summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-04-05 20:01:10 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-04-05 20:01:10 +0200
commitc3b63b831cd2c64700e875b28540212c7c881ac6 (patch)
treeedd98fcbd2004d3b562904f822bf6c3322fc7f52
parentd432e068a21c815d5d5e7bcbc1cc8c6e77a7d1e0 (diff)
parentcc07da9cb4d6e7a53f8d953427ffc2bca2e0c2df (diff)
downloaduxp-c3b63b831cd2c64700e875b28540212c7c881ac6.tar.gz
Merge branch 'master' into 816
-rw-r--r--CLOBBER2
-rw-r--r--Makefile.in2
-rw-r--r--accessible/atk/Platform.cpp4
-rw-r--r--accessible/tests/mochitest/common.js1
-rw-r--r--accessible/tests/mochitest/elm/test_nsApplicationAcc.html2
-rw-r--r--accessible/tests/mochitest/treeupdate/test_contextmenu.xul6
-rw-r--r--accessible/tests/mochitest/treeupdate/test_menu.xul4
-rw-r--r--application/basilisk/Makefile.in3
-rw-r--r--application/basilisk/app/permissions2
-rw-r--r--application/basilisk/app/profile/basilisk.js64
-rw-r--r--application/basilisk/base/content/aboutRobots-icon.pngbin9817 -> 0 bytes
-rw-r--r--application/basilisk/base/content/aboutRobots-widget-left.pngbin2224 -> 0 bytes
-rw-r--r--application/basilisk/base/content/aboutRobots.xhtml108
-rw-r--r--application/basilisk/base/content/browser-context.inc16
-rw-r--r--application/basilisk/base/content/browser-fullScreenAndPointerLock.js35
-rw-r--r--application/basilisk/base/content/browser-menubar.inc9
-rw-r--r--application/basilisk/base/content/browser.js134
-rw-r--r--application/basilisk/base/content/browser.xul11
-rw-r--r--application/basilisk/base/content/content.js6
-rw-r--r--application/basilisk/base/content/nsContextMenu.js34
-rw-r--r--application/basilisk/base/content/tab-content.js38
-rw-r--r--application/basilisk/base/content/tabbrowser.xml198
-rw-r--r--application/basilisk/base/content/urlbarBindings.xml22
-rw-r--r--application/basilisk/base/content/utilityOverlay.js101
-rw-r--r--application/basilisk/base/jar.mn7
-rw-r--r--application/basilisk/branding/shared/uaoverrides.inc2
-rw-r--r--application/basilisk/components/about/AboutRedirector.cpp5
-rw-r--r--application/basilisk/components/build/nsModule.cpp1
-rw-r--r--application/basilisk/components/contextualidentity/content/usercontext.css91
-rw-r--r--application/basilisk/components/contextualidentity/jar.mn6
-rw-r--r--application/basilisk/components/contextualidentity/moz.build7
-rw-r--r--application/basilisk/components/customizableui/CustomizableWidgets.jsm85
-rw-r--r--application/basilisk/components/moz.build4
-rw-r--r--application/basilisk/components/preferences/connection.js2
-rw-r--r--application/basilisk/components/preferences/connection.xul6
-rw-r--r--application/basilisk/components/preferences/containers.js176
-rw-r--r--application/basilisk/components/preferences/containers.xul52
-rw-r--r--application/basilisk/components/preferences/cookies.js39
-rw-r--r--application/basilisk/components/preferences/cookies.xul4
-rw-r--r--application/basilisk/components/preferences/handlers.css4
-rw-r--r--application/basilisk/components/preferences/handlers.xml23
-rw-r--r--application/basilisk/components/preferences/in-content/advanced.js19
-rw-r--r--application/basilisk/components/preferences/in-content/advanced.xul13
-rw-r--r--application/basilisk/components/preferences/in-content/containers.js73
-rw-r--r--application/basilisk/components/preferences/in-content/containers.xul54
-rw-r--r--application/basilisk/components/preferences/in-content/jar.mn1
-rw-r--r--application/basilisk/components/preferences/in-content/preferences.js1
-rw-r--r--application/basilisk/components/preferences/in-content/preferences.xul11
-rw-r--r--application/basilisk/components/preferences/in-content/privacy.js88
-rw-r--r--application/basilisk/components/preferences/in-content/privacy.xul25
-rw-r--r--application/basilisk/components/preferences/jar.mn2
-rw-r--r--application/basilisk/components/sessionstore/ContentRestore.jsm4
-rw-r--r--application/basilisk/components/sessionstore/SessionHistory.jsm3
-rw-r--r--application/basilisk/components/sessionstore/SessionStore.jsm42
-rw-r--r--application/basilisk/components/sessionstore/TabState.jsm4
-rw-r--r--application/basilisk/components/webextensions/.eslintrc.js22
-rw-r--r--application/basilisk/components/webextensions/ext-bookmarks.js374
-rw-r--r--application/basilisk/components/webextensions/ext-browserAction.js531
-rw-r--r--application/basilisk/components/webextensions/ext-c-contextMenus.js158
-rw-r--r--application/basilisk/components/webextensions/ext-c-omnibox.js32
-rw-r--r--application/basilisk/components/webextensions/ext-c-tabs.js35
-rw-r--r--application/basilisk/components/webextensions/ext-commands.js264
-rw-r--r--application/basilisk/components/webextensions/ext-contextMenus.js537
-rw-r--r--application/basilisk/components/webextensions/ext-desktop-runtime.js26
-rw-r--r--application/basilisk/components/webextensions/ext-history.js246
-rw-r--r--application/basilisk/components/webextensions/ext-omnibox.js104
-rw-r--r--application/basilisk/components/webextensions/ext-pageAction.js290
-rw-r--r--application/basilisk/components/webextensions/ext-sessions.js92
-rw-r--r--application/basilisk/components/webextensions/ext-tabs.js1093
-rw-r--r--application/basilisk/components/webextensions/ext-utils.js1239
-rw-r--r--application/basilisk/components/webextensions/ext-windows.js231
-rw-r--r--application/basilisk/components/webextensions/extension-mac-panel.css3
-rw-r--r--application/basilisk/components/webextensions/extension-mac.css11
-rw-r--r--application/basilisk/components/webextensions/extension-win-panel.css5
-rw-r--r--application/basilisk/components/webextensions/extension.css572
-rw-r--r--application/basilisk/components/webextensions/extension.svg19
-rw-r--r--application/basilisk/components/webextensions/extensions-browser.manifest31
-rw-r--r--application/basilisk/components/webextensions/jar.mn29
-rw-r--r--application/basilisk/components/webextensions/moz.build14
-rw-r--r--application/basilisk/components/webextensions/schemas/LICENSE27
-rw-r--r--application/basilisk/components/webextensions/schemas/bookmarks.json568
-rw-r--r--application/basilisk/components/webextensions/schemas/browser_action.json430
-rw-r--r--application/basilisk/components/webextensions/schemas/commands.json148
-rw-r--r--application/basilisk/components/webextensions/schemas/context_menus.json424
-rw-r--r--application/basilisk/components/webextensions/schemas/context_menus_internal.json78
-rw-r--r--application/basilisk/components/webextensions/schemas/history.json316
-rw-r--r--application/basilisk/components/webextensions/schemas/jar.mn16
-rw-r--r--application/basilisk/components/webextensions/schemas/moz.build7
-rw-r--r--application/basilisk/components/webextensions/schemas/omnibox.json248
-rw-r--r--application/basilisk/components/webextensions/schemas/page_action.json235
-rw-r--r--application/basilisk/components/webextensions/schemas/sessions.json146
-rw-r--r--application/basilisk/components/webextensions/schemas/tabs.json1295
-rw-r--r--application/basilisk/components/webextensions/schemas/windows.json508
-rw-r--r--application/basilisk/configure.in13
-rw-r--r--application/basilisk/confvars.sh5
-rw-r--r--application/basilisk/extensions/pdfjs/content/PdfJs.jsm23
-rw-r--r--application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm38
-rw-r--r--application/basilisk/installer/package-manifest.in26
-rw-r--r--application/basilisk/installer/windows/Makefile.in6
-rw-r--r--application/basilisk/installer/windows/nsis/defines.nsi.in4
-rw-r--r--application/basilisk/installer/windows/nsis/installer.nsi131
-rw-r--r--application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi332
-rw-r--r--application/basilisk/installer/windows/nsis/shared.nsh93
-rw-r--r--application/basilisk/installer/windows/nsis/uninstaller.nsi18
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd29
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/browser.properties31
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd24
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties31
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd1
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd1
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties14
-rw-r--r--application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd7
-rw-r--r--application/basilisk/locales/en-US/installer/custom.properties4
-rw-r--r--application/basilisk/locales/jar.mn3
-rw-r--r--application/basilisk/modules/ContentClick.jsm5
-rw-r--r--application/basilisk/modules/ProcessHangMonitor.jsm2
-rw-r--r--application/basilisk/themes/shared/incontentprefs/containers.css32
-rw-r--r--application/basilisk/themes/shared/incontentprefs/preferences.inc.css3
-rw-r--r--application/basilisk/themes/shared/jar.inc.mn2
-rw-r--r--application/basilisk/themes/shared/preferences/containers.css53
-rw-r--r--application/palemoon/app/profile/palemoon.js45
-rw-r--r--application/palemoon/base/content/aboutDialog.css71
-rw-r--r--application/palemoon/base/content/aboutDialog.js530
-rw-r--r--application/palemoon/base/content/aboutDialog.xul73
-rw-r--r--application/palemoon/base/content/aboutRobots-icon.pngbin9817 -> 0 bytes
-rw-r--r--application/palemoon/base/content/aboutRobots-widget-left.pngbin2224 -> 0 bytes
-rw-r--r--application/palemoon/base/content/aboutRobots.xhtml108
-rw-r--r--application/palemoon/base/content/baseMenuOverlay.xul10
-rw-r--r--application/palemoon/base/content/browser-appmenu.inc9
-rw-r--r--application/palemoon/base/content/browser-context.inc7
-rw-r--r--application/palemoon/base/content/browser-fullScreen.js37
-rw-r--r--application/palemoon/base/content/browser-menudragging.js26
-rw-r--r--application/palemoon/base/content/browser-title.css14
-rw-r--r--application/palemoon/base/content/browser.js25
-rw-r--r--application/palemoon/base/content/browser.xul3
-rw-r--r--application/palemoon/base/content/content.js2
-rw-r--r--application/palemoon/base/content/nsContextMenu.js5
-rw-r--r--application/palemoon/base/content/palemoon.xhtml6
-rw-r--r--application/palemoon/base/content/tabbrowser.xml37
-rw-r--r--application/palemoon/base/content/urlbarBindings.xml4
-rw-r--r--application/palemoon/base/content/utilityOverlay.js133
-rw-r--r--application/palemoon/base/jar.mn3
-rw-r--r--application/palemoon/branding/official/content/about-background.jpgbin0 -> 111893 bytes
-rw-r--r--application/palemoon/branding/official/content/about-background.pngbin151947 -> 0 bytes
-rw-r--r--application/palemoon/branding/official/content/about-wordmark.pngbin2197 -> 11708 bytes
-rw-r--r--application/palemoon/branding/official/content/about-wordmark.svg141
-rw-r--r--application/palemoon/branding/official/content/aboutDialog.css56
-rw-r--r--application/palemoon/branding/official/content/jar.mn2
-rw-r--r--application/palemoon/branding/shared/pref/preferences.inc8
-rw-r--r--application/palemoon/branding/shared/pref/uaoverrides.inc4
-rw-r--r--application/palemoon/branding/unofficial/content/about-background.pngbin67058 -> 95145 bytes
-rw-r--r--application/palemoon/branding/unofficial/content/about-wordmark.pngbin251 -> 0 bytes
-rw-r--r--application/palemoon/branding/unofficial/content/about-wordmark.svg8
-rw-r--r--application/palemoon/branding/unofficial/content/aboutDialog.css15
-rw-r--r--application/palemoon/branding/unofficial/content/jar.mn1
-rw-r--r--application/palemoon/branding/unstable/content/about-background.jpgbin0 -> 115006 bytes
-rw-r--r--application/palemoon/branding/unstable/content/about-background.pngbin330757 -> 0 bytes
-rw-r--r--application/palemoon/branding/unstable/content/about-wordmark.pngbin2197 -> 11708 bytes
-rw-r--r--application/palemoon/branding/unstable/content/about-wordmark.svg8
-rw-r--r--application/palemoon/branding/unstable/content/aboutDialog.css56
-rw-r--r--application/palemoon/branding/unstable/content/jar.mn2
-rw-r--r--application/palemoon/components/BrowserComponents.manifest1
-rw-r--r--application/palemoon/components/nsAboutRedirector.js4
-rw-r--r--application/palemoon/components/places/content/places.js4
-rw-r--r--application/palemoon/components/preferences/connection.js2
-rw-r--r--application/palemoon/components/preferences/connection.xul6
-rw-r--r--application/palemoon/components/preferences/newtaburl.js36
-rw-r--r--application/palemoon/components/preferences/tabs.js29
-rw-r--r--application/palemoon/config/version.txt2
-rw-r--r--application/palemoon/confvars.sh1
-rw-r--r--application/palemoon/installer/package-manifest.in7
-rw-r--r--application/palemoon/installer/windows/Makefile.in17
-rw-r--r--application/palemoon/installer/windows/nsis/defines.nsi.in4
-rw-r--r--application/palemoon/installer/windows/nsis/installer.nsi131
-rw-r--r--application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi332
-rw-r--r--application/palemoon/installer/windows/nsis/shared.nsh93
-rw-r--r--application/palemoon/installer/windows/nsis/uninstaller.nsi18
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd29
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd1
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/browser.dtd6
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/browser.properties16
-rw-r--r--application/palemoon/locales/en-US/chrome/browser/palemoon.dtd17
-rw-r--r--application/palemoon/locales/jar.mn1
-rw-r--r--application/palemoon/themes/linux/browser.css11
-rw-r--r--application/palemoon/themes/osx/browser.css11
-rw-r--r--application/palemoon/themes/windows/browser.css25
-rw-r--r--application/xulrunner/confvars.sh4
-rw-r--r--build/gyp.mozbuild1
-rw-r--r--config/external/nss/Makefile.in19
-rw-r--r--config/milestone.txt2
-rw-r--r--config/rules.mk9
-rw-r--r--db/sqlite3/src/sqlite3.c9120
-rw-r--r--db/sqlite3/src/sqlite3.h81
-rw-r--r--devtools/client/menus.js3
-rw-r--r--devtools/client/responsive.html/docs/browser-swap.md3
-rw-r--r--devtools/client/responsive.html/manager.js16
-rw-r--r--devtools/client/shared/curl.js1
-rw-r--r--devtools/client/styleeditor/test/browser.ini1
-rw-r--r--devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js63
-rw-r--r--devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js72
-rw-r--r--devtools/server/actors/moz.build2
-rw-r--r--devtools/server/actors/stylesheets.js13
-rw-r--r--devtools/server/actors/webbrowser.js18
-rw-r--r--devtools/shared/jsinspector/nsJSInspector.cpp1
-rw-r--r--docshell/base/SerializedLoadContext.cpp1
-rw-r--r--docshell/base/moz.build2
-rw-r--r--docshell/base/nsAboutRedirector.cpp1
-rw-r--r--docshell/base/nsDSURIContentListener.cpp1
-rw-r--r--docshell/base/nsDocShell.cpp1
-rw-r--r--docshell/base/nsDocShellEditorData.cpp1
-rw-r--r--docshell/base/timeline/ObservedDocShell.h1
-rw-r--r--docshell/base/timeline/TimelineConsumers.h3
-rw-r--r--docshell/base/timeline/TimelineMarker.cpp2
-rw-r--r--docshell/base/timeline/moz.build2
-rw-r--r--docshell/shistory/moz.build2
-rw-r--r--docshell/shistory/nsSHEntry.cpp1
-rw-r--r--docshell/shistory/nsSHEntryShared.h1
-rw-r--r--dom/animation/AnimationEffectReadOnly.cpp1
-rw-r--r--dom/animation/AnimationTimeline.cpp1
-rw-r--r--dom/base/Attr.cpp2
-rw-r--r--dom/base/CustomElementRegistry.cpp1
-rw-r--r--dom/base/DOMException.cpp1
-rw-r--r--dom/base/DOMIntersectionObserver.cpp1
-rwxr-xr-xdom/base/File.cpp1
-rw-r--r--dom/base/FormData.cpp1
-rw-r--r--dom/base/FragmentOrElement.cpp4
-rw-r--r--dom/base/Location.cpp5
-rw-r--r--dom/base/Navigator.cpp1
-rw-r--r--dom/base/Pose.cpp1
-rw-r--r--dom/base/ProcessGlobal.cpp1
-rw-r--r--dom/base/nsAttrAndChildArray.cpp9
-rw-r--r--dom/base/nsContentList.cpp1
-rw-r--r--dom/base/nsContentUtils.h4
-rw-r--r--dom/base/nsDOMAttributeMap.cpp1
-rw-r--r--dom/base/nsDOMMutationObserver.cpp1
-rw-r--r--dom/base/nsDocument.cpp4
-rw-r--r--dom/base/nsFrameMessageManager.cpp1
-rw-r--r--dom/base/nsGenericDOMDataNode.cpp4
-rw-r--r--dom/base/nsGlobalWindow.cpp1
-rw-r--r--dom/base/nsJSEnvironment.cpp19
-rw-r--r--dom/base/nsJSTimeoutHandler.cpp1
-rw-r--r--dom/base/nsMappedAttributes.h11
-rw-r--r--dom/base/nsRange.cpp1
-rw-r--r--dom/base/nsScriptLoader.cpp1
-rw-r--r--dom/base/nsWrapperCache.cpp2
-rw-r--r--dom/base/nsWrapperCache.h5
-rw-r--r--dom/bindings/BindingUtils.cpp10
-rw-r--r--dom/bindings/BindingUtils.h101
-rw-r--r--dom/bindings/CallbackObject.cpp1
-rw-r--r--dom/bindings/Codegen.py341
-rw-r--r--dom/bindings/Configuration.py2
-rw-r--r--dom/bindings/Exceptions.cpp1
-rw-r--r--dom/bindings/MozMap.h121
-rw-r--r--dom/bindings/Record.h91
-rw-r--r--dom/bindings/SimpleGlobalObject.cpp2
-rw-r--r--dom/bindings/moz.build2
-rw-r--r--dom/bindings/parser/WebIDL.py152
-rw-r--r--dom/browser-element/BrowserElementParent.js13
-rw-r--r--dom/canvas/CanvasRenderingContext2D.cpp25
-rw-r--r--dom/canvas/CanvasRenderingContext2D.h12
-rw-r--r--dom/canvas/ImageBitmap.cpp101
-rw-r--r--dom/canvas/ImageBitmap.h12
-rw-r--r--dom/canvas/ImageBitmapRenderingContext.cpp5
-rw-r--r--dom/canvas/ImageData.cpp1
-rw-r--r--dom/canvas/WebGLContext.h3
-rw-r--r--dom/canvas/WebGLTextureUpload.cpp22
-rw-r--r--dom/canvas/test/test_imagebitmap.html23
-rwxr-xr-xdom/console/Console.cpp1
-rw-r--r--dom/events/DOMEventTargetHelper.cpp1
-rw-r--r--dom/events/DataTransfer.cpp1
-rwxr-xr-xdom/events/Event.cpp1
-rw-r--r--dom/events/JSEventHandler.cpp1
-rw-r--r--dom/fetch/FetchDriver.cpp10
-rw-r--r--dom/fetch/Headers.cpp14
-rw-r--r--dom/fetch/Headers.h12
-rw-r--r--dom/fetch/InternalHeaders.cpp11
-rw-r--r--dom/fetch/InternalHeaders.h4
-rw-r--r--dom/filesystem/Directory.cpp1
-rw-r--r--dom/gamepad/GamepadServiceTest.cpp1
-rw-r--r--dom/html/HTMLCanvasElement.cpp2
-rw-r--r--dom/html/HTMLCanvasElement.h4
-rw-r--r--dom/html/HTMLFormControlsCollection.cpp1
-rw-r--r--dom/html/HTMLTableElement.cpp15
-rw-r--r--dom/html/HTMLTableSectionElement.cpp2
-rw-r--r--dom/html/nsDOMStringMap.cpp1
-rw-r--r--dom/html/nsTextEditorState.cpp6
-rw-r--r--dom/indexedDB/ActorsChild.cpp4
-rw-r--r--dom/indexedDB/IDBCursor.cpp1
-rw-r--r--dom/indexedDB/IDBFactory.cpp1
-rw-r--r--dom/indexedDB/IDBIndex.cpp1
-rw-r--r--dom/indexedDB/IDBKeyRange.cpp1
-rw-r--r--dom/indexedDB/IDBObjectStore.cpp1
-rw-r--r--dom/indexedDB/IDBRequest.cpp2
-rw-r--r--dom/indexedDB/IDBWrapperCache.cpp2
-rw-r--r--dom/ipc/ContentChild.h4
-rw-r--r--dom/ipc/TabChild.cpp1
-rw-r--r--dom/locales/en-US/chrome/security/security.properties2
-rw-r--r--dom/media/MediaManager.cpp11
-rw-r--r--dom/media/VideoFrameContainer.cpp12
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineAdapter.cpp10
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp101
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineDecryptor.h24
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineUtils.cpp4
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineUtils.h10
-rw-r--r--dom/media/gmp/widevine-adapter/WidevineVideoDecoder.h2
-rw-r--r--dom/media/gmp/widevine-adapter/content_decryption_module.h289
-rw-r--r--dom/media/gmp/widevine-adapter/content_decryption_module_export.h22
-rw-r--r--dom/media/gmp/widevine-adapter/content_decryption_module_ext.h64
-rw-r--r--dom/media/webaudio/AudioBuffer.cpp1
-rw-r--r--dom/media/webaudio/AudioParam.cpp1
-rw-r--r--dom/media/webaudio/MediaBufferDecoder.cpp1
-rw-r--r--dom/media/webaudio/WaveShaperNode.cpp1
-rw-r--r--dom/network/TCPSocketChild.cpp1
-rw-r--r--dom/performance/PerformanceMainThread.cpp1
-rw-r--r--dom/performance/PerformanceObserver.cpp1
-rw-r--r--dom/plugins/base/nptypes.h12
-rw-r--r--dom/plugins/base/nsPluginsDirUnix.cpp22
-rw-r--r--dom/promise/Promise.cpp2
-rw-r--r--dom/promise/PromiseCallback.cpp4
-rw-r--r--dom/push/PushSubscriptionOptions.cpp1
-rw-r--r--dom/security/nsContentSecurityManager.cpp56
-rw-r--r--dom/security/nsContentSecurityManager.h1
-rw-r--r--dom/smil/nsSMILAnimationController.cpp2
-rw-r--r--dom/svg/DOMSVGLength.cpp1
-rw-r--r--dom/svg/DOMSVGLengthList.cpp1
-rw-r--r--dom/svg/DOMSVGNumber.cpp1
-rw-r--r--dom/svg/DOMSVGNumberList.cpp1
-rw-r--r--dom/svg/DOMSVGPathSeg.cpp1
-rw-r--r--dom/svg/DOMSVGPathSegList.cpp1
-rw-r--r--dom/svg/DOMSVGPointList.cpp1
-rw-r--r--dom/svg/DOMSVGTransformList.cpp1
-rw-r--r--dom/svg/SVGTransform.cpp1
-rw-r--r--dom/svg/nsISVGPoint.cpp1
-rw-r--r--dom/svg/nsSVGElement.h1
-rw-r--r--dom/url/URLSearchParams.cpp51
-rw-r--r--dom/url/URLSearchParams.h19
-rw-r--r--dom/webidl/AddonEvent.webidl12
-rw-r--r--dom/webidl/AddonManager.webidl91
-rw-r--r--dom/webidl/Headers.webidl2
-rw-r--r--dom/webidl/InstallTrigger.webidl2
-rw-r--r--dom/webidl/TestInterfaceJS.webidl2
-rw-r--r--dom/webidl/URLSearchParams.webidl3
-rw-r--r--dom/webidl/moz.build6
-rw-r--r--dom/worklet/WorkletGlobalScope.cpp2
-rw-r--r--dom/xbl/nsXBLDocumentInfo.cpp2
-rw-r--r--dom/xslt/xpath/XPathResult.cpp1
-rw-r--r--dom/xslt/xpath/txUnaryExpr.cpp9
-rw-r--r--dom/xslt/xslt/txMozillaStylesheetCompiler.cpp4
-rw-r--r--dom/xul/nsXULElement.cpp1
-rw-r--r--editor/libeditor/tests/test_htmleditor_keyevent_handling.html2
-rw-r--r--editor/reftests/xul/platform.js2
-rw-r--r--gfx/2d/2D.h3
-rw-r--r--gfx/2d/Types.h10
-rw-r--r--gfx/cairo/libpixman/src/pixman.h2
-rw-r--r--gfx/ipc/GPUParent.cpp1
-rw-r--r--gfx/ipc/moz.build1
-rw-r--r--gfx/qcms/qcmstypes.h2
-rw-r--r--gfx/skia/skia/include/core/SkPath.h2
-rw-r--r--gfx/skia/skia/src/core/SkPath.cpp8
-rw-r--r--gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp11
-rw-r--r--gfx/thebes/gfxFontconfigFonts.cpp7
-rw-r--r--image/DecoderFactory.cpp7
-rw-r--r--image/DecoderFactory.h1
-rw-r--r--image/decoders/nsBMPDecoder.cpp40
-rw-r--r--image/decoders/nsBMPDecoder.h9
-rw-r--r--image/imgFrame.cpp2
-rw-r--r--ipc/glue/GeckoChildProcessHost.cpp2
-rw-r--r--ipc/glue/moz.build1
-rw-r--r--js/public/LegacyIntTypes.h10
-rw-r--r--js/public/Value.h7
-rw-r--r--js/src/Makefile.in21
-rw-r--r--js/src/builtin/TestingFunctions.cpp4
-rw-r--r--js/src/ctypes/CTypes.cpp4
-rw-r--r--js/src/ctypes/libffi/testsuite/libffi.call/float2.c10
-rw-r--r--js/src/gc/Memory.cpp85
-rw-r--r--js/src/gc/Nursery.cpp1
-rw-r--r--js/src/gc/Nursery.h1
-rw-r--r--js/src/jit/AliasAnalysisShared.cpp3
-rw-r--r--js/src/jit/IonAnalysis.cpp21
-rw-r--r--js/src/jit/JitOptions.cpp2
-rw-r--r--js/src/jit/MIR.h7
-rw-r--r--js/src/jit/StupidAllocator.cpp1
-rw-r--r--js/src/jsapi-tests/testGCAllocator.cpp12
-rw-r--r--js/src/jsapi.cpp3
-rw-r--r--js/src/jsapi.h32
-rw-r--r--js/src/jsfun.cpp68
-rw-r--r--js/src/jsgc.cpp11
-rw-r--r--js/src/jsnativestack.cpp29
-rw-r--r--js/src/jsstr.cpp5
-rw-r--r--js/src/jstypes.h8
-rw-r--r--js/src/jswrapper.h2
-rw-r--r--js/src/moz.build8
-rw-r--r--js/src/old-configure.in4
-rw-r--r--js/src/proxy/OpaqueCrossCompartmentWrapper.cpp8
-rw-r--r--js/src/proxy/ScriptedProxyHandler.cpp4
-rw-r--r--js/src/vm/Interpreter.cpp14
-rw-r--r--js/src/vm/Interpreter.h3
-rw-r--r--js/src/vm/ObjectGroup.cpp1
-rw-r--r--js/src/vm/Time.cpp11
-rw-r--r--js/src/wasm/WasmSignalHandlers.cpp2
-rw-r--r--js/xpconnect/loader/mozJSSubScriptLoader.cpp1
-rw-r--r--js/xpconnect/src/Sandbox.cpp1
-rw-r--r--js/xpconnect/src/XPCJSContext.cpp4
-rw-r--r--js/xpconnect/src/XPCShellImpl.cpp13
-rw-r--r--js/xpconnect/src/nsScriptErrorWithStack.cpp1
-rw-r--r--js/xpconnect/wrappers/WaiveXrayWrapper.cpp31
-rw-r--r--js/xpconnect/wrappers/WaiveXrayWrapper.h2
-rw-r--r--js/xpconnect/wrappers/XrayWrapper.cpp14
-rw-r--r--js/xpconnect/wrappers/XrayWrapper.h2
-rw-r--r--layout/base/nsCSSRendering.cpp215
-rw-r--r--layout/base/nsDisplayList.cpp22
-rw-r--r--layout/base/nsDisplayList.h8
-rw-r--r--layout/base/nsLayoutUtils.cpp131
-rw-r--r--layout/base/nsLayoutUtils.h14
-rw-r--r--layout/base/nsPresShell.cpp10
-rw-r--r--layout/generic/nsAbsoluteContainingBlock.cpp28
-rw-r--r--layout/generic/nsLineBox.h92
-rw-r--r--layout/generic/nsSelection.cpp1
-rw-r--r--layout/generic/nsTextFrame.cpp2
-rw-r--r--layout/inspector/inDOMUtils.cpp2
-rw-r--r--layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001-ref.html27
-rw-r--r--layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001.html30
-rw-r--r--layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002-ref.html27
-rw-r--r--layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002.html38
-rw-r--r--layout/reftests/w3c-css/submitted/flexbox/reftest.list4
-rw-r--r--layout/style/Declaration.cpp39
-rw-r--r--layout/style/FontFace.cpp1
-rw-r--r--layout/style/Loader.cpp4
-rw-r--r--layout/style/MediaQueryList.cpp1
-rw-r--r--layout/style/StyleAnimationValue.cpp4
-rw-r--r--layout/style/StyleRule.cpp4
-rw-r--r--layout/style/nsCSSDataBlock.cpp2
-rw-r--r--layout/style/nsCSSKeywordList.h1
-rw-r--r--layout/style/nsCSSParser.cpp31
-rw-r--r--layout/style/nsCSSPropAliasList.h2
-rw-r--r--layout/style/nsCSSPropList.h20
-rw-r--r--layout/style/nsCSSProps.cpp62
-rw-r--r--layout/style/nsCSSProps.h3
-rw-r--r--layout/style/nsCSSRules.cpp3
-rw-r--r--layout/style/nsComputedDOMStyle.cpp61
-rw-r--r--layout/style/nsComputedDOMStyle.h12
-rw-r--r--layout/style/nsComputedDOMStylePropertyList.h2
-rw-r--r--layout/style/nsROCSSPrimitiveValue.cpp1
-rw-r--r--layout/style/nsRuleNode.cpp43
-rw-r--r--layout/style/nsStyleConsts.h47
-rw-r--r--layout/style/nsStyleStruct.cpp8
-rw-r--r--layout/style/nsStyleStruct.h8
-rw-r--r--layout/svg/nsCSSClipPathInstance.cpp116
-rw-r--r--layout/svg/nsCSSClipPathInstance.h4
-rw-r--r--layout/svg/nsSVGIntegrationUtils.cpp144
-rw-r--r--layout/svg/nsSVGMaskFrame.cpp3
-rw-r--r--layout/svg/nsSVGUtils.cpp23
-rw-r--r--layout/xul/BoxObject.cpp1
-rw-r--r--layout/xul/tree/nsTreeColumns.cpp1
-rw-r--r--media/libcubeb/src/cubeb.c2
-rw-r--r--media/libcubeb/src/cubeb_audiounit.cpp2
-rw-r--r--memory/mozjemalloc/jemalloc.c27
-rw-r--r--memory/mozjemalloc/moz.build5
-rw-r--r--mfbt/RangedPtr.h2
-rw-r--r--mobile/android/components/AddonUpdateService.js12
-rw-r--r--modules/libpref/Preferences.cpp3
-rw-r--r--modules/libpref/init/all.js17
-rw-r--r--modules/libpref/nsIPrefBranch.idl24
-rw-r--r--modules/libpref/nsPrefBranch.cpp57
-rw-r--r--modules/libpref/test/unit/test_defaultValues.js48
-rw-r--r--modules/libpref/test/unit/xpcshell.ini1
-rw-r--r--netwerk/base/nsProtocolProxyService.cpp7
-rw-r--r--netwerk/base/nsStandardURL.h1
-rw-r--r--netwerk/base/nsUDPSocket.cpp1
-rw-r--r--netwerk/base/security-prefs.js14
-rw-r--r--netwerk/mime/nsMimeTypes.h3
-rw-r--r--netwerk/protocol/ftp/FTPChannelChild.cpp41
-rw-r--r--netwerk/protocol/ftp/nsFtpConnectionThread.cpp81
-rw-r--r--netwerk/protocol/http/AlternateServices.cpp7
-rw-r--r--netwerk/protocol/http/HttpBaseChannel.cpp5
-rw-r--r--netwerk/protocol/http/HttpBaseChannel.h3
-rw-r--r--netwerk/protocol/http/TunnelUtils.cpp67
-rw-r--r--netwerk/protocol/http/TunnelUtils.h11
-rw-r--r--netwerk/protocol/http/nsHttpChannel.cpp14
-rw-r--r--netwerk/protocol/http/nsHttpChannel.h3
-rw-r--r--netwerk/protocol/http/nsHttpConnection.cpp21
-rw-r--r--netwerk/protocol/http/nsHttpConnection.h3
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp67
-rw-r--r--netwerk/protocol/http/nsHttpHandler.h20
-rw-r--r--netwerk/sctp/datachannel/DataChannel.cpp11
-rw-r--r--netwerk/test/mochitests/mochitest.ini2
-rw-r--r--netwerk/test/mochitests/test_accept_header.html106
-rw-r--r--netwerk/test/mochitests/test_accept_header.sjs48
-rw-r--r--old-configure.in47
-rw-r--r--other-licenses/7zstub/LICENSE7
-rw-r--r--other-licenses/7zstub/README.mcp71
-rw-r--r--other-licenses/7zstub/ReleaseD/7zSD.sfx.exebin0 -> 155136 bytes
-rw-r--r--other-licenses/7zstub/customizations.diff363
-rw-r--r--other-licenses/7zstub/palemoon/7zSD.manifest29
-rw-r--r--other-licenses/7zstub/palemoon/7zSD.sfxbin231936 -> 156672 bytes
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.h64
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.cpp443
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.h71
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zExtract.cpp265
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.cpp161
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.h57
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.cpp757
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.h234
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.cpp19
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.h96
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zIn.cpp1294
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zIn.h288
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zItem.h181
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.cpp76
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.h29
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.cpp174
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.h36
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.cpp166
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.h22
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Archive.def3
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.cpp121
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.h168
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.cpp359
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.h121
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.cpp15
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.h31
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.cpp242
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.h130
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.cpp59
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.h24
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.cpp23
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.h33
-rw-r--r--other-licenses/7zstub/src/7zip/Archive/IArchive.h173
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.cpp249
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.h96
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.cpp139
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.h17
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/Main.cpp561
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsp696
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsw29
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.h10
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/makefile156
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.h8
-rw-r--r--other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.rc18
-rw-r--r--other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.cpp57
-rw-r--r--other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.h10
-rw-r--r--other-licenses/7zstub/src/7zip/Common/FileStreams.cpp251
-rw-r--r--other-licenses/7zstub/src/7zip/Common/FileStreams.h98
-rw-r--r--other-licenses/7zstub/src/7zip/Common/InBuffer.cpp80
-rw-r--r--other-licenses/7zstub/src/7zip/Common/InBuffer.h76
-rw-r--r--other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.cpp122
-rw-r--r--other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.h55
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LSBFDecoder.cpp34
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LSBFDecoder.h127
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LSBFEncoder.cpp29
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LSBFEncoder.h51
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LimitedStreams.cpp24
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LimitedStreams.h23
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LockedStream.cpp23
-rw-r--r--other-licenses/7zstub/src/7zip/Common/LockedStream.h38
-rw-r--r--other-licenses/7zstub/src/7zip/Common/MSBFDecoder.h69
-rw-r--r--other-licenses/7zstub/src/7zip/Common/MSBFEncoder.h59
-rw-r--r--other-licenses/7zstub/src/7zip/Common/OffsetStream.cpp35
-rw-r--r--other-licenses/7zstub/src/7zip/Common/OffsetStream.h25
-rw-r--r--other-licenses/7zstub/src/7zip/Common/OutBuffer.cpp116
-rw-r--r--other-licenses/7zstub/src/7zip/Common/OutBuffer.h64
-rw-r--r--other-licenses/7zstub/src/7zip/Common/ProgressUtils.cpp58
-rw-r--r--other-licenses/7zstub/src/7zip/Common/ProgressUtils.h43
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StdAfx.h9
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StreamBinder.cpp162
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StreamBinder.h37
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StreamObjects.cpp102
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StreamObjects.h156
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StreamUtils.cpp44
-rw-r--r--other-licenses/7zstub/src/7zip/Common/StreamUtils.h11
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.cpp18
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.h54
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/BranchTypes.h15
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.c101
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.h13
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/x86.cpp18
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/x86.h19
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.cpp412
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.h133
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.cpp52
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.h31
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.cpp17
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.h56
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/LZMA/LZMA.h82
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.cpp337
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.h251
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoder.h205
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.cpp80
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.h120
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBitTree.h161
-rw-r--r--other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderOpt.h31
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/FormatUtils.cpp40
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/FormatUtils.h18
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp175
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h129
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/StdAfx.h16
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.h3
-rw-r--r--other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.rc20
-rw-r--r--other-licenses/7zstub/src/7zip/GuiCommon.rc37
-rw-r--r--other-licenses/7zstub/src/7zip/ICoder.h163
-rw-r--r--other-licenses/7zstub/src/7zip/IPassword.h26
-rw-r--r--other-licenses/7zstub/src/7zip/IProgress.h32
-rw-r--r--other-licenses/7zstub/src/7zip/IStream.h62
-rw-r--r--other-licenses/7zstub/src/7zip/MyVersion.h8
-rw-r--r--other-licenses/7zstub/src/7zip/MyVersionInfo.rc41
-rw-r--r--other-licenses/7zstub/src/7zip/PropID.h51
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp117
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.h87
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.cpp359
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.h66
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/DefaultName.cpp23
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/DefaultName.h11
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.cpp528
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.h134
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.cpp45
-rw-r--r--other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.h24
-rw-r--r--other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.cpp53
-rw-r--r--other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.h30
-rw-r--r--other-licenses/7zstub/src/Asm/arm/7zCrcOpt.asm100
-rw-r--r--other-licenses/7zstub/src/Asm/x86/7zAsm.asm147
-rw-r--r--other-licenses/7zstub/src/Asm/x86/7zCrcOpt.asm147
-rw-r--r--other-licenses/7zstub/src/Asm/x86/AesOpt.asm237
-rw-r--r--other-licenses/7zstub/src/Asm/x86/LzmaDecOpt.asm1258
-rw-r--r--other-licenses/7zstub/src/Asm/x86/XzCrc64Opt.asm205
-rw-r--r--other-licenses/7zstub/src/C/7z.h202
-rw-r--r--other-licenses/7zstub/src/C/7zAlloc.c80
-rw-r--r--other-licenses/7zstub/src/C/7zAlloc.h19
-rw-r--r--other-licenses/7zstub/src/C/7zArcIn.c1771
-rw-r--r--other-licenses/7zstub/src/C/7zBuf.c36
-rw-r--r--other-licenses/7zstub/src/C/7zBuf.h35
-rw-r--r--other-licenses/7zstub/src/C/7zBuf2.c52
-rw-r--r--other-licenses/7zstub/src/C/7zCrc.c128
-rw-r--r--other-licenses/7zstub/src/C/7zCrc.h25
-rw-r--r--other-licenses/7zstub/src/C/7zCrcOpt.c115
-rw-r--r--other-licenses/7zstub/src/C/7zDec.c591
-rw-r--r--other-licenses/7zstub/src/C/7zFile.c286
-rw-r--r--other-licenses/7zstub/src/C/7zFile.h83
-rw-r--r--other-licenses/7zstub/src/C/7zStream.c176
-rw-r--r--other-licenses/7zstub/src/C/7zTypes.h374
-rw-r--r--other-licenses/7zstub/src/C/7zVersion.h27
-rw-r--r--other-licenses/7zstub/src/C/7zVersion.rc55
-rw-r--r--other-licenses/7zstub/src/C/Aes.c306
-rw-r--r--other-licenses/7zstub/src/C/Aes.h38
-rw-r--r--other-licenses/7zstub/src/C/AesOpt.c184
-rw-r--r--other-licenses/7zstub/src/C/Alloc.c455
-rw-r--r--other-licenses/7zstub/src/C/Alloc.h51
-rw-r--r--other-licenses/7zstub/src/C/Bcj2.c257
-rw-r--r--other-licenses/7zstub/src/C/Bcj2.h146
-rw-r--r--other-licenses/7zstub/src/C/Bcj2Enc.c311
-rw-r--r--other-licenses/7zstub/src/C/Bra.c230
-rw-r--r--other-licenses/7zstub/src/C/Bra.h64
-rw-r--r--other-licenses/7zstub/src/C/Bra86.c82
-rw-r--r--other-licenses/7zstub/src/C/BraIA64.c53
-rw-r--r--other-licenses/7zstub/src/C/Compiler.h33
-rw-r--r--other-licenses/7zstub/src/C/CpuArch.c200
-rw-r--r--other-licenses/7zstub/src/C/CpuArch.h335
-rw-r--r--other-licenses/7zstub/src/C/Delta.c64
-rw-r--r--other-licenses/7zstub/src/C/Delta.h19
-rw-r--r--other-licenses/7zstub/src/C/DllSecur.c87
-rw-r--r--other-licenses/7zstub/src/C/DllSecur.h19
-rw-r--r--other-licenses/7zstub/src/C/LzFind.c1069
-rw-r--r--other-licenses/7zstub/src/C/LzFind.h121
-rw-r--r--other-licenses/7zstub/src/C/LzFindMt.c820
-rw-r--r--other-licenses/7zstub/src/C/LzFindMt.h101
-rw-r--r--other-licenses/7zstub/src/C/LzHash.h57
-rw-r--r--other-licenses/7zstub/src/C/Lzma2Dec.c488
-rw-r--r--other-licenses/7zstub/src/C/Lzma2Dec.h120
-rw-r--r--other-licenses/7zstub/src/C/Lzma2DecMt.c1082
-rw-r--r--other-licenses/7zstub/src/C/Lzma2DecMt.h79
-rw-r--r--other-licenses/7zstub/src/C/Lzma2Enc.c803
-rw-r--r--other-licenses/7zstub/src/C/Lzma2Enc.h55
-rw-r--r--other-licenses/7zstub/src/C/Lzma86.h111
-rw-r--r--other-licenses/7zstub/src/C/Lzma86Dec.c54
-rw-r--r--other-licenses/7zstub/src/C/Lzma86Enc.c106
-rw-r--r--other-licenses/7zstub/src/C/LzmaDec.c1185
-rw-r--r--other-licenses/7zstub/src/C/LzmaDec.h234
-rw-r--r--other-licenses/7zstub/src/C/LzmaEnc.c2787
-rw-r--r--other-licenses/7zstub/src/C/LzmaEnc.h76
-rw-r--r--other-licenses/7zstub/src/C/LzmaLib.c40
-rw-r--r--other-licenses/7zstub/src/C/LzmaLib.h131
-rw-r--r--other-licenses/7zstub/src/C/MtCoder.c601
-rw-r--r--other-licenses/7zstub/src/C/MtCoder.h141
-rw-r--r--other-licenses/7zstub/src/C/MtDec.c1137
-rw-r--r--other-licenses/7zstub/src/C/MtDec.h201
-rw-r--r--other-licenses/7zstub/src/C/Ppmd.h85
-rw-r--r--other-licenses/7zstub/src/C/Ppmd7.c712
-rw-r--r--other-licenses/7zstub/src/C/Ppmd7.h142
-rw-r--r--other-licenses/7zstub/src/C/Ppmd7Dec.c191
-rw-r--r--other-licenses/7zstub/src/C/Ppmd7Enc.c187
-rw-r--r--other-licenses/7zstub/src/C/Precomp.h10
-rw-r--r--other-licenses/7zstub/src/C/RotateDefs.h30
-rw-r--r--other-licenses/7zstub/src/C/Sha256.c248
-rw-r--r--other-licenses/7zstub/src/C/Sha256.h26
-rw-r--r--other-licenses/7zstub/src/C/Sort.c141
-rw-r--r--other-licenses/7zstub/src/C/Sort.h18
-rw-r--r--other-licenses/7zstub/src/C/Threads.c95
-rw-r--r--other-licenses/7zstub/src/C/Threads.h68
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/7z.dsp241
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/7z.dsw29
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/7zMain.c686
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/Precomp.c4
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/Precomp.h10
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/makefile40
-rw-r--r--other-licenses/7zstub/src/C/Util/7z/makefile.gcc75
-rw-r--r--other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.c258
-rw-r--r--other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsp168
-rw-r--r--other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsw29
-rw-r--r--other-licenses/7zstub/src/C/Util/Lzma/makefile28
-rw-r--r--other-licenses/7zstub/src/C/Util/Lzma/makefile.gcc44
-rw-r--r--other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.def4
-rw-r--r--other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsp178
-rw-r--r--other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsw29
-rw-r--r--other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLibExports.c14
-rw-r--r--other-licenses/7zstub/src/C/Util/LzmaLib/makefile34
-rw-r--r--other-licenses/7zstub/src/C/Util/LzmaLib/resource.rc3
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.c4
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.h10
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.c640
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsp231
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsw29
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/makefile37
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/makefile_con38
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/resource.rc5
-rw-r--r--other-licenses/7zstub/src/C/Util/SfxSetup/setup.icobin0 -> 1078 bytes
-rw-r--r--other-licenses/7zstub/src/C/Xz.c90
-rw-r--r--other-licenses/7zstub/src/C/Xz.h460
-rw-r--r--other-licenses/7zstub/src/C/XzCrc64.c86
-rw-r--r--other-licenses/7zstub/src/C/XzCrc64.h26
-rw-r--r--other-licenses/7zstub/src/C/XzCrc64Opt.c69
-rw-r--r--other-licenses/7zstub/src/C/XzDec.c2773
-rw-r--r--other-licenses/7zstub/src/C/XzEnc.c1329
-rw-r--r--other-licenses/7zstub/src/C/XzEnc.h60
-rw-r--r--other-licenses/7zstub/src/C/XzIn.c319
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/7zip.mak240
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Aes.mak7
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.cpp (renamed from other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.cpp)0
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.h76
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.cpp567
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.h70
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.cpp678
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.h92
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zExtract.cpp423
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.cpp139
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.h61
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.cpp756
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.h181
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandlerOut.cpp939
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.cpp19
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.h148
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.cpp1663
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.h435
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zItem.h202
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.cpp901
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.h335
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.cpp174
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.h22
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zRegister.cpp21
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.cpp22
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.h35
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.cpp2497
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.h139
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.cpp (renamed from other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.cpp)0
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Archive.def12
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Archive2.def19
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/ArchiveExports.cpp151
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.cpp1124
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.h447
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.cpp17
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.h25
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.cpp232
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.h110
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.cpp46
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.h67
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.cpp88
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.h28
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.cpp191
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.h89
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp18
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.h37
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.h6
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Common/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/DllExports2.cpp122
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/IArchive.h608
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/Icons/7z.icobin0 -> 4710 bytes
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/LzmaHandler.cpp605
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/SplitHandler.cpp359
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.cpp1308
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.h11
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Asm.mak9
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsp1901
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsw29
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/makefile158
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/resource.rc7
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/makefile96
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/resource.rc5
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/makefile116
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/resource.rc5
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp799
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp477
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw29
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile59
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile.gcc195
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/resource.rc3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp715
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/7z.icobin0 -> 1078 bytes
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsp912
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsw29
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SfxCon.cpp482
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/makefile135
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/resource.rc5
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp246
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h86
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp137
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h11
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp803
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw29
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp596
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.h13
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/makefile117
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc18
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/setup.ico (renamed from other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/setup.ico)bin25214 -> 25214 bytes
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/7z.icobin0 -> 1078 bytes
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsp988
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsw29
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SfxWin.cpp241
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.h14
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/makefile153
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.h1
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.rc50
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.cpp250
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.h120
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.cpp536
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.h192
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.cpp46
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.h10
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.cpp475
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.h166
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.cpp418
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.h235
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.cpp163
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.h92
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.cpp127
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.h48
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.cpp367
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.h252
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.h6
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/MethodId.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/MethodId.h10
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.cpp509
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.h264
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.cpp39
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.h26
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.cpp111
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.h66
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.cpp51
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.h35
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/PropId.cpp108
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/RegisterArc.h78
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/RegisterCodec.h106
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.cpp156
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.h60
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.cpp285
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.h157
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.cpp56
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.h13
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.cpp57
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.h26
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.cpp48
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.h24
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.cpp666
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.h120
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Register.cpp24
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.cpp24
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.h31
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/BcjRegister.cpp17
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.cpp23
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.h35
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/BranchRegister.cpp41
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/ByteSwap.cpp92
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/CodecExports.cpp344
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.cpp120
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.h49
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/CopyRegister.cpp15
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/DeltaFilter.cpp128
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.cpp265
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.h96
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.cpp122
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.h42
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Register.cpp22
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.cpp343
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.h113
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.cpp182
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.h46
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/LzmaRegister.cpp22
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.cpp170
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.h86
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.cpp152
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.h58
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/PpmdRegister.cpp22
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.cpp150
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.h92
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.cpp245
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.h46
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crc.mak8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crc64.mak8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.cpp280
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.h118
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/7zAesRegister.cpp17
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.cpp112
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.h57
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/MyAesReg.cpp16
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.cpp124
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.h21
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Crypto/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/GuiCommon.rc84
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/Guid.txt220
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/ICoder.h399
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/IDecl.h28
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/IPassword.h23
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/IProgress.h19
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/IStream.h127
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/LzmaDec.mak5
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/MyVersion.h2
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/MyVersionInfo.rc2
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/PropID.h127
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/SubBuild.mak3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.cpp993
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsp235
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsw29
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/makefile28
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Client7z/resource.rc3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.cpp1281
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.h136
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp1691
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.h403
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.cpp78
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.h13
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp154
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.h112
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.cpp3492
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.h72
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.cpp37
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.h11
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/DirItem.h190
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.cpp1086
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.h41
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ExitCode.h27
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.cpp482
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.h94
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractMode.h34
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.cpp280
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.h31
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.cpp347
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.h106
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/IFileExtractCallback.h114
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.cpp1074
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.h424
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.cpp3550
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.h436
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.cpp668
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.h18
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Property.h14
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.cpp80
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.h10
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.cpp25
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.h10
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.cpp19
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.h16
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.cpp1667
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.h200
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.cpp64
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.h66
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.cpp771
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.h162
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.cpp233
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.h27
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.cpp70
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.h55
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.cpp94
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.h26
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Common/ZipRegistry.h130
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.cpp41
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.h14
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.mak36
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.manifest13
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.cpp69
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.h33
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp825
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.h164
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.cpp367
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.h48
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/List.cpp1349
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/List.h27
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/Main.cpp1151
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/MainAr.cpp167
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.cpp115
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.h66
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.cpp183
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.h62
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp702
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.h124
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.cpp110
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.h27
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/makefile69
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Console/resource.rc7
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.cpp37
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.h16
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.cpp1025
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.h21
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialogRes.h9
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.cpp64
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.h28
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialogRes.h4
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/DialogSize.h16
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.cpp1033
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.h328
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.cpp28
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.h14
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/LangUtils.h40
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/MyWindowsNew.h76
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.cpp122
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.h69
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.rc91
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialogRes.h17
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.cpp58
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.h28
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.rc14
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialogRes.h5
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp197
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.h170
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.rc12
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.cpp1337
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.h351
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.rc40
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2Res.h48
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2a.rc80
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialogRes.h3
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.cpp23
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.h10
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyNameRes.h95
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.cpp255
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.h62
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resource.h177
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resourceGui.h15
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/Extract.rc59
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.cpp418
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.h113
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.rc98
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialogRes.h24
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.cpp278
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.h38
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractRes.h51
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/HashGUI.h27
-rw-r--r--other-licenses/7zstub/src/CPP/7zip/UI/GUI/resource2.h2
-rw-r--r--other-licenses/7zstub/src/CPP/Build.mak145
-rw-r--r--other-licenses/7zstub/src/CPP/Common/AutoPtr.h35
-rw-r--r--other-licenses/7zstub/src/CPP/Common/CRC.cpp7
-rw-r--r--other-licenses/7zstub/src/CPP/Common/C_FileIO.cpp92
-rw-r--r--other-licenses/7zstub/src/CPP/Common/C_FileIO.h53
-rw-r--r--other-licenses/7zstub/src/CPP/Common/ComTry.h21
-rw-r--r--other-licenses/7zstub/src/CPP/Common/CommandLineParser.cpp197
-rw-r--r--other-licenses/7zstub/src/CPP/Common/CommandLineParser.h63
-rw-r--r--other-licenses/7zstub/src/CPP/Common/Common.h43
-rw-r--r--other-licenses/7zstub/src/CPP/Common/CrcReg.cpp98
-rw-r--r--other-licenses/7zstub/src/CPP/Common/Defs.h15
-rw-r--r--other-licenses/7zstub/src/CPP/Common/DynamicBuffer.h64
-rw-r--r--other-licenses/7zstub/src/CPP/Common/IntToString.cpp193
-rw-r--r--other-licenses/7zstub/src/CPP/Common/IntToString.h28
-rw-r--r--other-licenses/7zstub/src/CPP/Common/Lang.h23
-rw-r--r--other-licenses/7zstub/src/CPP/Common/ListFileUtils.cpp117
-rw-r--r--other-licenses/7zstub/src/CPP/Common/ListFileUtils.h14
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyBuffer.h259
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyBuffer2.h45
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyCom.h277
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyException.h14
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyGuidDef.h54
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyInitGuid.h45
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyLinux.h42
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyString.cpp1659
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyString.h867
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyTypes.h35
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyUnknown.h17
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyVector.cpp3
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyVector.h634
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyWindows.cpp145
-rw-r--r--other-licenses/7zstub/src/CPP/Common/MyWindows.h231
-rw-r--r--other-licenses/7zstub/src/CPP/Common/NewHandler.cpp163
-rw-r--r--other-licenses/7zstub/src/CPP/Common/NewHandler.h88
-rw-r--r--other-licenses/7zstub/src/CPP/Common/Sha256Reg.cpp40
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StdInStream.cpp89
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StdInStream.h38
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StdOutStream.cpp163
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StdOutStream.h71
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StringConvert.cpp319
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StringConvert.h88
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StringToInt.cpp144
-rw-r--r--other-licenses/7zstub/src/CPP/Common/StringToInt.h21
-rw-r--r--other-licenses/7zstub/src/CPP/Common/TextConfig.cpp124
-rw-r--r--other-licenses/7zstub/src/CPP/Common/TextConfig.h19
-rw-r--r--other-licenses/7zstub/src/CPP/Common/UTFConvert.cpp288
-rw-r--r--other-licenses/7zstub/src/CPP/Common/UTFConvert.h12
-rw-r--r--other-licenses/7zstub/src/CPP/Common/Wildcard.cpp676
-rw-r--r--other-licenses/7zstub/src/CPP/Common/Wildcard.h149
-rw-r--r--other-licenses/7zstub/src/CPP/Common/XzCrc64Init.cpp7
-rw-r--r--other-licenses/7zstub/src/CPP/Common/XzCrc64Reg.cpp42
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/COM.h70
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/CommonDialog.cpp185
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/CommonDialog.h23
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.cpp66
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.h65
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/CommandBar.h52
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Dialog.cpp251
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Dialog.h170
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Edit.h19
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ImageList.cpp10
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ImageList.h87
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ListView.cpp155
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ListView.h146
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ProgressBar.h35
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.cpp143
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.h50
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ReBar.h34
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Static.h28
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/StatusBar.h42
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/ToolBar.h43
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Trackbar.h27
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Window2.cpp200
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Control/Window2.h51
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/DLL.cpp109
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/DLL.h58
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Defs.h17
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/ErrorMsg.cpp66
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/ErrorMsg.h15
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileDir.cpp714
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileDir.h117
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileFind.cpp749
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileFind.h161
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileIO.cpp432
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileIO.h212
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileLink.cpp440
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileMapping.cpp12
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileMapping.h66
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileName.cpp839
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileName.h115
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileSystem.cpp131
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/FileSystem.h27
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Handle.h37
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/MemoryLock.cpp97
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/MemoryLock.h40
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/NtCheck.h46
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/PropVariant.cpp347
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/PropVariant.h114
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/PropVariantConv.cpp138
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/PropVariantConv.h37
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Registry.cpp390
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Registry.h84
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/ResourceString.cpp103
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/ResourceString.h16
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/SecurityUtils.cpp181
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/SecurityUtils.h167
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Shell.cpp340
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Shell.h94
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/StdAfx.h8
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Synchronization.cpp10
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Synchronization.h164
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/System.cpp142
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/System.h40
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Thread.h38
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/TimeUtils.cpp213
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/TimeUtils.h32
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Window.cpp179
-rw-r--r--other-licenses/7zstub/src/CPP/Windows/Window.h284
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Common/CRC.cs55
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Common/CommandLineParser.cs274
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Common/InBuffer.cs72
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Common/OutBuffer.cs47
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZ/IMatchFinder.cs24
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzBinTree.cs367
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzInWindow.cs132
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzOutWindow.cs110
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaBase.cs76
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaDecoder.cs398
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaEncoder.cs1480
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs364
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj90
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln20
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaBench.cs340
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs29
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs70
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs42
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoder.cs234
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs117
-rw-r--r--other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs157
-rw-r--r--other-licenses/7zstub/src/CS/7zip/ICoder.cs157
-rw-r--r--other-licenses/7zstub/src/Common/Alloc.cpp118
-rw-r--r--other-licenses/7zstub/src/Common/Alloc.h29
-rw-r--r--other-licenses/7zstub/src/Common/Buffer.h77
-rw-r--r--other-licenses/7zstub/src/Common/CRC.cpp61
-rw-r--r--other-licenses/7zstub/src/Common/CRC.h36
-rw-r--r--other-licenses/7zstub/src/Common/ComTry.h17
-rw-r--r--other-licenses/7zstub/src/Common/CommandLineParser.cpp232
-rw-r--r--other-licenses/7zstub/src/Common/CommandLineParser.h72
-rw-r--r--other-licenses/7zstub/src/Common/Defs.h20
-rw-r--r--other-licenses/7zstub/src/Common/DynamicBuffer.h47
-rw-r--r--other-licenses/7zstub/src/Common/IntToString.cpp63
-rw-r--r--other-licenses/7zstub/src/Common/IntToString.h15
-rw-r--r--other-licenses/7zstub/src/Common/MyCom.h203
-rw-r--r--other-licenses/7zstub/src/Common/MyUnknown.h24
-rw-r--r--other-licenses/7zstub/src/Common/MyWindows.cpp113
-rw-r--r--other-licenses/7zstub/src/Common/MyWindows.h200
-rw-r--r--other-licenses/7zstub/src/Common/NewHandler.cpp116
-rw-r--r--other-licenses/7zstub/src/Common/NewHandler.h16
-rw-r--r--other-licenses/7zstub/src/Common/Random.cpp17
-rw-r--r--other-licenses/7zstub/src/Common/Random.h16
-rw-r--r--other-licenses/7zstub/src/Common/StdInStream.cpp78
-rw-r--r--other-licenses/7zstub/src/Common/StdInStream.h31
-rw-r--r--other-licenses/7zstub/src/Common/StdOutStream.cpp87
-rw-r--r--other-licenses/7zstub/src/Common/StdOutStream.h35
-rw-r--r--other-licenses/7zstub/src/Common/String.cpp198
-rw-r--r--other-licenses/7zstub/src/Common/String.h631
-rw-r--r--other-licenses/7zstub/src/Common/StringConvert.cpp93
-rw-r--r--other-licenses/7zstub/src/Common/StringConvert.h71
-rw-r--r--other-licenses/7zstub/src/Common/TextConfig.cpp137
-rw-r--r--other-licenses/7zstub/src/Common/TextConfig.h22
-rw-r--r--other-licenses/7zstub/src/Common/Types.h19
-rw-r--r--other-licenses/7zstub/src/Common/UTFConvert.cpp91
-rw-r--r--other-licenses/7zstub/src/Common/UTFConvert.h11
-rw-r--r--other-licenses/7zstub/src/Common/Vector.cpp74
-rw-r--r--other-licenses/7zstub/src/Common/Vector.h228
-rw-r--r--other-licenses/7zstub/src/Common/Wildcard.cpp462
-rw-r--r--other-licenses/7zstub/src/Common/Wildcard.h78
-rw-r--r--other-licenses/7zstub/src/DOC/7zC.txt114
-rw-r--r--other-licenses/7zstub/src/DOC/7zFormat.txt469
-rw-r--r--other-licenses/7zstub/src/DOC/Methods.txt167
-rw-r--r--other-licenses/7zstub/src/DOC/copying.txt504
-rw-r--r--other-licenses/7zstub/src/DOC/installer.txt166
-rw-r--r--other-licenses/7zstub/src/DOC/lzma-history.txt424
-rw-r--r--other-licenses/7zstub/src/DOC/lzma-sdk.txt357
-rw-r--r--other-licenses/7zstub/src/DOC/lzma-specification.txt1176
-rw-r--r--other-licenses/7zstub/src/DOC/lzma.txt758
-rw-r--r--other-licenses/7zstub/src/DOC/readme.txt226
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/CRC.java52
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/BinTree.java382
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/InWindow.java131
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/OutWindow.java85
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Base.java88
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Decoder.java329
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Encoder.java1416
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java55
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java99
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Decoder.java88
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Encoder.java151
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/ICodeProgress.java6
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/LzmaAlone.java253
-rw-r--r--other-licenses/7zstub/src/Java/SevenZip/LzmaBench.java392
-rw-r--r--other-licenses/7zstub/src/Windows/COM.cpp37
-rw-r--r--other-licenses/7zstub/src/Windows/COM.h57
-rw-r--r--other-licenses/7zstub/src/Windows/Control/Dialog.cpp145
-rw-r--r--other-licenses/7zstub/src/Windows/Control/Dialog.h141
-rw-r--r--other-licenses/7zstub/src/Windows/Control/ProgressBar.h41
-rw-r--r--other-licenses/7zstub/src/Windows/DLL.cpp115
-rw-r--r--other-licenses/7zstub/src/Windows/DLL.h54
-rw-r--r--other-licenses/7zstub/src/Windows/Defs.h18
-rw-r--r--other-licenses/7zstub/src/Windows/Error.cpp50
-rw-r--r--other-licenses/7zstub/src/Windows/Error.h33
-rw-r--r--other-licenses/7zstub/src/Windows/FileDir.cpp672
-rw-r--r--other-licenses/7zstub/src/Windows/FileDir.h189
-rw-r--r--other-licenses/7zstub/src/Windows/FileFind.cpp365
-rw-r--r--other-licenses/7zstub/src/Windows/FileFind.h176
-rw-r--r--other-licenses/7zstub/src/Windows/FileIO.cpp245
-rw-r--r--other-licenses/7zstub/src/Windows/FileIO.h98
-rw-r--r--other-licenses/7zstub/src/Windows/FileName.cpp111
-rw-r--r--other-licenses/7zstub/src/Windows/FileName.h43
-rw-r--r--other-licenses/7zstub/src/Windows/Handle.h37
-rw-r--r--other-licenses/7zstub/src/Windows/PropVariant.cpp310
-rw-r--r--other-licenses/7zstub/src/Windows/PropVariant.h57
-rw-r--r--other-licenses/7zstub/src/Windows/PropVariantConversions.cpp145
-rw-r--r--other-licenses/7zstub/src/Windows/PropVariantConversions.h14
-rw-r--r--other-licenses/7zstub/src/Windows/ResourceString.cpp53
-rw-r--r--other-licenses/7zstub/src/Windows/ResourceString.h20
-rw-r--r--other-licenses/7zstub/src/Windows/Synchronization.cpp17
-rw-r--r--other-licenses/7zstub/src/Windows/Synchronization.h114
-rw-r--r--other-licenses/7zstub/src/Windows/Thread.h52
-rw-r--r--other-licenses/7zstub/src/Windows/Time.h66
-rw-r--r--other-licenses/7zstub/src/Windows/Window.cpp169
-rw-r--r--other-licenses/7zstub/src/Windows/Window.h211
-rw-r--r--other-licenses/7zstub/src/bin/7zS2.sfxbin0 -> 34816 bytes
-rw-r--r--other-licenses/7zstub/src/bin/7zS2con.sfxbin0 -> 34816 bytes
-rw-r--r--other-licenses/7zstub/src/bin/7zSD.sfxbin0 -> 124928 bytes
-rw-r--r--other-licenses/7zstub/src/bin/7zdec.exebin0 -> 42496 bytes
-rw-r--r--other-licenses/7zstub/src/bin/7zr.exebin0 -> 518656 bytes
-rw-r--r--other-licenses/7zstub/src/bin/installer/config.txt5
-rw-r--r--other-licenses/7zstub/src/bin/installer/cr.bat5
-rw-r--r--other-licenses/7zstub/src/bin/lzma.exebin0 -> 106496 bytes
-rw-r--r--other-licenses/7zstub/src/bin/x64/7zr.exebin0 -> 798720 bytes
-rw-r--r--other-licenses/7zstub/uxp/7zSD.manifest29
-rw-r--r--other-licenses/7zstub/uxp/7zSD.sfxbin231936 -> 156672 bytes
-rw-r--r--security/manager/ssl/nsSTSPreloadList.errors3580
-rw-r--r--security/manager/ssl/nsSTSPreloadList.inc5020
-rw-r--r--security/manager/ssl/nsSiteSecurityService.cpp2
-rw-r--r--testing/web-platform/meta/MANIFEST.json173
-rw-r--r--testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-cr.html1
-rw-r--r--testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html21
-rw-r--r--testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-ref.html15
-rw-r--r--testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder.html22
-rw-r--r--testing/web-platform/tests/html/form-elements/the-textarea-element/support/placeholder.css6
-rw-r--r--testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-cr.html1
-rw-r--r--testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-crlf.html19
-rw-r--r--testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-ref.html5
-rw-r--r--testing/web-platform/tests/html/input/the-placeholder-attribute/multiline.html19
-rw-r--r--testing/web-platform/tests/lint.whitelist4
-rw-r--r--toolkit/components/blocklist/blocklist.manifest2
-rw-r--r--toolkit/components/blocklist/moz.build1
-rw-r--r--toolkit/components/blocklist/nsBlocklistService.js52
-rw-r--r--toolkit/components/blocklist/nsBlocklistServiceContent.js113
-rw-r--r--toolkit/components/build/nsToolkitCompsModule.cpp18
-rw-r--r--toolkit/components/downloads/moz.build7
-rw-r--r--toolkit/components/maintenanceservice/Makefile.in13
-rw-r--r--toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi275
-rw-r--r--toolkit/components/maintenanceservice/maintenanceservice.cpp391
-rw-r--r--toolkit/components/maintenanceservice/maintenanceservice.exe.manifest25
-rw-r--r--toolkit/components/maintenanceservice/maintenanceservice.h10
-rw-r--r--toolkit/components/maintenanceservice/maintenanceservice.rc86
-rw-r--r--toolkit/components/maintenanceservice/moz.build54
-rw-r--r--toolkit/components/maintenanceservice/resource.h20
-rw-r--r--toolkit/components/maintenanceservice/servicebase.cpp86
-rw-r--r--toolkit/components/maintenanceservice/servicebase.h22
-rw-r--r--toolkit/components/maintenanceservice/serviceinstall.cpp759
-rw-r--r--toolkit/components/maintenanceservice/serviceinstall.h21
-rw-r--r--toolkit/components/maintenanceservice/workmonitor.cpp758
-rw-r--r--toolkit/components/maintenanceservice/workmonitor.h5
-rw-r--r--toolkit/components/moz.build3
-rw-r--r--toolkit/components/osfile/NativeOSFileInternals.cpp1
-rw-r--r--toolkit/components/osfile/modules/osfile_unix_back.jsm15
-rw-r--r--toolkit/components/passwordmgr/nsLoginManagerPrompter.js72
-rw-r--r--toolkit/components/places/UnifiedComplete.js80
-rw-r--r--toolkit/components/places/mozIPlacesAutoComplete.idl8
-rw-r--r--toolkit/components/places/nsPlacesTables.h4
-rw-r--r--toolkit/components/places/nsPlacesTriggers.h3
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js8
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js53
-rw-r--r--toolkit/components/search/current/nsSearchService.js26
-rw-r--r--toolkit/components/search/orginal/nsSearchService.js26
-rw-r--r--toolkit/components/thumbnails/BackgroundPageThumbs.jsm43
-rw-r--r--toolkit/components/thumbnails/PageThumbs.jsm3
-rw-r--r--toolkit/components/thumbnails/moz.build4
-rw-r--r--toolkit/components/timermanager/nsUpdateTimerManager.js32
-rw-r--r--toolkit/components/webextensions/.eslintrc.js494
-rw-r--r--toolkit/components/webextensions/Extension.jsm902
-rw-r--r--toolkit/components/webextensions/ExtensionAPI.jsm81
-rw-r--r--toolkit/components/webextensions/ExtensionChild.jsm1058
-rw-r--r--toolkit/components/webextensions/ExtensionCommon.jsm679
-rw-r--r--toolkit/components/webextensions/ExtensionContent.jsm1050
-rw-r--r--toolkit/components/webextensions/ExtensionManagement.jsm321
-rw-r--r--toolkit/components/webextensions/ExtensionParent.jsm551
-rw-r--r--toolkit/components/webextensions/ExtensionStorage.jsm241
-rw-r--r--toolkit/components/webextensions/ExtensionTestCommon.jsm343
-rw-r--r--toolkit/components/webextensions/ExtensionUtils.jsm1216
-rw-r--r--toolkit/components/webextensions/ExtensionXPCShellUtils.jsm306
-rw-r--r--toolkit/components/webextensions/LegacyExtensionsUtils.jsm250
-rw-r--r--toolkit/components/webextensions/MessageChannel.jsm797
-rw-r--r--toolkit/components/webextensions/NativeMessaging.jsm443
-rw-r--r--toolkit/components/webextensions/Schemas.jsm2143
-rw-r--r--toolkit/components/webextensions/ext-alarms.js155
-rw-r--r--toolkit/components/webextensions/ext-backgroundPage.js147
-rw-r--r--toolkit/components/webextensions/ext-browser-content.js217
-rw-r--r--toolkit/components/webextensions/ext-c-backgroundPage.js45
-rw-r--r--toolkit/components/webextensions/ext-c-extension.js57
-rw-r--r--toolkit/components/webextensions/ext-c-runtime.js96
-rw-r--r--toolkit/components/webextensions/ext-c-storage.js62
-rw-r--r--toolkit/components/webextensions/ext-c-test.js188
-rw-r--r--toolkit/components/webextensions/ext-cookies.js484
-rw-r--r--toolkit/components/webextensions/ext-downloads.js799
-rw-r--r--toolkit/components/webextensions/ext-extension.js20
-rw-r--r--toolkit/components/webextensions/ext-i18n.js34
-rw-r--r--toolkit/components/webextensions/ext-idle.js94
-rw-r--r--toolkit/components/webextensions/ext-management.js109
-rw-r--r--toolkit/components/webextensions/ext-notifications.js161
-rw-r--r--toolkit/components/webextensions/ext-runtime.js134
-rw-r--r--toolkit/components/webextensions/ext-storage.js46
-rw-r--r--toolkit/components/webextensions/ext-topSites.js24
-rw-r--r--toolkit/components/webextensions/ext-webNavigation.js192
-rw-r--r--toolkit/components/webextensions/ext-webRequest.js115
-rw-r--r--toolkit/components/webextensions/extensions-toolkit.manifest49
-rw-r--r--toolkit/components/webextensions/jar.mn26
-rw-r--r--toolkit/components/webextensions/moz.build41
-rw-r--r--toolkit/components/webextensions/schemas/LICENSE27
-rw-r--r--toolkit/components/webextensions/schemas/alarms.json145
-rw-r--r--toolkit/components/webextensions/schemas/cookies.json224
-rw-r--r--toolkit/components/webextensions/schemas/downloads.json793
-rw-r--r--toolkit/components/webextensions/schemas/events.json322
-rw-r--r--toolkit/components/webextensions/schemas/experiments.json16
-rw-r--r--toolkit/components/webextensions/schemas/extension.json178
-rw-r--r--toolkit/components/webextensions/schemas/extension_types.json83
-rw-r--r--toolkit/components/webextensions/schemas/i18n.json132
-rw-r--r--toolkit/components/webextensions/schemas/idle.json70
-rw-r--r--toolkit/components/webextensions/schemas/jar.mn25
-rw-r--r--toolkit/components/webextensions/schemas/management.json250
-rw-r--r--toolkit/components/webextensions/schemas/manifest.json377
-rw-r--r--toolkit/components/webextensions/schemas/moz.build7
-rw-r--r--toolkit/components/webextensions/schemas/native_host_manifest.json37
-rw-r--r--toolkit/components/webextensions/schemas/notifications.json416
-rw-r--r--toolkit/components/webextensions/schemas/runtime.json590
-rw-r--r--toolkit/components/webextensions/schemas/storage.json229
-rw-r--r--toolkit/components/webextensions/schemas/test.json215
-rw-r--r--toolkit/components/webextensions/schemas/top_sites.json66
-rw-r--r--toolkit/components/webextensions/schemas/web_navigation.json387
-rw-r--r--toolkit/components/webextensions/schemas/web_request.json616
-rw-r--r--toolkit/components/webextensions/test/mochitest/.eslintrc.js35
-rw-r--r--toolkit/components/webextensions/test/mochitest/chrome.ini35
-rw-r--r--toolkit/components/webextensions/test/mochitest/chrome_head.js12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_WebNavigation_page1.html12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_WebNavigation_page2.html7
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_WebNavigation_page3.html9
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_WebRequest_page3.html11
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_csp.html14
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_csp.html^headers^1
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_ext_test_api_injection.js12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_image_bad.pngbin5401 -> 0 bytes
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_image_good.pngbin580 -> 0 bytes
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_image_redirect.pngbin5401 -> 0 bytes
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_mixed.html13
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_permission_xhr.html55
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_privilege_escalation.html13
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_sample.html12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_script_bad.js3
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_script_good.js3
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_script_redirect.js4
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_script_xhr.js5
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_style_bad.css3
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_style_good.css3
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_style_redirect.css3
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_teardown_test.js24
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect.html9
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html8
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html^headers^1
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_frameClientRedirect.html12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_frameRedirect.html12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe.html12
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page1.html8
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page2.html7
-rw-r--r--toolkit/components/webextensions/test/mochitest/file_with_about_blank.html10
-rw-r--r--toolkit/components/webextensions/test/mochitest/head.js13
-rw-r--r--toolkit/components/webextensions/test/mochitest/head_cookies.js167
-rw-r--r--toolkit/components/webextensions/test/mochitest/head_webrequest.js331
-rw-r--r--toolkit/components/webextensions/test/mochitest/mochitest.ini115
-rw-r--r--toolkit/components/webextensions/test/mochitest/redirection.sjs4
-rw-r--r--toolkit/components/webextensions/test/mochitest/return_headers.sjs20
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_debug_global.html166
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_page.html84
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_contentscript_unrecognizedprop_warning.html80
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_downloads_saveAs.html68
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html106
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_hybrid_addons.html141
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_idle.html64
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_shutdown_cleanup.html50
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_storage_cleanup.html164
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_trustworthy_origin.html53
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html83
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_ext_webrequest_background_events.html96
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_chrome_native_messaging_paths.html61
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_clipboard.html140
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_all_apis.js160
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_background_api_injection.html46
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_background_canvas.html47
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_background_generated_url.html47
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_background_teardown.html76
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_content_security_policy.html162
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript.html116
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_about_blank.html117
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_api_injection.html88
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_async_loading.html54
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_context.html81
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_create_iframe.html165
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_css.html48
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_devtools_metadata.html81
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_exporthelpers.html95
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_incognito.html89
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_permission.html59
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_contentscript_teardown.html96
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_cookies.html234
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_cookies_containers.html93
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_cookies_expiry.html72
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_bad.html112
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_good.html86
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_exclude_include_globs.html92
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_external_messaging.html111
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_generate.html49
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_geturl.html72
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_i18n.html432
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_i18n_css.html116
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_inIncognitoContext_window.html49
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_jsversion.html86
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_listener_proxies.html63
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_notifications.html224
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_permission_xhr.html119
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect.html83
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect2.html103
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect_twoway.html127
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_runtime_disconnect.html78
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_runtime_id.html61
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_sandbox_var.html60
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_schema.html73
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_doublereply.html101
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_no_receiver.html83
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply.html79
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply2.html181
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_storage_content.html330
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_storage_tab.html118
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_subframes_privileges.html202
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_tab_teardown.html150
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_test.html191
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_unload_frame.html170
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_web_accessible_resources.html353
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_webnavigation.html559
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_webnavigation_filters.html308
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_webrequest_background_events.html116
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_webrequest_basic.html327
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_webrequest_suspend.html216
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_webrequest_upload.html199
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_window_postMessage.html105
-rw-r--r--toolkit/components/webextensions/test/mochitest/test_ext_xhr_capabilities.html86
-rw-r--r--toolkit/components/webextensions/test/mochitest/webrequest_chromeworker.js8
-rw-r--r--toolkit/components/webextensions/test/mochitest/webrequest_test.jsm22
-rw-r--r--toolkit/components/webextensions/test/mochitest/webrequest_worker.js3
-rw-r--r--toolkit/components/webextensions/test/xpcshell/.eslintrc.js9
-rw-r--r--toolkit/components/webextensions/test/xpcshell/data/file_download.html12
-rw-r--r--toolkit/components/webextensions/test/xpcshell/data/file_download.txt1
-rw-r--r--toolkit/components/webextensions/test/xpcshell/head.js111
-rw-r--r--toolkit/components/webextensions/test/xpcshell/head_native_messaging.js131
-rw-r--r--toolkit/components/webextensions/test/xpcshell/head_sync.js67
-rw-r--r--toolkit/components/webextensions/test/xpcshell/native_messaging.ini13
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_csp_custom_policies.js38
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_csp_validator.js85
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_alarms.js210
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_alarms_does_not_fire.js33
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_alarms_periodic.js44
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_alarms_replaces.js44
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_api_permissions.js64
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_apimanager.js91
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_load_events.js23
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_reload.js24
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_global_history.js22
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js40
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_runtime_connect_params.js72
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_sub_windows.js45
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_background_window_properties.js34
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_contexts.js190
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_downloads.js76
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_downloads_download.js354
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_downloads_misc.js862
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_downloads_search.js402
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_experiments.js175
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_extension.js55
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_idle.js202
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_json_parser.js37
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_context.js168
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_embedding.js188
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_localStorage.js50
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_management.js20
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_management_uninstall_self.js135
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_manifest_content_security_policy.js30
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_manifest_incognito.js27
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_manifest_minimum_chrome_version.js13
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging.js514
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_perf.js128
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_unresponsive.js82
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_onmessage_removelistener.js30
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js23
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getBrowserInfo.js26
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js25
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js337
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage.js79
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_errors.js59
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js54
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_self.js51
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_schemas.js1427
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_schemas_allowed_contexts.js147
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_schemas_api_injection.js102
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_schemas_async.js232
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_simple.js69
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_storage.js334
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_ext_topSites.js85
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_getAPILevelForWindow.js55
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_locale_converter.js133
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_locale_data.js130
-rw-r--r--toolkit/components/webextensions/test/xpcshell/test_native_messaging.js302
-rw-r--r--toolkit/components/webextensions/test/xpcshell/xpcshell.ini69
-rw-r--r--toolkit/content/widgets/browser.xml90
-rw-r--r--toolkit/crashreporter/CrashReports.jsm91
-rw-r--r--toolkit/crashreporter/CrashSubmit.jsm570
-rw-r--r--toolkit/crashreporter/InjectCrashReporter.cpp84
-rw-r--r--toolkit/crashreporter/InjectCrashReporter.h28
-rw-r--r--toolkit/crashreporter/KeyValueParser.jsm54
-rw-r--r--toolkit/crashreporter/LoadLibraryRemote.cpp454
-rw-r--r--toolkit/crashreporter/LoadLibraryRemote.h24
-rw-r--r--toolkit/crashreporter/breakpad-patches/00-arm-exidx-rollup.patch1347
-rw-r--r--toolkit/crashreporter/breakpad-patches/README4
-rw-r--r--toolkit/crashreporter/breakpad-windows-libxul/moz.build32
-rw-r--r--toolkit/crashreporter/breakpad-windows-standalone/moz.build26
-rw-r--r--toolkit/crashreporter/client/Makefile.in20
-rw-r--r--toolkit/crashreporter/client/Throbber-small.avibin3584 -> 0 bytes
-rw-r--r--toolkit/crashreporter/client/crashreporter.cpp759
-rw-r--r--toolkit/crashreporter/client/crashreporter.exe.manifest37
-rw-r--r--toolkit/crashreporter/client/crashreporter.h158
-rw-r--r--toolkit/crashreporter/client/crashreporter.icobin25214 -> 0 bytes
-rwxr-xr-xtoolkit/crashreporter/client/crashreporter.rc148
-rw-r--r--toolkit/crashreporter/client/crashreporter_gtk_common.cpp453
-rw-r--r--toolkit/crashreporter/client/crashreporter_gtk_common.h50
-rw-r--r--toolkit/crashreporter/client/crashreporter_linux.cpp576
-rw-r--r--toolkit/crashreporter/client/crashreporter_osx.h107
-rw-r--r--toolkit/crashreporter/client/crashreporter_osx.mm922
-rw-r--r--toolkit/crashreporter/client/crashreporter_unix_common.cpp85
-rw-r--r--toolkit/crashreporter/client/crashreporter_win.cpp1568
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Info.plist32
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/PkgInfo2
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in8
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib102
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib18
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nibbin25518 -> 0 bytes
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/classes.nib102
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/info.nib18
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/keyedobjects.nibbin27032 -> 0 bytes
-rw-r--r--toolkit/crashreporter/client/macbuild/Contents/Resources/crashreporter.icnsbin61743 -> 0 bytes
-rw-r--r--toolkit/crashreporter/client/moz.build78
-rw-r--r--toolkit/crashreporter/client/resource.h37
-rw-r--r--toolkit/crashreporter/content/crashes.js179
-rw-r--r--toolkit/crashreporter/content/crashes.xhtml123
-rw-r--r--toolkit/crashreporter/crashreporter.mozbuild24
-rw-r--r--toolkit/crashreporter/docs/index.rst195
-rw-r--r--toolkit/crashreporter/google-breakpad/.gitignore82
-rw-r--r--toolkit/crashreporter/google-breakpad/AUTHORS1
-rw-r--r--toolkit/crashreporter/google-breakpad/ChangeLog0
-rw-r--r--toolkit/crashreporter/google-breakpad/DEPS75
-rw-r--r--toolkit/crashreporter/google-breakpad/GIT-INFO1
-rw-r--r--toolkit/crashreporter/google-breakpad/INSTALL370
-rw-r--r--toolkit/crashreporter/google-breakpad/LICENSE50
-rw-r--r--toolkit/crashreporter/google-breakpad/Makefile.am1510
-rw-r--r--toolkit/crashreporter/google-breakpad/Makefile.in8221
-rw-r--r--toolkit/crashreporter/google-breakpad/NEWS0
-rw-r--r--toolkit/crashreporter/google-breakpad/README.ANDROID139
-rw-r--r--toolkit/crashreporter/google-breakpad/README.md82
-rw-r--r--toolkit/crashreporter/google-breakpad/aclocal.m41297
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/android/common-functions.sh372
-rw-r--r--toolkit/crashreporter/google-breakpad/android/google_breakpad/Android.mk103
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/android/run-checks.sh555
-rw-r--r--toolkit/crashreporter/google-breakpad/android/sample_app/README32
-rw-r--r--toolkit/crashreporter/google-breakpad/android/sample_app/jni/Android.mk44
-rw-r--r--toolkit/crashreporter/google-breakpad/android/sample_app/jni/Application.mk32
-rw-r--r--toolkit/crashreporter/google-breakpad/android/sample_app/jni/test_breakpad.cpp57
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/android/test-driver131
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/android/test-shell.sh131
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/compile347
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/config.guess1447
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/config.sub1813
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/depcomp791
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/install-sh501
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/ltmain.sh8406
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/missing215
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/autotools/test-driver148
-rw-r--r--toolkit/crashreporter/google-breakpad/breakpad-client.pc.in10
-rw-r--r--toolkit/crashreporter/google-breakpad/breakpad.pc.in10
-rw-r--r--toolkit/crashreporter/google-breakpad/codereview.settings4
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/configure9255
-rw-r--r--toolkit/crashreporter/google-breakpad/configure.ac204
-rw-r--r--toolkit/crashreporter/google-breakpad/m4/ax_pthread.m4283
-rw-r--r--toolkit/crashreporter/google-breakpad/m4/libtool.m47377
-rw-r--r--toolkit/crashreporter/google-breakpad/m4/ltoptions.m4368
-rw-r--r--toolkit/crashreporter/google-breakpad/m4/ltsugar.m4123
-rw-r--r--toolkit/crashreporter/google-breakpad/m4/ltversion.m423
-rw-r--r--toolkit/crashreporter/google-breakpad/m4/lt~obsolete.m492
-rw-r--r--toolkit/crashreporter/google-breakpad/src/breakpad_googletest_includes.h57
-rw-r--r--toolkit/crashreporter/google-breakpad/src/build/all.gyp41
-rw-r--r--toolkit/crashreporter/google-breakpad/src/build/common.gypi1045
-rw-r--r--toolkit/crashreporter/google-breakpad/src/build/filename_rules.gypi57
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/build/gyp_breakpad67
-rw-r--r--toolkit/crashreporter/google-breakpad/src/build/testing.gypi90
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/apple/Framework/BreakpadDefines.h73
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.h246
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm916
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.xcodeproj/project.pbxproj578
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h141
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm354
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad_Prefix.pch7
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.h74
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm210
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc105
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.h65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc333
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.h135
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-amd.sym3
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-intel.sym3
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/mapping_info.h61
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.cc305
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.h91
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc259
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc789
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h278
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc1179
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/handler/microdump_extra_info.h52
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc87
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h149
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/log/log.cc84
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/log/log.h55
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc609
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.h65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc257
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set.h144
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set_unittest.cc164
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader.h106
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc78
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader.h131
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc169
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc258
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.h125
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc128
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc776
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h265
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc94
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc355
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.h92
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc470
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc1376
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h124
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc775
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc66
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h49
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h130
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc199
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/moz.build35
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/linux/sender/google_crash_report_sender.cc104
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj2788
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h285
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm1043
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad_Prefix.pch8
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Info.plist26
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.h145
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm189
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/UnitTests-Info.plist20
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.h83
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.mm167
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.h162
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm362
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/InspectorMain.mm65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h47
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc72
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc166
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h150
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build19
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc402
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.h47
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc573
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h319
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc854
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h281
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/mach_vm_compat.h48
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc1604
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.h236
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj841
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests32-Info.plist20
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests64-Info.plist22
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build22
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/obj-cTestCases-Info.plist20
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc92
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h85
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc79
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.h52
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc106
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h62
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.h46
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.mm60
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_dwarf_databin702795 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym5300
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/handler/ucontext_compat.h47
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/Breakpad.xib1140
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/Localizable.stringsbin2428 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/ReporterIcon.graffle2489
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender-Info.plist32
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h117
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.icnsbin170816 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m755
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.stringsbin2428 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/InfoPlist.stringsbin192 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.stringsbin2746 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.stringsbin184 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.stringsbin2578 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.stringsbin2694 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/goArrow.pngbin3591 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.stringsbin2590 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.stringsbin1792 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/Localizable.stringsbin2546 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/Localizable.stringsbin2484 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.stringsbin184 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.stringsbin2632 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.stringsbin156 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.stringsbin2588 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/InfoPlist.stringsbin168 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/Localizable.stringsbin2430 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.h89
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.mm636
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.h65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m261
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/InfoPlist.stringsbin192 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib3748
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Info.plist55
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.h37
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm95
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/bomb.icnsbin23659 -> 0 bytes
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashInMainbin12588 -> 0 bytes
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashduringloadbin12588 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/testapp/main.m34
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/BreakpadFramework_Test.mm217
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc398
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc713
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test.cc319
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test_helper.cc74
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/spawn_child_process.h149
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/mac/tests/testlogging.h9
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h97
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc350
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h272
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc179
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/moz.build18
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile78
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.cc258
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.h201
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler_test.cc119
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.cc786
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.h70
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_test.cc75
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build18
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.cc436
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.h160
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/breakpad_client.gyp66
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/common/auto_critical_section.h81
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/common/ipc_protocol.h181
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/ReadMe.txt58
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.cc223
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h177
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp63
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.cc405
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h182
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc931
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h299
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.cc579
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.h199
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild17
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc1073
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp47
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h524
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild14
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.cc142
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp46
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.h125
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mozbuild14
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.cc53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.h57
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.cc522
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp63
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.h35
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.icobin23558 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.rc144
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/resource.h73
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/small.icobin23558 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp80
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/crash_generation_server_test.cc305
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc184
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h102
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc582
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc327
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc501
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h61
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc333
-rw-r--r--toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp83
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/Makefile.in9
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext.S489
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext_unittest.cc186
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/elf.h168
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/link.h73
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/sgidefs.h41
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h100
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/sys/procfs.h124
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h35
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/sys/user.h85
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/include/ucontext.h56
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/testing/include/wchar.h76
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/testing/mkdtemp.h110
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/testing/pthread_fixes.h99
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/android/ucontext_constants.h144
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.cc487
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.h114
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.cc209
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.h119
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/basictypes.h58
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/byte_cursor.h265
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/byte_cursor_unittest.cc776
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/common.gyp250
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/convert_UTF.c554
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/convert_UTF.h164
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader-inl.h170
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc250
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h315
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader_unittest.cc707
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.cc198
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.h269
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc199
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h365
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc527
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2enums.h675
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc2734
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h1288
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc2468
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc487
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_test_common.h149
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.cc1273
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.h166
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc231
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h188
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h61
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build35
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf/types.h51
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc295
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h202
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module_unittest.cc306
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc1075
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h320
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc1804
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.cc143
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.h188
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module_unittest.cc391
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/language.cc83
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/language.h88
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/crc32.cc70
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/crc32.h53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc1159
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h86
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols_unittest.cc204
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/eintr_wrapper.h58
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.cc179
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h148
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump_unittest.cc256
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_gnu_compat.h46
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.cc178
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.h58
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module_unittest.cc370
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elfutils-inl.h74
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.cc194
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.h126
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/file_id.cc202
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/file_id.h87
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/file_id_unittest.cc338
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.cc202
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.h107
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader_test.cc170
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.cc104
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.h48
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc230
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.h90
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/ignore_ret.h40
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc241
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.h93
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.cc237
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.h96
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support_unittest.cc213
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.cc107
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.h87
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file_unittest.cc208
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/moz.build56
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.cc53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.h65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink_unittest.cc89
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.cc155
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.h59
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.cc263
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.h197
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf_unittest.cc413
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/tests/auto_testfile.h124
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.cc322
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.h117
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig52
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig32
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig34
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/GTMDefines.h456
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.h504
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.m611
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.h61
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m269
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h301
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm306
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.cc211
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.h47
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.cc42
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.h54
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/byteswap.h73
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.cc646
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h196
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc106
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/file_id.h81
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.cc84
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.h43
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc369
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h131
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc539
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.h460
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc1902
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.cc155
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.h95
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc268
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h119
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/moz.build52
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h56
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc84
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.h52
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/super_fat_arch.h88
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.h1110
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.m428
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/md5.cc251
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/md5.h27
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/memory.h249
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/memory_range.h145
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/memory_range_unittest.cc193
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/memory_unittest.cc124
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/minidump_type_helper.h56
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/module.cc348
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/module.h351
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc616
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/moz.build72
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/scoped_ptr.h404
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.cc45
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.h260
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary_unittest.cc308
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.cc681
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.h49
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.cc197
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.h66
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.cc84
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.h50
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/message_output.h54
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build34
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc315
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h325
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc611
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc197
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.h143
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc258
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/stdio_wrapper.h43
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc155
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/string_conversion.h68
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/symbol_data.h42
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc359
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/test_assembler.h484
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc1662
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/testdata/func-line-pairing.h676
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/tests/auto_tempdir.h100
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.cc153
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.h52
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/unordered.h62
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/using_std_string.h65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/common_windows.gyp105
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.cc92
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.h64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.cc76
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.h58
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.cc420
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.h129
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild15
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/omap.cc694
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/omap.h72
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/omap_internal.h137
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/omap_unittest.cc330
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.cc1369
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.h257
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/string_utils-inl.h142
-rw-r--r--toolkit/crashreporter/google-breakpad/src/common/windows/string_utils.cc133
-rw-r--r--toolkit/crashreporter/google-breakpad/src/config.h.in79
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/breakpad_types.h68
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_amd64.h235
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm.h151
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm64.h140
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_mips.h176
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc.h168
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc64.h134
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_sparc.h163
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_x86.h174
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_linux.h87
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_mac.h205
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_ps3.h67
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_solaris.h94
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_win32.h2264
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_format.h1045
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_size.h113
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/basic_source_line_resolver.h144
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/call_stack.h87
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_module.h101
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_modules.h111
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_context.h116
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_object.h53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/exploitability.h82
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/fast_source_line_resolver.h100
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/memory_region.h79
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump.h132
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump_processor.h63
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump.h1171
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump_processor.h147
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/proc_maps_linux.h60
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_result.h66
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_state.h198
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_base.h128
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_interface.h117
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame.h144
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_cpu.h405
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_symbolizer.h108
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stackwalker.h235
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/symbol_supplier.h99
-rw-r--r--toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/system_info.h106
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/address_map-inl.h93
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/address_map.h85
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/address_map_unittest.cc196
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/basic_code_module.h116
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.cc155
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.h98
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver.cc612
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_types.h177
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_unittest.cc682
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/call_stack.cc54
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info-inl.h119
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.cc186
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.h275
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info_unittest.cc546
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/contained_range_map-inl.h197
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/contained_range_map.h150
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/contained_range_map_unittest.cc263
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.cc240
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.h127
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86_unittest.cc233
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/dump_context.cc659
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/dump_object.cc39
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/exploitability.cc119
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.cc625
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.h129
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/exploitability_unittest.cc306
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.cc283
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.h55
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver.cc275
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_types.h185
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_unittest.cc491
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/linked_ptr.h193
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/logging.cc111
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/logging.h186
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/map_serializers-inl.h266
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/map_serializers.h168
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/map_serializers_unittest.cc386
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/microdump.cc385
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/microdump_processor.cc100
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/microdump_processor_unittest.cc273
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk.cc151
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_machine_readable_test43
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test43
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test_vars1
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/minidump.cc4989
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/minidump_dump.cc213
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/processor/minidump_dump_test36
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc1577
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/minidump_processor_unittest.cc645
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk.cc162
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_machine_readable_test37
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_test37
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc1521
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/module_comparer.cc302
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/module_comparer.h98
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/module_factory.h72
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/module_serializer.cc207
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/module_serializer.h127
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/moz.build66
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.cc56
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.h53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper_unittest.cc87
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator-inl.h363
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator.h179
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator_unittest.cc403
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc106
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux_unittest.cc251
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/process_state.cc69
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/processor.gyp184
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/processor_tools.gypi57
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/proto/README20
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/proto/process_state.proto210
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/range_map-inl.h272
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/range_map.h161
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/range_map_shrink_down_unittest.cc355
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/range_map_unittest.cc559
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/simple_serializer-inl.h260
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/simple_serializer.h63
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.cc204
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.h140
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base.cc341
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base_types.h158
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stack_frame_cpu.cc79
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stack_frame_symbolizer.cc138
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.cc950
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.h49
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker.cc296
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.cc92
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.h72
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list_unittest.cc197
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.cc340
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.h116
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc932
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.cc296
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.h107
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.cc278
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.h104
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64_unittest.cc880
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc974
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.cc448
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.h85
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips_unittest.cc707
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.cc146
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.h79
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.cc137
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.h77
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest.cc433
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest_sol.s111
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc139
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.h78
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_unittest_utils.h224
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.cc672
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.h117
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc2128
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_address_map-inl.h71
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_address_map.h78
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_address_map_unittest.cc236
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map-inl.h92
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map.h96
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map_unittest.cc320
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_map-inl.h176
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_map.h144
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator-inl.h147
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator.h112
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_map_unittest.cc386
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_range_map-inl.h130
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_range_map.h106
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/static_range_map_unittest.cc421
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.cc6418
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.h50
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc391
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h372
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc336
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest_data.h418
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/tokenize.cc79
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/tokenize.h63
-rw-r--r--toolkit/crashreporter/google-breakpad/src/processor/windows_frame_info.h209
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/COPYING22
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/curl.h1936
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/curlbuild.h202
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/curlrules.h249
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/curlver.h70
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/easy.h103
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/mprintf.h82
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/multi.h346
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/stdcheaders.h34
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/typecheck-gcc.h551
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/curl/types.h1
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/Makefile.am43
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/TODO43
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.c422
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.h13
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.c623
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.h506
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.c313
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.h11
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.c310
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.h13
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.c2939
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.h57
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.c425
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.h11
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.c234
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.h41
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.c13
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.h27
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdis.h832
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdisasm.gyp67
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/qword.h14
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/Makefile70
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/README128
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm.i508
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm_oop.i1114
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile-swig65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile.PL7
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/python/Makefile-swig64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/Makefile-swig68
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/extconf.rb4
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/tcl/Makefile-swig63
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_disasm.c210
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_format.c1430
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.c70
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.h18
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_insn.c182
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_misc.c71
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.c191
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.h8
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags.h533
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags_completions.h121
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/lss/codereview.settings5
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h4496
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/README2
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/architecture/byte_order.h45
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/i386/_types.h34
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/arch.h105
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/fat.h64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/loader.h1402
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/nlist.h312
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/boolean.h88
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/boolean.h74
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_param.h157
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_types.h140
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine.h346
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/boolean.h40
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_state.h9
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_status.h1
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/vm_types.h40
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/thread_status.h94
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/vm_prot.h140
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/musl/COPYRIGHT163
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/musl/README23
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/musl/README.breakpad3
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/musl/VERSION1
-rw-r--r--toolkit/crashreporter/google-breakpad/src/third_party/musl/include/elf.h2827
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/core2md/core2md.cc72
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc113
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build33
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc1276
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range.h89
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range_unittest.cc258
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/minidump_upload.cc153
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/sym_upload.cc112
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/linux/tools_linux.gypi83
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.mm408
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj587
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h111
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm316
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj1839
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc264
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc203
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build40
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m135
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m204
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj254
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/tools_mac.gypi116
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_constants.h61
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_reader.go65
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/upload_system_symbols.go420
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/python/filter_syms.py204
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/python/tests/filter_syms_unittest.py138
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile.in5
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/dump_syms.cc54
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build29
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/run_regtest.sh51
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs129
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym33
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/tools.gyp38
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/dump_syms.exebin130048 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/symupload.exebin195072 -> 0 bytes
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc576
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.gyp46
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.h219
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.cc61
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.gyp64
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc204
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build31
-rwxr-xr-xtoolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/run_regtest.sh53
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/refresh_binaries.bat27
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.cc259
-rw-r--r--toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.gyp45
-rw-r--r--toolkit/crashreporter/injector/injector.cpp40
-rw-r--r--toolkit/crashreporter/injector/moz.build26
-rw-r--r--toolkit/crashreporter/jar.mn7
-rw-r--r--toolkit/crashreporter/jsoncpp/AUTHORS1
-rw-r--r--toolkit/crashreporter/jsoncpp/GIT-INFO1
-rw-r--r--toolkit/crashreporter/jsoncpp/LICENSE55
-rw-r--r--toolkit/crashreporter/jsoncpp/NEWS.txt175
-rw-r--r--toolkit/crashreporter/jsoncpp/README.md214
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/allocator.h94
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/assertions.h54
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/autolink.h25
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/config.h178
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/features.h57
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/forwards.h37
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/json.h15
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/reader.h404
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/value.h867
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/version.h20
-rw-r--r--toolkit/crashreporter/jsoncpp/include/json/writer.h331
-rw-r--r--toolkit/crashreporter/jsoncpp/src/lib_json/json_reader.cpp2039
-rw-r--r--toolkit/crashreporter/jsoncpp/src/lib_json/json_tool.h111
-rw-r--r--toolkit/crashreporter/jsoncpp/src/lib_json/json_value.cpp1604
-rw-r--r--toolkit/crashreporter/jsoncpp/src/lib_json/json_valueiterator.inl167
-rw-r--r--toolkit/crashreporter/jsoncpp/src/lib_json/json_writer.cpp1218
-rw-r--r--toolkit/crashreporter/jsoncpp/src/lib_json/moz.build39
-rw-r--r--toolkit/crashreporter/mac_utils.h14
-rw-r--r--toolkit/crashreporter/mac_utils.mm41
-rw-r--r--toolkit/crashreporter/minidump-analyzer/minidump-analyzer.cpp437
-rw-r--r--toolkit/crashreporter/minidump-analyzer/moz.build34
-rw-r--r--toolkit/crashreporter/moz.build122
-rw-r--r--toolkit/crashreporter/nsExceptionHandler.cpp4101
-rw-r--r--toolkit/crashreporter/nsExceptionHandler.h279
-rw-r--r--toolkit/crashreporter/test/CrashTestUtils.jsm72
-rw-r--r--toolkit/crashreporter/test/browser/.eslintrc.js7
-rw-r--r--toolkit/crashreporter/test/browser/browser.ini8
-rw-r--r--toolkit/crashreporter/test/browser/browser_aboutCrashes.js27
-rw-r--r--toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js152
-rw-r--r--toolkit/crashreporter/test/browser/browser_bug471404.js41
-rw-r--r--toolkit/crashreporter/test/browser/browser_clearReports.js124
-rw-r--r--toolkit/crashreporter/test/browser/crashreport.sjs180
-rw-r--r--toolkit/crashreporter/test/browser/head.js139
-rw-r--r--toolkit/crashreporter/test/dumputils.cpp99
-rw-r--r--toolkit/crashreporter/test/moz.build40
-rw-r--r--toolkit/crashreporter/test/nsTestCrasher.cpp126
-rw-r--r--toolkit/crashreporter/test/unit/.eslintrc.js7
-rw-r--r--toolkit/crashreporter/test/unit/crasher_subprocess_head.js33
-rw-r--r--toolkit/crashreporter/test/unit/crasher_subprocess_tail.js15
-rw-r--r--toolkit/crashreporter/test/unit/head_crashreporter.js173
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_AsyncShutdown.js102
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_abort.js16
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure.js21
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js27
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_after_js_oom_recovered.js20
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported.js34
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported_2.js26
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_moz_crash.js16
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_oom.js19
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_purevirtual.js24
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_runtimeabort.js21
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_terminator.js40
-rw-r--r--toolkit/crashreporter/test/unit/test_crash_with_memory_report.js55
-rw-r--r--toolkit/crashreporter/test/unit/test_crashreporter.js85
-rw-r--r--toolkit/crashreporter/test/unit/test_crashreporter_appmem.js12
-rw-r--r--toolkit/crashreporter/test/unit/test_crashreporter_crash.js51
-rw-r--r--toolkit/crashreporter/test/unit/test_crashreporter_crash_profile_lock.js26
-rw-r--r--toolkit/crashreporter/test/unit/test_event_files.js56
-rw-r--r--toolkit/crashreporter/test/unit/test_oom_annotation_windows.js27
-rw-r--r--toolkit/crashreporter/test/unit/test_override_exception_handler.js12
-rw-r--r--toolkit/crashreporter/test/unit/xpcshell.ini37
-rw-r--r--toolkit/crashreporter/test/unit_ipc/.eslintrc.js7
-rw-r--r--toolkit/crashreporter/test/unit_ipc/test_content_annotation.js22
-rw-r--r--toolkit/crashreporter/test/unit_ipc/test_content_exception_time_annotation.js17
-rw-r--r--toolkit/crashreporter/test/unit_ipc/test_content_memory_list.js23
-rw-r--r--toolkit/crashreporter/test/unit_ipc/test_content_oom_annotation_windows.js23
-rw-r--r--toolkit/crashreporter/test/unit_ipc/xpcshell.ini15
-rwxr-xr-xtoolkit/crashreporter/tools/symbolstore.py1078
-rw-r--r--toolkit/crashreporter/tools/unit-symbolstore.py583
-rw-r--r--toolkit/crashreporter/tools/upload_symbols.py102
-rwxr-xr-xtoolkit/crashreporter/tools/win32/dump_syms_vc1600.exebin55296 -> 0 bytes
-rw-r--r--toolkit/crashreporter/tools/win32/dump_syms_vc1700.exebin52736 -> 0 bytes
-rw-r--r--toolkit/crashreporter/tools/win32/dump_syms_vc1800.exebin51200 -> 0 bytes
-rwxr-xr-xtoolkit/crashreporter/update-breakpad.sh65
-rw-r--r--toolkit/crashreporter/update-jsoncpp.sh62
-rw-r--r--toolkit/jetpack/moz.build10
-rw-r--r--toolkit/jetpack/sdk/addon/bootstrap.js5
-rw-r--r--toolkit/jetpack/sdk/webextension.js43
-rw-r--r--toolkit/library/moz.build9
-rw-r--r--toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd27
-rw-r--r--toolkit/locales/jar.mn2
-rw-r--r--toolkit/modules/AppConstants.jsm7
-rw-r--r--toolkit/modules/moz.build4
-rw-r--r--toolkit/moz.build16
-rw-r--r--toolkit/mozapps/extensions/content/newaddon.js13
-rw-r--r--toolkit/mozapps/extensions/jar.mn2
-rw-r--r--toolkit/mozapps/installer/windows/nsis/makensis.mk7
-rw-r--r--toolkit/mozapps/update/common/errors.h23
-rw-r--r--toolkit/mozapps/update/common/moz.build5
-rw-r--r--toolkit/mozapps/update/common/sources.mozbuild9
-rw-r--r--toolkit/mozapps/update/common/updatedefines.h4
-rw-r--r--toolkit/mozapps/update/content/updates.js28
-rw-r--r--toolkit/mozapps/update/nsUpdateService.js378
-rw-r--r--toolkit/mozapps/update/tests/TestAUSHelper.cpp10
-rw-r--r--toolkit/mozapps/update/tests/moz.build6
-rw-r--r--toolkit/mozapps/update/updater/updater.cpp363
-rw-r--r--toolkit/mozapps/webextensions/AddonContentPolicy.cpp478
-rw-r--r--toolkit/mozapps/webextensions/AddonContentPolicy.h22
-rw-r--r--toolkit/mozapps/webextensions/AddonManager.jsm3666
-rw-r--r--toolkit/mozapps/webextensions/AddonManagerWebAPI.cpp171
-rw-r--r--toolkit/mozapps/webextensions/AddonManagerWebAPI.h33
-rw-r--r--toolkit/mozapps/webextensions/AddonPathService.cpp258
-rw-r--r--toolkit/mozapps/webextensions/AddonPathService.h55
-rw-r--r--toolkit/mozapps/webextensions/GMPInstallManager.jsm523
-rw-r--r--toolkit/mozapps/webextensions/LightweightThemeManager.jsm909
-rw-r--r--toolkit/mozapps/webextensions/addonManager.js296
-rw-r--r--toolkit/mozapps/webextensions/amInstallTrigger.js240
-rw-r--r--toolkit/mozapps/webextensions/amWebAPI.js269
-rw-r--r--toolkit/mozapps/webextensions/amWebInstallListener.js348
-rw-r--r--toolkit/mozapps/webextensions/content/about.js103
-rw-r--r--toolkit/mozapps/webextensions/content/eula.js25
-rw-r--r--toolkit/mozapps/webextensions/content/extensions.css270
-rw-r--r--toolkit/mozapps/webextensions/content/extensions.js3827
-rw-r--r--toolkit/mozapps/webextensions/content/extensions.xml2008
-rw-r--r--toolkit/mozapps/webextensions/content/extensions.xul715
-rw-r--r--toolkit/mozapps/webextensions/content/newaddon.xul67
-rw-r--r--toolkit/mozapps/webextensions/content/setting.xml486
-rw-r--r--toolkit/mozapps/webextensions/content/update.js663
-rw-r--r--toolkit/mozapps/webextensions/content/update.xul194
-rw-r--r--toolkit/mozapps/webextensions/extensions.manifest18
-rw-r--r--toolkit/mozapps/webextensions/internal/APIExtensionBootstrap.js39
-rw-r--r--toolkit/mozapps/webextensions/internal/AddonConstants.jsm31
-rw-r--r--toolkit/mozapps/webextensions/internal/AddonRepository.jsm1988
-rw-r--r--toolkit/mozapps/webextensions/internal/AddonRepository_SQLiteMigrator.jsm522
-rw-r--r--toolkit/mozapps/webextensions/internal/GMPProvider.jsm699
-rw-r--r--toolkit/mozapps/webextensions/internal/LightweightThemeImageOptimizer.jsm180
-rw-r--r--toolkit/mozapps/webextensions/internal/PluginProvider.jsm600
-rw-r--r--toolkit/mozapps/webextensions/internal/WebExtensionBootstrap.js39
-rw-r--r--toolkit/mozapps/webextensions/internal/XPIProvider.jsm9217
-rw-r--r--toolkit/mozapps/webextensions/internal/XPIProviderUtils.js2239
-rw-r--r--toolkit/mozapps/webextensions/internal/moz.build31
-rw-r--r--toolkit/mozapps/webextensions/jar.mn35
-rw-r--r--toolkit/mozapps/webextensions/moz.build57
-rw-r--r--toolkit/themes/linux/mozapps/jar.mn18
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/category-available.pngbin1092 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/category-discover.pngbin1482 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/category-plugins.pngbin1172 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/category-recent.pngbin2020 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/category-search.pngbin2600 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/category-service.pngbin2063 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric-16.pngbin584 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric.pngbin1290 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/extensionGeneric-16.pngbin713 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/extensions.css42
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/heart.pngbin2949 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/localeGeneric.pngbin1860 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/newaddon.css5
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/themeGeneric-16.pngbin638 -> 0 bytes
-rw-r--r--toolkit/themes/linux/mozapps/webextensions/themeGeneric.pngbin1734 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/jar.mn40
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/about.css78
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/blocklist.css20
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/cancel.pngbin115 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-available.pngbin1671 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-dictionaries.pngbin1769 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-discover.pngbin1324 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-experiments.pngbin822 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-plugins.pngbin886 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-recent.pngbin1642 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-search.pngbin2600 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/category-service.pngbin2063 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric-16.pngbin742 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric.pngbin1769 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/discover-logo.pngbin12007 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/eula.css47
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/experimentGeneric.pngbin822 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/extensionGeneric-16.pngbin554 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/extensions.css51
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/heart.pngbin2949 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/localeGeneric.pngbin2410 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/newaddon.css5
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/rating-not-won.pngbin1559 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/rating-won.pngbin1662 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/search.pngbin423 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/themeGeneric-16.pngbin710 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/themeGeneric.pngbin2185 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/toolbarbutton-dropmarker.pngbin147 -> 0 bytes
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/update.css28
-rw-r--r--toolkit/themes/osx/mozapps/webextensions/xpinstallConfirm.css90
-rw-r--r--toolkit/themes/shared/non-mac.jar.inc.mn27
-rw-r--r--toolkit/themes/windows/global/arrow/arrow-lft-hov.gifbin0 -> 91 bytes
-rw-r--r--toolkit/themes/windows/global/arrow/arrow-rit-hov.gifbin0 -> 91 bytes
-rw-r--r--toolkit/themes/windows/mozapps/jar.mn18
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/about.css91
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/blocklist.css20
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/cancel.pngbin115 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/category-available.pngbin2235 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/category-discover.pngbin1355 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/category-plugins.pngbin962 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/category-recent.pngbin2251 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/category-search.pngbin2600 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/category-service.pngbin2063 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric-16.pngbin733 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric.pngbin1665 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/discover-logo.pngbin12007 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/eula.css47
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/experimentGeneric.pngbin822 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/extensionGeneric-16.pngbin418 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/extensions.css42
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/heart.pngbin2949 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/localeGeneric.pngbin2518 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/newaddon.css5
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/rating-not-won.pngbin1559 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/rating-won.pngbin1662 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/themeGeneric-16.pngbin837 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/themeGeneric.pngbin2094 -> 0 bytes
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/update.css28
-rw-r--r--toolkit/themes/windows/mozapps/webextensions/xpinstallConfirm.css101
-rw-r--r--toolkit/xre/moz.build1
-rw-r--r--toolkit/xre/nsAndroidStartup.cpp1
-rw-r--r--toolkit/xre/nsAppRunner.cpp14
-rw-r--r--toolkit/xre/nsEmbedFunctions.cpp1
-rw-r--r--toolkit/xre/nsSigHandlers.cpp55
-rw-r--r--toolkit/xre/nsUpdateDriver.cpp19
-rw-r--r--toolkit/xre/nsX11ErrorHandler.cpp1
-rw-r--r--uriloader/exthandler/win/nsOSHelperAppService.cpp192
-rw-r--r--widget/windows/moz.build1
-rw-r--r--widget/windows/nsClipboard.cpp58
-rw-r--r--widget/windows/nsDataObj.cpp126
-rw-r--r--widget/windows/nsImageClipboard.cpp497
-rw-r--r--widget/windows/nsImageClipboard.h93
-rw-r--r--widget/windows/nsNativeThemeWin.cpp2
-rw-r--r--xpcom/base/nsCycleCollector.cpp5
-rw-r--r--xpcom/base/nsCycleCollectorTraceJSHelpers.cpp5
-rw-r--r--xpcom/base/nsDebugImpl.cpp8
-rw-r--r--xpcom/base/nsMemoryReporterManager.cpp83
-rw-r--r--xpcom/base/nsObjCExceptions.h78
-rw-r--r--xpcom/build/nsXPCOMPrivate.h4
-rw-r--r--xpcom/ds/nsMathUtils.h4
-rw-r--r--xpcom/glue/nsCycleCollectionParticipant.h45
-rw-r--r--xpcom/glue/nsTArray.h18
-rw-r--r--xpcom/io/nsLocalFile.h7
-rw-r--r--xpcom/io/nsLocalFileUnix.cpp16
-rw-r--r--xpcom/io/nsLocalFileUnix.h5
-rw-r--r--xpcom/reflect/xptcall/md/unix/Makefile.in30
-rw-r--r--xpcom/reflect/xptcall/md/unix/moz.build82
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix.s129
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix64.s128
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s124
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s52
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s56
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s85
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s55
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix.cpp74
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix64.cpp63
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp131
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_sparcv9_solaris.cpp73
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp149
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_solaris.cpp67
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix.s.m4119
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix64.s.m497
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s49
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparcv9_solaris.s50
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_64_solaris_SUNW.s63
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_solaris_SUNW.s78
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix.cpp185
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix64.cpp172
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp112
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_sparcv9_solaris.cpp101
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_solaris.cpp139
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_x86_solaris.cpp77
-rw-r--r--xpcom/reflect/xptcall/status.html25
-rw-r--r--xpcom/threads/nsThread.cpp4
2685 files changed, 147622 insertions, 398780 deletions
diff --git a/CLOBBER b/CLOBBER
index 481f9e1dd8..e355625f5a 100644
--- a/CLOBBER
+++ b/CLOBBER
@@ -22,4 +22,4 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
-Clobber for NSPR+NSS update
+Clobber for maintenance service removal
diff --git a/Makefile.in b/Makefile.in
index 26cd688d48..4adf3ac9a7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -290,7 +290,7 @@ MAKE_SYM_STORE_PATH := $(DIST)/bin
endif
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
endif
-ifeq (,$(filter-out Linux SunOS,$(OS_ARCH)))
+ifeq (,$(filter-out Linux,$(OS_ARCH)))
MAKE_SYM_STORE_ARGS := -c --vcs-info
DUMP_SYMS_BIN ?= $(DIST)/host/bin/dump_syms
MAKE_SYM_STORE_PATH := $(DIST)/bin
diff --git a/accessible/atk/Platform.cpp b/accessible/atk/Platform.cpp
index e64084f5a0..0ee3a3d977 100644
--- a/accessible/atk/Platform.cpp
+++ b/accessible/atk/Platform.cpp
@@ -60,11 +60,7 @@ struct GnomeAccessibilityModule
};
static GnomeAccessibilityModule sAtkBridge = {
-#ifdef AIX
- "libatk-bridge.a(libatk-bridge.so.0)", nullptr,
-#else
"libatk-bridge.so", nullptr,
-#endif
"gnome_accessibility_module_init", nullptr,
"gnome_accessibility_module_shutdown", nullptr
};
diff --git a/accessible/tests/mochitest/common.js b/accessible/tests/mochitest/common.js
index 1e48fa0671..b3f83ea845 100644
--- a/accessible/tests/mochitest/common.js
+++ b/accessible/tests/mochitest/common.js
@@ -59,7 +59,6 @@ const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
const MAC = (navigator.platform.indexOf("Mac") != -1);
const LINUX = (navigator.platform.indexOf("Linux") != -1);
-const SOLARIS = (navigator.platform.indexOf("SunOS") != -1);
const WIN = (navigator.platform.indexOf("Win") != -1);
////////////////////////////////////////////////////////////////////////////////
diff --git a/accessible/tests/mochitest/elm/test_nsApplicationAcc.html b/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
index 58763e4372..e23eb37bc4 100644
--- a/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
+++ b/accessible/tests/mochitest/elm/test_nsApplicationAcc.html
@@ -32,7 +32,7 @@
// nsIAccessible::name
var applicationName = "";
- if (LINUX || SOLARIS) {
+ if (LINUX) {
applicationName = appInfo.name;
} else {
try {
diff --git a/accessible/tests/mochitest/treeupdate/test_contextmenu.xul b/accessible/tests/mochitest/treeupdate/test_contextmenu.xul
index 5b31e01363..916b815eb1 100644
--- a/accessible/tests/mochitest/treeupdate/test_contextmenu.xul
+++ b/accessible/tests/mochitest/treeupdate/test_contextmenu.xul
@@ -130,7 +130,7 @@
*/
function getMenuTree1()
{
- if (LINUX || SOLARIS) {
+ if (LINUX) {
var tree = {
role: ROLE_MENUPOPUP,
children: [
@@ -190,7 +190,7 @@
function getMenuTree2()
{
var tree = getMenuTree1();
- if (LINUX || SOLARIS) {
+ if (LINUX) {
var submenuTree =
{
name: "item2.0",
@@ -232,7 +232,7 @@
children: []
};
- if (LINUX || SOLARIS)
+ if (LINUX)
tree.children[2].children[0].children.push(subsubmenuTree);
else
tree.children[2].children[0].children[0].children[0].children.push(subsubmenuTree);
diff --git a/accessible/tests/mochitest/treeupdate/test_menu.xul b/accessible/tests/mochitest/treeupdate/test_menu.xul
index abdea217eb..d62ac8c5dc 100644
--- a/accessible/tests/mochitest/treeupdate/test_menu.xul
+++ b/accessible/tests/mochitest/treeupdate/test_menu.xul
@@ -32,7 +32,7 @@
this.invoke = function openMenu_invoke()
{
var tree;
- if (LINUX || SOLARIS) {
+ if (LINUX) {
tree =
{ PARENT_MENUITEM: [ ] };
@@ -51,7 +51,7 @@
this.finalCheck = function openMenu_finalCheck()
{
var tree;
- if (LINUX || SOLARIS) {
+ if (LINUX) {
tree =
{ PARENT_MENUITEM: [
{ MENUITEM: [ ] },
diff --git a/application/basilisk/Makefile.in b/application/basilisk/Makefile.in
index 2eb9e708f6..92527eaa84 100644
--- a/application/basilisk/Makefile.in
+++ b/application/basilisk/Makefile.in
@@ -10,7 +10,4 @@ ifdef MAKENSISU
# uninstaller is included with the application for mar file generation.
libs::
$(MAKE) -C installer/windows uninstaller
-ifdef MOZ_MAINTENANCE_SERVICE
- $(MAKE) -C installer/windows maintenanceservice_installer
-endif
endif
diff --git a/application/basilisk/app/permissions b/application/basilisk/app/permissions
index cf0aa22fbf..cc5535f218 100644
--- a/application/basilisk/app/permissions
+++ b/application/basilisk/app/permissions
@@ -7,6 +7,8 @@
# See nsPermissionManager.cpp for more...
# XPInstall
+origin install 1 http://addons.basilisk-browser.org
+origin install 1 https://addons.basilisk-browser.org
origin install 1 https://addons.mozilla.org
origin install 1 https://testpilot.firefox.com
diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js
index ff1f1fbc27..4700eac449 100644
--- a/application/basilisk/app/profile/basilisk.js
+++ b/application/basilisk/app/profile/basilisk.js
@@ -36,24 +36,30 @@ pref("extensions.minCompatibleAppVersion", "4.0");
pref("xpinstall.customConfirmationUI", true);
+#define AM_DOMAIN addons.basilisk-browser.org
+#define AM_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
+
// Preferences for AMO integration
pref("extensions.getAddons.cache.enabled", false);
-pref("extensions.getAddons.maxResults", 15);
-pref("extensions.getAddons.get.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%");
-pref("extensions.getAddons.getWithPerformance.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/guid:%IDS%?src=firefox&appOS=%OS%&appVersion=%VERSION%&tMain=%TIME_MAIN%&tFirstPaint=%TIME_FIRST_PAINT%&tSessionRestored=%TIME_SESSION_RESTORED%");
-pref("extensions.getAddons.search.browseURL", "https://addons.mozilla.org/%LOCALE%/firefox/search?q=%TERMS%&platform=%OS%&appver=%VERSION%");
-pref("extensions.getAddons.search.url", "https://services.addons.mozilla.org/%LOCALE%/firefox/api/%API_VERSION%/search/%TERMS%/all/%MAX_RESULTS%/%OS%/%VERSION%/%COMPATIBILITY_MODE%?src=firefox");
-pref("extensions.webservice.discoverURL", "https://discovery.addons.mozilla.org/%LOCALE%/firefox/discovery/pane/%VERSION%/%OS%/%COMPATIBILITY_MODE%");
-pref("extensions.getAddons.recommended.url", "https://services.addons.mozilla.org/%LOCALE%/%APP%/api/%API_VERSION%/list/recommended/all/%MAX_RESULTS%/%OS%/%VERSION%?src=firefox");
-pref("extensions.getAddons.link.url", "https://addons.mozilla.org/%LOCALE%/firefox/");
+pref("extensions.getAddons.maxResults", 10);
+pref("extensions.getAddons.get.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%");
+pref("extensions.getAddons.getWithPerformance.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%");
+pref("extensions.getAddons.search.browseURL", "https://@AM_DOMAIN@/search/?terms=%TERMS%");
+pref("extensions.getAddons.search.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=search&q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%");
+pref("extensions.webservice.discoverURL", "http://@AM_DOMAIN@/?component=discover");
+pref("extensions.getAddons.recommended.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=recommended&locale=%LOCALE%&os=%OS%");
+pref("extensions.getAddons.browseAddons", "http://@AM_DOMAIN@/");
+pref("extensions.getAddons.recommended.browseURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=recommended");
pref("extensions.update.autoUpdateDefault", true);
+// Leave these for the moment...
pref("extensions.hotfix.id", "firefox-hotfix@mozilla.org");
pref("extensions.hotfix.cert.checkAttributes", true);
pref("extensions.hotfix.certs.1.sha1Fingerprint", "91:53:98:0C:C1:86:DF:47:8F:35:22:9E:11:C9:A7:31:04:49:A1:AA");
pref("extensions.hotfix.certs.2.sha1Fingerprint", "39:E7:2B:7A:5B:CF:37:78:F9:5D:4A:E0:53:2D:2F:3D:68:53:C5:60");
+// Also, leave this for the moment...
// Check AUS for system add-on updates.
pref("extensions.systemAddon.update.url", "https://aus5.mozilla.org/update/3/SystemAddons/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
@@ -66,11 +72,14 @@ pref("extensions.webextensions.base-content-security-policy", "script-src 'self'
pref("extensions.webextensions.default-content-security-policy", "script-src 'self'; object-src 'self';");
// Require signed add-ons by default
-pref("xpinstall.signatures.required", true);
+pref("xpinstall.signatures.required", false);
pref("xpinstall.signatures.devInfoURL", "https://wiki.mozilla.org/Addons/Extension_Signing");
// Dictionary download preference
-pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
+pref("browser.dictionaries.download.url", "http://@AM_DOMAIN@/dictionaries/");
+
+// Get More Tools link URL
+pref("browser.getdevtools.url","https://@AM_DOMAIN@/?component=integration&type=external&request=devtools");
// At startup, should we check to see if the installation
// date is older than some threshold
@@ -135,17 +144,15 @@ pref("app.update.url", "https://aus5.mozilla.org/update/6/%PRODUCT%/%VERSION%/%B
// app.update.url.manual is in branding section
// app.update.url.details is in branding section
+// User-settable override to app.update.url for testing purposes.
+//pref("app.update.url.override", "");
+
// app.update.interval is in branding section
// app.update.promptWaitTime is in branding section
// Show the Update Checking/Ready UI when the user was idle for x seconds
pref("app.update.idletime", 60);
-// Whether or not to attempt using the service for updates.
-#ifdef MOZ_MAINTENANCE_SERVICE
-pref("app.update.service.enabled", true);
-#endif
-
// Symmetric (can be overridden by individual extensions) update preferences.
// e.g.
// extensions.{GUID}.update.enabled
@@ -153,8 +160,8 @@ pref("app.update.service.enabled", true);
// .. etc ..
//
pref("extensions.update.enabled", true);
-pref("extensions.update.url", "https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
-pref("extensions.update.background.url", "https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=52.9&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%");
+pref("extensions.update.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@");
+pref("extensions.update.background.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@");
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
// Themes every day
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
@@ -166,7 +173,7 @@ pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name", "chrome://browser
pref("extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description", "chrome://browser/locale/browser.properties");
pref("lightweightThemes.update.enabled", true);
-pref("lightweightThemes.getMoreURL", "https://addons.mozilla.org/%LOCALE%/firefox/themes");
+pref("lightweightThemes.getMoreURL", "http://@AM_DOMAIN@/personas/");
pref("lightweightThemes.recommendedThemes", "[{\"id\":\"recommended-1\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/a-web-browser-renaissance/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.footer.jpg\",\"textcolor\":\"#000000\",\"accentcolor\":\"#f2d9b1\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.preview.jpg\",\"author\":\"Sean.Martell\",\"version\":\"0\"},{\"id\":\"recommended-2\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/space-fantasy/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.footer.jpg\",\"textcolor\":\"#ffffff\",\"accentcolor\":\"#d9d9d9\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.preview.jpg\",\"author\":\"fx5800p\",\"version\":\"1.0\"},{\"id\":\"recommended-3\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/linen-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.footer.png\",\"accentcolor\":\"#ada8a8\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.preview.png\",\"author\":\"DVemer\",\"version\":\"1.0\"},{\"id\":\"recommended-4\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/pastel-gradient/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.footer.png\",\"textcolor\":\"#000000\",\"accentcolor\":\"#000000\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.preview.png\",\"author\":\"darrinhenein\",\"version\":\"1.0\"},{\"id\":\"recommended-5\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/carbon-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.footer.png\",\"textcolor\":\"#3b3b3b\",\"accentcolor\":\"#2e2e2e\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.preview.jpg\",\"author\":\"Jaxivo\",\"version\":\"1.0\"}]");
#if defined(MOZ_ADOBE_EME) || defined(MOZ_WIDEVINE_EME)
@@ -329,7 +336,7 @@ pref("browser.helperApps.deleteTempFileOnExit", true);
#endif
// search engines URL
-pref("browser.search.searchEnginesURL", "https://addons.mozilla.org/%LOCALE%/firefox/search-engines/");
+pref("browser.search.searchEnginesURL", "https://@AM_DOMAIN@/search-plugins/");
// pointer to the default engine name
pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties");
@@ -1286,17 +1293,6 @@ pref("privacy.trackingprotection.ui.enabled", true);
pref("privacy.trackingprotection.ui.enabled", false);
#endif
-// Enable Contextual Identity Containers
-#ifdef NIGHTLY_BUILD
-pref("privacy.userContext.enabled", true);
-pref("privacy.userContext.ui.enabled", true);
-pref("privacy.usercontext.about_newtab_segregation.enabled", true);
-#else
-pref("privacy.userContext.enabled", false);
-pref("privacy.userContext.ui.enabled", false);
-pref("privacy.usercontext.about_newtab_segregation.enabled", false);
-#endif
-
#ifndef RELEASE_OR_BETA
// At the moment, autostart.2 is used, while autostart.1 is unused.
// We leave it here set to false to reset users' defaults and allow
@@ -1431,3 +1427,11 @@ pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false);
// controlling validation are located in /services/sync/services-sync.js
pref("services.sync.validation.enabled", true);
#endif
+
+// When a user cancels this number of authentication dialogs coming from
+// a single web page (eTLD+1) in a row, all following authentication dialogs
+// will be blocked (automatically canceled) for that page.
+// This counter is per-tab and per-domain to minimize false positives.
+// The counter resets when the page is reloaded from the UI
+// (content-reloads do NOT clear this to mitigate reloading tricks).
+pref("prompts.authentication_dialog_abuse_limit", 3);
diff --git a/application/basilisk/base/content/aboutRobots-icon.png b/application/basilisk/base/content/aboutRobots-icon.png
deleted file mode 100644
index 1c4899aaf7..0000000000
--- a/application/basilisk/base/content/aboutRobots-icon.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/base/content/aboutRobots-widget-left.png b/application/basilisk/base/content/aboutRobots-widget-left.png
deleted file mode 100644
index 3a1e48d5fa..0000000000
--- a/application/basilisk/base/content/aboutRobots-widget-left.png
+++ /dev/null
Binary files differ
diff --git a/application/basilisk/base/content/aboutRobots.xhtml b/application/basilisk/base/content/aboutRobots.xhtml
deleted file mode 100644
index 23fe3ba17f..0000000000
--- a/application/basilisk/base/content/aboutRobots.xhtml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!DOCTYPE html [
- <!ENTITY % htmlDTD
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "DTD/xhtml1-strict.dtd">
- %htmlDTD;
- <!ENTITY % netErrorDTD
- SYSTEM "chrome://global/locale/netError.dtd">
- %netErrorDTD;
- <!ENTITY % globalDTD
- SYSTEM "chrome://global/locale/global.dtd">
- %globalDTD;
- <!ENTITY % aboutrobotsDTD
- SYSTEM "chrome://browser/locale/aboutRobots.dtd">
- %aboutrobotsDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>&robots.pagetitle;</title>
- <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
- <link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNgGAWjYBSMAggAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNgGJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNgGAWjYBSMAggAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNgGAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/>
-
- <script type="application/javascript"><![CDATA[
- var buttonClicked = false;
- function robotButton()
- {
- var button = document.getElementById('errorTryAgain');
- if (buttonClicked) {
- button.style.visibility = "hidden";
- } else {
- var newLabel = button.getAttribute("label2");
- button.textContent = newLabel;
- buttonClicked = true;
- }
- }
- ]]></script>
-
- <style type="text/css"><![CDATA[
- #errorPageContainer {
- background-image: none;
- }
-
- #errorPageContainer:before {
- content: url('chrome://browser/content/aboutRobots-icon.png');
- position: absolute;
- }
-
- body[dir=rtl] #icon,
- body[dir=rtl] #errorPageContainer:before {
- transform: scaleX(-1);
- }
- ]]></style>
- </head>
-
- <body dir="&locale.dir;">
-
- <!-- PAGE CONTAINER (for styling purposes only) -->
- <div id="errorPageContainer">
-
- <!-- Error Title -->
- <div id="errorTitle">
- <h1 id="errorTitleText">&robots.errorTitleText;</h1>
- </div>
-
- <!-- LONG CONTENT (the section most likely to require scrolling) -->
- <div id="errorLongContent">
-
- <!-- Short Description -->
- <div id="errorShortDesc">
- <p id="errorShortDescText">&robots.errorShortDescText;</p>
- </div>
-
- <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
- <div id="errorLongDesc">
- <ul>
- <li>&robots.errorLongDesc1;</li>
- <li>&robots.errorLongDesc2;</li>
- <li>&robots.errorLongDesc3;</li>
- <li>&robots.errorLongDesc4;</li>
- </ul>
- </div>
-
- <!-- Short Description -->
- <div id="errorTrailerDesc">
- <p id="errorTrailerDescText">&robots.errorTrailerDescText;</p>
- </div>
-
- </div>
-
- <!-- Button -->
- <button id="errorTryAgain"
- label2="&robots.dontpress;"
- onclick="robotButton();">&retry.label;</button>
-
- <img src="chrome://browser/content/aboutRobots-widget-left.png"
- style="position: absolute; bottom: -12px; left: -10px;"/>
- <img src="chrome://browser/content/aboutRobots-widget-left.png"
- style="position: absolute; bottom: -12px; right: -10px; transform: scaleX(-1);"/>
- </div>
-
- </body>
-</html>
diff --git a/application/basilisk/base/content/browser-context.inc b/application/basilisk/base/content/browser-context.inc
index 36e0478af6..2f6b19da07 100644
--- a/application/basilisk/base/content/browser-context.inc
+++ b/application/basilisk/base/content/browser-context.inc
@@ -51,23 +51,11 @@
label="&openLinkCmdInCurrent.label;"
accesskey="&openLinkCmdInCurrent.accesskey;"
oncommand="gContextMenu.openLinkInCurrent();"/>
-# label and data-usercontextid are dynamically set.
- <menuitem id="context-openlinkincontainertab"
- accesskey="&openLinkCmdInTab.accesskey;"
- oncommand="gContextMenu.openLinkInTab(event);"/>
+# label is dynamically set.
<menuitem id="context-openlinkintab"
label="&openLinkCmdInTab.label;"
accesskey="&openLinkCmdInTab.accesskey;"
- data-usercontextid="0"
- oncommand="gContextMenu.openLinkInTab(event);"/>
-
- <menu id="context-openlinkinusercontext-menu"
- label="&openLinkCmdInContainerTab.label;"
- accesskey="&openLinkCmdInContainerTab.accesskey;"
- hidden="true">
- <menupopup oncommand="gContextMenu.openLinkInTab(event);"
- onpopupshowing="return gContextMenu.createContainerMenu(event);" />
- </menu>
+ oncommand="gContextMenu.openLinkInTab();"/>
<menuitem id="context-openlink"
label="&openLinkCmd.label;"
diff --git a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
index ebe55377fc..b26a31f78e 100644
--- a/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
+++ b/application/basilisk/base/content/browser-fullScreenAndPointerLock.js
@@ -322,15 +322,9 @@ var FullScreen = {
document.addEventListener("popuphidden", this._setPopupOpen, false);
// If it is not safe to collapse, add the mouse position tracker or
// else it won't be possible to hide the navigation toolbox again
- if (!this._safeToCollapse()) {
- let rect = gBrowser.mPanelContainer.getBoundingClientRect();
- this._mouseTargetRect = {
- top: rect.top + 50,
- bottom: rect.bottom,
- left: rect.left,
- right: rect.right
- };
- MousePosTracker.addListener(this);
+ if (gPrefService.getBoolPref("browser.fullscreen.autohide")) {
+ gBrowser.mPanelContainer.addEventListener("mousemove",
+ this._collapseCallback, false);
}
// In DOM fullscreen mode, we hide toolbars with CSS
if (!document.fullscreenElement)
@@ -468,7 +462,8 @@ var FullScreen = {
cleanup: function () {
if (!window.fullScreen) {
- MousePosTracker.removeListener(this);
+ gBrowser.mPanelContainer.removeEventListener("mousemove",
+ this._collapseCallback, false);
document.removeEventListener("keypress", this._keyToggleCallback, false);
document.removeEventListener("popupshown", this._setPopupOpen, false);
document.removeEventListener("popuphidden", this._setPopupOpen, false);
@@ -497,17 +492,12 @@ var FullScreen = {
.getInterface(Ci.nsIDOMWindowUtils);
},
- getMouseTargetRect: function()
- {
- return this._mouseTargetRect;
- },
-
// Event callbacks
_expandCallback: function()
{
FullScreen.showNavToolbox();
},
- onMouseEnter: function()
+ _collapseCallback: function()
{
FullScreen.hideNavToolbox();
},
@@ -588,14 +578,8 @@ var FullScreen = {
// Track whether mouse is near the toolbox
if (trackMouse && !this.useLionFullScreen) {
- let rect = gBrowser.mPanelContainer.getBoundingClientRect();
- this._mouseTargetRect = {
- top: rect.top + 50,
- bottom: rect.bottom,
- left: rect.left,
- right: rect.right
- };
- MousePosTracker.addListener(this);
+ gBrowser.mPanelContainer.addEventListener("mousemove",
+ this._collapseCallback, false);
}
this._isChromeCollapsed = false;
@@ -622,7 +606,8 @@ var FullScreen = {
gNavToolbox.style.marginTop =
-gNavToolbox.getBoundingClientRect().height + "px";
this._isChromeCollapsed = true;
- MousePosTracker.removeListener(this);
+ gBrowser.mPanelContainer.removeEventListener("mousemove",
+ this._collapseCallback, false);
},
_updateToolbars: function (aEnterFS) {
diff --git a/application/basilisk/base/content/browser-menubar.inc b/application/basilisk/base/content/browser-menubar.inc
index 41734711cd..0549ad915c 100644
--- a/application/basilisk/base/content/browser-menubar.inc
+++ b/application/basilisk/base/content/browser-menubar.inc
@@ -11,19 +11,12 @@
style="border:0px;padding:0px;margin:0px;-moz-appearance:none">
<menu id="file-menu" label="&fileMenu.label;"
accesskey="&fileMenu.accesskey;">
- <menupopup id="menu_FilePopup"
- onpopupshowing="updateUserContextUIVisibility();">
+ <menupopup id="menu_FilePopup">
<menuitem id="menu_newNavigatorTab"
label="&tabCmd.label;"
command="cmd_newNavigatorTab"
key="key_newNavigatorTab"
accesskey="&tabCmd.accesskey;"/>
- <menu id="menu_newUserContext"
- label="&newUserContext.label;"
- accesskey="&newUserContext.accesskey;"
- hidden="true">
- <menupopup onpopupshowing="return createUserContextMenu(event);" />
- </menu>
<menuitem id="menu_newNavigator"
label="&newNavigatorCmd.label;"
accesskey="&newNavigatorCmd.accesskey;"
diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js
index 9fb997a429..ddbe11a9d5 100644
--- a/application/basilisk/base/content/browser.js
+++ b/application/basilisk/base/content/browser.js
@@ -8,7 +8,6 @@ var Cu = Components.utils;
var Cc = Components.classes;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
Cu.import("resource://gre/modules/NotificationDB.jsm");
// lazy module getters
@@ -827,10 +826,6 @@ function _loadURIWithFlags(browser, uri, params) {
}
try {
if (!mustChangeProcess) {
- if (params.userContextId) {
- browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId });
- }
-
browser.webNavigation.loadURIWithOptions(uri, flags,
referrer, referrerPolicy,
postData, null, null, triggeringPrincipal);
@@ -856,10 +851,6 @@ function _loadURIWithFlags(browser, uri, params) {
postData: postData
}
- if (params.userContextId) {
- loadParams.userContextId = params.userContextId;
- }
-
LoadInOtherProcess(browser, loadParams);
}
} catch (e) {
@@ -872,10 +863,6 @@ function _loadURIWithFlags(browser, uri, params) {
Cu.reportError(e);
gBrowser.updateBrowserRemotenessByURL(browser, uri);
- if (params.userContextId) {
- browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId });
- }
-
browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy,
postData, null, null, triggeringPrincipal);
} else {
@@ -939,16 +926,6 @@ addEventListener("DOMContentLoaded", function onDCL() {
let initBrowser =
document.getAnonymousElementByAttribute(gBrowser, "anonid", "initialBrowser");
- // The window's first argument is a tab if and only if we are swapping tabs.
- // We must set the browser's usercontextid before updateBrowserRemoteness(),
- // so that the newly created remote tab child has the correct usercontextid.
- if (window.arguments) {
- let tabToOpen = window.arguments[0];
- if (tabToOpen instanceof XULElement && tabToOpen.hasAttribute("usercontextid")) {
- initBrowser.setAttribute("usercontextid", tabToOpen.getAttribute("usercontextid"));
- }
- }
-
gBrowser.updateBrowserRemoteness(initBrowser, gMultiProcessBrowser);
});
@@ -1133,13 +1110,6 @@ var gBrowserInit = {
// make sure it has a docshell
gBrowser.docShell;
- // We must set usercontextid before updateBrowserRemoteness()
- // so that the newly created remote tab child has correct usercontextid
- if (tabToOpen.hasAttribute("usercontextid")) {
- let usercontextid = tabToOpen.getAttribute("usercontextid");
- gBrowser.selectedBrowser.setAttribute("usercontextid", usercontextid);
- }
-
// If the browser that we're swapping in was remote, then we'd better
// be able to support remote browsers, and then make our selectedTab
// remote.
@@ -1165,9 +1135,8 @@ var gBrowserInit = {
// [3]: postData (nsIInputStream)
// [4]: allowThirdPartyFixup (bool)
// [5]: referrerPolicy (int)
- // [6]: userContextId (int)
- // [7]: originPrincipal (nsIPrincipal)
- // [8]: triggeringPrincipal (nsIPrincipal)
+ // [6]: originPrincipal (nsIPrincipal)
+ // [7]: triggeringPrincipal (nsIPrincipal)
else if (window.arguments.length >= 3) {
let referrerURI = window.arguments[2];
if (typeof(referrerURI) == "string") {
@@ -1179,13 +1148,11 @@ var gBrowserInit = {
}
let referrerPolicy = (window.arguments[5] != undefined ?
window.arguments[5] : Ci.nsIHttpChannel.REFERRER_POLICY_DEFAULT);
- let userContextId = (window.arguments[6] != undefined ?
- window.arguments[6] : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID);
loadURI(uriToLoad, referrerURI, window.arguments[3] || null,
- window.arguments[4] || false, referrerPolicy, userContextId,
+ window.arguments[4] || false, referrerPolicy,
// pass the origin principal (if any) and force its use to create
// an initial about:blank viewer if present:
- window.arguments[7], !!window.arguments[7], window.arguments[8]);
+ window.arguments[6], !!window.arguments[6], window.arguments[7]);
window.focus();
}
// Note: loadOneOrMoreURIs *must not* be called if window.arguments.length >= 3.
@@ -1277,7 +1244,7 @@ var gBrowserInit = {
// Setup click-and-hold gestures access to the session history
// menus if global click-and-hold isn't turned on
- if (!getBoolPref("ui.click_hold_context_menus", false))
+ if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false))
SetClickAndHoldHandlers();
let NP = {};
@@ -1868,7 +1835,7 @@ function BrowserGoHome(aEvent) {
case "tabshifted":
case "tab":
urls = homePage.split("|");
- var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false);
+ var loadInBackground = Services.prefs.getBoolPref("browser.tabs.loadBookmarksInBackground", false);
gBrowser.loadTabs(urls, loadInBackground);
break;
case "window":
@@ -2070,7 +2037,7 @@ function BrowserTryToCloseWindow()
}
function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
- userContextId, originPrincipal, forceAboutBlankViewerInCurrent,
+ originPrincipal, forceAboutBlankViewerInCurrent,
triggeringPrincipal) {
try {
openLinkIn(uri, "current",
@@ -2078,7 +2045,6 @@ function loadURI(uri, referrer, postData, allowThirdPartyFixup, referrerPolicy,
referrerPolicy: referrerPolicy,
postData: postData,
allowThirdPartyFixup: allowThirdPartyFixup,
- userContextId: userContextId,
originPrincipal,
triggeringPrincipal,
forceAboutBlankViewerInCurrent,
@@ -3094,6 +3060,11 @@ function getWebNavigation()
}
function BrowserReloadWithFlags(reloadFlags) {
+
+ // Reset DOS mitigation for auth prompts when user initiates a reload.
+ let browser = gBrowser.selectedBrowser;
+ delete browser.authPromptCounter;
+
let url = gBrowser.currentURI.spec;
if (gBrowser.updateBrowserRemotenessByURL(gBrowser.selectedBrowser, url)) {
// If the remoteness has changed, the new browser doesn't have any
@@ -3946,66 +3917,6 @@ function updateEditUIVisibility()
}
/**
- * Opens a new tab with the userContextId specified as an attribute of
- * sourceEvent. This attribute is propagated to the top level originAttributes
- * living on the tab's docShell.
- *
- * @param event
- * A click event on a userContext File Menu option
- */
-function openNewUserContextTab(event)
-{
- openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {
- userContextId: parseInt(event.target.getAttribute('data-usercontextid')),
- });
-}
-
-/**
- * Updates File Menu User Context UI visibility depending on
- * privacy.userContext.enabled pref state.
- */
-function updateUserContextUIVisibility()
-{
- let menu = document.getElementById("menu_newUserContext");
- menu.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled");
- if (PrivateBrowsingUtils.isWindowPrivate(window)) {
- menu.setAttribute("disabled", "true");
- }
-}
-
-/**
- * Updates the User Context UI indicators if the browser is in a non-default context
- */
-function updateUserContextUIIndicator()
-{
- let hbox = document.getElementById("userContext-icons");
-
- let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid");
- if (!userContextId) {
- hbox.setAttribute("data-identity-color", "");
- hbox.hidden = true;
- return;
- }
-
- let identity = ContextualIdentityService.getIdentityFromId(userContextId);
- if (!identity) {
- hbox.setAttribute("data-identity-color", "");
- hbox.hidden = true;
- return;
- }
-
- hbox.setAttribute("data-identity-color", identity.color);
-
- let label = document.getElementById("userContext-label");
- label.setAttribute("value", ContextualIdentityService.getUserContextLabel(userContextId));
-
- let indicator = document.getElementById("userContext-indicator");
- indicator.setAttribute("data-identity-icon", identity.icon);
-
- hbox.hidden = false;
-}
-
-/**
* Makes the Character Encoding menu enabled or disabled as appropriate.
* To be called when the View menu or the app menu is opened.
*/
@@ -4685,7 +4596,6 @@ nsBrowserAccess.prototype = {
_openURIInNewTab: function(aURI, aReferrer, aReferrerPolicy, aIsPrivate,
aIsExternal, aForceNotRemote=false,
- aUserContextId=Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID,
aOpener = null, aTriggeringPrincipal = null) {
let win, needToFocusWin;
@@ -4714,7 +4624,6 @@ nsBrowserAccess.prototype = {
triggeringPrincipal: aTriggeringPrincipal,
referrerURI: aReferrer,
referrerPolicy: aReferrerPolicy,
- userContextId: aUserContextId,
fromExternal: aIsExternal,
inBackground: loadInBackground,
forceNotRemote: aForceNotRemote,
@@ -4791,13 +4700,10 @@ nsBrowserAccess.prototype = {
// will do the job of shuttling off the newly opened browser to run in
// the right process once it starts loading a URI.
let forceNotRemote = !!aOpener;
- let userContextId = aOpener && aOpener.document
- ? aOpener.document.nodePrincipal.originAttributes.userContextId
- : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID;
let openerWindow = (aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener;
let browser = this._openURIInNewTab(aURI, referrer, referrerPolicy,
isPrivate, isExternal,
- forceNotRemote, userContextId,
+ forceNotRemote,
openerWindow, triggeringPrincipal);
if (browser)
newWindow = browser.contentWindow;
@@ -4829,16 +4735,10 @@ nsBrowserAccess.prototype = {
var isExternal = !!(aFlags & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
- var userContextId = aParams.openerOriginAttributes &&
- ("userContextId" in aParams.openerOriginAttributes)
- ? aParams.openerOriginAttributes.userContextId
- : Ci.nsIScriptSecurityManager.DEFAULT_USER_CONTEXT_ID
-
let browser = this._openURIInNewTab(aURI, aParams.referrer,
aParams.referrerPolicy,
aParams.isPrivate,
isExternal, false,
- userContextId, null,
aParams.triggeringPrincipal);
if (browser)
return browser.QueryInterface(Ci.nsIFrameLoaderOwner);
@@ -5395,11 +5295,6 @@ function handleLinkClick(event, href, linkNode) {
triggeringPrincipal: doc.nodePrincipal,
};
- // The new tab/window must use the same userContextId
- if (doc.nodePrincipal.originAttributes.userContextId) {
- params.userContextId = doc.nodePrincipal.originAttributes.userContextId;
- }
-
openLinkIn(href, where, params);
event.preventDefault();
return true;
@@ -5471,8 +5366,6 @@ function handleDroppedLink(event, urlOrLinks, name)
let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange;
- let userContextId = gBrowser.selectedBrowser.getAttribute("usercontextid");
-
// event is null if links are dropped in content process.
// inBackground should be false, as it's loading into current browser.
let inBackground = false;
@@ -5496,7 +5389,6 @@ function handleDroppedLink(event, urlOrLinks, name)
replace: true,
allowThirdPartyFixup: false,
postDatas,
- userContextId,
});
}
});
diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul
index 3208538c1d..0cc4c982ab 100644
--- a/application/basilisk/base/content/browser.xul
+++ b/application/basilisk/base/content/browser.xul
@@ -8,7 +8,6 @@
<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
-<?xml-stylesheet href="chrome://browser/content/usercontext/usercontext.css" type="text/css"?>
#ifdef MOZ_DEVTOOLS
<?xml-stylesheet href="chrome://devtools/skin/devtools-browser.css" type="text/css"?>
#endif
@@ -551,12 +550,7 @@
key="key_undoCloseTab"
label="&undoCloseTab.label;"
observes="History:UndoCloseTab"/>
- <menuseparator id="alltabs-popup-separator-1"/>
- <menu id="alltabs_containersTab"
- label="&newUserContext.label;">
- <menupopup id="alltabs_containersMenuTab" />
- </menu>
- <menuseparator id="alltabs-popup-separator-2"/>
+ <menuseparator id="alltabs-popup-separator"/>
</menupopup>
</toolbarbutton>
@@ -997,7 +991,8 @@
contentcontextmenu="contentAreaContextMenu"
autocompletepopup="PopupAutoComplete"
selectmenulist="ContentSelectDropdown"
- datetimepicker="DateTimePickerPanel"/>
+ datetimepicker="DateTimePickerPanel"
+ authdosprotected="true" />
</vbox>
<vbox id="browser-border-end" hidden="true" layer="true"/>
</hbox>
diff --git a/application/basilisk/base/content/content.js b/application/basilisk/base/content/content.js
index 5accbdf7b7..d2a70ba117 100644
--- a/application/basilisk/base/content/content.js
+++ b/application/basilisk/base/content/content.js
@@ -162,9 +162,6 @@ var handleContentContextMenu = function (event) {
let selectionInfo = BrowserUtils.getSelectionDetails(content);
- let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
- let userContextId = loadContext.originAttributes.userContextId;
-
if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
let editFlags = SpellCheckHelper.isEditable(event.target, content);
let spellInfo;
@@ -188,7 +185,7 @@ var handleContentContextMenu = function (event) {
principal, docLocation, charSet, baseURI, referrer,
referrerPolicy, contentType, contentDisposition,
frameOuterWindowID, selectionInfo, disableSetDesktopBg,
- loginFillInfo, parentAllowsMixedContent, userContextId },
+ loginFillInfo, parentAllowsMixedContent },
{ event, popupNode: event.target });
}
else {
@@ -212,7 +209,6 @@ var handleContentContextMenu = function (event) {
disableSetDesktopBackground: disableSetDesktopBg,
loginFillInfo,
parentAllowsMixedContent,
- userContextId,
};
}
}
diff --git a/application/basilisk/base/content/nsContextMenu.js b/application/basilisk/base/content/nsContextMenu.js
index 3f77dcb90f..74a2e7a8ee 100644
--- a/application/basilisk/base/content/nsContextMenu.js
+++ b/application/basilisk/base/content/nsContextMenu.js
@@ -4,7 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm");
Components.utils.import("resource://gre/modules/LoginManagerContextMenu.jsm");
@@ -142,28 +141,11 @@ nsContextMenu.prototype = {
this.onPlainTextLink = true;
}
- var inContainer = false;
- if (gContextMenuContentData.userContextId) {
- inContainer = true;
- var item = document.getElementById("context-openlinkincontainertab");
-
- item.setAttribute("data-usercontextid", gContextMenuContentData.userContextId);
-
- var label =
- ContextualIdentityService.getUserContextLabel(gContextMenuContentData.userContextId);
- item.setAttribute("label",
- gBrowserBundle.formatStringFromName("userContextOpenLink.label",
- [label], 1));
- }
-
var shouldShow = this.onSaveableLink || isMailtoInternal || this.onPlainTextLink;
var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
- var showContainers = Services.prefs.getBoolPref("privacy.userContext.enabled");
this.showItem("context-openlink", shouldShow && !isWindowPrivate);
this.showItem("context-openlinkprivate", shouldShow);
- this.showItem("context-openlinkintab", shouldShow && !inContainer);
- this.showItem("context-openlinkincontainertab", shouldShow && inContainer);
- this.showItem("context-openlinkinusercontext-menu", shouldShow && !isWindowPrivate && showContainers);
+ this.showItem("context-openlinkintab", shouldShow);
this.showItem("context-openlinkincurrent", this.onPlainTextLink);
this.showItem("context-sep-open", shouldShow);
},
@@ -958,13 +940,6 @@ nsContextMenu.prototype = {
params[p] = extra[p];
}
- // If we want to change userContextId, we must be sure that we don't
- // propagate the referrer.
- if ("userContextId" in params &&
- params.userContextId != gContextMenuContentData.userContextId) {
- params.noReferrer = true;
- }
-
return params;
},
@@ -982,7 +957,7 @@ nsContextMenu.prototype = {
},
// Open linked-to URL in a new tab.
- openLinkInTab: function(event) {
+ openLinkInTab: function() {
urlSecurityCheck(this.linkURL, this.principal);
let referrerURI = gContextMenuContentData.documentURIObject;
@@ -1003,7 +978,6 @@ nsContextMenu.prototype = {
let params = {
allowMixedContent: persistAllowMixedContentInChildTab,
- userContextId: parseInt(event.target.getAttribute('data-usercontextid')),
};
openLinkIn(this.linkURL, "tab", this._openLinkInParameters(params));
@@ -1779,8 +1753,4 @@ nsContextMenu.prototype = {
menuItem.label = menuLabel;
menuItem.accessKey = gNavigatorBundle.getString("contextMenuSearch.accesskey");
},
- createContainerMenu: function(aEvent) {
- return createUserContextMenu(aEvent, true,
- gContextMenuContentData.userContextId);
- },
};
diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js
index 6d053dd2bc..35ef8ceb28 100644
--- a/application/basilisk/base/content/tab-content.js
+++ b/application/basilisk/base/content/tab-content.js
@@ -9,9 +9,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-#ifdef MOZ_WEBEXTENSIONS
-Cu.import("resource://gre/modules/ExtensionContent.jsm");
-#endif
XPCOMUtils.defineLazyModuleGetter(this, "E10SUtils",
"resource:///modules/E10SUtils.jsm");
@@ -889,41 +886,6 @@ var RefreshBlocker = {
RefreshBlocker.init();
-var UserContextIdNotifier = {
- init() {
- addEventListener("DOMWindowCreated", this);
- },
-
- uninit() {
- removeEventListener("DOMWindowCreated", this);
- },
-
- handleEvent(aEvent) {
- // When the window is created, we want to inform the tabbrowser about
- // the userContextId in use in order to update the UI correctly.
- // Just because we cannot change the userContextId from an active docShell,
- // we don't need to check DOMContentLoaded again.
- this.uninit();
-
- // We use the docShell because content.document can have been loaded before
- // setting the originAttributes.
- let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
- let userContextId = loadContext.originAttributes.userContextId;
-
- sendAsyncMessage("Browser:WindowCreated", { userContextId });
- }
-};
-
-UserContextIdNotifier.init();
-
-#ifdef MOZ_WEBEXTENSIONS
-ExtensionContent.init(this);
-addEventListener("unload", () => {
- ExtensionContent.uninit(this);
- RefreshBlocker.uninit();
-});
-#endif
-
addMessageListener("AllowScriptsToClose", () => {
content.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml
index 0438380203..c2f02512dc 100644
--- a/application/basilisk/base/content/tabbrowser.xml
+++ b/application/basilisk/base/content/tabbrowser.xml
@@ -25,7 +25,7 @@
<xul:vbox flex="1" class="browserContainer">
<xul:stack flex="1" class="browserStack" anonid="browserStack">
<xul:browser anonid="initialBrowser" type="content-primary" message="true" messagemanagergroup="browsers"
- xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker"/>
+ xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker,authdosprotected"/>
</xul:stack>
</xul:vbox>
</xul:hbox>
@@ -814,10 +814,8 @@
}
let unifiedComplete = this.mTabBrowser._unifiedComplete;
- let userContextId = this.mBrowser.getAttribute("usercontextid") || 0;
if (this.mBrowser.registeredOpenURI) {
- unifiedComplete.unregisterOpenPage(this.mBrowser.registeredOpenURI,
- userContextId);
+ unifiedComplete.unregisterOpenPage(this.mBrowser.registeredOpenURI);
delete this.mBrowser.registeredOpenURI;
}
// Tabs in private windows aren't registered as "Open" so
@@ -825,7 +823,7 @@
if (!isBlankPageURL(aLocation.spec) &&
(!PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.permanentPrivateBrowsing)) {
- unifiedComplete.registerOpenPage(aLocation, userContextId);
+ unifiedComplete.registerOpenPage(aLocation);
this.mBrowser.registeredOpenURI = aLocation;
}
}
@@ -1230,7 +1228,6 @@
this._adjustFocusAfterTabSwitch(this.mCurrentTab);
}
- updateUserContextUIIndicator();
gIdentityHandler.updateSharingIndicator();
this.tabContainer._setPositionalAttributes();
@@ -1486,7 +1483,6 @@
var aSkipAnimation;
var aForceNotRemote;
var aNoReferrer;
- var aUserContextId;
var aRelatedBrowser;
var aOriginPrincipal;
var aOpener;
@@ -1507,7 +1503,6 @@
aSkipAnimation = params.skipAnimation;
aForceNotRemote = params.forceNotRemote;
aNoReferrer = params.noReferrer;
- aUserContextId = params.userContextId;
aRelatedBrowser = params.relatedBrowser;
aOriginPrincipal = params.originPrincipal;
aOpener = params.opener;
@@ -1530,7 +1525,6 @@
allowMixedContent: aAllowMixedContent,
forceNotRemote: aForceNotRemote,
noReferrer: aNoReferrer,
- userContextId: aUserContextId,
originPrincipal: aOriginPrincipal,
relatedBrowser: aRelatedBrowser,
opener: aOpener });
@@ -1551,7 +1545,6 @@
let aTargetTab;
let aNewIndex = -1;
let aPostDatas = [];
- let aUserContextId;
if (arguments.length == 2 &&
typeof arguments[1] == "object") {
let params = arguments[1];
@@ -1562,7 +1555,6 @@
aNewIndex = typeof params.newIndex === "number" ?
params.newIndex : aNewIndex;
aPostDatas = params.postDatas || aPostDatas;
- aUserContextId = params.userContextId;
}
if (!aURIs.length)
@@ -1611,8 +1603,7 @@
ownerTab: owner,
skipAnimation: multiple,
allowThirdPartyFixup: aAllowThirdPartyFixup,
- postData: aPostDatas[0],
- userContextId: aUserContextId
+ postData: aPostDatas[0]
});
if (aNewIndex !== -1) {
this.moveTabTo(firstTabAdded, aNewIndex);
@@ -1625,8 +1616,7 @@
let tab = this.addTab(aURIs[i], {
skipAnimation: true,
allowThirdPartyFixup: aAllowThirdPartyFixup,
- postData: aPostDatas[i],
- userContextId: aUserContextId
+ postData: aPostDatas[i]
});
if (targetTabIndex !== -1)
this.moveTabTo(tab, ++tabNum);
@@ -1899,7 +1889,7 @@
<body>
<![CDATA[
// Supported parameters:
- // userContextId, remote, isPreloadBrowser, uriIsAboutBlank, permanentKey
+ // remote, isPreloadBrowser, uriIsAboutBlank, permanentKey
const NS_XUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
@@ -1911,10 +1901,6 @@
b.setAttribute("contextmenu", this.getAttribute("contentcontextmenu"));
b.setAttribute("tooltip", this.getAttribute("contenttooltip"));
- if (aParams.userContextId) {
- b.setAttribute("usercontextid", aParams.userContextId);
- }
-
if (aParams.remote) {
b.setAttribute("remote", "true");
}
@@ -1936,6 +1922,10 @@
if (this.hasAttribute("datetimepicker")) {
b.setAttribute("datetimepicker", this.getAttribute("datetimepicker"));
}
+
+ if (this.hasAttribute("authdosprotected")) {
+ b.setAttribute("authdosprotected", this.getAttribute("authdosprotected"));
+ }
b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);
@@ -1989,7 +1979,7 @@
"use strict";
// Supported parameters:
- // forceNotRemote, userContextId
+ // forceNotRemote
let uriIsAboutBlank = !aURI || aURI == "about:blank";
@@ -2007,7 +1997,6 @@
// Private windows are not included because both the label and the
// icon for the tab would be set incorrectly (see bug 1195981).
if (aURI == BROWSER_NEW_TAB_URL &&
- !aParams.userContextId &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
browser = this._getPreloadedBrowser();
if (browser) {
@@ -2021,7 +2010,6 @@
browser = this._createBrowser({permanentKey: aTab.permanentKey,
remote: remote,
uriIsAboutBlank: uriIsAboutBlank,
- userContextId: aParams.userContextId,
relatedBrowser: aParams.relatedBrowser,
opener: aParams.opener});
}
@@ -2096,7 +2084,6 @@
var aAllowMixedContent;
var aForceNotRemote;
var aNoReferrer;
- var aUserContextId;
var aEventDetail;
var aRelatedBrowser;
var aOriginPrincipal;
@@ -2119,7 +2106,6 @@
aAllowMixedContent = params.allowMixedContent;
aForceNotRemote = params.forceNotRemote;
aNoReferrer = params.noReferrer;
- aUserContextId = params.userContextId;
aEventDetail = params.eventDetail;
aRelatedBrowser = params.relatedBrowser;
aOriginPrincipal = params.originPrincipal;
@@ -2146,11 +2132,6 @@
t.setAttribute("label", aURI);
}
- if (aUserContextId) {
- t.setAttribute("usercontextid", aUserContextId);
- ContextualIdentityService.setTabStyle(t);
- }
-
t.setAttribute("crop", "end");
t.setAttribute("onerror", "this.removeAttribute('image');");
@@ -2200,7 +2181,6 @@
// of tab.linkedBrowser.
let browserParams = {
forceNotRemote: aForceNotRemote,
- userContextId: aUserContextId,
relatedBrowser: aRelatedBrowser,
opener: aOpener,
};
@@ -2579,8 +2559,7 @@
listener.destroy();
if (browser.registeredOpenURI && !aAdoptedByTab) {
- this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI,
- browser.getAttribute("usercontextid") || 0);
+ this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI);
delete browser.registeredOpenURI;
}
@@ -2779,11 +2758,6 @@
if (ourBrowser.isRemoteBrowser != otherBrowser.isRemoteBrowser)
return;
- // Keep the userContextId if set on other browser
- if (otherBrowser.hasAttribute("usercontextid")) {
- ourBrowser.setAttribute("usercontextid", otherBrowser.getAttribute("usercontextid"));
- }
-
// That's gBrowser for the other window, not the tab's browser!
var remoteBrowser = aOtherTab.ownerDocument.defaultView.gBrowser;
var isPending = aOtherTab.hasAttribute("pending");
@@ -2816,10 +2790,6 @@
aOurTab.setAttribute("soundplaying", "true");
modifiedAttrs.push("soundplaying");
}
- if (aOtherTab.hasAttribute("usercontextid")) {
- aOurTab.setUserContextId(aOtherTab.getAttribute("usercontextid"));
- modifiedAttrs.push("usercontextid");
- }
if (aOtherTab.hasAttribute("sharing")) {
aOurTab.setAttribute("sharing", aOtherTab.getAttribute("sharing"));
modifiedAttrs.push("sharing");
@@ -2957,8 +2927,7 @@
<![CDATA[
// If the current URI is registered as open remove it from the list.
if (aOurBrowser.registeredOpenURI) {
- this._unifiedComplete.unregisterOpenPage(aOurBrowser.registeredOpenURI,
- aOurBrowser.getAttribute("usercontextid") || 0);
+ this._unifiedComplete.unregisterOpenPage(aOurBrowser.registeredOpenURI);
delete aOurBrowser.registeredOpenURI;
}
@@ -2991,7 +2960,10 @@
<parameter name="aTab"/>
<body>
<![CDATA[
- this.getBrowserForTab(aTab).reload();
+ let browser = this.getBrowserForTab(aTab);
+ // Reset DOS mitigation for basic auth prompt
+ delete browser.authPromptCounter;
+ browser.reload();
]]>
</body>
</method>
@@ -3295,10 +3267,6 @@
// it in the other window (making it seem to have moved between
// windows).
let params = { eventDetail: { adoptedTab: aTab } };
- if (aTab.hasAttribute("usercontextid")) {
- // new tab must have the same usercontextid as the old one
- params.userContextId = aTab.getAttribute("usercontextid");
- }
let newTab = this.addTab("about:blank", params);
let newBrowser = this.getBrowserForTab(newTab);
let newURL = aTab.linkedBrowser.currentURI.spec;
@@ -4618,7 +4586,6 @@
disableSetDesktopBackground: data.disableSetDesktopBg,
loginFillInfo: data.loginFillInfo,
parentAllowsMixedContent: data.parentAllowsMixedContent,
- userContextId: data.userContextId,
};
let popup = browser.ownerDocument.getElementById("contentAreaContextMenu");
let event = gContextMenuContentData.event;
@@ -4645,17 +4612,6 @@
}
case "Browser:WindowCreated": {
let tab = this.getTabForBrowser(browser);
- if (tab && data.userContextId) {
- ContextualIdentityService.telemetry(data.userContextId);
- tab.setUserContextId(data.userContextId);
- }
-
- // We don't want to update the container icon and identifier if
- // this is not the selected browser.
- if (browser == gBrowser.selectedBrowser) {
- updateUserContextUIIndicator();
- }
-
break;
}
case "Findbar:Keypress": {
@@ -4838,8 +4794,7 @@
for (let tab of this.tabs) {
let browser = tab.linkedBrowser;
if (browser.registeredOpenURI) {
- this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI,
- browser.getAttribute("usercontextid") || 0);
+ this._unifiedComplete.unregisterOpenPage(browser.registeredOpenURI);
delete browser.registeredOpenURI;
}
let filter = this._tabFilters.get(tab);
@@ -5240,7 +5195,7 @@
</xul:arrowscrollbox>
</content>
- <implementation implements="nsIDOMEventListener, nsIObserver">
+ <implementation implements="nsIDOMEventListener">
<constructor>
<![CDATA[
this.mTabClipWidth = Services.prefs.getIntPref("browser.tabs.tabClipWidth");
@@ -5259,17 +5214,9 @@
this._tabAnimationLoggingEnabled = false;
}
this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
- this.observe(null, "nsPref:changed", "privacy.userContext.enabled");
- Services.prefs.addObserver("privacy.userContext.enabled", this, false);
]]>
</constructor>
- <destructor>
- <![CDATA[
- Services.prefs.removeObserver("privacy.userContext.enabled", this);
- ]]>
- </destructor>
-
<field name="tabbrowser" readonly="true">
document.getElementById(this.getAttribute("tabbrowser"));
</field>
@@ -5295,55 +5242,6 @@
<field name="_afterHoveredTab">null</field>
<field name="_hoveredTab">null</field>
- <method name="observe">
- <parameter name="aSubject"/>
- <parameter name="aTopic"/>
- <parameter name="aData"/>
- <body><![CDATA[
- switch (aTopic) {
- case "nsPref:changed":
- // This is the only pref observed.
- let containersEnabled = Services.prefs.getBoolPref("privacy.userContext.enabled");
-
- const newTab = document.getElementById("new-tab-button");
- const newTab2 = document.getAnonymousElementByAttribute(this, "anonid", "tabs-newtab-button")
-
- if (containersEnabled) {
- for (let parent of [newTab, newTab2]) {
- if (!parent)
- continue;
- let popup = document.createElementNS(
- "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "menupopup");
- if (parent.id) {
- popup.id = "newtab-popup";
- } else {
- popup.setAttribute("anonid", "newtab-popup");
- }
- popup.className = "new-tab-popup";
- popup.setAttribute("position", "after_end");
- parent.appendChild(popup);
-
- gClickAndHoldListenersOnElement.add(parent);
- parent.setAttribute("type", "menu");
- }
- } else {
- for (let parent of [newTab, newTab2]) {
- if (!parent)
- continue;
- gClickAndHoldListenersOnElement.remove(parent);
- parent.removeAttribute("type");
- if (!parent.firstChild)
- continue;
- parent.firstChild.remove();
- }
- }
-
- break;
- }
- ]]></body>
- </method>
-
<property name="_isCustomizing" readonly="true">
<getter>
let root = document.documentElement;
@@ -6444,7 +6342,6 @@
inBackground = !inBackground;
let targetTab = this._getDragTargetTab(event, true);
- let userContextId = this.selectedItem.getAttribute("usercontextid");
let replace = !!targetTab;
let newIndex = this._getDropIndex(event, true);
let urls = links.map(link => link.url);
@@ -6454,7 +6351,6 @@
allowThirdPartyFixup: true,
targetTab,
newIndex,
- userContextId,
});
}
@@ -6715,14 +6611,6 @@
-->
<field name="muteReason">undefined</field>
- <property name="userContextId" readonly="true">
- <getter>
- return this.hasAttribute("usercontextid")
- ? parseInt(this.getAttribute("usercontextid"))
- : 0;
- </getter>
- </property>
-
<property name="soundPlaying" readonly="true">
<getter>
return this.getAttribute("soundplaying") == "true";
@@ -6850,27 +6738,6 @@
]]>
</body>
</method>
-
- <method name="setUserContextId">
- <parameter name="aUserContextId"/>
- <body>
- <![CDATA[
- if (aUserContextId) {
- if (this.linkedBrowser) {
- this.linkedBrowser.setAttribute("usercontextid", aUserContextId);
- }
- this.setAttribute("usercontextid", aUserContextId);
- } else {
- if (this.linkedBrowser) {
- this.linkedBrowser.removeAttribute("usercontextid");
- }
- this.removeAttribute("usercontextid");
- }
-
- ContextualIdentityService.setTabStyle(this);
- ]]>
- </body>
- </method>
</implementation>
<handlers>
@@ -7047,30 +6914,9 @@
<handlers>
<handler event="popupshowing">
<![CDATA[
- if (event.target.getAttribute("id") == "alltabs_containersMenuTab") {
- createUserContextMenu(event);
- return;
- }
-
- let containersEnabled = Services.prefs.getBoolPref("privacy.userContext.enabled");
-
- if (event.target.getAttribute("anonid") == "newtab-popup" ||
- event.target.id == "newtab-popup") {
- createUserContextMenu(event);
- } else {
- document.getElementById("alltabs-popup-separator-1").hidden = !containersEnabled;
- let containersTab = document.getElementById("alltabs_containersTab");
-
- containersTab.hidden = !containersEnabled;
- if (PrivateBrowsingUtils.isWindowPrivate(window)) {
- containersTab.setAttribute("disabled", "true");
- }
-
document.getElementById("alltabs_undoCloseTab").disabled =
SessionStore.getClosedTabCount(window) == 0;
- var tabcontainer = gBrowser.tabContainer;
-
// Listen for changes in the tab bar.
tabcontainer.addEventListener("TabAttrModified", this, false);
tabcontainer.addEventListener("TabClose", this, false);
@@ -7087,9 +6933,6 @@
<handler event="popuphidden">
<![CDATA[
- if (event.target.getAttribute("id") == "alltabs_containersMenuTab") {
- return;
- }
// clear out the menu popup and remove the listeners
for (let i = this.childNodes.length - 1; i > 0; i--) {
@@ -7098,9 +6941,6 @@
menuItem.tab.mCorrespondingMenuitem = null;
this.removeChild(menuItem);
}
- if (menuItem.hasAttribute("usercontextid")) {
- this.removeChild(menuItem);
- }
}
var tabcontainer = gBrowser.tabContainer;
tabcontainer.mTabstrip.removeEventListener("scroll", this, false);
diff --git a/application/basilisk/base/content/urlbarBindings.xml b/application/basilisk/base/content/urlbarBindings.xml
index eb31505812..b9c17818ab 100644
--- a/application/basilisk/base/content/urlbarBindings.xml
+++ b/application/basilisk/base/content/urlbarBindings.xml
@@ -56,11 +56,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
<field name="AppConstants" readonly="true">
(Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants;
</field>
-#ifdef MOZ_WEBEXTENSIONS
- <field name="ExtensionSearchHandler" readonly="true">
- (Components.utils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler;
- </field>
-#endif
<constructor><![CDATA[
this._prefs = Components.classes["@mozilla.org/preferences-service;1"]
@@ -488,15 +483,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
actionDetails
);
break;
-#ifdef MOZ_WEBEXTENSIONS
- case "extension":
- this.handleRevert();
- // Give the extension control of handling the command.
- let searchString = action.params.content;
- let keyword = action.params.keyword;
- this.ExtensionSearchHandler.handleInputEntered(keyword, searchString, where);
- return;
-#endif
}
} else {
// This is a fallback for add-ons and old testing code that directly
@@ -554,6 +540,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
Cu.reportError(ex);
}
+ // Reset DOS mitigations for the basic auth prompt.
+ delete browser.authPromptCounter;
+
let params = {
postData,
allowThirdPartyFixup: true,
@@ -1214,11 +1203,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
this._clearNoActions();
this.formatValue();
}
-#ifdef MOZ_WEBEXTENSIONS
- if (ExtensionSearchHandler.hasActiveInputSession()) {
- ExtensionSearchHandler.handleInputCancelled();
- }
-#endif
]]></handler>
<handler event="dragstart" phase="capturing"><![CDATA[
diff --git a/application/basilisk/base/content/utilityOverlay.js b/application/basilisk/base/content/utilityOverlay.js
index 38ca82f554..f3ebf3b7eb 100644
--- a/application/basilisk/base/content/utilityOverlay.js
+++ b/application/basilisk/base/content/utilityOverlay.js
@@ -5,7 +5,6 @@
// Services = object with smart getters for common XPCOM services
Components.utils.import("resource://gre/modules/AppConstants.jsm");
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
@@ -61,16 +60,6 @@ function openTopWin(url) {
openUILinkIn(url, "current");
}
-function getBoolPref(prefname, def)
-{
- try {
- return Services.prefs.getBoolPref(prefname);
- }
- catch (er) {
- return def;
- }
-}
-
/* openUILink handles clicks on UI elements that cause URLs to load.
*
* As the third argument, you may pass an object with the same properties as
@@ -137,7 +126,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
// ignoreButton allows "middle-click paste" to use function without always opening in a new window.
var middle = !ignoreButton && e.button == 1;
- var middleUsesTabs = getBoolPref("browser.tabs.opentabfor.middleclick", true);
+ var middleUsesTabs = Services.prefs.getBoolPref("browser.tabs.opentabfor.middleclick", true);
// Don't do anything special with right-mouse clicks. They're probably clicks on context menu items.
@@ -145,7 +134,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
if (metaKey || (middle && middleUsesTabs))
return shift ? "tabshifted" : "tab";
- if (alt && getBoolPref("browser.altClickSave", false))
+ if (alt && Services.prefs.getBoolPref("browser.altClickSave", false))
return "save";
if (shift || (middle && !middleUsesTabs))
@@ -176,7 +165,6 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
* skipTabAnimation (boolean)
* allowPinnedTabHostChange (boolean)
* allowPopups (boolean)
- * userContextId (unsigned int)
*/
function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) {
var params;
@@ -222,7 +210,6 @@ function openLinkIn(url, where, params) {
var aAllowPinnedTabHostChange = !!params.allowPinnedTabHostChange;
var aNoReferrer = params.noReferrer;
var aAllowPopups = !!params.allowPopups;
- var aUserContextId = params.userContextId;
var aIndicateErrorPageLoad = params.indicateErrorPageLoad;
var aPrincipal = params.originPrincipal;
var aTriggeringPrincipal = params.triggeringPrincipal;
@@ -268,7 +255,6 @@ function openLinkIn(url, where, params) {
function useOAForPrincipal(principal) {
if (principal && principal.isCodebasePrincipal) {
let attrs = {
- userContextId: aUserContextId,
privateBrowsingId: aIsPrivate || (w && PrivateBrowsingUtils.isWindowPrivate(w)),
};
return Services.scriptSecurityManager.createCodebasePrincipal(principal.URI, attrs);
@@ -315,17 +301,12 @@ function openLinkIn(url, where, params) {
createInstance(Ci.nsISupportsPRUint32);
referrerPolicySupports.data = aReferrerPolicy;
- var userContextIdSupports = Cc["@mozilla.org/supports-PRUint32;1"].
- createInstance(Ci.nsISupportsPRUint32);
- userContextIdSupports.data = aUserContextId;
-
sa.appendElement(wuri, /* weak =*/ false);
sa.appendElement(charset, /* weak =*/ false);
sa.appendElement(referrerURISupports, /* weak =*/ false);
sa.appendElement(aPostData, /* weak =*/ false);
sa.appendElement(allowThirdPartyFixupSupports, /* weak =*/ false);
sa.appendElement(referrerPolicySupports, /* weak =*/ false);
- sa.appendElement(userContextIdSupports, /* weak =*/ false);
sa.appendElement(aPrincipal, /* weak =*/ false);
sa.appendElement(aTriggeringPrincipal, /* weak =*/ false);
@@ -342,7 +323,7 @@ function openLinkIn(url, where, params) {
if (loadInBackground == null) {
loadInBackground = aFromChrome ?
false :
- getBoolPref("browser.tabs.loadInBackground");
+ Services.prefs.getBoolPref("browser.tabs.loadInBackground");
}
let uriObj;
@@ -418,8 +399,7 @@ function openLinkIn(url, where, params) {
flags: flags,
referrerURI: aNoReferrer ? null : aReferrerURI,
referrerPolicy: aReferrerPolicy,
- postData: aPostData,
- userContextId: aUserContextId
+ postData: aPostData
});
browserUsedForLoad = aCurrentBrowser;
break;
@@ -438,7 +418,6 @@ function openLinkIn(url, where, params) {
skipAnimation: aSkipTabAnimation,
allowMixedContent: aAllowMixedContent,
noReferrer: aNoReferrer,
- userContextId: aUserContextId,
originPrincipal: aPrincipal,
triggeringPrincipal: aTriggeringPrincipal,
});
@@ -482,74 +461,6 @@ function checkForMiddleClick(node, event) {
}
}
-// Populate a menu with user-context menu items. This method should be called
-// by onpopupshowing passing the event as first argument.
-function createUserContextMenu(event, isContextMenu = false, excludeUserContextId = 0) {
- while (event.target.hasChildNodes()) {
- event.target.removeChild(event.target.firstChild);
- }
-
- let bundle = document.getElementById("bundle_browser");
- let docfrag = document.createDocumentFragment();
-
- // If we are excluding a userContextId, we want to add a 'no-container' item.
- if (excludeUserContextId) {
- let menuitem = document.createElement("menuitem");
- menuitem.setAttribute("data-usercontextid", "0");
- menuitem.setAttribute("label", bundle.getString("userContextNone.label"));
- menuitem.setAttribute("accesskey", bundle.getString("userContextNone.accesskey"));
-
- // We don't set an oncommand/command attribute because if we have
- // to exclude a userContextId we are generating the contextMenu and
- // isContextMenu will be true.
-
- docfrag.appendChild(menuitem);
-
- let menuseparator = document.createElement("menuseparator");
- docfrag.appendChild(menuseparator);
- }
-
- ContextualIdentityService.getIdentities().forEach(identity => {
- if (identity.userContextId == excludeUserContextId) {
- return;
- }
-
- let menuitem = document.createElement("menuitem");
- menuitem.setAttribute("data-usercontextid", identity.userContextId);
- menuitem.setAttribute("label", ContextualIdentityService.getUserContextLabel(identity.userContextId));
-
- if (identity.accessKey) {
- menuitem.setAttribute("accesskey", bundle.getString(identity.accessKey));
- }
-
- menuitem.classList.add("menuitem-iconic");
- menuitem.setAttribute("data-identity-color", identity.color);
-
- if (!isContextMenu) {
- menuitem.setAttribute("command", "Browser:NewUserContextTab");
- }
-
- menuitem.setAttribute("data-identity-icon", identity.icon);
-
- docfrag.appendChild(menuitem);
- });
-
- if (!isContextMenu) {
- docfrag.appendChild(document.createElement("menuseparator"));
-
- let menuitem = document.createElement("menuitem");
- menuitem.setAttribute("label",
- bundle.getString("userContext.aboutPage.label"));
- menuitem.setAttribute("accesskey",
- bundle.getString("userContext.aboutPage.accesskey"));
- menuitem.setAttribute("command", "Browser:OpenAboutContainers");
- docfrag.appendChild(menuitem);
- }
-
- event.target.appendChild(docfrag);
- return true;
-}
-
// Closes all popups that are ancestors of the node.
function closeMenus(node)
{
@@ -652,7 +563,7 @@ function getShellService()
function isBidiEnabled() {
// first check the pref.
- if (getBoolPref("bidi.browser.ui", false))
+ if (Services.prefs.getBoolPref("bidi.browser.ui", false))
return true;
// then check intl.uidirection.<locale>
@@ -914,7 +825,7 @@ function openHelpLink(aHelpTopic, aCalledFromModal, aWhere) {
function openPrefsHelp() {
// non-instant apply prefwindows are usually modal, so we can't open in the topmost window,
// since its probably behind the window.
- var instantApply = getBoolPref("browser.preferences.instantApply");
+ var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic;
openHelpLink(helpTopic, !instantApply);
diff --git a/application/basilisk/base/jar.mn b/application/basilisk/base/jar.mn
index c288685b94..3b51e9555c 100644
--- a/application/basilisk/base/jar.mn
+++ b/application/basilisk/base/jar.mn
@@ -15,7 +15,6 @@ browser.jar:
* content/browser/aboutDialog.xul (content/aboutDialog.xul)
content/browser/aboutDialog.js (content/aboutDialog.js)
content/browser/aboutDialog.css (content/aboutDialog.css)
- content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml)
* content/browser/abouthome/aboutHome.xhtml (content/abouthome/aboutHome.xhtml)
content/browser/abouthome/aboutHome.js (content/abouthome/aboutHome.js)
* content/browser/abouthome/aboutHome.css (content/abouthome/aboutHome.css)
@@ -59,8 +58,6 @@ browser.jar:
content/browser/aboutaccounts/images/graphic_sync_intro@2x.png (content/aboutaccounts/images/graphic_sync_intro@2x.png)
- content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
- content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
content/browser/aboutTabCrashed.css (content/aboutTabCrashed.css)
content/browser/aboutTabCrashed.js (content/aboutTabCrashed.js)
content/browser/aboutTabCrashed.xhtml (content/aboutTabCrashed.xhtml)
@@ -95,7 +92,7 @@ browser.jar:
#endif
content/browser/browser-thumbnails.js (content/browser-thumbnails.js)
content/browser/browser-trackingprotection.js (content/browser-trackingprotection.js)
-* content/browser/tab-content.js (content/tab-content.js)
+ content/browser/tab-content.js (content/tab-content.js)
content/browser/content.js (content/content.js)
content/browser/defaultthemes/1.footer.jpg (content/defaultthemes/1.footer.jpg)
content/browser/defaultthemes/1.header.jpg (content/defaultthemes/1.header.jpg)
@@ -163,7 +160,7 @@ browser.jar:
content/browser/contentSearchUI.css (content/contentSearchUI.css)
content/browser/tabbrowser.css (content/tabbrowser.css)
content/browser/tabbrowser.xml (content/tabbrowser.xml)
-* content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
+ content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
content/browser/utilityOverlay.js (content/utilityOverlay.js)
content/browser/usercontext.svg (content/usercontext.svg)
content/browser/web-panels.js (content/web-panels.js)
diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc
index fb0e6b79bf..307d889d9f 100644
--- a/application/basilisk/branding/shared/uaoverrides.inc
+++ b/application/basilisk/branding/shared/uaoverrides.inc
@@ -26,6 +26,7 @@ pref("@GUAO_PREF@.addons.mozilla.org", "Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@)
// Required for domains that have proven unresponsive to requests from users
pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0 @APP_SLICE@");
pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0");
+pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (@OS_SLICE@ rv:42.0) @GK_SLICE@ Firefox/42.0 @APP_SLICE@");
// The never-ending Facebook debacle...
@@ -36,6 +37,7 @@ pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@
// The following requires native mode. Or it blocks.. "too old firefox", breakage, etc.
// UA-Sniffing domains below have indicated no interest in supporting Pale Moon (BOO!)
+pref("@GUAO_PREF@.whatsapp.com","Mozilla/5.0 (@OS_SLICE@ rv:61.0) @GK_SLICE@ Firefox/61.0");
// UA-sniffing domains that are "app/vendor-specific" and do not like Pale Moon
diff --git a/application/basilisk/components/about/AboutRedirector.cpp b/application/basilisk/components/about/AboutRedirector.cpp
index b77949ea7d..2b86084840 100644
--- a/application/basilisk/components/about/AboutRedirector.cpp
+++ b/application/basilisk/components/about/AboutRedirector.cpp
@@ -80,11 +80,6 @@ static RedirEntry kRedirMap[] = {
nsIAboutModule::ALLOW_SCRIPT
},
{
- "robots", "chrome://browser/content/aboutRobots.xhtml",
- nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT |
- nsIAboutModule::ALLOW_SCRIPT
- },
- {
"searchreset", "chrome://browser/content/search/searchReset.xhtml",
nsIAboutModule::ALLOW_SCRIPT |
nsIAboutModule::HIDE_FROM_ABOUTABOUT
diff --git a/application/basilisk/components/build/nsModule.cpp b/application/basilisk/components/build/nsModule.cpp
index 1baccd7103..4e082ab6c8 100644
--- a/application/basilisk/components/build/nsModule.cpp
+++ b/application/basilisk/components/build/nsModule.cpp
@@ -94,7 +94,6 @@ static const mozilla::Module::ContractIDEntry kBrowserContracts[] = {
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "feeds", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "privatebrowsing", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "rights", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
- { NS_ABOUT_MODULE_CONTRACTID_PREFIX "robots", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "searchreset", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "sessionrestore", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "welcomeback", &kNS_BROWSER_ABOUT_REDIRECTOR_CID },
diff --git a/application/basilisk/components/contextualidentity/content/usercontext.css b/application/basilisk/components/contextualidentity/content/usercontext.css
deleted file mode 100644
index 728275d9f8..0000000000
--- a/application/basilisk/components/contextualidentity/content/usercontext.css
+++ /dev/null
@@ -1,91 +0,0 @@
-[data-identity-color="blue"] {
- --identity-tab-color: #0996f8;
- --identity-icon-color: #00a7e0;
-}
-
-[data-identity-color="turquoise"] {
- --identity-tab-color: #01bdad;
- --identity-icon-color: #01bdad;
-}
-
-[data-identity-color="green"] {
- --identity-tab-color: #57bd35;
- --identity-icon-color: #7dc14c;
-}
-
-[data-identity-color="yellow"] {
- --identity-tab-color: #ffcb00;
- --identity-icon-color: #ffcb00;
-}
-
-[data-identity-color="orange"] {
- --identity-tab-color: #ff9216;
- --identity-icon-color: #ff9216;
-}
-
-[data-identity-color="red"] {
- --identity-tab-color: #d92215;
- --identity-icon-color: #d92215;
-}
-
-[data-identity-color="pink"] {
- --identity-tab-color: #ea385e;
- --identity-icon-color: #ee5195;
-}
-
-[data-identity-color="purple"] {
- --identity-tab-color: #7a2f7a;
- --identity-icon-color: #7a2f7a;
-}
-
-[data-identity-icon="fingerprint"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#fingerprint");
-}
-
-[data-identity-icon="briefcase"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#briefcase");
-}
-
-[data-identity-icon="dollar"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#dollar");
-}
-
-[data-identity-icon="cart"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#cart");
-}
-
-[data-identity-icon="circle"] {
- --identity-icon: url("chrome://browser/content/usercontext.svg#circle");
-}
-
-#userContext-indicator {
- height: 16px;
- width: 16px;
-}
-
-#userContext-label {
- margin-inline-end: 3px;
- color: var(--identity-tab-color);
-}
-
-#userContext-icons {
- -moz-box-align: center;
-}
-
-.tabbrowser-tab[usercontextid] {
- background-image: linear-gradient(to right, transparent 20%, var(--identity-tab-color) 30%, var(--identity-tab-color) 70%, transparent 80%);
- background-size: auto 2px;
- background-repeat: no-repeat;
-}
-
-.userContext-icon,
-.menuitem-iconic[data-usercontextid] > .menu-iconic-left > .menu-iconic-icon,
-.subviewbutton[usercontextid] > .toolbarbutton-icon,
-#userContext-indicator {
- background-image: var(--identity-icon);
- filter: url(chrome://browser/skin/filters.svg#fill);
- fill: var(--identity-icon-color);
- background-size: contain;
- background-repeat: no-repeat;
- background-position: center center;
-}
diff --git a/application/basilisk/components/contextualidentity/jar.mn b/application/basilisk/components/contextualidentity/jar.mn
deleted file mode 100644
index 848245949a..0000000000
--- a/application/basilisk/components/contextualidentity/jar.mn
+++ /dev/null
@@ -1,6 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-browser.jar:
- content/browser/usercontext/usercontext.css (content/usercontext.css)
diff --git a/application/basilisk/components/contextualidentity/moz.build b/application/basilisk/components/contextualidentity/moz.build
deleted file mode 100644
index aac3a838c4..0000000000
--- a/application/basilisk/components/contextualidentity/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JAR_MANIFESTS += ['jar.mn']
diff --git a/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm
index 09b3f167e3..401b7ca747 100644
--- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm
+++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm
@@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu",
"resource://gre/modules/CharsetMenu.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyGetter(this, "CharsetBundle", function() {
const kCharsetBundle = "chrome://global/locale/charsetMenu.properties";
@@ -977,89 +975,6 @@ const CustomizableWidgets = [
let win = aEvent.view;
win.MailIntegration.sendLinkForBrowser(win.gBrowser.selectedBrowser)
}
- }, {
- id: "containers-panelmenu",
- type: "view",
- viewId: "PanelUI-containers",
- hasObserver: false,
- onCreated: function(aNode) {
- let doc = aNode.ownerDocument;
- let win = doc.defaultView;
- let items = doc.getElementById("PanelUI-containersItems");
-
- let onItemCommand = function (aEvent) {
- let item = aEvent.target;
- if (item.hasAttribute("usercontextid")) {
- let userContextId = parseInt(item.getAttribute("usercontextid"));
- win.openUILinkIn(win.BROWSER_NEW_TAB_URL, "tab", {userContextId});
- }
- };
- items.addEventListener("command", onItemCommand);
-
- if (PrivateBrowsingUtils.isWindowPrivate(win)) {
- aNode.setAttribute("disabled", "true");
- }
-
- this.updateVisibility(aNode);
-
- if (!this.hasObserver) {
- Services.prefs.addObserver("privacy.userContext.enabled", this, true);
- this.hasObserver = true;
- }
- },
- onViewShowing: function(aEvent) {
- let doc = aEvent.target.ownerDocument;
-
- let items = doc.getElementById("PanelUI-containersItems");
-
- while (items.firstChild) {
- items.firstChild.remove();
- }
-
- let fragment = doc.createDocumentFragment();
- let bundle = doc.getElementById("bundle_browser");
-
- ContextualIdentityService.getIdentities().forEach(identity => {
- let label = ContextualIdentityService.getUserContextLabel(identity.userContextId);
-
- let item = doc.createElementNS(kNSXUL, "toolbarbutton");
- item.setAttribute("label", label);
- item.setAttribute("usercontextid", identity.userContextId);
- item.setAttribute("class", "subviewbutton");
- item.setAttribute("data-identity-color", identity.color);
- item.setAttribute("data-identity-icon", identity.icon);
-
- fragment.appendChild(item);
- });
-
- fragment.appendChild(doc.createElementNS(kNSXUL, "menuseparator"));
-
- let item = doc.createElementNS(kNSXUL, "toolbarbutton");
- item.setAttribute("label", bundle.getString("userContext.aboutPage.label"));
- item.setAttribute("command", "Browser:OpenAboutContainers");
- item.setAttribute("class", "subviewbutton");
- fragment.appendChild(item);
-
- items.appendChild(fragment);
- },
-
- updateVisibility(aNode) {
- aNode.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled");
- },
-
- observe(aSubject, aTopic, aData) {
- let {instances} = CustomizableUI.getWidget("containers-panelmenu");
- for (let {node} of instances) {
- if (node) {
- this.updateVisibility(node);
- }
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsISupportsWeakReference,
- Ci.nsIObserver
- ]),
}];
let preferencesButton = {
diff --git a/application/basilisk/components/moz.build b/application/basilisk/components/moz.build
index 07e79bc363..65e8beb761 100644
--- a/application/basilisk/components/moz.build
+++ b/application/basilisk/components/moz.build
@@ -6,7 +6,6 @@
DIRS += [
'about',
- 'contextualidentity',
'customizableui',
'dirprovider',
'downloads',
@@ -24,9 +23,6 @@ DIRS += [
'translation',
]
-if CONFIG['MOZ_WEBEXTENSIONS']:
- DIRS += ['webextensions']
-
DIRS += ['build']
XPIDL_SOURCES += [
diff --git a/application/basilisk/components/preferences/connection.js b/application/basilisk/components/preferences/connection.js
index f6b395a2dd..349139bed3 100644
--- a/application/basilisk/components/preferences/connection.js
+++ b/application/basilisk/components/preferences/connection.js
@@ -76,7 +76,7 @@ var gConnectionsDialog = {
var autologinProxyPref = document.getElementById("signon.autologin.proxy");
autologinProxyPref.disabled = proxyTypePref.value == 0;
var noProxiesPref = document.getElementById("network.proxy.no_proxies_on");
- noProxiesPref.disabled = proxyTypePref.value != 1;
+ noProxiesPref.disabled = proxyTypePref.value == 0;
var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url");
autoconfigURLPref.disabled = proxyTypePref.value != 2;
diff --git a/application/basilisk/components/preferences/connection.xul b/application/basilisk/components/preferences/connection.xul
index a3f0d082a9..1eb0c1544a 100644
--- a/application/basilisk/components/preferences/connection.xul
+++ b/application/basilisk/components/preferences/connection.xul
@@ -145,9 +145,6 @@
</radiogroup>
</box>
</row>
- <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
- <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
- <label value="&noproxyExplain.label;" control="networkProxyNone"/>
</rows>
</grid>
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
@@ -162,6 +159,9 @@
</radiogroup>
</groupbox>
<separator class="thin"/>
+ <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
+ <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
+ <label value="&noproxyExplain.label;" control="networkProxyNone"/>
<checkbox id="autologinProxy"
label="&autologinproxy.label;"
accesskey="&autologinproxy.accesskey;"
diff --git a/application/basilisk/components/preferences/containers.js b/application/basilisk/components/preferences/containers.js
deleted file mode 100644
index 6ca5853f7f..0000000000
--- a/application/basilisk/components/preferences/containers.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
-
-const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties");
-
-const HTMLNS = "http://www.w3.org/1999/xhtml";
-
-let gContainersManager = {
- icons: [
- "fingerprint",
- "briefcase",
- "dollar",
- "cart",
- "circle"
- ],
-
- colors: [
- "blue",
- "turquoise",
- "green",
- "yellow",
- "orange",
- "red",
- "pink",
- "purple"
- ],
-
- onLoad() {
- let params = window.arguments[0] || {};
- this.init(params);
- },
-
- init(aParams) {
- this.userContextId = aParams.userContextId || null;
- this.identity = aParams.identity;
-
- if (aParams.windowTitle) {
- document.title = aParams.windowTitle;
- }
-
- const iconWrapper = document.getElementById("iconWrapper");
- iconWrapper.appendChild(this.createIconButtons());
-
- const colorWrapper = document.getElementById("colorWrapper");
- colorWrapper.appendChild(this.createColorSwatches());
-
- if (this.identity.name) {
- const name = document.getElementById("name");
- name.value = this.identity.name;
- this.checkForm();
- }
-
- this.setLabelsMinWidth();
-
- // This is to prevent layout jank caused by the svgs and outlines rendering at different times
- document.getElementById("containers-content").removeAttribute("hidden");
- },
-
- setLabelsMinWidth() {
- const labelMinWidth = containersBundle.GetStringFromName("containers.labelMinWidth");
- const labels = [
- document.getElementById("nameLabel"),
- document.getElementById("iconLabel"),
- document.getElementById("colorLabel")
- ];
- for (let label of labels) {
- label.style.minWidth = labelMinWidth;
- }
- },
-
- uninit() {
- },
-
- // Check if name string as to if the form can be submitted
- checkForm() {
- const name = document.getElementById("name");
- let btnApplyChanges = document.getElementById("btnApplyChanges");
- if (!name.value) {
- btnApplyChanges.setAttribute("disabled", true);
- } else {
- btnApplyChanges.removeAttribute("disabled");
- }
- },
-
- createIconButtons(defaultIcon) {
- let radiogroup = document.createElement("radiogroup");
- radiogroup.setAttribute("id", "icon");
- radiogroup.className = "icon-buttons";
-
- for (let icon of this.icons) {
- let iconSwatch = document.createElement("radio");
- iconSwatch.id = "iconbutton-" + icon;
- iconSwatch.name = "icon";
- iconSwatch.type = "radio";
- iconSwatch.value = icon;
-
- if (this.identity.icon && this.identity.icon == icon) {
- iconSwatch.setAttribute("selected", true);
- }
-
- iconSwatch.setAttribute("label",
- containersBundle.GetStringFromName(`containers.${icon}.label`));
- let iconElement = document.createElement("hbox");
- iconElement.className = 'userContext-icon';
- iconElement.setAttribute("data-identity-icon", icon);
-
- iconSwatch.appendChild(iconElement);
- radiogroup.appendChild(iconSwatch);
- }
-
- return radiogroup;
- },
-
- createColorSwatches(defaultColor) {
- let radiogroup = document.createElement("radiogroup");
- radiogroup.setAttribute("id", "color");
-
- for (let color of this.colors) {
- let colorSwatch = document.createElement("radio");
- colorSwatch.id = "colorswatch-" + color;
- colorSwatch.name = "color";
- colorSwatch.type = "radio";
- colorSwatch.value = color;
-
- if (this.identity.color && this.identity.color == color) {
- colorSwatch.setAttribute("selected", true);
- }
-
- colorSwatch.setAttribute("label",
- containersBundle.GetStringFromName(`containers.${color}.label`));
- let iconElement = document.createElement("hbox");
- iconElement.className = 'userContext-icon';
- iconElement.setAttribute("data-identity-icon", "circle");
- iconElement.setAttribute("data-identity-color", color);
-
- colorSwatch.appendChild(iconElement);
- radiogroup.appendChild(colorSwatch);
- }
- return radiogroup;
- },
-
- onApplyChanges() {
- let icon = document.getElementById("icon").value;
- let color = document.getElementById("color").value;
- let name = document.getElementById("name").value;
-
- if (this.icons.indexOf(icon) == -1) {
- throw "Internal error. The icon value doesn't match.";
- }
-
- if (this.colors.indexOf(color) == -1) {
- throw "Internal error. The color value doesn't match.";
- }
-
- if (this.userContextId) {
- ContextualIdentityService.update(this.userContextId,
- name,
- icon,
- color);
- } else {
- ContextualIdentityService.create(name,
- icon,
- color);
- }
- window.parent.location.reload()
- },
-
- onWindowKeyPress(aEvent) {
- if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE)
- window.close();
- }
-}
diff --git a/application/basilisk/components/preferences/containers.xul b/application/basilisk/components/preferences/containers.xul
deleted file mode 100644
index 62a775fe40..0000000000
--- a/application/basilisk/components/preferences/containers.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/containers.css" type="text/css"?>
-
-<!DOCTYPE dialog SYSTEM "chrome://browser/locale/preferences/containers.dtd" >
-
-<window id="ContainersDialog" class="windowDialog"
- windowtype="Browser:Permissions"
- title="&window.title;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- style="width: &window.width;;"
- onload="gContainersManager.onLoad();"
- onunload="gContainersManager.uninit();"
- persist="screenX screenY width height"
- onkeypress="gContainersManager.onWindowKeyPress(event);">
-
- <script src="chrome://global/content/treeUtils.js"/>
- <script src="chrome://browser/content/preferences/containers.js"/>
-
- <stringbundle id="bundlePreferences"
- src="chrome://browser/locale/preferences/preferences.properties"/>
-
- <keyset>
- <key key="&windowClose.key;" modifiers="accel" oncommand="window.close();"/>
- </keyset>
-
- <vbox class="contentPane largeDialogContainer" flex="1" hidden="true" id="containers-content">
- <description id="permissionsText" control="url"/>
- <separator class="thin"/>
- <hbox align="start">
- <label id="nameLabel" control="url" value="&name.label;" accesskey="&name.accesskey;"/>
- <textbox id="name" flex="1" onkeyup="gContainersManager.checkForm();" />
- </hbox>
- <hbox align="center" id="iconWrapper">
- <label id="iconLabel" control="url" value="&icon.label;" accesskey="&icon.accesskey;"/>
- </hbox>
- <hbox align="center" id="colorWrapper">
- <label id="colorLabel" control="url" value="&color.label;" accesskey="&color.accesskey;"/>
- </hbox>
- </vbox>
- <vbox>
- <hbox class="actionButtons" align="right" flex="1">
- <button id="btnApplyChanges" disabled="true" oncommand="gContainersManager.onApplyChanges();" icon="save"
- label="&button.ok.label;" accesskey="&button.ok.accesskey;"/>
- </hbox>
- </vbox>
-</window>
diff --git a/application/basilisk/components/preferences/cookies.js b/application/basilisk/components/preferences/cookies.js
index c420855f89..4ede5b6e63 100644
--- a/application/basilisk/components/preferences/cookies.js
+++ b/application/basilisk/components/preferences/cookies.js
@@ -7,12 +7,8 @@ const nsICookie = Components.interfaces.nsICookie;
Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm")
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
-
var gCookiesWindow = {
_cm : Components.classes["@mozilla.org/cookiemanager;1"]
.getService(Components.interfaces.nsICookieManager),
@@ -38,10 +34,6 @@ var gCookiesWindow = {
this._populateList(true);
document.getElementById("filter").focus();
-
- if (!Services.prefs.getBoolPref("privacy.userContext.enabled")) {
- document.getElementById("userContextRow").hidden = true;
- }
},
uninit: function () {
@@ -82,24 +74,11 @@ var gCookiesWindow = {
aCookieB.originAttributes);
},
- _isPrivateCookie: function (aCookie) {
- let { userContextId } = aCookie.originAttributes;
- if (!userContextId) {
- // Default identity is public.
- return false;
- }
- return !ContextualIdentityService.getIdentityFromId(userContextId).public;
- },
-
observe: function (aCookie, aTopic, aData) {
if (aTopic != "cookie-changed")
return;
if (aCookie instanceof Components.interfaces.nsICookie) {
- if (this._isPrivateCookie(aCookie)) {
- return;
- }
-
var strippedHost = this._makeStrippedHost(aCookie.host);
if (aData == "changed")
this._handleCookieChanged(aCookie, strippedHost);
@@ -498,9 +477,6 @@ var gCookiesWindow = {
while (e.hasMoreElements()) {
var cookie = e.getNext();
if (cookie && cookie instanceof Components.interfaces.nsICookie) {
- if (this._isPrivateCookie(cookie)) {
- continue;
- }
var strippedHost = this._makeStrippedHost(cookie.host);
this._addCookie(strippedHost, cookie, hostCount);
@@ -524,17 +500,9 @@ var gCookiesWindow = {
return this._bundle.getString("expireAtEndOfSession");
},
- _getUserContextString: function(aUserContextId) {
- if (parseInt(aUserContextId) == 0) {
- return this._bundle.getString("defaultUserContextLabel");
- }
-
- return ContextualIdentityService.getUserContextLabel(aUserContextId);
- },
-
_updateCookieData: function (aItem) {
var seln = this._view.selection;
- var ids = ["name", "value", "host", "path", "isSecure", "expires", "userContext"];
+ var ids = ["name", "value", "host", "path", "isSecure", "expires"];
var properties;
if (aItem && !aItem.container && seln.count > 0) {
@@ -543,8 +511,7 @@ var gCookiesWindow = {
isDomain: aItem.isDomain ? this._bundle.getString("domainColon")
: this._bundle.getString("hostColon"),
isSecure: aItem.isSecure ? this._bundle.getString("forSecureOnly")
- : this._bundle.getString("forAnyConnection"),
- userContext: this._getUserContextString(aItem.originAttributes.userContextId) };
+ : this._bundle.getString("forAnyConnection") };
for (let id of ids) {
document.getElementById(id).disabled = false;
}
@@ -553,7 +520,7 @@ var gCookiesWindow = {
var noneSelected = this._bundle.getString("noCookieSelected");
properties = { name: noneSelected, value: noneSelected, host: noneSelected,
path: noneSelected, expires: noneSelected,
- isSecure: noneSelected, userContext: noneSelected };
+ isSecure: noneSelected };
for (let id of ids) {
document.getElementById(id).disabled = true;
}
diff --git a/application/basilisk/components/preferences/cookies.xul b/application/basilisk/components/preferences/cookies.xul
index bd60d9346a..d5fefdef72 100644
--- a/application/basilisk/components/preferences/cookies.xul
+++ b/application/basilisk/components/preferences/cookies.xul
@@ -85,10 +85,6 @@
<hbox pack="end"><label id="expiresLabel" control="expires" value="&props.expires.label;"/></hbox>
<textbox id="expires" readonly="true" class="plain"/>
</row>
- <row align="center" id="userContextRow">
- <hbox pack="end"><label id="userContextLabel" control="userContext" value="&props.container.label;"/></hbox>
- <textbox id="userContext" readonly="true" class="plain"/>
- </row>
</rows>
</grid>
</hbox>
diff --git a/application/basilisk/components/preferences/handlers.css b/application/basilisk/components/preferences/handlers.css
index 6af75a08b2..d5f100831e 100644
--- a/application/basilisk/components/preferences/handlers.css
+++ b/application/basilisk/components/preferences/handlers.css
@@ -10,10 +10,6 @@
-moz-binding: url("chrome://browser/content/preferences/handlers.xml#handler-selected");
}
-#containersView > richlistitem {
- -moz-binding: url("chrome://browser/content/preferences/handlers.xml#container");
-}
-
/**
* Make the icons appear.
* Note: we display the icon box for every item whether or not it has an icon
diff --git a/application/basilisk/components/preferences/handlers.xml b/application/basilisk/components/preferences/handlers.xml
index 0c629d7599..ad07a493c0 100644
--- a/application/basilisk/components/preferences/handlers.xml
+++ b/application/basilisk/components/preferences/handlers.xml
@@ -69,29 +69,6 @@
</binding>
- <binding id="container">
- <content>
- <xul:hbox flex="1" equalsize="always">
- <xul:hbox flex="1" align="center">
- <xul:hbox xbl:inherits="data-identity-icon=containerIcon,data-identity-color=containerColor" height="24" width="24" class="userContext-icon"/>
- <xul:label flex="1" crop="end" xbl:inherits="value=containerName"/>
- </xul:hbox>
- <xul:hbox flex="1" align="right">
- <xul:button anonid="preferencesButton"
- xbl:inherits="value=userContextId"
- onclick="gContainersPane.onPeferenceClick(event.originalTarget)">
- Preferences
- </xul:button>
- <xul:button anonid="removeButton"
- xbl:inherits="value=userContextId"
- onclick="gContainersPane.onRemoveClick(event.originalTarget)">
- Remove
- </xul:button>
- </xul:hbox>
- </xul:hbox>
- </content>
- </binding>
-
<binding id="offlineapp"
extends="chrome://global/content/bindings/listbox.xml#listitem">
<content>
diff --git a/application/basilisk/components/preferences/in-content/advanced.js b/application/basilisk/components/preferences/in-content/advanced.js
index 5f9458eeea..850f0e09fb 100644
--- a/application/basilisk/components/preferences/in-content/advanced.js
+++ b/application/basilisk/components/preferences/in-content/advanced.js
@@ -670,25 +670,6 @@ var gAdvancedPane = {
// or the binary platform or OS version is not known.
// A locked pref is sufficient to disable the radiogroup.
radiogroup.disabled = !canCheck || enabledPref.locked || autoPref.locked;
-
- if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
- // Check to see if the maintenance service is installed.
- // If it is don't show the preference at all.
- var installed;
- try {
- var wrk = Components.classes["@mozilla.org/windows-registry-key;1"]
- .createInstance(Components.interfaces.nsIWindowsRegKey);
- wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
- "SOFTWARE\\Mozilla\\MaintenanceService",
- wrk.ACCESS_READ | wrk.WOW64_64);
- installed = wrk.readIntValue("Installed");
- wrk.close();
- } catch (e) {
- }
- if (installed != 1) {
- document.getElementById("useService").hidden = true;
- }
- }
}
},
diff --git a/application/basilisk/components/preferences/in-content/advanced.xul b/application/basilisk/components/preferences/in-content/advanced.xul
index 4973f8e091..50e2765012 100644
--- a/application/basilisk/components/preferences/in-content/advanced.xul
+++ b/application/basilisk/components/preferences/in-content/advanced.xul
@@ -79,12 +79,6 @@
<preference id="app.update.disable_button.showUpdateHistory"
name="app.update.disable_button.showUpdateHistory"
type="bool"/>
-
-#ifdef MOZ_MAINTENANCE_SERVICE
- <preference id="app.update.service.enabled"
- name="app.update.service.enabled"
- type="bool"/>
-#endif
#endif
<preference id="browser.search.update"
@@ -331,13 +325,6 @@
accesskey="&updateHistory.accesskey;"
preference="app.update.disable_button.showUpdateHistory"/>
</hbox>
-
-#ifdef MOZ_MAINTENANCE_SERVICE
- <checkbox id="useService"
- label="&useService.label;"
- accesskey="&useService.accesskey;"
- preference="app.update.service.enabled"/>
-#endif
</groupbox>
#endif
<groupbox id="updateOthers" align="start">
diff --git a/application/basilisk/components/preferences/in-content/containers.js b/application/basilisk/components/preferences/in-content/containers.js
deleted file mode 100644
index 758e45fffd..0000000000
--- a/application/basilisk/components/preferences/in-content/containers.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-Components.utils.import("resource://gre/modules/ContextualIdentityService.jsm");
-
-const containersBundle = Services.strings.createBundle("chrome://browser/locale/preferences/containers.properties");
-
-const defaultContainerIcon = "fingerprint";
-const defaultContainerColor = "blue";
-
-let gContainersPane = {
-
- init() {
- this._list = document.getElementById("containersView");
-
- document.getElementById("backContainersLink").addEventListener("click", function () {
- gotoPref("privacy");
- });
-
- this._rebuildView();
- },
-
- _rebuildView() {
- const containers = ContextualIdentityService.getIdentities();
- while (this._list.firstChild) {
- this._list.firstChild.remove();
- }
- for (let container of containers) {
- let item = document.createElement("richlistitem");
- item.setAttribute("containerName", ContextualIdentityService.getUserContextLabel(container.userContextId));
- item.setAttribute("containerIcon", container.icon);
- item.setAttribute("containerColor", container.color);
- item.setAttribute("userContextId", container.userContextId);
-
- this._list.appendChild(item);
- }
- },
-
- onRemoveClick(button) {
- let userContextId = button.getAttribute("value");
- ContextualIdentityService.remove(userContextId);
- this._rebuildView();
- },
- onPeferenceClick(button) {
- this.openPreferenceDialog(button.getAttribute("value"));
- },
-
- onAddButtonClick(button) {
- this.openPreferenceDialog(null);
- },
-
- openPreferenceDialog(userContextId) {
- let identity = {
- name: "",
- icon: defaultContainerIcon,
- color: defaultContainerColor
- };
- let title;
- if (userContextId) {
- identity = ContextualIdentityService.getIdentityFromId(userContextId);
- // This is required to get the translation string from defaults
- identity.name = ContextualIdentityService.getUserContextLabel(identity.userContextId);
- title = containersBundle.formatStringFromName("containers.updateContainerTitle", [identity.name], 1);
- }
-
- const params = { userContextId, identity, windowTitle: title };
- gSubDialog.open("chrome://browser/content/preferences/containers.xul",
- null, params);
- }
-
-};
diff --git a/application/basilisk/components/preferences/in-content/containers.xul b/application/basilisk/components/preferences/in-content/containers.xul
deleted file mode 100644
index e83bac1c35..0000000000
--- a/application/basilisk/components/preferences/in-content/containers.xul
+++ /dev/null
@@ -1,54 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-<!-- Containers panel -->
-
-<script type="application/javascript"
- src="chrome://browser/content/preferences/in-content/containers.js"/>
-
-<preferences id="containerPreferences" hidden="true" data-category="paneContainer">
- <!-- Containers -->
- <preference id="privacy.userContext.enabled"
- name="privacy.userContext.enabled"
- type="bool"/>
-
-</preferences>
-
-<hbox hidden="true"
- class="container-header-links"
- data-category="paneContainers">
- <label class="text-link" id="backContainersLink" value="&backLink.label;" />
-</hbox>
-
-<hbox id="header-containers"
- class="header"
- hidden="true"
- data-category="paneContainers">
- <label class="header-name" flex="1">&paneContainers.title;</label>
- <button class="help-button"
- aria-label="&helpButton.label;"/>
-</hbox>
-
-<!-- Containers -->
-<groupbox id="browserContainersGroup" data-category="paneContainers" hidden="true">
- <vbox id="browserContainersbox">
-
- <richlistbox id="containersView" orient="vertical" persist="lastSelectedType"
- flex="1">
- <listheader equalsize="always">
- <treecol id="typeColumn" label="&label.label;" value="type"
- persist="sortDirection"
- flex="1" sortDirection="ascending"/>
- <treecol id="actionColumn" value="action"
- persist="sortDirection"
- flex="1"/>
- </listheader>
- </richlistbox>
- </vbox>
- <vbox>
- <hbox flex="1">
- <button onclick="gContainersPane.onAddButtonClick();" accesskey="&addButton.accesskey;" label="&addButton.label;"/>
- </hbox>
- </vbox>
-</groupbox>
diff --git a/application/basilisk/components/preferences/in-content/jar.mn b/application/basilisk/components/preferences/in-content/jar.mn
index e61a888569..70544f3321 100644
--- a/application/basilisk/components/preferences/in-content/jar.mn
+++ b/application/basilisk/components/preferences/in-content/jar.mn
@@ -9,7 +9,6 @@ browser.jar:
content/browser/preferences/in-content/main.js
* content/browser/preferences/in-content/privacy.js
- content/browser/preferences/in-content/containers.js
content/browser/preferences/in-content/advanced.js
content/browser/preferences/in-content/applications.js
* content/browser/preferences/in-content/content.js
diff --git a/application/basilisk/components/preferences/in-content/preferences.js b/application/basilisk/components/preferences/in-content/preferences.js
index e18ab4b045..35e10c58d3 100644
--- a/application/basilisk/components/preferences/in-content/preferences.js
+++ b/application/basilisk/components/preferences/in-content/preferences.js
@@ -61,7 +61,6 @@ function init_all() {
register_module("paneGeneral", gMainPane);
register_module("paneSearch", gSearchPane);
register_module("panePrivacy", gPrivacyPane);
- register_module("paneContainers", gContainersPane);
register_module("paneAdvanced", gAdvancedPane);
register_module("paneApplications", gApplicationsPane);
register_module("paneContent", gContentPane);
diff --git a/application/basilisk/components/preferences/in-content/preferences.xul b/application/basilisk/components/preferences/in-content/preferences.xul
index 7ec7ef119c..093516140c 100644
--- a/application/basilisk/components/preferences/in-content/preferences.xul
+++ b/application/basilisk/components/preferences/in-content/preferences.xul
@@ -13,7 +13,6 @@
href="chrome://browser/content/preferences/handlers.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/applications.css"?>
<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/search.css"?>
-<?xml-stylesheet href="chrome://browser/skin/preferences/in-content/containers.css"?>
<!DOCTYPE page [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
@@ -27,8 +26,6 @@
<!ENTITY % syncDTD SYSTEM "chrome://browser/locale/preferences/sync.dtd">
<!ENTITY % securityDTD SYSTEM
"chrome://browser/locale/preferences/security.dtd">
-<!ENTITY % containersDTD SYSTEM
- "chrome://browser/locale/preferences/containers.dtd">
<!ENTITY % sanitizeDTD SYSTEM "chrome://browser/locale/sanitize.dtd">
<!ENTITY % mainDTD SYSTEM "chrome://browser/locale/preferences/main.dtd">
<!ENTITY % aboutHomeDTD SYSTEM "chrome://browser/locale/aboutHome.dtd">
@@ -46,7 +43,6 @@
%syncBrandDTD;
%syncDTD;
%securityDTD;
-%containersDTD;
%sanitizeDTD;
%mainDTD;
%aboutHomeDTD;
@@ -134,12 +130,6 @@
<label class="category-name" flex="1">&panePrivacy.title;</label>
</richlistitem>
- <richlistitem id="category-containers"
- class="category"
- value="paneContainers"
- helpTopic="prefs-containers"
- hidden="true"/>
-
<richlistitem id="category-security"
class="category"
value="paneSecurity"
@@ -183,7 +173,6 @@
#include main.xul
#include search.xul
#include privacy.xul
-#include containers.xul
#include advanced.xul
#include applications.xul
#include content.xul
diff --git a/application/basilisk/components/preferences/in-content/privacy.js b/application/basilisk/components/preferences/in-content/privacy.js
index eab606e364..a976fb4fae 100644
--- a/application/basilisk/components/preferences/in-content/privacy.js
+++ b/application/basilisk/components/preferences/in-content/privacy.js
@@ -5,8 +5,6 @@
Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/PluralForm.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@@ -62,59 +60,6 @@ var gPrivacyPane = {
},
/**
- * Show the Containers UI depending on the privacy.userContext.ui.enabled pref.
- */
- _initBrowserContainers: function () {
- if (!Services.prefs.getBoolPref("privacy.userContext.ui.enabled")) {
- return;
- }
-
- let link = document.getElementById("browserContainersLearnMore");
- link.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "containers";
-
- document.getElementById("browserContainersbox").hidden = false;
-
- document.getElementById("browserContainersCheckbox").checked =
- Services.prefs.getBoolPref("privacy.userContext.enabled");
- },
-
- _checkBrowserContainers: function(event) {
- let checkbox = document.getElementById("browserContainersCheckbox");
- if (checkbox.checked) {
- Services.prefs.setBoolPref("privacy.userContext.enabled", true);
- return;
- }
-
- let count = ContextualIdentityService.countContainerTabs();
- if (count == 0) {
- Services.prefs.setBoolPref("privacy.userContext.enabled", false);
- return;
- }
-
- let bundlePreferences = document.getElementById("bundlePreferences");
-
- let title = bundlePreferences.getString("disableContainersAlertTitle");
- let message = PluralForm.get(count, bundlePreferences.getString("disableContainersMsg"))
- .replace("#S", count)
- let okButton = PluralForm.get(count, bundlePreferences.getString("disableContainersOkButton"))
- .replace("#S", count)
- let cancelButton = bundlePreferences.getString("disableContainersButton2");
-
- let buttonFlags = (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) +
- (Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1);
-
- let rv = Services.prompt.confirmEx(window, title, message, buttonFlags,
- okButton, cancelButton, null, null, {});
- if (rv == 0) {
- ContextualIdentityService.closeAllContainerTabs();
- Services.prefs.setBoolPref("privacy.userContext.enabled", false);
- return;
- }
-
- checkbox.checked = true;
- },
-
- /**
* Sets up the UI for the number of days of history to keep, and updates the
* label of the "Clear Now..." button.
*/
@@ -136,7 +81,6 @@ var gPrivacyPane = {
this._initTrackingProtectionPBM();
#endif
this._initAutocomplete();
- this._initBrowserContainers();
setEventListener("privacy.sanitize.sanitizeOnShutdown", "change",
gPrivacyPane._updateSanitizeSettingsButton);
@@ -184,10 +128,6 @@ var gPrivacyPane = {
setEventListener("changeBlockListPBM", "command",
gPrivacyPane.showBlockLists);
#endif
- setEventListener("browserContainersCheckbox", "command",
- gPrivacyPane._checkBrowserContainers);
- setEventListener("browserContainersSettings", "command",
- gPrivacyPane.showContainerSettings);
},
#ifdef MOZ_SAFE_BROWSING
@@ -489,13 +429,6 @@ var gPrivacyPane = {
},
#endif
- /**
- * Displays container panel for customising and adding containers.
- */
- showContainerSettings() {
- gotoPref("containers");
- },
-
#ifdef MOZ_SAFE_BROWSING
/**
* Displays the available block lists for tracking protection.
@@ -702,25 +635,4 @@ var gPrivacyPane = {
settingsButton.disabled = !sanitizeOnShutdownPref.value;
},
-
- // CONTAINERS
-
- /*
- * preferences:
- *
- * privacy.userContext.enabled
- * - true if containers is enabled
- */
-
- /**
- * Enables/disables the Settings button used to configure containers
- */
- readBrowserContainersCheckbox: function ()
- {
- var pref = document.getElementById("privacy.userContext.enabled");
- var settings = document.getElementById("browserContainersSettings");
-
- settings.disabled = !pref.value;
- }
-
};
diff --git a/application/basilisk/components/preferences/in-content/privacy.xul b/application/basilisk/components/preferences/in-content/privacy.xul
index e6cdc5dd2c..691cd6bf9b 100644
--- a/application/basilisk/components/preferences/in-content/privacy.xul
+++ b/application/basilisk/components/preferences/in-content/privacy.xul
@@ -302,28 +302,3 @@
&suggestionSettings.label;
</label>
</groupbox>
-
-<!-- Containers -->
-<groupbox id="browserContainersGroup" data-category="panePrivacy" hidden="true">
- <vbox id="browserContainersbox" hidden="true">
- <caption><label>&browserContainersHeader.label;
- <label id="browserContainersLearnMore" class="text-link"
- value="&browserContainersLearnMore.label;"/>
- </label></caption>
- <hbox align="start">
- <vbox>
- <checkbox id="browserContainersCheckbox"
- label="&browserContainersEnabled.label;"
- accesskey="&browserContainersEnabled.accesskey;"
- preference="privacy.userContext.enabled"
- onsyncfrompreference="return gPrivacyPane.readBrowserContainersCheckbox();"/>
- </vbox>
- <spacer flex="1"/>
- <vbox>
- <button id="browserContainersSettings"
- label="&browserContainersSettings.label;"
- accesskey="&browserContainersSettings.accesskey;"/>
- </vbox>
- </hbox>
- </vbox>
-</groupbox>
diff --git a/application/basilisk/components/preferences/jar.mn b/application/basilisk/components/preferences/jar.mn
index 5b24e89df0..f74be08205 100644
--- a/application/basilisk/components/preferences/jar.mn
+++ b/application/basilisk/components/preferences/jar.mn
@@ -24,8 +24,6 @@ browser.jar:
* content/browser/preferences/languages.xul
content/browser/preferences/languages.js
content/browser/preferences/permissions.xul
- content/browser/preferences/containers.xul
- content/browser/preferences/containers.js
content/browser/preferences/permissions.js
content/browser/preferences/sanitize.xul
content/browser/preferences/sanitize.js
diff --git a/application/basilisk/components/sessionstore/ContentRestore.jsm b/application/basilisk/components/sessionstore/ContentRestore.jsm
index d4972bcafe..8b38676242 100644
--- a/application/basilisk/components/sessionstore/ContentRestore.jsm
+++ b/application/basilisk/components/sessionstore/ContentRestore.jsm
@@ -208,10 +208,6 @@ ContentRestoreInternal.prototype = {
? Utils.deserializePrincipal(loadArguments.triggeringPrincipal)
: null;
- if (loadArguments.userContextId) {
- webNavigation.setOriginAttributesBeforeLoading({ userContextId: loadArguments.userContextId });
- }
-
webNavigation.loadURIWithOptions(loadArguments.uri, loadArguments.flags,
referrer, referrerPolicy, postData,
null, null, triggeringPrincipal);
diff --git a/application/basilisk/components/sessionstore/SessionHistory.jsm b/application/basilisk/components/sessionstore/SessionHistory.jsm
index 3d28d87db8..907a60839d 100644
--- a/application/basilisk/components/sessionstore/SessionHistory.jsm
+++ b/application/basilisk/components/sessionstore/SessionHistory.jsm
@@ -64,11 +64,10 @@ var SessionHistoryInternal = {
* The docShell that owns the session history.
*/
collect: function (docShell) {
- let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
let webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
let history = webNavigation.sessionHistory.QueryInterface(Ci.nsISHistoryInternal);
- let data = {entries: [], userContextId: loadContext.originAttributes.userContextId };
+ let data = {entries: []};
if (history && history.count > 0) {
// Loop over the transaction linked list directly so we can get the
diff --git a/application/basilisk/components/sessionstore/SessionStore.jsm b/application/basilisk/components/sessionstore/SessionStore.jsm
index b599bc1627..086bb914a5 100644
--- a/application/basilisk/components/sessionstore/SessionStore.jsm
+++ b/application/basilisk/components/sessionstore/SessionStore.jsm
@@ -2204,10 +2204,9 @@ var SessionStoreInternal = {
}
// Create a new tab.
- let userContextId = aTab.getAttribute("usercontextid");
let newTab = aTab == aWindow.gBrowser.selectedTab ?
- aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab, userContextId}) :
- aWindow.gBrowser.addTab(null, {userContextId});
+ aWindow.gBrowser.addTab(null, {relatedToCurrent: true, ownerTab: aTab}) :
+ aWindow.gBrowser.addTab();
// Set tab title to "Connecting..." and start the throbber to pretend we're
// doing something while actually waiting for data from the frame script.
@@ -2296,7 +2295,7 @@ var SessionStoreInternal = {
// create a new tab
let tabbrowser = aWindow.gBrowser;
- let tab = tabbrowser.selectedTab = tabbrowser.addTab(null, state);
+ let tab = tabbrowser.selectedTab = tabbrowser.addTab();
// restore tab content
this.restoreTab(tab, state);
@@ -3100,31 +3099,13 @@ var SessionStoreInternal = {
let numVisibleTabs = 0;
for (var t = 0; t < newTabCount; t++) {
- // When trying to restore into existing tab, we also take the userContextId
- // into account if present.
- let userContextId = winData.tabs[t].userContextId;
- let reuseExisting = t < openTabCount &&
- (tabbrowser.tabs[t].getAttribute("usercontextid") == (userContextId || ""));
- // If the tab is pinned, then we'll be loading it right away, and
- // there's no need to cause a remoteness flip by loading it initially
- // non-remote.
- let forceNotRemote = !winData.tabs[t].pinned;
- let tab = reuseExisting ? tabbrowser.tabs[t] :
- tabbrowser.addTab("about:blank",
- {skipAnimation: true,
- forceNotRemote,
- userContextId,
- skipBackgroundNotify: true});
-
- // If we inserted a new tab because the userContextId didn't match with the
- // open tab, even though `t < openTabCount`, we need to remove that open tab
- // and put the newly added tab in its place.
- if (!reuseExisting && t < openTabCount) {
- tabbrowser.removeTab(tabbrowser.tabs[t]);
- tabbrowser.moveTabTo(tab, t);
- }
-
- tabs.push(tab);
+ tabs.push(t < openTabCount ?
+ tabbrowser.tabs[t] :
+ tabbrowser.addTab("about:blank", {
+ skipAnimation: true,
+ forceNotRemote: true,
+ skipBackgroundNotify: true
+ }));
if (winData.tabs[t].pinned)
tabbrowser.pinTab(tabs[t]);
@@ -3531,9 +3512,6 @@ var SessionStoreInternal = {
let uri = activePageData ? activePageData.url || null : null;
if (aLoadArguments) {
uri = aLoadArguments.uri;
- if (aLoadArguments.userContextId) {
- browser.setAttribute("usercontextid", aLoadArguments.userContextId);
- }
}
// We have to mark this tab as restoring first, otherwise
diff --git a/application/basilisk/components/sessionstore/TabState.jsm b/application/basilisk/components/sessionstore/TabState.jsm
index f22c52fe33..ac846031b9 100644
--- a/application/basilisk/components/sessionstore/TabState.jsm
+++ b/application/basilisk/components/sessionstore/TabState.jsm
@@ -181,10 +181,6 @@ var TabStateInternal = {
if (key === "history") {
tabData.entries = value.entries;
- if (value.hasOwnProperty("userContextId")) {
- tabData.userContextId = value.userContextId;
- }
-
if (value.hasOwnProperty("index")) {
tabData.index = value.index;
}
diff --git a/application/basilisk/components/webextensions/.eslintrc.js b/application/basilisk/components/webextensions/.eslintrc.js
deleted file mode 100644
index 81a11c4ac6..0000000000
--- a/application/basilisk/components/webextensions/.eslintrc.js
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": "../../../toolkit/components/extensions/.eslintrc.js",
-
- "globals": {
- "AllWindowEvents": true,
- "browserActionFor": true,
- "currentWindow": true,
- "EventEmitter": true,
- "getCookieStoreIdForTab": true,
- "IconDetails": true,
- "makeWidgetId": true,
- "pageActionFor": true,
- "PanelPopup": true,
- "TabContext": true,
- "ViewPopup": true,
- "WindowEventManager": true,
- "WindowListManager": true,
- "WindowManager": true,
- },
-};
diff --git a/application/basilisk/components/webextensions/ext-bookmarks.js b/application/basilisk/components/webextensions/ext-bookmarks.js
deleted file mode 100644
index 399f6212d3..0000000000
--- a/application/basilisk/components/webextensions/ext-bookmarks.js
+++ /dev/null
@@ -1,374 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-const {
- SingletonEventManager,
-} = ExtensionUtils;
-
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
- "resource://devtools/shared/event-emitter.js");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-let listenerCount = 0;
-
-function getTree(rootGuid, onlyChildren) {
- function convert(node, parent) {
- let treenode = {
- id: node.guid,
- title: node.title || "",
- index: node.index,
- dateAdded: node.dateAdded / 1000,
- };
-
- if (parent && node.guid != PlacesUtils.bookmarks.rootGuid) {
- treenode.parentId = parent.guid;
- }
-
- if (node.type == PlacesUtils.TYPE_X_MOZ_PLACE) {
- // This isn't quite correct. Recently Bookmarked ends up here ...
- treenode.url = node.uri;
- } else {
- treenode.dateGroupModified = node.lastModified / 1000;
-
- if (node.children && !onlyChildren) {
- treenode.children = node.children.map(child => convert(child, node));
- }
- }
-
- return treenode;
- }
-
- return PlacesUtils.promiseBookmarksTree(rootGuid, {
- excludeItemsCallback: item => {
- if (item.type == PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR) {
- return true;
- }
- return item.annos &&
- item.annos.find(a => a.name == PlacesUtils.EXCLUDE_FROM_BACKUP_ANNO);
- },
- }).then(root => {
- if (onlyChildren) {
- let children = root.children || [];
- return children.map(child => convert(child, root));
- }
- // It seems like the array always just contains the root node.
- return [convert(root, null)];
- }).catch(e => Promise.reject({message: e.message}));
-}
-
-function convert(result) {
- let node = {
- id: result.guid,
- title: result.title || "",
- index: result.index,
- dateAdded: result.dateAdded.getTime(),
- };
-
- if (result.guid != PlacesUtils.bookmarks.rootGuid) {
- node.parentId = result.parentGuid;
- }
-
- if (result.type == PlacesUtils.bookmarks.TYPE_BOOKMARK) {
- node.url = result.url.href; // Output is always URL object.
- } else {
- node.dateGroupModified = result.lastModified.getTime();
- }
-
- return node;
-}
-
-let observer = {
- skipTags: true,
- skipDescendantsOnItemRemoval: true,
-
- onBeginUpdateBatch() {},
- onEndUpdateBatch() {},
-
- onItemAdded(id, parentId, index, itemType, uri, title, dateAdded, guid, parentGuid, source) {
- if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) {
- return;
- }
-
- let bookmark = {
- id: guid,
- parentId: parentGuid,
- index,
- title,
- dateAdded: dateAdded / 1000,
- };
-
- if (itemType == PlacesUtils.bookmarks.TYPE_BOOKMARK) {
- bookmark.url = uri.spec;
- } else {
- bookmark.dateGroupModified = bookmark.dateAdded;
- }
-
- this.emit("created", bookmark);
- },
-
- onItemVisited() {},
-
- onItemMoved(id, oldParentId, oldIndex, newParentId, newIndex, itemType, guid, oldParentGuid, newParentGuid, source) {
- if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) {
- return;
- }
-
- let info = {
- parentId: newParentGuid,
- index: newIndex,
- oldParentId: oldParentGuid,
- oldIndex,
- };
- this.emit("moved", {guid, info});
- },
-
- onItemRemoved(id, parentId, index, itemType, uri, guid, parentGuid, source) {
- if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) {
- return;
- }
-
- let node = {
- id: guid,
- parentId: parentGuid,
- index,
- };
-
- if (itemType == PlacesUtils.bookmarks.TYPE_BOOKMARK) {
- node.url = uri.spec;
- }
-
- this.emit("removed", {guid, info: {parentId: parentGuid, index, node}});
- },
-
- onItemChanged(id, prop, isAnno, val, lastMod, itemType, parentId, guid, parentGuid, oldVal, source) {
- if (itemType == PlacesUtils.bookmarks.TYPE_SEPARATOR) {
- return;
- }
-
- let info = {};
- if (prop == "title") {
- info.title = val;
- } else if (prop == "uri") {
- info.url = val;
- } else {
- // Not defined yet.
- return;
- }
-
- this.emit("changed", {guid, info});
- },
-};
-EventEmitter.decorate(observer);
-
-function decrementListeners() {
- listenerCount -= 1;
- if (!listenerCount) {
- PlacesUtils.bookmarks.removeObserver(observer);
- }
-}
-
-function incrementListeners() {
- listenerCount++;
- if (listenerCount == 1) {
- PlacesUtils.bookmarks.addObserver(observer, false);
- }
-}
-
-extensions.registerSchemaAPI("bookmarks", "addon_parent", context => {
- return {
- bookmarks: {
- get: function(idOrIdList) {
- let list = Array.isArray(idOrIdList) ? idOrIdList : [idOrIdList];
-
- return Task.spawn(function* () {
- let bookmarks = [];
- for (let id of list) {
- let bookmark = yield PlacesUtils.bookmarks.fetch({guid: id});
- if (!bookmark) {
- throw new Error("Bookmark not found");
- }
- bookmarks.push(convert(bookmark));
- }
- return bookmarks;
- }).catch(error => Promise.reject({message: error.message}));
- },
-
- getChildren: function(id) {
- // TODO: We should optimize this.
- return getTree(id, true);
- },
-
- getTree: function() {
- return getTree(PlacesUtils.bookmarks.rootGuid, false);
- },
-
- getSubTree: function(id) {
- return getTree(id, false);
- },
-
- search: function(query) {
- return PlacesUtils.bookmarks.search(query).then(result => result.map(convert));
- },
-
- getRecent: function(numberOfItems) {
- return PlacesUtils.bookmarks.getRecent(numberOfItems).then(result => result.map(convert));
- },
-
- create: function(bookmark) {
- let info = {
- title: bookmark.title || "",
- };
-
- // If url is NULL or missing, it will be a folder.
- if (bookmark.url !== null) {
- info.type = PlacesUtils.bookmarks.TYPE_BOOKMARK;
- info.url = bookmark.url || "";
- } else {
- info.type = PlacesUtils.bookmarks.TYPE_FOLDER;
- }
-
- if (bookmark.index !== null) {
- info.index = bookmark.index;
- }
-
- if (bookmark.parentId !== null) {
- info.parentGuid = bookmark.parentId;
- } else {
- info.parentGuid = PlacesUtils.bookmarks.unfiledGuid;
- }
-
- try {
- return PlacesUtils.bookmarks.insert(info).then(convert)
- .catch(error => Promise.reject({message: error.message}));
- } catch (e) {
- return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
- }
- },
-
- move: function(id, destination) {
- let info = {
- guid: id,
- };
-
- if (destination.parentId !== null) {
- info.parentGuid = destination.parentId;
- }
- info.index = (destination.index === null) ?
- PlacesUtils.bookmarks.DEFAULT_INDEX : destination.index;
-
- try {
- return PlacesUtils.bookmarks.update(info).then(convert)
- .catch(error => Promise.reject({message: error.message}));
- } catch (e) {
- return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
- }
- },
-
- update: function(id, changes) {
- let info = {
- guid: id,
- };
-
- if (changes.title !== null) {
- info.title = changes.title;
- }
- if (changes.url !== null) {
- info.url = changes.url;
- }
-
- try {
- return PlacesUtils.bookmarks.update(info).then(convert)
- .catch(error => Promise.reject({message: error.message}));
- } catch (e) {
- return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
- }
- },
-
- remove: function(id) {
- let info = {
- guid: id,
- };
-
- // The API doesn't give you the old bookmark at the moment
- try {
- return PlacesUtils.bookmarks.remove(info, {preventRemovalOfNonEmptyFolders: true}).then(result => {})
- .catch(error => Promise.reject({message: error.message}));
- } catch (e) {
- return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
- }
- },
-
- removeTree: function(id) {
- let info = {
- guid: id,
- };
-
- try {
- return PlacesUtils.bookmarks.remove(info).then(result => {})
- .catch(error => Promise.reject({message: error.message}));
- } catch (e) {
- return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
- }
- },
-
- onCreated: new SingletonEventManager(context, "bookmarks.onCreated", fire => {
- let listener = (event, bookmark) => {
- context.runSafe(fire, bookmark.id, bookmark);
- };
-
- observer.on("created", listener);
- incrementListeners();
- return () => {
- observer.off("created", listener);
- decrementListeners();
- };
- }).api(),
-
- onRemoved: new SingletonEventManager(context, "bookmarks.onRemoved", fire => {
- let listener = (event, data) => {
- context.runSafe(fire, data.guid, data.info);
- };
-
- observer.on("removed", listener);
- incrementListeners();
- return () => {
- observer.off("removed", listener);
- decrementListeners();
- };
- }).api(),
-
- onChanged: new SingletonEventManager(context, "bookmarks.onChanged", fire => {
- let listener = (event, data) => {
- context.runSafe(fire, data.guid, data.info);
- };
-
- observer.on("changed", listener);
- incrementListeners();
- return () => {
- observer.off("changed", listener);
- decrementListeners();
- };
- }).api(),
-
- onMoved: new SingletonEventManager(context, "bookmarks.onMoved", fire => {
- let listener = (event, data) => {
- context.runSafe(fire, data.guid, data.info);
- };
-
- observer.on("moved", listener);
- incrementListeners();
- return () => {
- observer.off("moved", listener);
- decrementListeners();
- };
- }).api(),
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-browserAction.js b/application/basilisk/components/webextensions/ext-browserAction.js
deleted file mode 100644
index 2c82ac701a..0000000000
--- a/application/basilisk/components/webextensions/ext-browserAction.js
+++ /dev/null
@@ -1,531 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
- "resource:///modules/CustomizableUI.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
- "resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
- "resource://gre/modules/Timer.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "DOMUtils",
- "@mozilla.org/inspector/dom-utils;1",
- "inIDOMUtils");
-
-Cu.import("resource://devtools/shared/event-emitter.js");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-var {
- EventManager,
- IconDetails,
-} = ExtensionUtils;
-
-const POPUP_PRELOAD_TIMEOUT_MS = 200;
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-function isAncestorOrSelf(target, node) {
- for (; node; node = node.parentNode) {
- if (node === target) {
- return true;
- }
- }
- return false;
-}
-
-// WeakMap[Extension -> BrowserAction]
-var browserActionMap = new WeakMap();
-
-// Responsible for the browser_action section of the manifest as well
-// as the associated popup.
-function BrowserAction(options, extension) {
- this.extension = extension;
-
- let widgetId = makeWidgetId(extension.id);
- this.id = `${widgetId}-browser-action`;
- this.viewId = `PanelUI-webext-${widgetId}-browser-action-view`;
- this.widget = null;
-
- this.pendingPopup = null;
- this.pendingPopupTimeout = null;
-
- this.tabManager = TabManager.for(extension);
-
- this.defaults = {
- enabled: true,
- title: options.default_title || extension.name,
- badgeText: "",
- badgeBackgroundColor: null,
- icon: IconDetails.normalize({path: options.default_icon}, extension),
- popup: options.default_popup || "",
- };
-
- this.browserStyle = options.browser_style || false;
- if (options.browser_style === null) {
- this.extension.logger.warn("Please specify whether you want browser_style " +
- "or not in your browser_action options.");
- }
-
- this.tabContext = new TabContext(tab => Object.create(this.defaults),
- extension);
-
- EventEmitter.decorate(this);
-}
-
-BrowserAction.prototype = {
- build() {
- let widget = CustomizableUI.createWidget({
- id: this.id,
- viewId: this.viewId,
- type: "view",
- removable: true,
- label: this.defaults.title || this.extension.name,
- tooltiptext: this.defaults.title || "",
- defaultArea: CustomizableUI.AREA_NAVBAR,
-
- onBeforeCreated: document => {
- let view = document.createElementNS(XUL_NS, "panelview");
- view.id = this.viewId;
- view.setAttribute("flex", "1");
-
- document.getElementById("PanelUI-multiView").appendChild(view);
- },
-
- onDestroyed: document => {
- let view = document.getElementById(this.viewId);
- if (view) {
- this.clearPopup();
- CustomizableUI.hidePanelForNode(view);
- view.remove();
- }
- },
-
- onCreated: node => {
- node.classList.add("badged-button");
- node.classList.add("webextension-browser-action");
- node.setAttribute("constrain-size", "true");
-
- node.onmousedown = event => this.handleEvent(event);
-
- this.updateButton(node, this.defaults);
- },
-
- onViewShowing: event => {
- let document = event.target.ownerDocument;
- let tabbrowser = document.defaultView.gBrowser;
-
- let tab = tabbrowser.selectedTab;
- let popupURL = this.getProperty(tab, "popup");
- this.tabManager.addActiveTabPermission(tab);
-
- // Popups are shown only if a popup URL is defined; otherwise
- // a "click" event is dispatched. This is done for compatibility with the
- // Google Chrome onClicked extension API.
- if (popupURL) {
- try {
- let popup = this.getPopup(document.defaultView, popupURL);
- event.detail.addBlocker(popup.attach(event.target));
- } catch (e) {
- Cu.reportError(e);
- event.preventDefault();
- }
- } else {
- // This isn't not a hack, but it seems to provide the correct behavior
- // with the fewest complications.
- event.preventDefault();
- this.emit("click");
- }
- },
- });
-
- this.tabContext.on("tab-select", // eslint-disable-line mozilla/balanced-listeners
- (evt, tab) => { this.updateWindow(tab.ownerGlobal); });
-
- this.widget = widget;
- },
-
- /**
- * Triggers this browser action for the given window, with the same effects as
- * if it were clicked by a user.
- *
- * This has no effect if the browser action is disabled for, or not
- * present in, the given window.
- */
- triggerAction: Task.async(function* (window) {
- let popup = ViewPopup.for(this.extension, window);
- if (popup) {
- popup.closePopup();
- return;
- }
-
- let widget = this.widget.forWindow(window);
- let tab = window.gBrowser.selectedTab;
-
- if (!widget || !this.getProperty(tab, "enabled")) {
- return;
- }
-
- // Popups are shown only if a popup URL is defined; otherwise
- // a "click" event is dispatched. This is done for compatibility with the
- // Google Chrome onClicked extension API.
- if (this.getProperty(tab, "popup")) {
- if (this.widget.areaType == CustomizableUI.TYPE_MENU_PANEL) {
- yield window.PanelUI.show();
- }
-
- let event = new window.CustomEvent("command", {bubbles: true, cancelable: true});
- widget.node.dispatchEvent(event);
- } else {
- this.emit("click");
- }
- }),
-
- handleEvent(event) {
- let button = event.target;
- let window = button.ownerDocument.defaultView;
-
- switch (event.type) {
- case "mousedown":
- if (event.button == 0) {
- // Begin pre-loading the browser for the popup, so it's more likely to
- // be ready by the time we get a complete click.
- let tab = window.gBrowser.selectedTab;
- let popupURL = this.getProperty(tab, "popup");
- let enabled = this.getProperty(tab, "enabled");
-
- if (popupURL && enabled) {
- // Add permission for the active tab so it will exist for the popup.
- // Store the tab to revoke the permission during clearPopup.
- if (!this.pendingPopup && !this.tabManager.hasActiveTabPermission(tab)) {
- this.tabManager.addActiveTabPermission(tab);
- this.tabToRevokeDuringClearPopup = tab;
- }
-
- this.pendingPopup = this.getPopup(window, popupURL);
- window.addEventListener("mouseup", this, true);
- } else {
- this.clearPopup();
- }
- }
- break;
-
- case "mouseup":
- if (event.button == 0) {
- this.clearPopupTimeout();
- // If we have a pending pre-loaded popup, cancel it after we've waited
- // long enough that we can be relatively certain it won't be opening.
- if (this.pendingPopup) {
- let {node} = this.widget.forWindow(window);
- if (isAncestorOrSelf(node, event.originalTarget)) {
- this.pendingPopupTimeout = setTimeout(() => this.clearPopup(),
- POPUP_PRELOAD_TIMEOUT_MS);
- } else {
- this.clearPopup();
- }
- }
- }
- break;
- }
- },
-
- /**
- * Returns a potentially pre-loaded popup for the given URL in the given
- * window. If a matching pre-load popup already exists, returns that.
- * Otherwise, initializes a new one.
- *
- * If a pre-load popup exists which does not match, it is destroyed before a
- * new one is created.
- *
- * @param {Window} window
- * The browser window in which to create the popup.
- * @param {string} popupURL
- * The URL to load into the popup.
- * @returns {ViewPopup}
- */
- getPopup(window, popupURL) {
- this.clearPopupTimeout();
- let {pendingPopup} = this;
- this.pendingPopup = null;
-
- if (pendingPopup) {
- if (pendingPopup.window === window && pendingPopup.popupURL === popupURL) {
- return pendingPopup;
- }
- pendingPopup.destroy();
- }
-
- let fixedWidth = this.widget.areaType == CustomizableUI.TYPE_MENU_PANEL;
- return new ViewPopup(this.extension, window, popupURL, this.browserStyle, fixedWidth);
- },
-
- /**
- * Clears any pending pre-loaded popup and related timeouts.
- */
- clearPopup() {
- this.clearPopupTimeout();
- if (this.pendingPopup) {
- if (this.tabToRevokeDuringClearPopup) {
- this.tabManager.revokeActiveTabPermission(this.tabToRevokeDuringClearPopup);
- this.tabToRevokeDuringClearPopup = null;
- }
- this.pendingPopup.destroy();
- this.pendingPopup = null;
- }
- },
-
- /**
- * Clears any pending timeouts to clear stale, pre-loaded popups.
- */
- clearPopupTimeout() {
- if (this.pendingPopup) {
- this.pendingPopup.window.removeEventListener("mouseup", this, true);
- }
-
- if (this.pendingPopupTimeout) {
- clearTimeout(this.pendingPopupTimeout);
- this.pendingPopupTimeout = null;
- }
- },
-
- // Update the toolbar button |node| with the tab context data
- // in |tabData|.
- updateButton(node, tabData) {
- let title = tabData.title || this.extension.name;
- node.setAttribute("tooltiptext", title);
- node.setAttribute("label", title);
-
- if (tabData.badgeText) {
- node.setAttribute("badge", tabData.badgeText);
- } else {
- node.removeAttribute("badge");
- }
-
- if (tabData.enabled) {
- node.removeAttribute("disabled");
- } else {
- node.setAttribute("disabled", "true");
- }
-
- let badgeNode = node.ownerDocument.getAnonymousElementByAttribute(node,
- "class", "toolbarbutton-badge");
- if (badgeNode) {
- let color = tabData.badgeBackgroundColor;
- if (color) {
- color = `rgba(${color[0]}, ${color[1]}, ${color[2]}, ${color[3] / 255})`;
- }
- badgeNode.style.backgroundColor = color || "";
- }
-
- const LEGACY_CLASS = "toolbarbutton-legacy-addon";
- node.classList.remove(LEGACY_CLASS);
-
- let baseSize = 16;
- let {icon, size} = IconDetails.getPreferredIcon(tabData.icon, this.extension, baseSize);
-
- // If the best available icon size is not divisible by 16, check if we have
- // an 18px icon to fall back to, and trim off the padding instead.
- if (size % 16 && !icon.endsWith(".svg")) {
- let result = IconDetails.getPreferredIcon(tabData.icon, this.extension, 18);
-
- if (result.size % 18 == 0) {
- baseSize = 18;
- icon = result.icon;
- node.classList.add(LEGACY_CLASS);
- }
- }
-
- // These URLs should already be properly escaped, but make doubly sure CSS
- // string escape characters are escaped here, since they could lead to a
- // sandbox break.
- let escape = str => str.replace(/[\\\s"]/g, encodeURIComponent);
-
- let getIcon = size => escape(IconDetails.getPreferredIcon(tabData.icon, this.extension, size).icon);
-
- node.setAttribute("style", `
- --webextension-menupanel-image: url("${getIcon(32)}");
- --webextension-menupanel-image-2x: url("${getIcon(64)}");
- --webextension-toolbar-image: url("${escape(icon)}");
- --webextension-toolbar-image-2x: url("${getIcon(baseSize * 2)}");
- `);
- },
-
- // Update the toolbar button for a given window.
- updateWindow(window) {
- let widget = this.widget.forWindow(window);
- if (widget) {
- let tab = window.gBrowser.selectedTab;
- this.updateButton(widget.node, this.tabContext.get(tab));
- }
- },
-
- // Update the toolbar button when the extension changes the icon,
- // title, badge, etc. If it only changes a parameter for a single
- // tab, |tab| will be that tab. Otherwise it will be null.
- updateOnChange(tab) {
- if (tab) {
- if (tab.selected) {
- this.updateWindow(tab.ownerGlobal);
- }
- } else {
- for (let window of WindowListManager.browserWindows()) {
- this.updateWindow(window);
- }
- }
- },
-
- // tab is allowed to be null.
- // prop should be one of "icon", "title", "badgeText", "popup", or "badgeBackgroundColor".
- setProperty(tab, prop, value) {
- if (tab == null) {
- this.defaults[prop] = value;
- } else if (value != null) {
- this.tabContext.get(tab)[prop] = value;
- } else {
- delete this.tabContext.get(tab)[prop];
- }
-
- this.updateOnChange(tab);
- },
-
- // tab is allowed to be null.
- // prop should be one of "title", "badgeText", "popup", or "badgeBackgroundColor".
- getProperty(tab, prop) {
- if (tab == null) {
- return this.defaults[prop];
- }
- return this.tabContext.get(tab)[prop];
- },
-
- shutdown() {
- this.tabContext.shutdown();
- CustomizableUI.destroyWidget(this.id);
- },
-};
-
-BrowserAction.for = (extension) => {
- return browserActionMap.get(extension);
-};
-
-global.browserActionFor = BrowserAction.for;
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("manifest_browser_action", (type, directive, extension, manifest) => {
- let browserAction = new BrowserAction(manifest.browser_action, extension);
- browserAction.build();
- browserActionMap.set(extension, browserAction);
-});
-
-extensions.on("shutdown", (type, extension) => {
- if (browserActionMap.has(extension)) {
- browserActionMap.get(extension).shutdown();
- browserActionMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-extensions.registerSchemaAPI("browserAction", "addon_parent", context => {
- let {extension} = context;
- return {
- browserAction: {
- onClicked: new EventManager(context, "browserAction.onClicked", fire => {
- let listener = () => {
- let tab = TabManager.activeTab;
- fire(TabManager.convert(extension, tab));
- };
- BrowserAction.for(extension).on("click", listener);
- return () => {
- BrowserAction.for(extension).off("click", listener);
- };
- }).api(),
-
- enable: function(tabId) {
- let tab = tabId !== null ? TabManager.getTab(tabId, context) : null;
- BrowserAction.for(extension).setProperty(tab, "enabled", true);
- },
-
- disable: function(tabId) {
- let tab = tabId !== null ? TabManager.getTab(tabId, context) : null;
- BrowserAction.for(extension).setProperty(tab, "enabled", false);
- },
-
- setTitle: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- let title = details.title;
- // Clear the tab-specific title when given a null string.
- if (tab && title == "") {
- title = null;
- }
- BrowserAction.for(extension).setProperty(tab, "title", title);
- },
-
- getTitle: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- let title = BrowserAction.for(extension).getProperty(tab, "title");
- return Promise.resolve(title);
- },
-
- setIcon: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- let icon = IconDetails.normalize(details, extension, context);
- BrowserAction.for(extension).setProperty(tab, "icon", icon);
- },
-
- setBadgeText: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- BrowserAction.for(extension).setProperty(tab, "badgeText", details.text);
- },
-
- getBadgeText: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- let text = BrowserAction.for(extension).getProperty(tab, "badgeText");
- return Promise.resolve(text);
- },
-
- setPopup: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- // Note: Chrome resolves arguments to setIcon relative to the calling
- // context, but resolves arguments to setPopup relative to the extension
- // root.
- // For internal consistency, we currently resolve both relative to the
- // calling context.
- let url = details.popup && context.uri.resolve(details.popup);
- if (url && !context.checkLoadURL(url)) {
- return Promise.reject({message: `Access denied for URL ${url}`});
- }
- BrowserAction.for(extension).setProperty(tab, "popup", url);
- },
-
- getPopup: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- let popup = BrowserAction.for(extension).getProperty(tab, "popup");
- return Promise.resolve(popup);
- },
-
- setBadgeBackgroundColor: function(details) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
- let color = details.color;
- if (!Array.isArray(color)) {
- let col = DOMUtils.colorToRGBA(color);
- color = col && [col.r, col.g, col.b, Math.round(col.a * 255)];
- }
- BrowserAction.for(extension).setProperty(tab, "badgeBackgroundColor", color);
- },
-
- getBadgeBackgroundColor: function(details, callback) {
- let tab = details.tabId !== null ? TabManager.getTab(details.tabId, context) : null;
-
- let color = BrowserAction.for(extension).getProperty(tab, "badgeBackgroundColor");
- return Promise.resolve(color || [0xd9, 0, 0, 255]);
- },
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-c-contextMenus.js b/application/basilisk/components/webextensions/ext-c-contextMenus.js
deleted file mode 100644
index 9fde90808e..0000000000
--- a/application/basilisk/components/webextensions/ext-c-contextMenus.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-// If id is not specified for an item we use an integer.
-// This ID need only be unique within a single addon. Since all addon code that
-// can use this API runs in the same process, this local variable suffices.
-var gNextMenuItemID = 0;
-
-// Map[Extension -> Map[string or id, ContextMenusClickPropHandler]]
-var gPropHandlers = new Map();
-
-// The contextMenus API supports an "onclick" attribute in the create/update
-// methods to register a callback. This class manages these onclick properties.
-class ContextMenusClickPropHandler {
- constructor(context) {
- this.context = context;
- // Map[string or integer -> callback]
- this.onclickMap = new Map();
- this.dispatchEvent = this.dispatchEvent.bind(this);
- }
-
- // A listener on contextMenus.onClicked that forwards the event to the only
- // listener, if any.
- dispatchEvent(info, tab) {
- let onclick = this.onclickMap.get(info.menuItemId);
- if (onclick) {
- // No need for runSafe or anything because we are already being run inside
- // an event handler -- the event is just being forwarded to the actual
- // handler.
- onclick(info, tab);
- }
- }
-
- // Sets the `onclick` handler for the given menu item.
- // The `onclick` function MUST be owned by `this.context`.
- setListener(id, onclick) {
- if (this.onclickMap.size === 0) {
- this.context.childManager.getParentEvent("contextMenus.onClicked").addListener(this.dispatchEvent);
- this.context.callOnClose(this);
- }
- this.onclickMap.set(id, onclick);
-
- let propHandlerMap = gPropHandlers.get(this.context.extension);
- if (!propHandlerMap) {
- propHandlerMap = new Map();
- } else {
- // If the current callback was created in a different context, remove it
- // from the other context.
- let propHandler = propHandlerMap.get(id);
- if (propHandler && propHandler !== this) {
- propHandler.unsetListener(id);
- }
- }
- propHandlerMap.set(id, this);
- gPropHandlers.set(this.context.extension, propHandlerMap);
- }
-
- // Deletes the `onclick` handler for the given menu item.
- // The `onclick` function MUST be owned by `this.context`.
- unsetListener(id) {
- if (!this.onclickMap.delete(id)) {
- return;
- }
- if (this.onclickMap.size === 0) {
- this.context.childManager.getParentEvent("contextMenus.onClicked").removeListener(this.dispatchEvent);
- this.context.forgetOnClose(this);
- }
- let propHandlerMap = gPropHandlers.get(this.context.extension);
- propHandlerMap.delete(id);
- if (propHandlerMap.size === 0) {
- gPropHandlers.delete(this.context.extension);
- }
- }
-
- // Deletes the `onclick` handler for the given menu item, if any, regardless
- // of the context where it was created.
- unsetListenerFromAnyContext(id) {
- let propHandlerMap = gPropHandlers.get(this.context.extension);
- let propHandler = propHandlerMap && propHandlerMap.get(id);
- if (propHandler) {
- propHandler.unsetListener(id);
- }
- }
-
- // Remove all `onclick` handlers of the extension.
- deleteAllListenersFromExtension() {
- let propHandlerMap = gPropHandlers.get(this.context.extension);
- if (propHandlerMap) {
- for (let [id, propHandler] of propHandlerMap) {
- propHandler.unsetListener(id);
- }
- }
- }
-
- // Removes all `onclick` handlers from this context.
- close() {
- for (let id of this.onclickMap.keys()) {
- this.unsetListener(id);
- }
- }
-}
-
-extensions.registerSchemaAPI("contextMenus", "addon_child", context => {
- let onClickedProp = new ContextMenusClickPropHandler(context);
-
- return {
- contextMenus: {
- create(createProperties, callback) {
- if (createProperties.id === null) {
- createProperties.id = ++gNextMenuItemID;
- }
- let {onclick} = createProperties;
- delete createProperties.onclick;
- context.childManager.callParentAsyncFunction("contextMenus.createInternal", [
- createProperties,
- ]).then(() => {
- if (onclick) {
- onClickedProp.setListener(createProperties.id, onclick);
- }
- if (callback) {
- callback();
- }
- });
- return createProperties.id;
- },
-
- update(id, updateProperties) {
- let {onclick} = updateProperties;
- delete updateProperties.onclick;
- return context.childManager.callParentAsyncFunction("contextMenus.update", [
- id,
- updateProperties,
- ]).then(() => {
- if (onclick) {
- onClickedProp.setListener(id, onclick);
- } else if (onclick === null) {
- onClickedProp.unsetListenerFromAnyContext(id);
- }
- // else onclick is not set so it should not be changed.
- });
- },
-
- remove(id) {
- onClickedProp.unsetListenerFromAnyContext(id);
- return context.childManager.callParentAsyncFunction("contextMenus.remove", [
- id,
- ]);
- },
-
- removeAll() {
- onClickedProp.deleteAllListenersFromExtension();
-
- return context.childManager.callParentAsyncFunction("contextMenus.removeAll", []);
- },
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-c-omnibox.js b/application/basilisk/components/webextensions/ext-c-omnibox.js
deleted file mode 100644
index 3b9b6e2f71..0000000000
--- a/application/basilisk/components/webextensions/ext-c-omnibox.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-var {
- runSafeSyncWithoutClone,
- SingletonEventManager,
-} = ExtensionUtils;
-
-extensions.registerSchemaAPI("omnibox", "addon_child", context => {
- return {
- omnibox: {
- onInputChanged: new SingletonEventManager(context, "omnibox.onInputChanged", fire => {
- let listener = (text, id) => {
- runSafeSyncWithoutClone(fire, text, suggestions => {
- // TODO: Switch to using callParentFunctionNoReturn once bug 1314903 is fixed.
- context.childManager.callParentAsyncFunction("omnibox_internal.addSuggestions", [
- id,
- suggestions,
- ]);
- });
- };
- context.childManager.getParentEvent("omnibox_internal.onInputChanged").addListener(listener);
- return () => {
- context.childManager.getParentEvent("omnibox_internal.onInputChanged").removeListener(listener);
- };
- }).api(),
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-c-tabs.js b/application/basilisk/components/webextensions/ext-c-tabs.js
deleted file mode 100644
index d5ce9fbf95..0000000000
--- a/application/basilisk/components/webextensions/ext-c-tabs.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-extensions.registerSchemaAPI("tabs", "addon_child", context => {
- return {
- tabs: {
- connect: function(tabId, connectInfo) {
- let name = "";
- if (connectInfo && connectInfo.name !== null) {
- name = connectInfo.name;
- }
- let recipient = {
- extensionId: context.extension.id,
- tabId,
- };
- if (connectInfo && connectInfo.frameId !== null) {
- recipient.frameId = connectInfo.frameId;
- }
- return context.messenger.connect(context.messageManager, name, recipient);
- },
-
- sendMessage: function(tabId, message, options, responseCallback) {
- let recipient = {
- extensionId: context.extension.id,
- tabId: tabId,
- };
- if (options && options.frameId !== null) {
- recipient.frameId = options.frameId;
- }
- return context.messenger.sendMessage(context.messageManager, message, recipient, responseCallback);
- },
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-commands.js b/application/basilisk/components/webextensions/ext-commands.js
deleted file mode 100644
index b6e7ab3d1b..0000000000
--- a/application/basilisk/components/webextensions/ext-commands.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://devtools/shared/event-emitter.js");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-var {
- EventManager,
- PlatformInfo,
-} = ExtensionUtils;
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-// WeakMap[Extension -> CommandList]
-var commandsMap = new WeakMap();
-
-function CommandList(manifest, extension) {
- this.extension = extension;
- this.id = makeWidgetId(extension.id);
- this.windowOpenListener = null;
-
- // Map[{String} commandName -> {Object} commandProperties]
- this.commands = this.loadCommandsFromManifest(manifest);
-
- // WeakMap[Window -> <xul:keyset>]
- this.keysetsMap = new WeakMap();
-
- this.register();
- EventEmitter.decorate(this);
-}
-
-CommandList.prototype = {
- /**
- * Registers the commands to all open windows and to any which
- * are later created.
- */
- register() {
- for (let window of WindowListManager.browserWindows()) {
- this.registerKeysToDocument(window);
- }
-
- this.windowOpenListener = (window) => {
- if (!this.keysetsMap.has(window)) {
- this.registerKeysToDocument(window);
- }
- };
-
- WindowListManager.addOpenListener(this.windowOpenListener);
- },
-
- /**
- * Unregisters the commands from all open windows and stops commands
- * from being registered to windows which are later created.
- */
- unregister() {
- for (let window of WindowListManager.browserWindows()) {
- if (this.keysetsMap.has(window)) {
- this.keysetsMap.get(window).remove();
- }
- }
-
- WindowListManager.removeOpenListener(this.windowOpenListener);
- },
-
- /**
- * Creates a Map from commands for each command in the manifest.commands object.
- *
- * @param {Object} manifest The manifest JSON object.
- * @returns {Map<string, object>}
- */
- loadCommandsFromManifest(manifest) {
- let commands = new Map();
- // For Windows, chrome.runtime expects 'win' while chrome.commands
- // expects 'windows'. We can special case this for now.
- let os = PlatformInfo.os == "win" ? "windows" : PlatformInfo.os;
- for (let [name, command] of Object.entries(manifest.commands)) {
- let suggested_key = command.suggested_key || {};
- let shortcut = suggested_key[os] || suggested_key.default;
- shortcut = shortcut ? shortcut.replace(/\s+/g, "") : null;
- commands.set(name, {
- description: command.description,
- shortcut,
- });
- }
- return commands;
- },
-
- /**
- * Registers the commands to a document.
- * @param {ChromeWindow} window The XUL window to insert the Keyset.
- */
- registerKeysToDocument(window) {
- let doc = window.document;
- let keyset = doc.createElementNS(XUL_NS, "keyset");
- keyset.id = `ext-keyset-id-${this.id}`;
- this.commands.forEach((command, name) => {
- if (command.shortcut) {
- let keyElement = this.buildKey(doc, name, command.shortcut);
- keyset.appendChild(keyElement);
- }
- });
- doc.documentElement.appendChild(keyset);
- this.keysetsMap.set(window, keyset);
- },
-
- /**
- * Builds a XUL Key element and attaches an onCommand listener which
- * emits a command event with the provided name when fired.
- *
- * @param {Document} doc The XUL document.
- * @param {string} name The name of the command.
- * @param {string} shortcut The shortcut provided in the manifest.
- * @see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/key
- *
- * @returns {Document} The newly created Key element.
- */
- buildKey(doc, name, shortcut) {
- let keyElement = this.buildKeyFromShortcut(doc, shortcut);
-
- // We need to have the attribute "oncommand" for the "command" listener to fire,
- // and it is currently ignored when set to the empty string.
- keyElement.setAttribute("oncommand", "//");
-
- /* eslint-disable mozilla/balanced-listeners */
- // We remove all references to the key elements when the extension is shutdown,
- // therefore the listeners for these elements will be garbage collected.
- keyElement.addEventListener("command", (event) => {
- if (name == "_execute_page_action") {
- let win = event.target.ownerDocument.defaultView;
- pageActionFor(this.extension).triggerAction(win);
- } else if (name == "_execute_browser_action") {
- let win = event.target.ownerDocument.defaultView;
- browserActionFor(this.extension).triggerAction(win);
- } else {
- TabManager.for(this.extension)
- .addActiveTabPermission(TabManager.activeTab);
- this.emit("command", name);
- }
- });
- /* eslint-enable mozilla/balanced-listeners */
-
- return keyElement;
- },
-
- /**
- * Builds a XUL Key element from the provided shortcut.
- *
- * @param {Document} doc The XUL document.
- * @param {string} shortcut The shortcut provided in the manifest.
- *
- * @see https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/key
- * @returns {Document} The newly created Key element.
- */
- buildKeyFromShortcut(doc, shortcut) {
- let keyElement = doc.createElementNS(XUL_NS, "key");
-
- let parts = shortcut.split("+");
-
- // The key is always the last element.
- let chromeKey = parts.pop();
-
- // The modifiers are the remaining elements.
- keyElement.setAttribute("modifiers", this.getModifiersAttribute(parts));
-
- if (/^[A-Z]$/.test(chromeKey)) {
- // We use the key attribute for all single digits and characters.
- keyElement.setAttribute("key", chromeKey);
- } else {
- keyElement.setAttribute("keycode", this.getKeycodeAttribute(chromeKey));
- keyElement.setAttribute("event", "keydown");
- }
-
- return keyElement;
- },
-
- /**
- * Determines the corresponding XUL keycode from the given chrome key.
- *
- * For example:
- *
- * input | output
- * ---------------------------------------
- * "PageUP" | "VK_PAGE_UP"
- * "Delete" | "VK_DELETE"
- *
- * @param {string} chromeKey The chrome key (e.g. "PageUp", "Space", ...)
- * @returns {string} The constructed value for the Key's 'keycode' attribute.
- */
- getKeycodeAttribute(chromeKey) {
- if (/[0-9]/.test(chromeKey)) {
- return `VK_${chromeKey}`;
- }
- return `VK${chromeKey.replace(/([A-Z])/g, "_$&").toUpperCase()}`;
- },
-
- /**
- * Determines the corresponding XUL modifiers from the chrome modifiers.
- *
- * For example:
- *
- * input | output
- * ---------------------------------------
- * ["Ctrl", "Shift"] | "accel shift"
- * ["MacCtrl"] | "control"
- *
- * @param {Array} chromeModifiers The array of chrome modifiers.
- * @returns {string} The constructed value for the Key's 'modifiers' attribute.
- */
- getModifiersAttribute(chromeModifiers) {
- let modifiersMap = {
- "Alt": "alt",
- "Command": "accel",
- "Ctrl": "accel",
- "MacCtrl": "control",
- "Shift": "shift",
- };
- return Array.from(chromeModifiers, modifier => {
- return modifiersMap[modifier];
- }).join(" ");
- },
-};
-
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("manifest_commands", (type, directive, extension, manifest) => {
- commandsMap.set(extension, new CommandList(manifest, extension));
-});
-
-extensions.on("shutdown", (type, extension) => {
- let commandsList = commandsMap.get(extension);
- if (commandsList) {
- commandsList.unregister();
- commandsMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-extensions.registerSchemaAPI("commands", "addon_parent", context => {
- let {extension} = context;
- return {
- commands: {
- getAll() {
- let commands = commandsMap.get(extension).commands;
- return Promise.resolve(Array.from(commands, ([name, command]) => {
- return ({
- name,
- description: command.description,
- shortcut: command.shortcut,
- });
- }));
- },
- onCommand: new EventManager(context, "commands.onCommand", fire => {
- let listener = (eventName, commandName) => {
- fire(commandName);
- };
- commandsMap.get(extension).on("command", listener);
- return () => {
- commandsMap.get(extension).off("command", listener);
- };
- }).api(),
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-contextMenus.js b/application/basilisk/components/webextensions/ext-contextMenus.js
deleted file mode 100644
index b3bf8aa537..0000000000
--- a/application/basilisk/components/webextensions/ext-contextMenus.js
+++ /dev/null
@@ -1,537 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/MatchPattern.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var {
- EventManager,
- ExtensionError,
- IconDetails,
-} = ExtensionUtils;
-
-// Map[Extension -> Map[ID -> MenuItem]]
-// Note: we want to enumerate all the menu items so
-// this cannot be a weak map.
-var gContextMenuMap = new Map();
-
-// Map[Extension -> MenuItem]
-var gRootItems = new Map();
-
-// If id is not specified for an item we use an integer.
-var gNextMenuItemID = 0;
-
-// Used to assign unique names to radio groups.
-var gNextRadioGroupID = 0;
-
-// The max length of a menu item's label.
-var gMaxLabelLength = 64;
-
-// When a new contextMenu is opened, this function is called and
-// we populate the |xulMenu| with all the items from extensions
-// to be displayed. We always clear all the items again when
-// popuphidden fires.
-var gMenuBuilder = {
- build: function(contextData) {
- let xulMenu = contextData.menu;
- xulMenu.addEventListener("popuphidden", this);
- this.xulMenu = xulMenu;
- for (let [, root] of gRootItems) {
- let rootElement = this.buildElementWithChildren(root, contextData);
- if (!rootElement.firstChild || !rootElement.firstChild.childNodes.length) {
- // If the root has no visible children, there is no reason to show
- // the root menu item itself either.
- continue;
- }
- rootElement.setAttribute("ext-type", "top-level-menu");
- rootElement = this.removeTopLevelMenuIfNeeded(rootElement);
-
- // Display the extension icon on the root element.
- if (root.extension.manifest.icons) {
- let parentWindow = contextData.menu.ownerGlobal;
- let extension = root.extension;
-
- let {icon} = IconDetails.getPreferredIcon(extension.manifest.icons, extension,
- 16 * parentWindow.devicePixelRatio);
-
- // The extension icons in the manifest are not pre-resolved, since
- // they're sometimes used by the add-on manager when the extension is
- // not enabled, and its URLs are not resolvable.
- let resolvedURL = root.extension.baseURI.resolve(icon);
-
- if (rootElement.localName == "menu") {
- rootElement.setAttribute("class", "menu-iconic");
- } else if (rootElement.localName == "menuitem") {
- rootElement.setAttribute("class", "menuitem-iconic");
- }
- rootElement.setAttribute("image", resolvedURL);
- }
-
- xulMenu.appendChild(rootElement);
- this.itemsToCleanUp.add(rootElement);
- }
- },
-
- buildElementWithChildren(item, contextData) {
- let element = this.buildSingleElement(item, contextData);
- let groupName;
- for (let child of item.children) {
- if (child.type == "radio" && !child.groupName) {
- if (!groupName) {
- groupName = `webext-radio-group-${gNextRadioGroupID++}`;
- }
- child.groupName = groupName;
- } else {
- groupName = null;
- }
-
- if (child.enabledForContext(contextData)) {
- let childElement = this.buildElementWithChildren(child, contextData);
- // Here element must be a menu element and its first child
- // is a menupopup, we have to append its children to this
- // menupopup.
- element.firstChild.appendChild(childElement);
- }
- }
-
- return element;
- },
-
- removeTopLevelMenuIfNeeded(element) {
- // If there is only one visible top level element we don't need the
- // root menu element for the extension.
- let menuPopup = element.firstChild;
- if (menuPopup && menuPopup.childNodes.length == 1) {
- let onlyChild = menuPopup.firstChild;
- onlyChild.remove();
- return onlyChild;
- }
-
- return element;
- },
-
- buildSingleElement(item, contextData) {
- let doc = contextData.menu.ownerDocument;
- let element;
- if (item.children.length > 0) {
- element = this.createMenuElement(doc, item);
- } else if (item.type == "separator") {
- element = doc.createElement("menuseparator");
- } else {
- element = doc.createElement("menuitem");
- }
-
- return this.customizeElement(element, item, contextData);
- },
-
- createMenuElement(doc, item) {
- let element = doc.createElement("menu");
- // Menu elements need to have a menupopup child for its menu items.
- let menupopup = doc.createElement("menupopup");
- element.appendChild(menupopup);
- return element;
- },
-
- customizeElement(element, item, contextData) {
- let label = item.title;
- if (label) {
- if (contextData.isTextSelected && label.indexOf("%s") > -1) {
- let selection = contextData.selectionText;
- // The rendering engine will truncate the title if it's longer than 64 characters.
- // But if it makes sense let's try truncate selection text only, to handle cases like
- // 'look up "%s" in MyDictionary' more elegantly.
- let maxSelectionLength = gMaxLabelLength - label.length + 2;
- if (maxSelectionLength > 4) {
- selection = selection.substring(0, maxSelectionLength - 3) + "...";
- }
- label = label.replace(/%s/g, selection);
- }
-
- element.setAttribute("label", label);
- }
-
- if (item.type == "checkbox") {
- element.setAttribute("type", "checkbox");
- if (item.checked) {
- element.setAttribute("checked", "true");
- }
- } else if (item.type == "radio") {
- element.setAttribute("type", "radio");
- element.setAttribute("name", item.groupName);
- if (item.checked) {
- element.setAttribute("checked", "true");
- }
- }
-
- if (!item.enabled) {
- element.setAttribute("disabled", "true");
- }
-
- element.addEventListener("command", event => { // eslint-disable-line mozilla/balanced-listeners
- if (event.target !== event.currentTarget) {
- return;
- }
- const wasChecked = item.checked;
- if (item.type == "checkbox") {
- item.checked = !item.checked;
- } else if (item.type == "radio") {
- // Deselect all radio items in the current radio group.
- for (let child of item.parent.children) {
- if (child.type == "radio" && child.groupName == item.groupName) {
- child.checked = false;
- }
- }
- // Select the clicked radio item.
- item.checked = true;
- }
-
- item.tabManager.addActiveTabPermission();
-
- let tab = item.tabManager.convert(contextData.tab);
- let info = item.getClickInfo(contextData, wasChecked);
- item.extension.emit("webext-contextmenu-menuitem-click", info, tab);
- });
-
- return element;
- },
-
- handleEvent: function(event) {
- if (this.xulMenu != event.target || event.type != "popuphidden") {
- return;
- }
-
- delete this.xulMenu;
- let target = event.target;
- target.removeEventListener("popuphidden", this);
- for (let item of this.itemsToCleanUp) {
- item.remove();
- }
- this.itemsToCleanUp.clear();
- },
-
- itemsToCleanUp: new Set(),
-};
-
-function contextMenuObserver(subject, topic, data) {
- subject = subject.wrappedJSObject;
- gMenuBuilder.build(subject);
-}
-
-function getContexts(contextData) {
- let contexts = new Set(["all"]);
-
- if (contextData.inFrame) {
- contexts.add("frame");
- }
-
- if (contextData.isTextSelected) {
- contexts.add("selection");
- }
-
- if (contextData.onLink) {
- contexts.add("link");
- }
-
- if (contextData.onEditableArea) {
- contexts.add("editable");
- }
-
- if (contextData.onImage) {
- contexts.add("image");
- }
-
- if (contextData.onVideo) {
- contexts.add("video");
- }
-
- if (contextData.onAudio) {
- contexts.add("audio");
- }
-
- if (contexts.size == 1) {
- contexts.add("page");
- }
-
- return contexts;
-}
-
-function MenuItem(extension, createProperties, isRoot = false) {
- this.extension = extension;
- this.children = [];
- this.parent = null;
- this.tabManager = TabManager.for(extension);
-
- this.setDefaults();
- this.setProps(createProperties);
- if (!this.hasOwnProperty("_id")) {
- this.id = gNextMenuItemID++;
- }
- // If the item is not the root and has no parent
- // it must be a child of the root.
- if (!isRoot && !this.parent) {
- this.root.addChild(this);
- }
-}
-
-MenuItem.prototype = {
- setProps(createProperties) {
- for (let propName in createProperties) {
- if (createProperties[propName] === null) {
- // Omitted optional argument.
- continue;
- }
- this[propName] = createProperties[propName];
- }
-
- if (createProperties.documentUrlPatterns != null) {
- this.documentUrlMatchPattern = new MatchPattern(this.documentUrlPatterns);
- }
-
- if (createProperties.targetUrlPatterns != null) {
- this.targetUrlMatchPattern = new MatchPattern(this.targetUrlPatterns);
- }
- },
-
- setDefaults() {
- this.setProps({
- type: "normal",
- checked: false,
- contexts: ["all"],
- enabled: true,
- });
- },
-
- set id(id) {
- if (this.hasOwnProperty("_id")) {
- throw new Error("Id of a MenuItem cannot be changed");
- }
- let isIdUsed = gContextMenuMap.get(this.extension).has(id);
- if (isIdUsed) {
- throw new Error("Id already exists");
- }
- this._id = id;
- },
-
- get id() {
- return this._id;
- },
-
- ensureValidParentId(parentId) {
- if (parentId === undefined) {
- return;
- }
- let menuMap = gContextMenuMap.get(this.extension);
- if (!menuMap.has(parentId)) {
- throw new Error("Could not find any MenuItem with id: " + parentId);
- }
- for (let item = menuMap.get(parentId); item; item = item.parent) {
- if (item === this) {
- throw new ExtensionError("MenuItem cannot be an ancestor (or self) of its new parent.");
- }
- }
- },
-
- set parentId(parentId) {
- this.ensureValidParentId(parentId);
-
- if (this.parent) {
- this.parent.detachChild(this);
- }
-
- if (parentId === undefined) {
- this.root.addChild(this);
- } else {
- let menuMap = gContextMenuMap.get(this.extension);
- menuMap.get(parentId).addChild(this);
- }
- },
-
- get parentId() {
- return this.parent ? this.parent.id : undefined;
- },
-
- addChild(child) {
- if (child.parent) {
- throw new Error("Child MenuItem already has a parent.");
- }
- this.children.push(child);
- child.parent = this;
- },
-
- detachChild(child) {
- let idx = this.children.indexOf(child);
- if (idx < 0) {
- throw new Error("Child MenuItem not found, it cannot be removed.");
- }
- this.children.splice(idx, 1);
- child.parent = null;
- },
-
- get root() {
- let extension = this.extension;
- if (!gRootItems.has(extension)) {
- let root = new MenuItem(extension,
- {title: extension.name},
- /* isRoot = */ true);
- gRootItems.set(extension, root);
- }
-
- return gRootItems.get(extension);
- },
-
- remove() {
- if (this.parent) {
- this.parent.detachChild(this);
- }
- let children = this.children.slice(0);
- for (let child of children) {
- child.remove();
- }
-
- let menuMap = gContextMenuMap.get(this.extension);
- menuMap.delete(this.id);
- if (this.root == this) {
- gRootItems.delete(this.extension);
- }
- },
-
- getClickInfo(contextData, wasChecked) {
- let mediaType;
- if (contextData.onVideo) {
- mediaType = "video";
- }
- if (contextData.onAudio) {
- mediaType = "audio";
- }
- if (contextData.onImage) {
- mediaType = "image";
- }
-
- let info = {
- menuItemId: this.id,
- editable: contextData.onEditableArea,
- };
-
- function setIfDefined(argName, value) {
- if (value !== undefined) {
- info[argName] = value;
- }
- }
-
- setIfDefined("parentMenuItemId", this.parentId);
- setIfDefined("mediaType", mediaType);
- setIfDefined("linkUrl", contextData.linkUrl);
- setIfDefined("srcUrl", contextData.srcUrl);
- setIfDefined("pageUrl", contextData.pageUrl);
- setIfDefined("frameUrl", contextData.frameUrl);
- setIfDefined("selectionText", contextData.selectionText);
-
- if ((this.type === "checkbox") || (this.type === "radio")) {
- info.checked = this.checked;
- info.wasChecked = wasChecked;
- }
-
- return info;
- },
-
- enabledForContext(contextData) {
- let contexts = getContexts(contextData);
- if (!this.contexts.some(n => contexts.has(n))) {
- return false;
- }
-
- let docPattern = this.documentUrlMatchPattern;
- let pageURI = Services.io.newURI(contextData.pageUrl, null, null);
- if (docPattern && !docPattern.matches(pageURI)) {
- return false;
- }
-
- let targetPattern = this.targetUrlMatchPattern;
- if (targetPattern) {
- let targetUrls = [];
- if (contextData.onImage || contextData.onAudio || contextData.onVideo) {
- // TODO: double check if srcUrl is always set when we need it
- targetUrls.push(contextData.srcUrl);
- }
- if (contextData.onLink) {
- targetUrls.push(contextData.linkUrl);
- }
- if (!targetUrls.some(targetUrl => targetPattern.matches(NetUtil.newURI(targetUrl)))) {
- return false;
- }
- }
-
- return true;
- },
-};
-
-var gExtensionCount = 0;
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("startup", (type, extension) => {
- gContextMenuMap.set(extension, new Map());
- if (++gExtensionCount == 1) {
- Services.obs.addObserver(contextMenuObserver,
- "on-build-contextmenu",
- false);
- }
-});
-
-extensions.on("shutdown", (type, extension) => {
- gContextMenuMap.delete(extension);
- gRootItems.delete(extension);
- if (--gExtensionCount == 0) {
- Services.obs.removeObserver(contextMenuObserver,
- "on-build-contextmenu");
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-extensions.registerSchemaAPI("contextMenus", "addon_parent", context => {
- let {extension} = context;
- return {
- contextMenus: {
- createInternal: function(createProperties) {
- // Note that the id is required by the schema. If the addon did not set
- // it, the implementation of contextMenus.create in the child should
- // have added it.
- let menuItem = new MenuItem(extension, createProperties);
- gContextMenuMap.get(extension).set(menuItem.id, menuItem);
- },
-
- update: function(id, updateProperties) {
- let menuItem = gContextMenuMap.get(extension).get(id);
- if (menuItem) {
- menuItem.setProps(updateProperties);
- }
- },
-
- remove: function(id) {
- let menuItem = gContextMenuMap.get(extension).get(id);
- if (menuItem) {
- menuItem.remove();
- }
- },
-
- removeAll: function() {
- let root = gRootItems.get(extension);
- if (root) {
- root.remove();
- }
- },
-
- onClicked: new EventManager(context, "contextMenus.onClicked", fire => {
- let listener = (event, info, tab) => {
- fire(info, tab);
- };
-
- extension.on("webext-contextmenu-menuitem-click", listener);
- return () => {
- extension.off("webext-contextmenu-menuitem-click", listener);
- };
- }).api(),
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-desktop-runtime.js b/application/basilisk/components/webextensions/ext-desktop-runtime.js
deleted file mode 100644
index 0fdb455621..0000000000
--- a/application/basilisk/components/webextensions/ext-desktop-runtime.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("uninstall", (msg, extension) => {
- if (extension.uninstallURL) {
- let browser = WindowManager.topWindow.gBrowser;
- browser.addTab(extension.uninstallURL, {relatedToCurrent: true});
- }
-});
-
-global.openOptionsPage = (extension) => {
- let window = WindowManager.topWindow;
- if (!window) {
- return Promise.reject({message: "No browser window available"});
- }
-
- if (extension.manifest.options_ui.open_in_tab) {
- window.switchToTabHavingURI(extension.manifest.options_ui.page, true);
- return Promise.resolve();
- }
-
- let viewId = `addons://detail/${encodeURIComponent(extension.id)}/preferences`;
-
- return window.BrowserOpenAddonsMgr(viewId);
-};
-
diff --git a/application/basilisk/components/webextensions/ext-history.js b/application/basilisk/components/webextensions/ext-history.js
deleted file mode 100644
index a47df16216..0000000000
--- a/application/basilisk/components/webextensions/ext-history.js
+++ /dev/null
@@ -1,246 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
- "resource://devtools/shared/event-emitter.js");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-
-const {
- normalizeTime,
- SingletonEventManager,
-} = ExtensionUtils;
-
-let nsINavHistoryService = Ci.nsINavHistoryService;
-const TRANSITION_TO_TRANSITION_TYPES_MAP = new Map([
- ["link", nsINavHistoryService.TRANSITION_LINK],
- ["typed", nsINavHistoryService.TRANSITION_TYPED],
- ["auto_bookmark", nsINavHistoryService.TRANSITION_BOOKMARK],
- ["auto_subframe", nsINavHistoryService.TRANSITION_EMBED],
- ["manual_subframe", nsINavHistoryService.TRANSITION_FRAMED_LINK],
-]);
-
-let TRANSITION_TYPE_TO_TRANSITIONS_MAP = new Map();
-for (let [transition, transitionType] of TRANSITION_TO_TRANSITION_TYPES_MAP) {
- TRANSITION_TYPE_TO_TRANSITIONS_MAP.set(transitionType, transition);
-}
-
-function getTransitionType(transition) {
- // cannot set a default value for the transition argument as the framework sets it to null
- transition = transition || "link";
- let transitionType = TRANSITION_TO_TRANSITION_TYPES_MAP.get(transition);
- if (!transitionType) {
- throw new Error(`|${transition}| is not a supported transition for history`);
- }
- return transitionType;
-}
-
-function getTransition(transitionType) {
- return TRANSITION_TYPE_TO_TRANSITIONS_MAP.get(transitionType) || "link";
-}
-
-/*
- * Converts a nsINavHistoryResultNode into a HistoryItem
- *
- * https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsINavHistoryResultNode
- */
-function convertNodeToHistoryItem(node) {
- return {
- id: node.pageGuid,
- url: node.uri,
- title: node.title,
- lastVisitTime: PlacesUtils.toDate(node.time).getTime(),
- visitCount: node.accessCount,
- };
-}
-
-/*
- * Converts a nsINavHistoryResultNode into a VisitItem
- *
- * https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsINavHistoryResultNode
- */
-function convertNodeToVisitItem(node) {
- return {
- id: node.pageGuid,
- visitId: node.visitId,
- visitTime: PlacesUtils.toDate(node.time).getTime(),
- referringVisitId: node.fromVisitId,
- transition: getTransition(node.visitType),
- };
-}
-
-/*
- * Converts a nsINavHistoryContainerResultNode into an array of objects
- *
- * https://developer.mozilla.org/en-US/docs/XPCOM_Interface_Reference/nsINavHistoryContainerResultNode
- */
-function convertNavHistoryContainerResultNode(container, converter) {
- let results = [];
- container.containerOpen = true;
- for (let i = 0; i < container.childCount; i++) {
- let node = container.getChild(i);
- results.push(converter(node));
- }
- container.containerOpen = false;
- return results;
-}
-
-var _observer;
-
-function getObserver() {
- if (!_observer) {
- _observer = {
- onDeleteURI: function(uri, guid, reason) {
- this.emit("visitRemoved", {allHistory: false, urls: [uri.spec]});
- },
- onVisit: function(uri, visitId, time, sessionId, referringId, transitionType, guid, hidden, visitCount, typed) {
- let data = {
- id: guid,
- url: uri.spec,
- title: "",
- lastVisitTime: time / 1000, // time from Places is microseconds,
- visitCount,
- typedCount: typed,
- };
- this.emit("visited", data);
- },
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onTitleChanged: function() {},
- onClearHistory: function() {
- this.emit("visitRemoved", {allHistory: true, urls: []});
- },
- onPageChanged: function() {},
- onFrecencyChanged: function() {},
- onManyFrecenciesChanged: function() {},
- onDeleteVisits: function(uri, time, guid, reason) {
- this.emit("visitRemoved", {allHistory: false, urls: [uri.spec]});
- },
- };
- EventEmitter.decorate(_observer);
- PlacesUtils.history.addObserver(_observer, false);
- }
- return _observer;
-}
-
-extensions.registerSchemaAPI("history", "addon_parent", context => {
- return {
- history: {
- addUrl: function(details) {
- let transition, date;
- try {
- transition = getTransitionType(details.transition);
- } catch (error) {
- return Promise.reject({message: error.message});
- }
- if (details.visitTime) {
- date = normalizeTime(details.visitTime);
- }
- let pageInfo = {
- title: details.title,
- url: details.url,
- visits: [
- {
- transition,
- date,
- },
- ],
- };
- try {
- return PlacesUtils.history.insert(pageInfo).then(() => undefined);
- } catch (error) {
- return Promise.reject({message: error.message});
- }
- },
-
- deleteAll: function() {
- return PlacesUtils.history.clear();
- },
-
- deleteRange: function(filter) {
- let newFilter = {
- beginDate: normalizeTime(filter.startTime),
- endDate: normalizeTime(filter.endTime),
- };
- // History.removeVisitsByFilter returns a boolean, but our API should return nothing
- return PlacesUtils.history.removeVisitsByFilter(newFilter).then(() => undefined);
- },
-
- deleteUrl: function(details) {
- let url = details.url;
- // History.remove returns a boolean, but our API should return nothing
- return PlacesUtils.history.remove(url).then(() => undefined);
- },
-
- search: function(query) {
- let beginTime = (query.startTime == null) ?
- PlacesUtils.toPRTime(Date.now() - 24 * 60 * 60 * 1000) :
- PlacesUtils.toPRTime(normalizeTime(query.startTime));
- let endTime = (query.endTime == null) ?
- Number.MAX_VALUE :
- PlacesUtils.toPRTime(normalizeTime(query.endTime));
- if (beginTime > endTime) {
- return Promise.reject({message: "The startTime cannot be after the endTime"});
- }
-
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.maxResults = query.maxResults || 100;
-
- let historyQuery = PlacesUtils.history.getNewQuery();
- historyQuery.searchTerms = query.text;
- historyQuery.beginTime = beginTime;
- historyQuery.endTime = endTime;
- let queryResult = PlacesUtils.history.executeQuery(historyQuery, options).root;
- let results = convertNavHistoryContainerResultNode(queryResult, convertNodeToHistoryItem);
- return Promise.resolve(results);
- },
-
- getVisits: function(details) {
- let url = details.url;
- if (!url) {
- return Promise.reject({message: "A URL must be provided for getVisits"});
- }
-
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
-
- let historyQuery = PlacesUtils.history.getNewQuery();
- historyQuery.uri = NetUtil.newURI(url);
- let queryResult = PlacesUtils.history.executeQuery(historyQuery, options).root;
- let results = convertNavHistoryContainerResultNode(queryResult, convertNodeToVisitItem);
- return Promise.resolve(results);
- },
-
- onVisited: new SingletonEventManager(context, "history.onVisited", fire => {
- let listener = (event, data) => {
- context.runSafe(fire, data);
- };
-
- getObserver().on("visited", listener);
- return () => {
- getObserver().off("visited", listener);
- };
- }).api(),
-
- onVisitRemoved: new SingletonEventManager(context, "history.onVisitRemoved", fire => {
- let listener = (event, data) => {
- context.runSafe(fire, data);
- };
-
- getObserver().on("visitRemoved", listener);
- return () => {
- getObserver().off("visitRemoved", listener);
- };
- }).api(),
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-omnibox.js b/application/basilisk/components/webextensions/ext-omnibox.js
deleted file mode 100644
index 9b2f60ca45..0000000000
--- a/application/basilisk/components/webextensions/ext-omnibox.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionSearchHandler",
- "resource://gre/modules/ExtensionSearchHandler.jsm");
-var {
- SingletonEventManager,
-} = ExtensionUtils;
-
-// WeakMap[extension -> keyword]
-let gKeywordMap = new WeakMap();
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("manifest_omnibox", (type, directive, extension, manifest) => {
- let keyword = manifest.omnibox.keyword;
- try {
- // This will throw if the keyword is already registered.
- ExtensionSearchHandler.registerKeyword(keyword, extension);
- gKeywordMap.set(extension, keyword);
- } catch (e) {
- extension.manifestError(e.message);
- }
-});
-
-extensions.on("shutdown", (type, extension) => {
- let keyword = gKeywordMap.get(extension);
- if (keyword) {
- ExtensionSearchHandler.unregisterKeyword(keyword);
- gKeywordMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-extensions.registerSchemaAPI("omnibox", "addon_parent", context => {
- let {extension} = context;
- return {
- omnibox: {
- setDefaultSuggestion(suggestion) {
- let keyword = gKeywordMap.get(extension);
- try {
- // This will throw if the keyword failed to register.
- ExtensionSearchHandler.setDefaultSuggestion(keyword, suggestion);
- } catch (e) {
- return Promise.reject(e.message);
- }
- },
-
- onInputStarted: new SingletonEventManager(context, "omnibox.onInputStarted", fire => {
- let listener = (eventName) => {
- fire();
- };
- extension.on(ExtensionSearchHandler.MSG_INPUT_STARTED, listener);
- return () => {
- extension.off(ExtensionSearchHandler.MSG_INPUT_STARTED, listener);
- };
- }).api(),
-
- onInputCancelled: new SingletonEventManager(context, "omnibox.onInputCancelled", fire => {
- let listener = (eventName) => {
- fire();
- };
- extension.on(ExtensionSearchHandler.MSG_INPUT_CANCELLED, listener);
- return () => {
- extension.off(ExtensionSearchHandler.MSG_INPUT_CANCELLED, listener);
- };
- }).api(),
-
- onInputEntered: new SingletonEventManager(context, "omnibox.onInputEntered", fire => {
- let listener = (eventName, text, disposition) => {
- fire(text, disposition);
- };
- extension.on(ExtensionSearchHandler.MSG_INPUT_ENTERED, listener);
- return () => {
- extension.off(ExtensionSearchHandler.MSG_INPUT_ENTERED, listener);
- };
- }).api(),
- },
-
- omnibox_internal: {
- addSuggestions(id, suggestions) {
- let keyword = gKeywordMap.get(extension);
- try {
- ExtensionSearchHandler.addSuggestions(keyword, id, suggestions);
- } catch (e) {
- // Silently fail because the extension developer can not know for sure if the user
- // has already invalidated the callback when asynchronously providing suggestions.
- }
- },
-
- onInputChanged: new SingletonEventManager(context, "omnibox_internal.onInputChanged", fire => {
- let listener = (eventName, text, id) => {
- fire(text, id);
- };
- extension.on(ExtensionSearchHandler.MSG_INPUT_CHANGED, listener);
- return () => {
- extension.off(ExtensionSearchHandler.MSG_INPUT_CHANGED, listener);
- };
- }).api(),
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-pageAction.js b/application/basilisk/components/webextensions/ext-pageAction.js
deleted file mode 100644
index 5bf3a9c707..0000000000
--- a/application/basilisk/components/webextensions/ext-pageAction.js
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- EventManager,
- IconDetails,
-} = ExtensionUtils;
-
-// WeakMap[Extension -> PageAction]
-var pageActionMap = new WeakMap();
-
-// Handles URL bar icons, including the |page_action| manifest entry
-// and associated API.
-function PageAction(options, extension) {
- this.extension = extension;
- this.id = makeWidgetId(extension.id) + "-page-action";
-
- this.tabManager = TabManager.for(extension);
-
- this.defaults = {
- show: false,
- title: options.default_title || extension.name,
- icon: IconDetails.normalize({path: options.default_icon}, extension),
- popup: options.default_popup || "",
- };
-
- this.browserStyle = options.browser_style || false;
- if (options.browser_style === null) {
- this.extension.logger.warn("Please specify whether you want browser_style " +
- "or not in your page_action options.");
- }
-
- this.tabContext = new TabContext(tab => Object.create(this.defaults),
- extension);
-
- this.tabContext.on("location-change", this.handleLocationChange.bind(this)); // eslint-disable-line mozilla/balanced-listeners
-
- // WeakMap[ChromeWindow -> <xul:image>]
- this.buttons = new WeakMap();
-
- EventEmitter.decorate(this);
-}
-
-PageAction.prototype = {
- // Returns the value of the property |prop| for the given tab, where
- // |prop| is one of "show", "title", "icon", "popup".
- getProperty(tab, prop) {
- return this.tabContext.get(tab)[prop];
- },
-
- // Sets the value of the property |prop| for the given tab to the
- // given value, symmetrically to |getProperty|.
- //
- // If |tab| is currently selected, updates the page action button to
- // reflect the new value.
- setProperty(tab, prop, value) {
- if (value != null) {
- this.tabContext.get(tab)[prop] = value;
- } else {
- delete this.tabContext.get(tab)[prop];
- }
-
- if (tab.selected) {
- this.updateButton(tab.ownerGlobal);
- }
- },
-
- // Updates the page action button in the given window to reflect the
- // properties of the currently selected tab:
- //
- // Updates "tooltiptext" and "aria-label" to match "title" property.
- // Updates "image" to match the "icon" property.
- // Shows or hides the icon, based on the "show" property.
- updateButton(window) {
- let tabData = this.tabContext.get(window.gBrowser.selectedTab);
-
- if (!(tabData.show || this.buttons.has(window))) {
- // Don't bother creating a button for a window until it actually
- // needs to be shown.
- return;
- }
-
- let button = this.getButton(window);
-
- if (tabData.show) {
- // Update the title and icon only if the button is visible.
-
- let title = tabData.title || this.extension.name;
- button.setAttribute("tooltiptext", title);
- button.setAttribute("aria-label", title);
-
- // These URLs should already be properly escaped, but make doubly sure CSS
- // string escape characters are escaped here, since they could lead to a
- // sandbox break.
- let escape = str => str.replace(/[\\\s"]/g, encodeURIComponent);
-
- let getIcon = size => escape(IconDetails.getPreferredIcon(tabData.icon, this.extension, size).icon);
-
- button.setAttribute("style", `
- --webextension-urlbar-image: url("${getIcon(16)}");
- --webextension-urlbar-image-2x: url("${getIcon(32)}");
- `);
-
- button.classList.add("webextension-page-action");
- }
-
- button.hidden = !tabData.show;
- },
-
- // Create an |image| node and add it to the |urlbar-icons|
- // container in the given window.
- addButton(window) {
- let document = window.document;
-
- let button = document.createElement("image");
- button.id = this.id;
- button.setAttribute("class", "urlbar-icon");
-
- button.addEventListener("click", event => { // eslint-disable-line mozilla/balanced-listeners
- if (event.button == 0) {
- this.handleClick(window);
- }
- });
-
- document.getElementById("urlbar-icons").appendChild(button);
-
- return button;
- },
-
- // Returns the page action button for the given window, creating it if
- // it doesn't already exist.
- getButton(window) {
- if (!this.buttons.has(window)) {
- let button = this.addButton(window);
- this.buttons.set(window, button);
- }
-
- return this.buttons.get(window);
- },
-
- /**
- * Triggers this page action for the given window, with the same effects as
- * if it were clicked by a user.
- *
- * This has no effect if the page action is hidden for the selected tab.
- *
- * @param {Window} window
- */
- triggerAction(window) {
- let pageAction = pageActionMap.get(this.extension);
- if (pageAction.getProperty(window.gBrowser.selectedTab, "show")) {
- pageAction.handleClick(window);
- }
- },
-
- // Handles a click event on the page action button for the given
- // window.
- // If the page action has a |popup| property, a panel is opened to
- // that URL. Otherwise, a "click" event is emitted, and dispatched to
- // the any click listeners in the add-on.
- handleClick(window) {
- let tab = window.gBrowser.selectedTab;
- let popupURL = this.tabContext.get(tab).popup;
-
- this.tabManager.addActiveTabPermission(tab);
-
- // If the widget has a popup URL defined, we open a popup, but do not
- // dispatch a click event to the extension.
- // If it has no popup URL defined, we dispatch a click event, but do not
- // open a popup.
- if (popupURL) {
- new PanelPopup(this.extension, this.getButton(window), popupURL,
- this.browserStyle);
- } else {
- this.emit("click", tab);
- }
- },
-
- handleLocationChange(eventType, tab, fromBrowse) {
- if (fromBrowse) {
- this.tabContext.clear(tab);
- }
- this.updateButton(tab.ownerGlobal);
- },
-
- shutdown() {
- this.tabContext.shutdown();
-
- for (let window of WindowListManager.browserWindows()) {
- if (this.buttons.has(window)) {
- this.buttons.get(window).remove();
- }
- }
- },
-};
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("manifest_page_action", (type, directive, extension, manifest) => {
- let pageAction = new PageAction(manifest.page_action, extension);
- pageActionMap.set(extension, pageAction);
-});
-
-extensions.on("shutdown", (type, extension) => {
- if (pageActionMap.has(extension)) {
- pageActionMap.get(extension).shutdown();
- pageActionMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-PageAction.for = extension => {
- return pageActionMap.get(extension);
-};
-
-global.pageActionFor = PageAction.for;
-
-extensions.registerSchemaAPI("pageAction", "addon_parent", context => {
- let {extension} = context;
- return {
- pageAction: {
- onClicked: new EventManager(context, "pageAction.onClicked", fire => {
- let listener = (evt, tab) => {
- fire(TabManager.convert(extension, tab));
- };
- let pageAction = PageAction.for(extension);
-
- pageAction.on("click", listener);
- return () => {
- pageAction.off("click", listener);
- };
- }).api(),
-
- show(tabId) {
- let tab = TabManager.getTab(tabId, context);
- PageAction.for(extension).setProperty(tab, "show", true);
- },
-
- hide(tabId) {
- let tab = TabManager.getTab(tabId, context);
- PageAction.for(extension).setProperty(tab, "show", false);
- },
-
- setTitle(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- // Clear the tab-specific title when given a null string.
- PageAction.for(extension).setProperty(tab, "title", details.title || null);
- },
-
- getTitle(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- let title = PageAction.for(extension).getProperty(tab, "title");
- return Promise.resolve(title);
- },
-
- setIcon(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- let icon = IconDetails.normalize(details, extension, context);
- PageAction.for(extension).setProperty(tab, "icon", icon);
- },
-
- setPopup(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- // Note: Chrome resolves arguments to setIcon relative to the calling
- // context, but resolves arguments to setPopup relative to the extension
- // root.
- // For internal consistency, we currently resolve both relative to the
- // calling context.
- let url = details.popup && context.uri.resolve(details.popup);
- if (url && !context.checkLoadURL(url)) {
- return Promise.reject({message: `Access denied for URL ${url}`});
- }
- PageAction.for(extension).setProperty(tab, "popup", url);
- },
-
- getPopup(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- let popup = PageAction.for(extension).getProperty(tab, "popup");
- return Promise.resolve(popup);
- },
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-sessions.js b/application/basilisk/components/webextensions/ext-sessions.js
deleted file mode 100644
index 4c13a1ac3a..0000000000
--- a/application/basilisk/components/webextensions/ext-sessions.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- promiseObserved,
-} = ExtensionUtils;
-
-XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
- "resource:///modules/sessionstore/SessionStore.jsm");
-
-function getRecentlyClosed(maxResults, extension) {
- let recentlyClosed = [];
-
- // Get closed windows
- let closedWindowData = SessionStore.getClosedWindowData(false);
- for (let window of closedWindowData) {
- recentlyClosed.push({
- lastModified: window.closedAt,
- window: WindowManager.convertFromSessionStoreClosedData(window, extension)});
- }
-
- // Get closed tabs
- for (let window of WindowListManager.browserWindows()) {
- let closedTabData = SessionStore.getClosedTabData(window, false);
- for (let tab of closedTabData) {
- recentlyClosed.push({
- lastModified: tab.closedAt,
- tab: TabManager.for(extension).convertFromSessionStoreClosedData(tab, window)});
- }
- }
-
- // Sort windows and tabs
- recentlyClosed.sort((a, b) => b.lastModified - a.lastModified);
- return recentlyClosed.slice(0, maxResults);
-}
-
-function createSession(restored, extension, sessionId) {
- if (!restored) {
- return Promise.reject({message: `Could not restore object using sessionId ${sessionId}.`});
- }
- let sessionObj = {lastModified: Date.now()};
- if (restored instanceof Ci.nsIDOMChromeWindow) {
- return promiseObserved("sessionstore-single-window-restored", subject => subject == restored).then(() => {
- sessionObj.window = WindowManager.convert(extension, restored, {populate: true});
- return Promise.resolve([sessionObj]);
- });
- }
- sessionObj.tab = TabManager.for(extension).convert(restored);
- return Promise.resolve([sessionObj]);
-}
-
-extensions.registerSchemaAPI("sessions", "addon_parent", context => {
- let {extension} = context;
- return {
- sessions: {
- getRecentlyClosed: function(filter) {
- let maxResults = filter.maxResults == undefined ? this.MAX_SESSION_RESULTS : filter.maxResults;
- return Promise.resolve(getRecentlyClosed(maxResults, extension));
- },
- restore: function(sessionId) {
- let session, closedId;
- if (sessionId) {
- closedId = sessionId;
- session = SessionStore.undoCloseById(closedId);
- } else if (SessionStore.lastClosedObjectType == "window") {
- // If the most recently closed object is a window, just undo closing the most recent window.
- session = SessionStore.undoCloseWindow(0);
- } else {
- // It is a tab, and we cannot call SessionStore.undoCloseTab without a window,
- // so we must find the tab in which case we can just use its closedId.
- let recentlyClosedTabs = [];
- for (let window of WindowListManager.browserWindows()) {
- let closedTabData = SessionStore.getClosedTabData(window, false);
- for (let tab of closedTabData) {
- recentlyClosedTabs.push(tab);
- }
- }
-
- // Sort the tabs.
- recentlyClosedTabs.sort((a, b) => b.closedAt - a.closedAt);
-
- // Use the closedId of the most recently closed tab to restore it.
- closedId = recentlyClosedTabs[0].closedId;
- session = SessionStore.undoCloseById(closedId);
- }
- return createSession(session, extension, closedId);
- },
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/ext-tabs.js b/application/basilisk/components/webextensions/ext-tabs.js
deleted file mode 100644
index bb575aaabe..0000000000
--- a/application/basilisk/components/webextensions/ext-tabs.js
+++ /dev/null
@@ -1,1093 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
- "@mozilla.org/browser/aboutnewtab-service;1",
- "nsIAboutNewTabService");
-
-XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
- "resource://gre/modules/PromiseUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-var {
- EventManager,
- ignoreEvent,
-} = ExtensionUtils;
-
-// This function is pretty tightly tied to Extension.jsm.
-// Its job is to fill in the |tab| property of the sender.
-function getSender(extension, target, sender) {
- if ("tabId" in sender) {
- // The message came from an ExtensionContext. In that case, it should
- // include a tabId property (which is filled in by the page-open
- // listener below).
- let tab = TabManager.getTab(sender.tabId, null, null);
- delete sender.tabId;
- if (tab) {
- sender.tab = TabManager.convert(extension, tab);
- return;
- }
- }
- if (target instanceof Ci.nsIDOMXULElement) {
- // If the message was sent from a content script to a <browser> element,
- // then we can just get the `tab` from `target`.
- let tabbrowser = target.ownerGlobal.gBrowser;
- if (tabbrowser) {
- let tab = tabbrowser.getTabForBrowser(target);
-
- // `tab` can be `undefined`, e.g. for extension popups. This condition is
- // reached if `getSender` is called for a popup without a valid `tabId`.
- if (tab) {
- sender.tab = TabManager.convert(extension, tab);
- }
- }
- }
-}
-
-// Used by Extension.jsm
-global.tabGetSender = getSender;
-
-/* eslint-disable mozilla/balanced-listeners */
-
-extensions.on("page-shutdown", (type, context) => {
- if (context.viewType == "tab") {
- if (context.extension.id !== context.xulBrowser.contentPrincipal.addonId) {
- // Only close extension tabs.
- // This check prevents about:addons from closing when it contains a
- // WebExtension as an embedded inline options page.
- return;
- }
- let {gBrowser} = context.xulBrowser.ownerGlobal;
- if (gBrowser) {
- let tab = gBrowser.getTabForBrowser(context.xulBrowser);
- if (tab) {
- gBrowser.removeTab(tab);
- }
- }
- }
-});
-
-extensions.on("fill-browser-data", (type, browser, data) => {
- data.tabId = browser ? TabManager.getBrowserId(browser) : -1;
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-global.currentWindow = function(context) {
- let {xulWindow} = context;
- if (xulWindow && context.viewType != "background") {
- return xulWindow;
- }
- return WindowManager.topWindow;
-};
-
-let tabListener = {
- init() {
- if (this.initialized) {
- return;
- }
-
- this.adoptedTabs = new WeakMap();
-
- this.handleWindowOpen = this.handleWindowOpen.bind(this);
- this.handleWindowClose = this.handleWindowClose.bind(this);
-
- AllWindowEvents.addListener("TabClose", this);
- AllWindowEvents.addListener("TabOpen", this);
- WindowListManager.addOpenListener(this.handleWindowOpen);
- WindowListManager.addCloseListener(this.handleWindowClose);
-
- EventEmitter.decorate(this);
-
- this.initialized = true;
- },
-
- handleEvent(event) {
- switch (event.type) {
- case "TabOpen":
- if (event.detail.adoptedTab) {
- this.adoptedTabs.set(event.detail.adoptedTab, event.target);
- }
-
- // We need to delay sending this event until the next tick, since the
- // tab does not have its final index when the TabOpen event is dispatched.
- Promise.resolve().then(() => {
- if (event.detail.adoptedTab) {
- this.emitAttached(event.originalTarget);
- } else {
- this.emitCreated(event.originalTarget);
- }
- });
- break;
-
- case "TabClose":
- let tab = event.originalTarget;
-
- if (event.detail.adoptedBy) {
- this.emitDetached(tab, event.detail.adoptedBy);
- } else {
- this.emitRemoved(tab, false);
- }
- break;
- }
- },
-
- handleWindowOpen(window) {
- if (window.arguments[0] instanceof window.XULElement) {
- // If the first window argument is a XUL element, it means the
- // window is about to adopt a tab from another window to replace its
- // initial tab.
- //
- // Note that this event handler depends on running before the
- // delayed startup code in browser.js, which is currently triggered
- // by the first MozAfterPaint event. That code handles finally
- // adopting the tab, and clears it from the arguments list in the
- // process, so if we run later than it, we're too late.
- let tab = window.arguments[0];
- this.adoptedTabs.set(tab, window.gBrowser.tabs[0]);
-
- // We need to be sure to fire this event after the onDetached event
- // for the original tab.
- let listener = (event, details) => {
- if (details.tab == tab) {
- this.off("tab-detached", listener);
-
- Promise.resolve().then(() => {
- this.emitAttached(details.adoptedBy);
- });
- }
- };
-
- this.on("tab-detached", listener);
- } else {
- for (let tab of window.gBrowser.tabs) {
- this.emitCreated(tab);
- }
- }
- },
-
- handleWindowClose(window) {
- for (let tab of window.gBrowser.tabs) {
- if (this.adoptedTabs.has(tab)) {
- this.emitDetached(tab, this.adoptedTabs.get(tab));
- } else {
- this.emitRemoved(tab, true);
- }
- }
- },
-
- emitAttached(tab) {
- let newWindowId = WindowManager.getId(tab.ownerGlobal);
- let tabId = TabManager.getId(tab);
-
- this.emit("tab-attached", {tab, tabId, newWindowId, newPosition: tab._tPos});
- },
-
- emitDetached(tab, adoptedBy) {
- let oldWindowId = WindowManager.getId(tab.ownerGlobal);
- let tabId = TabManager.getId(tab);
-
- this.emit("tab-detached", {tab, adoptedBy, tabId, oldWindowId, oldPosition: tab._tPos});
- },
-
- emitCreated(tab) {
- this.emit("tab-created", {tab});
- },
-
- emitRemoved(tab, isWindowClosing) {
- let windowId = WindowManager.getId(tab.ownerGlobal);
- let tabId = TabManager.getId(tab);
-
- // When addons run in-process, `window.close()` is synchronous. Most other
- // addon-invoked calls are asynchronous since they go through a proxy
- // context via the message manager. This includes event registrations such
- // as `tabs.onRemoved.addListener`.
- // So, even if `window.close()` were to be called (in-process) after calling
- // `tabs.onRemoved.addListener`, then the tab would be closed before the
- // event listener is registered. To make sure that the event listener is
- // notified, we dispatch `tabs.onRemoved` asynchronously.
- Services.tm.mainThread.dispatch(() => {
- this.emit("tab-removed", {tab, tabId, windowId, isWindowClosing});
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
-
- tabReadyInitialized: false,
- tabReadyPromises: new WeakMap(),
- initializingTabs: new WeakSet(),
-
- initTabReady() {
- if (!this.tabReadyInitialized) {
- AllWindowEvents.addListener("progress", this);
-
- this.tabReadyInitialized = true;
- }
- },
-
- onLocationChange(browser, webProgress, request, locationURI, flags) {
- if (webProgress.isTopLevel) {
- let gBrowser = browser.ownerGlobal.gBrowser;
- let tab = gBrowser.getTabForBrowser(browser);
-
- // Now we are certain that the first page in the tab was loaded.
- this.initializingTabs.delete(tab);
-
- // browser.innerWindowID is now set, resolve the promises if any.
- let deferred = this.tabReadyPromises.get(tab);
- if (deferred) {
- deferred.resolve(tab);
- this.tabReadyPromises.delete(tab);
- }
- }
- },
-
- /**
- * Returns a promise that resolves when the tab is ready.
- * Tabs created via the `tabs.create` method are "ready" once the location
- * changes to the requested URL. Other tabs are assumed to be ready once their
- * inner window ID is known.
- *
- * @param {XULElement} tab The <tab> element.
- * @returns {Promise} Resolves with the given tab once ready.
- */
- awaitTabReady(tab) {
- let deferred = this.tabReadyPromises.get(tab);
- if (!deferred) {
- deferred = PromiseUtils.defer();
- if (!this.initializingTabs.has(tab) && tab.linkedBrowser.innerWindowID) {
- deferred.resolve(tab);
- } else {
- this.initTabReady();
- this.tabReadyPromises.set(tab, deferred);
- }
- }
- return deferred.promise;
- },
-};
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("startup", () => {
- tabListener.init();
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-extensions.registerSchemaAPI("tabs", "addon_parent", context => {
- let {extension} = context;
- let self = {
- tabs: {
- onActivated: new WindowEventManager(context, "tabs.onActivated", "TabSelect", (fire, event) => {
- let tab = event.originalTarget;
- let tabId = TabManager.getId(tab);
- let windowId = WindowManager.getId(tab.ownerGlobal);
- fire({tabId, windowId});
- }).api(),
-
- onCreated: new EventManager(context, "tabs.onCreated", fire => {
- let listener = (eventName, event) => {
- fire(TabManager.convert(extension, event.tab));
- };
-
- tabListener.on("tab-created", listener);
- return () => {
- tabListener.off("tab-created", listener);
- };
- }).api(),
-
- /**
- * Since multiple tabs currently can't be highlighted, onHighlighted
- * essentially acts an alias for self.tabs.onActivated but returns
- * the tabId in an array to match the API.
- * @see https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/Tabs/onHighlighted
- */
- onHighlighted: new WindowEventManager(context, "tabs.onHighlighted", "TabSelect", (fire, event) => {
- let tab = event.originalTarget;
- let tabIds = [TabManager.getId(tab)];
- let windowId = WindowManager.getId(tab.ownerGlobal);
- fire({tabIds, windowId});
- }).api(),
-
- onAttached: new EventManager(context, "tabs.onAttached", fire => {
- let listener = (eventName, event) => {
- fire(event.tabId, {newWindowId: event.newWindowId, newPosition: event.newPosition});
- };
-
- tabListener.on("tab-attached", listener);
- return () => {
- tabListener.off("tab-attached", listener);
- };
- }).api(),
-
- onDetached: new EventManager(context, "tabs.onDetached", fire => {
- let listener = (eventName, event) => {
- fire(event.tabId, {oldWindowId: event.oldWindowId, oldPosition: event.oldPosition});
- };
-
- tabListener.on("tab-detached", listener);
- return () => {
- tabListener.off("tab-detached", listener);
- };
- }).api(),
-
- onRemoved: new EventManager(context, "tabs.onRemoved", fire => {
- let listener = (eventName, event) => {
- fire(event.tabId, {windowId: event.windowId, isWindowClosing: event.isWindowClosing});
- };
-
- tabListener.on("tab-removed", listener);
- return () => {
- tabListener.off("tab-removed", listener);
- };
- }).api(),
-
- onReplaced: ignoreEvent(context, "tabs.onReplaced"),
-
- onMoved: new EventManager(context, "tabs.onMoved", fire => {
- // There are certain circumstances where we need to ignore a move event.
- //
- // Namely, the first time the tab is moved after it's created, we need
- // to report the final position as the initial position in the tab's
- // onAttached or onCreated event. This is because most tabs are inserted
- // in a temporary location and then moved after the TabOpen event fires,
- // which generates a TabOpen event followed by a TabMove event, which
- // does not match the contract of our API.
- let ignoreNextMove = new WeakSet();
-
- let openListener = event => {
- ignoreNextMove.add(event.target);
- // Remove the tab from the set on the next tick, since it will already
- // have been moved by then.
- Promise.resolve().then(() => {
- ignoreNextMove.delete(event.target);
- });
- };
-
- let moveListener = event => {
- let tab = event.originalTarget;
-
- if (ignoreNextMove.has(tab)) {
- ignoreNextMove.delete(tab);
- return;
- }
-
- fire(TabManager.getId(tab), {
- windowId: WindowManager.getId(tab.ownerGlobal),
- fromIndex: event.detail,
- toIndex: tab._tPos,
- });
- };
-
- AllWindowEvents.addListener("TabMove", moveListener);
- AllWindowEvents.addListener("TabOpen", openListener);
- return () => {
- AllWindowEvents.removeListener("TabMove", moveListener);
- AllWindowEvents.removeListener("TabOpen", openListener);
- };
- }).api(),
-
- onUpdated: new EventManager(context, "tabs.onUpdated", fire => {
- function sanitize(extension, changeInfo) {
- let result = {};
- let nonempty = false;
- for (let prop in changeInfo) {
- if ((prop != "favIconUrl" && prop != "url") || extension.hasPermission("tabs")) {
- nonempty = true;
- result[prop] = changeInfo[prop];
- }
- }
- return [nonempty, result];
- }
-
- let fireForBrowser = (browser, changed) => {
- let [needed, changeInfo] = sanitize(extension, changed);
- if (needed) {
- let gBrowser = browser.ownerGlobal.gBrowser;
- let tabElem = gBrowser.getTabForBrowser(browser);
-
- let tab = TabManager.convert(extension, tabElem);
- fire(tab.id, changeInfo, tab);
- }
- };
-
- let listener = event => {
- let needed = [];
- if (event.type == "TabAttrModified") {
- let changed = event.detail.changed;
- if (changed.includes("image")) {
- needed.push("favIconUrl");
- }
- if (changed.includes("muted")) {
- needed.push("mutedInfo");
- }
- if (changed.includes("soundplaying")) {
- needed.push("audible");
- }
- } else if (event.type == "TabPinned") {
- needed.push("pinned");
- } else if (event.type == "TabUnpinned") {
- needed.push("pinned");
- }
-
- if (needed.length && !extension.hasPermission("tabs")) {
- needed = needed.filter(attr => attr != "url" && attr != "favIconUrl");
- }
-
- if (needed.length) {
- let tab = TabManager.convert(extension, event.originalTarget);
-
- let changeInfo = {};
- for (let prop of needed) {
- changeInfo[prop] = tab[prop];
- }
- fire(tab.id, changeInfo, tab);
- }
- };
- let progressListener = {
- onStateChange(browser, webProgress, request, stateFlags, statusCode) {
- if (!webProgress.isTopLevel) {
- return;
- }
-
- let status;
- if (stateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
- if (stateFlags & Ci.nsIWebProgressListener.STATE_START) {
- status = "loading";
- } else if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
- status = "complete";
- }
- } else if (stateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
- statusCode == Cr.NS_BINDING_ABORTED) {
- status = "complete";
- }
-
- fireForBrowser(browser, {status});
- },
-
- onLocationChange(browser, webProgress, request, locationURI, flags) {
- if (!webProgress.isTopLevel) {
- return;
- }
-
- fireForBrowser(browser, {
- status: webProgress.isLoadingDocument ? "loading" : "complete",
- url: locationURI.spec,
- });
- },
- };
-
- AllWindowEvents.addListener("progress", progressListener);
- AllWindowEvents.addListener("TabAttrModified", listener);
- AllWindowEvents.addListener("TabPinned", listener);
- AllWindowEvents.addListener("TabUnpinned", listener);
-
- return () => {
- AllWindowEvents.removeListener("progress", progressListener);
- AllWindowEvents.removeListener("TabAttrModified", listener);
- AllWindowEvents.removeListener("TabPinned", listener);
- AllWindowEvents.removeListener("TabUnpinned", listener);
- };
- }).api(),
-
- create: function(createProperties) {
- return new Promise((resolve, reject) => {
- let window = createProperties.windowId !== null ?
- WindowManager.getWindow(createProperties.windowId, context) :
- WindowManager.topWindow;
- if (!window.gBrowser) {
- let obs = (finishedWindow, topic, data) => {
- if (finishedWindow != window) {
- return;
- }
- Services.obs.removeObserver(obs, "browser-delayed-startup-finished");
- resolve(window);
- };
- Services.obs.addObserver(obs, "browser-delayed-startup-finished", false);
- } else {
- resolve(window);
- }
- }).then(window => {
- let url;
-
- if (createProperties.url !== null) {
- url = context.uri.resolve(createProperties.url);
-
- if (!context.checkLoadURL(url, {dontReportErrors: true})) {
- return Promise.reject({message: `Illegal URL: ${url}`});
- }
- }
-
- if (createProperties.cookieStoreId && !extension.hasPermission("cookies")) {
- return Promise.reject({message: `No permission for cookieStoreId: ${createProperties.cookieStoreId}`});
- }
-
- let options = {};
- if (createProperties.cookieStoreId) {
- if (!global.isValidCookieStoreId(createProperties.cookieStoreId)) {
- return Promise.reject({message: `Illegal cookieStoreId: ${createProperties.cookieStoreId}`});
- }
-
- let privateWindow = PrivateBrowsingUtils.isBrowserPrivate(window.gBrowser);
- if (privateWindow && !global.isPrivateCookieStoreId(createProperties.cookieStoreId)) {
- return Promise.reject({message: `Illegal to set non-private cookieStorageId in a private window`});
- }
-
- if (!privateWindow && global.isPrivateCookieStoreId(createProperties.cookieStoreId)) {
- return Promise.reject({message: `Illegal to set private cookieStorageId in a non-private window`});
- }
-
- if (global.isContainerCookieStoreId(createProperties.cookieStoreId)) {
- let containerId = global.getContainerForCookieStoreId(createProperties.cookieStoreId);
- if (!containerId) {
- return Promise.reject({message: `No cookie store exists with ID ${createProperties.cookieStoreId}`});
- }
-
- options.userContextId = containerId;
- }
- }
-
- tabListener.initTabReady();
- let tab = window.gBrowser.addTab(url || window.BROWSER_NEW_TAB_URL, options);
-
- let active = true;
- if (createProperties.active !== null) {
- active = createProperties.active;
- }
- if (active) {
- window.gBrowser.selectedTab = tab;
- }
-
- if (createProperties.index !== null) {
- window.gBrowser.moveTabTo(tab, createProperties.index);
- }
-
- if (createProperties.pinned) {
- window.gBrowser.pinTab(tab);
- }
-
- if (createProperties.url && !createProperties.url.startsWith("about:")) {
- // We can't wait for a location change event for about:newtab,
- // since it may be pre-rendered, in which case its initial
- // location change event has already fired.
-
- // Mark the tab as initializing, so that operations like
- // `executeScript` wait until the requested URL is loaded in
- // the tab before dispatching messages to the inner window
- // that contains the URL we're attempting to load.
- tabListener.initializingTabs.add(tab);
- }
-
- return TabManager.convert(extension, tab);
- });
- },
-
- remove: function(tabs) {
- if (!Array.isArray(tabs)) {
- tabs = [tabs];
- }
-
- for (let tabId of tabs) {
- let tab = TabManager.getTab(tabId, context);
- tab.ownerGlobal.gBrowser.removeTab(tab);
- }
-
- return Promise.resolve();
- },
-
- update: function(tabId, updateProperties) {
- let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let tabbrowser = tab.ownerGlobal.gBrowser;
-
- if (updateProperties.url !== null) {
- let url = context.uri.resolve(updateProperties.url);
-
- if (!context.checkLoadURL(url, {dontReportErrors: true})) {
- return Promise.reject({message: `Illegal URL: ${url}`});
- }
-
- tab.linkedBrowser.loadURI(url);
- }
-
- if (updateProperties.active !== null) {
- if (updateProperties.active) {
- tabbrowser.selectedTab = tab;
- } else {
- // Not sure what to do here? Which tab should we select?
- }
- }
- if (updateProperties.muted !== null) {
- if (tab.muted != updateProperties.muted) {
- tab.toggleMuteAudio(extension.uuid);
- }
- }
- if (updateProperties.pinned !== null) {
- if (updateProperties.pinned) {
- tabbrowser.pinTab(tab);
- } else {
- tabbrowser.unpinTab(tab);
- }
- }
- // FIXME: highlighted/selected, openerTabId
-
- return Promise.resolve(TabManager.convert(extension, tab));
- },
-
- reload: function(tabId, reloadProperties) {
- let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
- if (reloadProperties && reloadProperties.bypassCache) {
- flags |= Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
- }
- tab.linkedBrowser.reloadWithFlags(flags);
-
- return Promise.resolve();
- },
-
- get: function(tabId) {
- let tab = TabManager.getTab(tabId, context);
-
- return Promise.resolve(TabManager.convert(extension, tab));
- },
-
- getCurrent() {
- let tab;
- if (context.tabId) {
- tab = TabManager.convert(extension, TabManager.getTab(context.tabId, context));
- }
- return Promise.resolve(tab);
- },
-
- query: function(queryInfo) {
- let pattern = null;
- if (queryInfo.url !== null) {
- if (!extension.hasPermission("tabs")) {
- return Promise.reject({message: 'The "tabs" permission is required to use the query API with the "url" parameter'});
- }
-
- pattern = new MatchPattern(queryInfo.url);
- }
-
- function matches(tab) {
- let props = ["active", "pinned", "highlighted", "status", "title", "index"];
- for (let prop of props) {
- if (queryInfo[prop] !== null && queryInfo[prop] != tab[prop]) {
- return false;
- }
- }
-
- if (queryInfo.audible !== null) {
- if (queryInfo.audible != tab.audible) {
- return false;
- }
- }
-
- if (queryInfo.muted !== null) {
- if (queryInfo.muted != tab.mutedInfo.muted) {
- return false;
- }
- }
-
- if (queryInfo.cookieStoreId !== null &&
- tab.cookieStoreId != queryInfo.cookieStoreId) {
- return false;
- }
-
- if (pattern && !pattern.matches(Services.io.newURI(tab.url, null, null))) {
- return false;
- }
-
- return true;
- }
-
- let result = [];
- for (let window of WindowListManager.browserWindows()) {
- let lastFocused = window === WindowManager.topWindow;
- if (queryInfo.lastFocusedWindow !== null && queryInfo.lastFocusedWindow !== lastFocused) {
- continue;
- }
-
- let windowType = WindowManager.windowType(window);
- if (queryInfo.windowType !== null && queryInfo.windowType !== windowType) {
- continue;
- }
-
- if (queryInfo.windowId !== null) {
- if (queryInfo.windowId === WindowManager.WINDOW_ID_CURRENT) {
- if (currentWindow(context) !== window) {
- continue;
- }
- } else if (queryInfo.windowId !== WindowManager.getId(window)) {
- continue;
- }
- }
-
- if (queryInfo.currentWindow !== null) {
- let eq = window === currentWindow(context);
- if (queryInfo.currentWindow != eq) {
- continue;
- }
- }
-
- let tabs = TabManager.for(extension).getTabs(window);
- for (let tab of tabs) {
- if (matches(tab)) {
- result.push(tab);
- }
- }
- }
- return Promise.resolve(result);
- },
-
- captureVisibleTab: function(windowId, options) {
- if (!extension.hasPermission("<all_urls>")) {
- return Promise.reject({message: "The <all_urls> permission is required to use the captureVisibleTab API"});
- }
-
- let window = windowId == null ?
- WindowManager.topWindow :
- WindowManager.getWindow(windowId, context);
-
- let tab = window.gBrowser.selectedTab;
- return tabListener.awaitTabReady(tab).then(() => {
- let browser = tab.linkedBrowser;
- let recipient = {
- innerWindowID: browser.innerWindowID,
- };
-
- if (!options) {
- options = {};
- }
- if (options.format == null) {
- options.format = "png";
- }
- if (options.quality == null) {
- options.quality = 92;
- }
-
- let message = {
- options,
- width: browser.clientWidth,
- height: browser.clientHeight,
- };
-
- return context.sendMessage(browser.messageManager, "Extension:Capture",
- message, {recipient});
- });
- },
-
- detectLanguage: function(tabId) {
- let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- return tabListener.awaitTabReady(tab).then(() => {
- let browser = tab.linkedBrowser;
- let recipient = {innerWindowID: browser.innerWindowID};
-
- return context.sendMessage(browser.messageManager, "Extension:DetectLanguage",
- {}, {recipient});
- });
- },
-
- // Used to executeScript, insertCSS and removeCSS.
- _execute: function(tabId, details, kind, method) {
- let tab = tabId !== null ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let options = {
- js: [],
- css: [],
- remove_css: method == "removeCSS",
- };
-
- // We require a `code` or a `file` property, but we can't accept both.
- if ((details.code === null) == (details.file === null)) {
- return Promise.reject({message: `${method} requires either a 'code' or a 'file' property, but not both`});
- }
-
- if (details.frameId !== null && details.allFrames) {
- return Promise.reject({message: `'frameId' and 'allFrames' are mutually exclusive`});
- }
-
- if (TabManager.for(extension).hasActiveTabPermission(tab)) {
- // If we have the "activeTab" permission for this tab, ignore
- // the host whitelist.
- options.matchesHost = ["<all_urls>"];
- } else {
- options.matchesHost = extension.whiteListedHosts.serialize();
- }
-
- if (details.code !== null) {
- options[kind + "Code"] = details.code;
- }
- if (details.file !== null) {
- let url = context.uri.resolve(details.file);
- if (!extension.isExtensionURL(url)) {
- return Promise.reject({message: "Files to be injected must be within the extension"});
- }
- options[kind].push(url);
- }
- if (details.allFrames) {
- options.all_frames = details.allFrames;
- }
- if (details.frameId !== null) {
- options.frame_id = details.frameId;
- }
- if (details.matchAboutBlank) {
- options.match_about_blank = details.matchAboutBlank;
- }
- if (details.runAt !== null) {
- options.run_at = details.runAt;
- } else {
- options.run_at = "document_idle";
- }
-
- return tabListener.awaitTabReady(tab).then(() => {
- let browser = tab.linkedBrowser;
- let recipient = {
- innerWindowID: browser.innerWindowID,
- };
-
- return context.sendMessage(browser.messageManager, "Extension:Execute", {options}, {recipient});
- });
- },
-
- executeScript: function(tabId, details) {
- return self.tabs._execute(tabId, details, "js", "executeScript");
- },
-
- insertCSS: function(tabId, details) {
- return self.tabs._execute(tabId, details, "css", "insertCSS").then(() => {});
- },
-
- removeCSS: function(tabId, details) {
- return self.tabs._execute(tabId, details, "css", "removeCSS").then(() => {});
- },
-
- move: function(tabIds, moveProperties) {
- let index = moveProperties.index;
- let tabsMoved = [];
- if (!Array.isArray(tabIds)) {
- tabIds = [tabIds];
- }
-
- let destinationWindow = null;
- if (moveProperties.windowId !== null) {
- destinationWindow = WindowManager.getWindow(moveProperties.windowId, context);
- // Fail on an invalid window.
- if (!destinationWindow) {
- return Promise.reject({message: `Invalid window ID: ${moveProperties.windowId}`});
- }
- }
-
- /*
- Indexes are maintained on a per window basis so that a call to
- move([tabA, tabB], {index: 0})
- -> tabA to 0, tabB to 1 if tabA and tabB are in the same window
- move([tabA, tabB], {index: 0})
- -> tabA to 0, tabB to 0 if tabA and tabB are in different windows
- */
- let indexMap = new Map();
-
- let tabs = tabIds.map(tabId => TabManager.getTab(tabId, context));
- for (let tab of tabs) {
- // If the window is not specified, use the window from the tab.
- let window = destinationWindow || tab.ownerGlobal;
- let gBrowser = window.gBrowser;
-
- let insertionPoint = indexMap.get(window) || index;
- // If the index is -1 it should go to the end of the tabs.
- if (insertionPoint == -1) {
- insertionPoint = gBrowser.tabs.length;
- }
-
- // We can only move pinned tabs to a point within, or just after,
- // the current set of pinned tabs. Unpinned tabs, likewise, can only
- // be moved to a position after the current set of pinned tabs.
- // Attempts to move a tab to an illegal position are ignored.
- let numPinned = gBrowser._numPinnedTabs;
- let ok = tab.pinned ? insertionPoint <= numPinned : insertionPoint >= numPinned;
- if (!ok) {
- continue;
- }
-
- indexMap.set(window, insertionPoint + 1);
-
- if (tab.ownerGlobal != window) {
- // If the window we are moving the tab in is different, then move the tab
- // to the new window.
- tab = gBrowser.adoptTab(tab, insertionPoint, false);
- } else {
- // If the window we are moving is the same, just move the tab.
- gBrowser.moveTabTo(tab, insertionPoint);
- }
- tabsMoved.push(tab);
- }
-
- return Promise.resolve(tabsMoved.map(tab => TabManager.convert(extension, tab)));
- },
-
- duplicate: function(tabId) {
- let tab = TabManager.getTab(tabId, context);
-
- let gBrowser = tab.ownerGlobal.gBrowser;
- let newTab = gBrowser.duplicateTab(tab);
-
- return new Promise(resolve => {
- // We need to use SSTabRestoring because any attributes set before
- // are ignored. SSTabRestored is too late and results in a jump in
- // the UI. See http://bit.ly/session-store-api for more information.
- newTab.addEventListener("SSTabRestoring", function listener() {
- // As the tab is restoring, move it to the correct position.
- newTab.removeEventListener("SSTabRestoring", listener);
- // Pinned tabs that are duplicated are inserted
- // after the existing pinned tab and pinned.
- if (tab.pinned) {
- gBrowser.pinTab(newTab);
- }
- gBrowser.moveTabTo(newTab, tab._tPos + 1);
- });
-
- newTab.addEventListener("SSTabRestored", function listener() {
- // Once it has been restored, select it and return the promise.
- newTab.removeEventListener("SSTabRestored", listener);
- gBrowser.selectedTab = newTab;
- return resolve(TabManager.convert(extension, newTab));
- });
- });
- },
-
- getZoom(tabId) {
- let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let {ZoomManager} = tab.ownerGlobal;
- let zoom = ZoomManager.getZoomForBrowser(tab.linkedBrowser);
-
- return Promise.resolve(zoom);
- },
-
- setZoom(tabId, zoom) {
- let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let {FullZoom, ZoomManager} = tab.ownerGlobal;
-
- if (zoom === 0) {
- // A value of zero means use the default zoom factor.
- return FullZoom.reset(tab.linkedBrowser);
- } else if (zoom >= ZoomManager.MIN && zoom <= ZoomManager.MAX) {
- FullZoom.setZoom(zoom, tab.linkedBrowser);
- } else {
- return Promise.reject({
- message: `Zoom value ${zoom} out of range (must be between ${ZoomManager.MIN} and ${ZoomManager.MAX})`,
- });
- }
-
- return Promise.resolve();
- },
-
- _getZoomSettings(tabId) {
- let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let {FullZoom} = tab.ownerGlobal;
-
- return {
- mode: "automatic",
- scope: FullZoom.siteSpecific ? "per-origin" : "per-tab",
- defaultZoomFactor: 1,
- };
- },
-
- getZoomSettings(tabId) {
- return Promise.resolve(this._getZoomSettings(tabId));
- },
-
- setZoomSettings(tabId, settings) {
- let tab = tabId ? TabManager.getTab(tabId, context) : TabManager.activeTab;
-
- let currentSettings = this._getZoomSettings(tab.id);
-
- if (!Object.keys(settings).every(key => settings[key] === currentSettings[key])) {
- return Promise.reject(`Unsupported zoom settings: ${JSON.stringify(settings)}`);
- }
- return Promise.resolve();
- },
-
- onZoomChange: new EventManager(context, "tabs.onZoomChange", fire => {
- let getZoomLevel = browser => {
- let {ZoomManager} = browser.ownerGlobal;
-
- return ZoomManager.getZoomForBrowser(browser);
- };
-
- // Stores the last known zoom level for each tab's browser.
- // WeakMap[<browser> -> number]
- let zoomLevels = new WeakMap();
-
- // Store the zoom level for all existing tabs.
- for (let window of WindowListManager.browserWindows()) {
- for (let tab of window.gBrowser.tabs) {
- let browser = tab.linkedBrowser;
- zoomLevels.set(browser, getZoomLevel(browser));
- }
- }
-
- let tabCreated = (eventName, event) => {
- let browser = event.tab.linkedBrowser;
- zoomLevels.set(browser, getZoomLevel(browser));
- };
-
-
- let zoomListener = event => {
- let browser = event.originalTarget;
-
- // For non-remote browsers, this event is dispatched on the document
- // rather than on the <browser>.
- if (browser instanceof Ci.nsIDOMDocument) {
- browser = browser.defaultView.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .chromeEventHandler;
- }
-
- let {gBrowser} = browser.ownerGlobal;
- let tab = gBrowser.getTabForBrowser(browser);
- if (!tab) {
- // We only care about zoom events in the top-level browser of a tab.
- return;
- }
-
- let oldZoomFactor = zoomLevels.get(browser);
- let newZoomFactor = getZoomLevel(browser);
-
- if (oldZoomFactor != newZoomFactor) {
- zoomLevels.set(browser, newZoomFactor);
-
- let tabId = TabManager.getId(tab);
- fire({
- tabId,
- oldZoomFactor,
- newZoomFactor,
- zoomSettings: self.tabs._getZoomSettings(tabId),
- });
- }
- };
-
- tabListener.on("tab-attached", tabCreated);
- tabListener.on("tab-created", tabCreated);
-
- AllWindowEvents.addListener("FullZoomChange", zoomListener);
- AllWindowEvents.addListener("TextZoomChange", zoomListener);
- return () => {
- tabListener.off("tab-attached", tabCreated);
- tabListener.off("tab-created", tabCreated);
-
- AllWindowEvents.removeListener("FullZoomChange", zoomListener);
- AllWindowEvents.removeListener("TextZoomChange", zoomListener);
- };
- }).api(),
- },
- };
- return self;
-});
diff --git a/application/basilisk/components/webextensions/ext-utils.js b/application/basilisk/components/webextensions/ext-utils.js
deleted file mode 100644
index 75b2f4bd4a..0000000000
--- a/application/basilisk/components/webextensions/ext-utils.js
+++ /dev/null
@@ -1,1239 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "CustomizableUI",
- "resource:///modules/CustomizableUI.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
- "resource://gre/modules/Timer.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService",
- "@mozilla.org/content/style-sheet-service;1",
- "nsIStyleSheetService");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-const POPUP_LOAD_TIMEOUT_MS = 200;
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-var {
- DefaultWeakMap,
- EventManager,
- promiseEvent,
-} = ExtensionUtils;
-
-// This file provides some useful code for the |tabs| and |windows|
-// modules. All of the code is installed on |global|, which is a scope
-// shared among the different ext-*.js scripts.
-
-global.makeWidgetId = id => {
- id = id.toLowerCase();
- // FIXME: This allows for collisions.
- return id.replace(/[^a-z0-9_-]/g, "_");
-};
-
-function promisePopupShown(popup) {
- return new Promise(resolve => {
- if (popup.state == "open") {
- resolve();
- } else {
- popup.addEventListener("popupshown", function onPopupShown(event) {
- popup.removeEventListener("popupshown", onPopupShown);
- resolve();
- });
- }
- });
-}
-
-XPCOMUtils.defineLazyGetter(this, "popupStylesheets", () => {
- let stylesheets = ["chrome://browser/content/extension.css"];
-
- if (AppConstants.platform === "macosx") {
- stylesheets.push("chrome://browser/content/extension-mac.css");
- }
- return stylesheets;
-});
-
-XPCOMUtils.defineLazyGetter(this, "standaloneStylesheets", () => {
- let stylesheets = [];
-
- if (AppConstants.platform === "macosx") {
- stylesheets.push("chrome://browser/content/extension-mac-panel.css");
- }
- if (AppConstants.platform === "win") {
- stylesheets.push("chrome://browser/content/extension-win-panel.css");
- }
- return stylesheets;
-});
-
-class BasePopup {
- constructor(extension, viewNode, popupURL, browserStyle, fixedWidth = false) {
- this.extension = extension;
- this.popupURL = popupURL;
- this.viewNode = viewNode;
- this.browserStyle = browserStyle;
- this.window = viewNode.ownerGlobal;
- this.destroyed = false;
- this.fixedWidth = fixedWidth;
-
- extension.callOnClose(this);
-
- this.contentReady = new Promise(resolve => {
- this._resolveContentReady = resolve;
- });
-
- this.viewNode.addEventListener(this.DESTROY_EVENT, this);
-
- let doc = viewNode.ownerDocument;
- let arrowContent = doc.getAnonymousElementByAttribute(this.panel, "class", "panel-arrowcontent");
- this.borderColor = doc.defaultView.getComputedStyle(arrowContent).borderTopColor;
-
- this.browser = null;
- this.browserLoaded = new Promise((resolve, reject) => {
- this.browserLoadedDeferred = {resolve, reject};
- });
- this.browserReady = this.createBrowser(viewNode, popupURL);
-
- BasePopup.instances.get(this.window).set(extension, this);
- }
-
- static for(extension, window) {
- return BasePopup.instances.get(window).get(extension);
- }
-
- close() {
- this.closePopup();
- }
-
- destroy() {
- this.extension.forgetOnClose(this);
-
- this.destroyed = true;
- this.browserLoadedDeferred.reject(new Error("Popup destroyed"));
- return this.browserReady.then(() => {
- this.destroyBrowser(this.browser);
- this.browser.remove();
-
- this.viewNode.removeEventListener(this.DESTROY_EVENT, this);
- this.viewNode.style.maxHeight = "";
-
- if (this.panel) {
- this.panel.style.removeProperty("--arrowpanel-background");
- this.panel.style.removeProperty("--panel-arrow-image-vertical");
- }
-
- BasePopup.instances.get(this.window).delete(this.extension);
-
- this.browser = null;
- this.viewNode = null;
- });
- }
-
- destroyBrowser(browser) {
- let mm = browser.messageManager;
- // If the browser has already been removed from the document, because the
- // popup was closed externally, there will be no message manager here.
- if (mm) {
- mm.removeMessageListener("DOMTitleChanged", this);
- mm.removeMessageListener("Extension:BrowserBackgroundChanged", this);
- mm.removeMessageListener("Extension:BrowserContentLoaded", this);
- mm.removeMessageListener("Extension:BrowserResized", this);
- mm.removeMessageListener("Extension:DOMWindowClose", this);
- }
- }
-
- // Returns the name of the event fired on `viewNode` when the popup is being
- // destroyed. This must be implemented by every subclass.
- get DESTROY_EVENT() {
- throw new Error("Not implemented");
- }
-
- get STYLESHEETS() {
- let sheets = [];
-
- if (this.browserStyle) {
- sheets.push(...popupStylesheets);
- }
- if (!this.fixedWidth) {
- sheets.push(...standaloneStylesheets);
- }
-
- return sheets;
- }
-
- get panel() {
- let panel = this.viewNode;
- while (panel && panel.localName != "panel") {
- panel = panel.parentNode;
- }
- return panel;
- }
-
- receiveMessage({name, data}) {
- switch (name) {
- case "DOMTitleChanged":
- this.viewNode.setAttribute("aria-label", this.browser.contentTitle);
- break;
-
- case "Extension:BrowserBackgroundChanged":
- this.setBackground(data.background);
- break;
-
- case "Extension:BrowserContentLoaded":
- this.browserLoadedDeferred.resolve();
- break;
-
- case "Extension:BrowserResized":
- this._resolveContentReady();
- if (this.ignoreResizes) {
- this.dimensions = data;
- } else {
- this.resizeBrowser(data);
- }
- break;
-
- case "Extension:DOMWindowClose":
- this.closePopup();
- break;
- }
- }
-
- handleEvent(event) {
- switch (event.type) {
- case this.DESTROY_EVENT:
- this.destroy();
- break;
- }
- }
-
- createBrowser(viewNode, popupURL = null) {
- let document = viewNode.ownerDocument;
- this.browser = document.createElementNS(XUL_NS, "browser");
- this.browser.setAttribute("type", "content");
- this.browser.setAttribute("disableglobalhistory", "true");
- this.browser.setAttribute("transparent", "true");
- this.browser.setAttribute("class", "webextension-popup-browser");
- this.browser.setAttribute("tooltip", "aHTMLTooltip");
-
- // We only need flex sizing for the sake of the slide-in sub-views of the
- // main menu panel, so that the browser occupies the full width of the view,
- // and also takes up any extra height that's available to it.
- this.browser.setAttribute("flex", "1");
-
- // Note: When using noautohide panels, the popup manager will add width and
- // height attributes to the panel, breaking our resize code, if the browser
- // starts out smaller than 30px by 10px. This isn't an issue now, but it
- // will be if and when we popup debugging.
-
- viewNode.appendChild(this.browser);
-
- extensions.emit("extension-browser-inserted", this.browser);
- let windowId = WindowManager.getId(this.browser.ownerGlobal);
- this.browser.messageManager.sendAsyncMessage("Extension:InitExtensionView", {
- viewType: "popup",
- windowId,
- });
- // TODO(robwu): Rework this to use the Extension:ExtensionViewLoaded message
- // to detect loads and so on. And definitely move this content logic inside
- // a file in the child process.
-
- let initBrowser = browser => {
- let mm = browser.messageManager;
- mm.addMessageListener("DOMTitleChanged", this);
- mm.addMessageListener("Extension:BrowserBackgroundChanged", this);
- mm.addMessageListener("Extension:BrowserContentLoaded", this);
- mm.addMessageListener("Extension:BrowserResized", this);
- mm.addMessageListener("Extension:DOMWindowClose", this, true);
- };
-
- if (!popupURL) {
- initBrowser(this.browser);
- return this.browser;
- }
-
- return promiseEvent(this.browser, "load").then(() => {
- initBrowser(this.browser);
-
- let mm = this.browser.messageManager;
-
- mm.loadFrameScript(
- "chrome://extensions/content/ext-browser-content.js", false);
-
- mm.sendAsyncMessage("Extension:InitBrowser", {
- allowScriptsToClose: true,
- fixedWidth: this.fixedWidth,
- maxWidth: 800,
- maxHeight: 600,
- stylesheets: this.STYLESHEETS,
- });
-
- this.browser.setAttribute("src", popupURL);
- });
- }
-
- resizeBrowser({width, height, detail}) {
- if (this.fixedWidth) {
- // Figure out how much extra space we have on the side of the panel
- // opposite the arrow.
- let side = this.panel.getAttribute("side") == "top" ? "bottom" : "top";
- let maxHeight = this.viewHeight + this.extraHeight[side];
-
- height = Math.min(height, maxHeight);
- this.browser.style.height = `${height}px`;
-
- // Set a maximum height on the <panelview> element to our preferred
- // maximum height, so that the PanelUI resizing code can make an accurate
- // calculation. If we don't do this, the flex sizing logic will prevent us
- // from ever reporting a preferred size smaller than the height currently
- // available to us in the panel.
- height = Math.max(height, this.viewHeight);
- this.viewNode.style.maxHeight = `${height}px`;
- } else {
- this.browser.style.width = `${width}px`;
- this.browser.style.height = `${height}px`;
- }
-
- let event = new this.window.CustomEvent("WebExtPopupResized", {detail});
- this.browser.dispatchEvent(event);
- }
-
- setBackground(background) {
- let panelBackground = "";
- let panelArrow = "";
-
- if (background) {
- let borderColor = this.borderColor || background;
-
- panelBackground = background;
- panelArrow = `url("data:image/svg+xml,${encodeURIComponent(`<?xml version="1.0" encoding="UTF-8"?>
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="10">
- <path d="M 0,10 L 10,0 20,10 z" fill="${borderColor}"/>
- <path d="M 1,10 L 10,1 19,10 z" fill="${background}"/>
- </svg>
- `)}")`;
- }
-
- this.panel.style.setProperty("--arrowpanel-background", panelBackground);
- this.panel.style.setProperty("--panel-arrow-image-vertical", panelArrow);
- this.background = background;
- }
-}
-
-/**
- * A map of active popups for a given browser window.
- *
- * WeakMap[window -> WeakMap[Extension -> BasePopup]]
- */
-BasePopup.instances = new DefaultWeakMap(() => new WeakMap());
-
-class PanelPopup extends BasePopup {
- constructor(extension, imageNode, popupURL, browserStyle) {
- let document = imageNode.ownerDocument;
-
- let panel = document.createElement("panel");
- panel.setAttribute("id", makeWidgetId(extension.id) + "-panel");
- panel.setAttribute("class", "browser-extension-panel");
- panel.setAttribute("tabspecific", "true");
- panel.setAttribute("type", "arrow");
- panel.setAttribute("role", "group");
-
- document.getElementById("mainPopupSet").appendChild(panel);
-
- super(extension, panel, popupURL, browserStyle);
-
- this.contentReady.then(() => {
- panel.openPopup(imageNode, "bottomcenter topright", 0, 0, false, false);
-
- let event = new this.window.CustomEvent("WebExtPopupLoaded", {
- bubbles: true,
- detail: {extension},
- });
- this.browser.dispatchEvent(event);
- });
- }
-
- get DESTROY_EVENT() {
- return "popuphidden";
- }
-
- destroy() {
- super.destroy();
- this.viewNode.remove();
- }
-
- closePopup() {
- promisePopupShown(this.viewNode).then(() => {
- // Make sure we're not already destroyed.
- if (this.viewNode) {
- this.viewNode.hidePopup();
- }
- });
- }
-}
-
-class ViewPopup extends BasePopup {
- constructor(extension, window, popupURL, browserStyle, fixedWidth) {
- let document = window.document;
-
- // Create a temporary panel to hold the browser while it pre-loads its
- // content. This panel will never be shown, but the browser's docShell will
- // be swapped with the browser in the real panel when it's ready.
- let panel = document.createElement("panel");
- panel.setAttribute("type", "arrow");
- document.getElementById("mainPopupSet").appendChild(panel);
-
- super(extension, panel, popupURL, browserStyle, fixedWidth);
-
- this.ignoreResizes = true;
-
- this.attached = false;
- this.tempPanel = panel;
-
- this.browser.classList.add("webextension-preload-browser");
- }
-
- /**
- * Attaches the pre-loaded browser to the given view node, and reserves a
- * promise which resolves when the browser is ready.
- *
- * @param {Element} viewNode
- * The node to attach the browser to.
- * @returns {Promise<boolean>}
- * Resolves when the browser is ready. Resolves to `false` if the
- * browser was destroyed before it was fully loaded, and the popup
- * should be closed, or `true` otherwise.
- */
- attach(viewNode) {
- return Task.spawn(function* () {
- this.viewNode = viewNode;
- this.viewNode.addEventListener(this.DESTROY_EVENT, this);
-
- // Wait until the browser element is fully initialized, and give it at least
- // a short grace period to finish loading its initial content, if necessary.
- //
- // In practice, the browser that was created by the mousdown handler should
- // nearly always be ready by this point.
- yield Promise.all([
- this.browserReady,
- Promise.race([
- // This promise may be rejected if the popup calls window.close()
- // before it has fully loaded.
- this.browserLoaded.catch(() => {}),
- new Promise(resolve => setTimeout(resolve, POPUP_LOAD_TIMEOUT_MS)),
- ]),
- ]);
-
- if (!this.destroyed && !this.panel) {
- this.destroy();
- }
-
- if (this.destroyed) {
- return false;
- }
-
- this.attached = true;
-
- // Store the initial height of the view, so that we never resize menu panel
- // sub-views smaller than the initial height of the menu.
- this.viewHeight = this.viewNode.boxObject.height;
-
- // Calculate the extra height available on the screen above and below the
- // menu panel. Use that to calculate the how much the sub-view may grow.
- let popupRect = this.panel.getBoundingClientRect();
-
- this.setBackground(this.background);
-
- let win = this.window;
- let popupBottom = win.mozInnerScreenY + popupRect.bottom;
- let popupTop = win.mozInnerScreenY + popupRect.top;
-
- let screenBottom = win.screen.availTop + win.screen.availHeight;
- this.extraHeight = {
- bottom: Math.max(0, screenBottom - popupBottom),
- top: Math.max(0, popupTop - win.screen.availTop),
- };
-
- // Create a new browser in the real popup.
- let browser = this.browser;
- this.createBrowser(this.viewNode);
-
- this.browser.swapDocShells(browser);
- this.destroyBrowser(browser);
-
- this.ignoreResizes = false;
- if (this.dimensions) {
- this.resizeBrowser(this.dimensions);
- }
-
- this.tempPanel.remove();
- this.tempPanel = null;
-
- let event = new this.window.CustomEvent("WebExtPopupLoaded", {
- bubbles: true,
- detail: {extension: this.extension},
- });
- this.browser.dispatchEvent(event);
-
- return true;
- }.bind(this));
- }
-
- destroy() {
- return super.destroy().then(() => {
- if (this.tempPanel) {
- this.tempPanel.remove();
- this.tempPanel = null;
- }
- });
- }
-
- get DESTROY_EVENT() {
- return "ViewHiding";
- }
-
- closePopup() {
- if (this.attached) {
- CustomizableUI.hidePanelForNode(this.viewNode);
- } else {
- this.destroy();
- }
- }
-}
-
-Object.assign(global, {PanelPopup, ViewPopup});
-
-// Manages tab-specific context data, and dispatching tab select events
-// across all windows.
-global.TabContext = function TabContext(getDefaults, extension) {
- this.extension = extension;
- this.getDefaults = getDefaults;
-
- this.tabData = new WeakMap();
- this.lastLocation = new WeakMap();
-
- AllWindowEvents.addListener("progress", this);
- AllWindowEvents.addListener("TabSelect", this);
-
- EventEmitter.decorate(this);
-};
-
-TabContext.prototype = {
- get(tab) {
- if (!this.tabData.has(tab)) {
- this.tabData.set(tab, this.getDefaults(tab));
- }
-
- return this.tabData.get(tab);
- },
-
- clear(tab) {
- this.tabData.delete(tab);
- },
-
- handleEvent(event) {
- if (event.type == "TabSelect") {
- let tab = event.target;
- this.emit("tab-select", tab);
- this.emit("location-change", tab);
- }
- },
-
- onStateChange(browser, webProgress, request, stateFlags, statusCode) {
- let flags = Ci.nsIWebProgressListener;
-
- if (!(~stateFlags & (flags.STATE_IS_WINDOW | flags.STATE_START) ||
- this.lastLocation.has(browser))) {
- this.lastLocation.set(browser, request.URI);
- }
- },
-
- onLocationChange(browser, webProgress, request, locationURI, flags) {
- let gBrowser = browser.ownerGlobal.gBrowser;
- let lastLocation = this.lastLocation.get(browser);
- if (browser === gBrowser.selectedBrowser &&
- !(lastLocation && lastLocation.equalsExceptRef(browser.currentURI))) {
- let tab = gBrowser.getTabForBrowser(browser);
- this.emit("location-change", tab, true);
- }
- this.lastLocation.set(browser, browser.currentURI);
- },
-
- shutdown() {
- AllWindowEvents.removeListener("progress", this);
- AllWindowEvents.removeListener("TabSelect", this);
- },
-};
-
-// Manages tab mappings and permissions for a specific extension.
-function ExtensionTabManager(extension) {
- this.extension = extension;
-
- // A mapping of tab objects to the inner window ID the extension currently has
- // the active tab permission for. The active permission for a given tab is
- // valid only for the inner window that was active when the permission was
- // granted. If the tab navigates, the inner window ID changes, and the
- // permission automatically becomes stale.
- //
- // WeakMap[tab => inner-window-id<int>]
- this.hasTabPermissionFor = new WeakMap();
-}
-
-ExtensionTabManager.prototype = {
- addActiveTabPermission(tab = TabManager.activeTab) {
- if (this.extension.hasPermission("activeTab")) {
- // Note that, unlike Chrome, we don't currently clear this permission with
- // the tab navigates. If the inner window is revived from BFCache before
- // we've granted this permission to a new inner window, the extension
- // maintains its permissions for it.
- this.hasTabPermissionFor.set(tab, tab.linkedBrowser.innerWindowID);
- }
- },
-
- revokeActiveTabPermission(tab = TabManager.activeTab) {
- this.hasTabPermissionFor.delete(tab);
- },
-
- // Returns true if the extension has the "activeTab" permission for this tab.
- // This is somewhat more permissive than the generic "tabs" permission, as
- // checked by |hasTabPermission|, in that it also allows programmatic script
- // injection without an explicit host permission.
- hasActiveTabPermission(tab) {
- // This check is redundant with addTabPermission, but cheap.
- if (this.extension.hasPermission("activeTab")) {
- return (this.hasTabPermissionFor.has(tab) &&
- this.hasTabPermissionFor.get(tab) === tab.linkedBrowser.innerWindowID);
- }
- return false;
- },
-
- hasTabPermission(tab) {
- return this.extension.hasPermission("tabs") || this.hasActiveTabPermission(tab);
- },
-
- convert(tab) {
- let window = tab.ownerGlobal;
- let browser = tab.linkedBrowser;
-
- let mutedInfo = {muted: tab.muted};
- if (tab.muteReason === null) {
- mutedInfo.reason = "user";
- } else if (tab.muteReason) {
- mutedInfo.reason = "extension";
- mutedInfo.extensionId = tab.muteReason;
- }
-
- let result = {
- id: TabManager.getId(tab),
- index: tab._tPos,
- windowId: WindowManager.getId(window),
- selected: tab.selected,
- highlighted: tab.selected,
- active: tab.selected,
- pinned: tab.pinned,
- status: TabManager.getStatus(tab),
- incognito: WindowManager.isBrowserPrivate(browser),
- width: browser.frameLoader.lazyWidth || browser.clientWidth,
- height: browser.frameLoader.lazyHeight || browser.clientHeight,
- audible: tab.soundPlaying,
- mutedInfo,
- };
- if (this.extension.hasPermission("cookies")) {
- result.cookieStoreId = getCookieStoreIdForTab(result, tab);
- }
-
- if (this.hasTabPermission(tab)) {
- result.url = browser.currentURI.spec;
- let title = browser.contentTitle || tab.label;
- if (title) {
- result.title = title;
- }
- let icon = window.gBrowser.getIcon(tab);
- if (icon) {
- result.favIconUrl = icon;
- }
- }
-
- return result;
- },
-
- // Converts tabs returned from SessionStore.getClosedTabData and
- // SessionStore.getClosedWindowData into API tab objects
- convertFromSessionStoreClosedData(tab, window) {
- let result = {
- sessionId: String(tab.closedId),
- index: tab.pos ? tab.pos : 0,
- windowId: WindowManager.getId(window),
- selected: false,
- highlighted: false,
- active: false,
- pinned: false,
- incognito: Boolean(tab.state && tab.state.isPrivate),
- };
-
- if (this.hasTabPermission(tab)) {
- let entries = tab.state ? tab.state.entries : tab.entries;
- result.url = entries[0].url;
- result.title = entries[0].title;
- if (tab.image) {
- result.favIconUrl = tab.image;
- }
- }
-
- return result;
- },
-
- getTabs(window) {
- return Array.from(window.gBrowser.tabs)
- .filter(tab => !tab.closing)
- .map(tab => this.convert(tab));
- },
-};
-
-// Sends the tab and windowId upon request. This is primarily used to support
-// the synchronous `browser.extension.getViews` API.
-let onGetTabAndWindowId = {
- receiveMessage({name, target, sync}) {
- let {gBrowser} = target.ownerGlobal;
- let tab = gBrowser && gBrowser.getTabForBrowser(target);
- if (tab) {
- let reply = {
- tabId: TabManager.getId(tab),
- windowId: WindowManager.getId(tab.ownerGlobal),
- };
- if (sync) {
- return reply;
- }
- target.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", reply);
- }
- },
-};
-/* eslint-disable mozilla/balanced-listeners */
-Services.mm.addMessageListener("Extension:GetTabAndWindowId", onGetTabAndWindowId);
-/* eslint-enable mozilla/balanced-listeners */
-
-
-// Manages global mappings between XUL tabs and extension tab IDs.
-global.TabManager = {
- _tabs: new WeakMap(),
- _nextId: 1,
- _initialized: false,
-
- // We begin listening for TabOpen and TabClose events once we've started
- // assigning IDs to tabs, so that we can remap the IDs of tabs which are moved
- // between windows.
- initListener() {
- if (this._initialized) {
- return;
- }
-
- AllWindowEvents.addListener("TabOpen", this);
- AllWindowEvents.addListener("TabClose", this);
- WindowListManager.addOpenListener(this.handleWindowOpen.bind(this));
-
- this._initialized = true;
- },
-
- handleEvent(event) {
- if (event.type == "TabOpen") {
- let {adoptedTab} = event.detail;
- if (adoptedTab) {
- // This tab is being created to adopt a tab from a different window.
- // Copy the ID from the old tab to the new.
- let tab = event.target;
- this._tabs.set(tab, this.getId(adoptedTab));
-
- tab.linkedBrowser.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", {
- windowId: WindowManager.getId(tab.ownerGlobal),
- });
- }
- } else if (event.type == "TabClose") {
- let {adoptedBy} = event.detail;
- if (adoptedBy) {
- // This tab is being closed because it was adopted by a new window.
- // Copy its ID to the new tab, in case it was created as the first tab
- // of a new window, and did not have an `adoptedTab` detail when it was
- // opened.
- this._tabs.set(adoptedBy, this.getId(event.target));
-
- adoptedBy.linkedBrowser.messageManager.sendAsyncMessage("Extension:SetTabAndWindowId", {
- windowId: WindowManager.getId(adoptedBy),
- });
- }
- }
- },
-
- handleWindowOpen(window) {
- if (window.arguments && window.arguments[0] instanceof window.XULElement) {
- // If the first window argument is a XUL element, it means the
- // window is about to adopt a tab from another window to replace its
- // initial tab.
- let adoptedTab = window.arguments[0];
-
- this._tabs.set(window.gBrowser.tabs[0], this.getId(adoptedTab));
- }
- },
-
- getId(tab) {
- if (this._tabs.has(tab)) {
- return this._tabs.get(tab);
- }
- this.initListener();
-
- let id = this._nextId++;
- this._tabs.set(tab, id);
- return id;
- },
-
- getBrowserId(browser) {
- let gBrowser = browser.ownerGlobal.gBrowser;
- // Some non-browser windows have gBrowser but not
- // getTabForBrowser!
- if (gBrowser && gBrowser.getTabForBrowser) {
- let tab = gBrowser.getTabForBrowser(browser);
- if (tab) {
- return this.getId(tab);
- }
- }
- return -1;
- },
-
- /**
- * Returns the XUL <tab> element associated with the given tab ID. If no tab
- * with the given ID exists, and no default value is provided, an error is
- * raised, belonging to the scope of the given context.
- *
- * @param {integer} tabId
- * The ID of the tab to retrieve.
- * @param {ExtensionContext} context
- * The context of the caller.
- * This value may be omitted if `default_` is not `undefined`.
- * @param {*} default_
- * The value to return if no tab exists with the given ID.
- * @returns {Element<tab>}
- * A XUL <tab> element.
- */
- getTab(tabId, context, default_ = undefined) {
- // FIXME: Speed this up without leaking memory somehow.
- for (let window of WindowListManager.browserWindows()) {
- if (!window.gBrowser) {
- continue;
- }
- for (let tab of window.gBrowser.tabs) {
- if (this.getId(tab) == tabId) {
- return tab;
- }
- }
- }
- if (default_ !== undefined) {
- return default_;
- }
- throw new context.cloneScope.Error(`Invalid tab ID: ${tabId}`);
- },
-
- get activeTab() {
- let window = WindowManager.topWindow;
- if (window && window.gBrowser) {
- return window.gBrowser.selectedTab;
- }
- return null;
- },
-
- getStatus(tab) {
- return tab.getAttribute("busy") == "true" ? "loading" : "complete";
- },
-
- convert(extension, tab) {
- return TabManager.for(extension).convert(tab);
- },
-};
-
-// WeakMap[Extension -> ExtensionTabManager]
-let tabManagers = new WeakMap();
-
-// Returns the extension-specific tab manager for the given extension, or
-// creates one if it doesn't already exist.
-TabManager.for = function(extension) {
- if (!tabManagers.has(extension)) {
- tabManagers.set(extension, new ExtensionTabManager(extension));
- }
- return tabManagers.get(extension);
-};
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("shutdown", (type, extension) => {
- tabManagers.delete(extension);
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-function memoize(fn) {
- let weakMap = new DefaultWeakMap(fn);
- return weakMap.get.bind(weakMap);
-}
-
-// Manages mapping between XUL windows and extension window IDs.
-global.WindowManager = {
- _windows: new WeakMap(),
- _nextId: 0,
-
- // Note: These must match the values in windows.json.
- WINDOW_ID_NONE: -1,
- WINDOW_ID_CURRENT: -2,
-
- get topWindow() {
- return Services.wm.getMostRecentWindow("navigator:browser");
- },
-
- windowType(window) {
- // TODO: Make this work.
-
- let {chromeFlags} = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIXULWindow);
-
- if (chromeFlags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) {
- return "popup";
- }
-
- return "normal";
- },
-
- updateGeometry(window, options) {
- if (options.left !== null || options.top !== null) {
- let left = options.left !== null ? options.left : window.screenX;
- let top = options.top !== null ? options.top : window.screenY;
- window.moveTo(left, top);
- }
-
- if (options.width !== null || options.height !== null) {
- let width = options.width !== null ? options.width : window.outerWidth;
- let height = options.height !== null ? options.height : window.outerHeight;
- window.resizeTo(width, height);
- }
- },
-
- isBrowserPrivate: memoize(browser => {
- return PrivateBrowsingUtils.isBrowserPrivate(browser);
- }),
-
- getId(window) {
- if (this._windows.has(window)) {
- return this._windows.get(window);
- }
- let id = this._nextId++;
- this._windows.set(window, id);
- return id;
- },
-
- getWindow(id, context) {
- if (id == this.WINDOW_ID_CURRENT) {
- return currentWindow(context);
- }
-
- for (let window of WindowListManager.browserWindows(true)) {
- if (this.getId(window) == id) {
- return window;
- }
- }
- return null;
- },
-
- getState(window) {
- const STATES = {
- [window.STATE_MAXIMIZED]: "maximized",
- [window.STATE_MINIMIZED]: "minimized",
- [window.STATE_NORMAL]: "normal",
- };
- let state = STATES[window.windowState];
- if (window.fullScreen) {
- state = "fullscreen";
- }
- return state;
- },
-
- setState(window, state) {
- if (state != "fullscreen" && window.fullScreen) {
- window.fullScreen = false;
- }
-
- switch (state) {
- case "maximized":
- window.maximize();
- break;
-
- case "minimized":
- case "docked":
- window.minimize();
- break;
-
- case "normal":
- // Restore sometimes returns the window to its previous state, rather
- // than to the "normal" state, so it may need to be called anywhere from
- // zero to two times.
- window.restore();
- if (window.windowState != window.STATE_NORMAL) {
- window.restore();
- }
- if (window.windowState != window.STATE_NORMAL) {
- // And on OS-X, where normal vs. maximized is basically a heuristic,
- // we need to cheat.
- window.sizeToContent();
- }
- break;
-
- case "fullscreen":
- window.fullScreen = true;
- break;
-
- default:
- throw new Error(`Unexpected window state: ${state}`);
- }
- },
-
- convert(extension, window, getInfo) {
- let xulWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .treeOwner.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIXULWindow);
-
- let result = {
- id: this.getId(window),
- focused: window.document.hasFocus(),
- top: window.screenY,
- left: window.screenX,
- width: window.outerWidth,
- height: window.outerHeight,
- incognito: PrivateBrowsingUtils.isWindowPrivate(window),
- type: this.windowType(window),
- state: this.getState(window),
- alwaysOnTop: xulWindow.zLevel >= Ci.nsIXULWindow.raisedZ,
- };
-
- if (getInfo && getInfo.populate) {
- result.tabs = TabManager.for(extension).getTabs(window);
- }
-
- return result;
- },
-
- // Converts windows returned from SessionStore.getClosedWindowData
- // into API window objects
- convertFromSessionStoreClosedData(window, extension) {
- let result = {
- sessionId: String(window.closedId),
- focused: false,
- incognito: false,
- type: "normal", // this is always "normal" for a closed window
- state: this.getState(window),
- alwaysOnTop: false,
- };
-
- if (window.tabs.length) {
- result.tabs = [];
- window.tabs.forEach((tab, index) => {
- result.tabs.push(TabManager.for(extension).convertFromSessionStoreClosedData(tab, window, index));
- });
- }
-
- return result;
- },
-};
-
-// Manages listeners for window opening and closing. A window is
-// considered open when the "load" event fires on it. A window is
-// closed when a "domwindowclosed" notification fires for it.
-global.WindowListManager = {
- _openListeners: new Set(),
- _closeListeners: new Set(),
-
- // Returns an iterator for all browser windows. Unless |includeIncomplete| is
- // true, only fully-loaded windows are returned.
- * browserWindows(includeIncomplete = false) {
- // The window type parameter is only available once the window's document
- // element has been created. This means that, when looking for incomplete
- // browser windows, we need to ignore the type entirely for windows which
- // haven't finished loading, since we would otherwise skip browser windows
- // in their early loading stages.
- // This is particularly important given that the "domwindowcreated" event
- // fires for browser windows when they're in that in-between state, and just
- // before we register our own "domwindowcreated" listener.
-
- let e = Services.wm.getEnumerator("");
- while (e.hasMoreElements()) {
- let window = e.getNext();
-
- let ok = includeIncomplete;
- if (window.document.readyState == "complete") {
- ok = window.document.documentElement.getAttribute("windowtype") == "navigator:browser";
- }
-
- if (ok) {
- yield window;
- }
- }
- },
-
- addOpenListener(listener) {
- if (this._openListeners.size == 0 && this._closeListeners.size == 0) {
- Services.ww.registerNotification(this);
- }
- this._openListeners.add(listener);
-
- for (let window of this.browserWindows(true)) {
- if (window.document.readyState != "complete") {
- window.addEventListener("load", this);
- }
- }
- },
-
- removeOpenListener(listener) {
- this._openListeners.delete(listener);
- if (this._openListeners.size == 0 && this._closeListeners.size == 0) {
- Services.ww.unregisterNotification(this);
- }
- },
-
- addCloseListener(listener) {
- if (this._openListeners.size == 0 && this._closeListeners.size == 0) {
- Services.ww.registerNotification(this);
- }
- this._closeListeners.add(listener);
- },
-
- removeCloseListener(listener) {
- this._closeListeners.delete(listener);
- if (this._openListeners.size == 0 && this._closeListeners.size == 0) {
- Services.ww.unregisterNotification(this);
- }
- },
-
- handleEvent(event) {
- event.currentTarget.removeEventListener(event.type, this);
- let window = event.target.defaultView;
- if (window.document.documentElement.getAttribute("windowtype") != "navigator:browser") {
- return;
- }
-
- for (let listener of this._openListeners) {
- listener(window);
- }
- },
-
- observe(window, topic, data) {
- if (topic == "domwindowclosed") {
- if (window.document.documentElement.getAttribute("windowtype") != "navigator:browser") {
- return;
- }
-
- window.removeEventListener("load", this);
- for (let listener of this._closeListeners) {
- listener(window);
- }
- } else {
- window.addEventListener("load", this);
- }
- },
-};
-
-// Provides a facility to listen for DOM events across all XUL windows.
-global.AllWindowEvents = {
- _listeners: new Map(),
-
- // If |type| is a normal event type, invoke |listener| each time
- // that event fires in any open window. If |type| is "progress", add
- // a web progress listener that covers all open windows.
- addListener(type, listener) {
- if (type == "domwindowopened") {
- return WindowListManager.addOpenListener(listener);
- } else if (type == "domwindowclosed") {
- return WindowListManager.addCloseListener(listener);
- }
-
- if (this._listeners.size == 0) {
- WindowListManager.addOpenListener(this.openListener);
- }
-
- if (!this._listeners.has(type)) {
- this._listeners.set(type, new Set());
- }
- let list = this._listeners.get(type);
- list.add(listener);
-
- // Register listener on all existing windows.
- for (let window of WindowListManager.browserWindows()) {
- this.addWindowListener(window, type, listener);
- }
- },
-
- removeListener(eventType, listener) {
- if (eventType == "domwindowopened") {
- return WindowListManager.removeOpenListener(listener);
- } else if (eventType == "domwindowclosed") {
- return WindowListManager.removeCloseListener(listener);
- }
-
- let listeners = this._listeners.get(eventType);
- listeners.delete(listener);
- if (listeners.size == 0) {
- this._listeners.delete(eventType);
- if (this._listeners.size == 0) {
- WindowListManager.removeOpenListener(this.openListener);
- }
- }
-
- // Unregister listener from all existing windows.
- let useCapture = eventType === "focus" || eventType === "blur";
- for (let window of WindowListManager.browserWindows()) {
- if (eventType == "progress") {
- window.gBrowser.removeTabsProgressListener(listener);
- } else {
- window.removeEventListener(eventType, listener, useCapture);
- }
- }
- },
-
- /* eslint-disable mozilla/balanced-listeners */
- addWindowListener(window, eventType, listener) {
- let useCapture = eventType === "focus" || eventType === "blur";
-
- if (eventType == "progress") {
- window.gBrowser.addTabsProgressListener(listener);
- } else {
- window.addEventListener(eventType, listener, useCapture);
- }
- },
- /* eslint-enable mozilla/balanced-listeners */
-
- // Runs whenever the "load" event fires for a new window.
- openListener(window) {
- for (let [eventType, listeners] of AllWindowEvents._listeners) {
- for (let listener of listeners) {
- this.addWindowListener(window, eventType, listener);
- }
- }
- },
-};
-
-AllWindowEvents.openListener = AllWindowEvents.openListener.bind(AllWindowEvents);
-
-// Subclass of EventManager where we just need to call
-// add/removeEventListener on each XUL window.
-global.WindowEventManager = function(context, name, event, listener) {
- EventManager.call(this, context, name, fire => {
- let listener2 = (...args) => listener(fire, ...args);
- AllWindowEvents.addListener(event, listener2);
- return () => {
- AllWindowEvents.removeListener(event, listener2);
- };
- });
-};
-
-WindowEventManager.prototype = Object.create(EventManager.prototype);
diff --git a/application/basilisk/components/webextensions/ext-windows.js b/application/basilisk/components/webextensions/ext-windows.js
deleted file mode 100644
index 5956ae15bd..0000000000
--- a/application/basilisk/components/webextensions/ext-windows.js
+++ /dev/null
@@ -1,231 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
- "@mozilla.org/browser/aboutnewtab-service;1",
- "nsIAboutNewTabService");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- EventManager,
- promiseObserved,
-} = ExtensionUtils;
-
-function onXULFrameLoaderCreated({target}) {
- target.messageManager.sendAsyncMessage("AllowScriptsToClose", {});
-}
-
-extensions.registerSchemaAPI("windows", "addon_parent", context => {
- let {extension} = context;
- return {
- windows: {
- onCreated:
- new WindowEventManager(context, "windows.onCreated", "domwindowopened", (fire, window) => {
- fire(WindowManager.convert(extension, window));
- }).api(),
-
- onRemoved:
- new WindowEventManager(context, "windows.onRemoved", "domwindowclosed", (fire, window) => {
- fire(WindowManager.getId(window));
- }).api(),
-
- onFocusChanged: new EventManager(context, "windows.onFocusChanged", fire => {
- // Keep track of the last windowId used to fire an onFocusChanged event
- let lastOnFocusChangedWindowId;
-
- let listener = event => {
- // Wait a tick to avoid firing a superfluous WINDOW_ID_NONE
- // event when switching focus between two Firefox windows.
- Promise.resolve().then(() => {
- let window = Services.focus.activeWindow;
- let windowId = window ? WindowManager.getId(window) : WindowManager.WINDOW_ID_NONE;
- if (windowId !== lastOnFocusChangedWindowId) {
- fire(windowId);
- lastOnFocusChangedWindowId = windowId;
- }
- });
- };
- AllWindowEvents.addListener("focus", listener);
- AllWindowEvents.addListener("blur", listener);
- return () => {
- AllWindowEvents.removeListener("focus", listener);
- AllWindowEvents.removeListener("blur", listener);
- };
- }).api(),
-
- get: function(windowId, getInfo) {
- let window = WindowManager.getWindow(windowId, context);
- return Promise.resolve(WindowManager.convert(extension, window, getInfo));
- },
-
- getCurrent: function(getInfo) {
- let window = currentWindow(context);
- return Promise.resolve(WindowManager.convert(extension, window, getInfo));
- },
-
- getLastFocused: function(getInfo) {
- let window = WindowManager.topWindow;
- return Promise.resolve(WindowManager.convert(extension, window, getInfo));
- },
-
- getAll: function(getInfo) {
- let windows = Array.from(WindowListManager.browserWindows(),
- window => WindowManager.convert(extension, window, getInfo));
- return Promise.resolve(windows);
- },
-
- create: function(createData) {
- let needResize = (createData.left !== null || createData.top !== null ||
- createData.width !== null || createData.height !== null);
-
- if (needResize) {
- if (createData.state !== null && createData.state != "normal") {
- return Promise.reject({message: `"state": "${createData.state}" may not be combined with "left", "top", "width", or "height"`});
- }
- createData.state = "normal";
- }
-
- function mkstr(s) {
- let result = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
- result.data = s;
- return result;
- }
-
- let args = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
-
- if (createData.tabId !== null) {
- if (createData.url !== null) {
- return Promise.reject({message: "`tabId` may not be used in conjunction with `url`"});
- }
-
- if (createData.allowScriptsToClose) {
- return Promise.reject({message: "`tabId` may not be used in conjunction with `allowScriptsToClose`"});
- }
-
- let tab = TabManager.getTab(createData.tabId, context);
-
- // Private browsing tabs can only be moved to private browsing
- // windows.
- let incognito = PrivateBrowsingUtils.isBrowserPrivate(tab.linkedBrowser);
- if (createData.incognito !== null && createData.incognito != incognito) {
- return Promise.reject({message: "`incognito` property must match the incognito state of tab"});
- }
- createData.incognito = incognito;
-
- args.appendElement(tab, /* weak = */ false);
- } else if (createData.url !== null) {
- if (Array.isArray(createData.url)) {
- let array = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
- for (let url of createData.url) {
- array.appendElement(mkstr(url), /* weak = */ false);
- }
- args.appendElement(array, /* weak = */ false);
- } else {
- args.appendElement(mkstr(createData.url), /* weak = */ false);
- }
- } else {
- args.appendElement(mkstr(aboutNewTabService.newTabURL), /* weak = */ false);
- }
-
- let features = ["chrome"];
-
- if (createData.type === null || createData.type == "normal") {
- features.push("dialog=no", "all");
- } else {
- // All other types create "popup"-type windows by default.
- features.push("dialog", "resizable", "minimizable", "centerscreen", "titlebar", "close");
- }
-
- if (createData.incognito !== null) {
- if (createData.incognito) {
- features.push("private");
- } else {
- features.push("non-private");
- }
- }
-
- let {allowScriptsToClose, url} = createData;
- if (allowScriptsToClose === null) {
- allowScriptsToClose = typeof url === "string" && url.startsWith("moz-extension://");
- }
-
- let window = Services.ww.openWindow(null, "chrome://browser/content/browser.xul", "_blank",
- features.join(","), args);
-
- WindowManager.updateGeometry(window, createData);
-
- // TODO: focused, type
-
- return new Promise(resolve => {
- window.addEventListener("load", function listener() {
- window.removeEventListener("load", listener);
- if (["maximized", "normal"].includes(createData.state)) {
- window.document.documentElement.setAttribute("sizemode", createData.state);
- }
- resolve(promiseObserved("browser-delayed-startup-finished", win => win == window));
- });
- }).then(() => {
- // Some states only work after delayed-startup-finished
- if (["minimized", "fullscreen", "docked"].includes(createData.state)) {
- WindowManager.setState(window, createData.state);
- }
- if (allowScriptsToClose) {
- for (let {linkedBrowser} of window.gBrowser.tabs) {
- onXULFrameLoaderCreated({target: linkedBrowser});
- linkedBrowser.addEventListener( // eslint-disable-line mozilla/balanced-listeners
- "XULFrameLoaderCreated", onXULFrameLoaderCreated);
- }
- }
- return WindowManager.convert(extension, window, {populate: true});
- });
- },
-
- update: function(windowId, updateInfo) {
- if (updateInfo.state !== null && updateInfo.state != "normal") {
- if (updateInfo.left !== null || updateInfo.top !== null ||
- updateInfo.width !== null || updateInfo.height !== null) {
- return Promise.reject({message: `"state": "${updateInfo.state}" may not be combined with "left", "top", "width", or "height"`});
- }
- }
-
- let window = WindowManager.getWindow(windowId, context);
- if (updateInfo.focused) {
- Services.focus.activeWindow = window;
- }
-
- if (updateInfo.state !== null) {
- WindowManager.setState(window, updateInfo.state);
- }
-
- if (updateInfo.drawAttention) {
- // Bug 1257497 - Firefox can't cancel attention actions.
- window.getAttention();
- }
-
- WindowManager.updateGeometry(window, updateInfo);
-
- // TODO: All the other properties, focused=false...
-
- return Promise.resolve(WindowManager.convert(extension, window));
- },
-
- remove: function(windowId) {
- let window = WindowManager.getWindow(windowId, context);
- window.close();
-
- return new Promise(resolve => {
- let listener = () => {
- AllWindowEvents.removeListener("domwindowclosed", listener);
- resolve();
- };
- AllWindowEvents.addListener("domwindowclosed", listener);
- });
- },
- },
- };
-});
diff --git a/application/basilisk/components/webextensions/extension-mac-panel.css b/application/basilisk/components/webextensions/extension-mac-panel.css
deleted file mode 100644
index 2e9ed6bdbc..0000000000
--- a/application/basilisk/components/webextensions/extension-mac-panel.css
+++ /dev/null
@@ -1,3 +0,0 @@
-body {
- border-radius: 3.5px;
-}
diff --git a/application/basilisk/components/webextensions/extension-mac.css b/application/basilisk/components/webextensions/extension-mac.css
deleted file mode 100644
index 49cd3b359b..0000000000
--- a/application/basilisk/components/webextensions/extension-mac.css
+++ /dev/null
@@ -1,11 +0,0 @@
-button,
-select,
-input[type="checkbox"] + label::before {
- border-radius: 4px;
-}
-
-.panel-section-footer {
- border-bottom-left-radius: 4px;
- border-bottom-right-radius: 4px;
- overflow: hidden;
-}
diff --git a/application/basilisk/components/webextensions/extension-win-panel.css b/application/basilisk/components/webextensions/extension-win-panel.css
deleted file mode 100644
index 9da6da14cc..0000000000
--- a/application/basilisk/components/webextensions/extension-win-panel.css
+++ /dev/null
@@ -1,5 +0,0 @@
-@media (-moz-os-version: windows-win7) {
- body {
- border-radius: 4px;
- }
-}
diff --git a/application/basilisk/components/webextensions/extension.css b/application/basilisk/components/webextensions/extension.css
deleted file mode 100644
index 6b59033e31..0000000000
--- a/application/basilisk/components/webextensions/extension.css
+++ /dev/null
@@ -1,572 +0,0 @@
-/* stylelint-disable property-no-vendor-prefix */
-/* stylelint-disable property-no-vendor-prefix */
-/* Base */
-button,
-select,
-option,
-input {
- -moz-appearance: none;
-}
-
-/* Variables */
-html,
-body {
- background: transparent;
- box-sizing: border-box;
- color: #222426;
- cursor: default;
- display: flex;
- flex-direction: column;
- font: caption;
- margin: 0;
- padding: 0;
- -moz-user-select: none;
-}
-
-body * {
- box-sizing: border-box;
- text-align: start;
-}
-
-/* stylelint-disable property-no-vendor-prefix */
-/* Buttons */
-button,
-select {
- background-color: #fbfbfb;
- border: 1px solid #b1b1b1;
- box-shadow: 0 0 0 0 transparent;
- font: caption;
- height: 24px;
- outline: 0 !important;
- padding: 0 8px 0;
- transition-duration: 250ms;
- transition-property: box-shadow, border;
-}
-
-select {
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==);
- background-position: calc(100% - 4px) center;
- background-repeat: no-repeat;
- padding-inline-end: 24px;
- text-overflow: ellipsis;
-}
-
-label {
- font: caption;
-}
-
-button::-moz-focus-inner {
- border: 0;
- outline: 0;
-}
-
-/* Dropdowns */
-select {
- background-color: #fbfbfb;
- border: 1px solid #b1b1b1;
- box-shadow: 0 0 0 0 transparent;
- font: caption;
- height: 24px;
- outline: 0 !important;
- padding: 0 8px 0;
- transition-duration: 250ms;
- transition-property: box-shadow, border;
-}
-
-select {
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==);
- background-position: calc(100% - 4px) center;
- background-repeat: no-repeat;
- padding-inline-end: 24px;
- text-overflow: ellipsis;
-}
-
-select:-moz-focusring {
- color: transparent;
- text-shadow: 0 0 0 #000;
-}
-
-select:-moz-focusring * {
- color: #000;
- text-shadow: none;
-}
-
-button.hover,
-select.hover {
- background-color: #ebebeb;
- border: 1px solid #b1b1b1;
-}
-
-button.pressed,
-select.pressed {
- background-color: #d4d4d4;
- border: 1px solid #858585;
-}
-
-button.disabled,
-select.disabled {
- color: #999;
- opacity: .5;
-}
-
-button.focused,
-select.focused {
- border-color: #fff;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-button.default {
- background-color: #0996f8;
- border-color: #0670cc;
- color: #fff;
-}
-
-button.default.hover {
- background-color: #0670cc;
- border-color: #005bab;
-}
-
-button.default.pressed {
- background-color: #005bab;
- border-color: #004480;
-}
-
-button.default.focused {
- border-color: #fff;
-}
-
-/* Radio Buttons */
-.radioItem {
- margin-bottom: 6px;
- text-align: left;
-}
-
-input[type="radio"] {
- display: none;
-}
-
-input[type="radio"] + label {
- -moz-user-select: none;
-}
-
-input[type="radio"] + label::before {
- background-color: #fff;
- background-position: center;
- border: 1px solid #b1b1b1;
- border-radius: 50%;
- content: "";
- display: inline-block;
- height: 16px;
- margin-right: 6px;
- vertical-align: text-top;
- width: 16px;
-}
-
-input[type="radio"]:hover + label::before,
-.radioItem.hover input[type="radio"]:not(active) + label::before {
- background-color: #fbfbfb;
- border-color: #b1b1b1;
-}
-
-input[type="radio"]:hover:active + label::before,
-.radioItem.pressed input[type="radio"]:not(active) + label::before {
- background-color: #ebebeb;
- border-color: #858585;
-}
-
-input[type="radio"]:checked + label::before {
- background-color: #0996f8;
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8Y2lyY2xlIGN4PSI4IiBjeT0iOCIgcj0iNCIgZmlsbD0iI2ZmZiIgLz4KPC9zdmc+Cg==);
- border-color: #0670cc;
-}
-
-input[type="radio"]:checked:hover + label::before,
-.radioItem.hover input[type="radio"]:checked:not(active) + label::before {
- background-color: #0670cc;
- border-color: #005bab;
-}
-
-input[type="radio"]:checked:hover:active + label::before,
-.radioItem.pressed input[type="radio"]:checked:not(active) + label::before {
- background-color: #005bab;
- border-color: #004480;
-}
-
-.radioItem.disabled input[type="radio"] + label,
-.radioItem.disabled input[type="radio"]:hover + label,
-.radioItem.disabled input[type="radio"]:hover:active + label {
- color: #999;
- opacity: .5;
-}
-
-.radioItem.focused input[type="radio"] + label::before {
- border-color: #0996f8;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-.radioItem.focused input[type="radio"]:checked + label::before {
- border-color: #fff;
-}
-
-/* Checkboxes */
-.checkboxItem {
- margin-bottom: 6px;
- text-align: left;
-}
-
-input[type="checkbox"] {
- display: none;
-}
-
-input[type="checkbox"] + label {
- -moz-user-select: none;
-}
-
-input[type="checkbox"] + label::before {
- background-color: #fff;
- background-position: center;
- border: 1px solid #b1b1b1;
- content: "";
- display: inline-block;
- height: 16px;
- margin-right: 6px;
- vertical-align: text-top;
- width: 16px;
-}
-
-input[type="checkbox"]:hover + label::before,
-.checkboxItem.hover input[type="checkbox"]:not(active) + label::before {
- background-color: #fbfbfb;
- border-color: #b1b1b1;
-}
-
-input[type="checkbox"]:hover:active + label::before,
-.checkboxItem.pressed input[type="checkbox"]:not(active) + label::before {
- background-color: #ebebeb;
- border-color: #858585;
-}
-
-input[type="checkbox"]:checked + label::before {
- background-color: #0996f8;
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNNy43LDEyLjkgQzcuNCwxMy4zIDYuOCwxMy40IDYuNCwxMyBMMy4yLDkuOCBDMi44LDkuNCAyLjgsOC42IDMuMiw4LjIgQzMuNiw3LjggNC40LDcuOCA0LjgsOC4yIEw2LjksMTAuMyBMMTEuMSw0LjQgQzExLjUsMy45IDEyLjIsMy44IDEyLjcsNC4xIEMxMy4yLDQuNSAxMy4zLDUuMiAxMyw1LjcgTDcuNywxMi45IEw3LjcsMTIuOSBaIiBmaWxsPSIjZmZmIiAvPgo8L3N2Zz4K);
- border-color: #0670cc;
-}
-
-input[type="checkbox"]:checked:hover + label::before,
-.checkboxItem.hover input[type="checkbox"]:checked:not(active) + label::before {
- background-color: #0670cc;
- border-color: #005bab;
-}
-
-input[type="checkbox"]:checked:hover:active + label::before,
-.checkboxItem.pressed input[type="checkbox"]:checked:not(active) + label::before {
- background-color: #005bab;
- border-color: #004480;
-}
-
-.checkboxItem.disabled input[type="checkbox"] + label,
-.checkboxItem.disabled input[type="checkbox"]:hover + label,
-.checkboxItem.disabled input[type="checkbox"]:hover:active + label {
- color: #999;
- opacity: .5;
-}
-
-.checkboxItem.focused input[type="checkbox"] + label::before {
- border-color: #0996f8;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-.checkboxItem.focused input[type="checkbox"]:checked + label::before {
- border-color: #fff;
-}
-
-/* Expander Button */
-button.expander {
- background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2Ij4KICA8cGF0aCBkPSJNOCwxMkwzLDcsNCw2bDQsNCw0LTQsMSwxWiIgZmlsbD0iIzZBNkE2QSIgLz4KPC9zdmc+Cg==);
- background-position: center;
- background-repeat: no-repeat;
- height: 24px;
- padding: 0;
- width: 24px;
-}
-
-/* Interactive States */
-button:hover:not(.pressed):not(.disabled):not(.focused),
-select:hover:not(.pressed):not(.disabled):not(.focused) {
- background-color: #ebebeb;
- border: 1px solid #b1b1b1;
-}
-
-button:hover:active:not(.hover):not(.disabled):not(.focused),
-select:hover:active:not(.hover):not(.disabled):not(.focused) {
- background-color: #d4d4d4;
- border: 1px solid #858585;
-}
-
-button.default:hover:not(.pressed):not(.disabled):not(.focused) {
- background-color: #0670cc;
- border-color: #005bab;
-}
-
-button.default:hover:active:not(.hover):not(.disabled):not(.focused) {
- background-color: #005bab;
- border-color: #004480;
-}
-
-button:focus:not(.disabled) {
- border-color: #fff !important;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-/* Fields */
-input[type="text"],
-textarea {
- background-color: #fff;
- border: 1px solid #b1b1b1;
- box-shadow: 0 0 0 0 rgba(97, 181, 255, 0);
- font: caption;
- padding: 0 6px 0;
- transition-duration: 250ms;
- transition-property: box-shadow;
-}
-
-input[type="text"] {
- height: 24px;
-}
-
-input[type="text"].hover,
-textarea.hover {
- border: 1px solid #858585;
-}
-
-input[type="text"].disabled,
-textarea.disabled {
- color: #999;
- opacity: .5;
-}
-
-input[type="text"].focused,
-textarea.focused {
- border-color: #0996f8;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-/* Interactive States */
-input[type="text"]:not(disabled):hover,
-textarea:not(disabled):hover {
- border: 1px solid #858585;
-}
-
-input[type="text"]:focus,
-input[type="text"]:focus:hover,
-textarea:focus,
-textarea:focus:hover {
- border-color: #0996f8;
- box-shadow: 0 0 0 2px rgba(97, 181, 255, 0.75);
-}
-
-/* stylelint-disable property-no-vendor-prefix */
-.panel-section {
- display: flex;
- flex-direction: row;
-}
-
-.panel-section-separator {
- background-color: rgba(0, 0, 0, 0.15);
- min-height: 1px;
-}
-
-/* Panel Section - Header */
-.panel-section-header {
- border-bottom: 1px solid rgba(0, 0, 0, 0.15);
- padding: 16px;
-}
-
-.panel-section-header > .icon-section-header {
- background-position: center center;
- background-repeat: no-repeat;
- height: 32px;
- margin-right: 16px;
- position: relative;
- width: 32px;
-}
-
-.panel-section-header > .text-section-header {
- align-self: center;
- font-size: 1.385em;
- font-weight: lighter;
-}
-
-/* Panel Section - List */
-.panel-section-list {
- flex-direction: column;
- padding: 4px 0;
-}
-
-.panel-list-item {
- align-items: center;
- display: flex;
- flex-direction: row;
- height: 24px;
- padding: 0 16px;
-}
-
-.panel-list-item:not(.disabled):hover {
- background-color: rgba(0, 0, 0, 0.06);
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
- border-top: 1px solid rgba(0, 0, 0, 0.1);
-}
-
-.panel-list-item:not(.disabled):hover:active {
- background-color: rgba(0, 0, 0, 0.1);
-}
-
-.panel-list-item.disabled {
- color: #999;
-}
-
-.panel-list-item > .icon {
- flex-grow: 0;
- flex-shrink: 0;
-}
-
-.panel-list-item > .text {
- flex-grow: 10;
-}
-
-.panel-list-item > .text-shortcut {
- color: #808080;
- font-family: "Lucida Grande", caption;
- font-size: .847em;
- justify-content: flex-end;
-}
-
-.panel-section-list .panel-section-separator {
- margin: 4px 0;
-}
-
-/* Panel Section - Form Elements */
-.panel-section-formElements {
- display: flex;
- flex-direction: column;
- padding: 16px;
-}
-
-.panel-formElements-item {
- align-items: center;
- display: flex;
- flex-direction: row;
- margin-bottom: 12px;
-}
-
-.panel-formElements-item:last-child {
- margin-bottom: 0;
-}
-
-.panel-formElements-item label {
- flex-shrink: 0;
- margin-right: 6px;
- text-align: right;
-}
-
-.panel-formElements-item input[type="text"],
-.panel-formElements-item select {
- flex-grow: 1;
-}
-
-/* Panel Section - Footer */
-.panel-section-footer {
- background-color: rgba(0, 0, 0, 0.06);
- border-top: 1px solid rgba(0, 0, 0, 0.15);
- color: #1a1a1a;
- display: flex;
- flex-direction: row;
- height: 41px;
- margin-top: -1px;
- padding: 0;
-}
-
-.panel-section-footer-button {
- flex: 1 1 auto;
- height: 100%;
- margin: 0 -1px;
- padding: 12px;
- text-align: center;
-}
-
-.panel-section-footer-button > .text-shortcut {
- color: #808080;
- font-family: "Lucida Grande", caption;
- font-size: .847em;
-}
-
-.panel-section-footer-button:hover {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-.panel-section-footer-button:hover:active {
- background-color: rgba(0, 0, 0, 0.1);
-}
-
-.panel-section-footer-button.default {
- background-color: #0996f8;
- box-shadow: 0 1px 0 #0670cc inset;
- color: #fff;
-}
-
-.panel-section-footer-button.default:hover {
- background-color: #0670cc;
- box-shadow: 0 1px 0 #005bab inset;
-}
-
-.panel-section-footer-button.default:hover:active {
- background-color: #005bab;
- box-shadow: 0 1px 0 #004480 inset;
-}
-
-.panel-section-footer-separator {
- background-color: rgba(0, 0, 0, 0.1);
- width: 1px;
- z-index: 99;
-}
-
-/* Panel Section - Tabs */
-.panel-section-tabs {
- color: #1a1a1a;
- display: flex;
- flex-direction: row;
- height: 41px;
- margin-bottom: -1px;
- padding: 0;
-}
-
-.panel-section-tabs-button {
- flex: 1 1 auto;
- height: 100%;
- margin: 0 -1px;
- padding: 12px;
- text-align: center;
-}
-
-.panel-section-tabs-button:hover {
- background-color: rgba(0, 0, 0, 0.06);
-}
-
-.panel-section-tabs-button:hover:active {
- background-color: rgba(0, 0, 0, 0.1);
-}
-
-.panel-section-tabs-button.selected {
- box-shadow: 0 -1px 0 #0670cc inset, 0 -4px 0 #0996f8 inset;
- color: #0996f8;
-}
-
-.panel-section-tabs-button.selected:hover {
- color: #0670cc;
-}
-
-.panel-section-tabs-separator {
- background-color: rgba(0, 0, 0, 0.1);
- width: 1px;
- z-index: 99;
-}
diff --git a/application/basilisk/components/webextensions/extension.svg b/application/basilisk/components/webextensions/extension.svg
deleted file mode 100644
index a164552538..0000000000
--- a/application/basilisk/components/webextensions/extension.svg
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
- width="64" height="64" viewBox="0 0 64 64">
- <defs>
- <style>
- .style-puzzle-piece {
- fill: url('#gradient-linear-puzzle-piece');
- }
- </style>
- <linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
- <stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
- <stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
- </linearGradient>
- </defs>
- <path class="style-puzzle-piece" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
-</svg>
diff --git a/application/basilisk/components/webextensions/extensions-browser.manifest b/application/basilisk/components/webextensions/extensions-browser.manifest
deleted file mode 100644
index ed5cca8133..0000000000
--- a/application/basilisk/components/webextensions/extensions-browser.manifest
+++ /dev/null
@@ -1,31 +0,0 @@
-# scripts
-category webextension-scripts bookmarks chrome://browser/content/ext-bookmarks.js
-category webextension-scripts browserAction chrome://browser/content/ext-browserAction.js
-category webextension-scripts commands chrome://browser/content/ext-commands.js
-category webextension-scripts contextMenus chrome://browser/content/ext-contextMenus.js
-category webextension-scripts desktop-runtime chrome://browser/content/ext-desktop-runtime.js
-category webextension-scripts history chrome://browser/content/ext-history.js
-category webextension-scripts omnibox chrome://browser/content/ext-omnibox.js
-category webextension-scripts pageAction chrome://browser/content/ext-pageAction.js
-category webextension-scripts sessions chrome://browser/content/ext-sessions.js
-category webextension-scripts tabs chrome://browser/content/ext-tabs.js
-category webextension-scripts utils chrome://browser/content/ext-utils.js
-category webextension-scripts windows chrome://browser/content/ext-windows.js
-
-# scripts that must run in the same process as addon code.
-category webextension-scripts-addon contextMenus chrome://browser/content/ext-c-contextMenus.js
-category webextension-scripts-addon omnibox chrome://browser/content/ext-c-omnibox.js
-category webextension-scripts-addon tabs chrome://browser/content/ext-c-tabs.js
-
-# schemas
-category webextension-schemas bookmarks chrome://browser/content/schemas/bookmarks.json
-category webextension-schemas browser_action chrome://browser/content/schemas/browser_action.json
-category webextension-schemas commands chrome://browser/content/schemas/commands.json
-category webextension-schemas context_menus chrome://browser/content/schemas/context_menus.json
-category webextension-schemas context_menus_internal chrome://browser/content/schemas/context_menus_internal.json
-category webextension-schemas history chrome://browser/content/schemas/history.json
-category webextension-schemas omnibox chrome://browser/content/schemas/omnibox.json
-category webextension-schemas page_action chrome://browser/content/schemas/page_action.json
-category webextension-schemas sessions chrome://browser/content/schemas/sessions.json
-category webextension-schemas tabs chrome://browser/content/schemas/tabs.json
-category webextension-schemas windows chrome://browser/content/schemas/windows.json
diff --git a/application/basilisk/components/webextensions/jar.mn b/application/basilisk/components/webextensions/jar.mn
deleted file mode 100644
index a7b506ec4e..0000000000
--- a/application/basilisk/components/webextensions/jar.mn
+++ /dev/null
@@ -1,29 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-browser.jar:
- content/browser/extension.css
-#ifdef XP_MACOSX
- content/browser/extension-mac.css
- content/browser/extension-mac-panel.css
-#endif
-#ifdef XP_WIN
- content/browser/extension-win-panel.css
-#endif
- content/browser/extension.svg
- content/browser/ext-bookmarks.js
- content/browser/ext-browserAction.js
- content/browser/ext-commands.js
- content/browser/ext-contextMenus.js
- content/browser/ext-desktop-runtime.js
- content/browser/ext-history.js
- content/browser/ext-omnibox.js
- content/browser/ext-pageAction.js
- content/browser/ext-sessions.js
- content/browser/ext-tabs.js
- content/browser/ext-utils.js
- content/browser/ext-windows.js
- content/browser/ext-c-contextMenus.js
- content/browser/ext-c-omnibox.js
- content/browser/ext-c-tabs.js
diff --git a/application/basilisk/components/webextensions/moz.build b/application/basilisk/components/webextensions/moz.build
deleted file mode 100644
index 116e904158..0000000000
--- a/application/basilisk/components/webextensions/moz.build
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JAR_MANIFESTS += ['jar.mn']
-
-EXTRA_COMPONENTS += [
- 'extensions-browser.manifest',
-]
-
-DIRS += ['schemas']
-
diff --git a/application/basilisk/components/webextensions/schemas/LICENSE b/application/basilisk/components/webextensions/schemas/LICENSE
deleted file mode 100644
index 9314092fdc..0000000000
--- a/application/basilisk/components/webextensions/schemas/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/application/basilisk/components/webextensions/schemas/bookmarks.json b/application/basilisk/components/webextensions/schemas/bookmarks.json
deleted file mode 100644
index fb74c633e3..0000000000
--- a/application/basilisk/components/webextensions/schemas/bookmarks.json
+++ /dev/null
@@ -1,568 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "bookmarks"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "bookmarks",
- "description": "Use the <code>browser.bookmarks</code> API to create, organize, and otherwise manipulate bookmarks. Also see $(topic:override)[Override Pages], which you can use to create a custom Bookmark Manager page.",
- "permissions": ["bookmarks"],
- "types": [
- {
- "id": "BookmarkTreeNodeUnmodifiable",
- "type": "string",
- "enum": ["managed"],
- "description": "Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."
- },
- {
- "id": "BookmarkTreeNode",
- "type": "object",
- "description": "A node (either a bookmark or a folder) in the bookmark tree. Child nodes are ordered within their parent folder.",
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the node. IDs are unique within the current profile, and they remain valid even after the browser is restarted."
- },
- "parentId": {
- "type": "string",
- "optional": true,
- "description": "The <code>id</code> of the parent folder. Omitted for the root node."
- },
- "index": {
- "type": "integer",
- "optional": true,
- "description": "The 0-based position of this node within its parent folder."
- },
- "url": {
- "type": "string",
- "optional": true,
- "description": "The URL navigated to when a user clicks the bookmark. Omitted for folders."
- },
- "title": {
- "type": "string",
- "description": "The text displayed for the node."
- },
- "dateAdded": {
- "type": "number",
- "optional": true,
- "description": "When this node was created, in milliseconds since the epoch (<code>new Date(dateAdded)</code>)."
- },
- "dateGroupModified": {
- "type": "number",
- "optional": true,
- "description": "When the contents of this folder last changed, in milliseconds since the epoch."
- },
- "unmodifiable": {
- "$ref": "BookmarkTreeNodeUnmodifiable",
- "optional": true,
- "description": "Indicates the reason why this node is unmodifiable. The <var>managed</var> value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default)."
- },
- "children": {
- "type": "array",
- "optional": true,
- "items": { "$ref": "BookmarkTreeNode" },
- "description": "An ordered list of children of this node."
- }
- }
- },
- {
- "id": "CreateDetails",
- "description": "Object passed to the create() function.",
- "type": "object",
- "properties": {
- "parentId": {
- "type": "string",
- "optional": true,
- "description": "Defaults to the Other Bookmarks folder."
- },
- "index": {
- "type": "integer",
- "minimum": 0,
- "optional": true
- },
- "title": {
- "type": "string",
- "optional": true
- },
- "url": {
- "type": "string",
- "optional": true
- }
- }
- }
- ],
- "functions": [
- {
- "name": "get",
- "type": "function",
- "description": "Retrieves the specified BookmarkTreeNode(s).",
- "async": "callback",
- "parameters": [
- {
- "name": "idOrIdList",
- "description": "A single string-valued id, or an array of string-valued ids",
- "choices": [
- {
- "type": "string"
- },
- {
- "type": "array",
- "items": {
- "type": "string"
- },
- "minItems": 1
- }
- ]
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": { "$ref": "BookmarkTreeNode" }
- }
- ]
- }
- ]
- },
- {
- "name": "getChildren",
- "type": "function",
- "description": "Retrieves the children of the specified BookmarkTreeNode id.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": { "$ref": "BookmarkTreeNode"}
- }
- ]
- }
- ]
- },
- {
- "name": "getRecent",
- "type": "function",
- "description": "Retrieves the recently added bookmarks.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "minimum": 1,
- "name": "numberOfItems",
- "description": "The maximum number of items to return."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": { "$ref": "BookmarkTreeNode" }
- }
- ]
- }
- ]
- },
- {
- "name": "getTree",
- "type": "function",
- "description": "Retrieves the entire Bookmarks hierarchy.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": { "$ref": "BookmarkTreeNode" }
- }
- ]
- }
- ]
- },
- {
- "name": "getSubTree",
- "type": "function",
- "description": "Retrieves part of the Bookmarks hierarchy, starting at the specified node.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "id",
- "description": "The ID of the root of the subtree to retrieve."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": { "$ref": "BookmarkTreeNode" }
- }
- ]
- }
- ]
- },
- {
- "name": "search",
- "type": "function",
- "description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.",
- "async": "callback",
- "parameters": [
- {
- "name": "query",
- "description": "Either a string of words and quoted phrases that are matched against bookmark URLs and titles, or an object. If an object, the properties <code>query</code>, <code>url</code>, and <code>title</code> may be specified and bookmarks matching all specified properties will be produced.",
- "choices": [
- {
- "type": "string",
- "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles."
- },
- {
- "type": "object",
- "description": "An object specifying properties and values to match when searching. Produces bookmarks matching all properties.",
- "properties": {
- "query": {
- "type": "string",
- "optional": true,
- "description": "A string of words and quoted phrases that are matched against bookmark URLs and titles."
- },
- "url": {
- "type": "string",
- "format": "url",
- "optional": true,
- "description": "The URL of the bookmark; matches verbatim. Note that folders have no URL."
- },
- "title": {
- "type": "string",
- "optional": true,
- "description": "The title of the bookmark; matches verbatim."
- }
- }
- }
- ]
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": { "$ref": "BookmarkTreeNode" }
- }
- ]
- }
- ]
- },
- {
- "name": "create",
- "type": "function",
- "description": "Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.",
- "async": "callback",
- "parameters": [
- {
- "$ref": "CreateDetails",
- "name": "bookmark"
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "BookmarkTreeNode"
- }
- ]
- }
- ]
- },
- {
- "name": "move",
- "type": "function",
- "description": "Moves the specified BookmarkTreeNode to the provided location.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "object",
- "name": "destination",
- "properties": {
- "parentId": {
- "type": "string",
- "optional": true
- },
- "index": {
- "type": "integer",
- "minimum": 0,
- "optional": true
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "BookmarkTreeNode"
- }
- ]
- }
- ]
- },
- {
- "name": "update",
- "type": "function",
- "description": "Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. <b>Note:</b> Currently, only 'title' and 'url' are supported.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "object",
- "name": "changes",
- "properties": {
- "title": {
- "type": "string",
- "optional": true
- },
- "url": {
- "type": "string",
- "optional": true
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "BookmarkTreeNode"
- }
- ]
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Removes a bookmark or an empty bookmark folder.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "removeTree",
- "type": "function",
- "description": "Recursively removes a bookmark folder.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "import",
- "unsupported": true,
- "type": "function",
- "description": "Imports bookmarks from an html bookmark file",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "export",
- "unsupported": true,
- "type": "function",
- "description": "Exports bookmarks to an html bookmark file",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onCreated",
- "type": "function",
- "description": "Fired when a bookmark or folder is created.",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "$ref": "BookmarkTreeNode",
- "name": "bookmark"
- }
- ]
- },
- {
- "name": "onRemoved",
- "type": "function",
- "description": "Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents.",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "object",
- "name": "removeInfo",
- "properties": {
- "parentId": { "type": "string" },
- "index": { "type": "integer" },
- "node": { "$ref": "BookmarkTreeNode" }
- }
- }
- ]
- },
- {
- "name": "onChanged",
- "type": "function",
- "description": "Fired when a bookmark or folder changes. <b>Note:</b> Currently, only title and url changes trigger this.",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "object",
- "name": "changeInfo",
- "properties": {
- "title": { "type": "string" },
- "url": {
- "type": "string",
- "optional": true
- }
- }
- }
- ]
- },
- {
- "name": "onMoved",
- "type": "function",
- "description": "Fired when a bookmark or folder is moved to a different parent folder.",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "object",
- "name": "moveInfo",
- "properties": {
- "parentId": { "type": "string" },
- "index": { "type": "integer" },
- "oldParentId": { "type": "string" },
- "oldIndex": { "type": "integer" }
- }
- }
- ]
- },
- {
- "name": "onChildrenReordered",
- "unsupported": true,
- "type": "function",
- "description": "Fired when the children of a folder have changed their order due to the order being sorted in the UI. This is not called as a result of a move().",
- "parameters": [
- {
- "type": "string",
- "name": "id"
- },
- {
- "type": "object",
- "name": "reorderInfo",
- "properties": {
- "childIds": {
- "type": "array",
- "items": { "type": "string" }
- }
- }
- }
- ]
- },
- {
- "name": "onImportBegan",
- "unsupported": true,
- "type": "function",
- "description": "Fired when a bookmark import session is begun. Expensive observers should ignore onCreated updates until onImportEnded is fired. Observers should still handle other notifications immediately.",
- "parameters": []
- },
- {
- "name": "onImportEnded",
- "unsupported": true,
- "type": "function",
- "description": "Fired when a bookmark import session is ended.",
- "parameters": []
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/browser_action.json b/application/basilisk/components/webextensions/schemas/browser_action.json
deleted file mode 100644
index 1a7da956a1..0000000000
--- a/application/basilisk/components/webextensions/schemas/browser_action.json
+++ /dev/null
@@ -1,430 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "WebExtensionManifest",
- "properties": {
- "browser_action": {
- "type": "object",
- "additionalProperties": { "$ref": "UnrecognizedProperty" },
- "properties": {
- "default_title": {
- "type": "string",
- "optional": true,
- "preprocess": "localize"
- },
- "default_icon": {
- "$ref": "IconPath",
- "optional": true
- },
- "default_popup": {
- "type": "string",
- "format": "relativeUrl",
- "optional": true,
- "preprocess": "localize"
- },
- "browser_style": {
- "type": "boolean",
- "optional": true
- }
- },
- "optional": true
- }
- }
- }
- ]
- },
- {
- "namespace": "browserAction",
- "description": "Use browser actions to put icons in the main browser toolbar, to the right of the address bar. In addition to its icon, a browser action can also have a tooltip, a badge, and a popup.",
- "permissions": ["manifest:browser_action"],
- "types": [
- {
- "id": "ColorArray",
- "type": "array",
- "items": {
- "type": "integer",
- "minimum": 0,
- "maximum": 255
- },
- "minItems": 4,
- "maxItems": 4
- },
- {
- "id": "ImageDataType",
- "type": "object",
- "isInstanceOf": "ImageData",
- "additionalProperties": { "type": "any" },
- "postprocess": "convertImageDataToURL",
- "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
- }
- ],
- "functions": [
- {
- "name": "setTitle",
- "type": "function",
- "description": "Sets the title of the browser action. This shows up in the tooltip.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "title": {
- "type": "string",
- "description": "The string the browser action should display when moused over."
- },
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "getTitle",
- "type": "function",
- "description": "Gets the title of the browser action.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Specify the tab to get the title from. If no tab is specified, the non-tab-specific title is returned."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
- }
- ]
- },
- {
- "name": "setIcon",
- "type": "function",
- "description": "Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "imageData": {
- "choices": [
- { "$ref": "ImageDataType" },
- {
- "type": "object",
- "additionalProperties": {"$ref": "ImageDataType"}
- }
- ],
- "optional": true,
- "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
- },
- "path": {
- "choices": [
- { "type": "string" },
- {
- "type": "object",
- "additionalProperties": {"type": "string"}
- }
- ],
- "optional": true,
- "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
- },
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "setPopup",
- "type": "function",
- "description": "Sets the html document to be opened as a popup when the user clicks on the browser action's icon.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
- },
- "popup": {
- "type": "string",
- "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "getPopup",
- "type": "function",
- "description": "Gets the html document set as the popup for this browser action.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Specify the tab to get the popup from. If no tab is specified, the non-tab-specific popup is returned."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
- }
- ]
- },
- {
- "name": "setBadgeText",
- "type": "function",
- "description": "Sets the badge text for the browser action. The badge is displayed on top of the icon.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "text": {
- "type": "string",
- "description": "Any number of characters can be passed, but only about four can fit in the space."
- },
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "getBadgeText",
- "type": "function",
- "description": "Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Specify the tab to get the badge text from. If no tab is specified, the non-tab-specific badge text is returned."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
- }
- ]
- },
- {
- "name": "setBadgeBackgroundColor",
- "type": "function",
- "description": "Sets the background color for the badge.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "color": {
- "description": "An array of four integers in the range [0,255] that make up the RGBA color of the badge. For example, opaque red is <code>[255, 0, 0, 255]</code>. Can also be a string with a CSS value, with opaque red being <code>#FF0000</code> or <code>#F00</code>.",
- "choices": [
- {"type": "string"},
- {"$ref": "ColorArray"}
- ]
- },
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Limits the change to when a particular tab is selected. Automatically resets when the tab is closed."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "getBadgeBackgroundColor",
- "type": "function",
- "description": "Gets the background color of the browser action.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "optional": true,
- "description": "Specify the tab to get the badge background color from. If no tab is specified, the non-tab-specific badge background color is returned."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "$ref": "ColorArray"
- }
- ]
- }
- ]
- },
- {
- "name": "enable",
- "type": "function",
- "description": "Enables the browser action for a tab. By default, browser actions are enabled.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "optional": true,
- "name": "tabId",
- "minimum": 0,
- "description": "The id of the tab for which you want to modify the browser action."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "disable",
- "type": "function",
- "description": "Disables the browser action for a tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "optional": true,
- "name": "tabId",
- "minimum": 0,
- "description": "The id of the tab for which you want to modify the browser action."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "openPopup",
- "type": "function",
- "description": "Opens the extension popup window in the active window but does not grant tab permissions.",
- "unsupported": true,
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "popupView",
- "type": "object",
- "optional": true,
- "description": "JavaScript 'window' object for the popup window if it was succesfully opened.",
- "additionalProperties": { "type": "any" }
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onClicked",
- "type": "function",
- "description": "Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.",
- "parameters": [
- {
- "name": "tab",
- "$ref": "tabs.Tab"
- }
- ]
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/commands.json b/application/basilisk/components/webextensions/schemas/commands.json
deleted file mode 100644
index a1632088e3..0000000000
--- a/application/basilisk/components/webextensions/schemas/commands.json
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "id": "KeyName",
- "choices": [
- {
- "type": "string",
- "pattern": "^\\s*(Alt|Ctrl|Command|MacCtrl)\\s*\\+\\s*(Shift\\s*\\+\\s*)?([A-Z0-9]|Comma|Period|Home|End|PageUp|PageDown|Space|Insert|Delete|Up|Down|Left|Right)\\s*$"
- },
- {
- "type": "string",
- "pattern": "^(MediaNextTrack|MediaPlayPause|MediaPrevTrack|MediaStop)$"
- }
- ]
- },
- {
- "$extend": "WebExtensionManifest",
- "properties": {
- "commands": {
- "type": "object",
- "optional": true,
- "additionalProperties": {
- "type": "object",
- "additionalProperties": { "$ref": "UnrecognizedProperty" },
- "properties": {
- "suggested_key": {
- "type": "object",
- "optional": true,
- "properties": {
- "default": {
- "$ref": "KeyName",
- "optional": true
- },
- "mac": {
- "$ref": "KeyName",
- "optional": true
- },
- "linux": {
- "$ref": "KeyName",
- "optional": true
- },
- "windows": {
- "$ref": "KeyName",
- "optional": true
- },
- "chromeos": {
- "type": "string",
- "optional": true
- },
- "android": {
- "type": "string",
- "optional": true
- },
- "ios": {
- "type": "string",
- "optional": true
- },
- "additionalProperties": {
- "type": "string",
- "deprecated": "Unknown platform name",
- "optional": true
- }
- }
- },
- "description": {
- "type": "string",
- "optional": true
- }
- }
- }
- }
- }
- }
- ]
- },
- {
- "namespace": "commands",
- "description": "Use the commands API to add keyboard shortcuts that trigger actions in your extension, for example, an action to open the browser action or send a command to the xtension.",
- "permissions": ["manifest:commands"],
- "types": [
- {
- "id": "Command",
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "optional": true,
- "description": "The name of the Extension Command"
- },
- "description": {
- "type": "string",
- "optional": true,
- "description": "The Extension Command description"
- },
- "shortcut": {
- "type": "string",
- "optional": true,
- "description": "The shortcut active for this command, or blank if not active."
- }
- }
- }
- ],
- "events": [
- {
- "name": "onCommand",
- "description": "Fired when a registered command is activated using a keyboard shortcut.",
- "type": "function",
- "parameters": [
- {
- "name": "command",
- "type": "string"
- }
- ]
- }
- ],
- "functions": [
- {
- "name": "getAll",
- "type": "function",
- "async": "callback",
- "description": "Returns all the registered extension commands for this extension and their shortcut (if active).",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "commands",
- "type": "array",
- "items": {
- "$ref": "Command"
- }
- }
- ],
- "description": "Called to return the registered commands."
- }
- ]
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/context_menus.json b/application/basilisk/components/webextensions/schemas/context_menus.json
deleted file mode 100644
index b31af51f3f..0000000000
--- a/application/basilisk/components/webextensions/schemas/context_menus.json
+++ /dev/null
@@ -1,424 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "contextMenus"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "contextMenus",
- "description": "Use the <code>browser.contextMenus</code> API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
- "permissions": ["contextMenus"],
- "properties": {
- "ACTION_MENU_TOP_LEVEL_LIMIT": {
- "value": 6,
- "description": "The maximum number of top level extension items that can be added to an extension action context menu. Any items beyond this limit will be ignored."
- }
- },
- "types": [
- {
- "id": "ContextType",
- "type": "string",
- "enum": ["all", "page", "frame", "selection", "link", "editable", "image", "video", "audio", "launcher", "browser_action", "page_action"],
- "description": "The different contexts a menu can appear in. Specifying 'all' is equivalent to the combination of all other contexts except for 'launcher'. The 'launcher' context is only supported by apps and is used to add menu items to the context menu that appears when clicking on the app icon in the launcher/taskbar/dock/etc. Different platforms might put limitations on what is actually supported in a launcher context menu."
- },
- {
- "id": "ItemType",
- "type": "string",
- "enum": ["normal", "checkbox", "radio", "separator"],
- "description": "The type of menu item."
- },
- {
- "id": "OnClickData",
- "type": "object",
- "description": "Information sent when a context menu item is clicked.",
- "properties": {
- "menuItemId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "description": "The ID of the menu item that was clicked."
- },
- "parentMenuItemId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "optional": true,
- "description": "The parent ID, if any, for the item clicked."
- },
- "mediaType": {
- "type": "string",
- "optional": true,
- "description": "One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements."
- },
- "linkUrl": {
- "type": "string",
- "optional": true,
- "description": "If the element is a link, the URL it points to."
- },
- "srcUrl": {
- "type": "string",
- "optional": true,
- "description": "Will be present for elements with a 'src' URL."
- },
- "pageUrl": {
- "type": "string",
- "optional": true,
- "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu."
- },
- "frameUrl": {
- "type": "string",
- "optional": true,
- "description": " The URL of the frame of the element where the context menu was clicked, if it was in a frame."
- },
- "selectionText": {
- "type": "string",
- "optional": true,
- "description": "The text for the context selection, if any."
- },
- "editable": {
- "type": "boolean",
- "description": "A flag indicating whether the element is editable (text input, textarea, etc.)."
- },
- "wasChecked": {
- "type": "boolean",
- "optional": true,
- "description": "A flag indicating the state of a checkbox or radio item before it was clicked."
- },
- "checked": {
- "type": "boolean",
- "optional": true,
- "description": "A flag indicating the state of a checkbox or radio item after it is clicked."
- }
- }
- }
- ],
- "functions": [
- {
- "name": "create",
- "type": "function",
- "description": "Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in $(ref:runtime.lastError)).",
- "returns": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "description": "The ID of the newly created item."
- },
- "parameters": [
- {
- "type": "object",
- "name": "createProperties",
- "properties": {
- "type": {
- "$ref": "ItemType",
- "optional": true,
- "description": "The type of menu item. Defaults to 'normal' if not specified."
- },
- "id": {
- "type": "string",
- "optional": true,
- "description": "The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension."
- },
- "title": {
- "type": "string",
- "optional": true,
- "description": "The text to be displayed in the item; this is <em>required</em> unless <code>type</code> is 'separator'. When the context is 'selection', you can use <code>%s</code> within the string to show the selected text. For example, if this parameter's value is \"Translate '%s' to Pig Latin\" and the user selects the word \"cool\", the context menu item for the selection is \"Translate 'cool' to Pig Latin\"."
- },
- "checked": {
- "type": "boolean",
- "optional": true,
- "description": "The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items."
- },
- "contexts": {
- "type": "array",
- "items": {
- "$ref": "ContextType"
- },
- "minItems": 1,
- "optional": true,
- "description": "List of contexts this menu item will appear in. Defaults to ['page'] if not specified."
- },
- "onclick": {
- "type": "function",
- "optional": true,
- "description": "A function that will be called back when the menu item is clicked. Event pages cannot use this; instead, they should register a listener for $(ref:contextMenus.onClicked).",
- "parameters": [
- {
- "name": "info",
- "$ref": "contextMenusInternal.OnClickData",
- "description": "Information about the item clicked and the context where the click happened."
- },
- {
- "name": "tab",
- "$ref": "tabs.Tab",
- "description": "The details of the tab where the click took place. Note: this parameter only present for extensions."
- }
- ]
- },
- "parentId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "optional": true,
- "description": "The ID of a parent menu item; this makes the item a child of a previously added item."
- },
- "documentUrlPatterns": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true,
- "description": "Lets you restrict the item to apply only to documents whose URL matches one of the given patterns. (This applies to frames as well.) For details on the format of a pattern, see $(topic:match_patterns)[Match Patterns]."
- },
- "targetUrlPatterns": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true,
- "description": "Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags."
- },
- "enabled": {
- "type": "boolean",
- "optional": true,
- "description": "Whether this context menu item is enabled or disabled. Defaults to true."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called when the item has been created in the browser. If there were any problems creating the item, details will be available in $(ref:runtime.lastError).",
- "parameters": []
- }
- ]
- },
- {
- "name": "createInternal",
- "type": "function",
- "allowedContexts": ["addon_parent_only"],
- "async": "callback",
- "description": "Identical to contextMenus.create, except: the 'id' field is required and allows an integer, 'onclick' is not allowed, and the method is async (and the return value is not a menu item ID).",
- "parameters": [
- {
- "type": "object",
- "name": "createProperties",
- "properties": {
- "type": {
- "$ref": "ItemType",
- "optional": true
- },
- "id": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ]
- },
- "title": {
- "type": "string",
- "optional": true
- },
- "checked": {
- "type": "boolean",
- "optional": true
- },
- "contexts": {
- "type": "array",
- "items": {
- "$ref": "ContextType"
- },
- "minItems": 1,
- "optional": true
- },
- "parentId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "optional": true
- },
- "documentUrlPatterns": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true
- },
- "targetUrlPatterns": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true
- },
- "enabled": {
- "type": "boolean",
- "optional": true
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "update",
- "type": "function",
- "description": "Updates a previously created context menu item.",
- "async": "callback",
- "parameters": [
- {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "name": "id",
- "description": "The ID of the item to update."
- },
- {
- "type": "object",
- "name": "updateProperties",
- "description": "The properties to update. Accepts the same values as the create function.",
- "properties": {
- "type": {
- "$ref": "ItemType",
- "optional": true
- },
- "title": {
- "type": "string",
- "optional": true
- },
- "checked": {
- "type": "boolean",
- "optional": true
- },
- "contexts": {
- "type": "array",
- "items": {
- "$ref": "ContextType"
- },
- "minItems": 1,
- "optional": true
- },
- "onclick": {
- "type": "function",
- "optional": "omit-key-if-missing",
- "parameters": [
- {
- "name": "info",
- "$ref": "contextMenusInternal.OnClickData"
- },
- {
- "name": "tab",
- "$ref": "tabs.Tab",
- "description": "The details of the tab where the click took place. Note: this parameter only present for extensions."
- }
- ]
- },
- "parentId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "optional": true,
- "description": "Note: You cannot change an item to be a child of one of its own descendants."
- },
- "documentUrlPatterns": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true
- },
- "targetUrlPatterns": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true
- },
- "enabled": {
- "type": "boolean",
- "optional": true
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [],
- "description": "Called when the context menu has been updated."
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Removes a context menu item.",
- "async": "callback",
- "parameters": [
- {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "name": "menuItemId",
- "description": "The ID of the context menu item to remove."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [],
- "description": "Called when the context menu has been removed."
- }
- ]
- },
- {
- "name": "removeAll",
- "type": "function",
- "description": "Removes all context menu items added by this extension.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [],
- "description": "Called when removal is complete."
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onClicked",
- "type": "function",
- "description": "Fired when a context menu item is clicked.",
- "parameters": [
- {
- "name": "info",
- "$ref": "OnClickData",
- "description": "Information about the item clicked and the context where the click happened."
- },
- {
- "name": "tab",
- "$ref": "tabs.Tab",
- "description": "The details of the tab where the click took place. If the click did not take place in a tab, this parameter will be missing.",
- "optional": true
- }
- ]
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/context_menus_internal.json b/application/basilisk/components/webextensions/schemas/context_menus_internal.json
deleted file mode 100644
index c3cb7aff01..0000000000
--- a/application/basilisk/components/webextensions/schemas/context_menus_internal.json
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "contextMenusInternal",
- "description": "Use the <code>browser.contextMenus</code> API to add items to the browser's context menu. You can choose what types of objects your context menu additions apply to, such as images, hyperlinks, and pages.",
- "types": [
- {
- "id": "OnClickData",
- "type": "object",
- "description": "Information sent when a context menu item is clicked.",
- "properties": {
- "menuItemId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "description": "The ID of the menu item that was clicked."
- },
- "parentMenuItemId": {
- "choices": [
- { "type": "integer" },
- { "type": "string" }
- ],
- "optional": true,
- "description": "The parent ID, if any, for the item clicked."
- },
- "mediaType": {
- "type": "string",
- "optional": true,
- "description": "One of 'image', 'video', or 'audio' if the context menu was activated on one of these types of elements."
- },
- "linkUrl": {
- "type": "string",
- "optional": true,
- "description": "If the element is a link, the URL it points to."
- },
- "srcUrl": {
- "type": "string",
- "optional": true,
- "description": "Will be present for elements with a 'src' URL."
- },
- "pageUrl": {
- "type": "string",
- "optional": true,
- "description": "The URL of the page where the menu item was clicked. This property is not set if the click occured in a context where there is no current page, such as in a launcher context menu."
- },
- "frameUrl": {
- "type": "string",
- "optional": true,
- "description": " The URL of the frame of the element where the context menu was clicked, if it was in a frame."
- },
- "selectionText": {
- "type": "string",
- "optional": true,
- "description": "The text for the context selection, if any."
- },
- "editable": {
- "type": "boolean",
- "description": "A flag indicating whether the element is editable (text input, textarea, etc.)."
- },
- "wasChecked": {
- "type": "boolean",
- "optional": true,
- "description": "A flag indicating the state of a checkbox or radio item before it was clicked."
- },
- "checked": {
- "type": "boolean",
- "optional": true,
- "description": "A flag indicating the state of a checkbox or radio item after it is clicked."
- }
- }
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/history.json b/application/basilisk/components/webextensions/schemas/history.json
deleted file mode 100644
index e05569e384..0000000000
--- a/application/basilisk/components/webextensions/schemas/history.json
+++ /dev/null
@@ -1,316 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "history"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "history",
- "description": "Use the <code>browser.history</code> API to interact with the browser's record of visited pages. You can add, remove, and query for URLs in the browser's history. To override the history page with your own version, see $(topic:override)[Override Pages].",
- "permissions": ["history"],
- "types": [
- {
- "id": "TransitionType",
- "type": "string",
- "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "auto_toplevel", "form_submit", "reload", "keyword", "keyword_generated"],
- "description": "The $(topic:transition-types)[transition type] for this visit from its referrer."
- },
- {
- "id": "HistoryItem",
- "type": "object",
- "description": "An object encapsulating one result of a history query.",
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the item."
- },
- "url": {
- "type": "string",
- "optional": true,
- "description": "The URL navigated to by a user."
- },
- "title": {
- "type": "string",
- "optional": true,
- "description": "The title of the page when it was last loaded."
- },
- "lastVisitTime": {
- "type": "number",
- "optional": true,
- "description": "When this page was last loaded, represented in milliseconds since the epoch."
- },
- "visitCount": {
- "type": "integer",
- "optional": true,
- "description": "The number of times the user has navigated to this page."
- },
- "typedCount": {
- "type": "integer",
- "optional": true,
- "description": "The number of times the user has navigated to this page by typing in the address."
- }
- }
- },
- {
- "id": "VisitItem",
- "type": "object",
- "description": "An object encapsulating one visit to a URL.",
- "properties": {
- "id": {
- "type": "string",
- "description": "The unique identifier for the item."
- },
- "visitId": {
- "type": "string",
- "description": "The unique identifier for this visit."
- },
- "visitTime": {
- "type": "number",
- "optional": true,
- "description": "When this visit occurred, represented in milliseconds since the epoch."
- },
- "referringVisitId": {
- "type": "string",
- "description": "The visit ID of the referrer."
- },
- "transition": {
- "$ref": "TransitionType",
- "description": "The $(topic:transition-types)[transition type] for this visit from its referrer."
- }
- }
- }
- ],
- "functions": [
- {
- "name": "search",
- "type": "function",
- "description": "Searches the history for the last visit time of each page matching the query.",
- "async": "callback",
- "parameters": [
- {
- "name": "query",
- "type": "object",
- "properties": {
- "text": {
- "type": "string",
- "description": "A free-text query to the history service. Leave empty to retrieve all pages."
- },
- "startTime": {
- "$ref": "extensionTypes.Date",
- "optional": true,
- "description": "Limit results to those visited after this date. If not specified, this defaults to 24 hours in the past."
- },
- "endTime": {
- "$ref": "extensionTypes.Date",
- "optional": true,
- "description": "Limit results to those visited before this date."
- },
- "maxResults": {
- "type": "integer",
- "optional": true,
- "minimum": 1,
- "description": "The maximum number of results to retrieve. Defaults to 100."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": {
- "$ref": "HistoryItem"
- }
- }
- ]
- }
- ]
- },
- {
- "name": "getVisits",
- "type": "function",
- "description": "Retrieves information about visits to a URL.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "The URL for which to retrieve visit information. It must be in the format as returned from a call to history.search."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": {
- "$ref": "VisitItem"
- }
- }
- ]
- }
- ]
- },
- {
- "name": "addUrl",
- "type": "function",
- "description": "Adds a URL to the history with a default visitTime of the current time and a default $(topic:transition-types)[transition type] of \"link\".",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "The URL to add. Must be a valid URL that can be added to history."
- },
- "title": {
- "type": "string",
- "optional": true,
- "description": "The title of the page."
- },
- "transition": {
- "$ref": "TransitionType",
- "optional": true,
- "description": "The $(topic:transition-types)[transition type] for this visit from its referrer."
- },
- "visitTime": {
- "$ref": "extensionTypes.Date",
- "optional": true,
- "description": "The date when this visit occurred."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "deleteUrl",
- "type": "function",
- "description": "Removes all occurrences of the given URL from the history.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "The URL to remove."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "deleteRange",
- "type": "function",
- "description": "Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.",
- "async": "callback",
- "parameters": [
- {
- "name": "range",
- "type": "object",
- "properties": {
- "startTime": {
- "$ref": "extensionTypes.Date",
- "description": "Items added to history after this date."
- },
- "endTime": {
- "$ref": "extensionTypes.Date",
- "description": "Items added to history before this date."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": []
- }
- ]
- },
- {
- "name": "deleteAll",
- "type": "function",
- "description": "Deletes all items from the history.",
- "async": "callback",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": []
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onVisited",
- "type": "function",
- "description": "Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded.",
- "parameters": [
- {
- "name": "result",
- "$ref": "HistoryItem"
- }
- ]
- },
- {
- "name": "onVisitRemoved",
- "type": "function",
- "description": "Fired when one or more URLs are removed from the history service. When all visits have been removed the URL is purged from history.",
- "parameters": [
- {
- "name": "removed",
- "type": "object",
- "properties": {
- "allHistory": {
- "type": "boolean",
- "description": "True if all history was removed. If true, then urls will be empty."
- },
- "urls": {
- "type": "array",
- "items": {
- "type": "string"
- }
- }
- }
- }
- ]
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/jar.mn b/application/basilisk/components/webextensions/schemas/jar.mn
deleted file mode 100644
index c9fc9a8088..0000000000
--- a/application/basilisk/components/webextensions/schemas/jar.mn
+++ /dev/null
@@ -1,16 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-browser.jar:
- content/browser/schemas/bookmarks.json
- content/browser/schemas/browser_action.json
- content/browser/schemas/commands.json
- content/browser/schemas/context_menus.json
- content/browser/schemas/context_menus_internal.json
- content/browser/schemas/history.json
- content/browser/schemas/omnibox.json
- content/browser/schemas/page_action.json
- content/browser/schemas/sessions.json
- content/browser/schemas/tabs.json
- content/browser/schemas/windows.json
diff --git a/application/basilisk/components/webextensions/schemas/moz.build b/application/basilisk/components/webextensions/schemas/moz.build
deleted file mode 100644
index aac3a838c4..0000000000
--- a/application/basilisk/components/webextensions/schemas/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JAR_MANIFESTS += ['jar.mn']
diff --git a/application/basilisk/components/webextensions/schemas/omnibox.json b/application/basilisk/components/webextensions/schemas/omnibox.json
deleted file mode 100644
index 34428fab77..0000000000
--- a/application/basilisk/components/webextensions/schemas/omnibox.json
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "WebExtensionManifest",
- "properties": {
- "omnibox": {
- "type": "object",
- "additionalProperties": { "$ref": "UnrecognizedProperty" },
- "properties": {
- "keyword": {
- "type": "string",
- "pattern": "^[^?\\s:]([^\\s:]*[^/\\s:])?$"
- }
- },
- "optional": true
- }
- }
- }
- ]
- },
- {
- "namespace": "omnibox",
- "description": "The omnibox API allows you to register a keyword with Firefox's address bar.",
- "permissions": ["manifest:omnibox"],
- "types": [
- {
- "id": "DescriptionStyleType",
- "type": "string",
- "description": "The style type.",
- "enum": ["url", "match", "dim"]
- },
- {
- "id": "OnInputEnteredDisposition",
- "type": "string",
- "enum": ["currentTab", "newForegroundTab", "newBackgroundTab"],
- "description": "The window disposition for the omnibox query. This is the recommended context to display results. For example, if the omnibox command is to navigate to a certain URL, a disposition of 'newForegroundTab' means the navigation should take place in a new selected tab."
- },
- {
- "id": "SuggestResult",
- "type": "object",
- "description": "A suggest result.",
- "properties": {
- "content": {
- "type": "string",
- "minLength": 1,
- "description": "The text that is put into the URL bar, and that is sent to the extension when the user chooses this entry."
- },
- "description": {
- "type": "string",
- "minLength": 1,
- "description": "The text that is displayed in the URL dropdown. Can contain XML-style markup for styling. The supported tags are 'url' (for a literal URL), 'match' (for highlighting text that matched what the user's query), and 'dim' (for dim helper text). The styles can be nested, eg. <dim><match>dimmed match</match></dim>. You must escape the five predefined entities to display them as text: stackoverflow.com/a/1091953/89484 "
- },
- "descriptionStyles": {
- "optional": true,
- "unsupported": true,
- "type": "array",
- "description": "An array of style ranges for the description, as provided by the extension.",
- "items": {
- "type": "object",
- "description": "The style ranges for the description, as provided by the extension.",
- "properties": {
- "offset": { "type": "integer" },
- "type": { "description": "The style type", "$ref": "DescriptionStyleType"},
- "length": { "type": "integer", "optional": true }
- }
- }
- },
- "descriptionStylesRaw": {
- "optional": true,
- "unsupported": true,
- "type": "array",
- "description": "An array of style ranges for the description, as provided by ToValue().",
- "items": {
- "type": "object",
- "description": "The style ranges for the description, as provided by ToValue().",
- "properties": {
- "offset": { "type": "integer" },
- "type": { "type": "integer" }
- }
- }
- }
- }
- },
- {
- "id": "DefaultSuggestResult",
- "type": "object",
- "description": "A suggest result.",
- "properties": {
- "description": {
- "type": "string",
- "minLength": 1,
- "description": "The text that is displayed in the URL dropdown."
- },
- "descriptionStyles": {
- "optional": true,
- "unsupported": true,
- "type": "array",
- "description": "An array of style ranges for the description, as provided by the extension.",
- "items": {
- "type": "object",
- "description": "The style ranges for the description, as provided by the extension.",
- "properties": {
- "offset": { "type": "integer" },
- "type": { "description": "The style type", "$ref": "DescriptionStyleType"},
- "length": { "type": "integer", "optional": true }
- }
- }
- },
- "descriptionStylesRaw": {
- "optional": true,
- "unsupported": true,
- "type": "array",
- "description": "An array of style ranges for the description, as provided by ToValue().",
- "items": {
- "type": "object",
- "description": "The style ranges for the description, as provided by ToValue().",
- "properties": {
- "offset": { "type": "integer" },
- "type": { "type": "integer" }
- }
- }
- }
- }
- }
- ],
- "functions": [
- {
- "name": "setDefaultSuggestion",
- "type": "function",
- "description": "Sets the description and styling for the default suggestion. The default suggestion is the text that is displayed in the first suggestion row underneath the URL bar.",
- "parameters": [
- {
- "name": "suggestion",
- "$ref": "DefaultSuggestResult",
- "description": "A partial SuggestResult object, without the 'content' parameter."
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onInputStarted",
- "type": "function",
- "description": "User has started a keyword input session by typing the extension's keyword. This is guaranteed to be sent exactly once per input session, and before any onInputChanged events.",
- "parameters": []
- },
- {
- "name": "onInputChanged",
- "type": "function",
- "description": "User has changed what is typed into the omnibox.",
- "parameters": [
- {
- "type": "string",
- "name": "text"
- },
- {
- "name": "suggest",
- "type": "function",
- "description": "A callback passed to the onInputChanged event used for sending suggestions back to the browser.",
- "parameters": [
- {
- "name": "suggestResults",
- "type": "array",
- "description": "Array of suggest results",
- "items": {
- "$ref": "SuggestResult"
- }
- }
- ]
- }
- ]
- },
- {
- "name": "onInputEntered",
- "type": "function",
- "description": "User has accepted what is typed into the omnibox.",
- "parameters": [
- {
- "type": "string",
- "name": "text"
- },
- {
- "name": "disposition",
- "$ref": "OnInputEnteredDisposition"
- }
- ]
- },
- {
- "name": "onInputCancelled",
- "type": "function",
- "description": "User has ended the keyword input session without accepting the input.",
- "parameters": []
- }
- ]
- },
- {
- "namespace": "omnibox_internal",
- "description": "The internal namespace used by the omnibox API.",
- "defaultContexts": ["addon_parent_only"],
- "functions": [
- {
- "name": "addSuggestions",
- "type": "function",
- "async": "callback",
- "description": "Internal function used by omnibox.onInputChanged for adding search suggestions",
- "parameters": [
- {
- "name": "id",
- "type": "integer",
- "description": "The ID of the callback received by onInputChangedInternal"
- },
- {
- "name": "suggestResults",
- "type": "array",
- "description": "Array of suggest results",
- "items": {
- "$ref": "omnibox.SuggestResult"
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onInputChanged",
- "type": "function",
- "description": "Identical to omnibox.onInputChanged except no 'suggest' callback is provided.",
- "parameters": [
- {
- "type": "string",
- "name": "text"
- }
- ]
- }
- ]
- }
-] \ No newline at end of file
diff --git a/application/basilisk/components/webextensions/schemas/page_action.json b/application/basilisk/components/webextensions/schemas/page_action.json
deleted file mode 100644
index 126378ca53..0000000000
--- a/application/basilisk/components/webextensions/schemas/page_action.json
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "WebExtensionManifest",
- "properties": {
- "page_action": {
- "type": "object",
- "additionalProperties": { "$ref": "UnrecognizedProperty" },
- "properties": {
- "default_title": {
- "type": "string",
- "optional": true,
- "preprocess": "localize"
- },
- "default_icon": {
- "$ref": "IconPath",
- "optional": true
- },
- "default_popup": {
- "type": "string",
- "format": "relativeUrl",
- "optional": true,
- "preprocess": "localize"
- },
- "browser_style": {
- "type": "boolean",
- "optional": true
- }
- },
- "optional": true
- }
- }
- }
- ]
- },
- {
- "namespace": "pageAction",
- "description": "Use the <code>browser.pageAction</code> API to put icons inside the address bar. Page actions represent actions that can be taken on the current page, but that aren't applicable to all pages.",
- "permissions": ["manifest:page_action"],
- "types": [
- {
- "id": "ImageDataType",
- "type": "object",
- "isInstanceOf": "ImageData",
- "additionalProperties": { "type": "any" },
- "postprocess": "convertImageDataToURL",
- "description": "Pixel data for an image. Must be an ImageData object (for example, from a <code>canvas</code> element)."
- }
- ],
- "functions": [
- {
- "name": "show",
- "type": "function",
- "async": "callback",
- "description": "Shows the page action. The page action is shown whenever the tab is selected.",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "hide",
- "type": "function",
- "async": "callback",
- "description": "Hides the page action.",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "setTitle",
- "type": "function",
- "description": "Sets the title of the page action. This is displayed in a tooltip over the page action.",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- "title": {"type": "string", "description": "The tooltip string."}
- }
- }
- ]
- },
- {
- "name": "getTitle",
- "type": "function",
- "description": "Gets the title of the page action.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "description": "Specify the tab to get the title from."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
- }
- ]
- },
- {
- "name": "setIcon",
- "type": "function",
- "description": "Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the <b>path</b> or the <b>imageData</b> property must be specified.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- "imageData": {
- "choices": [
- { "$ref": "ImageDataType" },
- {
- "type": "object",
- "additionalProperties": {"$ref": "ImageDataType"}
- }
- ],
- "optional": true,
- "description": "Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}'"
- },
- "path": {
- "choices": [
- { "type": "string" },
- {
- "type": "object",
- "additionalProperties": {"type": "string"}
- }
- ],
- "optional": true,
- "description": "Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals <code>scale</code>, then image with size <code>scale</code> * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'"
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "setPopup",
- "type": "function",
- "async": true,
- "description": "Sets the html document to be opened as a popup when the user clicks on the page action's icon.",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {"type": "integer", "minimum": 0, "description": "The id of the tab for which you want to modify the page action."},
- "popup": {
- "type": "string",
- "description": "The html file to show in a popup. If set to the empty string (''), no popup is shown."
- }
- }
- }
- ]
- },
- {
- "name": "getPopup",
- "type": "function",
- "description": "Gets the html document set as the popup for this page action.",
- "async": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "properties": {
- "tabId": {
- "type": "integer",
- "description": "Specify the tab to get the popup from."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "string"
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onClicked",
- "type": "function",
- "description": "Fired when a page action icon is clicked. This event will not fire if the page action has a popup.",
- "parameters": [
- {
- "name": "tab",
- "$ref": "tabs.Tab"
- }
- ]
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/sessions.json b/application/basilisk/components/webextensions/schemas/sessions.json
deleted file mode 100644
index 690bb8ebcf..0000000000
--- a/application/basilisk/components/webextensions/schemas/sessions.json
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "sessions"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "sessions",
- "description": "Use the <code>chrome.sessions</code> API to query and restore tabs and windows from a browsing session.",
- "permissions": ["sessions"],
- "types": [
- {
- "id": "Filter",
- "type": "object",
- "properties": {
- "maxResults": {
- "type": "integer",
- "minimum": 0,
- "maximum": 25,
- "optional": true,
- "description": "The maximum number of entries to be fetched in the requested list. Omit this parameter to fetch the maximum number of entries ($(ref:sessions.MAX_SESSION_RESULTS))."
- }
- }
- },
- {
- "id": "Session",
- "type": "object",
- "properties": {
- "lastModified": {"type": "integer", "description": "The time when the window or tab was closed or modified, represented in milliseconds since the epoch."},
- "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab), if this entry describes a tab. Either this or $(ref:sessions.Session.window) will be set."},
- "window": {"$ref": "windows.Window", "optional": true, "description": "The $(ref:windows.Window), if this entry describes a window. Either this or $(ref:sessions.Session.tab) will be set."}
- }
- },
- {
- "id": "Device",
- "type": "object",
- "properties": {
- "info": {"type": "string"},
- "deviceName": {"type": "string", "description": "The name of the foreign device."},
- "sessions": {"type": "array", "items": {"$ref": "Session"}, "description": "A list of open window sessions for the foreign device, sorted from most recently to least recently modified session."}
- }
- }
- ],
- "functions": [
- {
- "name": "getRecentlyClosed",
- "type": "function",
- "description": "Gets the list of recently closed tabs and/or windows.",
- "async": "callback",
- "parameters": [
- {
- "$ref": "Filter",
- "name": "filter",
- "optional": true,
- "default": {}
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "sessions", "type": "array", "items": { "$ref": "Session" }, "description": "The list of closed entries in reverse order that they were closed (the most recently closed tab or window will be at index <code>0</code>). The entries may contain either tabs or windows."
- }
- ]
- }
- ]
- },
- {
- "name": "getDevices",
- "unsupported": true,
- "type": "function",
- "description": "Retrieves all devices with synced sessions.",
- "async": "callback",
- "parameters": [
- {
- "$ref": "Filter",
- "name": "filter",
- "optional": true
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "devices", "type": "array", "items": { "$ref": "Device" }, "description": "The list of $(ref:sessions.Device) objects for each synced session, sorted in order from device with most recently modified session to device with least recently modified session. $(ref:tabs.Tab) objects are sorted by recency in the $(ref:windows.Window) of the $(ref:sessions.Session) objects."
- }
- ]
- }
- ]
- },
- {
- "name": "restore",
- "type": "function",
- "description": "Reopens a $(ref:windows.Window) or $(ref:tabs.Tab), with an optional callback to run when the entry has been restored.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "sessionId",
- "optional": true,
- "description": "The $(ref:windows.Window.sessionId), or $(ref:tabs.Tab.sessionId) to restore. If this parameter is not specified, the most recently closed session is restored."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "$ref": "Session",
- "name": "restoredSession",
- "description": "A $(ref:sessions.Session) containing the restored $(ref:windows.Window) or $(ref:tabs.Tab) object."
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onChanged",
- "unsupported": true,
- "description": "Fired when recently closed tabs and/or windows are changed. This event does not monitor synced sessions changes.",
- "type": "function"
- }
- ],
- "properties": {
- "MAX_SESSION_RESULTS": {
- "value": 25,
- "description": "The maximum number of $(ref:sessions.Session) that will be included in a requested list."
- }
- }
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/tabs.json b/application/basilisk/components/webextensions/schemas/tabs.json
deleted file mode 100644
index 23ce33a4b3..0000000000
--- a/application/basilisk/components/webextensions/schemas/tabs.json
+++ /dev/null
@@ -1,1295 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "activeTab",
- "tabs"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "tabs",
- "description": "Use the <code>browser.tabs</code> API to interact with the browser's tab system. You can use this API to create, modify, and rearrange tabs in the browser.",
- "types": [
- { "id": "MutedInfoReason",
- "type": "string",
- "description": "An event that caused a muted state change.",
- "enum": [
- {"name": "user", "description": "A user input action has set/overridden the muted state."},
- {"name": "capture", "description": "Tab capture started, forcing a muted state change."},
- {"name": "extension", "description": "An extension, identified by the extensionId field, set the muted state."}
- ]
- },
- {
- "id": "MutedInfo",
- "type": "object",
- "description": "Tab muted state and the reason for the last state change.",
- "properties": {
- "muted": {
- "type": "boolean",
- "description": "Whether the tab is prevented from playing sound (but hasn't necessarily recently produced sound). Equivalent to whether the muted audio indicator is showing."
- },
- "reason": {
- "$ref": "MutedInfoReason",
- "optional": true,
- "description": "The reason the tab was muted or unmuted. Not set if the tab's mute state has never been changed."
- },
- "extensionId": {
- "type": "string",
- "optional": true,
- "description": "The ID of the extension that changed the muted state. Not set if an extension was not the reason the muted state last changed."
- }
- }
- },
- {
- "id": "Tab",
- "type": "object",
- "properties": {
- "id": {"type": "integer", "minimum": -1, "optional": true, "description": "The ID of the tab. Tab IDs are unique within a browser session. Under some circumstances a Tab may not be assigned an ID, for example when querying foreign tabs using the $(ref:sessions) API, in which case a session ID may be present. Tab ID can also be set to $(ref:tabs.TAB_ID_NONE) for apps and devtools windows."},
- "index": {"type": "integer", "minimum": -1, "description": "The zero-based index of the tab within its window."},
- "windowId": {"type": "integer", "minimum": 0, "description": "The ID of the window the tab is contained within."},
- "openerTabId": {"unsupported": true, "type": "integer", "minimum": 0, "optional": true, "description": "The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists."},
- "selected": {"type": "boolean", "description": "Whether the tab is selected.", "deprecated": "Please use $(ref:tabs.Tab.highlighted).", "unsupported": true},
- "highlighted": {"type": "boolean", "description": "Whether the tab is highlighted."},
- "active": {"type": "boolean", "description": "Whether the tab is active in its window. (Does not necessarily mean the window is focused.)"},
- "pinned": {"type": "boolean", "description": "Whether the tab is pinned."},
- "audible": {"type": "boolean", "optional": true, "description": "Whether the tab has produced sound over the past couple of seconds (but it might not be heard if also muted). Equivalent to whether the speaker audio indicator is showing."},
- "mutedInfo": {"$ref": "MutedInfo", "optional": true, "description": "Current tab muted state and the reason for the last state change."},
- "url": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The URL the tab is displaying. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."},
- "title": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The title of the tab. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission."},
- "favIconUrl": {"type": "string", "optional": true, "permissions": ["tabs"], "description": "The URL of the tab's favicon. This property is only present if the extension's manifest includes the <code>\"tabs\"</code> permission. It may also be an empty string if the tab is loading."},
- "status": {"type": "string", "optional": true, "description": "Either <em>loading</em> or <em>complete</em>."},
- "incognito": {"type": "boolean", "description": "Whether the tab is in an incognito window."},
- "width": {"type": "integer", "optional": true, "description": "The width of the tab in pixels."},
- "height": {"type": "integer", "optional": true, "description": "The height of the tab in pixels."},
- "sessionId": {"unsupported": true, "type": "string", "optional": true, "description": "The session ID used to uniquely identify a Tab obtained from the $(ref:sessions) API."},
- "cookieStoreId": {"type": "string", "description": "The CookieStoreId used for the tab."}
- }
- },
- {
- "id": "ZoomSettingsMode",
- "type": "string",
- "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to <code>automatic</code>.",
- "enum": [
- {
- "name": "automatic",
- "description": "Zoom changes are handled automatically by the browser."
- },
- {
- "name": "manual",
- "description": "Overrides the automatic handling of zoom changes. The <code>onZoomChange</code> event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support <code>per-origin</code> zooming, and will thus ignore the <code>scope</code> zoom setting and assume <code>per-tab</code>."
- },
- {
- "name": "disabled",
- "description": "Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored."
- }
- ]
- },
- {
- "id": "ZoomSettingsScope",
- "type": "string",
- "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to <code>per-origin</code> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.",
- "enum": [
- {
- "name": "per-origin",
- "description": "Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, <code>per-origin</code> zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The <code>per-origin</code> scope is only available in the <code>automatic</code> mode."
- },
- {
- "name": "per-tab",
- "description": "Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, <code>per-tab</code> zoom changes are reset on navigation; navigating a tab will always load pages with their <code>per-origin</code> zoom factors."
- }
- ]
- },
- {
- "id": "ZoomSettings",
- "type": "object",
- "description": "Defines how zoom changes in a tab are handled and at what scope.",
- "properties": {
- "mode": {
- "$ref": "ZoomSettingsMode",
- "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to <code>automatic</code>.",
- "optional": true
- },
- "scope": {
- "$ref": "ZoomSettingsScope",
- "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to <code>per-origin</code> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.",
- "optional": true
- },
- "defaultZoomFactor": {
- "type": "number",
- "optional": true,
- "description": "Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings."
- }
- }
- },
- {
- "id": "TabStatus",
- "type": "string",
- "enum": ["loading", "complete"],
- "description": "Whether the tabs have completed loading."
- },
- {
- "id": "WindowType",
- "type": "string",
- "enum": ["normal", "popup", "panel", "app", "devtools"],
- "description": "The type of window."
- }
- ],
- "properties": {
- "TAB_ID_NONE": {
- "value": -1,
- "description": "An ID which represents the absence of a browser tab."
- }
- },
- "functions": [
- {
- "name": "get",
- "type": "function",
- "description": "Retrieves details about the specified tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {"name": "tab", "$ref": "Tab"}
- ]
- }
- ]
- },
- {
- "name": "getCurrent",
- "type": "function",
- "description": "Gets the tab that this script call is being made from. May be undefined if called from a non-tab context (for example: a background page or popup view).",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "tab",
- "$ref": "Tab",
- "optional": true
- }
- ]
- }
- ]
- },
- {
- "name": "connect",
- "type": "function",
- "description": "Connects to the content script(s) in the specified tab. The $(ref:runtime.onConnect) event is fired in each content script running in the specified tab for the current extension. For more details, see $(topic:messaging)[Content Script Messaging].",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0
- },
- {
- "type": "object",
- "name": "connectInfo",
- "properties": {
- "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for content scripts that are listening for the connection event." },
- "frameId": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Open a port to a specific $(topic:frame_ids)[frame] identified by <code>frameId</code> instead of all frames in the tab."
- }
- },
- "optional": true
- }
- ],
- "returns": {
- "$ref": "runtime.Port",
- "description": "A port that can be used to communicate with the content scripts running in the specified tab. The port's $(ref:runtime.Port) event is fired if the tab closes or does not exist. "
- }
- },
- {
- "name": "sendRequest",
- "deprecated": "Please use $(ref:runtime.sendMessage).",
- "unsupported": true,
- "type": "function",
- "description": "Sends a single request to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:extension.onRequest) event is fired in each content script running in the specified tab for the current extension.",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0
- },
- {
- "type": "any",
- "name": "request"
- },
- {
- "type": "function",
- "name": "responseCallback",
- "optional": true,
- "parameters": [
- {
- "name": "response",
- "type": "any",
- "description": "The JSON response object sent by the handler of the request. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
- }
- ]
- }
- ]
- },
- {
- "name": "sendMessage",
- "type": "function",
- "description": "Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The $(ref:runtime.onMessage) event is fired in each content script running in the specified tab for the current extension.",
- "async": "responseCallback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0
- },
- {
- "type": "any",
- "name": "message"
- },
- {
- "type": "object",
- "name": "options",
- "properties": {
- "frameId": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "Send a message to a specific $(topic:frame_ids)[frame] identified by <code>frameId</code> instead of all frames in the tab."
- }
- },
- "optional": true
- },
- {
- "type": "function",
- "name": "responseCallback",
- "optional": true,
- "parameters": [
- {
- "name": "response",
- "type": "any",
- "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the specified tab, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
- }
- ]
- }
- ]
- },
- {
- "name": "getSelected",
- "deprecated": "Please use $(ref:tabs.query) <code>{active: true}</code>.",
- "unsupported": true,
- "type": "function",
- "description": "Gets the tab that is selected in the specified window.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": -2,
- "optional": true,
- "description": "Defaults to the $(topic:current-window)[current window]."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {"name": "tab", "$ref": "Tab"}
- ]
- }
- ]
- },
- {
- "name": "getAllInWindow",
- "deprecated": "Please use $(ref:tabs.query) <code>{windowId: windowId}</code>.",
- "unsupported": true,
- "type": "function",
- "description": "Gets details about all tabs in the specified window.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": -2,
- "optional": true,
- "description": "Defaults to the $(topic:current-window)[current window]."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {"name": "tabs", "type": "array", "items": { "$ref": "Tab" } }
- ]
- }
- ]
- },
- {
- "name": "create",
- "type": "function",
- "description": "Creates a new tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "createProperties",
- "properties": {
- "windowId": {
- "type": "integer",
- "minimum": -2,
- "optional": true,
- "description": "The window to create the new tab in. Defaults to the $(topic:current-window)[current window]."
- },
- "index": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window."
- },
- "url": {
- "type": "string",
- "optional": true,
- "description": "The URL to navigate the tab to initially. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page."
- },
- "active": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should become the active tab in the window. Does not affect whether the window is focused (see $(ref:windows.update)). Defaults to <var>true</var>."
- },
- "selected": {
- "deprecated": "Please use <em>active</em>.",
- "unsupported": true,
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should become the selected tab in the window. Defaults to <var>true</var>"
- },
- "pinned": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should be pinned. Defaults to <var>false</var>"
- },
- "openerTabId": {
- "unsupported": true,
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab."
- },
- "cookieStoreId": {
- "type": "string",
- "optional": true,
- "description": "The CookieStoreId for the tab that opened this tab."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "tab",
- "$ref": "Tab",
- "description": "Details about the created tab. Will contain the ID of the new tab."
- }
- ]
- }
- ]
- },
- {
- "name": "duplicate",
- "type": "function",
- "description": "Duplicates a tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "description": "The ID of the tab which is to be duplicated."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "tab",
- "optional": true,
- "description": "Details about the duplicated tab. The $(ref:tabs.Tab) object doesn't contain <code>url</code>, <code>title</code> and <code>favIconUrl</code> if the <code>\"tabs\"</code> permission has not been requested.",
- "$ref": "Tab"
- }
- ]
- }
- ]
- },
- {
- "name": "query",
- "type": "function",
- "description": "Gets all tabs that have the specified properties, or all tabs if no properties are specified.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "queryInfo",
- "properties": {
- "active": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are active in their windows."
- },
- "pinned": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are pinned."
- },
- "audible": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are audible."
- },
- "muted": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are muted."
- },
- "highlighted": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are highlighted."
- },
- "currentWindow": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are in the $(topic:current-window)[current window]."
- },
- "lastFocusedWindow": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tabs are in the last focused window."
- },
- "status": {
- "$ref": "TabStatus",
- "optional": true,
- "description": "Whether the tabs have completed loading."
- },
- "title": {
- "type": "string",
- "optional": true,
- "description": "Match page titles against a pattern."
- },
- "url": {
- "choices": [
- {"type": "string"},
- {"type": "array", "items": {"type": "string"}}
- ],
- "optional": true,
- "description": "Match tabs against one or more $(topic:match_patterns)[URL patterns]. Note that fragment identifiers are not matched."
- },
- "windowId": {
- "type": "integer",
- "optional": true,
- "minimum": -2,
- "description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the $(topic:current-window)[current window]."
- },
- "windowType": {
- "$ref": "WindowType",
- "optional": true,
- "description": "The type of window the tabs are in."
- },
- "index": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "The position of the tabs within their windows."
- },
- "cookieStoreId": {
- "type": "string",
- "optional": true,
- "description": "The CookieStoreId used for the tab."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "result",
- "type": "array",
- "items": {
- "$ref": "Tab"
- }
- }
- ]
- }
- ]
- },
- {
- "name": "highlight",
- "type": "function",
- "description": "Highlights the given tabs.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "highlightInfo",
- "properties": {
- "windowId": {
- "type": "integer",
- "optional": true,
- "description": "The window that contains the tabs.",
- "minimum": -2
- },
- "tabs": {
- "description": "One or more tab indices to highlight.",
- "choices": [
- {"type": "array", "items": {"type": "integer", "minimum": 0}},
- {"type": "integer"}
- ]
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "window",
- "$ref": "windows.Window",
- "description": "Contains details about the window whose tabs were highlighted."
- }
- ]
- }
- ]
- },
- {
- "name": "update",
- "type": "function",
- "description": "Modifies the properties of a tab. Properties that are not specified in <var>updateProperties</var> are not modified.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "Defaults to the selected tab of the $(topic:current-window)[current window]."
- },
- {
- "type": "object",
- "name": "updateProperties",
- "properties": {
- "url": {
- "type": "string",
- "optional": true,
- "description": "A URL to navigate the tab to."
- },
- "active": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should be active. Does not affect whether the window is focused (see $(ref:windows.update))."
- },
- "highlighted": {
- "unsupported": true,
- "type": "boolean",
- "optional": true,
- "description": "Adds or removes the tab from the current selection."
- },
- "selected": {
- "unsupported": true,
- "deprecated": "Please use <em>highlighted</em>.",
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should be selected."
- },
- "pinned": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should be pinned."
- },
- "muted": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the tab should be muted."
- },
- "openerTabId": {
- "unsupported": true,
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "tab",
- "$ref": "Tab",
- "optional": true,
- "description": "Details about the updated tab. The $(ref:tabs.Tab) object doesn't contain <code>url</code>, <code>title</code> and <code>favIconUrl</code> if the <code>\"tabs\"</code> permission has not been requested."
- }
- ]
- }
- ]
- },
- {
- "name": "move",
- "type": "function",
- "description": "Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === \"normal\") windows.",
- "async": "callback",
- "parameters": [
- {
- "name": "tabIds",
- "description": "The tab or list of tabs to move.",
- "choices": [
- {"type": "integer", "minimum": 0},
- {"type": "array", "items": {"type": "integer", "minimum": 0}}
- ]
- },
- {
- "type": "object",
- "name": "moveProperties",
- "properties": {
- "windowId": {
- "type": "integer",
- "minimum": -2,
- "optional": true,
- "description": "Defaults to the window the tab is currently in."
- },
- "index": {
- "type": "integer",
- "minimum": -1,
- "description": "The position to move the window to. -1 will place the tab at the end of the window."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "tabs",
- "description": "Details about the moved tabs.",
- "choices": [
- {"$ref": "Tab"},
- {"type": "array", "items": {"$ref": "Tab"}}
- ]
- }
- ]
- }
- ]
- },
- {
- "name": "reload",
- "type": "function",
- "description": "Reload a tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab to reload; defaults to the selected tab of the current window."
- },
- {
- "type": "object",
- "name": "reloadProperties",
- "optional": true,
- "properties": {
- "bypassCache": {
- "type": "boolean",
- "optional": true,
- "description": "Whether using any local cache. Default is false."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Closes one or more tabs.",
- "async": "callback",
- "parameters": [
- {
- "name": "tabIds",
- "description": "The tab or list of tabs to close.",
- "choices": [
- {"type": "integer", "minimum": 0},
- {"type": "array", "items": {"type": "integer", "minimum": 0}}
- ]
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "detectLanguage",
- "type": "function",
- "description": "Detects the primary language of the content in a tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "Defaults to the active tab of the $(topic:current-window)[current window]."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "language",
- "description": "An ISO language code such as <code>en</code> or <code>fr</code>. For a complete list of languages supported by this method, see <a href='http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc'>kLanguageInfoTable</a>. The 2nd to 4th columns will be checked and the first non-NULL value will be returned except for Simplified Chinese for which zh-CN will be returned. For an unknown language, <code>und</code> will be returned."
- }
- ]
- }
- ]
- },
- {
- "name": "captureVisibleTab",
- "type": "function",
- "description": "Captures the visible area of the currently active tab in the specified window. You must have $(topic:declare_permissions)[&lt;all_urls&gt;] permission to use this method.",
- "permissions": ["<all_urls>"],
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": -2,
- "optional": true,
- "description": "The target window. Defaults to the $(topic:current-window)[current window]."
- },
- {
- "$ref": "extensionTypes.ImageDetails",
- "name": "options",
- "optional": true
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "dataUrl",
- "description": "A data URL which encodes an image of the visible area of the captured tab. May be assigned to the 'src' property of an HTML Image element for display."
- }
- ]
- }
- ]
- },
- {
- "name": "executeScript",
- "type": "function",
- "description": "Injects JavaScript code into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab in which to run the script; defaults to the active tab of the current window."
- },
- {
- "$ref": "extensionTypes.InjectDetails",
- "name": "details",
- "description": "Details of the script to run."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called after all the JavaScript has been executed.",
- "parameters": [
- {
- "name": "result",
- "optional": true,
- "type": "array",
- "items": {"type": "any"},
- "description": "The result of the script in every injected frame."
- }
- ]
- }
- ]
- },
- {
- "name": "insertCSS",
- "type": "function",
- "description": "Injects CSS into a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab in which to insert the CSS; defaults to the active tab of the current window."
- },
- {
- "$ref": "extensionTypes.InjectDetails",
- "name": "details",
- "description": "Details of the CSS text to insert."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called when all the CSS has been inserted.",
- "parameters": []
- }
- ]
- },
- {
- "name": "removeCSS",
- "type": "function",
- "description": "Removes injected CSS from a page. For details, see the $(topic:content_scripts)[programmatic injection] section of the content scripts doc.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab from which to remove the injected CSS; defaults to the active tab of the current window."
- },
- {
- "$ref": "extensionTypes.InjectDetails",
- "name": "details",
- "description": "Details of the CSS text to remove."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called when all the CSS has been removed.",
- "parameters": []
- }
- ]
- },
- {
- "name": "setZoom",
- "type": "function",
- "description": "Zooms a specified tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab to zoom; defaults to the active tab of the current window."
- },
- {
- "type": "number",
- "name": "zoomFactor",
- "description": "The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called after the zoom factor has been changed.",
- "parameters": []
- }
- ]
- },
- {
- "name": "getZoom",
- "type": "function",
- "description": "Gets the current zoom factor of a specified tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the tab to get the current zoom factor from; defaults to the active tab of the current window."
- },
- {
- "type": "function",
- "name": "callback",
- "description": "Called with the tab's current zoom factor after it has been fetched.",
- "parameters": [
- {
- "type": "number",
- "name": "zoomFactor",
- "description": "The tab's current zoom factor."
- }
- ]
- }
- ]
- },
- {
- "name": "setZoomSettings",
- "type": "function",
- "description": "Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "optional": true,
- "minimum": 0,
- "description": "The ID of the tab to change the zoom settings for; defaults to the active tab of the current window."
- },
- {
- "$ref": "ZoomSettings",
- "name": "zoomSettings",
- "description": "Defines how zoom changes are handled and at what scope."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called after the zoom settings have been changed.",
- "parameters": []
- }
- ]
- },
- {
- "name": "getZoomSettings",
- "type": "function",
- "description": "Gets the current zoom settings of a specified tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "optional": true,
- "minimum": 0,
- "description": "The ID of the tab to get the current zoom settings from; defaults to the active tab of the current window."
- },
- {
- "type": "function",
- "name": "callback",
- "description": "Called with the tab's current zoom settings.",
- "parameters": [
- {
- "$ref": "ZoomSettings",
- "name": "zoomSettings",
- "description": "The tab's current zoom settings."
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onCreated",
- "type": "function",
- "description": "Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
- "parameters": [
- {
- "$ref": "Tab",
- "name": "tab",
- "description": "Details of the tab that was created."
- }
- ]
- },
- {
- "name": "onUpdated",
- "type": "function",
- "description": "Fired when a tab is updated.",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0},
- {
- "type": "object",
- "name": "changeInfo",
- "description": "Lists the changes to the state of the tab that was updated.",
- "properties": {
- "status": {
- "type": "string",
- "optional": true,
- "description": "The status of the tab. Can be either <em>loading</em> or <em>complete</em>."
- },
- "url": {
- "type": "string",
- "optional": true,
- "description": "The tab's URL if it has changed."
- },
- "pinned": {
- "type": "boolean",
- "optional": true,
- "description": "The tab's new pinned state."
- },
- "audible": {
- "type": "boolean",
- "optional": true,
- "description": "The tab's new audible state."
- },
- "mutedInfo": {
- "$ref": "MutedInfo",
- "optional": true,
- "description": "The tab's new muted state and the reason for the change."
- },
- "favIconUrl": {
- "type": "string",
- "optional": true,
- "description": "The tab's new favicon URL."
- }
- }
- },
- {
- "$ref": "Tab",
- "name": "tab",
- "description": "Gives the state of the tab that was updated."
- }
- ]
- },
- {
- "name": "onMoved",
- "type": "function",
- "description": "Fired when a tab is moved within a window. Only one move event is fired, representing the tab the user directly moved. Move events are not fired for the other tabs that must move in response. This event is not fired when a tab is moved between windows. For that, see $(ref:tabs.onDetached).",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0},
- {
- "type": "object",
- "name": "moveInfo",
- "properties": {
- "windowId": {"type": "integer", "minimum": 0},
- "fromIndex": {"type": "integer", "minimum": 0},
- "toIndex": {"type": "integer", "minimum": 0}
- }
- }
- ]
- },
- {
- "name": "onSelectionChanged",
- "deprecated": "Please use $(ref:tabs.onActivated).",
- "unsupported": true,
- "type": "function",
- "description": "Fires when the selected tab in a window changes.",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "description": "The ID of the tab that has become active."
- },
- {
- "type": "object",
- "name": "selectInfo",
- "properties": {
- "windowId": {
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the window the selected tab changed inside of."
- }
- }
- }
- ]
- },
- {
- "name": "onActiveChanged",
- "deprecated": "Please use $(ref:tabs.onActivated).",
- "unsupported": true,
- "type": "function",
- "description": "Fires when the selected tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to $(ref:tabs.onUpdated) events to be notified when a URL is set.",
- "parameters": [
- {
- "type": "integer",
- "name": "tabId",
- "minimum": 0,
- "description": "The ID of the tab that has become active."
- },
- {
- "type": "object",
- "name": "selectInfo",
- "properties": {
- "windowId": {
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the window the selected tab changed inside of."
- }
- }
- }
- ]
- },
- {
- "name": "onActivated",
- "type": "function",
- "description": "Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to onUpdated events to be notified when a URL is set.",
- "parameters": [
- {
- "type": "object",
- "name": "activeInfo",
- "properties": {
- "tabId": {
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the tab that has become active."
- },
- "windowId": {
- "type": "integer",
- "minimum": 0,
- "description": "The ID of the window the active tab changed inside of."
- }
- }
- }
- ]
- },
- {
- "name": "onHighlightChanged",
- "deprecated": "Please use $(ref:tabs.onHighlighted).",
- "unsupported": true,
- "type": "function",
- "description": "Fired when the highlighted or selected tabs in a window changes.",
- "parameters": [
- {
- "type": "object",
- "name": "selectInfo",
- "properties": {
- "windowId": {
- "type": "integer",
- "minimum": 0,
- "description": "The window whose tabs changed."
- },
- "tabIds": {
- "type": "array",
- "items": {"type": "integer", "minimum": 0},
- "description": "All highlighted tabs in the window."
- }
- }
- }
- ]
- },
- {
- "name": "onHighlighted",
- "type": "function",
- "description": "Fired when the highlighted or selected tabs in a window changes.",
- "parameters": [
- {
- "type": "object",
- "name": "highlightInfo",
- "properties": {
- "windowId": {
- "type": "integer",
- "minimum": 0,
- "description": "The window whose tabs changed."
- },
- "tabIds": {
- "type": "array",
- "items": {"type": "integer", "minimum": 0},
- "description": "All highlighted tabs in the window."
- }
- }
- }
- ]
- },
- {
- "name": "onDetached",
- "type": "function",
- "description": "Fired when a tab is detached from a window, for example because it is being moved between windows.",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0},
- {
- "type": "object",
- "name": "detachInfo",
- "properties": {
- "oldWindowId": {"type": "integer", "minimum": 0},
- "oldPosition": {"type": "integer", "minimum": 0}
- }
- }
- ]
- },
- {
- "name": "onAttached",
- "type": "function",
- "description": "Fired when a tab is attached to a window, for example because it was moved between windows.",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0},
- {
- "type": "object",
- "name": "attachInfo",
- "properties": {
- "newWindowId": {"type": "integer", "minimum": 0},
- "newPosition": {"type": "integer", "minimum": 0}
- }
- }
- ]
- },
- {
- "name": "onRemoved",
- "type": "function",
- "description": "Fired when a tab is closed.",
- "parameters": [
- {"type": "integer", "name": "tabId", "minimum": 0},
- {
- "type": "object",
- "name": "removeInfo",
- "properties": {
- "windowId": {"type": "integer", "minimum": 0, "description": "The window whose tab is closed." },
- "isWindowClosing": {"type": "boolean", "description": "True when the tab is being closed because its window is being closed." }
- }
- }
- ]
- },
- {
- "name": "onReplaced",
- "type": "function",
- "description": "Fired when a tab is replaced with another tab due to prerendering or instant.",
- "parameters": [
- {"type": "integer", "name": "addedTabId", "minimum": 0},
- {"type": "integer", "name": "removedTabId", "minimum": 0}
- ]
- },
- {
- "name": "onZoomChange",
- "type": "function",
- "description": "Fired when a tab is zoomed.",
- "parameters": [{
- "type": "object",
- "name": "ZoomChangeInfo",
- "properties": {
- "tabId": {"type": "integer", "minimum": 0},
- "oldZoomFactor": {"type": "number"},
- "newZoomFactor": {"type": "number"},
- "zoomSettings": {"$ref": "ZoomSettings"}
- }
- }]
- }
- ]
- }
-]
diff --git a/application/basilisk/components/webextensions/schemas/windows.json b/application/basilisk/components/webextensions/schemas/windows.json
deleted file mode 100644
index 8453358b57..0000000000
--- a/application/basilisk/components/webextensions/schemas/windows.json
+++ /dev/null
@@ -1,508 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "windows",
- "description": "Use the <code>browser.windows</code> API to interact with browser windows. You can use this API to create, modify, and rearrange windows in the browser.",
- "types": [
- {
- "id": "WindowType",
- "type": "string",
- "description": "The type of browser window this is. Under some circumstances a Window may not be assigned type property, for example when querying closed windows from the $(ref:sessions) API.",
- "enum": ["normal", "popup", "panel", "app", "devtools"]
- },
- {
- "id": "WindowState",
- "type": "string",
- "description": "The state of this browser window. Under some circumstances a Window may not be assigned state property, for example when querying closed windows from the $(ref:sessions) API.",
- "enum": ["normal", "minimized", "maximized", "fullscreen", "docked"]
- },
- {
- "id": "Window",
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "description": "The ID of the window. Window IDs are unique within a browser session. Under some circumstances a Window may not be assigned an ID, for example when querying windows using the $(ref:sessions) API, in which case a session ID may be present."
- },
- "focused": {
- "type": "boolean",
- "description": "Whether the window is currently the focused window."
- },
- "top": {
- "type": "integer",
- "optional": true,
- "description": "The offset of the window from the top edge of the screen in pixels. Under some circumstances a Window may not be assigned top property, for example when querying closed windows from the $(ref:sessions) API."
- },
- "left": {
- "type": "integer",
- "optional": true,
- "description": "The offset of the window from the left edge of the screen in pixels. Under some circumstances a Window may not be assigned left property, for example when querying closed windows from the $(ref:sessions) API."
- },
- "width": {
- "type": "integer",
- "optional": true,
- "description": "The width of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned width property, for example when querying closed windows from the $(ref:sessions) API."
- },
- "height": {
- "type": "integer",
- "optional": true,
- "description": "The height of the window, including the frame, in pixels. Under some circumstances a Window may not be assigned height property, for example when querying closed windows from the $(ref:sessions) API."
- },
- "tabs": {
- "type": "array",
- "items": { "$ref": "tabs.Tab" },
- "optional": true,
- "description": "Array of $(ref:tabs.Tab) objects representing the current tabs in the window."
- },
- "incognito": {
- "type": "boolean",
- "description": "Whether the window is incognito."
- },
- "type": {
- "$ref": "WindowType",
- "optional": true,
- "description": "The type of browser window this is."
- },
- "state": {
- "$ref": "WindowState",
- "optional": true,
- "description": "The state of this browser window."
- },
- "alwaysOnTop": {
- "type": "boolean",
- "description": "Whether the window is set to be always on top."
- },
- "sessionId": {
- "type": "string",
- "optional": true,
- "description": "The session ID used to uniquely identify a Window obtained from the $(ref:sessions) API."
- }
- }
- },
- {
- "id": "CreateType",
- "type": "string",
- "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set.",
- "enum": ["normal", "popup", "panel", "detached_panel"]
- }
- ],
- "properties": {
- "WINDOW_ID_NONE": {
- "value": -1,
- "description": "The windowId value that represents the absence of a browser window."
- },
- "WINDOW_ID_CURRENT": {
- "value": -2,
- "description": "The windowId value that represents the $(topic:current-window)[current window]."
- }
- },
- "functions": [
- {
- "name": "get",
- "type": "function",
- "description": "Gets details about a window.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": -2
- },
- {
- "type": "object",
- "name": "getInfo",
- "optional": true,
- "description": "",
- "properties": {
- "populate": {
- "type": "boolean",
- "optional": true,
- "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
- },
- "windowTypes": {
- "type": "array",
- "items": {
- "$ref": "WindowType"
- },
- "optional": true,
- "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "window",
- "$ref": "Window"
- }
- ]
- }
- ]
- },
- {
- "name": "getCurrent",
- "type": "function",
- "description": "Gets the $(topic:current-window)[current window].",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "getInfo",
- "optional": true,
- "description": "",
- "properties": {
- "populate": {
- "type": "boolean",
- "optional": true,
- "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
- },
- "windowTypes": {
- "type": "array",
- "items": { "$ref": "WindowType" },
- "optional": true,
- "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "window",
- "$ref": "Window"
- }
- ]
- }
- ]
- },
- {
- "name": "getLastFocused",
- "type": "function",
- "description": "Gets the window that was most recently focused &mdash; typically the window 'on top'.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "getInfo",
- "optional": true,
- "description": "",
- "properties": {
- "populate": {
- "type": "boolean",
- "optional": true,
- "description": "If true, the $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
- },
- "windowTypes": {
- "type": "array",
- "items": { "$ref": "WindowType" },
- "optional": true,
- "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "window",
- "$ref": "Window"
- }
- ]
- }
- ]
- },
- {
- "name": "getAll",
- "type": "function",
- "description": "Gets all windows.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "getInfo",
- "optional": true,
- "description": "",
- "properties": {
- "populate": {
- "type": "boolean",
- "optional": true,
- "description": "If true, each $(ref:windows.Window) object will have a <var>tabs</var> property that contains a list of the $(ref:tabs.Tab) objects for that window. The <code>Tab</code> objects only contain the <code>url</code>, <code>title</code> and <code>favIconUrl</code> properties if the extension's manifest file includes the <code>\"tabs\"</code> permission."
- },
- "windowTypes": {
- "type": "array",
- "items": { "$ref": "WindowType" },
- "optional": true,
- "description": "If set, the $(ref:windows.Window) returned will be filtered based on its type. If unset the default filter is set to <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "windows",
- "type": "array",
- "items": { "$ref": "Window" }
- }
- ]
- }
- ]
- },
- {
- "name": "create",
- "type": "function",
- "description": "Creates (opens) a new browser with any optional sizing, position or default URL provided.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "createData",
- "optional": true,
- "default": {},
- "properties": {
- "url": {
- "description": "A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme (i.e. 'http://www.google.com', not 'www.google.com'). Relative URLs will be relative to the current page within the extension. Defaults to the New Tab Page.",
- "optional": true,
- "choices": [
- { "type": "string", "format": "relativeUrl" },
- {
- "type": "array",
- "items": { "type": "string", "format": "relativeUrl" }
- }
- ]
- },
- "tabId": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The id of the tab for which you want to adopt to the new window."
- },
- "left": {
- "type": "integer",
- "optional": true,
- "description": "The number of pixels to position the new window from the left edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."
- },
- "top": {
- "type": "integer",
- "optional": true,
- "description": "The number of pixels to position the new window from the top edge of the screen. If not specified, the new window is offset naturally from the last focused window. This value is ignored for panels."
- },
- "width": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The width in pixels of the new window, including the frame. If not specified defaults to a natural width."
- },
- "height": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The height in pixels of the new window, including the frame. If not specified defaults to a natural height."
- },
- "focused": {
- "unsupported": true,
- "type": "boolean",
- "optional": true,
- "description": "If true, opens an active window. If false, opens an inactive window."
- },
- "incognito": {
- "type": "boolean",
- "optional": true,
- "description": "Whether the new window should be an incognito window."
- },
- "type": {
- "$ref": "CreateType",
- "optional": true,
- "description": "Specifies what type of browser window to create. The 'panel' and 'detached_panel' types create a popup unless the '--enable-panels' flag is set."
- },
- "state": {
- "$ref": "WindowState",
- "optional": true,
- "description": "The initial state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
- },
- "allowScriptsToClose": {
- "type": "boolean",
- "optional": true,
- "description": "Allow scripts to close the window."
- }
- },
- "optional": true
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "window",
- "$ref": "Window",
- "description": "Contains details about the created window.",
- "optional": true
- }
- ]
- }
- ]
- },
- {
- "name": "update",
- "type": "function",
- "description": "Updates the properties of a window. Specify only the properties that you want to change; unspecified properties will be left unchanged.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": -2
- },
- {
- "type": "object",
- "name": "updateInfo",
- "properties": {
- "left": {
- "type": "integer",
- "optional": true,
- "description": "The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels."
- },
- "top": {
- "type": "integer",
- "optional": true,
- "description": "The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels."
- },
- "width": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The width to resize the window to in pixels. This value is ignored for panels."
- },
- "height": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The height to resize the window to in pixels. This value is ignored for panels."
- },
- "focused": {
- "type": "boolean",
- "optional": true,
- "description": "If true, brings the window to the front. If false, brings the next window in the z-order to the front."
- },
- "drawAttention": {
- "type": "boolean",
- "optional": true,
- "description": "If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous draw attention request."
- },
- "state": {
- "$ref": "WindowState",
- "optional": true,
- "description": "The new state of the window. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'."
- }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "window",
- "$ref": "Window"
- }
- ]
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Removes (closes) a window, and all the tabs inside it.",
- "async": "callback",
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": 0
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onCreated",
- "type": "function",
- "description": "Fired when a window is created.",
- "filters": [
- {
- "name": "windowTypes",
- "type": "array",
- "items": { "$ref": "WindowType" },
- "description": "Conditions that the window's type being created must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- ],
- "parameters": [
- {
- "$ref": "Window",
- "name": "window",
- "description": "Details of the window that was created."
- }
- ]
- },
- {
- "name": "onRemoved",
- "type": "function",
- "description": "Fired when a window is removed (closed).",
- "filters": [
- {
- "name": "windowTypes",
- "type": "array",
- "items": { "$ref": "WindowType" },
- "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- ],
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": 0,
- "description": "ID of the removed window."
- }
- ]
- },
- {
- "name": "onFocusChanged",
- "type": "function",
- "description": "Fired when the currently focused window changes. Will be $(ref:windows.WINDOW_ID_NONE) if all browser windows have lost focus. Note: On some Linux window managers, WINDOW_ID_NONE will always be sent immediately preceding a switch from one browser window to another.",
- "filters": [
- {
- "name": "windowTypes",
- "type": "array",
- "items": { "$ref": "WindowType" },
- "description": "Conditions that the window's type being removed must satisfy. By default it will satisfy <code>['app', 'normal', 'panel', 'popup']</code>, with <code>'app'</code> and <code>'panel'</code> window types limited to the extension's own windows."
- }
- ],
- "parameters": [
- {
- "type": "integer",
- "name": "windowId",
- "minimum": -1,
- "description": "ID of the newly focused window."
- }
- ]
- }
- ]
- }
-]
diff --git a/application/basilisk/configure.in b/application/basilisk/configure.in
index 8527d218c6..4e7a063909 100644
--- a/application/basilisk/configure.in
+++ b/application/basilisk/configure.in
@@ -16,16 +16,3 @@ AC_SUBST(MC_BASILISK)
dnl Optional parts of the build.
-dnl ========================================================
-dnl = Disable WebExtensions
-dnl ========================================================
-MOZ_ARG_DISABLE_BOOL(webextensions,
-[ --disable-webextensions Disable WebExtensions],
- MOZ_WEBEXTENSIONS=,
- MOZ_WEBEXTENSIONS=1)
-
-if test -n "$MOZ_WEBEXTENSIONS"; then
- AC_DEFINE(MOZ_WEBEXTENSIONS)
-fi
-
-AC_SUBST(MOZ_WEBEXTENSIONS) \ No newline at end of file
diff --git a/application/basilisk/confvars.sh b/application/basilisk/confvars.sh
index cd18bdb946..2df7e826af 100644
--- a/application/basilisk/confvars.sh
+++ b/application/basilisk/confvars.sh
@@ -15,10 +15,6 @@ if test "$OS_ARCH" = "WINNT" -o \
MOZ_BUNDLED_FONTS=1
fi
-if test "$OS_ARCH" = "WINNT"; then
- MOZ_MAINTENANCE_SERVICE=
-fi
-
# For Basilisk we want to use 52.9.YYYY.MM.DD as MOZ_APP_VERSION in release
# builds so add-on developers have something to target while maintaining
# Firefox compatiblity.
@@ -55,7 +51,6 @@ MOZ_APP_STATIC_INI=1
MOZ_WEBGL_CONFORMANT=1
MOZ_JSDOWNLOADS=1
MOZ_WEBRTC=1
-MOZ_WEBEXTENSIONS=
MOZ_DEVTOOLS=1
MOZ_SERVICES_COMMON=1
MOZ_SERVICES_SYNC=1
diff --git a/application/basilisk/extensions/pdfjs/content/PdfJs.jsm b/application/basilisk/extensions/pdfjs/content/PdfJs.jsm
index b3d85436e7..7dc01c3988 100644
--- a/application/basilisk/extensions/pdfjs/content/PdfJs.jsm
+++ b/application/basilisk/extensions/pdfjs/content/PdfJs.jsm
@@ -52,23 +52,6 @@ XPCOMUtils.defineLazyModuleGetter(this, 'PdfjsChromeUtils',
'resource://pdf.js/PdfjsChromeUtils.jsm');
XPCOMUtils.defineLazyModuleGetter(this, 'PdfjsContentUtils',
'resource://pdf.js/PdfjsContentUtils.jsm');
-
-function getBoolPref(aPref, aDefaultValue) {
- try {
- return Services.prefs.getBoolPref(aPref);
- } catch (ex) {
- return aDefaultValue;
- }
-}
-
-function getIntPref(aPref, aDefaultValue) {
- try {
- return Services.prefs.getIntPref(aPref);
- } catch (ex) {
- return aDefaultValue;
- }
-}
-
function isDefaultHandler() {
if (Services.appinfo.processType === Services.appinfo.PROCESS_TYPE_CONTENT) {
return PdfjsContentUtils.isDefaultHandlerApp();
@@ -172,7 +155,7 @@ var PdfJs = {
}
this._initialized = true;
- if (!getBoolPref(PREF_DISABLED, true)) {
+ if (!Services.prefs.getBoolPref(PREF_DISABLED, true)) {
this._migrate();
}
@@ -209,7 +192,7 @@ var PdfJs = {
_migrate: function migrate() {
const VERSION = 2;
- var currentVersion = getIntPref(PREF_MIGRATION_VERSION, 0);
+ var currentVersion = Services.prefs.getIntPref(PREF_MIGRATION_VERSION, 0);
if (currentVersion >= VERSION) {
return;
}
@@ -284,7 +267,7 @@ var PdfJs = {
* @return {boolean} Whether or not it's enabled.
*/
get enabled() {
- var disabled = getBoolPref(PREF_DISABLED, true);
+ var disabled = Services.prefs.getBoolPref(PREF_DISABLED, true);
if (disabled) {
return false;
}
diff --git a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
index 5e337bbc5a..b5b21f2147 100644
--- a/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
+++ b/application/basilisk/extensions/pdfjs/content/PdfStreamConverter.jsm
@@ -78,22 +78,6 @@ function getFindBar(domWindow) {
}
}
-function getBoolPref(pref, def) {
- try {
- return Services.prefs.getBoolPref(pref);
- } catch (ex) {
- return def;
- }
-}
-
-function getIntPref(pref, def) {
- try {
- return Services.prefs.getIntPref(pref);
- } catch (ex) {
- return def;
- }
-}
-
function getStringPref(pref, def) {
try {
return Services.prefs.getComplexValue(pref, Ci.nsISupportsString).data;
@@ -103,7 +87,7 @@ function getStringPref(pref, def) {
}
function log(aMsg) {
- if (!getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false)) {
+ if (!Services.prefs.getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false)) {
return;
}
var msg = 'PdfStreamConverter.js: ' + (aMsg.join ? aMsg.join('') : aMsg);
@@ -359,17 +343,17 @@ ChromeActions.prototype = {
return !!findBar && ('updateControlState' in findBar);
},
supportsDocumentFonts: function() {
- var prefBrowser = getIntPref('browser.display.use_document_fonts', 1);
- var prefGfx = getBoolPref('gfx.downloadable_fonts.enabled', true);
+ var prefBrowser = Services.prefs.getIntPref('browser.display.use_document_fonts', 1);
+ var prefGfx = Services.prefs.getBoolPref('gfx.downloadable_fonts.enabled', true);
return (!!prefBrowser && prefGfx);
},
supportsDocumentColors: function() {
- return getIntPref('browser.display.document_color_use', 0) !== 2;
+ return Services.prefs.getIntPref('browser.display.document_color_use', 0) !== 2;
},
supportedMouseWheelZoomModifierKeys: function() {
return {
- ctrlKey: getIntPref('mousewheel.with_control.action', 3) === 3,
- metaKey: getIntPref('mousewheel.with_meta.action', 1) === 3,
+ ctrlKey: Services.prefs.getIntPref('mousewheel.with_control.action', 3) === 3,
+ metaKey: Services.prefs.getIntPref('mousewheel.with_meta.action', 1) === 3,
};
},
reportTelemetry: function (data) {
@@ -531,10 +515,10 @@ ChromeActions.prototype = {
prefName = (PREF_PREFIX + '.' + key);
switch (typeof prefValue) {
case 'boolean':
- currentPrefs[key] = getBoolPref(prefName, prefValue);
+ currentPrefs[key] = Services.prefs.getBoolPref(prefName, prefValue);
break;
case 'number':
- currentPrefs[key] = getIntPref(prefName, prefValue);
+ currentPrefs[key] = Services.prefs.getIntPref(prefName, prefValue);
break;
case 'string':
currentPrefs[key] = getStringPref(prefName, prefValue);
@@ -921,16 +905,16 @@ PdfStreamConverter.prototype = {
} catch (e) {}
var hash = aRequest.URI.ref;
- var isPDFBugEnabled = getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false);
+ var isPDFBugEnabled = Services.prefs.getBoolPref(PREF_PREFIX + '.pdfBugEnabled', false);
rangeRequest = contentEncoding === 'identity' &&
acceptRanges === 'bytes' &&
aRequest.contentLength >= 0 &&
- !getBoolPref(PREF_PREFIX + '.disableRange', false) &&
+ !Services.prefs.getBoolPref(PREF_PREFIX + '.disableRange', false) &&
(!isPDFBugEnabled ||
hash.toLowerCase().indexOf('disablerange=true') < 0);
streamRequest = contentEncoding === 'identity' &&
aRequest.contentLength >= 0 &&
- !getBoolPref(PREF_PREFIX + '.disableStream', false) &&
+ !Services.prefs.getBoolPref(PREF_PREFIX + '.disableStream', false) &&
(!isPDFBugEnabled ||
hash.toLowerCase().indexOf('disablestream=true') < 0);
}
diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in
index cebcb67960..4ea50408af 100644
--- a/application/basilisk/installer/package-manifest.in
+++ b/application/basilisk/installer/package-manifest.in
@@ -397,15 +397,9 @@
@RESPATH@/components/addonManager.js
@RESPATH@/components/amContentHandler.js
@RESPATH@/components/amInstallTrigger.js
-#ifdef MOZ_WEBEXTENSIONS
-@RESPATH@/components/amWebAPI.js
-#endif
@RESPATH@/components/amWebInstallListener.js
@RESPATH@/components/nsBlocklistService.js
@RESPATH@/components/blocklist.manifest
-#ifdef MOZ_WEBEXTENSIONS
-@RESPATH@/components/nsBlocklistServiceContent.js
-#endif
#ifdef MOZ_UPDATER
@RESPATH@/components/nsUpdateService.manifest
@RESPATH@/components/nsUpdateService.js
@@ -554,12 +548,6 @@
@RESPATH@/components/TestInterfaceJSMaplike.js
#endif
-#ifdef MOZ_WEBEXTENSIONS
-; [Extensions]
-@RESPATH@/components/extensions-toolkit.manifest
-@RESPATH@/browser/components/extensions-browser.manifest
-#endif
-
; Modules
@RESPATH@/browser/modules/*
@RESPATH@/modules/*
@@ -721,13 +709,6 @@
@RESPATH@/components/pipnss.xpt
@RESPATH@/components/pippki.xpt
-; for Solaris SPARC
-#ifdef SOLARIS
-bin/libfreebl_32fpu_3.so
-bin/libfreebl_32int_3.so
-bin/libfreebl_32int64_3.so
-#endif
-
; [Updater]
;
#ifdef MOZ_UPDATER
@@ -738,13 +719,6 @@ bin/libfreebl_32int64_3.so
#endif
#endif
-; [MaintenanceService]
-;
-#ifdef MOZ_MAINTENANCE_SERVICE
-@BINPATH@/maintenanceservice.exe
-@BINPATH@/maintenanceservice_installer.exe
-#endif
-
@RESPATH@/components/dom_audiochannel.xpt
; Shutdown Terminator
diff --git a/application/basilisk/installer/windows/Makefile.in b/application/basilisk/installer/windows/Makefile.in
index bab6ded1a1..5326ab8971 100644
--- a/application/basilisk/installer/windows/Makefile.in
+++ b/application/basilisk/installer/windows/Makefile.in
@@ -14,12 +14,6 @@ INSTALLER_FILES = \
nsis/shared.nsh \
$(NULL)
-ifdef MOZ_MAINTENANCE_SERVICE
-INSTALLER_FILES += \
- nsis/maintenanceservice_installer.nsi \
- $(NULL)
-endif
-
BRANDING_FILES = \
branding.nsi \
appname.bmp \
diff --git a/application/basilisk/installer/windows/nsis/defines.nsi.in b/application/basilisk/installer/windows/nsis/defines.nsi.in
index dbb58ca33a..8981bbde8f 100644
--- a/application/basilisk/installer/windows/nsis/defines.nsi.in
+++ b/application/basilisk/installer/windows/nsis/defines.nsi.in
@@ -51,10 +51,6 @@
!define MinSupportedCPU "SSE2"
-#ifdef MOZ_MAINTENANCE_SERVICE
-!define MOZ_MAINTENANCE_SERVICE
-#endif
-
# File details shared by both the installer and uninstaller
VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"
diff --git a/application/basilisk/installer/windows/nsis/installer.nsi b/application/basilisk/installer/windows/nsis/installer.nsi
index 994c092790..6b4b5ab9ac 100644
--- a/application/basilisk/installer/windows/nsis/installer.nsi
+++ b/application/basilisk/installer/windows/nsis/installer.nsi
@@ -165,11 +165,6 @@ Page custom preOptions leaveOptions
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
-; Custom Components Page
-!ifdef MOZ_MAINTENANCE_SERVICE
-Page custom preComponents leaveComponents
-!endif
-
; Custom Shortcuts Page
Page custom preShortcuts leaveShortcuts
@@ -427,41 +422,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndIf}
-!ifdef MOZ_MAINTENANCE_SERVICE
- ; If the maintenance service page was displayed then a value was already
- ; explicitly selected for installing the maintenance service and
- ; and so InstallMaintenanceService will already be 0 or 1.
- ; If the maintenance service page was not displayed then
- ; InstallMaintenanceService will be equal to "".
- ${If} $InstallMaintenanceService == ""
- Call IsUserAdmin
- Pop $R0
- ${If} $R0 == "true"
- ; Only proceed if we have HKLM write access
- ${AndIf} $TmpVal == "HKLM"
- ; On Windows < XP SP3 we do not install the maintenance service.
- ${If} ${IsWinXP}
- ${AndIf} ${AtMostServicePack} 2
- StrCpy $InstallMaintenanceService "0"
- ${Else}
- ; The user is an admin, so we should default to installing the service.
- StrCpy $InstallMaintenanceService "1"
- ${EndIf}
- ${Else}
- ; The user is not admin, so we can't install the service.
- StrCpy $InstallMaintenanceService "0"
- ${EndIf}
- ${EndIf}
-
- ${If} $InstallMaintenanceService == "1"
- ; The user wants to install the maintenance service, so execute
- ; the pre-packaged maintenance service installer.
- ; This option can only be turned on if the user is an admin so there
- ; is no need to use ExecShell w/ verb runas to enforce elevated.
- nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
- ${EndIf}
-!endif
-
; These need special handling on uninstall since they may be overwritten by
; an install into a different location.
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
@@ -578,13 +538,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndUnless}
${EndIf}
-
-!ifdef MOZ_MAINTENANCE_SERVICE
- ${If} $TmpVal == "HKLM"
- ; Add the registry keys for allowed certificates.
- ${AddMaintCertKeys}
- ${EndIf}
-!endif
SectionEnd
; Cleanup operations to perform at the end of the installation.
@@ -948,59 +901,6 @@ Function leaveShortcuts
${EndIf}
FunctionEnd
-!ifdef MOZ_MAINTENANCE_SERVICE
-Function preComponents
- ; If the service already exists, don't show this page
- ServicesHelper::IsInstalled "MozillaMaintenance"
- Pop $R9
- ${If} $R9 == 1
- ; The service already exists so don't show this page.
- Abort
- ${EndIf}
-
- ; On Windows < XP SP3 we do not install the maintenance service.
- ${If} ${IsWinXP}
- ${AndIf} ${AtMostServicePack} 2
- Abort
- ${EndIf}
-
- ; Don't show the custom components page if the
- ; user is not an admin
- Call IsUserAdmin
- Pop $R9
- ${If} $R9 != "true"
- Abort
- ${EndIf}
-
- ; Only show the maintenance service page if we have write access to HKLM
- ClearErrors
- WriteRegStr HKLM "Software\Mozilla" \
- "${BrandShortName}InstallerTest" "Write Test"
- ${If} ${Errors}
- ClearErrors
- Abort
- ${Else}
- DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
- ${EndIf}
-
- StrCpy $PageName "Components"
- ${CheckCustomCommon}
- !insertmacro MUI_HEADER_TEXT "$(COMPONENTS_PAGE_TITLE)" "$(COMPONENTS_PAGE_SUBTITLE)"
- !insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
-FunctionEnd
-
-Function leaveComponents
- ${MUI_INSTALLOPTIONS_READ} $0 "components.ini" "Settings" "State"
- ${If} $0 != 0
- Abort
- ${EndIf}
- ${MUI_INSTALLOPTIONS_READ} $InstallMaintenanceService "components.ini" "Field 2" "State"
- ${If} $InstallType == ${INSTALLTYPE_CUSTOM}
- Call CheckExistingInstall
- ${EndIf}
-FunctionEnd
-!endif
-
Function preSummary
StrCpy $PageName "Summary"
; Setup the summary.ini file for the Custom Summary Page
@@ -1180,7 +1080,6 @@ Function .onInit
!insertmacro InitInstallOptionsFile "options.ini"
!insertmacro InitInstallOptionsFile "shortcuts.ini"
- !insertmacro InitInstallOptionsFile "components.ini"
!insertmacro InitInstallOptionsFile "summary.ini"
WriteINIStr "$PLUGINSDIR\options.ini" "Settings" NumFields "5"
@@ -1255,36 +1154,6 @@ Function .onInit
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" Bottom "50"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" State "1"
- ; Don't offer to install the quick launch shortcut on Windows 7
- ${Unless} ${AtLeastWin7}
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Type "checkbox"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Text "$(ICONS_QUICKLAUNCH)"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Left "0"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Right "-1"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Top "60"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Bottom "70"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" State "1"
- ${EndUnless}
-
- ; Setup the components.ini file for the Components Page
- WriteINIStr "$PLUGINSDIR\components.ini" "Settings" NumFields "2"
-
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Type "label"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Text "$(OPTIONAL_COMPONENTS_DESC)"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Left "0"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Right "-1"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Top "5"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Bottom "25"
-
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Type "checkbox"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Text "$(MAINTENANCE_SERVICE_CHECKBOX_DESC)"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Left "0"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Right "-1"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Top "27"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Bottom "37"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" State "1"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Flags "GROUP"
-
; There must always be a core directory.
${GetSize} "$EXEDIR\core\" "/S=0K" $R5 $R7 $R8
SectionSetSize ${APP_IDX} $R5
diff --git a/application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi b/application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi
deleted file mode 100644
index 1f73bac6a0..0000000000
--- a/application/basilisk/installer/windows/nsis/maintenanceservice_installer.nsi
+++ /dev/null
@@ -1,332 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
-!verbose 3
-
-; 7-Zip provides better compression than the lzma from NSIS so we add the files
-; uncompressed and use 7-Zip to create a SFX archive of it
-SetDatablockOptimize on
-SetCompress off
-CRCCheck on
-
-RequestExecutionLevel admin
-
-; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
-; be removed after we require NSIS 3.0a2 or greater.
-!ifdef NSIS_PACKEDVERSION
- Unicode true
- ManifestSupportedOS all
- ManifestDPIAware true
-!endif
-
-!addplugindir ./
-
-; Variables
-Var TempMaintServiceName
-Var BrandFullNameDA
-Var BrandFullName
-
-; Other included files may depend upon these includes!
-; The following includes are provided by NSIS.
-!include FileFunc.nsh
-!include LogicLib.nsh
-!include MUI.nsh
-!include WinMessages.nsh
-!include WinVer.nsh
-!include WordFunc.nsh
-
-!insertmacro GetOptions
-!insertmacro GetParameters
-!insertmacro GetSize
-
-; The test slaves use this fallback key to run tests.
-; And anyone that wants to run tests themselves should already have
-; this installed.
-!define FallbackKey \
- "SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
-
-!define CompanyName "Mozilla Corporation"
-!define BrandFullNameInternal ""
-
-; The following includes are custom.
-!include defines.nsi
-; We keep defines.nsi defined so that we get other things like
-; the version number, but we redefine BrandFullName
-!define MaintFullName "Mozilla Maintenance Service"
-!undef BrandFullName
-!define BrandFullName "${MaintFullName}"
-
-!include common.nsh
-!include locales.nsi
-
-VIAddVersionKey "FileDescription" "${MaintFullName} Installer"
-VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe"
-
-Name "${MaintFullName}"
-OutFile "maintenanceservice_installer.exe"
-
-; Get installation folder from registry if available
-InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
-
-SetOverwrite on
-
-; serviceinstall.cpp also uses this key, in case the path is changed, update
-; there too.
-!define MaintUninstallKey \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
-
-; Always install into the 32-bit location even if we have a 64-bit build.
-; This is because we use only 1 service for all Basilisk channels.
-; Allow either x86 and x64 builds to exist at this location, depending on
-; what is the latest build.
-InstallDir "$PROGRAMFILES32\${MaintFullName}\"
-ShowUnInstDetails nevershow
-
-################################################################################
-# Modern User Interface - MUI
-
-!define MUI_ICON setup.ico
-!define MUI_UNICON setup.ico
-!define MUI_WELCOMEPAGE_TITLE_3LINES
-!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
-
-;Interface Settings
-!define MUI_ABORTWARNING
-
-; Uninstaller Pages
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
-################################################################################
-# Language
-
-!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
-!verbose push
-!verbose 3
-!include "overrideLocale.nsh"
-!include "customLocale.nsh"
-!verbose pop
-
-; Set this after the locale files to override it if it is in the locale
-; using " " for BrandingText will hide the "Nullsoft Install System..." branding
-BrandingText " "
-
-Function .onInit
- ; Remove the current exe directory from the search order.
- ; This only effects LoadLibrary calls and not implicitly loaded DLLs.
- System::Call 'kernel32::SetDllDirectoryW(w "")'
-
- SetSilent silent
-
- ${Unless} ${AtLeastWin7}
- Abort
- ${EndUnless}
-FunctionEnd
-
-Function un.onInit
- ; Remove the current exe directory from the search order.
- ; This only effects LoadLibrary calls and not implicitly loaded DLLs.
- System::Call 'kernel32::SetDllDirectoryW(w "")'
-
-; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
-; removed after we require NSIS 3.0a2 or greater.
-!ifndef NSIS_PACKEDVERSION
- ${If} ${AtLeastWinVista}
- System::Call 'user32::SetProcessDPIAware()'
- ${EndIf}
-!endif
-
- StrCpy $BrandFullNameDA "${MaintFullName}"
- StrCpy $BrandFullName "${MaintFullName}"
-FunctionEnd
-
-Section "MaintenanceService"
- AllowSkipFiles off
-
- CreateDirectory $INSTDIR
- SetOutPath $INSTDIR
-
- ; If the service already exists, then it will be stopped when upgrading it
- ; via the maintenanceservice_tmp.exe command executed below.
- ; The maintenanceservice_tmp.exe command will rename the file to
- ; maintenanceservice.exe if maintenanceservice_tmp.exe is newer.
- ; If the service does not exist yet, we install it and drop the file on
- ; disk as maintenanceservice.exe directly.
- StrCpy $TempMaintServiceName "maintenanceservice.exe"
- IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists
- StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
- skipAlreadyExists:
-
- ; We always write out a copy and then decide whether to install it or
- ; not via calling its 'install' cmdline which works by version comparison.
- CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
-
- ; The updater.ini file is only used when performing an install or upgrade,
- ; and only if that install or upgrade is successful. If an old updater.ini
- ; happened to be copied into the maintenance service installation directory
- ; but the service was not newer, the updater.ini file would be unused.
- ; It is used to fill the description of the service on success.
- CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini"
-
- ; Install the application maintenance service.
- ; If a service already exists, the command line parameter will stop the
- ; service and only install itself if it is newer than the already installed
- ; service. If successful it will remove the old maintenanceservice.exe
- ; and replace it with maintenanceservice_tmp.exe.
- ClearErrors
- ${GetParameters} $0
- ${GetOptions} "$0" "/Upgrade" $0
- ${If} ${Errors}
- ExecWait '"$INSTDIR\$TempMaintServiceName" install'
- ${Else}
- ; The upgrade cmdline is the same as install except
- ; It will fail if the service isn't already installed.
- ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade'
- ${EndIf}
-
- WriteUninstaller "$INSTDIR\Uninstall.exe"
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}"
- WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \
- '"$INSTDIR\uninstall.exe"'
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \
- "$INSTDIR\Uninstall.exe,0"
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}"
- WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla"
- WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}"
- WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1
- ${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4
- WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2
-
- ; Write out that a maintenance service was attempted.
- ; We do this because on upgrades we will check this value and we only
- ; want to install once on the first upgrade to maintenance service.
- ; Also write out that we are currently installed, preferences will check
- ; this value to determine if we should show the service update pref.
- ; Since the Maintenance service can be installed either x86 or x64,
- ; always use the 64-bit registry for checking if an attempt was made.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
-
- ; Included here for debug purposes only.
- ; These keys are used to bypass the installation dir is a valid installation
- ; check from the service so that tests can be run.
- ; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
- ; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-SectionEnd
-
-; By renaming before deleting we improve things slightly in case
-; there is a file in use error. In this case a new install can happen.
-Function un.RenameDelete
- Pop $9
- ; If the .moz-delete file already exists previously, delete it
- ; If it doesn't exist, the call is ignored.
- ; We don't need to pass /REBOOTOK here since it was already marked that way
- ; if it exists.
- Delete "$9.moz-delete"
- Rename "$9" "$9.moz-delete"
- ${If} ${Errors}
- Delete /REBOOTOK "$9"
- ${Else}
- Delete /REBOOTOK "$9.moz-delete"
- ${EndIf}
- ClearErrors
-FunctionEnd
-
-Section "Uninstall"
- ; Delete the service so that no updates will be attempted
- ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall'
-
- Push "$INSTDIR\updater.ini"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice.exe"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice_tmp.exe"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice.old"
- Call un.RenameDelete
- Push "$INSTDIR\Uninstall.exe"
- Call un.RenameDelete
- Push "$INSTDIR\update\updater.ini"
- Call un.RenameDelete
- Push "$INSTDIR\update\updater.exe"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-1.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-2.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-3.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-4.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-5.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-6.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-7.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-8.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-9.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-10.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-install.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-uninstall.log"
- Call un.RenameDelete
- SetShellVarContext all
- Push "$APPDATA\Mozilla\logs\maintenanceservice.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log"
- Call un.RenameDelete
- RMDir /REBOOTOK "$APPDATA\Mozilla\logs"
- RMDir /REBOOTOK "$APPDATA\Mozilla"
- RMDir /REBOOTOK "$INSTDIR\logs"
- RMDir /REBOOTOK "$INSTDIR\update"
- RMDir /REBOOTOK "$INSTDIR"
-
- DeleteRegKey HKLM "${MaintUninstallKey}"
-
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
- DeleteRegKey HKLM "${FallbackKey}\"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-SectionEnd
diff --git a/application/basilisk/installer/windows/nsis/shared.nsh b/application/basilisk/installer/windows/nsis/shared.nsh
index fb2239d241..f5bbef389c 100644
--- a/application/basilisk/installer/windows/nsis/shared.nsh
+++ b/application/basilisk/installer/windows/nsis/shared.nsh
@@ -124,51 +124,6 @@
${FixDistributionsINI}
RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}"
-
-!ifdef MOZ_MAINTENANCE_SERVICE
- Call IsUserAdmin
- Pop $R0
- ${If} $R0 == "true"
- ; Only proceed if we have HKLM write access
- ${AndIf} $TmpVal == "HKLM"
- ; On Windows 2000 we do not install the maintenance service.
- ${AndIf} ${AtLeastWinXP}
- ; We check to see if the maintenance service install was already attempted.
- ; Since the Maintenance service can be installed either x86 or x64,
- ; always use the 64-bit registry for checking if an attempt was made.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted"
- ClearErrors
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-
- ; Add the registry keys for allowed certificates.
- ${AddMaintCertKeys}
-
- ; If the maintenance service is already installed, do nothing.
- ; The maintenance service will launch:
- ; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance
- ; service if necessary. If the update was done from updater.exe without
- ; the service (i.e. service is failing), updater.exe will do the update of
- ; the service. The reasons we do not do it here is because we don't want
- ; to have to prompt for limited user accounts when the service isn't used
- ; and we currently call the PostUpdate twice, once for the user and once
- ; for the SYSTEM account. Also, this would stop the maintenance service
- ; and we need a return result back to the service when run that way.
- ${If} $5 == ""
- ; An install of maintenance service was never attempted.
- ; We know we are an Admin and that we have write access into HKLM
- ; based on the above checks, so attempt to just run the EXE.
- ; In the worst case, in case there is some edge case with the
- ; IsAdmin check and the permissions check, the maintenance service
- ; will just fail to be attempted to be installed.
- nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
- ${EndIf}
- ${EndIf}
-!endif
!macroend
!define PostUpdate "!insertmacro PostUpdate"
@@ -720,54 +675,6 @@
!macroend
!define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers"
-!ifdef MOZ_MAINTENANCE_SERVICE
-; Adds maintenance service certificate keys for the install dir.
-; For the cert to work, it must also be signed by a trusted cert for the user.
-!macro AddMaintCertKeys
- Push $R0
- ; Allow main Mozilla cert information for updates
- ; This call will push the needed key on the stack
- ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
- Pop $R0
- ${If} $R0 != ""
- ; More than one certificate can be specified in a different subfolder
- ; for example: $R0\1, but each individual binary can be signed
- ; with at most one certificate. A fallback certificate can only be used
- ; if the binary is replaced with a different certificate.
- ; We always use the 64bit registry for certs.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
-
- ; PrefetchProcessName was originally used to experiment with deleting
- ; Windows prefetch as a speed optimization. It is no longer used though.
- DeleteRegValue HKLM "$R0" "prefetchProcessName"
-
- ; Setting the Attempted value will ensure that a new Maintenance Service
- ; install will never be attempted again after this from updates. The value
- ; is used only to see if updates should attempt new service installs.
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
-
- ; These values associate the allowed certificates for the current
- ; installation.
- WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}"
- WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}"
- ; These values associate the allowed certificates for the previous
- ; installation, so that we can update from it cleanly using the
- ; old updater.exe (which will still have this signature).
- WriteRegStr HKLM "$R0\1" "name" "${CERTIFICATE_NAME_PREVIOUS}"
- WriteRegStr HKLM "$R0\1" "issuer" "${CERTIFICATE_ISSUER_PREVIOUS}"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
- ClearErrors
- ${EndIf}
- ; Restore the previously used value back
- Pop $R0
-!macroend
-!define AddMaintCertKeys "!insertmacro AddMaintCertKeys"
-!endif
-
; Removes various registry entries for reasons noted below (does not use SHCTX).
!macro RemoveDeprecatedKeys
StrCpy $0 "SOFTWARE\Classes"
diff --git a/application/basilisk/installer/windows/nsis/uninstaller.nsi b/application/basilisk/installer/windows/nsis/uninstaller.nsi
index 87f4d838af..c556b0a900 100644
--- a/application/basilisk/installer/windows/nsis/uninstaller.nsi
+++ b/application/basilisk/installer/windows/nsis/uninstaller.nsi
@@ -450,24 +450,6 @@ Section "Uninstall"
; uninstalls of Basilisk-release with reinstalls of Basilisk-release, for example.
WriteRegStr HKCU "Software\Mozilla\Basilisk" "Uninstalled-${UpdateChannel}" "True"
-!ifdef MOZ_MAINTENANCE_SERVICE
- ; Get the path the allowed cert is at and remove it
- ; Keep this block of code last since it modfies the reg view
- ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
- Pop $MaintCertKey
- ${If} $MaintCertKey != ""
- ; Always use the 64bit registry for certs on 64bit systems.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- DeleteRegKey HKLM "$MaintCertKey"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
- ${EndIf}
- Call un.UninstallServiceIfNotUsed
-!endif
-
${un.IsFirewallSvcRunning}
Pop $0
${If} "$0" == "true"
diff --git a/application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd b/application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd
deleted file mode 100644
index 23447add18..0000000000
--- a/application/basilisk/locales/en-US/chrome/browser/aboutRobots.dtd
+++ /dev/null
@@ -1,29 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!-- These strings are used in the about:robots page, which ties in with the
- robots theme used in the Firefox 3 Beta 2/3 first run pages.
- They're just meant to be fun and whimsical, with references to some geeky
- but well-known robots in movies and books. Be creative with translations! -->
-
-<!-- Nonsense line from the movie "The Day The Earth Stood Still". No translation needed. -->
-<!ENTITY robots.pagetitle "Gort! Klaatu barada nikto!">
-<!-- Movie: Logan's Run... Box (cybog): "Welcome Humans! I am ready for you." -->
-<!ENTITY robots.errorTitleText "Welcome Humans!">
-<!-- Movie: The Day The Earth Stood Still. Spoken by Klaatu. -->
-<!ENTITY robots.errorShortDescText "We have come to visit you in peace and with goodwill!">
-<!-- Various books by Isaac Asimov. http://en.wikipedia.org/wiki/Three_Laws_of_Robotics -->
-<!ENTITY robots.errorLongDesc1 "Robots may not injure a human being or, through inaction, allow a human being to come to harm.">
-<!-- Movie: Blade Runner. Batty: "I've seen things you people wouldn’t believe..." -->
-<!ENTITY robots.errorLongDesc2 "Robots have seen things you people wouldn’t believe.">
-<!-- Book: Hitchhiker’s Guide To The Galaxy. What the Sirius Cybernetics Corporation calls robots. -->
-<!ENTITY robots.errorLongDesc3 "Robots are Your Plastic Pal Who’s Fun To Be With.">
-<!-- TV: Futurama. Bender's first line is "Bite my shiny metal ass." -->
-<!ENTITY robots.errorLongDesc4 "Robots have shiny metal posteriors which should not be bitten.">
-<!-- TV: Battlestar Galactica (2004 series). From the opening text. -->
-<!ENTITY robots.errorTrailerDescText "And they have a plan.">
-<!-- TV: Battlestar Galactica (2004 series). Common expletive referring to Cylons. -->
-<!ENTITY robots.imgtitle "Frakkin' Toasters">
-<!-- Book: Hitchhiker's Guide To The Galaxy. Arthur presses a button and it warns him. -->
-<!ENTITY robots.dontpress "Please do not press this button again.">
diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.properties b/application/basilisk/locales/en-US/chrome/browser/browser.properties
index f1c39839b2..abec30bf19 100644
--- a/application/basilisk/locales/en-US/chrome/browser/browser.properties
+++ b/application/basilisk/locales/en-US/chrome/browser/browser.properties
@@ -638,37 +638,6 @@ e10s.accessibilityNotice.acceptButton.accesskey = O
e10s.accessibilityNotice.enableAndRestart.label = Enable (Requires Restart)
e10s.accessibilityNotice.enableAndRestart.accesskey = E
-# LOCALIZATION NOTE (userContextPersonal.label,
-# userContextWork.label,
-# userContextShopping.label,
-# userContextBanking.label,
-# userContextNone.label):
-# These strings specify the four predefined contexts included in support of the
-# Contextual Identity / Containers project. Each context is meant to represent
-# the context that the user is in when interacting with the site. Different
-# contexts will store cookies and other information from those sites in
-# different, isolated locations. You can enable the feature by typing
-# about:config in the URL bar and changing privacy.userContext.enabled to true.
-# Once enabled, you can open a new tab in a specific context by clicking
-# File > New Container Tab > (1 of 4 contexts). Once opened, you will see these
-# strings on the right-hand side of the URL bar.
-userContextPersonal.label = Personal
-userContextWork.label = Work
-userContextBanking.label = Banking
-userContextShopping.label = Shopping
-userContextNone.label = No Container
-
-userContextPersonal.accesskey = P
-userContextWork.accesskey = W
-userContextBanking.accesskey = B
-userContextShopping.accesskey = S
-userContextNone.accesskey = N
-
-userContext.aboutPage.label = Manage containers
-userContext.aboutPage.accesskey = O
-
-userContextOpenLink.label = Open Link in New %S Tab
-
muteTab.label = Mute Tab
muteTab.accesskey = M
unmuteTab.label = Unmute Tab
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd
deleted file mode 100644
index 58eca1ace8..0000000000
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.dtd
+++ /dev/null
@@ -1,24 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!ENTITY label.label "Name">
-<!ENTITY addButton.label "Add New Container">
-<!ENTITY addButton.accesskey "A">
-<!-- &#171; is &laquo; however it's not defined in XML -->
-<!ENTITY backLink.label "&#171; Go Back to Privacy">
-
-<!ENTITY window.title "Add New Container">
-<!ENTITY window.width "45em">
-
-<!ENTITY name.label "Name:">
-<!ENTITY name.accesskey "N">
-<!ENTITY icon.label "Icon:">
-<!ENTITY icon.accesskey "I">
-<!ENTITY color.label "Color:">
-<!ENTITY color.accesskey "o">
-<!ENTITY windowClose.key "w">
-
-<!ENTITY button.ok.label "Done">
-<!ENTITY button.ok.accesskey "D">
-
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties
deleted file mode 100644
index 9866a06595..0000000000
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/containers.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-containers.removeButton = Remove
-containers.preferencesButton = Preferences
-containers.colorHeading = Color:
-containers.labelMinWidth = 4rem
-containers.nameLabel = Name:
-containers.namePlaceholder = Enter a container name
-containers.submitButton = Done
-containers.iconHeading = Icon:
-containers.updateContainerTitle = %S Container Preferences
-
-containers.blue.label = Blue
-containers.turquoise.label = Turquoise
-containers.green.label = Green
-containers.yellow.label = Yellow
-containers.orange.label = Orange
-containers.red.label = Red
-containers.pink.label = Pink
-containers.purple.label = Purple
-
-containers.fingerprint.label = Fingerprint
-containers.briefcase.label = Briefcase
-# LOCALIZATION NOTE (containers.dollar.label)
-# String represents a money sign but currently uses a dollar sign so don't change to local currency
-# See Bug 1291672
-containers.dollar.label = Dollar sign
-containers.cart.label = Shopping cart
-containers.circle.label = Dot
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd
index 5e7df9609a..c83331328e 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/cookies.dtd
@@ -14,7 +14,6 @@
<!ENTITY props.path.label "Path:">
<!ENTITY props.secure.label "Send For:">
<!ENTITY props.expires.label "Expires:">
-<!ENTITY props.container.label "Container:">
<!ENTITY window.title "Cookies">
<!ENTITY windowClose.key "w">
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd
index 7702c8c517..353e627d7e 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.dtd
@@ -18,7 +18,6 @@
<!ENTITY paneContent.title "Content">
<!ENTITY paneApplications.title "Applications">
<!ENTITY panePrivacy.title "Privacy">
-<!ENTITY paneContainers.title "Container Tabs">
<!ENTITY paneSecurity.title "Security">
<!ENTITY paneAdvanced.title "Advanced">
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties
index 84fac427d4..c0b7e1be01 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -191,17 +191,3 @@ revertNoRestartButton=Revert
restartNow=Restart Now
restartLater=Restart Later
-
-disableContainersAlertTitle=Close All Container Tabs?
-
-# LOCALIZATION NOTE (disableContainersMsg): Semi-colon list of plural forms.
-# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #S is the number of container tabs
-disableContainersMsg=If you disable Container Tabs now, #S container tab will be closed. Are you sure you want to disable Container Tabs?;If you disable Container Tabs now, #S container tabs will be closed. Are you sure you want to disable Container Tabs?
-
-# LOCALIZATION NOTE (disableContainersOkButton): Semi-colon list of plural forms.
-# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
-# #S is the number of container tabs
-disableContainersOkButton=Close #S Container Tab;Close #S Container Tabs
-
-disableContainersButton2=Keep enabled
diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
index f743c4040f..8820e92abf 100644
--- a/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
+++ b/application/basilisk/locales/en-US/chrome/browser/preferences/privacy.dtd
@@ -110,10 +110,3 @@
<!ENTITY clearOnCloseSettings.label "Settings…">
<!ENTITY clearOnCloseSettings.accesskey "t">
-
-<!ENTITY browserContainersHeader.label "Container Tabs">
-<!ENTITY browserContainersLearnMore.label "Learn more">
-<!ENTITY browserContainersEnabled.label "Enable Container Tabs">
-<!ENTITY browserContainersEnabled.accesskey "n">
-<!ENTITY browserContainersSettings.label "Settings…">
-<!ENTITY browserContainersSettings.accesskey "i">
diff --git a/application/basilisk/locales/en-US/installer/custom.properties b/application/basilisk/locales/en-US/installer/custom.properties
index 4abb1a550a..0f86f55283 100644
--- a/application/basilisk/locales/en-US/installer/custom.properties
+++ b/application/basilisk/locales/en-US/installer/custom.properties
@@ -25,10 +25,6 @@ OPTIONS_PAGE_TITLE=Setup Type
OPTIONS_PAGE_SUBTITLE=Choose setup options
SHORTCUTS_PAGE_TITLE=Set Up Shortcuts
SHORTCUTS_PAGE_SUBTITLE=Create Program Icons
-COMPONENTS_PAGE_TITLE=Set Up Optional Components
-COMPONENTS_PAGE_SUBTITLE=Optional Recommended Components
-OPTIONAL_COMPONENTS_DESC=The Maintenance Service will allow you to update $BrandShortName silently in the background.
-MAINTENANCE_SERVICE_CHECKBOX_DESC=Install &Maintenance Service
SUMMARY_PAGE_TITLE=Summary
SUMMARY_PAGE_SUBTITLE=Ready to start installing $BrandShortName
SUMMARY_INSTALLED_TO=$BrandShortName will be installed to the following location:
diff --git a/application/basilisk/locales/jar.mn b/application/basilisk/locales/jar.mn
index 5c5a72a1fb..1a9b7f3155 100644
--- a/application/basilisk/locales/jar.mn
+++ b/application/basilisk/locales/jar.mn
@@ -11,7 +11,6 @@
locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd)
locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd)
locale/browser/aboutPrivateBrowsing.properties (%chrome/browser/aboutPrivateBrowsing.properties)
- locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd)
locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd)
locale/browser/accounts.properties (%chrome/browser/accounts.properties)
#ifdef MOZ_SERVICES_HEALTHREPORT
@@ -79,10 +78,8 @@
locale/browser/preferences/permissions.dtd (%chrome/browser/preferences/permissions.dtd)
locale/browser/preferences/preferences.dtd (%chrome/browser/preferences/preferences.dtd)
locale/browser/preferences/preferences.properties (%chrome/browser/preferences/preferences.properties)
- locale/browser/preferences/containers.properties (%chrome/browser/preferences/containers.properties)
* locale/browser/preferences/privacy.dtd (%chrome/browser/preferences/privacy.dtd)
locale/browser/preferences/security.dtd (%chrome/browser/preferences/security.dtd)
- locale/browser/preferences/containers.dtd (%chrome/browser/preferences/containers.dtd)
locale/browser/preferences/sync.dtd (%chrome/browser/preferences/sync.dtd)
locale/browser/preferences/tabs.dtd (%chrome/browser/preferences/tabs.dtd)
locale/browser/preferences/search.dtd (%chrome/browser/preferences/search.dtd)
diff --git a/application/basilisk/modules/ContentClick.jsm b/application/basilisk/modules/ContentClick.jsm
index 40101d5d35..4cd665f8c3 100644
--- a/application/basilisk/modules/ContentClick.jsm
+++ b/application/basilisk/modules/ContentClick.jsm
@@ -88,11 +88,6 @@ var ContentClick = {
triggeringPrincipal: json.triggeringPrincipal,
};
- // The new tab/window must use the same userContextId.
- if (json.originAttributes.userContextId) {
- params.userContextId = json.originAttributes.userContextId;
- }
-
window.openLinkIn(json.href, where, params);
}
};
diff --git a/application/basilisk/modules/ProcessHangMonitor.jsm b/application/basilisk/modules/ProcessHangMonitor.jsm
index e048f5b407..b1f6f2a97e 100644
--- a/application/basilisk/modules/ProcessHangMonitor.jsm
+++ b/application/basilisk/modules/ProcessHangMonitor.jsm
@@ -316,7 +316,7 @@ var ProcessHangMonitor = {
nb.appendNotification(bundle.getString("processHang.label"),
"process-hang",
- "chrome://browser/content/aboutRobots-icon.png",
+ "chrome://browser/skin/slowStartup-16.png",
nb.PRIORITY_WARNING_HIGH, buttons);
},
diff --git a/application/basilisk/themes/shared/incontentprefs/containers.css b/application/basilisk/themes/shared/incontentprefs/containers.css
deleted file mode 100644
index 5446dccce2..0000000000
--- a/application/basilisk/themes/shared/incontentprefs/containers.css
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../components/contextualidentity/content/usercontext.css
-
-.container-header-links {
- margin-block-end: 15px;
-}
-
-[data-identity-icon] {
- margin: 0;
- margin-inline-end: 16px;
-}
-
-#containersView {
- border: 0 none;
- background: transparent;
-}
-
-#containersView richlistitem {
- margin: 0px;
- margin-inline-end: 8px;
- padding: 0;
- padding-block-end: 8px;
- border-block-end: 1px solid var(--in-content-header-border-color);
-}
-
-#containersView richlistitem:last-of-type {
- border-block-end: 0 none;
- margin-block-end: 8px;
-}
diff --git a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
index 0e62660de9..20ea98327e 100644
--- a/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
+++ b/application/basilisk/themes/shared/incontentprefs/preferences.inc.css
@@ -237,8 +237,7 @@ treecol {
/* Privacy pane */
#trackingProtectionPBMLearnMore,
-#trackingProtectionLearnMore,
-#browserContainersLearnMore {
+#trackingProtectionLearnMore {
margin-inline-start: 1.5em !important;
margin-top: 0;
font-weight: normal;
diff --git a/application/basilisk/themes/shared/jar.inc.mn b/application/basilisk/themes/shared/jar.inc.mn
index 361edd3117..5750d2dc5a 100644
--- a/application/basilisk/themes/shared/jar.inc.mn
+++ b/application/basilisk/themes/shared/jar.inc.mn
@@ -73,8 +73,6 @@
skin/classic/browser/preferences/in-content/favicon.ico (../shared/incontentprefs/favicon.ico)
skin/classic/browser/preferences/in-content/icons.svg (../shared/incontentprefs/icons.svg)
skin/classic/browser/preferences/in-content/search.css (../shared/incontentprefs/search.css)
-* skin/classic/browser/preferences/in-content/containers.css (../shared/incontentprefs/containers.css)
-* skin/classic/browser/preferences/containers.css (../shared/preferences/containers.css)
skin/classic/browser/fxa/default-avatar.svg (../shared/fxa/default-avatar.svg)
skin/classic/browser/fxa/logo.png (../shared/fxa/logo.png)
skin/classic/browser/fxa/logo@2x.png (../shared/fxa/logo@2x.png)
diff --git a/application/basilisk/themes/shared/preferences/containers.css b/application/basilisk/themes/shared/preferences/containers.css
deleted file mode 100644
index 3fb9653316..0000000000
--- a/application/basilisk/themes/shared/preferences/containers.css
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../components/contextualidentity/content/usercontext.css
-
-:root {
- --preference-selected-color: #0996f8;
- --preference-unselected-color: #333;
- --preference-active-color: #858585;
-}
-
-radiogroup {
- display: flex;
- margin-inline-start: 0.35rem;
-}
-
-radio {
- flex: auto;
- display: flex;
- align-items: center;
- justify-content: center;
- -moz-user-select: none;
- outline: 2px solid transparent;
- outline-offset: 4px;
- -moz-outline-radius: 100%;
- min-block-size: 24px;
- min-inline-size: 24px;
- border-radius: 50%;
- padding: 2px;
- margin: 10px;
-}
-
-.icon-buttons > radio > [data-identity-icon] {
- fill: #4d4d4d;
-}
-
-radio > [data-identity-icon] {
- inline-size: 22px;
- block-size: 22px;
-}
-
-radio[selected=true] {
- outline-color: var(--preference-unselected-color);
-}
-
-radio[focused=true] {
- outline-color: var(--preference-selected-color);
-}
-
-radio:hover:active {
- outline-color: var(--preference-active-color);
-}
diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js
index 9a6a9fdc99..bd1b62cc3d 100644
--- a/application/palemoon/app/profile/palemoon.js
+++ b/application/palemoon/app/profile/palemoon.js
@@ -37,20 +37,20 @@ pref("extensions.strictCompatibility", false);
// for it to be compatible by default.
pref("extensions.minCompatibleAppVersion", "1.5");
-// Preferences for APO integration
-#define APO_AM_URL addons.palemoon.org/integration/addon-manager
-#define APO_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
+#define AM_DOMAIN addons.palemoon.org
+#define AM_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
+// Preferences for AMO integration
pref("extensions.getAddons.cache.enabled", false);
pref("extensions.getAddons.maxResults", 10);
-pref("extensions.getAddons.get.url", "https://@APO_AM_URL@/internal/get?addonguid=%IDS%&os=%OS%&version=%VERSION%");
-pref("extensions.getAddons.getWithPerformance.url", "https://@APO_AM_URL@/internal/get?addonguid=%IDS%&os=%OS%&version=%VERSION%");
-pref("extensions.getAddons.search.browseURL", "https://@APO_AM_URL@/external/recommended");
-pref("extensions.getAddons.search.url", "https://@APO_AM_URL@/internal/search?q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%");
-pref("extensions.webservice.discoverURL", "http://@APO_AM_URL@/internal/discover/");
-pref("extensions.getAddons.recommended.url", "https://@APO_AM_URL@/internal/recommended?locale=%LOCALE%&os=%OS%");
-pref("extensions.getAddons.browseAddons", "https://addons.palemoon.org");
-pref("extensions.getAddons.recommended.browseURL", "https://@APO_AM_URL@/external/recommended");
+pref("extensions.getAddons.get.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%");
+pref("extensions.getAddons.getWithPerformance.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=get&addonguid=%IDS%&os=%OS%&version=%VERSION%");
+pref("extensions.getAddons.search.browseURL", "https://@AM_DOMAIN@/search/?terms=%TERMS%");
+pref("extensions.getAddons.search.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=search&q=%TERMS%&locale=%LOCALE%&os=%OS%&version=%VERSION%");
+pref("extensions.webservice.discoverURL", "http://@AM_DOMAIN@/?component=discover");
+pref("extensions.getAddons.recommended.url", "https://@AM_DOMAIN@/?component=integration&type=internal&request=recommended&locale=%LOCALE%&os=%OS%");
+pref("extensions.getAddons.browseAddons", "http://@AM_DOMAIN@/");
+pref("extensions.getAddons.recommended.browseURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=recommended");
// Blocklist preferences
pref("extensions.blocklist.enabled", true);
@@ -70,10 +70,10 @@ pref("extensions.update.autoUpdateDefault", true);
pref("extensions.autoDisableScopes", 15);
// Dictionary download preference
-pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
+pref("browser.dictionaries.download.url", "https://@AM_DOMAIN@/dictionaries/");
// Get More Tools link URL
-pref("browser.getdevtools.url","https://@APO_AM_URL@/external/devtools");
+pref("browser.getdevtools.url","https://@AM_DOMAIN@/?component=integration&type=external&request=devtools");
// Feedback URL
pref("browser.feedback.url", "https://forum.palemoon.org");
@@ -194,8 +194,8 @@ pref("app.update.incompatible.mode", 0);
// .. etc ..
//
pref("extensions.update.enabled", true);
-pref("extensions.update.url", "https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@");
-pref("extensions.update.background.url", "https://@APO_AM_URL@/internal/update?@APO_AUS_ARGS@");
+pref("extensions.update.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@");
+pref("extensions.update.background.url", "https://@AM_DOMAIN@/?component=aus&@AM_AUS_ARGS@");
pref("extensions.update.interval", 86400); // Check for updates to Extensions and
// Themes every day
// Non-symmetric (not shared by extensions) extension-specific [update] preferences
@@ -362,7 +362,7 @@ pref("browser.download.panel.shown", false);
pref("browser.download.panel.firstSessionCompleted", false);
// search engines URL
-pref("browser.search.searchEnginesURL", "https://@APO_AM_URL@/external/searchplugins");
+pref("browser.search.searchEnginesURL", "https://@AM_DOMAIN@/?component=integration&type=external&request=searchplugins");
// pointer to the default engine name
pref("browser.search.defaultenginename", "chrome://browser-region/locale/region.properties");
@@ -1089,8 +1089,6 @@ pref("browser.pagethumbnails.capturing_disabled", false);
// enables showing basic placeholders for missing thumbnails
pref("browser.newtabpage.thumbnailPlaceholder", false);
-pref("privacy.usercontext.about_newtab_segregation.enabled", false);
-
// number of columns of newtab grid
pref("browser.newtabpage.columns", 4);
@@ -1121,6 +1119,9 @@ pref("security.csp.speccompliant", true);
// Block insecure active content on https pages
pref("security.mixed_content.block_active_content", true);
+// Disable Microsoft Family Safety MitM support
+pref("security.family_safety.mode", 0);
+
// Override the Gecko-default value of false for Pale Moon.
pref("plain_text.wrap_long_lines", true);
@@ -1160,6 +1161,14 @@ pref("toolkit.pageThumbs.minHeight", 180);
pref("ui.key.menuAccessKeyFocuses", true);
#endif
+// When a user cancels this number of authentication dialogs coming from
+// a single web page (eTLD+1) in a row, all following authentication dialogs
+// will be blocked (automatically canceled) for that page.
+// This counter is per-tab and per-domain to minimize false positives.
+// The counter resets when the page is reloaded from the UI
+// (content-reloads do NOT clear this to mitigate reloading tricks).
+pref("prompts.authentication_dialog_abuse_limit", 3);
+
// ****************** s4e prefs ******************
pref("status4evar.addonbar.borderStyle", false);
pref("status4evar.addonbar.closeButton", false);
diff --git a/application/palemoon/base/content/aboutDialog.css b/application/palemoon/base/content/aboutDialog.css
index d171a0bc17..d96eba5a22 100644
--- a/application/palemoon/base/content/aboutDialog.css
+++ b/application/palemoon/base/content/aboutDialog.css
@@ -2,56 +2,53 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#PMaboutDialog {
- width: 620px;
+#aboutPMDialogContainer {
+ width: 700px;
+ height: 410px;
}
-#PMrightBox {
- background-image: url("chrome://branding/content/about-wordmark.png");
- background-repeat: no-repeat;
- /* padding-top creates room for the wordmark */
- padding-top: 38px;
- margin-top:20px;
+#aboutVersionBox {
+ font-family: Arial, helvetica;
+ height: 38 px;
}
-#PMrightBox:-moz-locale-dir(rtl) {
- background-position: 100% 0;
-}
-
-#PMbottomBox {
- padding: 15px 10px 0;
-}
-
-#PMversion {
- margin-top: 10px;
- -moz-margin-start: 0;
+#aboutVersion {
+ text-align: center;
+ font-size: 18px;
+ font-weight: bold;
+ margin: 4px;
}
#distribution,
#distributionId {
+ text-align: center;
+ font-size: 14px;
font-weight: bold;
display: none;
margin-top: 0;
margin-bottom: 0;
}
-.text-blurb {
- margin-bottom: 10px;
- -moz-margin-start: 0;
- -moz-padding-start: 0;
+#aboutTextBox {
+ font-family: Arial, helvetica;
+ font-size: 14px;
+ margin: 5px 20px;
+ padding: 4px 10px 0px;
+ border-radius: 3px;
+ color: black;
+ background-color: rgba(240, 240, 240, .6);
+}
+
+#aboutLinkBox {
+ font-family: Arial, helvetica;
}
-#updateButton,
-#updateDeck > hbox > label {
- -moz-margin-start: 0;
- -moz-padding-start: 0;
+.text-credits {
+ margin: 5px 0px;
}
-.update-throbber {
- width: 16px;
- min-height: 16px;
- -moz-margin-end: 3px;
- list-style-image: url("chrome://global/skin/icons/loading_16.png");
+.text-center {
+ text-align: center;
}
.text-link,
@@ -63,5 +60,15 @@
.bottom-link,
.bottom-link:focus {
text-align: center;
+ text-decoration: none !important;
+ padding: 4px;
+ border-radius: 3px;
+ color: #244C8A;
+ background-color: rgba(240, 240, 240, .7);
margin: 0 40px;
+ transition: background-color 0.5s ease-out;
+}
+
+.bottom-link:hover {
+ background-color: rgba(240, 240, 255, .95);
}
diff --git a/application/palemoon/base/content/aboutDialog.js b/application/palemoon/base/content/aboutDialog.js
index f4c2a990ca..e4e18f2cff 100644
--- a/application/palemoon/base/content/aboutDialog.js
+++ b/application/palemoon/base/content/aboutDialog.js
@@ -42,13 +42,9 @@ function init(aEvent)
if (/[ab]\d+$/.test(version)) {
let buildID = Services.appinfo.appBuildID;
let buildDate = buildID.slice(0,4) + "-" + buildID.slice(4,6) + "-" + buildID.slice(6,8);
- document.getElementById("PMversion").textContent += " (" + buildDate + ")";
+ document.getElementById("aboutVersion").textContent += " (" + buildDate + ")";
}
-#ifdef MOZ_UPDATER
- gAppUpdater = new appUpdater();
-#endif
-
#ifdef XP_MACOSX
// it may not be sized at this point, and we need its width to calculate its position
window.sizeToContent();
@@ -64,527 +60,3 @@ function init(aEvent)
relnotes.setAttribute("href", releaseNotesURL);
}
}
-
-#ifdef MOZ_UPDATER
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
-Components.utils.import("resource://gre/modules/AddonManager.jsm");
-
-var gAppUpdater;
-
-function onUnload(aEvent) {
- if (gAppUpdater.isChecking)
- gAppUpdater.checker.stopChecking(Components.interfaces.nsIUpdateChecker.CURRENT_CHECK);
- // Safe to call even when there isn't a download in progress.
- gAppUpdater.removeDownloadListener();
- gAppUpdater = null;
-}
-
-
-function appUpdater()
-{
- this.updateDeck = document.getElementById("updateDeck");
-
- // Hide the update deck when there is already an update window open to avoid
- // syncing issues between them.
- if (Services.wm.getMostRecentWindow("Update:Wizard")) {
- this.updateDeck.hidden = true;
- return;
- }
-
- XPCOMUtils.defineLazyServiceGetter(this, "aus",
- "@mozilla.org/updates/update-service;1",
- "nsIApplicationUpdateService");
- XPCOMUtils.defineLazyServiceGetter(this, "checker",
- "@mozilla.org/updates/update-checker;1",
- "nsIUpdateChecker");
- XPCOMUtils.defineLazyServiceGetter(this, "um",
- "@mozilla.org/updates/update-manager;1",
- "nsIUpdateManager");
-
- this.bundle = Services.strings.
- createBundle("chrome://browser/locale/browser.properties");
-
- this.updateBtn = document.getElementById("updateButton");
-
- // The button label value must be set so its height is correct.
- this.setupUpdateButton("update.checkInsideButton");
-
- let manualURL = Services.urlFormatter.formatURLPref("app.update.url.manual");
- let manualLink = document.getElementById("manualLink");
- manualLink.value = manualURL;
- manualLink.href = manualURL;
- document.getElementById("failedLink").href = manualURL;
-
- if (this.updateDisabledAndLocked) {
- this.selectPanel("adminDisabled");
- return;
- }
-
- if (this.isPending || this.isApplied) {
- this.setupUpdateButton("update.restart." +
- (this.isMajor ? "upgradeButton" : "updateButton"));
- return;
- }
-
- if (this.aus.isOtherInstanceHandlingUpdates) {
- this.selectPanel("otherInstanceHandlingUpdates");
- return;
- }
-
- if (this.isDownloading) {
- this.startDownload();
- return;
- }
-
- if (this.updateEnabled && this.updateAuto) {
- this.selectPanel("checkingForUpdates");
- this.isChecking = true;
- this.checker.checkForUpdates(this.updateCheckListener, true);
- return;
- }
-}
-
-appUpdater.prototype =
-{
- // true when there is an update check in progress.
- isChecking: false,
-
- // true when there is an update already staged / ready to be applied.
- get isPending() {
- if (this.update) {
- return this.update.state == "pending" ||
- this.update.state == "pending-service";
- }
- return this.um.activeUpdate &&
- (this.um.activeUpdate.state == "pending" ||
- this.um.activeUpdate.state == "pending-service");
- },
-
- // true when there is an update already installed in the background.
- get isApplied() {
- if (this.update)
- return this.update.state == "applied" ||
- this.update.state == "applied-service";
- return this.um.activeUpdate &&
- (this.um.activeUpdate.state == "applied" ||
- this.um.activeUpdate.state == "applied-service");
- },
-
- // true when there is an update download in progress.
- get isDownloading() {
- if (this.update)
- return this.update.state == "downloading";
- return this.um.activeUpdate &&
- this.um.activeUpdate.state == "downloading";
- },
-
- // true when the update type is major.
- get isMajor() {
- if (this.update)
- return this.update.type == "major";
- return this.um.activeUpdate.type == "major";
- },
-
- // true when updating is disabled by an administrator.
- get updateDisabledAndLocked() {
- return !this.updateEnabled &&
- Services.prefs.prefIsLocked("app.update.enabled");
- },
-
- // true when updating is enabled.
- get updateEnabled() {
- try {
- return Services.prefs.getBoolPref("app.update.enabled");
- }
- catch (e) { }
- return true; // Firefox default is true
- },
-
- // true when updating in background is enabled.
- get backgroundUpdateEnabled() {
- return this.updateEnabled &&
- gAppUpdater.aus.canStageUpdates;
- },
-
- // true when updating is automatic.
- get updateAuto() {
- try {
- return Services.prefs.getBoolPref("app.update.auto");
- }
- catch (e) { }
- return true; // Firefox default is true
- },
-
- /**
- * Sets the deck's selected panel.
- *
- * @param aChildID
- * The id of the deck's child to select.
- */
- selectPanel: function(aChildID) {
- this.updateDeck.selectedPanel = document.getElementById(aChildID);
- this.updateBtn.disabled = (aChildID != "updateButtonBox");
- },
-
- /**
- * Sets the update button's label and accesskey.
- *
- * @param aKeyPrefix
- * The prefix for the properties file entry to use for setting the
- * label and accesskey.
- */
- setupUpdateButton: function(aKeyPrefix) {
- this.updateBtn.label = this.bundle.GetStringFromName(aKeyPrefix + ".label");
- this.updateBtn.accessKey = this.bundle.GetStringFromName(aKeyPrefix + ".accesskey");
- if (!document.commandDispatcher.focusedElement ||
- document.commandDispatcher.focusedElement == this.updateBtn)
- this.updateBtn.focus();
- },
-
- /**
- * Handles oncommand for the update button.
- */
- buttonOnCommand: function() {
- if (this.isPending || this.isApplied) {
- // Notify all windows that an application quit has been requested.
- let cancelQuit = Components.classes["@mozilla.org/supports-PRBool;1"].
- createInstance(Components.interfaces.nsISupportsPRBool);
- Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
-
- // Something aborted the quit process.
- if (cancelQuit.data)
- return;
-
- let appStartup = Components.classes["@mozilla.org/toolkit/app-startup;1"].
- getService(Components.interfaces.nsIAppStartup);
-
- // If already in safe mode restart in safe mode (bug 327119)
- if (Services.appinfo.inSafeMode) {
- appStartup.restartInSafeMode(Components.interfaces.nsIAppStartup.eAttemptQuit);
- return;
- }
-
- appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit |
- Components.interfaces.nsIAppStartup.eRestart);
- return;
- }
-
- const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul";
- // Firefox no longer displays a license for updates and the licenseURL check
- // is just in case a distibution does.
- if (this.update) {
- var ary = null;
- ary = Components.classes["@mozilla.org/supports-array;1"].
- createInstance(Components.interfaces.nsISupportsArray);
- ary.AppendElement(this.update);
- var openFeatures = "chrome,centerscreen,dialog=no,resizable=no,titlebar,toolbar=no";
- Services.ww.openWindow(null, URI_UPDATE_PROMPT_DIALOG, "", openFeatures, ary);
- window.close();
- return;
- }
-
- this.selectPanel("checkingForUpdates");
- this.isChecking = true;
- this.checker.checkForUpdates(this.updateCheckListener, true);
- },
-
- /**
- * Implements nsIUpdateCheckListener. The methods implemented by
- * nsIUpdateCheckListener are in a different scope from nsIIncrementalDownload
- * to make it clear which are used by each interface.
- */
- updateCheckListener: {
- /**
- * See nsIUpdateService.idl
- */
- onCheckComplete: function(aRequest, aUpdates, aUpdateCount) {
- gAppUpdater.isChecking = false;
- gAppUpdater.update = gAppUpdater.aus.
- selectUpdate(aUpdates, aUpdates.length);
- if (!gAppUpdater.update) {
- gAppUpdater.selectPanel("noUpdatesFound");
- return;
- }
-
- if (gAppUpdater.update.unsupported) {
- if (gAppUpdater.update.detailsURL) {
- let unsupportedLink = document.getElementById("unsupportedLink");
- unsupportedLink.href = gAppUpdater.update.detailsURL;
- }
- gAppUpdater.selectPanel("unsupportedSystem");
- return;
- }
-
- if (!gAppUpdater.aus.canApplyUpdates) {
- gAppUpdater.selectPanel("manualUpdate");
- return;
- }
-
- gAppUpdater.selectPanel("updateButtonBox");
- gAppUpdater.setupUpdateButton("update.openUpdateUI." +
- (this.isMajor ? "upgradeButton"
- : "applyButton"));
- },
-
- /**
- * See nsIUpdateService.idl
- */
- onError: function(aRequest, aUpdate) {
- // Errors in the update check are treated as no updates found. If the
- // update check fails repeatedly without a success the user will be
- // notified with the normal app update user interface so this is safe.
- gAppUpdater.isChecking = false;
- gAppUpdater.selectPanel("noUpdatesFound");
- },
-
- /**
- * See nsISupports.idl
- */
- QueryInterface: function(aIID) {
- if (!aIID.equals(Components.interfaces.nsIUpdateCheckListener) &&
- !aIID.equals(Components.interfaces.nsISupports))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- return this;
- }
- },
-
- /**
- * Checks the compatibility of add-ons for the application update.
- */
- checkAddonCompatibility: function() {
- var self = this;
- AddonManager.getAllAddons(function(aAddons) {
- self.addons = [];
- self.addonsCheckedCount = 0;
- aAddons.forEach(function(aAddon) {
- // Protect against code that overrides the add-ons manager and doesn't
- // implement the isCompatibleWith or the findUpdates method.
- if (!("isCompatibleWith" in aAddon) || !("findUpdates" in aAddon)) {
- let errMsg = "Add-on doesn't implement either the isCompatibleWith " +
- "or the findUpdates method!";
- if (aAddon.id)
- errMsg += " Add-on ID: " + aAddon.id;
- Components.utils.reportError(errMsg);
- return;
- }
-
- // If an add-on isn't appDisabled and isn't userDisabled then it is
- // either active now or the user expects it to be active after the
- // restart. If that is the case and the add-on is not installed by the
- // application and is not compatible with the new application version
- // then the user should be warned that the add-on will become
- // incompatible. If an addon's type equals plugin it is skipped since
- // checking plugins compatibility information isn't supported and
- // getting the scope property of a plugin breaks in some environments
- // (see bug 566787).
- try {
- if (aAddon.type != "plugin" && aAddon.isCompatible &&
- !aAddon.appDisabled && !aAddon.userDisabled &&
- aAddon.scope != AddonManager.SCOPE_APPLICATION &&
- !aAddon.isCompatibleWith(self.update.appVersion,
- self.update.platformVersion))
- self.addons.push(aAddon);
- }
- catch (e) {
- Components.utils.reportError(e);
- }
- });
- self.addonsTotalCount = self.addons.length;
- if (self.addonsTotalCount == 0) {
- self.startDownload();
- return;
- }
-
- self.checkAddonsForUpdates();
- });
- },
-
- /**
- * Checks if there are updates for add-ons that are incompatible with the
- * application update.
- */
- checkAddonsForUpdates: function() {
- this.addons.forEach(function(aAddon) {
- aAddon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_DETECTED,
- this.update.appVersion,
- this.update.platformVersion);
- }, this);
- },
-
- /**
- * See XPIProvider.jsm
- */
- onCompatibilityUpdateAvailable: function(aAddon) {
- for (var i = 0; i < this.addons.length; ++i) {
- if (this.addons[i].id == aAddon.id) {
- this.addons.splice(i, 1);
- break;
- }
- }
- },
-
- /**
- * See XPIProvider.jsm
- */
- onUpdateAvailable: function(aAddon, aInstall) {
- if (!Services.blocklist.isAddonBlocklisted(aAddon.id, aInstall.version,
- this.update.appVersion,
- this.update.platformVersion)) {
- // Compatibility or new version updates mean the same thing here.
- this.onCompatibilityUpdateAvailable(aAddon);
- }
- },
-
- /**
- * See XPIProvider.jsm
- */
- onUpdateFinished: function(aAddon) {
- ++this.addonsCheckedCount;
-
- if (this.addonsCheckedCount < this.addonsTotalCount)
- return;
-
- if (this.addons.length == 0) {
- // Compatibility updates or new version updates were found for all add-ons
- this.startDownload();
- return;
- }
-
- this.selectPanel("updateButtonBox");
- this.setupUpdateButton("update.openUpdateUI." +
- (this.isMajor ? "upgradeButton" : "applyButton"));
- },
-
- /**
- * Starts the download of an update mar.
- */
- startDownload: function() {
- if (!this.update)
- this.update = this.um.activeUpdate;
- this.update.QueryInterface(Components.interfaces.nsIWritablePropertyBag);
- this.update.setProperty("foregroundDownload", "true");
-
- this.aus.pauseDownload();
- let state = this.aus.downloadUpdate(this.update, false);
- if (state == "failed") {
- this.selectPanel("downloadFailed");
- return;
- }
-
- this.setupDownloadingUI();
- },
-
- /**
- * Switches to the UI responsible for tracking the download.
- */
- setupDownloadingUI: function() {
- this.downloadStatus = document.getElementById("downloadStatus");
- this.downloadStatus.value =
- DownloadUtils.getTransferTotal(0, this.update.selectedPatch.size);
- this.selectPanel("downloading");
- this.aus.addDownloadListener(this);
- },
-
- removeDownloadListener: function() {
- if (this.aus) {
- this.aus.removeDownloadListener(this);
- }
- },
-
- /**
- * See nsIRequestObserver.idl
- */
- onStartRequest: function(aRequest, aContext) {
- },
-
- /**
- * See nsIRequestObserver.idl
- */
- onStopRequest: function(aRequest, aContext, aStatusCode) {
- switch (aStatusCode) {
- case Components.results.NS_ERROR_UNEXPECTED:
- if (this.update.selectedPatch.state == "download-failed" &&
- (this.update.isCompleteUpdate || this.update.patchCount != 2)) {
- // Verification error of complete patch, informational text is held in
- // the update object.
- this.removeDownloadListener();
- this.selectPanel("downloadFailed");
- break;
- }
- // Verification failed for a partial patch, complete patch is now
- // downloading so return early and do NOT remove the download listener!
- break;
- case Components.results.NS_BINDING_ABORTED:
- // Do not remove UI listener since the user may resume downloading again.
- break;
- case Components.results.NS_OK:
- this.removeDownloadListener();
- if (this.backgroundUpdateEnabled) {
- this.selectPanel("applying");
- let update = this.um.activeUpdate;
- let self = this;
- Services.obs.addObserver(function (aSubject, aTopic, aData) {
- // Update the UI when the background updater is finished
- let status = aData;
- if (status == "applied" || status == "applied-service" ||
- status == "pending" || status == "pending-service") {
- // If the update is successfully applied, or if the updater has
- // fallen back to non-staged updates, show the Restart to Update
- // button.
- self.selectPanel("updateButtonBox");
- self.setupUpdateButton("update.restart." +
- (self.isMajor ? "upgradeButton" : "updateButton"));
- } else if (status == "failed") {
- // Background update has failed, let's show the UI responsible for
- // prompting the user to update manually.
- self.selectPanel("downloadFailed");
- } else if (status == "downloading") {
- // We've fallen back to downloading the full update because the
- // partial update failed to get staged in the background.
- // Therefore we need to keep our observer.
- self.setupDownloadingUI();
- return;
- }
- Services.obs.removeObserver(arguments.callee, "update-staged");
- }, "update-staged", false);
- } else {
- this.selectPanel("updateButtonBox");
- this.setupUpdateButton("update.restart." +
- (this.isMajor ? "upgradeButton" : "updateButton"));
- }
- break;
- default:
- this.removeDownloadListener();
- this.selectPanel("downloadFailed");
- break;
- }
-
- },
-
- /**
- * See nsIProgressEventSink.idl
- */
- onStatus: function(aRequest, aContext, aStatus, aStatusArg) {
- },
-
- /**
- * See nsIProgressEventSink.idl
- */
- onProgress: function(aRequest, aContext, aProgress, aProgressMax) {
- this.downloadStatus.value =
- DownloadUtils.getTransferTotal(aProgress, aProgressMax);
- },
-
- /**
- * See nsISupports.idl
- */
- QueryInterface: function(aIID) {
- if (!aIID.equals(Components.interfaces.nsIProgressEventSink) &&
- !aIID.equals(Components.interfaces.nsIRequestObserver) &&
- !aIID.equals(Components.interfaces.nsISupports))
- throw Components.results.NS_ERROR_NO_INTERFACE;
- return this;
- }
-};
-#endif
diff --git a/application/palemoon/base/content/aboutDialog.xul b/application/palemoon/base/content/aboutDialog.xul
index 5c344f55da..6edfc21555 100644
--- a/application/palemoon/base/content/aboutDialog.xul
+++ b/application/palemoon/base/content/aboutDialog.xul
@@ -24,9 +24,6 @@
id="PMaboutDialog"
windowtype="Browser:About"
onload="init(event);"
-#ifdef MOZ_UPDATER
- onunload="onUnload(event);"
-#endif
#ifdef XP_MACOSX
inwindowmenu="false"
#else
@@ -38,86 +35,48 @@
<script type="application/javascript" src="chrome://browser/content/aboutDialog.js"/>
- <vbox id="aboutPMDialogContainer">
- <hbox id="PMclientBox">
- <vbox id="PMleftBox" flex="1"/>
- <vbox id="PMrightBox" flex="1">
+ <vbox id="aboutPMDialogContainer" flex="1">
+ <vbox id="aboutHeaderBox" />
+ <vbox id="aboutVersionBox" flex="3">
#ifdef HAVE_64BIT_BUILD
-#expand <label id="PMversion">Version: __MOZ_APP_VERSION__ (64-bit)</label>
+#expand <label id="aboutVersion">Version: __MOZ_APP_VERSION__ (64-bit)</label>
#else
-#expand <label id="PMversion">Version: __MOZ_APP_VERSION__ (32-bit)</label>
+#expand <label id="aboutVersion">Version: __MOZ_APP_VERSION__ (32-bit)</label>
#endif
<label id="distribution" class="text-blurb"/>
<label id="distributionId" class="text-blurb"/>
- <vbox id="detailsBox">
- <vbox id="updateBox">
-#ifdef MOZ_UPDATER
- <deck id="updateDeck" orient="vertical">
- <hbox id="updateButtonBox" align="center">
- <button id="updateButton" align="start"
- oncommand="gAppUpdater.buttonOnCommand();"/>
- <spacer flex="1"/>
- </hbox>
- <hbox id="checkingForUpdates" align="center">
- <image class="update-throbber"/><label>&update.checkingForUpdates;</label>
- </hbox>
- <hbox id="checkingAddonCompat" align="center">
- <image class="update-throbber"/><label>&update.checkingAddonCompat;</label>
- </hbox>
- <hbox id="downloading" align="center">
- <image class="update-throbber"/><label>&update.downloading.start;</label><label id="downloadStatus"/><label>&update.downloading.end;</label>
- </hbox>
- <hbox id="applying" align="center">
- <image class="update-throbber"/><label>&update.applying;</label>
- </hbox>
- <hbox id="downloadFailed" align="center">
- <label>&update.failed.start;</label><label id="failedLink" class="text-link">&update.failed.linkText;</label><label>&update.failed.end;</label>
- </hbox>
- <hbox id="adminDisabled" align="center">
- <label>&update.adminDisabled;</label>
- </hbox>
- <hbox id="noUpdatesFound" align="center">
- <label>&update.noUpdatesFound;</label>
- </hbox>
- <hbox id="manualUpdate" align="center">
- <label>&update.manual.start;</label><label id="manualLink" class="text-link"/><label>&update.manual.end;</label>
- </hbox>
- </deck>
-#endif
- </vbox>
-
- <description class="text-pmcreds">
+ </vbox>
+ <vbox id="aboutTextBox" flex="1">
+ <description class="text-credits text-center">
#if defined(MOZ_OFFICIAL_BRANDING) || defined(MC_OFFICIAL)
#ifdef MC_PRIVATE_BUILD
This is a private build of Pale Moon. If you did not manually build this copy from source yourself, then please download an official version from the <label class="text-link" href="http://www.palemoon.org/">Pale Moon website</label>.
#else
- Pale Moon is released by <label class="text-link" href="http://www.moonchildproductions.info">Moonchild Productions</label>.
+ <label class="text-link" href="http://www.palemoon.org">Pale Moon</label> is released by <label class="text-link" href="http://www.moonchildproductions.info">Moonchild Productions</label>.
</description>
- <description class="text-pmcreds">
+ <description class="text-credits text-center">
Special thanks to all our supporters and donors for making this browser possible!
</description>
- <description class="text-blurb">
+ <description class="text-credits">
If you wish to contribute, please consider helping out by providing support to other users on the <label class="text-link" href="https://forum.palemoon.org/">Pale Moon forum</label>
or getting involved in our development by tackling some of the issues found in our GitHub issue tracker.
#endif
#else
&brandFullName; is released by &vendorShortName;.
</description>
- <description class="text-blurb">
+ <description class="text-credits">
This is an unofficial build of Pale Moon. For official builds, please go to <label class="text-link" href="http://www.palemoon.org/">the Pale Moon website</label>.
#endif
</description>
- </vbox>
- </vbox>
- </hbox>
- <vbox id="PMbottomBox">
+ </vbox>
+ <vbox id="aboutLinkBox">
<hbox pack="center">
- <label class="text-link bottom-link" href="about:license">Licensing information</label>
<label class="text-link bottom-link" href="about:rights">End-user rights</label>
+ <label class="text-link bottom-link" href="about:license">Licensing information</label>
<label class="text-link bottom-link" id="releaseNotesURL">Release notes</label>
</hbox>
- <description id="PMtrademark">&trademarkInfo.part1;</description>
+ <description id="aboutPMtrademark">&trademarkInfo.part1;</description>
</vbox>
</vbox>
diff --git a/application/palemoon/base/content/aboutRobots-icon.png b/application/palemoon/base/content/aboutRobots-icon.png
deleted file mode 100644
index 1c4899aaf7..0000000000
--- a/application/palemoon/base/content/aboutRobots-icon.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/base/content/aboutRobots-widget-left.png b/application/palemoon/base/content/aboutRobots-widget-left.png
deleted file mode 100644
index 3a1e48d5fa..0000000000
--- a/application/palemoon/base/content/aboutRobots-widget-left.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/base/content/aboutRobots.xhtml b/application/palemoon/base/content/aboutRobots.xhtml
deleted file mode 100644
index 23fe3ba17f..0000000000
--- a/application/palemoon/base/content/aboutRobots.xhtml
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!DOCTYPE html [
- <!ENTITY % htmlDTD
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "DTD/xhtml1-strict.dtd">
- %htmlDTD;
- <!ENTITY % netErrorDTD
- SYSTEM "chrome://global/locale/netError.dtd">
- %netErrorDTD;
- <!ENTITY % globalDTD
- SYSTEM "chrome://global/locale/global.dtd">
- %globalDTD;
- <!ENTITY % aboutrobotsDTD
- SYSTEM "chrome://browser/locale/aboutRobots.dtd">
- %aboutrobotsDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>&robots.pagetitle;</title>
- <link rel="stylesheet" href="chrome://global/skin/netError.css" type="text/css" media="all" />
- <link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAAAAAAAAAHgPoAgEKra7sAAAAFmZkQVQAAAAIOI1jYBgFo2AUjAIIAAAEEAABM9s3hAAAABpmY1RMAAAACQAAABAAAAAQAAAAAAAAAAAAHgPoAgHn3p%2BwAAAAKmZkQVQAAAAKOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F1BhPl6AAAAGmZjVEwAAAALAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQpITFkAAAAWZmRBVAAAAAw4jWNgGAWjYBSMAggAAAQQAAHaszpmAAAAGmZjVEwAAAANAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeeCPiMAAABAZmRBVAAAAA44jWNgGJ5gpxrDf2LEcIL%2FpzAVYxPDavP%2FUwz%2FpW79%2F%2F%2F%2FFMP%2FnWoQjC5GOxcgu4QYsVEwCmAAAOE0KxUmBL0KAAAAGmZjVEwAAAAPAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAQoU7coAAAAWZmRBVAAAABA4jWNgGAWjYBSMAggAAAQQAAEpOBELAAAAGmZjVEwAAAARAAAAEAAAABAAAAAAAAAAAAAeA%2BgCAeYVWtoAAAAqZmRBVAAAABI4jWNgGAVYQXNz839ixHBq3qnG8B9ZAzYx2rlgFIwCcgAA8psX%2FWvpAecAAAAaZmNUTAAAABMAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC4OJMwAAABZmZEFUAAAAFDiNY2AYBaNgFIwCCAAABBAAAcBQHOkAAAAaZmNUTAAAABUAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5kn7SQAAAEBmZEFUAAAAFjiNY2AYnmCnGsN%2FYsRwgv%2BnMBVjE8Nq8%2F9TDP%2Blbv3%2F%2F%2F8Uw%2F%2BdahCMLkY7FyC7hBixUTAKYAAA4TQrFc%2BcEoQAAAAaZmNUTAAAABcAAAAQAAAAEAAAAAAAAAAAAB4D6AIBC98ooAAAABZmZEFUAAAAGDiNY2AYBaNgFIwCCAAABBAAASCZDI4AAAAaZmNUTAAAABkAAAAQAAAAEAAAAAAAAAAAAB4D6AIB5qwZ%2FAAAACpmZEFUAAAAGjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9cjJWbAAAABpmY1RMAAAAGwAAABAAAAAQAAAAAAAAAAAAHgPoAgELOsoVAAAAFmZkQVQAAAAcOI1jYBgFo2AUjAIIAAAEEAAByfEBbAAAABpmY1RMAAAAHQAAABAAAAAQAAAAAAAAAAAAHgPoAgHm8LhvAAAAQGZkQVQAAAAeOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVlxR3%2FgAAABpmY1RMAAAAHwAAABAAAAAQAAAAAAAAAAAAHgPoAgELZmuGAAAAFmZkQVQAAAAgOI1jYBgFo2AUjAIIAAAEEAABHP5cFQAAABpmY1RMAAAAIQAAABAAAAAQAAAAAAAAAAAAHgPoAgHlgtAOAAAAKmZkQVQAAAAiOI1jYBgFWEFzc%2FN%2FYsRwat6pxvAfWQM2Mdq5YBSMAnIAAPKbF%2F0%2FMvDdAAAAAElFTkSuQmCC"/>
-
- <script type="application/javascript"><![CDATA[
- var buttonClicked = false;
- function robotButton()
- {
- var button = document.getElementById('errorTryAgain');
- if (buttonClicked) {
- button.style.visibility = "hidden";
- } else {
- var newLabel = button.getAttribute("label2");
- button.textContent = newLabel;
- buttonClicked = true;
- }
- }
- ]]></script>
-
- <style type="text/css"><![CDATA[
- #errorPageContainer {
- background-image: none;
- }
-
- #errorPageContainer:before {
- content: url('chrome://browser/content/aboutRobots-icon.png');
- position: absolute;
- }
-
- body[dir=rtl] #icon,
- body[dir=rtl] #errorPageContainer:before {
- transform: scaleX(-1);
- }
- ]]></style>
- </head>
-
- <body dir="&locale.dir;">
-
- <!-- PAGE CONTAINER (for styling purposes only) -->
- <div id="errorPageContainer">
-
- <!-- Error Title -->
- <div id="errorTitle">
- <h1 id="errorTitleText">&robots.errorTitleText;</h1>
- </div>
-
- <!-- LONG CONTENT (the section most likely to require scrolling) -->
- <div id="errorLongContent">
-
- <!-- Short Description -->
- <div id="errorShortDesc">
- <p id="errorShortDescText">&robots.errorShortDescText;</p>
- </div>
-
- <!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
- <div id="errorLongDesc">
- <ul>
- <li>&robots.errorLongDesc1;</li>
- <li>&robots.errorLongDesc2;</li>
- <li>&robots.errorLongDesc3;</li>
- <li>&robots.errorLongDesc4;</li>
- </ul>
- </div>
-
- <!-- Short Description -->
- <div id="errorTrailerDesc">
- <p id="errorTrailerDescText">&robots.errorTrailerDescText;</p>
- </div>
-
- </div>
-
- <!-- Button -->
- <button id="errorTryAgain"
- label2="&robots.dontpress;"
- onclick="robotButton();">&retry.label;</button>
-
- <img src="chrome://browser/content/aboutRobots-widget-left.png"
- style="position: absolute; bottom: -12px; left: -10px;"/>
- <img src="chrome://browser/content/aboutRobots-widget-left.png"
- style="position: absolute; bottom: -12px; right: -10px; transform: scaleX(-1);"/>
- </div>
-
- </body>
-</html>
diff --git a/application/palemoon/base/content/baseMenuOverlay.xul b/application/palemoon/base/content/baseMenuOverlay.xul
index e9019dc55c..a006ed5c6b 100644
--- a/application/palemoon/base/content/baseMenuOverlay.xul
+++ b/application/palemoon/base/content/baseMenuOverlay.xul
@@ -41,7 +41,7 @@
label="&helpMenu.label;"
accesskey="&helpMenu.accesskey;">
#endif
- <menupopup id="menu_HelpPopup">
+ <menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
<menuitem id="menu_openHelp"
oncommand="openHelpLink('firefox-help')"
onclick="checkForMiddleClick(this, event);"
@@ -66,6 +66,14 @@
accesskey="&helpSafeMode.accesskey;"
label="&helpSafeMode.label;"
oncommand="restart(true);"/>
+ <menuseparator id="updatesSeparator"/>
+ <menuitem id="checkForUpdates" class="menuitem-iconic"
+#ifdef MOZ_UPDATER
+ label="&updateCmd.label;"
+ oncommand="checkForUpdates();"/>
+#else
+ hidden="true"/>
+#endif
<menuseparator id="aboutSeparator"/>
<menuitem id="aboutName"
accesskey="&aboutProduct.accesskey;"
diff --git a/application/palemoon/base/content/browser-appmenu.inc b/application/palemoon/base/content/browser-appmenu.inc
index cfc855484a..ffb117a605 100644
--- a/application/palemoon/base/content/browser-appmenu.inc
+++ b/application/palemoon/base/content/browser-appmenu.inc
@@ -341,7 +341,7 @@
<splitmenu id="appmenu_help"
label="&helpMenu.label;"
oncommand="openHelpLink('firefox-help')">
- <menupopup id="appmenu_helpMenupopup">
+ <menupopup id="appmenu_helpMenupopup" onpopupshowing="buildHelpMenu();">
<menuitem id="appmenu_openHelp"
label="&helpMenu.label;"
oncommand="openHelpLink('firefox-help')"
@@ -358,6 +358,13 @@
<menuitem id="appmenu_safeMode"
label="&appMenuSafeMode.label;"
oncommand="restart(true);"/>
+#ifdef MOZ_UPDATER
+ <menuseparator/>
+ <menuitem id="appmenu_checkForUpdates"
+ class="menuitem-iconic"
+ label="&updateCmd.label;"
+ oncommand="checkForUpdates();"/>
+#endif
<menuseparator/>
<menuitem id="appmenu_about"
label="&aboutProduct.label;"
diff --git a/application/palemoon/base/content/browser-context.inc b/application/palemoon/base/content/browser-context.inc
index f672ede615..38c4725082 100644
--- a/application/palemoon/base/content/browser-context.inc
+++ b/application/palemoon/base/content/browser-context.inc
@@ -70,7 +70,7 @@
label="&mediaUnmute.label;"
accesskey="&mediaUnmute.accesskey;"
oncommand="gContextMenu.mediaCommand('unmute');"/>
- <menu id="context-media-playbackrate" label="&mediaPlaybackRate.label;" accesskey="&mediaPlaybackRate.accesskey;">
+ <menu id="context-media-playbackrate" label="&mediaPlaybackRate2.label;" accesskey="&mediaPlaybackRate2.accesskey;">
<menupopup>
<menuitem id="context-media-playbackrate-050x"
label="&mediaPlaybackRate050x.label;"
@@ -99,6 +99,11 @@
oncommand="gContextMenu.mediaCommand('playbackRate', 2.0);"/>
</menupopup>
</menu>
+ <menuitem id="context-media-loop"
+ label="&mediaLoop.label;"
+ accesskey="&mediaLoop.accesskey;"
+ type="checkbox"
+ oncommand="gContextMenu.mediaCommand('loop');"/>
<menuitem id="context-media-showcontrols"
label="&mediaShowControls.label;"
accesskey="&mediaShowControls.accesskey;"
diff --git a/application/palemoon/base/content/browser-fullScreen.js b/application/palemoon/base/content/browser-fullScreen.js
index b1235a8d31..e816ce5c14 100644
--- a/application/palemoon/base/content/browser-fullScreen.js
+++ b/application/palemoon/base/content/browser-fullScreen.js
@@ -53,17 +53,9 @@ var FullScreen = {
document.addEventListener("popupshown", this._setPopupOpen, false);
document.addEventListener("popuphidden", this._setPopupOpen, false);
this._shouldAnimate = true;
- // If it is not safe to collapse, add the mouse position tracker or
- // else it won't be possible to hide the navigation toolbox again
- if (!this._safeToCollapse(document.mozFullScreen)) {
- let rect = gBrowser.mPanelContainer.getBoundingClientRect();
- this._mouseTargetRect = {
- top: rect.top + 50,
- bottom: rect.bottom,
- left: rect.left,
- right: rect.right
- };
- MousePosTracker.addListener(this);
+ if (gPrefService.getBoolPref("browser.fullscreen.autohide")) {
+ gBrowser.mPanelContainer.addEventListener("mousemove",
+ this._collapseCallback, false);
}
// We don't animate the toolbar collapse if in DOM full-screen mode,
// as the size of the content area would still be changing after the
@@ -149,7 +141,8 @@ var FullScreen = {
cleanup: function () {
if (!window.fullScreen) {
- MousePosTracker.removeListener(this);
+ gBrowser.mPanelContainer.removeEventListener("mousemove",
+ this._collapseCallback, false);
document.removeEventListener("keypress", this._keyToggleCallback, false);
document.removeEventListener("popupshown", this._setPopupOpen, false);
document.removeEventListener("popuphidden", this._setPopupOpen, false);
@@ -164,17 +157,12 @@ var FullScreen = {
}
},
- getMouseTargetRect: function()
- {
- return this._mouseTargetRect;
- },
-
// Event callbacks
_expandCallback: function()
{
FullScreen.showNavToolbox();
},
- onMouseEnter: function()
+ _collapseCallback: function()
{
FullScreen.hideNavToolbox();
},
@@ -328,14 +316,8 @@ var FullScreen = {
// Track whether mouse is near the toolbox
this._isChromeCollapsed = false;
if (trackMouse) {
- let rect = gBrowser.mPanelContainer.getBoundingClientRect();
- this._mouseTargetRect = {
- top: rect.top + 50,
- bottom: rect.bottom,
- left: rect.left,
- right: rect.right
- };
- MousePosTracker.addListener(this);
+ gBrowser.mPanelContainer.addEventListener("mousemove",
+ this._collapseCallback, false);
}
},
@@ -378,7 +360,8 @@ var FullScreen = {
gNavToolbox.style.marginTop =
-gNavToolbox.getBoundingClientRect().height + "px";
this._isChromeCollapsed = true;
- MousePosTracker.removeListener(this);
+ gBrowser.mPanelContainer.removeEventListener("mousemove",
+ this._collapseCallback, false);
},
showXULChrome: function(aTag, aShow)
diff --git a/application/palemoon/base/content/browser-menudragging.js b/application/palemoon/base/content/browser-menudragging.js
index cf26b2ba42..f3f00d72cd 100644
--- a/application/palemoon/base/content/browser-menudragging.js
+++ b/application/palemoon/base/content/browser-menudragging.js
@@ -52,11 +52,9 @@ var browserMenuDragging = {
initPref: function(){
this.STAY_OPEN_ONDRAGEXIT =
- this.getPref('browser.menu.dragging.stayOpen',
- 'bool', false);
+ Services.prefs.getBoolPref('browser.menu.dragging.stayOpen', false);
this.DEBUG =
- this.getPref('browser.menu.dragging.debug',
- 'bool', false);
+ Services.prefs.getBoolPref('browser.menu.dragging.debug', false);
},
//delayed startup
@@ -291,26 +289,6 @@ var browserMenuDragging = {
.logStringMessage(aMsg);
},
- getPref: function(aPrefString, aPrefType, aDefault){
- var xpPref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- try{
- switch (aPrefType){
- case 'complex':
- return xpPref.getComplexValue(aPrefString, Components.interfaces.nsILocalFile); break;
- case 'str':
- return xpPref.getCharPref(aPrefString).toString(); break;
- case 'int':
- return xpPref.getIntPref(aPrefString); break;
- case 'bool':
- default:
- return xpPref.getBoolPref(aPrefString); break;
- }
- }catch(e){
- }
- return aDefault;
- },
-
setPref: function(aPrefString, aPrefType, aValue){
var xpPref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
diff --git a/application/palemoon/base/content/browser-title.css b/application/palemoon/base/content/browser-title.css
index 66b5e6731b..5f7e77564e 100644
--- a/application/palemoon/base/content/browser-title.css
+++ b/application/palemoon/base/content/browser-title.css
@@ -50,13 +50,6 @@
right: -12px;
}
-/* Lightweight Themes */
-
-#main-window:-moz-lwtheme::after {
- color: inherit;
- text-shadow: inherit;
-}
-
/* Windows Classic theme */
@media all and (-moz-windows-classic) {
@@ -192,6 +185,13 @@
}
+/* Lightweight Themes */
+
+#main-window:-moz-lwtheme::after {
+ color: inherit;
+ text-shadow: inherit;
+}
+
/* Hide for small windows */
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index eb4916e370..7672fa3a82 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -1147,7 +1147,7 @@ var gBrowserInit = {
// Setup click-and-hold gestures access to the session history
// menus if global click-and-hold isn't turned on
- if (!getBoolPref("ui.click_hold_context_menus", false))
+ if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false))
SetClickAndHoldHandlers();
// Initialize the full zoom setting.
@@ -1783,7 +1783,7 @@ function BrowserGoHome(aEvent) {
case "tabshifted":
case "tab":
urls = homePage.split("|");
- var loadInBackground = getBoolPref("browser.tabs.loadBookmarksInBackground", false);
+ var loadInBackground = Services.prefs.getBoolPref("browser.tabs.loadBookmarksInBackground", false);
gBrowser.loadTabs(urls, loadInBackground);
break;
case "window":
@@ -2661,6 +2661,11 @@ function getWebNavigation()
}
function BrowserReloadWithFlags(reloadFlags) {
+
+ // Reset DOS mitigation for auth prompts when user initiates a reload.
+ let browser = gBrowser.selectedBrowser;
+ delete browser.authPromptCounter;
+
/* First, we'll try to use the session history object to reload so
* that framesets are handled properly. If we're in a special
* window (such as view-source) that has no session history, fall
@@ -3397,7 +3402,7 @@ function BrowserCustomizeToolbar() {
TabsInTitlebar.allowedBy("customizing-toolbars", false);
var customizeURL = "chrome://global/content/customizeToolbar.xul";
- gCustomizeSheet = getBoolPref("toolbar.customization.usesheet", false);
+ gCustomizeSheet = Services.prefs.getBoolPref("toolbar.customization.usesheet", false);
if (gCustomizeSheet) {
let sheetFrame = document.createElement("iframe");
@@ -3481,7 +3486,7 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) {
cmd.removeAttribute("disabled");
// make sure to re-enable click-and-hold
- if (!getBoolPref("ui.click_hold_context_menus", false))
+ if (!Services.prefs.getBoolPref("ui.click_hold_context_menus", false))
SetClickAndHoldHandlers();
gBrowser.selectedBrowser.focus();
@@ -4408,7 +4413,13 @@ nsBrowserAccess.prototype = {
openURI: function (aURI, aOpener, aWhere, aContext) {
var newWindow = null;
- var isExternal = (aContext == Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
+ var isExternal = !!(aContext & Ci.nsIBrowserDOMWindow.OPEN_EXTERNAL);
+
+ if (aOpener && isExternal) {
+ Cu.reportError("nsBrowserAccess.openURI did not expect an opener to be " +
+ "passed if the context is OPEN_EXTERNAL.");
+ throw Cr.NS_ERROR_FAILURE;
+ }
if (isExternal && aURI && aURI.schemeIs("chrome")) {
dump("use -chrome command-line option to load external chrome urls\n");
@@ -5327,9 +5338,6 @@ function handleDroppedLink(event, urlOrLinks, name)
let lastLocationChange = gBrowser.selectedBrowser.lastLocationChange;
- let userContextId = gBrowser.selectedBrowser
- .getAttribute("usercontextid") || 0;
-
let inBackground = Services.prefs.getBoolPref("browser.tabs.loadInBackground");
if (event.shiftKey)
inBackground = !inBackground;
@@ -5348,7 +5356,6 @@ function handleDroppedLink(event, urlOrLinks, name)
replace: true,
allowThirdPartyFixup: false,
postDatas,
- userContextId,
});
}
});
diff --git a/application/palemoon/base/content/browser.xul b/application/palemoon/base/content/browser.xul
index ce2a7c5a8f..ddc305a7b8 100644
--- a/application/palemoon/base/content/browser.xul
+++ b/application/palemoon/base/content/browser.xul
@@ -965,7 +965,8 @@
tabcontainer="tabbrowser-tabs"
contentcontextmenu="contentAreaContextMenu"
autocompletepopup="PopupAutoComplete"
- datetimepicker="DateTimePickerPanel"/>
+ datetimepicker="DateTimePickerPanel"
+ authdosprotected="true"/>
<chatbar id="pinnedchats" layer="true" mousethrough="always" hidden="true"/>
<statuspanel id="statusbar-display" inactive="true"/>
</vbox>
diff --git a/application/palemoon/base/content/content.js b/application/palemoon/base/content/content.js
index 653dac3e3f..211a24a8bb 100644
--- a/application/palemoon/base/content/content.js
+++ b/application/palemoon/base/content/content.js
@@ -139,7 +139,6 @@ var handleContentContextMenu = function (event) {
let selectionInfo = BrowserUtils.getSelectionDetails(content);
let loadContext = docShell.QueryInterface(Ci.nsILoadContext);
- let userContextId = loadContext.originAttributes.userContextId;
let browser = docShell.chromeEventHandler;
let mainWin = browser.ownerGlobal;
@@ -160,7 +159,6 @@ var handleContentContextMenu = function (event) {
selectionInfo: selectionInfo,
loginFillInfo,
parentAllowsMixedContent,
- userContextId,
};
}
diff --git a/application/palemoon/base/content/nsContextMenu.js b/application/palemoon/base/content/nsContextMenu.js
index 1d4f888165..916dd2637a 100644
--- a/application/palemoon/base/content/nsContextMenu.js
+++ b/application/palemoon/base/content/nsContextMenu.js
@@ -381,6 +381,7 @@ nsContextMenu.prototype = {
this.showItem("context-media-mute", onMedia && !this.target.muted);
this.showItem("context-media-unmute", onMedia && this.target.muted);
this.showItem("context-media-playbackrate", onMedia);
+ this.showItem("context-media-loop", onMedia);
this.showItem("context-media-showcontrols", onMedia && !this.target.controls);
this.showItem("context-media-hidecontrols", onMedia && this.target.controls);
this.showItem("context-video-fullscreen", this.onVideo && this.target.ownerDocument.mozFullScreenElement == null);
@@ -394,6 +395,7 @@ nsContextMenu.prototype = {
this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0);
this.setItemAttr("context-media-playbackrate-150x", "checked", this.target.playbackRate == 1.5);
this.setItemAttr("context-media-playbackrate-200x", "checked", this.target.playbackRate == 2.0);
+ this.setItemAttr("context-media-loop", "checked", this.target.loop);
var hasError = this.target.error != null ||
this.target.networkState == this.target.NETWORK_NO_SOURCE;
this.setItemAttr("context-media-play", "disabled", hasError);
@@ -1531,6 +1533,9 @@ nsContextMenu.prototype = {
case "pause":
media.pause();
break;
+ case "loop":
+ media.loop = !media.loop;
+ break;
case "mute":
media.muted = true;
break;
diff --git a/application/palemoon/base/content/palemoon.xhtml b/application/palemoon/base/content/palemoon.xhtml
index 96757052c4..f145550a9c 100644
--- a/application/palemoon/base/content/palemoon.xhtml
+++ b/application/palemoon/base/content/palemoon.xhtml
@@ -13,7 +13,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset='utf-8' />
- <title>&chronicles.title.55.2;</title>
+ <title>&chronicles.title.66.1;</title>
<style type="text/css">
html {
@@ -54,11 +54,11 @@ a {
<section>
<p id="moztext">
- &chronicles.quote.55.2;
+ &chronicles.quote.66.1;
</p>
<p id="from">
- &chronicles.from.55.2;
+ &chronicles.from.66.1;
</p>
</section>
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
index 988cae55c4..868179b5d5 100644
--- a/application/palemoon/base/content/tabbrowser.xml
+++ b/application/palemoon/base/content/tabbrowser.xml
@@ -30,7 +30,7 @@
<xul:vbox flex="1" class="browserContainer">
<xul:stack flex="1" class="browserStack" anonid="browserStack">
<xul:browser anonid="initialBrowser" type="content-primary" message="true" disablehistory="true"
- xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,datetimepicker"/>
+ xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,datetimepicker,authdosprotected"/>
</xul:stack>
</xul:vbox>
</xul:hbox>
@@ -737,8 +737,7 @@
let autocomplete = this.mTabBrowser._placesAutocomplete;
if (this.mBrowser.registeredOpenURI) {
- autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI,
- this.mBrowser.getAttribute("usercontextid") || 0);
+ autocomplete.unregisterOpenPage(this.mBrowser.registeredOpenURI);
delete this.mBrowser.registeredOpenURI;
}
// Tabs in private windows aren't registered as "Open" so
@@ -746,8 +745,7 @@
if (!isBlankPageURL(aLocation.spec) &&
(!PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.permanentPrivateBrowsing)) {
- autocomplete.registerOpenPage(aLocation,
- this.mBrowser.getAttribute("usercontextid") || 0);
+ autocomplete.registerOpenPage(aLocation);
this.mBrowser.registeredOpenURI = aLocation;
}
}
@@ -1383,7 +1381,6 @@
let aTargetTab;
let aNewIndex = -1;
let aPostDatas = [];
- let aUserContextId;
if (arguments.length == 2 &&
typeof arguments[1] == "object") {
let params = arguments[1];
@@ -1394,7 +1391,6 @@
aNewIndex = typeof params.newIndex === "number" ?
params.newIndex : aNewIndex;
aPostDatas = params.postDatas || aPostDatas;
- aUserContextId = params.userContextId;
}
if (!aURIs.length)
@@ -1443,8 +1439,7 @@
ownerTab: owner,
skipAnimation: multiple,
allowThirdPartyFixup: aAllowThirdPartyFixup,
- postData: aPostDatas[0],
- userContextId: aUserContextId
+ postData: aPostDatas[0]
});
if (aNewIndex !== -1) {
this.moveTabTo(firstTabAdded, aNewIndex);
@@ -1457,8 +1452,7 @@
let tab = this.addTab(aURIs[i], {
skipAnimation: true,
allowThirdPartyFixup: aAllowThirdPartyFixup,
- postData: aPostDatas[i],
- userContextId: aUserContextId
+ postData: aPostDatas[i]
});
if (targetTabIndex !== -1)
this.moveTabTo(tab, ++tabNum);
@@ -1588,6 +1582,10 @@
if (this.hasAttribute("datetimepicker")) {
b.setAttribute("datetimepicker", this.getAttribute("datetimepicker"));
}
+
+ if (this.hasAttribute("authdosprotected")) {
+ b.setAttribute("authdosprotected", this.getAttribute("authdosprotected"));
+ }
// Create the browserStack container
var stack = document.createElementNS(NS_XUL, "stack");
@@ -2055,8 +2053,7 @@
this.mTabListeners[aTab._tPos].destroy();
if (browser.registeredOpenURI && !aTabWillBeMoved) {
- this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI,
- browser.getAttribute("usercontextid") || 0);
+ this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
delete browser.registeredOpenURI;
}
@@ -2424,8 +2421,7 @@
<![CDATA[
// If the current URI is registered as open remove it from the list.
if (aOurBrowser.registeredOpenURI) {
- this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI,
- aOurBrowser.getAttribute("usercontextid") || 0);
+ this._placesAutocomplete.unregisterOpenPage(aOurBrowser.registeredOpenURI);
delete aOurBrowser.registeredOpenURI;
}
@@ -2458,7 +2454,10 @@
<parameter name="aTab"/>
<body>
<![CDATA[
- this.getBrowserForTab(aTab).reload();
+ let browser = this.getBrowserForTab(aTab);
+ // Reset DOS mitigation for basic auth prompt
+ delete browser.authPromptCounter;
+ browser.reload();
]]>
</body>
</method>
@@ -3332,8 +3331,7 @@
for (var i = 0; i < this.mTabListeners.length; ++i) {
let browser = this.getBrowserAtIndex(i);
if (browser.registeredOpenURI) {
- this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI,
- browser.getAttribute("usercontextid") || 0);
+ this._placesAutocomplete.unregisterOpenPage(browser.registeredOpenURI);
delete browser.registeredOpenURI;
}
browser.webProgress.removeProgressListener(this.mTabFilters[i]);
@@ -4792,8 +4790,6 @@
inBackground = !inBackground;
let targetTab = this._getDragTargetTab(event);
- let userContextId = this.selectedItem
- .getAttribute("usercontextid") || 0;
let replace = !(!targetTab || dropEffect == "copy");
let newIndex = this._getDropIndex(event);
let urls = links.map(link => link.url);
@@ -4803,7 +4799,6 @@
allowThirdPartyFixup: true,
targetTab,
newIndex,
- userContextId,
});
}
diff --git a/application/palemoon/base/content/urlbarBindings.xml b/application/palemoon/base/content/urlbarBindings.xml
index d188e66585..d2d9cc7204 100644
--- a/application/palemoon/base/content/urlbarBindings.xml
+++ b/application/palemoon/base/content/urlbarBindings.xml
@@ -302,6 +302,10 @@
// but don't let that interfere with the loading of the url.
Cu.reportError(ex);
}
+
+ // Reset DOS mitigations for the basic auth prompt.
+ let browser = gBrowser.selectedBrowser;
+ delete browser.authPromptCounter;
function loadCurrent() {
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
diff --git a/application/palemoon/base/content/utilityOverlay.js b/application/palemoon/base/content/utilityOverlay.js
index 2c1a95f83c..c2a8baeed5 100644
--- a/application/palemoon/base/content/utilityOverlay.js
+++ b/application/palemoon/base/content/utilityOverlay.js
@@ -75,16 +75,6 @@ function openTopWin(url) {
openUILinkIn(url, "current");
}
-function getBoolPref(prefname, def)
-{
- try {
- return Services.prefs.getBoolPref(prefname);
- }
- catch(er) {
- return def;
- }
-}
-
/* openUILink handles clicks on UI elements that cause URLs to load.
*
* As the third argument, you may pass an object with the same properties as
@@ -151,7 +141,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
// ignoreButton allows "middle-click paste" to use function without always opening in a new window.
var middle = !ignoreButton && e.button == 1;
- var middleUsesTabs = getBoolPref("browser.tabs.opentabfor.middleclick", true);
+ var middleUsesTabs = Services.prefs.getBoolPref("browser.tabs.opentabfor.middleclick", true);
// Don't do anything special with right-mouse clicks. They're probably clicks on context menu items.
@@ -162,7 +152,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
#endif
return shift ? "tabshifted" : "tab";
- if (alt && getBoolPref("browser.altClickSave", false))
+ if (alt && Services.prefs.getBoolPref("browser.altClickSave", false))
return "save";
if (shift || (middle && !middleUsesTabs))
@@ -334,7 +324,7 @@ function openLinkIn(url, where, params) {
if (loadInBackground == null) {
loadInBackground = aFromChrome ?
false :
- getBoolPref("browser.tabs.loadInBackground");
+ Services.prefs.getBoolPref("browser.tabs.loadInBackground");
}
let uriObj;
@@ -515,7 +505,7 @@ function getShellService()
function isBidiEnabled() {
// first check the pref.
- if (getBoolPref("bidi.browser.ui", false))
+ if (Services.prefs.getBoolPref("bidi.browser.ui", false))
return true;
// if the pref isn't set, check for an RTL locale and force the pref to true
@@ -541,6 +531,117 @@ function isBidiEnabled() {
return rv;
}
+#ifdef MOZ_UPDATER
+/**
+ * Opens the update manager and checks for updates to the application.
+ */
+function checkForUpdates()
+{
+ var um =
+ Components.classes["@mozilla.org/updates/update-manager;1"].
+ getService(Components.interfaces.nsIUpdateManager);
+ var prompter =
+ Components.classes["@mozilla.org/updates/update-prompt;1"].
+ createInstance(Components.interfaces.nsIUpdatePrompt);
+
+ // If there's an update ready to be applied, show the "Update Downloaded"
+ // UI instead and let the user know they have to restart the application for
+ // the changes to be applied.
+ if (um.activeUpdate && um.activeUpdate.state == "pending")
+ prompter.showUpdateDownloaded(um.activeUpdate);
+ else
+ prompter.checkForUpdates();
+}
+#endif
+
+/**
+ * Set up the help menu software update items to show proper status,
+ * also disabling the items if update is disabled.
+ */
+function buildHelpMenu()
+{
+#ifdef MOZ_UPDATER
+ var updates =
+ Components.classes["@mozilla.org/updates/update-service;1"].
+ getService(Components.interfaces.nsIApplicationUpdateService);
+ var um =
+ Components.classes["@mozilla.org/updates/update-manager;1"].
+ getService(Components.interfaces.nsIUpdateManager);
+
+ // Disable the UI if the update enabled pref has been locked by the
+ // administrator or if we cannot update for some other reason.
+ var checkForUpdates = document.getElementById("checkForUpdates");
+ var appMenuCheckForUpdates = document.getElementById("appmenu_checkForUpdates");
+ var canCheckForUpdates = updates.canCheckForUpdates;
+ checkForUpdates.setAttribute("disabled", !canCheckForUpdates);
+ appMenuCheckForUpdates.setAttribute("disabled", !canCheckForUpdates);
+ if (!canCheckForUpdates)
+ return;
+
+ var strings = document.getElementById("bundle_browser");
+ var activeUpdate = um.activeUpdate;
+
+ // If there's an active update, substitute its name into the label
+ // we show for this item, otherwise display a generic label.
+ function getStringWithUpdateName(key) {
+ if (activeUpdate && activeUpdate.name)
+ return strings.getFormattedString(key, [activeUpdate.name]);
+ return strings.getString(key + "Fallback");
+ }
+
+ // By default, show "Check for Updates..." from updatesItem_default or
+ // updatesItem_defaultFallback
+ var key = "default";
+ if (activeUpdate) {
+ switch (activeUpdate.state) {
+ case "downloading":
+ // If we're downloading an update at present, show the text:
+ // "Downloading Thunderbird x.x..." from updatesItem_downloading or
+ // updatesItem_downloadingFallback, otherwise we're paused, and show
+ // "Resume Downloading Thunderbird x.x..." from updatesItem_resume or
+ // updatesItem_resumeFallback
+ key = updates.isDownloading ? "downloading" : "resume";
+ break;
+ case "pending":
+ // If we're waiting for the user to restart, show: "Apply Downloaded
+ // Updates Now..." from updatesItem_pending or
+ // updatesItem_pendingFallback
+ key = "pending";
+ break;
+ }
+ }
+
+ checkForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
+ appMenuCheckForUpdates.label = getStringWithUpdateName("updatesItem_" + key);
+ // updatesItem_default.accesskey, updatesItem_downloading.accesskey,
+ // updatesItem_resume.accesskey or updatesItem_pending.accesskey
+ checkForUpdates.accessKey = strings.getString("updatesItem_" + key +
+ ".accesskey");
+ appMenuCheckForUpdates.accessKey = strings.getString("updatesItem_" + key +
+ ".accesskey");
+ if (um.activeUpdate && updates.isDownloading) {
+ checkForUpdates.setAttribute("loading", "true");
+ appMenuCheckForUpdates.setAttribute("loading", "true");
+ } else {
+ checkForUpdates.removeAttribute("loading");
+ appMenuCheckForUpdates.removeAttribute("loading");
+ }
+#else
+#ifndef XP_MACOSX
+ // Some extensions may rely on these being present so only hide the about
+ // separator when there are no elements besides the check for updates menuitem
+ // in between the about separator and the updates separator.
+ var updatesSeparator = document.getElementById("updatesSeparator");
+ var aboutSeparator = document.getElementById("aboutSeparator");
+ var checkForUpdates = document.getElementById("checkForUpdates");
+ if (updatesSeparator.nextSibling === checkForUpdates &&
+ checkForUpdates.nextSibling === aboutSeparator)
+ updatesSeparator.hidden = true;
+#endif
+#endif
+}
+
+
function openAboutDialog() {
var enumerator = Services.wm.getEnumerator("Browser:About");
while (enumerator.hasMoreElements()) {
@@ -562,7 +663,7 @@ function openAboutDialog() {
function openPreferences(paneID, extraArgs)
{
- var instantApply = getBoolPref("browser.preferences.instantApply", false);
+ var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply", false);
var features = "chrome,titlebar,toolbar,centerscreen" + (instantApply ? ",dialog=no" : ",modal");
var win = Services.wm.getMostRecentWindow("Browser:Preferences");
@@ -743,7 +844,7 @@ function openHelpLink(aHelpTopic, aCalledFromModal) {
function openPrefsHelp() {
// non-instant apply prefwindows are usually modal, so we can't open in the topmost window,
// since its probably behind the window.
- var instantApply = getBoolPref("browser.preferences.instantApply");
+ var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
var helpTopic = document.getElementsByTagName("prefwindow")[0].currentPane.helpTopic;
openHelpLink(helpTopic, !instantApply);
diff --git a/application/palemoon/base/jar.mn b/application/palemoon/base/jar.mn
index 8931c02608..735b6d0cf0 100644
--- a/application/palemoon/base/jar.mn
+++ b/application/palemoon/base/jar.mn
@@ -18,9 +18,6 @@ browser.jar:
* content/browser/aboutDialog.xul (content/aboutDialog.xul)
* content/browser/aboutDialog.js (content/aboutDialog.js)
content/browser/aboutDialog.css (content/aboutDialog.css)
- content/browser/aboutRobots.xhtml (content/aboutRobots.xhtml)
- content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
- content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
content/browser/autorecovery.js (content/autorecovery.js)
content/browser/autorecovery.xul (content/autorecovery.xul)
* content/browser/browser.css (content/browser.css)
diff --git a/application/palemoon/branding/official/content/about-background.jpg b/application/palemoon/branding/official/content/about-background.jpg
new file mode 100644
index 0000000000..21e97986a0
--- /dev/null
+++ b/application/palemoon/branding/official/content/about-background.jpg
Binary files differ
diff --git a/application/palemoon/branding/official/content/about-background.png b/application/palemoon/branding/official/content/about-background.png
deleted file mode 100644
index 99dd74e58b..0000000000
--- a/application/palemoon/branding/official/content/about-background.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/branding/official/content/about-wordmark.png b/application/palemoon/branding/official/content/about-wordmark.png
index 5d51e1d4dc..bf09f15a06 100644
--- a/application/palemoon/branding/official/content/about-wordmark.png
+++ b/application/palemoon/branding/official/content/about-wordmark.png
Binary files differ
diff --git a/application/palemoon/branding/official/content/about-wordmark.svg b/application/palemoon/branding/official/content/about-wordmark.svg
index e0dcc255fc..166ea2c374 100644
--- a/application/palemoon/branding/official/content/about-wordmark.svg
+++ b/application/palemoon/branding/official/content/about-wordmark.svg
@@ -9,24 +9,57 @@
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="245.75363"
- height="34.463379"
+ width="314.56464"
+ height="44.113129"
id="svg2"
version="1.1"
- inkscape:version="0.48.5 r10040"
- sodipodi:docname="drawing.svg">
+ inkscape:version="0.92.1 r15371"
+ sodipodi:docname="about-wordmark.svg">
<defs
- id="defs4" />
+ id="defs4">
+ <filter
+ style="color-interpolation-filters:sRGB"
+ inkscape:label="Drop Shadow"
+ id="filter4610">
+ <feFlood
+ flood-opacity="1"
+ flood-color="rgb(252,252,247)"
+ result="flood"
+ id="feFlood4600" />
+ <feComposite
+ in="flood"
+ in2="SourceGraphic"
+ operator="in"
+ result="composite1"
+ id="feComposite4602" />
+ <feGaussianBlur
+ in="composite1"
+ stdDeviation="1"
+ result="blur"
+ id="feGaussianBlur4604" />
+ <feOffset
+ dx="2.77556e-017"
+ dy="0"
+ result="offset"
+ id="feOffset4606" />
+ <feComposite
+ in="SourceGraphic"
+ in2="offset"
+ operator="over"
+ result="composite2"
+ id="feComposite4608" />
+ </filter>
+ </defs>
<sodipodi:namedview
id="base"
- pagecolor="#ffffff"
+ pagecolor="#000000"
bordercolor="#666666"
borderopacity="1.0"
- inkscape:pageopacity="0.0"
+ inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="1.979899"
- inkscape:cx="122.96783"
- inkscape:cy="-35.932748"
+ inkscape:cx="140.32026"
+ inkscape:cy="-32.25665"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@@ -55,77 +88,91 @@
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- transform="translate(-51.826283,-53.778809)">
+ transform="translate(-29.067649,-53.687969)">
<text
xml:space="preserve"
- style="font-size:48px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500"
- x="32.324883"
- y="30.087807"
- id="text2985"
- sodipodi:linespacing="125%"><tspan
+ style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"
+ x="34.479874"
+ y="32.093662"
+ id="text2985"><tspan
sodipodi:role="line"
id="tspan2987"
- x="32.324883"
- y="30.087807" /></text>
+ x="34.479874"
+ y="32.093662"
+ style="font-size:51.20000076px;line-height:1.25;stroke-width:1.06666672"> </tspan></text>
<flowRoot
xml:space="preserve"
id="flowRoot2989"
- style="font-size:48px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500"><flowRegion
- id="flowRegion2991"><rect
+ style="font-style:normal;font-weight:normal;font-size:12.80000019px;line-height:0.01%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1.06666672"><flowRegion
+ id="flowRegion2991"
+ style="stroke-width:1.06666672"><rect
id="rect2993"
- width="654.57886"
- height="371.73615"
- x="44.446712"
- y="104.8391" /></flowRegion><flowPara
- id="flowPara2995" /></flowRoot> <g
- id="g3795">
+ width="698.21747"
+ height="396.51855"
+ x="47.409828"
+ y="111.82838"
+ style="stroke-width:1.13777781" /></flowRegion><flowPara
+ id="flowPara2995"
+ style="font-size:51.20000076px;line-height:1.25;stroke-width:1.06666672"> </flowPara></flowRoot> <g
+ id="g3795"
+ style="filter:url(#filter4610)">
<g
id="text2997"
- style="font-size:48px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#262678;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500">
+ style="font-style:normal;font-weight:normal;font-size:48px;line-height:125%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#262678;fill-opacity:1;stroke:none">
<path
id="path3779"
- d="m 54.9464,87.666504 0,-29.759766 -3.120117,0 0,-4.127929 14.928222,0 c 3.135722,3.3e-5 5.687722,0.96805 7.656006,2.904052 1.968235,1.936065 2.952365,4.503933 2.952393,7.703614 -2.8e-5,3.199727 -0.99197,5.791765 -2.97583,7.776123 -1.98391,1.984388 -4.528097,2.976575 -7.632569,2.976562 l -7.007812,0 0,12.527344 z m 4.800293,-16.655274 6.240234,0 c 1.983381,1.7e-5 3.55125,-0.592023 4.703613,-1.776123 1.152322,-1.184062 1.728494,-2.800027 1.728516,-4.8479 -2.2e-5,-2.016576 -0.568137,-3.600803 -1.704346,-4.752686 -1.13625,-1.151826 -2.696063,-1.727753 -4.679443,-1.727783 l -6.288574,0 z"
- inkscape:connector-curvature="0" />
+ d="M 58.609493,93.510938 V 61.767187 h -3.328124 v -4.403124 h 15.923436 c 3.34477,3.5e-5 6.066904,1.032587 8.166407,3.097655 2.09945,2.065136 3.149189,4.804196 3.149219,8.217189 -3e-5,3.413042 -1.058101,6.177882 -3.174219,8.294531 -2.11617,2.11668 -4.82997,3.175013 -8.141407,3.174999 h -7.474999 v 13.362501 z m 5.120313,-17.765626 h 6.656249 c 2.115607,1.8e-5 3.788,-0.631491 5.017188,-1.894531 1.229143,-1.263 1.843727,-2.986696 1.84375,-5.171094 -2.3e-5,-2.151014 -0.606013,-3.840856 -1.817969,-5.069531 -1.212,-1.228615 -2.875801,-1.842937 -4.991406,-1.842969 h -6.707812 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3781"
- d="m 80.184193,80.850586 c -2e-6,-1.248039 0.256101,-2.360098 0.76831,-3.336182 0.512204,-0.976063 1.224362,-1.744128 2.136475,-2.304199 0.912104,-0.560045 1.856194,-1.031969 2.832275,-1.415771 0.976066,-0.383775 2.080069,-0.663804 3.312012,-0.840088 1.231921,-0.176255 2.24779,-0.288315 3.047607,-0.336182 0.79979,-0.04784 1.647934,-0.07176 2.544434,-0.07178 l 1.056152,0 0,-0.240235 c -1.7e-5,-2.11131 -0.416032,-3.607158 -1.248047,-4.487548 -0.832046,-0.880351 -2.208021,-1.320536 -4.127929,-1.320557 -0.896496,2.1e-5 -1.784679,0.136007 -2.664551,0.407959 -0.879891,0.271993 -1.319832,0.76003 -1.319824,1.464111 l 0,1.393067 -4.368164,0 0,-2.400879 c -4e-6,-0.927713 0.312007,-1.719705 0.936035,-2.375977 0.624018,-0.656227 1.431878,-1.12815 2.423584,-1.415771 0.991691,-0.287574 1.887686,-0.487525 2.687988,-0.599854 0.800282,-0.11228 1.584217,-0.168432 2.351807,-0.168457 3.680648,2.5e-5 6.264874,0.840112 7.752685,2.520264 1.487772,1.680196 2.231668,4.008075 2.231688,6.983642 l 0,10.319825 c -2e-5,0.704105 0.35203,1.056156 1.05615,1.056152 l 1.96729,0 0,3.984375 -4.3667,0 c -2.01662,0 -3.02492,-0.928222 -3.024902,-2.784668 l 0.09668,-1.439941 -0.09668,0 c -0.06349,0.127933 -0.143329,0.303959 -0.239502,0.528076 -0.09621,0.224124 -0.360369,0.608157 -0.792481,1.152099 -0.432145,0.543948 -0.920182,1.023928 -1.464111,1.439942 -0.54396,0.416016 -1.279799,0.800049 -2.20752,1.152099 -0.927746,0.352051 -1.935558,0.528076 -3.023437,0.528076 -2.240242,0 -4.17652,-0.656005 -5.808838,-1.968017 -1.632327,-1.312009 -2.448488,-3.119869 -2.448486,-5.423584 z m 5.66455,-2.831543 c -0.639655,0.671884 -0.959479,1.535653 -0.959472,2.591309 -7e-6,1.05567 0.399895,1.967534 1.199707,2.735595 0.799796,0.76807 1.919912,1.152103 3.360351,1.1521 1.855456,3e-6 3.399156,-0.807857 4.631104,-2.423584 1.231917,-1.615716 1.847883,-3.383536 1.8479,-5.303467 l 0,-0.815918 -1.199707,0 c -1.183609,1.2e-5 -2.21559,0.03981 -3.095947,0.119385 -0.880383,0.0796 -1.904552,0.255626 -3.07251,0.528076 -1.167978,0.272472 -2.071785,0.744639 -2.711426,1.416504 z"
- inkscape:connector-curvature="0" />
+ d="m 85.529806,86.240625 c -2e-6,-1.331242 0.273174,-2.517438 0.819531,-3.558594 0.54635,-1.041134 1.305986,-1.860403 2.278906,-2.457812 0.972911,-0.597382 1.97994,-1.100767 3.021094,-1.510156 1.041137,-0.40936 2.21874,-0.708058 3.532812,-0.896094 1.314049,-0.188005 2.397643,-0.307536 3.250781,-0.358594 0.853109,-0.05103 1.7578,-0.07654 2.71406,-0.07656 h 1.12657 v -0.256251 c -2e-5,-2.252064 -0.44377,-3.847635 -1.33125,-4.786718 -0.88752,-0.939041 -2.355227,-1.408572 -4.403129,-1.408594 -0.956263,2.2e-5 -1.903658,0.145074 -2.842188,0.435156 -0.93855,0.290126 -1.407821,0.810699 -1.407812,1.561719 v 1.485938 h -4.659375 v -2.560938 c -4e-6,-0.98956 0.332807,-1.834352 0.998437,-2.534375 0.665619,-0.699976 1.527337,-1.20336 2.585156,-1.510156 1.057804,-0.306746 2.013532,-0.520027 2.867188,-0.639844 0.853634,-0.119766 1.689831,-0.179661 2.508594,-0.179688 3.926029,2.7e-5 6.682529,0.89612 8.269529,2.688282 1.58696,1.792209 2.38045,4.27528 2.38047,7.449218 v 11.007813 c -2e-5,0.751046 0.3755,1.126567 1.12656,1.126562 h 2.09844 v 4.25 h -4.65781 c -2.15106,0 -3.22658,-0.990103 -3.22656,-2.970312 l 0.10312,-1.535937 h -0.10312 c -0.0677,0.136462 -0.15289,0.324223 -0.25547,0.563281 -0.10263,0.239065 -0.3844,0.648701 -0.84532,1.228905 -0.46095,0.580212 -0.98152,1.09219 -1.561714,1.535939 -0.580224,0.44375 -1.365119,0.853385 -2.354688,1.228905 -0.989596,0.375521 -2.064596,0.563281 -3.225,0.563281 -2.389591,0 -4.454955,-0.699738 -6.196094,-2.099218 -1.741149,-1.399476 -2.61172,-3.32786 -2.611718,-5.785156 z m 6.042187,-3.020312 c -0.682299,0.716676 -1.023445,1.638029 -1.023437,2.764062 -8e-6,1.126048 0.426554,2.098703 1.279687,2.917968 0.853116,0.819275 2.047906,1.22891 3.584375,1.228907 1.979153,3e-6 3.625766,-0.861714 4.939842,-2.585156 1.31405,-1.723431 1.97108,-3.609105 1.9711,-5.657032 V 81.01875 h -1.27969 c -1.262519,1.3e-5 -2.363298,0.04246 -3.302346,0.127344 -0.939075,0.08491 -2.031522,0.272668 -3.277344,0.563281 -1.245843,0.290637 -2.209904,0.794282 -2.892187,1.510938 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3783"
- d="m 108.54943,84.594727 0,-25.776856 c -1e-5,-0.703095 -0.35206,-1.054658 -1.05616,-1.054687 l -1.96875,0 0,-3.984375 4.6084,0 c 1.08789,3.3e-5 1.87182,0.240023 2.35181,0.71997 0.47997,0.480013 0.71996,1.263948 0.71997,2.351807 l 0,25.775391 c -1e-5,0.704105 0.35204,1.056156 1.05615,1.056152 l 1.96875,0 0,3.984375 -4.6084,0 c -1.08789,0 -1.87183,-0.23999 -2.3518,-0.719971 -0.47999,-0.479979 -0.71998,-1.263914 -0.71997,-2.351806 z"
- inkscape:connector-curvature="0" />
+ d="M 115.78606,90.234375 V 62.739062 c -1e-5,-0.749968 -0.37553,-1.124968 -1.12657,-1.124999 h -2.1 v -4.25 h 4.91562 c 1.16042,3.5e-5 1.99661,0.256024 2.5086,0.767968 0.51197,0.512014 0.76796,1.348211 0.76797,2.508594 v 27.49375 c -10e-6,0.751046 0.37551,1.126567 1.12656,1.126563 h 2.1 v 4.25 h -4.91563 c -1.16041,0 -1.99662,-0.25599 -2.50858,-0.767969 -0.51199,-0.511978 -0.76798,-1.348175 -0.76797,-2.508594 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3785"
- d="m 119.13732,75.522949 c 0,-3.808578 1.15185,-6.88084 3.45556,-9.216797 2.30371,-2.335913 5.21581,-3.503881 8.73633,-3.503906 3.29588,2.5e-5 5.86375,1.072045 7.70362,3.216065 1.83982,2.144062 2.75974,4.86403 2.75976,8.159912 l -0.14355,1.92041 -17.71289,0 c 0.1289,2.496103 0.99315,4.472175 2.59277,5.928222 1.5996,1.456059 3.51952,2.184086 5.75976,2.184082 1.24804,4e-6 2.4641,-0.239986 3.6482,-0.71997 1.18406,-0.479976 2.04807,-0.944087 2.59204,-1.392334 l 0.86426,-0.720703 2.01562,3.312011 c -0.25588,0.256839 -0.63991,0.585208 -1.1521,0.985108 -0.51223,0.399904 -1.58425,0.927735 -3.21606,1.583496 -1.63186,0.655761 -3.29592,0.983642 -4.99219,0.983642 -3.80763,0 -6.91138,-1.208007 -9.31128,-3.624023 -2.3999,-2.41601 -3.59985,-5.447745 -3.59985,-9.095215 z m 4.99219,-2.833008 12.86279,0 c -0.0635,-1.951155 -0.63918,-3.470928 -1.72705,-4.559326 -1.08791,-1.088358 -2.41603,-1.632547 -3.98438,-1.632568 -1.82423,2.1e-5 -3.38429,0.536153 -4.68017,1.608398 -1.29591,1.072284 -2.11964,2.600115 -2.47119,4.583496 z"
- inkscape:connector-curvature="0" />
+ d="m 127.07981,80.557812 c 0,-4.062483 1.22864,-7.339562 3.68593,-9.83125 2.45729,-2.49164 5.56353,-3.737473 9.31875,-3.7375 3.51561,2.7e-5 6.25467,1.143515 8.2172,3.43047 1.96247,2.286999 2.94372,5.188298 2.94374,8.703906 l -0.15312,2.048437 h -18.89375 c 0.13749,2.66251 1.05936,4.77032 2.76562,6.323437 1.70624,1.55313 3.75416,2.329692 6.14375,2.329687 1.33124,5e-6 2.62837,-0.255985 3.89141,-0.767968 1.263,-0.511974 2.18461,-1.007026 2.76484,-1.485156 l 0.92188,-0.76875 2.14999,3.532812 c -0.27294,0.273962 -0.68257,0.624222 -1.2289,1.050782 -0.54638,0.426564 -1.68987,0.989584 -3.43047,1.689062 -1.74065,0.699479 -3.51565,1.049218 -5.325,1.049218 -4.06147,0 -7.37214,-1.28854 -9.93203,-3.865624 -2.5599,-2.577077 -3.83984,-5.810928 -3.83984,-9.701563 z m 5.325,-3.021875 h 13.72031 c -0.0677,-2.081232 -0.68179,-3.702323 -1.84219,-4.863281 -1.16043,-1.160915 -2.5771,-1.741383 -4.25,-1.741406 -1.94585,2.3e-5 -3.60991,0.571897 -4.99218,1.715625 -1.38231,1.143769 -2.26095,2.773456 -2.63594,4.889062 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3787"
- d="m 157.83702,87.666504 0,-4.12793 1.63184,0 c 0.64062,4e-6 0.99267,-0.352046 1.05615,-1.056152 l 2.3042,-28.703613 4.94385,0 7.96875,17.95166 1.68018,4.271484 0.0952,0 c 0.57615,-1.631823 1.13621,-3.055649 1.68018,-4.271484 l 7.96875,-17.95166 4.94384,0 2.3042,28.703613 c 0.0634,0.704106 0.415,1.056156 1.05469,1.056152 l 1.58496,0 0,4.12793 -4.27295,0 c -1.0557,0 -1.81546,-0.23999 -2.27929,-0.719971 -0.4639,-0.479979 -0.72806,-1.263914 -0.79248,-2.351806 l -1.39161,-17.904786 -0.0952,-4.990722 -0.0967,0 c -0.63968,2.111352 -1.23148,3.774924 -1.77539,4.990722 l -6.86426,14.879883 -4.03271,0 -6.86426,-14.879883 c -0.25587,-0.511697 -0.53566,-1.191628 -0.83936,-2.039795 -0.30372,-0.84812 -0.53565,-1.559789 -0.6958,-2.135009 l -0.28857,-0.864258 -0.0952,0 c 0.0312,2.015649 -9.8e-4,3.695335 -0.0967,5.039062 l -1.34326,17.904786 c -0.0645,1.087892 -0.32862,1.871827 -0.79248,2.351806 -0.46387,0.479981 -1.23975,0.719971 -2.32764,0.719971 z"
- inkscape:connector-curvature="0" />
+ d="m 168.35949,93.510938 v -4.403126 h 1.74063 c 0.68333,5e-6 1.05885,-0.375515 1.12656,-1.126562 l 2.45781,-30.617187 h 5.27344 l 8.5,19.148437 1.79219,4.55625 h 0.10155 c 0.61456,-1.740611 1.21196,-3.259359 1.79219,-4.55625 l 8.5,-19.148437 h 5.27343 l 2.45781,30.617187 c 0.0676,0.751047 0.44267,1.126567 1.12501,1.126562 h 1.69062 v 4.403126 h -4.55781 c -1.12608,0 -1.93649,-0.25599 -2.43125,-0.767969 -0.49482,-0.511978 -0.77659,-1.348175 -0.84531,-2.508594 L 200.87198,71.135937 200.77043,65.8125 h -0.10314 c -0.68233,2.252109 -1.31358,4.026586 -1.89375,5.323437 l -7.32188,15.871875 h -4.30156 l -7.32188,-15.871875 c -0.27292,-0.54581 -0.57137,-1.27107 -0.89531,-2.175781 -0.32397,-0.904662 -0.57136,-1.663775 -0.74219,-2.277343 l -0.30781,-0.921875 h -0.10154 c 0.0333,2.150025 -0.001,3.94169 -0.10315,5.374999 l -1.43281,19.098438 c -0.0688,1.160419 -0.35053,1.996616 -0.84531,2.508594 -0.4948,0.511979 -1.3224,0.767969 -2.48282,0.767969 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3789"
- d="m 203.55333,84.594727 c -2.52734,-2.432612 -3.79101,-5.472892 -3.79101,-9.12085 0,-3.647933 1.26391,-6.671856 3.79175,-9.071777 2.52782,-2.399879 5.61595,-3.599829 9.2644,-3.599854 3.67967,2.5e-5 6.78343,1.199975 9.31128,3.599854 2.5278,2.399921 3.79172,5.423844 3.79175,9.071777 -3e-5,3.647958 -1.272,6.687994 -3.81592,9.120117 -2.54397,2.43213 -5.63991,3.648193 -9.28784,3.648193 -3.64796,0 -6.73609,-1.215819 -9.26441,-3.64746 z m 3.38379,-15.312012 c -1.61524,1.631853 -2.42286,3.695815 -2.42285,6.191894 -1e-5,2.496104 0.80785,4.57618 2.42358,6.240235 1.61572,1.664067 3.57592,2.496097 5.88062,2.496093 2.33592,4e-6 4.31175,-0.82397 5.92749,-2.471923 1.6157,-1.647942 2.42356,-3.736075 2.42358,-6.264405 -2e-5,-2.496079 -0.80788,-4.560041 -2.42358,-6.191894 -1.61574,-1.631816 -3.59157,-2.447733 -5.92749,-2.447754 -2.3047,2.1e-5 -4.26515,0.815938 -5.88135,2.447754 z"
- inkscape:connector-curvature="0" />
+ d="m 217.12355,90.234375 c -2.69583,-2.594786 -4.04374,-5.837751 -4.04374,-9.728906 0,-3.891129 1.34817,-7.116647 4.04453,-9.676562 2.69634,-2.559871 5.99035,-3.839818 9.88203,-3.839845 3.92498,2.7e-5 7.23566,1.279974 9.93203,3.839845 2.69632,2.559915 4.0445,5.785433 4.04453,9.676562 -3e-5,3.891155 -1.3568,7.13386 -4.07031,9.728125 -2.71357,2.594272 -6.01591,3.891405 -9.90703,3.891405 -3.89116,0 -7.18516,-1.296873 -9.88204,-3.890624 z m 3.60938,-16.332812 c -1.72292,1.740643 -2.58439,3.942202 -2.58438,6.604687 -1e-5,2.662511 0.86171,4.881258 2.58516,6.65625 1.72343,1.775005 3.81431,2.662504 6.27266,2.662499 2.49165,5e-6 4.5992,-0.878901 6.32265,-2.636717 1.72342,-1.757805 2.58513,-3.985147 2.58516,-6.682032 -3e-5,-2.662485 -0.86174,-4.864044 -2.58516,-6.604687 -1.72345,-1.740604 -3.831,-2.610916 -6.32265,-2.610938 -2.45835,2.2e-5 -4.5495,0.870334 -6.27344,2.610938 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3791"
- d="m 233.17833,84.594727 c -2.52734,-2.432612 -3.79101,-5.472892 -3.79101,-9.12085 0,-3.647933 1.26391,-6.671856 3.79175,-9.071777 2.52782,-2.399879 5.61595,-3.599829 9.2644,-3.599854 3.67967,2.5e-5 6.78343,1.199975 9.31128,3.599854 2.5278,2.399921 3.79172,5.423844 3.79175,9.071777 -3e-5,3.647958 -1.272,6.687994 -3.81592,9.120117 -2.54397,2.43213 -5.63991,3.648193 -9.28784,3.648193 -3.64796,0 -6.73609,-1.215819 -9.26441,-3.64746 z m 3.38379,-15.312012 c -1.61524,1.631853 -2.42286,3.695815 -2.42285,6.191894 -1e-5,2.496104 0.80785,4.57618 2.42358,6.240235 1.61572,1.664067 3.57592,2.496097 5.88062,2.496093 2.33592,4e-6 4.31175,-0.82397 5.92749,-2.471923 1.6157,-1.647942 2.42356,-3.736075 2.42358,-6.264405 -2e-5,-2.496079 -0.80788,-4.560041 -2.42358,-6.191894 -1.61574,-1.631816 -3.59157,-2.447733 -5.92749,-2.447754 -2.3047,2.1e-5 -4.26515,0.815938 -5.88135,2.447754 z"
- inkscape:connector-curvature="0" />
+ d="m 248.72355,90.234375 c -2.69583,-2.594786 -4.04374,-5.837751 -4.04374,-9.728906 0,-3.891129 1.34817,-7.116647 4.04453,-9.676562 2.69634,-2.559871 5.99035,-3.839818 9.88203,-3.839845 3.92498,2.7e-5 7.23566,1.279974 9.93203,3.839845 2.69632,2.559915 4.0445,5.785433 4.04453,9.676562 -3e-5,3.891155 -1.3568,7.13386 -4.07031,9.728125 -2.71357,2.594272 -6.01591,3.891405 -9.90703,3.891405 -3.89116,0 -7.18516,-1.296873 -9.88204,-3.890624 z m 3.60938,-16.332812 c -1.72292,1.740643 -2.58439,3.942202 -2.58438,6.604687 -1e-5,2.662511 0.86171,4.881258 2.58516,6.65625 1.72343,1.775005 3.81431,2.662504 6.27266,2.662499 2.49165,5e-6 4.5992,-0.878901 6.32265,-2.636717 1.72342,-1.757805 2.58513,-3.985147 2.58516,-6.682032 -3e-5,-2.662485 -0.86174,-4.864044 -2.58516,-6.604687 -1.72345,-1.740604 -3.831,-2.610916 -6.32265,-2.610938 -2.45835,2.2e-5 -4.5495,0.870334 -6.27344,2.610938 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3793"
- d="m 261.36339,87.666504 0,-19.248047 c 0,-0.704082 -0.35205,-1.056132 -1.05615,-1.056152 l -1.96729,0 0,-3.984375 4.46338,0 c 2.04785,2.4e-5 3.07177,0.896019 3.07178,2.687988 l 0,0.912598 -0.0952,1.391601 0.0952,0 c 0.64062,-1.375956 1.72899,-2.647927 3.26514,-3.815918 1.53612,-1.167944 3.48777,-1.751928 5.85498,-1.751953 2.84861,2.5e-5 4.95286,0.768091 6.31274,2.304199 1.35984,1.536154 2.03977,3.872089 2.0398,7.007813 l 0,10.511719 c -3e-5,0.704105 0.35202,1.056156 1.05615,1.056152 l 1.96728,0 0,3.984375 -4.60693,0 c -1.08791,0 -1.87185,-0.23999 -2.35181,-0.719971 -0.48,-0.479979 -0.71999,-1.263914 -0.71997,-2.351806 l 0,-11.424317 c -2e-5,-1.952132 -0.31203,-3.456037 -0.93603,-4.511719 -0.62405,-1.055644 -1.83205,-1.583475 -3.62403,-1.583496 -1.85646,2.1e-5 -3.48072,0.552022 -4.8728,1.656006 -1.3921,1.104022 -2.32789,2.535905 -2.80737,4.295654 -0.2881,0.832046 -0.43214,1.919935 -0.43213,3.263672 l 0,11.375977 z"
- inkscape:connector-curvature="0" />
+ d="M 278.78762,93.510938 V 72.979687 c 0,-0.75102 -0.37552,-1.12654 -1.12656,-1.126562 h -2.09845 v -4.25 h 4.76094 c 2.18438,2.6e-5 3.27656,0.955754 3.27657,2.867188 v 0.973437 l -0.10155,1.484375 h 0.10155 c 0.68333,-1.467687 1.84425,-2.824456 3.48281,-4.070313 1.63853,-1.245807 3.72029,-1.868723 6.24532,-1.86875 3.03851,2.7e-5 5.28305,0.819297 6.73358,2.457813 1.4505,1.638564 2.17576,4.130228 2.17579,7.475 v 11.2125 c -3e-5,0.751046 0.37549,1.126567 1.12656,1.126563 h 2.09843 v 4.25 h -4.91406 c -1.16043,0 -1.99664,-0.25599 -2.50859,-0.767969 -0.512,-0.511978 -0.76799,-1.348175 -0.76797,-2.508594 V 78.048437 c -2e-5,-2.082274 -0.33283,-3.686439 -0.99843,-4.8125 -0.66566,-1.12602 -1.95419,-1.68904 -3.86563,-1.689062 -1.98023,2.2e-5 -3.71277,0.588823 -5.19766,1.766406 -1.4849,1.177624 -2.48308,2.704965 -2.99453,4.582031 -0.3073,0.887516 -0.46095,2.047931 -0.46093,3.48125 v 12.134376 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
</g>
<g
id="text3769"
- style="font-size:10px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#262678;fill-opacity:1;stroke:none;font-family:Museo 500;-inkscape-font-specification:Museo 500">
+ style="font-style:normal;font-weight:normal;font-size:10px;line-height:125%;font-family:'Museo 500';-inkscape-font-specification:'Museo 500';letter-spacing:0px;word-spacing:0px;fill:#262678;fill-opacity:1;stroke:none">
<path
id="path3774"
- d="m 285.52277,60.897457 0,-6.199951 -1.41999,0 c -0.14669,6e-6 -0.22003,0.07335 -0.22003,0.220032 l 0,0.449829 -0.88989,0 0,-0.929871 c 0,-0.226637 0.0433,-0.383294 0.12985,-0.469971 0.0866,-0.08666 0.24328,-0.129997 0.47012,-0.130004 l 4.85993,0 c 0.22664,7e-6 0.38329,0.04334 0.46997,0.130004 0.0867,0.08668 0.13,0.243334 0.13,0.469971 l 0,0.929871 -0.88989,0 0,-0.449829 c 0,-0.146682 -0.0734,-0.220026 -0.22003,-0.220032 l -1.41998,0 0,6.199951 z"
- inkscape:connector-curvature="0" />
+ d="m 304.55762,64.957287 v -6.613281 h -1.51465 c -0.15647,7e-6 -0.2347,0.07824 -0.2347,0.234701 v 0.479818 h -0.94922 v -0.991863 c 0,-0.241746 0.0462,-0.408847 0.13851,-0.501302 0.0924,-0.09244 0.2595,-0.138663 0.50146,-0.138671 h 5.18392 c 0.24175,8e-6 0.40885,0.04623 0.50131,0.138671 0.0925,0.09246 0.13866,0.259556 0.13866,0.501302 v 0.991863 h -0.94921 v -0.479818 c 0,-0.156461 -0.0783,-0.234694 -0.2347,-0.234701 h -1.51465 v 6.613281 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
<path
id="path3776"
- d="m 289.40979,60.897457 0,-0.859985 0.33997,0 c 0.13346,10e-7 0.2068,-0.07334 0.22003,-0.220032 l 0.48004,-5.979919 1.02997,0 1.66015,3.739929 0.35004,0.889892 0.0198,0 c 0.12003,-0.339963 0.23671,-0.636593 0.35003,-0.889892 l 1.66016,-3.739929 1.02997,0 0.48004,5.979919 c 0.0132,0.146689 0.0865,0.220033 0.21973,0.220032 l 0.3302,0 0,0.859985 -0.8902,0 c -0.21994,0 -0.37822,-0.05 -0.47486,-0.149994 -0.0966,-0.09999 -0.15167,-0.263315 -0.1651,-0.489959 l -0.28991,-3.730164 -0.0198,-1.039734 -0.0201,0 c -0.13327,0.439865 -0.25656,0.786443 -0.36987,1.039734 l -1.43006,3.099976 -0.84015,0 -1.43005,-3.099976 c -0.0533,-0.106604 -0.11159,-0.248256 -0.17487,-0.424957 -0.0633,-0.176692 -0.11159,-0.324957 -0.14495,-0.444794 l -0.0601,-0.180054 -0.0198,0 c 0.007,0.419927 -2.1e-4,0.769862 -0.0201,1.049805 l -0.27985,3.730164 c -0.0134,0.226644 -0.0685,0.389964 -0.1651,0.489959 -0.0966,0.1 -0.25828,0.149994 -0.48492,0.149994 z"
- inkscape:connector-curvature="0" />
+ d="M 308.70378,64.957287 V 64.03997 h 0.36263 c 0.14236,10e-7 0.22059,-0.07823 0.2347,-0.234701 l 0.51204,-6.37858 h 1.09864 l 1.77082,3.989258 0.37338,0.949218 h 0.0211 c 0.12803,-0.362627 0.25249,-0.679033 0.37336,-0.949218 l 1.77084,-3.989258 h 1.09864 l 0.51204,6.37858 c 0.0141,0.156469 0.0923,0.234702 0.23438,0.234701 h 0.35221 v 0.917317 h -0.94955 c -0.2346,0 -0.40343,-0.05333 -0.50651,-0.159993 -0.10304,-0.106656 -0.16178,-0.280869 -0.17611,-0.522623 l -0.30924,-3.978842 -0.0211,-1.109049 h -0.0214 c -0.14215,0.469189 -0.27366,0.838872 -0.39452,1.109049 l -1.5254,3.306641 h -0.89616 l -1.52539,-3.306641 c -0.0568,-0.113711 -0.11903,-0.264806 -0.18653,-0.453287 -0.0675,-0.188472 -0.11903,-0.346621 -0.15461,-0.474447 l -0.0641,-0.192058 h -0.0211 c 0.007,0.447922 -2.2e-4,0.821186 -0.0214,1.119792 l -0.2985,3.978842 c -0.0143,0.241754 -0.0731,0.415962 -0.17611,0.522623 -0.10304,0.106667 -0.2755,0.159993 -0.51725,0.159993 z"
+ inkscape:connector-curvature="0"
+ style="stroke-width:1.06666672" />
</g>
</g>
</g>
diff --git a/application/palemoon/branding/official/content/aboutDialog.css b/application/palemoon/branding/official/content/aboutDialog.css
index dbf04ae0a7..5bcc229e70 100644
--- a/application/palemoon/branding/official/content/aboutDialog.css
+++ b/application/palemoon/branding/official/content/aboutDialog.css
@@ -3,41 +3,51 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#aboutPMDialogContainer {
- background-image: url("chrome://branding/content/about-background.png");
+ background-image: url("chrome://branding/content/about-background.jpg");
background-repeat: no-repeat;
- background-color: #F7F7F7;
- background-size: cover;
- color: #000020;
+ background-color: #9ABCD5;
+ color: #101020;
}
-#PMleftBox {
- /* background-image: url("chrome://branding/content/about-logo.png"); */
+#aboutHeaderBox {
+ background-image: url("chrome://branding/content/about-wordmark.png");
background-repeat: no-repeat;
- /* min-width and min-height create room for the logo */
- min-width: 210px;
- min-height: 210px;
- margin-top:20px;
- -moz-margin-start: 30px;
+ background-position: center center;
+ height: 44px;
}
-#PMrightBox {
- margin-left: 30px;
- margin-right: 30px;
+#aboutVersionBox {
+ text-shadow: 1px 1px 0px #9ABCD5;
}
-#PMbottomBox {
- padding: 15px 10px 0;
- background-color: rgba(240,240,255,.7);
-}
+#aboutTextBox {
+ animation: 3s fadeIn;
+ animation-fill-mode: forwards;
+ text-shadow: 1px 1px 0px #9ABCD5;
+ color: #101020;
+}
-#PMupdateDeck > hbox > label:not([class="text-link"]) {
- color: #909090;
+@keyframes fadeIn {
+ 0% {
+ opacity: 0;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
+
+#aboutLinkBox {
+ padding: 15px 10px 0;
}
-#PMtrademark {
- font-size: xx-small;
+#aboutPMtrademark {
+ font-size: 10px;
text-align: center;
- color: #999999;
+ color: #C0C0C0;
+ text-shadow: 1px 1px 0px #000000;
margin-top: 10px;
margin-bottom: 10px;
}
diff --git a/application/palemoon/branding/official/content/jar.mn b/application/palemoon/branding/official/content/jar.mn
index d8038bf9e1..83ef1ed15e 100644
--- a/application/palemoon/branding/official/content/jar.mn
+++ b/application/palemoon/branding/official/content/jar.mn
@@ -5,7 +5,7 @@
browser.jar:
% content branding %content/branding/ contentaccessible=yes
content/branding/about.png (about.png)
- content/branding/about-background.png (about-background.png)
+ content/branding/about-background.jpg (about-background.jpg)
content/branding/about-logo.png (about-logo.png)
content/branding/about-logo@2x.png (about-logo@2x.png)
content/branding/about-wordmark.png (about-wordmark.png)
diff --git a/application/palemoon/branding/shared/pref/preferences.inc b/application/palemoon/branding/shared/pref/preferences.inc
index 721c2c90ea..8b085c417f 100644
--- a/application/palemoon/branding/shared/pref/preferences.inc
+++ b/application/palemoon/branding/shared/pref/preferences.inc
@@ -1,6 +1,3 @@
-#define APO_AM_URL addons.palemoon.org/integration/addon-manager
-#define APO_AUS_ARGS reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
-
// ===| General |==============================================================
pref("startup.homepage_welcome_url","http://www.palemoon.org/firstrun.shtml");
@@ -29,15 +26,12 @@ pref("app.update.promptWaitTime", 172800);
// ===| Add-ons Manager |======================================================
// Add-on window fixes
-pref("extensions.getMoreThemesURL", "https://@APO_AM_URL@/external/themes");
+pref("extensions.getMoreThemesURL", "https://addons.palemoon.org/themes/");
// Extensions Blocklist
pref("extensions.blocklist.url","http://blocklist.palemoon.org/%VERSION%/blocklist.xml");
pref("extensions.blocklist.itemURL", "http://blocklist.palemoon.org/info/?id=%blockID%");
-// Dictionary URL
-pref("browser.dictionaries.download.url", "https://addons.mozilla.org/%LOCALE%/firefox/dictionaries/");
-
pref("extensions.update.autoUpdateDefault", true); // Automatically update extensions by default
pref("extensions.getAddons.maxResults", 10);
pref("extensions.getAddons.cache.enabled", false);
diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc
index 5679566408..36a0ae1453 100644
--- a/application/palemoon/branding/shared/pref/uaoverrides.inc
+++ b/application/palemoon/branding/shared/pref/uaoverrides.inc
@@ -57,12 +57,16 @@ pref("@GUAO_PREF@.www.amazon.com","Mozilla/5.0 (@OS_SLICE@ rv:45.9) @GK_SLICE@ F
pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
// Daily motion only likes strict Firefox UAs
pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (@OS_SLICE@ rv:52.0) @GK_SLICE@ Firefox/52.0");
+// Financial Times' polyfill.io breaks horribly on a Pale Moon UA. Send a strict Firefox UA instead.
+pref("@GUAO_PREF@.polyfill.io","Mozilla/5.0 (@OS_SLICE@ rv:60.9) @GK_SLICE@ Firefox/60.9");
+
// The following requires native mode. Or it blocks.. "too old firefox", breakage, etc.
pref("@GUAO_PREF@.deviantart.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
pref("@GUAO_PREF@.deviantart.net","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
pref("@GUAO_PREF@.altibox.dk","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
pref("@GUAO_PREF@.altibox.no","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
+pref("@GUAO_PREF@.firefox.com","Mozilla/5.0 (@OS_SLICE@ rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@");
// UA-Sniffing domains below have indicated no interest in supporting Pale Moon (BOO!)
pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (@OS_SLICE@ rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)");
diff --git a/application/palemoon/branding/unofficial/content/about-background.png b/application/palemoon/branding/unofficial/content/about-background.png
index 006818637f..c034041f61 100644
--- a/application/palemoon/branding/unofficial/content/about-background.png
+++ b/application/palemoon/branding/unofficial/content/about-background.png
Binary files differ
diff --git a/application/palemoon/branding/unofficial/content/about-wordmark.png b/application/palemoon/branding/unofficial/content/about-wordmark.png
deleted file mode 100644
index 41889ba399..0000000000
--- a/application/palemoon/branding/unofficial/content/about-wordmark.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/branding/unofficial/content/about-wordmark.svg b/application/palemoon/branding/unofficial/content/about-wordmark.svg
deleted file mode 100644
index fd0f1745ee..0000000000
--- a/application/palemoon/branding/unofficial/content/about-wordmark.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-
-<svg version="1.1" id="aboutWordmark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="132px" height="48px" viewBox="0 0 132 48" xml:space="preserve">
-
- <path fill="#55575C"/>
-
-</svg>
diff --git a/application/palemoon/branding/unofficial/content/aboutDialog.css b/application/palemoon/branding/unofficial/content/aboutDialog.css
index 3f7c5ec235..5cc6b428ac 100644
--- a/application/palemoon/branding/unofficial/content/aboutDialog.css
+++ b/application/palemoon/branding/unofficial/content/aboutDialog.css
@@ -9,16 +9,11 @@
color: #fff;
}
-.text-link {
- color: #eef !important;
+#aboutVersionBox {
+ /* No wordmark: leave empty space */
+ margin-top: 20px;
}
-#PMrightBox {
- /* this margin prevents text from overlapping the planet image */
- margin-left: 280px;
- margin-right: 20px;
-}
-
-#PMbottomBox {
- background-color: rgba(0,0,0,.7);
+#aboutLinkBox {
+ padding: 15px 10px 20px;
}
diff --git a/application/palemoon/branding/unofficial/content/jar.mn b/application/palemoon/branding/unofficial/content/jar.mn
index bdb1e81296..3536957928 100644
--- a/application/palemoon/branding/unofficial/content/jar.mn
+++ b/application/palemoon/branding/unofficial/content/jar.mn
@@ -8,7 +8,6 @@ browser.jar:
content/branding/about-background.png (about-background.png)
content/branding/about-logo.png (about-logo.png)
content/branding/about-logo@2x.png (about-logo@2x.png)
- content/branding/about-wordmark.svg (about-wordmark.svg)
content/branding/icon48.png (icon48.png)
content/branding/icon64.png (icon64.png)
content/branding/icon16.png (../default16.png)
diff --git a/application/palemoon/branding/unstable/content/about-background.jpg b/application/palemoon/branding/unstable/content/about-background.jpg
new file mode 100644
index 0000000000..a33b33183b
--- /dev/null
+++ b/application/palemoon/branding/unstable/content/about-background.jpg
Binary files differ
diff --git a/application/palemoon/branding/unstable/content/about-background.png b/application/palemoon/branding/unstable/content/about-background.png
deleted file mode 100644
index 3d20e06586..0000000000
--- a/application/palemoon/branding/unstable/content/about-background.png
+++ /dev/null
Binary files differ
diff --git a/application/palemoon/branding/unstable/content/about-wordmark.png b/application/palemoon/branding/unstable/content/about-wordmark.png
index deb60b6b9c..bf09f15a06 100644
--- a/application/palemoon/branding/unstable/content/about-wordmark.png
+++ b/application/palemoon/branding/unstable/content/about-wordmark.png
Binary files differ
diff --git a/application/palemoon/branding/unstable/content/about-wordmark.svg b/application/palemoon/branding/unstable/content/about-wordmark.svg
deleted file mode 100644
index fd0f1745ee..0000000000
--- a/application/palemoon/branding/unstable/content/about-wordmark.svg
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-
-<svg version="1.1" id="aboutWordmark" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="132px" height="48px" viewBox="0 0 132 48" xml:space="preserve">
-
- <path fill="#55575C"/>
-
-</svg>
diff --git a/application/palemoon/branding/unstable/content/aboutDialog.css b/application/palemoon/branding/unstable/content/aboutDialog.css
index 9af49ba109..de71f259c2 100644
--- a/application/palemoon/branding/unstable/content/aboutDialog.css
+++ b/application/palemoon/branding/unstable/content/aboutDialog.css
@@ -3,45 +3,51 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#aboutPMDialogContainer {
- background-image: url("chrome://branding/content/about-background.png");
+ background-image: url("chrome://branding/content/about-background.jpg");
background-repeat: no-repeat;
- background-color: #100000;
- background-size: cover;
- color: #E0E0FF;
+ background-color: #D5BC9A;
+ color: #202010;
}
-#PMleftBox {
- background-image: url("chrome://branding/content/about-logo.png");
+#aboutHeaderBox {
+ background-image: url("chrome://branding/content/about-wordmark.png");
background-repeat: no-repeat;
- /* min-width and min-height create room for the logo */
- min-width: 210px;
- min-height: 210px;
- margin-top:20px;
- -moz-margin-start: 30px;
+ background-position: center center;
+ height: 44px;
}
-#PMrightBox {
- margin-left: 30px;
- margin-right: 30px;
+#aboutVersionBox {
+ text-shadow: 1px 1px 0px #D5BC9A;
}
-#detailsBox > description > .text-link {
- color: #CDC36F;
+#aboutTextBox {
+ animation: 3s fadeIn;
+ animation-fill-mode: forwards;
+ text-shadow: 1px 1px 0px #D5BC9A;
+ color: #202010;
}
-#PMbottomBox {
- padding: 15px 10px 0;
- background-color: rgba(240,240,255,.7);
-}
+@keyframes fadeIn {
+ 0% {
+ opacity: 0;
+ }
+ 50% {
+ opacity: 0;
+ }
+ 100% {
+ opacity: 1;
+ }
+}
-#PMupdateDeck > hbox > label:not([class="text-link"]) {
- color: #909090;
+#aboutLinkBox {
+ padding: 15px 10px 0;
}
-#PMtrademark {
- font-size: xx-small;
+#aboutPMtrademark {
+ font-size: 10px;
text-align: center;
- color: #333333;
+ color: #C0C0C0;
+ text-shadow: 1px 1px 0px #000000;
margin-top: 10px;
margin-bottom: 10px;
}
diff --git a/application/palemoon/branding/unstable/content/jar.mn b/application/palemoon/branding/unstable/content/jar.mn
index 6903e9ac52..fcb7890318 100644
--- a/application/palemoon/branding/unstable/content/jar.mn
+++ b/application/palemoon/branding/unstable/content/jar.mn
@@ -5,7 +5,7 @@
browser.jar:
% content branding %content/branding/ contentaccessible=yes
content/branding/about.png (about.png)
- content/branding/about-background.png (about-background.png)
+ content/branding/about-background.jpg (about-background.jpg)
content/branding/about-logo.png (about-logo.png)
content/branding/about-logo@2x.png (about-logo@2x.png)
content/branding/about-wordmark.png (about-wordmark.png)
diff --git a/application/palemoon/components/BrowserComponents.manifest b/application/palemoon/components/BrowserComponents.manifest
index b7f054eab0..0ff14d066d 100644
--- a/application/palemoon/components/BrowserComponents.manifest
+++ b/application/palemoon/components/BrowserComponents.manifest
@@ -10,7 +10,6 @@ contract @mozilla.org/network/protocol/about;1?what=palemoon {8cc51368-6aa0-43e8
contract @mozilla.org/network/protocol/about;1?what=permissions {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
contract @mozilla.org/network/protocol/about;1?what=privatebrowsing {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
contract @mozilla.org/network/protocol/about;1?what=rights {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
-contract @mozilla.org/network/protocol/about;1?what=robots {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
contract @mozilla.org/network/protocol/about;1?what=sessionrestore {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
#ifdef MOZ_SERVICES_SYNC
contract @mozilla.org/network/protocol/about;1?what=sync-progress {8cc51368-6aa0-43e8-b762-bde9b9fd828c}
diff --git a/application/palemoon/components/nsAboutRedirector.js b/application/palemoon/components/nsAboutRedirector.js
index 9c7d7953fe..4d99a78f57 100644
--- a/application/palemoon/components/nsAboutRedirector.js
+++ b/application/palemoon/components/nsAboutRedirector.js
@@ -61,10 +61,6 @@ AboutRedirector.prototype = {
url: "chrome://global/content/aboutRights.xhtml",
flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | MAKE_LINKABLE | ALLOW_SCRIPT)
},
- "robots": {
- url: "chrome://browser/content/aboutRobots.xhtml",
- flags: (URI_SAFE_FOR_UNTRUSTED_CONTENT | ALLOW_SCRIPT | HIDE_FROM_ABOUTABOUT)
- },
"sessionrestore": {
url: "chrome://browser/content/aboutSessionRestore.xhtml",
flags: ALLOW_SCRIPT
diff --git a/application/palemoon/components/places/content/places.js b/application/palemoon/components/places/content/places.js
index a941938237..40dbcb9b86 100644
--- a/application/palemoon/components/places/content/places.js
+++ b/application/palemoon/components/places/content/places.js
@@ -491,7 +491,7 @@ var PlacesOrganizer = {
Task.spawn(function() {
try {
- yield BookmarkJSONUtils.importFromFile(aFile, true);
+ yield BookmarkJSONUtils.importFromFile(aFile.path, true);
} catch(ex) {
PlacesOrganizer._showErrorAlert(PlacesUIUtils.getString("bookmarksRestoreParseError"));
}
@@ -519,7 +519,7 @@ var PlacesOrganizer = {
let fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
let fpCallback = function fpCallback_done(aResult) {
if (aResult != Ci.nsIFilePicker.returnCancel) {
- BookmarkJSONUtils.exportToFile(fp.file);
+ BookmarkJSONUtils.exportToFile(fp.file.path);
}
};
diff --git a/application/palemoon/components/preferences/connection.js b/application/palemoon/components/preferences/connection.js
index c1dd1bb6d0..da038c925b 100644
--- a/application/palemoon/components/preferences/connection.js
+++ b/application/palemoon/components/preferences/connection.js
@@ -63,7 +63,7 @@ var gConnectionsDialog = {
autologinProxyPref.disabled = proxyTypePref.value == 0;
var noProxiesPref = document.getElementById("network.proxy.no_proxies_on");
- noProxiesPref.disabled = proxyTypePref.value != 1;
+ noProxiesPref.disabled = proxyTypePref.value == 0;
var autoconfigURLPref = document.getElementById("network.proxy.autoconfig_url");
autoconfigURLPref.disabled = proxyTypePref.value != 2;
diff --git a/application/palemoon/components/preferences/connection.xul b/application/palemoon/components/preferences/connection.xul
index 491bf48787..e6079dd54d 100644
--- a/application/palemoon/components/preferences/connection.xul
+++ b/application/palemoon/components/preferences/connection.xul
@@ -138,9 +138,6 @@
<radio id="networkProxySOCKSVersion5" value="5" label="&socks5.label;" accesskey="&socks5.accesskey;"/>
</radiogroup>
</row>
- <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
- <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
- <label value="&noproxyExplain.label;" control="networkProxyNone"/>
</rows>
</grid>
<radio value="2" label="&autoTypeRadio.label;" accesskey="&autoTypeRadio.accesskey;"/>
@@ -154,6 +151,9 @@
</hbox>
</radiogroup>
<separator class="thin"/>
+ <label value="&noproxy.label;" accesskey="&noproxy.accesskey;" control="networkProxyNone"/>
+ <textbox id="networkProxyNone" preference="network.proxy.no_proxies_on" multiline="true" rows="2"/>
+ <label value="&noproxyExplain.label;" control="networkProxyNone"/>
<checkbox id="autologinProxy" preference="signon.autologin.proxy"
label="&autologinproxy.label;" accesskey="&autologinproxy.accesskey;"
tooltiptext="&autologinproxy.tooltip;"/>
diff --git a/application/palemoon/components/preferences/newtaburl.js b/application/palemoon/components/preferences/newtaburl.js
index ac0eec1c53..3c82df8460 100644
--- a/application/palemoon/components/preferences/newtaburl.js
+++ b/application/palemoon/components/preferences/newtaburl.js
@@ -22,7 +22,11 @@ var gNewtabUrl = {
return;
}
} else {
- newtabUrlChoice = Services.prefs.getIntPref("browser.newtab.choice");
+ if (this.newtabUrlChoiceIsSet) {
+ newtabUrlChoice = Services.prefs.getIntPref("browser.newtab.choice");
+ } else {
+ newtabUrlChoice = this.getNewtabChoice();
+ }
}
if (browserHomepageUrl || browserHomepageUrl == "") {
if (Services.prefs.getBoolPref("browser.preferences.instantApply")) {
@@ -64,5 +68,35 @@ var gNewtabUrl = {
}
Services.prefs.setCharPref("browser.newtab.url",newtabUrlPref);
} catch(e) { console.error(e); }
+ },
+
+ /**
+ * Determines the value of browser.newtab.choice based
+ * on the value of browser.newtab.url
+ *
+ * @returns the value of browser.newtab.choice
+ */
+ getNewtabChoice: function() {
+ let newtabUrlPref = Services.prefs.getCharPref("browser.newtab.url");
+ let browserHomepageUrl = Services.prefs.getComplexValue("browser.startup.homepage",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ let newtabUrlSanitizedPref = browserHomepageUrl.split("|")[0];
+ let defaultStartupHomepage = Services.prefs.getDefaultBranch("browser.")
+ .getComplexValue("startup.homepage",
+ Components.interfaces.nsIPrefLocalizedString).data;
+ switch (newtabUrlPref) {
+ case "about:logopage":
+ return 1;
+ case defaultStartupHomepage:
+ return 2;
+ case newtabUrlSanitizedPref:
+ return 3;
+ case "about:newtab":
+ return 4;
+ default: // Custom URL entered.
+ // We need this to consider instantApply.
+ this.newtabPageCustom = newtabUrlPref;
+ return 0;
+ }
}
};
diff --git a/application/palemoon/components/preferences/tabs.js b/application/palemoon/components/preferences/tabs.js
index 17084a7703..b09cb60dfb 100644
--- a/application/palemoon/components/preferences/tabs.js
+++ b/application/palemoon/components/preferences/tabs.js
@@ -78,34 +78,13 @@ var gTabsPane = {
/**
* Determines the value of the New Tab display drop-down based
* on the value of browser.newtab.url.
- *
- * @returns the appropriate value of browser.newtab.choice
*/
readNewtabUrl: function() {
- let newtabUrlPref = document.getElementById("browser.newtab.url");
- let newtabUrlSanitizedPref = document.getElementById("browser.newtab.myhome");
let newtabUrlChoice = document.getElementById("browser.newtab.choice");
- let defaultStartupHomepage = Services.prefs.getDefaultBranch("browser.")
- .getComplexValue("startup.homepage",
- Components.interfaces.nsIPrefLocalizedString).data;
- switch (newtabUrlPref.value) {
- case "about:logopage":
- newtabUrlChoice.value = 1;
- break;
- case defaultStartupHomepage:
- newtabUrlChoice.value = 2;
- break;
- case newtabUrlSanitizedPref.value:
- newtabUrlChoice.value = 3;
- break;
- case "about:newtab":
- newtabUrlChoice.value = 4;
- break;
- default: // Custom URL entered.
- document.getElementById("newtabPageCustom").hidden = false;
- newtabUrlChoice.value = 0;
- // We need this to consider instantApply.
- this.newtabPageCustom = newtabUrlPref.value;
+ newtabUrlChoice.value = gNewtabUrl.getNewtabChoice();
+ if (newtabUrlChoice.value == 0) {
+ document.getElementById("newtabPageCustom").hidden = false;
}
+ gNewtabUrl.newtabUrlChoiceIsSet = true;
}
};
diff --git a/application/palemoon/config/version.txt b/application/palemoon/config/version.txt
index 136b56ea88..dc6d771323 100644
--- a/application/palemoon/config/version.txt
+++ b/application/palemoon/config/version.txt
@@ -1 +1 @@
-28.4.0a1 \ No newline at end of file
+28.5.0a1 \ No newline at end of file
diff --git a/application/palemoon/confvars.sh b/application/palemoon/confvars.sh
index 26b02fc854..6216cba5b3 100644
--- a/application/palemoon/confvars.sh
+++ b/application/palemoon/confvars.sh
@@ -99,7 +99,6 @@ if test "$OS_ARCH" = "WINNT" -o \
fi
# Short-circuit a few services to be removed
-MOZ_MAINTENANCE_SERVICE=
MOZ_SERVICES_HEALTHREPORT=
MOZ_ADDON_SIGNING=0
MOZ_REQUIRE_SIGNING=0
diff --git a/application/palemoon/installer/package-manifest.in b/application/palemoon/installer/package-manifest.in
index 1247d31714..d8722bf08b 100644
--- a/application/palemoon/installer/package-manifest.in
+++ b/application/palemoon/installer/package-manifest.in
@@ -318,13 +318,6 @@
@RESPATH@/chrome/pippki@JAREXT@
@RESPATH@/chrome/pippki.manifest
-; for Solaris SPARC
-#ifdef SOLARIS
-bin/libfreebl_32fpu_3.so
-bin/libfreebl_32int_3.so
-bin/libfreebl_32int64_3.so
-#endif
-
; [Updater]
;
#ifdef MOZ_UPDATER
diff --git a/application/palemoon/installer/windows/Makefile.in b/application/palemoon/installer/windows/Makefile.in
index 9b0f697c81..d2be8aec2c 100644
--- a/application/palemoon/installer/windows/Makefile.in
+++ b/application/palemoon/installer/windows/Makefile.in
@@ -14,12 +14,6 @@ INSTALLER_FILES = \
nsis/shared.nsh \
$(NULL)
-ifdef MOZ_MAINTENANCE_SERVICE
-INSTALLER_FILES += \
- nsis/maintenanceservice_installer.nsi \
- $(NULL)
-endif
-
BRANDING_FILES = \
branding.nsi \
appname.bmp \
@@ -58,17 +52,6 @@ uninstaller::
--preprocess-locale $(topsrcdir) \
$(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
-# For building the maintenanceservice installer
-ifdef MOZ_MAINTENANCE_SERVICE
-maintenanceservice_installer::
- $(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
- $(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
- $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
- $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
- --preprocess-locale $(topsrcdir) \
- $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
-endif
-
$(CONFIG_DIR)/setup.exe::
$(RM) -r $(CONFIG_DIR)
$(MKDIR) $(CONFIG_DIR)
diff --git a/application/palemoon/installer/windows/nsis/defines.nsi.in b/application/palemoon/installer/windows/nsis/defines.nsi.in
index edef802a90..1764b10c40 100644
--- a/application/palemoon/installer/windows/nsis/defines.nsi.in
+++ b/application/palemoon/installer/windows/nsis/defines.nsi.in
@@ -51,10 +51,6 @@
!define MinSupportedCPU "SSE2"
-#ifdef MOZ_MAINTENANCE_SERVICE
-!define MOZ_MAINTENANCE_SERVICE
-#endif
-
# File details shared by both the installer and uninstaller
VIProductVersion "1.0.0.0"
VIAddVersionKey "ProductName" "${BrandShortName}"
diff --git a/application/palemoon/installer/windows/nsis/installer.nsi b/application/palemoon/installer/windows/nsis/installer.nsi
index 276b94f742..9216bb6e1f 100644
--- a/application/palemoon/installer/windows/nsis/installer.nsi
+++ b/application/palemoon/installer/windows/nsis/installer.nsi
@@ -165,11 +165,6 @@ Page custom preOptions leaveOptions
!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
!insertmacro MUI_PAGE_DIRECTORY
-; Custom Components Page
-!ifdef MOZ_MAINTENANCE_SERVICE
-Page custom preComponents leaveComponents
-!endif
-
; Custom Shortcuts Page
Page custom preShortcuts leaveShortcuts
@@ -427,41 +422,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndIf}
-!ifdef MOZ_MAINTENANCE_SERVICE
- ; If the maintenance service page was displayed then a value was already
- ; explicitly selected for installing the maintenance service and
- ; and so InstallMaintenanceService will already be 0 or 1.
- ; If the maintenance service page was not displayed then
- ; InstallMaintenanceService will be equal to "".
- ${If} $InstallMaintenanceService == ""
- Call IsUserAdmin
- Pop $R0
- ${If} $R0 == "true"
- ; Only proceed if we have HKLM write access
- ${AndIf} $TmpVal == "HKLM"
- ; On Windows < XP SP3 we do not install the maintenance service.
- ${If} ${IsWinXP}
- ${AndIf} ${AtMostServicePack} 2
- StrCpy $InstallMaintenanceService "0"
- ${Else}
- ; The user is an admin, so we should default to installing the service.
- StrCpy $InstallMaintenanceService "1"
- ${EndIf}
- ${Else}
- ; The user is not admin, so we can't install the service.
- StrCpy $InstallMaintenanceService "0"
- ${EndIf}
- ${EndIf}
-
- ${If} $InstallMaintenanceService == "1"
- ; The user wants to install the maintenance service, so execute
- ; the pre-packaged maintenance service installer.
- ; This option can only be turned on if the user is an admin so there
- ; is no need to use ExecShell w/ verb runas to enforce elevated.
- nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
- ${EndIf}
-!endif
-
; These need special handling on uninstall since they may be overwritten by
; an install into a different location.
StrCpy $0 "Software\Microsoft\Windows\CurrentVersion\App Paths\${FileMainEXE}"
@@ -578,13 +538,6 @@ Section "-Application" APP_IDX
${EndIf}
${EndUnless}
${EndIf}
-
-!ifdef MOZ_MAINTENANCE_SERVICE
- ${If} $TmpVal == "HKLM"
- ; Add the registry keys for allowed certificates.
- ${AddMaintCertKeys}
- ${EndIf}
-!endif
SectionEnd
; Cleanup operations to perform at the end of the installation.
@@ -948,59 +901,6 @@ Function leaveShortcuts
${EndIf}
FunctionEnd
-!ifdef MOZ_MAINTENANCE_SERVICE
-Function preComponents
- ; If the service already exists, don't show this page
- ServicesHelper::IsInstalled "MozillaMaintenance"
- Pop $R9
- ${If} $R9 == 1
- ; The service already exists so don't show this page.
- Abort
- ${EndIf}
-
- ; On Windows < XP SP3 we do not install the maintenance service.
- ${If} ${IsWinXP}
- ${AndIf} ${AtMostServicePack} 2
- Abort
- ${EndIf}
-
- ; Don't show the custom components page if the
- ; user is not an admin
- Call IsUserAdmin
- Pop $R9
- ${If} $R9 != "true"
- Abort
- ${EndIf}
-
- ; Only show the maintenance service page if we have write access to HKLM
- ClearErrors
- WriteRegStr HKLM "Software\Mozilla" \
- "${BrandShortName}InstallerTest" "Write Test"
- ${If} ${Errors}
- ClearErrors
- Abort
- ${Else}
- DeleteRegValue HKLM "Software\Mozilla" "${BrandShortName}InstallerTest"
- ${EndIf}
-
- StrCpy $PageName "Components"
- ${CheckCustomCommon}
- !insertmacro MUI_HEADER_TEXT "$(COMPONENTS_PAGE_TITLE)" "$(COMPONENTS_PAGE_SUBTITLE)"
- !insertmacro MUI_INSTALLOPTIONS_DISPLAY "components.ini"
-FunctionEnd
-
-Function leaveComponents
- ${MUI_INSTALLOPTIONS_READ} $0 "components.ini" "Settings" "State"
- ${If} $0 != 0
- Abort
- ${EndIf}
- ${MUI_INSTALLOPTIONS_READ} $InstallMaintenanceService "components.ini" "Field 2" "State"
- ${If} $InstallType == ${INSTALLTYPE_CUSTOM}
- Call CheckExistingInstall
- ${EndIf}
-FunctionEnd
-!endif
-
Function preSummary
StrCpy $PageName "Summary"
; Setup the summary.ini file for the Custom Summary Page
@@ -1180,7 +1080,6 @@ Function .onInit
!insertmacro InitInstallOptionsFile "options.ini"
!insertmacro InitInstallOptionsFile "shortcuts.ini"
- !insertmacro InitInstallOptionsFile "components.ini"
!insertmacro InitInstallOptionsFile "summary.ini"
WriteINIStr "$PLUGINSDIR\options.ini" "Settings" NumFields "5"
@@ -1255,36 +1154,6 @@ Function .onInit
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" Bottom "50"
WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 3" State "1"
- ; Don't offer to install the quick launch shortcut on Windows 7
- ${Unless} ${AtLeastWin7}
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Type "checkbox"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Text "$(ICONS_QUICKLAUNCH)"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Left "0"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Right "-1"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Top "60"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" Bottom "70"
- WriteINIStr "$PLUGINSDIR\shortcuts.ini" "Field 4" State "1"
- ${EndUnless}
-
- ; Setup the components.ini file for the Components Page
- WriteINIStr "$PLUGINSDIR\components.ini" "Settings" NumFields "2"
-
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Type "label"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Text "$(OPTIONAL_COMPONENTS_DESC)"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Left "0"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Right "-1"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Top "5"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 1" Bottom "25"
-
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Type "checkbox"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Text "$(MAINTENANCE_SERVICE_CHECKBOX_DESC)"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Left "0"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Right "-1"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Top "27"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Bottom "37"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" State "1"
- WriteINIStr "$PLUGINSDIR\components.ini" "Field 2" Flags "GROUP"
-
; There must always be a core directory.
${GetSize} "$EXEDIR\core\" "/S=0K" $R5 $R7 $R8
SectionSetSize ${APP_IDX} $R5
diff --git a/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi b/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi
deleted file mode 100644
index 1f73bac6a0..0000000000
--- a/application/palemoon/installer/windows/nsis/maintenanceservice_installer.nsi
+++ /dev/null
@@ -1,332 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
-!verbose 3
-
-; 7-Zip provides better compression than the lzma from NSIS so we add the files
-; uncompressed and use 7-Zip to create a SFX archive of it
-SetDatablockOptimize on
-SetCompress off
-CRCCheck on
-
-RequestExecutionLevel admin
-
-; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
-; be removed after we require NSIS 3.0a2 or greater.
-!ifdef NSIS_PACKEDVERSION
- Unicode true
- ManifestSupportedOS all
- ManifestDPIAware true
-!endif
-
-!addplugindir ./
-
-; Variables
-Var TempMaintServiceName
-Var BrandFullNameDA
-Var BrandFullName
-
-; Other included files may depend upon these includes!
-; The following includes are provided by NSIS.
-!include FileFunc.nsh
-!include LogicLib.nsh
-!include MUI.nsh
-!include WinMessages.nsh
-!include WinVer.nsh
-!include WordFunc.nsh
-
-!insertmacro GetOptions
-!insertmacro GetParameters
-!insertmacro GetSize
-
-; The test slaves use this fallback key to run tests.
-; And anyone that wants to run tests themselves should already have
-; this installed.
-!define FallbackKey \
- "SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
-
-!define CompanyName "Mozilla Corporation"
-!define BrandFullNameInternal ""
-
-; The following includes are custom.
-!include defines.nsi
-; We keep defines.nsi defined so that we get other things like
-; the version number, but we redefine BrandFullName
-!define MaintFullName "Mozilla Maintenance Service"
-!undef BrandFullName
-!define BrandFullName "${MaintFullName}"
-
-!include common.nsh
-!include locales.nsi
-
-VIAddVersionKey "FileDescription" "${MaintFullName} Installer"
-VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe"
-
-Name "${MaintFullName}"
-OutFile "maintenanceservice_installer.exe"
-
-; Get installation folder from registry if available
-InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
-
-SetOverwrite on
-
-; serviceinstall.cpp also uses this key, in case the path is changed, update
-; there too.
-!define MaintUninstallKey \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
-
-; Always install into the 32-bit location even if we have a 64-bit build.
-; This is because we use only 1 service for all Basilisk channels.
-; Allow either x86 and x64 builds to exist at this location, depending on
-; what is the latest build.
-InstallDir "$PROGRAMFILES32\${MaintFullName}\"
-ShowUnInstDetails nevershow
-
-################################################################################
-# Modern User Interface - MUI
-
-!define MUI_ICON setup.ico
-!define MUI_UNICON setup.ico
-!define MUI_WELCOMEPAGE_TITLE_3LINES
-!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
-
-;Interface Settings
-!define MUI_ABORTWARNING
-
-; Uninstaller Pages
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
-################################################################################
-# Language
-
-!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
-!verbose push
-!verbose 3
-!include "overrideLocale.nsh"
-!include "customLocale.nsh"
-!verbose pop
-
-; Set this after the locale files to override it if it is in the locale
-; using " " for BrandingText will hide the "Nullsoft Install System..." branding
-BrandingText " "
-
-Function .onInit
- ; Remove the current exe directory from the search order.
- ; This only effects LoadLibrary calls and not implicitly loaded DLLs.
- System::Call 'kernel32::SetDllDirectoryW(w "")'
-
- SetSilent silent
-
- ${Unless} ${AtLeastWin7}
- Abort
- ${EndUnless}
-FunctionEnd
-
-Function un.onInit
- ; Remove the current exe directory from the search order.
- ; This only effects LoadLibrary calls and not implicitly loaded DLLs.
- System::Call 'kernel32::SetDllDirectoryW(w "")'
-
-; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
-; removed after we require NSIS 3.0a2 or greater.
-!ifndef NSIS_PACKEDVERSION
- ${If} ${AtLeastWinVista}
- System::Call 'user32::SetProcessDPIAware()'
- ${EndIf}
-!endif
-
- StrCpy $BrandFullNameDA "${MaintFullName}"
- StrCpy $BrandFullName "${MaintFullName}"
-FunctionEnd
-
-Section "MaintenanceService"
- AllowSkipFiles off
-
- CreateDirectory $INSTDIR
- SetOutPath $INSTDIR
-
- ; If the service already exists, then it will be stopped when upgrading it
- ; via the maintenanceservice_tmp.exe command executed below.
- ; The maintenanceservice_tmp.exe command will rename the file to
- ; maintenanceservice.exe if maintenanceservice_tmp.exe is newer.
- ; If the service does not exist yet, we install it and drop the file on
- ; disk as maintenanceservice.exe directly.
- StrCpy $TempMaintServiceName "maintenanceservice.exe"
- IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists
- StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
- skipAlreadyExists:
-
- ; We always write out a copy and then decide whether to install it or
- ; not via calling its 'install' cmdline which works by version comparison.
- CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
-
- ; The updater.ini file is only used when performing an install or upgrade,
- ; and only if that install or upgrade is successful. If an old updater.ini
- ; happened to be copied into the maintenance service installation directory
- ; but the service was not newer, the updater.ini file would be unused.
- ; It is used to fill the description of the service on success.
- CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini"
-
- ; Install the application maintenance service.
- ; If a service already exists, the command line parameter will stop the
- ; service and only install itself if it is newer than the already installed
- ; service. If successful it will remove the old maintenanceservice.exe
- ; and replace it with maintenanceservice_tmp.exe.
- ClearErrors
- ${GetParameters} $0
- ${GetOptions} "$0" "/Upgrade" $0
- ${If} ${Errors}
- ExecWait '"$INSTDIR\$TempMaintServiceName" install'
- ${Else}
- ; The upgrade cmdline is the same as install except
- ; It will fail if the service isn't already installed.
- ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade'
- ${EndIf}
-
- WriteUninstaller "$INSTDIR\Uninstall.exe"
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}"
- WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \
- '"$INSTDIR\uninstall.exe"'
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \
- "$INSTDIR\Uninstall.exe,0"
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}"
- WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla"
- WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}"
- WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1
- ${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4
- WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2
-
- ; Write out that a maintenance service was attempted.
- ; We do this because on upgrades we will check this value and we only
- ; want to install once on the first upgrade to maintenance service.
- ; Also write out that we are currently installed, preferences will check
- ; this value to determine if we should show the service update pref.
- ; Since the Maintenance service can be installed either x86 or x64,
- ; always use the 64-bit registry for checking if an attempt was made.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
-
- ; Included here for debug purposes only.
- ; These keys are used to bypass the installation dir is a valid installation
- ; check from the service so that tests can be run.
- ; WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
- ; WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-SectionEnd
-
-; By renaming before deleting we improve things slightly in case
-; there is a file in use error. In this case a new install can happen.
-Function un.RenameDelete
- Pop $9
- ; If the .moz-delete file already exists previously, delete it
- ; If it doesn't exist, the call is ignored.
- ; We don't need to pass /REBOOTOK here since it was already marked that way
- ; if it exists.
- Delete "$9.moz-delete"
- Rename "$9" "$9.moz-delete"
- ${If} ${Errors}
- Delete /REBOOTOK "$9"
- ${Else}
- Delete /REBOOTOK "$9.moz-delete"
- ${EndIf}
- ClearErrors
-FunctionEnd
-
-Section "Uninstall"
- ; Delete the service so that no updates will be attempted
- ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall'
-
- Push "$INSTDIR\updater.ini"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice.exe"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice_tmp.exe"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice.old"
- Call un.RenameDelete
- Push "$INSTDIR\Uninstall.exe"
- Call un.RenameDelete
- Push "$INSTDIR\update\updater.ini"
- Call un.RenameDelete
- Push "$INSTDIR\update\updater.exe"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-1.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-2.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-3.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-4.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-5.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-6.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-7.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-8.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-9.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-10.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-install.log"
- Call un.RenameDelete
- Push "$INSTDIR\logs\maintenanceservice-uninstall.log"
- Call un.RenameDelete
- SetShellVarContext all
- Push "$APPDATA\Mozilla\logs\maintenanceservice.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-1.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-2.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-3.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-4.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-5.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-6.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-7.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-8.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-9.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-10.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-install.log"
- Call un.RenameDelete
- Push "$APPDATA\Mozilla\logs\maintenanceservice-uninstall.log"
- Call un.RenameDelete
- RMDir /REBOOTOK "$APPDATA\Mozilla\logs"
- RMDir /REBOOTOK "$APPDATA\Mozilla"
- RMDir /REBOOTOK "$INSTDIR\logs"
- RMDir /REBOOTOK "$INSTDIR\update"
- RMDir /REBOOTOK "$INSTDIR"
-
- DeleteRegKey HKLM "${MaintUninstallKey}"
-
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
- DeleteRegKey HKLM "${FallbackKey}\"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-SectionEnd
diff --git a/application/palemoon/installer/windows/nsis/shared.nsh b/application/palemoon/installer/windows/nsis/shared.nsh
index 294e3e6fca..815853ae73 100644
--- a/application/palemoon/installer/windows/nsis/shared.nsh
+++ b/application/palemoon/installer/windows/nsis/shared.nsh
@@ -124,51 +124,6 @@
${FixDistributionsINI}
RmDir /r /REBOOTOK "$INSTDIR\${TO_BE_DELETED}"
-
-!ifdef MOZ_MAINTENANCE_SERVICE
- Call IsUserAdmin
- Pop $R0
- ${If} $R0 == "true"
- ; Only proceed if we have HKLM write access
- ${AndIf} $TmpVal == "HKLM"
- ; On Windows 2000 we do not install the maintenance service.
- ${AndIf} ${AtLeastWinXP}
- ; We check to see if the maintenance service install was already attempted.
- ; Since the Maintenance service can be installed either x86 or x64,
- ; always use the 64-bit registry for checking if an attempt was made.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- ReadRegDWORD $5 HKLM "Software\Mozilla\MaintenanceService" "Attempted"
- ClearErrors
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-
- ; Add the registry keys for allowed certificates.
- ${AddMaintCertKeys}
-
- ; If the maintenance service is already installed, do nothing.
- ; The maintenance service will launch:
- ; maintenanceservice_installer.exe /Upgrade to upgrade the maintenance
- ; service if necessary. If the update was done from updater.exe without
- ; the service (i.e. service is failing), updater.exe will do the update of
- ; the service. The reasons we do not do it here is because we don't want
- ; to have to prompt for limited user accounts when the service isn't used
- ; and we currently call the PostUpdate twice, once for the user and once
- ; for the SYSTEM account. Also, this would stop the maintenance service
- ; and we need a return result back to the service when run that way.
- ${If} $5 == ""
- ; An install of maintenance service was never attempted.
- ; We know we are an Admin and that we have write access into HKLM
- ; based on the above checks, so attempt to just run the EXE.
- ; In the worst case, in case there is some edge case with the
- ; IsAdmin check and the permissions check, the maintenance service
- ; will just fail to be attempted to be installed.
- nsExec::Exec "$\"$INSTDIR\maintenanceservice_installer.exe$\""
- ${EndIf}
- ${EndIf}
-!endif
!macroend
!define PostUpdate "!insertmacro PostUpdate"
@@ -718,54 +673,6 @@
!macroend
!define UpdateProtocolHandlers "!insertmacro UpdateProtocolHandlers"
-!ifdef MOZ_MAINTENANCE_SERVICE
-; Adds maintenance service certificate keys for the install dir.
-; For the cert to work, it must also be signed by a trusted cert for the user.
-!macro AddMaintCertKeys
- Push $R0
- ; Allow main Mozilla cert information for updates
- ; This call will push the needed key on the stack
- ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
- Pop $R0
- ${If} $R0 != ""
- ; More than one certificate can be specified in a different subfolder
- ; for example: $R0\1, but each individual binary can be signed
- ; with at most one certificate. A fallback certificate can only be used
- ; if the binary is replaced with a different certificate.
- ; We always use the 64bit registry for certs.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
-
- ; PrefetchProcessName was originally used to experiment with deleting
- ; Windows prefetch as a speed optimization. It is no longer used though.
- DeleteRegValue HKLM "$R0" "prefetchProcessName"
-
- ; Setting the Attempted value will ensure that a new Maintenance Service
- ; install will never be attempted again after this from updates. The value
- ; is used only to see if updates should attempt new service installs.
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
-
- ; These values associate the allowed certificates for the current
- ; installation.
- WriteRegStr HKLM "$R0\0" "name" "${CERTIFICATE_NAME}"
- WriteRegStr HKLM "$R0\0" "issuer" "${CERTIFICATE_ISSUER}"
- ; These values associate the allowed certificates for the previous
- ; installation, so that we can update from it cleanly using the
- ; old updater.exe (which will still have this signature).
- WriteRegStr HKLM "$R0\1" "name" "${CERTIFICATE_NAME_PREVIOUS}"
- WriteRegStr HKLM "$R0\1" "issuer" "${CERTIFICATE_ISSUER_PREVIOUS}"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
- ClearErrors
- ${EndIf}
- ; Restore the previously used value back
- Pop $R0
-!macroend
-!define AddMaintCertKeys "!insertmacro AddMaintCertKeys"
-!endif
-
; Removes various registry entries for reasons noted below (does not use SHCTX).
!macro RemoveDeprecatedKeys
StrCpy $0 "SOFTWARE\Classes"
diff --git a/application/palemoon/installer/windows/nsis/uninstaller.nsi b/application/palemoon/installer/windows/nsis/uninstaller.nsi
index 333fd33d65..c85af36560 100644
--- a/application/palemoon/installer/windows/nsis/uninstaller.nsi
+++ b/application/palemoon/installer/windows/nsis/uninstaller.nsi
@@ -450,24 +450,6 @@ Section "Uninstall"
; uninstalls of PaleMoon-release with reinstalls of PaleMoon-release, for example.
WriteRegStr HKCU "Software\Mozilla\PaleMoon" "Uninstalled-${UpdateChannel}" "True"
-!ifdef MOZ_MAINTENANCE_SERVICE
- ; Get the path the allowed cert is at and remove it
- ; Keep this block of code last since it modfies the reg view
- ServicesHelper::PathToUniqueRegistryPath "$INSTDIR"
- Pop $MaintCertKey
- ${If} $MaintCertKey != ""
- ; Always use the 64bit registry for certs on 64bit systems.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- DeleteRegKey HKLM "$MaintCertKey"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
- ${EndIf}
- Call un.UninstallServiceIfNotUsed
-!endif
-
${un.IsFirewallSvcRunning}
Pop $0
${If} "$0" == "true"
diff --git a/application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd b/application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd
deleted file mode 100644
index 139603d8d3..0000000000
--- a/application/palemoon/locales/en-US/chrome/browser/aboutRobots.dtd
+++ /dev/null
@@ -1,29 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!-- These strings are used in the about:robots page, which ties in with the
- robots theme used in the Firefox 3 Beta 2/3 first run pages.
- They're just meant to be fun and whimsical, with references to some geeky
- but well-known robots in movies and books. Be creative with translations! -->
-
-<!-- Nonsense line from the movie "The Day The Earth Stood Still". No translation needed. -->
-<!ENTITY robots.pagetitle "Gort! Klaatu barada nikto!">
-<!-- Movie: Logan's Run... Box (cybog): "Welcome Humans! I am ready for you." -->
-<!ENTITY robots.errorTitleText "Welcome Humans!">
-<!-- Movie: The Day The Earth Stood Still. Spoken by Klaatu. -->
-<!ENTITY robots.errorShortDescText "We have come to visit you in peace and with goodwill!">
-<!-- Various books by Isaac Asimov. http://en.wikipedia.org/wiki/Three_Laws_of_Robotics -->
-<!ENTITY robots.errorLongDesc1 "Robots may not injure a human being or, through inaction, allow a human being to come to harm.">
-<!-- Movie: Blade Runner. Batty: "I've seen things you people wouldn't believe..." -->
-<!ENTITY robots.errorLongDesc2 "Robots have seen things you people wouldn't believe.">
-<!-- Book: Hitchhiker's Guide To The Galaxy. What the Sirius Cybernetics Corporation calls robots. -->
-<!ENTITY robots.errorLongDesc3 "Robots are Your Plastic Pal Who's Fun To Be With.">
-<!-- TV: Futurama. Bender's first line is "Bite my shiny metal ass." -->
-<!ENTITY robots.errorLongDesc4 "Robots have shiny metal posteriors which should not be bitten.">
-<!-- TV: Battlestar Galactica (2004 series). From the opening text. -->
-<!ENTITY robots.errorTrailerDescText "And they have a plan.">
-<!-- TV: Battlestar Galactica (2004 series). Common expletive referring to Cylons. -->
-<!ENTITY robots.imgtitle "Frakkin' Toasters">
-<!-- Book: Hitchhiker's Guide To The Galaxy. Arthur presses a button and it warns him. -->
-<!ENTITY robots.dontpress "Please do not press this button again.">
diff --git a/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd b/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd
index a926b0ed24..27de3797f3 100644
--- a/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd
+++ b/application/palemoon/locales/en-US/chrome/browser/baseMenuOverlay.dtd
@@ -14,6 +14,7 @@
for the help button in the menubar but Gnome does not. -->
<!ENTITY helpMenuWin.label "Help">
<!ENTITY helpMenuWin.accesskey "H">
+<!ENTITY updateCmd.label "Check for Updates…">
<!ENTITY aboutProduct.label "About &brandShortName;">
<!ENTITY aboutProduct.accesskey "A">
<!ENTITY productHelp.label "&brandShortName; Help">
diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.dtd b/application/palemoon/locales/en-US/chrome/browser/browser.dtd
index 439057a84b..c810b074ed 100644
--- a/application/palemoon/locales/en-US/chrome/browser/browser.dtd
+++ b/application/palemoon/locales/en-US/chrome/browser/browser.dtd
@@ -417,8 +417,8 @@ items are mutually exclusive. -->
<!ENTITY mediaMute.accesskey "M">
<!ENTITY mediaUnmute.label "Unmute">
<!ENTITY mediaUnmute.accesskey "m">
-<!ENTITY mediaPlaybackRate.label "Play Speed">
-<!ENTITY mediaPlaybackRate.accesskey "l">
+<!ENTITY mediaPlaybackRate2.label "Play Speed">
+<!ENTITY mediaPlaybackRate2.accesskey "d">
<!ENTITY mediaPlaybackRate050x.label "Slow Motion (0.5×)">
<!ENTITY mediaPlaybackRate050x.accesskey "S">
<!ENTITY mediaPlaybackRate100x.label "Normal Speed">
@@ -430,6 +430,8 @@ movie "Space Balls" and is meant to say that this speed is very
fast. -->
<!ENTITY mediaPlaybackRate200x.label "Ludicrous Speed (2×)">
<!ENTITY mediaPlaybackRate200x.accesskey "L">
+<!ENTITY mediaLoop.label "Loop">
+<!ENTITY mediaLoop.accesskey "L">
<!-- LOCALIZATION NOTE: The access keys for "Show Controls" and
"Hide Controls" are the same because the two context-menu
items are mutually exclusive. -->
diff --git a/application/palemoon/locales/en-US/chrome/browser/browser.properties b/application/palemoon/locales/en-US/chrome/browser/browser.properties
index dbe6dbaa1a..4c45e2513c 100644
--- a/application/palemoon/locales/en-US/chrome/browser/browser.properties
+++ b/application/palemoon/locales/en-US/chrome/browser/browser.properties
@@ -201,6 +201,22 @@ update.openUpdateUI.upgradeButton.accesskey=U
update.restart.upgradeButton.label=Upgrade Now
update.restart.upgradeButton.accesskey=U
+# Check for Updates in the Help Menu
+# LOCALIZATION NOTE (updatesItem_*): these are alternative labels for Check for Update item in Help menu.
+# Which one is used depends on Update process state.
+updatesItem_default=Check for Updates…
+updatesItem_defaultFallback=Check for Updates…
+updatesItem_default.accesskey=C
+updatesItem_downloading=Downloading %S…
+updatesItem_downloadingFallback=Downloading Update…
+updatesItem_downloading.accesskey=D
+updatesItem_resume=Resume Downloading %S…
+updatesItem_resumeFallback=Resume Downloading Update…
+updatesItem_resume.accesskey=D
+updatesItem_pending=Apply Downloaded Update Now…
+updatesItem_pendingFallback=Apply Downloaded Update Now…
+updatesItem_pending.accesskey=D
+
# RSS Pretty Print
feedShowFeedNew=Subscribe to '%S'…
diff --git a/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd b/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd
index 038d8eb757..4b4fac9ff3 100644
--- a/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd
+++ b/application/palemoon/locales/en-US/chrome/browser/palemoon.dtd
@@ -2,13 +2,14 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!ENTITY chronicles.title.55.2
-'The Chronicles of the Pale Moon, 55:2'>
+<!ENTITY chronicles.title.66.1
+'The Chronicles of the Pale Moon, 66:1'>
-<!ENTITY chronicles.quote.55.2
-'And so, our focus was drawn through time and space to the <em>emerging dragon</em> who would not abandon hope.<br/>
-Its resilience, stubbornness and spirit unbroken, and searching for long hours to find those willing to <em>join</em> its cause.<br/>
-The old nest abandoned, the death throes of the Beast ignored, and more determined than ever to find glory in the future.'>
+<!ENTITY chronicles.quote.66.1
+'The <em>landscape changed</em> as time went on: flowing, twisting, corrupting. The dull sheen of <em>tainted metal</em> shining through everywhere.<br/>
+In the trees, roots, animals, and even the <em>mountainous valleys</em> that had always been an <em>oasis of difference</em>.<br/>
+Still, our dragon continued, untainted and resolute, soaring above.<br/>
+There would be a home yet, <em>a sanctuary</em>, a place for all those not given in to this <em>singular</em> invading force that was <em>misshaping</em> the world.'>
-<!ENTITY chronicles.from.55.2
-'from <strong>The Chronicles of the Pale Moon,</strong> 55:2'>
+<!ENTITY chronicles.from.66.1
+'from <strong>The Chronicles of the Pale Moon,</strong> 66:1'>
diff --git a/application/palemoon/locales/jar.mn b/application/palemoon/locales/jar.mn
index 0fc7f2c9b1..5fcee246e9 100644
--- a/application/palemoon/locales/jar.mn
+++ b/application/palemoon/locales/jar.mn
@@ -9,7 +9,6 @@
locale/browser/aboutCertError.dtd (%chrome/browser/aboutCertError.dtd)
locale/browser/aboutDialog.dtd (%chrome/browser/aboutDialog.dtd)
locale/browser/aboutPrivateBrowsing.dtd (%chrome/browser/aboutPrivateBrowsing.dtd)
- locale/browser/aboutRobots.dtd (%chrome/browser/aboutRobots.dtd)
* locale/browser/aboutHome.dtd (%chrome/browser/aboutHome.dtd)
locale/browser/aboutSessionRestore.dtd (%chrome/browser/aboutSessionRestore.dtd)
#ifdef MOZ_SERVICES_SYNC
diff --git a/application/palemoon/themes/linux/browser.css b/application/palemoon/themes/linux/browser.css
index b545b06cb1..01b3f5c9e5 100644
--- a/application/palemoon/themes/linux/browser.css
+++ b/application/palemoon/themes/linux/browser.css
@@ -1607,6 +1607,17 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-image: linear-gradient(to top, rgba(0,0,0,.3) 1px, rgba(0,0,0,.05) 1px, transparent 50%);
}
+/* When the tab bar is collapsed, show a 1px border in its place. */
+#TabsToolbar[tabsontop="false"][collapsed="true"] {
+ visibility: visible;
+ height: 1px;
+ border-bottom-width: 1px;
+ /* !important here to override border-style: none on the toolbar */
+ border-bottom-style: solid !important;
+ border-bottom-color: ThreeDShadow;
+ overflow: hidden;
+}
+
.tabbrowser-tab,
.tabs-newtab-button {
position: static;
diff --git a/application/palemoon/themes/osx/browser.css b/application/palemoon/themes/osx/browser.css
index ddf050785f..6d0d92015b 100644
--- a/application/palemoon/themes/osx/browser.css
+++ b/application/palemoon/themes/osx/browser.css
@@ -1630,6 +1630,17 @@ richlistitem[type~="action"][actiontype="switchtab"][selected="true"] > .ac-url-
background-image: linear-gradient(to top, @toolbarShadowColor@ 1px, rgba(0,0,0,.05) 1px, transparent 50%);
}
+/* When the tab bar is collapsed, show a 1px border in its place. */
+#TabsToolbar[tabsontop="false"][collapsed="true"] {
+ visibility: visible;
+ height: 1px;
+ border-bottom-width: 1px;
+ /* !important here to override border-style: none on the toolbar */
+ border-bottom-style: solid !important;
+ border-bottom-color: ThreeDShadow;
+ overflow: hidden;
+}
+
@media (-moz-mac-lion-theme) {
#main-window[sizemode=normal] #TabsToolbar {
padding-left: 2px;
diff --git a/application/palemoon/themes/windows/browser.css b/application/palemoon/themes/windows/browser.css
index 56a8318da2..9f32b59cf9 100644
--- a/application/palemoon/themes/windows/browser.css
+++ b/application/palemoon/themes/windows/browser.css
@@ -31,6 +31,8 @@
%endif
:root {
+ --toolbox-after-color: ThreeDShadow;
+
--toolbar-custom-color: hsl(210,75%,92%);
--toolbar-highlight-top: rgba(255,255,255,.5);
--toolbar-highlight-bottom: transparent;
@@ -91,7 +93,7 @@
display: -moz-box;
-moz-box-ordinal-group: 101; /* tabs toolbar is 100 */
height: 1px;
- background-color: ThreeDShadow;
+ background-color: var(--toolbox-after-color);
}
#navigator-toolbox[tabsontop=false]::after,
#main-window[disablechrome] #navigator-toolbox::after {
@@ -1841,6 +1843,17 @@ richlistitem[type~="action"][actiontype="switchtab"] > .ac-url-box > .ac-action-
background-image: linear-gradient(to top, @toolbarShadowColor@ 1px, rgba(0,0,0,.05) 1px, transparent 50%);
}
+/* When the tab bar is collapsed, show a 1px border in its place. */
+#TabsToolbar[tabsontop="false"][collapsed="true"] {
+ visibility: visible;
+ height: 1px;
+ border-bottom-width: 1px;
+ /* !important here to override border-style: none on the toolbar */
+ border-bottom-style: solid !important;
+ border-bottom-color: var(--toolbox-after-color);
+ overflow: hidden;
+}
+
.tabbrowser-tab,
.tabs-newtab-button {
-moz-appearance: none;
@@ -3044,8 +3057,8 @@ toolbar[brighttext] #addonbar-closebutton {
@media (-moz-os-version: windows-vista),
(-moz-os-version: windows-win7) {
- #navigator-toolbox:not(:-moz-lwtheme)::after {
- background-color: #aabccf;
+ :root:not(:-moz-lwtheme) {
+ --toolbox-after-color: #aabccf;
}
}
@@ -3054,9 +3067,9 @@ toolbar[brighttext] #addonbar-closebutton {
:root {
--toolbar-custom-color: hsl(210,0%,92%);
}
-
- #navigator-toolbox:not(:-moz-lwtheme)::after {
- background-color: #bcbcbc;
+
+ :root:not(:-moz-lwtheme) {
+ --toolbox-after-color: #bcbcbc;
}
}
diff --git a/application/xulrunner/confvars.sh b/application/xulrunner/confvars.sh
index a317df2a66..794b2b4b12 100644
--- a/application/xulrunner/confvars.sh
+++ b/application/xulrunner/confvars.sh
@@ -13,10 +13,6 @@ MOZ_CHROME_FILE_FORMAT=omni
MOZ_UPDATER=1
-if test "$OS_ARCH" = "WINNT"; then
- MOZ_MAINTENANCE_SERVICE=
-fi
-
MOZ_PLACES=1
MOZ_WEBRTC=1
MOZ_WEBGL_CONFORMANT=1
diff --git a/build/gyp.mozbuild b/build/gyp.mozbuild
index fd8714ecf0..545b888bd8 100644
--- a/build/gyp.mozbuild
+++ b/build/gyp.mozbuild
@@ -89,7 +89,6 @@ flavors = {
'Android': 'android',
'Linux': 'linux',
'Darwin': 'mac' if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa' else 'ios',
- 'SunOS': 'solaris',
'GNU/kFreeBSD': 'freebsd',
'DragonFly': 'dragonfly',
'FreeBSD': 'freebsd',
diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in
index 861b7d07d1..2c266eb20f 100644
--- a/config/external/nss/Makefile.in
+++ b/config/external/nss/Makefile.in
@@ -43,20 +43,6 @@ endif
# Default
HAVE_FREEBL_LIBS = 1
-# SunOS SPARC
-ifeq ($(OS_ARCH), SunOS)
-ifneq (86,$(findstring 86,$(OS_TEST)))
-ifdef HAVE_64BIT_BUILD
-HAVE_FREEBL_LIBS =
-HAVE_FREEBL_LIBS_64 = 1
-else
-HAVE_FREEBL_LIBS =
-HAVE_FREEBL_LIBS_32FPU = 1
-HAVE_FREEBL_LIBS_32INT64 = 1
-endif
-endif
-endif
-
ifeq ($(OS_TARGET),Linux)
HAVE_FREEBL_LIBS =
HAVE_FREEBL_LIBS_PRIV = 1
@@ -331,11 +317,6 @@ NSS_DIST_DLL_DEST := $(DIST)/bin
NSS_DIST_DLL_TARGET := target
INSTALL_TARGETS += NSS_DIST_DLL
-ifeq ($(OS_ARCH)_$(1), SunOS_softokn3)
-# has to use copy mode on Solaris, see #665509
-$(DIST)/bin/$(DLL_PREFIX)softokn3$(DLL_SUFFIX): INSTALL := $(INSTALL) -t
-endif
-
NSS_SDK_LIB_FILES := \
$(addprefix $(DIST)/lib/$(LIB_PREFIX),$(addsuffix .$(LIB_SUFFIX),$(SDK_LIBS))) \
$(addprefix $(DIST)/bin/$(DLL_PREFIX),$(addsuffix $(DLL_SUFFIX),$(NSS_DLLS))) \
diff --git a/config/milestone.txt b/config/milestone.txt
index 776b58af7c..f525cbbb4f 100644
--- a/config/milestone.txt
+++ b/config/milestone.txt
@@ -10,4 +10,4 @@
# hardcoded milestones in the tree from these two files.
#--------------------------------------------------------
-4.1.8
+4.1.10
diff --git a/config/rules.mk b/config/rules.mk
index 9a8f61c2da..567971b197 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -386,15 +386,6 @@ endif
endif
endif
-ifeq ($(OS_ARCH),AIX)
-ifdef IS_COMPONENT
-ifneq ($(HAS_EXTRAEXPORTS),1)
-MKSHLIB += -bE:$(MOZILLA_DIR)/build/unix/aix.exp -bnoexpall
-MKCSHLIB += -bE:$(MOZILLA_DIR)/build/unix/aix.exp -bnoexpall
-endif # HAS_EXTRAEXPORTS
-endif # IS_COMPONENT
-endif # AIX
-
#
# Linux: add -Bsymbolic flag for components
#
diff --git a/db/sqlite3/src/sqlite3.c b/db/sqlite3/src/sqlite3.c
index d015df2c31..4729f45722 100644
--- a/db/sqlite3/src/sqlite3.c
+++ b/db/sqlite3/src/sqlite3.c
@@ -1,6 +1,6 @@
/******************************************************************************
** This file is an amalgamation of many separate C source files from SQLite
-** version 3.26.0. By combining all the individual C code files into this
+** version 3.27.2. By combining all the individual C code files into this
** single large file, the entire code can be compiled as a single translation
** unit. This allows many compilers to do optimizations that would not be
** possible if the files were compiled separately. Performance improvements
@@ -1162,9 +1162,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.26.0"
-#define SQLITE_VERSION_NUMBER 3026000
-#define SQLITE_SOURCE_ID "2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9"
+#define SQLITE_VERSION "3.27.2"
+#define SQLITE_VERSION_NUMBER 3027002
+#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -1862,6 +1862,15 @@ struct sqlite3_io_methods {
** file space based on this hint in order to help writes to the database
** file run faster.
**
+** <li>[[SQLITE_FCNTL_SIZE_LIMIT]]
+** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that
+** implements [sqlite3_deserialize()] to set an upper bound on the size
+** of the in-memory database. The argument is a pointer to a [sqlite3_int64].
+** If the integer pointed to is negative, then it is filled in with the
+** current limit. Otherwise the limit is set to the larger of the value
+** of the integer pointed to and the current database size. The integer
+** pointed to is set to the new limit.
+**
** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
** extends and truncates the database file in chunks of a size specified
@@ -2170,6 +2179,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
#define SQLITE_FCNTL_LOCK_TIMEOUT 34
#define SQLITE_FCNTL_DATA_VERSION 35
+#define SQLITE_FCNTL_SIZE_LIMIT 36
/* deprecated names */
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
@@ -3011,6 +3021,17 @@ struct sqlite3_mem_methods {
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
+**
+** [[SQLITE_CONFIG_MEMDB_MAXSIZE]]
+** <dt>SQLITE_CONFIG_MEMDB_MAXSIZE
+** <dd>The SQLITE_CONFIG_MEMDB_MAXSIZE option accepts a single parameter
+** [sqlite3_int64] parameter which is the default maximum size for an in-memory
+** database created using [sqlite3_deserialize()]. This default maximum
+** size can be adjusted up or down for individual databases using the
+** [SQLITE_FCNTL_SIZE_LIMIT] [sqlite3_file_control|file-control]. If this
+** configuration setting is never used, then the default maximum is determined
+** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
+** compile-time option is not set, then the default maximum is 1073741824.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -3041,6 +3062,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
+#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -3386,7 +3408,7 @@ SQLITE_API int sqlite3_changes(sqlite3*);
** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
** are not counted.
**
-** This the [sqlite3_total_changes(D)] interface only reports the number
+** The [sqlite3_total_changes(D)] interface only reports the number
** of rows that changed due to SQL statement run against database
** connection D. Any changes by other database connections are ignored.
** To detect changes against a database file from other database
@@ -4030,9 +4052,9 @@ SQLITE_API int sqlite3_set_authorizer(
** time is in units of nanoseconds, however the current implementation
** is only capable of millisecond resolution so the six least significant
** digits in the time are meaningless. Future versions of SQLite
-** might provide greater resolution on the profiler callback. The
-** sqlite3_profile() function is considered experimental and is
-** subject to change in future versions of SQLite.
+** might provide greater resolution on the profiler callback. Invoking
+** either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the
+** profile callback.
*/
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,
void(*xTrace)(void*,const char*), void*);
@@ -4446,6 +4468,8 @@ SQLITE_API int sqlite3_open_v2(
** is not a database file pathname pointer that SQLite passed into the xOpen
** VFS method, then the behavior of this routine is undefined and probably
** undesirable.
+**
+** See the [URI filename] documentation for additional information.
*/
SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
@@ -4668,18 +4692,23 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** deplete the limited store of lookaside memory. Future versions of
** SQLite may act on this hint differently.
**
-** [[SQLITE_PREPARE_NORMALIZE]] ^(<dt>SQLITE_PREPARE_NORMALIZE</dt>
-** <dd>The SQLITE_PREPARE_NORMALIZE flag indicates that a normalized
-** representation of the SQL statement should be calculated and then
-** associated with the prepared statement, which can be obtained via
-** the [sqlite3_normalized_sql()] interface.)^ The semantics used to
-** normalize a SQL statement are unspecified and subject to change.
-** At a minimum, literal values will be replaced with suitable
-** placeholders.
+** [[SQLITE_PREPARE_NORMALIZE]] <dt>SQLITE_PREPARE_NORMALIZE</dt>
+** <dd>The SQLITE_PREPARE_NORMALIZE flag is a no-op. This flag used
+** to be required for any prepared statement that wanted to use the
+** [sqlite3_normalized_sql()] interface. However, the
+** [sqlite3_normalized_sql()] interface is now available to all
+** prepared statements, regardless of whether or not they use this
+** flag.
+**
+** [[SQLITE_PREPARE_NO_VTAB]] <dt>SQLITE_PREPARE_NO_VTAB</dt>
+** <dd>The SQLITE_PREPARE_NO_VTAB flag causes the SQL compiler
+** to return an error (error code SQLITE_ERROR) if the statement uses
+** any virtual tables.
** </dl>
*/
#define SQLITE_PREPARE_PERSISTENT 0x01
#define SQLITE_PREPARE_NORMALIZE 0x02
+#define SQLITE_PREPARE_NO_VTAB 0x04
/*
** CAPI3REF: Compiling An SQL Statement
@@ -11035,7 +11064,7 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
** sqlite3changeset_next() is called on the iterator or until the
** conflict-handler function returns. If pnCol is not NULL, then *pnCol is
** set to the number of columns in the table affected by the change. If
-** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change
+** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
** is an indirect change, or false (0) otherwise. See the documentation for
** [sqlite3session_indirect()] for a description of direct and indirect
** changes. Finally, if pOp is not NULL, then *pOp is set to one of
@@ -12269,12 +12298,8 @@ struct Fts5PhraseIter {
**
** Usually, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the
-** first token of the phrase. The exception is if the table was created
-** with the offsets=0 option specified. In this case *piOff is always
-** set to -1.
-**
-** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM)
-** if an error occurs.
+** first token of the phrase. Returns SQLITE_OK if successful, or an error
+** code (i.e. SQLITE_NOMEM) if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
@@ -12563,11 +12588,11 @@ struct Fts5ExtensionApi {
** the tokenizer substitutes "first" for "1st" and the query works
** as expected.
**
-** <li> By adding multiple synonyms for a single term to the FTS index.
-** In this case, when tokenizing query text, the tokenizer may
-** provide multiple synonyms for a single term within the document.
-** FTS5 then queries the index for each synonym individually. For
-** example, faced with the query:
+** <li> By querying the index for all synonyms of each query term
+** separately. In this case, when tokenizing query text, the
+** tokenizer may provide multiple synonyms for a single term
+** within the document. FTS5 then queries the index for each
+** synonym individually. For example, faced with the query:
**
** <codeblock>
** ... MATCH 'first place'</codeblock>
@@ -12591,7 +12616,7 @@ struct Fts5ExtensionApi {
** "place".
**
** This way, even if the tokenizer does not provide synonyms
-** when tokenizing query text (it should not - to do would be
+** when tokenizing query text (it should not - to do so would be
** inefficient), it doesn't matter if the user queries for
** 'first + place' or '1st + place', as there are entries in the
** FTS index corresponding to both forms of the first token.
@@ -14535,6 +14560,7 @@ SQLITE_PRIVATE i64 sqlite3BtreeOffset(BtCursor*);
SQLITE_PRIVATE int sqlite3BtreePayload(BtCursor*, u32 offset, u32 amt, void*);
SQLITE_PRIVATE const void *sqlite3BtreePayloadFetch(BtCursor*, u32 *pAmt);
SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor*);
+SQLITE_PRIVATE sqlite3_int64 sqlite3BtreeMaxRecordSize(BtCursor*);
SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(Btree*, int *aRoot, int nRoot, int, int*);
SQLITE_PRIVATE struct Pager *sqlite3BtreePager(Btree*);
@@ -14774,12 +14800,11 @@ typedef struct VdbeOpList VdbeOpList;
#endif
/*
-** The following macro converts a relative address in the p2 field
-** of a VdbeOp structure into a negative number so that
-** sqlite3VdbeAddOpList() knows that the address is relative. Calling
-** the macro again restores the address.
+** The following macro converts a label returned by sqlite3VdbeMakeLabel()
+** into an index into the Parse.aLabel[] array that contains the resolved
+** address of that label.
*/
-#define ADDR(X) (-1-(X))
+#define ADDR(X) (~(X))
/*
** The makefile scans the vdbe.c source file and creates the "opcodes.h"
@@ -14912,57 +14937,56 @@ typedef struct VdbeOpList VdbeOpList;
#define OP_Sequence 120 /* synopsis: r[P2]=cursor[P1].ctr++ */
#define OP_NewRowid 121 /* synopsis: r[P2]=rowid */
#define OP_Insert 122 /* synopsis: intkey=r[P3] data=r[P2] */
-#define OP_InsertInt 123 /* synopsis: intkey=P3 data=r[P2] */
-#define OP_Delete 124
-#define OP_ResetCount 125
-#define OP_SorterCompare 126 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
-#define OP_SorterData 127 /* synopsis: r[P2]=data */
-#define OP_RowData 128 /* synopsis: r[P2]=data */
-#define OP_Rowid 129 /* synopsis: r[P2]=rowid */
-#define OP_NullRow 130
-#define OP_SeekEnd 131
-#define OP_SorterInsert 132 /* synopsis: key=r[P2] */
-#define OP_IdxInsert 133 /* synopsis: key=r[P2] */
-#define OP_IdxDelete 134 /* synopsis: key=r[P2@P3] */
-#define OP_DeferredSeek 135 /* synopsis: Move P3 to P1.rowid if needed */
-#define OP_IdxRowid 136 /* synopsis: r[P2]=rowid */
-#define OP_Destroy 137
-#define OP_Clear 138
-#define OP_ResetSorter 139
-#define OP_CreateBtree 140 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
+#define OP_Delete 123
+#define OP_ResetCount 124
+#define OP_SorterCompare 125 /* synopsis: if key(P1)!=trim(r[P3],P4) goto P2 */
+#define OP_SorterData 126 /* synopsis: r[P2]=data */
+#define OP_RowData 127 /* synopsis: r[P2]=data */
+#define OP_Rowid 128 /* synopsis: r[P2]=rowid */
+#define OP_NullRow 129
+#define OP_SeekEnd 130
+#define OP_SorterInsert 131 /* synopsis: key=r[P2] */
+#define OP_IdxInsert 132 /* synopsis: key=r[P2] */
+#define OP_IdxDelete 133 /* synopsis: key=r[P2@P3] */
+#define OP_DeferredSeek 134 /* synopsis: Move P3 to P1.rowid if needed */
+#define OP_IdxRowid 135 /* synopsis: r[P2]=rowid */
+#define OP_Destroy 136
+#define OP_Clear 137
+#define OP_ResetSorter 138
+#define OP_CreateBtree 139 /* synopsis: r[P2]=root iDb=P1 flags=P3 */
+#define OP_SqlExec 140
#define OP_Real 141 /* same as TK_FLOAT, synopsis: r[P2]=P4 */
-#define OP_SqlExec 142
-#define OP_ParseSchema 143
-#define OP_LoadAnalysis 144
-#define OP_DropTable 145
-#define OP_DropIndex 146
-#define OP_DropTrigger 147
-#define OP_IntegrityCk 148
-#define OP_RowSetAdd 149 /* synopsis: rowset(P1)=r[P2] */
-#define OP_Param 150
-#define OP_FkCounter 151 /* synopsis: fkctr[P1]+=P2 */
-#define OP_MemMax 152 /* synopsis: r[P1]=max(r[P1],r[P2]) */
-#define OP_OffsetLimit 153 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
-#define OP_AggInverse 154 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
-#define OP_AggStep 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
-#define OP_AggStep1 156 /* synopsis: accum=r[P3] step(r[P2@P5]) */
-#define OP_AggValue 157 /* synopsis: r[P3]=value N=P2 */
-#define OP_AggFinal 158 /* synopsis: accum=r[P1] N=P2 */
-#define OP_Expire 159
-#define OP_TableLock 160 /* synopsis: iDb=P1 root=P2 write=P3 */
-#define OP_VBegin 161
-#define OP_VCreate 162
-#define OP_VDestroy 163
-#define OP_VOpen 164
-#define OP_VColumn 165 /* synopsis: r[P3]=vcolumn(P2) */
-#define OP_VRename 166
-#define OP_Pagecount 167
-#define OP_MaxPgcnt 168
-#define OP_Trace 169
-#define OP_CursorHint 170
-#define OP_Noop 171
-#define OP_Explain 172
-#define OP_Abortable 173
+#define OP_ParseSchema 142
+#define OP_LoadAnalysis 143
+#define OP_DropTable 144
+#define OP_DropIndex 145
+#define OP_DropTrigger 146
+#define OP_IntegrityCk 147
+#define OP_RowSetAdd 148 /* synopsis: rowset(P1)=r[P2] */
+#define OP_Param 149
+#define OP_FkCounter 150 /* synopsis: fkctr[P1]+=P2 */
+#define OP_MemMax 151 /* synopsis: r[P1]=max(r[P1],r[P2]) */
+#define OP_OffsetLimit 152 /* synopsis: if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1) */
+#define OP_AggInverse 153 /* synopsis: accum=r[P3] inverse(r[P2@P5]) */
+#define OP_AggStep 154 /* synopsis: accum=r[P3] step(r[P2@P5]) */
+#define OP_AggStep1 155 /* synopsis: accum=r[P3] step(r[P2@P5]) */
+#define OP_AggValue 156 /* synopsis: r[P3]=value N=P2 */
+#define OP_AggFinal 157 /* synopsis: accum=r[P1] N=P2 */
+#define OP_Expire 158
+#define OP_TableLock 159 /* synopsis: iDb=P1 root=P2 write=P3 */
+#define OP_VBegin 160
+#define OP_VCreate 161
+#define OP_VDestroy 162
+#define OP_VOpen 163
+#define OP_VColumn 164 /* synopsis: r[P3]=vcolumn(P2) */
+#define OP_VRename 165
+#define OP_Pagecount 166
+#define OP_MaxPgcnt 167
+#define OP_Trace 168
+#define OP_CursorHint 169
+#define OP_Noop 170
+#define OP_Explain 171
+#define OP_Abortable 172
/* Properties such as "out2" or "jump" that are specified in
** comments following the "case" for each opcode in the vdbe.c
@@ -14991,12 +15015,12 @@ typedef struct VdbeOpList VdbeOpList;
/* 104 */ 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 112 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
/* 120 */ 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
-/* 128 */ 0x00, 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00,\
-/* 136 */ 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x00,\
-/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00,\
-/* 152 */ 0x04, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
-/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,\
-/* 168 */ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,}
+/* 128 */ 0x10, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x10,\
+/* 136 */ 0x10, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00,\
+/* 144 */ 0x00, 0x00, 0x00, 0x00, 0x06, 0x10, 0x00, 0x04,\
+/* 152 */ 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
+/* 160 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10,\
+/* 168 */ 0x00, 0x00, 0x00, 0x00, 0x00,}
/* The sqlite3P2Values() routine is able to run faster if it knows
** the value of the largest JUMP opcode. The smaller the maximum
@@ -15055,6 +15079,12 @@ SQLITE_PRIVATE int sqlite3VdbeExplainParent(Parse*);
# define ExplainQueryPlan(P)
# define ExplainQueryPlanPop(P)
# define ExplainQueryPlanParent(P) 0
+# define sqlite3ExplainBreakpoint(A,B) /*no-op*/
+#endif
+#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_EXPLAIN)
+SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char*,const char*);
+#else
+# define sqlite3ExplainBreakpoint(A,B) /*no-op*/
#endif
SQLITE_PRIVATE void sqlite3VdbeAddParseSchemaOp(Vdbe*,int,char*);
SQLITE_PRIVATE void sqlite3VdbeChangeOpcode(Vdbe*, u32 addr, u8);
@@ -15070,7 +15100,7 @@ SQLITE_PRIVATE void sqlite3VdbeAppendP4(Vdbe*, void *pP4, int p4type);
SQLITE_PRIVATE void sqlite3VdbeSetP4KeyInfo(Parse*, Index*);
SQLITE_PRIVATE void sqlite3VdbeUsesBtree(Vdbe*, int);
SQLITE_PRIVATE VdbeOp *sqlite3VdbeGetOp(Vdbe*, int);
-SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe*);
+SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Parse*);
SQLITE_PRIVATE void sqlite3VdbeRunOnlyOnce(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeReusable(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeDelete(Vdbe*);
@@ -15091,6 +15121,10 @@ SQLITE_PRIVATE void sqlite3VdbeCountChanges(Vdbe*);
SQLITE_PRIVATE sqlite3 *sqlite3VdbeDb(Vdbe*);
SQLITE_PRIVATE u8 sqlite3VdbePrepareFlags(Vdbe*);
SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe*, const char *z, int n, u8);
+#ifdef SQLITE_ENABLE_NORMALIZE
+SQLITE_PRIVATE void sqlite3VdbeAddDblquoteStr(sqlite3*,Vdbe*,const char*);
+SQLITE_PRIVATE int sqlite3VdbeUsesDoubleQuotedString(Vdbe*,const char*);
+#endif
SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe*,Vdbe*);
SQLITE_PRIVATE VdbeOp *sqlite3VdbeTakeOpArray(Vdbe*, int*, int*);
SQLITE_PRIVATE sqlite3_value *sqlite3VdbeGetBoundValue(Vdbe*, int, u8);
@@ -16216,10 +16250,13 @@ SQLITE_PRIVATE void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**);
/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing
** in the style of sqlite3_trace()
*/
-#define SQLITE_TRACE_LEGACY 0x80
+#define SQLITE_TRACE_LEGACY 0x40 /* Use the legacy xTrace */
+#define SQLITE_TRACE_XPROFILE 0x80 /* Use the legacy xProfile */
#else
-#define SQLITE_TRACE_LEGACY 0
+#define SQLITE_TRACE_LEGACY 0
+#define SQLITE_TRACE_XPROFILE 0
#endif /* SQLITE_OMIT_DEPRECATED */
+#define SQLITE_TRACE_NONLEGACY_MASK 0x0f /* Normal flags */
/*
@@ -16278,8 +16315,10 @@ struct sqlite3 {
void **aExtension; /* Array of shared library handles */
int (*xTrace)(u32,void*,void*,void*); /* Trace function */
void *pTraceArg; /* Argument to the trace function */
+#ifndef SQLITE_OMIT_DEPRECATED
void (*xProfile)(void*,const char*,u64); /* Profiling function */
void *pProfileArg; /* Argument to profile function */
+#endif
void *pCommitArg; /* Argument to xCommitCallback() */
int (*xCommitCallback)(void*); /* Invoked at every commit. */
void *pRollbackArg; /* Argument to xRollbackCallback() */
@@ -16410,6 +16449,7 @@ struct sqlite3 {
#define SQLITE_VdbeTrace HI(0x0004) /* True to trace VDBE execution */
#define SQLITE_VdbeAddopTrace HI(0x0008) /* Trace sqlite3VdbeAddOp() calls */
#define SQLITE_VdbeEQP HI(0x0010) /* Debug EXPLAIN QUERY PLAN */
+#define SQLITE_ParserTrace HI(0x0020) /* PRAGMA parser_trace=ON */
#endif
/*
@@ -16812,9 +16852,6 @@ struct VTable {
struct Table {
char *zName; /* Name of the table or view */
Column *aCol; /* Information about each column */
-#ifdef SQLITE_ENABLE_NORMALIZE
- Hash *pColHash; /* All columns indexed by name */
-#endif
Index *pIndex; /* List of SQL indexes on this table. */
Select *pSelect; /* NULL for tables. Points to definition if a view. */
FKey *pFKey; /* Linked list of all foreign keys in this table */
@@ -17101,7 +17138,7 @@ struct Index {
u16 nKeyCol; /* Number of columns forming the key */
u16 nColumn; /* Number of columns stored in the index */
u8 onError; /* OE_Abort, OE_Ignore, OE_Replace, or OE_None */
- unsigned idxType:2; /* 1==UNIQUE, 2==PRIMARY KEY, 0==CREATE INDEX */
+ unsigned idxType:2; /* 0:Normal 1:UNIQUE, 2:PRIMARY KEY, 3:IPK */
unsigned bUnordered:1; /* Use this index for == or IN queries only */
unsigned uniqNotNull:1; /* True if UNIQUE and NOT NULL for all columns */
unsigned isResized:1; /* True if resizeIndexObject() has been called */
@@ -17126,6 +17163,7 @@ struct Index {
#define SQLITE_IDXTYPE_APPDEF 0 /* Created using CREATE INDEX */
#define SQLITE_IDXTYPE_UNIQUE 1 /* Implements a UNIQUE constraint */
#define SQLITE_IDXTYPE_PRIMARYKEY 2 /* Is the PRIMARY KEY for the table */
+#define SQLITE_IDXTYPE_IPK 3 /* INTEGER PRIMARY KEY index */
/* Return true if index X is a PRIMARY KEY index */
#define IsPrimaryKeyIndex(X) ((X)->idxType==SQLITE_IDXTYPE_PRIMARYKEY)
@@ -17343,6 +17381,10 @@ struct Expr {
Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
** for a column of an index on an expression */
Window *pWin; /* TK_FUNCTION: Window definition for the func */
+ struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
+ int iAddr; /* Subroutine entry address */
+ int regReturn; /* Register used to hold return address */
+ } sub;
} y;
};
@@ -17374,6 +17416,8 @@ struct Expr {
#define EP_Alias 0x400000 /* Is an alias for a result set column */
#define EP_Leaf 0x800000 /* Expr.pLeft, .pRight, .u.pSelect all NULL */
#define EP_WinFunc 0x1000000 /* TK_FUNCTION with Expr.y.pWin set */
+#define EP_Subrtn 0x2000000 /* Uses Expr.y.sub. TK_IN, _SELECT, or _EXISTS */
+#define EP_Quoted 0x4000000 /* TK_ID was originally quoted */
/*
** The EP_Propagate mask is a set of properties that automatically propagate
@@ -17917,16 +17961,17 @@ struct Parse {
u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
u8 okConstFactor; /* OK to factor out constants */
u8 disableLookaside; /* Number of times lookaside has been disabled */
+ u8 disableVtab; /* Disable all virtual tables for this parse */
int nRangeReg; /* Size of the temporary register block */
int iRangeReg; /* First register in temporary register block */
int nErr; /* Number of errors seen */
int nTab; /* Number of previously allocated VDBE cursors */
int nMem; /* Number of memory cells used so far */
- int nOpAlloc; /* Number of slots allocated for Vdbe.aOp[] */
int szOpAlloc; /* Bytes of memory space allocated for Vdbe.aOp[] */
int iSelfTab; /* Table associated with an index on expr, or negative
** of the base register during check-constraint eval */
- int nLabel; /* Number of labels used */
+ int nLabel; /* The *negative* of the number of labels used */
+ int nLabelAlloc; /* Number of slots in aLabel */
int *aLabel; /* Space to hold the labels */
ExprList *pConstExpr;/* Constant expressions */
Token constraintName;/* Name of the constraint currently being parsed */
@@ -17986,7 +18031,9 @@ struct Parse {
Vdbe *pReprepare; /* VM being reprepared (sqlite3Reprepare()) */
const char *zTail; /* All SQL text past the last semicolon parsed */
Table *pNewTable; /* A table being constructed by CREATE TABLE */
- Index *pNewIndex; /* An index being constructed by CREATE INDEX */
+ Index *pNewIndex; /* An index being constructed by CREATE INDEX.
+ ** Also used to hold redundant UNIQUE constraints
+ ** during a RENAME COLUMN */
Trigger *pNewTrigger; /* Trigger under construct by a CREATE TRIGGER */
const char *zAuthContext; /* The 6th parameter to db->xAuth callbacks */
#ifndef SQLITE_OMIT_VIRTUALTABLE
@@ -18214,6 +18261,7 @@ typedef struct {
int iDb; /* 0 for main database. 1 for TEMP, 2.. for ATTACHed */
int rc; /* Result code stored here */
u32 mInitFlags; /* Flags controlling error messages */
+ u32 nInitRow; /* Number of rows processed */
} InitData;
/*
@@ -18274,6 +18322,9 @@ struct Sqlite3Config {
void (*xVdbeBranch)(void*,unsigned iSrcLine,u8 eThis,u8 eMx); /* Callback */
void *pVdbeBranchArg; /* 1st argument */
#endif
+#ifdef SQLITE_ENABLE_DESERIALIZE
+ sqlite3_int64 mxMemdbSize; /* Default max memdb size */
+#endif
#ifndef SQLITE_UNTESTABLE
int (*xTestCallback)(int); /* Invoked by sqlite3FaultSim() */
#endif
@@ -18662,6 +18713,7 @@ SQLITE_PRIVATE void sqlite3TreeViewWinFunc(TreeView*, const Window*, u8);
SQLITE_PRIVATE void sqlite3SetString(char **, sqlite3*, const char*);
SQLITE_PRIVATE void sqlite3ErrorMsg(Parse*, const char*, ...);
SQLITE_PRIVATE void sqlite3Dequote(char*);
+SQLITE_PRIVATE void sqlite3DequoteExpr(Expr*);
SQLITE_PRIVATE void sqlite3TokenInit(Token*,char*);
SQLITE_PRIVATE int sqlite3KeywordCode(const unsigned char*, int);
SQLITE_PRIVATE int sqlite3RunParser(Parse*, const char*, char **);
@@ -18690,6 +18742,7 @@ SQLITE_PRIVATE void sqlite3ExprListSetName(Parse*,ExprList*,Token*,int);
SQLITE_PRIVATE void sqlite3ExprListSetSpan(Parse*,ExprList*,const char*,const char*);
SQLITE_PRIVATE void sqlite3ExprListDelete(sqlite3*, ExprList*);
SQLITE_PRIVATE u32 sqlite3ExprListFlags(const ExprList*);
+SQLITE_PRIVATE int sqlite3IndexHasDuplicateRootPage(Index*);
SQLITE_PRIVATE int sqlite3Init(sqlite3*, char**);
SQLITE_PRIVATE int sqlite3InitCallback(void*, int, char**, char**);
SQLITE_PRIVATE int sqlite3InitOne(sqlite3*, int, char**, u32);
@@ -18723,6 +18776,11 @@ SQLITE_PRIVATE void sqlite3AddCollateType(Parse*, Token*);
SQLITE_PRIVATE void sqlite3EndTable(Parse*,Token*,Token*,u8,Select*);
SQLITE_PRIVATE int sqlite3ParseUri(const char*,const char*,unsigned int*,
sqlite3_vfs**,char**,char **);
+#ifdef SQLITE_HAS_CODEC
+SQLITE_PRIVATE int sqlite3CodecQueryParameters(sqlite3*,const char*,const char*);
+#else
+# define sqlite3CodecQueryParameters(A,B,C) 0
+#endif
SQLITE_PRIVATE Btree *sqlite3DbNameToBtree(sqlite3*,const char*);
#ifdef SQLITE_UNTESTABLE
@@ -18775,8 +18833,8 @@ SQLITE_PRIVATE void sqlite3Insert(Parse*, SrcList*, Select*, IdList*, int, Upser
SQLITE_PRIVATE void *sqlite3ArrayAllocate(sqlite3*,void*,int,int*,int*);
SQLITE_PRIVATE IdList *sqlite3IdListAppend(Parse*, IdList*, Token*);
SQLITE_PRIVATE int sqlite3IdListIndex(IdList*,const char*);
-SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int);
-SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*);
+SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(Parse*, SrcList*, int, int);
+SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(Parse*, SrcList*, Token*, Token*);
SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*,
Token*, Select*, Expr*, IdList*);
SQLITE_PRIVATE void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *);
@@ -18843,8 +18901,8 @@ SQLITE_PRIVATE Table *sqlite3LocateTableItem(Parse*,u32 flags,struct SrcList_ite
SQLITE_PRIVATE Index *sqlite3FindIndex(sqlite3*,const char*, const char*);
SQLITE_PRIVATE void sqlite3UnlinkAndDeleteTable(sqlite3*,int,const char*);
SQLITE_PRIVATE void sqlite3UnlinkAndDeleteIndex(sqlite3*,int,const char*);
-SQLITE_PRIVATE void sqlite3Vacuum(Parse*,Token*);
-SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int);
+SQLITE_PRIVATE void sqlite3Vacuum(Parse*,Token*,Expr*);
+SQLITE_PRIVATE int sqlite3RunVacuum(char**, sqlite3*, int, sqlite3_value*);
SQLITE_PRIVATE char *sqlite3NameFromToken(sqlite3*, Token*);
SQLITE_PRIVATE int sqlite3ExprCompare(Parse*,Expr*, Expr*, int);
SQLITE_PRIVATE int sqlite3ExprCompareSkip(Expr*, Expr*, int);
@@ -18882,9 +18940,6 @@ SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr*, int*);
SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr*);
SQLITE_PRIVATE int sqlite3ExprNeedsNoAffinityChange(const Expr*, char);
SQLITE_PRIVATE int sqlite3IsRowid(const char*);
-#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE int sqlite3IsRowidN(const char*, int);
-#endif
SQLITE_PRIVATE void sqlite3GenerateRowDelete(
Parse*,Table*,Trigger*,int,int,int,i16,u8,u8,u8,int);
SQLITE_PRIVATE void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int);
@@ -18911,9 +18966,7 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListDup(sqlite3*,ExprList*,int);
SQLITE_PRIVATE SrcList *sqlite3SrcListDup(sqlite3*,SrcList*,int);
SQLITE_PRIVATE IdList *sqlite3IdListDup(sqlite3*,IdList*);
SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3*,Select*,int);
-#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE FuncDef *sqlite3FunctionSearchN(int,const char*,int);
-#endif
+SQLITE_PRIVATE FuncDef *sqlite3FunctionSearch(int,const char*);
SQLITE_PRIVATE void sqlite3InsertBuiltinFuncs(FuncDef*,int);
SQLITE_PRIVATE FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,u8,u8);
SQLITE_PRIVATE void sqlite3RegisterBuiltinFunctions(void);
@@ -19118,19 +19171,17 @@ SQLITE_PRIVATE void sqlite3AlterFunctions(void);
SQLITE_PRIVATE void sqlite3AlterRenameTable(Parse*, SrcList*, Token*);
SQLITE_PRIVATE void sqlite3AlterRenameColumn(Parse*, SrcList*, Token*, Token*);
SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *, int *);
-#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE int sqlite3GetTokenNormalized(const unsigned char *, int *, int *);
-#endif
SQLITE_PRIVATE void sqlite3NestedParse(Parse*, const char*, ...);
SQLITE_PRIVATE void sqlite3ExpirePreparedStatements(sqlite3*, int);
-SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr *, int, int);
+SQLITE_PRIVATE void sqlite3CodeRhsOfIN(Parse*, Expr*, int);
+SQLITE_PRIVATE int sqlite3CodeSubselect(Parse*, Expr*);
SQLITE_PRIVATE void sqlite3SelectPrep(Parse*, Select*, NameContext*);
SQLITE_PRIVATE void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p);
SQLITE_PRIVATE int sqlite3MatchSpanName(const char*, const char*, const char*, const char*);
SQLITE_PRIVATE int sqlite3ResolveExprNames(NameContext*, Expr*);
SQLITE_PRIVATE int sqlite3ResolveExprListNames(NameContext*, ExprList*);
SQLITE_PRIVATE void sqlite3ResolveSelectNames(Parse*, Select*, NameContext*);
-SQLITE_PRIVATE void sqlite3ResolveSelfReference(Parse*,Table*,int,Expr*,ExprList*);
+SQLITE_PRIVATE int sqlite3ResolveSelfReference(Parse*,Table*,int,Expr*,ExprList*);
SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(Parse*, Select*, ExprList*, const char*);
SQLITE_PRIVATE void sqlite3ColumnDefault(Vdbe *, Table *, int, int);
SQLITE_PRIVATE void sqlite3AlterFinishAddColumn(Parse *, Token *);
@@ -19279,7 +19330,7 @@ SQLITE_PRIVATE int sqlite3VdbeParameterIndex(Vdbe*, const char*, int);
SQLITE_PRIVATE int sqlite3TransferBindings(sqlite3_stmt *, sqlite3_stmt *);
SQLITE_PRIVATE void sqlite3ParserReset(Parse*);
#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE void sqlite3Normalize(Vdbe*, const char*, int, u8);
+SQLITE_PRIVATE char *sqlite3Normalize(Vdbe*, const char*);
#endif
SQLITE_PRIVATE int sqlite3Reprepare(Vdbe*);
SQLITE_PRIVATE void sqlite3ExprListCheckLength(Parse*, ExprList*, const char*);
@@ -19375,7 +19426,7 @@ SQLITE_PRIVATE void sqlite3EndBenignMalloc(void);
#define IN_INDEX_NOOP_OK 0x0001 /* OK to return IN_INDEX_NOOP */
#define IN_INDEX_MEMBERSHIP 0x0002 /* IN operator used for membership test */
#define IN_INDEX_LOOP 0x0004 /* IN operator used as a loop */
-SQLITE_PRIVATE int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*);
+SQLITE_PRIVATE int sqlite3FindInIndex(Parse *, Expr *, u32, int*, int*, int*);
SQLITE_PRIVATE int sqlite3JournalOpen(sqlite3_vfs *, const char *, sqlite3_file *, int, int);
SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *);
@@ -19691,6 +19742,13 @@ SQLITE_PRIVATE const unsigned char sqlite3CtypeMap[256] = {
#endif
+/* The default maximum size of an in-memory database created using
+** sqlite3_deserialize()
+*/
+#ifndef SQLITE_MEMDB_DEFAULT_MAXSIZE
+# define SQLITE_MEMDB_DEFAULT_MAXSIZE 1073741824
+#endif
+
/*
** The following singleton contains the global configuration for
** the SQLite library.
@@ -19738,13 +19796,16 @@ SQLITE_PRIVATE SQLITE_WSD struct Sqlite3Config sqlite3Config = {
0, /* xVdbeBranch */
0, /* pVbeBranchArg */
#endif
+#ifdef SQLITE_ENABLE_DESERIALIZE
+ SQLITE_MEMDB_DEFAULT_MAXSIZE, /* mxMemdbSize */
+#endif
#ifndef SQLITE_UNTESTABLE
0, /* xTestCallback */
#endif
0, /* bLocaltimeFault */
0, /* bInternalFunctions */
0x7ffffffe, /* iOnceResetThreshold */
- SQLITE_DEFAULT_SORTERREF_SIZE /* szSorterRef */
+ SQLITE_DEFAULT_SORTERREF_SIZE, /* szSorterRef */
};
/*
@@ -20163,6 +20224,9 @@ struct sqlite3_context {
*/
typedef unsigned bft; /* Bit Field Type */
+/* The ScanStatus object holds a single value for the
+** sqlite3_stmt_scanstatus() interface.
+*/
typedef struct ScanStatus ScanStatus;
struct ScanStatus {
int addrExplain; /* OP_Explain for loop */
@@ -20173,6 +20237,19 @@ struct ScanStatus {
char *zName; /* Name of table or index */
};
+/* The DblquoteStr object holds the text of a double-quoted
+** string for a prepared statement. A linked list of these objects
+** is constructed during statement parsing and is held on Vdbe.pDblStr.
+** When computing a normalized SQL statement for an SQL statement, that
+** list is consulted for each double-quoted identifier to see if the
+** identifier should really be a string literal.
+*/
+typedef struct DblquoteStr DblquoteStr;
+struct DblquoteStr {
+ DblquoteStr *pNextStr; /* Next string literal in the list */
+ char z[8]; /* Dequoted value for the string */
+};
+
/*
** An instance of the virtual machine. This structure contains the complete
** state of the virtual machine.
@@ -20192,28 +20269,29 @@ struct Vdbe {
int pc; /* The program counter */
int rc; /* Value to return */
int nChange; /* Number of db changes made since last reset */
- int iStatement; /* Statement number (or 0 if has not opened stmt) */
+ int iStatement; /* Statement number (or 0 if has no opened stmt) */
i64 iCurrentTime; /* Value of julianday('now') for this statement */
i64 nFkConstraint; /* Number of imm. FK constraints this VM */
i64 nStmtDefCons; /* Number of def. constraints when stmt started */
i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
+ Mem *aMem; /* The memory locations */
+ Mem **apArg; /* Arguments to currently executing user function */
+ VdbeCursor **apCsr; /* One element of this array for each open cursor */
+ Mem *aVar; /* Values for the OP_Variable opcode. */
/* When allocating a new Vdbe object, all of the fields below should be
** initialized to zero or NULL */
Op *aOp; /* Space to hold the virtual machine's program */
- Mem *aMem; /* The memory locations */
- Mem **apArg; /* Arguments to currently executing user function */
+ int nOp; /* Number of instructions in the program */
+ int nOpAlloc; /* Slots allocated for aOp[] */
Mem *aColName; /* Column names to return */
Mem *pResultSet; /* Pointer to an array of results */
char *zErrMsg; /* Error message written here */
- VdbeCursor **apCsr; /* One element of this array for each open cursor */
- Mem *aVar; /* Values for the OP_Variable opcode. */
VList *pVList; /* Name of variables */
#ifndef SQLITE_OMIT_TRACE
i64 startTime; /* Time when query started - used for profiling */
#endif
- int nOp; /* Number of instructions in the program */
#ifdef SQLITE_DEBUG
int rcApp; /* errcode set by sqlite3_result_error_code() */
u32 nWrite; /* Number of write operations that have occurred */
@@ -20236,6 +20314,7 @@ struct Vdbe {
char *zSql; /* Text of the SQL statement that generated this */
#ifdef SQLITE_ENABLE_NORMALIZE
char *zNormSql; /* Normalization of the associated SQL statement */
+ DblquoteStr *pDblStr; /* List of double-quoted string literals */
#endif
void *pFree; /* Free this when deleting the vdbe */
VdbeFrame *pFrame; /* Parent frame */
@@ -27253,6 +27332,27 @@ static char *getTextArg(PrintfArguments *p){
return (char*)sqlite3_value_text(p->apArg[p->nUsed++]);
}
+/*
+** Allocate memory for a temporary buffer needed for printf rendering.
+**
+** If the requested size of the temp buffer is larger than the size
+** of the output buffer in pAccum, then cause an SQLITE_TOOBIG error.
+** Do the size check before the memory allocation to prevent rogue
+** SQL from requesting large allocations using the precision or width
+** field of the printf() function.
+*/
+static char *printfTempBuf(sqlite3_str *pAccum, sqlite3_int64 n){
+ char *z;
+ if( n>pAccum->nAlloc && n>pAccum->mxAlloc ){
+ setStrAccumError(pAccum, SQLITE_TOOBIG);
+ return 0;
+ }
+ z = sqlite3DbMallocRaw(pAccum->db, n);
+ if( z==0 ){
+ setStrAccumError(pAccum, SQLITE_NOMEM);
+ }
+ return z;
+}
/*
** On machines with a small stack size, you can redefine the
@@ -27335,6 +27435,9 @@ SQLITE_API void sqlite3_str_vappendf(
flag_leftjustify = flag_prefix = cThousand =
flag_alternateform = flag_altform2 = flag_zeropad = 0;
done = 0;
+ width = 0;
+ flag_long = 0;
+ precision = -1;
do{
switch( c ){
case '-': flag_leftjustify = 1; break;
@@ -27345,80 +27448,93 @@ SQLITE_API void sqlite3_str_vappendf(
case '0': flag_zeropad = 1; break;
case ',': cThousand = ','; break;
default: done = 1; break;
- }
- }while( !done && (c=(*++fmt))!=0 );
- /* Get the field width */
- if( c=='*' ){
- if( bArgList ){
- width = (int)getIntArg(pArgList);
- }else{
- width = va_arg(ap,int);
- }
- if( width<0 ){
- flag_leftjustify = 1;
- width = width >= -2147483647 ? -width : 0;
- }
- c = *++fmt;
- }else{
- unsigned wx = 0;
- while( c>='0' && c<='9' ){
- wx = wx*10 + c - '0';
- c = *++fmt;
- }
- testcase( wx>0x7fffffff );
- width = wx & 0x7fffffff;
- }
- assert( width>=0 );
+ case 'l': {
+ flag_long = 1;
+ c = *++fmt;
+ if( c=='l' ){
+ c = *++fmt;
+ flag_long = 2;
+ }
+ done = 1;
+ break;
+ }
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9': {
+ unsigned wx = c - '0';
+ while( (c = *++fmt)>='0' && c<='9' ){
+ wx = wx*10 + c - '0';
+ }
+ testcase( wx>0x7fffffff );
+ width = wx & 0x7fffffff;
#ifdef SQLITE_PRINTF_PRECISION_LIMIT
- if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
- width = SQLITE_PRINTF_PRECISION_LIMIT;
- }
+ if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
+ width = SQLITE_PRINTF_PRECISION_LIMIT;
+ }
#endif
-
- /* Get the precision */
- if( c=='.' ){
- c = *++fmt;
- if( c=='*' ){
- if( bArgList ){
- precision = (int)getIntArg(pArgList);
- }else{
- precision = va_arg(ap,int);
+ if( c!='.' && c!='l' ){
+ done = 1;
+ }else{
+ fmt--;
+ }
+ break;
}
- c = *++fmt;
- if( precision<0 ){
- precision = precision >= -2147483647 ? -precision : -1;
+ case '*': {
+ if( bArgList ){
+ width = (int)getIntArg(pArgList);
+ }else{
+ width = va_arg(ap,int);
+ }
+ if( width<0 ){
+ flag_leftjustify = 1;
+ width = width >= -2147483647 ? -width : 0;
+ }
+#ifdef SQLITE_PRINTF_PRECISION_LIMIT
+ if( width>SQLITE_PRINTF_PRECISION_LIMIT ){
+ width = SQLITE_PRINTF_PRECISION_LIMIT;
+ }
+#endif
+ if( (c = fmt[1])!='.' && c!='l' ){
+ c = *++fmt;
+ done = 1;
+ }
+ break;
}
- }else{
- unsigned px = 0;
- while( c>='0' && c<='9' ){
- px = px*10 + c - '0';
+ case '.': {
c = *++fmt;
- }
- testcase( px>0x7fffffff );
- precision = px & 0x7fffffff;
- }
- }else{
- precision = -1;
- }
- assert( precision>=(-1) );
+ if( c=='*' ){
+ if( bArgList ){
+ precision = (int)getIntArg(pArgList);
+ }else{
+ precision = va_arg(ap,int);
+ }
+ if( precision<0 ){
+ precision = precision >= -2147483647 ? -precision : -1;
+ }
+ c = *++fmt;
+ }else{
+ unsigned px = 0;
+ while( c>='0' && c<='9' ){
+ px = px*10 + c - '0';
+ c = *++fmt;
+ }
+ testcase( px>0x7fffffff );
+ precision = px & 0x7fffffff;
+ }
#ifdef SQLITE_PRINTF_PRECISION_LIMIT
- if( precision>SQLITE_PRINTF_PRECISION_LIMIT ){
- precision = SQLITE_PRINTF_PRECISION_LIMIT;
- }
+ if( precision>SQLITE_PRINTF_PRECISION_LIMIT ){
+ precision = SQLITE_PRINTF_PRECISION_LIMIT;
+ }
#endif
-
-
- /* Get the conversion type modifier */
- if( c=='l' ){
- flag_long = 1;
- c = *++fmt;
- if( c=='l' ){
- flag_long = 2;
- c = *++fmt;
+ if( c=='l' ){
+ --fmt;
+ }else{
+ done = 1;
+ }
+ break;
+ }
}
- }else{
- flag_long = 0;
- }
+ }while( !done && (c=(*++fmt))!=0 );
+
/* Fetch the info entry for the field */
infop = &fmtinfo[0];
xtype = etINVALID;
@@ -27503,12 +27619,11 @@ SQLITE_API void sqlite3_str_vappendf(
nOut = etBUFSIZE;
zOut = buf;
}else{
- u64 n = (u64)precision + 10 + precision/3;
- zOut = zExtra = sqlite3Malloc( n );
- if( zOut==0 ){
- setStrAccumError(pAccum, SQLITE_NOMEM);
- return;
- }
+ u64 n;
+ n = (u64)precision + 10;
+ if( cThousand ) n += precision/3;
+ zOut = zExtra = printfTempBuf(pAccum, n);
+ if( zOut==0 ) return;
nOut = (int)n;
}
bufpt = &zOut[nOut-1];
@@ -27627,12 +27742,12 @@ SQLITE_API void sqlite3_str_vappendf(
}else{
e2 = exp;
}
- if( MAX(e2,0)+(i64)precision+(i64)width > etBUFSIZE - 15 ){
- bufpt = zExtra
- = sqlite3Malloc( MAX(e2,0)+(i64)precision+(i64)width+15 );
- if( bufpt==0 ){
- setStrAccumError(pAccum, SQLITE_NOMEM);
- return;
+ {
+ i64 szBufNeeded; /* Size of a temporary buffer needed */
+ szBufNeeded = MAX(e2,0)+(i64)precision+(i64)width+15;
+ if( szBufNeeded > etBUFSIZE ){
+ bufpt = zExtra = printfTempBuf(pAccum, szBufNeeded);
+ if( bufpt==0 ) return;
}
}
zOut = bufpt;
@@ -27856,11 +27971,8 @@ SQLITE_API void sqlite3_str_vappendf(
needQuote = !isnull && xtype==etSQLESCAPE2;
n += i + 3;
if( n>etBUFSIZE ){
- bufpt = zExtra = sqlite3Malloc( n );
- if( bufpt==0 ){
- setStrAccumError(pAccum, SQLITE_NOMEM);
- return;
- }
+ bufpt = zExtra = printfTempBuf(pAccum, n);
+ if( bufpt==0 ) return;
}else{
bufpt = buf;
}
@@ -28486,7 +28598,8 @@ SQLITE_PRIVATE void sqlite3TreeViewSrcList(TreeView *pView, const SrcList *pSrc)
sqlite3_str_appendf(&x, " %s", pItem->zName);
}
if( pItem->pTab ){
- sqlite3_str_appendf(&x, " tabname=%Q", pItem->pTab->zName);
+ sqlite3_str_appendf(&x, " tab=%Q nCol=%d ptr=%p",
+ pItem->pTab->zName, pItem->pTab->nCol, pItem->pTab);
}
if( pItem->zAlias ){
sqlite3_str_appendf(&x, " (AS %s)", pItem->zAlias);
@@ -30226,7 +30339,7 @@ SQLITE_PRIVATE void sqlite3ErrorMsg(Parse *pParse, const char *zFormat, ...){
** dequoted string, exclusive of the zero terminator, if dequoting does
** occur.
**
-** 2002-Feb-14: This routine is extended to remove MS-Access style
+** 2002-02-14: This routine is extended to remove MS-Access style
** brackets from around identifiers. For example: "[a-b-c]" becomes
** "a-b-c".
*/
@@ -30252,6 +30365,11 @@ SQLITE_PRIVATE void sqlite3Dequote(char *z){
}
z[j] = 0;
}
+SQLITE_PRIVATE void sqlite3DequoteExpr(Expr *p){
+ assert( sqlite3Isquote(p->u.zToken[0]) );
+ p->flags |= p->u.zToken[0]=='"' ? EP_Quoted|EP_DblQuoted : EP_Quoted;
+ sqlite3Dequote(p->u.zToken);
+}
/*
** Generate a Token object from a string
@@ -31679,20 +31797,6 @@ static unsigned int strHash(const char *z){
}
return h;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-static unsigned int strHashN(const char *z, int n){
- unsigned int h = 0;
- int i;
- for(i=0; i<n; i++){
- /* Knuth multiplicative hashing. (Sorting & Searching, p. 510).
- ** 0x9e3779b1 is 2654435761 which is the closest prime number to
- ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */
- h += sqlite3UpperToLower[z[i]];
- h *= 0x9e3779b1;
- }
- return h;
-}
-#endif /* SQLITE_ENABLE_NORMALIZE */
/* Link pNew element into the hash table pH. If pEntry!=0 then also
@@ -31804,40 +31908,6 @@ static HashElem *findElementWithHash(
}
return &nullElement;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-static HashElem *findElementWithHashN(
- const Hash *pH, /* The pH to be searched */
- const char *pKey, /* The key we are searching for */
- int nKey, /* Number of key bytes to use */
- unsigned int *pHash /* Write the hash value here */
-){
- HashElem *elem; /* Used to loop thru the element list */
- int count; /* Number of elements left to test */
- unsigned int h; /* The computed hash */
- static HashElem nullElement = { 0, 0, 0, 0 };
-
- if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/
- struct _ht *pEntry;
- h = strHashN(pKey, nKey) % pH->htsize;
- pEntry = &pH->ht[h];
- elem = pEntry->chain;
- count = pEntry->count;
- }else{
- h = 0;
- elem = pH->first;
- count = pH->count;
- }
- if( pHash ) *pHash = h;
- while( count-- ){
- assert( elem!=0 );
- if( sqlite3StrNICmp(elem->pKey,pKey,nKey)==0 ){
- return elem;
- }
- elem = elem->next;
- }
- return &nullElement;
-}
-#endif /* SQLITE_ENABLE_NORMALIZE */
/* Remove a single entry from the hash table given a pointer to that
** element and a hash on the element's key.
@@ -31882,14 +31952,6 @@ SQLITE_PRIVATE void *sqlite3HashFind(const Hash *pH, const char *pKey){
assert( pKey!=0 );
return findElementWithHash(pH, pKey, 0)->data;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE void *sqlite3HashFindN(const Hash *pH, const char *pKey, int nKey){
- assert( pH!=0 );
- assert( pKey!=0 );
- assert( nKey>=0 );
- return findElementWithHashN(pH, pKey, nKey, 0)->data;
-}
-#endif /* SQLITE_ENABLE_NORMALIZE */
/* Insert an element into the hash table pH. The key is pKey
** and the data is "data".
@@ -32076,57 +32138,56 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
/* 120 */ "Sequence" OpHelp("r[P2]=cursor[P1].ctr++"),
/* 121 */ "NewRowid" OpHelp("r[P2]=rowid"),
/* 122 */ "Insert" OpHelp("intkey=r[P3] data=r[P2]"),
- /* 123 */ "InsertInt" OpHelp("intkey=P3 data=r[P2]"),
- /* 124 */ "Delete" OpHelp(""),
- /* 125 */ "ResetCount" OpHelp(""),
- /* 126 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
- /* 127 */ "SorterData" OpHelp("r[P2]=data"),
- /* 128 */ "RowData" OpHelp("r[P2]=data"),
- /* 129 */ "Rowid" OpHelp("r[P2]=rowid"),
- /* 130 */ "NullRow" OpHelp(""),
- /* 131 */ "SeekEnd" OpHelp(""),
- /* 132 */ "SorterInsert" OpHelp("key=r[P2]"),
- /* 133 */ "IdxInsert" OpHelp("key=r[P2]"),
- /* 134 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
- /* 135 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
- /* 136 */ "IdxRowid" OpHelp("r[P2]=rowid"),
- /* 137 */ "Destroy" OpHelp(""),
- /* 138 */ "Clear" OpHelp(""),
- /* 139 */ "ResetSorter" OpHelp(""),
- /* 140 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
+ /* 123 */ "Delete" OpHelp(""),
+ /* 124 */ "ResetCount" OpHelp(""),
+ /* 125 */ "SorterCompare" OpHelp("if key(P1)!=trim(r[P3],P4) goto P2"),
+ /* 126 */ "SorterData" OpHelp("r[P2]=data"),
+ /* 127 */ "RowData" OpHelp("r[P2]=data"),
+ /* 128 */ "Rowid" OpHelp("r[P2]=rowid"),
+ /* 129 */ "NullRow" OpHelp(""),
+ /* 130 */ "SeekEnd" OpHelp(""),
+ /* 131 */ "SorterInsert" OpHelp("key=r[P2]"),
+ /* 132 */ "IdxInsert" OpHelp("key=r[P2]"),
+ /* 133 */ "IdxDelete" OpHelp("key=r[P2@P3]"),
+ /* 134 */ "DeferredSeek" OpHelp("Move P3 to P1.rowid if needed"),
+ /* 135 */ "IdxRowid" OpHelp("r[P2]=rowid"),
+ /* 136 */ "Destroy" OpHelp(""),
+ /* 137 */ "Clear" OpHelp(""),
+ /* 138 */ "ResetSorter" OpHelp(""),
+ /* 139 */ "CreateBtree" OpHelp("r[P2]=root iDb=P1 flags=P3"),
+ /* 140 */ "SqlExec" OpHelp(""),
/* 141 */ "Real" OpHelp("r[P2]=P4"),
- /* 142 */ "SqlExec" OpHelp(""),
- /* 143 */ "ParseSchema" OpHelp(""),
- /* 144 */ "LoadAnalysis" OpHelp(""),
- /* 145 */ "DropTable" OpHelp(""),
- /* 146 */ "DropIndex" OpHelp(""),
- /* 147 */ "DropTrigger" OpHelp(""),
- /* 148 */ "IntegrityCk" OpHelp(""),
- /* 149 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
- /* 150 */ "Param" OpHelp(""),
- /* 151 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
- /* 152 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
- /* 153 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
- /* 154 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
- /* 155 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
- /* 156 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
- /* 157 */ "AggValue" OpHelp("r[P3]=value N=P2"),
- /* 158 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
- /* 159 */ "Expire" OpHelp(""),
- /* 160 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
- /* 161 */ "VBegin" OpHelp(""),
- /* 162 */ "VCreate" OpHelp(""),
- /* 163 */ "VDestroy" OpHelp(""),
- /* 164 */ "VOpen" OpHelp(""),
- /* 165 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
- /* 166 */ "VRename" OpHelp(""),
- /* 167 */ "Pagecount" OpHelp(""),
- /* 168 */ "MaxPgcnt" OpHelp(""),
- /* 169 */ "Trace" OpHelp(""),
- /* 170 */ "CursorHint" OpHelp(""),
- /* 171 */ "Noop" OpHelp(""),
- /* 172 */ "Explain" OpHelp(""),
- /* 173 */ "Abortable" OpHelp(""),
+ /* 142 */ "ParseSchema" OpHelp(""),
+ /* 143 */ "LoadAnalysis" OpHelp(""),
+ /* 144 */ "DropTable" OpHelp(""),
+ /* 145 */ "DropIndex" OpHelp(""),
+ /* 146 */ "DropTrigger" OpHelp(""),
+ /* 147 */ "IntegrityCk" OpHelp(""),
+ /* 148 */ "RowSetAdd" OpHelp("rowset(P1)=r[P2]"),
+ /* 149 */ "Param" OpHelp(""),
+ /* 150 */ "FkCounter" OpHelp("fkctr[P1]+=P2"),
+ /* 151 */ "MemMax" OpHelp("r[P1]=max(r[P1],r[P2])"),
+ /* 152 */ "OffsetLimit" OpHelp("if r[P1]>0 then r[P2]=r[P1]+max(0,r[P3]) else r[P2]=(-1)"),
+ /* 153 */ "AggInverse" OpHelp("accum=r[P3] inverse(r[P2@P5])"),
+ /* 154 */ "AggStep" OpHelp("accum=r[P3] step(r[P2@P5])"),
+ /* 155 */ "AggStep1" OpHelp("accum=r[P3] step(r[P2@P5])"),
+ /* 156 */ "AggValue" OpHelp("r[P3]=value N=P2"),
+ /* 157 */ "AggFinal" OpHelp("accum=r[P1] N=P2"),
+ /* 158 */ "Expire" OpHelp(""),
+ /* 159 */ "TableLock" OpHelp("iDb=P1 root=P2 write=P3"),
+ /* 160 */ "VBegin" OpHelp(""),
+ /* 161 */ "VCreate" OpHelp(""),
+ /* 162 */ "VDestroy" OpHelp(""),
+ /* 163 */ "VOpen" OpHelp(""),
+ /* 164 */ "VColumn" OpHelp("r[P3]=vcolumn(P2)"),
+ /* 165 */ "VRename" OpHelp(""),
+ /* 166 */ "Pagecount" OpHelp(""),
+ /* 167 */ "MaxPgcnt" OpHelp(""),
+ /* 168 */ "Trace" OpHelp(""),
+ /* 169 */ "CursorHint" OpHelp(""),
+ /* 170 */ "Noop" OpHelp(""),
+ /* 171 */ "Explain" OpHelp(""),
+ /* 172 */ "Abortable" OpHelp(""),
};
return azName[i];
}
@@ -46577,7 +46638,8 @@ typedef struct MemFile MemFile;
struct MemFile {
sqlite3_file base; /* IO methods */
sqlite3_int64 sz; /* Size of the file */
- sqlite3_int64 szMax; /* Space allocated to aData */
+ sqlite3_int64 szAlloc; /* Space allocated to aData */
+ sqlite3_int64 szMax; /* Maximum allowed size of the file */
unsigned char *aData; /* content of the file */
int nMmap; /* Number of memory mapped pages */
unsigned mFlags; /* Flags */
@@ -46703,10 +46765,15 @@ static int memdbEnlarge(MemFile *p, sqlite3_int64 newSz){
if( (p->mFlags & SQLITE_DESERIALIZE_RESIZEABLE)==0 || p->nMmap>0 ){
return SQLITE_FULL;
}
+ if( newSz>p->szMax ){
+ return SQLITE_FULL;
+ }
+ newSz *= 2;
+ if( newSz>p->szMax ) newSz = p->szMax;
pNew = sqlite3_realloc64(p->aData, newSz);
if( pNew==0 ) return SQLITE_NOMEM;
p->aData = pNew;
- p->szMax = newSz;
+ p->szAlloc = newSz;
return SQLITE_OK;
}
@@ -46720,10 +46787,11 @@ static int memdbWrite(
sqlite_int64 iOfst
){
MemFile *p = (MemFile *)pFile;
+ if( NEVER(p->mFlags & SQLITE_DESERIALIZE_READONLY) ) return SQLITE_READONLY;
if( iOfst+iAmt>p->sz ){
int rc;
- if( iOfst+iAmt>p->szMax
- && (rc = memdbEnlarge(p, (iOfst+iAmt)*2))!=SQLITE_OK
+ if( iOfst+iAmt>p->szAlloc
+ && (rc = memdbEnlarge(p, iOfst+iAmt))!=SQLITE_OK
){
return rc;
}
@@ -46769,6 +46837,11 @@ static int memdbFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){
*/
static int memdbLock(sqlite3_file *pFile, int eLock){
MemFile *p = (MemFile *)pFile;
+ if( eLock>SQLITE_LOCK_SHARED
+ && (p->mFlags & SQLITE_DESERIALIZE_READONLY)!=0
+ ){
+ return SQLITE_READONLY;
+ }
p->eLock = eLock;
return SQLITE_OK;
}
@@ -46793,6 +46866,19 @@ static int memdbFileControl(sqlite3_file *pFile, int op, void *pArg){
*(char**)pArg = sqlite3_mprintf("memdb(%p,%lld)", p->aData, p->sz);
rc = SQLITE_OK;
}
+ if( op==SQLITE_FCNTL_SIZE_LIMIT ){
+ sqlite3_int64 iLimit = *(sqlite3_int64*)pArg;
+ if( iLimit<p->sz ){
+ if( iLimit<0 ){
+ iLimit = p->szMax;
+ }else{
+ iLimit = p->sz;
+ }
+ }
+ p->szMax = iLimit;
+ *(sqlite3_int64*)pArg = iLimit;
+ rc = SQLITE_OK;
+ }
return rc;
}
@@ -46823,8 +46909,12 @@ static int memdbFetch(
void **pp
){
MemFile *p = (MemFile *)pFile;
- p->nMmap++;
- *pp = (void*)(p->aData + iOfst);
+ if( iOfst+iAmt>p->sz ){
+ *pp = 0;
+ }else{
+ p->nMmap++;
+ *pp = (void*)(p->aData + iOfst);
+ }
return SQLITE_OK;
}
@@ -46854,6 +46944,7 @@ static int memdbOpen(
assert( pOutFlags!=0 ); /* True because flags==SQLITE_OPEN_MAIN_DB */
*pOutFlags = flags | SQLITE_OPEN_MEMORY;
p->base.pMethods = &memdb_io_methods;
+ p->szMax = sqlite3GlobalConfig.mxMemdbSize;
return SQLITE_OK;
}
@@ -47103,7 +47194,11 @@ SQLITE_API int sqlite3_deserialize(
}else{
p->aData = pData;
p->sz = szDb;
+ p->szAlloc = szBuf;
p->szMax = szBuf;
+ if( p->szMax<sqlite3GlobalConfig.mxMemdbSize ){
+ p->szMax = sqlite3GlobalConfig.mxMemdbSize;
+ }
p->mFlags = mFlags;
rc = SQLITE_OK;
}
@@ -48524,16 +48619,27 @@ typedef struct PGroup PGroup;
** structure. Unless SQLITE_PCACHE_SEPARATE_HEADER is defined, a buffer of
** PgHdr1.pCache->szPage bytes is allocated directly before this structure
** in memory.
+**
+** Note: Variables isBulkLocal and isAnchor were once type "u8". That works,
+** but causes a 2-byte gap in the structure for most architectures (since
+** pointers must be either 4 or 8-byte aligned). As this structure is located
+** in memory directly after the associated page data, if the database is
+** corrupt, code at the b-tree layer may overread the page buffer and
+** read part of this structure before the corruption is detected. This
+** can cause a valgrind error if the unitialized gap is accessed. Using u16
+** ensures there is no such gap, and therefore no bytes of unitialized memory
+** in the structure.
*/
struct PgHdr1 {
sqlite3_pcache_page page; /* Base class. Must be first. pBuf & pExtra */
unsigned int iKey; /* Key value (page number) */
- u8 isBulkLocal; /* This page from bulk local storage */
- u8 isAnchor; /* This is the PGroup.lru element */
+ u16 isBulkLocal; /* This page from bulk local storage */
+ u16 isAnchor; /* This is the PGroup.lru element */
PgHdr1 *pNext; /* Next in hash table chain */
PCache1 *pCache; /* Cache that currently owns this page */
PgHdr1 *pLruNext; /* Next in LRU list of unpinned pages */
PgHdr1 *pLruPrev; /* Previous in LRU list of unpinned pages */
+ /* NB: pLruPrev is only valid if pLruNext!=0 */
};
/*
@@ -48599,6 +48705,7 @@ struct PCache1 {
unsigned int nMax; /* Configured "cache_size" value */
unsigned int n90pct; /* nMax*9/10 */
unsigned int iMaxKey; /* Largest key seen since xTruncate() */
+ unsigned int nPurgeableDummy; /* pnPurgeable points here when not used*/
/* Hash table of all pages. The following variables may only be accessed
** when the accessor is holding the PGroup mutex.
@@ -48733,6 +48840,7 @@ static int pcache1InitBulk(PCache1 *pCache){
pX->isBulkLocal = 1;
pX->isAnchor = 0;
pX->pNext = pCache->pFree;
+ pX->pLruPrev = 0; /* Initializing this saves a valgrind error */
pCache->pFree = pX;
zBulk += pCache->szAlloc;
}while( --nBulk );
@@ -48908,6 +49016,9 @@ static void pcache1FreePage(PgHdr1 *p){
** exists, this function falls back to sqlite3Malloc().
*/
SQLITE_PRIVATE void *sqlite3PageMalloc(int sz){
+ /* During rebalance operations on a corrupt database file, it is sometimes
+ ** (rarely) possible to overread the temporary page buffer by a few bytes.
+ ** Enlarge the allocation slightly so that this does not cause problems. */
return pcache1Alloc(sz);
}
@@ -49002,7 +49113,8 @@ static PgHdr1 *pcache1PinPage(PgHdr1 *pPage){
pPage->pLruPrev->pLruNext = pPage->pLruNext;
pPage->pLruNext->pLruPrev = pPage->pLruPrev;
pPage->pLruNext = 0;
- pPage->pLruPrev = 0;
+ /* pPage->pLruPrev = 0;
+ ** No need to clear pLruPrev as it is never accessed if pLruNext is 0 */
assert( pPage->isAnchor==0 );
assert( pPage->pCache->pGroup->lru.isAnchor==1 );
pPage->pCache->nRecyclable--;
@@ -49212,8 +49324,7 @@ static sqlite3_pcache *pcache1Create(int szPage, int szExtra, int bPurgeable){
pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
pCache->pnPurgeable = &pGroup->nPurgeable;
}else{
- static unsigned int dummyCurrentPage;
- pCache->pnPurgeable = &dummyCurrentPage;
+ pCache->pnPurgeable = &pCache->nPurgeableDummy;
}
pcache1LeaveMutex(pGroup);
if( pCache->nHash==0 ){
@@ -49340,8 +49451,9 @@ static SQLITE_NOINLINE PgHdr1 *pcache1FetchStage2(
pPage->iKey = iKey;
pPage->pNext = pCache->apHash[h];
pPage->pCache = pCache;
- pPage->pLruPrev = 0;
pPage->pLruNext = 0;
+ /* pPage->pLruPrev = 0;
+ ** No need to clear pLruPrev since it is not accessed when pLruNext==0 */
*(void **)pPage->page.pExtra = 0;
pCache->apHash[h] = pPage;
if( iKey>pCache->iMaxKey ){
@@ -49501,7 +49613,7 @@ static void pcache1Unpin(
/* It is an error to call this function if the page is already
** part of the PGroup LRU list.
*/
- assert( pPage->pLruPrev==0 && pPage->pLruNext==0 );
+ assert( pPage->pLruNext==0 );
assert( PAGE_IS_PINNED(pPage) );
if( reuseUnlikely || pGroup->nPurgeable>pGroup->nMaxPage ){
@@ -54192,7 +54304,10 @@ SQLITE_PRIVATE int sqlite3PagerMaxPageCount(Pager *pPager, int mxPage){
pPager->mxPgno = mxPage;
}
assert( pPager->eState!=PAGER_OPEN ); /* Called only by OP_MaxPgcnt */
- assert( pPager->mxPgno>=pPager->dbSize ); /* OP_MaxPgcnt enforces this */
+ /* assert( pPager->mxPgno>=pPager->dbSize ); */
+ /* OP_MaxPgcnt ensures that the parameter passed to this function is not
+ ** less than the total number of valid pages in the database. But this
+ ** may be less than Pager.dbSize, and so the assert() above is not valid */
return pPager->mxPgno;
}
@@ -62431,9 +62546,16 @@ struct CellInfo {
** found at self->pBt->mutex.
**
** skipNext meaning:
-** eState==SKIPNEXT && skipNext>0: Next sqlite3BtreeNext() is no-op.
-** eState==SKIPNEXT && skipNext<0: Next sqlite3BtreePrevious() is no-op.
-** eState==FAULT: Cursor fault with skipNext as error code.
+** The meaning of skipNext depends on the value of eState:
+**
+** eState Meaning of skipNext
+** VALID skipNext is meaningless and is ignored
+** INVALID skipNext is meaningless and is ignored
+** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and
+** sqlite3BtreePrevious() is no-op if skipNext<0.
+** REQUIRESEEK restoreCursorPosition() restores the cursor to
+** eState=SKIPNEXT if skipNext!=0
+** FAULT skipNext holds the cursor fault error code.
*/
struct BtCursor {
u8 eState; /* One of the CURSOR_XXX constants (see below) */
@@ -63597,13 +63719,19 @@ static int saveCursorKey(BtCursor *pCur){
/* Only the rowid is required for a table btree */
pCur->nKey = sqlite3BtreeIntegerKey(pCur);
}else{
- /* For an index btree, save the complete key content */
+ /* For an index btree, save the complete key content. It is possible
+ ** that the current key is corrupt. In that case, it is possible that
+ ** the sqlite3VdbeRecordUnpack() function may overread the buffer by
+ ** up to the size of 1 varint plus 1 8-byte value when the cursor
+ ** position is restored. Hence the 17 bytes of padding allocated
+ ** below. */
void *pKey;
pCur->nKey = sqlite3BtreePayloadSize(pCur);
- pKey = sqlite3Malloc( pCur->nKey );
+ pKey = sqlite3Malloc( pCur->nKey + 9 + 8 );
if( pKey ){
rc = sqlite3BtreePayload(pCur, 0, (int)pCur->nKey, pKey);
if( rc==SQLITE_OK ){
+ memset(((u8*)pKey)+pCur->nKey, 0, 9+8);
pCur->pKey = pKey;
}else{
sqlite3_free(pKey);
@@ -63735,11 +63863,12 @@ static int btreeMoveto(
UnpackedRecord *pIdxKey; /* Unpacked index key */
if( pKey ){
+ KeyInfo *pKeyInfo = pCur->pKeyInfo;
assert( nKey==(i64)(int)nKey );
- pIdxKey = sqlite3VdbeAllocUnpackedRecord(pCur->pKeyInfo);
+ pIdxKey = sqlite3VdbeAllocUnpackedRecord(pKeyInfo);
if( pIdxKey==0 ) return SQLITE_NOMEM_BKPT;
- sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, pIdxKey);
- if( pIdxKey->nField==0 ){
+ sqlite3VdbeRecordUnpack(pKeyInfo, (int)nKey, pKey, pIdxKey);
+ if( pIdxKey->nField==0 || pIdxKey->nField>pKeyInfo->nAllField ){
rc = SQLITE_CORRUPT_BKPT;
goto moveto_done;
}
@@ -63775,7 +63904,7 @@ static int btreeRestoreCursorPosition(BtCursor *pCur){
sqlite3_free(pCur->pKey);
pCur->pKey = 0;
assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_INVALID );
- pCur->skipNext |= skipNext;
+ if( skipNext ) pCur->skipNext = skipNext;
if( pCur->skipNext && pCur->eState==CURSOR_VALID ){
pCur->eState = CURSOR_SKIPNEXT;
}
@@ -63845,7 +63974,6 @@ SQLITE_PRIVATE int sqlite3BtreeCursorRestore(BtCursor *pCur, int *pDifferentRow)
if( pCur->eState!=CURSOR_VALID ){
*pDifferentRow = 1;
}else{
- assert( pCur->skipNext==0 );
*pDifferentRow = 0;
}
return SQLITE_OK;
@@ -63929,6 +64057,13 @@ static void ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent, int *pRC){
*pRC = rc;
return;
}
+ if( ((char*)sqlite3PagerGetExtra(pDbPage))[0]!=0 ){
+ /* The first byte of the extra data is the MemPage.isInit byte.
+ ** If that byte is set, it means this page is also being used
+ ** as a btree page. */
+ *pRC = SQLITE_CORRUPT_BKPT;
+ goto ptrmap_exit;
+ }
offset = PTRMAP_PTROFFSET(iPtrmap, key);
if( offset<0 ){
*pRC = SQLITE_CORRUPT_BKPT;
@@ -63991,7 +64126,7 @@ static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){
#else /* if defined SQLITE_OMIT_AUTOVACUUM */
#define ptrmapPut(w,x,y,z,rc)
#define ptrmapGet(w,x,y,z) SQLITE_OK
- #define ptrmapPutOvflPtr(x, y, rc)
+ #define ptrmapPutOvflPtr(x, y, z, rc)
#endif
/*
@@ -64284,17 +64419,24 @@ static u16 cellSize(MemPage *pPage, int iCell){
#ifndef SQLITE_OMIT_AUTOVACUUM
/*
-** If the cell pCell, part of page pPage contains a pointer
-** to an overflow page, insert an entry into the pointer-map
-** for the overflow page.
+** The cell pCell is currently part of page pSrc but will ultimately be part
+** of pPage. (pSrc and pPager are often the same.) If pCell contains a
+** pointer to an overflow page, insert an entry into the pointer-map for
+** the overflow page that will be valid after pCell has been moved to pPage.
*/
-static void ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell, int *pRC){
+static void ptrmapPutOvflPtr(MemPage *pPage, MemPage *pSrc, u8 *pCell,int *pRC){
CellInfo info;
if( *pRC ) return;
assert( pCell!=0 );
pPage->xParseCell(pPage, pCell, &info);
if( info.nLocal<info.nPayload ){
- Pgno ovfl = get4byte(&pCell[info.nSize-4]);
+ Pgno ovfl;
+ if( SQLITE_WITHIN(pSrc->aDataEnd, pCell, pCell+info.nLocal) ){
+ testcase( pSrc!=pPage );
+ *pRC = SQLITE_CORRUPT_BKPT;
+ return;
+ }
+ ovfl = get4byte(&pCell[info.nSize-4]);
ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno, pRC);
}
}
@@ -64349,19 +64491,14 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){
** reconstruct the entire page. */
if( (int)data[hdr+7]<=nMaxFrag ){
int iFree = get2byte(&data[hdr+1]);
+
+ /* If the initial freeblock offset were out of bounds, that would
+ ** have been detected by btreeInitPage() when it was computing the
+ ** number of free bytes on the page. */
+ assert( iFree<=usableSize-4 );
if( iFree ){
int iFree2 = get2byte(&data[iFree]);
-
- /* pageFindSlot() has already verified that free blocks are sorted
- ** in order of offset within the page, and that no block extends
- ** past the end of the page. Provided the two free slots do not
- ** overlap, this guarantees that the memmove() calls below will not
- ** overwrite the usableSize byte buffer, even if the database page
- ** is corrupt. */
- assert( iFree2==0 || iFree2>iFree );
- assert( iFree+get2byte(&data[iFree+2]) <= usableSize );
- assert( iFree2==0 || iFree2+get2byte(&data[iFree2+2]) <= usableSize );
-
+ if( iFree2>usableSize-4 ) return SQLITE_CORRUPT_PAGE(pPage);
if( 0==iFree2 || (data[iFree2]==0 && data[iFree2+1]==0) ){
u8 *pEnd = &data[cellOffset + nCell*2];
u8 *pAddr;
@@ -64372,9 +64509,9 @@ static int defragmentPage(MemPage *pPage, int nMaxFrag){
return SQLITE_CORRUPT_PAGE(pPage);
}
if( iFree2 ){
- assert( iFree+sz<=iFree2 ); /* Verified by pageFindSlot() */
+ if( iFree+sz>iFree2 ) return SQLITE_CORRUPT_PAGE(pPage);
sz2 = get2byte(&data[iFree2+2]);
- assert( iFree+sz+sz2+iFree2-(iFree+sz) <= usableSize );
+ if( iFree2+sz2 > usableSize ) return SQLITE_CORRUPT_PAGE(pPage);
memmove(&data[iFree+sz+sz2], &data[iFree+sz], iFree2-(iFree+sz));
sz += sz2;
}
@@ -65929,9 +66066,9 @@ static int newDatabase(BtShared*);
static int lockBtree(BtShared *pBt){
int rc; /* Result code from subfunctions */
MemPage *pPage1; /* Page 1 of the database file */
- int nPage; /* Number of pages in the database */
- int nPageFile = 0; /* Number of pages in the database file */
- int nPageHeader; /* Number of pages in the database according to hdr */
+ u32 nPage; /* Number of pages in the database */
+ u32 nPageFile = 0; /* Number of pages in the database file */
+ u32 nPageHeader; /* Number of pages in the database according to hdr */
assert( sqlite3_mutex_held(pBt->mutex) );
assert( pBt->pPage1==0 );
@@ -65944,7 +66081,7 @@ static int lockBtree(BtShared *pBt){
** a valid database file.
*/
nPage = nPageHeader = get4byte(28+(u8*)pPage1->aData);
- sqlite3PagerPagecount(pBt->pPager, &nPageFile);
+ sqlite3PagerPagecount(pBt->pPager, (int*)&nPageFile);
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){
nPage = nPageFile;
}
@@ -66025,6 +66162,7 @@ static int lockBtree(BtShared *pBt){
){
goto page1_init_failed;
}
+ pBt->btsFlags |= BTS_PAGESIZE_FIXED;
assert( (pageSize & 7)==0 );
/* EVIDENCE-OF: R-59310-51205 The "reserved space" size in the 1-byte
** integer at offset 20 is the number of bytes of space at the end of
@@ -66415,7 +66553,7 @@ static int setChildPtrmaps(MemPage *pPage){
for(i=0; i<nCell; i++){
u8 *pCell = findCell(pPage, i);
- ptrmapPutOvflPtr(pPage, pCell, &rc);
+ ptrmapPutOvflPtr(pPage, pPage, pCell, &rc);
if( !pPage->leaf ){
Pgno childPgno = get4byte(pCell);
@@ -67341,6 +67479,7 @@ SQLITE_PRIVATE int sqlite3BtreeCloseCursor(BtCursor *pCur){
sqlite3_free(pCur->aOverflow);
sqlite3_free(pCur->pKey);
sqlite3BtreeLeave(pBtree);
+ pCur->pBtree = 0;
}
return SQLITE_OK;
}
@@ -67440,6 +67579,25 @@ SQLITE_PRIVATE u32 sqlite3BtreePayloadSize(BtCursor *pCur){
}
/*
+** Return an upper bound on the size of any record for the table
+** that the cursor is pointing into.
+**
+** This is an optimization. Everything will still work if this
+** routine always returns 2147483647 (which is the largest record
+** that SQLite can handle) or more. But returning a smaller value might
+** prevent large memory allocations when trying to interpret a
+** corrupt datrabase.
+**
+** The current implementation merely returns the size of the underlying
+** database file.
+*/
+SQLITE_PRIVATE sqlite3_int64 sqlite3BtreeMaxRecordSize(BtCursor *pCur){
+ assert( cursorHoldsMutex(pCur) );
+ assert( pCur->eState==CURSOR_VALID );
+ return pCur->pBt->pageSize * (sqlite3_int64)pCur->pBt->nPage;
+}
+
+/*
** Given the page number of an overflow page in the database (parameter
** ovfl), this function finds the page number of the next page in the
** linked list of overflow pages. If possible, it uses the auto-vacuum
@@ -68253,7 +68411,7 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked(
** try to get there using sqlite3BtreeNext() rather than a full
** binary search. This is an optimization only. The correct answer
** is still obtained without this case, only a little more slowely */
- if( pCur->info.nKey+1==intKey && !pCur->skipNext ){
+ if( pCur->info.nKey+1==intKey ){
*pRes = 0;
rc = sqlite3BtreeNext(pCur, 0);
if( rc==SQLITE_OK ){
@@ -68395,7 +68553,7 @@ SQLITE_PRIVATE int sqlite3BtreeMovetoUnpacked(
testcase( nCell==0 ); /* Invalid key size: 0x80 0x80 0x00 */
testcase( nCell==1 ); /* Invalid key size: 0x80 0x80 0x01 */
testcase( nCell==2 ); /* Minimum legal index key size */
- if( nCell<2 ){
+ if( nCell<2 || nCell/pCur->pBt->usableSize>pCur->pBt->nPage ){
rc = SQLITE_CORRUPT_PAGE(pPage);
goto moveto_finish;
}
@@ -68527,7 +68685,6 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){
MemPage *pPage;
assert( cursorOwnsBtShared(pCur) );
- assert( pCur->skipNext==0 || pCur->eState!=CURSOR_VALID );
if( pCur->eState!=CURSOR_VALID ){
assert( (pCur->curFlags & BTCF_ValidOvfl)==0 );
rc = restoreCursorPosition(pCur);
@@ -68537,14 +68694,9 @@ static SQLITE_NOINLINE int btreeNext(BtCursor *pCur){
if( CURSOR_INVALID==pCur->eState ){
return SQLITE_DONE;
}
- if( pCur->skipNext ){
- assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_SKIPNEXT );
+ if( pCur->eState==CURSOR_SKIPNEXT ){
pCur->eState = CURSOR_VALID;
- if( pCur->skipNext>0 ){
- pCur->skipNext = 0;
- return SQLITE_OK;
- }
- pCur->skipNext = 0;
+ if( pCur->skipNext>0 ) return SQLITE_OK;
}
}
@@ -68599,7 +68751,6 @@ SQLITE_PRIVATE int sqlite3BtreeNext(BtCursor *pCur, int flags){
UNUSED_PARAMETER( flags ); /* Used in COMDB2 but not native SQLite */
assert( cursorOwnsBtShared(pCur) );
assert( flags==0 || flags==1 );
- assert( pCur->skipNext==0 || pCur->eState!=CURSOR_VALID );
pCur->info.nSize = 0;
pCur->curFlags &= ~(BTCF_ValidNKey|BTCF_ValidOvfl);
if( pCur->eState!=CURSOR_VALID ) return btreeNext(pCur);
@@ -68640,7 +68791,6 @@ static SQLITE_NOINLINE int btreePrevious(BtCursor *pCur){
MemPage *pPage;
assert( cursorOwnsBtShared(pCur) );
- assert( pCur->skipNext==0 || pCur->eState!=CURSOR_VALID );
assert( (pCur->curFlags & (BTCF_AtLast|BTCF_ValidOvfl|BTCF_ValidNKey))==0 );
assert( pCur->info.nSize==0 );
if( pCur->eState!=CURSOR_VALID ){
@@ -68651,14 +68801,9 @@ static SQLITE_NOINLINE int btreePrevious(BtCursor *pCur){
if( CURSOR_INVALID==pCur->eState ){
return SQLITE_DONE;
}
- if( pCur->skipNext ){
- assert( pCur->eState==CURSOR_VALID || pCur->eState==CURSOR_SKIPNEXT );
+ if( CURSOR_SKIPNEXT==pCur->eState ){
pCur->eState = CURSOR_VALID;
- if( pCur->skipNext<0 ){
- pCur->skipNext = 0;
- return SQLITE_OK;
- }
- pCur->skipNext = 0;
+ if( pCur->skipNext<0 ) return SQLITE_OK;
}
}
@@ -68693,7 +68838,6 @@ static SQLITE_NOINLINE int btreePrevious(BtCursor *pCur){
SQLITE_PRIVATE int sqlite3BtreePrevious(BtCursor *pCur, int flags){
assert( cursorOwnsBtShared(pCur) );
assert( flags==0 || flags==1 );
- assert( pCur->skipNext==0 || pCur->eState!=CURSOR_VALID );
UNUSED_PARAMETER( flags ); /* Used in COMDB2 but not native SQLite */
pCur->curFlags &= ~(BTCF_AtLast|BTCF_ValidOvfl|BTCF_ValidNKey);
pCur->info.nSize = 0;
@@ -69029,7 +69173,7 @@ static int allocateBtreePage(
TRACE(("ALLOCATE: %d from end of file\n", *pPgno));
}
- assert( *pPgno!=PENDING_BYTE_PAGE(pBt) );
+ assert( CORRUPT_DB || *pPgno!=PENDING_BYTE_PAGE(pBt) );
end_allocate_page:
releasePage(pTrunk);
@@ -69584,9 +69728,16 @@ static void insertCell(
assert( idx >= pPage->cellOffset+2*pPage->nCell+2 || CORRUPT_DB );
assert( idx+sz <= (int)pPage->pBt->usableSize );
pPage->nFree -= (u16)(2 + sz);
- memcpy(&data[idx], pCell, sz);
if( iChild ){
+ /* In a corrupt database where an entry in the cell index section of
+ ** a btree page has a value of 3 or less, the pCell value might point
+ ** as many as 4 bytes in front of the start of the aData buffer for
+ ** the source page. Make sure this does not cause problems by not
+ ** reading the first 4 bytes */
+ memcpy(&data[idx+4], pCell+4, sz-4);
put4byte(&data[idx], iChild);
+ }else{
+ memcpy(&data[idx], pCell, sz);
}
pIns = pPage->aCellIdx + i*2;
memmove(pIns+2, pIns, 2*(pPage->nCell - i));
@@ -69600,15 +69751,89 @@ static void insertCell(
/* The cell may contain a pointer to an overflow page. If so, write
** the entry for the overflow page into the pointer map.
*/
- ptrmapPutOvflPtr(pPage, pCell, pRC);
+ ptrmapPutOvflPtr(pPage, pPage, pCell, pRC);
}
#endif
}
}
/*
+** The following parameters determine how many adjacent pages get involved
+** in a balancing operation. NN is the number of neighbors on either side
+** of the page that participate in the balancing operation. NB is the
+** total number of pages that participate, including the target page and
+** NN neighbors on either side.
+**
+** The minimum value of NN is 1 (of course). Increasing NN above 1
+** (to 2 or 3) gives a modest improvement in SELECT and DELETE performance
+** in exchange for a larger degradation in INSERT and UPDATE performance.
+** The value of NN appears to give the best results overall.
+**
+** (Later:) The description above makes it seem as if these values are
+** tunable - as if you could change them and recompile and it would all work.
+** But that is unlikely. NB has been 3 since the inception of SQLite and
+** we have never tested any other value.
+*/
+#define NN 1 /* Number of neighbors on either side of pPage */
+#define NB 3 /* (NN*2+1): Total pages involved in the balance */
+
+/*
** A CellArray object contains a cache of pointers and sizes for a
** consecutive sequence of cells that might be held on multiple pages.
+**
+** The cells in this array are the divider cell or cells from the pParent
+** page plus up to three child pages. There are a total of nCell cells.
+**
+** pRef is a pointer to one of the pages that contributes cells. This is
+** used to access information such as MemPage.intKey and MemPage.pBt->pageSize
+** which should be common to all pages that contribute cells to this array.
+**
+** apCell[] and szCell[] hold, respectively, pointers to the start of each
+** cell and the size of each cell. Some of the apCell[] pointers might refer
+** to overflow cells. In other words, some apCel[] pointers might not point
+** to content area of the pages.
+**
+** A szCell[] of zero means the size of that cell has not yet been computed.
+**
+** The cells come from as many as four different pages:
+**
+** -----------
+** | Parent |
+** -----------
+** / | \
+** / | \
+** --------- --------- ---------
+** |Child-1| |Child-2| |Child-3|
+** --------- --------- ---------
+**
+** The order of cells is in the array is for an index btree is:
+**
+** 1. All cells from Child-1 in order
+** 2. The first divider cell from Parent
+** 3. All cells from Child-2 in order
+** 4. The second divider cell from Parent
+** 5. All cells from Child-3 in order
+**
+** For a table-btree (with rowids) the items 2 and 4 are empty because
+** content exists only in leaves and there are no divider cells.
+**
+** For an index btree, the apEnd[] array holds pointer to the end of page
+** for Child-1, the Parent, Child-2, the Parent (again), and Child-3,
+** respectively. The ixNx[] array holds the number of cells contained in
+** each of these 5 stages, and all stages to the left. Hence:
+**
+** ixNx[0] = Number of cells in Child-1.
+** ixNx[1] = Number of cells in Child-1 plus 1 for first divider.
+** ixNx[2] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
+** ixNx[3] = Number of cells in Child-1 and Child-2 + both divider cells
+** ixNx[4] = Total number of cells.
+**
+** For a table-btree, the concept is similar, except only apEnd[0]..apEnd[2]
+** are used and they point to the leaf pages only, and the ixNx value are:
+**
+** ixNx[0] = Number of cells in Child-1.
+** ixNx[1] = Number of cells in Child-1 and Child-2 + 1 for 1st divider.
+** ixNx[2] = Number of cells in Child-1 and Child-2 + both divider cells
*/
typedef struct CellArray CellArray;
struct CellArray {
@@ -69616,6 +69841,8 @@ struct CellArray {
MemPage *pRef; /* Reference page */
u8 **apCell; /* All cells begin balanced */
u16 *szCell; /* Local size of all cells in apCell[] */
+ u8 *apEnd[NB*2]; /* MemPage.aDataEnd values */
+ int ixNx[NB*2]; /* Index of at which we move to the next apEnd[] */
};
/*
@@ -69666,36 +69893,59 @@ static u16 cachedCellSize(CellArray *p, int N){
** responsibility of the caller to set it correctly.
*/
static int rebuildPage(
- MemPage *pPg, /* Edit this page */
+ CellArray *pCArray, /* Content to be added to page pPg */
+ int iFirst, /* First cell in pCArray to use */
int nCell, /* Final number of cells on page */
- u8 **apCell, /* Array of cells */
- u16 *szCell /* Array of cell sizes */
+ MemPage *pPg /* The page to be reconstructed */
){
const int hdr = pPg->hdrOffset; /* Offset of header on pPg */
u8 * const aData = pPg->aData; /* Pointer to data for pPg */
const int usableSize = pPg->pBt->usableSize;
u8 * const pEnd = &aData[usableSize];
- int i;
+ int i = iFirst; /* Which cell to copy from pCArray*/
+ u32 j; /* Start of cell content area */
+ int iEnd = i+nCell; /* Loop terminator */
u8 *pCellptr = pPg->aCellIdx;
u8 *pTmp = sqlite3PagerTempSpace(pPg->pBt->pPager);
u8 *pData;
+ int k; /* Current slot in pCArray->apEnd[] */
+ u8 *pSrcEnd; /* Current pCArray->apEnd[k] value */
- i = get2byte(&aData[hdr+5]);
- memcpy(&pTmp[i], &aData[i], usableSize - i);
+ assert( i<iEnd );
+ j = get2byte(&aData[hdr+5]);
+ if( NEVER(j>(u32)usableSize) ){ j = 0; }
+ memcpy(&pTmp[j], &aData[j], usableSize - j);
+
+ for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
+ pSrcEnd = pCArray->apEnd[k];
pData = pEnd;
- for(i=0; i<nCell; i++){
- u8 *pCell = apCell[i];
+ while( 1/*exit by break*/ ){
+ u8 *pCell = pCArray->apCell[i];
+ u16 sz = pCArray->szCell[i];
+ assert( sz>0 );
if( SQLITE_WITHIN(pCell,aData,pEnd) ){
+ if( ((uptr)(pCell+sz))>(uptr)pEnd ) return SQLITE_CORRUPT_BKPT;
pCell = &pTmp[pCell - aData];
+ }else if( (uptr)(pCell+sz)>(uptr)pSrcEnd
+ && (uptr)(pCell)<(uptr)pSrcEnd
+ ){
+ return SQLITE_CORRUPT_BKPT;
}
- pData -= szCell[i];
+
+ pData -= sz;
put2byte(pCellptr, (pData - aData));
pCellptr += 2;
if( pData < pCellptr ) return SQLITE_CORRUPT_BKPT;
- memcpy(pData, pCell, szCell[i]);
- assert( szCell[i]==pPg->xCellSize(pPg, pCell) || CORRUPT_DB );
- testcase( szCell[i]!=pPg->xCellSize(pPg,pCell) );
+ memcpy(pData, pCell, sz);
+ assert( sz==pPg->xCellSize(pPg, pCell) || CORRUPT_DB );
+ testcase( sz!=pPg->xCellSize(pPg,pCell) );
+ i++;
+ if( i>=iEnd ) break;
+ if( pCArray->ixNx[k]<=i ){
+ k++;
+ pSrcEnd = pCArray->apEnd[k];
+ }
}
/* The pPg->nFree field is now set incorrectly. The caller will fix it. */
@@ -69710,12 +69960,11 @@ static int rebuildPage(
}
/*
-** Array apCell[] contains nCell pointers to b-tree cells. Array szCell
-** contains the size in bytes of each such cell. This function attempts to
-** add the cells stored in the array to page pPg. If it cannot (because
-** the page needs to be defragmented before the cells will fit), non-zero
-** is returned. Otherwise, if the cells are added successfully, zero is
-** returned.
+** The pCArray objects contains pointers to b-tree cells and the cell sizes.
+** This function attempts to add the cells stored in the array to page pPg.
+** If it cannot (because the page needs to be defragmented before the cells
+** will fit), non-zero is returned. Otherwise, if the cells are added
+** successfully, zero is returned.
**
** Argument pCellptr points to the first entry in the cell-pointer array
** (part of page pPg) to populate. After cell apCell[0] is written to the
@@ -69737,18 +69986,23 @@ static int rebuildPage(
static int pageInsertArray(
MemPage *pPg, /* Page to add cells to */
u8 *pBegin, /* End of cell-pointer array */
- u8 **ppData, /* IN/OUT: Page content -area pointer */
+ u8 **ppData, /* IN/OUT: Page content-area pointer */
u8 *pCellptr, /* Pointer to cell-pointer area */
int iFirst, /* Index of first cell to add */
int nCell, /* Number of cells to add to pPg */
CellArray *pCArray /* Array of cells */
){
- int i;
- u8 *aData = pPg->aData;
- u8 *pData = *ppData;
- int iEnd = iFirst + nCell;
+ int i = iFirst; /* Loop counter - cell index to insert */
+ u8 *aData = pPg->aData; /* Complete page */
+ u8 *pData = *ppData; /* Content area. A subset of aData[] */
+ int iEnd = iFirst + nCell; /* End of loop. One past last cell to ins */
+ int k; /* Current slot in pCArray->apEnd[] */
+ u8 *pEnd; /* Maximum extent of cell data */
assert( CORRUPT_DB || pPg->hdrOffset==0 ); /* Never called on page 1 */
- for(i=iFirst; i<iEnd; i++){
+ if( iEnd<=iFirst ) return 0;
+ for(k=0; pCArray->ixNx[k]<=i && ALWAYS(k<NB*2); k++){}
+ pEnd = pCArray->apEnd[k];
+ while( 1 /*Exit by break*/ ){
int sz, rc;
u8 *pSlot;
sz = cachedCellSize(pCArray, i);
@@ -69763,20 +70017,33 @@ static int pageInsertArray(
assert( (pSlot+sz)<=pCArray->apCell[i]
|| pSlot>=(pCArray->apCell[i]+sz)
|| CORRUPT_DB );
+ if( (uptr)(pCArray->apCell[i]+sz)>(uptr)pEnd
+ && (uptr)(pCArray->apCell[i])<(uptr)pEnd
+ ){
+ assert( CORRUPT_DB );
+ (void)SQLITE_CORRUPT_BKPT;
+ return 1;
+ }
memmove(pSlot, pCArray->apCell[i], sz);
put2byte(pCellptr, (pSlot - aData));
pCellptr += 2;
+ i++;
+ if( i>=iEnd ) break;
+ if( pCArray->ixNx[k]<=i ){
+ k++;
+ pEnd = pCArray->apEnd[k];
+ }
}
*ppData = pData;
return 0;
}
/*
-** Array apCell[] contains nCell pointers to b-tree cells. Array szCell
-** contains the size in bytes of each such cell. This function adds the
-** space associated with each cell in the array that is currently stored
-** within the body of pPg to the pPg free-list. The cell-pointers and other
-** fields of the page are not updated.
+** The pCArray object contains pointers to b-tree cells and their sizes.
+**
+** This function adds the space associated with each cell in the array
+** that is currently stored within the body of pPg to the pPg free-list.
+** The cell-pointers and other fields of the page are not updated.
**
** This function returns the total number of cells added to the free-list.
*/
@@ -69826,9 +70093,9 @@ static int pageFreeArray(
}
/*
-** apCell[] and szCell[] contains pointers to and sizes of all cells in the
-** pages being balanced. The current page, pPg, has pPg->nCell cells starting
-** with apCell[iOld]. After balancing, this page should hold nNew cells
+** pCArray contains pointers to and sizes of all cells in the page being
+** balanced. The current page, pPg, has pPg->nCell cells starting with
+** pCArray->apCell[iOld]. After balancing, this page should hold nNew cells
** starting at apCell[iNew].
**
** This routine makes the necessary adjustments to pPg so that it contains
@@ -69860,13 +70127,17 @@ static int editPage(
#endif
/* Remove cells from the start and end of the page */
+ assert( nCell>=0 );
if( iOld<iNew ){
int nShift = pageFreeArray(pPg, iOld, iNew-iOld, pCArray);
+ if( nShift>nCell ) return SQLITE_CORRUPT_BKPT;
memmove(pPg->aCellIdx, &pPg->aCellIdx[nShift*2], nCell*2);
nCell -= nShift;
}
if( iNewEnd < iOldEnd ){
- nCell -= pageFreeArray(pPg, iNewEnd, iOldEnd - iNewEnd, pCArray);
+ int nTail = pageFreeArray(pPg, iNewEnd, iOldEnd - iNewEnd, pCArray);
+ assert( nCell>=nTail );
+ nCell -= nTail;
}
pData = &aData[get2byteNotZero(&aData[hdr+5])];
@@ -69876,6 +70147,7 @@ static int editPage(
if( iNew<iOld ){
int nAdd = MIN(nNew,iOld-iNew);
assert( (iOld-iNew)<nNew || nCell==0 || CORRUPT_DB );
+ assert( nAdd>=0 );
pCellptr = pPg->aCellIdx;
memmove(&pCellptr[nAdd*2], pCellptr, nCell*2);
if( pageInsertArray(
@@ -69890,6 +70162,7 @@ static int editPage(
int iCell = (iOld + pPg->aiOvfl[i]) - iNew;
if( iCell>=0 && iCell<nNew ){
pCellptr = &pPg->aCellIdx[iCell * 2];
+ assert( nCell>=iCell );
memmove(&pCellptr[2], pCellptr, (nCell - iCell) * 2);
nCell++;
if( pageInsertArray(
@@ -69900,6 +70173,7 @@ static int editPage(
}
/* Append cells to the end of the page */
+ assert( nCell>=0 );
pCellptr = &pPg->aCellIdx[nCell*2];
if( pageInsertArray(
pPg, pBegin, &pData, pCellptr,
@@ -69928,24 +70202,9 @@ static int editPage(
editpage_fail:
/* Unable to edit this page. Rebuild it from scratch instead. */
populateCellCache(pCArray, iNew, nNew);
- return rebuildPage(pPg, nNew, &pCArray->apCell[iNew], &pCArray->szCell[iNew]);
+ return rebuildPage(pCArray, iNew, nNew, pPg);
}
-/*
-** The following parameters determine how many adjacent pages get involved
-** in a balancing operation. NN is the number of neighbors on either side
-** of the page that participate in the balancing operation. NB is the
-** total number of pages that participate, including the target page and
-** NN neighbors on either side.
-**
-** The minimum value of NN is 1 (of course). Increasing NN above 1
-** (to 2 or 3) gives a modest improvement in SELECT and DELETE performance
-** in exchange for a larger degradation in INSERT and UPDATE performance.
-** The value of NN appears to give the best results overall.
-*/
-#define NN 1 /* Number of neighbors on either side of pPage */
-#define NB (NN*2+1) /* Total pages involved in the balance */
-
#ifndef SQLITE_OMIT_QUICKBALANCE
/*
@@ -69981,8 +70240,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){
assert( sqlite3PagerIswriteable(pParent->pDbPage) );
assert( pPage->nOverflow==1 );
- /* This error condition is now caught prior to reaching this function */
- if( NEVER(pPage->nCell==0) ) return SQLITE_CORRUPT_BKPT;
+ if( pPage->nCell==0 ) return SQLITE_CORRUPT_BKPT; /* dbfuzz001.test */
/* Allocate a new page. This page will become the right-sibling of
** pPage. Make the parent page writable, so that the new divider cell
@@ -69996,12 +70254,22 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){
u8 *pCell = pPage->apOvfl[0];
u16 szCell = pPage->xCellSize(pPage, pCell);
u8 *pStop;
+ CellArray b;
assert( sqlite3PagerIswriteable(pNew->pDbPage) );
- assert( pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) );
+ assert( CORRUPT_DB || pPage->aData[0]==(PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF) );
zeroPage(pNew, PTF_INTKEY|PTF_LEAFDATA|PTF_LEAF);
- rc = rebuildPage(pNew, 1, &pCell, &szCell);
- if( NEVER(rc) ) return rc;
+ b.nCell = 1;
+ b.pRef = pPage;
+ b.apCell = &pCell;
+ b.szCell = &szCell;
+ b.apEnd[0] = pPage->aDataEnd;
+ b.ixNx[0] = 2;
+ rc = rebuildPage(&b, 0, 1, pNew);
+ if( NEVER(rc) ){
+ releasePage(pNew);
+ return rc;
+ }
pNew->nFree = pBt->usableSize - pNew->cellOffset - 2 - szCell;
/* If this is an auto-vacuum database, update the pointer map
@@ -70016,7 +70284,7 @@ static int balance_quick(MemPage *pParent, MemPage *pPage, u8 *pSpace){
if( ISAUTOVACUUM ){
ptrmapPut(pBt, pgnoNew, PTRMAP_BTREE, pParent->pgno, &rc);
if( szCell>pNew->minLocal ){
- ptrmapPutOvflPtr(pNew, pCell, &rc);
+ ptrmapPutOvflPtr(pNew, pNew, pCell, &rc);
}
}
@@ -70239,10 +70507,6 @@ static int balance_nonroot(
assert( sqlite3_mutex_held(pBt->mutex) );
assert( sqlite3PagerIswriteable(pParent->pDbPage) );
-#if 0
- TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno));
-#endif
-
/* At this point pParent may have at most one overflow cell. And if
** this overflow cell is present, it must be the cell with
** index iParentIdx. This scenario comes about when this function
@@ -70483,8 +70747,15 @@ static int balance_nonroot(
**
*/
usableSpace = pBt->usableSize - 12 + leafCorrection;
- for(i=0; i<nOld; i++){
+ for(i=k=0; i<nOld; i++, k++){
MemPage *p = apOld[i];
+ b.apEnd[k] = p->aDataEnd;
+ b.ixNx[k] = cntOld[i];
+ if( !leafData ){
+ k++;
+ b.apEnd[k] = pParent->aDataEnd;
+ b.ixNx[k] = cntOld[i]+1;
+ }
szNew[i] = usableSpace - p->nFree;
for(j=0; j<p->nOverflow; j++){
szNew[i] += 2 + p->xCellSize(p, p->apOvfl[j]);
@@ -70708,7 +70979,8 @@ static int balance_nonroot(
** populated, not here.
*/
if( ISAUTOVACUUM ){
- MemPage *pNew = apNew[0];
+ MemPage *pOld;
+ MemPage *pNew = pOld = apNew[0];
u8 *aOld = pNew->aData;
int cntOldNext = pNew->nCell + pNew->nOverflow;
int usableSize = pBt->usableSize;
@@ -70718,7 +70990,7 @@ static int balance_nonroot(
for(i=0; i<b.nCell; i++){
u8 *pCell = b.apCell[i];
if( i==cntOldNext ){
- MemPage *pOld = (++iOld)<nNew ? apNew[iOld] : apOld[iOld];
+ pOld = (++iOld)<nNew ? apNew[iOld] : apOld[iOld];
cntOldNext += pOld->nCell + pOld->nOverflow + !leafData;
aOld = pOld->aData;
}
@@ -70741,7 +71013,7 @@ static int balance_nonroot(
ptrmapPut(pBt, get4byte(pCell), PTRMAP_BTREE, pNew->pgno, &rc);
}
if( cachedCellSize(&b,i)>pNew->minLocal ){
- ptrmapPutOvflPtr(pNew, pCell, &rc);
+ ptrmapPutOvflPtr(pNew, pOld, pCell, &rc);
}
if( rc ) goto balance_cleanup;
}
@@ -71165,7 +71437,11 @@ static int btreeOverwriteContent(
if( memcmp(pDest, ((u8*)pX->pData) + iOffset, iAmt)!=0 ){
int rc = sqlite3PagerWrite(pPage->pDbPage);
if( rc ) return rc;
- memcpy(pDest, ((u8*)pX->pData) + iOffset, iAmt);
+ /* In a corrupt database, it is possible for the source and destination
+ ** buffers to overlap. This is harmless since the database is already
+ ** corrupt but it does cause valgrind and ASAN warnings. So use
+ ** memmove(). */
+ memmove(pDest, ((u8*)pX->pData) + iOffset, iAmt);
}
}
return SQLITE_OK;
@@ -71560,6 +71836,7 @@ SQLITE_PRIVATE int sqlite3BtreeDelete(BtCursor *pCur, u8 flags){
if( bPreserve ){
if( !pPage->leaf
|| (pPage->nFree+cellSizePtr(pPage,pCell)+2)>(int)(pBt->usableSize*2/3)
+ || pPage->nCell==1 /* See dbfuzz001.test for a test case */
){
/* A b-tree rebalance will be required after deleting this entry.
** Save the cursor key. */
@@ -72338,18 +72615,18 @@ static void checkList(
}
pOvflData = (unsigned char *)sqlite3PagerGetData(pOvflPage);
if( isFreeList ){
- int n = get4byte(&pOvflData[4]);
+ u32 n = (u32)get4byte(&pOvflData[4]);
#ifndef SQLITE_OMIT_AUTOVACUUM
if( pCheck->pBt->autoVacuum ){
checkPtrmap(pCheck, iPage, PTRMAP_FREEPAGE, 0);
}
#endif
- if( n>(int)pCheck->pBt->usableSize/4-2 ){
+ if( n>pCheck->pBt->usableSize/4-2 ){
checkAppendMsg(pCheck,
"freelist leaf count too big on page %d", iPage);
N--;
}else{
- for(i=0; i<n; i++){
+ for(i=0; i<(int)n; i++){
Pgno iFreePage = get4byte(&pOvflData[8+i*4]);
#ifndef SQLITE_OMIT_AUTOVACUUM
if( pCheck->pBt->autoVacuum ){
@@ -72726,7 +73003,7 @@ SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
Pgno i;
IntegrityCk sCheck;
BtShared *pBt = p->pBt;
- int savedDbFlags = pBt->db->flags;
+ u64 savedDbFlags = pBt->db->flags;
char zErr[100];
VVA_ONLY( int nRef );
@@ -72793,7 +73070,7 @@ SQLITE_PRIVATE char *sqlite3BtreeIntegrityCheck(
}
#endif
testcase( pBt->db->flags & SQLITE_CellSizeCk );
- pBt->db->flags &= ~SQLITE_CellSizeCk;
+ pBt->db->flags &= ~(u64)SQLITE_CellSizeCk;
for(i=0; (int)i<nRoot && sCheck.mxErr; i++){
i64 notUsed;
if( aRoot[i]==0 ) continue;
@@ -74181,7 +74458,7 @@ SQLITE_PRIVATE SQLITE_NOINLINE int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPre
** if unable to complete the resizing.
*/
SQLITE_PRIVATE int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){
- assert( szNew>0 );
+ assert( CORRUPT_DB || szNew>0 );
assert( (pMem->flags & MEM_Dyn)==0 || pMem->szMalloc==0 );
if( pMem->szMalloc<szNew ){
return sqlite3VdbeMemGrow(pMem, szNew, 0);
@@ -75062,6 +75339,9 @@ static SQLITE_NOINLINE int vdbeMemFromBtreeResize(
){
int rc;
pMem->flags = MEM_Null;
+ if( sqlite3BtreeMaxRecordSize(pCur)<offset+amt ){
+ return SQLITE_CORRUPT_BKPT;
+ }
if( SQLITE_OK==(rc = sqlite3VdbeMemClearAndResize(pMem, amt+1)) ){
rc = sqlite3BtreePayload(pCur, offset, amt, pMem->z);
if( rc==SQLITE_OK ){
@@ -75468,9 +75748,11 @@ static int valueFromExpr(
}
#endif
else if( op==TK_TRUEFALSE ){
- pVal = valueNew(db, pCtx);
- pVal->flags = MEM_Int;
- pVal->u.i = pExpr->u.zToken[4]==0;
+ pVal = valueNew(db, pCtx);
+ if( pVal ){
+ pVal->flags = MEM_Int;
+ pVal->u.i = pExpr->u.zToken[4]==0;
+ }
}
*ppVal = pVal;
@@ -75863,7 +76145,7 @@ SQLITE_PRIVATE Vdbe *sqlite3VdbeCreate(Parse *pParse){
pParse->pVdbe = p;
assert( pParse->aLabel==0 );
assert( pParse->nLabel==0 );
- assert( pParse->nOpAlloc==0 );
+ assert( p->nOpAlloc==0 );
assert( pParse->szOpAlloc==0 );
sqlite3VdbeAddOp2(p, OP_Init, 0, 1);
return p;
@@ -75891,14 +76173,44 @@ SQLITE_PRIVATE void sqlite3VdbeSetSql(Vdbe *p, const char *z, int n, u8 prepFlag
}
assert( p->zSql==0 );
p->zSql = sqlite3DbStrNDup(p->db, z, n);
+}
+
#ifdef SQLITE_ENABLE_NORMALIZE
- assert( p->zNormSql==0 );
- if( p->zSql && (prepFlags & SQLITE_PREPARE_NORMALIZE)!=0 ){
- sqlite3Normalize(p, p->zSql, n, prepFlags);
- assert( p->zNormSql!=0 || p->db->mallocFailed );
+/*
+** Add a new element to the Vdbe->pDblStr list.
+*/
+SQLITE_PRIVATE void sqlite3VdbeAddDblquoteStr(sqlite3 *db, Vdbe *p, const char *z){
+ if( p ){
+ int n = sqlite3Strlen30(z);
+ DblquoteStr *pStr = sqlite3DbMallocRawNN(db,
+ sizeof(*pStr)+n+1-sizeof(pStr->z));
+ if( pStr ){
+ pStr->pNextStr = p->pDblStr;
+ p->pDblStr = pStr;
+ memcpy(pStr->z, z, n+1);
+ }
}
+}
#endif
+
+#ifdef SQLITE_ENABLE_NORMALIZE
+/*
+** zId of length nId is a double-quoted identifier. Check to see if
+** that identifier is really used as a string literal.
+*/
+SQLITE_PRIVATE int sqlite3VdbeUsesDoubleQuotedString(
+ Vdbe *pVdbe, /* The prepared statement */
+ const char *zId /* The double-quoted identifier, already dequoted */
+){
+ DblquoteStr *pStr;
+ assert( zId!=0 );
+ if( pVdbe->pDblStr==0 ) return 0;
+ for(pStr=pVdbe->pDblStr; pStr; pStr=pStr->pNextStr){
+ if( strcmp(zId, pStr->z)==0 ) return 1;
+ }
+ return 0;
}
+#endif
/*
** Swap all content between two VDBE structures.
@@ -75919,7 +76231,7 @@ SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
zTmp = pA->zSql;
pA->zSql = pB->zSql;
pB->zSql = zTmp;
-#ifdef SQLITE_ENABLE_NORMALIZE
+#if 0
zTmp = pA->zNormSql;
pA->zNormSql = pB->zNormSql;
pB->zNormSql = zTmp;
@@ -75936,7 +76248,7 @@ SQLITE_PRIVATE void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){
** to 1024/sizeof(Op).
**
** If an out-of-memory error occurs while resizing the array, return
-** SQLITE_NOMEM. In this case Vdbe.aOp and Parse.nOpAlloc remain
+** SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.nOpAlloc remain
** unchanged (this is so that any opcodes already allocated can be
** correctly deallocated along with the rest of the Vdbe).
*/
@@ -75952,9 +76264,9 @@ static int growOpArray(Vdbe *v, int nOp){
** operation (without SQLITE_TEST_REALLOC_STRESS) is to double the current
** size of the op array or add 1KB of space, whichever is smaller. */
#ifdef SQLITE_TEST_REALLOC_STRESS
- int nNew = (p->nOpAlloc>=512 ? p->nOpAlloc*2 : p->nOpAlloc+nOp);
+ int nNew = (v->nOpAlloc>=512 ? v->nOpAlloc*2 : v->nOpAlloc+nOp);
#else
- int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op)));
+ int nNew = (v->nOpAlloc ? v->nOpAlloc*2 : (int)(1024/sizeof(Op)));
UNUSED_PARAMETER(nOp);
#endif
@@ -75965,11 +76277,11 @@ static int growOpArray(Vdbe *v, int nOp){
}
assert( nOp<=(1024/sizeof(Op)) );
- assert( nNew>=(p->nOpAlloc+nOp) );
+ assert( nNew>=(v->nOpAlloc+nOp) );
pNew = sqlite3DbRealloc(p->db, v->aOp, nNew*sizeof(Op));
if( pNew ){
p->szOpAlloc = sqlite3DbMallocSize(p->db, pNew);
- p->nOpAlloc = p->szOpAlloc/sizeof(Op);
+ v->nOpAlloc = p->szOpAlloc/sizeof(Op);
v->aOp = pNew;
}
return (pNew ? SQLITE_OK : SQLITE_NOMEM_BKPT);
@@ -76003,9 +76315,9 @@ static void test_addop_breakpoint(void){
** operand.
*/
static SQLITE_NOINLINE int growOp3(Vdbe *p, int op, int p1, int p2, int p3){
- assert( p->pParse->nOpAlloc<=p->nOp );
+ assert( p->nOpAlloc<=p->nOp );
if( growOpArray(p, 1) ) return 1;
- assert( p->pParse->nOpAlloc>p->nOp );
+ assert( p->nOpAlloc>p->nOp );
return sqlite3VdbeAddOp3(p, op, p1, p2, p3);
}
SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, int p3){
@@ -76015,7 +76327,7 @@ SQLITE_PRIVATE int sqlite3VdbeAddOp3(Vdbe *p, int op, int p1, int p2, int p3){
i = p->nOp;
assert( p->magic==VDBE_MAGIC_INIT );
assert( op>=0 && op<0xff );
- if( p->pParse->nOpAlloc<=i ){
+ if( p->nOpAlloc<=i ){
return growOp3(p, op, p1, p2, p3);
}
p->nOp++;
@@ -76147,13 +76459,29 @@ SQLITE_PRIVATE int sqlite3VdbeExplainParent(Parse *pParse){
}
/*
-** Add a new OP_Explain opcode.
+** Set a debugger breakpoint on the following routine in order to
+** monitor the EXPLAIN QUERY PLAN code generation.
+*/
+#if defined(SQLITE_DEBUG)
+SQLITE_PRIVATE void sqlite3ExplainBreakpoint(const char *z1, const char *z2){
+ (void)z1;
+ (void)z2;
+}
+#endif
+
+/*
+** Add a new OP_ opcode.
**
** If the bPush flag is true, then make this opcode the parent for
** subsequent Explains until sqlite3VdbeExplainPop() is called.
*/
SQLITE_PRIVATE void sqlite3VdbeExplain(Parse *pParse, u8 bPush, const char *zFmt, ...){
- if( pParse->explain==2 ){
+#ifndef SQLITE_DEBUG
+ /* Always include the OP_Explain opcodes if SQLITE_DEBUG is defined.
+ ** But omit them (for performance) during production builds */
+ if( pParse->explain==2 )
+#endif
+ {
char *zMsg;
Vdbe *v;
va_list ap;
@@ -76165,7 +76493,10 @@ SQLITE_PRIVATE void sqlite3VdbeExplain(Parse *pParse, u8 bPush, const char *zFmt
iThis = v->nOp;
sqlite3VdbeAddOp4(v, OP_Explain, iThis, pParse->addrExplain, 0,
zMsg, P4_DYNAMIC);
- if( bPush) pParse->addrExplain = iThis;
+ sqlite3ExplainBreakpoint(bPush?"PUSH":"", sqlite3VdbeGetOp(v,-1)->p4.z);
+ if( bPush){
+ pParse->addrExplain = iThis;
+ }
}
}
@@ -76173,6 +76504,7 @@ SQLITE_PRIVATE void sqlite3VdbeExplain(Parse *pParse, u8 bPush, const char *zFmt
** Pop the EXPLAIN QUERY PLAN stack one level.
*/
SQLITE_PRIVATE void sqlite3VdbeExplainPop(Parse *pParse){
+ sqlite3ExplainBreakpoint("POP", 0);
pParse->addrExplain = sqlite3VdbeExplainParent(pParse);
}
#endif /* SQLITE_OMIT_EXPLAIN */
@@ -76237,21 +76569,22 @@ SQLITE_PRIVATE void sqlite3VdbeEndCoroutine(Vdbe *v, int regYield){
** The VDBE knows that a P2 value is a label because labels are
** always negative and P2 values are suppose to be non-negative.
** Hence, a negative P2 value is a label that has yet to be resolved.
+** (Later:) This is only true for opcodes that have the OPFLG_JUMP
+** property.
+**
+** Variable usage notes:
**
-** Zero is returned if a malloc() fails.
+** Parse.aLabel[x] Stores the address that the x-th label resolves
+** into. For testing (SQLITE_DEBUG), unresolved
+** labels stores -1, but that is not required.
+** Parse.nLabelAlloc Number of slots allocated to Parse.aLabel[]
+** Parse.nLabel The *negative* of the number of labels that have
+** been issued. The negative is stored because
+** that gives a performance improvement over storing
+** the equivalent positive value.
*/
-SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *v){
- Parse *p = v->pParse;
- int i = p->nLabel++;
- assert( v->magic==VDBE_MAGIC_INIT );
- if( (i & (i-1))==0 ){
- p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel,
- (i*2+1)*sizeof(p->aLabel[0]));
- }
- if( p->aLabel ){
- p->aLabel[i] = -1;
- }
- return ADDR(i);
+SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Parse *pParse){
+ return --pParse->nLabel;
}
/*
@@ -76259,18 +76592,35 @@ SQLITE_PRIVATE int sqlite3VdbeMakeLabel(Vdbe *v){
** be inserted. The parameter "x" must have been obtained from
** a prior call to sqlite3VdbeMakeLabel().
*/
+static SQLITE_NOINLINE void resizeResolveLabel(Parse *p, Vdbe *v, int j){
+ int nNewSize = 10 - p->nLabel;
+ p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel,
+ nNewSize*sizeof(p->aLabel[0]));
+ if( p->aLabel==0 ){
+ p->nLabelAlloc = 0;
+ }else{
+#ifdef SQLITE_DEBUG
+ int i;
+ for(i=p->nLabelAlloc; i<nNewSize; i++) p->aLabel[i] = -1;
+#endif
+ p->nLabelAlloc = nNewSize;
+ p->aLabel[j] = v->nOp;
+ }
+}
SQLITE_PRIVATE void sqlite3VdbeResolveLabel(Vdbe *v, int x){
Parse *p = v->pParse;
int j = ADDR(x);
assert( v->magic==VDBE_MAGIC_INIT );
- assert( j<p->nLabel );
+ assert( j<-p->nLabel );
assert( j>=0 );
- if( p->aLabel ){
#ifdef SQLITE_DEBUG
- if( p->db->flags & SQLITE_VdbeAddopTrace ){
- printf("RESOLVE LABEL %d to %d\n", x, v->nOp);
- }
+ if( p->db->flags & SQLITE_VdbeAddopTrace ){
+ printf("RESOLVE LABEL %d to %d\n", x, v->nOp);
+ }
#endif
+ if( p->nLabelAlloc + p->nLabel < 0 ){
+ resizeResolveLabel(p,v,j);
+ }else{
assert( p->aLabel[j]==(-1) ); /* Labels may only be resolved once */
p->aLabel[j] = v->nOp;
}
@@ -76395,8 +76745,9 @@ SQLITE_PRIVATE int sqlite3VdbeAssertMayAbort(Vdbe *v, int mayAbort){
while( (pOp = opIterNext(&sIter))!=0 ){
int opcode = pOp->opcode;
if( opcode==OP_Destroy || opcode==OP_VUpdate || opcode==OP_VRename
+ || opcode==OP_VDestroy
|| ((opcode==OP_Halt || opcode==OP_HaltIfNull)
- && ((pOp->p1&0xff)==SQLITE_CONSTRAINT && pOp->p2==OE_Abort))
+ && ((pOp->p1)!=SQLITE_OK && pOp->p2==OE_Abort))
){
hasAbort = 1;
break;
@@ -76545,7 +76896,7 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
** non-jump opcodes less than SQLITE_MX_JUMP_CODE are guaranteed to
** have non-negative values for P2. */
assert( (sqlite3OpcodeProperty[pOp->opcode] & OPFLG_JUMP)!=0 );
- assert( ADDR(pOp->p2)<pParse->nLabel );
+ assert( ADDR(pOp->p2)<-pParse->nLabel );
pOp->p2 = aLabel[ADDR(pOp->p2)];
}
break;
@@ -76584,7 +76935,7 @@ SQLITE_PRIVATE int sqlite3VdbeCurrentAddr(Vdbe *p){
*/
#if defined(SQLITE_DEBUG) && !defined(SQLITE_TEST_REALLOC_STRESS)
SQLITE_PRIVATE void sqlite3VdbeVerifyNoMallocRequired(Vdbe *p, int N){
- assert( p->nOp + N <= p->pParse->nOpAlloc );
+ assert( p->nOp + N <= p->nOpAlloc );
}
#endif
@@ -76656,7 +77007,7 @@ SQLITE_PRIVATE VdbeOp *sqlite3VdbeAddOpList(
VdbeOp *pOut, *pFirst;
assert( nOp>0 );
assert( p->magic==VDBE_MAGIC_INIT );
- if( p->nOp + nOp > p->pParse->nOpAlloc && growOpArray(p, nOp) ){
+ if( p->nOp + nOp > p->nOpAlloc && growOpArray(p, nOp) ){
return 0;
}
pFirst = pOut = &p->aOp[p->nOp];
@@ -77978,19 +78329,27 @@ SQLITE_PRIVATE void sqlite3VdbeMakeReady(
** the leftover memory at the end of the opcode array. This can significantly
** reduce the amount of memory held by a prepared statement.
*/
- do {
- x.nNeeded = 0;
- p->aMem = allocSpace(&x, p->aMem, nMem*sizeof(Mem));
- p->aVar = allocSpace(&x, p->aVar, nVar*sizeof(Mem));
- p->apArg = allocSpace(&x, p->apArg, nArg*sizeof(Mem*));
- p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
+ x.nNeeded = 0;
+ p->aMem = allocSpace(&x, 0, nMem*sizeof(Mem));
+ p->aVar = allocSpace(&x, 0, nVar*sizeof(Mem));
+ p->apArg = allocSpace(&x, 0, nArg*sizeof(Mem*));
+ p->apCsr = allocSpace(&x, 0, nCursor*sizeof(VdbeCursor*));
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
- p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
+ p->anExec = allocSpace(&x, 0, p->nOp*sizeof(i64));
#endif
- if( x.nNeeded==0 ) break;
+ if( x.nNeeded ){
x.pSpace = p->pFree = sqlite3DbMallocRawNN(db, x.nNeeded);
x.nFree = x.nNeeded;
- }while( !db->mallocFailed );
+ if( !db->mallocFailed ){
+ p->aMem = allocSpace(&x, p->aMem, nMem*sizeof(Mem));
+ p->aVar = allocSpace(&x, p->aVar, nVar*sizeof(Mem));
+ p->apArg = allocSpace(&x, p->apArg, nArg*sizeof(Mem*));
+ p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
+#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
+ p->anExec = allocSpace(&x, p->anExec, p->nOp*sizeof(i64));
+#endif
+ }
+ }
p->pVList = pParse->pVList;
pParse->pVList = 0;
@@ -78682,7 +79041,7 @@ SQLITE_PRIVATE int sqlite3VdbeHalt(Vdbe *p){
}else{
db->nDeferredCons = 0;
db->nDeferredImmCons = 0;
- db->flags &= ~SQLITE_DeferFKs;
+ db->flags &= ~(u64)SQLITE_DeferFKs;
sqlite3CommitInternalChanges(db);
}
}else{
@@ -78997,6 +79356,13 @@ SQLITE_PRIVATE void sqlite3VdbeClearObject(sqlite3 *db, Vdbe *p){
sqlite3DbFree(db, p->zSql);
#ifdef SQLITE_ENABLE_NORMALIZE
sqlite3DbFree(db, p->zNormSql);
+ {
+ DblquoteStr *pThis, *pNext;
+ for(pThis=p->pDblStr; pThis; pThis=pNext){
+ pNext = pThis->pNextStr;
+ sqlite3DbFree(db, pThis);
+ }
+ }
#endif
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
{
@@ -79537,7 +79903,7 @@ SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
UnpackedRecord *p /* Populate this structure before returning. */
){
const unsigned char *aKey = (const unsigned char *)pKey;
- int d;
+ u32 d;
u32 idx; /* Offset in aKey[] to read from */
u16 u; /* Unsigned loop counter */
u32 szHdr;
@@ -79548,7 +79914,7 @@ SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
idx = getVarint32(aKey, szHdr);
d = szHdr;
u = 0;
- while( idx<szHdr && d<=nKey ){
+ while( idx<szHdr && d<=(u32)nKey ){
u32 serial_type;
idx += getVarint32(&aKey[idx], serial_type);
@@ -79561,6 +79927,13 @@ SQLITE_PRIVATE void sqlite3VdbeRecordUnpack(
pMem++;
if( (++u)>=p->nField ) break;
}
+ if( d>(u32)nKey && u ){
+ assert( CORRUPT_DB );
+ /* In a corrupt record entry, the last pMem might have been set up using
+ ** uninitialized memory. Overwrite its value with NULL, to prevent
+ ** warnings from MSAN. */
+ sqlite3VdbeMemSetNull(pMem-1);
+ }
assert( u<=pKeyInfo->nKeyField + 1 );
p->nField = u;
}
@@ -79626,8 +79999,8 @@ static int vdbeRecordCompareDebug(
** Use that approximation to avoid the more expensive call to
** sqlite3VdbeSerialTypeLen() in the common case.
*/
- if( d1+serial_type1+2>(u32)nKey1
- && d1+sqlite3VdbeSerialTypeLen(serial_type1)>(u32)nKey1
+ if( d1+(u64)serial_type1+2>(u64)nKey1
+ && d1+(u64)sqlite3VdbeSerialTypeLen(serial_type1)>(u64)nKey1
){
break;
}
@@ -79638,7 +80011,8 @@ static int vdbeRecordCompareDebug(
/* Do the comparison
*/
- rc = sqlite3MemCompare(&mem1, &pPKey2->aMem[i], pKeyInfo->aColl[i]);
+ rc = sqlite3MemCompare(&mem1, &pPKey2->aMem[i],
+ pKeyInfo->nAllField>i ? pKeyInfo->aColl[i] : 0);
if( rc!=0 ){
assert( mem1.szMalloc==0 ); /* See comment below */
if( pKeyInfo->aSortOrder[i] ){
@@ -79994,12 +80368,12 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip(
}else{
idx1 = getVarint32(aKey1, szHdr1);
d1 = szHdr1;
- if( d1>(unsigned)nKey1 ){
- pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT;
- return 0; /* Corruption */
- }
i = 0;
}
+ if( d1>(unsigned)nKey1 ){
+ pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT;
+ return 0; /* Corruption */
+ }
VVA_ONLY( mem1.szMalloc = 0; ) /* Only needed by assert() statements */
assert( pPKey2->pKeyInfo->nAllField>=pPKey2->nField
@@ -80069,10 +80443,12 @@ SQLITE_PRIVATE int sqlite3VdbeRecordCompareWithSkip(
mem1.n = (serial_type - 12) / 2;
testcase( (d1+mem1.n)==(unsigned)nKey1 );
testcase( (d1+mem1.n+1)==(unsigned)nKey1 );
- if( (d1+mem1.n) > (unsigned)nKey1 ){
+ if( (d1+mem1.n) > (unsigned)nKey1
+ || (pKeyInfo = pPKey2->pKeyInfo)->nAllField<=i
+ ){
pPKey2->errCode = (u8)SQLITE_CORRUPT_BKPT;
return 0; /* Corruption */
- }else if( (pKeyInfo = pPKey2->pKeyInfo)->aColl[i] ){
+ }else if( pKeyInfo->aColl[i] ){
mem1.enc = pKeyInfo->enc;
mem1.db = pKeyInfo->db;
mem1.flags = MEM_Str;
@@ -80772,14 +81148,16 @@ static SQLITE_NOINLINE void invokeProfileCallback(sqlite3 *db, Vdbe *p){
sqlite3_int64 iNow;
sqlite3_int64 iElapse;
assert( p->startTime>0 );
- assert( db->xProfile!=0 || (db->mTrace & SQLITE_TRACE_PROFILE)!=0 );
+ assert( (db->mTrace & (SQLITE_TRACE_PROFILE|SQLITE_TRACE_XPROFILE))!=0 );
assert( db->init.busy==0 );
assert( p->zSql!=0 );
sqlite3OsCurrentTimeInt64(db->pVfs, &iNow);
iElapse = (iNow - p->startTime)*1000000;
+#ifndef SQLITE_OMIT_DEPRECATED
if( db->xProfile ){
db->xProfile(db->pProfileArg, p->zSql, iElapse);
}
+#endif
if( db->mTrace & SQLITE_TRACE_PROFILE ){
db->xTrace(SQLITE_TRACE_PROFILE, db->pTraceArg, p, (void*)&iElapse);
}
@@ -81293,7 +81671,7 @@ static int sqlite3Step(Vdbe *p){
return SQLITE_NOMEM_BKPT;
}
- if( p->pc<=0 && p->expired ){
+ if( p->pc<0 && p->expired ){
p->rc = SQLITE_SCHEMA;
rc = SQLITE_ERROR;
goto end_of_step;
@@ -81312,7 +81690,7 @@ static int sqlite3Step(Vdbe *p){
);
#ifndef SQLITE_OMIT_TRACE
- if( (db->xProfile || (db->mTrace & SQLITE_TRACE_PROFILE)!=0)
+ if( (db->mTrace & (SQLITE_TRACE_PROFILE|SQLITE_TRACE_XPROFILE))!=0
&& !db->init.busy && p->zSql ){
sqlite3OsCurrentTimeInt64(db->pVfs, &p->startTime);
}else{
@@ -81339,16 +81717,18 @@ static int sqlite3Step(Vdbe *p){
db->nVdbeExec--;
}
+ if( rc!=SQLITE_ROW ){
#ifndef SQLITE_OMIT_TRACE
- /* If the statement completed successfully, invoke the profile callback */
- if( rc!=SQLITE_ROW ) checkProfileCallback(db, p);
+ /* If the statement completed successfully, invoke the profile callback */
+ checkProfileCallback(db, p);
#endif
- if( rc==SQLITE_DONE && db->autoCommit ){
- assert( p->rc==SQLITE_OK );
- p->rc = doWalCallbacks(db);
- if( p->rc!=SQLITE_OK ){
- rc = SQLITE_ERROR;
+ if( rc==SQLITE_DONE && db->autoCommit ){
+ assert( p->rc==SQLITE_OK );
+ p->rc = doWalCallbacks(db);
+ if( p->rc!=SQLITE_OK ){
+ rc = SQLITE_ERROR;
+ }
}
}
@@ -81368,9 +81748,9 @@ end_of_step:
|| (rc&0xff)==SQLITE_BUSY || rc==SQLITE_MISUSE
);
assert( (p->rc!=SQLITE_ROW && p->rc!=SQLITE_DONE) || p->rc==p->rcApp );
- if( (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0
- && rc!=SQLITE_ROW
- && rc!=SQLITE_DONE
+ if( rc!=SQLITE_ROW
+ && rc!=SQLITE_DONE
+ && (p->prepFlags & SQLITE_PREPARE_SAVESQL)!=0
){
/* If this statement was prepared using saved SQL and an
** error has occurred, then return the error code in p->rc to the
@@ -81992,7 +82372,7 @@ static int vdbeUnbind(Vdbe *p, int i){
pVar = &p->aVar[i];
sqlite3VdbeMemRelease(pVar);
pVar->flags = MEM_Null;
- sqlite3Error(p->db, SQLITE_OK);
+ p->db->errCode = SQLITE_OK;
/* If the bit corresponding to this variable in Vdbe.expmask is set, then
** binding a new value to this variable invalidates the current query plan.
@@ -82418,7 +82798,13 @@ SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt){
*/
SQLITE_API const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt){
Vdbe *p = (Vdbe *)pStmt;
- return p ? p->zNormSql : 0;
+ if( p==0 ) return 0;
+ if( p->zNormSql==0 && ALWAYS(p->zSql!=0) ){
+ sqlite3_mutex_enter(p->db->mutex);
+ p->zNormSql = sqlite3Normalize(p, p->zSql);
+ sqlite3_mutex_leave(p->db->mutex);
+ }
+ return p->zNormSql;
}
#endif /* SQLITE_ENABLE_NORMALIZE */
@@ -83118,6 +83504,11 @@ static VdbeCursor *allocateCursor(
assert( iCur>=0 && iCur<p->nCursor );
if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/
+ /* Before calling sqlite3VdbeFreeCursor(), ensure the isEphemeral flag
+ ** is clear. Otherwise, if this is an ephemeral cursor created by
+ ** OP_OpenDup, the cursor will not be closed and will still be part
+ ** of a BtShared.pCursor list. */
+ p->apCsr[iCur]->isEphemeral = 0;
sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
p->apCsr[iCur] = 0;
}
@@ -83258,6 +83649,7 @@ SQLITE_PRIVATE void sqlite3ValueApplyAffinity(
static u16 SQLITE_NOINLINE computeNumericType(Mem *pMem){
assert( (pMem->flags & (MEM_Int|MEM_Real))==0 );
assert( (pMem->flags & (MEM_Str|MEM_Blob))!=0 );
+ ExpandBlob(pMem);
if( sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc)==0 ){
return 0;
}
@@ -84545,8 +84937,8 @@ fp_math:
break;
}
default: {
- iA = (i64)rA;
- iB = (i64)rB;
+ iA = sqlite3VdbeIntValue(pIn1);
+ iB = sqlite3VdbeIntValue(pIn2);
if( iA==0 ) goto arithmetic_result_is_null;
if( iA==-1 ) iA = 1;
rB = (double)(iB % iA);
@@ -84892,7 +85284,8 @@ case OP_Ge: { /* same as TK_GE, jump, in1, in3 */
*/
assert( pOp->opcode==OP_Eq || pOp->opcode==OP_Ne );
assert( (flags1 & MEM_Cleared)==0 );
- assert( (pOp->p5 & SQLITE_JUMPIFNULL)==0 );
+ assert( (pOp->p5 & SQLITE_JUMPIFNULL)==0 || CORRUPT_DB );
+ testcase( (pOp->p5 & SQLITE_JUMPIFNULL)!=0 );
if( (flags1&flags3&MEM_Null)!=0
&& (flags3&MEM_Cleared)==0
){
@@ -86576,7 +86969,8 @@ case OP_OpenDup: {
pCx->isEphemeral = 1;
pCx->pKeyInfo = pOrig->pKeyInfo;
pCx->isTable = pOrig->isTable;
- rc = sqlite3BtreeCursor(pOrig->pBtx, MASTER_ROOT, BTREE_WRCSR,
+ pCx->pgnoRoot = pOrig->pgnoRoot;
+ rc = sqlite3BtreeCursor(pOrig->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
pCx->pKeyInfo, pCx->uc.pCursor);
/* The sqlite3BtreeCursor() routine can only fail for the first cursor
** opened for a database. Since there is already an open cursor when this
@@ -86594,6 +86988,9 @@ case OP_OpenDup: {
** the main database is read-only. The ephemeral
** table is deleted automatically when the cursor is closed.
**
+** If the cursor P1 is already opened on an ephemeral table, the table
+** is cleared (all content is erased).
+**
** P2 is the number of columns in the ephemeral table.
** The cursor points to a BTree table if P4==0 and to a BTree index
** if P4 is not 0. If P4 is not NULL, it points to a KeyInfo structure
@@ -86625,41 +87022,50 @@ case OP_OpenEphemeral: {
SQLITE_OPEN_TRANSIENT_DB;
assert( pOp->p1>=0 );
assert( pOp->p2>=0 );
- pCx = allocateCursor(p, pOp->p1, pOp->p2, -1, CURTYPE_BTREE);
- if( pCx==0 ) goto no_mem;
- pCx->nullRow = 1;
- pCx->isEphemeral = 1;
- rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx,
- BTREE_OMIT_JOURNAL | BTREE_SINGLE | pOp->p5, vfsFlags);
- if( rc==SQLITE_OK ){
- rc = sqlite3BtreeBeginTrans(pCx->pBtx, 1, 0);
- }
- if( rc==SQLITE_OK ){
- /* If a transient index is required, create it by calling
- ** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
- ** opening it. If a transient table is required, just use the
- ** automatically created table with root-page 1 (an BLOB_INTKEY table).
- */
- if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
- int pgno;
- assert( pOp->p4type==P4_KEYINFO );
- rc = sqlite3BtreeCreateTable(pCx->pBtx, &pgno, BTREE_BLOBKEY | pOp->p5);
- if( rc==SQLITE_OK ){
- assert( pgno==MASTER_ROOT+1 );
- assert( pKeyInfo->db==db );
- assert( pKeyInfo->enc==ENC(db) );
- rc = sqlite3BtreeCursor(pCx->pBtx, pgno, BTREE_WRCSR,
- pKeyInfo, pCx->uc.pCursor);
+ pCx = p->apCsr[pOp->p1];
+ if( pCx ){
+ /* If the ephermeral table is already open, erase all existing content
+ ** so that the table is empty again, rather than creating a new table. */
+ rc = sqlite3BtreeClearTable(pCx->pBtx, pCx->pgnoRoot, 0);
+ }else{
+ pCx = allocateCursor(p, pOp->p1, pOp->p2, -1, CURTYPE_BTREE);
+ if( pCx==0 ) goto no_mem;
+ pCx->nullRow = 1;
+ pCx->isEphemeral = 1;
+ rc = sqlite3BtreeOpen(db->pVfs, 0, db, &pCx->pBtx,
+ BTREE_OMIT_JOURNAL | BTREE_SINGLE | pOp->p5,
+ vfsFlags);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3BtreeBeginTrans(pCx->pBtx, 1, 0);
+ }
+ if( rc==SQLITE_OK ){
+ /* If a transient index is required, create it by calling
+ ** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
+ ** opening it. If a transient table is required, just use the
+ ** automatically created table with root-page 1 (an BLOB_INTKEY table).
+ */
+ if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
+ assert( pOp->p4type==P4_KEYINFO );
+ rc = sqlite3BtreeCreateTable(pCx->pBtx, (int*)&pCx->pgnoRoot,
+ BTREE_BLOBKEY | pOp->p5);
+ if( rc==SQLITE_OK ){
+ assert( pCx->pgnoRoot==MASTER_ROOT+1 );
+ assert( pKeyInfo->db==db );
+ assert( pKeyInfo->enc==ENC(db) );
+ rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
+ pKeyInfo, pCx->uc.pCursor);
+ }
+ pCx->isTable = 0;
+ }else{
+ pCx->pgnoRoot = MASTER_ROOT;
+ rc = sqlite3BtreeCursor(pCx->pBtx, MASTER_ROOT, BTREE_WRCSR,
+ 0, pCx->uc.pCursor);
+ pCx->isTable = 1;
}
- pCx->isTable = 0;
- }else{
- rc = sqlite3BtreeCursor(pCx->pBtx, MASTER_ROOT, BTREE_WRCSR,
- 0, pCx->uc.pCursor);
- pCx->isTable = 1;
}
+ pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
}
if( rc ) goto abort_due_to_error;
- pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
break;
}
@@ -87309,7 +87715,7 @@ case OP_NotExists: /* jump, in3 */
pC = p->apCsr[pOp->p1];
assert( pC!=0 );
#ifdef SQLITE_DEBUG
- pC->seekOp = OP_SeekRowid;
+ if( pOp->opcode==OP_SeekRowid ) pC->seekOp = OP_SeekRowid;
#endif
assert( pC->isTable );
assert( pC->eCurType==CURTYPE_BTREE );
@@ -87527,14 +87933,7 @@ case OP_NewRowid: { /* out2 */
** This instruction only works on tables. The equivalent instruction
** for indices is OP_IdxInsert.
*/
-/* Opcode: InsertInt P1 P2 P3 P4 P5
-** Synopsis: intkey=P3 data=r[P2]
-**
-** This works exactly like OP_Insert except that the key is the
-** integer value P3, not the value of the integer stored in register P3.
-*/
-case OP_Insert:
-case OP_InsertInt: {
+case OP_Insert: {
Mem *pData; /* MEM cell holding data for the record to be inserted */
Mem *pKey; /* MEM cell holding key for the record */
VdbeCursor *pC; /* Cursor to table into which insert is written */
@@ -87555,16 +87954,11 @@ case OP_InsertInt: {
REGISTER_TRACE(pOp->p2, pData);
sqlite3VdbeIncrWriteCounter(p, pC);
- if( pOp->opcode==OP_Insert ){
- pKey = &aMem[pOp->p3];
- assert( pKey->flags & MEM_Int );
- assert( memIsValid(pKey) );
- REGISTER_TRACE(pOp->p3, pKey);
- x.nKey = pKey->u.i;
- }else{
- assert( pOp->opcode==OP_InsertInt );
- x.nKey = pOp->p3;
- }
+ pKey = &aMem[pOp->p3];
+ assert( pKey->flags & MEM_Int );
+ assert( memIsValid(pKey) );
+ REGISTER_TRACE(pOp->p3, pKey);
+ x.nKey = pKey->u.i;
if( pOp->p4type==P4_TABLE && HAS_UPDATE_HOOK(db) ){
assert( pC->iDb>=0 );
@@ -88217,7 +88611,7 @@ case OP_Next: /* jump */
assert( pOp->opcode!=OP_Next
|| pC->seekOp==OP_SeekGT || pC->seekOp==OP_SeekGE
|| pC->seekOp==OP_Rewind || pC->seekOp==OP_Found
- || pC->seekOp==OP_NullRow);
+ || pC->seekOp==OP_NullRow|| pC->seekOp==OP_SeekRowid);
assert( pOp->opcode!=OP_Prev
|| pC->seekOp==OP_SeekLT || pC->seekOp==OP_SeekLE
|| pC->seekOp==OP_Last
@@ -88747,9 +89141,16 @@ case OP_ParseSchema: {
assert( db->init.busy==0 );
db->init.busy = 1;
initData.rc = SQLITE_OK;
+ initData.nInitRow = 0;
assert( !db->mallocFailed );
rc = sqlite3_exec(db, zSql, sqlite3InitCallback, &initData, 0);
if( rc==SQLITE_OK ) rc = initData.rc;
+ if( rc==SQLITE_OK && initData.nInitRow==0 ){
+ /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse
+ ** at least one SQL statement. Any less than that indicates that
+ ** the sqlite_master table is corrupt. */
+ rc = SQLITE_CORRUPT_BKPT;
+ }
sqlite3DbFreeNN(db, zSql);
db->init.busy = 0;
}
@@ -89113,6 +89514,17 @@ case OP_Program: { /* jump */
#ifdef SQLITE_ENABLE_STMT_SCANSTATUS
p->anExec = 0;
#endif
+#ifdef SQLITE_DEBUG
+ /* Verify that second and subsequent executions of the same trigger do not
+ ** try to reuse register values from the first use. */
+ {
+ int i;
+ for(i=0; i<p->nMem; i++){
+ aMem[i].pScopyFrom = 0; /* Prevent false-positive AboutToChange() errs */
+ aMem[i].flags |= MEM_Undefined; /* Cause a fault if this reg is reused */
+ }
+ }
+#endif
pOp = &aOp[-1];
break;
@@ -89651,14 +90063,19 @@ case OP_JournalMode: { /* out2 */
#endif /* SQLITE_OMIT_PRAGMA */
#if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH)
-/* Opcode: Vacuum P1 * * * *
+/* Opcode: Vacuum P1 P2 * * *
**
** Vacuum the entire database P1. P1 is 0 for "main", and 2 or more
** for an attached database. The "temp" database may not be vacuumed.
+**
+** If P2 is not zero, then it is a register holding a string which is
+** the file into which the result of vacuum should be written. When
+** P2 is zero, the vacuum overwrites the original database.
*/
case OP_Vacuum: {
assert( p->readOnly==0 );
- rc = sqlite3RunVacuum(&p->zErrMsg, db, pOp->p1);
+ rc = sqlite3RunVacuum(&p->zErrMsg, db, pOp->p1,
+ pOp->p2 ? &aMem[pOp->p2] : 0);
if( rc ) goto abort_due_to_error;
break;
}
@@ -89810,6 +90227,7 @@ case OP_VDestroy: {
db->nVDestroy++;
rc = sqlite3VtabCallDestroy(db, pOp->p1, pOp->p4.z);
db->nVDestroy--;
+ assert( p->errorAction==OE_Abort && p->usesStmtJournal );
if( rc ) goto abort_due_to_error;
break;
}
@@ -90053,7 +90471,7 @@ case OP_VRename: {
rc = sqlite3VdbeChangeEncoding(pName, SQLITE_UTF8);
if( rc ) goto abort_due_to_error;
rc = pVtab->pModule->xRename(pVtab, pName->z);
- if( isLegacy==0 ) db->flags &= ~SQLITE_LegacyAlter;
+ if( isLegacy==0 ) db->flags &= ~(u64)SQLITE_LegacyAlter;
sqlite3VtabImportErrmsg(p, pVtab);
p->expired = 0;
if( rc ) goto abort_due_to_error;
@@ -94280,6 +94698,22 @@ SQLITE_PRIVATE int sqlite3JournalSize(sqlite3_vfs *pVfs){
/* #include <string.h> */
+#if !defined(SQLITE_OMIT_WINDOWFUNC)
+/*
+** Walk all expressions linked into the list of Window objects passed
+** as the second argument.
+*/
+static int walkWindowList(Walker *pWalker, Window *pList){
+ Window *pWin;
+ for(pWin=pList; pWin; pWin=pWin->pNextWin){
+ if( sqlite3WalkExprList(pWalker, pWin->pOrderBy) ) return WRC_Abort;
+ if( sqlite3WalkExprList(pWalker, pWin->pPartition) ) return WRC_Abort;
+ if( sqlite3WalkExpr(pWalker, pWin->pFilter) ) return WRC_Abort;
+ }
+ return WRC_Continue;
+}
+#endif
+
/*
** Walk an expression tree. Invoke the callback once for each node
** of the expression, while descending. (In other words, the callback
@@ -94319,10 +94753,7 @@ static SQLITE_NOINLINE int walkExpr(Walker *pWalker, Expr *pExpr){
}
#ifndef SQLITE_OMIT_WINDOWFUNC
if( ExprHasProperty(pExpr, EP_WinFunc) ){
- Window *pWin = pExpr->y.pWin;
- if( sqlite3WalkExprList(pWalker, pWin->pPartition) ) return WRC_Abort;
- if( sqlite3WalkExprList(pWalker, pWin->pOrderBy) ) return WRC_Abort;
- if( sqlite3WalkExpr(pWalker, pWin->pFilter) ) return WRC_Abort;
+ if( walkWindowList(pWalker, pExpr->y.pWin) ) return WRC_Abort;
}
#endif
}
@@ -94362,6 +94793,16 @@ SQLITE_PRIVATE int sqlite3WalkSelectExpr(Walker *pWalker, Select *p){
if( sqlite3WalkExpr(pWalker, p->pHaving) ) return WRC_Abort;
if( sqlite3WalkExprList(pWalker, p->pOrderBy) ) return WRC_Abort;
if( sqlite3WalkExpr(pWalker, p->pLimit) ) return WRC_Abort;
+#if !defined(SQLITE_OMIT_WINDOWFUNC) && !defined(SQLITE_OMIT_ALTERTABLE)
+ {
+ Parse *pParse = pWalker->pParse;
+ if( pParse && IN_RENAME_OBJECT ){
+ int rc = walkWindowList(pWalker, p->pWinDefn);
+ assert( rc==WRC_Continue );
+ return rc;
+ }
+ }
+#endif
return WRC_Continue;
}
@@ -94513,7 +94954,6 @@ static void resolveAlias(
if( pExpr->op==TK_COLLATE ){
pDup = sqlite3ExprAddCollateString(pParse, pDup, pExpr->u.zToken);
}
- ExprSetProperty(pDup, EP_Alias);
/* Before calling sqlite3ExprDelete(), set the EP_Static flag. This
** prevents ExprDelete() from deleting the Expr structure itself,
@@ -94907,6 +95347,25 @@ static int lookupName(
if( cnt==0 && zTab==0 ){
assert( pExpr->op==TK_ID );
if( ExprHasProperty(pExpr,EP_DblQuoted) ){
+ /* If a double-quoted identifier does not match any known column name,
+ ** then treat it as a string.
+ **
+ ** This hack was added in the early days of SQLite in a misguided attempt
+ ** to be compatible with MySQL 3.x, which used double-quotes for strings.
+ ** I now sorely regret putting in this hack. The effect of this hack is
+ ** that misspelled identifier names are silently converted into strings
+ ** rather than causing an error, to the frustration of countless
+ ** programmers. To all those frustrated programmers, my apologies.
+ **
+ ** Someday, I hope to get rid of this hack. Unfortunately there is
+ ** a huge amount of legacy SQL that uses it. So for now, we just
+ ** issue a warning.
+ */
+ sqlite3_log(SQLITE_WARNING,
+ "double-quoted string literal: \"%w\"", zCol);
+#ifdef SQLITE_ENABLE_NORMALIZE
+ sqlite3VdbeAddDblquoteStr(db, pParse->pVdbe, zCol);
+#endif
pExpr->op = TK_STRING;
pExpr->y.pTab = 0;
return WRC_Prune;
@@ -95273,10 +95732,10 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
#ifndef SQLITE_OMIT_WINDOWFUNC
if( pExpr->y.pWin ){
Select *pSel = pNC->pWinSelect;
+ sqlite3WindowUpdate(pParse, pSel->pWinDefn, pExpr->y.pWin, pDef);
sqlite3WalkExprList(pWalker, pExpr->y.pWin->pPartition);
sqlite3WalkExprList(pWalker, pExpr->y.pWin->pOrderBy);
sqlite3WalkExpr(pWalker, pExpr->y.pWin->pFilter);
- sqlite3WindowUpdate(pParse, pSel->pWinDefn, pExpr->y.pWin, pDef);
if( 0==pSel->pWin
|| 0==sqlite3WindowCompare(pParse, pSel->pWin, pExpr->y.pWin)
){
@@ -95553,32 +96012,53 @@ static int resolveCompoundOrderBy(
}else{
iCol = resolveAsName(pParse, pEList, pE);
if( iCol==0 ){
- pDup = sqlite3ExprDup(db, pE, 0);
+ /* Now test if expression pE matches one of the values returned
+ ** by pSelect. In the usual case this is done by duplicating the
+ ** expression, resolving any symbols in it, and then comparing
+ ** it against each expression returned by the SELECT statement.
+ ** Once the comparisons are finished, the duplicate expression
+ ** is deleted.
+ **
+ ** Or, if this is running as part of an ALTER TABLE operation,
+ ** resolve the symbols in the actual expression, not a duplicate.
+ ** And, if one of the comparisons is successful, leave the expression
+ ** as is instead of transforming it to an integer as in the usual
+ ** case. This allows the code in alter.c to modify column
+ ** refererences within the ORDER BY expression as required. */
+ if( IN_RENAME_OBJECT ){
+ pDup = pE;
+ }else{
+ pDup = sqlite3ExprDup(db, pE, 0);
+ }
if( !db->mallocFailed ){
assert(pDup);
iCol = resolveOrderByTermToExprList(pParse, pSelect, pDup);
}
- sqlite3ExprDelete(db, pDup);
+ if( !IN_RENAME_OBJECT ){
+ sqlite3ExprDelete(db, pDup);
+ }
}
}
if( iCol>0 ){
/* Convert the ORDER BY term into an integer column number iCol,
** taking care to preserve the COLLATE clause if it exists */
- Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
- if( pNew==0 ) return 1;
- pNew->flags |= EP_IntValue;
- pNew->u.iValue = iCol;
- if( pItem->pExpr==pE ){
- pItem->pExpr = pNew;
- }else{
- Expr *pParent = pItem->pExpr;
- assert( pParent->op==TK_COLLATE );
- while( pParent->pLeft->op==TK_COLLATE ) pParent = pParent->pLeft;
- assert( pParent->pLeft==pE );
- pParent->pLeft = pNew;
+ if( !IN_RENAME_OBJECT ){
+ Expr *pNew = sqlite3Expr(db, TK_INTEGER, 0);
+ if( pNew==0 ) return 1;
+ pNew->flags |= EP_IntValue;
+ pNew->u.iValue = iCol;
+ if( pItem->pExpr==pE ){
+ pItem->pExpr = pNew;
+ }else{
+ Expr *pParent = pItem->pExpr;
+ assert( pParent->op==TK_COLLATE );
+ while( pParent->pLeft->op==TK_COLLATE ) pParent = pParent->pLeft;
+ assert( pParent->pLeft==pE );
+ pParent->pLeft = pNew;
+ }
+ sqlite3ExprDelete(db, pE);
+ pItem->u.x.iOrderByCol = (u16)iCol;
}
- sqlite3ExprDelete(db, pE);
- pItem->u.x.iOrderByCol = (u16)iCol;
pItem->done = 1;
}else{
moreToDo = 1;
@@ -95637,6 +96117,38 @@ SQLITE_PRIVATE int sqlite3ResolveOrderGroupBy(
return 0;
}
+#ifndef SQLITE_OMIT_WINDOWFUNC
+/*
+** Walker callback for resolveRemoveWindows().
+*/
+static int resolveRemoveWindowsCb(Walker *pWalker, Expr *pExpr){
+ if( ExprHasProperty(pExpr, EP_WinFunc) ){
+ Window **pp;
+ for(pp=&pWalker->u.pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
+ if( *pp==pExpr->y.pWin ){
+ *pp = (*pp)->pNextWin;
+ break;
+ }
+ }
+ }
+ return WRC_Continue;
+}
+
+/*
+** Remove any Window objects owned by the expression pExpr from the
+** Select.pWin list of Select object pSelect.
+*/
+static void resolveRemoveWindows(Select *pSelect, Expr *pExpr){
+ Walker sWalker;
+ memset(&sWalker, 0, sizeof(Walker));
+ sWalker.xExprCallback = resolveRemoveWindowsCb;
+ sWalker.u.pSelect = pSelect;
+ sqlite3WalkExpr(&sWalker, pExpr);
+}
+#else
+# define resolveRemoveWindows(x,y)
+#endif
+
/*
** pOrderBy is an ORDER BY or GROUP BY clause in SELECT statement pSelect.
** The Name context of the SELECT statement is pNC. zType is either
@@ -95703,19 +96215,10 @@ static int resolveOrderGroupBy(
}
for(j=0; j<pSelect->pEList->nExpr; j++){
if( sqlite3ExprCompare(0, pE, pSelect->pEList->a[j].pExpr, -1)==0 ){
-#ifndef SQLITE_OMIT_WINDOWFUNC
- if( ExprHasProperty(pE, EP_WinFunc) ){
- /* Since this window function is being changed into a reference
- ** to the same window function the result set, remove the instance
- ** of this window function from the Select.pWin list. */
- Window **pp;
- for(pp=&pSelect->pWin; *pp; pp=&(*pp)->pNextWin){
- if( *pp==pE->y.pWin ){
- *pp = (*pp)->pNextWin;
- }
- }
- }
-#endif
+ /* Since this expresion is being changed into a reference
+ ** to an identical expression in the result set, remove all Window
+ ** objects belonging to the expression from the Select.pWin list. */
+ resolveRemoveWindows(pSelect, pE);
pItem->u.x.iOrderByCol = j+1;
}
}
@@ -95927,6 +96430,17 @@ static int resolveSelectStep(Walker *pWalker, Select *p){
}
}
+ if( IN_RENAME_OBJECT ){
+ Window *pWin;
+ for(pWin=p->pWinDefn; pWin; pWin=pWin->pNextWin){
+ if( sqlite3ResolveExprListNames(&sNC, pWin->pOrderBy)
+ || sqlite3ResolveExprListNames(&sNC, pWin->pPartition)
+ ){
+ return WRC_Abort;
+ }
+ }
+ }
+
/* If this is part of a compound SELECT, check that it has the right
** number of expressions in the select list. */
if( p->pNext && p->pEList->nExpr!=p->pNext->pEList->nExpr ){
@@ -96077,38 +96591,47 @@ SQLITE_PRIVATE void sqlite3ResolveSelectNames(
}
/*
-** Resolve names in expressions that can only reference a single table:
+** Resolve names in expressions that can only reference a single table
+** or which cannot reference any tables at all. Examples:
**
-** * CHECK constraints
-** * WHERE clauses on partial indices
+** (1) CHECK constraints
+** (2) WHERE clauses on partial indices
+** (3) Expressions in indexes on expressions
+** (4) Expression arguments to VACUUM INTO.
**
-** The Expr.iTable value for Expr.op==TK_COLUMN nodes of the expression
-** is set to -1 and the Expr.iColumn value is set to the column number.
+** In all cases except (4), the Expr.iTable value for Expr.op==TK_COLUMN
+** nodes of the expression is set to -1 and the Expr.iColumn value is
+** set to the column number. In case (4), TK_COLUMN nodes cause an error.
**
** Any errors cause an error message to be set in pParse.
*/
-SQLITE_PRIVATE void sqlite3ResolveSelfReference(
+SQLITE_PRIVATE int sqlite3ResolveSelfReference(
Parse *pParse, /* Parsing context */
- Table *pTab, /* The table being referenced */
- int type, /* NC_IsCheck or NC_PartIdx or NC_IdxExpr */
+ Table *pTab, /* The table being referenced, or NULL */
+ int type, /* NC_IsCheck or NC_PartIdx or NC_IdxExpr, or 0 */
Expr *pExpr, /* Expression to resolve. May be NULL. */
ExprList *pList /* Expression list to resolve. May be NULL. */
){
SrcList sSrc; /* Fake SrcList for pParse->pNewTable */
NameContext sNC; /* Name context for pParse->pNewTable */
+ int rc;
- assert( type==NC_IsCheck || type==NC_PartIdx || type==NC_IdxExpr );
+ assert( type==0 || pTab!=0 );
+ assert( type==NC_IsCheck || type==NC_PartIdx || type==NC_IdxExpr || pTab==0 );
memset(&sNC, 0, sizeof(sNC));
memset(&sSrc, 0, sizeof(sSrc));
- sSrc.nSrc = 1;
- sSrc.a[0].zName = pTab->zName;
- sSrc.a[0].pTab = pTab;
- sSrc.a[0].iCursor = -1;
+ if( pTab ){
+ sSrc.nSrc = 1;
+ sSrc.a[0].zName = pTab->zName;
+ sSrc.a[0].pTab = pTab;
+ sSrc.a[0].iCursor = -1;
+ }
sNC.pParse = pParse;
sNC.pSrcList = &sSrc;
sNC.ncFlags = type;
- if( sqlite3ResolveExprNames(&sNC, pExpr) ) return;
- if( pList ) sqlite3ResolveExprListNames(&sNC, pList);
+ if( (rc = sqlite3ResolveExprNames(&sNC, pExpr))!=SQLITE_OK ) return rc;
+ if( pList ) rc = sqlite3ResolveExprListNames(&sNC, pList);
+ return rc;
}
/************** End of resolve.c *********************************************/
@@ -96256,8 +96779,8 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
while( p ){
int op = p->op;
if( p->flags & EP_Generic ) break;
- if( (op==TK_AGG_COLUMN || op==TK_COLUMN
- || op==TK_REGISTER || op==TK_TRIGGER)
+ if( op==TK_REGISTER ) op = p->op2;
+ if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_TRIGGER)
&& p->y.pTab!=0
){
/* op==TK_REGISTER && p->y.pTab!=0 happens when pExpr was originally
@@ -96273,7 +96796,7 @@ SQLITE_PRIVATE CollSeq *sqlite3ExprCollSeq(Parse *pParse, Expr *pExpr){
p = p->pLeft;
continue;
}
- if( op==TK_COLLATE || (op==TK_REGISTER && p->op2==TK_COLLATE) ){
+ if( op==TK_COLLATE ){
pColl = sqlite3GetCollSeq(pParse, ENC(db), 0, p->u.zToken);
break;
}
@@ -96580,6 +97103,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprForVectorField(
}else{
if( pVector->op==TK_VECTOR ) pVector = pVector->x.pList->a[iField].pExpr;
pRet = sqlite3ExprDup(pParse->db, pVector, 0);
+ sqlite3RenameTokenRemap(pParse, pRet, pVector);
}
return pRet;
}
@@ -96596,7 +97120,7 @@ static int exprCodeSubselect(Parse *pParse, Expr *pExpr){
int reg = 0;
#ifndef SQLITE_OMIT_SUBQUERY
if( pExpr->op==TK_SELECT ){
- reg = sqlite3CodeSubselect(pParse, pExpr, 0, 0);
+ reg = sqlite3CodeSubselect(pParse, pExpr);
}
#endif
return reg;
@@ -96668,7 +97192,7 @@ static void codeVectorCompare(
int regLeft = 0;
int regRight = 0;
u8 opx = op;
- int addrDone = sqlite3VdbeMakeLabel(v);
+ int addrDone = sqlite3VdbeMakeLabel(pParse);
if( nLeft!=sqlite3ExprVectorSize(pRight) ){
sqlite3ErrorMsg(pParse, "row value misused");
@@ -96895,8 +97419,7 @@ SQLITE_PRIVATE Expr *sqlite3ExprAlloc(
if( pToken->n ) memcpy(pNew->u.zToken, pToken->z, pToken->n);
pNew->u.zToken[pToken->n] = 0;
if( dequote && sqlite3Isquote(pNew->u.zToken[0]) ){
- if( pNew->u.zToken[0]=='"' ) pNew->flags |= EP_DblQuoted;
- sqlite3Dequote(pNew->u.zToken);
+ sqlite3DequoteExpr(pNew);
}
}
}
@@ -96965,7 +97488,7 @@ SQLITE_PRIVATE Expr *sqlite3PExpr(
Expr *pRight /* Right operand */
){
Expr *p;
- if( op==TK_AND && pParse->nErr==0 ){
+ if( op==TK_AND && pParse->nErr==0 && !IN_RENAME_OBJECT ){
/* Take advantage of short-circuit false optimization for AND */
p = sqlite3ExprAnd(pParse->db, pLeft, pRight);
}else{
@@ -97215,6 +97738,16 @@ static int exprStructSize(Expr *p){
}
/*
+** Copy the complete content of an Expr node, taking care not to read
+** past the end of the structure for a reduced-size version of the source
+** Expr.
+*/
+static void exprNodeCopy(Expr *pDest, Expr *pSrc){
+ memset(pDest, 0, sizeof(Expr));
+ memcpy(pDest, pSrc, exprStructSize(pSrc));
+}
+
+/*
** The dupedExpr*Size() routines each return the number of bytes required
** to store a copy of an expression or expression tree. They differ in
** how much of the tree is measured.
@@ -97445,6 +97978,36 @@ static With *withDup(sqlite3 *db, With *p){
# define withDup(x,y) 0
#endif
+#ifndef SQLITE_OMIT_WINDOWFUNC
+/*
+** The gatherSelectWindows() procedure and its helper routine
+** gatherSelectWindowsCallback() are used to scan all the expressions
+** an a newly duplicated SELECT statement and gather all of the Window
+** objects found there, assembling them onto the linked list at Select->pWin.
+*/
+static int gatherSelectWindowsCallback(Walker *pWalker, Expr *pExpr){
+ if( pExpr->op==TK_FUNCTION && pExpr->y.pWin!=0 ){
+ assert( ExprHasProperty(pExpr, EP_WinFunc) );
+ pExpr->y.pWin->pNextWin = pWalker->u.pSelect->pWin;
+ pWalker->u.pSelect->pWin = pExpr->y.pWin;
+ }
+ return WRC_Continue;
+}
+static int gatherSelectWindowsSelectCallback(Walker *pWalker, Select *p){
+ return p==pWalker->u.pSelect ? WRC_Continue : WRC_Prune;
+}
+static void gatherSelectWindows(Select *p){
+ Walker w;
+ w.xExprCallback = gatherSelectWindowsCallback;
+ w.xSelectCallback = gatherSelectWindowsSelectCallback;
+ w.xSelectCallback2 = 0;
+ w.pParse = 0;
+ w.u.pSelect = p;
+ sqlite3WalkSelect(&w, p);
+}
+#endif
+
+
/*
** The following group of routines make deep copies of expressions,
** expression lists, ID lists, and select statements. The copies can
@@ -97612,6 +98175,7 @@ SQLITE_PRIVATE Select *sqlite3SelectDup(sqlite3 *db, Select *pDup, int flags){
#ifndef SQLITE_OMIT_WINDOWFUNC
pNew->pWin = 0;
pNew->pWinDefn = sqlite3WindowListDup(db, p->pWinDefn);
+ if( p->pWin ) gatherSelectWindows(pNew);
#endif
pNew->selId = p->selId;
*pp = pNew;
@@ -97744,6 +98308,9 @@ SQLITE_PRIVATE ExprList *sqlite3ExprListAppendVector(
}
vector_append_error:
+ if( IN_RENAME_OBJECT ){
+ sqlite3RenameExprUnmap(pParse, pExpr);
+ }
sqlite3ExprDelete(db, pExpr);
sqlite3IdListDelete(db, pColumns);
return pList;
@@ -97887,8 +98454,9 @@ SQLITE_PRIVATE int sqlite3SelectWalkFail(Walker *pWalker, Select *NotUsed){
*/
SQLITE_PRIVATE int sqlite3ExprIdToTrueFalse(Expr *pExpr){
assert( pExpr->op==TK_ID || pExpr->op==TK_STRING );
- if( sqlite3StrICmp(pExpr->u.zToken, "true")==0
- || sqlite3StrICmp(pExpr->u.zToken, "false")==0
+ if( !ExprHasProperty(pExpr, EP_Quoted)
+ && (sqlite3StrICmp(pExpr->u.zToken, "true")==0
+ || sqlite3StrICmp(pExpr->u.zToken, "false")==0)
){
pExpr->op = TK_TRUEFALSE;
return 1;
@@ -98197,7 +98765,9 @@ SQLITE_PRIVATE int sqlite3ExprIsInteger(Expr *p, int *pValue){
*/
SQLITE_PRIVATE int sqlite3ExprCanBeNull(const Expr *p){
u8 op;
- while( p->op==TK_UPLUS || p->op==TK_UMINUS ){ p = p->pLeft; }
+ while( p->op==TK_UPLUS || p->op==TK_UMINUS ){
+ p = p->pLeft;
+ }
op = p->op;
if( op==TK_REGISTER ) op = p->op2;
switch( op ){
@@ -98264,14 +98834,6 @@ SQLITE_PRIVATE int sqlite3IsRowid(const char *z){
if( sqlite3StrICmp(z, "OID")==0 ) return 1;
return 0;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE int sqlite3IsRowidN(const char *z, int n){
- if( sqlite3StrNICmp(z, "_ROWID_", n)==0 ) return 1;
- if( sqlite3StrNICmp(z, "ROWID", n)==0 ) return 1;
- if( sqlite3StrNICmp(z, "OID", n)==0 ) return 1;
- return 0;
-}
-#endif
/*
** pX is the RHS of an IN operator. If pX is a SELECT statement
@@ -98441,7 +99003,8 @@ SQLITE_PRIVATE int sqlite3FindInIndex(
Expr *pX, /* The right-hand side (RHS) of the IN operator */
u32 inFlags, /* IN_INDEX_LOOP, _MEMBERSHIP, and/or _NOOP_OK */
int *prRhsHasNull, /* Register holding NULL status. See notes */
- int *aiMap /* Mapping from Index fields to RHS fields */
+ int *aiMap, /* Mapping from Index fields to RHS fields */
+ int *piTab /* OUT: index to use */
){
Select *p; /* SELECT to the right of IN operator */
int eType = 0; /* Type of RHS table. IN_INDEX_* */
@@ -98536,6 +99099,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex(
Bitmask colUsed; /* Columns of the index used */
Bitmask mCol; /* Mask for the current column */
if( pIdx->nColumn<nExpr ) continue;
+ if( pIdx->pPartIdxWhere!=0 ) continue;
/* Maximum nColumn is BMS-2, not BMS-1, so that we can compute
** BITMASK(nExpr) without overflowing */
testcase( pIdx->nColumn==BMS-2 );
@@ -98626,16 +99190,15 @@ SQLITE_PRIVATE int sqlite3FindInIndex(
eType = IN_INDEX_EPH;
if( inFlags & IN_INDEX_LOOP ){
pParse->nQueryLoop = 0;
- if( pX->pLeft->iColumn<0 && !ExprHasProperty(pX, EP_xIsSelect) ){
- eType = IN_INDEX_ROWID;
- }
}else if( prRhsHasNull ){
*prRhsHasNull = rMayHaveNull = ++pParse->nMem;
}
- sqlite3CodeSubselect(pParse, pX, rMayHaveNull, eType==IN_INDEX_ROWID);
+ assert( pX->op==TK_IN );
+ sqlite3CodeRhsOfIN(pParse, pX, iTab);
+ if( rMayHaveNull ){
+ sqlite3SetHasNullFlag(v, iTab, rMayHaveNull);
+ }
pParse->nQueryLoop = savedNQueryLoop;
- }else{
- pX->iTable = iTab;
}
if( aiMap && eType!=IN_INDEX_INDEX_ASC && eType!=IN_INDEX_INDEX_DESC ){
@@ -98643,6 +99206,7 @@ SQLITE_PRIVATE int sqlite3FindInIndex(
n = sqlite3ExprVectorSize(pX->pLeft);
for(i=0; i<n; i++) aiMap[i] = i;
}
+ *piTab = iTab;
return eType;
}
#endif
@@ -98716,260 +99280,303 @@ SQLITE_PRIVATE void sqlite3VectorErrorMsg(Parse *pParse, Expr *pExpr){
}
}
+#ifndef SQLITE_OMIT_SUBQUERY
/*
-** Generate code for scalar subqueries used as a subquery expression, EXISTS,
-** or IN operators. Examples:
+** Generate code that will construct an ephemeral table containing all terms
+** in the RHS of an IN operator. The IN operator can be in either of two
+** forms:
**
-** (SELECT a FROM b) -- subquery
-** EXISTS (SELECT a FROM b) -- EXISTS subquery
** x IN (4,5,11) -- IN operator with list on right-hand side
** x IN (SELECT a FROM b) -- IN operator with subquery on the right
**
-** The pExpr parameter describes the expression that contains the IN
-** operator or subquery.
-**
-** If parameter isRowid is non-zero, then expression pExpr is guaranteed
-** to be of the form "<rowid> IN (?, ?, ?)", where <rowid> is a reference
-** to some integer key column of a table B-Tree. In this case, use an
-** intkey B-Tree to store the set of IN(...) values instead of the usual
-** (slower) variable length keys B-Tree.
-**
-** If rMayHaveNull is non-zero, that means that the operation is an IN
-** (not a SELECT or EXISTS) and that the RHS might contains NULLs.
-** All this routine does is initialize the register given by rMayHaveNull
-** to NULL. Calling routines will take care of changing this register
-** value to non-NULL if the RHS is NULL-free.
-**
-** For a SELECT or EXISTS operator, return the register that holds the
-** result. For a multi-column SELECT, the result is stored in a contiguous
-** array of registers and the return value is the register of the left-most
-** result column. Return 0 for IN operators or if an error occurs.
-*/
-#ifndef SQLITE_OMIT_SUBQUERY
-SQLITE_PRIVATE int sqlite3CodeSubselect(
+** The pExpr parameter is the IN operator. The cursor number for the
+** constructed ephermeral table is returned. The first time the ephemeral
+** table is computed, the cursor number is also stored in pExpr->iTable,
+** however the cursor number returned might not be the same, as it might
+** have been duplicated using OP_OpenDup.
+**
+** If the LHS expression ("x" in the examples) is a column value, or
+** the SELECT statement returns a column value, then the affinity of that
+** column is used to build the index keys. If both 'x' and the
+** SELECT... statement are columns, then numeric affinity is used
+** if either column has NUMERIC or INTEGER affinity. If neither
+** 'x' nor the SELECT... statement are columns, then numeric affinity
+** is used.
+*/
+SQLITE_PRIVATE void sqlite3CodeRhsOfIN(
Parse *pParse, /* Parsing context */
- Expr *pExpr, /* The IN, SELECT, or EXISTS operator */
- int rHasNullFlag, /* Register that records whether NULLs exist in RHS */
- int isRowid /* If true, LHS of IN operator is a rowid */
+ Expr *pExpr, /* The IN operator */
+ int iTab /* Use this cursor number */
){
- int jmpIfDynamic = -1; /* One-time test address */
- int rReg = 0; /* Register storing resulting */
- Vdbe *v = sqlite3GetVdbe(pParse);
- if( NEVER(v==0) ) return 0;
+ int addrOnce = 0; /* Address of the OP_Once instruction at top */
+ int addr; /* Address of OP_OpenEphemeral instruction */
+ Expr *pLeft; /* the LHS of the IN operator */
+ KeyInfo *pKeyInfo = 0; /* Key information */
+ int nVal; /* Size of vector pLeft */
+ Vdbe *v; /* The prepared statement under construction */
- /* The evaluation of the IN/EXISTS/SELECT must be repeated every time it
+ v = pParse->pVdbe;
+ assert( v!=0 );
+
+ /* The evaluation of the IN must be repeated every time it
** is encountered if any of the following is true:
**
** * The right-hand side is a correlated subquery
** * The right-hand side is an expression list containing variables
** * We are inside a trigger
**
- ** If all of the above are false, then we can run this code just once
- ** save the results, and reuse the same result on subsequent invocations.
+ ** If all of the above are false, then we can compute the RHS just once
+ ** and reuse it many names.
*/
- if( !ExprHasProperty(pExpr, EP_VarSelect) ){
- jmpIfDynamic = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
- }
+ if( !ExprHasProperty(pExpr, EP_VarSelect) && pParse->iSelfTab==0 ){
+ /* Reuse of the RHS is allowed */
+ /* If this routine has already been coded, but the previous code
+ ** might not have been invoked yet, so invoke it now as a subroutine.
+ */
+ if( ExprHasProperty(pExpr, EP_Subrtn) ){
+ addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
+ if( ExprHasProperty(pExpr, EP_xIsSelect) ){
+ ExplainQueryPlan((pParse, 0, "REUSE LIST SUBQUERY %d",
+ pExpr->x.pSelect->selId));
+ }
+ sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn,
+ pExpr->y.sub.iAddr);
+ sqlite3VdbeAddOp2(v, OP_OpenDup, iTab, pExpr->iTable);
+ sqlite3VdbeJumpHere(v, addrOnce);
+ return;
+ }
- switch( pExpr->op ){
- case TK_IN: {
- int addr; /* Address of OP_OpenEphemeral instruction */
- Expr *pLeft = pExpr->pLeft; /* the LHS of the IN operator */
- KeyInfo *pKeyInfo = 0; /* Key information */
- int nVal; /* Size of vector pLeft */
-
- nVal = sqlite3ExprVectorSize(pLeft);
- assert( !isRowid || nVal==1 );
+ /* Begin coding the subroutine */
+ ExprSetProperty(pExpr, EP_Subrtn);
+ pExpr->y.sub.regReturn = ++pParse->nMem;
+ pExpr->y.sub.iAddr =
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, pExpr->y.sub.regReturn) + 1;
+ VdbeComment((v, "return address"));
- /* Whether this is an 'x IN(SELECT...)' or an 'x IN(<exprlist>)'
- ** expression it is handled the same way. An ephemeral table is
- ** filled with index keys representing the results from the
- ** SELECT or the <exprlist>.
- **
- ** If the 'x' expression is a column value, or the SELECT...
- ** statement returns a column value, then the affinity of that
- ** column is used to build the index keys. If both 'x' and the
- ** SELECT... statement are columns, then numeric affinity is used
- ** if either column has NUMERIC or INTEGER affinity. If neither
- ** 'x' nor the SELECT... statement are columns, then numeric affinity
- ** is used.
- */
- pExpr->iTable = pParse->nTab++;
- addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral,
- pExpr->iTable, (isRowid?0:nVal));
- pKeyInfo = isRowid ? 0 : sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
+ addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
+ }
- if( ExprHasProperty(pExpr, EP_xIsSelect) ){
- /* Case 1: expr IN (SELECT ...)
- **
- ** Generate code to write the results of the select into the temporary
- ** table allocated and opened above.
- */
- Select *pSelect = pExpr->x.pSelect;
- ExprList *pEList = pSelect->pEList;
-
- ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY",
- jmpIfDynamic>=0?"":"CORRELATED "
- ));
- assert( !isRowid );
- /* If the LHS and RHS of the IN operator do not match, that
- ** error will have been caught long before we reach this point. */
- if( ALWAYS(pEList->nExpr==nVal) ){
- SelectDest dest;
- int i;
- sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable);
- dest.zAffSdst = exprINAffinity(pParse, pExpr);
- pSelect->iLimit = 0;
- testcase( pSelect->selFlags & SF_Distinct );
- testcase( pKeyInfo==0 ); /* Caused by OOM in sqlite3KeyInfoAlloc() */
- if( sqlite3Select(pParse, pSelect, &dest) ){
- sqlite3DbFree(pParse->db, dest.zAffSdst);
- sqlite3KeyInfoUnref(pKeyInfo);
- return 0;
- }
- sqlite3DbFree(pParse->db, dest.zAffSdst);
- assert( pKeyInfo!=0 ); /* OOM will cause exit after sqlite3Select() */
- assert( pEList!=0 );
- assert( pEList->nExpr>0 );
- assert( sqlite3KeyInfoIsWriteable(pKeyInfo) );
- for(i=0; i<nVal; i++){
- Expr *p = sqlite3VectorFieldSubexpr(pLeft, i);
- pKeyInfo->aColl[i] = sqlite3BinaryCompareCollSeq(
- pParse, p, pEList->a[i].pExpr
- );
- }
- }
- }else if( ALWAYS(pExpr->x.pList!=0) ){
- /* Case 2: expr IN (exprlist)
- **
- ** For each expression, build an index key from the evaluation and
- ** store it in the temporary table. If <expr> is a column, then use
- ** that columns affinity when building index keys. If <expr> is not
- ** a column, use numeric affinity.
- */
- char affinity; /* Affinity of the LHS of the IN */
- int i;
- ExprList *pList = pExpr->x.pList;
- struct ExprList_item *pItem;
- int r1, r2, r3;
- affinity = sqlite3ExprAffinity(pLeft);
- if( !affinity ){
- affinity = SQLITE_AFF_BLOB;
- }
- if( pKeyInfo ){
- assert( sqlite3KeyInfoIsWriteable(pKeyInfo) );
- pKeyInfo->aColl[0] = sqlite3ExprCollSeq(pParse, pExpr->pLeft);
- }
+ /* Check to see if this is a vector IN operator */
+ pLeft = pExpr->pLeft;
+ nVal = sqlite3ExprVectorSize(pLeft);
- /* Loop through each expression in <exprlist>. */
- r1 = sqlite3GetTempReg(pParse);
- r2 = sqlite3GetTempReg(pParse);
- if( isRowid ) sqlite3VdbeAddOp4(v, OP_Blob, 0, r2, 0, "", P4_STATIC);
- for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
- Expr *pE2 = pItem->pExpr;
- int iValToIns;
-
- /* If the expression is not constant then we will need to
- ** disable the test that was generated above that makes sure
- ** this code only executes once. Because for a non-constant
- ** expression we need to rerun this code each time.
- */
- if( jmpIfDynamic>=0 && !sqlite3ExprIsConstant(pE2) ){
- sqlite3VdbeChangeToNoop(v, jmpIfDynamic);
- jmpIfDynamic = -1;
- }
+ /* Construct the ephemeral table that will contain the content of
+ ** RHS of the IN operator.
+ */
+ pExpr->iTable = iTab;
+ addr = sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pExpr->iTable, nVal);
+#ifdef SQLITE_ENABLE_EXPLAIN_COMMENTS
+ if( ExprHasProperty(pExpr, EP_xIsSelect) ){
+ VdbeComment((v, "Result of SELECT %u", pExpr->x.pSelect->selId));
+ }else{
+ VdbeComment((v, "RHS of IN operator"));
+ }
+#endif
+ pKeyInfo = sqlite3KeyInfoAlloc(pParse->db, nVal, 1);
- /* Evaluate the expression and insert it into the temp table */
- if( isRowid && sqlite3ExprIsInteger(pE2, &iValToIns) ){
- sqlite3VdbeAddOp3(v, OP_InsertInt, pExpr->iTable, r2, iValToIns);
- }else{
- r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
- if( isRowid ){
- sqlite3VdbeAddOp2(v, OP_MustBeInt, r3,
- sqlite3VdbeCurrentAddr(v)+2);
- VdbeCoverage(v);
- sqlite3VdbeAddOp3(v, OP_Insert, pExpr->iTable, r2, r3);
- }else{
- sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
- sqlite3VdbeAddOp4Int(v, OP_IdxInsert, pExpr->iTable, r2, r3, 1);
- }
- }
- }
- sqlite3ReleaseTempReg(pParse, r1);
- sqlite3ReleaseTempReg(pParse, r2);
+ if( ExprHasProperty(pExpr, EP_xIsSelect) ){
+ /* Case 1: expr IN (SELECT ...)
+ **
+ ** Generate code to write the results of the select into the temporary
+ ** table allocated and opened above.
+ */
+ Select *pSelect = pExpr->x.pSelect;
+ ExprList *pEList = pSelect->pEList;
+
+ ExplainQueryPlan((pParse, 1, "%sLIST SUBQUERY %d",
+ addrOnce?"":"CORRELATED ", pSelect->selId
+ ));
+ /* If the LHS and RHS of the IN operator do not match, that
+ ** error will have been caught long before we reach this point. */
+ if( ALWAYS(pEList->nExpr==nVal) ){
+ SelectDest dest;
+ int i;
+ sqlite3SelectDestInit(&dest, SRT_Set, iTab);
+ dest.zAffSdst = exprINAffinity(pParse, pExpr);
+ pSelect->iLimit = 0;
+ testcase( pSelect->selFlags & SF_Distinct );
+ testcase( pKeyInfo==0 ); /* Caused by OOM in sqlite3KeyInfoAlloc() */
+ if( sqlite3Select(pParse, pSelect, &dest) ){
+ sqlite3DbFree(pParse->db, dest.zAffSdst);
+ sqlite3KeyInfoUnref(pKeyInfo);
+ return;
}
- if( pKeyInfo ){
- sqlite3VdbeChangeP4(v, addr, (void *)pKeyInfo, P4_KEYINFO);
+ sqlite3DbFree(pParse->db, dest.zAffSdst);
+ assert( pKeyInfo!=0 ); /* OOM will cause exit after sqlite3Select() */
+ assert( pEList!=0 );
+ assert( pEList->nExpr>0 );
+ assert( sqlite3KeyInfoIsWriteable(pKeyInfo) );
+ for(i=0; i<nVal; i++){
+ Expr *p = sqlite3VectorFieldSubexpr(pLeft, i);
+ pKeyInfo->aColl[i] = sqlite3BinaryCompareCollSeq(
+ pParse, p, pEList->a[i].pExpr
+ );
}
- break;
+ }
+ }else if( ALWAYS(pExpr->x.pList!=0) ){
+ /* Case 2: expr IN (exprlist)
+ **
+ ** For each expression, build an index key from the evaluation and
+ ** store it in the temporary table. If <expr> is a column, then use
+ ** that columns affinity when building index keys. If <expr> is not
+ ** a column, use numeric affinity.
+ */
+ char affinity; /* Affinity of the LHS of the IN */
+ int i;
+ ExprList *pList = pExpr->x.pList;
+ struct ExprList_item *pItem;
+ int r1, r2, r3;
+ affinity = sqlite3ExprAffinity(pLeft);
+ if( !affinity ){
+ affinity = SQLITE_AFF_BLOB;
+ }
+ if( pKeyInfo ){
+ assert( sqlite3KeyInfoIsWriteable(pKeyInfo) );
+ pKeyInfo->aColl[0] = sqlite3ExprCollSeq(pParse, pExpr->pLeft);
}
- case TK_EXISTS:
- case TK_SELECT:
- default: {
- /* Case 3: (SELECT ... FROM ...)
- ** or: EXISTS(SELECT ... FROM ...)
- **
- ** For a SELECT, generate code to put the values for all columns of
- ** the first row into an array of registers and return the index of
- ** the first register.
- **
- ** If this is an EXISTS, write an integer 0 (not exists) or 1 (exists)
- ** into a register and return that register number.
- **
- ** In both cases, the query is augmented with "LIMIT 1". Any
- ** preexisting limit is discarded in place of the new LIMIT 1.
+ /* Loop through each expression in <exprlist>. */
+ r1 = sqlite3GetTempReg(pParse);
+ r2 = sqlite3GetTempReg(pParse);
+ for(i=pList->nExpr, pItem=pList->a; i>0; i--, pItem++){
+ Expr *pE2 = pItem->pExpr;
+
+ /* If the expression is not constant then we will need to
+ ** disable the test that was generated above that makes sure
+ ** this code only executes once. Because for a non-constant
+ ** expression we need to rerun this code each time.
*/
- Select *pSel; /* SELECT statement to encode */
- SelectDest dest; /* How to deal with SELECT result */
- int nReg; /* Registers to allocate */
- Expr *pLimit; /* New limit expression */
-
- testcase( pExpr->op==TK_EXISTS );
- testcase( pExpr->op==TK_SELECT );
- assert( pExpr->op==TK_EXISTS || pExpr->op==TK_SELECT );
- assert( ExprHasProperty(pExpr, EP_xIsSelect) );
-
- pSel = pExpr->x.pSelect;
- ExplainQueryPlan((pParse, 1, "%sSCALAR SUBQUERY",
- jmpIfDynamic>=0?"":"CORRELATED "));
- nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1;
- sqlite3SelectDestInit(&dest, 0, pParse->nMem+1);
- pParse->nMem += nReg;
- if( pExpr->op==TK_SELECT ){
- dest.eDest = SRT_Mem;
- dest.iSdst = dest.iSDParm;
- dest.nSdst = nReg;
- sqlite3VdbeAddOp3(v, OP_Null, 0, dest.iSDParm, dest.iSDParm+nReg-1);
- VdbeComment((v, "Init subquery result"));
- }else{
- dest.eDest = SRT_Exists;
- sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
- VdbeComment((v, "Init EXISTS result"));
- }
- pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[1], 0);
- if( pSel->pLimit ){
- sqlite3ExprDelete(pParse->db, pSel->pLimit->pLeft);
- pSel->pLimit->pLeft = pLimit;
- }else{
- pSel->pLimit = sqlite3PExpr(pParse, TK_LIMIT, pLimit, 0);
- }
- pSel->iLimit = 0;
- if( sqlite3Select(pParse, pSel, &dest) ){
- return 0;
+ if( addrOnce && !sqlite3ExprIsConstant(pE2) ){
+ sqlite3VdbeChangeToNoop(v, addrOnce);
+ addrOnce = 0;
}
- rReg = dest.iSDParm;
- ExprSetVVAProperty(pExpr, EP_NoReduce);
- break;
+
+ /* Evaluate the expression and insert it into the temp table */
+ r3 = sqlite3ExprCodeTarget(pParse, pE2, r1);
+ sqlite3VdbeAddOp4(v, OP_MakeRecord, r3, 1, r2, &affinity, 1);
+ sqlite3VdbeAddOp4Int(v, OP_IdxInsert, iTab, r2, r3, 1);
}
+ sqlite3ReleaseTempReg(pParse, r1);
+ sqlite3ReleaseTempReg(pParse, r2);
}
+ if( pKeyInfo ){
+ sqlite3VdbeChangeP4(v, addr, (void *)pKeyInfo, P4_KEYINFO);
+ }
+ if( addrOnce ){
+ sqlite3VdbeJumpHere(v, addrOnce);
+ /* Subroutine return */
+ sqlite3VdbeAddOp1(v, OP_Return, pExpr->y.sub.regReturn);
+ sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1);
+ }
+}
+#endif /* SQLITE_OMIT_SUBQUERY */
- if( rHasNullFlag ){
- sqlite3SetHasNullFlag(v, pExpr->iTable, rHasNullFlag);
+/*
+** Generate code for scalar subqueries used as a subquery expression
+** or EXISTS operator:
+**
+** (SELECT a FROM b) -- subquery
+** EXISTS (SELECT a FROM b) -- EXISTS subquery
+**
+** The pExpr parameter is the SELECT or EXISTS operator to be coded.
+**
+** The register that holds the result. For a multi-column SELECT,
+** the result is stored in a contiguous array of registers and the
+** return value is the register of the left-most result column.
+** Return 0 if an error occurs.
+*/
+#ifndef SQLITE_OMIT_SUBQUERY
+SQLITE_PRIVATE int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
+ int addrOnce = 0; /* Address of OP_Once at top of subroutine */
+ int rReg = 0; /* Register storing resulting */
+ Select *pSel; /* SELECT statement to encode */
+ SelectDest dest; /* How to deal with SELECT result */
+ int nReg; /* Registers to allocate */
+ Expr *pLimit; /* New limit expression */
+
+ Vdbe *v = pParse->pVdbe;
+ assert( v!=0 );
+ testcase( pExpr->op==TK_EXISTS );
+ testcase( pExpr->op==TK_SELECT );
+ assert( pExpr->op==TK_EXISTS || pExpr->op==TK_SELECT );
+ assert( ExprHasProperty(pExpr, EP_xIsSelect) );
+ pSel = pExpr->x.pSelect;
+
+ /* The evaluation of the EXISTS/SELECT must be repeated every time it
+ ** is encountered if any of the following is true:
+ **
+ ** * The right-hand side is a correlated subquery
+ ** * The right-hand side is an expression list containing variables
+ ** * We are inside a trigger
+ **
+ ** If all of the above are false, then we can run this code just once
+ ** save the results, and reuse the same result on subsequent invocations.
+ */
+ if( !ExprHasProperty(pExpr, EP_VarSelect) ){
+ /* If this routine has already been coded, then invoke it as a
+ ** subroutine. */
+ if( ExprHasProperty(pExpr, EP_Subrtn) ){
+ ExplainQueryPlan((pParse, 0, "REUSE SUBQUERY %d", pSel->selId));
+ sqlite3VdbeAddOp2(v, OP_Gosub, pExpr->y.sub.regReturn,
+ pExpr->y.sub.iAddr);
+ return pExpr->iTable;
+ }
+
+ /* Begin coding the subroutine */
+ ExprSetProperty(pExpr, EP_Subrtn);
+ pExpr->y.sub.regReturn = ++pParse->nMem;
+ pExpr->y.sub.iAddr =
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, pExpr->y.sub.regReturn) + 1;
+ VdbeComment((v, "return address"));
+
+ addrOnce = sqlite3VdbeAddOp0(v, OP_Once); VdbeCoverage(v);
+ }
+
+ /* For a SELECT, generate code to put the values for all columns of
+ ** the first row into an array of registers and return the index of
+ ** the first register.
+ **
+ ** If this is an EXISTS, write an integer 0 (not exists) or 1 (exists)
+ ** into a register and return that register number.
+ **
+ ** In both cases, the query is augmented with "LIMIT 1". Any
+ ** preexisting limit is discarded in place of the new LIMIT 1.
+ */
+ ExplainQueryPlan((pParse, 1, "%sSCALAR SUBQUERY %d",
+ addrOnce?"":"CORRELATED ", pSel->selId));
+ nReg = pExpr->op==TK_SELECT ? pSel->pEList->nExpr : 1;
+ sqlite3SelectDestInit(&dest, 0, pParse->nMem+1);
+ pParse->nMem += nReg;
+ if( pExpr->op==TK_SELECT ){
+ dest.eDest = SRT_Mem;
+ dest.iSdst = dest.iSDParm;
+ dest.nSdst = nReg;
+ sqlite3VdbeAddOp3(v, OP_Null, 0, dest.iSDParm, dest.iSDParm+nReg-1);
+ VdbeComment((v, "Init subquery result"));
+ }else{
+ dest.eDest = SRT_Exists;
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, dest.iSDParm);
+ VdbeComment((v, "Init EXISTS result"));
+ }
+ pLimit = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[1], 0);
+ if( pSel->pLimit ){
+ sqlite3ExprDelete(pParse->db, pSel->pLimit->pLeft);
+ pSel->pLimit->pLeft = pLimit;
+ }else{
+ pSel->pLimit = sqlite3PExpr(pParse, TK_LIMIT, pLimit, 0);
}
+ pSel->iLimit = 0;
+ if( sqlite3Select(pParse, pSel, &dest) ){
+ return 0;
+ }
+ pExpr->iTable = rReg = dest.iSDParm;
+ ExprSetVVAProperty(pExpr, EP_NoReduce);
+ if( addrOnce ){
+ sqlite3VdbeJumpHere(v, addrOnce);
- if( jmpIfDynamic>=0 ){
- sqlite3VdbeJumpHere(v, jmpIfDynamic);
+ /* Subroutine return */
+ sqlite3VdbeAddOp1(v, OP_Return, pExpr->y.sub.regReturn);
+ sqlite3VdbeChangeP1(v, pExpr->y.sub.iAddr-1, sqlite3VdbeCurrentAddr(v)-1);
}
return rReg;
@@ -99046,6 +99653,7 @@ static void sqlite3ExprCodeIN(
int addrTruthOp; /* Address of opcode that determines the IN is true */
int destNotNull; /* Jump here if a comparison is not true in step 6 */
int addrTop; /* Top of the step-6 loop */
+ int iTab = 0; /* Index to use */
pLeft = pExpr->pLeft;
if( sqlite3ExprCheckIN(pParse, pExpr) ) return;
@@ -99057,7 +99665,7 @@ static void sqlite3ExprCodeIN(
if( pParse->db->mallocFailed ) goto sqlite3ExprCodeIN_oom_error;
/* Attempt to compute the RHS. After this step, if anything other than
- ** IN_INDEX_NOOP is returned, the table opened ith cursor pExpr->iTable
+ ** IN_INDEX_NOOP is returned, the table opened with cursor iTab
** contains the values that make up the RHS. If IN_INDEX_NOOP is returned,
** the RHS has not yet been coded. */
v = pParse->pVdbe;
@@ -99065,7 +99673,8 @@ static void sqlite3ExprCodeIN(
VdbeNoopComment((v, "begin IN expr"));
eType = sqlite3FindInIndex(pParse, pExpr,
IN_INDEX_MEMBERSHIP | IN_INDEX_NOOP_OK,
- destIfFalse==destIfNull ? 0 : &rRhsHasNull, aiMap);
+ destIfFalse==destIfNull ? 0 : &rRhsHasNull,
+ aiMap, &iTab);
assert( pParse->nErr || nVector==1 || eType==IN_INDEX_EPH
|| eType==IN_INDEX_INDEX_ASC || eType==IN_INDEX_INDEX_DESC
@@ -99111,7 +99720,7 @@ static void sqlite3ExprCodeIN(
if( eType==IN_INDEX_NOOP ){
ExprList *pList = pExpr->x.pList;
CollSeq *pColl = sqlite3ExprCollSeq(pParse, pExpr->pLeft);
- int labelOk = sqlite3VdbeMakeLabel(v);
+ int labelOk = sqlite3VdbeMakeLabel(pParse);
int r2, regToFree;
int regCkNull = 0;
int ii;
@@ -99155,7 +99764,7 @@ static void sqlite3ExprCodeIN(
if( destIfNull==destIfFalse ){
destStep2 = destIfFalse;
}else{
- destStep2 = destStep6 = sqlite3VdbeMakeLabel(v);
+ destStep2 = destStep6 = sqlite3VdbeMakeLabel(pParse);
}
for(i=0; i<nVector; i++){
Expr *p = sqlite3VectorFieldSubexpr(pExpr->pLeft, i);
@@ -99173,19 +99782,19 @@ static void sqlite3ExprCodeIN(
/* In this case, the RHS is the ROWID of table b-tree and so we also
** know that the RHS is non-NULL. Hence, we combine steps 3 and 4
** into a single opcode. */
- sqlite3VdbeAddOp3(v, OP_SeekRowid, pExpr->iTable, destIfFalse, rLhs);
+ sqlite3VdbeAddOp3(v, OP_SeekRowid, iTab, destIfFalse, rLhs);
VdbeCoverage(v);
addrTruthOp = sqlite3VdbeAddOp0(v, OP_Goto); /* Return True */
}else{
sqlite3VdbeAddOp4(v, OP_Affinity, rLhs, nVector, 0, zAff, nVector);
if( destIfFalse==destIfNull ){
/* Combine Step 3 and Step 5 into a single opcode */
- sqlite3VdbeAddOp4Int(v, OP_NotFound, pExpr->iTable, destIfFalse,
+ sqlite3VdbeAddOp4Int(v, OP_NotFound, iTab, destIfFalse,
rLhs, nVector); VdbeCoverage(v);
goto sqlite3ExprCodeIN_finished;
}
/* Ordinary Step 3, for the case where FALSE and NULL are distinct */
- addrTruthOp = sqlite3VdbeAddOp4Int(v, OP_Found, pExpr->iTable, 0,
+ addrTruthOp = sqlite3VdbeAddOp4Int(v, OP_Found, iTab, 0,
rLhs, nVector); VdbeCoverage(v);
}
@@ -99210,10 +99819,10 @@ static void sqlite3ExprCodeIN(
** of the RHS.
*/
if( destStep6 ) sqlite3VdbeResolveLabel(v, destStep6);
- addrTop = sqlite3VdbeAddOp2(v, OP_Rewind, pExpr->iTable, destIfFalse);
+ addrTop = sqlite3VdbeAddOp2(v, OP_Rewind, iTab, destIfFalse);
VdbeCoverage(v);
if( nVector>1 ){
- destNotNull = sqlite3VdbeMakeLabel(v);
+ destNotNull = sqlite3VdbeMakeLabel(pParse);
}else{
/* For nVector==1, combine steps 6 and 7 by immediately returning
** FALSE if the first comparison is not NULL */
@@ -99225,7 +99834,7 @@ static void sqlite3ExprCodeIN(
int r3 = sqlite3GetTempReg(pParse);
p = sqlite3VectorFieldSubexpr(pLeft, i);
pColl = sqlite3ExprCollSeq(pParse, p);
- sqlite3VdbeAddOp3(v, OP_Column, pExpr->iTable, i, r3);
+ sqlite3VdbeAddOp3(v, OP_Column, iTab, i, r3);
sqlite3VdbeAddOp4(v, OP_Ne, rLhs+i, destNotNull, r3,
(void*)pColl, P4_COLLSEQ);
VdbeCoverage(v);
@@ -99234,7 +99843,7 @@ static void sqlite3ExprCodeIN(
sqlite3VdbeAddOp2(v, OP_Goto, 0, destIfNull);
if( nVector>1 ){
sqlite3VdbeResolveLabel(v, destNotNull);
- sqlite3VdbeAddOp2(v, OP_Next, pExpr->iTable, addrTop+1);
+ sqlite3VdbeAddOp2(v, OP_Next, iTab, addrTop+1);
VdbeCoverage(v);
/* Step 7: If we reach this point, we know that the result must
@@ -99433,7 +100042,7 @@ static int exprCodeVector(Parse *pParse, Expr *p, int *piFreeable){
#if SQLITE_OMIT_SUBQUERY
iResult = 0;
#else
- iResult = sqlite3CodeSubselect(pParse, p, 0, 0);
+ iResult = sqlite3CodeSubselect(pParse, p);
#endif
}else{
int i;
@@ -99778,7 +100387,7 @@ expr_code_doover:
** arguments past the first non-NULL argument.
*/
if( pDef->funcFlags & SQLITE_FUNC_COALESCE ){
- int endCoalesce = sqlite3VdbeMakeLabel(v);
+ int endCoalesce = sqlite3VdbeMakeLabel(pParse);
assert( nFarg>=2 );
sqlite3ExprCode(pParse, pFarg->a[0].pExpr, target);
for(i=1; i<nFarg; i++){
@@ -99907,14 +100516,14 @@ expr_code_doover:
if( op==TK_SELECT && (nCol = pExpr->x.pSelect->pEList->nExpr)!=1 ){
sqlite3SubselectError(pParse, nCol, 1);
}else{
- return sqlite3CodeSubselect(pParse, pExpr, 0, 0);
+ return sqlite3CodeSubselect(pParse, pExpr);
}
break;
}
case TK_SELECT_COLUMN: {
int n;
if( pExpr->pLeft->iTable==0 ){
- pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft, 0, 0);
+ pExpr->pLeft->iTable = sqlite3CodeSubselect(pParse, pExpr->pLeft);
}
assert( pExpr->iTable==0 || pExpr->pLeft->op==TK_SELECT );
if( pExpr->iTable
@@ -99926,8 +100535,8 @@ expr_code_doover:
return pExpr->pLeft->iTable + pExpr->iColumn;
}
case TK_IN: {
- int destIfFalse = sqlite3VdbeMakeLabel(v);
- int destIfNull = sqlite3VdbeMakeLabel(v);
+ int destIfFalse = sqlite3VdbeMakeLabel(pParse);
+ int destIfNull = sqlite3VdbeMakeLabel(pParse);
sqlite3VdbeAddOp2(v, OP_Null, 0, target);
sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull);
sqlite3VdbeAddOp2(v, OP_Integer, 1, target);
@@ -100067,9 +100676,9 @@ expr_code_doover:
pEList = pExpr->x.pList;
aListelem = pEList->a;
nExpr = pEList->nExpr;
- endLabel = sqlite3VdbeMakeLabel(v);
+ endLabel = sqlite3VdbeMakeLabel(pParse);
if( (pX = pExpr->pLeft)!=0 ){
- tempX = *pX;
+ exprNodeCopy(&tempX, pX);
testcase( pX->op==TK_COLUMN );
exprToRegister(&tempX, exprCodeVector(pParse, &tempX, &regFree1));
testcase( regFree1==0 );
@@ -100090,7 +100699,7 @@ expr_code_doover:
}else{
pTest = aListelem[i].pExpr;
}
- nextCase = sqlite3VdbeMakeLabel(v);
+ nextCase = sqlite3VdbeMakeLabel(pParse);
testcase( pTest->op==TK_COLUMN );
sqlite3ExprIfFalse(pParse, pTest, nextCase, SQLITE_JUMPIFNULL);
testcase( aListelem[i+1].pExpr->op==TK_COLUMN );
@@ -100390,13 +100999,12 @@ static void exprCodeBetween(
Expr exprX; /* The x subexpression */
int regFree1 = 0; /* Temporary use register */
-
memset(&compLeft, 0, sizeof(Expr));
memset(&compRight, 0, sizeof(Expr));
memset(&exprAnd, 0, sizeof(Expr));
assert( !ExprHasProperty(pExpr, EP_xIsSelect) );
- exprX = *pExpr->pLeft;
+ exprNodeCopy(&exprX, pExpr->pLeft);
exprAnd.op = TK_AND;
exprAnd.pLeft = &compLeft;
exprAnd.pRight = &compRight;
@@ -100459,7 +101067,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int
op = pExpr->op;
switch( op ){
case TK_AND: {
- int d2 = sqlite3VdbeMakeLabel(v);
+ int d2 = sqlite3VdbeMakeLabel(pParse);
testcase( jumpIfNull==0 );
sqlite3ExprIfFalse(pParse, pExpr->pLeft, d2,jumpIfNull^SQLITE_JUMPIFNULL);
sqlite3ExprIfTrue(pParse, pExpr->pRight, dest, jumpIfNull);
@@ -100545,7 +101153,7 @@ SQLITE_PRIVATE void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int
}
#ifndef SQLITE_OMIT_SUBQUERY
case TK_IN: {
- int destIfFalse = sqlite3VdbeMakeLabel(v);
+ int destIfFalse = sqlite3VdbeMakeLabel(pParse);
int destIfNull = jumpIfNull ? dest : destIfFalse;
sqlite3ExprCodeIN(pParse, pExpr, destIfFalse, destIfNull);
sqlite3VdbeGoto(v, dest);
@@ -100632,7 +101240,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int
break;
}
case TK_OR: {
- int d2 = sqlite3VdbeMakeLabel(v);
+ int d2 = sqlite3VdbeMakeLabel(pParse);
testcase( jumpIfNull==0 );
sqlite3ExprIfTrue(pParse, pExpr->pLeft, d2, jumpIfNull^SQLITE_JUMPIFNULL);
sqlite3ExprIfFalse(pParse, pExpr->pRight, dest, jumpIfNull);
@@ -100716,7 +101324,7 @@ SQLITE_PRIVATE void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int
if( jumpIfNull ){
sqlite3ExprCodeIN(pParse, pExpr, dest, dest);
}else{
- int destIfNull = sqlite3VdbeMakeLabel(v);
+ int destIfNull = sqlite3VdbeMakeLabel(pParse);
sqlite3ExprCodeIN(pParse, pExpr, dest, destIfNull);
sqlite3VdbeResolveLabel(v, destIfNull);
}
@@ -100837,7 +101445,7 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTa
}
return 2;
}
- if( pA->op!=pB->op ){
+ if( pA->op!=pB->op || pA->op==TK_RAISE ){
if( pA->op==TK_COLLATE && sqlite3ExprCompare(pParse, pA->pLeft,pB,iTab)<2 ){
return 1;
}
@@ -100863,21 +101471,25 @@ SQLITE_PRIVATE int sqlite3ExprCompare(Parse *pParse, Expr *pA, Expr *pB, int iTa
if( sqlite3WindowCompare(pParse,pA->y.pWin,pB->y.pWin)!=0 ) return 2;
}
#endif
+ }else if( pA->op==TK_NULL ){
+ return 0;
}else if( pA->op==TK_COLLATE ){
if( sqlite3_stricmp(pA->u.zToken,pB->u.zToken)!=0 ) return 2;
- }else if( strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
+ }else if( ALWAYS(pB->u.zToken!=0) && strcmp(pA->u.zToken,pB->u.zToken)!=0 ){
return 2;
}
}
if( (pA->flags & EP_Distinct)!=(pB->flags & EP_Distinct) ) return 2;
- if( ALWAYS((combinedFlags & EP_TokenOnly)==0) ){
+ if( (combinedFlags & EP_TokenOnly)==0 ){
if( combinedFlags & EP_xIsSelect ) return 2;
if( (combinedFlags & EP_FixedCol)==0
&& sqlite3ExprCompare(pParse, pA->pLeft, pB->pLeft, iTab) ) return 2;
if( sqlite3ExprCompare(pParse, pA->pRight, pB->pRight, iTab) ) return 2;
if( sqlite3ExprListCompare(pA->x.pList, pB->x.pList, iTab) ) return 2;
- assert( (combinedFlags & EP_Reduced)==0 );
- if( pA->op!=TK_STRING && pA->op!=TK_TRUEFALSE ){
+ if( pA->op!=TK_STRING
+ && pA->op!=TK_TRUEFALSE
+ && (combinedFlags & EP_Reduced)==0
+ ){
if( pA->iColumn!=pB->iColumn ) return 2;
if( pA->iTable!=pB->iTable
&& (pA->iTable!=iTab || NEVER(pB->iTable>=0)) ) return 2;
@@ -100986,6 +101598,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
case TK_ISNOT:
case TK_NOT:
case TK_ISNULL:
+ case TK_NOTNULL:
case TK_IS:
case TK_OR:
case TK_CASE:
@@ -100994,6 +101607,7 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){
testcase( pExpr->op==TK_ISNOT );
testcase( pExpr->op==TK_NOT );
testcase( pExpr->op==TK_ISNULL );
+ testcase( pExpr->op==TK_NOTNULL );
testcase( pExpr->op==TK_IS );
testcase( pExpr->op==TK_OR );
testcase( pExpr->op==TK_CASE );
@@ -101367,6 +101981,7 @@ SQLITE_PRIVATE void sqlite3ExprAnalyzeAggregates(NameContext *pNC, Expr *pExpr){
w.xSelectCallback2 = analyzeAggregatesInSelectEnd;
w.walkerDepth = 0;
w.u.pNC = pNC;
+ w.pParse = 0;
assert( pNC->pSrcList!=0 );
sqlite3WalkExpr(&w, pExpr);
}
@@ -101498,9 +102113,16 @@ SQLITE_PRIVATE int sqlite3NoTempsInRange(Parse *pParse, int iFirst, int iLast){
**
** Or, if zName is not a system table, zero is returned.
*/
-static int isSystemTable(Parse *pParse, const char *zName){
- if( 0==sqlite3StrNICmp(zName, "sqlite_", 7) ){
- sqlite3ErrorMsg(pParse, "table %s may not be altered", zName);
+static int isAlterableTable(Parse *pParse, Table *pTab){
+ if( 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7)
+#ifndef SQLITE_OMIT_VIRTUALTABLE
+ || ( (pTab->tabFlags & TF_Shadow)
+ && (pParse->db->flags & SQLITE_Defensive)
+ && pParse->db->nVdbeExec==0
+ )
+#endif
+ ){
+ sqlite3ErrorMsg(pParse, "table %s may not be altered", pTab->zName);
return 1;
}
return 0;
@@ -101596,7 +102218,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameTable(
/* Make sure it is not a system table being altered, or a reserved name
** that the table is being renamed to.
*/
- if( SQLITE_OK!=isSystemTable(pParse, pTab->zName) ){
+ if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){
goto exit_rename_table;
}
if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto
@@ -101894,7 +102516,7 @@ SQLITE_PRIVATE void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
sqlite3ErrorMsg(pParse, "Cannot add a column to a view");
goto exit_begin_add_column;
}
- if( SQLITE_OK!=isSystemTable(pParse, pTab->zName) ){
+ if( SQLITE_OK!=isAlterableTable(pParse, pTab) ){
goto exit_begin_add_column;
}
@@ -101996,7 +102618,7 @@ SQLITE_PRIVATE void sqlite3AlterRenameColumn(
if( !pTab ) goto exit_rename_column;
/* Cannot alter a system table */
- if( SQLITE_OK!=isSystemTable(pParse, pTab->zName) ) goto exit_rename_column;
+ if( SQLITE_OK!=isAlterableTable(pParse, pTab) ) goto exit_rename_column;
if( SQLITE_OK!=isRealTable(pParse, pTab) ) goto exit_rename_column;
/* Which schema holds the table to be altered */
@@ -102251,13 +102873,30 @@ static void renameTokenFind(Parse *pParse, struct RenameCtx *pCtx, void *pPtr){
}
/*
+** Iterate through the Select objects that are part of WITH clauses attached
+** to select statement pSelect.
+*/
+static void renameWalkWith(Walker *pWalker, Select *pSelect){
+ if( pSelect->pWith ){
+ int i;
+ for(i=0; i<pSelect->pWith->nCte; i++){
+ Select *p = pSelect->pWith->a[i].pSelect;
+ NameContext sNC;
+ memset(&sNC, 0, sizeof(sNC));
+ sNC.pParse = pWalker->pParse;
+ sqlite3SelectPrep(sNC.pParse, p, &sNC);
+ sqlite3WalkSelect(pWalker, p);
+ }
+ }
+}
+
+/*
** This is a Walker select callback. It does nothing. It is only required
** because without a dummy callback, sqlite3WalkExpr() and similar do not
** descend into sub-select statements.
*/
static int renameColumnSelectCb(Walker *pWalker, Select *p){
- UNUSED_PARAMETER(pWalker);
- UNUSED_PARAMETER(p);
+ renameWalkWith(pWalker, p);
return WRC_Continue;
}
@@ -102407,7 +103046,6 @@ static int renameParseSql(
rc = sqlite3RunParser(p, zSql, &zErr);
assert( p->zErrMsg==0 );
assert( rc!=SQLITE_OK || zErr==0 );
- assert( (0!=p->pNewTable) + (0!=p->pNewIndex) + (0!=p->pNewTrigger)<2 );
p->zErrMsg = zErr;
if( db->mallocFailed ) rc = SQLITE_NOMEM;
if( rc==SQLITE_OK
@@ -102590,6 +103228,7 @@ static int renameResolveTrigger(Parse *pParse, const char *zDb){
}
sNC.ncFlags = 0;
}
+ sNC.pSrcList = 0;
}
}
}
@@ -102627,11 +103266,15 @@ static void renameWalkTrigger(Walker *pWalker, Trigger *pTrigger){
*/
static void renameParseCleanup(Parse *pParse){
sqlite3 *db = pParse->db;
+ Index *pIdx;
if( pParse->pVdbe ){
sqlite3VdbeFinalize(pParse->pVdbe);
}
sqlite3DeleteTable(db, pParse->pNewTable);
- if( pParse->pNewIndex ) sqlite3FreeIndex(db, pParse->pNewIndex);
+ while( (pIdx = pParse->pNewIndex)!=0 ){
+ pParse->pNewIndex = pIdx->pNext;
+ sqlite3FreeIndex(db, pIdx);
+ }
sqlite3DeleteTrigger(db, pParse->pNewTrigger);
sqlite3DbFree(db, pParse->zErrMsg);
renameTokenFree(db, pParse->pRename);
@@ -102742,6 +103385,9 @@ static void renameColumnFunc(
for(pIdx=sParse.pNewTable->pIndex; pIdx; pIdx=pIdx->pNext){
sqlite3WalkExprList(&sWalker, pIdx->aColExpr);
}
+ for(pIdx=sParse.pNewIndex; pIdx; pIdx=pIdx->pNext){
+ sqlite3WalkExprList(&sWalker, pIdx->aColExpr);
+ }
}
for(pFKey=sParse.pNewTable->pFKey; pFKey; pFKey=pFKey->pNextFrom){
@@ -102828,12 +103474,17 @@ static int renameTableSelectCb(Walker *pWalker, Select *pSelect){
int i;
RenameCtx *p = pWalker->u.pRename;
SrcList *pSrc = pSelect->pSrc;
+ if( pSrc==0 ){
+ assert( pWalker->pParse->db->mallocFailed );
+ return WRC_Abort;
+ }
for(i=0; i<pSrc->nSrc; i++){
struct SrcList_item *pItem = &pSrc->a[i];
if( pItem->pTab==p->pTab ){
renameTokenFind(pWalker->pParse, p, pItem->zName);
}
}
+ renameWalkWith(pWalker, pSelect);
return WRC_Continue;
}
@@ -104235,7 +104886,7 @@ static void analyzeOneTable(
addrNextRow = sqlite3VdbeCurrentAddr(v);
if( nColTest>0 ){
- int endDistinctTest = sqlite3VdbeMakeLabel(v);
+ int endDistinctTest = sqlite3VdbeMakeLabel(pParse);
int *aGotoChng; /* Array of jump instruction addresses */
aGotoChng = sqlite3DbMallocRawNN(db, sizeof(int)*nColTest);
if( aGotoChng==0 ) continue;
@@ -105173,8 +105824,8 @@ static void attachFunc(
assert( pVfs );
flags |= SQLITE_OPEN_MAIN_DB;
rc = sqlite3BtreeOpen(pVfs, zPath, db, &pNew->pBt, 0, flags);
- sqlite3_free( zPath );
db->nDb++;
+ pNew->zDbSName = sqlite3DbStrDup(db, zName);
}
db->noSharedCache = 0;
if( rc==SQLITE_CONSTRAINT ){
@@ -105202,7 +105853,6 @@ static void attachFunc(
sqlite3BtreeLeave(pNew->pBt);
}
pNew->safety_level = SQLITE_DEFAULT_SYNCHRONOUS+1;
- if( !REOPEN_AS_MEMDB(db) ) pNew->zDbSName = sqlite3DbStrDup(db, zName);
if( rc==SQLITE_OK && pNew->zDbSName==0 ){
rc = SQLITE_NOMEM_BKPT;
}
@@ -105230,15 +105880,19 @@ static void attachFunc(
break;
case SQLITE_NULL:
- /* No key specified. Use the key from the main database */
- sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
- if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
- rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
+ /* No key specified. Use the key from URI filename, or if none,
+ ** use the key from the main database. */
+ if( sqlite3CodecQueryParameters(db, zName, zPath)==0 ){
+ sqlite3CodecGetKey(db, 0, (void**)&zKey, &nKey);
+ if( nKey || sqlite3BtreeGetOptimalReserve(db->aDb[0].pBt)>0 ){
+ rc = sqlite3CodecAttach(db, db->nDb-1, zKey, nKey);
+ }
}
break;
}
}
#endif
+ sqlite3_free( zPath );
/* If the file was opened successfully, read the schema for the new database.
** If this fails, or if opening the file failed, then close the file and
@@ -106150,7 +106804,7 @@ SQLITE_PRIVATE void sqlite3FinishCoding(Parse *pParse){
if( v && pParse->nErr==0 && !db->mallocFailed ){
/* A minimum of one cursor is required if autoincrement is used
* See ticket [a696379c1f08866] */
- if( pParse->pAinc!=0 && pParse->nTab==0 ) pParse->nTab = 1;
+ assert( pParse->pAinc==0 || pParse->nTab>0 );
sqlite3VdbeMakeReady(v, pParse);
pParse->rc = SQLITE_DONE;
}else{
@@ -106277,26 +106931,32 @@ SQLITE_PRIVATE Table *sqlite3LocateTable(
p = sqlite3FindTable(db, zName, zDbase);
if( p==0 ){
- const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table";
#ifndef SQLITE_OMIT_VIRTUALTABLE
/* If zName is the not the name of a table in the schema created using
** CREATE, then check to see if it is the name of an virtual table that
** can be an eponymous virtual table. */
- Module *pMod = (Module*)sqlite3HashFind(&db->aModule, zName);
- if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){
- pMod = sqlite3PragmaVtabRegister(db, zName);
- }
- if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
- return pMod->pEpoTab;
+ if( pParse->disableVtab==0 ){
+ Module *pMod = (Module*)sqlite3HashFind(&db->aModule, zName);
+ if( pMod==0 && sqlite3_strnicmp(zName, "pragma_", 7)==0 ){
+ pMod = sqlite3PragmaVtabRegister(db, zName);
+ }
+ if( pMod && sqlite3VtabEponymousTableInit(pParse, pMod) ){
+ return pMod->pEpoTab;
+ }
}
#endif
- if( (flags & LOCATE_NOERR)==0 ){
- if( zDbase ){
- sqlite3ErrorMsg(pParse, "%s: %s.%s", zMsg, zDbase, zName);
- }else{
- sqlite3ErrorMsg(pParse, "%s: %s", zMsg, zName);
- }
- pParse->checkSchema = 1;
+ if( flags & LOCATE_NOERR ) return 0;
+ pParse->checkSchema = 1;
+ }else if( IsVirtual(p) && pParse->disableVtab ){
+ p = 0;
+ }
+
+ if( p==0 ){
+ const char *zMsg = flags & LOCATE_VIEW ? "no such view" : "no such table";
+ if( zDbase ){
+ sqlite3ErrorMsg(pParse, "%s: %s.%s", zMsg, zDbase, zName);
+ }else{
+ sqlite3ErrorMsg(pParse, "%s: %s", zMsg, zName);
}
}
@@ -106559,12 +107219,6 @@ static void SQLITE_NOINLINE deleteTable(sqlite3 *db, Table *pTable){
/* Delete the Table structure itself.
*/
-#ifdef SQLITE_ENABLE_NORMALIZE
- if( pTable->pColHash ){
- sqlite3HashClear(pTable->pColHash);
- sqlite3_free(pTable->pColHash);
- }
-#endif
sqlite3DeleteColumnNames(db, pTable);
sqlite3DbFree(db, pTable->zName);
sqlite3DbFree(db, pTable->zColAff);
@@ -108561,6 +109215,7 @@ SQLITE_PRIVATE void sqlite3CodeDropTable(Parse *pParse, Table *pTab, int iDb, in
*/
if( IsVirtual(pTab) ){
sqlite3VdbeAddOp4(v, OP_VDestroy, iDb, 0, 0, pTab->zName, 0);
+ sqlite3MayAbort(pParse);
}
sqlite3VdbeAddOp4(v, OP_DropTable, iDb, 0, 0, pTab->zName, 0);
sqlite3ChangeCookie(pParse, iDb);
@@ -109389,6 +110044,11 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
}
}
if( idxType==SQLITE_IDXTYPE_PRIMARYKEY ) pIdx->idxType = idxType;
+ if( IN_RENAME_OBJECT ){
+ pIndex->pNext = pParse->pNewIndex;
+ pParse->pNewIndex = pIndex;
+ pIndex = 0;
+ }
goto exit_create_index;
}
}
@@ -109404,6 +110064,14 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
Index *p;
assert( !IN_SPECIAL_PARSE );
assert( sqlite3SchemaMutexHeld(db, 0, pIndex->pSchema) );
+ if( pTblName!=0 ){
+ pIndex->tnum = db->init.newTnum;
+ if( sqlite3IndexHasDuplicateRootPage(pIndex) ){
+ sqlite3ErrorMsg(pParse, "invalid rootpage");
+ pParse->rc = SQLITE_CORRUPT_BKPT;
+ goto exit_create_index;
+ }
+ }
p = sqlite3HashInsert(&pIndex->pSchema->idxHash,
pIndex->zName, pIndex);
if( p ){
@@ -109412,9 +110080,6 @@ SQLITE_PRIVATE void sqlite3CreateIndex(
goto exit_create_index;
}
db->mDbFlags |= DBFLAG_SchemaChange;
- if( pTblName!=0 ){
- pIndex->tnum = db->init.newTnum;
- }
}
/* If this is the initial CREATE INDEX statement (or CREATE TABLE if the
@@ -109741,6 +110406,18 @@ SQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
}
/*
+** Maximum size of a SrcList object.
+** The SrcList object is used to represent the FROM clause of a
+** SELECT statement, and the query planner cannot deal with more
+** than 64 tables in a join. So any value larger than 64 here
+** is sufficient for most uses. Smaller values, like say 10, are
+** appropriate for small and memory-limited applications.
+*/
+#ifndef SQLITE_MAX_SRCLIST
+# define SQLITE_MAX_SRCLIST 200
+#endif
+
+/*
** Expand the space allocated for the given SrcList object by
** creating nExtra new slots beginning at iStart. iStart is zero based.
** New slots are zeroed.
@@ -109756,11 +110433,12 @@ SQLITE_PRIVATE int sqlite3IdListIndex(IdList *pList, const char *zName){
** the iStart value would be 0. The result then would
** be: nil, nil, nil, A, B.
**
-** If a memory allocation fails the SrcList is unchanged. The
-** db->mallocFailed flag will be set to true.
+** If a memory allocation fails or the SrcList becomes too large, leave
+** the original SrcList unchanged, return NULL, and leave an error message
+** in pParse.
*/
SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(
- sqlite3 *db, /* Database connection to notify of OOM errors */
+ Parse *pParse, /* Parsing context into which errors are reported */
SrcList *pSrc, /* The SrcList to be enlarged */
int nExtra, /* Number of new slots to add to pSrc->a[] */
int iStart /* Index in pSrc->a[] of first new slot */
@@ -109777,16 +110455,22 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(
if( (u32)pSrc->nSrc+nExtra>pSrc->nAlloc ){
SrcList *pNew;
int nAlloc = pSrc->nSrc*2+nExtra;
- int nGot;
+ sqlite3 *db = pParse->db;
+
+ if( pSrc->nSrc+nExtra>=SQLITE_MAX_SRCLIST ){
+ sqlite3ErrorMsg(pParse, "too many FROM clause terms, max: %d",
+ SQLITE_MAX_SRCLIST);
+ return 0;
+ }
+ if( nAlloc>SQLITE_MAX_SRCLIST ) nAlloc = SQLITE_MAX_SRCLIST;
pNew = sqlite3DbRealloc(db, pSrc,
sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) );
if( pNew==0 ){
assert( db->mallocFailed );
- return pSrc;
+ return 0;
}
pSrc = pNew;
- nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1;
- pSrc->nAlloc = nGot;
+ pSrc->nAlloc = nAlloc;
}
/* Move existing slots that come after the newly inserted slots
@@ -109811,7 +110495,8 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(
** Append a new table name to the given SrcList. Create a new SrcList if
** need be. A new entry is created in the SrcList even if pTable is NULL.
**
-** A SrcList is returned, or NULL if there is an OOM error. The returned
+** A SrcList is returned, or NULL if there is an OOM error or if the
+** SrcList grows to large. The returned
** SrcList might be the same as the SrcList that was input or it might be
** a new one. If an OOM error does occurs, then the prior value of pList
** that is input to this routine is automatically freed.
@@ -109842,27 +110527,32 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListEnlarge(
** before being added to the SrcList.
*/
SQLITE_PRIVATE SrcList *sqlite3SrcListAppend(
- sqlite3 *db, /* Connection to notify of malloc failures */
+ Parse *pParse, /* Parsing context, in which errors are reported */
SrcList *pList, /* Append to this SrcList. NULL creates a new SrcList */
Token *pTable, /* Table to append */
Token *pDatabase /* Database of the table */
){
struct SrcList_item *pItem;
+ sqlite3 *db;
assert( pDatabase==0 || pTable!=0 ); /* Cannot have C without B */
- assert( db!=0 );
+ assert( pParse!=0 );
+ assert( pParse->db!=0 );
+ db = pParse->db;
if( pList==0 ){
- pList = sqlite3DbMallocRawNN(db, sizeof(SrcList) );
+ pList = sqlite3DbMallocRawNN(pParse->db, sizeof(SrcList) );
if( pList==0 ) return 0;
pList->nAlloc = 1;
pList->nSrc = 1;
memset(&pList->a[0], 0, sizeof(pList->a[0]));
pList->a[0].iCursor = -1;
}else{
- pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc);
- }
- if( db->mallocFailed ){
- sqlite3SrcListDelete(db, pList);
- return 0;
+ SrcList *pNew = sqlite3SrcListEnlarge(pParse, pList, 1, pList->nSrc);
+ if( pNew==0 ){
+ sqlite3SrcListDelete(db, pList);
+ return 0;
+ }else{
+ pList = pNew;
+ }
}
pItem = &pList->a[pList->nSrc-1];
if( pDatabase && pDatabase->z==0 ){
@@ -109951,7 +110641,7 @@ SQLITE_PRIVATE SrcList *sqlite3SrcListAppendFromTerm(
);
goto append_from_error;
}
- p = sqlite3SrcListAppend(db, p, pTable, pDatabase);
+ p = sqlite3SrcListAppend(pParse, p, pTable, pDatabase);
if( p==0 ){
goto append_from_error;
}
@@ -110340,13 +111030,15 @@ static int collationMatch(const char *zColl, Index *pIndex){
*/
#ifndef SQLITE_OMIT_REINDEX
static void reindexTable(Parse *pParse, Table *pTab, char const *zColl){
- Index *pIndex; /* An index associated with pTab */
+ if( !IsVirtual(pTab) ){
+ Index *pIndex; /* An index associated with pTab */
- for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
- if( zColl==0 || collationMatch(zColl, pIndex) ){
- int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
- sqlite3BeginWriteOperation(pParse, 0, iDb);
- sqlite3RefillIndex(pParse, pIndex, -1);
+ for(pIndex=pTab->pIndex; pIndex; pIndex=pIndex->pNext){
+ if( zColl==0 || collationMatch(zColl, pIndex) ){
+ int iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema);
+ sqlite3BeginWriteOperation(pParse, 0, iDb);
+ sqlite3RefillIndex(pParse, pIndex, -1);
+ }
}
}
}
@@ -110845,7 +111537,7 @@ static int matchQuality(
** Search a FuncDefHash for a function with the given name. Return
** a pointer to the matching FuncDef if found, or 0 if there is no match.
*/
-static FuncDef *functionSearch(
+SQLITE_PRIVATE FuncDef *sqlite3FunctionSearch(
int h, /* Hash of the name */
const char *zFunc /* Name of function */
){
@@ -110857,21 +111549,6 @@ static FuncDef *functionSearch(
}
return 0;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-SQLITE_PRIVATE FuncDef *sqlite3FunctionSearchN(
- int h, /* Hash of the name */
- const char *zFunc, /* Name of function */
- int nFunc /* Length of the name */
-){
- FuncDef *p;
- for(p=sqlite3BuiltinFunctions.a[h]; p; p=p->u.pHash){
- if( sqlite3StrNICmp(p->zName, zFunc, nFunc)==0 ){
- return p;
- }
- }
- return 0;
-}
-#endif /* SQLITE_ENABLE_NORMALIZE */
/*
** Insert a new FuncDef into a FuncDefHash hash table.
@@ -110887,7 +111564,7 @@ SQLITE_PRIVATE void sqlite3InsertBuiltinFuncs(
int nName = sqlite3Strlen30(zName);
int h = SQLITE_FUNC_HASH(zName[0], nName);
assert( zName[0]>='a' && zName[0]<='z' );
- pOther = functionSearch(h, zName);
+ pOther = sqlite3FunctionSearch(h, zName);
if( pOther ){
assert( pOther!=&aDef[i] && pOther->pNext!=&aDef[i] );
aDef[i].pNext = pOther->pNext;
@@ -110965,7 +111642,7 @@ SQLITE_PRIVATE FuncDef *sqlite3FindFunction(
if( !createFlag && (pBest==0 || (db->mDbFlags & DBFLAG_PreferBuiltin)!=0) ){
bestScore = 0;
h = SQLITE_FUNC_HASH(sqlite3UpperToLower[(u8)zName[0]], nName);
- p = functionSearch(h, zName);
+ p = sqlite3FunctionSearch(h, zName);
while( p ){
int score = matchQuality(p, nArg, enc);
if( score>bestScore ){
@@ -111185,7 +111862,7 @@ SQLITE_PRIVATE void sqlite3MaterializeView(
sqlite3 *db = pParse->db;
int iDb = sqlite3SchemaToIndex(db, pView->pSchema);
pWhere = sqlite3ExprDup(db, pWhere, 0);
- pFrom = sqlite3SrcListAppend(db, 0, 0, 0);
+ pFrom = sqlite3SrcListAppend(pParse, 0, 0, 0);
if( pFrom ){
assert( pFrom->nSrc==1 );
pFrom->a[0].zName = sqlite3DbStrDup(db, pView->zName);
@@ -111585,7 +112262,7 @@ SQLITE_PRIVATE void sqlite3DeleteFrom(
/* If this DELETE cannot use the ONEPASS strategy, this is the
** end of the WHERE loop */
if( eOnePass!=ONEPASS_OFF ){
- addrBypass = sqlite3VdbeMakeLabel(v);
+ addrBypass = sqlite3VdbeMakeLabel(pParse);
}else{
sqlite3WhereEnd(pWInfo);
}
@@ -111774,7 +112451,7 @@ SQLITE_PRIVATE void sqlite3GenerateRowDelete(
/* Seek cursor iCur to the row to delete. If this row no longer exists
** (this can happen if a trigger program has already deleted it), do
** not attempt to delete it or fire any DELETE triggers. */
- iLabel = sqlite3VdbeMakeLabel(v);
+ iLabel = sqlite3VdbeMakeLabel(pParse);
opSeek = HasRowid(pTab) ? OP_NotExists : OP_NotFound;
if( eMode==ONEPASS_OFF ){
sqlite3VdbeAddOp4Int(v, opSeek, iDataCur, iLabel, iPk, nPk);
@@ -111980,7 +112657,7 @@ SQLITE_PRIVATE int sqlite3GenerateIndexKey(
if( piPartIdxLabel ){
if( pIdx->pPartIdxWhere ){
- *piPartIdxLabel = sqlite3VdbeMakeLabel(v);
+ *piPartIdxLabel = sqlite3VdbeMakeLabel(pParse);
pParse->iSelfTab = iDataCur + 1;
sqlite3ExprIfFalseDup(pParse, pIdx->pPartIdxWhere, *piPartIdxLabel,
SQLITE_JUMPIFNULL);
@@ -112236,6 +112913,7 @@ static void instrFunc(
int typeHaystack, typeNeedle;
int N = 1;
int isText;
+ unsigned char firstChar;
UNUSED_PARAMETER(argc);
typeHaystack = sqlite3_value_type(argv[0]);
@@ -112254,7 +112932,10 @@ static void instrFunc(
isText = 1;
}
if( zNeedle==0 || (nHaystack && zHaystack==0) ) return;
- while( nNeedle<=nHaystack && memcmp(zHaystack, zNeedle, nNeedle)!=0 ){
+ firstChar = zNeedle[0];
+ while( nNeedle<=nHaystack
+ && (zHaystack[0]!=firstChar || memcmp(zHaystack, zNeedle, nNeedle)!=0)
+ ){
N++;
do{
nHaystack--;
@@ -112545,11 +113226,11 @@ static void randomBlob(
int argc,
sqlite3_value **argv
){
- int n;
+ sqlite3_int64 n;
unsigned char *p;
assert( argc==1 );
UNUSED_PARAMETER(argc);
- n = sqlite3_value_int(argv[0]);
+ n = sqlite3_value_int64(argv[0]);
if( n<1 ){
n = 1;
}
@@ -114385,7 +115066,7 @@ static void fkLookupParent(
int i; /* Iterator variable */
Vdbe *v = sqlite3GetVdbe(pParse); /* Vdbe to add code to */
int iCur = pParse->nTab - 1; /* Cursor number to use */
- int iOk = sqlite3VdbeMakeLabel(v); /* jump here if parent key found */
+ int iOk = sqlite3VdbeMakeLabel(pParse); /* jump here if parent key found */
sqlite3VdbeVerifyAbortable(v,
(!pFKey->isDeferred
@@ -114658,8 +115339,11 @@ static void fkScanChildren(
** NOT( $current_a==a AND $current_b==b AND ... )
**
** The first form is used for rowid tables. The second form is used
- ** for WITHOUT ROWID tables. In the second form, the primary key is
- ** (a,b,...)
+ ** for WITHOUT ROWID tables. In the second form, the *parent* key is
+ ** (a,b,...). Either the parent or primary key could be used to
+ ** uniquely identify the current row, but the parent key is more convenient
+ ** as the required values have already been loaded into registers
+ ** by the caller.
*/
if( pTab==pFKey->pFrom && nIncr>0 ){
Expr *pNe; /* Expression (pLeft != pRight) */
@@ -114671,14 +115355,13 @@ static void fkScanChildren(
pNe = sqlite3PExpr(pParse, TK_NE, pLeft, pRight);
}else{
Expr *pEq, *pAll = 0;
- Index *pPk = sqlite3PrimaryKeyIndex(pTab);
assert( pIdx!=0 );
- for(i=0; i<pPk->nKeyCol; i++){
+ for(i=0; i<pIdx->nKeyCol; i++){
i16 iCol = pIdx->aiColumn[i];
assert( iCol>=0 );
pLeft = exprTableRegister(pParse, pTab, regData, iCol);
- pRight = exprTableColumn(db, pTab, pSrc->a[0].iCursor, iCol);
- pEq = sqlite3PExpr(pParse, TK_EQ, pLeft, pRight);
+ pRight = sqlite3Expr(db, TK_ID, pTab->aCol[iCol].zName);
+ pEq = sqlite3PExpr(pParse, TK_IS, pLeft, pRight);
pAll = sqlite3ExprAnd(db, pAll, pEq);
}
pNe = sqlite3PExpr(pParse, TK_NOT, pAll, 0);
@@ -114783,7 +115466,7 @@ SQLITE_PRIVATE void sqlite3FkDropTable(Parse *pParse, SrcList *pName, Table *pTa
if( p->isDeferred || (db->flags & SQLITE_DeferFKs) ) break;
}
if( !p ) return;
- iSkip = sqlite3VdbeMakeLabel(v);
+ iSkip = sqlite3VdbeMakeLabel(pParse);
sqlite3VdbeAddOp2(v, OP_FkIfZero, 1, iSkip); VdbeCoverage(v);
}
@@ -115068,7 +115751,7 @@ SQLITE_PRIVATE void sqlite3FkCheck(
/* Create a SrcList structure containing the child table. We need the
** child table as a SrcList for sqlite3WhereBegin() */
- pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
+ pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
if( pSrc ){
struct SrcList_item *pItem = pSrc->a;
pItem->pTab = pFKey->pFrom;
@@ -115345,7 +116028,7 @@ static Trigger *fkActionTrigger(
}
pSelect = sqlite3SelectNew(pParse,
sqlite3ExprListAppend(pParse, 0, pRaise),
- sqlite3SrcListAppend(db, 0, &tFrom, 0),
+ sqlite3SrcListAppend(pParse, 0, &tFrom, 0),
pWhere,
0, 0, 0, 0, 0
);
@@ -115807,6 +116490,7 @@ SQLITE_PRIVATE void sqlite3AutoincrementBegin(Parse *pParse){
aOp[7].p2 = memId+2;
aOp[7].p1 = memId;
aOp[10].p2 = memId;
+ if( pParse->nTab==0 ) pParse->nTab = 1;
}
}
@@ -116313,6 +116997,11 @@ SQLITE_PRIVATE void sqlite3Insert(
}
#ifndef SQLITE_OMIT_UPSERT
if( pUpsert ){
+ if( IsVirtual(pTab) ){
+ sqlite3ErrorMsg(pParse, "UPSERT not implemented for virtual table \"%s\"",
+ pTab->zName);
+ goto insert_cleanup;
+ }
pTabList->a[0].iCursor = iDataCur;
pUpsert->pUpsertSrc = pTabList;
pUpsert->regData = regData;
@@ -116353,7 +117042,7 @@ SQLITE_PRIVATE void sqlite3Insert(
/* Run the BEFORE and INSTEAD OF triggers, if there are any
*/
- endOfLoop = sqlite3VdbeMakeLabel(v);
+ endOfLoop = sqlite3VdbeMakeLabel(pParse);
if( tmask & TRIGGER_BEFORE ){
int regCols = sqlite3GetTempRange(pParse, pTab->nCol+1);
@@ -116435,16 +117124,12 @@ SQLITE_PRIVATE void sqlite3Insert(
}else if( pSelect ){
sqlite3VdbeAddOp2(v, OP_Copy, regFromSelect+ipkColumn, regRowid);
}else{
- VdbeOp *pOp;
- sqlite3ExprCode(pParse, pList->a[ipkColumn].pExpr, regRowid);
- pOp = sqlite3VdbeGetOp(v, -1);
- assert( pOp!=0 );
- if( pOp->opcode==OP_Null && !IsVirtual(pTab) ){
+ Expr *pIpk = pList->a[ipkColumn].pExpr;
+ if( pIpk->op==TK_NULL && !IsVirtual(pTab) ){
+ sqlite3VdbeAddOp3(v, OP_NewRowid, iDataCur, regRowid, regAutoinc);
appendFlag = 1;
- pOp->opcode = OP_NewRowid;
- pOp->p1 = iDataCur;
- pOp->p2 = regRowid;
- pOp->p3 = regAutoinc;
+ }else{
+ sqlite3ExprCode(pParse, pList->a[ipkColumn].pExpr, regRowid);
}
}
/* If the PRIMARY KEY expression is NULL, then use OP_NewRowid
@@ -116839,7 +117524,20 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
}
assert( onError==OE_Rollback || onError==OE_Abort || onError==OE_Fail
|| onError==OE_Ignore || onError==OE_Replace );
+ addr1 = 0;
switch( onError ){
+ case OE_Replace: {
+ assert( onError==OE_Replace );
+ addr1 = sqlite3VdbeMakeLabel(pParse);
+ sqlite3VdbeAddOp2(v, OP_NotNull, regNewData+1+i, addr1);
+ VdbeCoverage(v);
+ sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+i);
+ sqlite3VdbeAddOp2(v, OP_NotNull, regNewData+1+i, addr1);
+ VdbeCoverage(v);
+ onError = OE_Abort;
+ /* Fall through into the OE_Abort case to generate code that runs
+ ** if both the input and the default value are NULL */
+ }
case OE_Abort:
sqlite3MayAbort(pParse);
/* Fall through */
@@ -116852,21 +117550,15 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
sqlite3VdbeAppendP4(v, zMsg, P4_DYNAMIC);
sqlite3VdbeChangeP5(v, P5_ConstraintNotNull);
VdbeCoverage(v);
+ if( addr1 ) sqlite3VdbeResolveLabel(v, addr1);
break;
}
- case OE_Ignore: {
+ default: {
+ assert( onError==OE_Ignore );
sqlite3VdbeAddOp2(v, OP_IsNull, regNewData+1+i, ignoreDest);
VdbeCoverage(v);
break;
}
- default: {
- assert( onError==OE_Replace );
- addr1 = sqlite3VdbeAddOp1(v, OP_NotNull, regNewData+1+i);
- VdbeCoverage(v);
- sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, regNewData+1+i);
- sqlite3VdbeJumpHere(v, addr1);
- break;
- }
}
}
@@ -116887,7 +117579,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
** updated so there is no point it verifying the check constraint */
continue;
}
- allOk = sqlite3VdbeMakeLabel(v);
+ allOk = sqlite3VdbeMakeLabel(pParse);
sqlite3VdbeVerifyAbortable(v, onError);
sqlite3ExprIfTrue(pParse, pExpr, allOk, SQLITE_JUMPIFNULL);
if( onError==OE_Ignore ){
@@ -116954,7 +117646,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
** exist in the table.
*/
if( pkChng && pPk==0 ){
- int addrRowidOk = sqlite3VdbeMakeLabel(v);
+ int addrRowidOk = sqlite3VdbeMakeLabel(pParse);
/* Figure out what action to take in case of a rowid collision */
onError = pTab->keyConf;
@@ -117104,7 +117796,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
VdbeComment((v, "Skip upsert subroutine"));
sqlite3VdbeJumpHere(v, upsertJump);
}else{
- addrUniqueOk = sqlite3VdbeMakeLabel(v);
+ addrUniqueOk = sqlite3VdbeMakeLabel(pParse);
}
if( bAffinityDone==0 && (pUpIdx==0 || pUpIdx==pIdx) ){
sqlite3TableAffinity(v, pTab, regNewData+1);
@@ -117187,7 +117879,11 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
** (3) There are no secondary indexes on the table
** (4) No delete triggers need to be fired if there is a conflict
** (5) No FK constraint counters need to be updated if a conflict occurs.
- */
+ **
+ ** This is not possible for ENABLE_PREUPDATE_HOOK builds, as the row
+ ** must be explicitly deleted in order to ensure any pre-update hook
+ ** is invoked. */
+#ifndef SQLITE_ENABLE_PREUPDATE_HOOK
if( (ix==0 && pIdx->pNext==0) /* Condition 3 */
&& pPk==pIdx /* Condition 2 */
&& onError==OE_Replace /* Condition 1 */
@@ -117199,6 +117895,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
sqlite3VdbeResolveLabel(v, addrUniqueOk);
continue;
}
+#endif /* ifndef SQLITE_ENABLE_PREUPDATE_HOOK */
/* Check to see if the new index entry will be unique */
sqlite3VdbeVerifyAbortable(v, onError);
@@ -117312,7 +118009,7 @@ SQLITE_PRIVATE void sqlite3GenerateConstraintChecks(
/* If the IPK constraint is a REPLACE, run it last */
if( ipkTop ){
- sqlite3VdbeGoto(v, ipkTop+1);
+ sqlite3VdbeGoto(v, ipkTop);
VdbeComment((v, "Do IPK REPLACE"));
sqlite3VdbeJumpHere(v, ipkBottom);
}
@@ -117393,10 +118090,13 @@ SQLITE_PRIVATE void sqlite3CompleteInsertion(
pik_flags |= (update_flags & OPFLAG_SAVEPOSITION);
#ifdef SQLITE_ENABLE_PREUPDATE_HOOK
if( update_flags==0 ){
- sqlite3VdbeAddOp4(v, OP_InsertInt,
- iIdxCur+i, aRegIdx[i], 0, (char*)pTab, P4_TABLE
+ int r = sqlite3GetTempReg(pParse);
+ sqlite3VdbeAddOp2(v, OP_Integer, 0, r);
+ sqlite3VdbeAddOp4(v, OP_Insert,
+ iIdxCur+i, aRegIdx[i], r, (char*)pTab, P4_TABLE
);
sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
+ sqlite3ReleaseTempReg(pParse, r);
}
#endif
}
@@ -117682,7 +118382,8 @@ static int xferOptimization(
if( pSrc==0 ){
return 0; /* FROM clause does not contain a real table */
}
- if( pSrc==pDest ){
+ if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
+ testcase( pSrc!=pDest ); /* Possible due to bad sqlite_master.rootpage */
return 0; /* tab1 and tab2 may not be the same table */
}
if( HasRowid(pDest)!=HasRowid(pSrc) ){
@@ -117958,7 +118659,7 @@ SQLITE_API int sqlite3_exec(
sqlite3_mutex_enter(db->mutex);
sqlite3Error(db, SQLITE_OK);
while( rc==SQLITE_OK && zSql[0] ){
- int nCol;
+ int nCol = 0;
char **azVals = 0;
pStmt = 0;
@@ -117972,9 +118673,7 @@ SQLITE_API int sqlite3_exec(
zSql = zLeftover;
continue;
}
-
callbackIsInit = 0;
- nCol = sqlite3_column_count(pStmt);
while( 1 ){
int i;
@@ -117985,6 +118684,7 @@ SQLITE_API int sqlite3_exec(
(SQLITE_DONE==rc && !callbackIsInit
&& db->flags&SQLITE_NullCallback)) ){
if( !callbackIsInit ){
+ nCol = sqlite3_column_count(pStmt);
azCols = sqlite3DbMallocRaw(db, (2*nCol+1)*sizeof(const char*));
if( azCols==0 ){
goto exec_out;
@@ -119339,7 +120039,7 @@ SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff){
if( onoff ){
db->flags |= SQLITE_LoadExtension|SQLITE_LoadExtFunc;
}else{
- db->flags &= ~(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
+ db->flags &= ~(u64)(SQLITE_LoadExtension|SQLITE_LoadExtFunc);
}
sqlite3_mutex_leave(db->mutex);
return SQLITE_OK;
@@ -119598,8 +120298,7 @@ SQLITE_PRIVATE void sqlite3AutoLoadExtensions(sqlite3 *db){
#define PragTyp_HEXKEY 41
#define PragTyp_KEY 42
#define PragTyp_LOCK_STATUS 43
-#define PragTyp_PARSER_TRACE 44
-#define PragTyp_STATS 45
+#define PragTyp_STATS 44
/* Property flags associated with various pragma. */
#define PragFlg_NeedSchema 0x01 /* Force schema load before running */
@@ -120010,12 +120709,14 @@ static const PragmaName aPragmaName[] = {
/* ColNames: */ 0, 0,
/* iArg: */ 0 },
#endif
-#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)
+#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
+#if defined(SQLITE_DEBUG)
{/* zName: */ "parser_trace",
- /* ePragTyp: */ PragTyp_PARSER_TRACE,
- /* ePragFlg: */ 0,
+ /* ePragTyp: */ PragTyp_FLAG,
+ /* ePragFlg: */ PragFlg_Result0|PragFlg_NoColumns1,
/* ColNames: */ 0, 0,
- /* iArg: */ 0 },
+ /* iArg: */ SQLITE_ParserTrace },
+#endif
#endif
#if defined(SQLITE_INTROSPECTION_PRAGMAS)
{/* zName: */ "pragma_list",
@@ -121006,7 +121707,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
if( sqlite3GetBoolean(zRight, size!=0) ){
db->flags |= SQLITE_CacheSpill;
}else{
- db->flags &= ~SQLITE_CacheSpill;
+ db->flags &= ~(u64)SQLITE_CacheSpill;
}
setAllPagerFlags(db);
}
@@ -121566,7 +122267,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
x = sqlite3FkLocateIndex(pParse, pParent, pFK, &pIdx, &aiCols);
assert( x==0 );
}
- addrOk = sqlite3VdbeMakeLabel(v);
+ addrOk = sqlite3VdbeMakeLabel(pParse);
/* Generate code to read the child key values into registers
** regRow..regRow+n. If any of the child key values are NULL, this
@@ -121611,19 +122312,6 @@ SQLITE_PRIVATE void sqlite3Pragma(
#endif /* !defined(SQLITE_OMIT_TRIGGER) */
#endif /* !defined(SQLITE_OMIT_FOREIGN_KEY) */
-#ifndef NDEBUG
- case PragTyp_PARSER_TRACE: {
- if( zRight ){
- if( sqlite3GetBoolean(zRight, 0) ){
- sqlite3ParserTrace(stdout, "parser: ");
- }else{
- sqlite3ParserTrace(0, 0);
- }
- }
- }
- break;
-#endif
-
/* Reinstall the LIKE and GLOB functions. The variant of LIKE
** used will be case sensitive or not depending on the RHS.
*/
@@ -121786,8 +122474,8 @@ SQLITE_PRIVATE void sqlite3Pragma(
if( pTab->pCheck && (db->flags & SQLITE_IgnoreChecks)==0 ){
ExprList *pCheck = sqlite3ExprListDup(db, pTab->pCheck, 0);
if( db->mallocFailed==0 ){
- int addrCkFault = sqlite3VdbeMakeLabel(v);
- int addrCkOk = sqlite3VdbeMakeLabel(v);
+ int addrCkFault = sqlite3VdbeMakeLabel(pParse);
+ int addrCkOk = sqlite3VdbeMakeLabel(pParse);
char *zErr;
int k;
pParse->iSelfTab = iDataCur + 1;
@@ -121810,7 +122498,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
/* Validate index entries for the current row */
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
int jmp2, jmp3, jmp4, jmp5;
- int ckUniq = sqlite3VdbeMakeLabel(v);
+ int ckUniq = sqlite3VdbeMakeLabel(pParse);
if( pPk==pIdx ) continue;
r1 = sqlite3GenerateIndexKey(pParse, pIdx, iDataCur, 0, 0, &jmp3,
pPrior, r1);
@@ -121831,7 +122519,7 @@ SQLITE_PRIVATE void sqlite3Pragma(
** current key. The entry is unique if (1) any column is NULL
** or (2) the next entry has a different key */
if( IsUniqueIndex(pIdx) ){
- int uniqOk = sqlite3VdbeMakeLabel(v);
+ int uniqOk = sqlite3VdbeMakeLabel(pParse);
int jmp6;
int kk;
for(kk=0; kk<pIdx->nKeyCol; kk++){
@@ -122746,6 +123434,19 @@ static void corruptSchema(
}
/*
+** Check to see if any sibling index (another index on the same table)
+** of pIndex has the same root page number, and if it does, return true.
+** This would indicate a corrupt schema.
+*/
+SQLITE_PRIVATE int sqlite3IndexHasDuplicateRootPage(Index *pIndex){
+ Index *p;
+ for(p=pIndex->pTable->pIndex; p; p=p->pNext){
+ if( p->tnum==pIndex->tnum && p!=pIndex ) return 1;
+ }
+ return 0;
+}
+
+/*
** This is the callback routine for the code that initializes the
** database. See sqlite3Init() below for additional information.
** This routine is also called from the OP_ParseSchema opcode of the VDBE.
@@ -122766,6 +123467,7 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
UNUSED_PARAMETER2(NotUsed, argc);
assert( sqlite3_mutex_held(db->mutex) );
DbClearProperty(db, iDb, DB_Empty);
+ pData->nInitRow++;
if( db->mallocFailed ){
corruptSchema(pData, argv[0], 0);
return 1;
@@ -122819,15 +123521,12 @@ SQLITE_PRIVATE int sqlite3InitCallback(void *pInit, int argc, char **argv, char
*/
Index *pIndex;
pIndex = sqlite3FindIndex(db, argv[0], db->aDb[iDb].zDbSName);
- if( pIndex==0 ){
- /* This can occur if there exists an index on a TEMP table which
- ** has the same name as another index on a permanent index. Since
- ** the permanent table is hidden by the TEMP table, we can also
- ** safely ignore the index on the permanent table.
- */
- /* Do Nothing */;
- }else if( sqlite3GetInt32(argv[1], &pIndex->tnum)==0 ){
- corruptSchema(pData, argv[0], "invalid rootpage");
+ if( pIndex==0
+ || sqlite3GetInt32(argv[1],&pIndex->tnum)==0
+ || pIndex->tnum<2
+ || sqlite3IndexHasDuplicateRootPage(pIndex)
+ ){
+ corruptSchema(pData, argv[0], pIndex?"invalid rootpage":"orphan index");
}
}
return 0;
@@ -122877,6 +123576,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
initData.rc = SQLITE_OK;
initData.pzErrMsg = pzErrMsg;
initData.mInitFlags = mFlags;
+ initData.nInitRow = 0;
sqlite3InitCallback(&initData, 3, (char **)azArg, 0);
if( initData.rc ){
rc = initData.rc;
@@ -122994,7 +123694,7 @@ SQLITE_PRIVATE int sqlite3InitOne(sqlite3 *db, int iDb, char **pzErrMsg, u32 mFl
** indices that the user might have created.
*/
if( iDb==0 && meta[BTREE_FILE_FORMAT-1]>=4 ){
- db->flags &= ~SQLITE_LegacyFileFmt;
+ db->flags &= ~(u64)SQLITE_LegacyFileFmt;
}
/* Read the schema information out of the schema tables
@@ -123246,6 +123946,7 @@ static int sqlite3Prepare(
sParse.disableLookaside++;
db->lookaside.bDisable++;
}
+ sParse.disableVtab = (prepFlags & SQLITE_PREPARE_NO_VTAB)!=0;
/* Check to verify that it is possible to get a read lock on all
** database schemas. The inability to get a read lock indicates that
@@ -123410,293 +124111,6 @@ static int sqlite3LockAndPrepare(
return rc;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-/*
-** Checks if the specified token is a table, column, or function name,
-** based on the databases associated with the statement being prepared.
-** If the function fails, zero is returned and pRc is filled with the
-** error code.
-*/
-static int shouldTreatAsIdentifier(
- sqlite3 *db, /* Database handle. */
- const char *zToken, /* Pointer to start of token to be checked */
- int nToken, /* Length of token to be checked */
- int *pRc /* Pointer to error code upon failure */
-){
- int bFound = 0; /* Non-zero if token is an identifier name. */
- int i, j; /* Database and column loop indexes. */
- Schema *pSchema; /* Schema for current database. */
- Hash *pHash; /* Hash table of tables for current database. */
- HashElem *e; /* Hash element for hash table iteration. */
- Table *pTab; /* Database table for columns being checked. */
-
- if( sqlite3IsRowidN(zToken, nToken) ){
- return 1;
- }
- if( nToken>0 ){
- int hash = SQLITE_FUNC_HASH(sqlite3UpperToLower[(u8)zToken[0]], nToken);
- if( sqlite3FunctionSearchN(hash, zToken, nToken) ) return 1;
- }
- assert( db!=0 );
- sqlite3_mutex_enter(db->mutex);
- sqlite3BtreeEnterAll(db);
- for(i=0; i<db->nDb; i++){
- pHash = &db->aFunc;
- if( sqlite3HashFindN(pHash, zToken, nToken) ){
- bFound = 1;
- break;
- }
- pSchema = db->aDb[i].pSchema;
- if( pSchema==0 ) continue;
- pHash = &pSchema->tblHash;
- if( sqlite3HashFindN(pHash, zToken, nToken) ){
- bFound = 1;
- break;
- }
- for(e=sqliteHashFirst(pHash); e; e=sqliteHashNext(e)){
- pTab = sqliteHashData(e);
- if( pTab==0 ) continue;
- pHash = pTab->pColHash;
- if( pHash==0 ){
- pTab->pColHash = pHash = sqlite3_malloc(sizeof(Hash));
- if( pHash ){
- sqlite3HashInit(pHash);
- for(j=0; j<pTab->nCol; j++){
- Column *pCol = &pTab->aCol[j];
- sqlite3HashInsert(pHash, pCol->zName, pCol);
- }
- }else{
- *pRc = SQLITE_NOMEM_BKPT;
- bFound = 0;
- goto done;
- }
- }
- if( pHash && sqlite3HashFindN(pHash, zToken, nToken) ){
- bFound = 1;
- goto done;
- }
- }
- }
-done:
- sqlite3BtreeLeaveAll(db);
- sqlite3_mutex_leave(db->mutex);
- return bFound;
-}
-
-/*
-** Attempt to estimate the final output buffer size needed for the fully
-** normalized version of the specified SQL string. This should take into
-** account any potential expansion that could occur (e.g. via IN clauses
-** being expanded, etc). This size returned is the total number of bytes
-** including the NUL terminator.
-*/
-static int estimateNormalizedSize(
- const char *zSql, /* The original SQL string */
- int nSql, /* Length of original SQL string */
- u8 prepFlags /* The flags passed to sqlite3_prepare_v3() */
-){
- int nOut = nSql + 4;
- const char *z = zSql;
- while( nOut<nSql*5 ){
- while( z[0]!=0 && z[0]!='I' && z[0]!='i' ){ z++; }
- if( z[0]==0 ) break;
- z++;
- if( z[0]!='N' && z[0]!='n' ) break;
- z++;
- while( sqlite3Isspace(z[0]) ){ z++; }
- if( z[0]!='(' ) break;
- z++;
- nOut += 5; /* ?,?,? */
- }
- return nOut;
-}
-
-/*
-** Copy the current token into the output buffer while dealing with quoted
-** identifiers. By default, all letters will be converted into lowercase.
-** If the bUpper flag is set, uppercase will be used. The piOut argument
-** will be used to update the target index into the output string.
-*/
-static void copyNormalizedToken(
- const char *zSql, /* The original SQL string */
- int iIn, /* Current index into the original SQL string */
- int nToken, /* Number of bytes in the current token */
- int tokenFlags, /* Flags returned by the tokenizer */
- char *zOut, /* The output string */
- int *piOut /* Pointer to target index into the output string */
-){
- int bQuoted = tokenFlags & SQLITE_TOKEN_QUOTED;
- int bKeyword = tokenFlags & SQLITE_TOKEN_KEYWORD;
- int j = *piOut, k = 0;
- for(; k<nToken; k++){
- if( bQuoted ){
- if( k==0 && iIn>0 ){
- zOut[j++] = '"';
- continue;
- }else if( k==nToken-1 ){
- zOut[j++] = '"';
- continue;
- }
- }
- if( bKeyword ){
- zOut[j++] = sqlite3Toupper(zSql[iIn+k]);
- }else{
- zOut[j++] = sqlite3Tolower(zSql[iIn+k]);
- }
- }
- *piOut = j;
-}
-
-/*
-** Perform normalization of the SQL contained in the prepared statement and
-** store the result in the zNormSql field. The schema for the associated
-** databases are consulted while performing the normalization in order to
-** determine if a token appears to be an identifier. All identifiers are
-** left intact in the normalized SQL and all literals are replaced with a
-** single '?'.
-*/
-SQLITE_PRIVATE void sqlite3Normalize(
- Vdbe *pVdbe, /* VM being reprepared */
- const char *zSql, /* The original SQL string */
- int nSql, /* Size of the input string in bytes */
- u8 prepFlags /* The flags passed to sqlite3_prepare_v3() */
-){
- sqlite3 *db; /* Database handle. */
- char *z; /* The output string */
- int nZ; /* Size of the output string in bytes */
- int i; /* Next character to read from zSql[] */
- int j; /* Next character to fill in on z[] */
- int tokenType = 0; /* Type of the next token */
- int prevTokenType = 0; /* Type of the previous token, except spaces */
- int n; /* Size of the next token */
- int nParen = 0; /* Nesting level of parenthesis */
- Hash inHash; /* Table of parenthesis levels to output index. */
-
- db = sqlite3VdbeDb(pVdbe);
- assert( db!=0 );
- assert( pVdbe->zNormSql==0 );
- if( zSql==0 ) return;
- nZ = estimateNormalizedSize(zSql, nSql, prepFlags);
- z = sqlite3DbMallocRawNN(db, nZ);
- if( z==0 ) return;
- sqlite3HashInit(&inHash);
- for(i=j=0; i<nSql && zSql[i]; i+=n){
- int flags = 0;
- if( tokenType!=TK_SPACE ) prevTokenType = tokenType;
- n = sqlite3GetTokenNormalized((unsigned char*)zSql+i, &tokenType, &flags);
- switch( tokenType ){
- case TK_SPACE: {
- break;
- }
- case TK_ILLEGAL: {
- sqlite3DbFree(db, z);
- sqlite3HashClear(&inHash);
- return;
- }
- case TK_STRING:
- case TK_INTEGER:
- case TK_FLOAT:
- case TK_VARIABLE:
- case TK_BLOB: {
- z[j++] = '?';
- break;
- }
- case TK_LP:
- case TK_RP: {
- if( tokenType==TK_LP ){
- nParen++;
- if( prevTokenType==TK_IN ){
- assert( nParen<nSql );
- sqlite3HashInsert(&inHash, zSql+nParen, SQLITE_INT_TO_PTR(j));
- }
- }else{
- int jj;
- assert( nParen<nSql );
- jj = SQLITE_PTR_TO_INT(sqlite3HashFind(&inHash, zSql+nParen));
- if( jj>0 ){
- sqlite3HashInsert(&inHash, zSql+nParen, 0);
- assert( jj+6<nZ );
- memcpy(z+jj+1, "?,?,?", 5);
- j = jj+6;
- assert( nZ-1-j>=0 );
- assert( nZ-1-j<nZ );
- memset(z+j, 0, nZ-1-j);
- }
- nParen--;
- }
- assert( nParen>=0 );
- /* Fall through */
- }
- case TK_MINUS:
- case TK_SEMI:
- case TK_PLUS:
- case TK_STAR:
- case TK_SLASH:
- case TK_REM:
- case TK_EQ:
- case TK_LE:
- case TK_NE:
- case TK_LSHIFT:
- case TK_LT:
- case TK_RSHIFT:
- case TK_GT:
- case TK_GE:
- case TK_BITOR:
- case TK_CONCAT:
- case TK_COMMA:
- case TK_BITAND:
- case TK_BITNOT:
- case TK_DOT:
- case TK_IN:
- case TK_IS:
- case TK_NOT:
- case TK_NULL:
- case TK_ID: {
- if( tokenType==TK_NULL ){
- if( prevTokenType==TK_IS || prevTokenType==TK_NOT ){
- /* NULL is a keyword in this case, not a literal value */
- }else{
- /* Here the NULL is a literal value */
- z[j++] = '?';
- break;
- }
- }
- if( j>0 && sqlite3IsIdChar(z[j-1]) && sqlite3IsIdChar(zSql[i]) ){
- z[j++] = ' ';
- }
- if( tokenType==TK_ID ){
- int i2 = i, n2 = n, rc = SQLITE_OK;
- if( nParen>0 ){
- assert( nParen<nSql );
- sqlite3HashInsert(&inHash, zSql+nParen, 0);
- }
- if( flags&SQLITE_TOKEN_QUOTED ){ i2++; n2-=2; }
- if( shouldTreatAsIdentifier(db, zSql+i2, n2, &rc)==0 ){
- if( rc!=SQLITE_OK ){
- sqlite3DbFree(db, z);
- sqlite3HashClear(&inHash);
- return;
- }
- if( sqlite3_keyword_check(zSql+i2, n2)==0 ){
- z[j++] = '?';
- break;
- }
- }
- }
- copyNormalizedToken(zSql, i, n, flags, z, &j);
- break;
- }
- }
- }
- assert( j<nZ && "one" );
- while( j>0 && z[j-1]==' ' ){ j--; }
- if( j>0 && z[j-1]!=';' ){ z[j++] = ';'; }
- z[j] = 0;
- assert( j<nZ && "two" );
- pVdbe->zNormSql = z;
- sqlite3HashClear(&inHash);
-}
-#endif /* SQLITE_ENABLE_NORMALIZE */
/*
** Rerun the compilation of a statement after a schema change.
@@ -124538,7 +124952,7 @@ static void pushOntoSorter(
}
assert( pSelect->iOffset==0 || pSelect->iLimit!=0 );
iLimit = pSelect->iOffset ? pSelect->iOffset+1 : pSelect->iLimit;
- pSort->labelDone = sqlite3VdbeMakeLabel(v);
+ pSort->labelDone = sqlite3VdbeMakeLabel(pParse);
sqlite3ExprCodeExprList(pParse, pSort->pOrderBy, regBase, regOrigData,
SQLITE_ECEL_DUP | (regOrigData? SQLITE_ECEL_REF : 0));
if( bSeq ){
@@ -124577,7 +124991,7 @@ static void pushOntoSorter(
pKI->nAllField-pKI->nKeyField-1);
addrJmp = sqlite3VdbeCurrentAddr(v);
sqlite3VdbeAddOp3(v, OP_Jump, addrJmp+1, 0, addrJmp+1); VdbeCoverage(v);
- pSort->labelBkOut = sqlite3VdbeMakeLabel(v);
+ pSort->labelBkOut = sqlite3VdbeMakeLabel(pParse);
pSort->regReturn = ++pParse->nMem;
sqlite3VdbeAddOp2(v, OP_Gosub, pSort->regReturn, pSort->labelBkOut);
sqlite3VdbeAddOp1(v, OP_ResetSorter, pSort->iECursor);
@@ -125324,7 +125738,7 @@ static void generateSortTail(
){
Vdbe *v = pParse->pVdbe; /* The prepared statement */
int addrBreak = pSort->labelDone; /* Jump here to exit loop */
- int addrContinue = sqlite3VdbeMakeLabel(v); /* Jump here for next cycle */
+ int addrContinue = sqlite3VdbeMakeLabel(pParse);/* Jump here for next cycle */
int addr; /* Top of output loop. Jump for Next. */
int addrOnce = 0;
int iTab;
@@ -125364,7 +125778,12 @@ static void generateSortTail(
regRow = pDest->iSdst;
}else{
regRowid = sqlite3GetTempReg(pParse);
- regRow = sqlite3GetTempRange(pParse, nColumn);
+ if( eDest==SRT_EphemTab || eDest==SRT_Table ){
+ regRow = sqlite3GetTempReg(pParse);
+ nColumn = 0;
+ }else{
+ regRow = sqlite3GetTempRange(pParse, nColumn);
+ }
}
nKey = pOrderBy->nExpr - pSort->nOBSat;
if( pSort->sortFlags & SORTFLAG_UseSorter ){
@@ -125444,6 +125863,7 @@ static void generateSortTail(
switch( eDest ){
case SRT_Table:
case SRT_EphemTab: {
+ sqlite3VdbeAddOp3(v, OP_Column, iSortTab, nKey+bSeq, regRow);
sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, regRowid);
sqlite3VdbeAddOp3(v, OP_Insert, iParm, regRow, regRowid);
sqlite3VdbeChangeP5(v, OPFLAG_APPEND);
@@ -125984,15 +126404,15 @@ SQLITE_PRIVATE void sqlite3SelectAddColumnTypeAndCollation(
SQLITE_PRIVATE Table *sqlite3ResultSetOfSelect(Parse *pParse, Select *pSelect){
Table *pTab;
sqlite3 *db = pParse->db;
- int savedFlags;
+ u64 savedFlags;
savedFlags = db->flags;
- db->flags &= ~SQLITE_FullColNames;
+ db->flags &= ~(u64)SQLITE_FullColNames;
db->flags |= SQLITE_ShortColNames;
sqlite3SelectPrep(pParse, pSelect, 0);
+ db->flags = savedFlags;
if( pParse->nErr ) return 0;
while( pSelect->pPrior ) pSelect = pSelect->pPrior;
- db->flags = savedFlags;
pTab = sqlite3DbMallocZero(db, sizeof(Table) );
if( pTab==0 ){
return 0;
@@ -126236,7 +126656,7 @@ static void generateWithRecursiveQuery(
if( sqlite3AuthCheck(pParse, SQLITE_RECURSIVE, 0, 0, 0) ) return;
/* Process the LIMIT and OFFSET clauses, if they exist */
- addrBreak = sqlite3VdbeMakeLabel(v);
+ addrBreak = sqlite3VdbeMakeLabel(pParse);
p->nSelectRow = 320; /* 4 billion rows */
computeLimitRegisters(pParse, p, addrBreak);
pLimit = p->pLimit;
@@ -126306,7 +126726,7 @@ static void generateWithRecursiveQuery(
sqlite3VdbeAddOp1(v, OP_Delete, iQueue);
/* Output the single row in Current */
- addrCont = sqlite3VdbeMakeLabel(v);
+ addrCont = sqlite3VdbeMakeLabel(pParse);
codeOffset(v, regOffset, addrCont);
selectInnerLoop(pParse, p, iCurrent,
0, 0, pDest, addrCont, addrBreak);
@@ -126614,8 +127034,8 @@ static int multiSelect(
if( dest.eDest!=priorOp ){
int iCont, iBreak, iStart;
assert( p->pEList );
- iBreak = sqlite3VdbeMakeLabel(v);
- iCont = sqlite3VdbeMakeLabel(v);
+ iBreak = sqlite3VdbeMakeLabel(pParse);
+ iCont = sqlite3VdbeMakeLabel(pParse);
computeLimitRegisters(pParse, p, iBreak);
sqlite3VdbeAddOp2(v, OP_Rewind, unionTab, iBreak); VdbeCoverage(v);
iStart = sqlite3VdbeCurrentAddr(v);
@@ -126683,8 +127103,8 @@ static int multiSelect(
** tables.
*/
assert( p->pEList );
- iBreak = sqlite3VdbeMakeLabel(v);
- iCont = sqlite3VdbeMakeLabel(v);
+ iBreak = sqlite3VdbeMakeLabel(pParse);
+ iCont = sqlite3VdbeMakeLabel(pParse);
computeLimitRegisters(pParse, p, iBreak);
sqlite3VdbeAddOp2(v, OP_Rewind, tab1, iBreak); VdbeCoverage(v);
r1 = sqlite3GetTempReg(pParse);
@@ -126814,7 +127234,7 @@ static int generateOutputSubroutine(
int addr;
addr = sqlite3VdbeCurrentAddr(v);
- iContinue = sqlite3VdbeMakeLabel(v);
+ iContinue = sqlite3VdbeMakeLabel(pParse);
/* Suppress duplicates for UNION, EXCEPT, and INTERSECT
*/
@@ -127051,8 +127471,8 @@ static int multiSelectOrderBy(
db = pParse->db;
v = pParse->pVdbe;
assert( v!=0 ); /* Already thrown the error if VDBE alloc failed */
- labelEnd = sqlite3VdbeMakeLabel(v);
- labelCmpr = sqlite3VdbeMakeLabel(v);
+ labelEnd = sqlite3VdbeMakeLabel(pParse);
+ labelCmpr = sqlite3VdbeMakeLabel(pParse);
/* Patch up the ORDER BY clause
@@ -127368,6 +127788,7 @@ static Expr *substExpr(
ifNullRow.iTable = pSubst->iNewTable;
pCopy = &ifNullRow;
}
+ testcase( ExprHasProperty(pCopy, EP_Subquery) );
pNew = sqlite3ExprDup(db, pCopy, 0);
if( pNew && pSubst->isLeftJoin ){
ExprSetProperty(pNew, EP_CanBeNull);
@@ -127860,11 +128281,9 @@ static int flattenSubquery(
jointype = pSubitem->fg.jointype;
}else{
assert( pParent!=p ); /* 2nd and subsequent times through the loop */
- pSrc = pParent->pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
- if( pSrc==0 ){
- assert( db->mallocFailed );
- break;
- }
+ pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
+ if( pSrc==0 ) break;
+ pParent->pSrc = pSrc;
}
/* The subquery uses a single slot of the FROM clause of the outer
@@ -127883,10 +128302,9 @@ static int flattenSubquery(
** for the two elements in the FROM clause of the subquery.
*/
if( nSubSrc>1 ){
- pParent->pSrc = pSrc = sqlite3SrcListEnlarge(db, pSrc, nSubSrc-1,iFrom+1);
- if( db->mallocFailed ){
- break;
- }
+ pSrc = sqlite3SrcListEnlarge(pParse, pSrc, nSubSrc-1,iFrom+1);
+ if( pSrc==0 ) break;
+ pParent->pSrc = pSrc;
}
/* Transfer the FROM clause terms from the subquery into the
@@ -127932,7 +128350,8 @@ static int flattenSubquery(
pParent->pOrderBy = pOrderBy;
pSub->pOrderBy = 0;
}
- pWhere = sqlite3ExprDup(db, pSub->pWhere, 0);
+ pWhere = pSub->pWhere;
+ pSub->pWhere = 0;
if( isLeftJoin>0 ){
setJoinExpr(pWhere, iNewParent);
}
@@ -129235,7 +129654,7 @@ static void updateAccumulator(Parse *pParse, int regAcc, AggInfo *pAggInfo){
regAgg = 0;
}
if( pF->iDistinct>=0 ){
- addrNext = sqlite3VdbeMakeLabel(v);
+ addrNext = sqlite3VdbeMakeLabel(pParse);
testcase( nArg==0 ); /* Error condition */
testcase( nArg>1 ); /* Also an error */
codeDistinct(pParse, pF->iDistinct, addrNext, 1, regAgg);
@@ -129371,14 +129790,19 @@ static struct SrcList_item *isSelfJoinView(
){
struct SrcList_item *pItem;
for(pItem = pTabList->a; pItem<pThis; pItem++){
+ Select *pS1;
if( pItem->pSelect==0 ) continue;
if( pItem->fg.viaCoroutine ) continue;
if( pItem->zName==0 ) continue;
if( sqlite3_stricmp(pItem->zDatabase, pThis->zDatabase)!=0 ) continue;
if( sqlite3_stricmp(pItem->zName, pThis->zName)!=0 ) continue;
- if( sqlite3ExprCompare(0,
- pThis->pSelect->pWhere, pItem->pSelect->pWhere, -1)
- ){
+ pS1 = pItem->pSelect;
+ if( pThis->pSelect->selId!=pS1->selId ){
+ /* The query flattener left two different CTE tables with identical
+ ** names in the same FROM clause. */
+ continue;
+ }
+ if( sqlite3ExprCompare(0, pThis->pSelect->pWhere, pS1->pWhere, -1) ){
/* The view was modified by some other optimization such as
** pushDownWhereTerms() */
continue;
@@ -129640,6 +130064,7 @@ SQLITE_PRIVATE int sqlite3Select(
}
if( flattenSubquery(pParse, p, i, isAgg) ){
+ if( pParse->nErr ) goto select_end;
/* This subquery can be absorbed into its parent. */
i = -1;
}
@@ -129735,22 +130160,12 @@ SQLITE_PRIVATE int sqlite3Select(
pSub = pItem->pSelect;
if( pSub==0 ) continue;
- /* Sometimes the code for a subquery will be generated more than
- ** once, if the subquery is part of the WHERE clause in a LEFT JOIN,
- ** for example. In that case, do not regenerate the code to manifest
- ** a view or the co-routine to implement a view. The first instance
- ** is sufficient, though the subroutine to manifest the view does need
- ** to be invoked again. */
- if( pItem->addrFillSub ){
- if( pItem->fg.viaCoroutine==0 ){
- /* The subroutine that manifests the view might be a one-time routine,
- ** or it might need to be rerun on each iteration because it
- ** encodes a correlated subquery. */
- testcase( sqlite3VdbeGetOp(v, pItem->addrFillSub)->opcode==OP_Once );
- sqlite3VdbeAddOp2(v, OP_Gosub, pItem->regReturn, pItem->addrFillSub);
- }
- continue;
- }
+ /* The code for a subquery should only be generated once, though it is
+ ** technically harmless for it to be generated multiple times. The
+ ** following assert() will detect if something changes to cause
+ ** the same subquery to be coded multiple times, as a signal to the
+ ** developers to try to optimize the situation. */
+ assert( pItem->addrFillSub==0 );
/* Increment Parse.nHeight by the height of the largest expression
** tree referred to by this, the parent select. The child select
@@ -129938,7 +130353,7 @@ SQLITE_PRIVATE int sqlite3Select(
/* Set the limiter.
*/
- iEnd = sqlite3VdbeMakeLabel(v);
+ iEnd = sqlite3VdbeMakeLabel(pParse);
if( (p->selFlags & SF_FixedLimit)==0 ){
p->nSelectRow = 320; /* 4 billion rows */
}
@@ -130005,9 +130420,9 @@ SQLITE_PRIVATE int sqlite3Select(
assert( p->pEList==pEList );
#ifndef SQLITE_OMIT_WINDOWFUNC
if( pWin ){
- int addrGosub = sqlite3VdbeMakeLabel(v);
- int iCont = sqlite3VdbeMakeLabel(v);
- int iBreak = sqlite3VdbeMakeLabel(v);
+ int addrGosub = sqlite3VdbeMakeLabel(pParse);
+ int iCont = sqlite3VdbeMakeLabel(pParse);
+ int iBreak = sqlite3VdbeMakeLabel(pParse);
int regGosub = ++pParse->nMem;
sqlite3WindowCodeStep(pParse, p, pWInfo, regGosub, addrGosub);
@@ -130082,7 +130497,7 @@ SQLITE_PRIVATE int sqlite3Select(
}
/* Create a label to jump to when we want to abort the query */
- addrEnd = sqlite3VdbeMakeLabel(v);
+ addrEnd = sqlite3VdbeMakeLabel(pParse);
/* Convert TK_COLUMN nodes into TK_AGG_COLUMN and make entries in
** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the
@@ -130171,9 +130586,9 @@ SQLITE_PRIVATE int sqlite3Select(
iUseFlag = ++pParse->nMem;
iAbortFlag = ++pParse->nMem;
regOutputRow = ++pParse->nMem;
- addrOutputRow = sqlite3VdbeMakeLabel(v);
+ addrOutputRow = sqlite3VdbeMakeLabel(pParse);
regReset = ++pParse->nMem;
- addrReset = sqlite3VdbeMakeLabel(v);
+ addrReset = sqlite3VdbeMakeLabel(pParse);
iAMem = pParse->nMem + 1;
pParse->nMem += pGroupBy->nExpr;
iBMem = pParse->nMem + 1;
@@ -131460,7 +131875,7 @@ static SrcList *targetSrcList(
int iDb; /* Index of the database to use */
SrcList *pSrc; /* SrcList to be returned */
- pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
+ pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
if( pSrc ){
assert( pSrc->nSrc>0 );
pSrc->a[pSrc->nSrc-1].zName = sqlite3DbStrDup(db, pStep->zTarget);
@@ -131645,6 +132060,7 @@ static TriggerPrg *codeRowTrigger(
pSubParse->zAuthContext = pTrigger->zName;
pSubParse->eTriggerOp = pTrigger->op;
pSubParse->nQueryLoop = pParse->nQueryLoop;
+ pSubParse->disableVtab = pParse->disableVtab;
v = sqlite3GetVdbe(pSubParse);
if( v ){
@@ -131672,7 +132088,7 @@ static TriggerPrg *codeRowTrigger(
if( SQLITE_OK==sqlite3ResolveExprNames(&sNC, pWhen)
&& db->mallocFailed==0
){
- iEndTrigger = sqlite3VdbeMakeLabel(v);
+ iEndTrigger = sqlite3VdbeMakeLabel(pSubParse);
sqlite3ExprIfFalse(pSubParse, pWhen, iEndTrigger, SQLITE_JUMPIFNULL);
}
sqlite3ExprDelete(db, pWhen);
@@ -132271,6 +132687,7 @@ SQLITE_PRIVATE void sqlite3Update(
** being updated. Fill in aRegIdx[] with a register number that will hold
** the key for accessing each index.
*/
+ if( onError==OE_Replace ) bReplace = 1;
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
int reg;
if( chngKey || hasFK>1 || pIdx==pPk
@@ -132284,9 +132701,7 @@ SQLITE_PRIVATE void sqlite3Update(
if( indexColumnIsBeingUpdated(pIdx, i, aXRef, chngRowid) ){
reg = ++pParse->nMem;
pParse->nMem += pIdx->nColumn;
- if( (onError==OE_Replace)
- || (onError==OE_Default && pIdx->onError==OE_Replace)
- ){
+ if( onError==OE_Default && pIdx->onError==OE_Replace ){
bReplace = 1;
}
break;
@@ -132358,7 +132773,7 @@ SQLITE_PRIVATE void sqlite3Update(
#endif
/* Jump to labelBreak to abandon further processing of this UPDATE */
- labelContinue = labelBreak = sqlite3VdbeMakeLabel(v);
+ labelContinue = labelBreak = sqlite3VdbeMakeLabel(pParse);
/* Not an UPSERT. Normal processing. Begin by
** initialize the count of updated rows */
@@ -132493,13 +132908,13 @@ SQLITE_PRIVATE void sqlite3Update(
VdbeCoverage(v);
}
if( eOnePass!=ONEPASS_SINGLE ){
- labelContinue = sqlite3VdbeMakeLabel(v);
+ labelContinue = sqlite3VdbeMakeLabel(pParse);
}
sqlite3VdbeAddOp2(v, OP_IsNull, pPk ? regKey : regOldRowid, labelBreak);
VdbeCoverageIf(v, pPk==0);
VdbeCoverageIf(v, pPk!=0);
}else if( pPk ){
- labelContinue = sqlite3VdbeMakeLabel(v);
+ labelContinue = sqlite3VdbeMakeLabel(pParse);
sqlite3VdbeAddOp2(v, OP_Rewind, iEph, labelBreak); VdbeCoverage(v);
addrTop = sqlite3VdbeAddOp2(v, OP_RowData, iEph, regKey);
sqlite3VdbeAddOp4Int(v, OP_NotFound, iDataCur, labelContinue, regKey, 0);
@@ -133267,16 +133682,16 @@ static int execSqlF(sqlite3 *db, char **pzErrMsg, const char *zSql, ...){
** transient would cause the database file to appear to be deleted
** following reboot.
*/
-SQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse, Token *pNm){
+SQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse, Token *pNm, Expr *pInto){
Vdbe *v = sqlite3GetVdbe(pParse);
int iDb = 0;
- if( v==0 ) return;
+ if( v==0 ) goto build_vacuum_end;
if( pNm ){
#ifndef SQLITE_BUG_COMPATIBLE_20160819
/* Default behavior: Report an error if the argument to VACUUM is
** not recognized */
iDb = sqlite3TwoPartName(pParse, pNm, pNm, &pNm);
- if( iDb<0 ) return;
+ if( iDb<0 ) goto build_vacuum_end;
#else
/* When SQLITE_BUG_COMPATIBLE_20160819 is defined, unrecognized arguments
** to VACUUM are silently ignored. This is a back-out of a bug fix that
@@ -133288,21 +133703,33 @@ SQLITE_PRIVATE void sqlite3Vacuum(Parse *pParse, Token *pNm){
#endif
}
if( iDb!=1 ){
- sqlite3VdbeAddOp1(v, OP_Vacuum, iDb);
+ int iIntoReg = 0;
+ if( pInto && sqlite3ResolveSelfReference(pParse,0,0,pInto,0)==0 ){
+ iIntoReg = ++pParse->nMem;
+ sqlite3ExprCode(pParse, pInto, iIntoReg);
+ }
+ sqlite3VdbeAddOp2(v, OP_Vacuum, iDb, iIntoReg);
sqlite3VdbeUsesBtree(v, iDb);
}
+build_vacuum_end:
+ sqlite3ExprDelete(pParse->db, pInto);
return;
}
/*
** This routine implements the OP_Vacuum opcode of the VDBE.
*/
-SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
+SQLITE_PRIVATE int sqlite3RunVacuum(
+ char **pzErrMsg, /* Write error message here */
+ sqlite3 *db, /* Database connection */
+ int iDb, /* Which attached DB to vacuum */
+ sqlite3_value *pOut /* Write results here, if not NULL */
+){
int rc = SQLITE_OK; /* Return code from service routines */
Btree *pMain; /* The database being vacuumed */
Btree *pTemp; /* The temporary database we vacuum into */
- u16 saved_mDbFlags; /* Saved value of db->mDbFlags */
- u32 saved_flags; /* Saved value of db->flags */
+ u32 saved_mDbFlags; /* Saved value of db->mDbFlags */
+ u64 saved_flags; /* Saved value of db->flags */
int saved_nChange; /* Saved value of db->nChange */
int saved_nTotalChange; /* Saved value of db->nTotalChange */
u8 saved_mTrace; /* Saved trace settings */
@@ -133311,6 +133738,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
int nRes; /* Bytes of reserved space at the end of each page */
int nDb; /* Number of attached databases */
const char *zDbMain; /* Schema name of database to vacuum */
+ const char *zOut; /* Name of output file */
if( !db->autoCommit ){
sqlite3SetString(pzErrMsg, db, "cannot VACUUM from within a transaction");
@@ -133320,6 +133748,15 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
sqlite3SetString(pzErrMsg, db,"cannot VACUUM - SQL statements in progress");
return SQLITE_ERROR;
}
+ if( pOut ){
+ if( sqlite3_value_type(pOut)!=SQLITE_TEXT ){
+ sqlite3SetString(pzErrMsg, db, "non-text filename");
+ return SQLITE_ERROR;
+ }
+ zOut = (const char*)sqlite3_value_text(pOut);
+ }else{
+ zOut = "";
+ }
/* Save the current value of the database flags so that it can be
** restored before returning. Then set the writable-schema flag, and
@@ -133331,7 +133768,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
saved_mTrace = db->mTrace;
db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks;
db->mDbFlags |= DBFLAG_PreferBuiltin | DBFLAG_Vacuum;
- db->flags &= ~(SQLITE_ForeignKeys | SQLITE_ReverseOrder
+ db->flags &= ~(u64)(SQLITE_ForeignKeys | SQLITE_ReverseOrder
| SQLITE_Defensive | SQLITE_CountRows);
db->mTrace = 0;
@@ -133354,19 +133791,21 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
** to write the journal header file.
*/
nDb = db->nDb;
- rc = execSql(db, pzErrMsg, "ATTACH''AS vacuum_db");
+ rc = execSqlF(db, pzErrMsg, "ATTACH %Q AS vacuum_db", zOut);
if( rc!=SQLITE_OK ) goto end_of_vacuum;
assert( (db->nDb-1)==nDb );
pDb = &db->aDb[nDb];
assert( strcmp(pDb->zDbSName,"vacuum_db")==0 );
pTemp = pDb->pBt;
-
- /* The call to execSql() to attach the temp database has left the file
- ** locked (as there was more than one active statement when the transaction
- ** to read the schema was concluded. Unlock it here so that this doesn't
- ** cause problems for the call to BtreeSetPageSize() below. */
- sqlite3BtreeCommit(pTemp);
-
+ if( pOut ){
+ sqlite3_file *id = sqlite3PagerFile(sqlite3BtreePager(pTemp));
+ i64 sz = 0;
+ if( id->pMethods!=0 && (sqlite3OsFileSize(id, &sz)!=SQLITE_OK || sz>0) ){
+ rc = SQLITE_ERROR;
+ sqlite3SetString(pzErrMsg, db, "output file already exists");
+ goto end_of_vacuum;
+ }
+ }
nRes = sqlite3BtreeGetOptimalReserve(pMain);
/* A VACUUM cannot change the pagesize of an encrypted database. */
@@ -133390,7 +133829,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
*/
rc = execSql(db, pzErrMsg, "BEGIN");
if( rc!=SQLITE_OK ) goto end_of_vacuum;
- rc = sqlite3BtreeBeginTrans(pMain, 2, 0);
+ rc = sqlite3BtreeBeginTrans(pMain, pOut==0 ? 2 : 0, 0);
if( rc!=SQLITE_OK ) goto end_of_vacuum;
/* Do not attempt to change the page size for a WAL database */
@@ -133485,7 +133924,7 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
};
assert( 1==sqlite3BtreeIsInTrans(pTemp) );
- assert( 1==sqlite3BtreeIsInTrans(pMain) );
+ assert( pOut!=0 || 1==sqlite3BtreeIsInTrans(pMain) );
/* Copy Btree meta values */
for(i=0; i<ArraySize(aCopy); i+=2){
@@ -133496,17 +133935,23 @@ SQLITE_PRIVATE int sqlite3RunVacuum(char **pzErrMsg, sqlite3 *db, int iDb){
if( NEVER(rc!=SQLITE_OK) ) goto end_of_vacuum;
}
- rc = sqlite3BtreeCopyFile(pMain, pTemp);
+ if( pOut==0 ){
+ rc = sqlite3BtreeCopyFile(pMain, pTemp);
+ }
if( rc!=SQLITE_OK ) goto end_of_vacuum;
rc = sqlite3BtreeCommit(pTemp);
if( rc!=SQLITE_OK ) goto end_of_vacuum;
#ifndef SQLITE_OMIT_AUTOVACUUM
- sqlite3BtreeSetAutoVacuum(pMain, sqlite3BtreeGetAutoVacuum(pTemp));
+ if( pOut==0 ){
+ sqlite3BtreeSetAutoVacuum(pMain, sqlite3BtreeGetAutoVacuum(pTemp));
+ }
#endif
}
assert( rc==SQLITE_OK );
- rc = sqlite3BtreeSetPageSize(pMain, sqlite3BtreeGetPageSize(pTemp), nRes,1);
+ if( pOut==0 ){
+ rc = sqlite3BtreeSetPageSize(pMain, sqlite3BtreeGetPageSize(pTemp), nRes,1);
+ }
end_of_vacuum:
/* Restore the original value of db->flags */
@@ -134547,6 +134992,7 @@ SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){
const sqlite3_module *pMod = pVTab->pMod->pModule;
if( pVTab->pVtab && pMod->iVersion>=2 ){
int (*xMethod)(sqlite3_vtab *, int);
+ sqlite3VtabLock(pVTab);
switch( op ){
case SAVEPOINT_BEGIN:
xMethod = pMod->xSavepoint;
@@ -134562,6 +135008,7 @@ SQLITE_PRIVATE int sqlite3VtabSavepoint(sqlite3 *db, int op, int iSavepoint){
if( xMethod && pVTab->iSavepoint>iSavepoint ){
rc = xMethod(pVTab->pVtab, iSavepoint);
}
+ sqlite3VtabUnlock(pVTab);
}
}
}
@@ -135323,8 +135770,11 @@ SQLITE_PRIVATE void sqlite3WhereAddScanStatus(
# define sqlite3WhereAddScanStatus(a, b, c, d) ((void)d)
#endif
SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
+ Parse *pParse, /* Parsing context */
+ Vdbe *v, /* Prepared statement under construction */
WhereInfo *pWInfo, /* Complete information about the WHERE clause */
int iLevel, /* Which level of pWInfo->a[] should be coded */
+ WhereLevel *pLevel, /* The current level pointer */
Bitmask notReady /* Which tables are currently available */
);
@@ -135594,6 +136044,7 @@ SQLITE_PRIVATE int sqlite3WhereExplainOneScan(
}
#endif
zMsg = sqlite3StrAccumFinish(&str);
+ sqlite3ExplainBreakpoint("",zMsg);
ret = sqlite3VdbeAddOp4(v, OP_Explain, sqlite3VdbeCurrentAddr(v),
pParse->addrExplain, 0, zMsg,P4_DYNAMIC);
}
@@ -135919,16 +136370,17 @@ static int codeEqualityTerm(
if( pLoop->aLTerm[i]->pExpr==pX ) nEq++;
}
+ iTab = 0;
if( (pX->flags & EP_xIsSelect)==0 || pX->x.pSelect->pEList->nExpr==1 ){
- eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0);
+ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, 0, &iTab);
}else{
sqlite3 *db = pParse->db;
pX = removeUnindexableInClauseTerms(pParse, iEq, pLoop, pX);
if( !db->mallocFailed ){
aiMap = (int*)sqlite3DbMallocZero(pParse->db, sizeof(int)*nEq);
- eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap);
- pTerm->pExpr->iTable = pX->iTable;
+ eType = sqlite3FindInIndex(pParse, pX, IN_INDEX_LOOP, 0, aiMap, &iTab);
+ pTerm->pExpr->iTable = iTab;
}
sqlite3ExprDelete(db, pX);
pX = pTerm->pExpr;
@@ -135938,7 +136390,6 @@ static int codeEqualityTerm(
testcase( bRev );
bRev = !bRev;
}
- iTab = pX->iTable;
sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iTab, 0);
VdbeCoverageIf(v, bRev);
VdbeCoverageIf(v, !bRev);
@@ -135946,7 +136397,7 @@ static int codeEqualityTerm(
pLoop->wsFlags |= WHERE_IN_ABLE;
if( pLevel->u.in.nIn==0 ){
- pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
+ pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
}
i = pLevel->u.in.nIn;
@@ -135962,7 +136413,6 @@ static int codeEqualityTerm(
if( pLoop->aLTerm[i]->pExpr==pX ){
int iOut = iReg + i - iEq;
if( eType==IN_INDEX_ROWID ){
- testcase( nEq>1 ); /* Happens with a UNIQUE index on ROWID */
pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iOut);
}else{
int iCol = aiMap ? aiMap[iMap++] : 0;
@@ -136457,7 +136907,9 @@ static void codeExprOrVector(Parse *pParse, Expr *p, int iReg, int nReg){
#ifndef SQLITE_OMIT_SUBQUERY
if( (p->flags & EP_xIsSelect) ){
Vdbe *v = pParse->pVdbe;
- int iSelect = sqlite3CodeSubselect(pParse, p, 0, 0);
+ int iSelect;
+ assert( p->op==TK_SELECT );
+ iSelect = sqlite3CodeSubselect(pParse, p);
sqlite3VdbeAddOp3(v, OP_Copy, iSelect, iReg, nReg-1);
}else
#endif
@@ -136543,22 +136995,21 @@ static void whereIndexExprTrans(
** implementation described by pWInfo.
*/
SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
+ Parse *pParse, /* Parsing context */
+ Vdbe *v, /* Prepared statement under construction */
WhereInfo *pWInfo, /* Complete information about the WHERE clause */
int iLevel, /* Which level of pWInfo->a[] should be coded */
+ WhereLevel *pLevel, /* The current level pointer */
Bitmask notReady /* Which tables are currently available */
){
int j, k; /* Loop counters */
int iCur; /* The VDBE cursor for the table */
int addrNxt; /* Where to jump to continue with the next IN case */
- int omitTable; /* True if we use the index only */
int bRev; /* True if we need to scan in reverse order */
- WhereLevel *pLevel; /* The where level to be coded */
WhereLoop *pLoop; /* The WhereLoop object being coded */
WhereClause *pWC; /* Decomposition of the entire WHERE clause */
WhereTerm *pTerm; /* A WHERE clause term */
- Parse *pParse; /* Parsing context */
sqlite3 *db; /* Database connection */
- Vdbe *v; /* The prepared stmt under constructions */
struct SrcList_item *pTabItem; /* FROM clause term being coded */
int addrBrk; /* Jump here to break out of the loop */
int addrHalt; /* addrBrk for the outermost loop */
@@ -136568,18 +137019,13 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
Index *pIdx = 0; /* Index used by loop (if any) */
int iLoop; /* Iteration of constraint generator loop */
- pParse = pWInfo->pParse;
- v = pParse->pVdbe;
pWC = &pWInfo->sWC;
db = pParse->db;
- pLevel = &pWInfo->a[iLevel];
pLoop = pLevel->pWLoop;
pTabItem = &pWInfo->pTabList->a[pLevel->iFrom];
iCur = pTabItem->iCursor;
pLevel->notReady = notReady & ~sqlite3WhereGetMask(&pWInfo->sMaskSet, iCur);
bRev = (pWInfo->revMask>>iLevel)&1;
- omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0
- && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0;
VdbeModuleComment((v, "Begin WHERE-loop%d: %s",iLevel,pTabItem->pTab->zName));
/* Create labels for the "break" and "continue" instructions
@@ -136592,8 +137038,8 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
** there are no IN operators in the constraints, the "addrNxt" label
** is the same as "addrBrk".
*/
- addrBrk = pLevel->addrBrk = pLevel->addrNxt = sqlite3VdbeMakeLabel(v);
- addrCont = pLevel->addrCont = sqlite3VdbeMakeLabel(v);
+ addrBrk = pLevel->addrBrk = pLevel->addrNxt = sqlite3VdbeMakeLabel(pParse);
+ addrCont = pLevel->addrCont = sqlite3VdbeMakeLabel(pParse);
/* If this is the right table of a LEFT OUTER JOIN, allocate and
** initialize a memory cell that records if this table matches any
@@ -136720,7 +137166,6 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
pTerm = pLoop->aLTerm[0];
assert( pTerm!=0 );
assert( pTerm->pExpr!=0 );
- assert( omitTable==0 );
testcase( pTerm->wtFlags & TERM_VIRTUAL );
iReleaseReg = ++pParse->nMem;
iRowidReg = codeEqualityTerm(pParse, pTerm, pLevel, 0, bRev, iReleaseReg);
@@ -136729,6 +137174,9 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
sqlite3VdbeAddOp3(v, OP_SeekRowid, iCur, addrNxt, iRowidReg);
VdbeCoverage(v);
pLevel->op = OP_Noop;
+ if( (pTerm->prereqAll & pLevel->notReady)==0 ){
+ pTerm->wtFlags |= TERM_CODED;
+ }
}else if( (pLoop->wsFlags & WHERE_IPK)!=0
&& (pLoop->wsFlags & WHERE_COLUMN_RANGE)!=0
){
@@ -136739,7 +137187,6 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
int memEndValue = 0;
WhereTerm *pStart, *pEnd;
- assert( omitTable==0 );
j = 0;
pStart = pEnd = 0;
if( pLoop->wsFlags & WHERE_BTM_LIMIT ) pStart = pLoop->aLTerm[j++];
@@ -136903,6 +137350,8 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
char *zEndAff = 0; /* Affinity for end of range constraint */
u8 bSeekPastNull = 0; /* True to seek past initial nulls */
u8 bStopAtNull = 0; /* Add condition to terminate at NULLs */
+ int omitTable; /* True if we use the index only */
+
pIdx = pLoop->u.btree.pIndex;
iIdxCur = pLevel->iIdxCur;
@@ -137104,6 +137553,8 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
}
/* Seek the table cursor, if required */
+ omitTable = (pLoop->wsFlags & WHERE_IDX_ONLY)!=0
+ && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0;
if( omitTable ){
/* pIdx is a covering index. No need to access the main table. */
}else if( HasRowid(pIdx->pTable) ){
@@ -137138,8 +137589,13 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
** the cursor. In this case it is important to do the full evaluation,
** as the result of the expression may not be NULL, even if all table
** column values are. https://www.sqlite.org/src/info/7fa8049685b50b5a
+ **
+ ** Also, do not do this when processing one index an a multi-index
+ ** OR clause, since the transformation will become invalid once we
+ ** move forward to the next index.
+ ** https://sqlite.org/src/info/4e8e4857d32d401f
*/
- if( pLevel->iLeftJoin==0 ){
+ if( pLevel->iLeftJoin==0 && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0 ){
whereIndexExprTrans(pIdx, iCur, iIdxCur, pWInfo);
}
@@ -137214,7 +137670,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
int regReturn = ++pParse->nMem; /* Register used with OP_Gosub */
int regRowset = 0; /* Register for RowSet object */
int regRowid = 0; /* Register holding rowid */
- int iLoopBody = sqlite3VdbeMakeLabel(v); /* Start of loop body */
+ int iLoopBody = sqlite3VdbeMakeLabel(pParse);/* Start of loop body */
int iRetInit; /* Address of regReturn init */
int untestedTerms = 0; /* Some terms not completely tested */
int ii; /* Loop counter */
@@ -137330,6 +137786,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
pOrExpr = pAndExpr;
}
/* Loop through table entries that match term pOrTerm. */
+ ExplainQueryPlan((pParse, 1, "INDEX %d", ii+1));
WHERETRACE(0xffff, ("Subplan for OR-clause:\n"));
pSubWInfo = sqlite3WhereBegin(pParse, pOrTab, pOrExpr, 0, 0,
wctrlFlags, iCovCur);
@@ -137433,6 +137890,7 @@ SQLITE_PRIVATE Bitmask sqlite3WhereCodeOneLoopStart(
/* Finish the loop through table entries that match term pOrTerm. */
sqlite3WhereEnd(pSubWInfo);
+ ExplainQueryPlanPop(pParse);
}
}
}
@@ -138394,6 +138852,7 @@ static void exprAnalyzeOrTerm(
** and column is found but leave okToChngToIN false if not found.
*/
for(j=0; j<2 && !okToChngToIN; j++){
+ Expr *pLeft = 0;
pOrTerm = pOrWc->a;
for(i=pOrWc->nTerm-1; i>=0; i--, pOrTerm++){
assert( pOrTerm->eOperator & WO_EQ );
@@ -138417,6 +138876,7 @@ static void exprAnalyzeOrTerm(
}
iColumn = pOrTerm->u.leftColumn;
iCursor = pOrTerm->leftCursor;
+ pLeft = pOrTerm->pExpr->pLeft;
break;
}
if( i<0 ){
@@ -138436,7 +138896,9 @@ static void exprAnalyzeOrTerm(
assert( pOrTerm->eOperator & WO_EQ );
if( pOrTerm->leftCursor!=iCursor ){
pOrTerm->wtFlags &= ~TERM_OR_OK;
- }else if( pOrTerm->u.leftColumn!=iColumn ){
+ }else if( pOrTerm->u.leftColumn!=iColumn || (iColumn==XN_EXPR
+ && sqlite3ExprCompare(pParse, pOrTerm->pExpr->pLeft, pLeft, -1)
+ )){
okToChngToIN = 0;
}else{
int affLeft, affRight;
@@ -139525,6 +139987,17 @@ static WhereTerm *whereScanNext(WhereScan *pScan){
}
/*
+** This is whereScanInit() for the case of an index on an expression.
+** It is factored out into a separate tail-recursion subroutine so that
+** the normal whereScanInit() routine, which is a high-runner, does not
+** need to push registers onto the stack as part of its prologue.
+*/
+static SQLITE_NOINLINE WhereTerm *whereScanInitIndexExpr(WhereScan *pScan){
+ pScan->idxaff = sqlite3ExprAffinity(pScan->pIdxExpr);
+ return whereScanNext(pScan);
+}
+
+/*
** Initialize a WHERE clause scanner object. Return a pointer to the
** first match. Return NULL if there are no matches.
**
@@ -139556,12 +140029,19 @@ static WhereTerm *whereScanInit(
pScan->pIdxExpr = 0;
pScan->idxaff = 0;
pScan->zCollName = 0;
+ pScan->opMask = opMask;
+ pScan->k = 0;
+ pScan->aiCur[0] = iCur;
+ pScan->nEquiv = 1;
+ pScan->iEquiv = 1;
if( pIdx ){
int j = iColumn;
iColumn = pIdx->aiColumn[j];
if( iColumn==XN_EXPR ){
pScan->pIdxExpr = pIdx->aColExpr->a[j].pExpr;
pScan->zCollName = pIdx->azColl[j];
+ pScan->aiColumn[0] = XN_EXPR;
+ return whereScanInitIndexExpr(pScan);
}else if( iColumn==pIdx->pTable->iPKey ){
iColumn = XN_ROWID;
}else if( iColumn>=0 ){
@@ -139571,12 +140051,7 @@ static WhereTerm *whereScanInit(
}else if( iColumn==XN_EXPR ){
return 0;
}
- pScan->opMask = opMask;
- pScan->k = 0;
- pScan->aiCur[0] = iCur;
pScan->aiColumn[0] = iColumn;
- pScan->nEquiv = 1;
- pScan->iEquiv = 1;
return whereScanNext(pScan);
}
@@ -140051,7 +140526,7 @@ static void constructAutomaticIndex(
addrTop = sqlite3VdbeAddOp1(v, OP_Rewind, pLevel->iTabCur); VdbeCoverage(v);
}
if( pPartial ){
- iContinue = sqlite3VdbeMakeLabel(v);
+ iContinue = sqlite3VdbeMakeLabel(pParse);
sqlite3ExprIfFalse(pParse, pPartial, iContinue, SQLITE_JUMPIFNULL);
pLoop->wsFlags |= WHERE_PARTIALIDX;
}
@@ -140068,6 +140543,7 @@ static void constructAutomaticIndex(
translateColumnToCopy(pParse, addrTop, pLevel->iTabCur,
pTabItem->regResult, 1);
sqlite3VdbeGoto(v, addrTop);
+ pTabItem->fg.viaCoroutine = 0;
}else{
sqlite3VdbeAddOp2(v, OP_Next, pLevel->iTabCur, addrTop+1); VdbeCoverage(v);
}
@@ -141423,7 +141899,7 @@ static int whereLoopInsert(WhereLoopBuilder *pBuilder, WhereLoop *pTemplate){
rc = whereLoopXfer(db, p, pTemplate);
if( (p->wsFlags & WHERE_VIRTUALTABLE)==0 ){
Index *pIndex = p->u.btree.pIndex;
- if( pIndex && pIndex->tnum==0 ){
+ if( pIndex && pIndex->idxType==SQLITE_IDXTYPE_IPK ){
p->u.btree.pIndex = 0;
}
}
@@ -141590,8 +142066,8 @@ static int whereRangeVectorLen(
** terms only. If it is modified, this value is restored before this
** function returns.
**
-** If pProbe->tnum==0, that means pIndex is a fake index used for the
-** INTEGER PRIMARY KEY.
+** If pProbe->idxType==SQLITE_IDXTYPE_IPK, that means pIndex is
+** a fake index used for the INTEGER PRIMARY KEY.
*/
static int whereLoopAddBtreeIndex(
WhereLoopBuilder *pBuilder, /* The WhereLoop factory */
@@ -142091,6 +142567,7 @@ static int whereLoopAddBtree(
sPk.onError = OE_Replace;
sPk.pTable = pTab;
sPk.szIdxRow = pTab->szTabRow;
+ sPk.idxType = SQLITE_IDXTYPE_IPK;
aiRowEstPk[0] = pTab->nRowLogEst;
aiRowEstPk[1] = 0;
pFirst = pSrc->pTab->pIndex;
@@ -142181,7 +142658,7 @@ static int whereLoopAddBtree(
b = indexMightHelpWithOrderBy(pBuilder, pProbe, pSrc->iCursor);
/* The ONEPASS_DESIRED flags never occurs together with ORDER BY */
assert( (pWInfo->wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || b==0 );
- if( pProbe->tnum<=0 ){
+ if( pProbe->idxType==SQLITE_IDXTYPE_IPK ){
/* Integer primary key index */
pNew->wsFlags = WHERE_IPK;
@@ -143857,7 +144334,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
pWInfo->pResultSet = pResultSet;
pWInfo->aiCurOnePass[0] = pWInfo->aiCurOnePass[1] = -1;
pWInfo->nLevel = nTabList;
- pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(v);
+ pWInfo->iBreak = pWInfo->iContinue = sqlite3VdbeMakeLabel(pParse);
pWInfo->wctrlFlags = wctrlFlags;
pWInfo->iLimit = iAuxArg;
pWInfo->savedNQueryLoop = pParse->nQueryLoop;
@@ -144131,9 +144608,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 ){
int wsFlags = pWInfo->a[0].pWLoop->wsFlags;
int bOnerow = (wsFlags & WHERE_ONEROW)!=0;
+ assert( !(wsFlags & WHERE_VIRTUALTABLE) || IsVirtual(pTabList->a[0].pTab) );
if( bOnerow || (
0!=(wctrlFlags & WHERE_ONEPASS_MULTIROW)
- && 0==(wsFlags & WHERE_VIRTUALTABLE)
+ && !IsVirtual(pTabList->a[0].pTab)
&& (0==(wsFlags & WHERE_MULTI_OR) || (wctrlFlags & WHERE_DUPLICATES_OK))
)){
pWInfo->eOnePass = bOnerow ? ONEPASS_SINGLE : ONEPASS_MULTI;
@@ -144288,7 +144766,7 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin(
pParse, pTabList, pLevel, wctrlFlags
);
pLevel->addrBody = sqlite3VdbeCurrentAddr(v);
- notReady = sqlite3WhereCodeOneLoopStart(pWInfo, ii, notReady);
+ notReady = sqlite3WhereCodeOneLoopStart(pParse,v,pWInfo,ii,pLevel,notReady);
pWInfo->iContinue = pLevel->addrCont;
if( (wsFlags&WHERE_MULTI_OR)==0 && (wctrlFlags&WHERE_OR_SUBCLAUSE)==0 ){
sqlite3WhereAddScanStatus(v, pTabList, pLevel, addrExplain);
@@ -144473,6 +144951,29 @@ SQLITE_PRIVATE void sqlite3WhereEnd(WhereInfo *pWInfo){
continue;
}
+#ifdef SQLITE_ENABLE_EARLY_CURSOR_CLOSE
+ /* Close all of the cursors that were opened by sqlite3WhereBegin.
+ ** Except, do not close cursors that will be reused by the OR optimization
+ ** (WHERE_OR_SUBCLAUSE). And do not close the OP_OpenWrite cursors
+ ** created for the ONEPASS optimization.
+ */
+ if( (pTab->tabFlags & TF_Ephemeral)==0
+ && pTab->pSelect==0
+ && (pWInfo->wctrlFlags & WHERE_OR_SUBCLAUSE)==0
+ ){
+ int ws = pLoop->wsFlags;
+ if( pWInfo->eOnePass==ONEPASS_OFF && (ws & WHERE_IDX_ONLY)==0 ){
+ sqlite3VdbeAddOp1(v, OP_Close, pTabItem->iCursor);
+ }
+ if( (ws & WHERE_INDEXED)!=0
+ && (ws & (WHERE_IPK|WHERE_AUTO_INDEX))==0
+ && pLevel->iIdxCur!=pWInfo->aiCurOnePass[1]
+ ){
+ sqlite3VdbeAddOp1(v, OP_Close, pLevel->iIdxCur);
+ }
+ }
+#endif
+
/* If this scan uses an index, make VDBE code substitutions to read data
** from the index instead of from the table where possible. In some cases
** this optimization prevents the table from ever being read, which can
@@ -145372,8 +145873,7 @@ SQLITE_PRIVATE int sqlite3WindowRewrite(Parse *pParse, Select *p){
pSub = sqlite3SelectNew(
pParse, pSublist, pSrc, pWhere, pGroupBy, pHaving, pSort, 0, 0
);
- p->pSrc = sqlite3SrcListAppend(db, 0, 0, 0);
- assert( p->pSrc || db->mallocFailed );
+ p->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
if( p->pSrc ){
p->pSrc->a[0].pSelect = pSub;
sqlite3SrcListAssignCursors(pParse, p->pSrc);
@@ -145430,6 +145930,7 @@ SQLITE_PRIVATE void sqlite3WindowListDelete(sqlite3 *db, Window *p){
*/
static Expr *sqlite3WindowOffsetExpr(Parse *pParse, Expr *pExpr){
if( 0==sqlite3ExprIsConstant(pExpr) ){
+ if( IN_RENAME_OBJECT ) sqlite3RenameExprUnmap(pParse, pExpr);
sqlite3ExprDelete(pParse->db, pExpr);
pExpr = sqlite3ExprAlloc(pParse->db, TK_NULL, 0, 0);
}
@@ -145624,6 +146125,7 @@ static void windowCheckIntValue(Parse *pParse, int reg, int eCond){
VdbeCoverageNeverNullIf(v, eCond==0);
VdbeCoverageNeverNullIf(v, eCond==1);
VdbeCoverageNeverNullIf(v, eCond==2);
+ sqlite3MayAbort(pParse);
sqlite3VdbeAddOp2(v, OP_Halt, SQLITE_ERROR, OE_Abort);
sqlite3VdbeAppendP4(v, (void*)azErr[eCond], P4_STATIC);
sqlite3ReleaseTempReg(pParse, regZero);
@@ -145879,7 +146381,7 @@ static void windowReturnOneRow(
|| pFunc->zName==first_valueName
){
int csr = pWin->csrApp;
- int lbl = sqlite3VdbeMakeLabel(v);
+ int lbl = sqlite3VdbeMakeLabel(pParse);
int tmpReg = sqlite3GetTempReg(pParse);
sqlite3VdbeAddOp2(v, OP_Null, 0, pWin->regResult);
@@ -145902,7 +146404,7 @@ static void windowReturnOneRow(
int nArg = pWin->pOwner->x.pList->nExpr;
int iEph = pMWin->iEphCsr;
int csr = pWin->csrApp;
- int lbl = sqlite3VdbeMakeLabel(v);
+ int lbl = sqlite3VdbeMakeLabel(pParse);
int tmpReg = sqlite3GetTempReg(pParse);
if( nArg<3 ){
@@ -146163,8 +146665,8 @@ static void windowCodeRowExprStep(
/* Allocate register and label for the "flush_partition" sub-routine. */
regFlushPart = ++pParse->nMem;
- lblFlushPart = sqlite3VdbeMakeLabel(v);
- lblFlushDone = sqlite3VdbeMakeLabel(v);
+ lblFlushPart = sqlite3VdbeMakeLabel(pParse);
+ lblFlushDone = sqlite3VdbeMakeLabel(pParse);
regStart = ++pParse->nMem;
regEnd = ++pParse->nMem;
@@ -146274,7 +146776,7 @@ static void windowCodeRowExprStep(
|| pMWin->eStart==TK_PRECEDING
|| pMWin->eStart==TK_FOLLOWING
){
- int lblSkipInverse = sqlite3VdbeMakeLabel(v);;
+ int lblSkipInverse = sqlite3VdbeMakeLabel(pParse);;
if( pMWin->eStart==TK_PRECEDING ){
sqlite3VdbeAddOp3(v, OP_IfPos, regStart, lblSkipInverse, 1);
VdbeCoverage(v);
@@ -146439,13 +146941,13 @@ static void windowCodeCacheStep(
|| (pMWin->eStart==TK_CURRENT && pMWin->eEnd==TK_UNBOUNDED)
);
- lblEmpty = sqlite3VdbeMakeLabel(v);
+ lblEmpty = sqlite3VdbeMakeLabel(pParse);
regNewPeer = pParse->nMem+1;
pParse->nMem += nPeer;
/* Allocate register and label for the "flush_partition" sub-routine. */
regFlushPart = ++pParse->nMem;
- lblFlushPart = sqlite3VdbeMakeLabel(v);
+ lblFlushPart = sqlite3VdbeMakeLabel(pParse);
csrLead = pParse->nTab++;
regCtr = ++pParse->nMem;
@@ -146682,6 +147184,7 @@ SQLITE_PRIVATE Window *sqlite3WindowDup(sqlite3 *db, Expr *pOwner, Window *p){
if( pNew ){
pNew->zName = sqlite3DbStrDup(db, p->zName);
pNew->pFilter = sqlite3ExprDup(db, p->pFilter, 0);
+ pNew->pFunc = p->pFunc;
pNew->pPartition = sqlite3ExprListDup(db, p->pPartition, 0);
pNew->pOrderBy = sqlite3ExprListDup(db, p->pOrderBy, 0);
pNew->eType = p->eType;
@@ -146939,8 +147442,7 @@ static void disableLookaside(Parse *pParse){
memcpy(p->u.zToken, t.z, t.n);
p->u.zToken[t.n] = 0;
if( sqlite3Isquote(p->u.zToken[0]) ){
- if( p->u.zToken[0]=='"' ) p->flags |= EP_DblQuoted;
- sqlite3Dequote(p->u.zToken);
+ sqlite3DequoteExpr(p);
}
#if SQLITE_MAX_EXPR_DEPTH>0
p->nHeight = 1;
@@ -147049,27 +147551,27 @@ static void disableLookaside(Parse *pParse){
#endif
/************* Begin control #defines *****************************************/
#define YYCODETYPE unsigned short int
-#define YYNOCODE 277
+#define YYNOCODE 278
#define YYACTIONTYPE unsigned short int
#define YYWILDCARD 91
#define sqlite3ParserTOKENTYPE Token
typedef union {
int yyinit;
sqlite3ParserTOKENTYPE yy0;
- Expr* yy18;
- struct TrigEvent yy34;
- IdList* yy48;
- int yy70;
- struct {int value; int mask;} yy111;
- struct FrameBound yy119;
- SrcList* yy135;
- TriggerStep* yy207;
- Window* yy327;
- Upsert* yy340;
- const char* yy392;
- ExprList* yy420;
- With* yy449;
- Select* yy489;
+ ExprList* yy42;
+ int yy96;
+ TriggerStep* yy119;
+ Window* yy147;
+ SrcList* yy167;
+ Upsert* yy266;
+ struct FrameBound yy317;
+ IdList* yy336;
+ struct TrigEvent yy350;
+ struct {int value; int mask;} yy367;
+ Select* yy423;
+ const char* yy464;
+ Expr* yy490;
+ With* yy499;
} YYMINORTYPE;
#ifndef YYSTACKDEPTH
#define YYSTACKDEPTH 100
@@ -147085,17 +147587,17 @@ typedef union {
#define sqlite3ParserCTX_FETCH Parse *pParse=yypParser->pParse;
#define sqlite3ParserCTX_STORE yypParser->pParse=pParse;
#define YYFALLBACK 1
-#define YYNSTATE 521
-#define YYNRULE 367
+#define YYNSTATE 524
+#define YYNRULE 369
#define YYNTOKEN 155
-#define YY_MAX_SHIFT 520
-#define YY_MIN_SHIFTREDUCE 756
-#define YY_MAX_SHIFTREDUCE 1122
-#define YY_ERROR_ACTION 1123
-#define YY_ACCEPT_ACTION 1124
-#define YY_NO_ACTION 1125
-#define YY_MIN_REDUCE 1126
-#define YY_MAX_REDUCE 1492
+#define YY_MAX_SHIFT 523
+#define YY_MIN_SHIFTREDUCE 760
+#define YY_MAX_SHIFTREDUCE 1128
+#define YY_ERROR_ACTION 1129
+#define YY_ACCEPT_ACTION 1130
+#define YY_NO_ACTION 1131
+#define YY_MIN_REDUCE 1132
+#define YY_MAX_REDUCE 1500
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
@@ -147164,566 +147666,567 @@ typedef union {
*********** Begin parsing tables **********************************************/
#define YY_ACTTAB_COUNT (2009)
static const YYACTIONTYPE yy_action[] = {
- /* 0 */ 368, 105, 102, 197, 105, 102, 197, 515, 1124, 1,
- /* 10 */ 1, 520, 2, 1128, 515, 1192, 1171, 1456, 275, 370,
- /* 20 */ 127, 1389, 1197, 1197, 1192, 1166, 178, 1205, 64, 64,
- /* 30 */ 477, 887, 322, 428, 348, 37, 37, 808, 362, 888,
- /* 40 */ 509, 509, 509, 112, 113, 103, 1100, 1100, 953, 956,
- /* 50 */ 946, 946, 110, 110, 111, 111, 111, 111, 365, 252,
- /* 60 */ 252, 515, 252, 252, 497, 515, 309, 515, 459, 515,
- /* 70 */ 1079, 491, 512, 478, 6, 512, 809, 134, 498, 228,
- /* 80 */ 194, 428, 37, 37, 515, 208, 64, 64, 64, 64,
- /* 90 */ 13, 13, 109, 109, 109, 109, 108, 108, 107, 107,
- /* 100 */ 107, 106, 401, 258, 381, 13, 13, 398, 397, 428,
- /* 110 */ 252, 252, 370, 476, 405, 1104, 1079, 1080, 1081, 386,
- /* 120 */ 1106, 390, 497, 512, 497, 1423, 1419, 304, 1105, 307,
- /* 130 */ 1256, 496, 370, 499, 16, 16, 112, 113, 103, 1100,
- /* 140 */ 1100, 953, 956, 946, 946, 110, 110, 111, 111, 111,
- /* 150 */ 111, 262, 1107, 495, 1107, 401, 112, 113, 103, 1100,
- /* 160 */ 1100, 953, 956, 946, 946, 110, 110, 111, 111, 111,
- /* 170 */ 111, 129, 1425, 343, 1420, 339, 1059, 492, 1057, 263,
- /* 180 */ 73, 105, 102, 197, 994, 109, 109, 109, 109, 108,
- /* 190 */ 108, 107, 107, 107, 106, 401, 370, 111, 111, 111,
- /* 200 */ 111, 104, 492, 89, 1432, 109, 109, 109, 109, 108,
- /* 210 */ 108, 107, 107, 107, 106, 401, 111, 111, 111, 111,
- /* 220 */ 112, 113, 103, 1100, 1100, 953, 956, 946, 946, 110,
- /* 230 */ 110, 111, 111, 111, 111, 109, 109, 109, 109, 108,
- /* 240 */ 108, 107, 107, 107, 106, 401, 114, 108, 108, 107,
- /* 250 */ 107, 107, 106, 401, 109, 109, 109, 109, 108, 108,
- /* 260 */ 107, 107, 107, 106, 401, 152, 399, 399, 399, 109,
- /* 270 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 401,
- /* 280 */ 178, 493, 1412, 434, 1037, 1486, 1079, 515, 1486, 370,
- /* 290 */ 421, 297, 357, 412, 74, 1079, 109, 109, 109, 109,
- /* 300 */ 108, 108, 107, 107, 107, 106, 401, 1413, 37, 37,
- /* 310 */ 1431, 274, 506, 112, 113, 103, 1100, 1100, 953, 956,
- /* 320 */ 946, 946, 110, 110, 111, 111, 111, 111, 1436, 520,
- /* 330 */ 2, 1128, 1079, 1080, 1081, 430, 275, 1079, 127, 366,
- /* 340 */ 933, 1079, 1080, 1081, 220, 1205, 913, 458, 455, 454,
- /* 350 */ 392, 167, 515, 1035, 152, 445, 924, 453, 152, 874,
- /* 360 */ 923, 289, 109, 109, 109, 109, 108, 108, 107, 107,
- /* 370 */ 107, 106, 401, 13, 13, 261, 853, 252, 252, 227,
- /* 380 */ 106, 401, 370, 1079, 1080, 1081, 311, 388, 1079, 296,
- /* 390 */ 512, 923, 923, 925, 231, 323, 1255, 1388, 1423, 490,
- /* 400 */ 274, 506, 12, 208, 274, 506, 112, 113, 103, 1100,
- /* 410 */ 1100, 953, 956, 946, 946, 110, 110, 111, 111, 111,
- /* 420 */ 111, 1440, 286, 1128, 288, 1079, 1097, 247, 275, 1098,
- /* 430 */ 127, 387, 405, 389, 1079, 1080, 1081, 1205, 159, 238,
- /* 440 */ 255, 321, 461, 316, 460, 225, 790, 105, 102, 197,
- /* 450 */ 513, 314, 842, 842, 445, 109, 109, 109, 109, 108,
- /* 460 */ 108, 107, 107, 107, 106, 401, 515, 514, 515, 252,
- /* 470 */ 252, 1079, 1080, 1081, 435, 370, 1098, 933, 1460, 794,
- /* 480 */ 274, 506, 512, 105, 102, 197, 336, 63, 63, 64,
- /* 490 */ 64, 27, 790, 924, 287, 208, 1354, 923, 515, 112,
- /* 500 */ 113, 103, 1100, 1100, 953, 956, 946, 946, 110, 110,
- /* 510 */ 111, 111, 111, 111, 107, 107, 107, 106, 401, 49,
- /* 520 */ 49, 515, 28, 1079, 405, 497, 421, 297, 923, 923,
- /* 530 */ 925, 186, 468, 1079, 467, 999, 999, 442, 515, 1079,
- /* 540 */ 334, 515, 45, 45, 1083, 342, 173, 168, 109, 109,
- /* 550 */ 109, 109, 108, 108, 107, 107, 107, 106, 401, 13,
- /* 560 */ 13, 205, 13, 13, 252, 252, 1195, 1195, 370, 1079,
- /* 570 */ 1080, 1081, 787, 265, 5, 359, 494, 512, 469, 1079,
- /* 580 */ 1080, 1081, 398, 397, 1079, 1079, 1080, 1081, 3, 282,
- /* 590 */ 1079, 1083, 112, 113, 103, 1100, 1100, 953, 956, 946,
- /* 600 */ 946, 110, 110, 111, 111, 111, 111, 252, 252, 1015,
- /* 610 */ 220, 1079, 873, 458, 455, 454, 943, 943, 954, 957,
- /* 620 */ 512, 252, 252, 453, 1016, 1079, 445, 1107, 1209, 1107,
- /* 630 */ 1079, 1080, 1081, 515, 512, 426, 1079, 1080, 1081, 1017,
- /* 640 */ 512, 109, 109, 109, 109, 108, 108, 107, 107, 107,
- /* 650 */ 106, 401, 1052, 515, 50, 50, 515, 1079, 1080, 1081,
- /* 660 */ 828, 370, 1051, 379, 411, 1064, 1358, 207, 408, 773,
- /* 670 */ 829, 1079, 1080, 1081, 64, 64, 322, 64, 64, 1302,
- /* 680 */ 947, 411, 410, 1358, 1360, 112, 113, 103, 1100, 1100,
- /* 690 */ 953, 956, 946, 946, 110, 110, 111, 111, 111, 111,
- /* 700 */ 294, 482, 515, 1037, 1487, 515, 434, 1487, 354, 1120,
- /* 710 */ 483, 996, 913, 485, 466, 996, 132, 178, 33, 450,
- /* 720 */ 1203, 136, 406, 64, 64, 479, 64, 64, 419, 369,
- /* 730 */ 283, 1146, 252, 252, 109, 109, 109, 109, 108, 108,
- /* 740 */ 107, 107, 107, 106, 401, 512, 224, 440, 411, 266,
- /* 750 */ 1358, 266, 252, 252, 370, 296, 416, 284, 934, 396,
- /* 760 */ 976, 470, 400, 252, 252, 512, 9, 473, 231, 500,
- /* 770 */ 354, 1036, 1035, 1488, 355, 374, 512, 1121, 112, 113,
- /* 780 */ 103, 1100, 1100, 953, 956, 946, 946, 110, 110, 111,
- /* 790 */ 111, 111, 111, 252, 252, 1015, 515, 1347, 295, 252,
- /* 800 */ 252, 252, 252, 1098, 375, 249, 512, 445, 872, 322,
- /* 810 */ 1016, 480, 512, 195, 512, 434, 273, 15, 15, 515,
- /* 820 */ 314, 515, 95, 515, 93, 1017, 367, 109, 109, 109,
- /* 830 */ 109, 108, 108, 107, 107, 107, 106, 401, 515, 1121,
- /* 840 */ 39, 39, 51, 51, 52, 52, 503, 370, 515, 1204,
- /* 850 */ 1098, 918, 439, 341, 133, 436, 223, 222, 221, 53,
- /* 860 */ 53, 322, 1400, 761, 762, 763, 515, 370, 88, 54,
- /* 870 */ 54, 112, 113, 103, 1100, 1100, 953, 956, 946, 946,
- /* 880 */ 110, 110, 111, 111, 111, 111, 407, 55, 55, 196,
- /* 890 */ 515, 112, 113, 103, 1100, 1100, 953, 956, 946, 946,
- /* 900 */ 110, 110, 111, 111, 111, 111, 135, 264, 1149, 376,
- /* 910 */ 515, 40, 40, 515, 872, 515, 993, 515, 993, 116,
- /* 920 */ 109, 109, 109, 109, 108, 108, 107, 107, 107, 106,
- /* 930 */ 401, 41, 41, 515, 43, 43, 44, 44, 56, 56,
- /* 940 */ 109, 109, 109, 109, 108, 108, 107, 107, 107, 106,
- /* 950 */ 401, 515, 379, 515, 57, 57, 515, 799, 515, 379,
- /* 960 */ 515, 445, 200, 515, 323, 515, 1397, 515, 1459, 515,
- /* 970 */ 1287, 817, 58, 58, 14, 14, 515, 59, 59, 118,
- /* 980 */ 118, 60, 60, 515, 46, 46, 61, 61, 62, 62,
- /* 990 */ 47, 47, 515, 190, 189, 91, 515, 140, 140, 515,
- /* 1000 */ 394, 515, 277, 1200, 141, 141, 515, 1115, 515, 992,
- /* 1010 */ 515, 992, 515, 69, 69, 370, 278, 48, 48, 259,
- /* 1020 */ 65, 65, 119, 119, 246, 246, 260, 66, 66, 120,
- /* 1030 */ 120, 121, 121, 117, 117, 370, 515, 512, 383, 112,
- /* 1040 */ 113, 103, 1100, 1100, 953, 956, 946, 946, 110, 110,
- /* 1050 */ 111, 111, 111, 111, 515, 872, 515, 139, 139, 112,
- /* 1060 */ 113, 103, 1100, 1100, 953, 956, 946, 946, 110, 110,
- /* 1070 */ 111, 111, 111, 111, 1287, 138, 138, 125, 125, 515,
- /* 1080 */ 12, 515, 281, 1287, 515, 445, 131, 1287, 109, 109,
- /* 1090 */ 109, 109, 108, 108, 107, 107, 107, 106, 401, 515,
- /* 1100 */ 124, 124, 122, 122, 515, 123, 123, 515, 109, 109,
- /* 1110 */ 109, 109, 108, 108, 107, 107, 107, 106, 401, 515,
- /* 1120 */ 68, 68, 463, 783, 515, 70, 70, 302, 67, 67,
- /* 1130 */ 1032, 253, 253, 356, 1287, 191, 196, 1433, 465, 1301,
- /* 1140 */ 38, 38, 384, 94, 512, 42, 42, 177, 848, 274,
- /* 1150 */ 506, 385, 420, 847, 1356, 441, 508, 376, 377, 153,
- /* 1160 */ 423, 872, 432, 370, 224, 251, 194, 887, 182, 293,
- /* 1170 */ 783, 848, 88, 254, 466, 888, 847, 915, 807, 806,
- /* 1180 */ 230, 1241, 910, 370, 17, 413, 797, 112, 113, 103,
- /* 1190 */ 1100, 1100, 953, 956, 946, 946, 110, 110, 111, 111,
- /* 1200 */ 111, 111, 395, 814, 815, 1175, 983, 112, 101, 103,
- /* 1210 */ 1100, 1100, 953, 956, 946, 946, 110, 110, 111, 111,
- /* 1220 */ 111, 111, 375, 422, 427, 429, 298, 230, 230, 88,
- /* 1230 */ 1240, 451, 312, 797, 226, 88, 109, 109, 109, 109,
- /* 1240 */ 108, 108, 107, 107, 107, 106, 401, 86, 433, 979,
- /* 1250 */ 927, 881, 226, 983, 230, 415, 109, 109, 109, 109,
- /* 1260 */ 108, 108, 107, 107, 107, 106, 401, 320, 845, 781,
- /* 1270 */ 846, 100, 130, 100, 1403, 290, 370, 319, 1377, 1376,
- /* 1280 */ 437, 1449, 299, 1237, 303, 306, 308, 310, 1188, 1174,
- /* 1290 */ 1173, 1172, 315, 324, 325, 1228, 370, 927, 1249, 271,
- /* 1300 */ 1286, 113, 103, 1100, 1100, 953, 956, 946, 946, 110,
- /* 1310 */ 110, 111, 111, 111, 111, 1224, 1235, 502, 501, 1292,
- /* 1320 */ 1221, 1155, 103, 1100, 1100, 953, 956, 946, 946, 110,
- /* 1330 */ 110, 111, 111, 111, 111, 1148, 1137, 1136, 1138, 1443,
- /* 1340 */ 446, 244, 184, 98, 507, 188, 4, 353, 327, 109,
- /* 1350 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 401,
- /* 1360 */ 510, 329, 331, 199, 414, 456, 292, 285, 318, 109,
- /* 1370 */ 109, 109, 109, 108, 108, 107, 107, 107, 106, 401,
- /* 1380 */ 11, 1271, 1279, 402, 361, 192, 1171, 1351, 431, 505,
- /* 1390 */ 346, 1350, 333, 98, 507, 504, 4, 187, 1446, 1115,
- /* 1400 */ 233, 1396, 155, 1394, 1112, 152, 72, 75, 378, 425,
- /* 1410 */ 510, 165, 149, 157, 933, 1276, 86, 30, 1268, 417,
- /* 1420 */ 96, 96, 8, 160, 161, 162, 163, 97, 418, 402,
- /* 1430 */ 517, 516, 449, 402, 923, 210, 358, 424, 1282, 438,
- /* 1440 */ 169, 214, 360, 1345, 80, 504, 31, 444, 1365, 301,
- /* 1450 */ 245, 274, 506, 216, 174, 305, 488, 447, 217, 462,
- /* 1460 */ 1139, 487, 218, 363, 933, 923, 923, 925, 926, 24,
- /* 1470 */ 96, 96, 1191, 1190, 1189, 391, 1182, 97, 1163, 402,
- /* 1480 */ 517, 516, 799, 364, 923, 1162, 317, 1161, 98, 507,
- /* 1490 */ 1181, 4, 1458, 472, 393, 269, 270, 475, 481, 1232,
- /* 1500 */ 85, 1233, 326, 328, 232, 510, 495, 1231, 330, 98,
- /* 1510 */ 507, 1230, 4, 486, 335, 923, 923, 925, 926, 24,
- /* 1520 */ 1435, 1068, 404, 181, 336, 256, 510, 115, 402, 332,
- /* 1530 */ 352, 352, 351, 241, 349, 1214, 1414, 770, 338, 10,
- /* 1540 */ 504, 340, 272, 92, 1331, 1213, 87, 183, 484, 402,
- /* 1550 */ 201, 488, 280, 239, 344, 345, 489, 1145, 29, 933,
- /* 1560 */ 279, 504, 1074, 518, 240, 96, 96, 242, 243, 519,
- /* 1570 */ 1134, 1129, 97, 154, 402, 517, 516, 372, 373, 923,
- /* 1580 */ 933, 142, 143, 128, 1381, 267, 96, 96, 852, 757,
- /* 1590 */ 203, 144, 403, 97, 1382, 402, 517, 516, 204, 1380,
- /* 1600 */ 923, 146, 1379, 1159, 1158, 71, 1156, 276, 202, 185,
- /* 1610 */ 923, 923, 925, 926, 24, 198, 257, 126, 991, 989,
- /* 1620 */ 907, 98, 507, 156, 4, 145, 158, 206, 831, 209,
- /* 1630 */ 291, 923, 923, 925, 926, 24, 1005, 911, 510, 164,
- /* 1640 */ 147, 380, 371, 382, 166, 76, 77, 274, 506, 148,
- /* 1650 */ 78, 79, 1008, 211, 212, 1004, 137, 213, 18, 300,
- /* 1660 */ 230, 402, 997, 1109, 443, 215, 32, 170, 171, 772,
- /* 1670 */ 409, 448, 319, 504, 219, 172, 452, 81, 19, 457,
- /* 1680 */ 313, 20, 82, 268, 488, 150, 810, 179, 83, 487,
- /* 1690 */ 464, 151, 933, 180, 959, 84, 1040, 34, 96, 96,
- /* 1700 */ 471, 1041, 35, 474, 193, 97, 248, 402, 517, 516,
- /* 1710 */ 1068, 404, 923, 250, 256, 880, 229, 175, 875, 352,
- /* 1720 */ 352, 351, 241, 349, 100, 21, 770, 22, 1054, 1056,
- /* 1730 */ 7, 98, 507, 1045, 4, 337, 1058, 23, 974, 201,
- /* 1740 */ 176, 280, 88, 923, 923, 925, 926, 24, 510, 279,
- /* 1750 */ 960, 958, 962, 1014, 963, 1013, 235, 234, 25, 36,
- /* 1760 */ 99, 90, 507, 928, 4, 511, 350, 782, 26, 841,
- /* 1770 */ 236, 402, 347, 1069, 237, 1125, 1125, 1451, 510, 203,
- /* 1780 */ 1450, 1125, 1125, 504, 1125, 1125, 1125, 204, 1125, 1125,
- /* 1790 */ 146, 1125, 1125, 1125, 1125, 1125, 1125, 202, 1125, 1125,
- /* 1800 */ 1125, 402, 933, 1125, 1125, 1125, 1125, 1125, 96, 96,
- /* 1810 */ 1125, 1125, 1125, 504, 1125, 97, 1125, 402, 517, 516,
- /* 1820 */ 1125, 1125, 923, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 1830 */ 1125, 371, 933, 1125, 1125, 1125, 274, 506, 96, 96,
- /* 1840 */ 1125, 1125, 1125, 1125, 1125, 97, 1125, 402, 517, 516,
- /* 1850 */ 1125, 1125, 923, 923, 923, 925, 926, 24, 1125, 409,
- /* 1860 */ 1125, 1125, 1125, 256, 1125, 1125, 1125, 1125, 352, 352,
- /* 1870 */ 351, 241, 349, 1125, 1125, 770, 1125, 1125, 1125, 1125,
- /* 1880 */ 1125, 1125, 1125, 923, 923, 925, 926, 24, 201, 1125,
- /* 1890 */ 280, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 279, 1125,
- /* 1900 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 1910 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 1920 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 203, 1125,
- /* 1930 */ 1125, 1125, 1125, 1125, 1125, 1125, 204, 1125, 1125, 146,
- /* 1940 */ 1125, 1125, 1125, 1125, 1125, 1125, 202, 1125, 1125, 1125,
- /* 1950 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 1960 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 1970 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 1980 */ 371, 1125, 1125, 1125, 1125, 274, 506, 1125, 1125, 1125,
- /* 1990 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125,
- /* 2000 */ 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 409,
+ /* 0 */ 377, 518, 371, 107, 104, 200, 1293, 518, 1130, 1,
+ /* 10 */ 1, 523, 2, 1134, 518, 1203, 1203, 1262, 277, 373,
+ /* 20 */ 129, 495, 37, 37, 1397, 1201, 1201, 1211, 65, 65,
+ /* 30 */ 480, 891, 107, 104, 200, 37, 37, 1043, 1494, 892,
+ /* 40 */ 346, 1494, 342, 114, 115, 105, 1106, 1106, 957, 960,
+ /* 50 */ 950, 950, 112, 112, 113, 113, 113, 113, 285, 254,
+ /* 60 */ 254, 518, 254, 254, 500, 518, 495, 518, 107, 104,
+ /* 70 */ 200, 1085, 515, 481, 386, 515, 1464, 442, 501, 230,
+ /* 80 */ 197, 439, 37, 37, 1172, 210, 65, 65, 65, 65,
+ /* 90 */ 254, 254, 111, 111, 111, 111, 110, 110, 109, 109,
+ /* 100 */ 109, 108, 404, 515, 404, 155, 1041, 431, 401, 400,
+ /* 110 */ 254, 254, 373, 1431, 1427, 408, 1110, 1085, 1086, 1087,
+ /* 120 */ 284, 1112, 500, 515, 500, 368, 1433, 1421, 1428, 1111,
+ /* 130 */ 1261, 499, 373, 502, 108, 404, 114, 115, 105, 1106,
+ /* 140 */ 1106, 957, 960, 950, 950, 112, 112, 113, 113, 113,
+ /* 150 */ 113, 276, 509, 1113, 369, 1113, 114, 115, 105, 1106,
+ /* 160 */ 1106, 957, 960, 950, 950, 112, 112, 113, 113, 113,
+ /* 170 */ 113, 496, 1420, 1431, 493, 1468, 1065, 260, 1063, 433,
+ /* 180 */ 74, 107, 104, 200, 498, 111, 111, 111, 111, 110,
+ /* 190 */ 110, 109, 109, 109, 108, 404, 373, 113, 113, 113,
+ /* 200 */ 113, 106, 131, 91, 1361, 111, 111, 111, 111, 110,
+ /* 210 */ 110, 109, 109, 109, 108, 404, 113, 113, 113, 113,
+ /* 220 */ 114, 115, 105, 1106, 1106, 957, 960, 950, 950, 112,
+ /* 230 */ 112, 113, 113, 113, 113, 111, 111, 111, 111, 110,
+ /* 240 */ 110, 109, 109, 109, 108, 404, 116, 110, 110, 109,
+ /* 250 */ 109, 109, 108, 404, 111, 111, 111, 111, 110, 110,
+ /* 260 */ 109, 109, 109, 108, 404, 917, 512, 512, 512, 111,
+ /* 270 */ 111, 111, 111, 110, 110, 109, 109, 109, 108, 404,
+ /* 280 */ 517, 1198, 1177, 181, 109, 109, 109, 108, 404, 373,
+ /* 290 */ 1198, 402, 402, 402, 75, 360, 111, 111, 111, 111,
+ /* 300 */ 110, 110, 109, 109, 109, 108, 404, 382, 299, 419,
+ /* 310 */ 287, 170, 518, 114, 115, 105, 1106, 1106, 957, 960,
+ /* 320 */ 950, 950, 112, 112, 113, 113, 113, 113, 1444, 523,
+ /* 330 */ 2, 1134, 518, 13, 13, 337, 277, 1085, 129, 226,
+ /* 340 */ 937, 1058, 1000, 471, 917, 1211, 453, 384, 1085, 395,
+ /* 350 */ 162, 1057, 155, 45, 45, 416, 928, 401, 400, 479,
+ /* 360 */ 927, 12, 111, 111, 111, 111, 110, 110, 109, 109,
+ /* 370 */ 109, 108, 404, 226, 286, 254, 254, 254, 254, 518,
+ /* 380 */ 16, 16, 373, 1085, 1086, 1087, 314, 299, 515, 472,
+ /* 390 */ 515, 927, 927, 929, 1085, 1086, 1087, 378, 276, 509,
+ /* 400 */ 65, 65, 1113, 210, 1113, 1085, 114, 115, 105, 1106,
+ /* 410 */ 1106, 957, 960, 950, 950, 112, 112, 113, 113, 113,
+ /* 420 */ 113, 1448, 222, 1134, 1089, 461, 458, 457, 277, 180,
+ /* 430 */ 129, 378, 392, 408, 423, 456, 500, 1211, 240, 257,
+ /* 440 */ 324, 464, 319, 463, 227, 470, 12, 317, 424, 300,
+ /* 450 */ 317, 1085, 1086, 1087, 485, 111, 111, 111, 111, 110,
+ /* 460 */ 110, 109, 109, 109, 108, 404, 181, 118, 1085, 254,
+ /* 470 */ 254, 1089, 518, 90, 351, 373, 518, 1181, 365, 798,
+ /* 480 */ 1440, 339, 515, 248, 248, 77, 325, 133, 1085, 249,
+ /* 490 */ 424, 300, 794, 49, 49, 210, 515, 65, 65, 114,
+ /* 500 */ 115, 105, 1106, 1106, 957, 960, 950, 950, 112, 112,
+ /* 510 */ 113, 113, 113, 113, 1085, 1086, 1087, 222, 1085, 438,
+ /* 520 */ 461, 458, 457, 937, 787, 408, 171, 857, 362, 1021,
+ /* 530 */ 456, 136, 198, 486, 1085, 1086, 1087, 448, 794, 928,
+ /* 540 */ 5, 193, 192, 927, 1022, 107, 104, 200, 111, 111,
+ /* 550 */ 111, 111, 110, 110, 109, 109, 109, 108, 404, 1023,
+ /* 560 */ 254, 254, 803, 1085, 1085, 1086, 1087, 437, 373, 1085,
+ /* 570 */ 344, 787, 791, 515, 927, 927, 929, 1085, 1408, 1396,
+ /* 580 */ 832, 1085, 176, 3, 852, 1085, 518, 1439, 429, 851,
+ /* 590 */ 833, 518, 114, 115, 105, 1106, 1106, 957, 960, 950,
+ /* 600 */ 950, 112, 112, 113, 113, 113, 113, 13, 13, 1085,
+ /* 610 */ 1086, 1087, 13, 13, 518, 1085, 1086, 1087, 1496, 358,
+ /* 620 */ 1085, 389, 1234, 1085, 1086, 1087, 391, 1085, 1086, 1087,
+ /* 630 */ 448, 1085, 1086, 1087, 518, 65, 65, 947, 947, 958,
+ /* 640 */ 961, 111, 111, 111, 111, 110, 110, 109, 109, 109,
+ /* 650 */ 108, 404, 518, 382, 878, 13, 13, 518, 877, 518,
+ /* 660 */ 263, 373, 518, 431, 448, 1070, 1085, 1086, 1087, 267,
+ /* 670 */ 448, 488, 1360, 64, 64, 431, 812, 155, 50, 50,
+ /* 680 */ 65, 65, 518, 65, 65, 114, 115, 105, 1106, 1106,
+ /* 690 */ 957, 960, 950, 950, 112, 112, 113, 113, 113, 113,
+ /* 700 */ 518, 951, 382, 13, 13, 415, 411, 462, 414, 1085,
+ /* 710 */ 1366, 777, 1210, 292, 297, 813, 399, 497, 181, 403,
+ /* 720 */ 261, 15, 15, 276, 509, 414, 413, 1366, 1368, 410,
+ /* 730 */ 372, 345, 1209, 264, 111, 111, 111, 111, 110, 110,
+ /* 740 */ 109, 109, 109, 108, 404, 265, 254, 254, 229, 1405,
+ /* 750 */ 268, 1215, 268, 1103, 373, 1085, 1086, 1087, 938, 515,
+ /* 760 */ 393, 409, 876, 515, 254, 254, 1152, 482, 473, 262,
+ /* 770 */ 422, 476, 325, 503, 289, 518, 291, 515, 114, 115,
+ /* 780 */ 105, 1106, 1106, 957, 960, 950, 950, 112, 112, 113,
+ /* 790 */ 113, 113, 113, 414, 1021, 1366, 39, 39, 254, 254,
+ /* 800 */ 254, 254, 980, 254, 254, 254, 254, 255, 255, 1022,
+ /* 810 */ 279, 515, 516, 515, 846, 846, 515, 138, 515, 518,
+ /* 820 */ 515, 1043, 1495, 251, 1023, 1495, 876, 111, 111, 111,
+ /* 830 */ 111, 110, 110, 109, 109, 109, 108, 404, 518, 1353,
+ /* 840 */ 51, 51, 518, 199, 518, 506, 290, 373, 518, 276,
+ /* 850 */ 509, 922, 9, 483, 233, 1005, 1005, 445, 189, 52,
+ /* 860 */ 52, 325, 280, 53, 53, 54, 54, 373, 876, 55,
+ /* 870 */ 55, 114, 115, 105, 1106, 1106, 957, 960, 950, 950,
+ /* 880 */ 112, 112, 113, 113, 113, 113, 97, 518, 95, 1104,
+ /* 890 */ 1041, 114, 115, 105, 1106, 1106, 957, 960, 950, 950,
+ /* 900 */ 112, 112, 113, 113, 113, 113, 135, 199, 56, 56,
+ /* 910 */ 765, 766, 767, 225, 224, 223, 518, 283, 437, 233,
+ /* 920 */ 111, 111, 111, 111, 110, 110, 109, 109, 109, 108,
+ /* 930 */ 404, 1002, 876, 326, 518, 1002, 1104, 40, 40, 518,
+ /* 940 */ 111, 111, 111, 111, 110, 110, 109, 109, 109, 108,
+ /* 950 */ 404, 518, 448, 518, 1104, 41, 41, 518, 17, 518,
+ /* 960 */ 43, 43, 1155, 379, 518, 448, 518, 443, 518, 390,
+ /* 970 */ 518, 194, 44, 44, 57, 57, 1247, 518, 58, 58,
+ /* 980 */ 59, 59, 518, 466, 326, 14, 14, 60, 60, 120,
+ /* 990 */ 120, 61, 61, 449, 1206, 93, 518, 425, 46, 46,
+ /* 1000 */ 518, 1104, 518, 62, 62, 518, 437, 305, 518, 852,
+ /* 1010 */ 518, 298, 518, 1246, 851, 373, 518, 63, 63, 1293,
+ /* 1020 */ 397, 47, 47, 142, 142, 1467, 143, 143, 821, 70,
+ /* 1030 */ 70, 48, 48, 66, 66, 373, 518, 121, 121, 114,
+ /* 1040 */ 115, 105, 1106, 1106, 957, 960, 950, 950, 112, 112,
+ /* 1050 */ 113, 113, 113, 113, 518, 418, 518, 67, 67, 114,
+ /* 1060 */ 115, 105, 1106, 1106, 957, 960, 950, 950, 112, 112,
+ /* 1070 */ 113, 113, 113, 113, 312, 122, 122, 123, 123, 1293,
+ /* 1080 */ 518, 357, 1126, 88, 518, 435, 325, 387, 111, 111,
+ /* 1090 */ 111, 111, 110, 110, 109, 109, 109, 108, 404, 266,
+ /* 1100 */ 518, 119, 119, 518, 1293, 141, 141, 518, 111, 111,
+ /* 1110 */ 111, 111, 110, 110, 109, 109, 109, 108, 404, 518,
+ /* 1120 */ 801, 140, 140, 518, 127, 127, 511, 379, 126, 126,
+ /* 1130 */ 518, 137, 518, 1308, 518, 307, 518, 310, 518, 203,
+ /* 1140 */ 124, 124, 1307, 96, 125, 125, 207, 388, 1441, 468,
+ /* 1150 */ 1127, 69, 69, 71, 71, 68, 68, 38, 38, 42,
+ /* 1160 */ 42, 357, 1042, 373, 1293, 276, 509, 801, 185, 469,
+ /* 1170 */ 494, 436, 444, 6, 380, 156, 253, 197, 469, 134,
+ /* 1180 */ 426, 33, 1038, 373, 1121, 359, 1411, 114, 115, 105,
+ /* 1190 */ 1106, 1106, 957, 960, 950, 950, 112, 112, 113, 113,
+ /* 1200 */ 113, 113, 914, 296, 27, 293, 90, 114, 103, 105,
+ /* 1210 */ 1106, 1106, 957, 960, 950, 950, 112, 112, 113, 113,
+ /* 1220 */ 113, 113, 919, 275, 430, 232, 891, 232, 432, 256,
+ /* 1230 */ 1127, 232, 398, 370, 892, 28, 111, 111, 111, 111,
+ /* 1240 */ 110, 110, 109, 109, 109, 108, 404, 301, 454, 1385,
+ /* 1250 */ 90, 228, 209, 987, 811, 810, 111, 111, 111, 111,
+ /* 1260 */ 110, 110, 109, 109, 109, 108, 404, 315, 818, 819,
+ /* 1270 */ 90, 323, 983, 931, 885, 228, 373, 232, 999, 849,
+ /* 1280 */ 999, 322, 102, 998, 1384, 998, 785, 850, 440, 132,
+ /* 1290 */ 102, 302, 1243, 306, 309, 311, 373, 313, 1194, 1180,
+ /* 1300 */ 987, 115, 105, 1106, 1106, 957, 960, 950, 950, 112,
+ /* 1310 */ 112, 113, 113, 113, 113, 1178, 1179, 318, 327, 328,
+ /* 1320 */ 931, 1255, 105, 1106, 1106, 957, 960, 950, 950, 112,
+ /* 1330 */ 112, 113, 113, 113, 113, 1292, 1230, 1457, 273, 1241,
+ /* 1340 */ 504, 505, 1298, 100, 510, 246, 4, 1161, 1154, 111,
+ /* 1350 */ 111, 111, 111, 110, 110, 109, 109, 109, 108, 404,
+ /* 1360 */ 513, 1143, 187, 1142, 202, 1144, 1451, 356, 1227, 111,
+ /* 1370 */ 111, 111, 111, 110, 110, 109, 109, 109, 108, 404,
+ /* 1380 */ 11, 1277, 330, 405, 332, 334, 191, 1285, 364, 195,
+ /* 1390 */ 295, 417, 288, 100, 510, 507, 4, 434, 459, 321,
+ /* 1400 */ 1177, 349, 1357, 1356, 336, 155, 190, 1454, 1121, 158,
+ /* 1410 */ 513, 508, 235, 1404, 937, 1402, 1118, 381, 77, 428,
+ /* 1420 */ 98, 98, 8, 1282, 168, 30, 152, 99, 160, 405,
+ /* 1430 */ 520, 519, 88, 405, 927, 1362, 1274, 420, 163, 73,
+ /* 1440 */ 164, 76, 165, 166, 421, 507, 452, 212, 361, 363,
+ /* 1450 */ 427, 276, 509, 31, 1288, 172, 491, 441, 216, 1351,
+ /* 1460 */ 82, 490, 447, 1373, 937, 927, 927, 929, 930, 24,
+ /* 1470 */ 98, 98, 304, 247, 218, 177, 308, 99, 219, 405,
+ /* 1480 */ 520, 519, 450, 1145, 927, 220, 366, 1197, 100, 510,
+ /* 1490 */ 465, 4, 1188, 1196, 1195, 394, 803, 1169, 1187, 367,
+ /* 1500 */ 1168, 396, 484, 320, 1167, 513, 1466, 87, 475, 100,
+ /* 1510 */ 510, 271, 4, 272, 478, 927, 927, 929, 930, 24,
+ /* 1520 */ 1443, 1074, 407, 1238, 1239, 258, 513, 329, 405, 331,
+ /* 1530 */ 355, 355, 354, 243, 352, 234, 489, 774, 498, 184,
+ /* 1540 */ 507, 338, 1422, 339, 117, 1220, 10, 341, 333, 405,
+ /* 1550 */ 204, 491, 282, 1219, 1237, 1236, 492, 335, 343, 937,
+ /* 1560 */ 281, 507, 94, 1337, 186, 98, 98, 347, 89, 487,
+ /* 1570 */ 348, 241, 99, 29, 405, 520, 519, 274, 1151, 927,
+ /* 1580 */ 937, 521, 1080, 245, 242, 244, 98, 98, 856, 522,
+ /* 1590 */ 206, 1140, 1135, 99, 144, 405, 520, 519, 147, 375,
+ /* 1600 */ 927, 149, 376, 157, 1389, 1390, 1388, 1387, 205, 145,
+ /* 1610 */ 927, 927, 929, 930, 24, 146, 130, 761, 1165, 1164,
+ /* 1620 */ 72, 100, 510, 1162, 4, 269, 406, 188, 278, 201,
+ /* 1630 */ 259, 927, 927, 929, 930, 24, 128, 911, 513, 997,
+ /* 1640 */ 995, 159, 374, 208, 148, 161, 835, 276, 509, 211,
+ /* 1650 */ 294, 1011, 915, 167, 150, 383, 169, 78, 385, 79,
+ /* 1660 */ 80, 405, 81, 151, 1014, 213, 214, 1010, 139, 18,
+ /* 1670 */ 412, 215, 303, 507, 232, 1115, 1003, 446, 173, 217,
+ /* 1680 */ 174, 32, 776, 451, 491, 322, 221, 175, 814, 490,
+ /* 1690 */ 83, 455, 937, 19, 460, 316, 20, 84, 98, 98,
+ /* 1700 */ 270, 182, 85, 467, 153, 99, 154, 405, 520, 519,
+ /* 1710 */ 1074, 407, 927, 183, 258, 963, 1046, 86, 34, 355,
+ /* 1720 */ 355, 354, 243, 352, 474, 1047, 774, 35, 477, 196,
+ /* 1730 */ 250, 100, 510, 252, 4, 884, 178, 231, 1060, 204,
+ /* 1740 */ 21, 282, 102, 927, 927, 929, 930, 24, 513, 281,
+ /* 1750 */ 879, 22, 1064, 1062, 1051, 7, 340, 23, 978, 179,
+ /* 1760 */ 90, 92, 510, 964, 4, 236, 962, 966, 1020, 1019,
+ /* 1770 */ 237, 405, 967, 25, 36, 514, 932, 786, 513, 206,
+ /* 1780 */ 101, 26, 845, 507, 238, 239, 1459, 147, 350, 1458,
+ /* 1790 */ 149, 353, 1075, 1131, 1131, 1131, 1131, 205, 1131, 1131,
+ /* 1800 */ 1131, 405, 937, 1131, 1131, 1131, 1131, 1131, 98, 98,
+ /* 1810 */ 1131, 1131, 1131, 507, 1131, 99, 1131, 405, 520, 519,
+ /* 1820 */ 1131, 1131, 927, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 1830 */ 1131, 374, 937, 1131, 1131, 1131, 276, 509, 98, 98,
+ /* 1840 */ 1131, 1131, 1131, 1131, 1131, 99, 1131, 405, 520, 519,
+ /* 1850 */ 1131, 1131, 927, 927, 927, 929, 930, 24, 1131, 412,
+ /* 1860 */ 1131, 1131, 1131, 258, 1131, 1131, 1131, 1131, 355, 355,
+ /* 1870 */ 354, 243, 352, 1131, 1131, 774, 1131, 1131, 1131, 1131,
+ /* 1880 */ 1131, 1131, 1131, 927, 927, 929, 930, 24, 204, 1131,
+ /* 1890 */ 282, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 281, 1131,
+ /* 1900 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 1910 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 1920 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 206, 1131,
+ /* 1930 */ 1131, 1131, 1131, 1131, 1131, 1131, 147, 1131, 1131, 149,
+ /* 1940 */ 1131, 1131, 1131, 1131, 1131, 1131, 205, 1131, 1131, 1131,
+ /* 1950 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 1960 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 1970 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 1980 */ 374, 1131, 1131, 1131, 1131, 276, 509, 1131, 1131, 1131,
+ /* 1990 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
+ /* 2000 */ 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 412,
};
static const YYCODETYPE yy_lookahead[] = {
- /* 0 */ 184, 238, 239, 240, 238, 239, 240, 163, 155, 156,
- /* 10 */ 157, 158, 159, 160, 163, 191, 192, 183, 165, 19,
- /* 20 */ 167, 258, 202, 203, 200, 191, 163, 174, 184, 185,
- /* 30 */ 174, 31, 163, 163, 171, 184, 185, 35, 175, 39,
- /* 40 */ 179, 180, 181, 43, 44, 45, 46, 47, 48, 49,
- /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 184, 206,
- /* 60 */ 207, 163, 206, 207, 220, 163, 16, 163, 66, 163,
- /* 70 */ 59, 270, 219, 229, 273, 219, 74, 208, 174, 223,
- /* 80 */ 224, 163, 184, 185, 163, 232, 184, 185, 184, 185,
- /* 90 */ 184, 185, 92, 93, 94, 95, 96, 97, 98, 99,
- /* 100 */ 100, 101, 102, 233, 198, 184, 185, 96, 97, 163,
- /* 110 */ 206, 207, 19, 163, 261, 104, 105, 106, 107, 198,
- /* 120 */ 109, 119, 220, 219, 220, 274, 275, 77, 117, 79,
- /* 130 */ 187, 229, 19, 229, 184, 185, 43, 44, 45, 46,
+ /* 0 */ 168, 163, 184, 238, 239, 240, 163, 163, 155, 156,
+ /* 10 */ 157, 158, 159, 160, 163, 202, 203, 187, 165, 19,
+ /* 20 */ 167, 163, 184, 185, 259, 202, 203, 174, 184, 185,
+ /* 30 */ 174, 31, 238, 239, 240, 184, 185, 22, 23, 39,
+ /* 40 */ 216, 26, 218, 43, 44, 45, 46, 47, 48, 49,
+ /* 50 */ 50, 51, 52, 53, 54, 55, 56, 57, 174, 206,
+ /* 60 */ 207, 163, 206, 207, 220, 163, 163, 163, 238, 239,
+ /* 70 */ 240, 59, 219, 229, 231, 219, 183, 245, 174, 223,
+ /* 80 */ 224, 249, 184, 185, 191, 232, 184, 185, 184, 185,
+ /* 90 */ 206, 207, 92, 93, 94, 95, 96, 97, 98, 99,
+ /* 100 */ 100, 101, 102, 219, 102, 81, 91, 163, 96, 97,
+ /* 110 */ 206, 207, 19, 275, 276, 262, 104, 105, 106, 107,
+ /* 120 */ 163, 109, 220, 219, 220, 184, 275, 269, 277, 117,
+ /* 130 */ 187, 229, 19, 229, 101, 102, 43, 44, 45, 46,
/* 140 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- /* 150 */ 57, 233, 141, 134, 143, 102, 43, 44, 45, 46,
+ /* 150 */ 57, 127, 128, 141, 184, 143, 43, 44, 45, 46,
/* 160 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- /* 170 */ 57, 152, 274, 216, 276, 218, 83, 163, 85, 233,
- /* 180 */ 67, 238, 239, 240, 11, 92, 93, 94, 95, 96,
+ /* 170 */ 57, 268, 269, 275, 276, 197, 83, 233, 85, 163,
+ /* 180 */ 67, 238, 239, 240, 134, 92, 93, 94, 95, 96,
/* 190 */ 97, 98, 99, 100, 101, 102, 19, 54, 55, 56,
- /* 200 */ 57, 58, 163, 26, 163, 92, 93, 94, 95, 96,
+ /* 200 */ 57, 58, 152, 26, 247, 92, 93, 94, 95, 96,
/* 210 */ 97, 98, 99, 100, 101, 102, 54, 55, 56, 57,
/* 220 */ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
/* 230 */ 53, 54, 55, 56, 57, 92, 93, 94, 95, 96,
/* 240 */ 97, 98, 99, 100, 101, 102, 69, 96, 97, 98,
/* 250 */ 99, 100, 101, 102, 92, 93, 94, 95, 96, 97,
- /* 260 */ 98, 99, 100, 101, 102, 81, 179, 180, 181, 92,
+ /* 260 */ 98, 99, 100, 101, 102, 73, 179, 180, 181, 92,
/* 270 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- /* 280 */ 163, 267, 268, 163, 22, 23, 59, 163, 26, 19,
- /* 290 */ 117, 118, 175, 109, 24, 59, 92, 93, 94, 95,
- /* 300 */ 96, 97, 98, 99, 100, 101, 102, 268, 184, 185,
- /* 310 */ 269, 127, 128, 43, 44, 45, 46, 47, 48, 49,
+ /* 280 */ 163, 191, 192, 163, 98, 99, 100, 101, 102, 19,
+ /* 290 */ 200, 179, 180, 181, 24, 175, 92, 93, 94, 95,
+ /* 300 */ 96, 97, 98, 99, 100, 101, 102, 163, 116, 117,
+ /* 310 */ 118, 22, 163, 43, 44, 45, 46, 47, 48, 49,
/* 320 */ 50, 51, 52, 53, 54, 55, 56, 57, 157, 158,
- /* 330 */ 159, 160, 105, 106, 107, 163, 165, 59, 167, 184,
- /* 340 */ 90, 105, 106, 107, 108, 174, 73, 111, 112, 113,
- /* 350 */ 19, 22, 163, 91, 81, 163, 106, 121, 81, 132,
- /* 360 */ 110, 16, 92, 93, 94, 95, 96, 97, 98, 99,
- /* 370 */ 100, 101, 102, 184, 185, 255, 98, 206, 207, 26,
- /* 380 */ 101, 102, 19, 105, 106, 107, 23, 198, 59, 116,
- /* 390 */ 219, 141, 142, 143, 24, 163, 187, 205, 274, 275,
- /* 400 */ 127, 128, 182, 232, 127, 128, 43, 44, 45, 46,
+ /* 330 */ 159, 160, 163, 184, 185, 163, 165, 59, 167, 46,
+ /* 340 */ 90, 76, 11, 174, 73, 174, 19, 198, 59, 19,
+ /* 350 */ 72, 86, 81, 184, 185, 234, 106, 96, 97, 163,
+ /* 360 */ 110, 182, 92, 93, 94, 95, 96, 97, 98, 99,
+ /* 370 */ 100, 101, 102, 46, 230, 206, 207, 206, 207, 163,
+ /* 380 */ 184, 185, 19, 105, 106, 107, 23, 116, 219, 220,
+ /* 390 */ 219, 141, 142, 143, 105, 106, 107, 104, 127, 128,
+ /* 400 */ 184, 185, 141, 232, 143, 59, 43, 44, 45, 46,
/* 410 */ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
- /* 420 */ 57, 158, 77, 160, 79, 59, 26, 182, 165, 59,
- /* 430 */ 167, 199, 261, 102, 105, 106, 107, 174, 72, 108,
- /* 440 */ 109, 110, 111, 112, 113, 114, 59, 238, 239, 240,
- /* 450 */ 123, 120, 125, 126, 163, 92, 93, 94, 95, 96,
- /* 460 */ 97, 98, 99, 100, 101, 102, 163, 163, 163, 206,
- /* 470 */ 207, 105, 106, 107, 254, 19, 106, 90, 197, 23,
- /* 480 */ 127, 128, 219, 238, 239, 240, 22, 184, 185, 184,
- /* 490 */ 185, 22, 105, 106, 149, 232, 205, 110, 163, 43,
+ /* 420 */ 57, 158, 108, 160, 59, 111, 112, 113, 165, 250,
+ /* 430 */ 167, 104, 102, 262, 255, 121, 220, 174, 108, 109,
+ /* 440 */ 110, 111, 112, 113, 114, 229, 182, 120, 117, 118,
+ /* 450 */ 120, 105, 106, 107, 163, 92, 93, 94, 95, 96,
+ /* 460 */ 97, 98, 99, 100, 101, 102, 163, 22, 59, 206,
+ /* 470 */ 207, 106, 163, 26, 171, 19, 163, 193, 175, 23,
+ /* 480 */ 163, 22, 219, 206, 207, 139, 163, 22, 59, 182,
+ /* 490 */ 117, 118, 59, 184, 185, 232, 219, 184, 185, 43,
/* 500 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- /* 510 */ 54, 55, 56, 57, 98, 99, 100, 101, 102, 184,
- /* 520 */ 185, 163, 53, 59, 261, 220, 117, 118, 141, 142,
- /* 530 */ 143, 131, 174, 59, 229, 116, 117, 118, 163, 59,
- /* 540 */ 163, 163, 184, 185, 59, 242, 72, 22, 92, 93,
- /* 550 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 184,
- /* 560 */ 185, 24, 184, 185, 206, 207, 202, 203, 19, 105,
- /* 570 */ 106, 107, 23, 198, 22, 174, 198, 219, 220, 105,
- /* 580 */ 106, 107, 96, 97, 59, 105, 106, 107, 22, 174,
- /* 590 */ 59, 106, 43, 44, 45, 46, 47, 48, 49, 50,
- /* 600 */ 51, 52, 53, 54, 55, 56, 57, 206, 207, 12,
- /* 610 */ 108, 59, 132, 111, 112, 113, 46, 47, 48, 49,
- /* 620 */ 219, 206, 207, 121, 27, 59, 163, 141, 207, 143,
- /* 630 */ 105, 106, 107, 163, 219, 234, 105, 106, 107, 42,
- /* 640 */ 219, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- /* 650 */ 101, 102, 76, 163, 184, 185, 163, 105, 106, 107,
- /* 660 */ 63, 19, 86, 163, 163, 23, 163, 130, 205, 21,
- /* 670 */ 73, 105, 106, 107, 184, 185, 163, 184, 185, 237,
- /* 680 */ 110, 180, 181, 180, 181, 43, 44, 45, 46, 47,
+ /* 510 */ 54, 55, 56, 57, 105, 106, 107, 108, 59, 255,
+ /* 520 */ 111, 112, 113, 90, 59, 262, 22, 98, 174, 12,
+ /* 530 */ 121, 208, 163, 220, 105, 106, 107, 163, 105, 106,
+ /* 540 */ 22, 96, 97, 110, 27, 238, 239, 240, 92, 93,
+ /* 550 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 42,
+ /* 560 */ 206, 207, 115, 59, 105, 106, 107, 163, 19, 59,
+ /* 570 */ 163, 106, 23, 219, 141, 142, 143, 59, 163, 205,
+ /* 580 */ 63, 59, 72, 22, 124, 59, 163, 270, 234, 129,
+ /* 590 */ 73, 163, 43, 44, 45, 46, 47, 48, 49, 50,
+ /* 600 */ 51, 52, 53, 54, 55, 56, 57, 184, 185, 105,
+ /* 610 */ 106, 107, 184, 185, 163, 105, 106, 107, 265, 266,
+ /* 620 */ 59, 198, 225, 105, 106, 107, 198, 105, 106, 107,
+ /* 630 */ 163, 105, 106, 107, 163, 184, 185, 46, 47, 48,
+ /* 640 */ 49, 92, 93, 94, 95, 96, 97, 98, 99, 100,
+ /* 650 */ 101, 102, 163, 163, 132, 184, 185, 163, 132, 163,
+ /* 660 */ 256, 19, 163, 163, 163, 23, 105, 106, 107, 198,
+ /* 670 */ 163, 220, 205, 184, 185, 163, 35, 81, 184, 185,
+ /* 680 */ 184, 185, 163, 184, 185, 43, 44, 45, 46, 47,
/* 690 */ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- /* 700 */ 174, 163, 163, 22, 23, 163, 163, 26, 22, 23,
- /* 710 */ 220, 29, 73, 220, 272, 33, 22, 163, 24, 19,
- /* 720 */ 174, 208, 259, 184, 185, 19, 184, 185, 80, 175,
- /* 730 */ 230, 174, 206, 207, 92, 93, 94, 95, 96, 97,
- /* 740 */ 98, 99, 100, 101, 102, 219, 46, 65, 247, 195,
- /* 750 */ 247, 197, 206, 207, 19, 116, 117, 118, 23, 220,
- /* 760 */ 112, 174, 220, 206, 207, 219, 22, 174, 24, 174,
- /* 770 */ 22, 23, 91, 264, 265, 168, 219, 91, 43, 44,
+ /* 700 */ 163, 110, 163, 184, 185, 109, 205, 66, 163, 59,
+ /* 710 */ 163, 21, 205, 16, 174, 74, 220, 198, 163, 220,
+ /* 720 */ 230, 184, 185, 127, 128, 180, 181, 180, 181, 163,
+ /* 730 */ 175, 242, 174, 233, 92, 93, 94, 95, 96, 97,
+ /* 740 */ 98, 99, 100, 101, 102, 233, 206, 207, 26, 163,
+ /* 750 */ 195, 207, 197, 26, 19, 105, 106, 107, 23, 219,
+ /* 760 */ 119, 260, 26, 219, 206, 207, 174, 19, 174, 230,
+ /* 770 */ 80, 174, 163, 174, 77, 163, 79, 219, 43, 44,
/* 780 */ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- /* 790 */ 55, 56, 57, 206, 207, 12, 163, 149, 255, 206,
- /* 800 */ 207, 206, 207, 59, 104, 23, 219, 163, 26, 163,
- /* 810 */ 27, 105, 219, 163, 219, 163, 211, 184, 185, 163,
- /* 820 */ 120, 163, 146, 163, 148, 42, 221, 92, 93, 94,
- /* 830 */ 95, 96, 97, 98, 99, 100, 101, 102, 163, 91,
- /* 840 */ 184, 185, 184, 185, 184, 185, 63, 19, 163, 205,
- /* 850 */ 106, 23, 245, 163, 208, 248, 116, 117, 118, 184,
- /* 860 */ 185, 163, 163, 7, 8, 9, 163, 19, 26, 184,
+ /* 790 */ 55, 56, 57, 248, 12, 248, 184, 185, 206, 207,
+ /* 800 */ 206, 207, 112, 206, 207, 206, 207, 206, 207, 27,
+ /* 810 */ 163, 219, 123, 219, 125, 126, 219, 208, 219, 163,
+ /* 820 */ 219, 22, 23, 23, 42, 26, 26, 92, 93, 94,
+ /* 830 */ 95, 96, 97, 98, 99, 100, 101, 102, 163, 149,
+ /* 840 */ 184, 185, 163, 107, 163, 63, 149, 19, 163, 127,
+ /* 850 */ 128, 23, 22, 105, 24, 116, 117, 118, 131, 184,
+ /* 860 */ 185, 163, 163, 184, 185, 184, 185, 19, 132, 184,
/* 870 */ 185, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- /* 880 */ 52, 53, 54, 55, 56, 57, 163, 184, 185, 107,
- /* 890 */ 163, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- /* 900 */ 52, 53, 54, 55, 56, 57, 208, 255, 177, 178,
- /* 910 */ 163, 184, 185, 163, 132, 163, 141, 163, 143, 22,
+ /* 880 */ 52, 53, 54, 55, 56, 57, 146, 163, 148, 59,
+ /* 890 */ 91, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ /* 900 */ 52, 53, 54, 55, 56, 57, 208, 107, 184, 185,
+ /* 910 */ 7, 8, 9, 116, 117, 118, 163, 163, 163, 24,
/* 920 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- /* 930 */ 102, 184, 185, 163, 184, 185, 184, 185, 184, 185,
+ /* 930 */ 102, 29, 132, 163, 163, 33, 106, 184, 185, 163,
/* 940 */ 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- /* 950 */ 102, 163, 163, 163, 184, 185, 163, 115, 163, 163,
- /* 960 */ 163, 163, 15, 163, 163, 163, 163, 163, 23, 163,
- /* 970 */ 163, 26, 184, 185, 184, 185, 163, 184, 185, 184,
- /* 980 */ 185, 184, 185, 163, 184, 185, 184, 185, 184, 185,
- /* 990 */ 184, 185, 163, 96, 97, 147, 163, 184, 185, 163,
- /* 1000 */ 199, 163, 163, 205, 184, 185, 163, 60, 163, 141,
- /* 1010 */ 163, 143, 163, 184, 185, 19, 163, 184, 185, 230,
- /* 1020 */ 184, 185, 184, 185, 206, 207, 230, 184, 185, 184,
- /* 1030 */ 185, 184, 185, 184, 185, 19, 163, 219, 231, 43,
+ /* 950 */ 102, 163, 163, 163, 59, 184, 185, 163, 22, 163,
+ /* 960 */ 184, 185, 177, 178, 163, 163, 163, 65, 163, 199,
+ /* 970 */ 163, 26, 184, 185, 184, 185, 163, 163, 184, 185,
+ /* 980 */ 184, 185, 163, 98, 163, 184, 185, 184, 185, 184,
+ /* 990 */ 185, 184, 185, 252, 205, 147, 163, 61, 184, 185,
+ /* 1000 */ 163, 106, 163, 184, 185, 163, 163, 205, 163, 124,
+ /* 1010 */ 163, 256, 163, 163, 129, 19, 163, 184, 185, 163,
+ /* 1020 */ 199, 184, 185, 184, 185, 23, 184, 185, 26, 184,
+ /* 1030 */ 185, 184, 185, 184, 185, 19, 163, 184, 185, 43,
/* 1040 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- /* 1050 */ 54, 55, 56, 57, 163, 26, 163, 184, 185, 43,
+ /* 1050 */ 54, 55, 56, 57, 163, 163, 163, 184, 185, 43,
/* 1060 */ 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- /* 1070 */ 54, 55, 56, 57, 163, 184, 185, 184, 185, 163,
- /* 1080 */ 182, 163, 163, 163, 163, 163, 22, 163, 92, 93,
- /* 1090 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 163,
- /* 1100 */ 184, 185, 184, 185, 163, 184, 185, 163, 92, 93,
+ /* 1070 */ 54, 55, 56, 57, 16, 184, 185, 184, 185, 163,
+ /* 1080 */ 163, 22, 23, 138, 163, 19, 163, 231, 92, 93,
+ /* 1090 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 256,
+ /* 1100 */ 163, 184, 185, 163, 163, 184, 185, 163, 92, 93,
/* 1110 */ 94, 95, 96, 97, 98, 99, 100, 101, 102, 163,
- /* 1120 */ 184, 185, 98, 59, 163, 184, 185, 205, 184, 185,
- /* 1130 */ 23, 206, 207, 26, 163, 26, 107, 153, 154, 237,
- /* 1140 */ 184, 185, 231, 147, 219, 184, 185, 249, 124, 127,
- /* 1150 */ 128, 231, 254, 129, 163, 231, 177, 178, 262, 263,
- /* 1160 */ 118, 132, 19, 19, 46, 223, 224, 31, 24, 23,
- /* 1170 */ 106, 124, 26, 22, 272, 39, 129, 23, 109, 110,
- /* 1180 */ 26, 163, 140, 19, 22, 234, 59, 43, 44, 45,
+ /* 1120 */ 59, 184, 185, 163, 184, 185, 177, 178, 184, 185,
+ /* 1130 */ 163, 208, 163, 237, 163, 77, 163, 79, 163, 15,
+ /* 1140 */ 184, 185, 237, 147, 184, 185, 24, 231, 153, 154,
+ /* 1150 */ 91, 184, 185, 184, 185, 184, 185, 184, 185, 184,
+ /* 1160 */ 185, 22, 23, 19, 163, 127, 128, 106, 24, 273,
+ /* 1170 */ 271, 105, 231, 274, 263, 264, 223, 224, 273, 22,
+ /* 1180 */ 118, 24, 23, 19, 60, 26, 163, 43, 44, 45,
/* 1190 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- /* 1200 */ 56, 57, 231, 7, 8, 193, 59, 43, 44, 45,
+ /* 1200 */ 56, 57, 140, 23, 22, 163, 26, 43, 44, 45,
/* 1210 */ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- /* 1220 */ 56, 57, 104, 61, 23, 23, 23, 26, 26, 26,
- /* 1230 */ 163, 23, 23, 106, 26, 26, 92, 93, 94, 95,
- /* 1240 */ 96, 97, 98, 99, 100, 101, 102, 138, 105, 23,
- /* 1250 */ 59, 23, 26, 106, 26, 163, 92, 93, 94, 95,
- /* 1260 */ 96, 97, 98, 99, 100, 101, 102, 110, 23, 23,
- /* 1270 */ 23, 26, 26, 26, 163, 163, 19, 120, 163, 163,
- /* 1280 */ 163, 130, 163, 163, 163, 163, 163, 163, 163, 193,
- /* 1290 */ 193, 163, 163, 163, 163, 225, 19, 106, 163, 222,
- /* 1300 */ 163, 44, 45, 46, 47, 48, 49, 50, 51, 52,
- /* 1310 */ 53, 54, 55, 56, 57, 163, 163, 203, 163, 163,
- /* 1320 */ 222, 163, 45, 46, 47, 48, 49, 50, 51, 52,
- /* 1330 */ 53, 54, 55, 56, 57, 163, 163, 163, 163, 163,
- /* 1340 */ 251, 250, 209, 19, 20, 182, 22, 161, 222, 92,
+ /* 1220 */ 56, 57, 23, 211, 23, 26, 31, 26, 23, 22,
+ /* 1230 */ 91, 26, 231, 221, 39, 53, 92, 93, 94, 95,
+ /* 1240 */ 96, 97, 98, 99, 100, 101, 102, 23, 23, 163,
+ /* 1250 */ 26, 26, 130, 59, 109, 110, 92, 93, 94, 95,
+ /* 1260 */ 96, 97, 98, 99, 100, 101, 102, 23, 7, 8,
+ /* 1270 */ 26, 110, 23, 59, 23, 26, 19, 26, 141, 23,
+ /* 1280 */ 143, 120, 26, 141, 163, 143, 23, 23, 163, 26,
+ /* 1290 */ 26, 163, 163, 163, 163, 163, 19, 163, 163, 193,
+ /* 1300 */ 106, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ /* 1310 */ 53, 54, 55, 56, 57, 163, 193, 163, 163, 163,
+ /* 1320 */ 106, 163, 45, 46, 47, 48, 49, 50, 51, 52,
+ /* 1330 */ 53, 54, 55, 56, 57, 163, 163, 130, 222, 163,
+ /* 1340 */ 163, 203, 163, 19, 20, 251, 22, 163, 163, 92,
/* 1350 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- /* 1360 */ 36, 222, 222, 260, 226, 188, 256, 226, 187, 92,
+ /* 1360 */ 36, 163, 209, 163, 261, 163, 163, 161, 222, 92,
/* 1370 */ 93, 94, 95, 96, 97, 98, 99, 100, 101, 102,
- /* 1380 */ 210, 213, 213, 59, 213, 196, 192, 187, 256, 244,
- /* 1390 */ 212, 187, 226, 19, 20, 71, 22, 210, 166, 60,
- /* 1400 */ 130, 170, 260, 170, 38, 81, 257, 257, 170, 104,
- /* 1410 */ 36, 22, 43, 201, 90, 236, 138, 235, 213, 18,
- /* 1420 */ 96, 97, 48, 204, 204, 204, 204, 103, 170, 105,
- /* 1430 */ 106, 107, 18, 59, 110, 169, 213, 213, 201, 170,
- /* 1440 */ 201, 169, 236, 213, 146, 71, 235, 62, 253, 252,
- /* 1450 */ 170, 127, 128, 169, 22, 170, 82, 189, 169, 104,
- /* 1460 */ 170, 87, 169, 189, 90, 141, 142, 143, 144, 145,
- /* 1470 */ 96, 97, 186, 186, 186, 64, 194, 103, 186, 105,
- /* 1480 */ 106, 107, 115, 189, 110, 188, 186, 186, 19, 20,
- /* 1490 */ 194, 22, 186, 189, 102, 246, 246, 189, 133, 228,
- /* 1500 */ 104, 228, 227, 227, 170, 36, 134, 228, 227, 19,
- /* 1510 */ 20, 228, 22, 84, 271, 141, 142, 143, 144, 145,
- /* 1520 */ 0, 1, 2, 216, 22, 5, 36, 137, 59, 227,
- /* 1530 */ 10, 11, 12, 13, 14, 217, 269, 17, 216, 22,
- /* 1540 */ 71, 170, 243, 146, 241, 217, 136, 215, 135, 59,
- /* 1550 */ 30, 82, 32, 25, 214, 213, 87, 173, 26, 90,
- /* 1560 */ 40, 71, 13, 172, 164, 96, 97, 164, 6, 162,
- /* 1570 */ 162, 162, 103, 263, 105, 106, 107, 266, 266, 110,
- /* 1580 */ 90, 176, 176, 190, 182, 190, 96, 97, 98, 4,
- /* 1590 */ 70, 176, 3, 103, 182, 105, 106, 107, 78, 182,
- /* 1600 */ 110, 81, 182, 182, 182, 182, 182, 151, 88, 22,
- /* 1610 */ 141, 142, 143, 144, 145, 15, 89, 16, 23, 23,
- /* 1620 */ 128, 19, 20, 139, 22, 119, 131, 24, 20, 133,
- /* 1630 */ 16, 141, 142, 143, 144, 145, 1, 140, 36, 131,
- /* 1640 */ 119, 61, 122, 37, 139, 53, 53, 127, 128, 119,
- /* 1650 */ 53, 53, 105, 34, 130, 1, 5, 104, 22, 149,
- /* 1660 */ 26, 59, 68, 75, 41, 130, 24, 68, 104, 20,
- /* 1670 */ 150, 19, 120, 71, 114, 22, 67, 22, 22, 67,
- /* 1680 */ 23, 22, 22, 67, 82, 37, 28, 23, 138, 87,
- /* 1690 */ 22, 153, 90, 23, 23, 26, 23, 22, 96, 97,
- /* 1700 */ 24, 23, 22, 24, 130, 103, 23, 105, 106, 107,
- /* 1710 */ 1, 2, 110, 23, 5, 105, 34, 22, 132, 10,
- /* 1720 */ 11, 12, 13, 14, 26, 34, 17, 34, 85, 83,
- /* 1730 */ 44, 19, 20, 23, 22, 24, 75, 34, 23, 30,
- /* 1740 */ 26, 32, 26, 141, 142, 143, 144, 145, 36, 40,
- /* 1750 */ 23, 23, 23, 23, 11, 23, 22, 26, 22, 22,
- /* 1760 */ 22, 19, 20, 23, 22, 26, 15, 23, 22, 124,
- /* 1770 */ 130, 59, 23, 1, 130, 277, 277, 130, 36, 70,
- /* 1780 */ 130, 277, 277, 71, 277, 277, 277, 78, 277, 277,
- /* 1790 */ 81, 277, 277, 277, 277, 277, 277, 88, 277, 277,
- /* 1800 */ 277, 59, 90, 277, 277, 277, 277, 277, 96, 97,
- /* 1810 */ 277, 277, 277, 71, 277, 103, 277, 105, 106, 107,
- /* 1820 */ 277, 277, 110, 277, 277, 277, 277, 277, 277, 277,
- /* 1830 */ 277, 122, 90, 277, 277, 277, 127, 128, 96, 97,
- /* 1840 */ 277, 277, 277, 277, 277, 103, 277, 105, 106, 107,
- /* 1850 */ 277, 277, 110, 141, 142, 143, 144, 145, 277, 150,
- /* 1860 */ 277, 277, 277, 5, 277, 277, 277, 277, 10, 11,
- /* 1870 */ 12, 13, 14, 277, 277, 17, 277, 277, 277, 277,
- /* 1880 */ 277, 277, 277, 141, 142, 143, 144, 145, 30, 277,
- /* 1890 */ 32, 277, 277, 277, 277, 277, 277, 277, 40, 277,
- /* 1900 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
- /* 1910 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
- /* 1920 */ 277, 277, 277, 277, 277, 277, 277, 277, 70, 277,
- /* 1930 */ 277, 277, 277, 277, 277, 277, 78, 277, 277, 81,
- /* 1940 */ 277, 277, 277, 277, 277, 277, 88, 277, 277, 277,
- /* 1950 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
- /* 1960 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
- /* 1970 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
- /* 1980 */ 122, 277, 277, 277, 277, 127, 128, 277, 277, 277,
- /* 1990 */ 277, 277, 277, 277, 277, 277, 277, 277, 277, 277,
- /* 2000 */ 277, 277, 277, 277, 277, 277, 277, 277, 150, 277,
- /* 2010 */ 277, 277, 277, 277, 277, 277, 277, 277, 277,
+ /* 1380 */ 210, 213, 222, 59, 222, 222, 182, 213, 213, 196,
+ /* 1390 */ 257, 226, 226, 19, 20, 71, 22, 257, 188, 187,
+ /* 1400 */ 192, 212, 187, 187, 226, 81, 210, 166, 60, 261,
+ /* 1410 */ 36, 244, 130, 170, 90, 170, 38, 170, 139, 104,
+ /* 1420 */ 96, 97, 48, 236, 22, 235, 43, 103, 201, 105,
+ /* 1430 */ 106, 107, 138, 59, 110, 247, 213, 18, 204, 258,
+ /* 1440 */ 204, 258, 204, 204, 170, 71, 18, 169, 213, 236,
+ /* 1450 */ 213, 127, 128, 235, 201, 201, 82, 170, 169, 213,
+ /* 1460 */ 146, 87, 62, 254, 90, 141, 142, 143, 144, 145,
+ /* 1470 */ 96, 97, 253, 170, 169, 22, 170, 103, 169, 105,
+ /* 1480 */ 106, 107, 189, 170, 110, 169, 189, 186, 19, 20,
+ /* 1490 */ 104, 22, 194, 186, 186, 64, 115, 186, 194, 189,
+ /* 1500 */ 188, 102, 133, 186, 186, 36, 186, 104, 189, 19,
+ /* 1510 */ 20, 246, 22, 246, 189, 141, 142, 143, 144, 145,
+ /* 1520 */ 0, 1, 2, 228, 228, 5, 36, 227, 59, 227,
+ /* 1530 */ 10, 11, 12, 13, 14, 170, 84, 17, 134, 216,
+ /* 1540 */ 71, 272, 270, 22, 137, 217, 22, 216, 227, 59,
+ /* 1550 */ 30, 82, 32, 217, 228, 228, 87, 227, 170, 90,
+ /* 1560 */ 40, 71, 146, 241, 215, 96, 97, 214, 136, 135,
+ /* 1570 */ 213, 25, 103, 26, 105, 106, 107, 243, 173, 110,
+ /* 1580 */ 90, 172, 13, 6, 164, 164, 96, 97, 98, 162,
+ /* 1590 */ 70, 162, 162, 103, 176, 105, 106, 107, 78, 267,
+ /* 1600 */ 110, 81, 267, 264, 182, 182, 182, 182, 88, 176,
+ /* 1610 */ 141, 142, 143, 144, 145, 176, 190, 4, 182, 182,
+ /* 1620 */ 182, 19, 20, 182, 22, 190, 3, 22, 151, 15,
+ /* 1630 */ 89, 141, 142, 143, 144, 145, 16, 128, 36, 23,
+ /* 1640 */ 23, 139, 122, 24, 119, 131, 20, 127, 128, 133,
+ /* 1650 */ 16, 1, 140, 131, 119, 61, 139, 53, 37, 53,
+ /* 1660 */ 53, 59, 53, 119, 105, 34, 130, 1, 5, 22,
+ /* 1670 */ 150, 104, 149, 71, 26, 75, 68, 41, 68, 130,
+ /* 1680 */ 104, 24, 20, 19, 82, 120, 114, 22, 28, 87,
+ /* 1690 */ 22, 67, 90, 22, 67, 23, 22, 22, 96, 97,
+ /* 1700 */ 67, 23, 138, 22, 37, 103, 153, 105, 106, 107,
+ /* 1710 */ 1, 2, 110, 23, 5, 23, 23, 26, 22, 10,
+ /* 1720 */ 11, 12, 13, 14, 24, 23, 17, 22, 24, 130,
+ /* 1730 */ 23, 19, 20, 23, 22, 105, 22, 34, 85, 30,
+ /* 1740 */ 34, 32, 26, 141, 142, 143, 144, 145, 36, 40,
+ /* 1750 */ 132, 34, 75, 83, 23, 44, 24, 34, 23, 26,
+ /* 1760 */ 26, 19, 20, 23, 22, 26, 23, 23, 23, 23,
+ /* 1770 */ 22, 59, 11, 22, 22, 26, 23, 23, 36, 70,
+ /* 1780 */ 22, 22, 124, 71, 130, 130, 130, 78, 23, 130,
+ /* 1790 */ 81, 15, 1, 278, 278, 278, 278, 88, 278, 278,
+ /* 1800 */ 278, 59, 90, 278, 278, 278, 278, 278, 96, 97,
+ /* 1810 */ 278, 278, 278, 71, 278, 103, 278, 105, 106, 107,
+ /* 1820 */ 278, 278, 110, 278, 278, 278, 278, 278, 278, 278,
+ /* 1830 */ 278, 122, 90, 278, 278, 278, 127, 128, 96, 97,
+ /* 1840 */ 278, 278, 278, 278, 278, 103, 278, 105, 106, 107,
+ /* 1850 */ 278, 278, 110, 141, 142, 143, 144, 145, 278, 150,
+ /* 1860 */ 278, 278, 278, 5, 278, 278, 278, 278, 10, 11,
+ /* 1870 */ 12, 13, 14, 278, 278, 17, 278, 278, 278, 278,
+ /* 1880 */ 278, 278, 278, 141, 142, 143, 144, 145, 30, 278,
+ /* 1890 */ 32, 278, 278, 278, 278, 278, 278, 278, 40, 278,
+ /* 1900 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ /* 1910 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ /* 1920 */ 278, 278, 278, 278, 278, 278, 278, 278, 70, 278,
+ /* 1930 */ 278, 278, 278, 278, 278, 278, 78, 278, 278, 81,
+ /* 1940 */ 278, 278, 278, 278, 278, 278, 88, 278, 278, 278,
+ /* 1950 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ /* 1960 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ /* 1970 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ /* 1980 */ 122, 278, 278, 278, 278, 127, 128, 278, 278, 278,
+ /* 1990 */ 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
+ /* 2000 */ 278, 278, 278, 278, 278, 278, 278, 278, 150, 278,
+ /* 2010 */ 278, 278, 278, 278, 278, 278, 278, 278, 278,
};
-#define YY_SHIFT_COUNT (520)
+#define YY_SHIFT_COUNT (523)
#define YY_SHIFT_MIN (0)
#define YY_SHIFT_MAX (1858)
static const unsigned short int yy_shift_ofst[] = {
- /* 0 */ 1709, 1520, 1858, 1324, 1324, 277, 1374, 1469, 1602, 1712,
- /* 10 */ 1712, 1712, 273, 0, 0, 113, 1016, 1712, 1712, 1712,
- /* 20 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 11, 11, 236,
- /* 30 */ 184, 277, 277, 277, 277, 277, 277, 93, 177, 270,
+ /* 0 */ 1709, 1520, 1858, 1324, 1324, 24, 1374, 1469, 1602, 1712,
+ /* 10 */ 1712, 1712, 271, 0, 0, 113, 1016, 1712, 1712, 1712,
+ /* 20 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 12, 12, 409,
+ /* 30 */ 596, 24, 24, 24, 24, 24, 24, 93, 177, 270,
/* 40 */ 363, 456, 549, 642, 735, 828, 848, 996, 1144, 1016,
/* 50 */ 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1016,
- /* 60 */ 1016, 1016, 1016, 1016, 1016, 1016, 1164, 1016, 1257, 1277,
- /* 70 */ 1277, 1490, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
+ /* 60 */ 1016, 1016, 1016, 1016, 1016, 1016, 1016, 1164, 1016, 1257,
+ /* 70 */ 1277, 1277, 1490, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
/* 80 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
/* 90 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712,
- /* 100 */ 1712, 1712, 1712, 1742, 1712, 1712, 1712, 1712, 1712, 1712,
- /* 110 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 143, 162, 162,
- /* 120 */ 162, 162, 162, 204, 151, 416, 531, 648, 700, 531,
- /* 130 */ 486, 486, 531, 353, 353, 353, 353, 409, 279, 53,
- /* 140 */ 2009, 2009, 331, 331, 331, 329, 366, 329, 329, 597,
- /* 150 */ 597, 464, 474, 262, 681, 531, 531, 531, 531, 531,
- /* 160 */ 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- /* 170 */ 531, 531, 531, 531, 531, 531, 531, 173, 485, 984,
- /* 180 */ 984, 576, 485, 19, 1022, 2009, 2009, 2009, 387, 250,
- /* 190 */ 250, 525, 502, 278, 552, 227, 480, 566, 531, 531,
- /* 200 */ 531, 531, 531, 531, 531, 531, 531, 531, 639, 531,
- /* 210 */ 531, 531, 531, 531, 531, 531, 531, 531, 531, 531,
- /* 220 */ 531, 2, 2, 2, 531, 531, 531, 531, 782, 531,
- /* 230 */ 531, 531, 744, 531, 531, 783, 531, 531, 531, 531,
- /* 240 */ 531, 531, 531, 531, 419, 682, 327, 370, 370, 370,
- /* 250 */ 370, 1029, 327, 327, 1024, 897, 856, 947, 1109, 706,
- /* 260 */ 706, 1143, 1109, 1109, 1143, 842, 945, 1118, 1136, 1136,
- /* 270 */ 1136, 706, 676, 400, 1047, 694, 1339, 1270, 1270, 1366,
- /* 280 */ 1366, 1270, 1305, 1389, 1369, 1278, 1401, 1401, 1401, 1401,
- /* 290 */ 1270, 1414, 1278, 1278, 1305, 1389, 1369, 1369, 1278, 1270,
- /* 300 */ 1414, 1298, 1385, 1270, 1414, 1432, 1270, 1414, 1270, 1414,
- /* 310 */ 1432, 1355, 1355, 1355, 1411, 1432, 1355, 1367, 1355, 1411,
- /* 320 */ 1355, 1355, 1432, 1392, 1392, 1432, 1365, 1396, 1365, 1396,
- /* 330 */ 1365, 1396, 1365, 1396, 1270, 1372, 1429, 1502, 1390, 1372,
- /* 340 */ 1517, 1270, 1397, 1390, 1410, 1413, 1278, 1528, 1532, 1549,
- /* 350 */ 1549, 1562, 1562, 1562, 2009, 2009, 2009, 2009, 2009, 2009,
+ /* 100 */ 1712, 1712, 1712, 1712, 1712, 1742, 1712, 1712, 1712, 1712,
+ /* 110 */ 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 1712, 143,
+ /* 120 */ 162, 162, 162, 162, 162, 204, 151, 186, 650, 690,
+ /* 130 */ 327, 650, 261, 261, 650, 722, 722, 722, 722, 373,
+ /* 140 */ 33, 2, 2009, 2009, 330, 330, 330, 346, 289, 278,
+ /* 150 */ 289, 289, 517, 517, 459, 510, 15, 799, 650, 650,
+ /* 160 */ 650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ /* 170 */ 650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ /* 180 */ 331, 365, 995, 995, 265, 365, 50, 1038, 2009, 2009,
+ /* 190 */ 2009, 433, 250, 250, 504, 314, 429, 518, 522, 526,
+ /* 200 */ 561, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ /* 210 */ 192, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ /* 220 */ 650, 650, 650, 641, 641, 641, 650, 650, 650, 650,
+ /* 230 */ 800, 650, 650, 650, 830, 650, 650, 782, 650, 650,
+ /* 240 */ 650, 650, 650, 650, 650, 650, 739, 902, 689, 895,
+ /* 250 */ 895, 895, 895, 736, 689, 689, 885, 445, 903, 1124,
+ /* 260 */ 945, 748, 748, 1066, 945, 945, 1066, 447, 1002, 293,
+ /* 270 */ 1195, 1195, 1195, 748, 740, 727, 460, 1157, 1348, 1282,
+ /* 280 */ 1282, 1378, 1378, 1282, 1279, 1315, 1402, 1383, 1294, 1419,
+ /* 290 */ 1419, 1419, 1419, 1282, 1428, 1294, 1294, 1315, 1402, 1383,
+ /* 300 */ 1383, 1294, 1282, 1428, 1314, 1400, 1282, 1428, 1453, 1282,
+ /* 310 */ 1428, 1282, 1428, 1453, 1386, 1386, 1386, 1431, 1453, 1386,
+ /* 320 */ 1381, 1386, 1431, 1386, 1386, 1453, 1399, 1399, 1453, 1369,
+ /* 330 */ 1403, 1369, 1403, 1369, 1403, 1369, 1403, 1282, 1404, 1452,
+ /* 340 */ 1521, 1407, 1404, 1524, 1282, 1416, 1407, 1432, 1434, 1294,
+ /* 350 */ 1546, 1547, 1569, 1569, 1577, 1577, 1577, 2009, 2009, 2009,
/* 360 */ 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009, 2009,
- /* 370 */ 570, 345, 686, 748, 50, 740, 1064, 1107, 469, 537,
- /* 380 */ 1042, 1146, 1162, 1154, 1201, 1202, 1203, 1208, 1209, 1127,
- /* 390 */ 1069, 1196, 1157, 1147, 1226, 1228, 1245, 775, 868, 1246,
- /* 400 */ 1247, 1191, 1151, 1585, 1589, 1587, 1456, 1600, 1527, 1601,
- /* 410 */ 1595, 1596, 1492, 1484, 1506, 1603, 1495, 1608, 1496, 1614,
- /* 420 */ 1635, 1508, 1497, 1521, 1580, 1606, 1505, 1592, 1593, 1597,
- /* 430 */ 1598, 1530, 1547, 1619, 1524, 1654, 1651, 1636, 1553, 1510,
- /* 440 */ 1594, 1634, 1599, 1588, 1623, 1535, 1564, 1642, 1649, 1652,
- /* 450 */ 1552, 1560, 1653, 1609, 1655, 1656, 1657, 1659, 1612, 1658,
- /* 460 */ 1660, 1616, 1648, 1664, 1550, 1668, 1538, 1670, 1671, 1669,
- /* 470 */ 1673, 1675, 1676, 1678, 1680, 1679, 1574, 1683, 1690, 1610,
- /* 480 */ 1682, 1695, 1586, 1698, 1691, 1698, 1693, 1643, 1661, 1646,
- /* 490 */ 1686, 1710, 1711, 1714, 1716, 1703, 1715, 1698, 1727, 1728,
- /* 500 */ 1729, 1730, 1731, 1732, 1734, 1743, 1736, 1737, 1740, 1744,
- /* 510 */ 1738, 1746, 1739, 1645, 1640, 1644, 1647, 1650, 1749, 1751,
- /* 520 */ 1772,
+ /* 370 */ 2009, 2009, 2009, 591, 697, 1059, 1139, 1058, 797, 465,
+ /* 380 */ 1159, 1182, 1122, 1062, 1180, 936, 1199, 1201, 1205, 1224,
+ /* 390 */ 1225, 1244, 1061, 1145, 1261, 1161, 1194, 1249, 1251, 1256,
+ /* 400 */ 1137, 1142, 1263, 1264, 1214, 1207, 1613, 1623, 1605, 1477,
+ /* 410 */ 1614, 1541, 1620, 1616, 1617, 1509, 1502, 1525, 1619, 1514,
+ /* 420 */ 1626, 1516, 1634, 1650, 1522, 1512, 1535, 1594, 1621, 1517,
+ /* 430 */ 1604, 1606, 1607, 1609, 1544, 1559, 1631, 1536, 1666, 1663,
+ /* 440 */ 1647, 1567, 1523, 1608, 1648, 1610, 1600, 1636, 1549, 1576,
+ /* 450 */ 1657, 1662, 1664, 1565, 1572, 1665, 1624, 1668, 1671, 1672,
+ /* 460 */ 1674, 1627, 1660, 1675, 1633, 1667, 1678, 1564, 1681, 1553,
+ /* 470 */ 1690, 1692, 1691, 1693, 1696, 1700, 1702, 1705, 1704, 1599,
+ /* 480 */ 1707, 1710, 1630, 1703, 1714, 1618, 1716, 1706, 1716, 1717,
+ /* 490 */ 1653, 1677, 1670, 1711, 1731, 1732, 1733, 1734, 1723, 1735,
+ /* 500 */ 1716, 1740, 1743, 1744, 1745, 1739, 1746, 1748, 1761, 1751,
+ /* 510 */ 1752, 1753, 1754, 1758, 1759, 1749, 1658, 1654, 1655, 1656,
+ /* 520 */ 1659, 1765, 1776, 1791,
};
-#define YY_REDUCE_COUNT (369)
-#define YY_REDUCE_MIN (-237)
-#define YY_REDUCE_MAX (1424)
+#define YY_REDUCE_COUNT (372)
+#define YY_REDUCE_MIN (-235)
+#define YY_REDUCE_MAX (1441)
static const short yy_reduce_ofst[] = {
- /* 0 */ -147, 171, 263, -96, 358, -144, -149, -102, 124, -156,
- /* 10 */ -98, 305, 401, -57, 209, -237, 245, -94, -79, 189,
- /* 20 */ 375, 490, 493, 378, 303, 539, 542, 501, 503, 554,
- /* 30 */ 415, 526, 546, 557, 587, 593, 595, -234, -234, -234,
- /* 40 */ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- /* 50 */ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- /* 60 */ -234, -234, -234, -234, -234, -234, -234, -234, -234, -234,
- /* 70 */ -234, -50, 335, 470, 633, 656, 658, 660, 675, 685,
- /* 80 */ 703, 727, 747, 750, 752, 754, 770, 788, 790, 793,
- /* 90 */ 795, 797, 800, 802, 804, 806, 813, 820, 829, 833,
- /* 100 */ 836, 838, 843, 845, 847, 849, 873, 891, 893, 916,
- /* 110 */ 918, 921, 936, 941, 944, 956, 961, -234, -234, -234,
- /* 120 */ -234, -234, -234, -234, -234, -234, 463, 607, -176, 14,
- /* 130 */ -139, 87, -137, 818, 925, 818, 925, 898, -234, -234,
- /* 140 */ -234, -234, -166, -166, -166, -130, -131, -82, -54, -180,
- /* 150 */ 364, 41, 513, 509, 509, 117, 500, 789, 796, 646,
- /* 160 */ 192, 291, 644, 798, 120, 807, 543, 911, 920, 652,
- /* 170 */ 924, 922, 232, 698, 801, 971, 39, 220, 731, 442,
- /* 180 */ 902, -199, 979, -43, 421, 896, 942, 605, -184, -126,
- /* 190 */ 155, 172, 281, 304, 377, 538, 650, 690, 699, 723,
- /* 200 */ 803, 839, 853, 919, 991, 1018, 1067, 1092, 951, 1111,
- /* 210 */ 1112, 1115, 1116, 1117, 1119, 1120, 1121, 1122, 1123, 1124,
- /* 220 */ 1125, 1012, 1096, 1097, 1128, 1129, 1130, 1131, 1070, 1135,
- /* 230 */ 1137, 1152, 1077, 1153, 1155, 1114, 1156, 304, 1158, 1172,
- /* 240 */ 1173, 1174, 1175, 1176, 1089, 1091, 1133, 1098, 1126, 1139,
- /* 250 */ 1140, 1070, 1133, 1133, 1170, 1163, 1186, 1103, 1168, 1138,
- /* 260 */ 1141, 1110, 1169, 1171, 1132, 1177, 1189, 1194, 1181, 1200,
- /* 270 */ 1204, 1166, 1145, 1178, 1187, 1232, 1142, 1231, 1233, 1149,
- /* 280 */ 1150, 1238, 1179, 1182, 1212, 1205, 1219, 1220, 1221, 1222,
- /* 290 */ 1258, 1266, 1223, 1224, 1206, 1211, 1237, 1239, 1230, 1269,
- /* 300 */ 1272, 1195, 1197, 1280, 1284, 1268, 1285, 1289, 1290, 1293,
- /* 310 */ 1274, 1286, 1287, 1288, 1282, 1294, 1292, 1297, 1300, 1296,
- /* 320 */ 1301, 1306, 1304, 1249, 1250, 1308, 1271, 1275, 1273, 1276,
- /* 330 */ 1279, 1281, 1283, 1302, 1334, 1307, 1243, 1267, 1318, 1322,
- /* 340 */ 1303, 1371, 1299, 1328, 1332, 1340, 1342, 1384, 1391, 1400,
- /* 350 */ 1403, 1407, 1408, 1409, 1311, 1312, 1310, 1405, 1402, 1412,
- /* 360 */ 1417, 1420, 1406, 1393, 1395, 1421, 1422, 1423, 1424, 1415,
+ /* 0 */ -147, 171, 263, -96, 169, -144, -162, -149, -102, -156,
+ /* 10 */ -98, 216, 354, -170, -57, -235, 307, 149, 423, 428,
+ /* 20 */ 471, 313, 451, 519, 489, 496, 499, 545, 547, 555,
+ /* 30 */ -116, 540, 558, 592, 594, 597, 599, -206, -206, -206,
+ /* 40 */ -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
+ /* 50 */ -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
+ /* 60 */ -206, -206, -206, -206, -206, -206, -206, -206, -206, -206,
+ /* 70 */ -206, -206, 196, 309, 494, 537, 612, 656, 675, 679,
+ /* 80 */ 681, 685, 724, 753, 771, 776, 788, 790, 794, 796,
+ /* 90 */ 801, 803, 805, 807, 814, 819, 833, 837, 839, 842,
+ /* 100 */ 845, 847, 849, 853, 873, 891, 893, 917, 921, 937,
+ /* 110 */ 940, 944, 956, 960, 967, 969, 971, 973, 975, -206,
+ /* 120 */ -206, -206, -206, -206, -206, -206, -206, -206, 501, -168,
+ /* 130 */ 90, -97, 87, 112, 303, 277, 601, 277, 601, 179,
+ /* 140 */ -206, -206, -206, -206, -107, -107, -107, -43, -56, 323,
+ /* 150 */ 500, 512, -187, -177, 317, 609, 353, 353, 120, 144,
+ /* 160 */ 490, 539, 698, 374, 467, 507, 789, 404, -157, 755,
+ /* 170 */ 856, 916, 843, 941, 802, 770, 923, 821, 1001, -142,
+ /* 180 */ 264, 785, 896, 905, 899, 949, -176, 544, 911, 953,
+ /* 190 */ 1012, -182, -59, -30, 16, -22, 117, 172, 291, 369,
+ /* 200 */ 407, 415, 566, 586, 647, 699, 754, 813, 850, 892,
+ /* 210 */ 121, 1023, 1042, 1086, 1121, 1125, 1128, 1129, 1130, 1131,
+ /* 220 */ 1132, 1134, 1135, 284, 1106, 1123, 1152, 1154, 1155, 1156,
+ /* 230 */ 397, 1158, 1172, 1173, 1116, 1176, 1177, 1138, 1179, 117,
+ /* 240 */ 1184, 1185, 1198, 1200, 1202, 1203, 741, 1094, 1153, 1146,
+ /* 250 */ 1160, 1162, 1163, 397, 1153, 1153, 1170, 1204, 1206, 1103,
+ /* 260 */ 1168, 1165, 1166, 1133, 1174, 1175, 1140, 1210, 1193, 1208,
+ /* 270 */ 1212, 1215, 1216, 1178, 1167, 1189, 1196, 1241, 1148, 1243,
+ /* 280 */ 1245, 1181, 1183, 1247, 1188, 1187, 1190, 1227, 1223, 1234,
+ /* 290 */ 1236, 1238, 1239, 1274, 1278, 1235, 1237, 1213, 1218, 1253,
+ /* 300 */ 1254, 1246, 1287, 1289, 1209, 1219, 1303, 1305, 1293, 1306,
+ /* 310 */ 1309, 1313, 1316, 1297, 1301, 1307, 1308, 1298, 1310, 1311,
+ /* 320 */ 1312, 1317, 1304, 1318, 1320, 1319, 1265, 1267, 1325, 1295,
+ /* 330 */ 1300, 1296, 1302, 1326, 1321, 1327, 1330, 1365, 1323, 1269,
+ /* 340 */ 1272, 1328, 1331, 1322, 1388, 1334, 1336, 1349, 1353, 1357,
+ /* 350 */ 1405, 1409, 1420, 1421, 1427, 1429, 1430, 1332, 1335, 1339,
+ /* 360 */ 1418, 1422, 1423, 1424, 1425, 1433, 1426, 1435, 1436, 1437,
+ /* 370 */ 1438, 1441, 1439,
};
static const YYACTIONTYPE yy_default[] = {
- /* 0 */ 1492, 1492, 1492, 1340, 1123, 1229, 1123, 1123, 1123, 1340,
- /* 10 */ 1340, 1340, 1123, 1259, 1259, 1391, 1154, 1123, 1123, 1123,
- /* 20 */ 1123, 1123, 1123, 1123, 1339, 1123, 1123, 1123, 1123, 1123,
- /* 30 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1265, 1123,
- /* 40 */ 1123, 1123, 1123, 1123, 1341, 1342, 1123, 1123, 1123, 1390,
- /* 50 */ 1392, 1275, 1274, 1273, 1272, 1373, 1246, 1270, 1263, 1267,
- /* 60 */ 1335, 1336, 1334, 1338, 1342, 1341, 1123, 1266, 1306, 1320,
- /* 70 */ 1305, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 80 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 90 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 100 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 110 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1314, 1319, 1325,
- /* 120 */ 1318, 1315, 1308, 1307, 1309, 1310, 1123, 1144, 1193, 1123,
- /* 130 */ 1123, 1123, 1123, 1409, 1408, 1123, 1123, 1154, 1311, 1312,
- /* 140 */ 1322, 1321, 1398, 1448, 1447, 1123, 1123, 1123, 1123, 1123,
- /* 150 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 160 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 170 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1154, 1150, 1300,
- /* 180 */ 1299, 1418, 1150, 1253, 1123, 1404, 1229, 1220, 1123, 1123,
- /* 190 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 200 */ 1123, 1395, 1393, 1123, 1355, 1123, 1123, 1123, 1123, 1123,
- /* 210 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 220 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 230 */ 1123, 1123, 1225, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 240 */ 1123, 1123, 1123, 1442, 1123, 1368, 1207, 1225, 1225, 1225,
- /* 250 */ 1225, 1227, 1208, 1206, 1219, 1154, 1130, 1484, 1269, 1248,
- /* 260 */ 1248, 1481, 1269, 1269, 1481, 1168, 1462, 1165, 1259, 1259,
- /* 270 */ 1259, 1248, 1337, 1226, 1219, 1123, 1484, 1234, 1234, 1483,
- /* 280 */ 1483, 1234, 1278, 1284, 1196, 1269, 1202, 1202, 1202, 1202,
- /* 290 */ 1234, 1141, 1269, 1269, 1278, 1284, 1196, 1196, 1269, 1234,
- /* 300 */ 1141, 1372, 1478, 1234, 1141, 1348, 1234, 1141, 1234, 1141,
- /* 310 */ 1348, 1194, 1194, 1194, 1183, 1348, 1194, 1168, 1194, 1183,
- /* 320 */ 1194, 1194, 1348, 1352, 1352, 1348, 1252, 1247, 1252, 1247,
- /* 330 */ 1252, 1247, 1252, 1247, 1234, 1253, 1417, 1123, 1264, 1253,
- /* 340 */ 1343, 1234, 1123, 1264, 1262, 1260, 1269, 1147, 1186, 1445,
- /* 350 */ 1445, 1441, 1441, 1441, 1489, 1489, 1404, 1457, 1154, 1154,
- /* 360 */ 1154, 1154, 1457, 1170, 1170, 1154, 1154, 1154, 1154, 1457,
- /* 370 */ 1123, 1123, 1123, 1123, 1123, 1123, 1452, 1123, 1357, 1238,
- /* 380 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 390 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 400 */ 1123, 1123, 1289, 1123, 1126, 1401, 1123, 1123, 1399, 1123,
- /* 410 */ 1123, 1123, 1123, 1123, 1123, 1239, 1123, 1123, 1123, 1123,
- /* 420 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 430 */ 1123, 1123, 1123, 1123, 1480, 1123, 1123, 1123, 1123, 1123,
- /* 440 */ 1123, 1371, 1370, 1123, 1123, 1236, 1123, 1123, 1123, 1123,
- /* 450 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 460 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 470 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 480 */ 1123, 1123, 1123, 1261, 1123, 1416, 1123, 1123, 1123, 1123,
- /* 490 */ 1123, 1123, 1123, 1430, 1254, 1123, 1123, 1471, 1123, 1123,
- /* 500 */ 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
- /* 510 */ 1123, 1123, 1466, 1210, 1291, 1123, 1290, 1294, 1123, 1135,
- /* 520 */ 1123,
+ /* 0 */ 1500, 1500, 1500, 1346, 1129, 1235, 1129, 1129, 1129, 1346,
+ /* 10 */ 1346, 1346, 1129, 1265, 1265, 1399, 1160, 1129, 1129, 1129,
+ /* 20 */ 1129, 1129, 1129, 1129, 1345, 1129, 1129, 1129, 1129, 1129,
+ /* 30 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1271, 1129,
+ /* 40 */ 1129, 1129, 1129, 1129, 1347, 1348, 1129, 1129, 1129, 1398,
+ /* 50 */ 1400, 1363, 1281, 1280, 1279, 1278, 1381, 1252, 1276, 1269,
+ /* 60 */ 1273, 1341, 1342, 1340, 1344, 1348, 1347, 1129, 1272, 1312,
+ /* 70 */ 1326, 1311, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 80 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 90 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 100 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 110 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1320,
+ /* 120 */ 1325, 1331, 1324, 1321, 1314, 1313, 1315, 1316, 1129, 1150,
+ /* 130 */ 1199, 1129, 1129, 1129, 1129, 1417, 1416, 1129, 1129, 1160,
+ /* 140 */ 1317, 1318, 1328, 1327, 1406, 1456, 1455, 1364, 1129, 1129,
+ /* 150 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 160 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 170 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 180 */ 1160, 1156, 1306, 1305, 1426, 1156, 1259, 1129, 1412, 1235,
+ /* 190 */ 1226, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 200 */ 1129, 1129, 1129, 1129, 1403, 1401, 1129, 1129, 1129, 1129,
+ /* 210 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 220 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 230 */ 1129, 1129, 1129, 1129, 1231, 1129, 1129, 1129, 1129, 1129,
+ /* 240 */ 1129, 1129, 1129, 1129, 1129, 1450, 1129, 1376, 1213, 1231,
+ /* 250 */ 1231, 1231, 1231, 1233, 1214, 1212, 1225, 1160, 1136, 1492,
+ /* 260 */ 1275, 1254, 1254, 1489, 1275, 1275, 1489, 1174, 1470, 1171,
+ /* 270 */ 1265, 1265, 1265, 1254, 1343, 1232, 1225, 1129, 1492, 1240,
+ /* 280 */ 1240, 1491, 1491, 1240, 1364, 1284, 1290, 1202, 1275, 1208,
+ /* 290 */ 1208, 1208, 1208, 1240, 1147, 1275, 1275, 1284, 1290, 1202,
+ /* 300 */ 1202, 1275, 1240, 1147, 1380, 1486, 1240, 1147, 1354, 1240,
+ /* 310 */ 1147, 1240, 1147, 1354, 1200, 1200, 1200, 1189, 1354, 1200,
+ /* 320 */ 1174, 1200, 1189, 1200, 1200, 1354, 1358, 1358, 1354, 1258,
+ /* 330 */ 1253, 1258, 1253, 1258, 1253, 1258, 1253, 1240, 1259, 1425,
+ /* 340 */ 1129, 1270, 1259, 1349, 1240, 1129, 1270, 1268, 1266, 1275,
+ /* 350 */ 1153, 1192, 1453, 1453, 1449, 1449, 1449, 1497, 1497, 1412,
+ /* 360 */ 1465, 1160, 1160, 1160, 1160, 1465, 1176, 1176, 1160, 1160,
+ /* 370 */ 1160, 1160, 1465, 1129, 1129, 1129, 1129, 1129, 1129, 1460,
+ /* 380 */ 1129, 1365, 1244, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 390 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 400 */ 1129, 1129, 1129, 1129, 1129, 1295, 1129, 1132, 1409, 1129,
+ /* 410 */ 1129, 1407, 1129, 1129, 1129, 1129, 1129, 1129, 1245, 1129,
+ /* 420 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 430 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1488, 1129, 1129,
+ /* 440 */ 1129, 1129, 1129, 1129, 1379, 1378, 1129, 1129, 1242, 1129,
+ /* 450 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 460 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 470 */ 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 480 */ 1129, 1129, 1129, 1129, 1129, 1129, 1267, 1129, 1424, 1129,
+ /* 490 */ 1129, 1129, 1129, 1129, 1129, 1129, 1438, 1260, 1129, 1129,
+ /* 500 */ 1479, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129, 1129,
+ /* 510 */ 1129, 1129, 1129, 1129, 1129, 1474, 1216, 1297, 1129, 1296,
+ /* 520 */ 1300, 1129, 1141, 1129,
};
/********** End of lemon-generated parsing tables *****************************/
@@ -148168,36 +148671,37 @@ static const char *const yyTokenName[] = {
/* 244 */ "case_else",
/* 245 */ "uniqueflag",
/* 246 */ "collate",
- /* 247 */ "nmnum",
- /* 248 */ "trigger_decl",
- /* 249 */ "trigger_cmd_list",
- /* 250 */ "trigger_time",
- /* 251 */ "trigger_event",
- /* 252 */ "foreach_clause",
- /* 253 */ "when_clause",
- /* 254 */ "trigger_cmd",
- /* 255 */ "trnm",
- /* 256 */ "tridxby",
- /* 257 */ "database_kw_opt",
- /* 258 */ "key_opt",
- /* 259 */ "add_column_fullname",
- /* 260 */ "kwcolumn_opt",
- /* 261 */ "create_vtab",
- /* 262 */ "vtabarglist",
- /* 263 */ "vtabarg",
- /* 264 */ "vtabargtoken",
- /* 265 */ "lp",
- /* 266 */ "anylist",
- /* 267 */ "windowdefn_list",
- /* 268 */ "windowdefn",
- /* 269 */ "window",
- /* 270 */ "frame_opt",
- /* 271 */ "part_opt",
- /* 272 */ "filter_opt",
- /* 273 */ "range_or_rows",
- /* 274 */ "frame_bound",
- /* 275 */ "frame_bound_s",
- /* 276 */ "frame_bound_e",
+ /* 247 */ "vinto",
+ /* 248 */ "nmnum",
+ /* 249 */ "trigger_decl",
+ /* 250 */ "trigger_cmd_list",
+ /* 251 */ "trigger_time",
+ /* 252 */ "trigger_event",
+ /* 253 */ "foreach_clause",
+ /* 254 */ "when_clause",
+ /* 255 */ "trigger_cmd",
+ /* 256 */ "trnm",
+ /* 257 */ "tridxby",
+ /* 258 */ "database_kw_opt",
+ /* 259 */ "key_opt",
+ /* 260 */ "add_column_fullname",
+ /* 261 */ "kwcolumn_opt",
+ /* 262 */ "create_vtab",
+ /* 263 */ "vtabarglist",
+ /* 264 */ "vtabarg",
+ /* 265 */ "vtabargtoken",
+ /* 266 */ "lp",
+ /* 267 */ "anylist",
+ /* 268 */ "windowdefn_list",
+ /* 269 */ "windowdefn",
+ /* 270 */ "window",
+ /* 271 */ "frame_opt",
+ /* 272 */ "part_opt",
+ /* 273 */ "filter_opt",
+ /* 274 */ "range_or_rows",
+ /* 275 */ "frame_bound",
+ /* 276 */ "frame_bound_s",
+ /* 277 */ "frame_bound_e",
};
#endif /* defined(YYCOVERAGE) || !defined(NDEBUG) */
@@ -148434,144 +148938,146 @@ static const char *const yyRuleName[] = {
/* 226 */ "collate ::=",
/* 227 */ "collate ::= COLLATE ID|STRING",
/* 228 */ "cmd ::= DROP INDEX ifexists fullname",
- /* 229 */ "cmd ::= VACUUM",
- /* 230 */ "cmd ::= VACUUM nm",
- /* 231 */ "cmd ::= PRAGMA nm dbnm",
- /* 232 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
- /* 233 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
- /* 234 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
- /* 235 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
- /* 236 */ "plus_num ::= PLUS INTEGER|FLOAT",
- /* 237 */ "minus_num ::= MINUS INTEGER|FLOAT",
- /* 238 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
- /* 239 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
- /* 240 */ "trigger_time ::= BEFORE|AFTER",
- /* 241 */ "trigger_time ::= INSTEAD OF",
- /* 242 */ "trigger_time ::=",
- /* 243 */ "trigger_event ::= DELETE|INSERT",
- /* 244 */ "trigger_event ::= UPDATE",
- /* 245 */ "trigger_event ::= UPDATE OF idlist",
- /* 246 */ "when_clause ::=",
- /* 247 */ "when_clause ::= WHEN expr",
- /* 248 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
- /* 249 */ "trigger_cmd_list ::= trigger_cmd SEMI",
- /* 250 */ "trnm ::= nm DOT nm",
- /* 251 */ "tridxby ::= INDEXED BY nm",
- /* 252 */ "tridxby ::= NOT INDEXED",
- /* 253 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
- /* 254 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
- /* 255 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
- /* 256 */ "trigger_cmd ::= scanpt select scanpt",
- /* 257 */ "expr ::= RAISE LP IGNORE RP",
- /* 258 */ "expr ::= RAISE LP raisetype COMMA nm RP",
- /* 259 */ "raisetype ::= ROLLBACK",
- /* 260 */ "raisetype ::= ABORT",
- /* 261 */ "raisetype ::= FAIL",
- /* 262 */ "cmd ::= DROP TRIGGER ifexists fullname",
- /* 263 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
- /* 264 */ "cmd ::= DETACH database_kw_opt expr",
- /* 265 */ "key_opt ::=",
- /* 266 */ "key_opt ::= KEY expr",
- /* 267 */ "cmd ::= REINDEX",
- /* 268 */ "cmd ::= REINDEX nm dbnm",
- /* 269 */ "cmd ::= ANALYZE",
- /* 270 */ "cmd ::= ANALYZE nm dbnm",
- /* 271 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
- /* 272 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
- /* 273 */ "add_column_fullname ::= fullname",
- /* 274 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
- /* 275 */ "cmd ::= create_vtab",
- /* 276 */ "cmd ::= create_vtab LP vtabarglist RP",
- /* 277 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
- /* 278 */ "vtabarg ::=",
- /* 279 */ "vtabargtoken ::= ANY",
- /* 280 */ "vtabargtoken ::= lp anylist RP",
- /* 281 */ "lp ::= LP",
- /* 282 */ "with ::= WITH wqlist",
- /* 283 */ "with ::= WITH RECURSIVE wqlist",
- /* 284 */ "wqlist ::= nm eidlist_opt AS LP select RP",
- /* 285 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
- /* 286 */ "windowdefn_list ::= windowdefn",
- /* 287 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
- /* 288 */ "windowdefn ::= nm AS window",
- /* 289 */ "window ::= LP part_opt orderby_opt frame_opt RP",
- /* 290 */ "part_opt ::= PARTITION BY nexprlist",
- /* 291 */ "part_opt ::=",
- /* 292 */ "frame_opt ::=",
- /* 293 */ "frame_opt ::= range_or_rows frame_bound_s",
- /* 294 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e",
- /* 295 */ "range_or_rows ::= RANGE",
- /* 296 */ "range_or_rows ::= ROWS",
- /* 297 */ "frame_bound_s ::= frame_bound",
- /* 298 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
- /* 299 */ "frame_bound_e ::= frame_bound",
- /* 300 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
- /* 301 */ "frame_bound ::= expr PRECEDING",
- /* 302 */ "frame_bound ::= CURRENT ROW",
- /* 303 */ "frame_bound ::= expr FOLLOWING",
- /* 304 */ "window_clause ::= WINDOW windowdefn_list",
- /* 305 */ "over_clause ::= filter_opt OVER window",
- /* 306 */ "over_clause ::= filter_opt OVER nm",
- /* 307 */ "filter_opt ::=",
- /* 308 */ "filter_opt ::= FILTER LP WHERE expr RP",
- /* 309 */ "input ::= cmdlist",
- /* 310 */ "cmdlist ::= cmdlist ecmd",
- /* 311 */ "cmdlist ::= ecmd",
- /* 312 */ "ecmd ::= SEMI",
- /* 313 */ "ecmd ::= cmdx SEMI",
- /* 314 */ "ecmd ::= explain cmdx",
- /* 315 */ "trans_opt ::=",
- /* 316 */ "trans_opt ::= TRANSACTION",
- /* 317 */ "trans_opt ::= TRANSACTION nm",
- /* 318 */ "savepoint_opt ::= SAVEPOINT",
- /* 319 */ "savepoint_opt ::=",
- /* 320 */ "cmd ::= create_table create_table_args",
- /* 321 */ "columnlist ::= columnlist COMMA columnname carglist",
- /* 322 */ "columnlist ::= columnname carglist",
- /* 323 */ "nm ::= ID|INDEXED",
- /* 324 */ "nm ::= STRING",
- /* 325 */ "nm ::= JOIN_KW",
- /* 326 */ "typetoken ::= typename",
- /* 327 */ "typename ::= ID|STRING",
- /* 328 */ "signed ::= plus_num",
- /* 329 */ "signed ::= minus_num",
- /* 330 */ "carglist ::= carglist ccons",
- /* 331 */ "carglist ::=",
- /* 332 */ "ccons ::= NULL onconf",
- /* 333 */ "conslist_opt ::= COMMA conslist",
- /* 334 */ "conslist ::= conslist tconscomma tcons",
- /* 335 */ "conslist ::= tcons",
- /* 336 */ "tconscomma ::=",
- /* 337 */ "defer_subclause_opt ::= defer_subclause",
- /* 338 */ "resolvetype ::= raisetype",
- /* 339 */ "selectnowith ::= oneselect",
- /* 340 */ "oneselect ::= values",
- /* 341 */ "sclp ::= selcollist COMMA",
- /* 342 */ "as ::= ID|STRING",
- /* 343 */ "expr ::= term",
- /* 344 */ "likeop ::= LIKE_KW|MATCH",
- /* 345 */ "exprlist ::= nexprlist",
- /* 346 */ "nmnum ::= plus_num",
- /* 347 */ "nmnum ::= nm",
- /* 348 */ "nmnum ::= ON",
- /* 349 */ "nmnum ::= DELETE",
- /* 350 */ "nmnum ::= DEFAULT",
- /* 351 */ "plus_num ::= INTEGER|FLOAT",
- /* 352 */ "foreach_clause ::=",
- /* 353 */ "foreach_clause ::= FOR EACH ROW",
- /* 354 */ "trnm ::= nm",
- /* 355 */ "tridxby ::=",
- /* 356 */ "database_kw_opt ::= DATABASE",
- /* 357 */ "database_kw_opt ::=",
- /* 358 */ "kwcolumn_opt ::=",
- /* 359 */ "kwcolumn_opt ::= COLUMNKW",
- /* 360 */ "vtabarglist ::= vtabarg",
- /* 361 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
- /* 362 */ "vtabarg ::= vtabarg vtabargtoken",
- /* 363 */ "anylist ::=",
- /* 364 */ "anylist ::= anylist LP anylist RP",
- /* 365 */ "anylist ::= anylist ANY",
- /* 366 */ "with ::=",
+ /* 229 */ "cmd ::= VACUUM vinto",
+ /* 230 */ "cmd ::= VACUUM nm vinto",
+ /* 231 */ "vinto ::= INTO expr",
+ /* 232 */ "vinto ::=",
+ /* 233 */ "cmd ::= PRAGMA nm dbnm",
+ /* 234 */ "cmd ::= PRAGMA nm dbnm EQ nmnum",
+ /* 235 */ "cmd ::= PRAGMA nm dbnm LP nmnum RP",
+ /* 236 */ "cmd ::= PRAGMA nm dbnm EQ minus_num",
+ /* 237 */ "cmd ::= PRAGMA nm dbnm LP minus_num RP",
+ /* 238 */ "plus_num ::= PLUS INTEGER|FLOAT",
+ /* 239 */ "minus_num ::= MINUS INTEGER|FLOAT",
+ /* 240 */ "cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END",
+ /* 241 */ "trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause",
+ /* 242 */ "trigger_time ::= BEFORE|AFTER",
+ /* 243 */ "trigger_time ::= INSTEAD OF",
+ /* 244 */ "trigger_time ::=",
+ /* 245 */ "trigger_event ::= DELETE|INSERT",
+ /* 246 */ "trigger_event ::= UPDATE",
+ /* 247 */ "trigger_event ::= UPDATE OF idlist",
+ /* 248 */ "when_clause ::=",
+ /* 249 */ "when_clause ::= WHEN expr",
+ /* 250 */ "trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI",
+ /* 251 */ "trigger_cmd_list ::= trigger_cmd SEMI",
+ /* 252 */ "trnm ::= nm DOT nm",
+ /* 253 */ "tridxby ::= INDEXED BY nm",
+ /* 254 */ "tridxby ::= NOT INDEXED",
+ /* 255 */ "trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt",
+ /* 256 */ "trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt",
+ /* 257 */ "trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt",
+ /* 258 */ "trigger_cmd ::= scanpt select scanpt",
+ /* 259 */ "expr ::= RAISE LP IGNORE RP",
+ /* 260 */ "expr ::= RAISE LP raisetype COMMA nm RP",
+ /* 261 */ "raisetype ::= ROLLBACK",
+ /* 262 */ "raisetype ::= ABORT",
+ /* 263 */ "raisetype ::= FAIL",
+ /* 264 */ "cmd ::= DROP TRIGGER ifexists fullname",
+ /* 265 */ "cmd ::= ATTACH database_kw_opt expr AS expr key_opt",
+ /* 266 */ "cmd ::= DETACH database_kw_opt expr",
+ /* 267 */ "key_opt ::=",
+ /* 268 */ "key_opt ::= KEY expr",
+ /* 269 */ "cmd ::= REINDEX",
+ /* 270 */ "cmd ::= REINDEX nm dbnm",
+ /* 271 */ "cmd ::= ANALYZE",
+ /* 272 */ "cmd ::= ANALYZE nm dbnm",
+ /* 273 */ "cmd ::= ALTER TABLE fullname RENAME TO nm",
+ /* 274 */ "cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist",
+ /* 275 */ "add_column_fullname ::= fullname",
+ /* 276 */ "cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm",
+ /* 277 */ "cmd ::= create_vtab",
+ /* 278 */ "cmd ::= create_vtab LP vtabarglist RP",
+ /* 279 */ "create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm",
+ /* 280 */ "vtabarg ::=",
+ /* 281 */ "vtabargtoken ::= ANY",
+ /* 282 */ "vtabargtoken ::= lp anylist RP",
+ /* 283 */ "lp ::= LP",
+ /* 284 */ "with ::= WITH wqlist",
+ /* 285 */ "with ::= WITH RECURSIVE wqlist",
+ /* 286 */ "wqlist ::= nm eidlist_opt AS LP select RP",
+ /* 287 */ "wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP",
+ /* 288 */ "windowdefn_list ::= windowdefn",
+ /* 289 */ "windowdefn_list ::= windowdefn_list COMMA windowdefn",
+ /* 290 */ "windowdefn ::= nm AS window",
+ /* 291 */ "window ::= LP part_opt orderby_opt frame_opt RP",
+ /* 292 */ "part_opt ::= PARTITION BY nexprlist",
+ /* 293 */ "part_opt ::=",
+ /* 294 */ "frame_opt ::=",
+ /* 295 */ "frame_opt ::= range_or_rows frame_bound_s",
+ /* 296 */ "frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e",
+ /* 297 */ "range_or_rows ::= RANGE",
+ /* 298 */ "range_or_rows ::= ROWS",
+ /* 299 */ "frame_bound_s ::= frame_bound",
+ /* 300 */ "frame_bound_s ::= UNBOUNDED PRECEDING",
+ /* 301 */ "frame_bound_e ::= frame_bound",
+ /* 302 */ "frame_bound_e ::= UNBOUNDED FOLLOWING",
+ /* 303 */ "frame_bound ::= expr PRECEDING",
+ /* 304 */ "frame_bound ::= CURRENT ROW",
+ /* 305 */ "frame_bound ::= expr FOLLOWING",
+ /* 306 */ "window_clause ::= WINDOW windowdefn_list",
+ /* 307 */ "over_clause ::= filter_opt OVER window",
+ /* 308 */ "over_clause ::= filter_opt OVER nm",
+ /* 309 */ "filter_opt ::=",
+ /* 310 */ "filter_opt ::= FILTER LP WHERE expr RP",
+ /* 311 */ "input ::= cmdlist",
+ /* 312 */ "cmdlist ::= cmdlist ecmd",
+ /* 313 */ "cmdlist ::= ecmd",
+ /* 314 */ "ecmd ::= SEMI",
+ /* 315 */ "ecmd ::= cmdx SEMI",
+ /* 316 */ "ecmd ::= explain cmdx",
+ /* 317 */ "trans_opt ::=",
+ /* 318 */ "trans_opt ::= TRANSACTION",
+ /* 319 */ "trans_opt ::= TRANSACTION nm",
+ /* 320 */ "savepoint_opt ::= SAVEPOINT",
+ /* 321 */ "savepoint_opt ::=",
+ /* 322 */ "cmd ::= create_table create_table_args",
+ /* 323 */ "columnlist ::= columnlist COMMA columnname carglist",
+ /* 324 */ "columnlist ::= columnname carglist",
+ /* 325 */ "nm ::= ID|INDEXED",
+ /* 326 */ "nm ::= STRING",
+ /* 327 */ "nm ::= JOIN_KW",
+ /* 328 */ "typetoken ::= typename",
+ /* 329 */ "typename ::= ID|STRING",
+ /* 330 */ "signed ::= plus_num",
+ /* 331 */ "signed ::= minus_num",
+ /* 332 */ "carglist ::= carglist ccons",
+ /* 333 */ "carglist ::=",
+ /* 334 */ "ccons ::= NULL onconf",
+ /* 335 */ "conslist_opt ::= COMMA conslist",
+ /* 336 */ "conslist ::= conslist tconscomma tcons",
+ /* 337 */ "conslist ::= tcons",
+ /* 338 */ "tconscomma ::=",
+ /* 339 */ "defer_subclause_opt ::= defer_subclause",
+ /* 340 */ "resolvetype ::= raisetype",
+ /* 341 */ "selectnowith ::= oneselect",
+ /* 342 */ "oneselect ::= values",
+ /* 343 */ "sclp ::= selcollist COMMA",
+ /* 344 */ "as ::= ID|STRING",
+ /* 345 */ "expr ::= term",
+ /* 346 */ "likeop ::= LIKE_KW|MATCH",
+ /* 347 */ "exprlist ::= nexprlist",
+ /* 348 */ "nmnum ::= plus_num",
+ /* 349 */ "nmnum ::= nm",
+ /* 350 */ "nmnum ::= ON",
+ /* 351 */ "nmnum ::= DELETE",
+ /* 352 */ "nmnum ::= DEFAULT",
+ /* 353 */ "plus_num ::= INTEGER|FLOAT",
+ /* 354 */ "foreach_clause ::=",
+ /* 355 */ "foreach_clause ::= FOR EACH ROW",
+ /* 356 */ "trnm ::= nm",
+ /* 357 */ "tridxby ::=",
+ /* 358 */ "database_kw_opt ::= DATABASE",
+ /* 359 */ "database_kw_opt ::=",
+ /* 360 */ "kwcolumn_opt ::=",
+ /* 361 */ "kwcolumn_opt ::= COLUMNKW",
+ /* 362 */ "vtabarglist ::= vtabarg",
+ /* 363 */ "vtabarglist ::= vtabarglist COMMA vtabarg",
+ /* 364 */ "vtabarg ::= vtabarg vtabargtoken",
+ /* 365 */ "anylist ::=",
+ /* 366 */ "anylist ::= anylist LP anylist RP",
+ /* 367 */ "anylist ::= anylist ANY",
+ /* 368 */ "with ::=",
};
#endif /* NDEBUG */
@@ -148702,7 +149208,7 @@ static void yy_destructor(
case 207: /* oneselect */
case 219: /* values */
{
-sqlite3SelectDelete(pParse->db, (yypminor->yy489));
+sqlite3SelectDelete(pParse->db, (yypminor->yy423));
}
break;
case 184: /* term */
@@ -148712,11 +149218,12 @@ sqlite3SelectDelete(pParse->db, (yypminor->yy489));
case 227: /* on_opt */
case 242: /* case_operand */
case 244: /* case_else */
- case 253: /* when_clause */
- case 258: /* key_opt */
- case 272: /* filter_opt */
+ case 247: /* vinto */
+ case 254: /* when_clause */
+ case 259: /* key_opt */
+ case 273: /* filter_opt */
{
-sqlite3ExprDelete(pParse->db, (yypminor->yy18));
+sqlite3ExprDelete(pParse->db, (yypminor->yy490));
}
break;
case 189: /* eidlist_opt */
@@ -148731,9 +149238,9 @@ sqlite3ExprDelete(pParse->db, (yypminor->yy18));
case 233: /* setlist */
case 241: /* paren_exprlist */
case 243: /* case_exprlist */
- case 271: /* part_opt */
+ case 272: /* part_opt */
{
-sqlite3ExprListDelete(pParse->db, (yypminor->yy420));
+sqlite3ExprListDelete(pParse->db, (yypminor->yy42));
}
break;
case 205: /* fullname */
@@ -148742,51 +149249,51 @@ sqlite3ExprListDelete(pParse->db, (yypminor->yy420));
case 224: /* stl_prefix */
case 230: /* xfullname */
{
-sqlite3SrcListDelete(pParse->db, (yypminor->yy135));
+sqlite3SrcListDelete(pParse->db, (yypminor->yy167));
}
break;
case 208: /* wqlist */
{
-sqlite3WithDelete(pParse->db, (yypminor->yy449));
+sqlite3WithDelete(pParse->db, (yypminor->yy499));
}
break;
case 218: /* window_clause */
- case 267: /* windowdefn_list */
+ case 268: /* windowdefn_list */
{
-sqlite3WindowListDelete(pParse->db, (yypminor->yy327));
+sqlite3WindowListDelete(pParse->db, (yypminor->yy147));
}
break;
case 228: /* using_opt */
case 231: /* idlist */
case 235: /* idlist_opt */
{
-sqlite3IdListDelete(pParse->db, (yypminor->yy48));
+sqlite3IdListDelete(pParse->db, (yypminor->yy336));
}
break;
case 237: /* over_clause */
- case 268: /* windowdefn */
- case 269: /* window */
- case 270: /* frame_opt */
+ case 269: /* windowdefn */
+ case 270: /* window */
+ case 271: /* frame_opt */
{
-sqlite3WindowDelete(pParse->db, (yypminor->yy327));
+sqlite3WindowDelete(pParse->db, (yypminor->yy147));
}
break;
- case 249: /* trigger_cmd_list */
- case 254: /* trigger_cmd */
+ case 250: /* trigger_cmd_list */
+ case 255: /* trigger_cmd */
{
-sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy207));
+sqlite3DeleteTriggerStep(pParse->db, (yypminor->yy119));
}
break;
- case 251: /* trigger_event */
+ case 252: /* trigger_event */
{
-sqlite3IdListDelete(pParse->db, (yypminor->yy34).b);
+sqlite3IdListDelete(pParse->db, (yypminor->yy350).b);
}
break;
- case 274: /* frame_bound */
- case 275: /* frame_bound_s */
- case 276: /* frame_bound_e */
+ case 275: /* frame_bound */
+ case 276: /* frame_bound_s */
+ case 277: /* frame_bound_e */
{
-sqlite3ExprDelete(pParse->db, (yypminor->yy119).pExpr);
+sqlite3ExprDelete(pParse->db, (yypminor->yy317).pExpr);
}
break;
/********* End destructor definitions *****************************************/
@@ -149078,380 +149585,752 @@ static void yy_shift(
yyTraceShift(yypParser, yyNewState, "Shift");
}
-/* The following table contains information about every rule that
-** is used during the reduce.
-*/
-static const struct {
- YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
- signed char nrhs; /* Negative of the number of RHS symbols in the rule */
-} yyRuleInfo[] = {
- { 159, -1 }, /* (0) explain ::= EXPLAIN */
- { 159, -3 }, /* (1) explain ::= EXPLAIN QUERY PLAN */
- { 158, -1 }, /* (2) cmdx ::= cmd */
- { 160, -3 }, /* (3) cmd ::= BEGIN transtype trans_opt */
- { 161, 0 }, /* (4) transtype ::= */
- { 161, -1 }, /* (5) transtype ::= DEFERRED */
- { 161, -1 }, /* (6) transtype ::= IMMEDIATE */
- { 161, -1 }, /* (7) transtype ::= EXCLUSIVE */
- { 160, -2 }, /* (8) cmd ::= COMMIT|END trans_opt */
- { 160, -2 }, /* (9) cmd ::= ROLLBACK trans_opt */
- { 160, -2 }, /* (10) cmd ::= SAVEPOINT nm */
- { 160, -3 }, /* (11) cmd ::= RELEASE savepoint_opt nm */
- { 160, -5 }, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
- { 165, -6 }, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
- { 167, -1 }, /* (14) createkw ::= CREATE */
- { 169, 0 }, /* (15) ifnotexists ::= */
- { 169, -3 }, /* (16) ifnotexists ::= IF NOT EXISTS */
- { 168, -1 }, /* (17) temp ::= TEMP */
- { 168, 0 }, /* (18) temp ::= */
- { 166, -5 }, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
- { 166, -2 }, /* (20) create_table_args ::= AS select */
- { 173, 0 }, /* (21) table_options ::= */
- { 173, -2 }, /* (22) table_options ::= WITHOUT nm */
- { 175, -2 }, /* (23) columnname ::= nm typetoken */
- { 177, 0 }, /* (24) typetoken ::= */
- { 177, -4 }, /* (25) typetoken ::= typename LP signed RP */
- { 177, -6 }, /* (26) typetoken ::= typename LP signed COMMA signed RP */
- { 178, -2 }, /* (27) typename ::= typename ID|STRING */
- { 182, 0 }, /* (28) scanpt ::= */
- { 183, -2 }, /* (29) ccons ::= CONSTRAINT nm */
- { 183, -4 }, /* (30) ccons ::= DEFAULT scanpt term scanpt */
- { 183, -4 }, /* (31) ccons ::= DEFAULT LP expr RP */
- { 183, -4 }, /* (32) ccons ::= DEFAULT PLUS term scanpt */
- { 183, -4 }, /* (33) ccons ::= DEFAULT MINUS term scanpt */
- { 183, -3 }, /* (34) ccons ::= DEFAULT scanpt ID|INDEXED */
- { 183, -3 }, /* (35) ccons ::= NOT NULL onconf */
- { 183, -5 }, /* (36) ccons ::= PRIMARY KEY sortorder onconf autoinc */
- { 183, -2 }, /* (37) ccons ::= UNIQUE onconf */
- { 183, -4 }, /* (38) ccons ::= CHECK LP expr RP */
- { 183, -4 }, /* (39) ccons ::= REFERENCES nm eidlist_opt refargs */
- { 183, -1 }, /* (40) ccons ::= defer_subclause */
- { 183, -2 }, /* (41) ccons ::= COLLATE ID|STRING */
- { 188, 0 }, /* (42) autoinc ::= */
- { 188, -1 }, /* (43) autoinc ::= AUTOINCR */
- { 190, 0 }, /* (44) refargs ::= */
- { 190, -2 }, /* (45) refargs ::= refargs refarg */
- { 192, -2 }, /* (46) refarg ::= MATCH nm */
- { 192, -3 }, /* (47) refarg ::= ON INSERT refact */
- { 192, -3 }, /* (48) refarg ::= ON DELETE refact */
- { 192, -3 }, /* (49) refarg ::= ON UPDATE refact */
- { 193, -2 }, /* (50) refact ::= SET NULL */
- { 193, -2 }, /* (51) refact ::= SET DEFAULT */
- { 193, -1 }, /* (52) refact ::= CASCADE */
- { 193, -1 }, /* (53) refact ::= RESTRICT */
- { 193, -2 }, /* (54) refact ::= NO ACTION */
- { 191, -3 }, /* (55) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
- { 191, -2 }, /* (56) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
- { 194, 0 }, /* (57) init_deferred_pred_opt ::= */
- { 194, -2 }, /* (58) init_deferred_pred_opt ::= INITIALLY DEFERRED */
- { 194, -2 }, /* (59) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
- { 172, 0 }, /* (60) conslist_opt ::= */
- { 196, -1 }, /* (61) tconscomma ::= COMMA */
- { 197, -2 }, /* (62) tcons ::= CONSTRAINT nm */
- { 197, -7 }, /* (63) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
- { 197, -5 }, /* (64) tcons ::= UNIQUE LP sortlist RP onconf */
- { 197, -5 }, /* (65) tcons ::= CHECK LP expr RP onconf */
- { 197, -10 }, /* (66) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
- { 200, 0 }, /* (67) defer_subclause_opt ::= */
- { 186, 0 }, /* (68) onconf ::= */
- { 186, -3 }, /* (69) onconf ::= ON CONFLICT resolvetype */
- { 201, 0 }, /* (70) orconf ::= */
- { 201, -2 }, /* (71) orconf ::= OR resolvetype */
- { 202, -1 }, /* (72) resolvetype ::= IGNORE */
- { 202, -1 }, /* (73) resolvetype ::= REPLACE */
- { 160, -4 }, /* (74) cmd ::= DROP TABLE ifexists fullname */
- { 204, -2 }, /* (75) ifexists ::= IF EXISTS */
- { 204, 0 }, /* (76) ifexists ::= */
- { 160, -9 }, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
- { 160, -4 }, /* (78) cmd ::= DROP VIEW ifexists fullname */
- { 160, -1 }, /* (79) cmd ::= select */
- { 174, -3 }, /* (80) select ::= WITH wqlist selectnowith */
- { 174, -4 }, /* (81) select ::= WITH RECURSIVE wqlist selectnowith */
- { 174, -1 }, /* (82) select ::= selectnowith */
- { 206, -3 }, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */
- { 209, -1 }, /* (84) multiselect_op ::= UNION */
- { 209, -2 }, /* (85) multiselect_op ::= UNION ALL */
- { 209, -1 }, /* (86) multiselect_op ::= EXCEPT|INTERSECT */
- { 207, -9 }, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
- { 207, -10 }, /* (88) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
- { 219, -4 }, /* (89) values ::= VALUES LP nexprlist RP */
- { 219, -5 }, /* (90) values ::= values COMMA LP nexprlist RP */
- { 210, -1 }, /* (91) distinct ::= DISTINCT */
- { 210, -1 }, /* (92) distinct ::= ALL */
- { 210, 0 }, /* (93) distinct ::= */
- { 221, 0 }, /* (94) sclp ::= */
- { 211, -5 }, /* (95) selcollist ::= sclp scanpt expr scanpt as */
- { 211, -3 }, /* (96) selcollist ::= sclp scanpt STAR */
- { 211, -5 }, /* (97) selcollist ::= sclp scanpt nm DOT STAR */
- { 222, -2 }, /* (98) as ::= AS nm */
- { 222, 0 }, /* (99) as ::= */
- { 212, 0 }, /* (100) from ::= */
- { 212, -2 }, /* (101) from ::= FROM seltablist */
- { 224, -2 }, /* (102) stl_prefix ::= seltablist joinop */
- { 224, 0 }, /* (103) stl_prefix ::= */
- { 223, -7 }, /* (104) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
- { 223, -9 }, /* (105) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
- { 223, -7 }, /* (106) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
- { 223, -7 }, /* (107) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
- { 170, 0 }, /* (108) dbnm ::= */
- { 170, -2 }, /* (109) dbnm ::= DOT nm */
- { 205, -1 }, /* (110) fullname ::= nm */
- { 205, -3 }, /* (111) fullname ::= nm DOT nm */
- { 230, -1 }, /* (112) xfullname ::= nm */
- { 230, -3 }, /* (113) xfullname ::= nm DOT nm */
- { 230, -5 }, /* (114) xfullname ::= nm DOT nm AS nm */
- { 230, -3 }, /* (115) xfullname ::= nm AS nm */
- { 225, -1 }, /* (116) joinop ::= COMMA|JOIN */
- { 225, -2 }, /* (117) joinop ::= JOIN_KW JOIN */
- { 225, -3 }, /* (118) joinop ::= JOIN_KW nm JOIN */
- { 225, -4 }, /* (119) joinop ::= JOIN_KW nm nm JOIN */
- { 227, -2 }, /* (120) on_opt ::= ON expr */
- { 227, 0 }, /* (121) on_opt ::= */
- { 226, 0 }, /* (122) indexed_opt ::= */
- { 226, -3 }, /* (123) indexed_opt ::= INDEXED BY nm */
- { 226, -2 }, /* (124) indexed_opt ::= NOT INDEXED */
- { 228, -4 }, /* (125) using_opt ::= USING LP idlist RP */
- { 228, 0 }, /* (126) using_opt ::= */
- { 216, 0 }, /* (127) orderby_opt ::= */
- { 216, -3 }, /* (128) orderby_opt ::= ORDER BY sortlist */
- { 198, -4 }, /* (129) sortlist ::= sortlist COMMA expr sortorder */
- { 198, -2 }, /* (130) sortlist ::= expr sortorder */
- { 187, -1 }, /* (131) sortorder ::= ASC */
- { 187, -1 }, /* (132) sortorder ::= DESC */
- { 187, 0 }, /* (133) sortorder ::= */
- { 214, 0 }, /* (134) groupby_opt ::= */
- { 214, -3 }, /* (135) groupby_opt ::= GROUP BY nexprlist */
- { 215, 0 }, /* (136) having_opt ::= */
- { 215, -2 }, /* (137) having_opt ::= HAVING expr */
- { 217, 0 }, /* (138) limit_opt ::= */
- { 217, -2 }, /* (139) limit_opt ::= LIMIT expr */
- { 217, -4 }, /* (140) limit_opt ::= LIMIT expr OFFSET expr */
- { 217, -4 }, /* (141) limit_opt ::= LIMIT expr COMMA expr */
- { 160, -6 }, /* (142) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
- { 213, 0 }, /* (143) where_opt ::= */
- { 213, -2 }, /* (144) where_opt ::= WHERE expr */
- { 160, -8 }, /* (145) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
- { 233, -5 }, /* (146) setlist ::= setlist COMMA nm EQ expr */
- { 233, -7 }, /* (147) setlist ::= setlist COMMA LP idlist RP EQ expr */
- { 233, -3 }, /* (148) setlist ::= nm EQ expr */
- { 233, -5 }, /* (149) setlist ::= LP idlist RP EQ expr */
- { 160, -7 }, /* (150) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
- { 160, -7 }, /* (151) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
- { 236, 0 }, /* (152) upsert ::= */
- { 236, -11 }, /* (153) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
- { 236, -8 }, /* (154) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
- { 236, -4 }, /* (155) upsert ::= ON CONFLICT DO NOTHING */
- { 234, -2 }, /* (156) insert_cmd ::= INSERT orconf */
- { 234, -1 }, /* (157) insert_cmd ::= REPLACE */
- { 235, 0 }, /* (158) idlist_opt ::= */
- { 235, -3 }, /* (159) idlist_opt ::= LP idlist RP */
- { 231, -3 }, /* (160) idlist ::= idlist COMMA nm */
- { 231, -1 }, /* (161) idlist ::= nm */
- { 185, -3 }, /* (162) expr ::= LP expr RP */
- { 185, -1 }, /* (163) expr ::= ID|INDEXED */
- { 185, -1 }, /* (164) expr ::= JOIN_KW */
- { 185, -3 }, /* (165) expr ::= nm DOT nm */
- { 185, -5 }, /* (166) expr ::= nm DOT nm DOT nm */
- { 184, -1 }, /* (167) term ::= NULL|FLOAT|BLOB */
- { 184, -1 }, /* (168) term ::= STRING */
- { 184, -1 }, /* (169) term ::= INTEGER */
- { 185, -1 }, /* (170) expr ::= VARIABLE */
- { 185, -3 }, /* (171) expr ::= expr COLLATE ID|STRING */
- { 185, -6 }, /* (172) expr ::= CAST LP expr AS typetoken RP */
- { 185, -5 }, /* (173) expr ::= ID|INDEXED LP distinct exprlist RP */
- { 185, -4 }, /* (174) expr ::= ID|INDEXED LP STAR RP */
- { 185, -6 }, /* (175) expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
- { 185, -5 }, /* (176) expr ::= ID|INDEXED LP STAR RP over_clause */
- { 184, -1 }, /* (177) term ::= CTIME_KW */
- { 185, -5 }, /* (178) expr ::= LP nexprlist COMMA expr RP */
- { 185, -3 }, /* (179) expr ::= expr AND expr */
- { 185, -3 }, /* (180) expr ::= expr OR expr */
- { 185, -3 }, /* (181) expr ::= expr LT|GT|GE|LE expr */
- { 185, -3 }, /* (182) expr ::= expr EQ|NE expr */
- { 185, -3 }, /* (183) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
- { 185, -3 }, /* (184) expr ::= expr PLUS|MINUS expr */
- { 185, -3 }, /* (185) expr ::= expr STAR|SLASH|REM expr */
- { 185, -3 }, /* (186) expr ::= expr CONCAT expr */
- { 238, -2 }, /* (187) likeop ::= NOT LIKE_KW|MATCH */
- { 185, -3 }, /* (188) expr ::= expr likeop expr */
- { 185, -5 }, /* (189) expr ::= expr likeop expr ESCAPE expr */
- { 185, -2 }, /* (190) expr ::= expr ISNULL|NOTNULL */
- { 185, -3 }, /* (191) expr ::= expr NOT NULL */
- { 185, -3 }, /* (192) expr ::= expr IS expr */
- { 185, -4 }, /* (193) expr ::= expr IS NOT expr */
- { 185, -2 }, /* (194) expr ::= NOT expr */
- { 185, -2 }, /* (195) expr ::= BITNOT expr */
- { 185, -2 }, /* (196) expr ::= PLUS|MINUS expr */
- { 239, -1 }, /* (197) between_op ::= BETWEEN */
- { 239, -2 }, /* (198) between_op ::= NOT BETWEEN */
- { 185, -5 }, /* (199) expr ::= expr between_op expr AND expr */
- { 240, -1 }, /* (200) in_op ::= IN */
- { 240, -2 }, /* (201) in_op ::= NOT IN */
- { 185, -5 }, /* (202) expr ::= expr in_op LP exprlist RP */
- { 185, -3 }, /* (203) expr ::= LP select RP */
- { 185, -5 }, /* (204) expr ::= expr in_op LP select RP */
- { 185, -5 }, /* (205) expr ::= expr in_op nm dbnm paren_exprlist */
- { 185, -4 }, /* (206) expr ::= EXISTS LP select RP */
- { 185, -5 }, /* (207) expr ::= CASE case_operand case_exprlist case_else END */
- { 243, -5 }, /* (208) case_exprlist ::= case_exprlist WHEN expr THEN expr */
- { 243, -4 }, /* (209) case_exprlist ::= WHEN expr THEN expr */
- { 244, -2 }, /* (210) case_else ::= ELSE expr */
- { 244, 0 }, /* (211) case_else ::= */
- { 242, -1 }, /* (212) case_operand ::= expr */
- { 242, 0 }, /* (213) case_operand ::= */
- { 229, 0 }, /* (214) exprlist ::= */
- { 220, -3 }, /* (215) nexprlist ::= nexprlist COMMA expr */
- { 220, -1 }, /* (216) nexprlist ::= expr */
- { 241, 0 }, /* (217) paren_exprlist ::= */
- { 241, -3 }, /* (218) paren_exprlist ::= LP exprlist RP */
- { 160, -12 }, /* (219) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
- { 245, -1 }, /* (220) uniqueflag ::= UNIQUE */
- { 245, 0 }, /* (221) uniqueflag ::= */
- { 189, 0 }, /* (222) eidlist_opt ::= */
- { 189, -3 }, /* (223) eidlist_opt ::= LP eidlist RP */
- { 199, -5 }, /* (224) eidlist ::= eidlist COMMA nm collate sortorder */
- { 199, -3 }, /* (225) eidlist ::= nm collate sortorder */
- { 246, 0 }, /* (226) collate ::= */
- { 246, -2 }, /* (227) collate ::= COLLATE ID|STRING */
- { 160, -4 }, /* (228) cmd ::= DROP INDEX ifexists fullname */
- { 160, -1 }, /* (229) cmd ::= VACUUM */
- { 160, -2 }, /* (230) cmd ::= VACUUM nm */
- { 160, -3 }, /* (231) cmd ::= PRAGMA nm dbnm */
- { 160, -5 }, /* (232) cmd ::= PRAGMA nm dbnm EQ nmnum */
- { 160, -6 }, /* (233) cmd ::= PRAGMA nm dbnm LP nmnum RP */
- { 160, -5 }, /* (234) cmd ::= PRAGMA nm dbnm EQ minus_num */
- { 160, -6 }, /* (235) cmd ::= PRAGMA nm dbnm LP minus_num RP */
- { 180, -2 }, /* (236) plus_num ::= PLUS INTEGER|FLOAT */
- { 181, -2 }, /* (237) minus_num ::= MINUS INTEGER|FLOAT */
- { 160, -5 }, /* (238) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
- { 248, -11 }, /* (239) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
- { 250, -1 }, /* (240) trigger_time ::= BEFORE|AFTER */
- { 250, -2 }, /* (241) trigger_time ::= INSTEAD OF */
- { 250, 0 }, /* (242) trigger_time ::= */
- { 251, -1 }, /* (243) trigger_event ::= DELETE|INSERT */
- { 251, -1 }, /* (244) trigger_event ::= UPDATE */
- { 251, -3 }, /* (245) trigger_event ::= UPDATE OF idlist */
- { 253, 0 }, /* (246) when_clause ::= */
- { 253, -2 }, /* (247) when_clause ::= WHEN expr */
- { 249, -3 }, /* (248) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
- { 249, -2 }, /* (249) trigger_cmd_list ::= trigger_cmd SEMI */
- { 255, -3 }, /* (250) trnm ::= nm DOT nm */
- { 256, -3 }, /* (251) tridxby ::= INDEXED BY nm */
- { 256, -2 }, /* (252) tridxby ::= NOT INDEXED */
- { 254, -8 }, /* (253) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
- { 254, -8 }, /* (254) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
- { 254, -6 }, /* (255) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
- { 254, -3 }, /* (256) trigger_cmd ::= scanpt select scanpt */
- { 185, -4 }, /* (257) expr ::= RAISE LP IGNORE RP */
- { 185, -6 }, /* (258) expr ::= RAISE LP raisetype COMMA nm RP */
- { 203, -1 }, /* (259) raisetype ::= ROLLBACK */
- { 203, -1 }, /* (260) raisetype ::= ABORT */
- { 203, -1 }, /* (261) raisetype ::= FAIL */
- { 160, -4 }, /* (262) cmd ::= DROP TRIGGER ifexists fullname */
- { 160, -6 }, /* (263) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
- { 160, -3 }, /* (264) cmd ::= DETACH database_kw_opt expr */
- { 258, 0 }, /* (265) key_opt ::= */
- { 258, -2 }, /* (266) key_opt ::= KEY expr */
- { 160, -1 }, /* (267) cmd ::= REINDEX */
- { 160, -3 }, /* (268) cmd ::= REINDEX nm dbnm */
- { 160, -1 }, /* (269) cmd ::= ANALYZE */
- { 160, -3 }, /* (270) cmd ::= ANALYZE nm dbnm */
- { 160, -6 }, /* (271) cmd ::= ALTER TABLE fullname RENAME TO nm */
- { 160, -7 }, /* (272) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
- { 259, -1 }, /* (273) add_column_fullname ::= fullname */
- { 160, -8 }, /* (274) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
- { 160, -1 }, /* (275) cmd ::= create_vtab */
- { 160, -4 }, /* (276) cmd ::= create_vtab LP vtabarglist RP */
- { 261, -8 }, /* (277) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
- { 263, 0 }, /* (278) vtabarg ::= */
- { 264, -1 }, /* (279) vtabargtoken ::= ANY */
- { 264, -3 }, /* (280) vtabargtoken ::= lp anylist RP */
- { 265, -1 }, /* (281) lp ::= LP */
- { 232, -2 }, /* (282) with ::= WITH wqlist */
- { 232, -3 }, /* (283) with ::= WITH RECURSIVE wqlist */
- { 208, -6 }, /* (284) wqlist ::= nm eidlist_opt AS LP select RP */
- { 208, -8 }, /* (285) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
- { 267, -1 }, /* (286) windowdefn_list ::= windowdefn */
- { 267, -3 }, /* (287) windowdefn_list ::= windowdefn_list COMMA windowdefn */
- { 268, -3 }, /* (288) windowdefn ::= nm AS window */
- { 269, -5 }, /* (289) window ::= LP part_opt orderby_opt frame_opt RP */
- { 271, -3 }, /* (290) part_opt ::= PARTITION BY nexprlist */
- { 271, 0 }, /* (291) part_opt ::= */
- { 270, 0 }, /* (292) frame_opt ::= */
- { 270, -2 }, /* (293) frame_opt ::= range_or_rows frame_bound_s */
- { 270, -5 }, /* (294) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */
- { 273, -1 }, /* (295) range_or_rows ::= RANGE */
- { 273, -1 }, /* (296) range_or_rows ::= ROWS */
- { 275, -1 }, /* (297) frame_bound_s ::= frame_bound */
- { 275, -2 }, /* (298) frame_bound_s ::= UNBOUNDED PRECEDING */
- { 276, -1 }, /* (299) frame_bound_e ::= frame_bound */
- { 276, -2 }, /* (300) frame_bound_e ::= UNBOUNDED FOLLOWING */
- { 274, -2 }, /* (301) frame_bound ::= expr PRECEDING */
- { 274, -2 }, /* (302) frame_bound ::= CURRENT ROW */
- { 274, -2 }, /* (303) frame_bound ::= expr FOLLOWING */
- { 218, -2 }, /* (304) window_clause ::= WINDOW windowdefn_list */
- { 237, -3 }, /* (305) over_clause ::= filter_opt OVER window */
- { 237, -3 }, /* (306) over_clause ::= filter_opt OVER nm */
- { 272, 0 }, /* (307) filter_opt ::= */
- { 272, -5 }, /* (308) filter_opt ::= FILTER LP WHERE expr RP */
- { 155, -1 }, /* (309) input ::= cmdlist */
- { 156, -2 }, /* (310) cmdlist ::= cmdlist ecmd */
- { 156, -1 }, /* (311) cmdlist ::= ecmd */
- { 157, -1 }, /* (312) ecmd ::= SEMI */
- { 157, -2 }, /* (313) ecmd ::= cmdx SEMI */
- { 157, -2 }, /* (314) ecmd ::= explain cmdx */
- { 162, 0 }, /* (315) trans_opt ::= */
- { 162, -1 }, /* (316) trans_opt ::= TRANSACTION */
- { 162, -2 }, /* (317) trans_opt ::= TRANSACTION nm */
- { 164, -1 }, /* (318) savepoint_opt ::= SAVEPOINT */
- { 164, 0 }, /* (319) savepoint_opt ::= */
- { 160, -2 }, /* (320) cmd ::= create_table create_table_args */
- { 171, -4 }, /* (321) columnlist ::= columnlist COMMA columnname carglist */
- { 171, -2 }, /* (322) columnlist ::= columnname carglist */
- { 163, -1 }, /* (323) nm ::= ID|INDEXED */
- { 163, -1 }, /* (324) nm ::= STRING */
- { 163, -1 }, /* (325) nm ::= JOIN_KW */
- { 177, -1 }, /* (326) typetoken ::= typename */
- { 178, -1 }, /* (327) typename ::= ID|STRING */
- { 179, -1 }, /* (328) signed ::= plus_num */
- { 179, -1 }, /* (329) signed ::= minus_num */
- { 176, -2 }, /* (330) carglist ::= carglist ccons */
- { 176, 0 }, /* (331) carglist ::= */
- { 183, -2 }, /* (332) ccons ::= NULL onconf */
- { 172, -2 }, /* (333) conslist_opt ::= COMMA conslist */
- { 195, -3 }, /* (334) conslist ::= conslist tconscomma tcons */
- { 195, -1 }, /* (335) conslist ::= tcons */
- { 196, 0 }, /* (336) tconscomma ::= */
- { 200, -1 }, /* (337) defer_subclause_opt ::= defer_subclause */
- { 202, -1 }, /* (338) resolvetype ::= raisetype */
- { 206, -1 }, /* (339) selectnowith ::= oneselect */
- { 207, -1 }, /* (340) oneselect ::= values */
- { 221, -2 }, /* (341) sclp ::= selcollist COMMA */
- { 222, -1 }, /* (342) as ::= ID|STRING */
- { 185, -1 }, /* (343) expr ::= term */
- { 238, -1 }, /* (344) likeop ::= LIKE_KW|MATCH */
- { 229, -1 }, /* (345) exprlist ::= nexprlist */
- { 247, -1 }, /* (346) nmnum ::= plus_num */
- { 247, -1 }, /* (347) nmnum ::= nm */
- { 247, -1 }, /* (348) nmnum ::= ON */
- { 247, -1 }, /* (349) nmnum ::= DELETE */
- { 247, -1 }, /* (350) nmnum ::= DEFAULT */
- { 180, -1 }, /* (351) plus_num ::= INTEGER|FLOAT */
- { 252, 0 }, /* (352) foreach_clause ::= */
- { 252, -3 }, /* (353) foreach_clause ::= FOR EACH ROW */
- { 255, -1 }, /* (354) trnm ::= nm */
- { 256, 0 }, /* (355) tridxby ::= */
- { 257, -1 }, /* (356) database_kw_opt ::= DATABASE */
- { 257, 0 }, /* (357) database_kw_opt ::= */
- { 260, 0 }, /* (358) kwcolumn_opt ::= */
- { 260, -1 }, /* (359) kwcolumn_opt ::= COLUMNKW */
- { 262, -1 }, /* (360) vtabarglist ::= vtabarg */
- { 262, -3 }, /* (361) vtabarglist ::= vtabarglist COMMA vtabarg */
- { 263, -2 }, /* (362) vtabarg ::= vtabarg vtabargtoken */
- { 266, 0 }, /* (363) anylist ::= */
- { 266, -4 }, /* (364) anylist ::= anylist LP anylist RP */
- { 266, -2 }, /* (365) anylist ::= anylist ANY */
- { 232, 0 }, /* (366) with ::= */
+/* For rule J, yyRuleInfoLhs[J] contains the symbol on the left-hand side
+** of that rule */
+static const YYCODETYPE yyRuleInfoLhs[] = {
+ 159, /* (0) explain ::= EXPLAIN */
+ 159, /* (1) explain ::= EXPLAIN QUERY PLAN */
+ 158, /* (2) cmdx ::= cmd */
+ 160, /* (3) cmd ::= BEGIN transtype trans_opt */
+ 161, /* (4) transtype ::= */
+ 161, /* (5) transtype ::= DEFERRED */
+ 161, /* (6) transtype ::= IMMEDIATE */
+ 161, /* (7) transtype ::= EXCLUSIVE */
+ 160, /* (8) cmd ::= COMMIT|END trans_opt */
+ 160, /* (9) cmd ::= ROLLBACK trans_opt */
+ 160, /* (10) cmd ::= SAVEPOINT nm */
+ 160, /* (11) cmd ::= RELEASE savepoint_opt nm */
+ 160, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
+ 165, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
+ 167, /* (14) createkw ::= CREATE */
+ 169, /* (15) ifnotexists ::= */
+ 169, /* (16) ifnotexists ::= IF NOT EXISTS */
+ 168, /* (17) temp ::= TEMP */
+ 168, /* (18) temp ::= */
+ 166, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
+ 166, /* (20) create_table_args ::= AS select */
+ 173, /* (21) table_options ::= */
+ 173, /* (22) table_options ::= WITHOUT nm */
+ 175, /* (23) columnname ::= nm typetoken */
+ 177, /* (24) typetoken ::= */
+ 177, /* (25) typetoken ::= typename LP signed RP */
+ 177, /* (26) typetoken ::= typename LP signed COMMA signed RP */
+ 178, /* (27) typename ::= typename ID|STRING */
+ 182, /* (28) scanpt ::= */
+ 183, /* (29) ccons ::= CONSTRAINT nm */
+ 183, /* (30) ccons ::= DEFAULT scanpt term scanpt */
+ 183, /* (31) ccons ::= DEFAULT LP expr RP */
+ 183, /* (32) ccons ::= DEFAULT PLUS term scanpt */
+ 183, /* (33) ccons ::= DEFAULT MINUS term scanpt */
+ 183, /* (34) ccons ::= DEFAULT scanpt ID|INDEXED */
+ 183, /* (35) ccons ::= NOT NULL onconf */
+ 183, /* (36) ccons ::= PRIMARY KEY sortorder onconf autoinc */
+ 183, /* (37) ccons ::= UNIQUE onconf */
+ 183, /* (38) ccons ::= CHECK LP expr RP */
+ 183, /* (39) ccons ::= REFERENCES nm eidlist_opt refargs */
+ 183, /* (40) ccons ::= defer_subclause */
+ 183, /* (41) ccons ::= COLLATE ID|STRING */
+ 188, /* (42) autoinc ::= */
+ 188, /* (43) autoinc ::= AUTOINCR */
+ 190, /* (44) refargs ::= */
+ 190, /* (45) refargs ::= refargs refarg */
+ 192, /* (46) refarg ::= MATCH nm */
+ 192, /* (47) refarg ::= ON INSERT refact */
+ 192, /* (48) refarg ::= ON DELETE refact */
+ 192, /* (49) refarg ::= ON UPDATE refact */
+ 193, /* (50) refact ::= SET NULL */
+ 193, /* (51) refact ::= SET DEFAULT */
+ 193, /* (52) refact ::= CASCADE */
+ 193, /* (53) refact ::= RESTRICT */
+ 193, /* (54) refact ::= NO ACTION */
+ 191, /* (55) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
+ 191, /* (56) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
+ 194, /* (57) init_deferred_pred_opt ::= */
+ 194, /* (58) init_deferred_pred_opt ::= INITIALLY DEFERRED */
+ 194, /* (59) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
+ 172, /* (60) conslist_opt ::= */
+ 196, /* (61) tconscomma ::= COMMA */
+ 197, /* (62) tcons ::= CONSTRAINT nm */
+ 197, /* (63) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
+ 197, /* (64) tcons ::= UNIQUE LP sortlist RP onconf */
+ 197, /* (65) tcons ::= CHECK LP expr RP onconf */
+ 197, /* (66) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
+ 200, /* (67) defer_subclause_opt ::= */
+ 186, /* (68) onconf ::= */
+ 186, /* (69) onconf ::= ON CONFLICT resolvetype */
+ 201, /* (70) orconf ::= */
+ 201, /* (71) orconf ::= OR resolvetype */
+ 202, /* (72) resolvetype ::= IGNORE */
+ 202, /* (73) resolvetype ::= REPLACE */
+ 160, /* (74) cmd ::= DROP TABLE ifexists fullname */
+ 204, /* (75) ifexists ::= IF EXISTS */
+ 204, /* (76) ifexists ::= */
+ 160, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
+ 160, /* (78) cmd ::= DROP VIEW ifexists fullname */
+ 160, /* (79) cmd ::= select */
+ 174, /* (80) select ::= WITH wqlist selectnowith */
+ 174, /* (81) select ::= WITH RECURSIVE wqlist selectnowith */
+ 174, /* (82) select ::= selectnowith */
+ 206, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */
+ 209, /* (84) multiselect_op ::= UNION */
+ 209, /* (85) multiselect_op ::= UNION ALL */
+ 209, /* (86) multiselect_op ::= EXCEPT|INTERSECT */
+ 207, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
+ 207, /* (88) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
+ 219, /* (89) values ::= VALUES LP nexprlist RP */
+ 219, /* (90) values ::= values COMMA LP nexprlist RP */
+ 210, /* (91) distinct ::= DISTINCT */
+ 210, /* (92) distinct ::= ALL */
+ 210, /* (93) distinct ::= */
+ 221, /* (94) sclp ::= */
+ 211, /* (95) selcollist ::= sclp scanpt expr scanpt as */
+ 211, /* (96) selcollist ::= sclp scanpt STAR */
+ 211, /* (97) selcollist ::= sclp scanpt nm DOT STAR */
+ 222, /* (98) as ::= AS nm */
+ 222, /* (99) as ::= */
+ 212, /* (100) from ::= */
+ 212, /* (101) from ::= FROM seltablist */
+ 224, /* (102) stl_prefix ::= seltablist joinop */
+ 224, /* (103) stl_prefix ::= */
+ 223, /* (104) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
+ 223, /* (105) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
+ 223, /* (106) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
+ 223, /* (107) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
+ 170, /* (108) dbnm ::= */
+ 170, /* (109) dbnm ::= DOT nm */
+ 205, /* (110) fullname ::= nm */
+ 205, /* (111) fullname ::= nm DOT nm */
+ 230, /* (112) xfullname ::= nm */
+ 230, /* (113) xfullname ::= nm DOT nm */
+ 230, /* (114) xfullname ::= nm DOT nm AS nm */
+ 230, /* (115) xfullname ::= nm AS nm */
+ 225, /* (116) joinop ::= COMMA|JOIN */
+ 225, /* (117) joinop ::= JOIN_KW JOIN */
+ 225, /* (118) joinop ::= JOIN_KW nm JOIN */
+ 225, /* (119) joinop ::= JOIN_KW nm nm JOIN */
+ 227, /* (120) on_opt ::= ON expr */
+ 227, /* (121) on_opt ::= */
+ 226, /* (122) indexed_opt ::= */
+ 226, /* (123) indexed_opt ::= INDEXED BY nm */
+ 226, /* (124) indexed_opt ::= NOT INDEXED */
+ 228, /* (125) using_opt ::= USING LP idlist RP */
+ 228, /* (126) using_opt ::= */
+ 216, /* (127) orderby_opt ::= */
+ 216, /* (128) orderby_opt ::= ORDER BY sortlist */
+ 198, /* (129) sortlist ::= sortlist COMMA expr sortorder */
+ 198, /* (130) sortlist ::= expr sortorder */
+ 187, /* (131) sortorder ::= ASC */
+ 187, /* (132) sortorder ::= DESC */
+ 187, /* (133) sortorder ::= */
+ 214, /* (134) groupby_opt ::= */
+ 214, /* (135) groupby_opt ::= GROUP BY nexprlist */
+ 215, /* (136) having_opt ::= */
+ 215, /* (137) having_opt ::= HAVING expr */
+ 217, /* (138) limit_opt ::= */
+ 217, /* (139) limit_opt ::= LIMIT expr */
+ 217, /* (140) limit_opt ::= LIMIT expr OFFSET expr */
+ 217, /* (141) limit_opt ::= LIMIT expr COMMA expr */
+ 160, /* (142) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
+ 213, /* (143) where_opt ::= */
+ 213, /* (144) where_opt ::= WHERE expr */
+ 160, /* (145) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
+ 233, /* (146) setlist ::= setlist COMMA nm EQ expr */
+ 233, /* (147) setlist ::= setlist COMMA LP idlist RP EQ expr */
+ 233, /* (148) setlist ::= nm EQ expr */
+ 233, /* (149) setlist ::= LP idlist RP EQ expr */
+ 160, /* (150) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
+ 160, /* (151) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
+ 236, /* (152) upsert ::= */
+ 236, /* (153) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
+ 236, /* (154) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
+ 236, /* (155) upsert ::= ON CONFLICT DO NOTHING */
+ 234, /* (156) insert_cmd ::= INSERT orconf */
+ 234, /* (157) insert_cmd ::= REPLACE */
+ 235, /* (158) idlist_opt ::= */
+ 235, /* (159) idlist_opt ::= LP idlist RP */
+ 231, /* (160) idlist ::= idlist COMMA nm */
+ 231, /* (161) idlist ::= nm */
+ 185, /* (162) expr ::= LP expr RP */
+ 185, /* (163) expr ::= ID|INDEXED */
+ 185, /* (164) expr ::= JOIN_KW */
+ 185, /* (165) expr ::= nm DOT nm */
+ 185, /* (166) expr ::= nm DOT nm DOT nm */
+ 184, /* (167) term ::= NULL|FLOAT|BLOB */
+ 184, /* (168) term ::= STRING */
+ 184, /* (169) term ::= INTEGER */
+ 185, /* (170) expr ::= VARIABLE */
+ 185, /* (171) expr ::= expr COLLATE ID|STRING */
+ 185, /* (172) expr ::= CAST LP expr AS typetoken RP */
+ 185, /* (173) expr ::= ID|INDEXED LP distinct exprlist RP */
+ 185, /* (174) expr ::= ID|INDEXED LP STAR RP */
+ 185, /* (175) expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
+ 185, /* (176) expr ::= ID|INDEXED LP STAR RP over_clause */
+ 184, /* (177) term ::= CTIME_KW */
+ 185, /* (178) expr ::= LP nexprlist COMMA expr RP */
+ 185, /* (179) expr ::= expr AND expr */
+ 185, /* (180) expr ::= expr OR expr */
+ 185, /* (181) expr ::= expr LT|GT|GE|LE expr */
+ 185, /* (182) expr ::= expr EQ|NE expr */
+ 185, /* (183) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
+ 185, /* (184) expr ::= expr PLUS|MINUS expr */
+ 185, /* (185) expr ::= expr STAR|SLASH|REM expr */
+ 185, /* (186) expr ::= expr CONCAT expr */
+ 238, /* (187) likeop ::= NOT LIKE_KW|MATCH */
+ 185, /* (188) expr ::= expr likeop expr */
+ 185, /* (189) expr ::= expr likeop expr ESCAPE expr */
+ 185, /* (190) expr ::= expr ISNULL|NOTNULL */
+ 185, /* (191) expr ::= expr NOT NULL */
+ 185, /* (192) expr ::= expr IS expr */
+ 185, /* (193) expr ::= expr IS NOT expr */
+ 185, /* (194) expr ::= NOT expr */
+ 185, /* (195) expr ::= BITNOT expr */
+ 185, /* (196) expr ::= PLUS|MINUS expr */
+ 239, /* (197) between_op ::= BETWEEN */
+ 239, /* (198) between_op ::= NOT BETWEEN */
+ 185, /* (199) expr ::= expr between_op expr AND expr */
+ 240, /* (200) in_op ::= IN */
+ 240, /* (201) in_op ::= NOT IN */
+ 185, /* (202) expr ::= expr in_op LP exprlist RP */
+ 185, /* (203) expr ::= LP select RP */
+ 185, /* (204) expr ::= expr in_op LP select RP */
+ 185, /* (205) expr ::= expr in_op nm dbnm paren_exprlist */
+ 185, /* (206) expr ::= EXISTS LP select RP */
+ 185, /* (207) expr ::= CASE case_operand case_exprlist case_else END */
+ 243, /* (208) case_exprlist ::= case_exprlist WHEN expr THEN expr */
+ 243, /* (209) case_exprlist ::= WHEN expr THEN expr */
+ 244, /* (210) case_else ::= ELSE expr */
+ 244, /* (211) case_else ::= */
+ 242, /* (212) case_operand ::= expr */
+ 242, /* (213) case_operand ::= */
+ 229, /* (214) exprlist ::= */
+ 220, /* (215) nexprlist ::= nexprlist COMMA expr */
+ 220, /* (216) nexprlist ::= expr */
+ 241, /* (217) paren_exprlist ::= */
+ 241, /* (218) paren_exprlist ::= LP exprlist RP */
+ 160, /* (219) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
+ 245, /* (220) uniqueflag ::= UNIQUE */
+ 245, /* (221) uniqueflag ::= */
+ 189, /* (222) eidlist_opt ::= */
+ 189, /* (223) eidlist_opt ::= LP eidlist RP */
+ 199, /* (224) eidlist ::= eidlist COMMA nm collate sortorder */
+ 199, /* (225) eidlist ::= nm collate sortorder */
+ 246, /* (226) collate ::= */
+ 246, /* (227) collate ::= COLLATE ID|STRING */
+ 160, /* (228) cmd ::= DROP INDEX ifexists fullname */
+ 160, /* (229) cmd ::= VACUUM vinto */
+ 160, /* (230) cmd ::= VACUUM nm vinto */
+ 247, /* (231) vinto ::= INTO expr */
+ 247, /* (232) vinto ::= */
+ 160, /* (233) cmd ::= PRAGMA nm dbnm */
+ 160, /* (234) cmd ::= PRAGMA nm dbnm EQ nmnum */
+ 160, /* (235) cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ 160, /* (236) cmd ::= PRAGMA nm dbnm EQ minus_num */
+ 160, /* (237) cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ 180, /* (238) plus_num ::= PLUS INTEGER|FLOAT */
+ 181, /* (239) minus_num ::= MINUS INTEGER|FLOAT */
+ 160, /* (240) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ 249, /* (241) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ 251, /* (242) trigger_time ::= BEFORE|AFTER */
+ 251, /* (243) trigger_time ::= INSTEAD OF */
+ 251, /* (244) trigger_time ::= */
+ 252, /* (245) trigger_event ::= DELETE|INSERT */
+ 252, /* (246) trigger_event ::= UPDATE */
+ 252, /* (247) trigger_event ::= UPDATE OF idlist */
+ 254, /* (248) when_clause ::= */
+ 254, /* (249) when_clause ::= WHEN expr */
+ 250, /* (250) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ 250, /* (251) trigger_cmd_list ::= trigger_cmd SEMI */
+ 256, /* (252) trnm ::= nm DOT nm */
+ 257, /* (253) tridxby ::= INDEXED BY nm */
+ 257, /* (254) tridxby ::= NOT INDEXED */
+ 255, /* (255) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+ 255, /* (256) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ 255, /* (257) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+ 255, /* (258) trigger_cmd ::= scanpt select scanpt */
+ 185, /* (259) expr ::= RAISE LP IGNORE RP */
+ 185, /* (260) expr ::= RAISE LP raisetype COMMA nm RP */
+ 203, /* (261) raisetype ::= ROLLBACK */
+ 203, /* (262) raisetype ::= ABORT */
+ 203, /* (263) raisetype ::= FAIL */
+ 160, /* (264) cmd ::= DROP TRIGGER ifexists fullname */
+ 160, /* (265) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ 160, /* (266) cmd ::= DETACH database_kw_opt expr */
+ 259, /* (267) key_opt ::= */
+ 259, /* (268) key_opt ::= KEY expr */
+ 160, /* (269) cmd ::= REINDEX */
+ 160, /* (270) cmd ::= REINDEX nm dbnm */
+ 160, /* (271) cmd ::= ANALYZE */
+ 160, /* (272) cmd ::= ANALYZE nm dbnm */
+ 160, /* (273) cmd ::= ALTER TABLE fullname RENAME TO nm */
+ 160, /* (274) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ 260, /* (275) add_column_fullname ::= fullname */
+ 160, /* (276) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ 160, /* (277) cmd ::= create_vtab */
+ 160, /* (278) cmd ::= create_vtab LP vtabarglist RP */
+ 262, /* (279) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ 264, /* (280) vtabarg ::= */
+ 265, /* (281) vtabargtoken ::= ANY */
+ 265, /* (282) vtabargtoken ::= lp anylist RP */
+ 266, /* (283) lp ::= LP */
+ 232, /* (284) with ::= WITH wqlist */
+ 232, /* (285) with ::= WITH RECURSIVE wqlist */
+ 208, /* (286) wqlist ::= nm eidlist_opt AS LP select RP */
+ 208, /* (287) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
+ 268, /* (288) windowdefn_list ::= windowdefn */
+ 268, /* (289) windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ 269, /* (290) windowdefn ::= nm AS window */
+ 270, /* (291) window ::= LP part_opt orderby_opt frame_opt RP */
+ 272, /* (292) part_opt ::= PARTITION BY nexprlist */
+ 272, /* (293) part_opt ::= */
+ 271, /* (294) frame_opt ::= */
+ 271, /* (295) frame_opt ::= range_or_rows frame_bound_s */
+ 271, /* (296) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */
+ 274, /* (297) range_or_rows ::= RANGE */
+ 274, /* (298) range_or_rows ::= ROWS */
+ 276, /* (299) frame_bound_s ::= frame_bound */
+ 276, /* (300) frame_bound_s ::= UNBOUNDED PRECEDING */
+ 277, /* (301) frame_bound_e ::= frame_bound */
+ 277, /* (302) frame_bound_e ::= UNBOUNDED FOLLOWING */
+ 275, /* (303) frame_bound ::= expr PRECEDING */
+ 275, /* (304) frame_bound ::= CURRENT ROW */
+ 275, /* (305) frame_bound ::= expr FOLLOWING */
+ 218, /* (306) window_clause ::= WINDOW windowdefn_list */
+ 237, /* (307) over_clause ::= filter_opt OVER window */
+ 237, /* (308) over_clause ::= filter_opt OVER nm */
+ 273, /* (309) filter_opt ::= */
+ 273, /* (310) filter_opt ::= FILTER LP WHERE expr RP */
+ 155, /* (311) input ::= cmdlist */
+ 156, /* (312) cmdlist ::= cmdlist ecmd */
+ 156, /* (313) cmdlist ::= ecmd */
+ 157, /* (314) ecmd ::= SEMI */
+ 157, /* (315) ecmd ::= cmdx SEMI */
+ 157, /* (316) ecmd ::= explain cmdx */
+ 162, /* (317) trans_opt ::= */
+ 162, /* (318) trans_opt ::= TRANSACTION */
+ 162, /* (319) trans_opt ::= TRANSACTION nm */
+ 164, /* (320) savepoint_opt ::= SAVEPOINT */
+ 164, /* (321) savepoint_opt ::= */
+ 160, /* (322) cmd ::= create_table create_table_args */
+ 171, /* (323) columnlist ::= columnlist COMMA columnname carglist */
+ 171, /* (324) columnlist ::= columnname carglist */
+ 163, /* (325) nm ::= ID|INDEXED */
+ 163, /* (326) nm ::= STRING */
+ 163, /* (327) nm ::= JOIN_KW */
+ 177, /* (328) typetoken ::= typename */
+ 178, /* (329) typename ::= ID|STRING */
+ 179, /* (330) signed ::= plus_num */
+ 179, /* (331) signed ::= minus_num */
+ 176, /* (332) carglist ::= carglist ccons */
+ 176, /* (333) carglist ::= */
+ 183, /* (334) ccons ::= NULL onconf */
+ 172, /* (335) conslist_opt ::= COMMA conslist */
+ 195, /* (336) conslist ::= conslist tconscomma tcons */
+ 195, /* (337) conslist ::= tcons */
+ 196, /* (338) tconscomma ::= */
+ 200, /* (339) defer_subclause_opt ::= defer_subclause */
+ 202, /* (340) resolvetype ::= raisetype */
+ 206, /* (341) selectnowith ::= oneselect */
+ 207, /* (342) oneselect ::= values */
+ 221, /* (343) sclp ::= selcollist COMMA */
+ 222, /* (344) as ::= ID|STRING */
+ 185, /* (345) expr ::= term */
+ 238, /* (346) likeop ::= LIKE_KW|MATCH */
+ 229, /* (347) exprlist ::= nexprlist */
+ 248, /* (348) nmnum ::= plus_num */
+ 248, /* (349) nmnum ::= nm */
+ 248, /* (350) nmnum ::= ON */
+ 248, /* (351) nmnum ::= DELETE */
+ 248, /* (352) nmnum ::= DEFAULT */
+ 180, /* (353) plus_num ::= INTEGER|FLOAT */
+ 253, /* (354) foreach_clause ::= */
+ 253, /* (355) foreach_clause ::= FOR EACH ROW */
+ 256, /* (356) trnm ::= nm */
+ 257, /* (357) tridxby ::= */
+ 258, /* (358) database_kw_opt ::= DATABASE */
+ 258, /* (359) database_kw_opt ::= */
+ 261, /* (360) kwcolumn_opt ::= */
+ 261, /* (361) kwcolumn_opt ::= COLUMNKW */
+ 263, /* (362) vtabarglist ::= vtabarg */
+ 263, /* (363) vtabarglist ::= vtabarglist COMMA vtabarg */
+ 264, /* (364) vtabarg ::= vtabarg vtabargtoken */
+ 267, /* (365) anylist ::= */
+ 267, /* (366) anylist ::= anylist LP anylist RP */
+ 267, /* (367) anylist ::= anylist ANY */
+ 232, /* (368) with ::= */
+};
+
+/* For rule J, yyRuleInfoNRhs[J] contains the negative of the number
+** of symbols on the right-hand side of that rule. */
+static const signed char yyRuleInfoNRhs[] = {
+ -1, /* (0) explain ::= EXPLAIN */
+ -3, /* (1) explain ::= EXPLAIN QUERY PLAN */
+ -1, /* (2) cmdx ::= cmd */
+ -3, /* (3) cmd ::= BEGIN transtype trans_opt */
+ 0, /* (4) transtype ::= */
+ -1, /* (5) transtype ::= DEFERRED */
+ -1, /* (6) transtype ::= IMMEDIATE */
+ -1, /* (7) transtype ::= EXCLUSIVE */
+ -2, /* (8) cmd ::= COMMIT|END trans_opt */
+ -2, /* (9) cmd ::= ROLLBACK trans_opt */
+ -2, /* (10) cmd ::= SAVEPOINT nm */
+ -3, /* (11) cmd ::= RELEASE savepoint_opt nm */
+ -5, /* (12) cmd ::= ROLLBACK trans_opt TO savepoint_opt nm */
+ -6, /* (13) create_table ::= createkw temp TABLE ifnotexists nm dbnm */
+ -1, /* (14) createkw ::= CREATE */
+ 0, /* (15) ifnotexists ::= */
+ -3, /* (16) ifnotexists ::= IF NOT EXISTS */
+ -1, /* (17) temp ::= TEMP */
+ 0, /* (18) temp ::= */
+ -5, /* (19) create_table_args ::= LP columnlist conslist_opt RP table_options */
+ -2, /* (20) create_table_args ::= AS select */
+ 0, /* (21) table_options ::= */
+ -2, /* (22) table_options ::= WITHOUT nm */
+ -2, /* (23) columnname ::= nm typetoken */
+ 0, /* (24) typetoken ::= */
+ -4, /* (25) typetoken ::= typename LP signed RP */
+ -6, /* (26) typetoken ::= typename LP signed COMMA signed RP */
+ -2, /* (27) typename ::= typename ID|STRING */
+ 0, /* (28) scanpt ::= */
+ -2, /* (29) ccons ::= CONSTRAINT nm */
+ -4, /* (30) ccons ::= DEFAULT scanpt term scanpt */
+ -4, /* (31) ccons ::= DEFAULT LP expr RP */
+ -4, /* (32) ccons ::= DEFAULT PLUS term scanpt */
+ -4, /* (33) ccons ::= DEFAULT MINUS term scanpt */
+ -3, /* (34) ccons ::= DEFAULT scanpt ID|INDEXED */
+ -3, /* (35) ccons ::= NOT NULL onconf */
+ -5, /* (36) ccons ::= PRIMARY KEY sortorder onconf autoinc */
+ -2, /* (37) ccons ::= UNIQUE onconf */
+ -4, /* (38) ccons ::= CHECK LP expr RP */
+ -4, /* (39) ccons ::= REFERENCES nm eidlist_opt refargs */
+ -1, /* (40) ccons ::= defer_subclause */
+ -2, /* (41) ccons ::= COLLATE ID|STRING */
+ 0, /* (42) autoinc ::= */
+ -1, /* (43) autoinc ::= AUTOINCR */
+ 0, /* (44) refargs ::= */
+ -2, /* (45) refargs ::= refargs refarg */
+ -2, /* (46) refarg ::= MATCH nm */
+ -3, /* (47) refarg ::= ON INSERT refact */
+ -3, /* (48) refarg ::= ON DELETE refact */
+ -3, /* (49) refarg ::= ON UPDATE refact */
+ -2, /* (50) refact ::= SET NULL */
+ -2, /* (51) refact ::= SET DEFAULT */
+ -1, /* (52) refact ::= CASCADE */
+ -1, /* (53) refact ::= RESTRICT */
+ -2, /* (54) refact ::= NO ACTION */
+ -3, /* (55) defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
+ -2, /* (56) defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
+ 0, /* (57) init_deferred_pred_opt ::= */
+ -2, /* (58) init_deferred_pred_opt ::= INITIALLY DEFERRED */
+ -2, /* (59) init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
+ 0, /* (60) conslist_opt ::= */
+ -1, /* (61) tconscomma ::= COMMA */
+ -2, /* (62) tcons ::= CONSTRAINT nm */
+ -7, /* (63) tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
+ -5, /* (64) tcons ::= UNIQUE LP sortlist RP onconf */
+ -5, /* (65) tcons ::= CHECK LP expr RP onconf */
+ -10, /* (66) tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
+ 0, /* (67) defer_subclause_opt ::= */
+ 0, /* (68) onconf ::= */
+ -3, /* (69) onconf ::= ON CONFLICT resolvetype */
+ 0, /* (70) orconf ::= */
+ -2, /* (71) orconf ::= OR resolvetype */
+ -1, /* (72) resolvetype ::= IGNORE */
+ -1, /* (73) resolvetype ::= REPLACE */
+ -4, /* (74) cmd ::= DROP TABLE ifexists fullname */
+ -2, /* (75) ifexists ::= IF EXISTS */
+ 0, /* (76) ifexists ::= */
+ -9, /* (77) cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
+ -4, /* (78) cmd ::= DROP VIEW ifexists fullname */
+ -1, /* (79) cmd ::= select */
+ -3, /* (80) select ::= WITH wqlist selectnowith */
+ -4, /* (81) select ::= WITH RECURSIVE wqlist selectnowith */
+ -1, /* (82) select ::= selectnowith */
+ -3, /* (83) selectnowith ::= selectnowith multiselect_op oneselect */
+ -1, /* (84) multiselect_op ::= UNION */
+ -2, /* (85) multiselect_op ::= UNION ALL */
+ -1, /* (86) multiselect_op ::= EXCEPT|INTERSECT */
+ -9, /* (87) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
+ -10, /* (88) oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
+ -4, /* (89) values ::= VALUES LP nexprlist RP */
+ -5, /* (90) values ::= values COMMA LP nexprlist RP */
+ -1, /* (91) distinct ::= DISTINCT */
+ -1, /* (92) distinct ::= ALL */
+ 0, /* (93) distinct ::= */
+ 0, /* (94) sclp ::= */
+ -5, /* (95) selcollist ::= sclp scanpt expr scanpt as */
+ -3, /* (96) selcollist ::= sclp scanpt STAR */
+ -5, /* (97) selcollist ::= sclp scanpt nm DOT STAR */
+ -2, /* (98) as ::= AS nm */
+ 0, /* (99) as ::= */
+ 0, /* (100) from ::= */
+ -2, /* (101) from ::= FROM seltablist */
+ -2, /* (102) stl_prefix ::= seltablist joinop */
+ 0, /* (103) stl_prefix ::= */
+ -7, /* (104) seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
+ -9, /* (105) seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
+ -7, /* (106) seltablist ::= stl_prefix LP select RP as on_opt using_opt */
+ -7, /* (107) seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
+ 0, /* (108) dbnm ::= */
+ -2, /* (109) dbnm ::= DOT nm */
+ -1, /* (110) fullname ::= nm */
+ -3, /* (111) fullname ::= nm DOT nm */
+ -1, /* (112) xfullname ::= nm */
+ -3, /* (113) xfullname ::= nm DOT nm */
+ -5, /* (114) xfullname ::= nm DOT nm AS nm */
+ -3, /* (115) xfullname ::= nm AS nm */
+ -1, /* (116) joinop ::= COMMA|JOIN */
+ -2, /* (117) joinop ::= JOIN_KW JOIN */
+ -3, /* (118) joinop ::= JOIN_KW nm JOIN */
+ -4, /* (119) joinop ::= JOIN_KW nm nm JOIN */
+ -2, /* (120) on_opt ::= ON expr */
+ 0, /* (121) on_opt ::= */
+ 0, /* (122) indexed_opt ::= */
+ -3, /* (123) indexed_opt ::= INDEXED BY nm */
+ -2, /* (124) indexed_opt ::= NOT INDEXED */
+ -4, /* (125) using_opt ::= USING LP idlist RP */
+ 0, /* (126) using_opt ::= */
+ 0, /* (127) orderby_opt ::= */
+ -3, /* (128) orderby_opt ::= ORDER BY sortlist */
+ -4, /* (129) sortlist ::= sortlist COMMA expr sortorder */
+ -2, /* (130) sortlist ::= expr sortorder */
+ -1, /* (131) sortorder ::= ASC */
+ -1, /* (132) sortorder ::= DESC */
+ 0, /* (133) sortorder ::= */
+ 0, /* (134) groupby_opt ::= */
+ -3, /* (135) groupby_opt ::= GROUP BY nexprlist */
+ 0, /* (136) having_opt ::= */
+ -2, /* (137) having_opt ::= HAVING expr */
+ 0, /* (138) limit_opt ::= */
+ -2, /* (139) limit_opt ::= LIMIT expr */
+ -4, /* (140) limit_opt ::= LIMIT expr OFFSET expr */
+ -4, /* (141) limit_opt ::= LIMIT expr COMMA expr */
+ -6, /* (142) cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
+ 0, /* (143) where_opt ::= */
+ -2, /* (144) where_opt ::= WHERE expr */
+ -8, /* (145) cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
+ -5, /* (146) setlist ::= setlist COMMA nm EQ expr */
+ -7, /* (147) setlist ::= setlist COMMA LP idlist RP EQ expr */
+ -3, /* (148) setlist ::= nm EQ expr */
+ -5, /* (149) setlist ::= LP idlist RP EQ expr */
+ -7, /* (150) cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
+ -7, /* (151) cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
+ 0, /* (152) upsert ::= */
+ -11, /* (153) upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
+ -8, /* (154) upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
+ -4, /* (155) upsert ::= ON CONFLICT DO NOTHING */
+ -2, /* (156) insert_cmd ::= INSERT orconf */
+ -1, /* (157) insert_cmd ::= REPLACE */
+ 0, /* (158) idlist_opt ::= */
+ -3, /* (159) idlist_opt ::= LP idlist RP */
+ -3, /* (160) idlist ::= idlist COMMA nm */
+ -1, /* (161) idlist ::= nm */
+ -3, /* (162) expr ::= LP expr RP */
+ -1, /* (163) expr ::= ID|INDEXED */
+ -1, /* (164) expr ::= JOIN_KW */
+ -3, /* (165) expr ::= nm DOT nm */
+ -5, /* (166) expr ::= nm DOT nm DOT nm */
+ -1, /* (167) term ::= NULL|FLOAT|BLOB */
+ -1, /* (168) term ::= STRING */
+ -1, /* (169) term ::= INTEGER */
+ -1, /* (170) expr ::= VARIABLE */
+ -3, /* (171) expr ::= expr COLLATE ID|STRING */
+ -6, /* (172) expr ::= CAST LP expr AS typetoken RP */
+ -5, /* (173) expr ::= ID|INDEXED LP distinct exprlist RP */
+ -4, /* (174) expr ::= ID|INDEXED LP STAR RP */
+ -6, /* (175) expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
+ -5, /* (176) expr ::= ID|INDEXED LP STAR RP over_clause */
+ -1, /* (177) term ::= CTIME_KW */
+ -5, /* (178) expr ::= LP nexprlist COMMA expr RP */
+ -3, /* (179) expr ::= expr AND expr */
+ -3, /* (180) expr ::= expr OR expr */
+ -3, /* (181) expr ::= expr LT|GT|GE|LE expr */
+ -3, /* (182) expr ::= expr EQ|NE expr */
+ -3, /* (183) expr ::= expr BITAND|BITOR|LSHIFT|RSHIFT expr */
+ -3, /* (184) expr ::= expr PLUS|MINUS expr */
+ -3, /* (185) expr ::= expr STAR|SLASH|REM expr */
+ -3, /* (186) expr ::= expr CONCAT expr */
+ -2, /* (187) likeop ::= NOT LIKE_KW|MATCH */
+ -3, /* (188) expr ::= expr likeop expr */
+ -5, /* (189) expr ::= expr likeop expr ESCAPE expr */
+ -2, /* (190) expr ::= expr ISNULL|NOTNULL */
+ -3, /* (191) expr ::= expr NOT NULL */
+ -3, /* (192) expr ::= expr IS expr */
+ -4, /* (193) expr ::= expr IS NOT expr */
+ -2, /* (194) expr ::= NOT expr */
+ -2, /* (195) expr ::= BITNOT expr */
+ -2, /* (196) expr ::= PLUS|MINUS expr */
+ -1, /* (197) between_op ::= BETWEEN */
+ -2, /* (198) between_op ::= NOT BETWEEN */
+ -5, /* (199) expr ::= expr between_op expr AND expr */
+ -1, /* (200) in_op ::= IN */
+ -2, /* (201) in_op ::= NOT IN */
+ -5, /* (202) expr ::= expr in_op LP exprlist RP */
+ -3, /* (203) expr ::= LP select RP */
+ -5, /* (204) expr ::= expr in_op LP select RP */
+ -5, /* (205) expr ::= expr in_op nm dbnm paren_exprlist */
+ -4, /* (206) expr ::= EXISTS LP select RP */
+ -5, /* (207) expr ::= CASE case_operand case_exprlist case_else END */
+ -5, /* (208) case_exprlist ::= case_exprlist WHEN expr THEN expr */
+ -4, /* (209) case_exprlist ::= WHEN expr THEN expr */
+ -2, /* (210) case_else ::= ELSE expr */
+ 0, /* (211) case_else ::= */
+ -1, /* (212) case_operand ::= expr */
+ 0, /* (213) case_operand ::= */
+ 0, /* (214) exprlist ::= */
+ -3, /* (215) nexprlist ::= nexprlist COMMA expr */
+ -1, /* (216) nexprlist ::= expr */
+ 0, /* (217) paren_exprlist ::= */
+ -3, /* (218) paren_exprlist ::= LP exprlist RP */
+ -12, /* (219) cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
+ -1, /* (220) uniqueflag ::= UNIQUE */
+ 0, /* (221) uniqueflag ::= */
+ 0, /* (222) eidlist_opt ::= */
+ -3, /* (223) eidlist_opt ::= LP eidlist RP */
+ -5, /* (224) eidlist ::= eidlist COMMA nm collate sortorder */
+ -3, /* (225) eidlist ::= nm collate sortorder */
+ 0, /* (226) collate ::= */
+ -2, /* (227) collate ::= COLLATE ID|STRING */
+ -4, /* (228) cmd ::= DROP INDEX ifexists fullname */
+ -2, /* (229) cmd ::= VACUUM vinto */
+ -3, /* (230) cmd ::= VACUUM nm vinto */
+ -2, /* (231) vinto ::= INTO expr */
+ 0, /* (232) vinto ::= */
+ -3, /* (233) cmd ::= PRAGMA nm dbnm */
+ -5, /* (234) cmd ::= PRAGMA nm dbnm EQ nmnum */
+ -6, /* (235) cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ -5, /* (236) cmd ::= PRAGMA nm dbnm EQ minus_num */
+ -6, /* (237) cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ -2, /* (238) plus_num ::= PLUS INTEGER|FLOAT */
+ -2, /* (239) minus_num ::= MINUS INTEGER|FLOAT */
+ -5, /* (240) cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ -11, /* (241) trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ -1, /* (242) trigger_time ::= BEFORE|AFTER */
+ -2, /* (243) trigger_time ::= INSTEAD OF */
+ 0, /* (244) trigger_time ::= */
+ -1, /* (245) trigger_event ::= DELETE|INSERT */
+ -1, /* (246) trigger_event ::= UPDATE */
+ -3, /* (247) trigger_event ::= UPDATE OF idlist */
+ 0, /* (248) when_clause ::= */
+ -2, /* (249) when_clause ::= WHEN expr */
+ -3, /* (250) trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ -2, /* (251) trigger_cmd_list ::= trigger_cmd SEMI */
+ -3, /* (252) trnm ::= nm DOT nm */
+ -3, /* (253) tridxby ::= INDEXED BY nm */
+ -2, /* (254) tridxby ::= NOT INDEXED */
+ -8, /* (255) trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+ -8, /* (256) trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ -6, /* (257) trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+ -3, /* (258) trigger_cmd ::= scanpt select scanpt */
+ -4, /* (259) expr ::= RAISE LP IGNORE RP */
+ -6, /* (260) expr ::= RAISE LP raisetype COMMA nm RP */
+ -1, /* (261) raisetype ::= ROLLBACK */
+ -1, /* (262) raisetype ::= ABORT */
+ -1, /* (263) raisetype ::= FAIL */
+ -4, /* (264) cmd ::= DROP TRIGGER ifexists fullname */
+ -6, /* (265) cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ -3, /* (266) cmd ::= DETACH database_kw_opt expr */
+ 0, /* (267) key_opt ::= */
+ -2, /* (268) key_opt ::= KEY expr */
+ -1, /* (269) cmd ::= REINDEX */
+ -3, /* (270) cmd ::= REINDEX nm dbnm */
+ -1, /* (271) cmd ::= ANALYZE */
+ -3, /* (272) cmd ::= ANALYZE nm dbnm */
+ -6, /* (273) cmd ::= ALTER TABLE fullname RENAME TO nm */
+ -7, /* (274) cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ -1, /* (275) add_column_fullname ::= fullname */
+ -8, /* (276) cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ -1, /* (277) cmd ::= create_vtab */
+ -4, /* (278) cmd ::= create_vtab LP vtabarglist RP */
+ -8, /* (279) create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ 0, /* (280) vtabarg ::= */
+ -1, /* (281) vtabargtoken ::= ANY */
+ -3, /* (282) vtabargtoken ::= lp anylist RP */
+ -1, /* (283) lp ::= LP */
+ -2, /* (284) with ::= WITH wqlist */
+ -3, /* (285) with ::= WITH RECURSIVE wqlist */
+ -6, /* (286) wqlist ::= nm eidlist_opt AS LP select RP */
+ -8, /* (287) wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
+ -1, /* (288) windowdefn_list ::= windowdefn */
+ -3, /* (289) windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ -3, /* (290) windowdefn ::= nm AS window */
+ -5, /* (291) window ::= LP part_opt orderby_opt frame_opt RP */
+ -3, /* (292) part_opt ::= PARTITION BY nexprlist */
+ 0, /* (293) part_opt ::= */
+ 0, /* (294) frame_opt ::= */
+ -2, /* (295) frame_opt ::= range_or_rows frame_bound_s */
+ -5, /* (296) frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */
+ -1, /* (297) range_or_rows ::= RANGE */
+ -1, /* (298) range_or_rows ::= ROWS */
+ -1, /* (299) frame_bound_s ::= frame_bound */
+ -2, /* (300) frame_bound_s ::= UNBOUNDED PRECEDING */
+ -1, /* (301) frame_bound_e ::= frame_bound */
+ -2, /* (302) frame_bound_e ::= UNBOUNDED FOLLOWING */
+ -2, /* (303) frame_bound ::= expr PRECEDING */
+ -2, /* (304) frame_bound ::= CURRENT ROW */
+ -2, /* (305) frame_bound ::= expr FOLLOWING */
+ -2, /* (306) window_clause ::= WINDOW windowdefn_list */
+ -3, /* (307) over_clause ::= filter_opt OVER window */
+ -3, /* (308) over_clause ::= filter_opt OVER nm */
+ 0, /* (309) filter_opt ::= */
+ -5, /* (310) filter_opt ::= FILTER LP WHERE expr RP */
+ -1, /* (311) input ::= cmdlist */
+ -2, /* (312) cmdlist ::= cmdlist ecmd */
+ -1, /* (313) cmdlist ::= ecmd */
+ -1, /* (314) ecmd ::= SEMI */
+ -2, /* (315) ecmd ::= cmdx SEMI */
+ -2, /* (316) ecmd ::= explain cmdx */
+ 0, /* (317) trans_opt ::= */
+ -1, /* (318) trans_opt ::= TRANSACTION */
+ -2, /* (319) trans_opt ::= TRANSACTION nm */
+ -1, /* (320) savepoint_opt ::= SAVEPOINT */
+ 0, /* (321) savepoint_opt ::= */
+ -2, /* (322) cmd ::= create_table create_table_args */
+ -4, /* (323) columnlist ::= columnlist COMMA columnname carglist */
+ -2, /* (324) columnlist ::= columnname carglist */
+ -1, /* (325) nm ::= ID|INDEXED */
+ -1, /* (326) nm ::= STRING */
+ -1, /* (327) nm ::= JOIN_KW */
+ -1, /* (328) typetoken ::= typename */
+ -1, /* (329) typename ::= ID|STRING */
+ -1, /* (330) signed ::= plus_num */
+ -1, /* (331) signed ::= minus_num */
+ -2, /* (332) carglist ::= carglist ccons */
+ 0, /* (333) carglist ::= */
+ -2, /* (334) ccons ::= NULL onconf */
+ -2, /* (335) conslist_opt ::= COMMA conslist */
+ -3, /* (336) conslist ::= conslist tconscomma tcons */
+ -1, /* (337) conslist ::= tcons */
+ 0, /* (338) tconscomma ::= */
+ -1, /* (339) defer_subclause_opt ::= defer_subclause */
+ -1, /* (340) resolvetype ::= raisetype */
+ -1, /* (341) selectnowith ::= oneselect */
+ -1, /* (342) oneselect ::= values */
+ -2, /* (343) sclp ::= selcollist COMMA */
+ -1, /* (344) as ::= ID|STRING */
+ -1, /* (345) expr ::= term */
+ -1, /* (346) likeop ::= LIKE_KW|MATCH */
+ -1, /* (347) exprlist ::= nexprlist */
+ -1, /* (348) nmnum ::= plus_num */
+ -1, /* (349) nmnum ::= nm */
+ -1, /* (350) nmnum ::= ON */
+ -1, /* (351) nmnum ::= DELETE */
+ -1, /* (352) nmnum ::= DEFAULT */
+ -1, /* (353) plus_num ::= INTEGER|FLOAT */
+ 0, /* (354) foreach_clause ::= */
+ -3, /* (355) foreach_clause ::= FOR EACH ROW */
+ -1, /* (356) trnm ::= nm */
+ 0, /* (357) tridxby ::= */
+ -1, /* (358) database_kw_opt ::= DATABASE */
+ 0, /* (359) database_kw_opt ::= */
+ 0, /* (360) kwcolumn_opt ::= */
+ -1, /* (361) kwcolumn_opt ::= COLUMNKW */
+ -1, /* (362) vtabarglist ::= vtabarg */
+ -3, /* (363) vtabarglist ::= vtabarglist COMMA vtabarg */
+ -2, /* (364) vtabarg ::= vtabarg vtabargtoken */
+ 0, /* (365) anylist ::= */
+ -4, /* (366) anylist ::= anylist LP anylist RP */
+ -2, /* (367) anylist ::= anylist ANY */
+ 0, /* (368) with ::= */
};
static void yy_accept(yyParser*); /* Forward Declaration */
@@ -149483,7 +150362,7 @@ static YYACTIONTYPE yy_reduce(
yymsp = yypParser->yytos;
#ifndef NDEBUG
if( yyTraceFILE && yyruleno<(int)(sizeof(yyRuleName)/sizeof(yyRuleName[0])) ){
- yysize = yyRuleInfo[yyruleno].nrhs;
+ yysize = yyRuleInfoNRhs[yyruleno];
if( yysize ){
fprintf(yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
yyTracePrompt,
@@ -149498,7 +150377,7 @@ static YYACTIONTYPE yy_reduce(
/* Check that the stack is large enough to grow by a single entry
** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */
- if( yyRuleInfo[yyruleno].nrhs==0 ){
+ if( yyRuleInfoNRhs[yyruleno]==0 ){
#ifdef YYTRACKMAXSTACKDEPTH
if( (int)(yypParser->yytos - yypParser->yystack)>yypParser->yyhwm ){
yypParser->yyhwm++;
@@ -149548,15 +150427,15 @@ static YYACTIONTYPE yy_reduce(
{ sqlite3FinishCoding(pParse); }
break;
case 3: /* cmd ::= BEGIN transtype trans_opt */
-{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy70);}
+{sqlite3BeginTransaction(pParse, yymsp[-1].minor.yy96);}
break;
case 4: /* transtype ::= */
-{yymsp[1].minor.yy70 = TK_DEFERRED;}
+{yymsp[1].minor.yy96 = TK_DEFERRED;}
break;
case 5: /* transtype ::= DEFERRED */
case 6: /* transtype ::= IMMEDIATE */ yytestcase(yyruleno==6);
case 7: /* transtype ::= EXCLUSIVE */ yytestcase(yyruleno==7);
-{yymsp[0].minor.yy70 = yymsp[0].major; /*A-overwrites-X*/}
+{yymsp[0].minor.yy96 = yymsp[0].major; /*A-overwrites-X*/}
break;
case 8: /* cmd ::= COMMIT|END trans_opt */
case 9: /* cmd ::= ROLLBACK trans_opt */ yytestcase(yyruleno==9);
@@ -149579,7 +150458,7 @@ static YYACTIONTYPE yy_reduce(
break;
case 13: /* create_table ::= createkw temp TABLE ifnotexists nm dbnm */
{
- sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy70,0,0,yymsp[-2].minor.yy70);
+ sqlite3StartTable(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,yymsp[-4].minor.yy96,0,0,yymsp[-2].minor.yy96);
}
break;
case 14: /* createkw ::= CREATE */
@@ -149594,32 +150473,32 @@ static YYACTIONTYPE yy_reduce(
case 76: /* ifexists ::= */ yytestcase(yyruleno==76);
case 93: /* distinct ::= */ yytestcase(yyruleno==93);
case 226: /* collate ::= */ yytestcase(yyruleno==226);
-{yymsp[1].minor.yy70 = 0;}
+{yymsp[1].minor.yy96 = 0;}
break;
case 16: /* ifnotexists ::= IF NOT EXISTS */
-{yymsp[-2].minor.yy70 = 1;}
+{yymsp[-2].minor.yy96 = 1;}
break;
case 17: /* temp ::= TEMP */
case 43: /* autoinc ::= AUTOINCR */ yytestcase(yyruleno==43);
-{yymsp[0].minor.yy70 = 1;}
+{yymsp[0].minor.yy96 = 1;}
break;
case 19: /* create_table_args ::= LP columnlist conslist_opt RP table_options */
{
- sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy70,0);
+ sqlite3EndTable(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,yymsp[0].minor.yy96,0);
}
break;
case 20: /* create_table_args ::= AS select */
{
- sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy489);
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy489);
+ sqlite3EndTable(pParse,0,0,0,yymsp[0].minor.yy423);
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy423);
}
break;
case 22: /* table_options ::= WITHOUT nm */
{
if( yymsp[0].minor.yy0.n==5 && sqlite3_strnicmp(yymsp[0].minor.yy0.z,"rowid",5)==0 ){
- yymsp[-1].minor.yy70 = TF_WithoutRowid | TF_NoVisibleRowid;
+ yymsp[-1].minor.yy96 = TF_WithoutRowid | TF_NoVisibleRowid;
}else{
- yymsp[-1].minor.yy70 = 0;
+ yymsp[-1].minor.yy96 = 0;
sqlite3ErrorMsg(pParse, "unknown table option: %.*s", yymsp[0].minor.yy0.n, yymsp[0].minor.yy0.z);
}
}
@@ -149648,7 +150527,7 @@ static YYACTIONTYPE yy_reduce(
case 28: /* scanpt ::= */
{
assert( yyLookahead!=YYNOCODE );
- yymsp[1].minor.yy392 = yyLookaheadToken.z;
+ yymsp[1].minor.yy464 = yyLookaheadToken.z;
}
break;
case 29: /* ccons ::= CONSTRAINT nm */
@@ -149656,18 +150535,18 @@ static YYACTIONTYPE yy_reduce(
{pParse->constraintName = yymsp[0].minor.yy0;}
break;
case 30: /* ccons ::= DEFAULT scanpt term scanpt */
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy18,yymsp[-2].minor.yy392,yymsp[0].minor.yy392);}
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy490,yymsp[-2].minor.yy464,yymsp[0].minor.yy464);}
break;
case 31: /* ccons ::= DEFAULT LP expr RP */
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy18,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy490,yymsp[-2].minor.yy0.z+1,yymsp[0].minor.yy0.z);}
break;
case 32: /* ccons ::= DEFAULT PLUS term scanpt */
-{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy18,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy392);}
+{sqlite3AddDefaultValue(pParse,yymsp[-1].minor.yy490,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy464);}
break;
case 33: /* ccons ::= DEFAULT MINUS term scanpt */
{
- Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[-1].minor.yy18, 0);
- sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy392);
+ Expr *p = sqlite3PExpr(pParse, TK_UMINUS, yymsp[-1].minor.yy490, 0);
+ sqlite3AddDefaultValue(pParse,p,yymsp[-2].minor.yy0.z,yymsp[0].minor.yy464);
}
break;
case 34: /* ccons ::= DEFAULT scanpt ID|INDEXED */
@@ -149681,170 +150560,170 @@ static YYACTIONTYPE yy_reduce(
}
break;
case 35: /* ccons ::= NOT NULL onconf */
-{sqlite3AddNotNull(pParse, yymsp[0].minor.yy70);}
+{sqlite3AddNotNull(pParse, yymsp[0].minor.yy96);}
break;
case 36: /* ccons ::= PRIMARY KEY sortorder onconf autoinc */
-{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy70,yymsp[0].minor.yy70,yymsp[-2].minor.yy70);}
+{sqlite3AddPrimaryKey(pParse,0,yymsp[-1].minor.yy96,yymsp[0].minor.yy96,yymsp[-2].minor.yy96);}
break;
case 37: /* ccons ::= UNIQUE onconf */
-{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy70,0,0,0,0,
+{sqlite3CreateIndex(pParse,0,0,0,0,yymsp[0].minor.yy96,0,0,0,0,
SQLITE_IDXTYPE_UNIQUE);}
break;
case 38: /* ccons ::= CHECK LP expr RP */
-{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy18);}
+{sqlite3AddCheckConstraint(pParse,yymsp[-1].minor.yy490);}
break;
case 39: /* ccons ::= REFERENCES nm eidlist_opt refargs */
-{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy420,yymsp[0].minor.yy70);}
+{sqlite3CreateForeignKey(pParse,0,&yymsp[-2].minor.yy0,yymsp[-1].minor.yy42,yymsp[0].minor.yy96);}
break;
case 40: /* ccons ::= defer_subclause */
-{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy70);}
+{sqlite3DeferForeignKey(pParse,yymsp[0].minor.yy96);}
break;
case 41: /* ccons ::= COLLATE ID|STRING */
{sqlite3AddCollateType(pParse, &yymsp[0].minor.yy0);}
break;
case 44: /* refargs ::= */
-{ yymsp[1].minor.yy70 = OE_None*0x0101; /* EV: R-19803-45884 */}
+{ yymsp[1].minor.yy96 = OE_None*0x0101; /* EV: R-19803-45884 */}
break;
case 45: /* refargs ::= refargs refarg */
-{ yymsp[-1].minor.yy70 = (yymsp[-1].minor.yy70 & ~yymsp[0].minor.yy111.mask) | yymsp[0].minor.yy111.value; }
+{ yymsp[-1].minor.yy96 = (yymsp[-1].minor.yy96 & ~yymsp[0].minor.yy367.mask) | yymsp[0].minor.yy367.value; }
break;
case 46: /* refarg ::= MATCH nm */
-{ yymsp[-1].minor.yy111.value = 0; yymsp[-1].minor.yy111.mask = 0x000000; }
+{ yymsp[-1].minor.yy367.value = 0; yymsp[-1].minor.yy367.mask = 0x000000; }
break;
case 47: /* refarg ::= ON INSERT refact */
-{ yymsp[-2].minor.yy111.value = 0; yymsp[-2].minor.yy111.mask = 0x000000; }
+{ yymsp[-2].minor.yy367.value = 0; yymsp[-2].minor.yy367.mask = 0x000000; }
break;
case 48: /* refarg ::= ON DELETE refact */
-{ yymsp[-2].minor.yy111.value = yymsp[0].minor.yy70; yymsp[-2].minor.yy111.mask = 0x0000ff; }
+{ yymsp[-2].minor.yy367.value = yymsp[0].minor.yy96; yymsp[-2].minor.yy367.mask = 0x0000ff; }
break;
case 49: /* refarg ::= ON UPDATE refact */
-{ yymsp[-2].minor.yy111.value = yymsp[0].minor.yy70<<8; yymsp[-2].minor.yy111.mask = 0x00ff00; }
+{ yymsp[-2].minor.yy367.value = yymsp[0].minor.yy96<<8; yymsp[-2].minor.yy367.mask = 0x00ff00; }
break;
case 50: /* refact ::= SET NULL */
-{ yymsp[-1].minor.yy70 = OE_SetNull; /* EV: R-33326-45252 */}
+{ yymsp[-1].minor.yy96 = OE_SetNull; /* EV: R-33326-45252 */}
break;
case 51: /* refact ::= SET DEFAULT */
-{ yymsp[-1].minor.yy70 = OE_SetDflt; /* EV: R-33326-45252 */}
+{ yymsp[-1].minor.yy96 = OE_SetDflt; /* EV: R-33326-45252 */}
break;
case 52: /* refact ::= CASCADE */
-{ yymsp[0].minor.yy70 = OE_Cascade; /* EV: R-33326-45252 */}
+{ yymsp[0].minor.yy96 = OE_Cascade; /* EV: R-33326-45252 */}
break;
case 53: /* refact ::= RESTRICT */
-{ yymsp[0].minor.yy70 = OE_Restrict; /* EV: R-33326-45252 */}
+{ yymsp[0].minor.yy96 = OE_Restrict; /* EV: R-33326-45252 */}
break;
case 54: /* refact ::= NO ACTION */
-{ yymsp[-1].minor.yy70 = OE_None; /* EV: R-33326-45252 */}
+{ yymsp[-1].minor.yy96 = OE_None; /* EV: R-33326-45252 */}
break;
case 55: /* defer_subclause ::= NOT DEFERRABLE init_deferred_pred_opt */
-{yymsp[-2].minor.yy70 = 0;}
+{yymsp[-2].minor.yy96 = 0;}
break;
case 56: /* defer_subclause ::= DEFERRABLE init_deferred_pred_opt */
case 71: /* orconf ::= OR resolvetype */ yytestcase(yyruleno==71);
case 156: /* insert_cmd ::= INSERT orconf */ yytestcase(yyruleno==156);
-{yymsp[-1].minor.yy70 = yymsp[0].minor.yy70;}
+{yymsp[-1].minor.yy96 = yymsp[0].minor.yy96;}
break;
case 58: /* init_deferred_pred_opt ::= INITIALLY DEFERRED */
case 75: /* ifexists ::= IF EXISTS */ yytestcase(yyruleno==75);
case 198: /* between_op ::= NOT BETWEEN */ yytestcase(yyruleno==198);
case 201: /* in_op ::= NOT IN */ yytestcase(yyruleno==201);
case 227: /* collate ::= COLLATE ID|STRING */ yytestcase(yyruleno==227);
-{yymsp[-1].minor.yy70 = 1;}
+{yymsp[-1].minor.yy96 = 1;}
break;
case 59: /* init_deferred_pred_opt ::= INITIALLY IMMEDIATE */
-{yymsp[-1].minor.yy70 = 0;}
+{yymsp[-1].minor.yy96 = 0;}
break;
case 61: /* tconscomma ::= COMMA */
{pParse->constraintName.n = 0;}
break;
case 63: /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */
-{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy420,yymsp[0].minor.yy70,yymsp[-2].minor.yy70,0);}
+{sqlite3AddPrimaryKey(pParse,yymsp[-3].minor.yy42,yymsp[0].minor.yy96,yymsp[-2].minor.yy96,0);}
break;
case 64: /* tcons ::= UNIQUE LP sortlist RP onconf */
-{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy420,yymsp[0].minor.yy70,0,0,0,0,
+{sqlite3CreateIndex(pParse,0,0,0,yymsp[-2].minor.yy42,yymsp[0].minor.yy96,0,0,0,0,
SQLITE_IDXTYPE_UNIQUE);}
break;
case 65: /* tcons ::= CHECK LP expr RP onconf */
-{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy18);}
+{sqlite3AddCheckConstraint(pParse,yymsp[-2].minor.yy490);}
break;
case 66: /* tcons ::= FOREIGN KEY LP eidlist RP REFERENCES nm eidlist_opt refargs defer_subclause_opt */
{
- sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy420, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy420, yymsp[-1].minor.yy70);
- sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy70);
+ sqlite3CreateForeignKey(pParse, yymsp[-6].minor.yy42, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy42, yymsp[-1].minor.yy96);
+ sqlite3DeferForeignKey(pParse, yymsp[0].minor.yy96);
}
break;
case 68: /* onconf ::= */
case 70: /* orconf ::= */ yytestcase(yyruleno==70);
-{yymsp[1].minor.yy70 = OE_Default;}
+{yymsp[1].minor.yy96 = OE_Default;}
break;
case 69: /* onconf ::= ON CONFLICT resolvetype */
-{yymsp[-2].minor.yy70 = yymsp[0].minor.yy70;}
+{yymsp[-2].minor.yy96 = yymsp[0].minor.yy96;}
break;
case 72: /* resolvetype ::= IGNORE */
-{yymsp[0].minor.yy70 = OE_Ignore;}
+{yymsp[0].minor.yy96 = OE_Ignore;}
break;
case 73: /* resolvetype ::= REPLACE */
case 157: /* insert_cmd ::= REPLACE */ yytestcase(yyruleno==157);
-{yymsp[0].minor.yy70 = OE_Replace;}
+{yymsp[0].minor.yy96 = OE_Replace;}
break;
case 74: /* cmd ::= DROP TABLE ifexists fullname */
{
- sqlite3DropTable(pParse, yymsp[0].minor.yy135, 0, yymsp[-1].minor.yy70);
+ sqlite3DropTable(pParse, yymsp[0].minor.yy167, 0, yymsp[-1].minor.yy96);
}
break;
case 77: /* cmd ::= createkw temp VIEW ifnotexists nm dbnm eidlist_opt AS select */
{
- sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy420, yymsp[0].minor.yy489, yymsp[-7].minor.yy70, yymsp[-5].minor.yy70);
+ sqlite3CreateView(pParse, &yymsp[-8].minor.yy0, &yymsp[-4].minor.yy0, &yymsp[-3].minor.yy0, yymsp[-2].minor.yy42, yymsp[0].minor.yy423, yymsp[-7].minor.yy96, yymsp[-5].minor.yy96);
}
break;
case 78: /* cmd ::= DROP VIEW ifexists fullname */
{
- sqlite3DropTable(pParse, yymsp[0].minor.yy135, 1, yymsp[-1].minor.yy70);
+ sqlite3DropTable(pParse, yymsp[0].minor.yy167, 1, yymsp[-1].minor.yy96);
}
break;
case 79: /* cmd ::= select */
{
SelectDest dest = {SRT_Output, 0, 0, 0, 0, 0};
- sqlite3Select(pParse, yymsp[0].minor.yy489, &dest);
- sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy489);
+ sqlite3Select(pParse, yymsp[0].minor.yy423, &dest);
+ sqlite3SelectDelete(pParse->db, yymsp[0].minor.yy423);
}
break;
case 80: /* select ::= WITH wqlist selectnowith */
{
- Select *p = yymsp[0].minor.yy489;
+ Select *p = yymsp[0].minor.yy423;
if( p ){
- p->pWith = yymsp[-1].minor.yy449;
+ p->pWith = yymsp[-1].minor.yy499;
parserDoubleLinkSelect(pParse, p);
}else{
- sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy449);
+ sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy499);
}
- yymsp[-2].minor.yy489 = p;
+ yymsp[-2].minor.yy423 = p;
}
break;
case 81: /* select ::= WITH RECURSIVE wqlist selectnowith */
{
- Select *p = yymsp[0].minor.yy489;
+ Select *p = yymsp[0].minor.yy423;
if( p ){
- p->pWith = yymsp[-1].minor.yy449;
+ p->pWith = yymsp[-1].minor.yy499;
parserDoubleLinkSelect(pParse, p);
}else{
- sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy449);
+ sqlite3WithDelete(pParse->db, yymsp[-1].minor.yy499);
}
- yymsp[-3].minor.yy489 = p;
+ yymsp[-3].minor.yy423 = p;
}
break;
case 82: /* select ::= selectnowith */
{
- Select *p = yymsp[0].minor.yy489;
+ Select *p = yymsp[0].minor.yy423;
if( p ){
parserDoubleLinkSelect(pParse, p);
}
- yymsp[0].minor.yy489 = p; /*A-overwrites-X*/
+ yymsp[0].minor.yy423 = p; /*A-overwrites-X*/
}
break;
case 83: /* selectnowith ::= selectnowith multiselect_op oneselect */
{
- Select *pRhs = yymsp[0].minor.yy489;
- Select *pLhs = yymsp[-2].minor.yy489;
+ Select *pRhs = yymsp[0].minor.yy423;
+ Select *pLhs = yymsp[-2].minor.yy423;
if( pRhs && pRhs->pPrior ){
SrcList *pFrom;
Token x;
@@ -149854,63 +150733,63 @@ static YYACTIONTYPE yy_reduce(
pRhs = sqlite3SelectNew(pParse,0,pFrom,0,0,0,0,0,0);
}
if( pRhs ){
- pRhs->op = (u8)yymsp[-1].minor.yy70;
+ pRhs->op = (u8)yymsp[-1].minor.yy96;
pRhs->pPrior = pLhs;
if( ALWAYS(pLhs) ) pLhs->selFlags &= ~SF_MultiValue;
pRhs->selFlags &= ~SF_MultiValue;
- if( yymsp[-1].minor.yy70!=TK_ALL ) pParse->hasCompound = 1;
+ if( yymsp[-1].minor.yy96!=TK_ALL ) pParse->hasCompound = 1;
}else{
sqlite3SelectDelete(pParse->db, pLhs);
}
- yymsp[-2].minor.yy489 = pRhs;
+ yymsp[-2].minor.yy423 = pRhs;
}
break;
case 84: /* multiselect_op ::= UNION */
case 86: /* multiselect_op ::= EXCEPT|INTERSECT */ yytestcase(yyruleno==86);
-{yymsp[0].minor.yy70 = yymsp[0].major; /*A-overwrites-OP*/}
+{yymsp[0].minor.yy96 = yymsp[0].major; /*A-overwrites-OP*/}
break;
case 85: /* multiselect_op ::= UNION ALL */
-{yymsp[-1].minor.yy70 = TK_ALL;}
+{yymsp[-1].minor.yy96 = TK_ALL;}
break;
case 87: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt orderby_opt limit_opt */
{
- yymsp[-8].minor.yy489 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy420,yymsp[-5].minor.yy135,yymsp[-4].minor.yy18,yymsp[-3].minor.yy420,yymsp[-2].minor.yy18,yymsp[-1].minor.yy420,yymsp[-7].minor.yy70,yymsp[0].minor.yy18);
+ yymsp[-8].minor.yy423 = sqlite3SelectNew(pParse,yymsp[-6].minor.yy42,yymsp[-5].minor.yy167,yymsp[-4].minor.yy490,yymsp[-3].minor.yy42,yymsp[-2].minor.yy490,yymsp[-1].minor.yy42,yymsp[-7].minor.yy96,yymsp[0].minor.yy490);
}
break;
case 88: /* oneselect ::= SELECT distinct selcollist from where_opt groupby_opt having_opt window_clause orderby_opt limit_opt */
{
- yymsp[-9].minor.yy489 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy420,yymsp[-6].minor.yy135,yymsp[-5].minor.yy18,yymsp[-4].minor.yy420,yymsp[-3].minor.yy18,yymsp[-1].minor.yy420,yymsp[-8].minor.yy70,yymsp[0].minor.yy18);
- if( yymsp[-9].minor.yy489 ){
- yymsp[-9].minor.yy489->pWinDefn = yymsp[-2].minor.yy327;
+ yymsp[-9].minor.yy423 = sqlite3SelectNew(pParse,yymsp[-7].minor.yy42,yymsp[-6].minor.yy167,yymsp[-5].minor.yy490,yymsp[-4].minor.yy42,yymsp[-3].minor.yy490,yymsp[-1].minor.yy42,yymsp[-8].minor.yy96,yymsp[0].minor.yy490);
+ if( yymsp[-9].minor.yy423 ){
+ yymsp[-9].minor.yy423->pWinDefn = yymsp[-2].minor.yy147;
}else{
- sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy327);
+ sqlite3WindowListDelete(pParse->db, yymsp[-2].minor.yy147);
}
}
break;
case 89: /* values ::= VALUES LP nexprlist RP */
{
- yymsp[-3].minor.yy489 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy420,0,0,0,0,0,SF_Values,0);
+ yymsp[-3].minor.yy423 = sqlite3SelectNew(pParse,yymsp[-1].minor.yy42,0,0,0,0,0,SF_Values,0);
}
break;
case 90: /* values ::= values COMMA LP nexprlist RP */
{
- Select *pRight, *pLeft = yymsp[-4].minor.yy489;
- pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy420,0,0,0,0,0,SF_Values|SF_MultiValue,0);
+ Select *pRight, *pLeft = yymsp[-4].minor.yy423;
+ pRight = sqlite3SelectNew(pParse,yymsp[-1].minor.yy42,0,0,0,0,0,SF_Values|SF_MultiValue,0);
if( ALWAYS(pLeft) ) pLeft->selFlags &= ~SF_MultiValue;
if( pRight ){
pRight->op = TK_ALL;
pRight->pPrior = pLeft;
- yymsp[-4].minor.yy489 = pRight;
+ yymsp[-4].minor.yy423 = pRight;
}else{
- yymsp[-4].minor.yy489 = pLeft;
+ yymsp[-4].minor.yy423 = pLeft;
}
}
break;
case 91: /* distinct ::= DISTINCT */
-{yymsp[0].minor.yy70 = SF_Distinct;}
+{yymsp[0].minor.yy96 = SF_Distinct;}
break;
case 92: /* distinct ::= ALL */
-{yymsp[0].minor.yy70 = SF_All;}
+{yymsp[0].minor.yy96 = SF_All;}
break;
case 94: /* sclp ::= */
case 127: /* orderby_opt ::= */ yytestcase(yyruleno==127);
@@ -149918,19 +150797,19 @@ static YYACTIONTYPE yy_reduce(
case 214: /* exprlist ::= */ yytestcase(yyruleno==214);
case 217: /* paren_exprlist ::= */ yytestcase(yyruleno==217);
case 222: /* eidlist_opt ::= */ yytestcase(yyruleno==222);
-{yymsp[1].minor.yy420 = 0;}
+{yymsp[1].minor.yy42 = 0;}
break;
case 95: /* selcollist ::= sclp scanpt expr scanpt as */
{
- yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy420, yymsp[-2].minor.yy18);
- if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy420, &yymsp[0].minor.yy0, 1);
- sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy420,yymsp[-3].minor.yy392,yymsp[-1].minor.yy392);
+ yymsp[-4].minor.yy42 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy42, yymsp[-2].minor.yy490);
+ if( yymsp[0].minor.yy0.n>0 ) sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy42, &yymsp[0].minor.yy0, 1);
+ sqlite3ExprListSetSpan(pParse,yymsp[-4].minor.yy42,yymsp[-3].minor.yy464,yymsp[-1].minor.yy464);
}
break;
case 96: /* selcollist ::= sclp scanpt STAR */
{
Expr *p = sqlite3Expr(pParse->db, TK_ASTERISK, 0);
- yymsp[-2].minor.yy420 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy420, p);
+ yymsp[-2].minor.yy42 = sqlite3ExprListAppend(pParse, yymsp[-2].minor.yy42, p);
}
break;
case 97: /* selcollist ::= sclp scanpt nm DOT STAR */
@@ -149938,70 +150817,76 @@ static YYACTIONTYPE yy_reduce(
Expr *pRight = sqlite3PExpr(pParse, TK_ASTERISK, 0, 0);
Expr *pLeft = sqlite3ExprAlloc(pParse->db, TK_ID, &yymsp[-2].minor.yy0, 1);
Expr *pDot = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
- yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy420, pDot);
+ yymsp[-4].minor.yy42 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy42, pDot);
}
break;
case 98: /* as ::= AS nm */
case 109: /* dbnm ::= DOT nm */ yytestcase(yyruleno==109);
- case 236: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==236);
- case 237: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==237);
+ case 238: /* plus_num ::= PLUS INTEGER|FLOAT */ yytestcase(yyruleno==238);
+ case 239: /* minus_num ::= MINUS INTEGER|FLOAT */ yytestcase(yyruleno==239);
{yymsp[-1].minor.yy0 = yymsp[0].minor.yy0;}
break;
case 100: /* from ::= */
-{yymsp[1].minor.yy135 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy135));}
+{yymsp[1].minor.yy167 = sqlite3DbMallocZero(pParse->db, sizeof(*yymsp[1].minor.yy167));}
break;
case 101: /* from ::= FROM seltablist */
{
- yymsp[-1].minor.yy135 = yymsp[0].minor.yy135;
- sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy135);
+ yymsp[-1].minor.yy167 = yymsp[0].minor.yy167;
+ sqlite3SrcListShiftJoinType(yymsp[-1].minor.yy167);
}
break;
case 102: /* stl_prefix ::= seltablist joinop */
{
- if( ALWAYS(yymsp[-1].minor.yy135 && yymsp[-1].minor.yy135->nSrc>0) ) yymsp[-1].minor.yy135->a[yymsp[-1].minor.yy135->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy70;
+ if( ALWAYS(yymsp[-1].minor.yy167 && yymsp[-1].minor.yy167->nSrc>0) ) yymsp[-1].minor.yy167->a[yymsp[-1].minor.yy167->nSrc-1].fg.jointype = (u8)yymsp[0].minor.yy96;
}
break;
case 103: /* stl_prefix ::= */
-{yymsp[1].minor.yy135 = 0;}
+{yymsp[1].minor.yy167 = 0;}
break;
case 104: /* seltablist ::= stl_prefix nm dbnm as indexed_opt on_opt using_opt */
{
- yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy18,yymsp[0].minor.yy48);
- sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy135, &yymsp[-2].minor.yy0);
+ yymsp[-6].minor.yy167 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy167,&yymsp[-5].minor.yy0,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,0,yymsp[-1].minor.yy490,yymsp[0].minor.yy336);
+ sqlite3SrcListIndexedBy(pParse, yymsp[-6].minor.yy167, &yymsp[-2].minor.yy0);
}
break;
case 105: /* seltablist ::= stl_prefix nm dbnm LP exprlist RP as on_opt using_opt */
{
- yymsp[-8].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy135,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy18,yymsp[0].minor.yy48);
- sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy135, yymsp[-4].minor.yy420);
+ yymsp[-8].minor.yy167 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-8].minor.yy167,&yymsp[-7].minor.yy0,&yymsp[-6].minor.yy0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy490,yymsp[0].minor.yy336);
+ sqlite3SrcListFuncArgs(pParse, yymsp[-8].minor.yy167, yymsp[-4].minor.yy42);
}
break;
case 106: /* seltablist ::= stl_prefix LP select RP as on_opt using_opt */
{
- yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy489,yymsp[-1].minor.yy18,yymsp[0].minor.yy48);
+ yymsp[-6].minor.yy167 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy167,0,0,&yymsp[-2].minor.yy0,yymsp[-4].minor.yy423,yymsp[-1].minor.yy490,yymsp[0].minor.yy336);
}
break;
case 107: /* seltablist ::= stl_prefix LP seltablist RP as on_opt using_opt */
{
- if( yymsp[-6].minor.yy135==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy18==0 && yymsp[0].minor.yy48==0 ){
- yymsp[-6].minor.yy135 = yymsp[-4].minor.yy135;
- }else if( yymsp[-4].minor.yy135->nSrc==1 ){
- yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy18,yymsp[0].minor.yy48);
- if( yymsp[-6].minor.yy135 ){
- struct SrcList_item *pNew = &yymsp[-6].minor.yy135->a[yymsp[-6].minor.yy135->nSrc-1];
- struct SrcList_item *pOld = yymsp[-4].minor.yy135->a;
+ if( yymsp[-6].minor.yy167==0 && yymsp[-2].minor.yy0.n==0 && yymsp[-1].minor.yy490==0 && yymsp[0].minor.yy336==0 ){
+ yymsp[-6].minor.yy167 = yymsp[-4].minor.yy167;
+ }else if( yymsp[-4].minor.yy167->nSrc==1 ){
+ yymsp[-6].minor.yy167 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy167,0,0,&yymsp[-2].minor.yy0,0,yymsp[-1].minor.yy490,yymsp[0].minor.yy336);
+ if( yymsp[-6].minor.yy167 ){
+ struct SrcList_item *pNew = &yymsp[-6].minor.yy167->a[yymsp[-6].minor.yy167->nSrc-1];
+ struct SrcList_item *pOld = yymsp[-4].minor.yy167->a;
pNew->zName = pOld->zName;
pNew->zDatabase = pOld->zDatabase;
pNew->pSelect = pOld->pSelect;
+ if( pOld->fg.isTabFunc ){
+ pNew->u1.pFuncArg = pOld->u1.pFuncArg;
+ pOld->u1.pFuncArg = 0;
+ pOld->fg.isTabFunc = 0;
+ pNew->fg.isTabFunc = 1;
+ }
pOld->zName = pOld->zDatabase = 0;
pOld->pSelect = 0;
}
- sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy135);
+ sqlite3SrcListDelete(pParse->db, yymsp[-4].minor.yy167);
}else{
Select *pSubquery;
- sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy135);
- pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy135,0,0,0,0,SF_NestedFrom,0);
- yymsp[-6].minor.yy135 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy135,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy18,yymsp[0].minor.yy48);
+ sqlite3SrcListShiftJoinType(yymsp[-4].minor.yy167);
+ pSubquery = sqlite3SelectNew(pParse,0,yymsp[-4].minor.yy167,0,0,0,0,SF_NestedFrom,0);
+ yymsp[-6].minor.yy167 = sqlite3SrcListAppendFromTerm(pParse,yymsp[-6].minor.yy167,0,0,&yymsp[-2].minor.yy0,pSubquery,yymsp[-1].minor.yy490,yymsp[0].minor.yy336);
}
}
break;
@@ -150011,53 +150896,54 @@ static YYACTIONTYPE yy_reduce(
break;
case 110: /* fullname ::= nm */
{
- yylhsminor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[0].minor.yy0,0);
- if( IN_RENAME_OBJECT && yylhsminor.yy135 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy135->a[0].zName, &yymsp[0].minor.yy0);
+ yylhsminor.yy167 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0);
+ if( IN_RENAME_OBJECT && yylhsminor.yy167 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy167->a[0].zName, &yymsp[0].minor.yy0);
}
- yymsp[0].minor.yy135 = yylhsminor.yy135;
+ yymsp[0].minor.yy167 = yylhsminor.yy167;
break;
case 111: /* fullname ::= nm DOT nm */
{
- yylhsminor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
- if( IN_RENAME_OBJECT && yylhsminor.yy135 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy135->a[0].zName, &yymsp[0].minor.yy0);
+ yylhsminor.yy167 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0);
+ if( IN_RENAME_OBJECT && yylhsminor.yy167 ) sqlite3RenameTokenMap(pParse, yylhsminor.yy167->a[0].zName, &yymsp[0].minor.yy0);
}
- yymsp[-2].minor.yy135 = yylhsminor.yy135;
+ yymsp[-2].minor.yy167 = yylhsminor.yy167;
break;
case 112: /* xfullname ::= nm */
-{yymsp[0].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
+{yymsp[0].minor.yy167 = sqlite3SrcListAppend(pParse,0,&yymsp[0].minor.yy0,0); /*A-overwrites-X*/}
break;
case 113: /* xfullname ::= nm DOT nm */
-{yymsp[-2].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
+{yymsp[-2].minor.yy167 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 114: /* xfullname ::= nm DOT nm AS nm */
{
- yymsp[-4].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
- if( yymsp[-4].minor.yy135 ) yymsp[-4].minor.yy135->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
+ yymsp[-4].minor.yy167 = sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,&yymsp[-2].minor.yy0); /*A-overwrites-X*/
+ if( yymsp[-4].minor.yy167 ) yymsp[-4].minor.yy167->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
}
break;
case 115: /* xfullname ::= nm AS nm */
{
- yymsp[-2].minor.yy135 = sqlite3SrcListAppend(pParse->db,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
- if( yymsp[-2].minor.yy135 ) yymsp[-2].minor.yy135->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
+ yymsp[-2].minor.yy167 = sqlite3SrcListAppend(pParse,0,&yymsp[-2].minor.yy0,0); /*A-overwrites-X*/
+ if( yymsp[-2].minor.yy167 ) yymsp[-2].minor.yy167->a[0].zAlias = sqlite3NameFromToken(pParse->db, &yymsp[0].minor.yy0);
}
break;
case 116: /* joinop ::= COMMA|JOIN */
-{ yymsp[0].minor.yy70 = JT_INNER; }
+{ yymsp[0].minor.yy96 = JT_INNER; }
break;
case 117: /* joinop ::= JOIN_KW JOIN */
-{yymsp[-1].minor.yy70 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
+{yymsp[-1].minor.yy96 = sqlite3JoinType(pParse,&yymsp[-1].minor.yy0,0,0); /*X-overwrites-A*/}
break;
case 118: /* joinop ::= JOIN_KW nm JOIN */
-{yymsp[-2].minor.yy70 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
+{yymsp[-2].minor.yy96 = sqlite3JoinType(pParse,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0,0); /*X-overwrites-A*/}
break;
case 119: /* joinop ::= JOIN_KW nm nm JOIN */
-{yymsp[-3].minor.yy70 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
+{yymsp[-3].minor.yy96 = sqlite3JoinType(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);/*X-overwrites-A*/}
break;
case 120: /* on_opt ::= ON expr */
case 137: /* having_opt ::= HAVING expr */ yytestcase(yyruleno==137);
case 144: /* where_opt ::= WHERE expr */ yytestcase(yyruleno==144);
case 210: /* case_else ::= ELSE expr */ yytestcase(yyruleno==210);
-{yymsp[-1].minor.yy18 = yymsp[0].minor.yy18;}
+ case 231: /* vinto ::= INTO expr */ yytestcase(yyruleno==231);
+{yymsp[-1].minor.yy490 = yymsp[0].minor.yy490;}
break;
case 121: /* on_opt ::= */
case 136: /* having_opt ::= */ yytestcase(yyruleno==136);
@@ -150065,7 +150951,8 @@ static YYACTIONTYPE yy_reduce(
case 143: /* where_opt ::= */ yytestcase(yyruleno==143);
case 211: /* case_else ::= */ yytestcase(yyruleno==211);
case 213: /* case_operand ::= */ yytestcase(yyruleno==213);
-{yymsp[1].minor.yy18 = 0;}
+ case 232: /* vinto ::= */ yytestcase(yyruleno==232);
+{yymsp[1].minor.yy490 = 0;}
break;
case 123: /* indexed_opt ::= INDEXED BY nm */
{yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;}
@@ -150074,119 +150961,119 @@ static YYACTIONTYPE yy_reduce(
{yymsp[-1].minor.yy0.z=0; yymsp[-1].minor.yy0.n=1;}
break;
case 125: /* using_opt ::= USING LP idlist RP */
-{yymsp[-3].minor.yy48 = yymsp[-1].minor.yy48;}
+{yymsp[-3].minor.yy336 = yymsp[-1].minor.yy336;}
break;
case 126: /* using_opt ::= */
case 158: /* idlist_opt ::= */ yytestcase(yyruleno==158);
-{yymsp[1].minor.yy48 = 0;}
+{yymsp[1].minor.yy336 = 0;}
break;
case 128: /* orderby_opt ::= ORDER BY sortlist */
case 135: /* groupby_opt ::= GROUP BY nexprlist */ yytestcase(yyruleno==135);
-{yymsp[-2].minor.yy420 = yymsp[0].minor.yy420;}
+{yymsp[-2].minor.yy42 = yymsp[0].minor.yy42;}
break;
case 129: /* sortlist ::= sortlist COMMA expr sortorder */
{
- yymsp[-3].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy420,yymsp[-1].minor.yy18);
- sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy420,yymsp[0].minor.yy70);
+ yymsp[-3].minor.yy42 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy42,yymsp[-1].minor.yy490);
+ sqlite3ExprListSetSortOrder(yymsp[-3].minor.yy42,yymsp[0].minor.yy96);
}
break;
case 130: /* sortlist ::= expr sortorder */
{
- yymsp[-1].minor.yy420 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy18); /*A-overwrites-Y*/
- sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy420,yymsp[0].minor.yy70);
+ yymsp[-1].minor.yy42 = sqlite3ExprListAppend(pParse,0,yymsp[-1].minor.yy490); /*A-overwrites-Y*/
+ sqlite3ExprListSetSortOrder(yymsp[-1].minor.yy42,yymsp[0].minor.yy96);
}
break;
case 131: /* sortorder ::= ASC */
-{yymsp[0].minor.yy70 = SQLITE_SO_ASC;}
+{yymsp[0].minor.yy96 = SQLITE_SO_ASC;}
break;
case 132: /* sortorder ::= DESC */
-{yymsp[0].minor.yy70 = SQLITE_SO_DESC;}
+{yymsp[0].minor.yy96 = SQLITE_SO_DESC;}
break;
case 133: /* sortorder ::= */
-{yymsp[1].minor.yy70 = SQLITE_SO_UNDEFINED;}
+{yymsp[1].minor.yy96 = SQLITE_SO_UNDEFINED;}
break;
case 139: /* limit_opt ::= LIMIT expr */
-{yymsp[-1].minor.yy18 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy18,0);}
+{yymsp[-1].minor.yy490 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy490,0);}
break;
case 140: /* limit_opt ::= LIMIT expr OFFSET expr */
-{yymsp[-3].minor.yy18 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy18,yymsp[0].minor.yy18);}
+{yymsp[-3].minor.yy490 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[-2].minor.yy490,yymsp[0].minor.yy490);}
break;
case 141: /* limit_opt ::= LIMIT expr COMMA expr */
-{yymsp[-3].minor.yy18 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy18,yymsp[-2].minor.yy18);}
+{yymsp[-3].minor.yy490 = sqlite3PExpr(pParse,TK_LIMIT,yymsp[0].minor.yy490,yymsp[-2].minor.yy490);}
break;
case 142: /* cmd ::= with DELETE FROM xfullname indexed_opt where_opt */
{
- sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy135, &yymsp[-1].minor.yy0);
- sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy135,yymsp[0].minor.yy18,0,0);
+ sqlite3SrcListIndexedBy(pParse, yymsp[-2].minor.yy167, &yymsp[-1].minor.yy0);
+ sqlite3DeleteFrom(pParse,yymsp[-2].minor.yy167,yymsp[0].minor.yy490,0,0);
}
break;
case 145: /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist where_opt */
{
- sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy135, &yymsp[-3].minor.yy0);
- sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy420,"set list");
- sqlite3Update(pParse,yymsp[-4].minor.yy135,yymsp[-1].minor.yy420,yymsp[0].minor.yy18,yymsp[-5].minor.yy70,0,0,0);
+ sqlite3SrcListIndexedBy(pParse, yymsp[-4].minor.yy167, &yymsp[-3].minor.yy0);
+ sqlite3ExprListCheckLength(pParse,yymsp[-1].minor.yy42,"set list");
+ sqlite3Update(pParse,yymsp[-4].minor.yy167,yymsp[-1].minor.yy42,yymsp[0].minor.yy490,yymsp[-5].minor.yy96,0,0,0);
}
break;
case 146: /* setlist ::= setlist COMMA nm EQ expr */
{
- yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy420, yymsp[0].minor.yy18);
- sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy420, &yymsp[-2].minor.yy0, 1);
+ yymsp[-4].minor.yy42 = sqlite3ExprListAppend(pParse, yymsp[-4].minor.yy42, yymsp[0].minor.yy490);
+ sqlite3ExprListSetName(pParse, yymsp[-4].minor.yy42, &yymsp[-2].minor.yy0, 1);
}
break;
case 147: /* setlist ::= setlist COMMA LP idlist RP EQ expr */
{
- yymsp[-6].minor.yy420 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy420, yymsp[-3].minor.yy48, yymsp[0].minor.yy18);
+ yymsp[-6].minor.yy42 = sqlite3ExprListAppendVector(pParse, yymsp[-6].minor.yy42, yymsp[-3].minor.yy336, yymsp[0].minor.yy490);
}
break;
case 148: /* setlist ::= nm EQ expr */
{
- yylhsminor.yy420 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy18);
- sqlite3ExprListSetName(pParse, yylhsminor.yy420, &yymsp[-2].minor.yy0, 1);
+ yylhsminor.yy42 = sqlite3ExprListAppend(pParse, 0, yymsp[0].minor.yy490);
+ sqlite3ExprListSetName(pParse, yylhsminor.yy42, &yymsp[-2].minor.yy0, 1);
}
- yymsp[-2].minor.yy420 = yylhsminor.yy420;
+ yymsp[-2].minor.yy42 = yylhsminor.yy42;
break;
case 149: /* setlist ::= LP idlist RP EQ expr */
{
- yymsp[-4].minor.yy420 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy48, yymsp[0].minor.yy18);
+ yymsp[-4].minor.yy42 = sqlite3ExprListAppendVector(pParse, 0, yymsp[-3].minor.yy336, yymsp[0].minor.yy490);
}
break;
case 150: /* cmd ::= with insert_cmd INTO xfullname idlist_opt select upsert */
{
- sqlite3Insert(pParse, yymsp[-3].minor.yy135, yymsp[-1].minor.yy489, yymsp[-2].minor.yy48, yymsp[-5].minor.yy70, yymsp[0].minor.yy340);
+ sqlite3Insert(pParse, yymsp[-3].minor.yy167, yymsp[-1].minor.yy423, yymsp[-2].minor.yy336, yymsp[-5].minor.yy96, yymsp[0].minor.yy266);
}
break;
case 151: /* cmd ::= with insert_cmd INTO xfullname idlist_opt DEFAULT VALUES */
{
- sqlite3Insert(pParse, yymsp[-3].minor.yy135, 0, yymsp[-2].minor.yy48, yymsp[-5].minor.yy70, 0);
+ sqlite3Insert(pParse, yymsp[-3].minor.yy167, 0, yymsp[-2].minor.yy336, yymsp[-5].minor.yy96, 0);
}
break;
case 152: /* upsert ::= */
-{ yymsp[1].minor.yy340 = 0; }
+{ yymsp[1].minor.yy266 = 0; }
break;
case 153: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO UPDATE SET setlist where_opt */
-{ yymsp[-10].minor.yy340 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy420,yymsp[-5].minor.yy18,yymsp[-1].minor.yy420,yymsp[0].minor.yy18);}
+{ yymsp[-10].minor.yy266 = sqlite3UpsertNew(pParse->db,yymsp[-7].minor.yy42,yymsp[-5].minor.yy490,yymsp[-1].minor.yy42,yymsp[0].minor.yy490);}
break;
case 154: /* upsert ::= ON CONFLICT LP sortlist RP where_opt DO NOTHING */
-{ yymsp[-7].minor.yy340 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy420,yymsp[-2].minor.yy18,0,0); }
+{ yymsp[-7].minor.yy266 = sqlite3UpsertNew(pParse->db,yymsp[-4].minor.yy42,yymsp[-2].minor.yy490,0,0); }
break;
case 155: /* upsert ::= ON CONFLICT DO NOTHING */
-{ yymsp[-3].minor.yy340 = sqlite3UpsertNew(pParse->db,0,0,0,0); }
+{ yymsp[-3].minor.yy266 = sqlite3UpsertNew(pParse->db,0,0,0,0); }
break;
case 159: /* idlist_opt ::= LP idlist RP */
-{yymsp[-2].minor.yy48 = yymsp[-1].minor.yy48;}
+{yymsp[-2].minor.yy336 = yymsp[-1].minor.yy336;}
break;
case 160: /* idlist ::= idlist COMMA nm */
-{yymsp[-2].minor.yy48 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy48,&yymsp[0].minor.yy0);}
+{yymsp[-2].minor.yy336 = sqlite3IdListAppend(pParse,yymsp[-2].minor.yy336,&yymsp[0].minor.yy0);}
break;
case 161: /* idlist ::= nm */
-{yymsp[0].minor.yy48 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
+{yymsp[0].minor.yy336 = sqlite3IdListAppend(pParse,0,&yymsp[0].minor.yy0); /*A-overwrites-Y*/}
break;
case 162: /* expr ::= LP expr RP */
-{yymsp[-2].minor.yy18 = yymsp[-1].minor.yy18;}
+{yymsp[-2].minor.yy490 = yymsp[-1].minor.yy490;}
break;
case 163: /* expr ::= ID|INDEXED */
case 164: /* expr ::= JOIN_KW */ yytestcase(yyruleno==164);
-{yymsp[0].minor.yy18=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
+{yymsp[0].minor.yy490=tokenExpr(pParse,TK_ID,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 165: /* expr ::= nm DOT nm */
{
@@ -150196,9 +151083,9 @@ static YYACTIONTYPE yy_reduce(
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[0].minor.yy0);
sqlite3RenameTokenMap(pParse, (void*)temp1, &yymsp[-2].minor.yy0);
}
- yylhsminor.yy18 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
+ yylhsminor.yy490 = sqlite3PExpr(pParse, TK_DOT, temp1, temp2);
}
- yymsp[-2].minor.yy18 = yylhsminor.yy18;
+ yymsp[-2].minor.yy490 = yylhsminor.yy490;
break;
case 166: /* expr ::= nm DOT nm DOT nm */
{
@@ -150210,26 +151097,26 @@ static YYACTIONTYPE yy_reduce(
sqlite3RenameTokenMap(pParse, (void*)temp3, &yymsp[0].minor.yy0);
sqlite3RenameTokenMap(pParse, (void*)temp2, &yymsp[-2].minor.yy0);
}
- yylhsminor.yy18 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
+ yylhsminor.yy490 = sqlite3PExpr(pParse, TK_DOT, temp1, temp4);
}
- yymsp[-4].minor.yy18 = yylhsminor.yy18;
+ yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 167: /* term ::= NULL|FLOAT|BLOB */
case 168: /* term ::= STRING */ yytestcase(yyruleno==168);
-{yymsp[0].minor.yy18=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
+{yymsp[0].minor.yy490=tokenExpr(pParse,yymsp[0].major,yymsp[0].minor.yy0); /*A-overwrites-X*/}
break;
case 169: /* term ::= INTEGER */
{
- yylhsminor.yy18 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
+ yylhsminor.yy490 = sqlite3ExprAlloc(pParse->db, TK_INTEGER, &yymsp[0].minor.yy0, 1);
}
- yymsp[0].minor.yy18 = yylhsminor.yy18;
+ yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 170: /* expr ::= VARIABLE */
{
if( !(yymsp[0].minor.yy0.z[0]=='#' && sqlite3Isdigit(yymsp[0].minor.yy0.z[1])) ){
u32 n = yymsp[0].minor.yy0.n;
- yymsp[0].minor.yy18 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
- sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy18, n);
+ yymsp[0].minor.yy490 = tokenExpr(pParse, TK_VARIABLE, yymsp[0].minor.yy0);
+ sqlite3ExprAssignVarNumber(pParse, yymsp[0].minor.yy490, n);
}else{
/* When doing a nested parse, one can include terms in an expression
** that look like this: #1 #2 ... These terms refer to registers
@@ -150238,63 +151125,63 @@ static YYACTIONTYPE yy_reduce(
assert( t.n>=2 );
if( pParse->nested==0 ){
sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &t);
- yymsp[0].minor.yy18 = 0;
+ yymsp[0].minor.yy490 = 0;
}else{
- yymsp[0].minor.yy18 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
- if( yymsp[0].minor.yy18 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy18->iTable);
+ yymsp[0].minor.yy490 = sqlite3PExpr(pParse, TK_REGISTER, 0, 0);
+ if( yymsp[0].minor.yy490 ) sqlite3GetInt32(&t.z[1], &yymsp[0].minor.yy490->iTable);
}
}
}
break;
case 171: /* expr ::= expr COLLATE ID|STRING */
{
- yymsp[-2].minor.yy18 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy18, &yymsp[0].minor.yy0, 1);
+ yymsp[-2].minor.yy490 = sqlite3ExprAddCollateToken(pParse, yymsp[-2].minor.yy490, &yymsp[0].minor.yy0, 1);
}
break;
case 172: /* expr ::= CAST LP expr AS typetoken RP */
{
- yymsp[-5].minor.yy18 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
- sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy18, yymsp[-3].minor.yy18, 0);
+ yymsp[-5].minor.yy490 = sqlite3ExprAlloc(pParse->db, TK_CAST, &yymsp[-1].minor.yy0, 1);
+ sqlite3ExprAttachSubtrees(pParse->db, yymsp[-5].minor.yy490, yymsp[-3].minor.yy490, 0);
}
break;
case 173: /* expr ::= ID|INDEXED LP distinct exprlist RP */
{
- yylhsminor.yy18 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy420, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy70);
+ yylhsminor.yy490 = sqlite3ExprFunction(pParse, yymsp[-1].minor.yy42, &yymsp[-4].minor.yy0, yymsp[-2].minor.yy96);
}
- yymsp[-4].minor.yy18 = yylhsminor.yy18;
+ yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 174: /* expr ::= ID|INDEXED LP STAR RP */
{
- yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
+ yylhsminor.yy490 = sqlite3ExprFunction(pParse, 0, &yymsp[-3].minor.yy0, 0);
}
- yymsp[-3].minor.yy18 = yylhsminor.yy18;
+ yymsp[-3].minor.yy490 = yylhsminor.yy490;
break;
case 175: /* expr ::= ID|INDEXED LP distinct exprlist RP over_clause */
{
- yylhsminor.yy18 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy420, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy70);
- sqlite3WindowAttach(pParse, yylhsminor.yy18, yymsp[0].minor.yy327);
+ yylhsminor.yy490 = sqlite3ExprFunction(pParse, yymsp[-2].minor.yy42, &yymsp[-5].minor.yy0, yymsp[-3].minor.yy96);
+ sqlite3WindowAttach(pParse, yylhsminor.yy490, yymsp[0].minor.yy147);
}
- yymsp[-5].minor.yy18 = yylhsminor.yy18;
+ yymsp[-5].minor.yy490 = yylhsminor.yy490;
break;
case 176: /* expr ::= ID|INDEXED LP STAR RP over_clause */
{
- yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
- sqlite3WindowAttach(pParse, yylhsminor.yy18, yymsp[0].minor.yy327);
+ yylhsminor.yy490 = sqlite3ExprFunction(pParse, 0, &yymsp[-4].minor.yy0, 0);
+ sqlite3WindowAttach(pParse, yylhsminor.yy490, yymsp[0].minor.yy147);
}
- yymsp[-4].minor.yy18 = yylhsminor.yy18;
+ yymsp[-4].minor.yy490 = yylhsminor.yy490;
break;
case 177: /* term ::= CTIME_KW */
{
- yylhsminor.yy18 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
+ yylhsminor.yy490 = sqlite3ExprFunction(pParse, 0, &yymsp[0].minor.yy0, 0);
}
- yymsp[0].minor.yy18 = yylhsminor.yy18;
+ yymsp[0].minor.yy490 = yylhsminor.yy490;
break;
case 178: /* expr ::= LP nexprlist COMMA expr RP */
{
- ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy420, yymsp[-1].minor.yy18);
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
- if( yymsp[-4].minor.yy18 ){
- yymsp[-4].minor.yy18->x.pList = pList;
+ ExprList *pList = sqlite3ExprListAppend(pParse, yymsp[-3].minor.yy42, yymsp[-1].minor.yy490);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);
+ if( yymsp[-4].minor.yy490 ){
+ yymsp[-4].minor.yy490->x.pList = pList;
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
@@ -150308,7 +151195,7 @@ static YYACTIONTYPE yy_reduce(
case 184: /* expr ::= expr PLUS|MINUS expr */ yytestcase(yyruleno==184);
case 185: /* expr ::= expr STAR|SLASH|REM expr */ yytestcase(yyruleno==185);
case 186: /* expr ::= expr CONCAT expr */ yytestcase(yyruleno==186);
-{yymsp[-2].minor.yy18=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy18,yymsp[0].minor.yy18);}
+{yymsp[-2].minor.yy490=sqlite3PExpr(pParse,yymsp[-1].major,yymsp[-2].minor.yy490,yymsp[0].minor.yy490);}
break;
case 187: /* likeop ::= NOT LIKE_KW|MATCH */
{yymsp[-1].minor.yy0=yymsp[0].minor.yy0; yymsp[-1].minor.yy0.n|=0x80000000; /*yymsp[-1].minor.yy0-overwrite-yymsp[0].minor.yy0*/}
@@ -150318,11 +151205,11 @@ static YYACTIONTYPE yy_reduce(
ExprList *pList;
int bNot = yymsp[-1].minor.yy0.n & 0x80000000;
yymsp[-1].minor.yy0.n &= 0x7fffffff;
- pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy18);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy18);
- yymsp[-2].minor.yy18 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
- if( bNot ) yymsp[-2].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy18, 0);
- if( yymsp[-2].minor.yy18 ) yymsp[-2].minor.yy18->flags |= EP_InfixFunc;
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[0].minor.yy490);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-2].minor.yy490);
+ yymsp[-2].minor.yy490 = sqlite3ExprFunction(pParse, pList, &yymsp[-1].minor.yy0, 0);
+ if( bNot ) yymsp[-2].minor.yy490 = sqlite3PExpr(pParse, TK_NOT, yymsp[-2].minor.yy490, 0);
+ if( yymsp[-2].minor.yy490 ) yymsp[-2].minor.yy490->flags |= EP_InfixFunc;
}
break;
case 189: /* expr ::= expr likeop expr ESCAPE expr */
@@ -150330,62 +151217,62 @@ static YYACTIONTYPE yy_reduce(
ExprList *pList;
int bNot = yymsp[-3].minor.yy0.n & 0x80000000;
yymsp[-3].minor.yy0.n &= 0x7fffffff;
- pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy18);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy18);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy18);
- yymsp[-4].minor.yy18 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
- if( bNot ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0);
- if( yymsp[-4].minor.yy18 ) yymsp[-4].minor.yy18->flags |= EP_InfixFunc;
+ pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy490);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[-4].minor.yy490);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy490);
+ yymsp[-4].minor.yy490 = sqlite3ExprFunction(pParse, pList, &yymsp[-3].minor.yy0, 0);
+ if( bNot ) yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy490, 0);
+ if( yymsp[-4].minor.yy490 ) yymsp[-4].minor.yy490->flags |= EP_InfixFunc;
}
break;
case 190: /* expr ::= expr ISNULL|NOTNULL */
-{yymsp[-1].minor.yy18 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy18,0);}
+{yymsp[-1].minor.yy490 = sqlite3PExpr(pParse,yymsp[0].major,yymsp[-1].minor.yy490,0);}
break;
case 191: /* expr ::= expr NOT NULL */
-{yymsp[-2].minor.yy18 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy18,0);}
+{yymsp[-2].minor.yy490 = sqlite3PExpr(pParse,TK_NOTNULL,yymsp[-2].minor.yy490,0);}
break;
case 192: /* expr ::= expr IS expr */
{
- yymsp[-2].minor.yy18 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy18,yymsp[0].minor.yy18);
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy18, yymsp[-2].minor.yy18, TK_ISNULL);
+ yymsp[-2].minor.yy490 = sqlite3PExpr(pParse,TK_IS,yymsp[-2].minor.yy490,yymsp[0].minor.yy490);
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy490, yymsp[-2].minor.yy490, TK_ISNULL);
}
break;
case 193: /* expr ::= expr IS NOT expr */
{
- yymsp[-3].minor.yy18 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy18,yymsp[0].minor.yy18);
- binaryToUnaryIfNull(pParse, yymsp[0].minor.yy18, yymsp[-3].minor.yy18, TK_NOTNULL);
+ yymsp[-3].minor.yy490 = sqlite3PExpr(pParse,TK_ISNOT,yymsp[-3].minor.yy490,yymsp[0].minor.yy490);
+ binaryToUnaryIfNull(pParse, yymsp[0].minor.yy490, yymsp[-3].minor.yy490, TK_NOTNULL);
}
break;
case 194: /* expr ::= NOT expr */
case 195: /* expr ::= BITNOT expr */ yytestcase(yyruleno==195);
-{yymsp[-1].minor.yy18 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy18, 0);/*A-overwrites-B*/}
+{yymsp[-1].minor.yy490 = sqlite3PExpr(pParse, yymsp[-1].major, yymsp[0].minor.yy490, 0);/*A-overwrites-B*/}
break;
case 196: /* expr ::= PLUS|MINUS expr */
{
- yymsp[-1].minor.yy18 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy18, 0);
+ yymsp[-1].minor.yy490 = sqlite3PExpr(pParse, yymsp[-1].major==TK_PLUS ? TK_UPLUS : TK_UMINUS, yymsp[0].minor.yy490, 0);
/*A-overwrites-B*/
}
break;
case 197: /* between_op ::= BETWEEN */
case 200: /* in_op ::= IN */ yytestcase(yyruleno==200);
-{yymsp[0].minor.yy70 = 0;}
+{yymsp[0].minor.yy96 = 0;}
break;
case 199: /* expr ::= expr between_op expr AND expr */
{
- ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy18);
- pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy18);
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy18, 0);
- if( yymsp[-4].minor.yy18 ){
- yymsp[-4].minor.yy18->x.pList = pList;
+ ExprList *pList = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy490);
+ pList = sqlite3ExprListAppend(pParse,pList, yymsp[0].minor.yy490);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_BETWEEN, yymsp[-4].minor.yy490, 0);
+ if( yymsp[-4].minor.yy490 ){
+ yymsp[-4].minor.yy490->x.pList = pList;
}else{
sqlite3ExprListDelete(pParse->db, pList);
}
- if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0);
+ if( yymsp[-3].minor.yy96 ) yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy490, 0);
}
break;
case 202: /* expr ::= expr in_op LP exprlist RP */
{
- if( yymsp[-1].minor.yy420==0 ){
+ if( yymsp[-1].minor.yy42==0 ){
/* Expressions of the form
**
** expr1 IN ()
@@ -150394,9 +151281,11 @@ static YYACTIONTYPE yy_reduce(
** simplify to constants 0 (false) and 1 (true), respectively,
** regardless of the value of expr1.
*/
- sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy18);
- yymsp[-4].minor.yy18 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy70],1);
- }else if( yymsp[-1].minor.yy420->nExpr==1 ){
+ if( IN_RENAME_OBJECT==0 ){
+ sqlite3ExprDelete(pParse->db, yymsp[-4].minor.yy490);
+ yymsp[-4].minor.yy490 = sqlite3ExprAlloc(pParse->db, TK_INTEGER,&sqlite3IntTokens[yymsp[-3].minor.yy96],1);
+ }
+ }else if( yymsp[-1].minor.yy42->nExpr==1 ){
/* Expressions of the form:
**
** expr1 IN (?1)
@@ -150413,199 +151302,199 @@ static YYACTIONTYPE yy_reduce(
** affinity or the collating sequence to use for comparison. Otherwise,
** the semantics would be subtly different from IN or NOT IN.
*/
- Expr *pRHS = yymsp[-1].minor.yy420->a[0].pExpr;
- yymsp[-1].minor.yy420->a[0].pExpr = 0;
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy420);
+ Expr *pRHS = yymsp[-1].minor.yy42->a[0].pExpr;
+ yymsp[-1].minor.yy42->a[0].pExpr = 0;
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy42);
/* pRHS cannot be NULL because a malloc error would have been detected
** before now and control would have never reached this point */
if( ALWAYS(pRHS) ){
pRHS->flags &= ~EP_Collate;
pRHS->flags |= EP_Generic;
}
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, yymsp[-3].minor.yy70 ? TK_NE : TK_EQ, yymsp[-4].minor.yy18, pRHS);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, yymsp[-3].minor.yy96 ? TK_NE : TK_EQ, yymsp[-4].minor.yy490, pRHS);
}else{
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy18, 0);
- if( yymsp[-4].minor.yy18 ){
- yymsp[-4].minor.yy18->x.pList = yymsp[-1].minor.yy420;
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy18);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy490, 0);
+ if( yymsp[-4].minor.yy490 ){
+ yymsp[-4].minor.yy490->x.pList = yymsp[-1].minor.yy42;
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy490);
}else{
- sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy420);
+ sqlite3ExprListDelete(pParse->db, yymsp[-1].minor.yy42);
}
- if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0);
+ if( yymsp[-3].minor.yy96 ) yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy490, 0);
}
}
break;
case 203: /* expr ::= LP select RP */
{
- yymsp[-2].minor.yy18 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
- sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy18, yymsp[-1].minor.yy489);
+ yymsp[-2].minor.yy490 = sqlite3PExpr(pParse, TK_SELECT, 0, 0);
+ sqlite3PExprAddSelect(pParse, yymsp[-2].minor.yy490, yymsp[-1].minor.yy423);
}
break;
case 204: /* expr ::= expr in_op LP select RP */
{
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy18, 0);
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy18, yymsp[-1].minor.yy489);
- if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy490, 0);
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy490, yymsp[-1].minor.yy423);
+ if( yymsp[-3].minor.yy96 ) yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy490, 0);
}
break;
case 205: /* expr ::= expr in_op nm dbnm paren_exprlist */
{
- SrcList *pSrc = sqlite3SrcListAppend(pParse->db, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
+ SrcList *pSrc = sqlite3SrcListAppend(pParse, 0,&yymsp[-2].minor.yy0,&yymsp[-1].minor.yy0);
Select *pSelect = sqlite3SelectNew(pParse, 0,pSrc,0,0,0,0,0,0);
- if( yymsp[0].minor.yy420 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy420);
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy18, 0);
- sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy18, pSelect);
- if( yymsp[-3].minor.yy70 ) yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy18, 0);
+ if( yymsp[0].minor.yy42 ) sqlite3SrcListFuncArgs(pParse, pSelect ? pSrc : 0, yymsp[0].minor.yy42);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_IN, yymsp[-4].minor.yy490, 0);
+ sqlite3PExprAddSelect(pParse, yymsp[-4].minor.yy490, pSelect);
+ if( yymsp[-3].minor.yy96 ) yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_NOT, yymsp[-4].minor.yy490, 0);
}
break;
case 206: /* expr ::= EXISTS LP select RP */
{
Expr *p;
- p = yymsp[-3].minor.yy18 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
- sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy489);
+ p = yymsp[-3].minor.yy490 = sqlite3PExpr(pParse, TK_EXISTS, 0, 0);
+ sqlite3PExprAddSelect(pParse, p, yymsp[-1].minor.yy423);
}
break;
case 207: /* expr ::= CASE case_operand case_exprlist case_else END */
{
- yymsp[-4].minor.yy18 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy18, 0);
- if( yymsp[-4].minor.yy18 ){
- yymsp[-4].minor.yy18->x.pList = yymsp[-1].minor.yy18 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy420,yymsp[-1].minor.yy18) : yymsp[-2].minor.yy420;
- sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy18);
+ yymsp[-4].minor.yy490 = sqlite3PExpr(pParse, TK_CASE, yymsp[-3].minor.yy490, 0);
+ if( yymsp[-4].minor.yy490 ){
+ yymsp[-4].minor.yy490->x.pList = yymsp[-1].minor.yy490 ? sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy42,yymsp[-1].minor.yy490) : yymsp[-2].minor.yy42;
+ sqlite3ExprSetHeightAndFlags(pParse, yymsp[-4].minor.yy490);
}else{
- sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy420);
- sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy18);
+ sqlite3ExprListDelete(pParse->db, yymsp[-2].minor.yy42);
+ sqlite3ExprDelete(pParse->db, yymsp[-1].minor.yy490);
}
}
break;
case 208: /* case_exprlist ::= case_exprlist WHEN expr THEN expr */
{
- yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy420, yymsp[-2].minor.yy18);
- yymsp[-4].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy420, yymsp[0].minor.yy18);
+ yymsp[-4].minor.yy42 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy42, yymsp[-2].minor.yy490);
+ yymsp[-4].minor.yy42 = sqlite3ExprListAppend(pParse,yymsp[-4].minor.yy42, yymsp[0].minor.yy490);
}
break;
case 209: /* case_exprlist ::= WHEN expr THEN expr */
{
- yymsp[-3].minor.yy420 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy18);
- yymsp[-3].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy420, yymsp[0].minor.yy18);
+ yymsp[-3].minor.yy42 = sqlite3ExprListAppend(pParse,0, yymsp[-2].minor.yy490);
+ yymsp[-3].minor.yy42 = sqlite3ExprListAppend(pParse,yymsp[-3].minor.yy42, yymsp[0].minor.yy490);
}
break;
case 212: /* case_operand ::= expr */
-{yymsp[0].minor.yy18 = yymsp[0].minor.yy18; /*A-overwrites-X*/}
+{yymsp[0].minor.yy490 = yymsp[0].minor.yy490; /*A-overwrites-X*/}
break;
case 215: /* nexprlist ::= nexprlist COMMA expr */
-{yymsp[-2].minor.yy420 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy420,yymsp[0].minor.yy18);}
+{yymsp[-2].minor.yy42 = sqlite3ExprListAppend(pParse,yymsp[-2].minor.yy42,yymsp[0].minor.yy490);}
break;
case 216: /* nexprlist ::= expr */
-{yymsp[0].minor.yy420 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy18); /*A-overwrites-Y*/}
+{yymsp[0].minor.yy42 = sqlite3ExprListAppend(pParse,0,yymsp[0].minor.yy490); /*A-overwrites-Y*/}
break;
case 218: /* paren_exprlist ::= LP exprlist RP */
case 223: /* eidlist_opt ::= LP eidlist RP */ yytestcase(yyruleno==223);
-{yymsp[-2].minor.yy420 = yymsp[-1].minor.yy420;}
+{yymsp[-2].minor.yy42 = yymsp[-1].minor.yy42;}
break;
case 219: /* cmd ::= createkw uniqueflag INDEX ifnotexists nm dbnm ON nm LP sortlist RP where_opt */
{
sqlite3CreateIndex(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0,
- sqlite3SrcListAppend(pParse->db,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy420, yymsp[-10].minor.yy70,
- &yymsp[-11].minor.yy0, yymsp[0].minor.yy18, SQLITE_SO_ASC, yymsp[-8].minor.yy70, SQLITE_IDXTYPE_APPDEF);
+ sqlite3SrcListAppend(pParse,0,&yymsp[-4].minor.yy0,0), yymsp[-2].minor.yy42, yymsp[-10].minor.yy96,
+ &yymsp[-11].minor.yy0, yymsp[0].minor.yy490, SQLITE_SO_ASC, yymsp[-8].minor.yy96, SQLITE_IDXTYPE_APPDEF);
if( IN_RENAME_OBJECT && pParse->pNewIndex ){
sqlite3RenameTokenMap(pParse, pParse->pNewIndex->zName, &yymsp[-4].minor.yy0);
}
}
break;
case 220: /* uniqueflag ::= UNIQUE */
- case 260: /* raisetype ::= ABORT */ yytestcase(yyruleno==260);
-{yymsp[0].minor.yy70 = OE_Abort;}
+ case 262: /* raisetype ::= ABORT */ yytestcase(yyruleno==262);
+{yymsp[0].minor.yy96 = OE_Abort;}
break;
case 221: /* uniqueflag ::= */
-{yymsp[1].minor.yy70 = OE_None;}
+{yymsp[1].minor.yy96 = OE_None;}
break;
case 224: /* eidlist ::= eidlist COMMA nm collate sortorder */
{
- yymsp[-4].minor.yy420 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy420, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy70, yymsp[0].minor.yy70);
+ yymsp[-4].minor.yy42 = parserAddExprIdListTerm(pParse, yymsp[-4].minor.yy42, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy96, yymsp[0].minor.yy96);
}
break;
case 225: /* eidlist ::= nm collate sortorder */
{
- yymsp[-2].minor.yy420 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy70, yymsp[0].minor.yy70); /*A-overwrites-Y*/
+ yymsp[-2].minor.yy42 = parserAddExprIdListTerm(pParse, 0, &yymsp[-2].minor.yy0, yymsp[-1].minor.yy96, yymsp[0].minor.yy96); /*A-overwrites-Y*/
}
break;
case 228: /* cmd ::= DROP INDEX ifexists fullname */
-{sqlite3DropIndex(pParse, yymsp[0].minor.yy135, yymsp[-1].minor.yy70);}
+{sqlite3DropIndex(pParse, yymsp[0].minor.yy167, yymsp[-1].minor.yy96);}
break;
- case 229: /* cmd ::= VACUUM */
-{sqlite3Vacuum(pParse,0);}
+ case 229: /* cmd ::= VACUUM vinto */
+{sqlite3Vacuum(pParse,0,yymsp[0].minor.yy490);}
break;
- case 230: /* cmd ::= VACUUM nm */
-{sqlite3Vacuum(pParse,&yymsp[0].minor.yy0);}
+ case 230: /* cmd ::= VACUUM nm vinto */
+{sqlite3Vacuum(pParse,&yymsp[-1].minor.yy0,yymsp[0].minor.yy490);}
break;
- case 231: /* cmd ::= PRAGMA nm dbnm */
+ case 233: /* cmd ::= PRAGMA nm dbnm */
{sqlite3Pragma(pParse,&yymsp[-1].minor.yy0,&yymsp[0].minor.yy0,0,0);}
break;
- case 232: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
+ case 234: /* cmd ::= PRAGMA nm dbnm EQ nmnum */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,0);}
break;
- case 233: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
+ case 235: /* cmd ::= PRAGMA nm dbnm LP nmnum RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,0);}
break;
- case 234: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
+ case 236: /* cmd ::= PRAGMA nm dbnm EQ minus_num */
{sqlite3Pragma(pParse,&yymsp[-3].minor.yy0,&yymsp[-2].minor.yy0,&yymsp[0].minor.yy0,1);}
break;
- case 235: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
+ case 237: /* cmd ::= PRAGMA nm dbnm LP minus_num RP */
{sqlite3Pragma(pParse,&yymsp[-4].minor.yy0,&yymsp[-3].minor.yy0,&yymsp[-1].minor.yy0,1);}
break;
- case 238: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
+ case 240: /* cmd ::= createkw trigger_decl BEGIN trigger_cmd_list END */
{
Token all;
all.z = yymsp[-3].minor.yy0.z;
all.n = (int)(yymsp[0].minor.yy0.z - yymsp[-3].minor.yy0.z) + yymsp[0].minor.yy0.n;
- sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy207, &all);
+ sqlite3FinishTrigger(pParse, yymsp[-1].minor.yy119, &all);
}
break;
- case 239: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
+ case 241: /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */
{
- sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy70, yymsp[-4].minor.yy34.a, yymsp[-4].minor.yy34.b, yymsp[-2].minor.yy135, yymsp[0].minor.yy18, yymsp[-10].minor.yy70, yymsp[-8].minor.yy70);
+ sqlite3BeginTrigger(pParse, &yymsp[-7].minor.yy0, &yymsp[-6].minor.yy0, yymsp[-5].minor.yy96, yymsp[-4].minor.yy350.a, yymsp[-4].minor.yy350.b, yymsp[-2].minor.yy167, yymsp[0].minor.yy490, yymsp[-10].minor.yy96, yymsp[-8].minor.yy96);
yymsp[-10].minor.yy0 = (yymsp[-6].minor.yy0.n==0?yymsp[-7].minor.yy0:yymsp[-6].minor.yy0); /*A-overwrites-T*/
}
break;
- case 240: /* trigger_time ::= BEFORE|AFTER */
-{ yymsp[0].minor.yy70 = yymsp[0].major; /*A-overwrites-X*/ }
+ case 242: /* trigger_time ::= BEFORE|AFTER */
+{ yymsp[0].minor.yy96 = yymsp[0].major; /*A-overwrites-X*/ }
break;
- case 241: /* trigger_time ::= INSTEAD OF */
-{ yymsp[-1].minor.yy70 = TK_INSTEAD;}
+ case 243: /* trigger_time ::= INSTEAD OF */
+{ yymsp[-1].minor.yy96 = TK_INSTEAD;}
break;
- case 242: /* trigger_time ::= */
-{ yymsp[1].minor.yy70 = TK_BEFORE; }
+ case 244: /* trigger_time ::= */
+{ yymsp[1].minor.yy96 = TK_BEFORE; }
break;
- case 243: /* trigger_event ::= DELETE|INSERT */
- case 244: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==244);
-{yymsp[0].minor.yy34.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy34.b = 0;}
+ case 245: /* trigger_event ::= DELETE|INSERT */
+ case 246: /* trigger_event ::= UPDATE */ yytestcase(yyruleno==246);
+{yymsp[0].minor.yy350.a = yymsp[0].major; /*A-overwrites-X*/ yymsp[0].minor.yy350.b = 0;}
break;
- case 245: /* trigger_event ::= UPDATE OF idlist */
-{yymsp[-2].minor.yy34.a = TK_UPDATE; yymsp[-2].minor.yy34.b = yymsp[0].minor.yy48;}
+ case 247: /* trigger_event ::= UPDATE OF idlist */
+{yymsp[-2].minor.yy350.a = TK_UPDATE; yymsp[-2].minor.yy350.b = yymsp[0].minor.yy336;}
break;
- case 246: /* when_clause ::= */
- case 265: /* key_opt ::= */ yytestcase(yyruleno==265);
- case 307: /* filter_opt ::= */ yytestcase(yyruleno==307);
-{ yymsp[1].minor.yy18 = 0; }
+ case 248: /* when_clause ::= */
+ case 267: /* key_opt ::= */ yytestcase(yyruleno==267);
+ case 309: /* filter_opt ::= */ yytestcase(yyruleno==309);
+{ yymsp[1].minor.yy490 = 0; }
break;
- case 247: /* when_clause ::= WHEN expr */
- case 266: /* key_opt ::= KEY expr */ yytestcase(yyruleno==266);
-{ yymsp[-1].minor.yy18 = yymsp[0].minor.yy18; }
+ case 249: /* when_clause ::= WHEN expr */
+ case 268: /* key_opt ::= KEY expr */ yytestcase(yyruleno==268);
+{ yymsp[-1].minor.yy490 = yymsp[0].minor.yy490; }
break;
- case 248: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
+ case 250: /* trigger_cmd_list ::= trigger_cmd_list trigger_cmd SEMI */
{
- assert( yymsp[-2].minor.yy207!=0 );
- yymsp[-2].minor.yy207->pLast->pNext = yymsp[-1].minor.yy207;
- yymsp[-2].minor.yy207->pLast = yymsp[-1].minor.yy207;
+ assert( yymsp[-2].minor.yy119!=0 );
+ yymsp[-2].minor.yy119->pLast->pNext = yymsp[-1].minor.yy119;
+ yymsp[-2].minor.yy119->pLast = yymsp[-1].minor.yy119;
}
break;
- case 249: /* trigger_cmd_list ::= trigger_cmd SEMI */
+ case 251: /* trigger_cmd_list ::= trigger_cmd SEMI */
{
- assert( yymsp[-1].minor.yy207!=0 );
- yymsp[-1].minor.yy207->pLast = yymsp[-1].minor.yy207;
+ assert( yymsp[-1].minor.yy119!=0 );
+ yymsp[-1].minor.yy119->pLast = yymsp[-1].minor.yy119;
}
break;
- case 250: /* trnm ::= nm DOT nm */
+ case 252: /* trnm ::= nm DOT nm */
{
yymsp[-2].minor.yy0 = yymsp[0].minor.yy0;
sqlite3ErrorMsg(pParse,
@@ -150613,312 +151502,312 @@ static YYACTIONTYPE yy_reduce(
"statements within triggers");
}
break;
- case 251: /* tridxby ::= INDEXED BY nm */
+ case 253: /* tridxby ::= INDEXED BY nm */
{
sqlite3ErrorMsg(pParse,
"the INDEXED BY clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
- case 252: /* tridxby ::= NOT INDEXED */
+ case 254: /* tridxby ::= NOT INDEXED */
{
sqlite3ErrorMsg(pParse,
"the NOT INDEXED clause is not allowed on UPDATE or DELETE statements "
"within triggers");
}
break;
- case 253: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
-{yylhsminor.yy207 = sqlite3TriggerUpdateStep(pParse, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy420, yymsp[-1].minor.yy18, yymsp[-6].minor.yy70, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy392);}
- yymsp[-7].minor.yy207 = yylhsminor.yy207;
+ case 255: /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist where_opt scanpt */
+{yylhsminor.yy119 = sqlite3TriggerUpdateStep(pParse, &yymsp[-5].minor.yy0, yymsp[-2].minor.yy42, yymsp[-1].minor.yy490, yymsp[-6].minor.yy96, yymsp[-7].minor.yy0.z, yymsp[0].minor.yy464);}
+ yymsp[-7].minor.yy119 = yylhsminor.yy119;
break;
- case 254: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
+ case 256: /* trigger_cmd ::= scanpt insert_cmd INTO trnm idlist_opt select upsert scanpt */
{
- yylhsminor.yy207 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy48,yymsp[-2].minor.yy489,yymsp[-6].minor.yy70,yymsp[-1].minor.yy340,yymsp[-7].minor.yy392,yymsp[0].minor.yy392);/*yylhsminor.yy207-overwrites-yymsp[-6].minor.yy70*/
+ yylhsminor.yy119 = sqlite3TriggerInsertStep(pParse,&yymsp[-4].minor.yy0,yymsp[-3].minor.yy336,yymsp[-2].minor.yy423,yymsp[-6].minor.yy96,yymsp[-1].minor.yy266,yymsp[-7].minor.yy464,yymsp[0].minor.yy464);/*yylhsminor.yy119-overwrites-yymsp[-6].minor.yy96*/
}
- yymsp[-7].minor.yy207 = yylhsminor.yy207;
+ yymsp[-7].minor.yy119 = yylhsminor.yy119;
break;
- case 255: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
-{yylhsminor.yy207 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy18, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy392);}
- yymsp[-5].minor.yy207 = yylhsminor.yy207;
+ case 257: /* trigger_cmd ::= DELETE FROM trnm tridxby where_opt scanpt */
+{yylhsminor.yy119 = sqlite3TriggerDeleteStep(pParse, &yymsp[-3].minor.yy0, yymsp[-1].minor.yy490, yymsp[-5].minor.yy0.z, yymsp[0].minor.yy464);}
+ yymsp[-5].minor.yy119 = yylhsminor.yy119;
break;
- case 256: /* trigger_cmd ::= scanpt select scanpt */
-{yylhsminor.yy207 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy489, yymsp[-2].minor.yy392, yymsp[0].minor.yy392); /*yylhsminor.yy207-overwrites-yymsp[-1].minor.yy489*/}
- yymsp[-2].minor.yy207 = yylhsminor.yy207;
+ case 258: /* trigger_cmd ::= scanpt select scanpt */
+{yylhsminor.yy119 = sqlite3TriggerSelectStep(pParse->db, yymsp[-1].minor.yy423, yymsp[-2].minor.yy464, yymsp[0].minor.yy464); /*yylhsminor.yy119-overwrites-yymsp[-1].minor.yy423*/}
+ yymsp[-2].minor.yy119 = yylhsminor.yy119;
break;
- case 257: /* expr ::= RAISE LP IGNORE RP */
+ case 259: /* expr ::= RAISE LP IGNORE RP */
{
- yymsp[-3].minor.yy18 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
- if( yymsp[-3].minor.yy18 ){
- yymsp[-3].minor.yy18->affinity = OE_Ignore;
+ yymsp[-3].minor.yy490 = sqlite3PExpr(pParse, TK_RAISE, 0, 0);
+ if( yymsp[-3].minor.yy490 ){
+ yymsp[-3].minor.yy490->affinity = OE_Ignore;
}
}
break;
- case 258: /* expr ::= RAISE LP raisetype COMMA nm RP */
+ case 260: /* expr ::= RAISE LP raisetype COMMA nm RP */
{
- yymsp[-5].minor.yy18 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
- if( yymsp[-5].minor.yy18 ) {
- yymsp[-5].minor.yy18->affinity = (char)yymsp[-3].minor.yy70;
+ yymsp[-5].minor.yy490 = sqlite3ExprAlloc(pParse->db, TK_RAISE, &yymsp[-1].minor.yy0, 1);
+ if( yymsp[-5].minor.yy490 ) {
+ yymsp[-5].minor.yy490->affinity = (char)yymsp[-3].minor.yy96;
}
}
break;
- case 259: /* raisetype ::= ROLLBACK */
-{yymsp[0].minor.yy70 = OE_Rollback;}
+ case 261: /* raisetype ::= ROLLBACK */
+{yymsp[0].minor.yy96 = OE_Rollback;}
break;
- case 261: /* raisetype ::= FAIL */
-{yymsp[0].minor.yy70 = OE_Fail;}
+ case 263: /* raisetype ::= FAIL */
+{yymsp[0].minor.yy96 = OE_Fail;}
break;
- case 262: /* cmd ::= DROP TRIGGER ifexists fullname */
+ case 264: /* cmd ::= DROP TRIGGER ifexists fullname */
{
- sqlite3DropTrigger(pParse,yymsp[0].minor.yy135,yymsp[-1].minor.yy70);
+ sqlite3DropTrigger(pParse,yymsp[0].minor.yy167,yymsp[-1].minor.yy96);
}
break;
- case 263: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
+ case 265: /* cmd ::= ATTACH database_kw_opt expr AS expr key_opt */
{
- sqlite3Attach(pParse, yymsp[-3].minor.yy18, yymsp[-1].minor.yy18, yymsp[0].minor.yy18);
+ sqlite3Attach(pParse, yymsp[-3].minor.yy490, yymsp[-1].minor.yy490, yymsp[0].minor.yy490);
}
break;
- case 264: /* cmd ::= DETACH database_kw_opt expr */
+ case 266: /* cmd ::= DETACH database_kw_opt expr */
{
- sqlite3Detach(pParse, yymsp[0].minor.yy18);
+ sqlite3Detach(pParse, yymsp[0].minor.yy490);
}
break;
- case 267: /* cmd ::= REINDEX */
+ case 269: /* cmd ::= REINDEX */
{sqlite3Reindex(pParse, 0, 0);}
break;
- case 268: /* cmd ::= REINDEX nm dbnm */
+ case 270: /* cmd ::= REINDEX nm dbnm */
{sqlite3Reindex(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
- case 269: /* cmd ::= ANALYZE */
+ case 271: /* cmd ::= ANALYZE */
{sqlite3Analyze(pParse, 0, 0);}
break;
- case 270: /* cmd ::= ANALYZE nm dbnm */
+ case 272: /* cmd ::= ANALYZE nm dbnm */
{sqlite3Analyze(pParse, &yymsp[-1].minor.yy0, &yymsp[0].minor.yy0);}
break;
- case 271: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
+ case 273: /* cmd ::= ALTER TABLE fullname RENAME TO nm */
{
- sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy135,&yymsp[0].minor.yy0);
+ sqlite3AlterRenameTable(pParse,yymsp[-3].minor.yy167,&yymsp[0].minor.yy0);
}
break;
- case 272: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
+ case 274: /* cmd ::= ALTER TABLE add_column_fullname ADD kwcolumn_opt columnname carglist */
{
yymsp[-1].minor.yy0.n = (int)(pParse->sLastToken.z-yymsp[-1].minor.yy0.z) + pParse->sLastToken.n;
sqlite3AlterFinishAddColumn(pParse, &yymsp[-1].minor.yy0);
}
break;
- case 273: /* add_column_fullname ::= fullname */
+ case 275: /* add_column_fullname ::= fullname */
{
disableLookaside(pParse);
- sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy135);
+ sqlite3AlterBeginAddColumn(pParse, yymsp[0].minor.yy167);
}
break;
- case 274: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
+ case 276: /* cmd ::= ALTER TABLE fullname RENAME kwcolumn_opt nm TO nm */
{
- sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy135, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
+ sqlite3AlterRenameColumn(pParse, yymsp[-5].minor.yy167, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0);
}
break;
- case 275: /* cmd ::= create_vtab */
+ case 277: /* cmd ::= create_vtab */
{sqlite3VtabFinishParse(pParse,0);}
break;
- case 276: /* cmd ::= create_vtab LP vtabarglist RP */
+ case 278: /* cmd ::= create_vtab LP vtabarglist RP */
{sqlite3VtabFinishParse(pParse,&yymsp[0].minor.yy0);}
break;
- case 277: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
+ case 279: /* create_vtab ::= createkw VIRTUAL TABLE ifnotexists nm dbnm USING nm */
{
- sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy70);
+ sqlite3VtabBeginParse(pParse, &yymsp[-3].minor.yy0, &yymsp[-2].minor.yy0, &yymsp[0].minor.yy0, yymsp[-4].minor.yy96);
}
break;
- case 278: /* vtabarg ::= */
+ case 280: /* vtabarg ::= */
{sqlite3VtabArgInit(pParse);}
break;
- case 279: /* vtabargtoken ::= ANY */
- case 280: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==280);
- case 281: /* lp ::= LP */ yytestcase(yyruleno==281);
+ case 281: /* vtabargtoken ::= ANY */
+ case 282: /* vtabargtoken ::= lp anylist RP */ yytestcase(yyruleno==282);
+ case 283: /* lp ::= LP */ yytestcase(yyruleno==283);
{sqlite3VtabArgExtend(pParse,&yymsp[0].minor.yy0);}
break;
- case 282: /* with ::= WITH wqlist */
- case 283: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==283);
-{ sqlite3WithPush(pParse, yymsp[0].minor.yy449, 1); }
+ case 284: /* with ::= WITH wqlist */
+ case 285: /* with ::= WITH RECURSIVE wqlist */ yytestcase(yyruleno==285);
+{ sqlite3WithPush(pParse, yymsp[0].minor.yy499, 1); }
break;
- case 284: /* wqlist ::= nm eidlist_opt AS LP select RP */
+ case 286: /* wqlist ::= nm eidlist_opt AS LP select RP */
{
- yymsp[-5].minor.yy449 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy420, yymsp[-1].minor.yy489); /*A-overwrites-X*/
+ yymsp[-5].minor.yy499 = sqlite3WithAdd(pParse, 0, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy42, yymsp[-1].minor.yy423); /*A-overwrites-X*/
}
break;
- case 285: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
+ case 287: /* wqlist ::= wqlist COMMA nm eidlist_opt AS LP select RP */
{
- yymsp[-7].minor.yy449 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy449, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy420, yymsp[-1].minor.yy489);
+ yymsp[-7].minor.yy499 = sqlite3WithAdd(pParse, yymsp[-7].minor.yy499, &yymsp[-5].minor.yy0, yymsp[-4].minor.yy42, yymsp[-1].minor.yy423);
}
break;
- case 286: /* windowdefn_list ::= windowdefn */
-{ yylhsminor.yy327 = yymsp[0].minor.yy327; }
- yymsp[0].minor.yy327 = yylhsminor.yy327;
+ case 288: /* windowdefn_list ::= windowdefn */
+{ yylhsminor.yy147 = yymsp[0].minor.yy147; }
+ yymsp[0].minor.yy147 = yylhsminor.yy147;
break;
- case 287: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
+ case 289: /* windowdefn_list ::= windowdefn_list COMMA windowdefn */
{
- assert( yymsp[0].minor.yy327!=0 );
- yymsp[0].minor.yy327->pNextWin = yymsp[-2].minor.yy327;
- yylhsminor.yy327 = yymsp[0].minor.yy327;
+ assert( yymsp[0].minor.yy147!=0 );
+ yymsp[0].minor.yy147->pNextWin = yymsp[-2].minor.yy147;
+ yylhsminor.yy147 = yymsp[0].minor.yy147;
}
- yymsp[-2].minor.yy327 = yylhsminor.yy327;
+ yymsp[-2].minor.yy147 = yylhsminor.yy147;
break;
- case 288: /* windowdefn ::= nm AS window */
+ case 290: /* windowdefn ::= nm AS window */
{
- if( ALWAYS(yymsp[0].minor.yy327) ){
- yymsp[0].minor.yy327->zName = sqlite3DbStrNDup(pParse->db, yymsp[-2].minor.yy0.z, yymsp[-2].minor.yy0.n);
+ if( ALWAYS(yymsp[0].minor.yy147) ){
+ yymsp[0].minor.yy147->zName = sqlite3DbStrNDup(pParse->db, yymsp[-2].minor.yy0.z, yymsp[-2].minor.yy0.n);
}
- yylhsminor.yy327 = yymsp[0].minor.yy327;
+ yylhsminor.yy147 = yymsp[0].minor.yy147;
}
- yymsp[-2].minor.yy327 = yylhsminor.yy327;
+ yymsp[-2].minor.yy147 = yylhsminor.yy147;
break;
- case 289: /* window ::= LP part_opt orderby_opt frame_opt RP */
+ case 291: /* window ::= LP part_opt orderby_opt frame_opt RP */
{
- yymsp[-4].minor.yy327 = yymsp[-1].minor.yy327;
- if( ALWAYS(yymsp[-4].minor.yy327) ){
- yymsp[-4].minor.yy327->pPartition = yymsp[-3].minor.yy420;
- yymsp[-4].minor.yy327->pOrderBy = yymsp[-2].minor.yy420;
+ yymsp[-4].minor.yy147 = yymsp[-1].minor.yy147;
+ if( ALWAYS(yymsp[-4].minor.yy147) ){
+ yymsp[-4].minor.yy147->pPartition = yymsp[-3].minor.yy42;
+ yymsp[-4].minor.yy147->pOrderBy = yymsp[-2].minor.yy42;
}
}
break;
- case 290: /* part_opt ::= PARTITION BY nexprlist */
-{ yymsp[-2].minor.yy420 = yymsp[0].minor.yy420; }
+ case 292: /* part_opt ::= PARTITION BY nexprlist */
+{ yymsp[-2].minor.yy42 = yymsp[0].minor.yy42; }
break;
- case 291: /* part_opt ::= */
-{ yymsp[1].minor.yy420 = 0; }
+ case 293: /* part_opt ::= */
+{ yymsp[1].minor.yy42 = 0; }
break;
- case 292: /* frame_opt ::= */
+ case 294: /* frame_opt ::= */
{
- yymsp[1].minor.yy327 = sqlite3WindowAlloc(pParse, TK_RANGE, TK_UNBOUNDED, 0, TK_CURRENT, 0);
+ yymsp[1].minor.yy147 = sqlite3WindowAlloc(pParse, TK_RANGE, TK_UNBOUNDED, 0, TK_CURRENT, 0);
}
break;
- case 293: /* frame_opt ::= range_or_rows frame_bound_s */
+ case 295: /* frame_opt ::= range_or_rows frame_bound_s */
{
- yylhsminor.yy327 = sqlite3WindowAlloc(pParse, yymsp[-1].minor.yy70, yymsp[0].minor.yy119.eType, yymsp[0].minor.yy119.pExpr, TK_CURRENT, 0);
+ yylhsminor.yy147 = sqlite3WindowAlloc(pParse, yymsp[-1].minor.yy96, yymsp[0].minor.yy317.eType, yymsp[0].minor.yy317.pExpr, TK_CURRENT, 0);
}
- yymsp[-1].minor.yy327 = yylhsminor.yy327;
+ yymsp[-1].minor.yy147 = yylhsminor.yy147;
break;
- case 294: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */
+ case 296: /* frame_opt ::= range_or_rows BETWEEN frame_bound_s AND frame_bound_e */
{
- yylhsminor.yy327 = sqlite3WindowAlloc(pParse, yymsp[-4].minor.yy70, yymsp[-2].minor.yy119.eType, yymsp[-2].minor.yy119.pExpr, yymsp[0].minor.yy119.eType, yymsp[0].minor.yy119.pExpr);
+ yylhsminor.yy147 = sqlite3WindowAlloc(pParse, yymsp[-4].minor.yy96, yymsp[-2].minor.yy317.eType, yymsp[-2].minor.yy317.pExpr, yymsp[0].minor.yy317.eType, yymsp[0].minor.yy317.pExpr);
}
- yymsp[-4].minor.yy327 = yylhsminor.yy327;
+ yymsp[-4].minor.yy147 = yylhsminor.yy147;
break;
- case 295: /* range_or_rows ::= RANGE */
-{ yymsp[0].minor.yy70 = TK_RANGE; }
+ case 297: /* range_or_rows ::= RANGE */
+{ yymsp[0].minor.yy96 = TK_RANGE; }
break;
- case 296: /* range_or_rows ::= ROWS */
-{ yymsp[0].minor.yy70 = TK_ROWS; }
+ case 298: /* range_or_rows ::= ROWS */
+{ yymsp[0].minor.yy96 = TK_ROWS; }
break;
- case 297: /* frame_bound_s ::= frame_bound */
- case 299: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==299);
-{ yylhsminor.yy119 = yymsp[0].minor.yy119; }
- yymsp[0].minor.yy119 = yylhsminor.yy119;
+ case 299: /* frame_bound_s ::= frame_bound */
+ case 301: /* frame_bound_e ::= frame_bound */ yytestcase(yyruleno==301);
+{ yylhsminor.yy317 = yymsp[0].minor.yy317; }
+ yymsp[0].minor.yy317 = yylhsminor.yy317;
break;
- case 298: /* frame_bound_s ::= UNBOUNDED PRECEDING */
- case 300: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==300);
-{yymsp[-1].minor.yy119.eType = TK_UNBOUNDED; yymsp[-1].minor.yy119.pExpr = 0;}
+ case 300: /* frame_bound_s ::= UNBOUNDED PRECEDING */
+ case 302: /* frame_bound_e ::= UNBOUNDED FOLLOWING */ yytestcase(yyruleno==302);
+{yymsp[-1].minor.yy317.eType = TK_UNBOUNDED; yymsp[-1].minor.yy317.pExpr = 0;}
break;
- case 301: /* frame_bound ::= expr PRECEDING */
-{ yylhsminor.yy119.eType = TK_PRECEDING; yylhsminor.yy119.pExpr = yymsp[-1].minor.yy18; }
- yymsp[-1].minor.yy119 = yylhsminor.yy119;
+ case 303: /* frame_bound ::= expr PRECEDING */
+{ yylhsminor.yy317.eType = TK_PRECEDING; yylhsminor.yy317.pExpr = yymsp[-1].minor.yy490; }
+ yymsp[-1].minor.yy317 = yylhsminor.yy317;
break;
- case 302: /* frame_bound ::= CURRENT ROW */
-{ yymsp[-1].minor.yy119.eType = TK_CURRENT ; yymsp[-1].minor.yy119.pExpr = 0; }
+ case 304: /* frame_bound ::= CURRENT ROW */
+{ yymsp[-1].minor.yy317.eType = TK_CURRENT ; yymsp[-1].minor.yy317.pExpr = 0; }
break;
- case 303: /* frame_bound ::= expr FOLLOWING */
-{ yylhsminor.yy119.eType = TK_FOLLOWING; yylhsminor.yy119.pExpr = yymsp[-1].minor.yy18; }
- yymsp[-1].minor.yy119 = yylhsminor.yy119;
+ case 305: /* frame_bound ::= expr FOLLOWING */
+{ yylhsminor.yy317.eType = TK_FOLLOWING; yylhsminor.yy317.pExpr = yymsp[-1].minor.yy490; }
+ yymsp[-1].minor.yy317 = yylhsminor.yy317;
break;
- case 304: /* window_clause ::= WINDOW windowdefn_list */
-{ yymsp[-1].minor.yy327 = yymsp[0].minor.yy327; }
+ case 306: /* window_clause ::= WINDOW windowdefn_list */
+{ yymsp[-1].minor.yy147 = yymsp[0].minor.yy147; }
break;
- case 305: /* over_clause ::= filter_opt OVER window */
+ case 307: /* over_clause ::= filter_opt OVER window */
{
- yylhsminor.yy327 = yymsp[0].minor.yy327;
- assert( yylhsminor.yy327!=0 );
- yylhsminor.yy327->pFilter = yymsp[-2].minor.yy18;
+ yylhsminor.yy147 = yymsp[0].minor.yy147;
+ assert( yylhsminor.yy147!=0 );
+ yylhsminor.yy147->pFilter = yymsp[-2].minor.yy490;
}
- yymsp[-2].minor.yy327 = yylhsminor.yy327;
+ yymsp[-2].minor.yy147 = yylhsminor.yy147;
break;
- case 306: /* over_clause ::= filter_opt OVER nm */
+ case 308: /* over_clause ::= filter_opt OVER nm */
{
- yylhsminor.yy327 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
- if( yylhsminor.yy327 ){
- yylhsminor.yy327->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
- yylhsminor.yy327->pFilter = yymsp[-2].minor.yy18;
+ yylhsminor.yy147 = (Window*)sqlite3DbMallocZero(pParse->db, sizeof(Window));
+ if( yylhsminor.yy147 ){
+ yylhsminor.yy147->zName = sqlite3DbStrNDup(pParse->db, yymsp[0].minor.yy0.z, yymsp[0].minor.yy0.n);
+ yylhsminor.yy147->pFilter = yymsp[-2].minor.yy490;
}else{
- sqlite3ExprDelete(pParse->db, yymsp[-2].minor.yy18);
+ sqlite3ExprDelete(pParse->db, yymsp[-2].minor.yy490);
}
}
- yymsp[-2].minor.yy327 = yylhsminor.yy327;
+ yymsp[-2].minor.yy147 = yylhsminor.yy147;
break;
- case 308: /* filter_opt ::= FILTER LP WHERE expr RP */
-{ yymsp[-4].minor.yy18 = yymsp[-1].minor.yy18; }
+ case 310: /* filter_opt ::= FILTER LP WHERE expr RP */
+{ yymsp[-4].minor.yy490 = yymsp[-1].minor.yy490; }
break;
default:
- /* (309) input ::= cmdlist */ yytestcase(yyruleno==309);
- /* (310) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==310);
- /* (311) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=311);
- /* (312) ecmd ::= SEMI */ yytestcase(yyruleno==312);
- /* (313) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==313);
- /* (314) ecmd ::= explain cmdx */ yytestcase(yyruleno==314);
- /* (315) trans_opt ::= */ yytestcase(yyruleno==315);
- /* (316) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==316);
- /* (317) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==317);
- /* (318) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==318);
- /* (319) savepoint_opt ::= */ yytestcase(yyruleno==319);
- /* (320) cmd ::= create_table create_table_args */ yytestcase(yyruleno==320);
- /* (321) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==321);
- /* (322) columnlist ::= columnname carglist */ yytestcase(yyruleno==322);
- /* (323) nm ::= ID|INDEXED */ yytestcase(yyruleno==323);
- /* (324) nm ::= STRING */ yytestcase(yyruleno==324);
- /* (325) nm ::= JOIN_KW */ yytestcase(yyruleno==325);
- /* (326) typetoken ::= typename */ yytestcase(yyruleno==326);
- /* (327) typename ::= ID|STRING */ yytestcase(yyruleno==327);
- /* (328) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=328);
- /* (329) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=329);
- /* (330) carglist ::= carglist ccons */ yytestcase(yyruleno==330);
- /* (331) carglist ::= */ yytestcase(yyruleno==331);
- /* (332) ccons ::= NULL onconf */ yytestcase(yyruleno==332);
- /* (333) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==333);
- /* (334) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==334);
- /* (335) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=335);
- /* (336) tconscomma ::= */ yytestcase(yyruleno==336);
- /* (337) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=337);
- /* (338) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=338);
- /* (339) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=339);
- /* (340) oneselect ::= values */ yytestcase(yyruleno==340);
- /* (341) sclp ::= selcollist COMMA */ yytestcase(yyruleno==341);
- /* (342) as ::= ID|STRING */ yytestcase(yyruleno==342);
- /* (343) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=343);
- /* (344) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==344);
- /* (345) exprlist ::= nexprlist */ yytestcase(yyruleno==345);
- /* (346) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=346);
- /* (347) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=347);
- /* (348) nmnum ::= ON */ yytestcase(yyruleno==348);
- /* (349) nmnum ::= DELETE */ yytestcase(yyruleno==349);
- /* (350) nmnum ::= DEFAULT */ yytestcase(yyruleno==350);
- /* (351) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==351);
- /* (352) foreach_clause ::= */ yytestcase(yyruleno==352);
- /* (353) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==353);
- /* (354) trnm ::= nm */ yytestcase(yyruleno==354);
- /* (355) tridxby ::= */ yytestcase(yyruleno==355);
- /* (356) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==356);
- /* (357) database_kw_opt ::= */ yytestcase(yyruleno==357);
- /* (358) kwcolumn_opt ::= */ yytestcase(yyruleno==358);
- /* (359) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==359);
- /* (360) vtabarglist ::= vtabarg */ yytestcase(yyruleno==360);
- /* (361) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==361);
- /* (362) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==362);
- /* (363) anylist ::= */ yytestcase(yyruleno==363);
- /* (364) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==364);
- /* (365) anylist ::= anylist ANY */ yytestcase(yyruleno==365);
- /* (366) with ::= */ yytestcase(yyruleno==366);
+ /* (311) input ::= cmdlist */ yytestcase(yyruleno==311);
+ /* (312) cmdlist ::= cmdlist ecmd */ yytestcase(yyruleno==312);
+ /* (313) cmdlist ::= ecmd (OPTIMIZED OUT) */ assert(yyruleno!=313);
+ /* (314) ecmd ::= SEMI */ yytestcase(yyruleno==314);
+ /* (315) ecmd ::= cmdx SEMI */ yytestcase(yyruleno==315);
+ /* (316) ecmd ::= explain cmdx */ yytestcase(yyruleno==316);
+ /* (317) trans_opt ::= */ yytestcase(yyruleno==317);
+ /* (318) trans_opt ::= TRANSACTION */ yytestcase(yyruleno==318);
+ /* (319) trans_opt ::= TRANSACTION nm */ yytestcase(yyruleno==319);
+ /* (320) savepoint_opt ::= SAVEPOINT */ yytestcase(yyruleno==320);
+ /* (321) savepoint_opt ::= */ yytestcase(yyruleno==321);
+ /* (322) cmd ::= create_table create_table_args */ yytestcase(yyruleno==322);
+ /* (323) columnlist ::= columnlist COMMA columnname carglist */ yytestcase(yyruleno==323);
+ /* (324) columnlist ::= columnname carglist */ yytestcase(yyruleno==324);
+ /* (325) nm ::= ID|INDEXED */ yytestcase(yyruleno==325);
+ /* (326) nm ::= STRING */ yytestcase(yyruleno==326);
+ /* (327) nm ::= JOIN_KW */ yytestcase(yyruleno==327);
+ /* (328) typetoken ::= typename */ yytestcase(yyruleno==328);
+ /* (329) typename ::= ID|STRING */ yytestcase(yyruleno==329);
+ /* (330) signed ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=330);
+ /* (331) signed ::= minus_num (OPTIMIZED OUT) */ assert(yyruleno!=331);
+ /* (332) carglist ::= carglist ccons */ yytestcase(yyruleno==332);
+ /* (333) carglist ::= */ yytestcase(yyruleno==333);
+ /* (334) ccons ::= NULL onconf */ yytestcase(yyruleno==334);
+ /* (335) conslist_opt ::= COMMA conslist */ yytestcase(yyruleno==335);
+ /* (336) conslist ::= conslist tconscomma tcons */ yytestcase(yyruleno==336);
+ /* (337) conslist ::= tcons (OPTIMIZED OUT) */ assert(yyruleno!=337);
+ /* (338) tconscomma ::= */ yytestcase(yyruleno==338);
+ /* (339) defer_subclause_opt ::= defer_subclause (OPTIMIZED OUT) */ assert(yyruleno!=339);
+ /* (340) resolvetype ::= raisetype (OPTIMIZED OUT) */ assert(yyruleno!=340);
+ /* (341) selectnowith ::= oneselect (OPTIMIZED OUT) */ assert(yyruleno!=341);
+ /* (342) oneselect ::= values */ yytestcase(yyruleno==342);
+ /* (343) sclp ::= selcollist COMMA */ yytestcase(yyruleno==343);
+ /* (344) as ::= ID|STRING */ yytestcase(yyruleno==344);
+ /* (345) expr ::= term (OPTIMIZED OUT) */ assert(yyruleno!=345);
+ /* (346) likeop ::= LIKE_KW|MATCH */ yytestcase(yyruleno==346);
+ /* (347) exprlist ::= nexprlist */ yytestcase(yyruleno==347);
+ /* (348) nmnum ::= plus_num (OPTIMIZED OUT) */ assert(yyruleno!=348);
+ /* (349) nmnum ::= nm (OPTIMIZED OUT) */ assert(yyruleno!=349);
+ /* (350) nmnum ::= ON */ yytestcase(yyruleno==350);
+ /* (351) nmnum ::= DELETE */ yytestcase(yyruleno==351);
+ /* (352) nmnum ::= DEFAULT */ yytestcase(yyruleno==352);
+ /* (353) plus_num ::= INTEGER|FLOAT */ yytestcase(yyruleno==353);
+ /* (354) foreach_clause ::= */ yytestcase(yyruleno==354);
+ /* (355) foreach_clause ::= FOR EACH ROW */ yytestcase(yyruleno==355);
+ /* (356) trnm ::= nm */ yytestcase(yyruleno==356);
+ /* (357) tridxby ::= */ yytestcase(yyruleno==357);
+ /* (358) database_kw_opt ::= DATABASE */ yytestcase(yyruleno==358);
+ /* (359) database_kw_opt ::= */ yytestcase(yyruleno==359);
+ /* (360) kwcolumn_opt ::= */ yytestcase(yyruleno==360);
+ /* (361) kwcolumn_opt ::= COLUMNKW */ yytestcase(yyruleno==361);
+ /* (362) vtabarglist ::= vtabarg */ yytestcase(yyruleno==362);
+ /* (363) vtabarglist ::= vtabarglist COMMA vtabarg */ yytestcase(yyruleno==363);
+ /* (364) vtabarg ::= vtabarg vtabargtoken */ yytestcase(yyruleno==364);
+ /* (365) anylist ::= */ yytestcase(yyruleno==365);
+ /* (366) anylist ::= anylist LP anylist RP */ yytestcase(yyruleno==366);
+ /* (367) anylist ::= anylist ANY */ yytestcase(yyruleno==367);
+ /* (368) with ::= */ yytestcase(yyruleno==368);
break;
/********** End reduce actions ************************************************/
};
- assert( yyruleno<sizeof(yyRuleInfo)/sizeof(yyRuleInfo[0]) );
- yygoto = yyRuleInfo[yyruleno].lhs;
- yysize = yyRuleInfo[yyruleno].nrhs;
+ assert( yyruleno<sizeof(yyRuleInfoLhs)/sizeof(yyRuleInfoLhs[0]) );
+ yygoto = yyRuleInfoLhs[yyruleno];
+ yysize = yyRuleInfoNRhs[yyruleno];
yyact = yy_find_reduce_action(yymsp[yysize].stateno,(YYCODETYPE)yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table
@@ -152095,73 +152984,6 @@ SQLITE_PRIVATE int sqlite3GetToken(const unsigned char *z, int *tokenType){
return i;
}
-#ifdef SQLITE_ENABLE_NORMALIZE
-/*
-** Return the length (in bytes) of the token that begins at z[0].
-** Store the token type in *tokenType before returning. If flags has
-** SQLITE_TOKEN_NORMALIZE flag enabled, use the identifier token type
-** for keywords. Add SQLITE_TOKEN_QUOTED to flags if the token was
-** actually a quoted identifier. Add SQLITE_TOKEN_KEYWORD to flags
-** if the token was recognized as a keyword; this is useful when the
-** SQLITE_TOKEN_NORMALIZE flag is used, because it enables the caller
-** to differentiate between a keyword being treated as an identifier
-** (for normalization purposes) and an actual identifier.
-*/
-SQLITE_PRIVATE int sqlite3GetTokenNormalized(
- const unsigned char *z,
- int *tokenType,
- int *flags
-){
- int n;
- unsigned char iClass = aiClass[*z];
- if( iClass==CC_KYWD ){
- int i;
- for(i=1; aiClass[z[i]]<=CC_KYWD; i++){}
- if( IdChar(z[i]) ){
- /* This token started out using characters that can appear in keywords,
- ** but z[i] is a character not allowed within keywords, so this must
- ** be an identifier instead */
- i++;
- while( IdChar(z[i]) ){ i++; }
- *tokenType = TK_ID;
- return i;
- }
- *tokenType = TK_ID;
- n = keywordCode((char*)z, i, tokenType);
- /* If the token is no longer considered to be an identifier, then it is a
- ** keyword of some kind. Make the token back into an identifier and then
- ** set the SQLITE_TOKEN_KEYWORD flag. Several non-identifier tokens are
- ** used verbatim, including IN, IS, NOT, and NULL. */
- switch( *tokenType ){
- case TK_ID: {
- /* do nothing, handled by caller */
- break;
- }
- case TK_IN:
- case TK_IS:
- case TK_NOT:
- case TK_NULL: {
- *flags |= SQLITE_TOKEN_KEYWORD;
- break;
- }
- default: {
- *tokenType = TK_ID;
- *flags |= SQLITE_TOKEN_KEYWORD;
- break;
- }
- }
- }else{
- n = sqlite3GetToken(z, tokenType);
- /* If the token is considered to be an identifier and the character class
- ** of the first character is a quote, set the SQLITE_TOKEN_QUOTED flag. */
- if( *tokenType==TK_ID && (iClass==CC_QUOTE || iClass==CC_QUOTE2) ){
- *flags |= SQLITE_TOKEN_QUOTED;
- }
- }
- return n;
-}
-#endif /* SQLITE_ENABLE_NORMALIZE */
-
/*
** Run the parser on the given SQL string. The parser structure is
** passed in. An SQLITE_ status code is returned. If an error occurs
@@ -152189,7 +153011,14 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzEr
pParse->rc = SQLITE_OK;
pParse->zTail = zSql;
assert( pzErrMsg!=0 );
- /* sqlite3ParserTrace(stdout, "parser: "); */
+#ifdef SQLITE_DEBUG
+ if( db->flags & SQLITE_ParserTrace ){
+ printf("parser: [[[%s]]]\n", zSql);
+ sqlite3ParserTrace(stdout, "parser: ");
+ }else{
+ sqlite3ParserTrace(0, 0);
+ }
+#endif
#ifdef sqlite3Parser_ENGINEALWAYSONSTACK
pEngine = &sEngine;
sqlite3ParserInit(pEngine, pParse);
@@ -152332,6 +153161,141 @@ SQLITE_PRIVATE int sqlite3RunParser(Parse *pParse, const char *zSql, char **pzEr
return nErr;
}
+
+#ifdef SQLITE_ENABLE_NORMALIZE
+/*
+** Insert a single space character into pStr if the current string
+** ends with an identifier
+*/
+static void addSpaceSeparator(sqlite3_str *pStr){
+ if( pStr->nChar && sqlite3IsIdChar(pStr->zText[pStr->nChar-1]) ){
+ sqlite3_str_append(pStr, " ", 1);
+ }
+}
+
+/*
+** Compute a normalization of the SQL given by zSql[0..nSql-1]. Return
+** the normalization in space obtained from sqlite3DbMalloc(). Or return
+** NULL if anything goes wrong or if zSql is NULL.
+*/
+SQLITE_PRIVATE char *sqlite3Normalize(
+ Vdbe *pVdbe, /* VM being reprepared */
+ const char *zSql /* The original SQL string */
+){
+ sqlite3 *db; /* The database connection */
+ int i; /* Next unread byte of zSql[] */
+ int n; /* length of current token */
+ int tokenType; /* type of current token */
+ int prevType = 0; /* Previous non-whitespace token */
+ int nParen; /* Number of nested levels of parentheses */
+ int iStartIN; /* Start of RHS of IN operator in z[] */
+ int nParenAtIN; /* Value of nParent at start of RHS of IN operator */
+ int j; /* Bytes of normalized SQL generated so far */
+ sqlite3_str *pStr; /* The normalized SQL string under construction */
+
+ db = sqlite3VdbeDb(pVdbe);
+ tokenType = -1;
+ nParen = iStartIN = nParenAtIN = 0;
+ pStr = sqlite3_str_new(db);
+ assert( pStr!=0 ); /* sqlite3_str_new() never returns NULL */
+ for(i=0; zSql[i] && pStr->accError==0; i+=n){
+ if( tokenType!=TK_SPACE ){
+ prevType = tokenType;
+ }
+ n = sqlite3GetToken((unsigned char*)zSql+i, &tokenType);
+ if( NEVER(n<=0) ) break;
+ switch( tokenType ){
+ case TK_SPACE: {
+ break;
+ }
+ case TK_NULL: {
+ if( prevType==TK_IS || prevType==TK_NOT ){
+ sqlite3_str_append(pStr, " NULL", 5);
+ break;
+ }
+ /* Fall through */
+ }
+ case TK_STRING:
+ case TK_INTEGER:
+ case TK_FLOAT:
+ case TK_VARIABLE:
+ case TK_BLOB: {
+ sqlite3_str_append(pStr, "?", 1);
+ break;
+ }
+ case TK_LP: {
+ nParen++;
+ if( prevType==TK_IN ){
+ iStartIN = pStr->nChar;
+ nParenAtIN = nParen;
+ }
+ sqlite3_str_append(pStr, "(", 1);
+ break;
+ }
+ case TK_RP: {
+ if( iStartIN>0 && nParen==nParenAtIN ){
+ assert( pStr->nChar>=iStartIN );
+ pStr->nChar = iStartIN+1;
+ sqlite3_str_append(pStr, "?,?,?", 5);
+ iStartIN = 0;
+ }
+ nParen--;
+ sqlite3_str_append(pStr, ")", 1);
+ break;
+ }
+ case TK_ID: {
+ iStartIN = 0;
+ j = pStr->nChar;
+ if( sqlite3Isquote(zSql[i]) ){
+ char *zId = sqlite3DbStrNDup(db, zSql+i, n);
+ int nId;
+ int eType = 0;
+ if( zId==0 ) break;
+ sqlite3Dequote(zId);
+ if( zSql[i]=='"' && sqlite3VdbeUsesDoubleQuotedString(pVdbe, zId) ){
+ sqlite3_str_append(pStr, "?", 1);
+ sqlite3DbFree(db, zId);
+ break;
+ }
+ nId = sqlite3Strlen30(zId);
+ if( sqlite3GetToken((u8*)zId, &eType)==nId && eType==TK_ID ){
+ addSpaceSeparator(pStr);
+ sqlite3_str_append(pStr, zId, nId);
+ }else{
+ sqlite3_str_appendf(pStr, "\"%w\"", zId);
+ }
+ sqlite3DbFree(db, zId);
+ }else{
+ addSpaceSeparator(pStr);
+ sqlite3_str_append(pStr, zSql+i, n);
+ }
+ while( j<pStr->nChar ){
+ pStr->zText[j] = sqlite3Tolower(pStr->zText[j]);
+ j++;
+ }
+ break;
+ }
+ case TK_SELECT: {
+ iStartIN = 0;
+ /* fall through */
+ }
+ default: {
+ if( sqlite3IsIdChar(zSql[i]) ) addSpaceSeparator(pStr);
+ j = pStr->nChar;
+ sqlite3_str_append(pStr, zSql+i, n);
+ while( j<pStr->nChar ){
+ pStr->zText[j] = sqlite3Toupper(pStr->zText[j]);
+ j++;
+ }
+ break;
+ }
+ }
+ }
+ if( tokenType!=TK_SEMI ) sqlite3_str_append(pStr, ";", 1);
+ return sqlite3_str_finish(pStr);
+}
+#endif /* SQLITE_ENABLE_NORMALIZE */
+
/************** End of tokenize.c ********************************************/
/************** Begin file complete.c ****************************************/
/*
@@ -153377,6 +154341,13 @@ SQLITE_API int sqlite3_config(int op, ...){
}
#endif /* SQLITE_ENABLE_SORTER_REFERENCES */
+#ifdef SQLITE_ENABLE_DESERIALIZE
+ case SQLITE_CONFIG_MEMDB_MAXSIZE: {
+ sqlite3GlobalConfig.mxMemdbSize = va_arg(ap, sqlite3_int64);
+ break;
+ }
+#endif /* SQLITE_ENABLE_DESERIALIZE */
+
default: {
rc = SQLITE_ERROR;
break;
@@ -153567,11 +154538,11 @@ SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...){
if( aFlagOp[i].op==op ){
int onoff = va_arg(ap, int);
int *pRes = va_arg(ap, int*);
- u32 oldFlags = db->flags;
+ u64 oldFlags = db->flags;
if( onoff>0 ){
db->flags |= aFlagOp[i].mask;
}else if( onoff==0 ){
- db->flags &= ~aFlagOp[i].mask;
+ db->flags &= ~(u64)aFlagOp[i].mask;
}
if( oldFlags!=db->flags ){
sqlite3ExpirePreparedStatements(db, 0);
@@ -154034,7 +155005,7 @@ SQLITE_PRIVATE void sqlite3RollbackAll(sqlite3 *db, int tripCode){
/* Any deferred constraint violations have now been resolved. */
db->nDeferredCons = 0;
db->nDeferredImmCons = 0;
- db->flags &= ~SQLITE_DeferFKs;
+ db->flags &= ~(u64)SQLITE_DeferFKs;
/* If one has been configured, invoke the rollback-hook callback */
if( db->xRollbackCallback && (inTrans || !db->autoCommit) ){
@@ -154776,6 +155747,8 @@ SQLITE_API void *sqlite3_profile(
pOld = db->pProfileArg;
db->xProfile = xProfile;
db->pProfileArg = pArg;
+ db->mTrace &= SQLITE_TRACE_NONLEGACY_MASK;
+ if( db->xProfile ) db->mTrace |= SQLITE_TRACE_XPROFILE;
sqlite3_mutex_leave(db->mutex);
return pOld;
}
@@ -155127,7 +156100,7 @@ SQLITE_API const char *sqlite3_errmsg(sqlite3 *db){
z = sqlite3ErrStr(SQLITE_NOMEM_BKPT);
}else{
testcase( db->pErr==0 );
- z = (char*)sqlite3_value_text(db->pErr);
+ z = db->errCode ? (char*)sqlite3_value_text(db->pErr) : 0;
assert( !db->mallocFailed );
if( z==0 ){
z = sqlite3ErrStr(db->errCode);
@@ -155657,6 +156630,40 @@ SQLITE_PRIVATE int sqlite3ParseUri(
return rc;
}
+#if defined(SQLITE_HAS_CODEC)
+/*
+** Process URI filename query parameters relevant to the SQLite Encryption
+** Extension. Return true if any of the relevant query parameters are
+** seen and return false if not.
+*/
+SQLITE_PRIVATE int sqlite3CodecQueryParameters(
+ sqlite3 *db, /* Database connection */
+ const char *zDb, /* Which schema is being created/attached */
+ const char *zUri /* URI filename */
+){
+ const char *zKey;
+ if( (zKey = sqlite3_uri_parameter(zUri, "hexkey"))!=0 && zKey[0] ){
+ u8 iByte;
+ int i;
+ char zDecoded[40];
+ for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){
+ iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]);
+ if( (i&1)!=0 ) zDecoded[i/2] = iByte;
+ }
+ sqlite3_key_v2(db, zDb, zDecoded, i/2);
+ return 1;
+ }else if( (zKey = sqlite3_uri_parameter(zUri, "key"))!=0 ){
+ sqlite3_key_v2(db, zDb, zKey, sqlite3Strlen30(zKey));
+ return 1;
+ }else if( (zKey = sqlite3_uri_parameter(zUri, "textkey"))!=0 ){
+ sqlite3_key_v2(db, zDb, zKey, -1);
+ return 1;
+ }else{
+ return 0;
+ }
+}
+#endif
+
/*
** This routine does the work of opening a database on behalf of
@@ -156002,26 +157009,13 @@ opendb_out:
}
#endif
#if defined(SQLITE_HAS_CODEC)
- if( rc==SQLITE_OK ){
- const char *zKey;
- if( (zKey = sqlite3_uri_parameter(zOpen, "hexkey"))!=0 && zKey[0] ){
- u8 iByte;
- int i;
- char zDecoded[40];
- for(i=0, iByte=0; i<sizeof(zDecoded)*2 && sqlite3Isxdigit(zKey[i]); i++){
- iByte = (iByte<<4) + sqlite3HexToInt(zKey[i]);
- if( (i&1)!=0 ) zDecoded[i/2] = iByte;
- }
- sqlite3_key_v2(db, 0, zDecoded, i/2);
- }else if( (zKey = sqlite3_uri_parameter(zOpen, "key"))!=0 ){
- sqlite3_key_v2(db, 0, zKey, sqlite3Strlen30(zKey));
- }
- }
+ if( rc==SQLITE_OK ) sqlite3CodecQueryParameters(db, 0, zOpen);
#endif
sqlite3_free(zOpen);
return rc & 0xff;
}
+
/*
** Open a new database handle.
*/
@@ -158082,6 +159076,8 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi
*/
#define FTS3_VARINT_MAX 10
+#define FTS3_BUFFER_PADDING 8
+
/*
** FTS4 virtual tables may maintain multiple indexes - one index of all terms
** in the document set and zero or more prefix indexes. All indexes are stored
@@ -158115,6 +159111,18 @@ SQLITE_PRIVATE Fts3HashElem *sqlite3Fts3HashFindElem(const Fts3Hash *, const voi
#define POS_END (0) /* Position-list terminator */
/*
+** The assert_fts3_nc() macro is similar to the assert() macro, except that it
+** is used for assert() conditions that are true only if it can be
+** guranteed that the database is not corrupt.
+*/
+#if defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
+SQLITE_API extern int sqlite3_fts3_may_be_corrupt;
+# define assert_fts3_nc(x) assert(sqlite3_fts3_may_be_corrupt || (x))
+#else
+# define assert_fts3_nc(x) assert(x)
+#endif
+
+/*
** This section provides definitions to allow the
** FTS3 extension to be compiled outside of the
** amalgamation.
@@ -158638,6 +159646,14 @@ SQLITE_PRIVATE int sqlite3Fts3Never(int b) { assert( !b ); return b; }
# endif
#endif
+/*
+** This variable is set to false when running tests for which the on disk
+** structures should not be corrupt. Otherwise, true. If it is false, extra
+** assert() conditions in the fts3 code are activated - conditions that are
+** only true if it is guaranteed that the fts3 database is not corrupt.
+*/
+SQLITE_API int sqlite3_fts3_may_be_corrupt = 1;
+
/*
** Write a 64-bit variable-length integer to memory starting at p[0].
** The length of data written will be between 1 and FTS3_VARINT_MAX bytes.
@@ -158656,7 +159672,7 @@ SQLITE_PRIVATE int sqlite3Fts3PutVarint(char *p, sqlite_int64 v){
}
#define GETVARINT_STEP(v, ptr, shift, mask1, mask2, var, ret) \
- v = (v & mask1) | ( (*ptr++) << shift ); \
+ v = (v & mask1) | ( (*(const unsigned char*)(ptr++)) << shift ); \
if( (v & mask2)==0 ){ var = v; return ret; }
#define GETVARINT_INIT(v, ptr, shift, mask1, mask2, var, ret) \
v = (*ptr++); \
@@ -158694,20 +159710,21 @@ SQLITE_PRIVATE int sqlite3Fts3GetVarint(const char *pBuf, sqlite_int64 *v){
** a non-negative 32-bit integer before it is returned.
*/
SQLITE_PRIVATE int sqlite3Fts3GetVarint32(const char *p, int *pi){
+ const unsigned char *ptr = (const unsigned char*)p;
u32 a;
#ifndef fts3GetVarint32
- GETVARINT_INIT(a, p, 0, 0x00, 0x80, *pi, 1);
+ GETVARINT_INIT(a, ptr, 0, 0x00, 0x80, *pi, 1);
#else
- a = (*p++);
+ a = (*ptr++);
assert( a & 0x80 );
#endif
- GETVARINT_STEP(a, p, 7, 0x7F, 0x4000, *pi, 2);
- GETVARINT_STEP(a, p, 14, 0x3FFF, 0x200000, *pi, 3);
- GETVARINT_STEP(a, p, 21, 0x1FFFFF, 0x10000000, *pi, 4);
+ GETVARINT_STEP(a, ptr, 7, 0x7F, 0x4000, *pi, 2);
+ GETVARINT_STEP(a, ptr, 14, 0x3FFF, 0x200000, *pi, 3);
+ GETVARINT_STEP(a, ptr, 21, 0x1FFFFF, 0x10000000, *pi, 4);
a = (a & 0x0FFFFFFF );
- *pi = (int)(a | ((u32)(*p & 0x07) << 28));
+ *pi = (int)(a | ((u32)(*ptr & 0x07) << 28));
assert( 0==(a & 0x80000000) );
assert( *pi>=0 );
return 5;
@@ -158878,13 +159895,18 @@ static int fts3DestroyMethod(sqlite3_vtab *pVtab){
sqlite3 *db = p->db; /* Database handle */
/* Drop the shadow tables */
- if( p->zContentTbl==0 ){
- fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_content'", zDb, p->zName);
- }
- fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_segments'", zDb,p->zName);
- fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_segdir'", zDb, p->zName);
- fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_docsize'", zDb, p->zName);
- fts3DbExec(&rc, db, "DROP TABLE IF EXISTS %Q.'%q_stat'", zDb, p->zName);
+ fts3DbExec(&rc, db,
+ "DROP TABLE IF EXISTS %Q.'%q_segments';"
+ "DROP TABLE IF EXISTS %Q.'%q_segdir';"
+ "DROP TABLE IF EXISTS %Q.'%q_docsize';"
+ "DROP TABLE IF EXISTS %Q.'%q_stat';"
+ "%s DROP TABLE IF EXISTS %Q.'%q_content';",
+ zDb, p->zName,
+ zDb, p->zName,
+ zDb, p->zName,
+ zDb, p->zName,
+ (p->zContentTbl ? "--" : ""), zDb,p->zName
+ );
/* If everything has worked, invoke fts3DisconnectMethod() to free the
** memory associated with the Fts3Table structure and return SQLITE_OK.
@@ -159116,10 +160138,10 @@ static void fts3Appendf(
** memory.
*/
static char *fts3QuoteId(char const *zInput){
- int nRet;
+ sqlite3_int64 nRet;
char *zRet;
nRet = 2 + (int)strlen(zInput)*2 + 1;
- zRet = sqlite3_malloc(nRet);
+ zRet = sqlite3_malloc64(nRet);
if( zRet ){
int i;
char *z = zRet;
@@ -159300,7 +160322,7 @@ static int fts3PrefixParameter(
}
}
- aIndex = sqlite3_malloc(sizeof(struct Fts3Index) * nIndex);
+ aIndex = sqlite3_malloc64(sizeof(struct Fts3Index) * nIndex);
*apIndex = aIndex;
if( !aIndex ){
return SQLITE_NOMEM;
@@ -159379,7 +160401,7 @@ static int fts3ContentColumns(
if( rc==SQLITE_OK ){
const char **azCol; /* Output array */
- int nStr = 0; /* Size of all column names (incl. 0x00) */
+ sqlite3_int64 nStr = 0; /* Size of all column names (incl. 0x00) */
int nCol; /* Number of table columns */
int i; /* Used to iterate through columns */
@@ -159389,11 +160411,11 @@ static int fts3ContentColumns(
nCol = sqlite3_column_count(pStmt);
for(i=0; i<nCol; i++){
const char *zCol = sqlite3_column_name(pStmt, i);
- nStr += (int)strlen(zCol) + 1;
+ nStr += strlen(zCol) + 1;
}
/* Allocate and populate the array to return. */
- azCol = (const char **)sqlite3_malloc(sizeof(char *) * nCol + nStr);
+ azCol = (const char **)sqlite3_malloc64(sizeof(char *) * nCol + nStr);
if( azCol==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -159441,7 +160463,7 @@ static int fts3InitVtab(
Fts3Table *p = 0; /* Pointer to allocated vtab */
int rc = SQLITE_OK; /* Return code */
int i; /* Iterator variable */
- int nByte; /* Size of allocation used for *p */
+ sqlite3_int64 nByte; /* Size of allocation used for *p */
int iCol; /* Column index */
int nString = 0; /* Bytes required to hold all column names */
int nCol = 0; /* Number of columns in the FTS table */
@@ -159475,10 +160497,10 @@ static int fts3InitVtab(
nName = (int)strlen(argv[2]) + 1;
nByte = sizeof(const char *) * (argc-2);
- aCol = (const char **)sqlite3_malloc(nByte);
+ aCol = (const char **)sqlite3_malloc64(nByte);
if( aCol ){
memset((void*)aCol, 0, nByte);
- azNotindexed = (char **)sqlite3_malloc(nByte);
+ azNotindexed = (char **)sqlite3_malloc64(nByte);
}
if( azNotindexed ){
memset(azNotindexed, 0, nByte);
@@ -159673,7 +160695,7 @@ static int fts3InitVtab(
nName + /* zName */
nDb + /* zDb */
nString; /* Space for azColumn strings */
- p = (Fts3Table*)sqlite3_malloc(nByte);
+ p = (Fts3Table*)sqlite3_malloc64(nByte);
if( p==0 ){
rc = SQLITE_NOMEM;
goto fts3_init_out;
@@ -160452,7 +161474,7 @@ static int fts3PutColNumber(char **pp, int iCol){
** updated appropriately. The caller is responsible for insuring
** that there is enough space in *pp to hold the complete output.
*/
-static void fts3PoslistMerge(
+static int fts3PoslistMerge(
char **pp, /* Output buffer */
char **pp1, /* Left input list */
char **pp2 /* Right input list */
@@ -160465,11 +161487,17 @@ static void fts3PoslistMerge(
int iCol1; /* The current column index in pp1 */
int iCol2; /* The current column index in pp2 */
- if( *p1==POS_COLUMN ) fts3GetVarint32(&p1[1], &iCol1);
+ if( *p1==POS_COLUMN ){
+ fts3GetVarint32(&p1[1], &iCol1);
+ if( iCol1==0 ) return FTS_CORRUPT_VTAB;
+ }
else if( *p1==POS_END ) iCol1 = POSITION_LIST_END;
else iCol1 = 0;
- if( *p2==POS_COLUMN ) fts3GetVarint32(&p2[1], &iCol2);
+ if( *p2==POS_COLUMN ){
+ fts3GetVarint32(&p2[1], &iCol2);
+ if( iCol2==0 ) return FTS_CORRUPT_VTAB;
+ }
else if( *p2==POS_END ) iCol2 = POSITION_LIST_END;
else iCol2 = 0;
@@ -160517,6 +161545,7 @@ static void fts3PoslistMerge(
*pp = p;
*pp1 = p1 + 1;
*pp2 = p2 + 1;
+ return SQLITE_OK;
}
/*
@@ -160581,10 +161610,9 @@ static int fts3PoslistPhraseMerge(
p += sqlite3Fts3PutVarint(p, iCol1);
}
- assert( *p1!=POS_END && *p1!=POS_COLUMN );
- assert( *p2!=POS_END && *p2!=POS_COLUMN );
fts3GetDeltaVarint(&p1, &iPos1); iPos1 -= 2;
fts3GetDeltaVarint(&p2, &iPos2); iPos2 -= 2;
+ if( iPos1<0 || iPos2<0 ) break;
while( 1 ){
if( iPos2==iPos1+nToken
@@ -160810,6 +161838,7 @@ static int fts3DoclistOrMerge(
char *a2, int n2, /* Second doclist */
char **paOut, int *pnOut /* OUT: Malloc'd doclist */
){
+ int rc = SQLITE_OK;
sqlite3_int64 i1 = 0;
sqlite3_int64 i2 = 0;
sqlite3_int64 iPrev = 0;
@@ -160853,7 +161882,7 @@ static int fts3DoclistOrMerge(
** A symetric argument may be made if the doclists are in descending
** order.
*/
- aOut = sqlite3_malloc(n1+n2+FTS3_VARINT_MAX-1);
+ aOut = sqlite3_malloc64((i64)n1+n2+FTS3_VARINT_MAX-1+FTS3_BUFFER_PADDING);
if( !aOut ) return SQLITE_NOMEM;
p = aOut;
@@ -160864,7 +161893,8 @@ static int fts3DoclistOrMerge(
if( p2 && p1 && iDiff==0 ){
fts3PutDeltaVarint3(&p, bDescDoclist, &iPrev, &bFirstOut, i1);
- fts3PoslistMerge(&p, &p1, &p2);
+ rc = fts3PoslistMerge(&p, &p1, &p2);
+ if( rc ) break;
fts3GetDeltaVarint3(&p1, pEnd1, bDescDoclist, &i1);
fts3GetDeltaVarint3(&p2, pEnd2, bDescDoclist, &i2);
}else if( !p2 || (p1 && iDiff<0) ){
@@ -160878,10 +161908,16 @@ static int fts3DoclistOrMerge(
}
}
+ if( rc!=SQLITE_OK ){
+ sqlite3_free(aOut);
+ p = aOut = 0;
+ }else{
+ assert( (p-aOut)<=n1+n2+FTS3_VARINT_MAX-1 );
+ memset(&aOut[(p-aOut)], 0, FTS3_BUFFER_PADDING);
+ }
*paOut = aOut;
*pnOut = (int)(p-aOut);
- assert( *pnOut<=n1+n2+FTS3_VARINT_MAX-1 );
- return SQLITE_OK;
+ return rc;
}
/*
@@ -160916,7 +161952,7 @@ static int fts3DoclistPhraseMerge(
assert( nDist>0 );
if( bDescDoclist ){
- aOut = sqlite3_malloc(*pnRight + FTS3_VARINT_MAX);
+ aOut = sqlite3_malloc64((sqlite3_int64)*pnRight + FTS3_VARINT_MAX);
if( aOut==0 ) return SQLITE_NOMEM;
}else{
aOut = aRight;
@@ -161100,6 +162136,7 @@ static int fts3TermSelectMerge(
pTS->anOutput[0] = nDoclist;
if( pTS->aaOutput[0] ){
memcpy(pTS->aaOutput[0], aDoclist, nDoclist);
+ memset(&pTS->aaOutput[0][nDoclist], 0, FTS3_VARINT_MAX);
}else{
return SQLITE_NOMEM;
}
@@ -161151,8 +162188,8 @@ static int fts3SegReaderCursorAppend(
){
if( (pCsr->nSegment%16)==0 ){
Fts3SegReader **apNew;
- int nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
- apNew = (Fts3SegReader **)sqlite3_realloc(pCsr->apSegment, nByte);
+ sqlite3_int64 nByte = (pCsr->nSegment + 16)*sizeof(Fts3SegReader*);
+ apNew = (Fts3SegReader **)sqlite3_realloc64(pCsr->apSegment, nByte);
if( !apNew ){
sqlite3Fts3SegReaderFree(pNew);
return SQLITE_NOMEM;
@@ -161216,7 +162253,7 @@ static int fts3SegReaderCursor(
/* If zTerm is not NULL, and this segment is not stored entirely on its
** root node, the range of leaves scanned can be reduced. Do this. */
- if( iStartBlock && zTerm ){
+ if( iStartBlock && zTerm && zRoot ){
sqlite3_int64 *pi = (isPrefix ? &iLeavesEndBlock : 0);
rc = fts3SelectLeaf(p, zTerm, nTerm, zRoot, nRoot, &iStartBlock, pi);
if( rc!=SQLITE_OK ) goto finished;
@@ -162158,7 +163195,6 @@ static int fts3RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){
Fts3Table *p = (Fts3Table*)pVtab;
UNUSED_PARAMETER(iSavepoint);
assert( p->inTransaction );
- assert( p->mxSavepoint >= iSavepoint );
TESTONLY( p->mxSavepoint = iSavepoint );
sqlite3Fts3PendingTermsClear(p);
return SQLITE_OK;
@@ -162933,9 +163969,10 @@ static int fts3EvalIncrPhraseNext(
if( bEof==0 ){
int nList = 0;
int nByte = a[p->nToken-1].nList;
- char *aDoclist = sqlite3_malloc(nByte+1);
+ char *aDoclist = sqlite3_malloc(nByte+FTS3_BUFFER_PADDING);
if( !aDoclist ) return SQLITE_NOMEM;
memcpy(aDoclist, a[p->nToken-1].pList, nByte+1);
+ memset(&aDoclist[nByte], 0, FTS3_BUFFER_PADDING);
for(i=0; i<(p->nToken-1); i++){
if( a[i].bIgnore==0 ){
@@ -163326,7 +164363,7 @@ static int fts3EvalStart(Fts3Cursor *pCsr){
if( rc==SQLITE_OK && nToken>1 && pTab->bFts4 ){
Fts3TokenAndCost *aTC;
Fts3Expr **apOr;
- aTC = (Fts3TokenAndCost *)sqlite3_malloc(
+ aTC = (Fts3TokenAndCost *)sqlite3_malloc64(
sizeof(Fts3TokenAndCost) * nToken
+ sizeof(Fts3Expr *) * nOr * 2
);
@@ -163637,7 +164674,7 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){
&& (pExpr->pParent==0 || pExpr->pParent->eType!=FTSQUERY_NEAR)
){
Fts3Expr *p;
- int nTmp = 0; /* Bytes of temp space */
+ sqlite3_int64 nTmp = 0; /* Bytes of temp space */
char *aTmp; /* Temp space for PoslistNearMerge() */
/* Allocate temporary working space. */
@@ -163646,7 +164683,7 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){
nTmp += p->pRight->pPhrase->doclist.nList;
}
nTmp += p->pPhrase->doclist.nList;
- aTmp = sqlite3_malloc(nTmp*2);
+ aTmp = sqlite3_malloc64(nTmp*2);
if( !aTmp ){
*pRc = SQLITE_NOMEM;
res = 0;
@@ -163916,15 +164953,14 @@ static void fts3EvalRestart(
** found in Fts3Expr.pPhrase->doclist.pList for each of the phrase
** expression nodes.
*/
-static void fts3EvalUpdateCounts(Fts3Expr *pExpr){
+static void fts3EvalUpdateCounts(Fts3Expr *pExpr, int nCol){
if( pExpr ){
Fts3Phrase *pPhrase = pExpr->pPhrase;
if( pPhrase && pPhrase->doclist.pList ){
int iCol = 0;
char *p = pPhrase->doclist.pList;
- assert( *p );
- while( 1 ){
+ do{
u8 c = 0;
int iCnt = 0;
while( 0xFE & (*p | c) ){
@@ -163940,11 +164976,11 @@ static void fts3EvalUpdateCounts(Fts3Expr *pExpr){
if( *p==0x00 ) break;
p++;
p += fts3GetVarint32(p, &iCol);
- }
+ }while( iCol<nCol );
}
- fts3EvalUpdateCounts(pExpr->pLeft);
- fts3EvalUpdateCounts(pExpr->pRight);
+ fts3EvalUpdateCounts(pExpr->pLeft, nCol);
+ fts3EvalUpdateCounts(pExpr->pRight, nCol);
}
}
@@ -163988,7 +165024,7 @@ static int fts3EvalGatherStats(
for(p=pRoot; p; p=p->pLeft){
Fts3Expr *pE = (p->eType==FTSQUERY_PHRASE?p:p->pRight);
assert( pE->aMI==0 );
- pE->aMI = (u32 *)sqlite3_malloc(pTab->nColumn * 3 * sizeof(u32));
+ pE->aMI = (u32 *)sqlite3_malloc64(pTab->nColumn * 3 * sizeof(u32));
if( !pE->aMI ) return SQLITE_NOMEM;
memset(pE->aMI, 0, pTab->nColumn * 3 * sizeof(u32));
}
@@ -164014,7 +165050,7 @@ static int fts3EvalGatherStats(
);
if( rc==SQLITE_OK && pCsr->isEof==0 ){
- fts3EvalUpdateCounts(pRoot);
+ fts3EvalUpdateCounts(pRoot, pTab->nColumn);
}
}
@@ -164364,7 +165400,7 @@ static int fts3auxConnectMethod(
char const *zFts3; /* Name of fts3 table */
int nDb; /* Result of strlen(zDb) */
int nFts3; /* Result of strlen(zFts3) */
- int nByte; /* Bytes of space to allocate here */
+ sqlite3_int64 nByte; /* Bytes of space to allocate here */
int rc; /* value returned by declare_vtab() */
Fts3auxTable *p; /* Virtual table object to return */
@@ -164396,7 +165432,7 @@ static int fts3auxConnectMethod(
if( rc!=SQLITE_OK ) return rc;
nByte = sizeof(Fts3auxTable) + sizeof(Fts3Table) + nDb + nFts3 + 2;
- p = (Fts3auxTable *)sqlite3_malloc(nByte);
+ p = (Fts3auxTable *)sqlite3_malloc64(nByte);
if( !p ) return SQLITE_NOMEM;
memset(p, 0, nByte);
@@ -164546,7 +165582,7 @@ static int fts3auxCloseMethod(sqlite3_vtab_cursor *pCursor){
static int fts3auxGrowStatArray(Fts3auxCursor *pCsr, int nSize){
if( nSize>pCsr->nStat ){
struct Fts3auxColstats *aNew;
- aNew = (struct Fts3auxColstats *)sqlite3_realloc(pCsr->aStat,
+ aNew = (struct Fts3auxColstats *)sqlite3_realloc64(pCsr->aStat,
sizeof(struct Fts3auxColstats) * nSize
);
if( aNew==0 ) return SQLITE_NOMEM;
@@ -164714,15 +165750,15 @@ static int fts3auxFilterMethod(
assert( (iEq==0 && iGe==-1) || (iEq==-1 && iGe==0) );
if( zStr ){
pCsr->filter.zTerm = sqlite3_mprintf("%s", zStr);
- pCsr->filter.nTerm = sqlite3_value_bytes(apVal[0]);
if( pCsr->filter.zTerm==0 ) return SQLITE_NOMEM;
+ pCsr->filter.nTerm = (int)strlen(pCsr->filter.zTerm);
}
}
if( iLe>=0 ){
pCsr->zStop = sqlite3_mprintf("%s", sqlite3_value_text(apVal[iLe]));
- pCsr->nStop = sqlite3_value_bytes(apVal[iLe]);
if( pCsr->zStop==0 ) return SQLITE_NOMEM;
+ pCsr->nStop = (int)strlen(pCsr->zStop);
}
if( iLangid>=0 ){
@@ -164974,8 +166010,8 @@ static int fts3isspace(char c){
** zero the memory before returning a pointer to it. If unsuccessful,
** return NULL.
*/
-static void *fts3MallocZero(int nByte){
- void *pRet = sqlite3_malloc(nByte);
+static void *fts3MallocZero(sqlite3_int64 nByte){
+ void *pRet = sqlite3_malloc64(nByte);
if( pRet ) memset(pRet, 0, nByte);
return pRet;
}
@@ -165050,7 +166086,7 @@ static int getNextToken(
if( rc==SQLITE_OK ){
const char *zToken;
int nToken = 0, iStart = 0, iEnd = 0, iPosition = 0;
- int nByte; /* total space to allocate */
+ sqlite3_int64 nByte; /* total space to allocate */
rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition);
if( rc==SQLITE_OK ){
@@ -165104,8 +166140,8 @@ static int getNextToken(
** Enlarge a memory allocation. If an out-of-memory allocation occurs,
** then free the old allocation.
*/
-static void *fts3ReallocOrFree(void *pOrig, int nNew){
- void *pRet = sqlite3_realloc(pOrig, nNew);
+static void *fts3ReallocOrFree(void *pOrig, sqlite3_int64 nNew){
+ void *pRet = sqlite3_realloc64(pOrig, nNew);
if( !pRet ){
sqlite3_free(pOrig);
}
@@ -165349,7 +166385,6 @@ static int getNextNode(
int nConsumed = 0;
pParse->nNest++;
rc = fts3ExprParse(pParse, zInput+1, nInput-1, ppExpr, &nConsumed);
- if( rc==SQLITE_OK && !*ppExpr ){ rc = SQLITE_DONE; }
*pnConsumed = (int)(zInput - z) + 1 + nConsumed;
return rc;
}else if( *zInput==')' ){
@@ -165648,7 +166683,7 @@ static int fts3ExprBalance(Fts3Expr **pp, int nMaxDepth){
if( rc==SQLITE_OK ){
if( (eType==FTSQUERY_AND || eType==FTSQUERY_OR) ){
Fts3Expr **apLeaf;
- apLeaf = (Fts3Expr **)sqlite3_malloc(sizeof(Fts3Expr *) * nMaxDepth);
+ apLeaf = (Fts3Expr **)sqlite3_malloc64(sizeof(Fts3Expr *) * nMaxDepth);
if( 0==apLeaf ){
rc = SQLITE_NOMEM;
}else{
@@ -166068,7 +167103,7 @@ static void fts3ExprTestCommon(
zExpr = (const char *)sqlite3_value_text(argv[1]);
nExpr = sqlite3_value_bytes(argv[1]);
nCol = argc-2;
- azCol = (char **)sqlite3_malloc(nCol*sizeof(char *));
+ azCol = (char **)sqlite3_malloc64(nCol*sizeof(char *));
if( !azCol ){
sqlite3_result_error_nomem(context);
goto exprtest_out;
@@ -166182,8 +167217,8 @@ SQLITE_PRIVATE int sqlite3Fts3ExprInitTestInterface(sqlite3 *db, Fts3Hash *pHash
/*
** Malloc and Free functions
*/
-static void *fts3HashMalloc(int n){
- void *p = sqlite3_malloc(n);
+static void *fts3HashMalloc(sqlite3_int64 n){
+ void *p = sqlite3_malloc64(n);
if( p ){
memset(p, 0, n);
}
@@ -168076,7 +169111,7 @@ static int fts3tokDequoteArray(
nByte += (int)(strlen(argv[i]) + 1);
}
- *pazDequote = azDequote = sqlite3_malloc(sizeof(char *)*argc + nByte);
+ *pazDequote = azDequote = sqlite3_malloc64(sizeof(char *)*argc + nByte);
if( azDequote==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -168808,10 +169843,12 @@ static int fts3SqlStmt(
pStmt = p->aStmt[eStmt];
if( !pStmt ){
+ int f = SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_NO_VTAB;
char *zSql;
if( eStmt==SQL_CONTENT_INSERT ){
zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName, p->zWriteExprlist);
}else if( eStmt==SQL_SELECT_CONTENT_BY_ROWID ){
+ f &= ~SQLITE_PREPARE_NO_VTAB;
zSql = sqlite3_mprintf(azSql[eStmt], p->zReadExprlist);
}else{
zSql = sqlite3_mprintf(azSql[eStmt], p->zDb, p->zName);
@@ -168819,8 +169856,7 @@ static int fts3SqlStmt(
if( !zSql ){
rc = SQLITE_NOMEM;
}else{
- rc = sqlite3_prepare_v3(p->db, zSql, -1, SQLITE_PREPARE_PERSISTENT,
- &pStmt, NULL);
+ rc = sqlite3_prepare_v3(p->db, zSql, -1, f, &pStmt, NULL);
sqlite3_free(zSql);
assert( rc==SQLITE_OK || pStmt==0 );
p->aStmt[eStmt] = pStmt;
@@ -168978,7 +170014,7 @@ static sqlite3_int64 getAbsoluteLevel(
int iLevel /* Level of segments */
){
sqlite3_int64 iBase; /* First absolute level for iLangid/iIndex */
- assert( iLangid>=0 );
+ assert_fts3_nc( iLangid>=0 );
assert( p->nIndex>0 );
assert( iIndex>=0 && iIndex<p->nIndex );
@@ -169820,7 +170856,7 @@ static int fts3SegReaderNext(
** b-tree node. And that the final byte of the doclist is 0x00. If either
** of these statements is untrue, then the data structure is corrupt.
*/
- if( (&pReader->aNode[pReader->nNode] - pReader->aDoclist)<pReader->nDoclist
+ if( pReader->nDoclist > pReader->nNode-(pReader->aDoclist-pReader->aNode)
|| (pReader->nPopulate==0 && pReader->aDoclist[pReader->nDoclist-1])
){
return FTS_CORRUPT_VTAB;
@@ -170020,8 +171056,13 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew(
Fts3SegReader *pReader; /* Newly allocated SegReader object */
int nExtra = 0; /* Bytes to allocate segment root node */
- assert( iStartLeaf<=iEndLeaf );
+ assert( zRoot!=0 || nRoot==0 );
+#ifdef CORRUPT_DB
+ assert( zRoot!=0 || CORRUPT_DB );
+#endif
+
if( iStartLeaf==0 ){
+ if( iEndLeaf!=0 ) return FTS_CORRUPT_VTAB;
nExtra = nRoot + FTS3_NODE_PADDING;
}
@@ -170041,7 +171082,7 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderNew(
pReader->aNode = (char *)&pReader[1];
pReader->rootOnly = 1;
pReader->nNode = nRoot;
- memcpy(pReader->aNode, zRoot, nRoot);
+ if( nRoot ) memcpy(pReader->aNode, zRoot, nRoot);
memset(&pReader->aNode[nRoot], 0, FTS3_NODE_PADDING);
}else{
pReader->iCurrentBlock = iStartLeaf-1;
@@ -170661,6 +171702,11 @@ static int fts3SegWriterAdd(
nPrefix = fts3PrefixCompress(pWriter->zTerm, pWriter->nTerm, zTerm, nTerm);
nSuffix = nTerm-nPrefix;
+ /* If nSuffix is zero or less, then zTerm/nTerm must be a prefix of
+ ** pWriter->zTerm/pWriter->nTerm. i.e. must be equal to or less than when
+ ** compared with BINARY collation. This indicates corruption. */
+ if( nSuffix<=0 ) return FTS_CORRUPT_VTAB;
+
/* Figure out how many bytes are required by this new entry */
nReq = sqlite3Fts3VarintLen(nPrefix) + /* varint containing prefix size */
sqlite3Fts3VarintLen(nSuffix) + /* varint containing suffix size */
@@ -171368,7 +172414,9 @@ SQLITE_PRIVATE int sqlite3Fts3SegReaderStep(
}else{
iDelta = iDocid - iPrev;
}
- assert( iDelta>0 || (nDoclist==0 && iDelta==iDocid) );
+ if( iDelta<=0 && (nDoclist>0 || iDelta!=iDocid) ){
+ return FTS_CORRUPT_VTAB;
+ }
assert( nDoclist>0 || iDelta==iDocid );
nByte = sqlite3Fts3VarintLen(iDelta) + (isRequirePos?nList+1:0);
@@ -171734,14 +172782,16 @@ static void fts3DecodeIntArray(
const char *zBuf, /* The BLOB containing the varints */
int nBuf /* size of the BLOB */
){
- int i, j;
- UNUSED_PARAMETER(nBuf);
- for(i=j=0; i<N; i++){
- sqlite3_int64 x;
- j += sqlite3Fts3GetVarint(&zBuf[j], &x);
- assert(j<=nBuf);
- a[i] = (u32)(x & 0xffffffff);
+ int i = 0;
+ if( nBuf && (zBuf[nBuf-1]&0x80)==0 ){
+ int j;
+ for(i=j=0; i<N && j<nBuf; i++){
+ sqlite3_int64 x;
+ j += sqlite3Fts3GetVarint(&zBuf[j], &x);
+ a[i] = (u32)(x & 0xffffffff);
+ }
}
+ while( i<N ) a[i++] = 0;
}
/*
@@ -172147,7 +173197,7 @@ static int nodeReaderNext(NodeReader *p){
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &nSuffix);
if( nPrefix>p->iOff || nSuffix>p->nNode-p->iOff ){
- return SQLITE_CORRUPT_VTAB;
+ return FTS_CORRUPT_VTAB;
}
blobGrowBuffer(&p->term, nPrefix+nSuffix, &rc);
if( rc==SQLITE_OK ){
@@ -172157,7 +173207,7 @@ static int nodeReaderNext(NodeReader *p){
if( p->iChild==0 ){
p->iOff += fts3GetVarint32(&p->aNode[p->iOff], &p->nDoclist);
if( (p->nNode-p->iOff)<p->nDoclist ){
- return SQLITE_CORRUPT_VTAB;
+ return FTS_CORRUPT_VTAB;
}
p->aDoclist = &p->aNode[p->iOff];
p->iOff += p->nDoclist;
@@ -174287,7 +175337,7 @@ static void (*fts3MIBufferAlloc(MatchinfoBuffer *p, u32 **paOut))(void*){
aOut = &p->aMatchinfo[p->nElem+2];
xRet = fts3MIBufferFree;
}else{
- aOut = (u32*)sqlite3_malloc(p->nElem * sizeof(u32));
+ aOut = (u32*)sqlite3_malloc64(p->nElem * sizeof(u32));
if( aOut ){
xRet = sqlite3_free;
if( p->bGlobal ) memcpy(aOut, &p->aMatchinfo[1], p->nElem*sizeof(u32));
@@ -174542,7 +175592,8 @@ static void fts3SnippetDetails(
int j;
u64 mPhrase = (u64)1 << i;
u64 mPos = (u64)1 << (iCsr - iStart);
- assert( iCsr>=iStart );
+ assert( iCsr>=iStart && (iCsr - iStart)<=64 );
+ assert( i>=0 && i<=64 );
if( (mCover|mCovered)&mPhrase ){
iScore++;
}else{
@@ -174584,11 +175635,14 @@ static int fts3SnippetFindPositions(Fts3Expr *pExpr, int iPhrase, void *ctx){
int iFirst = 0;
pPhrase->pList = pCsr;
fts3GetDeltaPosition(&pCsr, &iFirst);
- assert( iFirst>=0 );
- pPhrase->pHead = pCsr;
- pPhrase->pTail = pCsr;
- pPhrase->iHead = iFirst;
- pPhrase->iTail = iFirst;
+ if( iFirst<0 ){
+ rc = FTS_CORRUPT_VTAB;
+ }else{
+ pPhrase->pHead = pCsr;
+ pPhrase->pTail = pCsr;
+ pPhrase->iHead = iFirst;
+ pPhrase->iTail = iFirst;
+ }
}else{
assert( rc!=SQLITE_OK || (
pPhrase->pList==0 && pPhrase->pHead==0 && pPhrase->pTail==0
@@ -174625,7 +175679,7 @@ static int fts3BestSnippet(
int rc; /* Return Code */
int nList; /* Number of phrases in expression */
SnippetIter sIter; /* Iterates through snippet candidates */
- int nByte; /* Number of bytes of space to allocate */
+ sqlite3_int64 nByte; /* Number of bytes of space to allocate */
int iBestScore = -1; /* Best snippet score found so far */
int i; /* Loop counter */
@@ -174643,7 +175697,7 @@ static int fts3BestSnippet(
** the required space using malloc().
*/
nByte = sizeof(SnippetPhrase) * nList;
- sIter.aPhrase = (SnippetPhrase *)sqlite3_malloc(nByte);
+ sIter.aPhrase = (SnippetPhrase *)sqlite3_malloc64(nByte);
if( !sIter.aPhrase ){
return SQLITE_NOMEM;
}
@@ -174713,8 +175767,8 @@ static int fts3StringAppend(
** appended data.
*/
if( pStr->n+nAppend+1>=pStr->nAlloc ){
- int nAlloc = pStr->nAlloc+nAppend+100;
- char *zNew = sqlite3_realloc(pStr->z, nAlloc);
+ sqlite3_int64 nAlloc = pStr->nAlloc+(sqlite3_int64)nAppend+100;
+ char *zNew = sqlite3_realloc64(pStr->z, nAlloc);
if( !zNew ){
return SQLITE_NOMEM;
}
@@ -174769,6 +175823,7 @@ static int fts3SnippetShift(
for(nLeft=0; !(hlmask & ((u64)1 << nLeft)); nLeft++);
for(nRight=0; !(hlmask & ((u64)1 << (nSnippet-1-nRight))); nRight++);
+ assert( (nSnippet-1-nRight)<=63 && (nSnippet-1-nRight)>=0 );
nDesired = (nLeft-nRight)/2;
/* Ideally, the start of the snippet should be pushed forward in the
@@ -174961,7 +176016,7 @@ static int fts3ColumnlistCount(char **ppCollist){
/*
** This function gathers 'y' or 'b' data for a single phrase.
*/
-static void fts3ExprLHits(
+static int fts3ExprLHits(
Fts3Expr *pExpr, /* Phrase expression node */
MatchInfo *p /* Matchinfo context */
){
@@ -174991,25 +176046,29 @@ static void fts3ExprLHits(
if( *pIter!=0x01 ) break;
pIter++;
pIter += fts3GetVarint32(pIter, &iCol);
+ if( iCol>=p->nCol ) return FTS_CORRUPT_VTAB;
}
+ return SQLITE_OK;
}
/*
** Gather the results for matchinfo directives 'y' and 'b'.
*/
-static void fts3ExprLHitGather(
+static int fts3ExprLHitGather(
Fts3Expr *pExpr,
MatchInfo *p
){
+ int rc = SQLITE_OK;
assert( (pExpr->pLeft==0)==(pExpr->pRight==0) );
if( pExpr->bEof==0 && pExpr->iDocid==p->pCursor->iPrevId ){
if( pExpr->pLeft ){
- fts3ExprLHitGather(pExpr->pLeft, p);
- fts3ExprLHitGather(pExpr->pRight, p);
+ rc = fts3ExprLHitGather(pExpr->pLeft, p);
+ if( rc==SQLITE_OK ) rc = fts3ExprLHitGather(pExpr->pRight, p);
}else{
- fts3ExprLHits(pExpr, p);
+ rc = fts3ExprLHits(pExpr, p);
}
}
+ return rc;
}
/*
@@ -175226,11 +176285,12 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){
int i;
int iCol;
int nToken = 0;
+ int rc = SQLITE_OK;
/* Allocate and populate the array of LcsIterator objects. The array
** contains one element for each matchable phrase in the query.
**/
- aIter = sqlite3_malloc(sizeof(LcsIterator) * pCsr->nPhrase);
+ aIter = sqlite3_malloc64(sizeof(LcsIterator) * pCsr->nPhrase);
if( !aIter ) return SQLITE_NOMEM;
memset(aIter, 0, sizeof(LcsIterator) * pCsr->nPhrase);
(void)fts3ExprIterate(pCsr->pExpr, fts3MatchinfoLcsCb, (void*)aIter);
@@ -175246,13 +176306,16 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){
int nLive = 0; /* Number of iterators in aIter not at EOF */
for(i=0; i<pInfo->nPhrase; i++){
- int rc;
LcsIterator *pIt = &aIter[i];
rc = sqlite3Fts3EvalPhrasePoslist(pCsr, pIt->pExpr, iCol, &pIt->pRead);
- if( rc!=SQLITE_OK ) return rc;
+ if( rc!=SQLITE_OK ) goto matchinfo_lcs_out;
if( pIt->pRead ){
pIt->iPos = pIt->iPosOffset;
- fts3LcsIteratorAdvance(&aIter[i]);
+ fts3LcsIteratorAdvance(pIt);
+ if( pIt->pRead==0 ){
+ rc = FTS_CORRUPT_VTAB;
+ goto matchinfo_lcs_out;
+ }
nLive++;
}
}
@@ -175284,8 +176347,9 @@ static int fts3MatchinfoLcs(Fts3Cursor *pCsr, MatchInfo *pInfo){
pInfo->aMatchinfo[iCol] = nLcs;
}
+ matchinfo_lcs_out:
sqlite3_free(aIter);
- return SQLITE_OK;
+ return rc;
}
/*
@@ -175381,7 +176445,7 @@ static int fts3MatchinfoValues(
case FTS3_MATCHINFO_LHITS: {
int nZero = fts3MatchinfoSize(pInfo, zArg[i]) * sizeof(u32);
memset(pInfo->aMatchinfo, 0, nZero);
- fts3ExprLHitGather(pCsr->pExpr, pInfo);
+ rc = fts3ExprLHitGather(pCsr->pExpr, pInfo);
break;
}
@@ -175533,6 +176597,10 @@ SQLITE_PRIVATE void sqlite3Fts3Snippet(
return;
}
+ /* Limit the snippet length to 64 tokens. */
+ if( nToken<-64 ) nToken = -64;
+ if( nToken>+64 ) nToken = +64;
+
for(nSnippet=1; 1; nSnippet++){
int iSnip; /* Loop counter 0..nSnippet-1 */
@@ -175675,7 +176743,7 @@ SQLITE_PRIVATE void sqlite3Fts3Offsets(
if( rc!=SQLITE_OK ) goto offsets_out;
/* Allocate the array of TermOffset iterators. */
- sCtx.aTerm = (TermOffset *)sqlite3_malloc(sizeof(TermOffset)*nToken);
+ sCtx.aTerm = (TermOffset *)sqlite3_malloc64(sizeof(TermOffset)*nToken);
if( 0==sCtx.aTerm ){
rc = SQLITE_NOMEM;
goto offsets_out;
@@ -175900,7 +176968,7 @@ typedef struct unicode_cursor unicode_cursor;
struct unicode_tokenizer {
sqlite3_tokenizer base;
- int bRemoveDiacritic;
+ int eRemoveDiacritic;
int nException;
int *aiException;
};
@@ -175973,7 +177041,7 @@ static int unicodeAddExceptions(
int *aNew; /* New aiException[] array */
int nNew; /* Number of valid entries in array aNew[] */
- aNew = sqlite3_realloc(p->aiException, (p->nException+nEntry)*sizeof(int));
+ aNew = sqlite3_realloc64(p->aiException,(p->nException+nEntry)*sizeof(int));
if( aNew==0 ) return SQLITE_NOMEM;
nNew = p->nException;
@@ -176045,17 +177113,20 @@ static int unicodeCreate(
pNew = (unicode_tokenizer *) sqlite3_malloc(sizeof(unicode_tokenizer));
if( pNew==NULL ) return SQLITE_NOMEM;
memset(pNew, 0, sizeof(unicode_tokenizer));
- pNew->bRemoveDiacritic = 1;
+ pNew->eRemoveDiacritic = 1;
for(i=0; rc==SQLITE_OK && i<nArg; i++){
const char *z = azArg[i];
int n = (int)strlen(z);
if( n==19 && memcmp("remove_diacritics=1", z, 19)==0 ){
- pNew->bRemoveDiacritic = 1;
+ pNew->eRemoveDiacritic = 1;
}
else if( n==19 && memcmp("remove_diacritics=0", z, 19)==0 ){
- pNew->bRemoveDiacritic = 0;
+ pNew->eRemoveDiacritic = 0;
+ }
+ else if( n==19 && memcmp("remove_diacritics=2", z, 19)==0 ){
+ pNew->eRemoveDiacritic = 2;
}
else if( n>=11 && memcmp("tokenchars=", z, 11)==0 ){
rc = unicodeAddExceptions(pNew, 1, &z[11], n-11);
@@ -176159,7 +177230,7 @@ static int unicodeNext(
/* Grow the output buffer if required. */
if( (zOut-pCsr->zToken)>=(pCsr->nAlloc-4) ){
- char *zNew = sqlite3_realloc(pCsr->zToken, pCsr->nAlloc+64);
+ char *zNew = sqlite3_realloc64(pCsr->zToken, pCsr->nAlloc+64);
if( !zNew ) return SQLITE_NOMEM;
zOut = &zNew[zOut - pCsr->zToken];
pCsr->zToken = zNew;
@@ -176168,7 +177239,7 @@ static int unicodeNext(
/* Write the folded case of the last character read to the output */
zEnd = z;
- iOut = sqlite3FtsUnicodeFold((int)iCode, p->bRemoveDiacritic);
+ iOut = sqlite3FtsUnicodeFold((int)iCode, p->eRemoveDiacritic);
if( iOut ){
WRITE_UTF8(zOut, iOut);
}
@@ -176213,7 +177284,7 @@ SQLITE_PRIVATE void sqlite3Fts3UnicodeTokenizer(sqlite3_tokenizer_module const *
/************** End of fts3_unicode.c ****************************************/
/************** Begin file fts3_unicode2.c ***********************************/
/*
-** 2012 May 25
+** 2012-05-25
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
@@ -176373,32 +177444,48 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsalnum(int c){
** E"). The resuls of passing a codepoint that corresponds to an
** uppercase letter are undefined.
*/
-static int remove_diacritic(int c){
+static int remove_diacritic(int c, int bComplex){
unsigned short aDia[] = {
0, 1797, 1848, 1859, 1891, 1928, 1940, 1995,
2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286,
2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732,
2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336,
- 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928,
- 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234,
- 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504,
- 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529,
- 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726,
- 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122,
- 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536,
- 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730,
- 62924, 63050, 63082, 63274, 63390,
+ 3456, 3696, 3712, 3728, 3744, 3766, 3832, 3896,
+ 3912, 3928, 3944, 3968, 4008, 4040, 4056, 4106,
+ 4138, 4170, 4202, 4234, 4266, 4296, 4312, 4344,
+ 4408, 4424, 4442, 4472, 4488, 4504, 6148, 6198,
+ 6264, 6280, 6360, 6429, 6505, 6529, 61448, 61468,
+ 61512, 61534, 61592, 61610, 61642, 61672, 61688, 61704,
+ 61726, 61784, 61800, 61816, 61836, 61880, 61896, 61914,
+ 61948, 61998, 62062, 62122, 62154, 62184, 62200, 62218,
+ 62252, 62302, 62364, 62410, 62442, 62478, 62536, 62554,
+ 62584, 62604, 62640, 62648, 62656, 62664, 62730, 62766,
+ 62830, 62890, 62924, 62974, 63032, 63050, 63082, 63118,
+ 63182, 63242, 63274, 63310, 63368, 63390,
};
- char aChar[] = {
- '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c',
- 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r',
- 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o',
- 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r',
- 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0',
- '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h',
- 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't',
- 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a',
- 'e', 'i', 'o', 'u', 'y',
+#define HIBIT ((unsigned char)0x80)
+ unsigned char aChar[] = {
+ '\0', 'a', 'c', 'e', 'i', 'n',
+ 'o', 'u', 'y', 'y', 'a', 'c',
+ 'd', 'e', 'e', 'g', 'h', 'i',
+ 'j', 'k', 'l', 'n', 'o', 'r',
+ 's', 't', 'u', 'u', 'w', 'y',
+ 'z', 'o', 'u', 'a', 'i', 'o',
+ 'u', 'u'|HIBIT, 'a'|HIBIT, 'g', 'k', 'o',
+ 'o'|HIBIT, 'j', 'g', 'n', 'a'|HIBIT, 'a',
+ 'e', 'i', 'o', 'r', 'u', 's',
+ 't', 'h', 'a', 'e', 'o'|HIBIT, 'o',
+ 'o'|HIBIT, 'y', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', 'a', 'b',
+ 'c'|HIBIT, 'd', 'd', 'e'|HIBIT, 'e', 'e'|HIBIT,
+ 'f', 'g', 'h', 'h', 'i', 'i'|HIBIT,
+ 'k', 'l', 'l'|HIBIT, 'l', 'm', 'n',
+ 'o'|HIBIT, 'p', 'r', 'r'|HIBIT, 'r', 's',
+ 's'|HIBIT, 't', 'u', 'u'|HIBIT, 'v', 'w',
+ 'w', 'x', 'y', 'z', 'h', 't',
+ 'w', 'y', 'a', 'a'|HIBIT, 'a'|HIBIT, 'a'|HIBIT,
+ 'e', 'e'|HIBIT, 'e'|HIBIT, 'i', 'o', 'o'|HIBIT,
+ 'o'|HIBIT, 'o'|HIBIT, 'u', 'u'|HIBIT, 'u'|HIBIT, 'y',
};
unsigned int key = (((unsigned int)c)<<3) | 0x00000007;
@@ -176415,7 +177502,8 @@ static int remove_diacritic(int c){
}
}
assert( key>=aDia[iRes] );
- return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);
+ if( bComplex==0 && (aChar[iRes] & 0x80) ) return c;
+ return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F);
}
@@ -176428,8 +177516,8 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsdiacritic(int c){
unsigned int mask1 = 0x000361F8;
if( c<768 || c>817 ) return 0;
return (c < 768+32) ?
- (mask0 & (1 << (c-768))) :
- (mask1 & (1 << (c-768-32)));
+ (mask0 & ((unsigned int)1 << (c-768))) :
+ (mask1 & ((unsigned int)1 << (c-768-32)));
}
@@ -176442,7 +177530,7 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeIsdiacritic(int c){
** The results are undefined if the value passed to this function
** is less than zero.
*/
-SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){
+SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int eRemoveDiacritic){
/* Each entry in the following array defines a rule for folding a range
** of codepoints to lower case. The rule applies to a range of nRange
** codepoints starting at codepoint iCode.
@@ -176565,7 +177653,9 @@ SQLITE_PRIVATE int sqlite3FtsUnicodeFold(int c, int bRemoveDiacritic){
assert( ret>0 );
}
- if( bRemoveDiacritic ) ret = remove_diacritic(ret);
+ if( eRemoveDiacritic ){
+ ret = remove_diacritic(ret, eRemoveDiacritic==2);
+ }
}
else if( c>=66560 && c<66600 ){
@@ -177272,7 +178362,7 @@ static JSON_NOINLINE int jsonParseAddNodeExpand(
assert( pParse->nNode>=pParse->nAlloc );
if( pParse->oom ) return -1;
nNew = pParse->nAlloc*2 + 10;
- pNew = sqlite3_realloc(pParse->aNode, sizeof(JsonNode)*nNew);
+ pNew = sqlite3_realloc64(pParse->aNode, sizeof(JsonNode)*nNew);
if( pNew==0 ){
pParse->oom = 1;
return -1;
@@ -177546,7 +178636,7 @@ static void jsonParseFillInParentage(JsonParse *pParse, u32 i, u32 iParent){
static int jsonParseFindParents(JsonParse *pParse){
u32 *aUp;
assert( pParse->aUp==0 );
- aUp = pParse->aUp = sqlite3_malloc( sizeof(u32)*pParse->nNode );
+ aUp = pParse->aUp = sqlite3_malloc64( sizeof(u32)*pParse->nNode );
if( aUp==0 ){
pParse->oom = 1;
return SQLITE_NOMEM;
@@ -177608,7 +178698,7 @@ static JsonParse *jsonParseCached(
pMatch->iHold = iMaxHold+1;
return pMatch;
}
- p = sqlite3_malloc( sizeof(*p) + nJson + 1 );
+ p = sqlite3_malloc64( sizeof(*p) + nJson + 1 );
if( p==0 ){
sqlite3_result_error_nomem(pCtx);
return 0;
@@ -179253,6 +180343,9 @@ struct Rtree {
u8 inWrTrans; /* True if inside write transaction */
u8 nAux; /* # of auxiliary columns in %_rowid */
u8 nAuxNotNull; /* Number of initial not-null aux columns */
+#ifdef SQLITE_DEBUG
+ u8 bCorrupt; /* Shadow table corruption detected */
+#endif
int iDepth; /* Current depth of the r-tree structure */
char *zDb; /* Name of database containing r-tree table */
char *zName; /* Name of r-tree table */
@@ -179313,6 +180406,15 @@ struct Rtree {
#endif
/*
+** Set the Rtree.bCorrupt flag
+*/
+#ifdef SQLITE_DEBUG
+# define RTREE_IS_CORRUPT(X) ((X)->bCorrupt = 1)
+#else
+# define RTREE_IS_CORRUPT(X)
+#endif
+
+/*
** When doing a search of an r-tree, instances of the following structure
** record intermediate results from the tree walk.
**
@@ -179678,8 +180780,8 @@ static void nodeZero(Rtree *pRtree, RtreeNode *p){
** Given a node number iNode, return the corresponding key to use
** in the Rtree.aHash table.
*/
-static int nodeHash(i64 iNode){
- return iNode % HASHSIZE;
+static unsigned int nodeHash(i64 iNode){
+ return ((unsigned)iNode) % HASHSIZE;
}
/*
@@ -179724,7 +180826,7 @@ static void nodeHashDelete(Rtree *pRtree, RtreeNode *pNode){
*/
static RtreeNode *nodeNew(Rtree *pRtree, RtreeNode *pParent){
RtreeNode *pNode;
- pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode) + pRtree->iNodeSize);
+ pNode = (RtreeNode *)sqlite3_malloc64(sizeof(RtreeNode) + pRtree->iNodeSize);
if( pNode ){
memset(pNode, 0, sizeof(RtreeNode) + pRtree->iNodeSize);
pNode->zData = (u8 *)&pNode[1];
@@ -179749,6 +180851,18 @@ static void nodeBlobReset(Rtree *pRtree){
}
/*
+** Check to see if pNode is the same as pParent or any of the parents
+** of pParent.
+*/
+static int nodeInParentChain(const RtreeNode *pNode, const RtreeNode *pParent){
+ do{
+ if( pNode==pParent ) return 1;
+ pParent = pParent->pParent;
+ }while( pParent );
+ return 0;
+}
+
+/*
** Obtain a reference to an r-tree node.
*/
static int nodeAcquire(
@@ -179766,6 +180880,10 @@ static int nodeAcquire(
if( (pNode = nodeHashLookup(pRtree, iNode))!=0 ){
assert( !pParent || !pNode->pParent || pNode->pParent==pParent );
if( pParent && !pNode->pParent ){
+ if( nodeInParentChain(pNode, pParent) ){
+ RTREE_IS_CORRUPT(pRtree);
+ return SQLITE_CORRUPT_VTAB;
+ }
pParent->nRef++;
pNode->pParent = pParent;
}
@@ -179796,9 +180914,12 @@ static int nodeAcquire(
*ppNode = 0;
/* If unable to open an sqlite3_blob on the desired row, that can only
** be because the shadow tables hold erroneous data. */
- if( rc==SQLITE_ERROR ) rc = SQLITE_CORRUPT_VTAB;
+ if( rc==SQLITE_ERROR ){
+ rc = SQLITE_CORRUPT_VTAB;
+ RTREE_IS_CORRUPT(pRtree);
+ }
}else if( pRtree->iNodeSize==sqlite3_blob_bytes(pRtree->pNodeBlob) ){
- pNode = (RtreeNode *)sqlite3_malloc(sizeof(RtreeNode)+pRtree->iNodeSize);
+ pNode = (RtreeNode *)sqlite3_malloc64(sizeof(RtreeNode)+pRtree->iNodeSize);
if( !pNode ){
rc = SQLITE_NOMEM;
}else{
@@ -179811,7 +180932,6 @@ static int nodeAcquire(
pNode->pNext = 0;
rc = sqlite3_blob_read(pRtree->pNodeBlob, pNode->zData,
pRtree->iNodeSize, 0);
- nodeReference(pParent);
}
}
@@ -179825,6 +180945,7 @@ static int nodeAcquire(
pRtree->iDepth = readInt16(pNode->zData);
if( pRtree->iDepth>RTREE_MAX_DEPTH ){
rc = SQLITE_CORRUPT_VTAB;
+ RTREE_IS_CORRUPT(pRtree);
}
}
@@ -179835,14 +180956,17 @@ static int nodeAcquire(
if( pNode && rc==SQLITE_OK ){
if( NCELL(pNode)>((pRtree->iNodeSize-4)/pRtree->nBytesPerCell) ){
rc = SQLITE_CORRUPT_VTAB;
+ RTREE_IS_CORRUPT(pRtree);
}
}
if( rc==SQLITE_OK ){
if( pNode!=0 ){
+ nodeReference(pParent);
nodeHashInsert(pRtree, pNode);
}else{
rc = SQLITE_CORRUPT_VTAB;
+ RTREE_IS_CORRUPT(pRtree);
}
*ppNode = pNode;
}else{
@@ -180068,7 +181192,7 @@ static void rtreeRelease(Rtree *pRtree){
pRtree->inWrTrans = 0;
assert( pRtree->nCursor==0 );
nodeBlobReset(pRtree);
- assert( pRtree->nNodeRef==0 );
+ assert( pRtree->nNodeRef==0 || pRtree->bCorrupt );
sqlite3_finalize(pRtree->pWriteNode);
sqlite3_finalize(pRtree->pDeleteNode);
sqlite3_finalize(pRtree->pReadRowid);
@@ -180127,7 +181251,7 @@ static int rtreeOpen(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCursor){
Rtree *pRtree = (Rtree *)pVTab;
RtreeCursor *pCsr;
- pCsr = (RtreeCursor *)sqlite3_malloc(sizeof(RtreeCursor));
+ pCsr = (RtreeCursor *)sqlite3_malloc64(sizeof(RtreeCursor));
if( pCsr ){
memset(pCsr, 0, sizeof(RtreeCursor));
pCsr->base.pVtab = pVTab;
@@ -180400,6 +181524,7 @@ static int nodeRowidIndex(
return SQLITE_OK;
}
}
+ RTREE_IS_CORRUPT(pRtree);
return SQLITE_CORRUPT_VTAB;
}
@@ -180493,7 +181618,7 @@ static RtreeSearchPoint *rtreeEnqueue(
RtreeSearchPoint *pNew;
if( pCur->nPoint>=pCur->nPointAlloc ){
int nNew = pCur->nPointAlloc*2 + 8;
- pNew = sqlite3_realloc(pCur->aPoint, nNew*sizeof(pCur->aPoint[0]));
+ pNew = sqlite3_realloc64(pCur->aPoint, nNew*sizeof(pCur->aPoint[0]));
if( pNew==0 ) return 0;
pCur->aPoint = pNew;
pCur->nPointAlloc = nNew;
@@ -180895,7 +182020,7 @@ static int rtreeFilter(
*/
rc = nodeAcquire(pRtree, 1, 0, &pRoot);
if( rc==SQLITE_OK && argc>0 ){
- pCsr->aConstraint = sqlite3_malloc(sizeof(RtreeConstraint)*argc);
+ pCsr->aConstraint = sqlite3_malloc64(sizeof(RtreeConstraint)*argc);
pCsr->nConstraint = argc;
if( !pCsr->aConstraint ){
rc = SQLITE_NOMEM;
@@ -181040,20 +182165,20 @@ static int rtreeBestIndex(sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo){
){
u8 op;
switch( p->op ){
- case SQLITE_INDEX_CONSTRAINT_EQ: op = RTREE_EQ; break;
- case SQLITE_INDEX_CONSTRAINT_GT: op = RTREE_GT; break;
- case SQLITE_INDEX_CONSTRAINT_LE: op = RTREE_LE; break;
- case SQLITE_INDEX_CONSTRAINT_LT: op = RTREE_LT; break;
- case SQLITE_INDEX_CONSTRAINT_GE: op = RTREE_GE; break;
- default:
- assert( p->op==SQLITE_INDEX_CONSTRAINT_MATCH );
- op = RTREE_MATCH;
- break;
+ case SQLITE_INDEX_CONSTRAINT_EQ: op = RTREE_EQ; break;
+ case SQLITE_INDEX_CONSTRAINT_GT: op = RTREE_GT; break;
+ case SQLITE_INDEX_CONSTRAINT_LE: op = RTREE_LE; break;
+ case SQLITE_INDEX_CONSTRAINT_LT: op = RTREE_LT; break;
+ case SQLITE_INDEX_CONSTRAINT_GE: op = RTREE_GE; break;
+ case SQLITE_INDEX_CONSTRAINT_MATCH: op = RTREE_MATCH; break;
+ default: op = 0; break;
+ }
+ if( op ){
+ zIdxStr[iIdx++] = op;
+ zIdxStr[iIdx++] = (char)(p->iColumn - 1 + '0');
+ pIdxInfo->aConstraintUsage[ii].argvIndex = (iIdx/2);
+ pIdxInfo->aConstraintUsage[ii].omit = 1;
}
- zIdxStr[iIdx++] = op;
- zIdxStr[iIdx++] = (char)(p->iColumn - 1 + '0');
- pIdxInfo->aConstraintUsage[ii].argvIndex = (iIdx/2);
- pIdxInfo->aConstraintUsage[ii].omit = 1;
}
}
@@ -181089,11 +182214,11 @@ static RtreeDValue cellArea(Rtree *pRtree, RtreeCell *p){
#endif
{
switch( pRtree->nDim ){
- case 5: area = p->aCoord[9].i - p->aCoord[8].i;
- case 4: area *= p->aCoord[7].i - p->aCoord[6].i;
- case 3: area *= p->aCoord[5].i - p->aCoord[4].i;
- case 2: area *= p->aCoord[3].i - p->aCoord[2].i;
- default: area *= p->aCoord[1].i - p->aCoord[0].i;
+ case 5: area = (i64)p->aCoord[9].i - (i64)p->aCoord[8].i;
+ case 4: area *= (i64)p->aCoord[7].i - (i64)p->aCoord[6].i;
+ case 3: area *= (i64)p->aCoord[5].i - (i64)p->aCoord[4].i;
+ case 2: area *= (i64)p->aCoord[3].i - (i64)p->aCoord[2].i;
+ default: area *= (i64)p->aCoord[1].i - (i64)p->aCoord[0].i;
}
}
return area;
@@ -181262,12 +182387,14 @@ static int AdjustTree(
RtreeCell *pCell /* This cell was just inserted */
){
RtreeNode *p = pNode;
+ int cnt = 0;
while( p->pParent ){
RtreeNode *pParent = p->pParent;
RtreeCell cell;
int iCell;
- if( nodeParentIndex(pRtree, p, &iCell) ){
+ if( (++cnt)>1000 || nodeParentIndex(pRtree, p, &iCell) ){
+ RTREE_IS_CORRUPT(pRtree);
return SQLITE_CORRUPT_VTAB;
}
@@ -181464,9 +182591,9 @@ static int splitNodeStartree(
int iBestSplit = 0;
RtreeDValue fBestMargin = RTREE_ZERO;
- int nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
+ sqlite3_int64 nByte = (pRtree->nDim+1)*(sizeof(int*)+nCell*sizeof(int));
- aaSorted = (int **)sqlite3_malloc(nByte);
+ aaSorted = (int **)sqlite3_malloc64(nByte);
if( !aaSorted ){
return SQLITE_NOMEM;
}
@@ -181587,7 +182714,7 @@ static int SplitNode(
/* Allocate an array and populate it with a copy of pCell and
** all cells from node pLeft. Then zero the original node.
*/
- aCell = sqlite3_malloc((sizeof(RtreeCell)+sizeof(int))*(nCell+1));
+ aCell = sqlite3_malloc64((sizeof(RtreeCell)+sizeof(int))*(nCell+1));
if( !aCell ){
rc = SQLITE_NOMEM;
goto splitnode_out;
@@ -181735,7 +182862,10 @@ static int fixLeafParent(Rtree *pRtree, RtreeNode *pLeaf){
}
rc = sqlite3_reset(pRtree->pReadParent);
if( rc==SQLITE_OK ) rc = rc2;
- if( rc==SQLITE_OK && !pChild->pParent ) rc = SQLITE_CORRUPT_VTAB;
+ if( rc==SQLITE_OK && !pChild->pParent ){
+ RTREE_IS_CORRUPT(pRtree);
+ rc = SQLITE_CORRUPT_VTAB;
+ }
pChild = pChild->pParent;
}
return rc;
@@ -181875,7 +183005,7 @@ static int Reinsert(
/* Allocate the buffers used by this operation. The allocation is
** relinquished before this function returns.
*/
- aCell = (RtreeCell *)sqlite3_malloc(n * (
+ aCell = (RtreeCell *)sqlite3_malloc64(n * (
sizeof(RtreeCell) + /* aCell array */
sizeof(int) + /* aOrder array */
sizeof(int) + /* aSpare array */
@@ -182049,8 +183179,12 @@ static int rtreeDeleteRowid(Rtree *pRtree, sqlite3_int64 iDelete){
rc = findLeafNode(pRtree, iDelete, &pLeaf, 0);
}
+#ifdef CORRUPT_DB
+ assert( pLeaf!=0 || rc!=SQLITE_OK || CORRUPT_DB );
+#endif
+
/* Delete the cell in question from the leaf node. */
- if( rc==SQLITE_OK ){
+ if( rc==SQLITE_OK && pLeaf ){
int rc2;
rc = nodeRowidIndex(pRtree, pLeaf, iDelete, &iCell);
if( rc==SQLITE_OK ){
@@ -182322,7 +183456,7 @@ static int rtreeUpdate(
rc = rc2;
}
}
- if( pRtree->nAux ){
+ if( rc==SQLITE_OK && pRtree->nAux ){
sqlite3_stmt *pUp = pRtree->pWriteAux;
int jj;
sqlite3_bind_int64(pUp, 1, *pRowid);
@@ -182520,6 +183654,7 @@ static int rtreeSqlInit(
};
sqlite3_stmt **appStmt[N_STATEMENT];
int i;
+ const int f = SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_NO_VTAB;
pRtree->db = db;
@@ -182576,8 +183711,7 @@ static int rtreeSqlInit(
}
zSql = sqlite3_mprintf(zFormat, zDb, zPrefix);
if( zSql ){
- rc = sqlite3_prepare_v3(db, zSql, -1, SQLITE_PREPARE_PERSISTENT,
- appStmt[i], 0);
+ rc = sqlite3_prepare_v3(db, zSql, -1, f, appStmt[i], 0);
}else{
rc = SQLITE_NOMEM;
}
@@ -182607,8 +183741,7 @@ static int rtreeSqlInit(
if( zSql==0 ){
rc = SQLITE_NOMEM;
}else{
- rc = sqlite3_prepare_v3(db, zSql, -1, SQLITE_PREPARE_PERSISTENT,
- &pRtree->pWriteAux, 0);
+ rc = sqlite3_prepare_v3(db, zSql, -1, f, &pRtree->pWriteAux, 0);
sqlite3_free(zSql);
}
}
@@ -182684,6 +183817,7 @@ static int getNodeSize(
*pzErr = sqlite3_mprintf("%s", sqlite3_errmsg(db));
}else if( pRtree->iNodeSize<(512-64) ){
rc = SQLITE_CORRUPT_VTAB;
+ RTREE_IS_CORRUPT(pRtree);
*pzErr = sqlite3_mprintf("undersize RTree blobs in \"%q_node\"",
pRtree->zName);
}
@@ -182739,7 +183873,7 @@ static int rtreeInit(
/* Allocate the sqlite3_vtab structure */
nDb = (int)strlen(argv[1]);
nName = (int)strlen(argv[2]);
- pRtree = (Rtree *)sqlite3_malloc(sizeof(Rtree)+nDb+nName+2);
+ pRtree = (Rtree *)sqlite3_malloc64(sizeof(Rtree)+nDb+nName+2);
if( !pRtree ){
return SQLITE_NOMEM;
}
@@ -183007,8 +184141,7 @@ static void rtreeCheckAppendMsg(RtreeCheck *pCheck, const char *zFmt, ...){
static u8 *rtreeCheckGetNode(RtreeCheck *pCheck, i64 iNode, int *pnNode){
u8 *pRet = 0; /* Return value */
- assert( pCheck->rc==SQLITE_OK );
- if( pCheck->pGetNode==0 ){
+ if( pCheck->rc==SQLITE_OK && pCheck->pGetNode==0 ){
pCheck->pGetNode = rtreeCheckPrepare(pCheck,
"SELECT data FROM %Q.'%q_node' WHERE nodeno=?",
pCheck->zDb, pCheck->zTab
@@ -183020,7 +184153,7 @@ static u8 *rtreeCheckGetNode(RtreeCheck *pCheck, i64 iNode, int *pnNode){
if( sqlite3_step(pCheck->pGetNode)==SQLITE_ROW ){
int nNode = sqlite3_column_bytes(pCheck->pGetNode, 0);
const u8 *pNode = (const u8*)sqlite3_column_blob(pCheck->pGetNode, 0);
- pRet = sqlite3_malloc(nNode);
+ pRet = sqlite3_malloc64(nNode);
if( pRet==0 ){
pCheck->rc = SQLITE_NOMEM;
}else{
@@ -183499,6 +184632,14 @@ struct GeoPoly {
*/
#define GEOPOLY_SZ(N) (sizeof(GeoPoly) + sizeof(GeoCoord)*2*((N)-4))
+/* Macros to access coordinates of a GeoPoly.
+** We have to use these macros, rather than just say p->a[i] in order
+** to silence (incorrect) UBSAN warnings if the array index is too large.
+*/
+#define GeoX(P,I) (((GeoCoord*)(P)->a)[(I)*2])
+#define GeoY(P,I) (((GeoCoord*)(P)->a)[(I)*2+1])
+
+
/*
** State of a parse of a GeoJSON input.
*/
@@ -183691,8 +184832,9 @@ static GeoPoly *geopolyFuncParam(
memcpy(p->hdr, a, nByte);
if( a[0] != *(unsigned char*)&x ){
int ii;
- for(ii=0; ii<nVertex*2; ii++){
- geopolySwab32((unsigned char*)&p->a[ii]);
+ for(ii=0; ii<nVertex; ii++){
+ geopolySwab32((unsigned char*)&GeoX(p,ii));
+ geopolySwab32((unsigned char*)&GeoY(p,ii));
}
p->hdr[0] ^= 1;
}
@@ -183751,9 +184893,9 @@ static void geopolyJsonFunc(
int i;
sqlite3_str_append(x, "[", 1);
for(i=0; i<p->nVertex; i++){
- sqlite3_str_appendf(x, "[%!g,%!g],", p->a[i*2], p->a[i*2+1]);
+ sqlite3_str_appendf(x, "[%!g,%!g],", GeoX(p,i), GeoY(p,i));
}
- sqlite3_str_appendf(x, "[%!g,%!g]]", p->a[0], p->a[1]);
+ sqlite3_str_appendf(x, "[%!g,%!g]]", GeoX(p,0), GeoY(p,0));
sqlite3_result_text(context, sqlite3_str_finish(x), -1, sqlite3_free);
sqlite3_free(p);
}
@@ -183770,7 +184912,9 @@ static void geopolySvgFunc(
int argc,
sqlite3_value **argv
){
- GeoPoly *p = geopolyFuncParam(context, argv[0], 0);
+ GeoPoly *p;
+ if( argc<1 ) return;
+ p = geopolyFuncParam(context, argv[0], 0);
if( p ){
sqlite3 *db = sqlite3_context_db_handle(context);
sqlite3_str *x = sqlite3_str_new(db);
@@ -183778,10 +184922,10 @@ static void geopolySvgFunc(
char cSep = '\'';
sqlite3_str_appendf(x, "<polyline points=");
for(i=0; i<p->nVertex; i++){
- sqlite3_str_appendf(x, "%c%g,%g", cSep, p->a[i*2], p->a[i*2+1]);
+ sqlite3_str_appendf(x, "%c%g,%g", cSep, GeoX(p,i), GeoY(p,i));
cSep = ' ';
}
- sqlite3_str_appendf(x, " %g,%g'", p->a[0], p->a[1]);
+ sqlite3_str_appendf(x, " %g,%g'", GeoX(p,0), GeoY(p,0));
for(i=1; i<argc; i++){
const char *z = (const char*)sqlite3_value_text(argv[i]);
if( z && z[0] ){
@@ -183826,12 +184970,12 @@ static void geopolyXformFunc(
int ii;
if( p ){
for(ii=0; ii<p->nVertex; ii++){
- x0 = p->a[ii*2];
- y0 = p->a[ii*2+1];
+ x0 = GeoX(p,ii);
+ y0 = GeoY(p,ii);
x1 = (GeoCoord)(A*x0 + B*y0 + E);
y1 = (GeoCoord)(C*x0 + D*y0 + F);
- p->a[ii*2] = x1;
- p->a[ii*2+1] = y1;
+ GeoX(p,ii) = x1;
+ GeoY(p,ii) = y1;
}
sqlite3_result_blob(context, p->hdr,
4+8*p->nVertex, SQLITE_TRANSIENT);
@@ -183850,12 +184994,12 @@ static double geopolyArea(GeoPoly *p){
double rArea = 0.0;
int ii;
for(ii=0; ii<p->nVertex-1; ii++){
- rArea += (p->a[ii*2] - p->a[ii*2+2]) /* (x0 - x1) */
- * (p->a[ii*2+1] + p->a[ii*2+3]) /* (y0 + y1) */
+ rArea += (GeoX(p,ii) - GeoX(p,ii+1)) /* (x0 - x1) */
+ * (GeoY(p,ii) + GeoY(p,ii+1)) /* (y0 + y1) */
* 0.5;
}
- rArea += (p->a[ii*2] - p->a[0]) /* (xN - x0) */
- * (p->a[ii*2+1] + p->a[1]) /* (yN + y0) */
+ rArea += (GeoX(p,ii) - GeoX(p,0)) /* (xN - x0) */
+ * (GeoY(p,ii) + GeoY(p,0)) /* (yN + y0) */
* 0.5;
return rArea;
}
@@ -183902,13 +185046,13 @@ static void geopolyCcwFunc(
if( p ){
if( geopolyArea(p)<0.0 ){
int ii, jj;
- for(ii=2, jj=p->nVertex*2 - 2; ii<jj; ii+=2, jj-=2){
- GeoCoord t = p->a[ii];
- p->a[ii] = p->a[jj];
- p->a[jj] = t;
- t = p->a[ii+1];
- p->a[ii+1] = p->a[jj+1];
- p->a[jj+1] = t;
+ for(ii=1, jj=p->nVertex-1; ii<jj; ii++, jj--){
+ GeoCoord t = GeoX(p,ii);
+ GeoX(p,ii) = GeoX(p,jj);
+ GeoX(p,jj) = t;
+ t = GeoY(p,ii);
+ GeoY(p,ii) = GeoY(p,jj);
+ GeoY(p,jj) = t;
}
}
sqlite3_result_blob(context, p->hdr,
@@ -183968,8 +185112,8 @@ static void geopolyRegularFunc(
p->hdr[3] = n&0xff;
for(i=0; i<n; i++){
double rAngle = 2.0*GEOPOLY_PI*i/n;
- p->a[i*2] = x - r*geopolySine(rAngle-0.5*GEOPOLY_PI);
- p->a[i*2+1] = y + r*geopolySine(rAngle);
+ GeoX(p,i) = x - r*geopolySine(rAngle-0.5*GEOPOLY_PI);
+ GeoY(p,i) = y + r*geopolySine(rAngle);
}
sqlite3_result_blob(context, p->hdr, 4+8*n, SQLITE_TRANSIENT);
sqlite3_free(p);
@@ -184006,13 +185150,13 @@ static GeoPoly *geopolyBBox(
}
if( p ){
int ii;
- mnX = mxX = p->a[0];
- mnY = mxY = p->a[1];
+ mnX = mxX = GeoX(p,0);
+ mnY = mxY = GeoY(p,0);
for(ii=1; ii<p->nVertex; ii++){
- double r = p->a[ii*2];
+ double r = GeoX(p,ii);
if( r<mnX ) mnX = (float)r;
else if( r>mxX ) mxX = (float)r;
- r = p->a[ii*2+1];
+ r = GeoY(p,ii);
if( r<mnY ) mnY = (float)r;
else if( r>mxY ) mxY = (float)r;
}
@@ -184032,14 +185176,14 @@ static GeoPoly *geopolyBBox(
pOut->hdr[1] = 0;
pOut->hdr[2] = 0;
pOut->hdr[3] = 4;
- pOut->a[0] = mnX;
- pOut->a[1] = mnY;
- pOut->a[2] = mxX;
- pOut->a[3] = mnY;
- pOut->a[4] = mxX;
- pOut->a[5] = mxY;
- pOut->a[6] = mnX;
- pOut->a[7] = mxY;
+ GeoX(pOut,0) = mnX;
+ GeoY(pOut,0) = mnY;
+ GeoX(pOut,1) = mxX;
+ GeoY(pOut,1) = mnY;
+ GeoX(pOut,2) = mxX;
+ GeoY(pOut,2) = mxY;
+ GeoX(pOut,3) = mnX;
+ GeoY(pOut,3) = mxY;
}else{
sqlite3_free(p);
aCoord[0].f = mnX;
@@ -184177,14 +185321,14 @@ static void geopolyContainsPointFunc(
int ii;
if( p1==0 ) return;
for(ii=0; ii<p1->nVertex-1; ii++){
- v = pointBeneathLine(x0,y0,p1->a[ii*2],p1->a[ii*2+1],
- p1->a[ii*2+2],p1->a[ii*2+3]);
+ v = pointBeneathLine(x0,y0,GeoX(p1,ii), GeoY(p1,ii),
+ GeoX(p1,ii+1),GeoY(p1,ii+1));
if( v==2 ) break;
cnt += v;
}
if( v!=2 ){
- v = pointBeneathLine(x0,y0,p1->a[ii*2],p1->a[ii*2+1],
- p1->a[0],p1->a[1]);
+ v = pointBeneathLine(x0,y0,GeoX(p1,ii), GeoY(p1,ii),
+ GeoX(p1,0), GeoY(p1,0));
}
if( v==2 ){
sqlite3_result_int(context, 1);
@@ -184306,10 +185450,10 @@ static void geopolyAddSegments(
unsigned int i;
GeoCoord *x;
for(i=0; i<(unsigned)pPoly->nVertex-1; i++){
- x = pPoly->a + (i*2);
+ x = &GeoX(pPoly,i);
geopolyAddOneSegment(p, x[0], x[1], x[2], x[3], side, i);
}
- x = pPoly->a + (i*2);
+ x = &GeoX(pPoly,i);
geopolyAddOneSegment(p, x[0], x[1], pPoly->a[0], pPoly->a[1], side, i);
}
@@ -185254,12 +186398,12 @@ static void rtreeMatchArgFree(void *pArg){
static void geomCallback(sqlite3_context *ctx, int nArg, sqlite3_value **aArg){
RtreeGeomCallback *pGeomCtx = (RtreeGeomCallback *)sqlite3_user_data(ctx);
RtreeMatchArg *pBlob;
- int nBlob;
+ sqlite3_int64 nBlob;
int memErr = 0;
nBlob = sizeof(RtreeMatchArg) + (nArg-1)*sizeof(RtreeDValue)
+ nArg*sizeof(sqlite3_value*);
- pBlob = (RtreeMatchArg *)sqlite3_malloc(nBlob);
+ pBlob = (RtreeMatchArg *)sqlite3_malloc64(nBlob);
if( !pBlob ){
sqlite3_result_error_nomem(ctx);
}else{
@@ -185970,7 +187114,7 @@ static int icuCreate(
if( argc>0 ){
n = strlen(argv[0])+1;
}
- p = (IcuTokenizer *)sqlite3_malloc(sizeof(IcuTokenizer)+n);
+ p = (IcuTokenizer *)sqlite3_malloc64(sizeof(IcuTokenizer)+n);
if( !p ){
return SQLITE_NOMEM;
}
@@ -186027,7 +187171,7 @@ static int icuOpen(
nInput = strlen(zInput);
}
nChar = nInput+1;
- pCsr = (IcuCursor *)sqlite3_malloc(
+ pCsr = (IcuCursor *)sqlite3_malloc64(
sizeof(IcuCursor) + /* IcuCursor */
((nChar+3)&~3) * sizeof(UChar) + /* IcuCursor.aChar[] */
(nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */
@@ -186599,7 +187743,11 @@ SQLITE_API sqlite3rbu *sqlite3rbu_open(
** name of the state database is "<database>-vacuum", where <database>
** is the name of the target database file. In this case, on UNIX, if the
** state database is not already present in the file-system, it is created
-** with the same permissions as the target db is made.
+** with the same permissions as the target db is made.
+**
+** With an RBU vacuum, it is an SQLITE_MISUSE error if the name of the
+** state database ends with "-vactmp". This name is reserved for internal
+** use.
**
** This function does not delete the state database after an RBU vacuum
** is completed, even if it created it. However, if the call to
@@ -189257,7 +190405,7 @@ static void rbuOpenDatabase(sqlite3rbu *p, int *pbRetry){
if( *zExtra=='\0' ) zExtra = 0;
}
- zTarget = sqlite3_mprintf("file:%s-vacuum?rbu_memory=1%s%s",
+ zTarget = sqlite3_mprintf("file:%s-vactmp?rbu_memory=1%s%s",
sqlite3_db_filename(p->dbRbu, "main"),
(zExtra==0 ? "" : "&"), (zExtra==0 ? "" : zExtra)
);
@@ -190523,6 +191671,12 @@ SQLITE_API sqlite3rbu *sqlite3rbu_vacuum(
const char *zState
){
if( zTarget==0 ){ return rbuMisuseError(); }
+ if( zState ){
+ int n = strlen(zState);
+ if( n>=7 && 0==memcmp("-vactmp", &zState[n-7], 7) ){
+ return rbuMisuseError();
+ }
+ }
/* TODO: Check that both arguments are non-NULL */
return openRbuHandle(0, zTarget, zState);
}
@@ -190719,7 +191873,10 @@ SQLITE_API int sqlite3rbu_savestate(sqlite3rbu *p){
if( p->eStage==RBU_STAGE_OAL ){
assert( rc!=SQLITE_DONE );
if( rc==SQLITE_OK ) rc = sqlite3_exec(p->dbRbu, "COMMIT", 0, 0, 0);
- if( rc==SQLITE_OK ) rc = sqlite3_exec(p->dbRbu, "BEGIN IMMEDIATE", 0, 0, 0);
+ if( rc==SQLITE_OK ){
+ const char *zBegin = rbuIsVacuum(p) ? "BEGIN" : "BEGIN IMMEDIATE";
+ rc = sqlite3_exec(p->dbRbu, zBegin, 0, 0, 0);
+ }
if( rc==SQLITE_OK ) rc = sqlite3_exec(p->dbMain, "BEGIN IMMEDIATE", 0, 0,0);
}
@@ -192250,6 +193407,10 @@ statNextRestart:
goto statNextRestart; /* Tail recursion */
}
pCsr->iPage++;
+ if( pCsr->iPage>=ArraySize(pCsr->aPage) ){
+ statResetCsr(pCsr);
+ return SQLITE_CORRUPT_BKPT;
+ }
assert( p==&pCsr->aPage[pCsr->iPage-1] );
if( p->iCell==p->nCell ){
@@ -192321,7 +193482,6 @@ static int statFilter(
StatTable *pTab = (StatTable*)(pCursor->pVtab);
char *zSql;
int rc = SQLITE_OK;
- char *zMaster;
if( idxNum==1 ){
const char *zDbase = (const char*)sqlite3_value_text(argv[0]);
@@ -192337,13 +193497,12 @@ static int statFilter(
statResetCsr(pCsr);
sqlite3_finalize(pCsr->pStmt);
pCsr->pStmt = 0;
- zMaster = pCsr->iDb==1 ? "sqlite_temp_master" : "sqlite_master";
zSql = sqlite3_mprintf(
"SELECT 'sqlite_master' AS name, 1 AS rootpage, 'table' AS type"
" UNION ALL "
"SELECT name, rootpage, type"
- " FROM \"%w\".%s WHERE rootpage!=0"
- " ORDER BY name", pTab->db->aDb[pCsr->iDb].zDbSName, zMaster);
+ " FROM \"%w\".sqlite_master WHERE rootpage!=0"
+ " ORDER BY name", pTab->db->aDb[pCsr->iDb].zDbSName);
if( zSql==0 ){
return SQLITE_NOMEM_BKPT;
}else{
@@ -193231,7 +194390,7 @@ static void sessionPutI64(u8 *aBuf, sqlite3_int64 i){
static int sessionSerializeValue(
u8 *aBuf, /* If non-NULL, write serialized value here */
sqlite3_value *pValue, /* Value to serialize */
- int *pnWrite /* IN/OUT: Increment by bytes written */
+ sqlite3_int64 *pnWrite /* IN/OUT: Increment by bytes written */
){
int nByte; /* Size of serialized value in bytes */
@@ -193772,7 +194931,7 @@ static int sessionGrowHash(int bPatchset, SessionTable *pTab){
SessionChange **apNew;
int nNew = (pTab->nChange ? pTab->nChange : 128) * 2;
- apNew = (SessionChange **)sqlite3_malloc(sizeof(SessionChange *) * nNew);
+ apNew = (SessionChange **)sqlite3_malloc64(sizeof(SessionChange *) * nNew);
if( apNew==0 ){
if( pTab->nChange==0 ){
return SQLITE_ERROR;
@@ -193838,7 +194997,7 @@ static int sessionTableInfo(
char *zPragma;
sqlite3_stmt *pStmt;
int rc;
- int nByte;
+ sqlite3_int64 nByte;
int nDbCol = 0;
int nThis;
int i;
@@ -193881,7 +195040,7 @@ static int sessionTableInfo(
if( rc==SQLITE_OK ){
nByte += nDbCol * (sizeof(const char *) + sizeof(u8) + 1);
- pAlloc = sqlite3_malloc(nByte);
+ pAlloc = sqlite3_malloc64(nByte);
if( pAlloc==0 ){
rc = SQLITE_NOMEM;
}
@@ -194022,7 +195181,7 @@ static void sessionPreupdateOneChange(
int iHash;
int bNull = 0;
int rc = SQLITE_OK;
- SessionStat1Ctx stat1 = {0};
+ SessionStat1Ctx stat1 = {{0,0,0,0,0},0};
if( pSession->rc ) return;
@@ -194079,7 +195238,7 @@ static void sessionPreupdateOneChange(
** this is an SQLITE_UPDATE or SQLITE_DELETE), or just the PK
** values (if this is an INSERT). */
SessionChange *pChange; /* New change object */
- int nByte; /* Number of bytes to allocate */
+ sqlite3_int64 nByte; /* Number of bytes to allocate */
int i; /* Used to iterate through columns */
assert( rc==SQLITE_OK );
@@ -194104,7 +195263,7 @@ static void sessionPreupdateOneChange(
}
/* Allocate the change object */
- pChange = (SessionChange *)sqlite3_malloc(nByte);
+ pChange = (SessionChange *)sqlite3_malloc64(nByte);
if( !pChange ){
rc = SQLITE_NOMEM;
goto error_out;
@@ -194548,7 +195707,7 @@ SQLITE_API int sqlite3session_create(
*ppSession = 0;
/* Allocate and populate the new session object. */
- pNew = (sqlite3_session *)sqlite3_malloc(sizeof(sqlite3_session) + nDb + 1);
+ pNew = (sqlite3_session *)sqlite3_malloc64(sizeof(sqlite3_session) + nDb + 1);
if( !pNew ) return SQLITE_NOMEM;
memset(pNew, 0, sizeof(sqlite3_session));
pNew->db = db;
@@ -194667,7 +195826,7 @@ SQLITE_API int sqlite3session_attach(
if( !pTab ){
/* Allocate new SessionTable object. */
- pTab = (SessionTable *)sqlite3_malloc(sizeof(SessionTable) + nName + 1);
+ pTab = (SessionTable *)sqlite3_malloc64(sizeof(SessionTable) + nName + 1);
if( !pTab ){
rc = SQLITE_NOMEM;
}else{
@@ -194727,7 +195886,7 @@ static int sessionBufferGrow(SessionBuffer *p, int nByte, int *pRc){
static void sessionAppendValue(SessionBuffer *p, sqlite3_value *pVal, int *pRc){
int rc = *pRc;
if( rc==SQLITE_OK ){
- int nByte = 0;
+ sqlite3_int64 nByte = 0;
rc = sessionSerializeValue(0, pVal, &nByte);
sessionBufferGrow(p, nByte, &rc);
if( rc==SQLITE_OK ){
@@ -195603,7 +196762,7 @@ static int sessionValueSetStr(
** argument to sqlite3ValueSetStr() and have the copy created
** automatically. But doing so makes it difficult to detect any OOM
** error. Hence the code to create the copy externally. */
- u8 *aCopy = sqlite3_malloc(nData+1);
+ u8 *aCopy = sqlite3_malloc64((sqlite3_int64)nData+1);
if( aCopy==0 ) return SQLITE_NOMEM;
memcpy(aCopy, aData, nData);
sqlite3ValueSetStr(pVal, nData, (char*)aCopy, enc, sqlite3_free);
@@ -196216,7 +197375,7 @@ static int sessionChangesetInvert(
int iCol;
if( 0==apVal ){
- apVal = (sqlite3_value **)sqlite3_malloc(sizeof(apVal[0])*nCol*2);
+ apVal = (sqlite3_value **)sqlite3_malloc64(sizeof(apVal[0])*nCol*2);
if( 0==apVal ){
rc = SQLITE_NOMEM;
goto finished_invert;
@@ -197489,7 +198648,7 @@ static int sessionChangeMerge(
int rc = SQLITE_OK;
if( !pExist ){
- pNew = (SessionChange *)sqlite3_malloc(sizeof(SessionChange) + nRec);
+ pNew = (SessionChange *)sqlite3_malloc64(sizeof(SessionChange) + nRec);
if( !pNew ){
return SQLITE_NOMEM;
}
@@ -197522,8 +198681,8 @@ static int sessionChangeMerge(
if( pExist->op==SQLITE_DELETE && pExist->bIndirect ){
*ppNew = pExist;
}else{
- int nByte = nRec + pExist->nRecord + sizeof(SessionChange);
- pNew = (SessionChange*)sqlite3_malloc(nByte);
+ sqlite3_int64 nByte = nRec + pExist->nRecord + sizeof(SessionChange);
+ pNew = (SessionChange*)sqlite3_malloc64(nByte);
if( pNew==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -197583,14 +198742,14 @@ static int sessionChangeMerge(
assert( pNew==0 );
}else{
u8 *aExist = pExist->aRecord;
- int nByte;
+ sqlite3_int64 nByte;
u8 *aCsr;
/* Allocate a new SessionChange object. Ensure that the aRecord[]
** buffer of the new object is large enough to hold any record that
** may be generated by combining the input records. */
nByte = sizeof(SessionChange) + pExist->nRecord + nRec;
- pNew = (SessionChange *)sqlite3_malloc(nByte);
+ pNew = (SessionChange *)sqlite3_malloc64(nByte);
if( !pNew ){
sqlite3_free(pExist);
return SQLITE_NOMEM;
@@ -197696,7 +198855,7 @@ static int sessionChangesetToHash(
if( !pTab ){
SessionTable **ppTab;
- pTab = sqlite3_malloc(sizeof(SessionTable) + nCol + nNew+1);
+ pTab = sqlite3_malloc64(sizeof(SessionTable) + nCol + nNew+1);
if( !pTab ){
rc = SQLITE_NOMEM;
break;
@@ -198470,12 +199629,8 @@ struct Fts5PhraseIter {
**
** Usually, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the
-** first token of the phrase. The exception is if the table was created
-** with the offsets=0 option specified. In this case *piOff is always
-** set to -1.
-**
-** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM)
-** if an error occurs.
+** first token of the phrase. Returns SQLITE_OK if successful, or an error
+** code (i.e. SQLITE_NOMEM) if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
@@ -198764,11 +199919,11 @@ struct Fts5ExtensionApi {
** the tokenizer substitutes "first" for "1st" and the query works
** as expected.
**
-** <li> By adding multiple synonyms for a single term to the FTS index.
-** In this case, when tokenizing query text, the tokenizer may
-** provide multiple synonyms for a single term within the document.
-** FTS5 then queries the index for each synonym individually. For
-** example, faced with the query:
+** <li> By querying the index for all synonyms of each query term
+** separately. In this case, when tokenizing query text, the
+** tokenizer may provide multiple synonyms for a single term
+** within the document. FTS5 then queries the index for each
+** synonym individually. For example, faced with the query:
**
** <codeblock>
** ... MATCH 'first place'</codeblock>
@@ -198792,7 +199947,7 @@ struct Fts5ExtensionApi {
** "place".
**
** This way, even if the tokenizer does not provide synonyms
-** when tokenizing query text (it should not - to do would be
+** when tokenizing query text (it should not - to do so would be
** inefficient), it doesn't matter if the user queries for
** 'first + place' or '1st + place', as there are entries in the
** FTS index corresponding to both forms of the first token.
@@ -199017,6 +200172,12 @@ SQLITE_API extern int sqlite3_fts5_may_be_corrupt;
# define assert_nc(x) assert(x)
#endif
+/*
+** A version of memcmp() that does not cause asan errors if one of the pointer
+** parameters is NULL and the number of bytes to compare is zero.
+*/
+#define fts5Memcmp(s1, s2, n) ((n)==0 ? 0 : memcmp((s1), (s2), (n)))
+
/* Mark a function parameter as unused, to suppress nuisance compiler
** warnings. */
#ifndef UNUSED_PARAM
@@ -199204,7 +200365,7 @@ static void sqlite3Fts5Put32(u8*, int);
static int sqlite3Fts5Get32(const u8*);
#define FTS5_POS2COLUMN(iPos) (int)(iPos >> 32)
-#define FTS5_POS2OFFSET(iPos) (int)(iPos & 0xFFFFFFFF)
+#define FTS5_POS2OFFSET(iPos) (int)(iPos & 0x7FFFFFFF)
typedef struct Fts5PoslistReader Fts5PoslistReader;
struct Fts5PoslistReader {
@@ -199239,7 +200400,7 @@ static int sqlite3Fts5PoslistNext64(
);
/* Malloc utility */
-static void *sqlite3Fts5MallocZero(int *pRc, int nByte);
+static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte);
static char *sqlite3Fts5Strndup(int *pRc, const char *pIn, int nIn);
/* Character set tests (like isspace(), isalpha() etc.) */
@@ -199450,8 +200611,18 @@ static int sqlite3Fts5PutVarint(unsigned char *p, u64 v);
/**************************************************************************
-** Interface to code in fts5.c.
+** Interface to code in fts5_main.c.
+*/
+
+/*
+** Virtual-table object.
*/
+typedef struct Fts5Table Fts5Table;
+struct Fts5Table {
+ sqlite3_vtab base; /* Base class used by SQLite core */
+ Fts5Config *pConfig; /* Virtual table configuration */
+ Fts5Index *pIndex; /* Full-text index */
+};
static int sqlite3Fts5GetTokenizer(
Fts5Global*,
@@ -199462,7 +200633,9 @@ static int sqlite3Fts5GetTokenizer(
char **pzErr
);
-static Fts5Index *sqlite3Fts5IndexFromCsrid(Fts5Global*, i64, Fts5Config **);
+static Fts5Table *sqlite3Fts5TableFromCsrid(Fts5Global*, i64);
+
+static int sqlite3Fts5FlushToDisk(Fts5Table*);
/*
** End of interface to code in fts5.c.
@@ -199718,7 +200891,7 @@ static int sqlite3Fts5UnicodeIsdiacritic(int c);
static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic);
static int sqlite3Fts5UnicodeCatParse(const char*, u8*);
-static int sqlite3Fts5UnicodeCategory(int iCode);
+static int sqlite3Fts5UnicodeCategory(u32 iCode);
static void sqlite3Fts5UnicodeAscii(u8*, u8*);
/*
** End of interface to code in fts5_unicode2.c.
@@ -200622,41 +201795,70 @@ static void fts5yy_shift(
fts5yyTraceShift(fts5yypParser, fts5yyNewState, "Shift");
}
-/* The following table contains information about every rule that
-** is used during the reduce.
-*/
-static const struct {
- fts5YYCODETYPE lhs; /* Symbol on the left-hand side of the rule */
- signed char nrhs; /* Negative of the number of RHS symbols in the rule */
-} fts5yyRuleInfo[] = {
- { 16, -1 }, /* (0) input ::= expr */
- { 20, -4 }, /* (1) colset ::= MINUS LCP colsetlist RCP */
- { 20, -3 }, /* (2) colset ::= LCP colsetlist RCP */
- { 20, -1 }, /* (3) colset ::= STRING */
- { 20, -2 }, /* (4) colset ::= MINUS STRING */
- { 21, -2 }, /* (5) colsetlist ::= colsetlist STRING */
- { 21, -1 }, /* (6) colsetlist ::= STRING */
- { 17, -3 }, /* (7) expr ::= expr AND expr */
- { 17, -3 }, /* (8) expr ::= expr OR expr */
- { 17, -3 }, /* (9) expr ::= expr NOT expr */
- { 17, -5 }, /* (10) expr ::= colset COLON LP expr RP */
- { 17, -3 }, /* (11) expr ::= LP expr RP */
- { 17, -1 }, /* (12) expr ::= exprlist */
- { 19, -1 }, /* (13) exprlist ::= cnearset */
- { 19, -2 }, /* (14) exprlist ::= exprlist cnearset */
- { 18, -1 }, /* (15) cnearset ::= nearset */
- { 18, -3 }, /* (16) cnearset ::= colset COLON nearset */
- { 22, -1 }, /* (17) nearset ::= phrase */
- { 22, -2 }, /* (18) nearset ::= CARET phrase */
- { 22, -5 }, /* (19) nearset ::= STRING LP nearphrases neardist_opt RP */
- { 23, -1 }, /* (20) nearphrases ::= phrase */
- { 23, -2 }, /* (21) nearphrases ::= nearphrases phrase */
- { 25, 0 }, /* (22) neardist_opt ::= */
- { 25, -2 }, /* (23) neardist_opt ::= COMMA STRING */
- { 24, -4 }, /* (24) phrase ::= phrase PLUS STRING star_opt */
- { 24, -2 }, /* (25) phrase ::= STRING star_opt */
- { 26, -1 }, /* (26) star_opt ::= STAR */
- { 26, 0 }, /* (27) star_opt ::= */
+/* For rule J, fts5yyRuleInfoLhs[J] contains the symbol on the left-hand side
+** of that rule */
+static const fts5YYCODETYPE fts5yyRuleInfoLhs[] = {
+ 16, /* (0) input ::= expr */
+ 20, /* (1) colset ::= MINUS LCP colsetlist RCP */
+ 20, /* (2) colset ::= LCP colsetlist RCP */
+ 20, /* (3) colset ::= STRING */
+ 20, /* (4) colset ::= MINUS STRING */
+ 21, /* (5) colsetlist ::= colsetlist STRING */
+ 21, /* (6) colsetlist ::= STRING */
+ 17, /* (7) expr ::= expr AND expr */
+ 17, /* (8) expr ::= expr OR expr */
+ 17, /* (9) expr ::= expr NOT expr */
+ 17, /* (10) expr ::= colset COLON LP expr RP */
+ 17, /* (11) expr ::= LP expr RP */
+ 17, /* (12) expr ::= exprlist */
+ 19, /* (13) exprlist ::= cnearset */
+ 19, /* (14) exprlist ::= exprlist cnearset */
+ 18, /* (15) cnearset ::= nearset */
+ 18, /* (16) cnearset ::= colset COLON nearset */
+ 22, /* (17) nearset ::= phrase */
+ 22, /* (18) nearset ::= CARET phrase */
+ 22, /* (19) nearset ::= STRING LP nearphrases neardist_opt RP */
+ 23, /* (20) nearphrases ::= phrase */
+ 23, /* (21) nearphrases ::= nearphrases phrase */
+ 25, /* (22) neardist_opt ::= */
+ 25, /* (23) neardist_opt ::= COMMA STRING */
+ 24, /* (24) phrase ::= phrase PLUS STRING star_opt */
+ 24, /* (25) phrase ::= STRING star_opt */
+ 26, /* (26) star_opt ::= STAR */
+ 26, /* (27) star_opt ::= */
+};
+
+/* For rule J, fts5yyRuleInfoNRhs[J] contains the negative of the number
+** of symbols on the right-hand side of that rule. */
+static const signed char fts5yyRuleInfoNRhs[] = {
+ -1, /* (0) input ::= expr */
+ -4, /* (1) colset ::= MINUS LCP colsetlist RCP */
+ -3, /* (2) colset ::= LCP colsetlist RCP */
+ -1, /* (3) colset ::= STRING */
+ -2, /* (4) colset ::= MINUS STRING */
+ -2, /* (5) colsetlist ::= colsetlist STRING */
+ -1, /* (6) colsetlist ::= STRING */
+ -3, /* (7) expr ::= expr AND expr */
+ -3, /* (8) expr ::= expr OR expr */
+ -3, /* (9) expr ::= expr NOT expr */
+ -5, /* (10) expr ::= colset COLON LP expr RP */
+ -3, /* (11) expr ::= LP expr RP */
+ -1, /* (12) expr ::= exprlist */
+ -1, /* (13) exprlist ::= cnearset */
+ -2, /* (14) exprlist ::= exprlist cnearset */
+ -1, /* (15) cnearset ::= nearset */
+ -3, /* (16) cnearset ::= colset COLON nearset */
+ -1, /* (17) nearset ::= phrase */
+ -2, /* (18) nearset ::= CARET phrase */
+ -5, /* (19) nearset ::= STRING LP nearphrases neardist_opt RP */
+ -1, /* (20) nearphrases ::= phrase */
+ -2, /* (21) nearphrases ::= nearphrases phrase */
+ 0, /* (22) neardist_opt ::= */
+ -2, /* (23) neardist_opt ::= COMMA STRING */
+ -4, /* (24) phrase ::= phrase PLUS STRING star_opt */
+ -2, /* (25) phrase ::= STRING star_opt */
+ -1, /* (26) star_opt ::= STAR */
+ 0, /* (27) star_opt ::= */
};
static void fts5yy_accept(fts5yyParser*); /* Forward Declaration */
@@ -200688,7 +201890,7 @@ static fts5YYACTIONTYPE fts5yy_reduce(
fts5yymsp = fts5yypParser->fts5yytos;
#ifndef NDEBUG
if( fts5yyTraceFILE && fts5yyruleno<(int)(sizeof(fts5yyRuleName)/sizeof(fts5yyRuleName[0])) ){
- fts5yysize = fts5yyRuleInfo[fts5yyruleno].nrhs;
+ fts5yysize = fts5yyRuleInfoNRhs[fts5yyruleno];
if( fts5yysize ){
fprintf(fts5yyTraceFILE, "%sReduce %d [%s], go to state %d.\n",
fts5yyTracePrompt,
@@ -200703,7 +201905,7 @@ static fts5YYACTIONTYPE fts5yy_reduce(
/* Check that the stack is large enough to grow by a single entry
** if the RHS of the rule is empty. This ensures that there is room
** enough on the stack to push the LHS value */
- if( fts5yyRuleInfo[fts5yyruleno].nrhs==0 ){
+ if( fts5yyRuleInfoNRhs[fts5yyruleno]==0 ){
#ifdef fts5YYTRACKMAXSTACKDEPTH
if( (int)(fts5yypParser->fts5yytos - fts5yypParser->fts5yystack)>fts5yypParser->fts5yyhwm ){
fts5yypParser->fts5yyhwm++;
@@ -200887,9 +202089,9 @@ static fts5YYACTIONTYPE fts5yy_reduce(
break;
/********** End reduce actions ************************************************/
};
- assert( fts5yyruleno<sizeof(fts5yyRuleInfo)/sizeof(fts5yyRuleInfo[0]) );
- fts5yygoto = fts5yyRuleInfo[fts5yyruleno].lhs;
- fts5yysize = fts5yyRuleInfo[fts5yyruleno].nrhs;
+ assert( fts5yyruleno<sizeof(fts5yyRuleInfoLhs)/sizeof(fts5yyRuleInfoLhs[0]) );
+ fts5yygoto = fts5yyRuleInfoLhs[fts5yyruleno];
+ fts5yysize = fts5yyRuleInfoNRhs[fts5yyruleno];
fts5yyact = fts5yy_find_reduce_action(fts5yymsp[fts5yysize].stateno,(fts5YYCODETYPE)fts5yygoto);
/* There are no SHIFTREDUCE actions on nonterminals because the table
@@ -201320,7 +202522,7 @@ static void fts5HighlightAppend(
HighlightContext *p,
const char *z, int n
){
- if( *pRc==SQLITE_OK ){
+ if( *pRc==SQLITE_OK && z ){
if( n<0 ) n = (int)strlen(z);
p->zOut = sqlite3_mprintf("%z%.*s", p->zOut, n, z);
if( p->zOut==0 ) *pRc = SQLITE_NOMEM;
@@ -201452,7 +202654,7 @@ static int fts5SentenceFinderAdd(Fts5SFinder *p, int iAdd){
int nNew = p->nFirstAlloc ? p->nFirstAlloc*2 : 64;
int *aNew;
- aNew = (int*)sqlite3_realloc(p->aFirst, nNew*sizeof(int));
+ aNew = (int*)sqlite3_realloc64(p->aFirst, nNew*sizeof(int));
if( aNew==0 ) return SQLITE_NOMEM;
p->aFirst = aNew;
p->nFirstAlloc = nNew;
@@ -201519,11 +202721,12 @@ static int fts5SnippetScore(
int nInst;
int nScore = 0;
int iLast = 0;
+ sqlite3_int64 iEnd = (sqlite3_int64)iPos + nToken;
rc = pApi->xInstCount(pFts, &nInst);
for(i=0; i<nInst && rc==SQLITE_OK; i++){
rc = pApi->xInst(pFts, i, &ip, &ic, &iOff);
- if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<(iPos+nToken) ){
+ if( rc==SQLITE_OK && ic==iCol && iOff>=iPos && iOff<iEnd ){
nScore += (aSeen[ip] ? 1 : 1000);
aSeen[ip] = 1;
if( iFirst<0 ) iFirst = iOff;
@@ -201533,7 +202736,7 @@ static int fts5SnippetScore(
*pnScore = nScore;
if( piPos ){
- int iAdj = iFirst - (nToken - (iLast-iFirst)) / 2;
+ sqlite3_int64 iAdj = iFirst - (nToken - (iLast-iFirst)) / 2;
if( (iAdj+nToken)>nDocsize ) iAdj = nDocsize - nToken;
if( iAdj<0 ) iAdj = 0;
*piPos = iAdj;
@@ -201626,7 +202829,9 @@ static void fts5SnippetFunction(
int jj;
rc = pApi->xInst(pFts, ii, &ip, &ic, &io);
- if( ic!=i || rc!=SQLITE_OK ) continue;
+ if( ic!=i ) continue;
+ if( io>nDocsize ) rc = FTS5_CORRUPT;
+ if( rc!=SQLITE_OK ) continue;
memset(aSeen, 0, nPhrase);
rc = fts5SnippetScore(pApi, pFts, nDocsize, aSeen, i,
io, nToken, &nScore, &iAdj
@@ -201752,13 +202957,13 @@ static int fts5Bm25GetData(
int nPhrase; /* Number of phrases in query */
sqlite3_int64 nRow = 0; /* Number of rows in table */
sqlite3_int64 nToken = 0; /* Number of tokens in table */
- int nByte; /* Bytes of space to allocate */
+ sqlite3_int64 nByte; /* Bytes of space to allocate */
int i;
/* Allocate the Fts5Bm25Data object */
nPhrase = pApi->xPhraseCount(pFts);
nByte = sizeof(Fts5Bm25Data) + nPhrase*2*sizeof(double);
- p = (Fts5Bm25Data*)sqlite3_malloc(nByte);
+ p = (Fts5Bm25Data*)sqlite3_malloc64(nByte);
if( p==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -201770,6 +202975,7 @@ static int fts5Bm25GetData(
/* Calculate the average document length for this FTS5 table */
if( rc==SQLITE_OK ) rc = pApi->xRowCount(pFts, &nRow);
+ assert( rc!=SQLITE_OK || nRow>0 );
if( rc==SQLITE_OK ) rc = pApi->xColumnTotalSize(pFts, -1, &nToken);
if( rc==SQLITE_OK ) p->avgdl = (double)nToken / (double)nRow;
@@ -201895,8 +203101,6 @@ static int sqlite3Fts5AuxInit(fts5_api *pApi){
return rc;
}
-
-
/*
** 2014 May 31
**
@@ -201916,12 +203120,12 @@ static int sqlite3Fts5AuxInit(fts5_api *pApi){
static int sqlite3Fts5BufferSize(int *pRc, Fts5Buffer *pBuf, u32 nByte){
if( (u32)pBuf->nSpace<nByte ){
- u32 nNew = pBuf->nSpace ? pBuf->nSpace : 64;
+ u64 nNew = pBuf->nSpace ? pBuf->nSpace : 64;
u8 *pNew;
while( nNew<nByte ){
nNew = nNew * 2;
}
- pNew = sqlite3_realloc(pBuf->p, nNew);
+ pNew = sqlite3_realloc64(pBuf->p, nNew);
if( pNew==0 ){
*pRc = SQLITE_NOMEM;
return 1;
@@ -201951,7 +203155,7 @@ static void sqlite3Fts5Put32(u8 *aBuf, int iVal){
}
static int sqlite3Fts5Get32(const u8 *aBuf){
- return (aBuf[0] << 24) + (aBuf[1] << 16) + (aBuf[2] << 8) + aBuf[3];
+ return (int)((((u32)aBuf[0])<<24) + (aBuf[1]<<16) + (aBuf[2]<<8) + aBuf[3]);
}
/*
@@ -202082,7 +203286,7 @@ static int sqlite3Fts5PoslistNext64(
iOff = ((i64)iVal) << 32;
fts5FastGetVarint32(a, i, iVal);
}
- *piOff = iOff + (iVal-2);
+ *piOff = iOff + ((iVal-2) & 0x7FFFFFFF);
*pi = i;
return 0;
}
@@ -202143,10 +203347,10 @@ static int sqlite3Fts5PoslistWriterAppend(
return SQLITE_OK;
}
-static void *sqlite3Fts5MallocZero(int *pRc, int nByte){
+static void *sqlite3Fts5MallocZero(int *pRc, sqlite3_int64 nByte){
void *pRet = 0;
if( *pRc==SQLITE_OK ){
- pRet = sqlite3_malloc(nByte);
+ pRet = sqlite3_malloc64(nByte);
if( pRet==0 ){
if( nByte>0 ) *pRc = SQLITE_NOMEM;
}else{
@@ -202589,7 +203793,7 @@ static int fts5ConfigParseSpecial(
if( sqlite3_strnicmp("tokenize", zCmd, nCmd)==0 ){
const char *p = (const char*)zArg;
- int nArg = (int)strlen(zArg) + 1;
+ sqlite3_int64 nArg = strlen(zArg) + 1;
char **azArg = sqlite3Fts5MallocZero(&rc, sizeof(char*) * nArg);
char *pDel = sqlite3Fts5MallocZero(&rc, nArg * 2);
char *pSpace = pDel;
@@ -202719,8 +203923,8 @@ static const char *fts5ConfigGobbleWord(
){
const char *zRet = 0;
- int nIn = (int)strlen(zIn);
- char *zOut = sqlite3_malloc(nIn+1);
+ sqlite3_int64 nIn = strlen(zIn);
+ char *zOut = sqlite3_malloc64(nIn+1);
assert( *pRc==SQLITE_OK );
*pbQuoted = 0;
@@ -202823,7 +204027,7 @@ static int sqlite3Fts5ConfigParse(
int rc = SQLITE_OK; /* Return code */
Fts5Config *pRet; /* New object to return */
int i;
- int nByte;
+ sqlite3_int64 nByte;
*ppOut = pRet = (Fts5Config*)sqlite3_malloc(sizeof(Fts5Config));
if( pRet==0 ) return SQLITE_NOMEM;
@@ -203467,7 +204671,7 @@ static int fts5ExprGetToken(
return tok;
}
-static void *fts5ParseAlloc(u64 t){ return sqlite3_malloc((int)t); }
+static void *fts5ParseAlloc(u64 t){ return sqlite3_malloc64((sqlite3_int64)t);}
static void fts5ParseFree(void *p){ sqlite3_free(p); }
static int sqlite3Fts5ExprNew(
@@ -203612,8 +204816,8 @@ static int fts5ExprSynonymList(
if( sqlite3Fts5IterEof(pIter)==0 && pIter->iRowid==iRowid ){
if( pIter->nData==0 ) continue;
if( nIter==nAlloc ){
- int nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
- Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc(nByte);
+ sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nAlloc * 2;
+ Fts5PoslistReader *aNew = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
if( aNew==0 ){
rc = SQLITE_NOMEM;
goto synonym_poslist_out;
@@ -203693,8 +204897,8 @@ static int fts5ExprPhraseIsMatch(
/* If the aStatic[] array is not large enough, allocate a large array
** using sqlite3_malloc(). This approach could be improved upon. */
if( pPhrase->nTerm>ArraySize(aStatic) ){
- int nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
- aIter = (Fts5PoslistReader*)sqlite3_malloc(nByte);
+ sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * pPhrase->nTerm;
+ aIter = (Fts5PoslistReader*)sqlite3_malloc64(nByte);
if( !aIter ) return SQLITE_NOMEM;
}
memset(aIter, 0, sizeof(Fts5PoslistReader) * pPhrase->nTerm);
@@ -203828,7 +205032,7 @@ static int fts5ExprNearIsMatch(int *pRc, Fts5ExprNearset *pNear){
/* If the aStatic[] array is not large enough, allocate a large array
** using sqlite3_malloc(). This approach could be improved upon. */
if( pNear->nPhrase>ArraySize(aStatic) ){
- int nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
+ sqlite3_int64 nByte = sizeof(Fts5NearTrimmer) * pNear->nPhrase;
a = (Fts5NearTrimmer*)sqlite3Fts5MallocZero(&rc, nByte);
}else{
memset(aStatic, 0, sizeof(aStatic));
@@ -204737,8 +205941,9 @@ static Fts5ExprNearset *sqlite3Fts5ParseNearset(
return pNear;
}
if( pNear==0 ){
- int nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
- pRet = sqlite3_malloc(nByte);
+ sqlite3_int64 nByte;
+ nByte = sizeof(Fts5ExprNearset) + SZALLOC * sizeof(Fts5ExprPhrase*);
+ pRet = sqlite3_malloc64(nByte);
if( pRet==0 ){
pParse->rc = SQLITE_NOMEM;
}else{
@@ -204746,9 +205951,10 @@ static Fts5ExprNearset *sqlite3Fts5ParseNearset(
}
}else if( (pNear->nPhrase % SZALLOC)==0 ){
int nNew = pNear->nPhrase + SZALLOC;
- int nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
+ sqlite3_int64 nByte;
- pRet = (Fts5ExprNearset*)sqlite3_realloc(pNear, nByte);
+ nByte = sizeof(Fts5ExprNearset) + nNew * sizeof(Fts5ExprPhrase*);
+ pRet = (Fts5ExprNearset*)sqlite3_realloc64(pNear, nByte);
if( pRet==0 ){
pParse->rc = SQLITE_NOMEM;
}
@@ -204812,8 +206018,8 @@ static int fts5ParseTokenize(
if( pPhrase && pPhrase->nTerm>0 && (tflags & FTS5_TOKEN_COLOCATED) ){
Fts5ExprTerm *pSyn;
- int nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
- pSyn = (Fts5ExprTerm*)sqlite3_malloc(nByte);
+ sqlite3_int64 nByte = sizeof(Fts5ExprTerm) + sizeof(Fts5Buffer) + nToken+1;
+ pSyn = (Fts5ExprTerm*)sqlite3_malloc64(nByte);
if( pSyn==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -204829,7 +206035,7 @@ static int fts5ParseTokenize(
Fts5ExprPhrase *pNew;
int nNew = SZALLOC + (pPhrase ? pPhrase->nTerm : 0);
- pNew = (Fts5ExprPhrase*)sqlite3_realloc(pPhrase,
+ pNew = (Fts5ExprPhrase*)sqlite3_realloc64(pPhrase,
sizeof(Fts5ExprPhrase) + sizeof(Fts5ExprTerm) * nNew
);
if( pNew==0 ){
@@ -204915,9 +206121,9 @@ static Fts5ExprPhrase *sqlite3Fts5ParseTerm(
if( pAppend==0 ){
if( (pParse->nPhrase % 8)==0 ){
- int nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
+ sqlite3_int64 nByte = sizeof(Fts5ExprPhrase*) * (pParse->nPhrase + 8);
Fts5ExprPhrase **apNew;
- apNew = (Fts5ExprPhrase**)sqlite3_realloc(pParse->apPhrase, nByte);
+ apNew = (Fts5ExprPhrase**)sqlite3_realloc64(pParse->apPhrase, nByte);
if( apNew==0 ){
pParse->rc = SQLITE_NOMEM;
fts5ExprPhraseFree(sCtx.pPhrase);
@@ -204972,8 +206178,10 @@ static int sqlite3Fts5ExprClonePhrase(
if( rc==SQLITE_OK ){
Fts5Colset *pColsetOrig = pOrig->pNode->pNear->pColset;
if( pColsetOrig ){
- int nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
- Fts5Colset *pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
+ sqlite3_int64 nByte;
+ Fts5Colset *pColset;
+ nByte = sizeof(Fts5Colset) + (pColsetOrig->nCol-1) * sizeof(int);
+ pColset = (Fts5Colset*)sqlite3Fts5MallocZero(&rc, nByte);
if( pColset ){
memcpy(pColset, pColsetOrig, nByte);
}
@@ -205093,7 +206301,7 @@ static Fts5Colset *fts5ParseColset(
assert( pParse->rc==SQLITE_OK );
assert( iCol>=0 && iCol<pParse->pConfig->nCol );
- pNew = sqlite3_realloc(p, sizeof(Fts5Colset) + sizeof(int)*nCol);
+ pNew = sqlite3_realloc64(p, sizeof(Fts5Colset) + sizeof(int)*nCol);
if( pNew==0 ){
pParse->rc = SQLITE_NOMEM;
}else{
@@ -205189,7 +206397,7 @@ static Fts5Colset *sqlite3Fts5ParseColset(
static Fts5Colset *fts5CloneColset(int *pRc, Fts5Colset *pOrig){
Fts5Colset *pRet;
if( pOrig ){
- int nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
+ sqlite3_int64 nByte = sizeof(Fts5Colset) + (pOrig->nCol-1) * sizeof(int);
pRet = (Fts5Colset*)sqlite3Fts5MallocZero(pRc, nByte);
if( pRet ){
memcpy(pRet, pOrig, nByte);
@@ -205343,7 +206551,7 @@ static Fts5ExprNode *sqlite3Fts5ParseNode(
if( pParse->rc==SQLITE_OK ){
int nChild = 0; /* Number of children of returned node */
- int nByte; /* Bytes of space to allocate for this node */
+ sqlite3_int64 nByte; /* Bytes of space to allocate for this node */
assert( (eType!=FTS5_STRING && !pNear)
|| (eType==FTS5_STRING && !pLeft && !pRight)
@@ -205475,7 +206683,7 @@ static Fts5ExprNode *sqlite3Fts5ParseImplicitAnd(
}
static char *fts5ExprTermPrint(Fts5ExprTerm *pTerm){
- int nByte = 0;
+ sqlite3_int64 nByte = 0;
Fts5ExprTerm *p;
char *zQuoted;
@@ -205483,7 +206691,7 @@ static char *fts5ExprTermPrint(Fts5ExprTerm *pTerm){
for(p=pTerm; p; p=p->pSynonym){
nByte += (int)strlen(pTerm->zTerm) * 2 + 3 + 2;
}
- zQuoted = sqlite3_malloc(nByte);
+ zQuoted = sqlite3_malloc64(nByte);
if( zQuoted ){
int i = 0;
@@ -205723,7 +206931,7 @@ static void fts5ExprFunction(
}
nConfig = 3 + (nArg-iArg);
- azConfig = (const char**)sqlite3_malloc(sizeof(char*) * nConfig);
+ azConfig = (const char**)sqlite3_malloc64(sizeof(char*) * nConfig);
if( azConfig==0 ){
sqlite3_result_error_nomem(pCtx);
return;
@@ -205809,7 +207017,7 @@ static void fts5ExprIsAlnum(
sqlite3Fts5UnicodeCatParse("N*", aArr);
sqlite3Fts5UnicodeCatParse("Co", aArr);
iCode = sqlite3_value_int(apVal[0]);
- sqlite3_result_int(pCtx, aArr[sqlite3Fts5UnicodeCategory(iCode)]);
+ sqlite3_result_int(pCtx, aArr[sqlite3Fts5UnicodeCategory((u32)iCode)]);
}
static void fts5ExprFold(
@@ -205904,7 +207112,7 @@ struct Fts5PoslistPopulator {
static Fts5PoslistPopulator *sqlite3Fts5ExprClearPoslists(Fts5Expr *pExpr, int bLive){
Fts5PoslistPopulator *pRet;
- pRet = sqlite3_malloc(sizeof(Fts5PoslistPopulator)*pExpr->nPhrase);
+ pRet = sqlite3_malloc64(sizeof(Fts5PoslistPopulator)*pExpr->nPhrase);
if( pRet ){
int i;
memset(pRet, 0, sizeof(Fts5PoslistPopulator)*pExpr->nPhrase);
@@ -206104,7 +207312,6 @@ static int sqlite3Fts5ExprPhraseCollist(
return rc;
}
-
/*
** 2014 August 11
**
@@ -206197,14 +207404,14 @@ static int sqlite3Fts5HashNew(Fts5Config *pConfig, Fts5Hash **ppNew, int *pnByte
if( pNew==0 ){
rc = SQLITE_NOMEM;
}else{
- int nByte;
+ sqlite3_int64 nByte;
memset(pNew, 0, sizeof(Fts5Hash));
pNew->pnByte = pnByte;
pNew->eDetail = pConfig->eDetail;
pNew->nSlot = 1024;
nByte = sizeof(Fts5HashEntry*) * pNew->nSlot;
- pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc(nByte);
+ pNew->aSlot = (Fts5HashEntry**)sqlite3_malloc64(nByte);
if( pNew->aSlot==0 ){
sqlite3_free(pNew);
*ppNew = 0;
@@ -206272,7 +207479,7 @@ static int fts5HashResize(Fts5Hash *pHash){
Fts5HashEntry **apNew;
Fts5HashEntry **apOld = pHash->aSlot;
- apNew = (Fts5HashEntry**)sqlite3_malloc(nNew*sizeof(Fts5HashEntry*));
+ apNew = (Fts5HashEntry**)sqlite3_malloc64(nNew*sizeof(Fts5HashEntry*));
if( !apNew ) return SQLITE_NOMEM;
memset(apNew, 0, nNew*sizeof(Fts5HashEntry*));
@@ -206366,7 +207573,7 @@ static int sqlite3Fts5HashWrite(
if( p==0 ){
/* Figure out how much space to allocate */
char *zKey;
- int nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
+ sqlite3_int64 nByte = sizeof(Fts5HashEntry) + (nToken+1) + 1 + 64;
if( nByte<128 ) nByte = 128;
/* Grow the Fts5Hash.aSlot[] array if necessary. */
@@ -206377,7 +207584,7 @@ static int sqlite3Fts5HashWrite(
}
/* Allocate new Fts5HashEntry and add it to the hash table. */
- p = (Fts5HashEntry*)sqlite3_malloc(nByte);
+ p = (Fts5HashEntry*)sqlite3_malloc64(nByte);
if( !p ) return SQLITE_NOMEM;
memset(p, 0, sizeof(Fts5HashEntry));
p->nAlloc = nByte;
@@ -206416,12 +207623,12 @@ static int sqlite3Fts5HashWrite(
** + 5 bytes for the new position offset (32-bit max).
*/
if( (p->nAlloc - p->nData) < (9 + 4 + 1 + 3 + 5) ){
- int nNew = p->nAlloc * 2;
+ sqlite3_int64 nNew = p->nAlloc * 2;
Fts5HashEntry *pNew;
Fts5HashEntry **pp;
- pNew = (Fts5HashEntry*)sqlite3_realloc(p, nNew);
+ pNew = (Fts5HashEntry*)sqlite3_realloc64(p, nNew);
if( pNew==0 ) return SQLITE_NOMEM;
- pNew->nAlloc = nNew;
+ pNew->nAlloc = (int)nNew;
for(pp=&pHash->aSlot[iHash]; *pp!=p; pp=&(*pp)->pHashNext);
*pp = pNew;
p = pNew;
@@ -206545,7 +207752,7 @@ static int fts5HashEntrySort(
int i;
*ppSorted = 0;
- ap = sqlite3_malloc(sizeof(Fts5HashEntry*) * nMergeSlot);
+ ap = sqlite3_malloc64(sizeof(Fts5HashEntry*) * nMergeSlot);
if( !ap ) return SQLITE_NOMEM;
memset(ap, 0, sizeof(Fts5HashEntry*) * nMergeSlot);
@@ -206590,7 +207797,8 @@ static int sqlite3Fts5HashQuery(
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
zKey = fts5EntryKey(p);
- if( memcmp(zKey, pTerm, nTerm)==0 && zKey[nTerm]==0 ) break;
+ assert( p->nKey+1==(int)strlen(zKey) );
+ if( nTerm==p->nKey+1 && memcmp(zKey, pTerm, nTerm)==0 ) break;
}
if( p ){
@@ -206642,7 +207850,6 @@ static void sqlite3Fts5HashScanEntry(
}
}
-
/*
** 2014 May 31
**
@@ -207157,7 +208364,6 @@ struct Fts5Iter {
Fts5IndexIter base; /* Base class containing output vars */
Fts5Index *pIndex; /* Index that owns this iterator */
- Fts5Structure *pStruct; /* Database structure for this iterator */
Fts5Buffer poslist; /* Buffer containing current poslist */
Fts5Colset *pColset; /* Restrict matches to these columns */
@@ -207218,7 +208424,7 @@ static u16 fts5GetU16(const u8 *aIn){
** If an OOM error is encountered, return NULL and set the error code in
** the Fts5Index handle passed as the first argument.
*/
-static void *fts5IdxMalloc(Fts5Index *p, int nByte){
+static void *fts5IdxMalloc(Fts5Index *p, sqlite3_int64 nByte){
return sqlite3Fts5MallocZero(&p->rc, nByte);
}
@@ -207252,7 +208458,7 @@ static int fts5BufferCompareBlob(
*/
static int fts5BufferCompare(Fts5Buffer *pLeft, Fts5Buffer *pRight){
int nCmp = MIN(pLeft->n, pRight->n);
- int res = memcmp(pLeft->p, pRight->p, nCmp);
+ int res = fts5Memcmp(pLeft->p, pRight->p, nCmp);
return (res==0 ? (pLeft->n - pRight->n) : res);
}
@@ -207318,8 +208524,8 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
if( rc==SQLITE_OK ){
u8 *aOut = 0; /* Read blob data into this buffer */
int nByte = sqlite3_blob_bytes(p->pReader);
- int nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING;
- pRet = (Fts5Data*)sqlite3_malloc(nAlloc);
+ sqlite3_int64 nAlloc = sizeof(Fts5Data) + nByte + FTS5_DATA_PADDING;
+ pRet = (Fts5Data*)sqlite3_malloc64(nAlloc);
if( pRet ){
pRet->nn = nByte;
aOut = pRet->p = (u8*)&pRet[1];
@@ -207335,6 +208541,7 @@ static Fts5Data *fts5DataRead(Fts5Index *p, i64 iRowid){
pRet = 0;
}else{
/* TODO1: Fix this */
+ pRet->p[nByte] = 0x00;
pRet->szLeaf = fts5GetU16(&pRet->p[2]);
}
}
@@ -207374,7 +208581,8 @@ static int fts5IndexPrepareStmt(
if( p->rc==SQLITE_OK ){
if( zSql ){
p->rc = sqlite3_prepare_v3(p->pConfig->db, zSql, -1,
- SQLITE_PREPARE_PERSISTENT, ppStmt, 0);
+ SQLITE_PREPARE_PERSISTENT|SQLITE_PREPARE_NO_VTAB,
+ ppStmt, 0);
}else{
p->rc = SQLITE_NOMEM;
}
@@ -207415,23 +208623,12 @@ static void fts5DataDelete(Fts5Index *p, i64 iFirst, i64 iLast){
if( p->rc!=SQLITE_OK ) return;
if( p->pDeleter==0 ){
- int rc;
Fts5Config *pConfig = p->pConfig;
char *zSql = sqlite3_mprintf(
"DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?",
pConfig->zDb, pConfig->zName
);
- if( zSql==0 ){
- rc = SQLITE_NOMEM;
- }else{
- rc = sqlite3_prepare_v3(pConfig->db, zSql, -1,
- SQLITE_PREPARE_PERSISTENT, &p->pDeleter, 0);
- sqlite3_free(zSql);
- }
- if( rc!=SQLITE_OK ){
- p->rc = rc;
- return;
- }
+ if( fts5IndexPrepareStmt(p, &p->pDeleter, zSql) ) return;
}
sqlite3_bind_int64(p->pDeleter, 1, iFirst);
@@ -207503,7 +208700,7 @@ static int fts5StructureDecode(
int iLvl;
int nLevel = 0;
int nSegment = 0;
- int nByte; /* Bytes of space to allocate at pRet */
+ sqlite3_int64 nByte; /* Bytes of space to allocate at pRet */
Fts5Structure *pRet = 0; /* Structure object to return */
/* Grab the cookie value */
@@ -207514,6 +208711,11 @@ static int fts5StructureDecode(
** structure record. */
i += fts5GetVarint32(&pData[i], nLevel);
i += fts5GetVarint32(&pData[i], nSegment);
+ if( nLevel>FTS5_MAX_SEGMENT || nLevel<0
+ || nSegment>FTS5_MAX_SEGMENT || nSegment<0
+ ){
+ return FTS5_CORRUPT;
+ }
nByte = (
sizeof(Fts5Structure) + /* Main structure */
sizeof(Fts5StructureLevel) * (nLevel-1) /* aLevel[] array */
@@ -207536,25 +208738,35 @@ static int fts5StructureDecode(
}else{
i += fts5GetVarint32(&pData[i], pLvl->nMerge);
i += fts5GetVarint32(&pData[i], nTotal);
- assert( nTotal>=pLvl->nMerge );
+ if( nTotal<pLvl->nMerge ) rc = FTS5_CORRUPT;
pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc,
nTotal * sizeof(Fts5StructureSegment)
);
+ nSegment -= nTotal;
}
if( rc==SQLITE_OK ){
pLvl->nSeg = nTotal;
for(iSeg=0; iSeg<nTotal; iSeg++){
+ Fts5StructureSegment *pSeg = &pLvl->aSeg[iSeg];
if( i>=nData ){
rc = FTS5_CORRUPT;
break;
}
- i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].iSegid);
- i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].pgnoFirst);
- i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].pgnoLast);
+ i += fts5GetVarint32(&pData[i], pSeg->iSegid);
+ i += fts5GetVarint32(&pData[i], pSeg->pgnoFirst);
+ i += fts5GetVarint32(&pData[i], pSeg->pgnoLast);
+ if( pSeg->pgnoLast<pSeg->pgnoFirst ){
+ rc = FTS5_CORRUPT;
+ break;
+ }
}
+ if( iLvl>0 && pLvl[-1].nMerge && nTotal==0 ) rc = FTS5_CORRUPT;
+ if( iLvl==nLevel-1 && pLvl->nMerge ) rc = FTS5_CORRUPT;
}
}
+ if( nSegment!=0 && rc==SQLITE_OK ) rc = FTS5_CORRUPT;
+
if( rc!=SQLITE_OK ){
fts5StructureRelease(pRet);
pRet = 0;
@@ -207572,12 +208784,12 @@ static void fts5StructureAddLevel(int *pRc, Fts5Structure **ppStruct){
if( *pRc==SQLITE_OK ){
Fts5Structure *pStruct = *ppStruct;
int nLevel = pStruct->nLevel;
- int nByte = (
+ sqlite3_int64 nByte = (
sizeof(Fts5Structure) + /* Main structure */
sizeof(Fts5StructureLevel) * (nLevel+1) /* aLevel[] array */
);
- pStruct = sqlite3_realloc(pStruct, nByte);
+ pStruct = sqlite3_realloc64(pStruct, nByte);
if( pStruct ){
memset(&pStruct->aLevel[nLevel], 0, sizeof(Fts5StructureLevel));
pStruct->nLevel++;
@@ -207602,10 +208814,10 @@ static void fts5StructureExtendLevel(
if( *pRc==SQLITE_OK ){
Fts5StructureLevel *pLvl = &pStruct->aLevel[iLvl];
Fts5StructureSegment *aNew;
- int nByte;
+ sqlite3_int64 nByte;
nByte = (pLvl->nSeg + nExtra) * sizeof(Fts5StructureSegment);
- aNew = sqlite3_realloc(pLvl->aSeg, nByte);
+ aNew = sqlite3_realloc64(pLvl->aSeg, nByte);
if( aNew ){
if( bInsert==0 ){
memset(&aNew[pLvl->nSeg], 0, sizeof(Fts5StructureSegment) * nExtra);
@@ -208119,10 +209331,10 @@ static Fts5DlidxIter *fts5DlidxIterInit(
int bDone = 0;
for(i=0; p->rc==SQLITE_OK && bDone==0; i++){
- int nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
+ sqlite3_int64 nByte = sizeof(Fts5DlidxIter) + i * sizeof(Fts5DlidxLvl);
Fts5DlidxIter *pNew;
- pNew = (Fts5DlidxIter*)sqlite3_realloc(pIter, nByte);
+ pNew = (Fts5DlidxIter*)sqlite3_realloc64(pIter, nByte);
if( pNew==0 ){
p->rc = SQLITE_NOMEM;
}else{
@@ -208292,12 +209504,13 @@ static void fts5SegIterLoadTerm(Fts5Index *p, Fts5SegIter *pIter, int nKeep){
int nNew; /* Bytes of new data */
iOff += fts5GetVarint32(&a[iOff], nNew);
- if( iOff+nNew>pIter->pLeaf->nn ){
+ if( iOff+nNew>pIter->pLeaf->szLeaf || nKeep>pIter->term.n || nNew==0 ){
p->rc = FTS5_CORRUPT;
return;
}
pIter->term.n = nKeep;
fts5BufferAppendBlob(&p->rc, &pIter->term, nNew, &a[iOff]);
+ assert( pIter->term.n<=pIter->term.nSpace );
iOff += nNew;
pIter->iTermLeafOffset = iOff;
pIter->iTermLeafPgno = pIter->iLeafPgno;
@@ -208362,7 +209575,7 @@ static void fts5SegIterInit(
if( p->rc==SQLITE_OK ){
pIter->iLeafOffset = 4;
assert_nc( pIter->pLeaf->nn>4 );
- assert( fts5LeafFirstTermOff(pIter->pLeaf)==4 );
+ assert_nc( fts5LeafFirstTermOff(pIter->pLeaf)==4 );
pIter->iPgidxOff = pIter->pLeaf->szLeaf+1;
fts5SegIterLoadTerm(p, pIter, 0);
fts5SegIterLoadNPos(p, pIter);
@@ -208418,7 +209631,7 @@ static void fts5SegIterReverseInitPage(Fts5Index *p, Fts5SegIter *pIter){
/* If necessary, grow the pIter->aRowidOffset[] array. */
if( iRowidOffset>=pIter->nRowidOffset ){
int nNew = pIter->nRowidOffset + 8;
- int *aNew = (int*)sqlite3_realloc(pIter->aRowidOffset, nNew*sizeof(int));
+ int *aNew = (int*)sqlite3_realloc64(pIter->aRowidOffset,nNew*sizeof(int));
if( aNew==0 ){
p->rc = SQLITE_NOMEM;
break;
@@ -208872,10 +210085,10 @@ static void fts5LeafSeek(
int szLeaf = pIter->pLeaf->szLeaf;
int n = pIter->pLeaf->nn;
- int nMatch = 0;
- int nKeep = 0;
- int nNew = 0;
- int iTermOff;
+ u32 nMatch = 0;
+ u32 nKeep = 0;
+ u32 nNew = 0;
+ u32 iTermOff;
int iPgidx; /* Current offset in pgidx */
int bEndOfPage = 0;
@@ -208899,15 +210112,15 @@ static void fts5LeafSeek(
assert( nKeep>=nMatch );
if( nKeep==nMatch ){
- int nCmp;
- int i;
- nCmp = MIN(nNew, nTerm-nMatch);
+ u32 nCmp;
+ u32 i;
+ nCmp = (u32)MIN(nNew, nTerm-nMatch);
for(i=0; i<nCmp; i++){
if( a[iOff+i]!=pTerm[nMatch+i] ) break;
}
nMatch += i;
- if( nTerm==nMatch ){
+ if( (u32)nTerm==nMatch ){
if( i==nNew ){
goto search_success;
}else{
@@ -208951,6 +210164,7 @@ static void fts5LeafSeek(
iPgidx += fts5GetVarint32(&pIter->pLeaf->p[iPgidx], iOff);
if( iOff<4 || iOff>=pIter->pLeaf->szLeaf ){
p->rc = FTS5_CORRUPT;
+ return;
}else{
nKeep = 0;
iTermOff = iOff;
@@ -208963,8 +210177,11 @@ static void fts5LeafSeek(
}
search_success:
-
pIter->iLeafOffset = iOff + nNew;
+ if( pIter->iLeafOffset>n || nNew<1 ){
+ p->rc = FTS5_CORRUPT;
+ return;
+ }
pIter->iTermLeafOffset = pIter->iLeafOffset;
pIter->iTermLeafPgno = pIter->iLeafPgno;
@@ -209071,7 +210288,7 @@ static void fts5SegIterSeekInit(
** 4) the FTS5INDEX_QUERY_SCAN flag was set and the iterator points
** to an entry with a term greater than or equal to (pTerm/nTerm).
*/
- assert( p->rc!=SQLITE_OK /* 1 */
+ assert_nc( p->rc!=SQLITE_OK /* 1 */
|| pIter->pLeaf==0 /* 2 */
|| fts5BufferCompareBlob(&pIter->term, pTerm, nTerm)==0 /* 3 */
|| (bGe && fts5BufferCompareBlob(&pIter->term, pTerm, nTerm)>0) /* 4 */
@@ -209169,7 +210386,7 @@ static void fts5AssertComparisonResult(
assert( pRes->iFirst==i1 );
}else{
int nMin = MIN(p1->term.n, p2->term.n);
- int res = memcmp(p1->term.p, p2->term.p, nMin);
+ int res = fts5Memcmp(p1->term.p, p2->term.p, nMin);
if( res==0 ) res = p1->term.n - p2->term.n;
if( res==0 ){
@@ -209392,7 +210609,6 @@ static void fts5MultiIterFree(Fts5Iter *pIter){
for(i=0; i<pIter->nSeg; i++){
fts5SegIterClear(&pIter->aSeg[i]);
}
- fts5StructureRelease(pIter->pStruct);
fts5BufferFree(&pIter->poslist);
sqlite3_free(pIter);
}
@@ -209740,7 +210956,8 @@ static void fts5SegiterPoslist(
Fts5Colset *pColset,
Fts5Buffer *pBuf
){
- if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos) ){
+ if( 0==fts5BufferGrow(&p->rc, pBuf, pSeg->nPos+FTS5_DATA_ZERO_PADDING) ){
+ memset(&pBuf->p[pBuf->n+pSeg->nPos], 0, FTS5_DATA_ZERO_PADDING);
if( pColset==0 ){
fts5ChunkIterate(p, pSeg, (void*)pBuf, fts5PoslistCallback);
}else{
@@ -210038,9 +211255,7 @@ static void fts5MultiIterNew(
if( pNew==0 ) return;
pNew->bRev = (0!=(flags & FTS5INDEX_QUERY_DESC));
pNew->bSkipEmpty = (0!=(flags & FTS5INDEX_QUERY_SKIPEMPTY));
- pNew->pStruct = pStruct;
pNew->pColset = pColset;
- fts5StructureRef(pStruct);
if( (flags & FTS5INDEX_QUERY_NOOUTPUT)==0 ){
fts5IterSetOutputCb(&p->rc, pNew);
}
@@ -210218,24 +211433,24 @@ static int fts5AllocateSegid(Fts5Index *p, Fts5Structure *pStruct){
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
int iId = pStruct->aLevel[iLvl].aSeg[iSeg].iSegid;
- if( iId<=FTS5_MAX_SEGMENT ){
- aUsed[(iId-1) / 32] |= 1 << ((iId-1) % 32);
+ if( iId<=FTS5_MAX_SEGMENT && iId>0 ){
+ aUsed[(iId-1) / 32] |= (u32)1 << ((iId-1) % 32);
}
}
}
for(i=0; aUsed[i]==0xFFFFFFFF; i++);
mask = aUsed[i];
- for(iSegid=0; mask & (1 << iSegid); iSegid++);
+ for(iSegid=0; mask & ((u32)1 << iSegid); iSegid++);
iSegid += 1 + i*32;
#ifdef SQLITE_DEBUG
for(iLvl=0; iLvl<pStruct->nLevel; iLvl++){
for(iSeg=0; iSeg<pStruct->aLevel[iLvl].nSeg; iSeg++){
- assert( iSegid!=pStruct->aLevel[iLvl].aSeg[iSeg].iSegid );
+ assert_nc( iSegid!=pStruct->aLevel[iLvl].aSeg[iSeg].iSegid );
}
}
- assert( iSegid>0 && iSegid<=FTS5_MAX_SEGMENT );
+ assert_nc( iSegid>0 && iSegid<=FTS5_MAX_SEGMENT );
{
sqlite3_stmt *pIdxSelect = fts5IdxSelectStmt(p);
@@ -210243,7 +211458,7 @@ static int fts5AllocateSegid(Fts5Index *p, Fts5Structure *pStruct){
u8 aBlob[2] = {0xff, 0xff};
sqlite3_bind_int(pIdxSelect, 1, iSegid);
sqlite3_bind_blob(pIdxSelect, 2, aBlob, 2, SQLITE_STATIC);
- assert( sqlite3_step(pIdxSelect)!=SQLITE_ROW );
+ assert_nc( sqlite3_step(pIdxSelect)!=SQLITE_ROW );
p->rc = sqlite3_reset(pIdxSelect);
sqlite3_bind_null(pIdxSelect, 2);
}
@@ -210313,7 +211528,7 @@ static int fts5WriteDlidxGrow(
int nLvl
){
if( p->rc==SQLITE_OK && nLvl>=pWriter->nDlidx ){
- Fts5DlidxWriter *aDlidx = (Fts5DlidxWriter*)sqlite3_realloc(
+ Fts5DlidxWriter *aDlidx = (Fts5DlidxWriter*)sqlite3_realloc64(
pWriter->aDlidx, sizeof(Fts5DlidxWriter) * nLvl
);
if( aDlidx==0 ){
@@ -210392,8 +211607,10 @@ static void fts5WriteBtreeTerm(
int nTerm, const u8 *pTerm /* First term on new page */
){
fts5WriteFlushBtree(p, pWriter);
- fts5BufferSet(&p->rc, &pWriter->btterm, nTerm, pTerm);
- pWriter->iBtPage = pWriter->writer.pgno;
+ if( p->rc==SQLITE_OK ){
+ fts5BufferSet(&p->rc, &pWriter->btterm, nTerm, pTerm);
+ pWriter->iBtPage = pWriter->writer.pgno;
+ }
}
/*
@@ -210544,6 +211761,7 @@ static void fts5WriteAppendTerm(
int nPrefix; /* Bytes of prefix compression for term */
Fts5PageWriter *pPage = &pWriter->writer;
Fts5Buffer *pPgidx = &pWriter->writer.pgidx;
+ int nMin = MIN(pPage->term.n, nTerm);
assert( p->rc==SQLITE_OK );
assert( pPage->buf.n>=4 );
@@ -210553,6 +211771,7 @@ static void fts5WriteAppendTerm(
if( (pPage->buf.n + pPgidx->n + nTerm + 2)>=p->pConfig->pgsz ){
if( pPage->buf.n>4 ){
fts5WriteFlushLeaf(p, pWriter);
+ if( p->rc!=SQLITE_OK ) return;
}
fts5BufferGrow(&p->rc, &pPage->buf, nTerm+FTS5_DATA_PADDING);
}
@@ -210585,13 +211804,14 @@ static void fts5WriteAppendTerm(
** inefficient, but still correct. */
int n = nTerm;
if( pPage->term.n ){
- n = 1 + fts5PrefixCompress(pPage->term.n, pPage->term.p, pTerm);
+ n = 1 + fts5PrefixCompress(nMin, pPage->term.p, pTerm);
}
fts5WriteBtreeTerm(p, pWriter, n, pTerm);
+ if( p->rc!=SQLITE_OK ) return;
pPage = &pWriter->writer;
}
}else{
- nPrefix = fts5PrefixCompress(pPage->term.n, pPage->term.p, pTerm);
+ nPrefix = fts5PrefixCompress(nMin, pPage->term.p, pTerm);
fts5BufferAppendVarint(&p->rc, &pPage->buf, nPrefix);
}
@@ -210638,7 +211858,7 @@ static void fts5WriteAppendRowid(
if( pWriter->bFirstRowidInDoclist || pWriter->bFirstRowidInPage ){
fts5BufferAppendVarint(&p->rc, &pPage->buf, iRowid);
}else{
- assert( p->rc || iRowid>pWriter->iPrevRowid );
+ assert_nc( p->rc || iRowid>pWriter->iPrevRowid );
fts5BufferAppendVarint(&p->rc, &pPage->buf, iRowid - pWriter->iPrevRowid);
}
pWriter->iPrevRowid = iRowid;
@@ -210760,7 +211980,7 @@ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){
int i;
Fts5Buffer buf;
memset(&buf, 0, sizeof(Fts5Buffer));
- for(i=0; i<pIter->nSeg; i++){
+ for(i=0; i<pIter->nSeg && p->rc==SQLITE_OK; i++){
Fts5SegIter *pSeg = &pIter->aSeg[i];
if( pSeg->pSeg==0 ){
/* no-op */
@@ -210778,35 +211998,43 @@ static void fts5TrimSegments(Fts5Index *p, Fts5Iter *pIter){
u8 aHdr[4] = {0x00, 0x00, 0x00, 0x00};
iLeafRowid = FTS5_SEGMENT_ROWID(iId, pSeg->iTermLeafPgno);
- pData = fts5DataRead(p, iLeafRowid);
+ pData = fts5LeafRead(p, iLeafRowid);
if( pData ){
- fts5BufferZero(&buf);
- fts5BufferGrow(&p->rc, &buf, pData->nn);
- fts5BufferAppendBlob(&p->rc, &buf, sizeof(aHdr), aHdr);
- fts5BufferAppendVarint(&p->rc, &buf, pSeg->term.n);
- fts5BufferAppendBlob(&p->rc, &buf, pSeg->term.n, pSeg->term.p);
- fts5BufferAppendBlob(&p->rc, &buf, pData->szLeaf-iOff, &pData->p[iOff]);
- if( p->rc==SQLITE_OK ){
- /* Set the szLeaf field */
- fts5PutU16(&buf.p[2], (u16)buf.n);
- }
+ if( iOff>pData->szLeaf ){
+ /* This can occur if the pages that the segments occupy overlap - if
+ ** a single page has been assigned to more than one segment. In
+ ** this case a prior iteration of this loop may have corrupted the
+ ** segment currently being trimmed. */
+ p->rc = FTS5_CORRUPT;
+ }else{
+ fts5BufferZero(&buf);
+ fts5BufferGrow(&p->rc, &buf, pData->nn);
+ fts5BufferAppendBlob(&p->rc, &buf, sizeof(aHdr), aHdr);
+ fts5BufferAppendVarint(&p->rc, &buf, pSeg->term.n);
+ fts5BufferAppendBlob(&p->rc, &buf, pSeg->term.n, pSeg->term.p);
+ fts5BufferAppendBlob(&p->rc, &buf, pData->szLeaf-iOff,&pData->p[iOff]);
+ if( p->rc==SQLITE_OK ){
+ /* Set the szLeaf field */
+ fts5PutU16(&buf.p[2], (u16)buf.n);
+ }
- /* Set up the new page-index array */
- fts5BufferAppendVarint(&p->rc, &buf, 4);
- if( pSeg->iLeafPgno==pSeg->iTermLeafPgno
- && pSeg->iEndofDoclist<pData->szLeaf
- ){
- int nDiff = pData->szLeaf - pSeg->iEndofDoclist;
- fts5BufferAppendVarint(&p->rc, &buf, buf.n - 1 - nDiff - 4);
- fts5BufferAppendBlob(&p->rc, &buf,
- pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff]
- );
- }
+ /* Set up the new page-index array */
+ fts5BufferAppendVarint(&p->rc, &buf, 4);
+ if( pSeg->iLeafPgno==pSeg->iTermLeafPgno
+ && pSeg->iEndofDoclist<pData->szLeaf
+ ){
+ int nDiff = pData->szLeaf - pSeg->iEndofDoclist;
+ fts5BufferAppendVarint(&p->rc, &buf, buf.n - 1 - nDiff - 4);
+ fts5BufferAppendBlob(&p->rc, &buf,
+ pData->nn - pSeg->iPgidxOff, &pData->p[pSeg->iPgidxOff]
+ );
+ }
+ pSeg->pSeg->pgnoFirst = pSeg->iTermLeafPgno;
+ fts5DataDelete(p, FTS5_SEGMENT_ROWID(iId, 1), iLeafRowid);
+ fts5DataWrite(p, iLeafRowid, buf.p, buf.n);
+ }
fts5DataRelease(pData);
- pSeg->pSeg->pgnoFirst = pSeg->iTermLeafPgno;
- fts5DataDelete(p, FTS5_SEGMENT_ROWID(iId, 1), iLeafRowid);
- fts5DataWrite(p, iLeafRowid, buf.p, buf.n);
}
}
}
@@ -210898,7 +212126,7 @@ static void fts5IndexMergeLevel(
const u8 *pTerm;
pTerm = fts5MultiIterTerm(pIter, &nTerm);
- if( nTerm!=term.n || memcmp(pTerm, term.p, nTerm) ){
+ if( nTerm!=term.n || fts5Memcmp(pTerm, term.p, nTerm) ){
if( pnRem && writer.nLeafWritten>nRem ){
break;
}
@@ -211153,6 +212381,7 @@ static void fts5FlushOneHash(Fts5Index *p){
/* Write the term for this entry to disk. */
sqlite3Fts5HashScanEntry(pHash, &zTerm, &pDoclist, &nDoclist);
fts5WriteAppendTerm(p, &writer, (int)strlen(zTerm), (const u8*)zTerm);
+ if( p->rc!=SQLITE_OK ) break;
assert( writer.bFirstRowidInPage==0 );
if( pgsz>=(pBuf->n + pPgidx->n + nDoclist + 1) ){
@@ -211175,6 +212404,7 @@ static void fts5FlushOneHash(Fts5Index *p){
pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iRowid);
writer.bFirstRowidInPage = 0;
fts5WriteDlidxAppend(p, &writer, iRowid);
+ if( p->rc!=SQLITE_OK ) break;
}else{
pBuf->n += sqlite3Fts5PutVarint(&pBuf->p[pBuf->n], iDelta);
}
@@ -211232,7 +212462,7 @@ static void fts5FlushOneHash(Fts5Index *p){
/* TODO2: Doclist terminator written here. */
/* pBuf->p[pBuf->n++] = '\0'; */
assert( pBuf->n<=pBuf->nSpace );
- sqlite3Fts5HashScanNext(pHash);
+ if( p->rc==SQLITE_OK ) sqlite3Fts5HashScanNext(pHash);
}
sqlite3Fts5HashClear(pHash);
fts5WriteFinish(p, &writer, &pgnoLast);
@@ -211276,7 +212506,7 @@ static Fts5Structure *fts5IndexOptimizeStruct(
Fts5Structure *pStruct
){
Fts5Structure *pNew = 0;
- int nByte = sizeof(Fts5Structure);
+ sqlite3_int64 nByte = sizeof(Fts5Structure);
int nSeg = pStruct->nSegment;
int i;
@@ -211406,11 +212636,13 @@ static void fts5AppendPoslist(
Fts5Buffer *pBuf
){
int nData = pMulti->base.nData;
+ int nByte = nData + 9 + 9 + FTS5_DATA_ZERO_PADDING;
assert( nData>0 );
- if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nData+9+9) ){
+ if( p->rc==SQLITE_OK && 0==fts5BufferGrow(&p->rc, pBuf, nByte) ){
fts5BufferSafeAppendVarint(pBuf, iDelta);
fts5BufferSafeAppendVarint(pBuf, nData*2);
fts5BufferSafeAppendBlob(pBuf, pMulti->base.pData, nData);
+ memset(&pBuf->p[pBuf->n], 0, FTS5_DATA_ZERO_PADDING);
}
}
@@ -211591,6 +212823,8 @@ static void fts5MergePrefixLists(
int iOff2 = 0;
u8 *a1 = &i1.aPoslist[i1.nSize];
u8 *a2 = &i2.aPoslist[i2.nSize];
+ int nCopy;
+ u8 *aCopy;
i64 iPrev = 0;
Fts5PoslistWriter writer;
@@ -211622,7 +212856,7 @@ static void fts5MergePrefixLists(
sqlite3Fts5PoslistNext64(a1, i1.nPoslist, &iOff1, &iPos1);
if( iPos1<0 ) break;
}else{
- assert( iPos2!=iPrev );
+ assert_nc( iPos2!=iPrev );
sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
sqlite3Fts5PoslistNext64(a2, i2.nPoslist, &iOff2, &iPos2);
if( iPos2<0 ) break;
@@ -211634,11 +212868,16 @@ static void fts5MergePrefixLists(
if( iPos1!=iPrev ){
sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos1);
}
- fts5BufferSafeAppendBlob(&tmp, &a1[iOff1], i1.nPoslist-iOff1);
+ aCopy = &a1[iOff1];
+ nCopy = i1.nPoslist - iOff1;
}else{
assert( iPos2>=0 && iPos2!=iPrev );
sqlite3Fts5PoslistSafeAppend(&tmp, &iPrev, iPos2);
- fts5BufferSafeAppendBlob(&tmp, &a2[iOff2], i2.nPoslist-iOff2);
+ aCopy = &a2[iOff2];
+ nCopy = i2.nPoslist - iOff2;
+ }
+ if( nCopy>0 ){
+ fts5BufferSafeAppendBlob(&tmp, aCopy, nCopy);
}
/* WRITEPOSLISTSIZE */
@@ -211646,6 +212885,7 @@ static void fts5MergePrefixLists(
fts5BufferSafeAppendBlob(&out, tmp.p, tmp.n);
fts5DoclistIterNext(&i1);
fts5DoclistIterNext(&i2);
+ assert( out.n<=(p1->n+p2->n+9) );
if( i1.aPoslist==0 || i2.aPoslist==0 ) break;
}
}
@@ -211747,7 +212987,7 @@ static void fts5SetupPrefixIter(
}
fts5MultiIterFree(p1);
- pData = fts5IdxMalloc(p, sizeof(Fts5Data) + doclist.n);
+ pData = fts5IdxMalloc(p, sizeof(Fts5Data)+doclist.n+FTS5_DATA_ZERO_PADDING);
if( pData ){
pData->p = (u8*)&pData[1];
pData->nn = pData->szLeaf = doclist.n;
@@ -212509,11 +213749,11 @@ static void fts5IndexIntegrityCheckSegment(
iOff = fts5LeafFirstTermOff(pLeaf);
iRowidOff = fts5LeafFirstRowidOff(pLeaf);
- if( iRowidOff>=iOff ){
+ if( iRowidOff>=iOff || iOff>=pLeaf->szLeaf ){
p->rc = FTS5_CORRUPT;
}else{
iOff += fts5GetVarint32(&pLeaf->p[iOff], nTerm);
- res = memcmp(&pLeaf->p[iOff], zIdxTerm, MIN(nTerm, nIdxTerm));
+ res = fts5Memcmp(&pLeaf->p[iOff], zIdxTerm, MIN(nTerm, nIdxTerm));
if( res==0 ) res = nTerm - nIdxTerm;
if( res<0 ) p->rc = FTS5_CORRUPT;
}
@@ -212908,7 +214148,7 @@ static void fts5DecodeFunction(
u8 *a = 0;
Fts5Buffer s; /* Build up text to return here */
int rc = SQLITE_OK; /* Return code */
- int nSpace = 0;
+ sqlite3_int64 nSpace = 0;
int eDetailNone = (sqlite3_user_data(pCtx)!=0);
assert( nArg==2 );
@@ -212924,8 +214164,7 @@ static void fts5DecodeFunction(
nSpace = n + FTS5_DATA_ZERO_PADDING;
a = (u8*)sqlite3Fts5MallocZero(&rc, nSpace);
if( a==0 ) goto decode_out;
- memcpy(a, aBlob, n);
-
+ if( n>0 ) memcpy(a, aBlob, n);
fts5DecodeRowid(iRowid, &iSegid, &bDlidx, &iHeight, &iPgno);
@@ -213020,6 +214259,9 @@ static void fts5DecodeFunction(
iPgidxOff = szLeaf = fts5GetU16(&a[2]);
if( iPgidxOff<n ){
fts5GetVarint32(&a[iPgidxOff], iTermOff);
+ }else if( iPgidxOff>n ){
+ rc = FTS5_CORRUPT;
+ goto decode_out;
}
}
@@ -213031,14 +214273,22 @@ static void fts5DecodeFunction(
}else{
iOff = szLeaf;
}
+ if( iOff>n ){
+ rc = FTS5_CORRUPT;
+ goto decode_out;
+ }
fts5DecodePoslist(&rc, &s, &a[4], iOff-4);
/* Decode any more doclist data that appears on the page before the
** first term. */
nDoclist = (iTermOff ? iTermOff : szLeaf) - iOff;
+ if( nDoclist+iOff>n ){
+ rc = FTS5_CORRUPT;
+ goto decode_out;
+ }
fts5DecodeDoclist(&rc, &s, &a[iOff], nDoclist);
- while( iPgidxOff<n ){
+ while( iPgidxOff<n && rc==SQLITE_OK ){
int bFirst = (iPgidxOff==szLeaf); /* True for first term on page */
int nByte; /* Bytes of data */
int iEnd;
@@ -213053,12 +214303,24 @@ static void fts5DecodeFunction(
}else{
iEnd = szLeaf;
}
+ if( iEnd>szLeaf ){
+ rc = FTS5_CORRUPT;
+ break;
+ }
if( bFirst==0 ){
iOff += fts5GetVarint32(&a[iOff], nByte);
+ if( nByte>term.n ){
+ rc = FTS5_CORRUPT;
+ break;
+ }
term.n = nByte;
}
iOff += fts5GetVarint32(&a[iOff], nByte);
+ if( iOff+nByte>n ){
+ rc = FTS5_CORRUPT;
+ break;
+ }
fts5BufferAppendBlob(&rc, &term, nByte, &a[iOff]);
iOff += nByte;
@@ -213182,8 +214444,8 @@ SQLITE_API int sqlite3_fts5_may_be_corrupt = 1;
typedef struct Fts5Auxdata Fts5Auxdata;
typedef struct Fts5Auxiliary Fts5Auxiliary;
typedef struct Fts5Cursor Fts5Cursor;
+typedef struct Fts5FullTable Fts5FullTable;
typedef struct Fts5Sorter Fts5Sorter;
-typedef struct Fts5Table Fts5Table;
typedef struct Fts5TokenizerModule Fts5TokenizerModule;
/*
@@ -213264,13 +214526,8 @@ struct Fts5TokenizerModule {
Fts5TokenizerModule *pNext; /* Next registered tokenizer module */
};
-/*
-** Virtual-table object.
-*/
-struct Fts5Table {
- sqlite3_vtab base; /* Base class used by SQLite core */
- Fts5Config *pConfig; /* Virtual table configuration */
- Fts5Index *pIndex; /* Full-text index */
+struct Fts5FullTable {
+ Fts5Table p; /* Public class members from fts5Int.h */
Fts5Storage *pStorage; /* Document store */
Fts5Global *pGlobal; /* Global (connection wide) data */
Fts5Cursor *pSortCsr; /* Sort data from this cursor */
@@ -213408,7 +214665,7 @@ struct Fts5Auxdata {
#define FTS5_SAVEPOINT 5
#define FTS5_RELEASE 6
#define FTS5_ROLLBACKTO 7
-static void fts5CheckTransactionState(Fts5Table *p, int op, int iSavepoint){
+static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){
switch( op ){
case FTS5_BEGIN:
assert( p->ts.eState==0 );
@@ -213447,7 +214704,7 @@ static void fts5CheckTransactionState(Fts5Table *p, int op, int iSavepoint){
case FTS5_ROLLBACKTO:
assert( p->ts.eState==1 );
- assert( iSavepoint>=0 );
+ assert( iSavepoint>=-1 );
assert( iSavepoint<=p->ts.iSavepoint );
p->ts.iSavepoint = iSavepoint;
break;
@@ -213460,18 +214717,18 @@ static void fts5CheckTransactionState(Fts5Table *p, int op, int iSavepoint){
/*
** Return true if pTab is a contentless table.
*/
-static int fts5IsContentless(Fts5Table *pTab){
- return pTab->pConfig->eContent==FTS5_CONTENT_NONE;
+static int fts5IsContentless(Fts5FullTable *pTab){
+ return pTab->p.pConfig->eContent==FTS5_CONTENT_NONE;
}
/*
** Delete a virtual table handle allocated by fts5InitVtab().
*/
-static void fts5FreeVtab(Fts5Table *pTab){
+static void fts5FreeVtab(Fts5FullTable *pTab){
if( pTab ){
- sqlite3Fts5IndexClose(pTab->pIndex);
+ sqlite3Fts5IndexClose(pTab->p.pIndex);
sqlite3Fts5StorageClose(pTab->pStorage);
- sqlite3Fts5ConfigFree(pTab->pConfig);
+ sqlite3Fts5ConfigFree(pTab->p.pConfig);
sqlite3_free(pTab);
}
}
@@ -213480,7 +214737,7 @@ static void fts5FreeVtab(Fts5Table *pTab){
** The xDisconnect() virtual table method.
*/
static int fts5DisconnectMethod(sqlite3_vtab *pVtab){
- fts5FreeVtab((Fts5Table*)pVtab);
+ fts5FreeVtab((Fts5FullTable*)pVtab);
return SQLITE_OK;
}
@@ -213491,7 +214748,7 @@ static int fts5DestroyMethod(sqlite3_vtab *pVtab){
Fts5Table *pTab = (Fts5Table*)pVtab;
int rc = sqlite3Fts5DropAll(pTab->pConfig);
if( rc==SQLITE_OK ){
- fts5FreeVtab((Fts5Table*)pVtab);
+ fts5FreeVtab((Fts5FullTable*)pVtab);
}
return rc;
}
@@ -213520,28 +214777,28 @@ static int fts5InitVtab(
const char **azConfig = (const char**)argv;
int rc = SQLITE_OK; /* Return code */
Fts5Config *pConfig = 0; /* Results of parsing argc/argv */
- Fts5Table *pTab = 0; /* New virtual table object */
+ Fts5FullTable *pTab = 0; /* New virtual table object */
/* Allocate the new vtab object and parse the configuration */
- pTab = (Fts5Table*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Table));
+ pTab = (Fts5FullTable*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5FullTable));
if( rc==SQLITE_OK ){
rc = sqlite3Fts5ConfigParse(pGlobal, db, argc, azConfig, &pConfig, pzErr);
assert( (rc==SQLITE_OK && *pzErr==0) || pConfig==0 );
}
if( rc==SQLITE_OK ){
- pTab->pConfig = pConfig;
+ pTab->p.pConfig = pConfig;
pTab->pGlobal = pGlobal;
}
/* Open the index sub-system */
if( rc==SQLITE_OK ){
- rc = sqlite3Fts5IndexOpen(pConfig, bCreate, &pTab->pIndex, pzErr);
+ rc = sqlite3Fts5IndexOpen(pConfig, bCreate, &pTab->p.pIndex, pzErr);
}
/* Open the storage sub-system */
if( rc==SQLITE_OK ){
rc = sqlite3Fts5StorageOpen(
- pConfig, pTab->pIndex, bCreate, &pTab->pStorage, pzErr
+ pConfig, pTab->p.pIndex, bCreate, &pTab->pStorage, pzErr
);
}
@@ -213554,8 +214811,8 @@ static int fts5InitVtab(
if( rc==SQLITE_OK ){
assert( pConfig->pzErrmsg==0 );
pConfig->pzErrmsg = pzErr;
- rc = sqlite3Fts5IndexLoadConfig(pTab->pIndex);
- sqlite3Fts5IndexRollback(pTab->pIndex);
+ rc = sqlite3Fts5IndexLoadConfig(pTab->p.pIndex);
+ sqlite3Fts5IndexRollback(pTab->p.pIndex);
pConfig->pzErrmsg = 0;
}
@@ -213768,7 +215025,7 @@ static int fts5BestIndexMethod(sqlite3_vtab *pVTab, sqlite3_index_info *pInfo){
return SQLITE_OK;
}
-static int fts5NewTransaction(Fts5Table *pTab){
+static int fts5NewTransaction(Fts5FullTable *pTab){
Fts5Cursor *pCsr;
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){
if( pCsr->base.pVtab==(sqlite3_vtab*)pTab ) return SQLITE_OK;
@@ -213780,16 +215037,16 @@ static int fts5NewTransaction(Fts5Table *pTab){
** Implementation of xOpen method.
*/
static int fts5OpenMethod(sqlite3_vtab *pVTab, sqlite3_vtab_cursor **ppCsr){
- Fts5Table *pTab = (Fts5Table*)pVTab;
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVTab;
+ Fts5Config *pConfig = pTab->p.pConfig;
Fts5Cursor *pCsr = 0; /* New cursor object */
- int nByte; /* Bytes of space to allocate */
+ sqlite3_int64 nByte; /* Bytes of space to allocate */
int rc; /* Return code */
rc = fts5NewTransaction(pTab);
if( rc==SQLITE_OK ){
nByte = sizeof(Fts5Cursor) + pConfig->nCol * sizeof(int);
- pCsr = (Fts5Cursor*)sqlite3_malloc(nByte);
+ pCsr = (Fts5Cursor*)sqlite3_malloc64(nByte);
if( pCsr ){
Fts5Global *pGlobal = pTab->pGlobal;
memset(pCsr, 0, nByte);
@@ -213827,7 +215084,7 @@ static void fts5CsrNewrow(Fts5Cursor *pCsr){
}
static void fts5FreeCursorComponents(Fts5Cursor *pCsr){
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
Fts5Auxdata *pData;
Fts5Auxdata *pNext;
@@ -213871,7 +215128,7 @@ static void fts5FreeCursorComponents(Fts5Cursor *pCsr){
*/
static int fts5CloseMethod(sqlite3_vtab_cursor *pCursor){
if( pCursor ){
- Fts5Table *pTab = (Fts5Table*)(pCursor->pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCursor->pVtab);
Fts5Cursor *pCsr = (Fts5Cursor*)pCursor;
Fts5Cursor **pp;
@@ -213928,7 +215185,7 @@ static int fts5SorterNext(Fts5Cursor *pCsr){
** Set the FTS5CSR_REQUIRE_RESEEK flag on all FTS5_PLAN_MATCH cursors
** open on table pTab.
*/
-static void fts5TripCursors(Fts5Table *pTab){
+static void fts5TripCursors(Fts5FullTable *pTab){
Fts5Cursor *pCsr;
for(pCsr=pTab->pGlobal->pCsr; pCsr; pCsr=pCsr->pNext){
if( pCsr->ePlan==FTS5_PLAN_MATCH
@@ -213955,11 +215212,11 @@ static int fts5CursorReseek(Fts5Cursor *pCsr, int *pbSkip){
int rc = SQLITE_OK;
assert( *pbSkip==0 );
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_RESEEK) ){
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
int bDesc = pCsr->bDesc;
i64 iRowid = sqlite3Fts5ExprRowid(pCsr->pExpr);
- rc = sqlite3Fts5ExprFirst(pCsr->pExpr, pTab->pIndex, iRowid, bDesc);
+ rc = sqlite3Fts5ExprFirst(pCsr->pExpr, pTab->p.pIndex, iRowid, bDesc);
if( rc==SQLITE_OK && iRowid!=sqlite3Fts5ExprRowid(pCsr->pExpr) ){
*pbSkip = 1;
}
@@ -214056,18 +215313,22 @@ static int fts5PrepareStatement(
return rc;
}
-static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){
- Fts5Config *pConfig = pTab->pConfig;
+static int fts5CursorFirstSorted(
+ Fts5FullTable *pTab,
+ Fts5Cursor *pCsr,
+ int bDesc
+){
+ Fts5Config *pConfig = pTab->p.pConfig;
Fts5Sorter *pSorter;
int nPhrase;
- int nByte;
+ sqlite3_int64 nByte;
int rc;
const char *zRank = pCsr->zRank;
const char *zRankArgs = pCsr->zRankArgs;
nPhrase = sqlite3Fts5ExprPhraseCount(pCsr->pExpr);
nByte = sizeof(Fts5Sorter) + sizeof(int) * (nPhrase-1);
- pSorter = (Fts5Sorter*)sqlite3_malloc(nByte);
+ pSorter = (Fts5Sorter*)sqlite3_malloc64(nByte);
if( pSorter==0 ) return SQLITE_NOMEM;
memset(pSorter, 0, nByte);
pSorter->nIdx = nPhrase;
@@ -214104,10 +215365,10 @@ static int fts5CursorFirstSorted(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){
return rc;
}
-static int fts5CursorFirst(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){
+static int fts5CursorFirst(Fts5FullTable *pTab, Fts5Cursor *pCsr, int bDesc){
int rc;
Fts5Expr *pExpr = pCsr->pExpr;
- rc = sqlite3Fts5ExprFirst(pExpr, pTab->pIndex, pCsr->iFirstRowid, bDesc);
+ rc = sqlite3Fts5ExprFirst(pExpr, pTab->p.pIndex, pCsr->iFirstRowid, bDesc);
if( sqlite3Fts5ExprEof(pExpr) ){
CsrFlagSet(pCsr, FTS5CSR_EOF);
}
@@ -214122,7 +215383,7 @@ static int fts5CursorFirst(Fts5Table *pTab, Fts5Cursor *pCsr, int bDesc){
** parameters.
*/
static int fts5SpecialMatch(
- Fts5Table *pTab,
+ Fts5FullTable *pTab,
Fts5Cursor *pCsr,
const char *zQuery
){
@@ -214133,18 +215394,18 @@ static int fts5SpecialMatch(
while( z[0]==' ' ) z++;
for(n=0; z[n] && z[n]!=' '; n++);
- assert( pTab->base.zErrMsg==0 );
+ assert( pTab->p.base.zErrMsg==0 );
pCsr->ePlan = FTS5_PLAN_SPECIAL;
if( 0==sqlite3_strnicmp("reads", z, n) ){
- pCsr->iSpecial = sqlite3Fts5IndexReads(pTab->pIndex);
+ pCsr->iSpecial = sqlite3Fts5IndexReads(pTab->p.pIndex);
}
else if( 0==sqlite3_strnicmp("id", z, n) ){
pCsr->iSpecial = pCsr->iCsrId;
}
else{
/* An unrecognized directive. Return an error message. */
- pTab->base.zErrMsg = sqlite3_mprintf("unknown special query: %.*s", n, z);
+ pTab->p.base.zErrMsg = sqlite3_mprintf("unknown special query: %.*s", n, z);
rc = SQLITE_ERROR;
}
@@ -214156,7 +215417,7 @@ static int fts5SpecialMatch(
** pTab. If one is found, return a pointer to the corresponding Fts5Auxiliary
** structure. Otherwise, if no such function exists, return NULL.
*/
-static Fts5Auxiliary *fts5FindAuxiliary(Fts5Table *pTab, const char *zName){
+static Fts5Auxiliary *fts5FindAuxiliary(Fts5FullTable *pTab, const char *zName){
Fts5Auxiliary *pAux;
for(pAux=pTab->pGlobal->pAux; pAux; pAux=pAux->pNext){
@@ -214169,8 +215430,8 @@ static Fts5Auxiliary *fts5FindAuxiliary(Fts5Table *pTab, const char *zName){
static int fts5FindRankFunction(Fts5Cursor *pCsr){
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
+ Fts5Config *pConfig = pTab->p.pConfig;
int rc = SQLITE_OK;
Fts5Auxiliary *pAux = 0;
const char *zRank = pCsr->zRank;
@@ -214186,7 +215447,7 @@ static int fts5FindRankFunction(Fts5Cursor *pCsr){
assert( rc==SQLITE_OK || pCsr->pRankArgStmt==0 );
if( rc==SQLITE_OK ){
if( SQLITE_ROW==sqlite3_step(pStmt) ){
- int nByte;
+ sqlite3_int64 nByte;
pCsr->nRankArg = sqlite3_column_count(pStmt);
nByte = sizeof(sqlite3_value*)*pCsr->nRankArg;
pCsr->apRankArg = (sqlite3_value**)sqlite3Fts5MallocZero(&rc, nByte);
@@ -214208,8 +215469,8 @@ static int fts5FindRankFunction(Fts5Cursor *pCsr){
if( rc==SQLITE_OK ){
pAux = fts5FindAuxiliary(pTab, zRank);
if( pAux==0 ){
- assert( pTab->base.zErrMsg==0 );
- pTab->base.zErrMsg = sqlite3_mprintf("no such function: %s", zRank);
+ assert( pTab->p.base.zErrMsg==0 );
+ pTab->p.base.zErrMsg = sqlite3_mprintf("no such function: %s", zRank);
rc = SQLITE_ERROR;
}
}
@@ -214284,8 +215545,8 @@ static int fts5FilterMethod(
int nVal, /* Number of elements in apVal */
sqlite3_value **apVal /* Arguments for the indexing scheme */
){
- Fts5Table *pTab = (Fts5Table*)(pCursor->pVtab);
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCursor->pVtab);
+ Fts5Config *pConfig = pTab->p.pConfig;
Fts5Cursor *pCsr = (Fts5Cursor*)pCursor;
int rc = SQLITE_OK; /* Error code */
int iVal = 0; /* Counter for apVal[] */
@@ -214314,8 +215575,8 @@ static int fts5FilterMethod(
assert( pCsr->zRank==0 );
assert( pCsr->zRankArgs==0 );
- assert( pzErrmsg==0 || pzErrmsg==&pTab->base.zErrMsg );
- pConfig->pzErrmsg = &pTab->base.zErrMsg;
+ assert( pzErrmsg==0 || pzErrmsg==&pTab->p.base.zErrMsg );
+ pConfig->pzErrmsg = &pTab->p.base.zErrMsg;
/* Decode the arguments passed through to this function.
**
@@ -214381,7 +215642,7 @@ static int fts5FilterMethod(
** but a request for an internal parameter. */
rc = fts5SpecialMatch(pTab, pCsr, &zExpr[1]);
}else{
- char **pzErr = &pTab->base.zErrMsg;
+ char **pzErr = &pTab->p.base.zErrMsg;
rc = sqlite3Fts5ExprNew(pConfig, iCol, zExpr, &pCsr->pExpr, pzErr);
if( rc==SQLITE_OK ){
if( bOrderByRank ){
@@ -214404,7 +215665,7 @@ static int fts5FilterMethod(
** by rowid (ePlan==FTS5_PLAN_ROWID). */
pCsr->ePlan = (pRowidEq ? FTS5_PLAN_ROWID : FTS5_PLAN_SCAN);
rc = sqlite3Fts5StorageStmt(
- pTab->pStorage, fts5StmtType(pCsr), &pCsr->pStmt, &pTab->base.zErrMsg
+ pTab->pStorage, fts5StmtType(pCsr), &pCsr->pStmt, &pTab->p.base.zErrMsg
);
if( rc==SQLITE_OK ){
if( pCsr->ePlan==FTS5_PLAN_ROWID ){
@@ -214487,12 +215748,12 @@ static int fts5SeekCursor(Fts5Cursor *pCsr, int bErrormsg){
/* If the cursor does not yet have a statement handle, obtain one now. */
if( pCsr->pStmt==0 ){
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
int eStmt = fts5StmtType(pCsr);
rc = sqlite3Fts5StorageStmt(
- pTab->pStorage, eStmt, &pCsr->pStmt, (bErrormsg?&pTab->base.zErrMsg:0)
+ pTab->pStorage, eStmt, &pCsr->pStmt, (bErrormsg?&pTab->p.base.zErrMsg:0)
);
- assert( rc!=SQLITE_OK || pTab->base.zErrMsg==0 );
+ assert( rc!=SQLITE_OK || pTab->p.base.zErrMsg==0 );
assert( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_CONTENT) );
}
@@ -214514,11 +215775,11 @@ static int fts5SeekCursor(Fts5Cursor *pCsr, int bErrormsg){
return rc;
}
-static void fts5SetVtabError(Fts5Table *p, const char *zFormat, ...){
+static void fts5SetVtabError(Fts5FullTable *p, const char *zFormat, ...){
va_list ap; /* ... printf arguments */
va_start(ap, zFormat);
- assert( p->base.zErrMsg==0 );
- p->base.zErrMsg = sqlite3_vmprintf(zFormat, ap);
+ assert( p->p.base.zErrMsg==0 );
+ p->p.base.zErrMsg = sqlite3_vmprintf(zFormat, ap);
va_end(ap);
}
@@ -214538,11 +215799,11 @@ static void fts5SetVtabError(Fts5Table *p, const char *zFormat, ...){
** more commands are added to this function.
*/
static int fts5SpecialInsert(
- Fts5Table *pTab, /* Fts5 table object */
+ Fts5FullTable *pTab, /* Fts5 table object */
const char *zCmd, /* Text inserted into table-name column */
sqlite3_value *pVal /* Value inserted into rank column */
){
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5Config *pConfig = pTab->p.pConfig;
int rc = SQLITE_OK;
int bError = 0;
@@ -214577,9 +215838,9 @@ static int fts5SpecialInsert(
pConfig->bPrefixIndex = sqlite3_value_int(pVal);
#endif
}else{
- rc = sqlite3Fts5IndexLoadConfig(pTab->pIndex);
+ rc = sqlite3Fts5IndexLoadConfig(pTab->p.pIndex);
if( rc==SQLITE_OK ){
- rc = sqlite3Fts5ConfigSetValue(pTab->pConfig, zCmd, pVal, &bError);
+ rc = sqlite3Fts5ConfigSetValue(pTab->p.pConfig, zCmd, pVal, &bError);
}
if( rc==SQLITE_OK ){
if( bError ){
@@ -214593,7 +215854,7 @@ static int fts5SpecialInsert(
}
static int fts5SpecialDelete(
- Fts5Table *pTab,
+ Fts5FullTable *pTab,
sqlite3_value **apVal
){
int rc = SQLITE_OK;
@@ -214607,7 +215868,7 @@ static int fts5SpecialDelete(
static void fts5StorageInsert(
int *pRc,
- Fts5Table *pTab,
+ Fts5FullTable *pTab,
sqlite3_value **apVal,
i64 *piRowid
){
@@ -214641,8 +215902,8 @@ static int fts5UpdateMethod(
sqlite3_value **apVal, /* Array of arguments */
sqlite_int64 *pRowid /* OUT: The affected (or effected) rowid */
){
- Fts5Table *pTab = (Fts5Table*)pVtab;
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVtab;
+ Fts5Config *pConfig = pTab->p.pConfig;
int eType0; /* value_type() of apVal[0] */
int rc = SQLITE_OK; /* Return code */
@@ -214651,12 +215912,11 @@ static int fts5UpdateMethod(
assert( pVtab->zErrMsg==0 );
assert( nArg==1 || nArg==(2+pConfig->nCol+2) );
- assert( nArg==1
- || sqlite3_value_type(apVal[1])==SQLITE_INTEGER
- || sqlite3_value_type(apVal[1])==SQLITE_NULL
+ assert( sqlite3_value_type(apVal[0])==SQLITE_INTEGER
+ || sqlite3_value_type(apVal[0])==SQLITE_NULL
);
- assert( pTab->pConfig->pzErrmsg==0 );
- pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg;
+ assert( pTab->p.pConfig->pzErrmsg==0 );
+ pTab->p.pConfig->pzErrmsg = &pTab->p.base.zErrMsg;
/* Put any active cursors into REQUIRE_SEEK state. */
fts5TripCursors(pTab);
@@ -214697,7 +215957,7 @@ static int fts5UpdateMethod(
/* Filter out attempts to run UPDATE or DELETE on contentless tables.
** This is not suported. */
if( eType0==SQLITE_INTEGER && fts5IsContentless(pTab) ){
- pTab->base.zErrMsg = sqlite3_mprintf(
+ pTab->p.base.zErrMsg = sqlite3_mprintf(
"cannot %s contentless fts5 table: %s",
(nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName
);
@@ -214710,46 +215970,52 @@ static int fts5UpdateMethod(
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, 0);
}
- /* INSERT */
- else if( eType0!=SQLITE_INTEGER ){
- /* If this is a REPLACE, first remove the current entry (if any) */
- if( eConflict==SQLITE_REPLACE
- && sqlite3_value_type(apVal[1])==SQLITE_INTEGER
- ){
- i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */
- rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0);
+ /* INSERT or UPDATE */
+ else{
+ int eType1 = sqlite3_value_numeric_type(apVal[1]);
+
+ if( eType1!=SQLITE_INTEGER && eType1!=SQLITE_NULL ){
+ rc = SQLITE_MISMATCH;
}
- fts5StorageInsert(&rc, pTab, apVal, pRowid);
- }
- /* UPDATE */
- else{
- i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
- i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
- if( iOld!=iNew ){
- if( eConflict==SQLITE_REPLACE ){
- rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0);
- if( rc==SQLITE_OK ){
- rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0);
- }
- fts5StorageInsert(&rc, pTab, apVal, pRowid);
- }else{
- rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, apVal, pRowid);
- if( rc==SQLITE_OK ){
+ else if( eType0!=SQLITE_INTEGER ){
+ /* If this is a REPLACE, first remove the current entry (if any) */
+ if( eConflict==SQLITE_REPLACE && eType1==SQLITE_INTEGER ){
+ i64 iNew = sqlite3_value_int64(apVal[1]); /* Rowid to delete */
+ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0);
+ }
+ fts5StorageInsert(&rc, pTab, apVal, pRowid);
+ }
+
+ /* UPDATE */
+ else{
+ i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
+ i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
+ if( eType1==SQLITE_INTEGER && iOld!=iNew ){
+ if( eConflict==SQLITE_REPLACE ){
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0);
+ }
+ fts5StorageInsert(&rc, pTab, apVal, pRowid);
+ }else{
+ rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, apVal, pRowid);
+ if( rc==SQLITE_OK ){
+ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0);
+ }
+ if( rc==SQLITE_OK ){
+ rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal,*pRowid);
+ }
}
- if( rc==SQLITE_OK ){
- rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal, *pRowid);
- }
+ }else{
+ rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0);
+ fts5StorageInsert(&rc, pTab, apVal, pRowid);
}
- }else{
- rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0);
- fts5StorageInsert(&rc, pTab, apVal, pRowid);
}
}
}
- pTab->pConfig->pzErrmsg = 0;
+ pTab->p.pConfig->pzErrmsg = 0;
return rc;
}
@@ -214758,12 +216024,12 @@ static int fts5UpdateMethod(
*/
static int fts5SyncMethod(sqlite3_vtab *pVtab){
int rc;
- Fts5Table *pTab = (Fts5Table*)pVtab;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVtab;
fts5CheckTransactionState(pTab, FTS5_SYNC, 0);
- pTab->pConfig->pzErrmsg = &pTab->base.zErrMsg;
+ pTab->p.pConfig->pzErrmsg = &pTab->p.base.zErrMsg;
fts5TripCursors(pTab);
rc = sqlite3Fts5StorageSync(pTab->pStorage);
- pTab->pConfig->pzErrmsg = 0;
+ pTab->p.pConfig->pzErrmsg = 0;
return rc;
}
@@ -214771,8 +216037,8 @@ static int fts5SyncMethod(sqlite3_vtab *pVtab){
** Implementation of xBegin() method.
*/
static int fts5BeginMethod(sqlite3_vtab *pVtab){
- fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_BEGIN, 0);
- fts5NewTransaction((Fts5Table*)pVtab);
+ fts5CheckTransactionState((Fts5FullTable*)pVtab, FTS5_BEGIN, 0);
+ fts5NewTransaction((Fts5FullTable*)pVtab);
return SQLITE_OK;
}
@@ -214783,7 +216049,7 @@ static int fts5BeginMethod(sqlite3_vtab *pVtab){
*/
static int fts5CommitMethod(sqlite3_vtab *pVtab){
UNUSED_PARAM(pVtab); /* Call below is a no-op for NDEBUG builds */
- fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_COMMIT, 0);
+ fts5CheckTransactionState((Fts5FullTable*)pVtab, FTS5_COMMIT, 0);
return SQLITE_OK;
}
@@ -214793,7 +216059,7 @@ static int fts5CommitMethod(sqlite3_vtab *pVtab){
*/
static int fts5RollbackMethod(sqlite3_vtab *pVtab){
int rc;
- Fts5Table *pTab = (Fts5Table*)pVtab;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVtab;
fts5CheckTransactionState(pTab, FTS5_ROLLBACK, 0);
rc = sqlite3Fts5StorageRollback(pTab->pStorage);
return rc;
@@ -214817,13 +216083,13 @@ static int fts5ApiColumnTotalSize(
sqlite3_int64 *pnToken
){
Fts5Cursor *pCsr = (Fts5Cursor*)pCtx;
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
return sqlite3Fts5StorageSize(pTab->pStorage, iCol, pnToken);
}
static int fts5ApiRowCount(Fts5Context *pCtx, i64 *pnRow){
Fts5Cursor *pCsr = (Fts5Cursor*)pCtx;
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
return sqlite3Fts5StorageRowCount(pTab->pStorage, pnRow);
}
@@ -214858,7 +216124,9 @@ static int fts5ApiColumnText(
){
int rc = SQLITE_OK;
Fts5Cursor *pCsr = (Fts5Cursor*)pCtx;
- if( fts5IsContentless((Fts5Table*)(pCsr->base.pVtab)) ){
+ if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab))
+ || pCsr->ePlan==FTS5_PLAN_SPECIAL
+ ){
*pz = 0;
*pn = 0;
}else{
@@ -214927,10 +216195,11 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){
int rc = SQLITE_OK;
Fts5PoslistReader *aIter; /* One iterator for each phrase */
int nIter; /* Number of iterators/phrases */
+ int nCol = ((Fts5Table*)pCsr->base.pVtab)->pConfig->nCol;
nIter = sqlite3Fts5ExprPhraseCount(pCsr->pExpr);
if( pCsr->aInstIter==0 ){
- int nByte = sizeof(Fts5PoslistReader) * nIter;
+ sqlite3_int64 nByte = sizeof(Fts5PoslistReader) * nIter;
pCsr->aInstIter = (Fts5PoslistReader*)sqlite3Fts5MallocZero(&rc, nByte);
}
aIter = pCsr->aInstIter;
@@ -214965,7 +216234,7 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){
nInst++;
if( nInst>=pCsr->nInstAlloc ){
pCsr->nInstAlloc = pCsr->nInstAlloc ? pCsr->nInstAlloc*2 : 32;
- aInst = (int*)sqlite3_realloc(
+ aInst = (int*)sqlite3_realloc64(
pCsr->aInst, pCsr->nInstAlloc*sizeof(int)*3
);
if( aInst ){
@@ -214980,6 +216249,10 @@ static int fts5CacheInstArray(Fts5Cursor *pCsr){
aInst[0] = iBest;
aInst[1] = FTS5_POS2COLUMN(aIter[iBest].iPos);
aInst[2] = FTS5_POS2OFFSET(aIter[iBest].iPos);
+ if( aInst[1]<0 || aInst[1]>=nCol ){
+ rc = FTS5_CORRUPT;
+ break;
+ }
sqlite3Fts5PoslistReaderNext(&aIter[iBest]);
}
}
@@ -215052,8 +216325,8 @@ static int fts5ColumnSizeCb(
static int fts5ApiColumnSize(Fts5Context *pCtx, int iCol, int *pnToken){
Fts5Cursor *pCsr = (Fts5Cursor*)pCtx;
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
+ Fts5Config *pConfig = pTab->p.pConfig;
int rc = SQLITE_OK;
if( CsrFlagTest(pCsr, FTS5CSR_REQUIRE_DOCSIZE) ){
@@ -215309,7 +216582,7 @@ static int fts5ApiQueryPhrase(
int(*xCallback)(const Fts5ExtensionApi*, Fts5Context*, void*)
){
Fts5Cursor *pCsr = (Fts5Cursor*)pCtx;
- Fts5Table *pTab = (Fts5Table*)(pCsr->base.pVtab);
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCsr->base.pVtab);
int rc;
Fts5Cursor *pNew = 0;
@@ -215386,25 +216659,19 @@ static void fts5ApiCallback(
/*
-** Given cursor id iId, return a pointer to the corresponding Fts5Index
+** Given cursor id iId, return a pointer to the corresponding Fts5Table
** object. Or NULL If the cursor id does not exist.
-**
-** If successful, set *ppConfig to point to the associated config object
-** before returning.
*/
-static Fts5Index *sqlite3Fts5IndexFromCsrid(
+static Fts5Table *sqlite3Fts5TableFromCsrid(
Fts5Global *pGlobal, /* FTS5 global context for db handle */
- i64 iCsrId, /* Id of cursor to find */
- Fts5Config **ppConfig /* OUT: Configuration object */
+ i64 iCsrId /* Id of cursor to find */
){
Fts5Cursor *pCsr;
- Fts5Table *pTab;
-
pCsr = fts5CursorFromCsrid(pGlobal, iCsrId);
- pTab = (Fts5Table*)pCsr->base.pVtab;
- *ppConfig = pTab->pConfig;
-
- return pTab->pIndex;
+ if( pCsr ){
+ return (Fts5Table*)pCsr->base.pVtab;
+ }
+ return 0;
}
/*
@@ -215484,8 +216751,8 @@ static int fts5ColumnMethod(
sqlite3_context *pCtx, /* Context for sqlite3_result_xxx() calls */
int iCol /* Index of column to read value from */
){
- Fts5Table *pTab = (Fts5Table*)(pCursor->pVtab);
- Fts5Config *pConfig = pTab->pConfig;
+ Fts5FullTable *pTab = (Fts5FullTable*)(pCursor->pVtab);
+ Fts5Config *pConfig = pTab->p.pConfig;
Fts5Cursor *pCsr = (Fts5Cursor*)pCursor;
int rc = SQLITE_OK;
@@ -215537,7 +216804,7 @@ static int fts5FindFunctionMethod(
void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), /* OUT: Result */
void **ppArg /* OUT: User data for *pxFunc */
){
- Fts5Table *pTab = (Fts5Table*)pVtab;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVtab;
Fts5Auxiliary *pAux;
UNUSED_PARAM(nUnused);
@@ -215559,21 +216826,24 @@ static int fts5RenameMethod(
sqlite3_vtab *pVtab, /* Virtual table handle */
const char *zName /* New name of table */
){
- Fts5Table *pTab = (Fts5Table*)pVtab;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVtab;
return sqlite3Fts5StorageRename(pTab->pStorage, zName);
}
+static int sqlite3Fts5FlushToDisk(Fts5Table *pTab){
+ fts5TripCursors((Fts5FullTable*)pTab);
+ return sqlite3Fts5StorageSync(((Fts5FullTable*)pTab)->pStorage);
+}
+
/*
** The xSavepoint() method.
**
** Flush the contents of the pending-terms table to disk.
*/
static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){
- Fts5Table *pTab = (Fts5Table*)pVtab;
UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */
- fts5CheckTransactionState(pTab, FTS5_SAVEPOINT, iSavepoint);
- fts5TripCursors(pTab);
- return sqlite3Fts5StorageSync(pTab->pStorage);
+ fts5CheckTransactionState((Fts5FullTable*)pVtab, FTS5_SAVEPOINT, iSavepoint);
+ return sqlite3Fts5FlushToDisk((Fts5Table*)pVtab);
}
/*
@@ -215582,11 +216852,9 @@ static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){
** This is a no-op.
*/
static int fts5ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){
- Fts5Table *pTab = (Fts5Table*)pVtab;
UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */
- fts5CheckTransactionState(pTab, FTS5_RELEASE, iSavepoint);
- fts5TripCursors(pTab);
- return sqlite3Fts5StorageSync(pTab->pStorage);
+ fts5CheckTransactionState((Fts5FullTable*)pVtab, FTS5_RELEASE, iSavepoint);
+ return sqlite3Fts5FlushToDisk((Fts5Table*)pVtab);
}
/*
@@ -215595,7 +216863,7 @@ static int fts5ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){
** Discard the contents of the pending terms table.
*/
static int fts5RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){
- Fts5Table *pTab = (Fts5Table*)pVtab;
+ Fts5FullTable *pTab = (Fts5FullTable*)pVtab;
UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */
fts5CheckTransactionState(pTab, FTS5_ROLLBACKTO, iSavepoint);
fts5TripCursors(pTab);
@@ -215796,7 +217064,7 @@ static void fts5SourceIdFunc(
){
assert( nArg==0 );
UNUSED_PARAM2(nArg, apUnused);
- sqlite3_result_text(pCtx, "fts5: 2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9", -1, SQLITE_TRANSIENT);
+ sqlite3_result_text(pCtx, "fts5: 2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7", -1, SQLITE_TRANSIENT);
}
/*
@@ -216045,7 +217313,7 @@ static int fts5StorageGetStmt(
char *zBind;
int i;
- zBind = sqlite3_malloc(1 + nCol*2);
+ zBind = sqlite3_malloc64(1 + nCol*2);
if( zBind ){
for(i=0; i<nCol; i++){
zBind[i*2] = '?';
@@ -216066,8 +217334,9 @@ static int fts5StorageGetStmt(
if( zSql==0 ){
rc = SQLITE_NOMEM;
}else{
- rc = sqlite3_prepare_v3(pC->db, zSql, -1,
- SQLITE_PREPARE_PERSISTENT, &p->aStmt[eStmt], 0);
+ int f = SQLITE_PREPARE_PERSISTENT;
+ if( eStmt>FTS5_STMT_LOOKUP ) f |= SQLITE_PREPARE_NO_VTAB;
+ rc = sqlite3_prepare_v3(pC->db, zSql, -1, f, &p->aStmt[eStmt], 0);
sqlite3_free(zSql);
if( rc!=SQLITE_OK && pzErrMsg ){
*pzErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(pC->db));
@@ -216211,11 +217480,11 @@ static int sqlite3Fts5StorageOpen(
){
int rc = SQLITE_OK;
Fts5Storage *p; /* New object */
- int nByte; /* Bytes of space to allocate */
+ sqlite3_int64 nByte; /* Bytes of space to allocate */
nByte = sizeof(Fts5Storage) /* Fts5Storage object */
+ pConfig->nCol * sizeof(i64); /* Fts5Storage.aTotalSize[] */
- *pp = p = (Fts5Storage*)sqlite3_malloc(nByte);
+ *pp = p = (Fts5Storage*)sqlite3_malloc64(nByte);
if( !p ) return SQLITE_NOMEM;
memset(p, 0, nByte);
@@ -216226,7 +217495,7 @@ static int sqlite3Fts5StorageOpen(
if( bCreate ){
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
int nDefn = 32 + pConfig->nCol*10;
- char *zDefn = sqlite3_malloc(32 + pConfig->nCol * 10);
+ char *zDefn = sqlite3_malloc64(32 + (sqlite3_int64)pConfig->nCol * 10);
if( zDefn==0 ){
rc = SQLITE_NOMEM;
}else{
@@ -216517,7 +217786,7 @@ static int sqlite3Fts5StorageRebuild(Fts5Storage *p){
Fts5Config *pConfig = p->pConfig;
sqlite3_stmt *pScan = 0;
Fts5InsertCtx ctx;
- int rc;
+ int rc, rc2;
memset(&ctx, 0, sizeof(Fts5InsertCtx));
ctx.pStorage = p;
@@ -216556,6 +217825,8 @@ static int sqlite3Fts5StorageRebuild(Fts5Storage *p){
}
}
sqlite3_free(buf.p);
+ rc2 = sqlite3_reset(pScan);
+ if( rc==SQLITE_OK ) rc = rc2;
/* Write the averages record */
if( rc==SQLITE_OK ){
@@ -216805,7 +218076,7 @@ static int sqlite3Fts5StorageIntegrity(Fts5Storage *p){
memset(&ctx, 0, sizeof(Fts5IntegrityCtx));
ctx.pConfig = p->pConfig;
- aTotalSize = (i64*)sqlite3_malloc(pConfig->nCol * (sizeof(int)+sizeof(i64)));
+ aTotalSize = (i64*)sqlite3_malloc64(pConfig->nCol*(sizeof(int)+sizeof(i64)));
if( !aTotalSize ) return SQLITE_NOMEM;
aColSize = (int*)&aTotalSize[pConfig->nCol];
memset(aTotalSize, 0, sizeof(i64) * pConfig->nCol);
@@ -217005,7 +218276,13 @@ static int sqlite3Fts5StorageSize(Fts5Storage *p, int iCol, i64 *pnToken){
static int sqlite3Fts5StorageRowCount(Fts5Storage *p, i64 *pnRow){
int rc = fts5StorageLoadTotals(p, 0);
if( rc==SQLITE_OK ){
+ /* nTotalRow being zero does not necessarily indicate a corrupt
+ ** database - it might be that the FTS5 table really does contain zero
+ ** rows. However this function is only called from the xRowCount() API,
+ ** and there is no way for that API to be invoked if the table contains
+ ** no rows. Hence the FTS5_CORRUPT return. */
*pnRow = p->nTotalRow;
+ if( p->nTotalRow<=0 ) rc = FTS5_CORRUPT;
}
return rc;
}
@@ -217215,7 +218492,7 @@ static int fts5AsciiTokenize(
nByte = ie-is;
if( nByte>nFold ){
if( pFold!=aFold ) sqlite3_free(pFold);
- pFold = sqlite3_malloc(nByte*2);
+ pFold = sqlite3_malloc64((sqlite3_int64)nByte*2);
if( pFold==0 ){
rc = SQLITE_NOMEM;
break;
@@ -217297,13 +218574,18 @@ struct Unicode61Tokenizer {
unsigned char aTokenChar[128]; /* ASCII range token characters */
char *aFold; /* Buffer to fold text into */
int nFold; /* Size of aFold[] in bytes */
- int bRemoveDiacritic; /* True if remove_diacritics=1 is set */
+ int eRemoveDiacritic; /* True if remove_diacritics=1 is set */
int nException;
int *aiException;
unsigned char aCategory[32]; /* True for token char categories */
};
+/* Values for eRemoveDiacritic (must match internals of fts5_unicode2.c) */
+#define FTS5_REMOVE_DIACRITICS_NONE 0
+#define FTS5_REMOVE_DIACRITICS_SIMPLE 1
+#define FTS5_REMOVE_DIACRITICS_COMPLEX 2
+
static int fts5UnicodeAddExceptions(
Unicode61Tokenizer *p, /* Tokenizer object */
const char *z, /* Characters to treat as exceptions */
@@ -217314,13 +218596,14 @@ static int fts5UnicodeAddExceptions(
int *aNew;
if( n>0 ){
- aNew = (int*)sqlite3_realloc(p->aiException, (n+p->nException)*sizeof(int));
+ aNew = (int*)sqlite3_realloc64(p->aiException,
+ (n+p->nException)*sizeof(int));
if( aNew ){
int nNew = p->nException;
const unsigned char *zCsr = (const unsigned char*)z;
const unsigned char *zTerm = (const unsigned char*)&z[n];
while( zCsr<zTerm ){
- int iCode;
+ u32 iCode;
int bToken;
READ_UTF8(zCsr, zTerm, iCode);
if( iCode<128 ){
@@ -217332,7 +218615,7 @@ static int fts5UnicodeAddExceptions(
if( bToken!=bTokenChars && sqlite3Fts5UnicodeIsdiacritic(iCode)==0 ){
int i;
for(i=0; i<nNew; i++){
- if( aNew[i]>iCode ) break;
+ if( (u32)aNew[i]>iCode ) break;
}
memmove(&aNew[i+1], &aNew[i], (nNew-i)*sizeof(int));
aNew[i] = iCode;
@@ -217424,7 +218707,7 @@ static int fts5UnicodeCreate(
int i;
memset(p, 0, sizeof(Unicode61Tokenizer));
- p->bRemoveDiacritic = 1;
+ p->eRemoveDiacritic = FTS5_REMOVE_DIACRITICS_SIMPLE;
p->nFold = 64;
p->aFold = sqlite3_malloc(p->nFold * sizeof(char));
if( p->aFold==0 ){
@@ -217445,10 +218728,15 @@ static int fts5UnicodeCreate(
for(i=0; rc==SQLITE_OK && i<nArg; i+=2){
const char *zArg = azArg[i+1];
if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){
- if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1] ){
+ if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){
rc = SQLITE_ERROR;
+ }else{
+ p->eRemoveDiacritic = (zArg[0] - '0');
+ assert( p->eRemoveDiacritic==FTS5_REMOVE_DIACRITICS_NONE
+ || p->eRemoveDiacritic==FTS5_REMOVE_DIACRITICS_SIMPLE
+ || p->eRemoveDiacritic==FTS5_REMOVE_DIACRITICS_COMPLEX
+ );
}
- p->bRemoveDiacritic = (zArg[0]=='1');
}else
if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){
rc = fts5UnicodeAddExceptions(p, zArg, 1);
@@ -217482,7 +218770,7 @@ static int fts5UnicodeCreate(
*/
static int fts5UnicodeIsAlnum(Unicode61Tokenizer *p, int iCode){
return (
- p->aCategory[sqlite3Fts5UnicodeCategory(iCode)]
+ p->aCategory[sqlite3Fts5UnicodeCategory((u32)iCode)]
^ fts5UnicodeIsException(p, iCode)
);
}
@@ -217511,7 +218799,7 @@ static int fts5UnicodeTokenize(
/* Each iteration of this loop gobbles up a contiguous run of separators,
** then the next token. */
while( rc==SQLITE_OK ){
- int iCode; /* non-ASCII codepoint read from input */
+ u32 iCode; /* non-ASCII codepoint read from input */
char *zOut = aFold;
int is;
int ie;
@@ -217543,7 +218831,7 @@ static int fts5UnicodeTokenize(
/* Grow the output buffer so that there is sufficient space to fit the
** largest possible utf-8 character. */
if( zOut>pEnd ){
- aFold = sqlite3_malloc(nFold*2);
+ aFold = sqlite3_malloc64((sqlite3_int64)nFold*2);
if( aFold==0 ){
rc = SQLITE_NOMEM;
goto tokenize_done;
@@ -217562,7 +218850,7 @@ static int fts5UnicodeTokenize(
READ_UTF8(zCsr, zTerm, iCode);
if( fts5UnicodeIsAlnum(p,iCode)||sqlite3Fts5UnicodeIsdiacritic(iCode) ){
non_ascii_tokenchar:
- iCode = sqlite3Fts5UnicodeFold(iCode, p->bRemoveDiacritic);
+ iCode = sqlite3Fts5UnicodeFold(iCode, p->eRemoveDiacritic);
if( iCode ) WRITE_UTF8(zOut, iCode);
}else{
break;
@@ -218338,10 +219626,8 @@ static int sqlite3Fts5TokenizerInit(fts5_api *pApi){
return rc;
}
-
-
/*
-** 2012 May 25
+** 2012-05-25
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
@@ -218370,32 +219656,48 @@ static int sqlite3Fts5TokenizerInit(fts5_api *pApi){
** E"). The resuls of passing a codepoint that corresponds to an
** uppercase letter are undefined.
*/
-static int fts5_remove_diacritic(int c){
+static int fts5_remove_diacritic(int c, int bComplex){
unsigned short aDia[] = {
0, 1797, 1848, 1859, 1891, 1928, 1940, 1995,
2024, 2040, 2060, 2110, 2168, 2206, 2264, 2286,
2344, 2383, 2472, 2488, 2516, 2596, 2668, 2732,
2782, 2842, 2894, 2954, 2984, 3000, 3028, 3336,
- 3456, 3696, 3712, 3728, 3744, 3896, 3912, 3928,
- 3968, 4008, 4040, 4106, 4138, 4170, 4202, 4234,
- 4266, 4296, 4312, 4344, 4408, 4424, 4472, 4504,
- 6148, 6198, 6264, 6280, 6360, 6429, 6505, 6529,
- 61448, 61468, 61534, 61592, 61642, 61688, 61704, 61726,
- 61784, 61800, 61836, 61880, 61914, 61948, 61998, 62122,
- 62154, 62200, 62218, 62302, 62364, 62442, 62478, 62536,
- 62554, 62584, 62604, 62640, 62648, 62656, 62664, 62730,
- 62924, 63050, 63082, 63274, 63390,
+ 3456, 3696, 3712, 3728, 3744, 3766, 3832, 3896,
+ 3912, 3928, 3944, 3968, 4008, 4040, 4056, 4106,
+ 4138, 4170, 4202, 4234, 4266, 4296, 4312, 4344,
+ 4408, 4424, 4442, 4472, 4488, 4504, 6148, 6198,
+ 6264, 6280, 6360, 6429, 6505, 6529, 61448, 61468,
+ 61512, 61534, 61592, 61610, 61642, 61672, 61688, 61704,
+ 61726, 61784, 61800, 61816, 61836, 61880, 61896, 61914,
+ 61948, 61998, 62062, 62122, 62154, 62184, 62200, 62218,
+ 62252, 62302, 62364, 62410, 62442, 62478, 62536, 62554,
+ 62584, 62604, 62640, 62648, 62656, 62664, 62730, 62766,
+ 62830, 62890, 62924, 62974, 63032, 63050, 63082, 63118,
+ 63182, 63242, 63274, 63310, 63368, 63390,
};
- char aChar[] = {
- '\0', 'a', 'c', 'e', 'i', 'n', 'o', 'u', 'y', 'y', 'a', 'c',
- 'd', 'e', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r',
- 's', 't', 'u', 'u', 'w', 'y', 'z', 'o', 'u', 'a', 'i', 'o',
- 'u', 'g', 'k', 'o', 'j', 'g', 'n', 'a', 'e', 'i', 'o', 'r',
- 'u', 's', 't', 'h', 'a', 'e', 'o', 'y', '\0', '\0', '\0', '\0',
- '\0', '\0', '\0', '\0', 'a', 'b', 'd', 'd', 'e', 'f', 'g', 'h',
- 'h', 'i', 'k', 'l', 'l', 'm', 'n', 'p', 'r', 'r', 's', 't',
- 'u', 'v', 'w', 'w', 'x', 'y', 'z', 'h', 't', 'w', 'y', 'a',
- 'e', 'i', 'o', 'u', 'y',
+#define HIBIT ((unsigned char)0x80)
+ unsigned char aChar[] = {
+ '\0', 'a', 'c', 'e', 'i', 'n',
+ 'o', 'u', 'y', 'y', 'a', 'c',
+ 'd', 'e', 'e', 'g', 'h', 'i',
+ 'j', 'k', 'l', 'n', 'o', 'r',
+ 's', 't', 'u', 'u', 'w', 'y',
+ 'z', 'o', 'u', 'a', 'i', 'o',
+ 'u', 'u'|HIBIT, 'a'|HIBIT, 'g', 'k', 'o',
+ 'o'|HIBIT, 'j', 'g', 'n', 'a'|HIBIT, 'a',
+ 'e', 'i', 'o', 'r', 'u', 's',
+ 't', 'h', 'a', 'e', 'o'|HIBIT, 'o',
+ 'o'|HIBIT, 'y', '\0', '\0', '\0', '\0',
+ '\0', '\0', '\0', '\0', 'a', 'b',
+ 'c'|HIBIT, 'd', 'd', 'e'|HIBIT, 'e', 'e'|HIBIT,
+ 'f', 'g', 'h', 'h', 'i', 'i'|HIBIT,
+ 'k', 'l', 'l'|HIBIT, 'l', 'm', 'n',
+ 'o'|HIBIT, 'p', 'r', 'r'|HIBIT, 'r', 's',
+ 's'|HIBIT, 't', 'u', 'u'|HIBIT, 'v', 'w',
+ 'w', 'x', 'y', 'z', 'h', 't',
+ 'w', 'y', 'a', 'a'|HIBIT, 'a'|HIBIT, 'a'|HIBIT,
+ 'e', 'e'|HIBIT, 'e'|HIBIT, 'i', 'o', 'o'|HIBIT,
+ 'o'|HIBIT, 'o'|HIBIT, 'u', 'u'|HIBIT, 'u'|HIBIT, 'y',
};
unsigned int key = (((unsigned int)c)<<3) | 0x00000007;
@@ -218412,7 +219714,8 @@ static int fts5_remove_diacritic(int c){
}
}
assert( key>=aDia[iRes] );
- return ((c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : (int)aChar[iRes]);
+ if( bComplex==0 && (aChar[iRes] & 0x80) ) return c;
+ return (c > (aDia[iRes]>>3) + (aDia[iRes]&0x07)) ? c : ((int)aChar[iRes] & 0x7F);
}
@@ -218425,8 +219728,8 @@ static int sqlite3Fts5UnicodeIsdiacritic(int c){
unsigned int mask1 = 0x000361F8;
if( c<768 || c>817 ) return 0;
return (c < 768+32) ?
- (mask0 & (1 << (c-768))) :
- (mask1 & (1 << (c-768-32)));
+ (mask0 & ((unsigned int)1 << (c-768))) :
+ (mask1 & ((unsigned int)1 << (c-768-32)));
}
@@ -218439,7 +219742,7 @@ static int sqlite3Fts5UnicodeIsdiacritic(int c){
** The results are undefined if the value passed to this function
** is less than zero.
*/
-static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){
+static int sqlite3Fts5UnicodeFold(int c, int eRemoveDiacritic){
/* Each entry in the following array defines a rule for folding a range
** of codepoints to lower case. The rule applies to a range of nRange
** codepoints starting at codepoint iCode.
@@ -218562,7 +219865,9 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){
assert( ret>0 );
}
- if( bRemoveDiacritic ) ret = fts5_remove_diacritic(ret);
+ if( eRemoveDiacritic ){
+ ret = fts5_remove_diacritic(ret, eRemoveDiacritic==2);
+ }
}
else if( c>=66560 && c<66600 ){
@@ -218573,12 +219878,6 @@ static int sqlite3Fts5UnicodeFold(int c, int bRemoveDiacritic){
}
-#if 0
-static int sqlite3Fts5UnicodeNCat(void) {
- return 32;
-}
-#endif
-
static int sqlite3Fts5UnicodeCatParse(const char *zCat, u8 *aArray){
aArray[0] = 1;
switch( zCat[0] ){
@@ -219060,7 +220359,7 @@ static u16 aFts5UnicodeData[] = {
34, 3074, 7692, 63, 63,
};
-static int sqlite3Fts5UnicodeCategory(int iCode) {
+static int sqlite3Fts5UnicodeCategory(u32 iCode) {
int iRes = -1;
int iHi;
int iLo;
@@ -219098,13 +220397,12 @@ static void sqlite3Fts5UnicodeAscii(u8 *aArray, u8 *aAscii){
int bToken = aArray[ aFts5UnicodeData[iTbl] & 0x1F ];
int n = (aFts5UnicodeData[iTbl] >> 5) + i;
for(; i<128 && i<n; i++){
- aAscii[i] = (u8)bToken;
+ aAscii[i] = bToken;
}
iTbl++;
}
}
-
/*
** 2015 May 30
**
@@ -219183,7 +220481,7 @@ static int sqlite3Fts5GetVarint32(const unsigned char *p, u32 *v){
u8 n;
p -= 2;
n = sqlite3Fts5GetVarint(p, &v64);
- *v = (u32)v64;
+ *v = ((u32)v64) & 0x7FFFFFFF;
assert( n>3 && n<=9 );
return n;
}
@@ -219450,7 +220748,6 @@ static int sqlite3Fts5GetVarintLen(u32 iVal){
return 5;
}
-
/*
** 2015 May 08
**
@@ -219508,7 +220805,7 @@ struct Fts5VocabTable {
struct Fts5VocabCursor {
sqlite3_vtab_cursor base;
sqlite3_stmt *pStmt; /* Statement holding lock on pIndex */
- Fts5Index *pIndex; /* Associated FTS5 index */
+ Fts5Table *pFts5; /* Associated FTS5 table */
int bEof; /* True if this cursor is at EOF */
Fts5IndexIter *pIter; /* Term/rowid iterator object */
@@ -219517,7 +220814,6 @@ struct Fts5VocabCursor {
char *zLeTerm; /* (term <= $zLeTerm) paramater, or NULL */
/* These are used by 'col' tables only */
- Fts5Config *pConfig; /* Fts5 table configuration */
int iCol;
i64 *aCnt;
i64 *aDoc;
@@ -219780,8 +221076,7 @@ static int fts5VocabOpenMethod(
sqlite3_vtab_cursor **ppCsr
){
Fts5VocabTable *pTab = (Fts5VocabTable*)pVTab;
- Fts5Index *pIndex = 0;
- Fts5Config *pConfig = 0;
+ Fts5Table *pFts5 = 0;
Fts5VocabCursor *pCsr = 0;
int rc = SQLITE_OK;
sqlite3_stmt *pStmt = 0;
@@ -219800,31 +221095,34 @@ static int fts5VocabOpenMethod(
if( pStmt && sqlite3_step(pStmt)==SQLITE_ROW ){
i64 iId = sqlite3_column_int64(pStmt, 0);
- pIndex = sqlite3Fts5IndexFromCsrid(pTab->pGlobal, iId, &pConfig);
+ pFts5 = sqlite3Fts5TableFromCsrid(pTab->pGlobal, iId);
}
- if( rc==SQLITE_OK && pIndex==0 ){
- rc = sqlite3_finalize(pStmt);
- pStmt = 0;
- if( rc==SQLITE_OK ){
- pVTab->zErrMsg = sqlite3_mprintf(
- "no such fts5 table: %s.%s", pTab->zFts5Db, pTab->zFts5Tbl
- );
- rc = SQLITE_ERROR;
+ if( rc==SQLITE_OK ){
+ if( pFts5==0 ){
+ rc = sqlite3_finalize(pStmt);
+ pStmt = 0;
+ if( rc==SQLITE_OK ){
+ pVTab->zErrMsg = sqlite3_mprintf(
+ "no such fts5 table: %s.%s", pTab->zFts5Db, pTab->zFts5Tbl
+ );
+ rc = SQLITE_ERROR;
+ }
+ }else{
+ rc = sqlite3Fts5FlushToDisk(pFts5);
}
}
if( rc==SQLITE_OK ){
- int nByte = pConfig->nCol * sizeof(i64) * 2 + sizeof(Fts5VocabCursor);
+ int nByte = pFts5->pConfig->nCol * sizeof(i64)*2 + sizeof(Fts5VocabCursor);
pCsr = (Fts5VocabCursor*)sqlite3Fts5MallocZero(&rc, nByte);
}
if( pCsr ){
- pCsr->pIndex = pIndex;
+ pCsr->pFts5 = pFts5;
pCsr->pStmt = pStmt;
- pCsr->pConfig = pConfig;
pCsr->aCnt = (i64*)&pCsr[1];
- pCsr->aDoc = &pCsr->aCnt[pConfig->nCol];
+ pCsr->aDoc = &pCsr->aCnt[pFts5->pConfig->nCol];
}else{
sqlite3_finalize(pStmt);
}
@@ -219840,6 +221138,7 @@ static void fts5VocabResetCursor(Fts5VocabCursor *pCsr){
sqlite3_free(pCsr->zLeTerm);
pCsr->nLeTerm = -1;
pCsr->zLeTerm = 0;
+ pCsr->bEof = 0;
}
/*
@@ -219878,7 +221177,7 @@ static int fts5VocabInstanceNewTerm(Fts5VocabCursor *pCsr){
}
static int fts5VocabInstanceNext(Fts5VocabCursor *pCsr){
- int eDetail = pCsr->pConfig->eDetail;
+ int eDetail = pCsr->pFts5->pConfig->eDetail;
int rc = SQLITE_OK;
Fts5IndexIter *pIter = pCsr->pIter;
i64 *pp = &pCsr->iInstPos;
@@ -219913,7 +221212,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor;
Fts5VocabTable *pTab = (Fts5VocabTable*)pCursor->pVtab;
int rc = SQLITE_OK;
- int nCol = pCsr->pConfig->nCol;
+ int nCol = pCsr->pFts5->pConfig->nCol;
pCsr->rowid++;
@@ -219935,6 +221234,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
int nTerm;
zTerm = sqlite3Fts5IterTerm(pCsr->pIter, &nTerm);
+ assert( nTerm>=0 );
if( pCsr->nLeTerm>=0 ){
int nCmp = MIN(nTerm, pCsr->nLeTerm);
int bCmp = memcmp(pCsr->zLeTerm, zTerm, nCmp);
@@ -219951,7 +221251,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
assert( pTab->eType==FTS5_VOCAB_COL || pTab->eType==FTS5_VOCAB_ROW );
while( rc==SQLITE_OK ){
- int eDetail = pCsr->pConfig->eDetail;
+ int eDetail = pCsr->pFts5->pConfig->eDetail;
const u8 *pPos; int nPos; /* Position list */
i64 iPos = 0; /* 64-bit position read from poslist */
int iOff = 0; /* Current offset within position list */
@@ -219974,7 +221274,6 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
int iCol = -1;
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff, &iPos) ){
int ii = FTS5_POS2COLUMN(iPos);
- pCsr->aCnt[ii]++;
if( iCol!=ii ){
if( ii>=nCol ){
rc = FTS5_CORRUPT;
@@ -219983,6 +221282,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
pCsr->aDoc[ii]++;
iCol = ii;
}
+ pCsr->aCnt[ii]++;
}
}else if( eDetail==FTS5_DETAIL_COLUMNS ){
while( 0==sqlite3Fts5PoslistNext64(pPos, nPos, &iOff,&iPos) ){
@@ -220011,7 +221311,9 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
if( rc==SQLITE_OK ){
zTerm = sqlite3Fts5IterTerm(pCsr->pIter, &nTerm);
- if( nTerm!=pCsr->term.n || memcmp(zTerm, pCsr->term.p, nTerm) ){
+ if( nTerm!=pCsr->term.n
+ || (nTerm>0 && memcmp(zTerm, pCsr->term.p, nTerm))
+ ){
break;
}
if( sqlite3Fts5IterEof(pCsr->pIter) ) break;
@@ -220022,7 +221324,7 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
if( rc==SQLITE_OK && pCsr->bEof==0 && pTab->eType==FTS5_VOCAB_COL ){
while( pCsr->aDoc[pCsr->iCol]==0 ) pCsr->iCol++;
- assert( pCsr->iCol<pCsr->pConfig->nCol );
+ assert( pCsr->iCol<pCsr->pFts5->pConfig->nCol );
}
return rc;
}
@@ -220069,6 +221371,7 @@ static int fts5VocabFilterMethod(
}
if( pLe ){
const char *zCopy = (const char *)sqlite3_value_text(pLe);
+ if( zCopy==0 ) zCopy = "";
pCsr->nLeTerm = sqlite3_value_bytes(pLe);
pCsr->zLeTerm = sqlite3_malloc(pCsr->nLeTerm+1);
if( pCsr->zLeTerm==0 ){
@@ -220080,14 +221383,15 @@ static int fts5VocabFilterMethod(
}
if( rc==SQLITE_OK ){
- rc = sqlite3Fts5IndexQuery(pCsr->pIndex, zTerm, nTerm, f, 0, &pCsr->pIter);
+ Fts5Index *pIndex = pCsr->pFts5->pIndex;
+ rc = sqlite3Fts5IndexQuery(pIndex, zTerm, nTerm, f, 0, &pCsr->pIter);
}
if( rc==SQLITE_OK && eType==FTS5_VOCAB_INSTANCE ){
rc = fts5VocabInstanceNewTerm(pCsr);
}
- if( rc==SQLITE_OK
- && !pCsr->bEof
- && (eType!=FTS5_VOCAB_INSTANCE || pCsr->pConfig->eDetail!=FTS5_DETAIL_NONE)
+ if( rc==SQLITE_OK && !pCsr->bEof
+ && (eType!=FTS5_VOCAB_INSTANCE
+ || pCsr->pFts5->pConfig->eDetail!=FTS5_DETAIL_NONE)
){
rc = fts5VocabNextMethod(pCursor);
}
@@ -220110,7 +221414,7 @@ static int fts5VocabColumnMethod(
int iCol /* Index of column to read value from */
){
Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor;
- int eDetail = pCsr->pConfig->eDetail;
+ int eDetail = pCsr->pFts5->pConfig->eDetail;
int eType = ((Fts5VocabTable*)(pCursor->pVtab))->eType;
i64 iVal = 0;
@@ -220122,7 +221426,7 @@ static int fts5VocabColumnMethod(
assert( iCol==1 || iCol==2 || iCol==3 );
if( iCol==1 ){
if( eDetail!=FTS5_DETAIL_NONE ){
- const char *z = pCsr->pConfig->azCol[pCsr->iCol];
+ const char *z = pCsr->pFts5->pConfig->azCol[pCsr->iCol];
sqlite3_result_text(pCtx, z, -1, SQLITE_STATIC);
}
}else if( iCol==2 ){
@@ -220150,8 +221454,8 @@ static int fts5VocabColumnMethod(
}else if( eDetail==FTS5_DETAIL_COLUMNS ){
ii = (int)pCsr->iInstPos;
}
- if( ii>=0 && ii<pCsr->pConfig->nCol ){
- const char *z = pCsr->pConfig->azCol[ii];
+ if( ii>=0 && ii<pCsr->pFts5->pConfig->nCol ){
+ const char *z = pCsr->pFts5->pConfig->azCol[ii];
sqlite3_result_text(pCtx, z, -1, SQLITE_STATIC);
}
break;
@@ -220524,9 +221828,9 @@ SQLITE_API int sqlite3_stmt_init(
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
/************** End of stmt.c ************************************************/
-#if __LINE__!=220527
+#if __LINE__!=221831
#undef SQLITE_SOURCE_ID
-#define SQLITE_SOURCE_ID "2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238alt2"
+#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0alt2"
#endif
/* Return the source-id for this library */
SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
diff --git a/db/sqlite3/src/sqlite3.h b/db/sqlite3/src/sqlite3.h
index f36ae57a64..348db74669 100644
--- a/db/sqlite3/src/sqlite3.h
+++ b/db/sqlite3/src/sqlite3.h
@@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
-#define SQLITE_VERSION "3.26.0"
-#define SQLITE_VERSION_NUMBER 3026000
-#define SQLITE_SOURCE_ID "2018-12-01 12:34:55 bf8c1b2b7a5960c282e543b9c293686dccff272512d08865f4600fb58238b4f9"
+#define SQLITE_VERSION "3.27.2"
+#define SQLITE_VERSION_NUMBER 3027002
+#define SQLITE_SOURCE_ID "2019-02-25 16:06:06 bd49a8271d650fa89e446b42e513b595a717b9212c91dd384aab871fc1d0f6d7"
/*
** CAPI3REF: Run-Time Library Version Numbers
@@ -823,6 +823,15 @@ struct sqlite3_io_methods {
** file space based on this hint in order to help writes to the database
** file run faster.
**
+** <li>[[SQLITE_FCNTL_SIZE_LIMIT]]
+** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that
+** implements [sqlite3_deserialize()] to set an upper bound on the size
+** of the in-memory database. The argument is a pointer to a [sqlite3_int64].
+** If the integer pointed to is negative, then it is filled in with the
+** current limit. Otherwise the limit is set to the larger of the value
+** of the integer pointed to and the current database size. The integer
+** pointed to is set to the new limit.
+**
** <li>[[SQLITE_FCNTL_CHUNK_SIZE]]
** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS
** extends and truncates the database file in chunks of a size specified
@@ -1131,6 +1140,7 @@ struct sqlite3_io_methods {
#define SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE 33
#define SQLITE_FCNTL_LOCK_TIMEOUT 34
#define SQLITE_FCNTL_DATA_VERSION 35
+#define SQLITE_FCNTL_SIZE_LIMIT 36
/* deprecated names */
#define SQLITE_GET_LOCKPROXYFILE SQLITE_FCNTL_GET_LOCKPROXYFILE
@@ -1972,6 +1982,17 @@ struct sqlite3_mem_methods {
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
+**
+** [[SQLITE_CONFIG_MEMDB_MAXSIZE]]
+** <dt>SQLITE_CONFIG_MEMDB_MAXSIZE
+** <dd>The SQLITE_CONFIG_MEMDB_MAXSIZE option accepts a single parameter
+** [sqlite3_int64] parameter which is the default maximum size for an in-memory
+** database created using [sqlite3_deserialize()]. This default maximum
+** size can be adjusted up or down for individual databases using the
+** [SQLITE_FCNTL_SIZE_LIMIT] [sqlite3_file_control|file-control]. If this
+** configuration setting is never used, then the default maximum is determined
+** by the [SQLITE_MEMDB_DEFAULT_MAXSIZE] compile-time option. If that
+** compile-time option is not set, then the default maximum is 1073741824.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@@ -2002,6 +2023,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
+#define SQLITE_CONFIG_MEMDB_MAXSIZE 29 /* sqlite3_int64 */
/*
** CAPI3REF: Database Connection Configuration Options
@@ -2347,7 +2369,7 @@ SQLITE_API int sqlite3_changes(sqlite3*);
** not. ^Changes to a view that are intercepted by INSTEAD OF triggers
** are not counted.
**
-** This the [sqlite3_total_changes(D)] interface only reports the number
+** The [sqlite3_total_changes(D)] interface only reports the number
** of rows that changed due to SQL statement run against database
** connection D. Any changes by other database connections are ignored.
** To detect changes against a database file from other database
@@ -2991,9 +3013,9 @@ SQLITE_API int sqlite3_set_authorizer(
** time is in units of nanoseconds, however the current implementation
** is only capable of millisecond resolution so the six least significant
** digits in the time are meaningless. Future versions of SQLite
-** might provide greater resolution on the profiler callback. The
-** sqlite3_profile() function is considered experimental and is
-** subject to change in future versions of SQLite.
+** might provide greater resolution on the profiler callback. Invoking
+** either [sqlite3_trace()] or [sqlite3_trace_v2()] will cancel the
+** profile callback.
*/
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3*,
void(*xTrace)(void*,const char*), void*);
@@ -3407,6 +3429,8 @@ SQLITE_API int sqlite3_open_v2(
** is not a database file pathname pointer that SQLite passed into the xOpen
** VFS method, then the behavior of this routine is undefined and probably
** undesirable.
+**
+** See the [URI filename] documentation for additional information.
*/
SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam);
SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault);
@@ -3629,18 +3653,23 @@ SQLITE_API int sqlite3_limit(sqlite3*, int id, int newVal);
** deplete the limited store of lookaside memory. Future versions of
** SQLite may act on this hint differently.
**
-** [[SQLITE_PREPARE_NORMALIZE]] ^(<dt>SQLITE_PREPARE_NORMALIZE</dt>
-** <dd>The SQLITE_PREPARE_NORMALIZE flag indicates that a normalized
-** representation of the SQL statement should be calculated and then
-** associated with the prepared statement, which can be obtained via
-** the [sqlite3_normalized_sql()] interface.)^ The semantics used to
-** normalize a SQL statement are unspecified and subject to change.
-** At a minimum, literal values will be replaced with suitable
-** placeholders.
+** [[SQLITE_PREPARE_NORMALIZE]] <dt>SQLITE_PREPARE_NORMALIZE</dt>
+** <dd>The SQLITE_PREPARE_NORMALIZE flag is a no-op. This flag used
+** to be required for any prepared statement that wanted to use the
+** [sqlite3_normalized_sql()] interface. However, the
+** [sqlite3_normalized_sql()] interface is now available to all
+** prepared statements, regardless of whether or not they use this
+** flag.
+**
+** [[SQLITE_PREPARE_NO_VTAB]] <dt>SQLITE_PREPARE_NO_VTAB</dt>
+** <dd>The SQLITE_PREPARE_NO_VTAB flag causes the SQL compiler
+** to return an error (error code SQLITE_ERROR) if the statement uses
+** any virtual tables.
** </dl>
*/
#define SQLITE_PREPARE_PERSISTENT 0x01
#define SQLITE_PREPARE_NORMALIZE 0x02
+#define SQLITE_PREPARE_NO_VTAB 0x04
/*
** CAPI3REF: Compiling An SQL Statement
@@ -9996,7 +10025,7 @@ SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
** sqlite3changeset_next() is called on the iterator or until the
** conflict-handler function returns. If pnCol is not NULL, then *pnCol is
** set to the number of columns in the table affected by the change. If
-** pbIncorrect is not NULL, then *pbIndirect is set to true (1) if the change
+** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
** is an indirect change, or false (0) otherwise. See the documentation for
** [sqlite3session_indirect()] for a description of direct and indirect
** changes. Finally, if pOp is not NULL, then *pOp is set to one of
@@ -11230,12 +11259,8 @@ struct Fts5PhraseIter {
**
** Usually, output parameter *piPhrase is set to the phrase number, *piCol
** to the column in which it occurs and *piOff the token offset of the
-** first token of the phrase. The exception is if the table was created
-** with the offsets=0 option specified. In this case *piOff is always
-** set to -1.
-**
-** Returns SQLITE_OK if successful, or an error code (i.e. SQLITE_NOMEM)
-** if an error occurs.
+** first token of the phrase. Returns SQLITE_OK if successful, or an error
+** code (i.e. SQLITE_NOMEM) if an error occurs.
**
** This API can be quite slow if used with an FTS5 table created with the
** "detail=none" or "detail=column" option.
@@ -11524,11 +11549,11 @@ struct Fts5ExtensionApi {
** the tokenizer substitutes "first" for "1st" and the query works
** as expected.
**
-** <li> By adding multiple synonyms for a single term to the FTS index.
-** In this case, when tokenizing query text, the tokenizer may
-** provide multiple synonyms for a single term within the document.
-** FTS5 then queries the index for each synonym individually. For
-** example, faced with the query:
+** <li> By querying the index for all synonyms of each query term
+** separately. In this case, when tokenizing query text, the
+** tokenizer may provide multiple synonyms for a single term
+** within the document. FTS5 then queries the index for each
+** synonym individually. For example, faced with the query:
**
** <codeblock>
** ... MATCH 'first place'</codeblock>
@@ -11552,7 +11577,7 @@ struct Fts5ExtensionApi {
** "place".
**
** This way, even if the tokenizer does not provide synonyms
-** when tokenizing query text (it should not - to do would be
+** when tokenizing query text (it should not - to do so would be
** inefficient), it doesn't matter if the user queries for
** 'first + place' or '1st + place', as there are entries in the
** FTS index corresponding to both forms of the first token.
diff --git a/devtools/client/menus.js b/devtools/client/menus.js
index 1d2168967c..dbacb367da 100644
--- a/devtools/client/menus.js
+++ b/devtools/client/menus.js
@@ -189,7 +189,8 @@ exports.menuitems = [
l10nKey: "getMoreDevtoolsCmd",
oncommand(event) {
let window = event.target.ownerDocument.defaultView;
- window.openUILinkIn("https://addons.mozilla.org/firefox/collections/mozilla/webdeveloper/", "tab");
+ let getMoreURL = Services.prefs.getCharPref("browser.getdevtools.url");
+ window.openUILinkIn(getMoreURL, "tab");
}
},
];
diff --git a/devtools/client/responsive.html/docs/browser-swap.md b/devtools/client/responsive.html/docs/browser-swap.md
index 75055ad4ef..f4f8322cb4 100644
--- a/devtools/client/responsive.html/docs/browser-swap.md
+++ b/devtools/client/responsive.html/docs/browser-swap.md
@@ -96,11 +96,8 @@ browsers are swapped.
Browser attributes `gBrowser.swapBrowsersAndCloseOther` transfers between
browsers:
-* `usercontextid`
-
Tab attributes `gBrowser.swapBrowsersAndCloseOther` transfers between tabs:
-* `usercontextid`
* `muted`
* `soundplaying`
* `busy`
diff --git a/devtools/client/responsive.html/manager.js b/devtools/client/responsive.html/manager.js
index a3fbed3661..97ef8ad6dc 100644
--- a/devtools/client/responsive.html/manager.js
+++ b/devtools/client/responsive.html/manager.js
@@ -76,11 +76,6 @@ const ResponsiveUIManager = exports.ResponsiveUIManager = {
this.showRemoteOnlyNotification(window, tab, options);
return promise.reject(new Error("RDM only available for remote tabs."));
}
- // Remove this once we support this case in bug 1306975.
- if (tab.linkedBrowser.hasAttribute("usercontextid")) {
- this.showNoContainerTabsNotification(window, tab, options);
- return promise.reject(new Error("RDM not available for container tabs."));
- }
if (!this.isActiveForTab(tab)) {
this.initMenuCheckListenerFor(window);
@@ -218,16 +213,7 @@ const ResponsiveUIManager = exports.ResponsiveUIManager = {
}
}),
- showRemoteOnlyNotification(window, tab, options) {
- this.showErrorNotification(window, tab, options, getStr("responsive.remoteOnly"));
- },
-
- showNoContainerTabsNotification(window, tab, options) {
- this.showErrorNotification(window, tab, options,
- getStr("responsive.noContainerTabs"));
- },
-
- showErrorNotification(window, tab, { command } = {}, msg) {
+ showRemoteOnlyNotification(window, tab, { command } = {}) {
// Default to using the browser's per-tab notification box
let nbox = window.gBrowser.getNotificationBox(tab.linkedBrowser);
diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js
index 6d33ad9717..9670197466 100644
--- a/devtools/client/shared/curl.js
+++ b/devtools/client/shared/curl.js
@@ -375,6 +375,7 @@ const CurlUtils = {
.replace(/\'/g, "\\\'")
.replace(/\n/g, "\\n")
.replace(/\r/g, "\\r")
+ .replace(/!/g, "\\041")
.replace(/[^\x20-\x7E]/g, escapeCharacter) + "'";
}
diff --git a/devtools/client/styleeditor/test/browser.ini b/devtools/client/styleeditor/test/browser.ini
index 4a84d45e66..ba935e1ddf 100644
--- a/devtools/client/styleeditor/test/browser.ini
+++ b/devtools/client/styleeditor/test/browser.ini
@@ -77,7 +77,6 @@ support-files =
[browser_styleeditor_init.js]
[browser_styleeditor_inline_friendly_names.js]
[browser_styleeditor_loading.js]
-[browser_styleeditor_loading_with_containers.js]
[browser_styleeditor_media_sidebar.js]
[browser_styleeditor_media_sidebar_links.js]
skip-if = e10s && debug # Bug 1252201 - Docshell leak on debug e10s
diff --git a/devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js b/devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js
deleted file mode 100644
index a00628c8b8..0000000000
--- a/devtools/client/styleeditor/test/browser_styleeditor_loading_with_containers.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test that the stylesheets can be loaded correctly with containers
-// (bug 1282660).
-
-const TESTCASE_URI = TEST_BASE_HTTP + "simple.html";
-const EXPECTED_SHEETS = [
- {
- sheetIndex: 0,
- name: /^simple.css$/,
- rules: 1,
- active: true
- }, {
- sheetIndex: 1,
- name: /^<.*>$/,
- rules: 3,
- active: false
- }
-];
-
-add_task(function* () {
- // Using the personal container.
- let userContextId = 1;
- let { tab } = yield* openTabInUserContext(TESTCASE_URI, userContextId);
- let { ui } = yield openStyleEditor(tab);
-
- is(ui.editors.length, 2, "The UI contains two style sheets.");
- checkSheet(ui.editors[0], EXPECTED_SHEETS[0]);
- checkSheet(ui.editors[1], EXPECTED_SHEETS[1]);
-});
-
-function* openTabInUserContext(uri, userContextId) {
- // Open the tab in the correct userContextId.
- let tab = gBrowser.addTab(uri, {userContextId});
-
- // Select tab and make sure its browser is focused.
- gBrowser.selectedTab = tab;
- tab.ownerDocument.defaultView.focus();
-
- let browser = gBrowser.getBrowserForTab(tab);
- yield BrowserTestUtils.browserLoaded(browser);
- return {tab, browser};
-}
-
-function checkSheet(editor, expected) {
- is(editor.styleSheet.styleSheetIndex, expected.sheetIndex,
- "Style sheet has correct index.");
-
- let summary = editor.summary;
- let name = summary.querySelector(".stylesheet-name > label")
- .getAttribute("value");
- ok(expected.name.test(name), "The name '" + name + "' is correct.");
-
- let ruleCount = summary.querySelector(".stylesheet-rule-count").textContent;
- is(parseInt(ruleCount, 10), expected.rules, "the rule count is correct");
-
- is(summary.classList.contains("splitview-active"), expected.active,
- "The active status for this sheet is correct.");
-}
diff --git a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js
index 26e95fe39f..d9662c4fdc 100644
--- a/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js
+++ b/devtools/client/webconsole/new-console-output/test/fixtures/stubs/consoleApi.js
@@ -657,8 +657,7 @@ stubPackets.set("console.log('foobar', 'test')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -690,8 +689,7 @@ stubPackets.set("console.log(undefined)", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -721,8 +719,7 @@ stubPackets.set("console.warn('danger, will robinson!')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -754,8 +751,7 @@ stubPackets.set("console.log(NaN)", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -787,8 +783,7 @@ stubPackets.set("console.log(null)", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -818,8 +813,7 @@ stubPackets.set("console.log('鼬')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -847,8 +841,7 @@ stubPackets.set("console.clear()", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086275587,
@@ -881,8 +874,7 @@ stubPackets.set("console.count('bar')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086277812,
@@ -933,8 +925,7 @@ stubPackets.set("console.assert(false, {message: 'foobar'})", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -973,8 +964,7 @@ stubPackets.set("console.log('hello \nfrom \rthe \"string world!')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -1004,8 +994,7 @@ stubPackets.set("console.log('úṇĩçödê țĕșť')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [],
@@ -1047,8 +1036,7 @@ stubPackets.set("console.dirxml(window)", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086285483,
@@ -1076,8 +1064,7 @@ stubPackets.set("console.trace()", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086287286,
@@ -1130,8 +1117,7 @@ stubPackets.set("console.time('bar')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086289137,
@@ -1164,8 +1150,7 @@ stubPackets.set("console.timeEnd('bar')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086289138,
@@ -1198,8 +1183,7 @@ stubPackets.set("console.table('bar')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086290984,
@@ -1246,8 +1230,7 @@ stubPackets.set("console.table(['a', 'b', 'c'])", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086292762,
@@ -1277,8 +1260,7 @@ stubPackets.set("console.group('bar')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086294628,
@@ -1308,8 +1290,7 @@ stubPackets.set("console.groupEnd('bar')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086294630,
@@ -1339,8 +1320,7 @@ stubPackets.set("console.groupCollapsed('foo')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086296567,
@@ -1370,8 +1350,7 @@ stubPackets.set("console.groupEnd('foo')", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086296570,
@@ -1399,8 +1378,7 @@ stubPackets.set("console.group()", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086298462,
@@ -1428,8 +1406,7 @@ stubPackets.set("console.groupEnd()", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"timeStamp": 1477086298464,
@@ -1460,8 +1437,7 @@ stubPackets.set("console.log(%cfoobar)", {
"appId": 0,
"firstPartyDomain": "",
"inIsolatedMozBrowser": false,
- "privateBrowsingId": 0,
- "userContextId": 0
+ "privateBrowsingId": 0
},
"private": false,
"styles": [
diff --git a/devtools/server/actors/moz.build b/devtools/server/actors/moz.build
index ddefc3e9e8..085d003cff 100644
--- a/devtools/server/actors/moz.build
+++ b/devtools/server/actors/moz.build
@@ -67,6 +67,6 @@ DevToolsModules(
'worker.js',
)
-FINAL_TARGET_PP_FILES.chrome.devtools.modules.devtools.server.actors += [
+FINAL_TARGET_FILES.chrome.devtools.modules.devtools.server.actors += [
'webbrowser.js',
] \ No newline at end of file
diff --git a/devtools/server/actors/stylesheets.js b/devtools/server/actors/stylesheets.js
index 7fcbca8c48..f484a59765 100644
--- a/devtools/server/actors/stylesheets.js
+++ b/devtools/server/actors/stylesheets.js
@@ -451,21 +451,10 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
let options = {
loadFromCache: true,
policy: Ci.nsIContentPolicy.TYPE_INTERNAL_STYLESHEET,
+ window: this.window,
charset: this._getCSSCharset()
};
- // Bug 1282660 - We use the system principal to load the default internal
- // stylesheets instead of the content principal since such stylesheets
- // require system principal to load. At meanwhile, we strip the loadGroup
- // for preventing the assertion of the userContextId mismatching.
- // The default internal stylesheets load from the 'resource:' URL.
- // Bug 1287607, 1291321 - 'chrome' and 'file' protocols should also be handled in the
- // same way.
- if (!/^(chrome|file|resource):\/\//.test(this.href)) {
- options.window = this.window;
- options.principal = this.document.nodePrincipal;
- }
-
return fetch(this.href, options).then(({ content }) => {
this.text = content;
return content;
diff --git a/devtools/server/actors/webbrowser.js b/devtools/server/actors/webbrowser.js
index dffe49b919..e7981e163f 100644
--- a/devtools/server/actors/webbrowser.js
+++ b/devtools/server/actors/webbrowser.js
@@ -30,9 +30,6 @@ loader.lazyRequireGetter(this, "WorkerActorList", "devtools/server/actors/worker
loader.lazyRequireGetter(this, "ServiceWorkerRegistrationActorList", "devtools/server/actors/worker", true);
loader.lazyRequireGetter(this, "ProcessActorList", "devtools/server/actors/process", true);
loader.lazyImporter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
-#ifdef MOZ_WEBEXTENSIONS
-loader.lazyImporter(this, "ExtensionContent", "resource://gre/modules/ExtensionContent.jsm");
-#endif
// Assumptions on events module:
// events needs to be dispatched synchronously,
@@ -984,21 +981,6 @@ TabActor.prototype = {
return null;
},
-#ifdef MOZ_WEBEXTENSIONS
- /**
- * Getter for the WebExtensions ContentScript globals related to the
- * current tab content's DOM window.
- */
- get webextensionsContentScriptGlobals() {
- // Ignore xpcshell runtime which spawn TabActors without a window.
- if (this.window) {
- return ExtensionContent.getContentScriptGlobalsForWindow(this.window);
- }
-
- return [];
- },
-#endif
-
/**
* Getter for the list of all content DOM windows in this tabActor
* @return {Array}
diff --git a/devtools/shared/jsinspector/nsJSInspector.cpp b/devtools/shared/jsinspector/nsJSInspector.cpp
index 6d717af5bc..457e64c088 100644
--- a/devtools/shared/jsinspector/nsJSInspector.cpp
+++ b/devtools/shared/jsinspector/nsJSInspector.cpp
@@ -37,7 +37,6 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(nsJSInspector)
NS_IMPL_CYCLE_COLLECTING_RELEASE(nsJSInspector)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsJSInspector)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSInspector)
diff --git a/docshell/base/SerializedLoadContext.cpp b/docshell/base/SerializedLoadContext.cpp
index b8e3eb9298..281fd7bd66 100644
--- a/docshell/base/SerializedLoadContext.cpp
+++ b/docshell/base/SerializedLoadContext.cpp
@@ -7,6 +7,7 @@
#include "SerializedLoadContext.h"
#include "nsNetUtil.h"
#include "nsIChannel.h"
+#include "nsILoadContext.h"
#include "nsIPrivateBrowsingChannel.h"
#include "nsIWebSocketChannel.h"
diff --git a/docshell/base/moz.build b/docshell/base/moz.build
index 6ea3e6d281..120465bac7 100644
--- a/docshell/base/moz.build
+++ b/docshell/base/moz.build
@@ -50,7 +50,7 @@ EXPORTS.mozilla += [
'LoadContext.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'LoadContext.cpp',
'nsAboutRedirector.cpp',
'nsDefaultURIFixup.cpp',
diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp
index 4dba7f261e..f57d6c002b 100644
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -8,6 +8,7 @@
#include "nsNetUtil.h"
#include "nsAboutProtocolUtils.h"
#include "mozilla/ArrayUtils.h"
+#include "nsIChannel.h"
#include "nsIProtocolHandler.h"
NS_IMPL_ISUPPORTS(nsAboutRedirector, nsIAboutModule)
diff --git a/docshell/base/nsDSURIContentListener.cpp b/docshell/base/nsDSURIContentListener.cpp
index ee6a4dd623..3f52251cc9 100644
--- a/docshell/base/nsDSURIContentListener.cpp
+++ b/docshell/base/nsDSURIContentListener.cpp
@@ -24,6 +24,7 @@
#include "nsDocShellLoadTypes.h"
#include "nsIMultiPartChannel.h"
#include "mozilla/dom/nsCSPUtils.h"
+#include "nsIStreamListener.h"
using namespace mozilla;
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 7f8a693cc3..d67780317c 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -39,6 +39,7 @@
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
+#include "nsAboutProtocolUtils.h"
#include "nsArray.h"
#include "nsArrayUtils.h"
#include "nsContentSecurityManager.h"
diff --git a/docshell/base/nsDocShellEditorData.cpp b/docshell/base/nsDocShellEditorData.cpp
index 7e4068eb9b..80c8c6ec3a 100644
--- a/docshell/base/nsDocShellEditorData.cpp
+++ b/docshell/base/nsDocShellEditorData.cpp
@@ -8,6 +8,7 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsComponentManagerUtils.h"
#include "nsPIDOMWindow.h"
+#include "nsIDocument.h"
#include "nsIDOMDocument.h"
#include "nsIEditor.h"
#include "nsIEditingSession.h"
diff --git a/docshell/base/timeline/ObservedDocShell.h b/docshell/base/timeline/ObservedDocShell.h
index 05eafbd0ce..b437de7692 100644
--- a/docshell/base/timeline/ObservedDocShell.h
+++ b/docshell/base/timeline/ObservedDocShell.h
@@ -11,6 +11,7 @@
#include "mozilla/RefPtr.h"
#include "mozilla/UniquePtr.h"
#include "nsTArray.h"
+#include "nsIDocShell.h"
class nsIDocShell;
diff --git a/docshell/base/timeline/TimelineConsumers.h b/docshell/base/timeline/TimelineConsumers.h
index 04099e1b9e..2a77b83ac6 100644
--- a/docshell/base/timeline/TimelineConsumers.h
+++ b/docshell/base/timeline/TimelineConsumers.h
@@ -7,11 +7,14 @@
#define mozilla_TimelineConsumers_h_
#include "nsIObserver.h"
+#include "nsIDocShell.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/LinkedList.h"
#include "mozilla/StaticMutex.h"
#include "TimelineMarkerEnums.h" // for MarkerTracingType
+#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
+#include "nsTArray.h"
class nsDocShell;
class nsIDocShell;
diff --git a/docshell/base/timeline/TimelineMarker.cpp b/docshell/base/timeline/TimelineMarker.cpp
index b83e9ceb42..0bf2483133 100644
--- a/docshell/base/timeline/TimelineMarker.cpp
+++ b/docshell/base/timeline/TimelineMarker.cpp
@@ -5,6 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TimelineMarker.h"
+#include "mozilla/dom/ProfileTimelineMarkerBinding.h"
+#include "nsContentUtils.h"
namespace mozilla {
diff --git a/docshell/base/timeline/moz.build b/docshell/base/timeline/moz.build
index 824e37466a..61cc4ec084 100644
--- a/docshell/base/timeline/moz.build
+++ b/docshell/base/timeline/moz.build
@@ -25,7 +25,7 @@ EXPORTS.mozilla += [
'WorkerTimelineMarker.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'AbstractTimelineMarker.cpp',
'AutoGlobalTimelineMarker.cpp',
'AutoTimelineMarker.cpp',
diff --git a/docshell/shistory/moz.build b/docshell/shistory/moz.build
index c85c3a3cbd..3d3fb51a22 100644
--- a/docshell/shistory/moz.build
+++ b/docshell/shistory/moz.build
@@ -23,7 +23,7 @@ EXPORTS += [
'nsSHEntryShared.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsSHEntry.cpp',
'nsSHEntryShared.cpp',
'nsSHistory.cpp',
diff --git a/docshell/shistory/nsSHEntry.cpp b/docshell/shistory/nsSHEntry.cpp
index 6b0b066d97..89ba2ebeb2 100644
--- a/docshell/shistory/nsSHEntry.cpp
+++ b/docshell/shistory/nsSHEntry.cpp
@@ -15,6 +15,7 @@
#include "nsIInputStream.h"
#include "nsIURI.h"
#include "mozilla/net/ReferrerPolicy.h"
+#include "nsArray.h"
#include <algorithm>
namespace dom = mozilla::dom;
diff --git a/docshell/shistory/nsSHEntryShared.h b/docshell/shistory/nsSHEntryShared.h
index 0a40691ff3..afeb338637 100644
--- a/docshell/shistory/nsSHEntryShared.h
+++ b/docshell/shistory/nsSHEntryShared.h
@@ -12,6 +12,7 @@
#include "nsCOMArray.h"
#include "nsIBFCacheEntry.h"
#include "nsIMutationObserver.h"
+#include "nsISHEntry.h"
#include "nsExpirationTracker.h"
#include "nsRect.h"
#include "nsString.h"
diff --git a/dom/animation/AnimationEffectReadOnly.cpp b/dom/animation/AnimationEffectReadOnly.cpp
index bf2e2197d9..63d633c2f1 100644
--- a/dom/animation/AnimationEffectReadOnly.cpp
+++ b/dom/animation/AnimationEffectReadOnly.cpp
@@ -23,7 +23,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationEffectReadOnly)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument, mTiming, mAnimation)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AnimationEffectReadOnly)
diff --git a/dom/animation/AnimationTimeline.cpp b/dom/animation/AnimationTimeline.cpp
index 643106807c..f4a1ecc9ac 100644
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/AnimationTimeline.cpp
@@ -21,7 +21,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AnimationTimeline)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow, mAnimations)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AnimationTimeline)
diff --git a/dom/base/Attr.cpp b/dom/base/Attr.cpp
index 6eb3b49fdd..71b559392b 100644
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -59,8 +59,6 @@ Attr::Attr(nsDOMAttributeMap *aAttrMap,
NS_IMPL_CYCLE_COLLECTION_CLASS(Attr)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Attr)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
-
if (!nsINode::Traverse(tmp, cb)) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index 00ee3d42fe..3f202d33b3 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -138,7 +138,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CustomElementRegistry)
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWhenDefinedPromiseMap)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(CustomElementRegistry)
diff --git a/dom/base/DOMException.cpp b/dom/base/DOMException.cpp
index dfda47316b..9fbb2f2425 100644
--- a/dom/base/DOMException.cpp
+++ b/dom/base/DOMException.cpp
@@ -165,7 +165,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(Exception)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Exception)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLocation)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mData)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Exception)
diff --git a/dom/base/DOMIntersectionObserver.cpp b/dom/base/DOMIntersectionObserver.cpp
index e671b7da95..389b93071f 100644
--- a/dom/base/DOMIntersectionObserver.cpp
+++ b/dom/base/DOMIntersectionObserver.cpp
@@ -52,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMIntersectionObserver)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMIntersectionObserver)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCallback)
diff --git a/dom/base/File.cpp b/dom/base/File.cpp
index 7d86dfe8a2..1d5ab73e7a 100755
--- a/dom/base/File.cpp
+++ b/dom/base/File.cpp
@@ -138,7 +138,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Blob)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Blob)
diff --git a/dom/base/FormData.cpp b/dom/base/FormData.cpp
index 6095286be9..52bdd92106 100644
--- a/dom/base/FormData.cpp
+++ b/dom/base/FormData.cpp
@@ -84,7 +84,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FormData)
"mFormData[i].GetAsBlob()", 0);
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(FormData)
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp
index 13ba19c8c6..9106778dfe 100644
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -1878,10 +1878,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(FragmentOrElement)
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(FragmentOrElement, tmp->mRefCnt.get())
}
- // Always need to traverse script objects, so do that before we check
- // if we're uncollectable.
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
-
if (!nsINode::Traverse(tmp, cb)) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
diff --git a/dom/base/Location.cpp b/dom/base/Location.cpp
index e312cffe00..1483c32f9d 100644
--- a/dom/base/Location.cpp
+++ b/dom/base/Location.cpp
@@ -80,7 +80,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Location)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mInnerWindow)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Location)
@@ -790,10 +789,6 @@ Location::GetSearch(nsAString& aSearch)
NS_IMETHODIMP
Location::SetSearch(const nsAString& aSearch)
{
- if (aSearch.IsEmpty()) {
- return NS_OK; // Ignore empty string
- }
-
nsresult rv = SetSearchInternal(aSearch);
if (NS_FAILED(rv)) {
return rv;
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 286cd0e797..fdf151b6c4 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -223,7 +223,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGamepadServiceTest)
#endif
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mVRGetDisplaysPromises)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Navigator)
diff --git a/dom/base/Pose.cpp b/dom/base/Pose.cpp
index 1eab4c1735..5bc4ca6de3 100644
--- a/dom/base/Pose.cpp
+++ b/dom/base/Pose.cpp
@@ -26,7 +26,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Pose)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Pose)
diff --git a/dom/base/ProcessGlobal.cpp b/dom/base/ProcessGlobal.cpp
index 641f49f98f..6cd29ab7c8 100644
--- a/dom/base/ProcessGlobal.cpp
+++ b/dom/base/ProcessGlobal.cpp
@@ -52,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ProcessGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
tmp->TraverseHostObjectURIs(cb);
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ProcessGlobal)
diff --git a/dom/base/nsAttrAndChildArray.cpp b/dom/base/nsAttrAndChildArray.cpp
index b285ee0037..9fd27262b3 100644
--- a/dom/base/nsAttrAndChildArray.cpp
+++ b/dom/base/nsAttrAndChildArray.cpp
@@ -78,15 +78,8 @@ GetIndexFromCache(const nsAttrAndChildArray* aArray)
}
-/**
- * Due to a compiler bug in VisualAge C++ for AIX, we need to return the
- * address of the first index into mBuffer here, instead of simply returning
- * mBuffer itself.
- *
- * See Bug 231104 for more information.
- */
#define ATTRS(_impl) \
- reinterpret_cast<InternalAttr*>(&((_impl)->mBuffer[0]))
+ reinterpret_cast<InternalAttr*>((_impl)->mBuffer)
#define NS_IMPL_EXTRA_SIZE \
diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp
index 43e65777dc..c98859ee39 100644
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -54,7 +54,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsBaseContentList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsBaseContentList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElements)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsBaseContentList)
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index 98df92efb0..299a8e8594 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -13,10 +13,6 @@
#include <float.h>
#endif
-#if defined(SOLARIS)
-#include <ieeefp.h>
-#endif
-
#include "js/TypeDecls.h"
#include "js/Value.h"
#include "js/RootingAPI.h"
diff --git a/dom/base/nsDOMAttributeMap.cpp b/dom/base/nsDOMAttributeMap.cpp
index 381f267cdf..2a90df7e41 100644
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -65,7 +65,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMAttributeMap)
for (auto iter = tmp->mAttributeCache.Iter(); !iter.Done(); iter.Next()) {
cb.NoteXPCOMChild(static_cast<nsINode*>(iter.Data().get()));
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/base/nsDOMMutationObserver.cpp b/dom/base/nsDOMMutationObserver.cpp
index 024ce5e2ef..858a30ce55 100644
--- a/dom/base/nsDOMMutationObserver.cpp
+++ b/dom/base/nsDOMMutationObserver.cpp
@@ -506,7 +506,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDOMMutationObserver)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMMutationObserver)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mReceivers)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFirstPendingMutation)
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index d4d4883790..a6ed419df1 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -1590,10 +1590,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsDocument, tmp->mRefCnt.get())
}
- // Always need to traverse script objects, so do that before we check
- // if we're uncollectable.
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
-
if (!nsINode::Traverse(tmp, cb)) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp
index f4c4ca0f16..bba4232aa8 100644
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -132,7 +132,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsFrameMessageManager)
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mChildManagers)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParentManager)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsFrameMessageManager)
diff --git a/dom/base/nsGenericDOMDataNode.cpp b/dom/base/nsGenericDOMDataNode.cpp
index 9688588e00..0ae15e09ee 100644
--- a/dom/base/nsGenericDOMDataNode.cpp
+++ b/dom/base/nsGenericDOMDataNode.cpp
@@ -98,10 +98,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGenericDOMDataNode)
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGenericDOMDataNode, tmp->mRefCnt.get())
}
- // Always need to traverse script objects, so do that before we check
- // if we're uncollectable.
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
-
if (!nsINode::Traverse(tmp, cb)) {
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp
index de2ebdefe6..ac85e34c0e 100644
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -2284,7 +2284,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsGlobalWindow)
tmp->TraverseHostObjectURIs(cb);
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGlobalWindow)
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index 4a984d294d..dfd380fc2a 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -625,7 +625,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSContext)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsJSContext)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobalObjectRef)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsJSContext)
@@ -1356,9 +1355,20 @@ nsJSContext::RunCycleCollectorSlice()
TimeStamp now = TimeStamp::Now();
// Only run a limited slice if we're within the max running time.
- if (TimeBetween(gCCStats.mBeginTime, now) < kMaxICCDuration) {
- float sliceMultiplier = std::max(TimeBetween(gCCStats.mEndSliceTime, now) / (float)kICCIntersliceDelay, 1.0f);
- budget = js::SliceBudget(js::TimeBudget(kICCSliceBudget * sliceMultiplier));
+ uint32_t runningTime = TimeBetween(gCCStats.mBeginTime, now);
+ if (runningTime < kMaxICCDuration) {
+ // Try to make up for a delay in running this slice.
+ float sliceDelayMultiplier = TimeBetween(gCCStats.mEndSliceTime, now) / (float)kICCIntersliceDelay;
+ float delaySliceBudget = kICCSliceBudget * sliceDelayMultiplier;
+
+ // Increase slice budgets up to |maxLaterSlice| as we approach
+ // half way through the ICC, to avoid large sync CCs.
+ float percentToHalfDone = std::min(2.0f * runningTime / kMaxICCDuration, 1.0f);
+ const float maxLaterSlice = 40.0f;
+ float laterSliceBudget = maxLaterSlice * percentToHalfDone;
+
+ budget = js::SliceBudget(js::TimeBudget(std::max({delaySliceBudget,
+ laterSliceBudget, (float)kICCSliceBudget})));
}
}
}
@@ -2618,7 +2628,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsJSArgArray)
tmp->ReleaseJSObjects();
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsJSArgArray)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSArgArray)
diff --git a/dom/base/nsJSTimeoutHandler.cpp b/dom/base/nsJSTimeoutHandler.cpp
index 8736cd1ddd..ce5d58385b 100644
--- a/dom/base/nsJSTimeoutHandler.cpp
+++ b/dom/base/nsJSTimeoutHandler.cpp
@@ -151,7 +151,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsJSScriptTimeoutHandler)
if (tmp->mFunction) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFunction)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/base/nsMappedAttributes.h b/dom/base/nsMappedAttributes.h
index 9fa7572dda..f00b888b9e 100644
--- a/dom/base/nsMappedAttributes.h
+++ b/dom/base/nsMappedAttributes.h
@@ -93,20 +93,13 @@ private:
nsAttrValue mValue;
};
- /**
- * Due to a compiler bug in VisualAge C++ for AIX, we need to return the
- * address of the first index into mAttrs here, instead of simply
- * returning mAttrs itself.
- *
- * See Bug 231104 for more information.
- */
const InternalAttr* Attrs() const
{
- return reinterpret_cast<const InternalAttr*>(&(mAttrs[0]));
+ return reinterpret_cast<const InternalAttr*>(mAttrs);
}
InternalAttr* Attrs()
{
- return reinterpret_cast<InternalAttr*>(&(mAttrs[0]));
+ return reinterpret_cast<InternalAttr*>(mAttrs);
}
uint16_t mAttrCount;
diff --git a/dom/base/nsRange.cpp b/dom/base/nsRange.cpp
index 4b4ce78857..d45a2c9750 100644
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -351,7 +351,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsRange)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mEndParent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRoot)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelection)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsRange)
diff --git a/dom/base/nsScriptLoader.cpp b/dom/base/nsScriptLoader.cpp
index 0eb5bbf316..1e23d6c5ff 100644
--- a/dom/base/nsScriptLoader.cpp
+++ b/dom/base/nsScriptLoader.cpp
@@ -353,7 +353,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsModuleScript)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mLoader)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsModuleScript)
diff --git a/dom/base/nsWrapperCache.cpp b/dom/base/nsWrapperCache.cpp
index b91d865984..c5993fe7b4 100644
--- a/dom/base/nsWrapperCache.cpp
+++ b/dom/base/nsWrapperCache.cpp
@@ -133,7 +133,7 @@ nsWrapperCache::CheckCCWrapperTraversal(void* aScriptObjectHolder,
// see through the COM layer, so we use a suppression to help it.
JS::AutoSuppressGCAnalysis suppress;
- aTracer->Traverse(aScriptObjectHolder, callback);
+ aTracer->TraverseNativeAndJS(aScriptObjectHolder, callback);
MOZ_ASSERT(callback.mFound,
"Cycle collection participant didn't traverse to preserved "
"wrapper! This will probably crash.");
diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h
index 3c69a7ec46..56cae89edb 100644
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -331,8 +331,7 @@ private:
* causes between the native object and the JS object, so it is important that
* any native object that supports preserving of its wrapper
* traces/traverses/unlinks the cached JS object (see
- * NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER,
- * NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS and
+ * NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER and
* NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER).
*/
enum { WRAPPER_BIT_PRESERVED = 1 << 0 };
@@ -383,7 +382,6 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
@@ -395,7 +393,6 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsWrapperCache, NS_WRAPPERCACHE_IID)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_class) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(__VA_ARGS__) \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(_class)
diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp
index 323feca52c..8d2bdaac64 100644
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2558,7 +2558,7 @@ NonVoidByteStringToJsval(JSContext *cx, const nsACString &str,
template<typename T> static void
-NormalizeUSVStringInternal(JSContext* aCx, T& aString)
+NormalizeUSVStringInternal(T& aString)
{
char16_t* start = aString.BeginWriting();
// Must use const here because we can't pass char** to UTF16CharEnumerator as
@@ -2575,15 +2575,15 @@ NormalizeUSVStringInternal(JSContext* aCx, T& aString)
}
void
-NormalizeUSVString(JSContext* aCx, nsAString& aString)
+NormalizeUSVString(nsAString& aString)
{
- NormalizeUSVStringInternal(aCx, aString);
+ NormalizeUSVStringInternal(aString);
}
void
-NormalizeUSVString(JSContext* aCx, binding_detail::FakeString& aString)
+NormalizeUSVString(binding_detail::FakeString& aString)
{
- NormalizeUSVStringInternal(aCx, aString);
+ NormalizeUSVStringInternal(aString);
}
bool
diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
index 24b47a545d..a3ec70f474 100644
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -49,7 +49,7 @@ namespace mozilla {
enum UseCounter : int16_t;
namespace dom {
-template<typename DataType> class MozMap;
+template<typename KeyType, typename ValueType> class Record;
nsresult
UnwrapArgImpl(JS::Handle<JSObject*> src, const nsIID& iid, void** ppArg);
@@ -2127,11 +2127,30 @@ ConvertJSValueToString(JSContext* cx, JS::Handle<JS::Value> v,
return AssignJSString(cx, result, s);
}
+template<typename T>
+static inline bool
+ConvertJSValueToString(JSContext* cx, JS::Handle<JS::Value> v, T& result)
+{
+ return ConvertJSValueToString(cx, v, eStringify, eStringify, result);
+}
+
void
-NormalizeUSVString(JSContext* aCx, nsAString& aString);
+NormalizeUSVString(nsAString& aString);
void
-NormalizeUSVString(JSContext* aCx, binding_detail::FakeString& aString);
+NormalizeUSVString(binding_detail::FakeString& aString);
+
+template<typename T>
+static inline bool
+ConvertJSValueToUSVString(JSContext* cx, JS::Handle<JS::Value> v, T& result)
+{
+ if (!ConvertJSValueToString(cx, v, eStringify, eStringify, result)) {
+ return false;
+ }
+
+ NormalizeUSVString(result);
+ return true;
+}
template<typename T>
inline bool
@@ -2158,6 +2177,13 @@ bool
ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
bool nullable, nsACString& result);
+inline bool
+ConvertJSValueToByteString(JSContext* cx, JS::Handle<JS::Value> v,
+ nsACString& result)
+{
+ return ConvertJSValueToByteString(cx, v, false, result);
+}
+
template<typename T>
void DoTraceSequence(JSTracer* trc, FallibleTArray<T>& seq);
template<typename T>
@@ -2293,31 +2319,26 @@ public:
}
};
-template<typename T>
-static void
-TraceMozMapValue(T* aValue, void* aClosure)
-{
- JSTracer* trc = static_cast<JSTracer*>(aClosure);
- // Act like it's a one-element sequence to leverage all that infrastructure.
- SequenceTracer<T>::TraceSequence(trc, aValue, aValue + 1);
-}
-
-template<typename T>
-void TraceMozMap(JSTracer* trc, MozMap<T>& map)
+template<typename K, typename V>
+void TraceRecord(JSTracer* trc, Record<K, V>& record)
{
- map.EnumerateValues(TraceMozMapValue<T>, trc);
+ for (auto& entry : record.Entries()) {
+ // Act like it's a one-element sequence to leverage all that infrastructure.
+ SequenceTracer<V>::TraceSequence(trc, &entry.mValue, &entry.mValue + 1);
+ }
}
-// sequence<MozMap>
-template<typename T>
-class SequenceTracer<MozMap<T>, false, false, false>
+// sequence<record>
+template<typename K, typename V>
+class SequenceTracer<Record<K, V>, false, false, false>
{
explicit SequenceTracer() = delete; // Should never be instantiated
public:
- static void TraceSequence(JSTracer* trc, MozMap<T>* seqp, MozMap<T>* end) {
+ static void TraceSequence(JSTracer* trc, Record<K, V>* seqp,
+ Record<K, V>* end) {
for (; seqp != end; ++seqp) {
- seqp->EnumerateValues(TraceMozMapValue<T>, trc);
+ TraceRecord(trc, *seqp);
}
}
};
@@ -2395,51 +2416,51 @@ public:
SequenceType mSequenceType;
};
-// Rooter class for MozMap; this is what we mostly use in the codegen.
-template<typename T>
-class MOZ_RAII MozMapRooter final : private JS::CustomAutoRooter
+// Rooter class for Record; this is what we mostly use in the codegen.
+template<typename K, typename V>
+class MOZ_RAII RecordRooter final : private JS::CustomAutoRooter
{
public:
- MozMapRooter(JSContext *aCx, MozMap<T>* aMozMap
+ RecordRooter(JSContext *aCx, Record<K, V>* aRecord
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: JS::CustomAutoRooter(aCx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
- mMozMap(aMozMap),
- mMozMapType(eMozMap)
+ mRecord(aRecord),
+ mRecordType(eRecord)
{
}
- MozMapRooter(JSContext *aCx, Nullable<MozMap<T>>* aMozMap
+ RecordRooter(JSContext *aCx, Nullable<Record<K, V>>* aRecord
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
: JS::CustomAutoRooter(aCx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT),
- mNullableMozMap(aMozMap),
- mMozMapType(eNullableMozMap)
+ mNullableRecord(aRecord),
+ mRecordType(eNullableRecord)
{
}
private:
- enum MozMapType {
- eMozMap,
- eNullableMozMap
+ enum RecordType {
+ eRecord,
+ eNullableRecord
};
virtual void trace(JSTracer *trc) override
{
- if (mMozMapType == eMozMap) {
- TraceMozMap(trc, *mMozMap);
+ if (mRecordType == eRecord) {
+ TraceRecord(trc, *mRecord);
} else {
- MOZ_ASSERT(mMozMapType == eNullableMozMap);
- if (!mNullableMozMap->IsNull()) {
- TraceMozMap(trc, mNullableMozMap->Value());
+ MOZ_ASSERT(mRecordType == eNullableRecord);
+ if (!mNullableRecord->IsNull()) {
+ TraceRecord(trc, mNullableRecord->Value());
}
}
}
union {
- MozMap<T>* mMozMap;
- Nullable<MozMap<T>>* mNullableMozMap;
+ Record<K, V>* mRecord;
+ Nullable<Record<K, V>>* mNullableRecord;
};
- MozMapType mMozMapType;
+ RecordType mRecordType;
};
template<typename T>
diff --git a/dom/bindings/CallbackObject.cpp b/dom/bindings/CallbackObject.cpp
index 7c7d2c6b4c..bb01c804c4 100644
--- a/dom/bindings/CallbackObject.cpp
+++ b/dom/bindings/CallbackObject.cpp
@@ -37,7 +37,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(CallbackObject)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mIncumbentGlobal)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CallbackObject)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIncumbentGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(CallbackObject)
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py
index 7a66686874..74acb5918c 100644
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -84,7 +84,7 @@ def idlTypeNeedsCycleCollection(type):
return True
elif type.isUnion():
return any(idlTypeNeedsCycleCollection(t) for t in type.flatMemberTypes)
- elif type.isMozMap():
+ elif type.isRecord():
if idlTypeNeedsCycleCollection(type.inner):
raise TypeError("Cycle collection for type %s is not supported" % type)
return False
@@ -996,6 +996,8 @@ class CGElseChain(CGThing):
class CGTemplatedType(CGWrapper):
def __init__(self, templateName, child, isConst=False, isReference=False):
+ if isinstance(child, list):
+ child = CGList(child, ", ")
const = "const " if isConst else ""
pre = "%s%s<" % (const, templateName)
ref = "&" if isReference else ""
@@ -1171,12 +1173,12 @@ class CGHeaders(CGWrapper):
declareIncludes.add(filename)
elif unrolled.isPrimitive():
bindingHeaders.add("mozilla/dom/PrimitiveConversions.h")
- elif unrolled.isMozMap():
+ elif unrolled.isRecord():
if dictionary or jsImplementedDescriptors:
- declareIncludes.add("mozilla/dom/MozMap.h")
+ declareIncludes.add("mozilla/dom/Record.h")
else:
- bindingHeaders.add("mozilla/dom/MozMap.h")
- # Also add headers for the type the MozMap is
+ bindingHeaders.add("mozilla/dom/Record.h")
+ # Also add headers for the type the record is
# parametrized over, if needed.
addHeadersForType((t.inner, dictionary))
@@ -1388,8 +1390,8 @@ def UnionTypes(unionTypes, config):
# the right header to be able to Release() in our inlined
# code.
headers.add(CGHeaders.getDeclarationFilename(f.callback))
- elif f.isMozMap():
- headers.add("mozilla/dom/MozMap.h")
+ elif f.isRecord():
+ headers.add("mozilla/dom/Record.h")
# And add headers for the type we're parametrized over
addHeadersForType(f.inner)
@@ -1448,9 +1450,9 @@ def UnionConversions(unionTypes, config):
headers.add(CGHeaders.getDeclarationFilename(f.inner))
elif f.isPrimitive():
headers.add("mozilla/dom/PrimitiveConversions.h")
- elif f.isMozMap():
- headers.add("mozilla/dom/MozMap.h")
- # And the internal type of the MozMap
+ elif f.isRecord():
+ headers.add("mozilla/dom/Record.h")
+ # And the internal type of the record
addHeadersForType(f.inner)
# We plan to include UnionTypes.h no matter what, so it's
@@ -4290,6 +4292,9 @@ class JSToNativeConversionInfo():
for whether we have a JS::Value. Only used when
defaultValue is not None or when True is passed for
checkForValue to instantiateJSToNativeConversion.
+ This expression may not be already-parenthesized, so if
+ you use it with && or || make sure to put parens
+ around it.
${passedToJSImpl} replaced by an expression that evaluates to a boolean
for whether this value is being passed to a JS-
implemented interface.
@@ -4355,7 +4360,9 @@ def handleDefaultStringValue(defaultValue, method):
passing as the second argument of handleDefault; in particular it does not
end with a ';'
"""
- assert defaultValue.type.isDOMString() or defaultValue.type.isByteString()
+ assert (defaultValue.type.isDOMString() or
+ defaultValue.type.isUSVString() or
+ defaultValue.type.isByteString())
return ("static const %(char_t)s data[] = { %(data)s };\n"
"%(method)s(data, ArrayLength(data) - 1)") % {
'char_t': "char" if defaultValue.type.isByteString() else "char16_t",
@@ -4365,6 +4372,17 @@ def handleDefaultStringValue(defaultValue, method):
}
+def recordKeyType(recordType):
+ assert recordType.keyType.isString()
+ if recordType.keyType.isByteString():
+ return "nsCString"
+ return "nsString"
+
+
+def recordKeyDeclType(recordType):
+ return CGGeneric(recordKeyType(recordType))
+
+
# If this function is modified, modify CGNativeMember.getArg and
# CGNativeMember.getRetvalInfo accordingly. The latter cares about the decltype
# and holdertype we end up using, because it needs to be able to return the code
@@ -4559,7 +4577,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
declArgs = "cx"
else:
assert (isMember in
- ("Sequence", "Variadic", "Dictionary", "OwningUnion", "MozMap"))
+ ("Sequence", "Variadic", "Dictionary", "OwningUnion", "Record"))
# We'll get traced by the sequence or dictionary or union tracer
declType = CGGeneric("JSObject*")
declArgs = None
@@ -4725,39 +4743,41 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
dealWithOptional=isOptional,
holderArgs=holderArgs)
- if type.isMozMap():
+ if type.isRecord():
assert not isEnforceRange and not isClamp
if failureCode is None:
- notMozMap = ('ThrowErrorMessage(cx, MSG_NOT_OBJECT, "%s");\n'
+ notRecord = ('ThrowErrorMessage(cx, MSG_NOT_OBJECT, "%s");\n'
"%s" % (firstCap(sourceDescription), exceptionCode))
else:
- notMozMap = failureCode
+ notRecord = failureCode
nullable = type.nullable()
# Be very careful not to change "type": we need it later
if nullable:
- valueType = type.inner.inner
+ recordType = type.inner
else:
- valueType = type.inner
+ recordType = type
+ valueType = recordType.inner
valueInfo = getJSToNativeConversionInfo(
- valueType, descriptorProvider, isMember="MozMap",
+ valueType, descriptorProvider, isMember="Record",
exceptionCode=exceptionCode, lenientFloatCode=lenientFloatCode,
isCallbackReturnValue=isCallbackReturnValue,
sourceDescription="value in %s" % sourceDescription,
nestingLevel=incrementNestingLevel())
if valueInfo.dealWithOptional:
- raise TypeError("Shouldn't have optional things in MozMap")
+ raise TypeError("Shouldn't have optional things in record")
if valueInfo.holderType is not None:
- raise TypeError("Shouldn't need holders for MozMap")
+ raise TypeError("Shouldn't need holders for record")
- typeName = CGTemplatedType("MozMap", valueInfo.declType)
- mozMapType = typeName.define()
+ declType = CGTemplatedType("Record", [recordKeyDeclType(recordType),
+ valueInfo.declType])
+ typeName = declType.define()
if nullable:
- typeName = CGTemplatedType("Nullable", typeName)
- mozMapRef = "${declName}.SetValue()"
+ declType = CGTemplatedType("Nullable", declType)
+ recordRef = "${declName}.SetValue()"
else:
- mozMapRef = "${declName}"
+ recordRef = "${declName}"
valueConversion = string.Template(valueInfo.template).substitute({
"val": "temp",
@@ -4770,68 +4790,122 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
"passedToJSImpl": "${passedToJSImpl}"
})
+ keyType = recordKeyType(recordType)
+ if recordType.keyType.isByteString():
+ keyConversionFunction = "ConvertJSValueToByteString"
+ hashKeyType = "nsCStringHashKey"
+ else:
+ hashKeyType = "nsStringHashKey"
+ if recordType.keyType.isDOMString():
+ keyConversionFunction = "ConvertJSValueToString"
+ else:
+ assert recordType.keyType.isUSVString()
+ keyConversionFunction = "ConvertJSValueToUSVString"
+
templateBody = fill(
"""
- ${mozMapType} &mozMap = ${mozMapRef};
+ auto& recordEntries = ${recordRef}.Entries();
- JS::Rooted<JSObject*> mozMapObj(cx, &$${val}.toObject());
- JS::Rooted<JS::IdVector> ids(cx, JS::IdVector(cx));
- if (!JS_Enumerate(cx, mozMapObj, &ids)) {
+ JS::Rooted<JSObject*> recordObj(cx, &$${val}.toObject());
+ JS::AutoIdVector ids(cx);
+ if (!js::GetPropertyKeys(cx, recordObj,
+ JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, &ids)) {
+ $*{exceptionCode}
+ }
+ if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
+ JS_ReportOutOfMemory(cx);
$*{exceptionCode}
}
JS::Rooted<JS::Value> propNameValue(cx);
JS::Rooted<JS::Value> temp(cx);
JS::Rooted<jsid> curId(cx);
+ JS::Rooted<JS::Value> idVal(cx);
+ // Use a hashset to keep track of ids seen, to avoid
+ // introducing nasty O(N^2) behavior scanning for them all the
+ // time. Ideally we'd use a data structure with O(1) lookup
+ // _and_ ordering for the MozMap, but we don't have one lying
+ // around.
+ nsTHashtable<${hashKeyType}> idsSeen;
for (size_t i = 0; i < ids.length(); ++i) {
- // Make sure we get the value before converting the name, since
- // getting the value can trigger GC but our name is a dependent
- // string.
curId = ids[i];
- binding_detail::FakeString propName;
- bool isSymbol;
- if (!ConvertIdToString(cx, curId, propName, isSymbol) ||
- (!isSymbol && !JS_GetPropertyById(cx, mozMapObj, curId, &temp))) {
+
+ JS::Rooted<JS::PropertyDescriptor> desc(cx);
+ if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
+ &desc)) {
$*{exceptionCode}
}
- if (isSymbol) {
+
+ if (!desc.object() /* == undefined in spec terms */ ||
+ !desc.enumerable()) {
continue;
}
- ${valueType}* slotPtr = mozMap.AddEntry(propName);
- if (!slotPtr) {
- JS_ReportOutOfMemory(cx);
+ idVal = js::IdToValue(curId);
+ ${keyType} propName;
+ // This will just throw if idVal is a Symbol, like the spec says
+ // to do.
+ if (!${keyConversionFunction}(cx, idVal, propName)) {
$*{exceptionCode}
}
- ${valueType}& slot = *slotPtr;
+
+ if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
+ $*{exceptionCode}
+ }
+
+ ${typeName}::EntryType* entry;
+ if (idsSeen.Contains(propName)) {
+ // Find the existing entry.
+ auto idx = recordEntries.IndexOf(propName);
+ MOZ_ASSERT(idx != recordEntries.NoIndex,
+ "Why is it not found?");
+ // Now blow it away to make it look like it was just added
+ // to the array, because it's not obvious that it's
+ // safe to write to its already-initialized mValue via our
+ // normal codegen conversions. For example, the value
+ // could be a union and this would change its type, but
+ // codegen assumes we won't do that.
+ entry = recordEntries.ReconstructElementAt(idx);
+ } else {
+ // Safe to do an infallible append here, because we did a
+ // SetCapacity above to the right capacity.
+ entry = recordEntries.AppendElement();
+ idsSeen.PutEntry(propName);
+ }
+ entry->mKey = propName;
+ ${valueType}& slot = entry->mValue;
$*{valueConversion}
}
""",
exceptionCode=exceptionCode,
- mozMapType=mozMapType,
- mozMapRef=mozMapRef,
+ recordRef=recordRef,
+ hashKeyType=hashKeyType,
+ keyType=keyType,
+ keyConversionFunction=keyConversionFunction,
+ typeName=typeName,
valueType=valueInfo.declType.define(),
valueConversion=valueConversion)
templateBody = wrapObjectTemplate(templateBody, type,
"${declName}.SetNull();\n",
- notMozMap)
+ notRecord)
- declType = typeName
declArgs = None
holderType = None
holderArgs = None
- # MozMap arguments that might contain traceable things need
+ # record arguments that might contain traceable things need
# to get traced
if not isMember and isCallbackReturnValue:
# Go ahead and just convert directly into our actual return value
declType = CGWrapper(declType, post="&")
declArgs = "aRetVal"
elif not isMember and typeNeedsRooting(valueType):
- holderType = CGTemplatedType("MozMapRooter", valueInfo.declType)
- # If our MozMap is nullable, this will set the Nullable to be
+ holderType = CGTemplatedType("RecordRooter",
+ [recordKeyDeclType(recordType),
+ valueInfo.declType])
+ # If our record is nullable, this will set the Nullable to be
# not-null, but that's ok because we make an explicit SetNull() call
# on it as needed if our JS value is actually null.
- holderArgs = "cx, &%s" % mozMapRef
+ holderArgs = "cx, &%s" % recordRef
return JSToNativeConversionInfo(templateBody, declType=declType,
declArgs=declArgs,
@@ -4914,16 +4988,16 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
else:
setDictionary = None
- mozMapMemberTypes = filter(lambda t: t.isMozMap(), memberTypes)
- if len(mozMapMemberTypes) > 0:
- assert len(mozMapMemberTypes) == 1
- name = getUnionMemberName(mozMapMemberTypes[0])
- mozMapObject = CGGeneric(
+ recordMemberTypes = filter(lambda t: t.isRecord(), memberTypes)
+ if len(recordMemberTypes) > 0:
+ assert len(recordMemberTypes) == 1
+ name = getUnionMemberName(recordMemberTypes[0])
+ recordObject = CGGeneric(
"done = (failed = !%s.TrySetTo%s(cx, ${val}, tryNext, ${passedToJSImpl})) || !tryNext;\n" %
(unionArgumentObj, name))
names.append(name)
else:
- mozMapObject = None
+ recordObject = None
objectMemberTypes = filter(lambda t: t.isObject(), memberTypes)
if len(objectMemberTypes) > 0:
@@ -4939,10 +5013,10 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
else:
object = None
- hasObjectTypes = interfaceObject or sequenceObject or dateObject or callbackObject or object or mozMapObject
+ hasObjectTypes = interfaceObject or sequenceObject or dateObject or callbackObject or object or recordObject
if hasObjectTypes:
# "object" is not distinguishable from other types
- assert not object or not (interfaceObject or sequenceObject or dateObject or callbackObject or mozMapObject)
+ assert not object or not (interfaceObject or sequenceObject or dateObject or callbackObject or recordObject)
if sequenceObject or dateObject or callbackObject:
# An object can be both an sequence object and a callback or
# dictionary, but we shouldn't have both in the union's members
@@ -4962,9 +5036,9 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
if dateObject:
templateBody.prepend(CGGeneric("JS::Rooted<JSObject*> argObj(cx, &${val}.toObject());\n"))
- if mozMapObject:
+ if recordObject:
templateBody = CGList([templateBody,
- CGIfWrapper(mozMapObject, "!done")])
+ CGIfWrapper(recordObject, "!done")])
templateBody = CGIfWrapper(templateBody, "${val}.isObject()")
else:
@@ -5144,7 +5218,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
if isinstance(defaultValue, IDLNullValue):
extraConditionForNull = "!(${haveValue}) || "
else:
- extraConditionForNull = "${haveValue} && "
+ extraConditionForNull = "(${haveValue}) && "
else:
extraConditionForNull = ""
templateBody = handleNull(templateBody, declLoc,
@@ -5525,7 +5599,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
def getConversionCode(varName):
normalizeCode = ""
if type.isUSVString():
- normalizeCode = "NormalizeUSVString(cx, %s);\n" % varName
+ normalizeCode = "NormalizeUSVString(%s);\n" % varName
conversionCode = fill("""
if (!ConvertJSValueToString(cx, $${val}, ${nullBehavior}, ${undefinedBehavior}, ${varName})) {
@@ -5688,7 +5762,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
haveCallable = "${val}.isObject() && " + haveCallable
if defaultValue is not None:
assert(isinstance(defaultValue, IDLNullValue))
- haveCallable = "${haveValue} && " + haveCallable
+ haveCallable = "(${haveValue}) && " + haveCallable
template = (
("if (%s) {\n" % haveCallable) +
conversion +
@@ -5700,7 +5774,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
haveObject = "${val}.isObject()"
if defaultValue is not None:
assert(isinstance(defaultValue, IDLNullValue))
- haveObject = "${haveValue} && " + haveObject
+ haveObject = "(${haveValue}) && " + haveObject
template = CGIfElseWrapper(haveObject,
CGGeneric(conversion),
CGGeneric("${declName} = nullptr;\n")).define()
@@ -5724,7 +5798,7 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
assert not isEnforceRange and not isClamp
declArgs = None
- if isMember in ("Variadic", "Sequence", "Dictionary", "MozMap"):
+ if isMember in ("Variadic", "Sequence", "Dictionary", "Record"):
# Rooting is handled by the sequence and dictionary tracers.
declType = "JS::Value"
else:
@@ -5768,8 +5842,9 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
return handleJSObjectType(type, isMember, failureCode, exceptionCode, sourceDescription)
if type.isDictionary():
- # There are no nullable dictionaries
- assert not type.nullable() or isCallbackReturnValue
+ # There are no nullable dictionary arguments or dictionary members
+ assert(not type.nullable() or isCallbackReturnValue or
+ (isMember and isMember != "Dictionary"))
# All optional dictionaries always have default values, so we
# should be able to assume not isOptional here.
assert not isOptional
@@ -6256,7 +6331,7 @@ def getMaybeWrapValueFuncForType(type):
sequenceWrapLevel = 0
-mozMapWrapLevel = 0
+recordWrapLevel = 0
def getWrapTemplateForType(type, descriptorProvider, result, successCode,
@@ -6361,7 +6436,7 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
if type is None or type.isVoid():
return (setUndefined(), True)
- if (type.isSequence() or type.isMozMap()) and type.nullable():
+ if (type.isSequence() or type.isRecord()) and type.nullable():
# These are both wrapped in Nullable<>
recTemplate, recInfall = getWrapTemplateForType(type.inner, descriptorProvider,
"%s.Value()" % result, successCode,
@@ -6434,14 +6509,14 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
return (code, False)
- if type.isMozMap():
- # Now do non-nullable MozMap. Our success code is just to break to
+ if type.isRecord():
+ # Now do non-nullable record. Our success code is just to break to
# where we define the property on the object. Note that we bump the
- # mozMapWrapLevel around this call so that nested MozMap conversions
+ # recordWrapLevel around this call so that nested record conversions
# will use different temp value names.
- global mozMapWrapLevel
- valueName = "mozMapValue%d" % mozMapWrapLevel
- mozMapWrapLevel += 1
+ global recordWrapLevel
+ valueName = "recordValue%d" % recordWrapLevel
+ recordWrapLevel += 1
innerTemplate = wrapForType(
type.inner, descriptorProvider,
{
@@ -6454,12 +6529,22 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
'obj': "returnObj",
'typedArraysAreStructs': typedArraysAreStructs
})
- mozMapWrapLevel -= 1
+ recordWrapLevel -= 1
+ if type.keyType.isByteString():
+ # There is no length-taking JS_DefineProperty. So to keep
+ # things sane with embedded nulls, we want to byte-inflate
+ # to an nsAString. The only byte-inflation function we
+ # have around is AppendASCIItoUTF16, which luckily doesn't
+ # assert anything about the input being ASCII.
+ expandedKeyDecl = "NS_ConvertASCIItoUTF16 expandedKey(entry.mKey);\n"
+ keyName = "expandedKey"
+ else:
+ expandedKeyDecl = ""
+ keyName = "entry.mKey"
+
code = fill(
"""
- nsTArray<nsString> keys;
- ${result}.GetKeys(keys);
JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
if (!returnObj) {
$*{exceptionCode}
@@ -6467,15 +6552,17 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
// Scope for 'tmp'
{
JS::Rooted<JS::Value> tmp(cx);
- for (size_t idx = 0; idx < keys.Length(); ++idx) {
- auto& ${valueName} = ${result}.Get(keys[idx]);
+ for (auto& entry : ${result}.Entries()) {
+ auto& ${valueName} = entry.mValue;
// Control block to let us common up the JS_DefineUCProperty calls when there
// are different ways to succeed at wrapping the value.
do {
$*{innerTemplate}
} while (0);
- if (!JS_DefineUCProperty(cx, returnObj, keys[idx].get(),
- keys[idx].Length(), tmp,
+ $*{expandedKeyDecl}
+ if (!JS_DefineUCProperty(cx, returnObj,
+ ${keyName}.BeginReading(),
+ ${keyName}.Length(), tmp,
JSPROP_ENUMERATE)) {
$*{exceptionCode}
}
@@ -6487,6 +6574,8 @@ def getWrapTemplateForType(type, descriptorProvider, result, successCode,
exceptionCode=exceptionCode,
valueName=valueName,
innerTemplate=innerTemplate,
+ expandedKeyDecl=expandedKeyDecl,
+ keyName=keyName,
set=setObject("*returnObj"))
return (code, False)
@@ -6770,7 +6859,7 @@ def typeMatchesLambda(type, func):
return False
if type.nullable():
return typeMatchesLambda(type.inner, func)
- if type.isSequence() or type.isMozMap():
+ if type.isSequence() or type.isRecord():
return typeMatchesLambda(type.inner, func)
if type.isUnion():
return any(typeMatchesLambda(t, func) for t in
@@ -6866,20 +6955,21 @@ def getRetvalDeclarationForType(returnType, descriptorProvider,
if nullable:
result = CGTemplatedType("Nullable", result)
return result, "ref", rooter, None, None
- if returnType.isMozMap():
+ if returnType.isRecord():
nullable = returnType.nullable()
if nullable:
returnType = returnType.inner
result, _, _, _, _ = getRetvalDeclarationForType(returnType.inner,
descriptorProvider,
- isMember="MozMap")
+ isMember="Record")
# While we have our inner type, set up our rooter, if needed
if not isMember and typeNeedsRooting(returnType):
- rooter = CGGeneric("MozMapRooter<%s> resultRooter(cx, &result);\n" %
- result.define())
+ rooter = CGGeneric("RecordRooter<%s> resultRooter(cx, &result);\n" %
+ ("nsString, " + result.define()))
else:
rooter = None
- result = CGTemplatedType("MozMap", result)
+ result = CGTemplatedType("Record", [recordKeyDeclType(returnType),
+ result])
if nullable:
result = CGTemplatedType("Nullable", result)
return result, "ref", rooter, None, None
@@ -6976,7 +7066,7 @@ class CGCallGenerator(CGThing):
return True
if a.type.isSequence():
return True
- if a.type.isMozMap():
+ if a.type.isRecord():
return True
# isObject() types are always a JS::Rooted, whether
# nullable or not, and it turns out a const JS::Rooted
@@ -7138,7 +7228,7 @@ class MethodNotNewObjectError(Exception):
# nested sequences we don't use the same variable name to iterate over
# different sequences.
sequenceWrapLevel = 0
-mapWrapLevel = 0
+recordWrapLevel = 0
def wrapTypeIntoCurrentCompartment(type, value, isMember=True):
@@ -7199,29 +7289,27 @@ def wrapTypeIntoCurrentCompartment(type, value, isMember=True):
wrapCode = CGIfWrapper(wrapCode, "!%s.IsNull()" % origValue)
return wrapCode
- if type.isMozMap():
- origValue = value
+ if type.isRecord():
origType = type
if type.nullable():
type = type.inner
- value = "%s.Value()" % value
- global mapWrapLevel
- key = "mapName%d" % mapWrapLevel
- mapWrapLevel += 1
+ recordRef = "%s.Value()" % value
+ else:
+ recordRef = value
+ global recordWrapLevel
+ entryRef = "mapEntry%d" % recordWrapLevel
+ recordWrapLevel += 1
wrapElement = wrapTypeIntoCurrentCompartment(type.inner,
- "%s.Get(%sKeys[%sIndex])" % (value, key, key))
- mapWrapLevel -= 1
+ "%s.mValue" % entryRef)
+ recordWrapLevel -= 1
if not wrapElement:
return None
wrapCode = CGWrapper(CGIndenter(wrapElement),
- pre=("""
- nsTArray<nsString> %sKeys;
- %s.GetKeys(%sKeys);
- for (uint32_t %sIndex = 0; %sIndex < %sKeys.Length(); ++%sIndex) {
- """ % (key, value, key, key, key, key, key)),
+ pre=("for (auto& %s : %s.Entries()) {\n" %
+ (entryRef, recordRef)),
post="}\n")
if origType.nullable():
- wrapCode = CGIfWrapper(wrapCode, "!%s.IsNull()" % origValue)
+ wrapCode = CGIfWrapper(wrapCode, "!%s.IsNull()" % value)
return wrapCode
if type.isDictionary():
@@ -8110,11 +8198,11 @@ class CGMethodCall(CGThing):
if distinguishingType(s).isSequence())
# Now append all the overloads that take a dictionary or callback
- # interface or MozMap. There should be only one of these!
+ # interface or record. There should be only one of these!
genericObjectSigs = [
s for s in possibleSignatures
if (distinguishingType(s).isDictionary() or
- distinguishingType(s).isMozMap() or
+ distinguishingType(s).isRecord() or
distinguishingType(s).isCallbackInterface())]
assert len(genericObjectSigs) <= 1
objectSigs.extend(genericObjectSigs)
@@ -9408,7 +9496,7 @@ class CGMemberJITInfo(CGThing):
return "JSVAL_TYPE_UNDEFINED"
if t.isSequence():
return "JSVAL_TYPE_OBJECT"
- if t.isMozMap():
+ if t.isRecord():
return "JSVAL_TYPE_OBJECT"
if t.isGeckoInterface():
return "JSVAL_TYPE_OBJECT"
@@ -9669,17 +9757,22 @@ def getUnionAccessorSignatureType(type, descriptorProvider):
# Flat member types have already unwrapped nullables.
assert not type.nullable()
- if type.isSequence() or type.isMozMap():
+ if type.isSequence() or type.isRecord():
if type.isSequence():
wrapperType = "Sequence"
else:
- wrapperType = "MozMap"
+ wrapperType = "Record"
# We don't use the returned template here, so it's OK to just pass no
# sourceDescription.
elementInfo = getJSToNativeConversionInfo(type.inner,
descriptorProvider,
isMember=wrapperType)
- return CGTemplatedType(wrapperType, elementInfo.declType,
+ if wrapperType == "Sequence":
+ innerType = elementInfo.declType
+ else:
+ innerType = [recordKeyDeclType(type), elementInfo.declType]
+
+ return CGTemplatedType(wrapperType, innerType,
isConst=True, isReference=True)
# Nested unions are unwrapped automatically into our flatMemberTypes.
@@ -10040,10 +10133,10 @@ class CGUnionStruct(CGThing):
CGCase("e" + vars["name"],
CGGeneric("DoTraceSequence(trc, mValue.m%s.Value());\n" %
vars["name"])))
- elif t.isMozMap():
+ elif t.isRecord():
traceCases.append(
CGCase("e" + vars["name"],
- CGGeneric("TraceMozMap(trc, mValue.m%s.Value());\n" %
+ CGGeneric("TraceRecord(trc, mValue.m%s.Value());\n" %
vars["name"])))
else:
assert t.isSpiderMonkeyInterface()
@@ -13172,8 +13265,8 @@ class CGDictionary(CGThing):
trace = CGGeneric('%s.TraceSelf(trc);\n' % memberData)
if type.nullable():
trace = CGIfWrapper(trace, "!%s.IsNull()" % memberNullable)
- elif type.isMozMap():
- # If you implement this, add a MozMap<object> to
+ elif type.isRecord():
+ # If you implement this, add a record<DOMString, object> to
# TestInterfaceJSDictionary and test it in test_bug1036214.html
# to make sure we end up with the correct security properties.
assert False
@@ -13583,7 +13676,7 @@ class ForwardDeclarationBuilder:
# since we don't know which one we might want
self.addInMozillaDom(CGUnionStruct.unionTypeName(t, False))
self.addInMozillaDom(CGUnionStruct.unionTypeName(t, True))
- elif t.isMozMap():
+ elif t.isRecord():
self.forwardDeclareForType(t.inner, config)
# Don't need to do anything for void, primitive, string, any or object.
# There may be some other cases we are missing.
@@ -14089,9 +14182,9 @@ class CGNativeMember(ClassMethod):
else:
returnCode = "aRetVal.SwapElements(${declName});\n"
return "void", "", returnCode
- if type.isMozMap():
- # If we want to handle MozMap-of-MozMap return values, we're
- # going to need to fix example codegen to not produce MozMap<void>
+ if type.isRecord():
+ # If we want to handle record-of-record return values, we're
+ # going to need to fix example codegen to not produce record<void>
# for the relevant argument...
assert not isMember
# In this case we convert directly into our outparam to start with
@@ -14139,13 +14232,14 @@ class CGNativeMember(ClassMethod):
if nullable:
type = CGTemplatedType("Nullable", type)
args.append(Argument("%s&" % type.define(), "aRetVal"))
- elif returnType.isMozMap():
+ elif returnType.isRecord():
nullable = returnType.nullable()
if nullable:
returnType = returnType.inner
# And now the actual underlying type
elementDecl = self.getReturnType(returnType.inner, True)
- type = CGTemplatedType("MozMap", CGGeneric(elementDecl))
+ type = CGTemplatedType("Record", [recordKeyDeclType(returnType),
+ CGGeneric(elementDecl)])
if nullable:
type = CGTemplatedType("Nullable", type)
args.append(Argument("%s&" % type.define(), "aRetVal"))
@@ -14206,7 +14300,7 @@ class CGNativeMember(ClassMethod):
Nullable as needed.
isMember can be false or one of the strings "Sequence", "Variadic",
- "MozMap"
+ "Record"
"""
if type.isSequence():
nullable = type.nullable()
@@ -14217,13 +14311,13 @@ class CGNativeMember(ClassMethod):
decl = CGTemplatedType("Sequence", argType)
return decl.define(), True, True
- if type.isMozMap():
+ if type.isRecord():
nullable = type.nullable()
if nullable:
type = type.inner
elementType = type.inner
- argType = self.getArgType(elementType, False, "MozMap")[0]
- decl = CGTemplatedType("MozMap", argType)
+ argType = self.getArgType(elementType, False, "Record")[0]
+ decl = CGTemplatedType("Record", [recordKeyDeclType(type), argType])
return decl.define(), True, True
if type.isUnion():
@@ -14994,7 +15088,6 @@ class CGJSImplClass(CGBindingImplClass):
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(${ifaceName})
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(${ifaceName})
NS_IMPL_CYCLE_COLLECTING_ADDREF(${ifaceName})
diff --git a/dom/bindings/Configuration.py b/dom/bindings/Configuration.py
index 5c96580a1c..f80c19c33a 100644
--- a/dom/bindings/Configuration.py
+++ b/dom/bindings/Configuration.py
@@ -115,7 +115,7 @@ class Configuration(DescriptorProvider):
for (t, _) in getAllTypes(self.descriptors, self.dictionaries, self.callbacks):
while True:
- if t.isMozMap():
+ if t.isRecord():
t = t.inner
elif t.unroll() != t:
t = t.unroll()
diff --git a/dom/bindings/Exceptions.cpp b/dom/bindings/Exceptions.cpp
index a3f8076887..8ace370513 100644
--- a/dom/bindings/Exceptions.cpp
+++ b/dom/bindings/Exceptions.cpp
@@ -305,7 +305,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(JSStackFrame)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCaller)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAsyncCaller)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(JSStackFrame)
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mStack)
diff --git a/dom/bindings/MozMap.h b/dom/bindings/MozMap.h
deleted file mode 100644
index 1e920c098e..0000000000
--- a/dom/bindings/MozMap.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Class for representing MozMap arguments. This is an nsTHashtable
- * under the hood, but we don't want to leak that implementation
- * detail.
- */
-
-#ifndef mozilla_dom_MozMap_h
-#define mozilla_dom_MozMap_h
-
-#include "nsTHashtable.h"
-#include "nsHashKeys.h"
-#include "nsStringGlue.h"
-#include "nsTArray.h"
-#include "mozilla/Attributes.h"
-#include "mozilla/Move.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace binding_detail {
-template<typename DataType>
-class MozMapEntry : public nsStringHashKey
-{
-public:
- explicit MozMapEntry(const nsAString* aKeyTypePointer)
- : nsStringHashKey(aKeyTypePointer)
- {
- }
-
- // Move constructor so we can do MozMaps of MozMaps.
- MozMapEntry(MozMapEntry<DataType>&& aOther)
- : nsStringHashKey(aOther),
- mData(Move(aOther.mData))
- {
- }
-
- DataType mData;
-};
-
-} // namespace binding_detail
-
-template<typename DataType>
-class MozMap : protected nsTHashtable<binding_detail::MozMapEntry<DataType>>
-{
-public:
- typedef typename binding_detail::MozMapEntry<DataType> EntryType;
- typedef nsTHashtable<EntryType> Base;
- typedef MozMap<DataType> SelfType;
-
- MozMap()
- {
- }
-
- // Move constructor so we can do MozMap of MozMap.
- MozMap(SelfType&& aOther) :
- Base(Move(aOther))
- {
- }
-
- // The return value is only safe to use until an AddEntry call.
- const DataType& Get(const nsAString& aKey) const
- {
- const EntryType* ent = this->GetEntry(aKey);
- MOZ_ASSERT(ent, "Why are you using a key we didn't claim to have?");
- return ent->mData;
- }
-
- DataType& Get(const nsAString& aKey)
- {
- EntryType* ent = this->GetEntry(aKey);
- MOZ_ASSERT(ent, "Why are you using a key we didn't claim to have?");
- return ent->mData;
- }
-
- // The return value is only safe to use until an AddEntry call.
- const DataType* GetIfExists(const nsAString& aKey) const
- {
- const EntryType* ent = this->GetEntry(aKey);
- if (!ent) {
- return nullptr;
- }
- return &ent->mData;
- }
-
- void GetKeys(nsTArray<nsString>& aKeys) const {
- for (auto iter = this->ConstIter(); !iter.Done(); iter.Next()) {
- aKeys.AppendElement(iter.Get()->GetKey());
- }
- }
-
- // XXXbz we expose this generic enumerator for tracing. Otherwise we'd end up
- // with a dependency on BindingUtils.h here for the SequenceTracer bits.
- typedef void (* Enumerator)(DataType* aValue, void* aClosure);
- void EnumerateValues(Enumerator aEnumerator, void *aClosure)
- {
- for (auto iter = this->Iter(); !iter.Done(); iter.Next()) {
- aEnumerator(&iter.Get()->mData, aClosure);
- }
- }
-
- MOZ_MUST_USE
- DataType* AddEntry(const nsAString& aKey)
- {
- EntryType* ent = this->PutEntry(aKey, fallible);
- if (!ent) {
- return nullptr;
- }
- return &ent->mData;
- }
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_MozMap_h
diff --git a/dom/bindings/Record.h b/dom/bindings/Record.h
new file mode 100644
index 0000000000..d6ab316996
--- /dev/null
+++ b/dom/bindings/Record.h
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/**
+ * Class for representing record arguments. Basically an array under the hood.
+ */
+
+#ifndef mozilla_dom_Record_h
+#define mozilla_dom_Record_h
+
+#include "nsTHashtable.h"
+#include "nsHashKeys.h"
+#include "nsStringGlue.h"
+#include "nsTArray.h"
+#include "mozilla/Attributes.h"
+#include "mozilla/Move.h"
+
+namespace mozilla {
+namespace dom {
+
+namespace binding_detail {
+template<typename KeyType, typename ValueType>
+class RecordEntry
+{
+public:
+ RecordEntry()
+ {
+ }
+
+ // Move constructor so we can do Records of Records.
+ RecordEntry(RecordEntry<KeyType, ValueType>&& aOther)
+ : mKey(Move(aOther.mKey)),
+ mValue(Move(aOther.mValue))
+ {
+ }
+
+ KeyType mKey;
+ ValueType mValue;
+};
+
+} // namespace binding_detail
+
+template<typename KeyType, typename ValueType>
+class Record
+{
+public:
+ typedef typename binding_detail::RecordEntry<KeyType, ValueType> EntryType;
+ typedef Record<KeyType, ValueType> SelfType;
+
+ Record()
+ {
+ }
+
+ // Move constructor so we can do Record of Record.
+ Record(SelfType&& aOther) :
+ mEntries(Move(aOther.mEntries))
+ {
+ }
+
+ const nsTArray<EntryType>& Entries() const
+ {
+ return mEntries;
+ }
+
+ nsTArray<EntryType>& Entries()
+ {
+ return mEntries;
+ }
+
+private:
+ nsTArray<EntryType> mEntries;
+};
+
+} // namespace dom
+} // namespace mozilla
+
+template<typename K, typename V>
+class nsDefaultComparator<mozilla::dom::binding_detail::RecordEntry<K, V>, K>
+{
+public:
+ bool Equals(const mozilla::dom::binding_detail::RecordEntry<K, V>& aEntry,
+ const K& aKey) const
+ {
+ return aEntry.mKey == aKey;
+ }
+};
+
+#endif // mozilla_dom_Record_h
diff --git a/dom/bindings/SimpleGlobalObject.cpp b/dom/bindings/SimpleGlobalObject.cpp
index 6ac3970197..88710f7d95 100644
--- a/dom/bindings/SimpleGlobalObject.cpp
+++ b/dom/bindings/SimpleGlobalObject.cpp
@@ -29,8 +29,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SimpleGlobalObject)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(SimpleGlobalObject)
-
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
tmp->TraverseHostObjectURIs(cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/bindings/moz.build b/dom/bindings/moz.build
index f1ce9e2769..7e1358e9c4 100644
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -32,10 +32,10 @@ EXPORTS.mozilla.dom += [
'FakeString.h',
'IterableIterator.h',
'JSSlots.h',
- 'MozMap.h',
'NonRefcountedDOMObject.h',
'Nullable.h',
'PrimitiveConversions.h',
+ 'Record.h',
'RootedDictionary.h',
'SimpleGlobalObject.h',
'StructuredClone.h',
diff --git a/dom/bindings/parser/WebIDL.py b/dom/bindings/parser/WebIDL.py
index f668d7d622..8c32a87388 100644
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -1867,7 +1867,7 @@ class IDLDictionary(IDLObjectWithScope):
if (memberType.nullable() or
memberType.isSequence() or
- memberType.isMozMap()):
+ memberType.isRecord()):
return typeContainsDictionary(memberType.inner, dictionary)
if memberType.isDictionary():
@@ -1988,7 +1988,7 @@ class IDLType(IDLObject):
'callback',
'union',
'sequence',
- 'mozmap'
+ 'record'
)
def __init__(self, location, name):
@@ -2038,7 +2038,7 @@ class IDLType(IDLObject):
def isSequence(self):
return False
- def isMozMap(self):
+ def isRecord(self):
return False
def isArrayBuffer(self):
@@ -2263,8 +2263,8 @@ class IDLNullableType(IDLParameterizedType):
def isSequence(self):
return self.inner.isSequence()
- def isMozMap(self):
- return self.inner.isMozMap()
+ def isRecord(self):
+ return self.inner.isRecord()
def isArrayBuffer(self):
return self.inner.isArrayBuffer()
@@ -2321,8 +2321,10 @@ class IDLNullableType(IDLParameterizedType):
return self
def isDistinguishableFrom(self, other):
- if (other.nullable() or (other.isUnion() and other.hasNullableType) or
- other.isDictionary()):
+ if (other.nullable() or
+ other.isDictionary() or
+ (other.isUnion() and
+ (other.hasNullableType or other.hasDictionaryType()))):
# Can't tell which type null should become
return False
return self.inner.isDistinguishableFrom(other)
@@ -2397,34 +2399,38 @@ class IDLSequenceType(IDLParameterizedType):
return (other.isPrimitive() or other.isString() or other.isEnum() or
other.isDate() or other.isInterface() or
other.isDictionary() or
- other.isCallback() or other.isMozMap())
+ other.isCallback() or other.isRecord())
-class IDLMozMapType(IDLParameterizedType):
- def __init__(self, location, parameterType):
- assert not parameterType.isVoid()
+class IDLRecordType(IDLParameterizedType):
+ def __init__(self, location, keyType, valueType):
+ assert keyType.isString()
+ assert keyType.isComplete()
+ assert not valueType.isVoid()
+
+ IDLParameterizedType.__init__(self, location, valueType.name, valueType)
+ self.keyType = keyType
- IDLParameterizedType.__init__(self, location, parameterType.name, parameterType)
# Need to set self.name up front if our inner type is already complete,
# since in that case our .complete() won't be called.
if self.inner.isComplete():
- self.name = self.inner.name + "MozMap"
+ self.name = self.keyType.name + self.inner.name + "Record"
def __eq__(self, other):
- return isinstance(other, IDLMozMapType) and self.inner == other.inner
+ return isinstance(other, IDLRecordType) and self.inner == other.inner
def __str__(self):
- return self.inner.__str__() + "MozMap"
+ return self.keyType.__str__() + self.inner.__str__() + "Record"
- def isMozMap(self):
+ def isRecord(self):
return True
def tag(self):
- return IDLType.Tags.mozmap
+ return IDLType.Tags.record
def complete(self, scope):
self.inner = self.inner.complete(scope)
- self.name = self.inner.name + "MozMap"
+ self.name = self.keyType.name + self.inner.name + "Record"
return self
def unroll(self):
@@ -2614,8 +2620,8 @@ class IDLTypedefType(IDLType):
def isSequence(self):
return self.inner.isSequence()
- def isMozMap(self):
- return self.inner.isMozMap()
+ def isRecord(self):
+ return self.inner.isRecord()
def isDictionary(self):
return self.inner.isDictionary()
@@ -2798,7 +2804,7 @@ class IDLWrapperType(IDLType):
if self.isEnum():
return (other.isPrimitive() or other.isInterface() or other.isObject() or
other.isCallback() or other.isDictionary() or
- other.isSequence() or other.isMozMap() or other.isDate())
+ other.isSequence() or other.isRecord() or other.isDate())
if self.isDictionary() and other.nullable():
return False
if (other.isPrimitive() or other.isString() or other.isEnum() or
@@ -2820,7 +2826,7 @@ class IDLWrapperType(IDLType):
(self.isNonCallbackInterface() or
other.isNonCallbackInterface()))
if (other.isDictionary() or other.isCallback() or
- other.isMozMap()):
+ other.isRecord()):
return self.isNonCallbackInterface()
# Not much else |other| can be
@@ -3030,17 +3036,17 @@ class IDLBuiltinType(IDLType):
return (other.isNumeric() or other.isString() or other.isEnum() or
other.isInterface() or other.isObject() or
other.isCallback() or other.isDictionary() or
- other.isSequence() or other.isMozMap() or other.isDate())
+ other.isSequence() or other.isRecord() or other.isDate())
if self.isNumeric():
return (other.isBoolean() or other.isString() or other.isEnum() or
other.isInterface() or other.isObject() or
other.isCallback() or other.isDictionary() or
- other.isSequence() or other.isMozMap() or other.isDate())
+ other.isSequence() or other.isRecord() or other.isDate())
if self.isString():
return (other.isPrimitive() or other.isInterface() or
other.isObject() or
other.isCallback() or other.isDictionary() or
- other.isSequence() or other.isMozMap() or other.isDate())
+ other.isSequence() or other.isRecord() or other.isDate())
if self.isAny():
# Can't tell "any" apart from anything
return False
@@ -3050,7 +3056,7 @@ class IDLBuiltinType(IDLType):
return (other.isPrimitive() or other.isString() or other.isEnum() or
other.isInterface() or other.isCallback() or
other.isDictionary() or other.isSequence() or
- other.isMozMap())
+ other.isRecord())
if self.isVoid():
return not other.isVoid()
# Not much else we could be!
@@ -3058,7 +3064,7 @@ class IDLBuiltinType(IDLType):
# Like interfaces, but we know we're not a callback
return (other.isPrimitive() or other.isString() or other.isEnum() or
other.isCallback() or other.isDictionary() or
- other.isSequence() or other.isMozMap() or other.isDate() or
+ other.isSequence() or other.isRecord() or other.isDate() or
(other.isInterface() and (
# ArrayBuffer is distinguishable from everything
# that's not an ArrayBuffer or a callback interface
@@ -3843,6 +3849,9 @@ class IDLConst(IDLInterfaceMember):
if type.isDictionary():
raise WebIDLError("A constant cannot be of a dictionary type",
[self.location])
+ if type.isRecord():
+ raise WebIDLError("A constant cannot be of a record type",
+ [self.location])
self.type = type
self.value = value
@@ -3954,8 +3963,8 @@ class IDLAttribute(IDLInterfaceMember):
if self.type.isSequence() and not self.getExtendedAttribute("Cached"):
raise WebIDLError("A non-cached attribute cannot be of a sequence "
"type", [self.location])
- if self.type.isMozMap() and not self.getExtendedAttribute("Cached"):
- raise WebIDLError("A non-cached attribute cannot be of a MozMap "
+ if self.type.isRecord() and not self.getExtendedAttribute("Cached"):
+ raise WebIDLError("A non-cached attribute cannot be of a record "
"type", [self.location])
if self.type.isUnion():
for f in self.type.unroll().flatMemberTypes:
@@ -3971,11 +3980,11 @@ class IDLAttribute(IDLInterfaceMember):
"one of its member types's member "
"types, and so on) is a sequence "
"type", [self.location, f.location])
- if f.isMozMap():
+ if f.isRecord():
raise WebIDLError("An attribute cannot be of a union "
"type if one of its member types (or "
"one of its member types's member "
- "types, and so on) is a MozMap "
+ "types, and so on) is a record "
"type", [self.location, f.location])
if not self.type.isInterface() and self.getExtendedAttribute("PutForwards"):
raise WebIDLError("An attribute with [PutForwards] must have an "
@@ -3989,7 +3998,7 @@ class IDLAttribute(IDLInterfaceMember):
def typeContainsChromeOnlyDictionaryMember(type):
if (type.nullable() or
type.isSequence() or
- type.isMozMap()):
+ type.isRecord()):
return typeContainsChromeOnlyDictionaryMember(type.inner)
if type.isUnion():
@@ -4035,10 +4044,10 @@ class IDLAttribute(IDLInterfaceMember):
[self.location, location])
if self.getExtendedAttribute("Frozen"):
if (not self.type.isSequence() and not self.type.isDictionary() and
- not self.type.isMozMap()):
+ not self.type.isRecord()):
raise WebIDLError("[Frozen] is only allowed on "
"sequence-valued, dictionary-valued, and "
- "MozMap-valued attributes",
+ "record-valued attributes",
[self.location])
if not self.type.unroll().isExposedInAllOf(self.exposureSet):
raise WebIDLError("Attribute returns a type that is not exposed "
@@ -5147,7 +5156,7 @@ class Tokenizer(object):
"Promise": "PROMISE",
"required": "REQUIRED",
"sequence": "SEQUENCE",
- "MozMap": "MOZMAP",
+ "record": "RECORD",
"short": "SHORT",
"unsigned": "UNSIGNED",
"void": "VOID",
@@ -6276,7 +6285,7 @@ class Parser(Tokenizer):
| OCTET
| OPTIONAL
| SEQUENCE
- | MOZMAP
+ | RECORD
| SETTER
| SHORT
| STATIC
@@ -6355,7 +6364,7 @@ class Parser(Tokenizer):
def p_NonAnyType(self, p):
"""
- NonAnyType : PrimitiveOrStringType Null
+ NonAnyType : PrimitiveType Null
| ARRAYBUFFER Null
| SHAREDARRAYBUFFER Null
| OBJECT Null
@@ -6371,6 +6380,12 @@ class Parser(Tokenizer):
p[0] = self.handleNullable(type, p[2])
+ def p_NonAnyTypeStringType(self, p):
+ """
+ NonAnyType : StringType Null
+ """
+ p[0] = self.handleNullable(p[1], p[2])
+
def p_NonAnyTypeSequenceType(self, p):
"""
NonAnyType : SEQUENCE LT Type GT Null
@@ -6391,13 +6406,14 @@ class Parser(Tokenizer):
type = IDLUnresolvedType(self.getLocation(p, 1), promiseIdent, p[3])
p[0] = self.handleNullable(type, p[5])
- def p_NonAnyTypeMozMapType(self, p):
+ def p_NonAnyTypeRecordType(self, p):
"""
- NonAnyType : MOZMAP LT Type GT Null
+ NonAnyType : RECORD LT StringType COMMA Type GT Null
"""
- innerType = p[3]
- type = IDLMozMapType(self.getLocation(p, 1), innerType)
- p[0] = self.handleNullable(type, p[5])
+ keyType = p[3]
+ valueType = p[5]
+ type = IDLRecordType(self.getLocation(p, 1), keyType, valueType)
+ p[0] = self.handleNullable(type, p[7])
def p_NonAnyTypeScopedName(self, p):
"""
@@ -6440,7 +6456,7 @@ class Parser(Tokenizer):
def p_ConstType(self, p):
"""
- ConstType : PrimitiveOrStringType Null
+ ConstType : PrimitiveType Null
"""
type = BuiltinTypes[p[1]]
p[0] = self.handleNullable(type, p[2])
@@ -6454,69 +6470,75 @@ class Parser(Tokenizer):
type = IDLUnresolvedType(self.getLocation(p, 1), identifier)
p[0] = self.handleNullable(type, p[2])
- def p_PrimitiveOrStringTypeUint(self, p):
+ def p_PrimitiveTypeUint(self, p):
"""
- PrimitiveOrStringType : UnsignedIntegerType
+ PrimitiveType : UnsignedIntegerType
"""
p[0] = p[1]
- def p_PrimitiveOrStringTypeBoolean(self, p):
+ def p_PrimitiveTypeBoolean(self, p):
"""
- PrimitiveOrStringType : BOOLEAN
+ PrimitiveType : BOOLEAN
"""
p[0] = IDLBuiltinType.Types.boolean
- def p_PrimitiveOrStringTypeByte(self, p):
+ def p_PrimitiveTypeByte(self, p):
"""
- PrimitiveOrStringType : BYTE
+ PrimitiveType : BYTE
"""
p[0] = IDLBuiltinType.Types.byte
- def p_PrimitiveOrStringTypeOctet(self, p):
+ def p_PrimitiveTypeOctet(self, p):
"""
- PrimitiveOrStringType : OCTET
+ PrimitiveType : OCTET
"""
p[0] = IDLBuiltinType.Types.octet
- def p_PrimitiveOrStringTypeFloat(self, p):
+ def p_PrimitiveTypeFloat(self, p):
"""
- PrimitiveOrStringType : FLOAT
+ PrimitiveType : FLOAT
"""
p[0] = IDLBuiltinType.Types.float
- def p_PrimitiveOrStringTypeUnrestictedFloat(self, p):
+ def p_PrimitiveTypeUnrestictedFloat(self, p):
"""
- PrimitiveOrStringType : UNRESTRICTED FLOAT
+ PrimitiveType : UNRESTRICTED FLOAT
"""
p[0] = IDLBuiltinType.Types.unrestricted_float
- def p_PrimitiveOrStringTypeDouble(self, p):
+ def p_PrimitiveTypeDouble(self, p):
"""
- PrimitiveOrStringType : DOUBLE
+ PrimitiveType : DOUBLE
"""
p[0] = IDLBuiltinType.Types.double
- def p_PrimitiveOrStringTypeUnrestictedDouble(self, p):
+ def p_PrimitiveTypeUnrestictedDouble(self, p):
"""
- PrimitiveOrStringType : UNRESTRICTED DOUBLE
+ PrimitiveType : UNRESTRICTED DOUBLE
"""
p[0] = IDLBuiltinType.Types.unrestricted_double
- def p_PrimitiveOrStringTypeDOMString(self, p):
+ def p_StringType(self, p):
+ """
+ StringType : BuiltinStringType
+ """
+ p[0] = BuiltinTypes[p[1]]
+
+ def p_BuiltinStringTypeDOMString(self, p):
"""
- PrimitiveOrStringType : DOMSTRING
+ BuiltinStringType : DOMSTRING
"""
p[0] = IDLBuiltinType.Types.domstring
- def p_PrimitiveOrStringTypeBytestring(self, p):
+ def p_BuiltinStringTypeBytestring(self, p):
"""
- PrimitiveOrStringType : BYTESTRING
+ BuiltinStringType : BYTESTRING
"""
p[0] = IDLBuiltinType.Types.bytestring
- def p_PrimitiveOrStringTypeUSVString(self, p):
+ def p_BuiltinStringTypeUSVString(self, p):
"""
- PrimitiveOrStringType : USVSTRING
+ BuiltinStringType : USVSTRING
"""
p[0] = IDLBuiltinType.Types.usvstring
diff --git a/dom/browser-element/BrowserElementParent.js b/dom/browser-element/BrowserElementParent.js
index 67d05f0abe..8e4475bfaf 100644
--- a/dom/browser-element/BrowserElementParent.js
+++ b/dom/browser-element/BrowserElementParent.js
@@ -23,15 +23,6 @@ function debug(msg) {
//dump("BrowserElementParent - " + msg + "\n");
}
-function getIntPref(prefName, def) {
- try {
- return Services.prefs.getIntPref(prefName);
- }
- catch(err) {
- return def;
- }
-}
-
function handleWindowEvent(e) {
if (this._browserElementParents) {
let beps = ThreadSafeChromeUtils.nondeterministicGetWeakMapKeys(this._browserElementParents);
@@ -856,8 +847,8 @@ BrowserElementParent.prototype = {
*/
zoom: defineNoReturnMethod(function(zoom) {
zoom *= 100;
- zoom = Math.min(getIntPref("zoom.maxPercent", 300), zoom);
- zoom = Math.max(getIntPref("zoom.minPercent", 50), zoom);
+ zoom = Math.min(Services.prefs.getIntPref("zoom.maxPercent", 300), zoom);
+ zoom = Math.max(Services.prefs.getIntPref("zoom.minPercent", 50), zoom);
this._sendAsyncMsg('zoom', {zoom: zoom / 100.0});
}),
diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp
index e3406fc021..4849fda57e 100644
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1047,7 +1047,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CanvasRenderingContext2D)
ImplCycleCollectionTraverse(cb, info.mElement, "Hit region fallback element");
}
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(CanvasRenderingContext2D)
@@ -1106,6 +1105,7 @@ CanvasRenderingContext2D::CanvasRenderingContext2D(layers::LayersBackend aCompos
, mIsCapturedFrameInvalid(false)
, mPathTransformWillUpdate(false)
, mInvalidateCount(0)
+ , mWriteOnly(false) // == !origin-clean
{
sNumLivingContexts++;
@@ -2563,7 +2563,8 @@ CanvasRenderingContext2D::CreatePattern(const CanvasImageSource& aSource,
// nullptr and set CORSUsed to true for passing the security check in
// CanvasUtils::DoDrawImageSecurityCheck().
RefPtr<CanvasPattern> pat =
- new CanvasPattern(this, srcSurf, repeatMode, nullptr, false, true);
+ new CanvasPattern(this, srcSurf, repeatMode, nullptr,
+ imgBitmap.IsWriteOnly(), true);
return pat.forget();
}
@@ -4953,6 +4954,10 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
aError.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
+
+ if (canvas->IsWriteOnly()) {
+ SetWriteOnly();
+ }
} else if (aImage.IsImageBitmap()) {
ImageBitmap& imageBitmap = aImage.GetAsImageBitmap();
srcSurf = imageBitmap.PrepareForDrawTarget(mTarget);
@@ -4961,6 +4966,10 @@ CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
return;
}
+ if (imageBitmap.IsWriteOnly()) {
+ SetWriteOnly();
+ }
+
imgSize = gfx::IntSize(imageBitmap.Width(), imageBitmap.Height());
}
else {
@@ -5675,9 +5684,8 @@ CanvasRenderingContext2D::GetImageData(JSContext* aCx, double aSx,
// Check only if we have a canvas element; if we were created with a docshell,
// then it's special internal use.
- if (mCanvasElement && mCanvasElement->IsWriteOnly() &&
- !nsContentUtils::IsCallerChrome())
- {
+ if (IsWriteOnly() ||
+ (mCanvasElement && mCanvasElement->IsWriteOnly() && !nsContentUtils::IsCallerChrome())) {
// XXX ERRMSG we need to report an error to developers here! (bug 329026)
aError.Throw(NS_ERROR_DOM_SECURITY_ERR);
return nullptr;
@@ -6321,6 +6329,13 @@ CanvasRenderingContext2D::ShouldForceInactiveLayer(LayerManager* aManager)
return !aManager->CanUseCanvasLayerForSize(GetSize());
}
+void CanvasRenderingContext2D::SetWriteOnly() {
+ mWriteOnly = true;
+ if (mCanvasElement) {
+ mCanvasElement->SetWriteOnly();
+ }
+}
+
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(CanvasPath, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(CanvasPath, Release)
diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h
index 848b3ee083..d4f295a03f 100644
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -40,6 +40,7 @@ class SourceSurface;
namespace dom {
class HTMLImageElementOrSVGImageElementOrHTMLCanvasElementOrHTMLVideoElementOrImageBitmap;
typedef HTMLImageElementOrSVGImageElementOrHTMLCanvasElementOrHTMLVideoElementOrImageBitmap CanvasImageSource;
+class ImageBitmap;
class ImageData;
class StringOrCanvasGradientOrCanvasPattern;
class OwningStringOrCanvasGradientOrCanvasPattern;
@@ -1151,6 +1152,17 @@ protected:
friend struct CanvasBidiProcessor;
friend class CanvasDrawObserver;
+ friend class ImageBitmap;
+
+ // For the origin-clean algorithm (mWriteOnly == !origin-clean)
+ // See https://html.spec.whatwg.org/multipage/imagebitmap-and-animations.html
+ void SetWriteOnly();
+
+ bool IsWriteOnly() const {
+ return mWriteOnly;
+ }
+
+ bool mWriteOnly;
};
} // namespace dom
diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp
index e45cdfc6f9..6efe1b318b 100644
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -351,29 +351,27 @@ CheckSecurityForHTMLElements(const nsLayoutUtils::SurfaceFromElementResult& aRes
*/
template<class HTMLElementType>
static already_AddRefed<SourceSurface>
-GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement, ErrorResult& aRv)
+GetSurfaceFromElement(nsIGlobalObject* aGlobal, HTMLElementType& aElement,
+ bool* aWriteOnly, ErrorResult& aRv)
{
nsLayoutUtils::SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromElement(&aElement, nsLayoutUtils::SFE_WANT_FIRST_FRAME);
- // check origin-clean
- if (!CheckSecurityForHTMLElements(res)) {
- aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
- return nullptr;
- }
-
RefPtr<SourceSurface> surface = res.GetSourceSurface();
if (NS_WARN_IF(!surface)) {
- aRv.Throw(NS_ERROR_NOT_AVAILABLE);
+ aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
+
+ // Check origin-clean and pass back
+ *aWriteOnly = !CheckSecurityForHTMLElements(res);
return surface.forget();
}
/*
- * The specification doesn't allow to create an ImegeBitmap from a vector image.
+ * The specification doesn't allow to create an ImageBitmap from a vector image.
* This function is used to check if the given HTMLImageElement contains a
* raster image.
*/
@@ -398,7 +396,7 @@ HasRasterImage(HTMLImageElement& aImageEl)
}
ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
- bool aIsPremultipliedAlpha /* = true */)
+ bool aWriteOnly, bool aIsPremultipliedAlpha /* = true */)
: mParent(aGlobal)
, mData(aData)
, mSurface(nullptr)
@@ -406,6 +404,7 @@ ImageBitmap::ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
, mPictureRect(0, 0, aData->GetSize().width, aData->GetSize().height)
, mIsPremultipliedAlpha(aIsPremultipliedAlpha)
, mIsCroppingAreaOutSideOfSourceImage(false)
+ , mWriteOnly(aWriteOnly)
{
MOZ_ASSERT(aData, "aData is null in ImageBitmap constructor.");
}
@@ -698,6 +697,7 @@ ImageBitmap::ToCloneData() const
RefPtr<SourceSurface> surface = mData->GetAsSourceSurface();
result->mSurface = surface->GetDataSurface();
MOZ_ASSERT(result->mSurface);
+ result->mWriteOnly = mWriteOnly;
return Move(result);
}
@@ -708,7 +708,7 @@ ImageBitmap::CreateFromCloneData(nsIGlobalObject* aGlobal,
{
RefPtr<layers::Image> data = CreateImageFromSurface(aData->mSurface);
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data,
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, aData->mWriteOnly,
aData->mIsPremultipliedAlpha);
ret->mIsCroppingAreaOutSideOfSourceImage =
@@ -724,11 +724,8 @@ ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal,
OffscreenCanvas& aOffscreenCanvas,
ErrorResult& aRv)
{
- // Check origin-clean.
- if (aOffscreenCanvas.IsWriteOnly()) {
- aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
- return nullptr;
- }
+ // Check origin-clean
+ bool writeOnly = aOffscreenCanvas.IsWriteOnly();
nsLayoutUtils::SurfaceFromElementResult res =
nsLayoutUtils::SurfaceFromOffscreenCanvas(&aOffscreenCanvas,
@@ -744,7 +741,7 @@ ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal,
RefPtr<layers::Image> data =
CreateImageFromSurface(surface);
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
return ret.forget();
}
@@ -757,16 +754,19 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLImageElement& aImageEl
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
-
+
// Check if the image element is a bitmap (e.g. it's a vector graphic) or not.
if (!HasRasterImage(aImageEl)) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return nullptr;
}
+ bool writeOnly = true;
+
// Get the SourceSurface out from the image element and then do security
// checking.
- RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aImageEl, aRv);
+ RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aImageEl,
+ &writeOnly, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
@@ -780,7 +780,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLImageElement& aImageEl
return nullptr;
}
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
@@ -812,13 +812,13 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl
return nullptr;
}
+ bool writeOnly = true;
+
// Check security.
nsCOMPtr<nsIPrincipal> principal = aVideoEl.GetCurrentVideoPrincipal();
bool CORSUsed = aVideoEl.GetCORSMode() != CORS_NONE;
- if (!CheckSecurityForHTMLElements(false, CORSUsed, principal)) {
- aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
- return nullptr;
- }
+
+ writeOnly = !CheckSecurityForHTMLElements(false, CORSUsed, principal);
// Create ImageBitmap.
ImageContainer *container = aVideoEl.GetImageContainer();
@@ -834,7 +834,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLVideoElement& aVideoEl
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return nullptr;
}
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
@@ -856,12 +856,18 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
return nullptr;
}
- RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aCanvasEl, aRv);
+ bool writeOnly = true;
+
+ RefPtr<SourceSurface> surface = GetSurfaceFromElement(aGlobal, aCanvasEl, &writeOnly, aRv);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
+ if (!writeOnly) {
+ writeOnly = aCanvasEl.IsWriteOnly();
+ }
+
// Crop the source surface if needed.
RefPtr<SourceSurface> croppedSurface;
IntRect cropRect = aCropRect.valueOr(IntRect());
@@ -874,8 +880,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
aCropRect.isSome()) {
// The _surface_ must be a DataSourceSurface.
MOZ_ASSERT(surface->GetType() == SurfaceType::DATA,
- "The snapshot SourceSurface from WebGL rendering contest is not \
- DataSourceSurface.");
+ "The snapshot SourceSurface from WebGL rendering contest is not DataSourceSurface.");
RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface();
croppedSurface = CropAndCopyDataSourceSurface(dataSurface, cropRect);
cropRect.MoveTo(0, 0);
@@ -897,7 +902,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
return nullptr;
}
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
@@ -958,9 +963,12 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
return nullptr;
}
- // Create an ImageBimtap.
+ // Create an ImageBitmap.
// ImageData's underlying data is not alpha-premultiplied.
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, false);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal,
+ data,
+ false /* write-only */,
+ false /* alpha-premult */);
// The cropping information has been handled in the CreateImageFromRawData()
// function.
@@ -975,11 +983,8 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D& aCanvasCtx,
const Maybe<IntRect>& aCropRect, ErrorResult& aRv)
{
- // Check origin-clean.
- if (aCanvasCtx.GetCanvas()->IsWriteOnly()) {
- aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
- return nullptr;
- }
+ // Check origin-clean
+ bool writeOnly = aCanvasCtx.GetCanvas()->IsWriteOnly() || aCanvasCtx.IsWriteOnly();
RefPtr<SourceSurface> surface = aCanvasCtx.GetSurfaceSnapshot();
@@ -1001,7 +1006,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D&
return nullptr;
}
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, writeOnly);
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
@@ -1024,7 +1029,10 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageBitmap& aImageBitmap,
}
RefPtr<layers::Image> data = aImageBitmap.mData;
- RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, aImageBitmap.mIsPremultipliedAlpha);
+ RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal,
+ data,
+ aImageBitmap.mWriteOnly,
+ aImageBitmap.mIsPremultipliedAlpha);
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
@@ -1295,7 +1303,7 @@ private:
}
// Create ImageBitmap object.
- RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data);
+ RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data, false /* write-only */);
// Set mIsCroppingAreaOutSideOfSourceImage.
imageBitmap->SetIsCroppingAreaOutSideOfSourceImage(sourceSize, originalCropRect);
@@ -1391,7 +1399,7 @@ private:
}
// Create ImageBitmap object.
- RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data);
+ RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(mGlobalObject, data, false /* write-only */);
// Set mIsCroppingAreaOutSideOfSourceImage.
imageBitmap->SetIsCroppingAreaOutSideOfSourceImage(sourceSize, originalCropRect);
@@ -1486,14 +1494,19 @@ ImageBitmap::ReadStructuredClone(JSContext* aCx,
uint32_t picRectHeight_;
uint32_t isPremultipliedAlpha_;
uint32_t isCroppingAreaOutSideOfSourceImage_;
+ uint32_t writeOnly;
+ uint32_t dummy;
if (!JS_ReadUint32Pair(aReader, &picRectX_, &picRectY_) ||
!JS_ReadUint32Pair(aReader, &picRectWidth_, &picRectHeight_) ||
!JS_ReadUint32Pair(aReader, &isPremultipliedAlpha_,
- &isCroppingAreaOutSideOfSourceImage_)) {
+ &isCroppingAreaOutSideOfSourceImage_) ||
+ !JS_ReadUint32Pair(aReader, &writeOnly, &dummy)) {
return nullptr;
}
+ MOZ_ASSERT(dummy == 0);
+
int32_t picRectX = BitwiseCast<int32_t>(picRectX_);
int32_t picRectY = BitwiseCast<int32_t>(picRectY_);
int32_t picRectWidth = BitwiseCast<int32_t>(picRectWidth_);
@@ -1512,7 +1525,7 @@ ImageBitmap::ReadStructuredClone(JSContext* aCx,
{
RefPtr<layers::Image> img = CreateImageFromSurface(aClonedSurfaces[aIndex]);
RefPtr<ImageBitmap> imageBitmap =
- new ImageBitmap(aParent, img, isPremultipliedAlpha_);
+ new ImageBitmap(aParent, img, !!writeOnly, isPremultipliedAlpha_);
imageBitmap->mIsCroppingAreaOutSideOfSourceImage =
isCroppingAreaOutSideOfSourceImage_;
@@ -1547,6 +1560,7 @@ ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter,
const uint32_t picRectHeight = BitwiseCast<uint32_t>(aImageBitmap->mPictureRect.height);
const uint32_t isPremultipliedAlpha = aImageBitmap->mIsPremultipliedAlpha ? 1 : 0;
const uint32_t isCroppingAreaOutSideOfSourceImage = aImageBitmap->mIsCroppingAreaOutSideOfSourceImage ? 1 : 0;
+ const uint32_t isWriteOnly = aImageBitmap->mWriteOnly ? 1 : 0;
// Indexing the cloned surfaces and send the index to the receiver.
uint32_t index = aClonedSurfaces.Length();
@@ -1555,7 +1569,8 @@ ImageBitmap::WriteStructuredClone(JSStructuredCloneWriter* aWriter,
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, picRectX, picRectY)) ||
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, picRectWidth, picRectHeight)) ||
NS_WARN_IF(!JS_WriteUint32Pair(aWriter, isPremultipliedAlpha,
- isCroppingAreaOutSideOfSourceImage))) {
+ isCroppingAreaOutSideOfSourceImage)) ||
+ NS_WARN_IF(!JS_WriteUint32Pair(aWriter, isWriteOnly, 0))) {
return false;
}
diff --git a/dom/canvas/ImageBitmap.h b/dom/canvas/ImageBitmap.h
index 2119c6bda5..25084b6ac5 100644
--- a/dom/canvas/ImageBitmap.h
+++ b/dom/canvas/ImageBitmap.h
@@ -65,6 +65,7 @@ struct ImageBitmapCloneData final
gfx::IntRect mPictureRect;
bool mIsPremultipliedAlpha;
bool mIsCroppingAreaOutSideOfSourceImage;
+ bool mWriteOnly;
};
/*
@@ -161,6 +162,10 @@ public:
template<typename T>
friend class MapDataIntoBufferSource;
+ bool IsWriteOnly() const {
+ return mWriteOnly;
+ }
+
// Mozilla Extensions
ImageBitmapFormat
FindOptimalFormat(const Optional<Sequence<ImageBitmapFormat>>& aPossibleFormats,
@@ -197,6 +202,7 @@ protected:
* CreateInternal(from ImageData) method.
*/
ImageBitmap(nsIGlobalObject* aGlobal, layers::Image* aData,
+ bool aWriteOnly,
bool aIsPremultipliedAlpha = true);
virtual ~ImageBitmap();
@@ -280,6 +286,12 @@ protected:
*/
bool mIsCroppingAreaOutSideOfSourceImage;
+ /*
+ * Write-Only flag is set to true if this image has been generated from a
+ * cross-origin source. This is the opposite of what is called 'origin-clean'
+ * in the spec.
+ */
+ bool mWriteOnly;
};
} // namespace dom
diff --git a/dom/canvas/ImageBitmapRenderingContext.cpp b/dom/canvas/ImageBitmapRenderingContext.cpp
index 8f50745542..ad313906a3 100644
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -63,6 +63,11 @@ ImageBitmapRenderingContext::TransferFromImageBitmap(ImageBitmap& aImageBitmap)
if (!mImage) {
return;
}
+
+ // Check if ImageBitmap is tainted, and if so flag the canvas tainted too.
+ if (aImageBitmap.IsWriteOnly() && mCanvasElement) {
+ mCanvasElement->SetWriteOnly();
+ }
Redraw(gfxRect(0, 0, mWidth, mHeight));
}
diff --git a/dom/canvas/ImageData.cpp b/dom/canvas/ImageData.cpp
index b201fa2791..d24fbca950 100644
--- a/dom/canvas/ImageData.cpp
+++ b/dom/canvas/ImageData.cpp
@@ -29,7 +29,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ImageData)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(ImageData)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(ImageData)
diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h
index 3ec307b001..8a20237ffa 100644
--- a/dom/canvas/WebGLContext.h
+++ b/dom/canvas/WebGLContext.h
@@ -275,8 +275,9 @@ struct TexImageSourceAdapter final : public TexImageSource
mPboOffset = pboOffset;
}
- TexImageSourceAdapter(const dom::ImageBitmap* imageBitmap, ErrorResult*) {
+ TexImageSourceAdapter(const dom::ImageBitmap* imageBitmap, ErrorResult* out_error) {
mImageBitmap = imageBitmap;
+ mOut_error = out_error;
}
TexImageSourceAdapter(const dom::ImageData* imageData, ErrorResult*) {
diff --git a/dom/canvas/WebGLTextureUpload.cpp b/dom/canvas/WebGLTextureUpload.cpp
index 612d5889d0..3839b5d5ed 100644
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -12,6 +12,7 @@
#include "GLBlitHelper.h"
#include "GLContext.h"
#include "mozilla/gfx/2D.h"
+#include "mozilla/dom/HTMLCanvasElement.h"
#include "mozilla/dom/HTMLVideoElement.h"
#include "mozilla/dom/ImageBitmap.h"
#include "mozilla/dom/ImageData.h"
@@ -214,9 +215,18 @@ FromPboOffset(WebGLContext* webgl, const char* funcName, TexImageTarget target,
static UniquePtr<webgl::TexUnpackBlob>
FromImageBitmap(WebGLContext* webgl, const char* funcName, TexImageTarget target,
uint32_t width, uint32_t height, uint32_t depth,
- const dom::ImageBitmap& imageBitmap)
+ const dom::ImageBitmap& imageBitmap, ErrorResult* aRv)
{
+ if (imageBitmap.IsWriteOnly()) {
+ aRv->Throw(NS_ERROR_DOM_SECURITY_ERR);
+ return nullptr;
+ }
+
UniquePtr<dom::ImageBitmapCloneData> cloneData = Move(imageBitmap.ToCloneData());
+ if (!cloneData) {
+ return nullptr;
+ }
+
const RefPtr<gfx::DataSourceSurface> surf = cloneData->mSurface;
////
@@ -293,6 +303,14 @@ WebGLContext::FromDomElem(const char* funcName, TexImageTarget target, uint32_t
uint32_t height, uint32_t depth, const dom::Element& elem,
ErrorResult* const out_error)
{
+ if (elem.IsHTMLElement(nsGkAtoms::canvas)) {
+ const dom::HTMLCanvasElement* canvas = static_cast<const dom::HTMLCanvasElement*>(&elem);
+ if (canvas->IsWriteOnly()) {
+ out_error->Throw(NS_ERROR_DOM_SECURITY_ERR);
+ return nullptr;
+ }
+ }
+
uint32_t flags = nsLayoutUtils::SFE_WANT_IMAGE_SURFACE |
nsLayoutUtils::SFE_USE_ELEMENT_SIZE_IF_VECTOR;
@@ -412,7 +430,7 @@ WebGLContext::From(const char* funcName, TexImageTarget target, GLsizei rawWidth
if (src.mImageBitmap) {
return FromImageBitmap(this, funcName, target, width, height, depth,
- *(src.mImageBitmap));
+ *(src.mImageBitmap), src.mOut_error);
}
if (src.mImageData) {
diff --git a/dom/canvas/test/test_imagebitmap.html b/dom/canvas/test/test_imagebitmap.html
index b3d3c08ad4..3b74970ace 100644
--- a/dom/canvas/test/test_imagebitmap.html
+++ b/dom/canvas/test/test_imagebitmap.html
@@ -270,13 +270,22 @@ function testSecurityErrors() {
}
function checkPromiseFailedWithSecurityError(p) {
- return p.then( function(reason) { ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully."); },
- function(reason) { if (reason == "SecurityError: The operation is insecure.") {
- ok(true, reason);
- }
- else {
- ok(false, "Did not get SecurityError with unclean source. Error Message: " + reason);
- }});
+ return p.then(imageBitmap => {
+ ok(!!imageBitmap, "ImageBitmaps are always created");
+ const context = document.createElement("canvas").getContext("2d");
+ context.drawImage(imageBitmap, 0, 0);
+ try {
+ context.getImageData(0, 0, 1, 1);
+ ok(false, "Did not get SecurityError with unclean source. ImageBitmap was created successfully.");
+ } catch (ex) {
+ if (ex == "SecurityError: The operation is insecure.") {
+ ok(true, ex);
+ }
+ else {
+ ok(false, "Did not get SecurityError with unclean source. Error Message: " + ex);
+ }
+ }
+ });
}
return Promise.all([
diff --git a/dom/console/Console.cpp b/dom/console/Console.cpp
index ff5a921673..b174172e01 100755
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -797,7 +797,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Console)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConsoleEventNotifier)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Console)
diff --git a/dom/events/DOMEventTargetHelper.cpp b/dom/events/DOMEventTargetHelper.cpp
index f8a5227d6c..dd9a01d8d2 100644
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -43,7 +43,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(DOMEventTargetHelper, tmp->mRefCnt.get())
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListenerManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp
index 45c72e6629..40a0f42e6c 100644
--- a/dom/events/DataTransfer.cpp
+++ b/dom/events/DataTransfer.cpp
@@ -57,7 +57,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DataTransfer)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mItems)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDragTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDragImage)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(DataTransfer)
diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp
index f33bfa5a88..280e40ad57 100755
--- a/dom/events/Event.cpp
+++ b/dom/events/Event.cpp
@@ -231,7 +231,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Event)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPresContext)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mExplicitOriginalTarget)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/events/JSEventHandler.cpp b/dom/events/JSEventHandler.cpp
index 4b1b333131..b9e7c4d84b 100644
--- a/dom/events/JSEventHandler.cpp
+++ b/dom/events/JSEventHandler.cpp
@@ -63,7 +63,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(JSEventHandler)
NS_IMPL_CYCLE_COLLECTION_DESCRIBE(JSEventHandler, tmp->mRefCnt.get())
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mTypedHandler.Ptr())
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(JSEventHandler)
diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp
index 1791399b7f..6294b0dc5c 100644
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -903,11 +903,7 @@ FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
AutoTArray<InternalHeaders::Entry, 5> headers;
mRequest->Headers()->GetEntries(headers);
- bool hasAccept = false;
for (uint32_t i = 0; i < headers.Length(); ++i) {
- if (!hasAccept && headers[i].mName.EqualsLiteral("accept")) {
- hasAccept = true;
- }
if (headers[i].mValue.IsEmpty()) {
aChannel->SetEmptyRequestHeader(headers[i].mName);
} else {
@@ -915,12 +911,6 @@ FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const
}
}
- if (!hasAccept) {
- aChannel->SetRequestHeader(NS_LITERAL_CSTRING("accept"),
- NS_LITERAL_CSTRING("*/*"),
- false /* merge */);
- }
-
if (mRequest->ForceOriginHeader()) {
nsAutoString origin;
if (NS_SUCCEEDED(nsContentUtils::GetUTFOrigin(mPrincipal, origin))) {
diff --git a/dom/fetch/Headers.cpp b/dom/fetch/Headers.cpp
index 1e1a46c62c..ca5aa57a62 100644
--- a/dom/fetch/Headers.cpp
+++ b/dom/fetch/Headers.cpp
@@ -25,7 +25,7 @@ NS_INTERFACE_MAP_END
// static
already_AddRefed<Headers>
Headers::Constructor(const GlobalObject& aGlobal,
- const Optional<HeadersOrByteStringSequenceSequenceOrByteStringMozMap>& aInit,
+ const Optional<HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord>& aInit,
ErrorResult& aRv)
{
RefPtr<InternalHeaders> ih = new InternalHeaders();
@@ -39,8 +39,8 @@ Headers::Constructor(const GlobalObject& aGlobal,
ih->Fill(*aInit.Value().GetAsHeaders().mInternalHeaders, aRv);
} else if (aInit.Value().IsByteStringSequenceSequence()) {
ih->Fill(aInit.Value().GetAsByteStringSequenceSequence(), aRv);
- } else if (aInit.Value().IsByteStringMozMap()) {
- ih->Fill(aInit.Value().GetAsByteStringMozMap(), aRv);
+ } else if (aInit.Value().IsByteStringByteStringRecord()) {
+ ih->Fill(aInit.Value().GetAsByteStringByteStringRecord(), aRv);
}
if (aRv.Failed()) {
@@ -53,7 +53,7 @@ Headers::Constructor(const GlobalObject& aGlobal,
// static
already_AddRefed<Headers>
Headers::Constructor(const GlobalObject& aGlobal,
- const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+ const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
ErrorResult& aRv)
{
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
@@ -62,7 +62,7 @@ Headers::Constructor(const GlobalObject& aGlobal,
/* static */ already_AddRefed<Headers>
Headers::Create(nsIGlobalObject* aGlobal,
- const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+ const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
ErrorResult& aRv)
{
RefPtr<InternalHeaders> ih = new InternalHeaders();
@@ -72,8 +72,8 @@ Headers::Create(nsIGlobalObject* aGlobal,
ih->Fill(*(aInit.GetAsHeaders().get()->mInternalHeaders), aRv);
} else if (aInit.IsByteStringSequenceSequence()) {
ih->Fill(aInit.GetAsByteStringSequenceSequence(), aRv);
- } else if (aInit.IsByteStringMozMap()) {
- ih->Fill(aInit.GetAsByteStringMozMap(), aRv);
+ } else if (aInit.IsByteStringByteStringRecord()) {
+ ih->Fill(aInit.GetAsByteStringByteStringRecord(), aRv);
}
if (NS_WARN_IF(aRv.Failed())) {
diff --git a/dom/fetch/Headers.h b/dom/fetch/Headers.h
index b603dc836c..1dd92f779f 100644
--- a/dom/fetch/Headers.h
+++ b/dom/fetch/Headers.h
@@ -20,9 +20,9 @@ class ErrorResult;
namespace dom {
-template<typename T> class MozMap;
-class HeadersOrByteStringSequenceSequenceOrByteStringMozMap;
-class OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap;
+template<typename K, typename V> class Record;
+class HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord;
+class OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord;
/**
* This Headers class is only used to represent the content facing Headers
@@ -57,17 +57,17 @@ public:
static already_AddRefed<Headers>
Constructor(const GlobalObject& aGlobal,
- const Optional<HeadersOrByteStringSequenceSequenceOrByteStringMozMap>& aInit,
+ const Optional<HeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord>& aInit,
ErrorResult& aRv);
static already_AddRefed<Headers>
Constructor(const GlobalObject& aGlobal,
- const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+ const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
ErrorResult& aRv);
static already_AddRefed<Headers>
Create(nsIGlobalObject* aGlobalObject,
- const OwningHeadersOrByteStringSequenceSequenceOrByteStringMozMap& aInit,
+ const OwningHeadersOrByteStringSequenceSequenceOrByteStringByteStringRecord& aInit,
ErrorResult& aRv);
void Append(const nsACString& aName, const nsACString& aValue,
diff --git a/dom/fetch/InternalHeaders.cpp b/dom/fetch/InternalHeaders.cpp
index 11585615ea..f66221d42a 100644
--- a/dom/fetch/InternalHeaders.cpp
+++ b/dom/fetch/InternalHeaders.cpp
@@ -314,12 +314,13 @@ InternalHeaders::Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& a
}
void
-InternalHeaders::Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv)
+InternalHeaders::Fill(const Record<nsCString, nsCString>& aInit, ErrorResult& aRv)
{
- nsTArray<nsString> keys;
- aInit.GetKeys(keys);
- for (uint32_t i = 0; i < keys.Length() && !aRv.Failed(); ++i) {
- Append(NS_ConvertUTF16toUTF8(keys[i]), aInit.Get(keys[i]), aRv);
+ for (auto& entry : aInit.Entries()) {
+ Append(entry.mKey, entry.mValue, aRv);
+ if (aRv.Failed()) {
+ return;
+ }
}
}
diff --git a/dom/fetch/InternalHeaders.h b/dom/fetch/InternalHeaders.h
index 9a6d6dae7d..98046f0efe 100644
--- a/dom/fetch/InternalHeaders.h
+++ b/dom/fetch/InternalHeaders.h
@@ -20,7 +20,7 @@ class ErrorResult;
namespace dom {
-template<typename T> class MozMap;
+template<typename K, typename V> class Record;
class HeadersEntry;
class InternalHeaders final
@@ -113,7 +113,7 @@ public:
void Fill(const InternalHeaders& aInit, ErrorResult& aRv);
void Fill(const Sequence<Sequence<nsCString>>& aInit, ErrorResult& aRv);
- void Fill(const MozMap<nsCString>& aInit, ErrorResult& aRv);
+ void Fill(const Record<nsCString, nsCString>& aInit, ErrorResult& aRv);
bool HasOnlySimpleHeaders() const;
diff --git a/dom/filesystem/Directory.cpp b/dom/filesystem/Directory.cpp
index 59c78fb2c3..5e8a4a7453 100644
--- a/dom/filesystem/Directory.cpp
+++ b/dom/filesystem/Directory.cpp
@@ -36,7 +36,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Directory)
tmp->mFileSystem->Traverse(cb);
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Directory)
diff --git a/dom/gamepad/GamepadServiceTest.cpp b/dom/gamepad/GamepadServiceTest.cpp
index a6fde58f01..89429b52a2 100644
--- a/dom/gamepad/GamepadServiceTest.cpp
+++ b/dom/gamepad/GamepadServiceTest.cpp
@@ -35,7 +35,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(GamepadServiceTest)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(GamepadServiceTest,
DOMEventTargetHelper)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp
index 527135a80d..a01795d9eb 100644
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -1000,7 +1000,7 @@ HTMLCanvasElement::GetSize()
}
bool
-HTMLCanvasElement::IsWriteOnly()
+HTMLCanvasElement::IsWriteOnly() const
{
return mWriteOnly;
}
diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h
index 746fab1989..e77db6ff1a 100644
--- a/dom/html/HTMLCanvasElement.h
+++ b/dom/html/HTMLCanvasElement.h
@@ -224,9 +224,9 @@ public:
nsIntSize GetSize();
/**
- * Determine whether the canvas is write-only.
+ * Determine whether the canvas is write-only (tainted).
*/
- bool IsWriteOnly();
+ bool IsWriteOnly() const;
/**
* Force the canvas to be write-only.
diff --git a/dom/html/HTMLFormControlsCollection.cpp b/dom/html/HTMLFormControlsCollection.cpp
index d91a6b5dec..77fafae99c 100644
--- a/dom/html/HTMLFormControlsCollection.cpp
+++ b/dom/html/HTMLFormControlsCollection.cpp
@@ -134,7 +134,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(HTMLFormControlsCollection)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(HTMLFormControlsCollection)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNameLookupTable)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(HTMLFormControlsCollection)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/html/HTMLTableElement.cpp b/dom/html/HTMLTableElement.cpp
index ec1b7cecb7..c5b7696cfd 100644
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -421,11 +421,10 @@ HTMLTableElement::CreateTHead()
void
HTMLTableElement::DeleteTHead()
{
- HTMLTableSectionElement* tHead = GetTHead();
+ RefPtr<HTMLTableSectionElement> tHead = GetTHead();
if (tHead) {
- mozilla::ErrorResult rv;
+ mozilla::IgnoredErrorResult rv;
nsINode::RemoveChild(*tHead, rv);
- MOZ_ASSERT(!rv.Failed());
}
}
@@ -452,11 +451,10 @@ HTMLTableElement::CreateTFoot()
void
HTMLTableElement::DeleteTFoot()
{
- HTMLTableSectionElement* tFoot = GetTFoot();
+ RefPtr<HTMLTableSectionElement> tFoot = GetTFoot();
if (tFoot) {
- mozilla::ErrorResult rv;
+ mozilla::IgnoredErrorResult rv;
nsINode::RemoveChild(*tFoot, rv);
- MOZ_ASSERT(!rv.Failed());
}
}
@@ -483,11 +481,10 @@ HTMLTableElement::CreateCaption()
void
HTMLTableElement::DeleteCaption()
{
- HTMLTableCaptionElement* caption = GetCaption();
+ RefPtr<HTMLTableCaptionElement> caption = GetCaption();
if (caption) {
- mozilla::ErrorResult rv;
+ mozilla::IgnoredErrorResult rv;
nsINode::RemoveChild(*caption, rv);
- MOZ_ASSERT(!rv.Failed());
}
}
diff --git a/dom/html/HTMLTableSectionElement.cpp b/dom/html/HTMLTableSectionElement.cpp
index c7b0665ddc..e99597636e 100644
--- a/dom/html/HTMLTableSectionElement.cpp
+++ b/dom/html/HTMLTableSectionElement.cpp
@@ -122,7 +122,7 @@ HTMLTableSectionElement::DeleteRow(int32_t aValue, ErrorResult& aError)
refIndex = (uint32_t)aValue;
}
- nsINode* row = rows->Item(refIndex);
+ nsCOMPtr<nsINode> row = rows->Item(refIndex);
if (!row) {
aError.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
return;
diff --git a/dom/html/nsDOMStringMap.cpp b/dom/html/nsDOMStringMap.cpp
index 42725bc6f3..6d2bc424d3 100644
--- a/dom/html/nsDOMStringMap.cpp
+++ b/dom/html/nsDOMStringMap.cpp
@@ -19,7 +19,6 @@ using namespace mozilla::dom;
NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMStringMap)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsDOMStringMap)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/html/nsTextEditorState.cpp b/dom/html/nsTextEditorState.cpp
index 0b4cb19206..25be6016c4 100644
--- a/dom/html/nsTextEditorState.cpp
+++ b/dom/html/nsTextEditorState.cpp
@@ -2255,7 +2255,11 @@ nsTextEditorState::UpdatePlaceholderText(bool aNotify)
nsCOMPtr<nsIContent> content = do_QueryInterface(mTextCtrlElement);
content->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder, placeholderValue);
- nsContentUtils::RemoveNewlines(placeholderValue);
+ if (mTextCtrlElement->IsTextArea()) { // <textarea>s preserve newlines...
+ nsContentUtils::PlatformToDOMLineBreaks(placeholderValue);
+ } else { // ...<input>s don't
+ nsContentUtils::RemoveNewlines(placeholderValue);
+ }
NS_ASSERTION(mPlaceholderDiv->GetFirstChild(), "placeholder div has no child");
mPlaceholderDiv->GetFirstChild()->SetText(placeholderValue, aNotify);
}
diff --git a/dom/indexedDB/ActorsChild.cpp b/dom/indexedDB/ActorsChild.cpp
index 3e8f973485..c4fcceb90f 100644
--- a/dom/indexedDB/ActorsChild.cpp
+++ b/dom/indexedDB/ActorsChild.cpp
@@ -3456,6 +3456,8 @@ BackgroundCursorChild::RecvResponse(const CursorResponse& aResponse)
RefPtr<IDBCursor> cursor;
mStrongCursor.swap(cursor);
+
+ RefPtr<IDBTransaction> transaction = mTransaction;
switch (aResponse.type()) {
case CursorResponse::Tnsresult:
@@ -3486,7 +3488,7 @@ BackgroundCursorChild::RecvResponse(const CursorResponse& aResponse)
MOZ_CRASH("Should never get here!");
}
- mTransaction->OnRequestFinished(/* aActorDestroyedNormally */ true);
+ transaction->OnRequestFinished(/* aActorDestroyedNormally */ true);
return true;
}
diff --git a/dom/indexedDB/IDBCursor.cpp b/dom/indexedDB/IDBCursor.cpp
index 7ae35e9811..af88742f0d 100644
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -948,7 +948,6 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_CLASS(IDBCursor)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBCursor)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRequest)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceIndex)
diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp
index 825d2ac36f..c1ef6353d4 100644
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -865,7 +865,6 @@ NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION_CLASS(IDBFactory)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBFactory)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/indexedDB/IDBIndex.cpp b/dom/indexedDB/IDBIndex.cpp
index 657e744c9c..af50926e62 100644
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -652,7 +652,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBIndex)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBIndex)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/indexedDB/IDBKeyRange.cpp b/dom/indexedDB/IDBKeyRange.cpp
index 2de48a70c6..e61c806177 100644
--- a/dom/indexedDB/IDBKeyRange.cpp
+++ b/dom/indexedDB/IDBKeyRange.cpp
@@ -239,7 +239,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBKeyRange)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBKeyRange)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBKeyRange)
diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp
index 8a0b292ade..756792741f 100644
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -1758,7 +1758,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDBObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(IDBObjectStore)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTransaction)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mIndexes)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDeletedIndexes)
diff --git a/dom/indexedDB/IDBRequest.cpp b/dom/indexedDB/IDBRequest.cpp
index 919d3adc76..e0e318059e 100644
--- a/dom/indexedDB/IDBRequest.cpp
+++ b/dom/indexedDB/IDBRequest.cpp
@@ -417,8 +417,6 @@ IDBRequest::GetError(ErrorResult& aRv)
NS_IMPL_CYCLE_COLLECTION_CLASS(IDBRequest)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBRequest, IDBWrapperCache)
- // Don't need NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS because
- // DOMEventTargetHelper does it for us.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceAsObjectStore)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceAsIndex)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSourceAsCursor)
diff --git a/dom/indexedDB/IDBWrapperCache.cpp b/dom/indexedDB/IDBWrapperCache.cpp
index df62514c80..ccc2bb43e1 100644
--- a/dom/indexedDB/IDBWrapperCache.cpp
+++ b/dom/indexedDB/IDBWrapperCache.cpp
@@ -18,8 +18,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(IDBWrapperCache)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(IDBWrapperCache,
DOMEventTargetHelper)
- // Don't need NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS because
- // DOMEventTargetHelper does it for us.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(IDBWrapperCache,
diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h
index f29d17e7f6..4c8f15cc05 100644
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -152,13 +152,13 @@ public:
RecvInitRendering(
Endpoint<PCompositorBridgeChild>&& aCompositor,
Endpoint<PImageBridgeChild>&& aImageBridge,
- Endpoint<PVideoDecoderManagerChild>&& aVideoManager);
+ Endpoint<PVideoDecoderManagerChild>&& aVideoManager) override;
bool
RecvReinitRendering(
Endpoint<PCompositorBridgeChild>&& aCompositor,
Endpoint<PImageBridgeChild>&& aImageBridge,
- Endpoint<PVideoDecoderManagerChild>&& aVideoManager);
+ Endpoint<PVideoDecoderManagerChild>&& aVideoManager) override;
PProcessHangMonitorChild*
AllocPProcessHangMonitorChild(Transport* aTransport,
diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp
index 3fe94001e8..e1355adee0 100644
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -176,7 +176,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TabChildBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTabChildGlobal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWebBrowserChrome)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/locales/en-US/chrome/security/security.properties b/dom/locales/en-US/chrome/security/security.properties
index 8efdb0a6d2..2be56fb9d3 100644
--- a/dom/locales/en-US/chrome/security/security.properties
+++ b/dom/locales/en-US/chrome/security/security.properties
@@ -85,3 +85,5 @@ BlockScriptWithWrongMimeType=Script from “%1$S†was blocked because of a dis
# LOCALIZATION NOTE: Do not translate "data: URI".
BlockTopLevelDataURINavigation=Navigation to toplevel data: URI not allowed (Blocked loading of: “%1$Sâ€)
+
+BlockSubresourceFTP=Loading FTP subresource within http(s) page not allowed (Blocked loading of: “%1$Sâ€)
diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp
index 288f2e74db..979cb64c7a 100644
--- a/dom/media/MediaManager.cpp
+++ b/dom/media/MediaManager.cpp
@@ -2049,6 +2049,16 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
return rv;
}
+ // Disallow access to null principal pages
+ nsCOMPtr<nsIPrincipal> principal = aWindow->GetExtantDoc()->NodePrincipal();
+ if (principal->GetIsNullPrincipal()) {
+ RefPtr<MediaStreamError> error =
+ new MediaStreamError(aWindow,
+ NS_LITERAL_STRING("NotAllowedError"));
+ onFailure->OnError(error);
+ return NS_OK;
+ }
+
if (!Preferences::GetBool("media.navigator.video.enabled", true)) {
c.mVideo.SetAsBoolean() = false;
}
@@ -2188,7 +2198,6 @@ MediaManager::GetUserMedia(nsPIDOMWindowInner* aWindow,
StreamListeners* listeners = AddWindowID(windowID);
// Create a disabled listener to act as a placeholder
- nsIPrincipal* principal = aWindow->GetExtantDoc()->NodePrincipal();
RefPtr<GetUserMediaCallbackMediaStreamListener> listener =
new GetUserMediaCallbackMediaStreamListener(mMediaThread, windowID,
MakePrincipalHandle(principal));
diff --git a/dom/media/VideoFrameContainer.cpp b/dom/media/VideoFrameContainer.cpp
index 2b1965766f..56aea9d274 100644
--- a/dom/media/VideoFrameContainer.cpp
+++ b/dom/media/VideoFrameContainer.cpp
@@ -61,7 +61,7 @@ void VideoFrameContainer::UpdatePrincipalHandleForFrameIDLocked(const PrincipalH
mFrameIDForPendingPrincipalHandle = aFrameID;
}
-static void
+static bool
SetImageToBlackPixel(PlanarYCbCrImage* aImage)
{
uint8_t blackPixel[] = { 0x10, 0x80, 0x80 };
@@ -72,7 +72,7 @@ SetImageToBlackPixel(PlanarYCbCrImage* aImage)
data.mCrChannel = blackPixel + 2;
data.mYStride = data.mCbCrStride = 1;
data.mPicSize = data.mYSize = data.mCbCrSize = gfx::IntSize(1, 1);
- aImage->CopyData(data);
+ return aImage->CopyData(data);
}
class VideoFrameContainerInvalidateRunnable : public Runnable {
@@ -122,11 +122,13 @@ void VideoFrameContainer::SetCurrentFrames(const VideoSegment& aSegment)
if (frame->GetForceBlack()) {
if (!mBlackImage) {
- mBlackImage = GetImageContainer()->CreatePlanarYCbCrImage();
- if (mBlackImage) {
+ RefPtr<Image> blackImage = GetImageContainer()->CreatePlanarYCbCrImage();
+ if (blackImage) {
// Sets the image to a single black pixel, which will be scaled to
// fill the rendered size.
- SetImageToBlackPixel(mBlackImage->AsPlanarYCbCrImage());
+ if (SetImageToBlackPixel(blackImage->AsPlanarYCbCrImage())) {
+ mBlackImage = blackImage;
+ }
}
}
if (mBlackImage) {
diff --git a/dom/media/gmp/widevine-adapter/WidevineAdapter.cpp b/dom/media/gmp/widevine-adapter/WidevineAdapter.cpp
index 74b5c38e85..57d4ecec27 100644
--- a/dom/media/gmp/widevine-adapter/WidevineAdapter.cpp
+++ b/dom/media/gmp/widevine-adapter/WidevineAdapter.cpp
@@ -46,7 +46,7 @@ void* GetCdmHost(int aHostInterfaceVersion, void* aUserData)
Log("GetCdmHostFunc(%d, %p)", aHostInterfaceVersion, aUserData);
WidevineDecryptor* decryptor = reinterpret_cast<WidevineDecryptor*>(aUserData);
MOZ_ASSERT(decryptor);
- return static_cast<cdm::Host_8*>(decryptor);
+ return static_cast<cdm::Host_9*>(decryptor);
}
#define STRINGIFY(s) _STRINGIFY(s)
@@ -106,8 +106,8 @@ WidevineAdapter::GMPGetAPI(const char* aAPIName,
WidevineDecryptor* decryptor = new WidevineDecryptor();
- auto cdm = reinterpret_cast<cdm::ContentDecryptionModule*>(
- create(cdm::ContentDecryptionModule::kVersion,
+ auto cdm = reinterpret_cast<cdm::ContentDecryptionModule_9*>(
+ create(cdm::ContentDecryptionModule_9::kVersion,
kEMEKeySystemWidevine.get(),
kEMEKeySystemWidevine.Length(),
&GetCdmHost,
@@ -161,8 +161,8 @@ WidevineAdapter::Supports(int32_t aModuleVersion,
int32_t aHostVersion)
{
return aModuleVersion == CDM_MODULE_VERSION &&
- aInterfaceVersion == cdm::ContentDecryptionModule::kVersion &&
- aHostVersion == cdm::Host_8::kVersion;
+ aInterfaceVersion == cdm::ContentDecryptionModule_9::kVersion &&
+ aHostVersion == cdm::Host_9::kVersion;
}
} // namespace mozilla
diff --git a/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp b/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
index 149fa1701f..4d3408804f 100644
--- a/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
+++ b/dom/media/gmp/widevine-adapter/WidevineDecryptor.cpp
@@ -102,7 +102,7 @@ WidevineDecryptor::CreateSession(uint32_t aCreateSessionToken,
} else {
// Invalid init data type
const char* errorMsg = "Invalid init data type when creating session.";
- OnRejectPromise(aPromiseId, kNotSupportedError, 0, errorMsg, sizeof(errorMsg));
+ OnRejectPromise(aPromiseId, kExceptionNotSupportedError, 0, errorMsg, sizeof(errorMsg));
return;
}
mPromiseIdToNewSessionTokens[aPromiseId] = aCreateSessionToken;
@@ -302,6 +302,12 @@ WidevineDecryptor::GetCurrentWallTime()
}
void
+WidevineDecryptor::OnResolveKeyStatusPromise(uint32_t aPromiseId,
+ cdm::KeyStatus aKeyStatus) {
+ //TODO: The callback of GetStatusForPolicy. See Mozilla bug 1404230.
+}
+
+void
WidevineDecryptor::OnResolveNewSessionPromise(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdSize)
@@ -333,41 +339,59 @@ WidevineDecryptor::OnResolvePromise(uint32_t aPromiseId)
}
static GMPDOMException
-ToGMPDOMException(cdm::Error aError)
-{
- switch (aError) {
- case kNotSupportedError: return kGMPNotSupportedError;
- case kInvalidStateError: return kGMPInvalidStateError;
- case kInvalidAccessError:
- // Note: Chrome converts kInvalidAccessError to TypeError, since the
- // Chromium CDM API doesn't have a type error enum value. The EME spec
- // requires TypeError in some places, so we do the same conversion.
- // See bug 1313202.
- return kGMPTypeError;
- case kQuotaExceededError: return kGMPQuotaExceededError;
+ConvertCDMExceptionToGMPDOMException(cdm::Exception aException)
+{
+ switch (aException) {
+ case kExceptionNotSupportedError: return kGMPNotSupportedError;
+ case kExceptionInvalidStateError: return kGMPInvalidStateError;
+ case kExceptionTypeError: return kGMPTypeError;
+ case kExceptionQuotaExceededError: return kGMPQuotaExceededError;
case kUnknownError: return kGMPInvalidModificationError; // Note: Unique placeholder.
case kClientError: return kGMPAbortError; // Note: Unique placeholder.
case kOutputError: return kGMPSecurityError; // Note: Unique placeholder.
};
- return kGMPTimeoutError; // Note: Unique placeholder.
+ return kGMPInvalidStateError; // Note: Unique placeholder.
+}
+
+// Align with spec, the Exceptions used by CDM to reject promises .
+// https://w3c.github.io/encrypted-media/#exceptions
+cdm::Exception
+ConvertCDMErrorToCDMException(cdm::Error error) {
+ switch (error) {
+ case cdm::kNotSupportedError:
+ return cdm::Exception::kExceptionNotSupportedError;
+ case cdm::kInvalidStateError:
+ return cdm::Exception::kExceptionInvalidStateError;
+ case cdm::kInvalidAccessError:
+ return cdm::Exception::kExceptionTypeError;
+ case cdm::kQuotaExceededError:
+ return cdm::Exception::kExceptionQuotaExceededError;
+
+ case cdm::kUnknownError:
+ case cdm::kClientError:
+ case cdm::kOutputError:
+ break;
+ }
+
+ return cdm::Exception::kExceptionInvalidStateError;
}
void
WidevineDecryptor::OnRejectPromise(uint32_t aPromiseId,
- Error aError,
+ cdm::Exception aException,
uint32_t aSystemCode,
const char* aErrorMessage,
uint32_t aErrorMessageSize)
{
if (!mCallback) {
Log("Decryptor::OnRejectPromise(aPromiseId=%d, err=%d, sysCode=%u, msg=%s) FAIL; !mCallback",
- aPromiseId, (int)aError, aSystemCode, aErrorMessage);
+ aPromiseId, (int)aException, aSystemCode, aErrorMessage);
return;
}
Log("Decryptor::OnRejectPromise(aPromiseId=%d, err=%d, sysCode=%u, msg=%s)",
- aPromiseId, (int)aError, aSystemCode, aErrorMessage);
+ aPromiseId, (int)aException, aSystemCode, aErrorMessage);
mCallback->RejectPromise(aPromiseId,
- ToGMPDOMException(aError),
+ ConvertCDMExceptionToGMPDOMException(aException),
!aErrorMessageSize ? "" : aErrorMessage,
aErrorMessageSize);
}
@@ -386,11 +410,9 @@ ToGMPMessageType(MessageType message_type)
void
WidevineDecryptor::OnSessionMessage(const char* aSessionId,
uint32_t aSessionIdSize,
- MessageType aMessageType,
+ cdm::MessageType aMessageType,
const char* aMessage,
- uint32_t aMessageSize,
- const char* aLegacyDestinationUrl,
- uint32_t aLegacyDestinationUrlLength)
+ uint32_t aMessageSize)
{
if (!mCallback) {
Log("Decryptor::OnSessionMessage() FAIL; !mCallback");
@@ -479,28 +501,6 @@ WidevineDecryptor::OnSessionClosed(const char* aSessionId,
}
void
-WidevineDecryptor::OnLegacySessionError(const char* aSessionId,
- uint32_t aSessionIdLength,
- Error aError,
- uint32_t aSystemCode,
- const char* aErrorMessage,
- uint32_t aErrorMessageLength)
-{
- if (!mCallback) {
- Log("Decryptor::OnLegacySessionError(sid=%s, error=%d) FAIL; !mCallback",
- aSessionId, (int)aError);
- return;
- }
- Log("Decryptor::OnLegacySessionError(sid=%s, error=%d)", aSessionId, (int)aError);
- mCallback->SessionError(aSessionId,
- aSessionIdLength,
- ToGMPDOMException(aError),
- aSystemCode,
- aErrorMessage,
- aErrorMessageLength);
-}
-
-void
WidevineDecryptor::SendPlatformChallenge(const char* aServiceId,
uint32_t aServiceIdSize,
const char* aChallenge,
@@ -538,4 +538,17 @@ WidevineDecryptor::CreateFileIO(FileIOClient* aClient)
return new WidevineFileIO(aClient);
}
+void
+WidevineDecryptor::RequestStorageId(uint32_t aVersion)
+{
+ Log("Decryptor::RequestStorageId() aVersion = %u", aVersion);
+ if (aVersion >= 0x80000000) {
+ mCDM->OnStorageId(aVersion, nullptr, 0);
+ return;
+ }
+
+ //TODO: Need to provide a menaingful buffer instead of a dummy one.
+ mCDM->OnStorageId(aVersion, new uint8_t[1024*1024], 1024 * 1024);
+}
+
} // namespace mozilla
diff --git a/dom/media/gmp/widevine-adapter/WidevineDecryptor.h b/dom/media/gmp/widevine-adapter/WidevineDecryptor.h
index d5185192b5..f291c321d3 100644
--- a/dom/media/gmp/widevine-adapter/WidevineDecryptor.h
+++ b/dom/media/gmp/widevine-adapter/WidevineDecryptor.h
@@ -16,7 +16,7 @@
namespace mozilla {
class WidevineDecryptor : public GMPDecryptor
- , public cdm::Host_8
+ , public cdm::Host_9
{
public:
@@ -69,16 +69,19 @@ public:
void DecryptingComplete() override;
- // cdm::Host_8
+ // cdm::Host_9 implementation
cdm::Buffer* Allocate(uint32_t aCapacity) override;
void SetTimer(int64_t aDelayMs, void* aContext) override;
cdm::Time GetCurrentWallTime() override;
+ // cdm::Host_9 interface
+ void OnResolveKeyStatusPromise(uint32_t aPromiseId,
+ cdm::KeyStatus aKeyStatus) override;
void OnResolveNewSessionPromise(uint32_t aPromiseId,
const char* aSessionId,
uint32_t aSessionIdSize) override;
void OnResolvePromise(uint32_t aPromiseId) override;
void OnRejectPromise(uint32_t aPromiseId,
- cdm::Error aError,
+ cdm::Exception aException,
uint32_t aSystemCode,
const char* aErrorMessage,
uint32_t aErrorMessageSize) override;
@@ -86,9 +89,7 @@ public:
uint32_t aSessionIdSize,
cdm::MessageType aMessageType,
const char* aMessage,
- uint32_t aMessageSize,
- const char* aLegacyDestinationUrl,
- uint32_t aLegacyDestinationUrlLength) override;
+ uint32_t aMessageSize) override;
void OnSessionKeysChange(const char* aSessionId,
uint32_t aSessionIdSize,
bool aHasAdditionalUsableKey,
@@ -99,12 +100,6 @@ public:
cdm::Time aNewExpiryTime) override;
void OnSessionClosed(const char* aSessionId,
uint32_t aSessionIdSize) override;
- void OnLegacySessionError(const char* aSessionId,
- uint32_t aSessionId_length,
- cdm::Error aError,
- uint32_t aSystemCode,
- const char* aErrorMessage,
- uint32_t aErrorMessageLength) override;
void SendPlatformChallenge(const char* aServiceId,
uint32_t aServiceIdSize,
const char* aChallenge,
@@ -113,6 +108,9 @@ public:
void QueryOutputProtectionStatus() override;
void OnDeferredInitializationDone(cdm::StreamType aStreamType,
cdm::Status aDecoderStatus) override;
+ // cdm::Host_9 interface
+ // NOTE: the interface has changed upstream.
+ void RequestStorageId(uint32_t aVersion) override;
cdm::FileIO* CreateFileIO(cdm::FileIOClient* aClient) override;
GMPDecryptorCallback* Callback() const { return mCallback; }
@@ -120,7 +118,7 @@ public:
private:
~WidevineDecryptor();
RefPtr<CDMWrapper> mCDM;
- cdm::ContentDecryptionModule_8* CDM() { return mCDM->GetCDM(); }
+ cdm::ContentDecryptionModule_9* CDM() { return mCDM->GetCDM(); }
GMPDecryptorCallback* mCallback;
std::map<uint32_t, uint32_t> mPromiseIdToNewSessionTokens;
diff --git a/dom/media/gmp/widevine-adapter/WidevineUtils.cpp b/dom/media/gmp/widevine-adapter/WidevineUtils.cpp
index 925dfe1a1f..10c6c2e18c 100644
--- a/dom/media/gmp/widevine-adapter/WidevineUtils.cpp
+++ b/dom/media/gmp/widevine-adapter/WidevineUtils.cpp
@@ -43,7 +43,7 @@ ToGMPErr(cdm::Status aStatus)
case cdm::kSuccess: return GMPNoErr;
case cdm::kNeedMoreData: return GMPGenericErr;
case cdm::kNoKey: return GMPNoKeyErr;
- case cdm::kSessionError: return GMPGenericErr;
+ case cdm::kInitializationError: return GMPGenericErr;
case cdm::kDecryptError: return GMPCryptoErr;
case cdm::kDecodeError: return GMPDecodeErr;
case cdm::kDeferredInitialization: return GMPGenericErr;
@@ -77,7 +77,7 @@ void InitInputBuffer(const GMPEncryptedBufferMetadata* aCrypto,
aInputBuffer.timestamp = aTimestamp;
}
-CDMWrapper::CDMWrapper(cdm::ContentDecryptionModule_8* aCDM,
+CDMWrapper::CDMWrapper(cdm::ContentDecryptionModule_9* aCDM,
WidevineDecryptor* aDecryptor)
: mCDM(aCDM)
, mDecryptor(aDecryptor)
diff --git a/dom/media/gmp/widevine-adapter/WidevineUtils.h b/dom/media/gmp/widevine-adapter/WidevineUtils.h
index 57c004a87c..2f6137fe3b 100644
--- a/dom/media/gmp/widevine-adapter/WidevineUtils.h
+++ b/dom/media/gmp/widevine-adapter/WidevineUtils.h
@@ -48,12 +48,16 @@ class CDMWrapper {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(CDMWrapper)
- explicit CDMWrapper(cdm::ContentDecryptionModule_8* aCDM,
+ explicit CDMWrapper(cdm::ContentDecryptionModule_9* aCDM,
WidevineDecryptor* aDecryptor);
- cdm::ContentDecryptionModule_8* GetCDM() const { return mCDM; }
+ cdm::ContentDecryptionModule_9* GetCDM() const { return mCDM; }
+ void OnStorageId(uint32_t aVersion, const uint8_t* aStorageId,
+ uint32_t aStorageIdSize) {
+ mCDM->OnStorageId(aVersion, aStorageId, aStorageIdSize);
+ }
private:
~CDMWrapper();
- cdm::ContentDecryptionModule_8* mCDM;
+ cdm::ContentDecryptionModule_9* mCDM;
RefPtr<WidevineDecryptor> mDecryptor;
};
diff --git a/dom/media/gmp/widevine-adapter/WidevineVideoDecoder.h b/dom/media/gmp/widevine-adapter/WidevineVideoDecoder.h
index b143f75f7f..f5e63519be 100644
--- a/dom/media/gmp/widevine-adapter/WidevineVideoDecoder.h
+++ b/dom/media/gmp/widevine-adapter/WidevineVideoDecoder.h
@@ -45,7 +45,7 @@ private:
~WidevineVideoDecoder();
- cdm::ContentDecryptionModule_8* CDM() const {
+ cdm::ContentDecryptionModule_9* CDM() const {
// CDM should only be accessed before 'DecodingComplete'.
MOZ_ASSERT(mCDMWrapper);
// CDMWrapper ensure the CDM is non-null, no need to check again.
diff --git a/dom/media/gmp/widevine-adapter/content_decryption_module.h b/dom/media/gmp/widevine-adapter/content_decryption_module.h
index 512ca97689..0539135fbe 100644
--- a/dom/media/gmp/widevine-adapter/content_decryption_module.h
+++ b/dom/media/gmp/widevine-adapter/content_decryption_module.h
@@ -5,6 +5,8 @@
#ifndef CDM_CONTENT_DECRYPTION_MODULE_H_
#define CDM_CONTENT_DECRYPTION_MODULE_H_
+#include "content_decryption_module_export.h"
+
#if defined(_MSC_VER)
typedef unsigned char uint8_t;
typedef unsigned int uint32_t;
@@ -14,25 +16,21 @@ typedef __int64 int64_t;
#include <stdint.h>
#endif
-// Define CDM_EXPORT so that functionality implemented by the CDM module
-// can be exported to consumers.
-#if defined(WIN32)
-
-#if defined(CDM_IMPLEMENTATION)
-#define CDM_EXPORT __declspec(dllexport)
-#else
-#define CDM_EXPORT __declspec(dllimport)
-#endif // defined(CDM_IMPLEMENTATION)
-
-#else // defined(WIN32)
-
-#if defined(CDM_IMPLEMENTATION)
-#define CDM_EXPORT __attribute__((visibility("default")))
+// Define CDM_CLASS_API to export class types. We have to add visibility
+// attributes to make sure virtual tables in CDM consumer and CDM implementation
+// are the same. Generally, it was always a good idea, as there're no guarantees
+// about that for the internal symbols, but it has only become a practical issue
+// after introduction of LTO devirtualization. See more details on
+// https://crbug.com/609564#c35
+#if defined(_WIN32)
+#if defined(__clang__)
+#define CDM_CLASS_API [[clang::lto_visibility_public]]
#else
-#define CDM_EXPORT
+#define CDM_CLASS_API
#endif
-
-#endif // defined(WIN32)
+#else // defined(_WIN32)
+#define CDM_CLASS_API __attribute__((visibility("default")))
+#endif // defined(_WIN32)
// The version number must be rolled when the exported functions are updated!
// If the CDM and the adapter use different versions of these functions, the
@@ -48,9 +46,9 @@ typedef __int64 int64_t;
#define BUILD_ENTRYPOINT_NO_EXPANSION(name, version) name##_##version
extern "C" {
-CDM_EXPORT void INITIALIZE_CDM_MODULE();
+CDM_API void INITIALIZE_CDM_MODULE();
-CDM_EXPORT void DeinitializeCdmModule();
+CDM_API void DeinitializeCdmModule();
// Returns a pointer to the requested CDM Host interface upon success.
// Returns NULL if the requested CDM Host interface is not supported.
@@ -65,30 +63,30 @@ typedef void* (*GetCdmHostFunc)(int host_interface_version, void* user_data);
// |cdm_interface_version|.
// Caller retains ownership of arguments and must call Destroy() on the returned
// object.
-CDM_EXPORT void* CreateCdmInstance(
+CDM_API void* CreateCdmInstance(
int cdm_interface_version,
const char* key_system, uint32_t key_system_size,
GetCdmHostFunc get_cdm_host_func, void* user_data);
-CDM_EXPORT const char* GetCdmVersion();
+CDM_API const char* GetCdmVersion();
}
namespace cdm {
-class AudioFrames;
-class DecryptedBlock;
-class VideoFrame;
+class CDM_CLASS_API AudioFrames;
+class CDM_CLASS_API DecryptedBlock;
+class CDM_CLASS_API VideoFrame;
-class Host_7;
-class Host_8;
+class CDM_CLASS_API Host_8;
+class CDM_CLASS_API Host_9;
enum Status {
kSuccess = 0,
kNeedMoreData, // Decoder needs more data to produce a decoded frame/sample.
- kNoKey, // The required decryption key is not available.
- kSessionError, // Session management error.
- kDecryptError, // Decryption failed.
- kDecodeError, // Error decoding audio or video.
+ kNoKey, // The required decryption key is not available.
+ kInitializationError, // Initialization error.
+ kDecryptError, // Decryption failed.
+ kDecodeError, // Error decoding audio or video.
kDeferredInitialization // Decoder is not ready for initialization.
};
@@ -97,6 +95,7 @@ enum Status {
// The following starts with the list of DOM4 exceptions from:
// http://www.w3.org/TR/dom/#domexception
// Some DOM4 exceptions are not included as they are not expected to be used.
+// Should only be used on Host_8 and before.
enum Error {
kNotSupportedError = 9,
kInvalidStateError = 11,
@@ -113,8 +112,20 @@ enum Error {
kOutputError = 101
};
-// Time is defined as the number of seconds since the
-// Epoch (00:00:00 UTC, January 1, 1970).
+// Exceptions used by the CDM to reject promises.
+// https://w3c.github.io/encrypted-media/#exceptions
+enum Exception {
+ kExceptionTypeError,
+ kExceptionNotSupportedError,
+ kExceptionInvalidStateError,
+ kExceptionQuotaExceededError
+};
+
+// Time is defined as the number of seconds since the Epoch
+// (00:00:00 UTC, January 1, 1970), not including any added leap second.
+// Also see Time definition in spec: https://w3c.github.io/encrypted-media/#time
+// Note that Time is defined in millisecond accuracy in the spec but in second
+// accuracy here.
typedef double Time;
// An input buffer can be split into several continuous subsamples.
@@ -151,13 +162,13 @@ struct SubsampleEntry {
// unencrypted.
struct InputBuffer {
InputBuffer()
- : data(NULL),
+ : data(nullptr),
data_size(0),
- key_id(NULL),
+ key_id(nullptr),
key_id_size(0),
- iv(NULL),
+ iv(nullptr),
iv_size(0),
- subsamples(NULL),
+ subsamples(nullptr),
num_subsamples(0),
timestamp(0) {}
@@ -188,7 +199,7 @@ struct AudioDecoderConfig {
channel_count(0),
bits_per_channel(0),
samples_per_second(0),
- extra_data(NULL),
+ extra_data(nullptr),
extra_data_size(0) {}
AudioCodec codec;
@@ -214,10 +225,25 @@ enum AudioFormat {
};
// Surface formats based on FOURCC labels, see: http://www.fourcc.org/yuv.php
+// Values are chosen to be consistent with Chromium's VideoPixelFormat values.
enum VideoFormat {
kUnknownVideoFormat = 0, // Unknown format value. Used for error reporting.
- kYv12, // 12bpp YVU planar 1x1 Y, 2x2 VU samples.
- kI420 // 12bpp YVU planar 1x1 Y, 2x2 UV samples.
+ kYv12 = 1, // 12bpp YVU planar 1x1 Y, 2x2 VU samples.
+ kI420 = 2, // 12bpp YUV planar 1x1 Y, 2x2 UV samples.
+
+ // In the following formats, each sample uses 16-bit in storage, while the
+ // sample value is stored in the least significant N bits where N is
+ // specified by the number after "P". For example, for YUV420P9, each Y, U,
+ // and V sample is stored in the least significant 9 bits in a 2-byte block.
+ kYUV420P9 = 16,
+ kYUV420P10 = 17,
+ kYUV422P9 = 18,
+ kYUV422P10 = 19,
+ kYUV444P9 = 20,
+ kYUV444P10 = 21,
+ kYUV420P12 = 22,
+ kYUV422P12 = 23,
+ kYUV444P12 = 24,
};
struct Size {
@@ -245,14 +271,19 @@ struct VideoDecoderConfig {
kH264ProfileHigh,
kH264ProfileHigh10,
kH264ProfileHigh422,
- kH264ProfileHigh444Predictive
+ kH264ProfileHigh444Predictive,
+ // VP9 Profiles are only passed in starting from CDM_9.
+ kVP9Profile0,
+ kVP9Profile1,
+ kVP9Profile2,
+ kVP9Profile3
};
VideoDecoderConfig()
: codec(kUnknownVideoCodec),
profile(kUnknownVideoCodecProfile),
format(kUnknownVideoFormat),
- extra_data(NULL),
+ extra_data(nullptr),
extra_data_size(0) {}
VideoCodec codec;
@@ -294,7 +325,7 @@ struct PlatformChallengeResponse {
// Used when passing arrays of binary data. Does not own the referenced data.
struct BinaryData {
- BinaryData() : data(NULL), length(0) {}
+ BinaryData() : data(nullptr), length(0) {}
const uint8_t* data;
uint32_t length;
};
@@ -316,7 +347,10 @@ enum KeyStatus {
// should be 0 when |status| == kUsable.
struct KeyInformation {
KeyInformation()
- : key_id(NULL), key_id_size(0), status(kInternalError), system_code(0) {}
+ : key_id(nullptr),
+ key_id_size(0),
+ status(kInternalError),
+ system_code(0) {}
const uint8_t* key_id;
uint32_t key_id_size;
KeyStatus status;
@@ -372,6 +406,24 @@ enum MessageType {
kLicenseRelease = 2
};
+enum HdcpVersion {
+ kHdcpVersionNone,
+ kHdcpVersion1_0,
+ kHdcpVersion1_1,
+ kHdcpVersion1_2,
+ kHdcpVersion1_3,
+ kHdcpVersion1_4,
+ kHdcpVersion2_0,
+ kHdcpVersion2_1,
+ kHdcpVersion2_2
+};
+
+struct Policy {
+ Policy() : min_hdcp_version(kHdcpVersionNone) {}
+
+ HdcpVersion min_hdcp_version;
+};
+
// FileIO interface provides a way for the CDM to store data in a file in
// persistent storage. This interface aims only at providing basic read/write
// capabilities and should not be used as a full fledged file IO API.
@@ -381,7 +433,7 @@ enum MessageType {
// Note to implementors of this interface:
// Per-origin storage and the ability for users to clear it are important.
// See http://www.w3.org/TR/encrypted-media/#privacy-storedinfo.
-class FileIO {
+class CDM_CLASS_API FileIO {
public:
// Opens the file with |file_name| for read and write.
// FileIOClient::OnOpenComplete() will be called after the opening
@@ -389,8 +441,9 @@ class FileIO {
// - When the file is opened by a CDM instance, it will be classified as "in
// use". In this case other CDM instances in the same domain may receive
// kInUse status when trying to open it.
- // - |file_name| must not contain forward slash ('/') or backslash ('\'), and
- // must not start with an underscore ('_').
+ // - |file_name| must only contain letters (A-Za-z), digits(0-9), or "._-".
+ // It must not start with an underscore ('_'), and must be at least 1
+ // character and no more than 256 characters long.
virtual void Open(const char* file_name, uint32_t file_name_size) = 0;
// Reads the contents of the file. FileIOClient::OnReadComplete() will be
@@ -421,7 +474,7 @@ class FileIO {
// When kError is returned, the FileIO object could be in an error state. All
// following calls (other than Close()) could return kError. The CDM should
// still call Close() to destroy the FileIO object.
-class FileIOClient {
+class CDM_CLASS_API FileIOClient {
public:
enum Status {
kSuccess = 0,
@@ -462,10 +515,20 @@ class FileIOClient {
// provided in CreateCdmInstance() to allocate any Buffer that needs to
// be passed back to the caller. Implementations must call Buffer::Destroy()
// when a Buffer is created that will never be returned to the caller.
-class ContentDecryptionModule_7 {
+class CDM_CLASS_API ContentDecryptionModule_8 {
public:
- static const int kVersion = 7;
- typedef Host_7 Host;
+ static const int kVersion = 8;
+ typedef Host_8 Host;
+
+ // Initializes the CDM instance, providing information about permitted
+ // functionalities.
+ // If |allow_distinctive_identifier| is false, messages from the CDM,
+ // such as message events, must not contain a Distinctive Identifier,
+ // even in an encrypted form.
+ // If |allow_persistent_state| is false, the CDM must not attempt to
+ // persist state. Calls to CreateFileIO() will fail.
+ virtual void Initialize(bool allow_distinctive_identifier,
+ bool allow_persistent_state) = 0;
// SetServerCertificate(), CreateSessionAndGenerateRequest(), LoadSession(),
// UpdateSession(), CloseSession(), and RemoveSession() all accept a
@@ -484,8 +547,7 @@ class ContentDecryptionModule_7 {
// or Host::OnRejectPromise().
virtual void CreateSessionAndGenerateRequest(uint32_t promise_id,
SessionType session_type,
- const char* init_data_type,
- uint32_t init_data_type_size,
+ InitDataType init_data_type,
const uint8_t* init_data,
uint32_t init_data_size) = 0;
@@ -631,8 +693,8 @@ class ContentDecryptionModule_7 {
virtual void Destroy() = 0;
protected:
- ContentDecryptionModule_7() {}
- virtual ~ContentDecryptionModule_7() {}
+ ContentDecryptionModule_8() {}
+ virtual ~ContentDecryptionModule_8() {}
};
// ContentDecryptionModule interface that all CDMs need to implement.
@@ -641,10 +703,10 @@ class ContentDecryptionModule_7 {
// provided in CreateCdmInstance() to allocate any Buffer that needs to
// be passed back to the caller. Implementations must call Buffer::Destroy()
// when a Buffer is created that will never be returned to the caller.
-class ContentDecryptionModule_8 {
+class CDM_CLASS_API ContentDecryptionModule_9 {
public:
- static const int kVersion = 8;
- typedef Host_8 Host;
+ static const int kVersion = 9;
+ typedef Host_9 Host;
// Initializes the CDM instance, providing information about permitted
// functionalities.
@@ -656,6 +718,13 @@ class ContentDecryptionModule_8 {
virtual void Initialize(bool allow_distinctive_identifier,
bool allow_persistent_state) = 0;
+ // Gets the key status if the CDM has a hypothetical key with the |policy|.
+ // The CDM must respond by calling either Host::OnResolveKeyStatusPromise()
+ // with the result key status or Host::OnRejectPromise() if an unexpected
+ // error happened or this method is not supported.
+ virtual void GetStatusForPolicy(uint32_t promise_id,
+ const Policy& policy) = 0;
+
// SetServerCertificate(), CreateSessionAndGenerateRequest(), LoadSession(),
// UpdateSession(), CloseSession(), and RemoveSession() all accept a
// |promise_id|, which must be passed to the completion Host method
@@ -731,8 +800,8 @@ class ContentDecryptionModule_8 {
//
// Returns kSuccess if the |audio_decoder_config| is supported and the CDM
// audio decoder is successfully initialized.
- // Returns kSessionError if |audio_decoder_config| is not supported. The CDM
- // may still be able to do Decrypt().
+ // Returns kInitializationError if |audio_decoder_config| is not supported.
+ // The CDM may still be able to do Decrypt().
// Returns kDeferredInitialization if the CDM is not ready to initialize the
// decoder at this time. Must call Host::OnDeferredInitializationDone() once
// initialization is complete.
@@ -744,8 +813,8 @@ class ContentDecryptionModule_8 {
//
// Returns kSuccess if the |video_decoder_config| is supported and the CDM
// video decoder is successfully initialized.
- // Returns kSessionError if |video_decoder_config| is not supported. The CDM
- // may still be able to do Decrypt().
+ // Returns kInitializationError if |video_decoder_config| is not supported.
+ // The CDM may still be able to do Decrypt().
// Returns kDeferredInitialization if the CDM is not ready to initialize the
// decoder at this time. Must call Host::OnDeferredInitializationDone() once
// initialization is complete.
@@ -815,18 +884,30 @@ class ContentDecryptionModule_8 {
uint32_t link_mask,
uint32_t output_protection_mask) = 0;
+ // Called by the host after a call to Host::RequestStorageId(). If the
+ // version of the storage ID requested is available, |storage_id| and
+ // |storage_id_size| are set appropriately. |version| will be the same as
+ // what was requested, unless 0 (latest) was requested, in which case
+ // |version| will be the actual version number for the |storage_id| returned.
+ // If the requested version is not available, null/zero will be provided as
+ // |storage_id| and |storage_id_size|, respectively, and |version| should be
+ // ignored.
+ virtual void OnStorageId(uint32_t version,
+ const uint8_t* storage_id,
+ uint32_t storage_id_size) = 0;
+
// Destroys the object in the same context as it was created.
virtual void Destroy() = 0;
protected:
- ContentDecryptionModule_8() {}
- virtual ~ContentDecryptionModule_8() {}
+ ContentDecryptionModule_9() {}
+ virtual ~ContentDecryptionModule_9() {}
};
-typedef ContentDecryptionModule_8 ContentDecryptionModule;
+typedef ContentDecryptionModule_9 ContentDecryptionModule;
// Represents a buffer created by Allocator implementations.
-class Buffer {
+class CDM_CLASS_API Buffer {
public:
// Destroys the buffer in the same context as it was created.
virtual void Destroy() = 0;
@@ -845,9 +926,9 @@ class Buffer {
void operator=(const Buffer&);
};
-class Host_7 {
+class CDM_CLASS_API Host_8 {
public:
- static const int kVersion = 7;
+ static const int kVersion = 8;
// Returns a Buffer* containing non-zero members upon success, or NULL on
// failure. The caller owns the Buffer* after this call. The buffer is not
@@ -859,7 +940,7 @@ class Host_7 {
// from now with |context|.
virtual void SetTimer(int64_t delay_ms, void* context) = 0;
- // Returns the current wall time in seconds.
+ // Returns the current wall time.
virtual Time GetCurrentWallTime() = 0;
// Called by the CDM when a session is created or loaded and the value for the
@@ -917,8 +998,10 @@ class Host_7 {
// session |session_id|. This can happen as the result of an Update() call
// or some other event. If this happens as a result of a call to Update(),
// it must be called before resolving the Update() promise. |new_expiry_time|
- // can be 0 to represent "undefined". Size parameter should not include
- // null termination.
+ // represents the time after which the key(s) in the session will no longer
+ // be usable for decryption. It can be 0 if no such time exists or if the
+ // license explicitly never expires. Size parameter should not include null
+ // termination.
virtual void OnExpirationChange(const char* session_id,
uint32_t session_id_size,
Time new_expiry_time) = 0;
@@ -978,13 +1061,13 @@ class Host_7 {
virtual FileIO* CreateFileIO(FileIOClient* client) = 0;
protected:
- Host_7() {}
- virtual ~Host_7() {}
+ Host_8() {}
+ virtual ~Host_8() {}
};
-class Host_8 {
+class CDM_CLASS_API Host_9 {
public:
- static const int kVersion = 8;
+ static const int kVersion = 9;
// Returns a Buffer* containing non-zero members upon success, or NULL on
// failure. The caller owns the Buffer* after this call. The buffer is not
@@ -996,9 +1079,14 @@ class Host_8 {
// from now with |context|.
virtual void SetTimer(int64_t delay_ms, void* context) = 0;
- // Returns the current wall time in seconds.
+ // Returns the current wall time.
virtual Time GetCurrentWallTime() = 0;
+ // Called by the CDM when a key status is available in response to
+ // GetStatusForPolicy().
+ virtual void OnResolveKeyStatusPromise(uint32_t promise_id,
+ KeyStatus key_status) = 0;
+
// Called by the CDM when a session is created or loaded and the value for the
// MediaKeySession's sessionId attribute is available (|session_id|).
// This must be called before OnSessionMessage() or
@@ -1016,26 +1104,21 @@ class Host_8 {
// Called by the CDM when an error occurs as a result of one of the
// ContentDecryptionModule calls that accept a |promise_id|.
- // |error| must be specified, |error_message| and |system_code|
+ // |exception| must be specified. |error_message| and |system_code|
// are optional. |error_message_size| should not include null termination.
virtual void OnRejectPromise(uint32_t promise_id,
- Error error,
+ Exception exception,
uint32_t system_code,
const char* error_message,
uint32_t error_message_size) = 0;
// Called by the CDM when it has a message for session |session_id|.
// Size parameters should not include null termination.
- // |legacy_destination_url| is only for supporting the prefixed EME API and
- // is ignored by unprefixed EME. It should only be non-null if |message_type|
- // is kLicenseRenewal.
virtual void OnSessionMessage(const char* session_id,
uint32_t session_id_size,
MessageType message_type,
const char* message,
- uint32_t message_size,
- const char* legacy_destination_url,
- uint32_t legacy_destination_url_length) = 0;
+ uint32_t message_size) = 0;
// Called by the CDM when there has been a change in keys or their status for
// session |session_id|. |has_additional_usable_key| should be set if a
@@ -1054,8 +1137,10 @@ class Host_8 {
// session |session_id|. This can happen as the result of an Update() call
// or some other event. If this happens as a result of a call to Update(),
// it must be called before resolving the Update() promise. |new_expiry_time|
- // can be 0 to represent "undefined". Size parameter should not include
- // null termination.
+ // represents the time after which the key(s) in the session will no longer
+ // be usable for decryption. It can be 0 if no such time exists or if the
+ // license explicitly never expires. Size parameter should not include null
+ // termination.
virtual void OnExpirationChange(const char* session_id,
uint32_t session_id_size,
Time new_expiry_time) = 0;
@@ -1065,21 +1150,6 @@ class Host_8 {
virtual void OnSessionClosed(const char* session_id,
uint32_t session_id_size) = 0;
- // Called by the CDM when an error occurs in session |session_id|
- // unrelated to one of the ContentDecryptionModule calls that accept a
- // |promise_id|. |error| must be specified, |error_message| and
- // |system_code| are optional. Length parameters should not include null
- // termination.
- // Note:
- // - This method is only for supporting prefixed EME API.
- // - This method will be ignored by unprefixed EME. All errors reported
- // in this method should probably also be reported by one of other methods.
- virtual void OnLegacySessionError(
- const char* session_id, uint32_t session_id_length,
- Error error,
- uint32_t system_code,
- const char* error_message, uint32_t error_message_length) = 0;
-
// The following are optional methods that may not be implemented on all
// platforms.
@@ -1114,13 +1184,22 @@ class Host_8 {
// CDM can call this method multiple times to operate on different files.
virtual FileIO* CreateFileIO(FileIOClient* client) = 0;
+ // Requests a specific version of the storage ID. A storage ID is a stable,
+ // device specific ID used by the CDM to securely store persistent data. The
+ // ID will be returned by the host via ContentDecryptionModule::OnStorageId().
+ // If |version| is 0, the latest version will be returned. All |version|s
+ // that are greater than or equal to 0x80000000 are reserved for the CDM and
+ // should not be supported or returned by the host. The CDM must not expose
+ // the ID outside the client device, even in encrypted form.
+ virtual void RequestStorageId(uint32_t version) = 0;
+
protected:
- Host_8() {}
- virtual ~Host_8() {}
+ Host_9() {}
+ virtual ~Host_9() {}
};
// Represents a decrypted block that has not been decoded.
-class DecryptedBlock {
+class CDM_CLASS_API DecryptedBlock {
public:
virtual void SetDecryptedBuffer(Buffer* buffer) = 0;
virtual Buffer* DecryptedBuffer() = 0;
@@ -1135,7 +1214,7 @@ class DecryptedBlock {
virtual ~DecryptedBlock() {}
};
-class VideoFrame {
+class CDM_CLASS_API VideoFrame {
public:
enum VideoPlane {
kYPlane = 0,
@@ -1178,7 +1257,7 @@ class VideoFrame {
//
// |<----------------- AudioFrames ------------------>|
// | audio buffer 0 | audio buffer 1 | audio buffer 2 |
-class AudioFrames {
+class CDM_CLASS_API AudioFrames {
public:
virtual void SetFrameBuffer(Buffer* buffer) = 0;
virtual Buffer* FrameBuffer() = 0;
diff --git a/dom/media/gmp/widevine-adapter/content_decryption_module_export.h b/dom/media/gmp/widevine-adapter/content_decryption_module_export.h
new file mode 100644
index 0000000000..51d485892b
--- /dev/null
+++ b/dom/media/gmp/widevine-adapter/content_decryption_module_export.h
@@ -0,0 +1,22 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CDM_CONTENT_DECRYPTION_MODULE_EXPORT_H_
+#define CDM_CONTENT_DECRYPTION_MODULE_EXPORT_H_
+
+// Define CDM_API so that functionality implemented by the CDM module
+// can be exported to consumers.
+#if defined(_WIN32)
+
+#if defined(CDM_IMPLEMENTATION)
+#define CDM_API __declspec(dllexport)
+#else
+#define CDM_API __declspec(dllimport)
+#endif // defined(CDM_IMPLEMENTATION)
+
+#else // defined(_WIN32)
+#define CDM_API __attribute__((visibility("default")))
+#endif // defined(_WIN32)
+
+#endif // CDM_CONTENT_DECRYPTION_MODULE_EXPORT_H_
diff --git a/dom/media/gmp/widevine-adapter/content_decryption_module_ext.h b/dom/media/gmp/widevine-adapter/content_decryption_module_ext.h
new file mode 100644
index 0000000000..5df8344e60
--- /dev/null
+++ b/dom/media/gmp/widevine-adapter/content_decryption_module_ext.h
@@ -0,0 +1,64 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CDM_CONTENT_DECRYPTION_MODULE_EXT_H_
+#define CDM_CONTENT_DECRYPTION_MODULE_EXT_H_
+
+#if defined(_WIN32)
+#include <windows.h>
+#endif
+
+#include "content_decryption_module_export.h"
+
+#if defined(_MSC_VER)
+typedef unsigned int uint32_t;
+#else
+#include <stdint.h>
+#endif
+
+namespace cdm {
+
+#if defined(_WIN32)
+typedef wchar_t FilePathCharType;
+typedef HANDLE PlatformFile;
+const PlatformFile kInvalidPlatformFile = INVALID_HANDLE_VALUE;
+#else
+typedef char FilePathCharType;
+typedef int PlatformFile;
+const PlatformFile kInvalidPlatformFile = -1;
+#endif // defined(_WIN32)
+
+struct HostFile {
+ HostFile(const FilePathCharType* file_path,
+ PlatformFile file,
+ PlatformFile sig_file)
+ : file_path(file_path), file(file), sig_file(sig_file) {}
+
+ // File that is part of the host of the CDM.
+ const FilePathCharType* file_path = nullptr;
+ PlatformFile file = kInvalidPlatformFile;
+
+ // Signature file for |file|.
+ PlatformFile sig_file = kInvalidPlatformFile;
+};
+
+} // namespace cdm
+
+extern "C" {
+
+// Functions in this file are dynamically retrieved by their versioned function
+// names. Increment the version number for any backward incompatible API
+// changes.
+
+// Verifies CDM host. All files in |host_files| are opened in read-only mode.
+//
+// Returns false and closes all files if there is an immediate failure.
+// Otherwise returns true as soon as possible and processes the files
+// asynchronously. All files MUST be closed by the CDM after this one-time
+// processing is finished.
+CDM_API bool VerifyCdmHost_0(const cdm::HostFile* host_files,
+ uint32_t num_files);
+}
+
+#endif // CDM_CONTENT_DECRYPTION_MODULE_EXT_H_
diff --git a/dom/media/webaudio/AudioBuffer.cpp b/dom/media/webaudio/AudioBuffer.cpp
index cb834f6a59..e7eba2d48a 100644
--- a/dom/media/webaudio/AudioBuffer.cpp
+++ b/dom/media/webaudio/AudioBuffer.cpp
@@ -27,7 +27,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AudioBuffer)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AudioBuffer)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(AudioBuffer)
diff --git a/dom/media/webaudio/AudioParam.cpp b/dom/media/webaudio/AudioParam.cpp
index 6f55749931..c1a8742642 100644
--- a/dom/media/webaudio/AudioParam.cpp
+++ b/dom/media/webaudio/AudioParam.cpp
@@ -22,7 +22,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AudioParam)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AudioParam)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNode)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(AudioParam)
diff --git a/dom/media/webaudio/MediaBufferDecoder.cpp b/dom/media/webaudio/MediaBufferDecoder.cpp
index 2ee11eacd4..f3b75ca1a7 100644
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -44,7 +44,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(WebAudioDecodeJob)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOutput)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSuccessCallback)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFailureCallback)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(WebAudioDecodeJob)
diff --git a/dom/media/webaudio/WaveShaperNode.cpp b/dom/media/webaudio/WaveShaperNode.cpp
index d5c617dcd4..4c50f2f1d6 100644
--- a/dom/media/webaudio/WaveShaperNode.cpp
+++ b/dom/media/webaudio/WaveShaperNode.cpp
@@ -23,7 +23,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(WaveShaperNode, AudioNode)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(WaveShaperNode, AudioNode)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(WaveShaperNode)
diff --git a/dom/network/TCPSocketChild.cpp b/dom/network/TCPSocketChild.cpp
index 8eb19a1db5..72581ca9d0 100644
--- a/dom/network/TCPSocketChild.cpp
+++ b/dom/network/TCPSocketChild.cpp
@@ -50,7 +50,6 @@ namespace dom {
NS_IMPL_CYCLE_COLLECTION_CLASS(TCPSocketChildBase)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TCPSocketChildBase)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSocket)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp
index 64c06d3ea1..5a84f5fb11 100644
--- a/dom/performance/PerformanceMainThread.cpp
+++ b/dom/performance/PerformanceMainThread.cpp
@@ -27,7 +27,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PerformanceMainThread,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTiming,
mNavigation,
mDocEntry)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(PerformanceMainThread,
diff --git a/dom/performance/PerformanceObserver.cpp b/dom/performance/PerformanceObserver.cpp
index d02acfb09a..7bf194bb7e 100644
--- a/dom/performance/PerformanceObserver.cpp
+++ b/dom/performance/PerformanceObserver.cpp
@@ -34,7 +34,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PerformanceObserver)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCallback)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPerformance)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwner)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(PerformanceObserver)
diff --git a/dom/plugins/base/nptypes.h b/dom/plugins/base/nptypes.h
index 12a5fb78e6..c365324723 100644
--- a/dom/plugins/base/nptypes.h
+++ b/dom/plugins/base/nptypes.h
@@ -22,18 +22,6 @@
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
-#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
- /*
- * AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
- * but not bool for C.
- */
- #include <inttypes.h>
-
- #ifndef __cplusplus
- typedef int bool;
- #define true 1
- #define false 0
- #endif
#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
/*
* BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
diff --git a/dom/plugins/base/nsPluginsDirUnix.cpp b/dom/plugins/base/nsPluginsDirUnix.cpp
index 6d112b4fe0..e6956c34c8 100644
--- a/dom/plugins/base/nsPluginsDirUnix.cpp
+++ b/dom/plugins/base/nsPluginsDirUnix.cpp
@@ -19,17 +19,7 @@
#include "nsIPrefService.h"
#define LOCAL_PLUGIN_DLL_SUFFIX ".so"
-#if defined(__hpux)
-#define DEFAULT_X11_PATH "/usr/lib/X11R6/"
-#undef LOCAL_PLUGIN_DLL_SUFFIX
-#define LOCAL_PLUGIN_DLL_SUFFIX ".sl"
-#define LOCAL_PLUGIN_DLL_ALT_SUFFIX ".so"
-#elif defined(_AIX)
-#define DEFAULT_X11_PATH "/usr/lib"
-#define LOCAL_PLUGIN_DLL_ALT_SUFFIX ".a"
-#elif defined(SOLARIS)
-#define DEFAULT_X11_PATH "/usr/openwin/lib/"
-#elif defined(LINUX)
+#if defined(LINUX)
#define DEFAULT_X11_PATH "/usr/X11R6/lib/"
#elif defined(__APPLE__)
#define DEFAULT_X11_PATH "/usr/X11R6/lib"
@@ -102,11 +92,7 @@ static bool LoadExtraSharedLib(const char *name, char **soname, bool tryToGetSon
#define PLUGIN_MAX_NUMBER_OF_EXTRA_LIBS 32
#define PREF_PLUGINS_SONAME "plugin.soname.list"
-#if defined(SOLARIS) || defined(HPUX)
-#define DEFAULT_EXTRA_LIBS_LIST "libXt" LOCAL_PLUGIN_DLL_SUFFIX ":libXext" LOCAL_PLUGIN_DLL_SUFFIX ":libXm" LOCAL_PLUGIN_DLL_SUFFIX
-#else
#define DEFAULT_EXTRA_LIBS_LIST "libXt" LOCAL_PLUGIN_DLL_SUFFIX ":libXext" LOCAL_PLUGIN_DLL_SUFFIX
-#endif
/*
this function looks for
user_pref("plugin.soname.list", "/usr/X11R6/lib/libXt.so.6:libXext.so");
@@ -280,15 +266,9 @@ nsresult nsPluginFile::LoadPlugin(PRLibrary **outLibrary)
// work fine.
-#if defined(SOLARIS) || defined(HPUX)
- // Acrobat/libXm: Lazy resolving might cause crash later (bug 211587)
- *outLibrary = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW);
- pLibrary = *outLibrary;
-#else
// Some dlopen() doesn't recover from a failed PR_LD_NOW (bug 223744)
*outLibrary = PR_LoadLibraryWithFlags(libSpec, 0);
pLibrary = *outLibrary;
-#endif
if (!pLibrary) {
LoadExtraSharedLibs();
// try reload plugin once more
diff --git a/dom/promise/Promise.cpp b/dom/promise/Promise.cpp
index 557f3a1f98..f636a91010 100644
--- a/dom/promise/Promise.cpp
+++ b/dom/promise/Promise.cpp
@@ -413,7 +413,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Promise)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResolveCallbacks)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRejectCallbacks)
#endif // SPIDERMONKEY_PROMISE
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Promise)
@@ -1995,7 +1994,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(CountdownHolder)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(CountdownHolder)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromise)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/dom/promise/PromiseCallback.cpp b/dom/promise/PromiseCallback.cpp
index 3f4a689ae1..6ecf983b79 100644
--- a/dom/promise/PromiseCallback.cpp
+++ b/dom/promise/PromiseCallback.cpp
@@ -47,7 +47,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(ResolvePromiseCallback,
PromiseCallback)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromise)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(ResolvePromiseCallback)
@@ -107,7 +106,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(RejectPromiseCallback,
PromiseCallback)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromise)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(RejectPromiseCallback)
@@ -170,7 +168,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(InvokePromiseFuncCallback,
PromiseCallback)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromiseFunc)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(InvokePromiseFuncCallback)
@@ -256,7 +253,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(WrapperPromiseCallback,
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResolveFunc)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRejectFunc)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCallback)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(WrapperPromiseCallback)
diff --git a/dom/push/PushSubscriptionOptions.cpp b/dom/push/PushSubscriptionOptions.cpp
index bc4fead1e4..39252e9e87 100644
--- a/dom/push/PushSubscriptionOptions.cpp
+++ b/dom/push/PushSubscriptionOptions.cpp
@@ -36,7 +36,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PushSubscriptionOptions)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PushSubscriptionOptions)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(PushSubscriptionOptions)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/security/nsContentSecurityManager.cpp b/dom/security/nsContentSecurityManager.cpp
index 570730312b..f2cbc8fcfb 100644
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -92,6 +92,55 @@ nsContentSecurityManager::AllowTopLevelNavigationToDataURI(nsIChannel* aChannel)
return false;
}
+/* static */ nsresult
+nsContentSecurityManager::CheckFTPSubresourceLoad(nsIChannel* aChannel)
+{
+ // We dissallow using FTP resources as a subresource everywhere.
+ // The only valid way to use FTP resources is loading it as
+ // a top level document.
+
+ nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
+ if (!loadInfo) {
+ return NS_OK;
+ }
+
+ nsContentPolicyType type = loadInfo->GetExternalContentPolicyType();
+ if (type == nsIContentPolicy::TYPE_DOCUMENT) {
+ return NS_OK;
+ }
+
+ nsCOMPtr<nsIURI> uri;
+ nsresult rv = NS_GetFinalChannelURI(aChannel, getter_AddRefs(uri));
+ NS_ENSURE_SUCCESS(rv, rv);
+ if (!uri) {
+ return NS_OK;
+ }
+
+ bool isFtpURI = (NS_SUCCEEDED(uri->SchemeIs("ftp", &isFtpURI)) && isFtpURI);
+ if (!isFtpURI) {
+ return NS_OK;
+ }
+
+ nsCOMPtr<nsIDocument> doc;
+ if (nsINode* node = loadInfo->LoadingNode()) {
+ doc = node->OwnerDoc();
+ }
+
+ nsAutoCString spec;
+ uri->GetSpec(spec);
+ NS_ConvertUTF8toUTF16 specUTF16(NS_UnescapeURL(spec));
+ const char16_t* params[] = { specUTF16.get() };
+
+ nsContentUtils::ReportToConsole(nsIScriptError::warningFlag,
+ NS_LITERAL_CSTRING("FTP_URI_BLOCKED"),
+ doc,
+ nsContentUtils::eSECURITY_PROPERTIES,
+ "BlockSubresourceFTP",
+ params, ArrayLength(params));
+
+ return NS_ERROR_CONTENT_BLOCKED;
+}
+
static nsresult
ValidateSecurityFlags(nsILoadInfo* aLoadInfo)
{
@@ -574,6 +623,10 @@ nsContentSecurityManager::doContentSecurityCheck(nsIChannel* aChannel,
rv = DoContentSecurityChecks(aChannel, loadInfo);
NS_ENSURE_SUCCESS(rv, rv);
+ // Apply this after CSP checks to allow CSP reporting.
+ rv = CheckFTPSubresourceLoad(aChannel);
+ NS_ENSURE_SUCCESS(rv, rv);
+
// now lets set the initalSecurityFlag for subsequent calls
loadInfo->SetInitialSecurityCheckDone(true);
@@ -591,6 +644,9 @@ nsContentSecurityManager::AsyncOnChannelRedirect(nsIChannel* aOldChannel,
// Are we enforcing security using LoadInfo?
if (loadInfo && loadInfo->GetEnforceSecurity()) {
nsresult rv = CheckChannel(aNewChannel);
+ if (NS_SUCCEEDED(rv)) {
+ rv = CheckFTPSubresourceLoad(aNewChannel);
+ }
if (NS_FAILED(rv)) {
aOldChannel->Cancel(rv);
return rv;
diff --git a/dom/security/nsContentSecurityManager.h b/dom/security/nsContentSecurityManager.h
index bab8477434..750dd88038 100644
--- a/dom/security/nsContentSecurityManager.h
+++ b/dom/security/nsContentSecurityManager.h
@@ -36,6 +36,7 @@ public:
private:
static nsresult CheckChannel(nsIChannel* aChannel);
+ static nsresult CheckFTPSubresourceLoad(nsIChannel* aChannel);
virtual ~nsContentSecurityManager() {}
diff --git a/dom/smil/nsSMILAnimationController.cpp b/dom/smil/nsSMILAnimationController.cpp
index 0dd616346f..69956203e0 100644
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -233,7 +233,7 @@ void
nsSMILAnimationController::NotifyRefreshDriverCreated(
nsRefreshDriver* aRefreshDriver)
{
- if (!mPauseState) {
+ if (!mPauseState && mChildContainerTable.Count()) {
MaybeStartSampling(aRefreshDriver);
}
}
diff --git a/dom/svg/DOMSVGLength.cpp b/dom/svg/DOMSVGLength.cpp
index 574617045e..c72c3e3836 100644
--- a/dom/svg/DOMSVGLength.cpp
+++ b/dom/svg/DOMSVGLength.cpp
@@ -43,7 +43,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGLength)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSVGElement)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGLength)
diff --git a/dom/svg/DOMSVGLengthList.cpp b/dom/svg/DOMSVGLengthList.cpp
index 9d93546d98..88ecd6007c 100644
--- a/dom/svg/DOMSVGLengthList.cpp
+++ b/dom/svg/DOMSVGLengthList.cpp
@@ -55,7 +55,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGLengthList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGLengthList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAList)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGLengthList)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/svg/DOMSVGNumber.cpp b/dom/svg/DOMSVGNumber.cpp
index 97d80d4d01..6b9528606e 100644
--- a/dom/svg/DOMSVGNumber.cpp
+++ b/dom/svg/DOMSVGNumber.cpp
@@ -35,7 +35,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGNumber)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGNumber)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/svg/DOMSVGNumberList.cpp b/dom/svg/DOMSVGNumberList.cpp
index 00fb7ba4d0..85322688fc 100644
--- a/dom/svg/DOMSVGNumberList.cpp
+++ b/dom/svg/DOMSVGNumberList.cpp
@@ -55,7 +55,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGNumberList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGNumberList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAList)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGNumberList)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/svg/DOMSVGPathSeg.cpp b/dom/svg/DOMSVGPathSeg.cpp
index 95be3521e2..a15bf42e94 100644
--- a/dom/svg/DOMSVGPathSeg.cpp
+++ b/dom/svg/DOMSVGPathSeg.cpp
@@ -31,7 +31,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGPathSeg)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSeg)
diff --git a/dom/svg/DOMSVGPathSegList.cpp b/dom/svg/DOMSVGPathSegList.cpp
index 0b811cdb1f..36768ea343 100644
--- a/dom/svg/DOMSVGPathSegList.cpp
+++ b/dom/svg/DOMSVGPathSegList.cpp
@@ -36,7 +36,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPathSegList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGPathSegList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPathSegList)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/svg/DOMSVGPointList.cpp b/dom/svg/DOMSVGPointList.cpp
index 966ef476e7..ca06bd2700 100644
--- a/dom/svg/DOMSVGPointList.cpp
+++ b/dom/svg/DOMSVGPointList.cpp
@@ -55,7 +55,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGPointList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGPointList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mElement)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGPointList)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/svg/DOMSVGTransformList.cpp b/dom/svg/DOMSVGTransformList.cpp
index 30760bc6d1..e4bde9aeb8 100644
--- a/dom/svg/DOMSVGTransformList.cpp
+++ b/dom/svg/DOMSVGTransformList.cpp
@@ -54,7 +54,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMSVGTransformList)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMSVGTransformList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAList)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(DOMSVGTransformList)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
diff --git a/dom/svg/SVGTransform.cpp b/dom/svg/SVGTransform.cpp
index b73018d1c4..1cba997eb1 100644
--- a/dom/svg/SVGTransform.cpp
+++ b/dom/svg/SVGTransform.cpp
@@ -51,7 +51,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
SVGMatrix* matrix =
SVGMatrixTearoffTable().GetTearoff(tmp);
CycleCollectionNoteChild(cb, matrix, "matrix");
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(SVGTransform)
diff --git a/dom/svg/nsISVGPoint.cpp b/dom/svg/nsISVGPoint.cpp
index 1c19710041..f4fdb9dd09 100644
--- a/dom/svg/nsISVGPoint.cpp
+++ b/dom/svg/nsISVGPoint.cpp
@@ -32,7 +32,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsISVGPoint)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mList)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsISVGPoint)
diff --git a/dom/svg/nsSVGElement.h b/dom/svg/nsSVGElement.h
index 42bc057469..257ed7a2e6 100644
--- a/dom/svg/nsSVGElement.h
+++ b/dom/svg/nsSVGElement.h
@@ -715,7 +715,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER \
NS_IMPL_CYCLE_COLLECTION_UNLINK_END \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(_val) \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(_element) \
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS \
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(_val) \
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER \
diff --git a/dom/url/URLSearchParams.cpp b/dom/url/URLSearchParams.cpp
index d9492f81c6..f762299f84 100644
--- a/dom/url/URLSearchParams.cpp
+++ b/dom/url/URLSearchParams.cpp
@@ -314,14 +314,6 @@ URLSearchParams::URLSearchParams(nsISupports* aParent,
{
}
-URLSearchParams::URLSearchParams(nsISupports* aParent,
- const URLSearchParams& aOther)
- : mParams(new URLParams(*aOther.mParams.get()))
- , mParent(aParent)
- , mObserver(nullptr)
-{
-}
-
URLSearchParams::~URLSearchParams()
{
DeleteAll();
@@ -335,34 +327,43 @@ URLSearchParams::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
/* static */ already_AddRefed<URLSearchParams>
URLSearchParams::Constructor(const GlobalObject& aGlobal,
- const nsAString& aInit,
+ const USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString& aInit,
ErrorResult& aRv)
{
RefPtr<URLSearchParams> sp =
new URLSearchParams(aGlobal.GetAsSupports(), nullptr);
- NS_ConvertUTF16toUTF8 input(aInit);
-
- if (StringBeginsWith(input, NS_LITERAL_CSTRING("?"))) {
- sp->ParseInput(Substring(input, 1, input.Length() - 1));
+ if (aInit.IsUSVString()) {
+ NS_ConvertUTF16toUTF8 input(aInit.GetAsUSVString());
+ if (StringBeginsWith(input, NS_LITERAL_CSTRING("?"))) {
+ sp->ParseInput(Substring(input, 1, input.Length() - 1));
+ } else {
+ sp->ParseInput(input);
+ }
+ } else if (aInit.IsUSVStringSequenceSequence()) {
+ const Sequence<Sequence<nsString>>& list =
+ aInit.GetAsUSVStringSequenceSequence();
+ for (uint32_t i = 0; i < list.Length(); ++i) {
+ const Sequence<nsString>& item = list[i];
+ if (item.Length() != 2) {
+ aRv.Throw(NS_ERROR_DOM_TYPE_ERR);
+ return nullptr;
+ }
+ sp->Append(item[0], item[1]);
+ }
+ } else if (aInit.IsUSVStringUSVStringRecord()) {
+ const Record<nsString, nsString>& record =
+ aInit.GetAsUSVStringUSVStringRecord();
+ for (auto& entry : record.Entries()) {
+ sp->Append(entry.mKey, entry.mValue);
+ }
} else {
- sp->ParseInput(input);
+ MOZ_CRASH("URLSearchParams: Invalid string");
}
return sp.forget();
}
-/* static */ already_AddRefed<URLSearchParams>
-URLSearchParams::Constructor(const GlobalObject& aGlobal,
- URLSearchParams& aInit,
- ErrorResult& aRv)
-{
- RefPtr<URLSearchParams> sp =
- new URLSearchParams(aGlobal.GetAsSupports(), aInit);
-
- return sp.forget();
-}
-
void
URLSearchParams::ParseInput(const nsACString& aInput)
{
diff --git a/dom/url/URLSearchParams.h b/dom/url/URLSearchParams.h
index 4b0aaa9917..9fefd78dde 100644
--- a/dom/url/URLSearchParams.h
+++ b/dom/url/URLSearchParams.h
@@ -20,6 +20,7 @@ namespace mozilla {
namespace dom {
class URLSearchParams;
+class USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString;
class URLSearchParamsObserver : public nsISupports
{
@@ -43,14 +44,6 @@ public:
DeleteAll();
}
- explicit URLParams(const URLParams& aOther)
- : mParams(aOther.mParams)
- {}
-
- URLParams(const URLParams&& aOther)
- : mParams(Move(aOther.mParams))
- {}
-
class ForEachIterator
{
public:
@@ -144,9 +137,6 @@ public:
explicit URLSearchParams(nsISupports* aParent,
URLSearchParamsObserver* aObserver=nullptr);
- URLSearchParams(nsISupports* aParent,
- const URLSearchParams& aOther);
-
// WebIDL methods
nsISupports* GetParentObject() const
{
@@ -157,11 +147,8 @@ public:
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
static already_AddRefed<URLSearchParams>
- Constructor(const GlobalObject& aGlobal, const nsAString& aInit,
- ErrorResult& aRv);
-
- static already_AddRefed<URLSearchParams>
- Constructor(const GlobalObject& aGlobal, URLSearchParams& aInit,
+ Constructor(const GlobalObject& aGlobal,
+ const USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString& aInit,
ErrorResult& aRv);
void ParseInput(const nsACString& aInput);
diff --git a/dom/webidl/AddonEvent.webidl b/dom/webidl/AddonEvent.webidl
deleted file mode 100644
index 235f81ec22..0000000000
--- a/dom/webidl/AddonEvent.webidl
+++ /dev/null
@@ -1,12 +0,0 @@
-[ Func="mozilla::AddonManagerWebAPI::IsAPIEnabled",
- Constructor(DOMString type, AddonEventInit eventInitDict)]
-interface AddonEvent : Event {
- readonly attribute DOMString id;
- readonly attribute boolean needsRestart;
-};
-
-dictionary AddonEventInit : EventInit {
- required DOMString id;
- required boolean needsRestart;
-};
-
diff --git a/dom/webidl/AddonManager.webidl b/dom/webidl/AddonManager.webidl
deleted file mode 100644
index 02c7953e6f..0000000000
--- a/dom/webidl/AddonManager.webidl
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* We need a JSImplementation but cannot get one without a contract ID.
- Since Addon and AddonInstall are only ever created from JS they don't need
- real contract IDs. */
-[ChromeOnly, JSImplementation="dummy"]
-interface Addon {
- // The add-on's ID.
- readonly attribute DOMString id;
- // The add-on's version.
- readonly attribute DOMString version;
- // The add-on's type (extension, theme, etc.).
- readonly attribute DOMString type;
- // The add-on's name in the current locale.
- readonly attribute DOMString name;
- // The add-on's description in the current locale.
- readonly attribute DOMString description;
- // If the user has enabled this add-on, note that it still may not be running
- // depending on whether enabling requires a restart or if the add-on is
- // incompatible in some way.
- readonly attribute boolean isEnabled;
- // If the add-on is currently active in the browser.
- readonly attribute boolean isActive;
- // If the add-on may be uninstalled
- readonly attribute boolean canUninstall;
-
- Promise<boolean> uninstall();
- Promise<void> setEnabled(boolean value);
-};
-
-[ChromeOnly, JSImplementation="dummy"]
-interface AddonInstall : EventTarget {
- // One of the STATE_* symbols from AddonManager.jsm
- readonly attribute DOMString state;
- // One of the ERROR_* symbols from AddonManager.jsm, or null
- readonly attribute DOMString? error;
- // How many bytes have been downloaded
- readonly attribute long long progress;
- // How many total bytes will need to be downloaded or -1 if unknown
- readonly attribute long long maxProgress;
-
- Promise<void> install();
- Promise<void> cancel();
-};
-
-dictionary addonInstallOptions {
- required DOMString url;
- // If a non-empty string is passed for "hash", it is used to verify the
- // checksum of the downloaded XPI before installing. If is omitted or if
- // it is null or empty string, no checksum verification is performed.
- DOMString? hash = null;
-};
-
-[HeaderFile="mozilla/AddonManagerWebAPI.h",
- Func="mozilla::AddonManagerWebAPI::IsAPIEnabled",
- NavigatorProperty="mozAddonManager",
- JSImplementation="@mozilla.org/addon-web-api/manager;1"]
-interface AddonManager : EventTarget {
- /**
- * Gets information about an add-on
- *
- * @param id
- * The ID of the add-on to test for.
- * @return A promise. It will resolve to an Addon if the add-on is installed.
- */
- Promise<Addon> getAddonByID(DOMString id);
-
- /**
- * Creates an AddonInstall object for a given URL.
- *
- * @param options
- * Only one supported option: 'url', the URL of the addon to install.
- * @return A promise that resolves to an instance of AddonInstall.
- */
- Promise<AddonInstall> createInstall(optional addonInstallOptions options);
-
- /* Hooks for managing event listeners */
- [ChromeOnly]
- void eventListenerWasAdded(DOMString type);
- [ChromeOnly]
- void eventListenerWasRemoved(DOMString type);
-};
-
-[ChromeOnly,Exposed=System,HeaderFile="mozilla/AddonManagerWebAPI.h"]
-interface AddonManagerPermissions {
- static boolean isHostPermitted(DOMString host);
-};
-
diff --git a/dom/webidl/Headers.webidl b/dom/webidl/Headers.webidl
index 205ab9f9ea..eef552a7fc 100644
--- a/dom/webidl/Headers.webidl
+++ b/dom/webidl/Headers.webidl
@@ -8,7 +8,7 @@
* http://fetch.spec.whatwg.org/#headers-class
*/
-typedef (Headers or sequence<sequence<ByteString>> or MozMap<ByteString>) HeadersInit;
+typedef (Headers or sequence<sequence<ByteString>> or record<ByteString, ByteString>) HeadersInit;
enum HeadersGuardEnum {
"none",
diff --git a/dom/webidl/InstallTrigger.webidl b/dom/webidl/InstallTrigger.webidl
index 789fb2bc40..68f48ddc61 100644
--- a/dom/webidl/InstallTrigger.webidl
+++ b/dom/webidl/InstallTrigger.webidl
@@ -57,7 +57,7 @@ interface InstallTriggerImpl {
* A callback to call as each installation succeeds or fails
* @return true if the installations were successfully started
*/
- boolean install(MozMap<(DOMString or InstallTriggerData)> installs,
+ boolean install(record<DOMString, (DOMString or InstallTriggerData)> installs,
optional InstallTriggerCallback callback);
/**
diff --git a/dom/webidl/TestInterfaceJS.webidl b/dom/webidl/TestInterfaceJS.webidl
index 1ca629c39e..2cf8d701af 100644
--- a/dom/webidl/TestInterfaceJS.webidl
+++ b/dom/webidl/TestInterfaceJS.webidl
@@ -24,7 +24,7 @@ interface TestInterfaceJS : EventTarget {
any pingPongObjectOrString((object or DOMString) objOrString);
TestInterfaceJSDictionary pingPongDictionary(optional TestInterfaceJSDictionary dict);
long pingPongDictionaryOrLong(optional (TestInterfaceJSUnionableDictionary or long) dictOrLong);
- DOMString pingPongMap(MozMap<any> map);
+ DOMString pingPongMap(record<DOMString, any> map);
long objectSequenceLength(sequence<object> seq);
long anySequenceLength(sequence<any> seq);
diff --git a/dom/webidl/URLSearchParams.webidl b/dom/webidl/URLSearchParams.webidl
index 93e8460719..b93f4e8b1e 100644
--- a/dom/webidl/URLSearchParams.webidl
+++ b/dom/webidl/URLSearchParams.webidl
@@ -13,8 +13,7 @@
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
*/
-[Constructor(optional USVString init = ""),
- Constructor(URLSearchParams init),
+[Constructor(optional (sequence<sequence<USVString>> or record<USVString, USVString> or USVString) init = ""),
Exposed=(Window,Worker,WorkerDebugger,System)]
interface URLSearchParams {
void append(USVString name, USVString value);
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index 06fea2f20d..aae7e479ca 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -591,9 +591,6 @@ WEBIDL_FILES = [
'XULElement.webidl',
]
-if CONFIG['MOZ_WEBEXTENSIONS']:
- WEBIDL_FILES += ['AddonManager.webidl']
-
if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
WEBIDL_FILES += [
'AudioChannelManager.webidl',
@@ -722,9 +719,6 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'WebGLContextEvent.webidl',
]
-if CONFIG['MOZ_WEBEXTENSIONS']:
- GENERATED_EVENTS_WEBIDL_FILES += ['AddonEvent.webidl']
-
if CONFIG['MOZ_WEBRTC']:
GENERATED_EVENTS_WEBIDL_FILES += [
'RTCDataChannelEvent.webidl',
diff --git a/dom/worklet/WorkletGlobalScope.cpp b/dom/worklet/WorkletGlobalScope.cpp
index 4caeae81ae..8c05a0abe3 100644
--- a/dom/worklet/WorkletGlobalScope.cpp
+++ b/dom/worklet/WorkletGlobalScope.cpp
@@ -22,8 +22,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(WorkletGlobalScope)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(WorkletGlobalScope)
-
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mConsole)
tmp->TraverseHostObjectURIs(cb);
diff --git a/dom/xbl/nsXBLDocumentInfo.cpp b/dom/xbl/nsXBLDocumentInfo.cpp
index 283775dc69..73b08d7e10 100644
--- a/dom/xbl/nsXBLDocumentInfo.cpp
+++ b/dom/xbl/nsXBLDocumentInfo.cpp
@@ -52,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXBLDocumentInfo)
if (tmp->mDocument &&
nsCCUncollectableMarker::InGeneration(cb, tmp->mDocument->GetMarkedCCGeneration())) {
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
return NS_SUCCESS_INTERRUPTED_TRAVERSE;
}
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument)
@@ -62,7 +61,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXBLDocumentInfo)
iter.UserData()->Traverse(cb);
}
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsXBLDocumentInfo)
if (tmp->mBindingTable) {
diff --git a/dom/xslt/xpath/XPathResult.cpp b/dom/xslt/xpath/XPathResult.cpp
index 33315c942f..07121347ec 100644
--- a/dom/xslt/xpath/XPathResult.cpp
+++ b/dom/xslt/xpath/XPathResult.cpp
@@ -63,7 +63,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(XPathResult)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(XPathResult)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mResultNodes)
diff --git a/dom/xslt/xpath/txUnaryExpr.cpp b/dom/xslt/xpath/txUnaryExpr.cpp
index 95682b5b25..ae20fda46a 100644
--- a/dom/xslt/xpath/txUnaryExpr.cpp
+++ b/dom/xslt/xpath/txUnaryExpr.cpp
@@ -23,16 +23,7 @@ UnaryExpr::evaluate(txIEvalContext* aContext, txAExprResult** aResult)
NS_ENSURE_SUCCESS(rv, rv);
double value = exprRes->numberValue();
-#ifdef HPUX
- /*
- * Negation of a zero doesn't produce a negative
- * zero on HPUX. Perform the operation by multiplying with
- * -1.
- */
- return aContext->recycler()->getNumberResult(-1 * value, aResult);
-#else
return aContext->recycler()->getNumberResult(-value, aResult);
-#endif
}
TX_IMPL_EXPR_STUBS_1(UnaryExpr, NODESET_RESULT, expr)
diff --git a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
index 7264417571..c9bcc31ff0 100644
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
@@ -462,10 +462,6 @@ txCompileObserver::startLoad(nsIURI* aUri, txStylesheetCompiler* aCompiler,
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel) {
- httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
- NS_LITERAL_CSTRING("*/*"),
- false);
-
nsCOMPtr<nsIURI> referrerURI;
aReferrerPrincipal->GetURI(getter_AddRefs(referrerURI));
if (referrerURI) {
diff --git a/dom/xul/nsXULElement.cpp b/dom/xul/nsXULElement.cpp
index 14fa898ab5..e351a46eb8 100644
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -2173,7 +2173,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXULPrototypeNode)
}
ImplCycleCollectionTraverse(cb, elem->mChildren, "mChildren");
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsXULPrototypeNode)
if (tmp->mType == nsXULPrototypeNode::eType_Script) {
diff --git a/editor/libeditor/tests/test_htmleditor_keyevent_handling.html b/editor/libeditor/tests/test_htmleditor_keyevent_handling.html
index bfec290a58..414045ac03 100644
--- a/editor/libeditor/tests/test_htmleditor_keyevent_handling.html
+++ b/editor/libeditor/tests/test_htmleditor_keyevent_handling.html
@@ -27,7 +27,7 @@ var htmlEditor = document.getElementById("htmlEditor");
const kIsMac = navigator.platform.indexOf("Mac") == 0;
const kIsWin = navigator.platform.indexOf("Win") == 0;
-const kIsLinux = navigator.platform.indexOf("Linux") == 0 || navigator.platform.indexOf("SunOS") == 0 ;
+const kIsLinux = navigator.platform.indexOf("Linux") == 0;
function runTests()
{
diff --git a/editor/reftests/xul/platform.js b/editor/reftests/xul/platform.js
index f45e6d1f5c..a8633fb09f 100644
--- a/editor/reftests/xul/platform.js
+++ b/editor/reftests/xul/platform.js
@@ -13,8 +13,6 @@ if (/Windows/.test(ua)) {
}
else if (/Linux/.test(ua))
id = "linux";
-else if (/SunOS/.test(ua))
- id = "linux";
else if (/Mac OS X/.test(ua))
id = "mac";
diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h
index c1fba3463a..e2020dc9e6 100644
--- a/gfx/2d/2D.h
+++ b/gfx/2d/2D.h
@@ -488,6 +488,9 @@ public:
/**
* Returns a DataSourceSurface with the same data as this one, but
* guaranteed to have surface->GetType() == SurfaceType::DATA.
+ *
+ * The returning surface might be null, because of OOM or gfx device reset.
+ * The caller needs to do null-check before using it.
*/
virtual already_AddRefed<DataSourceSurface> GetDataSurface() override;
diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h
index 7b1676ab29..3cdf077b11 100644
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -65,18 +65,8 @@ enum class SurfaceFormat : int8_t {
// This represents the unknown format.
UNKNOWN,
- // The following values are endian-independent synonyms. The _UINT32 suffix
- // indicates that the name reflects the layout when viewed as a uint32_t
- // value.
-#if MOZ_LITTLE_ENDIAN
A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB
-#elif MOZ_BIG_ENDIAN
- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
- X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB
-#else
-# error "bad endianness"
-#endif
};
inline bool IsOpaque(SurfaceFormat aFormat)
diff --git a/gfx/cairo/libpixman/src/pixman.h b/gfx/cairo/libpixman/src/pixman.h
index 1cbf62e21f..23408b0286 100644
--- a/gfx/cairo/libpixman/src/pixman.h
+++ b/gfx/cairo/libpixman/src/pixman.h
@@ -104,8 +104,6 @@ typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
-#elif defined (_AIX)
-# include <sys/inttypes.h>
#else
# include <stdint.h>
#endif
diff --git a/gfx/ipc/GPUParent.cpp b/gfx/ipc/GPUParent.cpp
index 9ff6cba9ec..6833f5690a 100644
--- a/gfx/ipc/GPUParent.cpp
+++ b/gfx/ipc/GPUParent.cpp
@@ -24,7 +24,6 @@
#include "mozilla/dom/VideoDecoderManagerChild.h"
#include "mozilla/layers/LayerTreeOwnerTracker.h"
#include "nsDebugImpl.h"
-#include "nsExceptionHandler.h"
#include "nsThreadManager.h"
#include "prenv.h"
#include "ProcessUtils.h"
diff --git a/gfx/ipc/moz.build b/gfx/ipc/moz.build
index ff3a812289..3096814445 100644
--- a/gfx/ipc/moz.build
+++ b/gfx/ipc/moz.build
@@ -70,7 +70,6 @@ IPDL_SOURCES = [
LOCAL_INCLUDES += [
'/dom/ipc',
- '/toolkit/crashreporter',
'/xpcom/threads',
]
diff --git a/gfx/qcms/qcmstypes.h b/gfx/qcms/qcmstypes.h
index d36779183b..d5f843f790 100644
--- a/gfx/qcms/qcmstypes.h
+++ b/gfx/qcms/qcmstypes.h
@@ -38,8 +38,6 @@ typedef unsigned __int64 uintptr_t;
typedef unsigned long uintptr_t;
#endif
-#elif defined (_AIX)
-# include <sys/inttypes.h>
#else
# include <stdint.h>
#endif
diff --git a/gfx/skia/skia/include/core/SkPath.h b/gfx/skia/skia/include/core/SkPath.h
index d1af4f31b6..bde07c498d 100644
--- a/gfx/skia/skia/include/core/SkPath.h
+++ b/gfx/skia/skia/include/core/SkPath.h
@@ -373,7 +373,7 @@ public:
@param extraPtCount The number of extra points the path should
preallocate for.
*/
- void incReserve(unsigned extraPtCount);
+ void incReserve(int extraPtCount);
/** Set the beginning of the next contour to the point (x,y).
diff --git a/gfx/skia/skia/src/core/SkPath.cpp b/gfx/skia/skia/src/core/SkPath.cpp
index 8f93c9c18c..fc3db3ee54 100644
--- a/gfx/skia/skia/src/core/SkPath.cpp
+++ b/gfx/skia/skia/src/core/SkPath.cpp
@@ -716,9 +716,11 @@ void SkPath::setConvexity(Convexity c) {
fFirstDirection = SkPathPriv::kUnknown_FirstDirection; \
} while (0)
-void SkPath::incReserve(U16CPU inc) {
+void SkPath::incReserve(int inc) {
SkDEBUGCODE(this->validate();)
- SkPathRef::Editor(&fPathRef, inc, inc);
+ if (inc > 0) {
+ SkPathRef::Editor(&fPathRef, inc, inc);
+ }
SkDEBUGCODE(this->validate();)
}
@@ -1742,7 +1744,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const {
if (this != dst) {
dst->fFillType = fFillType;
- dst->fConvexity = fConvexity;
+ dst->fConvexity = kUnknown_Convexity;
dst->fIsVolatile = fIsVolatile;
}
diff --git a/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp b/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp
index 993e1c59dc..c6097b03bb 100644
--- a/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp
+++ b/gfx/skia/skia/src/gpu/GrBufferAllocPool.cpp
@@ -152,13 +152,18 @@ void* GrBufferAllocPool::makeSpace(size_t size,
BufferBlock& back = fBlocks.back();
size_t usedBytes = back.fBuffer->gpuMemorySize() - back.fBytesFree;
size_t pad = GrSizeAlignUpPad(usedBytes, alignment);
- if ((size + pad) <= back.fBytesFree) {
+ SkSafeMath safeMath;
+ size_t alignedSize = safeMath.add(pad, size);
+ if (!safeMath.ok()) {
+ return nullptr;
+ }
+ if (alignedSize <= back.fBytesFree) {
memset((void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes), 0, pad);
usedBytes += pad;
*offset = usedBytes;
*buffer = back.fBuffer;
- back.fBytesFree -= size + pad;
- fBytesInUse += size + pad;
+ back.fBytesFree -= alignedSize;
+ fBytesInUse += alignedSize;
VALIDATE();
return (void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes);
}
diff --git a/gfx/thebes/gfxFontconfigFonts.cpp b/gfx/thebes/gfxFontconfigFonts.cpp
index bbcbbabf91..9caecc4c07 100644
--- a/gfx/thebes/gfxFontconfigFonts.cpp
+++ b/gfx/thebes/gfxFontconfigFonts.cpp
@@ -1096,15 +1096,8 @@ gfxFcFontSet::SortPreferredFonts(bool &aWaitForUserFont)
FcFontSet *sets[1] = { fontSet };
FcResult result;
-#ifdef SOLARIS
- // Get around a crash of FcFontSetSort when FcConfig is nullptr
- // Solaris's FcFontSetSort needs an FcConfig (bug 474758)
- fontSet.own(FcFontSetSort(FcConfigGetCurrent(), sets, 1, mSortPattern,
- FcFalse, nullptr, &result));
-#else
fontSet.own(FcFontSetSort(nullptr, sets, 1, mSortPattern,
FcFalse, nullptr, &result));
-#endif
if (truncateMarker != nullptr && fontSet) {
nsAutoRef<FcFontSet> truncatedSet(FcFontSetCreate());
diff --git a/image/DecoderFactory.cpp b/image/DecoderFactory.cpp
index 2085fb7c45..dffe4dc211 100644
--- a/image/DecoderFactory.cpp
+++ b/image/DecoderFactory.cpp
@@ -58,6 +58,10 @@ DecoderFactory::GetDecoderType(const char* aMimeType)
} else if (!strcmp(aMimeType, IMAGE_BMP_MS)) {
type = DecoderType::BMP;
+ // BMP_CLIPBOARD
+ } else if (!strcmp(aMimeType, IMAGE_BMP_MS_CLIPBOARD)) {
+ type = DecoderType::BMP_CLIPBOARD;
+
// ICO
} else if (!strcmp(aMimeType, IMAGE_ICO)) {
type = DecoderType::ICO;
@@ -100,6 +104,9 @@ DecoderFactory::GetDecoder(DecoderType aType,
case DecoderType::BMP:
decoder = new nsBMPDecoder(aImage);
break;
+ case DecoderType::BMP_CLIPBOARD:
+ decoder = new nsBMPDecoder(aImage, /* aForClipboard */ true);
+ break;
case DecoderType::ICO:
decoder = new nsICODecoder(aImage);
break;
diff --git a/image/DecoderFactory.h b/image/DecoderFactory.h
index f8cf64cc60..5638789ff6 100644
--- a/image/DecoderFactory.h
+++ b/image/DecoderFactory.h
@@ -34,6 +34,7 @@ enum class DecoderType
GIF,
JPEG,
BMP,
+ BMP_CLIPBOARD,
ICO,
ICON,
WEBP,
diff --git a/image/decoders/nsBMPDecoder.cpp b/image/decoders/nsBMPDecoder.cpp
index 42bb3486a8..b93eb42b62 100644
--- a/image/decoders/nsBMPDecoder.cpp
+++ b/image/decoders/nsBMPDecoder.cpp
@@ -66,6 +66,17 @@
// compression, then instead of treating the pixel data as 0RGB it is treated
// as ARGB, but only if one or more of the A values are non-zero.
//
+// Clipboard variants.
+// - It's the BMP format used for BMP images captured from the clipboard.
+// - It is missing the file header, containing the BM signature and the data
+// offset. Instead the data begins after the header.
+// - If it uses BITFIELDS compression, then there is always an additional 12
+// bytes of data after the header that must be read. In WinBMPv4+, the masks
+// are supposed to be included in the header size, which are the values we use
+// for decoding purposes, but there is additional three masks following the
+// header which must be skipped to get to the pixel data.
+//
+//
// OS/2 VERSIONS OF THE BMP FORMAT
// -------------------------------
// OS2-BMPv1.
@@ -168,10 +179,12 @@ static mozilla::LazyLogModule sBMPLog("BMPDecoder");
// The length of the mBIHSize field in the info header.
static const uint32_t BIHSIZE_FIELD_LENGTH = 4;
-nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength)
+nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength,
+ bool aForClipboard)
: Decoder(aImage)
, mLexer(Transition::To(aState, aLength), Transition::TerminateSuccess())
, mIsWithinICO(false)
+ , mIsForClipboard(aForClipboard)
, mMayHaveTransparency(false)
, mDoesHaveTransparency(false)
, mNumColors(0)
@@ -185,15 +198,19 @@ nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength)
{
}
-// Constructor for normal BMP files.
-nsBMPDecoder::nsBMPDecoder(RasterImage* aImage)
- : nsBMPDecoder(aImage, State::FILE_HEADER, FILE_HEADER_LENGTH)
+// Constructor for normal BMP files or from the clipboard.
+nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, bool aForClipboard)
+ : nsBMPDecoder(aImage,
+ aForClipboard ? State::INFO_HEADER_SIZE : State::FILE_HEADER,
+ aForClipboard ? BIHSIZE_FIELD_LENGTH : FILE_HEADER_LENGTH,
+ aForClipboard)
{
}
// Constructor used for WinBMPv3-ICO files, which lack a file header.
nsBMPDecoder::nsBMPDecoder(RasterImage* aImage, uint32_t aDataOffset)
- : nsBMPDecoder(aImage, State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH)
+ : nsBMPDecoder(aImage, State::INFO_HEADER_SIZE, BIHSIZE_FIELD_LENGTH,
+ /* aForClipboard */ false)
{
SetIsWithinICO();
@@ -598,6 +615,13 @@ nsBMPDecoder::ReadInfoHeaderRest(const char* aData, size_t aLength)
// Bitfields are present in the info header, so we can read them
// immediately.
mBitFields.ReadFromHeader(aData + 36, /* aReadAlpha = */ true);
+
+ // If this came from the clipboard, then we know that even if the header
+ // explicitly includes the bitfield masks, we need to add an additional
+ // offset for the start of the RGB data.
+ if (mIsForClipboard) {
+ mH.mDataOffset += BitFields::LENGTH;
+ }
} else {
// Bitfields are present after the info header, so we will read them in
// ReadBitfields().
@@ -712,6 +736,12 @@ nsBMPDecoder::ReadColorTable(const char* aData, size_t aLength)
aData += mBytesPerColor;
}
+ // If we are decoding a BMP from the clipboard, we did not know the data
+ // offset in advance. It is defined as just after the header and color table.
+ if (mIsForClipboard) {
+ mH.mDataOffset += mPreGapLength;
+ }
+
// We know how many bytes we've read so far (mPreGapLength) and we know the
// offset of the pixel data (mH.mDataOffset), so we can determine the length
// of the gap (possibly zero) between the color table and the pixel data.
diff --git a/image/decoders/nsBMPDecoder.h b/image/decoders/nsBMPDecoder.h
index 0cf2af6890..4b95684874 100644
--- a/image/decoders/nsBMPDecoder.h
+++ b/image/decoders/nsBMPDecoder.h
@@ -164,14 +164,14 @@ private:
RLE_ABSOLUTE
};
- // This is the constructor used for normal BMP images.
- explicit nsBMPDecoder(RasterImage* aImage);
+ // This is the constructor used for normal and clipboard BMP images.
+ explicit nsBMPDecoder(RasterImage* aImage, bool aForClipboard = false);
// This is the constructor used for BMP resources in ICO images.
nsBMPDecoder(RasterImage* aImage, uint32_t aDataOffset);
// Helper constructor called by the other two.
- nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength);
+ nsBMPDecoder(RasterImage* aImage, State aState, size_t aLength, bool aForClipboard);
int32_t AbsoluteHeight() const { return abs(mH.mHeight); }
@@ -198,6 +198,9 @@ private:
// If the BMP is within an ICO file our treatment of it differs slightly.
bool mIsWithinICO;
+ // If the BMP is decoded from the clipboard, we start with a data offset.
+ bool mIsForClipboard;
+
bmp::BitFields mBitFields;
// Might the image have transparency? Determined from the headers during
diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp
index c9f44181d6..d982c17c4b 100644
--- a/image/imgFrame.cpp
+++ b/image/imgFrame.cpp
@@ -161,13 +161,13 @@ imgFrame::imgFrame()
: mMonitor("imgFrame")
, mDecoded(0, 0, 0, 0)
, mLockCount(0)
+ , mHasNoAlpha(false)
, mAborted(false)
, mFinished(false)
, mOptimizable(false)
, mTimeout(FrameTimeout::FromRawMilliseconds(100))
, mDisposalMethod(DisposalMethod::NOT_SPECIFIED)
, mBlendMethod(BlendMethod::OVER)
- , mHasNoAlpha(false)
, mPalettedImageData(nullptr)
, mPaletteDepth(0)
, mNonPremult(false)
diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
index 8147e87dc2..fee4292380 100644
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -23,8 +23,6 @@
#include "prenv.h"
#include "nsXPCOMPrivate.h"
-#include "nsExceptionHandler.h"
-
#include "nsDirectoryServiceDefs.h"
#include "nsIFile.h"
#include "nsPrintfCString.h"
diff --git a/ipc/glue/moz.build b/ipc/glue/moz.build
index d0d9f99378..85d7f8fa0b 100644
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -177,7 +177,6 @@ IPDL_SOURCES = [
LOCAL_INCLUDES += [
'/dom/ipc',
- '/toolkit/crashreporter',
'/toolkit/xre',
'/xpcom/threads',
]
diff --git a/js/public/LegacyIntTypes.h b/js/public/LegacyIntTypes.h
index 2c8498c89e..cdfd98726d 100644
--- a/js/public/LegacyIntTypes.h
+++ b/js/public/LegacyIntTypes.h
@@ -31,20 +31,10 @@ typedef uint16_t uint16;
typedef uint32_t uint32;
typedef uint64_t uint64;
-/*
- * On AIX 4.3, sys/inttypes.h (which is included by sys/types.h, a very
- * common header file) defines the types int8, int16, int32, and int64.
- * So we don't define these four types here to avoid conflicts in case
- * the code also includes sys/types.h.
- */
-#if defined(AIX) && defined(HAVE_SYS_INTTYPES_H)
-#include <sys/inttypes.h>
-#else
typedef int8_t int8;
typedef int16_t int16;
typedef int32_t int32;
typedef int64_t int64;
-#endif /* AIX && HAVE_SYS_INTTYPES_H */
typedef uint8_t JSUint8;
typedef uint16_t JSUint16;
diff --git a/js/public/Value.h b/js/public/Value.h
index 01666ed4e1..7c4f833e3d 100644
--- a/js/public/Value.h
+++ b/js/public/Value.h
@@ -567,8 +567,11 @@ class MOZ_NON_PARAM alignas(8) Value
}
bool isMagic(JSWhyMagic why) const {
- MOZ_ASSERT_IF(isMagic(), data.s.payload.why == why);
- return isMagic();
+ if (!isMagic()) {
+ return false;
+ }
+ MOZ_RELEASE_ASSERT(data.s.payload.why == why);
+ return true;
}
JS::TraceKind traceKind() const {
diff --git a/js/src/Makefile.in b/js/src/Makefile.in
index b007954b1f..20678c68c3 100644
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -138,27 +138,6 @@ distclean::
CFLAGS += $(MOZ_ZLIB_CFLAGS)
-# Silence warnings on AIX/HP-UX from non-GNU compilers
-ifndef GNU_CC
-ifeq ($(OS_ARCH),AIX)
-# Suppress warnings from xlC
-# 1540-1281: offsetof() on null non-POD types
-# 1540-1608: anonymous unions using static data members
-CFLAGS += -qsuppress=1540-1281 -qsuppress=1540-1608
-CXXFLAGS += -qsuppress=1540-1281 -qsuppress=1540-1608
-endif
-endif
-ifeq ($(OS_ARCH),SunOS)
-ifeq ($(TARGET_CPU),sparc)
-
-ifdef GNU_CC
-CFLAGS += -mcpu=v9
-CXXFLAGS += -mcpu=v9
-endif # GNU_CC
-
-endif
-endif
-
$(LIBRARY_NAME).pc: js.pc
cp $^ $@
diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp
index 373b6c9edc..c896ce5d19 100644
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -240,11 +240,7 @@ GetBuildConfiguration(JSContext* cx, unsigned argc, Value* vp)
if (!JS_SetProperty(cx, info, "intl-api", value))
return false;
-#if defined(SOLARIS)
- value = BooleanValue(false);
-#else
value = BooleanValue(true);
-#endif
if (!JS_SetProperty(cx, info, "mapped-array-buffer", value))
return false;
diff --git a/js/src/ctypes/CTypes.cpp b/js/src/ctypes/CTypes.cpp
index 0facd0009e..d6adfac2c6 100644
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -20,10 +20,6 @@
#include <float.h>
#endif
-#if defined(SOLARIS)
-#include <ieeefp.h>
-#endif
-
#ifdef HAVE_SSIZE_T
#include <sys/types.h>
#endif
diff --git a/js/src/ctypes/libffi/testsuite/libffi.call/float2.c b/js/src/ctypes/libffi/testsuite/libffi.call/float2.c
index a0b296cf4b..dfdef0598a 100644
--- a/js/src/ctypes/libffi/testsuite/libffi.call/float2.c
+++ b/js/src/ctypes/libffi/testsuite/libffi.call/float2.c
@@ -32,21 +32,11 @@ int main (void)
f = 3.14159;
-#if 1
- /* This is ifdef'd out for now. long double support under SunOS/gcc
- is pretty much non-existent. You'll get the odd bus error in library
- routines like printf(). */
printf ("%Lf\n", ldblit(f));
-#endif
ld = 666;
ffi_call(&cif, FFI_FN(ldblit), &ld, values);
-#if 1
- /* This is ifdef'd out for now. long double support under SunOS/gcc
- is pretty much non-existent. You'll get the odd bus error in library
- routines like printf(). */
printf ("%Lf, %Lf, %Lf, %Lf\n", ld, ldblit(f), ld - ldblit(f), LDBL_EPSILON);
-#endif
/* These are not always the same!! Check for a reasonable delta */
if (ld - ldblit(f) < LDBL_EPSILON)
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
index 26da754692..268e1e489c 100644
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -17,11 +17,6 @@
#include "jswin.h"
#include <psapi.h>
-#elif defined(SOLARIS)
-
-#include <sys/mman.h>
-#include <unistd.h>
-
#elif defined(XP_UNIX)
#include <algorithm>
@@ -408,86 +403,6 @@ DeallocateMappedContent(void* p, size_t length)
# endif
-#elif defined(SOLARIS)
-
-#ifndef MAP_NOSYNC
-# define MAP_NOSYNC 0
-#endif
-
-void
-InitMemorySubsystem()
-{
- if (pageSize == 0)
- pageSize = allocGranularity = size_t(sysconf(_SC_PAGESIZE));
-}
-
-void*
-MapAlignedPages(size_t size, size_t alignment)
-{
- MOZ_ASSERT(size >= alignment);
- MOZ_ASSERT(size >= allocGranularity);
- MOZ_ASSERT(size % alignment == 0);
- MOZ_ASSERT(size % pageSize == 0);
- MOZ_ASSERT_IF(alignment < allocGranularity, allocGranularity % alignment == 0);
- MOZ_ASSERT_IF(alignment > allocGranularity, alignment % allocGranularity == 0);
-
- int prot = PROT_READ | PROT_WRITE;
- int flags = MAP_PRIVATE | MAP_ANON | MAP_ALIGN | MAP_NOSYNC;
-
- void* p = mmap((caddr_t)alignment, size, prot, flags, -1, 0);
- if (p == MAP_FAILED)
- return nullptr;
- return p;
-}
-
-static void*
-MapAlignedPagesLastDitch(size_t size, size_t alignment)
-{
- return nullptr;
-}
-
-void
-UnmapPages(void* p, size_t size)
-{
- MOZ_ALWAYS_TRUE(0 == munmap((caddr_t)p, size));
-}
-
-bool
-MarkPagesUnused(void* p, size_t size)
-{
- MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
- return true;
-}
-
-bool
-MarkPagesInUse(void* p, size_t size)
-{
- if (!DecommitEnabled())
- return;
-
- MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0);
-}
-
-size_t
-GetPageFaultCount()
-{
- return 0;
-}
-
-void*
-AllocateMappedContent(int fd, size_t offset, size_t length, size_t alignment)
-{
- // Not implemented.
- return nullptr;
-}
-
-// Deallocate mapped memory for object.
-void
-DeallocateMappedContent(void* p, size_t length)
-{
- // Not implemented.
-}
-
#elif defined(XP_UNIX)
void
diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
index ea4350fb86..93a0eb6a8b 100644
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -210,6 +210,7 @@ js::Nursery::disable()
return;
updateNumChunks(0);
currentEnd_ = 0;
+ position_ = 0;
runtime()->gc.storeBuffer.disable();
}
diff --git a/js/src/gc/Nursery.h b/js/src/gc/Nursery.h
index 0d215d9975..a839a49790 100644
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -245,6 +245,7 @@ class Nursery
// Free space remaining, not counting chunk trailers.
MOZ_ALWAYS_INLINE size_t freeSpace() const {
+ MOZ_ASSERT(isEnabled());
MOZ_ASSERT(currentEnd_ - position_ <= NurseryChunkUsableSize);
return (currentEnd_ - position_) +
(numChunks() - currentChunk_ - 1) * NurseryChunkUsableSize;
diff --git a/js/src/jit/AliasAnalysisShared.cpp b/js/src/jit/AliasAnalysisShared.cpp
index ae28327cad..81c0fd0672 100644
--- a/js/src/jit/AliasAnalysisShared.cpp
+++ b/js/src/jit/AliasAnalysisShared.cpp
@@ -102,7 +102,6 @@ GetObject(const MDefinition* ins)
case MDefinition::Op_SetDisjointTypedElements:
case MDefinition::Op_ArrayPopShift:
case MDefinition::Op_ArrayPush:
- case MDefinition::Op_ArraySlice:
case MDefinition::Op_LoadTypedArrayElementHole:
case MDefinition::Op_StoreTypedArrayElementHole:
case MDefinition::Op_LoadFixedSlot:
@@ -126,6 +125,7 @@ GetObject(const MDefinition* ins)
object = ins->getOperand(0);
break;
case MDefinition::Op_GetPropertyCache:
+ case MDefinition::Op_CallGetProperty:
case MDefinition::Op_LoadTypedArrayElementStatic:
case MDefinition::Op_StoreTypedArrayElementStatic:
case MDefinition::Op_GetDOMProperty:
@@ -148,6 +148,7 @@ GetObject(const MDefinition* ins)
case MDefinition::Op_WasmLoadGlobalVar:
case MDefinition::Op_WasmStoreGlobalVar:
case MDefinition::Op_ArrayJoin:
+ case MDefinition::Op_ArraySlice:
return nullptr;
default:
#ifdef DEBUG
diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp
index b163d5818b..d255c32a82 100644
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -3127,6 +3127,15 @@ ExtractMathSpace(MDefinition* ins)
MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Unknown TruncateKind");
}
+static bool MonotoneAdd(int32_t lhs, int32_t rhs) {
+ return (lhs >= 0 && rhs >= 0) || (lhs <= 0 && rhs <= 0);
+}
+
+static bool MonotoneSub(int32_t lhs, int32_t rhs) {
+ return (lhs >= 0 && rhs <= 0) || (lhs <= 0 && rhs >= 0);
+}
+
+
// Extract a linear sum from ins, if possible (otherwise giving the sum 'ins + 0').
SimpleLinearSum
jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
@@ -3168,10 +3177,12 @@ jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
// Check if this is of the form <SUM> + n or n + <SUM>.
if (ins->isAdd()) {
int32_t constant;
- if (space == MathSpace::Modulo)
+ if (space == MathSpace::Modulo) {
constant = lsum.constant + rsum.constant;
- else if (!SafeAdd(lsum.constant, rsum.constant, &constant))
+ } else if (!SafeAdd(lsum.constant, rsum.constant, &constant) ||
+ !MonotoneAdd(lsum.constant, rsum.constant)) {
return SimpleLinearSum(ins, 0);
+ }
return SimpleLinearSum(lsum.term ? lsum.term : rsum.term, constant);
}
@@ -3179,10 +3190,12 @@ jit::ExtractLinearSum(MDefinition* ins, MathSpace space)
// Check if this is of the form <SUM> - n.
if (lsum.term) {
int32_t constant;
- if (space == MathSpace::Modulo)
+ if (space == MathSpace::Modulo) {
constant = lsum.constant - rsum.constant;
- else if (!SafeSub(lsum.constant, rsum.constant, &constant))
+ } else if (!SafeSub(lsum.constant, rsum.constant, &constant) ||
+ !MonotoneSub(lsum.constant, rsum.constant)) {
return SimpleLinearSum(ins, 0);
+ }
return SimpleLinearSum(lsum.term, constant);
}
diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp
index eb5a6c1c22..b9a7c7b276 100644
--- a/js/src/jit/JitOptions.cpp
+++ b/js/src/jit/JitOptions.cpp
@@ -222,7 +222,7 @@ DefaultJitOptions::DefaultJitOptions()
}
// Toggles whether unboxed plain objects can be created by the VM.
- SET_DEFAULT(disableUnboxedObjects, false);
+ SET_DEFAULT(disableUnboxedObjects, true);
// Test whether Atomics are allowed in asm.js code.
SET_DEFAULT(asmJSAtomicsEnable, false);
diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h
index b2e84322f9..fb0f22fc35 100644
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -9910,10 +9910,6 @@ class MArraySlice
return unboxedType_;
}
- AliasSet getAliasSet() const override {
- return AliasSet::Store(AliasSet::BoxedOrUnboxedElements(unboxedType()) |
- AliasSet::ObjectFields);
- }
bool possiblyCalls() const override {
return true;
}
@@ -11837,7 +11833,8 @@ class MCallGetProperty
AliasSet getAliasSet() const override {
if (!idempotent_)
return AliasSet::Store(AliasSet::Any);
- return AliasSet::None();
+ return AliasSet::Load(AliasSet::ObjectFields | AliasSet::FixedSlot |
+ AliasSet::DynamicSlot);
}
bool possiblyCalls() const override {
return true;
diff --git a/js/src/jit/StupidAllocator.cpp b/js/src/jit/StupidAllocator.cpp
index 8e3ea62865..55431e8e0c 100644
--- a/js/src/jit/StupidAllocator.cpp
+++ b/js/src/jit/StupidAllocator.cpp
@@ -407,7 +407,6 @@ StupidAllocator::allocateForDefinition(LInstruction* ins, LDefinition* def)
{
uint32_t vreg = def->virtualRegister();
- CodePosition from;
if ((def->output()->isRegister() && def->policy() == LDefinition::FIXED) ||
def->policy() == LDefinition::MUST_REUSE_INPUT)
{
diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp
index 2c5c58a296..d203019ecb 100644
--- a/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/js/src/jsapi-tests/testGCAllocator.cpp
@@ -14,8 +14,6 @@
#if defined(XP_WIN)
#include "jswin.h"
#include <psapi.h>
-#elif defined(SOLARIS)
-// This test doesn't apply to Solaris.
#elif defined(XP_UNIX)
#include <algorithm>
#include <errno.h>
@@ -39,8 +37,6 @@ BEGIN_TEST(testGCAllocator)
# else // Various APIs are unavailable. This test is disabled.
return true;
# endif
-#elif defined(SOLARIS)
- return true;
#elif defined(XP_UNIX)
PageSize = size_t(sysconf(_SC_PAGESIZE));
#else
@@ -301,12 +297,6 @@ void* mapMemory(size_t length) { return nullptr; }
void unmapPages(void* p, size_t size) { }
# endif
-#elif defined(SOLARIS) // This test doesn't apply to Solaris.
-
-void* mapMemoryAt(void* desired, size_t length) { return nullptr; }
-void* mapMemory(size_t length) { return nullptr; }
-void unmapPages(void* p, size_t size) { }
-
#elif defined(XP_UNIX)
void*
@@ -377,7 +367,7 @@ unmapPages(void* p, size_t size)
MOZ_RELEASE_ASSERT(errno == ENOMEM);
}
-#else // !defined(XP_WIN) && !defined(SOLARIS) && !defined(XP_UNIX)
+#else // !defined(XP_WIN) && !defined(XP_UNIX)
#error "Memory mapping functions are not defined for your OS."
#endif
END_TEST(testGCAllocator)
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index 9ee29ffe42..f78f94dc12 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6434,6 +6434,9 @@ JS_SetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t v
}
jit::JitOptions.jumpThreshold = value;
break;
+ case JSJITCOMPILER_UNBOXED_OBJECTS:
+ jit::JitOptions.disableUnboxedObjects = !value;
+ break;
case JSJITCOMPILER_ASMJS_ATOMICS_ENABLE:
jit::JitOptions.asmJSAtomicsEnable = !!value;
break;
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 799396a0af..1f726f2e54 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -2154,6 +2154,13 @@ namespace JS {
extern JS_PUBLIC_API(bool)
OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool* bp);
+// Implementation of
+// https://www.ecma-international.org/ecma-262/6.0/#sec-instanceofoperator
+// This is almost identical to JS_HasInstance, except the latter may call a
+// custom hasInstance class op instead of InstanceofOperator.
+extern JS_PUBLIC_API(bool)
+InstanceofOperator(JSContext* cx, HandleObject obj, HandleValue v, bool* bp);
+
} // namespace JS
extern JS_PUBLIC_API(void*)
@@ -5776,19 +5783,20 @@ JS_SetParallelParsingEnabled(JSContext* cx, bool enabled);
extern JS_PUBLIC_API(void)
JS_SetOffthreadIonCompilationEnabled(JSContext* cx, bool enabled);
-#define JIT_COMPILER_OPTIONS(Register) \
- Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
- Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
- Register(ION_GVN_ENABLE, "ion.gvn.enable") \
- Register(ION_FORCE_IC, "ion.forceinlineCaches") \
- Register(ION_ENABLE, "ion.enable") \
+#define JIT_COMPILER_OPTIONS(Register) \
+ Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
+ Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
+ Register(ION_GVN_ENABLE, "ion.gvn.enable") \
+ Register(ION_FORCE_IC, "ion.forceinlineCaches") \
+ Register(ION_ENABLE, "ion.enable") \
Register(ION_INTERRUPT_WITHOUT_SIGNAL, "ion.interrupt-without-signals") \
- Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
- Register(BASELINE_ENABLE, "baseline.enable") \
- Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
- Register(JUMP_THRESHOLD, "jump-threshold") \
- Register(ASMJS_ATOMICS_ENABLE, "asmjs.atomics.enable") \
- Register(WASM_TEST_MODE, "wasm.test-mode") \
+ Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
+ Register(BASELINE_ENABLE, "baseline.enable") \
+ Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
+ Register(JUMP_THRESHOLD, "jump-threshold") \
+ Register(UNBOXED_OBJECTS, "unboxed_objects") \
+ Register(ASMJS_ATOMICS_ENABLE, "asmjs.atomics.enable") \
+ Register(WASM_TEST_MODE, "wasm.test-mode") \
Register(WASM_FOLD_OFFSETS, "wasm.fold-offsets")
typedef enum JSJitCompilerOption {
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp
index be11bf4363..e624aa415b 100644
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -288,6 +288,12 @@ CallerGetterImpl(JSContext* cx, const CallArgs& args)
return true;
}
+ if (JS_IsDeadWrapper(callerObj)) {
+ JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr,
+ JSMSG_DEAD_OBJECT);
+ return false;
+ }
+
JSFunction* callerFun = &callerObj->as<JSFunction>();
MOZ_ASSERT(!callerFun->isBuiltin(), "non-builtin iterator returned a builtin?");
@@ -314,54 +320,14 @@ CallerSetterImpl(JSContext* cx, const CallArgs& args)
{
MOZ_ASSERT(IsFunction(args.thisv()));
- // Beware! This function can be invoked on *any* function! It can't
- // assume it'll never be invoked on natives, strict mode functions, bound
- // functions, or anything else that ordinarily has immutable .caller
- // defined with [[ThrowTypeError]].
- RootedFunction fun(cx, &args.thisv().toObject().as<JSFunction>());
- if (!CallerRestrictions(cx, fun))
- return false;
-
- // Return |undefined| unless an error must be thrown.
- args.rval().setUndefined();
-
- // We can almost just return |undefined| here -- but if the caller function
- // was strict mode code, we still have to throw a TypeError. This requires
- // computing the caller, checking that no security boundaries are crossed,
- // and throwing a TypeError if the resulting caller is strict.
-
- NonBuiltinScriptFrameIter iter(cx);
- if (!AdvanceToActiveCallLinear(cx, iter, fun))
- return true;
-
- ++iter;
- while (!iter.done() && iter.isEvalFrame())
- ++iter;
-
- if (iter.done() || !iter.isFunctionFrame())
- return true;
-
- RootedObject caller(cx, iter.callee(cx));
- if (!cx->compartment()->wrap(cx, &caller)) {
- cx->clearPendingException();
- return true;
- }
-
- // If we don't have full access to the caller, or the caller is not strict,
- // return undefined. Otherwise throw a TypeError.
- JSObject* callerObj = CheckedUnwrap(caller);
- if (!callerObj)
- return true;
-
- JSFunction* callerFun = &callerObj->as<JSFunction>();
- MOZ_ASSERT(!callerFun->isBuiltin(), "non-builtin iterator returned a builtin?");
-
- if (callerFun->strict()) {
- JS_ReportErrorFlagsAndNumberASCII(cx, JSREPORT_ERROR, GetErrorMessage, nullptr,
- JSMSG_CALLER_IS_STRICT);
- return false;
+ // We just have to return |undefined|, but first we call CallerGetterImpl
+ // because we need the same strict-mode and security checks.
+
+ if (!CallerGetterImpl(cx, args)) {
+ return false;
}
+ args.rval().setUndefined();
return true;
}
@@ -690,7 +656,7 @@ js::fun_symbolHasInstance(JSContext* cx, unsigned argc, Value* vp)
}
/*
- * ES6 (4-25-16) 7.3.19 OrdinaryHasInstance
+ * ES6 7.3.19 OrdinaryHasInstance
*/
bool
JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool* bp)
@@ -707,7 +673,7 @@ JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool*
if (obj->is<JSFunction>() && obj->isBoundFunction()) {
/* Steps 2a-b. */
obj = obj->as<JSFunction>().getBoundFunctionTarget();
- return InstanceOfOperator(cx, obj, v, bp);
+ return InstanceofOperator(cx, obj, v, bp);
}
/* Step 3. */
@@ -716,12 +682,12 @@ JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool*
return true;
}
- /* Step 4. */
+ /* Step 4-5. */
RootedValue pval(cx);
if (!GetProperty(cx, obj, obj, cx->names().prototype, &pval))
return false;
- /* Step 5. */
+ /* Step 6. */
if (pval.isPrimitive()) {
/*
* Throw a runtime error if instanceof is called on a function that
@@ -732,7 +698,7 @@ JS::OrdinaryHasInstance(JSContext* cx, HandleObject objArg, HandleValue v, bool*
return false;
}
- /* Step 6. */
+ /* Step 7. */
RootedObject pobj(cx, &pval.toObject());
bool isDelegate;
if (!IsDelegate(cx, pobj, v, &isDelegate))
diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
index 3d4dae9bb9..8cee9ec096 100644
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -2310,22 +2310,27 @@ GCRuntime::updateCellPointers(MovingTracer* trc, Zone* zone, AllocKinds kinds, s
// 2) typed object type descriptor objects
// 3) all other objects
//
+// Also, there can be data races calling IsForwarded() on the new location of a
+// cell that is being updated in parallel on another thread. This can be avoided
+// by updating some kinds of cells in different phases. This is done for JSScripts
+// and LazyScripts, and JSScripts and Scopes.
+//
// Since we want to minimize the number of phases, we put everything else into
// the first phase and label it the 'misc' phase.
static const AllocKinds UpdatePhaseMisc {
AllocKind::SCRIPT,
- AllocKind::LAZY_SCRIPT,
AllocKind::BASE_SHAPE,
AllocKind::SHAPE,
AllocKind::ACCESSOR_SHAPE,
AllocKind::OBJECT_GROUP,
AllocKind::STRING,
- AllocKind::JITCODE,
- AllocKind::SCOPE
+ AllocKind::JITCODE
};
static const AllocKinds UpdatePhaseObjects {
+ AllocKind::LAZY_SCRIPT,
+ AllocKind::SCOPE,
AllocKind::FUNCTION,
AllocKind::FUNCTION_EXTENDED,
AllocKind::OBJECT0,
diff --git a/js/src/jsnativestack.cpp b/js/src/jsnativestack.cpp
index 166a5a4f77..98f8fc7416 100644
--- a/js/src/jsnativestack.cpp
+++ b/js/src/jsnativestack.cpp
@@ -71,35 +71,6 @@ js::GetNativeStackBaseImpl()
# endif
}
-#elif defined(SOLARIS)
-
-#include <ucontext.h>
-
-JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0);
-
-void*
-js::GetNativeStackBaseImpl()
-{
- stack_t st;
- stack_getbounds(&st);
- return static_cast<char*>(st.ss_sp) + st.ss_size;
-}
-
-#elif defined(AIX)
-
-#include <ucontext.h>
-
-JS_STATIC_ASSERT(JS_STACK_GROWTH_DIRECTION < 0);
-
-void*
-js::GetNativeStackBaseImpl()
-{
- ucontext_t context;
- getcontext(&context);
- return static_cast<char*>(context.uc_stack.ss_sp) +
- context.uc_stack.ss_size;
-}
-
#elif defined(XP_LINUX) && !defined(ANDROID) && defined(__GLIBC__)
void*
js::GetNativeStackBaseImpl()
diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp
index 4151d012b6..e3b5708ca2 100644
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -3070,8 +3070,11 @@ js::ValueToSource(JSContext* cx, HandleValue v)
return ToString<CanGC>(cx, v);
}
-
+#if JS_HAS_TOSOURCE
return ObjectToSource(cx, obj);
+#else
+ return ToString<CanGC>(cx, v);
+#endif
}
JSString*
diff --git a/js/src/jstypes.h b/js/src/jstypes.h
index 75774e5b82..6cfb3d4ad2 100644
--- a/js/src/jstypes.h
+++ b/js/src/jstypes.h
@@ -147,13 +147,7 @@
# define JS_64BIT
# endif
#elif defined(__GNUC__)
-/* Additional GCC defines are when running on Solaris, AIX, and HPUX */
-# if defined(__x86_64__) || defined(__sparcv9) || \
- defined(__64BIT__) || defined(__LP64__)
-# define JS_64BIT
-# endif
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */
-# if defined(__x86_64) || defined(__sparcv9)
+# if defined(__x86_64__) || defined(__64BIT__)
# define JS_64BIT
# endif
#elif defined(__xlc__) || defined(__xlC__) /* IBM XL C/C++ */
diff --git a/js/src/jswrapper.h b/js/src/jswrapper.h
index 3c73979f88..84ebe27324 100644
--- a/js/src/jswrapper.h
+++ b/js/src/jswrapper.h
@@ -270,6 +270,8 @@ class JS_FRIEND_API(OpaqueCrossCompartmentWrapper) : public CrossCompartmentWrap
virtual bool getBuiltinClass(JSContext* cx, HandleObject wrapper, ESClass* cls) const override;
virtual bool isArray(JSContext* cx, HandleObject obj,
JS::IsArrayAnswer* answer) const override;
+ virtual bool hasInstance(JSContext* cx, HandleObject wrapper,
+ MutableHandleValue v, bool* bp) const override;
virtual const char* className(JSContext* cx, HandleObject wrapper) const override;
virtual JSString* fun_toString(JSContext* cx, HandleObject proxy, unsigned indent) const override;
diff --git a/js/src/moz.build b/js/src/moz.build
index a3283b5d68..8887411384 100644
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -722,14 +722,6 @@ if CONFIG['OS_ARCH'] == 'Linux':
'dl',
]
-if CONFIG['OS_ARCH'] == 'SunOS':
- OS_LIBS += [
- 'posix4',
- 'dl',
- 'nsl',
- 'socket',
- ]
-
OS_LIBS += CONFIG['REALTIME_LIBS']
CFLAGS += CONFIG['MOZ_ICU_CFLAGS']
diff --git a/js/src/old-configure.in b/js/src/old-configure.in
index 8abea59564..45108ee59a 100644
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -206,10 +206,6 @@ case "$target" in
# -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
-
- # Disable C++11 thread-safe statics due to crashes on XP (bug 1204752)
- # See https://connect.microsoft.com/VisualStudio/feedback/details/1789709/visual-c-2015-runtime-broken-on-windows-server-2003-c-11-magic-statics
- CXXFLAGS="$CXXFLAGS -Zc:threadSafeInit-"
;;
esac
AC_SUBST(MSVS_VERSION)
diff --git a/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp b/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp
index ff3f4145cc..02bf237ff2 100644
--- a/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp
+++ b/js/src/proxy/OpaqueCrossCompartmentWrapper.cpp
@@ -175,6 +175,14 @@ OpaqueCrossCompartmentWrapper::isArray(JSContext* cx, HandleObject obj,
return true;
}
+bool OpaqueCrossCompartmentWrapper::hasInstance(JSContext* cx,
+ HandleObject wrapper,
+ MutableHandleValue v,
+ bool* bp) const {
+ *bp = false;
+ return true;
+}
+
const char*
OpaqueCrossCompartmentWrapper::className(JSContext* cx,
HandleObject proxy) const
diff --git a/js/src/proxy/ScriptedProxyHandler.cpp b/js/src/proxy/ScriptedProxyHandler.cpp
index 7765473371..0e25f470c0 100644
--- a/js/src/proxy/ScriptedProxyHandler.cpp
+++ b/js/src/proxy/ScriptedProxyHandler.cpp
@@ -8,8 +8,6 @@
#include "jsapi.h"
-#include "vm/Interpreter.h" // For InstanceOfOperator
-
#include "jsobjinlines.h"
#include "vm/NativeObject-inl.h"
@@ -1230,7 +1228,7 @@ bool
ScriptedProxyHandler::hasInstance(JSContext* cx, HandleObject proxy, MutableHandleValue v,
bool* bp) const
{
- return InstanceOfOperator(cx, proxy, v, bp);
+ return InstanceofOperator(cx, proxy, v, bp);
}
bool
diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
index b747e4d7a0..e6d6630c4b 100644
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -718,14 +718,14 @@ js::Execute(JSContext* cx, HandleScript script, JSObject& envChainArg, Value* rv
}
/*
- * ES6 (4-25-16) 12.10.4 InstanceofOperator
+ * ES6 12.9.4 InstanceofOperator
*/
extern bool
-js::InstanceOfOperator(JSContext* cx, HandleObject obj, HandleValue v, bool* bp)
+JS::InstanceofOperator(JSContext* cx, HandleObject obj, HandleValue v, bool* bp)
{
/* Step 1. is handled by caller. */
- /* Step 2. */
+ /* Step 2-3. */
RootedValue hasInstance(cx);
RootedId id(cx, SYMBOL_TO_JSID(cx->wellKnownSymbols().hasInstance));
if (!GetProperty(cx, obj, obj, id, &hasInstance))
@@ -735,7 +735,7 @@ js::InstanceOfOperator(JSContext* cx, HandleObject obj, HandleValue v, bool* bp)
if (!IsCallable(hasInstance))
return ReportIsNotFunction(cx, hasInstance);
- /* Step 3. */
+ /* Step 4. */
RootedValue rval(cx);
if (!Call(cx, hasInstance, obj, v, &rval))
return false;
@@ -743,13 +743,13 @@ js::InstanceOfOperator(JSContext* cx, HandleObject obj, HandleValue v, bool* bp)
return true;
}
- /* Step 4. */
+ /* Step 5. */
if (!obj->isCallable()) {
RootedValue val(cx, ObjectValue(*obj));
return ReportIsNotFunction(cx, val);
}
- /* Step 5. */
+ /* Step 6. */
return OrdinaryHasInstance(cx, obj, v, bp);
}
@@ -760,7 +760,7 @@ js::HasInstance(JSContext* cx, HandleObject obj, HandleValue v, bool* bp)
RootedValue local(cx, v);
if (JSHasInstanceOp hasInstance = clasp->getHasInstance())
return hasInstance(cx, obj, &local, bp);
- return js::InstanceOfOperator(cx, obj, local, bp);
+ return JS::InstanceofOperator(cx, obj, local, bp);
}
static inline bool
diff --git a/js/src/vm/Interpreter.h b/js/src/vm/Interpreter.h
index 330dbef5f5..9fefd75ccd 100644
--- a/js/src/vm/Interpreter.h
+++ b/js/src/vm/Interpreter.h
@@ -323,9 +323,6 @@ extern JSType
TypeOfValue(const Value& v);
extern bool
-InstanceOfOperator(JSContext* cx, HandleObject obj, HandleValue v, bool* bp);
-
-extern bool
HasInstance(JSContext* cx, HandleObject obj, HandleValue v, bool* bp);
// Unwind environment chain and iterator to match the scope corresponding to
diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
index 1fbf8976b6..46159a9724 100644
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -495,7 +495,6 @@ ObjectGroup::defaultNewGroup(ExclusiveContext* cx, const Class* clasp,
if (associated->is<JSFunction>()) {
// Canonicalize new functions to use the original one associated with its script.
- JSFunction* fun = &associated->as<JSFunction>();
associated = associated->as<JSFunction>().maybeCanonicalFunction();
// If we have previously cleared the 'new' script information for this
diff --git a/js/src/vm/Time.cpp b/js/src/vm/Time.cpp
index 69e2cc41d2..87531c1483 100644
--- a/js/src/vm/Time.cpp
+++ b/js/src/vm/Time.cpp
@@ -11,9 +11,6 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/MathAlgorithms.h"
-#ifdef SOLARIS
-#define _REENTRANT 1
-#endif
#include <string.h>
#include <time.h>
@@ -33,10 +30,6 @@
#ifdef XP_UNIX
-#ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */
-extern int gettimeofday(struct timeval* tv);
-#endif
-
#include <sys/time.h>
#endif /* XP_UNIX */
@@ -49,11 +42,7 @@ PRMJ_Now()
{
struct timeval tv;
-#ifdef _SVID_GETTOD /* Defined only on Solaris, see Solaris <sys/types.h> */
- gettimeofday(&tv);
-#else
gettimeofday(&tv, 0);
-#endif /* _SVID_GETTOD */
return int64_t(tv.tv_sec) * PRMJ_USEC_PER_SEC + int64_t(tv.tv_usec);
}
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 78d21369d7..c4733cc962 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -130,7 +130,7 @@ class AutoSetHandlingSegFault
# define EPC_sig(p) ((p)->sc_pc)
# define RFP_sig(p) ((p)->sc_regs[30])
# endif
-#elif defined(__linux__) || defined(SOLARIS)
+#elif defined(__linux__)
# if defined(__linux__)
# define XMM_sig(p,i) ((p)->uc_mcontext.fpregs->_xmm[i])
# define EIP_sig(p) ((p)->uc_mcontext.gregs[REG_EIP])
diff --git a/js/xpconnect/loader/mozJSSubScriptLoader.cpp b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
index 9c8908ea41..f23e5833a0 100644
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -295,7 +295,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AsyncScriptLoader)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromise)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(AsyncScriptLoader)
diff --git a/js/xpconnect/src/Sandbox.cpp b/js/xpconnect/src/Sandbox.cpp
index 120772ed2f..a516cf73fb 100644
--- a/js/xpconnect/src/Sandbox.cpp
+++ b/js/xpconnect/src/Sandbox.cpp
@@ -66,7 +66,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(SandboxPrivate)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(SandboxPrivate)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
tmp->TraverseHostObjectURIs(cb);
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
index 0243d80e36..bde949a960 100644
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -1427,6 +1427,8 @@ ReloadPrefsCallback(const char* pref, void* data)
bool extraWarnings = Preferences::GetBool(JS_OPTIONS_DOT_STR "strict");
+ bool unboxedObjects = Preferences::GetBool(JS_OPTIONS_DOT_STR "unboxed_objects");
+
sSharedMemoryEnabled = Preferences::GetBool(JS_OPTIONS_DOT_STR "shared_memory");
#ifdef DEBUG
@@ -1455,6 +1457,8 @@ ReloadPrefsCallback(const char* pref, void* data)
useBaselineEager ? 0 : -1);
JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_ION_WARMUP_TRIGGER,
useIonEager ? 0 : -1);
+ JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_UNBOXED_OBJECTS,
+ unboxedObjects);
}
XPCJSContext::~XPCJSContext()
diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp
index a6432856df..4ddc8deb36 100644
--- a/js/xpconnect/src/XPCShellImpl.cpp
+++ b/js/xpconnect/src/XPCShellImpl.cpp
@@ -644,7 +644,6 @@ env_setProperty(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue
ObjectOpResult& result)
{
/* XXX porting may be easy, but these don't seem to supply setenv by default */
-#if !defined SOLARIS
RootedString valstr(cx);
RootedString idstr(cx);
int rv;
@@ -663,7 +662,7 @@ env_setProperty(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue
JSAutoByteString value(cx, valstr);
if (!value)
return false;
-#if defined XP_WIN || defined HPUX || defined OSF1 || defined SCO
+#if defined XP_WIN || defined SCO
{
char* waste = JS_smprintf("%s=%s", name.ptr(), value.ptr());
if (!waste) {
@@ -671,16 +670,7 @@ env_setProperty(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue
return false;
}
rv = putenv(waste);
-#ifdef XP_WIN
- /*
- * HPUX9 at least still has the bad old non-copying putenv.
- *
- * Per mail from <s.shanmuganathan@digital.com>, OSF1 also has a putenv
- * that will crash if you pass it an auto char array (so it must place
- * its argument directly in the char* environ[] array).
- */
free(waste);
-#endif
}
#else
rv = setenv(name.ptr(), value.ptr(), 1);
@@ -696,7 +686,6 @@ env_setProperty(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue
return false;
}
vp.setString(valstr);
-#endif /* !defined SOLARIS */
return result.succeed();
}
diff --git a/js/xpconnect/src/nsScriptErrorWithStack.cpp b/js/xpconnect/src/nsScriptErrorWithStack.cpp
index edc12fa767..50407da23c 100644
--- a/js/xpconnect/src/nsScriptErrorWithStack.cpp
+++ b/js/xpconnect/src/nsScriptErrorWithStack.cpp
@@ -45,7 +45,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsScriptErrorWithStack)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsScriptErrorWithStack)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsScriptErrorWithStack)
diff --git a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
index 27c010d341..dca3daa58c 100644
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.cpp
@@ -88,6 +88,37 @@ WaiveXrayWrapper::nativeCall(JSContext* cx, JS::IsAcceptableThis test,
}
bool
+WaiveXrayWrapper::hasInstance(JSContext* cx, HandleObject wrapper,
+ MutableHandleValue v, bool* bp) const {
+ if (v.isObject() && WrapperFactory::IsXrayWrapper(&v.toObject())) {
+ // If |v| is an XrayWrapper and in the same compartment as the value
+ // wrapped by |wrapper|, then the Xrays of |v| would be waived upon
+ // calling CrossCompartmentWrapper::hasInstance. This may trigger
+ // getters and proxy traps of unwrapped |v|. To prevent that from
+ // happening, we exit early.
+
+ // |wrapper| is the right operand of "instanceof", and must either be
+ // a function or an object with a @@hasInstance method. We are not going
+ // to call @@hasInstance, so only check whether it is a function.
+ // This check is here for consistency with usual "instanceof" behavior,
+ // which throws if the right operand is not a function. Without this
+ // check, the "instanceof" operator would return false and potentially
+ // hide errors in the code that uses the "instanceof" operator.
+ if (!JS::IsCallable(wrapper)) {
+ RootedValue wrapperv(cx, JS::ObjectValue(*wrapper));
+ js::ReportIsNotFunction(cx, wrapperv);
+ return false;
+ }
+
+ *bp = false;
+ return true;
+ }
+
+ // Both |wrapper| and |v| have no Xrays here.
+ return CrossCompartmentWrapper::hasInstance(cx, wrapper, v, bp);
+}
+
+bool
WaiveXrayWrapper::getPrototype(JSContext* cx, HandleObject wrapper, MutableHandleObject protop) const
{
return CrossCompartmentWrapper::getPrototype(cx, wrapper, protop) &&
diff --git a/js/xpconnect/wrappers/WaiveXrayWrapper.h b/js/xpconnect/wrappers/WaiveXrayWrapper.h
index b0b4477968..0f9675c174 100644
--- a/js/xpconnect/wrappers/WaiveXrayWrapper.h
+++ b/js/xpconnect/wrappers/WaiveXrayWrapper.h
@@ -36,6 +36,8 @@ class WaiveXrayWrapper : public js::CrossCompartmentWrapper {
JS::MutableHandle<JSObject*> objp) const override;
virtual bool nativeCall(JSContext* cx, JS::IsAcceptableThis test,
JS::NativeImpl impl, const JS::CallArgs& args) const override;
+ virtual bool hasInstance(JSContext* cx, JS::HandleObject wrapper,
+ JS::MutableHandleValue v, bool* bp) const override;
virtual bool getPropertyDescriptor(JSContext* cx, JS::Handle<JSObject*> wrapper,
JS::Handle<jsid> id,
JS::MutableHandle<JS::PropertyDescriptor> desc) const override;
diff --git a/js/xpconnect/wrappers/XrayWrapper.cpp b/js/xpconnect/wrappers/XrayWrapper.cpp
index 48a9fdc68e..6e5a2f5e59 100644
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -2309,6 +2309,20 @@ XrayWrapper<Base, Traits>::getBuiltinClass(JSContext* cx, JS::HandleObject wrapp
}
template <typename Base, typename Traits>
+bool
+XrayWrapper<Base, Traits>::hasInstance(JSContext* cx,
+ JS::HandleObject wrapper,
+ JS::MutableHandleValue v,
+ bool* bp) const {
+ assertEnteredPolicy(cx, wrapper, JSID_VOID, BaseProxyHandler::GET);
+
+ // CrossCompartmentWrapper::hasInstance unwraps |wrapper|'s Xrays and enters
+ // its compartment. Any present XrayWrappers should be preserved, so the
+ // standard "instanceof" implementation is called without unwrapping first.
+ return JS::InstanceofOperator(cx, wrapper, v, bp);
+}
+
+template <typename Base, typename Traits>
const char*
XrayWrapper<Base, Traits>::className(JSContext* cx, HandleObject wrapper) const
{
diff --git a/js/xpconnect/wrappers/XrayWrapper.h b/js/xpconnect/wrappers/XrayWrapper.h
index 5630982c28..038d823900 100644
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -482,6 +482,8 @@ class XrayWrapper : public Base {
JS::AutoIdVector& props) const override;
virtual bool getBuiltinClass(JSContext* cx, JS::HandleObject wapper, js::ESClass* cls) const override;
+ virtual bool hasInstance(JSContext* cx, JS::HandleObject wrapper,
+ JS::MutableHandleValue v, bool* bp) const override;
virtual const char* className(JSContext* cx, JS::HandleObject proxy) const override;
static const XrayWrapper singleton;
diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp
index 71ebfad224..ff9edf7420 100644
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -1803,6 +1803,44 @@ SetupDirtyRects(const nsRect& aBGClipArea, const nsRect& aCallerDirtyRect,
"second should be empty if first is");
}
+static bool
+IsSVGStyleGeometryBox(StyleGeometryBox aBox)
+{
+ return (aBox == StyleGeometryBox::Fill || aBox == StyleGeometryBox::Stroke ||
+ aBox == StyleGeometryBox::View);
+}
+
+static bool
+IsHTMLStyleGeometryBox(StyleGeometryBox aBox)
+{
+ return (aBox == StyleGeometryBox::Content ||
+ aBox == StyleGeometryBox::Padding ||
+ aBox == StyleGeometryBox::Border ||
+ aBox == StyleGeometryBox::Margin);
+}
+
+static StyleGeometryBox
+ComputeBoxValue(nsIFrame* aForFrame, StyleGeometryBox aBox)
+{
+ // Except <svg>, all svg elements are not associate with CSS layout box.
+ if (aForFrame->IsFrameOfType(nsIFrame::eSVG) &&
+ (aForFrame->GetType() != nsGkAtoms::svgOuterSVGFrame)) {
+ // For SVG elements without associated CSS layout box, the values
+ // content-box, padding-box, border-box and margin-box compute to fill-box.
+ if (IsHTMLStyleGeometryBox(aBox)) {
+ return StyleGeometryBox::Fill;
+ }
+ } else {
+ // For elements with associated CSS layout box, the values fill-box,
+ // stroke-box and view-box compute to the initial value of mask-clip.
+ if (IsSVGStyleGeometryBox(aBox)) {
+ return StyleGeometryBox::Border;
+ }
+ }
+
+ return aBox;
+}
+
/* static */ void
nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer,
nsIFrame* aForFrame, const nsStyleBorder& aBorder,
@@ -1810,6 +1848,55 @@ nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer,
bool aWillPaintBorder, nscoord aAppUnitsPerPixel,
/* out */ ImageLayerClipState* aClipState)
{
+ StyleGeometryBox layerClip = ComputeBoxValue(aForFrame, aLayer.mClip);
+
+ if (IsSVGStyleGeometryBox(layerClip)) {
+ MOZ_ASSERT(aForFrame->IsFrameOfType(nsIFrame::eSVG) &&
+ (aForFrame->GetType() != nsGkAtoms::svgOuterSVGFrame));
+
+ aClipState->mHasAdditionalBGClipArea = false;
+ aClipState->mCustomClip = false;
+
+ // The coordinate space of clipArea is svg user space.
+ nsRect clipArea =
+ nsLayoutUtils::ComputeGeometryBox(aForFrame, layerClip);
+
+ nsRect strokeBox = (layerClip == StyleGeometryBox::Stroke)
+ ? clipArea
+ : nsLayoutUtils::ComputeGeometryBox(aForFrame, StyleGeometryBox::Stroke);
+ nsRect clipAreaRelativeToStrokeBox = clipArea - strokeBox.TopLeft();
+
+ // aBorderArea is the stroke-box area in a coordinate space defined by
+ // the caller. This coordinate space can be svg user space of aForFrame,
+ // the space of aForFrame's reference-frame, or anything else.
+ //
+ // Which coordinate space chosen for aBorderArea is not matter. What
+ // matter is to ensure returning aClipState->mBGClipArea in the consistent
+ // coordiante space with aBorderArea. So we evaluate the position of clip
+ // area base on the position of aBorderArea here.
+ aClipState->mBGClipArea =
+ clipAreaRelativeToStrokeBox + aBorderArea.TopLeft();
+
+ SetupDirtyRects(aClipState->mBGClipArea, aCallerDirtyRect,
+ aAppUnitsPerPixel, &aClipState->mDirtyRect,
+ &aClipState->mDirtyRectGfx);
+ return;
+ }
+
+ if (layerClip == StyleGeometryBox::NoClip) {
+ aClipState->mBGClipArea = aCallerDirtyRect;
+ aClipState->mHasAdditionalBGClipArea = false;
+ aClipState->mCustomClip = false;
+
+ SetupDirtyRects(aClipState->mBGClipArea, aCallerDirtyRect,
+ aAppUnitsPerPixel, &aClipState->mDirtyRect,
+ &aClipState->mDirtyRectGfx);
+ return;
+ }
+
+ MOZ_ASSERT(!aForFrame->IsFrameOfType(nsIFrame::eSVG) ||
+ aForFrame->GetType() == nsGkAtoms::svgOuterSVGFrame);
+
// Compute the outermost boundary of the area that might be painted.
// Same coordinate space as aBorderArea.
Sides skipSides = aForFrame->GetSkipSides();
@@ -1819,16 +1906,15 @@ nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer,
bool haveRoundedCorners = GetRadii(aForFrame, aBorder, aBorderArea,
clipBorderArea, aClipState->mRadii);
- uint8_t backgroundClip = aLayer.mClip;
-
bool isSolidBorder =
aWillPaintBorder && IsOpaqueBorder(aBorder);
- if (isSolidBorder && backgroundClip == NS_STYLE_IMAGELAYER_CLIP_BORDER) {
+ if (isSolidBorder && layerClip == StyleGeometryBox::Border) {
// If we have rounded corners, we need to inflate the background
// drawing area a bit to avoid seams between the border and
// background.
- backgroundClip = haveRoundedCorners ?
- NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING : NS_STYLE_IMAGELAYER_CLIP_PADDING;
+ layerClip = haveRoundedCorners
+ ? StyleGeometryBox::MozAlmostPadding
+ : StyleGeometryBox::Padding;
}
aClipState->mBGClipArea = clipBorderArea;
@@ -1844,7 +1930,7 @@ nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer,
// but the background is also clipped at a non-scrolling 'padding-box'
// like the content. (See below.)
// Therefore, only 'content-box' makes a difference here.
- if (backgroundClip == NS_STYLE_IMAGELAYER_CLIP_CONTENT) {
+ if (layerClip == StyleGeometryBox::Content) {
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame);
// Clip at a rectangle attached to the scrolled content.
aClipState->mHasAdditionalBGClipArea = true;
@@ -1864,22 +1950,30 @@ nsCSSRendering::GetImageLayerClip(const nsStyleImageLayers::Layer& aLayer,
// Also clip at a non-scrolling, rounded-corner 'padding-box',
// same as the scrolled content because of the 'overflow' property.
- backgroundClip = NS_STYLE_IMAGELAYER_CLIP_PADDING;
+ layerClip = StyleGeometryBox::Padding;
}
- if (backgroundClip != NS_STYLE_IMAGELAYER_CLIP_BORDER &&
- backgroundClip != NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ // See the comment of StyleGeometryBox::Margin.
+ // Hitting this assertion means we decide to turn on margin-box support for
+ // positioned mask from CSS parser and style system. In this case, you
+ // should *inflate* mBGClipArea by the margin returning from
+ // aForFrame->GetUsedMargin() in the code chunk bellow.
+ MOZ_ASSERT(layerClip != StyleGeometryBox::Margin,
+ "StyleGeometryBox::Margin rendering is not supported yet.\n");
+
+ if (layerClip != StyleGeometryBox::Border &&
+ layerClip != StyleGeometryBox::Text) {
nsMargin border = aForFrame->GetUsedBorder();
- if (backgroundClip == NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING) {
+ if (layerClip == StyleGeometryBox::MozAlmostPadding) {
// Reduce |border| by 1px (device pixels) on all sides, if
// possible, so that we don't get antialiasing seams between the
- // background and border.
+ // {background|mask} and border.
border.top = std::max(0, border.top - aAppUnitsPerPixel);
border.right = std::max(0, border.right - aAppUnitsPerPixel);
border.bottom = std::max(0, border.bottom - aAppUnitsPerPixel);
border.left = std::max(0, border.left - aAppUnitsPerPixel);
- } else if (backgroundClip != NS_STYLE_IMAGELAYER_CLIP_PADDING) {
- NS_ASSERTION(backgroundClip == NS_STYLE_IMAGELAYER_CLIP_CONTENT,
+ } else if (layerClip != StyleGeometryBox::Padding) {
+ NS_ASSERTION(layerClip == StyleGeometryBox::Content,
"unexpected background-clip");
border += aForFrame->GetUsedPadding();
}
@@ -3163,7 +3257,7 @@ nsCSSRendering::PaintBackgroundWithSC(const PaintBGParams& aParams,
if (drawBackgroundImage) {
bool clipSet = false;
- uint8_t currentBackgroundClip = NS_STYLE_IMAGELAYER_CLIP_BORDER;
+ StyleGeometryBox currentBackgroundClip = StyleGeometryBox::Border;
NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT_WITH_RANGE(i, layers, layers.mImageCount - 1,
nLayers + (layers.mImageCount -
startLayer - 1)) {
@@ -3239,16 +3333,43 @@ nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
nsIFrame** aAttachedToFrame,
bool* aOutIsTransformedFixed)
{
- // Compute background origin area relative to aBorderArea now as we may need
- // it to compute the effective image size for a CSS gradient.
- nsRect bgPositioningArea;
+ // Compute {background|mask} origin area relative to aBorderArea now as we
+ // may need it to compute the effective image size for a CSS gradient.
+ nsRect positionArea;
+
+ StyleGeometryBox layerOrigin =
+ ComputeBoxValue(aForFrame, aLayer.mOrigin);
+
+ if (IsSVGStyleGeometryBox(layerOrigin)) {
+ MOZ_ASSERT(aForFrame->IsFrameOfType(nsIFrame::eSVG) &&
+ (aForFrame->GetType() != nsGkAtoms::svgOuterSVGFrame));
+ *aAttachedToFrame = aForFrame;
+
+ positionArea =
+ nsLayoutUtils::ComputeGeometryBox(aForFrame, layerOrigin);
+
+ nsPoint toStrokeBoxOffset = nsPoint(0, 0);
+ if (layerOrigin != StyleGeometryBox::Stroke) {
+ nsRect strokeBox =
+ nsLayoutUtils::ComputeGeometryBox(aForFrame,
+ StyleGeometryBox::Stroke);
+ toStrokeBoxOffset = positionArea.TopLeft() - strokeBox.TopLeft();
+ }
+
+ // For SVG frames, the return value is relative to the stroke box
+ return nsRect(toStrokeBoxOffset, positionArea.Size());
+ }
+
+ MOZ_ASSERT(!aForFrame->IsFrameOfType(nsIFrame::eSVG) ||
+ aForFrame->GetType() == nsGkAtoms::svgOuterSVGFrame);
+
nsIAtom* frameType = aForFrame->GetType();
nsIFrame* geometryFrame = aForFrame;
if (MOZ_UNLIKELY(frameType == nsGkAtoms::scrollFrame &&
NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL == aLayer.mAttachment)) {
nsIScrollableFrame* scrollableFrame = do_QueryFrame(aForFrame);
- bgPositioningArea = nsRect(
+ positionArea = nsRect(
scrollableFrame->GetScrolledFrame()->GetPosition()
// For the dir=rtl case:
+ scrollableFrame->GetScrollRange().TopLeft(),
@@ -3256,20 +3377,20 @@ nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
// The ScrolledRect’s size does not include the borders or scrollbars,
// reverse the handling of background-origin
// compared to the common case below.
- if (aLayer.mOrigin == NS_STYLE_IMAGELAYER_ORIGIN_BORDER) {
+ if (layerOrigin == StyleGeometryBox::Border) {
nsMargin border = geometryFrame->GetUsedBorder();
border.ApplySkipSides(geometryFrame->GetSkipSides());
- bgPositioningArea.Inflate(border);
- bgPositioningArea.Inflate(scrollableFrame->GetActualScrollbarSizes());
- } else if (aLayer.mOrigin != NS_STYLE_IMAGELAYER_ORIGIN_PADDING) {
+ positionArea.Inflate(border);
+ positionArea.Inflate(scrollableFrame->GetActualScrollbarSizes());
+ } else if (layerOrigin != StyleGeometryBox::Padding) {
nsMargin padding = geometryFrame->GetUsedPadding();
padding.ApplySkipSides(geometryFrame->GetSkipSides());
- bgPositioningArea.Deflate(padding);
- NS_ASSERTION(aLayer.mOrigin == NS_STYLE_IMAGELAYER_ORIGIN_CONTENT,
+ positionArea.Deflate(padding);
+ NS_ASSERTION(layerOrigin == StyleGeometryBox::Content,
"unknown background-origin value");
}
*aAttachedToFrame = aForFrame;
- return bgPositioningArea;
+ return positionArea;
}
if (MOZ_UNLIKELY(frameType == nsGkAtoms::canvasFrame)) {
@@ -3279,25 +3400,31 @@ nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
// finished and this page only displays the continuations of
// absolutely positioned content).
if (geometryFrame) {
- bgPositioningArea = geometryFrame->GetRect();
+ positionArea = geometryFrame->GetRect();
}
} else {
- bgPositioningArea = nsRect(nsPoint(0,0), aBorderArea.Size());
+ positionArea = nsRect(nsPoint(0,0), aBorderArea.Size());
}
- // Background images are tiled over the 'background-clip' area
- // but the origin of the tiling is based on the 'background-origin' area
- // XXX: Bug 1303623 will bring in new origin value, we should iterate from
- // NS_STYLE_IMAGELAYER_ORIGIN_MARGIN instead of
- // NS_STYLE_IMAGELAYER_ORIGIN_BORDER.
- if (aLayer.mOrigin != NS_STYLE_IMAGELAYER_ORIGIN_BORDER && geometryFrame) {
+ // See the comment of StyleGeometryBox::Margin.
+ // Hitting this assertion means we decide to turn on margin-box support for
+ // positioned mask from CSS parser and style system. In this case, you
+ // should *inflate* positionArea by the margin returning from
+ // geometryFrame->GetUsedMargin() in the code chunk bellow.
+ MOZ_ASSERT(aLayer.mOrigin != StyleGeometryBox::Margin,
+ "StyleGeometryBox::Margin rendering is not supported yet.\n");
+
+ // {background|mask} images are tiled over the '{background|mask}-clip' area
+ // but the origin of the tiling is based on the '{background|mask}-origin'
+ // area.
+ if (layerOrigin != StyleGeometryBox::Border && geometryFrame) {
nsMargin border = geometryFrame->GetUsedBorder();
- if (aLayer.mOrigin != NS_STYLE_IMAGELAYER_ORIGIN_PADDING) {
+ if (layerOrigin != StyleGeometryBox::Padding) {
border += geometryFrame->GetUsedPadding();
- NS_ASSERTION(aLayer.mOrigin == NS_STYLE_IMAGELAYER_ORIGIN_CONTENT,
+ NS_ASSERTION(layerOrigin == StyleGeometryBox::Content,
"unknown background-origin value");
}
- bgPositioningArea.Deflate(border);
+ positionArea.Deflate(border);
}
nsIFrame* attachedToFrame = aForFrame;
@@ -3325,7 +3452,7 @@ nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
} else {
// Set the background positioning area to the viewport's area
// (relative to aForFrame)
- bgPositioningArea =
+ positionArea =
nsRect(-aForFrame->GetOffsetTo(attachedToFrame), attachedToFrame->GetSize());
if (!pageContentFrame) {
@@ -3334,14 +3461,14 @@ nsCSSRendering::ComputeImageLayerPositioningArea(nsPresContext* aPresContext,
aPresContext->PresShell()->GetRootScrollFrameAsScrollable();
if (scrollableFrame) {
nsMargin scrollbars = scrollableFrame->GetActualScrollbarSizes();
- bgPositioningArea.Deflate(scrollbars);
+ positionArea.Deflate(scrollbars);
}
}
}
}
*aAttachedToFrame = attachedToFrame;
- return bgPositioningArea;
+ return positionArea;
}
// Implementation of the formula for computation of background-repeat round
@@ -3569,7 +3696,7 @@ nsCSSRendering::PrepareImageLayer(nsPresContext* aPresContext,
bool transformedFixed = false;
// Compute background origin area relative to aBorderArea now as we may need
// it to compute the effective image size for a CSS gradient.
- nsRect bgPositioningArea =
+ nsRect positionArea =
ComputeImageLayerPositioningArea(aPresContext, aForFrame, aBorderArea,
aLayer, &attachedToFrame, &transformedFixed);
if (aOutIsTransformedFixed) {
@@ -3594,7 +3721,7 @@ nsCSSRendering::PrepareImageLayer(nsPresContext* aPresContext,
// not a pure optimization since it can affect the values of pixels at the
// edge of the viewport --- whether they're sampled from a putative "next
// tile" or not.)
- bgClipRect.IntersectRect(bgClipRect, bgPositioningArea + aBorderArea.TopLeft());
+ bgClipRect.IntersectRect(bgClipRect, positionArea + aBorderArea.TopLeft());
}
}
@@ -3605,7 +3732,7 @@ nsCSSRendering::PrepareImageLayer(nsPresContext* aPresContext,
// Also as required for proper background positioning when background-position
// is defined with percentages.
CSSSizeOrRatio intrinsicSize = state.mImageRenderer.ComputeIntrinsicSize();
- nsSize bgPositionSize = bgPositioningArea.Size();
+ nsSize bgPositionSize = positionArea.Size();
nsSize imageSize = ComputeDrawnSizeForBackground(intrinsicSize,
bgPositionSize,
aLayer.mSize,
@@ -3650,8 +3777,8 @@ nsCSSRendering::PrepareImageLayer(nsPresContext* aPresContext,
}
}
- imageTopLeft += bgPositioningArea.TopLeft();
- state.mAnchor += bgPositioningArea.TopLeft();
+ imageTopLeft += positionArea.TopLeft();
+ state.mAnchor += positionArea.TopLeft();
state.mDestArea = nsRect(imageTopLeft + aBorderArea.TopLeft(), imageSize);
state.mFillArea = state.mDestArea;
diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp
index 2b9ad7ff81..d619576baf 100644
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -3014,7 +3014,7 @@ nsDisplayBackgroundImage::ComputeVisibility(nsDisplayListBuilder* aBuilder,
/* static */ nsRegion
nsDisplayBackgroundImage::GetInsideClipRegion(nsDisplayItem* aItem,
- uint8_t aClip,
+ StyleGeometryBox aClip,
const nsRect& aRect,
const nsRect& aBackgroundRect)
{
@@ -3028,10 +3028,10 @@ nsDisplayBackgroundImage::GetInsideClipRegion(nsDisplayItem* aItem,
if (frame->GetType() == nsGkAtoms::canvasFrame) {
nsCanvasFrame* canvasFrame = static_cast<nsCanvasFrame*>(frame);
clipRect = canvasFrame->CanvasArea() + aItem->ToReferenceFrame();
- } else if (aClip == NS_STYLE_IMAGELAYER_CLIP_PADDING ||
- aClip == NS_STYLE_IMAGELAYER_CLIP_CONTENT) {
+ } else if (aClip == StyleGeometryBox::Padding ||
+ aClip == StyleGeometryBox::Content) {
nsMargin border = frame->GetUsedBorder();
- if (aClip == NS_STYLE_IMAGELAYER_CLIP_CONTENT) {
+ if (aClip == StyleGeometryBox::Content) {
border += frame->GetUsedPadding();
}
border.ApplySkipSides(frame->GetSkipSides());
@@ -3064,7 +3064,7 @@ nsDisplayBackgroundImage::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
if (layer.mImage.IsOpaque() && layer.mBlendMode == NS_STYLE_BLEND_NORMAL &&
layer.mRepeat.mXRepeat != NS_STYLE_IMAGELAYER_REPEAT_SPACE &&
layer.mRepeat.mYRepeat != NS_STYLE_IMAGELAYER_REPEAT_SPACE &&
- layer.mClip != NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ layer.mClip != StyleGeometryBox::Text) {
result = GetInsideClipRegion(this, layer.mClip, mBounds, mBackgroundRect);
}
}
@@ -3143,9 +3143,9 @@ nsDisplayBackgroundImage::PaintInternal(nsDisplayListBuilder* aBuilder,
CheckForBorderItem(this, flags);
gfxContext* ctx = aCtx->ThebesContext();
- uint8_t clip = mBackgroundStyle->mImage.mLayers[mLayer].mClip;
+ StyleGeometryBox clip = mBackgroundStyle->mImage.mLayers[mLayer].mClip;
- if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (clip == StyleGeometryBox::Text) {
if (!GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect, aBuilder)) {
return;
}
@@ -3161,7 +3161,7 @@ nsDisplayBackgroundImage::PaintInternal(nsDisplayListBuilder* aBuilder,
image::DrawResult result =
nsCSSRendering::PaintBackground(params);
- if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (clip == StyleGeometryBox::Text) {
ctx->PopGroupAndBlend();
}
@@ -3583,8 +3583,8 @@ nsDisplayBackgroundColor::Paint(nsDisplayListBuilder* aBuilder,
nsLayoutUtils::RectToGfxRect(mBackgroundRect,
mFrame->PresContext()->AppUnitsPerDevPixel());
- uint8_t clip = mBackgroundStyle->mImage.mLayers[0].mClip;
- if (clip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ StyleGeometryBox clip = mBackgroundStyle->mImage.mLayers[0].mClip;
+ if (clip == StyleGeometryBox::Text) {
if (!GenerateAndPushTextMask(mFrame, aCtx, mBackgroundRect, aBuilder)) {
return;
}
@@ -3618,7 +3618,7 @@ nsDisplayBackgroundColor::GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
const nsStyleImageLayers::Layer& bottomLayer = mBackgroundStyle->BottomLayer();
- if (bottomLayer.mClip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (bottomLayer.mClip == StyleGeometryBox::Text) {
return nsRegion();
}
diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h
index 9603a95b81..c9f773f5b6 100644
--- a/layout/base/nsDisplayList.h
+++ b/layout/base/nsDisplayList.h
@@ -2713,6 +2713,8 @@ private:
*/
class nsDisplayBackgroundImage : public nsDisplayImageContainer {
public:
+ typedef mozilla::StyleGeometryBox StyleGeometryBox;
+
/**
* aLayer signifies which background layer this item represents.
* aIsThemed should be the value of aFrame->IsThemed.
@@ -2790,8 +2792,10 @@ public:
virtual already_AddRefed<imgIContainer> GetImage() override;
virtual nsRect GetDestRect() override;
- static nsRegion GetInsideClipRegion(nsDisplayItem* aItem, uint8_t aClip,
- const nsRect& aRect, const nsRect& aBackgroundRect);
+ static nsRegion GetInsideClipRegion(nsDisplayItem* aItem,
+ StyleGeometryBox aClip,
+ const nsRect& aRect,
+ const nsRect& aBackgroundRect);
virtual bool ShouldFixToViewport(nsDisplayListBuilder* aBuilder) override;
diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
index 19200d5a72..07befdc812 100644
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -117,6 +117,7 @@
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "RegionBuilder.h"
+#include "SVGSVGElement.h"
#ifdef MOZ_XUL
#include "nsXULPopupManager.h"
@@ -2680,6 +2681,10 @@ nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(nsIFrame* aFrame)
nsIFrame*
nsLayoutUtils::FindNearestCommonAncestorFrame(nsIFrame* aFrame1, nsIFrame* aFrame2)
{
+ if (!aFrame1 || !aFrame2) {
+ return nullptr;
+ }
+
AutoTArray<nsIFrame*,100> ancestors1;
AutoTArray<nsIFrame*,100> ancestors2;
nsIFrame* commonAncestor = nullptr;
@@ -6935,7 +6940,7 @@ nsLayoutUtils::GetFrameTransparency(nsIFrame* aBackgroundFrame,
const nsStyleBackground* bg = bgSC->StyleBackground();
if (NS_GET_A(bg->mBackgroundColor) < 255 ||
// bottom layer's clip is used for the color
- bg->BottomLayer().mClip != NS_STYLE_IMAGELAYER_CLIP_BORDER)
+ bg->BottomLayer().mClip != StyleGeometryBox::Border)
return eTransparencyTransparent;
return eTransparencyOpaque;
}
@@ -9293,3 +9298,127 @@ nsLayoutUtils::IsInvisibleBreak(nsINode* aNode, nsIFrame** aNextLineFrame)
return lineNonEmpty;
}
+
+static nsRect
+ComputeSVGReferenceRect(nsIFrame* aFrame,
+ StyleGeometryBox aGeometryBox)
+{
+ MOZ_ASSERT(aFrame->GetContent()->IsSVGElement());
+ nsRect r;
+
+ // For SVG elements without associated CSS layout box, the used value for
+ // content-box, padding-box, border-box and margin-box is fill-box.
+ switch (aGeometryBox) {
+ case StyleGeometryBox::Stroke: {
+ // XXX Bug 1299876
+ // The size of srtoke-box is not correct if this graphic element has
+ // specific stroke-linejoin or stroke-linecap.
+ gfxRect bbox = nsSVGUtils::GetBBox(aFrame,
+ nsSVGUtils::eBBoxIncludeFill | nsSVGUtils::eBBoxIncludeStroke);
+ r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
+ nsPresContext::AppUnitsPerCSSPixel());
+ break;
+ }
+ case StyleGeometryBox::View: {
+ nsIContent* content = aFrame->GetContent();
+ nsSVGElement* element = static_cast<nsSVGElement*>(content);
+ SVGSVGElement* svgElement = element->GetCtx();
+ MOZ_ASSERT(svgElement);
+
+ if (svgElement && svgElement->HasViewBoxRect()) {
+ // If a ‘viewBox‘ attribute is specified for the SVG viewport creating
+ // element:
+ // 1. The reference box is positioned at the origin of the coordinate
+ // system established by the ‘viewBox‘ attribute.
+ // 2. The dimension of the reference box is set to the width and height
+ // values of the ‘viewBox‘ attribute.
+ nsSVGViewBox* viewBox = svgElement->GetViewBox();
+ const nsSVGViewBoxRect& value = viewBox->GetAnimValue();
+ r = nsRect(nsPresContext::CSSPixelsToAppUnits(value.x),
+ nsPresContext::CSSPixelsToAppUnits(value.y),
+ nsPresContext::CSSPixelsToAppUnits(value.width),
+ nsPresContext::CSSPixelsToAppUnits(value.height));
+ } else {
+ // No viewBox is specified, uses the nearest SVG viewport as reference
+ // box.
+ svgFloatSize viewportSize = svgElement->GetViewportSize();
+ r = nsRect(0, 0,
+ nsPresContext::CSSPixelsToAppUnits(viewportSize.width),
+ nsPresContext::CSSPixelsToAppUnits(viewportSize.height));
+ }
+
+ break;
+ }
+ case StyleGeometryBox::NoBox:
+ case StyleGeometryBox::Border:
+ case StyleGeometryBox::Content:
+ case StyleGeometryBox::Padding:
+ case StyleGeometryBox::Margin:
+ case StyleGeometryBox::Fill: {
+ gfxRect bbox = nsSVGUtils::GetBBox(aFrame,
+ nsSVGUtils::eBBoxIncludeFill);
+ r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
+ nsPresContext::AppUnitsPerCSSPixel());
+ break;
+ }
+ default:{
+ MOZ_ASSERT_UNREACHABLE("unknown StyleGeometryBox type");
+ gfxRect bbox = nsSVGUtils::GetBBox(aFrame,
+ nsSVGUtils::eBBoxIncludeFill);
+ r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
+ nsPresContext::AppUnitsPerCSSPixel());
+ break;
+ }
+ }
+
+ return r;
+}
+
+static nsRect
+ComputeHTMLReferenceRect(nsIFrame* aFrame,
+ StyleGeometryBox aGeometryBox)
+{
+ nsRect r;
+
+ // For elements with associated CSS layout box, the used value for fill-box,
+ // stroke-box and view-box is border-box.
+ switch (aGeometryBox) {
+ case StyleGeometryBox::Content:
+ r = aFrame->GetContentRectRelativeToSelf();
+ break;
+ case StyleGeometryBox::Padding:
+ r = aFrame->GetPaddingRectRelativeToSelf();
+ break;
+ case StyleGeometryBox::Margin:
+ r = aFrame->GetMarginRectRelativeToSelf();
+ break;
+ case StyleGeometryBox::NoBox:
+ case StyleGeometryBox::Border:
+ case StyleGeometryBox::Fill:
+ case StyleGeometryBox::Stroke:
+ case StyleGeometryBox::View:
+ r = aFrame->GetRectRelativeToSelf();
+ break;
+ default:
+ MOZ_ASSERT_UNREACHABLE("unknown StyleGeometryBox type");
+ r = aFrame->GetRectRelativeToSelf();
+ break;
+ }
+
+ return r;
+}
+
+/* static */ nsRect
+nsLayoutUtils::ComputeGeometryBox(nsIFrame* aFrame,
+ StyleGeometryBox aGeometryBox)
+{
+ // We use ComputeSVGReferenceRect for all SVG elements, except <svg>
+ // element, which does have an associated CSS layout box. In this case we
+ // should still use ComputeHTMLReferenceRect for region computing.
+ nsRect r = aFrame->IsFrameOfType(nsIFrame::eSVG) &&
+ (aFrame->GetType() != nsGkAtoms::svgOuterSVGFrame)
+ ? ComputeSVGReferenceRect(aFrame, aGeometryBox)
+ : ComputeHTMLReferenceRect(aFrame, aGeometryBox);
+
+ return r;
+}
diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h
index 97fc410b0a..0a82dbf6a5 100644
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -30,6 +30,7 @@
#include "mozilla/ReflowOutput.h"
#include "ImageContainer.h"
#include "gfx2DGlue.h"
+#include "nsStyleConsts.h"
#include <limits>
#include <algorithm>
@@ -152,6 +153,7 @@ public:
typedef mozilla::CSSRect CSSRect;
typedef mozilla::ScreenMargin ScreenMargin;
typedef mozilla::LayoutDeviceIntSize LayoutDeviceIntSize;
+ typedef mozilla::StyleGeometryBox StyleGeometryBox;
/**
* Finds previously assigned ViewID for the given content element, if any.
@@ -1437,13 +1439,14 @@ public:
/**
* This function increases an initial intrinsic size, 'aCurrent', according
* to the given 'aPercent', such that the size-increase makes up exactly
- * 'aPercent' percent of the returned value. If 'aPercent' is less than
- * or equal to zero the original 'aCurrent' value is returned. If 'aPercent'
- * is greater than or equal to 1.0 the value nscoord_MAX is returned.
+ * 'aPercent' percent of the returned value. If 'aPercent' or 'aCurrent' are
+ * less than or equal to zero the original 'aCurrent' value is returned.
+ * If 'aPercent' is greater than or equal to 1.0 the value nscoord_MAX is
+ * returned.
*/
static nscoord AddPercents(nscoord aCurrent, float aPercent)
{
- if (aPercent > 0.0f) {
+ if (aPercent > 0.0f && aCurrent > 0) {
return MOZ_UNLIKELY(aPercent >= 1.0f) ? nscoord_MAX
: NSToCoordRound(float(aCurrent) / (1.0f - aPercent));
}
@@ -2870,6 +2873,9 @@ public:
*/
static bool IsInvisibleBreak(nsINode* aNode, nsIFrame** aNextLineFrame = nullptr);
+ static nsRect ComputeGeometryBox(nsIFrame* aFrame,
+ StyleGeometryBox aGeometryBox);
+
private:
static uint32_t sFontSizeInflationEmPerLine;
static uint32_t sFontSizeInflationMinTwips;
diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
index 969ebc9621..5dfbb8dba6 100644
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -7296,11 +7296,11 @@ PresShell::HandleEvent(nsIFrame* aFrame,
return NS_OK;
}
- nsIContent* capturingContent = ((aEvent->mClass == ePointerEventClass ||
- aEvent->mClass == eWheelEventClass ||
- aEvent->HasMouseEventMessage())
- ? GetCapturingContent()
- : nullptr);
+ nsCOMPtr<nsIContent> capturingContent = ((aEvent->mClass == ePointerEventClass ||
+ aEvent->mClass == eWheelEventClass ||
+ aEvent->HasMouseEventMessage())
+ ? GetCapturingContent()
+ : nullptr);
nsCOMPtr<nsIDocument> retargetEventDoc;
if (!aDontRetargetEvents) {
diff --git a/layout/generic/nsAbsoluteContainingBlock.cpp b/layout/generic/nsAbsoluteContainingBlock.cpp
index 7c48aae92e..e3c847d01b 100644
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -409,14 +409,30 @@ OffsetToAlignedStaticPos(const ReflowInput& aKidReflowInput,
? GetOrthogonalAxis(aAbsPosCBAxis)
: aAbsPosCBAxis);
+ const bool placeholderContainerIsContainingBlock =
+ aPlaceholderContainer == aKidReflowInput.mCBReflowInput->mFrame;
+
nsIAtom* parentType = aPlaceholderContainer->GetType();
LogicalSize alignAreaSize(pcWM);
if (parentType == nsGkAtoms::flexContainerFrame) {
- // The alignment container is the flex container's content box:
- alignAreaSize = aPlaceholderContainer->GetLogicalSize(pcWM);
- LogicalMargin pcBorderPadding =
- aPlaceholderContainer->GetLogicalUsedBorderAndPadding(pcWM);
- alignAreaSize -= pcBorderPadding.Size(pcWM);
+ // We store the frame rect in FinishAndStoreOverflow, which runs _after_
+ // reflowing the absolute frames, so handle the special case of the frame
+ // being the actual containing block here, by getting the size from
+ // aAbsPosCBSize.
+ //
+ // The alignment container is the flex container's content box.
+ if (placeholderContainerIsContainingBlock) {
+ alignAreaSize = aAbsPosCBSize.ConvertTo(pcWM, aAbsPosCBWM);
+ // aAbsPosCBSize is the padding-box, so substract the padding to get the
+ // content box.
+ alignAreaSize -=
+ aPlaceholderContainer->GetLogicalUsedPadding(pcWM).Size(pcWM);
+ } else {
+ alignAreaSize = aPlaceholderContainer->GetLogicalSize(pcWM);
+ LogicalMargin pcBorderPadding =
+ aPlaceholderContainer->GetLogicalUsedBorderAndPadding(pcWM);
+ alignAreaSize -= pcBorderPadding.Size(pcWM);
+ }
} else if (parentType == nsGkAtoms::gridContainerFrame) {
// This abspos elem's parent is a grid container. Per CSS Grid 10.1 & 10.2:
// - If the grid container *also* generates the abspos containing block (a
@@ -424,7 +440,7 @@ OffsetToAlignedStaticPos(const ReflowInput& aKidReflowInput,
// the alignment container, too. (And its size is aAbsPosCBSize.)
// - Otherwise, we use the grid's padding box as the alignment container.
// https://drafts.csswg.org/css-grid/#static-position
- if (aPlaceholderContainer == aKidReflowInput.mCBReflowInput->mFrame) {
+ if (placeholderContainerIsContainingBlock) {
// The alignment container is the grid area that we're using as the
// absolute containing block.
alignAreaSize = aAbsPosCBSize.ConvertTo(pcWM, aAbsPosCBWM);
diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h
index 8f42b9e93f..962279df6b 100644
--- a/layout/generic/nsLineBox.h
+++ b/layout/generic/nsLineBox.h
@@ -857,29 +857,47 @@ class nsLineList_iterator {
return --copy;
}
- // Passing by value rather than by reference and reference to const
- // to keep AIX happy.
- bool operator==(const iterator_self_type aOther) const
+ bool operator==(const iterator_self_type& aOther) const
{
MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent == aOther.mCurrent;
}
- bool operator!=(const iterator_self_type aOther) const
+ bool operator!=(const iterator_self_type& aOther) const
{
MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent != aOther.mCurrent;
}
- bool operator==(const iterator_self_type aOther)
+ bool operator==(const iterator_self_type& aOther)
{
MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent == aOther.mCurrent;
}
- bool operator!=(const iterator_self_type aOther)
+ bool operator!=(const iterator_self_type& aOther)
{
MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent != aOther.mCurrent;
}
-
+ bool operator==(iterator_self_type& aOther) const
+ {
+ MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent == aOther.mCurrent;
+ }
+ bool operator!=(iterator_self_type& aOther) const
+ {
+ MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent != aOther.mCurrent;
+ }
+ bool operator==(iterator_self_type& aOther)
+ {
+ MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent == aOther.mCurrent;
+ }
+ bool operator!=(iterator_self_type& aOther)
+ {
+ MOZ_ASSERT(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent != aOther.mCurrent;
+ }
+
private:
link_type *mCurrent;
#ifdef DEBUG
@@ -992,24 +1010,42 @@ class nsLineList_reverse_iterator {
}
#endif /* !__MWERKS__ */
- // Passing by value rather than by reference and reference to const
- // to keep AIX happy.
- bool operator==(const iterator_self_type aOther) const
+ bool operator==(const iterator_self_type& aOther) const
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent == aOther.mCurrent;
}
- bool operator!=(const iterator_self_type aOther) const
+ bool operator!=(const iterator_self_type& aOther) const
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent != aOther.mCurrent;
}
- bool operator==(const iterator_self_type aOther)
+ bool operator==(const iterator_self_type& aOther)
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent == aOther.mCurrent;
}
- bool operator!=(const iterator_self_type aOther)
+ bool operator!=(const iterator_self_type& aOther)
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent != aOther.mCurrent;
+ }
+ bool operator==(iterator_self_type& aOther) const
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent == aOther.mCurrent;
+ }
+ bool operator!=(iterator_self_type& aOther) const
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent != aOther.mCurrent;
+ }
+ bool operator==(iterator_self_type& aOther)
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent == aOther.mCurrent;
+ }
+ bool operator!=(iterator_self_type& aOther)
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent != aOther.mCurrent;
@@ -1126,24 +1162,42 @@ class nsLineList_const_iterator {
return --copy;
}
- // Passing by value rather than by reference and reference to const
- // to keep AIX happy.
- bool operator==(const iterator_self_type aOther) const
+ bool operator==(const iterator_self_type& aOther) const
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent == aOther.mCurrent;
}
- bool operator!=(const iterator_self_type aOther) const
+ bool operator!=(const iterator_self_type& aOther) const
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent != aOther.mCurrent;
}
- bool operator==(const iterator_self_type aOther)
+ bool operator==(const iterator_self_type& aOther)
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent == aOther.mCurrent;
}
- bool operator!=(const iterator_self_type aOther)
+ bool operator!=(const iterator_self_type& aOther)
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent != aOther.mCurrent;
+ }
+ bool operator==(iterator_self_type& aOther) const
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent == aOther.mCurrent;
+ }
+ bool operator!=(iterator_self_type& aOther) const
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent != aOther.mCurrent;
+ }
+ bool operator==(iterator_self_type& aOther)
+ {
+ NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
+ return mCurrent == aOther.mCurrent;
+ }
+ bool operator!=(iterator_self_type& aOther)
{
NS_ASSERTION(mListLink == aOther.mListLink, "comparing iterators over different lists");
return mCurrent != aOther.mCurrent;
diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp
index ec0fba3087..ff75ab85dc 100644
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -3544,7 +3544,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Selection)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAnchorFocusRange)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFrameSelection)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mSelectionListeners)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(Selection)
diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp
index fa31443fdd..3288d3f2e4 100644
--- a/layout/generic/nsTextFrame.cpp
+++ b/layout/generic/nsTextFrame.cpp
@@ -6715,7 +6715,7 @@ ShouldDrawSelection(const nsIFrame* aFrame)
const nsStyleBackground* bg = aFrame->StyleContext()->StyleBackground();
const nsStyleImageLayers& layers = bg->mImage;
NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT(i, layers) {
- if (layers.mLayers[i].mClip == NS_STYLE_IMAGELAYER_CLIP_TEXT) {
+ if (layers.mLayers[i].mClip == StyleGeometryBox::Text) {
return false;
}
}
diff --git a/layout/inspector/inDOMUtils.cpp b/layout/inspector/inDOMUtils.cpp
index 9f1dcaad3f..e212e20df0 100644
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -784,12 +784,10 @@ PropertySupportsVariant(nsCSSPropertyID aPropertyID, uint32_t aVariant)
case eCSSProperty_background_position_x:
case eCSSProperty_background_position_y:
case eCSSProperty_background_size:
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
case eCSSProperty_mask_position:
case eCSSProperty_mask_position_x:
case eCSSProperty_mask_position_y:
case eCSSProperty_mask_size:
-#endif
case eCSSProperty_grid_auto_columns:
case eCSSProperty_grid_auto_rows:
case eCSSProperty_grid_template_columns:
diff --git a/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001-ref.html b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001-ref.html
new file mode 100644
index 0000000000..08eec8691b
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CSS Test Reference</title>
+<meta charset="utf-8">
+<link rel="author" title="Emilio Cobos Ãlvarez" href="mailto:emilio@crisal.io">
+<style>
+.parent {
+ position: fixed;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 200px;
+ height: 200px;
+ background: yellow;
+}
+
+.child {
+ position: absolute;
+ left: 50px;
+ top: 50px;
+ width: 100px;
+ height: 100px;
+ background: green;
+}
+</style>
+</head><body><div class="parent"><div class="child"></div></div>
+</body></html> \ No newline at end of file
diff --git a/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001.html b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001.html
new file mode 100644
index 0000000000..5f623cb849
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CSS Test: Absolutely positioned children of flex container with CSS align</title>
+<meta charset="utf-8">
+<link rel="help" href="https://drafts.csswg.org/css-flexbox/#abspos-items">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1386654">
+<link rel="match" href="https://hg.mozilla.org/mozilla-central/raw-file/6538de3b6137/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-001-ref.html">
+<link rel="author" title="Emilio Cobos Ãlvarez" href="mailto:emilio@crisal.io">
+<style>
+.parent {
+ position: fixed;
+ top: 0;
+ left: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 200px;
+ height: 200px;
+ background: yellow;
+}
+
+.child {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+}
+</style>
+</head><body><div class="parent"><div class="child"></div></div>
+</body></html> \ No newline at end of file
diff --git a/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002-ref.html b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002-ref.html
new file mode 100644
index 0000000000..df730047bb
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CSS Test Reference</title>
+<meta charset="utf-8">
+<link rel="author" title="Emilio Cobos Ãlvarez" href="mailto:emilio@crisal.io">
+<style>
+.parent {
+ position: fixed;
+ top: 0;
+ left: 0;
+ display: block;
+ width: 200px;
+ height: 200px;
+ background: yellow;
+}
+
+.child {
+ position: absolute;
+ left: 60px;
+ top: 60px;
+ width: 100px;
+ height: 100px;
+ background: green;
+}
+</style>
+</head><body><div class="parent"><div class="child"></div></div>
+</body></html> \ No newline at end of file
diff --git a/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002.html b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002.html
new file mode 100644
index 0000000000..9e89c5ad0e
--- /dev/null
+++ b/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>CSS Test: Absolutely positioned children of flex container with CSS align</title>
+<meta charset="utf-8">
+<link rel="help" href="https://drafts.csswg.org/css-flexbox/#abspos-items">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1386654">
+<link rel="match" href="https://hg.mozilla.org/mozilla-central/raw-file/6538de3b6137/layout/reftests/w3c-css/submitted/flexbox/position-absolute-containing-block-002-ref.html">
+<link rel="author" title="Emilio Cobos Ãlvarez" href="mailto:emilio@crisal.io">
+<style>
+.parent {
+ position: fixed;
+ top: 0;
+ left: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: 180px;
+ height: 180px;
+
+ /* Expand the background area to 200px, without touching the content-box,
+ which is what flex absolute children should be aligned relative to. */
+ border-top: 5px solid yellow;
+ padding-top: 15px;
+ border-left: 5px solid yellow;
+ padding-left: 15px;
+
+ background: yellow;
+}
+
+.child {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: green;
+}
+</style>
+</head><body><div class="parent"><div class="child"></div></div>
+</body></html> \ No newline at end of file
diff --git a/layout/reftests/w3c-css/submitted/flexbox/reftest.list b/layout/reftests/w3c-css/submitted/flexbox/reftest.list
index fd8bfccc90..3df75aee6d 100644
--- a/layout/reftests/w3c-css/submitted/flexbox/reftest.list
+++ b/layout/reftests/w3c-css/submitted/flexbox/reftest.list
@@ -211,3 +211,7 @@ fails == flexbox-min-height-auto-002b.html flexbox-min-height-auto-002-ref.html
== flexbox-single-line-clamp-1.html flexbox-single-line-clamp-1-ref.html
== flexbox-single-line-clamp-2.html flexbox-single-line-clamp-2-ref.html
== flexbox-single-line-clamp-3.html flexbox-single-line-clamp-3-ref.html
+
+# Flexbox as an absolute containing block.
+== position-absolute-containing-block-001.html position-absolute-containing-block-001-ref.html
+== position-absolute-containing-block-002.html position-absolute-containing-block-002-ref.html
diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp
index c67f6b2a2e..b2de159ed3 100644
--- a/layout/style/Declaration.cpp
+++ b/layout/style/Declaration.cpp
@@ -395,28 +395,25 @@ Declaration::GetImageLayerValue(
origin->mValue.GetUnit() == eCSSUnit_Enumerated,
"should not have inherit/initial within list");
- int32_t originDefaultValue =
+ StyleGeometryBox originDefaultValue =
(aTable == nsStyleImageLayers::kBackgroundLayerTable)
- ? NS_STYLE_IMAGELAYER_ORIGIN_PADDING : NS_STYLE_IMAGELAYER_ORIGIN_BORDER;
- if (clip->mValue.GetIntValue() != NS_STYLE_IMAGELAYER_CLIP_BORDER ||
- origin->mValue.GetIntValue() != originDefaultValue) {
+ ? StyleGeometryBox::Padding : StyleGeometryBox::Border;
+ if (static_cast<StyleGeometryBox>(clip->mValue.GetIntValue()) !=
+ StyleGeometryBox::Border ||
+ static_cast<StyleGeometryBox>(origin->mValue.GetIntValue()) !=
+ originDefaultValue) {
#ifdef DEBUG
- for (size_t i = 0; nsCSSProps::kImageLayerOriginKTable[i].mValue != -1; i++) {
+ const nsCSSProps::KTableEntry* originTable =
+ nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::origin]];
+ const nsCSSProps::KTableEntry* clipTable =
+ nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::clip]];
+ for (size_t i = 0; originTable[i].mValue != -1; i++) {
// For each keyword & value in kOriginKTable, ensure that
// kBackgroundKTable has a matching entry at the same position.
- MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mKeyword ==
- nsCSSProps::kBackgroundClipKTable[i].mKeyword);
- MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mValue ==
- nsCSSProps::kBackgroundClipKTable[i].mValue);
+ MOZ_ASSERT(originTable[i].mKeyword == clipTable[i].mKeyword);
+ MOZ_ASSERT(originTable[i].mValue == clipTable[i].mValue);
}
#endif
- static_assert(NS_STYLE_IMAGELAYER_CLIP_BORDER ==
- NS_STYLE_IMAGELAYER_ORIGIN_BORDER &&
- NS_STYLE_IMAGELAYER_CLIP_PADDING ==
- NS_STYLE_IMAGELAYER_ORIGIN_PADDING &&
- NS_STYLE_IMAGELAYER_CLIP_CONTENT ==
- NS_STYLE_IMAGELAYER_ORIGIN_CONTENT,
- "mask-clip and mask-origin style constants must agree");
aValue.Append(char16_t(' '));
origin->mValue.AppendToString(aTable[nsStyleImageLayers::origin], aValue,
aSerialization);
@@ -462,11 +459,7 @@ Declaration::GetImageLayerValue(
}
// This layer is an mask layer
} else {
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
MOZ_ASSERT(aTable == nsStyleImageLayers::kMaskLayerTable);
-#else
- MOZ_ASSERT_UNREACHABLE("Should never get here when mask-as-shorthand is disable");
-#endif
if (repeat || positionX || positionY || clip || origin || size ||
composite || mode) {
// Uneven length lists, so can't be serialized as shorthand.
@@ -487,11 +480,7 @@ Declaration::GetImageLayerValue(
}
// This layer is an mask layer
} else {
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
MOZ_ASSERT(aTable == nsStyleImageLayers::kMaskLayerTable);
-#else
- MOZ_ASSERT_UNREACHABLE("Should never get here when mask-as-shorthand is disable");
-#endif
if (!repeat || !positionX || !positionY || !clip || !origin || !size ||
!composite || !mode) {
// Uneven length lists, so can't be serialized as shorthand.
@@ -817,7 +806,6 @@ Declaration::GetPropertyValueInternal(
nsStyleImageLayers::kBackgroundLayerTable);
break;
}
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
case eCSSProperty_mask: {
GetImageLayerValue(data, aValue, aSerialization,
nsStyleImageLayers::kMaskLayerTable);
@@ -828,7 +816,6 @@ Declaration::GetPropertyValueInternal(
nsStyleImageLayers::kMaskLayerTable);
break;
}
-#endif
case eCSSProperty_font: {
// systemFont might not be present; other values are guaranteed to be
// available based on the shorthand check at the beginning of the
diff --git a/layout/style/FontFace.cpp b/layout/style/FontFace.cpp
index 4558ab1a24..ab67811490 100644
--- a/layout/style/FontFace.cpp
+++ b/layout/style/FontFace.cpp
@@ -75,7 +75,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(FontFace)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRule)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFontFaceSet)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOtherFontFaceSets)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(FontFace)
diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp
index a1a0fcfd90..0ce337e29f 100644
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1677,10 +1677,6 @@ Loader::LoadSheet(SheetLoadData* aLoadData,
nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
if (httpChannel) {
- // Send a minimal Accept header for text/css
- httpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
- NS_LITERAL_CSTRING("text/css,*/*;q=0.1"),
- false);
nsCOMPtr<nsIURI> referrerURI = aLoadData->GetReferrerURI();
if (referrerURI)
httpChannel->SetReferrerWithPolicy(referrerURI,
diff --git a/layout/style/MediaQueryList.cpp b/layout/style/MediaQueryList.cpp
index 069e049c46..db3781b768 100644
--- a/layout/style/MediaQueryList.cpp
+++ b/layout/style/MediaQueryList.cpp
@@ -39,7 +39,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(MediaQueryList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaQueryList)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mCallbacks)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MediaQueryList)
diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp
index eb34c3d832..a0f52b4ea1 100644
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -4255,7 +4255,6 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty,
}
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
case eCSSProperty_mask_position_x: {
const nsStyleImageLayers& layers =
static_cast<const nsStyleSVGReset*>(styleStruct)->mMask;
@@ -4269,21 +4268,18 @@ StyleAnimationValue::ExtractComputedValue(nsCSSPropertyID aProperty,
break;
}
-#endif
case eCSSProperty_background_size: {
const nsStyleImageLayers& layers =
static_cast<const nsStyleBackground*>(styleStruct)->mImage;
ExtractImageLayerSizePairList(layers, aComputedValue);
break;
}
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
case eCSSProperty_mask_size: {
const nsStyleImageLayers& layers =
static_cast<const nsStyleSVGReset*>(styleStruct)->mMask;
ExtractImageLayerSizePairList(layers, aComputedValue);
break;
}
-#endif
case eCSSProperty_clip_path: {
const nsStyleSVGReset* svgReset =
diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp
index 6aade88979..598cb7c74e 100644
--- a/layout/style/StyleRule.cpp
+++ b/layout/style/StyleRule.cpp
@@ -1275,10 +1275,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(DOMCSSStyleRule)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(DOMCSSStyleRule)
- // Just NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS here: that will call
- // into our Trace hook, where we do the right thing with declarations
- // already.
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMETHODIMP
diff --git a/layout/style/nsCSSDataBlock.cpp b/layout/style/nsCSSDataBlock.cpp
index fe2dc621a5..1dfdaed0ee 100644
--- a/layout/style/nsCSSDataBlock.cpp
+++ b/layout/style/nsCSSDataBlock.cpp
@@ -61,7 +61,6 @@ TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument,
MOZ_ASSERT(aDocument);
if (aValue.GetUnit() == eCSSUnit_URL) {
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
// The 'mask-image' property accepts local reference URIs.
// For example,
// mask-image: url(#mask_id); // refer to a SVG mask element, whose id is
@@ -94,7 +93,6 @@ TryToStartImageLoadOnValue(const nsCSSValue& aValue, nsIDocument* aDocument,
}
}
}
-#endif
aValue.StartImageLoad(aDocument);
if (aForTokenStream && aContext) {
CSSVariableImageTable::Add(aContext, aProperty,
diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h
index 94968faca3..34a46ffceb 100644
--- a/layout/style/nsCSSKeywordList.h
+++ b/layout/style/nsCSSKeywordList.h
@@ -405,6 +405,7 @@ CSS_KEY(n-resize, n_resize)
CSS_KEY(narrower, narrower)
CSS_KEY(ne-resize, ne_resize)
CSS_KEY(nesw-resize, nesw_resize)
+CSS_KEY(no-clip, no_clip)
CSS_KEY(no-close-quote, no_close_quote)
CSS_KEY(no-common-ligatures, no_common_ligatures)
CSS_KEY(no-contextual, no_contextual)
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index 736c66f87a..a8309314f8 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -12005,7 +12005,6 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
return ParsePaintOrder();
case eCSSProperty_scroll_snap_type:
return ParseScrollSnapType();
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
case eCSSProperty_mask:
return ParseImageLayers(nsStyleImageLayers::kMaskLayerTable);
case eCSSProperty_mask_repeat:
@@ -12018,7 +12017,6 @@ CSSParserImpl::ParsePropertyByFunction(nsCSSPropertyID aPropID)
aPropID == eCSSProperty_mask_position_x);
case eCSSProperty_mask_size:
return ParseImageLayerSize(eCSSProperty_mask_size);
-#endif
case eCSSProperty__webkit_text_stroke:
return ParseWebkitTextStroke();
case eCSSProperty_all:
@@ -12424,7 +12422,7 @@ CSSParserImpl::ParseImageLayersItem(
aState.mImage->mValue.SetNoneValue();
aState.mAttachment->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL,
eCSSUnit_Enumerated);
- aState.mClip->mValue.SetIntValue(NS_STYLE_IMAGELAYER_CLIP_BORDER,
+ aState.mClip->mValue.SetIntValue(StyleGeometryBox::Border,
eCSSUnit_Enumerated);
aState.mRepeat->mXValue.SetIntValue(NS_STYLE_IMAGELAYER_REPEAT_REPEAT,
@@ -12437,10 +12435,10 @@ CSSParserImpl::ParseImageLayersItem(
aState.mPositionY->mValue.SetArrayValue(positionYArr, eCSSUnit_Array);
if (eCSSProperty_mask == aTable[nsStyleImageLayers::shorthand]) {
- aState.mOrigin->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ORIGIN_BORDER,
+ aState.mOrigin->mValue.SetIntValue(StyleGeometryBox::Border,
eCSSUnit_Enumerated);
} else {
- aState.mOrigin->mValue.SetIntValue(NS_STYLE_IMAGELAYER_ORIGIN_PADDING,
+ aState.mOrigin->mValue.SetIntValue(StyleGeometryBox::Padding,
eCSSUnit_Enumerated);
}
positionXArr->Item(1).SetPercentValue(0.0f);
@@ -12462,6 +12460,8 @@ CSSParserImpl::ParseImageLayersItem(
haveMode = false,
haveSomething = false;
+ const KTableEntry* originTable =
+ nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::origin]];
while (GetToken(true)) {
nsCSSTokenType tt = mToken.mType;
UngetToken(); // ...but we'll still cheat and use mToken
@@ -12531,8 +12531,7 @@ CSSParserImpl::ParseImageLayersItem(
aState.mSize->mXValue = scratch.mXValue;
aState.mSize->mYValue = scratch.mYValue;
}
- } else if (nsCSSProps::FindKeyword(keyword,
- nsCSSProps::kImageLayerOriginKTable, dummy)) {
+ } else if (nsCSSProps::FindKeyword(keyword, originTable, dummy)) {
if (haveOrigin)
return false;
haveOrigin = true;
@@ -12547,23 +12546,15 @@ CSSParserImpl::ParseImageLayersItem(
// immediately following the first one (for background-origin).
#ifdef DEBUG
- for (size_t i = 0; nsCSSProps::kImageLayerOriginKTable[i].mValue != -1; i++) {
+ const KTableEntry* clipTable =
+ nsCSSProps::kKeywordTableTable[aTable[nsStyleImageLayers::clip]];
+ for (size_t i = 0; originTable[i].mValue != -1; i++) {
// For each keyword & value in kOriginKTable, ensure that
// kBackgroundKTable has a matching entry at the same position.
- MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mKeyword ==
- nsCSSProps::kBackgroundClipKTable[i].mKeyword);
- MOZ_ASSERT(nsCSSProps::kImageLayerOriginKTable[i].mValue ==
- nsCSSProps::kBackgroundClipKTable[i].mValue);
+ MOZ_ASSERT(originTable[i].mKeyword == clipTable[i].mKeyword);
+ MOZ_ASSERT(originTable[i].mValue == clipTable[i].mValue);
}
#endif
- static_assert(NS_STYLE_IMAGELAYER_CLIP_BORDER ==
- NS_STYLE_IMAGELAYER_ORIGIN_BORDER &&
- NS_STYLE_IMAGELAYER_CLIP_PADDING ==
- NS_STYLE_IMAGELAYER_ORIGIN_PADDING &&
- NS_STYLE_IMAGELAYER_CLIP_CONTENT ==
- NS_STYLE_IMAGELAYER_ORIGIN_CONTENT,
- "bg-clip and bg-origin style constants must agree");
-
CSSParseResult result =
ParseSingleValueProperty(aState.mClip->mValue,
aTable[nsStyleImageLayers::clip]);
diff --git a/layout/style/nsCSSPropAliasList.h b/layout/style/nsCSSPropAliasList.h
index 2699549ffc..f7938af9ed 100644
--- a/layout/style/nsCSSPropAliasList.h
+++ b/layout/style/nsCSSPropAliasList.h
@@ -453,7 +453,6 @@ CSS_PROP_ALIAS(-webkit-user-select,
WebkitUserSelect,
WEBKIT_PREFIX_PREF)
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
CSS_PROP_ALIAS(-webkit-mask,
mask,
WebkitMask,
@@ -494,5 +493,4 @@ CSS_PROP_ALIAS(-webkit-mask-size,
mask_size,
WebkitMaskSize,
WEBKIT_PREFIX_PREF)
-#endif
#undef WEBKIT_PREFIX_PREF
diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h
index b04921dcb5..2049f70e88 100644
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -564,7 +564,7 @@ CSS_PROP_BACKGROUND(
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
VARIANT_KEYWORD, // used by list parsing
- kImageLayerOriginKTable,
+ kBackgroundOriginKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
CSS_PROP_SHORTHAND(
@@ -2645,19 +2645,6 @@ CSS_PROP_SVG(
nullptr,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
-#ifndef MOZ_ENABLE_MASK_AS_SHORTHAND
-CSS_PROP_SVGRESET(
- mask,
- mask,
- Mask,
- CSS_PROPERTY_PARSE_VALUE |
- CSS_PROPERTY_CREATES_STACKING_CONTEXT,
- "",
- VARIANT_HUO,
- nullptr,
- CSS_PROP_NO_OFFSET,
- eStyleAnimType_Discrete)
-#else
CSS_PROP_SHORTHAND(
mask,
mask,
@@ -2672,7 +2659,7 @@ CSS_PROP_SVGRESET(
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
VARIANT_KEYWORD, // used by list parsing
- kImageLayerOriginKTable,
+ kMaskClipKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
CSS_PROP_SVGRESET(
@@ -2718,7 +2705,7 @@ CSS_PROP_SVGRESET(
CSS_PROPERTY_VALUE_LIST_USES_COMMAS,
"",
VARIANT_KEYWORD, // used by list parsing
- kImageLayerOriginKTable,
+ kMaskOriginKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
CSS_PROP_SHORTHAND(
@@ -2776,7 +2763,6 @@ CSS_PROP_SVGRESET(
kImageLayerSizeKTable,
CSS_PROP_NO_OFFSET,
eStyleAnimType_Custom)
-#endif // MOZ_ENABLE_MASK_AS_SHORTHAND
CSS_PROP_SVGRESET(
mask-type,
mask_type,
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index 9805eae14e..ac2978c277 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -932,33 +932,43 @@ const KTableEntry nsCSSProps::kImageLayerAttachmentKTable[] = {
{ eCSSKeyword_UNKNOWN, -1 }
};
-static_assert(NS_STYLE_IMAGELAYER_CLIP_BORDER == NS_STYLE_IMAGELAYER_ORIGIN_BORDER &&
- NS_STYLE_IMAGELAYER_CLIP_PADDING == NS_STYLE_IMAGELAYER_ORIGIN_PADDING &&
- NS_STYLE_IMAGELAYER_CLIP_CONTENT == NS_STYLE_IMAGELAYER_ORIGIN_CONTENT,
- "Except background-clip:text, all {background,mask}-clip and "
- "{background,mask}-origin style constants must agree");
-
-const KTableEntry nsCSSProps::kImageLayerOriginKTable[] = {
- { eCSSKeyword_border_box, NS_STYLE_IMAGELAYER_ORIGIN_BORDER },
- { eCSSKeyword_padding_box, NS_STYLE_IMAGELAYER_ORIGIN_PADDING },
- { eCSSKeyword_content_box, NS_STYLE_IMAGELAYER_ORIGIN_CONTENT },
+const KTableEntry nsCSSProps::kBackgroundOriginKTable[] = {
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
{ eCSSKeyword_UNKNOWN, -1 }
};
KTableEntry nsCSSProps::kBackgroundClipKTable[] = {
- { eCSSKeyword_border_box, NS_STYLE_IMAGELAYER_CLIP_BORDER },
- { eCSSKeyword_padding_box, NS_STYLE_IMAGELAYER_CLIP_PADDING },
- { eCSSKeyword_content_box, NS_STYLE_IMAGELAYER_CLIP_CONTENT },
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
// The next entry is controlled by the layout.css.background-clip-text.enabled
// pref.
- { eCSSKeyword_text, NS_STYLE_IMAGELAYER_CLIP_TEXT },
+ { eCSSKeyword_text, StyleGeometryBox::Text },
{ eCSSKeyword_UNKNOWN, -1 }
};
-static_assert(MOZ_ARRAY_LENGTH(nsCSSProps::kImageLayerOriginKTable) ==
- MOZ_ARRAY_LENGTH(nsCSSProps::kBackgroundClipKTable) - 1,
- "background-clip has one extra value, which is text, compared"
- "to {background,mask}-origin");
+const KTableEntry nsCSSProps::kMaskOriginKTable[] = {
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
+ { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
+ { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
+ { eCSSKeyword_view_box, StyleGeometryBox::View },
+ { eCSSKeyword_UNKNOWN, -1 }
+};
+
+const KTableEntry nsCSSProps::kMaskClipKTable[] = {
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
+ { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
+ { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
+ { eCSSKeyword_view_box, StyleGeometryBox::View },
+ { eCSSKeyword_no_clip, StyleGeometryBox::NoClip },
+ { eCSSKeyword_UNKNOWN, -1 }
+};
// Note: Don't change this table unless you update
// ParseImageLayerPosition!
@@ -2346,13 +2356,13 @@ const KTableEntry nsCSSProps::kFillRuleKTable[] = {
};
const KTableEntry nsCSSProps::kClipPathGeometryBoxKTable[] = {
- { eCSSKeyword_content_box, StyleClipPathGeometryBox::Content },
- { eCSSKeyword_padding_box, StyleClipPathGeometryBox::Padding },
- { eCSSKeyword_border_box, StyleClipPathGeometryBox::Border },
- { eCSSKeyword_margin_box, StyleClipPathGeometryBox::Margin },
- { eCSSKeyword_fill_box, StyleClipPathGeometryBox::Fill },
- { eCSSKeyword_stroke_box, StyleClipPathGeometryBox::Stroke },
- { eCSSKeyword_view_box, StyleClipPathGeometryBox::View },
+ { eCSSKeyword_content_box, StyleGeometryBox::Content },
+ { eCSSKeyword_padding_box, StyleGeometryBox::Padding },
+ { eCSSKeyword_border_box, StyleGeometryBox::Border },
+ { eCSSKeyword_margin_box, StyleGeometryBox::Margin },
+ { eCSSKeyword_fill_box, StyleGeometryBox::Fill },
+ { eCSSKeyword_stroke_box, StyleGeometryBox::Stroke },
+ { eCSSKeyword_view_box, StyleGeometryBox::View },
{ eCSSKeyword_UNKNOWN, -1 }
};
@@ -3051,7 +3061,6 @@ static const nsCSSPropertyID gScrollSnapTypeSubpropTable[] = {
eCSSProperty_scroll_snap_type_y,
eCSSProperty_UNKNOWN
};
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
static const nsCSSPropertyID gMaskSubpropTable[] = {
eCSSProperty_mask_image,
eCSSProperty_mask_repeat,
@@ -3069,7 +3078,6 @@ static const nsCSSPropertyID gMaskPositionSubpropTable[] = {
eCSSProperty_mask_position_y,
eCSSProperty_UNKNOWN
};
-#endif
// FIXME: mask-border tables should be added when we implement
// mask-border properties.
diff --git a/layout/style/nsCSSProps.h b/layout/style/nsCSSProps.h
index dfe35afd82..e67e1d41d1 100644
--- a/layout/style/nsCSSProps.h
+++ b/layout/style/nsCSSProps.h
@@ -717,6 +717,8 @@ public:
static const KTableEntry kTransformStyleKTable[];
static const KTableEntry kImageLayerAttachmentKTable[];
static const KTableEntry kImageLayerOriginKTable[];
+ static const KTableEntry kBackgroundOriginKTable[];
+ static const KTableEntry kMaskOriginKTable[];
static const KTableEntry kImageLayerPositionKTable[];
static const KTableEntry kImageLayerRepeatKTable[];
static const KTableEntry kImageLayerRepeatPartKTable[];
@@ -726,6 +728,7 @@ public:
// Not const because we modify its entries when the pref
// "layout.css.background-clip.text" changes:
static KTableEntry kBackgroundClipKTable[];
+ static const KTableEntry kMaskClipKTable[];
static const KTableEntry kBlendModeKTable[];
static const KTableEntry kBorderCollapseKTable[];
static const KTableEntry kBorderImageRepeatKTable[];
diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp
index a08d8af34e..4b90b6f0c0 100644
--- a/layout/style/nsCSSRules.cpp
+++ b/layout/style/nsCSSRules.cpp
@@ -1552,9 +1552,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsCSSFontFaceRule)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsCSSFontFaceRule)
- // NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS will call into our
- // Trace hook, where we do the right thing with declarations already.
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
// QueryInterface implementation for nsCSSFontFaceRule
diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp
index 4f8d3edf66..65c1d698c6 100644
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -74,6 +74,30 @@ NS_NewComputedDOMStyle(dom::Element* aElement, const nsAString& aPseudoElt,
return computedStyle.forget();
}
+static nsDOMCSSValueList*
+GetROCSSValueList(bool aCommaDelimited)
+{
+ return new nsDOMCSSValueList(aCommaDelimited, true);
+}
+
+template<typename T>
+already_AddRefed<CSSValue>
+GetBackgroundList(T nsStyleImageLayers::Layer::* aMember,
+ uint32_t nsStyleImageLayers::* aCount,
+ const nsStyleImageLayers& aLayers,
+ const KTableEntry aTable[])
+{
+ RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
+
+ for (uint32_t i = 0, i_end = aLayers.*aCount; i < i_end; ++i) {
+ RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
+ val->SetIdent(nsCSSProps::ValueToKeywordEnum(aLayers.mLayers[i].*aMember, aTable));
+ valueList->AppendCSSValue(val.forget());
+ }
+
+ return valueList.forget();
+}
+
/**
* An object that represents the ordered set of properties that are exposed on
* an nsComputedDOMStyle object and how their computed values can be obtained.
@@ -280,7 +304,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsComputedDOMStyle)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContent)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsComputedDOMStyle)
@@ -1803,24 +1826,6 @@ nsComputedDOMStyle::DoGetFontVariantPosition()
}
already_AddRefed<CSSValue>
-nsComputedDOMStyle::GetBackgroundList(uint8_t nsStyleImageLayers::Layer::* aMember,
- uint32_t nsStyleImageLayers::* aCount,
- const nsStyleImageLayers& aLayers,
- const KTableEntry aTable[])
-{
- RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(true);
-
- for (uint32_t i = 0, i_end = aLayers.*aCount; i < i_end; ++i) {
- RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
- val->SetIdent(nsCSSProps::ValueToKeywordEnum(aLayers.mLayers[i].*aMember,
- aTable));
- valueList->AppendCSSValue(val.forget());
- }
-
- return valueList.forget();
-}
-
-already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetBackgroundAttachment()
{
return GetBackgroundList(&nsStyleImageLayers::Layer::mAttachment,
@@ -2367,7 +2372,7 @@ nsComputedDOMStyle::DoGetBackgroundOrigin()
return GetBackgroundList(&nsStyleImageLayers::Layer::mOrigin,
&nsStyleImageLayers::mOriginCount,
StyleBackground()->mImage,
- nsCSSProps::kImageLayerOriginKTable);
+ nsCSSProps::kBackgroundOriginKTable);
}
void
@@ -5013,12 +5018,6 @@ nsComputedDOMStyle::DoGetTop()
return GetOffsetWidthFor(NS_SIDE_TOP);
}
-nsDOMCSSValueList*
-nsComputedDOMStyle::GetROCSSValueList(bool aCommaDelimited)
-{
- return new nsDOMCSSValueList(aCommaDelimited, true);
-}
-
already_AddRefed<CSSValue>
nsComputedDOMStyle::GetOffsetWidthFor(mozilla::css::Side aSide)
{
@@ -6180,8 +6179,8 @@ nsComputedDOMStyle::DoGetMask()
// need to support computed style for the cases where it used to be
// a longhand.
if (svg->mMask.mImageCount > 1 ||
- firstLayer.mClip != NS_STYLE_IMAGELAYER_CLIP_BORDER ||
- firstLayer.mOrigin != NS_STYLE_IMAGELAYER_ORIGIN_BORDER ||
+ firstLayer.mClip != StyleGeometryBox::Border ||
+ firstLayer.mOrigin != StyleGeometryBox::Border ||
firstLayer.mComposite != NS_STYLE_MASK_COMPOSITE_ADD ||
firstLayer.mMaskMode != NS_STYLE_MASK_MODE_MATCH_SOURCE ||
!nsStyleImageLayers::IsInitialPositionForLayerType(
@@ -6200,14 +6199,13 @@ nsComputedDOMStyle::DoGetMask()
return val.forget();
}
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetMaskClip()
{
return GetBackgroundList(&nsStyleImageLayers::Layer::mClip,
&nsStyleImageLayers::mClipCount,
StyleSVGReset()->mMask,
- nsCSSProps::kImageLayerOriginKTable);
+ nsCSSProps::kMaskClipKTable);
}
already_AddRefed<CSSValue>
@@ -6241,7 +6239,7 @@ nsComputedDOMStyle::DoGetMaskOrigin()
return GetBackgroundList(&nsStyleImageLayers::Layer::mOrigin,
&nsStyleImageLayers::mOriginCount,
StyleSVGReset()->mMask,
- nsCSSProps::kImageLayerOriginKTable);
+ nsCSSProps::kMaskOriginKTable);
}
already_AddRefed<CSSValue>
@@ -6278,7 +6276,6 @@ nsComputedDOMStyle::DoGetMaskSize()
const nsStyleImageLayers& layers = StyleSVGReset()->mMask;
return DoGetImageLayerSize(layers);
}
-#endif
already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetMaskType()
diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h
index 27e2086e92..77df71ec89 100644
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -53,6 +53,7 @@ private:
// Convenience typedefs:
typedef nsCSSProps::KTableEntry KTableEntry;
typedef mozilla::dom::CSSValue CSSValue;
+ typedef mozilla::StyleGeometryBox StyleGeometryBox;
public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
@@ -202,12 +203,6 @@ private:
const nscolor& aDefaultColor,
bool aIsBoxShadow);
- already_AddRefed<CSSValue> GetBackgroundList(
- uint8_t nsStyleImageLayers::Layer::* aMember,
- uint32_t nsStyleImageLayers::* aCount,
- const nsStyleImageLayers& aLayers,
- const KTableEntry aTable[]);
-
void GetCSSGradientString(const nsStyleGradient* aGradient,
nsAString& aString);
void GetImageRectString(nsIURI* aURI,
@@ -310,7 +305,6 @@ private:
/* Mask properties */
already_AddRefed<CSSValue> DoGetMask();
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
already_AddRefed<CSSValue> DoGetMaskImage();
already_AddRefed<CSSValue> DoGetMaskPosition();
already_AddRefed<CSSValue> DoGetMaskPositionX();
@@ -321,7 +315,7 @@ private:
already_AddRefed<CSSValue> DoGetMaskSize();
already_AddRefed<CSSValue> DoGetMaskMode();
already_AddRefed<CSSValue> DoGetMaskComposite();
-#endif
+
/* Padding properties */
already_AddRefed<CSSValue> DoGetPaddingTop();
already_AddRefed<CSSValue> DoGetPaddingBottom();
@@ -582,8 +576,6 @@ private:
/* Custom properties */
already_AddRefed<CSSValue> DoGetCustomProperty(const nsAString& aPropertyName);
- nsDOMCSSValueList* GetROCSSValueList(bool aCommaDelimited);
-
/* Helper functions */
void SetToRGBAColor(nsROCSSPrimitiveValue* aValue, nscolor aColor);
void SetValueFromComplexColor(nsROCSSPrimitiveValue* aValue,
diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h
index 1983208acc..825976b583 100644
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -332,7 +332,6 @@ COMPUTED_STYLE_PROP(marker_end, MarkerEnd)
COMPUTED_STYLE_PROP(marker_mid, MarkerMid)
COMPUTED_STYLE_PROP(marker_start, MarkerStart)
COMPUTED_STYLE_PROP(mask, Mask)
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
COMPUTED_STYLE_PROP(mask_clip, MaskClip)
COMPUTED_STYLE_PROP(mask_composite, MaskComposite)
COMPUTED_STYLE_PROP(mask_image, MaskImage)
@@ -343,7 +342,6 @@ COMPUTED_STYLE_PROP(mask_position_x, MaskPositionX)
COMPUTED_STYLE_PROP(mask_position_y, MaskPositionY)
COMPUTED_STYLE_PROP(mask_repeat, MaskRepeat)
COMPUTED_STYLE_PROP(mask_size, MaskSize)
-#endif
COMPUTED_STYLE_PROP(mask_type, MaskType)
COMPUTED_STYLE_PROP(paint_order, PaintOrder)
COMPUTED_STYLE_PROP(shape_rendering, ShapeRendering)
diff --git a/layout/style/nsROCSSPrimitiveValue.cpp b/layout/style/nsROCSSPrimitiveValue.cpp
index cbc715eb22..2721bd609d 100644
--- a/layout/style/nsROCSSPrimitiveValue.cpp
+++ b/layout/style/nsROCSSPrimitiveValue.cpp
@@ -52,7 +52,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsROCSSPrimitiveValue)
} else if (tmp->mType == CSS_RECT) {
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mValue.mRect)
}
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsROCSSPrimitiveValue)
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
index 9b9fc3948e..08400635b7 100644
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -22,6 +22,7 @@
#include "mozilla/Unused.h"
#include "mozilla/css/Declaration.h"
+#include "mozilla/TypeTraits.h"
#include "nsAlgorithm.h" // for clamped()
#include "nsRuleNode.h"
@@ -66,9 +67,6 @@
#define alloca _alloca
#endif
#endif
-#ifdef SOLARIS
-#include <alloca.h>
-#endif
using std::max;
using std::min;
@@ -6800,6 +6798,21 @@ struct BackgroundItemComputer<nsCSSValueList, RefPtr<css::URLValueData>>
}
};
+template <typename T>
+struct BackgroundItemComputer<nsCSSValueList, T>
+{
+ typedef typename EnableIf<IsEnum<T>::value, T>::Type ComputedType;
+
+ static void ComputeValue(nsStyleContext* aStyleContext,
+ const nsCSSValueList* aSpecifiedValue,
+ ComputedType& aComputedValue,
+ RuleNodeCacheConditions& aConditions)
+ {
+ aComputedValue =
+ static_cast<T>(aSpecifiedValue->mValue.GetIntValue());
+ }
+};
+
/* Helper function for ComputePositionValue.
* This function computes a single PositionCoord from two nsCSSValue objects,
* which represent an edge and an offset from that edge.
@@ -7353,7 +7366,7 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct,
bg->mImage.mLayers,
parentBG->mImage.mLayers,
&nsStyleImageLayers::Layer::mClip,
- uint8_t(NS_STYLE_IMAGELAYER_CLIP_BORDER),
+ StyleGeometryBox::Border,
parentBG->mImage.mClipCount,
bg->mImage.mClipCount, maxItemCount, rebuild, conditions);
@@ -7372,7 +7385,7 @@ nsRuleNode::ComputeBackgroundData(void* aStartStruct,
bg->mImage.mLayers,
parentBG->mImage.mLayers,
&nsStyleImageLayers::Layer::mOrigin,
- uint8_t(NS_STYLE_IMAGELAYER_ORIGIN_PADDING),
+ StyleGeometryBox::Padding,
parentBG->mImage.mOriginCount,
bg->mImage.mOriginCount, maxItemCount, rebuild,
conditions);
@@ -10005,7 +10018,6 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct,
parentSVGReset->mMaskType,
NS_STYLE_MASK_TYPE_LUMINANCE);
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
uint32_t maxItemCount = 1;
bool rebuild = false;
@@ -10043,7 +10055,7 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct,
svgReset->mMask.mLayers,
parentSVGReset->mMask.mLayers,
&nsStyleImageLayers::Layer::mClip,
- uint8_t(NS_STYLE_IMAGELAYER_CLIP_BORDER),
+ StyleGeometryBox::Border,
parentSVGReset->mMask.mClipCount,
svgReset->mMask.mClipCount, maxItemCount, rebuild,
conditions);
@@ -10053,7 +10065,7 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct,
svgReset->mMask.mLayers,
parentSVGReset->mMask.mLayers,
&nsStyleImageLayers::Layer::mOrigin,
- uint8_t(NS_STYLE_IMAGELAYER_ORIGIN_BORDER),
+ StyleGeometryBox::Border,
parentSVGReset->mMask.mOriginCount,
svgReset->mMask.mOriginCount, maxItemCount, rebuild,
conditions);
@@ -10113,21 +10125,6 @@ nsRuleNode::ComputeSVGResetData(void* aStartStruct,
if (rebuild) {
FillAllBackgroundLists(svgReset->mMask, maxItemCount);
}
-#else
- // mask: none | <url>
- const nsCSSValue* maskValue = aRuleData->ValueForMask();
- if (eCSSUnit_URL == maskValue->GetUnit()) {
- svgReset->mMask.mLayers[0].mSourceURI = maskValue->GetURLStructValue();
- } else if (eCSSUnit_None == maskValue->GetUnit() ||
- eCSSUnit_Initial == maskValue->GetUnit() ||
- eCSSUnit_Unset == maskValue->GetUnit()) {
- svgReset->mMask.mLayers[0].mSourceURI = nullptr;
- } else if (eCSSUnit_Inherit == maskValue->GetUnit()) {
- conditions.SetUncacheable();
- svgReset->mMask.mLayers[0].mSourceURI =
- parentSVGReset->mMask.mLayers[0].mSourceURI;
- }
-#endif
COMPUTE_END_RESET(SVGReset, svgReset)
}
diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h
index be588113e9..6d207aec9b 100644
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -134,16 +134,35 @@ enum class StyleClear : uint8_t {
Max = 13 // Max = (Both | Line)
};
-// clip-path geometry box
-enum class StyleClipPathGeometryBox : uint8_t {
- NoBox,
+// Define geometry box for clip-path's reference-box, background-clip,
+// background-origin, mask-clip and mask-origin.
+enum class StyleGeometryBox : uint8_t {
Content,
Padding,
Border,
- Margin,
- Fill,
- Stroke,
- View,
+ Margin, // XXX Bug 1260094 comment 9.
+ // Although margin-box is required by mask-origin and mask-clip, we
+ // do not implement that due to lack of support in other browsers.
+ // clip-path reference-box only.
+ Fill, // mask-clip, mask-origin and clip-path reference-box only.
+ Stroke, // mask-clip, mask-origin and clip-path reference-box only.
+ View, // mask-clip, mask-origin and clip-path reference-box only.
+ NoClip, // mask-clip only.
+ Text, // background-clip only.
+ NoBox, // Depending on which kind of element this style value applied on,
+ // the default value of a reference-box can be different.
+ // For an HTML element, the default value of reference-box is
+ // border-box; for an SVG element, the default value is fill-box.
+ // Since we can not determine the default value at parsing time,
+ // set it as NoBox so that we make a decision later.
+ // clip-path reference-box only.
+ MozAlmostPadding = 127 // A magic value that we use for our "pretend that
+ // background-clip is 'padding' when we have a solid
+ // border" optimization. This isn't actually equal
+ // to StyleGeometryBox::Padding because using that
+ // causes antialiasing seams between the background
+ // and border.
+ // background-clip only.
};
// fill-rule
@@ -359,14 +378,6 @@ enum class FillMode : uint32_t;
#define NS_STYLE_IMAGELAYER_ATTACHMENT_FIXED 1
#define NS_STYLE_IMAGELAYER_ATTACHMENT_LOCAL 2
-// See nsStyleImageLayers
-// Code depends on these constants having the same values as IMAGELAYER_ORIGIN_*
-#define NS_STYLE_IMAGELAYER_CLIP_BORDER 0
-#define NS_STYLE_IMAGELAYER_CLIP_PADDING 1
-#define NS_STYLE_IMAGELAYER_CLIP_CONTENT 2
-// One extra constant which does not exist in IMAGELAYER_ORIGIN_*
-#define NS_STYLE_IMAGELAYER_CLIP_TEXT 3
-
// A magic value that we use for our "pretend that background-clip is
// 'padding' when we have a solid border" optimization. This isn't
// actually equal to NS_STYLE_IMAGELAYER_CLIP_PADDING because using that
@@ -375,12 +386,6 @@ enum class FillMode : uint32_t;
#define NS_STYLE_IMAGELAYER_CLIP_MOZ_ALMOST_PADDING 127
// See nsStyleImageLayers
-// Code depends on these constants having the same values as BG_CLIP_*
-#define NS_STYLE_IMAGELAYER_ORIGIN_BORDER 0
-#define NS_STYLE_IMAGELAYER_ORIGIN_PADDING 1
-#define NS_STYLE_IMAGELAYER_ORIGIN_CONTENT 2
-
-// See nsStyleImageLayers
// The parser code depends on |ing these values together.
#define NS_STYLE_IMAGELAYER_POSITION_CENTER (1<<0)
#define NS_STYLE_IMAGELAYER_POSITION_TOP (1<<1)
diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp
index 52491a288a..72c1037243 100644
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -2465,7 +2465,6 @@ const nsCSSPropertyID nsStyleImageLayers::kBackgroundLayerTable[] = {
eCSSProperty_UNKNOWN // composite
};
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
const nsCSSPropertyID nsStyleImageLayers::kMaskLayerTable[] = {
eCSSProperty_mask, // shorthand
eCSSProperty_UNKNOWN, // color
@@ -2480,7 +2479,6 @@ const nsCSSPropertyID nsStyleImageLayers::kMaskLayerTable[] = {
eCSSProperty_mask_mode, // maskMode
eCSSProperty_mask_composite // composite
};
-#endif
nsStyleImageLayers::nsStyleImageLayers(nsStyleImageLayers::LayerType aType)
: mAttachmentCount(1)
@@ -2787,7 +2785,7 @@ nsStyleImageLayers::Size::operator==(const Size& aOther) const
}
nsStyleImageLayers::Layer::Layer()
- : mClip(NS_STYLE_IMAGELAYER_CLIP_BORDER)
+ : mClip(StyleGeometryBox::Border)
, mAttachment(NS_STYLE_IMAGELAYER_ATTACHMENT_SCROLL)
, mBlendMode(NS_STYLE_BLEND_NORMAL)
, mComposite(NS_STYLE_MASK_COMPOSITE_ADD)
@@ -2809,10 +2807,10 @@ nsStyleImageLayers::Layer::Initialize(nsStyleImageLayers::LayerType aType)
mPosition.SetInitialPercentValues(0.0f);
if (aType == LayerType::Background) {
- mOrigin = NS_STYLE_IMAGELAYER_ORIGIN_PADDING;
+ mOrigin = StyleGeometryBox::Padding;
} else {
MOZ_ASSERT(aType == LayerType::Mask, "unsupported layer type.");
- mOrigin = NS_STYLE_IMAGELAYER_ORIGIN_BORDER;
+ mOrigin = StyleGeometryBox::Border;
}
}
diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h
index 1cadea8406..c8182b8f14 100644
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -782,6 +782,8 @@ struct nsStyleImageLayers {
struct Layer;
friend struct Layer;
struct Layer {
+ typedef mozilla::StyleGeometryBox StyleGeometryBox;
+
nsStyleImage mImage; // [reset]
RefPtr<mozilla::css::URLValueData> mSourceURI; // [reset]
// mask-only property
@@ -793,9 +795,9 @@ struct nsStyleImageLayers {
// or an ImageValue.)
mozilla::Position mPosition; // [reset]
Size mSize; // [reset]
- uint8_t mClip; // [reset] See nsStyleConsts.h
+ StyleGeometryBox mClip; // [reset] See nsStyleConsts.h
MOZ_INIT_OUTSIDE_CTOR
- uint8_t mOrigin; // [reset] See nsStyleConsts.h
+ StyleGeometryBox mOrigin; // [reset] See nsStyleConsts.h
uint8_t mAttachment; // [reset] See nsStyleConsts.h
// background-only property
// This property is used for background layer
@@ -2755,7 +2757,7 @@ private:
ReferenceBox mReferenceBox = ReferenceBox::NoBox;
};
-using StyleClipPath = StyleShapeSource<StyleClipPathGeometryBox>;
+using StyleClipPath = StyleShapeSource<StyleGeometryBox>;
using StyleShapeOutside = StyleShapeSource<StyleShapeOutsideShapeBox>;
} // namespace mozilla
diff --git a/layout/svg/nsCSSClipPathInstance.cpp b/layout/svg/nsCSSClipPathInstance.cpp
index 828b10eaca..01f7de248e 100644
--- a/layout/svg/nsCSSClipPathInstance.cpp
+++ b/layout/svg/nsCSSClipPathInstance.cpp
@@ -62,122 +62,12 @@ nsCSSClipPathInstance::HitTestBasicShapeClip(nsIFrame* aFrame,
return path->ContainsPoint(ToPoint(aPoint) * pixelRatio, Matrix());
}
-nsRect
-nsCSSClipPathInstance::ComputeSVGReferenceRect()
-{
- MOZ_ASSERT(mTargetFrame->GetContent()->IsSVGElement());
- nsRect r;
-
- // For SVG elements without associated CSS layout box, the used value for
- // content-box, padding-box, border-box and margin-box is fill-box.
- switch (mClipPathStyle.GetReferenceBox()) {
- case StyleClipPathGeometryBox::Stroke: {
- // XXX Bug 1299876
- // The size of srtoke-box is not correct if this graphic element has
- // specific stroke-linejoin or stroke-linecap.
- gfxRect bbox = nsSVGUtils::GetBBox(mTargetFrame,
- nsSVGUtils::eBBoxIncludeFill | nsSVGUtils::eBBoxIncludeStroke);
- r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
- nsPresContext::AppUnitsPerCSSPixel());
- break;
- }
- case StyleClipPathGeometryBox::View: {
- nsIContent* content = mTargetFrame->GetContent();
- nsSVGElement* element = static_cast<nsSVGElement*>(content);
- SVGSVGElement* svgElement = element->GetCtx();
- MOZ_ASSERT(svgElement);
-
- if (svgElement && svgElement->HasViewBoxRect()) {
- // If a ‘viewBox‘ attribute is specified for the SVG viewport creating
- // element:
- // 1. The reference box is positioned at the origin of the coordinate
- // system established by the ‘viewBox‘ attribute.
- // 2. The dimension of the reference box is set to the width and height
- // values of the ‘viewBox‘ attribute.
- nsSVGViewBox* viewBox = svgElement->GetViewBox();
- const nsSVGViewBoxRect& value = viewBox->GetAnimValue();
- r = nsRect(nsPresContext::CSSPixelsToAppUnits(value.x),
- nsPresContext::CSSPixelsToAppUnits(value.y),
- nsPresContext::CSSPixelsToAppUnits(value.width),
- nsPresContext::CSSPixelsToAppUnits(value.height));
- } else {
- // No viewBox is specified, uses the nearest SVG viewport as reference
- // box.
- svgFloatSize viewportSize = svgElement->GetViewportSize();
- r = nsRect(0, 0,
- nsPresContext::CSSPixelsToAppUnits(viewportSize.width),
- nsPresContext::CSSPixelsToAppUnits(viewportSize.height));
- }
-
- break;
- }
- case StyleClipPathGeometryBox::NoBox:
- case StyleClipPathGeometryBox::Border:
- case StyleClipPathGeometryBox::Content:
- case StyleClipPathGeometryBox::Padding:
- case StyleClipPathGeometryBox::Margin:
- case StyleClipPathGeometryBox::Fill: {
- gfxRect bbox = nsSVGUtils::GetBBox(mTargetFrame,
- nsSVGUtils::eBBoxIncludeFill);
- r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
- nsPresContext::AppUnitsPerCSSPixel());
- break;
- }
- default:{
- MOZ_ASSERT_UNREACHABLE("unknown StyleClipPathGeometryBox type");
- gfxRect bbox = nsSVGUtils::GetBBox(mTargetFrame,
- nsSVGUtils::eBBoxIncludeFill);
- r = nsLayoutUtils::RoundGfxRectToAppRect(bbox,
- nsPresContext::AppUnitsPerCSSPixel());
- break;
- }
- }
-
- return r;
-}
-
-nsRect
-nsCSSClipPathInstance::ComputeHTMLReferenceRect()
-{
- nsRect r;
-
- // For elements with associated CSS layout box, the used value for fill-box,
- // stroke-box and view-box is border-box.
- switch (mClipPathStyle.GetReferenceBox()) {
- case StyleClipPathGeometryBox::Content:
- r = mTargetFrame->GetContentRectRelativeToSelf();
- break;
- case StyleClipPathGeometryBox::Padding:
- r = mTargetFrame->GetPaddingRectRelativeToSelf();
- break;
- case StyleClipPathGeometryBox::Margin:
- r = mTargetFrame->GetMarginRectRelativeToSelf();
- break;
- case StyleClipPathGeometryBox::NoBox:
- case StyleClipPathGeometryBox::Border:
- case StyleClipPathGeometryBox::Fill:
- case StyleClipPathGeometryBox::Stroke:
- case StyleClipPathGeometryBox::View:
- r = mTargetFrame->GetRectRelativeToSelf();
- break;
- default:
- MOZ_ASSERT_UNREACHABLE("unknown StyleClipPathGeometryBox type");
- r = mTargetFrame->GetRectRelativeToSelf();
- break;
- }
-
- return r;
-}
-
already_AddRefed<Path>
nsCSSClipPathInstance::CreateClipPath(DrawTarget* aDrawTarget)
{
- // We use ComputeSVGReferenceRect for all SVG elements, except <svg>
- // element, which does have an associated CSS layout box. In this case we
- // should still use ComputeHTMLReferenceRect for region computing.
- nsRect r = mTargetFrame->IsFrameOfType(nsIFrame::eSVG) &&
- (mTargetFrame->GetType() != nsGkAtoms::svgOuterSVGFrame)
- ? ComputeSVGReferenceRect() : ComputeHTMLReferenceRect();
+ nsRect r =
+ nsLayoutUtils::ComputeGeometryBox(mTargetFrame,
+ mClipPathStyle.GetReferenceBox());
if (mClipPathStyle.GetType() != StyleShapeSourceType::Shape) {
// TODO Clip to border-radius/reference box if no shape
diff --git a/layout/svg/nsCSSClipPathInstance.h b/layout/svg/nsCSSClipPathInstance.h
index 3b0724dbd0..33d92e738e 100644
--- a/layout/svg/nsCSSClipPathInstance.h
+++ b/layout/svg/nsCSSClipPathInstance.h
@@ -48,10 +48,6 @@ private:
already_AddRefed<Path> CreateClipPathInset(DrawTarget* aDrawTarget,
const nsRect& aRefBox);
-
- nsRect ComputeHTMLReferenceRect();
- nsRect ComputeSVGReferenceRect();
-
/**
* The frame for the element that is currently being clipped.
*/
diff --git a/layout/svg/nsSVGIntegrationUtils.cpp b/layout/svg/nsSVGIntegrationUtils.cpp
index 498f693937..0003e1a73e 100644
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -509,71 +509,108 @@ PaintMaskSurface(const PaintFramesParams& aParams,
return DrawResult::SUCCESS;
}
-static DrawResult
+struct MaskPaintResult {
+ RefPtr<SourceSurface> maskSurface;
+ Matrix maskTransform;
+ DrawResult result;
+ bool transparentBlackMask;
+ bool opacityApplied;
+
+ MaskPaintResult()
+ : result(DrawResult::SUCCESS), transparentBlackMask(false),
+ opacityApplied(false)
+ {}
+};
+
+static MaskPaintResult
CreateAndPaintMaskSurface(const PaintFramesParams& aParams,
float aOpacity, nsStyleContext* aSC,
const nsTArray<nsSVGMaskFrame*>& aMaskFrames,
- const nsPoint& aOffsetToUserSpace,
- Matrix& aOutMaskTransform,
- RefPtr<SourceSurface>& aOutMaskSurface,
- bool& aOpacityApplied)
+ const nsPoint& aOffsetToUserSpace)
{
const nsStyleSVGReset *svgReset = aSC->StyleSVGReset();
MOZ_ASSERT(aMaskFrames.Length() > 0);
+ MaskPaintResult paintResult;
gfxContext& ctx = aParams.ctx;
- // There is only one SVG mask.
+ // Optimization for single SVG mask.
if (((aMaskFrames.Length() == 1) && aMaskFrames[0])) {
gfxMatrix cssPxToDevPxMatrix =
nsSVGIntegrationUtils::GetCSSPxToDevPxMatrix(aParams.frame);
+ paintResult.opacityApplied = true;
- aOpacityApplied = true;
- aOutMaskSurface =
+ paintResult.maskSurface =
aMaskFrames[0]->GetMaskForMaskedFrame(&ctx, aParams.frame,
cssPxToDevPxMatrix, aOpacity,
- &aOutMaskTransform,
+ &paintResult.maskTransform,
svgReset->mMask.mLayers[0].mMaskMode);
- return DrawResult::SUCCESS;
+ if (!paintResult.maskSurface) {
+ paintResult.transparentBlackMask = true;
+ }
+
+ return paintResult;
}
const IntRect& maskSurfaceRect = aParams.maskRect;
if (maskSurfaceRect.IsEmpty()) {
- return DrawResult::SUCCESS;
+ paintResult.transparentBlackMask = true;
+ return paintResult;
}
RefPtr<DrawTarget> maskDT =
ctx.GetDrawTarget()->CreateSimilarDrawTarget(maskSurfaceRect.Size(),
SurfaceFormat::A8);
if (!maskDT || !maskDT->IsValid()) {
- return DrawResult::TEMPORARY_ERROR;
+ paintResult.result = DrawResult::TEMPORARY_ERROR;
+ return paintResult;
}
// Set aAppliedOpacity as true only if all mask layers are svg mask.
// In this case, we will apply opacity into the final mask surface, so the
// caller does not need to apply it again.
- aOpacityApplied = !HasNonSVGMask(aMaskFrames);
+ paintResult.opacityApplied = !HasNonSVGMask(aMaskFrames);
// Set context's matrix on maskContext, offset by the maskSurfaceRect's
// position. This makes sure that we combine the masks in device space.
gfxMatrix maskSurfaceMatrix =
ctx.CurrentMatrix() * gfxMatrix::Translation(-aParams.maskRect.TopLeft());
- DrawResult result = PaintMaskSurface(aParams, maskDT,
- aOpacityApplied ? aOpacity : 1.0,
- aSC, aMaskFrames, maskSurfaceMatrix,
- aOffsetToUserSpace);
- if (result != DrawResult::SUCCESS) {
- return result;
- }
-
- aOutMaskTransform = ToMatrix(maskSurfaceMatrix);
- if (!aOutMaskTransform.Invert()) {
- return DrawResult::SUCCESS;
+ paintResult.result = PaintMaskSurface(aParams, maskDT,
+ paintResult.opacityApplied
+ ? aOpacity : 1.0,
+ aSC, aMaskFrames, maskSurfaceMatrix,
+ aOffsetToUserSpace);
+ if (paintResult.result != DrawResult::SUCCESS) {
+ // Now we know the status of mask resource since we used it while painting.
+ // According to the return value of PaintMaskSurface, we know whether mask
+ // resource is resolvable or not.
+ //
+ // For a HTML doc:
+ // According to css-masking spec, always create a mask surface when
+ // we have any item in maskFrame even if all of those items are
+ // non-resolvable <mask-sources> or <images>.
+ // Set paintResult.transparentBlackMask as true, the caller should stop
+ // painting masked content as if this mask is a transparent black one.
+ // For a SVG doc:
+ // SVG 1.1 say that if we fail to resolve a mask, we should draw the
+ // object unmasked.
+ // Left patinResult.maskSurface empty, the caller should paint all
+ // masked content as if this mask is an opaque white one(no mask).
+ paintResult.transparentBlackMask =
+ !(aParams.frame->GetStateBits() & NS_FRAME_SVG_LAYOUT);
+
+ MOZ_ASSERT(!paintResult.maskSurface);
+ return paintResult;
+ }
+
+ paintResult.maskTransform = ToMatrix(maskSurfaceMatrix);
+ if (!paintResult.maskTransform.Invert()) {
+ return paintResult;
}
- aOutMaskSurface = maskDT->Snapshot();
- return DrawResult::SUCCESS;
+ paintResult.maskSurface = maskDT->Snapshot();
+ return paintResult;
}
static bool
@@ -783,6 +820,8 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
maskUsage.shouldGenerateClipMaskLayer ||
maskUsage.shouldGenerateMaskLayer);
+ bool shouldPushMask = false;
+
/* Check if we need to do additional operations on this child's
* rendering, which necessitates rendering into another surface. */
if (shouldGenerateMask) {
@@ -800,14 +839,23 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
// instead of the first continuation frame.
SetupContextMatrix(frame, aParams, offsetToBoundingBox,
offsetToUserSpace);
- result = CreateAndPaintMaskSurface(aParams, maskUsage.opacity,
- firstFrame->StyleContext(),
- maskFrames, offsetToUserSpace,
- maskTransform, maskSurface,
- opacityApplied);
- if (!maskSurface) {
- // Entire surface is clipped out.
- return result;
+ MaskPaintResult paintResult =
+ CreateAndPaintMaskSurface(aParams, maskUsage.opacity,
+ firstFrame->StyleContext(),
+ maskFrames, offsetToUserSpace);
+
+ if (paintResult.transparentBlackMask) {
+ MOZ_ASSERT(paintResult.result != DrawResult::SUCCESS);
+ return paintResult.result;
+ }
+
+ result &= paintResult.result;
+ maskSurface = paintResult.maskSurface;
+ if (maskSurface) {
+ MOZ_ASSERT(paintResult.result == DrawResult::SUCCESS);
+ shouldPushMask = true;
+ maskTransform = paintResult.maskTransform;
+ opacityApplied = paintResult.opacityApplied;
}
}
@@ -831,6 +879,8 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
// failure in nsSVGClipPathFrame::GetClipMask.
return result;
}
+
+ shouldPushMask = true;
}
// opacity != 1.0f.
@@ -841,18 +891,22 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
matSR.SetContext(&context);
SetupContextMatrix(firstFrame, aParams, offsetToBoundingBox,
offsetToUserSpace);
+ shouldPushMask = true;
}
- if (aParams.layerManager->GetRoot()->GetContentFlags() & Layer::CONTENT_COMPONENT_ALPHA) {
- context.PushGroupAndCopyBackground(gfxContentType::COLOR_ALPHA,
- opacityApplied
- ? 1.0
- : maskUsage.opacity,
- maskSurface, maskTransform);
- } else {
- context.PushGroupForBlendBack(gfxContentType::COLOR_ALPHA,
- opacityApplied ? 1.0 : maskUsage.opacity,
- maskSurface, maskTransform);
+ if (shouldPushMask) {
+ if (aParams.layerManager->GetRoot()->GetContentFlags() &
+ Layer::CONTENT_COMPONENT_ALPHA) {
+ context.PushGroupAndCopyBackground(gfxContentType::COLOR_ALPHA,
+ opacityApplied
+ ? 1.0
+ : maskUsage.opacity,
+ maskSurface, maskTransform);
+ } else {
+ context.PushGroupForBlendBack(gfxContentType::COLOR_ALPHA,
+ opacityApplied ? 1.0 : maskUsage.opacity,
+ maskSurface, maskTransform);
+ }
}
}
@@ -899,7 +953,7 @@ nsSVGIntegrationUtils::PaintMaskAndClipPath(const PaintFramesParams& aParams)
context.PopClip();
}
- if (shouldGenerateMask) {
+ if (shouldPushMask) {
context.PopGroupAndBlend();
}
diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp
index b8e4b32ae9..a22833d61a 100644
--- a/layout/svg/nsSVGMaskFrame.cpp
+++ b/layout/svg/nsSVGMaskFrame.cpp
@@ -274,7 +274,8 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext,
}
RefPtr<DataSourceSurface> maskSurface = maskSnapshot->GetDataSurface();
DataSourceSurface::MappedSurface map;
- if (!maskSurface->Map(DataSourceSurface::MapType::READ, &map)) {
+ if (!maskSurface ||
+ !maskSurface->Map(DataSourceSurface::MapType::READ, &map)) {
return nullptr;
}
diff --git a/layout/svg/nsSVGUtils.cpp b/layout/svg/nsSVGUtils.cpp
index 344ebf645a..b8794a05d0 100644
--- a/layout/svg/nsSVGUtils.cpp
+++ b/layout/svg/nsSVGUtils.cpp
@@ -514,26 +514,7 @@ nsSVGUtils::DetermineMaskUsage(nsIFrame* aFrame, bool aHandleOpacity,
nsTArray<nsSVGMaskFrame*> maskFrames = effectProperties.GetMaskFrames();
-#ifdef MOZ_ENABLE_MASK_AS_SHORTHAND
- // For a HTML doc:
- // According to css-masking spec, always create a mask surface when we
- // have any item in maskFrame even if all of those items are
- // non-resolvable <mask-sources> or <images>, we still need to create a
- // transparent black mask layer under this condition.
- // For a SVG doc:
- // SVG 1.1 say that if we fail to resolve a mask, we should draw the
- // object unmasked.
- aUsage.shouldGenerateMaskLayer =
- (aFrame->GetStateBits() & NS_FRAME_SVG_LAYOUT)
- ? maskFrames.Length() == 1 && maskFrames[0]
- : maskFrames.Length() > 0;
-#else
- // Since we do not support image mask so far, we should treat any
- // unresolvable mask as no mask. Otherwise, any object with a valid image
- // mask, e.g. url("xxx.png"), will become invisible just because we can not
- // handle image mask correctly. (See bug 1294171)
- aUsage.shouldGenerateMaskLayer = maskFrames.Length() == 1 && maskFrames[0];
-#endif
+ aUsage.shouldGenerateMaskLayer = (maskFrames.Length() > 0);
bool isOK = effectProperties.HasNoFilterOrHasValidFilter();
nsSVGClipPathFrame *clipPathFrame = effectProperties.GetClipPathFrame(&isOK);
@@ -704,7 +685,7 @@ nsSVGUtils::PaintFrameWithEffects(nsIFrame *aFrame,
bool isOK = effectProperties.HasNoFilterOrHasValidFilter();
nsSVGClipPathFrame *clipPathFrame = effectProperties.GetClipPathFrame(&isOK);
nsSVGMaskFrame *maskFrame = effectProperties.GetFirstMaskFrame(&isOK);
- if (!isOK) {
+ if (!isOK || !maskFrame) {
// Some resource is invalid. We shouldn't paint anything.
return DrawResult::SUCCESS;
}
diff --git a/layout/xul/BoxObject.cpp b/layout/xul/BoxObject.cpp
index 6636a6d622..347205fff2 100644
--- a/layout/xul/BoxObject.cpp
+++ b/layout/xul/BoxObject.cpp
@@ -53,7 +53,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(BoxObject)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(BoxObject)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
if (tmp->mPropertyTable) {
for (auto iter = tmp->mPropertyTable->Iter(); !iter.Done(); iter.Next()) {
cb.NoteXPCOMChild(iter.UserData());
diff --git a/layout/xul/tree/nsTreeColumns.cpp b/layout/xul/tree/nsTreeColumns.cpp
index c6ee19342e..ee8577f928 100644
--- a/layout/xul/tree/nsTreeColumns.cpp
+++ b/layout/xul/tree/nsTreeColumns.cpp
@@ -54,7 +54,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsTreeColumn)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mContent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mNext)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsTreeColumn)
diff --git a/media/libcubeb/src/cubeb.c b/media/libcubeb/src/cubeb.c
index e0375c394f..eb22a9b944 100644
--- a/media/libcubeb/src/cubeb.c
+++ b/media/libcubeb/src/cubeb.c
@@ -562,7 +562,7 @@ int cubeb_set_log_callback(cubeb_log_level log_level,
void
cubeb_crash()
{
- abort();
*((volatile int *) NULL) = 0;
+ abort();
}
diff --git a/media/libcubeb/src/cubeb_audiounit.cpp b/media/libcubeb/src/cubeb_audiounit.cpp
index f24dfbff2f..9483c2795e 100644
--- a/media/libcubeb/src/cubeb_audiounit.cpp
+++ b/media/libcubeb/src/cubeb_audiounit.cpp
@@ -1443,12 +1443,12 @@ audiounit_set_buffer_size(cubeb_stream * stm, uint32_t new_size_frames, set_buff
buffer_size_changed_callback,
stm);
if (r != noErr) {
- return CUBEB_ERROR;
if (set_side == INPUT) {
PRINT_ERROR_CODE("AudioUnitAddPropertyListener/input/kAudioDevicePropertyBufferFrameSize", r);
} else {
PRINT_ERROR_CODE("AudioUnitAddPropertyListener/output/kAudioDevicePropertyBufferFrameSize", r);
}
+ return CUBEB_ERROR;
}
if (!stm->buffer_size_change_state && count >= 30) {
diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c
index c0c189abf1..9a97bbb09c 100644
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -280,9 +280,7 @@ typedef long ssize_t;
#define JEMALLOC_RECYCLE
#ifndef MOZ_MEMORY_WINDOWS
-#ifndef MOZ_MEMORY_SOLARIS
#include <sys/cdefs.h>
-#endif
#ifndef __DECONST
# define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
#endif
@@ -308,7 +306,7 @@ __FBSDID("$FreeBSD: head/lib/libc/stdlib/malloc.c 180599 2008-07-18 19:35:44Z ja
#endif
#include <sys/time.h>
#include <sys/types.h>
-#if !defined(MOZ_MEMORY_SOLARIS) && !defined(MOZ_MEMORY_ANDROID)
+#if !defined(MOZ_MEMORY_ANDROID)
#include <sys/sysctl.h>
#endif
#include <sys/uio.h>
@@ -410,10 +408,6 @@ void *_mmap(void *addr, size_t length, int prot, int flags,
#endif
#endif
-#if defined(MOZ_MEMORY_SOLARIS) && defined(MAP_ALIGN) && !defined(JEMALLOC_NEVER_USES_MAP_ALIGN)
-#define JEMALLOC_USES_MAP_ALIGN /* Required on Solaris 10. Might improve performance elsewhere. */
-#endif
-
#ifndef __DECONST
#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
#endif
@@ -1040,7 +1034,7 @@ static const bool config_recycle = false;
* will abort.
* Platform specific page size conditions copied from js/public/HeapAPI.h
*/
-#if (defined(SOLARIS) || defined(__FreeBSD__)) && \
+#if (defined(__FreeBSD__)) && \
(defined(__sparc) || defined(__sparcv9) || defined(__ia64))
#define pagesize_2pow ((size_t) 13)
#elif defined(__powerpc64__)
@@ -5126,13 +5120,6 @@ malloc_ncpus(void)
else
return (n);
}
-#elif (defined(MOZ_MEMORY_SOLARIS))
-
-static inline unsigned
-malloc_ncpus(void)
-{
- return sysconf(_SC_NPROCESSORS_ONLN);
-}
#elif (defined(MOZ_MEMORY_WINDOWS))
static inline unsigned
malloc_ncpus(void)
@@ -5929,19 +5916,9 @@ RETURN:
#define MOZ_MEMORY_ELF
#endif
-#ifdef MOZ_MEMORY_SOLARIS
-# ifdef __SUNPRO_C
-void *
-memalign_impl(size_t alignment, size_t size);
-#pragma no_inline(memalign_impl)
-# elif (defined(__GNUC__))
-__attribute__((noinline))
-# endif
-#else
#if (defined(MOZ_MEMORY_ELF))
__attribute__((visibility ("hidden")))
#endif
-#endif
#endif /* MOZ_REPLACE_MALLOC */
#ifdef MOZ_MEMORY_ELF
diff --git a/memory/mozjemalloc/moz.build b/memory/mozjemalloc/moz.build
index a7c1e5f2ac..6408aac8cf 100644
--- a/memory/mozjemalloc/moz.build
+++ b/memory/mozjemalloc/moz.build
@@ -13,11 +13,6 @@ SOURCES += [
]
FINAL_LIBRARY = 'memory'
-# See bug 422055.
-if CONFIG['OS_ARCH'] == 'SunOS' and not CONFIG['GNU_CC'] \
- and CONFIG['MOZ_OPTIMIZE']:
- CFLAGS += ['-xO5']
-
# For non release/esr builds, enable (some) fatal jemalloc assertions. This
# helps us catch memory errors.
if CONFIG['MOZ_UPDATE_CHANNEL'] not in ('release', 'esr'):
diff --git a/mfbt/RangedPtr.h b/mfbt/RangedPtr.h
index a07c1f4f85..a3d4ec1032 100644
--- a/mfbt/RangedPtr.h
+++ b/mfbt/RangedPtr.h
@@ -212,7 +212,7 @@ public:
return *this;
}
- T& operator[](int aIndex) const
+ T& operator[](ptrdiff_t aIndex) const
{
MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T));
return *create(mPtr + aIndex);
diff --git a/mobile/android/components/AddonUpdateService.js b/mobile/android/components/AddonUpdateService.js
index 2505e27962..b2c4732c38 100644
--- a/mobile/android/components/AddonUpdateService.js
+++ b/mobile/android/components/AddonUpdateService.js
@@ -23,14 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Messaging",
XPCOMUtils.defineLazyModuleGetter(this, "OS", "resource://gre/modules/osfile.jsm");
-function getPref(func, preference, defaultValue) {
- try {
- return Services.prefs[func](preference);
- }
- catch (e) {}
- return defaultValue;
-}
-
// -----------------------------------------------------------------------
// Add-on auto-update management service
// -----------------------------------------------------------------------
@@ -49,7 +41,7 @@ AddonUpdateService.prototype = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback]),
notify: function aus_notify(aTimer) {
- if (aTimer && !getPref("getBoolPref", PREF_ADDON_UPDATE_ENABLED, true))
+ if (aTimer && !Services.prefs.getBoolPref(PREF_ADDON_UPDATE_ENABLED, true))
return;
// If we already auto-upgraded and installed new versions, ignore this check
@@ -61,7 +53,7 @@ AddonUpdateService.prototype = {
let gmp = new GMPInstallManager();
gmp.simpleCheckAndInstall().then(null, () => {});
- let interval = 1000 * getPref("getIntPref", PREF_ADDON_UPDATE_INTERVAL, 86400);
+ let interval = 1000 * Services.prefs.getIntPref(PREF_ADDON_UPDATE_INTERVAL, 86400);
Messaging.sendRequest({
type: "Gecko:ScheduleRun",
action: "update-addons",
diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp
index 31867ca0ac..c56cad98d5 100644
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -1306,9 +1306,6 @@ static nsresult pref_InitInitialObjects()
"winpref.js"
#elif defined(XP_UNIX)
"unix.js"
-#if defined(_AIX)
- , "aix.js"
-#endif
#elif defined(XP_BEOS)
"beos.js"
#endif
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index f6e90170e9..aed20c8548 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1264,6 +1264,7 @@ pref("javascript.options.strict", false);
#ifdef DEBUG
pref("javascript.options.strict.debug", false);
#endif
+pref("javascript.options.unboxed_objects", false);
pref("javascript.options.baselinejit", true);
pref("javascript.options.ion", true);
pref("javascript.options.asmjs", true);
@@ -1474,7 +1475,10 @@ pref("network.http.request.max-start-delay", 10);
pref("network.http.request.max-attempts", 10);
// Headers
-pref("network.http.accept.default", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
+pref("network.http.accept.default", "*/*");
+pref("network.http.accept.navigation", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
+pref("network.http.accept.image", "image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5");
+pref("network.http.accept.style", "text/css,*/*;q=0.1");
// Prefs allowing granular control of referers
// 0=don't send any, 1=send only on clicks, 2=send on image requests as well
@@ -5451,8 +5455,9 @@ pref("dom.storageManager.enabled", true);
pref("dom.storageManager.enabled", false);
#endif
-// When a user cancels this number of authentication dialogs coming from
-// a single web page in a row, all following authentication dialogs will
-// be blocked (automatically canceled) for that page. The counter resets
-// when the page is reloaded. To turn this feature off, just set the limit to 0.
-pref("prompts.authentication_dialog_abuse_limit", 3);
+// DoS protection for HTTP Auth prompt spawning.
+// -1 = completely disable HTTP Auth prompting. (careful!)
+// 0 = disable this DoS protection
+// >0 = suppress further prompts after the user has canceled the dialog n times
+// See application preferences for appropriate defaults.
+pref("prompts.authentication_dialog_abuse_limit", 0);
diff --git a/modules/libpref/nsIPrefBranch.idl b/modules/libpref/nsIPrefBranch.idl
index ee0c11ef07..900806b426 100644
--- a/modules/libpref/nsIPrefBranch.idl
+++ b/modules/libpref/nsIPrefBranch.idl
@@ -57,12 +57,16 @@ interface nsIPrefBranch : nsISupports
* Called to get the state of an individual boolean preference.
*
* @param aPrefName The boolean preference to get the state of.
+ * @param aDefaultValue The value to return if the preference is not set.
*
* @return boolean The value of the requested boolean preference.
*
* @see setBoolPref
*/
- boolean getBoolPref(in string aPrefName);
+ [optional_argc,binaryname(GetBoolPrefWithDefault)]
+ boolean getBoolPref(in string aPrefName, [optional] in boolean aDefaultValue);
+ [noscript,binaryname(GetBoolPref)]
+ boolean getBoolPrefXPCOM(in string aPrefName);
/**
* Called to set the state of an individual boolean preference.
@@ -83,23 +87,31 @@ interface nsIPrefBranch : nsISupports
* are converted to floating point numbers.
*
* @param aPrefName The floating point preference to get the state of.
+ * @param aDefaultValue The value to return if the preference is not set.
*
* @return float The value of the requested floating point preference.
*
* @see setCharPref
*/
- float getFloatPref(in string aPrefName);
+ [optional_argc,binaryname(GetFloatPrefWithDefault)]
+ float getFloatPref(in string aPrefName, [optional] in float aDefaultValue);
+ [noscript,binaryname(GetFloatPref)]
+ float getFloatPrefXPCOM(in string aPrefName);
/**
* Called to get the state of an individual string preference.
*
* @param aPrefName The string preference to retrieve.
+ * @param aDefaultValue The string to return if the preference is not set.
*
* @return string The value of the requested string preference.
*
* @see setCharPref
*/
- string getCharPref(in string aPrefName);
+ [optional_argc,binaryname(GetCharPrefWithDefault)]
+ string getCharPref(in string aPrefName, [optional] in string aDefaultValue);
+ [noscript,binaryname(GetCharPref)]
+ string getCharPrefXPCOM(in string aPrefName);
/**
* Called to set the state of an individual string preference.
@@ -118,12 +130,16 @@ interface nsIPrefBranch : nsISupports
* Called to get the state of an individual integer preference.
*
* @param aPrefName The integer preference to get the value of.
+ * @param aDefaultValue The value to return if the preference is not set.
*
* @return long The value of the requested integer preference.
*
* @see setIntPref
*/
- long getIntPref(in string aPrefName);
+ [optional_argc,binaryname(GetIntPrefWithDefault)]
+ long getIntPref(in string aPrefName, [optional] in long aDefaultValue);
+ [noscript,binaryname(GetIntPref)]
+ long getIntPrefXPCOM(in string aPrefName);
/**
* Called to set the state of an individual integer preference.
diff --git a/modules/libpref/nsPrefBranch.cpp b/modules/libpref/nsPrefBranch.cpp
index 98e06aaa42..5173db06e1 100644
--- a/modules/libpref/nsPrefBranch.cpp
+++ b/modules/libpref/nsPrefBranch.cpp
@@ -141,6 +141,20 @@ NS_IMETHODIMP nsPrefBranch::GetPrefType(const char *aPrefName, int32_t *_retval)
return NS_OK;
}
+NS_IMETHODIMP nsPrefBranch::GetBoolPrefWithDefault(const char *aPrefName,
+ bool aDefaultValue,
+ uint8_t _argc, bool *_retval)
+{
+ nsresult rv = GetBoolPref(aPrefName, _retval);
+
+ if (NS_FAILED(rv) && _argc == 1) {
+ *_retval = aDefaultValue;
+ return NS_OK;
+ }
+
+ return rv;
+}
+
NS_IMETHODIMP nsPrefBranch::GetBoolPref(const char *aPrefName, bool *_retval)
{
NS_ENSURE_ARG(aPrefName);
@@ -156,6 +170,20 @@ NS_IMETHODIMP nsPrefBranch::SetBoolPref(const char *aPrefName, bool aValue)
return PREF_SetBoolPref(pref, aValue, mIsDefault);
}
+NS_IMETHODIMP nsPrefBranch::GetFloatPrefWithDefault(const char *aPrefName,
+ float aDefaultValue,
+ uint8_t _argc, float *_retval)
+{
+ nsresult rv = GetFloatPref(aPrefName, _retval);
+
+ if (NS_FAILED(rv) && _argc == 1) {
+ *_retval = aDefaultValue;
+ return NS_OK;
+ }
+
+ return rv;
+}
+
NS_IMETHODIMP nsPrefBranch::GetFloatPref(const char *aPrefName, float *_retval)
{
NS_ENSURE_ARG(aPrefName);
@@ -169,6 +197,21 @@ NS_IMETHODIMP nsPrefBranch::GetFloatPref(const char *aPrefName, float *_retval)
return rv;
}
+NS_IMETHODIMP nsPrefBranch::GetCharPrefWithDefault(const char *aPrefName,
+ const char *aDefaultValue,
+ uint8_t _argc, char **_retval)
+{
+ nsresult rv = GetCharPref(aPrefName, _retval);
+
+ if (NS_FAILED(rv) && _argc == 1) {
+ NS_ENSURE_ARG(aDefaultValue);
+ *_retval = NS_strdup(aDefaultValue);
+ return NS_OK;
+ }
+
+ return rv;
+}
+
NS_IMETHODIMP nsPrefBranch::GetCharPref(const char *aPrefName, char **_retval)
{
NS_ENSURE_ARG(aPrefName);
@@ -195,6 +238,20 @@ nsresult nsPrefBranch::SetCharPrefInternal(const char *aPrefName, const char *aV
return PREF_SetCharPref(pref, aValue, mIsDefault);
}
+NS_IMETHODIMP nsPrefBranch::GetIntPrefWithDefault(const char *aPrefName,
+ int32_t aDefaultValue,
+ uint8_t _argc, int32_t *_retval)
+{
+ nsresult rv = GetIntPref(aPrefName, _retval);
+
+ if (NS_FAILED(rv) && _argc == 1) {
+ *_retval = aDefaultValue;
+ return NS_OK;
+ }
+
+ return rv;
+}
+
NS_IMETHODIMP nsPrefBranch::GetIntPref(const char *aPrefName, int32_t *_retval)
{
NS_ENSURE_ARG(aPrefName);
diff --git a/modules/libpref/test/unit/test_defaultValues.js b/modules/libpref/test/unit/test_defaultValues.js
new file mode 100644
index 0000000000..d04bcc04ae
--- /dev/null
+++ b/modules/libpref/test/unit/test_defaultValues.js
@@ -0,0 +1,48 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* Tests for providing a default value to get{Bool,Char,Float,Int}Pref */
+
+function run_test() {
+ var ps = Cc["@mozilla.org/preferences-service;1"]
+ .getService(Ci.nsIPrefService)
+ .QueryInterface(Ci.nsIPrefBranch);
+
+ let prefName = "test.default.values.bool";
+ do_check_throws(function() { ps.getBoolPref(prefName); },
+ Cr.NS_ERROR_UNEXPECTED);
+ strictEqual(ps.getBoolPref(prefName, false), false);
+ strictEqual(ps.getBoolPref(prefName, true), true);
+ ps.setBoolPref(prefName, true);
+ strictEqual(ps.getBoolPref(prefName), true);
+ strictEqual(ps.getBoolPref(prefName, false), true);
+ strictEqual(ps.getBoolPref(prefName, true), true);
+
+ prefName = "test.default.values.char";
+ do_check_throws(function() { ps.getCharPref(prefName); },
+ Cr.NS_ERROR_UNEXPECTED);
+ strictEqual(ps.getCharPref(prefName, ""), "");
+ strictEqual(ps.getCharPref(prefName, "string"), "string");
+ ps.setCharPref(prefName, "foo");
+ strictEqual(ps.getCharPref(prefName), "foo");
+ strictEqual(ps.getCharPref(prefName, "string"), "foo");
+
+ prefName = "test.default.values.float";
+ do_check_throws(function() { ps.getFloatPref(prefName); },
+ Cr.NS_ERROR_UNEXPECTED);
+ strictEqual(ps.getFloatPref(prefName, 3.5), 3.5);
+ strictEqual(ps.getFloatPref(prefName, 0), 0);
+ ps.setCharPref(prefName, 1.75);
+ strictEqual(ps.getFloatPref(prefName), 1.75);
+ strictEqual(ps.getFloatPref(prefName, 3.5), 1.75);
+
+ prefName = "test.default.values.int";
+ do_check_throws(function() { ps.getIntPref(prefName); },
+ Cr.NS_ERROR_UNEXPECTED);
+ strictEqual(ps.getIntPref(prefName, 3), 3);
+ strictEqual(ps.getIntPref(prefName, 0), 0);
+ ps.setIntPref(prefName, 42);
+ strictEqual(ps.getIntPref(prefName), 42);
+ strictEqual(ps.getIntPref(prefName, 3), 42);
+}
diff --git a/modules/libpref/test/unit/xpcshell.ini b/modules/libpref/test/unit/xpcshell.ini
index 74c56907a7..66458863f6 100644
--- a/modules/libpref/test/unit/xpcshell.ini
+++ b/modules/libpref/test/unit/xpcshell.ini
@@ -13,6 +13,7 @@ support-files =
[test_stickyprefs.js]
support-files = data/testPrefSticky.js data/testPrefStickyUser.js
[test_changeType.js]
+[test_defaultValues.js]
[test_dirtyPrefs.js]
[test_extprefs.js]
[test_libPrefs.js]
diff --git a/netwerk/base/nsProtocolProxyService.cpp b/netwerk/base/nsProtocolProxyService.cpp
index 26eca0e884..237a2a3bd3 100644
--- a/netwerk/base/nsProtocolProxyService.cpp
+++ b/netwerk/base/nsProtocolProxyService.cpp
@@ -1841,6 +1841,13 @@ nsProtocolProxyService::Resolve_Internal(nsIChannel *channel,
if (mPACMan && mPACMan->IsPACURI(uri))
return NS_OK;
+ // If proxies are enabled and this host:port combo is supposed to use a
+ // proxy, check for a proxy.
+ if ((mProxyConfig == PROXYCONFIG_DIRECT) ||
+ !CanUseProxy(uri, info.defaultPort)) {
+ return NS_OK;
+ }
+
bool mainThreadOnly;
if (mSystemProxySettings &&
mProxyConfig == PROXYCONFIG_SYSTEM &&
diff --git a/netwerk/base/nsStandardURL.h b/netwerk/base/nsStandardURL.h
index 0ca345572a..eba85528c7 100644
--- a/netwerk/base/nsStandardURL.h
+++ b/netwerk/base/nsStandardURL.h
@@ -72,7 +72,6 @@ public:
static void InitGlobalObjects();
static void ShutdownGlobalObjects();
-public: /* internal -- HPUX compiler can't handle this being private */
//
// location and length of an url segment relative to mSpec
//
diff --git a/netwerk/base/nsUDPSocket.cpp b/netwerk/base/nsUDPSocket.cpp
index 06ecbf9ee6..8b6a81bf56 100644
--- a/netwerk/base/nsUDPSocket.cpp
+++ b/netwerk/base/nsUDPSocket.cpp
@@ -172,7 +172,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsUDPMessage)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsUDPMessage)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsUDPMessage)
diff --git a/netwerk/base/security-prefs.js b/netwerk/base/security-prefs.js
index 7d63267a65..ef78ddccbb 100644
--- a/netwerk/base/security-prefs.js
+++ b/netwerk/base/security-prefs.js
@@ -17,6 +17,11 @@ pref("security.ssl.false_start.require-npn", false);
pref("security.ssl.enable_npn", true);
pref("security.ssl.enable_alpn", true);
+// TLS 1.3 cipher suites
+pref("security.tls13.aes_128_gcm_sha256", true);
+pref("security.tls13.chacha20_poly1305_sha256", true);
+pref("security.tls13.aes_256_gcm_sha384", true);
+
// TLS 1.0-1.2 cipher suites
pref("security.ssl3.ecdhe_rsa_aes_128_gcm_sha256", true);
pref("security.ssl3.ecdhe_ecdsa_aes_128_gcm_sha256", true);
@@ -36,11 +41,14 @@ pref("security.ssl3.rsa_camellia_128_sha", true);
pref("security.ssl3.rsa_camellia_256_sha", true);
pref("security.ssl3.rsa_aes_128_sha", true);
pref("security.ssl3.rsa_aes_256_sha", true);
-// Weak / deprecated
+
+// Deprecated
pref("security.ssl3.dhe_rsa_aes_256_sha", false);
pref("security.ssl3.dhe_rsa_aes_128_sha", false);
pref("security.ssl3.rsa_aes_128_gcm_sha256", false);
pref("security.ssl3.rsa_aes_128_sha256", false);
+
+// Weak/broken (requires fallback_hosts)
pref("security.ssl3.rsa_des_ede3_sha", false);
pref("security.ssl3.rsa_rc4_128_sha", false);
pref("security.ssl3.rsa_rc4_128_md5", false);
@@ -109,10 +117,6 @@ pref("security.webauth.u2f", false);
pref("security.webauth.u2f_enable_softtoken", false);
pref("security.webauth.u2f_enable_usbtoken", false);
-pref("security.ssl.errorReporting.enabled", true);
-pref("security.ssl.errorReporting.url", "https://incoming.telemetry.mozilla.org/submit/sslreports/");
-pref("security.ssl.errorReporting.automatic", false);
-
// OCSP must-staple
pref("security.ssl.enable_ocsp_must_staple", true);
diff --git a/netwerk/mime/nsMimeTypes.h b/netwerk/mime/nsMimeTypes.h
index 215d205078..57a85e9bc6 100644
--- a/netwerk/mime/nsMimeTypes.h
+++ b/netwerk/mime/nsMimeTypes.h
@@ -107,6 +107,9 @@
#define IMAGE_TIFF "image/tiff"
#define IMAGE_BMP "image/bmp"
#define IMAGE_BMP_MS "image/x-ms-bmp"
+// This is used internally to represent Windows clipboard BMPs which remove
+// part of the header.
+#define IMAGE_BMP_MS_CLIPBOARD "image/x-ms-clipboard-bmp"
#define IMAGE_ICO "image/x-icon"
#define IMAGE_ICO_MS "image/vnd.microsoft.icon"
#define IMAGE_ICON_MS "image/icon"
diff --git a/netwerk/protocol/ftp/FTPChannelChild.cpp b/netwerk/protocol/ftp/FTPChannelChild.cpp
index f8284aae3c..f52586744a 100644
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -516,33 +516,6 @@ FTPChannelChild::RecvOnStopRequest(const nsresult& aChannelStatus,
return true;
}
-class nsFtpChildAsyncAlert : public Runnable
-{
-public:
- nsFtpChildAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
- : mPrompter(aPrompter)
- , mResponseMsg(aResponseMsg)
- {
- MOZ_COUNT_CTOR(nsFtpChildAsyncAlert);
- }
-protected:
- virtual ~nsFtpChildAsyncAlert()
- {
- MOZ_COUNT_DTOR(nsFtpChildAsyncAlert);
- }
-public:
- NS_IMETHOD Run() override
- {
- if (mPrompter) {
- mPrompter->Alert(nullptr, mResponseMsg.get());
- }
- return NS_OK;
- }
-private:
- nsCOMPtr<nsIPrompt> mPrompter;
- nsString mResponseMsg;
-};
-
class MaybeDivertOnStopFTPEvent : public ChannelEvent
{
public:
@@ -600,19 +573,7 @@ FTPChannelChild::DoOnStopRequest(const nsresult& aChannelStatus,
(void)mListener->OnStopRequest(this, mListenerContext, aChannelStatus);
if (NS_FAILED(aChannelStatus) && !aErrorMsg.IsEmpty()) {
- nsCOMPtr<nsIPrompt> prompter;
- GetCallback(prompter);
- if (prompter) {
- nsCOMPtr<nsIRunnable> alertEvent;
- if (aUseUTF8) {
- alertEvent = new nsFtpChildAsyncAlert(prompter,
- NS_ConvertUTF8toUTF16(aErrorMsg));
- } else {
- alertEvent = new nsFtpChildAsyncAlert(prompter,
- NS_ConvertASCIItoUTF16(aErrorMsg));
- }
- NS_DispatchToMainThread(alertEvent);
- }
+ NS_ERROR("FTP error on stop request.");
}
mListener = nullptr;
diff --git a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
index 2ae12846a2..0dae7ca921 100644
--- a/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
+++ b/netwerk/protocol/ftp/nsFtpConnectionThread.cpp
@@ -29,7 +29,6 @@
#include "nsIStreamListenerTee.h"
#include "nsIPrefService.h"
#include "nsIPrefBranch.h"
-#include "nsIStringBundle.h"
#include "nsAuthInformationHolder.h"
#include "nsIProtocolProxyService.h"
#include "nsICancelable.h"
@@ -926,38 +925,7 @@ nsFtpState::R_syst() {
mServerType = FTP_VMS_TYPE;
} else {
NS_ERROR("Server type list format unrecognized.");
- // Guessing causes crashes.
- // (Of course, the parsing code should be more robust...)
- nsCOMPtr<nsIStringBundleService> bundleService =
- do_GetService(NS_STRINGBUNDLE_CONTRACTID);
- if (!bundleService)
- return FTP_ERROR;
-
- nsCOMPtr<nsIStringBundle> bundle;
- nsresult rv = bundleService->CreateBundle(NECKO_MSGS_URL,
- getter_AddRefs(bundle));
- if (NS_FAILED(rv))
- return FTP_ERROR;
-
- char16_t* ucs2Response = ToNewUnicode(mResponseMsg);
- const char16_t *formatStrings[1] = { ucs2Response };
- NS_NAMED_LITERAL_STRING(name, "UnsupportedFTPServer");
-
- nsXPIDLString formattedString;
- rv = bundle->FormatStringFromName(name.get(), formatStrings, 1,
- getter_Copies(formattedString));
- free(ucs2Response);
- if (NS_FAILED(rv))
- return FTP_ERROR;
-
- // TODO(darin): this code should not be dictating UI like this!
- nsCOMPtr<nsIPrompt> prompter;
- mChannel->GetCallback(prompter);
- if (prompter)
- prompter->Alert(nullptr, formattedString.get());
-
- // since we just alerted the user, clear mResponseMsg,
- // which is displayed to the user.
+ // clear mResponseMsg, which is displayed to the user.
mResponseMsg = "";
return FTP_ERROR;
}
@@ -1779,34 +1747,6 @@ nsFtpState::KillControlConnection()
mControlConnection = nullptr;
}
-class nsFtpAsyncAlert : public Runnable
-{
-public:
- nsFtpAsyncAlert(nsIPrompt *aPrompter, nsString aResponseMsg)
- : mPrompter(aPrompter)
- , mResponseMsg(aResponseMsg)
- {
- MOZ_COUNT_CTOR(nsFtpAsyncAlert);
- }
-protected:
- virtual ~nsFtpAsyncAlert()
- {
- MOZ_COUNT_DTOR(nsFtpAsyncAlert);
- }
-public:
- NS_IMETHOD Run() override
- {
- if (mPrompter) {
- mPrompter->Alert(nullptr, mResponseMsg.get());
- }
- return NS_OK;
- }
-private:
- nsCOMPtr<nsIPrompt> mPrompter;
- nsString mResponseMsg;
-};
-
-
nsresult
nsFtpState::StopProcessing()
{
@@ -1818,23 +1758,8 @@ nsFtpState::StopProcessing()
LOG_INFO(("FTP:(%x) nsFtpState stopping", this));
if (NS_FAILED(mInternalError) && !mResponseMsg.IsEmpty()) {
- // check to see if the control status is bad.
- // web shell wont throw an alert. we better:
-
- // XXX(darin): this code should not be dictating UI like this!
- nsCOMPtr<nsIPrompt> prompter;
- mChannel->GetCallback(prompter);
- if (prompter) {
- nsCOMPtr<nsIRunnable> alertEvent;
- if (mUseUTF8) {
- alertEvent = new nsFtpAsyncAlert(prompter,
- NS_ConvertUTF8toUTF16(mResponseMsg));
- } else {
- alertEvent = new nsFtpAsyncAlert(prompter,
- NS_ConvertASCIItoUTF16(mResponseMsg));
- }
- NS_DispatchToMainThread(alertEvent);
- }
+ NS_ERROR("FTP: bad control status.");
+ // check to see if the control status is bad; forward the error message.
nsCOMPtr<nsIFTPChannelParentInternal> ftpChanP;
mChannel->GetCallback(ftpChanP);
if (ftpChanP) {
diff --git a/netwerk/protocol/http/AlternateServices.cpp b/netwerk/protocol/http/AlternateServices.cpp
index b3e6babe39..ee2fa9331c 100644
--- a/netwerk/protocol/http/AlternateServices.cpp
+++ b/netwerk/protocol/http/AlternateServices.cpp
@@ -654,8 +654,13 @@ private:
{
nsID channelId;
nsLoadFlags flags;
+
+ nsContentPolicyType contentPolicyType =
+ loadInfo ? loadInfo->GetExternalContentPolicyType()
+ : nsIContentPolicy::TYPE_OTHER;
+
if (NS_FAILED(gHttpHandler->NewChannelId(&channelId)) ||
- NS_FAILED(chan->Init(uri, caps, nullptr, 0, nullptr, channelId)) ||
+ NS_FAILED(chan->Init(uri, caps, nullptr, 0, nullptr, channelId, contentPolicyType)) ||
NS_FAILED(chan->SetAllowAltSvc(false)) ||
NS_FAILED(chan->SetRedirectMode(nsIHttpChannelInternal::REDIRECT_MODE_ERROR)) ||
NS_FAILED(chan->SetLoadInfo(loadInfo)) ||
diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp
index 9e43d89e09..86e177e71a 100644
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -151,7 +151,8 @@ HttpBaseChannel::Init(nsIURI *aURI,
nsProxyInfo *aProxyInfo,
uint32_t aProxyResolveFlags,
nsIURI *aProxyURI,
- const nsID& aChannelId)
+ const nsID& aChannelId,
+ nsContentPolicyType aContentPolicyType)
{
LOG(("HttpBaseChannel::Init [this=%p]\n", this));
@@ -200,7 +201,7 @@ HttpBaseChannel::Init(nsIURI *aURI,
rv = mRequestHead.SetHeader(nsHttp::Host, hostLine);
if (NS_FAILED(rv)) return rv;
- rv = gHttpHandler->AddStandardRequestHeaders(&mRequestHead, isHTTPS);
+ rv = gHttpHandler->AddStandardRequestHeaders(&mRequestHead, isHTTPS, aContentPolicyType);
if (NS_FAILED(rv)) return rv;
nsAutoCString type;
diff --git a/netwerk/protocol/http/HttpBaseChannel.h b/netwerk/protocol/http/HttpBaseChannel.h
index 9aa696a70a..8def0f23c2 100644
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -99,7 +99,8 @@ public:
virtual nsresult Init(nsIURI *aURI, uint32_t aCaps, nsProxyInfo *aProxyInfo,
uint32_t aProxyResolveFlags,
nsIURI *aProxyURI,
- const nsID& aChannelId);
+ const nsID& aChannelId,
+ nsContentPolicyType aContentPolicyType);
// nsIRequest
NS_IMETHOD GetName(nsACString& aName) override;
diff --git a/netwerk/protocol/http/TunnelUtils.cpp b/netwerk/protocol/http/TunnelUtils.cpp
index 4cc24a07fd..6880e01872 100644
--- a/netwerk/protocol/http/TunnelUtils.cpp
+++ b/netwerk/protocol/http/TunnelUtils.cpp
@@ -23,6 +23,7 @@
#include "nsNetCID.h"
#include "nsServiceManagerUtils.h"
#include "nsComponentManagerUtils.h"
+#include "nsSocketTransport2.h"
namespace mozilla {
namespace net {
@@ -42,6 +43,7 @@ TLSFilterTransaction::TLSFilterTransaction(nsAHttpTransaction *aWrapped,
, mSegmentReader(aReader)
, mSegmentWriter(aWriter)
, mForce(false)
+ , mReadSegmentReturnValue(NS_OK)
, mNudgeCounter(0)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
@@ -130,6 +132,19 @@ TLSFilterTransaction::Close(nsresult aReason)
}
mTransaction->Close(aReason);
mTransaction = nullptr;
+
+ RefPtr<NullHttpTransaction> baseTrans(do_QueryReferent(mWeakTrans));
+ SpdyConnectTransaction *trans = baseTrans
+ ? baseTrans->QuerySpdyConnectTransaction()
+ : nullptr;
+
+ LOG(("TLSFilterTransaction::Close %p aReason=%" PRIx32 " trans=%p\n",
+ this, static_cast<uint32_t>(aReason), trans));
+
+ if (trans) {
+ trans->Close(aReason);
+ trans = nullptr;
+ }
}
nsresult
@@ -140,7 +155,7 @@ TLSFilterTransaction::OnReadSegment(const char *aData,
LOG(("TLSFilterTransaction %p OnReadSegment %d (buffered %d)\n",
this, aCount, mEncryptedTextUsed));
- mReadSegmentBlocked = false;
+ mReadSegmentReturnValue = NS_OK;
MOZ_ASSERT(mSegmentReader);
if (!mSecInfo) {
return NS_ERROR_FAILURE;
@@ -188,10 +203,12 @@ TLSFilterTransaction::OnReadSegment(const char *aData,
return NS_OK;
}
// mTransaction ReadSegments actually obscures this code, so
- // keep it in a member var for this::ReadSegments to insepct. Similar
+ // keep it in a member var for this::ReadSegments to inspect. Similar
// to nsHttpConnection::mSocketOutCondition
- mReadSegmentBlocked = (PR_GetError() == PR_WOULD_BLOCK_ERROR);
- return mReadSegmentBlocked ? NS_BASE_STREAM_WOULD_BLOCK : NS_ERROR_FAILURE;
+ PRErrorCode code = PR_GetError();
+ mReadSegmentReturnValue = ErrorAccordingToNSPR(code);
+
+ return mReadSegmentReturnValue;
}
aCount -= written;
aData += written;
@@ -273,10 +290,18 @@ TLSFilterTransaction::OnWriteSegment(char *aData,
mFilterReadCode = NS_OK;
int32_t bytesRead = PR_Read(mFD, aData, aCount);
if (bytesRead == -1) {
- if (PR_GetError() == PR_WOULD_BLOCK_ERROR) {
+ PRErrorCode code = PR_GetError();
+ if (code == PR_WOULD_BLOCK_ERROR) {
return NS_BASE_STREAM_WOULD_BLOCK;
}
- return NS_ERROR_FAILURE;
+ // If reading from the socket succeeded (NS_SUCCEEDED(mFilterReadCode)),
+ // but the nss layer encountered an error remember the error.
+ if (NS_SUCCEEDED(mFilterReadCode)) {
+ mFilterReadCode = ErrorAccordingToNSPR(code);
+ LOG(("TLSFilterTransaction::OnWriteSegment %p nss error %" PRIx32 ".\n",
+ this, static_cast<uint32_t>(mFilterReadCode)));
+ }
+ return mFilterReadCode;
}
*outCountRead = bytesRead;
@@ -303,7 +328,7 @@ TLSFilterTransaction::FilterInput(char *aBuf, int32_t aAmount)
if (NS_SUCCEEDED(mFilterReadCode) && outCountRead) {
LOG(("TLSFilterTransaction::FilterInput rv=%x read=%d input from net "
"1 layer stripped, 1 still on\n", mFilterReadCode, outCountRead));
- if (mReadSegmentBlocked) {
+ if (mReadSegmentReturnValue == NS_BASE_STREAM_WOULD_BLOCK) {
mNudgeCounter = 0;
}
}
@@ -325,19 +350,18 @@ TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader *aReader,
return NS_ERROR_UNEXPECTED;
}
- mReadSegmentBlocked = false;
+ mReadSegmentReturnValue = NS_OK;
mSegmentReader = aReader;
nsresult rv = mTransaction->ReadSegments(this, aCount, outCountRead);
LOG(("TLSFilterTransaction %p called trans->ReadSegments rv=%x %d\n",
this, rv, *outCountRead));
- if (NS_SUCCEEDED(rv) && mReadSegmentBlocked) {
- rv = NS_BASE_STREAM_WOULD_BLOCK;
+ if (NS_SUCCEEDED(rv) && (mReadSegmentReturnValue == NS_BASE_STREAM_WOULD_BLOCK)) {
LOG(("TLSFilterTransaction %p read segment blocked found rv=%x\n",
- this, rv));
+ this, static_cast<uint32_t>(rv)));
Connection()->ForceSend();
}
- return rv;
+ return NS_SUCCEEDED(rv) ? mReadSegmentReturnValue : rv;
}
nsresult
@@ -442,7 +466,10 @@ TLSFilterTransaction::Notify(nsITimer *timer)
if (timer != mTimer) {
return NS_ERROR_UNEXPECTED;
}
- StartTimerCallback();
+ nsresult rv = StartTimerCallback();
+ if (NS_FAILED(rv)) {
+ Close(rv);
+ }
return NS_OK;
}
@@ -456,7 +483,7 @@ TLSFilterTransaction::StartTimerCallback()
// This class can be called re-entrantly, so cleanup m* before ->on()
RefPtr<NudgeTunnelCallback> cb(mNudgeCallback);
mNudgeCallback = nullptr;
- cb->OnTunnelNudged(this);
+ return cb->OnTunnelNudged(this);
}
return NS_OK;
}
@@ -675,10 +702,12 @@ TLSFilterTransaction::TakeSubTransactions(
}
nsresult
-TLSFilterTransaction::SetProxiedTransaction(nsAHttpTransaction *aTrans)
+TLSFilterTransaction::SetProxiedTransaction(nsAHttpTransaction *aTrans,
+ nsAHttpTransaction *aSpdyConnectTransaction)
{
- LOG(("TLSFilterTransaction::SetProxiedTransaction [this=%p] aTrans=%p\n",
- this, aTrans));
+ LOG(("TLSFilterTransaction::SetProxiedTransaction [this=%p] aTrans=%p, "
+ "aSpdyConnectTransaction=%p\n",
+ this, aTrans, aSpdyConnectTransaction));
mTransaction = aTrans;
nsCOMPtr<nsIInterfaceRequestor> callbacks;
@@ -688,6 +717,8 @@ TLSFilterTransaction::SetProxiedTransaction(nsAHttpTransaction *aTrans)
secCtrl->SetNotificationCallbacks(callbacks);
}
+ mWeakTrans = do_GetWeakReference(aSpdyConnectTransaction);
+
return NS_OK;
}
@@ -1075,7 +1106,7 @@ SpdyConnectTransaction::MapStreamToHttpConnection(nsISocketTransport *aTransport
if (mForcePlainText) {
mTunneledConn->ForcePlainText();
} else {
- mTunneledConn->SetupSecondaryTLS();
+ mTunneledConn->SetupSecondaryTLS(this);
mTunneledConn->SetInSpdyTunnel(true);
}
diff --git a/netwerk/protocol/http/TunnelUtils.h b/netwerk/protocol/http/TunnelUtils.h
index 20cfaf7ee9..4a003082ec 100644
--- a/netwerk/protocol/http/TunnelUtils.h
+++ b/netwerk/protocol/http/TunnelUtils.h
@@ -93,10 +93,11 @@ class TLSFilterTransaction;
class NudgeTunnelCallback : public nsISupports
{
public:
- virtual void OnTunnelNudged(TLSFilterTransaction *) = 0;
+ virtual nsresult OnTunnelNudged(TLSFilterTransaction *) = 0;
};
-#define NS_DECL_NUDGETUNNELCALLBACK void OnTunnelNudged(TLSFilterTransaction *) override;
+#define NS_DECL_NUDGETUNNELCALLBACK \
+ nsresult OnTunnelNudged(TLSFilterTransaction *) override;
class TLSFilterTransaction final
: public nsAHttpTransaction
@@ -121,7 +122,8 @@ public:
nsresult CommitToSegmentSize(uint32_t size, bool forceCommitment) override;
nsresult GetTransactionSecurityInfo(nsISupports **) override;
nsresult NudgeTunnel(NudgeTunnelCallback *callback);
- nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans);
+ MOZ_MUST_USE nsresult SetProxiedTransaction(nsAHttpTransaction *aTrans,
+ nsAHttpTransaction *aSpdyConnectTransaction = nullptr);
void newIODriver(nsIAsyncInputStream *aSocketIn,
nsIAsyncOutputStream *aSocketOut,
nsIAsyncInputStream **outSocketIn,
@@ -153,6 +155,7 @@ private:
private:
RefPtr<nsAHttpTransaction> mTransaction;
+ nsWeakPtr mWeakTrans; // SpdyConnectTransaction *
nsCOMPtr<nsISupports> mSecInfo;
nsCOMPtr<nsITimer> mTimer;
RefPtr<NudgeTunnelCallback> mNudgeCallback;
@@ -168,7 +171,7 @@ private:
nsresult mFilterReadCode;
bool mForce;
- bool mReadSegmentBlocked;
+ nsresult mReadSegmentReturnValue;
uint32_t mNudgeCounter;
};
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index a890c51b3d..481df5ff04 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -324,10 +324,16 @@ nsHttpChannel::Init(nsIURI *uri,
nsProxyInfo *proxyInfo,
uint32_t proxyResolveFlags,
nsIURI *proxyURI,
- const nsID& channelId)
-{
- nsresult rv = HttpBaseChannel::Init(uri, caps, proxyInfo,
- proxyResolveFlags, proxyURI, channelId);
+ const nsID& channelId,
+ nsContentPolicyType aContentPolicyType)
+{
+ nsresult rv = HttpBaseChannel::Init(uri,
+ caps,
+ proxyInfo,
+ proxyResolveFlags,
+ proxyURI,
+ channelId,
+ aContentPolicyType);
if (NS_FAILED(rv))
return rv;
diff --git a/netwerk/protocol/http/nsHttpChannel.h b/netwerk/protocol/http/nsHttpChannel.h
index 554875b1cd..0038e1f716 100644
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -123,7 +123,8 @@ public:
virtual nsresult Init(nsIURI *aURI, uint32_t aCaps, nsProxyInfo *aProxyInfo,
uint32_t aProxyResolveFlags,
nsIURI *aProxyURI,
- const nsID& aChannelId) override;
+ const nsID& aChannelId,
+ nsContentPolicyType aContentPolicyType) override;
nsresult OnPush(const nsACString &uri, Http2PushedStream *pushedStream);
diff --git a/netwerk/protocol/http/nsHttpConnection.cpp b/netwerk/protocol/http/nsHttpConnection.cpp
index 8ccba76e2c..505d849c0b 100644
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -535,16 +535,16 @@ npnComplete:
return true;
}
-void
+nsresult
nsHttpConnection::OnTunnelNudged(TLSFilterTransaction *trans)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
LOG(("nsHttpConnection::OnTunnelNudged %p\n", this));
if (trans != mTLSFilter) {
- return;
+ return NS_OK;
}
LOG(("nsHttpConnection::OnTunnelNudged %p Calling OnSocketWritable\n", this));
- OnSocketWritable();
+ return OnSocketWritable();
}
// called on the socket thread
@@ -639,7 +639,9 @@ nsHttpConnection::Activate(nsAHttpTransaction *trans, uint32_t caps, int32_t pri
}
if (mTLSFilter) {
- mTLSFilter->SetProxiedTransaction(trans);
+ RefPtr<NullHttpTransaction> baseTrans(do_QueryReferent(mWeakTrans));
+ rv = mTLSFilter->SetProxiedTransaction(trans, baseTrans);
+ NS_ENSURE_SUCCESS(rv, rv);
mTransaction = mTLSFilter;
}
@@ -1979,7 +1981,7 @@ nsHttpConnection::OnSocketReadable()
// negotiation are known (which is determined from the write path).
// If the server speaks SPDY it is likely the readable data here is
// a spdy settings frame and without NPN it would be misinterpreted
- // as HTTP/*
+ // as HTTP
LOG(("nsHttpConnection::OnSocketReadable %p return due to inactive "
"tunnel setup but incomplete NPN state\n", this));
@@ -2019,12 +2021,14 @@ nsHttpConnection::OnSocketReadable()
}
void
-nsHttpConnection::SetupSecondaryTLS()
+nsHttpConnection::SetupSecondaryTLS(nsAHttpTransaction *aSpdyConnectTransaction)
{
MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
MOZ_ASSERT(!mTLSFilter);
- LOG(("nsHttpConnection %p SetupSecondaryTLS %s %d\n",
- this, mConnInfo->Origin(), mConnInfo->OriginPort()));
+ LOG(("nsHttpConnection %p SetupSecondaryTLS %s %d "
+ "aSpdyConnectTransaction=%p\n",
+ this, mConnInfo->Origin(), mConnInfo->OriginPort(),
+ aSpdyConnectTransaction));
nsHttpConnectionInfo *ci = nullptr;
if (mTransaction) {
@@ -2041,6 +2045,7 @@ nsHttpConnection::SetupSecondaryTLS()
if (mTransaction) {
mTransaction = mTLSFilter;
}
+ mWeakTrans = do_GetWeakReference(aSpdyConnectTransaction);
}
void
diff --git a/netwerk/protocol/http/nsHttpConnection.h b/netwerk/protocol/http/nsHttpConnection.h
index 08eea1de28..ce7523eb53 100644
--- a/netwerk/protocol/http/nsHttpConnection.h
+++ b/netwerk/protocol/http/nsHttpConnection.h
@@ -202,7 +202,7 @@ public:
static nsresult MakeConnectString(nsAHttpTransaction *trans,
nsHttpRequestHead *request,
nsACString &result);
- void SetupSecondaryTLS();
+ void SetupSecondaryTLS(nsAHttpTransaction *aSpdyConnectTransaction = nullptr);
void SetInSpdyTunnel(bool arg);
// Check active connections for traffic (or not). SPDY connections send a
@@ -281,6 +281,7 @@ private:
// transaction is open, otherwise it is null.
RefPtr<nsAHttpTransaction> mTransaction;
RefPtr<TLSFilterTransaction> mTLSFilter;
+ nsWeakPtr mWeakTrans; // SpdyConnectTransaction *
RefPtr<nsHttpHandler> mHttpHandler; // keep gHttpHandler alive
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 4779614546..0f4c942021 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -468,7 +468,9 @@ nsHttpHandler::InitConnectionMgr()
}
nsresult
-nsHttpHandler::AddStandardRequestHeaders(nsHttpRequestHead *request, bool isSecure)
+nsHttpHandler::AddStandardRequestHeaders(nsHttpRequestHead *request,
+ bool isSecure,
+ nsContentPolicyType aContentPolicyType)
{
nsresult rv;
@@ -481,7 +483,20 @@ nsHttpHandler::AddStandardRequestHeaders(nsHttpRequestHead *request, bool isSecu
// Add the "Accept" header. Note, this is set as an override because the
// service worker expects to see it. The other "default" headers are
// hidden from service worker interception.
- rv = request->SetHeader(nsHttp::Accept, mAccept,
+ nsAutoCString accept;
+ if (aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT ||
+ aContentPolicyType == nsIContentPolicy::TYPE_SUBDOCUMENT) {
+ accept.Assign(mAcceptNavigation);
+ } else if (aContentPolicyType == nsIContentPolicy::TYPE_IMAGE ||
+ aContentPolicyType == nsIContentPolicy::TYPE_IMAGESET) {
+ accept.Assign(mAcceptImage);
+ } else if (aContentPolicyType == nsIContentPolicy::TYPE_STYLESHEET) {
+ accept.Assign(mAcceptStyle);
+ } else {
+ accept.Assign(mAcceptDefault);
+ }
+
+ rv = request->SetHeader(nsHttp::Accept, accept,
false, nsHttpHeaderArray::eVarietyRequestOverride);
if (NS_FAILED(rv)) return rv;
@@ -1268,12 +1283,36 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
mQoSBits = (uint8_t) clamped(val, 0, 0xff);
}
+ if (PREF_CHANGED(HTTP_PREF("accept.navigation"))) {
+ nsXPIDLCString accept;
+ rv = prefs->GetCharPref(HTTP_PREF("accept.navigation"),
+ getter_Copies(accept));
+ if (NS_SUCCEEDED(rv))
+ SetAccept(accept, ACCEPT_NAVIGATION);
+ }
+
+ if (PREF_CHANGED(HTTP_PREF("accept.image"))) {
+ nsXPIDLCString accept;
+ rv = prefs->GetCharPref(HTTP_PREF("accept.image"),
+ getter_Copies(accept));
+ if (NS_SUCCEEDED(rv))
+ SetAccept(accept, ACCEPT_IMAGE);
+ }
+
+ if (PREF_CHANGED(HTTP_PREF("accept.style"))) {
+ nsXPIDLCString accept;
+ rv = prefs->GetCharPref(HTTP_PREF("accept.style"),
+ getter_Copies(accept));
+ if (NS_SUCCEEDED(rv))
+ SetAccept(accept, ACCEPT_STYLE);
+ }
+
if (PREF_CHANGED(HTTP_PREF("accept.default"))) {
nsXPIDLCString accept;
rv = prefs->GetCharPref(HTTP_PREF("accept.default"),
getter_Copies(accept));
if (NS_SUCCEEDED(rv))
- SetAccept(accept);
+ SetAccept(accept, ACCEPT_DEFAULT);
}
if (PREF_CHANGED(HTTP_PREF("accept-encoding"))) {
@@ -1897,9 +1936,21 @@ nsHttpHandler::SetAcceptLanguages()
}
nsresult
-nsHttpHandler::SetAccept(const char *aAccept)
+nsHttpHandler::SetAccept(const char *aAccept, AcceptType aType)
{
- mAccept = aAccept;
+ switch (aType) {
+ case ACCEPT_NAVIGATION:
+ mAcceptNavigation = aAccept;
+ break;
+ case ACCEPT_IMAGE:
+ mAcceptImage = aAccept;
+ break;
+ case ACCEPT_STYLE:
+ mAcceptStyle = aAccept;
+ break;
+ case ACCEPT_DEFAULT:
+ mAcceptDefault = aAccept;
+ }
return NS_OK;
}
@@ -2057,7 +2108,11 @@ nsHttpHandler::NewProxiedChannel2(nsIURI *uri,
rv = NewChannelId(&channelId);
NS_ENSURE_SUCCESS(rv, rv);
- rv = httpChannel->Init(uri, caps, proxyInfo, proxyResolveFlags, proxyURI, channelId);
+ nsContentPolicyType contentPolicyType =
+ aLoadInfo ? aLoadInfo->GetExternalContentPolicyType()
+ : nsIContentPolicy::TYPE_OTHER;
+
+ rv = httpChannel->Init(uri, caps, proxyInfo, proxyResolveFlags, proxyURI, channelId, contentPolicyType);
if (NS_FAILED(rv))
return rv;
diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h
index f1ec0f947f..67b9ebe0eb 100644
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -15,6 +15,7 @@
#include "nsCOMPtr.h"
#include "nsWeakReference.h"
+#include "nsIContentPolicy.h"
#include "nsIHttpProtocolHandler.h"
#include "nsIObserver.h"
#include "nsISpeculativeConnect.h"
@@ -50,6 +51,14 @@ enum FrameCheckLevel {
FRAMECHECK_STRICT
};
+// Fetch spec different http Accept types
+enum AcceptType {
+ ACCEPT_NAVIGATION,
+ ACCEPT_IMAGE,
+ ACCEPT_STYLE,
+ ACCEPT_DEFAULT,
+};
+
//-----------------------------------------------------------------------------
// nsHttpHandler - protocol handler for HTTP and HTTPS
//-----------------------------------------------------------------------------
@@ -70,7 +79,7 @@ public:
nsHttpHandler();
nsresult Init();
- nsresult AddStandardRequestHeaders(nsHttpRequestHead *, bool isSecure);
+ nsresult AddStandardRequestHeaders(nsHttpRequestHead *, bool isSecure, nsContentPolicyType aContentPolicyType);
nsresult AddConnectionHeader(nsHttpRequestHead *,
uint32_t capabilities);
bool IsAcceptableEncoding(const char *encoding, bool isSecure);
@@ -385,7 +394,7 @@ private:
void InitUserAgentComponents();
void PrefsChanged(nsIPrefBranch *prefs, const char *pref);
- nsresult SetAccept(const char *);
+ nsresult SetAccept(const char *, AcceptType aType);
nsresult SetAcceptLanguages();
nsresult SetAcceptEncodings(const char *, bool mIsSecure);
@@ -394,8 +403,8 @@ private:
void NotifyObservers(nsIHttpChannel *chan, const char *event);
static void TimerCallback(nsITimer * aTimer, void * aClosure);
+
private:
-
// cached services
nsMainThreadPtrHandle<nsIIOService> mIOService;
nsMainThreadPtrHandle<nsIStreamConverterService> mStreamConvSvc;
@@ -460,7 +469,10 @@ private:
bool mPipeliningOverSSL;
bool mEnforceAssocReq;
- nsCString mAccept;
+ nsCString mAcceptNavigation;
+ nsCString mAcceptImage;
+ nsCString mAcceptStyle;
+ nsCString mAcceptDefault;
nsCString mAcceptLanguages;
nsCString mHttpAcceptEncodings;
nsCString mHttpsAcceptEncodings;
diff --git a/netwerk/sctp/datachannel/DataChannel.cpp b/netwerk/sctp/datachannel/DataChannel.cpp
index ebc430f8c8..19be43d1cd 100644
--- a/netwerk/sctp/datachannel/DataChannel.cpp
+++ b/netwerk/sctp/datachannel/DataChannel.cpp
@@ -1928,12 +1928,21 @@ DataChannelConnection::ReceiveCallback(struct socket* sock, void *data, size_t d
if (!data) {
usrsctp_close(sock); // SCTP has finished shutting down
} else {
- mLock.AssertCurrentThreadOwns();
+ bool locked = false;
+ if (!IsSTSThread()) {
+ mLock.Lock();
+ locked = true;
+ } else {
+ mLock.AssertCurrentThreadOwns();
+ }
if (flags & MSG_NOTIFICATION) {
HandleNotification(static_cast<union sctp_notification *>(data), datalen);
} else {
HandleMessage(data, datalen, ntohl(rcv.rcv_ppid), rcv.rcv_sid);
}
+ if (locked) {
+ mLock.Unlock();
+ }
}
// sctp allocates 'data' with malloc(), and expects the receiver to free
// it (presumably with free).
diff --git a/netwerk/test/mochitests/mochitest.ini b/netwerk/test/mochitests/mochitest.ini
index f8a9190315..3cd5a674b6 100644
--- a/netwerk/test/mochitests/mochitest.ini
+++ b/netwerk/test/mochitests/mochitest.ini
@@ -25,3 +25,5 @@ support-files =
[test_viewsource_unlinkable.html]
[test_xhr_method_case.html]
[test_1396395.html]
+[test_accept_header.html]
+support-files = test_accept_header.sjs
diff --git a/netwerk/test/mochitests/test_accept_header.html b/netwerk/test/mochitests/test_accept_header.html
new file mode 100644
index 0000000000..b8434230f4
--- /dev/null
+++ b/netwerk/test/mochitests/test_accept_header.html
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+ <title>Accept header</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<script>
+
+// All the requests are sent to test_accept_header.sjs which will return
+// different content based on the queryString. When the queryString is 'get',
+// test_accept_header.sjs returns a JSON object with the latest request and its
+// accept header value.
+
+function test_last_request_and_continue(query, expected) {
+ fetch("test_accept_header.sjs?get").then(r => r.json()).then(json => {
+ is(json.type, query, "Expected: " + query);
+ is(json.accept, expected, "Accept header: " + expected);
+ next();
+ });
+}
+
+function test_iframe() {
+ let observer = new PerformanceObserver(function(list, obj) {
+ obj.disconnect();
+
+ list.getEntries().forEach(entry => {
+ if (entry.name.endsWith("test_accept_header.sjs?iframe")) {
+ obj.disconnect();
+ test_last_request_and_continue("iframe", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
+ }
+ });
+ });
+
+ observer.observe({entryTypes: ["resource"]});
+
+ let ifr = document.createElement("iframe");
+ ifr.src = "test_accept_header.sjs?iframe";
+ document.body.appendChild(ifr);
+}
+
+function test_image() {
+ let i = new Image();
+ i.src = "test_accept_header.sjs?image";
+ i.onload = function() {
+ // Fetch spec says we should have: "image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5"
+ test_last_request_and_continue("image", "image/webp,image/png,image/*;q=0.8,*/*;q=0.5");
+ }
+}
+
+function test_style() {
+ let observer = new PerformanceObserver(function(list, obj) {
+ obj.disconnect();
+
+ list.getEntries().forEach(entry => {
+ if (entry.name.endsWith("test_accept_header.sjs?style")) {
+ obj.disconnect();
+ test_last_request_and_continue("style", "text/css,*/*;q=0.1");
+ }
+ });
+ });
+
+ observer.observe({entryTypes: ["resource"]});
+
+ let head = document.getElementsByTagName("head")[0];
+ let link = document.createElement("link");
+ link.rel = "stylesheet";
+ link.type = "text/css";
+ link.href = "test_accept_header.sjs?style";
+ head.appendChild(link);
+}
+
+function test_worker() {
+ let w = new Worker("test_accept_header.sjs?worker");
+ w.onmessage = function() {
+ test_last_request_and_continue("worker", "*/*");
+ }
+}
+
+let tests = [
+ test_iframe,
+ test_image,
+ test_style,
+ test_worker,
+];
+
+function next() {
+ if (tests.length == 0) {
+ SimpleTest.finish();
+ return;
+ }
+
+ let test = tests.shift();
+ test();
+}
+
+SimpleTest.waitForExplicitFinish();
+
+SpecialPowers.pushPrefEnv({ "set": [
+ [ "dom.enable_performance_observer", true ]
+]}, next);
+
+</script>
+</body>
+</html>
diff --git a/netwerk/test/mochitests/test_accept_header.sjs b/netwerk/test/mochitests/test_accept_header.sjs
new file mode 100644
index 0000000000..035c886aa2
--- /dev/null
+++ b/netwerk/test/mochitests/test_accept_header.sjs
@@ -0,0 +1,48 @@
+function handleRequest(request, response) {
+ response.setStatusLine(request.httpVersion, "200", "OK");
+
+ if (request.queryString == "worker") {
+ response.setHeader("Content-Type", "application/json", false);
+ response.write("postMessage(42)");
+
+ setState("data", JSON.stringify({type: "worker", accept: request.getHeader("Accept") }));
+ return;
+ }
+
+ if (request.queryString == "image") {
+ // A 1x1 PNG image.
+ // Source: https://commons.wikimedia.org/wiki/File:1x1.png (Public Domain)
+ const IMAGE = atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAA" +
+ "ACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=");
+
+ response.setHeader("Content-Type", "image/png", false);
+ response.write(IMAGE);
+
+ setState("data", JSON.stringify({type: "image", accept: request.getHeader("Accept") }));
+ return;
+ }
+
+ if (request.queryString == "style") {
+ response.setHeader("Content-Type", "text/css", false);
+ response.write("");
+
+ setState("data", JSON.stringify({type: "style", accept: request.getHeader("Accept") }));
+ return;
+ }
+
+ if (request.queryString == "iframe") {
+ response.setHeader("Content-Type", "text/html", false);
+ response.write("<h1>Hello world!</h1>");
+
+ setState("data", JSON.stringify({type: "iframe", accept: request.getHeader("Accept") }));
+ return;
+ }
+
+ if (request.queryString == "get") {
+ response.setHeader("Content-Type", "text/javascript", false);
+ response.write(getState("data"));
+
+ setState("data", "");
+ return;
+ }
+}
diff --git a/old-configure.in b/old-configure.in
index 0d9ace960d..0ccc0540e9 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -68,7 +68,7 @@ GNOMEUI_VERSION=2.2.0
GCONF_VERSION=1.2.1
STARTUP_NOTIFICATION_VERSION=0.8
DBUS_VERSION=0.60
-SQLITE_VERSION=3.26.0
+SQLITE_VERSION=3.27.2
dnl Set various checks
dnl ========================================================
@@ -215,11 +215,12 @@ case "$target" in
# -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
-
- # Disable C++11 thread-safe statics due to crashes on XP (bug 1204752)
- # See https://connect.microsoft.com/VisualStudio/feedback/details/1789709/visual-c-2015-runtime-broken-on-windows-server-2003-c-11-magic-statics
- CXXFLAGS="$CXXFLAGS -Zc:threadSafeInit-"
-
+
+ # C4752: We explicitly use AVX instructions in only some libs, not global
+ # This is a pointless "helpful warning" to use /arch:AVX which we don't want.
+ CFLAGS="$CFLAGS -wd4752"
+ CXXFLAGS="$CXXFLAGS -wd4752"
+
# https://connect.microsoft.com/VisualStudio/feedback/details/888527/warnings-on-dbghelp-h
# for dbghelp.h, imagehlp.h, and shobj.h
# C4091: 'typedef ': ignored on left of '' when no variable is declared
@@ -3564,23 +3565,6 @@ AC_CHECK_PROGS(WGET, wget, "")
AC_SUBST(WGET)
dnl ========================================================
-dnl Maintenance Service
-dnl ========================================================
-
-MOZ_ARG_ENABLE_BOOL(maintenance-service,
-[ --enable-maintenance-service Enable building of maintenanceservice],
- MOZ_MAINTENANCE_SERVICE=1,
- MOZ_MAINTENANCE_SERVICE= )
-
-if test -n "$MOZ_MAINTENANCE_SERVICE"; then
- if test "$OS_ARCH" = "WINNT"; then
- AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
- else
- AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
- fi
-fi
-
-dnl ========================================================
dnl Bundled fonts on desktop platforms
dnl ========================================================
@@ -5069,7 +5053,6 @@ AC_SUBST(MOZ_UNIVERSALCHARDET)
AC_SUBST(ACCESSIBILITY)
AC_SUBST(MOZ_SPELLCHECK)
AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
-AC_SUBST(MOZ_MAINTENANCE_SERVICE)
AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
AC_SUBST(MOZ_ENABLE_SIGNMAR)
AC_SUBST(MOZ_UPDATER)
@@ -5594,22 +5577,6 @@ fi
AC_SUBST(PREPROCESS_OPTION)
-dnl ========================================================
-dnl mask as shorthand property
-dnl ========================================================
-
-# The control structure code will be removed as soon as the feature is stable
-# Refer to bug 1281101 for more details.
-
-# Enable mask-as-shorthand property by default for nightly and aurora channels
-if test -z "$RELEASE_OR_BETA"; then
- dnl mask as shorthand property enabled
- MOZ_ENABLE_MASK_AS_SHORTHAND=1
- AC_DEFINE(MOZ_ENABLE_MASK_AS_SHORTHAND)
-fi
-
-AC_SUBST(MOZ_ENABLE_MASK_AS_SHORTHAND)
-
# Avoid using obsolete NSPR features
AC_DEFINE(NO_NSPR_10_SUPPORT)
diff --git a/other-licenses/7zstub/LICENSE b/other-licenses/7zstub/LICENSE
new file mode 100644
index 0000000000..b07f078cec
--- /dev/null
+++ b/other-licenses/7zstub/LICENSE
@@ -0,0 +1,7 @@
+License
+
+LZMA SDK is placed in the public domain.
+
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute the
+original LZMA SDK code, either in source code form or as a compiled binary, for
+any purpose, commercial or non-commercial, and by any means.
diff --git a/other-licenses/7zstub/README.mcp b/other-licenses/7zstub/README.mcp
new file mode 100644
index 0000000000..d63e49ce87
--- /dev/null
+++ b/other-licenses/7zstub/README.mcp
@@ -0,0 +1,71 @@
+This directory contains the LZMA SDK code used in building the self-extracting
+Windows installer.
+
+The src/ directory contains an almost-unmodified copy of the 7-zip source code
+version 18.05, as downloaded from https://www.7-zip.org/a/lzma1805.7z (linked
+from https://www.7-zip.org/sdk.html). As stated in DOC/lzma-sdk.txt and on the
+web page, this code is in the public domain. A few modifications have been
+made to this copy of the source code. Those modifications are contained in
+customizations.diff, which should be found in the same directory as this file.
+
+The palemoon/ and uxp/ directories contain 7zSD.sfx, a 32-bit Windows executable
+built from the Visual C++ 6 project found in the src/CPP/7zip/Bundles/SFXSetup/
+directory with customizations. The "ReleaseD" configuration was used.
+The uxp/ version contains generic vendor information and can be used for any
+UXP application's installer with minimal confusion for the user. Basilisk
+uses this generic version.
+The ReleaseD/ directory contains 7zSD.sfx, which is an unmodified binary
+from that build process, ready to be customized for any target application.
+Including a compiled binary in the source tree is certainly not preferred, but
+is necessary in this case because the code does not build cleanly under more
+recent compilers. Using an older toolchain also allows us to keep this
+executable running on older Windows versions which are no longer supported by
+the build system used for the main application; that means we can show an error
+message specifically informing users that their OS is too old, instead of the
+generic "not a valid Win32 application" error that Windows would generate if we
+used the newer toolchain and that isn't very helpful to most users.
+Using a precompiled binary also allows the installer build procedure to work
+without a compiler toolchain being configured.
+
+The palemoon/ and uxp/ directories also contain a manifest which was edited
+into 7zSD.sfx's resources after build time. The manifest had to be added
+this way because the older resource compiler does not support manifests
+(and the 7-zip build files do not try to use any).
+
+The version info in the compiled binary was also edited after build time. There
+isn't a technical reason why the version info changes couldn't be included at
+build time, but since the goal is just to avoid confusing users about the origin
+of the installer, not to appear to be making the claim that we wrote the
+LZMA SDK, a more targeted change is appropriate.
+
+** BUILDING 7zSD.sfx yourself **
+
+Step-by-step instructions for generating 7zSD.sfx:
+1) Install Microsoft Visual C++ 6 Professional or Enterprise edition (the
+ Standard edition does not include the optimizing compiler, so it should
+ not be used). You'll likely want a virtual machine running Windows XP SP3,
+ because running VC6 under more modern Windows versions is tricky, to say
+ the least. Some people have reported success running it on Vista or Win 7,
+ but please just save yourself the headache!
+ Once installed, make sure to launch the Visual C++ 6.0 IDE at least once.
+2) Install an appropriate Windows SDK version. The Windows XP Service Pack 2 SDK
+ is known to work well, but that particular version appears to only be
+ available from archive.org:
+https://web.archive.org/web/20080209175723/http://www.microsoft.com:80/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
+ Follow the instructions on that archived page to install the SDK.
+3) Run the tool included with the SDK that configures Visual C++ to use it.
+ Start > All Programs > Microsoft Platform SDK for Windows XP SP2 >
+ Visual Studio Registration > Register PSDK Directories with Visual Studio
+4) If using a fresh copy of the LZMA SDK sources, apply the patch in
+ customizations.diff. The copy in the UXP source tree already has these
+ changes applied.
+5) Open the workspace file at src\CPP\7zip\Bundles\SFXSetup\SFXSetup.dsw and
+ build it using the "SFXSetup - Win32 ReleaseD" configuration. The output
+ executable should be at the path ReleaseD\7zSD.sfx relative to SFXSetup.dsw.
+6) Use Resource Hacker (available from http://angusj.com/resourcehacker/) to
+ (if desired) replace the existing icon on 7zSD.sfx and to add the manifest
+ as a new resource. Also edit the version info resource to replace CompanyName
+ and LegalCopyright with an appropriate vendor name and FileDescription and
+ ProductName with an appropriate product name.
+ Be sure to recompile the resources using the green "play" button in the
+ toolbar (or by pressing F5) before saving the edited binary file.
diff --git a/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe b/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe
new file mode 100644
index 0000000000..e1e37cf2e8
--- /dev/null
+++ b/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe
Binary files differ
diff --git a/other-licenses/7zstub/customizations.diff b/other-licenses/7zstub/customizations.diff
new file mode 100644
index 0000000000..e71540b514
--- /dev/null
+++ b/other-licenses/7zstub/customizations.diff
@@ -0,0 +1,363 @@
+diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
+index b1d740e..61cb260 100644
+--- a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
++++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
+@@ -54,7 +54,7 @@ BSC32=bscmake.exe
+ # ADD BSC32 /nologo
+ LINK32=link.exe
+ # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+-# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7zS.sfx" /opt:NOWIN98
++# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib delayimp.lib /nologo /subsystem:windows /machine:I386 /out:"Release\7zS.sfx" /opt:NOWIN98 /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
+ # SUBTRACT LINK32 /pdb:none
+
+ !ELSEIF "$(CFG)" == "SFXSetup - Win32 Debug"
+@@ -81,7 +81,7 @@ BSC32=bscmake.exe
+ # ADD BSC32 /nologo
+ LINK32=link.exe
+ # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\UTIL\7zSfxS.exe" /pdbtype:sept
++# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib delayimp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug\7zSfxS.exe" /pdbtype:sept /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
+
+ !ELSEIF "$(CFG)" == "SFXSetup - Win32 ReleaseD"
+
+@@ -107,9 +107,9 @@ BSC32=bscmake.exe
+ # ADD BASE BSC32 /nologo
+ # ADD BSC32 /nologo
+ LINK32=link.exe
+-# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\UTIL\7zWinSR.exe"
++# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\UTIL\7zWinSR.exe"
+ # SUBTRACT BASE LINK32 /debug /nodefaultlib
+-# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7zSD.sfx" /opt:NOWIN98
++# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib delayimp.lib /nologo /subsystem:windows /machine:I386 /out:"ReleaseD\7zSD.sfx" /opt:NOWIN98 /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
+ # SUBTRACT LINK32 /pdb:none
+
+ !ENDIF
+diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
+index 1705a8d..e3a3bb2 100644
+--- a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
++++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
+@@ -125,6 +125,179 @@ static void ShowErrorMessageSpec(const UString &name)
+ ShowErrorMessage(NULL, message);
+ }
+
++/* BEGIN Mozilla customizations */
++
++static char const *
++FindStrInBuf(char const * buf, size_t bufLen, char const * str)
++{
++ size_t index = 0;
++ while (index < bufLen) {
++ char const * result = strstr(buf + index, str);
++ if (result) {
++ return result;
++ }
++ while ((buf[index] != '\0') && (index < bufLen)) {
++ index++;
++ }
++ index++;
++ }
++ return NULL;
++}
++
++static bool
++ReadPostSigningDataFromView(char const * view, DWORD size, AString& data)
++{
++ // Find the offset and length of the certificate table,
++ // so we know the valid range to look for the token.
++ if (size < (0x3c + sizeof(UInt32))) {
++ return false;
++ }
++ UInt32 PEHeaderOffset = *(UInt32*)(view + 0x3c);
++ UInt32 optionalHeaderOffset = PEHeaderOffset + 24;
++ UInt32 certDirEntryOffset = 0;
++ if (size < (optionalHeaderOffset + sizeof(UInt16))) {
++ return false;
++ }
++ UInt16 magic = *(UInt16*)(view + optionalHeaderOffset);
++ if (magic == 0x010b) {
++ // 32-bit executable
++ certDirEntryOffset = optionalHeaderOffset + 128;
++ } else if (magic == 0x020b) {
++ // 64-bit executable; certain header fields are wider
++ certDirEntryOffset = optionalHeaderOffset + 144;
++ } else {
++ // Unknown executable
++ return false;
++ }
++ if (size < certDirEntryOffset + 8) {
++ return false;
++ }
++ UInt32 certTableOffset = *(UInt32*)(view + certDirEntryOffset);
++ UInt32 certTableLen = *(UInt32*)(view + certDirEntryOffset + sizeof(UInt32));
++ if (certTableOffset == 0 || certTableLen == 0 ||
++ size < (certTableOffset + certTableLen)) {
++ return false;
++ }
++
++ char const token[] = "__MOZCUSTOM__:";
++ // We're searching for a string inside a binary blob,
++ // so a normal strstr that bails on the first NUL won't work.
++ char const * tokenPos = FindStrInBuf(view + certTableOffset,
++ certTableLen, token);
++ if (tokenPos) {
++ size_t tokenLen = (sizeof(token) / sizeof(token[0])) - 1;
++ data = AString(tokenPos + tokenLen);
++ return true;
++ }
++ return false;
++}
++
++static bool
++ReadPostSigningData(UString exePath, AString& data)
++{
++ bool retval = false;
++ HANDLE exeFile = CreateFileW(exePath, GENERIC_READ, FILE_SHARE_READ, NULL,
++ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
++ if (exeFile != INVALID_HANDLE_VALUE) {
++ HANDLE mapping = CreateFileMapping(exeFile, NULL, PAGE_READONLY, 0, 0, NULL);
++ if (mapping != INVALID_HANDLE_VALUE) {
++ // MSDN claims the return value on failure is NULL,
++ // but I've also seen it returned on success, so double-check.
++ if (mapping || GetLastError() == ERROR_SUCCESS) {
++ char * view = (char*)MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
++ if (view) {
++ DWORD fileSize = GetFileSize(exeFile, NULL);
++ retval = ReadPostSigningDataFromView(view, fileSize, data);
++ }
++ CloseHandle(mapping);
++ }
++ }
++ CloseHandle(exeFile);
++ }
++ return retval;
++}
++
++// Delayed load libraries are loaded when the first symbol is used.
++// The following ensures that we load the delayed loaded libraries from the
++// system directory.
++struct AutoLoadSystemDependencies
++{
++ AutoLoadSystemDependencies()
++ {
++ HMODULE module = ::GetModuleHandleW(L"kernel32.dll");
++ if (module) {
++ // SetDefaultDllDirectories is always available on Windows 8 and above. It
++ // is also available on Windows Vista, Windows Server 2008, and
++ // Windows 7 when MS KB2533623 has been applied.
++ typedef BOOL (WINAPI *SetDefaultDllDirectoriesType)(DWORD);
++ SetDefaultDllDirectoriesType setDefaultDllDirectories =
++ (SetDefaultDllDirectoriesType) GetProcAddress(module, "SetDefaultDllDirectories");
++ if (setDefaultDllDirectories) {
++ setDefaultDllDirectories(0x0800 /* LOAD_LIBRARY_SEARCH_SYSTEM32 */ );
++ return;
++ }
++ }
++
++ static LPCWSTR delayDLLs[] = { L"uxtheme.dll", L"userenv.dll",
++ L"setupapi.dll", L"apphelp.dll",
++ L"propsys.dll", L"dwmapi.dll",
++ L"cryptbase.dll", L"oleacc.dll",
++ L"clbcatq.dll" };
++ WCHAR systemDirectory[MAX_PATH + 1] = { L'\0' };
++ // If GetSystemDirectory fails we accept that we'll load the DLLs from the
++ // normal search path.
++ GetSystemDirectoryW(systemDirectory, MAX_PATH + 1);
++ size_t systemDirLen = wcslen(systemDirectory);
++
++ // Make the system directory path terminate with a slash
++ if (systemDirectory[systemDirLen - 1] != L'\\' && systemDirLen) {
++ systemDirectory[systemDirLen] = L'\\';
++ ++systemDirLen;
++ // No need to re-NULL terminate
++ }
++
++ // For each known DLL ensure it is loaded from the system32 directory
++ for (size_t i = 0; i < sizeof(delayDLLs) / sizeof(delayDLLs[0]); ++i) {
++ size_t fileLen = wcslen(delayDLLs[i]);
++ wcsncpy(systemDirectory + systemDirLen, delayDLLs[i],
++ MAX_PATH - systemDirLen);
++ if (systemDirLen + fileLen <= MAX_PATH) {
++ systemDirectory[systemDirLen + fileLen] = L'\0';
++ } else {
++ systemDirectory[MAX_PATH] = L'\0';
++ }
++ LPCWSTR fullModulePath = systemDirectory; // just for code readability
++ LoadLibraryW(fullModulePath);
++ }
++ }
++} loadDLLs;
++
++BOOL
++RemoveCurrentDirFromSearchPath()
++{
++ // kernel32.dll is in the knownDLL list so it is safe to load without a full path
++ HMODULE kernel32 = LoadLibraryW(L"kernel32.dll");
++ if (!kernel32) {
++ return FALSE;
++ }
++
++ typedef BOOL (WINAPI *SetDllDirectoryType)(LPCWSTR);
++ SetDllDirectoryType SetDllDirectoryFn =
++ (SetDllDirectoryType)GetProcAddress(kernel32, "SetDllDirectoryW");
++ if (!SetDllDirectoryFn) {
++ FreeLibrary(kernel32);
++ return FALSE;
++ }
++
++ // If this call fails we can't do much about it, so ignore it.
++ // It is unlikely to fail and this is just a precaution anyway.
++ SetDllDirectoryFn(L"");
++ FreeLibrary(kernel32);
++ return TRUE;
++}
++
++/* END Mozilla customizations */
++
+ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ #ifdef UNDER_CE
+ LPWSTR
+@@ -133,13 +306,35 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ #endif
+ /* lpCmdLine */,int /* nCmdShow */)
+ {
++ /* BEGIN Mozilla customizations */
++ // Disable current directory from being in the search path.
++ // This call does not help with implicitly loaded DLLs.
++ if (!RemoveCurrentDirFromSearchPath()) {
++ WCHAR minOSTitle[512] = { '\0' };
++ WCHAR minOSText[512] = { '\0' };
++ LoadStringW(NULL, IDS_MIN_OS_TITLE, minOSTitle,
++ sizeof(minOSTitle) / sizeof(minOSTitle[0]));
++ LoadStringW(NULL, IDS_MIN_OS_TEXT, minOSText,
++ sizeof(minOSText) / sizeof(minOSText[0]));
++ MessageBoxW(NULL, minOSText, minOSTitle, MB_OK | MB_ICONERROR);
++ return 1;
++ }
++ /* END Mozilla customizations */
++
+ g_hInstance = (HINSTANCE)hInstance;
+
+ NT_CHECK
+
+- #ifdef _WIN32
+- LoadSecurityDlls();
+- #endif
++ // BEGIN Mozilla customizations
++ // Our AutoLoadSystemDependencies (see above) does the same job as the
++ // LoadSecurityDlls function, but slightly better because it runs as a static
++ // initializer, and it doesn't include LOAD_LIBRARY_SEARCH_USER_DIRS in
++ // the search path, which partially defeats the purpose of calling
++ // SetDefaultDllDirectories at all.
++ //#ifdef _WIN32
++ //LoadSecurityDlls();
++ //#endif
++ // END Mozilla customizations
+
+ // InitCommonControls();
+
+@@ -172,6 +367,18 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ UString dirPrefix ("." STRING_PATH_SEPARATOR);
+ UString appLaunched;
+ bool showProgress = true;
++
++ /* BEGIN Mozilla customizations */
++ bool extractOnly = false;
++ if (switches.IsPrefixedBy_NoCase(L"/extractdir=")) {
++ assumeYes = true;
++ showProgress = false;
++ extractOnly = true;
++ } else if (!switches.IsEmpty()) {
++ showProgress = false;
++ }
++ /* END Mozilla customizations */
++
+ if (!config.IsEmpty())
+ {
+ CObjectVector<CTextConfigPair> pairs;
+@@ -204,7 +411,8 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ }
+
+ CTempDir tempDir;
+- if (!tempDir.Create(kTempDirPrefix))
++ /* Mozilla customizations - Added !extractOnly */
++ if (!extractOnly && !tempDir.Create(kTempDirPrefix))
+ {
+ if (!assumeYes)
+ ShowErrorMessage(L"Can not create temp folder archive");
+@@ -222,7 +430,9 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ }
+ }
+
+- const FString tempDirPath = tempDir.GetPath();
++ /* BEGIN Mozilla customizations - added extractOnly parameter support */
++ const FString tempDirPath = extractOnly ? switches.Ptr(12) : GetUnicodeString(tempDir.GetPath());
++ /* END Mozilla customizations */
+ // tempDirPath = L"M:\\1\\"; // to test low disk space
+ {
+ bool isCorrupt = false;
+@@ -250,6 +460,28 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ }
+ }
+
++ /* BEGIN Mozilla customizations */
++ // Retrieve and store any data added to this file after signing.
++ {
++ AString postSigningData;
++ if (ReadPostSigningData(fullPath, postSigningData)) {
++ FString postSigningDataFilePath(tempDirPath);
++ NFile::NName::NormalizeDirPathPrefix(postSigningDataFilePath);
++ postSigningDataFilePath += L"postSigningData";
++
++ NFile::NIO::COutFile postSigningDataFile;
++ postSigningDataFile.Create(postSigningDataFilePath, true);
++
++ UInt32 written = 0;
++ postSigningDataFile.Write(postSigningData, postSigningData.Len(), written);
++ }
++ }
++
++ if (extractOnly) {
++ return 0;
++ }
++ /* END Mozilla customizations */
++
+ #ifndef UNDER_CE
+ CCurrentDirRestorer currentDirRestorer;
+ if (!SetCurrentDir(tempDirPath))
+diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h
+index 533197e..975d779 100644
+--- a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h
++++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h
+@@ -4,3 +4,5 @@
+ #define IDS_EXTRACTION_ERROR_MESSAGE 8
+ #define IDS_CANNOT_CREATE_FOLDER 3003
+ #define IDS_PROGRESS_EXTRACTING 3300
++#define IDS_MIN_OS_TITLE 70
++#define IDS_MIN_OS_TEXT 71
+diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc
+index 9e88fd4..9fda0d0 100644
+--- a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc
++++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc
+@@ -11,6 +11,8 @@ BEGIN
+ IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt"
+ IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
+ IDS_PROGRESS_EXTRACTING "Extracting"
++ IDS_MIN_OS_TITLE "Setup Error"
++ IDS_MIN_OS_TEXT "Microsoft Windows 7 or newer is required."
+ END
+
+ #include "../../UI/FileManager/ProgressDialog.rc"
+diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp
+index 27d42b2..9b61369 100644
+--- a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp
++++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp
+@@ -165,7 +165,8 @@ bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+ bool paused = Sync.GetPaused();
+ Sync.SetPaused(true);
+ _inCancelMessageBox = true;
+- int res = ::MessageBoxW(*this, L"Are you sure you want to cancel?", _title, MB_YESNOCANCEL);
++ // Mozilla Customization - Removed redundant cancel button from dialog.
++ int res = ::MessageBoxW(*this, L"Are you sure you want to cancel?", _title, MB_YESNO);
+ _inCancelMessageBox = false;
+ Sync.SetPaused(paused);
+ if (res == IDCANCEL || res == IDNO)
diff --git a/other-licenses/7zstub/palemoon/7zSD.manifest b/other-licenses/7zstub/palemoon/7zSD.manifest
new file mode 100644
index 0000000000..14639d7f56
--- /dev/null
+++ b/other-licenses/7zstub/palemoon/7zSD.manifest
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="7zS.sfx.exe" type="win32"/>
+<description>7-Zip Self-extracting Archive v18.05</description>
+<dependency>
+<dependentAssembly>
+<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>
+</dependentAssembly>
+</dependency>
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+<security>
+<requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+</requestedPrivileges>
+</security>
+</trustInfo>
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+<application>
+<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+</application>
+</compatibility>
+<application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings>
+<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+</windowsSettings>
+</application>
+</assembly>
diff --git a/other-licenses/7zstub/palemoon/7zSD.sfx b/other-licenses/7zstub/palemoon/7zSD.sfx
index ecb03bad36..db9f5d8da1 100644
--- a/other-licenses/7zstub/palemoon/7zSD.sfx
+++ b/other-licenses/7zstub/palemoon/7zSD.sfx
Binary files differ
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.h
deleted file mode 100644
index 215d5cbfb4..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// 7zCompressionMode.h
-
-#ifndef __7Z_COMPRESSION_MODE_H
-#define __7Z_COMPRESSION_MODE_H
-
-#include "../../../Windows/PropVariant.h"
-
-#include "7zMethodID.h"
-
-namespace NArchive {
-namespace N7z {
-
-struct CProperty
-{
- PROPID PropID;
- NWindows::NCOM::CPropVariant Value;
-};
-
-struct CMethodFull
-{
- CMethodID MethodID;
- UInt32 NumInStreams;
- UInt32 NumOutStreams;
- bool IsSimpleCoder() const
- { return (NumInStreams == 1) && (NumOutStreams == 1); }
-
- #ifdef EXCLUDE_COM
- #else
- CLSID EncoderClassID;
- CSysString FilePath;
- #endif
-
- CObjectVector<CProperty> CoderProperties;
-};
-
-struct CBind
-{
- UInt32 InCoder;
- UInt32 InStream;
- UInt32 OutCoder;
- UInt32 OutStream;
-};
-
-struct CCompressionMethodMode
-{
- CObjectVector<CMethodFull> Methods;
- CRecordVector<CBind> Binds;
- #ifdef COMPRESS_MT
- UInt32 NumThreads;
- #endif
- bool PasswordIsDefined;
- UString Password;
-
- bool IsEmpty() const { return (Methods.IsEmpty() && !PasswordIsDefined); }
- CCompressionMethodMode(): PasswordIsDefined(false)
- #ifdef COMPRESS_MT
- , NumThreads(1)
- #endif
- {}
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.cpp
deleted file mode 100644
index 7f8f149657..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.cpp
+++ /dev/null
@@ -1,443 +0,0 @@
-// 7zDecode.cpp
-
-#include "StdAfx.h"
-
-#include "7zDecode.h"
-
-#include "../../IPassword.h"
-#include "../../Common/LockedStream.h"
-#include "../../Common/StreamObjects.h"
-#include "../../Common/ProgressUtils.h"
-#include "../../Common/LimitedStreams.h"
-#include "../Common/FilterCoder.h"
-
-#include "7zMethods.h"
-
-#ifdef COMPRESS_LZMA
-#include "../../Compress/LZMA/LZMADecoder.h"
-static NArchive::N7z::CMethodID k_LZMA = { { 0x3, 0x1, 0x1 }, 3 };
-#endif
-
-#ifdef COMPRESS_PPMD
-#include "../../Compress/PPMD/PPMDDecoder.h"
-static NArchive::N7z::CMethodID k_PPMD = { { 0x3, 0x4, 0x1 }, 3 };
-#endif
-
-#ifdef COMPRESS_BCJ_X86
-#include "../../Compress/Branch/x86.h"
-static NArchive::N7z::CMethodID k_BCJ_X86 = { { 0x3, 0x3, 0x1, 0x3 }, 4 };
-#endif
-
-#ifdef COMPRESS_BCJ2
-#include "../../Compress/Branch/x86_2.h"
-static NArchive::N7z::CMethodID k_BCJ2 = { { 0x3, 0x3, 0x1, 0x1B }, 4 };
-#endif
-
-#ifdef COMPRESS_DEFLATE
-#ifndef COMPRESS_DEFLATE_DECODER
-#define COMPRESS_DEFLATE_DECODER
-#endif
-#endif
-
-#ifdef COMPRESS_DEFLATE_DECODER
-#include "../../Compress/Deflate/DeflateDecoder.h"
-static NArchive::N7z::CMethodID k_Deflate = { { 0x4, 0x1, 0x8 }, 3 };
-#endif
-
-#ifdef COMPRESS_BZIP2
-#ifndef COMPRESS_BZIP2_DECODER
-#define COMPRESS_BZIP2_DECODER
-#endif
-#endif
-
-#ifdef COMPRESS_BZIP2_DECODER
-#include "../../Compress/BZip2/BZip2Decoder.h"
-static NArchive::N7z::CMethodID k_BZip2 = { { 0x4, 0x2, 0x2 }, 3 };
-#endif
-
-#ifdef COMPRESS_COPY
-#include "../../Compress/Copy/CopyCoder.h"
-static NArchive::N7z::CMethodID k_Copy = { { 0x0 }, 1 };
-#endif
-
-#ifdef CRYPTO_7ZAES
-#include "../../Crypto/7zAES/7zAES.h"
-static NArchive::N7z::CMethodID k_7zAES = { { 0x6, 0xF1, 0x07, 0x01 }, 4 };
-#endif
-
-namespace NArchive {
-namespace N7z {
-
-static void ConvertFolderItemInfoToBindInfo(const CFolder &folder,
- CBindInfoEx &bindInfo)
-{
- bindInfo.Clear();
- int i;
- for (i = 0; i < folder.BindPairs.Size(); i++)
- {
- NCoderMixer2::CBindPair bindPair;
- bindPair.InIndex = (UInt32)folder.BindPairs[i].InIndex;
- bindPair.OutIndex = (UInt32)folder.BindPairs[i].OutIndex;
- bindInfo.BindPairs.Add(bindPair);
- }
- UInt32 outStreamIndex = 0;
- for (i = 0; i < folder.Coders.Size(); i++)
- {
- NCoderMixer2::CCoderStreamsInfo coderStreamsInfo;
- const CCoderInfo &coderInfo = folder.Coders[i];
- coderStreamsInfo.NumInStreams = (UInt32)coderInfo.NumInStreams;
- coderStreamsInfo.NumOutStreams = (UInt32)coderInfo.NumOutStreams;
- bindInfo.Coders.Add(coderStreamsInfo);
- const CAltCoderInfo &altCoderInfo = coderInfo.AltCoders.Front();
- bindInfo.CoderMethodIDs.Add(altCoderInfo.MethodID);
- for (UInt32 j = 0; j < coderStreamsInfo.NumOutStreams; j++, outStreamIndex++)
- if (folder.FindBindPairForOutStream(outStreamIndex) < 0)
- bindInfo.OutStreams.Add(outStreamIndex);
- }
- for (i = 0; i < folder.PackStreams.Size(); i++)
- bindInfo.InStreams.Add((UInt32)folder.PackStreams[i]);
-}
-
-static bool AreCodersEqual(const NCoderMixer2::CCoderStreamsInfo &a1,
- const NCoderMixer2::CCoderStreamsInfo &a2)
-{
- return (a1.NumInStreams == a2.NumInStreams) &&
- (a1.NumOutStreams == a2.NumOutStreams);
-}
-
-static bool AreBindPairsEqual(const NCoderMixer2::CBindPair &a1, const NCoderMixer2::CBindPair &a2)
-{
- return (a1.InIndex == a2.InIndex) &&
- (a1.OutIndex == a2.OutIndex);
-}
-
-static bool AreBindInfoExEqual(const CBindInfoEx &a1, const CBindInfoEx &a2)
-{
- if (a1.Coders.Size() != a2.Coders.Size())
- return false;
- int i;
- for (i = 0; i < a1.Coders.Size(); i++)
- if (!AreCodersEqual(a1.Coders[i], a2.Coders[i]))
- return false;
- if (a1.BindPairs.Size() != a2.BindPairs.Size())
- return false;
- for (i = 0; i < a1.BindPairs.Size(); i++)
- if (!AreBindPairsEqual(a1.BindPairs[i], a2.BindPairs[i]))
- return false;
- for (i = 0; i < a1.CoderMethodIDs.Size(); i++)
- if (a1.CoderMethodIDs[i] != a2.CoderMethodIDs[i])
- return false;
- if (a1.InStreams.Size() != a2.InStreams.Size())
- return false;
- if (a1.OutStreams.Size() != a2.OutStreams.Size())
- return false;
- return true;
-}
-
-CDecoder::CDecoder(bool multiThread)
-{
- #ifndef _ST_MODE
- multiThread = true;
- #endif
- _multiThread = multiThread;
- _bindInfoExPrevIsDefinded = false;
- #ifndef EXCLUDE_COM
- LoadMethodMap();
- #endif
-}
-
-HRESULT CDecoder::Decode(IInStream *inStream,
- UInt64 startPos,
- const UInt64 *packSizes,
- const CFolder &folderInfo,
- ISequentialOutStream *outStream,
- ICompressProgressInfo *compressProgress
- #ifndef _NO_CRYPTO
- , ICryptoGetTextPassword *getTextPassword
- #endif
- #ifdef COMPRESS_MT
- , bool mtMode, UInt32 numThreads
- #endif
- )
-{
- CObjectVector< CMyComPtr<ISequentialInStream> > inStreams;
-
- CLockedInStream lockedInStream;
- lockedInStream.Init(inStream);
-
- for (int j = 0; j < folderInfo.PackStreams.Size(); j++)
- {
- CLockedSequentialInStreamImp *lockedStreamImpSpec = new
- CLockedSequentialInStreamImp;
- CMyComPtr<ISequentialInStream> lockedStreamImp = lockedStreamImpSpec;
- lockedStreamImpSpec->Init(&lockedInStream, startPos);
- startPos += packSizes[j];
-
- CLimitedSequentialInStream *streamSpec = new
- CLimitedSequentialInStream;
- CMyComPtr<ISequentialInStream> inStream = streamSpec;
- streamSpec->Init(lockedStreamImp, packSizes[j]);
- inStreams.Add(inStream);
- }
-
- int numCoders = folderInfo.Coders.Size();
-
- CBindInfoEx bindInfo;
- ConvertFolderItemInfoToBindInfo(folderInfo, bindInfo);
- bool createNewCoders;
- if (!_bindInfoExPrevIsDefinded)
- createNewCoders = true;
- else
- createNewCoders = !AreBindInfoExEqual(bindInfo, _bindInfoExPrev);
- if (createNewCoders)
- {
- int i;
- _decoders.Clear();
- // _decoders2.Clear();
-
- _mixerCoder.Release();
-
- if (_multiThread)
- {
- _mixerCoderMTSpec = new NCoderMixer2::CCoderMixer2MT;
- _mixerCoder = _mixerCoderMTSpec;
- _mixerCoderCommon = _mixerCoderMTSpec;
- }
- else
- {
- #ifdef _ST_MODE
- _mixerCoderSTSpec = new NCoderMixer2::CCoderMixer2ST;
- _mixerCoder = _mixerCoderSTSpec;
- _mixerCoderCommon = _mixerCoderSTSpec;
- #endif
- }
- _mixerCoderCommon->SetBindInfo(bindInfo);
-
- for (i = 0; i < numCoders; i++)
- {
- const CCoderInfo &coderInfo = folderInfo.Coders[i];
- const CAltCoderInfo &altCoderInfo = coderInfo.AltCoders.Front();
- #ifndef EXCLUDE_COM
- CMethodInfo methodInfo;
- if (!GetMethodInfo(altCoderInfo.MethodID, methodInfo))
- return E_NOTIMPL;
- #endif
-
- if (coderInfo.IsSimpleCoder())
- {
- CMyComPtr<ICompressCoder> decoder;
- CMyComPtr<ICompressFilter> filter;
-
- #ifdef COMPRESS_LZMA
- if (altCoderInfo.MethodID == k_LZMA)
- decoder = new NCompress::NLZMA::CDecoder;
- #endif
-
- #ifdef COMPRESS_PPMD
- if (altCoderInfo.MethodID == k_PPMD)
- decoder = new NCompress::NPPMD::CDecoder;
- #endif
-
- #ifdef COMPRESS_BCJ_X86
- if (altCoderInfo.MethodID == k_BCJ_X86)
- filter = new CBCJ_x86_Decoder;
- #endif
-
- #ifdef COMPRESS_DEFLATE_DECODER
- if (altCoderInfo.MethodID == k_Deflate)
- decoder = new NCompress::NDeflate::NDecoder::CCOMCoder;
- #endif
-
- #ifdef COMPRESS_BZIP2_DECODER
- if (altCoderInfo.MethodID == k_BZip2)
- decoder = new NCompress::NBZip2::CDecoder;
- #endif
-
- #ifdef COMPRESS_COPY
- if (altCoderInfo.MethodID == k_Copy)
- decoder = new NCompress::CCopyCoder;
- #endif
-
- #ifdef CRYPTO_7ZAES
- if (altCoderInfo.MethodID == k_7zAES)
- filter = new NCrypto::NSevenZ::CDecoder;
- #endif
-
- if (filter)
- {
- CFilterCoder *coderSpec = new CFilterCoder;
- decoder = coderSpec;
- coderSpec->Filter = filter;
- }
- #ifndef EXCLUDE_COM
- if (decoder == 0)
- {
- RINOK(_libraries.CreateCoderSpec(methodInfo.FilePath,
- methodInfo.Decoder, &decoder));
- }
- #endif
-
- if (decoder == 0)
- return E_NOTIMPL;
-
- _decoders.Add((IUnknown *)decoder);
-
- if (_multiThread)
- _mixerCoderMTSpec->AddCoder(decoder);
- #ifdef _ST_MODE
- else
- _mixerCoderSTSpec->AddCoder(decoder, false);
- #endif
- }
- else
- {
- CMyComPtr<ICompressCoder2> decoder;
-
- #ifdef COMPRESS_BCJ2
- if (altCoderInfo.MethodID == k_BCJ2)
- decoder = new CBCJ2_x86_Decoder;
- #endif
-
- #ifndef EXCLUDE_COM
- if (decoder == 0)
- {
- RINOK(_libraries.CreateCoder2(methodInfo.FilePath,
- methodInfo.Decoder, &decoder));
- }
- #endif
-
- if (decoder == 0)
- return E_NOTIMPL;
-
- _decoders.Add((IUnknown *)decoder);
- if (_multiThread)
- _mixerCoderMTSpec->AddCoder2(decoder);
- #ifdef _ST_MODE
- else
- _mixerCoderSTSpec->AddCoder2(decoder, false);
- #endif
- }
- }
- _bindInfoExPrev = bindInfo;
- _bindInfoExPrevIsDefinded = true;
- }
- int i;
- _mixerCoderCommon->ReInit();
-
- UInt32 packStreamIndex = 0, unPackStreamIndex = 0;
- UInt32 coderIndex = 0;
- // UInt32 coder2Index = 0;
-
- for (i = 0; i < numCoders; i++)
- {
- const CCoderInfo &coderInfo = folderInfo.Coders[i];
- const CAltCoderInfo &altCoderInfo = coderInfo.AltCoders.Front();
- CMyComPtr<IUnknown> &decoder = _decoders[coderIndex];
-
- {
- CMyComPtr<ICompressSetDecoderProperties2> setDecoderProperties;
- HRESULT result = decoder.QueryInterface(IID_ICompressSetDecoderProperties2, &setDecoderProperties);
- if (setDecoderProperties)
- {
- const CByteBuffer &properties = altCoderInfo.Properties;
- size_t size = properties.GetCapacity();
- if (size > 0xFFFFFFFF)
- return E_NOTIMPL;
- if (size > 0)
- {
- RINOK(setDecoderProperties->SetDecoderProperties2((const Byte *)properties, (UInt32)size));
- }
- }
- }
-
- #ifdef COMPRESS_MT
- if (mtMode)
- {
- CMyComPtr<ICompressSetCoderMt> setCoderMt;
- decoder.QueryInterface(IID_ICompressSetCoderMt, &setCoderMt);
- if (setCoderMt)
- {
- RINOK(setCoderMt->SetNumberOfThreads(numThreads));
- }
- }
- #endif
-
- #ifndef _NO_CRYPTO
- {
- CMyComPtr<ICryptoSetPassword> cryptoSetPassword;
- HRESULT result = decoder.QueryInterface(IID_ICryptoSetPassword, &cryptoSetPassword);
- if (cryptoSetPassword)
- {
- if (getTextPassword == 0)
- return E_FAIL;
- CMyComBSTR password;
- RINOK(getTextPassword->CryptoGetTextPassword(&password));
- CByteBuffer buffer;
- UString unicodePassword(password);
- const UInt32 sizeInBytes = unicodePassword.Length() * 2;
- buffer.SetCapacity(sizeInBytes);
- for (int i = 0; i < unicodePassword.Length(); i++)
- {
- wchar_t c = unicodePassword[i];
- ((Byte *)buffer)[i * 2] = (Byte)c;
- ((Byte *)buffer)[i * 2 + 1] = (Byte)(c >> 8);
- }
- RINOK(cryptoSetPassword->CryptoSetPassword(
- (const Byte *)buffer, sizeInBytes));
- }
- }
- #endif
-
- coderIndex++;
-
- UInt32 numInStreams = (UInt32)coderInfo.NumInStreams;
- UInt32 numOutStreams = (UInt32)coderInfo.NumOutStreams;
- CRecordVector<const UInt64 *> packSizesPointers;
- CRecordVector<const UInt64 *> unPackSizesPointers;
- packSizesPointers.Reserve(numInStreams);
- unPackSizesPointers.Reserve(numOutStreams);
- UInt32 j;
- for (j = 0; j < numOutStreams; j++, unPackStreamIndex++)
- unPackSizesPointers.Add(&folderInfo.UnPackSizes[unPackStreamIndex]);
-
- for (j = 0; j < numInStreams; j++, packStreamIndex++)
- {
- int bindPairIndex = folderInfo.FindBindPairForInStream(packStreamIndex);
- if (bindPairIndex >= 0)
- packSizesPointers.Add(
- &folderInfo.UnPackSizes[(UInt32)folderInfo.BindPairs[bindPairIndex].OutIndex]);
- else
- {
- int index = folderInfo.FindPackStreamArrayIndex(packStreamIndex);
- if (index < 0)
- return E_FAIL;
- packSizesPointers.Add(&packSizes[index]);
- }
- }
-
- _mixerCoderCommon->SetCoderInfo(i,
- &packSizesPointers.Front(),
- &unPackSizesPointers.Front());
- }
- UInt32 mainCoder, temp;
- bindInfo.FindOutStream(bindInfo.OutStreams[0], mainCoder, temp);
-
- if (_multiThread)
- _mixerCoderMTSpec->SetProgressCoderIndex(mainCoder);
- /*
- else
- _mixerCoderSTSpec->SetProgressCoderIndex(mainCoder);;
- */
-
- if (numCoders == 0)
- return 0;
- CRecordVector<ISequentialInStream *> inStreamPointers;
- inStreamPointers.Reserve(inStreams.Size());
- for (i = 0; i < inStreams.Size(); i++)
- inStreamPointers.Add(inStreams[i]);
- ISequentialOutStream *outStreamPointer = outStream;
- return _mixerCoder->Code(&inStreamPointers.Front(), NULL,
- inStreams.Size(), &outStreamPointer, NULL, 1, compressProgress);
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.h
deleted file mode 100644
index 6620c2ed8d..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zDecode.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// 7zDecode.h
-
-#ifndef __7Z_DECODE_H
-#define __7Z_DECODE_H
-
-#include "../../IStream.h"
-#include "../../IPassword.h"
-
-#include "../Common/CoderMixer2.h"
-#include "../Common/CoderMixer2MT.h"
-#ifdef _ST_MODE
-#include "../Common/CoderMixer2ST.h"
-#endif
-#ifndef EXCLUDE_COM
-#include "../Common/CoderLoader.h"
-#endif
-
-#include "7zItem.h"
-
-namespace NArchive {
-namespace N7z {
-
-struct CBindInfoEx: public NCoderMixer2::CBindInfo
-{
- CRecordVector<CMethodID> CoderMethodIDs;
- void Clear()
- {
- CBindInfo::Clear();
- CoderMethodIDs.Clear();
- }
-};
-
-class CDecoder
-{
- #ifndef EXCLUDE_COM
- CCoderLibraries _libraries;
- #endif
-
- bool _bindInfoExPrevIsDefinded;
- CBindInfoEx _bindInfoExPrev;
-
- bool _multiThread;
- #ifdef _ST_MODE
- NCoderMixer2::CCoderMixer2ST *_mixerCoderSTSpec;
- #endif
- NCoderMixer2::CCoderMixer2MT *_mixerCoderMTSpec;
- NCoderMixer2::CCoderMixer2 *_mixerCoderCommon;
-
- CMyComPtr<ICompressCoder2> _mixerCoder;
- CObjectVector<CMyComPtr<IUnknown> > _decoders;
- // CObjectVector<CMyComPtr<ICompressCoder2> > _decoders2;
-public:
- CDecoder(bool multiThread);
- HRESULT Decode(IInStream *inStream,
- UInt64 startPos,
- const UInt64 *packSizes,
- const CFolder &folder,
- ISequentialOutStream *outStream,
- ICompressProgressInfo *compressProgress
- #ifndef _NO_CRYPTO
- , ICryptoGetTextPassword *getTextPasswordSpec
- #endif
- #ifdef COMPRESS_MT
- , bool mtMode, UInt32 numThreads
- #endif
- );
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zExtract.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zExtract.cpp
deleted file mode 100644
index cc892bc9df..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zExtract.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-// 7zExtract.cpp
-
-#include "StdAfx.h"
-
-#include "7zHandler.h"
-#include "7zFolderOutStream.h"
-#include "7zMethods.h"
-#include "7zDecode.h"
-// #include "7z1Decode.h"
-
-#include "../../../Common/ComTry.h"
-#include "../../Common/StreamObjects.h"
-#include "../../Common/ProgressUtils.h"
-#include "../../Common/LimitedStreams.h"
-
-namespace NArchive {
-namespace N7z {
-
-struct CExtractFolderInfo
-{
- #ifdef _7Z_VOL
- int VolumeIndex;
- #endif
- CNum FileIndex;
- CNum FolderIndex;
- CBoolVector ExtractStatuses;
- UInt64 UnPackSize;
- CExtractFolderInfo(
- #ifdef _7Z_VOL
- int volumeIndex,
- #endif
- CNum fileIndex, CNum folderIndex):
- #ifdef _7Z_VOL
- VolumeIndex(volumeIndex),
- #endif
- FileIndex(fileIndex),
- FolderIndex(folderIndex),
- UnPackSize(0)
- {
- if (fileIndex != kNumNoIndex)
- {
- ExtractStatuses.Reserve(1);
- ExtractStatuses.Add(true);
- }
- };
-};
-
-STDMETHODIMP CHandler::Extract(const UInt32* indices, UInt32 numItems,
- Int32 testModeSpec, IArchiveExtractCallback *extractCallbackSpec)
-{
- COM_TRY_BEGIN
- bool testMode = (testModeSpec != 0);
- CMyComPtr<IArchiveExtractCallback> extractCallback = extractCallbackSpec;
- UInt64 importantTotalUnPacked = 0;
-
- bool allFilesMode = (numItems == UInt32(-1));
- if (allFilesMode)
- numItems =
- #ifdef _7Z_VOL
- _refs.Size();
- #else
- _database.Files.Size();
- #endif
-
- if(numItems == 0)
- return S_OK;
-
- /*
- if(_volumes.Size() != 1)
- return E_FAIL;
- const CVolume &volume = _volumes.Front();
- const CArchiveDatabaseEx &_database = volume.Database;
- IInStream *_inStream = volume.Stream;
- */
-
- CObjectVector<CExtractFolderInfo> extractFolderInfoVector;
- for(UInt32 ii = 0; ii < numItems; ii++)
- {
- // UInt32 fileIndex = allFilesMode ? indexIndex : indices[indexIndex];
- UInt32 ref2Index = allFilesMode ? ii : indices[ii];
- // const CRef2 &ref2 = _refs[ref2Index];
-
- // for(UInt32 ri = 0; ri < ref2.Refs.Size(); ri++)
- {
- #ifdef _7Z_VOL
- // const CRef &ref = ref2.Refs[ri];
- const CRef &ref = _refs[ref2Index];
-
- int volumeIndex = ref.VolumeIndex;
- const CVolume &volume = _volumes[volumeIndex];
- const CArchiveDatabaseEx &database = volume.Database;
- UInt32 fileIndex = ref.ItemIndex;
- #else
- const CArchiveDatabaseEx &database = _database;
- UInt32 fileIndex = ref2Index;
- #endif
-
- CNum folderIndex = database.FileIndexToFolderIndexMap[fileIndex];
- if (folderIndex == kNumNoIndex)
- {
- extractFolderInfoVector.Add(CExtractFolderInfo(
- #ifdef _7Z_VOL
- volumeIndex,
- #endif
- fileIndex, kNumNoIndex));
- continue;
- }
- if (extractFolderInfoVector.IsEmpty() ||
- folderIndex != extractFolderInfoVector.Back().FolderIndex
- #ifdef _7Z_VOL
- || volumeIndex != extractFolderInfoVector.Back().VolumeIndex
- #endif
- )
- {
- extractFolderInfoVector.Add(CExtractFolderInfo(
- #ifdef _7Z_VOL
- volumeIndex,
- #endif
- kNumNoIndex, folderIndex));
- const CFolder &folderInfo = database.Folders[folderIndex];
- UInt64 unPackSize = folderInfo.GetUnPackSize();
- importantTotalUnPacked += unPackSize;
- extractFolderInfoVector.Back().UnPackSize = unPackSize;
- }
-
- CExtractFolderInfo &efi = extractFolderInfoVector.Back();
-
- // const CFolderInfo &folderInfo = m_dam_Folders[folderIndex];
- CNum startIndex = database.FolderStartFileIndex[folderIndex];
- for (CNum index = efi.ExtractStatuses.Size();
- index <= fileIndex - startIndex; index++)
- {
- // UInt64 unPackSize = _database.Files[startIndex + index].UnPackSize;
- // Count partial_folder_size
- // efi.UnPackSize += unPackSize;
- // importantTotalUnPacked += unPackSize;
- efi.ExtractStatuses.Add(index == fileIndex - startIndex);
- }
- }
- }
-
- extractCallback->SetTotal(importantTotalUnPacked);
-
- CDecoder decoder(
- #ifdef _ST_MODE
- false
- #else
- true
- #endif
- );
- // CDecoder1 decoder;
-
- UInt64 currentImportantTotalUnPacked = 0;
- UInt64 totalFolderUnPacked;
-
- for(int i = 0; i < extractFolderInfoVector.Size(); i++,
- currentImportantTotalUnPacked += totalFolderUnPacked)
- {
- const CExtractFolderInfo &efi = extractFolderInfoVector[i];
- totalFolderUnPacked = efi.UnPackSize;
-
- RINOK(extractCallback->SetCompleted(&currentImportantTotalUnPacked));
-
- CFolderOutStream *folderOutStream = new CFolderOutStream;
- CMyComPtr<ISequentialOutStream> outStream(folderOutStream);
-
- #ifdef _7Z_VOL
- const CVolume &volume = _volumes[efi.VolumeIndex];
- const CArchiveDatabaseEx &database = volume.Database;
- #else
- const CArchiveDatabaseEx &database = _database;
- #endif
-
- CNum startIndex;
- if (efi.FileIndex != kNumNoIndex)
- startIndex = efi.FileIndex;
- else
- startIndex = database.FolderStartFileIndex[efi.FolderIndex];
-
-
- HRESULT result = folderOutStream->Init(&database,
- #ifdef _7Z_VOL
- volume.StartRef2Index,
- #else
- 0,
- #endif
- startIndex,
- &efi.ExtractStatuses, extractCallback, testMode);
-
- RINOK(result);
-
- if (efi.FileIndex != kNumNoIndex)
- continue;
-
- CNum folderIndex = efi.FolderIndex;
- const CFolder &folderInfo = database.Folders[folderIndex];
-
- CLocalProgress *localProgressSpec = new CLocalProgress;
- CMyComPtr<ICompressProgressInfo> progress = localProgressSpec;
- localProgressSpec->Init(extractCallback, false);
-
- CLocalCompressProgressInfo *localCompressProgressSpec =
- new CLocalCompressProgressInfo;
- CMyComPtr<ICompressProgressInfo> compressProgress = localCompressProgressSpec;
- localCompressProgressSpec->Init(progress, NULL, &currentImportantTotalUnPacked);
-
- CNum packStreamIndex = database.FolderStartPackStreamIndex[folderIndex];
- UInt64 folderStartPackPos = database.GetFolderStreamPos(folderIndex, 0);
-
- #ifndef _NO_CRYPTO
- CMyComPtr<ICryptoGetTextPassword> getTextPassword;
- if (extractCallback)
- extractCallback.QueryInterface(IID_ICryptoGetTextPassword, &getTextPassword);
- #endif
-
- try
- {
- HRESULT result = decoder.Decode(
- #ifdef _7Z_VOL
- volume.Stream,
- #else
- _inStream,
- #endif
- folderStartPackPos,
- &database.PackSizes[packStreamIndex],
- folderInfo,
- outStream,
- compressProgress
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- #ifdef COMPRESS_MT
- , true, _numThreads
- #endif
- );
-
- if (result == S_FALSE)
- {
- RINOK(folderOutStream->FlushCorrupted(NArchive::NExtract::NOperationResult::kDataError));
- continue;
- }
- if (result == E_NOTIMPL)
- {
- RINOK(folderOutStream->FlushCorrupted(NArchive::NExtract::NOperationResult::kUnSupportedMethod));
- continue;
- }
- if (result != S_OK)
- return result;
- if (folderOutStream->WasWritingFinished() != S_OK)
- {
- RINOK(folderOutStream->FlushCorrupted(NArchive::NExtract::NOperationResult::kDataError));
- continue;
- }
- }
- catch(...)
- {
- RINOK(folderOutStream->FlushCorrupted(NArchive::NExtract::NOperationResult::kDataError));
- continue;
- }
- }
- return S_OK;
- COM_TRY_END
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.cpp
deleted file mode 100644
index 94afc6905e..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-// 7zFolderOutStream.cpp
-
-#include "StdAfx.h"
-
-#include "7zFolderOutStream.h"
-
-namespace NArchive {
-namespace N7z {
-
-CFolderOutStream::CFolderOutStream()
-{
- _outStreamWithHashSpec = new COutStreamWithCRC;
- _outStreamWithHash = _outStreamWithHashSpec;
-}
-
-HRESULT CFolderOutStream::Init(
- const CArchiveDatabaseEx *archiveDatabase,
- UInt32 ref2Offset,
- UInt32 startIndex,
- const CBoolVector *extractStatuses,
- IArchiveExtractCallback *extractCallback,
- bool testMode)
-{
- _archiveDatabase = archiveDatabase;
- _ref2Offset = ref2Offset;
- _startIndex = startIndex;
-
- _extractStatuses = extractStatuses;
- _extractCallback = extractCallback;
- _testMode = testMode;
-
- _currentIndex = 0;
- _fileIsOpen = false;
- return WriteEmptyFiles();
-}
-
-HRESULT CFolderOutStream::OpenFile()
-{
- Int32 askMode;
- if((*_extractStatuses)[_currentIndex])
- askMode = _testMode ?
- NArchive::NExtract::NAskMode::kTest :
- NArchive::NExtract::NAskMode::kExtract;
- else
- askMode = NArchive::NExtract::NAskMode::kSkip;
- CMyComPtr<ISequentialOutStream> realOutStream;
-
- UInt32 index = _startIndex + _currentIndex;
- RINOK(_extractCallback->GetStream(_ref2Offset + index, &realOutStream, askMode));
-
- _outStreamWithHashSpec->Init(realOutStream);
- if (askMode == NArchive::NExtract::NAskMode::kExtract &&
- (!realOutStream))
- {
- const CFileItem &fileInfo = _archiveDatabase->Files[index];
- if (!fileInfo.IsAnti && !fileInfo.IsDirectory)
- askMode = NArchive::NExtract::NAskMode::kSkip;
- }
- return _extractCallback->PrepareOperation(askMode);
-}
-
-HRESULT CFolderOutStream::WriteEmptyFiles()
-{
- for(;_currentIndex < _extractStatuses->Size(); _currentIndex++)
- {
- UInt32 index = _startIndex + _currentIndex;
- const CFileItem &fileInfo = _archiveDatabase->Files[index];
- if (!fileInfo.IsAnti && !fileInfo.IsDirectory && fileInfo.UnPackSize != 0)
- return S_OK;
- RINOK(OpenFile());
- RINOK(_extractCallback->SetOperationResult(
- NArchive::NExtract::NOperationResult::kOK));
- _outStreamWithHashSpec->ReleaseStream();
- }
- return S_OK;
-}
-
-STDMETHODIMP CFolderOutStream::Write(const void *data,
- UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize = 0;
- while(_currentIndex < _extractStatuses->Size())
- {
- if (_fileIsOpen)
- {
- UInt32 index = _startIndex + _currentIndex;
- const CFileItem &fileInfo = _archiveDatabase->Files[index];
- UInt64 fileSize = fileInfo.UnPackSize;
-
- UInt32 numBytesToWrite = (UInt32)MyMin(fileSize - _filePos,
- UInt64(size - realProcessedSize));
-
- UInt32 processedSizeLocal;
- RINOK(_outStreamWithHash->Write((const Byte *)data + realProcessedSize,
- numBytesToWrite, &processedSizeLocal));
-
- _filePos += processedSizeLocal;
- realProcessedSize += processedSizeLocal;
- if (_filePos == fileSize)
- {
- bool digestsAreEqual;
- if (fileInfo.IsFileCRCDefined)
- digestsAreEqual = fileInfo.FileCRC == _outStreamWithHashSpec->GetCRC();
- else
- digestsAreEqual = true;
-
- RINOK(_extractCallback->SetOperationResult(
- digestsAreEqual ?
- NArchive::NExtract::NOperationResult::kOK :
- NArchive::NExtract::NOperationResult::kCRCError));
- _outStreamWithHashSpec->ReleaseStream();
- _fileIsOpen = false;
- _currentIndex++;
- }
- if (realProcessedSize == size)
- {
- if (processedSize != NULL)
- *processedSize = realProcessedSize;
- return WriteEmptyFiles();
- }
- }
- else
- {
- RINOK(OpenFile());
- _fileIsOpen = true;
- _filePos = 0;
- }
- }
- if (processedSize != NULL)
- *processedSize = size;
- return S_OK;
-}
-
-HRESULT CFolderOutStream::FlushCorrupted(Int32 resultEOperationResult)
-{
- while(_currentIndex < _extractStatuses->Size())
- {
- if (_fileIsOpen)
- {
- RINOK(_extractCallback->SetOperationResult(resultEOperationResult));
- _outStreamWithHashSpec->ReleaseStream();
- _fileIsOpen = false;
- _currentIndex++;
- }
- else
- {
- RINOK(OpenFile());
- _fileIsOpen = true;
- }
- }
- return S_OK;
-}
-
-HRESULT CFolderOutStream::WasWritingFinished()
-{
- if (_currentIndex == _extractStatuses->Size())
- return S_OK;
- return E_FAIL;
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.h
deleted file mode 100644
index 05a6358c7e..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zFolderOutStream.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// 7zFolderOutStream.h
-
-#ifndef __7Z_FOLDEROUTSTREAM_H
-#define __7Z_FOLDEROUTSTREAM_H
-
-#include "7zIn.h"
-
-#include "../../IStream.h"
-#include "../IArchive.h"
-#include "../Common/OutStreamWithCRC.h"
-
-namespace NArchive {
-namespace N7z {
-
-class CFolderOutStream:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
-
- CFolderOutStream();
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-private:
-
- COutStreamWithCRC *_outStreamWithHashSpec;
- CMyComPtr<ISequentialOutStream> _outStreamWithHash;
- const CArchiveDatabaseEx *_archiveDatabase;
- const CBoolVector *_extractStatuses;
- UInt32 _startIndex;
- UInt32 _ref2Offset;
- int _currentIndex;
- // UInt64 _currentDataPos;
- CMyComPtr<IArchiveExtractCallback> _extractCallback;
- bool _testMode;
-
- bool _fileIsOpen;
- UInt64 _filePos;
-
- HRESULT OpenFile();
- HRESULT WriteEmptyFiles();
-public:
- HRESULT Init(
- const CArchiveDatabaseEx *archiveDatabase,
- UInt32 ref2Offset,
- UInt32 startIndex,
- const CBoolVector *extractStatuses,
- IArchiveExtractCallback *extractCallback,
- bool testMode);
- HRESULT FlushCorrupted(Int32 resultEOperationResult);
- HRESULT WasWritingFinished();
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.cpp
deleted file mode 100644
index b6f492aea8..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.cpp
+++ /dev/null
@@ -1,757 +0,0 @@
-// 7zHandler.cpp
-
-#include "StdAfx.h"
-
-#include "7zHandler.h"
-#include "7zProperties.h"
-
-#include "../../../Common/IntToString.h"
-#include "../../../Common/ComTry.h"
-#include "../../../Windows/Defs.h"
-
-#include "../Common/ItemNameUtils.h"
-#ifdef _7Z_VOL
-#include "../Common/MultiStream.h"
-#endif
-
-#ifdef __7Z_SET_PROPERTIES
-#ifdef EXTRACT_ONLY
-#include "../Common/ParseProperties.h"
-#endif
-#endif
-
-using namespace NWindows;
-
-namespace NArchive {
-namespace N7z {
-
-CHandler::CHandler()
-{
- #ifdef COMPRESS_MT
- _numThreads = NWindows::NSystem::GetNumberOfProcessors();
- #endif
- #ifndef EXTRACT_ONLY
- Init();
- #endif
- #ifndef EXCLUDE_COM
- LoadMethodMap();
- #endif
-}
-
-STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
-{
- COM_TRY_BEGIN
- *numItems =
- #ifdef _7Z_VOL
- _refs.Size();
- #else
- *numItems = _database.Files.Size();
- #endif
- return S_OK;
- COM_TRY_END
-}
-
-STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
-{
- value->vt = VT_EMPTY;
- return S_OK;
-}
-
-#ifdef _SFX
-
-STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties)
-{
- return E_NOTIMPL;
-}
-
-STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType)
-{
- return E_NOTIMPL;
-}
-
-#endif
-
-
-STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProperties)
-{
- *numProperties = 0;
- return S_OK;
-}
-
-STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType)
-{
- return E_NOTIMPL;
-}
-
-
-static void MySetFileTime(bool timeDefined, FILETIME unixTime,
- NWindows::NCOM::CPropVariant &propVariant)
-{
- if (timeDefined)
- propVariant = unixTime;
-}
-
-/*
-inline static wchar_t GetHex(Byte value)
-{
- return (value < 10) ? ('0' + value) : ('A' + (value - 10));
-}
-
-static UString ConvertBytesToHexString(const Byte *data, UInt32 size)
-{
- UString result;
- for (UInt32 i = 0; i < size; i++)
- {
- Byte b = data[i];
- result += GetHex(b >> 4);
- result += GetHex(b & 0xF);
- }
- return result;
-}
-*/
-
-
-#ifndef _SFX
-
-static UString ConvertUInt32ToString(UInt32 value)
-{
- wchar_t buffer[32];
- ConvertUInt64ToString(value, buffer);
- return buffer;
-}
-
-static UString GetStringForSizeValue(UInt32 value)
-{
- for (int i = 31; i >= 0; i--)
- if ((UInt32(1) << i) == value)
- return ConvertUInt32ToString(i);
- UString result;
- if (value % (1 << 20) == 0)
- {
- result += ConvertUInt32ToString(value >> 20);
- result += L"m";
- }
- else if (value % (1 << 10) == 0)
- {
- result += ConvertUInt32ToString(value >> 10);
- result += L"k";
- }
- else
- {
- result += ConvertUInt32ToString(value);
- result += L"b";
- }
- return result;
-}
-
-static CMethodID k_Copy = { { 0x0 }, 1 };
-static CMethodID k_LZMA = { { 0x3, 0x1, 0x1 }, 3 };
-static CMethodID k_BCJ = { { 0x3, 0x3, 0x1, 0x3 }, 4 };
-static CMethodID k_BCJ2 = { { 0x3, 0x3, 0x1, 0x1B }, 4 };
-static CMethodID k_PPMD = { { 0x3, 0x4, 0x1 }, 3 };
-static CMethodID k_Deflate = { { 0x4, 0x1, 0x8 }, 3 };
-static CMethodID k_BZip2 = { { 0x4, 0x2, 0x2 }, 3 };
-
-static inline char GetHex(Byte value)
-{
- return (value < 10) ? ('0' + value) : ('A' + (value - 10));
-}
-static inline UString GetHex2(Byte value)
-{
- UString result;
- result += GetHex(value >> 4);
- result += GetHex(value & 0xF);
- return result;
-}
-
-#endif
-
-static inline UInt32 GetUInt32FromMemLE(const Byte *p)
-{
- return p[0] | (((UInt32)p[1]) << 8) | (((UInt32)p[2]) << 16) | (((UInt32)p[3]) << 24);
-}
-
-STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
-{
- COM_TRY_BEGIN
- NWindows::NCOM::CPropVariant propVariant;
-
- /*
- const CRef2 &ref2 = _refs[index];
- if (ref2.Refs.IsEmpty())
- return E_FAIL;
- const CRef &ref = ref2.Refs.Front();
- */
-
- #ifdef _7Z_VOL
- const CRef &ref = _refs[index];
- const CVolume &volume = _volumes[ref.VolumeIndex];
- const CArchiveDatabaseEx &_database = volume.Database;
- UInt32 index2 = ref.ItemIndex;
- const CFileItem &item = _database.Files[index2];
- #else
- const CFileItem &item = _database.Files[index];
- UInt32 index2 = index;
- #endif
-
- switch(propID)
- {
- case kpidPath:
- {
- if (!item.Name.IsEmpty())
- propVariant = NItemName::GetOSName(item.Name);
- break;
- }
- case kpidIsFolder:
- propVariant = item.IsDirectory;
- break;
- case kpidSize:
- {
- propVariant = item.UnPackSize;
- // propVariant = ref2.UnPackSize;
- break;
- }
- case kpidPosition:
- {
- /*
- if (ref2.Refs.Size() > 1)
- propVariant = ref2.StartPos;
- else
- */
- if (item.IsStartPosDefined)
- propVariant = item.StartPos;
- break;
- }
- case kpidPackedSize:
- {
- // propVariant = ref2.PackSize;
- {
- CNum folderIndex = _database.FileIndexToFolderIndexMap[index2];
- if (folderIndex != kNumNoIndex)
- {
- if (_database.FolderStartFileIndex[folderIndex] == (CNum)index2)
- propVariant = _database.GetFolderFullPackSize(folderIndex);
- /*
- else
- propVariant = UInt64(0);
- */
- }
- else
- propVariant = UInt64(0);
- }
- break;
- }
- case kpidLastAccessTime:
- MySetFileTime(item.IsLastAccessTimeDefined, item.LastAccessTime, propVariant);
- break;
- case kpidCreationTime:
- MySetFileTime(item.IsCreationTimeDefined, item.CreationTime, propVariant);
- break;
- case kpidLastWriteTime:
- MySetFileTime(item.IsLastWriteTimeDefined, item.LastWriteTime, propVariant);
- break;
- case kpidAttributes:
- if (item.AreAttributesDefined)
- propVariant = item.Attributes;
- break;
- case kpidCRC:
- if (item.IsFileCRCDefined)
- propVariant = item.FileCRC;
- break;
- #ifndef _SFX
- case kpidMethod:
- {
- CNum folderIndex = _database.FileIndexToFolderIndexMap[index2];
- if (folderIndex != kNumNoIndex)
- {
- const CFolder &folderInfo = _database.Folders[folderIndex];
- UString methodsString;
- for (int i = folderInfo.Coders.Size() - 1; i >= 0; i--)
- {
- const CCoderInfo &coderInfo = folderInfo.Coders[i];
- if (!methodsString.IsEmpty())
- methodsString += L' ';
- CMethodInfo methodInfo;
-
- bool methodIsKnown;
-
- for (int j = 0; j < coderInfo.AltCoders.Size(); j++)
- {
- if (j > 0)
- methodsString += L"|";
- const CAltCoderInfo &altCoderInfo = coderInfo.AltCoders[j];
-
- UString methodName;
- #ifdef NO_REGISTRY
-
- methodIsKnown = true;
- if (altCoderInfo.MethodID == k_Copy)
- methodName = L"Copy";
- else if (altCoderInfo.MethodID == k_LZMA)
- methodName = L"LZMA";
- else if (altCoderInfo.MethodID == k_BCJ)
- methodName = L"BCJ";
- else if (altCoderInfo.MethodID == k_BCJ2)
- methodName = L"BCJ2";
- else if (altCoderInfo.MethodID == k_PPMD)
- methodName = L"PPMD";
- else if (altCoderInfo.MethodID == k_Deflate)
- methodName = L"Deflate";
- else if (altCoderInfo.MethodID == k_BZip2)
- methodName = L"BZip2";
- else
- methodIsKnown = false;
-
- #else
-
- methodIsKnown = GetMethodInfo(
- altCoderInfo.MethodID, methodInfo);
- methodName = methodInfo.Name;
-
- #endif
-
- if (methodIsKnown)
- {
- methodsString += methodName;
- if (altCoderInfo.MethodID == k_LZMA)
- {
- if (altCoderInfo.Properties.GetCapacity() >= 5)
- {
- methodsString += L":";
- UInt32 dicSize = GetUInt32FromMemLE(
- ((const Byte *)altCoderInfo.Properties + 1));
- methodsString += GetStringForSizeValue(dicSize);
- }
- }
- else if (altCoderInfo.MethodID == k_PPMD)
- {
- if (altCoderInfo.Properties.GetCapacity() >= 5)
- {
- Byte order = *(const Byte *)altCoderInfo.Properties;
- methodsString += L":o";
- methodsString += ConvertUInt32ToString(order);
- methodsString += L":mem";
- UInt32 dicSize = GetUInt32FromMemLE(
- ((const Byte *)altCoderInfo.Properties + 1));
- methodsString += GetStringForSizeValue(dicSize);
- }
- }
- else
- {
- if (altCoderInfo.Properties.GetCapacity() > 0)
- {
- methodsString += L":[";
- for (size_t bi = 0; bi < altCoderInfo.Properties.GetCapacity(); bi++)
- {
- if (bi > 2 && bi + 1 < altCoderInfo.Properties.GetCapacity())
- {
- methodsString += L"..";
- break;
- }
- else
- methodsString += GetHex2(altCoderInfo.Properties[bi]);
- }
- methodsString += L"]";
- }
- }
- }
- else
- {
- methodsString += altCoderInfo.MethodID.ConvertToString();
- }
- }
- }
- propVariant = methodsString;
- }
- }
- break;
- case kpidBlock:
- {
- CNum folderIndex = _database.FileIndexToFolderIndexMap[index2];
- if (folderIndex != kNumNoIndex)
- propVariant = (UInt32)folderIndex;
- }
- break;
- case kpidPackedSize0:
- case kpidPackedSize1:
- case kpidPackedSize2:
- case kpidPackedSize3:
- case kpidPackedSize4:
- {
- CNum folderIndex = _database.FileIndexToFolderIndexMap[index2];
- if (folderIndex != kNumNoIndex)
- {
- const CFolder &folderInfo = _database.Folders[folderIndex];
- if (_database.FolderStartFileIndex[folderIndex] == (CNum)index2 &&
- folderInfo.PackStreams.Size() > (int)(propID - kpidPackedSize0))
- {
- propVariant = _database.GetFolderPackStreamSize(folderIndex, propID - kpidPackedSize0);
- }
- else
- propVariant = UInt64(0);
- }
- else
- propVariant = UInt64(0);
- }
- break;
- #endif
- case kpidIsAnti:
- propVariant = item.IsAnti;
- break;
- }
- propVariant.Detach(value);
- return S_OK;
- COM_TRY_END
-}
-
-static const wchar_t *kExt = L"7z";
-static const wchar_t *kAfterPart = L".7z";
-
-#ifdef _7Z_VOL
-
-class CVolumeName
-{
- bool _first;
- UString _unchangedPart;
- UString _changedPart;
- UString _afterPart;
-public:
- bool InitName(const UString &name)
- {
- _first = true;
- int dotPos = name.ReverseFind('.');
- UString basePart = name;
- if (dotPos >= 0)
- {
- UString ext = name.Mid(dotPos + 1);
- if (ext.CompareNoCase(kExt)==0 ||
- ext.CompareNoCase(L"EXE") == 0)
- {
- _afterPart = kAfterPart;
- basePart = name.Left(dotPos);
- }
- }
-
- int numLetters = 1;
- bool splitStyle = false;
- if (basePart.Right(numLetters) == L"1")
- {
- while (numLetters < basePart.Length())
- {
- if (basePart[basePart.Length() - numLetters - 1] != '0')
- break;
- numLetters++;
- }
- }
- else
- return false;
- _unchangedPart = basePart.Left(basePart.Length() - numLetters);
- _changedPart = basePart.Right(numLetters);
- return true;
- }
-
- UString GetNextName()
- {
- UString newName;
- // if (_newStyle || !_first)
- {
- int i;
- int numLetters = _changedPart.Length();
- for (i = numLetters - 1; i >= 0; i--)
- {
- wchar_t c = _changedPart[i];
- if (c == L'9')
- {
- c = L'0';
- newName = c + newName;
- if (i == 0)
- newName = UString(L'1') + newName;
- continue;
- }
- c++;
- newName = UString(c) + newName;
- i--;
- for (; i >= 0; i--)
- newName = _changedPart[i] + newName;
- break;
- }
- _changedPart = newName;
- }
- _first = false;
- return _unchangedPart + _changedPart + _afterPart;
- }
-};
-
-#endif
-
-STDMETHODIMP CHandler::Open(IInStream *stream,
- const UInt64 *maxCheckStartPosition,
- IArchiveOpenCallback *openArchiveCallback)
-{
- COM_TRY_BEGIN
- Close();
- #ifndef _SFX
- _fileInfoPopIDs.Clear();
- #endif
- try
- {
- CMyComPtr<IArchiveOpenCallback> openArchiveCallbackTemp = openArchiveCallback;
- #ifdef _7Z_VOL
- CVolumeName seqName;
-
- CMyComPtr<IArchiveOpenVolumeCallback> openVolumeCallback;
- #endif
-
- #ifndef _NO_CRYPTO
- CMyComPtr<ICryptoGetTextPassword> getTextPassword;
- if (openArchiveCallback)
- {
- openArchiveCallbackTemp.QueryInterface(
- IID_ICryptoGetTextPassword, &getTextPassword);
- }
- #endif
- #ifdef _7Z_VOL
- if (openArchiveCallback)
- {
- openArchiveCallbackTemp.QueryInterface(IID_IArchiveOpenVolumeCallback, &openVolumeCallback);
- }
- while(true)
- {
- CMyComPtr<IInStream> inStream;
- if (!_volumes.IsEmpty())
- {
- if (!openVolumeCallback)
- break;
- if(_volumes.Size() == 1)
- {
- UString baseName;
- {
- NCOM::CPropVariant propVariant;
- RINOK(openVolumeCallback->GetProperty(kpidName, &propVariant));
- if (propVariant.vt != VT_BSTR)
- break;
- baseName = propVariant.bstrVal;
- }
- seqName.InitName(baseName);
- }
-
- UString fullName = seqName.GetNextName();
- HRESULT result = openVolumeCallback->GetStream(fullName, &inStream);
- if (result == S_FALSE)
- break;
- if (result != S_OK)
- return result;
- if (!stream)
- break;
- }
- else
- inStream = stream;
-
- CInArchive archive;
- RINOK(archive.Open(inStream, maxCheckStartPosition));
-
- _volumes.Add(CVolume());
- CVolume &volume = _volumes.Back();
- CArchiveDatabaseEx &database = volume.Database;
- volume.Stream = inStream;
- volume.StartRef2Index = _refs.Size();
-
- HRESULT result = archive.ReadDatabase(database
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- );
- if (result != S_OK)
- {
- _volumes.Clear();
- return result;
- }
- database.Fill();
- for(int i = 0; i < database.Files.Size(); i++)
- {
- CRef refNew;
- refNew.VolumeIndex = _volumes.Size() - 1;
- refNew.ItemIndex = i;
- _refs.Add(refNew);
- /*
- const CFileItem &file = database.Files[i];
- int j;
- */
- /*
- for (j = _refs.Size() - 1; j >= 0; j--)
- {
- CRef2 &ref2 = _refs[j];
- const CRef &ref = ref2.Refs.Back();
- const CVolume &volume2 = _volumes[ref.VolumeIndex];
- const CArchiveDatabaseEx &database2 = volume2.Database;
- const CFileItem &file2 = database2.Files[ref.ItemIndex];
- if (file2.Name.CompareNoCase(file.Name) == 0)
- {
- if (!file.IsStartPosDefined)
- continue;
- if (file.StartPos != ref2.StartPos + ref2.UnPackSize)
- continue;
- ref2.Refs.Add(refNew);
- break;
- }
- }
- */
- /*
- j = -1;
- if (j < 0)
- {
- CRef2 ref2New;
- ref2New.Refs.Add(refNew);
- j = _refs.Add(ref2New);
- }
- CRef2 &ref2 = _refs[j];
- ref2.UnPackSize += file.UnPackSize;
- ref2.PackSize += database.GetFilePackSize(i);
- if (ref2.Refs.Size() == 1 && file.IsStartPosDefined)
- ref2.StartPos = file.StartPos;
- */
- }
- if (database.Files.Size() != 1)
- break;
- const CFileItem &file = database.Files.Front();
- if (!file.IsStartPosDefined)
- break;
- }
- #else
- CInArchive archive;
- RINOK(archive.Open(stream, maxCheckStartPosition));
- HRESULT result = archive.ReadDatabase(_database
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- );
- RINOK(result);
- _database.Fill();
- _inStream = stream;
- #endif
- }
- catch(...)
- {
- Close();
- return S_FALSE;
- }
- // _inStream = stream;
- #ifndef _SFX
- FillPopIDs();
- #endif
- return S_OK;
- COM_TRY_END
-}
-
-STDMETHODIMP CHandler::Close()
-{
- COM_TRY_BEGIN
- #ifdef _7Z_VOL
- _volumes.Clear();
- _refs.Clear();
- #else
- _inStream.Release();
- _database.Clear();
- #endif
- return S_OK;
- COM_TRY_END
-}
-
-#ifdef _7Z_VOL
-STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
-{
- if (index != 0)
- return E_INVALIDARG;
- *stream = 0;
- CMultiStream *streamSpec = new CMultiStream;
- CMyComPtr<ISequentialInStream> streamTemp = streamSpec;
-
- UInt64 pos = 0;
- const UString *fileName;
- for (int i = 0; i < _refs.Size(); i++)
- {
- const CRef &ref = _refs[i];
- const CVolume &volume = _volumes[ref.VolumeIndex];
- const CArchiveDatabaseEx &database = volume.Database;
- const CFileItem &file = database.Files[ref.ItemIndex];
- if (i == 0)
- fileName = &file.Name;
- else
- if (fileName->Compare(file.Name) != 0)
- return S_FALSE;
- if (!file.IsStartPosDefined)
- return S_FALSE;
- if (file.StartPos != pos)
- return S_FALSE;
- CNum folderIndex = database.FileIndexToFolderIndexMap[ref.ItemIndex];
- if (folderIndex == kNumNoIndex)
- {
- if (file.UnPackSize != 0)
- return E_FAIL;
- continue;
- }
- if (database.NumUnPackStreamsVector[folderIndex] != 1)
- return S_FALSE;
- const CFolder &folder = database.Folders[folderIndex];
- if (folder.Coders.Size() != 1)
- return S_FALSE;
- const CCoderInfo &coder = folder.Coders.Front();
- if (coder.NumInStreams != 1 || coder.NumOutStreams != 1)
- return S_FALSE;
- const CAltCoderInfo &altCoder = coder.AltCoders.Front();
- if (altCoder.MethodID.IDSize != 1 || altCoder.MethodID.ID[0] != 0)
- return S_FALSE;
-
- pos += file.UnPackSize;
- CMultiStream::CSubStreamInfo subStreamInfo;
- subStreamInfo.Stream = volume.Stream;
- subStreamInfo.Pos = database.GetFolderStreamPos(folderIndex, 0);
- subStreamInfo.Size = file.UnPackSize;
- streamSpec->Streams.Add(subStreamInfo);
- }
- streamSpec->Init();
- *stream = streamTemp.Detach();
- return S_OK;
-}
-#endif
-
-
-#ifdef __7Z_SET_PROPERTIES
-#ifdef EXTRACT_ONLY
-
-STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties)
-{
- COM_TRY_BEGIN
- const UInt32 numProcessors = NSystem::GetNumberOfProcessors();
- _numThreads = numProcessors;
-
- for (int i = 0; i < numProperties; i++)
- {
- UString name = names[i];
- name.MakeUpper();
- if (name.IsEmpty())
- return E_INVALIDARG;
- const PROPVARIANT &value = values[i];
- UInt32 number;
- int index = ParseStringToUInt32(name, number);
- if (index == 0)
- {
- if(name.Left(2).CompareNoCase(L"MT") == 0)
- {
- RINOK(ParseMtProp(name.Mid(2), value, numProcessors, _numThreads));
- continue;
- }
- else
- return E_INVALIDARG;
- }
- }
- return S_OK;
- COM_TRY_END
-}
-
-#endif
-#endif
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.h
deleted file mode 100644
index 3da9b88599..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zHandler.h
+++ /dev/null
@@ -1,234 +0,0 @@
-// 7z/Handler.h
-
-#ifndef __7Z_HANDLER_H
-#define __7Z_HANDLER_H
-
-#include "../IArchive.h"
-#include "7zIn.h"
-
-#include "7zCompressionMode.h"
-
-#ifndef _SFX
-#include "7zMethods.h"
-#endif
-
-#ifdef COMPRESS_MT
-#include "../../../Windows/System.h"
-#endif
-
-namespace NArchive {
-namespace N7z {
-
-#ifdef _7Z_VOL
-struct CRef
-{
- int VolumeIndex;
- int ItemIndex;
-};
-
-/*
-struct CRef2
-{
- CRecordVector<CRef> Refs;
- UInt64 UnPackSize;
- UInt64 PackSize;
- UInt64 StartPos;
- CRef2(): UnPackSize(0), PackSize(0), StartPos(0) {}
-};
-*/
-
-struct CVolume
-{
- int StartRef2Index;
- CMyComPtr<IInStream> Stream;
- CArchiveDatabaseEx Database;
-};
-#endif
-
-#ifndef EXTRACT_ONLY
-
-struct COneMethodInfo
-{
- CObjectVector<CProperty> CoderProperties;
- UString MethodName;
-};
-#endif
-
-// {23170F69-40C1-278A-1000-000110070000}
-DEFINE_GUID(CLSID_CFormat7z,
- 0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00);
-
-#ifndef __7Z_SET_PROPERTIES
-
-#ifdef EXTRACT_ONLY
-#ifdef COMPRESS_MT
-#define __7Z_SET_PROPERTIES
-#endif
-#else
-#define __7Z_SET_PROPERTIES
-#endif
-
-#endif
-
-
-class CHandler:
- public IInArchive,
- #ifdef _7Z_VOL
- public IInArchiveGetStream,
- #endif
- #ifdef __7Z_SET_PROPERTIES
- public ISetProperties,
- #endif
- #ifndef EXTRACT_ONLY
- public IOutArchive,
- #endif
- public CMyUnknownImp
-{
-public:
- MY_QUERYINTERFACE_BEGIN
- #ifdef _7Z_VOL
- MY_QUERYINTERFACE_ENTRY(IInArchiveGetStream)
- #endif
- #ifdef __7Z_SET_PROPERTIES
- MY_QUERYINTERFACE_ENTRY(ISetProperties)
- #endif
- #ifndef EXTRACT_ONLY
- MY_QUERYINTERFACE_ENTRY(IOutArchive)
- #endif
- MY_QUERYINTERFACE_END
- MY_ADDREF_RELEASE
-
- STDMETHOD(Open)(IInStream *stream,
- const UInt64 *maxCheckStartPosition,
- IArchiveOpenCallback *openArchiveCallback);
- STDMETHOD(Close)();
-
- STDMETHOD(GetNumberOfItems)(UInt32 *numItems);
- STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value);
- STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems,
- Int32 testMode, IArchiveExtractCallback *extractCallback);
-
- STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value);
-
- STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties);
- STDMETHOD(GetPropertyInfo)(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType);
-
- STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties);
- STDMETHOD(GetArchivePropertyInfo)(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType);
-
- #ifdef _7Z_VOL
- STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
- #endif
-
- #ifdef __7Z_SET_PROPERTIES
- STDMETHOD(SetProperties)(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties);
- #endif
-
- #ifndef EXTRACT_ONLY
- // IOutArchiveHandler
- STDMETHOD(UpdateItems)(ISequentialOutStream *outStream, UInt32 numItems,
- IArchiveUpdateCallback *updateCallback);
-
- STDMETHOD(GetFileTimeType)(UInt32 *type);
-
- // ISetProperties
-
- HRESULT SetSolidSettings(const UString &s);
- HRESULT SetSolidSettings(const PROPVARIANT &value);
- #endif
-
- CHandler();
-
-private:
- #ifdef _7Z_VOL
- CObjectVector<CVolume> _volumes;
- CObjectVector<CRef> _refs;
- #else
- CMyComPtr<IInStream> _inStream;
- NArchive::N7z::CArchiveDatabaseEx _database;
- #endif
-
- #ifdef COMPRESS_MT
- UInt32 _numThreads;
- #endif
-
- #ifndef EXTRACT_ONLY
- CObjectVector<COneMethodInfo> _methods;
- CRecordVector<CBind> _binds;
- bool _removeSfxBlock;
- UInt64 _numSolidFiles;
- UInt64 _numSolidBytes;
- bool _numSolidBytesDefined;
- bool _solidExtension;
-
- bool _compressHeaders;
- bool _compressHeadersFull;
- bool _encryptHeaders;
-
- bool _autoFilter;
- UInt32 _level;
-
- bool _volumeMode;
-
-
- HRESULT SetParam(COneMethodInfo &oneMethodInfo, const UString &name, const UString &value);
- HRESULT SetParams(COneMethodInfo &oneMethodInfo, const UString &srcString);
-
- HRESULT SetPassword(CCompressionMethodMode &methodMode,
- IArchiveUpdateCallback *updateCallback);
-
- HRESULT SetCompressionMethod(CCompressionMethodMode &method,
- CObjectVector<COneMethodInfo> &methodsInfo
- #ifdef COMPRESS_MT
- , UInt32 numThreads
- #endif
- );
-
- HRESULT SetCompressionMethod(
- CCompressionMethodMode &method,
- CCompressionMethodMode &headerMethod);
-
- #endif
-
- #ifndef _SFX
-
- CRecordVector<UInt64> _fileInfoPopIDs;
- void FillPopIDs();
-
- #endif
-
- #ifndef EXTRACT_ONLY
-
- void InitSolidFiles() { _numSolidFiles = UInt64(Int64(-1)); }
- void InitSolidSize() { _numSolidBytes = UInt64(Int64(-1)); }
- void InitSolid()
- {
- InitSolidFiles();
- InitSolidSize();
- _solidExtension = false;
- _numSolidBytesDefined = false;
- }
-
- void Init()
- {
- _removeSfxBlock = false;
- _compressHeaders = true;
- _compressHeadersFull = true;
- _encryptHeaders = false;
- #ifdef COMPRESS_MT
- _numThreads = NWindows::NSystem::GetNumberOfProcessors();
- #endif
-
- _level = 5;
- _autoFilter = true;
- _volumeMode = false;
- InitSolid();
- }
- #endif
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.cpp
deleted file mode 100644
index 7aff58fa47..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.cpp
+++ /dev/null
@@ -1,19 +0,0 @@
-// 7z/Header.cpp
-
-#include "StdAfx.h"
-#include "7zHeader.h"
-
-namespace NArchive {
-namespace N7z {
-
-Byte kSignature[kSignatureSize] = {'7' + 1, 'z', 0xBC, 0xAF, 0x27, 0x1C};
-Byte kFinishSignature[kSignatureSize] = {'7' + 1, 'z', 0xBC, 0xAF, 0x27, 0x1C + 1};
-
-class SignatureInitializer
-{
-public:
- SignatureInitializer() { kSignature[0]--; kFinishSignature[0]--;};
-} g_SignatureInitializer;
-
-}}
-
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.h
deleted file mode 100644
index f301677267..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zHeader.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// 7z/7zHeader.h
-
-#ifndef __7Z_HEADER_H
-#define __7Z_HEADER_H
-
-#include "7zMethodID.h"
-
-namespace NArchive {
-namespace N7z {
-
-const int kSignatureSize = 6;
-extern Byte kSignature[kSignatureSize];
-
-// #define _7Z_VOL
-// 7z-MultiVolume is not finished yet.
-// It can work already, but I still do not like some
-// things of that new multivolume format.
-// So please keep it commented.
-
-#ifdef _7Z_VOL
-extern Byte kFinishSignature[kSignatureSize];
-#endif
-
-struct CArchiveVersion
-{
- Byte Major;
- Byte Minor;
-};
-
-const Byte kMajorVersion = 0;
-
-struct CStartHeader
-{
- UInt64 NextHeaderOffset;
- UInt64 NextHeaderSize;
- UInt32 NextHeaderCRC;
-};
-
-const UInt32 kStartHeaderSize = 20;
-
-#ifdef _7Z_VOL
-struct CFinishHeader: public CStartHeader
-{
- UInt64 ArchiveStartOffset; // data offset from end if that struct
- UInt64 AdditionalStartBlockSize; // start signature & start header size
-};
-
-const UInt32 kFinishHeaderSize = kStartHeaderSize + 16;
-#endif
-
-namespace NID
-{
- enum EEnum
- {
- kEnd,
-
- kHeader,
-
- kArchiveProperties,
-
- kAdditionalStreamsInfo,
- kMainStreamsInfo,
- kFilesInfo,
-
- kPackInfo,
- kUnPackInfo,
- kSubStreamsInfo,
-
- kSize,
- kCRC,
-
- kFolder,
-
- kCodersUnPackSize,
- kNumUnPackStream,
-
- kEmptyStream,
- kEmptyFile,
- kAnti,
-
- kName,
- kCreationTime,
- kLastAccessTime,
- kLastWriteTime,
- kWinAttributes,
- kComment,
-
- kEncodedHeader,
-
- kStartPos
- };
-}
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zIn.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zIn.cpp
deleted file mode 100644
index 86709d36d8..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zIn.cpp
+++ /dev/null
@@ -1,1294 +0,0 @@
-// 7zIn.cpp
-
-#include "StdAfx.h"
-
-#include "7zIn.h"
-#include "7zMethods.h"
-#include "7zDecode.h"
-#include "../../Common/StreamObjects.h"
-#include "../../Common/StreamUtils.h"
-#include "../../../Common/CRC.h"
-
-namespace NArchive {
-namespace N7z {
-
-class CStreamSwitch
-{
- CInArchive *_archive;
- bool _needRemove;
-public:
- CStreamSwitch(): _needRemove(false) {}
- ~CStreamSwitch() { Remove(); }
- void Remove();
- void Set(CInArchive *archive, const Byte *data, size_t size);
- void Set(CInArchive *archive, const CByteBuffer &byteBuffer);
- HRESULT Set(CInArchive *archive, const CObjectVector<CByteBuffer> *dataVector);
-};
-
-void CStreamSwitch::Remove()
-{
- if (_needRemove)
- {
- _archive->DeleteByteStream();
- _needRemove = false;
- }
-}
-
-void CStreamSwitch::Set(CInArchive *archive, const Byte *data, size_t size)
-{
- Remove();
- _archive = archive;
- _archive->AddByteStream(data, size);
- _needRemove = true;
-}
-
-void CStreamSwitch::Set(CInArchive *archive, const CByteBuffer &byteBuffer)
-{
- Set(archive, byteBuffer, byteBuffer.GetCapacity());
-}
-
-HRESULT CStreamSwitch::Set(CInArchive *archive, const CObjectVector<CByteBuffer> *dataVector)
-{
- Remove();
- Byte external;
- RINOK(archive->ReadByte(external));
- if (external != 0)
- {
- CNum dataIndex;
- RINOK(archive->ReadNum(dataIndex));
- Set(archive, (*dataVector)[dataIndex]);
- }
- return S_OK;
-}
-
-
-CInArchiveException::CInArchiveException(CCauseType cause):
- Cause(cause)
-{}
-
-HRESULT CInArchive::ReadDirect(IInStream *stream, void *data, UInt32 size,
- UInt32 *processedSize)
-{
- UInt32 realProcessedSize;
- HRESULT result = ReadStream(stream, data, size, &realProcessedSize);
- if(processedSize != NULL)
- *processedSize = realProcessedSize;
- _position += realProcessedSize;
- return result;
-}
-
-HRESULT CInArchive::ReadDirect(void *data, UInt32 size, UInt32 *processedSize)
-{
- return ReadDirect(_stream, data, size, processedSize);
-}
-
-HRESULT CInArchive::SafeReadDirect(void *data, UInt32 size)
-{
- UInt32 realProcessedSize;
- RINOK(ReadDirect(data, size, &realProcessedSize));
- if (realProcessedSize != size)
- throw CInArchiveException(CInArchiveException::kUnexpectedEndOfArchive);
- return S_OK;
-}
-
-HRESULT CInArchive::SafeReadDirectByte(Byte &b)
-{
- return SafeReadDirect(&b, 1);
-}
-
-HRESULT CInArchive::SafeReadDirectUInt32(UInt32 &value)
-{
- value = 0;
- for (int i = 0; i < 4; i++)
- {
- Byte b;
- RINOK(SafeReadDirectByte(b));
- value |= (UInt32(b) << (8 * i));
- }
- return S_OK;
-}
-
-HRESULT CInArchive::SafeReadDirectUInt64(UInt64 &value)
-{
- value = 0;
- for (int i = 0; i < 8; i++)
- {
- Byte b;
- RINOK(SafeReadDirectByte(b));
- value |= (UInt64(b) << (8 * i));
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadNumber(UInt64 &value)
-{
- Byte firstByte;
- RINOK(ReadByte(firstByte));
- Byte mask = 0x80;
- value = 0;
- for (int i = 0; i < 8; i++)
- {
- if ((firstByte & mask) == 0)
- {
- UInt64 highPart = firstByte & (mask - 1);
- value += (highPart << (i * 8));
- return S_OK;
- }
- Byte b;
- RINOK(ReadByte(b));
- value |= (UInt64(b) << (8 * i));
- mask >>= 1;
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadNum(CNum &value)
-{
- UInt64 value64;
- RINOK(ReadNumber(value64));
- if (value64 > kNumMax)
- return E_FAIL;
- value = (CNum)value64;
- return S_OK;
-}
-
-HRESULT CInArchive::ReadUInt32(UInt32 &value)
-{
- value = 0;
- for (int i = 0; i < 4; i++)
- {
- Byte b;
- RINOK(ReadByte(b));
- value |= (UInt32(b) << (8 * i));
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadUInt64(UInt64 &value)
-{
- value = 0;
- for (int i = 0; i < 8; i++)
- {
- Byte b;
- RINOK(ReadByte(b));
- value |= (UInt64(b) << (8 * i));
- }
- return S_OK;
-}
-
-static inline bool TestSignatureCandidate(const void *testBytes)
-{
- for (int i = 0; i < kSignatureSize; i++)
- if (((const Byte *)testBytes)[i] != kSignature[i])
- return false;
- return true;
-}
-
-#ifdef _7Z_VOL
-static inline bool TestFinishSignatureCandidate(const void *testBytes)
-{
- for (int i = 0; i < kSignatureSize; i++)
- if (((const Byte *)testBytes)[i] != kFinishSignature[i])
- return false;
- return true;
-}
-#endif
-
-HRESULT CInArchive::FindAndReadSignature(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
-{
- _position = _arhiveBeginStreamPosition;
- RINOK(stream->Seek(_arhiveBeginStreamPosition, STREAM_SEEK_SET, NULL));
-
- Byte signature[kSignatureSize];
- UInt32 processedSize;
- RINOK(ReadDirect(stream, signature, kSignatureSize, &processedSize));
- if(processedSize != kSignatureSize)
- return S_FALSE;
- if (TestSignatureCandidate(signature))
- return S_OK;
-
- CByteBuffer byteBuffer;
- const UInt32 kBufferSize = (1 << 16);
- byteBuffer.SetCapacity(kBufferSize);
- Byte *buffer = byteBuffer;
- UInt32 numPrevBytes = kSignatureSize - 1;
- memmove(buffer, signature + 1, numPrevBytes);
- UInt64 curTestPos = _arhiveBeginStreamPosition + 1;
- while(true)
- {
- if (searchHeaderSizeLimit != NULL)
- if (curTestPos - _arhiveBeginStreamPosition > *searchHeaderSizeLimit)
- return S_FALSE;
- UInt32 numReadBytes = kBufferSize - numPrevBytes;
- RINOK(ReadDirect(stream, buffer + numPrevBytes, numReadBytes, &processedSize));
- UInt32 numBytesInBuffer = numPrevBytes + processedSize;
- if (numBytesInBuffer < kSignatureSize)
- return S_FALSE;
- UInt32 numTests = numBytesInBuffer - kSignatureSize + 1;
- for(UInt32 pos = 0; pos < numTests; pos++, curTestPos++)
- {
- if (TestSignatureCandidate(buffer + pos))
- {
- _arhiveBeginStreamPosition = curTestPos;
- _position = curTestPos + kSignatureSize;
- return stream->Seek(_position, STREAM_SEEK_SET, NULL);
- }
- }
- numPrevBytes = numBytesInBuffer - numTests;
- memmove(buffer, buffer + numTests, numPrevBytes);
- }
-}
-
-// Out: _position must point to end of signature
-
-#ifdef _7Z_VOL
-HRESULT CInArchive::FindFinishSignature(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
-{
- RINOK(stream->Seek(0, STREAM_SEEK_END, &_position));
- if (_position < kSignatureSize)
- return S_FALSE;
-
- CByteBuffer byteBuffer;
- const UInt32 kBufferSize = (1 << 18);
- byteBuffer.SetCapacity(kBufferSize);
- Byte *buffer = byteBuffer;
- UInt32 numPrevBytes = 0;
- UInt64 limitPos = 0;
- if (searchHeaderSizeLimit != NULL)
- if (*searchHeaderSizeLimit < _position)
- limitPos = _position - *searchHeaderSizeLimit;
-
- while(_position >= limitPos)
- {
- UInt32 numReadBytes = kBufferSize - numPrevBytes;
- if (numReadBytes > _position)
- numReadBytes = (UInt32)_position;
- UInt32 numBytesInBuffer = numPrevBytes + numReadBytes;
- if (numBytesInBuffer < kSignatureSize)
- return S_FALSE;
- _position -= numReadBytes;
- RINOK(stream->Seek(_position, STREAM_SEEK_SET, &_position));
- UInt32 startPos = kBufferSize - numBytesInBuffer;
- UInt32 processedSize;
- RINOK(ReadDirect(stream, buffer + startPos, numReadBytes, &processedSize));
- if (processedSize != numReadBytes)
- return S_FALSE;
- _position -= processedSize;
- for(UInt32 pos = kBufferSize; pos >= startPos + kSignatureSize; pos--)
- {
- if (TestFinishSignatureCandidate(buffer + pos - kSignatureSize))
- {
- _position += pos - startPos;
- return stream->Seek(_position, STREAM_SEEK_SET, NULL);
- }
- }
- numPrevBytes = kSignatureSize - 1;
- memmove(buffer + kBufferSize - numPrevBytes, buffer + startPos + 1, numPrevBytes);
- }
- return S_FALSE;
-}
-#endif
-
-// S_FALSE means that file is not archive
-HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
-{
- Close();
- RINOK(stream->Seek(0, STREAM_SEEK_CUR, &_arhiveBeginStreamPosition))
- _position = _arhiveBeginStreamPosition;
- #ifdef _7Z_VOL
- HRESULT result = FindFinishSignature(stream, searchHeaderSizeLimit);
- if (result == S_OK)
- _finishSignature = true;
- else
- {
- if (result != S_FALSE)
- return result;
- _finishSignature = false;
- RINOK(FindAndReadSignature(stream, searchHeaderSizeLimit));
- }
- #else
- RINOK(FindAndReadSignature(stream, searchHeaderSizeLimit));
- #endif
- _stream = stream;
- return S_OK;
-}
-
-void CInArchive::Close()
-{
- _stream.Release();
-}
-
-HRESULT CInArchive::SkeepData(UInt64 size)
-{
- for (UInt64 i = 0; i < size; i++)
- {
- Byte temp;
- RINOK(ReadByte(temp));
- }
- return S_OK;
-}
-
-HRESULT CInArchive::SkeepData()
-{
- UInt64 size;
- RINOK(ReadNumber(size));
- return SkeepData(size);
-}
-
-HRESULT CInArchive::ReadArchiveProperties(CInArchiveInfo &archiveInfo)
-{
- while(true)
- {
- UInt64 type;
- RINOK(ReadID(type));
- if (type == NID::kEnd)
- break;
- SkeepData();
- }
- return S_OK;
-}
-
-HRESULT CInArchive::GetNextFolderItem(CFolder &folder)
-{
- CNum numCoders;
- RINOK(ReadNum(numCoders));
-
- folder.Coders.Clear();
- folder.Coders.Reserve((int)numCoders);
- CNum numInStreams = 0;
- CNum numOutStreams = 0;
- CNum i;
- for (i = 0; i < numCoders; i++)
- {
- folder.Coders.Add(CCoderInfo());
- CCoderInfo &coder = folder.Coders.Back();
-
- while (true)
- {
- coder.AltCoders.Add(CAltCoderInfo());
- CAltCoderInfo &altCoder = coder.AltCoders.Back();
- Byte mainByte;
- RINOK(ReadByte(mainByte));
- altCoder.MethodID.IDSize = mainByte & 0xF;
- RINOK(ReadBytes(altCoder.MethodID.ID, altCoder.MethodID.IDSize));
- if ((mainByte & 0x10) != 0)
- {
- RINOK(ReadNum(coder.NumInStreams));
- RINOK(ReadNum(coder.NumOutStreams));
- }
- else
- {
- coder.NumInStreams = 1;
- coder.NumOutStreams = 1;
- }
- if ((mainByte & 0x20) != 0)
- {
- CNum propertiesSize = 0;
- RINOK(ReadNum(propertiesSize));
- altCoder.Properties.SetCapacity((size_t)propertiesSize);
- RINOK(ReadBytes((Byte *)altCoder.Properties, (size_t)propertiesSize));
- }
- if ((mainByte & 0x80) == 0)
- break;
- }
- numInStreams += coder.NumInStreams;
- numOutStreams += coder.NumOutStreams;
- }
-
- CNum numBindPairs;
- // RINOK(ReadNumber(numBindPairs));
- numBindPairs = numOutStreams - 1;
- folder.BindPairs.Clear();
- folder.BindPairs.Reserve(numBindPairs);
- for (i = 0; i < numBindPairs; i++)
- {
- CBindPair bindPair;
- RINOK(ReadNum(bindPair.InIndex));
- RINOK(ReadNum(bindPair.OutIndex));
- folder.BindPairs.Add(bindPair);
- }
-
- CNum numPackedStreams = numInStreams - numBindPairs;
- folder.PackStreams.Reserve(numPackedStreams);
- if (numPackedStreams == 1)
- {
- for (CNum j = 0; j < numInStreams; j++)
- if (folder.FindBindPairForInStream(j) < 0)
- {
- folder.PackStreams.Add(j);
- break;
- }
- }
- else
- for(i = 0; i < numPackedStreams; i++)
- {
- CNum packStreamInfo;
- RINOK(ReadNum(packStreamInfo));
- folder.PackStreams.Add(packStreamInfo);
- }
-
- return S_OK;
-}
-
-HRESULT CInArchive::WaitAttribute(UInt64 attribute)
-{
- while(true)
- {
- UInt64 type;
- RINOK(ReadID(type));
- if (type == attribute)
- return S_OK;
- if (type == NID::kEnd)
- return S_FALSE;
- RINOK(SkeepData());
- }
-}
-
-HRESULT CInArchive::ReadHashDigests(int numItems,
- CRecordVector<bool> &digestsDefined,
- CRecordVector<UInt32> &digests)
-{
- RINOK(ReadBoolVector2(numItems, digestsDefined));
- digests.Clear();
- digests.Reserve(numItems);
- for(int i = 0; i < numItems; i++)
- {
- UInt32 crc;
- if (digestsDefined[i])
- RINOK(ReadUInt32(crc));
- digests.Add(crc);
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadPackInfo(
- UInt64 &dataOffset,
- CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
- CRecordVector<UInt32> &packCRCs)
-{
- RINOK(ReadNumber(dataOffset));
- CNum numPackStreams;
- RINOK(ReadNum(numPackStreams));
-
- RINOK(WaitAttribute(NID::kSize));
- packSizes.Clear();
- packSizes.Reserve(numPackStreams);
- for(CNum i = 0; i < numPackStreams; i++)
- {
- UInt64 size;
- RINOK(ReadNumber(size));
- packSizes.Add(size);
- }
-
- UInt64 type;
- while(true)
- {
- RINOK(ReadID(type));
- if (type == NID::kEnd)
- break;
- if (type == NID::kCRC)
- {
- RINOK(ReadHashDigests(numPackStreams, packCRCsDefined, packCRCs));
- continue;
- }
- RINOK(SkeepData());
- }
- if (packCRCsDefined.IsEmpty())
- {
- packCRCsDefined.Reserve(numPackStreams);
- packCRCsDefined.Clear();
- packCRCs.Reserve(numPackStreams);
- packCRCs.Clear();
- for(CNum i = 0; i < numPackStreams; i++)
- {
- packCRCsDefined.Add(false);
- packCRCs.Add(0);
- }
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadUnPackInfo(
- const CObjectVector<CByteBuffer> *dataVector,
- CObjectVector<CFolder> &folders)
-{
- RINOK(WaitAttribute(NID::kFolder));
- CNum numFolders;
- RINOK(ReadNum(numFolders));
-
- {
- CStreamSwitch streamSwitch;
- RINOK(streamSwitch.Set(this, dataVector));
- folders.Clear();
- folders.Reserve((UInt32)numFolders);
- for(CNum i = 0; i < numFolders; i++)
- {
- folders.Add(CFolder());
- RINOK(GetNextFolderItem(folders.Back()));
- }
- }
-
- RINOK(WaitAttribute(NID::kCodersUnPackSize));
-
- CNum i;
- for(i = 0; i < numFolders; i++)
- {
- CFolder &folder = folders[i];
- CNum numOutStreams = folder.GetNumOutStreams();
- folder.UnPackSizes.Reserve(numOutStreams);
- for(CNum j = 0; j < numOutStreams; j++)
- {
- UInt64 unPackSize;
- RINOK(ReadNumber(unPackSize));
- folder.UnPackSizes.Add(unPackSize);
- }
- }
-
- while(true)
- {
- UInt64 type;
- RINOK(ReadID(type));
- if (type == NID::kEnd)
- return S_OK;
- if (type == NID::kCRC)
- {
- CRecordVector<bool> crcsDefined;
- CRecordVector<UInt32> crcs;
- RINOK(ReadHashDigests(numFolders, crcsDefined, crcs));
- for(i = 0; i < numFolders; i++)
- {
- CFolder &folder = folders[i];
- folder.UnPackCRCDefined = crcsDefined[i];
- folder.UnPackCRC = crcs[i];
- }
- continue;
- }
- RINOK(SkeepData());
- }
-}
-
-HRESULT CInArchive::ReadSubStreamsInfo(
- const CObjectVector<CFolder> &folders,
- CRecordVector<CNum> &numUnPackStreamsInFolders,
- CRecordVector<UInt64> &unPackSizes,
- CRecordVector<bool> &digestsDefined,
- CRecordVector<UInt32> &digests)
-{
- numUnPackStreamsInFolders.Clear();
- numUnPackStreamsInFolders.Reserve(folders.Size());
- UInt64 type;
- while(true)
- {
- RINOK(ReadID(type));
- if (type == NID::kNumUnPackStream)
- {
- for(int i = 0; i < folders.Size(); i++)
- {
- CNum value;
- RINOK(ReadNum(value));
- numUnPackStreamsInFolders.Add(value);
- }
- continue;
- }
- if (type == NID::kCRC || type == NID::kSize)
- break;
- if (type == NID::kEnd)
- break;
- RINOK(SkeepData());
- }
-
- if (numUnPackStreamsInFolders.IsEmpty())
- for(int i = 0; i < folders.Size(); i++)
- numUnPackStreamsInFolders.Add(1);
-
- int i;
- for(i = 0; i < numUnPackStreamsInFolders.Size(); i++)
- {
- // v3.13 incorrectly worked with empty folders
- // v4.07: we check that folder is empty
- CNum numSubstreams = numUnPackStreamsInFolders[i];
- if (numSubstreams == 0)
- continue;
- UInt64 sum = 0;
- for (CNum j = 1; j < numSubstreams; j++)
- {
- UInt64 size;
- if (type == NID::kSize)
- {
- RINOK(ReadNumber(size));
- unPackSizes.Add(size);
- sum += size;
- }
- }
- unPackSizes.Add(folders[i].GetUnPackSize() - sum);
- }
- if (type == NID::kSize)
- {
- RINOK(ReadID(type));
- }
-
- int numDigests = 0;
- int numDigestsTotal = 0;
- for(i = 0; i < folders.Size(); i++)
- {
- CNum numSubstreams = numUnPackStreamsInFolders[i];
- if (numSubstreams != 1 || !folders[i].UnPackCRCDefined)
- numDigests += numSubstreams;
- numDigestsTotal += numSubstreams;
- }
-
- while(true)
- {
- if (type == NID::kCRC)
- {
- CRecordVector<bool> digestsDefined2;
- CRecordVector<UInt32> digests2;
- RINOK(ReadHashDigests(numDigests, digestsDefined2, digests2));
- int digestIndex = 0;
- for (i = 0; i < folders.Size(); i++)
- {
- CNum numSubstreams = numUnPackStreamsInFolders[i];
- const CFolder &folder = folders[i];
- if (numSubstreams == 1 && folder.UnPackCRCDefined)
- {
- digestsDefined.Add(true);
- digests.Add(folder.UnPackCRC);
- }
- else
- for (CNum j = 0; j < numSubstreams; j++, digestIndex++)
- {
- digestsDefined.Add(digestsDefined2[digestIndex]);
- digests.Add(digests2[digestIndex]);
- }
- }
- }
- else if (type == NID::kEnd)
- {
- if (digestsDefined.IsEmpty())
- {
- digestsDefined.Clear();
- digests.Clear();
- for (int i = 0; i < numDigestsTotal; i++)
- {
- digestsDefined.Add(false);
- digests.Add(0);
- }
- }
- return S_OK;
- }
- else
- {
- RINOK(SkeepData());
- }
- RINOK(ReadID(type));
- }
-}
-
-HRESULT CInArchive::ReadStreamsInfo(
- const CObjectVector<CByteBuffer> *dataVector,
- UInt64 &dataOffset,
- CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
- CRecordVector<UInt32> &packCRCs,
- CObjectVector<CFolder> &folders,
- CRecordVector<CNum> &numUnPackStreamsInFolders,
- CRecordVector<UInt64> &unPackSizes,
- CRecordVector<bool> &digestsDefined,
- CRecordVector<UInt32> &digests)
-{
- while(true)
- {
- UInt64 type;
- RINOK(ReadID(type));
- switch(type)
- {
- case NID::kEnd:
- return S_OK;
- case NID::kPackInfo:
- {
- RINOK(ReadPackInfo(dataOffset, packSizes,
- packCRCsDefined, packCRCs));
- break;
- }
- case NID::kUnPackInfo:
- {
- RINOK(ReadUnPackInfo(dataVector, folders));
- break;
- }
- case NID::kSubStreamsInfo:
- {
- RINOK(ReadSubStreamsInfo(folders, numUnPackStreamsInFolders,
- unPackSizes, digestsDefined, digests));
- break;
- }
- }
- }
-}
-
-HRESULT CInArchive::ReadFileNames(CObjectVector<CFileItem> &files)
-{
- for(int i = 0; i < files.Size(); i++)
- {
- UString &name = files[i].Name;
- name.Empty();
- while (true)
- {
- wchar_t c;
- RINOK(ReadWideCharLE(c));
- if (c == L'\0')
- break;
- name += c;
- }
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadBoolVector(int numItems, CBoolVector &v)
-{
- v.Clear();
- v.Reserve(numItems);
- Byte b;
- Byte mask = 0;
- for(int i = 0; i < numItems; i++)
- {
- if (mask == 0)
- {
- RINOK(ReadByte(b));
- mask = 0x80;
- }
- v.Add((b & mask) != 0);
- mask >>= 1;
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadBoolVector2(int numItems, CBoolVector &v)
-{
- Byte allAreDefined;
- RINOK(ReadByte(allAreDefined));
- if (allAreDefined == 0)
- return ReadBoolVector(numItems, v);
- v.Clear();
- v.Reserve(numItems);
- for (int i = 0; i < numItems; i++)
- v.Add(true);
- return S_OK;
-}
-
-HRESULT CInArchive::ReadTime(const CObjectVector<CByteBuffer> &dataVector,
- CObjectVector<CFileItem> &files, UInt64 type)
-{
- CBoolVector boolVector;
- RINOK(ReadBoolVector2(files.Size(), boolVector))
-
- CStreamSwitch streamSwitch;
- RINOK(streamSwitch.Set(this, &dataVector));
-
- for(int i = 0; i < files.Size(); i++)
- {
- CFileItem &file = files[i];
- CArchiveFileTime fileTime;
- bool defined = boolVector[i];
- if (defined)
- {
- UInt32 low, high;
- RINOK(ReadUInt32(low));
- RINOK(ReadUInt32(high));
- fileTime.dwLowDateTime = low;
- fileTime.dwHighDateTime = high;
- }
- switch(type)
- {
- case NID::kCreationTime:
- file.IsCreationTimeDefined = defined;
- if (defined)
- file.CreationTime = fileTime;
- break;
- case NID::kLastWriteTime:
- file.IsLastWriteTimeDefined = defined;
- if (defined)
- file.LastWriteTime = fileTime;
- break;
- case NID::kLastAccessTime:
- file.IsLastAccessTimeDefined = defined;
- if (defined)
- file.LastAccessTime = fileTime;
- break;
- }
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadAndDecodePackedStreams(UInt64 baseOffset,
- UInt64 &dataOffset, CObjectVector<CByteBuffer> &dataVector
- #ifndef _NO_CRYPTO
- , ICryptoGetTextPassword *getTextPassword
- #endif
- )
-{
- CRecordVector<UInt64> packSizes;
- CRecordVector<bool> packCRCsDefined;
- CRecordVector<UInt32> packCRCs;
- CObjectVector<CFolder> folders;
-
- CRecordVector<CNum> numUnPackStreamsInFolders;
- CRecordVector<UInt64> unPackSizes;
- CRecordVector<bool> digestsDefined;
- CRecordVector<UInt32> digests;
-
- RINOK(ReadStreamsInfo(NULL,
- dataOffset,
- packSizes,
- packCRCsDefined,
- packCRCs,
- folders,
- numUnPackStreamsInFolders,
- unPackSizes,
- digestsDefined,
- digests));
-
- // database.ArchiveInfo.DataStartPosition2 += database.ArchiveInfo.StartPositionAfterHeader;
-
- CNum packIndex = 0;
- CDecoder decoder(
- #ifdef _ST_MODE
- false
- #else
- true
- #endif
- );
- UInt64 dataStartPos = baseOffset + dataOffset;
- for(int i = 0; i < folders.Size(); i++)
- {
- const CFolder &folder = folders[i];
- dataVector.Add(CByteBuffer());
- CByteBuffer &data = dataVector.Back();
- UInt64 unPackSize = folder.GetUnPackSize();
- if (unPackSize > kNumMax)
- return E_FAIL;
- if (unPackSize > 0xFFFFFFFF)
- return E_FAIL;
- data.SetCapacity((size_t)unPackSize);
-
- CSequentialOutStreamImp2 *outStreamSpec = new CSequentialOutStreamImp2;
- CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
- outStreamSpec->Init(data, (size_t)unPackSize);
-
- HRESULT result = decoder.Decode(_stream, dataStartPos,
- &packSizes[packIndex], folder, outStream, NULL
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- #ifdef COMPRESS_MT
- , false, 1
- #endif
- );
- RINOK(result);
-
- if (folder.UnPackCRCDefined)
- if (!CCRC::VerifyDigest(folder.UnPackCRC, data, (UInt32)unPackSize))
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
- for (int j = 0; j < folder.PackStreams.Size(); j++)
- dataStartPos += packSizes[packIndex++];
- }
- return S_OK;
-}
-
-HRESULT CInArchive::ReadHeader(CArchiveDatabaseEx &database
- #ifndef _NO_CRYPTO
- , ICryptoGetTextPassword *getTextPassword
- #endif
- )
-{
- UInt64 type;
- RINOK(ReadID(type));
-
- if (type == NID::kArchiveProperties)
- {
- RINOK(ReadArchiveProperties(database.ArchiveInfo));
- RINOK(ReadID(type));
- }
-
- CObjectVector<CByteBuffer> dataVector;
-
- if (type == NID::kAdditionalStreamsInfo)
- {
- HRESULT result = ReadAndDecodePackedStreams(
- database.ArchiveInfo.StartPositionAfterHeader,
- database.ArchiveInfo.DataStartPosition2,
- dataVector
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- );
- RINOK(result);
- database.ArchiveInfo.DataStartPosition2 += database.ArchiveInfo.StartPositionAfterHeader;
- RINOK(ReadID(type));
- }
-
- CRecordVector<UInt64> unPackSizes;
- CRecordVector<bool> digestsDefined;
- CRecordVector<UInt32> digests;
-
- if (type == NID::kMainStreamsInfo)
- {
- RINOK(ReadStreamsInfo(&dataVector,
- database.ArchiveInfo.DataStartPosition,
- database.PackSizes,
- database.PackCRCsDefined,
- database.PackCRCs,
- database.Folders,
- database.NumUnPackStreamsVector,
- unPackSizes,
- digestsDefined,
- digests));
- database.ArchiveInfo.DataStartPosition += database.ArchiveInfo.StartPositionAfterHeader;
- RINOK(ReadID(type));
- }
- else
- {
- for(int i = 0; i < database.Folders.Size(); i++)
- {
- database.NumUnPackStreamsVector.Add(1);
- CFolder &folder = database.Folders[i];
- unPackSizes.Add(folder.GetUnPackSize());
- digestsDefined.Add(folder.UnPackCRCDefined);
- digests.Add(folder.UnPackCRC);
- }
- }
-
- database.Files.Clear();
-
- if (type == NID::kEnd)
- return S_OK;
- if (type != NID::kFilesInfo)
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
-
- CNum numFiles;
- RINOK(ReadNum(numFiles));
- database.Files.Reserve(numFiles);
- CNum i;
- for(i = 0; i < numFiles; i++)
- database.Files.Add(CFileItem());
-
- database.ArchiveInfo.FileInfoPopIDs.Add(NID::kSize);
- if (!database.PackSizes.IsEmpty())
- database.ArchiveInfo.FileInfoPopIDs.Add(NID::kPackInfo);
- if (numFiles > 0 && !digests.IsEmpty())
- database.ArchiveInfo.FileInfoPopIDs.Add(NID::kCRC);
-
- CBoolVector emptyStreamVector;
- emptyStreamVector.Reserve((int)numFiles);
- for(i = 0; i < numFiles; i++)
- emptyStreamVector.Add(false);
- CBoolVector emptyFileVector;
- CBoolVector antiFileVector;
- CNum numEmptyStreams = 0;
-
- // int sizePrev = -1;
- // int posPrev = 0;
-
- while(true)
- {
- /*
- if (sizePrev >= 0)
- if (sizePrev != _inByteBack->GetProcessedSize() - posPrev)
- throw 2;
- */
- UInt64 type;
- RINOK(ReadID(type));
- if (type == NID::kEnd)
- break;
- UInt64 size;
- RINOK(ReadNumber(size));
-
- // sizePrev = size;
- // posPrev = _inByteBack->GetProcessedSize();
-
- database.ArchiveInfo.FileInfoPopIDs.Add(type);
- switch(type)
- {
- case NID::kName:
- {
- CStreamSwitch streamSwitch;
- RINOK(streamSwitch.Set(this, &dataVector));
- RINOK(ReadFileNames(database.Files))
- break;
- }
- case NID::kWinAttributes:
- {
- CBoolVector boolVector;
- RINOK(ReadBoolVector2(database.Files.Size(), boolVector))
- CStreamSwitch streamSwitch;
- RINOK(streamSwitch.Set(this, &dataVector));
- for(i = 0; i < numFiles; i++)
- {
- CFileItem &file = database.Files[i];
- if (file.AreAttributesDefined = boolVector[i])
- {
- RINOK(ReadUInt32(file.Attributes));
- }
- }
- break;
- }
- case NID::kStartPos:
- {
- CBoolVector boolVector;
- RINOK(ReadBoolVector2(database.Files.Size(), boolVector))
- CStreamSwitch streamSwitch;
- RINOK(streamSwitch.Set(this, &dataVector));
- for(i = 0; i < numFiles; i++)
- {
- CFileItem &file = database.Files[i];
- if (file.IsStartPosDefined = boolVector[i])
- {
- RINOK(ReadUInt64(file.StartPos));
- }
- }
- break;
- }
- case NID::kEmptyStream:
- {
- RINOK(ReadBoolVector(numFiles, emptyStreamVector))
- for (i = 0; i < (CNum)emptyStreamVector.Size(); i++)
- if (emptyStreamVector[i])
- numEmptyStreams++;
- emptyFileVector.Reserve(numEmptyStreams);
- antiFileVector.Reserve(numEmptyStreams);
- for (i = 0; i < numEmptyStreams; i++)
- {
- emptyFileVector.Add(false);
- antiFileVector.Add(false);
- }
- break;
- }
- case NID::kEmptyFile:
- {
- RINOK(ReadBoolVector(numEmptyStreams, emptyFileVector))
- break;
- }
- case NID::kAnti:
- {
- RINOK(ReadBoolVector(numEmptyStreams, antiFileVector))
- break;
- }
- case NID::kCreationTime:
- case NID::kLastWriteTime:
- case NID::kLastAccessTime:
- {
- RINOK(ReadTime(dataVector, database.Files, type))
- break;
- }
- default:
- {
- database.ArchiveInfo.FileInfoPopIDs.DeleteBack();
- RINOK(SkeepData(size));
- }
- }
- }
-
- CNum emptyFileIndex = 0;
- CNum sizeIndex = 0;
- for(i = 0; i < numFiles; i++)
- {
- CFileItem &file = database.Files[i];
- file.HasStream = !emptyStreamVector[i];
- if(file.HasStream)
- {
- file.IsDirectory = false;
- file.IsAnti = false;
- file.UnPackSize = unPackSizes[sizeIndex];
- file.FileCRC = digests[sizeIndex];
- file.IsFileCRCDefined = digestsDefined[sizeIndex];
- sizeIndex++;
- }
- else
- {
- file.IsDirectory = !emptyFileVector[emptyFileIndex];
- file.IsAnti = antiFileVector[emptyFileIndex];
- emptyFileIndex++;
- file.UnPackSize = 0;
- file.IsFileCRCDefined = false;
- }
- }
- return S_OK;
-}
-
-
-void CArchiveDatabaseEx::FillFolderStartPackStream()
-{
- FolderStartPackStreamIndex.Clear();
- FolderStartPackStreamIndex.Reserve(Folders.Size());
- CNum startPos = 0;
- for(int i = 0; i < Folders.Size(); i++)
- {
- FolderStartPackStreamIndex.Add(startPos);
- startPos += (CNum)Folders[i].PackStreams.Size();
- }
-}
-
-void CArchiveDatabaseEx::FillStartPos()
-{
- PackStreamStartPositions.Clear();
- PackStreamStartPositions.Reserve(PackSizes.Size());
- UInt64 startPos = 0;
- for(int i = 0; i < PackSizes.Size(); i++)
- {
- PackStreamStartPositions.Add(startPos);
- startPos += PackSizes[i];
- }
-}
-
-void CArchiveDatabaseEx::FillFolderStartFileIndex()
-{
- FolderStartFileIndex.Clear();
- FolderStartFileIndex.Reserve(Folders.Size());
- FileIndexToFolderIndexMap.Clear();
- FileIndexToFolderIndexMap.Reserve(Files.Size());
-
- int folderIndex = 0;
- CNum indexInFolder = 0;
- for (int i = 0; i < Files.Size(); i++)
- {
- const CFileItem &file = Files[i];
- bool emptyStream = !file.HasStream;
- if (emptyStream && indexInFolder == 0)
- {
- FileIndexToFolderIndexMap.Add(kNumNoIndex);
- continue;
- }
- if (indexInFolder == 0)
- {
- // v3.13 incorrectly worked with empty folders
- // v4.07: Loop for skipping empty folders
- while(true)
- {
- if (folderIndex >= Folders.Size())
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
- FolderStartFileIndex.Add(i); // check it
- if (NumUnPackStreamsVector[folderIndex] != 0)
- break;
- folderIndex++;
- }
- }
- FileIndexToFolderIndexMap.Add(folderIndex);
- if (emptyStream)
- continue;
- indexInFolder++;
- if (indexInFolder >= NumUnPackStreamsVector[folderIndex])
- {
- folderIndex++;
- indexInFolder = 0;
- }
- }
-}
-
-HRESULT CInArchive::ReadDatabase(CArchiveDatabaseEx &database
- #ifndef _NO_CRYPTO
- , ICryptoGetTextPassword *getTextPassword
- #endif
- )
-{
- database.Clear();
- database.ArchiveInfo.StartPosition = _arhiveBeginStreamPosition;
-
-
- RINOK(SafeReadDirect(&database.ArchiveInfo.Version.Major, 1));
- RINOK(SafeReadDirect(&database.ArchiveInfo.Version.Minor, 1));
- if (database.ArchiveInfo.Version.Major != kMajorVersion)
- throw CInArchiveException(CInArchiveException::kUnsupportedVersion);
-
- #ifdef _7Z_VOL
- if (_finishSignature)
- {
- RINOK(_stream->Seek(_position - (4 + kFinishHeaderSize) -
- (kSignatureSize + 2), STREAM_SEEK_SET, &_position));
- }
- #endif
-
- UInt32 crcFromArchive;
- RINOK(SafeReadDirectUInt32(crcFromArchive));
-
- UInt64 nextHeaderOffset;
- UInt64 nextHeaderSize;
- UInt32 nextHeaderCRC;
- CCRC crc;
- RINOK(SafeReadDirectUInt64(nextHeaderOffset));
- crc.UpdateUInt64(nextHeaderOffset);
- RINOK(SafeReadDirectUInt64(nextHeaderSize));
- crc.UpdateUInt64(nextHeaderSize);
- RINOK(SafeReadDirectUInt32(nextHeaderCRC));
- crc.UpdateUInt32(nextHeaderCRC);
-
- #ifdef _7Z_VOL
- UInt64 archiveStartOffset; // data offset from end if that struct
- UInt64 additionalStartBlockSize; // start signature & start header size
- if (_finishSignature)
- {
- RINOK(SafeReadDirectUInt64(archiveStartOffset));
- crc.UpdateUInt64(archiveStartOffset);
- RINOK(SafeReadDirectUInt64(additionalStartBlockSize));
- crc.UpdateUInt64(additionalStartBlockSize);
- database.ArchiveInfo.StartPositionAfterHeader = _position + archiveStartOffset;
- }
- else
- #endif
- {
- database.ArchiveInfo.StartPositionAfterHeader = _position;
- }
- if (crc.GetDigest() != crcFromArchive)
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
-
- if (nextHeaderSize == 0)
- return S_OK;
-
- if (nextHeaderSize >= 0xFFFFFFFF)
- return E_FAIL;
-
- RINOK(_stream->Seek(nextHeaderOffset, STREAM_SEEK_CUR, &_position));
-
- CByteBuffer buffer2;
- buffer2.SetCapacity((size_t)nextHeaderSize);
- RINOK(SafeReadDirect(buffer2, (UInt32)nextHeaderSize));
- if (!CCRC::VerifyDigest(nextHeaderCRC, buffer2, (UInt32)nextHeaderSize))
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
-
- CStreamSwitch streamSwitch;
- streamSwitch.Set(this, buffer2);
-
- CObjectVector<CByteBuffer> dataVector;
-
- while (true)
- {
- UInt64 type;
- RINOK(ReadID(type));
- if (type == NID::kHeader)
- break;
- if (type != NID::kEncodedHeader)
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
- HRESULT result = ReadAndDecodePackedStreams(
- database.ArchiveInfo.StartPositionAfterHeader,
- database.ArchiveInfo.DataStartPosition2,
- dataVector
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- );
- RINOK(result);
- if (dataVector.Size() == 0)
- return S_OK;
- if (dataVector.Size() > 1)
- throw CInArchiveException(CInArchiveException::kIncorrectHeader);
- streamSwitch.Remove();
- streamSwitch.Set(this, dataVector.Front());
- }
-
- return ReadHeader(database
- #ifndef _NO_CRYPTO
- , getTextPassword
- #endif
- );
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zIn.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zIn.h
deleted file mode 100644
index a6c5ef032d..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zIn.h
+++ /dev/null
@@ -1,288 +0,0 @@
-// 7zIn.h
-
-#ifndef __7Z_IN_H
-#define __7Z_IN_H
-
-#include "../../IStream.h"
-#include "../../IPassword.h"
-#include "../../../Common/MyCom.h"
-#include "../../Common/InBuffer.h"
-
-#include "7zHeader.h"
-#include "7zItem.h"
-
-namespace NArchive {
-namespace N7z {
-
-class CInArchiveException
-{
-public:
- enum CCauseType
- {
- kUnsupportedVersion = 0,
- kUnexpectedEndOfArchive = 0,
- kIncorrectHeader,
- } Cause;
- CInArchiveException(CCauseType cause);
-};
-
-struct CInArchiveInfo
-{
- CArchiveVersion Version;
- UInt64 StartPosition;
- UInt64 StartPositionAfterHeader;
- UInt64 DataStartPosition;
- UInt64 DataStartPosition2;
- CRecordVector<UInt64> FileInfoPopIDs;
- void Clear()
- {
- FileInfoPopIDs.Clear();
- }
-};
-
-
-struct CArchiveDatabaseEx: public CArchiveDatabase
-{
- CInArchiveInfo ArchiveInfo;
- CRecordVector<UInt64> PackStreamStartPositions;
- CRecordVector<CNum> FolderStartPackStreamIndex;
- CRecordVector<CNum> FolderStartFileIndex;
- CRecordVector<CNum> FileIndexToFolderIndexMap;
-
- void Clear()
- {
- CArchiveDatabase::Clear();
- ArchiveInfo.Clear();
- PackStreamStartPositions.Clear();
- FolderStartPackStreamIndex.Clear();
- FolderStartFileIndex.Clear();
- FileIndexToFolderIndexMap.Clear();
- }
-
- void FillFolderStartPackStream();
- void FillStartPos();
- void FillFolderStartFileIndex();
-
- void Fill()
- {
- FillFolderStartPackStream();
- FillStartPos();
- FillFolderStartFileIndex();
- }
-
- UInt64 GetFolderStreamPos(int folderIndex, int indexInFolder) const
- {
- return ArchiveInfo.DataStartPosition +
- PackStreamStartPositions[FolderStartPackStreamIndex[folderIndex] +
- indexInFolder];
- }
-
- UInt64 GetFolderFullPackSize(int folderIndex) const
- {
- CNum packStreamIndex = FolderStartPackStreamIndex[folderIndex];
- const CFolder &folder = Folders[folderIndex];
- UInt64 size = 0;
- for (int i = 0; i < folder.PackStreams.Size(); i++)
- size += PackSizes[packStreamIndex + i];
- return size;
- }
-
- UInt64 GetFolderPackStreamSize(int folderIndex, int streamIndex) const
- {
- return PackSizes[FolderStartPackStreamIndex[folderIndex] + streamIndex];
- }
-
- UInt64 GetFilePackSize(CNum fileIndex) const
- {
- CNum folderIndex = FileIndexToFolderIndexMap[fileIndex];
- if (folderIndex >= 0)
- {
- if (FolderStartFileIndex[folderIndex] == fileIndex)
- return GetFolderFullPackSize(folderIndex);
- }
- return 0;
- }
-};
-
-class CInByte2
-{
- const Byte *_buffer;
- size_t _size;
- size_t _pos;
-public:
- void Init(const Byte *buffer, size_t size)
- {
- _buffer = buffer;
- _size = size;
- _pos = 0;
- }
- bool ReadByte(Byte &b)
- {
- if(_pos >= _size)
- return false;
- b = _buffer[_pos++];
- return true;
- }
- void ReadBytes(void *data, size_t size, size_t &processedSize)
- {
- for(processedSize = 0; processedSize < size && _pos < _size; processedSize++)
- ((Byte *)data)[processedSize] = _buffer[_pos++];
- }
-
- bool ReadBytes(void *data, size_t size)
- {
- size_t processedSize;
- ReadBytes(data, size, processedSize);
- return (processedSize == size);
- }
-
- size_t GetProcessedSize() const { return _pos; }
-};
-
-class CStreamSwitch;
-class CInArchive
-{
- friend class CStreamSwitch;
-
- CMyComPtr<IInStream> _stream;
- #ifdef _7Z_VOL
- bool _finishSignature;
- #endif
-
- CObjectVector<CInByte2> _inByteVector;
- CInByte2 *_inByteBack;
-
- UInt64 _arhiveBeginStreamPosition;
- UInt64 _position;
-
- void AddByteStream(const Byte *buffer, size_t size)
- {
- _inByteVector.Add(CInByte2());
- _inByteBack = &_inByteVector.Back();
- _inByteBack->Init(buffer, size);
- }
-
- void DeleteByteStream()
- {
- _inByteVector.DeleteBack();
- if (!_inByteVector.IsEmpty())
- _inByteBack = &_inByteVector.Back();
- }
-
-private:
- HRESULT FindAndReadSignature(IInStream *stream, const UInt64 *searchHeaderSizeLimit); // S_FALSE means is not archive
- #ifdef _7Z_VOL
- HRESULT FindFinishSignature(IInStream *stream, const UInt64 *searchHeaderSizeLimit); // S_FALSE means is not archive
- #endif
-
- HRESULT ReadFileNames(CObjectVector<CFileItem> &files);
-
- HRESULT ReadDirect(IInStream *stream, void *data, UInt32 size,
- UInt32 *processedSize);
- HRESULT ReadDirect(void *data, UInt32 size, UInt32 *processedSize);
- HRESULT SafeReadDirect(void *data, UInt32 size);
- HRESULT SafeReadDirectByte(Byte &b);
- HRESULT SafeReadDirectUInt32(UInt32 &value);
- HRESULT SafeReadDirectUInt64(UInt64 &value);
-
- HRESULT ReadBytes(void *data, size_t size)
- {
- if (!_inByteBack->ReadBytes(data, size))
- return E_FAIL;
- return S_OK;
- }
-
- HRESULT ReadByte(Byte &b)
- {
- if (!_inByteBack->ReadByte(b))
- return E_FAIL;
- return S_OK;
- }
-
- HRESULT ReadWideCharLE(wchar_t &c)
- {
- Byte b1;
- if (!_inByteBack->ReadByte(b1))
- return E_FAIL;
- Byte b2;
- if (!_inByteBack->ReadByte(b2))
- return E_FAIL;
- c = (wchar_t(b2) << 8) + b1;
- return S_OK;
- }
-
- HRESULT ReadNumber(UInt64 &value);
- HRESULT ReadNum(CNum &value);
- HRESULT ReadID(UInt64 &value) { return ReadNumber(value); }
- HRESULT ReadUInt32(UInt32 &value);
- HRESULT ReadUInt64(UInt64 &value);
-
- HRESULT SkeepData(UInt64 size);
- HRESULT SkeepData();
- HRESULT WaitAttribute(UInt64 attribute);
-
- HRESULT ReadArchiveProperties(CInArchiveInfo &archiveInfo);
- HRESULT GetNextFolderItem(CFolder &itemInfo);
- HRESULT ReadHashDigests(int numItems,
- CRecordVector<bool> &digestsDefined, CRecordVector<UInt32> &digests);
-
- HRESULT ReadPackInfo(
- UInt64 &dataOffset,
- CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
- CRecordVector<UInt32> &packCRCs);
-
- HRESULT ReadUnPackInfo(
- const CObjectVector<CByteBuffer> *dataVector,
- CObjectVector<CFolder> &folders);
-
- HRESULT ReadSubStreamsInfo(
- const CObjectVector<CFolder> &folders,
- CRecordVector<CNum> &numUnPackStreamsInFolders,
- CRecordVector<UInt64> &unPackSizes,
- CRecordVector<bool> &digestsDefined,
- CRecordVector<UInt32> &digests);
-
- HRESULT ReadStreamsInfo(
- const CObjectVector<CByteBuffer> *dataVector,
- UInt64 &dataOffset,
- CRecordVector<UInt64> &packSizes,
- CRecordVector<bool> &packCRCsDefined,
- CRecordVector<UInt32> &packCRCs,
- CObjectVector<CFolder> &folders,
- CRecordVector<CNum> &numUnPackStreamsInFolders,
- CRecordVector<UInt64> &unPackSizes,
- CRecordVector<bool> &digestsDefined,
- CRecordVector<UInt32> &digests);
-
-
- HRESULT GetNextFileItem(CFileItem &itemInfo);
- HRESULT ReadBoolVector(int numItems, CBoolVector &v);
- HRESULT ReadBoolVector2(int numItems, CBoolVector &v);
- HRESULT ReadTime(const CObjectVector<CByteBuffer> &dataVector,
- CObjectVector<CFileItem> &files, UInt64 type);
- HRESULT ReadAndDecodePackedStreams(UInt64 baseOffset, UInt64 &dataOffset,
- CObjectVector<CByteBuffer> &dataVector
- #ifndef _NO_CRYPTO
- , ICryptoGetTextPassword *getTextPassword
- #endif
- );
- HRESULT ReadHeader(CArchiveDatabaseEx &database
- #ifndef _NO_CRYPTO
- ,ICryptoGetTextPassword *getTextPassword
- #endif
- );
-public:
- HRESULT Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit); // S_FALSE means is not archive
- void Close();
-
- HRESULT ReadDatabase(CArchiveDatabaseEx &database
- #ifndef _NO_CRYPTO
- ,ICryptoGetTextPassword *getTextPassword
- #endif
- );
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zItem.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zItem.h
deleted file mode 100644
index c50a0bcf41..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zItem.h
+++ /dev/null
@@ -1,181 +0,0 @@
-// 7zItem.h
-
-#ifndef __7Z_ITEM_H
-#define __7Z_ITEM_H
-
-#include "../../../Common/Buffer.h"
-#include "7zMethodID.h"
-#include "7zHeader.h"
-
-namespace NArchive {
-namespace N7z {
-
-struct CAltCoderInfo
-{
- CMethodID MethodID;
- CByteBuffer Properties;
-};
-
-typedef UInt32 CNum;
-const CNum kNumMax = 0x7FFFFFFF;
-const CNum kNumNoIndex = 0xFFFFFFFF;
-
-struct CCoderInfo
-{
- CNum NumInStreams;
- CNum NumOutStreams;
- CObjectVector<CAltCoderInfo> AltCoders;
- bool IsSimpleCoder() const { return (NumInStreams == 1) && (NumOutStreams == 1); }
-};
-
-struct CBindPair
-{
- CNum InIndex;
- CNum OutIndex;
-};
-
-struct CFolder
-{
- CObjectVector<CCoderInfo> Coders;
- CRecordVector<CBindPair> BindPairs;
- CRecordVector<CNum> PackStreams;
- CRecordVector<UInt64> UnPackSizes;
- UInt32 UnPackCRC;
- bool UnPackCRCDefined;
-
- CFolder(): UnPackCRCDefined(false) {}
-
- UInt64 GetUnPackSize() const // test it
- {
- if (UnPackSizes.IsEmpty())
- return 0;
- for (int i = UnPackSizes.Size() - 1; i >= 0; i--)
- if (FindBindPairForOutStream(i) < 0)
- return UnPackSizes[i];
- throw 1;
- }
-
- CNum GetNumOutStreams() const
- {
- CNum result = 0;
- for (int i = 0; i < Coders.Size(); i++)
- result += Coders[i].NumOutStreams;
- return result;
- }
-
- int FindBindPairForInStream(CNum inStreamIndex) const
- {
- for(int i = 0; i < BindPairs.Size(); i++)
- if (BindPairs[i].InIndex == inStreamIndex)
- return i;
- return -1;
- }
- int FindBindPairForOutStream(CNum outStreamIndex) const
- {
- for(int i = 0; i < BindPairs.Size(); i++)
- if (BindPairs[i].OutIndex == outStreamIndex)
- return i;
- return -1;
- }
- int FindPackStreamArrayIndex(CNum inStreamIndex) const
- {
- for(int i = 0; i < PackStreams.Size(); i++)
- if (PackStreams[i] == inStreamIndex)
- return i;
- return -1;
- }
-};
-
-typedef FILETIME CArchiveFileTime;
-
-class CFileItem
-{
-public:
- CArchiveFileTime CreationTime;
- CArchiveFileTime LastWriteTime;
- CArchiveFileTime LastAccessTime;
- UInt64 UnPackSize;
- UInt64 StartPos;
- UInt32 Attributes;
- UInt32 FileCRC;
- UString Name;
-
- bool HasStream; // Test it !!! it means that there is
- // stream in some folder. It can be empty stream
- bool IsDirectory;
- bool IsAnti;
- bool IsFileCRCDefined;
- bool AreAttributesDefined;
- bool IsCreationTimeDefined;
- bool IsLastWriteTimeDefined;
- bool IsLastAccessTimeDefined;
- bool IsStartPosDefined;
-
- /*
- const bool HasStream() const {
- return !IsDirectory && !IsAnti && UnPackSize != 0; }
- */
- CFileItem():
- HasStream(true),
- IsDirectory(false),
- IsAnti(false),
- IsFileCRCDefined(false),
- AreAttributesDefined(false),
- IsCreationTimeDefined(false),
- IsLastWriteTimeDefined(false),
- IsLastAccessTimeDefined(false),
- IsStartPosDefined(false)
- {}
- void SetAttributes(UInt32 attributes)
- {
- AreAttributesDefined = true;
- Attributes = attributes;
- }
- void SetCreationTime(const CArchiveFileTime &creationTime)
- {
- IsCreationTimeDefined = true;
- CreationTime = creationTime;
- }
- void SetLastWriteTime(const CArchiveFileTime &lastWriteTime)
- {
- IsLastWriteTimeDefined = true;
- LastWriteTime = lastWriteTime;
- }
- void SetLastAccessTime(const CArchiveFileTime &lastAccessTime)
- {
- IsLastAccessTimeDefined = true;
- LastAccessTime = lastAccessTime;
- }
-};
-
-struct CArchiveDatabase
-{
- CRecordVector<UInt64> PackSizes;
- CRecordVector<bool> PackCRCsDefined;
- CRecordVector<UInt32> PackCRCs;
- CObjectVector<CFolder> Folders;
- CRecordVector<CNum> NumUnPackStreamsVector;
- CObjectVector<CFileItem> Files;
- void Clear()
- {
- PackSizes.Clear();
- PackCRCsDefined.Clear();
- PackCRCs.Clear();
- Folders.Clear();
- NumUnPackStreamsVector.Clear();
- Files.Clear();
- }
- bool IsEmpty() const
- {
- return (PackSizes.IsEmpty() &&
- PackCRCsDefined.IsEmpty() &&
- PackCRCs.IsEmpty() &&
- Folders.IsEmpty() &&
- NumUnPackStreamsVector.IsEmpty() &&
- Files.IsEmpty());
- }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.cpp
deleted file mode 100644
index a7b1296e9f..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.cpp
+++ /dev/null
@@ -1,76 +0,0 @@
-// 7zMethodID.cpp
-
-#include "StdAfx.h"
-
-#include "7zMethodID.h"
-
-namespace NArchive {
-namespace N7z {
-
-static wchar_t GetHex(Byte value)
-{
- return (value < 10) ? ('0' + value) : ('A' + (value - 10));
-}
-
-static bool HexCharToInt(wchar_t value, Byte &result)
-{
- if (value >= '0' && value <= '9')
- result = value - '0';
- else if (value >= 'a' && value <= 'f')
- result = 10 + value - 'a';
- else if (value >= 'A' && value <= 'F')
- result = 10 + value - 'A';
- else
- return false;
- return true;
-}
-
-static bool TwoHexCharsToInt(wchar_t valueHigh, wchar_t valueLow, Byte &result)
-{
- Byte resultHigh, resultLow;
- if (!HexCharToInt(valueHigh, resultHigh))
- return false;
- if (!HexCharToInt(valueLow, resultLow))
- return false;
- result = (resultHigh << 4) + resultLow;
- return true;
-}
-
-UString CMethodID::ConvertToString() const
-{
- UString result;
- for (int i = 0; i < IDSize; i++)
- {
- Byte b = ID[i];
- result += GetHex(b >> 4);
- result += GetHex(b & 0xF);
- }
- return result;
-}
-
-bool CMethodID::ConvertFromString(const UString &srcString)
-{
- int length = srcString.Length();
- if ((length & 1) != 0 || (length >> 1) > kMethodIDSize)
- return false;
- IDSize = length / 2;
- UInt32 i;
- for(i = 0; i < IDSize; i++)
- if (!TwoHexCharsToInt(srcString[i * 2], srcString[i * 2 + 1], ID[i]))
- return false;
- for(; i < kMethodIDSize; i++)
- ID[i] = 0;
- return true;
-}
-
-bool operator==(const CMethodID &a1, const CMethodID &a2)
-{
- if (a1.IDSize != a2.IDSize)
- return false;
- for (UInt32 i = 0; i < a1.IDSize; i++)
- if (a1.ID[i] != a2.ID[i])
- return false;
- return true;
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.h
deleted file mode 100644
index 6bff152d6c..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethodID.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// 7zMethodID.h
-
-#ifndef __7Z_METHOD_ID_H
-#define __7Z_METHOD_ID_H
-
-#include "../../../Common/String.h"
-#include "../../../Common/Types.h"
-
-namespace NArchive {
-namespace N7z {
-
-const int kMethodIDSize = 15;
-
-struct CMethodID
-{
- Byte ID[kMethodIDSize];
- Byte IDSize;
- UString ConvertToString() const;
- bool ConvertFromString(const UString &srcString);
-};
-
-bool operator==(const CMethodID &a1, const CMethodID &a2);
-
-inline bool operator!=(const CMethodID &a1, const CMethodID &a2)
- { return !(a1 == a2); }
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.cpp
deleted file mode 100644
index 32f59003b2..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-// 7zMethods.cpp
-
-#include "StdAfx.h"
-
-#include "7zMethods.h"
-
-#include "../../../Windows/FileFind.h"
-#include "../../../Windows/DLL.h"
-#include "../../../Windows/PropVariant.h"
-#include "../../../Windows/Synchronization.h"
-
-#include "../../ICoder.h"
-#include "../Common/CodecsPath.h"
-
-using namespace NWindows;
-
-namespace NArchive {
-namespace N7z {
-
-static CObjectVector<CMethodInfo2> g_Methods;
-static bool g_Loaded = false;
-
-typedef UInt32 (WINAPI *GetNumberOfMethodsFunc)(UInt32 *numMethods);
-
-typedef UInt32 (WINAPI *GetMethodPropertyFunc)(
- UInt32 index, PROPID propID, PROPVARIANT *value);
-
-static void Load(const CSysString &folderPrefix)
-{
- NFile::NFind::CEnumerator enumerator(folderPrefix + CSysString(TEXT("*")));
- NFile::NFind::CFileInfo fileInfo;
- while (enumerator.Next(fileInfo))
- {
- if (fileInfo.IsDirectory())
- continue;
- CSysString filePath = folderPrefix + fileInfo.Name;
- {
- NDLL::CLibrary library;
- if (!library.LoadEx(filePath, LOAD_LIBRARY_AS_DATAFILE))
- continue;
- }
- NDLL::CLibrary library;
- if (!library.Load(filePath))
- continue;
- GetMethodPropertyFunc getMethodProperty = (GetMethodPropertyFunc)
- library.GetProcAddress("GetMethodProperty");
- if (getMethodProperty == NULL)
- continue;
-
- UInt32 numMethods = 1;
- GetNumberOfMethodsFunc getNumberOfMethodsFunc = (GetNumberOfMethodsFunc)
- library.GetProcAddress("GetNumberOfMethods");
- if (getNumberOfMethodsFunc != NULL)
- if (getNumberOfMethodsFunc(&numMethods) != S_OK)
- continue;
-
- for(UInt32 i = 0; i < numMethods; i++)
- {
- CMethodInfo2 info;
- info.FilePath = filePath;
-
- NWindows::NCOM::CPropVariant propVariant;
- if (getMethodProperty(i, NMethodPropID::kID, &propVariant) != S_OK)
- continue;
- if (propVariant.vt != VT_BSTR)
- continue;
- info.MethodID.IDSize = SysStringByteLen(propVariant.bstrVal);
- memmove(info.MethodID.ID, propVariant.bstrVal, info.MethodID.IDSize);
- propVariant.Clear();
-
- if (getMethodProperty(i, NMethodPropID::kName, &propVariant) != S_OK)
- continue;
- if (propVariant.vt == VT_EMPTY)
- {
- }
- else if (propVariant.vt == VT_BSTR)
- info.Name = propVariant.bstrVal;
- else
- continue;
- propVariant.Clear();
-
- if (getMethodProperty (i, NMethodPropID::kEncoder, &propVariant) != S_OK)
- continue;
- if (propVariant.vt == VT_EMPTY)
- info.EncoderIsAssigned = false;
- else if (propVariant.vt == VT_BSTR)
- {
- info.EncoderIsAssigned = true;
- info.Encoder = *(const GUID *)propVariant.bstrVal;
- }
- else
- continue;
- propVariant.Clear();
-
- if (getMethodProperty (i, NMethodPropID::kDecoder, &propVariant) != S_OK)
- continue;
- if (propVariant.vt == VT_EMPTY)
- info.DecoderIsAssigned = false;
- else if (propVariant.vt == VT_BSTR)
- {
- info.DecoderIsAssigned = true;
- info.Decoder = *(const GUID *)propVariant.bstrVal;
- }
- else
- continue;
- propVariant.Clear();
-
- if (getMethodProperty (i, NMethodPropID::kInStreams, &propVariant) != S_OK)
- continue;
- if (propVariant.vt == VT_EMPTY)
- info.NumInStreams = 1;
- else if (propVariant.vt == VT_UI4)
- info.NumInStreams = propVariant.ulVal;
- else
- continue;
- propVariant.Clear();
-
- if (getMethodProperty (i, NMethodPropID::kOutStreams, &propVariant) != S_OK)
- continue;
- if (propVariant.vt == VT_EMPTY)
- info.NumOutStreams = 1;
- else if (propVariant.vt == VT_UI4)
- info.NumOutStreams = propVariant.ulVal;
- else
- continue;
- propVariant.Clear();
-
- g_Methods.Add(info);
- }
- }
-}
-
-static NSynchronization::CCriticalSection g_CriticalSection;
-
-void LoadMethodMap()
-{
- NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
- if (g_Loaded)
- return;
- g_Loaded = true;
- Load(GetCodecsFolderPrefix());
-}
-
-bool GetMethodInfo(const CMethodID &methodID, CMethodInfo &methodInfo)
-{
- for(int i = 0; i < g_Methods.Size(); i++)
- {
- const CMethodInfo2 &method = g_Methods[i];
- if (method.MethodID == methodID)
- {
- methodInfo = (CMethodInfo)method;
- return true;
- }
- }
- return false;
-}
-
-bool GetMethodInfo(const UString &name, CMethodInfo2 &methodInfo)
-{
- for(int i = 0; i < g_Methods.Size(); i++)
- {
- const CMethodInfo2 &method = g_Methods[i];
- if (method.Name.CompareNoCase(name) == 0)
- {
- methodInfo = method;
- return true;
- }
- }
- return false;
-}
-
-}}
-
-
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.h
deleted file mode 100644
index 429199d044..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zMethods.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// 7zMethods.h
-
-#ifndef __7Z_METHODS_H
-#define __7Z_METHODS_H
-
-#include "7zMethodID.h"
-
-namespace NArchive {
-namespace N7z {
-
-struct CMethodInfo
-{
- UString Name;
- bool EncoderIsAssigned;
- bool DecoderIsAssigned;
- UInt32 NumInStreams;
- UInt32 NumOutStreams;
- CLSID Encoder;
- CLSID Decoder;
- // UString Description;
- CSysString FilePath;
-};
-
-struct CMethodInfo2: public CMethodInfo
-{
- CMethodID MethodID;
-};
-
-void LoadMethodMap();
-bool GetMethodInfo(const CMethodID &methodID, CMethodInfo &methodInfo);
-bool GetMethodInfo(const UString &name, CMethodInfo2 &methodInfo);
-
-}}
-
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.cpp b/other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.cpp
deleted file mode 100644
index d474be0957..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-// 7zProperties.cpp
-
-#include "StdAfx.h"
-
-#include "7zProperties.h"
-#include "7zHeader.h"
-#include "7zHandler.h"
-
-// #define _MULTI_PACK
-
-namespace NArchive {
-namespace N7z {
-
-struct CPropMap
-{
- UInt64 FilePropID;
- STATPROPSTG StatPROPSTG;
-};
-
-CPropMap kPropMap[] =
-{
- { NID::kName, NULL, kpidPath, VT_BSTR},
- { NID::kSize, NULL, kpidSize, VT_UI8},
- { NID::kPackInfo, NULL, kpidPackedSize, VT_UI8},
-
- #ifdef _MULTI_PACK
- { 100, L"Pack0", kpidPackedSize0, VT_UI8},
- { 101, L"Pack1", kpidPackedSize1, VT_UI8},
- { 102, L"Pack2", kpidPackedSize2, VT_UI8},
- { 103, L"Pack3", kpidPackedSize3, VT_UI8},
- { 104, L"Pack4", kpidPackedSize4, VT_UI8},
- #endif
-
- { NID::kCreationTime, NULL, kpidCreationTime, VT_FILETIME},
- { NID::kLastWriteTime, NULL, kpidLastWriteTime, VT_FILETIME},
- { NID::kLastAccessTime, NULL, kpidLastAccessTime, VT_FILETIME},
- { NID::kWinAttributes, NULL, kpidAttributes, VT_UI4},
- { NID::kStartPos, NULL, kpidPosition, VT_UI4},
-
-
- { NID::kCRC, NULL, kpidCRC, VT_UI4},
-
- { NID::kAnti, L"Anti", kpidIsAnti, VT_BOOL},
- // { 97, NULL, kpidSolid, VT_BOOL},
- #ifndef _SFX
- { 98, NULL, kpidMethod, VT_BSTR},
- { 99, L"Block", kpidBlock, VT_UI4}
- #endif
- // { L"ID", kpidID, VT_BSTR},
- // { L"UnPack Version", kpidUnPackVersion, VT_UI1},
- // { L"Host OS", kpidHostOS, VT_BSTR}
-};
-
-static const int kPropMapSize = sizeof(kPropMap) / sizeof(kPropMap[0]);
-
-static int FindPropInMap(UInt64 filePropID)
-{
- for (int i = 0; i < kPropMapSize; i++)
- if (kPropMap[i].FilePropID == filePropID)
- return i;
- return -1;
-}
-
-static void CopyOneItem(CRecordVector<UInt64> &src,
- CRecordVector<UInt64> &dest, UInt32 item)
-{
- for (int i = 0; i < src.Size(); i++)
- if (src[i] == item)
- {
- dest.Add(item);
- src.Delete(i);
- return;
- }
-}
-
-static void RemoveOneItem(CRecordVector<UInt64> &src, UInt32 item)
-{
- for (int i = 0; i < src.Size(); i++)
- if (src[i] == item)
- {
- src.Delete(i);
- return;
- }
-}
-
-static void InsertToHead(CRecordVector<UInt64> &dest, UInt32 item)
-{
- for (int i = 0; i < dest.Size(); i++)
- if (dest[i] == item)
- {
- dest.Delete(i);
- break;
- }
- dest.Insert(0, item);
-}
-
-void CHandler::FillPopIDs()
-{
- _fileInfoPopIDs.Clear();
-
- #ifdef _7Z_VOL
- if(_volumes.Size() < 1)
- return;
- const CVolume &volume = _volumes.Front();
- const CArchiveDatabaseEx &_database = volume.Database;
- #endif
-
- CRecordVector<UInt64> fileInfoPopIDs = _database.ArchiveInfo.FileInfoPopIDs;
-
- RemoveOneItem(fileInfoPopIDs, NID::kEmptyStream);
- RemoveOneItem(fileInfoPopIDs, NID::kEmptyFile);
-
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kName);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kAnti);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kSize);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kPackInfo);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kCreationTime);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kLastWriteTime);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kLastAccessTime);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kWinAttributes);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kCRC);
- CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::kComment);
- _fileInfoPopIDs += fileInfoPopIDs;
-
- #ifndef _SFX
- _fileInfoPopIDs.Add(98);
- _fileInfoPopIDs.Add(99);
- #endif
- #ifdef _MULTI_PACK
- _fileInfoPopIDs.Add(100);
- _fileInfoPopIDs.Add(101);
- _fileInfoPopIDs.Add(102);
- _fileInfoPopIDs.Add(103);
- _fileInfoPopIDs.Add(104);
- #endif
-
- #ifndef _SFX
- InsertToHead(_fileInfoPopIDs, NID::kLastWriteTime);
- InsertToHead(_fileInfoPopIDs, NID::kPackInfo);
- InsertToHead(_fileInfoPopIDs, NID::kSize);
- InsertToHead(_fileInfoPopIDs, NID::kName);
- #endif
-}
-
-STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProperties)
-{
- *numProperties = _fileInfoPopIDs.Size();
- return S_OK;
-}
-
-STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType)
-{
- if((int)index >= _fileInfoPopIDs.Size())
- return E_INVALIDARG;
- int indexInMap = FindPropInMap(_fileInfoPopIDs[index]);
- if (indexInMap == -1)
- return E_INVALIDARG;
- const STATPROPSTG &srcItem = kPropMap[indexInMap].StatPROPSTG;
- *propID = srcItem.propid;
- *varType = srcItem.vt;
- *name = 0;
- return S_OK;
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.h b/other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.h
deleted file mode 100644
index 2149e327ea..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zProperties.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// 7zProperties.h
-
-#ifndef __7Z_PROPERTIES_H
-#define __7Z_PROPERTIES_H
-
-#include "../../PropID.h"
-
-namespace NArchive {
-namespace N7z {
-
-enum // PropID
-{
- kpidPackedSize0 = kpidUserDefined,
- kpidPackedSize1,
- kpidPackedSize2,
- kpidPackedSize3,
- kpidPackedSize4,
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/Archive.def b/other-licenses/7zstub/src/7zip/Archive/Archive.def
deleted file mode 100644
index f06b0816d7..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Archive.def
+++ /dev/null
@@ -1,3 +0,0 @@
-EXPORTS
- CreateObject PRIVATE
- GetHandlerProperty PRIVATE
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.cpp b/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.cpp
deleted file mode 100644
index 4a552bf097..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-// CoderMixer2.cpp
-
-#include "StdAfx.h"
-
-#include "CoderMixer2.h"
-
-namespace NCoderMixer2 {
-
-CBindReverseConverter::CBindReverseConverter(const CBindInfo &srcBindInfo):
- _srcBindInfo(srcBindInfo)
-{
- srcBindInfo.GetNumStreams(NumSrcInStreams, _numSrcOutStreams);
-
- UInt32 j;
- for (j = 0; j < NumSrcInStreams; j++)
- {
- _srcInToDestOutMap.Add(0);
- DestOutToSrcInMap.Add(0);
- }
- for (j = 0; j < _numSrcOutStreams; j++)
- {
- _srcOutToDestInMap.Add(0);
- _destInToSrcOutMap.Add(0);
- }
-
- UInt32 destInOffset = 0;
- UInt32 destOutOffset = 0;
- UInt32 srcInOffset = NumSrcInStreams;
- UInt32 srcOutOffset = _numSrcOutStreams;
-
- for (int i = srcBindInfo.Coders.Size() - 1; i >= 0; i--)
- {
- const CCoderStreamsInfo &srcCoderInfo = srcBindInfo.Coders[i];
-
- srcInOffset -= srcCoderInfo.NumInStreams;
- srcOutOffset -= srcCoderInfo.NumOutStreams;
-
- UInt32 j;
- for (j = 0; j < srcCoderInfo.NumInStreams; j++, destOutOffset++)
- {
- UInt32 index = srcInOffset + j;
- _srcInToDestOutMap[index] = destOutOffset;
- DestOutToSrcInMap[destOutOffset] = index;
- }
- for (j = 0; j < srcCoderInfo.NumOutStreams; j++, destInOffset++)
- {
- UInt32 index = srcOutOffset + j;
- _srcOutToDestInMap[index] = destInOffset;
- _destInToSrcOutMap[destInOffset] = index;
- }
- }
-}
-
-void CBindReverseConverter::CreateReverseBindInfo(CBindInfo &destBindInfo)
-{
- destBindInfo.Coders.Clear();
- destBindInfo.BindPairs.Clear();
- destBindInfo.InStreams.Clear();
- destBindInfo.OutStreams.Clear();
-
- int i;
- for (i = _srcBindInfo.Coders.Size() - 1; i >= 0; i--)
- {
- const CCoderStreamsInfo &srcCoderInfo = _srcBindInfo.Coders[i];
- CCoderStreamsInfo destCoderInfo;
- destCoderInfo.NumInStreams = srcCoderInfo.NumOutStreams;
- destCoderInfo.NumOutStreams = srcCoderInfo.NumInStreams;
- destBindInfo.Coders.Add(destCoderInfo);
- }
- for (i = _srcBindInfo.BindPairs.Size() - 1; i >= 0; i--)
- {
- const CBindPair &srcBindPair = _srcBindInfo.BindPairs[i];
- CBindPair destBindPair;
- destBindPair.InIndex = _srcOutToDestInMap[srcBindPair.OutIndex];
- destBindPair.OutIndex = _srcInToDestOutMap[srcBindPair.InIndex];
- destBindInfo.BindPairs.Add(destBindPair);
- }
- for (i = 0; i < _srcBindInfo.InStreams.Size(); i++)
- destBindInfo.OutStreams.Add(_srcInToDestOutMap[_srcBindInfo.InStreams[i]]);
- for (i = 0; i < _srcBindInfo.OutStreams.Size(); i++)
- destBindInfo.InStreams.Add(_srcOutToDestInMap[_srcBindInfo.OutStreams[i]]);
-}
-
-CCoderInfo::CCoderInfo(UInt32 numInStreams, UInt32 numOutStreams):
- NumInStreams(numInStreams),
- NumOutStreams(numOutStreams)
-{
- InSizes.Reserve(NumInStreams);
- InSizePointers.Reserve(NumInStreams);
- OutSizePointers.Reserve(NumOutStreams);
- OutSizePointers.Reserve(NumOutStreams);
-}
-
-static void SetSizes(const UInt64 **srcSizes, CRecordVector<UInt64> &sizes,
- CRecordVector<const UInt64 *> &sizePointers, UInt32 numItems)
-{
- sizes.Clear();
- sizePointers.Clear();
- for(UInt32 i = 0; i < numItems; i++)
- {
- if (srcSizes == 0 || srcSizes[i] == NULL)
- {
- sizes.Add(0);
- sizePointers.Add(NULL);
- }
- else
- {
- sizes.Add(*srcSizes[i]);
- sizePointers.Add(&sizes.Back());
- }
- }
-}
-
-void CCoderInfo::SetCoderInfo(const UInt64 **inSizes,
- const UInt64 **outSizes)
-{
- SetSizes(inSizes, InSizes, InSizePointers, NumInStreams);
- SetSizes(outSizes, OutSizes, OutSizePointers, NumOutStreams);
-}
-
-}
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.h b/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.h
deleted file mode 100644
index 00cca2190d..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// CoderMixer2.h
-
-#ifndef __CODER_MIXER2_H
-#define __CODER_MIXER2_H
-
-#include "../../../Common/Vector.h"
-#include "../../../Common/Types.h"
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-
-namespace NCoderMixer2 {
-
-struct CBindPair
-{
- UInt32 InIndex;
- UInt32 OutIndex;
-};
-
-struct CCoderStreamsInfo
-{
- UInt32 NumInStreams;
- UInt32 NumOutStreams;
-};
-
-struct CBindInfo
-{
- CRecordVector<CCoderStreamsInfo> Coders;
- CRecordVector<CBindPair> BindPairs;
- CRecordVector<UInt32> InStreams;
- CRecordVector<UInt32> OutStreams;
-
- void Clear()
- {
- Coders.Clear();
- BindPairs.Clear();
- InStreams.Clear();
- OutStreams.Clear();
- }
-
- /*
- UInt32 GetCoderStartOutStream(UInt32 coderIndex) const
- {
- UInt32 numOutStreams = 0;
- for (UInt32 i = 0; i < coderIndex; i++)
- numOutStreams += Coders[i].NumOutStreams;
- return numOutStreams;
- }
- */
-
-
- void GetNumStreams(UInt32 &numInStreams, UInt32 &numOutStreams) const
- {
- numInStreams = 0;
- numOutStreams = 0;
- for (int i = 0; i < Coders.Size(); i++)
- {
- const CCoderStreamsInfo &coderStreamsInfo = Coders[i];
- numInStreams += coderStreamsInfo.NumInStreams;
- numOutStreams += coderStreamsInfo.NumOutStreams;
- }
- }
-
- int FindBinderForInStream(UInt32 inStream) const
- {
- for (int i = 0; i < BindPairs.Size(); i++)
- if (BindPairs[i].InIndex == inStream)
- return i;
- return -1;
- }
- int FindBinderForOutStream(UInt32 outStream) const
- {
- for (int i = 0; i < BindPairs.Size(); i++)
- if (BindPairs[i].OutIndex == outStream)
- return i;
- return -1;
- }
-
- UInt32 GetCoderInStreamIndex(UInt32 coderIndex) const
- {
- UInt32 streamIndex = 0;
- for (UInt32 i = 0; i < coderIndex; i++)
- streamIndex += Coders[i].NumInStreams;
- return streamIndex;
- }
-
- UInt32 GetCoderOutStreamIndex(UInt32 coderIndex) const
- {
- UInt32 streamIndex = 0;
- for (UInt32 i = 0; i < coderIndex; i++)
- streamIndex += Coders[i].NumOutStreams;
- return streamIndex;
- }
-
-
- void FindInStream(UInt32 streamIndex, UInt32 &coderIndex,
- UInt32 &coderStreamIndex) const
- {
- for (coderIndex = 0; coderIndex < (UInt32)Coders.Size(); coderIndex++)
- {
- UInt32 curSize = Coders[coderIndex].NumInStreams;
- if (streamIndex < curSize)
- {
- coderStreamIndex = streamIndex;
- return;
- }
- streamIndex -= curSize;
- }
- throw 1;
- }
- void FindOutStream(UInt32 streamIndex, UInt32 &coderIndex,
- UInt32 &coderStreamIndex) const
- {
- for (coderIndex = 0; coderIndex < (UInt32)Coders.Size(); coderIndex++)
- {
- UInt32 curSize = Coders[coderIndex].NumOutStreams;
- if (streamIndex < curSize)
- {
- coderStreamIndex = streamIndex;
- return;
- }
- streamIndex -= curSize;
- }
- throw 1;
- }
-};
-
-class CBindReverseConverter
-{
- UInt32 _numSrcOutStreams;
- const NCoderMixer2::CBindInfo _srcBindInfo;
- CRecordVector<UInt32> _srcInToDestOutMap;
- CRecordVector<UInt32> _srcOutToDestInMap;
- CRecordVector<UInt32> _destInToSrcOutMap;
-public:
- UInt32 NumSrcInStreams;
- CRecordVector<UInt32> DestOutToSrcInMap;
-
- CBindReverseConverter(const NCoderMixer2::CBindInfo &srcBindInfo);
- void CreateReverseBindInfo(NCoderMixer2::CBindInfo &destBindInfo);
-};
-
-struct CCoderInfo
-{
- CMyComPtr<ICompressCoder> Coder;
- CMyComPtr<ICompressCoder2> Coder2;
- UInt32 NumInStreams;
- UInt32 NumOutStreams;
-
- CRecordVector<UInt64> InSizes;
- CRecordVector<UInt64> OutSizes;
- CRecordVector<const UInt64 *> InSizePointers;
- CRecordVector<const UInt64 *> OutSizePointers;
-
- CCoderInfo(UInt32 numInStreams, UInt32 numOutStreams);
- void SetCoderInfo(const UInt64 **inSizes, const UInt64 **outSizes);
-};
-
-class CCoderMixer2
-{
-public:
- virtual void SetBindInfo(const CBindInfo &bindInfo) = 0;
- virtual void ReInit() = 0;
- virtual void SetCoderInfo(UInt32 coderIndex, const UInt64 **inSizes, const UInt64 **outSizes) = 0;
-};
-
-}
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.cpp b/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.cpp
deleted file mode 100644
index 7b3ff73835..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-// CoderMixer2MT.cpp
-
-#include "StdAfx.h"
-
-#include "CoderMixer2MT.h"
-#include "CrossThreadProgress.h"
-
-using namespace NWindows;
-using namespace NSynchronization;
-
-namespace NCoderMixer2 {
-
-CThreadCoderInfo::CThreadCoderInfo(UInt32 numInStreams, UInt32 numOutStreams):
- ExitEvent(NULL),
- CompressEvent(NULL),
- CompressionCompletedEvent(NULL),
- CCoderInfo(numInStreams, numOutStreams)
-{
- InStreams.Reserve(NumInStreams);
- InStreamPointers.Reserve(NumInStreams);
- OutStreams.Reserve(NumOutStreams);
- OutStreamPointers.Reserve(NumOutStreams);
-}
-
-void CThreadCoderInfo::CreateEvents()
-{
- CompressEvent = new CAutoResetEvent(false);
- CompressionCompletedEvent = new CAutoResetEvent(false);
-}
-
-CThreadCoderInfo::~CThreadCoderInfo()
-{
- if (CompressEvent != NULL)
- delete CompressEvent;
- if (CompressionCompletedEvent != NULL)
- delete CompressionCompletedEvent;
-}
-
-class CCoderInfoFlusher2
-{
- CThreadCoderInfo *m_CoderInfo;
-public:
- CCoderInfoFlusher2(CThreadCoderInfo *coderInfo): m_CoderInfo(coderInfo) {}
- ~CCoderInfoFlusher2()
- {
- int i;
- for (i = 0; i < m_CoderInfo->InStreams.Size(); i++)
- m_CoderInfo->InStreams[i].Release();
- for (i = 0; i < m_CoderInfo->OutStreams.Size(); i++)
- m_CoderInfo->OutStreams[i].Release();
- m_CoderInfo->CompressionCompletedEvent->Set();
- }
-};
-
-bool CThreadCoderInfo::WaitAndCode()
-{
- HANDLE events[2] = { ExitEvent, *CompressEvent };
- DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
- if (waitResult == WAIT_OBJECT_0 + 0)
- return false;
-
- {
- InStreamPointers.Clear();
- OutStreamPointers.Clear();
- UInt32 i;
- for (i = 0; i < NumInStreams; i++)
- {
- if (InSizePointers[i] != NULL)
- InSizePointers[i] = &InSizes[i];
- InStreamPointers.Add(InStreams[i]);
- }
- for (i = 0; i < NumOutStreams; i++)
- {
- if (OutSizePointers[i] != NULL)
- OutSizePointers[i] = &OutSizes[i];
- OutStreamPointers.Add(OutStreams[i]);
- }
- CCoderInfoFlusher2 coderInfoFlusher(this);
- if (Coder)
- Result = Coder->Code(InStreamPointers[0],
- OutStreamPointers[0],
- InSizePointers[0],
- OutSizePointers[0],
- Progress);
- else
- Result = Coder2->Code(&InStreamPointers.Front(),
- &InSizePointers.Front(),
- NumInStreams,
- &OutStreamPointers.Front(),
- &OutSizePointers.Front(),
- NumOutStreams,
- Progress);
- }
- return true;
-}
-
-static void SetSizes(const UInt64 **srcSizes, CRecordVector<UInt64> &sizes,
- CRecordVector<const UInt64 *> &sizePointers, UInt32 numItems)
-{
- sizes.Clear();
- sizePointers.Clear();
- for(UInt32 i = 0; i < numItems; i++)
- {
- if (srcSizes == 0 || srcSizes[i] == NULL)
- {
- sizes.Add(0);
- sizePointers.Add(NULL);
- }
- else
- {
- sizes.Add(*srcSizes[i]);
- sizePointers.Add(&sizes.Back());
- }
- }
-}
-
-
-void CThreadCoderInfo::SetCoderInfo(const UInt64 **inSizes,
- const UInt64 **outSizes, ICompressProgressInfo *progress)
-{
- Progress = progress;
- SetSizes(inSizes, InSizes, InSizePointers, NumInStreams);
- SetSizes(outSizes, OutSizes, OutSizePointers, NumOutStreams);
-}
-
-static DWORD WINAPI CoderThread(void *threadCoderInfo)
-{
- while(true)
- {
- if (!((CThreadCoderInfo *)threadCoderInfo)->WaitAndCode())
- return 0;
- }
-}
-
-//////////////////////////////////////
-// CCoderMixer2MT
-
-static DWORD WINAPI MainCoderThread(void *threadCoderInfo)
-{
- while(true)
- {
- if (!((CCoderMixer2MT *)threadCoderInfo)->MyCode())
- return 0;
- }
-}
-
-CCoderMixer2MT::CCoderMixer2MT()
-{
- if (!_mainThread.Create(MainCoderThread, this))
- throw 271825;
-}
-
-CCoderMixer2MT::~CCoderMixer2MT()
-{
- _exitEvent.Set();
- _mainThread.Wait();
- for(int i = 0; i < _threads.Size(); i++)
- {
- _threads[i].Wait();
- _threads[i].Close();
- }
-}
-
-void CCoderMixer2MT::SetBindInfo(const CBindInfo &bindInfo)
-{
- _bindInfo = bindInfo;
- _streamBinders.Clear();
- for(int i = 0; i < _bindInfo.BindPairs.Size(); i++)
- {
- _streamBinders.Add(CStreamBinder());
- _streamBinders.Back().CreateEvents();
- }
-}
-
-void CCoderMixer2MT::AddCoderCommon()
-{
- int index = _coderInfoVector.Size();
- const CCoderStreamsInfo &CoderStreamsInfo = _bindInfo.Coders[index];
-
- CThreadCoderInfo threadCoderInfo(CoderStreamsInfo.NumInStreams,
- CoderStreamsInfo.NumOutStreams);
- _coderInfoVector.Add(threadCoderInfo);
- _coderInfoVector.Back().CreateEvents();
- _coderInfoVector.Back().ExitEvent = _exitEvent;
- _compressingCompletedEvents.Add(*_coderInfoVector.Back().CompressionCompletedEvent);
-
- NWindows::CThread newThread;
- _threads.Add(newThread);
- if (!_threads.Back().Create(CoderThread, &_coderInfoVector.Back()))
- throw 271824;
-}
-
-void CCoderMixer2MT::AddCoder(ICompressCoder *coder)
-{
- AddCoderCommon();
- _coderInfoVector.Back().Coder = coder;
-}
-
-void CCoderMixer2MT::AddCoder2(ICompressCoder2 *coder)
-{
- AddCoderCommon();
- _coderInfoVector.Back().Coder2 = coder;
-}
-
-/*
-void CCoderMixer2MT::FinishAddingCoders()
-{
- for(int i = 0; i < _coderInfoVector.Size(); i++)
- {
- DWORD id;
- HANDLE newThread = ::CreateThread(NULL, 0, CoderThread,
- &_coderInfoVector[i], 0, &id);
- if (newThread == 0)
- throw 271824;
- _threads.Add(newThread);
- }
-}
-*/
-
-void CCoderMixer2MT::ReInit()
-{
- for(int i = 0; i < _streamBinders.Size(); i++)
- _streamBinders[i].ReInit();
-}
-
-
-STDMETHODIMP CCoderMixer2MT::Init(ISequentialInStream **inStreams,
- ISequentialOutStream **outStreams)
-{
- if (_coderInfoVector.Size() != _bindInfo.Coders.Size())
- throw 0;
- int i;
- for(i = 0; i < _coderInfoVector.Size(); i++)
- {
- CThreadCoderInfo &coderInfo = _coderInfoVector[i];
- const CCoderStreamsInfo &coderStreamsInfo = _bindInfo.Coders[i];
- coderInfo.InStreams.Clear();
- UInt32 j;
- for(j = 0; j < coderStreamsInfo.NumInStreams; j++)
- coderInfo.InStreams.Add(NULL);
- coderInfo.OutStreams.Clear();
- for(j = 0; j < coderStreamsInfo.NumOutStreams; j++)
- coderInfo.OutStreams.Add(NULL);
- }
-
- for(i = 0; i < _bindInfo.BindPairs.Size(); i++)
- {
- const CBindPair &bindPair = _bindInfo.BindPairs[i];
- UInt32 inCoderIndex, inCoderStreamIndex;
- UInt32 outCoderIndex, outCoderStreamIndex;
- _bindInfo.FindInStream(bindPair.InIndex, inCoderIndex, inCoderStreamIndex);
- _bindInfo.FindOutStream(bindPair.OutIndex, outCoderIndex, outCoderStreamIndex);
-
- _streamBinders[i].CreateStreams(
- &_coderInfoVector[inCoderIndex].InStreams[inCoderStreamIndex],
- &_coderInfoVector[outCoderIndex].OutStreams[outCoderStreamIndex]);
- }
-
- for(i = 0; i < _bindInfo.InStreams.Size(); i++)
- {
- UInt32 inCoderIndex, inCoderStreamIndex;
- _bindInfo.FindInStream(_bindInfo.InStreams[i], inCoderIndex, inCoderStreamIndex);
- _coderInfoVector[inCoderIndex].InStreams[inCoderStreamIndex] = inStreams[i];
- }
-
- for(i = 0; i < _bindInfo.OutStreams.Size(); i++)
- {
- UInt32 outCoderIndex, outCoderStreamIndex;
- _bindInfo.FindOutStream(_bindInfo.OutStreams[i], outCoderIndex, outCoderStreamIndex);
- _coderInfoVector[outCoderIndex].OutStreams[outCoderStreamIndex] = outStreams[i];
- }
- return S_OK;
-}
-
-
-bool CCoderMixer2MT::MyCode()
-{
- HANDLE events[2] = { _exitEvent, _startCompressingEvent };
- DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
- if (waitResult == WAIT_OBJECT_0 + 0)
- return false;
-
- for(int i = 0; i < _coderInfoVector.Size(); i++)
- _coderInfoVector[i].CompressEvent->Set();
- DWORD result = ::WaitForMultipleObjects(_compressingCompletedEvents.Size(),
- &_compressingCompletedEvents.Front(), TRUE, INFINITE);
-
- _compressingFinishedEvent.Set();
-
- return true;
-}
-
-
-STDMETHODIMP CCoderMixer2MT::Code(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress)
-{
- if (numInStreams != (UInt32)_bindInfo.InStreams.Size() ||
- numOutStreams != (UInt32)_bindInfo.OutStreams.Size())
- return E_INVALIDARG;
-
- Init(inStreams, outStreams);
-
- _compressingFinishedEvent.Reset(); // ?
-
- CCrossThreadProgress *progressSpec = new CCrossThreadProgress;
- CMyComPtr<ICompressProgressInfo> crossProgress = progressSpec;
- progressSpec->Init();
- _coderInfoVector[_progressCoderIndex].Progress = crossProgress;
-
- _startCompressingEvent.Set();
-
-
- while (true)
- {
- HANDLE events[2] = {_compressingFinishedEvent, progressSpec->ProgressEvent };
- DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
- if (waitResult == WAIT_OBJECT_0 + 0)
- break;
- if (progress != NULL)
- progressSpec->Result = progress->SetRatioInfo(progressSpec->InSize,
- progressSpec->OutSize);
- else
- progressSpec->Result = S_OK;
- progressSpec->WaitEvent.Set();
- }
-
- int i;
- for(i = 0; i < _coderInfoVector.Size(); i++)
- {
- HRESULT result = _coderInfoVector[i].Result;
- if (result == S_FALSE)
- return result;
- }
- for(i = 0; i < _coderInfoVector.Size(); i++)
- {
- HRESULT result = _coderInfoVector[i].Result;
- if (result != S_OK && result != E_FAIL)
- return result;
- }
- for(i = 0; i < _coderInfoVector.Size(); i++)
- {
- HRESULT result = _coderInfoVector[i].Result;
- if (result != S_OK)
- return result;
- }
- return S_OK;
-}
-
-UInt64 CCoderMixer2MT::GetWriteProcessedSize(UInt32 binderIndex) const
-{
- return _streamBinders[binderIndex].ProcessedSize;
-}
-
-}
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.h b/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.h
deleted file mode 100644
index 9a72219654..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/CoderMixer2MT.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// CoderMixer2MT.h
-
-#ifndef __CODER_MIXER2_MT_H
-#define __CODER_MIXER2_MT_H
-
-#include "CoderMixer2.h"
-#include "../../../Common/MyCom.h"
-#include "../../../Windows/Thread.h"
-#include "../../Common/StreamBinder.h"
-
-namespace NCoderMixer2 {
-
-// CreateEvents();
-// {
-// SetCoderInfo()
-// Init Streams
-// set CompressEvent()
-// wait CompressionCompletedEvent
-// }
-
-struct CThreadCoderInfo: public CCoderInfo
-{
- NWindows::NSynchronization::CAutoResetEvent *CompressEvent;
- HANDLE ExitEvent;
- NWindows::NSynchronization::CAutoResetEvent *CompressionCompletedEvent;
-
- CObjectVector< CMyComPtr<ISequentialInStream> > InStreams;
- CObjectVector< CMyComPtr<ISequentialOutStream> > OutStreams;
- CRecordVector<ISequentialInStream *> InStreamPointers;
- CRecordVector<ISequentialOutStream *> OutStreamPointers;
-
- CMyComPtr<ICompressProgressInfo> Progress; // CMyComPtr
- HRESULT Result;
-
- CThreadCoderInfo(UInt32 numInStreams, UInt32 numOutStreams);
- void SetCoderInfo(const UInt64 **inSizes,
- const UInt64 **outSizes, ICompressProgressInfo *progress);
- ~CThreadCoderInfo();
- bool WaitAndCode();
- void CreateEvents();
-};
-
-
-// SetBindInfo()
-// for each coder
-// {
-// AddCoder[2]()
-// }
-//
-// for each file
-// {
-// ReInit()
-// for each coder
-// {
-// SetCoderInfo
-// }
-// SetProgressIndex(UInt32 coderIndex);
-// Code
-// }
-
-
-class CCoderMixer2MT:
- public ICompressCoder2,
- public CCoderMixer2,
- public CMyUnknownImp
-{
- MY_UNKNOWN_IMP
-
-public:
- STDMETHOD(Init)(ISequentialInStream **inStreams,
- ISequentialOutStream **outStreams);
-
- STDMETHOD(Code)(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress);
-
-
- CCoderMixer2MT();
- ~CCoderMixer2MT();
- void AddCoderCommon();
- void AddCoder(ICompressCoder *coder);
- void AddCoder2(ICompressCoder2 *coder);
-
- void ReInit();
- void SetCoderInfo(UInt32 coderIndex, const UInt64 **inSizes, const UInt64 **outSizes)
- { _coderInfoVector[coderIndex].SetCoderInfo(inSizes, outSizes, NULL); }
- void SetProgressCoderIndex(UInt32 coderIndex)
- { _progressCoderIndex = coderIndex; }
-
-
- UInt64 GetWriteProcessedSize(UInt32 binderIndex) const;
-
-
- bool MyCode();
-
-private:
- CBindInfo _bindInfo;
- CObjectVector<CStreamBinder> _streamBinders;
- CObjectVector<CThreadCoderInfo> _coderInfoVector;
- CRecordVector<NWindows::CThread> _threads;
- NWindows::CThread _mainThread;
-
- NWindows::NSynchronization::CAutoResetEvent _startCompressingEvent;
- CRecordVector<HANDLE> _compressingCompletedEvents;
- NWindows::NSynchronization::CAutoResetEvent _compressingFinishedEvent;
-
- NWindows::NSynchronization::CManualResetEvent _exitEvent;
- UInt32 _progressCoderIndex;
-
-public:
- void SetBindInfo(const CBindInfo &bindInfo);
-
-};
-
-}
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.cpp b/other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.cpp
deleted file mode 100644
index 62d05afdd7..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.cpp
+++ /dev/null
@@ -1,15 +0,0 @@
-// CrossThreadProgress.cpp
-
-#include "StdAfx.h"
-
-#include "CrossThreadProgress.h"
-
-STDMETHODIMP CCrossThreadProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
-{
- InSize = inSize;
- OutSize = outSize;
- ProgressEvent.Set();
- WaitEvent.Lock();
- return Result;
-}
-
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.h b/other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.h
deleted file mode 100644
index 0504b93064..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/CrossThreadProgress.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// CrossThreadProgress.h
-
-#ifndef __CROSSTHREADPROGRESS_H
-#define __CROSSTHREADPROGRESS_H
-
-#include "../../ICoder.h"
-#include "../../../Windows/Synchronization.h"
-#include "../../../Common/MyCom.h"
-
-class CCrossThreadProgress:
- public ICompressProgressInfo,
- public CMyUnknownImp
-{
-public:
- const UInt64 *InSize;
- const UInt64 *OutSize;
- HRESULT Result;
- NWindows::NSynchronization::CAutoResetEvent ProgressEvent;
- NWindows::NSynchronization::CAutoResetEvent WaitEvent;
- void Init()
- {
- ProgressEvent.Reset();
- WaitEvent.Reset();
- }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.cpp b/other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.cpp
deleted file mode 100644
index fa8aba2e4b..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-// FilterCoder.cpp
-
-#include "StdAfx.h"
-
-#include "FilterCoder.h"
-#include "../../../Common/Alloc.h"
-#include "../../../Common/Defs.h"
-#include "../../Common/StreamUtils.h"
-
-static const int kBufferSize = 1 << 17;
-
-CFilterCoder::CFilterCoder()
-{
- _buffer = (Byte *)::MidAlloc(kBufferSize);
-}
-
-CFilterCoder::~CFilterCoder()
-{
- ::MidFree(_buffer);
-}
-
-HRESULT CFilterCoder::WriteWithLimit(ISequentialOutStream *outStream, UInt32 size)
-{
- if (_outSizeIsDefined)
- {
- UInt64 remSize = _outSize - _nowPos64;
- if (size > remSize)
- size = (UInt32)remSize;
- }
- UInt32 processedSize = 0;
- RINOK(WriteStream(outStream, _buffer, size, &processedSize));
- if (size != processedSize)
- return E_FAIL;
- _nowPos64 += processedSize;
- return S_OK;
-}
-
-
-STDMETHODIMP CFilterCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
-{
- RINOK(Init());
- UInt32 bufferPos = 0;
- if (_outSizeIsDefined = (outSize != 0))
- _outSize = *outSize;
-
- while(NeedMore())
- {
- UInt32 processedSize;
-
- // Change it: It can be optimized using ReadPart
- RINOK(ReadStream(inStream, _buffer + bufferPos, kBufferSize - bufferPos, &processedSize));
-
- UInt32 endPos = bufferPos + processedSize;
-
- bufferPos = Filter->Filter(_buffer, endPos);
- if (bufferPos > endPos)
- {
- for (; endPos< bufferPos; endPos++)
- _buffer[endPos] = 0;
- bufferPos = Filter->Filter(_buffer, endPos);
- }
-
- if (bufferPos == 0)
- {
- if (endPos > 0)
- return WriteWithLimit(outStream, endPos);
- return S_OK;
- }
- RINOK(WriteWithLimit(outStream, bufferPos));
- if (progress != NULL)
- {
- RINOK(progress->SetRatioInfo(&_nowPos64, &_nowPos64));
- }
- UInt32 i = 0;
- while(bufferPos < endPos)
- _buffer[i++] = _buffer[bufferPos++];
- bufferPos = i;
- }
- return S_OK;
-}
-
-// #ifdef _ST_MODE
-STDMETHODIMP CFilterCoder::SetOutStream(ISequentialOutStream *outStream)
-{
- _bufferPos = 0;
- _outStream = outStream;
- return Init();
-}
-
-STDMETHODIMP CFilterCoder::ReleaseOutStream()
-{
- _outStream.Release();
- return S_OK;
-};
-
-
-STDMETHODIMP CFilterCoder::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 processedSizeTotal = 0;
- while(size > 0)
- {
- UInt32 sizeMax = kBufferSize - _bufferPos;
- UInt32 sizeTemp = size;
- if (sizeTemp > sizeMax)
- sizeTemp = sizeMax;
- memmove(_buffer + _bufferPos, data, sizeTemp);
- size -= sizeTemp;
- processedSizeTotal += sizeTemp;
- data = (const Byte *)data + sizeTemp;
- UInt32 endPos = _bufferPos + sizeTemp;
- _bufferPos = Filter->Filter(_buffer, endPos);
- if (_bufferPos == 0)
- {
- _bufferPos = endPos;
- break;
- }
- if (_bufferPos > endPos)
- {
- if (size != 0)
- return E_FAIL;
- break;
- }
- RINOK(WriteWithLimit(_outStream, _bufferPos));
- UInt32 i = 0;
- while(_bufferPos < endPos)
- _buffer[i++] = _buffer[_bufferPos++];
- _bufferPos = i;
- }
- if (processedSize != NULL)
- *processedSize = processedSizeTotal;
- return S_OK;
-}
-
-STDMETHODIMP CFilterCoder::Flush()
-{
- if (_bufferPos != 0)
- {
- UInt32 endPos = Filter->Filter(_buffer, _bufferPos);
- if (endPos > _bufferPos)
- {
- for (; _bufferPos < endPos; _bufferPos++)
- _buffer[_bufferPos] = 0;
- if (Filter->Filter(_buffer, endPos) != endPos)
- return E_FAIL;
- }
- UInt32 processedSize;
- RINOK(WriteStream(_outStream, _buffer, _bufferPos, &processedSize));
- if (_bufferPos != processedSize)
- return E_FAIL;
- _bufferPos = 0;
- }
- CMyComPtr<IOutStreamFlush> flush;
- _outStream.QueryInterface(IID_IOutStreamFlush, &flush);
- if (flush)
- return flush->Flush();
- return S_OK;
-}
-
-
-STDMETHODIMP CFilterCoder::SetInStream(ISequentialInStream *inStream)
-{
- _convertedPosBegin = _convertedPosEnd = _bufferPos = 0;
- _inStream = inStream;
- return Init();
-}
-
-STDMETHODIMP CFilterCoder::ReleaseInStream()
-{
- _inStream.Release();
- return S_OK;
-};
-
-STDMETHODIMP CFilterCoder::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 processedSizeTotal = 0;
- while(size > 0)
- {
- if (_convertedPosBegin != _convertedPosEnd)
- {
- UInt32 sizeTemp = MyMin(size, _convertedPosEnd - _convertedPosBegin);
- memmove(data, _buffer + _convertedPosBegin, sizeTemp);
- _convertedPosBegin += sizeTemp;
- data = (void *)((Byte *)data + sizeTemp);
- size -= sizeTemp;
- processedSizeTotal += sizeTemp;
- break;
- }
- int i;
- for (i = 0; _convertedPosEnd + i < _bufferPos; i++)
- _buffer[i] = _buffer[i + _convertedPosEnd];
- _bufferPos = i;
- _convertedPosBegin = _convertedPosEnd = 0;
- UInt32 processedSizeTemp;
- UInt32 size0 = kBufferSize - _bufferPos;
- // Optimize it:
- RINOK(ReadStream(_inStream, _buffer + _bufferPos, size0, &processedSizeTemp));
- _bufferPos = _bufferPos + processedSizeTemp;
- _convertedPosEnd = Filter->Filter(_buffer, _bufferPos);
- if (_convertedPosEnd == 0)
- {
- if (_bufferPos == 0)
- break;
- else
- {
- _convertedPosEnd = _bufferPos; // check it
- continue;
- }
- }
- if (_convertedPosEnd > _bufferPos)
- {
- for (; _bufferPos < _convertedPosEnd; _bufferPos++)
- _buffer[_bufferPos] = 0;
- _convertedPosEnd = Filter->Filter(_buffer, _bufferPos);
- }
- }
- if (processedSize != NULL)
- *processedSize = processedSizeTotal;
- return S_OK;
-}
-
-// #endif // _ST_MODE
-
-#ifndef _NO_CRYPTO
-STDMETHODIMP CFilterCoder::CryptoSetPassword(const Byte *data, UInt32 size)
-{
- return _setPassword->CryptoSetPassword(data, size);
-}
-#endif
-
-#ifndef EXTRACT_ONLY
-STDMETHODIMP CFilterCoder::WriteCoderProperties(ISequentialOutStream *outStream)
-{
- return _writeCoderProperties->WriteCoderProperties(outStream);
-}
-#endif
-
-STDMETHODIMP CFilterCoder::SetDecoderProperties2(const Byte *data, UInt32 size)
-{
- return _setDecoderProperties->SetDecoderProperties2(data, size);
-}
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.h b/other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.h
deleted file mode 100644
index cf0033ab6e..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/FilterCoder.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// FilterCoder.h
-
-#ifndef __FILTERCODER_H
-#define __FILTERCODER_H
-
-#include "../../../Common/MyCom.h"
-#include "../../ICoder.h"
-#include "../../IPassword.h"
-
-#define MY_QUERYINTERFACE_ENTRY_AG(i, sub0, sub) if (iid == IID_ ## i) \
-{ if (!sub) RINOK(sub0->QueryInterface(IID_ ## i, (void **)&sub)) \
-*outObject = (void *)(i *)this; AddRef(); return S_OK; }
-
-class CFilterCoder:
- public ICompressCoder,
- // #ifdef _ST_MODE
- public ICompressSetInStream,
- public ISequentialInStream,
- public ICompressSetOutStream,
- public ISequentialOutStream,
- public IOutStreamFlush,
- // #endif
-
- #ifndef _NO_CRYPTO
- public ICryptoSetPassword,
- #endif
- #ifndef EXTRACT_ONLY
- public ICompressWriteCoderProperties,
- #endif
- public ICompressSetDecoderProperties2,
- public CMyUnknownImp
-{
-protected:
- Byte *_buffer;
- // #ifdef _ST_MODE
- CMyComPtr<ISequentialInStream> _inStream;
- CMyComPtr<ISequentialOutStream> _outStream;
- UInt32 _bufferPos;
- UInt32 _convertedPosBegin;
- UInt32 _convertedPosEnd;
- // #endif
- bool _outSizeIsDefined;
- UInt64 _outSize;
- UInt64 _nowPos64;
-
- HRESULT Init()
- {
- _nowPos64 = 0;
- _outSizeIsDefined = false;
- return Filter->Init();
- }
-
- CMyComPtr<ICryptoSetPassword> _setPassword;
- #ifndef EXTRACT_ONLY
- CMyComPtr<ICompressWriteCoderProperties> _writeCoderProperties;
- #endif
- CMyComPtr<ICompressSetDecoderProperties2> _setDecoderProperties;
-public:
- CMyComPtr<ICompressFilter> Filter;
-
- CFilterCoder();
- ~CFilterCoder();
- HRESULT WriteWithLimit(ISequentialOutStream *outStream, UInt32 size);
- bool NeedMore() const
- { return (!_outSizeIsDefined || (_nowPos64 < _outSize)); }
-
-public:
- MY_QUERYINTERFACE_BEGIN
- MY_QUERYINTERFACE_ENTRY(ICompressCoder)
- // #ifdef _ST_MODE
- MY_QUERYINTERFACE_ENTRY(ICompressSetInStream)
- MY_QUERYINTERFACE_ENTRY(ISequentialInStream)
-
- MY_QUERYINTERFACE_ENTRY(ICompressSetOutStream)
- MY_QUERYINTERFACE_ENTRY(ISequentialOutStream)
- MY_QUERYINTERFACE_ENTRY(IOutStreamFlush)
- // #endif
-
- #ifndef _NO_CRYPTO
- MY_QUERYINTERFACE_ENTRY_AG(ICryptoSetPassword, Filter, _setPassword)
- #endif
-
- #ifndef EXTRACT_ONLY
- MY_QUERYINTERFACE_ENTRY_AG(ICompressWriteCoderProperties, Filter, _writeCoderProperties)
- #endif
-
- MY_QUERYINTERFACE_ENTRY_AG(ICompressSetDecoderProperties2, Filter, _setDecoderProperties)
- MY_QUERYINTERFACE_END
- MY_ADDREF_RELEASE
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
- // #ifdef _ST_MODE
- STDMETHOD(ReleaseInStream)();
- STDMETHOD(SetInStream)(ISequentialInStream *inStream);
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize); \
- STDMETHOD(SetOutStream)(ISequentialOutStream *outStream);
- STDMETHOD(ReleaseOutStream)();
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
- STDMETHOD(Flush)();
- // #endif
-
- #ifndef _NO_CRYPTO
- STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
- #endif
- #ifndef EXTRACT_ONLY
- STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
- #endif
- STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
-};
-
-// #ifdef _ST_MODE
-class CInStreamReleaser
-{
-public:
- CFilterCoder *FilterCoder;
- CInStreamReleaser(): FilterCoder(0) {}
- ~CInStreamReleaser() { if (FilterCoder) FilterCoder->ReleaseInStream(); }
-};
-
-class COutStreamReleaser
-{
-public:
- CFilterCoder *FilterCoder;
- COutStreamReleaser(): FilterCoder(0) {}
- ~COutStreamReleaser() { if (FilterCoder) FilterCoder->ReleaseOutStream(); }
-};
-// #endif
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.cpp b/other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.cpp
deleted file mode 100644
index 46f2cee3e1..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// Archive/Common/ItemNameUtils.cpp
-
-#include "StdAfx.h"
-
-#include "ItemNameUtils.h"
-
-namespace NArchive {
-namespace NItemName {
-
-static const wchar_t kOSDirDelimiter = WCHAR_PATH_SEPARATOR;
-static const wchar_t kDirDelimiter = L'/';
-
-UString MakeLegalName(const UString &name)
-{
- UString zipName = name;
- zipName.Replace(kOSDirDelimiter, kDirDelimiter);
- return zipName;
-}
-
-UString GetOSName(const UString &name)
-{
- UString newName = name;
- newName.Replace(kDirDelimiter, kOSDirDelimiter);
- return newName;
-}
-
-UString GetOSName2(const UString &name)
-{
- if (name.IsEmpty())
- return UString();
- UString newName = GetOSName(name);
- if (newName[newName.Length() - 1] == kOSDirDelimiter)
- newName.Delete(newName.Length() - 1);
- return newName;
-}
-
-bool HasTailSlash(const AString &name, UINT codePage)
-{
- if (name.IsEmpty())
- return false;
- LPCSTR prev =
- #ifdef _WIN32
- CharPrevExA(codePage, name, &name[name.Length()], 0);
- #else
- (LPCSTR)(name) + (name.Length() - 1);
- #endif
- return (*prev == '/');
-}
-
-#ifndef _WIN32
-UString WinNameToOSName(const UString &name)
-{
- UString newName = name;
- newName.Replace(L'\\', kOSDirDelimiter);
- return newName;
-}
-#endif
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.h b/other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.h
deleted file mode 100644
index 51e5d93f03..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/ItemNameUtils.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// Archive/Common/ItemNameUtils.h
-
-#ifndef __ARCHIVE_ITEMNAMEUTILS_H
-#define __ARCHIVE_ITEMNAMEUTILS_H
-
-#include "../../../Common/String.h"
-
-namespace NArchive {
-namespace NItemName {
-
- UString MakeLegalName(const UString &name);
- UString GetOSName(const UString &name);
- UString GetOSName2(const UString &name);
- bool HasTailSlash(const AString &name, UINT codePage);
-
- #ifdef _WIN32
- inline UString WinNameToOSName(const UString &name) { return name; }
- #else
- UString WinNameToOSName(const UString &name);
- #endif
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.cpp b/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.cpp
deleted file mode 100644
index 6199562ee1..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// OutStreamWithCRC.cpp
-
-#include "StdAfx.h"
-
-#include "OutStreamWithCRC.h"
-
-STDMETHODIMP COutStreamWithCRC::Write(const void *data,
- UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize;
- HRESULT result;
- if(!_stream)
- {
- realProcessedSize = size;
- result = S_OK;
- }
- else
- result = _stream->Write(data, size, &realProcessedSize);
- _crc.Update(data, realProcessedSize);
- if(processedSize != NULL)
- *processedSize = realProcessedSize;
- return result;
-}
diff --git a/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.h b/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.h
deleted file mode 100644
index 11c5c579bf..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/Common/OutStreamWithCRC.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// OutStreamWithCRC.h
-
-#ifndef __OUTSTREAMWITHCRC_H
-#define __OUTSTREAMWITHCRC_H
-
-#include "../../../Common/CRC.h"
-#include "../../../Common/MyCom.h"
-#include "../../IStream.h"
-
-class COutStreamWithCRC:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-private:
- CCRC _crc;
- CMyComPtr<ISequentialOutStream> _stream;
-public:
- void Init(ISequentialOutStream *stream)
- {
- _stream = stream;
- _crc.Init();
- }
- void ReleaseStream() { _stream.Release(); }
- UInt32 GetCRC() const { return _crc.GetDigest(); }
- void InitCRC() { _crc.Init(); }
-
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Archive/IArchive.h b/other-licenses/7zstub/src/7zip/Archive/IArchive.h
deleted file mode 100644
index 12f9a3c4af..0000000000
--- a/other-licenses/7zstub/src/7zip/Archive/IArchive.h
+++ /dev/null
@@ -1,173 +0,0 @@
-// IArchive.h
-
-#ifndef __IARCHIVE_H
-#define __IARCHIVE_H
-
-#include "../IStream.h"
-#include "../IProgress.h"
-#include "../PropID.h"
-
-// MIDL_INTERFACE("23170F69-40C1-278A-0000-000600xx0000")
-#define ARCHIVE_INTERFACE_SUB(i, base, x) \
-DEFINE_GUID(IID_ ## i, \
-0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x06, 0x00, x, 0x00, 0x00); \
-struct i: public base
-
-#define ARCHIVE_INTERFACE(i, x) ARCHIVE_INTERFACE_SUB(i, IUnknown, x)
-
-namespace NFileTimeType
-{
- enum EEnum
- {
- kWindows,
- kUnix,
- kDOS
- };
-}
-
-namespace NArchive
-{
- enum
- {
- kName = 0,
- kClassID,
- kExtension,
- kAddExtension,
- kUpdate,
- kKeepName,
- kStartSignature,
- kFinishSignature,
- kAssociate
- };
-
- namespace NExtract
- {
- namespace NAskMode
- {
- enum
- {
- kExtract = 0,
- kTest,
- kSkip,
- };
- }
- namespace NOperationResult
- {
- enum
- {
- kOK = 0,
- kUnSupportedMethod,
- kDataError,
- kCRCError,
- };
- }
- }
- namespace NUpdate
- {
- namespace NOperationResult
- {
- enum
- {
- kOK = 0,
- kError,
- };
- }
- }
-}
-
-ARCHIVE_INTERFACE(IArchiveOpenCallback, 0x10)
-{
- STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) PURE;
- STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) PURE;
-};
-
-
-ARCHIVE_INTERFACE_SUB(IArchiveExtractCallback, IProgress, 0x20)
-{
- STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream,
- Int32 askExtractMode) PURE;
- // GetStream OUT: S_OK - OK, S_FALSE - skeep this file
- STDMETHOD(PrepareOperation)(Int32 askExtractMode) PURE;
- STDMETHOD(SetOperationResult)(Int32 resultEOperationResult) PURE;
-};
-
-
-ARCHIVE_INTERFACE(IArchiveOpenVolumeCallback, 0x30)
-{
- STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) PURE;
- STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) PURE;
-};
-
-
-ARCHIVE_INTERFACE(IInArchiveGetStream, 0x40)
-{
- STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE;
-};
-
-
-ARCHIVE_INTERFACE(IArchiveOpenSetSubArchiveName, 0x50)
-{
- STDMETHOD(SetSubArchiveName)(const wchar_t *name) PURE;
-};
-
-
-ARCHIVE_INTERFACE(IInArchive, 0x60)
-{
- STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition,
- IArchiveOpenCallback *openArchiveCallback) PURE;
- STDMETHOD(Close)() PURE;
- STDMETHOD(GetNumberOfItems)(UInt32 *numItems) PURE;
- STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
- STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems,
- Int32 testMode, IArchiveExtractCallback *extractCallback) PURE;
- // indices must be sorted
- // numItems = 0xFFFFFFFF means all files
- // testMode != 0 means "test files operation"
-
- STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) PURE;
-
- STDMETHOD(GetNumberOfProperties)(UInt32 *numProperties) PURE;
- STDMETHOD(GetPropertyInfo)(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType) PURE;
-
- STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProperties) PURE;
- STDMETHOD(GetArchivePropertyInfo)(UInt32 index,
- BSTR *name, PROPID *propID, VARTYPE *varType) PURE;
-};
-
-
-ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback, IProgress, 0x80)
-{
- STDMETHOD(GetUpdateItemInfo)(UInt32 index,
- Int32 *newData, // 1 - new data, 0 - old data
- Int32 *newProperties, // 1 - new properties, 0 - old properties
- UInt32 *indexInArchive // -1 if there is no in archive, or if doesn't matter
- ) PURE;
- STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
- STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) PURE;
- STDMETHOD(SetOperationResult)(Int32 operationResult) PURE;
-};
-
-
-ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback2, IArchiveUpdateCallback, 0x82)
-{
- STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) PURE;
- STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) PURE;
-};
-
-
-ARCHIVE_INTERFACE(IOutArchive, 0xA0)
-{
- STDMETHOD(UpdateItems)(ISequentialOutStream *outStream, UInt32 numItems,
- IArchiveUpdateCallback *updateCallback) PURE;
- STDMETHOD(GetFileTimeType)(UInt32 *type) PURE;
-};
-
-
-ARCHIVE_INTERFACE(ISetProperties, 0x03)
-{
- STDMETHOD(SetProperties)(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties) PURE;
-};
-
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.cpp b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.cpp
deleted file mode 100644
index 8a06ec1384..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.cpp
+++ /dev/null
@@ -1,249 +0,0 @@
-// ExtractCallback.h
-
-#include "StdAfx.h"
-
-#include "ExtractCallback.h"
-
-#include "Common/Wildcard.h"
-#include "Common/StringConvert.h"
-
-#include "Windows/COM.h"
-#include "Windows/FileDir.h"
-#include "Windows/FileFind.h"
-#include "Windows/Time.h"
-#include "Windows/Defs.h"
-#include "Windows/PropVariant.h"
-
-#include "Windows/PropVariantConversions.h"
-
-using namespace NWindows;
-using namespace NFile;
-
-static LPCWSTR kErrorTitle = L"7-Zip";
-static LPCWSTR kCantDeleteFile = L"Can not delete output file";
-static LPCWSTR kCantOpenFile = L"Can not open output file";
-static LPCWSTR kUnsupportedMethod = L"Unsupported Method";
-// static LPCWSTR kCRCFailed = L"CRC Failed";
-// static LPCWSTR kDataError = L"Data Error";
-// static LPCWSTR kUnknownError = L""Unknown Error";
-
-void CExtractCallbackImp::Init(IInArchive *archiveHandler,
- const UString &directoryPath,
- const UString &itemDefaultName,
- const FILETIME &utcLastWriteTimeDefault,
- UInt32 attributesDefault)
-{
- _message.Empty();
- _isCorrupt = false;
- _itemDefaultName = itemDefaultName;
- _utcLastWriteTimeDefault = utcLastWriteTimeDefault;
- _attributesDefault = attributesDefault;
- _archiveHandler = archiveHandler;
- _directoryPath = directoryPath;
- NName::NormalizeDirPathPrefix(_directoryPath);
-}
-
-STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 size)
-{
- #ifndef _NO_PROGRESS
- ProgressDialog.ProgressSynch.SetProgress(size, 0);
- #endif
- return S_OK;
-}
-
-STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *completeValue)
-{
- #ifndef _NO_PROGRESS
- while(true)
- {
- if(ProgressDialog.ProgressSynch.GetStopped())
- return E_ABORT;
- if(!ProgressDialog.ProgressSynch.GetPaused())
- break;
- ::Sleep(100);
- }
- if (completeValue != NULL)
- ProgressDialog.ProgressSynch.SetPos(*completeValue);
- #endif
- return S_OK;
-}
-
-void CExtractCallbackImp::CreateComplexDirectory(const UStringVector &dirPathParts)
-{
- UString fullPath = _directoryPath;
- for(int i = 0; i < dirPathParts.Size(); i++)
- {
- fullPath += dirPathParts[i];
- NDirectory::MyCreateDirectory(fullPath);
- fullPath += NName::kDirDelimiter;
- }
-}
-
-STDMETHODIMP CExtractCallbackImp::GetStream(UInt32 index,
- ISequentialOutStream **outStream, Int32 askExtractMode)
-{
- #ifndef _NO_PROGRESS
- if(ProgressDialog.ProgressSynch.GetStopped())
- return E_ABORT;
- #endif
- _outFileStream.Release();
- NCOM::CPropVariant propVariantName;
- RINOK(_archiveHandler->GetProperty(index, kpidPath, &propVariantName));
- UString fullPath;
- if(propVariantName.vt == VT_EMPTY)
- fullPath = _itemDefaultName;
- else
- {
- if(propVariantName.vt != VT_BSTR)
- return E_FAIL;
- fullPath = propVariantName.bstrVal;
- }
- _filePath = fullPath;
-
- // m_CurrentFilePath = GetSystemString(fullPath, _codePage);
-
- if(askExtractMode == NArchive::NExtract::NAskMode::kExtract)
- {
- NCOM::CPropVariant propVariant;
- RINOK(_archiveHandler->GetProperty(index, kpidAttributes, &propVariant));
- if (propVariant.vt == VT_EMPTY)
- _processedFileInfo.Attributes = _attributesDefault;
- else
- {
- if (propVariant.vt != VT_UI4)
- return E_FAIL;
- _processedFileInfo.Attributes = propVariant.ulVal;
- }
-
- RINOK(_archiveHandler->GetProperty(index, kpidIsFolder, &propVariant));
- _processedFileInfo.IsDirectory = VARIANT_BOOLToBool(propVariant.boolVal);
-
- bool isAnti = false;
- {
- NCOM::CPropVariant propVariantTemp;
- RINOK(_archiveHandler->GetProperty(index, kpidIsAnti,
- &propVariantTemp));
- if (propVariantTemp.vt == VT_BOOL)
- isAnti = VARIANT_BOOLToBool(propVariantTemp.boolVal);
- }
-
- RINOK(_archiveHandler->GetProperty(index, kpidLastWriteTime, &propVariant));
- switch(propVariant.vt)
- {
- case VT_EMPTY:
- _processedFileInfo.UTCLastWriteTime = _utcLastWriteTimeDefault;
- break;
- case VT_FILETIME:
- _processedFileInfo.UTCLastWriteTime = propVariant.filetime;
- break;
- default:
- return E_FAIL;
- }
-
- UStringVector pathParts;
- SplitPathToParts(fullPath, pathParts);
- if(pathParts.IsEmpty())
- return E_FAIL;
-
- UString processedPath = fullPath;
-
- if(!_processedFileInfo.IsDirectory)
- pathParts.DeleteBack();
- if (!pathParts.IsEmpty())
- {
- if (!isAnti)
- CreateComplexDirectory(pathParts);
- }
-
- UString fullProcessedPath = _directoryPath + processedPath;
-
- if(_processedFileInfo.IsDirectory)
- {
- _diskFilePath = fullProcessedPath;
-
- if (isAnti)
- NDirectory::MyRemoveDirectory(_diskFilePath);
- return S_OK;
- }
-
- NFind::CFileInfoW fileInfo;
- if(NFind::FindFile(fullProcessedPath, fileInfo))
- {
- if (!NDirectory::DeleteFileAlways(fullProcessedPath))
- {
- _message = kCantDeleteFile;
- return E_FAIL;
- }
- }
-
- if (!isAnti)
- {
- _outFileStreamSpec = new COutFileStream;
- CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec);
- if (!_outFileStreamSpec->Create(fullProcessedPath, true))
- {
- _message = kCantOpenFile;
- return E_FAIL;
- }
- _outFileStream = outStreamLoc;
- *outStream = outStreamLoc.Detach();
- }
- _diskFilePath = fullProcessedPath;
- }
- else
- {
- *outStream = NULL;
- }
- return S_OK;
-}
-
-STDMETHODIMP CExtractCallbackImp::PrepareOperation(Int32 askExtractMode)
-{
- _extractMode = false;
- switch (askExtractMode)
- {
- case NArchive::NExtract::NAskMode::kExtract:
- _extractMode = true;
- break;
- }
- return S_OK;
-}
-
-STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 resultEOperationResult)
-{
- switch(resultEOperationResult)
- {
- case NArchive::NExtract::NOperationResult::kOK:
- {
- break;
- }
- default:
- {
- _outFileStream.Release();
- switch(resultEOperationResult)
- {
- case NArchive::NExtract::NOperationResult::kUnSupportedMethod:
- _message = kUnsupportedMethod;
- break;
- case NArchive::NExtract::NOperationResult::kCRCError:
- _isCorrupt = true;
- // _message = kCRCFailed;
- break;
- case NArchive::NExtract::NOperationResult::kDataError:
- _isCorrupt = true;
- // _message = kDataError;
- break;
- default:
- _isCorrupt = true;
- }
- return E_FAIL;
- }
- }
- if(_outFileStream != NULL)
- _outFileStreamSpec->File.SetLastWriteTime(&_processedFileInfo.UTCLastWriteTime);
- _outFileStream.Release();
- if (_extractMode)
- NDirectory::MySetFileAttributes(_diskFilePath, _processedFileInfo.Attributes);
- return S_OK;
-}
-
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.h b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.h
deleted file mode 100644
index d77ffd74e5..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractCallback.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// ExtractCallback.h
-
-#ifndef __EXTRACTCALLBACK_H
-#define __EXTRACTCALLBACK_H
-
-#include "resource.h"
-
-#include "Common/String.h"
-#include "Windows/ResourceString.h"
-
-#include "../../Archive/IArchive.h"
-
-#include "../../Common/FileStreams.h"
-#include "../../ICoder.h"
-
-#ifndef _NO_PROGRESS
-#include "../../FileManager/Resource/ProgressDialog/ProgressDialog.h"
-#endif
-
-class CExtractCallbackImp:
- public IArchiveExtractCallback,
- public CMyUnknownImp
-{
-public:
-
- MY_UNKNOWN_IMP
-
- // IProgress
- STDMETHOD(SetTotal)(UInt64 size);
- STDMETHOD(SetCompleted)(const UInt64 *completeValue);
-
- // IExtractCallback
- STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream,
- Int32 askExtractMode);
- STDMETHOD(PrepareOperation)(Int32 askExtractMode);
- STDMETHOD(SetOperationResult)(Int32 resultEOperationResult);
-
-private:
- CMyComPtr<IInArchive> _archiveHandler;
- UString _directoryPath;
-
- UString _filePath;
-
- UString _diskFilePath;
-
- bool _extractMode;
- struct CProcessedFileInfo
- {
- FILETIME UTCLastWriteTime;
- bool IsDirectory;
- UInt32 Attributes;
- } _processedFileInfo;
-
- COutFileStream *_outFileStreamSpec;
- CMyComPtr<ISequentialOutStream> _outFileStream;
-
- UString _itemDefaultName;
- FILETIME _utcLastWriteTimeDefault;
- UInt32 _attributesDefault;
-
- void CreateComplexDirectory(const UStringVector &dirPathParts);
-public:
- #ifndef _NO_PROGRESS
- CProgressDialog ProgressDialog;
- #endif
-
- bool _isCorrupt;
- UString _message;
-
- void Init(IInArchive *archiveHandler,
- const UString &directoryPath,
- const UString &itemDefaultName,
- const FILETIME &utcLastWriteTimeDefault,
- UInt32 attributesDefault);
-
- #ifndef _NO_PROGRESS
- HRESULT StartProgressDialog(const UString &title)
- {
- ProgressDialog.Create(title, 0);
- {
- #ifdef LANG
- ProgressDialog.SetText(LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890));
- #else
- ProgressDialog.SetText(NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING));
- #endif
- }
-
- ProgressDialog.Show(SW_SHOWNORMAL);
- return S_OK;
- }
- virtual ~CExtractCallbackImp() { ProgressDialog.Destroy(); }
- #endif
-
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.cpp b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.cpp
deleted file mode 100644
index 855f7aea91..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-// ExtractEngine.cpp
-
-#include "StdAfx.h"
-
-#include "ExtractEngine.h"
-
-#include "Common/StringConvert.h"
-
-#include "Windows/FileDir.h"
-#include "Windows/FileFind.h"
-#include "Windows/Thread.h"
-
-#include "../../UI/Common/OpenArchive.h"
-
-#include "../../UI/Explorer/MyMessages.h"
-#include "../../FileManager/FormatUtils.h"
-
-#include "ExtractCallback.h"
-
-using namespace NWindows;
-
-struct CThreadExtracting
-{
- CArchiveLink ArchiveLink;
-
- CExtractCallbackImp *ExtractCallbackSpec;
- CMyComPtr<IArchiveExtractCallback> ExtractCallback;
-
- #ifndef _NO_PROGRESS
- HRESULT Result;
-
- HRESULT Extract()
- {
- return ArchiveLink.GetArchive()->Extract(0, (UInt32)-1 , BoolToInt(false), ExtractCallback);
- }
- DWORD Process()
- {
- ExtractCallbackSpec->ProgressDialog.WaitCreating();
- Result = Extract();
- ExtractCallbackSpec->ProgressDialog.MyClose();
- return 0;
- }
- static DWORD WINAPI MyThreadFunction(void *param)
- {
- return ((CThreadExtracting *)param)->Process();
- }
- #endif
-};
-
-static const LPCWSTR kCantFindArchive = L"Can not find archive file";
-static const LPCWSTR kCantOpenArchive = L"File is not correct archive";
-
-HRESULT ExtractArchive(
- const UString &fileName,
- const UString &folderName,
- COpenCallbackGUI *openCallback,
- bool showProgress,
- bool &isCorrupt,
- UString &errorMessage)
-{
- isCorrupt = false;
- NFile::NFind::CFileInfoW archiveFileInfo;
- if (!NFile::NFind::FindFile(fileName, archiveFileInfo))
- {
- errorMessage = kCantFindArchive;
- return E_FAIL;
- }
-
- CThreadExtracting extracter;
-
- HRESULT result = MyOpenArchive(fileName, extracter.ArchiveLink, openCallback);
-
- if (result != S_OK)
- {
- errorMessage = kCantOpenArchive;
- return result;
- }
-
- UString directoryPath = folderName;
- NFile::NName::NormalizeDirPathPrefix(directoryPath);
-
- /*
- UString directoryPath;
- {
- UString fullPath;
- int fileNamePartStartIndex;
- if (!NWindows::NFile::NDirectory::MyGetFullPathName(fileName, fullPath, fileNamePartStartIndex))
- {
- MessageBox(NULL, "Error 1329484", "7-Zip", 0);
- return E_FAIL;
- }
- directoryPath = fullPath.Left(fileNamePartStartIndex);
- }
- */
-
- if(!NFile::NDirectory::CreateComplexDirectory(directoryPath))
- {
- errorMessage = MyFormatNew(IDS_CANNOT_CREATE_FOLDER,
- #ifdef LANG
- 0x02000603,
- #endif
- directoryPath);
- return E_FAIL;
- }
-
- extracter.ExtractCallbackSpec = new CExtractCallbackImp;
- extracter.ExtractCallback = extracter.ExtractCallbackSpec;
-
- extracter.ExtractCallbackSpec->Init(
- extracter.ArchiveLink.GetArchive(),
- directoryPath, L"Default", archiveFileInfo.LastWriteTime, 0);
-
- #ifndef _NO_PROGRESS
-
- if (showProgress)
- {
- CThread thread;
- if (!thread.Create(CThreadExtracting::MyThreadFunction, &extracter))
- throw 271824;
-
- UString title;
- #ifdef LANG
- title = LangLoadString(IDS_PROGRESS_EXTRACTING, 0x02000890);
- #else
- title = NWindows::MyLoadStringW(IDS_PROGRESS_EXTRACTING);
- #endif
- extracter.ExtractCallbackSpec->StartProgressDialog(title);
- result = extracter.Result;
- }
- else
-
- #endif
- {
- result = extracter.Extract();
- }
- errorMessage = extracter.ExtractCallbackSpec->_message;
- isCorrupt = extracter.ExtractCallbackSpec->_isCorrupt;
- return result;
-}
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.h b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.h
deleted file mode 100644
index 609cd7290e..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/ExtractEngine.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// ExtractEngine.h
-
-#ifndef __EXTRACTENGINE_H
-#define __EXTRACTENGINE_H
-
-#include "Common/String.h"
-#include "../../UI/GUI/OpenCallbackGUI.h"
-
-HRESULT ExtractArchive(
- const UString &fileName,
- const UString &folderName,
- COpenCallbackGUI *openCallback,
- bool showProgress,
- bool &isCorrupt,
- UString &errorMessage);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/Main.cpp b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/Main.cpp
deleted file mode 100644
index 1de7d6893e..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/Main.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-// Main.cpp
-
-#include "StdAfx.h"
-
-#include <initguid.h>
-
-#include "Common/StringConvert.h"
-#include "Common/Random.h"
-#include "Common/TextConfig.h"
-#include "Common/CommandLineParser.h"
-
-#include "Windows/FileDir.h"
-#include "Windows/FileIO.h"
-#include "Windows/FileFind.h"
-#include "Windows/FileName.h"
-#include "Windows/DLL.h"
-#include "Windows/ResourceString.h"
-
-#include "../../IPassword.h"
-#include "../../ICoder.h"
-#include "../../Archive/IArchive.h"
-#include "../../UI/Explorer/MyMessages.h"
-
-// #include "../../UI/GUI/ExtractGUI.h"
-
-#include "ExtractEngine.h"
-
-#include "resource.h"
-
-using namespace NWindows;
-
-HINSTANCE g_hInstance;
-
-static LPCTSTR kTempDirPrefix = TEXT("7zS");
-
-#define _SHELL_EXECUTE
-
-/* BEGIN Mozilla customizations */
-
-static char const *
-FindStrInBuf(char const * buf, size_t bufLen, char const * str)
-{
- size_t index = 0;
- while (index < bufLen) {
- char const * result = strstr(buf + index, str);
- if (result) {
- return result;
- }
- while ((buf[index] != '\0') && (index < bufLen)) {
- index++;
- }
- index++;
- }
- return NULL;
-}
-
-static bool
-ReadPostSigningDataFromView(char const * view, DWORD size, AString& data)
-{
- // Find the offset and length of the certificate table,
- // so we know the valid range to look for the token.
- if (size < (0x3c + sizeof(UInt32))) {
- return false;
- }
- UInt32 PEHeaderOffset = *(UInt32*)(view + 0x3c);
- UInt32 optionalHeaderOffset = PEHeaderOffset + 24;
- UInt32 certDirEntryOffset = 0;
- if (size < (optionalHeaderOffset + sizeof(UInt16))) {
- return false;
- }
- UInt16 magic = *(UInt16*)(view + optionalHeaderOffset);
- if (magic == 0x010b) {
- // 32-bit executable
- certDirEntryOffset = optionalHeaderOffset + 128;
- } else if (magic == 0x020b) {
- // 64-bit executable; certain header fields are wider
- certDirEntryOffset = optionalHeaderOffset + 144;
- } else {
- // Unknown executable
- return false;
- }
- if (size < certDirEntryOffset + 8) {
- return false;
- }
- UInt32 certTableOffset = *(UInt32*)(view + certDirEntryOffset);
- UInt32 certTableLen = *(UInt32*)(view + certDirEntryOffset + sizeof(UInt32));
- if (certTableOffset == 0 || certTableLen == 0 ||
- size < (certTableOffset + certTableLen)) {
- return false;
- }
-
- char const token[] = "__MOZCUSTOM__:";
- // We're searching for a string inside a binary blob,
- // so a normal strstr that bails on the first NUL won't work.
- char const * tokenPos = FindStrInBuf(view + certTableOffset,
- certTableLen, token);
- if (tokenPos) {
- size_t tokenLen = (sizeof(token) / sizeof(token[0])) - 1;
- data = AString(tokenPos + tokenLen);
- return true;
- }
- return false;
-}
-
-static bool
-ReadPostSigningData(UString exePath, AString& data)
-{
- bool retval = false;
- HANDLE exeFile = CreateFileW(exePath, GENERIC_READ, FILE_SHARE_READ, NULL,
- OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- if (exeFile != INVALID_HANDLE_VALUE) {
- HANDLE mapping = CreateFileMapping(exeFile, NULL, PAGE_READONLY, 0, 0, NULL);
- if (mapping != INVALID_HANDLE_VALUE) {
- // MSDN claims the return value on failure is NULL,
- // but I've also seen it returned on success, so double-check.
- if (mapping || GetLastError() == ERROR_SUCCESS) {
- char * view = (char*)MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
- if (view) {
- DWORD fileSize = GetFileSize(exeFile, NULL);
- retval = ReadPostSigningDataFromView(view, fileSize, data);
- }
- CloseHandle(mapping);
- }
- }
- CloseHandle(exeFile);
- }
- return retval;
-}
-
-/* END Mozilla customizations */
-
-
-static bool ReadDataString(LPCWSTR fileName, LPCSTR startID,
- LPCSTR endID, AString &stringResult)
-{
- stringResult.Empty();
- NFile::NIO::CInFile inFile;
- if (!inFile.Open(fileName))
- return false;
- const int kBufferSize = (1 << 12);
-
- Byte buffer[kBufferSize];
- int signatureStartSize = lstrlenA(startID);
- int signatureEndSize = lstrlenA(endID);
-
- UInt32 numBytesPrev = 0;
- bool writeMode = false;
- UInt64 posTotal = 0;
- while(true)
- {
- if (posTotal > (1 << 20))
- return (stringResult.IsEmpty());
- UInt32 numReadBytes = kBufferSize - numBytesPrev;
- UInt32 processedSize;
- if (!inFile.Read(buffer + numBytesPrev, numReadBytes, processedSize))
- return false;
- if (processedSize == 0)
- return true;
- UInt32 numBytesInBuffer = numBytesPrev + processedSize;
- UInt32 pos = 0;
- while (true)
- {
- if (writeMode)
- {
- if (pos > numBytesInBuffer - signatureEndSize)
- break;
- if (memcmp(buffer + pos, endID, signatureEndSize) == 0)
- return true;
- char b = buffer[pos];
- if (b == 0)
- return false;
- stringResult += b;
- pos++;
- }
- else
- {
- if (pos > numBytesInBuffer - signatureStartSize)
- break;
- if (memcmp(buffer + pos, startID, signatureStartSize) == 0)
- {
- writeMode = true;
- pos += signatureStartSize;
- }
- else
- pos++;
- }
- }
- numBytesPrev = numBytesInBuffer - pos;
- posTotal += pos;
- memmove(buffer, buffer + pos, numBytesPrev);
- }
-}
-
-static char kStartID[] = ",!@Install@!UTF-8!";
-static char kEndID[] = ",!@InstallEnd@!";
-
-class CInstallIDInit
-{
-public:
- CInstallIDInit()
- {
- kStartID[0] = ';';
- kEndID[0] = ';';
- };
-} g_CInstallIDInit;
-
-
-class CCurrentDirRestorer
-{
- CSysString m_CurrentDirectory;
-public:
- CCurrentDirRestorer()
- { NFile::NDirectory::MyGetCurrentDirectory(m_CurrentDirectory); }
- ~CCurrentDirRestorer()
- { RestoreDirectory();}
- bool RestoreDirectory()
- { return BOOLToBool(::SetCurrentDirectory(m_CurrentDirectory)); }
-};
-
-#ifndef _UNICODE
-bool g_IsNT = false;
-static inline bool IsItWindowsNT()
-{
- OSVERSIONINFO versionInfo;
- versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
- if (!::GetVersionEx(&versionInfo))
- return false;
- return (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT);
-}
-#endif
-
-// Delayed load libraries are loaded when the first symbol is used.
-// The following ensures that we load the delayed loaded libraries from the
-// system directory.
-struct AutoLoadSystemDependencies
-{
- AutoLoadSystemDependencies()
- {
- HMODULE module = ::GetModuleHandleW(L"kernel32.dll");
- if (module) {
- // SetDefaultDllDirectories is always available on Windows 8 and above. It
- // is also available on Windows Vista, Windows Server 2008, and
- // Windows 7 when MS KB2533623 has been applied.
- typedef BOOL (WINAPI *SetDefaultDllDirectoriesType)(DWORD);
- SetDefaultDllDirectoriesType setDefaultDllDirectories =
- (SetDefaultDllDirectoriesType) GetProcAddress(module, "SetDefaultDllDirectories");
- if (setDefaultDllDirectories) {
- setDefaultDllDirectories(0x0800 /* LOAD_LIBRARY_SEARCH_SYSTEM32 */ );
- return;
- }
- }
-
- static LPCWSTR delayDLLs[] = { L"dwmapi.dll", L"cryptbase.dll",
- L"SHCore.dll", L"uxtheme.dll",
- L"oleacc.dll", L"apphelp.dll" };
- WCHAR systemDirectory[MAX_PATH + 1] = { L'\0' };
- // If GetSystemDirectory fails we accept that we'll load the DLLs from the
- // normal search path.
- GetSystemDirectoryW(systemDirectory, MAX_PATH + 1);
- size_t systemDirLen = wcslen(systemDirectory);
-
- // Make the system directory path terminate with a slash
- if (systemDirectory[systemDirLen - 1] != L'\\' && systemDirLen) {
- systemDirectory[systemDirLen] = L'\\';
- ++systemDirLen;
- // No need to re-NULL terminate
- }
-
- // For each known DLL ensure it is loaded from the system32 directory
- for (size_t i = 0; i < sizeof(delayDLLs) / sizeof(delayDLLs[0]); ++i) {
- size_t fileLen = wcslen(delayDLLs[i]);
- wcsncpy(systemDirectory + systemDirLen, delayDLLs[i],
- MAX_PATH - systemDirLen);
- if (systemDirLen + fileLen <= MAX_PATH) {
- systemDirectory[systemDirLen + fileLen] = L'\0';
- } else {
- systemDirectory[MAX_PATH] = L'\0';
- }
- LPCWSTR fullModulePath = systemDirectory; // just for code readability
- LoadLibraryW(fullModulePath);
- }
- }
-} loadDLLs;
-
-BOOL
-RemoveCurrentDirFromSearchPath()
-{
- // kernel32.dll is in the knownDLL list so it is safe to load without a full path
- HMODULE kernel32 = LoadLibraryW(L"kernel32.dll");
- if (!kernel32) {
- return FALSE;
- }
-
- typedef BOOL (WINAPI *SetDllDirectoryType)(LPCWSTR);
- SetDllDirectoryType SetDllDirectoryFn =
- (SetDllDirectoryType)GetProcAddress(kernel32, "SetDllDirectoryW");
- if (!SetDllDirectoryFn) {
- FreeLibrary(kernel32);
- return FALSE;
- }
-
- // If this call fails we can't do much about it, so ignore it.
- // It is unlikely to fail and this is just a precaution anyway.
- SetDllDirectoryFn(L"");
- FreeLibrary(kernel32);
- return TRUE;
-}
-
-int APIENTRY WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow)
-{
- // Disable current directory from being in the search path.
- // This call does not help with implicitly loaded DLLs.
- if (!RemoveCurrentDirFromSearchPath()) {
- WCHAR minOSTitle[512] = { '\0' };
- WCHAR minOSText[512] = { '\0' };
- LoadStringW(NULL, IDS_MIN_OS_TITLE, minOSTitle,
- sizeof(minOSTitle) / sizeof(minOSTitle[0]));
- LoadStringW(NULL, IDS_MIN_OS_TEXT, minOSText,
- sizeof(minOSText) / sizeof(minOSText[0]));
- MessageBoxW(NULL, minOSText, minOSTitle, MB_OK | MB_ICONERROR);
- return 1;
- }
-
- g_hInstance = (HINSTANCE)hInstance;
- #ifndef _UNICODE
- g_IsNT = IsItWindowsNT();
- #endif
- InitCommonControls();
-
- UString archiveName, switches;
- #ifdef _SHELL_EXECUTE
- UString executeFile, executeParameters;
- #endif
- NCommandLineParser::SplitCommandLine(GetCommandLineW(), archiveName, switches);
-
- UString fullPath;
- NDLL::MyGetModuleFileName(g_hInstance, fullPath);
-
- switches.Trim();
- bool assumeYes = false;
- if (switches.Left(2).CompareNoCase(UString(L"-y")) == 0)
- {
- assumeYes = true;
- switches = switches.Mid(2);
- switches.Trim();
- }
-
- /* BEGIN Mozilla customizations */
- bool showProgress = true;
- bool extractOnly = false;
- if (switches.Left(3).CompareNoCase(UString(L"-ms")) == 0 ||
- switches.Left(4).CompareNoCase(UString(L"/ini")) == 0 ||
- switches.Left(2).CompareNoCase(UString(L"/s")) == 0) {
- showProgress = false;
- } else if (switches.Left(12).CompareNoCase(UString(L"/extractdir=")) == 0) {
- assumeYes = true;
- showProgress = false;
- extractOnly = true;
- }
- /* END Mozilla customizations */
-
- AString config;
- if (!ReadDataString(fullPath, kStartID, kEndID, config))
- {
- if (!assumeYes)
- MyMessageBox(L"Can't load config info");
- return 1;
- }
-
- UString dirPrefix = L".\\";
- UString appLaunched;
- if (!config.IsEmpty())
- {
- CObjectVector<CTextConfigPair> pairs;
- if (!GetTextConfig(config, pairs))
- {
- if (!assumeYes)
- MyMessageBox(L"Config failed");
- return 1;
- }
- UString friendlyName = GetTextConfigValue(pairs, L"Title");
- UString installPrompt = GetTextConfigValue(pairs, L"BeginPrompt");
- UString progress = GetTextConfigValue(pairs, L"Progress");
- if (progress.CompareNoCase(L"no") == 0)
- showProgress = false;
- int index = FindTextConfigItem(pairs, L"Directory");
- if (index >= 0)
- dirPrefix = pairs[index].String;
- if (!installPrompt.IsEmpty() && !assumeYes)
- {
- if (MessageBoxW(0, installPrompt, friendlyName, MB_YESNO |
- MB_ICONQUESTION) != IDYES)
- return 0;
- }
- appLaunched = GetTextConfigValue(pairs, L"RunProgram");
-
- #ifdef _SHELL_EXECUTE
- executeFile = GetTextConfigValue(pairs, L"ExecuteFile");
- executeParameters = GetTextConfigValue(pairs, L"ExecuteParameters") + switches;
- #endif
- }
-
- NFile::NDirectory::CTempDirectory tempDir;
- /* Mozilla customizations - Added !extractOnly */
- if (!extractOnly && !tempDir.Create(kTempDirPrefix))
- {
- if (!assumeYes)
- MyMessageBox(L"Can not create temp folder archive");
- return 1;
- }
-
- /* BEGIN Mozilla customizations */
- UString tempDirPath = (extractOnly ? switches.Mid(12) : GetUnicodeString(tempDir.GetPath()));
- /* END Mozilla customizations */
-
- COpenCallbackGUI openCallback;
-
- bool isCorrupt = false;
- UString errorMessage;
- HRESULT result = ExtractArchive(fullPath, tempDirPath, &openCallback, showProgress,
- isCorrupt, errorMessage);
-
- if (result != S_OK)
- {
- if (!assumeYes)
- {
- if (result == S_FALSE || isCorrupt)
- {
- errorMessage = NWindows::MyLoadStringW(IDS_EXTRACTION_ERROR_MESSAGE);
- result = E_FAIL;
- }
- if (result != E_ABORT && !errorMessage.IsEmpty())
- ::MessageBoxW(0, errorMessage, NWindows::MyLoadStringW(IDS_EXTRACTION_ERROR_TITLE), MB_ICONERROR);
- }
- return 1;
- }
-
- /* BEGIN Mozilla customizations */
- // Retrieve and store any data added to this file after signing.
- {
- AString postSigningData;
- if (ReadPostSigningData(fullPath, postSigningData)) {
- NFile::NName::CParsedPath postSigningDataFilePath;
- postSigningDataFilePath.ParsePath(tempDirPath);
- postSigningDataFilePath.PathParts.Add(L"postSigningData");
-
- NFile::NIO::COutFile postSigningDataFile;
- postSigningDataFile.Create(postSigningDataFilePath.MergePath(), true);
-
- UInt32 written = 0;
- postSigningDataFile.Write(postSigningData, postSigningData.Length(), written);
- }
- }
-
- if (extractOnly) {
- return 0;
- }
- /* END Mozilla customizations */
-
- CCurrentDirRestorer currentDirRestorer;
-
- if (!SetCurrentDirectory(tempDir.GetPath()))
- return 1;
-
- HANDLE hProcess = 0;
-#ifdef _SHELL_EXECUTE
- if (!executeFile.IsEmpty())
- {
- CSysString filePath = GetSystemString(executeFile);
- SHELLEXECUTEINFO execInfo;
- execInfo.cbSize = sizeof(execInfo);
- execInfo.fMask = SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_DDEWAIT;
- execInfo.hwnd = NULL;
- execInfo.lpVerb = NULL;
- execInfo.lpFile = filePath;
-
- if (!switches.IsEmpty())
- executeParameters += switches;
-
- CSysString parametersSys = GetSystemString(executeParameters);
- if (parametersSys.IsEmpty())
- execInfo.lpParameters = NULL;
- else
- execInfo.lpParameters = parametersSys;
-
- execInfo.lpDirectory = NULL;
- execInfo.nShow = SW_SHOWNORMAL;
- execInfo.hProcess = 0;
- bool success = BOOLToBool(::ShellExecuteEx(&execInfo));
- result = (UINT32)execInfo.hInstApp;
- if(result <= 32)
- {
- if (!assumeYes)
- MyMessageBox(L"Can not open file");
- return 1;
- }
- hProcess = execInfo.hProcess;
- }
- else
-#endif
- {
- if (appLaunched.IsEmpty())
- {
- appLaunched = L"setup.exe";
- if (!NFile::NFind::DoesFileExist(GetSystemString(appLaunched)))
- {
- if (!assumeYes)
- MyMessageBox(L"Can not find setup.exe");
- return 1;
- }
- }
-
- {
- UString s2 = tempDirPath;
- NFile::NName::NormalizeDirPathPrefix(s2);
- appLaunched.Replace(L"%%T\\", s2);
- }
-
- appLaunched.Replace(L"%%T", tempDirPath);
-
- if (!switches.IsEmpty())
- {
- appLaunched += L' ';
- appLaunched += switches;
- }
- STARTUPINFO startupInfo;
- startupInfo.cb = sizeof(startupInfo);
- startupInfo.lpReserved = 0;
- startupInfo.lpDesktop = 0;
- startupInfo.lpTitle = 0;
- startupInfo.dwFlags = 0;
- startupInfo.cbReserved2 = 0;
- startupInfo.lpReserved2 = 0;
-
- PROCESS_INFORMATION processInformation;
-
- CSysString appLaunchedSys = GetSystemString(dirPrefix + appLaunched);
-
- BOOL createResult = CreateProcess(NULL, (LPTSTR)(LPCTSTR)appLaunchedSys,
- NULL, NULL, FALSE, 0, NULL, NULL /*tempDir.GetPath() */,
- &startupInfo, &processInformation);
- if (createResult == 0)
- {
- if (!assumeYes)
- ShowLastErrorMessage();
- return 1;
- }
- ::CloseHandle(processInformation.hThread);
- hProcess = processInformation.hProcess;
- }
- if (hProcess != 0)
- {
- WaitForSingleObject(hProcess, INFINITE);
- ::CloseHandle(hProcess);
- }
- return 0;
-}
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsp b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsp
deleted file mode 100644
index e9ff6ad48b..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsp
+++ /dev/null
@@ -1,696 +0,0 @@
-# Microsoft Developer Studio Project File - Name="SFXSetup-moz" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Application" 0x0101
-
-CFG=SFXSetup-moz - Win32 Debug
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "SFXSetup-moz.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "SFXSetup-moz.mak" CFG="SFXSetup-moz - Win32 Debug"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "SFXSetup-moz - Win32 Release" (based on "Win32 (x86) Application")
-!MESSAGE "SFXSetup-moz - Win32 Debug" (based on "Win32 (x86) Application")
-!MESSAGE "SFXSetup-moz - Win32 ReleaseD" (based on "Win32 (x86) Application")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "SFXSetup-moz - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release"
-# PROP BASE Intermediate_Dir "Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release"
-# PROP Intermediate_Dir "Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "NDEBUG"
-# ADD RSC /l 0x419 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
-# ADD LINK32 comctl32.lib kernel32.lib user32.lib shell32.lib oleaut32.lib delayimp.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7zS.sfx" /delayload:comctl32.dll /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll /opt:NOWIN98
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "SFXSetup-moz - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir "Debug"
-# PROP BASE Intermediate_Dir "Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir "Debug"
-# PROP Intermediate_Dir "Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /Gz /MTd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /GZ /c
-# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "_DEBUG"
-# ADD RSC /l 0x419 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 comctl32.lib kernel32.lib user32.lib shell32.lib oleaut32.lib delayimp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\UTIL\7zSfxS.exe" /pdbtype:sept /delayload:comctl32.dll /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
-
-!ELSEIF "$(CFG)" == "SFXSetup-moz - Win32 ReleaseD"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "ReleaseD"
-# PROP BASE Intermediate_Dir "ReleaseD"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "ReleaseD"
-# PROP Intermediate_Dir "ReleaseD"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "_SFX" /Yu"StdAfx.h" /FD /c
-# ADD CPP /nologo /Gz /MD /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "FORMAT_7Z" /D "COMPRESS_LZMA" /D "COMPRESS_BCJ_X86" /D "COMPRESS_BCJ2" /D "COMPRESS_COPY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x419 /d "NDEBUG"
-# ADD RSC /l 0x419 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\UTIL\7zWinSR.exe"
-# SUBTRACT BASE LINK32 /debug /nodefaultlib
-# ADD LINK32 comctl32.lib kernel32.lib user32.lib shell32.lib oleaut32.lib delayimp.lib /nologo /subsystem:windows /machine:I386 /out:"ReleaseD\7zSD.sfx" /delayload:comctl32.dll /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll /opt:NOWIN98
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "SFXSetup-moz - Win32 Release"
-# Name "SFXSetup-moz - Win32 Debug"
-# Name "SFXSetup-moz - Win32 ReleaseD"
-# Begin Group "Spec"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=.\resource.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.cpp
-# ADD CPP /Yc"StdAfx.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\StdAfx.h
-# End Source File
-# End Group
-# Begin Group "Interface"
-
-# PROP Default_Filter ""
-# End Group
-# Begin Group "7z"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zDecode.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zDecode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zExtract.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zFolderOutStream.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zFolderOutStream.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zHandler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zHandler.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zHeader.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zHeader.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zIn.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zIn.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zItem.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zMethodID.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\7z\7zMethodID.h
-# End Source File
-# End Group
-# Begin Group "Archive Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\CoderMixer2.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\CoderMixer2.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\CoderMixer2MT.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\CoderMixer2MT.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\CrossThreadProgress.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\CrossThreadProgress.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\FilterCoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\FilterCoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\ItemNameUtils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\ItemNameUtils.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
-# End Source File
-# End Group
-# Begin Group "Compress"
-
-# PROP Default_Filter ""
-# Begin Group "LZMA"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZMA\LZMADecoder.cpp
-# End Source File
-# End Group
-# Begin Group "Branch"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchCoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\BranchCoder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\x86.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Branch\x86_2.cpp
-# End Source File
-# End Group
-# Begin Group "Copy"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyCoder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\Copy\CopyCoder.h
-# End Source File
-# End Group
-# Begin Group "LZ"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\LZOutWindow.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Compress\LZ\LZOutWindow.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "SDK"
-
-# PROP Default_Filter ""
-# End Group
-# Begin Group "Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\..\Common\Alloc.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Alloc.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\CommandLineParser.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\CommandLineParser.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\CRC.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\CRC.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\IntToString.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\IntToString.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\NewHandler.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\NewHandler.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\String.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\String.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\StringConvert.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\StringConvert.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\TextConfig.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\TextConfig.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\UTFConvert.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\UTFConvert.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Vector.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Vector.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Wildcard.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Common\Wildcard.h
-# End Source File
-# End Group
-# Begin Group "Windows"
-
-# PROP Default_Filter ""
-# Begin Group "Control"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Control\Dialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Control\Dialog.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\..\..\Windows\DLL.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\DLL.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Error.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Error.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileDir.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileDir.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileFind.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileFind.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileIO.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileIO.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileName.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\FileName.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\PropVariant.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\PropVariant.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\ResourceString.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\ResourceString.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Synchronization.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Synchronization.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Window.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\..\Windows\Window.h
-# End Source File
-# End Group
-# Begin Group "7z Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\Common\FileStreams.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\FileStreams.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\InBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\InBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LimitedStreams.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LimitedStreams.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LockedStream.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\LockedStream.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\OutBuffer.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\OutBuffer.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\ProgressUtils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\ProgressUtils.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamBinder.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamBinder.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamObjects.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamObjects.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamUtils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\Common\StreamUtils.h
-# End Source File
-# End Group
-# Begin Group "UI"
-
-# PROP Default_Filter ""
-# Begin Group "Explorer"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\UI\Explorer\MyMessages.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Explorer\MyMessages.h
-# End Source File
-# End Group
-# Begin Group "UI Common"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\UI\Common\ArchiveOpenCallback.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\ArchiveOpenCallback.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\ArchiverInfo.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\ArchiverInfo.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\DefaultName.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\DefaultName.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\ExtractMode.h
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\OpenArchive.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\Common\OpenArchive.h
-# End Source File
-# End Group
-# Begin Group "GUI"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\UI\GUI\OpenCallbackGUI.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\UI\GUI\OpenCallbackGUI.h
-# End Source File
-# End Group
-# End Group
-# Begin Group "File Manager"
-
-# PROP Default_Filter ""
-# Begin Group "Dialog"
-
-# PROP Default_Filter ""
-# Begin Source File
-
-SOURCE=..\..\FileManager\Resource\ProgressDialog\ProgressDialog.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\FileManager\Resource\ProgressDialog\ProgressDialog.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=..\..\FileManager\FormatUtils.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=..\..\FileManager\FormatUtils.h
-# End Source File
-# End Group
-# Begin Source File
-
-SOURCE=.\ExtractCallback.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ExtractCallback.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ExtractEngine.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\ExtractEngine.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\Main.cpp
-# End Source File
-# Begin Source File
-
-SOURCE=.\setup.ico
-# End Source File
-# End Target
-# End Project
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsw b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsw
deleted file mode 100644
index 2b6b8243c4..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/SFXSetup-moz.dsw
+++ /dev/null
@@ -1,29 +0,0 @@
-Microsoft Developer Studio Workspace File, Format Version 6.00
-# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
-
-###############################################################################
-
-Project: "SFXSetup-moz"=.\SFXSetup-moz.dsp - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Global:
-
-Package=<5>
-{{{
-}}}
-
-Package=<3>
-{{{
-}}}
-
-###############################################################################
-
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.h b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.h
deleted file mode 100644
index 85536206d0..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../../Common/MyWindows.h"
-#include "../../../Common/NewHandler.h"
-#include <commctrl.h>
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/makefile b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/makefile
deleted file mode 100644
index 89cae1d5bc..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/makefile
+++ /dev/null
@@ -1,156 +0,0 @@
-PROG = 7zS.sfx
-LIBS = $(LIBS) user32.lib oleaut32.lib shell32.lib ole32.lib comctl32.lib
-CFLAGS = $(CFLAGS) -I ../../../ \
- -DEXCLUDE_COM \
- -DNO_REGISTRY \
- -DEXTRACT_ONLY \
- -D_SFX \
- -DFORMAT_7Z \
- -DCOMPRESS_BCJ_X86 \
- -DCOMPRESS_BCJ2 \
- -DCOMPRESS_COPY \
- -DCOMPRESS_LZMA \
- -D_NO_CRYPTO
-
-SFX_WIN_OBJS = \
- $O\Main.obj \
- $O\ExtractCallback.obj \
- $O\ExtractEngine.obj \
-
-GUI_OBJS = \
- $O\OpenCallbackGUI.obj \
-
-COMMON_OBJS = \
- $O\Alloc.obj \
- $O\CommandLineParser.obj \
- $O\CRC.obj \
- $O\IntToString.obj \
- $O\NewHandler.obj \
- $O\String.obj \
- $O\StringConvert.obj \
- $O\TextConfig.obj \
- $O\UTFConvert.obj \
- $O\Vector.obj \
- $O\Wildcard.obj \
-
-WIN_OBJS = \
- $O\DLL.obj \
- $O\Error.obj \
- $O\FileDir.obj \
- $O\FileFind.obj \
- $O\FileIO.obj \
- $O\FileName.obj \
- $O\PropVariant.obj \
- $O\ResourceString.obj \
- $O\Synchronization.obj \
- $O\Window.obj \
-
-WIN_CTRL_OBJS = \
- $O\Dialog.obj \
-
-7ZIP_COMMON_OBJS = \
- $O\FileStreams.obj \
- $O\InBuffer.obj \
- $O\LimitedStreams.obj \
- $O\LockedStream.obj \
- $O\OutBuffer.obj \
- $O\ProgressUtils.obj \
- $O\StreamBinder.obj \
- $O\StreamObjects.obj \
- $O\StreamUtils.obj \
-
-UI_COMMON_OBJS = \
- $O\ArchiveOpenCallback.obj \
- $O\ArchiverInfo.obj \
- $O\DefaultName.obj \
- $O\OpenArchive.obj \
-
-FM_OBJS = \
- $O\FormatUtils.obj \
-
-AR_COMMON_OBJS = \
- $O\CoderMixer2.obj \
- $O\CoderMixer2MT.obj \
- $O\CrossThreadProgress.obj \
- $O\FilterCoder.obj \
- $O\ItemNameUtils.obj \
- $O\OutStreamWithCRC.obj \
-
-7Z_OBJS = \
- $O\7zDecode.obj \
- $O\7zExtract.obj \
- $O\7zFolderOutStream.obj \
- $O\7zHandler.obj \
- $O\7zHeader.obj \
- $O\7zIn.obj \
- $O\7zMethodID.obj \
-
-BRANCH_OPT_OBJS = \
- $O\BranchCoder.obj \
- $O\x86.obj \
- $O\x86_2.obj \
-
-LZ_OBJS = \
- $O\LZOutWindow.obj \
-
-LZMA_OPT_OBJS = \
- $O\LZMADecoder.obj \
-
-OBJS = \
- $O\StdAfx.obj \
- $(SFX_WIN_OBJS) \
- $(GUI_OBJS) \
- $(COMMON_OBJS) \
- $(WIN_OBJS) \
- $(WIN_CTRL_OBJS) \
- $(7ZIP_COMMON_OBJS) \
- $(UI_COMMON_OBJS) \
- $(FM_OBJS)\
- $(AR_COMMON_OBJS) \
- $(7Z_OBJS) \
- $(BRANCH_OPT_OBJS) \
- $(LZ_OBJS) \
- $(LZMA_OPT_OBJS) \
- $O\CopyCoder.obj \
- $O\MyMessages.obj \
- $O\ProgressDialog.obj \
- $O\resource.res
-
-
-!include "../../../Build.mak"
-
-$(SFX_WIN_OBJS): $(*B).cpp
- $(COMPL)
-
-$(GUI_OBJS): ../../UI/GUI/$(*B).cpp
- $(COMPL)
-$(COMMON_OBJS): ../../../Common/$(*B).cpp
- $(COMPL)
-$(WIN_OBJS): ../../../Windows/$(*B).cpp
- $(COMPL)
-$(WIN_CTRL_OBJS): ../../../Windows/Control/$(*B).cpp
- $(COMPL)
-$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
- $(COMPL)
-$(UI_COMMON_OBJS): ../../UI/Common/$(*B).cpp
- $(COMPL)
-$(FM_OBJS): ../../FileManager/$(*B).cpp
- $(COMPL)
-$(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
- $(COMPL)
-
-$(7Z_OBJS): ../../Archive/7z/$(*B).cpp
- $(COMPL)
-$(BRANCH_OPT_OBJS): ../../Compress/Branch/$(*B).cpp
- $(COMPL)
-$(LZ_OBJS): ../../Compress/LZ/$(*B).cpp
- $(COMPL)
-$(LZMA_OPT_OBJS): ../../Compress/LZMA/$(*B).cpp
- $(COMPL)
-
-$O\CopyCoder.obj: ../../Compress/Copy/$(*B).cpp
- $(COMPL)
-$O\MyMessages.obj: ../../UI/Explorer/MyMessages.cpp
- $(COMPL)
-$O\ProgressDialog.obj: ../../FileManager/Resource/ProgressDialog/$(*B).cpp
- $(COMPL)
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.h b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.h
deleted file mode 100644
index 9d58c410dd..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#define IDI_ICON3 159
-
-#define IDS_EXTRACTION_ERROR_TITLE 7
-#define IDS_EXTRACTION_ERROR_MESSAGE 8
-#define IDS_CANNOT_CREATE_FOLDER 9
-#define IDS_PROGRESS_EXTRACTING 69
-#define IDS_MIN_OS_TITLE 70
-#define IDS_MIN_OS_TEXT 71
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.rc b/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.rc
deleted file mode 100644
index ff1e2347cb..0000000000
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/resource.rc
+++ /dev/null
@@ -1,18 +0,0 @@
-#include "../../MyVersionInfo.rc"
-#include "resource.h"
-
-MY_VERSION_INFO_APP("7z Setup SFX", "7zS.sfx")
-
-IDI_ICON3 ICON "setup.ico"
-
-STRINGTABLE
-BEGIN
- IDS_EXTRACTION_ERROR_TITLE "Extraction Failed"
- IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt"
- IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
- IDS_PROGRESS_EXTRACTING "Extracting"
- IDS_MIN_OS_TITLE "Setup Error"
- IDS_MIN_OS_TEXT "Microsoft Windows XP SP2 or newer is required."
-END
-
-#include "../../FileManager/Resource/ProgressDialog/resource.rc"
diff --git a/other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.cpp b/other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.cpp
deleted file mode 100644
index 9dae03d121..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// FilePathAutoRename.cpp
-
-#include "StdAfx.h"
-#include "FilePathAutoRename.h"
-
-#include "Common/Defs.h"
-#include "Common/IntToString.h"
-
-#include "Windows/FileName.h"
-#include "Windows/FileFind.h"
-
-using namespace NWindows;
-
-static bool MakeAutoName(const UString &name,
- const UString &extension, int value, UString &path)
-{
- wchar_t number[32];
- ConvertUInt64ToString(value, number);
- path = name;
- path += number;
- path += extension;
- return NFile::NFind::DoesFileExist(path);
-}
-
-bool AutoRenamePath(UString &fullProcessedPath)
-{
- UString path;
- int dotPos = fullProcessedPath.ReverseFind(L'.');
-
- int slashPos = fullProcessedPath.ReverseFind(L'/');
- #ifdef _WIN32
- int slash1Pos = fullProcessedPath.ReverseFind(L'\\');
- slashPos = MyMax(slashPos, slash1Pos);
- #endif
-
- UString name, extension;
- if (dotPos > slashPos && dotPos > 0)
- {
- name = fullProcessedPath.Left(dotPos);
- extension = fullProcessedPath.Mid(dotPos);
- }
- else
- name = fullProcessedPath;
- name += L'_';
- int indexLeft = 1, indexRight = (1 << 30);
- while (indexLeft != indexRight)
- {
- int indexMid = (indexLeft + indexRight) / 2;
- if (MakeAutoName(name, extension, indexMid, path))
- indexLeft = indexMid + 1;
- else
- indexRight = indexMid;
- }
- if (MakeAutoName(name, extension, indexRight, fullProcessedPath))
- return false;
- return true;
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.h b/other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.h
deleted file mode 100644
index 10197428d8..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/FilePathAutoRename.h
+++ /dev/null
@@ -1,10 +0,0 @@
-// Util/FilePathAutoRename.h
-
-#ifndef __FILEPATHAUTORENAME_H
-#define __FILEPATHAUTORENAME_H
-
-#include "Common/String.h"
-
-bool AutoRenamePath(UString &fullProcessedPath);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/FileStreams.cpp b/other-licenses/7zstub/src/7zip/Common/FileStreams.cpp
deleted file mode 100644
index 7a32c6e702..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/FileStreams.cpp
+++ /dev/null
@@ -1,251 +0,0 @@
-// FileStreams.cpp
-
-#include "StdAfx.h"
-
-#ifndef _WIN32
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#endif
-
-#include "FileStreams.h"
-
-static inline HRESULT ConvertBoolToHRESULT(bool result)
-{
- // return result ? S_OK: E_FAIL;
- #ifdef _WIN32
- return result ? S_OK: (::GetLastError());
- #else
- return result ? S_OK: E_FAIL;
- #endif
-}
-
-bool CInFileStream::Open(LPCTSTR fileName)
-{
- return File.Open(fileName);
-}
-
-#ifdef _WIN32
-#ifndef _UNICODE
-bool CInFileStream::Open(LPCWSTR fileName)
-{
- return File.Open(fileName);
-}
-#endif
-#endif
-
-STDMETHODIMP CInFileStream::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- #ifdef _WIN32
-
- UInt32 realProcessedSize;
- bool result = File.ReadPart(data, size, realProcessedSize);
- if(processedSize != NULL)
- *processedSize = realProcessedSize;
- return ConvertBoolToHRESULT(result);
-
- #else
-
- if(processedSize != NULL)
- *processedSize = 0;
- ssize_t res = File.Read(data, (size_t)size);
- if (res == -1)
- return E_FAIL;
- if(processedSize != NULL)
- *processedSize = (UInt32)res;
- return S_OK;
-
- #endif
-}
-
-#ifndef _WIN32_WCE
-STDMETHODIMP CStdInFileStream::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- #ifdef _WIN32
- UInt32 realProcessedSize;
- BOOL res = ::ReadFile(GetStdHandle(STD_INPUT_HANDLE),
- data, size, (DWORD *)&realProcessedSize, NULL);
- if(processedSize != NULL)
- *processedSize = realProcessedSize;
- if (res == FALSE && GetLastError() == ERROR_BROKEN_PIPE)
- return S_OK;
- return ConvertBoolToHRESULT(res != FALSE);
-
- #else
-
- if(processedSize != NULL)
- *processedSize = 0;
- ssize_t res;
- do
- {
- res = read(0, data, (size_t)size);
- }
- while (res < 0 && (errno == EINTR));
- if (res == -1)
- return E_FAIL;
- if(processedSize != NULL)
- *processedSize = (UInt32)res;
- return S_OK;
-
- #endif
-}
-
-#endif
-
-STDMETHODIMP CInFileStream::Seek(Int64 offset, UInt32 seekOrigin,
- UInt64 *newPosition)
-{
- if(seekOrigin >= 3)
- return STG_E_INVALIDFUNCTION;
-
- #ifdef _WIN32
-
- UInt64 realNewPosition;
- bool result = File.Seek(offset, seekOrigin, realNewPosition);
- if(newPosition != NULL)
- *newPosition = realNewPosition;
- return ConvertBoolToHRESULT(result);
-
- #else
-
- off_t res = File.Seek(offset, seekOrigin);
- if (res == -1)
- return E_FAIL;
- if(newPosition != NULL)
- *newPosition = (UInt64)res;
- return S_OK;
-
- #endif
-}
-
-STDMETHODIMP CInFileStream::GetSize(UInt64 *size)
-{
- return ConvertBoolToHRESULT(File.GetLength(*size));
-}
-
-
-//////////////////////////
-// COutFileStream
-
-bool COutFileStream::Create(LPCTSTR fileName, bool createAlways)
-{
- return File.Create(fileName, createAlways);
-}
-
-#ifdef _WIN32
-#ifndef _UNICODE
-bool COutFileStream::Create(LPCWSTR fileName, bool createAlways)
-{
- return File.Create(fileName, createAlways);
-}
-#endif
-#endif
-
-STDMETHODIMP COutFileStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- #ifdef _WIN32
-
- UInt32 realProcessedSize;
- bool result = File.WritePart(data, size, realProcessedSize);
- if(processedSize != NULL)
- *processedSize = realProcessedSize;
- return ConvertBoolToHRESULT(result);
-
- #else
-
- if(processedSize != NULL)
- *processedSize = 0;
- ssize_t res = File.Write(data, (size_t)size);
- if (res == -1)
- return E_FAIL;
- if(processedSize != NULL)
- *processedSize = (UInt32)res;
- return S_OK;
-
- #endif
-}
-
-STDMETHODIMP COutFileStream::Seek(Int64 offset, UInt32 seekOrigin,
- UInt64 *newPosition)
-{
- if(seekOrigin >= 3)
- return STG_E_INVALIDFUNCTION;
- #ifdef _WIN32
-
- UInt64 realNewPosition;
- bool result = File.Seek(offset, seekOrigin, realNewPosition);
- if(newPosition != NULL)
- *newPosition = realNewPosition;
- return ConvertBoolToHRESULT(result);
-
- #else
-
- off_t res = File.Seek(offset, seekOrigin);
- if (res == -1)
- return E_FAIL;
- if(newPosition != NULL)
- *newPosition = (UInt64)res;
- return S_OK;
-
- #endif
-}
-
-STDMETHODIMP COutFileStream::SetSize(Int64 newSize)
-{
- #ifdef _WIN32
- UInt64 currentPos;
- if(!File.Seek(0, FILE_CURRENT, currentPos))
- return E_FAIL;
- bool result = File.SetLength(newSize);
- UInt64 currentPos2;
- result = result && File.Seek(currentPos, currentPos2);
- return result ? S_OK : E_FAIL;
- #else
- return E_FAIL;
- #endif
-}
-
-#ifndef _WIN32_WCE
-STDMETHODIMP CStdOutFileStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- if(processedSize != NULL)
- *processedSize = 0;
-
- #ifdef _WIN32
- UInt32 realProcessedSize;
- BOOL res = TRUE;
- if (size > 0)
- {
- // Seems that Windows doesn't like big amounts writing to stdout.
- // So we limit portions by 32KB.
- UInt32 sizeTemp = (1 << 15);
- if (sizeTemp > size)
- sizeTemp = size;
- res = ::WriteFile(GetStdHandle(STD_OUTPUT_HANDLE),
- data, sizeTemp, (DWORD *)&realProcessedSize, NULL);
- size -= realProcessedSize;
- data = (const void *)((const Byte *)data + realProcessedSize);
- if(processedSize != NULL)
- *processedSize += realProcessedSize;
- }
- return ConvertBoolToHRESULT(res != FALSE);
-
- #else
-
- ssize_t res;
- do
- {
- res = write(1, data, (size_t)size);
- }
- while (res < 0 && (errno == EINTR));
- if (res == -1)
- return E_FAIL;
- if(processedSize != NULL)
- *processedSize = (UInt32)res;
- return S_OK;
-
- return S_OK;
- #endif
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/FileStreams.h b/other-licenses/7zstub/src/7zip/Common/FileStreams.h
deleted file mode 100644
index e6494f679b..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/FileStreams.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// FileStreams.h
-
-#ifndef __FILESTREAMS_H
-#define __FILESTREAMS_H
-
-#ifdef _WIN32
-#include "../../Windows/FileIO.h"
-#else
-#include "../../Common/C_FileIO.h"
-#endif
-
-#include "../IStream.h"
-#include "../../Common/MyCom.h"
-
-class CInFileStream:
- public IInStream,
- public IStreamGetSize,
- public CMyUnknownImp
-{
-public:
- #ifdef _WIN32
- NWindows::NFile::NIO::CInFile File;
- #else
- NC::NFile::NIO::CInFile File;
- #endif
- CInFileStream() {}
- virtual ~CInFileStream() {}
-
- bool Open(LPCTSTR fileName);
- #ifdef _WIN32
- #ifndef _UNICODE
- bool Open(LPCWSTR fileName);
- #endif
- #endif
-
- MY_UNKNOWN_IMP2(IInStream, IStreamGetSize)
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
- STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
-
- STDMETHOD(GetSize)(UInt64 *size);
-};
-
-#ifndef _WIN32_WCE
-class CStdInFileStream:
- public ISequentialInStream,
- public CMyUnknownImp
-{
-public:
- // HANDLE File;
- // CStdInFileStream() File(INVALID_HANDLE_VALUE): {}
- // void Open() { File = GetStdHandle(STD_INPUT_HANDLE); };
- MY_UNKNOWN_IMP
-
- virtual ~CStdInFileStream() {}
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
-};
-#endif
-
-class COutFileStream:
- public IOutStream,
- public CMyUnknownImp
-{
-public:
- #ifdef _WIN32
- NWindows::NFile::NIO::COutFile File;
- #else
- NC::NFile::NIO::COutFile File;
- #endif
- virtual ~COutFileStream() {}
- bool Create(LPCTSTR fileName, bool createAlways);
- #ifdef _WIN32
- #ifndef _UNICODE
- bool Create(LPCWSTR fileName, bool createAlways);
- #endif
- #endif
-
- MY_UNKNOWN_IMP1(IOutStream)
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
- STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
- STDMETHOD(SetSize)(Int64 newSize);
-};
-
-#ifndef _WIN32_WCE
-class CStdOutFileStream:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
-
- virtual ~CStdOutFileStream() {}
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-};
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/InBuffer.cpp b/other-licenses/7zstub/src/7zip/Common/InBuffer.cpp
deleted file mode 100644
index 17280b5b6c..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/InBuffer.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// InBuffer.cpp
-
-#include "StdAfx.h"
-
-#include "InBuffer.h"
-
-#include "../../Common/Alloc.h"
-
-CInBuffer::CInBuffer():
- _buffer(0),
- _bufferLimit(0),
- _bufferBase(0),
- _stream(0),
- _bufferSize(0)
-{}
-
-bool CInBuffer::Create(UInt32 bufferSize)
-{
- const UInt32 kMinBlockSize = 1;
- if (bufferSize < kMinBlockSize)
- bufferSize = kMinBlockSize;
- if (_bufferBase != 0 && _bufferSize == bufferSize)
- return true;
- Free();
- _bufferSize = bufferSize;
- _bufferBase = (Byte *)::MidAlloc(bufferSize);
- return (_bufferBase != 0);
-}
-
-void CInBuffer::Free()
-{
- ::MidFree(_bufferBase);
- _bufferBase = 0;
-}
-
-void CInBuffer::SetStream(ISequentialInStream *stream)
-{
- _stream = stream;
-}
-
-void CInBuffer::Init()
-{
- _processedSize = 0;
- _buffer = _bufferBase;
- _bufferLimit = _buffer;
- _wasFinished = false;
- #ifdef _NO_EXCEPTIONS
- ErrorCode = S_OK;
- #endif
-}
-
-bool CInBuffer::ReadBlock()
-{
- #ifdef _NO_EXCEPTIONS
- if (ErrorCode != S_OK)
- return false;
- #endif
- if (_wasFinished)
- return false;
- _processedSize += (_buffer - _bufferBase);
- UInt32 numProcessedBytes;
- HRESULT result = _stream->Read(_bufferBase, _bufferSize, &numProcessedBytes);
- #ifdef _NO_EXCEPTIONS
- ErrorCode = result;
- #else
- if (result != S_OK)
- throw CInBufferException(result);
- #endif
- _buffer = _bufferBase;
- _bufferLimit = _buffer + numProcessedBytes;
- _wasFinished = (numProcessedBytes == 0);
- return (!_wasFinished);
-}
-
-Byte CInBuffer::ReadBlock2()
-{
- if(!ReadBlock())
- return 0xFF;
- return *_buffer++;
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/InBuffer.h b/other-licenses/7zstub/src/7zip/Common/InBuffer.h
deleted file mode 100644
index a59ecefacd..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/InBuffer.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// InBuffer.h
-
-#ifndef __INBUFFER_H
-#define __INBUFFER_H
-
-#include "../IStream.h"
-#include "../../Common/MyCom.h"
-
-#ifndef _NO_EXCEPTIONS
-class CInBufferException
-{
-public:
- HRESULT ErrorCode;
- CInBufferException(HRESULT errorCode): ErrorCode(errorCode) {}
-};
-#endif
-
-class CInBuffer
-{
- Byte *_buffer;
- Byte *_bufferLimit;
- Byte *_bufferBase;
- CMyComPtr<ISequentialInStream> _stream;
- UInt64 _processedSize;
- UInt32 _bufferSize;
- bool _wasFinished;
-
- bool ReadBlock();
- Byte ReadBlock2();
-
-public:
- #ifdef _NO_EXCEPTIONS
- HRESULT ErrorCode;
- #endif
-
- CInBuffer();
- ~CInBuffer() { Free(); }
-
- bool Create(UInt32 bufferSize);
- void Free();
-
- void SetStream(ISequentialInStream *stream);
- void Init();
- void ReleaseStream() { _stream.Release(); }
-
- bool ReadByte(Byte &b)
- {
- if(_buffer >= _bufferLimit)
- if(!ReadBlock())
- return false;
- b = *_buffer++;
- return true;
- }
- Byte ReadByte()
- {
- if(_buffer >= _bufferLimit)
- return ReadBlock2();
- return *_buffer++;
- }
- void ReadBytes(void *data, UInt32 size, UInt32 &processedSize)
- {
- for(processedSize = 0; processedSize < size; processedSize++)
- if (!ReadByte(((Byte *)data)[processedSize]))
- return;
- }
- bool ReadBytes(void *data, UInt32 size)
- {
- UInt32 processedSize;
- ReadBytes(data, size, processedSize);
- return (processedSize == size);
- }
- UInt64 GetProcessedSize() const { return _processedSize + (_buffer - _bufferBase); }
- bool WasFinished() const { return _wasFinished; }
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.cpp b/other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.cpp
deleted file mode 100644
index 06fde8ff33..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-// InOutTempBuffer.cpp
-
-#include "StdAfx.h"
-
-#include "InOutTempBuffer.h"
-#include "../../Common/Defs.h"
-// #include "Windows/Defs.h"
-
-#include "StreamUtils.h"
-
-using namespace NWindows;
-using namespace NFile;
-using namespace NDirectory;
-
-static UInt32 kTmpBufferMemorySize = (1 << 20);
-
-static LPCTSTR kTempFilePrefixString = TEXT("iot");
-
-CInOutTempBuffer::CInOutTempBuffer():
- _buffer(NULL)
-{
-}
-
-void CInOutTempBuffer::Create()
-{
- _buffer = new Byte[kTmpBufferMemorySize];
-}
-
-CInOutTempBuffer::~CInOutTempBuffer()
-{
- delete []_buffer;
-}
-void CInOutTempBuffer::InitWriting()
-{
- _bufferPosition = 0;
- _tmpFileCreated = false;
- _fileSize = 0;
-}
-
-bool CInOutTempBuffer::WriteToFile(const void *data, UInt32 size)
-{
- if (size == 0)
- return true;
- if(!_tmpFileCreated)
- {
- CSysString tempDirPath;
- if(!MyGetTempPath(tempDirPath))
- return false;
- if (_tempFile.Create(tempDirPath, kTempFilePrefixString, _tmpFileName) == 0)
- return false;
- // _outFile.SetOpenCreationDispositionCreateAlways();
- if(!_outFile.Create(_tmpFileName, true))
- return false;
- _tmpFileCreated = true;
- }
- UInt32 processedSize;
- if(!_outFile.Write(data, size, processedSize))
- return false;
- _fileSize += processedSize;
- return (processedSize == size);
-}
-
-bool CInOutTempBuffer::FlushWrite()
-{
- return _outFile.Close();
-}
-
-bool CInOutTempBuffer::Write(const void *data, UInt32 size)
-{
- if(_bufferPosition < kTmpBufferMemorySize)
- {
- UInt32 curSize = MyMin(kTmpBufferMemorySize - _bufferPosition, size);
- memmove(_buffer + _bufferPosition, (const Byte *)data, curSize);
- _bufferPosition += curSize;
- size -= curSize;
- data = ((const Byte *)data) + curSize;
- _fileSize += curSize;
- }
- return WriteToFile(data, size);
-}
-
-bool CInOutTempBuffer::InitReading()
-{
- _currentPositionInBuffer = 0;
- if(_tmpFileCreated)
- return _inFile.Open(_tmpFileName);
- return true;
-}
-
-HRESULT CInOutTempBuffer::WriteToStream(ISequentialOutStream *stream)
-{
- if (_currentPositionInBuffer < _bufferPosition)
- {
- UInt32 sizeToWrite = _bufferPosition - _currentPositionInBuffer;
- RINOK(WriteStream(stream, _buffer + _currentPositionInBuffer, sizeToWrite, NULL));
- _currentPositionInBuffer += sizeToWrite;
- }
- if (!_tmpFileCreated)
- return true;
- while(true)
- {
- UInt32 localProcessedSize;
- if (!_inFile.ReadPart(_buffer, kTmpBufferMemorySize, localProcessedSize))
- return E_FAIL;
- if (localProcessedSize == 0)
- return S_OK;
- RINOK(WriteStream(stream, _buffer, localProcessedSize, NULL));
- }
-}
-
-STDMETHODIMP CSequentialOutTempBufferImp::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- if (!_buffer->Write(data, size))
- {
- if (processedSize != NULL)
- *processedSize = 0;
- return E_FAIL;
- }
- if (processedSize != NULL)
- *processedSize = size;
- return S_OK;
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.h b/other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.h
deleted file mode 100644
index 17f3e8826a..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/InOutTempBuffer.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Util/InOutTempBuffer.h
-
-#ifndef __IN_OUT_TEMP_BUFFER_H
-#define __IN_OUT_TEMP_BUFFER_H
-
-#include "../../Windows/FileIO.h"
-#include "../../Windows/FileDir.h"
-#include "../../Common/MyCom.h"
-
-#include "../IStream.h"
-
-class CInOutTempBuffer
-{
- NWindows::NFile::NDirectory::CTempFile _tempFile;
- NWindows::NFile::NIO::COutFile _outFile;
- NWindows::NFile::NIO::CInFile _inFile;
- Byte *_buffer;
- UInt32 _bufferPosition;
- UInt32 _currentPositionInBuffer;
- CSysString _tmpFileName;
- bool _tmpFileCreated;
-
- UInt64 _fileSize;
-
- bool WriteToFile(const void *data, UInt32 size);
-public:
- CInOutTempBuffer();
- ~CInOutTempBuffer();
- void Create();
-
- void InitWriting();
- bool Write(const void *data, UInt32 size);
- UInt64 GetDataSize() const { return _fileSize; }
- bool FlushWrite();
- bool InitReading();
- HRESULT WriteToStream(ISequentialOutStream *stream);
-};
-
-class CSequentialOutTempBufferImp:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
- CInOutTempBuffer *_buffer;
-public:
- // CSequentialOutStreamImp(): _size(0) {}
- // UInt32 _size;
- void Init(CInOutTempBuffer *buffer) { _buffer = buffer; }
- // UInt32 GetSize() const { return _size; }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/LSBFDecoder.cpp b/other-licenses/7zstub/src/7zip/Common/LSBFDecoder.cpp
deleted file mode 100644
index ada5890be8..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LSBFDecoder.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-// Stream/LSBFDecoder.cpp
-
-#include "StdAfx.h"
-
-#include "LSBFDecoder.h"
-
-namespace NStream {
-namespace NLSBF {
-
-Byte kInvertTable[256];
-
-class CInverterTableInitializer
-{
-public:
- CInverterTableInitializer()
- {
- for(int i = 0; i < 256; i++)
- {
- Byte b = Byte(i);
- Byte bInvert = 0;
- for(int j = 0; j < 8; j++)
- {
- bInvert <<= 1;
- if (b & 1)
- bInvert |= 1;
- b >>= 1;
- }
- kInvertTable[i] = bInvert;
- }
- }
-} g_InverterTableInitializer;
-
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Common/LSBFDecoder.h b/other-licenses/7zstub/src/7zip/Common/LSBFDecoder.h
deleted file mode 100644
index 6e506859c6..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LSBFDecoder.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// LSBFDecoder.h
-
-#ifndef __STREAM_LSBFDECODER_H
-#define __STREAM_LSBFDECODER_H
-
-#include "../IStream.h"
-
-namespace NStream {
-namespace NLSBF {
-
-const int kNumBigValueBits = 8 * 4;
-
-const int kNumValueBytes = 3;
-const int kNumValueBits = 8 * kNumValueBytes;
-
-const UInt32 kMask = (1 << kNumValueBits) - 1;
-
-extern Byte kInvertTable[256];
-// the Least Significant Bit of byte is First
-
-template<class TInByte>
-class CBaseDecoder
-{
-protected:
- int m_BitPos;
- UInt32 m_Value;
- TInByte m_Stream;
-public:
- UInt32 NumExtraBytes;
- bool Create(UInt32 bufferSize) { return m_Stream.Create(bufferSize); }
- void SetStream(ISequentialInStream *inStream) { m_Stream.SetStream(inStream); }
- void ReleaseStream() { m_Stream.ReleaseStream(); }
- void Init()
- {
- m_Stream.Init();
- m_BitPos = kNumBigValueBits;
- m_Value = 0;
- NumExtraBytes = 0;
- }
- UInt64 GetProcessedSize() const
- { return m_Stream.GetProcessedSize() - (kNumBigValueBits - m_BitPos) / 8; }
- UInt64 GetProcessedBitsSize() const
- { return (m_Stream.GetProcessedSize() << 3) - (kNumBigValueBits - m_BitPos); }
- int GetBitPosition() const { return (m_BitPos & 7); }
-
- void Normalize()
- {
- for (;m_BitPos >= 8; m_BitPos -= 8)
- {
- Byte b;
- if (!m_Stream.ReadByte(b))
- {
- b = 0xFF; // check it
- NumExtraBytes++;
- }
- m_Value = (b << (kNumBigValueBits - m_BitPos)) | m_Value;
- }
- }
-
- UInt32 ReadBits(int numBits)
- {
- Normalize();
- UInt32 res = m_Value & ((1 << numBits) - 1);
- m_BitPos += numBits;
- m_Value >>= numBits;
- return res;
- }
-
- bool ExtraBitsWereRead() const
- {
- if (NumExtraBytes == 0)
- return false;
- return ((UInt32)(kNumBigValueBits - m_BitPos) < (NumExtraBytes << 3));
- }
-};
-
-template<class TInByte>
-class CDecoder: public CBaseDecoder<TInByte>
-{
- UInt32 m_NormalValue;
-
-public:
- void Init()
- {
- CBaseDecoder<TInByte>::Init();
- m_NormalValue = 0;
- }
-
- void Normalize()
- {
- for (;this->m_BitPos >= 8; this->m_BitPos -= 8)
- {
- Byte b;
- if (!this->m_Stream.ReadByte(b))
- {
- b = 0xFF; // check it
- this->NumExtraBytes++;
- }
- m_NormalValue = (b << (kNumBigValueBits - this->m_BitPos)) | m_NormalValue;
- this->m_Value = (this->m_Value << 8) | kInvertTable[b];
- }
- }
-
- UInt32 GetValue(int numBits)
- {
- Normalize();
- return ((this->m_Value >> (8 - this->m_BitPos)) & kMask) >> (kNumValueBits - numBits);
- }
-
- void MovePos(int numBits)
- {
- this->m_BitPos += numBits;
- m_NormalValue >>= numBits;
- }
-
- UInt32 ReadBits(int numBits)
- {
- Normalize();
- UInt32 res = m_NormalValue & ( (1 << numBits) - 1);
- MovePos(numBits);
- return res;
- }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/LSBFEncoder.cpp b/other-licenses/7zstub/src/7zip/Common/LSBFEncoder.cpp
deleted file mode 100644
index a0ed300c6e..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LSBFEncoder.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-// LSBFEncoder.cpp
-
-#include "StdAfx.h"
-
-#include "LSBFEncoder.h"
-#include "Common/Defs.h"
-
-namespace NStream {
-namespace NLSBF {
-
-void CEncoder::WriteBits(UInt32 value, int numBits)
-{
- while(numBits > 0)
- {
- if (numBits < m_BitPos)
- {
- m_CurByte |= (value & ((1 << numBits) - 1)) << (8 - m_BitPos);
- m_BitPos -= numBits;
- return;
- }
- numBits -= m_BitPos;
- m_Stream.WriteByte((Byte)(m_CurByte | (value << (8 - m_BitPos))));
- value >>= m_BitPos;
- m_BitPos = 8;
- m_CurByte = 0;
- }
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Common/LSBFEncoder.h b/other-licenses/7zstub/src/7zip/Common/LSBFEncoder.h
deleted file mode 100644
index 1c50b8e766..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LSBFEncoder.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Stream/LSBFEncoder.h
-
-#ifndef __STREAM_LSBFENCODER_H
-#define __STREAM_LSBFENCODER_H
-
-#include "../IStream.h"
-#include "OutBuffer.h"
-
-namespace NStream {
-namespace NLSBF {
-
-class CEncoder
-{
- COutBuffer m_Stream;
- int m_BitPos;
- Byte m_CurByte;
-public:
- bool Create(UInt32 bufferSize) { return m_Stream.Create(bufferSize); }
- void SetStream(ISequentialOutStream *outStream) { m_Stream.SetStream(outStream); }
- void ReleaseStream() { m_Stream.ReleaseStream(); }
- void Init()
- {
- m_Stream.Init();
- m_BitPos = 8;
- m_CurByte = 0;
- }
- HRESULT Flush()
- {
- FlushByte();
- return m_Stream.Flush();
- }
-
- void FlushByte()
- {
- if(m_BitPos < 8)
- m_Stream.WriteByte(m_CurByte);
- m_BitPos = 8;
- m_CurByte = 0;
- }
-
- void WriteBits(UInt32 value, int numBits);
- UInt32 GetBitPosition() const { return (8 - m_BitPos); }
- UInt64 GetProcessedSize() const {
- return m_Stream.GetProcessedSize() + (8 - m_BitPos + 7) /8; }
- void WriteByte(Byte b) { m_Stream.WriteByte(b);}
-};
-
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/LimitedStreams.cpp b/other-licenses/7zstub/src/7zip/Common/LimitedStreams.cpp
deleted file mode 100644
index c210c9560d..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LimitedStreams.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// LimitedStreams.cpp
-
-#include "StdAfx.h"
-
-#include "LimitedStreams.h"
-#include "../../Common/Defs.h"
-
-void CLimitedSequentialInStream::Init(ISequentialInStream *stream, UInt64 streamSize)
-{
- _stream = stream;
- _size = streamSize;
-}
-
-STDMETHODIMP CLimitedSequentialInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 processedSizeReal;
- UInt32 sizeToRead = UInt32(MyMin(_size, UInt64(size)));
- HRESULT result = _stream->Read(data, sizeToRead, &processedSizeReal);
- _size -= processedSizeReal;
- if(processedSize != NULL)
- *processedSize = processedSizeReal;
- return result;
-}
-
diff --git a/other-licenses/7zstub/src/7zip/Common/LimitedStreams.h b/other-licenses/7zstub/src/7zip/Common/LimitedStreams.h
deleted file mode 100644
index 7658b620d1..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LimitedStreams.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// LimitedStreams.h
-
-#ifndef __LIMITEDSTREAMS_H
-#define __LIMITEDSTREAMS_H
-
-#include "../../Common/MyCom.h"
-#include "../IStream.h"
-
-class CLimitedSequentialInStream:
- public ISequentialInStream,
- public CMyUnknownImp
-{
- UInt64 _size;
- CMyComPtr<ISequentialInStream> _stream;
-public:
- void Init(ISequentialInStream *stream, UInt64 streamSize);
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/LockedStream.cpp b/other-licenses/7zstub/src/7zip/Common/LockedStream.cpp
deleted file mode 100644
index 637c8980cd..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LockedStream.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// LockedStream.cpp
-
-#include "StdAfx.h"
-
-#include "LockedStream.h"
-
-HRESULT CLockedInStream::Read(UInt64 startPos, void *data, UInt32 size,
- UInt32 *processedSize)
-{
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- RINOK(_stream->Seek(startPos, STREAM_SEEK_SET, NULL));
- return _stream->Read(data, size, processedSize);
-}
-
-STDMETHODIMP CLockedSequentialInStreamImp::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize = 0;
- HRESULT result = _lockedInStream->Read(_pos, data, size, &realProcessedSize);
- _pos += realProcessedSize;
- if (processedSize != NULL)
- *processedSize = realProcessedSize;
- return result;
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/LockedStream.h b/other-licenses/7zstub/src/7zip/Common/LockedStream.h
deleted file mode 100644
index d61f6a3723..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/LockedStream.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// LockedStream.h
-
-#ifndef __LOCKEDSTREAM_H
-#define __LOCKEDSTREAM_H
-
-#include "../../Windows/Synchronization.h"
-#include "../../Common/MyCom.h"
-#include "../IStream.h"
-
-class CLockedInStream
-{
- CMyComPtr<IInStream> _stream;
- NWindows::NSynchronization::CCriticalSection _criticalSection;
-public:
- void Init(IInStream *stream)
- { _stream = stream; }
- HRESULT Read(UInt64 startPos, void *data, UInt32 size, UInt32 *processedSize);
-};
-
-class CLockedSequentialInStreamImp:
- public ISequentialInStream,
- public CMyUnknownImp
-{
- CLockedInStream *_lockedInStream;
- UInt64 _pos;
-public:
- void Init(CLockedInStream *lockedInStream, UInt64 startPos)
- {
- _lockedInStream = lockedInStream;
- _pos = startPos;
- }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/MSBFDecoder.h b/other-licenses/7zstub/src/7zip/Common/MSBFDecoder.h
deleted file mode 100644
index dad00ecab6..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/MSBFDecoder.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// MSBFDecoder.h
-// the Most Significant Bit of byte is First
-
-#ifndef __STREAM_MSBFDECODER_H
-#define __STREAM_MSBFDECODER_H
-
-#include "../../Common/Types.h"
-#include "../IStream.h"
-
-namespace NStream {
-namespace NMSBF {
-
-const int kNumBigValueBits = 8 * 4;
-const int kNumValueBytes = 3;
-const int kNumValueBits = 8 * kNumValueBytes;
-
-const UInt32 kMask = (1 << kNumValueBits) - 1;
-
-template<class TInByte>
-class CDecoder
-{
- UInt32 m_BitPos;
- UInt32 m_Value;
-public:
- TInByte m_Stream;
- bool Create(UInt32 bufferSize) { return m_Stream.Create(bufferSize); }
- void SetStream(ISequentialInStream *inStream) { m_Stream.SetStream(inStream);}
- void ReleaseStream() { m_Stream.ReleaseStream();}
-
- void Init()
- {
- m_Stream.Init();
- m_BitPos = kNumBigValueBits;
- Normalize();
- }
-
- UInt64 GetProcessedSize() const
- { return m_Stream.GetProcessedSize() - (kNumBigValueBits - m_BitPos) / 8; }
- UInt32 GetBitPosition() const { return (m_BitPos & 7); }
-
- void Normalize()
- {
- for (;m_BitPos >= 8; m_BitPos -= 8)
- m_Value = (m_Value << 8) | m_Stream.ReadByte();
- }
-
- UInt32 GetValue(UInt32 numBits) const
- {
- // return (m_Value << m_BitPos) >> (kNumBigValueBits - numBits);
- return ((m_Value >> (8 - m_BitPos)) & kMask) >> (kNumValueBits - numBits);
- }
-
- void MovePos(UInt32 numBits)
- {
- m_BitPos += numBits;
- Normalize();
- }
-
- UInt32 ReadBits(UInt32 numBits)
- {
- UInt32 res = GetValue(numBits);
- MovePos(numBits);
- return res;
- }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/MSBFEncoder.h b/other-licenses/7zstub/src/7zip/Common/MSBFEncoder.h
deleted file mode 100644
index b141e55459..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/MSBFEncoder.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Stream/MSBFEncoder.h
-
-#ifndef __STREAM_MSBFENCODER_H
-#define __STREAM_MSBFENCODER_H
-
-#include "Common/Defs.h"
-#include "../IStream.h"
-#include "OutBuffer.h"
-
-namespace NStream {
-namespace NMSBF {
-
-template<class TOutByte>
-class CEncoder
-{
- TOutByte m_Stream;
- int m_BitPos;
- Byte m_CurByte;
-public:
- bool Create(UInt32 bufferSize) { return m_Stream.Create(bufferSize); }
- void SetStream(ISequentialOutStream *outStream) { m_Stream.SetStream(outStream);}
- void ReleaseStream() { m_Stream.ReleaseStream(); }
- void Init()
- {
- m_Stream.Init();
- m_BitPos = 8;
- m_CurByte = 0;
- }
- HRESULT Flush()
- {
- if(m_BitPos < 8)
- WriteBits(0, m_BitPos);
- return m_Stream.Flush();
- }
-
- void WriteBits(UInt32 value, int numBits)
- {
- while(numBits > 0)
- {
- if (numBits < m_BitPos)
- {
- m_CurByte |= ((Byte)value << (m_BitPos -= numBits));
- return;
- }
- numBits -= m_BitPos;
- UInt32 newBits = (value >> numBits);
- value -= (newBits << numBits);
- m_Stream.WriteByte(m_CurByte | (Byte)newBits);
- m_BitPos = 8;
- m_CurByte = 0;
- }
- }
- UInt64 GetProcessedSize() const {
- return m_Stream.GetProcessedSize() + (8 - m_BitPos + 7) / 8; }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/OffsetStream.cpp b/other-licenses/7zstub/src/7zip/Common/OffsetStream.cpp
deleted file mode 100644
index 177401f383..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/OffsetStream.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-// OffsetStream.cpp
-
-#include "StdAfx.h"
-
-#include "Common/Defs.h"
-#include "OffsetStream.h"
-
-HRESULT COffsetOutStream::Init(IOutStream *stream, UInt64 offset)
-{
- _offset = offset;
- _stream = stream;
- return _stream->Seek(offset, STREAM_SEEK_SET, NULL);
-}
-
-STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- return _stream->Write(data, size, processedSize);
-}
-
-STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin,
- UInt64 *newPosition)
-{
- UInt64 absoluteNewPosition;
- if (seekOrigin == STREAM_SEEK_SET)
- offset += _offset;
- HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
- if (newPosition != NULL)
- *newPosition = absoluteNewPosition - _offset;
- return result;
-}
-
-STDMETHODIMP COffsetOutStream::SetSize(Int64 newSize)
-{
- return _stream->SetSize(_offset + newSize);
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/OffsetStream.h b/other-licenses/7zstub/src/7zip/Common/OffsetStream.h
deleted file mode 100644
index 6eaa25928e..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/OffsetStream.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// OffsetStream.h
-
-#ifndef __OFFSETSTREAM_H
-#define __OFFSETSTREAM_H
-
-#include "Common/MyCom.h"
-#include "../IStream.h"
-
-class COffsetOutStream:
- public IOutStream,
- public CMyUnknownImp
-{
- UInt64 _offset;
- CMyComPtr<IOutStream> _stream;
-public:
- HRESULT Init(IOutStream *stream, UInt64 offset);
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
- STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
- STDMETHOD(SetSize)(Int64 newSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/OutBuffer.cpp b/other-licenses/7zstub/src/7zip/Common/OutBuffer.cpp
deleted file mode 100644
index 45da6d7f00..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/OutBuffer.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-// OutByte.cpp
-
-#include "StdAfx.h"
-
-#include "OutBuffer.h"
-
-#include "../../Common/Alloc.h"
-
-bool COutBuffer::Create(UInt32 bufferSize)
-{
- const UInt32 kMinBlockSize = 1;
- if (bufferSize < kMinBlockSize)
- bufferSize = kMinBlockSize;
- if (_buffer != 0 && _bufferSize == bufferSize)
- return true;
- Free();
- _bufferSize = bufferSize;
- _buffer = (Byte *)::MidAlloc(bufferSize);
- return (_buffer != 0);
-}
-
-void COutBuffer::Free()
-{
- ::MidFree(_buffer);
- _buffer = 0;
-}
-
-void COutBuffer::SetStream(ISequentialOutStream *stream)
-{
- _stream = stream;
-}
-
-void COutBuffer::Init()
-{
- _streamPos = 0;
- _limitPos = _bufferSize;
- _pos = 0;
- _processedSize = 0;
- _overDict = false;
- #ifdef _NO_EXCEPTIONS
- ErrorCode = S_OK;
- #endif
-}
-
-UInt64 COutBuffer::GetProcessedSize() const
-{
- UInt64 res = _processedSize + _pos - _streamPos;
- if (_streamPos > _pos)
- res += _bufferSize;
- return res;
-}
-
-
-HRESULT COutBuffer::FlushPart()
-{
- // _streamPos < _bufferSize
- UInt32 size = (_streamPos >= _pos) ? (_bufferSize - _streamPos) : (_pos - _streamPos);
- HRESULT result = S_OK;
- #ifdef _NO_EXCEPTIONS
- result = ErrorCode;
- #endif
- if (_buffer2 != 0)
- {
- memmove(_buffer2, _buffer + _streamPos, size);
- _buffer2 += size;
- }
-
- if (_stream != 0
- #ifdef _NO_EXCEPTIONS
- && (ErrorCode == S_OK)
- #endif
- )
- {
- UInt32 processedSize = 0;
- result = _stream->Write(_buffer + _streamPos, size, &processedSize);
- size = processedSize;
- }
- _streamPos += size;
- if (_streamPos == _bufferSize)
- _streamPos = 0;
- if (_pos == _bufferSize)
- {
- _overDict = true;
- _pos = 0;
- }
- _limitPos = (_streamPos > _pos) ? _streamPos : _bufferSize;
- _processedSize += size;
- return result;
-}
-
-HRESULT COutBuffer::Flush()
-{
- #ifdef _NO_EXCEPTIONS
- if (ErrorCode != S_OK)
- return ErrorCode;
- #endif
-
- while(_streamPos != _pos)
- {
- HRESULT result = FlushPart();
- if (result != S_OK)
- return result;
- }
- return S_OK;
-}
-
-void COutBuffer::FlushWithCheck()
-{
- HRESULT result = FlushPart();
- #ifdef _NO_EXCEPTIONS
- ErrorCode = result;
- #else
- if (result != S_OK)
- throw COutBufferException(result);
- #endif
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/OutBuffer.h b/other-licenses/7zstub/src/7zip/Common/OutBuffer.h
deleted file mode 100644
index 37eefbdfcd..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/OutBuffer.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// OutBuffer.h
-
-#ifndef __OUTBUFFER_H
-#define __OUTBUFFER_H
-
-#include "../IStream.h"
-#include "../../Common/MyCom.h"
-
-#ifndef _NO_EXCEPTIONS
-struct COutBufferException
-{
- HRESULT ErrorCode;
- COutBufferException(HRESULT errorCode): ErrorCode(errorCode) {}
-};
-#endif
-
-class COutBuffer
-{
-protected:
- Byte *_buffer;
- UInt32 _pos;
- UInt32 _limitPos;
- UInt32 _streamPos;
- UInt32 _bufferSize;
- CMyComPtr<ISequentialOutStream> _stream;
- UInt64 _processedSize;
- Byte *_buffer2;
- bool _overDict;
-
- HRESULT FlushPart();
- void FlushWithCheck();
-public:
- #ifdef _NO_EXCEPTIONS
- HRESULT ErrorCode;
- #endif
-
- COutBuffer(): _buffer(0), _pos(0), _stream(0), _buffer2(0) {}
- ~COutBuffer() { Free(); }
-
- bool Create(UInt32 bufferSize);
- void Free();
-
- void SetMemStream(Byte *buffer) { _buffer2 = buffer; }
- void SetStream(ISequentialOutStream *stream);
- void Init();
- HRESULT Flush();
- void ReleaseStream() { _stream.Release(); }
-
- void WriteByte(Byte b)
- {
- _buffer[_pos++] = b;
- if(_pos == _limitPos)
- FlushWithCheck();
- }
- void WriteBytes(const void *data, size_t size)
- {
- for (size_t i = 0; i < size; i++)
- WriteByte(((const Byte *)data)[i]);
- }
-
- UInt64 GetProcessedSize() const;
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/ProgressUtils.cpp b/other-licenses/7zstub/src/7zip/Common/ProgressUtils.cpp
deleted file mode 100644
index ac598cd545..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/ProgressUtils.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// ProgressUtils.h
-
-#include "StdAfx.h"
-
-#include "ProgressUtils.h"
-
-void CLocalCompressProgressInfo::Init(ICompressProgressInfo *progress,
- const UInt64 *inStartValue, const UInt64 *outStartValue)
-{
- _progress = progress;
- _inStartValueIsAssigned = (inStartValue != NULL);
- if (_inStartValueIsAssigned)
- _inStartValue = *inStartValue;
- _outStartValueIsAssigned = (outStartValue != NULL);
- if (_outStartValueIsAssigned)
- _outStartValue = *outStartValue;
-}
-
-STDMETHODIMP CLocalCompressProgressInfo::SetRatioInfo(
- const UInt64 *inSize, const UInt64 *outSize)
-{
- UInt64 inSizeNew, outSizeNew;
- const UInt64 *inSizeNewPointer;
- const UInt64 *outSizeNewPointer;
- if (_inStartValueIsAssigned && inSize != NULL)
- {
- inSizeNew = _inStartValue + (*inSize);
- inSizeNewPointer = &inSizeNew;
- }
- else
- inSizeNewPointer = NULL;
-
- if (_outStartValueIsAssigned && outSize != NULL)
- {
- outSizeNew = _outStartValue + (*outSize);
- outSizeNewPointer = &outSizeNew;
- }
- else
- outSizeNewPointer = NULL;
- return _progress->SetRatioInfo(inSizeNewPointer, outSizeNewPointer);
-}
-
-
-///////////////////////////////////
-//
-
-void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
-{
- _progress = progress;
- _inSizeIsMain = inSizeIsMain;
-}
-
-STDMETHODIMP CLocalProgress::SetRatioInfo(
- const UInt64 *inSize, const UInt64 *outSize)
-{
- return _progress->SetCompleted(_inSizeIsMain ? inSize : outSize);
-}
-
diff --git a/other-licenses/7zstub/src/7zip/Common/ProgressUtils.h b/other-licenses/7zstub/src/7zip/Common/ProgressUtils.h
deleted file mode 100644
index 92e628528d..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/ProgressUtils.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// ProgressUtils.h
-
-#ifndef __PROGRESSUTILS_H
-#define __PROGRESSUTILS_H
-
-#include "../../Common/MyCom.h"
-
-#include "../ICoder.h"
-#include "../IProgress.h"
-
-class CLocalCompressProgressInfo:
- public ICompressProgressInfo,
- public CMyUnknownImp
-{
- CMyComPtr<ICompressProgressInfo> _progress;
- bool _inStartValueIsAssigned;
- bool _outStartValueIsAssigned;
- UInt64 _inStartValue;
- UInt64 _outStartValue;
-public:
- void Init(ICompressProgressInfo *progress,
- const UInt64 *inStartValue, const UInt64 *outStartValue);
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
-};
-
-class CLocalProgress:
- public ICompressProgressInfo,
- public CMyUnknownImp
-{
- CMyComPtr<IProgress> _progress;
- bool _inSizeIsMain;
-public:
- void Init(IProgress *progress, bool inSizeIsMain);
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/StdAfx.h b/other-licenses/7zstub/src/7zip/Common/StdAfx.h
deleted file mode 100644
index d7d9211b09..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StdAfx.h
+++ /dev/null
@@ -1,9 +0,0 @@
-// StdAfx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#include "../../Common/MyWindows.h"
-#include "../../Common/NewHandler.h"
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/StreamBinder.cpp b/other-licenses/7zstub/src/7zip/Common/StreamBinder.cpp
deleted file mode 100644
index dc11de8e5a..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StreamBinder.cpp
+++ /dev/null
@@ -1,162 +0,0 @@
-// StreamBinder.cpp
-
-#include "StdAfx.h"
-
-#include "StreamBinder.h"
-#include "../../Common/Defs.h"
-#include "../../Common/MyCom.h"
-
-using namespace NWindows;
-using namespace NSynchronization;
-
-class CSequentialInStreamForBinder:
- public ISequentialInStream,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
-private:
- CStreamBinder *m_StreamBinder;
-public:
- ~CSequentialInStreamForBinder() { m_StreamBinder->CloseRead(); }
- void SetBinder(CStreamBinder *streamBinder) { m_StreamBinder = streamBinder; }
-};
-
-STDMETHODIMP CSequentialInStreamForBinder::Read(void *data, UInt32 size, UInt32 *processedSize)
- { return m_StreamBinder->Read(data, size, processedSize); }
-
-class CSequentialOutStreamForBinder:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
-public:
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-
-private:
- CStreamBinder *m_StreamBinder;
-public:
- ~CSequentialOutStreamForBinder() { m_StreamBinder->CloseWrite(); }
- void SetBinder(CStreamBinder *streamBinder) { m_StreamBinder = streamBinder; }
-};
-
-STDMETHODIMP CSequentialOutStreamForBinder::Write(const void *data, UInt32 size, UInt32 *processedSize)
- { return m_StreamBinder->Write(data, size, processedSize); }
-
-
-//////////////////////////
-// CStreamBinder
-// (_thereAreBytesToReadEvent && _bufferSize == 0) means that stream is finished.
-
-void CStreamBinder::CreateEvents()
-{
- _allBytesAreWritenEvent = new CManualResetEvent(true);
- _thereAreBytesToReadEvent = new CManualResetEvent(false);
- _readStreamIsClosedEvent = new CManualResetEvent(false);
-}
-
-void CStreamBinder::ReInit()
-{
- _thereAreBytesToReadEvent->Reset();
- _readStreamIsClosedEvent->Reset();
- ProcessedSize = 0;
-}
-
-CStreamBinder::~CStreamBinder()
-{
- if (_allBytesAreWritenEvent != NULL)
- delete _allBytesAreWritenEvent;
- if (_thereAreBytesToReadEvent != NULL)
- delete _thereAreBytesToReadEvent;
- if (_readStreamIsClosedEvent != NULL)
- delete _readStreamIsClosedEvent;
-}
-
-
-
-
-void CStreamBinder::CreateStreams(ISequentialInStream **inStream,
- ISequentialOutStream **outStream)
-{
- CSequentialInStreamForBinder *inStreamSpec = new
- CSequentialInStreamForBinder;
- CMyComPtr<ISequentialInStream> inStreamLoc(inStreamSpec);
- inStreamSpec->SetBinder(this);
- *inStream = inStreamLoc.Detach();
-
- CSequentialOutStreamForBinder *outStreamSpec = new
- CSequentialOutStreamForBinder;
- CMyComPtr<ISequentialOutStream> outStreamLoc(outStreamSpec);
- outStreamSpec->SetBinder(this);
- *outStream = outStreamLoc.Detach();
-
- _buffer = NULL;
- _bufferSize= 0;
- ProcessedSize = 0;
-}
-
-HRESULT CStreamBinder::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 sizeToRead = size;
- if (size > 0)
- {
- if(!_thereAreBytesToReadEvent->Lock())
- return E_FAIL;
- sizeToRead = MyMin(_bufferSize, size);
- if (_bufferSize > 0)
- {
- MoveMemory(data, _buffer, sizeToRead);
- _buffer = ((const Byte *)_buffer) + sizeToRead;
- _bufferSize -= sizeToRead;
- if (_bufferSize == 0)
- {
- _thereAreBytesToReadEvent->Reset();
- _allBytesAreWritenEvent->Set();
- }
- }
- }
- if (processedSize != NULL)
- *processedSize = sizeToRead;
- ProcessedSize += sizeToRead;
- return S_OK;
-}
-
-void CStreamBinder::CloseRead()
-{
- _readStreamIsClosedEvent->Set();
-}
-
-HRESULT CStreamBinder::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- if (size > 0)
- {
- _buffer = data;
- _bufferSize = size;
- _allBytesAreWritenEvent->Reset();
- _thereAreBytesToReadEvent->Set();
-
- HANDLE events[2];
- events[0] = *_allBytesAreWritenEvent;
- events[1] = *_readStreamIsClosedEvent;
- DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
- if (waitResult != WAIT_OBJECT_0 + 0)
- {
- // ReadingWasClosed = true;
- return E_FAIL;
- }
- // if(!_allBytesAreWritenEvent.Lock())
- // return E_FAIL;
- }
- if (processedSize != NULL)
- *processedSize = size;
- return S_OK;
-}
-
-void CStreamBinder::CloseWrite()
-{
- // _bufferSize must be = 0
- _thereAreBytesToReadEvent->Set();
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/StreamBinder.h b/other-licenses/7zstub/src/7zip/Common/StreamBinder.h
deleted file mode 100644
index 7899f0ff04..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StreamBinder.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// StreamBinder.h
-
-#ifndef __STREAMBINDER_H
-#define __STREAMBINDER_H
-
-#include "../IStream.h"
-#include "../../Windows/Synchronization.h"
-
-class CStreamBinder
-{
- NWindows::NSynchronization::CManualResetEvent *_allBytesAreWritenEvent;
- NWindows::NSynchronization::CManualResetEvent *_thereAreBytesToReadEvent;
- NWindows::NSynchronization::CManualResetEvent *_readStreamIsClosedEvent;
- UInt32 _bufferSize;
- const void *_buffer;
-public:
- // bool ReadingWasClosed;
- UInt64 ProcessedSize;
- CStreamBinder():
- _allBytesAreWritenEvent(NULL),
- _thereAreBytesToReadEvent(NULL),
- _readStreamIsClosedEvent(NULL)
- {}
- ~CStreamBinder();
- void CreateEvents();
-
- void CreateStreams(ISequentialInStream **inStream,
- ISequentialOutStream **outStream);
- HRESULT Read(void *data, UInt32 size, UInt32 *processedSize);
- void CloseRead();
-
- HRESULT Write(const void *data, UInt32 size, UInt32 *processedSize);
- void CloseWrite();
- void ReInit();
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/StreamObjects.cpp b/other-licenses/7zstub/src/7zip/Common/StreamObjects.cpp
deleted file mode 100644
index 459df66cf8..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StreamObjects.cpp
+++ /dev/null
@@ -1,102 +0,0 @@
-// StreamObjects.cpp
-
-#include "StdAfx.h"
-
-#include "StreamObjects.h"
-#include "../../Common/Defs.h"
-
-
-STDMETHODIMP CSequentialInStreamImp::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 numBytesToRead = (UInt32)(MyMin(_pos + size, _size) - _pos);
- memmove(data, _dataPointer + _pos, numBytesToRead);
- _pos += numBytesToRead;
- if(processedSize != NULL)
- *processedSize = numBytesToRead;
- return S_OK;
-}
-
-
-void CWriteBuffer::Write(const void *data, size_t size)
-{
- size_t newCapacity = _size + size;
- _buffer.EnsureCapacity(newCapacity);
- memmove(_buffer + _size, data, size);
- _size += size;
-}
-
-STDMETHODIMP CSequentialOutStreamImp::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- _writeBuffer.Write(data, size);
- if(processedSize != NULL)
- *processedSize = size;
- return S_OK;
-}
-
-STDMETHODIMP CSequentialOutStreamImp2::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 newSize = size;
- if (_pos + size > _size)
- newSize = (UInt32)(_size - _pos);
- memmove(_buffer + _pos, data, newSize);
- if(processedSize != NULL)
- *processedSize = newSize;
- _pos += newSize;
- if (newSize != size)
- return E_FAIL;
- return S_OK;
-}
-
-STDMETHODIMP CSequentialInStreamSizeCount::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize;
- HRESULT result = _stream->Read(data, size, &realProcessedSize);
- _size += realProcessedSize;
- if (processedSize != 0)
- *processedSize = realProcessedSize;
- return result;
-}
-
-STDMETHODIMP CSequentialInStreamRollback::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- if (_currentPos != _currentSize)
- {
- size_t curSize = _currentSize - _currentPos;
- if (size > curSize)
- size = (UInt32)curSize;
- memmove(data, _buffer + _currentPos, size);
- _currentPos += size;
- if (processedSize != 0)
- *processedSize = size;
- return S_OK;
- }
- UInt32 realProcessedSize;
- if (size > _bufferSize)
- size = (UInt32)_bufferSize;
- HRESULT result = _stream->Read(_buffer, size, &realProcessedSize);
- memmove(data, _buffer, realProcessedSize);
- _size += realProcessedSize;
- _currentSize = realProcessedSize;
- _currentPos = realProcessedSize;
- if (processedSize != 0)
- *processedSize = realProcessedSize;
- return result;
-}
-
-HRESULT CSequentialInStreamRollback::Rollback(size_t rollbackSize)
-{
- if (rollbackSize > _currentPos)
- return E_INVALIDARG;
- _currentPos -= rollbackSize;
- return S_OK;
-}
-
-STDMETHODIMP CSequentialOutStreamSizeCount::Write(const void *data, UInt32 size, UInt32 *processedSize)
-{
- UInt32 realProcessedSize;
- HRESULT result = _stream->Write(data, size, &realProcessedSize);
- _size += realProcessedSize;
- if (processedSize != 0)
- *processedSize = realProcessedSize;
- return result;
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/StreamObjects.h b/other-licenses/7zstub/src/7zip/Common/StreamObjects.h
deleted file mode 100644
index b028a2114c..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StreamObjects.h
+++ /dev/null
@@ -1,156 +0,0 @@
-// StreamObjects.h
-
-#ifndef __STREAMOBJECTS_H
-#define __STREAMOBJECTS_H
-
-#include "../../Common/DynamicBuffer.h"
-#include "../../Common/MyCom.h"
-#include "../IStream.h"
-
-class CSequentialInStreamImp:
- public ISequentialInStream,
- public CMyUnknownImp
-{
- const Byte *_dataPointer;
- size_t _size;
- size_t _pos;
-
-public:
- void Init(const Byte *dataPointer, size_t size)
- {
- _dataPointer = dataPointer;
- _size = size;
- _pos = 0;
- }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
-};
-
-
-class CWriteBuffer
-{
- CByteDynamicBuffer _buffer;
- size_t _size;
-public:
- CWriteBuffer(): _size(0) {}
- void Init() { _size = 0; }
- void Write(const void *data, size_t size);
- size_t GetSize() const { return _size; }
- const CByteDynamicBuffer& GetBuffer() const { return _buffer; }
-};
-
-class CSequentialOutStreamImp:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
- CWriteBuffer _writeBuffer;
-public:
- void Init() { _writeBuffer.Init(); }
- size_t GetSize() const { return _writeBuffer.GetSize(); }
- const CByteDynamicBuffer& GetBuffer() const { return _writeBuffer.GetBuffer(); }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-};
-
-class CSequentialOutStreamImp2:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
- Byte *_buffer;
-public:
- size_t _size;
- size_t _pos;
-
- void Init(Byte *buffer, size_t size)
- {
- _buffer = buffer;
- _pos = 0;
- _size = size;
- }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-};
-
-class CSequentialInStreamSizeCount:
- public ISequentialInStream,
- public CMyUnknownImp
-{
- CMyComPtr<ISequentialInStream> _stream;
- UInt64 _size;
-public:
- void Init(ISequentialInStream *stream)
- {
- _stream = stream;
- _size = 0;
- }
- UInt64 GetSize() const { return _size; }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
-};
-
-class CSequentialInStreamRollback:
- public ISequentialInStream,
- public CMyUnknownImp
-{
- CMyComPtr<ISequentialInStream> _stream;
- Byte *_buffer;
- size_t _bufferSize;
- UInt64 _size;
-
- size_t _currentSize;
- size_t _currentPos;
-public:
- CSequentialInStreamRollback(size_t bufferSize):
- _bufferSize(bufferSize),
- _buffer(0)
- {
- _buffer = new Byte[bufferSize];
- }
- ~CSequentialInStreamRollback()
- {
- delete _buffer;
- }
-
- void Init(ISequentialInStream *stream)
- {
- _stream = stream;
- _size = 0;
- _currentSize = 0;
- _currentPos = 0;
- }
- UInt64 GetSize() const { return _size; }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
- HRESULT Rollback(size_t rollbackSize);
-};
-
-class CSequentialOutStreamSizeCount:
- public ISequentialOutStream,
- public CMyUnknownImp
-{
- CMyComPtr<ISequentialOutStream> _stream;
- UInt64 _size;
-public:
- void Init(ISequentialOutStream *stream)
- {
- _stream = stream;
- _size = 0;
- }
- UInt64 GetSize() const { return _size; }
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Common/StreamUtils.cpp b/other-licenses/7zstub/src/7zip/Common/StreamUtils.cpp
deleted file mode 100644
index 712a78585a..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StreamUtils.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// StreamUtils.cpp
-
-#include "StdAfx.h"
-
-#include "../../Common/MyCom.h"
-#include "StreamUtils.h"
-
-HRESULT ReadStream(ISequentialInStream *stream, void *data, UInt32 size, UInt32 *processedSize)
-{
- if (processedSize != 0)
- *processedSize = 0;
- while(size != 0)
- {
- UInt32 processedSizeLoc;
- HRESULT res = stream->Read(data, size, &processedSizeLoc);
- if (processedSize != 0)
- *processedSize += processedSizeLoc;
- data = (Byte *)((Byte *)data + processedSizeLoc);
- size -= processedSizeLoc;
- RINOK(res);
- if (processedSizeLoc == 0)
- return S_OK;
- }
- return S_OK;
-}
-
-HRESULT WriteStream(ISequentialOutStream *stream, const void *data, UInt32 size, UInt32 *processedSize)
-{
- if (processedSize != 0)
- *processedSize = 0;
- while(size != 0)
- {
- UInt32 processedSizeLoc;
- HRESULT res = stream->Write(data, size, &processedSizeLoc);
- if (processedSize != 0)
- *processedSize += processedSizeLoc;
- data = (const void *)((const Byte *)data + processedSizeLoc);
- size -= processedSizeLoc;
- RINOK(res);
- if (processedSizeLoc == 0)
- break;
- }
- return S_OK;
-}
diff --git a/other-licenses/7zstub/src/7zip/Common/StreamUtils.h b/other-licenses/7zstub/src/7zip/Common/StreamUtils.h
deleted file mode 100644
index c8cd8cef1a..0000000000
--- a/other-licenses/7zstub/src/7zip/Common/StreamUtils.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// StreamUtils.h
-
-#ifndef __STREAMUTILS_H
-#define __STREAMUTILS_H
-
-#include "../IStream.h"
-
-HRESULT ReadStream(ISequentialInStream *stream, void *data, UInt32 size, UInt32 *processedSize);
-HRESULT WriteStream(ISequentialOutStream *stream, const void *data, UInt32 size, UInt32 *processedSize);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.cpp b/other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.cpp
deleted file mode 100644
index 68e938bde9..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// BranchCoder.cpp
-
-#include "StdAfx.h"
-#include "BranchCoder.h"
-
-STDMETHODIMP CBranchConverter::Init()
-{
- _bufferPos = 0;
- SubInit();
- return S_OK;
-}
-
-STDMETHODIMP_(UInt32) CBranchConverter::Filter(Byte *data, UInt32 size)
-{
- UInt32 processedSize = SubFilter(data, size);
- _bufferPos += processedSize;
- return processedSize;
-}
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.h b/other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.h
deleted file mode 100644
index b64562dfc3..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchCoder.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// BranchCoder.h
-
-#ifndef __BRANCH_CODER_H
-#define __BRANCH_CODER_H
-
-#include "Common/MyCom.h"
-#include "Common/Types.h"
-#include "Common/Alloc.h"
-
-#include "../../ICoder.h"
-
-class CBranchConverter:
- public ICompressFilter,
- public CMyUnknownImp
-{
-protected:
- UInt32 _bufferPos;
- virtual void SubInit() {}
- virtual UInt32 SubFilter(Byte *data, UInt32 size) = 0;
-public:
- MY_UNKNOWN_IMP;
- STDMETHOD(Init)();
- STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size);
-};
-
-#define MyClassEncoderA(Name) class C ## Name: public CBranchConverter \
- { public: UInt32 SubFilter(Byte *data, UInt32 size); };
-
-#define MyClassDecoderA(Name) class C ## Name: public CBranchConverter \
- { public: UInt32 SubFilter(Byte *data, UInt32 size); };
-
-#define MyClassEncoderB(Name, ADD_ITEMS, ADD_INIT) class C ## Name: public CBranchConverter, public ADD_ITEMS \
- { public: UInt32 SubFilter(Byte *data, UInt32 size); ADD_INIT};
-
-#define MyClassDecoderB(Name, ADD_ITEMS, ADD_INIT) class C ## Name: public CBranchConverter, public ADD_ITEMS \
- { public: UInt32 SubFilter(Byte *data, UInt32 size); ADD_INIT};
-
-#define MyClass2b(Name, id, subId, encodingId) \
-DEFINE_GUID(CLSID_CCompressConvert ## Name, \
-0x23170F69, 0x40C1, 0x278B, 0x03, 0x03, id, subId, 0x00, 0x00, encodingId, 0x00);
-
-#define MyClassA(Name, id, subId) \
-MyClass2b(Name ## _Encoder, id, subId, 0x01) \
-MyClassEncoderA(Name ## _Encoder) \
-MyClass2b(Name ## _Decoder, id, subId, 0x00) \
-MyClassDecoderA(Name ## _Decoder)
-
-#define MyClassB(Name, id, subId, ADD_ITEMS, ADD_INIT) \
-MyClass2b(Name ## _Encoder, id, subId, 0x01) \
-MyClassEncoderB(Name ## _Encoder, ADD_ITEMS, ADD_INIT) \
-MyClass2b(Name ## _Decoder, id, subId, 0x00) \
-MyClassDecoderB(Name ## _Decoder, ADD_ITEMS, ADD_INIT)
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchTypes.h b/other-licenses/7zstub/src/7zip/Compress/Branch/BranchTypes.h
deleted file mode 100644
index 7300875625..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchTypes.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* BranchTypes.h */
-
-#ifndef __BRANCHTYPES_H
-#define __BRANCHTYPES_H
-
-typedef unsigned char Byte;
-typedef unsigned short UInt16;
-
-#ifdef _LZMA_UINT32_IS_ULONG
-typedef unsigned long UInt32;
-#else
-typedef unsigned int UInt32;
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.c b/other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.c
deleted file mode 100644
index 2d2c03d2d8..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/* BranchX86.c */
-
-#include "BranchX86.h"
-
-/*
-static int inline Test86MSByte(Byte b)
-{
- return (b == 0 || b == 0xFF);
-}
-*/
-#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
-
-const int kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
-const Byte kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
-
-/*
-void x86_Convert_Init(UInt32 *prevMask, UInt32 *prevPos)
-{
- *prevMask = 0;
- *prevPos = (UInt32)(-5);
-}
-*/
-
-UInt32 x86_Convert(Byte *buffer, UInt32 endPos, UInt32 nowPos,
- UInt32 *prevMask, UInt32 *prevPos, int encoding)
-{
- UInt32 bufferPos = 0;
- UInt32 limit;
-
- if (endPos < 5)
- return 0;
-
- if (nowPos - *prevPos > 5)
- *prevPos = nowPos - 5;
-
- limit = endPos - 5;
- while(bufferPos <= limit)
- {
- Byte b = buffer[bufferPos];
- UInt32 offset;
- if (b != 0xE8 && b != 0xE9)
- {
- bufferPos++;
- continue;
- }
- offset = (nowPos + bufferPos - *prevPos);
- *prevPos = (nowPos + bufferPos);
- if (offset > 5)
- *prevMask = 0;
- else
- {
- UInt32 i;
- for (i = 0; i < offset; i++)
- {
- *prevMask &= 0x77;
- *prevMask <<= 1;
- }
- }
- b = buffer[bufferPos + 4];
- if (Test86MSByte(b) && kMaskToAllowedStatus[(*prevMask >> 1) & 0x7] &&
- (*prevMask >> 1) < 0x10)
- {
- UInt32 src =
- ((UInt32)(b) << 24) |
- ((UInt32)(buffer[bufferPos + 3]) << 16) |
- ((UInt32)(buffer[bufferPos + 2]) << 8) |
- (buffer[bufferPos + 1]);
-
- UInt32 dest;
- while(1)
- {
- UInt32 index;
- if (encoding)
- dest = (nowPos + bufferPos + 5) + src;
- else
- dest = src - (nowPos + bufferPos + 5);
- if (*prevMask == 0)
- break;
- index = kMaskToBitNumber[*prevMask >> 1];
- b = (Byte)(dest >> (24 - index * 8));
- if (!Test86MSByte(b))
- break;
- src = dest ^ ((1 << (32 - index * 8)) - 1);
- }
- buffer[bufferPos + 4] = (Byte)(~(((dest >> 24) & 1) - 1));
- buffer[bufferPos + 3] = (Byte)(dest >> 16);
- buffer[bufferPos + 2] = (Byte)(dest >> 8);
- buffer[bufferPos + 1] = (Byte)dest;
- bufferPos += 5;
- *prevMask = 0;
- }
- else
- {
- bufferPos++;
- *prevMask |= 1;
- if (Test86MSByte(b))
- *prevMask |= 0x10;
- }
- }
- return bufferPos;
-}
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.h b/other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.h
deleted file mode 100644
index ff9c71cbe8..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/BranchX86.h
+++ /dev/null
@@ -1,13 +0,0 @@
-/* BranchX86.h */
-
-#ifndef __BRANCHX86_H
-#define __BRANCHX86_H
-
-#include "BranchTypes.h"
-
-#define x86_Convert_Init(prevMask, prevPos) { prevMask = 0; prevPos = (UInt32)(-5); }
-
-UInt32 x86_Convert(Byte *buffer, UInt32 endPos, UInt32 nowPos,
- UInt32 *prevMask, UInt32 *prevPos, int encoding);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/x86.cpp b/other-licenses/7zstub/src/7zip/Compress/Branch/x86.cpp
deleted file mode 100644
index 929484ad6d..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/x86.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-// x86.cpp
-
-#include "StdAfx.h"
-#include "x86.h"
-
-#include "Windows/Defs.h"
-
-#include "BranchX86.c"
-
-UInt32 CBCJ_x86_Encoder::SubFilter(Byte *data, UInt32 size)
-{
- return ::x86_Convert(data, size, _bufferPos, &_prevMask, &_prevPos, 1);
-}
-
-UInt32 CBCJ_x86_Decoder::SubFilter(Byte *data, UInt32 size)
-{
- return ::x86_Convert(data, size, _bufferPos, &_prevMask, &_prevPos, 0);
-}
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/x86.h b/other-licenses/7zstub/src/7zip/Compress/Branch/x86.h
deleted file mode 100644
index 85882d9149..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/x86.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// x86.h
-
-#ifndef __X86_H
-#define __X86_H
-
-#include "BranchCoder.h"
-#include "BranchX86.h"
-
-struct CBranch86
-{
- UInt32 _prevMask;
- UInt32 _prevPos;
- void x86Init() { x86_Convert_Init(_prevMask, _prevPos); }
-};
-
-MyClassB(BCJ_x86, 0x01, 3, CBranch86 ,
- virtual void SubInit() { x86Init(); })
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.cpp b/other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.cpp
deleted file mode 100644
index fc87bd937d..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-// x86_2.cpp
-
-#include "StdAfx.h"
-#include "x86_2.h"
-
-#include "../../../Common/Alloc.h"
-
-static const int kBufferSize = 1 << 17;
-
-inline bool IsJcc(Byte b0, Byte b1)
-{
- return (b0 == 0x0F && (b1 & 0xF0) == 0x80);
-}
-
-#ifndef EXTRACT_ONLY
-
-static bool inline Test86MSByte(Byte b)
-{
- return (b == 0 || b == 0xFF);
-}
-
-bool CBCJ2_x86_Encoder::Create()
-{
- if (!_mainStream.Create(1 << 16))
- return false;
- if (!_callStream.Create(1 << 20))
- return false;
- if (!_jumpStream.Create(1 << 20))
- return false;
- if (!_rangeEncoder.Create(1 << 20))
- return false;
- if (_buffer == 0)
- {
- _buffer = (Byte *)MidAlloc(kBufferSize);
- if (_buffer == 0)
- return false;
- }
- return true;
-}
-
-CBCJ2_x86_Encoder::~CBCJ2_x86_Encoder()
-{
- ::MidFree(_buffer);
-}
-
-HRESULT CBCJ2_x86_Encoder::Flush()
-{
- RINOK(_mainStream.Flush());
- RINOK(_callStream.Flush());
- RINOK(_jumpStream.Flush());
- _rangeEncoder.FlushData();
- return _rangeEncoder.FlushStream();
-}
-
-const UInt32 kDefaultLimit = (1 << 24);
-
-HRESULT CBCJ2_x86_Encoder::CodeReal(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress)
-{
- if (numInStreams != 1 || numOutStreams != 4)
- return E_INVALIDARG;
-
- if (!Create())
- return E_OUTOFMEMORY;
-
- bool sizeIsDefined = false;
- UInt64 inSize;
- if (inSizes != NULL)
- if (inSizes[0] != NULL)
- {
- inSize = *inSizes[0];
- if (inSize <= kDefaultLimit)
- sizeIsDefined = true;
- }
-
- ISequentialInStream *inStream = inStreams[0];
-
- _mainStream.SetStream(outStreams[0]);
- _mainStream.Init();
- _callStream.SetStream(outStreams[1]);
- _callStream.Init();
- _jumpStream.SetStream(outStreams[2]);
- _jumpStream.Init();
- _rangeEncoder.SetStream(outStreams[3]);
- _rangeEncoder.Init();
- for (int i = 0; i < 256; i++)
- _statusE8Encoder[i].Init();
- _statusE9Encoder.Init();
- _statusJccEncoder.Init();
- CCoderReleaser releaser(this);
-
- CMyComPtr<ICompressGetSubStreamSize> getSubStreamSize;
- {
- inStream->QueryInterface(IID_ICompressGetSubStreamSize, (void **)&getSubStreamSize);
- }
-
- UInt32 nowPos = 0;
- UInt64 nowPos64 = 0;
- UInt32 bufferPos = 0;
-
- Byte prevByte = 0;
-
- UInt64 subStreamIndex = 0;
- UInt64 subStreamStartPos = 0;
- UInt64 subStreamEndPos = 0;
-
- while(true)
- {
- UInt32 processedSize = 0;
- while(true)
- {
- UInt32 size = kBufferSize - (bufferPos + processedSize);
- UInt32 processedSizeLoc;
- if (size == 0)
- break;
- RINOK(inStream->Read(_buffer + bufferPos + processedSize, size, &processedSizeLoc));
- if (processedSizeLoc == 0)
- break;
- processedSize += processedSizeLoc;
- }
- UInt32 endPos = bufferPos + processedSize;
-
- if (endPos < 5)
- {
- // change it
- for (bufferPos = 0; bufferPos < endPos; bufferPos++)
- {
- Byte b = _buffer[bufferPos];
- _mainStream.WriteByte(b);
- if (b == 0xE8)
- _statusE8Encoder[prevByte].Encode(&_rangeEncoder, 0);
- else if (b == 0xE9)
- _statusE9Encoder.Encode(&_rangeEncoder, 0);
- else if (IsJcc(prevByte, b))
- _statusJccEncoder.Encode(&_rangeEncoder, 0);
- prevByte = b;
- }
- return Flush();
- }
-
- bufferPos = 0;
-
- UInt32 limit = endPos - 5;
- while(bufferPos <= limit)
- {
- Byte b = _buffer[bufferPos];
- _mainStream.WriteByte(b);
- if (b != 0xE8 && b != 0xE9 && !IsJcc(prevByte, b))
- {
- bufferPos++;
- prevByte = b;
- continue;
- }
- Byte nextByte = _buffer[bufferPos + 4];
- UInt32 src =
- (UInt32(nextByte) << 24) |
- (UInt32(_buffer[bufferPos + 3]) << 16) |
- (UInt32(_buffer[bufferPos + 2]) << 8) |
- (_buffer[bufferPos + 1]);
- UInt32 dest = (nowPos + bufferPos + 5) + src;
- // if (Test86MSByte(nextByte))
- bool convert;
- if (getSubStreamSize != NULL)
- {
- UInt64 currentPos = (nowPos64 + bufferPos);
- while (subStreamEndPos < currentPos)
- {
- UInt64 subStreamSize;
- HRESULT result = getSubStreamSize->GetSubStreamSize(subStreamIndex, &subStreamSize);
- if (result == S_OK)
- {
- subStreamStartPos = subStreamEndPos;
- subStreamEndPos += subStreamSize;
- subStreamIndex++;
- }
- else if (result == S_FALSE || result == E_NOTIMPL)
- {
- getSubStreamSize.Release();
- subStreamStartPos = 0;
- subStreamEndPos = subStreamStartPos - 1;
- }
- else
- return result;
- }
- if (getSubStreamSize == NULL)
- {
- if (sizeIsDefined)
- convert = (dest < inSize);
- else
- convert = Test86MSByte(nextByte);
- }
- else if (subStreamEndPos - subStreamStartPos > kDefaultLimit)
- convert = Test86MSByte(nextByte);
- else
- {
- UInt64 dest64 = (currentPos + 5) + Int64(Int32(src));
- convert = (dest64 >= subStreamStartPos && dest64 < subStreamEndPos);
- }
- }
- else if (sizeIsDefined)
- convert = (dest < inSize);
- else
- convert = Test86MSByte(nextByte);
- if (convert)
- {
- if (b == 0xE8)
- _statusE8Encoder[prevByte].Encode(&_rangeEncoder, 1);
- else if (b == 0xE9)
- _statusE9Encoder.Encode(&_rangeEncoder, 1);
- else
- _statusJccEncoder.Encode(&_rangeEncoder, 1);
-
- bufferPos += 5;
- if (b == 0xE8)
- {
- _callStream.WriteByte((Byte)(dest >> 24));
- _callStream.WriteByte((Byte)(dest >> 16));
- _callStream.WriteByte((Byte)(dest >> 8));
- _callStream.WriteByte((Byte)(dest));
- }
- else
- {
- _jumpStream.WriteByte((Byte)(dest >> 24));
- _jumpStream.WriteByte((Byte)(dest >> 16));
- _jumpStream.WriteByte((Byte)(dest >> 8));
- _jumpStream.WriteByte((Byte)(dest));
- }
- prevByte = nextByte;
- }
- else
- {
- if (b == 0xE8)
- _statusE8Encoder[prevByte].Encode(&_rangeEncoder, 0);
- else if (b == 0xE9)
- _statusE9Encoder.Encode(&_rangeEncoder, 0);
- else
- _statusJccEncoder.Encode(&_rangeEncoder, 0);
- bufferPos++;
- prevByte = b;
- }
- }
- nowPos += bufferPos;
- nowPos64 += bufferPos;
-
- if (progress != NULL)
- {
- RINOK(progress->SetRatioInfo(&nowPos64, NULL));
- }
-
- UInt32 i = 0;
- while(bufferPos < endPos)
- _buffer[i++] = _buffer[bufferPos++];
- bufferPos = i;
- }
-}
-
-STDMETHODIMP CBCJ2_x86_Encoder::Code(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress)
-{
- try
- {
- return CodeReal(inStreams, inSizes, numInStreams,
- outStreams, outSizes,numOutStreams, progress);
- }
- catch(const COutBufferException &e) { return e.ErrorCode; }
- catch(...) { return S_FALSE; }
-}
-
-#endif
-
-HRESULT CBCJ2_x86_Decoder::CodeReal(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress)
-{
- if (numInStreams != 4 || numOutStreams != 1)
- return E_INVALIDARG;
-
- if (!_mainInStream.Create(1 << 16))
- return E_OUTOFMEMORY;
- if (!_callStream.Create(1 << 20))
- return E_OUTOFMEMORY;
- if (!_jumpStream.Create(1 << 16))
- return E_OUTOFMEMORY;
- if (!_rangeDecoder.Create(1 << 20))
- return E_OUTOFMEMORY;
- if (!_outStream.Create(1 << 16))
- return E_OUTOFMEMORY;
-
- _mainInStream.SetStream(inStreams[0]);
- _callStream.SetStream(inStreams[1]);
- _jumpStream.SetStream(inStreams[2]);
- _rangeDecoder.SetStream(inStreams[3]);
- _outStream.SetStream(outStreams[0]);
-
- _mainInStream.Init();
- _callStream.Init();
- _jumpStream.Init();
- _rangeDecoder.Init();
- _outStream.Init();
-
- for (int i = 0; i < 256; i++)
- _statusE8Decoder[i].Init();
- _statusE9Decoder.Init();
- _statusJccDecoder.Init();
-
- CCoderReleaser releaser(this);
-
- Byte prevByte = 0;
- UInt32 processedBytes = 0;
- while(true)
- {
- if (processedBytes > (1 << 20) && progress != NULL)
- {
- UInt64 nowPos64 = _outStream.GetProcessedSize();
- RINOK(progress->SetRatioInfo(NULL, &nowPos64));
- processedBytes = 0;
- }
- processedBytes++;
- Byte b;
- if (!_mainInStream.ReadByte(b))
- return Flush();
- _outStream.WriteByte(b);
- if (b != 0xE8 && b != 0xE9 && !IsJcc(prevByte, b))
- {
- prevByte = b;
- continue;
- }
- bool status;
- if (b == 0xE8)
- status = (_statusE8Decoder[prevByte].Decode(&_rangeDecoder) == 1);
- else if (b == 0xE9)
- status = (_statusE9Decoder.Decode(&_rangeDecoder) == 1);
- else
- status = (_statusJccDecoder.Decode(&_rangeDecoder) == 1);
- if (status)
- {
- UInt32 src;
- if (b == 0xE8)
- {
- Byte b0;
- if(!_callStream.ReadByte(b0))
- return S_FALSE;
- src = ((UInt32)b0) << 24;
- if(!_callStream.ReadByte(b0))
- return S_FALSE;
- src |= ((UInt32)b0) << 16;
- if(!_callStream.ReadByte(b0))
- return S_FALSE;
- src |= ((UInt32)b0) << 8;
- if(!_callStream.ReadByte(b0))
- return S_FALSE;
- src |= ((UInt32)b0);
- }
- else
- {
- Byte b0;
- if(!_jumpStream.ReadByte(b0))
- return S_FALSE;
- src = ((UInt32)b0) << 24;
- if(!_jumpStream.ReadByte(b0))
- return S_FALSE;
- src |= ((UInt32)b0) << 16;
- if(!_jumpStream.ReadByte(b0))
- return S_FALSE;
- src |= ((UInt32)b0) << 8;
- if(!_jumpStream.ReadByte(b0))
- return S_FALSE;
- src |= ((UInt32)b0);
- }
- UInt32 dest = src - (UInt32(_outStream.GetProcessedSize()) + 4) ;
- _outStream.WriteByte((Byte)(dest));
- _outStream.WriteByte((Byte)(dest >> 8));
- _outStream.WriteByte((Byte)(dest >> 16));
- _outStream.WriteByte((Byte)(dest >> 24));
- prevByte = (dest >> 24);
- processedBytes += 4;
- }
- else
- prevByte = b;
- }
-}
-
-STDMETHODIMP CBCJ2_x86_Decoder::Code(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress)
-{
- try
- {
- return CodeReal(inStreams, inSizes, numInStreams,
- outStreams, outSizes,numOutStreams, progress);
- }
- catch(const COutBufferException &e) { return e.ErrorCode; }
- catch(...) { return S_FALSE; }
-}
diff --git a/other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.h b/other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.h
deleted file mode 100644
index 9e7780c80b..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Branch/x86_2.h
+++ /dev/null
@@ -1,133 +0,0 @@
-// x86_2.h
-
-#ifndef __BRANCH_X86_2_H
-#define __BRANCH_X86_2_H
-
-#include "../../../Common/MyCom.h"
-#include "../RangeCoder/RangeCoderBit.h"
-#include "../../ICoder.h"
-
-// {23170F69-40C1-278B-0303-010100000100}
-#define MyClass2_a(Name, id, subId, encodingId) \
-DEFINE_GUID(CLSID_CCompressConvert ## Name, \
-0x23170F69, 0x40C1, 0x278B, 0x03, 0x03, id, subId, 0x00, 0x00, encodingId, 0x00);
-
-#define MyClass_a(Name, id, subId) \
-MyClass2_a(Name ## _Encoder, id, subId, 0x01) \
-MyClass2_a(Name ## _Decoder, id, subId, 0x00)
-
-MyClass_a(BCJ2_x86, 0x01, 0x1B)
-
-const int kNumMoveBits = 5;
-
-#ifndef EXTRACT_ONLY
-
-class CBCJ2_x86_Encoder:
- public ICompressCoder2,
- public CMyUnknownImp
-{
- Byte *_buffer;
-public:
- CBCJ2_x86_Encoder(): _buffer(0) {};
- ~CBCJ2_x86_Encoder();
- bool Create();
-
- COutBuffer _mainStream;
- COutBuffer _callStream;
- COutBuffer _jumpStream;
- NCompress::NRangeCoder::CEncoder _rangeEncoder;
- NCompress::NRangeCoder::CBitEncoder<kNumMoveBits> _statusE8Encoder[256];
- NCompress::NRangeCoder::CBitEncoder<kNumMoveBits> _statusE9Encoder;
- NCompress::NRangeCoder::CBitEncoder<kNumMoveBits> _statusJccEncoder;
-
- HRESULT Flush();
- void ReleaseStreams()
- {
- _mainStream.ReleaseStream();
- _callStream.ReleaseStream();
- _jumpStream.ReleaseStream();
- _rangeEncoder.ReleaseStream();
- }
-
- class CCoderReleaser
- {
- CBCJ2_x86_Encoder *_coder;
- public:
- CCoderReleaser(CBCJ2_x86_Encoder *coder): _coder(coder) {}
- ~CCoderReleaser() { _coder->ReleaseStreams(); }
- };
-
-public:
-
- MY_UNKNOWN_IMP
-
- HRESULT CodeReal(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress);
- STDMETHOD(Code)(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress);
-};
-
-#endif
-
-class CBCJ2_x86_Decoder:
- public ICompressCoder2,
- public CMyUnknownImp
-{
-public:
- CInBuffer _mainInStream;
- CInBuffer _callStream;
- CInBuffer _jumpStream;
- NCompress::NRangeCoder::CDecoder _rangeDecoder;
- NCompress::NRangeCoder::CBitDecoder<kNumMoveBits> _statusE8Decoder[256];
- NCompress::NRangeCoder::CBitDecoder<kNumMoveBits> _statusE9Decoder;
- NCompress::NRangeCoder::CBitDecoder<kNumMoveBits> _statusJccDecoder;
-
- COutBuffer _outStream;
-
- void ReleaseStreams()
- {
- _mainInStream.ReleaseStream();
- _callStream.ReleaseStream();
- _jumpStream.ReleaseStream();
- _rangeDecoder.ReleaseStream();
- _outStream.ReleaseStream();
- }
-
- HRESULT Flush() { return _outStream.Flush(); }
- class CCoderReleaser
- {
- CBCJ2_x86_Decoder *_coder;
- public:
- CCoderReleaser(CBCJ2_x86_Decoder *coder): _coder(coder) {}
- ~CCoderReleaser() { _coder->ReleaseStreams(); }
- };
-
-public:
- MY_UNKNOWN_IMP
- HRESULT CodeReal(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress);
- STDMETHOD(Code)(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.cpp b/other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.cpp
deleted file mode 100644
index 9ced211586..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// Compress/CopyCoder.cpp
-
-#include "StdAfx.h"
-
-#include "CopyCoder.h"
-#include "../../../Common/Alloc.h"
-#include "../../Common/StreamUtils.h"
-
-namespace NCompress {
-
-static const UInt32 kBufferSize = 1 << 17;
-
-CCopyCoder::~CCopyCoder()
-{
- ::MidFree(_buffer);
-}
-
-STDMETHODIMP CCopyCoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
-{
- if (_buffer == 0)
- {
- _buffer = (Byte *)::MidAlloc(kBufferSize);
- if (_buffer == 0)
- return E_OUTOFMEMORY;
- }
-
- TotalSize = 0;
- while(true)
- {
- UInt32 realProcessedSize;
- UInt32 size = kBufferSize;
- if (outSize != 0)
- if (size > *outSize - TotalSize)
- size = (UInt32)(*outSize - TotalSize);
- RINOK(inStream->Read(_buffer, size, &realProcessedSize));
- if(realProcessedSize == 0)
- break;
- RINOK(WriteStream(outStream, _buffer, realProcessedSize, NULL));
- TotalSize += realProcessedSize;
- if (progress != NULL)
- {
- RINOK(progress->SetRatioInfo(&TotalSize, &TotalSize));
- }
- }
- return S_OK;
-}
-
-}
-
diff --git a/other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.h b/other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.h
deleted file mode 100644
index c82e469a45..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/Copy/CopyCoder.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Compress/CopyCoder.h
-
-#ifndef __COMPRESS_COPYCODER_H
-#define __COMPRESS_COPYCODER_H
-
-#include "../../ICoder.h"
-#include "../../../Common/MyCom.h"
-
-namespace NCompress {
-
-class CCopyCoder:
- public ICompressCoder,
- public CMyUnknownImp
-{
- Byte *_buffer;
-public:
- UInt64 TotalSize;
- CCopyCoder(): TotalSize(0) , _buffer(0) {};
- ~CCopyCoder();
-
- MY_UNKNOWN_IMP
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-};
-
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.cpp b/other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.cpp
deleted file mode 100644
index 329a7db35b..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// LZOutWindow.cpp
-
-#include "StdAfx.h"
-
-#include "../../../Common/Alloc.h"
-#include "LZOutWindow.h"
-
-void CLZOutWindow::Init(bool solid)
-{
- if(!solid)
- COutBuffer::Init();
- #ifdef _NO_EXCEPTIONS
- ErrorCode = S_OK;
- #endif
-}
-
-
diff --git a/other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.h b/other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.h
deleted file mode 100644
index b64cb927f8..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/LZ/LZOutWindow.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// LZOutWindow.h
-
-#ifndef __LZ_OUT_WINDOW_H
-#define __LZ_OUT_WINDOW_H
-
-#include "../../IStream.h"
-#include "../../Common/OutBuffer.h"
-
-#ifndef _NO_EXCEPTIONS
-typedef COutBufferException CLZOutWindowException;
-#endif
-
-class CLZOutWindow: public COutBuffer
-{
-public:
- void Init(bool solid = false);
-
- // distance >= 0, len > 0,
- bool CopyBlock(UInt32 distance, UInt32 len)
- {
- UInt32 pos = _pos - distance - 1;
- if (distance >= _pos)
- {
- if (!_overDict || distance >= _bufferSize)
- return false;
- pos += _bufferSize;
- }
- do
- {
- if (pos == _bufferSize)
- pos = 0;
- _buffer[_pos++] = _buffer[pos++];
- if (_pos == _limitPos)
- FlushWithCheck();
- }
- while(--len != 0);
- return true;
- }
-
- void PutByte(Byte b)
- {
- _buffer[_pos++] = b;
- if (_pos == _limitPos)
- FlushWithCheck();
- }
-
- Byte GetByte(UInt32 distance) const
- {
- UInt32 pos = _pos - distance - 1;
- if (pos >= _bufferSize)
- pos += _bufferSize;
- return _buffer[pos];
- }
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMA.h b/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMA.h
deleted file mode 100644
index d53296ee70..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMA.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// LZMA.h
-
-#ifndef __LZMA_H
-#define __LZMA_H
-
-namespace NCompress {
-namespace NLZMA {
-
-const UInt32 kNumRepDistances = 4;
-
-const int kNumStates = 12;
-
-const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
-const Byte kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
-const Byte kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
-const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
-
-class CState
-{
-public:
- Byte Index;
- void Init() { Index = 0; }
- void UpdateChar() { Index = kLiteralNextStates[Index]; }
- void UpdateMatch() { Index = kMatchNextStates[Index]; }
- void UpdateRep() { Index = kRepNextStates[Index]; }
- void UpdateShortRep() { Index = kShortRepNextStates[Index]; }
- bool IsCharState() const { return Index < 7; }
-};
-
-const int kNumPosSlotBits = 6;
-const int kDicLogSizeMin = 0;
-const int kDicLogSizeMax = 32;
-const int kDistTableSizeMax = kDicLogSizeMax * 2;
-
-const UInt32 kNumLenToPosStates = 4;
-
-inline UInt32 GetLenToPosState(UInt32 len)
-{
- len -= 2;
- if (len < kNumLenToPosStates)
- return len;
- return kNumLenToPosStates - 1;
-}
-
-namespace NLength {
-
-const int kNumPosStatesBitsMax = 4;
-const UInt32 kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
-
-const int kNumPosStatesBitsEncodingMax = 4;
-const UInt32 kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
-
-const int kNumLowBits = 3;
-const int kNumMidBits = 3;
-const int kNumHighBits = 8;
-const UInt32 kNumLowSymbols = 1 << kNumLowBits;
-const UInt32 kNumMidSymbols = 1 << kNumMidBits;
-const UInt32 kNumSymbolsTotal = kNumLowSymbols + kNumMidSymbols + (1 << kNumHighBits);
-
-}
-
-const UInt32 kMatchMinLen = 2;
-const UInt32 kMatchMaxLen = kMatchMinLen + NLength::kNumSymbolsTotal - 1;
-
-const int kNumAlignBits = 4;
-const UInt32 kAlignTableSize = 1 << kNumAlignBits;
-const UInt32 kAlignMask = (kAlignTableSize - 1);
-
-const UInt32 kStartPosModelIndex = 4;
-const UInt32 kEndPosModelIndex = 14;
-const UInt32 kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
-
-const UInt32 kNumFullDistances = 1 << (kEndPosModelIndex / 2);
-
-const int kNumLitPosStatesBitsEncodingMax = 4;
-const int kNumLitContextBitsMax = 8;
-
-const int kNumMoveBits = 5;
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.cpp b/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.cpp
deleted file mode 100644
index e5dfb27027..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-// LZMADecoder.cpp
-
-#include "StdAfx.h"
-
-#include "LZMADecoder.h"
-#include "../../../Common/Defs.h"
-
-namespace NCompress {
-namespace NLZMA {
-
-const int kLenIdFinished = -1;
-const int kLenIdNeedInit = -2;
-
-void CDecoder::Init()
-{
- {
- for(int i = 0; i < kNumStates; i++)
- {
- for (UInt32 j = 0; j <= _posStateMask; j++)
- {
- _isMatch[i][j].Init();
- _isRep0Long[i][j].Init();
- }
- _isRep[i].Init();
- _isRepG0[i].Init();
- _isRepG1[i].Init();
- _isRepG2[i].Init();
- }
- }
- {
- for (UInt32 i = 0; i < kNumLenToPosStates; i++)
- _posSlotDecoder[i].Init();
- }
- {
- for(UInt32 i = 0; i < kNumFullDistances - kEndPosModelIndex; i++)
- _posDecoders[i].Init();
- }
- _posAlignDecoder.Init();
- _lenDecoder.Init(_posStateMask + 1);
- _repMatchLenDecoder.Init(_posStateMask + 1);
- _literalDecoder.Init();
-
- _state.Init();
- _reps[0] = _reps[1] = _reps[2] = _reps[3] = 0;
-}
-
-HRESULT CDecoder::CodeSpec(UInt32 curSize)
-{
- if (_outSizeDefined)
- {
- const UInt64 rem = _outSize - _outWindowStream.GetProcessedSize();
- if (curSize > rem)
- curSize = (UInt32)rem;
- }
-
- if (_remainLen == kLenIdFinished)
- return S_OK;
- if (_remainLen == kLenIdNeedInit)
- {
- _rangeDecoder.Init();
- Init();
- _remainLen = 0;
- }
- if (curSize == 0)
- return S_OK;
-
- UInt32 rep0 = _reps[0];
- UInt32 rep1 = _reps[1];
- UInt32 rep2 = _reps[2];
- UInt32 rep3 = _reps[3];
- CState state = _state;
- Byte previousByte;
-
- while(_remainLen > 0 && curSize > 0)
- {
- previousByte = _outWindowStream.GetByte(rep0);
- _outWindowStream.PutByte(previousByte);
- _remainLen--;
- curSize--;
- }
- UInt64 nowPos64 = _outWindowStream.GetProcessedSize();
- if (nowPos64 == 0)
- previousByte = 0;
- else
- previousByte = _outWindowStream.GetByte(0);
-
- while(curSize > 0)
- {
- {
- #ifdef _NO_EXCEPTIONS
- if (_rangeDecoder.Stream.ErrorCode != S_OK)
- return _rangeDecoder.Stream.ErrorCode;
- #endif
- if (_rangeDecoder.Stream.WasFinished())
- return S_FALSE;
- UInt32 posState = UInt32(nowPos64) & _posStateMask;
- if (_isMatch[state.Index][posState].Decode(&_rangeDecoder) == 0)
- {
- if(!state.IsCharState())
- previousByte = _literalDecoder.DecodeWithMatchByte(&_rangeDecoder,
- (UInt32)nowPos64, previousByte, _outWindowStream.GetByte(rep0));
- else
- previousByte = _literalDecoder.DecodeNormal(&_rangeDecoder,
- (UInt32)nowPos64, previousByte);
- _outWindowStream.PutByte(previousByte);
- state.UpdateChar();
- curSize--;
- nowPos64++;
- }
- else
- {
- UInt32 len;
- if(_isRep[state.Index].Decode(&_rangeDecoder) == 1)
- {
- len = 0;
- if(_isRepG0[state.Index].Decode(&_rangeDecoder) == 0)
- {
- if(_isRep0Long[state.Index][posState].Decode(&_rangeDecoder) == 0)
- {
- state.UpdateShortRep();
- len = 1;
- }
- }
- else
- {
- UInt32 distance;
- if(_isRepG1[state.Index].Decode(&_rangeDecoder) == 0)
- distance = rep1;
- else
- {
- if (_isRepG2[state.Index].Decode(&_rangeDecoder) == 0)
- distance = rep2;
- else
- {
- distance = rep3;
- rep3 = rep2;
- }
- rep2 = rep1;
- }
- rep1 = rep0;
- rep0 = distance;
- }
- if (len == 0)
- {
- len = _repMatchLenDecoder.Decode(&_rangeDecoder, posState) + kMatchMinLen;
- state.UpdateRep();
- }
- }
- else
- {
- rep3 = rep2;
- rep2 = rep1;
- rep1 = rep0;
- len = kMatchMinLen + _lenDecoder.Decode(&_rangeDecoder, posState);
- state.UpdateMatch();
- UInt32 posSlot = _posSlotDecoder[GetLenToPosState(len)].Decode(&_rangeDecoder);
- if (posSlot >= kStartPosModelIndex)
- {
- UInt32 numDirectBits = (posSlot >> 1) - 1;
- rep0 = ((2 | (posSlot & 1)) << numDirectBits);
-
- if (posSlot < kEndPosModelIndex)
- rep0 += NRangeCoder::ReverseBitTreeDecode(_posDecoders +
- rep0 - posSlot - 1, &_rangeDecoder, numDirectBits);
- else
- {
- rep0 += (_rangeDecoder.DecodeDirectBits(
- numDirectBits - kNumAlignBits) << kNumAlignBits);
- rep0 += _posAlignDecoder.ReverseDecode(&_rangeDecoder);
- if (rep0 == 0xFFFFFFFF)
- {
- _remainLen = kLenIdFinished;
- return S_OK;
- }
- }
- }
- else
- rep0 = posSlot;
- }
- UInt32 locLen = len;
- if (len > curSize)
- locLen = (UInt32)curSize;
- if (!_outWindowStream.CopyBlock(rep0, locLen))
- return S_FALSE;
- previousByte = _outWindowStream.GetByte(0);
- curSize -= locLen;
- nowPos64 += locLen;
- len -= locLen;
- if (len != 0)
- {
- _remainLen = (Int32)len;
- break;
- }
-
- #ifdef _NO_EXCEPTIONS
- if (_outWindowStream.ErrorCode != S_OK)
- return _outWindowStream.ErrorCode;
- #endif
- }
- }
- }
- if (_rangeDecoder.Stream.WasFinished())
- return S_FALSE;
- _reps[0] = rep0;
- _reps[1] = rep1;
- _reps[2] = rep2;
- _reps[3] = rep3;
- _state = state;
-
- return S_OK;
-}
-
-STDMETHODIMP CDecoder::CodeReal(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *, const UInt64 *outSize,
- ICompressProgressInfo *progress)
-{
- SetInStream(inStream);
- _outWindowStream.SetStream(outStream);
- SetOutStreamSize(outSize);
- CDecoderFlusher flusher(this);
-
- while (true)
- {
- UInt32 curSize = 1 << 18;
- RINOK(CodeSpec(curSize));
- if (_remainLen == kLenIdFinished)
- break;
- if (progress != NULL)
- {
- UInt64 inSize = _rangeDecoder.GetProcessedSize();
- UInt64 nowPos64 = _outWindowStream.GetProcessedSize();
- RINOK(progress->SetRatioInfo(&inSize, &nowPos64));
- }
- if (_outSizeDefined)
- if (_outWindowStream.GetProcessedSize() >= _outSize)
- break;
- }
- flusher.NeedFlush = false;
- return Flush();
-}
-
-
-#ifdef _NO_EXCEPTIONS
-
-#define LZMA_TRY_BEGIN
-#define LZMA_TRY_END
-
-#else
-
-#define LZMA_TRY_BEGIN try {
-#define LZMA_TRY_END } \
- catch(const CInBufferException &e) { return e.ErrorCode; } \
- catch(const CLZOutWindowException &e) { return e.ErrorCode; } \
- catch(...) { return S_FALSE; }
-
-#endif
-
-
-STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress)
-{
- LZMA_TRY_BEGIN
- return CodeReal(inStream, outStream, inSize, outSize, progress);
- LZMA_TRY_END
-}
-
-STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *properties, UInt32 size)
-{
- if (size < 5)
- return E_INVALIDARG;
- int lc = properties[0] % 9;
- Byte remainder = (Byte)(properties[0] / 9);
- int lp = remainder % 5;
- int pb = remainder / 5;
- if (pb > NLength::kNumPosStatesBitsMax)
- return E_INVALIDARG;
- _posStateMask = (1 << pb) - 1;
- UInt32 dictionarySize = 0;
- for (int i = 0; i < 4; i++)
- dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
- if (!_outWindowStream.Create(dictionarySize))
- return E_OUTOFMEMORY;
- if (!_literalDecoder.Create(lp, lc))
- return E_OUTOFMEMORY;
- if (!_rangeDecoder.Create(1 << 20))
- return E_OUTOFMEMORY;
- return S_OK;
-}
-
-STDMETHODIMP CDecoder::GetInStreamProcessedSize(UInt64 *value)
-{
- *value = _rangeDecoder.GetProcessedSize();
- return S_OK;
-}
-
-STDMETHODIMP CDecoder::SetInStream(ISequentialInStream *inStream)
-{
- _rangeDecoder.SetStream(inStream);
- return S_OK;
-}
-
-STDMETHODIMP CDecoder::ReleaseInStream()
-{
- _rangeDecoder.ReleaseStream();
- return S_OK;
-}
-
-STDMETHODIMP CDecoder::SetOutStreamSize(const UInt64 *outSize)
-{
- if (_outSizeDefined = (outSize != NULL))
- _outSize = *outSize;
- _remainLen = kLenIdNeedInit;
- _outWindowStream.Init();
- return S_OK;
-}
-
-#ifdef _ST_MODE
-
-STDMETHODIMP CDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
-{
- LZMA_TRY_BEGIN
- if (processedSize)
- *processedSize = 0;
- const UInt64 startPos = _outWindowStream.GetProcessedSize();
- _outWindowStream.SetMemStream((Byte *)data);
- RINOK(CodeSpec(size));
- if (processedSize)
- *processedSize = (UInt32)(_outWindowStream.GetProcessedSize() - startPos);
- return Flush();
- LZMA_TRY_END
-}
-
-#endif
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.h b/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.h
deleted file mode 100644
index d6370e250f..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/LZMA/LZMADecoder.h
+++ /dev/null
@@ -1,251 +0,0 @@
-// LZMA/Decoder.h
-
-#ifndef __LZMA_DECODER_H
-#define __LZMA_DECODER_H
-
-#include "../../../Common/MyCom.h"
-#include "../../../Common/Alloc.h"
-#include "../../ICoder.h"
-#include "../LZ/LZOutWindow.h"
-#include "../RangeCoder/RangeCoderBitTree.h"
-
-#include "LZMA.h"
-
-namespace NCompress {
-namespace NLZMA {
-
-typedef NRangeCoder::CBitDecoder<kNumMoveBits> CMyBitDecoder;
-
-class CLiteralDecoder2
-{
- CMyBitDecoder _decoders[0x300];
-public:
- void Init()
- {
- for (int i = 0; i < 0x300; i++)
- _decoders[i].Init();
- }
- Byte DecodeNormal(NRangeCoder::CDecoder *rangeDecoder)
- {
- UInt32 symbol = 1;
- RC_INIT_VAR
- do
- {
- // symbol = (symbol << 1) | _decoders[0][symbol].Decode(rangeDecoder);
- RC_GETBIT(kNumMoveBits, _decoders[symbol].Prob, symbol)
- }
- while (symbol < 0x100);
- RC_FLUSH_VAR
- return (Byte)symbol;
- }
- Byte DecodeWithMatchByte(NRangeCoder::CDecoder *rangeDecoder, Byte matchByte)
- {
- UInt32 symbol = 1;
- RC_INIT_VAR
- do
- {
- UInt32 matchBit = (matchByte >> 7) & 1;
- matchByte <<= 1;
- // UInt32 bit = _decoders[1 + matchBit][symbol].Decode(rangeDecoder);
- // symbol = (symbol << 1) | bit;
- UInt32 bit;
- RC_GETBIT2(kNumMoveBits, _decoders[0x100 + (matchBit << 8) + symbol].Prob, symbol,
- bit = 0, bit = 1)
- if (matchBit != bit)
- {
- while (symbol < 0x100)
- {
- // symbol = (symbol << 1) | _decoders[0][symbol].Decode(rangeDecoder);
- RC_GETBIT(kNumMoveBits, _decoders[symbol].Prob, symbol)
- }
- break;
- }
- }
- while (symbol < 0x100);
- RC_FLUSH_VAR
- return (Byte)symbol;
- }
-};
-
-class CLiteralDecoder
-{
- CLiteralDecoder2 *_coders;
- int _numPrevBits;
- int _numPosBits;
- UInt32 _posMask;
-public:
- CLiteralDecoder(): _coders(0) {}
- ~CLiteralDecoder() { Free(); }
- void Free()
- {
- MyFree(_coders);
- _coders = 0;
- }
- bool Create(int numPosBits, int numPrevBits)
- {
- if (_coders == 0 || (numPosBits + numPrevBits) !=
- (_numPrevBits + _numPosBits) )
- {
- Free();
- UInt32 numStates = 1 << (numPosBits + numPrevBits);
- _coders = (CLiteralDecoder2 *)MyAlloc(numStates * sizeof(CLiteralDecoder2));
- }
- _numPosBits = numPosBits;
- _posMask = (1 << numPosBits) - 1;
- _numPrevBits = numPrevBits;
- return (_coders != 0);
- }
- void Init()
- {
- UInt32 numStates = 1 << (_numPrevBits + _numPosBits);
- for (UInt32 i = 0; i < numStates; i++)
- _coders[i].Init();
- }
- UInt32 GetState(UInt32 pos, Byte prevByte) const
- { return ((pos & _posMask) << _numPrevBits) + (prevByte >> (8 - _numPrevBits)); }
- Byte DecodeNormal(NRangeCoder::CDecoder *rangeDecoder, UInt32 pos, Byte prevByte)
- { return _coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder); }
- Byte DecodeWithMatchByte(NRangeCoder::CDecoder *rangeDecoder, UInt32 pos, Byte prevByte, Byte matchByte)
- { return _coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte); }
-};
-
-namespace NLength {
-
-class CDecoder
-{
- CMyBitDecoder _choice;
- CMyBitDecoder _choice2;
- NRangeCoder::CBitTreeDecoder<kNumMoveBits, kNumLowBits> _lowCoder[kNumPosStatesMax];
- NRangeCoder::CBitTreeDecoder<kNumMoveBits, kNumMidBits> _midCoder[kNumPosStatesMax];
- NRangeCoder::CBitTreeDecoder<kNumMoveBits, kNumHighBits> _highCoder;
-public:
- void Init(UInt32 numPosStates)
- {
- _choice.Init();
- _choice2.Init();
- for (UInt32 posState = 0; posState < numPosStates; posState++)
- {
- _lowCoder[posState].Init();
- _midCoder[posState].Init();
- }
- _highCoder.Init();
- }
- UInt32 Decode(NRangeCoder::CDecoder *rangeDecoder, UInt32 posState)
- {
- if(_choice.Decode(rangeDecoder) == 0)
- return _lowCoder[posState].Decode(rangeDecoder);
- if(_choice2.Decode(rangeDecoder) == 0)
- return kNumLowSymbols + _midCoder[posState].Decode(rangeDecoder);
- return kNumLowSymbols + kNumMidSymbols + _highCoder.Decode(rangeDecoder);
- }
-};
-
-}
-
-class CDecoder:
- public ICompressCoder,
- public ICompressSetDecoderProperties2,
- public ICompressGetInStreamProcessedSize,
- #ifdef _ST_MODE
- public ICompressSetInStream,
- public ICompressSetOutStreamSize,
- public ISequentialInStream,
- #endif
- public CMyUnknownImp
-{
- CLZOutWindow _outWindowStream;
- NRangeCoder::CDecoder _rangeDecoder;
-
- CMyBitDecoder _isMatch[kNumStates][NLength::kNumPosStatesMax];
- CMyBitDecoder _isRep[kNumStates];
- CMyBitDecoder _isRepG0[kNumStates];
- CMyBitDecoder _isRepG1[kNumStates];
- CMyBitDecoder _isRepG2[kNumStates];
- CMyBitDecoder _isRep0Long[kNumStates][NLength::kNumPosStatesMax];
-
- NRangeCoder::CBitTreeDecoder<kNumMoveBits, kNumPosSlotBits> _posSlotDecoder[kNumLenToPosStates];
-
- CMyBitDecoder _posDecoders[kNumFullDistances - kEndPosModelIndex];
- NRangeCoder::CBitTreeDecoder<kNumMoveBits, kNumAlignBits> _posAlignDecoder;
-
- NLength::CDecoder _lenDecoder;
- NLength::CDecoder _repMatchLenDecoder;
-
- CLiteralDecoder _literalDecoder;
-
- UInt32 _posStateMask;
-
- ///////////////////
- // State
- UInt32 _reps[4];
- CState _state;
- Int32 _remainLen; // -1 means end of stream. // -2 means need Init
- UInt64 _outSize;
- bool _outSizeDefined;
-
- void Init();
- HRESULT CodeSpec(UInt32 size);
-public:
-
- #ifdef _ST_MODE
- MY_UNKNOWN_IMP5(
- ICompressSetDecoderProperties2,
- ICompressGetInStreamProcessedSize,
- ICompressSetInStream,
- ICompressSetOutStreamSize,
- ISequentialInStream)
- #else
- MY_UNKNOWN_IMP2(
- ICompressSetDecoderProperties2,
- ICompressGetInStreamProcessedSize)
- #endif
-
- void ReleaseStreams()
- {
- _outWindowStream.ReleaseStream();
- ReleaseInStream();
- }
-
- class CDecoderFlusher
- {
- CDecoder *_decoder;
- public:
- bool NeedFlush;
- CDecoderFlusher(CDecoder *decoder): _decoder(decoder), NeedFlush(true) {}
- ~CDecoderFlusher()
- {
- if (NeedFlush)
- _decoder->Flush();
- _decoder->ReleaseStreams();
- }
- };
-
- HRESULT Flush() { return _outWindowStream.Flush(); }
-
- STDMETHOD(CodeReal)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream, const UInt64 *inSize, const UInt64 *outSize,
- ICompressProgressInfo *progress);
-
- STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
-
- STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
-
- STDMETHOD(SetInStream)(ISequentialInStream *inStream);
- STDMETHOD(ReleaseInStream)();
- STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
-
- #ifdef _ST_MODE
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
- #endif
-
- CDecoder(): _outSizeDefined(false) {}
- virtual ~CDecoder() {}
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoder.h b/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoder.h
deleted file mode 100644
index 9828bc4b94..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoder.h
+++ /dev/null
@@ -1,205 +0,0 @@
-// Compress/RangeCoder/RangeCoder.h
-
-#ifndef __COMPRESS_RANGECODER_H
-#define __COMPRESS_RANGECODER_H
-
-#include "../../Common/InBuffer.h"
-#include "../../Common/OutBuffer.h"
-
-namespace NCompress {
-namespace NRangeCoder {
-
-const int kNumTopBits = 24;
-const UInt32 kTopValue = (1 << kNumTopBits);
-
-class CEncoder
-{
- UInt32 _cacheSize;
- Byte _cache;
-public:
- UInt64 Low;
- UInt32 Range;
- COutBuffer Stream;
- bool Create(UInt32 bufferSize) { return Stream.Create(bufferSize); }
-
- void SetStream(ISequentialOutStream *stream) { Stream.SetStream(stream); }
- void Init()
- {
- Stream.Init();
- Low = 0;
- Range = 0xFFFFFFFF;
- _cacheSize = 1;
- _cache = 0;
- }
-
- void FlushData()
- {
- // Low += 1;
- for(int i = 0; i < 5; i++)
- ShiftLow();
- }
-
- HRESULT FlushStream() { return Stream.Flush(); }
-
- void ReleaseStream() { Stream.ReleaseStream(); }
-
- void Encode(UInt32 start, UInt32 size, UInt32 total)
- {
- Low += start * (Range /= total);
- Range *= size;
- while (Range < kTopValue)
- {
- Range <<= 8;
- ShiftLow();
- }
- }
-
- void ShiftLow()
- {
- if ((UInt32)Low < (UInt32)0xFF000000 || (int)(Low >> 32) != 0)
- {
- Byte temp = _cache;
- do
- {
- Stream.WriteByte((Byte)(temp + (Byte)(Low >> 32)));
- temp = 0xFF;
- }
- while(--_cacheSize != 0);
- _cache = (Byte)((UInt32)Low >> 24);
- }
- _cacheSize++;
- Low = (UInt32)Low << 8;
- }
-
- void EncodeDirectBits(UInt32 value, int numTotalBits)
- {
- for (int i = numTotalBits - 1; i >= 0; i--)
- {
- Range >>= 1;
- if (((value >> i) & 1) == 1)
- Low += Range;
- if (Range < kTopValue)
- {
- Range <<= 8;
- ShiftLow();
- }
- }
- }
-
- void EncodeBit(UInt32 size0, UInt32 numTotalBits, UInt32 symbol)
- {
- UInt32 newBound = (Range >> numTotalBits) * size0;
- if (symbol == 0)
- Range = newBound;
- else
- {
- Low += newBound;
- Range -= newBound;
- }
- while (Range < kTopValue)
- {
- Range <<= 8;
- ShiftLow();
- }
- }
-
- UInt64 GetProcessedSize() { return Stream.GetProcessedSize() + _cacheSize + 4; }
-};
-
-class CDecoder
-{
-public:
- CInBuffer Stream;
- UInt32 Range;
- UInt32 Code;
- bool Create(UInt32 bufferSize) { return Stream.Create(bufferSize); }
-
- void Normalize()
- {
- while (Range < kTopValue)
- {
- Code = (Code << 8) | Stream.ReadByte();
- Range <<= 8;
- }
- }
-
- void SetStream(ISequentialInStream *stream) { Stream.SetStream(stream); }
- void Init()
- {
- Stream.Init();
- Code = 0;
- Range = 0xFFFFFFFF;
- for(int i = 0; i < 5; i++)
- Code = (Code << 8) | Stream.ReadByte();
- }
-
- void ReleaseStream() { Stream.ReleaseStream(); }
-
- UInt32 GetThreshold(UInt32 total)
- {
- return (Code) / ( Range /= total);
- }
-
- void Decode(UInt32 start, UInt32 size)
- {
- Code -= start * Range;
- Range *= size;
- Normalize();
- }
-
- UInt32 DecodeDirectBits(int numTotalBits)
- {
- UInt32 range = Range;
- UInt32 code = Code;
- UInt32 result = 0;
- for (int i = numTotalBits; i != 0; i--)
- {
- range >>= 1;
- /*
- result <<= 1;
- if (code >= range)
- {
- code -= range;
- result |= 1;
- }
- */
- UInt32 t = (code - range) >> 31;
- code -= range & (t - 1);
- result = (result << 1) | (1 - t);
-
- if (range < kTopValue)
- {
- code = (code << 8) | Stream.ReadByte();
- range <<= 8;
- }
- }
- Range = range;
- Code = code;
- return result;
- }
-
- UInt32 DecodeBit(UInt32 size0, UInt32 numTotalBits)
- {
- UInt32 newBound = (Range >> numTotalBits) * size0;
- UInt32 symbol;
- if (Code < newBound)
- {
- symbol = 0;
- Range = newBound;
- }
- else
- {
- symbol = 1;
- Code -= newBound;
- Range -= newBound;
- }
- Normalize();
- return symbol;
- }
-
- UInt64 GetProcessedSize() {return Stream.GetProcessedSize(); }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.cpp b/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.cpp
deleted file mode 100644
index 8d273c8f93..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// Compress/RangeCoder/RangeCoderBit.cpp
-
-#include "StdAfx.h"
-
-#include "RangeCoderBit.h"
-
-namespace NCompress {
-namespace NRangeCoder {
-
-UInt32 CPriceTables::ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
-static CPriceTables g_PriceTables;
-
-CPriceTables::CPriceTables() { Init(); }
-
-void CPriceTables::Init()
-{
- const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
- for(int i = kNumBits - 1; i >= 0; i--)
- {
- UInt32 start = 1 << (kNumBits - i - 1);
- UInt32 end = 1 << (kNumBits - i);
- for (UInt32 j = start; j < end; j++)
- ProbPrices[j] = (i << kNumBitPriceShiftBits) +
- (((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1));
- }
-
- /*
- // simplest: bad solution
- for(UInt32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
- ProbPrices[i] = kBitPrice;
- */
-
- /*
- const double kDummyMultMid = (1.0 / kBitPrice) / 2;
- const double kDummyMultMid = 0;
- // float solution
- double ln2 = log(double(2));
- double lnAll = log(double(kBitModelTotal >> kNumMoveReducingBits));
- for(UInt32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
- ProbPrices[i] = UInt32((fabs(lnAll - log(double(i))) / ln2 + kDummyMultMid) * kBitPrice);
- */
-
- /*
- // experimental, slow, solution:
- for(UInt32 i = 1; i < (kBitModelTotal >> kNumMoveReducingBits) - 1; i++)
- {
- const int kCyclesBits = 5;
- const UInt32 kCycles = (1 << kCyclesBits);
-
- UInt32 range = UInt32(-1);
- UInt32 bitCount = 0;
- for (UInt32 j = 0; j < kCycles; j++)
- {
- range >>= (kNumBitModelTotalBits - kNumMoveReducingBits);
- range *= i;
- while(range < (1 << 31))
- {
- range <<= 1;
- bitCount++;
- }
- }
- bitCount <<= kNumBitPriceShiftBits;
- range -= (1 << 31);
- for (int k = kNumBitPriceShiftBits - 1; k >= 0; k--)
- {
- range <<= 1;
- if (range > (1 << 31))
- {
- bitCount += (1 << k);
- range -= (1 << 31);
- }
- }
- ProbPrices[i] = (bitCount
- // + (1 << (kCyclesBits - 1))
- ) >> kCyclesBits;
- }
- */
-}
-
-}}
diff --git a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.h b/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.h
deleted file mode 100644
index 64538e6879..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBit.h
+++ /dev/null
@@ -1,120 +0,0 @@
-// Compress/RangeCoder/RangeCoderBit.h
-
-#ifndef __COMPRESS_RANGECODER_BIT_H
-#define __COMPRESS_RANGECODER_BIT_H
-
-#include "RangeCoder.h"
-
-namespace NCompress {
-namespace NRangeCoder {
-
-const int kNumBitModelTotalBits = 11;
-const UInt32 kBitModelTotal = (1 << kNumBitModelTotalBits);
-
-const int kNumMoveReducingBits = 2;
-
-const int kNumBitPriceShiftBits = 6;
-const UInt32 kBitPrice = 1 << kNumBitPriceShiftBits;
-
-class CPriceTables
-{
-public:
- static UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
- static void Init();
- CPriceTables();
-};
-
-template <int numMoveBits>
-class CBitModel
-{
-public:
- UInt32 Prob;
- void UpdateModel(UInt32 symbol)
- {
- /*
- Prob -= (Prob + ((symbol - 1) & ((1 << numMoveBits) - 1))) >> numMoveBits;
- Prob += (1 - symbol) << (kNumBitModelTotalBits - numMoveBits);
- */
- if (symbol == 0)
- Prob += (kBitModelTotal - Prob) >> numMoveBits;
- else
- Prob -= (Prob) >> numMoveBits;
- }
-public:
- void Init() { Prob = kBitModelTotal / 2; }
-};
-
-template <int numMoveBits>
-class CBitEncoder: public CBitModel<numMoveBits>
-{
-public:
- void Encode(CEncoder *encoder, UInt32 symbol)
- {
- /*
- encoder->EncodeBit(this->Prob, kNumBitModelTotalBits, symbol);
- this->UpdateModel(symbol);
- */
- UInt32 newBound = (encoder->Range >> kNumBitModelTotalBits) * this->Prob;
- if (symbol == 0)
- {
- encoder->Range = newBound;
- this->Prob += (kBitModelTotal - this->Prob) >> numMoveBits;
- }
- else
- {
- encoder->Low += newBound;
- encoder->Range -= newBound;
- this->Prob -= (this->Prob) >> numMoveBits;
- }
- if (encoder->Range < kTopValue)
- {
- encoder->Range <<= 8;
- encoder->ShiftLow();
- }
- }
- UInt32 GetPrice(UInt32 symbol) const
- {
- return CPriceTables::ProbPrices[
- (((this->Prob - symbol) ^ ((-(int)symbol))) & (kBitModelTotal - 1)) >> kNumMoveReducingBits];
- }
- UInt32 GetPrice0() const { return CPriceTables::ProbPrices[this->Prob >> kNumMoveReducingBits]; }
- UInt32 GetPrice1() const { return CPriceTables::ProbPrices[(kBitModelTotal - this->Prob) >> kNumMoveReducingBits]; }
-};
-
-
-template <int numMoveBits>
-class CBitDecoder: public CBitModel<numMoveBits>
-{
-public:
- UInt32 Decode(CDecoder *decoder)
- {
- UInt32 newBound = (decoder->Range >> kNumBitModelTotalBits) * this->Prob;
- if (decoder->Code < newBound)
- {
- decoder->Range = newBound;
- this->Prob += (kBitModelTotal - this->Prob) >> numMoveBits;
- if (decoder->Range < kTopValue)
- {
- decoder->Code = (decoder->Code << 8) | decoder->Stream.ReadByte();
- decoder->Range <<= 8;
- }
- return 0;
- }
- else
- {
- decoder->Range -= newBound;
- decoder->Code -= newBound;
- this->Prob -= (this->Prob) >> numMoveBits;
- if (decoder->Range < kTopValue)
- {
- decoder->Code = (decoder->Code << 8) | decoder->Stream.ReadByte();
- decoder->Range <<= 8;
- }
- return 1;
- }
- }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBitTree.h b/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBitTree.h
deleted file mode 100644
index 1fa023f3b8..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderBitTree.h
+++ /dev/null
@@ -1,161 +0,0 @@
-// Compress/RangeCoder/RangeCoderBitTree.h
-
-#ifndef __COMPRESS_RANGECODER_BIT_TREE_H
-#define __COMPRESS_RANGECODER_BIT_TREE_H
-
-#include "RangeCoderBit.h"
-#include "RangeCoderOpt.h"
-
-namespace NCompress {
-namespace NRangeCoder {
-
-template <int numMoveBits, int NumBitLevels>
-class CBitTreeEncoder
-{
- CBitEncoder<numMoveBits> Models[1 << NumBitLevels];
-public:
- void Init()
- {
- for(UInt32 i = 1; i < (1 << NumBitLevels); i++)
- Models[i].Init();
- }
- void Encode(CEncoder *rangeEncoder, UInt32 symbol)
- {
- UInt32 modelIndex = 1;
- for (int bitIndex = NumBitLevels; bitIndex != 0 ;)
- {
- bitIndex--;
- UInt32 bit = (symbol >> bitIndex) & 1;
- Models[modelIndex].Encode(rangeEncoder, bit);
- modelIndex = (modelIndex << 1) | bit;
- }
- };
- void ReverseEncode(CEncoder *rangeEncoder, UInt32 symbol)
- {
- UInt32 modelIndex = 1;
- for (int i = 0; i < NumBitLevels; i++)
- {
- UInt32 bit = symbol & 1;
- Models[modelIndex].Encode(rangeEncoder, bit);
- modelIndex = (modelIndex << 1) | bit;
- symbol >>= 1;
- }
- }
- UInt32 GetPrice(UInt32 symbol) const
- {
- symbol |= (1 << NumBitLevels);
- UInt32 price = 0;
- while (symbol != 1)
- {
- price += Models[symbol >> 1].GetPrice(symbol & 1);
- symbol >>= 1;
- }
- return price;
- }
- UInt32 ReverseGetPrice(UInt32 symbol) const
- {
- UInt32 price = 0;
- UInt32 modelIndex = 1;
- for (int i = NumBitLevels; i != 0; i--)
- {
- UInt32 bit = symbol & 1;
- symbol >>= 1;
- price += Models[modelIndex].GetPrice(bit);
- modelIndex = (modelIndex << 1) | bit;
- }
- return price;
- }
-};
-
-template <int numMoveBits, int NumBitLevels>
-class CBitTreeDecoder
-{
- CBitDecoder<numMoveBits> Models[1 << NumBitLevels];
-public:
- void Init()
- {
- for(UInt32 i = 1; i < (1 << NumBitLevels); i++)
- Models[i].Init();
- }
- UInt32 Decode(CDecoder *rangeDecoder)
- {
- UInt32 modelIndex = 1;
- RC_INIT_VAR
- for(int bitIndex = NumBitLevels; bitIndex != 0; bitIndex--)
- {
- // modelIndex = (modelIndex << 1) + Models[modelIndex].Decode(rangeDecoder);
- RC_GETBIT(numMoveBits, Models[modelIndex].Prob, modelIndex)
- }
- RC_FLUSH_VAR
- return modelIndex - (1 << NumBitLevels);
- };
- UInt32 ReverseDecode(CDecoder *rangeDecoder)
- {
- UInt32 modelIndex = 1;
- UInt32 symbol = 0;
- RC_INIT_VAR
- for(int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
- {
- // UInt32 bit = Models[modelIndex].Decode(rangeDecoder);
- // modelIndex <<= 1;
- // modelIndex += bit;
- // symbol |= (bit << bitIndex);
- RC_GETBIT2(numMoveBits, Models[modelIndex].Prob, modelIndex, ; , symbol |= (1 << bitIndex))
- }
- RC_FLUSH_VAR
- return symbol;
- }
-};
-
-template <int numMoveBits>
-void ReverseBitTreeEncode(CBitEncoder<numMoveBits> *Models,
- CEncoder *rangeEncoder, int NumBitLevels, UInt32 symbol)
-{
- UInt32 modelIndex = 1;
- for (int i = 0; i < NumBitLevels; i++)
- {
- UInt32 bit = symbol & 1;
- Models[modelIndex].Encode(rangeEncoder, bit);
- modelIndex = (modelIndex << 1) | bit;
- symbol >>= 1;
- }
-}
-
-template <int numMoveBits>
-UInt32 ReverseBitTreeGetPrice(CBitEncoder<numMoveBits> *Models,
- UInt32 NumBitLevels, UInt32 symbol)
-{
- UInt32 price = 0;
- UInt32 modelIndex = 1;
- for (int i = NumBitLevels; i != 0; i--)
- {
- UInt32 bit = symbol & 1;
- symbol >>= 1;
- price += Models[modelIndex].GetPrice(bit);
- modelIndex = (modelIndex << 1) | bit;
- }
- return price;
-}
-
-template <int numMoveBits>
-UInt32 ReverseBitTreeDecode(CBitDecoder<numMoveBits> *Models,
- CDecoder *rangeDecoder, int NumBitLevels)
-{
- UInt32 modelIndex = 1;
- UInt32 symbol = 0;
- RC_INIT_VAR
- for(int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
- {
- // UInt32 bit = Models[modelIndex].Decode(rangeDecoder);
- // modelIndex <<= 1;
- // modelIndex += bit;
- // symbol |= (bit << bitIndex);
- RC_GETBIT2(numMoveBits, Models[modelIndex].Prob, modelIndex, ; , symbol |= (1 << bitIndex))
- }
- RC_FLUSH_VAR
- return symbol;
-}
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderOpt.h b/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderOpt.h
deleted file mode 100644
index 829fc83d77..0000000000
--- a/other-licenses/7zstub/src/7zip/Compress/RangeCoder/RangeCoderOpt.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Compress/RangeCoder/RangeCoderOpt.h
-
-#ifndef __COMPRESS_RANGECODER_OPT_H
-#define __COMPRESS_RANGECODER_OPT_H
-
-#define RC_INIT_VAR \
- UInt32 range = rangeDecoder->Range; \
- UInt32 code = rangeDecoder->Code;
-
-#define RC_FLUSH_VAR \
- rangeDecoder->Range = range; \
- rangeDecoder->Code = code;
-
-#define RC_NORMALIZE \
- if (range < NCompress::NRangeCoder::kTopValue) \
- { code = (code << 8) | rangeDecoder->Stream.ReadByte(); range <<= 8; }
-
-#define RC_GETBIT2(numMoveBits, prob, mi, A0, A1) \
- { UInt32 bound = (range >> NCompress::NRangeCoder::kNumBitModelTotalBits) * prob; \
- if (code < bound) \
- { A0; range = bound; \
- prob += (NCompress::NRangeCoder::kBitModelTotal - prob) >> numMoveBits; \
- mi <<= 1; } \
- else \
- { A1; range -= bound; code -= bound; prob -= (prob) >> numMoveBits; \
- mi = (mi + mi) + 1; }} \
- RC_NORMALIZE
-
-#define RC_GETBIT(numMoveBits, prob, mi) RC_GETBIT2(numMoveBits, prob, mi, ; , ;)
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.cpp b/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.cpp
deleted file mode 100644
index 04f27f4276..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-// FormatUtils.cpp
-
-#include "StdAfx.h"
-
-#include "FormatUtils.h"
-#include "Common/IntToString.h"
-#include "Windows/ResourceString.h"
-
-#ifdef LANG
-#include "LangUtils.h"
-#endif
-
-UString NumberToString(UInt64 number)
-{
- wchar_t numberString[32];
- ConvertUInt64ToString(number, numberString);
- return numberString;
-}
-
-UString MyFormatNew(const UString &format, const UString &argument)
-{
- UString result = format;
- result.Replace(L"{0}", argument);
- return result;
-}
-
-UString MyFormatNew(UINT resourceID,
- #ifdef LANG
- UInt32 langID,
- #endif
- const UString &argument)
-{
- return MyFormatNew(
- #ifdef LANG
- LangString(resourceID, langID),
- #else
- NWindows::MyLoadStringW(resourceID),
- #endif
- argument);
-}
diff --git a/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.h b/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.h
deleted file mode 100644
index 825ff6d2ed..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/FormatUtils.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// FormatUtils.h
-
-#ifndef __FORMATUTILS_H
-#define __FORMATUTILS_H
-
-#include "Common/Types.h"
-#include "Common/String.h"
-
-UString NumberToString(UInt64 number);
-
-UString MyFormatNew(const UString &format, const UString &argument);
-UString MyFormatNew(UINT resourceID,
- #ifdef LANG
- UInt32 langID,
- #endif
- const UString &argument);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp b/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp
deleted file mode 100644
index b421e8ccef..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-// ProgressDialog.cpp
-
-#include "StdAfx.h"
-#include "resource.h"
-#include "ProgressDialog.h"
-#include "Common/IntToString.h"
-#include "Common/IntToString.h"
-
-using namespace NWindows;
-
-static const UINT_PTR kTimerID = 3;
-static const UINT kTimerElapse = 50;
-
-#ifdef LANG
-#include "../../LangUtils.h"
-#endif
-
-#ifdef LANG
-static CIDLangPair kIDLangPairs[] =
-{
- { IDCANCEL, 0x02000711 }
-};
-#endif
-
-#ifndef _SFX
-CProgressDialog::~CProgressDialog()
-{
- AddToTitle(TEXT(""));
-}
-void CProgressDialog::AddToTitle(LPCWSTR s)
-{
- if (MainWindow != 0)
- ::MySetWindowText(MainWindow, UString(s) + MainTitle);
-}
-#endif
-
-
-
-bool CProgressDialog::OnInit()
-{
- _range = UINT64(-1);
- _prevPercentValue = -1;
-
- #ifdef LANG
- // LangSetWindowText(HWND(*this), 0x02000C00);
- LangSetDlgItemsText(HWND(*this), kIDLangPairs, sizeof(kIDLangPairs) / sizeof(kIDLangPairs[0]));
- #endif
-
- m_ProgressBar.Attach(GetItem(IDC_PROGRESS1));
- _timer = SetTimer(kTimerID, kTimerElapse);
- _dialogCreatedEvent.Set();
- SetText(_title);
- return CModalDialog::OnInit();
-}
-
-void CProgressDialog::OnCancel()
-{
- ProgressSynch.SetStopped(true);
-}
-
-void CProgressDialog::SetRange(UINT64 range)
-{
- _range = range;
- _peviousPos = (UInt64)(Int64)-1;
- _converter.Init(range);
- m_ProgressBar.SetRange32(0 , _converter.Count(range)); // Test it for 100%
-}
-
-void CProgressDialog::SetPos(UINT64 pos)
-{
- bool redraw = true;
- if (pos < _range && pos > _peviousPos)
- {
- UINT64 posDelta = pos - _peviousPos;
- if (posDelta < (_range >> 10))
- redraw = false;
- }
- if(redraw)
- {
- m_ProgressBar.SetPos(_converter.Count(pos)); // Test it for 100%
- _peviousPos = pos;
- }
-}
-
-bool CProgressDialog::OnTimer(WPARAM timerID, LPARAM callback)
-{
- if (ProgressSynch.GetPaused())
- return true;
- UINT64 total, completed;
- ProgressSynch.GetProgress(total, completed);
- if (total != _range)
- SetRange(total);
- SetPos(completed);
-
- if (total == 0)
- total = 1;
-
- int percentValue = (int)(completed * 100 / total);
- if (percentValue != _prevPercentValue)
- {
- wchar_t s[64];
- ConvertUInt64ToString(percentValue, s);
- UString title = s;
- title += L"% ";
- SetText(title + _title);
- #ifndef _SFX
- AddToTitle(title + MainAddTitle);
- #endif
- _prevPercentValue = percentValue;
- }
- return true;
-}
-
-
-////////////////////
-// CU64ToI32Converter
-
-static const UINT64 kMaxIntValue = 0x7FFFFFFF;
-
-void CU64ToI32Converter::Init(UINT64 range)
-{
- _numShiftBits = 0;
- while(range > kMaxIntValue)
- {
- range >>= 1;
- _numShiftBits++;
- }
-}
-
-int CU64ToI32Converter::Count(UINT64 aValue)
-{
- return int(aValue >> _numShiftBits);
-}
-
-const UINT CProgressDialog::kCloseMessage = WM_USER + 1;
-
-bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch(message)
- {
- case kCloseMessage:
- {
- KillTimer(_timer);
- _timer = 0;
- End(0);
- return true;
- }
- case WM_SETTEXT:
- {
- if (_timer == 0)
- return true;
- }
- }
- return CModalDialog::OnMessage(message, wParam, lParam);
-}
-
-bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
-{
- switch(buttonID)
- {
- case IDCANCEL:
- {
- bool paused = ProgressSynch.GetPaused();;
- ProgressSynch.SetPaused(true);
- int res = ::MessageBoxW(HWND(*this),
- L"Are you sure you want to cancel?",
- _title, MB_YESNO);
- ProgressSynch.SetPaused(paused);
- if (res == IDNO)
- return true;
- break;
- }
- }
- return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
-}
diff --git a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h b/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h
deleted file mode 100644
index d0d8db56f0..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/ProgressDialog.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// ProgressDialog.h
-
-#ifndef __PROGRESSDIALOG_H
-#define __PROGRESSDIALOG_H
-
-#include "resource.h"
-
-#include "Windows/Control/Dialog.h"
-#include "Windows/Control/ProgressBar.h"
-#include "Windows/Synchronization.h"
-
-class CProgressSynch
-{
- NWindows::NSynchronization::CCriticalSection _criticalSection;
- bool _stopped;
- bool _paused;
- UINT64 _total;
- UINT64 _completed;
-public:
- CProgressSynch(): _stopped(false), _paused(false), _total(1), _completed(0) {}
-
- bool GetStopped()
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- return _stopped;
- }
- void SetStopped(bool value)
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- _stopped = value;
- }
- bool GetPaused()
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- return _paused;
- }
- void SetPaused(bool value)
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- _paused = value;
- }
- void SetProgress(UINT64 total, UINT64 completed)
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- _total = total;
- _completed = completed;
- }
- void SetPos(UINT64 completed)
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- _completed = completed;
- }
- void GetProgress(UINT64 &total, UINT64 &completed)
- {
- NWindows::NSynchronization::CCriticalSectionLock lock(_criticalSection);
- total = _total;
- completed = _completed;
- }
-};
-
-class CU64ToI32Converter
-{
- UINT64 _numShiftBits;
-public:
- void Init(UINT64 _range);
- int Count(UINT64 aValue);
-};
-
-// class CProgressDialog: public NWindows::NControl::CModelessDialog
-
-class CProgressDialog: public NWindows::NControl::CModalDialog
-{
-private:
- UINT_PTR _timer;
-
- UString _title;
- CU64ToI32Converter _converter;
- UINT64 _peviousPos;
- UINT64 _range;
- NWindows::NControl::CProgressBar m_ProgressBar;
-
- int _prevPercentValue;
-
- bool OnTimer(WPARAM timerID, LPARAM callback);
- void SetRange(UINT64 range);
- void SetPos(UINT64 pos);
- virtual bool OnInit();
- virtual void OnCancel();
- NWindows::NSynchronization::CManualResetEvent _dialogCreatedEvent;
- #ifndef _SFX
- void AddToTitle(LPCWSTR string);
- #endif
- bool OnButtonClicked(int buttonID, HWND buttonHWND);
-public:
- CProgressSynch ProgressSynch;
-
- #ifndef _SFX
- HWND MainWindow;
- UString MainTitle;
- UString MainAddTitle;
- ~CProgressDialog();
- #endif
-
- CProgressDialog(): _timer(0)
- #ifndef _SFX
- ,MainWindow(0)
- #endif
- {}
-
- void WaitCreating() { _dialogCreatedEvent.Lock(); }
-
-
- INT_PTR Create(const UString &title, HWND wndParent = 0)
- {
- _title = title;
- return CModalDialog::Create(IDD_DIALOG_PROGRESS, wndParent);
- }
-
- static const UINT kCloseMessage;
-
- virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
-
- void MyClose()
- {
- PostMessage(kCloseMessage);
- };
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/StdAfx.h b/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/StdAfx.h
deleted file mode 100644
index 6447c20642..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/StdAfx.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// stdafx.h
-
-#ifndef __STDAFX_H
-#define __STDAFX_H
-
-#define _WIN32_WINNT 0x0400
-
-// it's for Windows NT supporting (MENUITEMINFOW)
-#define WINVER 0x0400
-
-#include <windows.h>
-#include <commctrl.h>
-
-#include "Common/NewHandler.h"
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.h b/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.h
deleted file mode 100644
index 7f9828126f..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.h
+++ /dev/null
@@ -1,3 +0,0 @@
-#define IDD_DIALOG_PROGRESS 500
-
-#define IDC_PROGRESS1 1000
diff --git a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.rc b/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.rc
deleted file mode 100644
index 71a76fe9e6..0000000000
--- a/other-licenses/7zstub/src/7zip/FileManager/Resource/ProgressDialog/resource.rc
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "resource.h"
-#include "../../../GuiCommon.rc"
-
-#define xSize2 172
-#define ySize2 42
-#define xSize (xSize2 + marg + marg)
-#define ySize (ySize2 + marg + marg)
-
-#define bYPos (ySize - marg - bYSize)
-#define bXPos (xSize - marg - bXSize)
-
-
-IDD_DIALOG_PROGRESS DIALOG 0, 0, xSize, ySize MY_MODAL_DIALOG_STYLE
-CAPTION "Progress"
-MY_FONT
-BEGIN
- PUSHBUTTON "Cancel", IDCANCEL, bXPos, bYPos , bXSize, bYSize
- CONTROL "Progress1", IDC_PROGRESS1,"msctls_progress32",PBS_SMOOTH | WS_BORDER,
- marg,marg, xSize2, 14
-END
diff --git a/other-licenses/7zstub/src/7zip/GuiCommon.rc b/other-licenses/7zstub/src/7zip/GuiCommon.rc
deleted file mode 100644
index fb65dce844..0000000000
--- a/other-licenses/7zstub/src/7zip/GuiCommon.rc
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <winnt.h>
-#include <WinUser.h>
-#include <CommCtrl.h>
-
-#define marg 7
-#undef bXSize
-#undef bYSize
-#define bXSize 64
-#define bYSize 14
-#define bDotsSize 20
-
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-
-#undef xSize2
-#undef ySize2
-#undef xSize
-#undef ySize
-#undef bXPos
-#undef bYPos
-#undef b1XPos
-#undef b1YPos
-#undef b2XPos
-#undef b2YPos
-#undef b3XPos
-#undef b3YPos
-#undef gPos
-#undef gPos2
-#undef gSpace
-#undef gSize
-#undef marg2
-#undef marg3
-
-
-#define MY_MODAL_DIALOG_STYLE STYLE DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
-#define MY_PAGE_STYLE STYLE DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
-
-#define MY_FONT FONT 8, "MS Shell Dlg"
diff --git a/other-licenses/7zstub/src/7zip/ICoder.h b/other-licenses/7zstub/src/7zip/ICoder.h
deleted file mode 100644
index 508dac3fd0..0000000000
--- a/other-licenses/7zstub/src/7zip/ICoder.h
+++ /dev/null
@@ -1,163 +0,0 @@
-// ICoder.h
-
-#ifndef __ICODER_H
-#define __ICODER_H
-
-#include "IStream.h"
-
-// "23170F69-40C1-278A-0000-000400xx0000"
-#define CODER_INTERFACE(i, x) \
-DEFINE_GUID(IID_ ## i, \
-0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x04, 0x00, x, 0x00, 0x00); \
-struct i: public IUnknown
-
-CODER_INTERFACE(ICompressProgressInfo, 0x04)
-{
- STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize) PURE;
-};
-
-CODER_INTERFACE(ICompressCoder, 0x05)
-{
- STDMETHOD(Code)(ISequentialInStream *inStream,
- ISequentialOutStream *outStream,
- const UInt64 *inSize,
- const UInt64 *outSize,
- ICompressProgressInfo *progress) PURE;
-};
-
-CODER_INTERFACE(ICompressCoder2, 0x18)
-{
- STDMETHOD(Code)(ISequentialInStream **inStreams,
- const UInt64 **inSizes,
- UInt32 numInStreams,
- ISequentialOutStream **outStreams,
- const UInt64 **outSizes,
- UInt32 numOutStreams,
- ICompressProgressInfo *progress) PURE;
-};
-
-namespace NCoderPropID
-{
- enum EEnum
- {
- kDictionarySize = 0x400,
- kUsedMemorySize,
- kOrder,
- kPosStateBits = 0x440,
- kLitContextBits,
- kLitPosBits,
- kNumFastBytes = 0x450,
- kMatchFinder,
- kMatchFinderCycles,
- kNumPasses = 0x460,
- kAlgorithm = 0x470,
- kMultiThread = 0x480,
- kNumThreads,
- kEndMarker = 0x490
- };
-}
-
-CODER_INTERFACE(ICompressSetCoderProperties, 0x20)
-{
- STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
- const PROPVARIANT *properties, UInt32 numProperties) PURE;
-};
-
-/*
-CODER_INTERFACE(ICompressSetCoderProperties, 0x21)
-{
- STDMETHOD(SetDecoderProperties)(ISequentialInStream *inStream) PURE;
-};
-*/
-
-CODER_INTERFACE(ICompressSetDecoderProperties2, 0x22)
-{
- STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size) PURE;
-};
-
-CODER_INTERFACE(ICompressWriteCoderProperties, 0x23)
-{
- STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStreams) PURE;
-};
-
-CODER_INTERFACE(ICompressGetInStreamProcessedSize, 0x24)
-{
- STDMETHOD(GetInStreamProcessedSize)(UInt64 *value) PURE;
-};
-
-CODER_INTERFACE(ICompressSetCoderMt, 0x25)
-{
- STDMETHOD(SetNumberOfThreads)(UInt32 numThreads) PURE;
-};
-
-CODER_INTERFACE(ICompressGetSubStreamSize, 0x30)
-{
- STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value) PURE;
-};
-
-CODER_INTERFACE(ICompressSetInStream, 0x31)
-{
- STDMETHOD(SetInStream)(ISequentialInStream *inStream) PURE;
- STDMETHOD(ReleaseInStream)() PURE;
-};
-
-CODER_INTERFACE(ICompressSetOutStream, 0x32)
-{
- STDMETHOD(SetOutStream)(ISequentialOutStream *outStream) PURE;
- STDMETHOD(ReleaseOutStream)() PURE;
-};
-
-CODER_INTERFACE(ICompressSetInStreamSize, 0x33)
-{
- STDMETHOD(SetInStreamSize)(const UInt64 *inSize) PURE;
-};
-
-CODER_INTERFACE(ICompressSetOutStreamSize, 0x34)
-{
- STDMETHOD(SetOutStreamSize)(const UInt64 *outSize) PURE;
-};
-
-CODER_INTERFACE(ICompressFilter, 0x40)
-{
- STDMETHOD(Init)() PURE;
- STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size) PURE;
- // Filter return outSize (UInt32)
- // if (outSize <= size): Filter have converted outSize bytes
- // if (outSize > size): Filter have not converted anything.
- // and it needs at least outSize bytes to convert one block
- // (it's for crypto block algorithms).
-};
-
-CODER_INTERFACE(ICryptoProperties, 0x80)
-{
- STDMETHOD(SetKey)(const Byte *data, UInt32 size) PURE;
- STDMETHOD(SetInitVector)(const Byte *data, UInt32 size) PURE;
-};
-
-CODER_INTERFACE(ICryptoSetPassword, 0x90)
-{
- STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size) PURE;
-};
-
-CODER_INTERFACE(ICryptoSetCRC, 0xA0)
-{
- STDMETHOD(CryptoSetCRC)(UInt32 crc) PURE;
-};
-
-//////////////////////
-// It's for DLL file
-namespace NMethodPropID
-{
- enum EEnum
- {
- kID,
- kName,
- kDecoder,
- kEncoder,
- kInStreams,
- kOutStreams,
- kDescription
- };
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/IPassword.h b/other-licenses/7zstub/src/7zip/IPassword.h
deleted file mode 100644
index ba8acb0ec7..0000000000
--- a/other-licenses/7zstub/src/7zip/IPassword.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// IPassword.h
-
-#ifndef __IPASSWORD_H
-#define __IPASSWORD_H
-
-#include "../Common/MyUnknown.h"
-#include "../Common/Types.h"
-
-// MIDL_INTERFACE("23170F69-40C1-278A-0000-000500xx0000")
-#define PASSWORD_INTERFACE(i, x) \
-DEFINE_GUID(IID_ ## i, \
-0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x05, 0x00, x, 0x00, 0x00); \
-struct i: public IUnknown
-
-PASSWORD_INTERFACE(ICryptoGetTextPassword, 0x10)
-{
- STDMETHOD(CryptoGetTextPassword)(BSTR *password) PURE;
-};
-
-PASSWORD_INTERFACE(ICryptoGetTextPassword2, 0x11)
-{
- STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password) PURE;
-};
-
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/IProgress.h b/other-licenses/7zstub/src/7zip/IProgress.h
deleted file mode 100644
index fa2070dc7c..0000000000
--- a/other-licenses/7zstub/src/7zip/IProgress.h
+++ /dev/null
@@ -1,32 +0,0 @@
-// Interface/IProgress.h
-
-#ifndef __IPROGRESS_H
-#define __IPROGRESS_H
-
-#include "../Common/MyUnknown.h"
-#include "../Common/Types.h"
-
-// {23170F69-40C1-278A-0000-000000050000}
-DEFINE_GUID(IID_IProgress,
-0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00);
-MIDL_INTERFACE("23170F69-40C1-278A-0000-000000050000")
-IProgress: public IUnknown
-{
- STDMETHOD(SetTotal)(UInt64 total) PURE;
- STDMETHOD(SetCompleted)(const UInt64 *completeValue) PURE;
-};
-
-/*
-// {23170F69-40C1-278A-0000-000000050002}
-DEFINE_GUID(IID_IProgress2,
-0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02);
-MIDL_INTERFACE("23170F69-40C1-278A-0000-000000050002")
-IProgress2: public IUnknown
-{
-public:
- STDMETHOD(SetTotal)(const UInt64 *total) PURE;
- STDMETHOD(SetCompleted)(const UInt64 *completeValue) PURE;
-};
-*/
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/IStream.h b/other-licenses/7zstub/src/7zip/IStream.h
deleted file mode 100644
index d92b89aa70..0000000000
--- a/other-licenses/7zstub/src/7zip/IStream.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// IStream.h
-
-#ifndef __ISTREAM_H
-#define __ISTREAM_H
-
-#include "../Common/MyUnknown.h"
-#include "../Common/Types.h"
-
-// "23170F69-40C1-278A-0000-000300xx0000"
-
-#define STREAM_INTERFACE_SUB(i, b, x) \
-DEFINE_GUID(IID_ ## i, \
-0x23170F69, 0x40C1, 0x278A, 0x00, 0x00, 0x00, 0x03, 0x00, x, 0x00, 0x00); \
-struct i: public b
-
-#define STREAM_INTERFACE(i, x) STREAM_INTERFACE_SUB(i, IUnknown, x)
-
-STREAM_INTERFACE(ISequentialInStream, 0x01)
-{
- STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize) PURE;
- /*
- Out: if size != 0, return_value = S_OK and (*processedSize == 0),
- then there are no more bytes in stream.
- if (size > 0) && there are bytes in stream,
- this function must read at least 1 byte.
- This function is allowed to read less than number of remaining bytes in stream.
- You must call Read function in loop, if you need exact amount of data
- */
-};
-
-STREAM_INTERFACE(ISequentialOutStream, 0x02)
-{
- STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize) PURE;
- /*
- if (size > 0) this function must write at least 1 byte.
- This function is allowed to write less than "size".
- You must call Write function in loop, if you need to write exact amount of data
- */
-};
-
-STREAM_INTERFACE_SUB(IInStream, ISequentialInStream, 0x03)
-{
- STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
-};
-
-STREAM_INTERFACE_SUB(IOutStream, ISequentialOutStream, 0x04)
-{
- STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
- STDMETHOD(SetSize)(Int64 newSize) PURE;
-};
-
-STREAM_INTERFACE(IStreamGetSize, 0x06)
-{
- STDMETHOD(GetSize)(UInt64 *size) PURE;
-};
-
-STREAM_INTERFACE(IOutStreamFlush, 0x07)
-{
- STDMETHOD(Flush)() PURE;
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/MyVersion.h b/other-licenses/7zstub/src/7zip/MyVersion.h
deleted file mode 100644
index 2bed0462a1..0000000000
--- a/other-licenses/7zstub/src/7zip/MyVersion.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#define MY_VER_MAJOR 4
-#define MY_VER_MINOR 42
-#define MY_VER_BUILD 0
-#define MY_VERSION "4.42"
-#define MY_7ZIP_VERSION "7-Zip 4.42"
-#define MY_DATE "2006-05-14"
-#define MY_COPYRIGHT "Copyright (c) 1999-2006 Igor Pavlov"
-#define MY_VERSION_COPYRIGHT_DATE MY_VERSION " " MY_COPYRIGHT " " MY_DATE
diff --git a/other-licenses/7zstub/src/7zip/MyVersionInfo.rc b/other-licenses/7zstub/src/7zip/MyVersionInfo.rc
deleted file mode 100644
index b0a5c338c3..0000000000
--- a/other-licenses/7zstub/src/7zip/MyVersionInfo.rc
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <WinVer.h>
-#include "MyVersion.h"
-
-#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,0
-
-#ifdef DEBUG
-#define DBG_FL VS_FF_DEBUG
-#else
-#define DBG_FL 0
-#endif
-
-#define MY_VERSION_INFO(fileType, descr, intName, origName) \
-LANGUAGE 9, 1 \
-1 VERSIONINFO \
- FILEVERSION MY_VER \
- PRODUCTVERSION MY_VER \
- FILEFLAGSMASK VS_FFI_FILEFLAGSMASK \
- FILEFLAGS DBG_FL \
- FILEOS VOS_NT_WINDOWS32 \
- FILETYPE fileType \
- FILESUBTYPE 0x0L \
-BEGIN \
- BLOCK "StringFileInfo" \
- BEGIN \
- BLOCK "040904b0" \
- BEGIN \
- VALUE "CompanyName", "Igor Pavlov" \
- VALUE "FileDescription", descr \
- VALUE "FileVersion", MY_VERSION \
- VALUE "InternalName", intName \
- VALUE "LegalCopyright", MY_COPYRIGHT \
- VALUE "OriginalFilename", origName \
- VALUE "ProductName", "7-Zip" \
- VALUE "ProductVersion", MY_VERSION \
- END \
- END \
-END
-
-#define MY_VERSION_INFO_APP(descr, intName) MY_VERSION_INFO(VFT_APP, descr, intName, intName ".exe")
-
-#define MY_VERSION_INFO_DLL(descr, intName) MY_VERSION_INFO(VFT_DLL, descr, intName, intName ".dll")
diff --git a/other-licenses/7zstub/src/7zip/PropID.h b/other-licenses/7zstub/src/7zip/PropID.h
deleted file mode 100644
index 1dd6ed8213..0000000000
--- a/other-licenses/7zstub/src/7zip/PropID.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Interface/PropID.h
-
-#ifndef __INTERFACE_PROPID_H
-#define __INTERFACE_PROPID_H
-
-enum
-{
- kpidNoProperty = 0,
-
- kpidHandlerItemIndex = 2,
- kpidPath,
- kpidName,
- kpidExtension,
- kpidIsFolder,
- kpidSize,
- kpidPackedSize,
- kpidAttributes,
- kpidCreationTime,
- kpidLastAccessTime,
- kpidLastWriteTime,
- kpidSolid,
- kpidCommented,
- kpidEncrypted,
- kpidSplitBefore,
- kpidSplitAfter,
- kpidDictionarySize,
- kpidCRC,
- kpidType,
- kpidIsAnti,
- kpidMethod,
- kpidHostOS,
- kpidFileSystem,
- kpidUser,
- kpidGroup,
- kpidBlock,
- kpidComment,
- kpidPosition,
- kpidPrefix,
-
- kpidTotalSize = 0x1100,
- kpidFreeSpace,
- kpidClusterSize,
- kpidVolumeName,
-
- kpidLocalName = 0x1200,
- kpidProvider,
-
- kpidUserDefined = 0x10000
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp b/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp
deleted file mode 100644
index bef05786b3..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-// ArchiveOpenCallback.cpp
-
-#include "StdAfx.h"
-
-#include "ArchiveOpenCallback.h"
-
-#include "Common/StringConvert.h"
-#include "Windows/PropVariant.h"
-
-#include "../../Common/FileStreams.h"
-
-using namespace NWindows;
-
-STDMETHODIMP COpenCallbackImp::SetTotal(const UInt64 *files, const UInt64 *bytes)
-{
- return Callback->SetTotal(files, bytes);
-}
-
-STDMETHODIMP COpenCallbackImp::SetCompleted(const UInt64 *files, const UInt64 *bytes)
-{
- return Callback->SetTotal(files, bytes);
-}
-
-STDMETHODIMP COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value)
-{
- NCOM::CPropVariant propVariant;
- if (_subArchiveMode)
- {
- switch(propID)
- {
- case kpidName:
- propVariant = _subArchiveName;
- break;
- }
- propVariant.Detach(value);
- return S_OK;
- }
- switch(propID)
- {
- case kpidName:
- propVariant = _fileInfo.Name;
- break;
- case kpidIsFolder:
- propVariant = _fileInfo.IsDirectory();
- break;
- case kpidSize:
- propVariant = _fileInfo.Size;
- break;
- case kpidAttributes:
- propVariant = (UInt32)_fileInfo.Attributes;
- break;
- case kpidLastAccessTime:
- propVariant = _fileInfo.LastAccessTime;
- break;
- case kpidCreationTime:
- propVariant = _fileInfo.CreationTime;
- break;
- case kpidLastWriteTime:
- propVariant = _fileInfo.LastWriteTime;
- break;
- }
- propVariant.Detach(value);
- return S_OK;
-}
-
-int COpenCallbackImp::FindName(const UString &name)
-{
- for (int i = 0; i < FileNames.Size(); i++)
- if (name.CompareNoCase(FileNames[i]) == 0)
- return i;
- return -1;
-}
-
-struct CInFileStreamVol: public CInFileStream
-{
- UString Name;
- COpenCallbackImp *OpenCallbackImp;
- CMyComPtr<IArchiveOpenCallback> OpenCallbackRef;
- ~CInFileStreamVol()
- {
- int index = OpenCallbackImp->FindName(Name);
- if (index >= 0)
- OpenCallbackImp->FileNames.Delete(index);
- }
-};
-
-STDMETHODIMP COpenCallbackImp::GetStream(const wchar_t *name,
- IInStream **inStream)
-{
- if (_subArchiveMode)
- return S_FALSE;
- RINOK(Callback->CheckBreak());
- *inStream = NULL;
- UString fullPath = _folderPrefix + name;
- if (!NFile::NFind::FindFile(fullPath, _fileInfo))
- return S_FALSE;
- if (_fileInfo.IsDirectory())
- return S_FALSE;
- CInFileStreamVol *inFile = new CInFileStreamVol;
- CMyComPtr<IInStream> inStreamTemp = inFile;
- if (!inFile->Open(fullPath))
- return ::GetLastError();
- *inStream = inStreamTemp.Detach();
- inFile->Name = name;
- inFile->OpenCallbackImp = this;
- inFile->OpenCallbackRef = this;
- FileNames.Add(name);
- return S_OK;
-}
-
-#ifndef _NO_CRYPTO
-STDMETHODIMP COpenCallbackImp::CryptoGetTextPassword(BSTR *password)
-{
- return Callback->CryptoGetTextPassword(password);
-}
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.h b/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.h
deleted file mode 100644
index 84d13edc56..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/ArchiveOpenCallback.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// ArchiveOpenCallback.h
-
-#ifndef __ARCHIVE_OPEN_CALLBACK_H
-#define __ARCHIVE_OPEN_CALLBACK_H
-
-#include "Common/String.h"
-#include "Common/MyCom.h"
-#include "Windows/FileFind.h"
-
-#ifndef _NO_CRYPTO
-#include "../../IPassword.h"
-#endif
-#include "../../Archive/IArchive.h"
-
-struct IOpenCallbackUI
-{
- virtual HRESULT CheckBreak() = 0;
- virtual HRESULT SetTotal(const UInt64 *files, const UInt64 *bytes) = 0;
- virtual HRESULT SetCompleted(const UInt64 *files, const UInt64 *bytes) = 0;
- #ifndef _NO_CRYPTO
- virtual HRESULT CryptoGetTextPassword(BSTR *password) = 0;
- virtual HRESULT GetPasswordIfAny(UString &password) = 0;
- #endif
-};
-
-class COpenCallbackImp:
- public IArchiveOpenCallback,
- public IArchiveOpenVolumeCallback,
- public IArchiveOpenSetSubArchiveName,
- #ifndef _NO_CRYPTO
- public ICryptoGetTextPassword,
- #endif
- public CMyUnknownImp
-{
-public:
- #ifndef _NO_CRYPTO
- MY_UNKNOWN_IMP3(
- IArchiveOpenVolumeCallback,
- ICryptoGetTextPassword,
- IArchiveOpenSetSubArchiveName
- )
- #else
- MY_UNKNOWN_IMP2(
- IArchiveOpenVolumeCallback,
- IArchiveOpenSetSubArchiveName
- )
- #endif
-
- STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes);
- STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes);
-
- // IArchiveOpenVolumeCallback
- STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value);
- STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream);
-
- #ifndef _NO_CRYPTO
- // ICryptoGetTextPassword
- STDMETHOD(CryptoGetTextPassword)(BSTR *password);
- #endif
-
- STDMETHOD(SetSubArchiveName(const wchar_t *name))
- {
- _subArchiveMode = true;
- _subArchiveName = name;
- return S_OK;
- }
-
-private:
- UString _folderPrefix;
- NWindows::NFile::NFind::CFileInfoW _fileInfo;
- bool _subArchiveMode;
- UString _subArchiveName;
-public:
- UStringVector FileNames;
- IOpenCallbackUI *Callback;
- void Init(const UString &folderPrefix, const UString &fileName)
- {
- _folderPrefix = folderPrefix;
- if (!NWindows::NFile::NFind::FindFile(_folderPrefix + fileName, _fileInfo))
- throw 1;
- FileNames.Clear();
- _subArchiveMode = false;
- }
- int FindName(const UString &name);
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.cpp b/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.cpp
deleted file mode 100644
index 08c352190d..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.cpp
+++ /dev/null
@@ -1,359 +0,0 @@
-// ArchiverInfo.cpp
-
-#include "StdAfx.h"
-
-#include "ArchiverInfo.h"
-
-#ifndef EXCLUDE_COM
-
-#include "Common/StringConvert.h"
-#include "Windows/FileFind.h"
-#include "Windows/FileName.h"
-#include "Windows/DLL.h"
-#ifdef _WIN32
-#include "Windows/Registry.h"
-#endif
-#include "Windows/PropVariant.h"
-#include "../../Archive/IArchive.h"
-
-using namespace NWindows;
-using namespace NFile;
-
-#endif
-
-extern HINSTANCE g_hInstance;
-
-#ifndef EXCLUDE_COM
-
-static void SplitString(const UString &srcString, UStringVector &destStrings)
-{
- destStrings.Clear();
- UString string;
- int len = srcString.Length();
- if (len == 0)
- return;
- for (int i = 0; i < len; i++)
- {
- wchar_t c = srcString[i];
- if (c == L' ')
- {
- if (!string.IsEmpty())
- {
- destStrings.Add(string);
- string.Empty();
- }
- }
- else
- string += c;
- }
- if (!string.IsEmpty())
- destStrings.Add(string);
-}
-
-typedef UInt32 (WINAPI * GetHandlerPropertyFunc)(
- PROPID propID, PROPVARIANT *value);
-
-static UString GetModuleFolderPrefix()
-{
- UString path;
- NDLL::MyGetModuleFileName(g_hInstance, path);
- int pos = path.ReverseFind(WCHAR_PATH_SEPARATOR);
- return path.Left(pos + 1);
-}
-
-static wchar_t *kFormatFolderName = L"Formats";
-
-#ifdef _WIN32
-static LPCTSTR kRegistryPath = TEXT("Software\\7-zip");
-static LPCWSTR kProgramPathValue = L"Path";
-static bool ReadPathFromRegistry(HKEY baseKey, UString &path)
-{
- NRegistry::CKey key;
- if(key.Open(baseKey, kRegistryPath, KEY_READ) == ERROR_SUCCESS)
- if (key.QueryValue(kProgramPathValue, path) == ERROR_SUCCESS)
- {
- NName::NormalizeDirPathPrefix(path);
- return true;
- }
- return false;
-}
-#endif
-
-static UString GetBaseFolderPrefixFromRegistry()
-{
- UString moduleFolderPrefix = GetModuleFolderPrefix();
- NFind::CFileInfoW fileInfo;
- if (NFind::FindFile(moduleFolderPrefix + kFormatFolderName, fileInfo))
- if (fileInfo.IsDirectory())
- return moduleFolderPrefix;
- UString path;
- #ifdef _WIN32
- if(ReadPathFromRegistry(HKEY_CURRENT_USER, path))
- return path;
- if(ReadPathFromRegistry(HKEY_LOCAL_MACHINE, path))
- return path;
- #endif
- return moduleFolderPrefix;
-}
-
-typedef UInt32 (WINAPI *CreateObjectPointer)(
- const GUID *clsID,
- const GUID *interfaceID,
- void **outObject);
-
-#endif
-
-#ifndef _SFX
-static void SetBuffer(CByteBuffer &bb, const Byte *data, int size)
-{
- bb.SetCapacity(size);
- memmove((Byte *)bb, data, size);
-}
-#endif
-
-void ReadArchiverInfoList(CObjectVector<CArchiverInfo> &archivers)
-{
- archivers.Clear();
-
- #ifdef EXCLUDE_COM
-
- #ifdef FORMAT_7Z
- {
- CArchiverInfo item;
- item.UpdateEnabled = true;
- item.Name = L"7z";
- item.Extensions.Add(CArchiverExtInfo(L"7z"));
- #ifndef _SFX
- const unsigned char kSig[] = {'7' , 'z', 0xBC, 0xAF, 0x27, 0x1C};
- SetBuffer(item.StartSignature, kSig, 6);
- #endif
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_BZIP2
- {
- CArchiverInfo item;
- item.UpdateEnabled = true;
- item.KeepName = true;
- item.Name = L"BZip2";
- item.Extensions.Add(CArchiverExtInfo(L"bz2"));
- item.Extensions.Add(CArchiverExtInfo(L"tbz2", L".tar"));
- #ifndef _SFX
- const unsigned char sig[] = {'B' , 'Z', 'h' };
- SetBuffer(item.StartSignature, sig, 3);
- #endif
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_GZIP
- {
- CArchiverInfo item;
- item.UpdateEnabled = true;
- item.Name = L"GZip";
- item.Extensions.Add(CArchiverExtInfo(L"gz"));
- item.Extensions.Add(CArchiverExtInfo(L"tgz", L".tar"));
- #ifndef _SFX
- const unsigned char sig[] = { 0x1F, 0x8B };
- SetBuffer(item.StartSignature, sig, 2);
- #endif
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_SPLIT
- {
- CArchiverInfo item;
- item.UpdateEnabled = false;
- item.KeepName = true;
- item.Name = L"Split";
- item.Extensions.Add(CArchiverExtInfo(L"001"));
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_TAR
- {
- CArchiverInfo item;
- item.UpdateEnabled = true;
- item.Name = L"Tar";
- item.Extensions.Add(CArchiverExtInfo(L"tar"));
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_ZIP
- {
- CArchiverInfo item;
- item.UpdateEnabled = true;
- item.Name = L"Zip";
- item.Extensions.Add(CArchiverExtInfo(L"zip"));
- #ifndef _SFX
- const unsigned char sig[] = { 0x50, 0x4B, 0x03, 0x04 };
- SetBuffer(item.StartSignature, sig, 4);
- #endif
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_CPIO
- {
- CArchiverInfo item;
- item.Name = L"Cpio";
- item.Extensions.Add(CArchiverExtInfo(L"cpio"));
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_RPM
- {
- CArchiverInfo item;
- item.Name = L"Rpm";
- item.Extensions.Add(CArchiverExtInfo(L"rpm", L".cpio.gz"));
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_ARJ
- {
- CArchiverInfo item;
- item.Name = L"Arj";
- item.Extensions.Add(CArchiverExtInfo(L"arj"));
- #ifndef _SFX
- const unsigned char sig[] = { 0x60, 0xEA };
- SetBuffer(item.StartSignature, sig, 2);
- #endif
- archivers.Add(item);
- }
- #endif
-
- #ifdef FORMAT_Z
- {
- CArchiverInfo item;
- item.Name = L"Z";
- item.Extensions.Add(CArchiverExtInfo(L"Z"));
- #ifndef _SFX
- const unsigned char sig[] = { 0x1F, 0x9D };
- SetBuffer(item.StartSignature, sig, 2);
- #endif
- archivers.Add(item);
- }
- #endif
-
- #else
-
- UString folderPath = GetBaseFolderPrefixFromRegistry() +
- (UString)kFormatFolderName + (UString)WSTRING_PATH_SEPARATOR;
- NFind::CEnumeratorW enumerator(folderPath + L"*");
- NFind::CFileInfoW fileInfo;
- while (enumerator.Next(fileInfo))
- {
- if (fileInfo.IsDirectory())
- continue;
- UString filePath = folderPath + fileInfo.Name;
- {
- NDLL::CLibrary library;
- if (!library.LoadEx(filePath, LOAD_LIBRARY_AS_DATAFILE))
- continue;
- }
-
- NDLL::CLibrary library;
- if (!library.Load(filePath))
- continue;
- GetHandlerPropertyFunc getHandlerProperty = (GetHandlerPropertyFunc)
- library.GetProcAddress("GetHandlerProperty");
- if (getHandlerProperty == NULL)
- continue;
-
- CArchiverInfo item;
- item.FilePath = filePath;
-
- NWindows::NCOM::CPropVariant prop;
- if (getHandlerProperty(NArchive::kName, &prop) != S_OK)
- continue;
- if (prop.vt != VT_BSTR)
- continue;
- item.Name = prop.bstrVal;
- prop.Clear();
-
- if (getHandlerProperty(NArchive::kClassID, &prop) != S_OK)
- continue;
- if (prop.vt != VT_BSTR)
- continue;
- item.ClassID = *(const GUID *)prop.bstrVal;
- prop.Clear();
-
- if (getHandlerProperty(NArchive::kExtension, &prop) != S_OK)
- continue;
- if (prop.vt != VT_BSTR)
- continue;
-
- UString ext = prop.bstrVal;
- UString addExt;
-
- prop.Clear();
-
- if (getHandlerProperty(NArchive::kAddExtension, &prop) != S_OK)
- continue;
- if (prop.vt == VT_BSTR)
- {
- addExt = prop.bstrVal;
- }
- else if (prop.vt != VT_EMPTY)
- continue;
- prop.Clear();
-
- UStringVector exts, addExts;
- SplitString(ext, exts);
- SplitString(addExt, addExts);
-
- prop.Clear();
- for (int i = 0; i < exts.Size(); i++)
- {
- CArchiverExtInfo extInfo;
- extInfo.Ext = exts[i];
- if (addExts.Size() > 0)
- extInfo.AddExt = addExts[i];
- if (extInfo.AddExt == L"*")
- extInfo.AddExt.Empty();
- item.Extensions.Add(extInfo);
- }
-
- if (getHandlerProperty(NArchive::kUpdate, &prop) == S_OK)
- if (prop.vt == VT_BOOL)
- item.UpdateEnabled = VARIANT_BOOLToBool(prop.boolVal);
- prop.Clear();
-
- if (item.UpdateEnabled)
- {
- if (getHandlerProperty(NArchive::kKeepName, &prop) == S_OK)
- if (prop.vt == VT_BOOL)
- item.KeepName = VARIANT_BOOLToBool(prop.boolVal);
- prop.Clear();
- }
-
- if (getHandlerProperty(NArchive::kStartSignature, &prop) == S_OK)
- {
- if (prop.vt == VT_BSTR)
- {
- UINT len = ::SysStringByteLen(prop.bstrVal);
- item.StartSignature.SetCapacity(len);
- memmove(item.StartSignature, prop.bstrVal, len);
- }
- }
- prop.Clear();
-
- if (getHandlerProperty(NArchive::kAssociate, &prop) == S_OK)
- if (prop.vt == VT_BOOL)
- item.Associate = VARIANT_BOOLToBool(prop.boolVal);
- prop.Clear();
-
-
- archivers.Add(item);
- }
-
- #endif
-}
-
-
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.h b/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.h
deleted file mode 100644
index 8c42f7c5b8..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/ArchiverInfo.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// ArchiverInfo.h
-
-#ifndef __ARCHIVERINFO_H
-#define __ARCHIVERINFO_H
-
-#include "Common/String.h"
-#include "Common/Types.h"
-#include "Common/Buffer.h"
-
-struct CArchiverExtInfo
-{
- UString Ext;
- UString AddExt;
- CArchiverExtInfo() {}
- CArchiverExtInfo(const UString &ext): Ext(ext) {}
- CArchiverExtInfo(const UString &ext, const UString &addExt): Ext(ext), AddExt(addExt) {}
-};
-
-struct CArchiverInfo
-{
- #ifndef EXCLUDE_COM
- UString FilePath;
- CLSID ClassID;
- #endif
- UString Name;
- CObjectVector<CArchiverExtInfo> Extensions;
- #ifndef _SFX
- CByteBuffer StartSignature;
- CByteBuffer FinishSignature;
- bool Associate;
- #endif
- int FindExtension(const UString &ext) const
- {
- for (int i = 0; i < Extensions.Size(); i++)
- if (ext.CompareNoCase(Extensions[i].Ext) == 0)
- return i;
- return -1;
- }
- UString GetAllExtensions() const
- {
- UString s;
- for (int i = 0; i < Extensions.Size(); i++)
- {
- if (i > 0)
- s += ' ';
- s += Extensions[i].Ext;
- }
- return s;
- }
- const UString &GetMainExtension() const
- {
- return Extensions[0].Ext;
- }
- bool UpdateEnabled;
- bool KeepName;
-
- CArchiverInfo(): UpdateEnabled(false), KeepName(false)
- #ifndef _SFX
- ,Associate(true)
- #endif
- {}
-};
-
-void ReadArchiverInfoList(CObjectVector<CArchiverInfo> &archivers);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/DefaultName.cpp b/other-licenses/7zstub/src/7zip/UI/Common/DefaultName.cpp
deleted file mode 100644
index 1ada83a89b..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/DefaultName.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-// DefaultName.cpp
-
-#include "StdAfx.h"
-
-#include "DefaultName.h"
-
-static const wchar_t *kEmptyFileAlias = L"[Content]";
-
-UString GetDefaultName2(const UString &fileName,
- const UString &extension, const UString &addSubExtension)
-{
- int extLength = extension.Length();
- int fileNameLength = fileName.Length();
- if (fileNameLength > extLength + 1)
- {
- int dotPos = fileNameLength - (extLength + 1);
- if (fileName[dotPos] == '.')
- if (extension.CompareNoCase(fileName.Mid(dotPos + 1)) == 0)
- return fileName.Left(dotPos) + addSubExtension;
- }
- return kEmptyFileAlias;
-}
-
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/DefaultName.h b/other-licenses/7zstub/src/7zip/UI/Common/DefaultName.h
deleted file mode 100644
index 1788cb8560..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/DefaultName.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// DefaultName.h
-
-#ifndef __DEFAULTNAME_H
-#define __DEFAULTNAME_H
-
-#include "Common/String.h"
-
-UString GetDefaultName2(const UString &fileName,
- const UString &extension, const UString &addSubExtension);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.cpp b/other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.cpp
deleted file mode 100644
index 59cb31cc59..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.cpp
+++ /dev/null
@@ -1,528 +0,0 @@
-// OpenArchive.cpp
-
-#include "StdAfx.h"
-
-#include "OpenArchive.h"
-
-#include "Common/Wildcard.h"
-
-#include "Windows/FileName.h"
-#include "Windows/FileDir.h"
-#include "Windows/Defs.h"
-#include "Windows/PropVariant.h"
-
-#include "../../Common/FileStreams.h"
-#include "../../Common/StreamUtils.h"
-
-#include "Common/StringConvert.h"
-
-#ifdef FORMAT_7Z
-#include "../../Archive/7z/7zHandler.h"
-#endif
-
-#ifdef FORMAT_BZIP2
-#include "../../Archive/BZip2/BZip2Handler.h"
-#endif
-
-#ifdef FORMAT_GZIP
-#include "../../Archive/GZip/GZipHandler.h"
-#endif
-
-#ifdef FORMAT_SPLIT
-#include "../../Archive/Split/SplitHandler.h"
-#endif
-
-#ifdef FORMAT_TAR
-#include "../../Archive/Tar/TarHandler.h"
-#endif
-
-#ifdef FORMAT_ZIP
-#include "../../Archive/Zip/ZipHandler.h"
-#endif
-
-#ifdef FORMAT_Z
-#include "../../Archive/Z/ZHandler.h"
-#endif
-
-#ifndef EXCLUDE_COM
-#include "HandlerLoader.h"
-#endif
-
-#include "DefaultName.h"
-
-using namespace NWindows;
-
-HRESULT GetArchiveItemPath(IInArchive *archive, UInt32 index, UString &result)
-{
- NCOM::CPropVariant prop;
- RINOK(archive->GetProperty(index, kpidPath, &prop));
- if(prop.vt == VT_BSTR)
- result = prop.bstrVal;
- else if (prop.vt == VT_EMPTY)
- result.Empty();
- else
- return E_FAIL;
- return S_OK;
-}
-
-HRESULT GetArchiveItemPath(IInArchive *archive, UInt32 index, const UString &defaultName, UString &result)
-{
- RINOK(GetArchiveItemPath(archive, index, result));
- if (result.IsEmpty())
- result = defaultName;
- return S_OK;
-}
-
-HRESULT GetArchiveItemFileTime(IInArchive *archive, UInt32 index,
- const FILETIME &defaultFileTime, FILETIME &fileTime)
-{
- NCOM::CPropVariant prop;
- RINOK(archive->GetProperty(index, kpidLastWriteTime, &prop));
- if (prop.vt == VT_FILETIME)
- fileTime = prop.filetime;
- else if (prop.vt == VT_EMPTY)
- fileTime = defaultFileTime;
- else
- return E_FAIL;
- return S_OK;
-}
-
-static HRESULT IsArchiveItemProp(IInArchive *archive, UInt32 index, PROPID propID, bool &result)
-{
- NCOM::CPropVariant prop;
- RINOK(archive->GetProperty(index, propID, &prop));
- if(prop.vt == VT_BOOL)
- result = VARIANT_BOOLToBool(prop.boolVal);
- else if (prop.vt == VT_EMPTY)
- result = false;
- else
- return E_FAIL;
- return S_OK;
-}
-
-HRESULT IsArchiveItemFolder(IInArchive *archive, UInt32 index, bool &result)
-{
- return IsArchiveItemProp(archive, index, kpidIsFolder, result);
-}
-
-HRESULT IsArchiveItemAnti(IInArchive *archive, UInt32 index, bool &result)
-{
- return IsArchiveItemProp(archive, index, kpidIsAnti, result);
-}
-
-// Static-SFX (for Linux) can be big
-const UInt64 kMaxCheckStartPosition =
-#ifdef _WIN32
-1 << 20;
-#else
-1 << 22;
-#endif
-
-
-HRESULT ReOpenArchive(IInArchive *archive, const UString &fileName)
-{
- CInFileStream *inStreamSpec = new CInFileStream;
- CMyComPtr<IInStream> inStream(inStreamSpec);
- inStreamSpec->Open(fileName);
- return archive->Open(inStream, &kMaxCheckStartPosition, NULL);
-}
-
-#ifndef _SFX
-static inline bool TestSignature(const Byte *p1, const Byte *p2, size_t size)
-{
- for (size_t i = 0; i < size; i++)
- if (p1[i] != p2[i])
- return false;
- return true;
-}
-#endif
-
-HRESULT OpenArchive(
- IInStream *inStream,
- const UString &fileName,
- #ifndef EXCLUDE_COM
- HMODULE *module,
- #endif
- IInArchive **archiveResult,
- CArchiverInfo &archiverInfoResult,
- UString &defaultItemName,
- IArchiveOpenCallback *openArchiveCallback)
-{
- *archiveResult = NULL;
- CObjectVector<CArchiverInfo> archiverInfoList;
- ReadArchiverInfoList(archiverInfoList);
- UString extension;
- {
- int dotPos = fileName.ReverseFind(L'.');
- if (dotPos >= 0)
- extension = fileName.Mid(dotPos + 1);
- }
- CIntVector orderIndices;
- int i;
- bool finded = false;
- for(i = 0; i < archiverInfoList.Size(); i++)
- {
- if (archiverInfoList[i].FindExtension(extension) >= 0)
- {
- orderIndices.Insert(0, i);
- finded = true;
- }
- else
- orderIndices.Add(i);
- }
-
- #ifndef _SFX
- if (!finded)
- {
- CByteBuffer byteBuffer;
- const UInt32 kBufferSize = (200 << 10);
- byteBuffer.SetCapacity(kBufferSize);
- Byte *buffer = byteBuffer;
- RINOK(inStream->Seek(0, STREAM_SEEK_SET, NULL));
- UInt32 processedSize;
- RINOK(ReadStream(inStream, buffer, kBufferSize, &processedSize));
- int numFinded = 0;
- for (int pos = (int)processedSize; pos >= 0 ; pos--)
- {
- for(int i = numFinded; i < orderIndices.Size(); i++)
- {
- int index = orderIndices[i];
- const CArchiverInfo &ai = archiverInfoList[index];
- const CByteBuffer &sig = ai.StartSignature;
- if (sig.GetCapacity() == 0)
- continue;
- if (pos + sig.GetCapacity() > processedSize)
- continue;
- if (TestSignature(buffer + pos, sig, sig.GetCapacity()))
- {
- orderIndices.Delete(i);
- orderIndices.Insert(0, index);
- numFinded++;
- }
- }
- }
- }
- #endif
-
- HRESULT badResult = S_OK;
- for(i = 0; i < orderIndices.Size(); i++)
- {
- inStream->Seek(0, STREAM_SEEK_SET, NULL);
- const CArchiverInfo &archiverInfo = archiverInfoList[orderIndices[i]];
- #ifndef EXCLUDE_COM
- CHandlerLoader loader;
- #endif
- CMyComPtr<IInArchive> archive;
-
- #ifdef FORMAT_7Z
- if (archiverInfo.Name.CompareNoCase(L"7z") == 0)
- archive = new NArchive::N7z::CHandler;
- #endif
-
- #ifdef FORMAT_BZIP2
- if (archiverInfo.Name.CompareNoCase(L"BZip2") == 0)
- archive = new NArchive::NBZip2::CHandler;
- #endif
-
- #ifdef FORMAT_GZIP
- if (archiverInfo.Name.CompareNoCase(L"GZip") == 0)
- archive = new NArchive::NGZip::CHandler;
- #endif
-
- #ifdef FORMAT_SPLIT
- if (archiverInfo.Name.CompareNoCase(L"Split") == 0)
- archive = new NArchive::NSplit::CHandler;
- #endif
-
- #ifdef FORMAT_TAR
- if (archiverInfo.Name.CompareNoCase(L"Tar") == 0)
- archive = new NArchive::NTar::CHandler;
- #endif
-
- #ifdef FORMAT_ZIP
- if (archiverInfo.Name.CompareNoCase(L"Zip") == 0)
- archive = new NArchive::NZip::CHandler;
- #endif
-
- #ifdef FORMAT_Z
- if (archiverInfo.Name.CompareNoCase(L"Z") == 0)
- archive = new NArchive::NZ::CHandler;
- #endif
-
-
- #ifndef EXCLUDE_COM
- if (!archive)
- {
- HRESULT result = loader.CreateHandler(archiverInfo.FilePath,
- archiverInfo.ClassID, (void **)&archive, false);
- if (result != S_OK)
- continue;
- }
- #endif
-
- if (!archive)
- return E_FAIL;
-
- HRESULT result = archive->Open(inStream, &kMaxCheckStartPosition, openArchiveCallback);
- if(result == S_FALSE)
- continue;
- if(result != S_OK)
- {
- badResult = result;
- if(result == E_ABORT)
- break;
- continue;
- }
- *archiveResult = archive.Detach();
- #ifndef EXCLUDE_COM
- *module = loader.Detach();
- #endif
- archiverInfoResult = archiverInfo;
- int subExtIndex = archiverInfo.FindExtension(extension);
- if (subExtIndex < 0)
- subExtIndex = 0;
- defaultItemName = GetDefaultName2(fileName,
- archiverInfo.Extensions[subExtIndex].Ext,
- archiverInfo.Extensions[subExtIndex].AddExt);
-
- return S_OK;
- }
- if (badResult != S_OK)
- return badResult;
- return S_FALSE;
-}
-
-HRESULT OpenArchive(const UString &filePath,
- #ifndef EXCLUDE_COM
- HMODULE *module,
- #endif
- IInArchive **archiveResult,
- CArchiverInfo &archiverInfo,
- UString &defaultItemName,
- IArchiveOpenCallback *openArchiveCallback)
-{
- CInFileStream *inStreamSpec = new CInFileStream;
- CMyComPtr<IInStream> inStream(inStreamSpec);
- if (!inStreamSpec->Open(filePath))
- return GetLastError();
- return OpenArchive(inStream, ExtractFileNameFromPath(filePath),
- #ifndef EXCLUDE_COM
- module,
- #endif
- archiveResult, archiverInfo,
- defaultItemName, openArchiveCallback);
-}
-
-static void MakeDefaultName(UString &name)
-{
- int dotPos = name.ReverseFind(L'.');
- if (dotPos < 0)
- return;
- UString ext = name.Mid(dotPos + 1);
- if (ext.IsEmpty())
- return;
- for (int pos = 0; pos < ext.Length(); pos++)
- if (ext[pos] < L'0' || ext[pos] > L'9')
- return;
- name = name.Left(dotPos);
-}
-
-HRESULT OpenArchive(const UString &fileName,
- #ifndef EXCLUDE_COM
- HMODULE *module0,
- HMODULE *module1,
- #endif
- IInArchive **archive0,
- IInArchive **archive1,
- CArchiverInfo &archiverInfo0,
- CArchiverInfo &archiverInfo1,
- UString &defaultItemName0,
- UString &defaultItemName1,
- IArchiveOpenCallback *openArchiveCallback)
-{
- HRESULT result = OpenArchive(fileName,
- #ifndef EXCLUDE_COM
- module0,
- #endif
- archive0, archiverInfo0, defaultItemName0, openArchiveCallback);
- RINOK(result);
- CMyComPtr<IInArchiveGetStream> getStream;
- result = (*archive0)->QueryInterface(IID_IInArchiveGetStream, (void **)&getStream);
- if (result != S_OK || getStream == 0)
- return S_OK;
-
- CMyComPtr<ISequentialInStream> subSeqStream;
- result = getStream->GetStream(0, &subSeqStream);
- if (result != S_OK)
- return S_OK;
-
- CMyComPtr<IInStream> subStream;
- if (subSeqStream.QueryInterface(IID_IInStream, &subStream) != S_OK)
- return S_OK;
- if (!subStream)
- return S_OK;
-
- UInt32 numItems;
- RINOK((*archive0)->GetNumberOfItems(&numItems));
- if (numItems < 1)
- return S_OK;
-
- UString subPath;
- RINOK(GetArchiveItemPath(*archive0, 0, subPath))
- if (subPath.IsEmpty())
- {
- MakeDefaultName(defaultItemName0);
- subPath = defaultItemName0;
- if (archiverInfo0.Name.CompareNoCase(L"7z") == 0)
- {
- if (subPath.Right(3).CompareNoCase(L".7z") != 0)
- subPath += L".7z";
- }
- }
- else
- subPath = ExtractFileNameFromPath(subPath);
-
- CMyComPtr<IArchiveOpenSetSubArchiveName> setSubArchiveName;
- openArchiveCallback->QueryInterface(IID_IArchiveOpenSetSubArchiveName, (void **)&setSubArchiveName);
- if (setSubArchiveName)
- setSubArchiveName->SetSubArchiveName(subPath);
-
- result = OpenArchive(subStream, subPath,
- #ifndef EXCLUDE_COM
- module1,
- #endif
- archive1, archiverInfo1, defaultItemName1, openArchiveCallback);
- return S_OK;
-}
-
-HRESULT MyOpenArchive(const UString &archiveName,
- #ifndef EXCLUDE_COM
- HMODULE *module,
- #endif
- IInArchive **archive,
- UString &defaultItemName,
- IOpenCallbackUI *openCallbackUI)
-{
- COpenCallbackImp *openCallbackSpec = new COpenCallbackImp;
- CMyComPtr<IArchiveOpenCallback> openCallback = openCallbackSpec;
- openCallbackSpec->Callback = openCallbackUI;
-
- UString fullName;
- int fileNamePartStartIndex;
- NFile::NDirectory::MyGetFullPathName(archiveName, fullName, fileNamePartStartIndex);
- openCallbackSpec->Init(
- fullName.Left(fileNamePartStartIndex),
- fullName.Mid(fileNamePartStartIndex));
-
- CArchiverInfo archiverInfo;
- return OpenArchive(archiveName,
- #ifndef EXCLUDE_COM
- module,
- #endif
- archive,
- archiverInfo,
- defaultItemName,
- openCallback);
-}
-
-HRESULT MyOpenArchive(const UString &archiveName,
- #ifndef EXCLUDE_COM
- HMODULE *module0,
- HMODULE *module1,
- #endif
- IInArchive **archive0,
- IInArchive **archive1,
- UString &defaultItemName0,
- UString &defaultItemName1,
- UStringVector &volumePaths,
- IOpenCallbackUI *openCallbackUI)
-{
- COpenCallbackImp *openCallbackSpec = new COpenCallbackImp;
- CMyComPtr<IArchiveOpenCallback> openCallback = openCallbackSpec;
- openCallbackSpec->Callback = openCallbackUI;
-
- UString fullName;
- int fileNamePartStartIndex;
- NFile::NDirectory::MyGetFullPathName(archiveName, fullName, fileNamePartStartIndex);
- UString prefix = fullName.Left(fileNamePartStartIndex);
- UString name = fullName.Mid(fileNamePartStartIndex);
- openCallbackSpec->Init(prefix, name);
-
- CArchiverInfo archiverInfo0, archiverInfo1;
- HRESULT result = OpenArchive(archiveName,
- #ifndef EXCLUDE_COM
- module0,
- module1,
- #endif
- archive0,
- archive1,
- archiverInfo0,
- archiverInfo1,
- defaultItemName0,
- defaultItemName1,
- openCallback);
- RINOK(result);
- volumePaths.Add(prefix + name);
- for (int i = 0; i < openCallbackSpec->FileNames.Size(); i++)
- volumePaths.Add(prefix + openCallbackSpec->FileNames[i]);
- return S_OK;
-}
-
-HRESULT CArchiveLink::Close()
-{
- if (Archive1 != 0)
- RINOK(Archive1->Close());
- if (Archive0 != 0)
- RINOK(Archive0->Close());
- return S_OK;
-}
-
-void CArchiveLink::Release()
-{
- if (Archive1 != 0)
- Archive1.Release();
- if (Archive0 != 0)
- Archive0.Release();
- #ifndef EXCLUDE_COM
- Library1.Free();
- Library0.Free();
- #endif
-}
-
-HRESULT OpenArchive(const UString &archiveName,
- CArchiveLink &archiveLink,
- IArchiveOpenCallback *openCallback)
-{
- return OpenArchive(archiveName,
- #ifndef EXCLUDE_COM
- &archiveLink.Library0, &archiveLink.Library1,
- #endif
- &archiveLink.Archive0, &archiveLink.Archive1,
- archiveLink.ArchiverInfo0, archiveLink.ArchiverInfo1,
- archiveLink.DefaultItemName0, archiveLink.DefaultItemName1,
- openCallback);
-}
-
-HRESULT MyOpenArchive(const UString &archiveName,
- CArchiveLink &archiveLink,
- IOpenCallbackUI *openCallbackUI)
-{
- return MyOpenArchive(archiveName,
- #ifndef EXCLUDE_COM
- &archiveLink.Library0, &archiveLink.Library1,
- #endif
- &archiveLink.Archive0, &archiveLink.Archive1,
- archiveLink.DefaultItemName0, archiveLink.DefaultItemName1,
- archiveLink.VolumePaths,
- openCallbackUI);
-}
-
-HRESULT ReOpenArchive(CArchiveLink &archiveLink,
- const UString &fileName)
-{
- if (archiveLink.GetNumLevels() > 1)
- return E_NOTIMPL;
- if (archiveLink.GetNumLevels() == 0)
- return MyOpenArchive(fileName, archiveLink, 0);
- return ReOpenArchive(archiveLink.GetArchive(), fileName);
-}
diff --git a/other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.h b/other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.h
deleted file mode 100644
index be6d757d7f..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Common/OpenArchive.h
+++ /dev/null
@@ -1,134 +0,0 @@
-// OpenArchive.h
-
-#ifndef __OPENARCHIVE_H
-#define __OPENARCHIVE_H
-
-#include "Common/String.h"
-#include "Windows/FileFind.h"
-
-#include "../../Archive/IArchive.h"
-#include "ArchiverInfo.h"
-#include "ArchiveOpenCallback.h"
-
-#ifndef EXCLUDE_COM
-#include "Windows/DLL.h"
-#endif
-
-HRESULT GetArchiveItemPath(IInArchive *archive, UInt32 index, UString &result);
-HRESULT GetArchiveItemPath(IInArchive *archive, UInt32 index, const UString &defaultName, UString &result);
-HRESULT GetArchiveItemFileTime(IInArchive *archive, UInt32 index,
- const FILETIME &defaultFileTime, FILETIME &fileTime);
-HRESULT IsArchiveItemFolder(IInArchive *archive, UInt32 index, bool &result);
-HRESULT IsArchiveItemAnti(IInArchive *archive, UInt32 index, bool &result);
-
-struct ISetSubArchiveName
-{
- virtual void SetSubArchiveName(const wchar_t *name) = 0;
-};
-
-HRESULT OpenArchive(
- IInStream *inStream,
- const UString &fileName,
- #ifndef EXCLUDE_COM
- HMODULE *module,
- #endif
- IInArchive **archiveResult,
- CArchiverInfo &archiverInfoResult,
- UString &defaultItemName,
- IArchiveOpenCallback *openArchiveCallback);
-
-HRESULT OpenArchive(const UString &filePath,
- #ifndef EXCLUDE_COM
- HMODULE *module,
- #endif
- IInArchive **archive,
- CArchiverInfo &archiverInfo,
- UString &defaultItemName,
- IArchiveOpenCallback *openArchiveCallback);
-
-HRESULT OpenArchive(const UString &filePath,
- #ifndef EXCLUDE_COM
- HMODULE *module0,
- HMODULE *module1,
- #endif
- IInArchive **archive0,
- IInArchive **archive1,
- CArchiverInfo &archiverInfo0,
- CArchiverInfo &archiverInfo1,
- UString &defaultItemName0,
- UString &defaultItemName1,
- IArchiveOpenCallback *openArchiveCallback);
-
-
-HRESULT ReOpenArchive(IInArchive *archive,
- const UString &fileName);
-
-HRESULT MyOpenArchive(const UString &archiveName,
- #ifndef EXCLUDE_COM
- HMODULE *module,
- #endif
- IInArchive **archive,
- UString &defaultItemName,
- IOpenCallbackUI *openCallbackUI);
-
-HRESULT MyOpenArchive(const UString &archiveName,
- #ifndef EXCLUDE_COM
- HMODULE *module0,
- HMODULE *module1,
- #endif
- IInArchive **archive0,
- IInArchive **archive1,
- UString &defaultItemName0,
- UString &defaultItemName1,
- UStringVector &volumePaths,
- IOpenCallbackUI *openCallbackUI);
-
-struct CArchiveLink
-{
- #ifndef EXCLUDE_COM
- NWindows::NDLL::CLibrary Library0;
- NWindows::NDLL::CLibrary Library1;
- #endif
- CMyComPtr<IInArchive> Archive0;
- CMyComPtr<IInArchive> Archive1;
- UString DefaultItemName0;
- UString DefaultItemName1;
-
- CArchiverInfo ArchiverInfo0;
- CArchiverInfo ArchiverInfo1;
-
- UStringVector VolumePaths;
-
- int GetNumLevels() const
- {
- int result = 0;
- if (Archive0)
- {
- result++;
- if (Archive1)
- result++;
- }
- return result;
- }
-
-
- IInArchive *GetArchive() { return Archive1 != 0 ? Archive1: Archive0; }
- UString GetDefaultItemName() { return Archive1 != 0 ? DefaultItemName1: DefaultItemName0; }
- const CArchiverInfo &GetArchiverInfo() { return Archive1 != 0 ? ArchiverInfo1: ArchiverInfo0; }
- HRESULT Close();
- void Release();
-};
-
-HRESULT OpenArchive(const UString &archiveName,
- CArchiveLink &archiveLink,
- IArchiveOpenCallback *openCallback);
-
-HRESULT MyOpenArchive(const UString &archiveName,
- CArchiveLink &archiveLink,
- IOpenCallbackUI *openCallbackUI);
-
-HRESULT ReOpenArchive(CArchiveLink &archiveLink,
- const UString &fileName);
-
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.cpp b/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.cpp
deleted file mode 100644
index 92558930d8..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-// MyMessages.cpp
-
-#include "StdAfx.h"
-
-#include "MyMessages.h"
-#include "Common/String.h"
-#include "Common/StringConvert.h"
-
-#include "Windows/Error.h"
-#include "Windows/ResourceString.h"
-
-#ifdef LANG
-#include "../../FileManager/LangUtils.h"
-#endif
-
-using namespace NWindows;
-
-void MyMessageBox(HWND window, LPCWSTR message)
-{
- ::MessageBoxW(window, message, L"7-Zip", 0);
-}
-
-void MyMessageBox(UINT32 id
- #ifdef LANG
- ,UINT32 langID
- #endif
- )
-{
- #ifdef LANG
- MyMessageBox(LangString(id, langID));
- #else
- MyMessageBox(MyLoadStringW(id));
- #endif
-}
-
-void ShowErrorMessage(HWND window, DWORD message)
-{
- MyMessageBox(window, NError::MyFormatMessageW(message));
-}
-
-void ShowLastErrorMessage(HWND window)
-{
- ShowErrorMessage(window, ::GetLastError());
-}
-
diff --git a/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.h b/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.h
deleted file mode 100644
index e3a755eef8..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/Explorer/MyMessages.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// MyMessages.h
-
-#ifndef __MYMESSAGES_H
-#define __MYMESSAGES_H
-
-#include "Common/String.h"
-
-void MyMessageBox(HWND window, LPCWSTR message);
-
-inline void MyMessageBox(LPCWSTR message)
- { MyMessageBox(0, message); }
-
-void MyMessageBox(UINT32 id
- #ifdef LANG
- ,UINT32 langID
- #endif
- );
-
-void ShowErrorMessage(HWND window, DWORD errorMessage);
-inline void ShowErrorMessage(DWORD errorMessage)
- { ShowErrorMessage(0, errorMessage); }
-void ShowLastErrorMessage(HWND window = 0);
-
-#endif
diff --git a/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.cpp b/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.cpp
deleted file mode 100644
index 98afce4ca1..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// OpenCallbackGUI.cpp
-
-#include "StdAfx.h"
-
-#include "OpenCallbackGUI.h"
-
-#include "Common/StdOutStream.h"
-#include "Common/StdInStream.h"
-#include "Common/StringConvert.h"
-
-#ifndef _NO_CRYPTO
-#include "../../FileManager/Resource/PasswordDialog/PasswordDialog.h"
-#endif
-
-HRESULT COpenCallbackGUI::CheckBreak()
-{
- return S_OK;
-}
-
-HRESULT COpenCallbackGUI::SetTotal(const UInt64 *files, const UInt64 *bytes)
-{
- return S_OK;
-}
-
-HRESULT COpenCallbackGUI::SetCompleted(const UInt64 *files, const UInt64 *bytes)
-{
- return S_OK;
-}
-
-#ifndef _NO_CRYPTO
-HRESULT COpenCallbackGUI::CryptoGetTextPassword(BSTR *password)
-{
- if (!PasswordIsDefined)
- {
- CPasswordDialog dialog;
- if (dialog.Create(ParentWindow) == IDCANCEL)
- return E_ABORT;
- Password = dialog.Password;
- PasswordIsDefined = true;
- }
- CMyComBSTR tempName(Password);
- *password = tempName.Detach();
- return S_OK;
-}
-
-HRESULT COpenCallbackGUI::GetPasswordIfAny(UString &password)
-{
- if (PasswordIsDefined)
- password = Password;
- return S_OK;
-}
-#endif
-
diff --git a/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.h b/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.h
deleted file mode 100644
index 76a6ec41cf..0000000000
--- a/other-licenses/7zstub/src/7zip/UI/GUI/OpenCallbackGUI.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// OpenCallbackGUI.h
-
-#ifndef __OPEN_CALLBACK_GUI_H
-#define __OPEN_CALLBACK_GUI_H
-
-#include "../Common/ArchiveOpenCallback.h"
-
-class COpenCallbackGUI: public IOpenCallbackUI
-{
-public:
- HRESULT CheckBreak();
- HRESULT SetTotal(const UInt64 *files, const UInt64 *bytes);
- HRESULT SetCompleted(const UInt64 *files, const UInt64 *bytes);
- #ifndef _NO_CRYPTO
- HRESULT CryptoGetTextPassword(BSTR *password);
- HRESULT GetPasswordIfAny(UString &password);
- bool PasswordIsDefined;
- UString Password;
- #endif
-
- HWND ParentWindow;
-
- COpenCallbackGUI():
- #ifndef _NO_CRYPTO
- PasswordIsDefined(false),
- #endif
- ParentWindow(0) {}
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/Asm/arm/7zCrcOpt.asm b/other-licenses/7zstub/src/Asm/arm/7zCrcOpt.asm
new file mode 100644
index 0000000000..f008d658c3
--- /dev/null
+++ b/other-licenses/7zstub/src/Asm/arm/7zCrcOpt.asm
@@ -0,0 +1,100 @@
+ CODE32
+
+ EXPORT |CrcUpdateT4@16|
+
+ AREA |.text|, CODE, ARM
+
+ MACRO
+ CRC32_STEP_1
+
+ ldrb r4, [r1], #1
+ subs r2, r2, #1
+ eor r4, r4, r0
+ and r4, r4, #0xFF
+ ldr r4, [r3, +r4, lsl #2]
+ eor r0, r4, r0, lsr #8
+
+ MEND
+
+
+ MACRO
+ CRC32_STEP_4 $STREAM_WORD
+
+ eor r7, r7, r8
+ eor r7, r7, r9
+ eor r0, r0, r7
+ eor r0, r0, $STREAM_WORD
+ ldr $STREAM_WORD, [r1], #4
+
+ and r7, r0, #0xFF
+ and r8, r0, #0xFF00
+ and r9, r0, #0xFF0000
+ and r0, r0, #0xFF000000
+
+ ldr r7, [r6, +r7, lsl #2]
+ ldr r8, [r5, +r8, lsr #6]
+ ldr r9, [r4, +r9, lsr #14]
+ ldr r0, [r3, +r0, lsr #22]
+
+ MEND
+
+
+|CrcUpdateT4@16| PROC
+
+ stmdb sp!, {r4-r11, lr}
+ cmp r2, #0
+ beq |$fin|
+
+|$v1|
+ tst r1, #7
+ beq |$v2|
+ CRC32_STEP_1
+ bne |$v1|
+
+|$v2|
+ cmp r2, #16
+ blo |$v3|
+
+ ldr r10, [r1], #4
+ ldr r11, [r1], #4
+
+ add r4, r3, #0x400
+ add r5, r3, #0x800
+ add r6, r3, #0xC00
+
+ mov r7, #0
+ mov r8, #0
+ mov r9, #0
+
+ sub r2, r2, #16
+
+|$loop|
+ ; pld [r1, #0x40]
+
+ CRC32_STEP_4 r10
+ CRC32_STEP_4 r11
+
+ subs r2, r2, #8
+ bhs |$loop|
+
+ sub r1, r1, #8
+ add r2, r2, #16
+
+ eor r7, r7, r8
+ eor r7, r7, r9
+ eor r0, r0, r7
+
+|$v3|
+ cmp r2, #0
+ beq |$fin|
+
+|$v4|
+ CRC32_STEP_1
+ bne |$v4|
+
+|$fin|
+ ldmia sp!, {r4-r11, pc}
+
+|CrcUpdateT4@16| ENDP
+
+ END
diff --git a/other-licenses/7zstub/src/Asm/x86/7zAsm.asm b/other-licenses/7zstub/src/Asm/x86/7zAsm.asm
new file mode 100644
index 0000000000..8c30d7b7e3
--- /dev/null
+++ b/other-licenses/7zstub/src/Asm/x86/7zAsm.asm
@@ -0,0 +1,147 @@
+; 7zAsm.asm -- ASM macros
+; 2018-02-03 : Igor Pavlov : Public domain
+
+MY_ASM_START macro
+ ifdef x64
+ .code
+ else
+ .386
+ .model flat
+ _TEXT$00 SEGMENT PARA PUBLIC 'CODE'
+ endif
+endm
+
+MY_PROC macro name:req, numParams:req
+ align 16
+ proc_numParams = numParams
+ ifdef x64
+ proc_name equ name
+ else
+ proc_name equ @CatStr(@,name,@, %numParams * 4)
+ endif
+ proc_name PROC
+endm
+
+MY_ENDP macro
+ ifdef x64
+ ret
+ else
+ if proc_numParams LT 3
+ ret
+ else
+ ret (proc_numParams - 2) * 4
+ endif
+ endif
+ proc_name ENDP
+endm
+
+ifdef x64
+ REG_SIZE equ 8
+ REG_LOGAR_SIZE equ 3
+else
+ REG_SIZE equ 4
+ REG_LOGAR_SIZE equ 2
+endif
+
+ x0 equ EAX
+ x1 equ ECX
+ x2 equ EDX
+ x3 equ EBX
+ x4 equ ESP
+ x5 equ EBP
+ x6 equ ESI
+ x7 equ EDI
+
+ x0_W equ AX
+ x1_W equ CX
+ x2_W equ DX
+ x3_W equ BX
+
+ x5_W equ BP
+ x6_W equ SI
+ x7_W equ DI
+
+ x0_L equ AL
+ x1_L equ CL
+ x2_L equ DL
+ x3_L equ BL
+
+ x0_H equ AH
+ x1_H equ CH
+ x2_H equ DH
+ x3_H equ BH
+
+ifdef x64
+ x5_L equ BPL
+ x6_L equ SIL
+ x7_L equ DIL
+
+ r0 equ RAX
+ r1 equ RCX
+ r2 equ RDX
+ r3 equ RBX
+ r4 equ RSP
+ r5 equ RBP
+ r6 equ RSI
+ r7 equ RDI
+ x8 equ r8d
+ x9 equ r9d
+ x10 equ r10d
+ x11 equ r11d
+ x12 equ r12d
+ x13 equ r13d
+ x14 equ r14d
+ x15 equ r15d
+else
+ r0 equ x0
+ r1 equ x1
+ r2 equ x2
+ r3 equ x3
+ r4 equ x4
+ r5 equ x5
+ r6 equ x6
+ r7 equ x7
+endif
+
+MY_PUSH_4_REGS macro
+ push r3
+ push r5
+ push r6
+ push r7
+endm
+
+MY_POP_4_REGS macro
+ pop r7
+ pop r6
+ pop r5
+ pop r3
+endm
+
+
+ifdef x64
+
+; for WIN64-x64 ABI:
+
+REG_PARAM_0 equ r1
+REG_PARAM_1 equ r2
+REG_PARAM_2 equ r8
+REG_PARAM_3 equ r9
+
+MY_PUSH_PRESERVED_REGS macro
+ MY_PUSH_4_REGS
+ push r12
+ push r13
+ push r14
+ push r15
+endm
+
+
+MY_POP_PRESERVED_REGS macro
+ pop r15
+ pop r14
+ pop r13
+ pop r12
+ MY_POP_4_REGS
+endm
+
+endif
diff --git a/other-licenses/7zstub/src/Asm/x86/7zCrcOpt.asm b/other-licenses/7zstub/src/Asm/x86/7zCrcOpt.asm
new file mode 100644
index 0000000000..2de51719ad
--- /dev/null
+++ b/other-licenses/7zstub/src/Asm/x86/7zCrcOpt.asm
@@ -0,0 +1,147 @@
+; 7zCrcOpt.asm -- CRC32 calculation : optimized version
+; 2009-12-12 : Igor Pavlov : Public domain
+
+include 7zAsm.asm
+
+MY_ASM_START
+
+rD equ r2
+rN equ r7
+
+ifdef x64
+ num_VAR equ r8
+ table_VAR equ r9
+else
+ data_size equ (REG_SIZE * 5)
+ crc_table equ (REG_SIZE + data_size)
+ num_VAR equ [r4 + data_size]
+ table_VAR equ [r4 + crc_table]
+endif
+
+SRCDAT equ rN + rD + 4 *
+
+CRC macro op:req, dest:req, src:req, t:req
+ op dest, DWORD PTR [r5 + src * 4 + 0400h * t]
+endm
+
+CRC_XOR macro dest:req, src:req, t:req
+ CRC xor, dest, src, t
+endm
+
+CRC_MOV macro dest:req, src:req, t:req
+ CRC mov, dest, src, t
+endm
+
+CRC1b macro
+ movzx x6, BYTE PTR [rD]
+ inc rD
+ movzx x3, x0_L
+ xor x6, x3
+ shr x0, 8
+ CRC xor, x0, r6, 0
+ dec rN
+endm
+
+MY_PROLOG macro crc_end:req
+ MY_PUSH_4_REGS
+
+ mov x0, x1
+ mov rN, num_VAR
+ mov r5, table_VAR
+ test rN, rN
+ jz crc_end
+ @@:
+ test rD, 7
+ jz @F
+ CRC1b
+ jnz @B
+ @@:
+ cmp rN, 16
+ jb crc_end
+ add rN, rD
+ mov num_VAR, rN
+ sub rN, 8
+ and rN, NOT 7
+ sub rD, rN
+ xor x0, [SRCDAT 0]
+endm
+
+MY_EPILOG macro crc_end:req
+ xor x0, [SRCDAT 0]
+ mov rD, rN
+ mov rN, num_VAR
+ sub rN, rD
+ crc_end:
+ test rN, rN
+ jz @F
+ CRC1b
+ jmp crc_end
+ @@:
+ MY_POP_4_REGS
+endm
+
+MY_PROC CrcUpdateT8, 4
+ MY_PROLOG crc_end_8
+ mov x1, [SRCDAT 1]
+ align 16
+ main_loop_8:
+ mov x6, [SRCDAT 2]
+ movzx x3, x1_L
+ CRC_XOR x6, r3, 3
+ movzx x3, x1_H
+ CRC_XOR x6, r3, 2
+ shr x1, 16
+ movzx x3, x1_L
+ movzx x1, x1_H
+ CRC_XOR x6, r3, 1
+ movzx x3, x0_L
+ CRC_XOR x6, r1, 0
+
+ mov x1, [SRCDAT 3]
+ CRC_XOR x6, r3, 7
+ movzx x3, x0_H
+ shr x0, 16
+ CRC_XOR x6, r3, 6
+ movzx x3, x0_L
+ CRC_XOR x6, r3, 5
+ movzx x3, x0_H
+ CRC_MOV x0, r3, 4
+ xor x0, x6
+ add rD, 8
+ jnz main_loop_8
+
+ MY_EPILOG crc_end_8
+MY_ENDP
+
+MY_PROC CrcUpdateT4, 4
+ MY_PROLOG crc_end_4
+ align 16
+ main_loop_4:
+ movzx x1, x0_L
+ movzx x3, x0_H
+ shr x0, 16
+ movzx x6, x0_H
+ and x0, 0FFh
+ CRC_MOV x1, r1, 3
+ xor x1, [SRCDAT 1]
+ CRC_XOR x1, r3, 2
+ CRC_XOR x1, r6, 0
+ CRC_XOR x1, r0, 1
+
+ movzx x0, x1_L
+ movzx x3, x1_H
+ shr x1, 16
+ movzx x6, x1_H
+ and x1, 0FFh
+ CRC_MOV x0, r0, 3
+ xor x0, [SRCDAT 2]
+ CRC_XOR x0, r3, 2
+ CRC_XOR x0, r6, 0
+ CRC_XOR x0, r1, 1
+ add rD, 8
+ jnz main_loop_4
+
+ MY_EPILOG crc_end_4
+MY_ENDP
+
+end
diff --git a/other-licenses/7zstub/src/Asm/x86/AesOpt.asm b/other-licenses/7zstub/src/Asm/x86/AesOpt.asm
new file mode 100644
index 0000000000..c32e48f886
--- /dev/null
+++ b/other-licenses/7zstub/src/Asm/x86/AesOpt.asm
@@ -0,0 +1,237 @@
+; AesOpt.asm -- Intel's AES.
+; 2009-12-12 : Igor Pavlov : Public domain
+
+include 7zAsm.asm
+
+MY_ASM_START
+
+ifndef x64
+ .xmm
+endif
+
+ifdef x64
+ num equ r8
+else
+ num equ [r4 + REG_SIZE * 4]
+endif
+
+rD equ r2
+rN equ r0
+
+MY_PROLOG macro reg:req
+ ifdef x64
+ movdqa [r4 + 8], xmm6
+ movdqa [r4 + 8 + 16], xmm7
+ endif
+
+ push r3
+ push r5
+ push r6
+
+ mov rN, num
+ mov x6, [r1 + 16]
+ shl x6, 5
+
+ movdqa reg, [r1]
+ add r1, 32
+endm
+
+MY_EPILOG macro
+ pop r6
+ pop r5
+ pop r3
+
+ ifdef x64
+ movdqa xmm6, [r4 + 8]
+ movdqa xmm7, [r4 + 8 + 16]
+ endif
+
+ MY_ENDP
+endm
+
+ways equ 4
+ways16 equ (ways * 16)
+
+OP_W macro op, op2
+ i = 0
+ rept ways
+ op @CatStr(xmm,%i), op2
+ i = i + 1
+ endm
+endm
+
+LOAD_OP macro op:req, offs:req
+ op xmm0, [r1 + r3 offs]
+endm
+
+LOAD_OP_W macro op:req, offs:req
+ movdqa xmm7, [r1 + r3 offs]
+ OP_W op, xmm7
+endm
+
+
+; ---------- AES-CBC Decode ----------
+
+CBC_DEC_UPDATE macro reg, offs
+ pxor reg, xmm6
+ movdqa xmm6, [rD + offs]
+ movdqa [rD + offs], reg
+endm
+
+DECODE macro op:req
+ op aesdec, +16
+ @@:
+ op aesdec, +0
+ op aesdec, -16
+ sub x3, 32
+ jnz @B
+ op aesdeclast, +0
+endm
+
+MY_PROC AesCbc_Decode_Intel, 3
+ MY_PROLOG xmm6
+
+ sub x6, 32
+
+ jmp check2
+
+ align 16
+ nextBlocks2:
+ mov x3, x6
+ OP_W movdqa, [rD + i * 16]
+ LOAD_OP_W pxor, +32
+ DECODE LOAD_OP_W
+ OP_W CBC_DEC_UPDATE, i * 16
+ add rD, ways16
+ check2:
+ sub rN, ways
+ jnc nextBlocks2
+
+ add rN, ways
+ jmp check
+
+ nextBlock:
+ mov x3, x6
+ movdqa xmm1, [rD]
+ LOAD_OP movdqa, +32
+ pxor xmm0, xmm1
+ DECODE LOAD_OP
+ pxor xmm0, xmm6
+ movdqa [rD], xmm0
+ movdqa xmm6, xmm1
+ add rD, 16
+ check:
+ sub rN, 1
+ jnc nextBlock
+
+ movdqa [r1 - 32], xmm6
+ MY_EPILOG
+
+
+; ---------- AES-CBC Encode ----------
+
+ENCODE macro op:req
+ op aesenc, -16
+ @@:
+ op aesenc, +0
+ op aesenc, +16
+ add r3, 32
+ jnz @B
+ op aesenclast, +0
+endm
+
+MY_PROC AesCbc_Encode_Intel, 3
+ MY_PROLOG xmm0
+
+ add r1, r6
+ neg r6
+ add r6, 32
+
+ jmp check_e
+
+ align 16
+ nextBlock_e:
+ mov r3, r6
+ pxor xmm0, [rD]
+ pxor xmm0, [r1 + r3 - 32]
+ ENCODE LOAD_OP
+ movdqa [rD], xmm0
+ add rD, 16
+ check_e:
+ sub rN, 1
+ jnc nextBlock_e
+
+ movdqa [r1 + r6 - 64], xmm0
+ MY_EPILOG
+
+
+; ---------- AES-CTR ----------
+
+XOR_UPD_1 macro reg, offs
+ pxor reg, [rD + offs]
+endm
+
+XOR_UPD_2 macro reg, offs
+ movdqa [rD + offs], reg
+endm
+
+MY_PROC AesCtr_Code_Intel, 3
+ MY_PROLOG xmm6
+
+ mov r5, r4
+ shr r5, 4
+ dec r5
+ shl r5, 4
+
+ mov DWORD PTR [r5], 1
+ mov DWORD PTR [r5 + 4], 0
+ mov DWORD PTR [r5 + 8], 0
+ mov DWORD PTR [r5 + 12], 0
+
+ add r1, r6
+ neg r6
+ add r6, 32
+
+ jmp check2_c
+
+ align 16
+ nextBlocks2_c:
+ movdqa xmm7, [r5]
+
+ i = 0
+ rept ways
+ paddq xmm6, xmm7
+ movdqa @CatStr(xmm,%i), xmm6
+ i = i + 1
+ endm
+
+ mov r3, r6
+ LOAD_OP_W pxor, -32
+ ENCODE LOAD_OP_W
+ OP_W XOR_UPD_1, i * 16
+ OP_W XOR_UPD_2, i * 16
+ add rD, ways16
+ check2_c:
+ sub rN, ways
+ jnc nextBlocks2_c
+
+ add rN, ways
+ jmp check_c
+
+ nextBlock_c:
+ paddq xmm6, [r5]
+ mov r3, r6
+ movdqa xmm0, [r1 + r3 - 32]
+ pxor xmm0, xmm6
+ ENCODE LOAD_OP
+ XOR_UPD_1 xmm0, 0
+ XOR_UPD_2 xmm0, 0
+ add rD, 16
+ check_c:
+ sub rN, 1
+ jnc nextBlock_c
+
+ movdqa [r1 + r6 - 64], xmm6
+ MY_EPILOG
+
+end
diff --git a/other-licenses/7zstub/src/Asm/x86/LzmaDecOpt.asm b/other-licenses/7zstub/src/Asm/x86/LzmaDecOpt.asm
new file mode 100644
index 0000000000..0a89eb735f
--- /dev/null
+++ b/other-licenses/7zstub/src/Asm/x86/LzmaDecOpt.asm
@@ -0,0 +1,1258 @@
+; LzmaDecOpt.asm -- ASM version of LzmaDec_DecodeReal_3() function
+; 2018-02-06: Igor Pavlov : Public domain
+;
+; 3 - is the code compatibility version of LzmaDec_DecodeReal_*()
+; function for check at link time.
+; That code is tightly coupled with LzmaDec_TryDummy()
+; and with another functions in LzmaDec.c file.
+; CLzmaDec structure, (probs) array layout, input and output of
+; LzmaDec_DecodeReal_*() must be equal in both versions (C / ASM).
+
+ifndef x64
+; x64=1
+; .err <x64_IS_REQUIRED>
+endif
+
+include 7zAsm.asm
+
+MY_ASM_START
+
+_TEXT$LZMADECOPT SEGMENT ALIGN(64) 'CODE'
+
+MY_ALIGN macro num:req
+ align num
+endm
+
+MY_ALIGN_16 macro
+ MY_ALIGN 16
+endm
+
+MY_ALIGN_32 macro
+ MY_ALIGN 32
+endm
+
+MY_ALIGN_64 macro
+ MY_ALIGN 64
+endm
+
+
+; _LZMA_SIZE_OPT equ 1
+
+; _LZMA_PROB32 equ 1
+
+ifdef _LZMA_PROB32
+ PSHIFT equ 2
+ PLOAD macro dest, mem
+ mov dest, dword ptr [mem]
+ endm
+ PSTORE macro src, mem
+ mov dword ptr [mem], src
+ endm
+else
+ PSHIFT equ 1
+ PLOAD macro dest, mem
+ movzx dest, word ptr [mem]
+ endm
+ PSTORE macro src, mem
+ mov word ptr [mem], @CatStr(src, _W)
+ endm
+endif
+
+PMULT equ (1 SHL PSHIFT)
+PMULT_HALF equ (1 SHL (PSHIFT - 1))
+PMULT_2 equ (1 SHL (PSHIFT + 1))
+
+
+; x0 range
+; x1 pbPos / (prob) TREE
+; x2 probBranch / prm (MATCHED) / pbPos / cnt
+; x3 sym
+;====== r4 === RSP
+; x5 cod
+; x6 t1 NORM_CALC / probs_state / dist
+; x7 t0 NORM_CALC / prob2 IF_BIT_1
+; x8 state
+; x9 match (MATCHED) / sym2 / dist2 / lpMask_reg
+; x10 kBitModelTotal_reg
+; r11 probs
+; x12 offs (MATCHED) / dic / len_temp
+; x13 processedPos
+; x14 bit (MATCHED) / dicPos
+; r15 buf
+
+
+cod equ x5
+cod_L equ x5_L
+range equ x0
+state equ x8
+state_R equ r8
+buf equ r15
+processedPos equ x13
+kBitModelTotal_reg equ x10
+
+probBranch equ x2
+probBranch_R equ r2
+probBranch_W equ x2_W
+
+pbPos equ x1
+pbPos_R equ r1
+
+cnt equ x2
+cnt_R equ r2
+
+lpMask_reg equ x9
+dicPos equ r14
+
+sym equ x3
+sym_R equ r3
+sym_L equ x3_L
+
+probs equ r11
+dic equ r12
+
+t0 equ x7
+t0_W equ x7_W
+t0_R equ r7
+
+prob2 equ t0
+prob2_W equ t0_W
+
+t1 equ x6
+t1_R equ r6
+
+probs_state equ t1
+probs_state_R equ t1_R
+
+prm equ r2
+match equ x9
+match_R equ r9
+offs equ x12
+offs_R equ r12
+bit equ x14
+bit_R equ r14
+
+sym2 equ x9
+sym2_R equ r9
+
+len_temp equ x12
+
+dist equ sym
+dist2 equ x9
+
+
+
+kNumBitModelTotalBits equ 11
+kBitModelTotal equ (1 SHL kNumBitModelTotalBits)
+kNumMoveBits equ 5
+kBitModelOffset equ ((1 SHL kNumMoveBits) - 1)
+kTopValue equ (1 SHL 24)
+
+NORM_2 macro
+ ; movzx t0, BYTE PTR [buf]
+ shl cod, 8
+ mov cod_L, BYTE PTR [buf]
+ shl range, 8
+ ; or cod, t0
+ inc buf
+endm
+
+
+NORM macro
+ cmp range, kTopValue
+ jae SHORT @F
+ NORM_2
+@@:
+endm
+
+
+; ---------- Branch MACROS ----------
+
+UPDATE_0 macro probsArray:req, probOffset:req, probDisp:req
+ mov prob2, kBitModelTotal_reg
+ sub prob2, probBranch
+ shr prob2, kNumMoveBits
+ add probBranch, prob2
+ PSTORE probBranch, probOffset * 1 + probsArray + probDisp * PMULT
+endm
+
+
+UPDATE_1 macro probsArray:req, probOffset:req, probDisp:req
+ sub prob2, range
+ sub cod, range
+ mov range, prob2
+ mov prob2, probBranch
+ shr probBranch, kNumMoveBits
+ sub prob2, probBranch
+ PSTORE prob2, probOffset * 1 + probsArray + probDisp * PMULT
+endm
+
+
+CMP_COD macro probsArray:req, probOffset:req, probDisp:req
+ PLOAD probBranch, probOffset * 1 + probsArray + probDisp * PMULT
+ NORM
+ mov prob2, range
+ shr range, kNumBitModelTotalBits
+ imul range, probBranch
+ cmp cod, range
+endm
+
+
+IF_BIT_1_NOUP macro probsArray:req, probOffset:req, probDisp:req, toLabel:req
+ CMP_COD probsArray, probOffset, probDisp
+ jae toLabel
+endm
+
+
+IF_BIT_1 macro probsArray:req, probOffset:req, probDisp:req, toLabel:req
+ IF_BIT_1_NOUP probsArray, probOffset, probDisp, toLabel
+ UPDATE_0 probsArray, probOffset, probDisp
+endm
+
+
+IF_BIT_0_NOUP macro probsArray:req, probOffset:req, probDisp:req, toLabel:req
+ CMP_COD probsArray, probOffset, probDisp
+ jb toLabel
+endm
+
+
+; ---------- CMOV MACROS ----------
+
+NORM_CALC macro prob:req
+ NORM
+ mov t0, range
+ shr range, kNumBitModelTotalBits
+ imul range, prob
+ sub t0, range
+ mov t1, cod
+ sub cod, range
+endm
+
+
+PUP macro prob:req, probPtr:req
+ sub t0, prob
+ ; only sar works for both 16/32 bit prob modes
+ sar t0, kNumMoveBits
+ add t0, prob
+ PSTORE t0, probPtr
+endm
+
+
+PUP_SUB macro prob:req, probPtr:req, symSub:req
+ sbb sym, symSub
+ PUP prob, probPtr
+endm
+
+
+PUP_COD macro prob:req, probPtr:req, symSub:req
+ mov t0, kBitModelOffset
+ cmovb cod, t1
+ mov t1, sym
+ cmovb t0, kBitModelTotal_reg
+ PUP_SUB prob, probPtr, symSub
+endm
+
+
+BIT_0 macro prob:req, probNext:req
+ PLOAD prob, probs + 1 * PMULT
+ PLOAD probNext, probs + 1 * PMULT_2
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ PLOAD t0, probs + 1 * PMULT_2 + PMULT
+ cmovae probNext, t0
+ mov t0, kBitModelOffset
+ cmovb cod, t1
+ cmovb t0, kBitModelTotal_reg
+ mov sym, 2
+ PUP_SUB prob, probs + 1 * PMULT, 0 - 1
+endm
+
+
+BIT_1 macro prob:req, probNext:req
+ PLOAD probNext, probs + sym_R * PMULT_2
+ add sym, sym
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ PLOAD t0, probs + sym_R * PMULT + PMULT
+ cmovae probNext, t0
+ PUP_COD prob, probs + t1_R * PMULT_HALF, 0 - 1
+endm
+
+
+BIT_2 macro prob:req, symSub:req
+ add sym, sym
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ PUP_COD prob, probs + t1_R * PMULT_HALF, symSub
+endm
+
+
+; ---------- MATCHED LITERAL ----------
+
+LITM_0 macro
+ mov offs, 256 * PMULT
+ shl match, (PSHIFT + 1)
+ mov bit, offs
+ and bit, match
+ PLOAD x1, probs + 256 * PMULT + bit_R * 1 + 1 * PMULT
+ lea prm, [probs + 256 * PMULT + bit_R * 1 + 1 * PMULT]
+ ; lea prm, [probs + 256 * PMULT + 1 * PMULT]
+ ; add prm, bit_R
+ xor offs, bit
+ add match, match
+
+ NORM_CALC x1
+
+ cmovae offs, bit
+ mov bit, match
+ cmovae range, t0
+ mov t0, kBitModelOffset
+ cmovb cod, t1
+ cmovb t0, kBitModelTotal_reg
+ mov sym, 0
+ PUP_SUB x1, prm, -2-1
+endm
+
+
+LITM macro
+ and bit, offs
+ lea prm, [probs + offs_R * 1]
+ add prm, bit_R
+ PLOAD x1, prm + sym_R * PMULT
+ xor offs, bit
+ add sym, sym
+ add match, match
+
+ NORM_CALC x1
+
+ cmovae offs, bit
+ mov bit, match
+ cmovae range, t0
+ PUP_COD x1, prm + t1_R * PMULT_HALF, - 1
+endm
+
+
+LITM_2 macro
+ and bit, offs
+ lea prm, [probs + offs_R * 1]
+ add prm, bit_R
+ PLOAD x1, prm + sym_R * PMULT
+ add sym, sym
+
+ NORM_CALC x1
+
+ cmovae range, t0
+ PUP_COD x1, prm + t1_R * PMULT_HALF, 256 - 1
+endm
+
+
+; ---------- REVERSE BITS ----------
+
+REV_0 macro prob:req, probNext:req
+ ; PLOAD prob, probs + 1 * PMULT
+ ; lea sym2_R, [probs + 2 * PMULT]
+ ; PLOAD probNext, probs + 2 * PMULT
+ PLOAD probNext, sym2_R
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ PLOAD t0, probs + 3 * PMULT
+ cmovae probNext, t0
+ cmovb cod, t1
+ mov t0, kBitModelOffset
+ cmovb t0, kBitModelTotal_reg
+ lea t1_R, [probs + 3 * PMULT]
+ cmovae sym2_R, t1_R
+ PUP prob, probs + 1 * PMULT
+endm
+
+
+REV_1 macro prob:req, probNext:req, step:req
+ add sym2_R, step * PMULT
+ PLOAD probNext, sym2_R
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ PLOAD t0, sym2_R + step * PMULT
+ cmovae probNext, t0
+ cmovb cod, t1
+ mov t0, kBitModelOffset
+ cmovb t0, kBitModelTotal_reg
+ lea t1_R, [sym2_R + step * PMULT]
+ cmovae sym2_R, t1_R
+ PUP prob, t1_R - step * PMULT_2
+endm
+
+
+REV_2 macro prob:req, step:req
+ sub sym2_R, probs
+ shr sym2, PSHIFT
+ or sym, sym2
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ lea t0, [sym - step]
+ cmovb sym, t0
+ cmovb cod, t1
+ mov t0, kBitModelOffset
+ cmovb t0, kBitModelTotal_reg
+ PUP prob, probs + sym2_R * PMULT
+endm
+
+
+REV_1_VAR macro prob:req
+ PLOAD prob, sym_R
+ mov probs, sym_R
+ add sym_R, sym2_R
+
+ NORM_CALC prob
+
+ cmovae range, t0
+ lea t0_R, [sym_R + sym2_R]
+ cmovae sym_R, t0_R
+ mov t0, kBitModelOffset
+ cmovb cod, t1
+ ; mov t1, kBitModelTotal
+ ; cmovb t0, t1
+ cmovb t0, kBitModelTotal_reg
+ add sym2, sym2
+ PUP prob, probs
+endm
+
+
+
+
+LIT_PROBS macro lpMaskParam:req
+ ; prob += (UInt32)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
+ mov t0, processedPos
+ shl t0, 8
+ add sym, t0
+ and sym, lpMaskParam
+ add probs_state_R, pbPos_R
+ mov x1, LOC lc2
+ lea sym, dword ptr[sym_R + 2 * sym_R]
+ add probs, Literal * PMULT
+ shl sym, x1_L
+ add probs, sym_R
+ UPDATE_0 probs_state_R, 0, IsMatch
+ inc processedPos
+endm
+
+
+
+kNumPosBitsMax equ 4
+kNumPosStatesMax equ (1 SHL kNumPosBitsMax)
+
+kLenNumLowBits equ 3
+kLenNumLowSymbols equ (1 SHL kLenNumLowBits)
+kLenNumHighBits equ 8
+kLenNumHighSymbols equ (1 SHL kLenNumHighBits)
+kNumLenProbs equ (2 * kLenNumLowSymbols * kNumPosStatesMax + kLenNumHighSymbols)
+
+LenLow equ 0
+LenChoice equ LenLow
+LenChoice2 equ (LenLow + kLenNumLowSymbols)
+LenHigh equ (LenLow + 2 * kLenNumLowSymbols * kNumPosStatesMax)
+
+kNumStates equ 12
+kNumStates2 equ 16
+kNumLitStates equ 7
+
+kStartPosModelIndex equ 4
+kEndPosModelIndex equ 14
+kNumFullDistances equ (1 SHL (kEndPosModelIndex SHR 1))
+
+kNumPosSlotBits equ 6
+kNumLenToPosStates equ 4
+
+kNumAlignBits equ 4
+kAlignTableSize equ (1 SHL kNumAlignBits)
+
+kMatchMinLen equ 2
+kMatchSpecLenStart equ (kMatchMinLen + kLenNumLowSymbols * 2 + kLenNumHighSymbols)
+
+kStartOffset equ 1664
+SpecPos equ (-kStartOffset)
+IsRep0Long equ (SpecPos + kNumFullDistances)
+RepLenCoder equ (IsRep0Long + (kNumStates2 SHL kNumPosBitsMax))
+LenCoder equ (RepLenCoder + kNumLenProbs)
+IsMatch equ (LenCoder + kNumLenProbs)
+kAlign equ (IsMatch + (kNumStates2 SHL kNumPosBitsMax))
+IsRep equ (kAlign + kAlignTableSize)
+IsRepG0 equ (IsRep + kNumStates)
+IsRepG1 equ (IsRepG0 + kNumStates)
+IsRepG2 equ (IsRepG1 + kNumStates)
+PosSlot equ (IsRepG2 + kNumStates)
+Literal equ (PosSlot + (kNumLenToPosStates SHL kNumPosSlotBits))
+NUM_BASE_PROBS equ (Literal + kStartOffset)
+
+if kAlign ne 0
+ .err <Stop_Compiling_Bad_LZMA_kAlign>
+endif
+
+if NUM_BASE_PROBS ne 1984
+ .err <Stop_Compiling_Bad_LZMA_PROBS>
+endif
+
+
+PTR_FIELD equ dq ?
+
+CLzmaDec_Asm struct
+ lc db ?
+ lp db ?
+ pb db ?
+ _pad_ db ?
+ dicSize dd ?
+
+ probs_Spec PTR_FIELD
+ probs_1664 PTR_FIELD
+ dic_Spec PTR_FIELD
+ dicBufSize PTR_FIELD
+ dicPos_Spec PTR_FIELD
+ buf_Spec PTR_FIELD
+
+ range_Spec dd ?
+ code_Spec dd ?
+ processedPos_Spec dd ?
+ checkDicSize dd ?
+ rep0 dd ?
+ rep1 dd ?
+ rep2 dd ?
+ rep3 dd ?
+ state_Spec dd ?
+ remainLen dd ?
+CLzmaDec_Asm ends
+
+
+CLzmaDec_Asm_Loc struct
+ OLD_RSP PTR_FIELD
+ lzmaPtr PTR_FIELD
+ _pad0_ PTR_FIELD
+ _pad1_ PTR_FIELD
+ _pad2_ PTR_FIELD
+ dicBufSize PTR_FIELD
+ probs_Spec PTR_FIELD
+ dic_Spec PTR_FIELD
+
+ limit PTR_FIELD
+ bufLimit PTR_FIELD
+ lc2 dd ?
+ lpMask dd ?
+ pbMask dd ?
+ checkDicSize dd ?
+
+ _pad_ dd ?
+ remainLen dd ?
+ dicPos_Spec PTR_FIELD
+ rep0 dd ?
+ rep1 dd ?
+ rep2 dd ?
+ rep3 dd ?
+CLzmaDec_Asm_Loc ends
+
+
+GLOB_2 equ [sym_R].CLzmaDec_Asm.
+GLOB equ [r1].CLzmaDec_Asm.
+LOC_0 equ [r0].CLzmaDec_Asm_Loc.
+LOC equ [RSP].CLzmaDec_Asm_Loc.
+
+
+COPY_VAR macro name
+ mov t0, GLOB_2 name
+ mov LOC_0 name, t0
+endm
+
+
+RESTORE_VAR macro name
+ mov t0, LOC name
+ mov GLOB name, t0
+endm
+
+
+
+IsMatchBranch_Pre macro reg
+ ; prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
+ mov pbPos, LOC pbMask
+ and pbPos, processedPos
+ shl pbPos, (kLenNumLowBits + 1 + PSHIFT)
+ lea probs_state_R, [probs + state_R]
+endm
+
+
+IsMatchBranch macro reg
+ IsMatchBranch_Pre
+ IF_BIT_1 probs_state_R, pbPos_R, IsMatch, IsMatch_label
+endm
+
+
+CheckLimits macro reg
+ cmp buf, LOC bufLimit
+ jae fin_OK
+ cmp dicPos, LOC limit
+ jae fin_OK
+endm
+
+
+
+; RSP is (16x + 8) bytes aligned in WIN64-x64
+; LocalSize equ ((((SIZEOF CLzmaDec_Asm_Loc) + 7) / 16 * 16) + 8)
+
+PARAM_lzma equ REG_PARAM_0
+PARAM_limit equ REG_PARAM_1
+PARAM_bufLimit equ REG_PARAM_2
+
+; MY_ALIGN_64
+MY_PROC LzmaDec_DecodeReal_3, 3
+MY_PUSH_PRESERVED_REGS
+
+ lea r0, [RSP - (SIZEOF CLzmaDec_Asm_Loc)]
+ and r0, -128
+ mov r5, RSP
+ mov RSP, r0
+ mov LOC_0 Old_RSP, r5
+ mov LOC_0 lzmaPtr, PARAM_lzma
+
+ mov LOC_0 remainLen, 0 ; remainLen must be ZERO
+
+ mov LOC_0 bufLimit, PARAM_bufLimit
+ mov sym_R, PARAM_lzma ; CLzmaDec_Asm_Loc pointer for GLOB_2
+ mov dic, GLOB_2 dic_Spec
+ add PARAM_limit, dic
+ mov LOC_0 limit, PARAM_limit
+
+ COPY_VAR(rep0)
+ COPY_VAR(rep1)
+ COPY_VAR(rep2)
+ COPY_VAR(rep3)
+
+ mov dicPos, GLOB_2 dicPos_Spec
+ add dicPos, dic
+ mov LOC_0 dicPos_Spec, dicPos
+ mov LOC_0 dic_Spec, dic
+
+ mov x1_L, GLOB_2 pb
+ mov t0, 1
+ shl t0, x1_L
+ dec t0
+ mov LOC_0 pbMask, t0
+
+ ; unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
+ ; unsigned lc = p->prop.lc;
+ ; unsigned lpMask = ((unsigned)0x100 << p->prop.lp) - ((unsigned)0x100 >> lc);
+
+ mov x1_L, GLOB_2 lc
+ mov x2, 100h
+ mov t0, x2
+ shr x2, x1_L
+ ; inc x1
+ add x1_L, PSHIFT
+ mov LOC_0 lc2, x1
+ mov x1_L, GLOB_2 lp
+ shl t0, x1_L
+ sub t0, x2
+ mov LOC_0 lpMask, t0
+ mov lpMask_reg, t0
+
+ ; mov probs, GLOB_2 probs_Spec
+ ; add probs, kStartOffset SHL PSHIFT
+ mov probs, GLOB_2 probs_1664
+ mov LOC_0 probs_Spec, probs
+
+ mov t0_R, GLOB_2 dicBufSize
+ mov LOC_0 dicBufSize, t0_R
+
+ mov x1, GLOB_2 checkDicSize
+ mov LOC_0 checkDicSize, x1
+
+ mov processedPos, GLOB_2 processedPos_Spec
+
+ mov state, GLOB_2 state_Spec
+ shl state, PSHIFT
+
+ mov buf, GLOB_2 buf_Spec
+ mov range, GLOB_2 range_Spec
+ mov cod, GLOB_2 code_Spec
+ mov kBitModelTotal_reg, kBitModelTotal
+ xor sym, sym
+
+ ; if (processedPos != 0 || checkDicSize != 0)
+ or x1, processedPos
+ jz @f
+
+ add t0_R, dic
+ cmp dicPos, dic
+ cmovnz t0_R, dicPos
+ movzx sym, byte ptr[t0_R - 1]
+
+@@:
+ IsMatchBranch_Pre
+ cmp state, 4 * PMULT
+ jb lit_end
+ cmp state, kNumLitStates * PMULT
+ jb lit_matched_end
+ jmp lz_end
+
+
+
+
+; ---------- LITERAL ----------
+MY_ALIGN_64
+lit_start:
+ xor state, state
+lit_start_2:
+ LIT_PROBS lpMask_reg
+
+ ifdef _LZMA_SIZE_OPT
+
+ PLOAD x1, probs + 1 * PMULT
+ mov sym, 1
+MY_ALIGN_16
+lit_loop:
+ BIT_1 x1, x2
+ mov x1, x2
+ cmp sym, 127
+ jbe lit_loop
+
+ else
+
+ BIT_0 x1, x2
+ BIT_1 x2, x1
+ BIT_1 x1, x2
+ BIT_1 x2, x1
+ BIT_1 x1, x2
+ BIT_1 x2, x1
+ BIT_1 x1, x2
+
+ endif
+
+ BIT_2 x2, 256 - 1
+
+ ; mov dic, LOC dic_Spec
+ mov probs, LOC probs_Spec
+ IsMatchBranch_Pre
+ mov byte ptr[dicPos], sym_L
+ inc dicPos
+
+ CheckLimits
+lit_end:
+ IF_BIT_0_NOUP probs_state_R, pbPos_R, IsMatch, lit_start
+
+ ; jmp IsMatch_label
+
+; ---------- MATCHES ----------
+; MY_ALIGN_32
+IsMatch_label:
+ UPDATE_1 probs_state_R, pbPos_R, IsMatch
+ IF_BIT_1 probs_state_R, 0, IsRep, IsRep_label
+
+ add probs, LenCoder * PMULT
+ add state, kNumStates * PMULT
+
+; ---------- LEN DECODE ----------
+len_decode:
+ mov len_temp, 8 - 1 - kMatchMinLen
+ IF_BIT_0_NOUP probs, 0, 0, len_mid_0
+ UPDATE_1 probs, 0, 0
+ add probs, (1 SHL (kLenNumLowBits + PSHIFT))
+ mov len_temp, -1 - kMatchMinLen
+ IF_BIT_0_NOUP probs, 0, 0, len_mid_0
+ UPDATE_1 probs, 0, 0
+ add probs, LenHigh * PMULT - (1 SHL (kLenNumLowBits + PSHIFT))
+ mov sym, 1
+ PLOAD x1, probs + 1 * PMULT
+
+MY_ALIGN_32
+len8_loop:
+ BIT_1 x1, x2
+ mov x1, x2
+ cmp sym, 64
+ jb len8_loop
+
+ mov len_temp, (kLenNumHighSymbols - kLenNumLowSymbols * 2) - 1 - kMatchMinLen
+ jmp len_mid_2
+
+MY_ALIGN_32
+len_mid_0:
+ UPDATE_0 probs, 0, 0
+ add probs, pbPos_R
+ BIT_0 x2, x1
+len_mid_2:
+ BIT_1 x1, x2
+ BIT_2 x2, len_temp
+ mov probs, LOC probs_Spec
+ cmp state, kNumStates * PMULT
+ jb copy_match
+
+
+; ---------- DECODE DISTANCE ----------
+ ; probs + PosSlot + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
+
+ mov t0, 3 + kMatchMinLen
+ cmp sym, 3 + kMatchMinLen
+ cmovb t0, sym
+ add probs, PosSlot * PMULT - (kMatchMinLen SHL (kNumPosSlotBits + PSHIFT))
+ shl t0, (kNumPosSlotBits + PSHIFT)
+ add probs, t0_R
+
+ ; sym = Len
+ ; mov LOC remainLen, sym
+ mov len_temp, sym
+
+ ifdef _LZMA_SIZE_OPT
+
+ PLOAD x1, probs + 1 * PMULT
+ mov sym, 1
+MY_ALIGN_16
+slot_loop:
+ BIT_1 x1, x2
+ mov x1, x2
+ cmp sym, 32
+ jb slot_loop
+
+ else
+
+ BIT_0 x1, x2
+ BIT_1 x2, x1
+ BIT_1 x1, x2
+ BIT_1 x2, x1
+ BIT_1 x1, x2
+
+ endif
+
+ mov x1, sym
+ BIT_2 x2, 64-1
+
+ and sym, 3
+ mov probs, LOC probs_Spec
+ cmp x1, 32 + kEndPosModelIndex / 2
+ jb short_dist
+
+ ; unsigned numDirectBits = (unsigned)(((distance >> 1) - 1));
+ sub x1, (32 + 1 + kNumAlignBits)
+ ; distance = (2 | (distance & 1));
+ or sym, 2
+ PLOAD x2, probs + 1 * PMULT
+ shl sym, kNumAlignBits + 1
+ lea sym2_R, [probs + 2 * PMULT]
+
+ jmp direct_norm
+ ; lea t1, [sym_R + (1 SHL kNumAlignBits)]
+ ; cmp range, kTopValue
+ ; jb direct_norm
+
+; ---------- DIRECT DISTANCE ----------
+MY_ALIGN_32
+direct_loop:
+ shr range, 1
+ mov t0, cod
+ sub cod, range
+ cmovs cod, t0
+ cmovns sym, t1
+
+ comment ~
+ sub cod, range
+ mov x2, cod
+ sar x2, 31
+ lea sym, dword ptr [r2 + sym_R * 2 + 1]
+ and x2, range
+ add cod, x2
+ ~
+ dec x1
+ je direct_end
+
+ add sym, sym
+direct_norm:
+ lea t1, [sym_R + (1 SHL kNumAlignBits)]
+ cmp range, kTopValue
+ jae near ptr direct_loop
+ ; we align for 32 here with "near ptr" command above
+ NORM_2
+ jmp direct_loop
+
+MY_ALIGN_32
+direct_end:
+ ; prob = + kAlign;
+ ; distance <<= kNumAlignBits;
+ REV_0 x2, x1
+ REV_1 x1, x2, 2
+ REV_1 x2, x1, 4
+ REV_2 x1, 8
+
+decode_dist_end:
+
+ ; if (distance >= (checkDicSize == 0 ? processedPos: checkDicSize))
+
+ mov t0, LOC checkDicSize
+ test t0, t0
+ cmove t0, processedPos
+ cmp sym, t0
+ jae end_of_payload
+
+ ; rep3 = rep2;
+ ; rep2 = rep1;
+ ; rep1 = rep0;
+ ; rep0 = distance + 1;
+
+ inc sym
+ mov t0, LOC rep0
+ mov t1, LOC rep1
+ mov x1, LOC rep2
+ mov LOC rep0, sym
+ ; mov sym, LOC remainLen
+ mov sym, len_temp
+ mov LOC rep1, t0
+ mov LOC rep2, t1
+ mov LOC rep3, x1
+
+ ; state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
+ cmp state, (kNumStates + kNumLitStates) * PMULT
+ mov state, kNumLitStates * PMULT
+ mov t0, (kNumLitStates + 3) * PMULT
+ cmovae state, t0
+
+
+; ---------- COPY MATCH ----------
+copy_match:
+
+ ; len += kMatchMinLen;
+ ; add sym, kMatchMinLen
+
+ ; if ((rem = limit - dicPos) == 0)
+ ; {
+ ; p->dicPos = dicPos;
+ ; return SZ_ERROR_DATA;
+ ; }
+ mov cnt_R, LOC limit
+ sub cnt_R, dicPos
+ jz fin_ERROR
+
+ ; curLen = ((rem < len) ? (unsigned)rem : len);
+ cmp cnt_R, sym_R
+ ; cmovae cnt_R, sym_R ; 64-bit
+ cmovae cnt, sym ; 32-bit
+
+ mov dic, LOC dic_Spec
+ mov x1, LOC rep0
+
+ mov t0_R, dicPos
+ add dicPos, cnt_R
+ ; processedPos += curLen;
+ add processedPos, cnt
+ ; len -= curLen;
+ sub sym, cnt
+ mov LOC remainLen, sym
+
+ sub t0_R, dic
+
+ ; pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0);
+ sub t0_R, r1
+ jae @f
+
+ mov r1, LOC dicBufSize
+ add t0_R, r1
+ sub r1, t0_R
+ cmp cnt_R, r1
+ ja copy_match_cross
+@@:
+ ; if (curLen <= dicBufSize - pos)
+
+; ---------- COPY MATCH FAST ----------
+ ; Byte *dest = dic + dicPos;
+ ; mov r1, dic
+ ; ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
+ ; sub t0_R, dicPos
+ ; dicPos += curLen;
+
+ ; const Byte *lim = dest + curLen;
+ add t0_R, dic
+ movzx sym, byte ptr[t0_R]
+ add t0_R, cnt_R
+ neg cnt_R
+ ; lea r1, [dicPos - 1]
+copy_common:
+ dec dicPos
+ ; cmp LOC rep0, 1
+ ; je rep0Label
+
+ ; t0_R - src_lim
+ ; r1 - dest_lim - 1
+ ; cnt_R - (-cnt)
+
+ IsMatchBranch_Pre
+ inc cnt_R
+ jz copy_end
+MY_ALIGN_16
+@@:
+ mov byte ptr[cnt_R * 1 + dicPos], sym_L
+ movzx sym, byte ptr[cnt_R * 1 + t0_R]
+ inc cnt_R
+ jnz @b
+
+copy_end:
+lz_end_match:
+ mov byte ptr[dicPos], sym_L
+ inc dicPos
+
+ ; IsMatchBranch_Pre
+ CheckLimits
+lz_end:
+ IF_BIT_1_NOUP probs_state_R, pbPos_R, IsMatch, IsMatch_label
+
+
+
+; ---------- LITERAL MATCHED ----------
+
+ LIT_PROBS LOC lpMask
+
+ ; matchByte = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
+ mov x1, LOC rep0
+ ; mov dic, LOC dic_Spec
+ mov LOC dicPos_Spec, dicPos
+
+ ; state -= (state < 10) ? 3 : 6;
+ lea t0, [state_R - 6 * PMULT]
+ sub state, 3 * PMULT
+ cmp state, 7 * PMULT
+ cmovae state, t0
+
+ sub dicPos, dic
+ sub dicPos, r1
+ jae @f
+ add dicPos, LOC dicBufSize
+@@:
+ comment ~
+ xor t0, t0
+ sub dicPos, r1
+ cmovb t0_R, LOC dicBufSize
+ ~
+
+ movzx match, byte ptr[dic + dicPos * 1]
+
+ ifdef _LZMA_SIZE_OPT
+
+ mov offs, 256 * PMULT
+ shl match, (PSHIFT + 1)
+ mov bit, match
+ mov sym, 1
+MY_ALIGN_16
+litm_loop:
+ LITM
+ cmp sym, 256
+ jb litm_loop
+ sub sym, 256
+
+ else
+
+ LITM_0
+ LITM
+ LITM
+ LITM
+ LITM
+ LITM
+ LITM
+ LITM_2
+
+ endif
+
+ mov probs, LOC probs_Spec
+ IsMatchBranch_Pre
+ ; mov dic, LOC dic_Spec
+ mov dicPos, LOC dicPos_Spec
+ mov byte ptr[dicPos], sym_L
+ inc dicPos
+
+ CheckLimits
+lit_matched_end:
+ IF_BIT_1_NOUP probs_state_R, pbPos_R, IsMatch, IsMatch_label
+ ; IsMatchBranch
+ mov lpMask_reg, LOC lpMask
+ sub state, 3 * PMULT
+ jmp lit_start_2
+
+
+
+; ---------- REP 0 LITERAL ----------
+MY_ALIGN_32
+IsRep0Short_label:
+ UPDATE_0 probs_state_R, pbPos_R, IsRep0Long
+
+ ; dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
+ mov dic, LOC dic_Spec
+ mov t0_R, dicPos
+ mov probBranch, LOC rep0
+ sub t0_R, dic
+
+ sub probs, RepLenCoder * PMULT
+ inc processedPos
+ ; state = state < kNumLitStates ? 9 : 11;
+ or state, 1 * PMULT
+ IsMatchBranch_Pre
+
+ sub t0_R, probBranch_R
+ jae @f
+ add t0_R, LOC dicBufSize
+@@:
+ movzx sym, byte ptr[dic + t0_R * 1]
+ jmp lz_end_match
+
+
+MY_ALIGN_32
+IsRep_label:
+ UPDATE_1 probs_state_R, 0, IsRep
+
+ ; The (checkDicSize == 0 && processedPos == 0) case was checked before in LzmaDec.c with kBadRepCode.
+ ; So we don't check it here.
+
+ ; mov t0, processedPos
+ ; or t0, LOC checkDicSize
+ ; jz fin_ERROR_2
+
+ ; state = state < kNumLitStates ? 8 : 11;
+ cmp state, kNumLitStates * PMULT
+ mov state, 8 * PMULT
+ mov probBranch, 11 * PMULT
+ cmovae state, probBranch
+
+ ; prob = probs + RepLenCoder;
+ add probs, RepLenCoder * PMULT
+
+ IF_BIT_1 probs_state_R, 0, IsRepG0, IsRepG0_label
+ IF_BIT_0_NOUP probs_state_R, pbPos_R, IsRep0Long, IsRep0Short_label
+ UPDATE_1 probs_state_R, pbPos_R, IsRep0Long
+ jmp len_decode
+
+MY_ALIGN_32
+IsRepG0_label:
+ UPDATE_1 probs_state_R, 0, IsRepG0
+ mov dist2, LOC rep0
+ mov dist, LOC rep1
+ mov LOC rep1, dist2
+
+ IF_BIT_1 probs_state_R, 0, IsRepG1, IsRepG1_label
+ mov LOC rep0, dist
+ jmp len_decode
+
+; MY_ALIGN_32
+IsRepG1_label:
+ UPDATE_1 probs_state_R, 0, IsRepG1
+ mov dist2, LOC rep2
+ mov LOC rep2, dist
+
+ IF_BIT_1 probs_state_R, 0, IsRepG2, IsRepG2_label
+ mov LOC rep0, dist2
+ jmp len_decode
+
+; MY_ALIGN_32
+IsRepG2_label:
+ UPDATE_1 probs_state_R, 0, IsRepG2
+ mov dist, LOC rep3
+ mov LOC rep3, dist2
+ mov LOC rep0, dist
+ jmp len_decode
+
+
+
+; ---------- SPEC SHORT DISTANCE ----------
+
+MY_ALIGN_32
+short_dist:
+ sub x1, 32 + 1
+ jbe decode_dist_end
+ or sym, 2
+ shl sym, x1_L
+ lea sym_R, [probs + sym_R * PMULT + SpecPos * PMULT + 1 * PMULT]
+ mov sym2, PMULT ; step
+MY_ALIGN_32
+spec_loop:
+ REV_1_VAR x2
+ dec x1
+ jnz spec_loop
+
+ mov probs, LOC probs_Spec
+ sub sym, sym2
+ sub sym, SpecPos * PMULT
+ sub sym_R, probs
+ shr sym, PSHIFT
+
+ jmp decode_dist_end
+
+
+; ---------- COPY MATCH CROSS ----------
+copy_match_cross:
+ ; t0_R - src pos
+ ; r1 - len to dicBufSize
+ ; cnt_R - total copy len
+
+ mov t1_R, t0_R ; srcPos
+ mov t0_R, dic
+ mov r1, LOC dicBufSize ;
+ neg cnt_R
+@@:
+ movzx sym, byte ptr[t1_R * 1 + t0_R]
+ inc t1_R
+ mov byte ptr[cnt_R * 1 + dicPos], sym_L
+ inc cnt_R
+ cmp t1_R, r1
+ jne @b
+
+ movzx sym, byte ptr[t0_R]
+ sub t0_R, cnt_R
+ jmp copy_common
+
+
+
+
+fin_ERROR:
+ mov LOC remainLen, len_temp
+; fin_ERROR_2:
+ mov sym, 1
+ jmp fin
+
+end_of_payload:
+ cmp sym, 0FFFFFFFFh ; -1
+ jne fin_ERROR
+
+ mov LOC remainLen, kMatchSpecLenStart
+ sub state, kNumStates * PMULT
+
+fin_OK:
+ xor sym, sym
+
+fin:
+ NORM
+
+ mov r1, LOC lzmaPtr
+
+ sub dicPos, LOC dic_Spec
+ mov GLOB dicPos_Spec, dicPos
+ mov GLOB buf_Spec, buf
+ mov GLOB range_Spec, range
+ mov GLOB code_Spec, cod
+ shr state, PSHIFT
+ mov GLOB state_Spec, state
+ mov GLOB processedPos_Spec, processedPos
+
+ RESTORE_VAR(remainLen)
+ RESTORE_VAR(rep0)
+ RESTORE_VAR(rep1)
+ RESTORE_VAR(rep2)
+ RESTORE_VAR(rep3)
+
+ mov x0, sym
+
+ mov RSP, LOC Old_RSP
+
+MY_POP_PRESERVED_REGS
+MY_ENDP
+
+_TEXT$LZMADECOPT ENDS
+
+end
diff --git a/other-licenses/7zstub/src/Asm/x86/XzCrc64Opt.asm b/other-licenses/7zstub/src/Asm/x86/XzCrc64Opt.asm
new file mode 100644
index 0000000000..3e6d490266
--- /dev/null
+++ b/other-licenses/7zstub/src/Asm/x86/XzCrc64Opt.asm
@@ -0,0 +1,205 @@
+; XzCrc64Opt.asm -- CRC64 calculation : optimized version
+; 2011-06-28 : Igor Pavlov : Public domain
+
+include 7zAsm.asm
+
+MY_ASM_START
+
+ifdef x64
+
+ rD equ r9
+ rN equ r10
+
+ num_VAR equ r8
+ table_VAR equ r9
+
+ SRCDAT equ rN + rD
+
+CRC_XOR macro dest:req, src:req, t:req
+ xor dest, QWORD PTR [r5 + src * 8 + 0800h * t]
+endm
+
+CRC1b macro
+ movzx x6, BYTE PTR [rD]
+ inc rD
+ movzx x3, x0_L
+ xor x6, x3
+ shr r0, 8
+ CRC_XOR r0, r6, 0
+ dec rN
+endm
+
+MY_PROLOG macro crc_end:req
+ MY_PUSH_4_REGS
+
+ mov r0, r1
+ mov rN, num_VAR
+ mov r5, table_VAR
+ mov rD, r2
+ test rN, rN
+ jz crc_end
+ @@:
+ test rD, 3
+ jz @F
+ CRC1b
+ jnz @B
+ @@:
+ cmp rN, 8
+ jb crc_end
+ add rN, rD
+ mov num_VAR, rN
+ sub rN, 4
+ and rN, NOT 3
+ sub rD, rN
+ mov x1, [SRCDAT]
+ xor r0, r1
+ add rN, 4
+endm
+
+MY_EPILOG macro crc_end:req
+ sub rN, 4
+ mov x1, [SRCDAT]
+ xor r0, r1
+ mov rD, rN
+ mov rN, num_VAR
+ sub rN, rD
+ crc_end:
+ test rN, rN
+ jz @F
+ CRC1b
+ jmp crc_end
+ @@:
+ MY_POP_4_REGS
+endm
+
+MY_PROC XzCrc64UpdateT4, 4
+ MY_PROLOG crc_end_4
+ align 16
+ main_loop_4:
+ mov x1, [SRCDAT]
+ movzx x2, x0_L
+ movzx x3, x0_H
+ shr r0, 16
+ movzx x6, x0_L
+ movzx x7, x0_H
+ shr r0, 16
+ CRC_XOR r1, r2, 3
+ CRC_XOR r0, r3, 2
+ CRC_XOR r1, r6, 1
+ CRC_XOR r0, r7, 0
+ xor r0, r1
+
+ add rD, 4
+ jnz main_loop_4
+
+ MY_EPILOG crc_end_4
+MY_ENDP
+
+else
+
+ rD equ r1
+ rN equ r7
+
+ crc_val equ (REG_SIZE * 5)
+ crc_table equ (8 + crc_val)
+ table_VAR equ [r4 + crc_table]
+ num_VAR equ table_VAR
+
+
+ SRCDAT equ rN + rD
+
+CRC macro op0:req, op1:req, dest0:req, dest1:req, src:req, t:req
+ op0 dest0, DWORD PTR [r5 + src * 8 + 0800h * t]
+ op1 dest1, DWORD PTR [r5 + src * 8 + 0800h * t + 4]
+endm
+
+CRC_XOR macro dest0:req, dest1:req, src:req, t:req
+ CRC xor, xor, dest0, dest1, src, t
+endm
+
+
+CRC1b macro
+ movzx x6, BYTE PTR [rD]
+ inc rD
+ movzx x3, x0_L
+ xor x6, x3
+ shrd r0, r2, 8
+ shr r2, 8
+ CRC_XOR r0, r2, r6, 0
+ dec rN
+endm
+
+MY_PROLOG macro crc_end:req
+ MY_PUSH_4_REGS
+
+ mov rN, r2
+
+ mov x0, [r4 + crc_val]
+ mov x2, [r4 + crc_val + 4]
+ mov r5, table_VAR
+ test rN, rN
+ jz crc_end
+ @@:
+ test rD, 3
+ jz @F
+ CRC1b
+ jnz @B
+ @@:
+ cmp rN, 8
+ jb crc_end
+ add rN, rD
+
+ mov num_VAR, rN
+
+ sub rN, 4
+ and rN, NOT 3
+ sub rD, rN
+ xor r0, [SRCDAT]
+ add rN, 4
+endm
+
+MY_EPILOG macro crc_end:req
+ sub rN, 4
+ xor r0, [SRCDAT]
+
+ mov rD, rN
+ mov rN, num_VAR
+ sub rN, rD
+ crc_end:
+ test rN, rN
+ jz @F
+ CRC1b
+ jmp crc_end
+ @@:
+ MY_POP_4_REGS
+endm
+
+MY_PROC XzCrc64UpdateT4, 5
+ MY_PROLOG crc_end_4
+ movzx x6, x0_L
+ align 16
+ main_loop_4:
+ mov r3, [SRCDAT]
+ xor r3, r2
+
+ CRC xor, mov, r3, r2, r6, 3
+ movzx x6, x0_H
+ shr r0, 16
+ CRC_XOR r3, r2, r6, 2
+
+ movzx x6, x0_L
+ movzx x0, x0_H
+ CRC_XOR r3, r2, r6, 1
+ CRC_XOR r3, r2, r0, 0
+ movzx x6, x3_L
+ mov r0, r3
+
+ add rD, 4
+ jnz main_loop_4
+
+ MY_EPILOG crc_end_4
+MY_ENDP
+
+endif
+
+end
diff --git a/other-licenses/7zstub/src/C/7z.h b/other-licenses/7zstub/src/C/7z.h
new file mode 100644
index 0000000000..82813c298b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7z.h
@@ -0,0 +1,202 @@
+/* 7z.h -- 7z interface
+2017-04-03 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_H
+#define __7Z_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define k7zStartHeaderSize 0x20
+#define k7zSignatureSize 6
+
+extern const Byte k7zSignature[k7zSignatureSize];
+
+typedef struct
+{
+ const Byte *Data;
+ size_t Size;
+} CSzData;
+
+/* CSzCoderInfo & CSzFolder support only default methods */
+
+typedef struct
+{
+ size_t PropsOffset;
+ UInt32 MethodID;
+ Byte NumStreams;
+ Byte PropsSize;
+} CSzCoderInfo;
+
+typedef struct
+{
+ UInt32 InIndex;
+ UInt32 OutIndex;
+} CSzBond;
+
+#define SZ_NUM_CODERS_IN_FOLDER_MAX 4
+#define SZ_NUM_BONDS_IN_FOLDER_MAX 3
+#define SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX 4
+
+typedef struct
+{
+ UInt32 NumCoders;
+ UInt32 NumBonds;
+ UInt32 NumPackStreams;
+ UInt32 UnpackStream;
+ UInt32 PackStreams[SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX];
+ CSzBond Bonds[SZ_NUM_BONDS_IN_FOLDER_MAX];
+ CSzCoderInfo Coders[SZ_NUM_CODERS_IN_FOLDER_MAX];
+} CSzFolder;
+
+
+SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd);
+
+typedef struct
+{
+ UInt32 Low;
+ UInt32 High;
+} CNtfsFileTime;
+
+typedef struct
+{
+ Byte *Defs; /* MSB 0 bit numbering */
+ UInt32 *Vals;
+} CSzBitUi32s;
+
+typedef struct
+{
+ Byte *Defs; /* MSB 0 bit numbering */
+ // UInt64 *Vals;
+ CNtfsFileTime *Vals;
+} CSzBitUi64s;
+
+#define SzBitArray_Check(p, i) (((p)[(i) >> 3] & (0x80 >> ((i) & 7))) != 0)
+
+#define SzBitWithVals_Check(p, i) ((p)->Defs && ((p)->Defs[(i) >> 3] & (0x80 >> ((i) & 7))) != 0)
+
+typedef struct
+{
+ UInt32 NumPackStreams;
+ UInt32 NumFolders;
+
+ UInt64 *PackPositions; // NumPackStreams + 1
+ CSzBitUi32s FolderCRCs; // NumFolders
+
+ size_t *FoCodersOffsets; // NumFolders + 1
+ UInt32 *FoStartPackStreamIndex; // NumFolders + 1
+ UInt32 *FoToCoderUnpackSizes; // NumFolders + 1
+ Byte *FoToMainUnpackSizeIndex; // NumFolders
+ UInt64 *CoderUnpackSizes; // for all coders in all folders
+
+ Byte *CodersData;
+} CSzAr;
+
+UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex);
+
+SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
+ ILookInStream *stream, UInt64 startPos,
+ Byte *outBuffer, size_t outSize,
+ ISzAllocPtr allocMain);
+
+typedef struct
+{
+ CSzAr db;
+
+ UInt64 startPosAfterHeader;
+ UInt64 dataPos;
+
+ UInt32 NumFiles;
+
+ UInt64 *UnpackPositions; // NumFiles + 1
+ // Byte *IsEmptyFiles;
+ Byte *IsDirs;
+ CSzBitUi32s CRCs;
+
+ CSzBitUi32s Attribs;
+ // CSzBitUi32s Parents;
+ CSzBitUi64s MTime;
+ CSzBitUi64s CTime;
+
+ UInt32 *FolderToFile; // NumFolders + 1
+ UInt32 *FileToFolder; // NumFiles
+
+ size_t *FileNameOffsets; /* in 2-byte steps */
+ Byte *FileNames; /* UTF-16-LE */
+} CSzArEx;
+
+#define SzArEx_IsDir(p, i) (SzBitArray_Check((p)->IsDirs, i))
+
+#define SzArEx_GetFileSize(p, i) ((p)->UnpackPositions[(i) + 1] - (p)->UnpackPositions[i])
+
+void SzArEx_Init(CSzArEx *p);
+void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc);
+UInt64 SzArEx_GetFolderStreamPos(const CSzArEx *p, UInt32 folderIndex, UInt32 indexInFolder);
+int SzArEx_GetFolderFullPackSize(const CSzArEx *p, UInt32 folderIndex, UInt64 *resSize);
+
+/*
+if dest == NULL, the return value specifies the required size of the buffer,
+ in 16-bit characters, including the null-terminating character.
+if dest != NULL, the return value specifies the number of 16-bit characters that
+ are written to the dest, including the null-terminating character. */
+
+size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
+
+/*
+size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex);
+UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest);
+*/
+
+
+
+/*
+ SzArEx_Extract extracts file from archive
+
+ *outBuffer must be 0 before first call for each new archive.
+
+ Extracting cache:
+ If you need to decompress more than one file, you can send
+ these values from previous call:
+ *blockIndex,
+ *outBuffer,
+ *outBufferSize
+ You can consider "*outBuffer" as cache of solid block. If your archive is solid,
+ it will increase decompression speed.
+
+ If you use external function, you can declare these 3 cache variables
+ (blockIndex, outBuffer, outBufferSize) as static in that external function.
+
+ Free *outBuffer and set *outBuffer to 0, if you want to flush cache.
+*/
+
+SRes SzArEx_Extract(
+ const CSzArEx *db,
+ ILookInStream *inStream,
+ UInt32 fileIndex, /* index of file */
+ UInt32 *blockIndex, /* index of solid block */
+ Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
+ size_t *outBufferSize, /* buffer size for output buffer */
+ size_t *offset, /* offset of stream for required file in *outBuffer */
+ size_t *outSizeProcessed, /* size of file in *outBuffer */
+ ISzAllocPtr allocMain,
+ ISzAllocPtr allocTemp);
+
+
+/*
+SzArEx_Open Errors:
+SZ_ERROR_NO_ARCHIVE
+SZ_ERROR_ARCHIVE
+SZ_ERROR_UNSUPPORTED
+SZ_ERROR_MEM
+SZ_ERROR_CRC
+SZ_ERROR_INPUT_EOF
+SZ_ERROR_FAIL
+*/
+
+SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream,
+ ISzAllocPtr allocMain, ISzAllocPtr allocTemp);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zAlloc.c b/other-licenses/7zstub/src/C/7zAlloc.c
new file mode 100644
index 0000000000..ea32809c65
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zAlloc.c
@@ -0,0 +1,80 @@
+/* 7zAlloc.c -- Allocation functions
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <stdlib.h>
+
+#include "7zAlloc.h"
+
+/* #define _SZ_ALLOC_DEBUG */
+/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
+
+#ifdef _SZ_ALLOC_DEBUG
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#include <stdio.h>
+int g_allocCount = 0;
+int g_allocCountTemp = 0;
+
+#endif
+
+void *SzAlloc(ISzAllocPtr p, size_t size)
+{
+ UNUSED_VAR(p);
+ if (size == 0)
+ return 0;
+ #ifdef _SZ_ALLOC_DEBUG
+ fprintf(stderr, "\nAlloc %10u bytes; count = %10d", (unsigned)size, g_allocCount);
+ g_allocCount++;
+ #endif
+ return malloc(size);
+}
+
+void SzFree(ISzAllocPtr p, void *address)
+{
+ UNUSED_VAR(p);
+ #ifdef _SZ_ALLOC_DEBUG
+ if (address != 0)
+ {
+ g_allocCount--;
+ fprintf(stderr, "\nFree; count = %10d", g_allocCount);
+ }
+ #endif
+ free(address);
+}
+
+void *SzAllocTemp(ISzAllocPtr p, size_t size)
+{
+ UNUSED_VAR(p);
+ if (size == 0)
+ return 0;
+ #ifdef _SZ_ALLOC_DEBUG
+ fprintf(stderr, "\nAlloc_temp %10u bytes; count = %10d", (unsigned)size, g_allocCountTemp);
+ g_allocCountTemp++;
+ #ifdef _WIN32
+ return HeapAlloc(GetProcessHeap(), 0, size);
+ #endif
+ #endif
+ return malloc(size);
+}
+
+void SzFreeTemp(ISzAllocPtr p, void *address)
+{
+ UNUSED_VAR(p);
+ #ifdef _SZ_ALLOC_DEBUG
+ if (address != 0)
+ {
+ g_allocCountTemp--;
+ fprintf(stderr, "\nFree_temp; count = %10d", g_allocCountTemp);
+ }
+ #ifdef _WIN32
+ HeapFree(GetProcessHeap(), 0, address);
+ return;
+ #endif
+ #endif
+ free(address);
+}
diff --git a/other-licenses/7zstub/src/C/7zAlloc.h b/other-licenses/7zstub/src/C/7zAlloc.h
new file mode 100644
index 0000000000..c0f89d73cb
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zAlloc.h
@@ -0,0 +1,19 @@
+/* 7zAlloc.h -- Allocation functions
+2017-04-03 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_ALLOC_H
+#define __7Z_ALLOC_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+void *SzAlloc(ISzAllocPtr p, size_t size);
+void SzFree(ISzAllocPtr p, void *address);
+
+void *SzAllocTemp(ISzAllocPtr p, size_t size);
+void SzFreeTemp(ISzAllocPtr p, void *address);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zArcIn.c b/other-licenses/7zstub/src/C/7zArcIn.c
new file mode 100644
index 0000000000..70d7175e3d
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zArcIn.c
@@ -0,0 +1,1771 @@
+/* 7zArcIn.c -- 7z Input functions
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "7z.h"
+#include "7zBuf.h"
+#include "7zCrc.h"
+#include "CpuArch.h"
+
+#define MY_ALLOC(T, p, size, alloc) { \
+ if ((p = (T *)ISzAlloc_Alloc(alloc, (size) * sizeof(T))) == NULL) return SZ_ERROR_MEM; }
+
+#define MY_ALLOC_ZE(T, p, size, alloc) { if ((size) == 0) p = NULL; else MY_ALLOC(T, p, size, alloc) }
+
+#define MY_ALLOC_AND_CPY(to, size, from, alloc) \
+ { MY_ALLOC(Byte, to, size, alloc); memcpy(to, from, size); }
+
+#define MY_ALLOC_ZE_AND_CPY(to, size, from, alloc) \
+ { if ((size) == 0) p = NULL; else { MY_ALLOC_AND_CPY(to, size, from, alloc) } }
+
+#define k7zMajorVersion 0
+
+enum EIdEnum
+{
+ k7zIdEnd,
+ k7zIdHeader,
+ k7zIdArchiveProperties,
+ k7zIdAdditionalStreamsInfo,
+ k7zIdMainStreamsInfo,
+ k7zIdFilesInfo,
+ k7zIdPackInfo,
+ k7zIdUnpackInfo,
+ k7zIdSubStreamsInfo,
+ k7zIdSize,
+ k7zIdCRC,
+ k7zIdFolder,
+ k7zIdCodersUnpackSize,
+ k7zIdNumUnpackStream,
+ k7zIdEmptyStream,
+ k7zIdEmptyFile,
+ k7zIdAnti,
+ k7zIdName,
+ k7zIdCTime,
+ k7zIdATime,
+ k7zIdMTime,
+ k7zIdWinAttrib,
+ k7zIdComment,
+ k7zIdEncodedHeader,
+ k7zIdStartPos,
+ k7zIdDummy
+ // k7zNtSecure,
+ // k7zParent,
+ // k7zIsReal
+};
+
+const Byte k7zSignature[k7zSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
+
+#define SzBitUi32s_Init(p) { (p)->Defs = NULL; (p)->Vals = NULL; }
+
+static SRes SzBitUi32s_Alloc(CSzBitUi32s *p, size_t num, ISzAllocPtr alloc)
+{
+ if (num == 0)
+ {
+ p->Defs = NULL;
+ p->Vals = NULL;
+ }
+ else
+ {
+ MY_ALLOC(Byte, p->Defs, (num + 7) >> 3, alloc);
+ MY_ALLOC(UInt32, p->Vals, num, alloc);
+ }
+ return SZ_OK;
+}
+
+void SzBitUi32s_Free(CSzBitUi32s *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->Defs); p->Defs = NULL;
+ ISzAlloc_Free(alloc, p->Vals); p->Vals = NULL;
+}
+
+#define SzBitUi64s_Init(p) { (p)->Defs = NULL; (p)->Vals = NULL; }
+
+void SzBitUi64s_Free(CSzBitUi64s *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->Defs); p->Defs = NULL;
+ ISzAlloc_Free(alloc, p->Vals); p->Vals = NULL;
+}
+
+
+static void SzAr_Init(CSzAr *p)
+{
+ p->NumPackStreams = 0;
+ p->NumFolders = 0;
+
+ p->PackPositions = NULL;
+ SzBitUi32s_Init(&p->FolderCRCs);
+
+ p->FoCodersOffsets = NULL;
+ p->FoStartPackStreamIndex = NULL;
+ p->FoToCoderUnpackSizes = NULL;
+ p->FoToMainUnpackSizeIndex = NULL;
+ p->CoderUnpackSizes = NULL;
+
+ p->CodersData = NULL;
+}
+
+static void SzAr_Free(CSzAr *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->PackPositions);
+ SzBitUi32s_Free(&p->FolderCRCs, alloc);
+
+ ISzAlloc_Free(alloc, p->FoCodersOffsets);
+ ISzAlloc_Free(alloc, p->FoStartPackStreamIndex);
+ ISzAlloc_Free(alloc, p->FoToCoderUnpackSizes);
+ ISzAlloc_Free(alloc, p->FoToMainUnpackSizeIndex);
+ ISzAlloc_Free(alloc, p->CoderUnpackSizes);
+
+ ISzAlloc_Free(alloc, p->CodersData);
+
+ SzAr_Init(p);
+}
+
+
+void SzArEx_Init(CSzArEx *p)
+{
+ SzAr_Init(&p->db);
+
+ p->NumFiles = 0;
+ p->dataPos = 0;
+
+ p->UnpackPositions = NULL;
+ p->IsDirs = NULL;
+
+ p->FolderToFile = NULL;
+ p->FileToFolder = NULL;
+
+ p->FileNameOffsets = NULL;
+ p->FileNames = NULL;
+
+ SzBitUi32s_Init(&p->CRCs);
+ SzBitUi32s_Init(&p->Attribs);
+ // SzBitUi32s_Init(&p->Parents);
+ SzBitUi64s_Init(&p->MTime);
+ SzBitUi64s_Init(&p->CTime);
+}
+
+void SzArEx_Free(CSzArEx *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->UnpackPositions);
+ ISzAlloc_Free(alloc, p->IsDirs);
+
+ ISzAlloc_Free(alloc, p->FolderToFile);
+ ISzAlloc_Free(alloc, p->FileToFolder);
+
+ ISzAlloc_Free(alloc, p->FileNameOffsets);
+ ISzAlloc_Free(alloc, p->FileNames);
+
+ SzBitUi32s_Free(&p->CRCs, alloc);
+ SzBitUi32s_Free(&p->Attribs, alloc);
+ // SzBitUi32s_Free(&p->Parents, alloc);
+ SzBitUi64s_Free(&p->MTime, alloc);
+ SzBitUi64s_Free(&p->CTime, alloc);
+
+ SzAr_Free(&p->db, alloc);
+ SzArEx_Init(p);
+}
+
+
+static int TestSignatureCandidate(const Byte *testBytes)
+{
+ unsigned i;
+ for (i = 0; i < k7zSignatureSize; i++)
+ if (testBytes[i] != k7zSignature[i])
+ return 0;
+ return 1;
+}
+
+#define SzData_Clear(p) { (p)->Data = NULL; (p)->Size = 0; }
+
+#define SZ_READ_BYTE_SD(_sd_, dest) if ((_sd_)->Size == 0) return SZ_ERROR_ARCHIVE; (_sd_)->Size--; dest = *(_sd_)->Data++;
+#define SZ_READ_BYTE(dest) SZ_READ_BYTE_SD(sd, dest)
+#define SZ_READ_BYTE_2(dest) if (sd.Size == 0) return SZ_ERROR_ARCHIVE; sd.Size--; dest = *sd.Data++;
+
+#define SKIP_DATA(sd, size) { sd->Size -= (size_t)(size); sd->Data += (size_t)(size); }
+#define SKIP_DATA2(sd, size) { sd.Size -= (size_t)(size); sd.Data += (size_t)(size); }
+
+#define SZ_READ_32(dest) if (sd.Size < 4) return SZ_ERROR_ARCHIVE; \
+ dest = GetUi32(sd.Data); SKIP_DATA2(sd, 4);
+
+static MY_NO_INLINE SRes ReadNumber(CSzData *sd, UInt64 *value)
+{
+ Byte firstByte, mask;
+ unsigned i;
+ UInt32 v;
+
+ SZ_READ_BYTE(firstByte);
+ if ((firstByte & 0x80) == 0)
+ {
+ *value = firstByte;
+ return SZ_OK;
+ }
+ SZ_READ_BYTE(v);
+ if ((firstByte & 0x40) == 0)
+ {
+ *value = (((UInt32)firstByte & 0x3F) << 8) | v;
+ return SZ_OK;
+ }
+ SZ_READ_BYTE(mask);
+ *value = v | ((UInt32)mask << 8);
+ mask = 0x20;
+ for (i = 2; i < 8; i++)
+ {
+ Byte b;
+ if ((firstByte & mask) == 0)
+ {
+ UInt64 highPart = (unsigned)firstByte & (unsigned)(mask - 1);
+ *value |= (highPart << (8 * i));
+ return SZ_OK;
+ }
+ SZ_READ_BYTE(b);
+ *value |= ((UInt64)b << (8 * i));
+ mask >>= 1;
+ }
+ return SZ_OK;
+}
+
+
+static MY_NO_INLINE SRes SzReadNumber32(CSzData *sd, UInt32 *value)
+{
+ Byte firstByte;
+ UInt64 value64;
+ if (sd->Size == 0)
+ return SZ_ERROR_ARCHIVE;
+ firstByte = *sd->Data;
+ if ((firstByte & 0x80) == 0)
+ {
+ *value = firstByte;
+ sd->Data++;
+ sd->Size--;
+ return SZ_OK;
+ }
+ RINOK(ReadNumber(sd, &value64));
+ if (value64 >= (UInt32)0x80000000 - 1)
+ return SZ_ERROR_UNSUPPORTED;
+ if (value64 >= ((UInt64)(1) << ((sizeof(size_t) - 1) * 8 + 4)))
+ return SZ_ERROR_UNSUPPORTED;
+ *value = (UInt32)value64;
+ return SZ_OK;
+}
+
+#define ReadID(sd, value) ReadNumber(sd, value)
+
+static SRes SkipData(CSzData *sd)
+{
+ UInt64 size;
+ RINOK(ReadNumber(sd, &size));
+ if (size > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+ SKIP_DATA(sd, size);
+ return SZ_OK;
+}
+
+static SRes WaitId(CSzData *sd, UInt32 id)
+{
+ for (;;)
+ {
+ UInt64 type;
+ RINOK(ReadID(sd, &type));
+ if (type == id)
+ return SZ_OK;
+ if (type == k7zIdEnd)
+ return SZ_ERROR_ARCHIVE;
+ RINOK(SkipData(sd));
+ }
+}
+
+static SRes RememberBitVector(CSzData *sd, UInt32 numItems, const Byte **v)
+{
+ UInt32 numBytes = (numItems + 7) >> 3;
+ if (numBytes > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+ *v = sd->Data;
+ SKIP_DATA(sd, numBytes);
+ return SZ_OK;
+}
+
+static UInt32 CountDefinedBits(const Byte *bits, UInt32 numItems)
+{
+ Byte b = 0;
+ unsigned m = 0;
+ UInt32 sum = 0;
+ for (; numItems != 0; numItems--)
+ {
+ if (m == 0)
+ {
+ b = *bits++;
+ m = 8;
+ }
+ m--;
+ sum += ((b >> m) & 1);
+ }
+ return sum;
+}
+
+static MY_NO_INLINE SRes ReadBitVector(CSzData *sd, UInt32 numItems, Byte **v, ISzAllocPtr alloc)
+{
+ Byte allAreDefined;
+ Byte *v2;
+ UInt32 numBytes = (numItems + 7) >> 3;
+ *v = NULL;
+ SZ_READ_BYTE(allAreDefined);
+ if (numBytes == 0)
+ return SZ_OK;
+ if (allAreDefined == 0)
+ {
+ if (numBytes > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+ MY_ALLOC_AND_CPY(*v, numBytes, sd->Data, alloc);
+ SKIP_DATA(sd, numBytes);
+ return SZ_OK;
+ }
+ MY_ALLOC(Byte, *v, numBytes, alloc);
+ v2 = *v;
+ memset(v2, 0xFF, (size_t)numBytes);
+ {
+ unsigned numBits = (unsigned)numItems & 7;
+ if (numBits != 0)
+ v2[(size_t)numBytes - 1] = (Byte)((((UInt32)1 << numBits) - 1) << (8 - numBits));
+ }
+ return SZ_OK;
+}
+
+static MY_NO_INLINE SRes ReadUi32s(CSzData *sd2, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
+{
+ UInt32 i;
+ CSzData sd;
+ UInt32 *vals;
+ const Byte *defs;
+ MY_ALLOC_ZE(UInt32, crcs->Vals, numItems, alloc);
+ sd = *sd2;
+ defs = crcs->Defs;
+ vals = crcs->Vals;
+ for (i = 0; i < numItems; i++)
+ if (SzBitArray_Check(defs, i))
+ {
+ SZ_READ_32(vals[i]);
+ }
+ else
+ vals[i] = 0;
+ *sd2 = sd;
+ return SZ_OK;
+}
+
+static SRes ReadBitUi32s(CSzData *sd, UInt32 numItems, CSzBitUi32s *crcs, ISzAllocPtr alloc)
+{
+ SzBitUi32s_Free(crcs, alloc);
+ RINOK(ReadBitVector(sd, numItems, &crcs->Defs, alloc));
+ return ReadUi32s(sd, numItems, crcs, alloc);
+}
+
+static SRes SkipBitUi32s(CSzData *sd, UInt32 numItems)
+{
+ Byte allAreDefined;
+ UInt32 numDefined = numItems;
+ SZ_READ_BYTE(allAreDefined);
+ if (!allAreDefined)
+ {
+ size_t numBytes = (numItems + 7) >> 3;
+ if (numBytes > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+ numDefined = CountDefinedBits(sd->Data, numItems);
+ SKIP_DATA(sd, numBytes);
+ }
+ if (numDefined > (sd->Size >> 2))
+ return SZ_ERROR_ARCHIVE;
+ SKIP_DATA(sd, (size_t)numDefined * 4);
+ return SZ_OK;
+}
+
+static SRes ReadPackInfo(CSzAr *p, CSzData *sd, ISzAllocPtr alloc)
+{
+ RINOK(SzReadNumber32(sd, &p->NumPackStreams));
+
+ RINOK(WaitId(sd, k7zIdSize));
+ MY_ALLOC(UInt64, p->PackPositions, (size_t)p->NumPackStreams + 1, alloc);
+ {
+ UInt64 sum = 0;
+ UInt32 i;
+ UInt32 numPackStreams = p->NumPackStreams;
+ for (i = 0; i < numPackStreams; i++)
+ {
+ UInt64 packSize;
+ p->PackPositions[i] = sum;
+ RINOK(ReadNumber(sd, &packSize));
+ sum += packSize;
+ if (sum < packSize)
+ return SZ_ERROR_ARCHIVE;
+ }
+ p->PackPositions[i] = sum;
+ }
+
+ for (;;)
+ {
+ UInt64 type;
+ RINOK(ReadID(sd, &type));
+ if (type == k7zIdEnd)
+ return SZ_OK;
+ if (type == k7zIdCRC)
+ {
+ /* CRC of packed streams is unused now */
+ RINOK(SkipBitUi32s(sd, p->NumPackStreams));
+ continue;
+ }
+ RINOK(SkipData(sd));
+ }
+}
+
+/*
+static SRes SzReadSwitch(CSzData *sd)
+{
+ Byte external;
+ RINOK(SzReadByte(sd, &external));
+ return (external == 0) ? SZ_OK: SZ_ERROR_UNSUPPORTED;
+}
+*/
+
+#define k_NumCodersStreams_in_Folder_MAX (SZ_NUM_BONDS_IN_FOLDER_MAX + SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX)
+
+SRes SzGetNextFolderItem(CSzFolder *f, CSzData *sd)
+{
+ UInt32 numCoders, i;
+ UInt32 numInStreams = 0;
+ const Byte *dataStart = sd->Data;
+
+ f->NumCoders = 0;
+ f->NumBonds = 0;
+ f->NumPackStreams = 0;
+ f->UnpackStream = 0;
+
+ RINOK(SzReadNumber32(sd, &numCoders));
+ if (numCoders == 0 || numCoders > SZ_NUM_CODERS_IN_FOLDER_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+
+ for (i = 0; i < numCoders; i++)
+ {
+ Byte mainByte;
+ CSzCoderInfo *coder = f->Coders + i;
+ unsigned idSize, j;
+ UInt64 id;
+
+ SZ_READ_BYTE(mainByte);
+ if ((mainByte & 0xC0) != 0)
+ return SZ_ERROR_UNSUPPORTED;
+
+ idSize = (unsigned)(mainByte & 0xF);
+ if (idSize > sizeof(id))
+ return SZ_ERROR_UNSUPPORTED;
+ if (idSize > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+ id = 0;
+ for (j = 0; j < idSize; j++)
+ {
+ id = ((id << 8) | *sd->Data);
+ sd->Data++;
+ sd->Size--;
+ }
+ if (id > (UInt32)0xFFFFFFFF)
+ return SZ_ERROR_UNSUPPORTED;
+ coder->MethodID = (UInt32)id;
+
+ coder->NumStreams = 1;
+ coder->PropsOffset = 0;
+ coder->PropsSize = 0;
+
+ if ((mainByte & 0x10) != 0)
+ {
+ UInt32 numStreams;
+
+ RINOK(SzReadNumber32(sd, &numStreams));
+ if (numStreams > k_NumCodersStreams_in_Folder_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+ coder->NumStreams = (Byte)numStreams;
+
+ RINOK(SzReadNumber32(sd, &numStreams));
+ if (numStreams != 1)
+ return SZ_ERROR_UNSUPPORTED;
+ }
+
+ numInStreams += coder->NumStreams;
+
+ if (numInStreams > k_NumCodersStreams_in_Folder_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+
+ if ((mainByte & 0x20) != 0)
+ {
+ UInt32 propsSize = 0;
+ RINOK(SzReadNumber32(sd, &propsSize));
+ if (propsSize > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+ if (propsSize >= 0x80)
+ return SZ_ERROR_UNSUPPORTED;
+ coder->PropsOffset = sd->Data - dataStart;
+ coder->PropsSize = (Byte)propsSize;
+ sd->Data += (size_t)propsSize;
+ sd->Size -= (size_t)propsSize;
+ }
+ }
+
+ /*
+ if (numInStreams == 1 && numCoders == 1)
+ {
+ f->NumPackStreams = 1;
+ f->PackStreams[0] = 0;
+ }
+ else
+ */
+ {
+ Byte streamUsed[k_NumCodersStreams_in_Folder_MAX];
+ UInt32 numBonds, numPackStreams;
+
+ numBonds = numCoders - 1;
+ if (numInStreams < numBonds)
+ return SZ_ERROR_ARCHIVE;
+ if (numBonds > SZ_NUM_BONDS_IN_FOLDER_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+ f->NumBonds = numBonds;
+
+ numPackStreams = numInStreams - numBonds;
+ if (numPackStreams > SZ_NUM_PACK_STREAMS_IN_FOLDER_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+ f->NumPackStreams = numPackStreams;
+
+ for (i = 0; i < numInStreams; i++)
+ streamUsed[i] = False;
+
+ if (numBonds != 0)
+ {
+ Byte coderUsed[SZ_NUM_CODERS_IN_FOLDER_MAX];
+
+ for (i = 0; i < numCoders; i++)
+ coderUsed[i] = False;
+
+ for (i = 0; i < numBonds; i++)
+ {
+ CSzBond *bp = f->Bonds + i;
+
+ RINOK(SzReadNumber32(sd, &bp->InIndex));
+ if (bp->InIndex >= numInStreams || streamUsed[bp->InIndex])
+ return SZ_ERROR_ARCHIVE;
+ streamUsed[bp->InIndex] = True;
+
+ RINOK(SzReadNumber32(sd, &bp->OutIndex));
+ if (bp->OutIndex >= numCoders || coderUsed[bp->OutIndex])
+ return SZ_ERROR_ARCHIVE;
+ coderUsed[bp->OutIndex] = True;
+ }
+
+ for (i = 0; i < numCoders; i++)
+ if (!coderUsed[i])
+ {
+ f->UnpackStream = i;
+ break;
+ }
+
+ if (i == numCoders)
+ return SZ_ERROR_ARCHIVE;
+ }
+
+ if (numPackStreams == 1)
+ {
+ for (i = 0; i < numInStreams; i++)
+ if (!streamUsed[i])
+ break;
+ if (i == numInStreams)
+ return SZ_ERROR_ARCHIVE;
+ f->PackStreams[0] = i;
+ }
+ else
+ for (i = 0; i < numPackStreams; i++)
+ {
+ UInt32 index;
+ RINOK(SzReadNumber32(sd, &index));
+ if (index >= numInStreams || streamUsed[index])
+ return SZ_ERROR_ARCHIVE;
+ streamUsed[index] = True;
+ f->PackStreams[i] = index;
+ }
+ }
+
+ f->NumCoders = numCoders;
+
+ return SZ_OK;
+}
+
+
+static MY_NO_INLINE SRes SkipNumbers(CSzData *sd2, UInt32 num)
+{
+ CSzData sd;
+ sd = *sd2;
+ for (; num != 0; num--)
+ {
+ Byte firstByte, mask;
+ unsigned i;
+ SZ_READ_BYTE_2(firstByte);
+ if ((firstByte & 0x80) == 0)
+ continue;
+ if ((firstByte & 0x40) == 0)
+ {
+ if (sd.Size == 0)
+ return SZ_ERROR_ARCHIVE;
+ sd.Size--;
+ sd.Data++;
+ continue;
+ }
+ mask = 0x20;
+ for (i = 2; i < 8 && (firstByte & mask) != 0; i++)
+ mask >>= 1;
+ if (i > sd.Size)
+ return SZ_ERROR_ARCHIVE;
+ SKIP_DATA2(sd, i);
+ }
+ *sd2 = sd;
+ return SZ_OK;
+}
+
+
+#define k_Scan_NumCoders_MAX 64
+#define k_Scan_NumCodersStreams_in_Folder_MAX 64
+
+
+static SRes ReadUnpackInfo(CSzAr *p,
+ CSzData *sd2,
+ UInt32 numFoldersMax,
+ const CBuf *tempBufs, UInt32 numTempBufs,
+ ISzAllocPtr alloc)
+{
+ CSzData sd;
+
+ UInt32 fo, numFolders, numCodersOutStreams, packStreamIndex;
+ const Byte *startBufPtr;
+ Byte external;
+
+ RINOK(WaitId(sd2, k7zIdFolder));
+
+ RINOK(SzReadNumber32(sd2, &numFolders));
+ if (numFolders > numFoldersMax)
+ return SZ_ERROR_UNSUPPORTED;
+ p->NumFolders = numFolders;
+
+ SZ_READ_BYTE_SD(sd2, external);
+ if (external == 0)
+ sd = *sd2;
+ else
+ {
+ UInt32 index;
+ RINOK(SzReadNumber32(sd2, &index));
+ if (index >= numTempBufs)
+ return SZ_ERROR_ARCHIVE;
+ sd.Data = tempBufs[index].data;
+ sd.Size = tempBufs[index].size;
+ }
+
+ MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc);
+ MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
+ MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
+ MY_ALLOC(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);
+
+ startBufPtr = sd.Data;
+
+ packStreamIndex = 0;
+ numCodersOutStreams = 0;
+
+ for (fo = 0; fo < numFolders; fo++)
+ {
+ UInt32 numCoders, ci, numInStreams = 0;
+
+ p->FoCodersOffsets[fo] = sd.Data - startBufPtr;
+
+ RINOK(SzReadNumber32(&sd, &numCoders));
+ if (numCoders == 0 || numCoders > k_Scan_NumCoders_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+
+ for (ci = 0; ci < numCoders; ci++)
+ {
+ Byte mainByte;
+ unsigned idSize;
+ UInt32 coderInStreams;
+
+ SZ_READ_BYTE_2(mainByte);
+ if ((mainByte & 0xC0) != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ idSize = (mainByte & 0xF);
+ if (idSize > 8)
+ return SZ_ERROR_UNSUPPORTED;
+ if (idSize > sd.Size)
+ return SZ_ERROR_ARCHIVE;
+ SKIP_DATA2(sd, idSize);
+
+ coderInStreams = 1;
+
+ if ((mainByte & 0x10) != 0)
+ {
+ UInt32 coderOutStreams;
+ RINOK(SzReadNumber32(&sd, &coderInStreams));
+ RINOK(SzReadNumber32(&sd, &coderOutStreams));
+ if (coderInStreams > k_Scan_NumCodersStreams_in_Folder_MAX || coderOutStreams != 1)
+ return SZ_ERROR_UNSUPPORTED;
+ }
+
+ numInStreams += coderInStreams;
+
+ if ((mainByte & 0x20) != 0)
+ {
+ UInt32 propsSize;
+ RINOK(SzReadNumber32(&sd, &propsSize));
+ if (propsSize > sd.Size)
+ return SZ_ERROR_ARCHIVE;
+ SKIP_DATA2(sd, propsSize);
+ }
+ }
+
+ {
+ UInt32 indexOfMainStream = 0;
+ UInt32 numPackStreams = 1;
+
+ if (numCoders != 1 || numInStreams != 1)
+ {
+ Byte streamUsed[k_Scan_NumCodersStreams_in_Folder_MAX];
+ Byte coderUsed[k_Scan_NumCoders_MAX];
+
+ UInt32 i;
+ UInt32 numBonds = numCoders - 1;
+ if (numInStreams < numBonds)
+ return SZ_ERROR_ARCHIVE;
+
+ if (numInStreams > k_Scan_NumCodersStreams_in_Folder_MAX)
+ return SZ_ERROR_UNSUPPORTED;
+
+ for (i = 0; i < numInStreams; i++)
+ streamUsed[i] = False;
+ for (i = 0; i < numCoders; i++)
+ coderUsed[i] = False;
+
+ for (i = 0; i < numBonds; i++)
+ {
+ UInt32 index;
+
+ RINOK(SzReadNumber32(&sd, &index));
+ if (index >= numInStreams || streamUsed[index])
+ return SZ_ERROR_ARCHIVE;
+ streamUsed[index] = True;
+
+ RINOK(SzReadNumber32(&sd, &index));
+ if (index >= numCoders || coderUsed[index])
+ return SZ_ERROR_ARCHIVE;
+ coderUsed[index] = True;
+ }
+
+ numPackStreams = numInStreams - numBonds;
+
+ if (numPackStreams != 1)
+ for (i = 0; i < numPackStreams; i++)
+ {
+ UInt32 index;
+ RINOK(SzReadNumber32(&sd, &index));
+ if (index >= numInStreams || streamUsed[index])
+ return SZ_ERROR_ARCHIVE;
+ streamUsed[index] = True;
+ }
+
+ for (i = 0; i < numCoders; i++)
+ if (!coderUsed[i])
+ {
+ indexOfMainStream = i;
+ break;
+ }
+
+ if (i == numCoders)
+ return SZ_ERROR_ARCHIVE;
+ }
+
+ p->FoStartPackStreamIndex[fo] = packStreamIndex;
+ p->FoToCoderUnpackSizes[fo] = numCodersOutStreams;
+ p->FoToMainUnpackSizeIndex[fo] = (Byte)indexOfMainStream;
+ numCodersOutStreams += numCoders;
+ if (numCodersOutStreams < numCoders)
+ return SZ_ERROR_UNSUPPORTED;
+ if (numPackStreams > p->NumPackStreams - packStreamIndex)
+ return SZ_ERROR_ARCHIVE;
+ packStreamIndex += numPackStreams;
+ }
+ }
+
+ p->FoToCoderUnpackSizes[fo] = numCodersOutStreams;
+
+ {
+ size_t dataSize = sd.Data - startBufPtr;
+ p->FoStartPackStreamIndex[fo] = packStreamIndex;
+ p->FoCodersOffsets[fo] = dataSize;
+ MY_ALLOC_ZE_AND_CPY(p->CodersData, dataSize, startBufPtr, alloc);
+ }
+
+ if (external != 0)
+ {
+ if (sd.Size != 0)
+ return SZ_ERROR_ARCHIVE;
+ sd = *sd2;
+ }
+
+ RINOK(WaitId(&sd, k7zIdCodersUnpackSize));
+
+ MY_ALLOC_ZE(UInt64, p->CoderUnpackSizes, (size_t)numCodersOutStreams, alloc);
+ {
+ UInt32 i;
+ for (i = 0; i < numCodersOutStreams; i++)
+ {
+ RINOK(ReadNumber(&sd, p->CoderUnpackSizes + i));
+ }
+ }
+
+ for (;;)
+ {
+ UInt64 type;
+ RINOK(ReadID(&sd, &type));
+ if (type == k7zIdEnd)
+ {
+ *sd2 = sd;
+ return SZ_OK;
+ }
+ if (type == k7zIdCRC)
+ {
+ RINOK(ReadBitUi32s(&sd, numFolders, &p->FolderCRCs, alloc));
+ continue;
+ }
+ RINOK(SkipData(&sd));
+ }
+}
+
+
+UInt64 SzAr_GetFolderUnpackSize(const CSzAr *p, UInt32 folderIndex)
+{
+ return p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex] + p->FoToMainUnpackSizeIndex[folderIndex]];
+}
+
+
+typedef struct
+{
+ UInt32 NumTotalSubStreams;
+ UInt32 NumSubDigests;
+ CSzData sdNumSubStreams;
+ CSzData sdSizes;
+ CSzData sdCRCs;
+} CSubStreamInfo;
+
+
+static SRes ReadSubStreamsInfo(CSzAr *p, CSzData *sd, CSubStreamInfo *ssi)
+{
+ UInt64 type = 0;
+ UInt32 numSubDigests = 0;
+ UInt32 numFolders = p->NumFolders;
+ UInt32 numUnpackStreams = numFolders;
+ UInt32 numUnpackSizesInData = 0;
+
+ for (;;)
+ {
+ RINOK(ReadID(sd, &type));
+ if (type == k7zIdNumUnpackStream)
+ {
+ UInt32 i;
+ ssi->sdNumSubStreams.Data = sd->Data;
+ numUnpackStreams = 0;
+ numSubDigests = 0;
+ for (i = 0; i < numFolders; i++)
+ {
+ UInt32 numStreams;
+ RINOK(SzReadNumber32(sd, &numStreams));
+ if (numUnpackStreams > numUnpackStreams + numStreams)
+ return SZ_ERROR_UNSUPPORTED;
+ numUnpackStreams += numStreams;
+ if (numStreams != 0)
+ numUnpackSizesInData += (numStreams - 1);
+ if (numStreams != 1 || !SzBitWithVals_Check(&p->FolderCRCs, i))
+ numSubDigests += numStreams;
+ }
+ ssi->sdNumSubStreams.Size = sd->Data - ssi->sdNumSubStreams.Data;
+ continue;
+ }
+ if (type == k7zIdCRC || type == k7zIdSize || type == k7zIdEnd)
+ break;
+ RINOK(SkipData(sd));
+ }
+
+ if (!ssi->sdNumSubStreams.Data)
+ {
+ numSubDigests = numFolders;
+ if (p->FolderCRCs.Defs)
+ numSubDigests = numFolders - CountDefinedBits(p->FolderCRCs.Defs, numFolders);
+ }
+
+ ssi->NumTotalSubStreams = numUnpackStreams;
+ ssi->NumSubDigests = numSubDigests;
+
+ if (type == k7zIdSize)
+ {
+ ssi->sdSizes.Data = sd->Data;
+ RINOK(SkipNumbers(sd, numUnpackSizesInData));
+ ssi->sdSizes.Size = sd->Data - ssi->sdSizes.Data;
+ RINOK(ReadID(sd, &type));
+ }
+
+ for (;;)
+ {
+ if (type == k7zIdEnd)
+ return SZ_OK;
+ if (type == k7zIdCRC)
+ {
+ ssi->sdCRCs.Data = sd->Data;
+ RINOK(SkipBitUi32s(sd, numSubDigests));
+ ssi->sdCRCs.Size = sd->Data - ssi->sdCRCs.Data;
+ }
+ else
+ {
+ RINOK(SkipData(sd));
+ }
+ RINOK(ReadID(sd, &type));
+ }
+}
+
+static SRes SzReadStreamsInfo(CSzAr *p,
+ CSzData *sd,
+ UInt32 numFoldersMax, const CBuf *tempBufs, UInt32 numTempBufs,
+ UInt64 *dataOffset,
+ CSubStreamInfo *ssi,
+ ISzAllocPtr alloc)
+{
+ UInt64 type;
+
+ SzData_Clear(&ssi->sdSizes);
+ SzData_Clear(&ssi->sdCRCs);
+ SzData_Clear(&ssi->sdNumSubStreams);
+
+ *dataOffset = 0;
+ RINOK(ReadID(sd, &type));
+ if (type == k7zIdPackInfo)
+ {
+ RINOK(ReadNumber(sd, dataOffset));
+ RINOK(ReadPackInfo(p, sd, alloc));
+ RINOK(ReadID(sd, &type));
+ }
+ if (type == k7zIdUnpackInfo)
+ {
+ RINOK(ReadUnpackInfo(p, sd, numFoldersMax, tempBufs, numTempBufs, alloc));
+ RINOK(ReadID(sd, &type));
+ }
+ if (type == k7zIdSubStreamsInfo)
+ {
+ RINOK(ReadSubStreamsInfo(p, sd, ssi));
+ RINOK(ReadID(sd, &type));
+ }
+ else
+ {
+ ssi->NumTotalSubStreams = p->NumFolders;
+ // ssi->NumSubDigests = 0;
+ }
+
+ return (type == k7zIdEnd ? SZ_OK : SZ_ERROR_UNSUPPORTED);
+}
+
+static SRes SzReadAndDecodePackedStreams(
+ ILookInStream *inStream,
+ CSzData *sd,
+ CBuf *tempBufs,
+ UInt32 numFoldersMax,
+ UInt64 baseOffset,
+ CSzAr *p,
+ ISzAllocPtr allocTemp)
+{
+ UInt64 dataStartPos;
+ UInt32 fo;
+ CSubStreamInfo ssi;
+
+ RINOK(SzReadStreamsInfo(p, sd, numFoldersMax, NULL, 0, &dataStartPos, &ssi, allocTemp));
+
+ dataStartPos += baseOffset;
+ if (p->NumFolders == 0)
+ return SZ_ERROR_ARCHIVE;
+
+ for (fo = 0; fo < p->NumFolders; fo++)
+ Buf_Init(tempBufs + fo);
+
+ for (fo = 0; fo < p->NumFolders; fo++)
+ {
+ CBuf *tempBuf = tempBufs + fo;
+ UInt64 unpackSize = SzAr_GetFolderUnpackSize(p, fo);
+ if ((size_t)unpackSize != unpackSize)
+ return SZ_ERROR_MEM;
+ if (!Buf_Create(tempBuf, (size_t)unpackSize, allocTemp))
+ return SZ_ERROR_MEM;
+ }
+
+ for (fo = 0; fo < p->NumFolders; fo++)
+ {
+ const CBuf *tempBuf = tempBufs + fo;
+ RINOK(LookInStream_SeekTo(inStream, dataStartPos));
+ RINOK(SzAr_DecodeFolder(p, fo, inStream, dataStartPos, tempBuf->data, tempBuf->size, allocTemp));
+ }
+
+ return SZ_OK;
+}
+
+static SRes SzReadFileNames(const Byte *data, size_t size, UInt32 numFiles, size_t *offsets)
+{
+ size_t pos = 0;
+ *offsets++ = 0;
+ if (numFiles == 0)
+ return (size == 0) ? SZ_OK : SZ_ERROR_ARCHIVE;
+ if (size < 2)
+ return SZ_ERROR_ARCHIVE;
+ if (data[size - 2] != 0 || data[size - 1] != 0)
+ return SZ_ERROR_ARCHIVE;
+ do
+ {
+ const Byte *p;
+ if (pos == size)
+ return SZ_ERROR_ARCHIVE;
+ for (p = data + pos;
+ #ifdef _WIN32
+ *(const UInt16 *)p != 0
+ #else
+ p[0] != 0 || p[1] != 0
+ #endif
+ ; p += 2);
+ pos = p - data + 2;
+ *offsets++ = (pos >> 1);
+ }
+ while (--numFiles);
+ return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;
+}
+
+static MY_NO_INLINE SRes ReadTime(CSzBitUi64s *p, UInt32 num,
+ CSzData *sd2,
+ const CBuf *tempBufs, UInt32 numTempBufs,
+ ISzAllocPtr alloc)
+{
+ CSzData sd;
+ UInt32 i;
+ CNtfsFileTime *vals;
+ Byte *defs;
+ Byte external;
+
+ RINOK(ReadBitVector(sd2, num, &p->Defs, alloc));
+
+ SZ_READ_BYTE_SD(sd2, external);
+ if (external == 0)
+ sd = *sd2;
+ else
+ {
+ UInt32 index;
+ RINOK(SzReadNumber32(sd2, &index));
+ if (index >= numTempBufs)
+ return SZ_ERROR_ARCHIVE;
+ sd.Data = tempBufs[index].data;
+ sd.Size = tempBufs[index].size;
+ }
+
+ MY_ALLOC_ZE(CNtfsFileTime, p->Vals, num, alloc);
+ vals = p->Vals;
+ defs = p->Defs;
+ for (i = 0; i < num; i++)
+ if (SzBitArray_Check(defs, i))
+ {
+ if (sd.Size < 8)
+ return SZ_ERROR_ARCHIVE;
+ vals[i].Low = GetUi32(sd.Data);
+ vals[i].High = GetUi32(sd.Data + 4);
+ SKIP_DATA2(sd, 8);
+ }
+ else
+ vals[i].High = vals[i].Low = 0;
+
+ if (external == 0)
+ *sd2 = sd;
+
+ return SZ_OK;
+}
+
+
+#define NUM_ADDITIONAL_STREAMS_MAX 8
+
+
+static SRes SzReadHeader2(
+ CSzArEx *p, /* allocMain */
+ CSzData *sd,
+ ILookInStream *inStream,
+ CBuf *tempBufs, UInt32 *numTempBufs,
+ ISzAllocPtr allocMain,
+ ISzAllocPtr allocTemp
+ )
+{
+ CSubStreamInfo ssi;
+
+{
+ UInt64 type;
+
+ SzData_Clear(&ssi.sdSizes);
+ SzData_Clear(&ssi.sdCRCs);
+ SzData_Clear(&ssi.sdNumSubStreams);
+
+ ssi.NumSubDigests = 0;
+ ssi.NumTotalSubStreams = 0;
+
+ RINOK(ReadID(sd, &type));
+
+ if (type == k7zIdArchiveProperties)
+ {
+ for (;;)
+ {
+ UInt64 type2;
+ RINOK(ReadID(sd, &type2));
+ if (type2 == k7zIdEnd)
+ break;
+ RINOK(SkipData(sd));
+ }
+ RINOK(ReadID(sd, &type));
+ }
+
+ if (type == k7zIdAdditionalStreamsInfo)
+ {
+ CSzAr tempAr;
+ SRes res;
+
+ SzAr_Init(&tempAr);
+ res = SzReadAndDecodePackedStreams(inStream, sd, tempBufs, NUM_ADDITIONAL_STREAMS_MAX,
+ p->startPosAfterHeader, &tempAr, allocTemp);
+ *numTempBufs = tempAr.NumFolders;
+ SzAr_Free(&tempAr, allocTemp);
+
+ if (res != SZ_OK)
+ return res;
+ RINOK(ReadID(sd, &type));
+ }
+
+ if (type == k7zIdMainStreamsInfo)
+ {
+ RINOK(SzReadStreamsInfo(&p->db, sd, (UInt32)1 << 30, tempBufs, *numTempBufs,
+ &p->dataPos, &ssi, allocMain));
+ p->dataPos += p->startPosAfterHeader;
+ RINOK(ReadID(sd, &type));
+ }
+
+ if (type == k7zIdEnd)
+ {
+ return SZ_OK;
+ }
+
+ if (type != k7zIdFilesInfo)
+ return SZ_ERROR_ARCHIVE;
+}
+
+{
+ UInt32 numFiles = 0;
+ UInt32 numEmptyStreams = 0;
+ const Byte *emptyStreams = NULL;
+ const Byte *emptyFiles = NULL;
+
+ RINOK(SzReadNumber32(sd, &numFiles));
+ p->NumFiles = numFiles;
+
+ for (;;)
+ {
+ UInt64 type;
+ UInt64 size;
+ RINOK(ReadID(sd, &type));
+ if (type == k7zIdEnd)
+ break;
+ RINOK(ReadNumber(sd, &size));
+ if (size > sd->Size)
+ return SZ_ERROR_ARCHIVE;
+
+ if (type >= ((UInt32)1 << 8))
+ {
+ SKIP_DATA(sd, size);
+ }
+ else switch ((unsigned)type)
+ {
+ case k7zIdName:
+ {
+ size_t namesSize;
+ const Byte *namesData;
+ Byte external;
+
+ SZ_READ_BYTE(external);
+ if (external == 0)
+ {
+ namesSize = (size_t)size - 1;
+ namesData = sd->Data;
+ }
+ else
+ {
+ UInt32 index;
+ RINOK(SzReadNumber32(sd, &index));
+ if (index >= *numTempBufs)
+ return SZ_ERROR_ARCHIVE;
+ namesData = (tempBufs)[index].data;
+ namesSize = (tempBufs)[index].size;
+ }
+
+ if ((namesSize & 1) != 0)
+ return SZ_ERROR_ARCHIVE;
+ MY_ALLOC(size_t, p->FileNameOffsets, numFiles + 1, allocMain);
+ MY_ALLOC_ZE_AND_CPY(p->FileNames, namesSize, namesData, allocMain);
+ RINOK(SzReadFileNames(p->FileNames, namesSize, numFiles, p->FileNameOffsets))
+ if (external == 0)
+ {
+ SKIP_DATA(sd, namesSize);
+ }
+ break;
+ }
+ case k7zIdEmptyStream:
+ {
+ RINOK(RememberBitVector(sd, numFiles, &emptyStreams));
+ numEmptyStreams = CountDefinedBits(emptyStreams, numFiles);
+ emptyFiles = NULL;
+ break;
+ }
+ case k7zIdEmptyFile:
+ {
+ RINOK(RememberBitVector(sd, numEmptyStreams, &emptyFiles));
+ break;
+ }
+ case k7zIdWinAttrib:
+ {
+ Byte external;
+ CSzData sdSwitch;
+ CSzData *sdPtr;
+ SzBitUi32s_Free(&p->Attribs, allocMain);
+ RINOK(ReadBitVector(sd, numFiles, &p->Attribs.Defs, allocMain));
+
+ SZ_READ_BYTE(external);
+ if (external == 0)
+ sdPtr = sd;
+ else
+ {
+ UInt32 index;
+ RINOK(SzReadNumber32(sd, &index));
+ if (index >= *numTempBufs)
+ return SZ_ERROR_ARCHIVE;
+ sdSwitch.Data = (tempBufs)[index].data;
+ sdSwitch.Size = (tempBufs)[index].size;
+ sdPtr = &sdSwitch;
+ }
+ RINOK(ReadUi32s(sdPtr, numFiles, &p->Attribs, allocMain));
+ break;
+ }
+ /*
+ case k7zParent:
+ {
+ SzBitUi32s_Free(&p->Parents, allocMain);
+ RINOK(ReadBitVector(sd, numFiles, &p->Parents.Defs, allocMain));
+ RINOK(SzReadSwitch(sd));
+ RINOK(ReadUi32s(sd, numFiles, &p->Parents, allocMain));
+ break;
+ }
+ */
+ case k7zIdMTime: RINOK(ReadTime(&p->MTime, numFiles, sd, tempBufs, *numTempBufs, allocMain)); break;
+ case k7zIdCTime: RINOK(ReadTime(&p->CTime, numFiles, sd, tempBufs, *numTempBufs, allocMain)); break;
+ default:
+ {
+ SKIP_DATA(sd, size);
+ }
+ }
+ }
+
+ if (numFiles - numEmptyStreams != ssi.NumTotalSubStreams)
+ return SZ_ERROR_ARCHIVE;
+
+ for (;;)
+ {
+ UInt64 type;
+ RINOK(ReadID(sd, &type));
+ if (type == k7zIdEnd)
+ break;
+ RINOK(SkipData(sd));
+ }
+
+ {
+ UInt32 i;
+ UInt32 emptyFileIndex = 0;
+ UInt32 folderIndex = 0;
+ UInt32 remSubStreams = 0;
+ UInt32 numSubStreams = 0;
+ UInt64 unpackPos = 0;
+ const Byte *digestsDefs = NULL;
+ const Byte *digestsVals = NULL;
+ UInt32 digestsValsIndex = 0;
+ UInt32 digestIndex;
+ Byte allDigestsDefined = 0;
+ Byte isDirMask = 0;
+ Byte crcMask = 0;
+ Byte mask = 0x80;
+
+ MY_ALLOC(UInt32, p->FolderToFile, p->db.NumFolders + 1, allocMain);
+ MY_ALLOC_ZE(UInt32, p->FileToFolder, p->NumFiles, allocMain);
+ MY_ALLOC(UInt64, p->UnpackPositions, p->NumFiles + 1, allocMain);
+ MY_ALLOC_ZE(Byte, p->IsDirs, (p->NumFiles + 7) >> 3, allocMain);
+
+ RINOK(SzBitUi32s_Alloc(&p->CRCs, p->NumFiles, allocMain));
+
+ if (ssi.sdCRCs.Size != 0)
+ {
+ SZ_READ_BYTE_SD(&ssi.sdCRCs, allDigestsDefined);
+ if (allDigestsDefined)
+ digestsVals = ssi.sdCRCs.Data;
+ else
+ {
+ size_t numBytes = (ssi.NumSubDigests + 7) >> 3;
+ digestsDefs = ssi.sdCRCs.Data;
+ digestsVals = digestsDefs + numBytes;
+ }
+ }
+
+ digestIndex = 0;
+
+ for (i = 0; i < numFiles; i++, mask >>= 1)
+ {
+ if (mask == 0)
+ {
+ UInt32 byteIndex = (i - 1) >> 3;
+ p->IsDirs[byteIndex] = isDirMask;
+ p->CRCs.Defs[byteIndex] = crcMask;
+ isDirMask = 0;
+ crcMask = 0;
+ mask = 0x80;
+ }
+
+ p->UnpackPositions[i] = unpackPos;
+ p->CRCs.Vals[i] = 0;
+
+ if (emptyStreams && SzBitArray_Check(emptyStreams, i))
+ {
+ if (emptyFiles)
+ {
+ if (!SzBitArray_Check(emptyFiles, emptyFileIndex))
+ isDirMask |= mask;
+ emptyFileIndex++;
+ }
+ else
+ isDirMask |= mask;
+ if (remSubStreams == 0)
+ {
+ p->FileToFolder[i] = (UInt32)-1;
+ continue;
+ }
+ }
+
+ if (remSubStreams == 0)
+ {
+ for (;;)
+ {
+ if (folderIndex >= p->db.NumFolders)
+ return SZ_ERROR_ARCHIVE;
+ p->FolderToFile[folderIndex] = i;
+ numSubStreams = 1;
+ if (ssi.sdNumSubStreams.Data)
+ {
+ RINOK(SzReadNumber32(&ssi.sdNumSubStreams, &numSubStreams));
+ }
+ remSubStreams = numSubStreams;
+ if (numSubStreams != 0)
+ break;
+ {
+ UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
+ unpackPos += folderUnpackSize;
+ if (unpackPos < folderUnpackSize)
+ return SZ_ERROR_ARCHIVE;
+ }
+
+ folderIndex++;
+ }
+ }
+
+ p->FileToFolder[i] = folderIndex;
+
+ if (emptyStreams && SzBitArray_Check(emptyStreams, i))
+ continue;
+
+ if (--remSubStreams == 0)
+ {
+ UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
+ UInt64 startFolderUnpackPos = p->UnpackPositions[p->FolderToFile[folderIndex]];
+ if (folderUnpackSize < unpackPos - startFolderUnpackPos)
+ return SZ_ERROR_ARCHIVE;
+ unpackPos = startFolderUnpackPos + folderUnpackSize;
+ if (unpackPos < folderUnpackSize)
+ return SZ_ERROR_ARCHIVE;
+
+ if (numSubStreams == 1 && SzBitWithVals_Check(&p->db.FolderCRCs, i))
+ {
+ p->CRCs.Vals[i] = p->db.FolderCRCs.Vals[folderIndex];
+ crcMask |= mask;
+ }
+ else if (allDigestsDefined || (digestsDefs && SzBitArray_Check(digestsDefs, digestIndex)))
+ {
+ p->CRCs.Vals[i] = GetUi32(digestsVals + (size_t)digestsValsIndex * 4);
+ digestsValsIndex++;
+ crcMask |= mask;
+ }
+
+ folderIndex++;
+ }
+ else
+ {
+ UInt64 v;
+ RINOK(ReadNumber(&ssi.sdSizes, &v));
+ unpackPos += v;
+ if (unpackPos < v)
+ return SZ_ERROR_ARCHIVE;
+ if (allDigestsDefined || (digestsDefs && SzBitArray_Check(digestsDefs, digestIndex)))
+ {
+ p->CRCs.Vals[i] = GetUi32(digestsVals + (size_t)digestsValsIndex * 4);
+ digestsValsIndex++;
+ crcMask |= mask;
+ }
+ }
+ }
+
+ if (mask != 0x80)
+ {
+ UInt32 byteIndex = (i - 1) >> 3;
+ p->IsDirs[byteIndex] = isDirMask;
+ p->CRCs.Defs[byteIndex] = crcMask;
+ }
+
+ p->UnpackPositions[i] = unpackPos;
+
+ if (remSubStreams != 0)
+ return SZ_ERROR_ARCHIVE;
+
+ for (;;)
+ {
+ p->FolderToFile[folderIndex] = i;
+ if (folderIndex >= p->db.NumFolders)
+ break;
+ if (!ssi.sdNumSubStreams.Data)
+ return SZ_ERROR_ARCHIVE;
+ RINOK(SzReadNumber32(&ssi.sdNumSubStreams, &numSubStreams));
+ if (numSubStreams != 0)
+ return SZ_ERROR_ARCHIVE;
+ /*
+ {
+ UInt64 folderUnpackSize = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
+ unpackPos += folderUnpackSize;
+ if (unpackPos < folderUnpackSize)
+ return SZ_ERROR_ARCHIVE;
+ }
+ */
+ folderIndex++;
+ }
+
+ if (ssi.sdNumSubStreams.Data && ssi.sdNumSubStreams.Size != 0)
+ return SZ_ERROR_ARCHIVE;
+ }
+}
+ return SZ_OK;
+}
+
+
+static SRes SzReadHeader(
+ CSzArEx *p,
+ CSzData *sd,
+ ILookInStream *inStream,
+ ISzAllocPtr allocMain,
+ ISzAllocPtr allocTemp)
+{
+ UInt32 i;
+ UInt32 numTempBufs = 0;
+ SRes res;
+ CBuf tempBufs[NUM_ADDITIONAL_STREAMS_MAX];
+
+ for (i = 0; i < NUM_ADDITIONAL_STREAMS_MAX; i++)
+ Buf_Init(tempBufs + i);
+
+ res = SzReadHeader2(p, sd, inStream,
+ tempBufs, &numTempBufs,
+ allocMain, allocTemp);
+
+ for (i = 0; i < NUM_ADDITIONAL_STREAMS_MAX; i++)
+ Buf_Free(tempBufs + i, allocTemp);
+
+ RINOK(res);
+
+ if (sd->Size != 0)
+ return SZ_ERROR_FAIL;
+
+ return res;
+}
+
+static SRes SzArEx_Open2(
+ CSzArEx *p,
+ ILookInStream *inStream,
+ ISzAllocPtr allocMain,
+ ISzAllocPtr allocTemp)
+{
+ Byte header[k7zStartHeaderSize];
+ Int64 startArcPos;
+ UInt64 nextHeaderOffset, nextHeaderSize;
+ size_t nextHeaderSizeT;
+ UInt32 nextHeaderCRC;
+ CBuf buf;
+ SRes res;
+
+ startArcPos = 0;
+ RINOK(ILookInStream_Seek(inStream, &startArcPos, SZ_SEEK_CUR));
+
+ RINOK(LookInStream_Read2(inStream, header, k7zStartHeaderSize, SZ_ERROR_NO_ARCHIVE));
+
+ if (!TestSignatureCandidate(header))
+ return SZ_ERROR_NO_ARCHIVE;
+ if (header[6] != k7zMajorVersion)
+ return SZ_ERROR_UNSUPPORTED;
+
+ nextHeaderOffset = GetUi64(header + 12);
+ nextHeaderSize = GetUi64(header + 20);
+ nextHeaderCRC = GetUi32(header + 28);
+
+ p->startPosAfterHeader = startArcPos + k7zStartHeaderSize;
+
+ if (CrcCalc(header + 12, 20) != GetUi32(header + 8))
+ return SZ_ERROR_CRC;
+
+ nextHeaderSizeT = (size_t)nextHeaderSize;
+ if (nextHeaderSizeT != nextHeaderSize)
+ return SZ_ERROR_MEM;
+ if (nextHeaderSizeT == 0)
+ return SZ_OK;
+ if (nextHeaderOffset > nextHeaderOffset + nextHeaderSize ||
+ nextHeaderOffset > nextHeaderOffset + nextHeaderSize + k7zStartHeaderSize)
+ return SZ_ERROR_NO_ARCHIVE;
+
+ {
+ Int64 pos = 0;
+ RINOK(ILookInStream_Seek(inStream, &pos, SZ_SEEK_END));
+ if ((UInt64)pos < startArcPos + nextHeaderOffset ||
+ (UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset ||
+ (UInt64)pos < startArcPos + k7zStartHeaderSize + nextHeaderOffset + nextHeaderSize)
+ return SZ_ERROR_INPUT_EOF;
+ }
+
+ RINOK(LookInStream_SeekTo(inStream, startArcPos + k7zStartHeaderSize + nextHeaderOffset));
+
+ if (!Buf_Create(&buf, nextHeaderSizeT, allocTemp))
+ return SZ_ERROR_MEM;
+
+ res = LookInStream_Read(inStream, buf.data, nextHeaderSizeT);
+
+ if (res == SZ_OK)
+ {
+ res = SZ_ERROR_ARCHIVE;
+ if (CrcCalc(buf.data, nextHeaderSizeT) == nextHeaderCRC)
+ {
+ CSzData sd;
+ UInt64 type;
+ sd.Data = buf.data;
+ sd.Size = buf.size;
+
+ res = ReadID(&sd, &type);
+
+ if (res == SZ_OK && type == k7zIdEncodedHeader)
+ {
+ CSzAr tempAr;
+ CBuf tempBuf;
+ Buf_Init(&tempBuf);
+
+ SzAr_Init(&tempAr);
+ res = SzReadAndDecodePackedStreams(inStream, &sd, &tempBuf, 1, p->startPosAfterHeader, &tempAr, allocTemp);
+ SzAr_Free(&tempAr, allocTemp);
+
+ if (res != SZ_OK)
+ {
+ Buf_Free(&tempBuf, allocTemp);
+ }
+ else
+ {
+ Buf_Free(&buf, allocTemp);
+ buf.data = tempBuf.data;
+ buf.size = tempBuf.size;
+ sd.Data = buf.data;
+ sd.Size = buf.size;
+ res = ReadID(&sd, &type);
+ }
+ }
+
+ if (res == SZ_OK)
+ {
+ if (type == k7zIdHeader)
+ {
+ /*
+ CSzData sd2;
+ unsigned ttt;
+ for (ttt = 0; ttt < 40000; ttt++)
+ {
+ SzArEx_Free(p, allocMain);
+ sd2 = sd;
+ res = SzReadHeader(p, &sd2, inStream, allocMain, allocTemp);
+ if (res != SZ_OK)
+ break;
+ }
+ */
+ res = SzReadHeader(p, &sd, inStream, allocMain, allocTemp);
+ }
+ else
+ res = SZ_ERROR_UNSUPPORTED;
+ }
+ }
+ }
+
+ Buf_Free(&buf, allocTemp);
+ return res;
+}
+
+
+SRes SzArEx_Open(CSzArEx *p, ILookInStream *inStream,
+ ISzAllocPtr allocMain, ISzAllocPtr allocTemp)
+{
+ SRes res = SzArEx_Open2(p, inStream, allocMain, allocTemp);
+ if (res != SZ_OK)
+ SzArEx_Free(p, allocMain);
+ return res;
+}
+
+
+SRes SzArEx_Extract(
+ const CSzArEx *p,
+ ILookInStream *inStream,
+ UInt32 fileIndex,
+ UInt32 *blockIndex,
+ Byte **tempBuf,
+ size_t *outBufferSize,
+ size_t *offset,
+ size_t *outSizeProcessed,
+ ISzAllocPtr allocMain,
+ ISzAllocPtr allocTemp)
+{
+ UInt32 folderIndex = p->FileToFolder[fileIndex];
+ SRes res = SZ_OK;
+
+ *offset = 0;
+ *outSizeProcessed = 0;
+
+ if (folderIndex == (UInt32)-1)
+ {
+ ISzAlloc_Free(allocMain, *tempBuf);
+ *blockIndex = folderIndex;
+ *tempBuf = NULL;
+ *outBufferSize = 0;
+ return SZ_OK;
+ }
+
+ if (*tempBuf == NULL || *blockIndex != folderIndex)
+ {
+ UInt64 unpackSizeSpec = SzAr_GetFolderUnpackSize(&p->db, folderIndex);
+ /*
+ UInt64 unpackSizeSpec =
+ p->UnpackPositions[p->FolderToFile[(size_t)folderIndex + 1]] -
+ p->UnpackPositions[p->FolderToFile[folderIndex]];
+ */
+ size_t unpackSize = (size_t)unpackSizeSpec;
+
+ if (unpackSize != unpackSizeSpec)
+ return SZ_ERROR_MEM;
+ *blockIndex = folderIndex;
+ ISzAlloc_Free(allocMain, *tempBuf);
+ *tempBuf = NULL;
+
+ if (res == SZ_OK)
+ {
+ *outBufferSize = unpackSize;
+ if (unpackSize != 0)
+ {
+ *tempBuf = (Byte *)ISzAlloc_Alloc(allocMain, unpackSize);
+ if (*tempBuf == NULL)
+ res = SZ_ERROR_MEM;
+ }
+
+ if (res == SZ_OK)
+ {
+ res = SzAr_DecodeFolder(&p->db, folderIndex,
+ inStream, p->dataPos, *tempBuf, unpackSize, allocTemp);
+ }
+ }
+ }
+
+ if (res == SZ_OK)
+ {
+ UInt64 unpackPos = p->UnpackPositions[fileIndex];
+ *offset = (size_t)(unpackPos - p->UnpackPositions[p->FolderToFile[folderIndex]]);
+ *outSizeProcessed = (size_t)(p->UnpackPositions[(size_t)fileIndex + 1] - unpackPos);
+ if (*offset + *outSizeProcessed > *outBufferSize)
+ return SZ_ERROR_FAIL;
+ if (SzBitWithVals_Check(&p->CRCs, fileIndex))
+ if (CrcCalc(*tempBuf + *offset, *outSizeProcessed) != p->CRCs.Vals[fileIndex])
+ res = SZ_ERROR_CRC;
+ }
+
+ return res;
+}
+
+
+size_t SzArEx_GetFileNameUtf16(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
+{
+ size_t offs = p->FileNameOffsets[fileIndex];
+ size_t len = p->FileNameOffsets[fileIndex + 1] - offs;
+ if (dest != 0)
+ {
+ size_t i;
+ const Byte *src = p->FileNames + offs * 2;
+ for (i = 0; i < len; i++)
+ dest[i] = GetUi16(src + i * 2);
+ }
+ return len;
+}
+
+/*
+size_t SzArEx_GetFullNameLen(const CSzArEx *p, size_t fileIndex)
+{
+ size_t len;
+ if (!p->FileNameOffsets)
+ return 1;
+ len = 0;
+ for (;;)
+ {
+ UInt32 parent = (UInt32)(Int32)-1;
+ len += p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];
+ if SzBitWithVals_Check(&p->Parents, fileIndex)
+ parent = p->Parents.Vals[fileIndex];
+ if (parent == (UInt32)(Int32)-1)
+ return len;
+ fileIndex = parent;
+ }
+}
+
+UInt16 *SzArEx_GetFullNameUtf16_Back(const CSzArEx *p, size_t fileIndex, UInt16 *dest)
+{
+ Bool needSlash;
+ if (!p->FileNameOffsets)
+ {
+ *(--dest) = 0;
+ return dest;
+ }
+ needSlash = False;
+ for (;;)
+ {
+ UInt32 parent = (UInt32)(Int32)-1;
+ size_t curLen = p->FileNameOffsets[fileIndex + 1] - p->FileNameOffsets[fileIndex];
+ SzArEx_GetFileNameUtf16(p, fileIndex, dest - curLen);
+ if (needSlash)
+ *(dest - 1) = '/';
+ needSlash = True;
+ dest -= curLen;
+
+ if SzBitWithVals_Check(&p->Parents, fileIndex)
+ parent = p->Parents.Vals[fileIndex];
+ if (parent == (UInt32)(Int32)-1)
+ return dest;
+ fileIndex = parent;
+ }
+}
+*/
diff --git a/other-licenses/7zstub/src/C/7zBuf.c b/other-licenses/7zstub/src/C/7zBuf.c
new file mode 100644
index 0000000000..438bba68bd
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zBuf.c
@@ -0,0 +1,36 @@
+/* 7zBuf.c -- Byte Buffer
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "7zBuf.h"
+
+void Buf_Init(CBuf *p)
+{
+ p->data = 0;
+ p->size = 0;
+}
+
+int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc)
+{
+ p->size = 0;
+ if (size == 0)
+ {
+ p->data = 0;
+ return 1;
+ }
+ p->data = (Byte *)ISzAlloc_Alloc(alloc, size);
+ if (p->data)
+ {
+ p->size = size;
+ return 1;
+ }
+ return 0;
+}
+
+void Buf_Free(CBuf *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->data);
+ p->data = 0;
+ p->size = 0;
+}
diff --git a/other-licenses/7zstub/src/C/7zBuf.h b/other-licenses/7zstub/src/C/7zBuf.h
new file mode 100644
index 0000000000..5942d6e623
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zBuf.h
@@ -0,0 +1,35 @@
+/* 7zBuf.h -- Byte Buffer
+2017-04-03 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_BUF_H
+#define __7Z_BUF_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+typedef struct
+{
+ Byte *data;
+ size_t size;
+} CBuf;
+
+void Buf_Init(CBuf *p);
+int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc);
+void Buf_Free(CBuf *p, ISzAllocPtr alloc);
+
+typedef struct
+{
+ Byte *data;
+ size_t size;
+ size_t pos;
+} CDynBuf;
+
+void DynBuf_Construct(CDynBuf *p);
+void DynBuf_SeekToBeg(CDynBuf *p);
+int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc);
+void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zBuf2.c b/other-licenses/7zstub/src/C/7zBuf2.c
new file mode 100644
index 0000000000..49b4343b67
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zBuf2.c
@@ -0,0 +1,52 @@
+/* 7zBuf2.c -- Byte Buffer
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "7zBuf.h"
+
+void DynBuf_Construct(CDynBuf *p)
+{
+ p->data = 0;
+ p->size = 0;
+ p->pos = 0;
+}
+
+void DynBuf_SeekToBeg(CDynBuf *p)
+{
+ p->pos = 0;
+}
+
+int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc)
+{
+ if (size > p->size - p->pos)
+ {
+ size_t newSize = p->pos + size;
+ Byte *data;
+ newSize += newSize / 4;
+ data = (Byte *)ISzAlloc_Alloc(alloc, newSize);
+ if (!data)
+ return 0;
+ p->size = newSize;
+ if (p->pos != 0)
+ memcpy(data, p->data, p->pos);
+ ISzAlloc_Free(alloc, p->data);
+ p->data = data;
+ }
+ if (size != 0)
+ {
+ memcpy(p->data + p->pos, buf, size);
+ p->pos += size;
+ }
+ return 1;
+}
+
+void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->data);
+ p->data = 0;
+ p->size = 0;
+ p->pos = 0;
+}
diff --git a/other-licenses/7zstub/src/C/7zCrc.c b/other-licenses/7zstub/src/C/7zCrc.c
new file mode 100644
index 0000000000..40ab75952a
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zCrc.c
@@ -0,0 +1,128 @@
+/* 7zCrc.c -- CRC32 init
+2017-06-06 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "7zCrc.h"
+#include "CpuArch.h"
+
+#define kCrcPoly 0xEDB88320
+
+#ifdef MY_CPU_LE
+ #define CRC_NUM_TABLES 8
+#else
+ #define CRC_NUM_TABLES 9
+
+ #define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
+
+ UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
+ UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
+#endif
+
+#ifndef MY_CPU_BE
+ UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
+ UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
+#endif
+
+typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
+
+CRC_FUNC g_CrcUpdateT4;
+CRC_FUNC g_CrcUpdateT8;
+CRC_FUNC g_CrcUpdate;
+
+UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
+
+UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
+{
+ return g_CrcUpdate(v, data, size, g_CrcTable);
+}
+
+UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
+{
+ return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;
+}
+
+#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
+
+UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table)
+{
+ const Byte *p = (const Byte *)data;
+ const Byte *pEnd = p + size;
+ for (; p != pEnd; p++)
+ v = CRC_UPDATE_BYTE_2(v, *p);
+ return v;
+}
+
+void MY_FAST_CALL CrcGenerateTable()
+{
+ UInt32 i;
+ for (i = 0; i < 256; i++)
+ {
+ UInt32 r = i;
+ unsigned j;
+ for (j = 0; j < 8; j++)
+ r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
+ g_CrcTable[i] = r;
+ }
+ for (i = 256; i < 256 * CRC_NUM_TABLES; i++)
+ {
+ UInt32 r = g_CrcTable[(size_t)i - 256];
+ g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
+ }
+
+ #if CRC_NUM_TABLES < 4
+
+ g_CrcUpdate = CrcUpdateT1;
+
+ #else
+
+ #ifdef MY_CPU_LE
+
+ g_CrcUpdateT4 = CrcUpdateT4;
+ g_CrcUpdate = CrcUpdateT4;
+
+ #if CRC_NUM_TABLES >= 8
+ g_CrcUpdateT8 = CrcUpdateT8;
+
+ #ifdef MY_CPU_X86_OR_AMD64
+ if (!CPU_Is_InOrder())
+ #endif
+ g_CrcUpdate = CrcUpdateT8;
+ #endif
+
+ #else
+ {
+ #ifndef MY_CPU_BE
+ UInt32 k = 0x01020304;
+ const Byte *p = (const Byte *)&k;
+ if (p[0] == 4 && p[1] == 3)
+ {
+ g_CrcUpdateT4 = CrcUpdateT4;
+ g_CrcUpdate = CrcUpdateT4;
+ #if CRC_NUM_TABLES >= 8
+ g_CrcUpdateT8 = CrcUpdateT8;
+ g_CrcUpdate = CrcUpdateT8;
+ #endif
+ }
+ else if (p[0] != 1 || p[1] != 2)
+ g_CrcUpdate = CrcUpdateT1;
+ else
+ #endif
+ {
+ for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--)
+ {
+ UInt32 x = g_CrcTable[(size_t)i - 256];
+ g_CrcTable[i] = CRC_UINT32_SWAP(x);
+ }
+ g_CrcUpdateT4 = CrcUpdateT1_BeT4;
+ g_CrcUpdate = CrcUpdateT1_BeT4;
+ #if CRC_NUM_TABLES >= 8
+ g_CrcUpdateT8 = CrcUpdateT1_BeT8;
+ g_CrcUpdate = CrcUpdateT1_BeT8;
+ #endif
+ }
+ }
+ #endif
+
+ #endif
+}
diff --git a/other-licenses/7zstub/src/C/7zCrc.h b/other-licenses/7zstub/src/C/7zCrc.h
new file mode 100644
index 0000000000..3b0459402b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zCrc.h
@@ -0,0 +1,25 @@
+/* 7zCrc.h -- CRC32 calculation
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_CRC_H
+#define __7Z_CRC_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+extern UInt32 g_CrcTable[];
+
+/* Call CrcGenerateTable one time before other CRC functions */
+void MY_FAST_CALL CrcGenerateTable(void);
+
+#define CRC_INIT_VAL 0xFFFFFFFF
+#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
+#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
+
+UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
+UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zCrcOpt.c b/other-licenses/7zstub/src/C/7zCrcOpt.c
new file mode 100644
index 0000000000..2ee0de8459
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zCrcOpt.c
@@ -0,0 +1,115 @@
+/* 7zCrcOpt.c -- CRC32 calculation
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+
+#ifndef MY_CPU_BE
+
+#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
+
+UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
+{
+ const Byte *p = (const Byte *)data;
+ for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2(v, *p);
+ for (; size >= 4; size -= 4, p += 4)
+ {
+ v ^= *(const UInt32 *)p;
+ v =
+ (table + 0x300)[((v ) & 0xFF)]
+ ^ (table + 0x200)[((v >> 8) & 0xFF)]
+ ^ (table + 0x100)[((v >> 16) & 0xFF)]
+ ^ (table + 0x000)[((v >> 24))];
+ }
+ for (; size > 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2(v, *p);
+ return v;
+}
+
+UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
+{
+ const Byte *p = (const Byte *)data;
+ for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2(v, *p);
+ for (; size >= 8; size -= 8, p += 8)
+ {
+ UInt32 d;
+ v ^= *(const UInt32 *)p;
+ v =
+ (table + 0x700)[((v ) & 0xFF)]
+ ^ (table + 0x600)[((v >> 8) & 0xFF)]
+ ^ (table + 0x500)[((v >> 16) & 0xFF)]
+ ^ (table + 0x400)[((v >> 24))];
+ d = *((const UInt32 *)p + 1);
+ v ^=
+ (table + 0x300)[((d ) & 0xFF)]
+ ^ (table + 0x200)[((d >> 8) & 0xFF)]
+ ^ (table + 0x100)[((d >> 16) & 0xFF)]
+ ^ (table + 0x000)[((d >> 24))];
+ }
+ for (; size > 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2(v, *p);
+ return v;
+}
+
+#endif
+
+
+#ifndef MY_CPU_LE
+
+#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
+
+#define CRC_UPDATE_BYTE_2_BE(crc, b) (table[(((crc) >> 24) ^ (b))] ^ ((crc) << 8))
+
+UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table)
+{
+ const Byte *p = (const Byte *)data;
+ table += 0x100;
+ v = CRC_UINT32_SWAP(v);
+ for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2_BE(v, *p);
+ for (; size >= 4; size -= 4, p += 4)
+ {
+ v ^= *(const UInt32 *)p;
+ v =
+ (table + 0x000)[((v ) & 0xFF)]
+ ^ (table + 0x100)[((v >> 8) & 0xFF)]
+ ^ (table + 0x200)[((v >> 16) & 0xFF)]
+ ^ (table + 0x300)[((v >> 24))];
+ }
+ for (; size > 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2_BE(v, *p);
+ return CRC_UINT32_SWAP(v);
+}
+
+UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table)
+{
+ const Byte *p = (const Byte *)data;
+ table += 0x100;
+ v = CRC_UINT32_SWAP(v);
+ for (; size > 0 && ((unsigned)(ptrdiff_t)p & 7) != 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2_BE(v, *p);
+ for (; size >= 8; size -= 8, p += 8)
+ {
+ UInt32 d;
+ v ^= *(const UInt32 *)p;
+ v =
+ (table + 0x400)[((v ) & 0xFF)]
+ ^ (table + 0x500)[((v >> 8) & 0xFF)]
+ ^ (table + 0x600)[((v >> 16) & 0xFF)]
+ ^ (table + 0x700)[((v >> 24))];
+ d = *((const UInt32 *)p + 1);
+ v ^=
+ (table + 0x000)[((d ) & 0xFF)]
+ ^ (table + 0x100)[((d >> 8) & 0xFF)]
+ ^ (table + 0x200)[((d >> 16) & 0xFF)]
+ ^ (table + 0x300)[((d >> 24))];
+ }
+ for (; size > 0; size--, p++)
+ v = CRC_UPDATE_BYTE_2_BE(v, *p);
+ return CRC_UINT32_SWAP(v);
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zDec.c b/other-licenses/7zstub/src/C/7zDec.c
new file mode 100644
index 0000000000..9c986950c8
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zDec.c
@@ -0,0 +1,591 @@
+/* 7zDec.c -- Decoding from 7z folder
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+/* #define _7ZIP_PPMD_SUPPPORT */
+
+#include "7z.h"
+#include "7zCrc.h"
+
+#include "Bcj2.h"
+#include "Bra.h"
+#include "CpuArch.h"
+#include "Delta.h"
+#include "LzmaDec.h"
+#include "Lzma2Dec.h"
+#ifdef _7ZIP_PPMD_SUPPPORT
+#include "Ppmd7.h"
+#endif
+
+#define k_Copy 0
+#define k_Delta 3
+#define k_LZMA2 0x21
+#define k_LZMA 0x30101
+#define k_BCJ 0x3030103
+#define k_BCJ2 0x303011B
+#define k_PPC 0x3030205
+#define k_IA64 0x3030401
+#define k_ARM 0x3030501
+#define k_ARMT 0x3030701
+#define k_SPARC 0x3030805
+
+
+#ifdef _7ZIP_PPMD_SUPPPORT
+
+#define k_PPMD 0x30401
+
+typedef struct
+{
+ IByteIn vt;
+ const Byte *cur;
+ const Byte *end;
+ const Byte *begin;
+ UInt64 processed;
+ Bool extra;
+ SRes res;
+ const ILookInStream *inStream;
+} CByteInToLook;
+
+static Byte ReadByte(const IByteIn *pp)
+{
+ CByteInToLook *p = CONTAINER_FROM_VTBL(pp, CByteInToLook, vt);
+ if (p->cur != p->end)
+ return *p->cur++;
+ if (p->res == SZ_OK)
+ {
+ size_t size = p->cur - p->begin;
+ p->processed += size;
+ p->res = ILookInStream_Skip(p->inStream, size);
+ size = (1 << 25);
+ p->res = ILookInStream_Look(p->inStream, (const void **)&p->begin, &size);
+ p->cur = p->begin;
+ p->end = p->begin + size;
+ if (size != 0)
+ return *p->cur++;;
+ }
+ p->extra = True;
+ return 0;
+}
+
+static SRes SzDecodePpmd(const Byte *props, unsigned propsSize, UInt64 inSize, const ILookInStream *inStream,
+ Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
+{
+ CPpmd7 ppmd;
+ CByteInToLook s;
+ SRes res = SZ_OK;
+
+ s.vt.Read = ReadByte;
+ s.inStream = inStream;
+ s.begin = s.end = s.cur = NULL;
+ s.extra = False;
+ s.res = SZ_OK;
+ s.processed = 0;
+
+ if (propsSize != 5)
+ return SZ_ERROR_UNSUPPORTED;
+
+ {
+ unsigned order = props[0];
+ UInt32 memSize = GetUi32(props + 1);
+ if (order < PPMD7_MIN_ORDER ||
+ order > PPMD7_MAX_ORDER ||
+ memSize < PPMD7_MIN_MEM_SIZE ||
+ memSize > PPMD7_MAX_MEM_SIZE)
+ return SZ_ERROR_UNSUPPORTED;
+ Ppmd7_Construct(&ppmd);
+ if (!Ppmd7_Alloc(&ppmd, memSize, allocMain))
+ return SZ_ERROR_MEM;
+ Ppmd7_Init(&ppmd, order);
+ }
+ {
+ CPpmd7z_RangeDec rc;
+ Ppmd7z_RangeDec_CreateVTable(&rc);
+ rc.Stream = &s.vt;
+ if (!Ppmd7z_RangeDec_Init(&rc))
+ res = SZ_ERROR_DATA;
+ else if (s.extra)
+ res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);
+ else
+ {
+ SizeT i;
+ for (i = 0; i < outSize; i++)
+ {
+ int sym = Ppmd7_DecodeSymbol(&ppmd, &rc.vt);
+ if (s.extra || sym < 0)
+ break;
+ outBuffer[i] = (Byte)sym;
+ }
+ if (i != outSize)
+ res = (s.res != SZ_OK ? s.res : SZ_ERROR_DATA);
+ else if (s.processed + (s.cur - s.begin) != inSize || !Ppmd7z_RangeDec_IsFinishedOK(&rc))
+ res = SZ_ERROR_DATA;
+ }
+ }
+ Ppmd7_Free(&ppmd, allocMain);
+ return res;
+}
+
+#endif
+
+
+static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
+ Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
+{
+ CLzmaDec state;
+ SRes res = SZ_OK;
+
+ LzmaDec_Construct(&state);
+ RINOK(LzmaDec_AllocateProbs(&state, props, propsSize, allocMain));
+ state.dic = outBuffer;
+ state.dicBufSize = outSize;
+ LzmaDec_Init(&state);
+
+ for (;;)
+ {
+ const void *inBuf = NULL;
+ size_t lookahead = (1 << 18);
+ if (lookahead > inSize)
+ lookahead = (size_t)inSize;
+ res = ILookInStream_Look(inStream, &inBuf, &lookahead);
+ if (res != SZ_OK)
+ break;
+
+ {
+ SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos;
+ ELzmaStatus status;
+ res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
+ lookahead -= inProcessed;
+ inSize -= inProcessed;
+ if (res != SZ_OK)
+ break;
+
+ if (status == LZMA_STATUS_FINISHED_WITH_MARK)
+ {
+ if (outSize != state.dicPos || inSize != 0)
+ res = SZ_ERROR_DATA;
+ break;
+ }
+
+ if (outSize == state.dicPos && inSize == 0 && status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK)
+ break;
+
+ if (inProcessed == 0 && dicPos == state.dicPos)
+ {
+ res = SZ_ERROR_DATA;
+ break;
+ }
+
+ res = ILookInStream_Skip(inStream, inProcessed);
+ if (res != SZ_OK)
+ break;
+ }
+ }
+
+ LzmaDec_FreeProbs(&state, allocMain);
+ return res;
+}
+
+
+#ifndef _7Z_NO_METHOD_LZMA2
+
+static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize, ILookInStream *inStream,
+ Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain)
+{
+ CLzma2Dec state;
+ SRes res = SZ_OK;
+
+ Lzma2Dec_Construct(&state);
+ if (propsSize != 1)
+ return SZ_ERROR_DATA;
+ RINOK(Lzma2Dec_AllocateProbs(&state, props[0], allocMain));
+ state.decoder.dic = outBuffer;
+ state.decoder.dicBufSize = outSize;
+ Lzma2Dec_Init(&state);
+
+ for (;;)
+ {
+ const void *inBuf = NULL;
+ size_t lookahead = (1 << 18);
+ if (lookahead > inSize)
+ lookahead = (size_t)inSize;
+ res = ILookInStream_Look(inStream, &inBuf, &lookahead);
+ if (res != SZ_OK)
+ break;
+
+ {
+ SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos;
+ ELzmaStatus status;
+ res = Lzma2Dec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
+ lookahead -= inProcessed;
+ inSize -= inProcessed;
+ if (res != SZ_OK)
+ break;
+
+ if (status == LZMA_STATUS_FINISHED_WITH_MARK)
+ {
+ if (outSize != state.decoder.dicPos || inSize != 0)
+ res = SZ_ERROR_DATA;
+ break;
+ }
+
+ if (inProcessed == 0 && dicPos == state.decoder.dicPos)
+ {
+ res = SZ_ERROR_DATA;
+ break;
+ }
+
+ res = ILookInStream_Skip(inStream, inProcessed);
+ if (res != SZ_OK)
+ break;
+ }
+ }
+
+ Lzma2Dec_FreeProbs(&state, allocMain);
+ return res;
+}
+
+#endif
+
+
+static SRes SzDecodeCopy(UInt64 inSize, ILookInStream *inStream, Byte *outBuffer)
+{
+ while (inSize > 0)
+ {
+ const void *inBuf;
+ size_t curSize = (1 << 18);
+ if (curSize > inSize)
+ curSize = (size_t)inSize;
+ RINOK(ILookInStream_Look(inStream, &inBuf, &curSize));
+ if (curSize == 0)
+ return SZ_ERROR_INPUT_EOF;
+ memcpy(outBuffer, inBuf, curSize);
+ outBuffer += curSize;
+ inSize -= curSize;
+ RINOK(ILookInStream_Skip(inStream, curSize));
+ }
+ return SZ_OK;
+}
+
+static Bool IS_MAIN_METHOD(UInt32 m)
+{
+ switch (m)
+ {
+ case k_Copy:
+ case k_LZMA:
+ #ifndef _7Z_NO_METHOD_LZMA2
+ case k_LZMA2:
+ #endif
+ #ifdef _7ZIP_PPMD_SUPPPORT
+ case k_PPMD:
+ #endif
+ return True;
+ }
+ return False;
+}
+
+static Bool IS_SUPPORTED_CODER(const CSzCoderInfo *c)
+{
+ return
+ c->NumStreams == 1
+ /* && c->MethodID <= (UInt32)0xFFFFFFFF */
+ && IS_MAIN_METHOD((UInt32)c->MethodID);
+}
+
+#define IS_BCJ2(c) ((c)->MethodID == k_BCJ2 && (c)->NumStreams == 4)
+
+static SRes CheckSupportedFolder(const CSzFolder *f)
+{
+ if (f->NumCoders < 1 || f->NumCoders > 4)
+ return SZ_ERROR_UNSUPPORTED;
+ if (!IS_SUPPORTED_CODER(&f->Coders[0]))
+ return SZ_ERROR_UNSUPPORTED;
+ if (f->NumCoders == 1)
+ {
+ if (f->NumPackStreams != 1 || f->PackStreams[0] != 0 || f->NumBonds != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ return SZ_OK;
+ }
+
+
+ #ifndef _7Z_NO_METHODS_FILTERS
+
+ if (f->NumCoders == 2)
+ {
+ const CSzCoderInfo *c = &f->Coders[1];
+ if (
+ /* c->MethodID > (UInt32)0xFFFFFFFF || */
+ c->NumStreams != 1
+ || f->NumPackStreams != 1
+ || f->PackStreams[0] != 0
+ || f->NumBonds != 1
+ || f->Bonds[0].InIndex != 1
+ || f->Bonds[0].OutIndex != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ switch ((UInt32)c->MethodID)
+ {
+ case k_Delta:
+ case k_BCJ:
+ case k_PPC:
+ case k_IA64:
+ case k_SPARC:
+ case k_ARM:
+ case k_ARMT:
+ break;
+ default:
+ return SZ_ERROR_UNSUPPORTED;
+ }
+ return SZ_OK;
+ }
+
+ #endif
+
+
+ if (f->NumCoders == 4)
+ {
+ if (!IS_SUPPORTED_CODER(&f->Coders[1])
+ || !IS_SUPPORTED_CODER(&f->Coders[2])
+ || !IS_BCJ2(&f->Coders[3]))
+ return SZ_ERROR_UNSUPPORTED;
+ if (f->NumPackStreams != 4
+ || f->PackStreams[0] != 2
+ || f->PackStreams[1] != 6
+ || f->PackStreams[2] != 1
+ || f->PackStreams[3] != 0
+ || f->NumBonds != 3
+ || f->Bonds[0].InIndex != 5 || f->Bonds[0].OutIndex != 0
+ || f->Bonds[1].InIndex != 4 || f->Bonds[1].OutIndex != 1
+ || f->Bonds[2].InIndex != 3 || f->Bonds[2].OutIndex != 2)
+ return SZ_ERROR_UNSUPPORTED;
+ return SZ_OK;
+ }
+
+ return SZ_ERROR_UNSUPPORTED;
+}
+
+#define CASE_BRA_CONV(isa) case k_ ## isa: isa ## _Convert(outBuffer, outSize, 0, 0); break;
+
+static SRes SzFolder_Decode2(const CSzFolder *folder,
+ const Byte *propsData,
+ const UInt64 *unpackSizes,
+ const UInt64 *packPositions,
+ ILookInStream *inStream, UInt64 startPos,
+ Byte *outBuffer, SizeT outSize, ISzAllocPtr allocMain,
+ Byte *tempBuf[])
+{
+ UInt32 ci;
+ SizeT tempSizes[3] = { 0, 0, 0};
+ SizeT tempSize3 = 0;
+ Byte *tempBuf3 = 0;
+
+ RINOK(CheckSupportedFolder(folder));
+
+ for (ci = 0; ci < folder->NumCoders; ci++)
+ {
+ const CSzCoderInfo *coder = &folder->Coders[ci];
+
+ if (IS_MAIN_METHOD((UInt32)coder->MethodID))
+ {
+ UInt32 si = 0;
+ UInt64 offset;
+ UInt64 inSize;
+ Byte *outBufCur = outBuffer;
+ SizeT outSizeCur = outSize;
+ if (folder->NumCoders == 4)
+ {
+ UInt32 indices[] = { 3, 2, 0 };
+ UInt64 unpackSize = unpackSizes[ci];
+ si = indices[ci];
+ if (ci < 2)
+ {
+ Byte *temp;
+ outSizeCur = (SizeT)unpackSize;
+ if (outSizeCur != unpackSize)
+ return SZ_ERROR_MEM;
+ temp = (Byte *)ISzAlloc_Alloc(allocMain, outSizeCur);
+ if (!temp && outSizeCur != 0)
+ return SZ_ERROR_MEM;
+ outBufCur = tempBuf[1 - ci] = temp;
+ tempSizes[1 - ci] = outSizeCur;
+ }
+ else if (ci == 2)
+ {
+ if (unpackSize > outSize) /* check it */
+ return SZ_ERROR_PARAM;
+ tempBuf3 = outBufCur = outBuffer + (outSize - (size_t)unpackSize);
+ tempSize3 = outSizeCur = (SizeT)unpackSize;
+ }
+ else
+ return SZ_ERROR_UNSUPPORTED;
+ }
+ offset = packPositions[si];
+ inSize = packPositions[(size_t)si + 1] - offset;
+ RINOK(LookInStream_SeekTo(inStream, startPos + offset));
+
+ if (coder->MethodID == k_Copy)
+ {
+ if (inSize != outSizeCur) /* check it */
+ return SZ_ERROR_DATA;
+ RINOK(SzDecodeCopy(inSize, inStream, outBufCur));
+ }
+ else if (coder->MethodID == k_LZMA)
+ {
+ RINOK(SzDecodeLzma(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain));
+ }
+ #ifndef _7Z_NO_METHOD_LZMA2
+ else if (coder->MethodID == k_LZMA2)
+ {
+ RINOK(SzDecodeLzma2(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain));
+ }
+ #endif
+ #ifdef _7ZIP_PPMD_SUPPPORT
+ else if (coder->MethodID == k_PPMD)
+ {
+ RINOK(SzDecodePpmd(propsData + coder->PropsOffset, coder->PropsSize, inSize, inStream, outBufCur, outSizeCur, allocMain));
+ }
+ #endif
+ else
+ return SZ_ERROR_UNSUPPORTED;
+ }
+ else if (coder->MethodID == k_BCJ2)
+ {
+ UInt64 offset = packPositions[1];
+ UInt64 s3Size = packPositions[2] - offset;
+
+ if (ci != 3)
+ return SZ_ERROR_UNSUPPORTED;
+
+ tempSizes[2] = (SizeT)s3Size;
+ if (tempSizes[2] != s3Size)
+ return SZ_ERROR_MEM;
+ tempBuf[2] = (Byte *)ISzAlloc_Alloc(allocMain, tempSizes[2]);
+ if (!tempBuf[2] && tempSizes[2] != 0)
+ return SZ_ERROR_MEM;
+
+ RINOK(LookInStream_SeekTo(inStream, startPos + offset));
+ RINOK(SzDecodeCopy(s3Size, inStream, tempBuf[2]));
+
+ if ((tempSizes[0] & 3) != 0 ||
+ (tempSizes[1] & 3) != 0 ||
+ tempSize3 + tempSizes[0] + tempSizes[1] != outSize)
+ return SZ_ERROR_DATA;
+
+ {
+ CBcj2Dec p;
+
+ p.bufs[0] = tempBuf3; p.lims[0] = tempBuf3 + tempSize3;
+ p.bufs[1] = tempBuf[0]; p.lims[1] = tempBuf[0] + tempSizes[0];
+ p.bufs[2] = tempBuf[1]; p.lims[2] = tempBuf[1] + tempSizes[1];
+ p.bufs[3] = tempBuf[2]; p.lims[3] = tempBuf[2] + tempSizes[2];
+
+ p.dest = outBuffer;
+ p.destLim = outBuffer + outSize;
+
+ Bcj2Dec_Init(&p);
+ RINOK(Bcj2Dec_Decode(&p));
+
+ {
+ unsigned i;
+ for (i = 0; i < 4; i++)
+ if (p.bufs[i] != p.lims[i])
+ return SZ_ERROR_DATA;
+
+ if (!Bcj2Dec_IsFinished(&p))
+ return SZ_ERROR_DATA;
+
+ if (p.dest != p.destLim
+ || p.state != BCJ2_STREAM_MAIN)
+ return SZ_ERROR_DATA;
+ }
+ }
+ }
+ #ifndef _7Z_NO_METHODS_FILTERS
+ else if (ci == 1)
+ {
+ if (coder->MethodID == k_Delta)
+ {
+ if (coder->PropsSize != 1)
+ return SZ_ERROR_UNSUPPORTED;
+ {
+ Byte state[DELTA_STATE_SIZE];
+ Delta_Init(state);
+ Delta_Decode(state, (unsigned)(propsData[coder->PropsOffset]) + 1, outBuffer, outSize);
+ }
+ }
+ else
+ {
+ if (coder->PropsSize != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ switch (coder->MethodID)
+ {
+ case k_BCJ:
+ {
+ UInt32 state;
+ x86_Convert_Init(state);
+ x86_Convert(outBuffer, outSize, 0, &state, 0);
+ break;
+ }
+ CASE_BRA_CONV(PPC)
+ CASE_BRA_CONV(IA64)
+ CASE_BRA_CONV(SPARC)
+ CASE_BRA_CONV(ARM)
+ CASE_BRA_CONV(ARMT)
+ default:
+ return SZ_ERROR_UNSUPPORTED;
+ }
+ }
+ }
+ #endif
+ else
+ return SZ_ERROR_UNSUPPORTED;
+ }
+
+ return SZ_OK;
+}
+
+
+SRes SzAr_DecodeFolder(const CSzAr *p, UInt32 folderIndex,
+ ILookInStream *inStream, UInt64 startPos,
+ Byte *outBuffer, size_t outSize,
+ ISzAllocPtr allocMain)
+{
+ SRes res;
+ CSzFolder folder;
+ CSzData sd;
+
+ const Byte *data = p->CodersData + p->FoCodersOffsets[folderIndex];
+ sd.Data = data;
+ sd.Size = p->FoCodersOffsets[(size_t)folderIndex + 1] - p->FoCodersOffsets[folderIndex];
+
+ res = SzGetNextFolderItem(&folder, &sd);
+
+ if (res != SZ_OK)
+ return res;
+
+ if (sd.Size != 0
+ || folder.UnpackStream != p->FoToMainUnpackSizeIndex[folderIndex]
+ || outSize != SzAr_GetFolderUnpackSize(p, folderIndex))
+ return SZ_ERROR_FAIL;
+ {
+ unsigned i;
+ Byte *tempBuf[3] = { 0, 0, 0};
+
+ res = SzFolder_Decode2(&folder, data,
+ &p->CoderUnpackSizes[p->FoToCoderUnpackSizes[folderIndex]],
+ p->PackPositions + p->FoStartPackStreamIndex[folderIndex],
+ inStream, startPos,
+ outBuffer, (SizeT)outSize, allocMain, tempBuf);
+
+ for (i = 0; i < 3; i++)
+ ISzAlloc_Free(allocMain, tempBuf[i]);
+
+ if (res == SZ_OK)
+ if (SzBitWithVals_Check(&p->FolderCRCs, folderIndex))
+ if (CrcCalc(outBuffer, outSize) != p->FolderCRCs.Vals[folderIndex])
+ res = SZ_ERROR_CRC;
+
+ return res;
+ }
+}
diff --git a/other-licenses/7zstub/src/C/7zFile.c b/other-licenses/7zstub/src/C/7zFile.c
new file mode 100644
index 0000000000..e486901e30
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zFile.c
@@ -0,0 +1,286 @@
+/* 7zFile.c -- File IO
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "7zFile.h"
+
+#ifndef USE_WINDOWS_FILE
+
+#ifndef UNDER_CE
+#include <errno.h>
+#endif
+
+#else
+
+/*
+ ReadFile and WriteFile functions in Windows have BUG:
+ If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
+ from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
+ (Insufficient system resources exist to complete the requested service).
+ Probably in some version of Windows there are problems with other sizes:
+ for 32 MB (maybe also for 16 MB).
+ And message can be "Network connection was lost"
+*/
+
+#define kChunkSizeMax (1 << 22)
+
+#endif
+
+void File_Construct(CSzFile *p)
+{
+ #ifdef USE_WINDOWS_FILE
+ p->handle = INVALID_HANDLE_VALUE;
+ #else
+ p->file = NULL;
+ #endif
+}
+
+#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
+static WRes File_Open(CSzFile *p, const char *name, int writeMode)
+{
+ #ifdef USE_WINDOWS_FILE
+ p->handle = CreateFileA(name,
+ writeMode ? GENERIC_WRITE : GENERIC_READ,
+ FILE_SHARE_READ, NULL,
+ writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
+ #else
+ p->file = fopen(name, writeMode ? "wb+" : "rb");
+ return (p->file != 0) ? 0 :
+ #ifdef UNDER_CE
+ 2; /* ENOENT */
+ #else
+ errno;
+ #endif
+ #endif
+}
+
+WRes InFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 0); }
+WRes OutFile_Open(CSzFile *p, const char *name) { return File_Open(p, name, 1); }
+#endif
+
+#ifdef USE_WINDOWS_FILE
+static WRes File_OpenW(CSzFile *p, const WCHAR *name, int writeMode)
+{
+ p->handle = CreateFileW(name,
+ writeMode ? GENERIC_WRITE : GENERIC_READ,
+ FILE_SHARE_READ, NULL,
+ writeMode ? CREATE_ALWAYS : OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL, NULL);
+ return (p->handle != INVALID_HANDLE_VALUE) ? 0 : GetLastError();
+}
+WRes InFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 0); }
+WRes OutFile_OpenW(CSzFile *p, const WCHAR *name) { return File_OpenW(p, name, 1); }
+#endif
+
+WRes File_Close(CSzFile *p)
+{
+ #ifdef USE_WINDOWS_FILE
+ if (p->handle != INVALID_HANDLE_VALUE)
+ {
+ if (!CloseHandle(p->handle))
+ return GetLastError();
+ p->handle = INVALID_HANDLE_VALUE;
+ }
+ #else
+ if (p->file != NULL)
+ {
+ int res = fclose(p->file);
+ if (res != 0)
+ return res;
+ p->file = NULL;
+ }
+ #endif
+ return 0;
+}
+
+WRes File_Read(CSzFile *p, void *data, size_t *size)
+{
+ size_t originalSize = *size;
+ if (originalSize == 0)
+ return 0;
+
+ #ifdef USE_WINDOWS_FILE
+
+ *size = 0;
+ do
+ {
+ DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
+ DWORD processed = 0;
+ BOOL res = ReadFile(p->handle, data, curSize, &processed, NULL);
+ data = (void *)((Byte *)data + processed);
+ originalSize -= processed;
+ *size += processed;
+ if (!res)
+ return GetLastError();
+ if (processed == 0)
+ break;
+ }
+ while (originalSize > 0);
+ return 0;
+
+ #else
+
+ *size = fread(data, 1, originalSize, p->file);
+ if (*size == originalSize)
+ return 0;
+ return ferror(p->file);
+
+ #endif
+}
+
+WRes File_Write(CSzFile *p, const void *data, size_t *size)
+{
+ size_t originalSize = *size;
+ if (originalSize == 0)
+ return 0;
+
+ #ifdef USE_WINDOWS_FILE
+
+ *size = 0;
+ do
+ {
+ DWORD curSize = (originalSize > kChunkSizeMax) ? kChunkSizeMax : (DWORD)originalSize;
+ DWORD processed = 0;
+ BOOL res = WriteFile(p->handle, data, curSize, &processed, NULL);
+ data = (void *)((Byte *)data + processed);
+ originalSize -= processed;
+ *size += processed;
+ if (!res)
+ return GetLastError();
+ if (processed == 0)
+ break;
+ }
+ while (originalSize > 0);
+ return 0;
+
+ #else
+
+ *size = fwrite(data, 1, originalSize, p->file);
+ if (*size == originalSize)
+ return 0;
+ return ferror(p->file);
+
+ #endif
+}
+
+WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin)
+{
+ #ifdef USE_WINDOWS_FILE
+
+ LARGE_INTEGER value;
+ DWORD moveMethod;
+ value.LowPart = (DWORD)*pos;
+ value.HighPart = (LONG)((UInt64)*pos >> 16 >> 16); /* for case when UInt64 is 32-bit only */
+ switch (origin)
+ {
+ case SZ_SEEK_SET: moveMethod = FILE_BEGIN; break;
+ case SZ_SEEK_CUR: moveMethod = FILE_CURRENT; break;
+ case SZ_SEEK_END: moveMethod = FILE_END; break;
+ default: return ERROR_INVALID_PARAMETER;
+ }
+ value.LowPart = SetFilePointer(p->handle, value.LowPart, &value.HighPart, moveMethod);
+ if (value.LowPart == 0xFFFFFFFF)
+ {
+ WRes res = GetLastError();
+ if (res != NO_ERROR)
+ return res;
+ }
+ *pos = ((Int64)value.HighPart << 32) | value.LowPart;
+ return 0;
+
+ #else
+
+ int moveMethod;
+ int res;
+ switch (origin)
+ {
+ case SZ_SEEK_SET: moveMethod = SEEK_SET; break;
+ case SZ_SEEK_CUR: moveMethod = SEEK_CUR; break;
+ case SZ_SEEK_END: moveMethod = SEEK_END; break;
+ default: return 1;
+ }
+ res = fseek(p->file, (long)*pos, moveMethod);
+ *pos = ftell(p->file);
+ return res;
+
+ #endif
+}
+
+WRes File_GetLength(CSzFile *p, UInt64 *length)
+{
+ #ifdef USE_WINDOWS_FILE
+
+ DWORD sizeHigh;
+ DWORD sizeLow = GetFileSize(p->handle, &sizeHigh);
+ if (sizeLow == 0xFFFFFFFF)
+ {
+ DWORD res = GetLastError();
+ if (res != NO_ERROR)
+ return res;
+ }
+ *length = (((UInt64)sizeHigh) << 32) + sizeLow;
+ return 0;
+
+ #else
+
+ long pos = ftell(p->file);
+ int res = fseek(p->file, 0, SEEK_END);
+ *length = ftell(p->file);
+ fseek(p->file, pos, SEEK_SET);
+ return res;
+
+ #endif
+}
+
+
+/* ---------- FileSeqInStream ---------- */
+
+static SRes FileSeqInStream_Read(const ISeqInStream *pp, void *buf, size_t *size)
+{
+ CFileSeqInStream *p = CONTAINER_FROM_VTBL(pp, CFileSeqInStream, vt);
+ return File_Read(&p->file, buf, size) == 0 ? SZ_OK : SZ_ERROR_READ;
+}
+
+void FileSeqInStream_CreateVTable(CFileSeqInStream *p)
+{
+ p->vt.Read = FileSeqInStream_Read;
+}
+
+
+/* ---------- FileInStream ---------- */
+
+static SRes FileInStream_Read(const ISeekInStream *pp, void *buf, size_t *size)
+{
+ CFileInStream *p = CONTAINER_FROM_VTBL(pp, CFileInStream, vt);
+ return (File_Read(&p->file, buf, size) == 0) ? SZ_OK : SZ_ERROR_READ;
+}
+
+static SRes FileInStream_Seek(const ISeekInStream *pp, Int64 *pos, ESzSeek origin)
+{
+ CFileInStream *p = CONTAINER_FROM_VTBL(pp, CFileInStream, vt);
+ return File_Seek(&p->file, pos, origin);
+}
+
+void FileInStream_CreateVTable(CFileInStream *p)
+{
+ p->vt.Read = FileInStream_Read;
+ p->vt.Seek = FileInStream_Seek;
+}
+
+
+/* ---------- FileOutStream ---------- */
+
+static size_t FileOutStream_Write(const ISeqOutStream *pp, const void *data, size_t size)
+{
+ CFileOutStream *p = CONTAINER_FROM_VTBL(pp, CFileOutStream, vt);
+ File_Write(&p->file, data, &size);
+ return size;
+}
+
+void FileOutStream_CreateVTable(CFileOutStream *p)
+{
+ p->vt.Write = FileOutStream_Write;
+}
diff --git a/other-licenses/7zstub/src/C/7zFile.h b/other-licenses/7zstub/src/C/7zFile.h
new file mode 100644
index 0000000000..7e263bea1b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zFile.h
@@ -0,0 +1,83 @@
+/* 7zFile.h -- File IO
+2017-04-03 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_FILE_H
+#define __7Z_FILE_H
+
+#ifdef _WIN32
+#define USE_WINDOWS_FILE
+#endif
+
+#ifdef USE_WINDOWS_FILE
+#include <windows.h>
+#else
+#include <stdio.h>
+#endif
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+/* ---------- File ---------- */
+
+typedef struct
+{
+ #ifdef USE_WINDOWS_FILE
+ HANDLE handle;
+ #else
+ FILE *file;
+ #endif
+} CSzFile;
+
+void File_Construct(CSzFile *p);
+#if !defined(UNDER_CE) || !defined(USE_WINDOWS_FILE)
+WRes InFile_Open(CSzFile *p, const char *name);
+WRes OutFile_Open(CSzFile *p, const char *name);
+#endif
+#ifdef USE_WINDOWS_FILE
+WRes InFile_OpenW(CSzFile *p, const WCHAR *name);
+WRes OutFile_OpenW(CSzFile *p, const WCHAR *name);
+#endif
+WRes File_Close(CSzFile *p);
+
+/* reads max(*size, remain file's size) bytes */
+WRes File_Read(CSzFile *p, void *data, size_t *size);
+
+/* writes *size bytes */
+WRes File_Write(CSzFile *p, const void *data, size_t *size);
+
+WRes File_Seek(CSzFile *p, Int64 *pos, ESzSeek origin);
+WRes File_GetLength(CSzFile *p, UInt64 *length);
+
+
+/* ---------- FileInStream ---------- */
+
+typedef struct
+{
+ ISeqInStream vt;
+ CSzFile file;
+} CFileSeqInStream;
+
+void FileSeqInStream_CreateVTable(CFileSeqInStream *p);
+
+
+typedef struct
+{
+ ISeekInStream vt;
+ CSzFile file;
+} CFileInStream;
+
+void FileInStream_CreateVTable(CFileInStream *p);
+
+
+typedef struct
+{
+ ISeqOutStream vt;
+ CSzFile file;
+} CFileOutStream;
+
+void FileOutStream_CreateVTable(CFileOutStream *p);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zStream.c b/other-licenses/7zstub/src/C/7zStream.c
new file mode 100644
index 0000000000..579741fadc
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zStream.c
@@ -0,0 +1,176 @@
+/* 7zStream.c -- 7z Stream functions
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "7zTypes.h"
+
+SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType)
+{
+ while (size != 0)
+ {
+ size_t processed = size;
+ RINOK(ISeqInStream_Read(stream, buf, &processed));
+ if (processed == 0)
+ return errorType;
+ buf = (void *)((Byte *)buf + processed);
+ size -= processed;
+ }
+ return SZ_OK;
+}
+
+SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size)
+{
+ return SeqInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
+}
+
+SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf)
+{
+ size_t processed = 1;
+ RINOK(ISeqInStream_Read(stream, buf, &processed));
+ return (processed == 1) ? SZ_OK : SZ_ERROR_INPUT_EOF;
+}
+
+
+
+SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset)
+{
+ Int64 t = offset;
+ return ILookInStream_Seek(stream, &t, SZ_SEEK_SET);
+}
+
+SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size)
+{
+ const void *lookBuf;
+ if (*size == 0)
+ return SZ_OK;
+ RINOK(ILookInStream_Look(stream, &lookBuf, size));
+ memcpy(buf, lookBuf, *size);
+ return ILookInStream_Skip(stream, *size);
+}
+
+SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType)
+{
+ while (size != 0)
+ {
+ size_t processed = size;
+ RINOK(ILookInStream_Read(stream, buf, &processed));
+ if (processed == 0)
+ return errorType;
+ buf = (void *)((Byte *)buf + processed);
+ size -= processed;
+ }
+ return SZ_OK;
+}
+
+SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size)
+{
+ return LookInStream_Read2(stream, buf, size, SZ_ERROR_INPUT_EOF);
+}
+
+
+
+#define GET_LookToRead2 CLookToRead2 *p = CONTAINER_FROM_VTBL(pp, CLookToRead2, vt);
+
+static SRes LookToRead2_Look_Lookahead(const ILookInStream *pp, const void **buf, size_t *size)
+{
+ SRes res = SZ_OK;
+ GET_LookToRead2
+ size_t size2 = p->size - p->pos;
+ if (size2 == 0 && *size != 0)
+ {
+ p->pos = 0;
+ p->size = 0;
+ size2 = p->bufSize;
+ res = ISeekInStream_Read(p->realStream, p->buf, &size2);
+ p->size = size2;
+ }
+ if (*size > size2)
+ *size = size2;
+ *buf = p->buf + p->pos;
+ return res;
+}
+
+static SRes LookToRead2_Look_Exact(const ILookInStream *pp, const void **buf, size_t *size)
+{
+ SRes res = SZ_OK;
+ GET_LookToRead2
+ size_t size2 = p->size - p->pos;
+ if (size2 == 0 && *size != 0)
+ {
+ p->pos = 0;
+ p->size = 0;
+ if (*size > p->bufSize)
+ *size = p->bufSize;
+ res = ISeekInStream_Read(p->realStream, p->buf, size);
+ size2 = p->size = *size;
+ }
+ if (*size > size2)
+ *size = size2;
+ *buf = p->buf + p->pos;
+ return res;
+}
+
+static SRes LookToRead2_Skip(const ILookInStream *pp, size_t offset)
+{
+ GET_LookToRead2
+ p->pos += offset;
+ return SZ_OK;
+}
+
+static SRes LookToRead2_Read(const ILookInStream *pp, void *buf, size_t *size)
+{
+ GET_LookToRead2
+ size_t rem = p->size - p->pos;
+ if (rem == 0)
+ return ISeekInStream_Read(p->realStream, buf, size);
+ if (rem > *size)
+ rem = *size;
+ memcpy(buf, p->buf + p->pos, rem);
+ p->pos += rem;
+ *size = rem;
+ return SZ_OK;
+}
+
+static SRes LookToRead2_Seek(const ILookInStream *pp, Int64 *pos, ESzSeek origin)
+{
+ GET_LookToRead2
+ p->pos = p->size = 0;
+ return ISeekInStream_Seek(p->realStream, pos, origin);
+}
+
+void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead)
+{
+ p->vt.Look = lookahead ?
+ LookToRead2_Look_Lookahead :
+ LookToRead2_Look_Exact;
+ p->vt.Skip = LookToRead2_Skip;
+ p->vt.Read = LookToRead2_Read;
+ p->vt.Seek = LookToRead2_Seek;
+}
+
+
+
+static SRes SecToLook_Read(const ISeqInStream *pp, void *buf, size_t *size)
+{
+ CSecToLook *p = CONTAINER_FROM_VTBL(pp, CSecToLook, vt);
+ return LookInStream_LookRead(p->realStream, buf, size);
+}
+
+void SecToLook_CreateVTable(CSecToLook *p)
+{
+ p->vt.Read = SecToLook_Read;
+}
+
+static SRes SecToRead_Read(const ISeqInStream *pp, void *buf, size_t *size)
+{
+ CSecToRead *p = CONTAINER_FROM_VTBL(pp, CSecToRead, vt);
+ return ILookInStream_Read(p->realStream, buf, size);
+}
+
+void SecToRead_CreateVTable(CSecToRead *p)
+{
+ p->vt.Read = SecToRead_Read;
+}
diff --git a/other-licenses/7zstub/src/C/7zTypes.h b/other-licenses/7zstub/src/C/7zTypes.h
new file mode 100644
index 0000000000..4977cdaa66
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zTypes.h
@@ -0,0 +1,374 @@
+/* 7zTypes.h -- Basic types
+2017-07-17 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_TYPES_H
+#define __7Z_TYPES_H
+
+#ifdef _WIN32
+/* #include <windows.h> */
+#endif
+
+#include <stddef.h>
+
+#ifndef EXTERN_C_BEGIN
+#ifdef __cplusplus
+#define EXTERN_C_BEGIN extern "C" {
+#define EXTERN_C_END }
+#else
+#define EXTERN_C_BEGIN
+#define EXTERN_C_END
+#endif
+#endif
+
+EXTERN_C_BEGIN
+
+#define SZ_OK 0
+
+#define SZ_ERROR_DATA 1
+#define SZ_ERROR_MEM 2
+#define SZ_ERROR_CRC 3
+#define SZ_ERROR_UNSUPPORTED 4
+#define SZ_ERROR_PARAM 5
+#define SZ_ERROR_INPUT_EOF 6
+#define SZ_ERROR_OUTPUT_EOF 7
+#define SZ_ERROR_READ 8
+#define SZ_ERROR_WRITE 9
+#define SZ_ERROR_PROGRESS 10
+#define SZ_ERROR_FAIL 11
+#define SZ_ERROR_THREAD 12
+
+#define SZ_ERROR_ARCHIVE 16
+#define SZ_ERROR_NO_ARCHIVE 17
+
+typedef int SRes;
+
+
+#ifdef _WIN32
+
+/* typedef DWORD WRes; */
+typedef unsigned WRes;
+#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x)
+
+#else
+
+typedef int WRes;
+#define MY__FACILITY_WIN32 7
+#define MY__FACILITY__WRes MY__FACILITY_WIN32
+#define MY_SRes_HRESULT_FROM_WRes(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (MY__FACILITY__WRes << 16) | 0x80000000)))
+
+#endif
+
+
+#ifndef RINOK
+#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
+#endif
+
+typedef unsigned char Byte;
+typedef short Int16;
+typedef unsigned short UInt16;
+
+#ifdef _LZMA_UINT32_IS_ULONG
+typedef long Int32;
+typedef unsigned long UInt32;
+#else
+typedef int Int32;
+typedef unsigned int UInt32;
+#endif
+
+#ifdef _SZ_NO_INT_64
+
+/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
+ NOTES: Some code will work incorrectly in that case! */
+
+typedef long Int64;
+typedef unsigned long UInt64;
+
+#else
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+typedef __int64 Int64;
+typedef unsigned __int64 UInt64;
+#define UINT64_CONST(n) n
+#else
+typedef long long int Int64;
+typedef unsigned long long int UInt64;
+#define UINT64_CONST(n) n ## ULL
+#endif
+
+#endif
+
+#ifdef _LZMA_NO_SYSTEM_SIZE_T
+typedef UInt32 SizeT;
+#else
+typedef size_t SizeT;
+#endif
+
+typedef int Bool;
+#define True 1
+#define False 0
+
+
+#ifdef _WIN32
+#define MY_STD_CALL __stdcall
+#else
+#define MY_STD_CALL
+#endif
+
+#ifdef _MSC_VER
+
+#if _MSC_VER >= 1300
+#define MY_NO_INLINE __declspec(noinline)
+#else
+#define MY_NO_INLINE
+#endif
+
+#define MY_FORCE_INLINE __forceinline
+
+#define MY_CDECL __cdecl
+#define MY_FAST_CALL __fastcall
+
+#else
+
+#define MY_NO_INLINE
+#define MY_FORCE_INLINE
+#define MY_CDECL
+#define MY_FAST_CALL
+
+/* inline keyword : for C++ / C99 */
+
+/* GCC, clang: */
+/*
+#if defined (__GNUC__) && (__GNUC__ >= 4)
+#define MY_FORCE_INLINE __attribute__((always_inline))
+#define MY_NO_INLINE __attribute__((noinline))
+#endif
+*/
+
+#endif
+
+
+/* The following interfaces use first parameter as pointer to structure */
+
+typedef struct IByteIn IByteIn;
+struct IByteIn
+{
+ Byte (*Read)(const IByteIn *p); /* reads one byte, returns 0 in case of EOF or error */
+};
+#define IByteIn_Read(p) (p)->Read(p)
+
+
+typedef struct IByteOut IByteOut;
+struct IByteOut
+{
+ void (*Write)(const IByteOut *p, Byte b);
+};
+#define IByteOut_Write(p, b) (p)->Write(p, b)
+
+
+typedef struct ISeqInStream ISeqInStream;
+struct ISeqInStream
+{
+ SRes (*Read)(const ISeqInStream *p, void *buf, size_t *size);
+ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
+ (output(*size) < input(*size)) is allowed */
+};
+#define ISeqInStream_Read(p, buf, size) (p)->Read(p, buf, size)
+
+/* it can return SZ_ERROR_INPUT_EOF */
+SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size);
+SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType);
+SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf);
+
+
+typedef struct ISeqOutStream ISeqOutStream;
+struct ISeqOutStream
+{
+ size_t (*Write)(const ISeqOutStream *p, const void *buf, size_t size);
+ /* Returns: result - the number of actually written bytes.
+ (result < size) means error */
+};
+#define ISeqOutStream_Write(p, buf, size) (p)->Write(p, buf, size)
+
+typedef enum
+{
+ SZ_SEEK_SET = 0,
+ SZ_SEEK_CUR = 1,
+ SZ_SEEK_END = 2
+} ESzSeek;
+
+
+typedef struct ISeekInStream ISeekInStream;
+struct ISeekInStream
+{
+ SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
+ SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin);
+};
+#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
+#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
+
+
+typedef struct ILookInStream ILookInStream;
+struct ILookInStream
+{
+ SRes (*Look)(const ILookInStream *p, const void **buf, size_t *size);
+ /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
+ (output(*size) > input(*size)) is not allowed
+ (output(*size) < input(*size)) is allowed */
+ SRes (*Skip)(const ILookInStream *p, size_t offset);
+ /* offset must be <= output(*size) of Look */
+
+ SRes (*Read)(const ILookInStream *p, void *buf, size_t *size);
+ /* reads directly (without buffer). It's same as ISeqInStream::Read */
+ SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin);
+};
+
+#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
+#define ILookInStream_Skip(p, offset) (p)->Skip(p, offset)
+#define ILookInStream_Read(p, buf, size) (p)->Read(p, buf, size)
+#define ILookInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
+
+
+SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size);
+SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset);
+
+/* reads via ILookInStream::Read */
+SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType);
+SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size);
+
+
+
+typedef struct
+{
+ ILookInStream vt;
+ const ISeekInStream *realStream;
+
+ size_t pos;
+ size_t size; /* it's data size */
+
+ /* the following variables must be set outside */
+ Byte *buf;
+ size_t bufSize;
+} CLookToRead2;
+
+void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead);
+
+#define LookToRead2_Init(p) { (p)->pos = (p)->size = 0; }
+
+
+typedef struct
+{
+ ISeqInStream vt;
+ const ILookInStream *realStream;
+} CSecToLook;
+
+void SecToLook_CreateVTable(CSecToLook *p);
+
+
+
+typedef struct
+{
+ ISeqInStream vt;
+ const ILookInStream *realStream;
+} CSecToRead;
+
+void SecToRead_CreateVTable(CSecToRead *p);
+
+
+typedef struct ICompressProgress ICompressProgress;
+
+struct ICompressProgress
+{
+ SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize);
+ /* Returns: result. (result != SZ_OK) means break.
+ Value (UInt64)(Int64)-1 for size means unknown value. */
+};
+#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
+
+
+
+typedef struct ISzAlloc ISzAlloc;
+typedef const ISzAlloc * ISzAllocPtr;
+
+struct ISzAlloc
+{
+ void *(*Alloc)(ISzAllocPtr p, size_t size);
+ void (*Free)(ISzAllocPtr p, void *address); /* address can be 0 */
+};
+
+#define ISzAlloc_Alloc(p, size) (p)->Alloc(p, size)
+#define ISzAlloc_Free(p, a) (p)->Free(p, a)
+
+/* deprecated */
+#define IAlloc_Alloc(p, size) ISzAlloc_Alloc(p, size)
+#define IAlloc_Free(p, a) ISzAlloc_Free(p, a)
+
+
+
+
+
+#ifndef MY_offsetof
+ #ifdef offsetof
+ #define MY_offsetof(type, m) offsetof(type, m)
+ /*
+ #define MY_offsetof(type, m) FIELD_OFFSET(type, m)
+ */
+ #else
+ #define MY_offsetof(type, m) ((size_t)&(((type *)0)->m))
+ #endif
+#endif
+
+
+
+#ifndef MY_container_of
+
+/*
+#define MY_container_of(ptr, type, m) container_of(ptr, type, m)
+#define MY_container_of(ptr, type, m) CONTAINING_RECORD(ptr, type, m)
+#define MY_container_of(ptr, type, m) ((type *)((char *)(ptr) - offsetof(type, m)))
+#define MY_container_of(ptr, type, m) (&((type *)0)->m == (ptr), ((type *)(((char *)(ptr)) - MY_offsetof(type, m))))
+*/
+
+/*
+ GCC shows warning: "perhaps the 'offsetof' macro was used incorrectly"
+ GCC 3.4.4 : classes with constructor
+ GCC 4.8.1 : classes with non-public variable members"
+*/
+
+#define MY_container_of(ptr, type, m) ((type *)((char *)(1 ? (ptr) : &((type *)0)->m) - MY_offsetof(type, m)))
+
+
+#endif
+
+#define CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) ((type *)(ptr))
+
+/*
+#define CONTAINER_FROM_VTBL(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
+*/
+#define CONTAINER_FROM_VTBL(ptr, type, m) MY_container_of(ptr, type, m)
+
+#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
+/*
+#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL(ptr, type, m)
+*/
+
+
+
+#ifdef _WIN32
+
+#define CHAR_PATH_SEPARATOR '\\'
+#define WCHAR_PATH_SEPARATOR L'\\'
+#define STRING_PATH_SEPARATOR "\\"
+#define WSTRING_PATH_SEPARATOR L"\\"
+
+#else
+
+#define CHAR_PATH_SEPARATOR '/'
+#define WCHAR_PATH_SEPARATOR L'/'
+#define STRING_PATH_SEPARATOR "/"
+#define WSTRING_PATH_SEPARATOR L"/"
+
+#endif
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/7zVersion.h b/other-licenses/7zstub/src/C/7zVersion.h
new file mode 100644
index 0000000000..ed3aa94270
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zVersion.h
@@ -0,0 +1,27 @@
+#define MY_VER_MAJOR 18
+#define MY_VER_MINOR 05
+#define MY_VER_BUILD 0
+#define MY_VERSION_NUMBERS "18.05"
+#define MY_VERSION MY_VERSION_NUMBERS
+
+#ifdef MY_CPU_NAME
+ #define MY_VERSION_CPU MY_VERSION " (" MY_CPU_NAME ")"
+#else
+ #define MY_VERSION_CPU MY_VERSION
+#endif
+
+#define MY_DATE "2018-04-30"
+#undef MY_COPYRIGHT
+#undef MY_VERSION_COPYRIGHT_DATE
+#define MY_AUTHOR_NAME "Igor Pavlov"
+#define MY_COPYRIGHT_PD "Igor Pavlov : Public domain"
+#define MY_COPYRIGHT_CR "Copyright (c) 1999-2018 Igor Pavlov"
+
+#ifdef USE_COPYRIGHT_CR
+ #define MY_COPYRIGHT MY_COPYRIGHT_CR
+#else
+ #define MY_COPYRIGHT MY_COPYRIGHT_PD
+#endif
+
+#define MY_COPYRIGHT_DATE MY_COPYRIGHT " : " MY_DATE
+#define MY_VERSION_COPYRIGHT_DATE MY_VERSION_CPU " : " MY_COPYRIGHT " : " MY_DATE
diff --git a/other-licenses/7zstub/src/C/7zVersion.rc b/other-licenses/7zstub/src/C/7zVersion.rc
new file mode 100644
index 0000000000..6ed26de744
--- /dev/null
+++ b/other-licenses/7zstub/src/C/7zVersion.rc
@@ -0,0 +1,55 @@
+#define MY_VS_FFI_FILEFLAGSMASK 0x0000003FL
+#define MY_VOS_NT_WINDOWS32 0x00040004L
+#define MY_VOS_CE_WINDOWS32 0x00050004L
+
+#define MY_VFT_APP 0x00000001L
+#define MY_VFT_DLL 0x00000002L
+
+// #include <WinVer.h>
+
+#ifndef MY_VERSION
+#include "7zVersion.h"
+#endif
+
+#define MY_VER MY_VER_MAJOR,MY_VER_MINOR,MY_VER_BUILD,0
+
+#ifdef DEBUG
+#define DBG_FL VS_FF_DEBUG
+#else
+#define DBG_FL 0
+#endif
+
+#define MY_VERSION_INFO(fileType, descr, intName, origName) \
+LANGUAGE 9, 1 \
+1 VERSIONINFO \
+ FILEVERSION MY_VER \
+ PRODUCTVERSION MY_VER \
+ FILEFLAGSMASK MY_VS_FFI_FILEFLAGSMASK \
+ FILEFLAGS DBG_FL \
+ FILEOS MY_VOS_NT_WINDOWS32 \
+ FILETYPE fileType \
+ FILESUBTYPE 0x0L \
+BEGIN \
+ BLOCK "StringFileInfo" \
+ BEGIN \
+ BLOCK "040904b0" \
+ BEGIN \
+ VALUE "CompanyName", "Igor Pavlov" \
+ VALUE "FileDescription", descr \
+ VALUE "FileVersion", MY_VERSION \
+ VALUE "InternalName", intName \
+ VALUE "LegalCopyright", MY_COPYRIGHT \
+ VALUE "OriginalFilename", origName \
+ VALUE "ProductName", "7-Zip" \
+ VALUE "ProductVersion", MY_VERSION \
+ END \
+ END \
+ BLOCK "VarFileInfo" \
+ BEGIN \
+ VALUE "Translation", 0x409, 1200 \
+ END \
+END
+
+#define MY_VERSION_INFO_APP(descr, intName) MY_VERSION_INFO(MY_VFT_APP, descr, intName, intName ".exe")
+
+#define MY_VERSION_INFO_DLL(descr, intName) MY_VERSION_INFO(MY_VFT_DLL, descr, intName, intName ".dll")
diff --git a/other-licenses/7zstub/src/C/Aes.c b/other-licenses/7zstub/src/C/Aes.c
new file mode 100644
index 0000000000..8f7d50ea24
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Aes.c
@@ -0,0 +1,306 @@
+/* Aes.c -- AES encryption / decryption
+2017-01-24 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "Aes.h"
+#include "CpuArch.h"
+
+static UInt32 T[256 * 4];
+static const Byte Sbox[256] = {
+ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
+ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
+ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
+ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
+ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
+ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
+ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
+ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
+ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
+ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
+ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
+ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
+ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
+ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
+ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16};
+
+void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks);
+
+void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
+
+AES_CODE_FUNC g_AesCbc_Encode;
+AES_CODE_FUNC g_AesCbc_Decode;
+AES_CODE_FUNC g_AesCtr_Code;
+
+static UInt32 D[256 * 4];
+static Byte InvS[256];
+
+static const Byte Rcon[11] = { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36 };
+
+#define xtime(x) ((((x) << 1) ^ (((x) & 0x80) != 0 ? 0x1B : 0)) & 0xFF)
+
+#define Ui32(a0, a1, a2, a3) ((UInt32)(a0) | ((UInt32)(a1) << 8) | ((UInt32)(a2) << 16) | ((UInt32)(a3) << 24))
+
+#define gb0(x) ( (x) & 0xFF)
+#define gb1(x) (((x) >> ( 8)) & 0xFF)
+#define gb2(x) (((x) >> (16)) & 0xFF)
+#define gb3(x) (((x) >> (24)))
+
+#define gb(n, x) gb ## n(x)
+
+#define TT(x) (T + (x << 8))
+#define DD(x) (D + (x << 8))
+
+
+void AesGenTables(void)
+{
+ unsigned i;
+ for (i = 0; i < 256; i++)
+ InvS[Sbox[i]] = (Byte)i;
+
+ for (i = 0; i < 256; i++)
+ {
+ {
+ UInt32 a1 = Sbox[i];
+ UInt32 a2 = xtime(a1);
+ UInt32 a3 = a2 ^ a1;
+ TT(0)[i] = Ui32(a2, a1, a1, a3);
+ TT(1)[i] = Ui32(a3, a2, a1, a1);
+ TT(2)[i] = Ui32(a1, a3, a2, a1);
+ TT(3)[i] = Ui32(a1, a1, a3, a2);
+ }
+ {
+ UInt32 a1 = InvS[i];
+ UInt32 a2 = xtime(a1);
+ UInt32 a4 = xtime(a2);
+ UInt32 a8 = xtime(a4);
+ UInt32 a9 = a8 ^ a1;
+ UInt32 aB = a8 ^ a2 ^ a1;
+ UInt32 aD = a8 ^ a4 ^ a1;
+ UInt32 aE = a8 ^ a4 ^ a2;
+ DD(0)[i] = Ui32(aE, a9, aD, aB);
+ DD(1)[i] = Ui32(aB, aE, a9, aD);
+ DD(2)[i] = Ui32(aD, aB, aE, a9);
+ DD(3)[i] = Ui32(a9, aD, aB, aE);
+ }
+ }
+
+ g_AesCbc_Encode = AesCbc_Encode;
+ g_AesCbc_Decode = AesCbc_Decode;
+ g_AesCtr_Code = AesCtr_Code;
+
+ #ifdef MY_CPU_X86_OR_AMD64
+ if (CPU_Is_Aes_Supported())
+ {
+ g_AesCbc_Encode = AesCbc_Encode_Intel;
+ g_AesCbc_Decode = AesCbc_Decode_Intel;
+ g_AesCtr_Code = AesCtr_Code_Intel;
+ }
+ #endif
+}
+
+
+#define HT(i, x, s) TT(x)[gb(x, s[(i + x) & 3])]
+
+#define HT4(m, i, s, p) m[i] = \
+ HT(i, 0, s) ^ \
+ HT(i, 1, s) ^ \
+ HT(i, 2, s) ^ \
+ HT(i, 3, s) ^ w[p + i]
+
+#define HT16(m, s, p) \
+ HT4(m, 0, s, p); \
+ HT4(m, 1, s, p); \
+ HT4(m, 2, s, p); \
+ HT4(m, 3, s, p); \
+
+#define FT(i, x) Sbox[gb(x, m[(i + x) & 3])]
+#define FT4(i) dest[i] = Ui32(FT(i, 0), FT(i, 1), FT(i, 2), FT(i, 3)) ^ w[i];
+
+
+#define HD(i, x, s) DD(x)[gb(x, s[(i - x) & 3])]
+
+#define HD4(m, i, s, p) m[i] = \
+ HD(i, 0, s) ^ \
+ HD(i, 1, s) ^ \
+ HD(i, 2, s) ^ \
+ HD(i, 3, s) ^ w[p + i];
+
+#define HD16(m, s, p) \
+ HD4(m, 0, s, p); \
+ HD4(m, 1, s, p); \
+ HD4(m, 2, s, p); \
+ HD4(m, 3, s, p); \
+
+#define FD(i, x) InvS[gb(x, m[(i - x) & 3])]
+#define FD4(i) dest[i] = Ui32(FD(i, 0), FD(i, 1), FD(i, 2), FD(i, 3)) ^ w[i];
+
+void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *w, const Byte *key, unsigned keySize)
+{
+ unsigned i, wSize;
+ wSize = keySize + 28;
+ keySize /= 4;
+ w[0] = ((UInt32)keySize / 2) + 3;
+ w += 4;
+
+ for (i = 0; i < keySize; i++, key += 4)
+ w[i] = GetUi32(key);
+
+ for (; i < wSize; i++)
+ {
+ UInt32 t = w[(size_t)i - 1];
+ unsigned rem = i % keySize;
+ if (rem == 0)
+ t = Ui32(Sbox[gb1(t)] ^ Rcon[i / keySize], Sbox[gb2(t)], Sbox[gb3(t)], Sbox[gb0(t)]);
+ else if (keySize > 6 && rem == 4)
+ t = Ui32(Sbox[gb0(t)], Sbox[gb1(t)], Sbox[gb2(t)], Sbox[gb3(t)]);
+ w[i] = w[i - keySize] ^ t;
+ }
+}
+
+void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *w, const Byte *key, unsigned keySize)
+{
+ unsigned i, num;
+ Aes_SetKey_Enc(w, key, keySize);
+ num = keySize + 20;
+ w += 8;
+ for (i = 0; i < num; i++)
+ {
+ UInt32 r = w[i];
+ w[i] =
+ DD(0)[Sbox[gb0(r)]] ^
+ DD(1)[Sbox[gb1(r)]] ^
+ DD(2)[Sbox[gb2(r)]] ^
+ DD(3)[Sbox[gb3(r)]];
+ }
+}
+
+/* Aes_Encode and Aes_Decode functions work with little-endian words.
+ src and dest are pointers to 4 UInt32 words.
+ src and dest can point to same block */
+
+static void Aes_Encode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
+{
+ UInt32 s[4];
+ UInt32 m[4];
+ UInt32 numRounds2 = w[0];
+ w += 4;
+ s[0] = src[0] ^ w[0];
+ s[1] = src[1] ^ w[1];
+ s[2] = src[2] ^ w[2];
+ s[3] = src[3] ^ w[3];
+ w += 4;
+ for (;;)
+ {
+ HT16(m, s, 0);
+ if (--numRounds2 == 0)
+ break;
+ HT16(s, m, 4);
+ w += 8;
+ }
+ w += 4;
+ FT4(0); FT4(1); FT4(2); FT4(3);
+}
+
+static void Aes_Decode(const UInt32 *w, UInt32 *dest, const UInt32 *src)
+{
+ UInt32 s[4];
+ UInt32 m[4];
+ UInt32 numRounds2 = w[0];
+ w += 4 + numRounds2 * 8;
+ s[0] = src[0] ^ w[0];
+ s[1] = src[1] ^ w[1];
+ s[2] = src[2] ^ w[2];
+ s[3] = src[3] ^ w[3];
+ for (;;)
+ {
+ w -= 8;
+ HD16(m, s, 4);
+ if (--numRounds2 == 0)
+ break;
+ HD16(s, m, 0);
+ }
+ FD4(0); FD4(1); FD4(2); FD4(3);
+}
+
+void AesCbc_Init(UInt32 *p, const Byte *iv)
+{
+ unsigned i;
+ for (i = 0; i < 4; i++)
+ p[i] = GetUi32(iv + i * 4);
+}
+
+void MY_FAST_CALL AesCbc_Encode(UInt32 *p, Byte *data, size_t numBlocks)
+{
+ for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
+ {
+ p[0] ^= GetUi32(data);
+ p[1] ^= GetUi32(data + 4);
+ p[2] ^= GetUi32(data + 8);
+ p[3] ^= GetUi32(data + 12);
+
+ Aes_Encode(p + 4, p, p);
+
+ SetUi32(data, p[0]);
+ SetUi32(data + 4, p[1]);
+ SetUi32(data + 8, p[2]);
+ SetUi32(data + 12, p[3]);
+ }
+}
+
+void MY_FAST_CALL AesCbc_Decode(UInt32 *p, Byte *data, size_t numBlocks)
+{
+ UInt32 in[4], out[4];
+ for (; numBlocks != 0; numBlocks--, data += AES_BLOCK_SIZE)
+ {
+ in[0] = GetUi32(data);
+ in[1] = GetUi32(data + 4);
+ in[2] = GetUi32(data + 8);
+ in[3] = GetUi32(data + 12);
+
+ Aes_Decode(p + 4, out, in);
+
+ SetUi32(data, p[0] ^ out[0]);
+ SetUi32(data + 4, p[1] ^ out[1]);
+ SetUi32(data + 8, p[2] ^ out[2]);
+ SetUi32(data + 12, p[3] ^ out[3]);
+
+ p[0] = in[0];
+ p[1] = in[1];
+ p[2] = in[2];
+ p[3] = in[3];
+ }
+}
+
+void MY_FAST_CALL AesCtr_Code(UInt32 *p, Byte *data, size_t numBlocks)
+{
+ for (; numBlocks != 0; numBlocks--)
+ {
+ UInt32 temp[4];
+ unsigned i;
+
+ if (++p[0] == 0)
+ p[1]++;
+
+ Aes_Encode(p + 4, temp, p);
+
+ for (i = 0; i < 4; i++, data += 4)
+ {
+ UInt32 t = temp[i];
+
+ #ifdef MY_CPU_LE_UNALIGN
+ *((UInt32 *)data) ^= t;
+ #else
+ data[0] ^= (t & 0xFF);
+ data[1] ^= ((t >> 8) & 0xFF);
+ data[2] ^= ((t >> 16) & 0xFF);
+ data[3] ^= ((t >> 24));
+ #endif
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/C/Aes.h b/other-licenses/7zstub/src/C/Aes.h
new file mode 100644
index 0000000000..381e979d1b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Aes.h
@@ -0,0 +1,38 @@
+/* Aes.h -- AES encryption / decryption
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __AES_H
+#define __AES_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define AES_BLOCK_SIZE 16
+
+/* Call AesGenTables one time before other AES functions */
+void AesGenTables(void);
+
+/* UInt32 pointers must be 16-byte aligned */
+
+/* 16-byte (4 * 32-bit words) blocks: 1 (IV) + 1 (keyMode) + 15 (AES-256 roundKeys) */
+#define AES_NUM_IVMRK_WORDS ((1 + 1 + 15) * 4)
+
+/* aes - 16-byte aligned pointer to keyMode+roundKeys sequence */
+/* keySize = 16 or 24 or 32 (bytes) */
+typedef void (MY_FAST_CALL *AES_SET_KEY_FUNC)(UInt32 *aes, const Byte *key, unsigned keySize);
+void MY_FAST_CALL Aes_SetKey_Enc(UInt32 *aes, const Byte *key, unsigned keySize);
+void MY_FAST_CALL Aes_SetKey_Dec(UInt32 *aes, const Byte *key, unsigned keySize);
+
+/* ivAes - 16-byte aligned pointer to iv+keyMode+roundKeys sequence: UInt32[AES_NUM_IVMRK_WORDS] */
+void AesCbc_Init(UInt32 *ivAes, const Byte *iv); /* iv size is AES_BLOCK_SIZE */
+/* data - 16-byte aligned pointer to data */
+/* numBlocks - the number of 16-byte blocks in data array */
+typedef void (MY_FAST_CALL *AES_CODE_FUNC)(UInt32 *ivAes, Byte *data, size_t numBlocks);
+extern AES_CODE_FUNC g_AesCbc_Encode;
+extern AES_CODE_FUNC g_AesCbc_Decode;
+extern AES_CODE_FUNC g_AesCtr_Code;
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/AesOpt.c b/other-licenses/7zstub/src/C/AesOpt.c
new file mode 100644
index 0000000000..0e7f49a1b0
--- /dev/null
+++ b/other-licenses/7zstub/src/C/AesOpt.c
@@ -0,0 +1,184 @@
+/* AesOpt.c -- Intel's AES
+2017-06-08 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+
+#ifdef MY_CPU_X86_OR_AMD64
+#if (_MSC_VER > 1500) || (_MSC_FULL_VER >= 150030729)
+#define USE_INTEL_AES
+#endif
+#endif
+
+#ifdef USE_INTEL_AES
+
+#include <wmmintrin.h>
+
+void MY_FAST_CALL AesCbc_Encode_Intel(__m128i *p, __m128i *data, size_t numBlocks)
+{
+ __m128i m = *p;
+ for (; numBlocks != 0; numBlocks--, data++)
+ {
+ UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
+ const __m128i *w = p + 3;
+ m = _mm_xor_si128(m, *data);
+ m = _mm_xor_si128(m, p[2]);
+ do
+ {
+ m = _mm_aesenc_si128(m, w[0]);
+ m = _mm_aesenc_si128(m, w[1]);
+ w += 2;
+ }
+ while (--numRounds2 != 0);
+ m = _mm_aesenc_si128(m, w[0]);
+ m = _mm_aesenclast_si128(m, w[1]);
+ *data = m;
+ }
+ *p = m;
+}
+
+#define NUM_WAYS 3
+
+#define AES_OP_W(op, n) { \
+ const __m128i t = w[n]; \
+ m0 = op(m0, t); \
+ m1 = op(m1, t); \
+ m2 = op(m2, t); \
+ }
+
+#define AES_DEC(n) AES_OP_W(_mm_aesdec_si128, n)
+#define AES_DEC_LAST(n) AES_OP_W(_mm_aesdeclast_si128, n)
+#define AES_ENC(n) AES_OP_W(_mm_aesenc_si128, n)
+#define AES_ENC_LAST(n) AES_OP_W(_mm_aesenclast_si128, n)
+
+void MY_FAST_CALL AesCbc_Decode_Intel(__m128i *p, __m128i *data, size_t numBlocks)
+{
+ __m128i iv = *p;
+ for (; numBlocks >= NUM_WAYS; numBlocks -= NUM_WAYS, data += NUM_WAYS)
+ {
+ UInt32 numRounds2 = *(const UInt32 *)(p + 1);
+ const __m128i *w = p + numRounds2 * 2;
+ __m128i m0, m1, m2;
+ {
+ const __m128i t = w[2];
+ m0 = _mm_xor_si128(t, data[0]);
+ m1 = _mm_xor_si128(t, data[1]);
+ m2 = _mm_xor_si128(t, data[2]);
+ }
+ numRounds2--;
+ do
+ {
+ AES_DEC(1)
+ AES_DEC(0)
+ w -= 2;
+ }
+ while (--numRounds2 != 0);
+ AES_DEC(1)
+ AES_DEC_LAST(0)
+
+ {
+ __m128i t;
+ t = _mm_xor_si128(m0, iv); iv = data[0]; data[0] = t;
+ t = _mm_xor_si128(m1, iv); iv = data[1]; data[1] = t;
+ t = _mm_xor_si128(m2, iv); iv = data[2]; data[2] = t;
+ }
+ }
+ for (; numBlocks != 0; numBlocks--, data++)
+ {
+ UInt32 numRounds2 = *(const UInt32 *)(p + 1);
+ const __m128i *w = p + numRounds2 * 2;
+ __m128i m = _mm_xor_si128(w[2], *data);
+ numRounds2--;
+ do
+ {
+ m = _mm_aesdec_si128(m, w[1]);
+ m = _mm_aesdec_si128(m, w[0]);
+ w -= 2;
+ }
+ while (--numRounds2 != 0);
+ m = _mm_aesdec_si128(m, w[1]);
+ m = _mm_aesdeclast_si128(m, w[0]);
+
+ m = _mm_xor_si128(m, iv);
+ iv = *data;
+ *data = m;
+ }
+ *p = iv;
+}
+
+void MY_FAST_CALL AesCtr_Code_Intel(__m128i *p, __m128i *data, size_t numBlocks)
+{
+ __m128i ctr = *p;
+ __m128i one;
+ one.m128i_u64[0] = 1;
+ one.m128i_u64[1] = 0;
+ for (; numBlocks >= NUM_WAYS; numBlocks -= NUM_WAYS, data += NUM_WAYS)
+ {
+ UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
+ const __m128i *w = p;
+ __m128i m0, m1, m2;
+ {
+ const __m128i t = w[2];
+ ctr = _mm_add_epi64(ctr, one); m0 = _mm_xor_si128(ctr, t);
+ ctr = _mm_add_epi64(ctr, one); m1 = _mm_xor_si128(ctr, t);
+ ctr = _mm_add_epi64(ctr, one); m2 = _mm_xor_si128(ctr, t);
+ }
+ w += 3;
+ do
+ {
+ AES_ENC(0)
+ AES_ENC(1)
+ w += 2;
+ }
+ while (--numRounds2 != 0);
+ AES_ENC(0)
+ AES_ENC_LAST(1)
+ data[0] = _mm_xor_si128(data[0], m0);
+ data[1] = _mm_xor_si128(data[1], m1);
+ data[2] = _mm_xor_si128(data[2], m2);
+ }
+ for (; numBlocks != 0; numBlocks--, data++)
+ {
+ UInt32 numRounds2 = *(const UInt32 *)(p + 1) - 1;
+ const __m128i *w = p;
+ __m128i m;
+ ctr = _mm_add_epi64(ctr, one);
+ m = _mm_xor_si128(ctr, p[2]);
+ w += 3;
+ do
+ {
+ m = _mm_aesenc_si128(m, w[0]);
+ m = _mm_aesenc_si128(m, w[1]);
+ w += 2;
+ }
+ while (--numRounds2 != 0);
+ m = _mm_aesenc_si128(m, w[0]);
+ m = _mm_aesenclast_si128(m, w[1]);
+ *data = _mm_xor_si128(*data, m);
+ }
+ *p = ctr;
+}
+
+#else
+
+void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks);
+
+void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *p, Byte *data, size_t numBlocks)
+{
+ AesCbc_Encode(p, data, numBlocks);
+}
+
+void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *p, Byte *data, size_t numBlocks)
+{
+ AesCbc_Decode(p, data, numBlocks);
+}
+
+void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *p, Byte *data, size_t numBlocks)
+{
+ AesCtr_Code(p, data, numBlocks);
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Alloc.c b/other-licenses/7zstub/src/C/Alloc.c
new file mode 100644
index 0000000000..30b499e5ff
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Alloc.c
@@ -0,0 +1,455 @@
+/* Alloc.c -- Memory allocation functions
+2018-04-27 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <stdio.h>
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+#include <stdlib.h>
+
+#include "Alloc.h"
+
+/* #define _SZ_ALLOC_DEBUG */
+
+/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
+#ifdef _SZ_ALLOC_DEBUG
+
+#include <stdio.h>
+int g_allocCount = 0;
+int g_allocCountMid = 0;
+int g_allocCountBig = 0;
+
+
+#define CONVERT_INT_TO_STR(charType, tempSize) \
+ unsigned char temp[tempSize]; unsigned i = 0; \
+ while (val >= 10) { temp[i++] = (unsigned char)('0' + (unsigned)(val % 10)); val /= 10; } \
+ *s++ = (charType)('0' + (unsigned)val); \
+ while (i != 0) { i--; *s++ = temp[i]; } \
+ *s = 0;
+
+static void ConvertUInt64ToString(UInt64 val, char *s)
+{
+ CONVERT_INT_TO_STR(char, 24);
+}
+
+#define GET_HEX_CHAR(t) ((char)(((t < 10) ? ('0' + t) : ('A' + (t - 10)))))
+
+static void ConvertUInt64ToHex(UInt64 val, char *s)
+{
+ UInt64 v = val;
+ unsigned i;
+ for (i = 1;; i++)
+ {
+ v >>= 4;
+ if (v == 0)
+ break;
+ }
+ s[i] = 0;
+ do
+ {
+ unsigned t = (unsigned)(val & 0xF);
+ val >>= 4;
+ s[--i] = GET_HEX_CHAR(t);
+ }
+ while (i);
+}
+
+#define DEBUG_OUT_STREAM stderr
+
+static void Print(const char *s)
+{
+ fputs(s, DEBUG_OUT_STREAM);
+}
+
+static void PrintAligned(const char *s, size_t align)
+{
+ size_t len = strlen(s);
+ for(;;)
+ {
+ fputc(' ', DEBUG_OUT_STREAM);
+ if (len >= align)
+ break;
+ ++len;
+ }
+ Print(s);
+}
+
+static void PrintLn()
+{
+ Print("\n");
+}
+
+static void PrintHex(UInt64 v, size_t align)
+{
+ char s[32];
+ ConvertUInt64ToHex(v, s);
+ PrintAligned(s, align);
+}
+
+static void PrintDec(UInt64 v, size_t align)
+{
+ char s[32];
+ ConvertUInt64ToString(v, s);
+ PrintAligned(s, align);
+}
+
+static void PrintAddr(void *p)
+{
+ PrintHex((UInt64)(size_t)(ptrdiff_t)p, 12);
+}
+
+
+#define PRINT_ALLOC(name, cnt, size, ptr) \
+ Print(name " "); \
+ PrintDec(cnt++, 10); \
+ PrintHex(size, 10); \
+ PrintAddr(ptr); \
+ PrintLn();
+
+#define PRINT_FREE(name, cnt, ptr) if (ptr) { \
+ Print(name " "); \
+ PrintDec(--cnt, 10); \
+ PrintAddr(ptr); \
+ PrintLn(); }
+
+#else
+
+#define PRINT_ALLOC(name, cnt, size, ptr)
+#define PRINT_FREE(name, cnt, ptr)
+#define Print(s)
+#define PrintLn()
+#define PrintHex(v, align)
+#define PrintDec(v, align)
+#define PrintAddr(p)
+
+#endif
+
+
+
+void *MyAlloc(size_t size)
+{
+ if (size == 0)
+ return NULL;
+ #ifdef _SZ_ALLOC_DEBUG
+ {
+ void *p = malloc(size);
+ PRINT_ALLOC("Alloc ", g_allocCount, size, p);
+ return p;
+ }
+ #else
+ return malloc(size);
+ #endif
+}
+
+void MyFree(void *address)
+{
+ PRINT_FREE("Free ", g_allocCount, address);
+
+ free(address);
+}
+
+#ifdef _WIN32
+
+void *MidAlloc(size_t size)
+{
+ if (size == 0)
+ return NULL;
+
+ PRINT_ALLOC("Alloc-Mid", g_allocCountMid, size, NULL);
+
+ return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
+}
+
+void MidFree(void *address)
+{
+ PRINT_FREE("Free-Mid", g_allocCountMid, address);
+
+ if (!address)
+ return;
+ VirtualFree(address, 0, MEM_RELEASE);
+}
+
+#ifndef MEM_LARGE_PAGES
+#undef _7ZIP_LARGE_PAGES
+#endif
+
+#ifdef _7ZIP_LARGE_PAGES
+SIZE_T g_LargePageSize = 0;
+typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
+#endif
+
+void SetLargePageSize()
+{
+ #ifdef _7ZIP_LARGE_PAGES
+ SIZE_T size;
+ GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
+ GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
+ if (!largePageMinimum)
+ return;
+ size = largePageMinimum();
+ if (size == 0 || (size & (size - 1)) != 0)
+ return;
+ g_LargePageSize = size;
+ #endif
+}
+
+
+void *BigAlloc(size_t size)
+{
+ if (size == 0)
+ return NULL;
+
+ PRINT_ALLOC("Alloc-Big", g_allocCountBig, size, NULL);
+
+ #ifdef _7ZIP_LARGE_PAGES
+ {
+ SIZE_T ps = g_LargePageSize;
+ if (ps != 0 && ps <= (1 << 30) && size > (ps / 2))
+ {
+ size_t size2;
+ ps--;
+ size2 = (size + ps) & ~ps;
+ if (size2 >= size)
+ {
+ void *res = VirtualAlloc(NULL, size2, MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
+ if (res)
+ return res;
+ }
+ }
+ }
+ #endif
+
+ return VirtualAlloc(NULL, size, MEM_COMMIT, PAGE_READWRITE);
+}
+
+void BigFree(void *address)
+{
+ PRINT_FREE("Free-Big", g_allocCountBig, address);
+
+ if (!address)
+ return;
+ VirtualFree(address, 0, MEM_RELEASE);
+}
+
+#endif
+
+
+static void *SzAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MyAlloc(size); }
+static void SzFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MyFree(address); }
+const ISzAlloc g_Alloc = { SzAlloc, SzFree };
+
+static void *SzMidAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return MidAlloc(size); }
+static void SzMidFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); MidFree(address); }
+const ISzAlloc g_MidAlloc = { SzMidAlloc, SzMidFree };
+
+static void *SzBigAlloc(ISzAllocPtr p, size_t size) { UNUSED_VAR(p); return BigAlloc(size); }
+static void SzBigFree(ISzAllocPtr p, void *address) { UNUSED_VAR(p); BigFree(address); }
+const ISzAlloc g_BigAlloc = { SzBigAlloc, SzBigFree };
+
+
+/*
+ uintptr_t : <stdint.h> C99 (optional)
+ : unsupported in VS6
+*/
+
+#ifdef _WIN32
+ typedef UINT_PTR UIntPtr;
+#else
+ /*
+ typedef uintptr_t UIntPtr;
+ */
+ typedef ptrdiff_t UIntPtr;
+#endif
+
+
+#define ADJUST_ALLOC_SIZE 0
+/*
+#define ADJUST_ALLOC_SIZE (sizeof(void *) - 1)
+*/
+/*
+ Use (ADJUST_ALLOC_SIZE = (sizeof(void *) - 1)), if
+ MyAlloc() can return address that is NOT multiple of sizeof(void *).
+*/
+
+
+/*
+#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((char *)(p) - ((size_t)(UIntPtr)(p) & ((align) - 1))))
+*/
+#define MY_ALIGN_PTR_DOWN(p, align) ((void *)((((UIntPtr)(p)) & ~((UIntPtr)(align) - 1))))
+
+#define MY_ALIGN_PTR_UP_PLUS(p, align) MY_ALIGN_PTR_DOWN(((char *)(p) + (align) + ADJUST_ALLOC_SIZE), align)
+
+
+#if (_POSIX_C_SOURCE >= 200112L) && !defined(_WIN32)
+ #define USE_posix_memalign
+#endif
+
+/*
+ This posix_memalign() is for test purposes only.
+ We also need special Free() function instead of free(),
+ if this posix_memalign() is used.
+*/
+
+/*
+static int posix_memalign(void **ptr, size_t align, size_t size)
+{
+ size_t newSize = size + align;
+ void *p;
+ void *pAligned;
+ *ptr = NULL;
+ if (newSize < size)
+ return 12; // ENOMEM
+ p = MyAlloc(newSize);
+ if (!p)
+ return 12; // ENOMEM
+ pAligned = MY_ALIGN_PTR_UP_PLUS(p, align);
+ ((void **)pAligned)[-1] = p;
+ *ptr = pAligned;
+ return 0;
+}
+*/
+
+/*
+ ALLOC_ALIGN_SIZE >= sizeof(void *)
+ ALLOC_ALIGN_SIZE >= cache_line_size
+*/
+
+#define ALLOC_ALIGN_SIZE ((size_t)1 << 7)
+
+static void *SzAlignedAlloc(ISzAllocPtr pp, size_t size)
+{
+ #ifndef USE_posix_memalign
+
+ void *p;
+ void *pAligned;
+ size_t newSize;
+ UNUSED_VAR(pp);
+
+ /* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned
+ block to prevent cache line sharing with another allocated blocks */
+
+ newSize = size + ALLOC_ALIGN_SIZE * 1 + ADJUST_ALLOC_SIZE;
+ if (newSize < size)
+ return NULL;
+
+ p = MyAlloc(newSize);
+
+ if (!p)
+ return NULL;
+ pAligned = MY_ALIGN_PTR_UP_PLUS(p, ALLOC_ALIGN_SIZE);
+
+ Print(" size="); PrintHex(size, 8);
+ Print(" a_size="); PrintHex(newSize, 8);
+ Print(" ptr="); PrintAddr(p);
+ Print(" a_ptr="); PrintAddr(pAligned);
+ PrintLn();
+
+ ((void **)pAligned)[-1] = p;
+
+ return pAligned;
+
+ #else
+
+ void *p;
+ UNUSED_VAR(pp);
+ if (posix_memalign(&p, ALLOC_ALIGN_SIZE, size))
+ return NULL;
+
+ Print(" posix_memalign="); PrintAddr(p);
+ PrintLn();
+
+ return p;
+
+ #endif
+}
+
+
+static void SzAlignedFree(ISzAllocPtr pp, void *address)
+{
+ UNUSED_VAR(pp);
+ #ifndef USE_posix_memalign
+ if (address)
+ MyFree(((void **)address)[-1]);
+ #else
+ free(address);
+ #endif
+}
+
+
+const ISzAlloc g_AlignedAlloc = { SzAlignedAlloc, SzAlignedFree };
+
+
+
+#define MY_ALIGN_PTR_DOWN_1(p) MY_ALIGN_PTR_DOWN(p, sizeof(void *))
+
+/* we align ptr to support cases where CAlignOffsetAlloc::offset is not multiply of sizeof(void *) */
+#define REAL_BLOCK_PTR_VAR(p) ((void **)MY_ALIGN_PTR_DOWN_1(p))[-1]
+/*
+#define REAL_BLOCK_PTR_VAR(p) ((void **)(p))[-1]
+*/
+
+static void *AlignOffsetAlloc_Alloc(ISzAllocPtr pp, size_t size)
+{
+ CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt);
+ void *adr;
+ void *pAligned;
+ size_t newSize;
+ size_t extra;
+ size_t alignSize = (size_t)1 << p->numAlignBits;
+
+ if (alignSize < sizeof(void *))
+ alignSize = sizeof(void *);
+
+ if (p->offset >= alignSize)
+ return NULL;
+
+ /* also we can allocate additional dummy ALLOC_ALIGN_SIZE bytes after aligned
+ block to prevent cache line sharing with another allocated blocks */
+ extra = p->offset & (sizeof(void *) - 1);
+ newSize = size + alignSize + extra + ADJUST_ALLOC_SIZE;
+ if (newSize < size)
+ return NULL;
+
+ adr = ISzAlloc_Alloc(p->baseAlloc, newSize);
+
+ if (!adr)
+ return NULL;
+
+ pAligned = (char *)MY_ALIGN_PTR_DOWN((char *)adr +
+ alignSize - p->offset + extra + ADJUST_ALLOC_SIZE, alignSize) + p->offset;
+
+ PrintLn();
+ Print("- Aligned: ");
+ Print(" size="); PrintHex(size, 8);
+ Print(" a_size="); PrintHex(newSize, 8);
+ Print(" ptr="); PrintAddr(adr);
+ Print(" a_ptr="); PrintAddr(pAligned);
+ PrintLn();
+
+ REAL_BLOCK_PTR_VAR(pAligned) = adr;
+
+ return pAligned;
+}
+
+
+static void AlignOffsetAlloc_Free(ISzAllocPtr pp, void *address)
+{
+ if (address)
+ {
+ CAlignOffsetAlloc *p = CONTAINER_FROM_VTBL(pp, CAlignOffsetAlloc, vt);
+ PrintLn();
+ Print("- Aligned Free: ");
+ PrintLn();
+ ISzAlloc_Free(p->baseAlloc, REAL_BLOCK_PTR_VAR(address));
+ }
+}
+
+
+void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p)
+{
+ p->vt.Alloc = AlignOffsetAlloc_Alloc;
+ p->vt.Free = AlignOffsetAlloc_Free;
+}
diff --git a/other-licenses/7zstub/src/C/Alloc.h b/other-licenses/7zstub/src/C/Alloc.h
new file mode 100644
index 0000000000..3d796e5eee
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Alloc.h
@@ -0,0 +1,51 @@
+/* Alloc.h -- Memory allocation functions
+2018-02-19 : Igor Pavlov : Public domain */
+
+#ifndef __COMMON_ALLOC_H
+#define __COMMON_ALLOC_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+void *MyAlloc(size_t size);
+void MyFree(void *address);
+
+#ifdef _WIN32
+
+void SetLargePageSize();
+
+void *MidAlloc(size_t size);
+void MidFree(void *address);
+void *BigAlloc(size_t size);
+void BigFree(void *address);
+
+#else
+
+#define MidAlloc(size) MyAlloc(size)
+#define MidFree(address) MyFree(address)
+#define BigAlloc(size) MyAlloc(size)
+#define BigFree(address) MyFree(address)
+
+#endif
+
+extern const ISzAlloc g_Alloc;
+extern const ISzAlloc g_BigAlloc;
+extern const ISzAlloc g_MidAlloc;
+extern const ISzAlloc g_AlignedAlloc;
+
+
+typedef struct
+{
+ ISzAlloc vt;
+ ISzAllocPtr baseAlloc;
+ unsigned numAlignBits; /* ((1 << numAlignBits) >= sizeof(void *)) */
+ size_t offset; /* (offset == (k * sizeof(void *)) && offset < (1 << numAlignBits) */
+} CAlignOffsetAlloc;
+
+void AlignOffsetAlloc_CreateVTable(CAlignOffsetAlloc *p);
+
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Bcj2.c b/other-licenses/7zstub/src/C/Bcj2.c
new file mode 100644
index 0000000000..da93985cf6
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Bcj2.c
@@ -0,0 +1,257 @@
+/* Bcj2.c -- BCJ2 Decoder (Converter for x86 code)
+2018-04-28 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "Bcj2.h"
+#include "CpuArch.h"
+
+#define CProb UInt16
+
+#define kTopValue ((UInt32)1 << 24)
+#define kNumModelBits 11
+#define kBitModelTotal (1 << kNumModelBits)
+#define kNumMoveBits 5
+
+#define _IF_BIT_0 ttt = *prob; bound = (p->range >> kNumModelBits) * ttt; if (p->code < bound)
+#define _UPDATE_0 p->range = bound; *prob = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
+#define _UPDATE_1 p->range -= bound; p->code -= bound; *prob = (CProb)(ttt - (ttt >> kNumMoveBits));
+
+void Bcj2Dec_Init(CBcj2Dec *p)
+{
+ unsigned i;
+
+ p->state = BCJ2_DEC_STATE_OK;
+ p->ip = 0;
+ p->temp[3] = 0;
+ p->range = 0;
+ p->code = 0;
+ for (i = 0; i < sizeof(p->probs) / sizeof(p->probs[0]); i++)
+ p->probs[i] = kBitModelTotal >> 1;
+}
+
+SRes Bcj2Dec_Decode(CBcj2Dec *p)
+{
+ if (p->range <= 5)
+ {
+ p->state = BCJ2_DEC_STATE_OK;
+ for (; p->range != 5; p->range++)
+ {
+ if (p->range == 1 && p->code != 0)
+ return SZ_ERROR_DATA;
+
+ if (p->bufs[BCJ2_STREAM_RC] == p->lims[BCJ2_STREAM_RC])
+ {
+ p->state = BCJ2_STREAM_RC;
+ return SZ_OK;
+ }
+
+ p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++;
+ }
+
+ if (p->code == 0xFFFFFFFF)
+ return SZ_ERROR_DATA;
+
+ p->range = 0xFFFFFFFF;
+ }
+ else if (p->state >= BCJ2_DEC_STATE_ORIG_0)
+ {
+ while (p->state <= BCJ2_DEC_STATE_ORIG_3)
+ {
+ Byte *dest = p->dest;
+ if (dest == p->destLim)
+ return SZ_OK;
+ *dest = p->temp[(size_t)p->state - BCJ2_DEC_STATE_ORIG_0];
+ p->state++;
+ p->dest = dest + 1;
+ }
+ }
+
+ /*
+ if (BCJ2_IS_32BIT_STREAM(p->state))
+ {
+ const Byte *cur = p->bufs[p->state];
+ if (cur == p->lims[p->state])
+ return SZ_OK;
+ p->bufs[p->state] = cur + 4;
+
+ {
+ UInt32 val;
+ Byte *dest;
+ SizeT rem;
+
+ p->ip += 4;
+ val = GetBe32(cur) - p->ip;
+ dest = p->dest;
+ rem = p->destLim - dest;
+ if (rem < 4)
+ {
+ SizeT i;
+ SetUi32(p->temp, val);
+ for (i = 0; i < rem; i++)
+ dest[i] = p->temp[i];
+ p->dest = dest + rem;
+ p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem;
+ return SZ_OK;
+ }
+ SetUi32(dest, val);
+ p->temp[3] = (Byte)(val >> 24);
+ p->dest = dest + 4;
+ p->state = BCJ2_DEC_STATE_OK;
+ }
+ }
+ */
+
+ for (;;)
+ {
+ if (BCJ2_IS_32BIT_STREAM(p->state))
+ p->state = BCJ2_DEC_STATE_OK;
+ else
+ {
+ if (p->range < kTopValue)
+ {
+ if (p->bufs[BCJ2_STREAM_RC] == p->lims[BCJ2_STREAM_RC])
+ {
+ p->state = BCJ2_STREAM_RC;
+ return SZ_OK;
+ }
+ p->range <<= 8;
+ p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++;
+ }
+
+ {
+ const Byte *src = p->bufs[BCJ2_STREAM_MAIN];
+ const Byte *srcLim;
+ Byte *dest;
+ SizeT num = p->lims[BCJ2_STREAM_MAIN] - src;
+
+ if (num == 0)
+ {
+ p->state = BCJ2_STREAM_MAIN;
+ return SZ_OK;
+ }
+
+ dest = p->dest;
+ if (num > (SizeT)(p->destLim - dest))
+ {
+ num = p->destLim - dest;
+ if (num == 0)
+ {
+ p->state = BCJ2_DEC_STATE_ORIG;
+ return SZ_OK;
+ }
+ }
+
+ srcLim = src + num;
+
+ if (p->temp[3] == 0x0F && (src[0] & 0xF0) == 0x80)
+ *dest = src[0];
+ else for (;;)
+ {
+ Byte b = *src;
+ *dest = b;
+ if (b != 0x0F)
+ {
+ if ((b & 0xFE) == 0xE8)
+ break;
+ dest++;
+ if (++src != srcLim)
+ continue;
+ break;
+ }
+ dest++;
+ if (++src == srcLim)
+ break;
+ if ((*src & 0xF0) != 0x80)
+ continue;
+ *dest = *src;
+ break;
+ }
+
+ num = src - p->bufs[BCJ2_STREAM_MAIN];
+
+ if (src == srcLim)
+ {
+ p->temp[3] = src[-1];
+ p->bufs[BCJ2_STREAM_MAIN] = src;
+ p->ip += (UInt32)num;
+ p->dest += num;
+ p->state =
+ p->bufs[BCJ2_STREAM_MAIN] ==
+ p->lims[BCJ2_STREAM_MAIN] ?
+ (unsigned)BCJ2_STREAM_MAIN :
+ (unsigned)BCJ2_DEC_STATE_ORIG;
+ return SZ_OK;
+ }
+
+ {
+ UInt32 bound, ttt;
+ CProb *prob;
+ Byte b = src[0];
+ Byte prev = (Byte)(num == 0 ? p->temp[3] : src[-1]);
+
+ p->temp[3] = b;
+ p->bufs[BCJ2_STREAM_MAIN] = src + 1;
+ num++;
+ p->ip += (UInt32)num;
+ p->dest += num;
+
+ prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)prev : (b == 0xE9 ? 1 : 0));
+
+ _IF_BIT_0
+ {
+ _UPDATE_0
+ continue;
+ }
+ _UPDATE_1
+
+ }
+ }
+ }
+
+ {
+ UInt32 val;
+ unsigned cj = (p->temp[3] == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP;
+ const Byte *cur = p->bufs[cj];
+ Byte *dest;
+ SizeT rem;
+
+ if (cur == p->lims[cj])
+ {
+ p->state = cj;
+ break;
+ }
+
+ val = GetBe32(cur);
+ p->bufs[cj] = cur + 4;
+
+ p->ip += 4;
+ val -= p->ip;
+ dest = p->dest;
+ rem = p->destLim - dest;
+
+ if (rem < 4)
+ {
+ p->temp[0] = (Byte)val; if (rem > 0) dest[0] = (Byte)val; val >>= 8;
+ p->temp[1] = (Byte)val; if (rem > 1) dest[1] = (Byte)val; val >>= 8;
+ p->temp[2] = (Byte)val; if (rem > 2) dest[2] = (Byte)val; val >>= 8;
+ p->temp[3] = (Byte)val;
+ p->dest = dest + rem;
+ p->state = BCJ2_DEC_STATE_ORIG_0 + (unsigned)rem;
+ break;
+ }
+
+ SetUi32(dest, val);
+ p->temp[3] = (Byte)(val >> 24);
+ p->dest = dest + 4;
+ }
+ }
+
+ if (p->range < kTopValue && p->bufs[BCJ2_STREAM_RC] != p->lims[BCJ2_STREAM_RC])
+ {
+ p->range <<= 8;
+ p->code = (p->code << 8) | *(p->bufs[BCJ2_STREAM_RC])++;
+ }
+
+ return SZ_OK;
+}
diff --git a/other-licenses/7zstub/src/C/Bcj2.h b/other-licenses/7zstub/src/C/Bcj2.h
new file mode 100644
index 0000000000..68893d2d12
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Bcj2.h
@@ -0,0 +1,146 @@
+/* Bcj2.h -- BCJ2 Converter for x86 code
+2014-11-10 : Igor Pavlov : Public domain */
+
+#ifndef __BCJ2_H
+#define __BCJ2_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define BCJ2_NUM_STREAMS 4
+
+enum
+{
+ BCJ2_STREAM_MAIN,
+ BCJ2_STREAM_CALL,
+ BCJ2_STREAM_JUMP,
+ BCJ2_STREAM_RC
+};
+
+enum
+{
+ BCJ2_DEC_STATE_ORIG_0 = BCJ2_NUM_STREAMS,
+ BCJ2_DEC_STATE_ORIG_1,
+ BCJ2_DEC_STATE_ORIG_2,
+ BCJ2_DEC_STATE_ORIG_3,
+
+ BCJ2_DEC_STATE_ORIG,
+ BCJ2_DEC_STATE_OK
+};
+
+enum
+{
+ BCJ2_ENC_STATE_ORIG = BCJ2_NUM_STREAMS,
+ BCJ2_ENC_STATE_OK
+};
+
+
+#define BCJ2_IS_32BIT_STREAM(s) ((s) == BCJ2_STREAM_CALL || (s) == BCJ2_STREAM_JUMP)
+
+/*
+CBcj2Dec / CBcj2Enc
+bufs sizes:
+ BUF_SIZE(n) = lims[n] - bufs[n]
+bufs sizes for BCJ2_STREAM_CALL and BCJ2_STREAM_JUMP must be mutliply of 4:
+ (BUF_SIZE(BCJ2_STREAM_CALL) & 3) == 0
+ (BUF_SIZE(BCJ2_STREAM_JUMP) & 3) == 0
+*/
+
+/*
+CBcj2Dec:
+dest is allowed to overlap with bufs[BCJ2_STREAM_MAIN], with the following conditions:
+ bufs[BCJ2_STREAM_MAIN] >= dest &&
+ bufs[BCJ2_STREAM_MAIN] - dest >= tempReserv +
+ BUF_SIZE(BCJ2_STREAM_CALL) +
+ BUF_SIZE(BCJ2_STREAM_JUMP)
+ tempReserv = 0 : for first call of Bcj2Dec_Decode
+ tempReserv = 4 : for any other calls of Bcj2Dec_Decode
+ overlap with offset = 1 is not allowed
+*/
+
+typedef struct
+{
+ const Byte *bufs[BCJ2_NUM_STREAMS];
+ const Byte *lims[BCJ2_NUM_STREAMS];
+ Byte *dest;
+ const Byte *destLim;
+
+ unsigned state; /* BCJ2_STREAM_MAIN has more priority than BCJ2_STATE_ORIG */
+
+ UInt32 ip;
+ Byte temp[4];
+ UInt32 range;
+ UInt32 code;
+ UInt16 probs[2 + 256];
+} CBcj2Dec;
+
+void Bcj2Dec_Init(CBcj2Dec *p);
+
+/* Returns: SZ_OK or SZ_ERROR_DATA */
+SRes Bcj2Dec_Decode(CBcj2Dec *p);
+
+#define Bcj2Dec_IsFinished(_p_) ((_p_)->code == 0)
+
+
+
+typedef enum
+{
+ BCJ2_ENC_FINISH_MODE_CONTINUE,
+ BCJ2_ENC_FINISH_MODE_END_BLOCK,
+ BCJ2_ENC_FINISH_MODE_END_STREAM
+} EBcj2Enc_FinishMode;
+
+typedef struct
+{
+ Byte *bufs[BCJ2_NUM_STREAMS];
+ const Byte *lims[BCJ2_NUM_STREAMS];
+ const Byte *src;
+ const Byte *srcLim;
+
+ unsigned state;
+ EBcj2Enc_FinishMode finishMode;
+
+ Byte prevByte;
+
+ Byte cache;
+ UInt32 range;
+ UInt64 low;
+ UInt64 cacheSize;
+
+ UInt32 ip;
+
+ /* 32-bit ralative offset in JUMP/CALL commands is
+ - (mod 4 GB) in 32-bit mode
+ - signed Int32 in 64-bit mode
+ We use (mod 4 GB) check for fileSize.
+ Use fileSize up to 2 GB, if you want to support 32-bit and 64-bit code conversion. */
+ UInt32 fileIp;
+ UInt32 fileSize; /* (fileSize <= ((UInt32)1 << 31)), 0 means no_limit */
+ UInt32 relatLimit; /* (relatLimit <= ((UInt32)1 << 31)), 0 means desable_conversion */
+
+ UInt32 tempTarget;
+ unsigned tempPos;
+ Byte temp[4 * 2];
+
+ unsigned flushPos;
+
+ UInt16 probs[2 + 256];
+} CBcj2Enc;
+
+void Bcj2Enc_Init(CBcj2Enc *p);
+void Bcj2Enc_Encode(CBcj2Enc *p);
+
+#define Bcj2Enc_Get_InputData_Size(p) ((SizeT)((p)->srcLim - (p)->src) + (p)->tempPos)
+#define Bcj2Enc_IsFinished(p) ((p)->flushPos == 5)
+
+
+#define BCJ2_RELAT_LIMIT_NUM_BITS 26
+#define BCJ2_RELAT_LIMIT ((UInt32)1 << BCJ2_RELAT_LIMIT_NUM_BITS)
+
+/* limit for CBcj2Enc::fileSize variable */
+#define BCJ2_FileSize_MAX ((UInt32)1 << 31)
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Bcj2Enc.c b/other-licenses/7zstub/src/C/Bcj2Enc.c
new file mode 100644
index 0000000000..b0bc7593db
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Bcj2Enc.c
@@ -0,0 +1,311 @@
+/* Bcj2Enc.c -- BCJ2 Encoder (Converter for x86 code)
+2017-04-28 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+/* #define SHOW_STAT */
+
+#ifdef SHOW_STAT
+#include <stdio.h>
+#define PRF(x) x
+#else
+#define PRF(x)
+#endif
+
+#include <string.h>
+
+#include "Bcj2.h"
+#include "CpuArch.h"
+
+#define CProb UInt16
+
+#define kTopValue ((UInt32)1 << 24)
+#define kNumModelBits 11
+#define kBitModelTotal (1 << kNumModelBits)
+#define kNumMoveBits 5
+
+void Bcj2Enc_Init(CBcj2Enc *p)
+{
+ unsigned i;
+
+ p->state = BCJ2_ENC_STATE_OK;
+ p->finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE;
+
+ p->prevByte = 0;
+
+ p->cache = 0;
+ p->range = 0xFFFFFFFF;
+ p->low = 0;
+ p->cacheSize = 1;
+
+ p->ip = 0;
+
+ p->fileIp = 0;
+ p->fileSize = 0;
+ p->relatLimit = BCJ2_RELAT_LIMIT;
+
+ p->tempPos = 0;
+
+ p->flushPos = 0;
+
+ for (i = 0; i < sizeof(p->probs) / sizeof(p->probs[0]); i++)
+ p->probs[i] = kBitModelTotal >> 1;
+}
+
+static Bool MY_FAST_CALL RangeEnc_ShiftLow(CBcj2Enc *p)
+{
+ if ((UInt32)p->low < (UInt32)0xFF000000 || (UInt32)(p->low >> 32) != 0)
+ {
+ Byte *buf = p->bufs[BCJ2_STREAM_RC];
+ do
+ {
+ if (buf == p->lims[BCJ2_STREAM_RC])
+ {
+ p->state = BCJ2_STREAM_RC;
+ p->bufs[BCJ2_STREAM_RC] = buf;
+ return True;
+ }
+ *buf++ = (Byte)(p->cache + (Byte)(p->low >> 32));
+ p->cache = 0xFF;
+ }
+ while (--p->cacheSize);
+ p->bufs[BCJ2_STREAM_RC] = buf;
+ p->cache = (Byte)((UInt32)p->low >> 24);
+ }
+ p->cacheSize++;
+ p->low = (UInt32)p->low << 8;
+ return False;
+}
+
+static void Bcj2Enc_Encode_2(CBcj2Enc *p)
+{
+ if (BCJ2_IS_32BIT_STREAM(p->state))
+ {
+ Byte *cur = p->bufs[p->state];
+ if (cur == p->lims[p->state])
+ return;
+ SetBe32(cur, p->tempTarget);
+ p->bufs[p->state] = cur + 4;
+ }
+
+ p->state = BCJ2_ENC_STATE_ORIG;
+
+ for (;;)
+ {
+ if (p->range < kTopValue)
+ {
+ if (RangeEnc_ShiftLow(p))
+ return;
+ p->range <<= 8;
+ }
+
+ {
+ {
+ const Byte *src = p->src;
+ const Byte *srcLim;
+ Byte *dest;
+ SizeT num = p->srcLim - src;
+
+ if (p->finishMode == BCJ2_ENC_FINISH_MODE_CONTINUE)
+ {
+ if (num <= 4)
+ return;
+ num -= 4;
+ }
+ else if (num == 0)
+ break;
+
+ dest = p->bufs[BCJ2_STREAM_MAIN];
+ if (num > (SizeT)(p->lims[BCJ2_STREAM_MAIN] - dest))
+ {
+ num = p->lims[BCJ2_STREAM_MAIN] - dest;
+ if (num == 0)
+ {
+ p->state = BCJ2_STREAM_MAIN;
+ return;
+ }
+ }
+
+ srcLim = src + num;
+
+ if (p->prevByte == 0x0F && (src[0] & 0xF0) == 0x80)
+ *dest = src[0];
+ else for (;;)
+ {
+ Byte b = *src;
+ *dest = b;
+ if (b != 0x0F)
+ {
+ if ((b & 0xFE) == 0xE8)
+ break;
+ dest++;
+ if (++src != srcLim)
+ continue;
+ break;
+ }
+ dest++;
+ if (++src == srcLim)
+ break;
+ if ((*src & 0xF0) != 0x80)
+ continue;
+ *dest = *src;
+ break;
+ }
+
+ num = src - p->src;
+
+ if (src == srcLim)
+ {
+ p->prevByte = src[-1];
+ p->bufs[BCJ2_STREAM_MAIN] = dest;
+ p->src = src;
+ p->ip += (UInt32)num;
+ continue;
+ }
+
+ {
+ Byte context = (Byte)(num == 0 ? p->prevByte : src[-1]);
+ Bool needConvert;
+
+ p->bufs[BCJ2_STREAM_MAIN] = dest + 1;
+ p->ip += (UInt32)num + 1;
+ src++;
+
+ needConvert = False;
+
+ if ((SizeT)(p->srcLim - src) >= 4)
+ {
+ UInt32 relatVal = GetUi32(src);
+ if ((p->fileSize == 0 || (UInt32)(p->ip + 4 + relatVal - p->fileIp) < p->fileSize)
+ && ((relatVal + p->relatLimit) >> 1) < p->relatLimit)
+ needConvert = True;
+ }
+
+ {
+ UInt32 bound;
+ unsigned ttt;
+ Byte b = src[-1];
+ CProb *prob = p->probs + (unsigned)(b == 0xE8 ? 2 + (unsigned)context : (b == 0xE9 ? 1 : 0));
+
+ ttt = *prob;
+ bound = (p->range >> kNumModelBits) * ttt;
+
+ if (!needConvert)
+ {
+ p->range = bound;
+ *prob = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
+ p->src = src;
+ p->prevByte = b;
+ continue;
+ }
+
+ p->low += bound;
+ p->range -= bound;
+ *prob = (CProb)(ttt - (ttt >> kNumMoveBits));
+
+ {
+ UInt32 relatVal = GetUi32(src);
+ UInt32 absVal;
+ p->ip += 4;
+ absVal = p->ip + relatVal;
+ p->prevByte = src[3];
+ src += 4;
+ p->src = src;
+ {
+ unsigned cj = (b == 0xE8) ? BCJ2_STREAM_CALL : BCJ2_STREAM_JUMP;
+ Byte *cur = p->bufs[cj];
+ if (cur == p->lims[cj])
+ {
+ p->state = cj;
+ p->tempTarget = absVal;
+ return;
+ }
+ SetBe32(cur, absVal);
+ p->bufs[cj] = cur + 4;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (p->finishMode != BCJ2_ENC_FINISH_MODE_END_STREAM)
+ return;
+
+ for (; p->flushPos < 5; p->flushPos++)
+ if (RangeEnc_ShiftLow(p))
+ return;
+ p->state = BCJ2_ENC_STATE_OK;
+}
+
+
+void Bcj2Enc_Encode(CBcj2Enc *p)
+{
+ PRF(printf("\n"));
+ PRF(printf("---- ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src));
+
+ if (p->tempPos != 0)
+ {
+ unsigned extra = 0;
+
+ for (;;)
+ {
+ const Byte *src = p->src;
+ const Byte *srcLim = p->srcLim;
+ unsigned finishMode = p->finishMode;
+
+ p->src = p->temp;
+ p->srcLim = p->temp + p->tempPos;
+ if (src != srcLim)
+ p->finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE;
+
+ PRF(printf(" ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src));
+
+ Bcj2Enc_Encode_2(p);
+
+ {
+ unsigned num = (unsigned)(p->src - p->temp);
+ unsigned tempPos = p->tempPos - num;
+ unsigned i;
+ p->tempPos = tempPos;
+ for (i = 0; i < tempPos; i++)
+ p->temp[i] = p->temp[(size_t)i + num];
+
+ p->src = src;
+ p->srcLim = srcLim;
+ p->finishMode = finishMode;
+
+ if (p->state != BCJ2_ENC_STATE_ORIG || src == srcLim)
+ return;
+
+ if (extra >= tempPos)
+ {
+ p->src = src - tempPos;
+ p->tempPos = 0;
+ break;
+ }
+
+ p->temp[tempPos] = src[0];
+ p->tempPos = tempPos + 1;
+ p->src = src + 1;
+ extra++;
+ }
+ }
+ }
+
+ PRF(printf("++++ ip = %8d tempPos = %8d src = %8d\n", p->ip, p->tempPos, p->srcLim - p->src));
+
+ Bcj2Enc_Encode_2(p);
+
+ if (p->state == BCJ2_ENC_STATE_ORIG)
+ {
+ const Byte *src = p->src;
+ unsigned rem = (unsigned)(p->srcLim - src);
+ unsigned i;
+ for (i = 0; i < rem; i++)
+ p->temp[i] = src[i];
+ p->tempPos = rem;
+ p->src = src + rem;
+ }
+}
diff --git a/other-licenses/7zstub/src/C/Bra.c b/other-licenses/7zstub/src/C/Bra.c
new file mode 100644
index 0000000000..cbdcb290df
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Bra.c
@@ -0,0 +1,230 @@
+/* Bra.c -- Converters for RISC code
+2017-04-04 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+#include "Bra.h"
+
+SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
+{
+ Byte *p;
+ const Byte *lim;
+ size &= ~(size_t)3;
+ ip += 4;
+ p = data;
+ lim = data + size;
+
+ if (encoding)
+
+ for (;;)
+ {
+ for (;;)
+ {
+ if (p >= lim)
+ return p - data;
+ p += 4;
+ if (p[-1] == 0xEB)
+ break;
+ }
+ {
+ UInt32 v = GetUi32(p - 4);
+ v <<= 2;
+ v += ip + (UInt32)(p - data);
+ v >>= 2;
+ v &= 0x00FFFFFF;
+ v |= 0xEB000000;
+ SetUi32(p - 4, v);
+ }
+ }
+
+ for (;;)
+ {
+ for (;;)
+ {
+ if (p >= lim)
+ return p - data;
+ p += 4;
+ if (p[-1] == 0xEB)
+ break;
+ }
+ {
+ UInt32 v = GetUi32(p - 4);
+ v <<= 2;
+ v -= ip + (UInt32)(p - data);
+ v >>= 2;
+ v &= 0x00FFFFFF;
+ v |= 0xEB000000;
+ SetUi32(p - 4, v);
+ }
+ }
+}
+
+
+SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
+{
+ Byte *p;
+ const Byte *lim;
+ size &= ~(size_t)1;
+ p = data;
+ lim = data + size - 4;
+
+ if (encoding)
+
+ for (;;)
+ {
+ UInt32 b1;
+ for (;;)
+ {
+ UInt32 b3;
+ if (p > lim)
+ return p - data;
+ b1 = p[1];
+ b3 = p[3];
+ p += 2;
+ b1 ^= 8;
+ if ((b3 & b1) >= 0xF8)
+ break;
+ }
+ {
+ UInt32 v =
+ ((UInt32)b1 << 19)
+ + (((UInt32)p[1] & 0x7) << 8)
+ + (((UInt32)p[-2] << 11))
+ + (p[0]);
+
+ p += 2;
+ {
+ UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
+ v += cur;
+ }
+
+ p[-4] = (Byte)(v >> 11);
+ p[-3] = (Byte)(0xF0 | ((v >> 19) & 0x7));
+ p[-2] = (Byte)v;
+ p[-1] = (Byte)(0xF8 | (v >> 8));
+ }
+ }
+
+ for (;;)
+ {
+ UInt32 b1;
+ for (;;)
+ {
+ UInt32 b3;
+ if (p > lim)
+ return p - data;
+ b1 = p[1];
+ b3 = p[3];
+ p += 2;
+ b1 ^= 8;
+ if ((b3 & b1) >= 0xF8)
+ break;
+ }
+ {
+ UInt32 v =
+ ((UInt32)b1 << 19)
+ + (((UInt32)p[1] & 0x7) << 8)
+ + (((UInt32)p[-2] << 11))
+ + (p[0]);
+
+ p += 2;
+ {
+ UInt32 cur = (ip + (UInt32)(p - data)) >> 1;
+ v -= cur;
+ }
+
+ /*
+ SetUi16(p - 4, (UInt16)(((v >> 11) & 0x7FF) | 0xF000));
+ SetUi16(p - 2, (UInt16)(v | 0xF800));
+ */
+
+ p[-4] = (Byte)(v >> 11);
+ p[-3] = (Byte)(0xF0 | ((v >> 19) & 0x7));
+ p[-2] = (Byte)v;
+ p[-1] = (Byte)(0xF8 | (v >> 8));
+ }
+ }
+}
+
+
+SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
+{
+ Byte *p;
+ const Byte *lim;
+ size &= ~(size_t)3;
+ ip -= 4;
+ p = data;
+ lim = data + size;
+
+ for (;;)
+ {
+ for (;;)
+ {
+ if (p >= lim)
+ return p - data;
+ p += 4;
+ /* if ((v & 0xFC000003) == 0x48000001) */
+ if ((p[-4] & 0xFC) == 0x48 && (p[-1] & 3) == 1)
+ break;
+ }
+ {
+ UInt32 v = GetBe32(p - 4);
+ if (encoding)
+ v += ip + (UInt32)(p - data);
+ else
+ v -= ip + (UInt32)(p - data);
+ v &= 0x03FFFFFF;
+ v |= 0x48000000;
+ SetBe32(p - 4, v);
+ }
+ }
+}
+
+
+SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
+{
+ Byte *p;
+ const Byte *lim;
+ size &= ~(size_t)3;
+ ip -= 4;
+ p = data;
+ lim = data + size;
+
+ for (;;)
+ {
+ for (;;)
+ {
+ if (p >= lim)
+ return p - data;
+ /*
+ v = GetBe32(p);
+ p += 4;
+ m = v + ((UInt32)5 << 29);
+ m ^= (UInt32)7 << 29;
+ m += (UInt32)1 << 22;
+ if ((m & ((UInt32)0x1FF << 23)) == 0)
+ break;
+ */
+ p += 4;
+ if ((p[-4] == 0x40 && (p[-3] & 0xC0) == 0) ||
+ (p[-4] == 0x7F && (p[-3] >= 0xC0)))
+ break;
+ }
+ {
+ UInt32 v = GetBe32(p - 4);
+ v <<= 2;
+ if (encoding)
+ v += ip + (UInt32)(p - data);
+ else
+ v -= ip + (UInt32)(p - data);
+
+ v &= 0x01FFFFFF;
+ v -= (UInt32)1 << 24;
+ v ^= 0xFF000000;
+ v >>= 2;
+ v |= 0x40000000;
+ SetBe32(p - 4, v);
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/C/Bra.h b/other-licenses/7zstub/src/C/Bra.h
new file mode 100644
index 0000000000..aba8dce14f
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Bra.h
@@ -0,0 +1,64 @@
+/* Bra.h -- Branch converters for executables
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __BRA_H
+#define __BRA_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+/*
+These functions convert relative addresses to absolute addresses
+in CALL instructions to increase the compression ratio.
+
+ In:
+ data - data buffer
+ size - size of data
+ ip - current virtual Instruction Pinter (IP) value
+ state - state variable for x86 converter
+ encoding - 0 (for decoding), 1 (for encoding)
+
+ Out:
+ state - state variable for x86 converter
+
+ Returns:
+ The number of processed bytes. If you call these functions with multiple calls,
+ you must start next call with first byte after block of processed bytes.
+
+ Type Endian Alignment LookAhead
+
+ x86 little 1 4
+ ARMT little 2 2
+ ARM little 4 0
+ PPC big 4 0
+ SPARC big 4 0
+ IA64 little 16 0
+
+ size must be >= Alignment + LookAhead, if it's not last block.
+ If (size < Alignment + LookAhead), converter returns 0.
+
+ Example:
+
+ UInt32 ip = 0;
+ for ()
+ {
+ ; size must be >= Alignment + LookAhead, if it's not last block
+ SizeT processed = Convert(data, size, ip, 1);
+ data += processed;
+ size -= processed;
+ ip += processed;
+ }
+*/
+
+#define x86_Convert_Init(state) { state = 0; }
+SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding);
+SizeT ARM_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
+SizeT ARMT_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
+SizeT PPC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
+SizeT SPARC_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
+SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Bra86.c b/other-licenses/7zstub/src/C/Bra86.c
new file mode 100644
index 0000000000..a6463c63ba
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Bra86.c
@@ -0,0 +1,82 @@
+/* Bra86.c -- Converter for x86 code (BCJ)
+2017-04-03 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "Bra.h"
+
+#define Test86MSByte(b) ((((b) + 1) & 0xFE) == 0)
+
+SizeT x86_Convert(Byte *data, SizeT size, UInt32 ip, UInt32 *state, int encoding)
+{
+ SizeT pos = 0;
+ UInt32 mask = *state & 7;
+ if (size < 5)
+ return 0;
+ size -= 4;
+ ip += 5;
+
+ for (;;)
+ {
+ Byte *p = data + pos;
+ const Byte *limit = data + size;
+ for (; p < limit; p++)
+ if ((*p & 0xFE) == 0xE8)
+ break;
+
+ {
+ SizeT d = (SizeT)(p - data - pos);
+ pos = (SizeT)(p - data);
+ if (p >= limit)
+ {
+ *state = (d > 2 ? 0 : mask >> (unsigned)d);
+ return pos;
+ }
+ if (d > 2)
+ mask = 0;
+ else
+ {
+ mask >>= (unsigned)d;
+ if (mask != 0 && (mask > 4 || mask == 3 || Test86MSByte(p[(size_t)(mask >> 1) + 1])))
+ {
+ mask = (mask >> 1) | 4;
+ pos++;
+ continue;
+ }
+ }
+ }
+
+ if (Test86MSByte(p[4]))
+ {
+ UInt32 v = ((UInt32)p[4] << 24) | ((UInt32)p[3] << 16) | ((UInt32)p[2] << 8) | ((UInt32)p[1]);
+ UInt32 cur = ip + (UInt32)pos;
+ pos += 5;
+ if (encoding)
+ v += cur;
+ else
+ v -= cur;
+ if (mask != 0)
+ {
+ unsigned sh = (mask & 6) << 2;
+ if (Test86MSByte((Byte)(v >> sh)))
+ {
+ v ^= (((UInt32)0x100 << sh) - 1);
+ if (encoding)
+ v += cur;
+ else
+ v -= cur;
+ }
+ mask = 0;
+ }
+ p[1] = (Byte)v;
+ p[2] = (Byte)(v >> 8);
+ p[3] = (Byte)(v >> 16);
+ p[4] = (Byte)(0 - ((v >> 24) & 1));
+ }
+ else
+ {
+ mask = (mask >> 1) | 4;
+ pos++;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/C/BraIA64.c b/other-licenses/7zstub/src/C/BraIA64.c
new file mode 100644
index 0000000000..2656907a0b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/BraIA64.c
@@ -0,0 +1,53 @@
+/* BraIA64.c -- Converter for IA-64 code
+2017-01-26 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+#include "Bra.h"
+
+SizeT IA64_Convert(Byte *data, SizeT size, UInt32 ip, int encoding)
+{
+ SizeT i;
+ if (size < 16)
+ return 0;
+ size -= 16;
+ i = 0;
+ do
+ {
+ unsigned m = ((UInt32)0x334B0000 >> (data[i] & 0x1E)) & 3;
+ if (m)
+ {
+ m++;
+ do
+ {
+ Byte *p = data + (i + (size_t)m * 5 - 8);
+ if (((p[3] >> m) & 15) == 5
+ && (((p[-1] | ((UInt32)p[0] << 8)) >> m) & 0x70) == 0)
+ {
+ unsigned raw = GetUi32(p);
+ unsigned v = raw >> m;
+ v = (v & 0xFFFFF) | ((v & (1 << 23)) >> 3);
+
+ v <<= 4;
+ if (encoding)
+ v += ip + (UInt32)i;
+ else
+ v -= ip + (UInt32)i;
+ v >>= 4;
+
+ v &= 0x1FFFFF;
+ v += 0x700000;
+ v &= 0x8FFFFF;
+ raw &= ~((UInt32)0x8FFFFF << m);
+ raw |= (v << m);
+ SetUi32(p, raw);
+ }
+ }
+ while (++m <= 4);
+ }
+ i += 16;
+ }
+ while (i <= size);
+ return i;
+}
diff --git a/other-licenses/7zstub/src/C/Compiler.h b/other-licenses/7zstub/src/C/Compiler.h
new file mode 100644
index 0000000000..c788648cd2
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Compiler.h
@@ -0,0 +1,33 @@
+/* Compiler.h
+2017-04-03 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_COMPILER_H
+#define __7Z_COMPILER_H
+
+#ifdef _MSC_VER
+
+ #ifdef UNDER_CE
+ #define RPC_NO_WINDOWS_H
+ /* #pragma warning(disable : 4115) // '_RPC_ASYNC_STATE' : named type definition in parentheses */
+ #pragma warning(disable : 4201) // nonstandard extension used : nameless struct/union
+ #pragma warning(disable : 4214) // nonstandard extension used : bit field types other than int
+ #endif
+
+ #if _MSC_VER >= 1300
+ #pragma warning(disable : 4996) // This function or variable may be unsafe
+ #else
+ #pragma warning(disable : 4511) // copy constructor could not be generated
+ #pragma warning(disable : 4512) // assignment operator could not be generated
+ #pragma warning(disable : 4514) // unreferenced inline function has been removed
+ #pragma warning(disable : 4702) // unreachable code
+ #pragma warning(disable : 4710) // not inlined
+ #pragma warning(disable : 4714) // function marked as __forceinline not inlined
+ #pragma warning(disable : 4786) // identifier was truncated to '255' characters in the debug information
+ #endif
+
+#endif
+
+#define UNUSED_VAR(x) (void)x;
+/* #define UNUSED_VAR(x) x=x; */
+
+#endif
diff --git a/other-licenses/7zstub/src/C/CpuArch.c b/other-licenses/7zstub/src/C/CpuArch.c
new file mode 100644
index 0000000000..f835c2b7bf
--- /dev/null
+++ b/other-licenses/7zstub/src/C/CpuArch.c
@@ -0,0 +1,200 @@
+/* CpuArch.c -- CPU specific code
+2016-02-25: Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+
+#ifdef MY_CPU_X86_OR_AMD64
+
+#if (defined(_MSC_VER) && !defined(MY_CPU_AMD64)) || defined(__GNUC__)
+#define USE_ASM
+#endif
+
+#if !defined(USE_ASM) && _MSC_VER >= 1500
+#include <intrin.h>
+#endif
+
+#if defined(USE_ASM) && !defined(MY_CPU_AMD64)
+static UInt32 CheckFlag(UInt32 flag)
+{
+ #ifdef _MSC_VER
+ __asm pushfd;
+ __asm pop EAX;
+ __asm mov EDX, EAX;
+ __asm xor EAX, flag;
+ __asm push EAX;
+ __asm popfd;
+ __asm pushfd;
+ __asm pop EAX;
+ __asm xor EAX, EDX;
+ __asm push EDX;
+ __asm popfd;
+ __asm and flag, EAX;
+ #else
+ __asm__ __volatile__ (
+ "pushf\n\t"
+ "pop %%EAX\n\t"
+ "movl %%EAX,%%EDX\n\t"
+ "xorl %0,%%EAX\n\t"
+ "push %%EAX\n\t"
+ "popf\n\t"
+ "pushf\n\t"
+ "pop %%EAX\n\t"
+ "xorl %%EDX,%%EAX\n\t"
+ "push %%EDX\n\t"
+ "popf\n\t"
+ "andl %%EAX, %0\n\t":
+ "=c" (flag) : "c" (flag) :
+ "%eax", "%edx");
+ #endif
+ return flag;
+}
+#define CHECK_CPUID_IS_SUPPORTED if (CheckFlag(1 << 18) == 0 || CheckFlag(1 << 21) == 0) return False;
+#else
+#define CHECK_CPUID_IS_SUPPORTED
+#endif
+
+void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d)
+{
+ #ifdef USE_ASM
+
+ #ifdef _MSC_VER
+
+ UInt32 a2, b2, c2, d2;
+ __asm xor EBX, EBX;
+ __asm xor ECX, ECX;
+ __asm xor EDX, EDX;
+ __asm mov EAX, function;
+ __asm cpuid;
+ __asm mov a2, EAX;
+ __asm mov b2, EBX;
+ __asm mov c2, ECX;
+ __asm mov d2, EDX;
+
+ *a = a2;
+ *b = b2;
+ *c = c2;
+ *d = d2;
+
+ #else
+
+ __asm__ __volatile__ (
+ #if defined(MY_CPU_AMD64) && defined(__PIC__)
+ "mov %%rbx, %%rdi;"
+ "cpuid;"
+ "xchg %%rbx, %%rdi;"
+ : "=a" (*a) ,
+ "=D" (*b) ,
+ #elif defined(MY_CPU_X86) && defined(__PIC__)
+ "mov %%ebx, %%edi;"
+ "cpuid;"
+ "xchgl %%ebx, %%edi;"
+ : "=a" (*a) ,
+ "=D" (*b) ,
+ #else
+ "cpuid"
+ : "=a" (*a) ,
+ "=b" (*b) ,
+ #endif
+ "=c" (*c) ,
+ "=d" (*d)
+ : "0" (function)) ;
+
+ #endif
+
+ #else
+
+ int CPUInfo[4];
+ __cpuid(CPUInfo, function);
+ *a = CPUInfo[0];
+ *b = CPUInfo[1];
+ *c = CPUInfo[2];
+ *d = CPUInfo[3];
+
+ #endif
+}
+
+Bool x86cpuid_CheckAndRead(Cx86cpuid *p)
+{
+ CHECK_CPUID_IS_SUPPORTED
+ MyCPUID(0, &p->maxFunc, &p->vendor[0], &p->vendor[2], &p->vendor[1]);
+ MyCPUID(1, &p->ver, &p->b, &p->c, &p->d);
+ return True;
+}
+
+static const UInt32 kVendors[][3] =
+{
+ { 0x756E6547, 0x49656E69, 0x6C65746E},
+ { 0x68747541, 0x69746E65, 0x444D4163},
+ { 0x746E6543, 0x48727561, 0x736C7561}
+};
+
+int x86cpuid_GetFirm(const Cx86cpuid *p)
+{
+ unsigned i;
+ for (i = 0; i < sizeof(kVendors) / sizeof(kVendors[i]); i++)
+ {
+ const UInt32 *v = kVendors[i];
+ if (v[0] == p->vendor[0] &&
+ v[1] == p->vendor[1] &&
+ v[2] == p->vendor[2])
+ return (int)i;
+ }
+ return -1;
+}
+
+Bool CPU_Is_InOrder()
+{
+ Cx86cpuid p;
+ int firm;
+ UInt32 family, model;
+ if (!x86cpuid_CheckAndRead(&p))
+ return True;
+
+ family = x86cpuid_GetFamily(p.ver);
+ model = x86cpuid_GetModel(p.ver);
+
+ firm = x86cpuid_GetFirm(&p);
+
+ switch (firm)
+ {
+ case CPU_FIRM_INTEL: return (family < 6 || (family == 6 && (
+ /* In-Order Atom CPU */
+ model == 0x1C /* 45 nm, N4xx, D4xx, N5xx, D5xx, 230, 330 */
+ || model == 0x26 /* 45 nm, Z6xx */
+ || model == 0x27 /* 32 nm, Z2460 */
+ || model == 0x35 /* 32 nm, Z2760 */
+ || model == 0x36 /* 32 nm, N2xxx, D2xxx */
+ )));
+ case CPU_FIRM_AMD: return (family < 5 || (family == 5 && (model < 6 || model == 0xA)));
+ case CPU_FIRM_VIA: return (family < 6 || (family == 6 && model < 0xF));
+ }
+ return True;
+}
+
+#if !defined(MY_CPU_AMD64) && defined(_WIN32)
+#include <windows.h>
+static Bool CPU_Sys_Is_SSE_Supported()
+{
+ OSVERSIONINFO vi;
+ vi.dwOSVersionInfoSize = sizeof(vi);
+ if (!GetVersionEx(&vi))
+ return False;
+ return (vi.dwMajorVersion >= 5);
+}
+#define CHECK_SYS_SSE_SUPPORT if (!CPU_Sys_Is_SSE_Supported()) return False;
+#else
+#define CHECK_SYS_SSE_SUPPORT
+#endif
+
+Bool CPU_Is_Aes_Supported()
+{
+ Cx86cpuid p;
+ CHECK_SYS_SSE_SUPPORT
+ if (!x86cpuid_CheckAndRead(&p))
+ return False;
+ return (p.c >> 25) & 1;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/CpuArch.h b/other-licenses/7zstub/src/C/CpuArch.h
new file mode 100644
index 0000000000..7fb27282c7
--- /dev/null
+++ b/other-licenses/7zstub/src/C/CpuArch.h
@@ -0,0 +1,335 @@
+/* CpuArch.h -- CPU specific code
+2017-09-04 : Igor Pavlov : Public domain */
+
+#ifndef __CPU_ARCH_H
+#define __CPU_ARCH_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+/*
+MY_CPU_LE means that CPU is LITTLE ENDIAN.
+MY_CPU_BE means that CPU is BIG ENDIAN.
+If MY_CPU_LE and MY_CPU_BE are not defined, we don't know about ENDIANNESS of platform.
+
+MY_CPU_LE_UNALIGN means that CPU is LITTLE ENDIAN and CPU supports unaligned memory accesses.
+*/
+
+#if defined(_M_X64) \
+ || defined(_M_AMD64) \
+ || defined(__x86_64__) \
+ || defined(__AMD64__) \
+ || defined(__amd64__)
+ #define MY_CPU_AMD64
+ #ifdef __ILP32__
+ #define MY_CPU_NAME "x32"
+ #else
+ #define MY_CPU_NAME "x64"
+ #endif
+ #define MY_CPU_64BIT
+#endif
+
+
+#if defined(_M_IX86) \
+ || defined(__i386__)
+ #define MY_CPU_X86
+ #define MY_CPU_NAME "x86"
+ #define MY_CPU_32BIT
+#endif
+
+
+#if defined(_M_ARM64) \
+ || defined(__AARCH64EL__) \
+ || defined(__AARCH64EB__) \
+ || defined(__aarch64__)
+ #define MY_CPU_ARM64
+ #define MY_CPU_NAME "arm64"
+ #define MY_CPU_64BIT
+#endif
+
+
+#if defined(_M_ARM) \
+ || defined(_M_ARM_NT) \
+ || defined(_M_ARMT) \
+ || defined(__arm__) \
+ || defined(__thumb__) \
+ || defined(__ARMEL__) \
+ || defined(__ARMEB__) \
+ || defined(__THUMBEL__) \
+ || defined(__THUMBEB__)
+ #define MY_CPU_ARM
+ #define MY_CPU_NAME "arm"
+ #define MY_CPU_32BIT
+#endif
+
+
+#if defined(_M_IA64) \
+ || defined(__ia64__)
+ #define MY_CPU_IA64
+ #define MY_CPU_NAME "ia64"
+ #define MY_CPU_64BIT
+#endif
+
+
+#if defined(__mips64) \
+ || defined(__mips64__) \
+ || (defined(__mips) && (__mips == 64 || __mips == 4 || __mips == 3))
+ #define MY_CPU_NAME "mips64"
+ #define MY_CPU_64BIT
+#elif defined(__mips__)
+ #define MY_CPU_NAME "mips"
+ /* #define MY_CPU_32BIT */
+#endif
+
+
+#if defined(__ppc64__) \
+ || defined(__powerpc64__)
+ #ifdef __ILP32__
+ #define MY_CPU_NAME "ppc64-32"
+ #else
+ #define MY_CPU_NAME "ppc64"
+ #endif
+ #define MY_CPU_64BIT
+#elif defined(__ppc__) \
+ || defined(__powerpc__)
+ #define MY_CPU_NAME "ppc"
+ #define MY_CPU_32BIT
+#endif
+
+
+#if defined(__sparc64__)
+ #define MY_CPU_NAME "sparc64"
+ #define MY_CPU_64BIT
+#elif defined(__sparc__)
+ #define MY_CPU_NAME "sparc"
+ /* #define MY_CPU_32BIT */
+#endif
+
+
+#if defined(MY_CPU_X86) || defined(MY_CPU_AMD64)
+#define MY_CPU_X86_OR_AMD64
+#endif
+
+
+#ifdef _WIN32
+
+ #ifdef MY_CPU_ARM
+ #define MY_CPU_ARM_LE
+ #endif
+
+ #ifdef MY_CPU_ARM64
+ #define MY_CPU_ARM64_LE
+ #endif
+
+ #ifdef _M_IA64
+ #define MY_CPU_IA64_LE
+ #endif
+
+#endif
+
+
+#if defined(MY_CPU_X86_OR_AMD64) \
+ || defined(MY_CPU_ARM_LE) \
+ || defined(MY_CPU_ARM64_LE) \
+ || defined(MY_CPU_IA64_LE) \
+ || defined(__LITTLE_ENDIAN__) \
+ || defined(__ARMEL__) \
+ || defined(__THUMBEL__) \
+ || defined(__AARCH64EL__) \
+ || defined(__MIPSEL__) \
+ || defined(__MIPSEL) \
+ || defined(_MIPSEL) \
+ || defined(__BFIN__) \
+ || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__))
+ #define MY_CPU_LE
+#endif
+
+#if defined(__BIG_ENDIAN__) \
+ || defined(__ARMEB__) \
+ || defined(__THUMBEB__) \
+ || defined(__AARCH64EB__) \
+ || defined(__MIPSEB__) \
+ || defined(__MIPSEB) \
+ || defined(_MIPSEB) \
+ || defined(__m68k__) \
+ || defined(__s390__) \
+ || defined(__s390x__) \
+ || defined(__zarch__) \
+ || (defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__))
+ #define MY_CPU_BE
+#endif
+
+
+#if defined(MY_CPU_LE) && defined(MY_CPU_BE)
+ #error Stop_Compiling_Bad_Endian
+#endif
+
+
+#if defined(MY_CPU_32BIT) && defined(MY_CPU_64BIT)
+ #error Stop_Compiling_Bad_32_64_BIT
+#endif
+
+
+#ifndef MY_CPU_NAME
+ #ifdef MY_CPU_LE
+ #define MY_CPU_NAME "LE"
+ #elif defined(MY_CPU_BE)
+ #define MY_CPU_NAME "BE"
+ #else
+ /*
+ #define MY_CPU_NAME ""
+ */
+ #endif
+#endif
+
+
+
+
+
+#ifdef MY_CPU_LE
+ #if defined(MY_CPU_X86_OR_AMD64) \
+ || defined(MY_CPU_ARM64) \
+ || defined(__ARM_FEATURE_UNALIGNED)
+ #define MY_CPU_LE_UNALIGN
+ #endif
+#endif
+
+
+#ifdef MY_CPU_LE_UNALIGN
+
+#define GetUi16(p) (*(const UInt16 *)(const void *)(p))
+#define GetUi32(p) (*(const UInt32 *)(const void *)(p))
+#define GetUi64(p) (*(const UInt64 *)(const void *)(p))
+
+#define SetUi16(p, v) { *(UInt16 *)(p) = (v); }
+#define SetUi32(p, v) { *(UInt32 *)(p) = (v); }
+#define SetUi64(p, v) { *(UInt64 *)(p) = (v); }
+
+#else
+
+#define GetUi16(p) ( (UInt16) ( \
+ ((const Byte *)(p))[0] | \
+ ((UInt16)((const Byte *)(p))[1] << 8) ))
+
+#define GetUi32(p) ( \
+ ((const Byte *)(p))[0] | \
+ ((UInt32)((const Byte *)(p))[1] << 8) | \
+ ((UInt32)((const Byte *)(p))[2] << 16) | \
+ ((UInt32)((const Byte *)(p))[3] << 24))
+
+#define GetUi64(p) (GetUi32(p) | ((UInt64)GetUi32(((const Byte *)(p)) + 4) << 32))
+
+#define SetUi16(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
+ _ppp_[0] = (Byte)_vvv_; \
+ _ppp_[1] = (Byte)(_vvv_ >> 8); }
+
+#define SetUi32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
+ _ppp_[0] = (Byte)_vvv_; \
+ _ppp_[1] = (Byte)(_vvv_ >> 8); \
+ _ppp_[2] = (Byte)(_vvv_ >> 16); \
+ _ppp_[3] = (Byte)(_vvv_ >> 24); }
+
+#define SetUi64(p, v) { Byte *_ppp2_ = (Byte *)(p); UInt64 _vvv2_ = (v); \
+ SetUi32(_ppp2_ , (UInt32)_vvv2_); \
+ SetUi32(_ppp2_ + 4, (UInt32)(_vvv2_ >> 32)); }
+
+#endif
+
+#ifdef __has_builtin
+ #define MY__has_builtin(x) __has_builtin(x)
+#else
+ #define MY__has_builtin(x) 0
+#endif
+
+#if defined(MY_CPU_LE_UNALIGN) && /* defined(_WIN64) && */ (_MSC_VER >= 1300)
+
+/* Note: we use bswap instruction, that is unsupported in 386 cpu */
+
+#include <stdlib.h>
+
+#pragma intrinsic(_byteswap_ushort)
+#pragma intrinsic(_byteswap_ulong)
+#pragma intrinsic(_byteswap_uint64)
+
+/* #define GetBe16(p) _byteswap_ushort(*(const UInt16 *)(const Byte *)(p)) */
+#define GetBe32(p) _byteswap_ulong(*(const UInt32 *)(const Byte *)(p))
+#define GetBe64(p) _byteswap_uint64(*(const UInt64 *)(const Byte *)(p))
+
+#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = _byteswap_ulong(v)
+
+#elif defined(MY_CPU_LE_UNALIGN) && ( \
+ (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) \
+ || (defined(__clang__) && MY__has_builtin(__builtin_bswap16)) )
+
+/* #define GetBe16(p) __builtin_bswap16(*(const UInt16 *)(const Byte *)(p)) */
+#define GetBe32(p) __builtin_bswap32(*(const UInt32 *)(const Byte *)(p))
+#define GetBe64(p) __builtin_bswap64(*(const UInt64 *)(const Byte *)(p))
+
+#define SetBe32(p, v) (*(UInt32 *)(void *)(p)) = __builtin_bswap32(v)
+
+#else
+
+#define GetBe32(p) ( \
+ ((UInt32)((const Byte *)(p))[0] << 24) | \
+ ((UInt32)((const Byte *)(p))[1] << 16) | \
+ ((UInt32)((const Byte *)(p))[2] << 8) | \
+ ((const Byte *)(p))[3] )
+
+#define GetBe64(p) (((UInt64)GetBe32(p) << 32) | GetBe32(((const Byte *)(p)) + 4))
+
+#define SetBe32(p, v) { Byte *_ppp_ = (Byte *)(p); UInt32 _vvv_ = (v); \
+ _ppp_[0] = (Byte)(_vvv_ >> 24); \
+ _ppp_[1] = (Byte)(_vvv_ >> 16); \
+ _ppp_[2] = (Byte)(_vvv_ >> 8); \
+ _ppp_[3] = (Byte)_vvv_; }
+
+#endif
+
+
+#ifndef GetBe16
+
+#define GetBe16(p) ( (UInt16) ( \
+ ((UInt16)((const Byte *)(p))[0] << 8) | \
+ ((const Byte *)(p))[1] ))
+
+#endif
+
+
+
+#ifdef MY_CPU_X86_OR_AMD64
+
+typedef struct
+{
+ UInt32 maxFunc;
+ UInt32 vendor[3];
+ UInt32 ver;
+ UInt32 b;
+ UInt32 c;
+ UInt32 d;
+} Cx86cpuid;
+
+enum
+{
+ CPU_FIRM_INTEL,
+ CPU_FIRM_AMD,
+ CPU_FIRM_VIA
+};
+
+void MyCPUID(UInt32 function, UInt32 *a, UInt32 *b, UInt32 *c, UInt32 *d);
+
+Bool x86cpuid_CheckAndRead(Cx86cpuid *p);
+int x86cpuid_GetFirm(const Cx86cpuid *p);
+
+#define x86cpuid_GetFamily(ver) (((ver >> 16) & 0xFF0) | ((ver >> 8) & 0xF))
+#define x86cpuid_GetModel(ver) (((ver >> 12) & 0xF0) | ((ver >> 4) & 0xF))
+#define x86cpuid_GetStepping(ver) (ver & 0xF)
+
+Bool CPU_Is_InOrder();
+Bool CPU_Is_Aes_Supported();
+
+#endif
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Delta.c b/other-licenses/7zstub/src/C/Delta.c
new file mode 100644
index 0000000000..6cbbe46012
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Delta.c
@@ -0,0 +1,64 @@
+/* Delta.c -- Delta converter
+2009-05-26 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "Delta.h"
+
+void Delta_Init(Byte *state)
+{
+ unsigned i;
+ for (i = 0; i < DELTA_STATE_SIZE; i++)
+ state[i] = 0;
+}
+
+static void MyMemCpy(Byte *dest, const Byte *src, unsigned size)
+{
+ unsigned i;
+ for (i = 0; i < size; i++)
+ dest[i] = src[i];
+}
+
+void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size)
+{
+ Byte buf[DELTA_STATE_SIZE];
+ unsigned j = 0;
+ MyMemCpy(buf, state, delta);
+ {
+ SizeT i;
+ for (i = 0; i < size;)
+ {
+ for (j = 0; j < delta && i < size; i++, j++)
+ {
+ Byte b = data[i];
+ data[i] = (Byte)(b - buf[j]);
+ buf[j] = b;
+ }
+ }
+ }
+ if (j == delta)
+ j = 0;
+ MyMemCpy(state, buf + j, delta - j);
+ MyMemCpy(state + delta - j, buf, j);
+}
+
+void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size)
+{
+ Byte buf[DELTA_STATE_SIZE];
+ unsigned j = 0;
+ MyMemCpy(buf, state, delta);
+ {
+ SizeT i;
+ for (i = 0; i < size;)
+ {
+ for (j = 0; j < delta && i < size; i++, j++)
+ {
+ buf[j] = data[i] = (Byte)(buf[j] + data[i]);
+ }
+ }
+ }
+ if (j == delta)
+ j = 0;
+ MyMemCpy(state, buf + j, delta - j);
+ MyMemCpy(state + delta - j, buf, j);
+}
diff --git a/other-licenses/7zstub/src/C/Delta.h b/other-licenses/7zstub/src/C/Delta.h
new file mode 100644
index 0000000000..e59d5a252b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Delta.h
@@ -0,0 +1,19 @@
+/* Delta.h -- Delta converter
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __DELTA_H
+#define __DELTA_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define DELTA_STATE_SIZE 256
+
+void Delta_Init(Byte *state);
+void Delta_Encode(Byte *state, unsigned delta, Byte *data, SizeT size);
+void Delta_Decode(Byte *state, unsigned delta, Byte *data, SizeT size);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/DllSecur.c b/other-licenses/7zstub/src/C/DllSecur.c
new file mode 100644
index 0000000000..8745421aca
--- /dev/null
+++ b/other-licenses/7zstub/src/C/DllSecur.c
@@ -0,0 +1,87 @@
+/* DllSecur.c -- DLL loading security
+2016-10-04 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#ifdef _WIN32
+
+#include <windows.h>
+
+#include "DllSecur.h"
+
+#ifndef UNDER_CE
+
+typedef BOOL (WINAPI *Func_SetDefaultDllDirectories)(DWORD DirectoryFlags);
+
+#define MY_LOAD_LIBRARY_SEARCH_USER_DIRS 0x400
+#define MY_LOAD_LIBRARY_SEARCH_SYSTEM32 0x800
+
+static const char * const g_Dlls =
+ #ifndef _CONSOLE
+ "UXTHEME\0"
+ #endif
+ "USERENV\0"
+ "SETUPAPI\0"
+ "APPHELP\0"
+ "PROPSYS\0"
+ "DWMAPI\0"
+ "CRYPTBASE\0"
+ "OLEACC\0"
+ "CLBCATQ\0"
+ ;
+
+#endif
+
+void LoadSecurityDlls()
+{
+ #ifndef UNDER_CE
+
+ wchar_t buf[MAX_PATH + 100];
+
+ {
+ // at Vista (ver 6.0) : CoCreateInstance(CLSID_ShellLink, ...) doesn't work after SetDefaultDllDirectories() : Check it ???
+ OSVERSIONINFO vi;
+ vi.dwOSVersionInfoSize = sizeof(vi);
+ if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMinorVersion != 0)
+ {
+ Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
+ GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
+ if (setDllDirs)
+ if (setDllDirs(MY_LOAD_LIBRARY_SEARCH_SYSTEM32 | MY_LOAD_LIBRARY_SEARCH_USER_DIRS))
+ return;
+ }
+ }
+
+ {
+ unsigned len = GetSystemDirectoryW(buf, MAX_PATH + 2);
+ if (len == 0 || len > MAX_PATH)
+ return;
+ }
+ {
+ const char *dll;
+ unsigned pos = (unsigned)lstrlenW(buf);
+
+ if (buf[pos - 1] != '\\')
+ buf[pos++] = '\\';
+
+ for (dll = g_Dlls; dll[0] != 0;)
+ {
+ unsigned k = 0;
+ for (;;)
+ {
+ char c = *dll++;
+ buf[pos + k] = c;
+ k++;
+ if (c == 0)
+ break;
+ }
+
+ lstrcatW(buf, L".dll");
+ LoadLibraryExW(buf, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
+ }
+ }
+
+ #endif
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/DllSecur.h b/other-licenses/7zstub/src/C/DllSecur.h
new file mode 100644
index 0000000000..023c509602
--- /dev/null
+++ b/other-licenses/7zstub/src/C/DllSecur.h
@@ -0,0 +1,19 @@
+/* DllSecur.h -- DLL loading for security
+2016-06-08 : Igor Pavlov : Public domain */
+
+#ifndef __DLL_SECUR_H
+#define __DLL_SECUR_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#ifdef _WIN32
+
+void LoadSecurityDlls();
+
+#endif
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/LzFind.c b/other-licenses/7zstub/src/C/LzFind.c
new file mode 100644
index 0000000000..6ea82a9b53
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzFind.c
@@ -0,0 +1,1069 @@
+/* LzFind.c -- Match finder for LZ algorithms
+2017-06-10 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "LzFind.h"
+#include "LzHash.h"
+
+#define kEmptyHashValue 0
+#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
+#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
+#define kNormalizeMask (~(UInt32)(kNormalizeStepMin - 1))
+#define kMaxHistorySize ((UInt32)7 << 29)
+
+#define kStartMaxLen 3
+
+static void LzInWindow_Free(CMatchFinder *p, ISzAllocPtr alloc)
+{
+ if (!p->directInput)
+ {
+ ISzAlloc_Free(alloc, p->bufferBase);
+ p->bufferBase = NULL;
+ }
+}
+
+/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
+
+static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAllocPtr alloc)
+{
+ UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
+ if (p->directInput)
+ {
+ p->blockSize = blockSize;
+ return 1;
+ }
+ if (!p->bufferBase || p->blockSize != blockSize)
+ {
+ LzInWindow_Free(p, alloc);
+ p->blockSize = blockSize;
+ p->bufferBase = (Byte *)ISzAlloc_Alloc(alloc, (size_t)blockSize);
+ }
+ return (p->bufferBase != NULL);
+}
+
+Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
+
+UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
+
+void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
+{
+ p->posLimit -= subValue;
+ p->pos -= subValue;
+ p->streamPos -= subValue;
+}
+
+static void MatchFinder_ReadBlock(CMatchFinder *p)
+{
+ if (p->streamEndWasReached || p->result != SZ_OK)
+ return;
+
+ /* We use (p->streamPos - p->pos) value. (p->streamPos < p->pos) is allowed. */
+
+ if (p->directInput)
+ {
+ UInt32 curSize = 0xFFFFFFFF - (p->streamPos - p->pos);
+ if (curSize > p->directInputRem)
+ curSize = (UInt32)p->directInputRem;
+ p->directInputRem -= curSize;
+ p->streamPos += curSize;
+ if (p->directInputRem == 0)
+ p->streamEndWasReached = 1;
+ return;
+ }
+
+ for (;;)
+ {
+ Byte *dest = p->buffer + (p->streamPos - p->pos);
+ size_t size = (p->bufferBase + p->blockSize - dest);
+ if (size == 0)
+ return;
+
+ p->result = ISeqInStream_Read(p->stream, dest, &size);
+ if (p->result != SZ_OK)
+ return;
+ if (size == 0)
+ {
+ p->streamEndWasReached = 1;
+ return;
+ }
+ p->streamPos += (UInt32)size;
+ if (p->streamPos - p->pos > p->keepSizeAfter)
+ return;
+ }
+}
+
+void MatchFinder_MoveBlock(CMatchFinder *p)
+{
+ memmove(p->bufferBase,
+ p->buffer - p->keepSizeBefore,
+ (size_t)(p->streamPos - p->pos) + p->keepSizeBefore);
+ p->buffer = p->bufferBase + p->keepSizeBefore;
+}
+
+int MatchFinder_NeedMove(CMatchFinder *p)
+{
+ if (p->directInput)
+ return 0;
+ /* if (p->streamEndWasReached) return 0; */
+ return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
+}
+
+void MatchFinder_ReadIfRequired(CMatchFinder *p)
+{
+ if (p->streamEndWasReached)
+ return;
+ if (p->keepSizeAfter >= p->streamPos - p->pos)
+ MatchFinder_ReadBlock(p);
+}
+
+static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
+{
+ if (MatchFinder_NeedMove(p))
+ MatchFinder_MoveBlock(p);
+ MatchFinder_ReadBlock(p);
+}
+
+static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
+{
+ p->cutValue = 32;
+ p->btMode = 1;
+ p->numHashBytes = 4;
+ p->bigHash = 0;
+}
+
+#define kCrcPoly 0xEDB88320
+
+void MatchFinder_Construct(CMatchFinder *p)
+{
+ UInt32 i;
+ p->bufferBase = NULL;
+ p->directInput = 0;
+ p->hash = NULL;
+ p->expectedDataSize = (UInt64)(Int64)-1;
+ MatchFinder_SetDefaultSettings(p);
+
+ for (i = 0; i < 256; i++)
+ {
+ UInt32 r = i;
+ unsigned j;
+ for (j = 0; j < 8; j++)
+ r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
+ p->crc[i] = r;
+ }
+}
+
+static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->hash);
+ p->hash = NULL;
+}
+
+void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc)
+{
+ MatchFinder_FreeThisClassMemory(p, alloc);
+ LzInWindow_Free(p, alloc);
+}
+
+static CLzRef* AllocRefs(size_t num, ISzAllocPtr alloc)
+{
+ size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
+ if (sizeInBytes / sizeof(CLzRef) != num)
+ return NULL;
+ return (CLzRef *)ISzAlloc_Alloc(alloc, sizeInBytes);
+}
+
+int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
+ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
+ ISzAllocPtr alloc)
+{
+ UInt32 sizeReserv;
+
+ if (historySize > kMaxHistorySize)
+ {
+ MatchFinder_Free(p, alloc);
+ return 0;
+ }
+
+ sizeReserv = historySize >> 1;
+ if (historySize >= ((UInt32)3 << 30)) sizeReserv = historySize >> 3;
+ else if (historySize >= ((UInt32)2 << 30)) sizeReserv = historySize >> 2;
+
+ sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
+
+ p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
+ p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
+
+ /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
+
+ if (LzInWindow_Create(p, sizeReserv, alloc))
+ {
+ UInt32 newCyclicBufferSize = historySize + 1;
+ UInt32 hs;
+ p->matchMaxLen = matchMaxLen;
+ {
+ p->fixedHashSize = 0;
+ if (p->numHashBytes == 2)
+ hs = (1 << 16) - 1;
+ else
+ {
+ hs = historySize;
+ if (hs > p->expectedDataSize)
+ hs = (UInt32)p->expectedDataSize;
+ if (hs != 0)
+ hs--;
+ hs |= (hs >> 1);
+ hs |= (hs >> 2);
+ hs |= (hs >> 4);
+ hs |= (hs >> 8);
+ hs >>= 1;
+ hs |= 0xFFFF; /* don't change it! It's required for Deflate */
+ if (hs > (1 << 24))
+ {
+ if (p->numHashBytes == 3)
+ hs = (1 << 24) - 1;
+ else
+ hs >>= 1;
+ /* if (bigHash) mode, GetHeads4b() in LzFindMt.c needs (hs >= ((1 << 24) - 1))) */
+ }
+ }
+ p->hashMask = hs;
+ hs++;
+ if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
+ if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
+ if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
+ hs += p->fixedHashSize;
+ }
+
+ {
+ size_t newSize;
+ size_t numSons;
+ p->historySize = historySize;
+ p->hashSizeSum = hs;
+ p->cyclicBufferSize = newCyclicBufferSize;
+
+ numSons = newCyclicBufferSize;
+ if (p->btMode)
+ numSons <<= 1;
+ newSize = hs + numSons;
+
+ if (p->hash && p->numRefs == newSize)
+ return 1;
+
+ MatchFinder_FreeThisClassMemory(p, alloc);
+ p->numRefs = newSize;
+ p->hash = AllocRefs(newSize, alloc);
+
+ if (p->hash)
+ {
+ p->son = p->hash + p->hashSizeSum;
+ return 1;
+ }
+ }
+ }
+
+ MatchFinder_Free(p, alloc);
+ return 0;
+}
+
+static void MatchFinder_SetLimits(CMatchFinder *p)
+{
+ UInt32 limit = kMaxValForNormalize - p->pos;
+ UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
+
+ if (limit2 < limit)
+ limit = limit2;
+ limit2 = p->streamPos - p->pos;
+
+ if (limit2 <= p->keepSizeAfter)
+ {
+ if (limit2 > 0)
+ limit2 = 1;
+ }
+ else
+ limit2 -= p->keepSizeAfter;
+
+ if (limit2 < limit)
+ limit = limit2;
+
+ {
+ UInt32 lenLimit = p->streamPos - p->pos;
+ if (lenLimit > p->matchMaxLen)
+ lenLimit = p->matchMaxLen;
+ p->lenLimit = lenLimit;
+ }
+ p->posLimit = p->pos + limit;
+}
+
+
+void MatchFinder_Init_LowHash(CMatchFinder *p)
+{
+ size_t i;
+ CLzRef *items = p->hash;
+ size_t numItems = p->fixedHashSize;
+ for (i = 0; i < numItems; i++)
+ items[i] = kEmptyHashValue;
+}
+
+
+void MatchFinder_Init_HighHash(CMatchFinder *p)
+{
+ size_t i;
+ CLzRef *items = p->hash + p->fixedHashSize;
+ size_t numItems = (size_t)p->hashMask + 1;
+ for (i = 0; i < numItems; i++)
+ items[i] = kEmptyHashValue;
+}
+
+
+void MatchFinder_Init_3(CMatchFinder *p, int readData)
+{
+ p->cyclicBufferPos = 0;
+ p->buffer = p->bufferBase;
+ p->pos =
+ p->streamPos = p->cyclicBufferSize;
+ p->result = SZ_OK;
+ p->streamEndWasReached = 0;
+
+ if (readData)
+ MatchFinder_ReadBlock(p);
+
+ MatchFinder_SetLimits(p);
+}
+
+
+void MatchFinder_Init(CMatchFinder *p)
+{
+ MatchFinder_Init_HighHash(p);
+ MatchFinder_Init_LowHash(p);
+ MatchFinder_Init_3(p, True);
+}
+
+
+static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
+{
+ return (p->pos - p->historySize - 1) & kNormalizeMask;
+}
+
+void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems)
+{
+ size_t i;
+ for (i = 0; i < numItems; i++)
+ {
+ UInt32 value = items[i];
+ if (value <= subValue)
+ value = kEmptyHashValue;
+ else
+ value -= subValue;
+ items[i] = value;
+ }
+}
+
+static void MatchFinder_Normalize(CMatchFinder *p)
+{
+ UInt32 subValue = MatchFinder_GetSubValue(p);
+ MatchFinder_Normalize3(subValue, p->hash, p->numRefs);
+ MatchFinder_ReduceOffsets(p, subValue);
+}
+
+static void MatchFinder_CheckLimits(CMatchFinder *p)
+{
+ if (p->pos == kMaxValForNormalize)
+ MatchFinder_Normalize(p);
+ if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
+ MatchFinder_CheckAndMoveAndRead(p);
+ if (p->cyclicBufferPos == p->cyclicBufferSize)
+ p->cyclicBufferPos = 0;
+ MatchFinder_SetLimits(p);
+}
+
+static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
+ UInt32 *distances, UInt32 maxLen)
+{
+ son[_cyclicBufferPos] = curMatch;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ return distances;
+ {
+ const Byte *pb = cur - delta;
+ curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
+ if (pb[maxLen] == cur[maxLen] && *pb == *cur)
+ {
+ UInt32 len = 0;
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ if (maxLen < len)
+ {
+ *distances++ = maxLen = len;
+ *distances++ = delta - 1;
+ if (len == lenLimit)
+ return distances;
+ }
+ }
+ }
+ }
+}
+
+UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
+ UInt32 *distances, UInt32 maxLen)
+{
+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
+ UInt32 len0 = 0, len1 = 0;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ {
+ *ptr0 = *ptr1 = kEmptyHashValue;
+ return distances;
+ }
+ {
+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
+ const Byte *pb = cur - delta;
+ UInt32 len = (len0 < len1 ? len0 : len1);
+ if (pb[len] == cur[len])
+ {
+ if (++len != lenLimit && pb[len] == cur[len])
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ if (maxLen < len)
+ {
+ *distances++ = maxLen = len;
+ *distances++ = delta - 1;
+ if (len == lenLimit)
+ {
+ *ptr1 = pair[0];
+ *ptr0 = pair[1];
+ return distances;
+ }
+ }
+ }
+ if (pb[len] < cur[len])
+ {
+ *ptr1 = curMatch;
+ ptr1 = pair + 1;
+ curMatch = *ptr1;
+ len1 = len;
+ }
+ else
+ {
+ *ptr0 = curMatch;
+ ptr0 = pair;
+ curMatch = *ptr0;
+ len0 = len;
+ }
+ }
+ }
+}
+
+static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
+{
+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
+ UInt32 len0 = 0, len1 = 0;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ {
+ *ptr0 = *ptr1 = kEmptyHashValue;
+ return;
+ }
+ {
+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
+ const Byte *pb = cur - delta;
+ UInt32 len = (len0 < len1 ? len0 : len1);
+ if (pb[len] == cur[len])
+ {
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ {
+ if (len == lenLimit)
+ {
+ *ptr1 = pair[0];
+ *ptr0 = pair[1];
+ return;
+ }
+ }
+ }
+ if (pb[len] < cur[len])
+ {
+ *ptr1 = curMatch;
+ ptr1 = pair + 1;
+ curMatch = *ptr1;
+ len1 = len;
+ }
+ else
+ {
+ *ptr0 = curMatch;
+ ptr0 = pair;
+ curMatch = *ptr0;
+ len0 = len;
+ }
+ }
+ }
+}
+
+#define MOVE_POS \
+ ++p->cyclicBufferPos; \
+ p->buffer++; \
+ if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
+
+#define MOVE_POS_RET MOVE_POS return offset;
+
+static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
+
+#define GET_MATCHES_HEADER2(minLen, ret_op) \
+ UInt32 lenLimit; UInt32 hv; const Byte *cur; UInt32 curMatch; \
+ lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
+ cur = p->buffer;
+
+#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
+#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
+
+#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
+
+#define GET_MATCHES_FOOTER(offset, maxLen) \
+ offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
+ distances + offset, maxLen) - distances); MOVE_POS_RET;
+
+#define SKIP_FOOTER \
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
+
+#define UPDATE_maxLen { \
+ ptrdiff_t diff = (ptrdiff_t)0 - d2; \
+ const Byte *c = cur + maxLen; \
+ const Byte *lim = cur + lenLimit; \
+ for (; c != lim; c++) if (*(c + diff) != *c) break; \
+ maxLen = (UInt32)(c - cur); }
+
+static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 offset;
+ GET_MATCHES_HEADER(2)
+ HASH2_CALC;
+ curMatch = p->hash[hv];
+ p->hash[hv] = p->pos;
+ offset = 0;
+ GET_MATCHES_FOOTER(offset, 1)
+}
+
+UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 offset;
+ GET_MATCHES_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hv];
+ p->hash[hv] = p->pos;
+ offset = 0;
+ GET_MATCHES_FOOTER(offset, 2)
+}
+
+static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 h2, d2, maxLen, offset, pos;
+ UInt32 *hash;
+ GET_MATCHES_HEADER(3)
+
+ HASH3_CALC;
+
+ hash = p->hash;
+ pos = p->pos;
+
+ d2 = pos - hash[h2];
+
+ curMatch = (hash + kFix3HashSize)[hv];
+
+ hash[h2] = pos;
+ (hash + kFix3HashSize)[hv] = pos;
+
+ maxLen = 2;
+ offset = 0;
+
+ if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
+ {
+ UPDATE_maxLen
+ distances[0] = maxLen;
+ distances[1] = d2 - 1;
+ offset = 2;
+ if (maxLen == lenLimit)
+ {
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
+ MOVE_POS_RET;
+ }
+ }
+
+ GET_MATCHES_FOOTER(offset, maxLen)
+}
+
+static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 h2, h3, d2, d3, maxLen, offset, pos;
+ UInt32 *hash;
+ GET_MATCHES_HEADER(4)
+
+ HASH4_CALC;
+
+ hash = p->hash;
+ pos = p->pos;
+
+ d2 = pos - hash[ h2];
+ d3 = pos - (hash + kFix3HashSize)[h3];
+
+ curMatch = (hash + kFix4HashSize)[hv];
+
+ hash[ h2] = pos;
+ (hash + kFix3HashSize)[h3] = pos;
+ (hash + kFix4HashSize)[hv] = pos;
+
+ maxLen = 0;
+ offset = 0;
+
+ if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
+ {
+ distances[0] = maxLen = 2;
+ distances[1] = d2 - 1;
+ offset = 2;
+ }
+
+ if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
+ {
+ maxLen = 3;
+ distances[(size_t)offset + 1] = d3 - 1;
+ offset += 2;
+ d2 = d3;
+ }
+
+ if (offset != 0)
+ {
+ UPDATE_maxLen
+ distances[(size_t)offset - 2] = maxLen;
+ if (maxLen == lenLimit)
+ {
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
+ MOVE_POS_RET;
+ }
+ }
+
+ if (maxLen < 3)
+ maxLen = 3;
+
+ GET_MATCHES_FOOTER(offset, maxLen)
+}
+
+/*
+static UInt32 Bt5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos;
+ UInt32 *hash;
+ GET_MATCHES_HEADER(5)
+
+ HASH5_CALC;
+
+ hash = p->hash;
+ pos = p->pos;
+
+ d2 = pos - hash[ h2];
+ d3 = pos - (hash + kFix3HashSize)[h3];
+ d4 = pos - (hash + kFix4HashSize)[h4];
+
+ curMatch = (hash + kFix5HashSize)[hv];
+
+ hash[ h2] = pos;
+ (hash + kFix3HashSize)[h3] = pos;
+ (hash + kFix4HashSize)[h4] = pos;
+ (hash + kFix5HashSize)[hv] = pos;
+
+ maxLen = 0;
+ offset = 0;
+
+ if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
+ {
+ distances[0] = maxLen = 2;
+ distances[1] = d2 - 1;
+ offset = 2;
+ if (*(cur - d2 + 2) == cur[2])
+ distances[0] = maxLen = 3;
+ else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
+ {
+ distances[2] = maxLen = 3;
+ distances[3] = d3 - 1;
+ offset = 4;
+ d2 = d3;
+ }
+ }
+ else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
+ {
+ distances[0] = maxLen = 3;
+ distances[1] = d3 - 1;
+ offset = 2;
+ d2 = d3;
+ }
+
+ if (d2 != d4 && d4 < p->cyclicBufferSize
+ && *(cur - d4) == *cur
+ && *(cur - d4 + 3) == *(cur + 3))
+ {
+ maxLen = 4;
+ distances[(size_t)offset + 1] = d4 - 1;
+ offset += 2;
+ d2 = d4;
+ }
+
+ if (offset != 0)
+ {
+ UPDATE_maxLen
+ distances[(size_t)offset - 2] = maxLen;
+ if (maxLen == lenLimit)
+ {
+ SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
+ MOVE_POS_RET;
+ }
+ }
+
+ if (maxLen < 4)
+ maxLen = 4;
+
+ GET_MATCHES_FOOTER(offset, maxLen)
+}
+*/
+
+static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 h2, h3, d2, d3, maxLen, offset, pos;
+ UInt32 *hash;
+ GET_MATCHES_HEADER(4)
+
+ HASH4_CALC;
+
+ hash = p->hash;
+ pos = p->pos;
+
+ d2 = pos - hash[ h2];
+ d3 = pos - (hash + kFix3HashSize)[h3];
+
+ curMatch = (hash + kFix4HashSize)[hv];
+
+ hash[ h2] = pos;
+ (hash + kFix3HashSize)[h3] = pos;
+ (hash + kFix4HashSize)[hv] = pos;
+
+ maxLen = 0;
+ offset = 0;
+
+ if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
+ {
+ distances[0] = maxLen = 2;
+ distances[1] = d2 - 1;
+ offset = 2;
+ }
+
+ if (d2 != d3 && d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
+ {
+ maxLen = 3;
+ distances[(size_t)offset + 1] = d3 - 1;
+ offset += 2;
+ d2 = d3;
+ }
+
+ if (offset != 0)
+ {
+ UPDATE_maxLen
+ distances[(size_t)offset - 2] = maxLen;
+ if (maxLen == lenLimit)
+ {
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS_RET;
+ }
+ }
+
+ if (maxLen < 3)
+ maxLen = 3;
+
+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
+ distances + offset, maxLen) - (distances));
+ MOVE_POS_RET
+}
+
+/*
+static UInt32 Hc5_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 h2, h3, h4, d2, d3, d4, maxLen, offset, pos
+ UInt32 *hash;
+ GET_MATCHES_HEADER(5)
+
+ HASH5_CALC;
+
+ hash = p->hash;
+ pos = p->pos;
+
+ d2 = pos - hash[ h2];
+ d3 = pos - (hash + kFix3HashSize)[h3];
+ d4 = pos - (hash + kFix4HashSize)[h4];
+
+ curMatch = (hash + kFix5HashSize)[hv];
+
+ hash[ h2] = pos;
+ (hash + kFix3HashSize)[h3] = pos;
+ (hash + kFix4HashSize)[h4] = pos;
+ (hash + kFix5HashSize)[hv] = pos;
+
+ maxLen = 0;
+ offset = 0;
+
+ if (d2 < p->cyclicBufferSize && *(cur - d2) == *cur)
+ {
+ distances[0] = maxLen = 2;
+ distances[1] = d2 - 1;
+ offset = 2;
+ if (*(cur - d2 + 2) == cur[2])
+ distances[0] = maxLen = 3;
+ else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
+ {
+ distances[2] = maxLen = 3;
+ distances[3] = d3 - 1;
+ offset = 4;
+ d2 = d3;
+ }
+ }
+ else if (d3 < p->cyclicBufferSize && *(cur - d3) == *cur)
+ {
+ distances[0] = maxLen = 3;
+ distances[1] = d3 - 1;
+ offset = 2;
+ d2 = d3;
+ }
+
+ if (d2 != d4 && d4 < p->cyclicBufferSize
+ && *(cur - d4) == *cur
+ && *(cur - d4 + 3) == *(cur + 3))
+ {
+ maxLen = 4;
+ distances[(size_t)offset + 1] = d4 - 1;
+ offset += 2;
+ d2 = d4;
+ }
+
+ if (offset != 0)
+ {
+ UPDATE_maxLen
+ distances[(size_t)offset - 2] = maxLen;
+ if (maxLen == lenLimit)
+ {
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS_RET;
+ }
+ }
+
+ if (maxLen < 4)
+ maxLen = 4;
+
+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
+ distances + offset, maxLen) - (distances));
+ MOVE_POS_RET
+}
+*/
+
+UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
+{
+ UInt32 offset;
+ GET_MATCHES_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hv];
+ p->hash[hv] = p->pos;
+ offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
+ distances, 2) - (distances));
+ MOVE_POS_RET
+}
+
+static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ SKIP_HEADER(2)
+ HASH2_CALC;
+ curMatch = p->hash[hv];
+ p->hash[hv] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ SKIP_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hv];
+ p->hash[hv] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 h2;
+ UInt32 *hash;
+ SKIP_HEADER(3)
+ HASH3_CALC;
+ hash = p->hash;
+ curMatch = (hash + kFix3HashSize)[hv];
+ hash[h2] =
+ (hash + kFix3HashSize)[hv] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 h2, h3;
+ UInt32 *hash;
+ SKIP_HEADER(4)
+ HASH4_CALC;
+ hash = p->hash;
+ curMatch = (hash + kFix4HashSize)[hv];
+ hash[ h2] =
+ (hash + kFix3HashSize)[h3] =
+ (hash + kFix4HashSize)[hv] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+
+/*
+static void Bt5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 h2, h3, h4;
+ UInt32 *hash;
+ SKIP_HEADER(5)
+ HASH5_CALC;
+ hash = p->hash;
+ curMatch = (hash + kFix5HashSize)[hv];
+ hash[ h2] =
+ (hash + kFix3HashSize)[h3] =
+ (hash + kFix4HashSize)[h4] =
+ (hash + kFix5HashSize)[hv] = p->pos;
+ SKIP_FOOTER
+ }
+ while (--num != 0);
+}
+*/
+
+static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 h2, h3;
+ UInt32 *hash;
+ SKIP_HEADER(4)
+ HASH4_CALC;
+ hash = p->hash;
+ curMatch = (hash + kFix4HashSize)[hv];
+ hash[ h2] =
+ (hash + kFix3HashSize)[h3] =
+ (hash + kFix4HashSize)[hv] = p->pos;
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS
+ }
+ while (--num != 0);
+}
+
+/*
+static void Hc5_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ UInt32 h2, h3, h4;
+ UInt32 *hash;
+ SKIP_HEADER(5)
+ HASH5_CALC;
+ hash = p->hash;
+ curMatch = hash + kFix5HashSize)[hv];
+ hash[ h2] =
+ (hash + kFix3HashSize)[h3] =
+ (hash + kFix4HashSize)[h4] =
+ (hash + kFix5HashSize)[hv] = p->pos;
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS
+ }
+ while (--num != 0);
+}
+*/
+
+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
+{
+ do
+ {
+ SKIP_HEADER(3)
+ HASH_ZIP_CALC;
+ curMatch = p->hash[hv];
+ p->hash[hv] = p->pos;
+ p->son[p->cyclicBufferPos] = curMatch;
+ MOVE_POS
+ }
+ while (--num != 0);
+}
+
+void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
+{
+ vTable->Init = (Mf_Init_Func)MatchFinder_Init;
+ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
+ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
+ if (!p->btMode)
+ {
+ /* if (p->numHashBytes <= 4) */
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
+ }
+ /*
+ else
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Hc5_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Hc5_MatchFinder_Skip;
+ }
+ */
+ }
+ else if (p->numHashBytes == 2)
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
+ }
+ else if (p->numHashBytes == 3)
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
+ }
+ else /* if (p->numHashBytes == 4) */
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
+ }
+ /*
+ else
+ {
+ vTable->GetMatches = (Mf_GetMatches_Func)Bt5_MatchFinder_GetMatches;
+ vTable->Skip = (Mf_Skip_Func)Bt5_MatchFinder_Skip;
+ }
+ */
+}
diff --git a/other-licenses/7zstub/src/C/LzFind.h b/other-licenses/7zstub/src/C/LzFind.h
new file mode 100644
index 0000000000..c77added7b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzFind.h
@@ -0,0 +1,121 @@
+/* LzFind.h -- Match finder for LZ algorithms
+2017-06-10 : Igor Pavlov : Public domain */
+
+#ifndef __LZ_FIND_H
+#define __LZ_FIND_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+typedef UInt32 CLzRef;
+
+typedef struct _CMatchFinder
+{
+ Byte *buffer;
+ UInt32 pos;
+ UInt32 posLimit;
+ UInt32 streamPos;
+ UInt32 lenLimit;
+
+ UInt32 cyclicBufferPos;
+ UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
+
+ Byte streamEndWasReached;
+ Byte btMode;
+ Byte bigHash;
+ Byte directInput;
+
+ UInt32 matchMaxLen;
+ CLzRef *hash;
+ CLzRef *son;
+ UInt32 hashMask;
+ UInt32 cutValue;
+
+ Byte *bufferBase;
+ ISeqInStream *stream;
+
+ UInt32 blockSize;
+ UInt32 keepSizeBefore;
+ UInt32 keepSizeAfter;
+
+ UInt32 numHashBytes;
+ size_t directInputRem;
+ UInt32 historySize;
+ UInt32 fixedHashSize;
+ UInt32 hashSizeSum;
+ SRes result;
+ UInt32 crc[256];
+ size_t numRefs;
+
+ UInt64 expectedDataSize;
+} CMatchFinder;
+
+#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
+
+#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
+
+#define Inline_MatchFinder_IsFinishedOK(p) \
+ ((p)->streamEndWasReached \
+ && (p)->streamPos == (p)->pos \
+ && (!(p)->directInput || (p)->directInputRem == 0))
+
+int MatchFinder_NeedMove(CMatchFinder *p);
+Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
+void MatchFinder_MoveBlock(CMatchFinder *p);
+void MatchFinder_ReadIfRequired(CMatchFinder *p);
+
+void MatchFinder_Construct(CMatchFinder *p);
+
+/* Conditions:
+ historySize <= 3 GB
+ keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
+*/
+int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
+ UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
+ ISzAllocPtr alloc);
+void MatchFinder_Free(CMatchFinder *p, ISzAllocPtr alloc);
+void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, size_t numItems);
+void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
+
+UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
+ UInt32 *distances, UInt32 maxLen);
+
+/*
+Conditions:
+ Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
+ Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
+*/
+
+typedef void (*Mf_Init_Func)(void *object);
+typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
+typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
+typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
+typedef void (*Mf_Skip_Func)(void *object, UInt32);
+
+typedef struct _IMatchFinder
+{
+ Mf_Init_Func Init;
+ Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
+ Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
+ Mf_GetMatches_Func GetMatches;
+ Mf_Skip_Func Skip;
+} IMatchFinder;
+
+void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
+
+void MatchFinder_Init_LowHash(CMatchFinder *p);
+void MatchFinder_Init_HighHash(CMatchFinder *p);
+void MatchFinder_Init_3(CMatchFinder *p, int readData);
+void MatchFinder_Init(CMatchFinder *p);
+
+UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
+UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
+
+void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
+void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/LzFindMt.c b/other-licenses/7zstub/src/C/LzFindMt.c
new file mode 100644
index 0000000000..2563824fcd
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzFindMt.c
@@ -0,0 +1,820 @@
+/* LzFindMt.c -- multithreaded Match finder for LZ algorithms
+2017-06-10 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "LzHash.h"
+
+#include "LzFindMt.h"
+
+static void MtSync_Construct(CMtSync *p)
+{
+ p->wasCreated = False;
+ p->csWasInitialized = False;
+ p->csWasEntered = False;
+ Thread_Construct(&p->thread);
+ Event_Construct(&p->canStart);
+ Event_Construct(&p->wasStarted);
+ Event_Construct(&p->wasStopped);
+ Semaphore_Construct(&p->freeSemaphore);
+ Semaphore_Construct(&p->filledSemaphore);
+}
+
+static void MtSync_GetNextBlock(CMtSync *p)
+{
+ if (p->needStart)
+ {
+ p->numProcessedBlocks = 1;
+ p->needStart = False;
+ p->stopWriting = False;
+ p->exit = False;
+ Event_Reset(&p->wasStarted);
+ Event_Reset(&p->wasStopped);
+
+ Event_Set(&p->canStart);
+ Event_Wait(&p->wasStarted);
+
+ // if (mt) MatchFinder_Init_LowHash(mt->MatchFinder);
+ }
+ else
+ {
+ CriticalSection_Leave(&p->cs);
+ p->csWasEntered = False;
+ p->numProcessedBlocks++;
+ Semaphore_Release1(&p->freeSemaphore);
+ }
+ Semaphore_Wait(&p->filledSemaphore);
+ CriticalSection_Enter(&p->cs);
+ p->csWasEntered = True;
+}
+
+/* MtSync_StopWriting must be called if Writing was started */
+
+static void MtSync_StopWriting(CMtSync *p)
+{
+ UInt32 myNumBlocks = p->numProcessedBlocks;
+ if (!Thread_WasCreated(&p->thread) || p->needStart)
+ return;
+ p->stopWriting = True;
+ if (p->csWasEntered)
+ {
+ CriticalSection_Leave(&p->cs);
+ p->csWasEntered = False;
+ }
+ Semaphore_Release1(&p->freeSemaphore);
+
+ Event_Wait(&p->wasStopped);
+
+ while (myNumBlocks++ != p->numProcessedBlocks)
+ {
+ Semaphore_Wait(&p->filledSemaphore);
+ Semaphore_Release1(&p->freeSemaphore);
+ }
+ p->needStart = True;
+}
+
+static void MtSync_Destruct(CMtSync *p)
+{
+ if (Thread_WasCreated(&p->thread))
+ {
+ MtSync_StopWriting(p);
+ p->exit = True;
+ if (p->needStart)
+ Event_Set(&p->canStart);
+ Thread_Wait(&p->thread);
+ Thread_Close(&p->thread);
+ }
+ if (p->csWasInitialized)
+ {
+ CriticalSection_Delete(&p->cs);
+ p->csWasInitialized = False;
+ }
+
+ Event_Close(&p->canStart);
+ Event_Close(&p->wasStarted);
+ Event_Close(&p->wasStopped);
+ Semaphore_Close(&p->freeSemaphore);
+ Semaphore_Close(&p->filledSemaphore);
+
+ p->wasCreated = False;
+}
+
+#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
+
+static SRes MtSync_Create2(CMtSync *p, THREAD_FUNC_TYPE startAddress, void *obj, UInt32 numBlocks)
+{
+ if (p->wasCreated)
+ return SZ_OK;
+
+ RINOK_THREAD(CriticalSection_Init(&p->cs));
+ p->csWasInitialized = True;
+
+ RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->canStart));
+ RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStarted));
+ RINOK_THREAD(AutoResetEvent_CreateNotSignaled(&p->wasStopped));
+
+ RINOK_THREAD(Semaphore_Create(&p->freeSemaphore, numBlocks, numBlocks));
+ RINOK_THREAD(Semaphore_Create(&p->filledSemaphore, 0, numBlocks));
+
+ p->needStart = True;
+
+ RINOK_THREAD(Thread_Create(&p->thread, startAddress, obj));
+ p->wasCreated = True;
+ return SZ_OK;
+}
+
+static SRes MtSync_Create(CMtSync *p, THREAD_FUNC_TYPE startAddress, void *obj, UInt32 numBlocks)
+{
+ SRes res = MtSync_Create2(p, startAddress, obj, numBlocks);
+ if (res != SZ_OK)
+ MtSync_Destruct(p);
+ return res;
+}
+
+void MtSync_Init(CMtSync *p) { p->needStart = True; }
+
+#define kMtMaxValForNormalize 0xFFFFFFFF
+
+#define DEF_GetHeads2(name, v, action) \
+ static void GetHeads ## name(const Byte *p, UInt32 pos, \
+ UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc) \
+ { action; for (; numHeads != 0; numHeads--) { \
+ const UInt32 value = (v); p++; *heads++ = pos - hash[value]; hash[value] = pos++; } }
+
+#define DEF_GetHeads(name, v) DEF_GetHeads2(name, v, ;)
+
+DEF_GetHeads2(2, (p[0] | ((UInt32)p[1] << 8)), UNUSED_VAR(hashMask); UNUSED_VAR(crc); )
+DEF_GetHeads(3, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8)) & hashMask)
+DEF_GetHeads(4, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5)) & hashMask)
+DEF_GetHeads(4b, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ ((UInt32)p[3] << 16)) & hashMask)
+/* DEF_GetHeads(5, (crc[p[0]] ^ p[1] ^ ((UInt32)p[2] << 8) ^ (crc[p[3]] << 5) ^ (crc[p[4]] << 3)) & hashMask) */
+
+static void HashThreadFunc(CMatchFinderMt *mt)
+{
+ CMtSync *p = &mt->hashSync;
+ for (;;)
+ {
+ UInt32 numProcessedBlocks = 0;
+ Event_Wait(&p->canStart);
+ Event_Set(&p->wasStarted);
+
+ MatchFinder_Init_HighHash(mt->MatchFinder);
+
+ for (;;)
+ {
+ if (p->exit)
+ return;
+ if (p->stopWriting)
+ {
+ p->numProcessedBlocks = numProcessedBlocks;
+ Event_Set(&p->wasStopped);
+ break;
+ }
+
+ {
+ CMatchFinder *mf = mt->MatchFinder;
+ if (MatchFinder_NeedMove(mf))
+ {
+ CriticalSection_Enter(&mt->btSync.cs);
+ CriticalSection_Enter(&mt->hashSync.cs);
+ {
+ const Byte *beforePtr = Inline_MatchFinder_GetPointerToCurrentPos(mf);
+ ptrdiff_t offset;
+ MatchFinder_MoveBlock(mf);
+ offset = beforePtr - Inline_MatchFinder_GetPointerToCurrentPos(mf);
+ mt->pointerToCurPos -= offset;
+ mt->buffer -= offset;
+ }
+ CriticalSection_Leave(&mt->btSync.cs);
+ CriticalSection_Leave(&mt->hashSync.cs);
+ continue;
+ }
+
+ Semaphore_Wait(&p->freeSemaphore);
+
+ MatchFinder_ReadIfRequired(mf);
+ if (mf->pos > (kMtMaxValForNormalize - kMtHashBlockSize))
+ {
+ UInt32 subValue = (mf->pos - mf->historySize - 1);
+ MatchFinder_ReduceOffsets(mf, subValue);
+ MatchFinder_Normalize3(subValue, mf->hash + mf->fixedHashSize, (size_t)mf->hashMask + 1);
+ }
+ {
+ UInt32 *heads = mt->hashBuf + ((numProcessedBlocks++) & kMtHashNumBlocksMask) * kMtHashBlockSize;
+ UInt32 num = mf->streamPos - mf->pos;
+ heads[0] = 2;
+ heads[1] = num;
+ if (num >= mf->numHashBytes)
+ {
+ num = num - mf->numHashBytes + 1;
+ if (num > kMtHashBlockSize - 2)
+ num = kMtHashBlockSize - 2;
+ mt->GetHeadsFunc(mf->buffer, mf->pos, mf->hash + mf->fixedHashSize, mf->hashMask, heads + 2, num, mf->crc);
+ heads[0] = 2 + num;
+ }
+ mf->pos += num;
+ mf->buffer += num;
+ }
+ }
+
+ Semaphore_Release1(&p->filledSemaphore);
+ }
+ }
+}
+
+static void MatchFinderMt_GetNextBlock_Hash(CMatchFinderMt *p)
+{
+ MtSync_GetNextBlock(&p->hashSync);
+ p->hashBufPosLimit = p->hashBufPos = ((p->hashSync.numProcessedBlocks - 1) & kMtHashNumBlocksMask) * kMtHashBlockSize;
+ p->hashBufPosLimit += p->hashBuf[p->hashBufPos++];
+ p->hashNumAvail = p->hashBuf[p->hashBufPos++];
+}
+
+#define kEmptyHashValue 0
+
+/* #define MFMT_GM_INLINE */
+
+#ifdef MFMT_GM_INLINE
+
+#define NO_INLINE MY_FAST_CALL
+
+static Int32 NO_INLINE GetMatchesSpecN(UInt32 lenLimit, UInt32 pos, const Byte *cur, CLzRef *son,
+ UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
+ UInt32 *_distances, UInt32 _maxLen, const UInt32 *hash, Int32 limit, UInt32 size, UInt32 *posRes)
+{
+ do
+ {
+ UInt32 *distances = _distances + 1;
+ UInt32 curMatch = pos - *hash++;
+
+ CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
+ CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
+ UInt32 len0 = 0, len1 = 0;
+ UInt32 cutValue = _cutValue;
+ UInt32 maxLen = _maxLen;
+ for (;;)
+ {
+ UInt32 delta = pos - curMatch;
+ if (cutValue-- == 0 || delta >= _cyclicBufferSize)
+ {
+ *ptr0 = *ptr1 = kEmptyHashValue;
+ break;
+ }
+ {
+ CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
+ const Byte *pb = cur - delta;
+ UInt32 len = (len0 < len1 ? len0 : len1);
+ if (pb[len] == cur[len])
+ {
+ if (++len != lenLimit && pb[len] == cur[len])
+ while (++len != lenLimit)
+ if (pb[len] != cur[len])
+ break;
+ if (maxLen < len)
+ {
+ *distances++ = maxLen = len;
+ *distances++ = delta - 1;
+ if (len == lenLimit)
+ {
+ *ptr1 = pair[0];
+ *ptr0 = pair[1];
+ break;
+ }
+ }
+ }
+ if (pb[len] < cur[len])
+ {
+ *ptr1 = curMatch;
+ ptr1 = pair + 1;
+ curMatch = *ptr1;
+ len1 = len;
+ }
+ else
+ {
+ *ptr0 = curMatch;
+ ptr0 = pair;
+ curMatch = *ptr0;
+ len0 = len;
+ }
+ }
+ }
+ pos++;
+ _cyclicBufferPos++;
+ cur++;
+ {
+ UInt32 num = (UInt32)(distances - _distances);
+ *_distances = num - 1;
+ _distances += num;
+ limit -= num;
+ }
+ }
+ while (limit > 0 && --size != 0);
+ *posRes = pos;
+ return limit;
+}
+
+#endif
+
+static void BtGetMatches(CMatchFinderMt *p, UInt32 *distances)
+{
+ UInt32 numProcessed = 0;
+ UInt32 curPos = 2;
+ UInt32 limit = kMtBtBlockSize - (p->matchMaxLen * 2);
+
+ distances[1] = p->hashNumAvail;
+
+ while (curPos < limit)
+ {
+ if (p->hashBufPos == p->hashBufPosLimit)
+ {
+ MatchFinderMt_GetNextBlock_Hash(p);
+ distances[1] = numProcessed + p->hashNumAvail;
+ if (p->hashNumAvail >= p->numHashBytes)
+ continue;
+ distances[0] = curPos + p->hashNumAvail;
+ distances += curPos;
+ for (; p->hashNumAvail != 0; p->hashNumAvail--)
+ *distances++ = 0;
+ return;
+ }
+ {
+ UInt32 size = p->hashBufPosLimit - p->hashBufPos;
+ UInt32 lenLimit = p->matchMaxLen;
+ UInt32 pos = p->pos;
+ UInt32 cyclicBufferPos = p->cyclicBufferPos;
+ if (lenLimit >= p->hashNumAvail)
+ lenLimit = p->hashNumAvail;
+ {
+ UInt32 size2 = p->hashNumAvail - lenLimit + 1;
+ if (size2 < size)
+ size = size2;
+ size2 = p->cyclicBufferSize - cyclicBufferPos;
+ if (size2 < size)
+ size = size2;
+ }
+
+ #ifndef MFMT_GM_INLINE
+ while (curPos < limit && size-- != 0)
+ {
+ UInt32 *startDistances = distances + curPos;
+ UInt32 num = (UInt32)(GetMatchesSpec1(lenLimit, pos - p->hashBuf[p->hashBufPos++],
+ pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue,
+ startDistances + 1, p->numHashBytes - 1) - startDistances);
+ *startDistances = num - 1;
+ curPos += num;
+ cyclicBufferPos++;
+ pos++;
+ p->buffer++;
+ }
+ #else
+ {
+ UInt32 posRes;
+ curPos = limit - GetMatchesSpecN(lenLimit, pos, p->buffer, p->son, cyclicBufferPos, p->cyclicBufferSize, p->cutValue,
+ distances + curPos, p->numHashBytes - 1, p->hashBuf + p->hashBufPos, (Int32)(limit - curPos), size, &posRes);
+ p->hashBufPos += posRes - pos;
+ cyclicBufferPos += posRes - pos;
+ p->buffer += posRes - pos;
+ pos = posRes;
+ }
+ #endif
+
+ numProcessed += pos - p->pos;
+ p->hashNumAvail -= pos - p->pos;
+ p->pos = pos;
+ if (cyclicBufferPos == p->cyclicBufferSize)
+ cyclicBufferPos = 0;
+ p->cyclicBufferPos = cyclicBufferPos;
+ }
+ }
+
+ distances[0] = curPos;
+}
+
+static void BtFillBlock(CMatchFinderMt *p, UInt32 globalBlockIndex)
+{
+ CMtSync *sync = &p->hashSync;
+ if (!sync->needStart)
+ {
+ CriticalSection_Enter(&sync->cs);
+ sync->csWasEntered = True;
+ }
+
+ BtGetMatches(p, p->btBuf + (globalBlockIndex & kMtBtNumBlocksMask) * kMtBtBlockSize);
+
+ if (p->pos > kMtMaxValForNormalize - kMtBtBlockSize)
+ {
+ UInt32 subValue = p->pos - p->cyclicBufferSize;
+ MatchFinder_Normalize3(subValue, p->son, (size_t)p->cyclicBufferSize * 2);
+ p->pos -= subValue;
+ }
+
+ if (!sync->needStart)
+ {
+ CriticalSection_Leave(&sync->cs);
+ sync->csWasEntered = False;
+ }
+}
+
+void BtThreadFunc(CMatchFinderMt *mt)
+{
+ CMtSync *p = &mt->btSync;
+ for (;;)
+ {
+ UInt32 blockIndex = 0;
+ Event_Wait(&p->canStart);
+ Event_Set(&p->wasStarted);
+ for (;;)
+ {
+ if (p->exit)
+ return;
+ if (p->stopWriting)
+ {
+ p->numProcessedBlocks = blockIndex;
+ MtSync_StopWriting(&mt->hashSync);
+ Event_Set(&p->wasStopped);
+ break;
+ }
+ Semaphore_Wait(&p->freeSemaphore);
+ BtFillBlock(mt, blockIndex++);
+ Semaphore_Release1(&p->filledSemaphore);
+ }
+ }
+}
+
+void MatchFinderMt_Construct(CMatchFinderMt *p)
+{
+ p->hashBuf = NULL;
+ MtSync_Construct(&p->hashSync);
+ MtSync_Construct(&p->btSync);
+}
+
+static void MatchFinderMt_FreeMem(CMatchFinderMt *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->hashBuf);
+ p->hashBuf = NULL;
+}
+
+void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAllocPtr alloc)
+{
+ MtSync_Destruct(&p->hashSync);
+ MtSync_Destruct(&p->btSync);
+ MatchFinderMt_FreeMem(p, alloc);
+}
+
+#define kHashBufferSize (kMtHashBlockSize * kMtHashNumBlocks)
+#define kBtBufferSize (kMtBtBlockSize * kMtBtNumBlocks)
+
+static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE HashThreadFunc2(void *p) { HashThreadFunc((CMatchFinderMt *)p); return 0; }
+static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE BtThreadFunc2(void *p)
+{
+ Byte allocaDummy[0x180];
+ unsigned i = 0;
+ for (i = 0; i < 16; i++)
+ allocaDummy[i] = (Byte)0;
+ if (allocaDummy[0] == 0)
+ BtThreadFunc((CMatchFinderMt *)p);
+ return 0;
+}
+
+SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,
+ UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc)
+{
+ CMatchFinder *mf = p->MatchFinder;
+ p->historySize = historySize;
+ if (kMtBtBlockSize <= matchMaxLen * 4)
+ return SZ_ERROR_PARAM;
+ if (!p->hashBuf)
+ {
+ p->hashBuf = (UInt32 *)ISzAlloc_Alloc(alloc, (kHashBufferSize + kBtBufferSize) * sizeof(UInt32));
+ if (!p->hashBuf)
+ return SZ_ERROR_MEM;
+ p->btBuf = p->hashBuf + kHashBufferSize;
+ }
+ keepAddBufferBefore += (kHashBufferSize + kBtBufferSize);
+ keepAddBufferAfter += kMtHashBlockSize;
+ if (!MatchFinder_Create(mf, historySize, keepAddBufferBefore, matchMaxLen, keepAddBufferAfter, alloc))
+ return SZ_ERROR_MEM;
+
+ RINOK(MtSync_Create(&p->hashSync, HashThreadFunc2, p, kMtHashNumBlocks));
+ RINOK(MtSync_Create(&p->btSync, BtThreadFunc2, p, kMtBtNumBlocks));
+ return SZ_OK;
+}
+
+/* Call it after ReleaseStream / SetStream */
+static void MatchFinderMt_Init(CMatchFinderMt *p)
+{
+ CMatchFinder *mf = p->MatchFinder;
+
+ p->btBufPos =
+ p->btBufPosLimit = 0;
+ p->hashBufPos =
+ p->hashBufPosLimit = 0;
+
+ /* Init without data reading. We don't want to read data in this thread */
+ MatchFinder_Init_3(mf, False);
+ MatchFinder_Init_LowHash(mf);
+
+ p->pointerToCurPos = Inline_MatchFinder_GetPointerToCurrentPos(mf);
+ p->btNumAvailBytes = 0;
+ p->lzPos = p->historySize + 1;
+
+ p->hash = mf->hash;
+ p->fixedHashSize = mf->fixedHashSize;
+ p->crc = mf->crc;
+
+ p->son = mf->son;
+ p->matchMaxLen = mf->matchMaxLen;
+ p->numHashBytes = mf->numHashBytes;
+ p->pos = mf->pos;
+ p->buffer = mf->buffer;
+ p->cyclicBufferPos = mf->cyclicBufferPos;
+ p->cyclicBufferSize = mf->cyclicBufferSize;
+ p->cutValue = mf->cutValue;
+}
+
+/* ReleaseStream is required to finish multithreading */
+void MatchFinderMt_ReleaseStream(CMatchFinderMt *p)
+{
+ MtSync_StopWriting(&p->btSync);
+ /* p->MatchFinder->ReleaseStream(); */
+}
+
+static void MatchFinderMt_Normalize(CMatchFinderMt *p)
+{
+ MatchFinder_Normalize3(p->lzPos - p->historySize - 1, p->hash, p->fixedHashSize);
+ p->lzPos = p->historySize + 1;
+}
+
+static void MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p)
+{
+ UInt32 blockIndex;
+ MtSync_GetNextBlock(&p->btSync);
+ blockIndex = ((p->btSync.numProcessedBlocks - 1) & kMtBtNumBlocksMask);
+ p->btBufPosLimit = p->btBufPos = blockIndex * kMtBtBlockSize;
+ p->btBufPosLimit += p->btBuf[p->btBufPos++];
+ p->btNumAvailBytes = p->btBuf[p->btBufPos++];
+ if (p->lzPos >= kMtMaxValForNormalize - kMtBtBlockSize)
+ MatchFinderMt_Normalize(p);
+}
+
+static const Byte * MatchFinderMt_GetPointerToCurrentPos(CMatchFinderMt *p)
+{
+ return p->pointerToCurPos;
+}
+
+#define GET_NEXT_BLOCK_IF_REQUIRED if (p->btBufPos == p->btBufPosLimit) MatchFinderMt_GetNextBlock_Bt(p);
+
+static UInt32 MatchFinderMt_GetNumAvailableBytes(CMatchFinderMt *p)
+{
+ GET_NEXT_BLOCK_IF_REQUIRED;
+ return p->btNumAvailBytes;
+}
+
+static UInt32 * MixMatches2(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)
+{
+ UInt32 h2, curMatch2;
+ UInt32 *hash = p->hash;
+ const Byte *cur = p->pointerToCurPos;
+ UInt32 lzPos = p->lzPos;
+ MT_HASH2_CALC
+
+ curMatch2 = hash[h2];
+ hash[h2] = lzPos;
+
+ if (curMatch2 >= matchMinPos)
+ if (cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])
+ {
+ *distances++ = 2;
+ *distances++ = lzPos - curMatch2 - 1;
+ }
+
+ return distances;
+}
+
+static UInt32 * MixMatches3(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)
+{
+ UInt32 h2, h3, curMatch2, curMatch3;
+ UInt32 *hash = p->hash;
+ const Byte *cur = p->pointerToCurPos;
+ UInt32 lzPos = p->lzPos;
+ MT_HASH3_CALC
+
+ curMatch2 = hash[ h2];
+ curMatch3 = (hash + kFix3HashSize)[h3];
+
+ hash[ h2] = lzPos;
+ (hash + kFix3HashSize)[h3] = lzPos;
+
+ if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])
+ {
+ distances[1] = lzPos - curMatch2 - 1;
+ if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2])
+ {
+ distances[0] = 3;
+ return distances + 2;
+ }
+ distances[0] = 2;
+ distances += 2;
+ }
+
+ if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0])
+ {
+ *distances++ = 3;
+ *distances++ = lzPos - curMatch3 - 1;
+ }
+
+ return distances;
+}
+
+/*
+static UInt32 *MixMatches4(CMatchFinderMt *p, UInt32 matchMinPos, UInt32 *distances)
+{
+ UInt32 h2, h3, h4, curMatch2, curMatch3, curMatch4;
+ UInt32 *hash = p->hash;
+ const Byte *cur = p->pointerToCurPos;
+ UInt32 lzPos = p->lzPos;
+ MT_HASH4_CALC
+
+ curMatch2 = hash[ h2];
+ curMatch3 = (hash + kFix3HashSize)[h3];
+ curMatch4 = (hash + kFix4HashSize)[h4];
+
+ hash[ h2] = lzPos;
+ (hash + kFix3HashSize)[h3] = lzPos;
+ (hash + kFix4HashSize)[h4] = lzPos;
+
+ if (curMatch2 >= matchMinPos && cur[(ptrdiff_t)curMatch2 - lzPos] == cur[0])
+ {
+ distances[1] = lzPos - curMatch2 - 1;
+ if (cur[(ptrdiff_t)curMatch2 - lzPos + 2] == cur[2])
+ {
+ distances[0] = (cur[(ptrdiff_t)curMatch2 - lzPos + 3] == cur[3]) ? 4 : 3;
+ return distances + 2;
+ }
+ distances[0] = 2;
+ distances += 2;
+ }
+
+ if (curMatch3 >= matchMinPos && cur[(ptrdiff_t)curMatch3 - lzPos] == cur[0])
+ {
+ distances[1] = lzPos - curMatch3 - 1;
+ if (cur[(ptrdiff_t)curMatch3 - lzPos + 3] == cur[3])
+ {
+ distances[0] = 4;
+ return distances + 2;
+ }
+ distances[0] = 3;
+ distances += 2;
+ }
+
+ if (curMatch4 >= matchMinPos)
+ if (
+ cur[(ptrdiff_t)curMatch4 - lzPos] == cur[0] &&
+ cur[(ptrdiff_t)curMatch4 - lzPos + 3] == cur[3]
+ )
+ {
+ *distances++ = 4;
+ *distances++ = lzPos - curMatch4 - 1;
+ }
+
+ return distances;
+}
+*/
+
+#define INCREASE_LZ_POS p->lzPos++; p->pointerToCurPos++;
+
+static UInt32 MatchFinderMt2_GetMatches(CMatchFinderMt *p, UInt32 *distances)
+{
+ const UInt32 *btBuf = p->btBuf + p->btBufPos;
+ UInt32 len = *btBuf++;
+ p->btBufPos += 1 + len;
+ p->btNumAvailBytes--;
+ {
+ UInt32 i;
+ for (i = 0; i < len; i += 2)
+ {
+ UInt32 v0 = btBuf[0];
+ UInt32 v1 = btBuf[1];
+ btBuf += 2;
+ distances[0] = v0;
+ distances[1] = v1;
+ distances += 2;
+ }
+ }
+ INCREASE_LZ_POS
+ return len;
+}
+
+static UInt32 MatchFinderMt_GetMatches(CMatchFinderMt *p, UInt32 *distances)
+{
+ const UInt32 *btBuf = p->btBuf + p->btBufPos;
+ UInt32 len = *btBuf++;
+ p->btBufPos += 1 + len;
+
+ if (len == 0)
+ {
+ /* change for bt5 ! */
+ if (p->btNumAvailBytes-- >= 4)
+ len = (UInt32)(p->MixMatchesFunc(p, p->lzPos - p->historySize, distances) - (distances));
+ }
+ else
+ {
+ /* Condition: there are matches in btBuf with length < p->numHashBytes */
+ UInt32 *distances2;
+ p->btNumAvailBytes--;
+ distances2 = p->MixMatchesFunc(p, p->lzPos - btBuf[1], distances);
+ do
+ {
+ UInt32 v0 = btBuf[0];
+ UInt32 v1 = btBuf[1];
+ btBuf += 2;
+ distances2[0] = v0;
+ distances2[1] = v1;
+ distances2 += 2;
+ }
+ while ((len -= 2) != 0);
+ len = (UInt32)(distances2 - (distances));
+ }
+ INCREASE_LZ_POS
+ return len;
+}
+
+#define SKIP_HEADER2_MT do { GET_NEXT_BLOCK_IF_REQUIRED
+#define SKIP_HEADER_MT(n) SKIP_HEADER2_MT if (p->btNumAvailBytes-- >= (n)) { const Byte *cur = p->pointerToCurPos; UInt32 *hash = p->hash;
+#define SKIP_FOOTER_MT } INCREASE_LZ_POS p->btBufPos += p->btBuf[p->btBufPos] + 1; } while (--num != 0);
+
+static void MatchFinderMt0_Skip(CMatchFinderMt *p, UInt32 num)
+{
+ SKIP_HEADER2_MT { p->btNumAvailBytes--;
+ SKIP_FOOTER_MT
+}
+
+static void MatchFinderMt2_Skip(CMatchFinderMt *p, UInt32 num)
+{
+ SKIP_HEADER_MT(2)
+ UInt32 h2;
+ MT_HASH2_CALC
+ hash[h2] = p->lzPos;
+ SKIP_FOOTER_MT
+}
+
+static void MatchFinderMt3_Skip(CMatchFinderMt *p, UInt32 num)
+{
+ SKIP_HEADER_MT(3)
+ UInt32 h2, h3;
+ MT_HASH3_CALC
+ (hash + kFix3HashSize)[h3] =
+ hash[ h2] =
+ p->lzPos;
+ SKIP_FOOTER_MT
+}
+
+/*
+static void MatchFinderMt4_Skip(CMatchFinderMt *p, UInt32 num)
+{
+ SKIP_HEADER_MT(4)
+ UInt32 h2, h3, h4;
+ MT_HASH4_CALC
+ (hash + kFix4HashSize)[h4] =
+ (hash + kFix3HashSize)[h3] =
+ hash[ h2] =
+ p->lzPos;
+ SKIP_FOOTER_MT
+}
+*/
+
+void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable)
+{
+ vTable->Init = (Mf_Init_Func)MatchFinderMt_Init;
+ vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinderMt_GetNumAvailableBytes;
+ vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinderMt_GetPointerToCurrentPos;
+ vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt_GetMatches;
+
+ switch (p->MatchFinder->numHashBytes)
+ {
+ case 2:
+ p->GetHeadsFunc = GetHeads2;
+ p->MixMatchesFunc = (Mf_Mix_Matches)NULL;
+ vTable->Skip = (Mf_Skip_Func)MatchFinderMt0_Skip;
+ vTable->GetMatches = (Mf_GetMatches_Func)MatchFinderMt2_GetMatches;
+ break;
+ case 3:
+ p->GetHeadsFunc = GetHeads3;
+ p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches2;
+ vTable->Skip = (Mf_Skip_Func)MatchFinderMt2_Skip;
+ break;
+ default:
+ /* case 4: */
+ p->GetHeadsFunc = p->MatchFinder->bigHash ? GetHeads4b : GetHeads4;
+ p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches3;
+ vTable->Skip = (Mf_Skip_Func)MatchFinderMt3_Skip;
+ break;
+ /*
+ default:
+ p->GetHeadsFunc = GetHeads5;
+ p->MixMatchesFunc = (Mf_Mix_Matches)MixMatches4;
+ vTable->Skip = (Mf_Skip_Func)MatchFinderMt4_Skip;
+ break;
+ */
+ }
+}
diff --git a/other-licenses/7zstub/src/C/LzFindMt.h b/other-licenses/7zstub/src/C/LzFindMt.h
new file mode 100644
index 0000000000..3d86c788f3
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzFindMt.h
@@ -0,0 +1,101 @@
+/* LzFindMt.h -- multithreaded Match finder for LZ algorithms
+2017-04-03 : Igor Pavlov : Public domain */
+
+#ifndef __LZ_FIND_MT_H
+#define __LZ_FIND_MT_H
+
+#include "LzFind.h"
+#include "Threads.h"
+
+EXTERN_C_BEGIN
+
+#define kMtHashBlockSize (1 << 13)
+#define kMtHashNumBlocks (1 << 3)
+#define kMtHashNumBlocksMask (kMtHashNumBlocks - 1)
+
+#define kMtBtBlockSize (1 << 14)
+#define kMtBtNumBlocks (1 << 6)
+#define kMtBtNumBlocksMask (kMtBtNumBlocks - 1)
+
+typedef struct _CMtSync
+{
+ Bool wasCreated;
+ Bool needStart;
+ Bool exit;
+ Bool stopWriting;
+
+ CThread thread;
+ CAutoResetEvent canStart;
+ CAutoResetEvent wasStarted;
+ CAutoResetEvent wasStopped;
+ CSemaphore freeSemaphore;
+ CSemaphore filledSemaphore;
+ Bool csWasInitialized;
+ Bool csWasEntered;
+ CCriticalSection cs;
+ UInt32 numProcessedBlocks;
+} CMtSync;
+
+typedef UInt32 * (*Mf_Mix_Matches)(void *p, UInt32 matchMinPos, UInt32 *distances);
+
+/* kMtCacheLineDummy must be >= size_of_CPU_cache_line */
+#define kMtCacheLineDummy 128
+
+typedef void (*Mf_GetHeads)(const Byte *buffer, UInt32 pos,
+ UInt32 *hash, UInt32 hashMask, UInt32 *heads, UInt32 numHeads, const UInt32 *crc);
+
+typedef struct _CMatchFinderMt
+{
+ /* LZ */
+ const Byte *pointerToCurPos;
+ UInt32 *btBuf;
+ UInt32 btBufPos;
+ UInt32 btBufPosLimit;
+ UInt32 lzPos;
+ UInt32 btNumAvailBytes;
+
+ UInt32 *hash;
+ UInt32 fixedHashSize;
+ UInt32 historySize;
+ const UInt32 *crc;
+
+ Mf_Mix_Matches MixMatchesFunc;
+
+ /* LZ + BT */
+ CMtSync btSync;
+ Byte btDummy[kMtCacheLineDummy];
+
+ /* BT */
+ UInt32 *hashBuf;
+ UInt32 hashBufPos;
+ UInt32 hashBufPosLimit;
+ UInt32 hashNumAvail;
+
+ CLzRef *son;
+ UInt32 matchMaxLen;
+ UInt32 numHashBytes;
+ UInt32 pos;
+ const Byte *buffer;
+ UInt32 cyclicBufferPos;
+ UInt32 cyclicBufferSize; /* it must be historySize + 1 */
+ UInt32 cutValue;
+
+ /* BT + Hash */
+ CMtSync hashSync;
+ /* Byte hashDummy[kMtCacheLineDummy]; */
+
+ /* Hash */
+ Mf_GetHeads GetHeadsFunc;
+ CMatchFinder *MatchFinder;
+} CMatchFinderMt;
+
+void MatchFinderMt_Construct(CMatchFinderMt *p);
+void MatchFinderMt_Destruct(CMatchFinderMt *p, ISzAllocPtr alloc);
+SRes MatchFinderMt_Create(CMatchFinderMt *p, UInt32 historySize, UInt32 keepAddBufferBefore,
+ UInt32 matchMaxLen, UInt32 keepAddBufferAfter, ISzAllocPtr alloc);
+void MatchFinderMt_CreateVTable(CMatchFinderMt *p, IMatchFinder *vTable);
+void MatchFinderMt_ReleaseStream(CMatchFinderMt *p);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/LzHash.h b/other-licenses/7zstub/src/C/LzHash.h
new file mode 100644
index 0000000000..2191444072
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzHash.h
@@ -0,0 +1,57 @@
+/* LzHash.h -- HASH functions for LZ algorithms
+2015-04-12 : Igor Pavlov : Public domain */
+
+#ifndef __LZ_HASH_H
+#define __LZ_HASH_H
+
+#define kHash2Size (1 << 10)
+#define kHash3Size (1 << 16)
+#define kHash4Size (1 << 20)
+
+#define kFix3HashSize (kHash2Size)
+#define kFix4HashSize (kHash2Size + kHash3Size)
+#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
+
+#define HASH2_CALC hv = cur[0] | ((UInt32)cur[1] << 8);
+
+#define HASH3_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ h2 = temp & (kHash2Size - 1); \
+ hv = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
+
+#define HASH4_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ h2 = temp & (kHash2Size - 1); \
+ temp ^= ((UInt32)cur[2] << 8); \
+ h3 = temp & (kHash3Size - 1); \
+ hv = (temp ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
+
+#define HASH5_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ h2 = temp & (kHash2Size - 1); \
+ temp ^= ((UInt32)cur[2] << 8); \
+ h3 = temp & (kHash3Size - 1); \
+ temp ^= (p->crc[cur[3]] << 5); \
+ h4 = temp & (kHash4Size - 1); \
+ hv = (temp ^ (p->crc[cur[4]] << 3)) & p->hashMask; }
+
+/* #define HASH_ZIP_CALC hv = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
+#define HASH_ZIP_CALC hv = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
+
+
+#define MT_HASH2_CALC \
+ h2 = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
+
+#define MT_HASH3_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ h2 = temp & (kHash2Size - 1); \
+ h3 = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
+
+#define MT_HASH4_CALC { \
+ UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
+ h2 = temp & (kHash2Size - 1); \
+ temp ^= ((UInt32)cur[2] << 8); \
+ h3 = temp & (kHash3Size - 1); \
+ h4 = (temp ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Lzma2Dec.c b/other-licenses/7zstub/src/C/Lzma2Dec.c
new file mode 100644
index 0000000000..57e7f346e1
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma2Dec.c
@@ -0,0 +1,488 @@
+/* Lzma2Dec.c -- LZMA2 Decoder
+2018-02-19 : Igor Pavlov : Public domain */
+
+/* #define SHOW_DEBUG_INFO */
+
+#include "Precomp.h"
+
+#ifdef SHOW_DEBUG_INFO
+#include <stdio.h>
+#endif
+
+#include <string.h>
+
+#include "Lzma2Dec.h"
+
+/*
+00000000 - End of data
+00000001 U U - Uncompressed, reset dic, need reset state and set new prop
+00000010 U U - Uncompressed, no reset
+100uuuuu U U P P - LZMA, no reset
+101uuuuu U U P P - LZMA, reset state
+110uuuuu U U P P S - LZMA, reset state + set new prop
+111uuuuu U U P P S - LZMA, reset state + set new prop, reset dic
+
+ u, U - Unpack Size
+ P - Pack Size
+ S - Props
+*/
+
+#define LZMA2_CONTROL_COPY_RESET_DIC 1
+
+#define LZMA2_IS_UNCOMPRESSED_STATE(p) (((p)->control & (1 << 7)) == 0)
+
+#define LZMA2_LCLP_MAX 4
+#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))
+
+#ifdef SHOW_DEBUG_INFO
+#define PRF(x) x
+#else
+#define PRF(x)
+#endif
+
+typedef enum
+{
+ LZMA2_STATE_CONTROL,
+ LZMA2_STATE_UNPACK0,
+ LZMA2_STATE_UNPACK1,
+ LZMA2_STATE_PACK0,
+ LZMA2_STATE_PACK1,
+ LZMA2_STATE_PROP,
+ LZMA2_STATE_DATA,
+ LZMA2_STATE_DATA_CONT,
+ LZMA2_STATE_FINISHED,
+ LZMA2_STATE_ERROR
+} ELzma2State;
+
+static SRes Lzma2Dec_GetOldProps(Byte prop, Byte *props)
+{
+ UInt32 dicSize;
+ if (prop > 40)
+ return SZ_ERROR_UNSUPPORTED;
+ dicSize = (prop == 40) ? 0xFFFFFFFF : LZMA2_DIC_SIZE_FROM_PROP(prop);
+ props[0] = (Byte)LZMA2_LCLP_MAX;
+ props[1] = (Byte)(dicSize);
+ props[2] = (Byte)(dicSize >> 8);
+ props[3] = (Byte)(dicSize >> 16);
+ props[4] = (Byte)(dicSize >> 24);
+ return SZ_OK;
+}
+
+SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc)
+{
+ Byte props[LZMA_PROPS_SIZE];
+ RINOK(Lzma2Dec_GetOldProps(prop, props));
+ return LzmaDec_AllocateProbs(&p->decoder, props, LZMA_PROPS_SIZE, alloc);
+}
+
+SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc)
+{
+ Byte props[LZMA_PROPS_SIZE];
+ RINOK(Lzma2Dec_GetOldProps(prop, props));
+ return LzmaDec_Allocate(&p->decoder, props, LZMA_PROPS_SIZE, alloc);
+}
+
+void Lzma2Dec_Init(CLzma2Dec *p)
+{
+ p->state = LZMA2_STATE_CONTROL;
+ p->needInitLevel = 0xE0;
+ p->isExtraMode = False;
+ p->unpackSize = 0;
+
+ // p->decoder.dicPos = 0; // we can use it instead of full init
+ LzmaDec_Init(&p->decoder);
+}
+
+static ELzma2State Lzma2Dec_UpdateState(CLzma2Dec *p, Byte b)
+{
+ switch (p->state)
+ {
+ case LZMA2_STATE_CONTROL:
+ p->isExtraMode = False;
+ p->control = b;
+ PRF(printf("\n %8X", (unsigned)p->decoder.dicPos));
+ PRF(printf(" %02X", (unsigned)b));
+ if (b == 0)
+ return LZMA2_STATE_FINISHED;
+ if (LZMA2_IS_UNCOMPRESSED_STATE(p))
+ {
+ if (b == LZMA2_CONTROL_COPY_RESET_DIC)
+ p->needInitLevel = 0xC0;
+ else if (b > 2 || p->needInitLevel == 0xE0)
+ return LZMA2_STATE_ERROR;
+ }
+ else
+ {
+ if (b < p->needInitLevel)
+ return LZMA2_STATE_ERROR;
+ p->needInitLevel = 0;
+ p->unpackSize = (UInt32)(b & 0x1F) << 16;
+ }
+ return LZMA2_STATE_UNPACK0;
+
+ case LZMA2_STATE_UNPACK0:
+ p->unpackSize |= (UInt32)b << 8;
+ return LZMA2_STATE_UNPACK1;
+
+ case LZMA2_STATE_UNPACK1:
+ p->unpackSize |= (UInt32)b;
+ p->unpackSize++;
+ PRF(printf(" %7u", (unsigned)p->unpackSize));
+ return LZMA2_IS_UNCOMPRESSED_STATE(p) ? LZMA2_STATE_DATA : LZMA2_STATE_PACK0;
+
+ case LZMA2_STATE_PACK0:
+ p->packSize = (UInt32)b << 8;
+ return LZMA2_STATE_PACK1;
+
+ case LZMA2_STATE_PACK1:
+ p->packSize |= (UInt32)b;
+ p->packSize++;
+ // if (p->packSize < 5) return LZMA2_STATE_ERROR;
+ PRF(printf(" %5u", (unsigned)p->packSize));
+ return (p->control & 0x40) ? LZMA2_STATE_PROP : LZMA2_STATE_DATA;
+
+ case LZMA2_STATE_PROP:
+ {
+ unsigned lc, lp;
+ if (b >= (9 * 5 * 5))
+ return LZMA2_STATE_ERROR;
+ lc = b % 9;
+ b /= 9;
+ p->decoder.prop.pb = (Byte)(b / 5);
+ lp = b % 5;
+ if (lc + lp > LZMA2_LCLP_MAX)
+ return LZMA2_STATE_ERROR;
+ p->decoder.prop.lc = (Byte)lc;
+ p->decoder.prop.lp = (Byte)lp;
+ return LZMA2_STATE_DATA;
+ }
+ }
+ return LZMA2_STATE_ERROR;
+}
+
+static void LzmaDec_UpdateWithUncompressed(CLzmaDec *p, const Byte *src, SizeT size)
+{
+ memcpy(p->dic + p->dicPos, src, size);
+ p->dicPos += size;
+ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= size)
+ p->checkDicSize = p->prop.dicSize;
+ p->processedPos += (UInt32)size;
+}
+
+void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState);
+
+
+SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
+{
+ SizeT inSize = *srcLen;
+ *srcLen = 0;
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+
+ while (p->state != LZMA2_STATE_ERROR)
+ {
+ SizeT dicPos;
+
+ if (p->state == LZMA2_STATE_FINISHED)
+ {
+ *status = LZMA_STATUS_FINISHED_WITH_MARK;
+ return SZ_OK;
+ }
+
+ dicPos = p->decoder.dicPos;
+
+ if (dicPos == dicLimit && finishMode == LZMA_FINISH_ANY)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_OK;
+ }
+
+ if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)
+ {
+ if (*srcLen == inSize)
+ {
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ (*srcLen)++;
+ p->state = Lzma2Dec_UpdateState(p, *src++);
+ if (dicPos == dicLimit && p->state != LZMA2_STATE_FINISHED)
+ break;
+ continue;
+ }
+
+ {
+ SizeT inCur = inSize - *srcLen;
+ SizeT outCur = dicLimit - dicPos;
+ ELzmaFinishMode curFinishMode = LZMA_FINISH_ANY;
+
+ if (outCur >= p->unpackSize)
+ {
+ outCur = (SizeT)p->unpackSize;
+ curFinishMode = LZMA_FINISH_END;
+ }
+
+ if (LZMA2_IS_UNCOMPRESSED_STATE(p))
+ {
+ if (inCur == 0)
+ {
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+
+ if (p->state == LZMA2_STATE_DATA)
+ {
+ Bool initDic = (p->control == LZMA2_CONTROL_COPY_RESET_DIC);
+ LzmaDec_InitDicAndState(&p->decoder, initDic, False);
+ }
+
+ if (inCur > outCur)
+ inCur = outCur;
+ if (inCur == 0)
+ break;
+
+ LzmaDec_UpdateWithUncompressed(&p->decoder, src, inCur);
+
+ src += inCur;
+ *srcLen += inCur;
+ p->unpackSize -= (UInt32)inCur;
+ p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
+ }
+ else
+ {
+ SRes res;
+
+ if (p->state == LZMA2_STATE_DATA)
+ {
+ Bool initDic = (p->control >= 0xE0);
+ Bool initState = (p->control >= 0xA0);
+ LzmaDec_InitDicAndState(&p->decoder, initDic, initState);
+ p->state = LZMA2_STATE_DATA_CONT;
+ }
+
+ if (inCur > p->packSize)
+ inCur = (SizeT)p->packSize;
+
+ res = LzmaDec_DecodeToDic(&p->decoder, dicPos + outCur, src, &inCur, curFinishMode, status);
+
+ src += inCur;
+ *srcLen += inCur;
+ p->packSize -= (UInt32)inCur;
+ outCur = p->decoder.dicPos - dicPos;
+ p->unpackSize -= (UInt32)outCur;
+
+ if (res != 0)
+ break;
+
+ if (*status == LZMA_STATUS_NEEDS_MORE_INPUT)
+ {
+ if (p->packSize == 0)
+ break;
+ return SZ_OK;
+ }
+
+ if (inCur == 0 && outCur == 0)
+ {
+ if (*status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ || p->unpackSize != 0
+ || p->packSize != 0)
+ break;
+ p->state = LZMA2_STATE_CONTROL;
+ }
+
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+ }
+ }
+ }
+
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+ p->state = LZMA2_STATE_ERROR;
+ return SZ_ERROR_DATA;
+}
+
+
+
+
+ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
+ SizeT outSize,
+ const Byte *src, SizeT *srcLen,
+ int checkFinishBlock)
+{
+ SizeT inSize = *srcLen;
+ *srcLen = 0;
+
+ while (p->state != LZMA2_STATE_ERROR)
+ {
+ if (p->state == LZMA2_STATE_FINISHED)
+ return LZMA_STATUS_FINISHED_WITH_MARK;
+
+ if (outSize == 0 && !checkFinishBlock)
+ return LZMA_STATUS_NOT_FINISHED;
+
+ if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)
+ {
+ if (*srcLen == inSize)
+ return LZMA_STATUS_NEEDS_MORE_INPUT;
+ (*srcLen)++;
+
+ p->state = Lzma2Dec_UpdateState(p, *src++);
+
+ if (p->state == LZMA2_STATE_UNPACK0)
+ {
+ // if (p->decoder.dicPos != 0)
+ if (p->control == LZMA2_CONTROL_COPY_RESET_DIC || p->control >= 0xE0)
+ return LZMA2_PARSE_STATUS_NEW_BLOCK;
+ // if (outSize == 0) return LZMA_STATUS_NOT_FINISHED;
+ }
+
+ // The following code can be commented.
+ // It's not big problem, if we read additional input bytes.
+ // It will be stopped later in LZMA2_STATE_DATA / LZMA2_STATE_DATA_CONT state.
+
+ if (outSize == 0 && p->state != LZMA2_STATE_FINISHED)
+ {
+ // checkFinishBlock is true. So we expect that block must be finished,
+ // We can return LZMA_STATUS_NOT_SPECIFIED or LZMA_STATUS_NOT_FINISHED here
+ // break;
+ return LZMA_STATUS_NOT_FINISHED;
+ }
+
+ if (p->state == LZMA2_STATE_DATA)
+ return LZMA2_PARSE_STATUS_NEW_CHUNK;
+
+ continue;
+ }
+
+ if (outSize == 0)
+ return LZMA_STATUS_NOT_FINISHED;
+
+ {
+ SizeT inCur = inSize - *srcLen;
+
+ if (LZMA2_IS_UNCOMPRESSED_STATE(p))
+ {
+ if (inCur == 0)
+ return LZMA_STATUS_NEEDS_MORE_INPUT;
+ if (inCur > p->unpackSize)
+ inCur = p->unpackSize;
+ if (inCur > outSize)
+ inCur = outSize;
+ p->decoder.dicPos += inCur;
+ src += inCur;
+ *srcLen += inCur;
+ outSize -= inCur;
+ p->unpackSize -= (UInt32)inCur;
+ p->state = (p->unpackSize == 0) ? LZMA2_STATE_CONTROL : LZMA2_STATE_DATA_CONT;
+ }
+ else
+ {
+ p->isExtraMode = True;
+
+ if (inCur == 0)
+ {
+ if (p->packSize != 0)
+ return LZMA_STATUS_NEEDS_MORE_INPUT;
+ }
+ else if (p->state == LZMA2_STATE_DATA)
+ {
+ p->state = LZMA2_STATE_DATA_CONT;
+ if (*src != 0)
+ {
+ // first byte of lzma chunk must be Zero
+ *srcLen += 1;
+ p->packSize--;
+ break;
+ }
+ }
+
+ if (inCur > p->packSize)
+ inCur = (SizeT)p->packSize;
+
+ src += inCur;
+ *srcLen += inCur;
+ p->packSize -= (UInt32)inCur;
+
+ if (p->packSize == 0)
+ {
+ SizeT rem = outSize;
+ if (rem > p->unpackSize)
+ rem = p->unpackSize;
+ p->decoder.dicPos += rem;
+ p->unpackSize -= (UInt32)rem;
+ outSize -= rem;
+ if (p->unpackSize == 0)
+ p->state = LZMA2_STATE_CONTROL;
+ }
+ }
+ }
+ }
+
+ p->state = LZMA2_STATE_ERROR;
+ return LZMA_STATUS_NOT_SPECIFIED;
+}
+
+
+
+
+SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
+{
+ SizeT outSize = *destLen, inSize = *srcLen;
+ *srcLen = *destLen = 0;
+
+ for (;;)
+ {
+ SizeT inCur = inSize, outCur, dicPos;
+ ELzmaFinishMode curFinishMode;
+ SRes res;
+
+ if (p->decoder.dicPos == p->decoder.dicBufSize)
+ p->decoder.dicPos = 0;
+ dicPos = p->decoder.dicPos;
+ curFinishMode = LZMA_FINISH_ANY;
+ outCur = p->decoder.dicBufSize - dicPos;
+
+ if (outCur >= outSize)
+ {
+ outCur = outSize;
+ curFinishMode = finishMode;
+ }
+
+ res = Lzma2Dec_DecodeToDic(p, dicPos + outCur, src, &inCur, curFinishMode, status);
+
+ src += inCur;
+ inSize -= inCur;
+ *srcLen += inCur;
+ outCur = p->decoder.dicPos - dicPos;
+ memcpy(dest, p->decoder.dic + dicPos, outCur);
+ dest += outCur;
+ outSize -= outCur;
+ *destLen += outCur;
+ if (res != 0)
+ return res;
+ if (outCur == 0 || outSize == 0)
+ return SZ_OK;
+ }
+}
+
+
+SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAllocPtr alloc)
+{
+ CLzma2Dec p;
+ SRes res;
+ SizeT outSize = *destLen, inSize = *srcLen;
+ *destLen = *srcLen = 0;
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+ Lzma2Dec_Construct(&p);
+ RINOK(Lzma2Dec_AllocateProbs(&p, prop, alloc));
+ p.decoder.dic = dest;
+ p.decoder.dicBufSize = outSize;
+ Lzma2Dec_Init(&p);
+ *srcLen = inSize;
+ res = Lzma2Dec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
+ *destLen = p.decoder.dicPos;
+ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
+ res = SZ_ERROR_INPUT_EOF;
+ Lzma2Dec_FreeProbs(&p, alloc);
+ return res;
+}
diff --git a/other-licenses/7zstub/src/C/Lzma2Dec.h b/other-licenses/7zstub/src/C/Lzma2Dec.h
new file mode 100644
index 0000000000..da50387250
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma2Dec.h
@@ -0,0 +1,120 @@
+/* Lzma2Dec.h -- LZMA2 Decoder
+2018-02-19 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA2_DEC_H
+#define __LZMA2_DEC_H
+
+#include "LzmaDec.h"
+
+EXTERN_C_BEGIN
+
+/* ---------- State Interface ---------- */
+
+typedef struct
+{
+ unsigned state;
+ Byte control;
+ Byte needInitLevel;
+ Byte isExtraMode;
+ Byte _pad_;
+ UInt32 packSize;
+ UInt32 unpackSize;
+ CLzmaDec decoder;
+} CLzma2Dec;
+
+#define Lzma2Dec_Construct(p) LzmaDec_Construct(&(p)->decoder)
+#define Lzma2Dec_FreeProbs(p, alloc) LzmaDec_FreeProbs(&(p)->decoder, alloc)
+#define Lzma2Dec_Free(p, alloc) LzmaDec_Free(&(p)->decoder, alloc)
+
+SRes Lzma2Dec_AllocateProbs(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc);
+SRes Lzma2Dec_Allocate(CLzma2Dec *p, Byte prop, ISzAllocPtr alloc);
+void Lzma2Dec_Init(CLzma2Dec *p);
+
+/*
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen or dicLimit).
+ LZMA_FINISH_ANY - use smallest number of input bytes
+ LZMA_FINISH_END - read EndOfStream marker after decoding
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_NEEDS_MORE_INPUT
+ SZ_ERROR_DATA - Data error
+*/
+
+SRes Lzma2Dec_DecodeToDic(CLzma2Dec *p, SizeT dicLimit,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+SRes Lzma2Dec_DecodeToBuf(CLzma2Dec *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+
+/* ---------- LZMA2 block and chunk parsing ---------- */
+
+/*
+Lzma2Dec_Parse() parses compressed data stream up to next independent block or next chunk data.
+It can return LZMA_STATUS_* code or LZMA2_PARSE_STATUS_* code:
+ - LZMA2_PARSE_STATUS_NEW_BLOCK - there is new block, and 1 additional byte (control byte of next block header) was read from input.
+ - LZMA2_PARSE_STATUS_NEW_CHUNK - there is new chunk, and only lzma2 header of new chunk was read.
+ CLzma2Dec::unpackSize contains unpack size of that chunk
+*/
+
+typedef enum
+{
+/*
+ LZMA_STATUS_NOT_SPECIFIED // data error
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED //
+ LZMA_STATUS_NEEDS_MORE_INPUT
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK // unused
+*/
+ LZMA2_PARSE_STATUS_NEW_BLOCK = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + 1,
+ LZMA2_PARSE_STATUS_NEW_CHUNK
+} ELzma2ParseStatus;
+
+ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
+ SizeT outSize, // output size
+ const Byte *src, SizeT *srcLen,
+ int checkFinishBlock // set (checkFinishBlock = 1), if it must read full input data, if decoder.dicPos reaches blockMax position.
+ );
+
+/*
+LZMA2 parser doesn't decode LZMA chunks, so we must read
+ full input LZMA chunk to decode some part of LZMA chunk.
+
+Lzma2Dec_GetUnpackExtra() returns the value that shows
+ max possible number of output bytes that can be output by decoder
+ at current input positon.
+*/
+
+#define Lzma2Dec_GetUnpackExtra(p) ((p)->isExtraMode ? (p)->unpackSize : 0);
+
+
+/* ---------- One Call Interface ---------- */
+
+/*
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - use smallest number of input bytes
+ LZMA_FINISH_END - read EndOfStream marker after decoding
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+*/
+
+SRes Lzma2Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ Byte prop, ELzmaFinishMode finishMode, ELzmaStatus *status, ISzAllocPtr alloc);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Lzma2DecMt.c b/other-licenses/7zstub/src/C/Lzma2DecMt.c
new file mode 100644
index 0000000000..be698cbeb2
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma2DecMt.c
@@ -0,0 +1,1082 @@
+/* Lzma2DecMt.c -- LZMA2 Decoder Multi-thread
+2018-03-02 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+// #define SHOW_DEBUG_INFO
+
+#ifdef SHOW_DEBUG_INFO
+#include <stdio.h>
+#endif
+
+#ifdef SHOW_DEBUG_INFO
+#define PRF(x) x
+#else
+#define PRF(x)
+#endif
+
+#define PRF_STR(s) PRF(printf("\n" s "\n"))
+#define PRF_STR_INT(s, d) PRF(printf("\n" s " %d\n", (unsigned)d))
+#define PRF_STR_INT_2(s, d1, d2) PRF(printf("\n" s " %d %d\n", (unsigned)d1, (unsigned)d2))
+
+// #define _7ZIP_ST
+
+#include "Alloc.h"
+
+#include "Lzma2Dec.h"
+#include "Lzma2DecMt.h"
+
+#ifndef _7ZIP_ST
+#include "MtDec.h"
+#endif
+
+
+#define LZMA2DECMT_OUT_BLOCK_MAX_DEFAULT (1 << 28)
+
+void Lzma2DecMtProps_Init(CLzma2DecMtProps *p)
+{
+ p->inBufSize_ST = 1 << 20;
+ p->outStep_ST = 1 << 20;
+
+ #ifndef _7ZIP_ST
+ p->numThreads = 1;
+ p->inBufSize_MT = 1 << 18;
+ p->outBlockMax = LZMA2DECMT_OUT_BLOCK_MAX_DEFAULT;
+ p->inBlockMax = p->outBlockMax + p->outBlockMax / 16;
+ #endif
+}
+
+
+
+#ifndef _7ZIP_ST
+
+/* ---------- CLzma2DecMtThread ---------- */
+
+typedef struct
+{
+ CLzma2Dec dec;
+ Byte dec_created;
+ Byte needInit;
+
+ Byte *outBuf;
+ size_t outBufSize;
+
+ EMtDecParseState state;
+ ELzma2ParseStatus parseStatus;
+
+ size_t inPreSize;
+ size_t outPreSize;
+
+ size_t inCodeSize;
+ size_t outCodeSize;
+ SRes codeRes;
+
+ CAlignOffsetAlloc alloc;
+
+ Byte mtPad[1 << 7];
+} CLzma2DecMtThread;
+
+#endif
+
+
+/* ---------- CLzma2DecMt ---------- */
+
+typedef struct
+{
+ // ISzAllocPtr alloc;
+ ISzAllocPtr allocMid;
+
+ CAlignOffsetAlloc alignOffsetAlloc;
+ CLzma2DecMtProps props;
+ Byte prop;
+
+ ISeqInStream *inStream;
+ ISeqOutStream *outStream;
+ ICompressProgress *progress;
+
+ Bool finishMode;
+ Bool outSize_Defined;
+ UInt64 outSize;
+
+ UInt64 outProcessed;
+ UInt64 inProcessed;
+ Bool readWasFinished;
+ SRes readRes;
+
+ Byte *inBuf;
+ size_t inBufSize;
+ Byte dec_created;
+ CLzma2Dec dec;
+
+ size_t inPos;
+ size_t inLim;
+
+ #ifndef _7ZIP_ST
+ UInt64 outProcessed_Parse;
+ Bool mtc_WasConstructed;
+ CMtDec mtc;
+ CLzma2DecMtThread coders[MTDEC__THREADS_MAX];
+ #endif
+
+} CLzma2DecMt;
+
+
+
+CLzma2DecMtHandle Lzma2DecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid)
+{
+ CLzma2DecMt *p = (CLzma2DecMt *)ISzAlloc_Alloc(alloc, sizeof(CLzma2DecMt));
+ if (!p)
+ return NULL;
+
+ // p->alloc = alloc;
+ p->allocMid = allocMid;
+
+ AlignOffsetAlloc_CreateVTable(&p->alignOffsetAlloc);
+ p->alignOffsetAlloc.numAlignBits = 7;
+ p->alignOffsetAlloc.offset = 0;
+ p->alignOffsetAlloc.baseAlloc = alloc;
+
+ p->inBuf = NULL;
+ p->inBufSize = 0;
+ p->dec_created = False;
+
+ // Lzma2DecMtProps_Init(&p->props);
+
+ #ifndef _7ZIP_ST
+ p->mtc_WasConstructed = False;
+ {
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CLzma2DecMtThread *t = &p->coders[i];
+ t->dec_created = False;
+ t->outBuf = NULL;
+ t->outBufSize = 0;
+ }
+ }
+ #endif
+
+ return p;
+}
+
+
+#ifndef _7ZIP_ST
+
+static void Lzma2DecMt_FreeOutBufs(CLzma2DecMt *p)
+{
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CLzma2DecMtThread *t = &p->coders[i];
+ if (t->outBuf)
+ {
+ ISzAlloc_Free(p->allocMid, t->outBuf);
+ t->outBuf = NULL;
+ t->outBufSize = 0;
+ }
+ }
+}
+
+#endif
+
+
+static void Lzma2DecMt_FreeSt(CLzma2DecMt *p)
+{
+ if (p->dec_created)
+ {
+ Lzma2Dec_Free(&p->dec, &p->alignOffsetAlloc.vt);
+ p->dec_created = False;
+ }
+ if (p->inBuf)
+ {
+ ISzAlloc_Free(p->allocMid, p->inBuf);
+ p->inBuf = NULL;
+ }
+ p->inBufSize = 0;
+}
+
+
+void Lzma2DecMt_Destroy(CLzma2DecMtHandle pp)
+{
+ CLzma2DecMt *p = (CLzma2DecMt *)pp;
+
+ Lzma2DecMt_FreeSt(p);
+
+ #ifndef _7ZIP_ST
+
+ if (p->mtc_WasConstructed)
+ {
+ MtDec_Destruct(&p->mtc);
+ p->mtc_WasConstructed = False;
+ }
+ {
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CLzma2DecMtThread *t = &p->coders[i];
+ if (t->dec_created)
+ {
+ // we don't need to free dict here
+ Lzma2Dec_FreeProbs(&t->dec, &t->alloc.vt); // p->alloc !!!
+ t->dec_created = False;
+ }
+ }
+ }
+ Lzma2DecMt_FreeOutBufs(p);
+
+ #endif
+
+ ISzAlloc_Free(p->alignOffsetAlloc.baseAlloc, pp);
+}
+
+
+
+#ifndef _7ZIP_ST
+
+static void Lzma2DecMt_MtCallback_Parse(void *obj, unsigned coderIndex, CMtDecCallbackInfo *cc)
+{
+ CLzma2DecMt *me = (CLzma2DecMt *)obj;
+ CLzma2DecMtThread *t = &me->coders[coderIndex];
+
+ PRF_STR_INT_2("Parse", coderIndex, cc->srcSize);
+
+ cc->state = MTDEC_PARSE_CONTINUE;
+
+ if (cc->startCall)
+ {
+ if (!t->dec_created)
+ {
+ Lzma2Dec_Construct(&t->dec);
+ t->dec_created = True;
+ AlignOffsetAlloc_CreateVTable(&t->alloc);
+ {
+ /* (1 << 12) is expected size of one way in data cache.
+ We optimize alignment for cache line size of 128 bytes and smaller */
+ const unsigned kNumAlignBits = 12;
+ const unsigned kNumCacheLineBits = 7; /* <= kNumAlignBits */
+ t->alloc.numAlignBits = kNumAlignBits;
+ t->alloc.offset = ((UInt32)coderIndex * ((1 << 11) + (1 << 8) + (1 << 6))) & ((1 << kNumAlignBits) - (1 << kNumCacheLineBits));
+ t->alloc.baseAlloc = me->alignOffsetAlloc.baseAlloc;
+ }
+ }
+ Lzma2Dec_Init(&t->dec);
+
+ t->inPreSize = 0;
+ t->outPreSize = 0;
+ // t->blockWasFinished = False;
+ // t->finishedWithMark = False;
+ t->parseStatus = LZMA_STATUS_NOT_SPECIFIED;
+ t->state = MTDEC_PARSE_CONTINUE;
+
+ t->inCodeSize = 0;
+ t->outCodeSize = 0;
+ t->codeRes = SZ_OK;
+
+ // (cc->srcSize == 0) is allowed
+ }
+
+ {
+ ELzma2ParseStatus status;
+ Bool overflow;
+ UInt32 unpackRem = 0;
+
+ int checkFinishBlock = True;
+ size_t limit = me->props.outBlockMax;
+ if (me->outSize_Defined)
+ {
+ UInt64 rem = me->outSize - me->outProcessed_Parse;
+ if (limit >= rem)
+ {
+ limit = (size_t)rem;
+ if (!me->finishMode)
+ checkFinishBlock = False;
+ }
+ }
+
+ // checkFinishBlock = False, if we want to decode partial data
+ // that must be finished at position <= outBlockMax.
+
+ {
+ const SizeT srcOrig = cc->srcSize;
+ SizeT srcSize_Point = 0;
+ SizeT dicPos_Point = 0;
+
+ cc->srcSize = 0;
+ overflow = False;
+
+ for (;;)
+ {
+ SizeT srcCur = srcOrig - cc->srcSize;
+
+ status = Lzma2Dec_Parse(&t->dec,
+ limit - t->dec.decoder.dicPos,
+ cc->src + cc->srcSize, &srcCur,
+ checkFinishBlock);
+
+ cc->srcSize += srcCur;
+
+ if (status == LZMA2_PARSE_STATUS_NEW_CHUNK)
+ {
+ if (t->dec.unpackSize > me->props.outBlockMax - t->dec.decoder.dicPos)
+ {
+ overflow = True;
+ break;
+ }
+ continue;
+ }
+
+ if (status == LZMA2_PARSE_STATUS_NEW_BLOCK)
+ {
+ if (t->dec.decoder.dicPos == 0)
+ continue;
+ // we decode small blocks in one thread
+ if (t->dec.decoder.dicPos >= (1 << 14))
+ break;
+ dicPos_Point = t->dec.decoder.dicPos;
+ srcSize_Point = cc->srcSize;
+ continue;
+ }
+
+ if ((int)status == LZMA_STATUS_NOT_FINISHED && checkFinishBlock
+ // && limit == t->dec.decoder.dicPos
+ // && limit == me->props.outBlockMax
+ )
+ {
+ overflow = True;
+ break;
+ }
+
+ unpackRem = Lzma2Dec_GetUnpackExtra(&t->dec);
+ break;
+ }
+
+ if (dicPos_Point != 0
+ && (int)status != LZMA2_PARSE_STATUS_NEW_BLOCK
+ && (int)status != LZMA_STATUS_FINISHED_WITH_MARK
+ && (int)status != LZMA_STATUS_NOT_SPECIFIED)
+ {
+ // we revert to latest newBlock state
+ status = LZMA2_PARSE_STATUS_NEW_BLOCK;
+ unpackRem = 0;
+ t->dec.decoder.dicPos = dicPos_Point;
+ cc->srcSize = srcSize_Point;
+ overflow = False;
+ }
+ }
+
+ t->inPreSize += cc->srcSize;
+ t->parseStatus = status;
+
+ if (overflow)
+ cc->state = MTDEC_PARSE_OVERFLOW;
+ else
+ {
+ size_t dicPos = t->dec.decoder.dicPos;
+
+ if ((int)status != LZMA_STATUS_NEEDS_MORE_INPUT)
+ {
+ if (status == LZMA2_PARSE_STATUS_NEW_BLOCK)
+ {
+ cc->state = MTDEC_PARSE_NEW;
+ cc->srcSize--; // we don't need control byte of next block
+ t->inPreSize--;
+ }
+ else
+ {
+ cc->state = MTDEC_PARSE_END;
+ if ((int)status != LZMA_STATUS_FINISHED_WITH_MARK)
+ {
+ // (status == LZMA_STATUS_NOT_SPECIFIED)
+ // (status == LZMA_STATUS_NOT_FINISHED)
+ if (unpackRem != 0)
+ {
+ /* we also reserve space for max possible number of output bytes of current LZMA chunk */
+ SizeT rem = limit - dicPos;
+ if (rem > unpackRem)
+ rem = unpackRem;
+ dicPos += rem;
+ }
+ }
+ }
+
+ me->outProcessed_Parse += dicPos;
+ }
+
+ cc->outPos = dicPos;
+ t->outPreSize = (size_t)dicPos;
+ }
+
+ t->state = cc->state;
+ return;
+ }
+}
+
+
+static SRes Lzma2DecMt_MtCallback_PreCode(void *pp, unsigned coderIndex)
+{
+ CLzma2DecMt *me = (CLzma2DecMt *)pp;
+ CLzma2DecMtThread *t = &me->coders[coderIndex];
+ Byte *dest = t->outBuf;
+
+ if (t->inPreSize == 0)
+ {
+ t->codeRes = SZ_ERROR_DATA;
+ return t->codeRes;
+ }
+
+ if (!dest || t->outBufSize < t->outPreSize)
+ {
+ if (dest)
+ {
+ ISzAlloc_Free(me->allocMid, dest);
+ t->outBuf = NULL;
+ t->outBufSize = 0;
+ }
+
+ dest = (Byte *)ISzAlloc_Alloc(me->allocMid, t->outPreSize
+ // + (1 << 28)
+ );
+ // Sleep(200);
+ if (!dest)
+ return SZ_ERROR_MEM;
+ t->outBuf = dest;
+ t->outBufSize = t->outPreSize;
+ }
+
+ t->dec.decoder.dic = dest;
+ t->dec.decoder.dicBufSize = t->outPreSize;
+
+ t->needInit = True;
+
+ return Lzma2Dec_AllocateProbs(&t->dec, me->prop, &t->alloc.vt); // alloc.vt
+}
+
+
+static SRes Lzma2DecMt_MtCallback_Code(void *pp, unsigned coderIndex,
+ const Byte *src, size_t srcSize, int srcFinished,
+ // int finished, int blockFinished,
+ UInt64 *inCodePos, UInt64 *outCodePos, int *stop)
+{
+ CLzma2DecMt *me = (CLzma2DecMt *)pp;
+ CLzma2DecMtThread *t = &me->coders[coderIndex];
+
+ UNUSED_VAR(srcFinished)
+
+ PRF_STR_INT_2("Code", coderIndex, srcSize);
+
+ *inCodePos = t->inCodeSize;
+ *outCodePos = 0;
+ *stop = True;
+
+ if (t->needInit)
+ {
+ Lzma2Dec_Init(&t->dec);
+ t->needInit = False;
+ }
+
+ {
+ ELzmaStatus status;
+ size_t srcProcessed = srcSize;
+ Bool blockWasFinished =
+ ((int)t->parseStatus == LZMA_STATUS_FINISHED_WITH_MARK
+ || t->parseStatus == LZMA2_PARSE_STATUS_NEW_BLOCK);
+
+ SRes res = Lzma2Dec_DecodeToDic(&t->dec,
+ t->outPreSize,
+ src, &srcProcessed,
+ blockWasFinished ? LZMA_FINISH_END : LZMA_FINISH_ANY,
+ &status);
+
+ t->codeRes = res;
+
+ t->inCodeSize += srcProcessed;
+ *inCodePos = t->inCodeSize;
+ t->outCodeSize = t->dec.decoder.dicPos;
+ *outCodePos = t->dec.decoder.dicPos;
+
+ if (res != SZ_OK)
+ return res;
+
+ if (srcProcessed == srcSize)
+ *stop = False;
+
+ if (blockWasFinished)
+ {
+ if (srcSize != srcProcessed)
+ return SZ_ERROR_FAIL;
+
+ if (t->inPreSize == t->inCodeSize)
+ {
+ if (t->outPreSize != t->outCodeSize)
+ return SZ_ERROR_FAIL;
+ *stop = True;
+ }
+ }
+ else
+ {
+ if (t->outPreSize == t->outCodeSize)
+ *stop = True;
+ }
+
+ return SZ_OK;
+ }
+}
+
+
+#define LZMA2DECMT_STREAM_WRITE_STEP (1 << 24)
+
+static SRes Lzma2DecMt_MtCallback_Write(void *pp, unsigned coderIndex,
+ Bool needWriteToStream,
+ const Byte *src, size_t srcSize,
+ Bool *needContinue, Bool *canRecode)
+{
+ CLzma2DecMt *me = (CLzma2DecMt *)pp;
+ const CLzma2DecMtThread *t = &me->coders[coderIndex];
+ size_t size = t->outCodeSize;
+ const Byte *data = t->outBuf;
+ Bool needContinue2 = True;
+
+ PRF_STR_INT_2("Write", coderIndex, srcSize);
+
+ *needContinue = False;
+ *canRecode = True;
+ UNUSED_VAR(src)
+ UNUSED_VAR(srcSize)
+
+ if (
+ // t->parseStatus == LZMA_STATUS_FINISHED_WITH_MARK
+ t->state == MTDEC_PARSE_OVERFLOW
+ || t->state == MTDEC_PARSE_END)
+ needContinue2 = False;
+
+
+ if (!needWriteToStream)
+ return SZ_OK;
+
+ me->mtc.inProcessed += t->inCodeSize;
+
+ if (t->codeRes == SZ_OK)
+ if ((int)t->parseStatus == LZMA_STATUS_FINISHED_WITH_MARK
+ || t->parseStatus == LZMA2_PARSE_STATUS_NEW_BLOCK)
+ if (t->outPreSize != t->outCodeSize
+ || t->inPreSize != t->inCodeSize)
+ return SZ_ERROR_FAIL;
+
+ *canRecode = False;
+
+ if (me->outStream)
+ {
+ for (;;)
+ {
+ size_t cur = size;
+ size_t written;
+ if (cur > LZMA2DECMT_STREAM_WRITE_STEP)
+ cur = LZMA2DECMT_STREAM_WRITE_STEP;
+
+ written = ISeqOutStream_Write(me->outStream, data, cur);
+
+ me->outProcessed += written;
+ // me->mtc.writtenTotal += written;
+ if (written != cur)
+ return SZ_ERROR_WRITE;
+ data += cur;
+ size -= cur;
+ if (size == 0)
+ {
+ *needContinue = needContinue2;
+ return SZ_OK;
+ }
+ RINOK(MtProgress_ProgressAdd(&me->mtc.mtProgress, 0, 0));
+ }
+ }
+
+ return SZ_ERROR_FAIL;
+ /*
+ if (size > me->outBufSize)
+ return SZ_ERROR_OUTPUT_EOF;
+ memcpy(me->outBuf, data, size);
+ me->outBufSize -= size;
+ me->outBuf += size;
+ *needContinue = needContinue2;
+ return SZ_OK;
+ */
+}
+
+#endif
+
+
+static SRes Lzma2Dec_Prepare_ST(CLzma2DecMt *p)
+{
+ if (!p->dec_created)
+ {
+ Lzma2Dec_Construct(&p->dec);
+ p->dec_created = True;
+ }
+
+ RINOK(Lzma2Dec_Allocate(&p->dec, p->prop, &p->alignOffsetAlloc.vt));
+
+ if (!p->inBuf || p->inBufSize != p->props.inBufSize_ST)
+ {
+ ISzAlloc_Free(p->allocMid, p->inBuf);
+ p->inBufSize = 0;
+ p->inBuf = (Byte *)ISzAlloc_Alloc(p->allocMid, p->props.inBufSize_ST);
+ if (!p->inBuf)
+ return SZ_ERROR_MEM;
+ p->inBufSize = p->props.inBufSize_ST;
+ }
+
+ Lzma2Dec_Init(&p->dec);
+
+ return SZ_OK;
+}
+
+
+static SRes Lzma2Dec_Decode_ST(CLzma2DecMt *p
+ #ifndef _7ZIP_ST
+ , Bool tMode
+ #endif
+ )
+{
+ SizeT wrPos;
+ size_t inPos, inLim;
+ const Byte *inData;
+ UInt64 inPrev, outPrev;
+
+ CLzma2Dec *dec;
+
+ #ifndef _7ZIP_ST
+ if (tMode)
+ {
+ Lzma2DecMt_FreeOutBufs(p);
+ tMode = MtDec_PrepareRead(&p->mtc);
+ }
+ #endif
+
+ RINOK(Lzma2Dec_Prepare_ST(p));
+
+ dec = &p->dec;
+
+ inPrev = p->inProcessed;
+ outPrev = p->outProcessed;
+
+ inPos = 0;
+ inLim = 0;
+ inData = NULL;
+ wrPos = dec->decoder.dicPos;
+
+ for (;;)
+ {
+ SizeT dicPos;
+ SizeT size;
+ ELzmaFinishMode finishMode;
+ SizeT inProcessed;
+ ELzmaStatus status;
+ SRes res;
+
+ SizeT outProcessed;
+ Bool outFinished;
+ Bool needStop;
+
+ if (inPos == inLim)
+ {
+ #ifndef _7ZIP_ST
+ if (tMode)
+ {
+ inData = MtDec_Read(&p->mtc, &inLim);
+ inPos = 0;
+ if (inData)
+ continue;
+ tMode = False;
+ inLim = 0;
+ }
+ #endif
+
+ if (!p->readWasFinished)
+ {
+ inPos = 0;
+ inLim = p->inBufSize;
+ inData = p->inBuf;
+ p->readRes = ISeqInStream_Read(p->inStream, (void *)inData, &inLim);
+ // p->readProcessed += inLim;
+ // inLim -= 5; p->readWasFinished = True; // for test
+ if (inLim == 0 || p->readRes != SZ_OK)
+ p->readWasFinished = True;
+ }
+ }
+
+ dicPos = dec->decoder.dicPos;
+ {
+ SizeT next = dec->decoder.dicBufSize;
+ if (next - wrPos > p->props.outStep_ST)
+ next = wrPos + p->props.outStep_ST;
+ size = next - dicPos;
+ }
+
+ finishMode = LZMA_FINISH_ANY;
+ if (p->outSize_Defined)
+ {
+ const UInt64 rem = p->outSize - p->outProcessed;
+ if (size >= rem)
+ {
+ size = (SizeT)rem;
+ if (p->finishMode)
+ finishMode = LZMA_FINISH_END;
+ }
+ }
+
+ inProcessed = inLim - inPos;
+
+ res = Lzma2Dec_DecodeToDic(dec, dicPos + size, inData + inPos, &inProcessed, finishMode, &status);
+
+ inPos += inProcessed;
+ p->inProcessed += inProcessed;
+ outProcessed = dec->decoder.dicPos - dicPos;
+ p->outProcessed += outProcessed;
+
+ outFinished = (p->outSize_Defined && p->outSize <= p->outProcessed);
+
+ needStop = (res != SZ_OK
+ || (inProcessed == 0 && outProcessed == 0)
+ || status == LZMA_STATUS_FINISHED_WITH_MARK
+ || (!p->finishMode && outFinished));
+
+ if (needStop || outProcessed >= size)
+ {
+ SRes res2;
+ {
+ size_t writeSize = dec->decoder.dicPos - wrPos;
+ size_t written = ISeqOutStream_Write(p->outStream, dec->decoder.dic + wrPos, writeSize);
+ res2 = (written == writeSize) ? SZ_OK : SZ_ERROR_WRITE;
+ }
+
+ if (dec->decoder.dicPos == dec->decoder.dicBufSize)
+ dec->decoder.dicPos = 0;
+ wrPos = dec->decoder.dicPos;
+
+ RINOK(res2);
+
+ if (needStop)
+ {
+ if (res != SZ_OK)
+ return res;
+
+ if (status == LZMA_STATUS_FINISHED_WITH_MARK)
+ {
+ if (p->finishMode)
+ {
+ if (p->outSize_Defined && p->outSize != p->outProcessed)
+ return SZ_ERROR_DATA;
+ }
+ return SZ_OK;
+ }
+
+ if (!p->finishMode && outFinished)
+ return SZ_OK;
+
+ if (status == LZMA_STATUS_NEEDS_MORE_INPUT)
+ return SZ_ERROR_INPUT_EOF;
+
+ return SZ_ERROR_DATA;
+ }
+ }
+
+ if (p->progress)
+ {
+ UInt64 inDelta = p->inProcessed - inPrev;
+ UInt64 outDelta = p->outProcessed - outPrev;
+ if (inDelta >= (1 << 22) || outDelta >= (1 << 22))
+ {
+ RINOK(ICompressProgress_Progress(p->progress, p->inProcessed, p->outProcessed));
+ inPrev = p->inProcessed;
+ outPrev = p->outProcessed;
+ }
+ }
+ }
+}
+
+
+
+SRes Lzma2DecMt_Decode(CLzma2DecMtHandle pp,
+ Byte prop,
+ const CLzma2DecMtProps *props,
+ ISeqOutStream *outStream, const UInt64 *outDataSize, int finishMode,
+ // Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ // const Byte *inData, size_t inDataSize,
+ UInt64 *inProcessed,
+ // UInt64 *outProcessed,
+ int *isMT,
+ ICompressProgress *progress)
+{
+ CLzma2DecMt *p = (CLzma2DecMt *)pp;
+ #ifndef _7ZIP_ST
+ Bool tMode;
+ #endif
+
+ *inProcessed = 0;
+
+ if (prop > 40)
+ return SZ_ERROR_UNSUPPORTED;
+
+ p->prop = prop;
+ p->props = *props;
+
+ p->inStream = inStream;
+ p->outStream = outStream;
+ p->progress = progress;
+
+ p->outSize = 0;
+ p->outSize_Defined = False;
+ if (outDataSize)
+ {
+ p->outSize_Defined = True;
+ p->outSize = *outDataSize;
+ }
+ p->finishMode = finishMode;
+
+ p->outProcessed = 0;
+ p->inProcessed = 0;
+
+ p->readWasFinished = False;
+
+ *isMT = False;
+
+
+ #ifndef _7ZIP_ST
+
+ tMode = False;
+
+ // p->mtc.parseRes = SZ_OK;
+
+ // p->mtc.numFilledThreads = 0;
+ // p->mtc.crossStart = 0;
+ // p->mtc.crossEnd = 0;
+ // p->mtc.allocError_for_Read_BlockIndex = 0;
+ // p->mtc.isAllocError = False;
+
+ if (p->props.numThreads > 1)
+ {
+ IMtDecCallback vt;
+
+ Lzma2DecMt_FreeSt(p);
+
+ p->outProcessed_Parse = 0;
+
+ if (!p->mtc_WasConstructed)
+ {
+ p->mtc_WasConstructed = True;
+ MtDec_Construct(&p->mtc);
+ }
+
+ p->mtc.progress = progress;
+ p->mtc.inStream = inStream;
+
+ // p->outBuf = NULL;
+ // p->outBufSize = 0;
+ /*
+ if (!outStream)
+ {
+ // p->outBuf = outBuf;
+ // p->outBufSize = *outBufSize;
+ // *outBufSize = 0;
+ return SZ_ERROR_PARAM;
+ }
+ */
+
+ // p->mtc.inBlockMax = p->props.inBlockMax;
+ p->mtc.alloc = &p->alignOffsetAlloc.vt;
+ // p->alignOffsetAlloc.baseAlloc;
+ // p->mtc.inData = inData;
+ // p->mtc.inDataSize = inDataSize;
+ p->mtc.mtCallback = &vt;
+ p->mtc.mtCallbackObject = p;
+
+ p->mtc.inBufSize = p->props.inBufSize_MT;
+
+ p->mtc.numThreadsMax = p->props.numThreads;
+
+ *isMT = True;
+
+ vt.Parse = Lzma2DecMt_MtCallback_Parse;
+ vt.PreCode = Lzma2DecMt_MtCallback_PreCode;
+ vt.Code = Lzma2DecMt_MtCallback_Code;
+ vt.Write = Lzma2DecMt_MtCallback_Write;
+
+ {
+ Bool needContinue = False;
+
+ SRes res = MtDec_Code(&p->mtc);
+
+ /*
+ if (!outStream)
+ *outBufSize = p->outBuf - outBuf;
+ */
+
+ *inProcessed = p->mtc.inProcessed;
+
+ needContinue = False;
+
+ if (res == SZ_OK)
+ {
+ if (p->mtc.mtProgress.res != SZ_OK)
+ res = p->mtc.mtProgress.res;
+ else
+ needContinue = p->mtc.needContinue;
+ }
+
+ if (!needContinue)
+ {
+ if (res == SZ_OK)
+ return p->mtc.readRes;
+ return res;
+ }
+
+ tMode = True;
+ p->readRes = p->mtc.readRes;
+ p->readWasFinished = p->mtc.readWasFinished;
+ p->inProcessed = p->mtc.inProcessed;
+
+ PRF_STR("----- decoding ST -----");
+ }
+ }
+
+ #endif
+
+
+ *isMT = False;
+
+ {
+ SRes res = Lzma2Dec_Decode_ST(p
+ #ifndef _7ZIP_ST
+ , tMode
+ #endif
+ );
+
+ *inProcessed = p->inProcessed;
+
+ // res = SZ_OK; // for test
+ if (res == SZ_OK && p->readRes != SZ_OK)
+ res = p->readRes;
+
+ /*
+ #ifndef _7ZIP_ST
+ if (res == SZ_OK && tMode && p->mtc.parseRes != SZ_OK)
+ res = p->mtc.parseRes;
+ #endif
+ */
+
+ return res;
+ }
+}
+
+
+/* ---------- Read from CLzma2DecMtHandle Interface ---------- */
+
+SRes Lzma2DecMt_Init(CLzma2DecMtHandle pp,
+ Byte prop,
+ const CLzma2DecMtProps *props,
+ const UInt64 *outDataSize, int finishMode,
+ ISeqInStream *inStream)
+{
+ CLzma2DecMt *p = (CLzma2DecMt *)pp;
+
+ if (prop > 40)
+ return SZ_ERROR_UNSUPPORTED;
+
+ p->prop = prop;
+ p->props = *props;
+
+ p->inStream = inStream;
+
+ p->outSize = 0;
+ p->outSize_Defined = False;
+ if (outDataSize)
+ {
+ p->outSize_Defined = True;
+ p->outSize = *outDataSize;
+ }
+ p->finishMode = finishMode;
+
+ p->outProcessed = 0;
+ p->inProcessed = 0;
+
+ p->inPos = 0;
+ p->inLim = 0;
+
+ return Lzma2Dec_Prepare_ST(p);
+}
+
+
+SRes Lzma2DecMt_Read(CLzma2DecMtHandle pp,
+ Byte *data, size_t *outSize,
+ UInt64 *inStreamProcessed)
+{
+ CLzma2DecMt *p = (CLzma2DecMt *)pp;
+ ELzmaFinishMode finishMode;
+ SRes readRes;
+ size_t size = *outSize;
+
+ *outSize = 0;
+ *inStreamProcessed = 0;
+
+ finishMode = LZMA_FINISH_ANY;
+ if (p->outSize_Defined)
+ {
+ const UInt64 rem = p->outSize - p->outProcessed;
+ if (size >= rem)
+ {
+ size = (size_t)rem;
+ if (p->finishMode)
+ finishMode = LZMA_FINISH_END;
+ }
+ }
+
+ readRes = SZ_OK;
+
+ for (;;)
+ {
+ SizeT inCur;
+ SizeT outCur;
+ ELzmaStatus status;
+ SRes res;
+
+ if (p->inPos == p->inLim && readRes == SZ_OK)
+ {
+ p->inPos = 0;
+ p->inLim = p->props.inBufSize_ST;
+ readRes = ISeqInStream_Read(p->inStream, p->inBuf, &p->inLim);
+ }
+
+ inCur = p->inLim - p->inPos;
+ outCur = size;
+
+ res = Lzma2Dec_DecodeToBuf(&p->dec, data, &outCur,
+ p->inBuf + p->inPos, &inCur, finishMode, &status);
+
+ p->inPos += inCur;
+ p->inProcessed += inCur;
+ *inStreamProcessed += inCur;
+ p->outProcessed += outCur;
+ *outSize += outCur;
+ size -= outCur;
+ data += outCur;
+
+ if (res != 0)
+ return res;
+
+ /*
+ if (status == LZMA_STATUS_FINISHED_WITH_MARK)
+ return readRes;
+
+ if (size == 0 && status != LZMA_STATUS_NEEDS_MORE_INPUT)
+ {
+ if (p->finishMode && p->outSize_Defined && p->outProcessed >= p->outSize)
+ return SZ_ERROR_DATA;
+ return readRes;
+ }
+ */
+
+ if (inCur == 0 && outCur == 0)
+ return readRes;
+ }
+}
diff --git a/other-licenses/7zstub/src/C/Lzma2DecMt.h b/other-licenses/7zstub/src/C/Lzma2DecMt.h
new file mode 100644
index 0000000000..96f89a3ca2
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma2DecMt.h
@@ -0,0 +1,79 @@
+/* Lzma2DecMt.h -- LZMA2 Decoder Multi-thread
+2018-02-17 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA2_DEC_MT_H
+#define __LZMA2_DEC_MT_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+typedef struct
+{
+ size_t inBufSize_ST;
+ size_t outStep_ST;
+
+ #ifndef _7ZIP_ST
+ unsigned numThreads;
+ size_t inBufSize_MT;
+ size_t outBlockMax;
+ size_t inBlockMax;
+ #endif
+} CLzma2DecMtProps;
+
+/* init to single-thread mode */
+void Lzma2DecMtProps_Init(CLzma2DecMtProps *p);
+
+
+/* ---------- CLzma2DecMtHandle Interface ---------- */
+
+/* Lzma2DecMt_ * functions can return the following exit codes:
+SRes:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater in props
+ SZ_ERROR_WRITE - ISeqOutStream write callback error
+ // SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
+ SZ_ERROR_PROGRESS - some break from progress callback
+ SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
+*/
+
+typedef void * CLzma2DecMtHandle;
+
+CLzma2DecMtHandle Lzma2DecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid);
+void Lzma2DecMt_Destroy(CLzma2DecMtHandle p);
+
+SRes Lzma2DecMt_Decode(CLzma2DecMtHandle p,
+ Byte prop,
+ const CLzma2DecMtProps *props,
+ ISeqOutStream *outStream,
+ const UInt64 *outDataSize, // NULL means undefined
+ int finishMode, // 0 - partial unpacking is allowed, 1 - if lzma2 stream must be finished
+ // Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ // const Byte *inData, size_t inDataSize,
+
+ // out variables:
+ UInt64 *inProcessed,
+ int *isMT, /* out: (*isMT == 0), if single thread decoding was used */
+
+ // UInt64 *outProcessed,
+ ICompressProgress *progress);
+
+
+/* ---------- Read from CLzma2DecMtHandle Interface ---------- */
+
+SRes Lzma2DecMt_Init(CLzma2DecMtHandle pp,
+ Byte prop,
+ const CLzma2DecMtProps *props,
+ const UInt64 *outDataSize, int finishMode,
+ ISeqInStream *inStream);
+
+SRes Lzma2DecMt_Read(CLzma2DecMtHandle pp,
+ Byte *data, size_t *outSize,
+ UInt64 *inStreamProcessed);
+
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Lzma2Enc.c b/other-licenses/7zstub/src/C/Lzma2Enc.c
new file mode 100644
index 0000000000..5098195c12
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma2Enc.c
@@ -0,0 +1,803 @@
+/* Lzma2Enc.c -- LZMA2 Encoder
+2018-04-27 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+/* #define _7ZIP_ST */
+
+#include "Lzma2Enc.h"
+
+#ifndef _7ZIP_ST
+#include "MtCoder.h"
+#else
+#define MTCODER__THREADS_MAX 1
+#endif
+
+#define LZMA2_CONTROL_LZMA (1 << 7)
+#define LZMA2_CONTROL_COPY_NO_RESET 2
+#define LZMA2_CONTROL_COPY_RESET_DIC 1
+#define LZMA2_CONTROL_EOF 0
+
+#define LZMA2_LCLP_MAX 4
+
+#define LZMA2_DIC_SIZE_FROM_PROP(p) (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11))
+
+#define LZMA2_PACK_SIZE_MAX (1 << 16)
+#define LZMA2_COPY_CHUNK_SIZE LZMA2_PACK_SIZE_MAX
+#define LZMA2_UNPACK_SIZE_MAX (1 << 21)
+#define LZMA2_KEEP_WINDOW_SIZE LZMA2_UNPACK_SIZE_MAX
+
+#define LZMA2_CHUNK_SIZE_COMPRESSED_MAX ((1 << 16) + 16)
+
+
+#define PRF(x) /* x */
+
+
+/* ---------- CLimitedSeqInStream ---------- */
+
+typedef struct
+{
+ ISeqInStream vt;
+ ISeqInStream *realStream;
+ UInt64 limit;
+ UInt64 processed;
+ int finished;
+} CLimitedSeqInStream;
+
+static void LimitedSeqInStream_Init(CLimitedSeqInStream *p)
+{
+ p->limit = (UInt64)(Int64)-1;
+ p->processed = 0;
+ p->finished = 0;
+}
+
+static SRes LimitedSeqInStream_Read(const ISeqInStream *pp, void *data, size_t *size)
+{
+ CLimitedSeqInStream *p = CONTAINER_FROM_VTBL(pp, CLimitedSeqInStream, vt);
+ size_t size2 = *size;
+ SRes res = SZ_OK;
+
+ if (p->limit != (UInt64)(Int64)-1)
+ {
+ UInt64 rem = p->limit - p->processed;
+ if (size2 > rem)
+ size2 = (size_t)rem;
+ }
+ if (size2 != 0)
+ {
+ res = ISeqInStream_Read(p->realStream, data, &size2);
+ p->finished = (size2 == 0 ? 1 : 0);
+ p->processed += size2;
+ }
+ *size = size2;
+ return res;
+}
+
+
+/* ---------- CLzma2EncInt ---------- */
+
+typedef struct
+{
+ CLzmaEncHandle enc;
+ Byte propsAreSet;
+ Byte propsByte;
+ Byte needInitState;
+ Byte needInitProp;
+ UInt64 srcPos;
+} CLzma2EncInt;
+
+
+static SRes Lzma2EncInt_InitStream(CLzma2EncInt *p, const CLzma2EncProps *props)
+{
+ if (!p->propsAreSet)
+ {
+ SizeT propsSize = LZMA_PROPS_SIZE;
+ Byte propsEncoded[LZMA_PROPS_SIZE];
+ RINOK(LzmaEnc_SetProps(p->enc, &props->lzmaProps));
+ RINOK(LzmaEnc_WriteProperties(p->enc, propsEncoded, &propsSize));
+ p->propsByte = propsEncoded[0];
+ p->propsAreSet = True;
+ }
+ return SZ_OK;
+}
+
+static void Lzma2EncInt_InitBlock(CLzma2EncInt *p)
+{
+ p->srcPos = 0;
+ p->needInitState = True;
+ p->needInitProp = True;
+}
+
+
+SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, ISeqInStream *inStream, UInt32 keepWindowSize,
+ ISzAllocPtr alloc, ISzAllocPtr allocBig);
+SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
+ UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig);
+SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
+ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize);
+const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp);
+void LzmaEnc_Finish(CLzmaEncHandle pp);
+void LzmaEnc_SaveState(CLzmaEncHandle pp);
+void LzmaEnc_RestoreState(CLzmaEncHandle pp);
+
+/*
+UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp);
+*/
+
+static SRes Lzma2EncInt_EncodeSubblock(CLzma2EncInt *p, Byte *outBuf,
+ size_t *packSizeRes, ISeqOutStream *outStream)
+{
+ size_t packSizeLimit = *packSizeRes;
+ size_t packSize = packSizeLimit;
+ UInt32 unpackSize = LZMA2_UNPACK_SIZE_MAX;
+ unsigned lzHeaderSize = 5 + (p->needInitProp ? 1 : 0);
+ Bool useCopyBlock;
+ SRes res;
+
+ *packSizeRes = 0;
+ if (packSize < lzHeaderSize)
+ return SZ_ERROR_OUTPUT_EOF;
+ packSize -= lzHeaderSize;
+
+ LzmaEnc_SaveState(p->enc);
+ res = LzmaEnc_CodeOneMemBlock(p->enc, p->needInitState,
+ outBuf + lzHeaderSize, &packSize, LZMA2_PACK_SIZE_MAX, &unpackSize);
+
+ PRF(printf("\npackSize = %7d unpackSize = %7d ", packSize, unpackSize));
+
+ if (unpackSize == 0)
+ return res;
+
+ if (res == SZ_OK)
+ useCopyBlock = (packSize + 2 >= unpackSize || packSize > (1 << 16));
+ else
+ {
+ if (res != SZ_ERROR_OUTPUT_EOF)
+ return res;
+ res = SZ_OK;
+ useCopyBlock = True;
+ }
+
+ if (useCopyBlock)
+ {
+ size_t destPos = 0;
+ PRF(printf("################# COPY "));
+
+ while (unpackSize > 0)
+ {
+ UInt32 u = (unpackSize < LZMA2_COPY_CHUNK_SIZE) ? unpackSize : LZMA2_COPY_CHUNK_SIZE;
+ if (packSizeLimit - destPos < u + 3)
+ return SZ_ERROR_OUTPUT_EOF;
+ outBuf[destPos++] = (Byte)(p->srcPos == 0 ? LZMA2_CONTROL_COPY_RESET_DIC : LZMA2_CONTROL_COPY_NO_RESET);
+ outBuf[destPos++] = (Byte)((u - 1) >> 8);
+ outBuf[destPos++] = (Byte)(u - 1);
+ memcpy(outBuf + destPos, LzmaEnc_GetCurBuf(p->enc) - unpackSize, u);
+ unpackSize -= u;
+ destPos += u;
+ p->srcPos += u;
+
+ if (outStream)
+ {
+ *packSizeRes += destPos;
+ if (ISeqOutStream_Write(outStream, outBuf, destPos) != destPos)
+ return SZ_ERROR_WRITE;
+ destPos = 0;
+ }
+ else
+ *packSizeRes = destPos;
+ /* needInitState = True; */
+ }
+
+ LzmaEnc_RestoreState(p->enc);
+ return SZ_OK;
+ }
+
+ {
+ size_t destPos = 0;
+ UInt32 u = unpackSize - 1;
+ UInt32 pm = (UInt32)(packSize - 1);
+ unsigned mode = (p->srcPos == 0) ? 3 : (p->needInitState ? (p->needInitProp ? 2 : 1) : 0);
+
+ PRF(printf(" "));
+
+ outBuf[destPos++] = (Byte)(LZMA2_CONTROL_LZMA | (mode << 5) | ((u >> 16) & 0x1F));
+ outBuf[destPos++] = (Byte)(u >> 8);
+ outBuf[destPos++] = (Byte)u;
+ outBuf[destPos++] = (Byte)(pm >> 8);
+ outBuf[destPos++] = (Byte)pm;
+
+ if (p->needInitProp)
+ outBuf[destPos++] = p->propsByte;
+
+ p->needInitProp = False;
+ p->needInitState = False;
+ destPos += packSize;
+ p->srcPos += unpackSize;
+
+ if (outStream)
+ if (ISeqOutStream_Write(outStream, outBuf, destPos) != destPos)
+ return SZ_ERROR_WRITE;
+
+ *packSizeRes = destPos;
+ return SZ_OK;
+ }
+}
+
+
+/* ---------- Lzma2 Props ---------- */
+
+void Lzma2EncProps_Init(CLzma2EncProps *p)
+{
+ LzmaEncProps_Init(&p->lzmaProps);
+ p->blockSize = LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO;
+ p->numBlockThreads_Reduced = -1;
+ p->numBlockThreads_Max = -1;
+ p->numTotalThreads = -1;
+}
+
+void Lzma2EncProps_Normalize(CLzma2EncProps *p)
+{
+ UInt64 fileSize;
+ int t1, t1n, t2, t2r, t3;
+ {
+ CLzmaEncProps lzmaProps = p->lzmaProps;
+ LzmaEncProps_Normalize(&lzmaProps);
+ t1n = lzmaProps.numThreads;
+ }
+
+ t1 = p->lzmaProps.numThreads;
+ t2 = p->numBlockThreads_Max;
+ t3 = p->numTotalThreads;
+
+ if (t2 > MTCODER__THREADS_MAX)
+ t2 = MTCODER__THREADS_MAX;
+
+ if (t3 <= 0)
+ {
+ if (t2 <= 0)
+ t2 = 1;
+ t3 = t1n * t2;
+ }
+ else if (t2 <= 0)
+ {
+ t2 = t3 / t1n;
+ if (t2 == 0)
+ {
+ t1 = 1;
+ t2 = t3;
+ }
+ if (t2 > MTCODER__THREADS_MAX)
+ t2 = MTCODER__THREADS_MAX;
+ }
+ else if (t1 <= 0)
+ {
+ t1 = t3 / t2;
+ if (t1 == 0)
+ t1 = 1;
+ }
+ else
+ t3 = t1n * t2;
+
+ p->lzmaProps.numThreads = t1;
+
+ t2r = t2;
+
+ fileSize = p->lzmaProps.reduceSize;
+
+ if ( p->blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
+ && p->blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO
+ && (p->blockSize < fileSize || fileSize == (UInt64)(Int64)-1))
+ p->lzmaProps.reduceSize = p->blockSize;
+
+ LzmaEncProps_Normalize(&p->lzmaProps);
+
+ p->lzmaProps.reduceSize = fileSize;
+
+ t1 = p->lzmaProps.numThreads;
+
+ if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID)
+ {
+ t2r = t2 = 1;
+ t3 = t1;
+ }
+ else if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO && t2 <= 1)
+ {
+ /* if there is no block multi-threading, we use SOLID block */
+ p->blockSize = LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID;
+ }
+ else
+ {
+ if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO)
+ {
+ const UInt32 kMinSize = (UInt32)1 << 20;
+ const UInt32 kMaxSize = (UInt32)1 << 28;
+ const UInt32 dictSize = p->lzmaProps.dictSize;
+ UInt64 blockSize = (UInt64)dictSize << 2;
+ if (blockSize < kMinSize) blockSize = kMinSize;
+ if (blockSize > kMaxSize) blockSize = kMaxSize;
+ if (blockSize < dictSize) blockSize = dictSize;
+ blockSize += (kMinSize - 1);
+ blockSize &= ~(UInt64)(kMinSize - 1);
+ p->blockSize = blockSize;
+ }
+
+ if (t2 > 1 && fileSize != (UInt64)(Int64)-1)
+ {
+ UInt64 numBlocks = fileSize / p->blockSize;
+ if (numBlocks * p->blockSize != fileSize)
+ numBlocks++;
+ if (numBlocks < (unsigned)t2)
+ {
+ t2r = (unsigned)numBlocks;
+ if (t2r == 0)
+ t2r = 1;
+ t3 = t1 * t2r;
+ }
+ }
+ }
+
+ p->numBlockThreads_Max = t2;
+ p->numBlockThreads_Reduced = t2r;
+ p->numTotalThreads = t3;
+}
+
+
+static SRes Progress(ICompressProgress *p, UInt64 inSize, UInt64 outSize)
+{
+ return (p && ICompressProgress_Progress(p, inSize, outSize) != SZ_OK) ? SZ_ERROR_PROGRESS : SZ_OK;
+}
+
+
+/* ---------- Lzma2 ---------- */
+
+typedef struct
+{
+ Byte propEncoded;
+ CLzma2EncProps props;
+ UInt64 expectedDataSize;
+
+ Byte *tempBufLzma;
+
+ ISzAllocPtr alloc;
+ ISzAllocPtr allocBig;
+
+ CLzma2EncInt coders[MTCODER__THREADS_MAX];
+
+ #ifndef _7ZIP_ST
+
+ ISeqOutStream *outStream;
+ Byte *outBuf;
+ size_t outBuf_Rem; /* remainder in outBuf */
+
+ size_t outBufSize; /* size of allocated outBufs[i] */
+ size_t outBufsDataSizes[MTCODER__BLOCKS_MAX];
+ Bool mtCoder_WasConstructed;
+ CMtCoder mtCoder;
+ Byte *outBufs[MTCODER__BLOCKS_MAX];
+
+ #endif
+
+} CLzma2Enc;
+
+
+
+CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ CLzma2Enc *p = (CLzma2Enc *)ISzAlloc_Alloc(alloc, sizeof(CLzma2Enc));
+ if (!p)
+ return NULL;
+ Lzma2EncProps_Init(&p->props);
+ Lzma2EncProps_Normalize(&p->props);
+ p->expectedDataSize = (UInt64)(Int64)-1;
+ p->tempBufLzma = NULL;
+ p->alloc = alloc;
+ p->allocBig = allocBig;
+ {
+ unsigned i;
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ p->coders[i].enc = NULL;
+ }
+
+ #ifndef _7ZIP_ST
+ p->mtCoder_WasConstructed = False;
+ {
+ unsigned i;
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ p->outBufs[i] = NULL;
+ p->outBufSize = 0;
+ }
+ #endif
+
+ return p;
+}
+
+
+#ifndef _7ZIP_ST
+
+static void Lzma2Enc_FreeOutBufs(CLzma2Enc *p)
+{
+ unsigned i;
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ if (p->outBufs[i])
+ {
+ ISzAlloc_Free(p->alloc, p->outBufs[i]);
+ p->outBufs[i] = NULL;
+ }
+ p->outBufSize = 0;
+}
+
+#endif
+
+
+void Lzma2Enc_Destroy(CLzma2EncHandle pp)
+{
+ CLzma2Enc *p = (CLzma2Enc *)pp;
+ unsigned i;
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ {
+ CLzma2EncInt *t = &p->coders[i];
+ if (t->enc)
+ {
+ LzmaEnc_Destroy(t->enc, p->alloc, p->allocBig);
+ t->enc = NULL;
+ }
+ }
+
+
+ #ifndef _7ZIP_ST
+ if (p->mtCoder_WasConstructed)
+ {
+ MtCoder_Destruct(&p->mtCoder);
+ p->mtCoder_WasConstructed = False;
+ }
+ Lzma2Enc_FreeOutBufs(p);
+ #endif
+
+ ISzAlloc_Free(p->alloc, p->tempBufLzma);
+ p->tempBufLzma = NULL;
+
+ ISzAlloc_Free(p->alloc, pp);
+}
+
+
+SRes Lzma2Enc_SetProps(CLzma2EncHandle pp, const CLzma2EncProps *props)
+{
+ CLzma2Enc *p = (CLzma2Enc *)pp;
+ CLzmaEncProps lzmaProps = props->lzmaProps;
+ LzmaEncProps_Normalize(&lzmaProps);
+ if (lzmaProps.lc + lzmaProps.lp > LZMA2_LCLP_MAX)
+ return SZ_ERROR_PARAM;
+ p->props = *props;
+ Lzma2EncProps_Normalize(&p->props);
+ return SZ_OK;
+}
+
+
+void Lzma2Enc_SetDataSize(CLzmaEncHandle pp, UInt64 expectedDataSiize)
+{
+ CLzma2Enc *p = (CLzma2Enc *)pp;
+ p->expectedDataSize = expectedDataSiize;
+}
+
+
+Byte Lzma2Enc_WriteProperties(CLzma2EncHandle pp)
+{
+ CLzma2Enc *p = (CLzma2Enc *)pp;
+ unsigned i;
+ UInt32 dicSize = LzmaEncProps_GetDictSize(&p->props.lzmaProps);
+ for (i = 0; i < 40; i++)
+ if (dicSize <= LZMA2_DIC_SIZE_FROM_PROP(i))
+ break;
+ return (Byte)i;
+}
+
+
+static SRes Lzma2Enc_EncodeMt1(
+ CLzma2Enc *me,
+ CLzma2EncInt *p,
+ ISeqOutStream *outStream,
+ Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ const Byte *inData, size_t inDataSize,
+ int finished,
+ ICompressProgress *progress)
+{
+ UInt64 unpackTotal = 0;
+ UInt64 packTotal = 0;
+ size_t outLim = 0;
+ CLimitedSeqInStream limitedInStream;
+
+ if (outBuf)
+ {
+ outLim = *outBufSize;
+ *outBufSize = 0;
+ }
+
+ if (!p->enc)
+ {
+ p->propsAreSet = False;
+ p->enc = LzmaEnc_Create(me->alloc);
+ if (!p->enc)
+ return SZ_ERROR_MEM;
+ }
+
+ limitedInStream.realStream = inStream;
+ if (inStream)
+ {
+ limitedInStream.vt.Read = LimitedSeqInStream_Read;
+ }
+
+ if (!outBuf)
+ {
+ // outStream version works only in one thread. So we use CLzma2Enc::tempBufLzma
+ if (!me->tempBufLzma)
+ {
+ me->tempBufLzma = (Byte *)ISzAlloc_Alloc(me->alloc, LZMA2_CHUNK_SIZE_COMPRESSED_MAX);
+ if (!me->tempBufLzma)
+ return SZ_ERROR_MEM;
+ }
+ }
+
+ RINOK(Lzma2EncInt_InitStream(p, &me->props));
+
+ for (;;)
+ {
+ SRes res = SZ_OK;
+ size_t inSizeCur = 0;
+
+ Lzma2EncInt_InitBlock(p);
+
+ LimitedSeqInStream_Init(&limitedInStream);
+ limitedInStream.limit = me->props.blockSize;
+
+ if (inStream)
+ {
+ UInt64 expected = (UInt64)(Int64)-1;
+ // inStream version works only in one thread. So we use CLzma2Enc::expectedDataSize
+ if (me->expectedDataSize != (UInt64)(Int64)-1
+ && me->expectedDataSize >= unpackTotal)
+ expected = me->expectedDataSize - unpackTotal;
+ if (me->props.blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
+ && expected > me->props.blockSize)
+ expected = (size_t)me->props.blockSize;
+
+ LzmaEnc_SetDataSize(p->enc, expected);
+
+ RINOK(LzmaEnc_PrepareForLzma2(p->enc,
+ &limitedInStream.vt,
+ LZMA2_KEEP_WINDOW_SIZE,
+ me->alloc,
+ me->allocBig));
+ }
+ else
+ {
+ inSizeCur = inDataSize - (size_t)unpackTotal;
+ if (me->props.blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
+ && inSizeCur > me->props.blockSize)
+ inSizeCur = (size_t)me->props.blockSize;
+
+ // LzmaEnc_SetDataSize(p->enc, inSizeCur);
+
+ RINOK(LzmaEnc_MemPrepare(p->enc,
+ inData + (size_t)unpackTotal, inSizeCur,
+ LZMA2_KEEP_WINDOW_SIZE,
+ me->alloc,
+ me->allocBig));
+ }
+
+ for (;;)
+ {
+ size_t packSize = LZMA2_CHUNK_SIZE_COMPRESSED_MAX;
+ if (outBuf)
+ packSize = outLim - (size_t)packTotal;
+
+ res = Lzma2EncInt_EncodeSubblock(p,
+ outBuf ? outBuf + (size_t)packTotal : me->tempBufLzma, &packSize,
+ outBuf ? NULL : outStream);
+
+ if (res != SZ_OK)
+ break;
+
+ packTotal += packSize;
+ if (outBuf)
+ *outBufSize = (size_t)packTotal;
+
+ res = Progress(progress, unpackTotal + p->srcPos, packTotal);
+ if (res != SZ_OK)
+ break;
+
+ /*
+ if (LzmaEnc_GetNumAvailableBytes(p->enc) == 0)
+ break;
+ */
+
+ if (packSize == 0)
+ break;
+ }
+
+ LzmaEnc_Finish(p->enc);
+
+ unpackTotal += p->srcPos;
+
+ RINOK(res);
+
+ if (p->srcPos != (inStream ? limitedInStream.processed : inSizeCur))
+ return SZ_ERROR_FAIL;
+
+ if (inStream ? limitedInStream.finished : (unpackTotal == inDataSize))
+ {
+ if (finished)
+ {
+ if (outBuf)
+ {
+ size_t destPos = *outBufSize;
+ if (destPos >= outLim)
+ return SZ_ERROR_OUTPUT_EOF;
+ outBuf[destPos] = 0;
+ *outBufSize = destPos + 1;
+ }
+ else
+ {
+ Byte b = 0;
+ if (ISeqOutStream_Write(outStream, &b, 1) != 1)
+ return SZ_ERROR_WRITE;
+ }
+ }
+ return SZ_OK;
+ }
+ }
+}
+
+
+
+#ifndef _7ZIP_ST
+
+static SRes Lzma2Enc_MtCallback_Code(void *pp, unsigned coderIndex, unsigned outBufIndex,
+ const Byte *src, size_t srcSize, int finished)
+{
+ CLzma2Enc *me = (CLzma2Enc *)pp;
+ size_t destSize = me->outBufSize;
+ SRes res;
+ CMtProgressThunk progressThunk;
+
+ Byte *dest = me->outBufs[outBufIndex];
+
+ me->outBufsDataSizes[outBufIndex] = 0;
+
+ if (!dest)
+ {
+ dest = (Byte *)ISzAlloc_Alloc(me->alloc, me->outBufSize);
+ if (!dest)
+ return SZ_ERROR_MEM;
+ me->outBufs[outBufIndex] = dest;
+ }
+
+ MtProgressThunk_CreateVTable(&progressThunk);
+ progressThunk.mtProgress = &me->mtCoder.mtProgress;
+ progressThunk.inSize = 0;
+ progressThunk.outSize = 0;
+
+ res = Lzma2Enc_EncodeMt1(me,
+ &me->coders[coderIndex],
+ NULL, dest, &destSize,
+ NULL, src, srcSize,
+ finished,
+ &progressThunk.vt);
+
+ me->outBufsDataSizes[outBufIndex] = destSize;
+
+ return res;
+}
+
+
+static SRes Lzma2Enc_MtCallback_Write(void *pp, unsigned outBufIndex)
+{
+ CLzma2Enc *me = (CLzma2Enc *)pp;
+ size_t size = me->outBufsDataSizes[outBufIndex];
+ const Byte *data = me->outBufs[outBufIndex];
+
+ if (me->outStream)
+ return ISeqOutStream_Write(me->outStream, data, size) == size ? SZ_OK : SZ_ERROR_WRITE;
+
+ if (size > me->outBuf_Rem)
+ return SZ_ERROR_OUTPUT_EOF;
+ memcpy(me->outBuf, data, size);
+ me->outBuf_Rem -= size;
+ me->outBuf += size;
+ return SZ_OK;
+}
+
+#endif
+
+
+
+SRes Lzma2Enc_Encode2(CLzma2EncHandle pp,
+ ISeqOutStream *outStream,
+ Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ const Byte *inData, size_t inDataSize,
+ ICompressProgress *progress)
+{
+ CLzma2Enc *p = (CLzma2Enc *)pp;
+
+ if (inStream && inData)
+ return SZ_ERROR_PARAM;
+
+ if (outStream && outBuf)
+ return SZ_ERROR_PARAM;
+
+ {
+ unsigned i;
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ p->coders[i].propsAreSet = False;
+ }
+
+ #ifndef _7ZIP_ST
+
+ if (p->props.numBlockThreads_Reduced > 1)
+ {
+ IMtCoderCallback2 vt;
+
+ if (!p->mtCoder_WasConstructed)
+ {
+ p->mtCoder_WasConstructed = True;
+ MtCoder_Construct(&p->mtCoder);
+ }
+
+ vt.Code = Lzma2Enc_MtCallback_Code;
+ vt.Write = Lzma2Enc_MtCallback_Write;
+
+ p->outStream = outStream;
+ p->outBuf = NULL;
+ p->outBuf_Rem = 0;
+ if (!outStream)
+ {
+ p->outBuf = outBuf;
+ p->outBuf_Rem = *outBufSize;
+ *outBufSize = 0;
+ }
+
+ p->mtCoder.allocBig = p->allocBig;
+ p->mtCoder.progress = progress;
+ p->mtCoder.inStream = inStream;
+ p->mtCoder.inData = inData;
+ p->mtCoder.inDataSize = inDataSize;
+ p->mtCoder.mtCallback = &vt;
+ p->mtCoder.mtCallbackObject = p;
+
+ p->mtCoder.blockSize = (size_t)p->props.blockSize;
+ if (p->mtCoder.blockSize != p->props.blockSize)
+ return SZ_ERROR_PARAM; /* SZ_ERROR_MEM */
+
+ {
+ size_t destBlockSize = p->mtCoder.blockSize + (p->mtCoder.blockSize >> 10) + 16;
+ if (destBlockSize < p->mtCoder.blockSize)
+ return SZ_ERROR_PARAM;
+ if (p->outBufSize != destBlockSize)
+ Lzma2Enc_FreeOutBufs(p);
+ p->outBufSize = destBlockSize;
+ }
+
+ p->mtCoder.numThreadsMax = p->props.numBlockThreads_Max;
+ p->mtCoder.expectedDataSize = p->expectedDataSize;
+
+ {
+ SRes res = MtCoder_Code(&p->mtCoder);
+ if (!outStream)
+ *outBufSize = p->outBuf - outBuf;
+ return res;
+ }
+ }
+
+ #endif
+
+
+ return Lzma2Enc_EncodeMt1(p,
+ &p->coders[0],
+ outStream, outBuf, outBufSize,
+ inStream, inData, inDataSize,
+ True, /* finished */
+ progress);
+}
diff --git a/other-licenses/7zstub/src/C/Lzma2Enc.h b/other-licenses/7zstub/src/C/Lzma2Enc.h
new file mode 100644
index 0000000000..65f2dd145d
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma2Enc.h
@@ -0,0 +1,55 @@
+/* Lzma2Enc.h -- LZMA2 Encoder
+2017-07-27 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA2_ENC_H
+#define __LZMA2_ENC_H
+
+#include "LzmaEnc.h"
+
+EXTERN_C_BEGIN
+
+#define LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO 0
+#define LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID ((UInt64)(Int64)-1)
+
+typedef struct
+{
+ CLzmaEncProps lzmaProps;
+ UInt64 blockSize;
+ int numBlockThreads_Reduced;
+ int numBlockThreads_Max;
+ int numTotalThreads;
+} CLzma2EncProps;
+
+void Lzma2EncProps_Init(CLzma2EncProps *p);
+void Lzma2EncProps_Normalize(CLzma2EncProps *p);
+
+/* ---------- CLzmaEnc2Handle Interface ---------- */
+
+/* Lzma2Enc_* functions can return the following exit codes:
+SRes:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater in props
+ SZ_ERROR_WRITE - ISeqOutStream write callback error
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
+ SZ_ERROR_PROGRESS - some break from progress callback
+ SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
+*/
+
+typedef void * CLzma2EncHandle;
+
+CLzma2EncHandle Lzma2Enc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig);
+void Lzma2Enc_Destroy(CLzma2EncHandle p);
+SRes Lzma2Enc_SetProps(CLzma2EncHandle p, const CLzma2EncProps *props);
+void Lzma2Enc_SetDataSize(CLzma2EncHandle p, UInt64 expectedDataSiize);
+Byte Lzma2Enc_WriteProperties(CLzma2EncHandle p);
+SRes Lzma2Enc_Encode2(CLzma2EncHandle p,
+ ISeqOutStream *outStream,
+ Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ const Byte *inData, size_t inDataSize,
+ ICompressProgress *progress);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Lzma86.h b/other-licenses/7zstub/src/C/Lzma86.h
new file mode 100644
index 0000000000..83057e5983
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma86.h
@@ -0,0 +1,111 @@
+/* Lzma86.h -- LZMA + x86 (BCJ) Filter
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA86_H
+#define __LZMA86_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define LZMA86_SIZE_OFFSET (1 + 5)
+#define LZMA86_HEADER_SIZE (LZMA86_SIZE_OFFSET + 8)
+
+/*
+It's an example for LZMA + x86 Filter use.
+You can use .lzma86 extension, if you write that stream to file.
+.lzma86 header adds one additional byte to standard .lzma header.
+.lzma86 header (14 bytes):
+ Offset Size Description
+ 0 1 = 0 - no filter, pure LZMA
+ = 1 - x86 filter + LZMA
+ 1 1 lc, lp and pb in encoded form
+ 2 4 dictSize (little endian)
+ 6 8 uncompressed size (little endian)
+
+
+Lzma86_Encode
+-------------
+level - compression level: 0 <= level <= 9, the default value for "level" is 5.
+
+dictSize - The dictionary size in bytes. The maximum value is
+ 128 MB = (1 << 27) bytes for 32-bit version
+ 1 GB = (1 << 30) bytes for 64-bit version
+ The default value is 16 MB = (1 << 24) bytes, for level = 5.
+ It's recommended to use the dictionary that is larger than 4 KB and
+ that can be calculated as (1 << N) or (3 << N) sizes.
+ For better compression ratio dictSize must be >= inSize.
+
+filterMode:
+ SZ_FILTER_NO - no Filter
+ SZ_FILTER_YES - x86 Filter
+ SZ_FILTER_AUTO - it tries both alternatives to select best.
+ Encoder will use 2 or 3 passes:
+ 2 passes when FILTER_NO provides better compression.
+ 3 passes when FILTER_YES provides better compression.
+
+Lzma86Encode allocates Data with MyAlloc functions.
+RAM Requirements for compressing:
+ RamSize = dictionarySize * 11.5 + 6MB + FilterBlockSize
+ filterMode FilterBlockSize
+ SZ_FILTER_NO 0
+ SZ_FILTER_YES inSize
+ SZ_FILTER_AUTO inSize
+
+
+Return code:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
+*/
+
+enum ESzFilterMode
+{
+ SZ_FILTER_NO,
+ SZ_FILTER_YES,
+ SZ_FILTER_AUTO
+};
+
+SRes Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
+ int level, UInt32 dictSize, int filterMode);
+
+
+/*
+Lzma86_GetUnpackSize:
+ In:
+ src - input data
+ srcLen - input data size
+ Out:
+ unpackSize - size of uncompressed stream
+ Return code:
+ SZ_OK - OK
+ SZ_ERROR_INPUT_EOF - Error in headers
+*/
+
+SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize);
+
+/*
+Lzma86_Decode:
+ In:
+ dest - output data
+ destLen - output data size
+ src - input data
+ srcLen - input data size
+ Out:
+ destLen - processed output size
+ srcLen - processed input size
+ Return code:
+ SZ_OK - OK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - unsupported file
+ SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer
+*/
+
+SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Lzma86Dec.c b/other-licenses/7zstub/src/C/Lzma86Dec.c
new file mode 100644
index 0000000000..20ac5e7a97
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma86Dec.c
@@ -0,0 +1,54 @@
+/* Lzma86Dec.c -- LZMA + x86 (BCJ) Filter Decoder
+2016-05-16 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "Lzma86.h"
+
+#include "Alloc.h"
+#include "Bra.h"
+#include "LzmaDec.h"
+
+SRes Lzma86_GetUnpackSize(const Byte *src, SizeT srcLen, UInt64 *unpackSize)
+{
+ unsigned i;
+ if (srcLen < LZMA86_HEADER_SIZE)
+ return SZ_ERROR_INPUT_EOF;
+ *unpackSize = 0;
+ for (i = 0; i < sizeof(UInt64); i++)
+ *unpackSize += ((UInt64)src[LZMA86_SIZE_OFFSET + i]) << (8 * i);
+ return SZ_OK;
+}
+
+SRes Lzma86_Decode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen)
+{
+ SRes res;
+ int useFilter;
+ SizeT inSizePure;
+ ELzmaStatus status;
+
+ if (*srcLen < LZMA86_HEADER_SIZE)
+ return SZ_ERROR_INPUT_EOF;
+
+ useFilter = src[0];
+
+ if (useFilter > 1)
+ {
+ *destLen = 0;
+ return SZ_ERROR_UNSUPPORTED;
+ }
+
+ inSizePure = *srcLen - LZMA86_HEADER_SIZE;
+ res = LzmaDecode(dest, destLen, src + LZMA86_HEADER_SIZE, &inSizePure,
+ src + 1, LZMA_PROPS_SIZE, LZMA_FINISH_ANY, &status, &g_Alloc);
+ *srcLen = inSizePure + LZMA86_HEADER_SIZE;
+ if (res != SZ_OK)
+ return res;
+ if (useFilter == 1)
+ {
+ UInt32 x86State;
+ x86_Convert_Init(x86State);
+ x86_Convert(dest, *destLen, 0, &x86State, 0);
+ }
+ return SZ_OK;
+}
diff --git a/other-licenses/7zstub/src/C/Lzma86Enc.c b/other-licenses/7zstub/src/C/Lzma86Enc.c
new file mode 100644
index 0000000000..ee59fb7d77
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Lzma86Enc.c
@@ -0,0 +1,106 @@
+/* Lzma86Enc.c -- LZMA + x86 (BCJ) Filter Encoder
+2016-05-16 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "Lzma86.h"
+
+#include "Alloc.h"
+#include "Bra.h"
+#include "LzmaEnc.h"
+
+#define SZE_OUT_OVERFLOW SZE_DATA_ERROR
+
+int Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
+ int level, UInt32 dictSize, int filterMode)
+{
+ size_t outSize2 = *destLen;
+ Byte *filteredStream;
+ Bool useFilter;
+ int mainResult = SZ_ERROR_OUTPUT_EOF;
+ CLzmaEncProps props;
+ LzmaEncProps_Init(&props);
+ props.level = level;
+ props.dictSize = dictSize;
+
+ *destLen = 0;
+ if (outSize2 < LZMA86_HEADER_SIZE)
+ return SZ_ERROR_OUTPUT_EOF;
+
+ {
+ int i;
+ UInt64 t = srcLen;
+ for (i = 0; i < 8; i++, t >>= 8)
+ dest[LZMA86_SIZE_OFFSET + i] = (Byte)t;
+ }
+
+ filteredStream = 0;
+ useFilter = (filterMode != SZ_FILTER_NO);
+ if (useFilter)
+ {
+ if (srcLen != 0)
+ {
+ filteredStream = (Byte *)MyAlloc(srcLen);
+ if (filteredStream == 0)
+ return SZ_ERROR_MEM;
+ memcpy(filteredStream, src, srcLen);
+ }
+ {
+ UInt32 x86State;
+ x86_Convert_Init(x86State);
+ x86_Convert(filteredStream, srcLen, 0, &x86State, 1);
+ }
+ }
+
+ {
+ size_t minSize = 0;
+ Bool bestIsFiltered = False;
+
+ /* passes for SZ_FILTER_AUTO:
+ 0 - BCJ + LZMA
+ 1 - LZMA
+ 2 - BCJ + LZMA agaian, if pass 0 (BCJ + LZMA) is better.
+ */
+ int numPasses = (filterMode == SZ_FILTER_AUTO) ? 3 : 1;
+
+ int i;
+ for (i = 0; i < numPasses; i++)
+ {
+ size_t outSizeProcessed = outSize2 - LZMA86_HEADER_SIZE;
+ size_t outPropsSize = 5;
+ SRes curRes;
+ Bool curModeIsFiltered = (numPasses > 1 && i == numPasses - 1);
+ if (curModeIsFiltered && !bestIsFiltered)
+ break;
+ if (useFilter && i == 0)
+ curModeIsFiltered = True;
+
+ curRes = LzmaEncode(dest + LZMA86_HEADER_SIZE, &outSizeProcessed,
+ curModeIsFiltered ? filteredStream : src, srcLen,
+ &props, dest + 1, &outPropsSize, 0,
+ NULL, &g_Alloc, &g_Alloc);
+
+ if (curRes != SZ_ERROR_OUTPUT_EOF)
+ {
+ if (curRes != SZ_OK)
+ {
+ mainResult = curRes;
+ break;
+ }
+ if (outSizeProcessed <= minSize || mainResult != SZ_OK)
+ {
+ minSize = outSizeProcessed;
+ bestIsFiltered = curModeIsFiltered;
+ mainResult = SZ_OK;
+ }
+ }
+ }
+ dest[0] = (Byte)(bestIsFiltered ? 1 : 0);
+ *destLen = LZMA86_HEADER_SIZE + minSize;
+ }
+ if (useFilter)
+ MyFree(filteredStream);
+ return mainResult;
+}
diff --git a/other-licenses/7zstub/src/C/LzmaDec.c b/other-licenses/7zstub/src/C/LzmaDec.c
new file mode 100644
index 0000000000..962b94bb63
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzmaDec.c
@@ -0,0 +1,1185 @@
+/* LzmaDec.c -- LZMA Decoder
+2018-02-28 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+/* #include "CpuArch.h" */
+#include "LzmaDec.h"
+
+#include <string.h>
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+
+#define RC_INIT_SIZE 5
+
+#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
+
+#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
+#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
+#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits));
+#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \
+ { UPDATE_0(p); i = (i + i); A0; } else \
+ { UPDATE_1(p); i = (i + i) + 1; A1; }
+
+#define TREE_GET_BIT(probs, i) { GET_BIT2(probs + i, i, ;, ;); }
+
+#define REV_BIT(p, i, A0, A1) IF_BIT_0(p + i) \
+ { UPDATE_0(p + i); A0; } else \
+ { UPDATE_1(p + i); A1; }
+#define REV_BIT_VAR( p, i, m) REV_BIT(p, i, i += m; m += m, m += m; i += m; )
+#define REV_BIT_CONST(p, i, m) REV_BIT(p, i, i += m; , i += m * 2; )
+#define REV_BIT_LAST( p, i, m) REV_BIT(p, i, i -= m , ; )
+
+#define TREE_DECODE(probs, limit, i) \
+ { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
+
+/* #define _LZMA_SIZE_OPT */
+
+#ifdef _LZMA_SIZE_OPT
+#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
+#else
+#define TREE_6_DECODE(probs, i) \
+ { i = 1; \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ TREE_GET_BIT(probs, i); \
+ i -= 0x40; }
+#endif
+
+#define NORMAL_LITER_DEC TREE_GET_BIT(prob, symbol)
+#define MATCHED_LITER_DEC \
+ matchByte += matchByte; \
+ bit = offs; \
+ offs &= matchByte; \
+ probLit = prob + (offs + bit + symbol); \
+ GET_BIT2(probLit, symbol, offs ^= bit; , ;)
+
+
+
+#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
+
+#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
+#define UPDATE_0_CHECK range = bound;
+#define UPDATE_1_CHECK range -= bound; code -= bound;
+#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
+ { UPDATE_0_CHECK; i = (i + i); A0; } else \
+ { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
+#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
+#define TREE_DECODE_CHECK(probs, limit, i) \
+ { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
+
+
+#define REV_BIT_CHECK(p, i, m) IF_BIT_0_CHECK(p + i) \
+ { UPDATE_0_CHECK; i += m; m += m; } else \
+ { UPDATE_1_CHECK; m += m; i += m; }
+
+
+#define kNumPosBitsMax 4
+#define kNumPosStatesMax (1 << kNumPosBitsMax)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+
+#define LenLow 0
+#define LenHigh (LenLow + 2 * (kNumPosStatesMax << kLenNumLowBits))
+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
+
+#define LenChoice LenLow
+#define LenChoice2 (LenLow + (1 << kLenNumLowBits))
+
+#define kNumStates 12
+#define kNumStates2 16
+#define kNumLitStates 7
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+#define kNumPosSlotBits 6
+#define kNumLenToPosStates 4
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+
+#define kMatchMinLen 2
+#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols * 2 + kLenNumHighSymbols)
+
+/* External ASM code needs same CLzmaProb array layout. So don't change it. */
+
+/* (probs_1664) is faster and better for code size at some platforms */
+/*
+#ifdef MY_CPU_X86_OR_AMD64
+*/
+#define kStartOffset 1664
+#define GET_PROBS p->probs_1664
+/*
+#define GET_PROBS p->probs + kStartOffset
+#else
+#define kStartOffset 0
+#define GET_PROBS p->probs
+#endif
+*/
+
+#define SpecPos (-kStartOffset)
+#define IsRep0Long (SpecPos + kNumFullDistances)
+#define RepLenCoder (IsRep0Long + (kNumStates2 << kNumPosBitsMax))
+#define LenCoder (RepLenCoder + kNumLenProbs)
+#define IsMatch (LenCoder + kNumLenProbs)
+#define Align (IsMatch + (kNumStates2 << kNumPosBitsMax))
+#define IsRep (Align + kAlignTableSize)
+#define IsRepG0 (IsRep + kNumStates)
+#define IsRepG1 (IsRepG0 + kNumStates)
+#define IsRepG2 (IsRepG1 + kNumStates)
+#define PosSlot (IsRepG2 + kNumStates)
+#define Literal (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
+#define NUM_BASE_PROBS (Literal + kStartOffset)
+
+#if Align != 0 && kStartOffset != 0
+ #error Stop_Compiling_Bad_LZMA_kAlign
+#endif
+
+#if NUM_BASE_PROBS != 1984
+ #error Stop_Compiling_Bad_LZMA_PROBS
+#endif
+
+
+#define LZMA_LIT_SIZE 0x300
+
+#define LzmaProps_GetNumProbs(p) (NUM_BASE_PROBS + ((UInt32)LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
+
+
+#define CALC_POS_STATE(processedPos, pbMask) (((processedPos) & (pbMask)) << 4)
+#define COMBINED_PS_STATE (posState + state)
+#define GET_LEN_STATE (posState)
+
+#define LZMA_DIC_MIN (1 << 12)
+
+/*
+p->remainLen : shows status of LZMA decoder:
+ < kMatchSpecLenStart : normal remain
+ = kMatchSpecLenStart : finished
+ = kMatchSpecLenStart + 1 : need init range coder
+ = kMatchSpecLenStart + 2 : need init range coder and state
+*/
+
+/* ---------- LZMA_DECODE_REAL ---------- */
+/*
+LzmaDec_DecodeReal_3() can be implemented in external ASM file.
+3 - is the code compatibility version of that function for check at link time.
+*/
+
+#define LZMA_DECODE_REAL LzmaDec_DecodeReal_3
+
+/*
+LZMA_DECODE_REAL()
+In:
+ RangeCoder is normalized
+ if (p->dicPos == limit)
+ {
+ LzmaDec_TryDummy() was called before to exclude LITERAL and MATCH-REP cases.
+ So first symbol can be only MATCH-NON-REP. And if that MATCH-NON-REP symbol
+ is not END_OF_PAYALOAD_MARKER, then function returns error code.
+ }
+
+Processing:
+ first LZMA symbol will be decoded in any case
+ All checks for limits are at the end of main loop,
+ It will decode new LZMA-symbols while (p->buf < bufLimit && dicPos < limit),
+ RangeCoder is still without last normalization when (p->buf < bufLimit) is being checked.
+
+Out:
+ RangeCoder is normalized
+ Result:
+ SZ_OK - OK
+ SZ_ERROR_DATA - Error
+ p->remainLen:
+ < kMatchSpecLenStart : normal remain
+ = kMatchSpecLenStart : finished
+*/
+
+
+#ifdef _LZMA_DEC_OPT
+
+int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit);
+
+#else
+
+static
+int MY_FAST_CALL LZMA_DECODE_REAL(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
+{
+ CLzmaProb *probs = GET_PROBS;
+ unsigned state = (unsigned)p->state;
+ UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
+ unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
+ unsigned lc = p->prop.lc;
+ unsigned lpMask = ((unsigned)0x100 << p->prop.lp) - ((unsigned)0x100 >> lc);
+
+ Byte *dic = p->dic;
+ SizeT dicBufSize = p->dicBufSize;
+ SizeT dicPos = p->dicPos;
+
+ UInt32 processedPos = p->processedPos;
+ UInt32 checkDicSize = p->checkDicSize;
+ unsigned len = 0;
+
+ const Byte *buf = p->buf;
+ UInt32 range = p->range;
+ UInt32 code = p->code;
+
+ do
+ {
+ CLzmaProb *prob;
+ UInt32 bound;
+ unsigned ttt;
+ unsigned posState = CALC_POS_STATE(processedPos, pbMask);
+
+ prob = probs + IsMatch + COMBINED_PS_STATE;
+ IF_BIT_0(prob)
+ {
+ unsigned symbol;
+ UPDATE_0(prob);
+ prob = probs + Literal;
+ if (processedPos != 0 || checkDicSize != 0)
+ prob += (UInt32)3 * ((((processedPos << 8) + dic[(dicPos == 0 ? dicBufSize : dicPos) - 1]) & lpMask) << lc);
+ processedPos++;
+
+ if (state < kNumLitStates)
+ {
+ state -= (state < 4) ? state : 3;
+ symbol = 1;
+ #ifdef _LZMA_SIZE_OPT
+ do { NORMAL_LITER_DEC } while (symbol < 0x100);
+ #else
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ NORMAL_LITER_DEC
+ #endif
+ }
+ else
+ {
+ unsigned matchByte = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
+ unsigned offs = 0x100;
+ state -= (state < 10) ? 3 : 6;
+ symbol = 1;
+ #ifdef _LZMA_SIZE_OPT
+ do
+ {
+ unsigned bit;
+ CLzmaProb *probLit;
+ MATCHED_LITER_DEC
+ }
+ while (symbol < 0x100);
+ #else
+ {
+ unsigned bit;
+ CLzmaProb *probLit;
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ MATCHED_LITER_DEC
+ }
+ #endif
+ }
+
+ dic[dicPos++] = (Byte)symbol;
+ continue;
+ }
+
+ {
+ UPDATE_1(prob);
+ prob = probs + IsRep + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ state += kNumStates;
+ prob = probs + LenCoder;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ /*
+ // that case was checked before with kBadRepCode
+ if (checkDicSize == 0 && processedPos == 0)
+ return SZ_ERROR_DATA;
+ */
+ prob = probs + IsRepG0 + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ prob = probs + IsRep0Long + COMBINED_PS_STATE;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
+ dicPos++;
+ processedPos++;
+ state = state < kNumLitStates ? 9 : 11;
+ continue;
+ }
+ UPDATE_1(prob);
+ }
+ else
+ {
+ UInt32 distance;
+ UPDATE_1(prob);
+ prob = probs + IsRepG1 + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ distance = rep1;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ prob = probs + IsRepG2 + state;
+ IF_BIT_0(prob)
+ {
+ UPDATE_0(prob);
+ distance = rep2;
+ }
+ else
+ {
+ UPDATE_1(prob);
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ state = state < kNumLitStates ? 8 : 11;
+ prob = probs + RepLenCoder;
+ }
+
+ #ifdef _LZMA_SIZE_OPT
+ {
+ unsigned lim, offset;
+ CLzmaProb *probLen = prob + LenChoice;
+ IF_BIT_0(probLen)
+ {
+ UPDATE_0(probLen);
+ probLen = prob + LenLow + GET_LEN_STATE;
+ offset = 0;
+ lim = (1 << kLenNumLowBits);
+ }
+ else
+ {
+ UPDATE_1(probLen);
+ probLen = prob + LenChoice2;
+ IF_BIT_0(probLen)
+ {
+ UPDATE_0(probLen);
+ probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits);
+ offset = kLenNumLowSymbols;
+ lim = (1 << kLenNumLowBits);
+ }
+ else
+ {
+ UPDATE_1(probLen);
+ probLen = prob + LenHigh;
+ offset = kLenNumLowSymbols * 2;
+ lim = (1 << kLenNumHighBits);
+ }
+ }
+ TREE_DECODE(probLen, lim, len);
+ len += offset;
+ }
+ #else
+ {
+ CLzmaProb *probLen = prob + LenChoice;
+ IF_BIT_0(probLen)
+ {
+ UPDATE_0(probLen);
+ probLen = prob + LenLow + GET_LEN_STATE;
+ len = 1;
+ TREE_GET_BIT(probLen, len);
+ TREE_GET_BIT(probLen, len);
+ TREE_GET_BIT(probLen, len);
+ len -= 8;
+ }
+ else
+ {
+ UPDATE_1(probLen);
+ probLen = prob + LenChoice2;
+ IF_BIT_0(probLen)
+ {
+ UPDATE_0(probLen);
+ probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits);
+ len = 1;
+ TREE_GET_BIT(probLen, len);
+ TREE_GET_BIT(probLen, len);
+ TREE_GET_BIT(probLen, len);
+ }
+ else
+ {
+ UPDATE_1(probLen);
+ probLen = prob + LenHigh;
+ TREE_DECODE(probLen, (1 << kLenNumHighBits), len);
+ len += kLenNumLowSymbols * 2;
+ }
+ }
+ }
+ #endif
+
+ if (state >= kNumStates)
+ {
+ UInt32 distance;
+ prob = probs + PosSlot +
+ ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
+ TREE_6_DECODE(prob, distance);
+ if (distance >= kStartPosModelIndex)
+ {
+ unsigned posSlot = (unsigned)distance;
+ unsigned numDirectBits = (unsigned)(((distance >> 1) - 1));
+ distance = (2 | (distance & 1));
+ if (posSlot < kEndPosModelIndex)
+ {
+ distance <<= numDirectBits;
+ prob = probs + SpecPos;
+ {
+ UInt32 m = 1;
+ distance++;
+ do
+ {
+ REV_BIT_VAR(prob, distance, m);
+ }
+ while (--numDirectBits);
+ distance -= m;
+ }
+ }
+ else
+ {
+ numDirectBits -= kNumAlignBits;
+ do
+ {
+ NORMALIZE
+ range >>= 1;
+
+ {
+ UInt32 t;
+ code -= range;
+ t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
+ distance = (distance << 1) + (t + 1);
+ code += range & t;
+ }
+ /*
+ distance <<= 1;
+ if (code >= range)
+ {
+ code -= range;
+ distance |= 1;
+ }
+ */
+ }
+ while (--numDirectBits);
+ prob = probs + Align;
+ distance <<= kNumAlignBits;
+ {
+ unsigned i = 1;
+ REV_BIT_CONST(prob, i, 1);
+ REV_BIT_CONST(prob, i, 2);
+ REV_BIT_CONST(prob, i, 4);
+ REV_BIT_LAST (prob, i, 8);
+ distance |= i;
+ }
+ if (distance == (UInt32)0xFFFFFFFF)
+ {
+ len = kMatchSpecLenStart;
+ state -= kNumStates;
+ break;
+ }
+ }
+ }
+
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ rep0 = distance + 1;
+ state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
+ if (distance >= (checkDicSize == 0 ? processedPos: checkDicSize))
+ {
+ p->dicPos = dicPos;
+ return SZ_ERROR_DATA;
+ }
+ }
+
+ len += kMatchMinLen;
+
+ {
+ SizeT rem;
+ unsigned curLen;
+ SizeT pos;
+
+ if ((rem = limit - dicPos) == 0)
+ {
+ p->dicPos = dicPos;
+ return SZ_ERROR_DATA;
+ }
+
+ curLen = ((rem < len) ? (unsigned)rem : len);
+ pos = dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0);
+
+ processedPos += curLen;
+
+ len -= curLen;
+ if (curLen <= dicBufSize - pos)
+ {
+ Byte *dest = dic + dicPos;
+ ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
+ const Byte *lim = dest + curLen;
+ dicPos += curLen;
+ do
+ *(dest) = (Byte)*(dest + src);
+ while (++dest != lim);
+ }
+ else
+ {
+ do
+ {
+ dic[dicPos++] = dic[pos];
+ if (++pos == dicBufSize)
+ pos = 0;
+ }
+ while (--curLen != 0);
+ }
+ }
+ }
+ }
+ while (dicPos < limit && buf < bufLimit);
+
+ NORMALIZE;
+
+ p->buf = buf;
+ p->range = range;
+ p->code = code;
+ p->remainLen = len;
+ p->dicPos = dicPos;
+ p->processedPos = processedPos;
+ p->reps[0] = rep0;
+ p->reps[1] = rep1;
+ p->reps[2] = rep2;
+ p->reps[3] = rep3;
+ p->state = state;
+
+ return SZ_OK;
+}
+#endif
+
+static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
+{
+ if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
+ {
+ Byte *dic = p->dic;
+ SizeT dicPos = p->dicPos;
+ SizeT dicBufSize = p->dicBufSize;
+ unsigned len = (unsigned)p->remainLen;
+ SizeT rep0 = p->reps[0]; /* we use SizeT to avoid the BUG of VC14 for AMD64 */
+ SizeT rem = limit - dicPos;
+ if (rem < len)
+ len = (unsigned)(rem);
+
+ if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
+ p->checkDicSize = p->prop.dicSize;
+
+ p->processedPos += len;
+ p->remainLen -= len;
+ while (len != 0)
+ {
+ len--;
+ dic[dicPos] = dic[dicPos - rep0 + (dicPos < rep0 ? dicBufSize : 0)];
+ dicPos++;
+ }
+ p->dicPos = dicPos;
+ }
+}
+
+
+#define kRange0 0xFFFFFFFF
+#define kBound0 ((kRange0 >> kNumBitModelTotalBits) << (kNumBitModelTotalBits - 1))
+#define kBadRepCode (kBound0 + (((kRange0 - kBound0) >> kNumBitModelTotalBits) << (kNumBitModelTotalBits - 1)))
+#if kBadRepCode != (0xC0000000 - 0x400)
+ #error Stop_Compiling_Bad_LZMA_Check
+#endif
+
+static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
+{
+ do
+ {
+ SizeT limit2 = limit;
+ if (p->checkDicSize == 0)
+ {
+ UInt32 rem = p->prop.dicSize - p->processedPos;
+ if (limit - p->dicPos > rem)
+ limit2 = p->dicPos + rem;
+
+ if (p->processedPos == 0)
+ if (p->code >= kBadRepCode)
+ return SZ_ERROR_DATA;
+ }
+
+ RINOK(LZMA_DECODE_REAL(p, limit2, bufLimit));
+
+ if (p->checkDicSize == 0 && p->processedPos >= p->prop.dicSize)
+ p->checkDicSize = p->prop.dicSize;
+
+ LzmaDec_WriteRem(p, limit);
+ }
+ while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
+
+ return 0;
+}
+
+typedef enum
+{
+ DUMMY_ERROR, /* unexpected end of input stream */
+ DUMMY_LIT,
+ DUMMY_MATCH,
+ DUMMY_REP
+} ELzmaDummy;
+
+static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
+{
+ UInt32 range = p->range;
+ UInt32 code = p->code;
+ const Byte *bufLimit = buf + inSize;
+ const CLzmaProb *probs = GET_PROBS;
+ unsigned state = (unsigned)p->state;
+ ELzmaDummy res;
+
+ {
+ const CLzmaProb *prob;
+ UInt32 bound;
+ unsigned ttt;
+ unsigned posState = CALC_POS_STATE(p->processedPos, (1 << p->prop.pb) - 1);
+
+ prob = probs + IsMatch + COMBINED_PS_STATE;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK
+
+ /* if (bufLimit - buf >= 7) return DUMMY_LIT; */
+
+ prob = probs + Literal;
+ if (p->checkDicSize != 0 || p->processedPos != 0)
+ prob += ((UInt32)LZMA_LIT_SIZE *
+ ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
+ (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
+
+ if (state < kNumLitStates)
+ {
+ unsigned symbol = 1;
+ do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
+ }
+ else
+ {
+ unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
+ (p->dicPos < p->reps[0] ? p->dicBufSize : 0)];
+ unsigned offs = 0x100;
+ unsigned symbol = 1;
+ do
+ {
+ unsigned bit;
+ const CLzmaProb *probLit;
+ matchByte += matchByte;
+ bit = offs;
+ offs &= matchByte;
+ probLit = prob + (offs + bit + symbol);
+ GET_BIT2_CHECK(probLit, symbol, offs ^= bit; , ; )
+ }
+ while (symbol < 0x100);
+ }
+ res = DUMMY_LIT;
+ }
+ else
+ {
+ unsigned len;
+ UPDATE_1_CHECK;
+
+ prob = probs + IsRep + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ state = 0;
+ prob = probs + LenCoder;
+ res = DUMMY_MATCH;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ res = DUMMY_REP;
+ prob = probs + IsRepG0 + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ prob = probs + IsRep0Long + COMBINED_PS_STATE;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ NORMALIZE_CHECK;
+ return DUMMY_REP;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ }
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ prob = probs + IsRepG1 + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ prob = probs + IsRepG2 + state;
+ IF_BIT_0_CHECK(prob)
+ {
+ UPDATE_0_CHECK;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ }
+ }
+ }
+ state = kNumStates;
+ prob = probs + RepLenCoder;
+ }
+ {
+ unsigned limit, offset;
+ const CLzmaProb *probLen = prob + LenChoice;
+ IF_BIT_0_CHECK(probLen)
+ {
+ UPDATE_0_CHECK;
+ probLen = prob + LenLow + GET_LEN_STATE;
+ offset = 0;
+ limit = 1 << kLenNumLowBits;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ probLen = prob + LenChoice2;
+ IF_BIT_0_CHECK(probLen)
+ {
+ UPDATE_0_CHECK;
+ probLen = prob + LenLow + GET_LEN_STATE + (1 << kLenNumLowBits);
+ offset = kLenNumLowSymbols;
+ limit = 1 << kLenNumLowBits;
+ }
+ else
+ {
+ UPDATE_1_CHECK;
+ probLen = prob + LenHigh;
+ offset = kLenNumLowSymbols * 2;
+ limit = 1 << kLenNumHighBits;
+ }
+ }
+ TREE_DECODE_CHECK(probLen, limit, len);
+ len += offset;
+ }
+
+ if (state < 4)
+ {
+ unsigned posSlot;
+ prob = probs + PosSlot +
+ ((len < kNumLenToPosStates - 1 ? len : kNumLenToPosStates - 1) <<
+ kNumPosSlotBits);
+ TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
+ if (posSlot >= kStartPosModelIndex)
+ {
+ unsigned numDirectBits = ((posSlot >> 1) - 1);
+
+ /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
+
+ if (posSlot < kEndPosModelIndex)
+ {
+ prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits);
+ }
+ else
+ {
+ numDirectBits -= kNumAlignBits;
+ do
+ {
+ NORMALIZE_CHECK
+ range >>= 1;
+ code -= range & (((code - range) >> 31) - 1);
+ /* if (code >= range) code -= range; */
+ }
+ while (--numDirectBits);
+ prob = probs + Align;
+ numDirectBits = kNumAlignBits;
+ }
+ {
+ unsigned i = 1;
+ unsigned m = 1;
+ do
+ {
+ REV_BIT_CHECK(prob, i, m);
+ }
+ while (--numDirectBits);
+ }
+ }
+ }
+ }
+ }
+ NORMALIZE_CHECK;
+ return res;
+}
+
+
+void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState)
+{
+ p->remainLen = kMatchSpecLenStart + 1;
+ p->tempBufSize = 0;
+
+ if (initDic)
+ {
+ p->processedPos = 0;
+ p->checkDicSize = 0;
+ p->remainLen = kMatchSpecLenStart + 2;
+ }
+ if (initState)
+ p->remainLen = kMatchSpecLenStart + 2;
+}
+
+void LzmaDec_Init(CLzmaDec *p)
+{
+ p->dicPos = 0;
+ LzmaDec_InitDicAndState(p, True, True);
+}
+
+
+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
+ ELzmaFinishMode finishMode, ELzmaStatus *status)
+{
+ SizeT inSize = *srcLen;
+ (*srcLen) = 0;
+
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+
+ if (p->remainLen > kMatchSpecLenStart)
+ {
+ for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
+ p->tempBuf[p->tempBufSize++] = *src++;
+ if (p->tempBufSize != 0 && p->tempBuf[0] != 0)
+ return SZ_ERROR_DATA;
+ if (p->tempBufSize < RC_INIT_SIZE)
+ {
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ p->code =
+ ((UInt32)p->tempBuf[1] << 24)
+ | ((UInt32)p->tempBuf[2] << 16)
+ | ((UInt32)p->tempBuf[3] << 8)
+ | ((UInt32)p->tempBuf[4]);
+ p->range = 0xFFFFFFFF;
+ p->tempBufSize = 0;
+
+ if (p->remainLen > kMatchSpecLenStart + 1)
+ {
+ SizeT numProbs = LzmaProps_GetNumProbs(&p->prop);
+ SizeT i;
+ CLzmaProb *probs = p->probs;
+ for (i = 0; i < numProbs; i++)
+ probs[i] = kBitModelTotal >> 1;
+ p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
+ p->state = 0;
+ }
+
+ p->remainLen = 0;
+ }
+
+ LzmaDec_WriteRem(p, dicLimit);
+
+ while (p->remainLen != kMatchSpecLenStart)
+ {
+ int checkEndMarkNow = 0;
+
+ if (p->dicPos >= dicLimit)
+ {
+ if (p->remainLen == 0 && p->code == 0)
+ {
+ *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
+ return SZ_OK;
+ }
+ if (finishMode == LZMA_FINISH_ANY)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_OK;
+ }
+ if (p->remainLen != 0)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_ERROR_DATA;
+ }
+ checkEndMarkNow = 1;
+ }
+
+ if (p->tempBufSize == 0)
+ {
+ SizeT processed;
+ const Byte *bufLimit;
+ if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
+ {
+ int dummyRes = LzmaDec_TryDummy(p, src, inSize);
+ if (dummyRes == DUMMY_ERROR)
+ {
+ memcpy(p->tempBuf, src, inSize);
+ p->tempBufSize = (unsigned)inSize;
+ (*srcLen) += inSize;
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_ERROR_DATA;
+ }
+ bufLimit = src;
+ }
+ else
+ bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
+ p->buf = src;
+ if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
+ return SZ_ERROR_DATA;
+ processed = (SizeT)(p->buf - src);
+ (*srcLen) += processed;
+ src += processed;
+ inSize -= processed;
+ }
+ else
+ {
+ unsigned rem = p->tempBufSize, lookAhead = 0;
+ while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
+ p->tempBuf[rem++] = src[lookAhead++];
+ p->tempBufSize = rem;
+ if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
+ {
+ int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);
+ if (dummyRes == DUMMY_ERROR)
+ {
+ (*srcLen) += lookAhead;
+ *status = LZMA_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
+ {
+ *status = LZMA_STATUS_NOT_FINISHED;
+ return SZ_ERROR_DATA;
+ }
+ }
+ p->buf = p->tempBuf;
+ if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
+ return SZ_ERROR_DATA;
+
+ {
+ unsigned kkk = (unsigned)(p->buf - p->tempBuf);
+ if (rem < kkk)
+ return SZ_ERROR_FAIL; /* some internal error */
+ rem -= kkk;
+ if (lookAhead < rem)
+ return SZ_ERROR_FAIL; /* some internal error */
+ lookAhead -= rem;
+ }
+ (*srcLen) += lookAhead;
+ src += lookAhead;
+ inSize -= lookAhead;
+ p->tempBufSize = 0;
+ }
+ }
+
+ if (p->code != 0)
+ return SZ_ERROR_DATA;
+ *status = LZMA_STATUS_FINISHED_WITH_MARK;
+ return SZ_OK;
+}
+
+
+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status)
+{
+ SizeT outSize = *destLen;
+ SizeT inSize = *srcLen;
+ *srcLen = *destLen = 0;
+ for (;;)
+ {
+ SizeT inSizeCur = inSize, outSizeCur, dicPos;
+ ELzmaFinishMode curFinishMode;
+ SRes res;
+ if (p->dicPos == p->dicBufSize)
+ p->dicPos = 0;
+ dicPos = p->dicPos;
+ if (outSize > p->dicBufSize - dicPos)
+ {
+ outSizeCur = p->dicBufSize;
+ curFinishMode = LZMA_FINISH_ANY;
+ }
+ else
+ {
+ outSizeCur = dicPos + outSize;
+ curFinishMode = finishMode;
+ }
+
+ res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status);
+ src += inSizeCur;
+ inSize -= inSizeCur;
+ *srcLen += inSizeCur;
+ outSizeCur = p->dicPos - dicPos;
+ memcpy(dest, p->dic + dicPos, outSizeCur);
+ dest += outSizeCur;
+ outSize -= outSizeCur;
+ *destLen += outSizeCur;
+ if (res != 0)
+ return res;
+ if (outSizeCur == 0 || outSize == 0)
+ return SZ_OK;
+ }
+}
+
+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->probs);
+ p->probs = NULL;
+}
+
+static void LzmaDec_FreeDict(CLzmaDec *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->dic);
+ p->dic = NULL;
+}
+
+void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc)
+{
+ LzmaDec_FreeProbs(p, alloc);
+ LzmaDec_FreeDict(p, alloc);
+}
+
+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size)
+{
+ UInt32 dicSize;
+ Byte d;
+
+ if (size < LZMA_PROPS_SIZE)
+ return SZ_ERROR_UNSUPPORTED;
+ else
+ dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24);
+
+ if (dicSize < LZMA_DIC_MIN)
+ dicSize = LZMA_DIC_MIN;
+ p->dicSize = dicSize;
+
+ d = data[0];
+ if (d >= (9 * 5 * 5))
+ return SZ_ERROR_UNSUPPORTED;
+
+ p->lc = (Byte)(d % 9);
+ d /= 9;
+ p->pb = (Byte)(d / 5);
+ p->lp = (Byte)(d % 5);
+
+ return SZ_OK;
+}
+
+static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAllocPtr alloc)
+{
+ UInt32 numProbs = LzmaProps_GetNumProbs(propNew);
+ if (!p->probs || numProbs != p->numProbs)
+ {
+ LzmaDec_FreeProbs(p, alloc);
+ p->probs = (CLzmaProb *)ISzAlloc_Alloc(alloc, numProbs * sizeof(CLzmaProb));
+ if (!p->probs)
+ return SZ_ERROR_MEM;
+ p->probs_1664 = p->probs + 1664;
+ p->numProbs = numProbs;
+ }
+ return SZ_OK;
+}
+
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc)
+{
+ CLzmaProps propNew;
+ RINOK(LzmaProps_Decode(&propNew, props, propsSize));
+ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
+ p->prop = propNew;
+ return SZ_OK;
+}
+
+SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc)
+{
+ CLzmaProps propNew;
+ SizeT dicBufSize;
+ RINOK(LzmaProps_Decode(&propNew, props, propsSize));
+ RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc));
+
+ {
+ UInt32 dictSize = propNew.dicSize;
+ SizeT mask = ((UInt32)1 << 12) - 1;
+ if (dictSize >= ((UInt32)1 << 30)) mask = ((UInt32)1 << 22) - 1;
+ else if (dictSize >= ((UInt32)1 << 22)) mask = ((UInt32)1 << 20) - 1;;
+ dicBufSize = ((SizeT)dictSize + mask) & ~mask;
+ if (dicBufSize < dictSize)
+ dicBufSize = dictSize;
+ }
+
+ if (!p->dic || dicBufSize != p->dicBufSize)
+ {
+ LzmaDec_FreeDict(p, alloc);
+ p->dic = (Byte *)ISzAlloc_Alloc(alloc, dicBufSize);
+ if (!p->dic)
+ {
+ LzmaDec_FreeProbs(p, alloc);
+ return SZ_ERROR_MEM;
+ }
+ }
+ p->dicBufSize = dicBufSize;
+ p->prop = propNew;
+ return SZ_OK;
+}
+
+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+ ELzmaStatus *status, ISzAllocPtr alloc)
+{
+ CLzmaDec p;
+ SRes res;
+ SizeT outSize = *destLen, inSize = *srcLen;
+ *destLen = *srcLen = 0;
+ *status = LZMA_STATUS_NOT_SPECIFIED;
+ if (inSize < RC_INIT_SIZE)
+ return SZ_ERROR_INPUT_EOF;
+ LzmaDec_Construct(&p);
+ RINOK(LzmaDec_AllocateProbs(&p, propData, propSize, alloc));
+ p.dic = dest;
+ p.dicBufSize = outSize;
+ LzmaDec_Init(&p);
+ *srcLen = inSize;
+ res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status);
+ *destLen = p.dicPos;
+ if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT)
+ res = SZ_ERROR_INPUT_EOF;
+ LzmaDec_FreeProbs(&p, alloc);
+ return res;
+}
diff --git a/other-licenses/7zstub/src/C/LzmaDec.h b/other-licenses/7zstub/src/C/LzmaDec.h
new file mode 100644
index 0000000000..28ce60c3ea
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzmaDec.h
@@ -0,0 +1,234 @@
+/* LzmaDec.h -- LZMA Decoder
+2018-04-21 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA_DEC_H
+#define __LZMA_DEC_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+/* #define _LZMA_PROB32 */
+/* _LZMA_PROB32 can increase the speed on some CPUs,
+ but memory usage for CLzmaDec::probs will be doubled in that case */
+
+typedef
+#ifdef _LZMA_PROB32
+ UInt32
+#else
+ UInt16
+#endif
+ CLzmaProb;
+
+
+/* ---------- LZMA Properties ---------- */
+
+#define LZMA_PROPS_SIZE 5
+
+typedef struct _CLzmaProps
+{
+ Byte lc;
+ Byte lp;
+ Byte pb;
+ Byte _pad_;
+ UInt32 dicSize;
+} CLzmaProps;
+
+/* LzmaProps_Decode - decodes properties
+Returns:
+ SZ_OK
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+*/
+
+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
+
+
+/* ---------- LZMA Decoder state ---------- */
+
+/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
+ Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
+
+#define LZMA_REQUIRED_INPUT_MAX 20
+
+typedef struct
+{
+ /* Don't change this structure. ASM code can use it. */
+ CLzmaProps prop;
+ CLzmaProb *probs;
+ CLzmaProb *probs_1664;
+ Byte *dic;
+ SizeT dicBufSize;
+ SizeT dicPos;
+ const Byte *buf;
+ UInt32 range;
+ UInt32 code;
+ UInt32 processedPos;
+ UInt32 checkDicSize;
+ UInt32 reps[4];
+ UInt32 state;
+ UInt32 remainLen;
+
+ UInt32 numProbs;
+ unsigned tempBufSize;
+ Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
+} CLzmaDec;
+
+#define LzmaDec_Construct(p) { (p)->dic = NULL; (p)->probs = NULL; }
+
+void LzmaDec_Init(CLzmaDec *p);
+
+/* There are two types of LZMA streams:
+ - Stream with end mark. That end mark adds about 6 bytes to compressed size.
+ - Stream without end mark. You must know exact uncompressed size to decompress such stream. */
+
+typedef enum
+{
+ LZMA_FINISH_ANY, /* finish at any point */
+ LZMA_FINISH_END /* block must be finished at the end */
+} ELzmaFinishMode;
+
+/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
+
+ You must use LZMA_FINISH_END, when you know that current output buffer
+ covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
+
+ If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
+ and output value of destLen will be less than output buffer size limit.
+ You can check status result also.
+
+ You can use multiple checks to test data integrity after full decompression:
+ 1) Check Result and "status" variable.
+ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
+ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
+ You must use correct finish mode in that case. */
+
+typedef enum
+{
+ LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
+ LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
+ LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
+ LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
+} ELzmaStatus;
+
+/* ELzmaStatus is used only as output value for function call */
+
+
+/* ---------- Interfaces ---------- */
+
+/* There are 3 levels of interfaces:
+ 1) Dictionary Interface
+ 2) Buffer Interface
+ 3) One Call Interface
+ You can select any of these interfaces, but don't mix functions from different
+ groups for same object. */
+
+
+/* There are two variants to allocate state for Dictionary Interface:
+ 1) LzmaDec_Allocate / LzmaDec_Free
+ 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
+ You can use variant 2, if you set dictionary buffer manually.
+ For Buffer Interface you must always use variant 1.
+
+LzmaDec_Allocate* can return:
+ SZ_OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+*/
+
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);
+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAllocPtr alloc);
+
+SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAllocPtr alloc);
+void LzmaDec_Free(CLzmaDec *p, ISzAllocPtr alloc);
+
+/* ---------- Dictionary Interface ---------- */
+
+/* You can use it, if you want to eliminate the overhead for data copying from
+ dictionary to some other external buffer.
+ You must work with CLzmaDec variables directly in this interface.
+
+ STEPS:
+ LzmaDec_Construct()
+ LzmaDec_Allocate()
+ for (each new stream)
+ {
+ LzmaDec_Init()
+ while (it needs more decompression)
+ {
+ LzmaDec_DecodeToDic()
+ use data from CLzmaDec::dic and update CLzmaDec::dicPos
+ }
+ }
+ LzmaDec_Free()
+*/
+
+/* LzmaDec_DecodeToDic
+
+ The decoding to internal dictionary buffer (CLzmaDec::dic).
+ You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
+
+finishMode:
+ It has meaning only if the decoding reaches output limit (dicLimit).
+ LZMA_FINISH_ANY - Decode just dicLimit bytes.
+ LZMA_FINISH_END - Stream must be finished after dicLimit.
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_NEEDS_MORE_INPUT
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ SZ_ERROR_DATA - Data error
+*/
+
+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+
+/* ---------- Buffer Interface ---------- */
+
+/* It's zlib-like interface.
+ See LzmaDec_DecodeToDic description for information about STEPS and return results,
+ but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
+ to work with CLzmaDec variables manually.
+
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - Decode just destLen bytes.
+ LZMA_FINISH_END - Stream must be finished after (*destLen).
+*/
+
+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+
+
+/* ---------- One Call Interface ---------- */
+
+/* LzmaDecode
+
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - Decode just destLen bytes.
+ LZMA_FINISH_END - Stream must be finished after (*destLen).
+
+Returns:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+*/
+
+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+ ELzmaStatus *status, ISzAllocPtr alloc);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/LzmaEnc.c b/other-licenses/7zstub/src/C/LzmaEnc.c
new file mode 100644
index 0000000000..bebe664d3e
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzmaEnc.c
@@ -0,0 +1,2787 @@
+/* LzmaEnc.c -- LZMA Encoder
+2018-04-29 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+/* #define SHOW_STAT */
+/* #define SHOW_STAT2 */
+
+#if defined(SHOW_STAT) || defined(SHOW_STAT2)
+#include <stdio.h>
+#endif
+
+#include "LzmaEnc.h"
+
+#include "LzFind.h"
+#ifndef _7ZIP_ST
+#include "LzFindMt.h"
+#endif
+
+#ifdef SHOW_STAT
+static unsigned g_STAT_OFFSET = 0;
+#endif
+
+#define kLzmaMaxHistorySize ((UInt32)3 << 29)
+/* #define kLzmaMaxHistorySize ((UInt32)7 << 29) */
+
+#define kNumTopBits 24
+#define kTopValue ((UInt32)1 << kNumTopBits)
+
+#define kNumBitModelTotalBits 11
+#define kBitModelTotal (1 << kNumBitModelTotalBits)
+#define kNumMoveBits 5
+#define kProbInitValue (kBitModelTotal >> 1)
+
+#define kNumMoveReducingBits 4
+#define kNumBitPriceShiftBits 4
+#define kBitPrice (1 << kNumBitPriceShiftBits)
+
+void LzmaEncProps_Init(CLzmaEncProps *p)
+{
+ p->level = 5;
+ p->dictSize = p->mc = 0;
+ p->reduceSize = (UInt64)(Int64)-1;
+ p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1;
+ p->writeEndMark = 0;
+}
+
+void LzmaEncProps_Normalize(CLzmaEncProps *p)
+{
+ int level = p->level;
+ if (level < 0) level = 5;
+ p->level = level;
+
+ if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level <= 7 ? (1 << 25) : (1 << 26)));
+ if (p->dictSize > p->reduceSize)
+ {
+ unsigned i;
+ UInt32 reduceSize = (UInt32)p->reduceSize;
+ for (i = 11; i <= 30; i++)
+ {
+ if (reduceSize <= ((UInt32)2 << i)) { p->dictSize = ((UInt32)2 << i); break; }
+ if (reduceSize <= ((UInt32)3 << i)) { p->dictSize = ((UInt32)3 << i); break; }
+ }
+ }
+
+ if (p->lc < 0) p->lc = 3;
+ if (p->lp < 0) p->lp = 0;
+ if (p->pb < 0) p->pb = 2;
+
+ if (p->algo < 0) p->algo = (level < 5 ? 0 : 1);
+ if (p->fb < 0) p->fb = (level < 7 ? 32 : 64);
+ if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1);
+ if (p->numHashBytes < 0) p->numHashBytes = 4;
+ if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1);
+
+ if (p->numThreads < 0)
+ p->numThreads =
+ #ifndef _7ZIP_ST
+ ((p->btMode && p->algo) ? 2 : 1);
+ #else
+ 1;
+ #endif
+}
+
+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2)
+{
+ CLzmaEncProps props = *props2;
+ LzmaEncProps_Normalize(&props);
+ return props.dictSize;
+}
+
+#if (_MSC_VER >= 1400)
+/* BSR code is fast for some new CPUs */
+/* #define LZMA_LOG_BSR */
+#endif
+
+#ifdef LZMA_LOG_BSR
+
+#define kDicLogSizeMaxCompress 32
+
+#define BSR2_RET(pos, res) { unsigned long zz; _BitScanReverse(&zz, (pos)); res = (zz + zz) + ((pos >> (zz - 1)) & 1); }
+
+static unsigned GetPosSlot1(UInt32 pos)
+{
+ unsigned res;
+ BSR2_RET(pos, res);
+ return res;
+}
+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
+#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); }
+
+#else
+
+#define kNumLogBits (9 + sizeof(size_t) / 2)
+/* #define kNumLogBits (11 + sizeof(size_t) / 8 * 3) */
+
+#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7)
+
+static void LzmaEnc_FastPosInit(Byte *g_FastPos)
+{
+ unsigned slot;
+ g_FastPos[0] = 0;
+ g_FastPos[1] = 1;
+ g_FastPos += 2;
+
+ for (slot = 2; slot < kNumLogBits * 2; slot++)
+ {
+ size_t k = ((size_t)1 << ((slot >> 1) - 1));
+ size_t j;
+ for (j = 0; j < k; j++)
+ g_FastPos[j] = (Byte)slot;
+ g_FastPos += k;
+ }
+}
+
+/* we can use ((limit - pos) >> 31) only if (pos < ((UInt32)1 << 31)) */
+/*
+#define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \
+ (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \
+ res = p->g_FastPos[pos >> zz] + (zz * 2); }
+*/
+
+/*
+#define BSR2_RET(pos, res) { unsigned zz = 6 + ((kNumLogBits - 1) & \
+ (0 - (((((UInt32)1 << (kNumLogBits)) - 1) - (pos >> 6)) >> 31))); \
+ res = p->g_FastPos[pos >> zz] + (zz * 2); }
+*/
+
+#define BSR2_RET(pos, res) { unsigned zz = (pos < (1 << (kNumLogBits + 6))) ? 6 : 6 + kNumLogBits - 1; \
+ res = p->g_FastPos[pos >> zz] + (zz * 2); }
+
+/*
+#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \
+ p->g_FastPos[pos >> 6] + 12 : \
+ p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; }
+*/
+
+#define GetPosSlot1(pos) p->g_FastPos[pos]
+#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); }
+#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos & (kNumFullDistances - 1)]; else BSR2_RET(pos, res); }
+
+#endif
+
+
+#define LZMA_NUM_REPS 4
+
+typedef UInt16 CState;
+typedef UInt16 CExtra;
+
+typedef struct
+{
+ UInt32 price;
+ CState state;
+ CExtra extra;
+ // 0 : normal
+ // 1 : LIT : MATCH
+ // > 1 : MATCH (extra-1) : LIT : REP0 (len)
+ UInt32 len;
+ UInt32 dist;
+ UInt32 reps[LZMA_NUM_REPS];
+} COptimal;
+
+
+#define kNumOpts (1 << 12)
+#define kPackReserve (1 + kNumOpts * 2)
+
+#define kNumLenToPosStates 4
+#define kNumPosSlotBits 6
+#define kDicLogSizeMin 0
+#define kDicLogSizeMax 32
+#define kDistTableSizeMax (kDicLogSizeMax * 2)
+
+#define kNumAlignBits 4
+#define kAlignTableSize (1 << kNumAlignBits)
+#define kAlignMask (kAlignTableSize - 1)
+
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+
+typedef
+#ifdef _LZMA_PROB32
+ UInt32
+#else
+ UInt16
+#endif
+ CLzmaProb;
+
+#define LZMA_PB_MAX 4
+#define LZMA_LC_MAX 8
+#define LZMA_LP_MAX 4
+
+#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX)
+
+#define kLenNumLowBits 3
+#define kLenNumLowSymbols (1 << kLenNumLowBits)
+#define kLenNumHighBits 8
+#define kLenNumHighSymbols (1 << kLenNumHighBits)
+#define kLenNumSymbolsTotal (kLenNumLowSymbols * 2 + kLenNumHighSymbols)
+
+#define LZMA_MATCH_LEN_MIN 2
+#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1)
+
+#define kNumStates 12
+
+
+typedef struct
+{
+ CLzmaProb low[LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)];
+ CLzmaProb high[kLenNumHighSymbols];
+} CLenEnc;
+
+
+typedef struct
+{
+ unsigned tableSize;
+ unsigned counters[LZMA_NUM_PB_STATES_MAX];
+ UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal];
+} CLenPriceEnc;
+
+
+typedef struct
+{
+ UInt32 range;
+ unsigned cache;
+ UInt64 low;
+ UInt64 cacheSize;
+ Byte *buf;
+ Byte *bufLim;
+ Byte *bufBase;
+ ISeqOutStream *outStream;
+ UInt64 processed;
+ SRes res;
+} CRangeEnc;
+
+
+typedef struct
+{
+ CLzmaProb *litProbs;
+
+ unsigned state;
+ UInt32 reps[LZMA_NUM_REPS];
+
+ CLzmaProb posAlignEncoder[1 << kNumAlignBits];
+ CLzmaProb isRep[kNumStates];
+ CLzmaProb isRepG0[kNumStates];
+ CLzmaProb isRepG1[kNumStates];
+ CLzmaProb isRepG2[kNumStates];
+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
+
+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
+ CLzmaProb posEncoders[kNumFullDistances];
+
+ CLenEnc lenProbs;
+ CLenEnc repLenProbs;
+
+} CSaveState;
+
+
+typedef UInt32 CProbPrice;
+
+
+typedef struct
+{
+ void *matchFinderObj;
+ IMatchFinder matchFinder;
+
+ unsigned optCur;
+ unsigned optEnd;
+
+ unsigned longestMatchLen;
+ unsigned numPairs;
+ UInt32 numAvail;
+
+ unsigned state;
+ unsigned numFastBytes;
+ unsigned additionalOffset;
+ UInt32 reps[LZMA_NUM_REPS];
+ unsigned lpMask, pbMask;
+ CLzmaProb *litProbs;
+ CRangeEnc rc;
+
+ UInt32 backRes;
+
+ unsigned lc, lp, pb;
+ unsigned lclp;
+
+ Bool fastMode;
+ Bool writeEndMark;
+ Bool finished;
+ Bool multiThread;
+ Bool needInit;
+
+ UInt64 nowPos64;
+
+ unsigned matchPriceCount;
+ unsigned alignPriceCount;
+
+ unsigned distTableSize;
+
+ UInt32 dictSize;
+ SRes result;
+
+ #ifndef _7ZIP_ST
+ Bool mtMode;
+ // begin of CMatchFinderMt is used in LZ thread
+ CMatchFinderMt matchFinderMt;
+ // end of CMatchFinderMt is used in BT and HASH threads
+ #endif
+
+ CMatchFinder matchFinderBase;
+
+ #ifndef _7ZIP_ST
+ Byte pad[128];
+ #endif
+
+ // LZ thread
+ CProbPrice ProbPrices[kBitModelTotal >> kNumMoveReducingBits];
+
+ UInt32 matches[LZMA_MATCH_LEN_MAX * 2 + 2 + 1];
+
+ UInt32 alignPrices[kAlignTableSize];
+ UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax];
+ UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances];
+
+ CLzmaProb posAlignEncoder[1 << kNumAlignBits];
+ CLzmaProb isRep[kNumStates];
+ CLzmaProb isRepG0[kNumStates];
+ CLzmaProb isRepG1[kNumStates];
+ CLzmaProb isRepG2[kNumStates];
+ CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX];
+ CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX];
+ CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits];
+ CLzmaProb posEncoders[kNumFullDistances];
+
+ CLenEnc lenProbs;
+ CLenEnc repLenProbs;
+
+ #ifndef LZMA_LOG_BSR
+ Byte g_FastPos[1 << kNumLogBits];
+ #endif
+
+ CLenPriceEnc lenEnc;
+ CLenPriceEnc repLenEnc;
+
+ COptimal opt[kNumOpts];
+
+ CSaveState saveState;
+
+ #ifndef _7ZIP_ST
+ Byte pad2[128];
+ #endif
+} CLzmaEnc;
+
+
+
+#define COPY_ARR(dest, src, arr) memcpy(dest->arr, src->arr, sizeof(src->arr));
+
+void LzmaEnc_SaveState(CLzmaEncHandle pp)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ CSaveState *dest = &p->saveState;
+
+ dest->state = p->state;
+
+ dest->lenProbs = p->lenProbs;
+ dest->repLenProbs = p->repLenProbs;
+
+ COPY_ARR(dest, p, reps);
+
+ COPY_ARR(dest, p, posAlignEncoder);
+ COPY_ARR(dest, p, isRep);
+ COPY_ARR(dest, p, isRepG0);
+ COPY_ARR(dest, p, isRepG1);
+ COPY_ARR(dest, p, isRepG2);
+ COPY_ARR(dest, p, isMatch);
+ COPY_ARR(dest, p, isRep0Long);
+ COPY_ARR(dest, p, posSlotEncoder);
+ COPY_ARR(dest, p, posEncoders);
+
+ memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << p->lclp) * sizeof(CLzmaProb));
+}
+
+
+void LzmaEnc_RestoreState(CLzmaEncHandle pp)
+{
+ CLzmaEnc *dest = (CLzmaEnc *)pp;
+ const CSaveState *p = &dest->saveState;
+
+ dest->state = p->state;
+
+ dest->lenProbs = p->lenProbs;
+ dest->repLenProbs = p->repLenProbs;
+
+ COPY_ARR(dest, p, reps);
+
+ COPY_ARR(dest, p, posAlignEncoder);
+ COPY_ARR(dest, p, isRep);
+ COPY_ARR(dest, p, isRepG0);
+ COPY_ARR(dest, p, isRepG1);
+ COPY_ARR(dest, p, isRepG2);
+ COPY_ARR(dest, p, isMatch);
+ COPY_ARR(dest, p, isRep0Long);
+ COPY_ARR(dest, p, posSlotEncoder);
+ COPY_ARR(dest, p, posEncoders);
+
+ memcpy(dest->litProbs, p->litProbs, ((UInt32)0x300 << dest->lclp) * sizeof(CLzmaProb));
+}
+
+
+
+SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ CLzmaEncProps props = *props2;
+ LzmaEncProps_Normalize(&props);
+
+ if (props.lc > LZMA_LC_MAX
+ || props.lp > LZMA_LP_MAX
+ || props.pb > LZMA_PB_MAX
+ || props.dictSize > ((UInt64)1 << kDicLogSizeMaxCompress)
+ || props.dictSize > kLzmaMaxHistorySize)
+ return SZ_ERROR_PARAM;
+
+ p->dictSize = props.dictSize;
+ {
+ unsigned fb = props.fb;
+ if (fb < 5)
+ fb = 5;
+ if (fb > LZMA_MATCH_LEN_MAX)
+ fb = LZMA_MATCH_LEN_MAX;
+ p->numFastBytes = fb;
+ }
+ p->lc = props.lc;
+ p->lp = props.lp;
+ p->pb = props.pb;
+ p->fastMode = (props.algo == 0);
+ p->matchFinderBase.btMode = (Byte)(props.btMode ? 1 : 0);
+ {
+ unsigned numHashBytes = 4;
+ if (props.btMode)
+ {
+ if (props.numHashBytes < 2)
+ numHashBytes = 2;
+ else if (props.numHashBytes < 4)
+ numHashBytes = props.numHashBytes;
+ }
+ p->matchFinderBase.numHashBytes = numHashBytes;
+ }
+
+ p->matchFinderBase.cutValue = props.mc;
+
+ p->writeEndMark = props.writeEndMark;
+
+ #ifndef _7ZIP_ST
+ /*
+ if (newMultiThread != _multiThread)
+ {
+ ReleaseMatchFinder();
+ _multiThread = newMultiThread;
+ }
+ */
+ p->multiThread = (props.numThreads > 1);
+ #endif
+
+ return SZ_OK;
+}
+
+
+void LzmaEnc_SetDataSize(CLzmaEncHandle pp, UInt64 expectedDataSiize)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ p->matchFinderBase.expectedDataSize = expectedDataSiize;
+}
+
+
+#define kState_Start 0
+#define kState_LitAfterMatch 4
+#define kState_LitAfterRep 5
+#define kState_MatchAfterLit 7
+#define kState_RepAfterLit 8
+
+static const Byte kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
+static const Byte kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
+static const Byte kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
+static const Byte kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
+
+#define IsLitState(s) ((s) < 7)
+#define GetLenToPosState2(len) (((len) < kNumLenToPosStates - 1) ? (len) : kNumLenToPosStates - 1)
+#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1)
+
+#define kInfinityPrice (1 << 30)
+
+static void RangeEnc_Construct(CRangeEnc *p)
+{
+ p->outStream = NULL;
+ p->bufBase = NULL;
+}
+
+#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize)
+#define RangeEnc_GetProcessed_sizet(p) ((size_t)(p)->processed + ((p)->buf - (p)->bufBase) + (size_t)(p)->cacheSize)
+
+#define RC_BUF_SIZE (1 << 16)
+
+static int RangeEnc_Alloc(CRangeEnc *p, ISzAllocPtr alloc)
+{
+ if (!p->bufBase)
+ {
+ p->bufBase = (Byte *)ISzAlloc_Alloc(alloc, RC_BUF_SIZE);
+ if (!p->bufBase)
+ return 0;
+ p->bufLim = p->bufBase + RC_BUF_SIZE;
+ }
+ return 1;
+}
+
+static void RangeEnc_Free(CRangeEnc *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->bufBase);
+ p->bufBase = 0;
+}
+
+static void RangeEnc_Init(CRangeEnc *p)
+{
+ /* Stream.Init(); */
+ p->range = 0xFFFFFFFF;
+ p->cache = 0;
+ p->low = 0;
+ p->cacheSize = 0;
+
+ p->buf = p->bufBase;
+
+ p->processed = 0;
+ p->res = SZ_OK;
+}
+
+MY_NO_INLINE static void RangeEnc_FlushStream(CRangeEnc *p)
+{
+ size_t num;
+ if (p->res != SZ_OK)
+ return;
+ num = p->buf - p->bufBase;
+ if (num != ISeqOutStream_Write(p->outStream, p->bufBase, num))
+ p->res = SZ_ERROR_WRITE;
+ p->processed += num;
+ p->buf = p->bufBase;
+}
+
+MY_NO_INLINE static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p)
+{
+ UInt32 low = (UInt32)p->low;
+ unsigned high = (unsigned)(p->low >> 32);
+ p->low = (UInt32)(low << 8);
+ if (low < (UInt32)0xFF000000 || high != 0)
+ {
+ {
+ Byte *buf = p->buf;
+ *buf++ = (Byte)(p->cache + high);
+ p->cache = (unsigned)(low >> 24);
+ p->buf = buf;
+ if (buf == p->bufLim)
+ RangeEnc_FlushStream(p);
+ if (p->cacheSize == 0)
+ return;
+ }
+ high += 0xFF;
+ for (;;)
+ {
+ Byte *buf = p->buf;
+ *buf++ = (Byte)(high);
+ p->buf = buf;
+ if (buf == p->bufLim)
+ RangeEnc_FlushStream(p);
+ if (--p->cacheSize == 0)
+ return;
+ }
+ }
+ p->cacheSize++;
+}
+
+static void RangeEnc_FlushData(CRangeEnc *p)
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ RangeEnc_ShiftLow(p);
+}
+
+#define RC_NORM(p) if (range < kTopValue) { range <<= 8; RangeEnc_ShiftLow(p); }
+
+#define RC_BIT_PRE(p, prob) \
+ ttt = *(prob); \
+ newBound = (range >> kNumBitModelTotalBits) * ttt;
+
+// #define _LZMA_ENC_USE_BRANCH
+
+#ifdef _LZMA_ENC_USE_BRANCH
+
+#define RC_BIT(p, prob, symbol) { \
+ RC_BIT_PRE(p, prob) \
+ if (symbol == 0) { range = newBound; ttt += (kBitModelTotal - ttt) >> kNumMoveBits; } \
+ else { (p)->low += newBound; range -= newBound; ttt -= ttt >> kNumMoveBits; } \
+ *(prob) = (CLzmaProb)ttt; \
+ RC_NORM(p) \
+ }
+
+#else
+
+#define RC_BIT(p, prob, symbol) { \
+ UInt32 mask; \
+ RC_BIT_PRE(p, prob) \
+ mask = 0 - (UInt32)symbol; \
+ range &= mask; \
+ mask &= newBound; \
+ range -= mask; \
+ (p)->low += mask; \
+ mask = (UInt32)symbol - 1; \
+ range += newBound & mask; \
+ mask &= (kBitModelTotal - ((1 << kNumMoveBits) - 1)); \
+ mask += ((1 << kNumMoveBits) - 1); \
+ ttt += (Int32)(mask - ttt) >> kNumMoveBits; \
+ *(prob) = (CLzmaProb)ttt; \
+ RC_NORM(p) \
+ }
+
+#endif
+
+
+
+
+#define RC_BIT_0_BASE(p, prob) \
+ range = newBound; *(prob) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
+
+#define RC_BIT_1_BASE(p, prob) \
+ range -= newBound; (p)->low += newBound; *(prob) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); \
+
+#define RC_BIT_0(p, prob) \
+ RC_BIT_0_BASE(p, prob) \
+ RC_NORM(p)
+
+#define RC_BIT_1(p, prob) \
+ RC_BIT_1_BASE(p, prob) \
+ RC_NORM(p)
+
+static void RangeEnc_EncodeBit_0(CRangeEnc *p, CLzmaProb *prob)
+{
+ UInt32 range, ttt, newBound;
+ range = p->range;
+ RC_BIT_PRE(p, prob)
+ RC_BIT_0(p, prob)
+ p->range = range;
+}
+
+static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol)
+{
+ UInt32 range = p->range;
+ symbol |= 0x100;
+ do
+ {
+ UInt32 ttt, newBound;
+ // RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1);
+ CLzmaProb *prob = probs + (symbol >> 8);
+ UInt32 bit = (symbol >> 7) & 1;
+ symbol <<= 1;
+ RC_BIT(p, prob, bit);
+ }
+ while (symbol < 0x10000);
+ p->range = range;
+}
+
+static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte)
+{
+ UInt32 range = p->range;
+ UInt32 offs = 0x100;
+ symbol |= 0x100;
+ do
+ {
+ UInt32 ttt, newBound;
+ CLzmaProb *prob;
+ UInt32 bit;
+ matchByte <<= 1;
+ // RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1);
+ prob = probs + (offs + (matchByte & offs) + (symbol >> 8));
+ bit = (symbol >> 7) & 1;
+ symbol <<= 1;
+ offs &= ~(matchByte ^ symbol);
+ RC_BIT(p, prob, bit);
+ }
+ while (symbol < 0x10000);
+ p->range = range;
+}
+
+
+
+static void LzmaEnc_InitPriceTables(CProbPrice *ProbPrices)
+{
+ UInt32 i;
+ for (i = 0; i < (kBitModelTotal >> kNumMoveReducingBits); i++)
+ {
+ const unsigned kCyclesBits = kNumBitPriceShiftBits;
+ UInt32 w = (i << kNumMoveReducingBits) + (1 << (kNumMoveReducingBits - 1));
+ unsigned bitCount = 0;
+ unsigned j;
+ for (j = 0; j < kCyclesBits; j++)
+ {
+ w = w * w;
+ bitCount <<= 1;
+ while (w >= ((UInt32)1 << 16))
+ {
+ w >>= 1;
+ bitCount++;
+ }
+ }
+ ProbPrices[i] = (CProbPrice)((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount);
+ // printf("\n%3d: %5d", i, ProbPrices[i]);
+ }
+}
+
+
+#define GET_PRICE(prob, symbol) \
+ p->ProbPrices[((prob) ^ (unsigned)(((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
+
+#define GET_PRICEa(prob, symbol) \
+ ProbPrices[((prob) ^ (unsigned)((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits];
+
+#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits]
+#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
+
+#define GET_PRICEa_0(prob) ProbPrices[(prob) >> kNumMoveReducingBits]
+#define GET_PRICEa_1(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits]
+
+
+static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, const CProbPrice *ProbPrices)
+{
+ UInt32 price = 0;
+ symbol |= 0x100;
+ do
+ {
+ unsigned bit = symbol & 1;
+ symbol >>= 1;
+ price += GET_PRICEa(probs[symbol], bit);
+ }
+ while (symbol >= 2);
+ return price;
+}
+
+
+static UInt32 LitEnc_Matched_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, const CProbPrice *ProbPrices)
+{
+ UInt32 price = 0;
+ UInt32 offs = 0x100;
+ symbol |= 0x100;
+ do
+ {
+ matchByte <<= 1;
+ price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1);
+ symbol <<= 1;
+ offs &= ~(matchByte ^ symbol);
+ }
+ while (symbol < 0x10000);
+ return price;
+}
+
+
+static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, unsigned numBits, UInt32 symbol)
+{
+ UInt32 range = rc->range;
+ unsigned m = 1;
+ do
+ {
+ UInt32 ttt, newBound;
+ unsigned bit = symbol & 1;
+ // RangeEnc_EncodeBit(rc, probs + m, bit);
+ symbol >>= 1;
+ RC_BIT(rc, probs + m, bit);
+ m = (m << 1) | bit;
+ }
+ while (--numBits);
+ rc->range = range;
+}
+
+
+
+static void LenEnc_Init(CLenEnc *p)
+{
+ unsigned i;
+ for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << (kLenNumLowBits + 1)); i++)
+ p->low[i] = kProbInitValue;
+ for (i = 0; i < kLenNumHighSymbols; i++)
+ p->high[i] = kProbInitValue;
+}
+
+static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, unsigned symbol, unsigned posState)
+{
+ UInt32 range, ttt, newBound;
+ CLzmaProb *probs = p->low;
+ range = rc->range;
+ RC_BIT_PRE(rc, probs);
+ if (symbol >= kLenNumLowSymbols)
+ {
+ RC_BIT_1(rc, probs);
+ probs += kLenNumLowSymbols;
+ RC_BIT_PRE(rc, probs);
+ if (symbol >= kLenNumLowSymbols * 2)
+ {
+ RC_BIT_1(rc, probs);
+ rc->range = range;
+ // RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols * 2);
+ LitEnc_Encode(rc, p->high, symbol - kLenNumLowSymbols * 2);
+ return;
+ }
+ symbol -= kLenNumLowSymbols;
+ }
+
+ // RcTree_Encode(rc, probs + (posState << kLenNumLowBits), kLenNumLowBits, symbol);
+ {
+ unsigned m;
+ unsigned bit;
+ RC_BIT_0(rc, probs);
+ probs += (posState << (1 + kLenNumLowBits));
+ bit = (symbol >> 2) ; RC_BIT(rc, probs + 1, bit); m = (1 << 1) + bit;
+ bit = (symbol >> 1) & 1; RC_BIT(rc, probs + m, bit); m = (m << 1) + bit;
+ bit = symbol & 1; RC_BIT(rc, probs + m, bit);
+ rc->range = range;
+ }
+}
+
+static void SetPrices_3(const CLzmaProb *probs, UInt32 startPrice, UInt32 *prices, const CProbPrice *ProbPrices)
+{
+ unsigned i;
+ for (i = 0; i < 8; i += 2)
+ {
+ UInt32 price = startPrice;
+ UInt32 prob;
+ price += GET_PRICEa(probs[1 ], (i >> 2));
+ price += GET_PRICEa(probs[2 + (i >> 2)], (i >> 1) & 1);
+ prob = probs[4 + (i >> 1)];
+ prices[i ] = price + GET_PRICEa_0(prob);
+ prices[i + 1] = price + GET_PRICEa_1(prob);
+ }
+}
+
+
+MY_NO_INLINE static void MY_FAST_CALL LenPriceEnc_UpdateTable(
+ CLenPriceEnc *p, unsigned posState,
+ const CLenEnc *enc,
+ const CProbPrice *ProbPrices)
+{
+ // int y; for (y = 0; y < 100; y++) {
+ UInt32 a;
+ unsigned i, numSymbols;
+
+ UInt32 *prices = p->prices[posState];
+ {
+ const CLzmaProb *probs = enc->low + (posState << (1 + kLenNumLowBits));
+ SetPrices_3(probs, GET_PRICEa_0(enc->low[0]), prices, ProbPrices);
+ a = GET_PRICEa_1(enc->low[0]);
+ SetPrices_3(probs + kLenNumLowSymbols, a + GET_PRICEa_0(enc->low[kLenNumLowSymbols]), prices + kLenNumLowSymbols, ProbPrices);
+ a += GET_PRICEa_1(enc->low[kLenNumLowSymbols]);
+ }
+ numSymbols = p->tableSize;
+ p->counters[posState] = numSymbols;
+ for (i = kLenNumLowSymbols * 2; i < numSymbols; i += 1)
+ {
+ prices[i] = a +
+ // RcTree_GetPrice(enc->high, kLenNumHighBits, i - kLenNumLowSymbols * 2, ProbPrices);
+ LitEnc_GetPrice(enc->high, i - kLenNumLowSymbols * 2, ProbPrices);
+ /*
+ unsigned sym = (i - kLenNumLowSymbols * 2) >> 1;
+ UInt32 price = a + RcTree_GetPrice(enc->high, kLenNumHighBits - 1, sym, ProbPrices);
+ UInt32 prob = enc->high[(1 << 7) + sym];
+ prices[i ] = price + GET_PRICEa_0(prob);
+ prices[i + 1] = price + GET_PRICEa_1(prob);
+ */
+ }
+ // }
+}
+
+static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, unsigned numPosStates,
+ const CLenEnc *enc,
+ const CProbPrice *ProbPrices)
+{
+ unsigned posState;
+ for (posState = 0; posState < numPosStates; posState++)
+ LenPriceEnc_UpdateTable(p, posState, enc, ProbPrices);
+}
+
+
+/*
+ #ifdef SHOW_STAT
+ g_STAT_OFFSET += num;
+ printf("\n MovePos %u", num);
+ #endif
+*/
+
+#define MOVE_POS(p, num) { \
+ p->additionalOffset += (num); \
+ p->matchFinder.Skip(p->matchFinderObj, (num)); }
+
+
+static unsigned ReadMatchDistances(CLzmaEnc *p, unsigned *numPairsRes)
+{
+ unsigned numPairs;
+
+ p->additionalOffset++;
+ p->numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
+ numPairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matches);
+ *numPairsRes = numPairs;
+
+ #ifdef SHOW_STAT
+ printf("\n i = %u numPairs = %u ", g_STAT_OFFSET, numPairs / 2);
+ g_STAT_OFFSET++;
+ {
+ unsigned i;
+ for (i = 0; i < numPairs; i += 2)
+ printf("%2u %6u | ", p->matches[i], p->matches[i + 1]);
+ }
+ #endif
+
+ if (numPairs == 0)
+ return 0;
+ {
+ unsigned len = p->matches[(size_t)numPairs - 2];
+ if (len != p->numFastBytes)
+ return len;
+ {
+ UInt32 numAvail = p->numAvail;
+ if (numAvail > LZMA_MATCH_LEN_MAX)
+ numAvail = LZMA_MATCH_LEN_MAX;
+ {
+ const Byte *p1 = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ const Byte *p2 = p1 + len;
+ ptrdiff_t dif = (ptrdiff_t)-1 - p->matches[(size_t)numPairs - 1];
+ const Byte *lim = p1 + numAvail;
+ for (; p2 != lim && *p2 == p2[dif]; p2++);
+ return (unsigned)(p2 - p1);
+ }
+ }
+ }
+}
+
+#define MARK_LIT ((UInt32)(Int32)-1)
+
+#define MakeAs_Lit(p) { (p)->dist = MARK_LIT; (p)->extra = 0; }
+#define MakeAs_ShortRep(p) { (p)->dist = 0; (p)->extra = 0; }
+#define IsShortRep(p) ((p)->dist == 0)
+
+
+#define GetPrice_ShortRep(p, state, posState) \
+ ( GET_PRICE_0(p->isRepG0[state]) + GET_PRICE_0(p->isRep0Long[state][posState]))
+
+#define GetPrice_Rep_0(p, state, posState) ( \
+ GET_PRICE_1(p->isMatch[state][posState]) \
+ + GET_PRICE_1(p->isRep0Long[state][posState])) \
+ + GET_PRICE_1(p->isRep[state]) \
+ + GET_PRICE_0(p->isRepG0[state])
+
+
+static UInt32 GetPrice_PureRep(const CLzmaEnc *p, unsigned repIndex, size_t state, size_t posState)
+{
+ UInt32 price;
+ UInt32 prob = p->isRepG0[state];
+ if (repIndex == 0)
+ {
+ price = GET_PRICE_0(prob);
+ price += GET_PRICE_1(p->isRep0Long[state][posState]);
+ }
+ else
+ {
+ price = GET_PRICE_1(prob);
+ prob = p->isRepG1[state];
+ if (repIndex == 1)
+ price += GET_PRICE_0(prob);
+ else
+ {
+ price += GET_PRICE_1(prob);
+ price += GET_PRICE(p->isRepG2[state], repIndex - 2);
+ }
+ }
+ return price;
+}
+
+
+static unsigned Backward(CLzmaEnc *p, unsigned cur)
+{
+ unsigned wr = cur + 1;
+ p->optEnd = wr;
+
+ for (;;)
+ {
+ UInt32 dist = p->opt[cur].dist;
+ UInt32 len = p->opt[cur].len;
+ UInt32 extra = p->opt[cur].extra;
+ cur -= len;
+
+ if (extra)
+ {
+ wr--;
+ p->opt[wr].len = len;
+ cur -= extra;
+ len = extra;
+ if (extra == 1)
+ {
+ p->opt[wr].dist = dist;
+ dist = MARK_LIT;
+ }
+ else
+ {
+ p->opt[wr].dist = 0;
+ len--;
+ wr--;
+ p->opt[wr].dist = MARK_LIT;
+ p->opt[wr].len = 1;
+ }
+ }
+
+ if (cur == 0)
+ {
+ p->backRes = dist;
+ p->optCur = wr;
+ return len;
+ }
+
+ wr--;
+ p->opt[wr].dist = dist;
+ p->opt[wr].len = len;
+ }
+}
+
+
+
+#define LIT_PROBS(pos, prevByte) \
+ (p->litProbs + (UInt32)3 * (((((pos) << 8) + (prevByte)) & p->lpMask) << p->lc))
+
+
+static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)
+{
+ unsigned last, cur;
+ UInt32 reps[LZMA_NUM_REPS];
+ unsigned repLens[LZMA_NUM_REPS];
+ UInt32 *matches;
+
+ {
+ UInt32 numAvail;
+ unsigned numPairs, mainLen, repMaxIndex, i, posState;
+ UInt32 matchPrice, repMatchPrice;
+ const Byte *data;
+ Byte curByte, matchByte;
+
+ p->optCur = p->optEnd = 0;
+
+ if (p->additionalOffset == 0)
+ mainLen = ReadMatchDistances(p, &numPairs);
+ else
+ {
+ mainLen = p->longestMatchLen;
+ numPairs = p->numPairs;
+ }
+
+ numAvail = p->numAvail;
+ if (numAvail < 2)
+ {
+ p->backRes = MARK_LIT;
+ return 1;
+ }
+ if (numAvail > LZMA_MATCH_LEN_MAX)
+ numAvail = LZMA_MATCH_LEN_MAX;
+
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ repMaxIndex = 0;
+
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ unsigned len;
+ const Byte *data2;
+ reps[i] = p->reps[i];
+ data2 = data - reps[i];
+ if (data[0] != data2[0] || data[1] != data2[1])
+ {
+ repLens[i] = 0;
+ continue;
+ }
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++);
+ repLens[i] = len;
+ if (len > repLens[repMaxIndex])
+ repMaxIndex = i;
+ }
+
+ if (repLens[repMaxIndex] >= p->numFastBytes)
+ {
+ unsigned len;
+ p->backRes = repMaxIndex;
+ len = repLens[repMaxIndex];
+ MOVE_POS(p, len - 1)
+ return len;
+ }
+
+ matches = p->matches;
+
+ if (mainLen >= p->numFastBytes)
+ {
+ p->backRes = matches[(size_t)numPairs - 1] + LZMA_NUM_REPS;
+ MOVE_POS(p, mainLen - 1)
+ return mainLen;
+ }
+
+ curByte = *data;
+ matchByte = *(data - reps[0]);
+
+ if (mainLen < 2 && curByte != matchByte && repLens[repMaxIndex] < 2)
+ {
+ p->backRes = MARK_LIT;
+ return 1;
+ }
+
+ p->opt[0].state = (CState)p->state;
+
+ posState = (position & p->pbMask);
+
+ {
+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
+ p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) +
+ (!IsLitState(p->state) ?
+ LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) :
+ LitEnc_GetPrice(probs, curByte, p->ProbPrices));
+ }
+
+ MakeAs_Lit(&p->opt[1]);
+
+ matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]);
+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]);
+
+ if (matchByte == curByte)
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, p->state, posState);
+ if (shortRepPrice < p->opt[1].price)
+ {
+ p->opt[1].price = shortRepPrice;
+ MakeAs_ShortRep(&p->opt[1]);
+ }
+ }
+
+ last = (mainLen >= repLens[repMaxIndex] ? mainLen : repLens[repMaxIndex]);
+
+ if (last < 2)
+ {
+ p->backRes = p->opt[1].dist;
+ return 1;
+ }
+
+ p->opt[1].len = 1;
+
+ p->opt[0].reps[0] = reps[0];
+ p->opt[0].reps[1] = reps[1];
+ p->opt[0].reps[2] = reps[2];
+ p->opt[0].reps[3] = reps[3];
+
+ {
+ unsigned len = last;
+ do
+ p->opt[len--].price = kInfinityPrice;
+ while (len >= 2);
+ }
+
+ // ---------- REP ----------
+
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ unsigned repLen = repLens[i];
+ UInt32 price;
+ if (repLen < 2)
+ continue;
+ price = repMatchPrice + GetPrice_PureRep(p, i, p->state, posState);
+ do
+ {
+ UInt32 price2 = price + p->repLenEnc.prices[posState][(size_t)repLen - 2];
+ COptimal *opt = &p->opt[repLen];
+ if (price2 < opt->price)
+ {
+ opt->price = price2;
+ opt->len = repLen;
+ opt->dist = i;
+ opt->extra = 0;
+ }
+ }
+ while (--repLen >= 2);
+ }
+
+
+ // ---------- MATCH ----------
+ {
+ unsigned len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
+ if (len <= mainLen)
+ {
+ unsigned offs = 0;
+ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]);
+
+ while (len > matches[offs])
+ offs += 2;
+
+ for (; ; len++)
+ {
+ COptimal *opt;
+ UInt32 dist = matches[(size_t)offs + 1];
+ UInt32 price2 = normalMatchPrice + p->lenEnc.prices[posState][(size_t)len - LZMA_MATCH_LEN_MIN];
+ unsigned lenToPosState = GetLenToPosState(len);
+
+ if (dist < kNumFullDistances)
+ price2 += p->distancesPrices[lenToPosState][dist & (kNumFullDistances - 1)];
+ else
+ {
+ unsigned slot;
+ GetPosSlot2(dist, slot);
+ price2 += p->alignPrices[dist & kAlignMask];
+ price2 += p->posSlotPrices[lenToPosState][slot];
+ }
+
+ opt = &p->opt[len];
+
+ if (price2 < opt->price)
+ {
+ opt->price = price2;
+ opt->len = len;
+ opt->dist = dist + LZMA_NUM_REPS;
+ opt->extra = 0;
+ }
+
+ if (len == matches[offs])
+ {
+ offs += 2;
+ if (offs == numPairs)
+ break;
+ }
+ }
+ }
+ }
+
+
+ cur = 0;
+
+ #ifdef SHOW_STAT2
+ /* if (position >= 0) */
+ {
+ unsigned i;
+ printf("\n pos = %4X", position);
+ for (i = cur; i <= last; i++)
+ printf("\nprice[%4X] = %u", position - cur + i, p->opt[i].price);
+ }
+ #endif
+ }
+
+
+
+ // ---------- Optimal Parsing ----------
+
+ for (;;)
+ {
+ UInt32 numAvail, numAvailFull;
+ unsigned newLen, numPairs, prev, state, posState, startLen;
+ UInt32 curPrice, litPrice, matchPrice, repMatchPrice;
+ Bool nextIsLit;
+ Byte curByte, matchByte;
+ const Byte *data;
+ COptimal *curOpt, *nextOpt;
+
+ if (++cur == last)
+ return Backward(p, cur);
+
+ newLen = ReadMatchDistances(p, &numPairs);
+
+ if (newLen >= p->numFastBytes)
+ {
+ p->numPairs = numPairs;
+ p->longestMatchLen = newLen;
+ return Backward(p, cur);
+ }
+
+ curOpt = &p->opt[cur];
+ prev = cur - curOpt->len;
+
+ if (curOpt->len == 1)
+ {
+ state = p->opt[prev].state;
+ if (IsShortRep(curOpt))
+ state = kShortRepNextStates[state];
+ else
+ state = kLiteralNextStates[state];
+ }
+ else
+ {
+ const COptimal *prevOpt;
+ UInt32 b0;
+ UInt32 dist = curOpt->dist;
+
+ if (curOpt->extra)
+ {
+ prev -= curOpt->extra;
+ state = kState_RepAfterLit;
+ if (curOpt->extra == 1)
+ state = (dist < LZMA_NUM_REPS) ? kState_RepAfterLit : kState_MatchAfterLit;
+ }
+ else
+ {
+ state = p->opt[prev].state;
+ if (dist < LZMA_NUM_REPS)
+ state = kRepNextStates[state];
+ else
+ state = kMatchNextStates[state];
+ }
+
+ prevOpt = &p->opt[prev];
+ b0 = prevOpt->reps[0];
+
+ if (dist < LZMA_NUM_REPS)
+ {
+ if (dist == 0)
+ {
+ reps[0] = b0;
+ reps[1] = prevOpt->reps[1];
+ reps[2] = prevOpt->reps[2];
+ reps[3] = prevOpt->reps[3];
+ }
+ else
+ {
+ reps[1] = b0;
+ b0 = prevOpt->reps[1];
+ if (dist == 1)
+ {
+ reps[0] = b0;
+ reps[2] = prevOpt->reps[2];
+ reps[3] = prevOpt->reps[3];
+ }
+ else
+ {
+ reps[2] = b0;
+ reps[0] = prevOpt->reps[dist];
+ reps[3] = prevOpt->reps[dist ^ 1];
+ }
+ }
+ }
+ else
+ {
+ reps[0] = (dist - LZMA_NUM_REPS + 1);
+ reps[1] = b0;
+ reps[2] = prevOpt->reps[1];
+ reps[3] = prevOpt->reps[2];
+ }
+ }
+
+ curOpt->state = (CState)state;
+ curOpt->reps[0] = reps[0];
+ curOpt->reps[1] = reps[1];
+ curOpt->reps[2] = reps[2];
+ curOpt->reps[3] = reps[3];
+
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ curByte = *data;
+ matchByte = *(data - reps[0]);
+
+ position++;
+ posState = (position & p->pbMask);
+
+ /*
+ The order of Price checks:
+ < LIT
+ <= SHORT_REP
+ < LIT : REP_0
+ < REP [ : LIT : REP_0 ]
+ < MATCH [ : LIT : REP_0 ]
+ */
+
+ curPrice = curOpt->price;
+ litPrice = curPrice + GET_PRICE_0(p->isMatch[state][posState]);
+
+ nextOpt = &p->opt[(size_t)cur + 1];
+ nextIsLit = False;
+
+ // if (litPrice >= nextOpt->price) litPrice = 0; else // 18.new
+ {
+ const CLzmaProb *probs = LIT_PROBS(position, *(data - 1));
+ litPrice += (!IsLitState(state) ?
+ LitEnc_Matched_GetPrice(probs, curByte, matchByte, p->ProbPrices) :
+ LitEnc_GetPrice(probs, curByte, p->ProbPrices));
+
+ if (litPrice < nextOpt->price)
+ {
+ nextOpt->price = litPrice;
+ nextOpt->len = 1;
+ MakeAs_Lit(nextOpt);
+ nextIsLit = True;
+ }
+ }
+
+ matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]);
+ repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]);
+
+ // ---------- SHORT_REP ----------
+ // if (IsLitState(state)) // 18.new
+ if (matchByte == curByte)
+ // if (repMatchPrice < nextOpt->price) // 18.new
+ if (nextOpt->len < 2
+ || (nextOpt->dist != 0
+ && nextOpt->extra <= 1 // 17.old
+ ))
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetPrice_ShortRep(p, state, posState);
+ if (shortRepPrice <= nextOpt->price) // 17.old
+ // if (shortRepPrice < nextOpt->price) // 18.new
+ {
+ nextOpt->price = shortRepPrice;
+ nextOpt->len = 1;
+ MakeAs_ShortRep(nextOpt);
+ nextIsLit = False;
+ }
+ }
+
+ numAvailFull = p->numAvail;
+ {
+ UInt32 temp = kNumOpts - 1 - cur;
+ if (numAvailFull > temp)
+ numAvailFull = temp;
+ }
+
+ if (numAvailFull < 2)
+ continue;
+ numAvail = (numAvailFull <= p->numFastBytes ? numAvailFull : p->numFastBytes);
+
+ // numAvail <= p->numFastBytes
+
+ // ---------- LIT : REP_0 ----------
+
+ if (
+ // litPrice != 0 && // 18.new
+ !nextIsLit
+ && matchByte != curByte
+ && numAvailFull > 2)
+ {
+ const Byte *data2 = data - reps[0];
+ if (data[1] == data2[1] && data[2] == data2[2])
+ {
+ unsigned len;
+ unsigned limit = p->numFastBytes + 1;
+ if (limit > numAvailFull)
+ limit = numAvailFull;
+ for (len = 3; len < limit && data[len] == data2[len]; len++);
+
+ {
+ unsigned state2 = kLiteralNextStates[state];
+ unsigned posState2 = (position + 1) & p->pbMask;
+ UInt32 price = litPrice + GetPrice_Rep_0(p, state2, posState2);
+ {
+ unsigned offset = cur + len;
+ while (last < offset)
+ p->opt[++last].price = kInfinityPrice;
+
+ // do
+ {
+ UInt32 price2;
+ COptimal *opt;
+ len--;
+ // price2 = price + GetPrice_Len_Rep_0(p, len, state2, posState2);
+ price2 = price + p->repLenEnc.prices[posState2][len - LZMA_MATCH_LEN_MIN];
+
+ opt = &p->opt[offset];
+ // offset--;
+ if (price2 < opt->price)
+ {
+ opt->price = price2;
+ opt->len = len;
+ opt->dist = 0;
+ opt->extra = 1;
+ }
+ }
+ // while (len >= 3);
+ }
+ }
+ }
+ }
+
+ startLen = 2; /* speed optimization */
+ {
+ // ---------- REP ----------
+ unsigned repIndex = 0; // 17.old
+ // unsigned repIndex = IsLitState(state) ? 0 : 1; // 18.notused
+ for (; repIndex < LZMA_NUM_REPS; repIndex++)
+ {
+ unsigned len;
+ UInt32 price;
+ const Byte *data2 = data - reps[repIndex];
+ if (data[0] != data2[0] || data[1] != data2[1])
+ continue;
+
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++);
+
+ // if (len < startLen) continue; // 18.new: speed optimization
+
+ while (last < cur + len)
+ p->opt[++last].price = kInfinityPrice;
+ {
+ unsigned len2 = len;
+ price = repMatchPrice + GetPrice_PureRep(p, repIndex, state, posState);
+ do
+ {
+ UInt32 price2 = price + p->repLenEnc.prices[posState][(size_t)len2 - 2];
+ COptimal *opt = &p->opt[cur + len2];
+ if (price2 < opt->price)
+ {
+ opt->price = price2;
+ opt->len = len2;
+ opt->dist = repIndex;
+ opt->extra = 0;
+ }
+ }
+ while (--len2 >= 2);
+ }
+
+ if (repIndex == 0) startLen = len + 1; // 17.old
+ // startLen = len + 1; // 18.new
+
+ /* if (_maxMode) */
+ {
+ // ---------- REP : LIT : REP_0 ----------
+ // numFastBytes + 1 + numFastBytes
+
+ unsigned len2 = len + 1;
+ unsigned limit = len2 + p->numFastBytes;
+ if (limit > numAvailFull)
+ limit = numAvailFull;
+
+ for (; len2 < limit && data[len2] == data2[len2]; len2++);
+
+ len2 -= len;
+ if (len2 >= 3)
+ {
+ unsigned state2 = kRepNextStates[state];
+ unsigned posState2 = (position + len) & p->pbMask;
+ price +=
+ p->repLenEnc.prices[posState][(size_t)len - 2]
+ + GET_PRICE_0(p->isMatch[state2][posState2])
+ + LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]),
+ data[len], data2[len], p->ProbPrices);
+
+ // state2 = kLiteralNextStates[state2];
+ state2 = kState_LitAfterRep;
+ posState2 = (posState2 + 1) & p->pbMask;
+
+
+ price += GetPrice_Rep_0(p, state2, posState2);
+ {
+ unsigned offset = cur + len + len2;
+ while (last < offset)
+ p->opt[++last].price = kInfinityPrice;
+ // do
+ {
+ unsigned price2;
+ COptimal *opt;
+ len2--;
+ // price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2);
+ price2 = price + p->repLenEnc.prices[posState2][len2 - LZMA_MATCH_LEN_MIN];
+
+ opt = &p->opt[offset];
+ // offset--;
+ if (price2 < opt->price)
+ {
+ opt->price = price2;
+ opt->len = len2;
+ opt->extra = (CExtra)(len + 1);
+ opt->dist = repIndex;
+ }
+ }
+ // while (len2 >= 3);
+ }
+ }
+ }
+ }
+ }
+
+
+ // ---------- MATCH ----------
+ /* for (unsigned len = 2; len <= newLen; len++) */
+ if (newLen > numAvail)
+ {
+ newLen = numAvail;
+ for (numPairs = 0; newLen > matches[numPairs]; numPairs += 2);
+ matches[numPairs] = newLen;
+ numPairs += 2;
+ }
+
+ if (newLen >= startLen)
+ {
+ UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]);
+ UInt32 dist;
+ unsigned offs, posSlot, len;
+ while (last < cur + newLen)
+ p->opt[++last].price = kInfinityPrice;
+
+ offs = 0;
+ while (startLen > matches[offs])
+ offs += 2;
+ dist = matches[(size_t)offs + 1];
+
+ // if (dist >= kNumFullDistances)
+ GetPosSlot2(dist, posSlot);
+
+ for (len = /*2*/ startLen; ; len++)
+ {
+ UInt32 price = normalMatchPrice + p->lenEnc.prices[posState][(size_t)len - LZMA_MATCH_LEN_MIN];
+ {
+ COptimal *opt;
+ unsigned lenToPosState = len - 2; lenToPosState = GetLenToPosState2(lenToPosState);
+ if (dist < kNumFullDistances)
+ price += p->distancesPrices[lenToPosState][dist & (kNumFullDistances - 1)];
+ else
+ price += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[dist & kAlignMask];
+
+ opt = &p->opt[cur + len];
+ if (price < opt->price)
+ {
+ opt->price = price;
+ opt->len = len;
+ opt->dist = dist + LZMA_NUM_REPS;
+ opt->extra = 0;
+ }
+ }
+
+ if (/*_maxMode && */ len == matches[offs])
+ {
+ // MATCH : LIT : REP_0
+
+ const Byte *data2 = data - dist - 1;
+ unsigned len2 = len + 1;
+ unsigned limit = len2 + p->numFastBytes;
+ if (limit > numAvailFull)
+ limit = numAvailFull;
+
+ for (; len2 < limit && data[len2] == data2[len2]; len2++);
+
+ len2 -= len;
+
+ if (len2 >= 3)
+ {
+ unsigned state2 = kMatchNextStates[state];
+ unsigned posState2 = (position + len) & p->pbMask;
+ unsigned offset;
+ price += GET_PRICE_0(p->isMatch[state2][posState2]);
+ price += LitEnc_Matched_GetPrice(LIT_PROBS(position + len, data[(size_t)len - 1]),
+ data[len], data2[len], p->ProbPrices);
+
+ // state2 = kLiteralNextStates[state2];
+ state2 = kState_LitAfterMatch;
+
+ posState2 = (posState2 + 1) & p->pbMask;
+ price += GetPrice_Rep_0(p, state2, posState2);
+
+ offset = cur + len + len2;
+ while (last < offset)
+ p->opt[++last].price = kInfinityPrice;
+ // do
+ {
+ UInt32 price2;
+ COptimal *opt;
+ len2--;
+ // price2 = price + GetPrice_Len_Rep_0(p, len2, state2, posState2);
+ price2 = price + p->repLenEnc.prices[posState2][len2 - LZMA_MATCH_LEN_MIN];
+ opt = &p->opt[offset];
+ // offset--;
+ if (price2 < opt->price)
+ {
+ opt->price = price2;
+ opt->len = len2;
+ opt->extra = (CExtra)(len + 1);
+ opt->dist = dist + LZMA_NUM_REPS;
+ }
+ }
+ // while (len2 >= 3);
+ }
+
+ offs += 2;
+ if (offs == numPairs)
+ break;
+ dist = matches[(size_t)offs + 1];
+ // if (dist >= kNumFullDistances)
+ GetPosSlot2(dist, posSlot);
+ }
+ }
+ }
+ }
+}
+
+
+
+#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist))
+
+
+
+static unsigned GetOptimumFast(CLzmaEnc *p)
+{
+ UInt32 numAvail, mainDist;
+ unsigned mainLen, numPairs, repIndex, repLen, i;
+ const Byte *data;
+
+ if (p->additionalOffset == 0)
+ mainLen = ReadMatchDistances(p, &numPairs);
+ else
+ {
+ mainLen = p->longestMatchLen;
+ numPairs = p->numPairs;
+ }
+
+ numAvail = p->numAvail;
+ p->backRes = MARK_LIT;
+ if (numAvail < 2)
+ return 1;
+ if (numAvail > LZMA_MATCH_LEN_MAX)
+ numAvail = LZMA_MATCH_LEN_MAX;
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+ repLen = repIndex = 0;
+
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ unsigned len;
+ const Byte *data2 = data - p->reps[i];
+ if (data[0] != data2[0] || data[1] != data2[1])
+ continue;
+ for (len = 2; len < numAvail && data[len] == data2[len]; len++);
+ if (len >= p->numFastBytes)
+ {
+ p->backRes = i;
+ MOVE_POS(p, len - 1)
+ return len;
+ }
+ if (len > repLen)
+ {
+ repIndex = i;
+ repLen = len;
+ }
+ }
+
+ if (mainLen >= p->numFastBytes)
+ {
+ p->backRes = p->matches[(size_t)numPairs - 1] + LZMA_NUM_REPS;
+ MOVE_POS(p, mainLen - 1)
+ return mainLen;
+ }
+
+ mainDist = 0; /* for GCC */
+
+ if (mainLen >= 2)
+ {
+ mainDist = p->matches[(size_t)numPairs - 1];
+ while (numPairs > 2)
+ {
+ UInt32 dist2;
+ if (mainLen != p->matches[(size_t)numPairs - 4] + 1)
+ break;
+ dist2 = p->matches[(size_t)numPairs - 3];
+ if (!ChangePair(dist2, mainDist))
+ break;
+ numPairs -= 2;
+ mainLen--;
+ mainDist = dist2;
+ }
+ if (mainLen == 2 && mainDist >= 0x80)
+ mainLen = 1;
+ }
+
+ if (repLen >= 2)
+ if ( repLen + 1 >= mainLen
+ || (repLen + 2 >= mainLen && mainDist >= (1 << 9))
+ || (repLen + 3 >= mainLen && mainDist >= (1 << 15)))
+ {
+ p->backRes = repIndex;
+ MOVE_POS(p, repLen - 1)
+ return repLen;
+ }
+
+ if (mainLen < 2 || numAvail <= 2)
+ return 1;
+
+ {
+ unsigned len1 = ReadMatchDistances(p, &p->numPairs);
+ p->longestMatchLen = len1;
+
+ if (len1 >= 2)
+ {
+ UInt32 newDist = p->matches[(size_t)p->numPairs - 1];
+ if ( (len1 >= mainLen && newDist < mainDist)
+ || (len1 == mainLen + 1 && !ChangePair(mainDist, newDist))
+ || (len1 > mainLen + 1)
+ || (len1 + 1 >= mainLen && mainLen >= 3 && ChangePair(newDist, mainDist)))
+ return 1;
+ }
+ }
+
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1;
+
+ for (i = 0; i < LZMA_NUM_REPS; i++)
+ {
+ unsigned len, limit;
+ const Byte *data2 = data - p->reps[i];
+ if (data[0] != data2[0] || data[1] != data2[1])
+ continue;
+ limit = mainLen - 1;
+ for (len = 2;; len++)
+ {
+ if (len >= limit)
+ return 1;
+ if (data[len] != data2[len])
+ break;
+ }
+ }
+
+ p->backRes = mainDist + LZMA_NUM_REPS;
+ if (mainLen != 2)
+ {
+ MOVE_POS(p, mainLen - 2)
+ }
+ return mainLen;
+}
+
+
+
+
+static void WriteEndMarker(CLzmaEnc *p, unsigned posState)
+{
+ UInt32 range;
+ range = p->rc.range;
+ {
+ UInt32 ttt, newBound;
+ CLzmaProb *prob = &p->isMatch[p->state][posState];
+ RC_BIT_PRE(&p->rc, prob)
+ RC_BIT_1(&p->rc, prob)
+ prob = &p->isRep[p->state];
+ RC_BIT_PRE(&p->rc, prob)
+ RC_BIT_0(&p->rc, prob)
+ }
+ p->state = kMatchNextStates[p->state];
+
+ p->rc.range = range;
+ LenEnc_Encode(&p->lenProbs, &p->rc, 0, posState);
+ range = p->rc.range;
+
+ {
+ // RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[0], (1 << kNumPosSlotBits) - 1);
+ CLzmaProb *probs = p->posSlotEncoder[0];
+ unsigned m = 1;
+ do
+ {
+ UInt32 ttt, newBound;
+ RC_BIT_PRE(p, probs + m)
+ RC_BIT_1(&p->rc, probs + m);
+ m = (m << 1) + 1;
+ }
+ while (m < (1 << kNumPosSlotBits));
+ }
+ {
+ // RangeEnc_EncodeDirectBits(&p->rc, ((UInt32)1 << (30 - kNumAlignBits)) - 1, 30 - kNumAlignBits); UInt32 range = p->range;
+ unsigned numBits = 30 - kNumAlignBits;
+ do
+ {
+ range >>= 1;
+ p->rc.low += range;
+ RC_NORM(&p->rc)
+ }
+ while (--numBits);
+ }
+
+ {
+ // RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask);
+ CLzmaProb *probs = p->posAlignEncoder;
+ unsigned m = 1;
+ do
+ {
+ UInt32 ttt, newBound;
+ RC_BIT_PRE(p, probs + m)
+ RC_BIT_1(&p->rc, probs + m);
+ m = (m << 1) + 1;
+ }
+ while (m < kAlignTableSize);
+ }
+ p->rc.range = range;
+}
+
+
+static SRes CheckErrors(CLzmaEnc *p)
+{
+ if (p->result != SZ_OK)
+ return p->result;
+ if (p->rc.res != SZ_OK)
+ p->result = SZ_ERROR_WRITE;
+ if (p->matchFinderBase.result != SZ_OK)
+ p->result = SZ_ERROR_READ;
+ if (p->result != SZ_OK)
+ p->finished = True;
+ return p->result;
+}
+
+
+MY_NO_INLINE static SRes Flush(CLzmaEnc *p, UInt32 nowPos)
+{
+ /* ReleaseMFStream(); */
+ p->finished = True;
+ if (p->writeEndMark)
+ WriteEndMarker(p, nowPos & p->pbMask);
+ RangeEnc_FlushData(&p->rc);
+ RangeEnc_FlushStream(&p->rc);
+ return CheckErrors(p);
+}
+
+
+
+static void FillAlignPrices(CLzmaEnc *p)
+{
+ unsigned i;
+ const CProbPrice *ProbPrices = p->ProbPrices;
+ const CLzmaProb *probs = p->posAlignEncoder;
+ p->alignPriceCount = 0;
+ for (i = 0; i < kAlignTableSize / 2; i++)
+ {
+ UInt32 price = 0;
+ unsigned symbol = i;
+ unsigned m = 1;
+ unsigned bit;
+ UInt32 prob;
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[m], bit); m = (m << 1) + bit;
+ prob = probs[m];
+ p->alignPrices[i ] = price + GET_PRICEa_0(prob);
+ p->alignPrices[i + 8] = price + GET_PRICEa_1(prob);
+ // p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices);
+ }
+}
+
+
+static void FillDistancesPrices(CLzmaEnc *p)
+{
+ UInt32 tempPrices[kNumFullDistances];
+ unsigned i, lenToPosState;
+
+ const CProbPrice *ProbPrices = p->ProbPrices;
+ p->matchPriceCount = 0;
+
+ for (i = kStartPosModelIndex; i < kNumFullDistances; i++)
+ {
+ unsigned posSlot = GetPosSlot1(i);
+ unsigned footerBits = ((posSlot >> 1) - 1);
+ unsigned base = ((2 | (posSlot & 1)) << footerBits);
+ // tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base, footerBits, i - base, p->ProbPrices);
+
+ const CLzmaProb *probs = p->posEncoders + base;
+ UInt32 price = 0;
+ unsigned m = 1;
+ unsigned symbol = i - base;
+ do
+ {
+ unsigned bit = symbol & 1;
+ symbol >>= 1;
+ price += GET_PRICEa(probs[m], bit);
+ m = (m << 1) + bit;
+ }
+ while (--footerBits);
+ tempPrices[i] = price;
+ }
+
+ for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++)
+ {
+ unsigned posSlot;
+ const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState];
+ UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState];
+ unsigned distTableSize = p->distTableSize;
+ const CLzmaProb *probs = encoder;
+ for (posSlot = 0; posSlot < distTableSize; posSlot += 2)
+ {
+ // posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices);
+ UInt32 price = 0;
+ unsigned bit;
+ unsigned symbol = (posSlot >> 1) + (1 << (kNumPosSlotBits - 1));
+ UInt32 prob;
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[symbol], bit);
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[symbol], bit);
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[symbol], bit);
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[symbol], bit);
+ bit = symbol & 1; symbol >>= 1; price += GET_PRICEa(probs[symbol], bit);
+ prob = probs[(posSlot >> 1) + (1 << (kNumPosSlotBits - 1))];
+ posSlotPrices[posSlot ] = price + GET_PRICEa_0(prob);
+ posSlotPrices[posSlot + 1] = price + GET_PRICEa_1(prob);
+ }
+ for (posSlot = kEndPosModelIndex; posSlot < distTableSize; posSlot++)
+ posSlotPrices[posSlot] += ((UInt32)(((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits);
+
+ {
+ UInt32 *distancesPrices = p->distancesPrices[lenToPosState];
+ {
+ distancesPrices[0] = posSlotPrices[0];
+ distancesPrices[1] = posSlotPrices[1];
+ distancesPrices[2] = posSlotPrices[2];
+ distancesPrices[3] = posSlotPrices[3];
+ }
+ for (i = 4; i < kNumFullDistances; i += 2)
+ {
+ UInt32 slotPrice = posSlotPrices[GetPosSlot1(i)];
+ distancesPrices[i ] = slotPrice + tempPrices[i];
+ distancesPrices[i + 1] = slotPrice + tempPrices[i + 1];
+ }
+ }
+ }
+}
+
+
+
+void LzmaEnc_Construct(CLzmaEnc *p)
+{
+ RangeEnc_Construct(&p->rc);
+ MatchFinder_Construct(&p->matchFinderBase);
+
+ #ifndef _7ZIP_ST
+ MatchFinderMt_Construct(&p->matchFinderMt);
+ p->matchFinderMt.MatchFinder = &p->matchFinderBase;
+ #endif
+
+ {
+ CLzmaEncProps props;
+ LzmaEncProps_Init(&props);
+ LzmaEnc_SetProps(p, &props);
+ }
+
+ #ifndef LZMA_LOG_BSR
+ LzmaEnc_FastPosInit(p->g_FastPos);
+ #endif
+
+ LzmaEnc_InitPriceTables(p->ProbPrices);
+ p->litProbs = NULL;
+ p->saveState.litProbs = NULL;
+
+}
+
+CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc)
+{
+ void *p;
+ p = ISzAlloc_Alloc(alloc, sizeof(CLzmaEnc));
+ if (p)
+ LzmaEnc_Construct((CLzmaEnc *)p);
+ return p;
+}
+
+void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->litProbs);
+ ISzAlloc_Free(alloc, p->saveState.litProbs);
+ p->litProbs = NULL;
+ p->saveState.litProbs = NULL;
+}
+
+void LzmaEnc_Destruct(CLzmaEnc *p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ #ifndef _7ZIP_ST
+ MatchFinderMt_Destruct(&p->matchFinderMt, allocBig);
+ #endif
+
+ MatchFinder_Free(&p->matchFinderBase, allocBig);
+ LzmaEnc_FreeLits(p, alloc);
+ RangeEnc_Free(&p->rc, alloc);
+}
+
+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig);
+ ISzAlloc_Free(alloc, p);
+}
+
+
+static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, UInt32 maxPackSize, UInt32 maxUnpackSize)
+{
+ UInt32 nowPos32, startPos32;
+ if (p->needInit)
+ {
+ p->matchFinder.Init(p->matchFinderObj);
+ p->needInit = 0;
+ }
+
+ if (p->finished)
+ return p->result;
+ RINOK(CheckErrors(p));
+
+ nowPos32 = (UInt32)p->nowPos64;
+ startPos32 = nowPos32;
+
+ if (p->nowPos64 == 0)
+ {
+ unsigned numPairs;
+ Byte curByte;
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
+ return Flush(p, nowPos32);
+ ReadMatchDistances(p, &numPairs);
+ RangeEnc_EncodeBit_0(&p->rc, &p->isMatch[kState_Start][0]);
+ // p->state = kLiteralNextStates[p->state];
+ curByte = *(p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset);
+ LitEnc_Encode(&p->rc, p->litProbs, curByte);
+ p->additionalOffset--;
+ nowPos32++;
+ }
+
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0)
+
+ for (;;)
+ {
+ UInt32 dist;
+ unsigned len, posState;
+ UInt32 range, ttt, newBound;
+ CLzmaProb *probs;
+
+ if (p->fastMode)
+ len = GetOptimumFast(p);
+ else
+ {
+ unsigned oci = p->optCur;
+ if (p->optEnd == oci)
+ len = GetOptimum(p, nowPos32);
+ else
+ {
+ const COptimal *opt = &p->opt[oci];
+ len = opt->len;
+ p->backRes = opt->dist;
+ p->optCur = oci + 1;
+ }
+ }
+
+ posState = (unsigned)nowPos32 & p->pbMask;
+ range = p->rc.range;
+ probs = &p->isMatch[p->state][posState];
+
+ RC_BIT_PRE(&p->rc, probs)
+
+ dist = p->backRes;
+
+ #ifdef SHOW_STAT2
+ printf("\n pos = %6X, len = %3u pos = %6u", nowPos32, len, dist);
+ #endif
+
+ if (dist == MARK_LIT)
+ {
+ Byte curByte;
+ const Byte *data;
+ unsigned state;
+
+ RC_BIT_0(&p->rc, probs);
+ p->rc.range = range;
+ data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
+ probs = LIT_PROBS(nowPos32, *(data - 1));
+ curByte = *data;
+ state = p->state;
+ p->state = kLiteralNextStates[state];
+ if (IsLitState(state))
+ LitEnc_Encode(&p->rc, probs, curByte);
+ else
+ LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0]));
+ }
+ else
+ {
+ RC_BIT_1(&p->rc, probs);
+ probs = &p->isRep[p->state];
+ RC_BIT_PRE(&p->rc, probs)
+
+ if (dist < LZMA_NUM_REPS)
+ {
+ RC_BIT_1(&p->rc, probs);
+ probs = &p->isRepG0[p->state];
+ RC_BIT_PRE(&p->rc, probs)
+ if (dist == 0)
+ {
+ RC_BIT_0(&p->rc, probs);
+ probs = &p->isRep0Long[p->state][posState];
+ RC_BIT_PRE(&p->rc, probs)
+ if (len != 1)
+ {
+ RC_BIT_1_BASE(&p->rc, probs);
+ }
+ else
+ {
+ RC_BIT_0_BASE(&p->rc, probs);
+ p->state = kShortRepNextStates[p->state];
+ }
+ }
+ else
+ {
+ RC_BIT_1(&p->rc, probs);
+ probs = &p->isRepG1[p->state];
+ RC_BIT_PRE(&p->rc, probs)
+ if (dist == 1)
+ {
+ RC_BIT_0_BASE(&p->rc, probs);
+ dist = p->reps[1];
+ }
+ else
+ {
+ RC_BIT_1(&p->rc, probs);
+ probs = &p->isRepG2[p->state];
+ RC_BIT_PRE(&p->rc, probs)
+ if (dist == 2)
+ {
+ RC_BIT_0_BASE(&p->rc, probs);
+ dist = p->reps[2];
+ }
+ else
+ {
+ RC_BIT_1_BASE(&p->rc, probs);
+ dist = p->reps[3];
+ p->reps[3] = p->reps[2];
+ }
+ p->reps[2] = p->reps[1];
+ }
+ p->reps[1] = p->reps[0];
+ p->reps[0] = dist;
+ }
+
+ RC_NORM(&p->rc)
+
+ p->rc.range = range;
+
+ if (len != 1)
+ {
+ LenEnc_Encode(&p->repLenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState);
+ if (!p->fastMode)
+ if (--p->repLenEnc.counters[posState] == 0)
+ LenPriceEnc_UpdateTable(&p->repLenEnc, posState, &p->repLenProbs, p->ProbPrices);
+
+ p->state = kRepNextStates[p->state];
+ }
+ }
+ else
+ {
+ unsigned posSlot;
+ RC_BIT_0(&p->rc, probs);
+ p->rc.range = range;
+ p->state = kMatchNextStates[p->state];
+
+ LenEnc_Encode(&p->lenProbs, &p->rc, len - LZMA_MATCH_LEN_MIN, posState);
+ if (!p->fastMode)
+ if (--p->lenEnc.counters[posState] == 0)
+ LenPriceEnc_UpdateTable(&p->lenEnc, posState, &p->lenProbs, p->ProbPrices);
+
+ dist -= LZMA_NUM_REPS;
+ p->reps[3] = p->reps[2];
+ p->reps[2] = p->reps[1];
+ p->reps[1] = p->reps[0];
+ p->reps[0] = dist + 1;
+
+ p->matchPriceCount++;
+ GetPosSlot(dist, posSlot);
+ // RcTree_Encode_PosSlot(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], posSlot);
+ {
+ UInt32 symbol = posSlot + (1 << kNumPosSlotBits);
+ range = p->rc.range;
+ probs = p->posSlotEncoder[GetLenToPosState(len)];
+ do
+ {
+ CLzmaProb *prob = probs + (symbol >> kNumPosSlotBits);
+ UInt32 bit = (symbol >> (kNumPosSlotBits - 1)) & 1;
+ symbol <<= 1;
+ RC_BIT(&p->rc, prob, bit);
+ }
+ while (symbol < (1 << kNumPosSlotBits * 2));
+ p->rc.range = range;
+ }
+
+ if (dist >= kStartPosModelIndex)
+ {
+ unsigned footerBits = ((posSlot >> 1) - 1);
+
+ if (dist < kNumFullDistances)
+ {
+ unsigned base = ((2 | (posSlot & 1)) << footerBits);
+ RcTree_ReverseEncode(&p->rc, p->posEncoders + base, footerBits, dist - base);
+ }
+ else
+ {
+ UInt32 pos2 = (dist | 0xF) << (32 - footerBits);
+ range = p->rc.range;
+ // RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits);
+ /*
+ do
+ {
+ range >>= 1;
+ p->rc.low += range & (0 - ((dist >> --footerBits) & 1));
+ RC_NORM(&p->rc)
+ }
+ while (footerBits > kNumAlignBits);
+ */
+ do
+ {
+ range >>= 1;
+ p->rc.low += range & (0 - (pos2 >> 31));
+ pos2 += pos2;
+ RC_NORM(&p->rc)
+ }
+ while (pos2 != 0xF0000000);
+
+
+ // RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask);
+
+ {
+ unsigned m = 1;
+ unsigned bit;
+ bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit;
+ bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit;
+ bit = dist & 1; dist >>= 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit); m = (m << 1) + bit;
+ bit = dist & 1; RC_BIT(&p->rc, p->posAlignEncoder + m, bit);
+ p->rc.range = range;
+ p->alignPriceCount++;
+ }
+ }
+ }
+ }
+ }
+
+ nowPos32 += len;
+ p->additionalOffset -= len;
+
+ if (p->additionalOffset == 0)
+ {
+ UInt32 processed;
+
+ if (!p->fastMode)
+ {
+ if (p->matchPriceCount >= (1 << 7))
+ FillDistancesPrices(p);
+ if (p->alignPriceCount >= kAlignTableSize)
+ FillAlignPrices(p);
+ }
+
+ if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0)
+ break;
+ processed = nowPos32 - startPos32;
+
+ if (maxPackSize)
+ {
+ if (processed + kNumOpts + 300 >= maxUnpackSize
+ || RangeEnc_GetProcessed_sizet(&p->rc) + kPackReserve >= maxPackSize)
+ break;
+ }
+ else if (processed >= (1 << 17))
+ {
+ p->nowPos64 += nowPos32 - startPos32;
+ return CheckErrors(p);
+ }
+ }
+ }
+
+ p->nowPos64 += nowPos32 - startPos32;
+ return Flush(p, nowPos32);
+}
+
+
+
+#define kBigHashDicLimit ((UInt32)1 << 24)
+
+static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ UInt32 beforeSize = kNumOpts;
+ if (!RangeEnc_Alloc(&p->rc, alloc))
+ return SZ_ERROR_MEM;
+
+ #ifndef _7ZIP_ST
+ p->mtMode = (p->multiThread && !p->fastMode && (p->matchFinderBase.btMode != 0));
+ #endif
+
+ {
+ unsigned lclp = p->lc + p->lp;
+ if (!p->litProbs || !p->saveState.litProbs || p->lclp != lclp)
+ {
+ LzmaEnc_FreeLits(p, alloc);
+ p->litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb));
+ p->saveState.litProbs = (CLzmaProb *)ISzAlloc_Alloc(alloc, ((UInt32)0x300 << lclp) * sizeof(CLzmaProb));
+ if (!p->litProbs || !p->saveState.litProbs)
+ {
+ LzmaEnc_FreeLits(p, alloc);
+ return SZ_ERROR_MEM;
+ }
+ p->lclp = lclp;
+ }
+ }
+
+ p->matchFinderBase.bigHash = (Byte)(p->dictSize > kBigHashDicLimit ? 1 : 0);
+
+ if (beforeSize + p->dictSize < keepWindowSize)
+ beforeSize = keepWindowSize - p->dictSize;
+
+ #ifndef _7ZIP_ST
+ if (p->mtMode)
+ {
+ RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes,
+ LZMA_MATCH_LEN_MAX
+ + 1 /* 18.04 */
+ , allocBig));
+ p->matchFinderObj = &p->matchFinderMt;
+ p->matchFinderBase.bigHash = (Byte)(
+ (p->dictSize > kBigHashDicLimit && p->matchFinderBase.hashMask >= 0xFFFFFF) ? 1 : 0);
+ MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder);
+ }
+ else
+ #endif
+ {
+ if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig))
+ return SZ_ERROR_MEM;
+ p->matchFinderObj = &p->matchFinderBase;
+ MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder);
+ }
+
+ return SZ_OK;
+}
+
+void LzmaEnc_Init(CLzmaEnc *p)
+{
+ unsigned i;
+ p->state = 0;
+ p->reps[0] =
+ p->reps[1] =
+ p->reps[2] =
+ p->reps[3] = 1;
+
+ RangeEnc_Init(&p->rc);
+
+ for (i = 0; i < (1 << kNumAlignBits); i++)
+ p->posAlignEncoder[i] = kProbInitValue;
+
+ for (i = 0; i < kNumStates; i++)
+ {
+ unsigned j;
+ for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++)
+ {
+ p->isMatch[i][j] = kProbInitValue;
+ p->isRep0Long[i][j] = kProbInitValue;
+ }
+ p->isRep[i] = kProbInitValue;
+ p->isRepG0[i] = kProbInitValue;
+ p->isRepG1[i] = kProbInitValue;
+ p->isRepG2[i] = kProbInitValue;
+ }
+
+ {
+ for (i = 0; i < kNumLenToPosStates; i++)
+ {
+ CLzmaProb *probs = p->posSlotEncoder[i];
+ unsigned j;
+ for (j = 0; j < (1 << kNumPosSlotBits); j++)
+ probs[j] = kProbInitValue;
+ }
+ }
+ {
+ for (i = 0; i < kNumFullDistances; i++)
+ p->posEncoders[i] = kProbInitValue;
+ }
+
+ {
+ UInt32 num = (UInt32)0x300 << (p->lp + p->lc);
+ UInt32 k;
+ CLzmaProb *probs = p->litProbs;
+ for (k = 0; k < num; k++)
+ probs[k] = kProbInitValue;
+ }
+
+
+ LenEnc_Init(&p->lenProbs);
+ LenEnc_Init(&p->repLenProbs);
+
+ p->optEnd = 0;
+ p->optCur = 0;
+ p->additionalOffset = 0;
+
+ p->pbMask = (1 << p->pb) - 1;
+ p->lpMask = ((UInt32)0x100 << p->lp) - ((unsigned)0x100 >> p->lc);
+}
+
+void LzmaEnc_InitPrices(CLzmaEnc *p)
+{
+ if (!p->fastMode)
+ {
+ FillDistancesPrices(p);
+ FillAlignPrices(p);
+ }
+
+ p->lenEnc.tableSize =
+ p->repLenEnc.tableSize =
+ p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN;
+ LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, &p->lenProbs, p->ProbPrices);
+ LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, &p->repLenProbs, p->ProbPrices);
+}
+
+static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ unsigned i;
+ for (i = kEndPosModelIndex / 2; i < kDicLogSizeMax; i++)
+ if (p->dictSize <= ((UInt32)1 << i))
+ break;
+ p->distTableSize = i * 2;
+
+ p->finished = False;
+ p->result = SZ_OK;
+ RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig));
+ LzmaEnc_Init(p);
+ LzmaEnc_InitPrices(p);
+ p->nowPos64 = 0;
+ return SZ_OK;
+}
+
+static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream,
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ p->matchFinderBase.stream = inStream;
+ p->needInit = 1;
+ p->rc.outStream = outStream;
+ return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig);
+}
+
+SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp,
+ ISeqInStream *inStream, UInt32 keepWindowSize,
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ p->matchFinderBase.stream = inStream;
+ p->needInit = 1;
+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
+}
+
+static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen)
+{
+ p->matchFinderBase.directInput = 1;
+ p->matchFinderBase.bufferBase = (Byte *)src;
+ p->matchFinderBase.directInputRem = srcLen;
+}
+
+SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen,
+ UInt32 keepWindowSize, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ LzmaEnc_SetInputBuf(p, src, srcLen);
+ p->needInit = 1;
+
+ LzmaEnc_SetDataSize(pp, srcLen);
+ return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig);
+}
+
+void LzmaEnc_Finish(CLzmaEncHandle pp)
+{
+ #ifndef _7ZIP_ST
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ if (p->mtMode)
+ MatchFinderMt_ReleaseStream(&p->matchFinderMt);
+ #else
+ UNUSED_VAR(pp);
+ #endif
+}
+
+
+typedef struct
+{
+ ISeqOutStream vt;
+ Byte *data;
+ SizeT rem;
+ Bool overflow;
+} CLzmaEnc_SeqOutStreamBuf;
+
+static size_t SeqOutStreamBuf_Write(const ISeqOutStream *pp, const void *data, size_t size)
+{
+ CLzmaEnc_SeqOutStreamBuf *p = CONTAINER_FROM_VTBL(pp, CLzmaEnc_SeqOutStreamBuf, vt);
+ if (p->rem < size)
+ {
+ size = p->rem;
+ p->overflow = True;
+ }
+ memcpy(p->data, data, size);
+ p->rem -= size;
+ p->data += size;
+ return size;
+}
+
+
+UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp)
+{
+ const CLzmaEnc *p = (CLzmaEnc *)pp;
+ return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj);
+}
+
+
+const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp)
+{
+ const CLzmaEnc *p = (CLzmaEnc *)pp;
+ return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset;
+}
+
+
+SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit,
+ Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ UInt64 nowPos64;
+ SRes res;
+ CLzmaEnc_SeqOutStreamBuf outStream;
+
+ outStream.vt.Write = SeqOutStreamBuf_Write;
+ outStream.data = dest;
+ outStream.rem = *destLen;
+ outStream.overflow = False;
+
+ p->writeEndMark = False;
+ p->finished = False;
+ p->result = SZ_OK;
+
+ if (reInit)
+ LzmaEnc_Init(p);
+ LzmaEnc_InitPrices(p);
+
+ nowPos64 = p->nowPos64;
+ RangeEnc_Init(&p->rc);
+ p->rc.outStream = &outStream.vt;
+
+ if (desiredPackSize == 0)
+ return SZ_ERROR_OUTPUT_EOF;
+
+ res = LzmaEnc_CodeOneBlock(p, desiredPackSize, *unpackSize);
+
+ *unpackSize = (UInt32)(p->nowPos64 - nowPos64);
+ *destLen -= outStream.rem;
+ if (outStream.overflow)
+ return SZ_ERROR_OUTPUT_EOF;
+
+ return res;
+}
+
+
+static SRes LzmaEnc_Encode2(CLzmaEnc *p, ICompressProgress *progress)
+{
+ SRes res = SZ_OK;
+
+ #ifndef _7ZIP_ST
+ Byte allocaDummy[0x300];
+ allocaDummy[0] = 0;
+ allocaDummy[1] = allocaDummy[0];
+ #endif
+
+ for (;;)
+ {
+ res = LzmaEnc_CodeOneBlock(p, 0, 0);
+ if (res != SZ_OK || p->finished)
+ break;
+ if (progress)
+ {
+ res = ICompressProgress_Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc));
+ if (res != SZ_OK)
+ {
+ res = SZ_ERROR_PROGRESS;
+ break;
+ }
+ }
+ }
+
+ LzmaEnc_Finish(p);
+
+ /*
+ if (res == SZ_OK && !Inline_MatchFinder_IsFinishedOK(&p->matchFinderBase))
+ res = SZ_ERROR_FAIL;
+ }
+ */
+
+ return res;
+}
+
+
+SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress,
+ ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ RINOK(LzmaEnc_Prepare(pp, outStream, inStream, alloc, allocBig));
+ return LzmaEnc_Encode2((CLzmaEnc *)pp, progress);
+}
+
+
+SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size)
+{
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+ unsigned i;
+ UInt32 dictSize = p->dictSize;
+ if (*size < LZMA_PROPS_SIZE)
+ return SZ_ERROR_PARAM;
+ *size = LZMA_PROPS_SIZE;
+ props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc);
+
+ if (dictSize >= ((UInt32)1 << 22))
+ {
+ UInt32 kDictMask = ((UInt32)1 << 20) - 1;
+ if (dictSize < (UInt32)0xFFFFFFFF - kDictMask)
+ dictSize = (dictSize + kDictMask) & ~kDictMask;
+ }
+ else for (i = 11; i <= 30; i++)
+ {
+ if (dictSize <= ((UInt32)2 << i)) { dictSize = (2 << i); break; }
+ if (dictSize <= ((UInt32)3 << i)) { dictSize = (3 << i); break; }
+ }
+
+ for (i = 0; i < 4; i++)
+ props[1 + i] = (Byte)(dictSize >> (8 * i));
+ return SZ_OK;
+}
+
+
+unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle pp)
+{
+ return ((CLzmaEnc *)pp)->writeEndMark;
+}
+
+
+SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ SRes res;
+ CLzmaEnc *p = (CLzmaEnc *)pp;
+
+ CLzmaEnc_SeqOutStreamBuf outStream;
+
+ outStream.vt.Write = SeqOutStreamBuf_Write;
+ outStream.data = dest;
+ outStream.rem = *destLen;
+ outStream.overflow = False;
+
+ p->writeEndMark = writeEndMark;
+ p->rc.outStream = &outStream.vt;
+
+ res = LzmaEnc_MemPrepare(pp, src, srcLen, 0, alloc, allocBig);
+
+ if (res == SZ_OK)
+ {
+ res = LzmaEnc_Encode2(p, progress);
+ if (res == SZ_OK && p->nowPos64 != srcLen)
+ res = SZ_ERROR_FAIL;
+ }
+
+ *destLen -= outStream.rem;
+ if (outStream.overflow)
+ return SZ_ERROR_OUTPUT_EOF;
+ return res;
+}
+
+
+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+ ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc);
+ SRes res;
+ if (!p)
+ return SZ_ERROR_MEM;
+
+ res = LzmaEnc_SetProps(p, props);
+ if (res == SZ_OK)
+ {
+ res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize);
+ if (res == SZ_OK)
+ res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen,
+ writeEndMark, progress, alloc, allocBig);
+ }
+
+ LzmaEnc_Destroy(p, alloc, allocBig);
+ return res;
+}
diff --git a/other-licenses/7zstub/src/C/LzmaEnc.h b/other-licenses/7zstub/src/C/LzmaEnc.h
new file mode 100644
index 0000000000..c9938f04bc
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzmaEnc.h
@@ -0,0 +1,76 @@
+/* LzmaEnc.h -- LZMA Encoder
+2017-07-27 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA_ENC_H
+#define __LZMA_ENC_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define LZMA_PROPS_SIZE 5
+
+typedef struct _CLzmaEncProps
+{
+ int level; /* 0 <= level <= 9 */
+ UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
+ (1 << 12) <= dictSize <= (3 << 29) for 64-bit version
+ default = (1 << 24) */
+ int lc; /* 0 <= lc <= 8, default = 3 */
+ int lp; /* 0 <= lp <= 4, default = 0 */
+ int pb; /* 0 <= pb <= 4, default = 2 */
+ int algo; /* 0 - fast, 1 - normal, default = 1 */
+ int fb; /* 5 <= fb <= 273, default = 32 */
+ int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
+ int numHashBytes; /* 2, 3 or 4, default = 4 */
+ UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
+ unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
+ int numThreads; /* 1 or 2, default = 2 */
+
+ UInt64 reduceSize; /* estimated size of data that will be compressed. default = (UInt64)(Int64)-1.
+ Encoder uses this value to reduce dictionary size */
+} CLzmaEncProps;
+
+void LzmaEncProps_Init(CLzmaEncProps *p);
+void LzmaEncProps_Normalize(CLzmaEncProps *p);
+UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
+
+
+/* ---------- CLzmaEncHandle Interface ---------- */
+
+/* LzmaEnc* functions can return the following exit codes:
+SRes:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater in props
+ SZ_ERROR_WRITE - ISeqOutStream write callback error
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow - version with (Byte *) output
+ SZ_ERROR_PROGRESS - some break from progress callback
+ SZ_ERROR_THREAD - error in multithreading functions (only for Mt version)
+*/
+
+typedef void * CLzmaEncHandle;
+
+CLzmaEncHandle LzmaEnc_Create(ISzAllocPtr alloc);
+void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAllocPtr alloc, ISzAllocPtr allocBig);
+
+SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
+void LzmaEnc_SetDataSize(CLzmaEncHandle p, UInt64 expectedDataSiize);
+SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
+unsigned LzmaEnc_IsWriteEndMark(CLzmaEncHandle p);
+
+SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
+ ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
+SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ int writeEndMark, ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
+
+
+/* ---------- One Call Interface ---------- */
+
+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+ ICompressProgress *progress, ISzAllocPtr alloc, ISzAllocPtr allocBig);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/LzmaLib.c b/other-licenses/7zstub/src/C/LzmaLib.c
new file mode 100644
index 0000000000..c10cf1a0f2
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzmaLib.c
@@ -0,0 +1,40 @@
+/* LzmaLib.c -- LZMA library wrapper
+2015-06-13 : Igor Pavlov : Public domain */
+
+#include "Alloc.h"
+#include "LzmaDec.h"
+#include "LzmaEnc.h"
+#include "LzmaLib.h"
+
+MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
+ unsigned char *outProps, size_t *outPropsSize,
+ int level, /* 0 <= level <= 9, default = 5 */
+ unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
+ int lc, /* 0 <= lc <= 8, default = 3 */
+ int lp, /* 0 <= lp <= 4, default = 0 */
+ int pb, /* 0 <= pb <= 4, default = 2 */
+ int fb, /* 5 <= fb <= 273, default = 32 */
+ int numThreads /* 1 or 2, default = 2 */
+)
+{
+ CLzmaEncProps props;
+ LzmaEncProps_Init(&props);
+ props.level = level;
+ props.dictSize = dictSize;
+ props.lc = lc;
+ props.lp = lp;
+ props.pb = pb;
+ props.fb = fb;
+ props.numThreads = numThreads;
+
+ return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
+ NULL, &g_Alloc, &g_Alloc);
+}
+
+
+MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
+ const unsigned char *props, size_t propsSize)
+{
+ ELzmaStatus status;
+ return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
+}
diff --git a/other-licenses/7zstub/src/C/LzmaLib.h b/other-licenses/7zstub/src/C/LzmaLib.h
new file mode 100644
index 0000000000..5c35e53654
--- /dev/null
+++ b/other-licenses/7zstub/src/C/LzmaLib.h
@@ -0,0 +1,131 @@
+/* LzmaLib.h -- LZMA library interface
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __LZMA_LIB_H
+#define __LZMA_LIB_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define MY_STDAPI int MY_STD_CALL
+
+#define LZMA_PROPS_SIZE 5
+
+/*
+RAM requirements for LZMA:
+ for compression: (dictSize * 11.5 + 6 MB) + state_size
+ for decompression: dictSize + state_size
+ state_size = (4 + (1.5 << (lc + lp))) KB
+ by default (lc=3, lp=0), state_size = 16 KB.
+
+LZMA properties (5 bytes) format
+ Offset Size Description
+ 0 1 lc, lp and pb in encoded form.
+ 1 4 dictSize (little endian).
+*/
+
+/*
+LzmaCompress
+------------
+
+outPropsSize -
+ In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
+ Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
+
+ LZMA Encoder will use defult values for any parameter, if it is
+ -1 for any from: level, loc, lp, pb, fb, numThreads
+ 0 for dictSize
+
+level - compression level: 0 <= level <= 9;
+
+ level dictSize algo fb
+ 0: 16 KB 0 32
+ 1: 64 KB 0 32
+ 2: 256 KB 0 32
+ 3: 1 MB 0 32
+ 4: 4 MB 0 32
+ 5: 16 MB 1 32
+ 6: 32 MB 1 32
+ 7+: 64 MB 1 64
+
+ The default value for "level" is 5.
+
+ algo = 0 means fast method
+ algo = 1 means normal method
+
+dictSize - The dictionary size in bytes. The maximum value is
+ 128 MB = (1 << 27) bytes for 32-bit version
+ 1 GB = (1 << 30) bytes for 64-bit version
+ The default value is 16 MB = (1 << 24) bytes.
+ It's recommended to use the dictionary that is larger than 4 KB and
+ that can be calculated as (1 << N) or (3 << N) sizes.
+
+lc - The number of literal context bits (high bits of previous literal).
+ It can be in the range from 0 to 8. The default value is 3.
+ Sometimes lc=4 gives the gain for big files.
+
+lp - The number of literal pos bits (low bits of current position for literals).
+ It can be in the range from 0 to 4. The default value is 0.
+ The lp switch is intended for periodical data when the period is equal to 2^lp.
+ For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
+ better to set lc=0, if you change lp switch.
+
+pb - The number of pos bits (low bits of current position).
+ It can be in the range from 0 to 4. The default value is 2.
+ The pb switch is intended for periodical data when the period is equal 2^pb.
+
+fb - Word size (the number of fast bytes).
+ It can be in the range from 5 to 273. The default value is 32.
+ Usually, a big number gives a little bit better compression ratio and
+ slower compression process.
+
+numThreads - The number of thereads. 1 or 2. The default value is 2.
+ Fast mode (algo = 0) can use only 1 thread.
+
+Out:
+ destLen - processed output size
+Returns:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
+*/
+
+MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
+ unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
+ int level, /* 0 <= level <= 9, default = 5 */
+ unsigned dictSize, /* default = (1 << 24) */
+ int lc, /* 0 <= lc <= 8, default = 3 */
+ int lp, /* 0 <= lp <= 4, default = 0 */
+ int pb, /* 0 <= pb <= 4, default = 2 */
+ int fb, /* 5 <= fb <= 273, default = 32 */
+ int numThreads /* 1 or 2, default = 2 */
+ );
+
+/*
+LzmaUncompress
+--------------
+In:
+ dest - output data
+ destLen - output data size
+ src - input data
+ srcLen - input data size
+Out:
+ destLen - processed output size
+ srcLen - processed input size
+Returns:
+ SZ_OK - OK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation arror
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
+*/
+
+MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
+ const unsigned char *props, size_t propsSize);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/MtCoder.c b/other-licenses/7zstub/src/C/MtCoder.c
new file mode 100644
index 0000000000..ddc7c02858
--- /dev/null
+++ b/other-licenses/7zstub/src/C/MtCoder.c
@@ -0,0 +1,601 @@
+/* MtCoder.c -- Multi-thread Coder
+2018-02-21 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "MtCoder.h"
+
+#ifndef _7ZIP_ST
+
+SRes MtProgressThunk_Progress(const ICompressProgress *pp, UInt64 inSize, UInt64 outSize)
+{
+ CMtProgressThunk *thunk = CONTAINER_FROM_VTBL(pp, CMtProgressThunk, vt);
+ UInt64 inSize2 = 0;
+ UInt64 outSize2 = 0;
+ if (inSize != (UInt64)(Int64)-1)
+ {
+ inSize2 = inSize - thunk->inSize;
+ thunk->inSize = inSize;
+ }
+ if (outSize != (UInt64)(Int64)-1)
+ {
+ outSize2 = outSize - thunk->outSize;
+ thunk->outSize = outSize;
+ }
+ return MtProgress_ProgressAdd(thunk->mtProgress, inSize2, outSize2);
+}
+
+
+void MtProgressThunk_CreateVTable(CMtProgressThunk *p)
+{
+ p->vt.Progress = MtProgressThunk_Progress;
+}
+
+
+
+#define RINOK_THREAD(x) { if ((x) != 0) return SZ_ERROR_THREAD; }
+
+
+static WRes ArEvent_OptCreate_And_Reset(CEvent *p)
+{
+ if (Event_IsCreated(p))
+ return Event_Reset(p);
+ return AutoResetEvent_CreateNotSignaled(p);
+}
+
+
+static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp);
+
+
+static SRes MtCoderThread_CreateAndStart(CMtCoderThread *t)
+{
+ WRes wres = ArEvent_OptCreate_And_Reset(&t->startEvent);
+ if (wres == 0)
+ {
+ t->stop = False;
+ if (!Thread_WasCreated(&t->thread))
+ wres = Thread_Create(&t->thread, ThreadFunc, t);
+ if (wres == 0)
+ wres = Event_Set(&t->startEvent);
+ }
+ if (wres == 0)
+ return SZ_OK;
+ return MY_SRes_HRESULT_FROM_WRes(wres);
+}
+
+
+static void MtCoderThread_Destruct(CMtCoderThread *t)
+{
+ if (Thread_WasCreated(&t->thread))
+ {
+ t->stop = 1;
+ Event_Set(&t->startEvent);
+ Thread_Wait(&t->thread);
+ Thread_Close(&t->thread);
+ }
+
+ Event_Close(&t->startEvent);
+
+ if (t->inBuf)
+ {
+ ISzAlloc_Free(t->mtCoder->allocBig, t->inBuf);
+ t->inBuf = NULL;
+ }
+}
+
+
+
+static SRes FullRead(ISeqInStream *stream, Byte *data, size_t *processedSize)
+{
+ size_t size = *processedSize;
+ *processedSize = 0;
+ while (size != 0)
+ {
+ size_t cur = size;
+ SRes res = ISeqInStream_Read(stream, data, &cur);
+ *processedSize += cur;
+ data += cur;
+ size -= cur;
+ RINOK(res);
+ if (cur == 0)
+ return SZ_OK;
+ }
+ return SZ_OK;
+}
+
+
+/*
+ ThreadFunc2() returns:
+ SZ_OK - in all normal cases (even for stream error or memory allocation error)
+ SZ_ERROR_THREAD - in case of failure in system synch function
+*/
+
+static SRes ThreadFunc2(CMtCoderThread *t)
+{
+ CMtCoder *mtc = t->mtCoder;
+
+ for (;;)
+ {
+ unsigned bi;
+ SRes res;
+ SRes res2;
+ Bool finished;
+ unsigned bufIndex;
+ size_t size;
+ const Byte *inData;
+ UInt64 readProcessed = 0;
+
+ RINOK_THREAD(Event_Wait(&mtc->readEvent))
+
+ /* after Event_Wait(&mtc->readEvent) we must call Event_Set(&mtc->readEvent) in any case to unlock another threads */
+
+ if (mtc->stopReading)
+ {
+ return Event_Set(&mtc->readEvent) == 0 ? SZ_OK : SZ_ERROR_THREAD;
+ }
+
+ res = MtProgress_GetError(&mtc->mtProgress);
+
+ size = 0;
+ inData = NULL;
+ finished = True;
+
+ if (res == SZ_OK)
+ {
+ size = mtc->blockSize;
+ if (mtc->inStream)
+ {
+ if (!t->inBuf)
+ {
+ t->inBuf = (Byte *)ISzAlloc_Alloc(mtc->allocBig, mtc->blockSize);
+ if (!t->inBuf)
+ res = SZ_ERROR_MEM;
+ }
+ if (res == SZ_OK)
+ {
+ res = FullRead(mtc->inStream, t->inBuf, &size);
+ readProcessed = mtc->readProcessed + size;
+ mtc->readProcessed = readProcessed;
+ }
+ if (res != SZ_OK)
+ {
+ mtc->readRes = res;
+ /* after reading error - we can stop encoding of previous blocks */
+ MtProgress_SetError(&mtc->mtProgress, res);
+ }
+ else
+ finished = (size != mtc->blockSize);
+ }
+ else
+ {
+ size_t rem;
+ readProcessed = mtc->readProcessed;
+ rem = mtc->inDataSize - (size_t)readProcessed;
+ if (size > rem)
+ size = rem;
+ inData = mtc->inData + (size_t)readProcessed;
+ readProcessed += size;
+ mtc->readProcessed = readProcessed;
+ finished = (mtc->inDataSize == (size_t)readProcessed);
+ }
+ }
+
+ /* we must get some block from blocksSemaphore before Event_Set(&mtc->readEvent) */
+
+ res2 = SZ_OK;
+
+ if (Semaphore_Wait(&mtc->blocksSemaphore) != 0)
+ {
+ res2 = SZ_ERROR_THREAD;
+ if (res == SZ_OK)
+ {
+ res = res2;
+ // MtProgress_SetError(&mtc->mtProgress, res);
+ }
+ }
+
+ bi = mtc->blockIndex;
+
+ if (++mtc->blockIndex >= mtc->numBlocksMax)
+ mtc->blockIndex = 0;
+
+ bufIndex = (unsigned)(int)-1;
+
+ if (res == SZ_OK)
+ res = MtProgress_GetError(&mtc->mtProgress);
+
+ if (res != SZ_OK)
+ finished = True;
+
+ if (!finished)
+ {
+ if (mtc->numStartedThreads < mtc->numStartedThreadsLimit
+ && mtc->expectedDataSize != readProcessed)
+ {
+ res = MtCoderThread_CreateAndStart(&mtc->threads[mtc->numStartedThreads]);
+ if (res == SZ_OK)
+ mtc->numStartedThreads++;
+ else
+ {
+ MtProgress_SetError(&mtc->mtProgress, res);
+ finished = True;
+ }
+ }
+ }
+
+ if (finished)
+ mtc->stopReading = True;
+
+ RINOK_THREAD(Event_Set(&mtc->readEvent))
+
+ if (res2 != SZ_OK)
+ return res2;
+
+ if (res == SZ_OK)
+ {
+ CriticalSection_Enter(&mtc->cs);
+ bufIndex = mtc->freeBlockHead;
+ mtc->freeBlockHead = mtc->freeBlockList[bufIndex];
+ CriticalSection_Leave(&mtc->cs);
+
+ res = mtc->mtCallback->Code(mtc->mtCallbackObject, t->index, bufIndex,
+ mtc->inStream ? t->inBuf : inData, size, finished);
+
+ // MtProgress_Reinit(&mtc->mtProgress, t->index);
+
+ if (res != SZ_OK)
+ MtProgress_SetError(&mtc->mtProgress, res);
+ }
+
+ {
+ CMtCoderBlock *block = &mtc->blocks[bi];
+ block->res = res;
+ block->bufIndex = bufIndex;
+ block->finished = finished;
+ }
+
+ #ifdef MTCODER__USE_WRITE_THREAD
+ RINOK_THREAD(Event_Set(&mtc->writeEvents[bi]))
+ #else
+ {
+ unsigned wi;
+ {
+ CriticalSection_Enter(&mtc->cs);
+ wi = mtc->writeIndex;
+ if (wi == bi)
+ mtc->writeIndex = (unsigned)(int)-1;
+ else
+ mtc->ReadyBlocks[bi] = True;
+ CriticalSection_Leave(&mtc->cs);
+ }
+
+ if (wi != bi)
+ {
+ if (res != SZ_OK || finished)
+ return 0;
+ continue;
+ }
+
+ if (mtc->writeRes != SZ_OK)
+ res = mtc->writeRes;
+
+ for (;;)
+ {
+ if (res == SZ_OK && bufIndex != (unsigned)(int)-1)
+ {
+ res = mtc->mtCallback->Write(mtc->mtCallbackObject, bufIndex);
+ if (res != SZ_OK)
+ {
+ mtc->writeRes = res;
+ MtProgress_SetError(&mtc->mtProgress, res);
+ }
+ }
+
+ if (++wi >= mtc->numBlocksMax)
+ wi = 0;
+ {
+ Bool isReady;
+
+ CriticalSection_Enter(&mtc->cs);
+
+ if (bufIndex != (unsigned)(int)-1)
+ {
+ mtc->freeBlockList[bufIndex] = mtc->freeBlockHead;
+ mtc->freeBlockHead = bufIndex;
+ }
+
+ isReady = mtc->ReadyBlocks[wi];
+
+ if (isReady)
+ mtc->ReadyBlocks[wi] = False;
+ else
+ mtc->writeIndex = wi;
+
+ CriticalSection_Leave(&mtc->cs);
+
+ RINOK_THREAD(Semaphore_Release1(&mtc->blocksSemaphore))
+
+ if (!isReady)
+ break;
+ }
+
+ {
+ CMtCoderBlock *block = &mtc->blocks[wi];
+ if (res == SZ_OK && block->res != SZ_OK)
+ res = block->res;
+ bufIndex = block->bufIndex;
+ finished = block->finished;
+ }
+ }
+ }
+ #endif
+
+ if (finished || res != SZ_OK)
+ return 0;
+ }
+}
+
+
+static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp)
+{
+ CMtCoderThread *t = (CMtCoderThread *)pp;
+ for (;;)
+ {
+ if (Event_Wait(&t->startEvent) != 0)
+ return SZ_ERROR_THREAD;
+ if (t->stop)
+ return 0;
+ {
+ SRes res = ThreadFunc2(t);
+ CMtCoder *mtc = t->mtCoder;
+ if (res != SZ_OK)
+ {
+ MtProgress_SetError(&mtc->mtProgress, res);
+ }
+
+ #ifndef MTCODER__USE_WRITE_THREAD
+ {
+ unsigned numFinished = (unsigned)InterlockedIncrement(&mtc->numFinishedThreads);
+ if (numFinished == mtc->numStartedThreads)
+ if (Event_Set(&mtc->finishedEvent) != 0)
+ return SZ_ERROR_THREAD;
+ }
+ #endif
+ }
+ }
+}
+
+
+
+void MtCoder_Construct(CMtCoder *p)
+{
+ unsigned i;
+
+ p->blockSize = 0;
+ p->numThreadsMax = 0;
+ p->expectedDataSize = (UInt64)(Int64)-1;
+
+ p->inStream = NULL;
+ p->inData = NULL;
+ p->inDataSize = 0;
+
+ p->progress = NULL;
+ p->allocBig = NULL;
+
+ p->mtCallback = NULL;
+ p->mtCallbackObject = NULL;
+
+ p->allocatedBufsSize = 0;
+
+ Event_Construct(&p->readEvent);
+ Semaphore_Construct(&p->blocksSemaphore);
+
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ {
+ CMtCoderThread *t = &p->threads[i];
+ t->mtCoder = p;
+ t->index = i;
+ t->inBuf = NULL;
+ t->stop = False;
+ Event_Construct(&t->startEvent);
+ Thread_Construct(&t->thread);
+ }
+
+ #ifdef MTCODER__USE_WRITE_THREAD
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ Event_Construct(&p->writeEvents[i]);
+ #else
+ Event_Construct(&p->finishedEvent);
+ #endif
+
+ CriticalSection_Init(&p->cs);
+ CriticalSection_Init(&p->mtProgress.cs);
+}
+
+
+
+
+static void MtCoder_Free(CMtCoder *p)
+{
+ unsigned i;
+
+ /*
+ p->stopReading = True;
+ if (Event_IsCreated(&p->readEvent))
+ Event_Set(&p->readEvent);
+ */
+
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ MtCoderThread_Destruct(&p->threads[i]);
+
+ Event_Close(&p->readEvent);
+ Semaphore_Close(&p->blocksSemaphore);
+
+ #ifdef MTCODER__USE_WRITE_THREAD
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ Event_Close(&p->writeEvents[i]);
+ #else
+ Event_Close(&p->finishedEvent);
+ #endif
+}
+
+
+void MtCoder_Destruct(CMtCoder *p)
+{
+ MtCoder_Free(p);
+
+ CriticalSection_Delete(&p->cs);
+ CriticalSection_Delete(&p->mtProgress.cs);
+}
+
+
+SRes MtCoder_Code(CMtCoder *p)
+{
+ unsigned numThreads = p->numThreadsMax;
+ unsigned numBlocksMax;
+ unsigned i;
+ SRes res = SZ_OK;
+
+ if (numThreads > MTCODER__THREADS_MAX)
+ numThreads = MTCODER__THREADS_MAX;
+ numBlocksMax = MTCODER__GET_NUM_BLOCKS_FROM_THREADS(numThreads);
+
+ if (p->blockSize < ((UInt32)1 << 26)) numBlocksMax++;
+ if (p->blockSize < ((UInt32)1 << 24)) numBlocksMax++;
+ if (p->blockSize < ((UInt32)1 << 22)) numBlocksMax++;
+
+ if (numBlocksMax > MTCODER__BLOCKS_MAX)
+ numBlocksMax = MTCODER__BLOCKS_MAX;
+
+ if (p->blockSize != p->allocatedBufsSize)
+ {
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ {
+ CMtCoderThread *t = &p->threads[i];
+ if (t->inBuf)
+ {
+ ISzAlloc_Free(p->allocBig, t->inBuf);
+ t->inBuf = NULL;
+ }
+ }
+ p->allocatedBufsSize = p->blockSize;
+ }
+
+ p->readRes = SZ_OK;
+
+ MtProgress_Init(&p->mtProgress, p->progress);
+
+ #ifdef MTCODER__USE_WRITE_THREAD
+ for (i = 0; i < numBlocksMax; i++)
+ {
+ RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->writeEvents[i]));
+ }
+ #else
+ RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->finishedEvent));
+ #endif
+
+ {
+ RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->readEvent));
+
+ if (Semaphore_IsCreated(&p->blocksSemaphore))
+ {
+ RINOK_THREAD(Semaphore_Close(&p->blocksSemaphore));
+ }
+ RINOK_THREAD(Semaphore_Create(&p->blocksSemaphore, numBlocksMax, numBlocksMax));
+ }
+
+ for (i = 0; i < MTCODER__BLOCKS_MAX - 1; i++)
+ p->freeBlockList[i] = i + 1;
+ p->freeBlockList[MTCODER__BLOCKS_MAX - 1] = (unsigned)(int)-1;
+ p->freeBlockHead = 0;
+
+ p->readProcessed = 0;
+ p->blockIndex = 0;
+ p->numBlocksMax = numBlocksMax;
+ p->stopReading = False;
+
+ #ifndef MTCODER__USE_WRITE_THREAD
+ p->writeIndex = 0;
+ p->writeRes = SZ_OK;
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ p->ReadyBlocks[i] = False;
+ p->numFinishedThreads = 0;
+ #endif
+
+ p->numStartedThreadsLimit = numThreads;
+ p->numStartedThreads = 0;
+
+ // for (i = 0; i < numThreads; i++)
+ {
+ CMtCoderThread *nextThread = &p->threads[p->numStartedThreads++];
+ RINOK(MtCoderThread_CreateAndStart(nextThread));
+ }
+
+ RINOK_THREAD(Event_Set(&p->readEvent))
+
+ #ifdef MTCODER__USE_WRITE_THREAD
+ {
+ unsigned bi = 0;
+
+ for (;; bi++)
+ {
+ if (bi >= numBlocksMax)
+ bi = 0;
+
+ RINOK_THREAD(Event_Wait(&p->writeEvents[bi]))
+
+ {
+ const CMtCoderBlock *block = &p->blocks[bi];
+ unsigned bufIndex = block->bufIndex;
+ Bool finished = block->finished;
+ if (res == SZ_OK && block->res != SZ_OK)
+ res = block->res;
+
+ if (bufIndex != (unsigned)(int)-1)
+ {
+ if (res == SZ_OK)
+ {
+ res = p->mtCallback->Write(p->mtCallbackObject, bufIndex);
+ if (res != SZ_OK)
+ MtProgress_SetError(&p->mtProgress, res);
+ }
+
+ CriticalSection_Enter(&p->cs);
+ {
+ p->freeBlockList[bufIndex] = p->freeBlockHead;
+ p->freeBlockHead = bufIndex;
+ }
+ CriticalSection_Leave(&p->cs);
+ }
+
+ RINOK_THREAD(Semaphore_Release1(&p->blocksSemaphore))
+
+ if (finished)
+ break;
+ }
+ }
+ }
+ #else
+ {
+ WRes wres = Event_Wait(&p->finishedEvent);
+ res = MY_SRes_HRESULT_FROM_WRes(wres);
+ }
+ #endif
+
+ if (res == SZ_OK)
+ res = p->readRes;
+
+ if (res == SZ_OK)
+ res = p->mtProgress.res;
+
+ #ifndef MTCODER__USE_WRITE_THREAD
+ if (res == SZ_OK)
+ res = p->writeRes;
+ #endif
+
+ if (res != SZ_OK)
+ MtCoder_Free(p);
+ return res;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/MtCoder.h b/other-licenses/7zstub/src/C/MtCoder.h
new file mode 100644
index 0000000000..7982e847cf
--- /dev/null
+++ b/other-licenses/7zstub/src/C/MtCoder.h
@@ -0,0 +1,141 @@
+/* MtCoder.h -- Multi-thread Coder
+2018-02-21 : Igor Pavlov : Public domain */
+
+#ifndef __MT_CODER_H
+#define __MT_CODER_H
+
+#include "MtDec.h"
+
+EXTERN_C_BEGIN
+
+/*
+ if ( defined MTCODER__USE_WRITE_THREAD) : main thread writes all data blocks to output stream
+ if (not defined MTCODER__USE_WRITE_THREAD) : any coder thread can write data blocks to output stream
+*/
+/* #define MTCODER__USE_WRITE_THREAD */
+
+#ifndef _7ZIP_ST
+ #define MTCODER__GET_NUM_BLOCKS_FROM_THREADS(numThreads) ((numThreads) + (numThreads) / 8 + 1)
+ #define MTCODER__THREADS_MAX 64
+ #define MTCODER__BLOCKS_MAX (MTCODER__GET_NUM_BLOCKS_FROM_THREADS(MTCODER__THREADS_MAX) + 3)
+#else
+ #define MTCODER__THREADS_MAX 1
+ #define MTCODER__BLOCKS_MAX 1
+#endif
+
+
+#ifndef _7ZIP_ST
+
+
+typedef struct
+{
+ ICompressProgress vt;
+ CMtProgress *mtProgress;
+ UInt64 inSize;
+ UInt64 outSize;
+} CMtProgressThunk;
+
+void MtProgressThunk_CreateVTable(CMtProgressThunk *p);
+
+#define MtProgressThunk_Init(p) { (p)->inSize = 0; (p)->outSize = 0; }
+
+
+struct _CMtCoder;
+
+
+typedef struct
+{
+ struct _CMtCoder *mtCoder;
+ unsigned index;
+ int stop;
+ Byte *inBuf;
+
+ CAutoResetEvent startEvent;
+ CThread thread;
+} CMtCoderThread;
+
+
+typedef struct
+{
+ SRes (*Code)(void *p, unsigned coderIndex, unsigned outBufIndex,
+ const Byte *src, size_t srcSize, int finished);
+ SRes (*Write)(void *p, unsigned outBufIndex);
+} IMtCoderCallback2;
+
+
+typedef struct
+{
+ SRes res;
+ unsigned bufIndex;
+ Bool finished;
+} CMtCoderBlock;
+
+
+typedef struct _CMtCoder
+{
+ /* input variables */
+
+ size_t blockSize; /* size of input block */
+ unsigned numThreadsMax;
+ UInt64 expectedDataSize;
+
+ ISeqInStream *inStream;
+ const Byte *inData;
+ size_t inDataSize;
+
+ ICompressProgress *progress;
+ ISzAllocPtr allocBig;
+
+ IMtCoderCallback2 *mtCallback;
+ void *mtCallbackObject;
+
+
+ /* internal variables */
+
+ size_t allocatedBufsSize;
+
+ CAutoResetEvent readEvent;
+ CSemaphore blocksSemaphore;
+
+ Bool stopReading;
+ SRes readRes;
+
+ #ifdef MTCODER__USE_WRITE_THREAD
+ CAutoResetEvent writeEvents[MTCODER__BLOCKS_MAX];
+ #else
+ CAutoResetEvent finishedEvent;
+ SRes writeRes;
+ unsigned writeIndex;
+ Byte ReadyBlocks[MTCODER__BLOCKS_MAX];
+ LONG numFinishedThreads;
+ #endif
+
+ unsigned numStartedThreadsLimit;
+ unsigned numStartedThreads;
+
+ unsigned numBlocksMax;
+ unsigned blockIndex;
+ UInt64 readProcessed;
+
+ CCriticalSection cs;
+
+ unsigned freeBlockHead;
+ unsigned freeBlockList[MTCODER__BLOCKS_MAX];
+
+ CMtProgress mtProgress;
+ CMtCoderBlock blocks[MTCODER__BLOCKS_MAX];
+ CMtCoderThread threads[MTCODER__THREADS_MAX];
+} CMtCoder;
+
+
+void MtCoder_Construct(CMtCoder *p);
+void MtCoder_Destruct(CMtCoder *p);
+SRes MtCoder_Code(CMtCoder *p);
+
+
+#endif
+
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/MtDec.c b/other-licenses/7zstub/src/C/MtDec.c
new file mode 100644
index 0000000000..60d31b07ce
--- /dev/null
+++ b/other-licenses/7zstub/src/C/MtDec.c
@@ -0,0 +1,1137 @@
+/* MtDec.c -- Multi-thread Decoder
+2018-03-02 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+// #define SHOW_DEBUG_INFO
+
+// #include <stdio.h>
+
+#ifdef SHOW_DEBUG_INFO
+#include <stdio.h>
+#endif
+
+#ifdef SHOW_DEBUG_INFO
+#define PRF(x) x
+#else
+#define PRF(x)
+#endif
+
+#define PRF_STR_INT(s, d) PRF(printf("\n" s " %d\n", (unsigned)d))
+
+#include "MtDec.h"
+
+#ifndef _7ZIP_ST
+
+void MtProgress_Init(CMtProgress *p, ICompressProgress *progress)
+{
+ p->progress = progress;
+ p->res = SZ_OK;
+ p->totalInSize = 0;
+ p->totalOutSize = 0;
+}
+
+
+SRes MtProgress_Progress_ST(CMtProgress *p)
+{
+ if (p->res == SZ_OK && p->progress)
+ if (ICompressProgress_Progress(p->progress, p->totalInSize, p->totalOutSize) != SZ_OK)
+ p->res = SZ_ERROR_PROGRESS;
+ return p->res;
+}
+
+
+SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize)
+{
+ SRes res;
+ CriticalSection_Enter(&p->cs);
+
+ p->totalInSize += inSize;
+ p->totalOutSize += outSize;
+ if (p->res == SZ_OK && p->progress)
+ if (ICompressProgress_Progress(p->progress, p->totalInSize, p->totalOutSize) != SZ_OK)
+ p->res = SZ_ERROR_PROGRESS;
+ res = p->res;
+
+ CriticalSection_Leave(&p->cs);
+ return res;
+}
+
+
+SRes MtProgress_GetError(CMtProgress *p)
+{
+ SRes res;
+ CriticalSection_Enter(&p->cs);
+ res = p->res;
+ CriticalSection_Leave(&p->cs);
+ return res;
+}
+
+
+void MtProgress_SetError(CMtProgress *p, SRes res)
+{
+ CriticalSection_Enter(&p->cs);
+ if (p->res == SZ_OK)
+ p->res = res;
+ CriticalSection_Leave(&p->cs);
+}
+
+
+#define RINOK_THREAD(x) RINOK(x)
+
+
+static WRes ArEvent_OptCreate_And_Reset(CEvent *p)
+{
+ if (Event_IsCreated(p))
+ return Event_Reset(p);
+ return AutoResetEvent_CreateNotSignaled(p);
+}
+
+
+
+typedef struct
+{
+ void *next;
+ void *pad[3];
+} CMtDecBufLink;
+
+#define MTDEC__LINK_DATA_OFFSET sizeof(CMtDecBufLink)
+#define MTDEC__DATA_PTR_FROM_LINK(link) ((Byte *)(link) + MTDEC__LINK_DATA_OFFSET)
+
+
+
+static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp);
+
+
+static WRes MtDecThread_CreateEvents(CMtDecThread *t)
+{
+ WRes wres = ArEvent_OptCreate_And_Reset(&t->canWrite);
+ if (wres == 0)
+ {
+ wres = ArEvent_OptCreate_And_Reset(&t->canRead);
+ if (wres == 0)
+ return SZ_OK;
+ }
+ return wres;
+}
+
+
+static SRes MtDecThread_CreateAndStart(CMtDecThread *t)
+{
+ WRes wres = MtDecThread_CreateEvents(t);
+ // wres = 17; // for test
+ if (wres == 0)
+ {
+ if (Thread_WasCreated(&t->thread))
+ return SZ_OK;
+ wres = Thread_Create(&t->thread, ThreadFunc, t);
+ if (wres == 0)
+ return SZ_OK;
+ }
+ return MY_SRes_HRESULT_FROM_WRes(wres);
+}
+
+
+void MtDecThread_FreeInBufs(CMtDecThread *t)
+{
+ if (t->inBuf)
+ {
+ void *link = t->inBuf;
+ t->inBuf = NULL;
+ do
+ {
+ void *next = ((CMtDecBufLink *)link)->next;
+ ISzAlloc_Free(t->mtDec->alloc, link);
+ link = next;
+ }
+ while (link);
+ }
+}
+
+
+static void MtDecThread_CloseThread(CMtDecThread *t)
+{
+ if (Thread_WasCreated(&t->thread))
+ {
+ Event_Set(&t->canWrite); /* we can disable it. There are no threads waiting canWrite in normal cases */
+ Event_Set(&t->canRead);
+ Thread_Wait(&t->thread);
+ Thread_Close(&t->thread);
+ }
+
+ Event_Close(&t->canRead);
+ Event_Close(&t->canWrite);
+}
+
+static void MtDec_CloseThreads(CMtDec *p)
+{
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ MtDecThread_CloseThread(&p->threads[i]);
+}
+
+static void MtDecThread_Destruct(CMtDecThread *t)
+{
+ MtDecThread_CloseThread(t);
+ MtDecThread_FreeInBufs(t);
+}
+
+
+
+static SRes FullRead(ISeqInStream *stream, Byte *data, size_t *processedSize)
+{
+ size_t size = *processedSize;
+ *processedSize = 0;
+ while (size != 0)
+ {
+ size_t cur = size;
+ SRes res = ISeqInStream_Read(stream, data, &cur);
+ *processedSize += cur;
+ data += cur;
+ size -= cur;
+ RINOK(res);
+ if (cur == 0)
+ return SZ_OK;
+ }
+ return SZ_OK;
+}
+
+
+static SRes MtDec_GetError_Spec(CMtDec *p, UInt64 interruptIndex, Bool *wasInterrupted)
+{
+ SRes res;
+ CriticalSection_Enter(&p->mtProgress.cs);
+ *wasInterrupted = (p->needInterrupt && interruptIndex > p->interruptIndex);
+ res = p->mtProgress.res;
+ CriticalSection_Leave(&p->mtProgress.cs);
+ return res;
+}
+
+static SRes MtDec_Progress_GetError_Spec(CMtDec *p, UInt64 inSize, UInt64 outSize, UInt64 interruptIndex, Bool *wasInterrupted)
+{
+ SRes res;
+ CriticalSection_Enter(&p->mtProgress.cs);
+
+ p->mtProgress.totalInSize += inSize;
+ p->mtProgress.totalOutSize += outSize;
+ if (p->mtProgress.res == SZ_OK && p->mtProgress.progress)
+ if (ICompressProgress_Progress(p->mtProgress.progress, p->mtProgress.totalInSize, p->mtProgress.totalOutSize) != SZ_OK)
+ p->mtProgress.res = SZ_ERROR_PROGRESS;
+
+ *wasInterrupted = (p->needInterrupt && interruptIndex > p->interruptIndex);
+ res = p->mtProgress.res;
+
+ CriticalSection_Leave(&p->mtProgress.cs);
+
+ return res;
+}
+
+static void MtDec_Interrupt(CMtDec *p, UInt64 interruptIndex)
+{
+ CriticalSection_Enter(&p->mtProgress.cs);
+ if (!p->needInterrupt || interruptIndex < p->interruptIndex)
+ {
+ p->interruptIndex = interruptIndex;
+ p->needInterrupt = True;
+ }
+ CriticalSection_Leave(&p->mtProgress.cs);
+}
+
+Byte *MtDec_GetCrossBuff(CMtDec *p)
+{
+ Byte *cr = p->crossBlock;
+ if (!cr)
+ {
+ cr = (Byte *)ISzAlloc_Alloc(p->alloc, MTDEC__LINK_DATA_OFFSET + p->inBufSize);
+ if (!cr)
+ return NULL;
+ p->crossBlock = cr;
+ }
+ return MTDEC__DATA_PTR_FROM_LINK(cr);
+}
+
+
+/*
+ ThreadFunc2() returns:
+ 0 - in all normal cases (even for stream error or memory allocation error)
+ (!= 0) - WRes error return by system threading function
+*/
+
+// #define MTDEC_ProgessStep (1 << 22)
+#define MTDEC_ProgessStep (1 << 0)
+
+static WRes ThreadFunc2(CMtDecThread *t)
+{
+ CMtDec *p = t->mtDec;
+
+ PRF_STR_INT("ThreadFunc2", t->index);
+
+ // SetThreadAffinityMask(GetCurrentThread(), 1 << t->index);
+
+ for (;;)
+ {
+ SRes res, codeRes;
+ Bool wasInterrupted, isAllocError, overflow, finish;
+ SRes threadingErrorSRes;
+ Bool needCode, needWrite, needContinue;
+
+ size_t inDataSize_Start;
+ UInt64 inDataSize;
+ // UInt64 inDataSize_Full;
+
+ UInt64 blockIndex;
+
+ UInt64 inPrev = 0;
+ UInt64 outPrev = 0;
+ UInt64 inCodePos;
+ UInt64 outCodePos;
+
+ Byte *afterEndData = NULL;
+ size_t afterEndData_Size = 0;
+
+ Bool canCreateNewThread = False;
+ // CMtDecCallbackInfo parse;
+ CMtDecThread *nextThread;
+
+ PRF_STR_INT("Event_Wait(&t->canRead)", t->index);
+
+ RINOK_THREAD(Event_Wait(&t->canRead));
+ if (p->exitThread)
+ return 0;
+
+ PRF_STR_INT("after Event_Wait(&t->canRead)", t->index);
+
+ // if (t->index == 3) return 19; // for test
+
+ blockIndex = p->blockIndex++;
+
+ // PRF(printf("\ncanRead\n"))
+
+ res = MtDec_Progress_GetError_Spec(p, 0, 0, blockIndex, &wasInterrupted);
+
+ finish = p->readWasFinished;
+ needCode = False;
+ needWrite = False;
+ isAllocError = False;
+ overflow = False;
+
+ inDataSize_Start = 0;
+ inDataSize = 0;
+ // inDataSize_Full = 0;
+
+ if (res == SZ_OK && !wasInterrupted)
+ {
+ // if (p->inStream)
+ {
+ CMtDecBufLink *prev = NULL;
+ CMtDecBufLink *link = (CMtDecBufLink *)t->inBuf;
+ size_t crossSize = p->crossEnd - p->crossStart;
+
+ PRF(printf("\ncrossSize = %d\n", crossSize));
+
+ for (;;)
+ {
+ if (!link)
+ {
+ link = (CMtDecBufLink *)ISzAlloc_Alloc(p->alloc, MTDEC__LINK_DATA_OFFSET + p->inBufSize);
+ if (!link)
+ {
+ finish = True;
+ // p->allocError_for_Read_BlockIndex = blockIndex;
+ isAllocError = True;
+ break;
+ }
+ link->next = NULL;
+ if (prev)
+ {
+ // static unsigned g_num = 0;
+ // printf("\n%6d : %x", ++g_num, (unsigned)(size_t)((Byte *)link - (Byte *)prev));
+ prev->next = link;
+ }
+ else
+ t->inBuf = (void *)link;
+ }
+
+ {
+ Byte *data = MTDEC__DATA_PTR_FROM_LINK(link);
+ Byte *parseData = data;
+ size_t size;
+
+ if (crossSize != 0)
+ {
+ inDataSize = crossSize;
+ // inDataSize_Full = inDataSize;
+ inDataSize_Start = crossSize;
+ size = crossSize;
+ parseData = MTDEC__DATA_PTR_FROM_LINK(p->crossBlock) + p->crossStart;
+ PRF(printf("\ncross : crossStart = %7d crossEnd = %7d finish = %1d",
+ (int)p->crossStart, (int)p->crossEnd, (int)finish));
+ }
+ else
+ {
+ size = p->inBufSize;
+
+ res = FullRead(p->inStream, data, &size);
+
+ // size = 10; // test
+
+ inDataSize += size;
+ // inDataSize_Full = inDataSize;
+ if (!prev)
+ inDataSize_Start = size;
+
+ p->readProcessed += size;
+ finish = (size != p->inBufSize);
+ if (finish)
+ p->readWasFinished = True;
+
+ // res = E_INVALIDARG; // test
+
+ if (res != SZ_OK)
+ {
+ // PRF(printf("\nRead error = %d\n", res))
+ // we want to decode all data before error
+ p->readRes = res;
+ // p->readError_BlockIndex = blockIndex;
+ p->readWasFinished = True;
+ finish = True;
+ res = SZ_OK;
+ // break;
+ }
+
+ if (inDataSize - inPrev >= MTDEC_ProgessStep)
+ {
+ res = MtDec_Progress_GetError_Spec(p, 0, 0, blockIndex, &wasInterrupted);
+ if (res != SZ_OK || wasInterrupted)
+ break;
+ inPrev = inDataSize;
+ }
+ }
+
+ {
+ CMtDecCallbackInfo parse;
+
+ parse.startCall = (prev == NULL);
+ parse.src = parseData;
+ parse.srcSize = size;
+ parse.srcFinished = finish;
+ parse.canCreateNewThread = True;
+
+ // PRF(printf("\nParse size = %d\n", (unsigned)size))
+
+ p->mtCallback->Parse(p->mtCallbackObject, t->index, &parse);
+
+ needWrite = True;
+ canCreateNewThread = parse.canCreateNewThread;
+
+ // printf("\n\n%12I64u %12I64u", (UInt64)p->mtProgress.totalInSize, (UInt64)p->mtProgress.totalOutSize);
+
+ if (
+ // parseRes != SZ_OK ||
+ // inDataSize - (size - parse.srcSize) > p->inBlockMax
+ // ||
+ parse.state == MTDEC_PARSE_OVERFLOW
+ // || wasInterrupted
+ )
+ {
+ // Overflow or Parse error - switch from MT decoding to ST decoding
+ finish = True;
+ overflow = True;
+
+ {
+ PRF(printf("\n Overflow"));
+ // PRF(printf("\nisBlockFinished = %d", (unsigned)parse.blockWasFinished));
+ PRF(printf("\n inDataSize = %d", (unsigned)inDataSize));
+ }
+
+ if (crossSize != 0)
+ memcpy(data, parseData, size);
+ p->crossStart = 0;
+ p->crossEnd = 0;
+ break;
+ }
+
+ if (crossSize != 0)
+ {
+ memcpy(data, parseData, parse.srcSize);
+ p->crossStart += parse.srcSize;
+ }
+
+ if (parse.state != MTDEC_PARSE_CONTINUE || finish)
+ {
+ // we don't need to parse in current thread anymore
+
+ if (parse.state == MTDEC_PARSE_END)
+ finish = True;
+
+ needCode = True;
+ // p->crossFinished = finish;
+
+ if (parse.srcSize == size)
+ {
+ // full parsed - no cross transfer
+ p->crossStart = 0;
+ p->crossEnd = 0;
+ break;
+ }
+
+ if (parse.state == MTDEC_PARSE_END)
+ {
+ p->crossStart = 0;
+ p->crossEnd = 0;
+
+ if (crossSize != 0)
+ memcpy(data + parse.srcSize, parseData + parse.srcSize, size - parse.srcSize); // we need all data
+ afterEndData_Size = size - parse.srcSize;
+ afterEndData = parseData + parse.srcSize;
+
+ // we reduce data size to required bytes (parsed only)
+ inDataSize -= (size - parse.srcSize);
+ if (!prev)
+ inDataSize_Start = parse.srcSize;
+ break;
+ }
+
+ {
+ // partial parsed - need cross transfer
+ if (crossSize != 0)
+ inDataSize = parse.srcSize; // it's only parsed now
+ else
+ {
+ // partial parsed - is not in initial cross block - we need to copy new data to cross block
+ Byte *cr = MtDec_GetCrossBuff(p);
+ if (!cr)
+ {
+ {
+ PRF(printf("\ncross alloc error error\n"));
+ // res = SZ_ERROR_MEM;
+ finish = True;
+ // p->allocError_for_Read_BlockIndex = blockIndex;
+ isAllocError = True;
+ break;
+ }
+ }
+
+ {
+ size_t crSize = size - parse.srcSize;
+ inDataSize -= crSize;
+ p->crossEnd = crSize;
+ p->crossStart = 0;
+ memcpy(cr, parseData + parse.srcSize, crSize);
+ }
+ }
+
+ // inDataSize_Full = inDataSize;
+ if (!prev)
+ inDataSize_Start = parse.srcSize; // it's partial size (parsed only)
+
+ finish = False;
+ break;
+ }
+ }
+
+ if (parse.srcSize != size)
+ {
+ res = SZ_ERROR_FAIL;
+ PRF(printf("\nfinished error SZ_ERROR_FAIL = %d\n", res));
+ break;
+ }
+ }
+ }
+
+ prev = link;
+ link = link->next;
+
+ if (crossSize != 0)
+ {
+ crossSize = 0;
+ p->crossStart = 0;
+ p->crossEnd = 0;
+ }
+ }
+ }
+
+ if (res == SZ_OK)
+ res = MtDec_GetError_Spec(p, blockIndex, &wasInterrupted);
+ }
+
+ codeRes = SZ_OK;
+
+ if (res == SZ_OK && needCode && !wasInterrupted)
+ {
+ codeRes = p->mtCallback->PreCode(p->mtCallbackObject, t->index);
+ if (codeRes != SZ_OK)
+ {
+ needCode = False;
+ finish = True;
+ // SZ_ERROR_MEM is expected error here.
+ // if (codeRes == SZ_ERROR_MEM) - we will try single-thread decoding later.
+ // if (codeRes != SZ_ERROR_MEM) - we can stop decoding or try single-thread decoding.
+ }
+ }
+
+ if (res != SZ_OK || wasInterrupted)
+ finish = True;
+
+ nextThread = NULL;
+ threadingErrorSRes = SZ_OK;
+
+ if (!finish)
+ {
+ if (p->numStartedThreads < p->numStartedThreads_Limit && canCreateNewThread)
+ {
+ SRes res2 = MtDecThread_CreateAndStart(&p->threads[p->numStartedThreads]);
+ if (res2 == SZ_OK)
+ {
+ // if (p->numStartedThreads % 1000 == 0) PRF(printf("\n numStartedThreads=%d\n", p->numStartedThreads));
+ p->numStartedThreads++;
+ }
+ else
+ {
+ PRF(printf("\nERROR: numStartedThreads=%d\n", p->numStartedThreads));
+ if (p->numStartedThreads == 1)
+ {
+ // if only one thread is possible, we leave muti-threading code
+ finish = True;
+ needCode = False;
+ threadingErrorSRes = res2;
+ }
+ else
+ p->numStartedThreads_Limit = p->numStartedThreads;
+ }
+ }
+
+ if (!finish)
+ {
+ unsigned nextIndex = t->index + 1;
+ nextThread = &p->threads[nextIndex >= p->numStartedThreads ? 0 : nextIndex];
+ RINOK_THREAD(Event_Set(&nextThread->canRead))
+ // We have started executing for new iteration (with next thread)
+ // And that next thread now is responsible for possible exit from decoding (threading_code)
+ }
+ }
+
+ // each call of Event_Set(&nextThread->canRead) must be followed by call of Event_Set(&nextThread->canWrite)
+ // if ( !finish ) we must call Event_Set(&nextThread->canWrite) in any case
+ // if ( finish ) we switch to single-thread mode and there are 2 ways at the end of current iteration (current block):
+ // - if (needContinue) after Write(&needContinue), we restore decoding with new iteration
+ // - otherwise we stop decoding and exit from ThreadFunc2()
+
+ // Don't change (finish) variable in the further code
+
+
+ // ---------- CODE ----------
+
+ inPrev = 0;
+ outPrev = 0;
+ inCodePos = 0;
+ outCodePos = 0;
+
+ if (res == SZ_OK && needCode && codeRes == SZ_OK)
+ {
+ Bool isStartBlock = True;
+ CMtDecBufLink *link = (CMtDecBufLink *)t->inBuf;
+
+ for (;;)
+ {
+ size_t inSize;
+ int stop;
+
+ if (isStartBlock)
+ inSize = inDataSize_Start;
+ else
+ {
+ UInt64 rem = inDataSize - inCodePos;
+ inSize = p->inBufSize;
+ if (inSize > rem)
+ inSize = (size_t)rem;
+ }
+
+ inCodePos += inSize;
+ stop = True;
+
+ codeRes = p->mtCallback->Code(p->mtCallbackObject, t->index,
+ (const Byte *)MTDEC__DATA_PTR_FROM_LINK(link), inSize,
+ (inCodePos == inDataSize), // srcFinished
+ &inCodePos, &outCodePos, &stop);
+
+ if (codeRes != SZ_OK)
+ {
+ PRF(printf("\nCode Interrupt error = %x\n", codeRes));
+ // we interrupt only later blocks
+ MtDec_Interrupt(p, blockIndex);
+ break;
+ }
+
+ if (stop || inCodePos == inDataSize)
+ break;
+
+ {
+ const UInt64 inDelta = inCodePos - inPrev;
+ const UInt64 outDelta = outCodePos - outPrev;
+ if (inDelta >= MTDEC_ProgessStep || outDelta >= MTDEC_ProgessStep)
+ {
+ // Sleep(1);
+ res = MtDec_Progress_GetError_Spec(p, inDelta, outDelta, blockIndex, &wasInterrupted);
+ if (res != SZ_OK || wasInterrupted)
+ break;
+ inPrev = inCodePos;
+ outPrev = outCodePos;
+ }
+ }
+
+ link = link->next;
+ isStartBlock = False;
+ }
+ }
+
+
+ // ---------- WRITE ----------
+
+ RINOK_THREAD(Event_Wait(&t->canWrite));
+
+ {
+ Bool isErrorMode = False;
+ Bool canRecode = True;
+ Bool needWriteToStream = needWrite;
+
+ if (p->exitThread) return 0; // it's never executed in normal cases
+
+ if (p->wasInterrupted)
+ wasInterrupted = True;
+ else
+ {
+ if (codeRes != SZ_OK) // || !needCode // check it !!!
+ {
+ p->wasInterrupted = True;
+ p->codeRes = codeRes;
+ if (codeRes == SZ_ERROR_MEM)
+ isAllocError = True;
+ }
+
+ if (threadingErrorSRes)
+ {
+ p->wasInterrupted = True;
+ p->threadingErrorSRes = threadingErrorSRes;
+ needWriteToStream = False;
+ }
+ if (isAllocError)
+ {
+ p->wasInterrupted = True;
+ p->isAllocError = True;
+ needWriteToStream = False;
+ }
+ if (overflow)
+ {
+ p->wasInterrupted = True;
+ p->overflow = True;
+ needWriteToStream = False;
+ }
+ }
+
+ if (needCode)
+ {
+ if (wasInterrupted)
+ {
+ inCodePos = 0;
+ outCodePos = 0;
+ }
+ {
+ const UInt64 inDelta = inCodePos - inPrev;
+ const UInt64 outDelta = outCodePos - outPrev;
+ // if (inDelta != 0 || outDelta != 0)
+ res = MtProgress_ProgressAdd(&p->mtProgress, inDelta, outDelta);
+ }
+ }
+
+ needContinue = (!finish);
+
+ // if (res == SZ_OK && needWrite && !wasInterrupted)
+ if (needWrite)
+ {
+ // p->inProcessed += inCodePos;
+
+ res = p->mtCallback->Write(p->mtCallbackObject, t->index,
+ res == SZ_OK && needWriteToStream && !wasInterrupted, // needWrite
+ afterEndData, afterEndData_Size,
+ &needContinue,
+ &canRecode);
+
+ // res= E_INVALIDARG; // for test
+
+ PRF(printf("\nAfter Write needContinue = %d\n", (unsigned)needContinue));
+ PRF(printf("\nprocessed = %d\n", (unsigned)p->inProcessed));
+
+ if (res != SZ_OK)
+ {
+ PRF(printf("\nWrite error = %d\n", res));
+ isErrorMode = True;
+ p->wasInterrupted = True;
+ }
+ if (res != SZ_OK
+ || (!needContinue && !finish))
+ {
+ PRF(printf("\nWrite Interrupt error = %x\n", res));
+ MtDec_Interrupt(p, blockIndex);
+ }
+ }
+
+ if (canRecode)
+ if (!needCode
+ || res != SZ_OK
+ || p->wasInterrupted
+ || codeRes != SZ_OK
+ || wasInterrupted
+ || p->numFilledThreads != 0
+ || isErrorMode)
+ {
+ if (p->numFilledThreads == 0)
+ p->filledThreadStart = t->index;
+ if (inDataSize != 0 || !finish)
+ {
+ t->inDataSize_Start = inDataSize_Start;
+ t->inDataSize = inDataSize;
+ p->numFilledThreads++;
+ }
+ PRF(printf("\np->numFilledThreads = %d\n", p->numFilledThreads));
+ PRF(printf("p->filledThreadStart = %d\n", p->filledThreadStart));
+ }
+
+ if (!finish)
+ {
+ RINOK_THREAD(Event_Set(&nextThread->canWrite));
+ }
+ else
+ {
+ if (needContinue)
+ {
+ // we restore decoding with new iteration
+ RINOK_THREAD(Event_Set(&p->threads[0].canWrite));
+ }
+ else
+ {
+ // we exit from decoding
+ if (t->index == 0)
+ return SZ_OK;
+ p->exitThread = True;
+ }
+ RINOK_THREAD(Event_Set(&p->threads[0].canRead));
+ }
+ }
+ }
+}
+
+#ifdef _WIN32
+#define USE_ALLOCA
+#endif
+
+#ifdef USE_ALLOCA
+#ifdef _WIN32
+#include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
+#endif
+
+
+static THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc1(void *pp)
+{
+ WRes res;
+
+ CMtDecThread *t = (CMtDecThread *)pp;
+ CMtDec *p;
+
+ // fprintf(stdout, "\n%d = %p\n", t->index, &t);
+
+ res = ThreadFunc2(t);
+ p = t->mtDec;
+ if (res == 0)
+ return p->exitThreadWRes;
+ {
+ // it's unexpected situation for some threading function error
+ if (p->exitThreadWRes == 0)
+ p->exitThreadWRes = res;
+ PRF(printf("\nthread exit error = %d\n", res));
+ p->exitThread = True;
+ Event_Set(&p->threads[0].canRead);
+ Event_Set(&p->threads[0].canWrite);
+ MtProgress_SetError(&p->mtProgress, MY_SRes_HRESULT_FROM_WRes(res));
+ }
+ return res;
+}
+
+static MY_NO_INLINE THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE ThreadFunc(void *pp)
+{
+ CMtDecThread *t = (CMtDecThread *)pp;
+
+ // fprintf(stderr, "\n%d = %p - before", t->index, &t);
+ #ifdef USE_ALLOCA
+ t->allocaPtr = alloca(t->index * 128);
+ #endif
+ return ThreadFunc1(pp);
+}
+
+
+int MtDec_PrepareRead(CMtDec *p)
+{
+ if (p->crossBlock && p->crossStart == p->crossEnd)
+ {
+ ISzAlloc_Free(p->alloc, p->crossBlock);
+ p->crossBlock = NULL;
+ }
+
+ {
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ if (i > p->numStartedThreads
+ || p->numFilledThreads <=
+ (i >= p->filledThreadStart ?
+ i - p->filledThreadStart :
+ i + p->numStartedThreads - p->filledThreadStart))
+ MtDecThread_FreeInBufs(&p->threads[i]);
+ }
+
+ return (p->numFilledThreads != 0) || (p->crossStart != p->crossEnd);
+}
+
+
+const Byte *MtDec_Read(CMtDec *p, size_t *inLim)
+{
+ while (p->numFilledThreads != 0)
+ {
+ CMtDecThread *t = &p->threads[p->filledThreadStart];
+
+ if (*inLim != 0)
+ {
+ {
+ void *link = t->inBuf;
+ void *next = ((CMtDecBufLink *)link)->next;
+ ISzAlloc_Free(p->alloc, link);
+ t->inBuf = next;
+ }
+
+ if (t->inDataSize == 0)
+ {
+ MtDecThread_FreeInBufs(t);
+ if (--p->numFilledThreads == 0)
+ break;
+ if (++p->filledThreadStart == p->numStartedThreads)
+ p->filledThreadStart = 0;
+ t = &p->threads[p->filledThreadStart];
+ }
+ }
+
+ {
+ size_t lim = t->inDataSize_Start;
+ if (lim != 0)
+ t->inDataSize_Start = 0;
+ else
+ {
+ UInt64 rem = t->inDataSize;
+ lim = p->inBufSize;
+ if (lim > rem)
+ lim = (size_t)rem;
+ }
+ t->inDataSize -= lim;
+ *inLim = lim;
+ return (const Byte *)MTDEC__DATA_PTR_FROM_LINK(t->inBuf);
+ }
+ }
+
+ {
+ size_t crossSize = p->crossEnd - p->crossStart;
+ if (crossSize != 0)
+ {
+ const Byte *data = MTDEC__DATA_PTR_FROM_LINK(p->crossBlock) + p->crossStart;
+ *inLim = crossSize;
+ p->crossStart = 0;
+ p->crossEnd = 0;
+ return data;
+ }
+ *inLim = 0;
+ if (p->crossBlock)
+ {
+ ISzAlloc_Free(p->alloc, p->crossBlock);
+ p->crossBlock = NULL;
+ }
+ return NULL;
+ }
+}
+
+
+void MtDec_Construct(CMtDec *p)
+{
+ unsigned i;
+
+ p->inBufSize = (size_t)1 << 18;
+
+ p->numThreadsMax = 0;
+
+ p->inStream = NULL;
+
+ // p->inData = NULL;
+ // p->inDataSize = 0;
+
+ p->crossBlock = NULL;
+ p->crossStart = 0;
+ p->crossEnd = 0;
+
+ p->numFilledThreads = 0;
+
+ p->progress = NULL;
+ p->alloc = NULL;
+
+ p->mtCallback = NULL;
+ p->mtCallbackObject = NULL;
+
+ p->allocatedBufsSize = 0;
+
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CMtDecThread *t = &p->threads[i];
+ t->mtDec = p;
+ t->index = i;
+ t->inBuf = NULL;
+ Event_Construct(&t->canRead);
+ Event_Construct(&t->canWrite);
+ Thread_Construct(&t->thread);
+ }
+
+ // Event_Construct(&p->finishedEvent);
+
+ CriticalSection_Init(&p->mtProgress.cs);
+}
+
+
+static void MtDec_Free(CMtDec *p)
+{
+ unsigned i;
+
+ p->exitThread = True;
+
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ MtDecThread_Destruct(&p->threads[i]);
+
+ // Event_Close(&p->finishedEvent);
+
+ if (p->crossBlock)
+ {
+ ISzAlloc_Free(p->alloc, p->crossBlock);
+ p->crossBlock = NULL;
+ }
+}
+
+
+void MtDec_Destruct(CMtDec *p)
+{
+ MtDec_Free(p);
+
+ CriticalSection_Delete(&p->mtProgress.cs);
+}
+
+
+SRes MtDec_Code(CMtDec *p)
+{
+ unsigned i;
+
+ p->inProcessed = 0;
+
+ p->blockIndex = 1; // it must be larger than not_defined index (0)
+ p->isAllocError = False;
+ p->overflow = False;
+ p->threadingErrorSRes = SZ_OK;
+
+ p->needContinue = True;
+
+ p->readWasFinished = False;
+ p->needInterrupt = False;
+ p->interruptIndex = (UInt64)(Int64)-1;
+
+ p->readProcessed = 0;
+ p->readRes = SZ_OK;
+ p->codeRes = SZ_OK;
+ p->wasInterrupted = False;
+
+ p->crossStart = 0;
+ p->crossEnd = 0;
+
+ p->filledThreadStart = 0;
+ p->numFilledThreads = 0;
+
+ {
+ unsigned numThreads = p->numThreadsMax;
+ if (numThreads > MTDEC__THREADS_MAX)
+ numThreads = MTDEC__THREADS_MAX;
+ p->numStartedThreads_Limit = numThreads;
+ p->numStartedThreads = 0;
+ }
+
+ if (p->inBufSize != p->allocatedBufsSize)
+ {
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CMtDecThread *t = &p->threads[i];
+ if (t->inBuf)
+ MtDecThread_FreeInBufs(t);
+ }
+ if (p->crossBlock)
+ {
+ ISzAlloc_Free(p->alloc, p->crossBlock);
+ p->crossBlock = NULL;
+ }
+
+ p->allocatedBufsSize = p->inBufSize;
+ }
+
+ MtProgress_Init(&p->mtProgress, p->progress);
+
+ // RINOK_THREAD(ArEvent_OptCreate_And_Reset(&p->finishedEvent));
+ p->exitThread = False;
+ p->exitThreadWRes = 0;
+
+ {
+ WRes wres;
+ WRes sres;
+ CMtDecThread *nextThread = &p->threads[p->numStartedThreads++];
+ // wres = MtDecThread_CreateAndStart(nextThread);
+ wres = MtDecThread_CreateEvents(nextThread);
+ if (wres == 0) { wres = Event_Set(&nextThread->canWrite);
+ if (wres == 0) { wres = Event_Set(&nextThread->canRead);
+ if (wres == 0) { wres = ThreadFunc(nextThread);
+ if (wres != 0)
+ {
+ p->needContinue = False;
+ MtDec_CloseThreads(p);
+ }}}}
+
+ // wres = 17; // for test
+ // wres = Event_Wait(&p->finishedEvent);
+
+ sres = MY_SRes_HRESULT_FROM_WRes(wres);
+
+ if (sres != 0)
+ p->threadingErrorSRes = sres;
+
+ if (
+ // wres == 0
+ // wres != 0
+ // || p->mtc.codeRes == SZ_ERROR_MEM
+ p->isAllocError
+ || p->threadingErrorSRes != SZ_OK
+ || p->overflow)
+ {
+ // p->needContinue = True;
+ }
+ else
+ p->needContinue = False;
+
+ if (p->needContinue)
+ return SZ_OK;
+
+ // if (sres != SZ_OK)
+ return sres;
+ // return E_FAIL;
+ }
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/MtDec.h b/other-licenses/7zstub/src/C/MtDec.h
new file mode 100644
index 0000000000..b445bc9d04
--- /dev/null
+++ b/other-licenses/7zstub/src/C/MtDec.h
@@ -0,0 +1,201 @@
+/* MtDec.h -- Multi-thread Decoder
+2018-03-02 : Igor Pavlov : Public domain */
+
+#ifndef __MT_DEC_H
+#define __MT_DEC_H
+
+#include "7zTypes.h"
+
+#ifndef _7ZIP_ST
+#include "Threads.h"
+#endif
+
+EXTERN_C_BEGIN
+
+#ifndef _7ZIP_ST
+
+#ifndef _7ZIP_ST
+ #define MTDEC__THREADS_MAX 32
+#else
+ #define MTDEC__THREADS_MAX 1
+#endif
+
+
+typedef struct
+{
+ ICompressProgress *progress;
+ SRes res;
+ UInt64 totalInSize;
+ UInt64 totalOutSize;
+ CCriticalSection cs;
+} CMtProgress;
+
+void MtProgress_Init(CMtProgress *p, ICompressProgress *progress);
+SRes MtProgress_Progress_ST(CMtProgress *p);
+SRes MtProgress_ProgressAdd(CMtProgress *p, UInt64 inSize, UInt64 outSize);
+SRes MtProgress_GetError(CMtProgress *p);
+void MtProgress_SetError(CMtProgress *p, SRes res);
+
+struct _CMtDec;
+
+typedef struct
+{
+ struct _CMtDec *mtDec;
+ unsigned index;
+ void *inBuf;
+
+ size_t inDataSize_Start; // size of input data in start block
+ UInt64 inDataSize; // total size of input data in all blocks
+
+ CThread thread;
+ CAutoResetEvent canRead;
+ CAutoResetEvent canWrite;
+ void *allocaPtr;
+} CMtDecThread;
+
+void MtDecThread_FreeInBufs(CMtDecThread *t);
+
+
+typedef enum
+{
+ MTDEC_PARSE_CONTINUE, // continue this block with more input data
+ MTDEC_PARSE_OVERFLOW, // MT buffers overflow, need switch to single-thread
+ MTDEC_PARSE_NEW, // new block
+ MTDEC_PARSE_END // end of block threading. But we still can return to threading after Write(&needContinue)
+} EMtDecParseState;
+
+typedef struct
+{
+ // in
+ int startCall;
+ const Byte *src;
+ size_t srcSize;
+ // in : (srcSize == 0) is allowed
+ // out : it's allowed to return less that actually was used ?
+ int srcFinished;
+
+ // out
+ EMtDecParseState state;
+ Bool canCreateNewThread;
+ UInt64 outPos; // check it (size_t)
+} CMtDecCallbackInfo;
+
+
+typedef struct
+{
+ void (*Parse)(void *p, unsigned coderIndex, CMtDecCallbackInfo *ci);
+
+ // PreCode() and Code():
+ // (SRes_return_result != SZ_OK) means stop decoding, no need another blocks
+ SRes (*PreCode)(void *p, unsigned coderIndex);
+ SRes (*Code)(void *p, unsigned coderIndex,
+ const Byte *src, size_t srcSize, int srcFinished,
+ UInt64 *inCodePos, UInt64 *outCodePos, int *stop);
+ // stop - means stop another Code calls
+
+
+ /* Write() must be called, if Parse() was called
+ set (needWrite) if
+ {
+ && (was not interrupted by progress)
+ && (was not interrupted in previous block)
+ }
+
+ out:
+ if (*needContinue), decoder still need to continue decoding with new iteration,
+ even after MTDEC_PARSE_END
+ if (*canRecode), we didn't flush current block data, so we still can decode current block later.
+ */
+ SRes (*Write)(void *p, unsigned coderIndex,
+ Bool needWriteToStream,
+ const Byte *src, size_t srcSize,
+ // int srcFinished,
+ Bool *needContinue,
+ Bool *canRecode);
+} IMtDecCallback;
+
+
+
+typedef struct _CMtDec
+{
+ /* input variables */
+
+ size_t inBufSize; /* size of input block */
+ unsigned numThreadsMax;
+ // size_t inBlockMax;
+ unsigned numThreadsMax_2;
+
+ ISeqInStream *inStream;
+ // const Byte *inData;
+ // size_t inDataSize;
+
+ ICompressProgress *progress;
+ ISzAllocPtr alloc;
+
+ IMtDecCallback *mtCallback;
+ void *mtCallbackObject;
+
+
+ /* internal variables */
+
+ size_t allocatedBufsSize;
+
+ Bool exitThread;
+ WRes exitThreadWRes;
+
+ UInt64 blockIndex;
+ Bool isAllocError;
+ Bool overflow;
+ SRes threadingErrorSRes;
+
+ Bool needContinue;
+
+ // CAutoResetEvent finishedEvent;
+
+ SRes readRes;
+ SRes codeRes;
+
+ Bool wasInterrupted;
+
+ unsigned numStartedThreads_Limit;
+ unsigned numStartedThreads;
+
+ Byte *crossBlock;
+ size_t crossStart;
+ size_t crossEnd;
+ UInt64 readProcessed;
+ Bool readWasFinished;
+ UInt64 inProcessed;
+
+ unsigned filledThreadStart;
+ unsigned numFilledThreads;
+
+ #ifndef _7ZIP_ST
+ Bool needInterrupt;
+ UInt64 interruptIndex;
+ CMtProgress mtProgress;
+ CMtDecThread threads[MTDEC__THREADS_MAX];
+ #endif
+} CMtDec;
+
+
+void MtDec_Construct(CMtDec *p);
+void MtDec_Destruct(CMtDec *p);
+
+/*
+MtDec_Code() returns:
+ SZ_OK - in most cases
+ MY_SRes_HRESULT_FROM_WRes(WRes_error) - in case of unexpected error in threading function
+*/
+
+SRes MtDec_Code(CMtDec *p);
+Byte *MtDec_GetCrossBuff(CMtDec *p);
+
+int MtDec_PrepareRead(CMtDec *p);
+const Byte *MtDec_Read(CMtDec *p, size_t *inLim);
+
+#endif
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Ppmd.h b/other-licenses/7zstub/src/C/Ppmd.h
new file mode 100644
index 0000000000..4b99415212
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Ppmd.h
@@ -0,0 +1,85 @@
+/* Ppmd.h -- PPMD codec common code
+2017-04-03 : Igor Pavlov : Public domain
+This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
+
+#ifndef __PPMD_H
+#define __PPMD_H
+
+#include "CpuArch.h"
+
+EXTERN_C_BEGIN
+
+#ifdef MY_CPU_32BIT
+ #define PPMD_32BIT
+#endif
+
+#define PPMD_INT_BITS 7
+#define PPMD_PERIOD_BITS 7
+#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
+
+#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
+#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
+#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
+#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
+
+#define PPMD_N1 4
+#define PPMD_N2 4
+#define PPMD_N3 4
+#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
+#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
+
+#pragma pack(push, 1)
+/* Most compilers works OK here even without #pragma pack(push, 1), but some GCC compilers need it. */
+
+/* SEE-contexts for PPM-contexts with masked symbols */
+typedef struct
+{
+ UInt16 Summ; /* Freq */
+ Byte Shift; /* Speed of Freq change; low Shift is for fast change */
+ Byte Count; /* Count to next change of Shift */
+} CPpmd_See;
+
+#define Ppmd_See_Update(p) if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) \
+ { (p)->Summ <<= 1; (p)->Count = (Byte)(3 << (p)->Shift++); }
+
+typedef struct
+{
+ Byte Symbol;
+ Byte Freq;
+ UInt16 SuccessorLow;
+ UInt16 SuccessorHigh;
+} CPpmd_State;
+
+#pragma pack(pop)
+
+typedef
+ #ifdef PPMD_32BIT
+ CPpmd_State *
+ #else
+ UInt32
+ #endif
+ CPpmd_State_Ref;
+
+typedef
+ #ifdef PPMD_32BIT
+ void *
+ #else
+ UInt32
+ #endif
+ CPpmd_Void_Ref;
+
+typedef
+ #ifdef PPMD_32BIT
+ Byte *
+ #else
+ UInt32
+ #endif
+ CPpmd_Byte_Ref;
+
+#define PPMD_SetAllBitsIn256Bytes(p) \
+ { size_t z; for (z = 0; z < 256 / sizeof(p[0]); z += 8) { \
+ p[z+7] = p[z+6] = p[z+5] = p[z+4] = p[z+3] = p[z+2] = p[z+1] = p[z+0] = ~(size_t)0; }}
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Ppmd7.c b/other-licenses/7zstub/src/C/Ppmd7.c
new file mode 100644
index 0000000000..ef93cb2d47
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Ppmd7.c
@@ -0,0 +1,712 @@
+/* Ppmd7.c -- PPMdH codec
+2017-04-03 : Igor Pavlov : Public domain
+This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "Ppmd7.h"
+
+const Byte PPMD7_kExpEscape[16] = { 25, 14, 9, 7, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2 };
+static const UInt16 kInitBinEsc[] = { 0x3CDD, 0x1F3F, 0x59BF, 0x48F3, 0x64A1, 0x5ABC, 0x6632, 0x6051};
+
+#define MAX_FREQ 124
+#define UNIT_SIZE 12
+
+#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
+#define U2I(nu) (p->Units2Indx[(size_t)(nu) - 1])
+#define I2U(indx) (p->Indx2Units[indx])
+
+#ifdef PPMD_32BIT
+ #define REF(ptr) (ptr)
+#else
+ #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
+#endif
+
+#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
+
+#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
+#define STATS(ctx) Ppmd7_GetStats(p, ctx)
+#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
+#define SUFFIX(ctx) CTX((ctx)->Suffix)
+
+typedef CPpmd7_Context * CTX_PTR;
+
+struct CPpmd7_Node_;
+
+typedef
+ #ifdef PPMD_32BIT
+ struct CPpmd7_Node_ *
+ #else
+ UInt32
+ #endif
+ CPpmd7_Node_Ref;
+
+typedef struct CPpmd7_Node_
+{
+ UInt16 Stamp; /* must be at offset 0 as CPpmd7_Context::NumStats. Stamp=0 means free */
+ UInt16 NU;
+ CPpmd7_Node_Ref Next; /* must be at offset >= 4 */
+ CPpmd7_Node_Ref Prev;
+} CPpmd7_Node;
+
+#ifdef PPMD_32BIT
+ #define NODE(ptr) (ptr)
+#else
+ #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
+#endif
+
+void Ppmd7_Construct(CPpmd7 *p)
+{
+ unsigned i, k, m;
+
+ p->Base = 0;
+
+ for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
+ {
+ unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
+ do { p->Units2Indx[k++] = (Byte)i; } while (--step);
+ p->Indx2Units[i] = (Byte)k;
+ }
+
+ p->NS2BSIndx[0] = (0 << 1);
+ p->NS2BSIndx[1] = (1 << 1);
+ memset(p->NS2BSIndx + 2, (2 << 1), 9);
+ memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
+
+ for (i = 0; i < 3; i++)
+ p->NS2Indx[i] = (Byte)i;
+ for (m = i, k = 1; i < 256; i++)
+ {
+ p->NS2Indx[i] = (Byte)m;
+ if (--k == 0)
+ k = (++m) - 2;
+ }
+
+ memset(p->HB2Flag, 0, 0x40);
+ memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);
+}
+
+void Ppmd7_Free(CPpmd7 *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->Base);
+ p->Size = 0;
+ p->Base = 0;
+}
+
+Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAllocPtr alloc)
+{
+ if (!p->Base || p->Size != size)
+ {
+ size_t size2;
+ Ppmd7_Free(p, alloc);
+ size2 = 0
+ #ifndef PPMD_32BIT
+ + UNIT_SIZE
+ #endif
+ ;
+ p->AlignOffset =
+ #ifdef PPMD_32BIT
+ (4 - size) & 3;
+ #else
+ 4 - (size & 3);
+ #endif
+ if ((p->Base = (Byte *)ISzAlloc_Alloc(alloc, p->AlignOffset + size + size2)) == 0)
+ return False;
+ p->Size = size;
+ }
+ return True;
+}
+
+static void InsertNode(CPpmd7 *p, void *node, unsigned indx)
+{
+ *((CPpmd_Void_Ref *)node) = p->FreeList[indx];
+ p->FreeList[indx] = REF(node);
+}
+
+static void *RemoveNode(CPpmd7 *p, unsigned indx)
+{
+ CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]);
+ p->FreeList[indx] = *node;
+ return node;
+}
+
+static void SplitBlock(CPpmd7 *p, void *ptr, unsigned oldIndx, unsigned newIndx)
+{
+ unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
+ ptr = (Byte *)ptr + U2B(I2U(newIndx));
+ if (I2U(i = U2I(nu)) != nu)
+ {
+ unsigned k = I2U(--i);
+ InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
+ }
+ InsertNode(p, ptr, i);
+}
+
+static void GlueFreeBlocks(CPpmd7 *p)
+{
+ #ifdef PPMD_32BIT
+ CPpmd7_Node headItem;
+ CPpmd7_Node_Ref head = &headItem;
+ #else
+ CPpmd7_Node_Ref head = p->AlignOffset + p->Size;
+ #endif
+
+ CPpmd7_Node_Ref n = head;
+ unsigned i;
+
+ p->GlueCount = 255;
+
+ /* create doubly-linked list of free blocks */
+ for (i = 0; i < PPMD_NUM_INDEXES; i++)
+ {
+ UInt16 nu = I2U(i);
+ CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i];
+ p->FreeList[i] = 0;
+ while (next != 0)
+ {
+ CPpmd7_Node *node = NODE(next);
+ node->Next = n;
+ n = NODE(n)->Prev = next;
+ next = *(const CPpmd7_Node_Ref *)node;
+ node->Stamp = 0;
+ node->NU = (UInt16)nu;
+ }
+ }
+ NODE(head)->Stamp = 1;
+ NODE(head)->Next = n;
+ NODE(n)->Prev = head;
+ if (p->LoUnit != p->HiUnit)
+ ((CPpmd7_Node *)p->LoUnit)->Stamp = 1;
+
+ /* Glue free blocks */
+ while (n != head)
+ {
+ CPpmd7_Node *node = NODE(n);
+ UInt32 nu = (UInt32)node->NU;
+ for (;;)
+ {
+ CPpmd7_Node *node2 = NODE(n) + nu;
+ nu += node2->NU;
+ if (node2->Stamp != 0 || nu >= 0x10000)
+ break;
+ NODE(node2->Prev)->Next = node2->Next;
+ NODE(node2->Next)->Prev = node2->Prev;
+ node->NU = (UInt16)nu;
+ }
+ n = node->Next;
+ }
+
+ /* Fill lists of free blocks */
+ for (n = NODE(head)->Next; n != head;)
+ {
+ CPpmd7_Node *node = NODE(n);
+ unsigned nu;
+ CPpmd7_Node_Ref next = node->Next;
+ for (nu = node->NU; nu > 128; nu -= 128, node += 128)
+ InsertNode(p, node, PPMD_NUM_INDEXES - 1);
+ if (I2U(i = U2I(nu)) != nu)
+ {
+ unsigned k = I2U(--i);
+ InsertNode(p, node + k, nu - k - 1);
+ }
+ InsertNode(p, node, i);
+ n = next;
+ }
+}
+
+static void *AllocUnitsRare(CPpmd7 *p, unsigned indx)
+{
+ unsigned i;
+ void *retVal;
+ if (p->GlueCount == 0)
+ {
+ GlueFreeBlocks(p);
+ if (p->FreeList[indx] != 0)
+ return RemoveNode(p, indx);
+ }
+ i = indx;
+ do
+ {
+ if (++i == PPMD_NUM_INDEXES)
+ {
+ UInt32 numBytes = U2B(I2U(indx));
+ p->GlueCount--;
+ return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
+ }
+ }
+ while (p->FreeList[i] == 0);
+ retVal = RemoveNode(p, i);
+ SplitBlock(p, retVal, i, indx);
+ return retVal;
+}
+
+static void *AllocUnits(CPpmd7 *p, unsigned indx)
+{
+ UInt32 numBytes;
+ if (p->FreeList[indx] != 0)
+ return RemoveNode(p, indx);
+ numBytes = U2B(I2U(indx));
+ if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
+ {
+ void *retVal = p->LoUnit;
+ p->LoUnit += numBytes;
+ return retVal;
+ }
+ return AllocUnitsRare(p, indx);
+}
+
+#define MyMem12Cpy(dest, src, num) \
+ { UInt32 *d = (UInt32 *)dest; const UInt32 *s = (const UInt32 *)src; UInt32 n = num; \
+ do { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3; } while (--n); }
+
+static void *ShrinkUnits(CPpmd7 *p, void *oldPtr, unsigned oldNU, unsigned newNU)
+{
+ unsigned i0 = U2I(oldNU);
+ unsigned i1 = U2I(newNU);
+ if (i0 == i1)
+ return oldPtr;
+ if (p->FreeList[i1] != 0)
+ {
+ void *ptr = RemoveNode(p, i1);
+ MyMem12Cpy(ptr, oldPtr, newNU);
+ InsertNode(p, oldPtr, i0);
+ return ptr;
+ }
+ SplitBlock(p, oldPtr, i0, i1);
+ return oldPtr;
+}
+
+#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
+
+static void SetSuccessor(CPpmd_State *p, CPpmd_Void_Ref v)
+{
+ (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
+ (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
+}
+
+static void RestartModel(CPpmd7 *p)
+{
+ unsigned i, k, m;
+
+ memset(p->FreeList, 0, sizeof(p->FreeList));
+ p->Text = p->Base + p->AlignOffset;
+ p->HiUnit = p->Text + p->Size;
+ p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
+ p->GlueCount = 0;
+
+ p->OrderFall = p->MaxOrder;
+ p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
+ p->PrevSuccess = 0;
+
+ p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
+ p->MinContext->Suffix = 0;
+ p->MinContext->NumStats = 256;
+ p->MinContext->SummFreq = 256 + 1;
+ p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
+ p->LoUnit += U2B(256 / 2);
+ p->MinContext->Stats = REF(p->FoundState);
+ for (i = 0; i < 256; i++)
+ {
+ CPpmd_State *s = &p->FoundState[i];
+ s->Symbol = (Byte)i;
+ s->Freq = 1;
+ SetSuccessor(s, 0);
+ }
+
+ for (i = 0; i < 128; i++)
+ for (k = 0; k < 8; k++)
+ {
+ UInt16 *dest = p->BinSumm[i] + k;
+ UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));
+ for (m = 0; m < 64; m += 8)
+ dest[m] = val;
+ }
+
+ for (i = 0; i < 25; i++)
+ for (k = 0; k < 16; k++)
+ {
+ CPpmd_See *s = &p->See[i][k];
+ s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));
+ s->Count = 4;
+ }
+}
+
+void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder)
+{
+ p->MaxOrder = maxOrder;
+ RestartModel(p);
+ p->DummySee.Shift = PPMD_PERIOD_BITS;
+ p->DummySee.Summ = 0; /* unused */
+ p->DummySee.Count = 64; /* unused */
+}
+
+static CTX_PTR CreateSuccessors(CPpmd7 *p, Bool skip)
+{
+ CPpmd_State upState;
+ CTX_PTR c = p->MinContext;
+ CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
+ CPpmd_State *ps[PPMD7_MAX_ORDER];
+ unsigned numPs = 0;
+
+ if (!skip)
+ ps[numPs++] = p->FoundState;
+
+ while (c->Suffix)
+ {
+ CPpmd_Void_Ref successor;
+ CPpmd_State *s;
+ c = SUFFIX(c);
+ if (c->NumStats != 1)
+ {
+ for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
+ }
+ else
+ s = ONE_STATE(c);
+ successor = SUCCESSOR(s);
+ if (successor != upBranch)
+ {
+ c = CTX(successor);
+ if (numPs == 0)
+ return c;
+ break;
+ }
+ ps[numPs++] = s;
+ }
+
+ upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);
+ SetSuccessor(&upState, upBranch + 1);
+
+ if (c->NumStats == 1)
+ upState.Freq = ONE_STATE(c)->Freq;
+ else
+ {
+ UInt32 cf, s0;
+ CPpmd_State *s;
+ for (s = STATS(c); s->Symbol != upState.Symbol; s++);
+ cf = s->Freq - 1;
+ s0 = c->SummFreq - c->NumStats - cf;
+ upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
+ }
+
+ do
+ {
+ /* Create Child */
+ CTX_PTR c1; /* = AllocContext(p); */
+ if (p->HiUnit != p->LoUnit)
+ c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
+ else if (p->FreeList[0] != 0)
+ c1 = (CTX_PTR)RemoveNode(p, 0);
+ else
+ {
+ c1 = (CTX_PTR)AllocUnitsRare(p, 0);
+ if (!c1)
+ return NULL;
+ }
+ c1->NumStats = 1;
+ *ONE_STATE(c1) = upState;
+ c1->Suffix = REF(c);
+ SetSuccessor(ps[--numPs], REF(c1));
+ c = c1;
+ }
+ while (numPs != 0);
+
+ return c;
+}
+
+static void SwapStates(CPpmd_State *t1, CPpmd_State *t2)
+{
+ CPpmd_State tmp = *t1;
+ *t1 = *t2;
+ *t2 = tmp;
+}
+
+static void UpdateModel(CPpmd7 *p)
+{
+ CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
+ CTX_PTR c;
+ unsigned s0, ns;
+
+ if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
+ {
+ c = SUFFIX(p->MinContext);
+
+ if (c->NumStats == 1)
+ {
+ CPpmd_State *s = ONE_STATE(c);
+ if (s->Freq < 32)
+ s->Freq++;
+ }
+ else
+ {
+ CPpmd_State *s = STATS(c);
+ if (s->Symbol != p->FoundState->Symbol)
+ {
+ do { s++; } while (s->Symbol != p->FoundState->Symbol);
+ if (s[0].Freq >= s[-1].Freq)
+ {
+ SwapStates(&s[0], &s[-1]);
+ s--;
+ }
+ }
+ if (s->Freq < MAX_FREQ - 9)
+ {
+ s->Freq += 2;
+ c->SummFreq += 2;
+ }
+ }
+ }
+
+ if (p->OrderFall == 0)
+ {
+ p->MinContext = p->MaxContext = CreateSuccessors(p, True);
+ if (p->MinContext == 0)
+ {
+ RestartModel(p);
+ return;
+ }
+ SetSuccessor(p->FoundState, REF(p->MinContext));
+ return;
+ }
+
+ *p->Text++ = p->FoundState->Symbol;
+ successor = REF(p->Text);
+ if (p->Text >= p->UnitsStart)
+ {
+ RestartModel(p);
+ return;
+ }
+
+ if (fSuccessor)
+ {
+ if (fSuccessor <= successor)
+ {
+ CTX_PTR cs = CreateSuccessors(p, False);
+ if (cs == NULL)
+ {
+ RestartModel(p);
+ return;
+ }
+ fSuccessor = REF(cs);
+ }
+ if (--p->OrderFall == 0)
+ {
+ successor = fSuccessor;
+ p->Text -= (p->MaxContext != p->MinContext);
+ }
+ }
+ else
+ {
+ SetSuccessor(p->FoundState, successor);
+ fSuccessor = REF(p->MinContext);
+ }
+
+ s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);
+
+ for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))
+ {
+ unsigned ns1;
+ UInt32 cf, sf;
+ if ((ns1 = c->NumStats) != 1)
+ {
+ if ((ns1 & 1) == 0)
+ {
+ /* Expand for one UNIT */
+ unsigned oldNU = ns1 >> 1;
+ unsigned i = U2I(oldNU);
+ if (i != U2I((size_t)oldNU + 1))
+ {
+ void *ptr = AllocUnits(p, i + 1);
+ void *oldPtr;
+ if (!ptr)
+ {
+ RestartModel(p);
+ return;
+ }
+ oldPtr = STATS(c);
+ MyMem12Cpy(ptr, oldPtr, oldNU);
+ InsertNode(p, oldPtr, i);
+ c->Stats = STATS_REF(ptr);
+ }
+ }
+ c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));
+ }
+ else
+ {
+ CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);
+ if (!s)
+ {
+ RestartModel(p);
+ return;
+ }
+ *s = *ONE_STATE(c);
+ c->Stats = REF(s);
+ if (s->Freq < MAX_FREQ / 4 - 1)
+ s->Freq <<= 1;
+ else
+ s->Freq = MAX_FREQ - 4;
+ c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));
+ }
+ cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);
+ sf = (UInt32)s0 + c->SummFreq;
+ if (cf < 6 * sf)
+ {
+ cf = 1 + (cf > sf) + (cf >= 4 * sf);
+ c->SummFreq += 3;
+ }
+ else
+ {
+ cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);
+ c->SummFreq = (UInt16)(c->SummFreq + cf);
+ }
+ {
+ CPpmd_State *s = STATS(c) + ns1;
+ SetSuccessor(s, successor);
+ s->Symbol = p->FoundState->Symbol;
+ s->Freq = (Byte)cf;
+ c->NumStats = (UInt16)(ns1 + 1);
+ }
+ }
+ p->MaxContext = p->MinContext = CTX(fSuccessor);
+}
+
+static void Rescale(CPpmd7 *p)
+{
+ unsigned i, adder, sumFreq, escFreq;
+ CPpmd_State *stats = STATS(p->MinContext);
+ CPpmd_State *s = p->FoundState;
+ {
+ CPpmd_State tmp = *s;
+ for (; s != stats; s--)
+ s[0] = s[-1];
+ *s = tmp;
+ }
+ escFreq = p->MinContext->SummFreq - s->Freq;
+ s->Freq += 4;
+ adder = (p->OrderFall != 0);
+ s->Freq = (Byte)((s->Freq + adder) >> 1);
+ sumFreq = s->Freq;
+
+ i = p->MinContext->NumStats - 1;
+ do
+ {
+ escFreq -= (++s)->Freq;
+ s->Freq = (Byte)((s->Freq + adder) >> 1);
+ sumFreq += s->Freq;
+ if (s[0].Freq > s[-1].Freq)
+ {
+ CPpmd_State *s1 = s;
+ CPpmd_State tmp = *s1;
+ do
+ s1[0] = s1[-1];
+ while (--s1 != stats && tmp.Freq > s1[-1].Freq);
+ *s1 = tmp;
+ }
+ }
+ while (--i);
+
+ if (s->Freq == 0)
+ {
+ unsigned numStats = p->MinContext->NumStats;
+ unsigned n0, n1;
+ do { i++; } while ((--s)->Freq == 0);
+ escFreq += i;
+ p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i);
+ if (p->MinContext->NumStats == 1)
+ {
+ CPpmd_State tmp = *stats;
+ do
+ {
+ tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));
+ escFreq >>= 1;
+ }
+ while (escFreq > 1);
+ InsertNode(p, stats, U2I(((numStats + 1) >> 1)));
+ *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
+ return;
+ }
+ n0 = (numStats + 1) >> 1;
+ n1 = (p->MinContext->NumStats + 1) >> 1;
+ if (n0 != n1)
+ p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
+ }
+ p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
+ p->FoundState = STATS(p->MinContext);
+}
+
+CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *escFreq)
+{
+ CPpmd_See *see;
+ unsigned nonMasked = p->MinContext->NumStats - numMasked;
+ if (p->MinContext->NumStats != 256)
+ {
+ see = p->See[(unsigned)p->NS2Indx[(size_t)nonMasked - 1]] +
+ (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +
+ 2 * (unsigned)(p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +
+ 4 * (unsigned)(numMasked > nonMasked) +
+ p->HiBitsFlag;
+ {
+ unsigned r = (see->Summ >> see->Shift);
+ see->Summ = (UInt16)(see->Summ - r);
+ *escFreq = r + (r == 0);
+ }
+ }
+ else
+ {
+ see = &p->DummySee;
+ *escFreq = 1;
+ }
+ return see;
+}
+
+static void NextContext(CPpmd7 *p)
+{
+ CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
+ if (p->OrderFall == 0 && (Byte *)c > p->Text)
+ p->MinContext = p->MaxContext = c;
+ else
+ UpdateModel(p);
+}
+
+void Ppmd7_Update1(CPpmd7 *p)
+{
+ CPpmd_State *s = p->FoundState;
+ s->Freq += 4;
+ p->MinContext->SummFreq += 4;
+ if (s[0].Freq > s[-1].Freq)
+ {
+ SwapStates(&s[0], &s[-1]);
+ p->FoundState = --s;
+ if (s->Freq > MAX_FREQ)
+ Rescale(p);
+ }
+ NextContext(p);
+}
+
+void Ppmd7_Update1_0(CPpmd7 *p)
+{
+ p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);
+ p->RunLength += p->PrevSuccess;
+ p->MinContext->SummFreq += 4;
+ if ((p->FoundState->Freq += 4) > MAX_FREQ)
+ Rescale(p);
+ NextContext(p);
+}
+
+void Ppmd7_UpdateBin(CPpmd7 *p)
+{
+ p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
+ p->PrevSuccess = 1;
+ p->RunLength++;
+ NextContext(p);
+}
+
+void Ppmd7_Update2(CPpmd7 *p)
+{
+ p->MinContext->SummFreq += 4;
+ if ((p->FoundState->Freq += 4) > MAX_FREQ)
+ Rescale(p);
+ p->RunLength = p->InitRL;
+ UpdateModel(p);
+}
diff --git a/other-licenses/7zstub/src/C/Ppmd7.h b/other-licenses/7zstub/src/C/Ppmd7.h
new file mode 100644
index 0000000000..ee2c035d00
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Ppmd7.h
@@ -0,0 +1,142 @@
+/* Ppmd7.h -- PPMdH compression codec
+2017-04-03 : Igor Pavlov : Public domain
+This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
+
+/* This code supports virtual RangeDecoder and includes the implementation
+of RangeCoder from 7z, instead of RangeCoder from original PPMd var.H.
+If you need the compatibility with original PPMd var.H, you can use external RangeDecoder */
+
+#ifndef __PPMD7_H
+#define __PPMD7_H
+
+#include "Ppmd.h"
+
+EXTERN_C_BEGIN
+
+#define PPMD7_MIN_ORDER 2
+#define PPMD7_MAX_ORDER 64
+
+#define PPMD7_MIN_MEM_SIZE (1 << 11)
+#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3)
+
+struct CPpmd7_Context_;
+
+typedef
+ #ifdef PPMD_32BIT
+ struct CPpmd7_Context_ *
+ #else
+ UInt32
+ #endif
+ CPpmd7_Context_Ref;
+
+typedef struct CPpmd7_Context_
+{
+ UInt16 NumStats;
+ UInt16 SummFreq;
+ CPpmd_State_Ref Stats;
+ CPpmd7_Context_Ref Suffix;
+} CPpmd7_Context;
+
+#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
+
+typedef struct
+{
+ CPpmd7_Context *MinContext, *MaxContext;
+ CPpmd_State *FoundState;
+ unsigned OrderFall, InitEsc, PrevSuccess, MaxOrder, HiBitsFlag;
+ Int32 RunLength, InitRL; /* must be 32-bit at least */
+
+ UInt32 Size;
+ UInt32 GlueCount;
+ Byte *Base, *LoUnit, *HiUnit, *Text, *UnitsStart;
+ UInt32 AlignOffset;
+
+ Byte Indx2Units[PPMD_NUM_INDEXES];
+ Byte Units2Indx[128];
+ CPpmd_Void_Ref FreeList[PPMD_NUM_INDEXES];
+ Byte NS2Indx[256], NS2BSIndx[256], HB2Flag[256];
+ CPpmd_See DummySee, See[25][16];
+ UInt16 BinSumm[128][64];
+} CPpmd7;
+
+void Ppmd7_Construct(CPpmd7 *p);
+Bool Ppmd7_Alloc(CPpmd7 *p, UInt32 size, ISzAllocPtr alloc);
+void Ppmd7_Free(CPpmd7 *p, ISzAllocPtr alloc);
+void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder);
+#define Ppmd7_WasAllocated(p) ((p)->Base != NULL)
+
+
+/* ---------- Internal Functions ---------- */
+
+extern const Byte PPMD7_kExpEscape[16];
+
+#ifdef PPMD_32BIT
+ #define Ppmd7_GetPtr(p, ptr) (ptr)
+ #define Ppmd7_GetContext(p, ptr) (ptr)
+ #define Ppmd7_GetStats(p, ctx) ((ctx)->Stats)
+#else
+ #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
+ #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
+ #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
+#endif
+
+void Ppmd7_Update1(CPpmd7 *p);
+void Ppmd7_Update1_0(CPpmd7 *p);
+void Ppmd7_Update2(CPpmd7 *p);
+void Ppmd7_UpdateBin(CPpmd7 *p);
+
+#define Ppmd7_GetBinSumm(p) \
+ &p->BinSumm[(size_t)(unsigned)Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \
+ p->NS2BSIndx[(size_t)Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \
+ (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \
+ 2 * p->HB2Flag[(unsigned)Ppmd7Context_OneState(p->MinContext)->Symbol] + \
+ ((p->RunLength >> 26) & 0x20)]
+
+CPpmd_See *Ppmd7_MakeEscFreq(CPpmd7 *p, unsigned numMasked, UInt32 *scale);
+
+
+/* ---------- Decode ---------- */
+
+typedef struct IPpmd7_RangeDec IPpmd7_RangeDec;
+
+struct IPpmd7_RangeDec
+{
+ UInt32 (*GetThreshold)(const IPpmd7_RangeDec *p, UInt32 total);
+ void (*Decode)(const IPpmd7_RangeDec *p, UInt32 start, UInt32 size);
+ UInt32 (*DecodeBit)(const IPpmd7_RangeDec *p, UInt32 size0);
+};
+
+typedef struct
+{
+ IPpmd7_RangeDec vt;
+ UInt32 Range;
+ UInt32 Code;
+ IByteIn *Stream;
+} CPpmd7z_RangeDec;
+
+void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p);
+Bool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p);
+#define Ppmd7z_RangeDec_IsFinishedOK(p) ((p)->Code == 0)
+
+int Ppmd7_DecodeSymbol(CPpmd7 *p, const IPpmd7_RangeDec *rc);
+
+
+/* ---------- Encode ---------- */
+
+typedef struct
+{
+ UInt64 Low;
+ UInt32 Range;
+ Byte Cache;
+ UInt64 CacheSize;
+ IByteOut *Stream;
+} CPpmd7z_RangeEnc;
+
+void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p);
+void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p);
+
+void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Ppmd7Dec.c b/other-licenses/7zstub/src/C/Ppmd7Dec.c
new file mode 100644
index 0000000000..3023b6776d
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Ppmd7Dec.c
@@ -0,0 +1,191 @@
+/* Ppmd7Dec.c -- PPMdH Decoder
+2017-04-03 : Igor Pavlov : Public domain
+This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
+
+#include "Precomp.h"
+
+#include "Ppmd7.h"
+
+#define kTopValue (1 << 24)
+
+Bool Ppmd7z_RangeDec_Init(CPpmd7z_RangeDec *p)
+{
+ unsigned i;
+ p->Code = 0;
+ p->Range = 0xFFFFFFFF;
+ if (IByteIn_Read(p->Stream) != 0)
+ return False;
+ for (i = 0; i < 4; i++)
+ p->Code = (p->Code << 8) | IByteIn_Read(p->Stream);
+ return (p->Code < 0xFFFFFFFF);
+}
+
+#define GET_Ppmd7z_RangeDec CPpmd7z_RangeDec *p = CONTAINER_FROM_VTBL(pp, CPpmd7z_RangeDec, vt);
+
+static UInt32 Range_GetThreshold(const IPpmd7_RangeDec *pp, UInt32 total)
+{
+ GET_Ppmd7z_RangeDec
+ return p->Code / (p->Range /= total);
+}
+
+static void Range_Normalize(CPpmd7z_RangeDec *p)
+{
+ if (p->Range < kTopValue)
+ {
+ p->Code = (p->Code << 8) | IByteIn_Read(p->Stream);
+ p->Range <<= 8;
+ if (p->Range < kTopValue)
+ {
+ p->Code = (p->Code << 8) | IByteIn_Read(p->Stream);
+ p->Range <<= 8;
+ }
+ }
+}
+
+static void Range_Decode(const IPpmd7_RangeDec *pp, UInt32 start, UInt32 size)
+{
+ GET_Ppmd7z_RangeDec
+ p->Code -= start * p->Range;
+ p->Range *= size;
+ Range_Normalize(p);
+}
+
+static UInt32 Range_DecodeBit(const IPpmd7_RangeDec *pp, UInt32 size0)
+{
+ GET_Ppmd7z_RangeDec
+ UInt32 newBound = (p->Range >> 14) * size0;
+ UInt32 symbol;
+ if (p->Code < newBound)
+ {
+ symbol = 0;
+ p->Range = newBound;
+ }
+ else
+ {
+ symbol = 1;
+ p->Code -= newBound;
+ p->Range -= newBound;
+ }
+ Range_Normalize(p);
+ return symbol;
+}
+
+void Ppmd7z_RangeDec_CreateVTable(CPpmd7z_RangeDec *p)
+{
+ p->vt.GetThreshold = Range_GetThreshold;
+ p->vt.Decode = Range_Decode;
+ p->vt.DecodeBit = Range_DecodeBit;
+}
+
+
+#define MASK(sym) ((signed char *)charMask)[sym]
+
+int Ppmd7_DecodeSymbol(CPpmd7 *p, const IPpmd7_RangeDec *rc)
+{
+ size_t charMask[256 / sizeof(size_t)];
+ if (p->MinContext->NumStats != 1)
+ {
+ CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
+ unsigned i;
+ UInt32 count, hiCnt;
+ if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
+ {
+ Byte symbol;
+ rc->Decode(rc, 0, s->Freq);
+ p->FoundState = s;
+ symbol = s->Symbol;
+ Ppmd7_Update1_0(p);
+ return symbol;
+ }
+ p->PrevSuccess = 0;
+ i = p->MinContext->NumStats - 1;
+ do
+ {
+ if ((hiCnt += (++s)->Freq) > count)
+ {
+ Byte symbol;
+ rc->Decode(rc, hiCnt - s->Freq, s->Freq);
+ p->FoundState = s;
+ symbol = s->Symbol;
+ Ppmd7_Update1(p);
+ return symbol;
+ }
+ }
+ while (--i);
+ if (count >= p->MinContext->SummFreq)
+ return -2;
+ p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
+ rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);
+ PPMD_SetAllBitsIn256Bytes(charMask);
+ MASK(s->Symbol) = 0;
+ i = p->MinContext->NumStats - 1;
+ do { MASK((--s)->Symbol) = 0; } while (--i);
+ }
+ else
+ {
+ UInt16 *prob = Ppmd7_GetBinSumm(p);
+ if (rc->DecodeBit(rc, *prob) == 0)
+ {
+ Byte symbol;
+ *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
+ symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;
+ Ppmd7_UpdateBin(p);
+ return symbol;
+ }
+ *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
+ p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
+ PPMD_SetAllBitsIn256Bytes(charMask);
+ MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;
+ p->PrevSuccess = 0;
+ }
+ for (;;)
+ {
+ CPpmd_State *ps[256], *s;
+ UInt32 freqSum, count, hiCnt;
+ CPpmd_See *see;
+ unsigned i, num, numMasked = p->MinContext->NumStats;
+ do
+ {
+ p->OrderFall++;
+ if (!p->MinContext->Suffix)
+ return -1;
+ p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
+ }
+ while (p->MinContext->NumStats == numMasked);
+ hiCnt = 0;
+ s = Ppmd7_GetStats(p, p->MinContext);
+ i = 0;
+ num = p->MinContext->NumStats - numMasked;
+ do
+ {
+ int k = (int)(MASK(s->Symbol));
+ hiCnt += (s->Freq & k);
+ ps[i] = s++;
+ i -= k;
+ }
+ while (i != num);
+
+ see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);
+ freqSum += hiCnt;
+ count = rc->GetThreshold(rc, freqSum);
+
+ if (count < hiCnt)
+ {
+ Byte symbol;
+ CPpmd_State **pps = ps;
+ for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
+ s = *pps;
+ rc->Decode(rc, hiCnt - s->Freq, s->Freq);
+ Ppmd_See_Update(see);
+ p->FoundState = s;
+ symbol = s->Symbol;
+ Ppmd7_Update2(p);
+ return symbol;
+ }
+ if (count >= freqSum)
+ return -2;
+ rc->Decode(rc, hiCnt, freqSum - hiCnt);
+ see->Summ = (UInt16)(see->Summ + freqSum);
+ do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
+ }
+}
diff --git a/other-licenses/7zstub/src/C/Ppmd7Enc.c b/other-licenses/7zstub/src/C/Ppmd7Enc.c
new file mode 100644
index 0000000000..a74d3002b6
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Ppmd7Enc.c
@@ -0,0 +1,187 @@
+/* Ppmd7Enc.c -- PPMdH Encoder
+2017-04-03 : Igor Pavlov : Public domain
+This code is based on PPMd var.H (2001): Dmitry Shkarin : Public domain */
+
+#include "Precomp.h"
+
+#include "Ppmd7.h"
+
+#define kTopValue (1 << 24)
+
+void Ppmd7z_RangeEnc_Init(CPpmd7z_RangeEnc *p)
+{
+ p->Low = 0;
+ p->Range = 0xFFFFFFFF;
+ p->Cache = 0;
+ p->CacheSize = 1;
+}
+
+static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p)
+{
+ if ((UInt32)p->Low < (UInt32)0xFF000000 || (unsigned)(p->Low >> 32) != 0)
+ {
+ Byte temp = p->Cache;
+ do
+ {
+ IByteOut_Write(p->Stream, (Byte)(temp + (Byte)(p->Low >> 32)));
+ temp = 0xFF;
+ }
+ while (--p->CacheSize != 0);
+ p->Cache = (Byte)((UInt32)p->Low >> 24);
+ }
+ p->CacheSize++;
+ p->Low = (UInt32)p->Low << 8;
+}
+
+static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total)
+{
+ p->Low += start * (p->Range /= total);
+ p->Range *= size;
+ while (p->Range < kTopValue)
+ {
+ p->Range <<= 8;
+ RangeEnc_ShiftLow(p);
+ }
+}
+
+static void RangeEnc_EncodeBit_0(CPpmd7z_RangeEnc *p, UInt32 size0)
+{
+ p->Range = (p->Range >> 14) * size0;
+ while (p->Range < kTopValue)
+ {
+ p->Range <<= 8;
+ RangeEnc_ShiftLow(p);
+ }
+}
+
+static void RangeEnc_EncodeBit_1(CPpmd7z_RangeEnc *p, UInt32 size0)
+{
+ UInt32 newBound = (p->Range >> 14) * size0;
+ p->Low += newBound;
+ p->Range -= newBound;
+ while (p->Range < kTopValue)
+ {
+ p->Range <<= 8;
+ RangeEnc_ShiftLow(p);
+ }
+}
+
+void Ppmd7z_RangeEnc_FlushData(CPpmd7z_RangeEnc *p)
+{
+ unsigned i;
+ for (i = 0; i < 5; i++)
+ RangeEnc_ShiftLow(p);
+}
+
+
+#define MASK(sym) ((signed char *)charMask)[sym]
+
+void Ppmd7_EncodeSymbol(CPpmd7 *p, CPpmd7z_RangeEnc *rc, int symbol)
+{
+ size_t charMask[256 / sizeof(size_t)];
+ if (p->MinContext->NumStats != 1)
+ {
+ CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
+ UInt32 sum;
+ unsigned i;
+ if (s->Symbol == symbol)
+ {
+ RangeEnc_Encode(rc, 0, s->Freq, p->MinContext->SummFreq);
+ p->FoundState = s;
+ Ppmd7_Update1_0(p);
+ return;
+ }
+ p->PrevSuccess = 0;
+ sum = s->Freq;
+ i = p->MinContext->NumStats - 1;
+ do
+ {
+ if ((++s)->Symbol == symbol)
+ {
+ RangeEnc_Encode(rc, sum, s->Freq, p->MinContext->SummFreq);
+ p->FoundState = s;
+ Ppmd7_Update1(p);
+ return;
+ }
+ sum += s->Freq;
+ }
+ while (--i);
+
+ p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
+ PPMD_SetAllBitsIn256Bytes(charMask);
+ MASK(s->Symbol) = 0;
+ i = p->MinContext->NumStats - 1;
+ do { MASK((--s)->Symbol) = 0; } while (--i);
+ RangeEnc_Encode(rc, sum, p->MinContext->SummFreq - sum, p->MinContext->SummFreq);
+ }
+ else
+ {
+ UInt16 *prob = Ppmd7_GetBinSumm(p);
+ CPpmd_State *s = Ppmd7Context_OneState(p->MinContext);
+ if (s->Symbol == symbol)
+ {
+ RangeEnc_EncodeBit_0(rc, *prob);
+ *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
+ p->FoundState = s;
+ Ppmd7_UpdateBin(p);
+ return;
+ }
+ else
+ {
+ RangeEnc_EncodeBit_1(rc, *prob);
+ *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
+ p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
+ PPMD_SetAllBitsIn256Bytes(charMask);
+ MASK(s->Symbol) = 0;
+ p->PrevSuccess = 0;
+ }
+ }
+ for (;;)
+ {
+ UInt32 escFreq;
+ CPpmd_See *see;
+ CPpmd_State *s;
+ UInt32 sum;
+ unsigned i, numMasked = p->MinContext->NumStats;
+ do
+ {
+ p->OrderFall++;
+ if (!p->MinContext->Suffix)
+ return; /* EndMarker (symbol = -1) */
+ p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
+ }
+ while (p->MinContext->NumStats == numMasked);
+
+ see = Ppmd7_MakeEscFreq(p, numMasked, &escFreq);
+ s = Ppmd7_GetStats(p, p->MinContext);
+ sum = 0;
+ i = p->MinContext->NumStats;
+ do
+ {
+ int cur = s->Symbol;
+ if (cur == symbol)
+ {
+ UInt32 low = sum;
+ CPpmd_State *s1 = s;
+ do
+ {
+ sum += (s->Freq & (int)(MASK(s->Symbol)));
+ s++;
+ }
+ while (--i);
+ RangeEnc_Encode(rc, low, s1->Freq, sum + escFreq);
+ Ppmd_See_Update(see);
+ p->FoundState = s1;
+ Ppmd7_Update2(p);
+ return;
+ }
+ sum += (s->Freq & (int)(MASK(cur)));
+ MASK(cur) = 0;
+ s++;
+ }
+ while (--i);
+
+ RangeEnc_Encode(rc, sum, escFreq, sum + escFreq);
+ see->Summ = (UInt16)(see->Summ + sum + escFreq);
+ }
+}
diff --git a/other-licenses/7zstub/src/C/Precomp.h b/other-licenses/7zstub/src/C/Precomp.h
new file mode 100644
index 0000000000..edb5814439
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Precomp.h
@@ -0,0 +1,10 @@
+/* Precomp.h -- StdAfx
+2013-11-12 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_PRECOMP_H
+#define __7Z_PRECOMP_H
+
+#include "Compiler.h"
+/* #include "7zTypes.h" */
+
+#endif
diff --git a/other-licenses/7zstub/src/C/RotateDefs.h b/other-licenses/7zstub/src/C/RotateDefs.h
new file mode 100644
index 0000000000..6c790e791e
--- /dev/null
+++ b/other-licenses/7zstub/src/C/RotateDefs.h
@@ -0,0 +1,30 @@
+/* RotateDefs.h -- Rotate functions
+2015-03-25 : Igor Pavlov : Public domain */
+
+#ifndef __ROTATE_DEFS_H
+#define __ROTATE_DEFS_H
+
+#ifdef _MSC_VER
+
+#include <stdlib.h>
+
+/* don't use _rotl with MINGW. It can insert slow call to function. */
+
+/* #if (_MSC_VER >= 1200) */
+#pragma intrinsic(_rotl)
+#pragma intrinsic(_rotr)
+/* #endif */
+
+#define rotlFixed(x, n) _rotl((x), (n))
+#define rotrFixed(x, n) _rotr((x), (n))
+
+#else
+
+/* new compilers can translate these macros to fast commands. */
+
+#define rotlFixed(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
+#define rotrFixed(x, n) (((x) >> (n)) | ((x) << (32 - (n))))
+
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Sha256.c b/other-licenses/7zstub/src/C/Sha256.c
new file mode 100644
index 0000000000..90994e5abb
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Sha256.c
@@ -0,0 +1,248 @@
+/* Crypto/Sha256.c -- SHA-256 Hash
+2017-04-03 : Igor Pavlov : Public domain
+This code is based on public domain code from Wei Dai's Crypto++ library. */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "CpuArch.h"
+#include "RotateDefs.h"
+#include "Sha256.h"
+
+/* define it for speed optimization */
+#ifndef _SFX
+#define _SHA256_UNROLL
+#define _SHA256_UNROLL2
+#endif
+
+/* #define _SHA256_UNROLL2 */
+
+void Sha256_Init(CSha256 *p)
+{
+ p->state[0] = 0x6a09e667;
+ p->state[1] = 0xbb67ae85;
+ p->state[2] = 0x3c6ef372;
+ p->state[3] = 0xa54ff53a;
+ p->state[4] = 0x510e527f;
+ p->state[5] = 0x9b05688c;
+ p->state[6] = 0x1f83d9ab;
+ p->state[7] = 0x5be0cd19;
+ p->count = 0;
+}
+
+#define S0(x) (rotrFixed(x, 2) ^ rotrFixed(x,13) ^ rotrFixed(x, 22))
+#define S1(x) (rotrFixed(x, 6) ^ rotrFixed(x,11) ^ rotrFixed(x, 25))
+#define s0(x) (rotrFixed(x, 7) ^ rotrFixed(x,18) ^ (x >> 3))
+#define s1(x) (rotrFixed(x,17) ^ rotrFixed(x,19) ^ (x >> 10))
+
+#define blk0(i) (W[i])
+#define blk2(i) (W[i] += s1(W[((i)-2)&15]) + W[((i)-7)&15] + s0(W[((i)-15)&15]))
+
+#define Ch(x,y,z) (z^(x&(y^z)))
+#define Maj(x,y,z) ((x&y)|(z&(x|y)))
+
+#ifdef _SHA256_UNROLL2
+
+#define R(a,b,c,d,e,f,g,h, i) \
+ h += S1(e) + Ch(e,f,g) + K[(i)+(size_t)(j)] + (j ? blk2(i) : blk0(i)); \
+ d += h; \
+ h += S0(a) + Maj(a, b, c)
+
+#define RX_8(i) \
+ R(a,b,c,d,e,f,g,h, i); \
+ R(h,a,b,c,d,e,f,g, i+1); \
+ R(g,h,a,b,c,d,e,f, i+2); \
+ R(f,g,h,a,b,c,d,e, i+3); \
+ R(e,f,g,h,a,b,c,d, i+4); \
+ R(d,e,f,g,h,a,b,c, i+5); \
+ R(c,d,e,f,g,h,a,b, i+6); \
+ R(b,c,d,e,f,g,h,a, i+7)
+
+#define RX_16 RX_8(0); RX_8(8);
+
+#else
+
+#define a(i) T[(0-(i))&7]
+#define b(i) T[(1-(i))&7]
+#define c(i) T[(2-(i))&7]
+#define d(i) T[(3-(i))&7]
+#define e(i) T[(4-(i))&7]
+#define f(i) T[(5-(i))&7]
+#define g(i) T[(6-(i))&7]
+#define h(i) T[(7-(i))&7]
+
+#define R(i) \
+ h(i) += S1(e(i)) + Ch(e(i),f(i),g(i)) + K[(i)+(size_t)(j)] + (j ? blk2(i) : blk0(i)); \
+ d(i) += h(i); \
+ h(i) += S0(a(i)) + Maj(a(i), b(i), c(i)) \
+
+#ifdef _SHA256_UNROLL
+
+#define RX_8(i) R(i+0); R(i+1); R(i+2); R(i+3); R(i+4); R(i+5); R(i+6); R(i+7);
+#define RX_16 RX_8(0); RX_8(8);
+
+#else
+
+#define RX_16 unsigned i; for (i = 0; i < 16; i++) { R(i); }
+
+#endif
+
+#endif
+
+static const UInt32 K[64] = {
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
+ 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
+ 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
+ 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
+ 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
+ 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
+ 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
+ 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
+ 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
+};
+
+static void Sha256_WriteByteBlock(CSha256 *p)
+{
+ UInt32 W[16];
+ unsigned j;
+ UInt32 *state;
+
+ #ifdef _SHA256_UNROLL2
+ UInt32 a,b,c,d,e,f,g,h;
+ #else
+ UInt32 T[8];
+ #endif
+
+ for (j = 0; j < 16; j += 4)
+ {
+ const Byte *ccc = p->buffer + j * 4;
+ W[j ] = GetBe32(ccc);
+ W[j + 1] = GetBe32(ccc + 4);
+ W[j + 2] = GetBe32(ccc + 8);
+ W[j + 3] = GetBe32(ccc + 12);
+ }
+
+ state = p->state;
+
+ #ifdef _SHA256_UNROLL2
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+ e = state[4];
+ f = state[5];
+ g = state[6];
+ h = state[7];
+ #else
+ for (j = 0; j < 8; j++)
+ T[j] = state[j];
+ #endif
+
+ for (j = 0; j < 64; j += 16)
+ {
+ RX_16
+ }
+
+ #ifdef _SHA256_UNROLL2
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+ state[4] += e;
+ state[5] += f;
+ state[6] += g;
+ state[7] += h;
+ #else
+ for (j = 0; j < 8; j++)
+ state[j] += T[j];
+ #endif
+
+ /* Wipe variables */
+ /* memset(W, 0, sizeof(W)); */
+ /* memset(T, 0, sizeof(T)); */
+}
+
+#undef S0
+#undef S1
+#undef s0
+#undef s1
+
+void Sha256_Update(CSha256 *p, const Byte *data, size_t size)
+{
+ if (size == 0)
+ return;
+
+ {
+ unsigned pos = (unsigned)p->count & 0x3F;
+ unsigned num;
+
+ p->count += size;
+
+ num = 64 - pos;
+ if (num > size)
+ {
+ memcpy(p->buffer + pos, data, size);
+ return;
+ }
+
+ size -= num;
+ memcpy(p->buffer + pos, data, num);
+ data += num;
+ }
+
+ for (;;)
+ {
+ Sha256_WriteByteBlock(p);
+ if (size < 64)
+ break;
+ size -= 64;
+ memcpy(p->buffer, data, 64);
+ data += 64;
+ }
+
+ if (size != 0)
+ memcpy(p->buffer, data, size);
+}
+
+void Sha256_Final(CSha256 *p, Byte *digest)
+{
+ unsigned pos = (unsigned)p->count & 0x3F;
+ unsigned i;
+
+ p->buffer[pos++] = 0x80;
+
+ while (pos != (64 - 8))
+ {
+ pos &= 0x3F;
+ if (pos == 0)
+ Sha256_WriteByteBlock(p);
+ p->buffer[pos++] = 0;
+ }
+
+ {
+ UInt64 numBits = (p->count << 3);
+ SetBe32(p->buffer + 64 - 8, (UInt32)(numBits >> 32));
+ SetBe32(p->buffer + 64 - 4, (UInt32)(numBits));
+ }
+
+ Sha256_WriteByteBlock(p);
+
+ for (i = 0; i < 8; i += 2)
+ {
+ UInt32 v0 = p->state[i];
+ UInt32 v1 = p->state[i + 1];
+ SetBe32(digest , v0);
+ SetBe32(digest + 4, v1);
+ digest += 8;
+ }
+
+ Sha256_Init(p);
+}
diff --git a/other-licenses/7zstub/src/C/Sha256.h b/other-licenses/7zstub/src/C/Sha256.h
new file mode 100644
index 0000000000..7f17ccf9c9
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Sha256.h
@@ -0,0 +1,26 @@
+/* Sha256.h -- SHA-256 Hash
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __CRYPTO_SHA256_H
+#define __CRYPTO_SHA256_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+#define SHA256_DIGEST_SIZE 32
+
+typedef struct
+{
+ UInt32 state[8];
+ UInt64 count;
+ Byte buffer[64];
+} CSha256;
+
+void Sha256_Init(CSha256 *p);
+void Sha256_Update(CSha256 *p, const Byte *data, size_t size);
+void Sha256_Final(CSha256 *p, Byte *digest);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Sort.c b/other-licenses/7zstub/src/C/Sort.c
new file mode 100644
index 0000000000..73dcbf0596
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Sort.c
@@ -0,0 +1,141 @@
+/* Sort.c -- Sort functions
+2014-04-05 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "Sort.h"
+
+#define HeapSortDown(p, k, size, temp) \
+ { for (;;) { \
+ size_t s = (k << 1); \
+ if (s > size) break; \
+ if (s < size && p[s + 1] > p[s]) s++; \
+ if (temp >= p[s]) break; \
+ p[k] = p[s]; k = s; \
+ } p[k] = temp; }
+
+void HeapSort(UInt32 *p, size_t size)
+{
+ if (size <= 1)
+ return;
+ p--;
+ {
+ size_t i = size / 2;
+ do
+ {
+ UInt32 temp = p[i];
+ size_t k = i;
+ HeapSortDown(p, k, size, temp)
+ }
+ while (--i != 0);
+ }
+ /*
+ do
+ {
+ size_t k = 1;
+ UInt32 temp = p[size];
+ p[size--] = p[1];
+ HeapSortDown(p, k, size, temp)
+ }
+ while (size > 1);
+ */
+ while (size > 3)
+ {
+ UInt32 temp = p[size];
+ size_t k = (p[3] > p[2]) ? 3 : 2;
+ p[size--] = p[1];
+ p[1] = p[k];
+ HeapSortDown(p, k, size, temp)
+ }
+ {
+ UInt32 temp = p[size];
+ p[size] = p[1];
+ if (size > 2 && p[2] < temp)
+ {
+ p[1] = p[2];
+ p[2] = temp;
+ }
+ else
+ p[1] = temp;
+ }
+}
+
+void HeapSort64(UInt64 *p, size_t size)
+{
+ if (size <= 1)
+ return;
+ p--;
+ {
+ size_t i = size / 2;
+ do
+ {
+ UInt64 temp = p[i];
+ size_t k = i;
+ HeapSortDown(p, k, size, temp)
+ }
+ while (--i != 0);
+ }
+ /*
+ do
+ {
+ size_t k = 1;
+ UInt64 temp = p[size];
+ p[size--] = p[1];
+ HeapSortDown(p, k, size, temp)
+ }
+ while (size > 1);
+ */
+ while (size > 3)
+ {
+ UInt64 temp = p[size];
+ size_t k = (p[3] > p[2]) ? 3 : 2;
+ p[size--] = p[1];
+ p[1] = p[k];
+ HeapSortDown(p, k, size, temp)
+ }
+ {
+ UInt64 temp = p[size];
+ p[size] = p[1];
+ if (size > 2 && p[2] < temp)
+ {
+ p[1] = p[2];
+ p[2] = temp;
+ }
+ else
+ p[1] = temp;
+ }
+}
+
+/*
+#define HeapSortRefDown(p, vals, n, size, temp) \
+ { size_t k = n; UInt32 val = vals[temp]; for (;;) { \
+ size_t s = (k << 1); \
+ if (s > size) break; \
+ if (s < size && vals[p[s + 1]] > vals[p[s]]) s++; \
+ if (val >= vals[p[s]]) break; \
+ p[k] = p[s]; k = s; \
+ } p[k] = temp; }
+
+void HeapSortRef(UInt32 *p, UInt32 *vals, size_t size)
+{
+ if (size <= 1)
+ return;
+ p--;
+ {
+ size_t i = size / 2;
+ do
+ {
+ UInt32 temp = p[i];
+ HeapSortRefDown(p, vals, i, size, temp);
+ }
+ while (--i != 0);
+ }
+ do
+ {
+ UInt32 temp = p[size];
+ p[size--] = p[1];
+ HeapSortRefDown(p, vals, 1, size, temp);
+ }
+ while (size > 1);
+}
+*/
diff --git a/other-licenses/7zstub/src/C/Sort.h b/other-licenses/7zstub/src/C/Sort.h
new file mode 100644
index 0000000000..7209d7824d
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Sort.h
@@ -0,0 +1,18 @@
+/* Sort.h -- Sort functions
+2014-04-05 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_SORT_H
+#define __7Z_SORT_H
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+void HeapSort(UInt32 *p, size_t size);
+void HeapSort64(UInt64 *p, size_t size);
+
+/* void HeapSortRef(UInt32 *p, UInt32 *vals, size_t size); */
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Threads.c b/other-licenses/7zstub/src/C/Threads.c
new file mode 100644
index 0000000000..8fd86f224b
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Threads.c
@@ -0,0 +1,95 @@
+/* Threads.c -- multithreading library
+2017-06-26 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#ifndef UNDER_CE
+#include <process.h>
+#endif
+
+#include "Threads.h"
+
+static WRes GetError()
+{
+ DWORD res = GetLastError();
+ return res ? (WRes)res : 1;
+}
+
+static WRes HandleToWRes(HANDLE h) { return (h != NULL) ? 0 : GetError(); }
+static WRes BOOLToWRes(BOOL v) { return v ? 0 : GetError(); }
+
+WRes HandlePtr_Close(HANDLE *p)
+{
+ if (*p != NULL)
+ {
+ if (!CloseHandle(*p))
+ return GetError();
+ *p = NULL;
+ }
+ return 0;
+}
+
+WRes Handle_WaitObject(HANDLE h) { return (WRes)WaitForSingleObject(h, INFINITE); }
+
+WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param)
+{
+ /* Windows Me/98/95: threadId parameter may not be NULL in _beginthreadex/CreateThread functions */
+
+ #ifdef UNDER_CE
+
+ DWORD threadId;
+ *p = CreateThread(0, 0, func, param, 0, &threadId);
+
+ #else
+
+ unsigned threadId;
+ *p = (HANDLE)_beginthreadex(NULL, 0, func, param, 0, &threadId);
+
+ #endif
+
+ /* maybe we must use errno here, but probably GetLastError() is also OK. */
+ return HandleToWRes(*p);
+}
+
+static WRes Event_Create(CEvent *p, BOOL manualReset, int signaled)
+{
+ *p = CreateEvent(NULL, manualReset, (signaled ? TRUE : FALSE), NULL);
+ return HandleToWRes(*p);
+}
+
+WRes Event_Set(CEvent *p) { return BOOLToWRes(SetEvent(*p)); }
+WRes Event_Reset(CEvent *p) { return BOOLToWRes(ResetEvent(*p)); }
+
+WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled) { return Event_Create(p, TRUE, signaled); }
+WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled) { return Event_Create(p, FALSE, signaled); }
+WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p) { return ManualResetEvent_Create(p, 0); }
+WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p) { return AutoResetEvent_Create(p, 0); }
+
+
+WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount)
+{
+ *p = CreateSemaphore(NULL, (LONG)initCount, (LONG)maxCount, NULL);
+ return HandleToWRes(*p);
+}
+
+static WRes Semaphore_Release(CSemaphore *p, LONG releaseCount, LONG *previousCount)
+ { return BOOLToWRes(ReleaseSemaphore(*p, releaseCount, previousCount)); }
+WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num)
+ { return Semaphore_Release(p, (LONG)num, NULL); }
+WRes Semaphore_Release1(CSemaphore *p) { return Semaphore_ReleaseN(p, 1); }
+
+WRes CriticalSection_Init(CCriticalSection *p)
+{
+ /* InitializeCriticalSection can raise only STATUS_NO_MEMORY exception */
+ #ifdef _MSC_VER
+ __try
+ #endif
+ {
+ InitializeCriticalSection(p);
+ /* InitializeCriticalSectionAndSpinCount(p, 0); */
+ }
+ #ifdef _MSC_VER
+ __except (EXCEPTION_EXECUTE_HANDLER) { return 1; }
+ #endif
+ return 0;
+}
diff --git a/other-licenses/7zstub/src/C/Threads.h b/other-licenses/7zstub/src/C/Threads.h
new file mode 100644
index 0000000000..f913241aea
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Threads.h
@@ -0,0 +1,68 @@
+/* Threads.h -- multithreading library
+2017-06-18 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_THREADS_H
+#define __7Z_THREADS_H
+
+#ifdef _WIN32
+#include <windows.h>
+#endif
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+WRes HandlePtr_Close(HANDLE *h);
+WRes Handle_WaitObject(HANDLE h);
+
+typedef HANDLE CThread;
+#define Thread_Construct(p) *(p) = NULL
+#define Thread_WasCreated(p) (*(p) != NULL)
+#define Thread_Close(p) HandlePtr_Close(p)
+#define Thread_Wait(p) Handle_WaitObject(*(p))
+
+typedef
+#ifdef UNDER_CE
+ DWORD
+#else
+ unsigned
+#endif
+ THREAD_FUNC_RET_TYPE;
+
+#define THREAD_FUNC_CALL_TYPE MY_STD_CALL
+#define THREAD_FUNC_DECL THREAD_FUNC_RET_TYPE THREAD_FUNC_CALL_TYPE
+typedef THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE * THREAD_FUNC_TYPE)(void *);
+WRes Thread_Create(CThread *p, THREAD_FUNC_TYPE func, LPVOID param);
+
+typedef HANDLE CEvent;
+typedef CEvent CAutoResetEvent;
+typedef CEvent CManualResetEvent;
+#define Event_Construct(p) *(p) = NULL
+#define Event_IsCreated(p) (*(p) != NULL)
+#define Event_Close(p) HandlePtr_Close(p)
+#define Event_Wait(p) Handle_WaitObject(*(p))
+WRes Event_Set(CEvent *p);
+WRes Event_Reset(CEvent *p);
+WRes ManualResetEvent_Create(CManualResetEvent *p, int signaled);
+WRes ManualResetEvent_CreateNotSignaled(CManualResetEvent *p);
+WRes AutoResetEvent_Create(CAutoResetEvent *p, int signaled);
+WRes AutoResetEvent_CreateNotSignaled(CAutoResetEvent *p);
+
+typedef HANDLE CSemaphore;
+#define Semaphore_Construct(p) *(p) = NULL
+#define Semaphore_IsCreated(p) (*(p) != NULL)
+#define Semaphore_Close(p) HandlePtr_Close(p)
+#define Semaphore_Wait(p) Handle_WaitObject(*(p))
+WRes Semaphore_Create(CSemaphore *p, UInt32 initCount, UInt32 maxCount);
+WRes Semaphore_ReleaseN(CSemaphore *p, UInt32 num);
+WRes Semaphore_Release1(CSemaphore *p);
+
+typedef CRITICAL_SECTION CCriticalSection;
+WRes CriticalSection_Init(CCriticalSection *p);
+#define CriticalSection_Delete(p) DeleteCriticalSection(p)
+#define CriticalSection_Enter(p) EnterCriticalSection(p)
+#define CriticalSection_Leave(p) LeaveCriticalSection(p)
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Util/7z/7z.dsp b/other-licenses/7zstub/src/C/Util/7z/7z.dsp
new file mode 100644
index 0000000000..d3bf0fe00d
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/7z.dsp
@@ -0,0 +1,241 @@
+# Microsoft Developer Studio Project File - Name="7z" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=7z - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "7z.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "7z.mak" CFG="7z - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "7z - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "7z - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "7z - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W4 /WX /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /FAcs /Yu"Precomp.h" /FD /c
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\util\7zDec.exe" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "7z - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "_SZ_ALLOC_DEBUG2" /D "_SZ_NO_INT_64_A" /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Yu"Precomp.h" /FD /GZ /c
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\util\7zDec.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "7z - Win32 Release"
+# Name "7z - Win32 Debug"
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\7z.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zAlloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zAlloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zArcIn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zBuf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zBuf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zCrc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zCrcOpt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zDec.c
+# ADD CPP /D "_7ZIP_PPMD_SUPPPORT"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zFile.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zStream.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bcj2.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bcj2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bra.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bra86.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\BraIA64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\CpuArch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\CpuArch.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Delta.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Delta.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Lzma2Dec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Lzma2Dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Ppmd.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Ppmd7.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Ppmd7.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Ppmd7Dec.c
+# End Source File
+# End Group
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Compiler.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\Precomp.c
+# ADD CPP /Yc"Precomp.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\Precomp.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\7zMain.c
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/C/Util/7z/7z.dsw b/other-licenses/7zstub/src/C/Util/7z/7z.dsw
new file mode 100644
index 0000000000..23089fb79f
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/7z.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "7z"=.\7z.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/C/Util/7z/7zMain.c b/other-licenses/7zstub/src/C/Util/7z/7zMain.c
new file mode 100644
index 0000000000..82aac89eb6
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/7zMain.c
@@ -0,0 +1,686 @@
+/* 7zMain.c - Test application for 7z Decoder
+2018-04-19 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "../../CpuArch.h"
+
+#include "../../7z.h"
+#include "../../7zAlloc.h"
+#include "../../7zBuf.h"
+#include "../../7zCrc.h"
+#include "../../7zFile.h"
+#include "../../7zVersion.h"
+
+#ifndef USE_WINDOWS_FILE
+/* for mkdir */
+#ifdef _WIN32
+#include <direct.h>
+#else
+#include <sys/stat.h>
+#include <errno.h>
+#endif
+#endif
+
+
+#define kInputBufSize ((size_t)1 << 18)
+
+static const ISzAlloc g_Alloc = { SzAlloc, SzFree };
+
+
+static void Print(const char *s)
+{
+ fputs(s, stdout);
+}
+
+
+static int Buf_EnsureSize(CBuf *dest, size_t size)
+{
+ if (dest->size >= size)
+ return 1;
+ Buf_Free(dest, &g_Alloc);
+ return Buf_Create(dest, size, &g_Alloc);
+}
+
+#ifndef _WIN32
+#define _USE_UTF8
+#endif
+
+/* #define _USE_UTF8 */
+
+#ifdef _USE_UTF8
+
+#define _UTF8_START(n) (0x100 - (1 << (7 - (n))))
+
+#define _UTF8_RANGE(n) (((UInt32)1) << ((n) * 5 + 6))
+
+#define _UTF8_HEAD(n, val) ((Byte)(_UTF8_START(n) + (val >> (6 * (n)))))
+#define _UTF8_CHAR(n, val) ((Byte)(0x80 + (((val) >> (6 * (n))) & 0x3F)))
+
+static size_t Utf16_To_Utf8_Calc(const UInt16 *src, const UInt16 *srcLim)
+{
+ size_t size = 0;
+ for (;;)
+ {
+ UInt32 val;
+ if (src == srcLim)
+ return size;
+
+ size++;
+ val = *src++;
+
+ if (val < 0x80)
+ continue;
+
+ if (val < _UTF8_RANGE(1))
+ {
+ size++;
+ continue;
+ }
+
+ if (val >= 0xD800 && val < 0xDC00 && src != srcLim)
+ {
+ UInt32 c2 = *src;
+ if (c2 >= 0xDC00 && c2 < 0xE000)
+ {
+ src++;
+ size += 3;
+ continue;
+ }
+ }
+
+ size += 2;
+ }
+}
+
+static Byte *Utf16_To_Utf8(Byte *dest, const UInt16 *src, const UInt16 *srcLim)
+{
+ for (;;)
+ {
+ UInt32 val;
+ if (src == srcLim)
+ return dest;
+
+ val = *src++;
+
+ if (val < 0x80)
+ {
+ *dest++ = (char)val;
+ continue;
+ }
+
+ if (val < _UTF8_RANGE(1))
+ {
+ dest[0] = _UTF8_HEAD(1, val);
+ dest[1] = _UTF8_CHAR(0, val);
+ dest += 2;
+ continue;
+ }
+
+ if (val >= 0xD800 && val < 0xDC00 && src != srcLim)
+ {
+ UInt32 c2 = *src;
+ if (c2 >= 0xDC00 && c2 < 0xE000)
+ {
+ src++;
+ val = (((val - 0xD800) << 10) | (c2 - 0xDC00)) + 0x10000;
+ dest[0] = _UTF8_HEAD(3, val);
+ dest[1] = _UTF8_CHAR(2, val);
+ dest[2] = _UTF8_CHAR(1, val);
+ dest[3] = _UTF8_CHAR(0, val);
+ dest += 4;
+ continue;
+ }
+ }
+
+ dest[0] = _UTF8_HEAD(2, val);
+ dest[1] = _UTF8_CHAR(1, val);
+ dest[2] = _UTF8_CHAR(0, val);
+ dest += 3;
+ }
+}
+
+static SRes Utf16_To_Utf8Buf(CBuf *dest, const UInt16 *src, size_t srcLen)
+{
+ size_t destLen = Utf16_To_Utf8_Calc(src, src + srcLen);
+ destLen += 1;
+ if (!Buf_EnsureSize(dest, destLen))
+ return SZ_ERROR_MEM;
+ *Utf16_To_Utf8(dest->data, src, src + srcLen) = 0;
+ return SZ_OK;
+}
+
+#endif
+
+static SRes Utf16_To_Char(CBuf *buf, const UInt16 *s
+ #ifndef _USE_UTF8
+ , UINT codePage
+ #endif
+ )
+{
+ unsigned len = 0;
+ for (len = 0; s[len] != 0; len++);
+
+ #ifndef _USE_UTF8
+ {
+ unsigned size = len * 3 + 100;
+ if (!Buf_EnsureSize(buf, size))
+ return SZ_ERROR_MEM;
+ {
+ buf->data[0] = 0;
+ if (len != 0)
+ {
+ char defaultChar = '_';
+ BOOL defUsed;
+ unsigned numChars = 0;
+ numChars = WideCharToMultiByte(codePage, 0, s, len, (char *)buf->data, size, &defaultChar, &defUsed);
+ if (numChars == 0 || numChars >= size)
+ return SZ_ERROR_FAIL;
+ buf->data[numChars] = 0;
+ }
+ return SZ_OK;
+ }
+ }
+ #else
+ return Utf16_To_Utf8Buf(buf, s, len);
+ #endif
+}
+
+#ifdef _WIN32
+ #ifndef USE_WINDOWS_FILE
+ static UINT g_FileCodePage = CP_ACP;
+ #endif
+ #define MY_FILE_CODE_PAGE_PARAM ,g_FileCodePage
+#else
+ #define MY_FILE_CODE_PAGE_PARAM
+#endif
+
+static WRes MyCreateDir(const UInt16 *name)
+{
+ #ifdef USE_WINDOWS_FILE
+
+ return CreateDirectoryW(name, NULL) ? 0 : GetLastError();
+
+ #else
+
+ CBuf buf;
+ WRes res;
+ Buf_Init(&buf);
+ RINOK(Utf16_To_Char(&buf, name MY_FILE_CODE_PAGE_PARAM));
+
+ res =
+ #ifdef _WIN32
+ _mkdir((const char *)buf.data)
+ #else
+ mkdir((const char *)buf.data, 0777)
+ #endif
+ == 0 ? 0 : errno;
+ Buf_Free(&buf, &g_Alloc);
+ return res;
+
+ #endif
+}
+
+static WRes OutFile_OpenUtf16(CSzFile *p, const UInt16 *name)
+{
+ #ifdef USE_WINDOWS_FILE
+ return OutFile_OpenW(p, name);
+ #else
+ CBuf buf;
+ WRes res;
+ Buf_Init(&buf);
+ RINOK(Utf16_To_Char(&buf, name MY_FILE_CODE_PAGE_PARAM));
+ res = OutFile_Open(p, (const char *)buf.data);
+ Buf_Free(&buf, &g_Alloc);
+ return res;
+ #endif
+}
+
+
+static SRes PrintString(const UInt16 *s)
+{
+ CBuf buf;
+ SRes res;
+ Buf_Init(&buf);
+ res = Utf16_To_Char(&buf, s
+ #ifndef _USE_UTF8
+ , CP_OEMCP
+ #endif
+ );
+ if (res == SZ_OK)
+ Print((const char *)buf.data);
+ Buf_Free(&buf, &g_Alloc);
+ return res;
+}
+
+static void UInt64ToStr(UInt64 value, char *s, int numDigits)
+{
+ char temp[32];
+ int pos = 0;
+ do
+ {
+ temp[pos++] = (char)('0' + (unsigned)(value % 10));
+ value /= 10;
+ }
+ while (value != 0);
+
+ for (numDigits -= pos; numDigits > 0; numDigits--)
+ *s++ = ' ';
+
+ do
+ *s++ = temp[--pos];
+ while (pos);
+ *s = '\0';
+}
+
+static char *UIntToStr(char *s, unsigned value, int numDigits)
+{
+ char temp[16];
+ int pos = 0;
+ do
+ temp[pos++] = (char)('0' + (value % 10));
+ while (value /= 10);
+
+ for (numDigits -= pos; numDigits > 0; numDigits--)
+ *s++ = '0';
+
+ do
+ *s++ = temp[--pos];
+ while (pos);
+ *s = '\0';
+ return s;
+}
+
+static void UIntToStr_2(char *s, unsigned value)
+{
+ s[0] = (char)('0' + (value / 10));
+ s[1] = (char)('0' + (value % 10));
+}
+
+#define PERIOD_4 (4 * 365 + 1)
+#define PERIOD_100 (PERIOD_4 * 25 - 1)
+#define PERIOD_400 (PERIOD_100 * 4 + 1)
+
+static void ConvertFileTimeToString(const CNtfsFileTime *nt, char *s)
+{
+ unsigned year, mon, hour, min, sec;
+ Byte ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+ unsigned t;
+ UInt32 v;
+ UInt64 v64 = nt->Low | ((UInt64)nt->High << 32);
+ v64 /= 10000000;
+ sec = (unsigned)(v64 % 60); v64 /= 60;
+ min = (unsigned)(v64 % 60); v64 /= 60;
+ hour = (unsigned)(v64 % 24); v64 /= 24;
+
+ v = (UInt32)v64;
+
+ year = (unsigned)(1601 + v / PERIOD_400 * 400);
+ v %= PERIOD_400;
+
+ t = v / PERIOD_100; if (t == 4) t = 3; year += t * 100; v -= t * PERIOD_100;
+ t = v / PERIOD_4; if (t == 25) t = 24; year += t * 4; v -= t * PERIOD_4;
+ t = v / 365; if (t == 4) t = 3; year += t; v -= t * 365;
+
+ if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
+ ms[1] = 29;
+ for (mon = 0;; mon++)
+ {
+ unsigned d = ms[mon];
+ if (v < d)
+ break;
+ v -= d;
+ }
+ s = UIntToStr(s, year, 4); *s++ = '-';
+ UIntToStr_2(s, mon + 1); s[2] = '-'; s += 3;
+ UIntToStr_2(s, (unsigned)v + 1); s[2] = ' '; s += 3;
+ UIntToStr_2(s, hour); s[2] = ':'; s += 3;
+ UIntToStr_2(s, min); s[2] = ':'; s += 3;
+ UIntToStr_2(s, sec); s[2] = 0;
+}
+
+static void PrintLF()
+{
+ Print("\n");
+}
+
+static void PrintError(char *s)
+{
+ Print("\nERROR: ");
+ Print(s);
+ PrintLF();
+}
+
+static void GetAttribString(UInt32 wa, Bool isDir, char *s)
+{
+ #ifdef USE_WINDOWS_FILE
+ s[0] = (char)(((wa & FILE_ATTRIBUTE_DIRECTORY) != 0 || isDir) ? 'D' : '.');
+ s[1] = (char)(((wa & FILE_ATTRIBUTE_READONLY ) != 0) ? 'R': '.');
+ s[2] = (char)(((wa & FILE_ATTRIBUTE_HIDDEN ) != 0) ? 'H': '.');
+ s[3] = (char)(((wa & FILE_ATTRIBUTE_SYSTEM ) != 0) ? 'S': '.');
+ s[4] = (char)(((wa & FILE_ATTRIBUTE_ARCHIVE ) != 0) ? 'A': '.');
+ s[5] = 0;
+ #else
+ s[0] = (char)(((wa & (1 << 4)) != 0 || isDir) ? 'D' : '.');
+ s[1] = 0;
+ #endif
+}
+
+
+// #define NUM_PARENTS_MAX 128
+
+int MY_CDECL main(int numargs, char *args[])
+{
+ ISzAlloc allocImp;
+ ISzAlloc allocTempImp;
+
+ CFileInStream archiveStream;
+ CLookToRead2 lookStream;
+ CSzArEx db;
+ SRes res;
+ UInt16 *temp = NULL;
+ size_t tempSize = 0;
+ // UInt32 parents[NUM_PARENTS_MAX];
+
+ Print("\n7z Decoder " MY_VERSION_CPU " : " MY_COPYRIGHT_DATE "\n\n");
+
+ if (numargs == 1)
+ {
+ Print(
+ "Usage: 7zDec <command> <archive_name>\n\n"
+ "<Commands>\n"
+ " e: Extract files from archive (without using directory names)\n"
+ " l: List contents of archive\n"
+ " t: Test integrity of archive\n"
+ " x: eXtract files with full paths\n");
+ return 0;
+ }
+
+ if (numargs < 3)
+ {
+ PrintError("incorrect command");
+ return 1;
+ }
+
+ #if defined(_WIN32) && !defined(USE_WINDOWS_FILE) && !defined(UNDER_CE)
+ g_FileCodePage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
+ #endif
+
+
+ allocImp = g_Alloc;
+ allocTempImp = g_Alloc;
+
+ #ifdef UNDER_CE
+ if (InFile_OpenW(&archiveStream.file, L"\test.7z"))
+ #else
+ if (InFile_Open(&archiveStream.file, args[2]))
+ #endif
+ {
+ PrintError("can not open input file");
+ return 1;
+ }
+
+ FileInStream_CreateVTable(&archiveStream);
+ LookToRead2_CreateVTable(&lookStream, False);
+ lookStream.buf = NULL;
+
+ res = SZ_OK;
+
+ {
+ lookStream.buf = ISzAlloc_Alloc(&allocImp, kInputBufSize);
+ if (!lookStream.buf)
+ res = SZ_ERROR_MEM;
+ else
+ {
+ lookStream.bufSize = kInputBufSize;
+ lookStream.realStream = &archiveStream.vt;
+ LookToRead2_Init(&lookStream);
+ }
+ }
+
+ CrcGenerateTable();
+
+ SzArEx_Init(&db);
+
+ if (res == SZ_OK)
+ {
+ res = SzArEx_Open(&db, &lookStream.vt, &allocImp, &allocTempImp);
+ }
+
+ if (res == SZ_OK)
+ {
+ char *command = args[1];
+ int listCommand = 0, testCommand = 0, fullPaths = 0;
+
+ if (strcmp(command, "l") == 0) listCommand = 1;
+ else if (strcmp(command, "t") == 0) testCommand = 1;
+ else if (strcmp(command, "e") == 0) { }
+ else if (strcmp(command, "x") == 0) { fullPaths = 1; }
+ else
+ {
+ PrintError("incorrect command");
+ res = SZ_ERROR_FAIL;
+ }
+
+ if (res == SZ_OK)
+ {
+ UInt32 i;
+
+ /*
+ if you need cache, use these 3 variables.
+ if you use external function, you can make these variable as static.
+ */
+ UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */
+ Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */
+ size_t outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */
+
+ for (i = 0; i < db.NumFiles; i++)
+ {
+ size_t offset = 0;
+ size_t outSizeProcessed = 0;
+ // const CSzFileItem *f = db.Files + i;
+ size_t len;
+ unsigned isDir = SzArEx_IsDir(&db, i);
+ if (listCommand == 0 && isDir && !fullPaths)
+ continue;
+ len = SzArEx_GetFileNameUtf16(&db, i, NULL);
+ // len = SzArEx_GetFullNameLen(&db, i);
+
+ if (len > tempSize)
+ {
+ SzFree(NULL, temp);
+ tempSize = len;
+ temp = (UInt16 *)SzAlloc(NULL, tempSize * sizeof(temp[0]));
+ if (!temp)
+ {
+ res = SZ_ERROR_MEM;
+ break;
+ }
+ }
+
+ SzArEx_GetFileNameUtf16(&db, i, temp);
+ /*
+ if (SzArEx_GetFullNameUtf16_Back(&db, i, temp + len) != temp)
+ {
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+ */
+
+ if (listCommand)
+ {
+ char attr[8], s[32], t[32];
+ UInt64 fileSize;
+
+ GetAttribString(SzBitWithVals_Check(&db.Attribs, i) ? db.Attribs.Vals[i] : 0, isDir, attr);
+
+ fileSize = SzArEx_GetFileSize(&db, i);
+ UInt64ToStr(fileSize, s, 10);
+
+ if (SzBitWithVals_Check(&db.MTime, i))
+ ConvertFileTimeToString(&db.MTime.Vals[i], t);
+ else
+ {
+ size_t j;
+ for (j = 0; j < 19; j++)
+ t[j] = ' ';
+ t[j] = '\0';
+ }
+
+ Print(t);
+ Print(" ");
+ Print(attr);
+ Print(" ");
+ Print(s);
+ Print(" ");
+ res = PrintString(temp);
+ if (res != SZ_OK)
+ break;
+ if (isDir)
+ Print("/");
+ PrintLF();
+ continue;
+ }
+
+ Print(testCommand ?
+ "Testing ":
+ "Extracting ");
+ res = PrintString(temp);
+ if (res != SZ_OK)
+ break;
+
+ if (isDir)
+ Print("/");
+ else
+ {
+ res = SzArEx_Extract(&db, &lookStream.vt, i,
+ &blockIndex, &outBuffer, &outBufferSize,
+ &offset, &outSizeProcessed,
+ &allocImp, &allocTempImp);
+ if (res != SZ_OK)
+ break;
+ }
+
+ if (!testCommand)
+ {
+ CSzFile outFile;
+ size_t processedSize;
+ size_t j;
+ UInt16 *name = (UInt16 *)temp;
+ const UInt16 *destPath = (const UInt16 *)name;
+
+ for (j = 0; name[j] != 0; j++)
+ if (name[j] == '/')
+ {
+ if (fullPaths)
+ {
+ name[j] = 0;
+ MyCreateDir(name);
+ name[j] = CHAR_PATH_SEPARATOR;
+ }
+ else
+ destPath = name + j + 1;
+ }
+
+ if (isDir)
+ {
+ MyCreateDir(destPath);
+ PrintLF();
+ continue;
+ }
+ else if (OutFile_OpenUtf16(&outFile, destPath))
+ {
+ PrintError("can not open output file");
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+
+ processedSize = outSizeProcessed;
+
+ if (File_Write(&outFile, outBuffer + offset, &processedSize) != 0 || processedSize != outSizeProcessed)
+ {
+ PrintError("can not write output file");
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+
+ #ifdef USE_WINDOWS_FILE
+ {
+ FILETIME mtime, ctime;
+ FILETIME *mtimePtr = NULL;
+ FILETIME *ctimePtr = NULL;
+
+ if (SzBitWithVals_Check(&db.MTime, i))
+ {
+ const CNtfsFileTime *t = &db.MTime.Vals[i];
+ mtime.dwLowDateTime = (DWORD)(t->Low);
+ mtime.dwHighDateTime = (DWORD)(t->High);
+ mtimePtr = &mtime;
+ }
+ if (SzBitWithVals_Check(&db.CTime, i))
+ {
+ const CNtfsFileTime *t = &db.CTime.Vals[i];
+ ctime.dwLowDateTime = (DWORD)(t->Low);
+ ctime.dwHighDateTime = (DWORD)(t->High);
+ ctimePtr = &ctime;
+ }
+ if (mtimePtr || ctimePtr)
+ SetFileTime(outFile.handle, ctimePtr, NULL, mtimePtr);
+ }
+ #endif
+
+ if (File_Close(&outFile))
+ {
+ PrintError("can not close output file");
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+
+ #ifdef USE_WINDOWS_FILE
+ if (SzBitWithVals_Check(&db.Attribs, i))
+ {
+ UInt32 attrib = db.Attribs.Vals[i];
+ /* p7zip stores posix attributes in high 16 bits and adds 0x8000 as marker.
+ We remove posix bits, if we detect posix mode field */
+ if ((attrib & 0xF0000000) != 0)
+ attrib &= 0x7FFF;
+ SetFileAttributesW(destPath, attrib);
+ }
+ #endif
+ }
+ PrintLF();
+ }
+ ISzAlloc_Free(&allocImp, outBuffer);
+ }
+ }
+
+ SzFree(NULL, temp);
+ SzArEx_Free(&db, &allocImp);
+ ISzAlloc_Free(&allocImp, lookStream.buf);
+
+ File_Close(&archiveStream.file);
+
+ if (res == SZ_OK)
+ {
+ Print("\nEverything is Ok\n");
+ return 0;
+ }
+
+ if (res == SZ_ERROR_UNSUPPORTED)
+ PrintError("decoder doesn't support this archive");
+ else if (res == SZ_ERROR_MEM)
+ PrintError("can not allocate memory");
+ else if (res == SZ_ERROR_CRC)
+ PrintError("CRC error");
+ else
+ {
+ char s[32];
+ UInt64ToStr(res, s, 0);
+ PrintError(s);
+ }
+
+ return 1;
+}
diff --git a/other-licenses/7zstub/src/C/Util/7z/Precomp.c b/other-licenses/7zstub/src/C/Util/7z/Precomp.c
new file mode 100644
index 0000000000..34b60f8fc1
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/Precomp.c
@@ -0,0 +1,4 @@
+/* Precomp.c -- StdAfx
+2013-01-21 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
diff --git a/other-licenses/7zstub/src/C/Util/7z/Precomp.h b/other-licenses/7zstub/src/C/Util/7z/Precomp.h
new file mode 100644
index 0000000000..9f398d08fd
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/Precomp.h
@@ -0,0 +1,10 @@
+/* Precomp.h -- StdAfx
+2013-06-16 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_PRECOMP_H
+#define __7Z_PRECOMP_H
+
+#include "../../Compiler.h"
+#include "../../7zTypes.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Util/7z/makefile b/other-licenses/7zstub/src/C/Util/7z/makefile
new file mode 100644
index 0000000000..f4a54af73e
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/makefile
@@ -0,0 +1,40 @@
+CFLAGS = $(CFLAGS) -D_7ZIP_PPMD_SUPPPORT
+
+PROG = 7zDec.exe
+
+C_OBJS = \
+ $O\7zAlloc.obj \
+ $O\7zBuf.obj \
+ $O\7zCrc.obj \
+ $O\7zCrcOpt.obj \
+ $O\7zFile.obj \
+ $O\7zDec.obj \
+ $O\7zArcIn.obj \
+ $O\7zStream.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\Lzma2Dec.obj \
+ $O\LzmaDec.obj \
+ $O\Ppmd7.obj \
+ $O\Ppmd7Dec.obj \
+
+7Z_OBJS = \
+ $O\7zMain.obj \
+
+OBJS = \
+ $O\Precomp.obj \
+ $(7Z_OBJS) \
+ $(C_OBJS) \
+
+!include "../../../CPP/Build.mak"
+
+$(7Z_OBJS): $(*B).c
+ $(CCOMPL_USE)
+$(C_OBJS): ../../$(*B).c
+ $(CCOMPL_USE)
+$O\Precomp.obj: Precomp.c
+ $(CCOMPL_PCH)
diff --git a/other-licenses/7zstub/src/C/Util/7z/makefile.gcc b/other-licenses/7zstub/src/C/Util/7z/makefile.gcc
new file mode 100644
index 0000000000..f707935aa9
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/7z/makefile.gcc
@@ -0,0 +1,75 @@
+PROG = 7zDec
+CXX = gcc
+LIB =
+RM = rm -f
+CFLAGS = -c -O2 -Wall
+
+OBJS = 7zMain.o 7zAlloc.o 7zArcIn.o 7zBuf.o 7zBuf2.o 7zCrc.o 7zCrcOpt.o 7zDec.o CpuArch.o Delta.o LzmaDec.o Lzma2Dec.o Bra.o Bra86.o BraIA64.o Bcj2.o Ppmd7.o Ppmd7Dec.o 7zFile.o 7zStream.o
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB)
+
+7zMain.o: 7zMain.c
+ $(CXX) $(CFLAGS) 7zMain.c
+
+7zAlloc.o: ../../7zAlloc.c
+ $(CXX) $(CFLAGS) ../../7zAlloc.c
+
+7zArcIn.o: ../../7zArcIn.c
+ $(CXX) $(CFLAGS) ../../7zArcIn.c
+
+7zBuf.o: ../../7zBuf.c
+ $(CXX) $(CFLAGS) ../../7zBuf.c
+
+7zBuf2.o: ../../7zBuf2.c
+ $(CXX) $(CFLAGS) ../../7zBuf2.c
+
+7zCrc.o: ../../7zCrc.c
+ $(CXX) $(CFLAGS) ../../7zCrc.c
+
+7zCrcOpt.o: ../../7zCrc.c
+ $(CXX) $(CFLAGS) ../../7zCrcOpt.c
+
+7zDec.o: ../../7zDec.c
+ $(CXX) $(CFLAGS) -D_7ZIP_PPMD_SUPPPORT ../../7zDec.c
+
+CpuArch.o: ../../CpuArch.c
+ $(CXX) $(CFLAGS) ../../CpuArch.c
+
+Delta.o: ../../Delta.c
+ $(CXX) $(CFLAGS) ../../Delta.c
+
+LzmaDec.o: ../../LzmaDec.c
+ $(CXX) $(CFLAGS) ../../LzmaDec.c
+
+Lzma2Dec.o: ../../Lzma2Dec.c
+ $(CXX) $(CFLAGS) ../../Lzma2Dec.c
+
+Bra.o: ../../Bra.c
+ $(CXX) $(CFLAGS) ../../Bra.c
+
+Bra86.o: ../../Bra86.c
+ $(CXX) $(CFLAGS) ../../Bra86.c
+
+BraIA64.o: ../../BraIA64.c
+ $(CXX) $(CFLAGS) ../../BraIA64.c
+
+Bcj2.o: ../../Bcj2.c
+ $(CXX) $(CFLAGS) ../../Bcj2.c
+
+Ppmd7.o: ../../Ppmd7.c
+ $(CXX) $(CFLAGS) ../../Ppmd7.c
+
+Ppmd7Dec.o: ../../Ppmd7Dec.c
+ $(CXX) $(CFLAGS) ../../Ppmd7Dec.c
+
+7zFile.o: ../../7zFile.c
+ $(CXX) $(CFLAGS) ../../7zFile.c
+
+7zStream.o: ../../7zStream.c
+ $(CXX) $(CFLAGS) ../../7zStream.c
+
+clean:
+ -$(RM) $(PROG) $(OBJS)
diff --git a/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.c b/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.c
new file mode 100644
index 0000000000..cf88c7778f
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.c
@@ -0,0 +1,258 @@
+/* LzmaUtil.c -- Test application for LZMA compression
+2017-04-27 : Igor Pavlov : Public domain */
+
+#include "../../Precomp.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../../CpuArch.h"
+
+#include "../../Alloc.h"
+#include "../../7zFile.h"
+#include "../../7zVersion.h"
+#include "../../LzmaDec.h"
+#include "../../LzmaEnc.h"
+
+static const char * const kCantReadMessage = "Can not read input file";
+static const char * const kCantWriteMessage = "Can not write output file";
+static const char * const kCantAllocateMessage = "Can not allocate memory";
+static const char * const kDataErrorMessage = "Data error";
+
+static void PrintHelp(char *buffer)
+{
+ strcat(buffer,
+ "\nLZMA-C " MY_VERSION_CPU " : " MY_COPYRIGHT_DATE "\n\n"
+ "Usage: lzma <e|d> inputFile outputFile\n"
+ " e: encode file\n"
+ " d: decode file\n");
+}
+
+static int PrintError(char *buffer, const char *message)
+{
+ strcat(buffer, "\nError: ");
+ strcat(buffer, message);
+ strcat(buffer, "\n");
+ return 1;
+}
+
+static int PrintErrorNumber(char *buffer, SRes val)
+{
+ sprintf(buffer + strlen(buffer), "\nError code: %x\n", (unsigned)val);
+ return 1;
+}
+
+static int PrintUserError(char *buffer)
+{
+ return PrintError(buffer, "Incorrect command");
+}
+
+
+#define IN_BUF_SIZE (1 << 16)
+#define OUT_BUF_SIZE (1 << 16)
+
+
+static SRes Decode2(CLzmaDec *state, ISeqOutStream *outStream, ISeqInStream *inStream,
+ UInt64 unpackSize)
+{
+ int thereIsSize = (unpackSize != (UInt64)(Int64)-1);
+ Byte inBuf[IN_BUF_SIZE];
+ Byte outBuf[OUT_BUF_SIZE];
+ size_t inPos = 0, inSize = 0, outPos = 0;
+ LzmaDec_Init(state);
+ for (;;)
+ {
+ if (inPos == inSize)
+ {
+ inSize = IN_BUF_SIZE;
+ RINOK(inStream->Read(inStream, inBuf, &inSize));
+ inPos = 0;
+ }
+ {
+ SRes res;
+ SizeT inProcessed = inSize - inPos;
+ SizeT outProcessed = OUT_BUF_SIZE - outPos;
+ ELzmaFinishMode finishMode = LZMA_FINISH_ANY;
+ ELzmaStatus status;
+ if (thereIsSize && outProcessed > unpackSize)
+ {
+ outProcessed = (SizeT)unpackSize;
+ finishMode = LZMA_FINISH_END;
+ }
+
+ res = LzmaDec_DecodeToBuf(state, outBuf + outPos, &outProcessed,
+ inBuf + inPos, &inProcessed, finishMode, &status);
+ inPos += inProcessed;
+ outPos += outProcessed;
+ unpackSize -= outProcessed;
+
+ if (outStream)
+ if (outStream->Write(outStream, outBuf, outPos) != outPos)
+ return SZ_ERROR_WRITE;
+
+ outPos = 0;
+
+ if (res != SZ_OK || (thereIsSize && unpackSize == 0))
+ return res;
+
+ if (inProcessed == 0 && outProcessed == 0)
+ {
+ if (thereIsSize || status != LZMA_STATUS_FINISHED_WITH_MARK)
+ return SZ_ERROR_DATA;
+ return res;
+ }
+ }
+ }
+}
+
+
+static SRes Decode(ISeqOutStream *outStream, ISeqInStream *inStream)
+{
+ UInt64 unpackSize;
+ int i;
+ SRes res = 0;
+
+ CLzmaDec state;
+
+ /* header: 5 bytes of LZMA properties and 8 bytes of uncompressed size */
+ unsigned char header[LZMA_PROPS_SIZE + 8];
+
+ /* Read and parse header */
+
+ RINOK(SeqInStream_Read(inStream, header, sizeof(header)));
+
+ unpackSize = 0;
+ for (i = 0; i < 8; i++)
+ unpackSize += (UInt64)header[LZMA_PROPS_SIZE + i] << (i * 8);
+
+ LzmaDec_Construct(&state);
+ RINOK(LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc));
+ res = Decode2(&state, outStream, inStream, unpackSize);
+ LzmaDec_Free(&state, &g_Alloc);
+ return res;
+}
+
+static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, char *rs)
+{
+ CLzmaEncHandle enc;
+ SRes res;
+ CLzmaEncProps props;
+
+ UNUSED_VAR(rs);
+
+ enc = LzmaEnc_Create(&g_Alloc);
+ if (enc == 0)
+ return SZ_ERROR_MEM;
+
+ LzmaEncProps_Init(&props);
+ res = LzmaEnc_SetProps(enc, &props);
+
+ if (res == SZ_OK)
+ {
+ Byte header[LZMA_PROPS_SIZE + 8];
+ size_t headerSize = LZMA_PROPS_SIZE;
+ int i;
+
+ res = LzmaEnc_WriteProperties(enc, header, &headerSize);
+ for (i = 0; i < 8; i++)
+ header[headerSize++] = (Byte)(fileSize >> (8 * i));
+ if (outStream->Write(outStream, header, headerSize) != headerSize)
+ res = SZ_ERROR_WRITE;
+ else
+ {
+ if (res == SZ_OK)
+ res = LzmaEnc_Encode(enc, outStream, inStream, NULL, &g_Alloc, &g_Alloc);
+ }
+ }
+ LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
+ return res;
+}
+
+
+static int main2(int numArgs, const char *args[], char *rs)
+{
+ CFileSeqInStream inStream;
+ CFileOutStream outStream;
+ char c;
+ int res;
+ int encodeMode;
+ Bool useOutFile = False;
+
+ FileSeqInStream_CreateVTable(&inStream);
+ File_Construct(&inStream.file);
+
+ FileOutStream_CreateVTable(&outStream);
+ File_Construct(&outStream.file);
+
+ if (numArgs == 1)
+ {
+ PrintHelp(rs);
+ return 0;
+ }
+
+ if (numArgs < 3 || numArgs > 4 || strlen(args[1]) != 1)
+ return PrintUserError(rs);
+
+ c = args[1][0];
+ encodeMode = (c == 'e' || c == 'E');
+ if (!encodeMode && c != 'd' && c != 'D')
+ return PrintUserError(rs);
+
+ {
+ size_t t4 = sizeof(UInt32);
+ size_t t8 = sizeof(UInt64);
+ if (t4 != 4 || t8 != 8)
+ return PrintError(rs, "Incorrect UInt32 or UInt64");
+ }
+
+ if (InFile_Open(&inStream.file, args[2]) != 0)
+ return PrintError(rs, "Can not open input file");
+
+ if (numArgs > 3)
+ {
+ useOutFile = True;
+ if (OutFile_Open(&outStream.file, args[3]) != 0)
+ return PrintError(rs, "Can not open output file");
+ }
+ else if (encodeMode)
+ PrintUserError(rs);
+
+ if (encodeMode)
+ {
+ UInt64 fileSize;
+ File_GetLength(&inStream.file, &fileSize);
+ res = Encode(&outStream.vt, &inStream.vt, fileSize, rs);
+ }
+ else
+ {
+ res = Decode(&outStream.vt, useOutFile ? &inStream.vt : NULL);
+ }
+
+ if (useOutFile)
+ File_Close(&outStream.file);
+ File_Close(&inStream.file);
+
+ if (res != SZ_OK)
+ {
+ if (res == SZ_ERROR_MEM)
+ return PrintError(rs, kCantAllocateMessage);
+ else if (res == SZ_ERROR_DATA)
+ return PrintError(rs, kDataErrorMessage);
+ else if (res == SZ_ERROR_WRITE)
+ return PrintError(rs, kCantWriteMessage);
+ else if (res == SZ_ERROR_READ)
+ return PrintError(rs, kCantReadMessage);
+ return PrintErrorNumber(rs, res);
+ }
+ return 0;
+}
+
+
+int MY_CDECL main(int numArgs, const char *args[])
+{
+ char rs[800] = { 0 };
+ int res = main2(numArgs, args, rs);
+ fputs(rs, stdout);
+ return res;
+}
diff --git a/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsp b/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsp
new file mode 100644
index 0000000000..eedde07d89
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsp
@@ -0,0 +1,168 @@
+# Microsoft Developer Studio Project File - Name="LzmaUtil" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=LzmaUtil - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "LzmaUtil.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "LzmaUtil.mak" CFG="LzmaUtil - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "LzmaUtil - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "LzmaUtil - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "LzmaUtil - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MT /W4 /WX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\util\7lzma.exe"
+
+!ELSEIF "$(CFG)" == "LzmaUtil - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W4 /WX /Gm /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\util\7lzma.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "LzmaUtil - Win32 Release"
+# Name "LzmaUtil - Win32 Debug"
+# Begin Source File
+
+SOURCE=..\..\7zFile.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zStream.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zVersion.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\CpuArch.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFind.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFindMt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFindMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzHash.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaEnc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaEnc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\LzmaUtil.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Threads.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Threads.h
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsw b/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsw
new file mode 100644
index 0000000000..f43548752f
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/Lzma/LzmaUtil.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "LzmaUtil"=.\LzmaUtil.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/C/Util/Lzma/makefile b/other-licenses/7zstub/src/C/Util/Lzma/makefile
new file mode 100644
index 0000000000..3b825f21ac
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/Lzma/makefile
@@ -0,0 +1,28 @@
+# MY_STATIC_LINK=1
+PROG = LZMAc.exe
+
+CFLAGS = $(CFLAGS) \
+
+LIB_OBJS = \
+ $O\LzmaUtil.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\LzFind.obj \
+ $O\LzFindMt.obj \
+ $O\LzmaDec.obj \
+ $O\LzmaEnc.obj \
+ $O\7zFile.obj \
+ $O\7zStream.obj \
+ $O\Threads.obj \
+
+OBJS = \
+ $(LIB_OBJS) \
+ $(C_OBJS) \
+
+!include "../../../CPP/Build.mak"
+
+$(LIB_OBJS): $(*B).c
+ $(COMPL_O2)
+$(C_OBJS): ../../$(*B).c
+ $(COMPL_O2)
diff --git a/other-licenses/7zstub/src/C/Util/Lzma/makefile.gcc b/other-licenses/7zstub/src/C/Util/Lzma/makefile.gcc
new file mode 100644
index 0000000000..12a72bb8b9
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/Lzma/makefile.gcc
@@ -0,0 +1,44 @@
+PROG = lzma
+CXX = g++
+LIB =
+RM = rm -f
+CFLAGS = -c -O2 -Wall -D_7ZIP_ST
+
+OBJS = \
+ LzmaUtil.o \
+ Alloc.o \
+ LzFind.o \
+ LzmaDec.o \
+ LzmaEnc.o \
+ 7zFile.o \
+ 7zStream.o \
+
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB) $(LIB2)
+
+LzmaUtil.o: LzmaUtil.c
+ $(CXX) $(CFLAGS) LzmaUtil.c
+
+Alloc.o: ../../Alloc.c
+ $(CXX) $(CFLAGS) ../../Alloc.c
+
+LzFind.o: ../../LzFind.c
+ $(CXX) $(CFLAGS) ../../LzFind.c
+
+LzmaDec.o: ../../LzmaDec.c
+ $(CXX) $(CFLAGS) ../../LzmaDec.c
+
+LzmaEnc.o: ../../LzmaEnc.c
+ $(CXX) $(CFLAGS) ../../LzmaEnc.c
+
+7zFile.o: ../../7zFile.c
+ $(CXX) $(CFLAGS) ../../7zFile.c
+
+7zStream.o: ../../7zStream.c
+ $(CXX) $(CFLAGS) ../../7zStream.c
+
+clean:
+ -$(RM) $(PROG) $(OBJS)
diff --git a/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.def b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.def
new file mode 100644
index 0000000000..43b9597781
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.def
@@ -0,0 +1,4 @@
+EXPORTS
+ LzmaCompress
+ LzmaUncompress
+
diff --git a/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsp b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsp
new file mode 100644
index 0000000000..0d4c981c4c
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsp
@@ -0,0 +1,178 @@
+# Microsoft Developer Studio Project File - Name="LzmaLib" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=LzmaLib - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "LzmaLib.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "LzmaLib.mak" CFG="LzmaLib - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "LzmaLib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "LzmaLib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "LzmaLib - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /Gr /MT /W3 /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"C:\Util\LZMA.dll" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "LzmaLib - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "LZMALIB_EXPORTS" /D "COMPRESS_MF_MT" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"C:\Util\LZMA.dll" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "LzmaLib - Win32 Release"
+# Name "LzmaLib - Win32 Debug"
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\LzmaLib.def
+# End Source File
+# Begin Source File
+
+SOURCE=.\LzmaLibExports.c
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\7zTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Alloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\IStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFind.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFindMt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzFindMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzHash.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaEnc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaEnc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaLib.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaLib.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Threads.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Threads.h
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsw b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsw
new file mode 100644
index 0000000000..f6c55593f5
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLib.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "LzmaLib"=.\LzmaLib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLibExports.c b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLibExports.c
new file mode 100644
index 0000000000..02600c724f
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/LzmaLib/LzmaLibExports.c
@@ -0,0 +1,14 @@
+/* LzmaLibExports.c -- LZMA library DLL Entry point
+2015-11-08 : Igor Pavlov : Public domain */
+
+#include "../../Precomp.h"
+
+#include <windows.h>
+
+BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
+{
+ UNUSED_VAR(hInstance);
+ UNUSED_VAR(dwReason);
+ UNUSED_VAR(lpReserved);
+ return TRUE;
+}
diff --git a/other-licenses/7zstub/src/C/Util/LzmaLib/makefile b/other-licenses/7zstub/src/C/Util/LzmaLib/makefile
new file mode 100644
index 0000000000..e0f311471a
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/LzmaLib/makefile
@@ -0,0 +1,34 @@
+MY_STATIC_LINK=1
+SLIB = sLZMA.lib
+PROG = LZMA.dll
+SLIBPATH = $O\$(SLIB)
+
+DEF_FILE = LzmaLib.def
+CFLAGS = $(CFLAGS) \
+
+LIB_OBJS = \
+ $O\LzmaLibExports.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\LzFind.obj \
+ $O\LzFindMt.obj \
+ $O\LzmaDec.obj \
+ $O\LzmaEnc.obj \
+ $O\LzmaLib.obj \
+ $O\Threads.obj \
+
+OBJS = \
+ $(LIB_OBJS) \
+ $(C_OBJS) \
+ $O\resource.res
+
+!include "../../../CPP/Build.mak"
+
+$(SLIBPATH): $O $(OBJS)
+ lib -out:$(SLIBPATH) $(OBJS) $(LIBS)
+
+$(LIB_OBJS): $(*B).c
+ $(COMPL_O2)
+$(C_OBJS): ../../$(*B).c
+ $(COMPL_O2)
diff --git a/other-licenses/7zstub/src/C/Util/LzmaLib/resource.rc b/other-licenses/7zstub/src/C/Util/LzmaLib/resource.rc
new file mode 100644
index 0000000000..d95e3f3583
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/LzmaLib/resource.rc
@@ -0,0 +1,3 @@
+#include "../../7zVersion.rc"
+
+MY_VERSION_INFO_DLL("LZMA library", "LZMA")
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.c b/other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.c
new file mode 100644
index 0000000000..34b60f8fc1
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.c
@@ -0,0 +1,4 @@
+/* Precomp.c -- StdAfx
+2013-01-21 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.h b/other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.h
new file mode 100644
index 0000000000..9f398d08fd
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/Precomp.h
@@ -0,0 +1,10 @@
+/* Precomp.h -- StdAfx
+2013-06-16 : Igor Pavlov : Public domain */
+
+#ifndef __7Z_PRECOMP_H
+#define __7Z_PRECOMP_H
+
+#include "../../Compiler.h"
+#include "../../7zTypes.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.c b/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.c
new file mode 100644
index 0000000000..bfbf430251
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.c
@@ -0,0 +1,640 @@
+/* SfxSetup.c - 7z SFX Setup
+2017-04-04 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#ifndef UNICODE
+#define UNICODE
+#endif
+
+#ifndef _UNICODE
+#define _UNICODE
+#endif
+
+#ifdef _CONSOLE
+#include <stdio.h>
+#endif
+
+#include "../../7z.h"
+#include "../../7zAlloc.h"
+#include "../../7zCrc.h"
+#include "../../7zFile.h"
+#include "../../CpuArch.h"
+#include "../../DllSecur.h"
+
+#define k_EXE_ExtIndex 2
+
+#define kInputBufSize ((size_t)1 << 18)
+
+static const char * const kExts[] =
+{
+ "bat"
+ , "cmd"
+ , "exe"
+ , "inf"
+ , "msi"
+ #ifdef UNDER_CE
+ , "cab"
+ #endif
+ , "html"
+ , "htm"
+};
+
+static const char * const kNames[] =
+{
+ "setup"
+ , "install"
+ , "run"
+ , "start"
+};
+
+static unsigned FindExt(const wchar_t *s, unsigned *extLen)
+{
+ unsigned len = (unsigned)wcslen(s);
+ unsigned i;
+ for (i = len; i > 0; i--)
+ {
+ if (s[i - 1] == '.')
+ {
+ *extLen = len - i;
+ return i - 1;
+ }
+ }
+ *extLen = 0;
+ return len;
+}
+
+#define MAKE_CHAR_UPPER(c) ((((c) >= 'a' && (c) <= 'z') ? (c) -= 0x20 : (c)))
+
+static unsigned FindItem(const char * const *items, unsigned num, const wchar_t *s, unsigned len)
+{
+ unsigned i;
+ for (i = 0; i < num; i++)
+ {
+ const char *item = items[i];
+ unsigned itemLen = (unsigned)strlen(item);
+ unsigned j;
+ if (len != itemLen)
+ continue;
+ for (j = 0; j < len; j++)
+ {
+ unsigned c = (Byte)item[j];
+ if (c != s[j] && MAKE_CHAR_UPPER(c) != s[j])
+ break;
+ }
+ if (j == len)
+ return i;
+ }
+ return i;
+}
+
+#ifdef _CONSOLE
+static BOOL WINAPI HandlerRoutine(DWORD ctrlType)
+{
+ UNUSED_VAR(ctrlType);
+ return TRUE;
+}
+#endif
+
+static void PrintErrorMessage(const char *message)
+{
+ #ifdef _CONSOLE
+ printf("\n7-Zip Error: %s\n", message);
+ #else
+ #ifdef UNDER_CE
+ WCHAR messageW[256 + 4];
+ unsigned i;
+ for (i = 0; i < 256 && message[i] != 0; i++)
+ messageW[i] = message[i];
+ messageW[i] = 0;
+ MessageBoxW(0, messageW, L"7-Zip Error", MB_ICONERROR);
+ #else
+ MessageBoxA(0, message, "7-Zip Error", MB_ICONERROR);
+ #endif
+ #endif
+}
+
+static WRes MyCreateDir(const WCHAR *name)
+{
+ return CreateDirectoryW(name, NULL) ? 0 : GetLastError();
+}
+
+#ifdef UNDER_CE
+#define kBufferSize (1 << 13)
+#else
+#define kBufferSize (1 << 15)
+#endif
+
+#define kSignatureSearchLimit (1 << 22)
+
+static Bool FindSignature(CSzFile *stream, UInt64 *resPos)
+{
+ Byte buf[kBufferSize];
+ size_t numPrevBytes = 0;
+ *resPos = 0;
+ for (;;)
+ {
+ size_t processed, pos;
+ if (*resPos > kSignatureSearchLimit)
+ return False;
+ processed = kBufferSize - numPrevBytes;
+ if (File_Read(stream, buf + numPrevBytes, &processed) != 0)
+ return False;
+ processed += numPrevBytes;
+ if (processed < k7zStartHeaderSize ||
+ (processed == k7zStartHeaderSize && numPrevBytes != 0))
+ return False;
+ processed -= k7zStartHeaderSize;
+ for (pos = 0; pos <= processed; pos++)
+ {
+ for (; pos <= processed && buf[pos] != '7'; pos++);
+ if (pos > processed)
+ break;
+ if (memcmp(buf + pos, k7zSignature, k7zSignatureSize) == 0)
+ if (CrcCalc(buf + pos + 12, 20) == GetUi32(buf + pos + 8))
+ {
+ *resPos += pos;
+ return True;
+ }
+ }
+ *resPos += processed;
+ numPrevBytes = k7zStartHeaderSize;
+ memmove(buf, buf + processed, k7zStartHeaderSize);
+ }
+}
+
+static Bool DoesFileOrDirExist(const WCHAR *path)
+{
+ WIN32_FIND_DATAW fd;
+ HANDLE handle;
+ handle = FindFirstFileW(path, &fd);
+ if (handle == INVALID_HANDLE_VALUE)
+ return False;
+ FindClose(handle);
+ return True;
+}
+
+static WRes RemoveDirWithSubItems(WCHAR *path)
+{
+ WIN32_FIND_DATAW fd;
+ HANDLE handle;
+ WRes res = 0;
+ size_t len = wcslen(path);
+ wcscpy(path + len, L"*");
+ handle = FindFirstFileW(path, &fd);
+ path[len] = L'\0';
+ if (handle == INVALID_HANDLE_VALUE)
+ return GetLastError();
+
+ for (;;)
+ {
+ if (wcscmp(fd.cFileName, L".") != 0 &&
+ wcscmp(fd.cFileName, L"..") != 0)
+ {
+ wcscpy(path + len, fd.cFileName);
+ if ((fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ wcscat(path, WSTRING_PATH_SEPARATOR);
+ res = RemoveDirWithSubItems(path);
+ }
+ else
+ {
+ SetFileAttributesW(path, 0);
+ if (DeleteFileW(path) == 0)
+ res = GetLastError();
+ }
+
+ if (res != 0)
+ break;
+ }
+
+ if (!FindNextFileW(handle, &fd))
+ {
+ res = GetLastError();
+ if (res == ERROR_NO_MORE_FILES)
+ res = 0;
+ break;
+ }
+ }
+
+ path[len] = L'\0';
+ FindClose(handle);
+ if (res == 0)
+ {
+ if (!RemoveDirectoryW(path))
+ res = GetLastError();
+ }
+ return res;
+}
+
+#ifdef _CONSOLE
+int MY_CDECL main()
+#else
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
+ #ifdef UNDER_CE
+ LPWSTR
+ #else
+ LPSTR
+ #endif
+ lpCmdLine, int nCmdShow)
+#endif
+{
+ CFileInStream archiveStream;
+ CLookToRead2 lookStream;
+ CSzArEx db;
+ SRes res = SZ_OK;
+ ISzAlloc allocImp;
+ ISzAlloc allocTempImp;
+ WCHAR sfxPath[MAX_PATH + 2];
+ WCHAR path[MAX_PATH * 3 + 2];
+ #ifndef UNDER_CE
+ WCHAR workCurDir[MAX_PATH + 32];
+ #endif
+ size_t pathLen;
+ DWORD winRes;
+ const wchar_t *cmdLineParams;
+ const char *errorMessage = NULL;
+ Bool useShellExecute = True;
+ DWORD exitCode = 0;
+
+ LoadSecurityDlls();
+
+ #ifdef _CONSOLE
+ SetConsoleCtrlHandler(HandlerRoutine, TRUE);
+ #else
+ UNUSED_VAR(hInstance);
+ UNUSED_VAR(hPrevInstance);
+ UNUSED_VAR(lpCmdLine);
+ UNUSED_VAR(nCmdShow);
+ #endif
+
+ CrcGenerateTable();
+
+ allocImp.Alloc = SzAlloc;
+ allocImp.Free = SzFree;
+
+ allocTempImp.Alloc = SzAllocTemp;
+ allocTempImp.Free = SzFreeTemp;
+
+ FileInStream_CreateVTable(&archiveStream);
+ LookToRead2_CreateVTable(&lookStream, False);
+ lookStream.buf = NULL;
+
+ winRes = GetModuleFileNameW(NULL, sfxPath, MAX_PATH);
+ if (winRes == 0 || winRes > MAX_PATH)
+ return 1;
+ {
+ cmdLineParams = GetCommandLineW();
+ #ifndef UNDER_CE
+ {
+ Bool quoteMode = False;
+ for (;; cmdLineParams++)
+ {
+ wchar_t c = *cmdLineParams;
+ if (c == L'\"')
+ quoteMode = !quoteMode;
+ else if (c == 0 || (c == L' ' && !quoteMode))
+ break;
+ }
+ }
+ #endif
+ }
+
+ {
+ unsigned i;
+ DWORD d;
+ winRes = GetTempPathW(MAX_PATH, path);
+ if (winRes == 0 || winRes > MAX_PATH)
+ return 1;
+ pathLen = wcslen(path);
+ d = (GetTickCount() << 12) ^ (GetCurrentThreadId() << 14) ^ GetCurrentProcessId();
+
+ for (i = 0;; i++, d += GetTickCount())
+ {
+ if (i >= 100)
+ {
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+ wcscpy(path + pathLen, L"7z");
+
+ {
+ wchar_t *s = path + wcslen(path);
+ UInt32 value = d;
+ unsigned k;
+ for (k = 0; k < 8; k++)
+ {
+ unsigned t = value & 0xF;
+ value >>= 4;
+ s[7 - k] = (wchar_t)((t < 10) ? ('0' + t) : ('A' + (t - 10)));
+ }
+ s[k] = '\0';
+ }
+
+ if (DoesFileOrDirExist(path))
+ continue;
+ if (CreateDirectoryW(path, NULL))
+ {
+ wcscat(path, WSTRING_PATH_SEPARATOR);
+ pathLen = wcslen(path);
+ break;
+ }
+ if (GetLastError() != ERROR_ALREADY_EXISTS)
+ {
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+ }
+
+ #ifndef UNDER_CE
+ wcscpy(workCurDir, path);
+ #endif
+ if (res != SZ_OK)
+ errorMessage = "Can't create temp folder";
+ }
+
+ if (res != SZ_OK)
+ {
+ if (!errorMessage)
+ errorMessage = "Error";
+ PrintErrorMessage(errorMessage);
+ return 1;
+ }
+
+ if (InFile_OpenW(&archiveStream.file, sfxPath) != 0)
+ {
+ errorMessage = "can not open input file";
+ res = SZ_ERROR_FAIL;
+ }
+ else
+ {
+ UInt64 pos = 0;
+ if (!FindSignature(&archiveStream.file, &pos))
+ res = SZ_ERROR_FAIL;
+ else if (File_Seek(&archiveStream.file, (Int64 *)&pos, SZ_SEEK_SET) != 0)
+ res = SZ_ERROR_FAIL;
+ if (res != 0)
+ errorMessage = "Can't find 7z archive";
+ }
+
+ if (res == SZ_OK)
+ {
+ lookStream.buf = ISzAlloc_Alloc(&allocImp, kInputBufSize);
+ if (!lookStream.buf)
+ res = SZ_ERROR_MEM;
+ else
+ {
+ lookStream.bufSize = kInputBufSize;
+ lookStream.realStream = &archiveStream.vt;
+ LookToRead2_Init(&lookStream);
+ }
+ }
+
+ SzArEx_Init(&db);
+
+ if (res == SZ_OK)
+ {
+ res = SzArEx_Open(&db, &lookStream.vt, &allocImp, &allocTempImp);
+ }
+
+ if (res == SZ_OK)
+ {
+ UInt32 executeFileIndex = (UInt32)(Int32)-1;
+ UInt32 minPrice = 1 << 30;
+ UInt32 i;
+ UInt32 blockIndex = 0xFFFFFFFF; /* it can have any value before first call (if outBuffer = 0) */
+ Byte *outBuffer = 0; /* it must be 0 before first call for each new archive. */
+ size_t outBufferSize = 0; /* it can have any value before first call (if outBuffer = 0) */
+
+ for (i = 0; i < db.NumFiles; i++)
+ {
+ size_t offset = 0;
+ size_t outSizeProcessed = 0;
+ WCHAR *temp;
+
+ if (SzArEx_GetFileNameUtf16(&db, i, NULL) >= MAX_PATH)
+ {
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+
+ temp = path + pathLen;
+
+ SzArEx_GetFileNameUtf16(&db, i, temp);
+ {
+ res = SzArEx_Extract(&db, &lookStream.vt, i,
+ &blockIndex, &outBuffer, &outBufferSize,
+ &offset, &outSizeProcessed,
+ &allocImp, &allocTempImp);
+ if (res != SZ_OK)
+ break;
+ }
+ {
+ CSzFile outFile;
+ size_t processedSize;
+ size_t j;
+ size_t nameStartPos = 0;
+ for (j = 0; temp[j] != 0; j++)
+ {
+ if (temp[j] == '/')
+ {
+ temp[j] = 0;
+ MyCreateDir(path);
+ temp[j] = CHAR_PATH_SEPARATOR;
+ nameStartPos = j + 1;
+ }
+ }
+
+ if (SzArEx_IsDir(&db, i))
+ {
+ MyCreateDir(path);
+ continue;
+ }
+ else
+ {
+ unsigned extLen;
+ const WCHAR *name = temp + nameStartPos;
+ unsigned len = (unsigned)wcslen(name);
+ unsigned nameLen = FindExt(temp + nameStartPos, &extLen);
+ unsigned extPrice = FindItem(kExts, sizeof(kExts) / sizeof(kExts[0]), name + len - extLen, extLen);
+ unsigned namePrice = FindItem(kNames, sizeof(kNames) / sizeof(kNames[0]), name, nameLen);
+
+ unsigned price = namePrice + extPrice * 64 + (nameStartPos == 0 ? 0 : (1 << 12));
+ if (minPrice > price)
+ {
+ minPrice = price;
+ executeFileIndex = i;
+ useShellExecute = (extPrice != k_EXE_ExtIndex);
+ }
+
+ if (DoesFileOrDirExist(path))
+ {
+ errorMessage = "Duplicate file";
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+ if (OutFile_OpenW(&outFile, path))
+ {
+ errorMessage = "Can't open output file";
+ res = SZ_ERROR_FAIL;
+ break;
+ }
+ }
+
+ processedSize = outSizeProcessed;
+ if (File_Write(&outFile, outBuffer + offset, &processedSize) != 0 || processedSize != outSizeProcessed)
+ {
+ errorMessage = "Can't write output file";
+ res = SZ_ERROR_FAIL;
+ }
+
+ #ifdef USE_WINDOWS_FILE
+ if (SzBitWithVals_Check(&db.MTime, i))
+ {
+ const CNtfsFileTime *t = db.MTime.Vals + i;
+ FILETIME mTime;
+ mTime.dwLowDateTime = t->Low;
+ mTime.dwHighDateTime = t->High;
+ SetFileTime(outFile.handle, NULL, NULL, &mTime);
+ }
+ #endif
+
+ {
+ SRes res2 = File_Close(&outFile);
+ if (res != SZ_OK)
+ break;
+ if (res2 != SZ_OK)
+ {
+ res = res2;
+ break;
+ }
+ }
+ #ifdef USE_WINDOWS_FILE
+ if (SzBitWithVals_Check(&db.Attribs, i))
+ SetFileAttributesW(path, db.Attribs.Vals[i]);
+ #endif
+ }
+ }
+
+ if (res == SZ_OK)
+ {
+ if (executeFileIndex == (UInt32)(Int32)-1)
+ {
+ errorMessage = "There is no file to execute";
+ res = SZ_ERROR_FAIL;
+ }
+ else
+ {
+ WCHAR *temp = path + pathLen;
+ UInt32 j;
+ SzArEx_GetFileNameUtf16(&db, executeFileIndex, temp);
+ for (j = 0; temp[j] != 0; j++)
+ if (temp[j] == '/')
+ temp[j] = CHAR_PATH_SEPARATOR;
+ }
+ }
+ ISzAlloc_Free(&allocImp, outBuffer);
+ }
+
+ SzArEx_Free(&db, &allocImp);
+
+ ISzAlloc_Free(&allocImp, lookStream.buf);
+
+ File_Close(&archiveStream.file);
+
+ if (res == SZ_OK)
+ {
+ HANDLE hProcess = 0;
+
+ #ifndef UNDER_CE
+ WCHAR oldCurDir[MAX_PATH + 2];
+ oldCurDir[0] = 0;
+ {
+ DWORD needLen = GetCurrentDirectory(MAX_PATH + 1, oldCurDir);
+ if (needLen == 0 || needLen > MAX_PATH)
+ oldCurDir[0] = 0;
+ SetCurrentDirectory(workCurDir);
+ }
+ #endif
+
+ if (useShellExecute)
+ {
+ SHELLEXECUTEINFO ei;
+ UINT32 executeRes;
+ BOOL success;
+
+ memset(&ei, 0, sizeof(ei));
+ ei.cbSize = sizeof(ei);
+ ei.lpFile = path;
+ ei.fMask = SEE_MASK_NOCLOSEPROCESS
+ #ifndef UNDER_CE
+ | SEE_MASK_FLAG_DDEWAIT
+ #endif
+ /* | SEE_MASK_NO_CONSOLE */
+ ;
+ if (wcslen(cmdLineParams) != 0)
+ ei.lpParameters = cmdLineParams;
+ ei.nShow = SW_SHOWNORMAL; /* SW_HIDE; */
+ success = ShellExecuteEx(&ei);
+ executeRes = (UINT32)(UINT_PTR)ei.hInstApp;
+ if (!success || (executeRes <= 32 && executeRes != 0)) /* executeRes = 0 in Windows CE */
+ res = SZ_ERROR_FAIL;
+ else
+ hProcess = ei.hProcess;
+ }
+ else
+ {
+ STARTUPINFOW si;
+ PROCESS_INFORMATION pi;
+ WCHAR cmdLine[MAX_PATH * 3];
+
+ wcscpy(cmdLine, path);
+ wcscat(cmdLine, cmdLineParams);
+ memset(&si, 0, sizeof(si));
+ si.cb = sizeof(si);
+ if (CreateProcessW(NULL, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi) == 0)
+ res = SZ_ERROR_FAIL;
+ else
+ {
+ CloseHandle(pi.hThread);
+ hProcess = pi.hProcess;
+ }
+ }
+
+ if (hProcess != 0)
+ {
+ WaitForSingleObject(hProcess, INFINITE);
+ if (!GetExitCodeProcess(hProcess, &exitCode))
+ exitCode = 1;
+ CloseHandle(hProcess);
+ }
+
+ #ifndef UNDER_CE
+ SetCurrentDirectory(oldCurDir);
+ #endif
+ }
+
+ path[pathLen] = L'\0';
+ RemoveDirWithSubItems(path);
+
+ if (res == SZ_OK)
+ return (int)exitCode;
+
+ {
+ if (res == SZ_ERROR_UNSUPPORTED)
+ errorMessage = "Decoder doesn't support this archive";
+ else if (res == SZ_ERROR_MEM)
+ errorMessage = "Can't allocate required memory";
+ else if (res == SZ_ERROR_CRC)
+ errorMessage = "CRC error";
+ else
+ {
+ if (!errorMessage)
+ errorMessage = "ERROR";
+ }
+
+ if (errorMessage)
+ PrintErrorMessage(errorMessage);
+ }
+ return 1;
+}
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsp b/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsp
new file mode 100644
index 0000000000..be9de6dec7
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsp
@@ -0,0 +1,231 @@
+# Microsoft Developer Studio Project File - Name="SfxSetup" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=SfxSetup - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SfxSetup.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SfxSetup.mak" CFG="SfxSetup - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SfxSetup - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "SfxSetup - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "SfxSetup - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W4 /WX /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Yu"Precomp.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "SfxSetup - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_UNICODE" /D "UNICODE" /Yu"Precomp.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "SfxSetup - Win32 Release"
+# Name "SfxSetup - Win32 Debug"
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\7z.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zAlloc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zAlloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zArcIn.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zBuf.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zBuf.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zCrc.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zCrcOpt.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zDec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zFile.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zFile.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zStream.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\7zTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bcj2.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bcj2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bra.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Bra86.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\BraIA64.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\CpuArch.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\CpuArch.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Delta.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Delta.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\DllSecur.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\DllSecur.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Lzma2Dec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Lzma2Dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.c
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\LzmaDec.h
+# End Source File
+# End Group
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\Precomp.c
+# ADD CPP /Yc"Precomp.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\Precomp.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\SfxSetup.c
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsw b/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsw
new file mode 100644
index 0000000000..128fcdd3e0
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/SfxSetup.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SfxSetup"=.\SfxSetup.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/makefile b/other-licenses/7zstub/src/C/Util/SfxSetup/makefile
new file mode 100644
index 0000000000..c9f59ccd3e
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/makefile
@@ -0,0 +1,37 @@
+PROG = 7zS2.sfx
+MY_FIXED = 1
+
+C_OBJS = \
+ $O\7zAlloc.obj \
+ $O\7zArcIn.obj \
+ $O\7zBuf.obj \
+ $O\7zBuf2.obj \
+ $O\7zCrc.obj \
+ $O\7zCrcOpt.obj \
+ $O\7zFile.obj \
+ $O\7zDec.obj \
+ $O\7zStream.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\DllSecur.obj \
+ $O\Lzma2Dec.obj \
+ $O\LzmaDec.obj \
+
+7Z_OBJS = \
+ $O\SfxSetup.obj \
+
+OBJS = \
+ $(7Z_OBJS) \
+ $(C_OBJS) \
+ $O\resource.res
+
+!include "../../../CPP/Build.mak"
+
+$(7Z_OBJS): $(*B).c
+ $(COMPL_O1)
+$(C_OBJS): ../../$(*B).c
+ $(COMPL_O1)
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/makefile_con b/other-licenses/7zstub/src/C/Util/SfxSetup/makefile_con
new file mode 100644
index 0000000000..6f604ed81e
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/makefile_con
@@ -0,0 +1,38 @@
+PROG = 7zS2con.sfx
+MY_FIXED = 1
+CFLAGS = $(CFLAGS) -D_CONSOLE
+
+C_OBJS = \
+ $O\7zAlloc.obj \
+ $O\7zArcIn.obj \
+ $O\7zBuf.obj \
+ $O\7zBuf2.obj \
+ $O\7zCrc.obj \
+ $O\7zCrcOpt.obj \
+ $O\7zFile.obj \
+ $O\7zDec.obj \
+ $O\7zStream.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\DllSecur.obj \
+ $O\Lzma2Dec.obj \
+ $O\LzmaDec.obj \
+
+7Z_OBJS = \
+ $O\SfxSetup.obj \
+
+OBJS = \
+ $(7Z_OBJS) \
+ $(C_OBJS) \
+ $O\resource.res
+
+!include "../../../CPP/Build.mak"
+
+$(7Z_OBJS): $(*B).c
+ $(COMPL_O1)
+$(C_OBJS): ../../$(*B).c
+ $(COMPL_O1)
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/resource.rc b/other-licenses/7zstub/src/C/Util/SfxSetup/resource.rc
new file mode 100644
index 0000000000..64f4e2ce7a
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/resource.rc
@@ -0,0 +1,5 @@
+#include "../../7zVersion.rc"
+
+MY_VERSION_INFO_APP("7z Setup SFX small", "7zS2.sfx")
+
+1 ICON "setup.ico"
diff --git a/other-licenses/7zstub/src/C/Util/SfxSetup/setup.ico b/other-licenses/7zstub/src/C/Util/SfxSetup/setup.ico
new file mode 100644
index 0000000000..dbb6ca8b47
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Util/SfxSetup/setup.ico
Binary files differ
diff --git a/other-licenses/7zstub/src/C/Xz.c b/other-licenses/7zstub/src/C/Xz.c
new file mode 100644
index 0000000000..7e061d6e7d
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Xz.c
@@ -0,0 +1,90 @@
+/* Xz.c - Xz
+2017-05-12 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "7zCrc.h"
+#include "CpuArch.h"
+#include "Xz.h"
+#include "XzCrc64.h"
+
+const Byte XZ_SIG[XZ_SIG_SIZE] = { 0xFD, '7', 'z', 'X', 'Z', 0 };
+/* const Byte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE] = { 'Y', 'Z' }; */
+
+unsigned Xz_WriteVarInt(Byte *buf, UInt64 v)
+{
+ unsigned i = 0;
+ do
+ {
+ buf[i++] = (Byte)((v & 0x7F) | 0x80);
+ v >>= 7;
+ }
+ while (v != 0);
+ buf[(size_t)i - 1] &= 0x7F;
+ return i;
+}
+
+void Xz_Construct(CXzStream *p)
+{
+ p->numBlocks = 0;
+ p->blocks = NULL;
+ p->flags = 0;
+}
+
+void Xz_Free(CXzStream *p, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, p->blocks);
+ p->numBlocks = 0;
+ p->blocks = NULL;
+}
+
+unsigned XzFlags_GetCheckSize(CXzStreamFlags f)
+{
+ unsigned t = XzFlags_GetCheckType(f);
+ return (t == 0) ? 0 : (4 << ((t - 1) / 3));
+}
+
+void XzCheck_Init(CXzCheck *p, unsigned mode)
+{
+ p->mode = mode;
+ switch (mode)
+ {
+ case XZ_CHECK_CRC32: p->crc = CRC_INIT_VAL; break;
+ case XZ_CHECK_CRC64: p->crc64 = CRC64_INIT_VAL; break;
+ case XZ_CHECK_SHA256: Sha256_Init(&p->sha); break;
+ }
+}
+
+void XzCheck_Update(CXzCheck *p, const void *data, size_t size)
+{
+ switch (p->mode)
+ {
+ case XZ_CHECK_CRC32: p->crc = CrcUpdate(p->crc, data, size); break;
+ case XZ_CHECK_CRC64: p->crc64 = Crc64Update(p->crc64, data, size); break;
+ case XZ_CHECK_SHA256: Sha256_Update(&p->sha, (const Byte *)data, size); break;
+ }
+}
+
+int XzCheck_Final(CXzCheck *p, Byte *digest)
+{
+ switch (p->mode)
+ {
+ case XZ_CHECK_CRC32:
+ SetUi32(digest, CRC_GET_DIGEST(p->crc));
+ break;
+ case XZ_CHECK_CRC64:
+ {
+ int i;
+ UInt64 v = CRC64_GET_DIGEST(p->crc64);
+ for (i = 0; i < 8; i++, v >>= 8)
+ digest[i] = (Byte)(v & 0xFF);
+ break;
+ }
+ case XZ_CHECK_SHA256:
+ Sha256_Final(&p->sha, digest);
+ break;
+ default:
+ return 0;
+ }
+ return 1;
+}
diff --git a/other-licenses/7zstub/src/C/Xz.h b/other-licenses/7zstub/src/C/Xz.h
new file mode 100644
index 0000000000..7b88f516ac
--- /dev/null
+++ b/other-licenses/7zstub/src/C/Xz.h
@@ -0,0 +1,460 @@
+/* Xz.h - Xz interface
+2018-02-28 : Igor Pavlov : Public domain */
+
+#ifndef __XZ_H
+#define __XZ_H
+
+#include "Sha256.h"
+
+EXTERN_C_BEGIN
+
+#define XZ_ID_Subblock 1
+#define XZ_ID_Delta 3
+#define XZ_ID_X86 4
+#define XZ_ID_PPC 5
+#define XZ_ID_IA64 6
+#define XZ_ID_ARM 7
+#define XZ_ID_ARMT 8
+#define XZ_ID_SPARC 9
+#define XZ_ID_LZMA2 0x21
+
+unsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value);
+unsigned Xz_WriteVarInt(Byte *buf, UInt64 v);
+
+/* ---------- xz block ---------- */
+
+#define XZ_BLOCK_HEADER_SIZE_MAX 1024
+
+#define XZ_NUM_FILTERS_MAX 4
+#define XZ_BF_NUM_FILTERS_MASK 3
+#define XZ_BF_PACK_SIZE (1 << 6)
+#define XZ_BF_UNPACK_SIZE (1 << 7)
+
+#define XZ_FILTER_PROPS_SIZE_MAX 20
+
+typedef struct
+{
+ UInt64 id;
+ UInt32 propsSize;
+ Byte props[XZ_FILTER_PROPS_SIZE_MAX];
+} CXzFilter;
+
+typedef struct
+{
+ UInt64 packSize;
+ UInt64 unpackSize;
+ Byte flags;
+ CXzFilter filters[XZ_NUM_FILTERS_MAX];
+} CXzBlock;
+
+#define XzBlock_GetNumFilters(p) (((p)->flags & XZ_BF_NUM_FILTERS_MASK) + 1)
+#define XzBlock_HasPackSize(p) (((p)->flags & XZ_BF_PACK_SIZE) != 0)
+#define XzBlock_HasUnpackSize(p) (((p)->flags & XZ_BF_UNPACK_SIZE) != 0)
+#define XzBlock_HasUnsupportedFlags(p) (((p)->flags & ~(XZ_BF_NUM_FILTERS_MASK | XZ_BF_PACK_SIZE | XZ_BF_UNPACK_SIZE)) != 0)
+
+SRes XzBlock_Parse(CXzBlock *p, const Byte *header);
+SRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, Bool *isIndex, UInt32 *headerSizeRes);
+
+/* ---------- xz stream ---------- */
+
+#define XZ_SIG_SIZE 6
+#define XZ_FOOTER_SIG_SIZE 2
+
+extern const Byte XZ_SIG[XZ_SIG_SIZE];
+
+/*
+extern const Byte XZ_FOOTER_SIG[XZ_FOOTER_SIG_SIZE];
+*/
+
+#define XZ_FOOTER_SIG_0 'Y'
+#define XZ_FOOTER_SIG_1 'Z'
+
+#define XZ_STREAM_FLAGS_SIZE 2
+#define XZ_STREAM_CRC_SIZE 4
+
+#define XZ_STREAM_HEADER_SIZE (XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE)
+#define XZ_STREAM_FOOTER_SIZE (XZ_FOOTER_SIG_SIZE + XZ_STREAM_FLAGS_SIZE + XZ_STREAM_CRC_SIZE + 4)
+
+#define XZ_CHECK_MASK 0xF
+#define XZ_CHECK_NO 0
+#define XZ_CHECK_CRC32 1
+#define XZ_CHECK_CRC64 4
+#define XZ_CHECK_SHA256 10
+
+typedef struct
+{
+ unsigned mode;
+ UInt32 crc;
+ UInt64 crc64;
+ CSha256 sha;
+} CXzCheck;
+
+void XzCheck_Init(CXzCheck *p, unsigned mode);
+void XzCheck_Update(CXzCheck *p, const void *data, size_t size);
+int XzCheck_Final(CXzCheck *p, Byte *digest);
+
+typedef UInt16 CXzStreamFlags;
+
+#define XzFlags_IsSupported(f) ((f) <= XZ_CHECK_MASK)
+#define XzFlags_GetCheckType(f) ((f) & XZ_CHECK_MASK)
+#define XzFlags_HasDataCrc32(f) (Xz_GetCheckType(f) == XZ_CHECK_CRC32)
+unsigned XzFlags_GetCheckSize(CXzStreamFlags f);
+
+SRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf);
+SRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream);
+
+typedef struct
+{
+ UInt64 unpackSize;
+ UInt64 totalSize;
+} CXzBlockSizes;
+
+typedef struct
+{
+ CXzStreamFlags flags;
+ size_t numBlocks;
+ CXzBlockSizes *blocks;
+ UInt64 startOffset;
+} CXzStream;
+
+void Xz_Construct(CXzStream *p);
+void Xz_Free(CXzStream *p, ISzAllocPtr alloc);
+
+#define XZ_SIZE_OVERFLOW ((UInt64)(Int64)-1)
+
+UInt64 Xz_GetUnpackSize(const CXzStream *p);
+UInt64 Xz_GetPackSize(const CXzStream *p);
+
+typedef struct
+{
+ size_t num;
+ size_t numAllocated;
+ CXzStream *streams;
+} CXzs;
+
+void Xzs_Construct(CXzs *p);
+void Xzs_Free(CXzs *p, ISzAllocPtr alloc);
+SRes Xzs_ReadBackward(CXzs *p, ILookInStream *inStream, Int64 *startOffset, ICompressProgress *progress, ISzAllocPtr alloc);
+
+UInt64 Xzs_GetNumBlocks(const CXzs *p);
+UInt64 Xzs_GetUnpackSize(const CXzs *p);
+
+
+// ECoderStatus values are identical to ELzmaStatus values of LZMA2 decoder
+
+typedef enum
+{
+ CODER_STATUS_NOT_SPECIFIED, /* use main error code instead */
+ CODER_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
+ CODER_STATUS_NOT_FINISHED, /* stream was not finished */
+ CODER_STATUS_NEEDS_MORE_INPUT /* you must provide more input bytes */
+} ECoderStatus;
+
+
+// ECoderFinishMode values are identical to ELzmaFinishMode
+
+typedef enum
+{
+ CODER_FINISH_ANY, /* finish at any point */
+ CODER_FINISH_END /* block must be finished at the end */
+} ECoderFinishMode;
+
+
+typedef struct _IStateCoder
+{
+ void *p;
+ void (*Free)(void *p, ISzAllocPtr alloc);
+ SRes (*SetProps)(void *p, const Byte *props, size_t propSize, ISzAllocPtr alloc);
+ void (*Init)(void *p);
+ SRes (*Code2)(void *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ int srcWasFinished, ECoderFinishMode finishMode,
+ // int *wasFinished,
+ ECoderStatus *status);
+ SizeT (*Filter)(void *p, Byte *data, SizeT size);
+} IStateCoder;
+
+
+
+#define MIXCODER_NUM_FILTERS_MAX 4
+
+typedef struct
+{
+ ISzAllocPtr alloc;
+ Byte *buf;
+ unsigned numCoders;
+
+ Byte *outBuf;
+ size_t outBufSize;
+ size_t outWritten; // is equal to lzmaDecoder.dicPos (in outBuf mode)
+ Bool wasFinished;
+ SRes res;
+ ECoderStatus status;
+ // Bool SingleBufMode;
+
+ int finished[MIXCODER_NUM_FILTERS_MAX - 1];
+ size_t pos[MIXCODER_NUM_FILTERS_MAX - 1];
+ size_t size[MIXCODER_NUM_FILTERS_MAX - 1];
+ UInt64 ids[MIXCODER_NUM_FILTERS_MAX];
+ SRes results[MIXCODER_NUM_FILTERS_MAX];
+ IStateCoder coders[MIXCODER_NUM_FILTERS_MAX];
+} CMixCoder;
+
+
+typedef enum
+{
+ XZ_STATE_STREAM_HEADER,
+ XZ_STATE_STREAM_INDEX,
+ XZ_STATE_STREAM_INDEX_CRC,
+ XZ_STATE_STREAM_FOOTER,
+ XZ_STATE_STREAM_PADDING,
+ XZ_STATE_BLOCK_HEADER,
+ XZ_STATE_BLOCK,
+ XZ_STATE_BLOCK_FOOTER
+} EXzState;
+
+
+typedef struct
+{
+ EXzState state;
+ UInt32 pos;
+ unsigned alignPos;
+ unsigned indexPreSize;
+
+ CXzStreamFlags streamFlags;
+
+ UInt32 blockHeaderSize;
+ UInt64 packSize;
+ UInt64 unpackSize;
+
+ UInt64 numBlocks; // number of finished blocks in current stream
+ UInt64 indexSize;
+ UInt64 indexPos;
+ UInt64 padSize;
+
+ UInt64 numStartedStreams;
+ UInt64 numFinishedStreams;
+ UInt64 numTotalBlocks;
+
+ UInt32 crc;
+ CMixCoder decoder;
+ CXzBlock block;
+ CXzCheck check;
+ CSha256 sha;
+
+ Bool parseMode;
+ Bool headerParsedOk;
+ Bool decodeToStreamSignature;
+ unsigned decodeOnlyOneBlock;
+
+ Byte *outBuf;
+ size_t outBufSize;
+ size_t outDataWritten; // the size of data in (outBuf) that were fully unpacked
+
+ Byte shaDigest[SHA256_DIGEST_SIZE];
+ Byte buf[XZ_BLOCK_HEADER_SIZE_MAX];
+} CXzUnpacker;
+
+/* alloc : aligned for cache line allocation is better */
+void XzUnpacker_Construct(CXzUnpacker *p, ISzAllocPtr alloc);
+void XzUnpacker_Init(CXzUnpacker *p);
+void XzUnpacker_SetOutBuf(CXzUnpacker *p, Byte *outBuf, size_t outBufSize);
+void XzUnpacker_Free(CXzUnpacker *p);
+
+/*
+ XzUnpacker
+ The sequence for decoding functions:
+ {
+ XzUnpacker_Construct()
+ [Decoding_Calls]
+ XzUnpacker_Free()
+ }
+
+ [Decoding_Calls]
+
+ There are 3 types of interfaces for [Decoding_Calls] calls:
+
+ Interface-1 : Partial output buffers:
+ {
+ XzUnpacker_Init()
+ for()
+ XzUnpacker_Code();
+ }
+
+ Interface-2 : Direct output buffer:
+ Use it, if you know exact size of decoded data, and you need
+ whole xz unpacked data in one output buffer.
+ xz unpacker doesn't allocate additional buffer for lzma2 dictionary in that mode.
+ {
+ XzUnpacker_Init()
+ XzUnpacker_SetOutBufMode(); // to set output buffer and size
+ for()
+ XzUnpacker_Code(); // (dest = NULL) in XzUnpacker_Code()
+ }
+
+ Interface-3 : Direct output buffer : One call full decoding
+ It unpacks whole input buffer to output buffer in one call.
+ It uses Interface-2 internally.
+ {
+ XzUnpacker_CodeFull()
+ }
+*/
+
+/*
+finishMode:
+ It has meaning only if the decoding reaches output limit (*destLen).
+ CODER_FINISH_ANY - use smallest number of input bytes
+ CODER_FINISH_END - read EndOfStream marker after decoding
+
+Returns:
+ SZ_OK
+ status:
+ CODER_STATUS_NOT_FINISHED,
+ CODER_STATUS_NEEDS_MORE_INPUT - maybe there are more xz streams,
+ call XzUnpacker_IsStreamWasFinished to check that current stream was finished
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_UNSUPPORTED - Unsupported method or method properties
+ SZ_ERROR_CRC - CRC error
+ // SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+
+ SZ_ERROR_NO_ARCHIVE - the error with xz Stream Header with one of the following reasons:
+ - xz Stream Signature failure
+ - CRC32 of xz Stream Header is failed
+ - The size of Stream padding is not multiple of four bytes.
+ It's possible to get that error, if xz stream was finished and the stream
+ contains some another data. In that case you can call XzUnpacker_GetExtraSize()
+ function to get real size of xz stream.
+*/
+
+
+SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, int srcFinished,
+ ECoderFinishMode finishMode, ECoderStatus *status);
+
+SRes XzUnpacker_CodeFull(CXzUnpacker *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen,
+ ECoderFinishMode finishMode, ECoderStatus *status);
+
+Bool XzUnpacker_IsStreamWasFinished(const CXzUnpacker *p);
+
+/*
+XzUnpacker_GetExtraSize() returns then number of uncofirmed bytes,
+ if it's in (XZ_STATE_STREAM_HEADER) state or in (XZ_STATE_STREAM_PADDING) state.
+These bytes can be some bytes after xz archive, or
+it can be start of new xz stream.
+
+Call XzUnpacker_GetExtraSize() after XzUnpacker_Code() function to detect real size of
+xz stream in two cases, if XzUnpacker_Code() returns:
+ res == SZ_OK && status == CODER_STATUS_NEEDS_MORE_INPUT
+ res == SZ_ERROR_NO_ARCHIVE
+*/
+
+UInt64 XzUnpacker_GetExtraSize(const CXzUnpacker *p);
+
+
+/*
+ for random block decoding:
+ XzUnpacker_Init();
+ set CXzUnpacker::streamFlags
+ XzUnpacker_PrepareToRandomBlockDecoding()
+ loop
+ {
+ XzUnpacker_Code()
+ XzUnpacker_IsBlockFinished()
+ }
+*/
+
+void XzUnpacker_PrepareToRandomBlockDecoding(CXzUnpacker *p);
+Bool XzUnpacker_IsBlockFinished(const CXzUnpacker *p);
+
+#define XzUnpacker_GetPackSizeForIndex(p) ((p)->packSize + (p)->blockHeaderSize + XzFlags_GetCheckSize((p)->streamFlags))
+
+
+
+/* ---------- Multi Threading Decoding ---------- */
+
+
+typedef struct
+{
+ size_t inBufSize_ST;
+ size_t outStep_ST;
+ Bool ignoreErrors;
+
+ #ifndef _7ZIP_ST
+ unsigned numThreads;
+ size_t inBufSize_MT;
+ size_t memUseMax;
+ #endif
+} CXzDecMtProps;
+
+void XzDecMtProps_Init(CXzDecMtProps *p);
+
+
+typedef void * CXzDecMtHandle;
+
+/*
+ alloc : XzDecMt uses CAlignOffsetAlloc for addresses allocated by (alloc).
+ allocMid : for big allocations, aligned allocation is better
+*/
+
+CXzDecMtHandle XzDecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid);
+void XzDecMt_Destroy(CXzDecMtHandle p);
+
+
+typedef struct
+{
+ Byte UnpackSize_Defined;
+ Byte NumStreams_Defined;
+ Byte NumBlocks_Defined;
+
+ Byte DataAfterEnd;
+ Byte DecodingTruncated; // Decoding was Truncated, we need only partial output data
+
+ UInt64 InSize; // pack size processed
+ UInt64 OutSize;
+
+ UInt64 NumStreams;
+ UInt64 NumBlocks;
+
+ SRes DecodeRes;
+ SRes ReadRes;
+ SRes ProgressRes;
+ SRes CombinedRes;
+ SRes CombinedRes_Type;
+
+} CXzStatInfo;
+
+void XzStatInfo_Clear(CXzStatInfo *p);
+
+/*
+XzDecMt_Decode()
+SRes:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_NO_ARCHIVE - is not xz archive
+ SZ_ERROR_ARCHIVE - Headers error
+ SZ_ERROR_DATA - Data Error
+ SZ_ERROR_CRC - CRC Error
+ SZ_ERROR_INPUT_EOF - it needs more input data
+ SZ_ERROR_WRITE - ISeqOutStream error
+ (SZ_ERROR_READ) - ISeqInStream errors
+ (SZ_ERROR_PROGRESS) - ICompressProgress errors
+ // SZ_ERROR_THREAD - error in multi-threading functions
+ MY_SRes_HRESULT_FROM_WRes(WRes_error) - error in multi-threading function
+*/
+
+SRes XzDecMt_Decode(CXzDecMtHandle p,
+ const CXzDecMtProps *props,
+ const UInt64 *outDataSize, // NULL means undefined
+ int finishMode, // 0 - partial unpacking is allowed, 1 - xz stream(s) must be finished
+ ISeqOutStream *outStream,
+ // Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ // const Byte *inData, size_t inDataSize,
+ CXzStatInfo *stat,
+ int *isMT, // 0 means that ST (Single-Thread) version was used
+ ICompressProgress *progress);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/XzCrc64.c b/other-licenses/7zstub/src/C/XzCrc64.c
new file mode 100644
index 0000000000..e9ca9ec265
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzCrc64.c
@@ -0,0 +1,86 @@
+/* XzCrc64.c -- CRC64 calculation
+2017-05-23 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "XzCrc64.h"
+#include "CpuArch.h"
+
+#define kCrc64Poly UINT64_CONST(0xC96C5795D7870F42)
+
+#ifdef MY_CPU_LE
+ #define CRC64_NUM_TABLES 4
+#else
+ #define CRC64_NUM_TABLES 5
+ #define CRC_UINT64_SWAP(v) \
+ ((v >> 56) \
+ | ((v >> 40) & ((UInt64)0xFF << 8)) \
+ | ((v >> 24) & ((UInt64)0xFF << 16)) \
+ | ((v >> 8) & ((UInt64)0xFF << 24)) \
+ | ((v << 8) & ((UInt64)0xFF << 32)) \
+ | ((v << 24) & ((UInt64)0xFF << 40)) \
+ | ((v << 40) & ((UInt64)0xFF << 48)) \
+ | ((v << 56)))
+
+ UInt64 MY_FAST_CALL XzCrc64UpdateT1_BeT4(UInt64 v, const void *data, size_t size, const UInt64 *table);
+#endif
+
+#ifndef MY_CPU_BE
+ UInt64 MY_FAST_CALL XzCrc64UpdateT4(UInt64 v, const void *data, size_t size, const UInt64 *table);
+#endif
+
+typedef UInt64 (MY_FAST_CALL *CRC64_FUNC)(UInt64 v, const void *data, size_t size, const UInt64 *table);
+
+static CRC64_FUNC g_Crc64Update;
+UInt64 g_Crc64Table[256 * CRC64_NUM_TABLES];
+
+UInt64 MY_FAST_CALL Crc64Update(UInt64 v, const void *data, size_t size)
+{
+ return g_Crc64Update(v, data, size, g_Crc64Table);
+}
+
+UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size)
+{
+ return g_Crc64Update(CRC64_INIT_VAL, data, size, g_Crc64Table) ^ CRC64_INIT_VAL;
+}
+
+void MY_FAST_CALL Crc64GenerateTable()
+{
+ UInt32 i;
+ for (i = 0; i < 256; i++)
+ {
+ UInt64 r = i;
+ unsigned j;
+ for (j = 0; j < 8; j++)
+ r = (r >> 1) ^ (kCrc64Poly & ((UInt64)0 - (r & 1)));
+ g_Crc64Table[i] = r;
+ }
+ for (i = 256; i < 256 * CRC64_NUM_TABLES; i++)
+ {
+ UInt64 r = g_Crc64Table[(size_t)i - 256];
+ g_Crc64Table[i] = g_Crc64Table[r & 0xFF] ^ (r >> 8);
+ }
+
+ #ifdef MY_CPU_LE
+
+ g_Crc64Update = XzCrc64UpdateT4;
+
+ #else
+ {
+ #ifndef MY_CPU_BE
+ UInt32 k = 1;
+ if (*(const Byte *)&k == 1)
+ g_Crc64Update = XzCrc64UpdateT4;
+ else
+ #endif
+ {
+ for (i = 256 * CRC64_NUM_TABLES - 1; i >= 256; i--)
+ {
+ UInt64 x = g_Crc64Table[(size_t)i - 256];
+ g_Crc64Table[i] = CRC_UINT64_SWAP(x);
+ }
+ g_Crc64Update = XzCrc64UpdateT1_BeT4;
+ }
+ }
+ #endif
+}
diff --git a/other-licenses/7zstub/src/C/XzCrc64.h b/other-licenses/7zstub/src/C/XzCrc64.h
new file mode 100644
index 0000000000..71b10d57e5
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzCrc64.h
@@ -0,0 +1,26 @@
+/* XzCrc64.h -- CRC64 calculation
+2013-01-18 : Igor Pavlov : Public domain */
+
+#ifndef __XZ_CRC64_H
+#define __XZ_CRC64_H
+
+#include <stddef.h>
+
+#include "7zTypes.h"
+
+EXTERN_C_BEGIN
+
+extern UInt64 g_Crc64Table[];
+
+void MY_FAST_CALL Crc64GenerateTable(void);
+
+#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF)
+#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL)
+#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
+
+UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size);
+UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/XzCrc64Opt.c b/other-licenses/7zstub/src/C/XzCrc64Opt.c
new file mode 100644
index 0000000000..9273465d47
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzCrc64Opt.c
@@ -0,0 +1,69 @@
+/* XzCrc64Opt.c -- CRC64 calculation
+2017-06-30 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include "CpuArch.h"
+
+#ifndef MY_CPU_BE
+
+#define CRC64_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
+
+UInt64 MY_FAST_CALL XzCrc64UpdateT4(UInt64 v, const void *data, size_t size, const UInt64 *table)
+{
+ const Byte *p = (const Byte *)data;
+ for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
+ v = CRC64_UPDATE_BYTE_2(v, *p);
+ for (; size >= 4; size -= 4, p += 4)
+ {
+ UInt32 d = (UInt32)v ^ *(const UInt32 *)p;
+ v = (v >> 32)
+ ^ (table + 0x300)[((d ) & 0xFF)]
+ ^ (table + 0x200)[((d >> 8) & 0xFF)]
+ ^ (table + 0x100)[((d >> 16) & 0xFF)]
+ ^ (table + 0x000)[((d >> 24))];
+ }
+ for (; size > 0; size--, p++)
+ v = CRC64_UPDATE_BYTE_2(v, *p);
+ return v;
+}
+
+#endif
+
+
+#ifndef MY_CPU_LE
+
+#define CRC_UINT64_SWAP(v) \
+ ((v >> 56) \
+ | ((v >> 40) & ((UInt64)0xFF << 8)) \
+ | ((v >> 24) & ((UInt64)0xFF << 16)) \
+ | ((v >> 8) & ((UInt64)0xFF << 24)) \
+ | ((v << 8) & ((UInt64)0xFF << 32)) \
+ | ((v << 24) & ((UInt64)0xFF << 40)) \
+ | ((v << 40) & ((UInt64)0xFF << 48)) \
+ | ((v << 56)))
+
+#define CRC64_UPDATE_BYTE_2_BE(crc, b) (table[(Byte)((crc) >> 56) ^ (b)] ^ ((crc) << 8))
+
+UInt64 MY_FAST_CALL XzCrc64UpdateT1_BeT4(UInt64 v, const void *data, size_t size, const UInt64 *table)
+{
+ const Byte *p = (const Byte *)data;
+ table += 0x100;
+ v = CRC_UINT64_SWAP(v);
+ for (; size > 0 && ((unsigned)(ptrdiff_t)p & 3) != 0; size--, p++)
+ v = CRC64_UPDATE_BYTE_2_BE(v, *p);
+ for (; size >= 4; size -= 4, p += 4)
+ {
+ UInt32 d = (UInt32)(v >> 32) ^ *(const UInt32 *)p;
+ v = (v << 32)
+ ^ (table + 0x000)[((d ) & 0xFF)]
+ ^ (table + 0x100)[((d >> 8) & 0xFF)]
+ ^ (table + 0x200)[((d >> 16) & 0xFF)]
+ ^ (table + 0x300)[((d >> 24))];
+ }
+ for (; size > 0; size--, p++)
+ v = CRC64_UPDATE_BYTE_2_BE(v, *p);
+ return CRC_UINT64_SWAP(v);
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/C/XzDec.c b/other-licenses/7zstub/src/C/XzDec.c
new file mode 100644
index 0000000000..ebf198336c
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzDec.c
@@ -0,0 +1,2773 @@
+/* XzDec.c -- Xz Decode
+2018-04-24 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+// #include <stdio.h>
+
+// #define XZ_DUMP
+
+/* #define XZ_DUMP */
+
+#ifdef XZ_DUMP
+#include <stdio.h>
+#endif
+
+// #define SHOW_DEBUG_INFO
+
+#ifdef SHOW_DEBUG_INFO
+#include <stdio.h>
+#endif
+
+#ifdef SHOW_DEBUG_INFO
+#define PRF(x) x
+#else
+#define PRF(x)
+#endif
+
+#define PRF_STR(s) PRF(printf("\n" s "\n"))
+#define PRF_STR_INT(s, d) PRF(printf("\n" s " %d\n", (unsigned)d))
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "7zCrc.h"
+#include "Alloc.h"
+#include "Bra.h"
+#include "CpuArch.h"
+#include "Delta.h"
+#include "Lzma2Dec.h"
+
+// #define USE_SUBBLOCK
+
+#ifdef USE_SUBBLOCK
+#include "Bcj3Dec.c"
+#include "SbDec.h"
+#endif
+
+#include "Xz.h"
+
+#define XZ_CHECK_SIZE_MAX 64
+
+#define CODER_BUF_SIZE ((size_t)1 << 17)
+
+unsigned Xz_ReadVarInt(const Byte *p, size_t maxSize, UInt64 *value)
+{
+ unsigned i, limit;
+ *value = 0;
+ limit = (maxSize > 9) ? 9 : (unsigned)maxSize;
+
+ for (i = 0; i < limit;)
+ {
+ Byte b = p[i];
+ *value |= (UInt64)(b & 0x7F) << (7 * i++);
+ if ((b & 0x80) == 0)
+ return (b == 0 && i != 1) ? 0 : i;
+ }
+ return 0;
+}
+
+/* ---------- BraState ---------- */
+
+#define BRA_BUF_SIZE (1 << 14)
+
+typedef struct
+{
+ size_t bufPos;
+ size_t bufConv;
+ size_t bufTotal;
+
+ int encodeMode;
+
+ UInt32 methodId;
+ UInt32 delta;
+ UInt32 ip;
+ UInt32 x86State;
+ Byte deltaState[DELTA_STATE_SIZE];
+
+ Byte buf[BRA_BUF_SIZE];
+} CBraState;
+
+static void BraState_Free(void *pp, ISzAllocPtr alloc)
+{
+ ISzAlloc_Free(alloc, pp);
+}
+
+static SRes BraState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAllocPtr alloc)
+{
+ CBraState *p = ((CBraState *)pp);
+ UNUSED_VAR(alloc);
+ p->ip = 0;
+ if (p->methodId == XZ_ID_Delta)
+ {
+ if (propSize != 1)
+ return SZ_ERROR_UNSUPPORTED;
+ p->delta = (unsigned)props[0] + 1;
+ }
+ else
+ {
+ if (propSize == 4)
+ {
+ UInt32 v = GetUi32(props);
+ switch (p->methodId)
+ {
+ case XZ_ID_PPC:
+ case XZ_ID_ARM:
+ case XZ_ID_SPARC:
+ if ((v & 3) != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ break;
+ case XZ_ID_ARMT:
+ if ((v & 1) != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ break;
+ case XZ_ID_IA64:
+ if ((v & 0xF) != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ break;
+ }
+ p->ip = v;
+ }
+ else if (propSize != 0)
+ return SZ_ERROR_UNSUPPORTED;
+ }
+ return SZ_OK;
+}
+
+static void BraState_Init(void *pp)
+{
+ CBraState *p = ((CBraState *)pp);
+ p->bufPos = p->bufConv = p->bufTotal = 0;
+ x86_Convert_Init(p->x86State);
+ if (p->methodId == XZ_ID_Delta)
+ Delta_Init(p->deltaState);
+}
+
+
+#define CASE_BRA_CONV(isa) case XZ_ID_ ## isa: size = isa ## _Convert(data, size, p->ip, p->encodeMode); break;
+
+static SizeT BraState_Filter(void *pp, Byte *data, SizeT size)
+{
+ CBraState *p = ((CBraState *)pp);
+ switch (p->methodId)
+ {
+ case XZ_ID_Delta:
+ if (p->encodeMode)
+ Delta_Encode(p->deltaState, p->delta, data, size);
+ else
+ Delta_Decode(p->deltaState, p->delta, data, size);
+ break;
+ case XZ_ID_X86:
+ size = x86_Convert(data, size, p->ip, &p->x86State, p->encodeMode);
+ break;
+ CASE_BRA_CONV(PPC)
+ CASE_BRA_CONV(IA64)
+ CASE_BRA_CONV(ARM)
+ CASE_BRA_CONV(ARMT)
+ CASE_BRA_CONV(SPARC)
+ }
+ p->ip += (UInt32)size;
+ return size;
+}
+
+
+static SRes BraState_Code2(void *pp,
+ Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, int srcWasFinished,
+ ECoderFinishMode finishMode,
+ // int *wasFinished
+ ECoderStatus *status)
+{
+ CBraState *p = ((CBraState *)pp);
+ SizeT destRem = *destLen;
+ SizeT srcRem = *srcLen;
+ UNUSED_VAR(finishMode);
+
+ *destLen = 0;
+ *srcLen = 0;
+ // *wasFinished = False;
+ *status = CODER_STATUS_NOT_FINISHED;
+
+ while (destRem > 0)
+ {
+ if (p->bufPos != p->bufConv)
+ {
+ size_t size = p->bufConv - p->bufPos;
+ if (size > destRem)
+ size = destRem;
+ memcpy(dest, p->buf + p->bufPos, size);
+ p->bufPos += size;
+ *destLen += size;
+ dest += size;
+ destRem -= size;
+ continue;
+ }
+
+ p->bufTotal -= p->bufPos;
+ memmove(p->buf, p->buf + p->bufPos, p->bufTotal);
+ p->bufPos = 0;
+ p->bufConv = 0;
+ {
+ size_t size = BRA_BUF_SIZE - p->bufTotal;
+ if (size > srcRem)
+ size = srcRem;
+ memcpy(p->buf + p->bufTotal, src, size);
+ *srcLen += size;
+ src += size;
+ srcRem -= size;
+ p->bufTotal += size;
+ }
+ if (p->bufTotal == 0)
+ break;
+
+ p->bufConv = BraState_Filter(pp, p->buf, p->bufTotal);
+
+ if (p->bufConv == 0)
+ {
+ if (!srcWasFinished)
+ break;
+ p->bufConv = p->bufTotal;
+ }
+ }
+
+ if (p->bufTotal == p->bufPos && srcRem == 0 && srcWasFinished)
+ {
+ *status = CODER_STATUS_FINISHED_WITH_MARK;
+ // *wasFinished = 1;
+ }
+
+ return SZ_OK;
+}
+
+
+SRes BraState_SetFromMethod(IStateCoder *p, UInt64 id, int encodeMode, ISzAllocPtr alloc)
+{
+ CBraState *decoder;
+ if (id < XZ_ID_Delta || id > XZ_ID_SPARC)
+ return SZ_ERROR_UNSUPPORTED;
+ decoder = p->p;
+ if (!decoder)
+ {
+ decoder = (CBraState *)ISzAlloc_Alloc(alloc, sizeof(CBraState));
+ if (!decoder)
+ return SZ_ERROR_MEM;
+ p->p = decoder;
+ p->Free = BraState_Free;
+ p->SetProps = BraState_SetProps;
+ p->Init = BraState_Init;
+ p->Code2 = BraState_Code2;
+ p->Filter = BraState_Filter;
+ }
+ decoder->methodId = (UInt32)id;
+ decoder->encodeMode = encodeMode;
+ return SZ_OK;
+}
+
+
+
+/* ---------- SbState ---------- */
+
+#ifdef USE_SUBBLOCK
+
+static void SbState_Free(void *pp, ISzAllocPtr alloc)
+{
+ CSbDec *p = (CSbDec *)pp;
+ SbDec_Free(p);
+ ISzAlloc_Free(alloc, pp);
+}
+
+static SRes SbState_SetProps(void *pp, const Byte *props, size_t propSize, ISzAllocPtr alloc)
+{
+ UNUSED_VAR(pp);
+ UNUSED_VAR(props);
+ UNUSED_VAR(alloc);
+ return (propSize == 0) ? SZ_OK : SZ_ERROR_UNSUPPORTED;
+}
+
+static void SbState_Init(void *pp)
+{
+ SbDec_Init((CSbDec *)pp);
+}
+
+static SRes SbState_Code2(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ int srcWasFinished, ECoderFinishMode finishMode,
+ // int *wasFinished
+ ECoderStatus *status)
+{
+ CSbDec *p = (CSbDec *)pp;
+ SRes res;
+ UNUSED_VAR(srcWasFinished);
+ p->dest = dest;
+ p->destLen = *destLen;
+ p->src = src;
+ p->srcLen = *srcLen;
+ p->finish = finishMode; /* change it */
+ res = SbDec_Decode((CSbDec *)pp);
+ *destLen -= p->destLen;
+ *srcLen -= p->srcLen;
+ // *wasFinished = (*destLen == 0 && *srcLen == 0); /* change it */
+ *status = (*destLen == 0 && *srcLen == 0) ?
+ CODER_STATUS_FINISHED_WITH_MARK :
+ CODER_STATUS_NOT_FINISHED;
+ return res;
+}
+
+static SRes SbState_SetFromMethod(IStateCoder *p, ISzAllocPtr alloc)
+{
+ CSbDec *decoder = (CSbDec *)p->p;
+ if (!decoder)
+ {
+ decoder = (CSbDec *)ISzAlloc_Alloc(alloc, sizeof(CSbDec));
+ if (!decoder)
+ return SZ_ERROR_MEM;
+ p->p = decoder;
+ p->Free = SbState_Free;
+ p->SetProps = SbState_SetProps;
+ p->Init = SbState_Init;
+ p->Code2 = SbState_Code2;
+ p->Filter = NULL;
+ }
+ SbDec_Construct(decoder);
+ SbDec_SetAlloc(decoder, alloc);
+ return SZ_OK;
+}
+
+#endif
+
+
+
+/* ---------- Lzma2 ---------- */
+
+typedef struct
+{
+ CLzma2Dec decoder;
+ Bool outBufMode;
+} CLzma2Dec_Spec;
+
+
+static void Lzma2State_Free(void *pp, ISzAllocPtr alloc)
+{
+ CLzma2Dec_Spec *p = (CLzma2Dec_Spec *)pp;
+ if (p->outBufMode)
+ Lzma2Dec_FreeProbs(&p->decoder, alloc);
+ else
+ Lzma2Dec_Free(&p->decoder, alloc);
+ ISzAlloc_Free(alloc, pp);
+}
+
+static SRes Lzma2State_SetProps(void *pp, const Byte *props, size_t propSize, ISzAllocPtr alloc)
+{
+ if (propSize != 1)
+ return SZ_ERROR_UNSUPPORTED;
+ {
+ CLzma2Dec_Spec *p = (CLzma2Dec_Spec *)pp;
+ if (p->outBufMode)
+ return Lzma2Dec_AllocateProbs(&p->decoder, props[0], alloc);
+ else
+ return Lzma2Dec_Allocate(&p->decoder, props[0], alloc);
+ }
+}
+
+static void Lzma2State_Init(void *pp)
+{
+ Lzma2Dec_Init(&((CLzma2Dec_Spec *)pp)->decoder);
+}
+
+
+/*
+ if (outBufMode), then (dest) is not used. Use NULL.
+ Data is unpacked to (spec->decoder.decoder.dic) output buffer.
+*/
+
+static SRes Lzma2State_Code2(void *pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ int srcWasFinished, ECoderFinishMode finishMode,
+ // int *wasFinished,
+ ECoderStatus *status)
+{
+ CLzma2Dec_Spec *spec = (CLzma2Dec_Spec *)pp;
+ ELzmaStatus status2;
+ /* ELzmaFinishMode fm = (finishMode == LZMA_FINISH_ANY) ? LZMA_FINISH_ANY : LZMA_FINISH_END; */
+ SRes res;
+ UNUSED_VAR(srcWasFinished);
+ if (spec->outBufMode)
+ {
+ SizeT dicPos = spec->decoder.decoder.dicPos;
+ SizeT dicLimit = dicPos + *destLen;
+ res = Lzma2Dec_DecodeToDic(&spec->decoder, dicLimit, src, srcLen, (ELzmaFinishMode)finishMode, &status2);
+ *destLen = spec->decoder.decoder.dicPos - dicPos;
+ }
+ else
+ res = Lzma2Dec_DecodeToBuf(&spec->decoder, dest, destLen, src, srcLen, (ELzmaFinishMode)finishMode, &status2);
+ // *wasFinished = (status2 == LZMA_STATUS_FINISHED_WITH_MARK);
+ // ECoderStatus values are identical to ELzmaStatus values of LZMA2 decoder
+ *status = status2;
+ return res;
+}
+
+
+static SRes Lzma2State_SetFromMethod(IStateCoder *p, Byte *outBuf, size_t outBufSize, ISzAllocPtr alloc)
+{
+ CLzma2Dec_Spec *spec = (CLzma2Dec_Spec *)p->p;
+ if (!spec)
+ {
+ spec = (CLzma2Dec_Spec *)ISzAlloc_Alloc(alloc, sizeof(CLzma2Dec_Spec));
+ if (!spec)
+ return SZ_ERROR_MEM;
+ p->p = spec;
+ p->Free = Lzma2State_Free;
+ p->SetProps = Lzma2State_SetProps;
+ p->Init = Lzma2State_Init;
+ p->Code2 = Lzma2State_Code2;
+ p->Filter = NULL;
+ Lzma2Dec_Construct(&spec->decoder);
+ }
+ spec->outBufMode = False;
+ if (outBuf)
+ {
+ spec->outBufMode = True;
+ spec->decoder.decoder.dic = outBuf;
+ spec->decoder.decoder.dicBufSize = outBufSize;
+ }
+ return SZ_OK;
+}
+
+
+static SRes Lzma2State_ResetOutBuf(IStateCoder *p, Byte *outBuf, size_t outBufSize)
+{
+ CLzma2Dec_Spec *spec = (CLzma2Dec_Spec *)p->p;
+ if ((spec->outBufMode && !outBuf) || (!spec->outBufMode && outBuf))
+ return SZ_ERROR_FAIL;
+ if (outBuf)
+ {
+ spec->decoder.decoder.dic = outBuf;
+ spec->decoder.decoder.dicBufSize = outBufSize;
+ }
+ return SZ_OK;
+}
+
+
+
+static void MixCoder_Construct(CMixCoder *p, ISzAllocPtr alloc)
+{
+ unsigned i;
+ p->alloc = alloc;
+ p->buf = NULL;
+ p->numCoders = 0;
+
+ p->outBufSize = 0;
+ p->outBuf = NULL;
+ // p->SingleBufMode = False;
+
+ for (i = 0; i < MIXCODER_NUM_FILTERS_MAX; i++)
+ p->coders[i].p = NULL;
+}
+
+
+static void MixCoder_Free(CMixCoder *p)
+{
+ unsigned i;
+ p->numCoders = 0;
+ for (i = 0; i < MIXCODER_NUM_FILTERS_MAX; i++)
+ {
+ IStateCoder *sc = &p->coders[i];
+ if (sc->p)
+ {
+ sc->Free(sc->p, p->alloc);
+ sc->p = NULL;
+ }
+ }
+ if (p->buf)
+ {
+ ISzAlloc_Free(p->alloc, p->buf);
+ p->buf = NULL; /* 9.31: the BUG was fixed */
+ }
+}
+
+static void MixCoder_Init(CMixCoder *p)
+{
+ unsigned i;
+ for (i = 0; i < MIXCODER_NUM_FILTERS_MAX - 1; i++)
+ {
+ p->size[i] = 0;
+ p->pos[i] = 0;
+ p->finished[i] = 0;
+ }
+ for (i = 0; i < p->numCoders; i++)
+ {
+ IStateCoder *coder = &p->coders[i];
+ coder->Init(coder->p);
+ p->results[i] = SZ_OK;
+ }
+ p->outWritten = 0;
+ p->wasFinished = False;
+ p->res = SZ_OK;
+ p->status = CODER_STATUS_NOT_SPECIFIED;
+}
+
+
+static SRes MixCoder_SetFromMethod(CMixCoder *p, unsigned coderIndex, UInt64 methodId, Byte *outBuf, size_t outBufSize)
+{
+ IStateCoder *sc = &p->coders[coderIndex];
+ p->ids[coderIndex] = methodId;
+ switch (methodId)
+ {
+ case XZ_ID_LZMA2: return Lzma2State_SetFromMethod(sc, outBuf, outBufSize, p->alloc);
+ #ifdef USE_SUBBLOCK
+ case XZ_ID_Subblock: return SbState_SetFromMethod(sc, p->alloc);
+ #endif
+ }
+ if (coderIndex == 0)
+ return SZ_ERROR_UNSUPPORTED;
+ return BraState_SetFromMethod(sc, methodId, 0, p->alloc);
+}
+
+
+static SRes MixCoder_ResetFromMethod(CMixCoder *p, unsigned coderIndex, UInt64 methodId, Byte *outBuf, size_t outBufSize)
+{
+ IStateCoder *sc = &p->coders[coderIndex];
+ switch (methodId)
+ {
+ case XZ_ID_LZMA2: return Lzma2State_ResetOutBuf(sc, outBuf, outBufSize);
+ }
+ return SZ_ERROR_UNSUPPORTED;
+}
+
+
+
+/*
+ if (destFinish) - then unpack data block is finished at (*destLen) position,
+ and we can return data that were not processed by filter
+
+output (status) can be :
+ CODER_STATUS_NOT_FINISHED
+ CODER_STATUS_FINISHED_WITH_MARK
+ CODER_STATUS_NEEDS_MORE_INPUT - not implemented still
+*/
+
+static SRes MixCoder_Code(CMixCoder *p,
+ Byte *dest, SizeT *destLen, int destFinish,
+ const Byte *src, SizeT *srcLen, int srcWasFinished,
+ ECoderFinishMode finishMode)
+{
+ SizeT destLenOrig = *destLen;
+ SizeT srcLenOrig = *srcLen;
+
+ *destLen = 0;
+ *srcLen = 0;
+
+ if (p->wasFinished)
+ return p->res;
+
+ p->status = CODER_STATUS_NOT_FINISHED;
+
+ // if (p->SingleBufMode)
+ if (p->outBuf)
+ {
+ SRes res;
+ SizeT destLen2, srcLen2;
+ int wasFinished;
+
+ PRF_STR("------- MixCoder Single ----------");
+
+ srcLen2 = srcLenOrig;
+ destLen2 = destLenOrig;
+
+ {
+ IStateCoder *coder = &p->coders[0];
+ res = coder->Code2(coder->p, NULL, &destLen2, src, &srcLen2, srcWasFinished, finishMode,
+ // &wasFinished,
+ &p->status);
+ wasFinished = (p->status == CODER_STATUS_FINISHED_WITH_MARK);
+ }
+
+ p->res = res;
+
+ /*
+ if (wasFinished)
+ p->status = CODER_STATUS_FINISHED_WITH_MARK;
+ else
+ {
+ if (res == SZ_OK)
+ if (destLen2 != destLenOrig)
+ p->status = CODER_STATUS_NEEDS_MORE_INPUT;
+ }
+ */
+
+
+ *srcLen = srcLen2;
+ src += srcLen2;
+ p->outWritten += destLen2;
+
+ if (res != SZ_OK || srcWasFinished || wasFinished)
+ p->wasFinished = True;
+
+ if (p->numCoders == 1)
+ *destLen = destLen2;
+ else if (p->wasFinished)
+ {
+ unsigned i;
+ size_t processed = p->outWritten;
+
+ for (i = 1; i < p->numCoders; i++)
+ {
+ IStateCoder *coder = &p->coders[i];
+ processed = coder->Filter(coder->p, p->outBuf, processed);
+ if (wasFinished || (destFinish && p->outWritten == destLenOrig))
+ processed = p->outWritten;
+ PRF_STR_INT("filter", i);
+ }
+ *destLen = processed;
+ }
+ return res;
+ }
+
+ PRF_STR("standard mix");
+
+ if (p->numCoders != 1)
+ {
+ if (!p->buf)
+ {
+ p->buf = (Byte *)ISzAlloc_Alloc(p->alloc, CODER_BUF_SIZE * (MIXCODER_NUM_FILTERS_MAX - 1));
+ if (!p->buf)
+ return SZ_ERROR_MEM;
+ }
+
+ finishMode = CODER_FINISH_ANY;
+ }
+
+ for (;;)
+ {
+ Bool processed = False;
+ Bool allFinished = True;
+ SRes resMain = SZ_OK;
+ unsigned i;
+
+ p->status = CODER_STATUS_NOT_FINISHED;
+ /*
+ if (p->numCoders == 1 && *destLen == destLenOrig && finishMode == LZMA_FINISH_ANY)
+ break;
+ */
+
+ for (i = 0; i < p->numCoders; i++)
+ {
+ SRes res;
+ IStateCoder *coder = &p->coders[i];
+ Byte *dest2;
+ SizeT destLen2, srcLen2; // destLen2_Orig;
+ const Byte *src2;
+ int srcFinished2;
+ int encodingWasFinished;
+ ECoderStatus status2;
+
+ if (i == 0)
+ {
+ src2 = src;
+ srcLen2 = srcLenOrig - *srcLen;
+ srcFinished2 = srcWasFinished;
+ }
+ else
+ {
+ size_t k = i - 1;
+ src2 = p->buf + (CODER_BUF_SIZE * k) + p->pos[k];
+ srcLen2 = p->size[k] - p->pos[k];
+ srcFinished2 = p->finished[k];
+ }
+
+ if (i == p->numCoders - 1)
+ {
+ dest2 = dest;
+ destLen2 = destLenOrig - *destLen;
+ }
+ else
+ {
+ if (p->pos[i] != p->size[i])
+ continue;
+ dest2 = p->buf + (CODER_BUF_SIZE * i);
+ destLen2 = CODER_BUF_SIZE;
+ }
+
+ // destLen2_Orig = destLen2;
+
+ if (p->results[i] != SZ_OK)
+ {
+ if (resMain == SZ_OK)
+ resMain = p->results[i];
+ continue;
+ }
+
+ res = coder->Code2(coder->p,
+ dest2, &destLen2,
+ src2, &srcLen2, srcFinished2,
+ finishMode,
+ // &encodingWasFinished,
+ &status2);
+
+ if (res != SZ_OK)
+ {
+ p->results[i] = res;
+ if (resMain == SZ_OK)
+ resMain = res;
+ }
+
+ encodingWasFinished = (status2 == CODER_STATUS_FINISHED_WITH_MARK);
+
+ if (!encodingWasFinished)
+ {
+ allFinished = False;
+ if (p->numCoders == 1 && res == SZ_OK)
+ p->status = status2;
+ }
+
+ if (i == 0)
+ {
+ *srcLen += srcLen2;
+ src += srcLen2;
+ }
+ else
+ p->pos[(size_t)i - 1] += srcLen2;
+
+ if (i == p->numCoders - 1)
+ {
+ *destLen += destLen2;
+ dest += destLen2;
+ }
+ else
+ {
+ p->size[i] = destLen2;
+ p->pos[i] = 0;
+ p->finished[i] = encodingWasFinished;
+ }
+
+ if (destLen2 != 0 || srcLen2 != 0)
+ processed = True;
+ }
+
+ if (!processed)
+ {
+ if (allFinished)
+ p->status = CODER_STATUS_FINISHED_WITH_MARK;
+ return resMain;
+ }
+ }
+}
+
+
+SRes Xz_ParseHeader(CXzStreamFlags *p, const Byte *buf)
+{
+ *p = (CXzStreamFlags)GetBe16(buf + XZ_SIG_SIZE);
+ if (CrcCalc(buf + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE) !=
+ GetUi32(buf + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE))
+ return SZ_ERROR_NO_ARCHIVE;
+ return XzFlags_IsSupported(*p) ? SZ_OK : SZ_ERROR_UNSUPPORTED;
+}
+
+static Bool Xz_CheckFooter(CXzStreamFlags flags, UInt64 indexSize, const Byte *buf)
+{
+ return indexSize == (((UInt64)GetUi32(buf + 4) + 1) << 2)
+ && GetUi32(buf) == CrcCalc(buf + 4, 6)
+ && flags == GetBe16(buf + 8)
+ && buf[10] == XZ_FOOTER_SIG_0
+ && buf[11] == XZ_FOOTER_SIG_1;
+}
+
+#define READ_VARINT_AND_CHECK(buf, pos, size, res) \
+ { unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \
+ if (s == 0) return SZ_ERROR_ARCHIVE; pos += s; }
+
+
+static Bool XzBlock_AreSupportedFilters(const CXzBlock *p)
+{
+ unsigned numFilters = XzBlock_GetNumFilters(p) - 1;
+ unsigned i;
+ {
+ const CXzFilter *f = &p->filters[numFilters];
+ if (f->id != XZ_ID_LZMA2 || f->propsSize != 1 || f->props[0] > 40)
+ return False;
+ }
+
+ for (i = 0; i < numFilters; i++)
+ {
+ const CXzFilter *f = &p->filters[i];
+ if (f->id == XZ_ID_Delta)
+ {
+ if (f->propsSize != 1)
+ return False;
+ }
+ else if (f->id < XZ_ID_Delta
+ || f->id > XZ_ID_SPARC
+ || (f->propsSize != 0 && f->propsSize != 4))
+ return False;
+ }
+ return True;
+}
+
+
+SRes XzBlock_Parse(CXzBlock *p, const Byte *header)
+{
+ unsigned pos;
+ unsigned numFilters, i;
+ unsigned headerSize = (unsigned)header[0] << 2;
+
+ /* (headerSize != 0) : another code checks */
+
+ if (CrcCalc(header, headerSize) != GetUi32(header + headerSize))
+ return SZ_ERROR_ARCHIVE;
+
+ pos = 1;
+ p->flags = header[pos++];
+
+ p->packSize = (UInt64)(Int64)-1;
+ if (XzBlock_HasPackSize(p))
+ {
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &p->packSize);
+ if (p->packSize == 0 || p->packSize + headerSize >= (UInt64)1 << 63)
+ return SZ_ERROR_ARCHIVE;
+ }
+
+ p->unpackSize = (UInt64)(Int64)-1;
+ if (XzBlock_HasUnpackSize(p))
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &p->unpackSize);
+
+ numFilters = XzBlock_GetNumFilters(p);
+ for (i = 0; i < numFilters; i++)
+ {
+ CXzFilter *filter = p->filters + i;
+ UInt64 size;
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &filter->id);
+ READ_VARINT_AND_CHECK(header, pos, headerSize, &size);
+ if (size > headerSize - pos || size > XZ_FILTER_PROPS_SIZE_MAX)
+ return SZ_ERROR_ARCHIVE;
+ filter->propsSize = (UInt32)size;
+ memcpy(filter->props, header + pos, (size_t)size);
+ pos += (unsigned)size;
+
+ #ifdef XZ_DUMP
+ printf("\nf[%u] = %2X: ", i, (unsigned)filter->id);
+ {
+ unsigned i;
+ for (i = 0; i < size; i++)
+ printf(" %2X", filter->props[i]);
+ }
+ #endif
+ }
+
+ if (XzBlock_HasUnsupportedFlags(p))
+ return SZ_ERROR_UNSUPPORTED;
+
+ while (pos < headerSize)
+ if (header[pos++] != 0)
+ return SZ_ERROR_ARCHIVE;
+ return SZ_OK;
+}
+
+
+
+
+static SRes XzDecMix_Init(CMixCoder *p, const CXzBlock *block, Byte *outBuf, size_t outBufSize)
+{
+ unsigned i;
+ Bool needReInit = True;
+ unsigned numFilters = XzBlock_GetNumFilters(block);
+
+ if (numFilters == p->numCoders && ((p->outBuf && outBuf) || (!p->outBuf && !outBuf)))
+ {
+ needReInit = False;
+ for (i = 0; i < numFilters; i++)
+ if (p->ids[i] != block->filters[numFilters - 1 - i].id)
+ {
+ needReInit = True;
+ break;
+ }
+ }
+
+ // p->SingleBufMode = (outBuf != NULL);
+ p->outBuf = outBuf;
+ p->outBufSize = outBufSize;
+
+ // p->SingleBufMode = False;
+ // outBuf = NULL;
+
+ if (needReInit)
+ {
+ MixCoder_Free(p);
+ for (i = 0; i < numFilters; i++)
+ {
+ RINOK(MixCoder_SetFromMethod(p, i, block->filters[numFilters - 1 - i].id, outBuf, outBufSize));
+ }
+ p->numCoders = numFilters;
+ }
+ else
+ {
+ RINOK(MixCoder_ResetFromMethod(p, 0, block->filters[numFilters - 1].id, outBuf, outBufSize));
+ }
+
+ for (i = 0; i < numFilters; i++)
+ {
+ const CXzFilter *f = &block->filters[numFilters - 1 - i];
+ IStateCoder *sc = &p->coders[i];
+ RINOK(sc->SetProps(sc->p, f->props, f->propsSize, p->alloc));
+ }
+
+ MixCoder_Init(p);
+ return SZ_OK;
+}
+
+
+
+void XzUnpacker_Init(CXzUnpacker *p)
+{
+ p->state = XZ_STATE_STREAM_HEADER;
+ p->pos = 0;
+ p->numStartedStreams = 0;
+ p->numFinishedStreams = 0;
+ p->numTotalBlocks = 0;
+ p->padSize = 0;
+ p->decodeOnlyOneBlock = 0;
+
+ p->parseMode = False;
+ p->decodeToStreamSignature = False;
+
+ // p->outBuf = NULL;
+ // p->outBufSize = 0;
+ p->outDataWritten = 0;
+}
+
+
+void XzUnpacker_SetOutBuf(CXzUnpacker *p, Byte *outBuf, size_t outBufSize)
+{
+ p->outBuf = outBuf;
+ p->outBufSize = outBufSize;
+}
+
+
+void XzUnpacker_Construct(CXzUnpacker *p, ISzAllocPtr alloc)
+{
+ MixCoder_Construct(&p->decoder, alloc);
+ p->outBuf = NULL;
+ p->outBufSize = 0;
+ XzUnpacker_Init(p);
+}
+
+
+void XzUnpacker_Free(CXzUnpacker *p)
+{
+ MixCoder_Free(&p->decoder);
+}
+
+
+void XzUnpacker_PrepareToRandomBlockDecoding(CXzUnpacker *p)
+{
+ p->indexSize = 0;
+ p->numBlocks = 0;
+ Sha256_Init(&p->sha);
+ p->state = XZ_STATE_BLOCK_HEADER;
+ p->pos = 0;
+ p->decodeOnlyOneBlock = 1;
+}
+
+
+static void XzUnpacker_UpdateIndex(CXzUnpacker *p, UInt64 packSize, UInt64 unpackSize)
+{
+ Byte temp[32];
+ unsigned num = Xz_WriteVarInt(temp, packSize);
+ num += Xz_WriteVarInt(temp + num, unpackSize);
+ Sha256_Update(&p->sha, temp, num);
+ p->indexSize += num;
+ p->numBlocks++;
+}
+
+
+
+SRes XzUnpacker_Code(CXzUnpacker *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, int srcFinished,
+ ECoderFinishMode finishMode, ECoderStatus *status)
+{
+ SizeT destLenOrig = *destLen;
+ SizeT srcLenOrig = *srcLen;
+ *destLen = 0;
+ *srcLen = 0;
+ *status = CODER_STATUS_NOT_SPECIFIED;
+
+ for (;;)
+ {
+ SizeT srcRem;
+
+ if (p->state == XZ_STATE_BLOCK)
+ {
+ SizeT destLen2 = destLenOrig - *destLen;
+ SizeT srcLen2 = srcLenOrig - *srcLen;
+ SRes res;
+
+ ECoderFinishMode finishMode2 = finishMode;
+ Bool srcFinished2 = srcFinished;
+ Bool destFinish = False;
+
+ if (p->block.packSize != (UInt64)(Int64)-1)
+ {
+ UInt64 rem = p->block.packSize - p->packSize;
+ if (srcLen2 >= rem)
+ {
+ srcFinished2 = True;
+ srcLen2 = (SizeT)rem;
+ }
+ if (rem == 0 && p->block.unpackSize == p->unpackSize)
+ return SZ_ERROR_DATA;
+ }
+
+ if (p->block.unpackSize != (UInt64)(Int64)-1)
+ {
+ UInt64 rem = p->block.unpackSize - p->unpackSize;
+ if (destLen2 >= rem)
+ {
+ destFinish = True;
+ finishMode2 = CODER_FINISH_END;
+ destLen2 = (SizeT)rem;
+ }
+ }
+
+ /*
+ if (srcLen2 == 0 && destLen2 == 0)
+ {
+ *status = CODER_STATUS_NOT_FINISHED;
+ return SZ_OK;
+ }
+ */
+
+ {
+ res = MixCoder_Code(&p->decoder,
+ (p->outBuf ? NULL : dest), &destLen2, destFinish,
+ src, &srcLen2, srcFinished2,
+ finishMode2);
+
+ *status = p->decoder.status;
+ XzCheck_Update(&p->check, (p->outBuf ? p->outBuf + p->outDataWritten : dest), destLen2);
+ if (!p->outBuf)
+ dest += destLen2;
+ p->outDataWritten += destLen2;
+ }
+
+ (*srcLen) += srcLen2;
+ src += srcLen2;
+ p->packSize += srcLen2;
+ (*destLen) += destLen2;
+ p->unpackSize += destLen2;
+
+ RINOK(res);
+
+ if (*status != CODER_STATUS_FINISHED_WITH_MARK)
+ {
+ if (p->block.packSize == p->packSize
+ && *status == CODER_STATUS_NEEDS_MORE_INPUT)
+ {
+ PRF_STR("CODER_STATUS_NEEDS_MORE_INPUT");
+ *status = CODER_STATUS_NOT_SPECIFIED;
+ return SZ_ERROR_DATA;
+ }
+
+ return SZ_OK;
+ }
+ {
+ XzUnpacker_UpdateIndex(p, XzUnpacker_GetPackSizeForIndex(p), p->unpackSize);
+ p->state = XZ_STATE_BLOCK_FOOTER;
+ p->pos = 0;
+ p->alignPos = 0;
+ *status = CODER_STATUS_NOT_SPECIFIED;
+
+ if ((p->block.packSize != (UInt64)(Int64)-1 && p->block.packSize != p->packSize)
+ || (p->block.unpackSize != (UInt64)(Int64)-1 && p->block.unpackSize != p->unpackSize))
+ {
+ PRF_STR("ERROR: block.size mismatch");
+ return SZ_ERROR_DATA;
+ }
+ }
+ // continue;
+ }
+
+ srcRem = srcLenOrig - *srcLen;
+
+ // XZ_STATE_BLOCK_FOOTER can transit to XZ_STATE_BLOCK_HEADER without input bytes
+ if (srcRem == 0 && p->state != XZ_STATE_BLOCK_FOOTER)
+ {
+ *status = CODER_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+
+ switch (p->state)
+ {
+ case XZ_STATE_STREAM_HEADER:
+ {
+ if (p->pos < XZ_STREAM_HEADER_SIZE)
+ {
+ if (p->pos < XZ_SIG_SIZE && *src != XZ_SIG[p->pos])
+ return SZ_ERROR_NO_ARCHIVE;
+ if (p->decodeToStreamSignature)
+ return SZ_OK;
+ p->buf[p->pos++] = *src++;
+ (*srcLen)++;
+ }
+ else
+ {
+ RINOK(Xz_ParseHeader(&p->streamFlags, p->buf));
+ p->numStartedStreams++;
+ p->indexSize = 0;
+ p->numBlocks = 0;
+ Sha256_Init(&p->sha);
+ p->state = XZ_STATE_BLOCK_HEADER;
+ p->pos = 0;
+ }
+ break;
+ }
+
+ case XZ_STATE_BLOCK_HEADER:
+ {
+ if (p->pos == 0)
+ {
+ p->buf[p->pos++] = *src++;
+ (*srcLen)++;
+ if (p->buf[0] == 0)
+ {
+ if (p->decodeOnlyOneBlock)
+ return SZ_ERROR_DATA;
+ p->indexPreSize = 1 + Xz_WriteVarInt(p->buf + 1, p->numBlocks);
+ p->indexPos = p->indexPreSize;
+ p->indexSize += p->indexPreSize;
+ Sha256_Final(&p->sha, p->shaDigest);
+ Sha256_Init(&p->sha);
+ p->crc = CrcUpdate(CRC_INIT_VAL, p->buf, p->indexPreSize);
+ p->state = XZ_STATE_STREAM_INDEX;
+ break;
+ }
+ p->blockHeaderSize = ((UInt32)p->buf[0] << 2) + 4;
+ break;
+ }
+
+ if (p->pos != p->blockHeaderSize)
+ {
+ UInt32 cur = p->blockHeaderSize - p->pos;
+ if (cur > srcRem)
+ cur = (UInt32)srcRem;
+ memcpy(p->buf + p->pos, src, cur);
+ p->pos += cur;
+ (*srcLen) += cur;
+ src += cur;
+ }
+ else
+ {
+ RINOK(XzBlock_Parse(&p->block, p->buf));
+ if (!XzBlock_AreSupportedFilters(&p->block))
+ return SZ_ERROR_UNSUPPORTED;
+ p->numTotalBlocks++;
+ p->state = XZ_STATE_BLOCK;
+ p->packSize = 0;
+ p->unpackSize = 0;
+ XzCheck_Init(&p->check, XzFlags_GetCheckType(p->streamFlags));
+ if (p->parseMode)
+ {
+ p->headerParsedOk = True;
+ return SZ_OK;
+ }
+ RINOK(XzDecMix_Init(&p->decoder, &p->block, p->outBuf, p->outBufSize));
+ }
+ break;
+ }
+
+ case XZ_STATE_BLOCK_FOOTER:
+ {
+ if ((((unsigned)p->packSize + p->alignPos) & 3) != 0)
+ {
+ if (srcRem == 0)
+ {
+ *status = CODER_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ (*srcLen)++;
+ p->alignPos++;
+ if (*src++ != 0)
+ return SZ_ERROR_CRC;
+ }
+ else
+ {
+ UInt32 checkSize = XzFlags_GetCheckSize(p->streamFlags);
+ UInt32 cur = checkSize - p->pos;
+ if (cur != 0)
+ {
+ if (srcRem == 0)
+ {
+ *status = CODER_STATUS_NEEDS_MORE_INPUT;
+ return SZ_OK;
+ }
+ if (cur > srcRem)
+ cur = (UInt32)srcRem;
+ memcpy(p->buf + p->pos, src, cur);
+ p->pos += cur;
+ (*srcLen) += cur;
+ src += cur;
+ if (checkSize != p->pos)
+ break;
+ }
+ {
+ Byte digest[XZ_CHECK_SIZE_MAX];
+ p->state = XZ_STATE_BLOCK_HEADER;
+ p->pos = 0;
+ if (XzCheck_Final(&p->check, digest) && memcmp(digest, p->buf, checkSize) != 0)
+ return SZ_ERROR_CRC;
+ if (p->decodeOnlyOneBlock)
+ {
+ *status = CODER_STATUS_FINISHED_WITH_MARK;
+ return SZ_OK;
+ }
+ }
+ }
+ break;
+ }
+
+ case XZ_STATE_STREAM_INDEX:
+ {
+ if (p->pos < p->indexPreSize)
+ {
+ (*srcLen)++;
+ if (*src++ != p->buf[p->pos++])
+ return SZ_ERROR_CRC;
+ }
+ else
+ {
+ if (p->indexPos < p->indexSize)
+ {
+ UInt64 cur = p->indexSize - p->indexPos;
+ if (srcRem > cur)
+ srcRem = (SizeT)cur;
+ p->crc = CrcUpdate(p->crc, src, srcRem);
+ Sha256_Update(&p->sha, src, srcRem);
+ (*srcLen) += srcRem;
+ src += srcRem;
+ p->indexPos += srcRem;
+ }
+ else if ((p->indexPos & 3) != 0)
+ {
+ Byte b = *src++;
+ p->crc = CRC_UPDATE_BYTE(p->crc, b);
+ (*srcLen)++;
+ p->indexPos++;
+ p->indexSize++;
+ if (b != 0)
+ return SZ_ERROR_CRC;
+ }
+ else
+ {
+ Byte digest[SHA256_DIGEST_SIZE];
+ p->state = XZ_STATE_STREAM_INDEX_CRC;
+ p->indexSize += 4;
+ p->pos = 0;
+ Sha256_Final(&p->sha, digest);
+ if (memcmp(digest, p->shaDigest, SHA256_DIGEST_SIZE) != 0)
+ return SZ_ERROR_CRC;
+ }
+ }
+ break;
+ }
+
+ case XZ_STATE_STREAM_INDEX_CRC:
+ {
+ if (p->pos < 4)
+ {
+ (*srcLen)++;
+ p->buf[p->pos++] = *src++;
+ }
+ else
+ {
+ p->state = XZ_STATE_STREAM_FOOTER;
+ p->pos = 0;
+ if (CRC_GET_DIGEST(p->crc) != GetUi32(p->buf))
+ return SZ_ERROR_CRC;
+ }
+ break;
+ }
+
+ case XZ_STATE_STREAM_FOOTER:
+ {
+ UInt32 cur = XZ_STREAM_FOOTER_SIZE - p->pos;
+ if (cur > srcRem)
+ cur = (UInt32)srcRem;
+ memcpy(p->buf + p->pos, src, cur);
+ p->pos += cur;
+ (*srcLen) += cur;
+ src += cur;
+ if (p->pos == XZ_STREAM_FOOTER_SIZE)
+ {
+ p->state = XZ_STATE_STREAM_PADDING;
+ p->numFinishedStreams++;
+ p->padSize = 0;
+ if (!Xz_CheckFooter(p->streamFlags, p->indexSize, p->buf))
+ return SZ_ERROR_CRC;
+ }
+ break;
+ }
+
+ case XZ_STATE_STREAM_PADDING:
+ {
+ if (*src != 0)
+ {
+ if (((UInt32)p->padSize & 3) != 0)
+ return SZ_ERROR_NO_ARCHIVE;
+ p->pos = 0;
+ p->state = XZ_STATE_STREAM_HEADER;
+ }
+ else
+ {
+ (*srcLen)++;
+ src++;
+ p->padSize++;
+ }
+ break;
+ }
+
+ case XZ_STATE_BLOCK: break; /* to disable GCC warning */
+ }
+ }
+ /*
+ if (p->state == XZ_STATE_FINISHED)
+ *status = CODER_STATUS_FINISHED_WITH_MARK;
+ return SZ_OK;
+ */
+}
+
+
+SRes XzUnpacker_CodeFull(CXzUnpacker *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen,
+ ECoderFinishMode finishMode, ECoderStatus *status)
+{
+ XzUnpacker_Init(p);
+ XzUnpacker_SetOutBuf(p, dest, *destLen);
+
+ return XzUnpacker_Code(p,
+ NULL, destLen,
+ src, srcLen, True,
+ finishMode, status);
+}
+
+
+Bool XzUnpacker_IsBlockFinished(const CXzUnpacker *p)
+{
+ return (p->state == XZ_STATE_BLOCK_HEADER) && (p->pos == 0);
+}
+
+Bool XzUnpacker_IsStreamWasFinished(const CXzUnpacker *p)
+{
+ return (p->state == XZ_STATE_STREAM_PADDING) && (((UInt32)p->padSize & 3) == 0);
+}
+
+UInt64 XzUnpacker_GetExtraSize(const CXzUnpacker *p)
+{
+ UInt64 num = 0;
+ if (p->state == XZ_STATE_STREAM_PADDING)
+ num = p->padSize;
+ else if (p->state == XZ_STATE_STREAM_HEADER)
+ num = p->padSize + p->pos;
+ return num;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifndef _7ZIP_ST
+#include "MtDec.h"
+#endif
+
+
+void XzDecMtProps_Init(CXzDecMtProps *p)
+{
+ p->inBufSize_ST = 1 << 18;
+ p->outStep_ST = 1 << 20;
+ p->ignoreErrors = False;
+
+ #ifndef _7ZIP_ST
+ p->numThreads = 1;
+ p->inBufSize_MT = 1 << 18;
+ p->memUseMax = sizeof(size_t) << 28;
+ #endif
+}
+
+
+
+#ifndef _7ZIP_ST
+
+/* ---------- CXzDecMtThread ---------- */
+
+typedef struct
+{
+ Byte *outBuf;
+ size_t outBufSize;
+ size_t outPreSize;
+ size_t inPreSize;
+ size_t inPreHeaderSize;
+ size_t blockPackSize_for_Index; // including block header and checksum.
+ size_t blockPackTotal; // including stream header, block header and checksum.
+ size_t inCodeSize;
+ size_t outCodeSize;
+ ECoderStatus status;
+ SRes codeRes;
+ Bool skipMode;
+ // Bool finishedWithMark;
+ EMtDecParseState parseState;
+ Bool parsing_Truncated;
+ Bool atBlockHeader;
+ CXzStreamFlags streamFlags;
+ // UInt64 numFinishedStreams
+ UInt64 numStreams;
+ UInt64 numTotalBlocks;
+ UInt64 numBlocks;
+
+ Bool dec_created;
+ CXzUnpacker dec;
+
+ Byte mtPad[1 << 7];
+} CXzDecMtThread;
+
+#endif
+
+
+/* ---------- CXzDecMt ---------- */
+
+typedef struct
+{
+ CAlignOffsetAlloc alignOffsetAlloc;
+ ISzAllocPtr allocMid;
+
+ CXzDecMtProps props;
+ size_t unpackBlockMaxSize;
+
+ ISeqInStream *inStream;
+ ISeqOutStream *outStream;
+ ICompressProgress *progress;
+ // CXzStatInfo *stat;
+
+ Bool finishMode;
+ Bool outSize_Defined;
+ UInt64 outSize;
+
+ UInt64 outProcessed;
+ UInt64 inProcessed;
+ UInt64 readProcessed;
+ Bool readWasFinished;
+ SRes readRes;
+ SRes writeRes;
+
+ Byte *outBuf;
+ size_t outBufSize;
+ Byte *inBuf;
+ size_t inBufSize;
+ Bool dec_created;
+ CXzUnpacker dec;
+
+ ECoderStatus status;
+ SRes codeRes;
+
+ #ifndef _7ZIP_ST
+ Bool mainDecoderWasCalled;
+ // int statErrorDefined;
+ int finishedDecoderIndex;
+
+ // global values that are used in Parse stage
+ CXzStreamFlags streamFlags;
+ // UInt64 numFinishedStreams
+ UInt64 numStreams;
+ UInt64 numTotalBlocks;
+ UInt64 numBlocks;
+
+ // UInt64 numBadBlocks;
+ SRes mainErrorCode;
+
+ Bool isBlockHeaderState_Parse;
+ Bool isBlockHeaderState_Write;
+ UInt64 outProcessed_Parse;
+ Bool parsing_Truncated;
+
+ Bool mtc_WasConstructed;
+ CMtDec mtc;
+ CXzDecMtThread coders[MTDEC__THREADS_MAX];
+ #endif
+
+} CXzDecMt;
+
+
+
+CXzDecMtHandle XzDecMt_Create(ISzAllocPtr alloc, ISzAllocPtr allocMid)
+{
+ CXzDecMt *p = (CXzDecMt *)ISzAlloc_Alloc(alloc, sizeof(CXzDecMt));
+ if (!p)
+ return NULL;
+
+ AlignOffsetAlloc_CreateVTable(&p->alignOffsetAlloc);
+ p->alignOffsetAlloc.baseAlloc = alloc;
+ p->alignOffsetAlloc.numAlignBits = 7;
+ p->alignOffsetAlloc.offset = 0;
+
+ p->allocMid = allocMid;
+
+ p->outBuf = NULL;
+ p->outBufSize = 0;
+ p->inBuf = NULL;
+ p->inBufSize = 0;
+ p->dec_created = False;
+
+ p->unpackBlockMaxSize = 0;
+
+ XzDecMtProps_Init(&p->props);
+
+ #ifndef _7ZIP_ST
+ p->mtc_WasConstructed = False;
+ {
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CXzDecMtThread *coder = &p->coders[i];
+ coder->dec_created = False;
+ coder->outBuf = NULL;
+ coder->outBufSize = 0;
+ }
+ }
+ #endif
+
+ return p;
+}
+
+
+#ifndef _7ZIP_ST
+
+static void XzDecMt_FreeOutBufs(CXzDecMt *p)
+{
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CXzDecMtThread *coder = &p->coders[i];
+ if (coder->outBuf)
+ {
+ ISzAlloc_Free(p->allocMid, coder->outBuf);
+ coder->outBuf = NULL;
+ coder->outBufSize = 0;
+ }
+ }
+ p->unpackBlockMaxSize = 0;
+}
+
+#endif
+
+
+
+static void XzDecMt_FreeSt(CXzDecMt *p)
+{
+ if (p->dec_created)
+ {
+ XzUnpacker_Free(&p->dec);
+ p->dec_created = False;
+ }
+
+ if (p->outBuf)
+ {
+ ISzAlloc_Free(p->allocMid, p->outBuf);
+ p->outBuf = NULL;
+ }
+ p->outBufSize = 0;
+
+ if (p->inBuf)
+ {
+ ISzAlloc_Free(p->allocMid, p->inBuf);
+ p->inBuf = NULL;
+ }
+ p->inBufSize = 0;
+}
+
+
+void XzDecMt_Destroy(CXzDecMtHandle pp)
+{
+ CXzDecMt *p = (CXzDecMt *)pp;
+
+ XzDecMt_FreeSt(p);
+
+ #ifndef _7ZIP_ST
+
+ if (p->mtc_WasConstructed)
+ {
+ MtDec_Destruct(&p->mtc);
+ p->mtc_WasConstructed = False;
+ }
+ {
+ unsigned i;
+ for (i = 0; i < MTDEC__THREADS_MAX; i++)
+ {
+ CXzDecMtThread *t = &p->coders[i];
+ if (t->dec_created)
+ {
+ // we don't need to free dict here
+ XzUnpacker_Free(&t->dec);
+ t->dec_created = False;
+ }
+ }
+ }
+ XzDecMt_FreeOutBufs(p);
+
+ #endif
+
+ ISzAlloc_Free(p->alignOffsetAlloc.baseAlloc, pp);
+}
+
+
+
+#ifndef _7ZIP_ST
+
+static void XzDecMt_Callback_Parse(void *obj, unsigned coderIndex, CMtDecCallbackInfo *cc)
+{
+ CXzDecMt *me = (CXzDecMt *)obj;
+ CXzDecMtThread *coder = &me->coders[coderIndex];
+ size_t srcSize = cc->srcSize;
+
+ cc->srcSize = 0;
+ cc->outPos = 0;
+ cc->state = MTDEC_PARSE_CONTINUE;
+
+ cc->canCreateNewThread = True;
+
+ if (cc->startCall)
+ {
+ coder->outPreSize = 0;
+ coder->inPreSize = 0;
+ coder->inPreHeaderSize = 0;
+ coder->parseState = MTDEC_PARSE_CONTINUE;
+ coder->parsing_Truncated = False;
+ coder->skipMode = False;
+ coder->codeRes = SZ_OK;
+ coder->status = CODER_STATUS_NOT_SPECIFIED;
+ coder->inCodeSize = 0;
+ coder->outCodeSize = 0;
+
+ coder->numStreams = me->numStreams;
+ coder->numTotalBlocks = me->numTotalBlocks;
+ coder->numBlocks = me->numBlocks;
+
+ if (!coder->dec_created)
+ {
+ XzUnpacker_Construct(&coder->dec, &me->alignOffsetAlloc.vt);
+ coder->dec_created = True;
+ }
+
+ XzUnpacker_Init(&coder->dec);
+
+ if (me->isBlockHeaderState_Parse)
+ {
+ coder->dec.streamFlags = me->streamFlags;
+ coder->atBlockHeader = True;
+ XzUnpacker_PrepareToRandomBlockDecoding(&coder->dec);
+ }
+ else
+ {
+ coder->atBlockHeader = False;
+ me->isBlockHeaderState_Parse = True;
+ }
+
+ coder->dec.numStartedStreams = me->numStreams;
+ coder->dec.numTotalBlocks = me->numTotalBlocks;
+ coder->dec.numBlocks = me->numBlocks;
+ }
+
+ while (!coder->skipMode)
+ {
+ ECoderStatus status;
+ SRes res;
+ size_t srcSize2 = srcSize;
+ size_t destSize = (size_t)0 - 1;
+
+ coder->dec.parseMode = True;
+ coder->dec.headerParsedOk = False;
+
+ PRF_STR_INT("Parse", srcSize2);
+
+ res = XzUnpacker_Code(&coder->dec,
+ NULL, &destSize,
+ cc->src, &srcSize2, cc->srcFinished,
+ CODER_FINISH_END, &status);
+
+ // PRF(printf(" res = %d, srcSize2 = %d", res, (unsigned)srcSize2));
+
+ coder->codeRes = res;
+ coder->status = status;
+ cc->srcSize += srcSize2;
+ srcSize -= srcSize2;
+ coder->inPreHeaderSize += srcSize2;
+ coder->inPreSize = coder->inPreHeaderSize;
+
+ if (res != SZ_OK)
+ {
+ cc->state =
+ coder->parseState = MTDEC_PARSE_END;
+ /*
+ if (res == SZ_ERROR_MEM)
+ return res;
+ return SZ_OK;
+ */
+ return; // res;
+ }
+
+ if (coder->dec.headerParsedOk)
+ {
+ const CXzBlock *block = &coder->dec.block;
+ if (XzBlock_HasUnpackSize(block)
+ // && block->unpackSize <= me->props.outBlockMax
+ && XzBlock_HasPackSize(block))
+ {
+ {
+ if (block->unpackSize * 2 * me->mtc.numStartedThreads > me->props.memUseMax)
+ {
+ cc->state = MTDEC_PARSE_OVERFLOW;
+ return; // SZ_OK;
+ }
+ }
+ {
+ UInt64 packSize = block->packSize;
+ UInt64 packSizeAligned = packSize + ((0 - (unsigned)packSize) & 3);
+ UInt32 checkSize = XzFlags_GetCheckSize(coder->dec.streamFlags);
+ UInt64 blockPackSum = coder->inPreSize + packSizeAligned + checkSize;
+ // if (blockPackSum <= me->props.inBlockMax)
+ // unpackBlockMaxSize
+ {
+ coder->blockPackSize_for_Index = (size_t)(coder->dec.blockHeaderSize + packSize + checkSize);
+ coder->blockPackTotal = (size_t)blockPackSum;
+ coder->outPreSize = (size_t)block->unpackSize;
+ coder->streamFlags = coder->dec.streamFlags;
+ me->streamFlags = coder->dec.streamFlags;
+ coder->skipMode = True;
+ break;
+ }
+ }
+ }
+ }
+ else
+ // if (coder->inPreSize <= me->props.inBlockMax)
+ {
+ if (!cc->srcFinished)
+ return; // SZ_OK;
+ cc->state =
+ coder->parseState = MTDEC_PARSE_END;
+ return; // SZ_OK;
+ }
+ cc->state = MTDEC_PARSE_OVERFLOW;
+ return; // SZ_OK;
+ }
+
+ // ---------- skipMode ----------
+ {
+ UInt64 rem = coder->blockPackTotal - coder->inPreSize;
+ size_t cur = srcSize;
+ if (cur > rem)
+ cur = (size_t)rem;
+ cc->srcSize += cur;
+ coder->inPreSize += cur;
+ srcSize -= cur;
+
+ if (coder->inPreSize == coder->blockPackTotal)
+ {
+ if (srcSize == 0)
+ {
+ if (!cc->srcFinished)
+ return; // SZ_OK;
+ cc->state = MTDEC_PARSE_END;
+ }
+ else if ((cc->src)[cc->srcSize] == 0) // we check control byte of next block
+ cc->state = MTDEC_PARSE_END;
+ else
+ {
+ cc->state = MTDEC_PARSE_NEW;
+
+ {
+ size_t blockMax = me->unpackBlockMaxSize;
+ if (blockMax < coder->outPreSize)
+ blockMax = coder->outPreSize;
+ {
+ UInt64 required = (UInt64)blockMax * (me->mtc.numStartedThreads + 1) * 2;
+ if (me->props.memUseMax < required)
+ cc->canCreateNewThread = False;
+ }
+ }
+
+ if (me->outSize_Defined)
+ {
+ // next block can be zero size
+ const UInt64 rem2 = me->outSize - me->outProcessed_Parse;
+ if (rem2 < coder->outPreSize)
+ {
+ coder->parsing_Truncated = True;
+ cc->state = MTDEC_PARSE_END;
+ }
+ me->outProcessed_Parse += coder->outPreSize;
+ }
+ }
+ }
+ else if (cc->srcFinished)
+ cc->state = MTDEC_PARSE_END;
+ else
+ return; // SZ_OK;
+
+ coder->parseState = cc->state;
+ cc->outPos = coder->outPreSize;
+
+ me->numStreams = coder->dec.numStartedStreams;
+ me->numTotalBlocks = coder->dec.numTotalBlocks;
+ me->numBlocks = coder->dec.numBlocks + 1;
+ return; // SZ_OK;
+ }
+}
+
+
+static SRes XzDecMt_Callback_PreCode(void *pp, unsigned coderIndex)
+{
+ CXzDecMt *me = (CXzDecMt *)pp;
+ CXzDecMtThread *coder = &me->coders[coderIndex];
+ Byte *dest;
+
+ if (!coder->dec.headerParsedOk)
+ return SZ_OK;
+
+ dest = coder->outBuf;
+
+ if (!dest || coder->outBufSize < coder->outPreSize)
+ {
+ if (dest)
+ {
+ ISzAlloc_Free(me->allocMid, dest);
+ coder->outBuf = NULL;
+ coder->outBufSize = 0;
+ }
+ {
+ size_t outPreSize = coder->outPreSize;
+ if (outPreSize == 0)
+ outPreSize = 1;
+ dest = (Byte *)ISzAlloc_Alloc(me->allocMid, outPreSize);
+ }
+ if (!dest)
+ return SZ_ERROR_MEM;
+ coder->outBuf = dest;
+ coder->outBufSize = coder->outPreSize;
+
+ if (coder->outBufSize > me->unpackBlockMaxSize)
+ me->unpackBlockMaxSize = coder->outBufSize;
+ }
+
+ // return SZ_ERROR_MEM;
+
+ XzUnpacker_SetOutBuf(&coder->dec, coder->outBuf, coder->outBufSize);
+
+ {
+ SRes res = XzDecMix_Init(&coder->dec.decoder, &coder->dec.block, coder->outBuf, coder->outBufSize);
+ // res = SZ_ERROR_UNSUPPORTED; // to test
+ coder->codeRes = res;
+ if (res != SZ_OK)
+ {
+ // if (res == SZ_ERROR_MEM) return res;
+ if (me->props.ignoreErrors && res != SZ_ERROR_MEM)
+ return S_OK;
+ return res;
+ }
+ }
+
+ return SZ_OK;
+}
+
+
+static SRes XzDecMt_Callback_Code(void *pp, unsigned coderIndex,
+ const Byte *src, size_t srcSize, int srcFinished,
+ // int finished, int blockFinished,
+ UInt64 *inCodePos, UInt64 *outCodePos, int *stop)
+{
+ CXzDecMt *me = (CXzDecMt *)pp;
+ CXzDecMtThread *coder = &me->coders[coderIndex];
+
+ *inCodePos = coder->inCodeSize;
+ *outCodePos = coder->outCodeSize;
+ *stop = True;
+
+ if (coder->inCodeSize < coder->inPreHeaderSize)
+ {
+ UInt64 rem = coder->inPreHeaderSize - coder->inCodeSize;
+ size_t step = srcSize;
+ if (step > rem)
+ step = (size_t)rem;
+ src += step;
+ srcSize -= step;
+ coder->inCodeSize += step;
+ if (coder->inCodeSize < coder->inPreHeaderSize)
+ {
+ *stop = False;
+ return SZ_OK;
+ }
+ }
+
+ if (!coder->dec.headerParsedOk)
+ return SZ_OK;
+ if (!coder->outBuf)
+ return SZ_OK;
+
+ if (coder->codeRes == SZ_OK)
+ {
+ ECoderStatus status;
+ SRes res;
+ size_t srcProcessed = srcSize;
+ size_t outSizeCur = coder->outPreSize - coder->dec.outDataWritten;
+
+ // PRF(printf("\nCallback_Code: Code %d %d\n", (unsigned)srcSize, (unsigned)outSizeCur));
+
+ res = XzUnpacker_Code(&coder->dec,
+ NULL, &outSizeCur,
+ src, &srcProcessed, srcFinished,
+ // coder->finishedWithMark ? CODER_FINISH_END : CODER_FINISH_ANY,
+ CODER_FINISH_END,
+ &status);
+
+ // PRF(printf(" res = %d, srcSize2 = %d, outSizeCur = %d", res, (unsigned)srcProcessed, (unsigned)outSizeCur));
+
+ coder->codeRes = res;
+ coder->status = status;
+ coder->inCodeSize += srcProcessed;
+ coder->outCodeSize = coder->dec.outDataWritten;
+ *inCodePos = coder->inCodeSize;
+ *outCodePos = coder->outCodeSize;
+
+ if (res == SZ_OK)
+ {
+ if (srcProcessed == srcSize)
+ *stop = False;
+ return SZ_OK;
+ }
+ }
+
+ if (me->props.ignoreErrors && coder->codeRes != SZ_ERROR_MEM)
+ {
+ *inCodePos = coder->inPreSize;
+ *outCodePos = coder->outPreSize;
+ return S_OK;
+ }
+ return coder->codeRes;
+}
+
+
+#define XZDECMT_STREAM_WRITE_STEP (1 << 24)
+
+static SRes XzDecMt_Callback_Write(void *pp, unsigned coderIndex,
+ Bool needWriteToStream,
+ const Byte *src, size_t srcSize,
+ // int srcFinished,
+ Bool *needContinue,
+ Bool *canRecode)
+{
+ CXzDecMt *me = (CXzDecMt *)pp;
+ const CXzDecMtThread *coder = &me->coders[coderIndex];
+
+ // PRF(printf("\nWrite processed = %d srcSize = %d\n", (unsigned)me->mtc.inProcessed, (unsigned)srcSize));
+
+ *needContinue = False;
+ *canRecode = True;
+
+ if (!needWriteToStream)
+ return SZ_OK;
+
+ if (!coder->dec.headerParsedOk || !coder->outBuf)
+ {
+ if (me->finishedDecoderIndex < 0)
+ me->finishedDecoderIndex = coderIndex;
+ return SZ_OK;
+ }
+
+ if (me->finishedDecoderIndex >= 0)
+ return SZ_OK;
+
+ me->mtc.inProcessed += coder->inCodeSize;
+
+ *canRecode = False;
+
+ {
+ SRes res;
+ size_t size = coder->outCodeSize;
+ Byte *data = coder->outBuf;
+
+ // we use in me->dec: sha, numBlocks, indexSize
+
+ if (!me->isBlockHeaderState_Write)
+ {
+ XzUnpacker_PrepareToRandomBlockDecoding(&me->dec);
+ me->dec.decodeOnlyOneBlock = False;
+ me->dec.numStartedStreams = coder->dec.numStartedStreams;
+ me->dec.streamFlags = coder->streamFlags;
+
+ me->isBlockHeaderState_Write = True;
+ }
+
+ me->dec.numTotalBlocks = coder->dec.numTotalBlocks;
+ XzUnpacker_UpdateIndex(&me->dec, coder->blockPackSize_for_Index, coder->outPreSize);
+
+ if (coder->outPreSize != size)
+ {
+ if (me->props.ignoreErrors)
+ {
+ memset(data + size, 0, coder->outPreSize - size);
+ size = coder->outPreSize;
+ }
+ // me->numBadBlocks++;
+ if (me->mainErrorCode == SZ_OK)
+ {
+ if ((int)coder->status == LZMA_STATUS_NEEDS_MORE_INPUT)
+ me->mainErrorCode = SZ_ERROR_INPUT_EOF;
+ else
+ me->mainErrorCode = SZ_ERROR_DATA;
+ }
+ }
+
+ if (me->writeRes != SZ_OK)
+ return me->writeRes;
+
+ res = SZ_OK;
+ {
+ if (me->outSize_Defined)
+ {
+ const UInt64 rem = me->outSize - me->outProcessed;
+ if (size > rem)
+ size = (SizeT)rem;
+ }
+
+ for (;;)
+ {
+ size_t cur = size;
+ size_t written;
+ if (cur > XZDECMT_STREAM_WRITE_STEP)
+ cur = XZDECMT_STREAM_WRITE_STEP;
+
+ written = ISeqOutStream_Write(me->outStream, data, cur);
+
+ // PRF(printf("\nWritten ask = %d written = %d\n", (unsigned)cur, (unsigned)written));
+
+ me->outProcessed += written;
+ if (written != cur)
+ {
+ me->writeRes = SZ_ERROR_WRITE;
+ res = me->writeRes;
+ break;
+ }
+ data += cur;
+ size -= cur;
+ // PRF_STR_INT("Written size =", size);
+ if (size == 0)
+ break;
+ res = MtProgress_ProgressAdd(&me->mtc.mtProgress, 0, 0);
+ if (res != SZ_OK)
+ break;
+ }
+ }
+
+ if (coder->codeRes != SZ_OK)
+ if (!me->props.ignoreErrors)
+ {
+ me->finishedDecoderIndex = coderIndex;
+ return res;
+ }
+
+ RINOK(res);
+
+ if (coder->inPreSize != coder->inCodeSize
+ || coder->blockPackTotal != coder->inCodeSize)
+ {
+ me->finishedDecoderIndex = coderIndex;
+ return SZ_OK;
+ }
+
+ if (coder->parseState != MTDEC_PARSE_END)
+ {
+ *needContinue = True;
+ return SZ_OK;
+ }
+ }
+
+ // (coder->state == MTDEC_PARSE_END) means that there are no other working threads
+ // so we can use mtc variables without lock
+
+ PRF_STR_INT("Write MTDEC_PARSE_END", me->mtc.inProcessed);
+
+ me->mtc.mtProgress.totalInSize = me->mtc.inProcessed;
+ {
+ CXzUnpacker *dec = &me->dec;
+
+ PRF_STR_INT("PostSingle", srcSize);
+
+ {
+ size_t srcProcessed = srcSize;
+ ECoderStatus status;
+ size_t outSizeCur = 0;
+ SRes res;
+
+ // dec->decodeOnlyOneBlock = False;
+ dec->decodeToStreamSignature = True;
+
+ me->mainDecoderWasCalled = True;
+
+ if (coder->parsing_Truncated)
+ {
+ me->parsing_Truncated = True;
+ return SZ_OK;
+ }
+
+ res = XzUnpacker_Code(dec,
+ NULL, &outSizeCur,
+ src, &srcProcessed,
+ me->mtc.readWasFinished, // srcFinished
+ CODER_FINISH_END, // CODER_FINISH_ANY,
+ &status);
+
+ me->status = status;
+ me->codeRes = res;
+
+ me->mtc.inProcessed += srcProcessed;
+ me->mtc.mtProgress.totalInSize = me->mtc.inProcessed;
+
+ if (res != SZ_OK)
+ {
+ return S_OK;
+ // return res;
+ }
+
+ if (dec->state == XZ_STATE_STREAM_HEADER)
+ {
+ *needContinue = True;
+ me->isBlockHeaderState_Parse = False;
+ me->isBlockHeaderState_Write = False;
+ {
+ Byte *crossBuf = MtDec_GetCrossBuff(&me->mtc);
+ if (!crossBuf)
+ return SZ_ERROR_MEM;
+ memcpy(crossBuf, src + srcProcessed, srcSize - srcProcessed);
+ }
+ me->mtc.crossStart = 0;
+ me->mtc.crossEnd = srcSize - srcProcessed;
+ return SZ_OK;
+ }
+
+ if (status != CODER_STATUS_NEEDS_MORE_INPUT)
+ {
+ return E_FAIL;
+ }
+
+ if (me->mtc.readWasFinished)
+ {
+ return SZ_OK;
+ }
+ }
+
+ {
+ size_t inPos;
+ size_t inLim;
+ const Byte *inData;
+ UInt64 inProgressPrev = me->mtc.inProcessed;
+
+ // XzDecMt_Prepare_InBuf_ST(p);
+ Byte *crossBuf = MtDec_GetCrossBuff(&me->mtc);
+ if (!crossBuf)
+ return SZ_ERROR_MEM;
+
+ inPos = 0;
+ inLim = 0;
+ // outProcessed = 0;
+
+ inData = crossBuf;
+
+ for (;;)
+ {
+ SizeT inProcessed;
+ SizeT outProcessed;
+ ECoderStatus status;
+ SRes res;
+
+ if (inPos == inLim)
+ {
+ if (!me->mtc.readWasFinished)
+ {
+ inPos = 0;
+ inLim = me->mtc.inBufSize;
+ me->mtc.readRes = ISeqInStream_Read(me->inStream, (void *)inData, &inLim);
+ me->mtc.readProcessed += inLim;
+ if (inLim == 0 || me->mtc.readRes != SZ_OK)
+ me->mtc.readWasFinished = True;
+ }
+ }
+
+ inProcessed = inLim - inPos;
+ outProcessed = 0;
+
+ res = XzUnpacker_Code(dec,
+ NULL, &outProcessed,
+ inData + inPos, &inProcessed,
+ (inProcessed == 0), // srcFinished
+ CODER_FINISH_END, &status);
+
+ me->codeRes = res;
+ me->status = status;
+ inPos += inProcessed;
+ me->mtc.inProcessed += inProcessed;
+ me->mtc.mtProgress.totalInSize = me->mtc.inProcessed;
+
+ if (res != SZ_OK)
+ {
+ return S_OK;
+ // return res;
+ }
+
+ if (dec->state == XZ_STATE_STREAM_HEADER)
+ {
+ *needContinue = True;
+ me->mtc.crossStart = inPos;
+ me->mtc.crossEnd = inLim;
+ me->isBlockHeaderState_Parse = False;
+ me->isBlockHeaderState_Write = False;
+ return SZ_OK;
+ }
+
+ if (status != CODER_STATUS_NEEDS_MORE_INPUT)
+ return E_FAIL;
+
+ if (me->mtc.progress)
+ {
+ UInt64 inDelta = me->mtc.inProcessed - inProgressPrev;
+ if (inDelta >= (1 << 22))
+ {
+ RINOK(MtProgress_Progress_ST(&me->mtc.mtProgress));
+ inProgressPrev = me->mtc.inProcessed;
+ }
+ }
+ if (me->mtc.readWasFinished)
+ return SZ_OK;
+ }
+ }
+ }
+}
+
+
+#endif
+
+
+
+void XzStatInfo_Clear(CXzStatInfo *p)
+{
+ p->InSize = 0;
+ p->OutSize = 0;
+
+ p->NumStreams = 0;
+ p->NumBlocks = 0;
+
+ p->UnpackSize_Defined = False;
+
+ p->NumStreams_Defined = False;
+ p->NumBlocks_Defined = False;
+
+ // p->IsArc = False;
+ // p->UnexpectedEnd = False;
+ // p->Unsupported = False;
+ // p->HeadersError = False;
+ // p->DataError = False;
+ // p->CrcError = False;
+
+ p->DataAfterEnd = False;
+ p->DecodingTruncated = False;
+
+ p->DecodeRes = SZ_OK;
+ p->ReadRes = SZ_OK;
+ p->ProgressRes = SZ_OK;
+
+ p->CombinedRes = SZ_OK;
+ p->CombinedRes_Type = SZ_OK;
+}
+
+
+
+
+static SRes XzDecMt_Decode_ST(CXzDecMt *p
+ #ifndef _7ZIP_ST
+ , Bool tMode
+ #endif
+ , CXzStatInfo *stat)
+{
+ size_t outPos;
+ size_t inPos, inLim;
+ const Byte *inData;
+ UInt64 inPrev, outPrev;
+
+ CXzUnpacker *dec;
+
+ #ifndef _7ZIP_ST
+ if (tMode)
+ {
+ XzDecMt_FreeOutBufs(p);
+ tMode = MtDec_PrepareRead(&p->mtc);
+ }
+ #endif
+
+ if (!p->outBuf || p->outBufSize != p->props.outStep_ST)
+ {
+ ISzAlloc_Free(p->allocMid, p->outBuf);
+ p->outBufSize = 0;
+ p->outBuf = (Byte *)ISzAlloc_Alloc(p->allocMid, p->props.outStep_ST);
+ if (!p->outBuf)
+ return SZ_ERROR_MEM;
+ p->outBufSize = p->props.outStep_ST;
+ }
+
+ if (!p->inBuf || p->inBufSize != p->props.inBufSize_ST)
+ {
+ ISzAlloc_Free(p->allocMid, p->inBuf);
+ p->inBufSize = 0;
+ p->inBuf = (Byte *)ISzAlloc_Alloc(p->allocMid, p->props.inBufSize_ST);
+ if (!p->inBuf)
+ return SZ_ERROR_MEM;
+ p->inBufSize = p->props.inBufSize_ST;
+ }
+
+ dec = &p->dec;
+ dec->decodeToStreamSignature = False;
+ // dec->decodeOnlyOneBlock = False;
+
+ XzUnpacker_SetOutBuf(dec, NULL, 0);
+
+ inPrev = p->inProcessed;
+ outPrev = p->outProcessed;
+
+ inPos = 0;
+ inLim = 0;
+ inData = NULL;
+ outPos = 0;
+
+ for (;;)
+ {
+ SizeT outSize;
+ Bool finished;
+ ECoderFinishMode finishMode;
+ SizeT inProcessed;
+ ECoderStatus status;
+ SRes res;
+
+ SizeT outProcessed;
+
+
+
+ if (inPos == inLim)
+ {
+ #ifndef _7ZIP_ST
+ if (tMode)
+ {
+ inData = MtDec_Read(&p->mtc, &inLim);
+ inPos = 0;
+ if (inData)
+ continue;
+ tMode = False;
+ inLim = 0;
+ }
+ #endif
+
+ if (!p->readWasFinished)
+ {
+ inPos = 0;
+ inLim = p->inBufSize;
+ inData = p->inBuf;
+ p->readRes = ISeqInStream_Read(p->inStream, (void *)inData, &inLim);
+ p->readProcessed += inLim;
+ if (inLim == 0 || p->readRes != SZ_OK)
+ p->readWasFinished = True;
+ }
+ }
+
+ outSize = p->props.outStep_ST - outPos;
+
+ finishMode = CODER_FINISH_ANY;
+ if (p->outSize_Defined)
+ {
+ const UInt64 rem = p->outSize - p->outProcessed;
+ if (outSize >= rem)
+ {
+ outSize = (SizeT)rem;
+ if (p->finishMode)
+ finishMode = CODER_FINISH_END;
+ }
+ }
+
+ inProcessed = inLim - inPos;
+ outProcessed = outSize;
+
+ res = XzUnpacker_Code(dec, p->outBuf + outPos, &outProcessed,
+ inData + inPos, &inProcessed,
+ (inPos == inLim), // srcFinished
+ finishMode, &status);
+
+ p->codeRes = res;
+ p->status = status;
+
+ inPos += inProcessed;
+ outPos += outProcessed;
+ p->inProcessed += inProcessed;
+ p->outProcessed += outProcessed;
+
+ finished = ((inProcessed == 0 && outProcessed == 0) || res != SZ_OK);
+
+ if (finished || outProcessed >= outSize)
+ if (outPos != 0)
+ {
+ size_t written = ISeqOutStream_Write(p->outStream, p->outBuf, outPos);
+ p->outProcessed += written;
+ if (written != outPos)
+ {
+ stat->CombinedRes_Type = SZ_ERROR_WRITE;
+ return SZ_ERROR_WRITE;
+ }
+ outPos = 0;
+ }
+
+ if (p->progress && res == SZ_OK)
+ {
+ UInt64 inDelta = p->inProcessed - inPrev;
+ UInt64 outDelta = p->outProcessed - outPrev;
+ if (inDelta >= (1 << 22) || outDelta >= (1 << 22))
+ {
+ res = ICompressProgress_Progress(p->progress, p->inProcessed, p->outProcessed);
+ if (res != SZ_OK)
+ {
+ stat->CombinedRes_Type = SZ_ERROR_PROGRESS;
+ stat->ProgressRes = res;
+ return res;
+ }
+ inPrev = p->inProcessed;
+ outPrev = p->outProcessed;
+ }
+ }
+
+ if (finished)
+ return res;
+ }
+}
+
+static SRes XzStatInfo_SetStat(const CXzUnpacker *dec,
+ int finishMode,
+ UInt64 readProcessed, UInt64 inProcessed,
+ SRes res, ECoderStatus status,
+ Bool decodingTruncated,
+ CXzStatInfo *stat)
+{
+ UInt64 extraSize;
+
+ stat->DecodingTruncated = (Byte)(decodingTruncated ? 1 : 0);
+ stat->InSize = inProcessed;
+ stat->NumStreams = dec->numStartedStreams;
+ stat->NumBlocks = dec->numTotalBlocks;
+
+ stat->UnpackSize_Defined = True;
+ stat->NumStreams_Defined = True;
+ stat->NumBlocks_Defined = True;
+
+ extraSize = XzUnpacker_GetExtraSize(dec);
+
+ if (res == SZ_OK)
+ {
+ if (status == CODER_STATUS_NEEDS_MORE_INPUT)
+ {
+ // CODER_STATUS_NEEDS_MORE_INPUT is expected status for correct xz streams
+ extraSize = 0;
+ if (!XzUnpacker_IsStreamWasFinished(dec))
+ res = SZ_ERROR_INPUT_EOF;
+ }
+ else if (!decodingTruncated || finishMode) // (status == CODER_STATUS_NOT_FINISHED)
+ res = SZ_ERROR_DATA;
+ }
+ else if (res == SZ_ERROR_NO_ARCHIVE)
+ {
+ /*
+ SZ_ERROR_NO_ARCHIVE is possible for 2 states:
+ XZ_STATE_STREAM_HEADER - if bad signature or bad CRC
+ XZ_STATE_STREAM_PADDING - if non-zero padding data
+ extraSize / inProcessed don't include "bad" byte
+ */
+ if (inProcessed != extraSize) // if good streams before error
+ if (extraSize != 0 || readProcessed != inProcessed)
+ {
+ stat->DataAfterEnd = True;
+ // there is some good xz stream before. So we set SZ_OK
+ res = SZ_OK;
+ }
+ }
+
+ stat->DecodeRes = res;
+
+ stat->InSize -= extraSize;
+ return res;
+}
+
+
+SRes XzDecMt_Decode(CXzDecMtHandle pp,
+ const CXzDecMtProps *props,
+ const UInt64 *outDataSize, int finishMode,
+ ISeqOutStream *outStream,
+ // Byte *outBuf, size_t *outBufSize,
+ ISeqInStream *inStream,
+ // const Byte *inData, size_t inDataSize,
+ CXzStatInfo *stat,
+ int *isMT,
+ ICompressProgress *progress)
+{
+ CXzDecMt *p = (CXzDecMt *)pp;
+ #ifndef _7ZIP_ST
+ Bool tMode;
+ #endif
+
+ XzStatInfo_Clear(stat);
+
+ p->props = *props;
+
+ p->inStream = inStream;
+ p->outStream = outStream;
+ p->progress = progress;
+ // p->stat = stat;
+
+ p->outSize = 0;
+ p->outSize_Defined = False;
+ if (outDataSize)
+ {
+ p->outSize_Defined = True;
+ p->outSize = *outDataSize;
+ }
+
+ p->finishMode = finishMode;
+
+ // p->outSize = 457; p->outSize_Defined = True; p->finishMode = False; // for test
+
+ p->writeRes = SZ_OK;
+ p->outProcessed = 0;
+ p->inProcessed = 0;
+ p->readProcessed = 0;
+ p->readWasFinished = False;
+
+ p->codeRes = 0;
+ p->status = CODER_STATUS_NOT_SPECIFIED;
+
+ if (!p->dec_created)
+ {
+ XzUnpacker_Construct(&p->dec, &p->alignOffsetAlloc.vt);
+ p->dec_created = True;
+ }
+ XzUnpacker_Init(&p->dec);
+
+
+ *isMT = False;
+
+ /*
+ p->outBuf = NULL;
+ p->outBufSize = 0;
+ if (!outStream)
+ {
+ p->outBuf = outBuf;
+ p->outBufSize = *outBufSize;
+ *outBufSize = 0;
+ }
+ */
+
+
+ #ifndef _7ZIP_ST
+
+ p->isBlockHeaderState_Parse = False;
+ p->isBlockHeaderState_Write = False;
+ // p->numBadBlocks = 0;
+ p->mainErrorCode = SZ_OK;
+ p->mainDecoderWasCalled = False;
+
+ tMode = False;
+
+ if (p->props.numThreads > 1)
+ {
+ IMtDecCallback vt;
+
+ XzDecMt_FreeSt(p);
+
+ p->outProcessed_Parse = 0;
+ p->parsing_Truncated = False;
+
+ p->numStreams = 0;
+ p->numTotalBlocks = 0;
+ p->numBlocks = 0;
+ p->finishedDecoderIndex = -1;
+
+ if (!p->mtc_WasConstructed)
+ {
+ p->mtc_WasConstructed = True;
+ MtDec_Construct(&p->mtc);
+ }
+
+ p->mtc.mtCallback = &vt;
+ p->mtc.mtCallbackObject = p;
+
+ p->mtc.progress = progress;
+ p->mtc.inStream = inStream;
+ p->mtc.alloc = &p->alignOffsetAlloc.vt;
+ // p->mtc.inData = inData;
+ // p->mtc.inDataSize = inDataSize;
+ p->mtc.inBufSize = p->props.inBufSize_MT;
+ // p->mtc.inBlockMax = p->props.inBlockMax;
+ p->mtc.numThreadsMax = p->props.numThreads;
+
+ *isMT = True;
+
+ vt.Parse = XzDecMt_Callback_Parse;
+ vt.PreCode = XzDecMt_Callback_PreCode;
+ vt.Code = XzDecMt_Callback_Code;
+ vt.Write = XzDecMt_Callback_Write;
+
+ {
+ Bool needContinue;
+
+ SRes res = MtDec_Code(&p->mtc);
+
+ stat->InSize = p->mtc.inProcessed;
+
+ p->inProcessed = p->mtc.inProcessed;
+ p->readRes = p->mtc.readRes;
+ p->readWasFinished = p->mtc.readWasFinished;
+ p->readProcessed = p->mtc.readProcessed;
+
+ tMode = True;
+ needContinue = False;
+
+ if (res == SZ_OK)
+ {
+ if (p->mtc.mtProgress.res != SZ_OK)
+ {
+ res = p->mtc.mtProgress.res;
+ stat->ProgressRes = res;
+ stat->CombinedRes_Type = SZ_ERROR_PROGRESS;
+ }
+ else
+ needContinue = p->mtc.needContinue;
+ }
+
+ if (!needContinue)
+ {
+ SRes codeRes;
+ Bool truncated = False;
+ ECoderStatus status;
+ CXzUnpacker *dec;
+
+ stat->OutSize = p->outProcessed;
+
+ if (p->finishedDecoderIndex >= 0)
+ {
+ CXzDecMtThread *coder = &p->coders[(unsigned)p->finishedDecoderIndex];
+ codeRes = coder->codeRes;
+ dec = &coder->dec;
+ status = coder->status;
+ }
+ else if (p->mainDecoderWasCalled)
+ {
+ codeRes = p->codeRes;
+ dec = &p->dec;
+ status = p->status;
+ truncated = p->parsing_Truncated;
+ }
+ else
+ return E_FAIL;
+
+ XzStatInfo_SetStat(dec, p->finishMode,
+ p->mtc.readProcessed, p->mtc.inProcessed,
+ codeRes, status,
+ truncated,
+ stat);
+
+ if (res == SZ_OK)
+ {
+ if (p->writeRes != SZ_OK)
+ {
+ res = p->writeRes;
+ stat->CombinedRes_Type = SZ_ERROR_WRITE;
+ }
+ else if (p->mtc.readRes != SZ_OK && p->mtc.inProcessed == p->mtc.readProcessed)
+ {
+ res = p->mtc.readRes;
+ stat->ReadRes = res;
+ stat->CombinedRes_Type = SZ_ERROR_READ;
+ }
+ else if (p->mainErrorCode != SZ_OK)
+ {
+ res = p->mainErrorCode;
+ }
+ }
+
+ stat->CombinedRes = res;
+ if (stat->CombinedRes_Type == SZ_OK)
+ stat->CombinedRes_Type = res;
+ return res;
+ }
+
+ PRF_STR("----- decoding ST -----");
+ }
+ }
+
+ #endif
+
+
+ *isMT = False;
+
+ {
+ SRes res = XzDecMt_Decode_ST(p
+ #ifndef _7ZIP_ST
+ , tMode
+ #endif
+ , stat
+ );
+
+ XzStatInfo_SetStat(&p->dec,
+ p->finishMode,
+ p->readProcessed, p->inProcessed,
+ p->codeRes, p->status,
+ False, // truncated
+ stat);
+
+ if (res == SZ_OK)
+ {
+ /*
+ if (p->writeRes != SZ_OK)
+ {
+ res = p->writeRes;
+ stat->CombinedRes_Type = SZ_ERROR_WRITE;
+ }
+ else
+ */
+ if (p->readRes != SZ_OK && p->inProcessed == p->readProcessed)
+ {
+ res = p->readRes;
+ stat->ReadRes = res;
+ stat->CombinedRes_Type = SZ_ERROR_READ;
+ }
+ #ifndef _7ZIP_ST
+ else if (p->mainErrorCode != SZ_OK)
+ res = p->mainErrorCode;
+ #endif
+ }
+
+ stat->CombinedRes = res;
+ if (stat->CombinedRes_Type == SZ_OK)
+ stat->CombinedRes_Type = res;
+ return res;
+ }
+}
diff --git a/other-licenses/7zstub/src/C/XzEnc.c b/other-licenses/7zstub/src/C/XzEnc.c
new file mode 100644
index 0000000000..432cbfe79c
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzEnc.c
@@ -0,0 +1,1329 @@
+/* XzEnc.c -- Xz Encode
+2018-04-28 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "7zCrc.h"
+#include "Bra.h"
+#include "CpuArch.h"
+
+#ifdef USE_SUBBLOCK
+#include "Bcj3Enc.c"
+#include "SbFind.c"
+#include "SbEnc.c"
+#endif
+
+#include "XzEnc.h"
+
+// #define _7ZIP_ST
+
+#ifndef _7ZIP_ST
+#include "MtCoder.h"
+#else
+#define MTCODER__THREADS_MAX 1
+#define MTCODER__BLOCKS_MAX 1
+#endif
+
+#define XZ_GET_PAD_SIZE(dataSize) ((4 - ((unsigned)(dataSize) & 3)) & 3)
+
+/* max pack size for LZMA2 block + check-64bytrs: */
+#define XZ_GET_MAX_BLOCK_PACK_SIZE(unpackSize) ((unpackSize) + ((unpackSize) >> 10) + 16 + 64)
+
+#define XZ_GET_ESTIMATED_BLOCK_TOTAL_PACK_SIZE(unpackSize) (XZ_BLOCK_HEADER_SIZE_MAX + XZ_GET_MAX_BLOCK_PACK_SIZE(unpackSize))
+
+
+#define XzBlock_ClearFlags(p) (p)->flags = 0;
+#define XzBlock_SetNumFilters(p, n) (p)->flags |= ((n) - 1);
+#define XzBlock_SetHasPackSize(p) (p)->flags |= XZ_BF_PACK_SIZE;
+#define XzBlock_SetHasUnpackSize(p) (p)->flags |= XZ_BF_UNPACK_SIZE;
+
+
+static SRes WriteBytes(ISeqOutStream *s, const void *buf, size_t size)
+{
+ return (ISeqOutStream_Write(s, buf, size) == size) ? SZ_OK : SZ_ERROR_WRITE;
+}
+
+static SRes WriteBytesUpdateCrc(ISeqOutStream *s, const void *buf, size_t size, UInt32 *crc)
+{
+ *crc = CrcUpdate(*crc, buf, size);
+ return WriteBytes(s, buf, size);
+}
+
+
+static SRes Xz_WriteHeader(CXzStreamFlags f, ISeqOutStream *s)
+{
+ UInt32 crc;
+ Byte header[XZ_STREAM_HEADER_SIZE];
+ memcpy(header, XZ_SIG, XZ_SIG_SIZE);
+ header[XZ_SIG_SIZE] = (Byte)(f >> 8);
+ header[XZ_SIG_SIZE + 1] = (Byte)(f & 0xFF);
+ crc = CrcCalc(header + XZ_SIG_SIZE, XZ_STREAM_FLAGS_SIZE);
+ SetUi32(header + XZ_SIG_SIZE + XZ_STREAM_FLAGS_SIZE, crc);
+ return WriteBytes(s, header, XZ_STREAM_HEADER_SIZE);
+}
+
+
+static SRes XzBlock_WriteHeader(const CXzBlock *p, ISeqOutStream *s)
+{
+ Byte header[XZ_BLOCK_HEADER_SIZE_MAX];
+
+ unsigned pos = 1;
+ unsigned numFilters, i;
+ header[pos++] = p->flags;
+
+ if (XzBlock_HasPackSize(p)) pos += Xz_WriteVarInt(header + pos, p->packSize);
+ if (XzBlock_HasUnpackSize(p)) pos += Xz_WriteVarInt(header + pos, p->unpackSize);
+ numFilters = XzBlock_GetNumFilters(p);
+
+ for (i = 0; i < numFilters; i++)
+ {
+ const CXzFilter *f = &p->filters[i];
+ pos += Xz_WriteVarInt(header + pos, f->id);
+ pos += Xz_WriteVarInt(header + pos, f->propsSize);
+ memcpy(header + pos, f->props, f->propsSize);
+ pos += f->propsSize;
+ }
+
+ while ((pos & 3) != 0)
+ header[pos++] = 0;
+
+ header[0] = (Byte)(pos >> 2);
+ SetUi32(header + pos, CrcCalc(header, pos));
+ return WriteBytes(s, header, pos + 4);
+}
+
+
+
+
+typedef struct
+{
+ size_t numBlocks;
+ size_t size;
+ size_t allocated;
+ Byte *blocks;
+} CXzEncIndex;
+
+
+static void XzEncIndex_Construct(CXzEncIndex *p)
+{
+ p->numBlocks = 0;
+ p->size = 0;
+ p->allocated = 0;
+ p->blocks = NULL;
+}
+
+static void XzEncIndex_Init(CXzEncIndex *p)
+{
+ p->numBlocks = 0;
+ p->size = 0;
+}
+
+static void XzEncIndex_Free(CXzEncIndex *p, ISzAllocPtr alloc)
+{
+ if (p->blocks)
+ {
+ ISzAlloc_Free(alloc, p->blocks);
+ p->blocks = NULL;
+ }
+ p->numBlocks = 0;
+ p->size = 0;
+ p->allocated = 0;
+}
+
+
+static SRes XzEncIndex_ReAlloc(CXzEncIndex *p, size_t newSize, ISzAllocPtr alloc)
+{
+ Byte *blocks = (Byte *)ISzAlloc_Alloc(alloc, newSize);
+ if (!blocks)
+ return SZ_ERROR_MEM;
+ if (p->size != 0)
+ memcpy(blocks, p->blocks, p->size);
+ if (p->blocks)
+ ISzAlloc_Free(alloc, p->blocks);
+ p->blocks = blocks;
+ p->allocated = newSize;
+ return SZ_OK;
+}
+
+
+static SRes XzEncIndex_PreAlloc(CXzEncIndex *p, UInt64 numBlocks, UInt64 unpackSize, UInt64 totalSize, ISzAllocPtr alloc)
+{
+ UInt64 pos;
+ {
+ Byte buf[32];
+ unsigned pos2 = Xz_WriteVarInt(buf, totalSize);
+ pos2 += Xz_WriteVarInt(buf + pos2, unpackSize);
+ pos = numBlocks * pos2;
+ }
+
+ if (pos <= p->allocated - p->size)
+ return SZ_OK;
+ {
+ UInt64 newSize64 = p->size + pos;
+ size_t newSize = (size_t)newSize64;
+ if (newSize != newSize64)
+ return SZ_ERROR_MEM;
+ return XzEncIndex_ReAlloc(p, newSize, alloc);
+ }
+}
+
+
+static SRes XzEncIndex_AddIndexRecord(CXzEncIndex *p, UInt64 unpackSize, UInt64 totalSize, ISzAllocPtr alloc)
+{
+ Byte buf[32];
+ unsigned pos = Xz_WriteVarInt(buf, totalSize);
+ pos += Xz_WriteVarInt(buf + pos, unpackSize);
+
+ if (pos > p->allocated - p->size)
+ {
+ size_t newSize = p->allocated * 2 + 16 * 2;
+ if (newSize < p->size + pos)
+ return SZ_ERROR_MEM;
+ RINOK(XzEncIndex_ReAlloc(p, newSize, alloc));
+ }
+ memcpy(p->blocks + p->size, buf, pos);
+ p->size += pos;
+ p->numBlocks++;
+ return SZ_OK;
+}
+
+
+static SRes XzEncIndex_WriteFooter(const CXzEncIndex *p, CXzStreamFlags flags, ISeqOutStream *s)
+{
+ Byte buf[32];
+ UInt64 globalPos;
+ UInt32 crc = CRC_INIT_VAL;
+ unsigned pos = 1 + Xz_WriteVarInt(buf + 1, p->numBlocks);
+
+ globalPos = pos;
+ buf[0] = 0;
+ RINOK(WriteBytesUpdateCrc(s, buf, pos, &crc));
+ RINOK(WriteBytesUpdateCrc(s, p->blocks, p->size, &crc));
+ globalPos += p->size;
+
+ pos = XZ_GET_PAD_SIZE(globalPos);
+ buf[1] = 0;
+ buf[2] = 0;
+ buf[3] = 0;
+ globalPos += pos;
+
+ crc = CrcUpdate(crc, buf + 4 - pos, pos);
+ SetUi32(buf + 4, CRC_GET_DIGEST(crc));
+
+ SetUi32(buf + 8 + 4, (UInt32)(globalPos >> 2));
+ buf[8 + 8] = (Byte)(flags >> 8);
+ buf[8 + 9] = (Byte)(flags & 0xFF);
+ SetUi32(buf + 8, CrcCalc(buf + 8 + 4, 6));
+ buf[8 + 10] = XZ_FOOTER_SIG_0;
+ buf[8 + 11] = XZ_FOOTER_SIG_1;
+
+ return WriteBytes(s, buf + 4 - pos, pos + 4 + 12);
+}
+
+
+
+/* ---------- CSeqCheckInStream ---------- */
+
+typedef struct
+{
+ ISeqInStream vt;
+ ISeqInStream *realStream;
+ const Byte *data;
+ UInt64 limit;
+ UInt64 processed;
+ int realStreamFinished;
+ CXzCheck check;
+} CSeqCheckInStream;
+
+static void SeqCheckInStream_Init(CSeqCheckInStream *p, unsigned checkMode)
+{
+ p->limit = (UInt64)(Int64)-1;
+ p->processed = 0;
+ p->realStreamFinished = 0;
+ XzCheck_Init(&p->check, checkMode);
+}
+
+static void SeqCheckInStream_GetDigest(CSeqCheckInStream *p, Byte *digest)
+{
+ XzCheck_Final(&p->check, digest);
+}
+
+static SRes SeqCheckInStream_Read(const ISeqInStream *pp, void *data, size_t *size)
+{
+ CSeqCheckInStream *p = CONTAINER_FROM_VTBL(pp, CSeqCheckInStream, vt);
+ size_t size2 = *size;
+ SRes res = SZ_OK;
+
+ if (p->limit != (UInt64)(Int64)-1)
+ {
+ UInt64 rem = p->limit - p->processed;
+ if (size2 > rem)
+ size2 = (size_t)rem;
+ }
+ if (size2 != 0)
+ {
+ if (p->realStream)
+ {
+ res = ISeqInStream_Read(p->realStream, data, &size2);
+ p->realStreamFinished = (size2 == 0) ? 1 : 0;
+ }
+ else
+ memcpy(data, p->data + (size_t)p->processed, size2);
+ XzCheck_Update(&p->check, data, size2);
+ p->processed += size2;
+ }
+ *size = size2;
+ return res;
+}
+
+
+/* ---------- CSeqSizeOutStream ---------- */
+
+typedef struct
+{
+ ISeqOutStream vt;
+ ISeqOutStream *realStream;
+ Byte *outBuf;
+ size_t outBufLimit;
+ UInt64 processed;
+} CSeqSizeOutStream;
+
+static size_t SeqSizeOutStream_Write(const ISeqOutStream *pp, const void *data, size_t size)
+{
+ CSeqSizeOutStream *p = CONTAINER_FROM_VTBL(pp, CSeqSizeOutStream, vt);
+ if (p->realStream)
+ size = ISeqOutStream_Write(p->realStream, data, size);
+ else
+ {
+ if (size > p->outBufLimit - (size_t)p->processed)
+ return 0;
+ memcpy(p->outBuf + (size_t)p->processed, data, size);
+ }
+ p->processed += size;
+ return size;
+}
+
+
+/* ---------- CSeqInFilter ---------- */
+
+#define FILTER_BUF_SIZE (1 << 20)
+
+typedef struct
+{
+ ISeqInStream p;
+ ISeqInStream *realStream;
+ IStateCoder StateCoder;
+ Byte *buf;
+ size_t curPos;
+ size_t endPos;
+ int srcWasFinished;
+} CSeqInFilter;
+
+
+SRes BraState_SetFromMethod(IStateCoder *p, UInt64 id, int encodeMode, ISzAllocPtr alloc);
+
+static SRes SeqInFilter_Init(CSeqInFilter *p, const CXzFilter *props, ISzAllocPtr alloc)
+{
+ if (!p->buf)
+ {
+ p->buf = (Byte *)ISzAlloc_Alloc(alloc, FILTER_BUF_SIZE);
+ if (!p->buf)
+ return SZ_ERROR_MEM;
+ }
+ p->curPos = p->endPos = 0;
+ p->srcWasFinished = 0;
+ RINOK(BraState_SetFromMethod(&p->StateCoder, props->id, 1, alloc));
+ RINOK(p->StateCoder.SetProps(p->StateCoder.p, props->props, props->propsSize, alloc));
+ p->StateCoder.Init(p->StateCoder.p);
+ return SZ_OK;
+}
+
+
+static SRes SeqInFilter_Read(const ISeqInStream *pp, void *data, size_t *size)
+{
+ CSeqInFilter *p = CONTAINER_FROM_VTBL(pp, CSeqInFilter, p);
+ size_t sizeOriginal = *size;
+ if (sizeOriginal == 0)
+ return SZ_OK;
+ *size = 0;
+
+ for (;;)
+ {
+ if (!p->srcWasFinished && p->curPos == p->endPos)
+ {
+ p->curPos = 0;
+ p->endPos = FILTER_BUF_SIZE;
+ RINOK(ISeqInStream_Read(p->realStream, p->buf, &p->endPos));
+ if (p->endPos == 0)
+ p->srcWasFinished = 1;
+ }
+ {
+ SizeT srcLen = p->endPos - p->curPos;
+ ECoderStatus status;
+ SRes res;
+ *size = sizeOriginal;
+ res = p->StateCoder.Code2(p->StateCoder.p,
+ data, size,
+ p->buf + p->curPos, &srcLen,
+ p->srcWasFinished, CODER_FINISH_ANY,
+ &status);
+ p->curPos += srcLen;
+ if (*size != 0 || srcLen == 0 || res != SZ_OK)
+ return res;
+ }
+ }
+}
+
+static void SeqInFilter_Construct(CSeqInFilter *p)
+{
+ p->buf = NULL;
+ p->StateCoder.p = NULL;
+ p->p.Read = SeqInFilter_Read;
+}
+
+static void SeqInFilter_Free(CSeqInFilter *p, ISzAllocPtr alloc)
+{
+ if (p->StateCoder.p)
+ {
+ p->StateCoder.Free(p->StateCoder.p, alloc);
+ p->StateCoder.p = NULL;
+ }
+ if (p->buf)
+ {
+ ISzAlloc_Free(alloc, p->buf);
+ p->buf = NULL;
+ }
+}
+
+
+/* ---------- CSbEncInStream ---------- */
+
+#ifdef USE_SUBBLOCK
+
+typedef struct
+{
+ ISeqInStream vt;
+ ISeqInStream *inStream;
+ CSbEnc enc;
+} CSbEncInStream;
+
+static SRes SbEncInStream_Read(const ISeqInStream *pp, void *data, size_t *size)
+{
+ CSbEncInStream *p = CONTAINER_FROM_VTBL(pp, CSbEncInStream, vt);
+ size_t sizeOriginal = *size;
+ if (sizeOriginal == 0)
+ return SZ_OK;
+
+ for (;;)
+ {
+ if (p->enc.needRead && !p->enc.readWasFinished)
+ {
+ size_t processed = p->enc.needReadSizeMax;
+ RINOK(p->inStream->Read(p->inStream, p->enc.buf + p->enc.readPos, &processed));
+ p->enc.readPos += processed;
+ if (processed == 0)
+ {
+ p->enc.readWasFinished = True;
+ p->enc.isFinalFinished = True;
+ }
+ p->enc.needRead = False;
+ }
+
+ *size = sizeOriginal;
+ RINOK(SbEnc_Read(&p->enc, data, size));
+ if (*size != 0 || !p->enc.needRead)
+ return SZ_OK;
+ }
+}
+
+void SbEncInStream_Construct(CSbEncInStream *p, ISzAllocPtr alloc)
+{
+ SbEnc_Construct(&p->enc, alloc);
+ p->vt.Read = SbEncInStream_Read;
+}
+
+SRes SbEncInStream_Init(CSbEncInStream *p)
+{
+ return SbEnc_Init(&p->enc);
+}
+
+void SbEncInStream_Free(CSbEncInStream *p)
+{
+ SbEnc_Free(&p->enc);
+}
+
+#endif
+
+
+
+/* ---------- CXzProps ---------- */
+
+
+void XzFilterProps_Init(CXzFilterProps *p)
+{
+ p->id = 0;
+ p->delta = 0;
+ p->ip = 0;
+ p->ipDefined = False;
+}
+
+void XzProps_Init(CXzProps *p)
+{
+ p->checkId = XZ_CHECK_CRC32;
+ p->blockSize = XZ_PROPS__BLOCK_SIZE__AUTO;
+ p->numBlockThreads_Reduced = -1;
+ p->numBlockThreads_Max = -1;
+ p->numTotalThreads = -1;
+ p->reduceSize = (UInt64)(Int64)-1;
+ p->forceWriteSizesInHeader = 0;
+ // p->forceWriteSizesInHeader = 1;
+
+ XzFilterProps_Init(&p->filterProps);
+ Lzma2EncProps_Init(&p->lzma2Props);
+}
+
+
+static void XzEncProps_Normalize_Fixed(CXzProps *p)
+{
+ UInt64 fileSize;
+ int t1, t1n, t2, t2r, t3;
+ {
+ CLzma2EncProps tp = p->lzma2Props;
+ if (tp.numTotalThreads <= 0)
+ tp.numTotalThreads = p->numTotalThreads;
+ Lzma2EncProps_Normalize(&tp);
+ t1n = tp.numTotalThreads;
+ }
+
+ t1 = p->lzma2Props.numTotalThreads;
+ t2 = p->numBlockThreads_Max;
+ t3 = p->numTotalThreads;
+
+ if (t2 > MTCODER__THREADS_MAX)
+ t2 = MTCODER__THREADS_MAX;
+
+ if (t3 <= 0)
+ {
+ if (t2 <= 0)
+ t2 = 1;
+ t3 = t1n * t2;
+ }
+ else if (t2 <= 0)
+ {
+ t2 = t3 / t1n;
+ if (t2 == 0)
+ {
+ t1 = 1;
+ t2 = t3;
+ }
+ if (t2 > MTCODER__THREADS_MAX)
+ t2 = MTCODER__THREADS_MAX;
+ }
+ else if (t1 <= 0)
+ {
+ t1 = t3 / t2;
+ if (t1 == 0)
+ t1 = 1;
+ }
+ else
+ t3 = t1n * t2;
+
+ p->lzma2Props.numTotalThreads = t1;
+
+ t2r = t2;
+
+ fileSize = p->reduceSize;
+
+ if ((p->blockSize < fileSize || fileSize == (UInt64)(Int64)-1))
+ p->lzma2Props.lzmaProps.reduceSize = p->blockSize;
+
+ Lzma2EncProps_Normalize(&p->lzma2Props);
+
+ t1 = p->lzma2Props.numTotalThreads;
+
+ {
+ if (t2 > 1 && fileSize != (UInt64)(Int64)-1)
+ {
+ UInt64 numBlocks = fileSize / p->blockSize;
+ if (numBlocks * p->blockSize != fileSize)
+ numBlocks++;
+ if (numBlocks < (unsigned)t2)
+ {
+ t2r = (unsigned)numBlocks;
+ if (t2r == 0)
+ t2r = 1;
+ t3 = t1 * t2r;
+ }
+ }
+ }
+
+ p->numBlockThreads_Max = t2;
+ p->numBlockThreads_Reduced = t2r;
+ p->numTotalThreads = t3;
+}
+
+
+static void XzProps_Normalize(CXzProps *p)
+{
+ /* we normalize xzProps properties, but we normalize only some of CXzProps::lzma2Props properties.
+ Lzma2Enc_SetProps() will normalize lzma2Props later. */
+
+ if (p->blockSize == XZ_PROPS__BLOCK_SIZE__SOLID)
+ {
+ p->lzma2Props.lzmaProps.reduceSize = p->reduceSize;
+ p->numBlockThreads_Reduced = 1;
+ p->numBlockThreads_Max = 1;
+ if (p->lzma2Props.numTotalThreads <= 0)
+ p->lzma2Props.numTotalThreads = p->numTotalThreads;
+ return;
+ }
+ else
+ {
+ CLzma2EncProps *lzma2 = &p->lzma2Props;
+ if (p->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO)
+ {
+ // xz-auto
+ p->lzma2Props.lzmaProps.reduceSize = p->reduceSize;
+
+ if (lzma2->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID)
+ {
+ // if (xz-auto && lzma2-solid) - we use solid for both
+ p->blockSize = XZ_PROPS__BLOCK_SIZE__SOLID;
+ p->numBlockThreads_Reduced = 1;
+ p->numBlockThreads_Max = 1;
+ if (p->lzma2Props.numTotalThreads <= 0)
+ p->lzma2Props.numTotalThreads = p->numTotalThreads;
+ }
+ else
+ {
+ // if (xz-auto && (lzma2-auto || lzma2-fixed_)
+ // we calculate block size for lzma2 and use that block size for xz, lzma2 uses single-chunk per block
+ CLzma2EncProps tp = p->lzma2Props;
+ if (tp.numTotalThreads <= 0)
+ tp.numTotalThreads = p->numTotalThreads;
+
+ Lzma2EncProps_Normalize(&tp);
+
+ p->blockSize = tp.blockSize; // fixed or solid
+ p->numBlockThreads_Reduced = tp.numBlockThreads_Reduced;
+ p->numBlockThreads_Max = tp.numBlockThreads_Max;
+ if (lzma2->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO)
+ lzma2->blockSize = tp.blockSize; // fixed or solid, LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
+ if (lzma2->lzmaProps.reduceSize > tp.blockSize && tp.blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID)
+ lzma2->lzmaProps.reduceSize = tp.blockSize;
+ lzma2->numBlockThreads_Reduced = 1;
+ lzma2->numBlockThreads_Max = 1;
+ return;
+ }
+ }
+ else
+ {
+ // xz-fixed
+ // we can use xz::reduceSize or xz::blockSize as base for lzmaProps::reduceSize
+
+ p->lzma2Props.lzmaProps.reduceSize = p->reduceSize;
+ {
+ UInt64 r = p->reduceSize;
+ if (r > p->blockSize || r == (UInt64)(Int64)-1)
+ r = p->blockSize;
+ lzma2->lzmaProps.reduceSize = r;
+ }
+ if (lzma2->blockSize == LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO)
+ lzma2->blockSize = LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID;
+ else if (lzma2->blockSize > p->blockSize && lzma2->blockSize != LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID)
+ lzma2->blockSize = p->blockSize;
+
+ XzEncProps_Normalize_Fixed(p);
+ }
+ }
+}
+
+
+/* ---------- CLzma2WithFilters ---------- */
+
+typedef struct
+{
+ CLzma2EncHandle lzma2;
+ CSeqInFilter filter;
+
+ #ifdef USE_SUBBLOCK
+ CSbEncInStream sb;
+ #endif
+} CLzma2WithFilters;
+
+
+static void Lzma2WithFilters_Construct(CLzma2WithFilters *p)
+{
+ p->lzma2 = NULL;
+ SeqInFilter_Construct(&p->filter);
+
+ #ifdef USE_SUBBLOCK
+ SbEncInStream_Construct(&p->sb, alloc);
+ #endif
+}
+
+
+static SRes Lzma2WithFilters_Create(CLzma2WithFilters *p, ISzAllocPtr alloc, ISzAllocPtr bigAlloc)
+{
+ if (!p->lzma2)
+ {
+ p->lzma2 = Lzma2Enc_Create(alloc, bigAlloc);
+ if (!p->lzma2)
+ return SZ_ERROR_MEM;
+ }
+ return SZ_OK;
+}
+
+
+static void Lzma2WithFilters_Free(CLzma2WithFilters *p, ISzAllocPtr alloc)
+{
+ #ifdef USE_SUBBLOCK
+ SbEncInStream_Free(&p->sb);
+ #endif
+
+ SeqInFilter_Free(&p->filter, alloc);
+ if (p->lzma2)
+ {
+ Lzma2Enc_Destroy(p->lzma2);
+ p->lzma2 = NULL;
+ }
+}
+
+
+typedef struct
+{
+ UInt64 unpackSize;
+ UInt64 totalSize;
+ size_t headerSize;
+} CXzEncBlockInfo;
+
+
+static SRes Xz_CompressBlock(
+ CLzma2WithFilters *lzmaf,
+
+ ISeqOutStream *outStream,
+ Byte *outBufHeader,
+ Byte *outBufData, size_t outBufDataLimit,
+
+ ISeqInStream *inStream,
+ // UInt64 expectedSize,
+ const Byte *inBuf, // used if (!inStream)
+ size_t inBufSize, // used if (!inStream), it's block size, props->blockSize is ignored
+
+ const CXzProps *props,
+ ICompressProgress *progress,
+ int *inStreamFinished, /* only for inStream version */
+ CXzEncBlockInfo *blockSizes,
+ ISzAllocPtr alloc,
+ ISzAllocPtr allocBig)
+{
+ CSeqCheckInStream checkInStream;
+ CSeqSizeOutStream seqSizeOutStream;
+ CXzBlock block;
+ unsigned filterIndex = 0;
+ CXzFilter *filter = NULL;
+ const CXzFilterProps *fp = &props->filterProps;
+ if (fp->id == 0)
+ fp = NULL;
+
+ *inStreamFinished = False;
+
+ RINOK(Lzma2WithFilters_Create(lzmaf, alloc, allocBig));
+
+ RINOK(Lzma2Enc_SetProps(lzmaf->lzma2, &props->lzma2Props));
+
+ XzBlock_ClearFlags(&block);
+ XzBlock_SetNumFilters(&block, 1 + (fp ? 1 : 0));
+
+ if (fp)
+ {
+ filter = &block.filters[filterIndex++];
+ filter->id = fp->id;
+ filter->propsSize = 0;
+
+ if (fp->id == XZ_ID_Delta)
+ {
+ filter->props[0] = (Byte)(fp->delta - 1);
+ filter->propsSize = 1;
+ }
+ else if (fp->ipDefined)
+ {
+ SetUi32(filter->props, fp->ip);
+ filter->propsSize = 4;
+ }
+ }
+
+ {
+ CXzFilter *f = &block.filters[filterIndex++];
+ f->id = XZ_ID_LZMA2;
+ f->propsSize = 1;
+ f->props[0] = Lzma2Enc_WriteProperties(lzmaf->lzma2);
+ }
+
+ seqSizeOutStream.vt.Write = SeqSizeOutStream_Write;
+ seqSizeOutStream.realStream = outStream;
+ seqSizeOutStream.outBuf = outBufData;
+ seqSizeOutStream.outBufLimit = outBufDataLimit;
+ seqSizeOutStream.processed = 0;
+
+ /*
+ if (expectedSize != (UInt64)(Int64)-1)
+ {
+ block.unpackSize = expectedSize;
+ if (props->blockSize != (UInt64)(Int64)-1)
+ if (expectedSize > props->blockSize)
+ block.unpackSize = props->blockSize;
+ XzBlock_SetHasUnpackSize(&block);
+ }
+ */
+
+ if (outStream)
+ {
+ RINOK(XzBlock_WriteHeader(&block, &seqSizeOutStream.vt));
+ }
+
+ checkInStream.vt.Read = SeqCheckInStream_Read;
+ SeqCheckInStream_Init(&checkInStream, props->checkId);
+
+ checkInStream.realStream = inStream;
+ checkInStream.data = inBuf;
+ checkInStream.limit = props->blockSize;
+ if (!inStream)
+ checkInStream.limit = inBufSize;
+
+ if (fp)
+ {
+ #ifdef USE_SUBBLOCK
+ if (fp->id == XZ_ID_Subblock)
+ {
+ lzmaf->sb.inStream = &checkInStream.vt;
+ RINOK(SbEncInStream_Init(&lzmaf->sb));
+ }
+ else
+ #endif
+ {
+ lzmaf->filter.realStream = &checkInStream.vt;
+ RINOK(SeqInFilter_Init(&lzmaf->filter, filter, alloc));
+ }
+ }
+
+ {
+ SRes res;
+ Byte *outBuf = NULL;
+ size_t outSize = 0;
+ Bool useStream = (fp || inStream);
+ // useStream = True;
+
+ if (!useStream)
+ {
+ XzCheck_Update(&checkInStream.check, inBuf, inBufSize);
+ checkInStream.processed = inBufSize;
+ }
+
+ if (!outStream)
+ {
+ outBuf = seqSizeOutStream.outBuf; // + (size_t)seqSizeOutStream.processed;
+ outSize = seqSizeOutStream.outBufLimit; // - (size_t)seqSizeOutStream.processed;
+ }
+
+ res = Lzma2Enc_Encode2(lzmaf->lzma2,
+ outBuf ? NULL : &seqSizeOutStream.vt,
+ outBuf,
+ outBuf ? &outSize : NULL,
+
+ useStream ?
+ (fp ?
+ (
+ #ifdef USE_SUBBLOCK
+ (fp->id == XZ_ID_Subblock) ? &lzmaf->sb.vt:
+ #endif
+ &lzmaf->filter.p) :
+ &checkInStream.vt) : NULL,
+
+ useStream ? NULL : inBuf,
+ useStream ? 0 : inBufSize,
+
+ progress);
+
+ if (outBuf)
+ seqSizeOutStream.processed += outSize;
+
+ RINOK(res);
+ blockSizes->unpackSize = checkInStream.processed;
+ }
+ {
+ Byte buf[4 + 64];
+ unsigned padSize = XZ_GET_PAD_SIZE(seqSizeOutStream.processed);
+ UInt64 packSize = seqSizeOutStream.processed;
+
+ buf[0] = 0;
+ buf[1] = 0;
+ buf[2] = 0;
+ buf[3] = 0;
+
+ SeqCheckInStream_GetDigest(&checkInStream, buf + 4);
+ RINOK(WriteBytes(&seqSizeOutStream.vt, buf + (4 - padSize), padSize + XzFlags_GetCheckSize((CXzStreamFlags)props->checkId)));
+
+ blockSizes->totalSize = seqSizeOutStream.processed - padSize;
+
+ if (!outStream)
+ {
+ seqSizeOutStream.outBuf = outBufHeader;
+ seqSizeOutStream.outBufLimit = XZ_BLOCK_HEADER_SIZE_MAX;
+ seqSizeOutStream.processed = 0;
+
+ block.unpackSize = blockSizes->unpackSize;
+ XzBlock_SetHasUnpackSize(&block);
+
+ block.packSize = packSize;
+ XzBlock_SetHasPackSize(&block);
+
+ RINOK(XzBlock_WriteHeader(&block, &seqSizeOutStream.vt));
+
+ blockSizes->headerSize = (size_t)seqSizeOutStream.processed;
+ blockSizes->totalSize += seqSizeOutStream.processed;
+ }
+ }
+
+ if (inStream)
+ *inStreamFinished = checkInStream.realStreamFinished;
+ else
+ {
+ *inStreamFinished = False;
+ if (checkInStream.processed != inBufSize)
+ return SZ_ERROR_FAIL;
+ }
+
+ return SZ_OK;
+}
+
+
+
+typedef struct
+{
+ ICompressProgress vt;
+ ICompressProgress *progress;
+ UInt64 inOffset;
+ UInt64 outOffset;
+} CCompressProgress_XzEncOffset;
+
+
+static SRes CompressProgress_XzEncOffset_Progress(const ICompressProgress *pp, UInt64 inSize, UInt64 outSize)
+{
+ const CCompressProgress_XzEncOffset *p = CONTAINER_FROM_VTBL(pp, CCompressProgress_XzEncOffset, vt);
+ inSize += p->inOffset;
+ outSize += p->outOffset;
+ return ICompressProgress_Progress(p->progress, inSize, outSize);
+}
+
+
+
+
+typedef struct
+{
+ ISzAllocPtr alloc;
+ ISzAllocPtr allocBig;
+
+ CXzProps xzProps;
+ UInt64 expectedDataSize;
+
+ CXzEncIndex xzIndex;
+
+ CLzma2WithFilters lzmaf_Items[MTCODER__THREADS_MAX];
+
+ size_t outBufSize; /* size of allocated outBufs[i] */
+ Byte *outBufs[MTCODER__BLOCKS_MAX];
+
+ #ifndef _7ZIP_ST
+ unsigned checkType;
+ ISeqOutStream *outStream;
+ Bool mtCoder_WasConstructed;
+ CMtCoder mtCoder;
+ CXzEncBlockInfo EncBlocks[MTCODER__BLOCKS_MAX];
+ #endif
+
+} CXzEnc;
+
+
+static void XzEnc_Construct(CXzEnc *p)
+{
+ unsigned i;
+
+ XzEncIndex_Construct(&p->xzIndex);
+
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ Lzma2WithFilters_Construct(&p->lzmaf_Items[i]);
+
+ #ifndef _7ZIP_ST
+ p->mtCoder_WasConstructed = False;
+ {
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ p->outBufs[i] = NULL;
+ p->outBufSize = 0;
+ }
+ #endif
+}
+
+
+static void XzEnc_FreeOutBufs(CXzEnc *p)
+{
+ unsigned i;
+ for (i = 0; i < MTCODER__BLOCKS_MAX; i++)
+ if (p->outBufs[i])
+ {
+ ISzAlloc_Free(p->alloc, p->outBufs[i]);
+ p->outBufs[i] = NULL;
+ }
+ p->outBufSize = 0;
+}
+
+
+static void XzEnc_Free(CXzEnc *p, ISzAllocPtr alloc)
+{
+ unsigned i;
+
+ XzEncIndex_Free(&p->xzIndex, alloc);
+
+ for (i = 0; i < MTCODER__THREADS_MAX; i++)
+ Lzma2WithFilters_Free(&p->lzmaf_Items[i], alloc);
+
+ #ifndef _7ZIP_ST
+ if (p->mtCoder_WasConstructed)
+ {
+ MtCoder_Destruct(&p->mtCoder);
+ p->mtCoder_WasConstructed = False;
+ }
+ XzEnc_FreeOutBufs(p);
+ #endif
+}
+
+
+CXzEncHandle XzEnc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig)
+{
+ CXzEnc *p = (CXzEnc *)ISzAlloc_Alloc(alloc, sizeof(CXzEnc));
+ if (!p)
+ return NULL;
+ XzEnc_Construct(p);
+ XzProps_Init(&p->xzProps);
+ XzProps_Normalize(&p->xzProps);
+ p->expectedDataSize = (UInt64)(Int64)-1;
+ p->alloc = alloc;
+ p->allocBig = allocBig;
+ return p;
+}
+
+
+void XzEnc_Destroy(CXzEncHandle pp)
+{
+ CXzEnc *p = (CXzEnc *)pp;
+ XzEnc_Free(p, p->alloc);
+ ISzAlloc_Free(p->alloc, p);
+}
+
+
+SRes XzEnc_SetProps(CXzEncHandle pp, const CXzProps *props)
+{
+ CXzEnc *p = (CXzEnc *)pp;
+ p->xzProps = *props;
+ XzProps_Normalize(&p->xzProps);
+ return SZ_OK;
+}
+
+
+void XzEnc_SetDataSize(CXzEncHandle pp, UInt64 expectedDataSiize)
+{
+ CXzEnc *p = (CXzEnc *)pp;
+ p->expectedDataSize = expectedDataSiize;
+}
+
+
+
+
+#ifndef _7ZIP_ST
+
+static SRes XzEnc_MtCallback_Code(void *pp, unsigned coderIndex, unsigned outBufIndex,
+ const Byte *src, size_t srcSize, int finished)
+{
+ CXzEnc *me = (CXzEnc *)pp;
+ SRes res;
+ CMtProgressThunk progressThunk;
+
+ Byte *dest = me->outBufs[outBufIndex];
+
+ UNUSED_VAR(finished)
+
+ {
+ CXzEncBlockInfo *bInfo = &me->EncBlocks[outBufIndex];
+ bInfo->totalSize = 0;
+ bInfo->unpackSize = 0;
+ bInfo->headerSize = 0;
+ }
+
+ if (!dest)
+ {
+ dest = (Byte *)ISzAlloc_Alloc(me->alloc, me->outBufSize);
+ if (!dest)
+ return SZ_ERROR_MEM;
+ me->outBufs[outBufIndex] = dest;
+ }
+
+ MtProgressThunk_CreateVTable(&progressThunk);
+ progressThunk.mtProgress = &me->mtCoder.mtProgress;
+ MtProgressThunk_Init(&progressThunk);
+
+ {
+ CXzEncBlockInfo blockSizes;
+ int inStreamFinished;
+
+ res = Xz_CompressBlock(
+ &me->lzmaf_Items[coderIndex],
+
+ NULL,
+ dest,
+ dest + XZ_BLOCK_HEADER_SIZE_MAX, me->outBufSize - XZ_BLOCK_HEADER_SIZE_MAX,
+
+ NULL,
+ // srcSize, // expectedSize
+ src, srcSize,
+
+ &me->xzProps,
+ &progressThunk.vt,
+ &inStreamFinished,
+ &blockSizes,
+ me->alloc,
+ me->allocBig);
+
+ if (res == SZ_OK)
+ me->EncBlocks[outBufIndex] = blockSizes;
+
+ return res;
+ }
+}
+
+
+static SRes XzEnc_MtCallback_Write(void *pp, unsigned outBufIndex)
+{
+ CXzEnc *me = (CXzEnc *)pp;
+
+ const CXzEncBlockInfo *bInfo = &me->EncBlocks[outBufIndex];
+ const Byte *data = me->outBufs[outBufIndex];
+
+ RINOK(WriteBytes(me->outStream, data, bInfo->headerSize));
+
+ {
+ UInt64 totalPackFull = bInfo->totalSize + XZ_GET_PAD_SIZE(bInfo->totalSize);
+ RINOK(WriteBytes(me->outStream, data + XZ_BLOCK_HEADER_SIZE_MAX, (size_t)totalPackFull - bInfo->headerSize));
+ }
+
+ return XzEncIndex_AddIndexRecord(&me->xzIndex, bInfo->unpackSize, bInfo->totalSize, me->alloc);
+}
+
+#endif
+
+
+
+SRes XzEnc_Encode(CXzEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress)
+{
+ CXzEnc *p = (CXzEnc *)pp;
+
+ const CXzProps *props = &p->xzProps;
+
+ XzEncIndex_Init(&p->xzIndex);
+ {
+ UInt64 numBlocks = 1;
+ UInt64 blockSize = props->blockSize;
+
+ if (blockSize != XZ_PROPS__BLOCK_SIZE__SOLID
+ && props->reduceSize != (UInt64)(Int64)-1)
+ {
+ numBlocks = props->reduceSize / blockSize;
+ if (numBlocks * blockSize != props->reduceSize)
+ numBlocks++;
+ }
+ else
+ blockSize = (UInt64)1 << 62;
+
+ RINOK(XzEncIndex_PreAlloc(&p->xzIndex, numBlocks, blockSize, XZ_GET_ESTIMATED_BLOCK_TOTAL_PACK_SIZE(blockSize), p->alloc));
+ }
+
+ RINOK(Xz_WriteHeader((CXzStreamFlags)props->checkId, outStream));
+
+
+ #ifndef _7ZIP_ST
+ if (props->numBlockThreads_Reduced > 1)
+ {
+ IMtCoderCallback2 vt;
+
+ if (!p->mtCoder_WasConstructed)
+ {
+ p->mtCoder_WasConstructed = True;
+ MtCoder_Construct(&p->mtCoder);
+ }
+
+ vt.Code = XzEnc_MtCallback_Code;
+ vt.Write = XzEnc_MtCallback_Write;
+
+ p->checkType = props->checkId;
+ p->xzProps = *props;
+
+ p->outStream = outStream;
+
+ p->mtCoder.allocBig = p->allocBig;
+ p->mtCoder.progress = progress;
+ p->mtCoder.inStream = inStream;
+ p->mtCoder.inData = NULL;
+ p->mtCoder.inDataSize = 0;
+ p->mtCoder.mtCallback = &vt;
+ p->mtCoder.mtCallbackObject = p;
+
+ if ( props->blockSize == XZ_PROPS__BLOCK_SIZE__SOLID
+ || props->blockSize == XZ_PROPS__BLOCK_SIZE__AUTO)
+ return SZ_ERROR_FAIL;
+
+ p->mtCoder.blockSize = (size_t)props->blockSize;
+ if (p->mtCoder.blockSize != props->blockSize)
+ return SZ_ERROR_PARAM; /* SZ_ERROR_MEM */
+
+ {
+ size_t destBlockSize = XZ_BLOCK_HEADER_SIZE_MAX + XZ_GET_MAX_BLOCK_PACK_SIZE(p->mtCoder.blockSize);
+ if (destBlockSize < p->mtCoder.blockSize)
+ return SZ_ERROR_PARAM;
+ if (p->outBufSize != destBlockSize)
+ XzEnc_FreeOutBufs(p);
+ p->outBufSize = destBlockSize;
+ }
+
+ p->mtCoder.numThreadsMax = props->numBlockThreads_Max;
+ p->mtCoder.expectedDataSize = p->expectedDataSize;
+
+ RINOK(MtCoder_Code(&p->mtCoder));
+ }
+ else
+ #endif
+ {
+ int writeStartSizes;
+ CCompressProgress_XzEncOffset progress2;
+ Byte *bufData = NULL;
+ size_t bufSize = 0;
+
+ progress2.vt.Progress = CompressProgress_XzEncOffset_Progress;
+ progress2.inOffset = 0;
+ progress2.outOffset = 0;
+ progress2.progress = progress;
+
+ writeStartSizes = 0;
+
+ if (props->blockSize != XZ_PROPS__BLOCK_SIZE__SOLID)
+ {
+ writeStartSizes = (props->forceWriteSizesInHeader > 0);
+
+ if (writeStartSizes)
+ {
+ size_t t2;
+ size_t t = (size_t)props->blockSize;
+ if (t != props->blockSize)
+ return SZ_ERROR_PARAM;
+ t = XZ_GET_MAX_BLOCK_PACK_SIZE(t);
+ if (t < props->blockSize)
+ return SZ_ERROR_PARAM;
+ t2 = XZ_BLOCK_HEADER_SIZE_MAX + t;
+ if (!p->outBufs[0] || t2 != p->outBufSize)
+ {
+ XzEnc_FreeOutBufs(p);
+ p->outBufs[0] = (Byte *)ISzAlloc_Alloc(p->alloc, t2);
+ if (!p->outBufs[0])
+ return SZ_ERROR_MEM;
+ p->outBufSize = t2;
+ }
+ bufData = p->outBufs[0] + XZ_BLOCK_HEADER_SIZE_MAX;
+ bufSize = t;
+ }
+ }
+
+ for (;;)
+ {
+ CXzEncBlockInfo blockSizes;
+ int inStreamFinished;
+
+ /*
+ UInt64 rem = (UInt64)(Int64)-1;
+ if (props->reduceSize != (UInt64)(Int64)-1
+ && props->reduceSize >= progress2.inOffset)
+ rem = props->reduceSize - progress2.inOffset;
+ */
+
+ blockSizes.headerSize = 0; // for GCC
+
+ RINOK(Xz_CompressBlock(
+ &p->lzmaf_Items[0],
+
+ writeStartSizes ? NULL : outStream,
+ writeStartSizes ? p->outBufs[0] : NULL,
+ bufData, bufSize,
+
+ inStream,
+ // rem,
+ NULL, 0,
+
+ props,
+ progress ? &progress2.vt : NULL,
+ &inStreamFinished,
+ &blockSizes,
+ p->alloc,
+ p->allocBig));
+
+ {
+ UInt64 totalPackFull = blockSizes.totalSize + XZ_GET_PAD_SIZE(blockSizes.totalSize);
+
+ if (writeStartSizes)
+ {
+ RINOK(WriteBytes(outStream, p->outBufs[0], blockSizes.headerSize));
+ RINOK(WriteBytes(outStream, bufData, (size_t)totalPackFull - blockSizes.headerSize));
+ }
+
+ RINOK(XzEncIndex_AddIndexRecord(&p->xzIndex, blockSizes.unpackSize, blockSizes.totalSize, p->alloc));
+
+ progress2.inOffset += blockSizes.unpackSize;
+ progress2.outOffset += totalPackFull;
+ }
+
+ if (inStreamFinished)
+ break;
+ }
+ }
+
+ return XzEncIndex_WriteFooter(&p->xzIndex, (CXzStreamFlags)props->checkId, outStream);
+}
+
+
+#include "Alloc.h"
+
+SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream,
+ const CXzProps *props, ICompressProgress *progress)
+{
+ SRes res;
+ CXzEncHandle xz = XzEnc_Create(&g_Alloc, &g_BigAlloc);
+ if (!xz)
+ return SZ_ERROR_MEM;
+ res = XzEnc_SetProps(xz, props);
+ if (res == SZ_OK)
+ res = XzEnc_Encode(xz, outStream, inStream, progress);
+ XzEnc_Destroy(xz);
+ return res;
+}
+
+
+SRes Xz_EncodeEmpty(ISeqOutStream *outStream)
+{
+ SRes res;
+ CXzEncIndex xzIndex;
+ XzEncIndex_Construct(&xzIndex);
+ res = Xz_WriteHeader((CXzStreamFlags)0, outStream);
+ if (res == SZ_OK)
+ res = XzEncIndex_WriteFooter(&xzIndex, (CXzStreamFlags)0, outStream);
+ XzEncIndex_Free(&xzIndex, NULL); // g_Alloc
+ return res;
+}
diff --git a/other-licenses/7zstub/src/C/XzEnc.h b/other-licenses/7zstub/src/C/XzEnc.h
new file mode 100644
index 0000000000..529ac3fd8c
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzEnc.h
@@ -0,0 +1,60 @@
+/* XzEnc.h -- Xz Encode
+2017-06-27 : Igor Pavlov : Public domain */
+
+#ifndef __XZ_ENC_H
+#define __XZ_ENC_H
+
+#include "Lzma2Enc.h"
+
+#include "Xz.h"
+
+EXTERN_C_BEGIN
+
+
+#define XZ_PROPS__BLOCK_SIZE__AUTO LZMA2_ENC_PROPS__BLOCK_SIZE__AUTO
+#define XZ_PROPS__BLOCK_SIZE__SOLID LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID
+
+
+typedef struct
+{
+ UInt32 id;
+ UInt32 delta;
+ UInt32 ip;
+ int ipDefined;
+} CXzFilterProps;
+
+void XzFilterProps_Init(CXzFilterProps *p);
+
+
+typedef struct
+{
+ CLzma2EncProps lzma2Props;
+ CXzFilterProps filterProps;
+ unsigned checkId;
+ UInt64 blockSize;
+ int numBlockThreads_Reduced;
+ int numBlockThreads_Max;
+ int numTotalThreads;
+ int forceWriteSizesInHeader;
+ UInt64 reduceSize;
+} CXzProps;
+
+void XzProps_Init(CXzProps *p);
+
+
+typedef void * CXzEncHandle;
+
+CXzEncHandle XzEnc_Create(ISzAllocPtr alloc, ISzAllocPtr allocBig);
+void XzEnc_Destroy(CXzEncHandle p);
+SRes XzEnc_SetProps(CXzEncHandle p, const CXzProps *props);
+void XzEnc_SetDataSize(CXzEncHandle p, UInt64 expectedDataSiize);
+SRes XzEnc_Encode(CXzEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress);
+
+SRes Xz_Encode(ISeqOutStream *outStream, ISeqInStream *inStream,
+ const CXzProps *props, ICompressProgress *progress);
+
+SRes Xz_EncodeEmpty(ISeqOutStream *outStream);
+
+EXTERN_C_END
+
+#endif
diff --git a/other-licenses/7zstub/src/C/XzIn.c b/other-licenses/7zstub/src/C/XzIn.c
new file mode 100644
index 0000000000..42da1dece6
--- /dev/null
+++ b/other-licenses/7zstub/src/C/XzIn.c
@@ -0,0 +1,319 @@
+/* XzIn.c - Xz input
+2018-02-02 : Igor Pavlov : Public domain */
+
+#include "Precomp.h"
+
+#include <string.h>
+
+#include "7zCrc.h"
+#include "CpuArch.h"
+#include "Xz.h"
+
+/*
+#define XZ_FOOTER_SIG_CHECK(p) (memcmp((p), XZ_FOOTER_SIG, XZ_FOOTER_SIG_SIZE) == 0)
+*/
+#define XZ_FOOTER_SIG_CHECK(p) ((p)[0] == XZ_FOOTER_SIG_0 && (p)[1] == XZ_FOOTER_SIG_1)
+
+
+SRes Xz_ReadHeader(CXzStreamFlags *p, ISeqInStream *inStream)
+{
+ Byte sig[XZ_STREAM_HEADER_SIZE];
+ RINOK(SeqInStream_Read2(inStream, sig, XZ_STREAM_HEADER_SIZE, SZ_ERROR_NO_ARCHIVE));
+ if (memcmp(sig, XZ_SIG, XZ_SIG_SIZE) != 0)
+ return SZ_ERROR_NO_ARCHIVE;
+ return Xz_ParseHeader(p, sig);
+}
+
+#define READ_VARINT_AND_CHECK(buf, pos, size, res) \
+ { unsigned s = Xz_ReadVarInt(buf + pos, size - pos, res); \
+ if (s == 0) return SZ_ERROR_ARCHIVE; pos += s; }
+
+SRes XzBlock_ReadHeader(CXzBlock *p, ISeqInStream *inStream, Bool *isIndex, UInt32 *headerSizeRes)
+{
+ Byte header[XZ_BLOCK_HEADER_SIZE_MAX];
+ unsigned headerSize;
+ *headerSizeRes = 0;
+ RINOK(SeqInStream_ReadByte(inStream, &header[0]));
+ headerSize = (unsigned)header[0];
+ if (headerSize == 0)
+ {
+ *headerSizeRes = 1;
+ *isIndex = True;
+ return SZ_OK;
+ }
+
+ *isIndex = False;
+ headerSize = (headerSize << 2) + 4;
+ *headerSizeRes = headerSize;
+ RINOK(SeqInStream_Read(inStream, header + 1, headerSize - 1));
+ return XzBlock_Parse(p, header);
+}
+
+#define ADD_SIZE_CHECK(size, val) \
+ { UInt64 newSize = size + (val); if (newSize < size) return XZ_SIZE_OVERFLOW; size = newSize; }
+
+UInt64 Xz_GetUnpackSize(const CXzStream *p)
+{
+ UInt64 size = 0;
+ size_t i;
+ for (i = 0; i < p->numBlocks; i++)
+ ADD_SIZE_CHECK(size, p->blocks[i].unpackSize);
+ return size;
+}
+
+UInt64 Xz_GetPackSize(const CXzStream *p)
+{
+ UInt64 size = 0;
+ size_t i;
+ for (i = 0; i < p->numBlocks; i++)
+ ADD_SIZE_CHECK(size, (p->blocks[i].totalSize + 3) & ~(UInt64)3);
+ return size;
+}
+
+/*
+SRes XzBlock_ReadFooter(CXzBlock *p, CXzStreamFlags f, ISeqInStream *inStream)
+{
+ return SeqInStream_Read(inStream, p->check, XzFlags_GetCheckSize(f));
+}
+*/
+
+static SRes Xz_ReadIndex2(CXzStream *p, const Byte *buf, size_t size, ISzAllocPtr alloc)
+{
+ size_t numBlocks, pos = 1;
+ UInt32 crc;
+
+ if (size < 5 || buf[0] != 0)
+ return SZ_ERROR_ARCHIVE;
+
+ size -= 4;
+ crc = CrcCalc(buf, size);
+ if (crc != GetUi32(buf + size))
+ return SZ_ERROR_ARCHIVE;
+
+ {
+ UInt64 numBlocks64;
+ READ_VARINT_AND_CHECK(buf, pos, size, &numBlocks64);
+ numBlocks = (size_t)numBlocks64;
+ if (numBlocks != numBlocks64 || numBlocks * 2 > size)
+ return SZ_ERROR_ARCHIVE;
+ }
+
+ Xz_Free(p, alloc);
+ if (numBlocks != 0)
+ {
+ size_t i;
+ p->numBlocks = numBlocks;
+ p->blocks = (CXzBlockSizes *)ISzAlloc_Alloc(alloc, sizeof(CXzBlockSizes) * numBlocks);
+ if (!p->blocks)
+ return SZ_ERROR_MEM;
+ for (i = 0; i < numBlocks; i++)
+ {
+ CXzBlockSizes *block = &p->blocks[i];
+ READ_VARINT_AND_CHECK(buf, pos, size, &block->totalSize);
+ READ_VARINT_AND_CHECK(buf, pos, size, &block->unpackSize);
+ if (block->totalSize == 0)
+ return SZ_ERROR_ARCHIVE;
+ }
+ }
+ while ((pos & 3) != 0)
+ if (buf[pos++] != 0)
+ return SZ_ERROR_ARCHIVE;
+ return (pos == size) ? SZ_OK : SZ_ERROR_ARCHIVE;
+}
+
+static SRes Xz_ReadIndex(CXzStream *p, ILookInStream *stream, UInt64 indexSize, ISzAllocPtr alloc)
+{
+ SRes res;
+ size_t size;
+ Byte *buf;
+ if (indexSize > ((UInt32)1 << 31))
+ return SZ_ERROR_UNSUPPORTED;
+ size = (size_t)indexSize;
+ if (size != indexSize)
+ return SZ_ERROR_UNSUPPORTED;
+ buf = (Byte *)ISzAlloc_Alloc(alloc, size);
+ if (!buf)
+ return SZ_ERROR_MEM;
+ res = LookInStream_Read2(stream, buf, size, SZ_ERROR_UNSUPPORTED);
+ if (res == SZ_OK)
+ res = Xz_ReadIndex2(p, buf, size, alloc);
+ ISzAlloc_Free(alloc, buf);
+ return res;
+}
+
+static SRes LookInStream_SeekRead_ForArc(ILookInStream *stream, UInt64 offset, void *buf, size_t size)
+{
+ RINOK(LookInStream_SeekTo(stream, offset));
+ return LookInStream_Read(stream, buf, size);
+ /* return LookInStream_Read2(stream, buf, size, SZ_ERROR_NO_ARCHIVE); */
+}
+
+static SRes Xz_ReadBackward(CXzStream *p, ILookInStream *stream, Int64 *startOffset, ISzAllocPtr alloc)
+{
+ UInt64 indexSize;
+ Byte buf[XZ_STREAM_FOOTER_SIZE];
+ UInt64 pos = *startOffset;
+
+ if ((pos & 3) != 0 || pos < XZ_STREAM_FOOTER_SIZE)
+ return SZ_ERROR_NO_ARCHIVE;
+
+ pos -= XZ_STREAM_FOOTER_SIZE;
+ RINOK(LookInStream_SeekRead_ForArc(stream, pos, buf, XZ_STREAM_FOOTER_SIZE));
+
+ if (!XZ_FOOTER_SIG_CHECK(buf + 10))
+ {
+ UInt32 total = 0;
+ pos += XZ_STREAM_FOOTER_SIZE;
+
+ for (;;)
+ {
+ size_t i;
+ #define TEMP_BUF_SIZE (1 << 10)
+ Byte temp[TEMP_BUF_SIZE];
+
+ i = (pos > TEMP_BUF_SIZE) ? TEMP_BUF_SIZE : (size_t)pos;
+ pos -= i;
+ RINOK(LookInStream_SeekRead_ForArc(stream, pos, temp, i));
+ total += (UInt32)i;
+ for (; i != 0; i--)
+ if (temp[i - 1] != 0)
+ break;
+ if (i != 0)
+ {
+ if ((i & 3) != 0)
+ return SZ_ERROR_NO_ARCHIVE;
+ pos += i;
+ break;
+ }
+ if (pos < XZ_STREAM_FOOTER_SIZE || total > (1 << 16))
+ return SZ_ERROR_NO_ARCHIVE;
+ }
+
+ if (pos < XZ_STREAM_FOOTER_SIZE)
+ return SZ_ERROR_NO_ARCHIVE;
+ pos -= XZ_STREAM_FOOTER_SIZE;
+ RINOK(LookInStream_SeekRead_ForArc(stream, pos, buf, XZ_STREAM_FOOTER_SIZE));
+ if (!XZ_FOOTER_SIG_CHECK(buf + 10))
+ return SZ_ERROR_NO_ARCHIVE;
+ }
+
+ p->flags = (CXzStreamFlags)GetBe16(buf + 8);
+
+ if (!XzFlags_IsSupported(p->flags))
+ return SZ_ERROR_UNSUPPORTED;
+
+ if (GetUi32(buf) != CrcCalc(buf + 4, 6))
+ return SZ_ERROR_ARCHIVE;
+
+ indexSize = ((UInt64)GetUi32(buf + 4) + 1) << 2;
+
+ if (pos < indexSize)
+ return SZ_ERROR_ARCHIVE;
+
+ pos -= indexSize;
+ RINOK(LookInStream_SeekTo(stream, pos));
+ RINOK(Xz_ReadIndex(p, stream, indexSize, alloc));
+
+ {
+ UInt64 totalSize = Xz_GetPackSize(p);
+ if (totalSize == XZ_SIZE_OVERFLOW
+ || totalSize >= ((UInt64)1 << 63)
+ || pos < totalSize + XZ_STREAM_HEADER_SIZE)
+ return SZ_ERROR_ARCHIVE;
+ pos -= (totalSize + XZ_STREAM_HEADER_SIZE);
+ RINOK(LookInStream_SeekTo(stream, pos));
+ *startOffset = pos;
+ }
+ {
+ CXzStreamFlags headerFlags;
+ CSecToRead secToRead;
+ SecToRead_CreateVTable(&secToRead);
+ secToRead.realStream = stream;
+
+ RINOK(Xz_ReadHeader(&headerFlags, &secToRead.vt));
+ return (p->flags == headerFlags) ? SZ_OK : SZ_ERROR_ARCHIVE;
+ }
+}
+
+
+/* ---------- Xz Streams ---------- */
+
+void Xzs_Construct(CXzs *p)
+{
+ p->num = p->numAllocated = 0;
+ p->streams = 0;
+}
+
+void Xzs_Free(CXzs *p, ISzAllocPtr alloc)
+{
+ size_t i;
+ for (i = 0; i < p->num; i++)
+ Xz_Free(&p->streams[i], alloc);
+ ISzAlloc_Free(alloc, p->streams);
+ p->num = p->numAllocated = 0;
+ p->streams = 0;
+}
+
+UInt64 Xzs_GetNumBlocks(const CXzs *p)
+{
+ UInt64 num = 0;
+ size_t i;
+ for (i = 0; i < p->num; i++)
+ num += p->streams[i].numBlocks;
+ return num;
+}
+
+UInt64 Xzs_GetUnpackSize(const CXzs *p)
+{
+ UInt64 size = 0;
+ size_t i;
+ for (i = 0; i < p->num; i++)
+ ADD_SIZE_CHECK(size, Xz_GetUnpackSize(&p->streams[i]));
+ return size;
+}
+
+/*
+UInt64 Xzs_GetPackSize(const CXzs *p)
+{
+ UInt64 size = 0;
+ size_t i;
+ for (i = 0; i < p->num; i++)
+ ADD_SIZE_CHECK(size, Xz_GetTotalSize(&p->streams[i]));
+ return size;
+}
+*/
+
+SRes Xzs_ReadBackward(CXzs *p, ILookInStream *stream, Int64 *startOffset, ICompressProgress *progress, ISzAllocPtr alloc)
+{
+ Int64 endOffset = 0;
+ RINOK(ILookInStream_Seek(stream, &endOffset, SZ_SEEK_END));
+ *startOffset = endOffset;
+ for (;;)
+ {
+ CXzStream st;
+ SRes res;
+ Xz_Construct(&st);
+ res = Xz_ReadBackward(&st, stream, startOffset, alloc);
+ st.startOffset = *startOffset;
+ RINOK(res);
+ if (p->num == p->numAllocated)
+ {
+ size_t newNum = p->num + p->num / 4 + 1;
+ Byte *data = (Byte *)ISzAlloc_Alloc(alloc, newNum * sizeof(CXzStream));
+ if (!data)
+ return SZ_ERROR_MEM;
+ p->numAllocated = newNum;
+ if (p->num != 0)
+ memcpy(data, p->streams, p->num * sizeof(CXzStream));
+ ISzAlloc_Free(alloc, p->streams);
+ p->streams = (CXzStream *)data;
+ }
+ p->streams[p->num++] = st;
+ if (*startOffset == 0)
+ break;
+ RINOK(LookInStream_SeekTo(stream, *startOffset));
+ if (progress && ICompressProgress_Progress(progress, endOffset - *startOffset, (UInt64)(Int64)-1) != SZ_OK)
+ return SZ_ERROR_PROGRESS;
+ }
+ return SZ_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/7zip.mak b/other-licenses/7zstub/src/CPP/7zip/7zip.mak
new file mode 100644
index 0000000000..7fec27cf3f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/7zip.mak
@@ -0,0 +1,240 @@
+OBJS = \
+ $O\StdAfx.obj \
+ $(CURRENT_OBJS) \
+ $(COMMON_OBJS) \
+ $(WIN_OBJS) \
+ $(WIN_CTRL_OBJS) \
+ $(7ZIP_COMMON_OBJS) \
+ $(AR_OBJS) \
+ $(AR_COMMON_OBJS) \
+ $(UI_COMMON_OBJS) \
+ $(AGENT_OBJS) \
+ $(CONSOLE_OBJS) \
+ $(EXPLORER_OBJS) \
+ $(FM_OBJS) \
+ $(GUI_OBJS) \
+ $(7Z_OBJS) \
+ $(CAB_OBJS) \
+ $(CHM_OBJS) \
+ $(COM_OBJS) \
+ $(ISO_OBJS) \
+ $(NSIS_OBJS) \
+ $(RAR_OBJS) \
+ $(TAR_OBJS) \
+ $(UDF_OBJS) \
+ $(WIM_OBJS) \
+ $(ZIP_OBJS) \
+ $(COMPRESS_OBJS) \
+ $(CRYPTO_OBJS) \
+ $(C_OBJS) \
+ $(ASM_OBJS) \
+ $O\resource.res \
+
+!include "../../../Build.mak"
+
+# MAK_SINGLE_FILE = 1
+
+!IFDEF MAK_SINGLE_FILE
+
+!IFDEF CURRENT_OBJS
+$(CURRENT_OBJS): ./$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+
+!IFDEF COMMON_OBJS
+$(COMMON_OBJS): ../../../Common/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF WIN_OBJS
+$(WIN_OBJS): ../../../Windows/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF WIN_CTRL_OBJS
+$(WIN_CTRL_OBJS): ../../../Windows/Control/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF 7ZIP_COMMON_OBJS
+$(7ZIP_COMMON_OBJS): ../../Common/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF AR_OBJS
+$(AR_OBJS): ../../Archive/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF AR_COMMON_OBJS
+$(AR_COMMON_OBJS): ../../Archive/Common/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF 7Z_OBJS
+$(7Z_OBJS): ../../Archive/7z/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF CAB_OBJS
+$(CAB_OBJS): ../../Archive/Cab/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF CHM_OBJS
+$(CHM_OBJS): ../../Archive/Chm/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF COM_OBJS
+$(COM_OBJS): ../../Archive/Com/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF ISO_OBJS
+$(ISO_OBJS): ../../Archive/Iso/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF NSIS_OBJS
+$(NSIS_OBJS): ../../Archive/Nsis/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF RAR_OBJS
+$(RAR_OBJS): ../../Archive/Rar/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF TAR_OBJS
+$(TAR_OBJS): ../../Archive/Tar/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF UDF_OBJS
+$(UDF_OBJS): ../../Archive/Udf/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF WIM_OBJS
+$(WIM_OBJS): ../../Archive/Wim/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF ZIP_OBJS
+$(ZIP_OBJS): ../../Archive/Zip/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF COMPRESS_OBJS
+$(COMPRESS_OBJS): ../../Compress/$(*B).cpp
+ $(COMPL_O2)
+!ENDIF
+
+!IFDEF CRYPTO_OBJS
+$(CRYPTO_OBJS): ../../Crypto/$(*B).cpp
+ $(COMPL_O2)
+!ENDIF
+
+!IFDEF UI_COMMON_OBJS
+$(UI_COMMON_OBJS): ../../UI/Common/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF AGENT_OBJS
+$(AGENT_OBJS): ../../UI/Agent/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF CONSOLE_OBJS
+$(CONSOLE_OBJS): ../../UI/Console/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF EXPLORER_OBJS
+$(EXPLORER_OBJS): ../../UI/Explorer/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF FM_OBJS
+$(FM_OBJS): ../../UI/FileManager/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF GUI_OBJS
+$(GUI_OBJS): ../../UI/GUI/$(*B).cpp
+ $(COMPL)
+!ENDIF
+
+!IFDEF C_OBJS
+$(C_OBJS): ../../../../C/$(*B).c
+ $(COMPL_O2)
+!ENDIF
+
+
+!ELSE
+
+{.}.cpp{$O}.obj::
+ $(COMPLB)
+{../../../Common}.cpp{$O}.obj::
+ $(COMPLB)
+{../../../Windows}.cpp{$O}.obj::
+ $(COMPLB)
+{../../../Windows/Control}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Common}.cpp{$O}.obj::
+ $(COMPLB)
+
+{../../UI/Common}.cpp{$O}.obj::
+ $(COMPLB)
+{../../UI/Agent}.cpp{$O}.obj::
+ $(COMPLB)
+{../../UI/Console}.cpp{$O}.obj::
+ $(COMPLB)
+{../../UI/Explorer}.cpp{$O}.obj::
+ $(COMPLB)
+{../../UI/FileManager}.cpp{$O}.obj::
+ $(COMPLB)
+{../../UI/GUI}.cpp{$O}.obj::
+ $(COMPLB)
+
+
+{../../Archive}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Common}.cpp{$O}.obj::
+ $(COMPLB)
+
+{../../Archive/7z}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Cab}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Chm}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Com}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Iso}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Nsis}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Rar}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Tar}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Udf}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Wim}.cpp{$O}.obj::
+ $(COMPLB)
+{../../Archive/Zip}.cpp{$O}.obj::
+ $(COMPLB)
+
+{../../Compress}.cpp{$O}.obj::
+ $(COMPLB_O2)
+{../../Crypto}.cpp{$O}.obj::
+ $(COMPLB_O2)
+{../../../../C}.c{$O}.obj::
+ $(CCOMPLB)
+
+!ENDIF
+
+!include "Asm.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Aes.mak b/other-licenses/7zstub/src/CPP/7zip/Aes.mak
new file mode 100644
index 0000000000..4d5e98b37e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Aes.mak
@@ -0,0 +1,7 @@
+C_OBJS = $(C_OBJS) \
+ $O\Aes.obj
+
+!IF "$(CPU)" != "IA64" && "$(CPU)" != "MIPS" && "$(CPU)" != "ARM" && "$(CPU)" != "ARM64"
+ASM_OBJS = $(ASM_OBJS) \
+ $O\AesOpt.obj
+!ENDIF
diff --git a/other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.cpp
index 232c638203..232c638203 100644
--- a/other-licenses/7zstub/src/7zip/Archive/7z/7zCompressionMode.cpp
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.cpp
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.h
new file mode 100644
index 0000000000..23600171d1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zCompressionMode.h
@@ -0,0 +1,76 @@
+// 7zCompressionMode.h
+
+#ifndef __7Z_COMPRESSION_MODE_H
+#define __7Z_COMPRESSION_MODE_H
+
+#include "../../Common/MethodId.h"
+#include "../../Common/MethodProps.h"
+
+namespace NArchive {
+namespace N7z {
+
+struct CMethodFull: public CMethodProps
+{
+ CMethodId Id;
+ UInt32 NumStreams;
+ int CodecIndex;
+
+ CMethodFull(): CodecIndex(-1) {}
+ bool IsSimpleCoder() const { return NumStreams == 1; }
+};
+
+struct CBond2
+{
+ UInt32 OutCoder;
+ UInt32 OutStream;
+ UInt32 InCoder;
+};
+
+struct CCompressionMethodMode
+{
+ /*
+ if (Bonds.Empty()), then default bonds must be created
+ if (Filter_was_Inserted)
+ {
+ Methods[0] is filter method
+ Bonds don't contain bonds for filter (these bonds must be created)
+ }
+ */
+
+ CObjectVector<CMethodFull> Methods;
+ CRecordVector<CBond2> Bonds;
+
+ bool IsThereBond_to_Coder(unsigned coderIndex) const
+ {
+ FOR_VECTOR(i, Bonds)
+ if (Bonds[i].InCoder == coderIndex)
+ return true;
+ return false;
+ }
+
+ bool DefaultMethod_was_Inserted;
+ bool Filter_was_Inserted;
+
+ #ifndef _7ZIP_ST
+ UInt32 NumThreads;
+ bool MultiThreadMixer;
+ #endif
+
+ bool PasswordIsDefined;
+ UString Password;
+
+ bool IsEmpty() const { return (Methods.IsEmpty() && !PasswordIsDefined); }
+ CCompressionMethodMode():
+ DefaultMethod_was_Inserted(false),
+ Filter_was_Inserted(false),
+ PasswordIsDefined(false)
+ #ifndef _7ZIP_ST
+ , NumThreads(1)
+ , MultiThreadMixer(true)
+ #endif
+ {}
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.cpp
new file mode 100644
index 0000000000..2705ecb9ae
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.cpp
@@ -0,0 +1,567 @@
+// 7zDecode.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/LimitedStreams.h"
+#include "../../Common/ProgressUtils.h"
+#include "../../Common/StreamObjects.h"
+
+#include "7zDecode.h"
+
+namespace NArchive {
+namespace N7z {
+
+class CDecProgress:
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+ CMyComPtr<ICompressProgressInfo> _progress;
+public:
+ CDecProgress(ICompressProgressInfo *progress): _progress(progress) {}
+
+ MY_UNKNOWN_IMP1(ICompressProgressInfo)
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+};
+
+STDMETHODIMP CDecProgress::SetRatioInfo(const UInt64 * /* inSize */, const UInt64 *outSize)
+{
+ return _progress->SetRatioInfo(NULL, outSize);
+}
+
+static void Convert_FolderInfo_to_BindInfo(const CFolderEx &folder, CBindInfoEx &bi)
+{
+ bi.Clear();
+
+ bi.Bonds.ClearAndSetSize(folder.Bonds.Size());
+ unsigned i;
+ for (i = 0; i < folder.Bonds.Size(); i++)
+ {
+ NCoderMixer2::CBond &bond = bi.Bonds[i];
+ const N7z::CBond &folderBond = folder.Bonds[i];
+ bond.PackIndex = folderBond.PackIndex;
+ bond.UnpackIndex = folderBond.UnpackIndex;
+ }
+
+ bi.Coders.ClearAndSetSize(folder.Coders.Size());
+ bi.CoderMethodIDs.ClearAndSetSize(folder.Coders.Size());
+ for (i = 0; i < folder.Coders.Size(); i++)
+ {
+ const CCoderInfo &coderInfo = folder.Coders[i];
+ bi.Coders[i].NumStreams = coderInfo.NumStreams;
+ bi.CoderMethodIDs[i] = coderInfo.MethodID;
+ }
+
+ /*
+ if (!bi.SetUnpackCoder())
+ throw 1112;
+ */
+ bi.UnpackCoder = folder.UnpackCoder;
+ bi.PackStreams.ClearAndSetSize(folder.PackStreams.Size());
+ for (i = 0; i < folder.PackStreams.Size(); i++)
+ bi.PackStreams[i] = folder.PackStreams[i];
+}
+
+static inline bool AreCodersEqual(
+ const NCoderMixer2::CCoderStreamsInfo &a1,
+ const NCoderMixer2::CCoderStreamsInfo &a2)
+{
+ return (a1.NumStreams == a2.NumStreams);
+}
+
+static inline bool AreBondsEqual(
+ const NCoderMixer2::CBond &a1,
+ const NCoderMixer2::CBond &a2)
+{
+ return
+ (a1.PackIndex == a2.PackIndex) &&
+ (a1.UnpackIndex == a2.UnpackIndex);
+}
+
+static bool AreBindInfoExEqual(const CBindInfoEx &a1, const CBindInfoEx &a2)
+{
+ if (a1.Coders.Size() != a2.Coders.Size())
+ return false;
+ unsigned i;
+ for (i = 0; i < a1.Coders.Size(); i++)
+ if (!AreCodersEqual(a1.Coders[i], a2.Coders[i]))
+ return false;
+
+ if (a1.Bonds.Size() != a2.Bonds.Size())
+ return false;
+ for (i = 0; i < a1.Bonds.Size(); i++)
+ if (!AreBondsEqual(a1.Bonds[i], a2.Bonds[i]))
+ return false;
+
+ for (i = 0; i < a1.CoderMethodIDs.Size(); i++)
+ if (a1.CoderMethodIDs[i] != a2.CoderMethodIDs[i])
+ return false;
+
+ if (a1.PackStreams.Size() != a2.PackStreams.Size())
+ return false;
+ for (i = 0; i < a1.PackStreams.Size(); i++)
+ if (a1.PackStreams[i] != a2.PackStreams[i])
+ return false;
+
+ /*
+ if (a1.UnpackCoder != a2.UnpackCoder)
+ return false;
+ */
+ return true;
+}
+
+CDecoder::CDecoder(bool useMixerMT):
+ _bindInfoPrev_Defined(false),
+ _useMixerMT(useMixerMT)
+{}
+
+
+struct CLockedInStream:
+ public IUnknown,
+ public CMyUnknownImp
+{
+ CMyComPtr<IInStream> Stream;
+ UInt64 Pos;
+
+ MY_UNKNOWN_IMP
+
+ #ifdef USE_MIXER_MT
+ NWindows::NSynchronization::CCriticalSection CriticalSection;
+ #endif
+};
+
+
+#ifdef USE_MIXER_MT
+
+class CLockedSequentialInStreamMT:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+ CLockedInStream *_glob;
+ UInt64 _pos;
+ CMyComPtr<IUnknown> _globRef;
+public:
+ void Init(CLockedInStream *lockedInStream, UInt64 startPos)
+ {
+ _globRef = lockedInStream;
+ _glob = lockedInStream;
+ _pos = startPos;
+ }
+
+ MY_UNKNOWN_IMP1(ISequentialInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CLockedSequentialInStreamMT::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ NWindows::NSynchronization::CCriticalSectionLock lock(_glob->CriticalSection);
+
+ if (_pos != _glob->Pos)
+ {
+ RINOK(_glob->Stream->Seek(_pos, STREAM_SEEK_SET, NULL));
+ _glob->Pos = _pos;
+ }
+
+ UInt32 realProcessedSize = 0;
+ HRESULT res = _glob->Stream->Read(data, size, &realProcessedSize);
+ _pos += realProcessedSize;
+ _glob->Pos = _pos;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return res;
+}
+
+#endif
+
+
+#ifdef USE_MIXER_ST
+
+class CLockedSequentialInStreamST:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+ CLockedInStream *_glob;
+ UInt64 _pos;
+ CMyComPtr<IUnknown> _globRef;
+public:
+ void Init(CLockedInStream *lockedInStream, UInt64 startPos)
+ {
+ _globRef = lockedInStream;
+ _glob = lockedInStream;
+ _pos = startPos;
+ }
+
+ MY_UNKNOWN_IMP1(ISequentialInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CLockedSequentialInStreamST::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (_pos != _glob->Pos)
+ {
+ RINOK(_glob->Stream->Seek(_pos, STREAM_SEEK_SET, NULL));
+ _glob->Pos = _pos;
+ }
+
+ UInt32 realProcessedSize = 0;
+ HRESULT res = _glob->Stream->Read(data, size, &realProcessedSize);
+ _pos += realProcessedSize;
+ _glob->Pos = _pos;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return res;
+}
+
+#endif
+
+
+
+HRESULT CDecoder::Decode(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ IInStream *inStream,
+ UInt64 startPos,
+ const CFolders &folders, unsigned folderIndex,
+ const UInt64 *unpackSize
+
+ , ISequentialOutStream *outStream
+ , ICompressProgressInfo *compressProgress
+
+ , ISequentialInStream **
+ #ifdef USE_MIXER_ST
+ inStreamMainRes
+ #endif
+
+ , bool &dataAfterEnd_Error
+
+ _7Z_DECODER_CRYPRO_VARS_DECL
+
+ #if !defined(_7ZIP_ST)
+ , bool mtMode, UInt32 numThreads, UInt64 memUsage
+ #endif
+ )
+{
+ dataAfterEnd_Error = false;
+
+ const UInt64 *packPositions = &folders.PackPositions[folders.FoStartPackStreamIndex[folderIndex]];
+ CFolderEx folderInfo;
+ folders.ParseFolderEx(folderIndex, folderInfo);
+
+ if (!folderInfo.IsDecodingSupported())
+ return E_NOTIMPL;
+
+ CBindInfoEx bindInfo;
+ Convert_FolderInfo_to_BindInfo(folderInfo, bindInfo);
+ if (!bindInfo.CalcMapsAndCheck())
+ return E_NOTIMPL;
+
+ UInt64 folderUnpackSize = folders.GetFolderUnpackSize(folderIndex);
+ bool fullUnpack = true;
+ if (unpackSize)
+ {
+ if (*unpackSize > folderUnpackSize)
+ return E_FAIL;
+ fullUnpack = (*unpackSize == folderUnpackSize);
+ }
+
+ /*
+ We don't need to init isEncrypted and passwordIsDefined
+ We must upgrade them only
+
+ #ifndef _NO_CRYPTO
+ isEncrypted = false;
+ passwordIsDefined = false;
+ #endif
+ */
+
+ if (!_bindInfoPrev_Defined || !AreBindInfoExEqual(bindInfo, _bindInfoPrev))
+ {
+ _mixerRef.Release();
+
+ #ifdef USE_MIXER_MT
+ #ifdef USE_MIXER_ST
+ if (_useMixerMT)
+ #endif
+ {
+ _mixerMT = new NCoderMixer2::CMixerMT(false);
+ _mixerRef = _mixerMT;
+ _mixer = _mixerMT;
+ }
+ #ifdef USE_MIXER_ST
+ else
+ #endif
+ #endif
+ {
+ #ifdef USE_MIXER_ST
+ _mixerST = new NCoderMixer2::CMixerST(false);
+ _mixerRef = _mixerST;
+ _mixer = _mixerST;
+ #endif
+ }
+
+ RINOK(_mixer->SetBindInfo(bindInfo));
+
+ FOR_VECTOR(i, folderInfo.Coders)
+ {
+ const CCoderInfo &coderInfo = folderInfo.Coders[i];
+
+ #ifndef _SFX
+ // we don't support RAR codecs here
+ if ((coderInfo.MethodID >> 8) == 0x403)
+ return E_NOTIMPL;
+ #endif
+
+ CCreatedCoder cod;
+ RINOK(CreateCoder_Id(
+ EXTERNAL_CODECS_LOC_VARS
+ coderInfo.MethodID, false, cod));
+
+ if (coderInfo.IsSimpleCoder())
+ {
+ if (!cod.Coder)
+ return E_NOTIMPL;
+ // CMethodId m = coderInfo.MethodID;
+ // isFilter = (IsFilterMethod(m) || m == k_AES);
+ }
+ else
+ {
+ if (!cod.Coder2 || cod.NumStreams != coderInfo.NumStreams)
+ return E_NOTIMPL;
+ }
+ _mixer->AddCoder(cod);
+
+ // now there is no codec that uses another external codec
+ /*
+ #ifdef EXTERNAL_CODECS
+ CMyComPtr<ISetCompressCodecsInfo> setCompressCodecsInfo;
+ decoderUnknown.QueryInterface(IID_ISetCompressCodecsInfo, (void **)&setCompressCodecsInfo);
+ if (setCompressCodecsInfo)
+ {
+ // we must use g_ExternalCodecs also
+ RINOK(setCompressCodecsInfo->SetCompressCodecsInfo(__externalCodecs->GetCodecs));
+ }
+ #endif
+ */
+ }
+
+ _bindInfoPrev = bindInfo;
+ _bindInfoPrev_Defined = true;
+ }
+
+ _mixer->ReInit();
+
+ UInt32 packStreamIndex = 0;
+ UInt32 unpackStreamIndexStart = folders.FoToCoderUnpackSizes[folderIndex];
+
+ unsigned i;
+
+ bool mt_wasUsed = false;
+
+ for (i = 0; i < folderInfo.Coders.Size(); i++)
+ {
+ const CCoderInfo &coderInfo = folderInfo.Coders[i];
+ IUnknown *decoder = _mixer->GetCoder(i).GetUnknown();
+
+ #if !defined(_7ZIP_ST)
+ if (!mt_wasUsed)
+ {
+ if (mtMode)
+ {
+ CMyComPtr<ICompressSetCoderMt> setCoderMt;
+ decoder->QueryInterface(IID_ICompressSetCoderMt, (void **)&setCoderMt);
+ if (setCoderMt)
+ {
+ mt_wasUsed = true;
+ RINOK(setCoderMt->SetNumberOfThreads(numThreads));
+ }
+ }
+ // if (memUsage != 0)
+ {
+ CMyComPtr<ICompressSetMemLimit> setMemLimit;
+ decoder->QueryInterface(IID_ICompressSetMemLimit, (void **)&setMemLimit);
+ if (setMemLimit)
+ {
+ mt_wasUsed = true;
+ RINOK(setMemLimit->SetMemLimit(memUsage));
+ }
+ }
+ }
+ #endif
+
+ {
+ CMyComPtr<ICompressSetDecoderProperties2> setDecoderProperties;
+ decoder->QueryInterface(IID_ICompressSetDecoderProperties2, (void **)&setDecoderProperties);
+ if (setDecoderProperties)
+ {
+ const CByteBuffer &props = coderInfo.Props;
+ size_t size = props.Size();
+ if (size > 0xFFFFFFFF)
+ return E_NOTIMPL;
+ HRESULT res = setDecoderProperties->SetDecoderProperties2((const Byte *)props, (UInt32)size);
+ if (res == E_INVALIDARG)
+ res = E_NOTIMPL;
+ RINOK(res);
+ }
+ }
+
+ #ifndef _NO_CRYPTO
+ {
+ CMyComPtr<ICryptoSetPassword> cryptoSetPassword;
+ decoder->QueryInterface(IID_ICryptoSetPassword, (void **)&cryptoSetPassword);
+ if (cryptoSetPassword)
+ {
+ isEncrypted = true;
+ if (!getTextPassword)
+ return E_NOTIMPL;
+ CMyComBSTR passwordBSTR;
+ RINOK(getTextPassword->CryptoGetTextPassword(&passwordBSTR));
+ passwordIsDefined = true;
+ password.Empty();
+ size_t len = 0;
+ if (passwordBSTR)
+ {
+ password = passwordBSTR;
+ len = password.Len();
+ }
+ CByteBuffer buffer(len * 2);
+ for (size_t k = 0; k < len; k++)
+ {
+ wchar_t c = passwordBSTR[k];
+ ((Byte *)buffer)[k * 2] = (Byte)c;
+ ((Byte *)buffer)[k * 2 + 1] = (Byte)(c >> 8);
+ }
+ RINOK(cryptoSetPassword->CryptoSetPassword((const Byte *)buffer, (UInt32)buffer.Size()));
+ }
+ }
+ #endif
+
+ bool finishMode = false;
+ {
+ CMyComPtr<ICompressSetFinishMode> setFinishMode;
+ decoder->QueryInterface(IID_ICompressSetFinishMode, (void **)&setFinishMode);
+ if (setFinishMode)
+ {
+ finishMode = fullUnpack;
+ RINOK(setFinishMode->SetFinishMode(BoolToInt(finishMode)));
+ }
+ }
+
+ UInt32 numStreams = (UInt32)coderInfo.NumStreams;
+
+ CObjArray<UInt64> packSizes(numStreams);
+ CObjArray<const UInt64 *> packSizesPointers(numStreams);
+
+ for (UInt32 j = 0; j < numStreams; j++, packStreamIndex++)
+ {
+ int bond = folderInfo.FindBond_for_PackStream(packStreamIndex);
+
+ if (bond >= 0)
+ packSizesPointers[j] = &folders.CoderUnpackSizes[unpackStreamIndexStart + folderInfo.Bonds[(unsigned)bond].UnpackIndex];
+ else
+ {
+ int index = folderInfo.Find_in_PackStreams(packStreamIndex);
+ if (index < 0)
+ return E_NOTIMPL;
+ packSizes[j] = packPositions[(unsigned)index + 1] - packPositions[(unsigned)index];
+ packSizesPointers[j] = &packSizes[j];
+ }
+ }
+
+ const UInt64 *unpackSizesPointer =
+ (unpackSize && i == bindInfo.UnpackCoder) ?
+ unpackSize :
+ &folders.CoderUnpackSizes[unpackStreamIndexStart + i];
+
+ _mixer->SetCoderInfo(i, unpackSizesPointer, packSizesPointers, finishMode);
+ }
+
+ if (outStream)
+ {
+ _mixer->SelectMainCoder(!fullUnpack);
+ }
+
+ CObjectVector< CMyComPtr<ISequentialInStream> > inStreams;
+
+ CLockedInStream *lockedInStreamSpec = new CLockedInStream;
+ CMyComPtr<IUnknown> lockedInStream = lockedInStreamSpec;
+
+ bool needMtLock = false;
+
+ if (folderInfo.PackStreams.Size() > 1)
+ {
+ // lockedInStream.Pos = (UInt64)(Int64)-1;
+ // RINOK(inStream->Seek(0, STREAM_SEEK_CUR, &lockedInStream.Pos));
+ RINOK(inStream->Seek(startPos + packPositions[0], STREAM_SEEK_SET, &lockedInStreamSpec->Pos));
+ lockedInStreamSpec->Stream = inStream;
+
+ #ifdef USE_MIXER_ST
+ if (_mixer->IsThere_ExternalCoder_in_PackTree(_mixer->MainCoderIndex))
+ #endif
+ needMtLock = true;
+ }
+
+ for (unsigned j = 0; j < folderInfo.PackStreams.Size(); j++)
+ {
+ CMyComPtr<ISequentialInStream> packStream;
+ UInt64 packPos = startPos + packPositions[j];
+
+ if (folderInfo.PackStreams.Size() == 1)
+ {
+ RINOK(inStream->Seek(packPos, STREAM_SEEK_SET, NULL));
+ packStream = inStream;
+ }
+ else
+ {
+ #ifdef USE_MIXER_MT
+ #ifdef USE_MIXER_ST
+ if (_useMixerMT || needMtLock)
+ #endif
+ {
+ CLockedSequentialInStreamMT *lockedStreamImpSpec = new CLockedSequentialInStreamMT;
+ packStream = lockedStreamImpSpec;
+ lockedStreamImpSpec->Init(lockedInStreamSpec, packPos);
+ }
+ #ifdef USE_MIXER_ST
+ else
+ #endif
+ #endif
+ {
+ #ifdef USE_MIXER_ST
+ CLockedSequentialInStreamST *lockedStreamImpSpec = new CLockedSequentialInStreamST;
+ packStream = lockedStreamImpSpec;
+ lockedStreamImpSpec->Init(lockedInStreamSpec, packPos);
+ #endif
+ }
+ }
+
+ CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
+ inStreams.AddNew() = streamSpec;
+ streamSpec->SetStream(packStream);
+ streamSpec->Init(packPositions[j + 1] - packPositions[j]);
+ }
+
+ unsigned num = inStreams.Size();
+ CObjArray<ISequentialInStream *> inStreamPointers(num);
+ for (i = 0; i < num; i++)
+ inStreamPointers[i] = inStreams[i];
+
+ if (outStream)
+ {
+ CMyComPtr<ICompressProgressInfo> progress2;
+ if (compressProgress && !_mixer->Is_PackSize_Correct_for_Coder(_mixer->MainCoderIndex))
+ progress2 = new CDecProgress(compressProgress);
+
+ ISequentialOutStream *outStreamPointer = outStream;
+ return _mixer->Code(inStreamPointers, &outStreamPointer,
+ progress2 ? (ICompressProgressInfo *)progress2 : compressProgress,
+ dataAfterEnd_Error);
+ }
+
+ #ifdef USE_MIXER_ST
+ return _mixerST->GetMainUnpackStream(inStreamPointers, inStreamMainRes);
+ #else
+ return E_FAIL;
+ #endif
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.h
new file mode 100644
index 0000000000..944f8a3171
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zDecode.h
@@ -0,0 +1,70 @@
+// 7zDecode.h
+
+#ifndef __7Z_DECODE_H
+#define __7Z_DECODE_H
+
+#include "../Common/CoderMixer2.h"
+
+#include "7zIn.h"
+
+namespace NArchive {
+namespace N7z {
+
+struct CBindInfoEx: public NCoderMixer2::CBindInfo
+{
+ CRecordVector<CMethodId> CoderMethodIDs;
+
+ void Clear()
+ {
+ CBindInfo::Clear();
+ CoderMethodIDs.Clear();
+ }
+};
+
+class CDecoder
+{
+ bool _bindInfoPrev_Defined;
+ CBindInfoEx _bindInfoPrev;
+
+ bool _useMixerMT;
+
+ #ifdef USE_MIXER_ST
+ NCoderMixer2::CMixerST *_mixerST;
+ #endif
+
+ #ifdef USE_MIXER_MT
+ NCoderMixer2::CMixerMT *_mixerMT;
+ #endif
+
+ NCoderMixer2::CMixer *_mixer;
+ CMyComPtr<IUnknown> _mixerRef;
+
+public:
+
+ CDecoder(bool useMixerMT);
+
+ HRESULT Decode(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ IInStream *inStream,
+ UInt64 startPos,
+ const CFolders &folders, unsigned folderIndex,
+ const UInt64 *unpackSize // if (!unpackSize), then full folder is required
+ // if (unpackSize), then only *unpackSize bytes from folder are required
+
+ , ISequentialOutStream *outStream
+ , ICompressProgressInfo *compressProgress
+
+ , ISequentialInStream **inStreamMainRes
+ , bool &dataAfterEnd_Error
+
+ _7Z_DECODER_CRYPRO_VARS_DECL
+
+ #if !defined(_7ZIP_ST)
+ , bool mtMode, UInt32 numThreads, UInt64 memUsage
+ #endif
+ );
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.cpp
new file mode 100644
index 0000000000..4c0d22149a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.cpp
@@ -0,0 +1,678 @@
+// 7zEncode.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/CreateCoder.h"
+#include "../../Common/FilterCoder.h"
+#include "../../Common/LimitedStreams.h"
+#include "../../Common/InOutTempBuffer.h"
+#include "../../Common/ProgressUtils.h"
+#include "../../Common/StreamObjects.h"
+
+#include "7zEncode.h"
+#include "7zSpecStream.h"
+
+namespace NArchive {
+namespace N7z {
+
+void CEncoder::InitBindConv()
+{
+ unsigned numIn = _bindInfo.Coders.Size();
+
+ _SrcIn_to_DestOut.ClearAndSetSize(numIn);
+ _DestOut_to_SrcIn.ClearAndSetSize(numIn);
+
+ unsigned numOut = _bindInfo.GetNum_Bonds_and_PackStreams();
+ _SrcOut_to_DestIn.ClearAndSetSize(numOut);
+ // _DestIn_to_SrcOut.ClearAndSetSize(numOut);
+
+ UInt32 destIn = 0;
+ UInt32 destOut = 0;
+
+ for (unsigned i = _bindInfo.Coders.Size(); i != 0;)
+ {
+ i--;
+
+ const NCoderMixer2::CCoderStreamsInfo &coder = _bindInfo.Coders[i];
+
+ numIn--;
+ numOut -= coder.NumStreams;
+
+ _SrcIn_to_DestOut[numIn] = destOut;
+ _DestOut_to_SrcIn[destOut] = numIn;
+
+ destOut++;
+
+ for (UInt32 j = 0; j < coder.NumStreams; j++, destIn++)
+ {
+ UInt32 index = numOut + j;
+ _SrcOut_to_DestIn[index] = destIn;
+ // _DestIn_to_SrcOut[destIn] = index;
+ }
+ }
+}
+
+void CEncoder::SetFolder(CFolder &folder)
+{
+ folder.Bonds.SetSize(_bindInfo.Bonds.Size());
+
+ unsigned i;
+
+ for (i = 0; i < _bindInfo.Bonds.Size(); i++)
+ {
+ CBond &fb = folder.Bonds[i];
+ const NCoderMixer2::CBond &mixerBond = _bindInfo.Bonds[_bindInfo.Bonds.Size() - 1 - i];
+ fb.PackIndex = _SrcOut_to_DestIn[mixerBond.PackIndex];
+ fb.UnpackIndex = _SrcIn_to_DestOut[mixerBond.UnpackIndex];
+ }
+
+ folder.Coders.SetSize(_bindInfo.Coders.Size());
+
+ for (i = 0; i < _bindInfo.Coders.Size(); i++)
+ {
+ CCoderInfo &coderInfo = folder.Coders[i];
+ const NCoderMixer2::CCoderStreamsInfo &coderStreamsInfo = _bindInfo.Coders[_bindInfo.Coders.Size() - 1 - i];
+
+ coderInfo.NumStreams = coderStreamsInfo.NumStreams;
+ coderInfo.MethodID = _decompressionMethods[i];
+ // we don't free coderInfo.Props here. So coderInfo.Props can be non-empty.
+ }
+
+ folder.PackStreams.SetSize(_bindInfo.PackStreams.Size());
+
+ for (i = 0; i < _bindInfo.PackStreams.Size(); i++)
+ folder.PackStreams[i] = _SrcOut_to_DestIn[_bindInfo.PackStreams[i]];
+}
+
+
+
+static HRESULT SetCoderProps2(const CProps &props, const UInt64 *dataSizeReduce, IUnknown *coder)
+{
+ CMyComPtr<ICompressSetCoderProperties> setCoderProperties;
+ coder->QueryInterface(IID_ICompressSetCoderProperties, (void **)&setCoderProperties);
+ if (setCoderProperties)
+ return props.SetCoderProps(setCoderProperties, dataSizeReduce);
+ return props.AreThereNonOptionalProps() ? E_INVALIDARG : S_OK;
+}
+
+
+
+void CMtEncMultiProgress::Init(ICompressProgressInfo *progress)
+{
+ _progress = progress;
+ OutSize = 0;
+}
+
+STDMETHODIMP CMtEncMultiProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 * /* outSize */)
+{
+ UInt64 outSize2;
+ {
+ #ifndef _7ZIP_ST
+ NWindows::NSynchronization::CCriticalSectionLock lock(CriticalSection);
+ #endif
+ outSize2 = OutSize;
+ }
+
+ if (_progress)
+ return _progress->SetRatioInfo(inSize, &outSize2);
+
+ return S_OK;
+}
+
+
+
+HRESULT CEncoder::CreateMixerCoder(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const UInt64 *inSizeForReduce)
+{
+ #ifdef USE_MIXER_MT
+ #ifdef USE_MIXER_ST
+ if (_options.MultiThreadMixer)
+ #endif
+ {
+ _mixerMT = new NCoderMixer2::CMixerMT(true);
+ _mixerRef = _mixerMT;
+ _mixer = _mixerMT;
+ }
+ #ifdef USE_MIXER_ST
+ else
+ #endif
+ #endif
+ {
+ #ifdef USE_MIXER_ST
+ _mixerST = new NCoderMixer2::CMixerST(true);
+ _mixerRef = _mixerST;
+ _mixer = _mixerST;
+ #endif
+ }
+
+ RINOK(_mixer->SetBindInfo(_bindInfo));
+
+ FOR_VECTOR (m, _options.Methods)
+ {
+ const CMethodFull &methodFull = _options.Methods[m];
+
+ CCreatedCoder cod;
+
+ if (methodFull.CodecIndex >= 0)
+ {
+ RINOK(CreateCoder_Index(
+ EXTERNAL_CODECS_LOC_VARS
+ methodFull.CodecIndex, true, cod));
+ }
+ else
+ {
+ RINOK(CreateCoder_Id(
+ EXTERNAL_CODECS_LOC_VARS
+ methodFull.Id, true, cod));
+ }
+
+ if (cod.NumStreams != methodFull.NumStreams)
+ return E_FAIL;
+ if (!cod.Coder && !cod.Coder2)
+ return E_FAIL;
+
+ CMyComPtr<IUnknown> encoderCommon = cod.Coder ? (IUnknown *)cod.Coder : (IUnknown *)cod.Coder2;
+
+ #ifndef _7ZIP_ST
+ {
+ CMyComPtr<ICompressSetCoderMt> setCoderMt;
+ encoderCommon.QueryInterface(IID_ICompressSetCoderMt, &setCoderMt);
+ if (setCoderMt)
+ {
+ RINOK(setCoderMt->SetNumberOfThreads(_options.NumThreads));
+ }
+ }
+ #endif
+
+ RINOK(SetCoderProps2(methodFull, inSizeForReduce, encoderCommon));
+
+ /*
+ CMyComPtr<ICryptoResetSalt> resetSalt;
+ encoderCommon.QueryInterface(IID_ICryptoResetSalt, (void **)&resetSalt);
+ if (resetSalt)
+ {
+ resetSalt->ResetSalt();
+ }
+ */
+
+ // now there is no codec that uses another external codec
+ /*
+ #ifdef EXTERNAL_CODECS
+ CMyComPtr<ISetCompressCodecsInfo> setCompressCodecsInfo;
+ encoderCommon.QueryInterface(IID_ISetCompressCodecsInfo, (void **)&setCompressCodecsInfo);
+ if (setCompressCodecsInfo)
+ {
+ // we must use g_ExternalCodecs also
+ RINOK(setCompressCodecsInfo->SetCompressCodecsInfo(__externalCodecs->GetCodecs));
+ }
+ #endif
+ */
+
+ CMyComPtr<ICryptoSetPassword> cryptoSetPassword;
+ encoderCommon.QueryInterface(IID_ICryptoSetPassword, &cryptoSetPassword);
+
+ if (cryptoSetPassword)
+ {
+ const unsigned sizeInBytes = _options.Password.Len() * 2;
+ CByteBuffer buffer(sizeInBytes);
+ for (unsigned i = 0; i < _options.Password.Len(); i++)
+ {
+ wchar_t c = _options.Password[i];
+ ((Byte *)buffer)[i * 2] = (Byte)c;
+ ((Byte *)buffer)[i * 2 + 1] = (Byte)(c >> 8);
+ }
+ RINOK(cryptoSetPassword->CryptoSetPassword((const Byte *)buffer, (UInt32)sizeInBytes));
+ }
+
+ _mixer->AddCoder(cod);
+ }
+ return S_OK;
+}
+
+
+
+class CSequentialOutTempBufferImp2:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CInOutTempBuffer *_buf;
+public:
+ CMtEncMultiProgress *_mtProgresSpec;
+
+ CSequentialOutTempBufferImp2(): _buf(0), _mtProgresSpec(NULL) {}
+ void Init(CInOutTempBuffer *buffer) { _buf = buffer; }
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CSequentialOutTempBufferImp2::Write(const void *data, UInt32 size, UInt32 *processed)
+{
+ if (!_buf->Write(data, size))
+ {
+ if (processed)
+ *processed = 0;
+ return E_FAIL;
+ }
+ if (processed)
+ *processed = size;
+ if (_mtProgresSpec)
+ _mtProgresSpec->AddOutSize(size);
+ return S_OK;
+}
+
+
+class CSequentialOutMtNotify:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+public:
+ CMyComPtr<ISequentialOutStream> _stream;
+ CMtEncMultiProgress *_mtProgresSpec;
+
+ CSequentialOutMtNotify(): _mtProgresSpec(NULL) {}
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CSequentialOutMtNotify::Write(const void *data, UInt32 size, UInt32 *processed)
+{
+ UInt32 realProcessed = 0;
+ HRESULT res = _stream->Write(data, size, &realProcessed);
+ if (processed)
+ *processed = realProcessed;
+ if (_mtProgresSpec)
+ _mtProgresSpec->AddOutSize(size);
+ return res;
+}
+
+
+
+HRESULT CEncoder::Encode(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ ISequentialInStream *inStream,
+ // const UInt64 *inStreamSize,
+ const UInt64 *inSizeForReduce,
+ CFolder &folderItem,
+ CRecordVector<UInt64> &coderUnpackSizes,
+ UInt64 &unpackSize,
+ ISequentialOutStream *outStream,
+ CRecordVector<UInt64> &packSizes,
+ ICompressProgressInfo *compressProgress)
+{
+ RINOK(EncoderConstr());
+
+ if (!_mixerRef)
+ {
+ RINOK(CreateMixerCoder(EXTERNAL_CODECS_LOC_VARS inSizeForReduce));
+ }
+
+ _mixer->ReInit();
+
+ CMtEncMultiProgress *mtProgressSpec = NULL;
+ CMyComPtr<ICompressProgressInfo> mtProgress;
+
+ CSequentialOutMtNotify *mtOutStreamNotifySpec = NULL;
+ CMyComPtr<ISequentialOutStream> mtOutStreamNotify;
+
+ CObjectVector<CInOutTempBuffer> inOutTempBuffers;
+ CObjectVector<CSequentialOutTempBufferImp2 *> tempBufferSpecs;
+ CObjectVector<CMyComPtr<ISequentialOutStream> > tempBuffers;
+
+ unsigned numMethods = _bindInfo.Coders.Size();
+
+ unsigned i;
+
+ for (i = 1; i < _bindInfo.PackStreams.Size(); i++)
+ {
+ CInOutTempBuffer &iotb = inOutTempBuffers.AddNew();
+ iotb.Create();
+ iotb.InitWriting();
+ }
+
+ for (i = 1; i < _bindInfo.PackStreams.Size(); i++)
+ {
+ CSequentialOutTempBufferImp2 *tempBufferSpec = new CSequentialOutTempBufferImp2;
+ CMyComPtr<ISequentialOutStream> tempBuffer = tempBufferSpec;
+ tempBufferSpec->Init(&inOutTempBuffers[i - 1]);
+ tempBuffers.Add(tempBuffer);
+ tempBufferSpecs.Add(tempBufferSpec);
+ }
+
+ for (i = 0; i < numMethods; i++)
+ _mixer->SetCoderInfo(i, NULL, NULL, false);
+
+
+ /* inStreamSize can be used by BCJ2 to set optimal range of conversion.
+ But current BCJ2 encoder uses also another way to check exact size of current file.
+ So inStreamSize is not required. */
+
+ /*
+ if (inStreamSize)
+ _mixer->SetCoderInfo(_bindInfo.UnpackCoder, inStreamSize, NULL);
+ */
+
+
+ CSequentialInStreamSizeCount2 *inStreamSizeCountSpec = new CSequentialInStreamSizeCount2;
+ CMyComPtr<ISequentialInStream> inStreamSizeCount = inStreamSizeCountSpec;
+
+ CSequentialOutStreamSizeCount *outStreamSizeCountSpec = NULL;
+ CMyComPtr<ISequentialOutStream> outStreamSizeCount;
+
+ inStreamSizeCountSpec->Init(inStream);
+
+ ISequentialInStream *inStreamPointer = inStreamSizeCount;
+ CRecordVector<ISequentialOutStream *> outStreamPointers;
+
+ SetFolder(folderItem);
+
+ for (i = 0; i < numMethods; i++)
+ {
+ IUnknown *coder = _mixer->GetCoder(i).GetUnknown();
+
+ CMyComPtr<ICryptoResetInitVector> resetInitVector;
+ coder->QueryInterface(IID_ICryptoResetInitVector, (void **)&resetInitVector);
+ if (resetInitVector)
+ {
+ resetInitVector->ResetInitVector();
+ }
+
+ {
+ CMyComPtr<ICompressSetCoderPropertiesOpt> optProps;
+ coder->QueryInterface(IID_ICompressSetCoderPropertiesOpt, (void **)&optProps);
+ if (optProps)
+ {
+ PROPID propID = NCoderPropID::kExpectedDataSize;
+ NWindows::NCOM::CPropVariant prop = (UInt64)unpackSize;
+ RINOK(optProps->SetCoderPropertiesOpt(&propID, &prop, 1));
+ }
+ }
+
+ CMyComPtr<ICompressWriteCoderProperties> writeCoderProperties;
+ coder->QueryInterface(IID_ICompressWriteCoderProperties, (void **)&writeCoderProperties);
+
+ CByteBuffer &props = folderItem.Coders[numMethods - 1 - i].Props;
+
+ if (writeCoderProperties)
+ {
+ CDynBufSeqOutStream *outStreamSpec = new CDynBufSeqOutStream;
+ CMyComPtr<ISequentialOutStream> dynOutStream(outStreamSpec);
+ outStreamSpec->Init();
+ RINOK(writeCoderProperties->WriteCoderProperties(dynOutStream));
+ outStreamSpec->CopyToBuffer(props);
+ }
+ else
+ props.Free();
+ }
+
+ _mixer->SelectMainCoder(false);
+ UInt32 mainCoder = _mixer->MainCoderIndex;
+
+ bool useMtProgress = false;
+ if (!_mixer->Is_PackSize_Correct_for_Coder(mainCoder))
+ {
+ #ifdef _7ZIP_ST
+ if (!_mixer->IsThere_ExternalCoder_in_PackTree(mainCoder))
+ #endif
+ useMtProgress = true;
+ }
+
+ if (useMtProgress)
+ {
+ mtProgressSpec = new CMtEncMultiProgress;
+ mtProgress = mtProgressSpec;
+ mtProgressSpec->Init(compressProgress);
+
+ mtOutStreamNotifySpec = new CSequentialOutMtNotify;
+ mtOutStreamNotify = mtOutStreamNotifySpec;
+ mtOutStreamNotifySpec->_stream = outStream;
+ mtOutStreamNotifySpec->_mtProgresSpec = mtProgressSpec;
+
+ FOR_VECTOR(t, tempBufferSpecs)
+ {
+ tempBufferSpecs[t]->_mtProgresSpec = mtProgressSpec;
+ }
+ }
+
+
+ if (_bindInfo.PackStreams.Size() != 0)
+ {
+ outStreamSizeCountSpec = new CSequentialOutStreamSizeCount;
+ outStreamSizeCount = outStreamSizeCountSpec;
+ outStreamSizeCountSpec->SetStream(mtOutStreamNotify ? (ISequentialOutStream *)mtOutStreamNotify : outStream);
+ outStreamSizeCountSpec->Init();
+ outStreamPointers.Add(outStreamSizeCount);
+ }
+
+ for (i = 1; i < _bindInfo.PackStreams.Size(); i++)
+ outStreamPointers.Add(tempBuffers[i - 1]);
+
+ bool dataAfterEnd_Error;
+
+ RINOK(_mixer->Code(
+ &inStreamPointer,
+ &outStreamPointers.Front(),
+ mtProgress ? (ICompressProgressInfo *)mtProgress : compressProgress, dataAfterEnd_Error));
+
+ if (_bindInfo.PackStreams.Size() != 0)
+ packSizes.Add(outStreamSizeCountSpec->GetSize());
+
+ for (i = 1; i < _bindInfo.PackStreams.Size(); i++)
+ {
+ CInOutTempBuffer &inOutTempBuffer = inOutTempBuffers[i - 1];
+ RINOK(inOutTempBuffer.WriteToStream(outStream));
+ packSizes.Add(inOutTempBuffer.GetDataSize());
+ }
+
+ unpackSize = 0;
+
+ for (i = 0; i < _bindInfo.Coders.Size(); i++)
+ {
+ int bond = _bindInfo.FindBond_for_UnpackStream(_DestOut_to_SrcIn[i]);
+ UInt64 streamSize;
+ if (bond < 0)
+ {
+ streamSize = inStreamSizeCountSpec->GetSize();
+ unpackSize = streamSize;
+ }
+ else
+ streamSize = _mixer->GetBondStreamSize(bond);
+ coderUnpackSizes.Add(streamSize);
+ }
+
+ return S_OK;
+}
+
+
+CEncoder::CEncoder(const CCompressionMethodMode &options):
+ _constructed(false)
+{
+ if (options.IsEmpty())
+ throw 1;
+
+ _options = options;
+
+ #ifdef USE_MIXER_ST
+ _mixerST = NULL;
+ #endif
+
+ #ifdef USE_MIXER_MT
+ _mixerMT = NULL;
+ #endif
+
+ _mixer = NULL;
+}
+
+
+HRESULT CEncoder::EncoderConstr()
+{
+ if (_constructed)
+ return S_OK;
+ if (_options.Methods.IsEmpty())
+ {
+ // it has only password method;
+ if (!_options.PasswordIsDefined)
+ throw 1;
+ if (!_options.Bonds.IsEmpty())
+ throw 1;
+
+ CMethodFull method;
+ method.Id = k_AES;
+ method.NumStreams = 1;
+ _options.Methods.Add(method);
+
+ NCoderMixer2::CCoderStreamsInfo coderStreamsInfo;
+ coderStreamsInfo.NumStreams = 1;
+ _bindInfo.Coders.Add(coderStreamsInfo);
+
+ _bindInfo.PackStreams.Add(0);
+ _bindInfo.UnpackCoder = 0;
+ }
+ else
+ {
+
+ UInt32 numOutStreams = 0;
+ unsigned i;
+
+ for (i = 0; i < _options.Methods.Size(); i++)
+ {
+ const CMethodFull &methodFull = _options.Methods[i];
+ NCoderMixer2::CCoderStreamsInfo cod;
+
+ cod.NumStreams = methodFull.NumStreams;
+
+ if (_options.Bonds.IsEmpty())
+ {
+ // if there are no bonds in options, we create bonds via first streams of coders
+ if (i != _options.Methods.Size() - 1)
+ {
+ NCoderMixer2::CBond bond;
+ bond.PackIndex = numOutStreams;
+ bond.UnpackIndex = i + 1; // it's next coder
+ _bindInfo.Bonds.Add(bond);
+ }
+ else if (cod.NumStreams != 0)
+ _bindInfo.PackStreams.Insert(0, numOutStreams);
+
+ for (UInt32 j = 1; j < cod.NumStreams; j++)
+ _bindInfo.PackStreams.Add(numOutStreams + j);
+ }
+
+ numOutStreams += cod.NumStreams;
+
+ _bindInfo.Coders.Add(cod);
+ }
+
+ if (!_options.Bonds.IsEmpty())
+ {
+ for (i = 0; i < _options.Bonds.Size(); i++)
+ {
+ NCoderMixer2::CBond mixerBond;
+ const CBond2 &bond = _options.Bonds[i];
+ if (bond.InCoder >= _bindInfo.Coders.Size()
+ || bond.OutCoder >= _bindInfo.Coders.Size()
+ || bond.OutStream >= _bindInfo.Coders[bond.OutCoder].NumStreams)
+ return E_INVALIDARG;
+ mixerBond.PackIndex = _bindInfo.GetStream_for_Coder(bond.OutCoder) + bond.OutStream;
+ mixerBond.UnpackIndex = bond.InCoder;
+ _bindInfo.Bonds.Add(mixerBond);
+ }
+
+ for (i = 0; i < numOutStreams; i++)
+ if (_bindInfo.FindBond_for_PackStream(i) == -1)
+ _bindInfo.PackStreams.Add(i);
+ }
+
+ if (!_bindInfo.SetUnpackCoder())
+ return E_INVALIDARG;
+
+ if (!_bindInfo.CalcMapsAndCheck())
+ return E_INVALIDARG;
+
+ if (_bindInfo.PackStreams.Size() != 1)
+ {
+ /* main_PackStream is pack stream of main path of coders tree.
+ We find main_PackStream, and place to start of list of out streams.
+ It allows to use more optimal memory usage for temp buffers,
+ if main_PackStream is largest stream. */
+
+ UInt32 ci = _bindInfo.UnpackCoder;
+
+ for (;;)
+ {
+ if (_bindInfo.Coders[ci].NumStreams == 0)
+ break;
+
+ UInt32 outIndex = _bindInfo.Coder_to_Stream[ci];
+ int bond = _bindInfo.FindBond_for_PackStream(outIndex);
+ if (bond >= 0)
+ {
+ ci = _bindInfo.Bonds[bond].UnpackIndex;
+ continue;
+ }
+
+ int si = _bindInfo.FindStream_in_PackStreams(outIndex);
+ if (si >= 0)
+ _bindInfo.PackStreams.MoveToFront(si);
+ break;
+ }
+ }
+
+ if (_options.PasswordIsDefined)
+ {
+ unsigned numCryptoStreams = _bindInfo.PackStreams.Size();
+
+ unsigned numInStreams = _bindInfo.Coders.Size();
+
+ for (i = 0; i < numCryptoStreams; i++)
+ {
+ NCoderMixer2::CBond bond;
+ bond.UnpackIndex = numInStreams + i;
+ bond.PackIndex = _bindInfo.PackStreams[i];
+ _bindInfo.Bonds.Add(bond);
+ }
+ _bindInfo.PackStreams.Clear();
+
+ /*
+ if (numCryptoStreams == 0)
+ numCryptoStreams = 1;
+ */
+
+ for (i = 0; i < numCryptoStreams; i++)
+ {
+ CMethodFull method;
+ method.NumStreams = 1;
+ method.Id = k_AES;
+ _options.Methods.Add(method);
+
+ NCoderMixer2::CCoderStreamsInfo cod;
+ cod.NumStreams = 1;
+ _bindInfo.Coders.Add(cod);
+
+ _bindInfo.PackStreams.Add(numOutStreams++);
+ }
+ }
+
+ }
+
+ for (unsigned i = _options.Methods.Size(); i != 0;)
+ _decompressionMethods.Add(_options.Methods[--i].Id);
+
+ if (_bindInfo.Coders.Size() > 16)
+ return E_INVALIDARG;
+ if (_bindInfo.GetNum_Bonds_and_PackStreams() > 16)
+ return E_INVALIDARG;
+
+ if (!_bindInfo.CalcMapsAndCheck())
+ return E_INVALIDARG;
+
+ InitBindConv();
+ _constructed = true;
+ return S_OK;
+}
+
+CEncoder::~CEncoder() {}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.h
new file mode 100644
index 0000000000..434cbecd3c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zEncode.h
@@ -0,0 +1,92 @@
+// 7zEncode.h
+
+#ifndef __7Z_ENCODE_H
+#define __7Z_ENCODE_H
+
+#include "7zCompressionMode.h"
+
+#include "../Common/CoderMixer2.h"
+
+#include "7zItem.h"
+
+namespace NArchive {
+namespace N7z {
+
+class CMtEncMultiProgress:
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+ CMyComPtr<ICompressProgressInfo> _progress;
+ #ifndef _7ZIP_ST
+ NWindows::NSynchronization::CCriticalSection CriticalSection;
+ #endif
+
+public:
+ UInt64 OutSize;
+
+ CMtEncMultiProgress(): OutSize(0) {}
+
+ void Init(ICompressProgressInfo *progress);
+
+ void AddOutSize(UInt64 addOutSize)
+ {
+ #ifndef _7ZIP_ST
+ NWindows::NSynchronization::CCriticalSectionLock lock(CriticalSection);
+ #endif
+ OutSize += addOutSize;
+ }
+
+ MY_UNKNOWN_IMP1(ICompressProgressInfo)
+
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+};
+
+class CEncoder
+{
+ #ifdef USE_MIXER_ST
+ NCoderMixer2::CMixerST *_mixerST;
+ #endif
+ #ifdef USE_MIXER_MT
+ NCoderMixer2::CMixerMT *_mixerMT;
+ #endif
+
+ NCoderMixer2::CMixer *_mixer;
+ CMyComPtr<IUnknown> _mixerRef;
+
+ CCompressionMethodMode _options;
+ NCoderMixer2::CBindInfo _bindInfo;
+ CRecordVector<CMethodId> _decompressionMethods;
+
+ CRecordVector<UInt32> _SrcIn_to_DestOut;
+ CRecordVector<UInt32> _SrcOut_to_DestIn;
+ // CRecordVector<UInt32> _DestIn_to_SrcOut;
+ CRecordVector<UInt32> _DestOut_to_SrcIn;
+
+ void InitBindConv();
+ void SetFolder(CFolder &folder);
+
+ HRESULT CreateMixerCoder(DECL_EXTERNAL_CODECS_LOC_VARS
+ const UInt64 *inSizeForReduce);
+
+ bool _constructed;
+public:
+
+ CEncoder(const CCompressionMethodMode &options);
+ ~CEncoder();
+ HRESULT EncoderConstr();
+ HRESULT Encode(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ ISequentialInStream *inStream,
+ // const UInt64 *inStreamSize,
+ const UInt64 *inSizeForReduce,
+ CFolder &folderItem,
+ CRecordVector<UInt64> &coderUnpackSizes,
+ UInt64 &unpackSize,
+ ISequentialOutStream *outStream,
+ CRecordVector<UInt64> &packSizes,
+ ICompressProgressInfo *compressProgress);
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zExtract.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zExtract.cpp
new file mode 100644
index 0000000000..075644ffda
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zExtract.cpp
@@ -0,0 +1,423 @@
+// 7zExtract.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/7zCrc.h"
+
+#include "../../../Common/ComTry.h"
+
+#include "../../Common/ProgressUtils.h"
+
+#include "7zDecode.h"
+#include "7zHandler.h"
+
+// EXTERN_g_ExternalCodecs
+
+namespace NArchive {
+namespace N7z {
+
+class CFolderOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+public:
+ bool TestMode;
+ bool CheckCrc;
+private:
+ bool _fileIsOpen;
+ bool _calcCrc;
+ UInt32 _crc;
+ UInt64 _rem;
+
+ const UInt32 *_indexes;
+ unsigned _numFiles;
+ unsigned _fileIndex;
+
+ HRESULT OpenFile(bool isCorrupted = false);
+ HRESULT CloseFile_and_SetResult(Int32 res);
+ HRESULT CloseFile();
+ HRESULT ProcessEmptyFiles();
+
+public:
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+
+ const CDbEx *_db;
+ CMyComPtr<IArchiveExtractCallback> ExtractCallback;
+
+ bool ExtraWriteWasCut;
+
+ CFolderOutStream():
+ TestMode(false),
+ CheckCrc(true)
+ {}
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+
+ HRESULT Init(unsigned startIndex, const UInt32 *indexes, unsigned numFiles);
+ HRESULT FlushCorrupted(Int32 callbackOperationResult);
+
+ bool WasWritingFinished() const { return _numFiles == 0; }
+};
+
+
+HRESULT CFolderOutStream::Init(unsigned startIndex, const UInt32 *indexes, unsigned numFiles)
+{
+ _fileIndex = startIndex;
+ _indexes = indexes;
+ _numFiles = numFiles;
+
+ _fileIsOpen = false;
+ ExtraWriteWasCut = false;
+
+ return ProcessEmptyFiles();
+}
+
+HRESULT CFolderOutStream::OpenFile(bool isCorrupted)
+{
+ const CFileItem &fi = _db->Files[_fileIndex];
+ UInt32 nextFileIndex = (_indexes ? *_indexes : _fileIndex);
+ Int32 askMode = (_fileIndex == nextFileIndex) ?
+ (TestMode ?
+ NExtract::NAskMode::kTest :
+ NExtract::NAskMode::kExtract) :
+ NExtract::NAskMode::kSkip;
+
+ if (isCorrupted
+ && askMode == NExtract::NAskMode::kExtract
+ && !_db->IsItemAnti(_fileIndex)
+ && !fi.IsDir)
+ askMode = NExtract::NAskMode::kTest;
+
+ CMyComPtr<ISequentialOutStream> realOutStream;
+ RINOK(ExtractCallback->GetStream(_fileIndex, &realOutStream, askMode));
+
+ _stream = realOutStream;
+ _crc = CRC_INIT_VAL;
+ _calcCrc = (CheckCrc && fi.CrcDefined && !fi.IsDir);
+
+ _fileIsOpen = true;
+ _rem = fi.Size;
+
+ if (askMode == NExtract::NAskMode::kExtract
+ && !realOutStream
+ && !_db->IsItemAnti(_fileIndex)
+ && !fi.IsDir)
+ askMode = NExtract::NAskMode::kSkip;
+ return ExtractCallback->PrepareOperation(askMode);
+}
+
+HRESULT CFolderOutStream::CloseFile_and_SetResult(Int32 res)
+{
+ _stream.Release();
+ _fileIsOpen = false;
+
+ if (!_indexes)
+ _numFiles--;
+ else if (*_indexes == _fileIndex)
+ {
+ _indexes++;
+ _numFiles--;
+ }
+
+ _fileIndex++;
+ return ExtractCallback->SetOperationResult(res);
+}
+
+HRESULT CFolderOutStream::CloseFile()
+{
+ const CFileItem &fi = _db->Files[_fileIndex];
+ return CloseFile_and_SetResult((!_calcCrc || fi.Crc == CRC_GET_DIGEST(_crc)) ?
+ NExtract::NOperationResult::kOK :
+ NExtract::NOperationResult::kCRCError);
+}
+
+HRESULT CFolderOutStream::ProcessEmptyFiles()
+{
+ while (_numFiles != 0 && _db->Files[_fileIndex].Size == 0)
+ {
+ RINOK(OpenFile());
+ RINOK(CloseFile());
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CFolderOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ while (size != 0)
+ {
+ if (_fileIsOpen)
+ {
+ UInt32 cur = (size < _rem ? size : (UInt32)_rem);
+ if (_calcCrc)
+ {
+ const UInt32 k_Step = (UInt32)1 << 20;
+ if (cur > k_Step)
+ cur = k_Step;
+ }
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Write(data, cur, &cur);
+ if (_calcCrc)
+ _crc = CrcUpdate(_crc, data, cur);
+ if (processedSize)
+ *processedSize += cur;
+ data = (const Byte *)data + cur;
+ size -= cur;
+ _rem -= cur;
+ if (_rem == 0)
+ {
+ RINOK(CloseFile());
+ RINOK(ProcessEmptyFiles());
+ }
+ RINOK(result);
+ if (cur == 0)
+ break;
+ continue;
+ }
+
+ RINOK(ProcessEmptyFiles());
+ if (_numFiles == 0)
+ {
+ // we support partial extracting
+ /*
+ if (processedSize)
+ *processedSize += size;
+ break;
+ */
+ ExtraWriteWasCut = true;
+ // return S_FALSE;
+ return k_My_HRESULT_WritingWasCut;
+ }
+ RINOK(OpenFile());
+ }
+
+ return S_OK;
+}
+
+HRESULT CFolderOutStream::FlushCorrupted(Int32 callbackOperationResult)
+{
+ while (_numFiles != 0)
+ {
+ if (_fileIsOpen)
+ {
+ RINOK(CloseFile_and_SetResult(callbackOperationResult));
+ }
+ else
+ {
+ RINOK(OpenFile(true));
+ }
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
+ Int32 testModeSpec, IArchiveExtractCallback *extractCallbackSpec)
+{
+ COM_TRY_BEGIN
+
+ CMyComPtr<IArchiveExtractCallback> extractCallback = extractCallbackSpec;
+
+ UInt64 importantTotalUnpacked = 0;
+
+ // numItems = (UInt32)(Int32)-1;
+
+ bool allFilesMode = (numItems == (UInt32)(Int32)-1);
+ if (allFilesMode)
+ numItems = _db.Files.Size();
+
+ if (numItems == 0)
+ return S_OK;
+
+ {
+ CNum prevFolder = kNumNoIndex;
+ UInt32 nextFile = 0;
+
+ UInt32 i;
+
+ for (i = 0; i < numItems; i++)
+ {
+ UInt32 fileIndex = allFilesMode ? i : indices[i];
+ CNum folderIndex = _db.FileIndexToFolderIndexMap[fileIndex];
+ if (folderIndex == kNumNoIndex)
+ continue;
+ if (folderIndex != prevFolder || fileIndex < nextFile)
+ nextFile = _db.FolderStartFileIndex[folderIndex];
+ for (CNum index = nextFile; index <= fileIndex; index++)
+ importantTotalUnpacked += _db.Files[index].Size;
+ nextFile = fileIndex + 1;
+ prevFolder = folderIndex;
+ }
+ }
+
+ RINOK(extractCallback->SetTotal(importantTotalUnpacked));
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(extractCallback, false);
+
+ CDecoder decoder(
+ #if !defined(USE_MIXER_MT)
+ false
+ #elif !defined(USE_MIXER_ST)
+ true
+ #elif !defined(__7Z_SET_PROPERTIES)
+ #ifdef _7ZIP_ST
+ false
+ #else
+ true
+ #endif
+ #else
+ _useMultiThreadMixer
+ #endif
+ );
+
+ UInt64 curPacked, curUnpacked;
+
+ CMyComPtr<IArchiveExtractCallbackMessage> callbackMessage;
+ extractCallback.QueryInterface(IID_IArchiveExtractCallbackMessage, &callbackMessage);
+
+ CFolderOutStream *folderOutStream = new CFolderOutStream;
+ CMyComPtr<ISequentialOutStream> outStream(folderOutStream);
+
+ folderOutStream->_db = &_db;
+ folderOutStream->ExtractCallback = extractCallback;
+ folderOutStream->TestMode = (testModeSpec != 0);
+ folderOutStream->CheckCrc = (_crcSize != 0);
+
+ for (UInt32 i = 0;; lps->OutSize += curUnpacked, lps->InSize += curPacked)
+ {
+ RINOK(lps->SetCur());
+
+ if (i >= numItems)
+ break;
+
+ curUnpacked = 0;
+ curPacked = 0;
+
+ UInt32 fileIndex = allFilesMode ? i : indices[i];
+ CNum folderIndex = _db.FileIndexToFolderIndexMap[fileIndex];
+
+ UInt32 numSolidFiles = 1;
+
+ if (folderIndex != kNumNoIndex)
+ {
+ curPacked = _db.GetFolderFullPackSize(folderIndex);
+ UInt32 nextFile = fileIndex + 1;
+ fileIndex = _db.FolderStartFileIndex[folderIndex];
+ UInt32 k;
+
+ for (k = i + 1; k < numItems; k++)
+ {
+ UInt32 fileIndex2 = allFilesMode ? k : indices[k];
+ if (_db.FileIndexToFolderIndexMap[fileIndex2] != folderIndex
+ || fileIndex2 < nextFile)
+ break;
+ nextFile = fileIndex2 + 1;
+ }
+
+ numSolidFiles = k - i;
+
+ for (k = fileIndex; k < nextFile; k++)
+ curUnpacked += _db.Files[k].Size;
+ }
+
+ {
+ HRESULT result = folderOutStream->Init(fileIndex,
+ allFilesMode ? NULL : indices + i,
+ numSolidFiles);
+
+ i += numSolidFiles;
+
+ RINOK(result);
+ }
+
+ // to test solid block with zero unpacked size we disable that code
+ if (folderOutStream->WasWritingFinished())
+ continue;
+
+ #ifndef _NO_CRYPTO
+ CMyComPtr<ICryptoGetTextPassword> getTextPassword;
+ if (extractCallback)
+ extractCallback.QueryInterface(IID_ICryptoGetTextPassword, &getTextPassword);
+ #endif
+
+ try
+ {
+ #ifndef _NO_CRYPTO
+ bool isEncrypted = false;
+ bool passwordIsDefined = false;
+ UString password;
+ #endif
+
+
+ bool dataAfterEnd_Error = false;
+
+ HRESULT result = decoder.Decode(
+ EXTERNAL_CODECS_VARS
+ _inStream,
+ _db.ArcInfo.DataStartPosition,
+ _db, folderIndex,
+ &curUnpacked,
+
+ outStream,
+ progress,
+ NULL // *inStreamMainRes
+ , dataAfterEnd_Error
+
+ _7Z_DECODER_CRYPRO_VARS
+ #if !defined(_7ZIP_ST)
+ , true, _numThreads, _memUsage
+ #endif
+ );
+
+ if (result == S_FALSE || result == E_NOTIMPL || dataAfterEnd_Error)
+ {
+ bool wasFinished = folderOutStream->WasWritingFinished();
+
+ int resOp = NExtract::NOperationResult::kDataError;
+
+ if (result != S_FALSE)
+ {
+ if (result == E_NOTIMPL)
+ resOp = NExtract::NOperationResult::kUnsupportedMethod;
+ else if (wasFinished && dataAfterEnd_Error)
+ resOp = NExtract::NOperationResult::kDataAfterEnd;
+ }
+
+ RINOK(folderOutStream->FlushCorrupted(resOp));
+
+ if (wasFinished)
+ {
+ // we don't show error, if it's after required files
+ if (/* !folderOutStream->ExtraWriteWasCut && */ callbackMessage)
+ {
+ RINOK(callbackMessage->ReportExtractResult(NEventIndexType::kBlockIndex, folderIndex, resOp));
+ }
+ }
+ continue;
+ }
+
+ if (result != S_OK)
+ return result;
+
+ RINOK(folderOutStream->FlushCorrupted(NExtract::NOperationResult::kDataError));
+ continue;
+ }
+ catch(...)
+ {
+ RINOK(folderOutStream->FlushCorrupted(NExtract::NOperationResult::kDataError));
+ // continue;
+ return E_FAIL;
+ }
+ }
+
+ return S_OK;
+
+ COM_TRY_END
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.cpp
new file mode 100644
index 0000000000..eee11a0855
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.cpp
@@ -0,0 +1,139 @@
+// 7zFolderInStream.cpp
+
+#include "StdAfx.h"
+
+#include "7zFolderInStream.h"
+
+namespace NArchive {
+namespace N7z {
+
+void CFolderInStream::Init(IArchiveUpdateCallback *updateCallback,
+ const UInt32 *indexes, unsigned numFiles)
+{
+ _updateCallback = updateCallback;
+ _indexes = indexes;
+ _numFiles = numFiles;
+ _index = 0;
+
+ Processed.ClearAndReserve(numFiles);
+ CRCs.ClearAndReserve(numFiles);
+ Sizes.ClearAndReserve(numFiles);
+
+ _pos = 0;
+ _crc = CRC_INIT_VAL;
+ _size_Defined = false;
+ _size = 0;
+
+ _stream.Release();
+}
+
+HRESULT CFolderInStream::OpenStream()
+{
+ _pos = 0;
+ _crc = CRC_INIT_VAL;
+ _size_Defined = false;
+ _size = 0;
+
+ while (_index < _numFiles)
+ {
+ CMyComPtr<ISequentialInStream> stream;
+ HRESULT result = _updateCallback->GetStream(_indexes[_index], &stream);
+ if (result != S_OK)
+ {
+ if (result != S_FALSE)
+ return result;
+ }
+
+ _stream = stream;
+
+ if (stream)
+ {
+ CMyComPtr<IStreamGetSize> streamGetSize;
+ stream.QueryInterface(IID_IStreamGetSize, &streamGetSize);
+ if (streamGetSize)
+ {
+ if (streamGetSize->GetSize(&_size) == S_OK)
+ _size_Defined = true;
+ }
+ return S_OK;
+ }
+
+ _index++;
+ RINOK(_updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK));
+ AddFileInfo(result == S_OK);
+ }
+ return S_OK;
+}
+
+void CFolderInStream::AddFileInfo(bool isProcessed)
+{
+ Processed.Add(isProcessed);
+ Sizes.Add(_pos);
+ CRCs.Add(CRC_GET_DIGEST(_crc));
+}
+
+STDMETHODIMP CFolderInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ while (size != 0)
+ {
+ if (_stream)
+ {
+ UInt32 cur = size;
+ const UInt32 kMax = (UInt32)1 << 20;
+ if (cur > kMax)
+ cur = kMax;
+ RINOK(_stream->Read(data, cur, &cur));
+ if (cur != 0)
+ {
+ _crc = CrcUpdate(_crc, data, cur);
+ _pos += cur;
+ if (processedSize)
+ *processedSize = cur;
+ return S_OK;
+ }
+
+ _stream.Release();
+ _index++;
+ AddFileInfo(true);
+
+ _pos = 0;
+ _crc = CRC_INIT_VAL;
+ _size_Defined = false;
+ _size = 0;
+
+ RINOK(_updateCallback->SetOperationResult(NArchive::NUpdate::NOperationResult::kOK));
+ }
+
+ if (_index >= _numFiles)
+ break;
+ RINOK(OpenStream());
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CFolderInStream::GetSubStreamSize(UInt64 subStream, UInt64 *value)
+{
+ *value = 0;
+ if (subStream > Sizes.Size())
+ return S_FALSE; // E_FAIL;
+
+ unsigned index = (unsigned)subStream;
+ if (index < Sizes.Size())
+ {
+ *value = Sizes[index];
+ return S_OK;
+ }
+
+ if (!_size_Defined)
+ {
+ *value = _pos;
+ return S_FALSE;
+ }
+
+ *value = (_pos > _size ? _pos : _size);
+ return S_OK;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.h
new file mode 100644
index 0000000000..f2b1c599ae
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zFolderInStream.h
@@ -0,0 +1,61 @@
+// 7zFolderInStream.h
+
+#ifndef __7Z_FOLDER_IN_STREAM_H
+#define __7Z_FOLDER_IN_STREAM_H
+
+#include "../../../../C/7zCrc.h"
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/MyVector.h"
+
+#include "../../ICoder.h"
+#include "../IArchive.h"
+
+namespace NArchive {
+namespace N7z {
+
+class CFolderInStream:
+ public ISequentialInStream,
+ public ICompressGetSubStreamSize,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialInStream> _stream;
+ UInt64 _pos;
+ UInt32 _crc;
+ bool _size_Defined;
+ UInt64 _size;
+
+ const UInt32 *_indexes;
+ unsigned _numFiles;
+ unsigned _index;
+
+ CMyComPtr<IArchiveUpdateCallback> _updateCallback;
+
+ HRESULT OpenStream();
+ void AddFileInfo(bool isProcessed);
+
+public:
+ CRecordVector<bool> Processed;
+ CRecordVector<UInt32> CRCs;
+ CRecordVector<UInt64> Sizes;
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, ICompressGetSubStreamSize)
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
+
+ void Init(IArchiveUpdateCallback *updateCallback, const UInt32 *indexes, unsigned numFiles);
+
+ bool WasFinished() const { return _index == _numFiles; }
+
+ UInt64 GetFullSize() const
+ {
+ UInt64 size = 0;
+ FOR_VECTOR (i, Sizes)
+ size += Sizes[i];
+ return size;
+ }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.cpp
new file mode 100644
index 0000000000..a3b0bce1d7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.cpp
@@ -0,0 +1,756 @@
+// 7zHandler.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/CpuArch.h"
+
+#include "../../../Common/ComTry.h"
+#include "../../../Common/IntToString.h"
+
+#ifndef __7Z_SET_PROPERTIES
+#include "../../../Windows/System.h"
+#endif
+
+#include "../Common/ItemNameUtils.h"
+
+#include "7zHandler.h"
+#include "7zProperties.h"
+
+#ifdef __7Z_SET_PROPERTIES
+#ifdef EXTRACT_ONLY
+#include "../Common/ParseProperties.h"
+#endif
+#endif
+
+using namespace NWindows;
+using namespace NCOM;
+
+namespace NArchive {
+namespace N7z {
+
+CHandler::CHandler()
+{
+ #ifndef _NO_CRYPTO
+ _isEncrypted = false;
+ _passwordIsDefined = false;
+ #endif
+
+ #ifdef EXTRACT_ONLY
+
+ _crcSize = 4;
+
+ #ifdef __7Z_SET_PROPERTIES
+ _useMultiThreadMixer = true;
+ #endif
+
+ #endif
+}
+
+STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
+{
+ *numItems = _db.Files.Size();
+ return S_OK;
+}
+
+#ifdef _SFX
+
+IMP_IInArchive_ArcProps_NO_Table
+
+STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProps)
+{
+ *numProps = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetPropertyInfo(UInt32 /* index */,
+ BSTR * /* name */, PROPID * /* propID */, VARTYPE * /* varType */)
+{
+ return E_NOTIMPL;
+}
+
+#else
+
+static const Byte kArcProps[] =
+{
+ kpidHeadersSize,
+ kpidMethod,
+ kpidSolid,
+ kpidNumBlocks
+ // , kpidIsTree
+};
+
+IMP_IInArchive_ArcProps
+
+static inline char GetHex(unsigned value)
+{
+ return (char)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
+}
+
+static unsigned ConvertMethodIdToString_Back(char *s, UInt64 id)
+{
+ int len = 0;
+ do
+ {
+ s[--len] = GetHex((unsigned)id & 0xF); id >>= 4;
+ s[--len] = GetHex((unsigned)id & 0xF); id >>= 4;
+ }
+ while (id != 0);
+ return (unsigned)-len;
+}
+
+static void ConvertMethodIdToString(AString &res, UInt64 id)
+{
+ const unsigned kLen = 32;
+ char s[kLen];
+ unsigned len = kLen - 1;
+ s[len] = 0;
+ res += s + len - ConvertMethodIdToString_Back(s + len, id);
+}
+
+static unsigned GetStringForSizeValue(char *s, UInt32 val)
+{
+ unsigned i;
+ for (i = 0; i <= 31; i++)
+ if (((UInt32)1 << i) == val)
+ {
+ if (i < 10)
+ {
+ s[0] = (char)('0' + i);
+ s[1] = 0;
+ return 1;
+ }
+ if (i < 20) { s[0] = '1'; s[1] = (char)('0' + i - 10); }
+ else if (i < 30) { s[0] = '2'; s[1] = (char)('0' + i - 20); }
+ else { s[0] = '3'; s[1] = (char)('0' + i - 30); }
+ s[2] = 0;
+ return 2;
+ }
+ char c = 'b';
+ if ((val & ((1 << 20) - 1)) == 0) { val >>= 20; c = 'm'; }
+ else if ((val & ((1 << 10) - 1)) == 0) { val >>= 10; c = 'k'; }
+ ::ConvertUInt32ToString(val, s);
+ unsigned pos = MyStringLen(s);
+ s[pos++] = c;
+ s[pos] = 0;
+ return pos;
+}
+
+/*
+static inline void AddHexToString(UString &res, Byte value)
+{
+ res += GetHex((Byte)(value >> 4));
+ res += GetHex((Byte)(value & 0xF));
+}
+*/
+
+static char *AddProp32(char *s, const char *name, UInt32 v)
+{
+ *s++ = ':';
+ s = MyStpCpy(s, name);
+ ::ConvertUInt32ToString(v, s);
+ return s + MyStringLen(s);
+}
+
+void CHandler::AddMethodName(AString &s, UInt64 id)
+{
+ AString name;
+ FindMethod(EXTERNAL_CODECS_VARS id, name);
+ if (name.IsEmpty())
+ ConvertMethodIdToString(s, id);
+ else
+ s += name;
+}
+
+#endif
+
+STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
+{
+ #ifndef _SFX
+ COM_TRY_BEGIN
+ #endif
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ #ifndef _SFX
+ case kpidMethod:
+ {
+ AString s;
+ const CParsedMethods &pm = _db.ParsedMethods;
+ FOR_VECTOR (i, pm.IDs)
+ {
+ UInt64 id = pm.IDs[i];
+ s.Add_Space_if_NotEmpty();
+ char temp[16];
+ if (id == k_LZMA2)
+ {
+ s += "LZMA2:";
+ if ((pm.Lzma2Prop & 1) == 0)
+ ConvertUInt32ToString((pm.Lzma2Prop >> 1) + 12, temp);
+ else
+ GetStringForSizeValue(temp, 3 << ((pm.Lzma2Prop >> 1) + 11));
+ s += temp;
+ }
+ else if (id == k_LZMA)
+ {
+ s += "LZMA:";
+ GetStringForSizeValue(temp, pm.LzmaDic);
+ s += temp;
+ }
+ else
+ AddMethodName(s, id);
+ }
+ prop = s;
+ break;
+ }
+ case kpidSolid: prop = _db.IsSolid(); break;
+ case kpidNumBlocks: prop = (UInt32)_db.NumFolders; break;
+ case kpidHeadersSize: prop = _db.HeadersSize; break;
+ case kpidPhySize: prop = _db.PhySize; break;
+ case kpidOffset: if (_db.ArcInfo.StartPosition != 0) prop = _db.ArcInfo.StartPosition; break;
+ /*
+ case kpidIsTree: if (_db.IsTree) prop = true; break;
+ case kpidIsAltStream: if (_db.ThereAreAltStreams) prop = true; break;
+ case kpidIsAux: if (_db.IsTree) prop = true; break;
+ */
+ // case kpidError: if (_db.ThereIsHeaderError) prop = "Header error"; break;
+ #endif
+
+ case kpidWarningFlags:
+ {
+ UInt32 v = 0;
+ if (_db.StartHeaderWasRecovered) v |= kpv_ErrorFlags_HeadersError;
+ if (_db.UnsupportedFeatureWarning) v |= kpv_ErrorFlags_UnsupportedFeature;
+ if (v != 0)
+ prop = v;
+ break;
+ }
+
+ case kpidErrorFlags:
+ {
+ UInt32 v = 0;
+ if (!_db.IsArc) v |= kpv_ErrorFlags_IsNotArc;
+ if (_db.ThereIsHeaderError) v |= kpv_ErrorFlags_HeadersError;
+ if (_db.UnexpectedEnd) v |= kpv_ErrorFlags_UnexpectedEnd;
+ // if (_db.UnsupportedVersion) v |= kpv_ErrorFlags_Unsupported;
+ if (_db.UnsupportedFeatureError) v |= kpv_ErrorFlags_UnsupportedFeature;
+ prop = v;
+ break;
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+ #ifndef _SFX
+ COM_TRY_END
+ #endif
+}
+
+static void SetFileTimeProp_From_UInt64Def(PROPVARIANT *prop, const CUInt64DefVector &v, int index)
+{
+ UInt64 value;
+ if (v.GetItem(index, value))
+ PropVarEm_Set_FileTime64(prop, value);
+}
+
+bool CHandler::IsFolderEncrypted(CNum folderIndex) const
+{
+ if (folderIndex == kNumNoIndex)
+ return false;
+ size_t startPos = _db.FoCodersDataOffset[folderIndex];
+ const Byte *p = _db.CodersData + startPos;
+ size_t size = _db.FoCodersDataOffset[folderIndex + 1] - startPos;
+ CInByte2 inByte;
+ inByte.Init(p, size);
+
+ CNum numCoders = inByte.ReadNum();
+ for (; numCoders != 0; numCoders--)
+ {
+ Byte mainByte = inByte.ReadByte();
+ unsigned idSize = (mainByte & 0xF);
+ const Byte *longID = inByte.GetPtr();
+ UInt64 id64 = 0;
+ for (unsigned j = 0; j < idSize; j++)
+ id64 = ((id64 << 8) | longID[j]);
+ inByte.SkipDataNoCheck(idSize);
+ if (id64 == k_AES)
+ return true;
+ if ((mainByte & 0x20) != 0)
+ inByte.SkipDataNoCheck(inByte.ReadNum());
+ }
+ return false;
+}
+
+STDMETHODIMP CHandler::GetNumRawProps(UInt32 *numProps)
+{
+ *numProps = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetRawPropInfo(UInt32 /* index */, BSTR *name, PROPID *propID)
+{
+ *name = NULL;
+ *propID = kpidNtSecure;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetParent(UInt32 /* index */, UInt32 *parent, UInt32 *parentType)
+{
+ /*
+ const CFileItem &file = _db.Files[index];
+ *parentType = (file.IsAltStream ? NParentType::kAltStream : NParentType::kDir);
+ *parent = (UInt32)(Int32)file.Parent;
+ */
+ *parentType = NParentType::kDir;
+ *parent = (UInt32)(Int32)-1;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetRawProp(UInt32 index, PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType)
+{
+ *data = NULL;
+ *dataSize = 0;
+ *propType = 0;
+
+ if (/* _db.IsTree && propID == kpidName ||
+ !_db.IsTree && */ propID == kpidPath)
+ {
+ if (_db.NameOffsets && _db.NamesBuf)
+ {
+ size_t offset = _db.NameOffsets[index];
+ size_t size = (_db.NameOffsets[index + 1] - offset) * 2;
+ if (size < ((UInt32)1 << 31))
+ {
+ *data = (const void *)(_db.NamesBuf + offset * 2);
+ *dataSize = (UInt32)size;
+ *propType = NPropDataType::kUtf16z;
+ }
+ }
+ return S_OK;
+ }
+ /*
+ if (propID == kpidNtSecure)
+ {
+ if (index < (UInt32)_db.SecureIDs.Size())
+ {
+ int id = _db.SecureIDs[index];
+ size_t offs = _db.SecureOffsets[id];
+ size_t size = _db.SecureOffsets[id + 1] - offs;
+ if (size >= 0)
+ {
+ *data = _db.SecureBuf + offs;
+ *dataSize = (UInt32)size;
+ *propType = NPropDataType::kRaw;
+ }
+ }
+ }
+ */
+ return S_OK;
+}
+
+#ifndef _SFX
+
+HRESULT CHandler::SetMethodToProp(CNum folderIndex, PROPVARIANT *prop) const
+{
+ PropVariant_Clear(prop);
+ if (folderIndex == kNumNoIndex)
+ return S_OK;
+ // for (int ttt = 0; ttt < 1; ttt++) {
+ const unsigned kTempSize = 256;
+ char temp[kTempSize];
+ unsigned pos = kTempSize;
+ temp[--pos] = 0;
+
+ size_t startPos = _db.FoCodersDataOffset[folderIndex];
+ const Byte *p = _db.CodersData + startPos;
+ size_t size = _db.FoCodersDataOffset[folderIndex + 1] - startPos;
+ CInByte2 inByte;
+ inByte.Init(p, size);
+
+ // numCoders == 0 ???
+ CNum numCoders = inByte.ReadNum();
+ bool needSpace = false;
+
+ for (; numCoders != 0; numCoders--, needSpace = true)
+ {
+ if (pos < 32) // max size of property
+ break;
+ Byte mainByte = inByte.ReadByte();
+ unsigned idSize = (mainByte & 0xF);
+ const Byte *longID = inByte.GetPtr();
+ UInt64 id64 = 0;
+ for (unsigned j = 0; j < idSize; j++)
+ id64 = ((id64 << 8) | longID[j]);
+ inByte.SkipDataNoCheck(idSize);
+
+ if ((mainByte & 0x10) != 0)
+ {
+ inByte.ReadNum(); // NumInStreams
+ inByte.ReadNum(); // NumOutStreams
+ }
+
+ CNum propsSize = 0;
+ const Byte *props = NULL;
+ if ((mainByte & 0x20) != 0)
+ {
+ propsSize = inByte.ReadNum();
+ props = inByte.GetPtr();
+ inByte.SkipDataNoCheck(propsSize);
+ }
+
+ const char *name = NULL;
+ char s[32];
+ s[0] = 0;
+
+ if (id64 <= (UInt32)0xFFFFFFFF)
+ {
+ UInt32 id = (UInt32)id64;
+ if (id == k_LZMA)
+ {
+ name = "LZMA";
+ if (propsSize == 5)
+ {
+ UInt32 dicSize = GetUi32((const Byte *)props + 1);
+ char *dest = s + GetStringForSizeValue(s, dicSize);
+ UInt32 d = props[0];
+ if (d != 0x5D)
+ {
+ UInt32 lc = d % 9;
+ d /= 9;
+ UInt32 pb = d / 5;
+ UInt32 lp = d % 5;
+ if (lc != 3) dest = AddProp32(dest, "lc", lc);
+ if (lp != 0) dest = AddProp32(dest, "lp", lp);
+ if (pb != 2) dest = AddProp32(dest, "pb", pb);
+ }
+ }
+ }
+ else if (id == k_LZMA2)
+ {
+ name = "LZMA2";
+ if (propsSize == 1)
+ {
+ Byte d = props[0];
+ if ((d & 1) == 0)
+ ConvertUInt32ToString((UInt32)((d >> 1) + 12), s);
+ else
+ GetStringForSizeValue(s, 3 << ((d >> 1) + 11));
+ }
+ }
+ else if (id == k_PPMD)
+ {
+ name = "PPMD";
+ if (propsSize == 5)
+ {
+ Byte order = *props;
+ char *dest = s;
+ *dest++ = 'o';
+ ConvertUInt32ToString(order, dest);
+ dest += MyStringLen(dest);
+ dest = MyStpCpy(dest, ":mem");
+ GetStringForSizeValue(dest, GetUi32(props + 1));
+ }
+ }
+ else if (id == k_Delta)
+ {
+ name = "Delta";
+ if (propsSize == 1)
+ ConvertUInt32ToString((UInt32)props[0] + 1, s);
+ }
+ else if (id == k_BCJ2) name = "BCJ2";
+ else if (id == k_BCJ) name = "BCJ";
+ else if (id == k_AES)
+ {
+ name = "7zAES";
+ if (propsSize >= 1)
+ {
+ Byte firstByte = props[0];
+ UInt32 numCyclesPower = firstByte & 0x3F;
+ ConvertUInt32ToString(numCyclesPower, s);
+ }
+ }
+ }
+
+ if (name)
+ {
+ unsigned nameLen = MyStringLen(name);
+ unsigned propsLen = MyStringLen(s);
+ unsigned totalLen = nameLen + propsLen;
+ if (propsLen != 0)
+ totalLen++;
+ if (needSpace)
+ totalLen++;
+ if (totalLen + 5 >= pos)
+ break;
+ pos -= totalLen;
+ MyStringCopy(temp + pos, name);
+ if (propsLen != 0)
+ {
+ char *dest = temp + pos + nameLen;
+ *dest++ = ':';
+ MyStringCopy(dest, s);
+ }
+ if (needSpace)
+ temp[pos + totalLen - 1] = ' ';
+ }
+ else
+ {
+ AString methodName;
+ FindMethod(EXTERNAL_CODECS_VARS id64, methodName);
+ if (needSpace)
+ temp[--pos] = ' ';
+ if (methodName.IsEmpty())
+ pos -= ConvertMethodIdToString_Back(temp + pos, id64);
+ else
+ {
+ unsigned len = methodName.Len();
+ if (len + 5 > pos)
+ break;
+ pos -= len;
+ for (unsigned i = 0; i < len; i++)
+ temp[pos + i] = methodName[i];
+ }
+ }
+ }
+
+ if (numCoders != 0 && pos >= 4)
+ {
+ temp[--pos] = ' ';
+ temp[--pos] = '.';
+ temp[--pos] = '.';
+ temp[--pos] = '.';
+ }
+
+ return PropVarEm_Set_Str(prop, temp + pos);
+ // }
+}
+
+#endif
+
+STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ PropVariant_Clear(value);
+ // COM_TRY_BEGIN
+ // NCOM::CPropVariant prop;
+
+ /*
+ const CRef2 &ref2 = _refs[index];
+ if (ref2.Refs.IsEmpty())
+ return E_FAIL;
+ const CRef &ref = ref2.Refs.Front();
+ */
+
+ const CFileItem &item = _db.Files[index];
+ const UInt32 index2 = index;
+
+ switch (propID)
+ {
+ case kpidIsDir: PropVarEm_Set_Bool(value, item.IsDir); break;
+ case kpidSize:
+ {
+ PropVarEm_Set_UInt64(value, item.Size);
+ // prop = ref2.Size;
+ break;
+ }
+ case kpidPackSize:
+ {
+ // prop = ref2.PackSize;
+ {
+ CNum folderIndex = _db.FileIndexToFolderIndexMap[index2];
+ if (folderIndex != kNumNoIndex)
+ {
+ if (_db.FolderStartFileIndex[folderIndex] == (CNum)index2)
+ PropVarEm_Set_UInt64(value, _db.GetFolderFullPackSize(folderIndex));
+ /*
+ else
+ PropVarEm_Set_UInt64(value, 0);
+ */
+ }
+ else
+ PropVarEm_Set_UInt64(value, 0);
+ }
+ break;
+ }
+ // case kpidIsAux: prop = _db.IsItemAux(index2); break;
+ case kpidPosition: { UInt64 v; if (_db.StartPos.GetItem(index2, v)) PropVarEm_Set_UInt64(value, v); break; }
+ case kpidCTime: SetFileTimeProp_From_UInt64Def(value, _db.CTime, index2); break;
+ case kpidATime: SetFileTimeProp_From_UInt64Def(value, _db.ATime, index2); break;
+ case kpidMTime: SetFileTimeProp_From_UInt64Def(value, _db.MTime, index2); break;
+ case kpidAttrib: if (_db.Attrib.ValidAndDefined(index2)) PropVarEm_Set_UInt32(value, _db.Attrib.Vals[index2]); break;
+ case kpidCRC: if (item.CrcDefined) PropVarEm_Set_UInt32(value, item.Crc); break;
+ case kpidEncrypted: PropVarEm_Set_Bool(value, IsFolderEncrypted(_db.FileIndexToFolderIndexMap[index2])); break;
+ case kpidIsAnti: PropVarEm_Set_Bool(value, _db.IsItemAnti(index2)); break;
+ /*
+ case kpidIsAltStream: prop = item.IsAltStream; break;
+ case kpidNtSecure:
+ {
+ int id = _db.SecureIDs[index];
+ size_t offs = _db.SecureOffsets[id];
+ size_t size = _db.SecureOffsets[id + 1] - offs;
+ if (size >= 0)
+ {
+ prop.SetBlob(_db.SecureBuf + offs, (ULONG)size);
+ }
+ break;
+ }
+ */
+
+ case kpidPath: return _db.GetPath_Prop(index, value);
+
+ #ifndef _SFX
+
+ case kpidMethod: return SetMethodToProp(_db.FileIndexToFolderIndexMap[index2], value);
+ case kpidBlock:
+ {
+ CNum folderIndex = _db.FileIndexToFolderIndexMap[index2];
+ if (folderIndex != kNumNoIndex)
+ PropVarEm_Set_UInt32(value, (UInt32)folderIndex);
+ }
+ break;
+ /*
+ case kpidPackedSize0:
+ case kpidPackedSize1:
+ case kpidPackedSize2:
+ case kpidPackedSize3:
+ case kpidPackedSize4:
+ {
+ CNum folderIndex = _db.FileIndexToFolderIndexMap[index2];
+ if (folderIndex != kNumNoIndex)
+ {
+ if (_db.FolderStartFileIndex[folderIndex] == (CNum)index2 &&
+ _db.FoStartPackStreamIndex[folderIndex + 1] -
+ _db.FoStartPackStreamIndex[folderIndex] > (propID - kpidPackedSize0))
+ {
+ PropVarEm_Set_UInt64(value, _db.GetFolderPackStreamSize(folderIndex, propID - kpidPackedSize0));
+ }
+ }
+ else
+ PropVarEm_Set_UInt64(value, 0);
+ }
+ break;
+ */
+
+ #endif
+ }
+ // prop.Detach(value);
+ return S_OK;
+ // COM_TRY_END
+}
+
+STDMETHODIMP CHandler::Open(IInStream *stream,
+ const UInt64 *maxCheckStartPosition,
+ IArchiveOpenCallback *openArchiveCallback)
+{
+ COM_TRY_BEGIN
+ Close();
+ #ifndef _SFX
+ _fileInfoPopIDs.Clear();
+ #endif
+
+ try
+ {
+ CMyComPtr<IArchiveOpenCallback> openArchiveCallbackTemp = openArchiveCallback;
+
+ #ifndef _NO_CRYPTO
+ CMyComPtr<ICryptoGetTextPassword> getTextPassword;
+ if (openArchiveCallback)
+ openArchiveCallbackTemp.QueryInterface(IID_ICryptoGetTextPassword, &getTextPassword);
+ #endif
+
+ CInArchive archive(
+ #ifdef __7Z_SET_PROPERTIES
+ _useMultiThreadMixer
+ #else
+ true
+ #endif
+ );
+ _db.IsArc = false;
+ RINOK(archive.Open(stream, maxCheckStartPosition));
+ _db.IsArc = true;
+
+ HRESULT result = archive.ReadDatabase(
+ EXTERNAL_CODECS_VARS
+ _db
+ #ifndef _NO_CRYPTO
+ , getTextPassword, _isEncrypted, _passwordIsDefined, _password
+ #endif
+ );
+ RINOK(result);
+
+ _inStream = stream;
+ }
+ catch(...)
+ {
+ Close();
+ // return E_INVALIDARG;
+ // return S_FALSE;
+ // we must return out_of_memory here
+ return E_OUTOFMEMORY;
+ }
+ // _inStream = stream;
+ #ifndef _SFX
+ FillPopIDs();
+ #endif
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CHandler::Close()
+{
+ COM_TRY_BEGIN
+ _inStream.Release();
+ _db.Clear();
+ #ifndef _NO_CRYPTO
+ _isEncrypted = false;
+ _passwordIsDefined = false;
+ _password.Empty();
+ #endif
+ return S_OK;
+ COM_TRY_END
+}
+
+#ifdef __7Z_SET_PROPERTIES
+#ifdef EXTRACT_ONLY
+
+STDMETHODIMP CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps)
+{
+ COM_TRY_BEGIN
+
+ InitCommon();
+ _useMultiThreadMixer = true;
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ UString name = names[i];
+ name.MakeLower_Ascii();
+ if (name.IsEmpty())
+ return E_INVALIDARG;
+ const PROPVARIANT &value = values[i];
+ UInt32 number;
+ unsigned index = ParseStringToUInt32(name, number);
+ if (index == 0)
+ {
+ if (name.IsEqualTo("mtf"))
+ {
+ RINOK(PROPVARIANT_to_bool(value, _useMultiThreadMixer));
+ continue;
+ }
+ {
+ HRESULT hres;
+ if (SetCommonProperty(name, value, hres))
+ {
+ RINOK(hres);
+ continue;
+ }
+ }
+ return E_INVALIDARG;
+ }
+ }
+ return S_OK;
+ COM_TRY_END
+}
+
+#endif
+#endif
+
+IMPL_ISetCompressCodecsInfo
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.h
new file mode 100644
index 0000000000..7d5a5f0099
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandler.h
@@ -0,0 +1,181 @@
+// 7z/Handler.h
+
+#ifndef __7Z_HANDLER_H
+#define __7Z_HANDLER_H
+
+#include "../../ICoder.h"
+#include "../IArchive.h"
+
+#include "../../Common/CreateCoder.h"
+
+#ifndef __7Z_SET_PROPERTIES
+
+#ifdef EXTRACT_ONLY
+ #if !defined(_7ZIP_ST) && !defined(_SFX)
+ #define __7Z_SET_PROPERTIES
+ #endif
+#else
+ #define __7Z_SET_PROPERTIES
+#endif
+
+#endif
+
+// #ifdef __7Z_SET_PROPERTIES
+#include "../Common/HandlerOut.h"
+// #endif
+
+#include "7zCompressionMode.h"
+#include "7zIn.h"
+
+namespace NArchive {
+namespace N7z {
+
+
+#ifndef EXTRACT_ONLY
+
+class COutHandler: public CMultiMethodProps
+{
+ HRESULT SetSolidFromString(const UString &s);
+ HRESULT SetSolidFromPROPVARIANT(const PROPVARIANT &value);
+public:
+ UInt64 _numSolidFiles;
+ UInt64 _numSolidBytes;
+ bool _numSolidBytesDefined;
+ bool _solidExtension;
+ bool _useTypeSorting;
+
+ bool _compressHeaders;
+ bool _encryptHeadersSpecified;
+ bool _encryptHeaders;
+ // bool _useParents; 9.26
+
+ CBoolPair Write_CTime;
+ CBoolPair Write_ATime;
+ CBoolPair Write_MTime;
+ CBoolPair Write_Attrib;
+
+ bool _useMultiThreadMixer;
+
+ bool _removeSfxBlock;
+
+ // bool _volumeMode;
+
+ void InitSolidFiles() { _numSolidFiles = (UInt64)(Int64)(-1); }
+ void InitSolidSize() { _numSolidBytes = (UInt64)(Int64)(-1); }
+ void InitSolid()
+ {
+ InitSolidFiles();
+ InitSolidSize();
+ _solidExtension = false;
+ _numSolidBytesDefined = false;
+ }
+
+ void InitProps7z();
+ void InitProps();
+
+ COutHandler() { InitProps7z(); }
+
+ HRESULT SetProperty(const wchar_t *name, const PROPVARIANT &value);
+};
+
+#endif
+
+class CHandler:
+ public IInArchive,
+ public IArchiveGetRawProps,
+
+ #ifdef __7Z_SET_PROPERTIES
+ public ISetProperties,
+ #endif
+
+ #ifndef EXTRACT_ONLY
+ public IOutArchive,
+ #endif
+
+ PUBLIC_ISetCompressCodecsInfo
+
+ public CMyUnknownImp,
+
+ #ifndef EXTRACT_ONLY
+ public COutHandler
+ #else
+ public CCommonMethodProps
+ #endif
+{
+public:
+ MY_QUERYINTERFACE_BEGIN2(IInArchive)
+ MY_QUERYINTERFACE_ENTRY(IArchiveGetRawProps)
+ #ifdef __7Z_SET_PROPERTIES
+ MY_QUERYINTERFACE_ENTRY(ISetProperties)
+ #endif
+ #ifndef EXTRACT_ONLY
+ MY_QUERYINTERFACE_ENTRY(IOutArchive)
+ #endif
+ QUERY_ENTRY_ISetCompressCodecsInfo
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ INTERFACE_IInArchive(;)
+ INTERFACE_IArchiveGetRawProps(;)
+
+ #ifdef __7Z_SET_PROPERTIES
+ STDMETHOD(SetProperties)(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps);
+ #endif
+
+ #ifndef EXTRACT_ONLY
+ INTERFACE_IOutArchive(;)
+ #endif
+
+ DECL_ISetCompressCodecsInfo
+
+ CHandler();
+
+private:
+ CMyComPtr<IInStream> _inStream;
+ NArchive::N7z::CDbEx _db;
+
+ #ifndef _NO_CRYPTO
+ bool _isEncrypted;
+ bool _passwordIsDefined;
+ UString _password;
+ #endif
+
+ #ifdef EXTRACT_ONLY
+
+ #ifdef __7Z_SET_PROPERTIES
+ bool _useMultiThreadMixer;
+ #endif
+
+ UInt32 _crcSize;
+
+ #else
+
+ CRecordVector<CBond2> _bonds;
+
+ HRESULT PropsMethod_To_FullMethod(CMethodFull &dest, const COneMethodInfo &m);
+ HRESULT SetHeaderMethod(CCompressionMethodMode &headerMethod);
+ HRESULT SetMainMethod(CCompressionMethodMode &method
+ #ifndef _7ZIP_ST
+ , UInt32 numThreads
+ #endif
+ );
+
+
+ #endif
+
+ bool IsFolderEncrypted(CNum folderIndex) const;
+ #ifndef _SFX
+
+ CRecordVector<UInt64> _fileInfoPopIDs;
+ void FillPopIDs();
+ void AddMethodName(AString &s, UInt64 id);
+ HRESULT SetMethodToProp(CNum folderIndex, PROPVARIANT *prop) const;
+
+ #endif
+
+ DECL_EXTERNAL_CODECS_VARS
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandlerOut.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandlerOut.cpp
new file mode 100644
index 0000000000..f0474bbfe8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHandlerOut.cpp
@@ -0,0 +1,939 @@
+// 7zHandlerOut.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/ComTry.h"
+#include "../../../Common/StringToInt.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../Common/ItemNameUtils.h"
+#include "../Common/ParseProperties.h"
+
+#include "7zHandler.h"
+#include "7zOut.h"
+#include "7zUpdate.h"
+
+#ifndef EXTRACT_ONLY
+
+using namespace NWindows;
+
+namespace NArchive {
+namespace N7z {
+
+#define k_LZMA_Name "LZMA"
+#define kDefaultMethodName "LZMA2"
+#define k_Copy_Name "Copy"
+
+#define k_MatchFinder_ForHeaders "BT2"
+
+static const UInt32 k_NumFastBytes_ForHeaders = 273;
+static const UInt32 k_Level_ForHeaders = 5;
+static const UInt32 k_Dictionary_ForHeaders =
+ #ifdef UNDER_CE
+ 1 << 18;
+ #else
+ 1 << 20;
+ #endif
+
+STDMETHODIMP CHandler::GetFileTimeType(UInt32 *type)
+{
+ *type = NFileTimeType::kWindows;
+ return S_OK;
+}
+
+HRESULT CHandler::PropsMethod_To_FullMethod(CMethodFull &dest, const COneMethodInfo &m)
+{
+ dest.CodecIndex = FindMethod_Index(
+ EXTERNAL_CODECS_VARS
+ m.MethodName, true,
+ dest.Id, dest.NumStreams);
+ if (dest.CodecIndex < 0)
+ return E_INVALIDARG;
+ (CProps &)dest = (CProps &)m;
+ return S_OK;
+}
+
+HRESULT CHandler::SetHeaderMethod(CCompressionMethodMode &headerMethod)
+{
+ if (!_compressHeaders)
+ return S_OK;
+ COneMethodInfo m;
+ m.MethodName = k_LZMA_Name;
+ m.AddProp_Ascii(NCoderPropID::kMatchFinder, k_MatchFinder_ForHeaders);
+ m.AddProp_Level(k_Level_ForHeaders);
+ m.AddProp32(NCoderPropID::kNumFastBytes, k_NumFastBytes_ForHeaders);
+ m.AddProp32(NCoderPropID::kDictionarySize, k_Dictionary_ForHeaders);
+ m.AddProp_NumThreads(1);
+
+ CMethodFull &methodFull = headerMethod.Methods.AddNew();
+ return PropsMethod_To_FullMethod(methodFull, m);
+}
+
+HRESULT CHandler::SetMainMethod(
+ CCompressionMethodMode &methodMode
+ #ifndef _7ZIP_ST
+ , UInt32 numThreads
+ #endif
+ )
+{
+ methodMode.Bonds = _bonds;
+
+ CObjectVector<COneMethodInfo> methods = _methods;
+
+ {
+ FOR_VECTOR (i, methods)
+ {
+ AString &methodName = methods[i].MethodName;
+ if (methodName.IsEmpty())
+ methodName = kDefaultMethodName;
+ }
+ if (methods.IsEmpty())
+ {
+ COneMethodInfo &m = methods.AddNew();
+ m.MethodName = (GetLevel() == 0 ? k_Copy_Name : kDefaultMethodName);
+ methodMode.DefaultMethod_was_Inserted = true;
+ }
+ }
+
+ if (!_filterMethod.MethodName.IsEmpty())
+ {
+ // if (methodMode.Bonds.IsEmpty())
+ {
+ FOR_VECTOR (k, methodMode.Bonds)
+ {
+ CBond2 &bond = methodMode.Bonds[k];
+ bond.InCoder++;
+ bond.OutCoder++;
+ }
+ methods.Insert(0, _filterMethod);
+ methodMode.Filter_was_Inserted = true;
+ }
+ }
+
+ const UInt64 kSolidBytes_Min = (1 << 24);
+ const UInt64 kSolidBytes_Max = ((UInt64)1 << 32) - 1;
+
+ bool needSolid = false;
+
+ FOR_VECTOR (i, methods)
+ {
+ COneMethodInfo &oneMethodInfo = methods[i];
+
+ SetGlobalLevelTo(oneMethodInfo);
+ #ifndef _7ZIP_ST
+ CMultiMethodProps::SetMethodThreadsTo(oneMethodInfo, numThreads);
+ #endif
+
+ CMethodFull &methodFull = methodMode.Methods.AddNew();
+ RINOK(PropsMethod_To_FullMethod(methodFull, oneMethodInfo));
+
+ if (methodFull.Id != k_Copy)
+ needSolid = true;
+
+ if (_numSolidBytesDefined)
+ continue;
+
+ UInt32 dicSize;
+ switch (methodFull.Id)
+ {
+ case k_LZMA:
+ case k_LZMA2: dicSize = oneMethodInfo.Get_Lzma_DicSize(); break;
+ case k_PPMD: dicSize = oneMethodInfo.Get_Ppmd_MemSize(); break;
+ case k_Deflate: dicSize = (UInt32)1 << 15; break;
+ case k_BZip2: dicSize = oneMethodInfo.Get_BZip2_BlockSize(); break;
+ default: continue;
+ }
+
+ _numSolidBytes = (UInt64)dicSize << 7;
+ if (_numSolidBytes < kSolidBytes_Min) _numSolidBytes = kSolidBytes_Min;
+ if (_numSolidBytes > kSolidBytes_Max) _numSolidBytes = kSolidBytes_Max;
+ _numSolidBytesDefined = true;
+ }
+
+ if (!_numSolidBytesDefined)
+ if (needSolid)
+ _numSolidBytes = kSolidBytes_Max;
+ else
+ _numSolidBytes = 0;
+ _numSolidBytesDefined = true;
+ return S_OK;
+}
+
+static HRESULT GetTime(IArchiveUpdateCallback *updateCallback, int index, PROPID propID, UInt64 &ft, bool &ftDefined)
+{
+ // ft = 0;
+ // ftDefined = false;
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(index, propID, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ ft = prop.filetime.dwLowDateTime | ((UInt64)prop.filetime.dwHighDateTime << 32);
+ ftDefined = true;
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_INVALIDARG;
+ else
+ {
+ ft = 0;
+ ftDefined = false;
+ }
+ return S_OK;
+}
+
+/*
+
+#ifdef _WIN32
+static const wchar_t kDirDelimiter1 = L'\\';
+#endif
+static const wchar_t kDirDelimiter2 = L'/';
+
+static inline bool IsCharDirLimiter(wchar_t c)
+{
+ return (
+ #ifdef _WIN32
+ c == kDirDelimiter1 ||
+ #endif
+ c == kDirDelimiter2);
+}
+
+static int FillSortIndex(CObjectVector<CTreeFolder> &treeFolders, int cur, int curSortIndex)
+{
+ CTreeFolder &tf = treeFolders[cur];
+ tf.SortIndex = curSortIndex++;
+ for (int i = 0; i < tf.SubFolders.Size(); i++)
+ curSortIndex = FillSortIndex(treeFolders, tf.SubFolders[i], curSortIndex);
+ tf.SortIndexEnd = curSortIndex;
+ return curSortIndex;
+}
+
+static int FindSubFolder(const CObjectVector<CTreeFolder> &treeFolders, int cur, const UString &name, int &insertPos)
+{
+ const CIntVector &subFolders = treeFolders[cur].SubFolders;
+ int left = 0, right = subFolders.Size();
+ insertPos = -1;
+ for (;;)
+ {
+ if (left == right)
+ {
+ insertPos = left;
+ return -1;
+ }
+ int mid = (left + right) / 2;
+ int midFolder = subFolders[mid];
+ int compare = CompareFileNames(name, treeFolders[midFolder].Name);
+ if (compare == 0)
+ return midFolder;
+ if (compare < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+}
+
+static int AddFolder(CObjectVector<CTreeFolder> &treeFolders, int cur, const UString &name)
+{
+ int insertPos;
+ int folderIndex = FindSubFolder(treeFolders, cur, name, insertPos);
+ if (folderIndex < 0)
+ {
+ folderIndex = treeFolders.Size();
+ CTreeFolder &newFolder = treeFolders.AddNew();
+ newFolder.Parent = cur;
+ newFolder.Name = name;
+ treeFolders[cur].SubFolders.Insert(insertPos, folderIndex);
+ }
+ // else if (treeFolders[folderIndex].IsAltStreamFolder != isAltStreamFolder) throw 1123234234;
+ return folderIndex;
+}
+*/
+
+STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numItems,
+ IArchiveUpdateCallback *updateCallback)
+{
+ COM_TRY_BEGIN
+
+ const CDbEx *db = 0;
+ #ifdef _7Z_VOL
+ if (_volumes.Size() > 1)
+ return E_FAIL;
+ const CVolume *volume = 0;
+ if (_volumes.Size() == 1)
+ {
+ volume = &_volumes.Front();
+ db = &volume->Database;
+ }
+ #else
+ if (_inStream != 0)
+ db = &_db;
+ #endif
+
+ /*
+ CMyComPtr<IArchiveGetRawProps> getRawProps;
+ updateCallback->QueryInterface(IID_IArchiveGetRawProps, (void **)&getRawProps);
+
+ CUniqBlocks secureBlocks;
+ secureBlocks.AddUniq(NULL, 0);
+
+ CObjectVector<CTreeFolder> treeFolders;
+ {
+ CTreeFolder folder;
+ folder.Parent = -1;
+ treeFolders.Add(folder);
+ }
+ */
+
+ CObjectVector<CUpdateItem> updateItems;
+
+ bool need_CTime = (Write_CTime.Def && Write_CTime.Val);
+ bool need_ATime = (Write_ATime.Def && Write_ATime.Val);
+ bool need_MTime = (Write_MTime.Def && Write_MTime.Val || !Write_MTime.Def);
+ bool need_Attrib = (Write_Attrib.Def && Write_Attrib.Val || !Write_Attrib.Def);
+
+ if (db && !db->Files.IsEmpty())
+ {
+ if (!Write_CTime.Def) need_CTime = !db->CTime.Defs.IsEmpty();
+ if (!Write_ATime.Def) need_ATime = !db->ATime.Defs.IsEmpty();
+ if (!Write_MTime.Def) need_MTime = !db->MTime.Defs.IsEmpty();
+ if (!Write_Attrib.Def) need_Attrib = !db->Attrib.Defs.IsEmpty();
+ }
+
+ // UString s;
+ UString name;
+
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ Int32 newData, newProps;
+ UInt32 indexInArchive;
+ if (!updateCallback)
+ return E_FAIL;
+ RINOK(updateCallback->GetUpdateItemInfo(i, &newData, &newProps, &indexInArchive));
+ CUpdateItem ui;
+ ui.NewProps = IntToBool(newProps);
+ ui.NewData = IntToBool(newData);
+ ui.IndexInArchive = indexInArchive;
+ ui.IndexInClient = i;
+ ui.IsAnti = false;
+ ui.Size = 0;
+
+ name.Empty();
+ // bool isAltStream = false;
+ if (ui.IndexInArchive != -1)
+ {
+ if (db == 0 || (unsigned)ui.IndexInArchive >= db->Files.Size())
+ return E_INVALIDARG;
+ const CFileItem &fi = db->Files[ui.IndexInArchive];
+ if (!ui.NewProps)
+ {
+ _db.GetPath(ui.IndexInArchive, name);
+ }
+ ui.IsDir = fi.IsDir;
+ ui.Size = fi.Size;
+ // isAltStream = fi.IsAltStream;
+ ui.IsAnti = db->IsItemAnti(ui.IndexInArchive);
+
+ if (!ui.NewProps)
+ {
+ ui.CTimeDefined = db->CTime.GetItem(ui.IndexInArchive, ui.CTime);
+ ui.ATimeDefined = db->ATime.GetItem(ui.IndexInArchive, ui.ATime);
+ ui.MTimeDefined = db->MTime.GetItem(ui.IndexInArchive, ui.MTime);
+ }
+ }
+
+ if (ui.NewProps)
+ {
+ bool folderStatusIsDefined;
+ if (need_Attrib)
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(i, kpidAttrib, &prop));
+ if (prop.vt == VT_EMPTY)
+ ui.AttribDefined = false;
+ else if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ else
+ {
+ ui.Attrib = prop.ulVal;
+ ui.AttribDefined = true;
+ }
+ }
+
+ // we need MTime to sort files.
+ if (need_CTime) RINOK(GetTime(updateCallback, i, kpidCTime, ui.CTime, ui.CTimeDefined));
+ if (need_ATime) RINOK(GetTime(updateCallback, i, kpidATime, ui.ATime, ui.ATimeDefined));
+ if (need_MTime) RINOK(GetTime(updateCallback, i, kpidMTime, ui.MTime, ui.MTimeDefined));
+
+ /*
+ if (getRawProps)
+ {
+ const void *data;
+ UInt32 dataSize;
+ UInt32 propType;
+
+ getRawProps->GetRawProp(i, kpidNtSecure, &data, &dataSize, &propType);
+ if (dataSize != 0 && propType != NPropDataType::kRaw)
+ return E_FAIL;
+ ui.SecureIndex = secureBlocks.AddUniq((const Byte *)data, dataSize);
+ }
+ */
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(i, kpidPath, &prop));
+ if (prop.vt == VT_EMPTY)
+ {
+ }
+ else if (prop.vt != VT_BSTR)
+ return E_INVALIDARG;
+ else
+ {
+ name = prop.bstrVal;
+ NItemName::ReplaceSlashes_OsToUnix(name);
+ }
+ }
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(i, kpidIsDir, &prop));
+ if (prop.vt == VT_EMPTY)
+ folderStatusIsDefined = false;
+ else if (prop.vt != VT_BOOL)
+ return E_INVALIDARG;
+ else
+ {
+ ui.IsDir = (prop.boolVal != VARIANT_FALSE);
+ folderStatusIsDefined = true;
+ }
+ }
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(i, kpidIsAnti, &prop));
+ if (prop.vt == VT_EMPTY)
+ ui.IsAnti = false;
+ else if (prop.vt != VT_BOOL)
+ return E_INVALIDARG;
+ else
+ ui.IsAnti = (prop.boolVal != VARIANT_FALSE);
+ }
+
+ /*
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(i, kpidIsAltStream, &prop));
+ if (prop.vt == VT_EMPTY)
+ isAltStream = false;
+ else if (prop.vt != VT_BOOL)
+ return E_INVALIDARG;
+ else
+ isAltStream = (prop.boolVal != VARIANT_FALSE);
+ }
+ */
+
+ if (ui.IsAnti)
+ {
+ ui.AttribDefined = false;
+
+ ui.CTimeDefined = false;
+ ui.ATimeDefined = false;
+ ui.MTimeDefined = false;
+
+ ui.Size = 0;
+ }
+
+ if (!folderStatusIsDefined && ui.AttribDefined)
+ ui.SetDirStatusFromAttrib();
+ }
+ else
+ {
+ /*
+ if (_db.SecureIDs.IsEmpty())
+ ui.SecureIndex = secureBlocks.AddUniq(NULL, 0);
+ else
+ {
+ int id = _db.SecureIDs[ui.IndexInArchive];
+ size_t offs = _db.SecureOffsets[id];
+ size_t size = _db.SecureOffsets[id + 1] - offs;
+ ui.SecureIndex = secureBlocks.AddUniq(_db.SecureBuf + offs, size);
+ }
+ */
+ }
+
+ /*
+ {
+ int folderIndex = 0;
+ if (_useParents)
+ {
+ int j;
+ s.Empty();
+ for (j = 0; j < name.Len(); j++)
+ {
+ wchar_t c = name[j];
+ if (IsCharDirLimiter(c))
+ {
+ folderIndex = AddFolder(treeFolders, folderIndex, s);
+ s.Empty();
+ continue;
+ }
+ s += c;
+ }
+ if (isAltStream)
+ {
+ int colonPos = s.Find(':');
+ if (colonPos < 0)
+ {
+ // isAltStream = false;
+ return E_INVALIDARG;
+ }
+ UString mainName = s.Left(colonPos);
+ int newFolderIndex = AddFolder(treeFolders, folderIndex, mainName);
+ if (treeFolders[newFolderIndex].UpdateItemIndex < 0)
+ {
+ for (int j = updateItems.Size() - 1; j >= 0; j--)
+ {
+ CUpdateItem &ui2 = updateItems[j];
+ if (ui2.ParentFolderIndex == folderIndex
+ && ui2.Name == mainName)
+ {
+ ui2.TreeFolderIndex = newFolderIndex;
+ treeFolders[newFolderIndex].UpdateItemIndex = j;
+ }
+ }
+ }
+ folderIndex = newFolderIndex;
+ s.Delete(0, colonPos + 1);
+ }
+ ui.Name = s;
+ }
+ else
+ ui.Name = name;
+ ui.IsAltStream = isAltStream;
+ ui.ParentFolderIndex = folderIndex;
+ ui.TreeFolderIndex = -1;
+ if (ui.IsDir && !s.IsEmpty())
+ {
+ ui.TreeFolderIndex = AddFolder(treeFolders, folderIndex, s);
+ treeFolders[ui.TreeFolderIndex].UpdateItemIndex = updateItems.Size();
+ }
+ }
+ */
+ ui.Name = name;
+
+ if (ui.NewData)
+ {
+ ui.Size = 0;
+ if (!ui.IsDir)
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(i, kpidSize, &prop));
+ if (prop.vt != VT_UI8)
+ return E_INVALIDARG;
+ ui.Size = (UInt64)prop.uhVal.QuadPart;
+ if (ui.Size != 0 && ui.IsAnti)
+ return E_INVALIDARG;
+ }
+ }
+
+ updateItems.Add(ui);
+ }
+
+ /*
+ FillSortIndex(treeFolders, 0, 0);
+ for (i = 0; i < (UInt32)updateItems.Size(); i++)
+ {
+ CUpdateItem &ui = updateItems[i];
+ ui.ParentSortIndex = treeFolders[ui.ParentFolderIndex].SortIndex;
+ ui.ParentSortIndexEnd = treeFolders[ui.ParentFolderIndex].SortIndexEnd;
+ }
+ */
+
+ CCompressionMethodMode methodMode, headerMethod;
+
+ HRESULT res = SetMainMethod(methodMode
+ #ifndef _7ZIP_ST
+ , _numThreads
+ #endif
+ );
+ RINOK(res);
+
+ RINOK(SetHeaderMethod(headerMethod));
+
+ #ifndef _7ZIP_ST
+ methodMode.NumThreads = _numThreads;
+ methodMode.MultiThreadMixer = _useMultiThreadMixer;
+ headerMethod.NumThreads = 1;
+ headerMethod.MultiThreadMixer = _useMultiThreadMixer;
+ #endif
+
+ CMyComPtr<ICryptoGetTextPassword2> getPassword2;
+ updateCallback->QueryInterface(IID_ICryptoGetTextPassword2, (void **)&getPassword2);
+
+ methodMode.PasswordIsDefined = false;
+ methodMode.Password.Empty();
+ if (getPassword2)
+ {
+ CMyComBSTR password;
+ Int32 passwordIsDefined;
+ RINOK(getPassword2->CryptoGetTextPassword2(&passwordIsDefined, &password));
+ methodMode.PasswordIsDefined = IntToBool(passwordIsDefined);
+ if (methodMode.PasswordIsDefined && password)
+ methodMode.Password = password;
+ }
+
+ bool compressMainHeader = _compressHeaders; // check it
+
+ bool encryptHeaders = false;
+
+ #ifndef _NO_CRYPTO
+ if (!methodMode.PasswordIsDefined && _passwordIsDefined)
+ {
+ // if header is compressed, we use that password for updated archive
+ methodMode.PasswordIsDefined = true;
+ methodMode.Password = _password;
+ }
+ #endif
+
+ if (methodMode.PasswordIsDefined)
+ {
+ if (_encryptHeadersSpecified)
+ encryptHeaders = _encryptHeaders;
+ #ifndef _NO_CRYPTO
+ else
+ encryptHeaders = _passwordIsDefined;
+ #endif
+ compressMainHeader = true;
+ if (encryptHeaders)
+ {
+ headerMethod.PasswordIsDefined = methodMode.PasswordIsDefined;
+ headerMethod.Password = methodMode.Password;
+ }
+ }
+
+ if (numItems < 2)
+ compressMainHeader = false;
+
+ int level = GetLevel();
+
+ CUpdateOptions options;
+ options.Method = &methodMode;
+ options.HeaderMethod = (_compressHeaders || encryptHeaders) ? &headerMethod : NULL;
+ options.UseFilters = (level != 0 && _autoFilter && !methodMode.Filter_was_Inserted);
+ options.MaxFilter = (level >= 8);
+ options.AnalysisLevel = GetAnalysisLevel();
+
+ options.HeaderOptions.CompressMainHeader = compressMainHeader;
+ /*
+ options.HeaderOptions.WriteCTime = Write_CTime;
+ options.HeaderOptions.WriteATime = Write_ATime;
+ options.HeaderOptions.WriteMTime = Write_MTime;
+ options.HeaderOptions.WriteAttrib = Write_Attrib;
+ */
+
+ options.NumSolidFiles = _numSolidFiles;
+ options.NumSolidBytes = _numSolidBytes;
+ options.SolidExtension = _solidExtension;
+ options.UseTypeSorting = _useTypeSorting;
+
+ options.RemoveSfxBlock = _removeSfxBlock;
+ // options.VolumeMode = _volumeMode;
+
+ options.MultiThreadMixer = _useMultiThreadMixer;
+
+ COutArchive archive;
+ CArchiveDatabaseOut newDatabase;
+
+ CMyComPtr<ICryptoGetTextPassword> getPassword;
+ updateCallback->QueryInterface(IID_ICryptoGetTextPassword, (void **)&getPassword);
+
+ /*
+ if (secureBlocks.Sorted.Size() > 1)
+ {
+ secureBlocks.GetReverseMap();
+ for (int i = 0; i < updateItems.Size(); i++)
+ {
+ int &secureIndex = updateItems[i].SecureIndex;
+ secureIndex = secureBlocks.BufIndexToSortedIndex[secureIndex];
+ }
+ }
+ */
+
+ res = Update(
+ EXTERNAL_CODECS_VARS
+ #ifdef _7Z_VOL
+ volume ? volume->Stream: 0,
+ volume ? db : 0,
+ #else
+ _inStream,
+ db,
+ #endif
+ updateItems,
+ // treeFolders,
+ // secureBlocks,
+ archive, newDatabase, outStream, updateCallback, options
+ #ifndef _NO_CRYPTO
+ , getPassword
+ #endif
+ );
+
+ RINOK(res);
+
+ updateItems.ClearAndFree();
+
+ return archive.WriteDatabase(EXTERNAL_CODECS_VARS
+ newDatabase, options.HeaderMethod, options.HeaderOptions);
+
+ COM_TRY_END
+}
+
+static HRESULT ParseBond(UString &srcString, UInt32 &coder, UInt32 &stream)
+{
+ stream = 0;
+ {
+ unsigned index = ParseStringToUInt32(srcString, coder);
+ if (index == 0)
+ return E_INVALIDARG;
+ srcString.DeleteFrontal(index);
+ }
+ if (srcString[0] == 's')
+ {
+ srcString.Delete(0);
+ unsigned index = ParseStringToUInt32(srcString, stream);
+ if (index == 0)
+ return E_INVALIDARG;
+ srcString.DeleteFrontal(index);
+ }
+ return S_OK;
+}
+
+void COutHandler::InitProps7z()
+{
+ _removeSfxBlock = false;
+ _compressHeaders = true;
+ _encryptHeadersSpecified = false;
+ _encryptHeaders = false;
+ // _useParents = false;
+
+ Write_CTime.Init();
+ Write_ATime.Init();
+ Write_MTime.Init();
+ Write_Attrib.Init();
+
+ _useMultiThreadMixer = true;
+
+ // _volumeMode = false;
+
+ InitSolid();
+ _useTypeSorting = false;
+}
+
+void COutHandler::InitProps()
+{
+ CMultiMethodProps::Init();
+ InitProps7z();
+}
+
+
+
+HRESULT COutHandler::SetSolidFromString(const UString &s)
+{
+ UString s2 = s;
+ s2.MakeLower_Ascii();
+ for (unsigned i = 0; i < s2.Len();)
+ {
+ const wchar_t *start = ((const wchar_t *)s2) + i;
+ const wchar_t *end;
+ UInt64 v = ConvertStringToUInt64(start, &end);
+ if (start == end)
+ {
+ if (s2[i++] != 'e')
+ return E_INVALIDARG;
+ _solidExtension = true;
+ continue;
+ }
+ i += (int)(end - start);
+ if (i == s2.Len())
+ return E_INVALIDARG;
+ wchar_t c = s2[i++];
+ if (c == 'f')
+ {
+ if (v < 1)
+ v = 1;
+ _numSolidFiles = v;
+ }
+ else
+ {
+ unsigned numBits;
+ switch (c)
+ {
+ case 'b': numBits = 0; break;
+ case 'k': numBits = 10; break;
+ case 'm': numBits = 20; break;
+ case 'g': numBits = 30; break;
+ case 't': numBits = 40; break;
+ default: return E_INVALIDARG;
+ }
+ _numSolidBytes = (v << numBits);
+ _numSolidBytesDefined = true;
+ /*
+ if (_numSolidBytes == 0)
+ _numSolidFiles = 1;
+ */
+ }
+ }
+ return S_OK;
+}
+
+HRESULT COutHandler::SetSolidFromPROPVARIANT(const PROPVARIANT &value)
+{
+ bool isSolid;
+ switch (value.vt)
+ {
+ case VT_EMPTY: isSolid = true; break;
+ case VT_BOOL: isSolid = (value.boolVal != VARIANT_FALSE); break;
+ case VT_BSTR:
+ if (StringToBool(value.bstrVal, isSolid))
+ break;
+ return SetSolidFromString(value.bstrVal);
+ default: return E_INVALIDARG;
+ }
+ if (isSolid)
+ InitSolid();
+ else
+ _numSolidFiles = 1;
+ return S_OK;
+}
+
+static HRESULT PROPVARIANT_to_BoolPair(const PROPVARIANT &prop, CBoolPair &dest)
+{
+ RINOK(PROPVARIANT_to_bool(prop, dest.Val));
+ dest.Def = true;
+ return S_OK;
+}
+
+HRESULT COutHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &value)
+{
+ UString name = nameSpec;
+ name.MakeLower_Ascii();
+ if (name.IsEmpty())
+ return E_INVALIDARG;
+
+ if (name[0] == L's')
+ {
+ name.Delete(0);
+ if (name.IsEmpty())
+ return SetSolidFromPROPVARIANT(value);
+ if (value.vt != VT_EMPTY)
+ return E_INVALIDARG;
+ return SetSolidFromString(name);
+ }
+
+ UInt32 number;
+ int index = ParseStringToUInt32(name, number);
+ // UString realName = name.Ptr(index);
+ if (index == 0)
+ {
+ if (name.IsEqualTo("rsfx")) return PROPVARIANT_to_bool(value, _removeSfxBlock);
+ if (name.IsEqualTo("hc")) return PROPVARIANT_to_bool(value, _compressHeaders);
+ // if (name.IsEqualToNoCase(L"HS")) return PROPVARIANT_to_bool(value, _useParents);
+
+ if (name.IsEqualTo("hcf"))
+ {
+ bool compressHeadersFull = true;
+ RINOK(PROPVARIANT_to_bool(value, compressHeadersFull));
+ return compressHeadersFull ? S_OK: E_INVALIDARG;
+ }
+
+ if (name.IsEqualTo("he"))
+ {
+ RINOK(PROPVARIANT_to_bool(value, _encryptHeaders));
+ _encryptHeadersSpecified = true;
+ return S_OK;
+ }
+
+ if (name.IsEqualTo("tc")) return PROPVARIANT_to_BoolPair(value, Write_CTime);
+ if (name.IsEqualTo("ta")) return PROPVARIANT_to_BoolPair(value, Write_ATime);
+ if (name.IsEqualTo("tm")) return PROPVARIANT_to_BoolPair(value, Write_MTime);
+
+ if (name.IsEqualTo("tr")) return PROPVARIANT_to_BoolPair(value, Write_Attrib);
+
+ if (name.IsEqualTo("mtf")) return PROPVARIANT_to_bool(value, _useMultiThreadMixer);
+
+ if (name.IsEqualTo("qs")) return PROPVARIANT_to_bool(value, _useTypeSorting);
+
+ // if (name.IsEqualTo("v")) return PROPVARIANT_to_bool(value, _volumeMode);
+ }
+ return CMultiMethodProps::SetProperty(name, value);
+}
+
+STDMETHODIMP CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps)
+{
+ COM_TRY_BEGIN
+ _bonds.Clear();
+ InitProps();
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ UString name = names[i];
+ name.MakeLower_Ascii();
+ if (name.IsEmpty())
+ return E_INVALIDARG;
+
+ const PROPVARIANT &value = values[i];
+
+ if (name[0] == 'b')
+ {
+ if (value.vt != VT_EMPTY)
+ return E_INVALIDARG;
+ name.Delete(0);
+
+ CBond2 bond;
+ RINOK(ParseBond(name, bond.OutCoder, bond.OutStream));
+ if (name[0] != ':')
+ return E_INVALIDARG;
+ name.Delete(0);
+ UInt32 inStream = 0;
+ RINOK(ParseBond(name, bond.InCoder, inStream));
+ if (inStream != 0)
+ return E_INVALIDARG;
+ if (!name.IsEmpty())
+ return E_INVALIDARG;
+ _bonds.Add(bond);
+ continue;
+ }
+
+ RINOK(SetProperty(name, value));
+ }
+
+ unsigned numEmptyMethods = GetNumEmptyMethods();
+ if (numEmptyMethods > 0)
+ {
+ unsigned k;
+ for (k = 0; k < _bonds.Size(); k++)
+ {
+ const CBond2 &bond = _bonds[k];
+ if (bond.InCoder < (UInt32)numEmptyMethods ||
+ bond.OutCoder < (UInt32)numEmptyMethods)
+ return E_INVALIDARG;
+ }
+ for (k = 0; k < _bonds.Size(); k++)
+ {
+ CBond2 &bond = _bonds[k];
+ bond.InCoder -= (UInt32)numEmptyMethods;
+ bond.OutCoder -= (UInt32)numEmptyMethods;
+ }
+ _methods.DeleteFrontal(numEmptyMethods);
+ }
+
+ FOR_VECTOR (k, _bonds)
+ {
+ const CBond2 &bond = _bonds[k];
+ if (bond.InCoder >= (UInt32)_methods.Size() ||
+ bond.OutCoder >= (UInt32)_methods.Size())
+ return E_INVALIDARG;
+ }
+
+ return S_OK;
+ COM_TRY_END
+}
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.cpp
new file mode 100644
index 0000000000..de3990961b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.cpp
@@ -0,0 +1,19 @@
+// 7zHeader.cpp
+
+#include "StdAfx.h"
+
+#include "7zHeader.h"
+
+namespace NArchive {
+namespace N7z {
+
+Byte kSignature[kSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
+#ifdef _7Z_VOL
+Byte kFinishSignature[kSignatureSize] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C + 1};
+#endif
+
+// We can change signature. So file doesn't contain correct signature.
+// struct SignatureInitializer { SignatureInitializer() { kSignature[0]--; } };
+// static SignatureInitializer g_SignatureInitializer;
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.h
new file mode 100644
index 0000000000..7de6eee85d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zHeader.h
@@ -0,0 +1,148 @@
+// 7z/7zHeader.h
+
+#ifndef __7Z_HEADER_H
+#define __7Z_HEADER_H
+
+#include "../../../Common/MyTypes.h"
+
+namespace NArchive {
+namespace N7z {
+
+const unsigned kSignatureSize = 6;
+extern Byte kSignature[kSignatureSize];
+
+// #define _7Z_VOL
+// 7z-MultiVolume is not finished yet.
+// It can work already, but I still do not like some
+// things of that new multivolume format.
+// So please keep it commented.
+
+#ifdef _7Z_VOL
+extern Byte kFinishSignature[kSignatureSize];
+#endif
+
+struct CArchiveVersion
+{
+ Byte Major;
+ Byte Minor;
+};
+
+const Byte kMajorVersion = 0;
+
+struct CStartHeader
+{
+ UInt64 NextHeaderOffset;
+ UInt64 NextHeaderSize;
+ UInt32 NextHeaderCRC;
+};
+
+const UInt32 kStartHeaderSize = 20;
+
+#ifdef _7Z_VOL
+struct CFinishHeader: public CStartHeader
+{
+ UInt64 ArchiveStartOffset; // data offset from end if that struct
+ UInt64 AdditionalStartBlockSize; // start signature & start header size
+};
+
+const UInt32 kFinishHeaderSize = kStartHeaderSize + 16;
+#endif
+
+namespace NID
+{
+ enum EEnum
+ {
+ kEnd,
+
+ kHeader,
+
+ kArchiveProperties,
+
+ kAdditionalStreamsInfo,
+ kMainStreamsInfo,
+ kFilesInfo,
+
+ kPackInfo,
+ kUnpackInfo,
+ kSubStreamsInfo,
+
+ kSize,
+ kCRC,
+
+ kFolder,
+
+ kCodersUnpackSize,
+ kNumUnpackStream,
+
+ kEmptyStream,
+ kEmptyFile,
+ kAnti,
+
+ kName,
+ kCTime,
+ kATime,
+ kMTime,
+ kWinAttrib,
+ kComment,
+
+ kEncodedHeader,
+
+ kStartPos,
+ kDummy
+
+ // kNtSecure,
+ // kParent,
+ // kIsAux
+ };
+}
+
+
+const UInt32 k_Copy = 0;
+const UInt32 k_Delta = 3;
+
+const UInt32 k_LZMA2 = 0x21;
+
+const UInt32 k_SWAP2 = 0x20302;
+const UInt32 k_SWAP4 = 0x20304;
+
+const UInt32 k_LZMA = 0x30101;
+const UInt32 k_PPMD = 0x30401;
+
+const UInt32 k_Deflate = 0x40108;
+const UInt32 k_BZip2 = 0x40202;
+
+const UInt32 k_BCJ = 0x3030103;
+const UInt32 k_BCJ2 = 0x303011B;
+const UInt32 k_PPC = 0x3030205;
+const UInt32 k_IA64 = 0x3030401;
+const UInt32 k_ARM = 0x3030501;
+const UInt32 k_ARMT = 0x3030701;
+const UInt32 k_SPARC = 0x3030805;
+
+const UInt32 k_AES = 0x6F10701;
+
+
+static inline bool IsFilterMethod(UInt64 m)
+{
+ if (m > (UInt64)0xFFFFFFFF)
+ return false;
+ switch ((UInt32)m)
+ {
+ case k_Delta:
+ case k_BCJ:
+ case k_BCJ2:
+ case k_PPC:
+ case k_IA64:
+ case k_ARM:
+ case k_ARMT:
+ case k_SPARC:
+ case k_SWAP2:
+ case k_SWAP4:
+ return true;
+ }
+ return false;
+}
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.cpp
new file mode 100644
index 0000000000..bbc77b0351
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.cpp
@@ -0,0 +1,1663 @@
+// 7zIn.cpp
+
+#include "StdAfx.h"
+
+#ifdef _WIN32
+#include <wchar.h>
+#else
+#include <ctype.h>
+#endif
+
+#include "../../../../C/7zCrc.h"
+#include "../../../../C/CpuArch.h"
+
+#include "../../Common/StreamObjects.h"
+#include "../../Common/StreamUtils.h"
+
+#include "7zDecode.h"
+#include "7zIn.h"
+
+#define Get16(p) GetUi16(p)
+#define Get32(p) GetUi32(p)
+#define Get64(p) GetUi64(p)
+
+// define FORMAT_7Z_RECOVERY if you want to recover multivolume archives with empty StartHeader
+#ifndef _SFX
+#define FORMAT_7Z_RECOVERY
+#endif
+
+using namespace NWindows;
+using namespace NCOM;
+
+namespace NArchive {
+namespace N7z {
+
+unsigned BoolVector_CountSum(const CBoolVector &v)
+{
+ unsigned sum = 0;
+ const unsigned size = v.Size();
+ for (unsigned i = 0; i < size; i++)
+ if (v[i])
+ sum++;
+ return sum;
+}
+
+static inline bool BoolVector_Item_IsValidAndTrue(const CBoolVector &v, unsigned i)
+{
+ return (i < v.Size() ? v[i] : false);
+}
+
+static void BoolVector_Fill_False(CBoolVector &v, unsigned size)
+{
+ v.ClearAndSetSize(size);
+ bool *p = &v[0];
+ for (unsigned i = 0; i < size; i++)
+ p[i] = false;
+}
+
+
+class CInArchiveException {};
+class CUnsupportedFeatureException: public CInArchiveException {};
+
+static void ThrowException() { throw CInArchiveException(); }
+static inline void ThrowEndOfData() { ThrowException(); }
+static inline void ThrowUnsupported() { throw CUnsupportedFeatureException(); }
+static inline void ThrowIncorrect() { ThrowException(); }
+
+class CStreamSwitch
+{
+ CInArchive *_archive;
+ bool _needRemove;
+ bool _needUpdatePos;
+public:
+ CStreamSwitch(): _needRemove(false), _needUpdatePos(false) {}
+ ~CStreamSwitch() { Remove(); }
+ void Remove();
+ void Set(CInArchive *archive, const Byte *data, size_t size, bool needUpdatePos);
+ void Set(CInArchive *archive, const CByteBuffer &byteBuffer);
+ void Set(CInArchive *archive, const CObjectVector<CByteBuffer> *dataVector);
+};
+
+void CStreamSwitch::Remove()
+{
+ if (_needRemove)
+ {
+ if (_archive->_inByteBack->GetRem() != 0)
+ _archive->ThereIsHeaderError = true;
+ _archive->DeleteByteStream(_needUpdatePos);
+ _needRemove = false;
+ }
+}
+
+void CStreamSwitch::Set(CInArchive *archive, const Byte *data, size_t size, bool needUpdatePos)
+{
+ Remove();
+ _archive = archive;
+ _archive->AddByteStream(data, size);
+ _needRemove = true;
+ _needUpdatePos = needUpdatePos;
+}
+
+void CStreamSwitch::Set(CInArchive *archive, const CByteBuffer &byteBuffer)
+{
+ Set(archive, byteBuffer, byteBuffer.Size(), false);
+}
+
+void CStreamSwitch::Set(CInArchive *archive, const CObjectVector<CByteBuffer> *dataVector)
+{
+ Remove();
+ Byte external = archive->ReadByte();
+ if (external != 0)
+ {
+ if (!dataVector)
+ ThrowIncorrect();
+ CNum dataIndex = archive->ReadNum();
+ if (dataIndex >= dataVector->Size())
+ ThrowIncorrect();
+ Set(archive, (*dataVector)[dataIndex]);
+ }
+}
+
+void CInArchive::AddByteStream(const Byte *buf, size_t size)
+{
+ if (_numInByteBufs == kNumBufLevelsMax)
+ ThrowIncorrect();
+ _inByteBack = &_inByteVector[_numInByteBufs++];
+ _inByteBack->Init(buf, size);
+}
+
+
+Byte CInByte2::ReadByte()
+{
+ if (_pos >= _size)
+ ThrowEndOfData();
+ return _buffer[_pos++];
+}
+
+void CInByte2::ReadBytes(Byte *data, size_t size)
+{
+ if (size == 0)
+ return;
+ if (size > _size - _pos)
+ ThrowEndOfData();
+ memcpy(data, _buffer + _pos, size);
+ _pos += size;
+}
+
+void CInByte2::SkipData(UInt64 size)
+{
+ if (size > _size - _pos)
+ ThrowEndOfData();
+ _pos += (size_t)size;
+}
+
+void CInByte2::SkipData()
+{
+ SkipData(ReadNumber());
+}
+
+static UInt64 ReadNumberSpec(const Byte *p, size_t size, size_t &processed)
+{
+ if (size == 0)
+ {
+ processed = 0;
+ return 0;
+ }
+
+ unsigned b = *p++;
+ size--;
+
+ if ((b & 0x80) == 0)
+ {
+ processed = 1;
+ return b;
+ }
+
+ if (size == 0)
+ {
+ processed = 0;
+ return 0;
+ }
+
+ UInt64 value = (UInt64)*p;
+ p++;
+ size--;
+
+ for (unsigned i = 1; i < 8; i++)
+ {
+ unsigned mask = (unsigned)0x80 >> i;
+ if ((b & mask) == 0)
+ {
+ UInt64 high = b & (mask - 1);
+ value |= (high << (i * 8));
+ processed = i + 1;
+ return value;
+ }
+
+ if (size == 0)
+ {
+ processed = 0;
+ return 0;
+ }
+
+ value |= ((UInt64)*p << (i * 8));
+ p++;
+ size--;
+ }
+
+ processed = 9;
+ return value;
+}
+
+UInt64 CInByte2::ReadNumber()
+{
+ size_t processed;
+ UInt64 res = ReadNumberSpec(_buffer + _pos, _size - _pos, processed);
+ if (processed == 0)
+ ThrowEndOfData();
+ _pos += processed;
+ return res;
+}
+
+CNum CInByte2::ReadNum()
+{
+ /*
+ if (_pos < _size)
+ {
+ Byte val = _buffer[_pos];
+ if ((unsigned)val < 0x80)
+ {
+ _pos++;
+ return (unsigned)val;
+ }
+ }
+ */
+ UInt64 value = ReadNumber();
+ if (value > kNumMax)
+ ThrowUnsupported();
+ return (CNum)value;
+}
+
+UInt32 CInByte2::ReadUInt32()
+{
+ if (_pos + 4 > _size)
+ ThrowEndOfData();
+ UInt32 res = Get32(_buffer + _pos);
+ _pos += 4;
+ return res;
+}
+
+UInt64 CInByte2::ReadUInt64()
+{
+ if (_pos + 8 > _size)
+ ThrowEndOfData();
+ UInt64 res = Get64(_buffer + _pos);
+ _pos += 8;
+ return res;
+}
+
+#define CHECK_SIGNATURE if (p[0] != '7' || p[1] != 'z' || p[2] != 0xBC || p[3] != 0xAF || p[4] != 0x27 || p[5] != 0x1C) return false;
+
+static inline bool TestSignature(const Byte *p)
+{
+ CHECK_SIGNATURE
+ return CrcCalc(p + 12, 20) == Get32(p + 8);
+}
+
+#ifdef FORMAT_7Z_RECOVERY
+static inline bool TestSignature2(const Byte *p)
+{
+ CHECK_SIGNATURE;
+ if (CrcCalc(p + 12, 20) == Get32(p + 8))
+ return true;
+ for (unsigned i = 8; i < kHeaderSize; i++)
+ if (p[i] != 0)
+ return false;
+ return (p[6] != 0 || p[7] != 0);
+}
+#else
+#define TestSignature2(p) TestSignature(p)
+#endif
+
+HRESULT CInArchive::FindAndReadSignature(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+{
+ RINOK(ReadStream_FALSE(stream, _header, kHeaderSize));
+
+ if (TestSignature2(_header))
+ return S_OK;
+ if (searchHeaderSizeLimit && *searchHeaderSizeLimit == 0)
+ return S_FALSE;
+
+ const UInt32 kBufSize = 1 << 15;
+ CByteArr buf(kBufSize);
+ memcpy(buf, _header, kHeaderSize);
+ UInt64 offset = 0;
+
+ for (;;)
+ {
+ UInt32 readSize = kBufSize - kHeaderSize;
+ if (searchHeaderSizeLimit)
+ {
+ UInt64 rem = *searchHeaderSizeLimit - offset;
+ if (readSize > rem)
+ readSize = (UInt32)rem;
+ if (readSize == 0)
+ return S_FALSE;
+ }
+
+ UInt32 processed = 0;
+ RINOK(stream->Read(buf + kHeaderSize, readSize, &processed));
+ if (processed == 0)
+ return S_FALSE;
+
+ for (UInt32 pos = 0;;)
+ {
+ const Byte *p = buf + pos + 1;
+ const Byte *lim = buf + processed;
+ for (; p <= lim; p += 4)
+ {
+ if (p[0] == '7') break;
+ if (p[1] == '7') { p += 1; break; }
+ if (p[2] == '7') { p += 2; break; }
+ if (p[3] == '7') { p += 3; break; }
+ };
+ if (p > lim)
+ break;
+ pos = (UInt32)(p - buf);
+ if (TestSignature(p))
+ {
+ memcpy(_header, p, kHeaderSize);
+ _arhiveBeginStreamPosition += offset + pos;
+ return stream->Seek(_arhiveBeginStreamPosition + kHeaderSize, STREAM_SEEK_SET, NULL);
+ }
+ }
+
+ offset += processed;
+ memmove(buf, buf + processed, kHeaderSize);
+ }
+}
+
+// S_FALSE means that file is not archive
+HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+{
+ HeadersSize = 0;
+ Close();
+ RINOK(stream->Seek(0, STREAM_SEEK_CUR, &_arhiveBeginStreamPosition))
+ RINOK(stream->Seek(0, STREAM_SEEK_END, &_fileEndPosition))
+ RINOK(stream->Seek(_arhiveBeginStreamPosition, STREAM_SEEK_SET, NULL))
+ RINOK(FindAndReadSignature(stream, searchHeaderSizeLimit));
+ _stream = stream;
+ return S_OK;
+}
+
+void CInArchive::Close()
+{
+ _numInByteBufs = 0;
+ _stream.Release();
+ ThereIsHeaderError = false;
+}
+
+void CInArchive::ReadArchiveProperties(CInArchiveInfo & /* archiveInfo */)
+{
+ for (;;)
+ {
+ if (ReadID() == NID::kEnd)
+ break;
+ SkipData();
+ }
+}
+
+// CFolder &folder can be non empty. So we must set all fields
+
+void CInByte2::ParseFolder(CFolder &folder)
+{
+ UInt32 numCoders = ReadNum();
+
+ if (numCoders == 0)
+ ThrowUnsupported();
+
+ folder.Coders.SetSize(numCoders);
+
+ UInt32 numInStreams = 0;
+ UInt32 i;
+ for (i = 0; i < numCoders; i++)
+ {
+ CCoderInfo &coder = folder.Coders[i];
+ {
+ Byte mainByte = ReadByte();
+ if ((mainByte & 0xC0) != 0)
+ ThrowUnsupported();
+ unsigned idSize = (mainByte & 0xF);
+ if (idSize > 8 || idSize > GetRem())
+ ThrowUnsupported();
+ const Byte *longID = GetPtr();
+ UInt64 id = 0;
+ for (unsigned j = 0; j < idSize; j++)
+ id = ((id << 8) | longID[j]);
+ SkipDataNoCheck(idSize);
+ coder.MethodID = id;
+
+ if ((mainByte & 0x10) != 0)
+ {
+ coder.NumStreams = ReadNum();
+ /* numOutStreams = */ ReadNum();
+ }
+ else
+ {
+ coder.NumStreams = 1;
+ }
+
+ if ((mainByte & 0x20) != 0)
+ {
+ CNum propsSize = ReadNum();
+ coder.Props.Alloc((size_t)propsSize);
+ ReadBytes((Byte *)coder.Props, (size_t)propsSize);
+ }
+ else
+ coder.Props.Free();
+ }
+ numInStreams += coder.NumStreams;
+ }
+
+ UInt32 numBonds = numCoders - 1;
+ folder.Bonds.SetSize(numBonds);
+ for (i = 0; i < numBonds; i++)
+ {
+ CBond &bp = folder.Bonds[i];
+ bp.PackIndex = ReadNum();
+ bp.UnpackIndex = ReadNum();
+ }
+
+ if (numInStreams < numBonds)
+ ThrowUnsupported();
+ UInt32 numPackStreams = numInStreams - numBonds;
+ folder.PackStreams.SetSize(numPackStreams);
+
+ if (numPackStreams == 1)
+ {
+ for (i = 0; i < numInStreams; i++)
+ if (folder.FindBond_for_PackStream(i) < 0)
+ {
+ folder.PackStreams[0] = i;
+ break;
+ }
+ if (i == numInStreams)
+ ThrowUnsupported();
+ }
+ else
+ for (i = 0; i < numPackStreams; i++)
+ folder.PackStreams[i] = ReadNum();
+}
+
+void CFolders::ParseFolderInfo(unsigned folderIndex, CFolder &folder) const
+{
+ size_t startPos = FoCodersDataOffset[folderIndex];
+ CInByte2 inByte;
+ inByte.Init(CodersData + startPos, FoCodersDataOffset[folderIndex + 1] - startPos);
+ inByte.ParseFolder(folder);
+ if (inByte.GetRem() != 0)
+ throw 20120424;
+}
+
+
+void CDatabase::GetPath(unsigned index, UString &path) const
+{
+ path.Empty();
+ if (!NameOffsets || !NamesBuf)
+ return;
+
+ size_t offset = NameOffsets[index];
+ size_t size = NameOffsets[index + 1] - offset;
+
+ if (size >= (1 << 28))
+ return;
+
+ wchar_t *s = path.GetBuf((unsigned)size - 1);
+
+ const Byte *p = ((const Byte *)NamesBuf + offset * 2);
+
+ #if defined(_WIN32) && defined(MY_CPU_LE)
+
+ wmemcpy(s, (const wchar_t *)p, size);
+
+ #else
+
+ for (size_t i = 0; i < size; i++)
+ {
+ *s = Get16(p);
+ p += 2;
+ s++;
+ }
+
+ #endif
+
+ path.ReleaseBuf_SetLen((unsigned)size - 1);
+}
+
+HRESULT CDatabase::GetPath_Prop(unsigned index, PROPVARIANT *path) const throw()
+{
+ PropVariant_Clear(path);
+ if (!NameOffsets || !NamesBuf)
+ return S_OK;
+
+ size_t offset = NameOffsets[index];
+ size_t size = NameOffsets[index + 1] - offset;
+
+ if (size >= (1 << 14))
+ return S_OK;
+
+ RINOK(PropVarEm_Alloc_Bstr(path, (unsigned)size - 1));
+ wchar_t *s = path->bstrVal;
+
+ const Byte *p = ((const Byte *)NamesBuf + offset * 2);
+
+ for (size_t i = 0; i < size; i++)
+ {
+ wchar_t c = Get16(p);
+ p += 2;
+ #if WCHAR_PATH_SEPARATOR != L'/'
+ if (c == L'/')
+ c = WCHAR_PATH_SEPARATOR;
+ #endif
+ *s++ = c;
+ }
+
+ return S_OK;
+
+ /*
+ unsigned cur = index;
+ unsigned size = 0;
+
+ for (int i = 0;; i++)
+ {
+ size_t len = NameOffsets[cur + 1] - NameOffsets[cur];
+ size += (unsigned)len;
+ if (i > 256 || len > (1 << 14) || size > (1 << 14))
+ return PropVarEm_Set_Str(path, "[TOO-LONG]");
+ cur = Files[cur].Parent;
+ if (cur < 0)
+ break;
+ }
+ size--;
+
+ RINOK(PropVarEm_Alloc_Bstr(path, size));
+ wchar_t *s = path->bstrVal;
+ s += size;
+ *s = 0;
+ cur = index;
+
+ for (;;)
+ {
+ unsigned len = (unsigned)(NameOffsets[cur + 1] - NameOffsets[cur] - 1);
+ const Byte *p = (const Byte *)NamesBuf + (NameOffsets[cur + 1] * 2) - 2;
+ for (; len != 0; len--)
+ {
+ p -= 2;
+ --s;
+ wchar_t c = Get16(p);
+ if (c == '/')
+ c = WCHAR_PATH_SEPARATOR;
+ *s = c;
+ }
+
+ const CFileItem &file = Files[cur];
+ cur = file.Parent;
+ if (cur < 0)
+ return S_OK;
+ *(--s) = (file.IsAltStream ? ':' : WCHAR_PATH_SEPARATOR);
+ }
+ */
+}
+
+void CInArchive::WaitId(UInt64 id)
+{
+ for (;;)
+ {
+ UInt64 type = ReadID();
+ if (type == id)
+ return;
+ if (type == NID::kEnd)
+ ThrowIncorrect();
+ SkipData();
+ }
+}
+
+
+void CInArchive::Read_UInt32_Vector(CUInt32DefVector &v)
+{
+ unsigned numItems = v.Defs.Size();
+ v.Vals.ClearAndSetSize(numItems);
+ UInt32 *p = &v.Vals[0];
+ const bool *defs = &v.Defs[0];
+ for (unsigned i = 0; i < numItems; i++)
+ {
+ UInt32 a = 0;
+ if (defs[i])
+ a = ReadUInt32();
+ p[i] = a;
+ }
+}
+
+
+void CInArchive::ReadHashDigests(unsigned numItems, CUInt32DefVector &crcs)
+{
+ ReadBoolVector2(numItems, crcs.Defs);
+ Read_UInt32_Vector(crcs);
+}
+
+
+#define k_Scan_NumCoders_MAX 64
+#define k_Scan_NumCodersStreams_in_Folder_MAX 64
+
+void CInArchive::ReadPackInfo(CFolders &f)
+{
+ CNum numPackStreams = ReadNum();
+
+ WaitId(NID::kSize);
+ f.PackPositions.Alloc(numPackStreams + 1);
+ f.NumPackStreams = numPackStreams;
+ UInt64 sum = 0;
+ for (CNum i = 0; i < numPackStreams; i++)
+ {
+ f.PackPositions[i] = sum;
+ UInt64 packSize = ReadNumber();
+ sum += packSize;
+ if (sum < packSize)
+ ThrowIncorrect();
+ }
+ f.PackPositions[numPackStreams] = sum;
+
+ UInt64 type;
+ for (;;)
+ {
+ type = ReadID();
+ if (type == NID::kEnd)
+ return;
+ if (type == NID::kCRC)
+ {
+ CUInt32DefVector PackCRCs;
+ ReadHashDigests(numPackStreams, PackCRCs);
+ continue;
+ }
+ SkipData();
+ }
+}
+
+void CInArchive::ReadUnpackInfo(
+ const CObjectVector<CByteBuffer> *dataVector,
+ CFolders &folders)
+{
+ WaitId(NID::kFolder);
+ CNum numFolders = ReadNum();
+
+ CNum numCodersOutStreams = 0;
+ {
+ CStreamSwitch streamSwitch;
+ streamSwitch.Set(this, dataVector);
+ const Byte *startBufPtr = _inByteBack->GetPtr();
+ folders.NumFolders = numFolders;
+
+ folders.FoStartPackStreamIndex.Alloc(numFolders + 1);
+ folders.FoToMainUnpackSizeIndex.Alloc(numFolders);
+ folders.FoCodersDataOffset.Alloc(numFolders + 1);
+ folders.FoToCoderUnpackSizes.Alloc(numFolders + 1);
+
+ CBoolVector StreamUsed;
+ CBoolVector CoderUsed;
+
+ CNum packStreamIndex = 0;
+ CNum fo;
+ CInByte2 *inByte = _inByteBack;
+
+ for (fo = 0; fo < numFolders; fo++)
+ {
+ UInt32 indexOfMainStream = 0;
+ UInt32 numPackStreams = 0;
+ folders.FoCodersDataOffset[fo] = _inByteBack->GetPtr() - startBufPtr;
+
+ CNum numInStreams = 0;
+ CNum numCoders = inByte->ReadNum();
+
+ if (numCoders == 0 || numCoders > k_Scan_NumCoders_MAX)
+ ThrowUnsupported();
+
+ for (CNum ci = 0; ci < numCoders; ci++)
+ {
+ Byte mainByte = inByte->ReadByte();
+ if ((mainByte & 0xC0) != 0)
+ ThrowUnsupported();
+
+ unsigned idSize = (mainByte & 0xF);
+ if (idSize > 8)
+ ThrowUnsupported();
+ if (idSize > inByte->GetRem())
+ ThrowEndOfData();
+ const Byte *longID = inByte->GetPtr();
+ UInt64 id = 0;
+ for (unsigned j = 0; j < idSize; j++)
+ id = ((id << 8) | longID[j]);
+ inByte->SkipDataNoCheck(idSize);
+ if (folders.ParsedMethods.IDs.Size() < 128)
+ folders.ParsedMethods.IDs.AddToUniqueSorted(id);
+
+ CNum coderInStreams = 1;
+ if ((mainByte & 0x10) != 0)
+ {
+ coderInStreams = inByte->ReadNum();
+ if (coderInStreams > k_Scan_NumCodersStreams_in_Folder_MAX)
+ ThrowUnsupported();
+ if (inByte->ReadNum() != 1)
+ ThrowUnsupported();
+ }
+
+ numInStreams += coderInStreams;
+ if (numInStreams > k_Scan_NumCodersStreams_in_Folder_MAX)
+ ThrowUnsupported();
+
+ if ((mainByte & 0x20) != 0)
+ {
+ CNum propsSize = inByte->ReadNum();
+ if (propsSize > inByte->GetRem())
+ ThrowEndOfData();
+ if (id == k_LZMA2 && propsSize == 1)
+ {
+ Byte v = *_inByteBack->GetPtr();
+ if (folders.ParsedMethods.Lzma2Prop < v)
+ folders.ParsedMethods.Lzma2Prop = v;
+ }
+ else if (id == k_LZMA && propsSize == 5)
+ {
+ UInt32 dicSize = GetUi32(_inByteBack->GetPtr() + 1);
+ if (folders.ParsedMethods.LzmaDic < dicSize)
+ folders.ParsedMethods.LzmaDic = dicSize;
+ }
+ inByte->SkipDataNoCheck((size_t)propsSize);
+ }
+ }
+
+ if (numCoders == 1 && numInStreams == 1)
+ {
+ indexOfMainStream = 0;
+ numPackStreams = 1;
+ }
+ else
+ {
+ UInt32 i;
+ CNum numBonds = numCoders - 1;
+ if (numInStreams < numBonds)
+ ThrowUnsupported();
+
+ BoolVector_Fill_False(StreamUsed, numInStreams);
+ BoolVector_Fill_False(CoderUsed, numCoders);
+
+ for (i = 0; i < numBonds; i++)
+ {
+ CNum index = ReadNum();
+ if (index >= numInStreams || StreamUsed[index])
+ ThrowUnsupported();
+ StreamUsed[index] = true;
+
+ index = ReadNum();
+ if (index >= numCoders || CoderUsed[index])
+ ThrowUnsupported();
+ CoderUsed[index] = true;
+ }
+
+ numPackStreams = numInStreams - numBonds;
+
+ if (numPackStreams != 1)
+ for (i = 0; i < numPackStreams; i++)
+ {
+ CNum index = inByte->ReadNum(); // PackStreams
+ if (index >= numInStreams || StreamUsed[index])
+ ThrowUnsupported();
+ StreamUsed[index] = true;
+ }
+
+ for (i = 0; i < numCoders; i++)
+ if (!CoderUsed[i])
+ {
+ indexOfMainStream = i;
+ break;
+ }
+
+ if (i == numCoders)
+ ThrowUnsupported();
+ }
+
+ folders.FoToCoderUnpackSizes[fo] = numCodersOutStreams;
+ numCodersOutStreams += numCoders;
+ folders.FoStartPackStreamIndex[fo] = packStreamIndex;
+ if (numPackStreams > folders.NumPackStreams - packStreamIndex)
+ ThrowIncorrect();
+ packStreamIndex += numPackStreams;
+ folders.FoToMainUnpackSizeIndex[fo] = (Byte)indexOfMainStream;
+ }
+
+ size_t dataSize = _inByteBack->GetPtr() - startBufPtr;
+ folders.FoToCoderUnpackSizes[fo] = numCodersOutStreams;
+ folders.FoStartPackStreamIndex[fo] = packStreamIndex;
+ folders.FoCodersDataOffset[fo] = _inByteBack->GetPtr() - startBufPtr;
+ folders.CodersData.CopyFrom(startBufPtr, dataSize);
+
+ // if (folders.NumPackStreams != packStreamIndex) ThrowUnsupported();
+ }
+
+ WaitId(NID::kCodersUnpackSize);
+ folders.CoderUnpackSizes.Alloc(numCodersOutStreams);
+ for (CNum i = 0; i < numCodersOutStreams; i++)
+ folders.CoderUnpackSizes[i] = ReadNumber();
+
+ for (;;)
+ {
+ UInt64 type = ReadID();
+ if (type == NID::kEnd)
+ return;
+ if (type == NID::kCRC)
+ {
+ ReadHashDigests(numFolders, folders.FolderCRCs);
+ continue;
+ }
+ SkipData();
+ }
+}
+
+void CInArchive::ReadSubStreamsInfo(
+ CFolders &folders,
+ CRecordVector<UInt64> &unpackSizes,
+ CUInt32DefVector &digests)
+{
+ folders.NumUnpackStreamsVector.Alloc(folders.NumFolders);
+ CNum i;
+ for (i = 0; i < folders.NumFolders; i++)
+ folders.NumUnpackStreamsVector[i] = 1;
+
+ UInt64 type;
+
+ for (;;)
+ {
+ type = ReadID();
+ if (type == NID::kNumUnpackStream)
+ {
+ for (i = 0; i < folders.NumFolders; i++)
+ folders.NumUnpackStreamsVector[i] = ReadNum();
+ continue;
+ }
+ if (type == NID::kCRC || type == NID::kSize || type == NID::kEnd)
+ break;
+ SkipData();
+ }
+
+ if (type == NID::kSize)
+ {
+ for (i = 0; i < folders.NumFolders; i++)
+ {
+ // v3.13 incorrectly worked with empty folders
+ // v4.07: we check that folder is empty
+ CNum numSubstreams = folders.NumUnpackStreamsVector[i];
+ if (numSubstreams == 0)
+ continue;
+ UInt64 sum = 0;
+ for (CNum j = 1; j < numSubstreams; j++)
+ {
+ UInt64 size = ReadNumber();
+ unpackSizes.Add(size);
+ sum += size;
+ if (sum < size)
+ ThrowIncorrect();
+ }
+ UInt64 folderUnpackSize = folders.GetFolderUnpackSize(i);
+ if (folderUnpackSize < sum)
+ ThrowIncorrect();
+ unpackSizes.Add(folderUnpackSize - sum);
+ }
+ type = ReadID();
+ }
+ else
+ {
+ for (i = 0; i < folders.NumFolders; i++)
+ {
+ /* v9.26 - v9.29 incorrectly worked:
+ if (folders.NumUnpackStreamsVector[i] == 0), it threw error */
+ CNum val = folders.NumUnpackStreamsVector[i];
+ if (val > 1)
+ ThrowIncorrect();
+ if (val == 1)
+ unpackSizes.Add(folders.GetFolderUnpackSize(i));
+ }
+ }
+
+ unsigned numDigests = 0;
+ for (i = 0; i < folders.NumFolders; i++)
+ {
+ CNum numSubstreams = folders.NumUnpackStreamsVector[i];
+ if (numSubstreams != 1 || !folders.FolderCRCs.ValidAndDefined(i))
+ numDigests += numSubstreams;
+ }
+
+ for (;;)
+ {
+ if (type == NID::kEnd)
+ break;
+ if (type == NID::kCRC)
+ {
+ // CUInt32DefVector digests2;
+ // ReadHashDigests(numDigests, digests2);
+ CBoolVector digests2;
+ ReadBoolVector2(numDigests, digests2);
+
+ digests.ClearAndSetSize(unpackSizes.Size());
+
+ unsigned k = 0;
+ unsigned k2 = 0;
+
+ for (i = 0; i < folders.NumFolders; i++)
+ {
+ CNum numSubstreams = folders.NumUnpackStreamsVector[i];
+ if (numSubstreams == 1 && folders.FolderCRCs.ValidAndDefined(i))
+ {
+ digests.Defs[k] = true;
+ digests.Vals[k] = folders.FolderCRCs.Vals[i];
+ k++;
+ }
+ else for (CNum j = 0; j < numSubstreams; j++)
+ {
+ bool defined = digests2[k2++];
+ digests.Defs[k] = defined;
+ UInt32 crc = 0;
+ if (defined)
+ crc = ReadUInt32();
+ digests.Vals[k] = crc;
+ k++;
+ }
+ }
+ // if (k != unpackSizes.Size()) throw 1234567;
+ }
+ else
+ SkipData();
+
+ type = ReadID();
+ }
+
+ if (digests.Defs.Size() != unpackSizes.Size())
+ {
+ digests.ClearAndSetSize(unpackSizes.Size());
+ unsigned k = 0;
+ for (i = 0; i < folders.NumFolders; i++)
+ {
+ CNum numSubstreams = folders.NumUnpackStreamsVector[i];
+ if (numSubstreams == 1 && folders.FolderCRCs.ValidAndDefined(i))
+ {
+ digests.Defs[k] = true;
+ digests.Vals[k] = folders.FolderCRCs.Vals[i];
+ k++;
+ }
+ else for (CNum j = 0; j < numSubstreams; j++)
+ {
+ digests.Defs[k] = false;
+ digests.Vals[k] = 0;
+ k++;
+ }
+ }
+ }
+}
+
+void CInArchive::ReadStreamsInfo(
+ const CObjectVector<CByteBuffer> *dataVector,
+ UInt64 &dataOffset,
+ CFolders &folders,
+ CRecordVector<UInt64> &unpackSizes,
+ CUInt32DefVector &digests)
+{
+ UInt64 type = ReadID();
+
+ if (type == NID::kPackInfo)
+ {
+ dataOffset = ReadNumber();
+ ReadPackInfo(folders);
+ type = ReadID();
+ }
+
+ if (type == NID::kUnpackInfo)
+ {
+ ReadUnpackInfo(dataVector, folders);
+ type = ReadID();
+ }
+
+ if (folders.NumFolders != 0 && !folders.PackPositions)
+ {
+ // if there are folders, we need PackPositions also
+ folders.PackPositions.Alloc(1);
+ folders.PackPositions[0] = 0;
+ }
+
+ if (type == NID::kSubStreamsInfo)
+ {
+ ReadSubStreamsInfo(folders, unpackSizes, digests);
+ type = ReadID();
+ }
+ else
+ {
+ folders.NumUnpackStreamsVector.Alloc(folders.NumFolders);
+ /* If digests.Defs.Size() == 0, it means that there are no crcs.
+ So we don't need to fill digests with values. */
+ // digests.Vals.ClearAndSetSize(folders.NumFolders);
+ // BoolVector_Fill_False(digests.Defs, folders.NumFolders);
+ for (CNum i = 0; i < folders.NumFolders; i++)
+ {
+ folders.NumUnpackStreamsVector[i] = 1;
+ unpackSizes.Add(folders.GetFolderUnpackSize(i));
+ // digests.Vals[i] = 0;
+ }
+ }
+
+ if (type != NID::kEnd)
+ ThrowIncorrect();
+}
+
+void CInArchive::ReadBoolVector(unsigned numItems, CBoolVector &v)
+{
+ v.ClearAndSetSize(numItems);
+ Byte b = 0;
+ Byte mask = 0;
+ bool *p = &v[0];
+ for (unsigned i = 0; i < numItems; i++)
+ {
+ if (mask == 0)
+ {
+ b = ReadByte();
+ mask = 0x80;
+ }
+ p[i] = ((b & mask) != 0);
+ mask >>= 1;
+ }
+}
+
+void CInArchive::ReadBoolVector2(unsigned numItems, CBoolVector &v)
+{
+ Byte allAreDefined = ReadByte();
+ if (allAreDefined == 0)
+ {
+ ReadBoolVector(numItems, v);
+ return;
+ }
+ v.ClearAndSetSize(numItems);
+ bool *p = &v[0];
+ for (unsigned i = 0; i < numItems; i++)
+ p[i] = true;
+}
+
+void CInArchive::ReadUInt64DefVector(const CObjectVector<CByteBuffer> &dataVector,
+ CUInt64DefVector &v, unsigned numItems)
+{
+ ReadBoolVector2(numItems, v.Defs);
+
+ CStreamSwitch streamSwitch;
+ streamSwitch.Set(this, &dataVector);
+
+ v.Vals.ClearAndSetSize(numItems);
+ UInt64 *p = &v.Vals[0];
+ const bool *defs = &v.Defs[0];
+
+ for (unsigned i = 0; i < numItems; i++)
+ {
+ UInt64 t = 0;
+ if (defs[i])
+ t = ReadUInt64();
+ p[i] = t;
+ }
+}
+
+HRESULT CInArchive::ReadAndDecodePackedStreams(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ UInt64 baseOffset,
+ UInt64 &dataOffset, CObjectVector<CByteBuffer> &dataVector
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ )
+{
+ CFolders folders;
+ CRecordVector<UInt64> unpackSizes;
+ CUInt32DefVector digests;
+
+ ReadStreamsInfo(NULL,
+ dataOffset,
+ folders,
+ unpackSizes,
+ digests);
+
+ CDecoder decoder(_useMixerMT);
+
+ for (CNum i = 0; i < folders.NumFolders; i++)
+ {
+ CByteBuffer &data = dataVector.AddNew();
+ UInt64 unpackSize64 = folders.GetFolderUnpackSize(i);
+ size_t unpackSize = (size_t)unpackSize64;
+ if (unpackSize != unpackSize64)
+ ThrowUnsupported();
+ data.Alloc(unpackSize);
+
+ CBufPtrSeqOutStream *outStreamSpec = new CBufPtrSeqOutStream;
+ CMyComPtr<ISequentialOutStream> outStream = outStreamSpec;
+ outStreamSpec->Init(data, unpackSize);
+
+ bool dataAfterEnd_Error = false;
+
+ HRESULT result = decoder.Decode(
+ EXTERNAL_CODECS_LOC_VARS
+ _stream, baseOffset + dataOffset,
+ folders, i,
+ NULL, // *unpackSize
+
+ outStream,
+ NULL, // *compressProgress
+
+ NULL // **inStreamMainRes
+ , dataAfterEnd_Error
+
+ _7Z_DECODER_CRYPRO_VARS
+ #if !defined(_7ZIP_ST)
+ , false // mtMode
+ , 1 // numThreads
+ , 0 // memUsage
+ #endif
+ );
+
+ RINOK(result);
+
+ if (dataAfterEnd_Error)
+ ThereIsHeaderError = true;
+
+ if (folders.FolderCRCs.ValidAndDefined(i))
+ if (CrcCalc(data, unpackSize) != folders.FolderCRCs.Vals[i])
+ ThrowIncorrect();
+ }
+
+ if (folders.PackPositions)
+ HeadersSize += folders.PackPositions[folders.NumPackStreams];
+
+ return S_OK;
+}
+
+HRESULT CInArchive::ReadHeader(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CDbEx &db
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ )
+{
+ UInt64 type = ReadID();
+
+ if (type == NID::kArchiveProperties)
+ {
+ ReadArchiveProperties(db.ArcInfo);
+ type = ReadID();
+ }
+
+ CObjectVector<CByteBuffer> dataVector;
+
+ if (type == NID::kAdditionalStreamsInfo)
+ {
+ HRESULT result = ReadAndDecodePackedStreams(
+ EXTERNAL_CODECS_LOC_VARS
+ db.ArcInfo.StartPositionAfterHeader,
+ db.ArcInfo.DataStartPosition2,
+ dataVector
+ _7Z_DECODER_CRYPRO_VARS
+ );
+ RINOK(result);
+ db.ArcInfo.DataStartPosition2 += db.ArcInfo.StartPositionAfterHeader;
+ type = ReadID();
+ }
+
+ CRecordVector<UInt64> unpackSizes;
+ CUInt32DefVector digests;
+
+ if (type == NID::kMainStreamsInfo)
+ {
+ ReadStreamsInfo(&dataVector,
+ db.ArcInfo.DataStartPosition,
+ (CFolders &)db,
+ unpackSizes,
+ digests);
+ db.ArcInfo.DataStartPosition += db.ArcInfo.StartPositionAfterHeader;
+ type = ReadID();
+ }
+
+ if (type == NID::kFilesInfo)
+ {
+
+ const CNum numFiles = ReadNum();
+
+ db.ArcInfo.FileInfoPopIDs.Add(NID::kSize);
+ // if (!db.PackSizes.IsEmpty())
+ db.ArcInfo.FileInfoPopIDs.Add(NID::kPackInfo);
+ if (numFiles > 0 && !digests.Defs.IsEmpty())
+ db.ArcInfo.FileInfoPopIDs.Add(NID::kCRC);
+
+ CBoolVector emptyStreamVector;
+ CBoolVector emptyFileVector;
+ CBoolVector antiFileVector;
+ CNum numEmptyStreams = 0;
+
+ for (;;)
+ {
+ const UInt64 type2 = ReadID();
+ if (type2 == NID::kEnd)
+ break;
+ UInt64 size = ReadNumber();
+ if (size > _inByteBack->GetRem())
+ ThrowIncorrect();
+ CStreamSwitch switchProp;
+ switchProp.Set(this, _inByteBack->GetPtr(), (size_t)size, true);
+ bool addPropIdToList = true;
+ bool isKnownType = true;
+ if (type2 > ((UInt32)1 << 30))
+ isKnownType = false;
+ else switch ((UInt32)type2)
+ {
+ case NID::kName:
+ {
+ CStreamSwitch streamSwitch;
+ streamSwitch.Set(this, &dataVector);
+ size_t rem = _inByteBack->GetRem();
+ db.NamesBuf.Alloc(rem);
+ ReadBytes(db.NamesBuf, rem);
+ db.NameOffsets.Alloc(numFiles + 1);
+ size_t pos = 0;
+ unsigned i;
+ for (i = 0; i < numFiles; i++)
+ {
+ size_t curRem = (rem - pos) / 2;
+ const UInt16 *buf = (const UInt16 *)(db.NamesBuf + pos);
+ size_t j;
+ for (j = 0; j < curRem && buf[j] != 0; j++);
+ if (j == curRem)
+ ThrowEndOfData();
+ db.NameOffsets[i] = pos / 2;
+ pos += j * 2 + 2;
+ }
+ db.NameOffsets[i] = pos / 2;
+ if (pos != rem)
+ ThereIsHeaderError = true;
+ break;
+ }
+
+ case NID::kWinAttrib:
+ {
+ ReadBoolVector2(numFiles, db.Attrib.Defs);
+ CStreamSwitch streamSwitch;
+ streamSwitch.Set(this, &dataVector);
+ Read_UInt32_Vector(db.Attrib);
+ break;
+ }
+
+ /*
+ case NID::kIsAux:
+ {
+ ReadBoolVector(numFiles, db.IsAux);
+ break;
+ }
+ case NID::kParent:
+ {
+ db.IsTree = true;
+ // CBoolVector boolVector;
+ // ReadBoolVector2(numFiles, boolVector);
+ // CStreamSwitch streamSwitch;
+ // streamSwitch.Set(this, &dataVector);
+ CBoolVector boolVector;
+ ReadBoolVector2(numFiles, boolVector);
+
+ db.ThereAreAltStreams = false;
+ for (i = 0; i < numFiles; i++)
+ {
+ CFileItem &file = db.Files[i];
+ // file.Parent = -1;
+ // if (boolVector[i])
+ file.Parent = (int)ReadUInt32();
+ file.IsAltStream = !boolVector[i];
+ if (file.IsAltStream)
+ db.ThereAreAltStreams = true;
+ }
+ break;
+ }
+ */
+ case NID::kEmptyStream:
+ {
+ ReadBoolVector(numFiles, emptyStreamVector);
+ numEmptyStreams = BoolVector_CountSum(emptyStreamVector);
+ emptyFileVector.Clear();
+ antiFileVector.Clear();
+ break;
+ }
+ case NID::kEmptyFile: ReadBoolVector(numEmptyStreams, emptyFileVector); break;
+ case NID::kAnti: ReadBoolVector(numEmptyStreams, antiFileVector); break;
+ case NID::kStartPos: ReadUInt64DefVector(dataVector, db.StartPos, (unsigned)numFiles); break;
+ case NID::kCTime: ReadUInt64DefVector(dataVector, db.CTime, (unsigned)numFiles); break;
+ case NID::kATime: ReadUInt64DefVector(dataVector, db.ATime, (unsigned)numFiles); break;
+ case NID::kMTime: ReadUInt64DefVector(dataVector, db.MTime, (unsigned)numFiles); break;
+ case NID::kDummy:
+ {
+ for (UInt64 j = 0; j < size; j++)
+ if (ReadByte() != 0)
+ ThereIsHeaderError = true;
+ addPropIdToList = false;
+ break;
+ }
+ /*
+ case NID::kNtSecure:
+ {
+ try
+ {
+ {
+ CStreamSwitch streamSwitch;
+ streamSwitch.Set(this, &dataVector);
+ UInt32 numDescriptors = ReadUInt32();
+ size_t offset = 0;
+ db.SecureOffsets.Clear();
+ for (i = 0; i < numDescriptors; i++)
+ {
+ UInt32 size = ReadUInt32();
+ db.SecureOffsets.Add(offset);
+ offset += size;
+ }
+ // ThrowIncorrect();;
+ db.SecureOffsets.Add(offset);
+ db.SecureBuf.SetCapacity(offset);
+ for (i = 0; i < numDescriptors; i++)
+ {
+ offset = db.SecureOffsets[i];
+ ReadBytes(db.SecureBuf + offset, db.SecureOffsets[i + 1] - offset);
+ }
+ db.SecureIDs.Clear();
+ for (unsigned i = 0; i < numFiles; i++)
+ {
+ db.SecureIDs.Add(ReadNum());
+ // db.SecureIDs.Add(ReadUInt32());
+ }
+ // ReadUInt32();
+ if (_inByteBack->GetRem() != 0)
+ ThrowIncorrect();;
+ }
+ }
+ catch(CInArchiveException &)
+ {
+ ThereIsHeaderError = true;
+ addPropIdToList = isKnownType = false;
+ db.ClearSecure();
+ }
+ break;
+ }
+ */
+ default:
+ addPropIdToList = isKnownType = false;
+ }
+ if (isKnownType)
+ {
+ if (addPropIdToList)
+ db.ArcInfo.FileInfoPopIDs.Add(type2);
+ }
+ else
+ {
+ db.UnsupportedFeatureWarning = true;
+ _inByteBack->SkipRem();
+ }
+ // SkipData worked incorrectly in some versions before v4.59 (7zVer <= 0.02)
+ if (_inByteBack->GetRem() != 0)
+ ThrowIncorrect();
+ }
+
+ type = ReadID(); // Read (NID::kEnd) end of headers
+
+ if (numFiles - numEmptyStreams != unpackSizes.Size())
+ ThrowUnsupported();
+
+ CNum emptyFileIndex = 0;
+ CNum sizeIndex = 0;
+
+ const CNum numAntiItems = BoolVector_CountSum(antiFileVector);
+
+ if (numAntiItems != 0)
+ db.IsAnti.ClearAndSetSize(numFiles);
+
+ db.Files.ClearAndSetSize(numFiles);
+
+ for (CNum i = 0; i < numFiles; i++)
+ {
+ CFileItem &file = db.Files[i];
+ bool isAnti;
+ file.Crc = 0;
+ if (!BoolVector_Item_IsValidAndTrue(emptyStreamVector, i))
+ {
+ file.HasStream = true;
+ file.IsDir = false;
+ isAnti = false;
+ file.Size = unpackSizes[sizeIndex];
+ file.CrcDefined = digests.ValidAndDefined(sizeIndex);
+ if (file.CrcDefined)
+ file.Crc = digests.Vals[sizeIndex];
+ sizeIndex++;
+ }
+ else
+ {
+ file.HasStream = false;
+ file.IsDir = !BoolVector_Item_IsValidAndTrue(emptyFileVector, emptyFileIndex);
+ isAnti = BoolVector_Item_IsValidAndTrue(antiFileVector, emptyFileIndex);
+ emptyFileIndex++;
+ file.Size = 0;
+ file.CrcDefined = false;
+ }
+ if (numAntiItems != 0)
+ db.IsAnti[i] = isAnti;
+ }
+
+ }
+
+ db.FillLinks();
+
+ if (type != NID::kEnd || _inByteBack->GetRem() != 0)
+ {
+ db.UnsupportedFeatureWarning = true;
+ // ThrowIncorrect();
+ }
+
+ return S_OK;
+}
+
+
+void CDbEx::FillLinks()
+{
+ FolderStartFileIndex.Alloc(NumFolders);
+ FileIndexToFolderIndexMap.Alloc(Files.Size());
+
+ CNum folderIndex = 0;
+ CNum indexInFolder = 0;
+ unsigned i;
+
+ for (i = 0; i < Files.Size(); i++)
+ {
+ bool emptyStream = !Files[i].HasStream;
+ if (indexInFolder == 0)
+ {
+ if (emptyStream)
+ {
+ FileIndexToFolderIndexMap[i] = kNumNoIndex;
+ continue;
+ }
+ // v3.13 incorrectly worked with empty folders
+ // v4.07: we skip empty folders
+ for (;;)
+ {
+ if (folderIndex >= NumFolders)
+ ThrowIncorrect();
+ FolderStartFileIndex[folderIndex] = i;
+ if (NumUnpackStreamsVector[folderIndex] != 0)
+ break;
+ folderIndex++;
+ }
+ }
+ FileIndexToFolderIndexMap[i] = folderIndex;
+ if (emptyStream)
+ continue;
+ if (++indexInFolder >= NumUnpackStreamsVector[folderIndex])
+ {
+ folderIndex++;
+ indexInFolder = 0;
+ }
+ }
+
+ if (indexInFolder != 0)
+ folderIndex++;
+ /*
+ if (indexInFolder != 0)
+ ThrowIncorrect();
+ */
+
+ for (;;)
+ {
+ if (folderIndex >= NumFolders)
+ return;
+ FolderStartFileIndex[folderIndex] = i;
+ /*
+ if (NumUnpackStreamsVector[folderIndex] != 0)
+ ThrowIncorrect();;
+ */
+ folderIndex++;
+ }
+}
+
+
+HRESULT CInArchive::ReadDatabase2(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CDbEx &db
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ )
+{
+ db.Clear();
+ db.ArcInfo.StartPosition = _arhiveBeginStreamPosition;
+
+ db.ArcInfo.Version.Major = _header[6];
+ db.ArcInfo.Version.Minor = _header[7];
+
+ if (db.ArcInfo.Version.Major != kMajorVersion)
+ {
+ // db.UnsupportedVersion = true;
+ return S_FALSE;
+ }
+
+ UInt64 nextHeaderOffset = Get64(_header + 12);
+ UInt64 nextHeaderSize = Get64(_header + 20);
+ UInt32 nextHeaderCRC = Get32(_header + 28);
+
+ #ifdef FORMAT_7Z_RECOVERY
+ UInt32 crcFromArc = Get32(_header + 8);
+ if (crcFromArc == 0 && nextHeaderOffset == 0 && nextHeaderSize == 0 && nextHeaderCRC == 0)
+ {
+ UInt64 cur, fileSize;
+ RINOK(_stream->Seek(0, STREAM_SEEK_CUR, &cur));
+ const unsigned kCheckSize = 512;
+ Byte buf[kCheckSize];
+ RINOK(_stream->Seek(0, STREAM_SEEK_END, &fileSize));
+ UInt64 rem = fileSize - cur;
+ unsigned checkSize = kCheckSize;
+ if (rem < kCheckSize)
+ checkSize = (unsigned)(rem);
+ if (checkSize < 3)
+ return S_FALSE;
+ RINOK(_stream->Seek(fileSize - checkSize, STREAM_SEEK_SET, NULL));
+ RINOK(ReadStream_FALSE(_stream, buf, (size_t)checkSize));
+
+ if (buf[checkSize - 1] != 0)
+ return S_FALSE;
+
+ unsigned i;
+ for (i = checkSize - 2;; i--)
+ {
+ if (buf[i] == NID::kEncodedHeader && buf[i + 1] == NID::kPackInfo ||
+ buf[i] == NID::kHeader && buf[i + 1] == NID::kMainStreamsInfo)
+ break;
+ if (i == 0)
+ return S_FALSE;
+ }
+ nextHeaderSize = checkSize - i;
+ nextHeaderOffset = rem - nextHeaderSize;
+ nextHeaderCRC = CrcCalc(buf + i, (size_t)nextHeaderSize);
+ RINOK(_stream->Seek(cur, STREAM_SEEK_SET, NULL));
+ db.StartHeaderWasRecovered = true;
+ }
+ else
+ #endif
+ {
+ // Crc was tested already at signature check
+ // if (CrcCalc(_header + 12, 20) != crcFromArchive) ThrowIncorrect();
+ }
+
+ db.ArcInfo.StartPositionAfterHeader = _arhiveBeginStreamPosition + kHeaderSize;
+ db.PhySize = kHeaderSize;
+
+ db.IsArc = false;
+ if ((Int64)nextHeaderOffset < 0 ||
+ nextHeaderSize > ((UInt64)1 << 62))
+ return S_FALSE;
+ if (nextHeaderSize == 0)
+ {
+ if (nextHeaderOffset != 0)
+ return S_FALSE;
+ db.IsArc = true;
+ return S_OK;
+ }
+
+ if (!db.StartHeaderWasRecovered)
+ db.IsArc = true;
+
+ HeadersSize += kHeaderSize + nextHeaderSize;
+ db.PhySize = kHeaderSize + nextHeaderOffset + nextHeaderSize;
+ if (_fileEndPosition - db.ArcInfo.StartPositionAfterHeader < nextHeaderOffset + nextHeaderSize)
+ {
+ db.UnexpectedEnd = true;
+ return S_FALSE;
+ }
+ RINOK(_stream->Seek(nextHeaderOffset, STREAM_SEEK_CUR, NULL));
+
+ size_t nextHeaderSize_t = (size_t)nextHeaderSize;
+ if (nextHeaderSize_t != nextHeaderSize)
+ return E_OUTOFMEMORY;
+ CByteBuffer buffer2(nextHeaderSize_t);
+
+ RINOK(ReadStream_FALSE(_stream, buffer2, nextHeaderSize_t));
+
+ if (CrcCalc(buffer2, nextHeaderSize_t) != nextHeaderCRC)
+ ThrowIncorrect();
+
+ if (!db.StartHeaderWasRecovered)
+ db.PhySizeWasConfirmed = true;
+
+ CStreamSwitch streamSwitch;
+ streamSwitch.Set(this, buffer2);
+
+ CObjectVector<CByteBuffer> dataVector;
+
+ UInt64 type = ReadID();
+ if (type != NID::kHeader)
+ {
+ if (type != NID::kEncodedHeader)
+ ThrowIncorrect();
+ HRESULT result = ReadAndDecodePackedStreams(
+ EXTERNAL_CODECS_LOC_VARS
+ db.ArcInfo.StartPositionAfterHeader,
+ db.ArcInfo.DataStartPosition2,
+ dataVector
+ _7Z_DECODER_CRYPRO_VARS
+ );
+ RINOK(result);
+ if (dataVector.Size() == 0)
+ return S_OK;
+ if (dataVector.Size() > 1)
+ ThrowIncorrect();
+ streamSwitch.Remove();
+ streamSwitch.Set(this, dataVector.Front());
+ if (ReadID() != NID::kHeader)
+ ThrowIncorrect();
+ }
+
+ db.IsArc = true;
+
+ db.HeadersSize = HeadersSize;
+
+ return ReadHeader(
+ EXTERNAL_CODECS_LOC_VARS
+ db
+ _7Z_DECODER_CRYPRO_VARS
+ );
+}
+
+
+HRESULT CInArchive::ReadDatabase(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CDbEx &db
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ )
+{
+ try
+ {
+ HRESULT res = ReadDatabase2(
+ EXTERNAL_CODECS_LOC_VARS db
+ _7Z_DECODER_CRYPRO_VARS
+ );
+ if (ThereIsHeaderError)
+ db.ThereIsHeaderError = true;
+ if (res == E_NOTIMPL)
+ ThrowUnsupported();
+ return res;
+ }
+ catch(CUnsupportedFeatureException &)
+ {
+ db.UnsupportedFeatureError = true;
+ return S_FALSE;
+ }
+ catch(CInArchiveException &)
+ {
+ db.ThereIsHeaderError = true;
+ return S_FALSE;
+ }
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.h
new file mode 100644
index 0000000000..c5fb9095f0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zIn.h
@@ -0,0 +1,435 @@
+// 7zIn.h
+
+#ifndef __7Z_IN_H
+#define __7Z_IN_H
+
+#include "../../../Common/MyCom.h"
+
+#include "../../../Windows/PropVariant.h"
+
+#include "../../IPassword.h"
+#include "../../IStream.h"
+
+#include "../../Common/CreateCoder.h"
+#include "../../Common/InBuffer.h"
+
+#include "7zItem.h"
+
+namespace NArchive {
+namespace N7z {
+
+/*
+ We don't need to init isEncrypted and passwordIsDefined
+ We must upgrade them only */
+
+#ifdef _NO_CRYPTO
+#define _7Z_DECODER_CRYPRO_VARS_DECL
+#define _7Z_DECODER_CRYPRO_VARS
+#else
+#define _7Z_DECODER_CRYPRO_VARS_DECL , ICryptoGetTextPassword *getTextPassword, bool &isEncrypted, bool &passwordIsDefined, UString &password
+#define _7Z_DECODER_CRYPRO_VARS , getTextPassword, isEncrypted, passwordIsDefined, password
+#endif
+
+struct CParsedMethods
+{
+ Byte Lzma2Prop;
+ UInt32 LzmaDic;
+ CRecordVector<UInt64> IDs;
+
+ CParsedMethods(): Lzma2Prop(0), LzmaDic(0) {}
+};
+
+struct CFolderEx: public CFolder
+{
+ unsigned UnpackCoder;
+};
+
+struct CFolders
+{
+ CNum NumPackStreams;
+ CNum NumFolders;
+
+ CObjArray<UInt64> PackPositions; // NumPackStreams + 1
+ // CUInt32DefVector PackCRCs; // we don't use PackCRCs now
+
+ CUInt32DefVector FolderCRCs; // NumFolders
+ CObjArray<CNum> NumUnpackStreamsVector; // NumFolders
+
+ CObjArray<UInt64> CoderUnpackSizes; // including unpack sizes of bond coders
+ CObjArray<CNum> FoToCoderUnpackSizes; // NumFolders + 1
+ CObjArray<CNum> FoStartPackStreamIndex; // NumFolders + 1
+ CObjArray<Byte> FoToMainUnpackSizeIndex; // NumFolders
+
+ CObjArray<size_t> FoCodersDataOffset; // NumFolders + 1
+ CByteBuffer CodersData;
+
+ CParsedMethods ParsedMethods;
+
+ void ParseFolderInfo(unsigned folderIndex, CFolder &folder) const;
+ void ParseFolderEx(unsigned folderIndex, CFolderEx &folder) const
+ {
+ ParseFolderInfo(folderIndex, folder);
+ folder.UnpackCoder = FoToMainUnpackSizeIndex[folderIndex];
+ }
+
+ unsigned GetNumFolderUnpackSizes(unsigned folderIndex) const
+ {
+ return (unsigned)(FoToCoderUnpackSizes[folderIndex + 1] - FoToCoderUnpackSizes[folderIndex]);
+ }
+
+ UInt64 GetFolderUnpackSize(unsigned folderIndex) const
+ {
+ return CoderUnpackSizes[FoToCoderUnpackSizes[folderIndex] + FoToMainUnpackSizeIndex[folderIndex]];
+ }
+
+ UInt64 GetStreamPackSize(unsigned index) const
+ {
+ return PackPositions[index + 1] - PackPositions[index];
+ }
+
+ CFolders(): NumPackStreams(0), NumFolders(0) {}
+
+ void Clear()
+ {
+ NumPackStreams = 0;
+ PackPositions.Free();
+ // PackCRCs.Clear();
+
+ NumFolders = 0;
+ FolderCRCs.Clear();
+ NumUnpackStreamsVector.Free();
+ CoderUnpackSizes.Free();
+ FoToCoderUnpackSizes.Free();
+ FoStartPackStreamIndex.Free();
+ FoToMainUnpackSizeIndex.Free();
+ FoCodersDataOffset.Free();
+ CodersData.Free();
+ }
+};
+
+struct CDatabase: public CFolders
+{
+ CRecordVector<CFileItem> Files;
+
+ CUInt64DefVector CTime;
+ CUInt64DefVector ATime;
+ CUInt64DefVector MTime;
+ CUInt64DefVector StartPos;
+ CUInt32DefVector Attrib;
+ CBoolVector IsAnti;
+ /*
+ CBoolVector IsAux;
+ CByteBuffer SecureBuf;
+ CRecordVector<UInt32> SecureIDs;
+ */
+
+ CByteBuffer NamesBuf;
+ CObjArray<size_t> NameOffsets; // numFiles + 1, offsets of utf-16 symbols
+
+ /*
+ void ClearSecure()
+ {
+ SecureBuf.Free();
+ SecureIDs.Clear();
+ }
+ */
+
+ void Clear()
+ {
+ CFolders::Clear();
+ // ClearSecure();
+
+ NamesBuf.Free();
+ NameOffsets.Free();
+
+ Files.Clear();
+ CTime.Clear();
+ ATime.Clear();
+ MTime.Clear();
+ StartPos.Clear();
+ Attrib.Clear();
+ IsAnti.Clear();
+ // IsAux.Clear();
+ }
+
+ bool IsSolid() const
+ {
+ for (CNum i = 0; i < NumFolders; i++)
+ if (NumUnpackStreamsVector[i] > 1)
+ return true;
+ return false;
+ }
+ bool IsItemAnti(unsigned index) const { return (index < IsAnti.Size() && IsAnti[index]); }
+ // bool IsItemAux(unsigned index) const { return (index < IsAux.Size() && IsAux[index]); }
+
+ /*
+ const void* GetName(unsigned index) const
+ {
+ if (!NameOffsets || !NamesBuf)
+ return NULL;
+ return (void *)((const Byte *)NamesBuf + NameOffsets[index] * 2);
+ };
+ */
+ void GetPath(unsigned index, UString &path) const;
+ HRESULT GetPath_Prop(unsigned index, PROPVARIANT *path) const throw();
+};
+
+struct CInArchiveInfo
+{
+ CArchiveVersion Version;
+ UInt64 StartPosition;
+ UInt64 StartPositionAfterHeader;
+ UInt64 DataStartPosition;
+ UInt64 DataStartPosition2;
+ CRecordVector<UInt64> FileInfoPopIDs;
+
+ void Clear()
+ {
+ StartPosition = 0;
+ StartPositionAfterHeader = 0;
+ DataStartPosition = 0;
+ DataStartPosition2 = 0;
+ FileInfoPopIDs.Clear();
+ }
+};
+
+struct CDbEx: public CDatabase
+{
+ CInArchiveInfo ArcInfo;
+
+ CObjArray<CNum> FolderStartFileIndex;
+ CObjArray<CNum> FileIndexToFolderIndexMap;
+
+ UInt64 HeadersSize;
+ UInt64 PhySize;
+
+ /*
+ CRecordVector<size_t> SecureOffsets;
+ bool IsTree;
+ bool ThereAreAltStreams;
+ */
+
+ bool IsArc;
+ bool PhySizeWasConfirmed;
+
+ bool ThereIsHeaderError;
+ bool UnexpectedEnd;
+ // bool UnsupportedVersion;
+
+ bool StartHeaderWasRecovered;
+ bool UnsupportedFeatureWarning;
+ bool UnsupportedFeatureError;
+
+ /*
+ void ClearSecureEx()
+ {
+ ClearSecure();
+ SecureOffsets.Clear();
+ }
+ */
+
+ void Clear()
+ {
+ IsArc = false;
+ PhySizeWasConfirmed = false;
+
+ ThereIsHeaderError = false;
+ UnexpectedEnd = false;
+ // UnsupportedVersion = false;
+
+ StartHeaderWasRecovered = false;
+ UnsupportedFeatureError = false;
+ UnsupportedFeatureWarning = false;
+
+ /*
+ IsTree = false;
+ ThereAreAltStreams = false;
+ */
+
+ CDatabase::Clear();
+
+ // SecureOffsets.Clear();
+ ArcInfo.Clear();
+ FolderStartFileIndex.Free();
+ FileIndexToFolderIndexMap.Free();
+
+ HeadersSize = 0;
+ PhySize = 0;
+ }
+
+ void FillLinks();
+
+ UInt64 GetFolderStreamPos(CNum folderIndex, unsigned indexInFolder) const
+ {
+ return ArcInfo.DataStartPosition +
+ PackPositions[FoStartPackStreamIndex[folderIndex] + indexInFolder];
+ }
+
+ UInt64 GetFolderFullPackSize(CNum folderIndex) const
+ {
+ return
+ PackPositions[FoStartPackStreamIndex[folderIndex + 1]] -
+ PackPositions[FoStartPackStreamIndex[folderIndex]];
+ }
+
+ UInt64 GetFolderPackStreamSize(CNum folderIndex, unsigned streamIndex) const
+ {
+ size_t i = FoStartPackStreamIndex[folderIndex] + streamIndex;
+ return PackPositions[i + 1] - PackPositions[i];
+ }
+
+ UInt64 GetFilePackSize(CNum fileIndex) const
+ {
+ CNum folderIndex = FileIndexToFolderIndexMap[fileIndex];
+ if (folderIndex != kNumNoIndex)
+ if (FolderStartFileIndex[folderIndex] == fileIndex)
+ return GetFolderFullPackSize(folderIndex);
+ return 0;
+ }
+};
+
+const unsigned kNumBufLevelsMax = 4;
+
+struct CInByte2
+{
+ const Byte *_buffer;
+public:
+ size_t _size;
+ size_t _pos;
+
+ size_t GetRem() const { return _size - _pos; }
+ const Byte *GetPtr() const { return _buffer + _pos; }
+ void Init(const Byte *buffer, size_t size)
+ {
+ _buffer = buffer;
+ _size = size;
+ _pos = 0;
+ }
+ Byte ReadByte();
+ void ReadBytes(Byte *data, size_t size);
+ void SkipDataNoCheck(UInt64 size) { _pos += (size_t)size; }
+ void SkipData(UInt64 size);
+
+ void SkipData();
+ void SkipRem() { _pos = _size; }
+ UInt64 ReadNumber();
+ CNum ReadNum();
+ UInt32 ReadUInt32();
+ UInt64 ReadUInt64();
+
+ void ParseFolder(CFolder &folder);
+};
+
+class CStreamSwitch;
+
+const UInt32 kHeaderSize = 32;
+
+class CInArchive
+{
+ friend class CStreamSwitch;
+
+ CMyComPtr<IInStream> _stream;
+
+ unsigned _numInByteBufs;
+ CInByte2 _inByteVector[kNumBufLevelsMax];
+
+ CInByte2 *_inByteBack;
+ bool ThereIsHeaderError;
+
+ UInt64 _arhiveBeginStreamPosition;
+ UInt64 _fileEndPosition;
+
+ Byte _header[kHeaderSize];
+
+ UInt64 HeadersSize;
+
+ bool _useMixerMT;
+
+ void AddByteStream(const Byte *buffer, size_t size);
+
+ void DeleteByteStream(bool needUpdatePos)
+ {
+ _numInByteBufs--;
+ if (_numInByteBufs > 0)
+ {
+ _inByteBack = &_inByteVector[_numInByteBufs - 1];
+ if (needUpdatePos)
+ _inByteBack->_pos += _inByteVector[_numInByteBufs]._pos;
+ }
+ }
+
+ HRESULT FindAndReadSignature(IInStream *stream, const UInt64 *searchHeaderSizeLimit);
+
+ void ReadBytes(Byte *data, size_t size) { _inByteBack->ReadBytes(data, size); }
+ Byte ReadByte() { return _inByteBack->ReadByte(); }
+ UInt64 ReadNumber() { return _inByteBack->ReadNumber(); }
+ CNum ReadNum() { return _inByteBack->ReadNum(); }
+ UInt64 ReadID() { return _inByteBack->ReadNumber(); }
+ UInt32 ReadUInt32() { return _inByteBack->ReadUInt32(); }
+ UInt64 ReadUInt64() { return _inByteBack->ReadUInt64(); }
+ void SkipData(UInt64 size) { _inByteBack->SkipData(size); }
+ void SkipData() { _inByteBack->SkipData(); }
+ void WaitId(UInt64 id);
+
+ void Read_UInt32_Vector(CUInt32DefVector &v);
+
+ void ReadArchiveProperties(CInArchiveInfo &archiveInfo);
+ void ReadHashDigests(unsigned numItems, CUInt32DefVector &crcs);
+
+ void ReadPackInfo(CFolders &f);
+
+ void ReadUnpackInfo(
+ const CObjectVector<CByteBuffer> *dataVector,
+ CFolders &folders);
+
+ void ReadSubStreamsInfo(
+ CFolders &folders,
+ CRecordVector<UInt64> &unpackSizes,
+ CUInt32DefVector &digests);
+
+ void ReadStreamsInfo(
+ const CObjectVector<CByteBuffer> *dataVector,
+ UInt64 &dataOffset,
+ CFolders &folders,
+ CRecordVector<UInt64> &unpackSizes,
+ CUInt32DefVector &digests);
+
+ void ReadBoolVector(unsigned numItems, CBoolVector &v);
+ void ReadBoolVector2(unsigned numItems, CBoolVector &v);
+ void ReadUInt64DefVector(const CObjectVector<CByteBuffer> &dataVector,
+ CUInt64DefVector &v, unsigned numItems);
+ HRESULT ReadAndDecodePackedStreams(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ UInt64 baseOffset, UInt64 &dataOffset,
+ CObjectVector<CByteBuffer> &dataVector
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ );
+ HRESULT ReadHeader(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CDbEx &db
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ );
+ HRESULT ReadDatabase2(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CDbEx &db
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ );
+public:
+ CInArchive(bool useMixerMT):
+ _numInByteBufs(0),
+ _useMixerMT(useMixerMT)
+ {}
+
+ HRESULT Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit); // S_FALSE means is not archive
+ void Close();
+
+ HRESULT ReadDatabase(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CDbEx &db
+ _7Z_DECODER_CRYPRO_VARS_DECL
+ );
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zItem.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zItem.h
new file mode 100644
index 0000000000..90cf98c532
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zItem.h
@@ -0,0 +1,202 @@
+// 7zItem.h
+
+#ifndef __7Z_ITEM_H
+#define __7Z_ITEM_H
+
+#include "../../../Common/MyBuffer.h"
+#include "../../../Common/MyString.h"
+
+#include "../../Common/MethodId.h"
+
+#include "7zHeader.h"
+
+namespace NArchive {
+namespace N7z {
+
+typedef UInt32 CNum;
+const CNum kNumMax = 0x7FFFFFFF;
+const CNum kNumNoIndex = 0xFFFFFFFF;
+
+struct CCoderInfo
+{
+ CMethodId MethodID;
+ CByteBuffer Props;
+ UInt32 NumStreams;
+
+ bool IsSimpleCoder() const { return NumStreams == 1; }
+};
+
+
+struct CBond
+{
+ UInt32 PackIndex;
+ UInt32 UnpackIndex;
+};
+
+
+struct CFolder
+{
+ CLASS_NO_COPY(CFolder)
+public:
+ CObjArray2<CCoderInfo> Coders;
+ CObjArray2<CBond> Bonds;
+ CObjArray2<UInt32> PackStreams;
+
+ CFolder() {}
+
+ bool IsDecodingSupported() const { return Coders.Size() <= 32; }
+
+ int Find_in_PackStreams(UInt32 packStream) const
+ {
+ FOR_VECTOR(i, PackStreams)
+ if (PackStreams[i] == packStream)
+ return i;
+ return -1;
+ }
+
+ int FindBond_for_PackStream(UInt32 packStream) const
+ {
+ FOR_VECTOR(i, Bonds)
+ if (Bonds[i].PackIndex == packStream)
+ return i;
+ return -1;
+ }
+
+ /*
+ int FindBond_for_UnpackStream(UInt32 unpackStream) const
+ {
+ FOR_VECTOR(i, Bonds)
+ if (Bonds[i].UnpackIndex == unpackStream)
+ return i;
+ return -1;
+ }
+
+ int FindOutCoder() const
+ {
+ for (int i = (int)Coders.Size() - 1; i >= 0; i--)
+ if (FindBond_for_UnpackStream(i) < 0)
+ return i;
+ return -1;
+ }
+ */
+
+ bool IsEncrypted() const
+ {
+ FOR_VECTOR(i, Coders)
+ if (Coders[i].MethodID == k_AES)
+ return true;
+ return false;
+ }
+};
+
+
+struct CUInt32DefVector
+{
+ CBoolVector Defs;
+ CRecordVector<UInt32> Vals;
+
+ void ClearAndSetSize(unsigned newSize)
+ {
+ Defs.ClearAndSetSize(newSize);
+ Vals.ClearAndSetSize(newSize);
+ }
+
+ void Clear()
+ {
+ Defs.Clear();
+ Vals.Clear();
+ }
+
+ void ReserveDown()
+ {
+ Defs.ReserveDown();
+ Vals.ReserveDown();
+ }
+
+ bool GetItem(unsigned index, UInt32 &value) const
+ {
+ if (index < Defs.Size() && Defs[index])
+ {
+ value = Vals[index];
+ return true;
+ }
+ value = 0;
+ return false;
+ }
+
+ bool ValidAndDefined(unsigned i) const { return i < Defs.Size() && Defs[i]; }
+
+ bool CheckSize(unsigned size) const { return Defs.Size() == size || Defs.Size() == 0; }
+
+ void SetItem(unsigned index, bool defined, UInt32 value);
+};
+
+
+struct CUInt64DefVector
+{
+ CBoolVector Defs;
+ CRecordVector<UInt64> Vals;
+
+ void Clear()
+ {
+ Defs.Clear();
+ Vals.Clear();
+ }
+
+ void ReserveDown()
+ {
+ Defs.ReserveDown();
+ Vals.ReserveDown();
+ }
+
+ bool GetItem(unsigned index, UInt64 &value) const
+ {
+ if (index < Defs.Size() && Defs[index])
+ {
+ value = Vals[index];
+ return true;
+ }
+ value = 0;
+ return false;
+ }
+
+ bool CheckSize(unsigned size) const { return Defs.Size() == size || Defs.Size() == 0; }
+
+ void SetItem(unsigned index, bool defined, UInt64 value);
+};
+
+
+struct CFileItem
+{
+ UInt64 Size;
+ UInt32 Crc;
+ /*
+ int Parent;
+ bool IsAltStream;
+ */
+ bool HasStream; // Test it !!! it means that there is
+ // stream in some folder. It can be empty stream
+ bool IsDir;
+ bool CrcDefined;
+
+ /*
+ void Clear()
+ {
+ HasStream = true;
+ IsDir = false;
+ CrcDefined = false;
+ }
+
+ CFileItem():
+ // Parent(-1),
+ // IsAltStream(false),
+ HasStream(true),
+ IsDir(false),
+ CrcDefined(false),
+ {}
+ */
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.cpp
new file mode 100644
index 0000000000..5bd3a417f7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.cpp
@@ -0,0 +1,901 @@
+// 7zOut.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/7zCrc.h"
+
+#include "../../../Common/AutoPtr.h"
+
+#include "../../Common/StreamObjects.h"
+
+#include "7zOut.h"
+
+namespace NArchive {
+namespace N7z {
+
+HRESULT COutArchive::WriteSignature()
+{
+ Byte buf[8];
+ memcpy(buf, kSignature, kSignatureSize);
+ buf[kSignatureSize] = kMajorVersion;
+ buf[kSignatureSize + 1] = 4;
+ return WriteDirect(buf, 8);
+}
+
+#ifdef _7Z_VOL
+HRESULT COutArchive::WriteFinishSignature()
+{
+ RINOK(WriteDirect(kFinishSignature, kSignatureSize));
+ CArchiveVersion av;
+ av.Major = kMajorVersion;
+ av.Minor = 2;
+ RINOK(WriteDirectByte(av.Major));
+ return WriteDirectByte(av.Minor);
+}
+#endif
+
+static void SetUInt32(Byte *p, UInt32 d)
+{
+ for (int i = 0; i < 4; i++, d >>= 8)
+ p[i] = (Byte)d;
+}
+
+static void SetUInt64(Byte *p, UInt64 d)
+{
+ for (int i = 0; i < 8; i++, d >>= 8)
+ p[i] = (Byte)d;
+}
+
+HRESULT COutArchive::WriteStartHeader(const CStartHeader &h)
+{
+ Byte buf[24];
+ SetUInt64(buf + 4, h.NextHeaderOffset);
+ SetUInt64(buf + 12, h.NextHeaderSize);
+ SetUInt32(buf + 20, h.NextHeaderCRC);
+ SetUInt32(buf, CrcCalc(buf + 4, 20));
+ return WriteDirect(buf, 24);
+}
+
+#ifdef _7Z_VOL
+HRESULT COutArchive::WriteFinishHeader(const CFinishHeader &h)
+{
+ CCRC crc;
+ crc.UpdateUInt64(h.NextHeaderOffset);
+ crc.UpdateUInt64(h.NextHeaderSize);
+ crc.UpdateUInt32(h.NextHeaderCRC);
+ crc.UpdateUInt64(h.ArchiveStartOffset);
+ crc.UpdateUInt64(h.AdditionalStartBlockSize);
+ RINOK(WriteDirectUInt32(crc.GetDigest()));
+ RINOK(WriteDirectUInt64(h.NextHeaderOffset));
+ RINOK(WriteDirectUInt64(h.NextHeaderSize));
+ RINOK(WriteDirectUInt32(h.NextHeaderCRC));
+ RINOK(WriteDirectUInt64(h.ArchiveStartOffset));
+ return WriteDirectUInt64(h.AdditionalStartBlockSize);
+}
+#endif
+
+HRESULT COutArchive::Create(ISequentialOutStream *stream, bool endMarker)
+{
+ Close();
+ #ifdef _7Z_VOL
+ // endMarker = false;
+ _endMarker = endMarker;
+ #endif
+ SeqStream = stream;
+ if (!endMarker)
+ {
+ SeqStream.QueryInterface(IID_IOutStream, &Stream);
+ if (!Stream)
+ {
+ return E_NOTIMPL;
+ // endMarker = true;
+ }
+ }
+ #ifdef _7Z_VOL
+ if (endMarker)
+ {
+ /*
+ CStartHeader sh;
+ sh.NextHeaderOffset = (UInt32)(Int32)-1;
+ sh.NextHeaderSize = (UInt32)(Int32)-1;
+ sh.NextHeaderCRC = 0;
+ WriteStartHeader(sh);
+ */
+ }
+ else
+ #endif
+ {
+ if (!Stream)
+ return E_FAIL;
+ RINOK(WriteSignature());
+ RINOK(Stream->Seek(0, STREAM_SEEK_CUR, &_prefixHeaderPos));
+ }
+ return S_OK;
+}
+
+void COutArchive::Close()
+{
+ SeqStream.Release();
+ Stream.Release();
+}
+
+HRESULT COutArchive::SkipPrefixArchiveHeader()
+{
+ #ifdef _7Z_VOL
+ if (_endMarker)
+ return S_OK;
+ #endif
+ Byte buf[24];
+ memset(buf, 0, 24);
+ return WriteDirect(buf, 24);
+}
+
+UInt64 COutArchive::GetPos() const
+{
+ if (_countMode)
+ return _countSize;
+ if (_writeToStream)
+ return _outByte.GetProcessedSize();
+ return _outByte2.GetPos();
+}
+
+void COutArchive::WriteBytes(const void *data, size_t size)
+{
+ if (_countMode)
+ _countSize += size;
+ else if (_writeToStream)
+ {
+ _outByte.WriteBytes(data, size);
+ _crc = CrcUpdate(_crc, data, size);
+ }
+ else
+ _outByte2.WriteBytes(data, size);
+}
+
+void COutArchive::WriteByte(Byte b)
+{
+ if (_countMode)
+ _countSize++;
+ else if (_writeToStream)
+ {
+ _outByte.WriteByte(b);
+ _crc = CRC_UPDATE_BYTE(_crc, b);
+ }
+ else
+ _outByte2.WriteByte(b);
+}
+
+void COutArchive::WriteUInt32(UInt32 value)
+{
+ for (int i = 0; i < 4; i++)
+ {
+ WriteByte((Byte)value);
+ value >>= 8;
+ }
+}
+
+void COutArchive::WriteUInt64(UInt64 value)
+{
+ for (int i = 0; i < 8; i++)
+ {
+ WriteByte((Byte)value);
+ value >>= 8;
+ }
+}
+
+void COutArchive::WriteNumber(UInt64 value)
+{
+ Byte firstByte = 0;
+ Byte mask = 0x80;
+ int i;
+ for (i = 0; i < 8; i++)
+ {
+ if (value < ((UInt64(1) << ( 7 * (i + 1)))))
+ {
+ firstByte |= Byte(value >> (8 * i));
+ break;
+ }
+ firstByte |= mask;
+ mask >>= 1;
+ }
+ WriteByte(firstByte);
+ for (; i > 0; i--)
+ {
+ WriteByte((Byte)value);
+ value >>= 8;
+ }
+}
+
+static UInt32 GetBigNumberSize(UInt64 value)
+{
+ int i;
+ for (i = 1; i < 9; i++)
+ if (value < (((UInt64)1 << (i * 7))))
+ break;
+ return i;
+}
+
+#ifdef _7Z_VOL
+UInt32 COutArchive::GetVolHeadersSize(UInt64 dataSize, int nameLength, bool props)
+{
+ UInt32 result = GetBigNumberSize(dataSize) * 2 + 41;
+ if (nameLength != 0)
+ {
+ nameLength = (nameLength + 1) * 2;
+ result += nameLength + GetBigNumberSize(nameLength) + 2;
+ }
+ if (props)
+ {
+ result += 20;
+ }
+ if (result >= 128)
+ result++;
+ result += kSignatureSize + 2 + kFinishHeaderSize;
+ return result;
+}
+
+UInt64 COutArchive::GetVolPureSize(UInt64 volSize, int nameLength, bool props)
+{
+ UInt32 headersSizeBase = COutArchive::GetVolHeadersSize(1, nameLength, props);
+ int testSize;
+ if (volSize > headersSizeBase)
+ testSize = volSize - headersSizeBase;
+ else
+ testSize = 1;
+ UInt32 headersSize = COutArchive::GetVolHeadersSize(testSize, nameLength, props);
+ UInt64 pureSize = 1;
+ if (volSize > headersSize)
+ pureSize = volSize - headersSize;
+ return pureSize;
+}
+#endif
+
+void COutArchive::WriteFolder(const CFolder &folder)
+{
+ WriteNumber(folder.Coders.Size());
+ unsigned i;
+
+ for (i = 0; i < folder.Coders.Size(); i++)
+ {
+ const CCoderInfo &coder = folder.Coders[i];
+ {
+ UInt64 id = coder.MethodID;
+ unsigned idSize;
+ for (idSize = 1; idSize < sizeof(id); idSize++)
+ if ((id >> (8 * idSize)) == 0)
+ break;
+ idSize &= 0xF;
+ Byte temp[16];
+ for (unsigned t = idSize; t != 0; t--, id >>= 8)
+ temp[t] = (Byte)(id & 0xFF);
+
+ Byte b = (Byte)(idSize);
+ bool isComplex = !coder.IsSimpleCoder();
+ b |= (isComplex ? 0x10 : 0);
+
+ size_t propsSize = coder.Props.Size();
+ b |= ((propsSize != 0) ? 0x20 : 0);
+ temp[0] = b;
+ WriteBytes(temp, idSize + 1);
+ if (isComplex)
+ {
+ WriteNumber(coder.NumStreams);
+ WriteNumber(1); // NumOutStreams;
+ }
+ if (propsSize == 0)
+ continue;
+ WriteNumber(propsSize);
+ WriteBytes(coder.Props, propsSize);
+ }
+ }
+
+ for (i = 0; i < folder.Bonds.Size(); i++)
+ {
+ const CBond &bond = folder.Bonds[i];
+ WriteNumber(bond.PackIndex);
+ WriteNumber(bond.UnpackIndex);
+ }
+
+ if (folder.PackStreams.Size() > 1)
+ for (i = 0; i < folder.PackStreams.Size(); i++)
+ WriteNumber(folder.PackStreams[i]);
+}
+
+void COutArchive::WriteBoolVector(const CBoolVector &boolVector)
+{
+ Byte b = 0;
+ Byte mask = 0x80;
+ FOR_VECTOR (i, boolVector)
+ {
+ if (boolVector[i])
+ b |= mask;
+ mask >>= 1;
+ if (mask == 0)
+ {
+ WriteByte(b);
+ mask = 0x80;
+ b = 0;
+ }
+ }
+ if (mask != 0x80)
+ WriteByte(b);
+}
+
+static inline unsigned Bv_GetSizeInBytes(const CBoolVector &v) { return ((unsigned)v.Size() + 7) / 8; }
+
+void COutArchive::WritePropBoolVector(Byte id, const CBoolVector &boolVector)
+{
+ WriteByte(id);
+ WriteNumber(Bv_GetSizeInBytes(boolVector));
+ WriteBoolVector(boolVector);
+}
+
+unsigned BoolVector_CountSum(const CBoolVector &v);
+
+void COutArchive::WriteHashDigests(const CUInt32DefVector &digests)
+{
+ const unsigned numDefined = BoolVector_CountSum(digests.Defs);
+ if (numDefined == 0)
+ return;
+
+ WriteByte(NID::kCRC);
+ if (numDefined == digests.Defs.Size())
+ WriteByte(1);
+ else
+ {
+ WriteByte(0);
+ WriteBoolVector(digests.Defs);
+ }
+
+ for (unsigned i = 0; i < digests.Defs.Size(); i++)
+ if (digests.Defs[i])
+ WriteUInt32(digests.Vals[i]);
+}
+
+void COutArchive::WritePackInfo(
+ UInt64 dataOffset,
+ const CRecordVector<UInt64> &packSizes,
+ const CUInt32DefVector &packCRCs)
+{
+ if (packSizes.IsEmpty())
+ return;
+ WriteByte(NID::kPackInfo);
+ WriteNumber(dataOffset);
+ WriteNumber(packSizes.Size());
+ WriteByte(NID::kSize);
+ FOR_VECTOR (i, packSizes)
+ WriteNumber(packSizes[i]);
+
+ WriteHashDigests(packCRCs);
+
+ WriteByte(NID::kEnd);
+}
+
+void COutArchive::WriteUnpackInfo(const CObjectVector<CFolder> &folders, const COutFolders &outFolders)
+{
+ if (folders.IsEmpty())
+ return;
+
+ WriteByte(NID::kUnpackInfo);
+
+ WriteByte(NID::kFolder);
+ WriteNumber(folders.Size());
+ {
+ WriteByte(0);
+ FOR_VECTOR (i, folders)
+ WriteFolder(folders[i]);
+ }
+
+ WriteByte(NID::kCodersUnpackSize);
+ FOR_VECTOR (i, outFolders.CoderUnpackSizes)
+ WriteNumber(outFolders.CoderUnpackSizes[i]);
+
+ WriteHashDigests(outFolders.FolderUnpackCRCs);
+
+ WriteByte(NID::kEnd);
+}
+
+void COutArchive::WriteSubStreamsInfo(const CObjectVector<CFolder> &folders,
+ const COutFolders &outFolders,
+ const CRecordVector<UInt64> &unpackSizes,
+ const CUInt32DefVector &digests)
+{
+ const CRecordVector<CNum> &numUnpackStreamsInFolders = outFolders.NumUnpackStreamsVector;
+ WriteByte(NID::kSubStreamsInfo);
+
+ unsigned i;
+ for (i = 0; i < numUnpackStreamsInFolders.Size(); i++)
+ if (numUnpackStreamsInFolders[i] != 1)
+ {
+ WriteByte(NID::kNumUnpackStream);
+ for (i = 0; i < numUnpackStreamsInFolders.Size(); i++)
+ WriteNumber(numUnpackStreamsInFolders[i]);
+ break;
+ }
+
+ for (i = 0; i < numUnpackStreamsInFolders.Size(); i++)
+ if (numUnpackStreamsInFolders[i] > 1)
+ {
+ WriteByte(NID::kSize);
+ CNum index = 0;
+ for (i = 0; i < numUnpackStreamsInFolders.Size(); i++)
+ {
+ CNum num = numUnpackStreamsInFolders[i];
+ for (CNum j = 0; j < num; j++)
+ {
+ if (j + 1 != num)
+ WriteNumber(unpackSizes[index]);
+ index++;
+ }
+ }
+ break;
+ }
+
+ CUInt32DefVector digests2;
+
+ unsigned digestIndex = 0;
+ for (i = 0; i < folders.Size(); i++)
+ {
+ unsigned numSubStreams = (unsigned)numUnpackStreamsInFolders[i];
+ if (numSubStreams == 1 && outFolders.FolderUnpackCRCs.ValidAndDefined(i))
+ digestIndex++;
+ else
+ for (unsigned j = 0; j < numSubStreams; j++, digestIndex++)
+ {
+ digests2.Defs.Add(digests.Defs[digestIndex]);
+ digests2.Vals.Add(digests.Vals[digestIndex]);
+ }
+ }
+ WriteHashDigests(digests2);
+ WriteByte(NID::kEnd);
+}
+
+// 7-Zip 4.50 - 4.58 contain BUG, so they do not support .7z archives with Unknown field.
+
+void COutArchive::SkipToAligned(unsigned pos, unsigned alignShifts)
+{
+ if (!_useAlign)
+ return;
+
+ const unsigned alignSize = (unsigned)1 << alignShifts;
+ pos += (unsigned)GetPos();
+ pos &= (alignSize - 1);
+ if (pos == 0)
+ return;
+ unsigned skip = alignSize - pos;
+ if (skip < 2)
+ skip += alignSize;
+ skip -= 2;
+ WriteByte(NID::kDummy);
+ WriteByte((Byte)skip);
+ for (unsigned i = 0; i < skip; i++)
+ WriteByte(0);
+}
+
+void COutArchive::WriteAlignedBools(const CBoolVector &v, unsigned numDefined, Byte type, unsigned itemSizeShifts)
+{
+ const unsigned bvSize = (numDefined == v.Size()) ? 0 : Bv_GetSizeInBytes(v);
+ const UInt64 dataSize = ((UInt64)numDefined << itemSizeShifts) + bvSize + 2;
+ SkipToAligned(3 + (unsigned)bvSize + (unsigned)GetBigNumberSize(dataSize), itemSizeShifts);
+
+ WriteByte(type);
+ WriteNumber(dataSize);
+ if (numDefined == v.Size())
+ WriteByte(1);
+ else
+ {
+ WriteByte(0);
+ WriteBoolVector(v);
+ }
+ WriteByte(0); // 0 means no switching to external stream
+}
+
+void COutArchive::WriteUInt64DefVector(const CUInt64DefVector &v, Byte type)
+{
+ const unsigned numDefined = BoolVector_CountSum(v.Defs);
+ if (numDefined == 0)
+ return;
+
+ WriteAlignedBools(v.Defs, numDefined, type, 3);
+
+ for (unsigned i = 0; i < v.Defs.Size(); i++)
+ if (v.Defs[i])
+ WriteUInt64(v.Vals[i]);
+}
+
+HRESULT COutArchive::EncodeStream(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CEncoder &encoder, const CByteBuffer &data,
+ CRecordVector<UInt64> &packSizes, CObjectVector<CFolder> &folders, COutFolders &outFolders)
+{
+ CBufInStream *streamSpec = new CBufInStream;
+ CMyComPtr<ISequentialInStream> stream = streamSpec;
+ streamSpec->Init(data, data.Size());
+ outFolders.FolderUnpackCRCs.Defs.Add(true);
+ outFolders.FolderUnpackCRCs.Vals.Add(CrcCalc(data, data.Size()));
+ // outFolders.NumUnpackStreamsVector.Add(1);
+ UInt64 dataSize64 = data.Size();
+ UInt64 unpackSize = data.Size();
+ RINOK(encoder.Encode(
+ EXTERNAL_CODECS_LOC_VARS
+ stream,
+ // NULL,
+ &dataSize64,
+ folders.AddNew(), outFolders.CoderUnpackSizes, unpackSize, SeqStream, packSizes, NULL))
+ return S_OK;
+}
+
+void COutArchive::WriteHeader(
+ const CArchiveDatabaseOut &db,
+ // const CHeaderOptions &headerOptions,
+ UInt64 &headerOffset)
+{
+ /*
+ bool thereIsSecure = (db.SecureBuf.Size() != 0);
+ */
+ _useAlign = true;
+
+ {
+ UInt64 packSize = 0;
+ FOR_VECTOR (i, db.PackSizes)
+ packSize += db.PackSizes[i];
+ headerOffset = packSize;
+ }
+
+
+ WriteByte(NID::kHeader);
+
+ // Archive Properties
+
+ if (db.Folders.Size() > 0)
+ {
+ WriteByte(NID::kMainStreamsInfo);
+ WritePackInfo(0, db.PackSizes, db.PackCRCs);
+ WriteUnpackInfo(db.Folders, (const COutFolders &)db);
+
+ CRecordVector<UInt64> unpackSizes;
+ CUInt32DefVector digests;
+ FOR_VECTOR (i, db.Files)
+ {
+ const CFileItem &file = db.Files[i];
+ if (!file.HasStream)
+ continue;
+ unpackSizes.Add(file.Size);
+ digests.Defs.Add(file.CrcDefined);
+ digests.Vals.Add(file.Crc);
+ }
+
+ WriteSubStreamsInfo(db.Folders, (const COutFolders &)db, unpackSizes, digests);
+ WriteByte(NID::kEnd);
+ }
+
+ if (db.Files.IsEmpty())
+ {
+ WriteByte(NID::kEnd);
+ return;
+ }
+
+ WriteByte(NID::kFilesInfo);
+ WriteNumber(db.Files.Size());
+
+ {
+ /* ---------- Empty Streams ---------- */
+ CBoolVector emptyStreamVector;
+ emptyStreamVector.ClearAndSetSize(db.Files.Size());
+ unsigned numEmptyStreams = 0;
+ {
+ FOR_VECTOR (i, db.Files)
+ if (db.Files[i].HasStream)
+ emptyStreamVector[i] = false;
+ else
+ {
+ emptyStreamVector[i] = true;
+ numEmptyStreams++;
+ }
+ }
+
+ if (numEmptyStreams != 0)
+ {
+ WritePropBoolVector(NID::kEmptyStream, emptyStreamVector);
+
+ CBoolVector emptyFileVector, antiVector;
+ emptyFileVector.ClearAndSetSize(numEmptyStreams);
+ antiVector.ClearAndSetSize(numEmptyStreams);
+ bool thereAreEmptyFiles = false, thereAreAntiItems = false;
+ unsigned cur = 0;
+
+ FOR_VECTOR (i, db.Files)
+ {
+ const CFileItem &file = db.Files[i];
+ if (file.HasStream)
+ continue;
+ emptyFileVector[cur] = !file.IsDir;
+ if (!file.IsDir)
+ thereAreEmptyFiles = true;
+ bool isAnti = db.IsItemAnti(i);
+ antiVector[cur] = isAnti;
+ if (isAnti)
+ thereAreAntiItems = true;
+ cur++;
+ }
+
+ if (thereAreEmptyFiles)
+ WritePropBoolVector(NID::kEmptyFile, emptyFileVector);
+ if (thereAreAntiItems)
+ WritePropBoolVector(NID::kAnti, antiVector);
+ }
+ }
+
+
+ {
+ /* ---------- Names ---------- */
+
+ unsigned numDefined = 0;
+ size_t namesDataSize = 0;
+ FOR_VECTOR (i, db.Files)
+ {
+ const UString &name = db.Names[i];
+ if (!name.IsEmpty())
+ numDefined++;
+ namesDataSize += (name.Len() + 1) * 2;
+ }
+
+ if (numDefined > 0)
+ {
+ namesDataSize++;
+ SkipToAligned(2 + GetBigNumberSize(namesDataSize), 4);
+
+ WriteByte(NID::kName);
+ WriteNumber(namesDataSize);
+ WriteByte(0);
+ FOR_VECTOR (i, db.Files)
+ {
+ const UString &name = db.Names[i];
+ for (unsigned t = 0; t <= name.Len(); t++)
+ {
+ wchar_t c = name[t];
+ WriteByte((Byte)c);
+ WriteByte((Byte)(c >> 8));
+ }
+ }
+ }
+ }
+
+ /* if (headerOptions.WriteCTime) */ WriteUInt64DefVector(db.CTime, NID::kCTime);
+ /* if (headerOptions.WriteATime) */ WriteUInt64DefVector(db.ATime, NID::kATime);
+ /* if (headerOptions.WriteMTime) */ WriteUInt64DefVector(db.MTime, NID::kMTime);
+ WriteUInt64DefVector(db.StartPos, NID::kStartPos);
+
+ {
+ /* ---------- Write Attrib ---------- */
+ const unsigned numDefined = BoolVector_CountSum(db.Attrib.Defs);
+
+ if (numDefined != 0)
+ {
+ WriteAlignedBools(db.Attrib.Defs, numDefined, NID::kWinAttrib, 2);
+ FOR_VECTOR (i, db.Attrib.Defs)
+ {
+ if (db.Attrib.Defs[i])
+ WriteUInt32(db.Attrib.Vals[i]);
+ }
+ }
+ }
+
+ /*
+ {
+ // ---------- Write IsAux ----------
+ if (BoolVector_CountSum(db.IsAux) != 0)
+ WritePropBoolVector(NID::kIsAux, db.IsAux);
+ }
+
+ {
+ // ---------- Write Parent ----------
+ CBoolVector boolVector;
+ boolVector.Reserve(db.Files.Size());
+ unsigned numIsDir = 0;
+ unsigned numParentLinks = 0;
+ for (i = 0; i < db.Files.Size(); i++)
+ {
+ const CFileItem &file = db.Files[i];
+ bool defined = !file.IsAltStream;
+ boolVector.Add(defined);
+ if (defined)
+ numIsDir++;
+ if (file.Parent >= 0)
+ numParentLinks++;
+ }
+ if (numParentLinks > 0)
+ {
+ // WriteAlignedBools(boolVector, numDefined, NID::kParent, 2);
+ const unsigned bvSize = (numIsDir == boolVector.Size()) ? 0 : Bv_GetSizeInBytes(boolVector);
+ const UInt64 dataSize = (UInt64)db.Files.Size() * 4 + bvSize + 1;
+ SkipToAligned(2 + (unsigned)bvSize + (unsigned)GetBigNumberSize(dataSize), 2);
+
+ WriteByte(NID::kParent);
+ WriteNumber(dataSize);
+ if (numIsDir == boolVector.Size())
+ WriteByte(1);
+ else
+ {
+ WriteByte(0);
+ WriteBoolVector(boolVector);
+ }
+ for (i = 0; i < db.Files.Size(); i++)
+ {
+ const CFileItem &file = db.Files[i];
+ // if (file.Parent >= 0)
+ WriteUInt32(file.Parent);
+ }
+ }
+ }
+
+ if (thereIsSecure)
+ {
+ UInt64 secureDataSize = 1 + 4 +
+ db.SecureBuf.Size() +
+ db.SecureSizes.Size() * 4;
+ // secureDataSize += db.SecureIDs.Size() * 4;
+ for (i = 0; i < db.SecureIDs.Size(); i++)
+ secureDataSize += GetBigNumberSize(db.SecureIDs[i]);
+ SkipToAligned(2 + GetBigNumberSize(secureDataSize), 2);
+ WriteByte(NID::kNtSecure);
+ WriteNumber(secureDataSize);
+ WriteByte(0);
+ WriteUInt32(db.SecureSizes.Size());
+ for (i = 0; i < db.SecureSizes.Size(); i++)
+ WriteUInt32(db.SecureSizes[i]);
+ WriteBytes(db.SecureBuf, db.SecureBuf.Size());
+ for (i = 0; i < db.SecureIDs.Size(); i++)
+ {
+ WriteNumber(db.SecureIDs[i]);
+ // WriteUInt32(db.SecureIDs[i]);
+ }
+ }
+ */
+
+ WriteByte(NID::kEnd); // for files
+ WriteByte(NID::kEnd); // for headers
+}
+
+HRESULT COutArchive::WriteDatabase(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const CArchiveDatabaseOut &db,
+ const CCompressionMethodMode *options,
+ const CHeaderOptions &headerOptions)
+{
+ if (!db.CheckNumFiles())
+ return E_FAIL;
+
+ UInt64 headerOffset;
+ UInt32 headerCRC;
+ UInt64 headerSize;
+ if (db.IsEmpty())
+ {
+ headerSize = 0;
+ headerOffset = 0;
+ headerCRC = CrcCalc(0, 0);
+ }
+ else
+ {
+ bool encodeHeaders = false;
+ if (options != 0)
+ if (options->IsEmpty())
+ options = 0;
+ if (options != 0)
+ if (options->PasswordIsDefined || headerOptions.CompressMainHeader)
+ encodeHeaders = true;
+
+ _outByte.SetStream(SeqStream);
+ _outByte.Init();
+ _crc = CRC_INIT_VAL;
+ _countMode = encodeHeaders;
+ _writeToStream = true;
+ _countSize = 0;
+ WriteHeader(db, /* headerOptions, */ headerOffset);
+
+ if (encodeHeaders)
+ {
+ CByteBuffer buf(_countSize);
+ _outByte2.Init((Byte *)buf, _countSize);
+
+ _countMode = false;
+ _writeToStream = false;
+ WriteHeader(db, /* headerOptions, */ headerOffset);
+
+ if (_countSize != _outByte2.GetPos())
+ return E_FAIL;
+
+ CCompressionMethodMode encryptOptions;
+ encryptOptions.PasswordIsDefined = options->PasswordIsDefined;
+ encryptOptions.Password = options->Password;
+ CEncoder encoder(headerOptions.CompressMainHeader ? *options : encryptOptions);
+ CRecordVector<UInt64> packSizes;
+ CObjectVector<CFolder> folders;
+ COutFolders outFolders;
+
+ RINOK(EncodeStream(
+ EXTERNAL_CODECS_LOC_VARS
+ encoder, buf,
+ packSizes, folders, outFolders));
+
+ _writeToStream = true;
+
+ if (folders.Size() == 0)
+ throw 1;
+
+ WriteID(NID::kEncodedHeader);
+ WritePackInfo(headerOffset, packSizes, CUInt32DefVector());
+ WriteUnpackInfo(folders, outFolders);
+ WriteByte(NID::kEnd);
+ FOR_VECTOR (i, packSizes)
+ headerOffset += packSizes[i];
+ }
+ RINOK(_outByte.Flush());
+ headerCRC = CRC_GET_DIGEST(_crc);
+ headerSize = _outByte.GetProcessedSize();
+ }
+ #ifdef _7Z_VOL
+ if (_endMarker)
+ {
+ CFinishHeader h;
+ h.NextHeaderSize = headerSize;
+ h.NextHeaderCRC = headerCRC;
+ h.NextHeaderOffset =
+ UInt64(0) - (headerSize +
+ 4 + kFinishHeaderSize);
+ h.ArchiveStartOffset = h.NextHeaderOffset - headerOffset;
+ h.AdditionalStartBlockSize = 0;
+ RINOK(WriteFinishHeader(h));
+ return WriteFinishSignature();
+ }
+ else
+ #endif
+ {
+ CStartHeader h;
+ h.NextHeaderSize = headerSize;
+ h.NextHeaderCRC = headerCRC;
+ h.NextHeaderOffset = headerOffset;
+ RINOK(Stream->Seek(_prefixHeaderPos, STREAM_SEEK_SET, NULL));
+ return WriteStartHeader(h);
+ }
+}
+
+void CUInt32DefVector::SetItem(unsigned index, bool defined, UInt32 value)
+{
+ while (index >= Defs.Size())
+ Defs.Add(false);
+ Defs[index] = defined;
+ if (!defined)
+ return;
+ while (index >= Vals.Size())
+ Vals.Add(0);
+ Vals[index] = value;
+}
+
+void CUInt64DefVector::SetItem(unsigned index, bool defined, UInt64 value)
+{
+ while (index >= Defs.Size())
+ Defs.Add(false);
+ Defs[index] = defined;
+ if (!defined)
+ return;
+ while (index >= Vals.Size())
+ Vals.Add(0);
+ Vals[index] = value;
+}
+
+void CArchiveDatabaseOut::AddFile(const CFileItem &file, const CFileItem2 &file2, const UString &name)
+{
+ unsigned index = Files.Size();
+ CTime.SetItem(index, file2.CTimeDefined, file2.CTime);
+ ATime.SetItem(index, file2.ATimeDefined, file2.ATime);
+ MTime.SetItem(index, file2.MTimeDefined, file2.MTime);
+ StartPos.SetItem(index, file2.StartPosDefined, file2.StartPos);
+ Attrib.SetItem(index, file2.AttribDefined, file2.Attrib);
+ SetItem_Anti(index, file2.IsAnti);
+ // SetItem_Aux(index, file2.IsAux);
+ Names.Add(name);
+ Files.Add(file);
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.h
new file mode 100644
index 0000000000..12e965f861
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zOut.h
@@ -0,0 +1,335 @@
+// 7zOut.h
+
+#ifndef __7Z_OUT_H
+#define __7Z_OUT_H
+
+#include "7zCompressionMode.h"
+#include "7zEncode.h"
+#include "7zHeader.h"
+#include "7zItem.h"
+
+#include "../../Common/OutBuffer.h"
+#include "../../Common/StreamUtils.h"
+
+namespace NArchive {
+namespace N7z {
+
+class CWriteBufferLoc
+{
+ Byte *_data;
+ size_t _size;
+ size_t _pos;
+public:
+ CWriteBufferLoc(): _size(0), _pos(0) {}
+ void Init(Byte *data, size_t size)
+ {
+ _data = data;
+ _size = size;
+ _pos = 0;
+ }
+ void WriteBytes(const void *data, size_t size)
+ {
+ if (size == 0)
+ return;
+ if (size > _size - _pos)
+ throw 1;
+ memcpy(_data + _pos, data, size);
+ _pos += size;
+ }
+ void WriteByte(Byte b)
+ {
+ if (_size == _pos)
+ throw 1;
+ _data[_pos++] = b;
+ }
+ size_t GetPos() const { return _pos; }
+};
+
+
+struct CHeaderOptions
+{
+ bool CompressMainHeader;
+ /*
+ bool WriteCTime;
+ bool WriteATime;
+ bool WriteMTime;
+ */
+
+ CHeaderOptions():
+ CompressMainHeader(true)
+ /*
+ , WriteCTime(false)
+ , WriteATime(false)
+ , WriteMTime(true)
+ */
+ {}
+};
+
+
+struct CFileItem2
+{
+ UInt64 CTime;
+ UInt64 ATime;
+ UInt64 MTime;
+ UInt64 StartPos;
+ UInt32 Attrib;
+
+ bool CTimeDefined;
+ bool ATimeDefined;
+ bool MTimeDefined;
+ bool StartPosDefined;
+ bool AttribDefined;
+ bool IsAnti;
+ // bool IsAux;
+
+ /*
+ void Init()
+ {
+ CTimeDefined = false;
+ ATimeDefined = false;
+ MTimeDefined = false;
+ StartPosDefined = false;
+ AttribDefined = false;
+ IsAnti = false;
+ // IsAux = false;
+ }
+ */
+};
+
+
+struct COutFolders
+{
+ CUInt32DefVector FolderUnpackCRCs; // Now we use it for headers only.
+
+ CRecordVector<CNum> NumUnpackStreamsVector;
+ CRecordVector<UInt64> CoderUnpackSizes; // including unpack sizes of bond coders
+
+ void OutFoldersClear()
+ {
+ FolderUnpackCRCs.Clear();
+ NumUnpackStreamsVector.Clear();
+ CoderUnpackSizes.Clear();
+ }
+
+ void OutFoldersReserveDown()
+ {
+ FolderUnpackCRCs.ReserveDown();
+ NumUnpackStreamsVector.ReserveDown();
+ CoderUnpackSizes.ReserveDown();
+ }
+};
+
+
+struct CArchiveDatabaseOut: public COutFolders
+{
+ CRecordVector<UInt64> PackSizes;
+ CUInt32DefVector PackCRCs;
+ CObjectVector<CFolder> Folders;
+
+ CRecordVector<CFileItem> Files;
+ UStringVector Names;
+ CUInt64DefVector CTime;
+ CUInt64DefVector ATime;
+ CUInt64DefVector MTime;
+ CUInt64DefVector StartPos;
+ CUInt32DefVector Attrib;
+ CBoolVector IsAnti;
+
+ /*
+ CBoolVector IsAux;
+
+ CByteBuffer SecureBuf;
+ CRecordVector<UInt32> SecureSizes;
+ CRecordVector<UInt32> SecureIDs;
+
+ void ClearSecure()
+ {
+ SecureBuf.Free();
+ SecureSizes.Clear();
+ SecureIDs.Clear();
+ }
+ */
+
+ void Clear()
+ {
+ OutFoldersClear();
+
+ PackSizes.Clear();
+ PackCRCs.Clear();
+ Folders.Clear();
+
+ Files.Clear();
+ Names.Clear();
+ CTime.Clear();
+ ATime.Clear();
+ MTime.Clear();
+ StartPos.Clear();
+ Attrib.Clear();
+ IsAnti.Clear();
+
+ /*
+ IsAux.Clear();
+ ClearSecure();
+ */
+ }
+
+ void ReserveDown()
+ {
+ OutFoldersReserveDown();
+
+ PackSizes.ReserveDown();
+ PackCRCs.ReserveDown();
+ Folders.ReserveDown();
+
+ Files.ReserveDown();
+ Names.ReserveDown();
+ CTime.ReserveDown();
+ ATime.ReserveDown();
+ MTime.ReserveDown();
+ StartPos.ReserveDown();
+ Attrib.ReserveDown();
+ IsAnti.ReserveDown();
+
+ /*
+ IsAux.ReserveDown();
+ */
+ }
+
+ bool IsEmpty() const
+ {
+ return (
+ PackSizes.IsEmpty() &&
+ NumUnpackStreamsVector.IsEmpty() &&
+ Folders.IsEmpty() &&
+ Files.IsEmpty());
+ }
+
+ bool CheckNumFiles() const
+ {
+ unsigned size = Files.Size();
+ return (
+ CTime.CheckSize(size)
+ && ATime.CheckSize(size)
+ && MTime.CheckSize(size)
+ && StartPos.CheckSize(size)
+ && Attrib.CheckSize(size)
+ && (size == IsAnti.Size() || IsAnti.Size() == 0));
+ }
+
+ bool IsItemAnti(unsigned index) const { return (index < IsAnti.Size() && IsAnti[index]); }
+ // bool IsItemAux(unsigned index) const { return (index < IsAux.Size() && IsAux[index]); }
+
+ void SetItem_Anti(unsigned index, bool isAnti)
+ {
+ while (index >= IsAnti.Size())
+ IsAnti.Add(false);
+ IsAnti[index] = isAnti;
+ }
+ /*
+ void SetItem_Aux(unsigned index, bool isAux)
+ {
+ while (index >= IsAux.Size())
+ IsAux.Add(false);
+ IsAux[index] = isAux;
+ }
+ */
+
+ void AddFile(const CFileItem &file, const CFileItem2 &file2, const UString &name);
+};
+
+
+class COutArchive
+{
+ UInt64 _prefixHeaderPos;
+
+ HRESULT WriteDirect(const void *data, UInt32 size) { return WriteStream(SeqStream, data, size); }
+
+ UInt64 GetPos() const;
+ void WriteBytes(const void *data, size_t size);
+ void WriteBytes(const CByteBuffer &data) { WriteBytes(data, data.Size()); }
+ void WriteByte(Byte b);
+ void WriteUInt32(UInt32 value);
+ void WriteUInt64(UInt64 value);
+ void WriteNumber(UInt64 value);
+ void WriteID(UInt64 value) { WriteNumber(value); }
+
+ void WriteFolder(const CFolder &folder);
+ HRESULT WriteFileHeader(const CFileItem &itemInfo);
+ void WriteBoolVector(const CBoolVector &boolVector);
+ void WritePropBoolVector(Byte id, const CBoolVector &boolVector);
+
+ void WriteHashDigests(const CUInt32DefVector &digests);
+
+ void WritePackInfo(
+ UInt64 dataOffset,
+ const CRecordVector<UInt64> &packSizes,
+ const CUInt32DefVector &packCRCs);
+
+ void WriteUnpackInfo(
+ const CObjectVector<CFolder> &folders,
+ const COutFolders &outFolders);
+
+ void WriteSubStreamsInfo(
+ const CObjectVector<CFolder> &folders,
+ const COutFolders &outFolders,
+ const CRecordVector<UInt64> &unpackSizes,
+ const CUInt32DefVector &digests);
+
+ void SkipToAligned(unsigned pos, unsigned alignShifts);
+ void WriteAlignedBools(const CBoolVector &v, unsigned numDefined, Byte type, unsigned itemSizeShifts);
+ void WriteUInt64DefVector(const CUInt64DefVector &v, Byte type);
+
+ HRESULT EncodeStream(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CEncoder &encoder, const CByteBuffer &data,
+ CRecordVector<UInt64> &packSizes, CObjectVector<CFolder> &folders, COutFolders &outFolders);
+ void WriteHeader(
+ const CArchiveDatabaseOut &db,
+ // const CHeaderOptions &headerOptions,
+ UInt64 &headerOffset);
+
+ bool _countMode;
+ bool _writeToStream;
+ size_t _countSize;
+ UInt32 _crc;
+ COutBuffer _outByte;
+ CWriteBufferLoc _outByte2;
+
+ #ifdef _7Z_VOL
+ bool _endMarker;
+ #endif
+
+ bool _useAlign;
+
+ HRESULT WriteSignature();
+ #ifdef _7Z_VOL
+ HRESULT WriteFinishSignature();
+ #endif
+ HRESULT WriteStartHeader(const CStartHeader &h);
+ #ifdef _7Z_VOL
+ HRESULT WriteFinishHeader(const CFinishHeader &h);
+ #endif
+ CMyComPtr<IOutStream> Stream;
+public:
+
+ COutArchive() { _outByte.Create(1 << 16); }
+ CMyComPtr<ISequentialOutStream> SeqStream;
+ HRESULT Create(ISequentialOutStream *stream, bool endMarker);
+ void Close();
+ HRESULT SkipPrefixArchiveHeader();
+ HRESULT WriteDatabase(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const CArchiveDatabaseOut &db,
+ const CCompressionMethodMode *options,
+ const CHeaderOptions &headerOptions);
+
+ #ifdef _7Z_VOL
+ static UInt32 GetVolHeadersSize(UInt64 dataSize, int nameLength = 0, bool props = false);
+ static UInt64 GetVolPureSize(UInt64 volSize, int nameLength = 0, bool props = false);
+ #endif
+
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.cpp
new file mode 100644
index 0000000000..388ac766c6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.cpp
@@ -0,0 +1,174 @@
+// 7zProperties.cpp
+
+#include "StdAfx.h"
+
+#include "7zProperties.h"
+#include "7zHeader.h"
+#include "7zHandler.h"
+
+// #define _MULTI_PACK
+
+namespace NArchive {
+namespace N7z {
+
+struct CPropMap
+{
+ UInt32 FilePropID;
+ CStatProp StatProp;
+};
+
+static const CPropMap kPropMap[] =
+{
+ { NID::kName, { NULL, kpidPath, VT_BSTR } },
+ { NID::kSize, { NULL, kpidSize, VT_UI8 } },
+ { NID::kPackInfo, { NULL, kpidPackSize, VT_UI8 } },
+
+ #ifdef _MULTI_PACK
+ { 100, { "Pack0", kpidPackedSize0, VT_UI8 } },
+ { 101, { "Pack1", kpidPackedSize1, VT_UI8 } },
+ { 102, { "Pack2", kpidPackedSize2, VT_UI8 } },
+ { 103, { "Pack3", kpidPackedSize3, VT_UI8 } },
+ { 104, { "Pack4", kpidPackedSize4, VT_UI8 } },
+ #endif
+
+ { NID::kCTime, { NULL, kpidCTime, VT_FILETIME } },
+ { NID::kMTime, { NULL, kpidMTime, VT_FILETIME } },
+ { NID::kATime, { NULL, kpidATime, VT_FILETIME } },
+ { NID::kWinAttrib, { NULL, kpidAttrib, VT_UI4 } },
+ { NID::kStartPos, { NULL, kpidPosition, VT_UI8 } },
+
+ { NID::kCRC, { NULL, kpidCRC, VT_UI4 } },
+
+// { NID::kIsAux, { NULL, kpidIsAux, VT_BOOL } },
+ { NID::kAnti, { NULL, kpidIsAnti, VT_BOOL } }
+
+ #ifndef _SFX
+ ,
+ { 97, { NULL, kpidEncrypted, VT_BOOL } },
+ { 98, { NULL, kpidMethod, VT_BSTR } },
+ { 99, { NULL, kpidBlock, VT_UI4 } }
+ #endif
+};
+
+static void CopyOneItem(CRecordVector<UInt64> &src,
+ CRecordVector<UInt64> &dest, UInt32 item)
+{
+ FOR_VECTOR (i, src)
+ if (src[i] == item)
+ {
+ dest.Add(item);
+ src.Delete(i);
+ return;
+ }
+}
+
+static void RemoveOneItem(CRecordVector<UInt64> &src, UInt32 item)
+{
+ FOR_VECTOR (i, src)
+ if (src[i] == item)
+ {
+ src.Delete(i);
+ return;
+ }
+}
+
+static void InsertToHead(CRecordVector<UInt64> &dest, UInt32 item)
+{
+ FOR_VECTOR (i, dest)
+ if (dest[i] == item)
+ {
+ dest.Delete(i);
+ break;
+ }
+ dest.Insert(0, item);
+}
+
+#define COPY_ONE_ITEM(id) CopyOneItem(fileInfoPopIDs, _fileInfoPopIDs, NID::id);
+
+void CHandler::FillPopIDs()
+{
+ _fileInfoPopIDs.Clear();
+
+ #ifdef _7Z_VOL
+ if (_volumes.Size() < 1)
+ return;
+ const CVolume &volume = _volumes.Front();
+ const CArchiveDatabaseEx &_db = volume.Database;
+ #endif
+
+ CRecordVector<UInt64> fileInfoPopIDs = _db.ArcInfo.FileInfoPopIDs;
+
+ RemoveOneItem(fileInfoPopIDs, NID::kEmptyStream);
+ RemoveOneItem(fileInfoPopIDs, NID::kEmptyFile);
+ /*
+ RemoveOneItem(fileInfoPopIDs, NID::kParent);
+ RemoveOneItem(fileInfoPopIDs, NID::kNtSecure);
+ */
+
+ COPY_ONE_ITEM(kName);
+ COPY_ONE_ITEM(kAnti);
+ COPY_ONE_ITEM(kSize);
+ COPY_ONE_ITEM(kPackInfo);
+ COPY_ONE_ITEM(kCTime);
+ COPY_ONE_ITEM(kMTime);
+ COPY_ONE_ITEM(kATime);
+ COPY_ONE_ITEM(kWinAttrib);
+ COPY_ONE_ITEM(kCRC);
+ COPY_ONE_ITEM(kComment);
+
+ _fileInfoPopIDs += fileInfoPopIDs;
+
+ #ifndef _SFX
+ _fileInfoPopIDs.Add(97);
+ _fileInfoPopIDs.Add(98);
+ _fileInfoPopIDs.Add(99);
+ #endif
+
+ #ifdef _MULTI_PACK
+ _fileInfoPopIDs.Add(100);
+ _fileInfoPopIDs.Add(101);
+ _fileInfoPopIDs.Add(102);
+ _fileInfoPopIDs.Add(103);
+ _fileInfoPopIDs.Add(104);
+ #endif
+
+ #ifndef _SFX
+ InsertToHead(_fileInfoPopIDs, NID::kMTime);
+ InsertToHead(_fileInfoPopIDs, NID::kPackInfo);
+ InsertToHead(_fileInfoPopIDs, NID::kSize);
+ InsertToHead(_fileInfoPopIDs, NID::kName);
+ #endif
+}
+
+STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProps)
+{
+ *numProps = _fileInfoPopIDs.Size();
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetPropertyInfo(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType)
+{
+ if (index >= _fileInfoPopIDs.Size())
+ return E_INVALIDARG;
+ UInt64 id = _fileInfoPopIDs[index];
+ for (unsigned i = 0; i < ARRAY_SIZE(kPropMap); i++)
+ {
+ const CPropMap &pr = kPropMap[i];
+ if (pr.FilePropID == id)
+ {
+ const CStatProp &st = pr.StatProp;
+ *propID = st.PropID;
+ *varType = st.vt;
+ /*
+ if (st.lpwstrName)
+ *name = ::SysAllocString(st.lpwstrName);
+ else
+ */
+ *name = NULL;
+ return S_OK;
+ }
+ }
+ return E_INVALIDARG;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.h
new file mode 100644
index 0000000000..7b78130ef5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zProperties.h
@@ -0,0 +1,22 @@
+// 7zProperties.h
+
+#ifndef __7Z_PROPERTIES_H
+#define __7Z_PROPERTIES_H
+
+#include "../../PropID.h"
+
+namespace NArchive {
+namespace N7z {
+
+enum
+{
+ kpidPackedSize0 = kpidUserDefined,
+ kpidPackedSize1,
+ kpidPackedSize2,
+ kpidPackedSize3,
+ kpidPackedSize4
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zRegister.cpp
new file mode 100644
index 0000000000..3e8cfb6645
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zRegister.cpp
@@ -0,0 +1,21 @@
+// 7zRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/RegisterArc.h"
+
+#include "7zHandler.h"
+
+namespace NArchive {
+namespace N7z {
+
+static Byte k_Signature_Dec[kSignatureSize] = {'7' + 1, 'z', 0xBC, 0xAF, 0x27, 0x1C};
+
+REGISTER_ARC_IO_DECREMENT_SIG(
+ "7z", "7z", NULL, 7,
+ k_Signature_Dec,
+ 0,
+ NArcInfoFlags::kFindSignature,
+ NULL);
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.cpp
new file mode 100644
index 0000000000..e9671a87e9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.cpp
@@ -0,0 +1,22 @@
+// 7zSpecStream.cpp
+
+#include "StdAfx.h"
+
+#include "7zSpecStream.h"
+
+STDMETHODIMP CSequentialInStreamSizeCount2::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessedSize;
+ HRESULT result = _stream->Read(data, size, &realProcessedSize);
+ _size += realProcessedSize;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return result;
+}
+
+STDMETHODIMP CSequentialInStreamSizeCount2::GetSubStreamSize(UInt64 subStream, UInt64 *value)
+{
+ if (!_getSubStreamSize)
+ return E_NOTIMPL;
+ return _getSubStreamSize->GetSubStreamSize(subStream, value);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.h
new file mode 100644
index 0000000000..09941287d6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zSpecStream.h
@@ -0,0 +1,35 @@
+// 7zSpecStream.h
+
+#ifndef __7Z_SPEC_STREAM_H
+#define __7Z_SPEC_STREAM_H
+
+#include "../../../Common/MyCom.h"
+
+#include "../../ICoder.h"
+
+class CSequentialInStreamSizeCount2:
+ public ISequentialInStream,
+ public ICompressGetSubStreamSize,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialInStream> _stream;
+ CMyComPtr<ICompressGetSubStreamSize> _getSubStreamSize;
+ UInt64 _size;
+public:
+ void Init(ISequentialInStream *stream)
+ {
+ _size = 0;
+ _getSubStreamSize.Release();
+ _stream = stream;
+ _stream.QueryInterface(IID_ICompressGetSubStreamSize, &_getSubStreamSize);
+ }
+ UInt64 GetSize() const { return _size; }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, ICompressGetSubStreamSize)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+
+ STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.cpp
new file mode 100644
index 0000000000..44de9ac4fc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.cpp
@@ -0,0 +1,2497 @@
+// 7zUpdate.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/CpuArch.h"
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../Common/CreateCoder.h"
+#include "../../Common/LimitedStreams.h"
+#include "../../Common/ProgressUtils.h"
+
+#include "../../Compress/CopyCoder.h"
+
+#include "../Common/ItemNameUtils.h"
+
+#include "7zDecode.h"
+#include "7zEncode.h"
+#include "7zFolderInStream.h"
+#include "7zHandler.h"
+#include "7zOut.h"
+#include "7zUpdate.h"
+
+namespace NArchive {
+namespace N7z {
+
+
+#define k_X86 k_BCJ
+
+struct CFilterMode
+{
+ UInt32 Id;
+ UInt32 Delta;
+
+ CFilterMode(): Id(0), Delta(0) {}
+
+ void SetDelta()
+ {
+ if (Id == k_IA64)
+ Delta = 16;
+ else if (Id == k_ARM || Id == k_PPC || Id == k_SPARC)
+ Delta = 4;
+ else if (Id == k_ARMT)
+ Delta = 2;
+ else
+ Delta = 0;
+ }
+};
+
+
+/* ---------- PE ---------- */
+
+#define MZ_SIG 0x5A4D
+
+#define PE_SIG 0x00004550
+#define PE_OptHeader_Magic_32 0x10B
+#define PE_OptHeader_Magic_64 0x20B
+#define PE_SectHeaderSize 40
+#define PE_SECT_EXECUTE 0x20000000
+
+static int Parse_EXE(const Byte *buf, size_t size, CFilterMode *filterMode)
+{
+ if (size < 512 || GetUi16(buf) != MZ_SIG)
+ return 0;
+
+ const Byte *p;
+ UInt32 peOffset, optHeaderSize, filterId;
+
+ peOffset = GetUi32(buf + 0x3C);
+ if (peOffset >= 0x1000 || peOffset + 512 > size || (peOffset & 7) != 0)
+ return 0;
+ p = buf + peOffset;
+ if (GetUi32(p) != PE_SIG)
+ return 0;
+ p += 4;
+
+ switch (GetUi16(p))
+ {
+ case 0x014C:
+ case 0x8664: filterId = k_X86; break;
+
+ /*
+ IMAGE_FILE_MACHINE_ARM 0x01C0 // ARM LE
+ IMAGE_FILE_MACHINE_THUMB 0x01C2 // ARM Thumb / Thumb-2 LE
+ IMAGE_FILE_MACHINE_ARMNT 0x01C4 // ARM Thumb-2, LE
+ Note: We use ARM filter for 0x01C2. (WinCE 5 - 0x01C2) files mostly contain ARM code (not Thumb/Thumb-2).
+ */
+
+ case 0x01C0: // WinCE old
+ case 0x01C2: filterId = k_ARM; break; // WinCE new
+ case 0x01C4: filterId = k_ARMT; break; // WinRT
+
+ case 0x0200: filterId = k_IA64; break;
+ default: return 0;
+ }
+
+ optHeaderSize = GetUi16(p + 16);
+ if (optHeaderSize > (1 << 10))
+ return 0;
+
+ p += 20; /* headerSize */
+
+ switch (GetUi16(p))
+ {
+ case PE_OptHeader_Magic_32:
+ case PE_OptHeader_Magic_64:
+ break;
+ default:
+ return 0;
+ }
+
+ filterMode->Id = filterId;
+ return 1;
+}
+
+
+/* ---------- ELF ---------- */
+
+#define ELF_SIG 0x464C457F
+
+#define ELF_CLASS_32 1
+#define ELF_CLASS_64 2
+
+#define ELF_DATA_2LSB 1
+#define ELF_DATA_2MSB 2
+
+static UInt16 Get16(const Byte *p, Bool be) { if (be) return (UInt16)GetBe16(p); return (UInt16)GetUi16(p); }
+static UInt32 Get32(const Byte *p, Bool be) { if (be) return GetBe32(p); return GetUi32(p); }
+// static UInt64 Get64(const Byte *p, Bool be) { if (be) return GetBe64(p); return GetUi64(p); }
+
+static int Parse_ELF(const Byte *buf, size_t size, CFilterMode *filterMode)
+{
+ Bool /* is32, */ be;
+ UInt32 filterId;
+
+ if (size < 512 || buf[6] != 1) /* ver */
+ return 0;
+
+ if (GetUi32(buf) != ELF_SIG)
+ return 0;
+
+ switch (buf[4])
+ {
+ case ELF_CLASS_32: /* is32 = True; */ break;
+ case ELF_CLASS_64: /* is32 = False; */ break;
+ default: return 0;
+ }
+
+ switch (buf[5])
+ {
+ case ELF_DATA_2LSB: be = False; break;
+ case ELF_DATA_2MSB: be = True; break;
+ default: return 0;
+ }
+
+ switch (Get16(buf + 0x12, be))
+ {
+ case 3:
+ case 6:
+ case 62: filterId = k_X86; break;
+ case 2:
+ case 18:
+ case 43: filterId = k_SPARC; break;
+ case 20:
+ case 21: if (!be) return 0; filterId = k_PPC; break;
+ case 40: if ( be) return 0; filterId = k_ARM; break;
+
+ /* Some IA-64 ELF exacutable have size that is not aligned for 16 bytes.
+ So we don't use IA-64 filter for IA-64 ELF */
+ // case 50: if ( be) return 0; filterId = k_IA64; break;
+
+ default: return 0;
+ }
+
+ filterMode->Id = filterId;
+ return 1;
+}
+
+
+
+/* ---------- Mach-O ---------- */
+
+#define MACH_SIG_BE_32 0xCEFAEDFE
+#define MACH_SIG_BE_64 0xCFFAEDFE
+#define MACH_SIG_LE_32 0xFEEDFACE
+#define MACH_SIG_LE_64 0xFEEDFACF
+
+#define MACH_ARCH_ABI64 (1 << 24)
+#define MACH_MACHINE_386 7
+#define MACH_MACHINE_ARM 12
+#define MACH_MACHINE_SPARC 14
+#define MACH_MACHINE_PPC 18
+#define MACH_MACHINE_PPC64 (MACH_ARCH_ABI64 | MACH_MACHINE_PPC)
+#define MACH_MACHINE_AMD64 (MACH_ARCH_ABI64 | MACH_MACHINE_386)
+
+static unsigned Parse_MACH(const Byte *buf, size_t size, CFilterMode *filterMode)
+{
+ UInt32 filterId, numCommands, commandsSize;
+
+ if (size < 512)
+ return 0;
+
+ Bool /* mode64, */ be;
+ switch (GetUi32(buf))
+ {
+ case MACH_SIG_BE_32: /* mode64 = False; */ be = True; break;
+ case MACH_SIG_BE_64: /* mode64 = True; */ be = True; break;
+ case MACH_SIG_LE_32: /* mode64 = False; */ be = False; break;
+ case MACH_SIG_LE_64: /* mode64 = True; */ be = False; break;
+ default: return 0;
+ }
+
+ switch (Get32(buf + 4, be))
+ {
+ case MACH_MACHINE_386:
+ case MACH_MACHINE_AMD64: filterId = k_X86; break;
+ case MACH_MACHINE_ARM: if ( be) return 0; filterId = k_ARM; break;
+ case MACH_MACHINE_SPARC: if (!be) return 0; filterId = k_SPARC; break;
+ case MACH_MACHINE_PPC:
+ case MACH_MACHINE_PPC64: if (!be) return 0; filterId = k_PPC; break;
+ default: return 0;
+ }
+
+ numCommands = Get32(buf + 0x10, be);
+ commandsSize = Get32(buf + 0x14, be);
+
+ if (commandsSize > (1 << 24) || numCommands > (1 << 18))
+ return 0;
+
+ filterMode->Id = filterId;
+ return 1;
+}
+
+
+/* ---------- WAV ---------- */
+
+#define WAV_SUBCHUNK_fmt 0x20746D66
+#define WAV_SUBCHUNK_data 0x61746164
+
+#define RIFF_SIG 0x46464952
+
+static Bool Parse_WAV(const Byte *buf, size_t size, CFilterMode *filterMode)
+{
+ UInt32 subChunkSize, pos;
+ if (size < 0x2C)
+ return False;
+
+ if (GetUi32(buf + 0) != RIFF_SIG ||
+ GetUi32(buf + 8) != 0x45564157 || // WAVE
+ GetUi32(buf + 0xC) != WAV_SUBCHUNK_fmt)
+ return False;
+ subChunkSize = GetUi32(buf + 0x10);
+ /* [0x14 = format] = 1 (PCM) */
+ if (subChunkSize < 0x10 || subChunkSize > 0x12 || GetUi16(buf + 0x14) != 1)
+ return False;
+
+ unsigned numChannels = GetUi16(buf + 0x16);
+ unsigned bitsPerSample = GetUi16(buf + 0x22);
+
+ if ((bitsPerSample & 0x7) != 0 || bitsPerSample >= 256 || numChannels >= 256)
+ return False;
+
+ pos = 0x14 + subChunkSize;
+
+ const int kNumSubChunksTests = 10;
+ // Do we need to scan more than 3 sub-chunks?
+ for (int i = 0; i < kNumSubChunksTests; i++)
+ {
+ if (pos + 8 > size)
+ return False;
+ subChunkSize = GetUi32(buf + pos + 4);
+ if (GetUi32(buf + pos) == WAV_SUBCHUNK_data)
+ {
+ unsigned delta = numChannels * (bitsPerSample >> 3);
+ if (delta >= 256)
+ return False;
+ filterMode->Id = k_Delta;
+ filterMode->Delta = delta;
+ return True;
+ }
+ if (subChunkSize > (1 << 16))
+ return False;
+ pos += subChunkSize + 8;
+ }
+ return False;
+}
+
+static Bool ParseFile(const Byte *buf, size_t size, CFilterMode *filterMode)
+{
+ filterMode->Id = 0;
+ filterMode->Delta = 0;
+
+ if (Parse_EXE(buf, size, filterMode)) return True;
+ if (Parse_ELF(buf, size, filterMode)) return True;
+ if (Parse_MACH(buf, size, filterMode)) return True;
+ return Parse_WAV(buf, size, filterMode);
+}
+
+
+
+
+struct CFilterMode2: public CFilterMode
+{
+ bool Encrypted;
+ unsigned GroupIndex;
+
+ CFilterMode2(): Encrypted(false) {}
+
+ int Compare(const CFilterMode2 &m) const
+ {
+ if (!Encrypted)
+ {
+ if (m.Encrypted)
+ return -1;
+ }
+ else if (!m.Encrypted)
+ return 1;
+
+ if (Id < m.Id) return -1;
+ if (Id > m.Id) return 1;
+
+ if (Delta < m.Delta) return -1;
+ if (Delta > m.Delta) return 1;
+
+ return 0;
+ }
+
+ bool operator ==(const CFilterMode2 &m) const
+ {
+ return Id == m.Id && Delta == m.Delta && Encrypted == m.Encrypted;
+ }
+};
+
+static unsigned GetGroup(CRecordVector<CFilterMode2> &filters, const CFilterMode2 &m)
+{
+ unsigned i;
+ for (i = 0; i < filters.Size(); i++)
+ {
+ const CFilterMode2 &m2 = filters[i];
+ if (m == m2)
+ return i;
+ /*
+ if (m.Encrypted != m2.Encrypted)
+ {
+ if (!m.Encrypted)
+ break;
+ continue;
+ }
+
+ if (m.Id < m2.Id) break;
+ if (m.Id != m2.Id) continue;
+
+ if (m.Delta < m2.Delta) break;
+ if (m.Delta != m2.Delta) continue;
+ */
+ }
+ // filters.Insert(i, m);
+ // return i;
+ return filters.Add(m);
+}
+
+static inline bool Is86Filter(CMethodId m)
+{
+ return (m == k_BCJ || m == k_BCJ2);
+}
+
+static inline bool IsExeFilter(CMethodId m)
+{
+ switch (m)
+ {
+ case k_BCJ:
+ case k_BCJ2:
+ case k_ARM:
+ case k_ARMT:
+ case k_PPC:
+ case k_SPARC:
+ case k_IA64:
+ return true;
+ }
+ return false;
+}
+
+static unsigned Get_FilterGroup_for_Folder(
+ CRecordVector<CFilterMode2> &filters, const CFolderEx &f, bool extractFilter)
+{
+ CFilterMode2 m;
+ m.Id = 0;
+ m.Delta = 0;
+ m.Encrypted = f.IsEncrypted();
+
+ if (extractFilter)
+ {
+ const CCoderInfo &coder = f.Coders[f.UnpackCoder];
+
+ if (coder.MethodID == k_Delta)
+ {
+ if (coder.Props.Size() == 1)
+ {
+ m.Delta = (unsigned)coder.Props[0] + 1;
+ m.Id = k_Delta;
+ }
+ }
+ else if (IsExeFilter(coder.MethodID))
+ {
+ m.Id = (UInt32)coder.MethodID;
+ if (m.Id == k_BCJ2)
+ m.Id = k_BCJ;
+ m.SetDelta();
+ }
+ }
+
+ return GetGroup(filters, m);
+}
+
+
+
+
+static HRESULT WriteRange(IInStream *inStream, ISequentialOutStream *outStream,
+ UInt64 position, UInt64 size, ICompressProgressInfo *progress)
+{
+ RINOK(inStream->Seek(position, STREAM_SEEK_SET, 0));
+ CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
+ CMyComPtr<CLimitedSequentialInStream> inStreamLimited(streamSpec);
+ streamSpec->SetStream(inStream);
+ streamSpec->Init(size);
+
+ NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder;
+ CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec;
+ RINOK(copyCoder->Code(inStreamLimited, outStream, NULL, NULL, progress));
+ return (copyCoderSpec->TotalSize == size ? S_OK : E_FAIL);
+}
+
+/*
+unsigned CUpdateItem::GetExtensionPos() const
+{
+ int slashPos = Name.ReverseFind_PathSepar();
+ int dotPos = Name.ReverseFind_Dot();
+ if (dotPos <= slashPos)
+ return Name.Len();
+ return dotPos + 1;
+}
+
+UString CUpdateItem::GetExtension() const
+{
+ return Name.Ptr(GetExtensionPos());
+}
+*/
+
+#define RINOZ(x) { int __tt = (x); if (__tt != 0) return __tt; }
+
+#define RINOZ_COMP(a, b) RINOZ(MyCompare(a, b))
+
+/*
+static int CompareBuffers(const CByteBuffer &a1, const CByteBuffer &a2)
+{
+ size_t c1 = a1.GetCapacity();
+ size_t c2 = a2.GetCapacity();
+ RINOZ_COMP(c1, c2);
+ for (size_t i = 0; i < c1; i++)
+ RINOZ_COMP(a1[i], a2[i]);
+ return 0;
+}
+
+static int CompareCoders(const CCoderInfo &c1, const CCoderInfo &c2)
+{
+ RINOZ_COMP(c1.NumInStreams, c2.NumInStreams);
+ RINOZ_COMP(c1.NumOutStreams, c2.NumOutStreams);
+ RINOZ_COMP(c1.MethodID, c2.MethodID);
+ return CompareBuffers(c1.Props, c2.Props);
+}
+
+static int CompareBonds(const CBond &b1, const CBond &b2)
+{
+ RINOZ_COMP(b1.InIndex, b2.InIndex);
+ return MyCompare(b1.OutIndex, b2.OutIndex);
+}
+
+static int CompareFolders(const CFolder &f1, const CFolder &f2)
+{
+ int s1 = f1.Coders.Size();
+ int s2 = f2.Coders.Size();
+ RINOZ_COMP(s1, s2);
+ int i;
+ for (i = 0; i < s1; i++)
+ RINOZ(CompareCoders(f1.Coders[i], f2.Coders[i]));
+ s1 = f1.Bonds.Size();
+ s2 = f2.Bonds.Size();
+ RINOZ_COMP(s1, s2);
+ for (i = 0; i < s1; i++)
+ RINOZ(CompareBonds(f1.Bonds[i], f2.Bonds[i]));
+ return 0;
+}
+*/
+
+/*
+static int CompareFiles(const CFileItem &f1, const CFileItem &f2)
+{
+ return CompareFileNames(f1.Name, f2.Name);
+}
+*/
+
+struct CFolderRepack
+{
+ unsigned FolderIndex;
+ CNum NumCopyFiles;
+};
+
+/*
+static int CompareFolderRepacks(const CFolderRepack *p1, const CFolderRepack *p2, void *)
+{
+ int i1 = p1->FolderIndex;
+ int i2 = p2->FolderIndex;
+ // In that version we don't want to parse folders here, so we don't compare folders
+ // probably it must be improved in future
+ // const CDbEx &db = *(const CDbEx *)param;
+ // RINOZ(CompareFolders(
+ // db.Folders[i1],
+ // db.Folders[i2]));
+
+ return MyCompare(i1, i2);
+
+ // RINOZ_COMP(
+ // db.NumUnpackStreamsVector[i1],
+ // db.NumUnpackStreamsVector[i2]);
+ // if (db.NumUnpackStreamsVector[i1] == 0)
+ // return 0;
+ // return CompareFiles(
+ // db.Files[db.FolderStartFileIndex[i1]],
+ // db.Files[db.FolderStartFileIndex[i2]]);
+}
+*/
+
+/*
+ we sort empty files and dirs in such order:
+ - Dir.NonAnti (name sorted)
+ - File.NonAnti (name sorted)
+ - File.Anti (name sorted)
+ - Dir.Anti (reverse name sorted)
+*/
+
+static int CompareEmptyItems(const unsigned *p1, const unsigned *p2, void *param)
+{
+ const CObjectVector<CUpdateItem> &updateItems = *(const CObjectVector<CUpdateItem> *)param;
+ const CUpdateItem &u1 = updateItems[*p1];
+ const CUpdateItem &u2 = updateItems[*p2];
+ // NonAnti < Anti
+ if (u1.IsAnti != u2.IsAnti)
+ return (u1.IsAnti ? 1 : -1);
+ if (u1.IsDir != u2.IsDir)
+ {
+ // Dir.NonAnti < File < Dir.Anti
+ if (u1.IsDir)
+ return (u1.IsAnti ? 1 : -1);
+ return (u2.IsAnti ? -1 : 1);
+ }
+ int n = CompareFileNames(u1.Name, u2.Name);
+ return (u1.IsDir && u1.IsAnti) ? -n : n;
+}
+
+static const char *g_Exts =
+ " 7z xz lzma ace arc arj bz tbz bz2 tbz2 cab deb gz tgz ha lha lzh lzo lzx pak rar rpm sit zoo"
+ " zip jar ear war msi"
+ " 3gp avi mov mpeg mpg mpe wmv"
+ " aac ape fla flac la mp3 m4a mp4 ofr ogg pac ra rm rka shn swa tta wv wma wav"
+ " swf"
+ " chm hxi hxs"
+ " gif jpeg jpg jp2 png tiff bmp ico psd psp"
+ " awg ps eps cgm dxf svg vrml wmf emf ai md"
+ " cad dwg pps key sxi"
+ " max 3ds"
+ " iso bin nrg mdf img pdi tar cpio xpi"
+ " vfd vhd vud vmc vsv"
+ " vmdk dsk nvram vmem vmsd vmsn vmss vmtm"
+ " inl inc idl acf asa"
+ " h hpp hxx c cpp cxx m mm go swift"
+ " rc java cs rs pas bas vb cls ctl frm dlg def"
+ " f77 f f90 f95"
+ " asm s"
+ " sql manifest dep"
+ " mak clw csproj vcproj sln dsp dsw"
+ " class"
+ " bat cmd bash sh"
+ " xml xsd xsl xslt hxk hxc htm html xhtml xht mht mhtml htw asp aspx css cgi jsp shtml"
+ " awk sed hta js json php php3 php4 php5 phptml pl pm py pyo rb tcl ts vbs"
+ " text txt tex ans asc srt reg ini doc docx mcw dot rtf hlp xls xlr xlt xlw ppt pdf"
+ " sxc sxd sxi sxg sxw stc sti stw stm odt ott odg otg odp otp ods ots odf"
+ " abw afp cwk lwp wpd wps wpt wrf wri"
+ " abf afm bdf fon mgf otf pcf pfa snf ttf"
+ " dbf mdb nsf ntf wdb db fdb gdb"
+ " exe dll ocx vbx sfx sys tlb awx com obj lib out o so"
+ " pdb pch idb ncb opt";
+
+static unsigned GetExtIndex(const char *ext)
+{
+ unsigned extIndex = 1;
+ const char *p = g_Exts;
+ for (;;)
+ {
+ char c = *p++;
+ if (c == 0)
+ return extIndex;
+ if (c == ' ')
+ continue;
+ unsigned pos = 0;
+ for (;;)
+ {
+ char c2 = ext[pos++];
+ if (c2 == 0 && (c == 0 || c == ' '))
+ return extIndex;
+ if (c != c2)
+ break;
+ c = *p++;
+ }
+ extIndex++;
+ for (;;)
+ {
+ if (c == 0)
+ return extIndex;
+ if (c == ' ')
+ break;
+ c = *p++;
+ }
+ }
+}
+
+struct CRefItem
+{
+ const CUpdateItem *UpdateItem;
+ UInt32 Index;
+ unsigned ExtensionPos;
+ unsigned NamePos;
+ unsigned ExtensionIndex;
+
+ CRefItem() {};
+ CRefItem(UInt32 index, const CUpdateItem &ui, bool sortByType):
+ UpdateItem(&ui),
+ Index(index),
+ ExtensionPos(0),
+ NamePos(0),
+ ExtensionIndex(0)
+ {
+ if (sortByType)
+ {
+ int slashPos = ui.Name.ReverseFind_PathSepar();
+ NamePos = slashPos + 1;
+ int dotPos = ui.Name.ReverseFind_Dot();
+ if (dotPos <= slashPos)
+ ExtensionPos = ui.Name.Len();
+ else
+ {
+ ExtensionPos = dotPos + 1;
+ if (ExtensionPos != ui.Name.Len())
+ {
+ AString s;
+ for (unsigned pos = ExtensionPos;; pos++)
+ {
+ wchar_t c = ui.Name[pos];
+ if (c >= 0x80)
+ break;
+ if (c == 0)
+ {
+ ExtensionIndex = GetExtIndex(s);
+ break;
+ }
+ s += (char)MyCharLower_Ascii((char)c);
+ }
+ }
+ }
+ }
+ }
+};
+
+struct CSortParam
+{
+ // const CObjectVector<CTreeFolder> *TreeFolders;
+ bool SortByType;
+};
+
+/*
+ we sort files in such order:
+ - Dir.NonAnti (name sorted)
+ - alt streams
+ - Dirs
+ - Dir.Anti (reverse name sorted)
+*/
+
+
+static int CompareUpdateItems(const CRefItem *p1, const CRefItem *p2, void *param)
+{
+ const CRefItem &a1 = *p1;
+ const CRefItem &a2 = *p2;
+ const CUpdateItem &u1 = *a1.UpdateItem;
+ const CUpdateItem &u2 = *a2.UpdateItem;
+
+ /*
+ if (u1.IsAltStream != u2.IsAltStream)
+ return u1.IsAltStream ? 1 : -1;
+ */
+
+ // Actually there are no dirs that time. They were stored in other steps
+ // So that code is unused?
+ if (u1.IsDir != u2.IsDir)
+ return u1.IsDir ? 1 : -1;
+ if (u1.IsDir)
+ {
+ if (u1.IsAnti != u2.IsAnti)
+ return (u1.IsAnti ? 1 : -1);
+ int n = CompareFileNames(u1.Name, u2.Name);
+ return -n;
+ }
+
+ // bool sortByType = *(bool *)param;
+ const CSortParam *sortParam = (const CSortParam *)param;
+ bool sortByType = sortParam->SortByType;
+ if (sortByType)
+ {
+ RINOZ_COMP(a1.ExtensionIndex, a2.ExtensionIndex);
+ RINOZ(CompareFileNames(u1.Name.Ptr(a1.ExtensionPos), u2.Name.Ptr(a2.ExtensionPos)));
+ RINOZ(CompareFileNames(u1.Name.Ptr(a1.NamePos), u2.Name.Ptr(a2.NamePos)));
+ if (!u1.MTimeDefined && u2.MTimeDefined) return 1;
+ if (u1.MTimeDefined && !u2.MTimeDefined) return -1;
+ if (u1.MTimeDefined && u2.MTimeDefined) RINOZ_COMP(u1.MTime, u2.MTime);
+ RINOZ_COMP(u1.Size, u2.Size);
+ }
+ /*
+ int par1 = a1.UpdateItem->ParentFolderIndex;
+ int par2 = a2.UpdateItem->ParentFolderIndex;
+ const CTreeFolder &tf1 = (*sortParam->TreeFolders)[par1];
+ const CTreeFolder &tf2 = (*sortParam->TreeFolders)[par2];
+
+ int b1 = tf1.SortIndex, e1 = tf1.SortIndexEnd;
+ int b2 = tf2.SortIndex, e2 = tf2.SortIndexEnd;
+ if (b1 < b2)
+ {
+ if (e1 <= b2)
+ return -1;
+ // p2 in p1
+ int par = par2;
+ for (;;)
+ {
+ const CTreeFolder &tf = (*sortParam->TreeFolders)[par];
+ par = tf.Parent;
+ if (par == par1)
+ {
+ RINOZ(CompareFileNames(u1.Name, tf.Name));
+ break;
+ }
+ }
+ }
+ else if (b2 < b1)
+ {
+ if (e2 <= b1)
+ return 1;
+ // p1 in p2
+ int par = par1;
+ for (;;)
+ {
+ const CTreeFolder &tf = (*sortParam->TreeFolders)[par];
+ par = tf.Parent;
+ if (par == par2)
+ {
+ RINOZ(CompareFileNames(tf.Name, u2.Name));
+ break;
+ }
+ }
+ }
+ */
+ // RINOZ_COMP(a1.UpdateItem->ParentSortIndex, a2.UpdateItem->ParentSortIndex);
+ RINOK(CompareFileNames(u1.Name, u2.Name));
+ RINOZ_COMP(a1.UpdateItem->IndexInClient, a2.UpdateItem->IndexInClient);
+ RINOZ_COMP(a1.UpdateItem->IndexInArchive, a2.UpdateItem->IndexInArchive);
+ return 0;
+}
+
+struct CSolidGroup
+{
+ CRecordVector<UInt32> Indices;
+
+ CRecordVector<CFolderRepack> folderRefs;
+};
+
+static const char * const g_ExeExts[] =
+{
+ "dll"
+ , "exe"
+ , "ocx"
+ , "sfx"
+ , "sys"
+};
+
+static bool IsExeExt(const wchar_t *ext)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(g_ExeExts); i++)
+ if (StringsAreEqualNoCase_Ascii(ext, g_ExeExts[i]))
+ return true;
+ return false;
+}
+
+struct CAnalysis
+{
+ CMyComPtr<IArchiveUpdateCallbackFile> Callback;
+ CByteBuffer Buffer;
+
+ bool ParseWav;
+ bool ParseExe;
+ bool ParseAll;
+
+ CAnalysis():
+ ParseWav(true),
+ ParseExe(false),
+ ParseAll(false)
+ {}
+
+ HRESULT GetFilterGroup(UInt32 index, const CUpdateItem &ui, CFilterMode &filterMode);
+};
+
+static const size_t kAnalysisBufSize = 1 << 14;
+
+HRESULT CAnalysis::GetFilterGroup(UInt32 index, const CUpdateItem &ui, CFilterMode &filterMode)
+{
+ filterMode.Id = 0;
+ filterMode.Delta = 0;
+
+ CFilterMode filterModeTemp = filterMode;
+
+ int slashPos = ui.Name.ReverseFind_PathSepar();
+ int dotPos = ui.Name.ReverseFind_Dot();
+
+ // if (dotPos > slashPos)
+ {
+ bool needReadFile = ParseAll;
+
+ bool probablyIsSameIsa = false;
+
+ if (!needReadFile || !Callback)
+ {
+ const wchar_t *ext;
+ if (dotPos > slashPos)
+ ext = ui.Name.Ptr(dotPos + 1);
+ else
+ ext = ui.Name.RightPtr(0);
+
+ // p7zip uses the trick to store posix attributes in high 16 bits
+ if (ui.Attrib & 0x8000)
+ {
+ unsigned st_mode = ui.Attrib >> 16;
+ // st_mode = 00111;
+ if ((st_mode & 00111) && (ui.Size >= 2048))
+ {
+ #ifndef _WIN32
+ probablyIsSameIsa = true;
+ #endif
+ needReadFile = true;
+ }
+ }
+
+ if (IsExeExt(ext))
+ {
+ needReadFile = true;
+ #ifdef _WIN32
+ probablyIsSameIsa = true;
+ needReadFile = ParseExe;
+ #endif
+ }
+ else if (StringsAreEqualNoCase_Ascii(ext, "wav"))
+ {
+ needReadFile = ParseWav;
+ }
+ /*
+ else if (!needReadFile && ParseUnixExt)
+ {
+ if (StringsAreEqualNoCase_Ascii(ext, "so")
+ || StringsAreEqualNoCase_Ascii(ext, ""))
+
+ needReadFile = true;
+ }
+ */
+ }
+
+ if (needReadFile && Callback)
+ {
+ if (Buffer.Size() != kAnalysisBufSize)
+ {
+ Buffer.Alloc(kAnalysisBufSize);
+ }
+ {
+ CMyComPtr<ISequentialInStream> stream;
+ HRESULT result = Callback->GetStream2(index, &stream, NUpdateNotifyOp::kAnalyze);
+ if (result == S_OK && stream)
+ {
+ size_t size = kAnalysisBufSize;
+ result = ReadStream(stream, Buffer, &size);
+ stream.Release();
+ // RINOK(Callback->SetOperationResult2(index, NUpdate::NOperationResult::kOK));
+ if (result == S_OK)
+ {
+ Bool parseRes = ParseFile(Buffer, size, &filterModeTemp);
+ if (parseRes && filterModeTemp.Delta == 0)
+ {
+ filterModeTemp.SetDelta();
+ if (filterModeTemp.Delta != 0 && filterModeTemp.Id != k_Delta)
+ {
+ if (ui.Size % filterModeTemp.Delta != 0)
+ {
+ parseRes = false;
+ }
+ }
+ }
+ if (!parseRes)
+ {
+ filterModeTemp.Id = 0;
+ filterModeTemp.Delta = 0;
+ }
+ }
+ }
+ }
+ }
+ else if ((needReadFile && !Callback) || probablyIsSameIsa)
+ {
+ #ifdef MY_CPU_X86_OR_AMD64
+ if (probablyIsSameIsa)
+ filterModeTemp.Id = k_X86;
+ #endif
+ }
+ }
+
+ filterMode = filterModeTemp;
+ return S_OK;
+}
+
+static inline void GetMethodFull(UInt64 methodID, UInt32 numStreams, CMethodFull &m)
+{
+ m.Id = methodID;
+ m.NumStreams = numStreams;
+}
+
+static HRESULT AddBondForFilter(CCompressionMethodMode &mode)
+{
+ for (unsigned c = 1; c < mode.Methods.Size(); c++)
+ {
+ if (!mode.IsThereBond_to_Coder(c))
+ {
+ CBond2 bond;
+ bond.OutCoder = 0;
+ bond.OutStream = 0;
+ bond.InCoder = c;
+ mode.Bonds.Add(bond);
+ return S_OK;
+ }
+ }
+ return E_INVALIDARG;
+}
+
+static HRESULT AddFilterBond(CCompressionMethodMode &mode)
+{
+ if (!mode.Bonds.IsEmpty())
+ return AddBondForFilter(mode);
+ return S_OK;
+}
+
+static HRESULT AddBcj2Methods(CCompressionMethodMode &mode)
+{
+ // mode.Methods[0] must be k_BCJ2 method !
+
+ CMethodFull m;
+ GetMethodFull(k_LZMA, 1, m);
+
+ m.AddProp32(NCoderPropID::kDictionarySize, 1 << 20);
+ m.AddProp32(NCoderPropID::kNumFastBytes, 128);
+ m.AddProp32(NCoderPropID::kNumThreads, 1);
+ m.AddProp32(NCoderPropID::kLitPosBits, 2);
+ m.AddProp32(NCoderPropID::kLitContextBits, 0);
+ // m.AddProp_Ascii(NCoderPropID::kMatchFinder, "BT2");
+
+ unsigned methodIndex = mode.Methods.Size();
+
+ if (mode.Bonds.IsEmpty())
+ {
+ for (unsigned i = 1; i + 1 < mode.Methods.Size(); i++)
+ {
+ CBond2 bond;
+ bond.OutCoder = i;
+ bond.OutStream = 0;
+ bond.InCoder = i + 1;
+ mode.Bonds.Add(bond);
+ }
+ }
+
+ mode.Methods.Add(m);
+ mode.Methods.Add(m);
+
+ RINOK(AddBondForFilter(mode));
+ CBond2 bond;
+ bond.OutCoder = 0;
+ bond.InCoder = methodIndex; bond.OutStream = 1; mode.Bonds.Add(bond);
+ bond.InCoder = methodIndex + 1; bond.OutStream = 2; mode.Bonds.Add(bond);
+ return S_OK;
+}
+
+static HRESULT MakeExeMethod(CCompressionMethodMode &mode,
+ const CFilterMode &filterMode, /* bool addFilter, */ bool bcj2Filter)
+{
+ if (mode.Filter_was_Inserted)
+ {
+ const CMethodFull &m = mode.Methods[0];
+ CMethodId id = m.Id;
+ if (id == k_BCJ2)
+ return AddBcj2Methods(mode);
+ if (!m.IsSimpleCoder())
+ return E_NOTIMPL;
+ // if (Bonds.IsEmpty()) we can create bonds later
+ return AddFilterBond(mode);
+ }
+
+ if (filterMode.Id == 0)
+ return S_OK;
+
+ CMethodFull &m = mode.Methods.InsertNew(0);
+
+ {
+ FOR_VECTOR(k, mode.Bonds)
+ {
+ CBond2 &bond = mode.Bonds[k];
+ bond.InCoder++;
+ bond.OutCoder++;
+ }
+ }
+
+ HRESULT res;
+
+ if (bcj2Filter && Is86Filter(filterMode.Id))
+ {
+ GetMethodFull(k_BCJ2, 4, m);
+ res = AddBcj2Methods(mode);
+ }
+ else
+ {
+ GetMethodFull(filterMode.Id, 1, m);
+ if (filterMode.Id == k_Delta)
+ m.AddProp32(NCoderPropID::kDefaultProp, filterMode.Delta);
+ res = AddFilterBond(mode);
+
+ int alignBits = -1;
+ if (filterMode.Id == k_Delta || filterMode.Delta != 0)
+ {
+ if (filterMode.Delta == 1) alignBits = 0;
+ else if (filterMode.Delta == 2) alignBits = 1;
+ else if (filterMode.Delta == 4) alignBits = 2;
+ else if (filterMode.Delta == 8) alignBits = 3;
+ else if (filterMode.Delta == 16) alignBits = 4;
+ }
+ else
+ {
+ // alignBits = GetAlignForFilterMethod(filterMode.Id);
+ }
+
+ if (res == S_OK && alignBits >= 0)
+ {
+ unsigned nextCoder = 1;
+ if (!mode.Bonds.IsEmpty())
+ {
+ nextCoder = mode.Bonds.Back().InCoder;
+ }
+ if (nextCoder < mode.Methods.Size())
+ {
+ CMethodFull &nextMethod = mode.Methods[nextCoder];
+ if (nextMethod.Id == k_LZMA || nextMethod.Id == k_LZMA2)
+ {
+ if (!nextMethod.Are_Lzma_Model_Props_Defined())
+ {
+ if (alignBits != 0)
+ {
+ if (alignBits > 2 || filterMode.Id == k_Delta)
+ nextMethod.AddProp32(NCoderPropID::kPosStateBits, alignBits);
+ unsigned lc = 0;
+ if (alignBits < 3)
+ lc = 3 - alignBits;
+ nextMethod.AddProp32(NCoderPropID::kLitContextBits, lc);
+ nextMethod.AddProp32(NCoderPropID::kLitPosBits, alignBits);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return res;
+}
+
+
+static void UpdateItem_To_FileItem2(const CUpdateItem &ui, CFileItem2 &file2)
+{
+ file2.Attrib = ui.Attrib; file2.AttribDefined = ui.AttribDefined;
+ file2.CTime = ui.CTime; file2.CTimeDefined = ui.CTimeDefined;
+ file2.ATime = ui.ATime; file2.ATimeDefined = ui.ATimeDefined;
+ file2.MTime = ui.MTime; file2.MTimeDefined = ui.MTimeDefined;
+ file2.IsAnti = ui.IsAnti;
+ // file2.IsAux = false;
+ file2.StartPosDefined = false;
+ // file2.StartPos = 0;
+}
+
+
+static void UpdateItem_To_FileItem(const CUpdateItem &ui,
+ CFileItem &file, CFileItem2 &file2)
+{
+ UpdateItem_To_FileItem2(ui, file2);
+
+ file.Size = ui.Size;
+ file.IsDir = ui.IsDir;
+ file.HasStream = ui.HasStream();
+ // file.IsAltStream = ui.IsAltStream;
+}
+
+
+
+class CRepackInStreamWithSizes:
+ public ISequentialInStream,
+ public ICompressGetSubStreamSize,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialInStream> _stream;
+ // UInt64 _size;
+ const CBoolVector *_extractStatuses;
+ UInt32 _startIndex;
+public:
+ const CDbEx *_db;
+
+ void Init(ISequentialInStream *stream, UInt32 startIndex, const CBoolVector *extractStatuses)
+ {
+ _startIndex = startIndex;
+ _extractStatuses = extractStatuses;
+ // _size = 0;
+ _stream = stream;
+ }
+ // UInt64 GetSize() const { return _size; }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, ICompressGetSubStreamSize)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+
+ STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value);
+};
+
+STDMETHODIMP CRepackInStreamWithSizes::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ return _stream->Read(data, size, processedSize);
+ /*
+ UInt32 realProcessedSize;
+ HRESULT result = _stream->Read(data, size, &realProcessedSize);
+ _size += realProcessedSize;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return result;
+ */
+}
+
+STDMETHODIMP CRepackInStreamWithSizes::GetSubStreamSize(UInt64 subStream, UInt64 *value)
+{
+ *value = 0;
+ if (subStream >= _extractStatuses->Size())
+ return S_FALSE; // E_FAIL;
+ unsigned index = (unsigned)subStream;
+ if ((*_extractStatuses)[index])
+ {
+ const CFileItem &fi = _db->Files[_startIndex + index];
+ if (fi.HasStream)
+ *value = fi.Size;
+ }
+ return S_OK;
+}
+
+
+class CRepackStreamBase
+{
+protected:
+ bool _needWrite;
+ bool _fileIsOpen;
+ bool _calcCrc;
+ UInt32 _crc;
+ UInt64 _rem;
+
+ const CBoolVector *_extractStatuses;
+ UInt32 _startIndex;
+ unsigned _currentIndex;
+
+ HRESULT OpenFile();
+ HRESULT CloseFile();
+ HRESULT ProcessEmptyFiles();
+
+public:
+ const CDbEx *_db;
+ CMyComPtr<IArchiveUpdateCallbackFile> _opCallback;
+ CMyComPtr<IArchiveExtractCallbackMessage> _extractCallback;
+
+ HRESULT Init(UInt32 startIndex, const CBoolVector *extractStatuses);
+ HRESULT CheckFinishedState() const { return (_currentIndex == _extractStatuses->Size()) ? S_OK: E_FAIL; }
+};
+
+HRESULT CRepackStreamBase::Init(UInt32 startIndex, const CBoolVector *extractStatuses)
+{
+ _startIndex = startIndex;
+ _extractStatuses = extractStatuses;
+
+ _currentIndex = 0;
+ _fileIsOpen = false;
+
+ return ProcessEmptyFiles();
+}
+
+HRESULT CRepackStreamBase::OpenFile()
+{
+ UInt32 arcIndex = _startIndex + _currentIndex;
+ const CFileItem &fi = _db->Files[arcIndex];
+
+ _needWrite = (*_extractStatuses)[_currentIndex];
+ if (_opCallback)
+ {
+ RINOK(_opCallback->ReportOperation(
+ NEventIndexType::kInArcIndex, arcIndex,
+ _needWrite ?
+ NUpdateNotifyOp::kRepack :
+ NUpdateNotifyOp::kSkip));
+ }
+
+ _crc = CRC_INIT_VAL;
+ _calcCrc = (fi.CrcDefined && !fi.IsDir);
+
+ _fileIsOpen = true;
+ _rem = fi.Size;
+ return S_OK;
+}
+
+const HRESULT k_My_HRESULT_CRC_ERROR = 0x20000002;
+
+HRESULT CRepackStreamBase::CloseFile()
+{
+ UInt32 arcIndex = _startIndex + _currentIndex;
+ const CFileItem &fi = _db->Files[arcIndex];
+ _fileIsOpen = false;
+ _currentIndex++;
+ if (!_calcCrc || fi.Crc == CRC_GET_DIGEST(_crc))
+ return S_OK;
+
+ if (_extractCallback)
+ {
+ RINOK(_extractCallback->ReportExtractResult(
+ NEventIndexType::kInArcIndex, arcIndex,
+ NExtract::NOperationResult::kCRCError));
+ }
+ // return S_FALSE;
+ return k_My_HRESULT_CRC_ERROR;
+}
+
+HRESULT CRepackStreamBase::ProcessEmptyFiles()
+{
+ while (_currentIndex < _extractStatuses->Size() && _db->Files[_startIndex + _currentIndex].Size == 0)
+ {
+ RINOK(OpenFile());
+ RINOK(CloseFile());
+ }
+ return S_OK;
+}
+
+
+
+#ifndef _7ZIP_ST
+
+class CFolderOutStream2:
+ public CRepackStreamBase,
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+public:
+ CMyComPtr<ISequentialOutStream> _stream;
+
+ MY_UNKNOWN_IMP
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CFolderOutStream2::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ while (size != 0)
+ {
+ if (_fileIsOpen)
+ {
+ UInt32 cur = (size < _rem ? size : (UInt32)_rem);
+ HRESULT result = S_OK;
+ if (_needWrite)
+ result = _stream->Write(data, cur, &cur);
+ if (_calcCrc)
+ _crc = CrcUpdate(_crc, data, cur);
+ if (processedSize)
+ *processedSize += cur;
+ data = (const Byte *)data + cur;
+ size -= cur;
+ _rem -= cur;
+ if (_rem == 0)
+ {
+ RINOK(CloseFile());
+ RINOK(ProcessEmptyFiles());
+ }
+ RINOK(result);
+ if (cur == 0)
+ break;
+ continue;
+ }
+
+ RINOK(ProcessEmptyFiles());
+ if (_currentIndex == _extractStatuses->Size())
+ {
+ // we don't support write cut here
+ return E_FAIL;
+ }
+ RINOK(OpenFile());
+ }
+
+ return S_OK;
+}
+
+#endif
+
+
+
+static const UInt32 kTempBufSize = 1 << 16;
+
+class CFolderInStream2:
+ public CRepackStreamBase,
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+ Byte *_buf;
+public:
+ CMyComPtr<ISequentialInStream> _inStream;
+ HRESULT Result;
+
+ MY_UNKNOWN_IMP
+
+ CFolderInStream2():
+ Result(S_OK)
+ {
+ _buf = new Byte[kTempBufSize];
+ }
+
+ ~CFolderInStream2()
+ {
+ delete []_buf;
+ }
+
+ void Init() { Result = S_OK; }
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CFolderInStream2::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ while (size != 0)
+ {
+ if (_fileIsOpen)
+ {
+ UInt32 cur = (size < _rem ? size : (UInt32)_rem);
+
+ void *buf;
+ if (_needWrite)
+ buf = data;
+ else
+ {
+ buf = _buf;
+ if (cur > kTempBufSize)
+ cur = kTempBufSize;
+ }
+
+ HRESULT result = _inStream->Read(buf, cur, &cur);
+ _crc = CrcUpdate(_crc, buf, cur);
+ _rem -= cur;
+
+ if (_needWrite)
+ {
+ data = (Byte *)data + cur;
+ size -= cur;
+ if (processedSize)
+ *processedSize += cur;
+ }
+
+ if (result != S_OK)
+ Result = result;
+
+ if (_rem == 0)
+ {
+ RINOK(CloseFile());
+ RINOK(ProcessEmptyFiles());
+ }
+
+ RINOK(result);
+
+ if (cur == 0)
+ return E_FAIL;
+
+ continue;
+ }
+
+ RINOK(ProcessEmptyFiles());
+ if (_currentIndex == _extractStatuses->Size())
+ {
+ return S_OK;
+ }
+ RINOK(OpenFile());
+ }
+
+ return S_OK;
+}
+
+
+class CThreadDecoder
+ #ifndef _7ZIP_ST
+ : public CVirtThread
+ #endif
+{
+public:
+ CDecoder Decoder;
+
+ CThreadDecoder(bool multiThreadMixer):
+ Decoder(multiThreadMixer)
+ {
+ #ifndef _7ZIP_ST
+ if (multiThreadMixer)
+ {
+ MtMode = false;
+ NumThreads = 1;
+ FosSpec = new CFolderOutStream2;
+ Fos = FosSpec;
+ Result = E_FAIL;
+ }
+ #endif
+ // UnpackSize = 0;
+ // send_UnpackSize = false;
+ }
+
+ #ifndef _7ZIP_ST
+
+ bool dataAfterEnd_Error;
+ HRESULT Result;
+ CMyComPtr<IInStream> InStream;
+
+ CFolderOutStream2 *FosSpec;
+ CMyComPtr<ISequentialOutStream> Fos;
+
+ UInt64 StartPos;
+ const CFolders *Folders;
+ int FolderIndex;
+
+ // bool send_UnpackSize;
+ // UInt64 UnpackSize;
+
+ #ifndef _NO_CRYPTO
+ CMyComPtr<ICryptoGetTextPassword> getTextPassword;
+ #endif
+
+ DECL_EXTERNAL_CODECS_LOC_VARS2;
+
+ #ifndef _7ZIP_ST
+ bool MtMode;
+ UInt32 NumThreads;
+ #endif
+
+
+ ~CThreadDecoder() { CVirtThread::WaitThreadFinish(); }
+ virtual void Execute();
+
+ #endif
+};
+
+#ifndef _7ZIP_ST
+
+void CThreadDecoder::Execute()
+{
+ try
+ {
+ #ifndef _NO_CRYPTO
+ bool isEncrypted = false;
+ bool passwordIsDefined = false;
+ UString password;
+ #endif
+
+ dataAfterEnd_Error = false;
+
+ Result = Decoder.Decode(
+ EXTERNAL_CODECS_LOC_VARS
+ InStream,
+ StartPos,
+ *Folders, FolderIndex,
+
+ // send_UnpackSize ? &UnpackSize : NULL,
+ NULL, // unpackSize : FULL unpack
+
+ Fos,
+ NULL, // compressProgress
+
+ NULL // *inStreamMainRes
+ , dataAfterEnd_Error
+
+ _7Z_DECODER_CRYPRO_VARS
+ #ifndef _7ZIP_ST
+ , MtMode, NumThreads,
+ 0 // MemUsage
+ #endif
+
+ );
+ }
+ catch(...)
+ {
+ Result = E_FAIL;
+ }
+
+ /*
+ if (Result == S_OK)
+ Result = FosSpec->CheckFinishedState();
+ */
+ FosSpec->_stream.Release();
+}
+
+#endif
+
+#ifndef _NO_CRYPTO
+
+class CCryptoGetTextPassword:
+ public ICryptoGetTextPassword,
+ public CMyUnknownImp
+{
+public:
+ UString Password;
+
+ MY_UNKNOWN_IMP
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+};
+
+STDMETHODIMP CCryptoGetTextPassword::CryptoGetTextPassword(BSTR *password)
+{
+ return StringToBstr(Password, password);
+}
+
+#endif
+
+
+static void GetFile(const CDatabase &inDb, unsigned index, CFileItem &file, CFileItem2 &file2)
+{
+ file = inDb.Files[index];
+ file2.CTimeDefined = inDb.CTime.GetItem(index, file2.CTime);
+ file2.ATimeDefined = inDb.ATime.GetItem(index, file2.ATime);
+ file2.MTimeDefined = inDb.MTime.GetItem(index, file2.MTime);
+ file2.StartPosDefined = inDb.StartPos.GetItem(index, file2.StartPos);
+ file2.AttribDefined = inDb.Attrib.GetItem(index, file2.Attrib);
+ file2.IsAnti = inDb.IsItemAnti(index);
+ // file2.IsAux = inDb.IsItemAux(index);
+}
+
+HRESULT Update(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ IInStream *inStream,
+ const CDbEx *db,
+ const CObjectVector<CUpdateItem> &updateItems,
+ // const CObjectVector<CTreeFolder> &treeFolders,
+ // const CUniqBlocks &secureBlocks,
+ COutArchive &archive,
+ CArchiveDatabaseOut &newDatabase,
+ ISequentialOutStream *seqOutStream,
+ IArchiveUpdateCallback *updateCallback,
+ const CUpdateOptions &options
+ #ifndef _NO_CRYPTO
+ , ICryptoGetTextPassword *getDecoderPassword
+ #endif
+ )
+{
+ UInt64 numSolidFiles = options.NumSolidFiles;
+ if (numSolidFiles == 0)
+ numSolidFiles = 1;
+
+ CMyComPtr<IArchiveUpdateCallbackFile> opCallback;
+ updateCallback->QueryInterface(IID_IArchiveUpdateCallbackFile, (void **)&opCallback);
+
+ CMyComPtr<IArchiveExtractCallbackMessage> extractCallback;
+ updateCallback->QueryInterface(IID_IArchiveExtractCallbackMessage, (void **)&extractCallback);
+
+ // size_t totalSecureDataSize = (size_t)secureBlocks.GetTotalSizeInBytes();
+
+ /*
+ CMyComPtr<IOutStream> outStream;
+ RINOK(seqOutStream->QueryInterface(IID_IOutStream, (void **)&outStream));
+ if (!outStream)
+ return E_NOTIMPL;
+ */
+
+ UInt64 startBlockSize = db ? db->ArcInfo.StartPosition: 0;
+ if (startBlockSize > 0 && !options.RemoveSfxBlock)
+ {
+ RINOK(WriteRange(inStream, seqOutStream, 0, startBlockSize, NULL));
+ }
+
+ CIntArr fileIndexToUpdateIndexMap;
+ UInt64 complexity = 0;
+ UInt64 inSizeForReduce2 = 0;
+ bool needEncryptedRepack = false;
+
+ CRecordVector<CFilterMode2> filters;
+ CObjectVector<CSolidGroup> groups;
+ bool thereAreRepacks = false;
+
+ bool useFilters = options.UseFilters;
+ if (useFilters)
+ {
+ const CCompressionMethodMode &method = *options.Method;
+
+ FOR_VECTOR (i, method.Methods)
+ if (IsFilterMethod(method.Methods[i].Id))
+ {
+ useFilters = false;
+ break;
+ }
+ }
+
+ if (db)
+ {
+ fileIndexToUpdateIndexMap.Alloc(db->Files.Size());
+ unsigned i;
+
+ for (i = 0; i < db->Files.Size(); i++)
+ fileIndexToUpdateIndexMap[i] = -1;
+
+ for (i = 0; i < updateItems.Size(); i++)
+ {
+ int index = updateItems[i].IndexInArchive;
+ if (index != -1)
+ fileIndexToUpdateIndexMap[(unsigned)index] = i;
+ }
+
+ for (i = 0; i < db->NumFolders; i++)
+ {
+ CNum indexInFolder = 0;
+ CNum numCopyItems = 0;
+ CNum numUnpackStreams = db->NumUnpackStreamsVector[i];
+ UInt64 repackSize = 0;
+
+ for (CNum fi = db->FolderStartFileIndex[i]; indexInFolder < numUnpackStreams; fi++)
+ {
+ const CFileItem &file = db->Files[fi];
+ if (file.HasStream)
+ {
+ indexInFolder++;
+ int updateIndex = fileIndexToUpdateIndexMap[fi];
+ if (updateIndex >= 0 && !updateItems[updateIndex].NewData)
+ {
+ numCopyItems++;
+ repackSize += file.Size;
+ }
+ }
+ }
+
+ if (numCopyItems == 0)
+ continue;
+
+ CFolderRepack rep;
+ rep.FolderIndex = i;
+ rep.NumCopyFiles = numCopyItems;
+ CFolderEx f;
+ db->ParseFolderEx(i, f);
+
+ const bool isEncrypted = f.IsEncrypted();
+ const bool needCopy = (numCopyItems == numUnpackStreams);
+ const bool extractFilter = (useFilters || needCopy);
+
+ unsigned groupIndex = Get_FilterGroup_for_Folder(filters, f, extractFilter);
+
+ while (groupIndex >= groups.Size())
+ groups.AddNew();
+
+ groups[groupIndex].folderRefs.Add(rep);
+
+ if (needCopy)
+ complexity += db->GetFolderFullPackSize(i);
+ else
+ {
+ thereAreRepacks = true;
+ complexity += repackSize;
+ if (inSizeForReduce2 < repackSize)
+ inSizeForReduce2 = repackSize;
+ if (isEncrypted)
+ needEncryptedRepack = true;
+ }
+ }
+ }
+
+ UInt64 inSizeForReduce = 0;
+ {
+ bool isSolid = (numSolidFiles > 1 && options.NumSolidBytes != 0);
+ FOR_VECTOR (i, updateItems)
+ {
+ const CUpdateItem &ui = updateItems[i];
+ if (ui.NewData)
+ {
+ complexity += ui.Size;
+ if (isSolid)
+ inSizeForReduce += ui.Size;
+ else if (inSizeForReduce < ui.Size)
+ inSizeForReduce = ui.Size;
+ }
+ }
+ }
+
+ if (inSizeForReduce < inSizeForReduce2)
+ inSizeForReduce = inSizeForReduce2;
+
+ RINOK(updateCallback->SetTotal(complexity));
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(updateCallback, true);
+
+ #ifndef _7ZIP_ST
+
+ CStreamBinder sb;
+ if (options.MultiThreadMixer)
+ {
+ RINOK(sb.CreateEvents());
+ }
+
+ #endif
+
+ CThreadDecoder threadDecoder(options.MultiThreadMixer);
+
+ #ifndef _7ZIP_ST
+ if (options.MultiThreadMixer && thereAreRepacks)
+ {
+ #ifdef EXTERNAL_CODECS
+ threadDecoder.__externalCodecs = __externalCodecs;
+ #endif
+ RINOK(threadDecoder.Create());
+ }
+ #endif
+
+ {
+ CAnalysis analysis;
+ if (options.AnalysisLevel == 0)
+ {
+ analysis.ParseWav = false;
+ analysis.ParseExe = false;
+ analysis.ParseAll = false;
+ }
+ else
+ {
+ analysis.Callback = opCallback;
+ if (options.AnalysisLevel > 0)
+ {
+ analysis.ParseWav = true;
+ if (options.AnalysisLevel >= 7)
+ {
+ analysis.ParseExe = true;
+ if (options.AnalysisLevel >= 9)
+ analysis.ParseAll = true;
+ }
+ }
+ }
+
+ // ---------- Split files to groups ----------
+
+ const CCompressionMethodMode &method = *options.Method;
+
+ FOR_VECTOR (i, updateItems)
+ {
+ const CUpdateItem &ui = updateItems[i];
+ if (!ui.NewData || !ui.HasStream())
+ continue;
+
+ CFilterMode2 fm;
+ if (useFilters)
+ {
+ RINOK(analysis.GetFilterGroup(i, ui, fm));
+ }
+ fm.Encrypted = method.PasswordIsDefined;
+
+ unsigned groupIndex = GetGroup(filters, fm);
+ while (groupIndex >= groups.Size())
+ groups.AddNew();
+ groups[groupIndex].Indices.Add(i);
+ }
+ }
+
+
+ #ifndef _NO_CRYPTO
+
+ CCryptoGetTextPassword *getPasswordSpec = NULL;
+ CMyComPtr<ICryptoGetTextPassword> getTextPassword;
+ if (needEncryptedRepack)
+ {
+ getPasswordSpec = new CCryptoGetTextPassword;
+ getTextPassword = getPasswordSpec;
+
+ #ifndef _7ZIP_ST
+ threadDecoder.getTextPassword = getPasswordSpec;
+ #endif
+
+ if (options.Method->PasswordIsDefined)
+ getPasswordSpec->Password = options.Method->Password;
+ else
+ {
+ if (!getDecoderPassword)
+ return E_NOTIMPL;
+ CMyComBSTR password;
+ RINOK(getDecoderPassword->CryptoGetTextPassword(&password));
+ if (password)
+ getPasswordSpec->Password = password;
+ }
+ }
+
+ #endif
+
+
+ // ---------- Compress ----------
+
+ RINOK(archive.Create(seqOutStream, false));
+ RINOK(archive.SkipPrefixArchiveHeader());
+
+ /*
+ CIntVector treeFolderToArcIndex;
+ treeFolderToArcIndex.Reserve(treeFolders.Size());
+ for (i = 0; i < treeFolders.Size(); i++)
+ treeFolderToArcIndex.Add(-1);
+ // ---------- Write Tree (only AUX dirs) ----------
+ for (i = 1; i < treeFolders.Size(); i++)
+ {
+ const CTreeFolder &treeFolder = treeFolders[i];
+ CFileItem file;
+ CFileItem2 file2;
+ file2.Init();
+ int secureID = 0;
+ if (treeFolder.UpdateItemIndex < 0)
+ {
+ // we can store virtual dir item wuthout attrib, but we want all items have attrib.
+ file.SetAttrib(FILE_ATTRIBUTE_DIRECTORY);
+ file2.IsAux = true;
+ }
+ else
+ {
+ const CUpdateItem &ui = updateItems[treeFolder.UpdateItemIndex];
+ // if item is not dir, then it's parent for alt streams.
+ // we will write such items later
+ if (!ui.IsDir)
+ continue;
+ secureID = ui.SecureIndex;
+ if (ui.NewProps)
+ UpdateItem_To_FileItem(ui, file, file2);
+ else
+ GetFile(*db, ui.IndexInArchive, file, file2);
+ }
+ file.Size = 0;
+ file.HasStream = false;
+ file.IsDir = true;
+ file.Parent = treeFolder.Parent;
+
+ treeFolderToArcIndex[i] = newDatabase.Files.Size();
+ newDatabase.AddFile(file, file2, treeFolder.Name);
+
+ if (totalSecureDataSize != 0)
+ newDatabase.SecureIDs.Add(secureID);
+ }
+ */
+
+ {
+ /* ---------- Write non-AUX dirs and Empty files ---------- */
+ CUIntVector emptyRefs;
+
+ unsigned i;
+
+ for (i = 0; i < updateItems.Size(); i++)
+ {
+ const CUpdateItem &ui = updateItems[i];
+ if (ui.NewData)
+ {
+ if (ui.HasStream())
+ continue;
+ }
+ else if (ui.IndexInArchive != -1 && db->Files[ui.IndexInArchive].HasStream)
+ continue;
+ /*
+ if (ui.TreeFolderIndex >= 0)
+ continue;
+ */
+ emptyRefs.Add(i);
+ }
+
+ emptyRefs.Sort(CompareEmptyItems, (void *)&updateItems);
+
+ for (i = 0; i < emptyRefs.Size(); i++)
+ {
+ const CUpdateItem &ui = updateItems[emptyRefs[i]];
+ CFileItem file;
+ CFileItem2 file2;
+ UString name;
+ if (ui.NewProps)
+ {
+ UpdateItem_To_FileItem(ui, file, file2);
+ file.CrcDefined = false;
+ name = ui.Name;
+ }
+ else
+ {
+ GetFile(*db, ui.IndexInArchive, file, file2);
+ db->GetPath(ui.IndexInArchive, name);
+ }
+
+ /*
+ if (totalSecureDataSize != 0)
+ newDatabase.SecureIDs.Add(ui.SecureIndex);
+ file.Parent = ui.ParentFolderIndex;
+ */
+ newDatabase.AddFile(file, file2, name);
+ }
+ }
+
+ lps->ProgressOffset = 0;
+
+ {
+ // ---------- Sort Filters ----------
+
+ FOR_VECTOR (i, filters)
+ {
+ filters[i].GroupIndex = i;
+ }
+ filters.Sort2();
+ }
+
+ for (unsigned groupIndex = 0; groupIndex < filters.Size(); groupIndex++)
+ {
+ const CFilterMode2 &filterMode = filters[groupIndex];
+
+ CCompressionMethodMode method = *options.Method;
+ {
+ HRESULT res = MakeExeMethod(method, filterMode,
+ #ifdef _7ZIP_ST
+ false
+ #else
+ options.MaxFilter && options.MultiThreadMixer
+ #endif
+ );
+
+ RINOK(res);
+ }
+
+ if (filterMode.Encrypted)
+ {
+ if (!method.PasswordIsDefined)
+ {
+ #ifndef _NO_CRYPTO
+ if (getPasswordSpec)
+ method.Password = getPasswordSpec->Password;
+ #endif
+ method.PasswordIsDefined = true;
+ }
+ }
+ else
+ {
+ method.PasswordIsDefined = false;
+ method.Password.Empty();
+ }
+
+ CEncoder encoder(method);
+
+ // ---------- Repack and copy old solid blocks ----------
+
+ const CSolidGroup &group = groups[filterMode.GroupIndex];
+
+ FOR_VECTOR(folderRefIndex, group.folderRefs)
+ {
+ const CFolderRepack &rep = group.folderRefs[folderRefIndex];
+
+ unsigned folderIndex = rep.FolderIndex;
+
+ CNum numUnpackStreams = db->NumUnpackStreamsVector[folderIndex];
+
+ if (rep.NumCopyFiles == numUnpackStreams)
+ {
+ if (opCallback)
+ {
+ RINOK(opCallback->ReportOperation(
+ NEventIndexType::kBlockIndex, (UInt32)folderIndex,
+ NUpdateNotifyOp::kReplicate));
+
+ // ---------- Copy old solid block ----------
+ {
+ CNum indexInFolder = 0;
+ for (CNum fi = db->FolderStartFileIndex[folderIndex]; indexInFolder < numUnpackStreams; fi++)
+ {
+ if (db->Files[fi].HasStream)
+ {
+ indexInFolder++;
+ RINOK(opCallback->ReportOperation(
+ NEventIndexType::kInArcIndex, (UInt32)fi,
+ NUpdateNotifyOp::kReplicate));
+ }
+ }
+ }
+ }
+
+ UInt64 packSize = db->GetFolderFullPackSize(folderIndex);
+ RINOK(WriteRange(inStream, archive.SeqStream,
+ db->GetFolderStreamPos(folderIndex, 0), packSize, progress));
+ lps->ProgressOffset += packSize;
+
+ CFolder &folder = newDatabase.Folders.AddNew();
+ db->ParseFolderInfo(folderIndex, folder);
+ CNum startIndex = db->FoStartPackStreamIndex[folderIndex];
+ FOR_VECTOR(j, folder.PackStreams)
+ {
+ newDatabase.PackSizes.Add(db->GetStreamPackSize(startIndex + j));
+ // newDatabase.PackCRCsDefined.Add(db.PackCRCsDefined[startIndex + j]);
+ // newDatabase.PackCRCs.Add(db.PackCRCs[startIndex + j]);
+ }
+
+ size_t indexStart = db->FoToCoderUnpackSizes[folderIndex];
+ size_t indexEnd = db->FoToCoderUnpackSizes[folderIndex + 1];
+ for (; indexStart < indexEnd; indexStart++)
+ newDatabase.CoderUnpackSizes.Add(db->CoderUnpackSizes[indexStart]);
+ }
+ else
+ {
+ // ---------- Repack old solid block ----------
+
+ CBoolVector extractStatuses;
+
+ CNum indexInFolder = 0;
+
+ if (opCallback)
+ {
+ RINOK(opCallback->ReportOperation(
+ NEventIndexType::kBlockIndex, (UInt32)folderIndex,
+ NUpdateNotifyOp::kRepack))
+ }
+
+ /* We could reduce data size of decoded folder, if we don't need to repack
+ last files in folder. But the gain in speed is small in most cases.
+ So we unpack full folder. */
+
+ UInt64 sizeToEncode = 0;
+
+ /*
+ UInt64 importantUnpackSize = 0;
+ unsigned numImportantFiles = 0;
+ UInt64 decodeSize = 0;
+ */
+
+ for (CNum fi = db->FolderStartFileIndex[folderIndex]; indexInFolder < numUnpackStreams; fi++)
+ {
+ bool needExtract = false;
+ const CFileItem &file = db->Files[fi];
+
+ if (file.HasStream)
+ {
+ indexInFolder++;
+ int updateIndex = fileIndexToUpdateIndexMap[fi];
+ if (updateIndex >= 0 && !updateItems[updateIndex].NewData)
+ needExtract = true;
+ // decodeSize += file.Size;
+ }
+
+ extractStatuses.Add(needExtract);
+ if (needExtract)
+ {
+ sizeToEncode += file.Size;
+ /*
+ numImportantFiles = extractStatuses.Size();
+ importantUnpackSize = decodeSize;
+ */
+ }
+ }
+
+ // extractStatuses.DeleteFrom(numImportantFiles);
+
+ unsigned startPackIndex = newDatabase.PackSizes.Size();
+ UInt64 curUnpackSize;
+ {
+
+ CMyComPtr<ISequentialInStream> sbInStream;
+ CRepackStreamBase *repackBase;
+ CFolderInStream2 *FosSpec2 = NULL;
+
+ CRepackInStreamWithSizes *inStreamSizeCountSpec = new CRepackInStreamWithSizes;
+ CMyComPtr<ISequentialInStream> inStreamSizeCount = inStreamSizeCountSpec;
+ {
+ #ifndef _7ZIP_ST
+ if (options.MultiThreadMixer)
+ {
+ repackBase = threadDecoder.FosSpec;
+ CMyComPtr<ISequentialOutStream> sbOutStream;
+ sb.CreateStreams(&sbInStream, &sbOutStream);
+ sb.ReInit();
+
+ threadDecoder.FosSpec->_stream = sbOutStream;
+
+ threadDecoder.InStream = inStream;
+ threadDecoder.StartPos = db->ArcInfo.DataStartPosition; // db->GetFolderStreamPos(folderIndex, 0);
+ threadDecoder.Folders = (const CFolders *)db;
+ threadDecoder.FolderIndex = folderIndex;
+
+ // threadDecoder.UnpackSize = importantUnpackSize;
+ // threadDecoder.send_UnpackSize = true;
+ }
+ else
+ #endif
+ {
+ FosSpec2 = new CFolderInStream2;
+ FosSpec2->Init();
+ sbInStream = FosSpec2;
+ repackBase = FosSpec2;
+
+ #ifndef _NO_CRYPTO
+ bool isEncrypted = false;
+ bool passwordIsDefined = false;
+ UString password;
+ #endif
+
+ CMyComPtr<ISequentialInStream> decodedStream;
+ bool dataAfterEnd_Error = false;
+
+ HRESULT res = threadDecoder.Decoder.Decode(
+ EXTERNAL_CODECS_LOC_VARS
+ inStream,
+ db->ArcInfo.DataStartPosition, // db->GetFolderStreamPos(folderIndex, 0);,
+ *db, folderIndex,
+ // &importantUnpackSize, // *unpackSize
+ NULL, // *unpackSize : FULL unpack
+
+ NULL, // *outStream
+ NULL, // *compressProgress
+
+ &decodedStream
+ , dataAfterEnd_Error
+
+ _7Z_DECODER_CRYPRO_VARS
+ #ifndef _7ZIP_ST
+ , false // mtMode
+ , 1 // numThreads
+ , 0 // memUsage
+ #endif
+ );
+
+ RINOK(res);
+ if (!decodedStream)
+ return E_FAIL;
+
+ FosSpec2->_inStream = decodedStream;
+ }
+
+ repackBase->_db = db;
+ repackBase->_opCallback = opCallback;
+ repackBase->_extractCallback = extractCallback;
+
+ UInt32 startIndex = db->FolderStartFileIndex[folderIndex];
+ RINOK(repackBase->Init(startIndex, &extractStatuses));
+
+ inStreamSizeCountSpec->_db = db;
+ inStreamSizeCountSpec->Init(sbInStream, startIndex, &extractStatuses);
+
+ #ifndef _7ZIP_ST
+ if (options.MultiThreadMixer)
+ {
+ threadDecoder.Start();
+ }
+ #endif
+ }
+
+ curUnpackSize = sizeToEncode;
+
+ HRESULT encodeRes = encoder.Encode(
+ EXTERNAL_CODECS_LOC_VARS
+ inStreamSizeCount,
+ // NULL,
+ &inSizeForReduce,
+ newDatabase.Folders.AddNew(), newDatabase.CoderUnpackSizes, curUnpackSize,
+ archive.SeqStream, newDatabase.PackSizes, progress);
+
+ if (encodeRes == k_My_HRESULT_CRC_ERROR)
+ return E_FAIL;
+
+ #ifndef _7ZIP_ST
+ if (options.MultiThreadMixer)
+ {
+ // 16.00: hang was fixed : for case if decoding was not finished.
+ // We close CBinderInStream and it calls CStreamBinder::CloseRead()
+ inStreamSizeCount.Release();
+ sbInStream.Release();
+
+ threadDecoder.WaitExecuteFinish();
+
+ HRESULT decodeRes = threadDecoder.Result;
+ // if (res == k_My_HRESULT_CRC_ERROR)
+ if (decodeRes == S_FALSE || threadDecoder.dataAfterEnd_Error)
+ {
+ if (extractCallback)
+ {
+ RINOK(extractCallback->ReportExtractResult(
+ NEventIndexType::kInArcIndex, db->FolderStartFileIndex[folderIndex],
+ // NEventIndexType::kBlockIndex, (UInt32)folderIndex,
+ (decodeRes != S_OK ?
+ NExtract::NOperationResult::kDataError :
+ NExtract::NOperationResult::kDataAfterEnd)));
+ }
+ if (decodeRes != S_OK)
+ return E_FAIL;
+ }
+ RINOK(decodeRes);
+ if (encodeRes == S_OK)
+ if (sb.ProcessedSize != sizeToEncode)
+ encodeRes = E_FAIL;
+ }
+ else
+ #endif
+ {
+ if (FosSpec2->Result == S_FALSE)
+ {
+ if (extractCallback)
+ {
+ RINOK(extractCallback->ReportExtractResult(
+ NEventIndexType::kBlockIndex, (UInt32)folderIndex,
+ NExtract::NOperationResult::kDataError));
+ }
+ return E_FAIL;
+ }
+ RINOK(FosSpec2->Result);
+ }
+
+ RINOK(encodeRes);
+ RINOK(repackBase->CheckFinishedState());
+
+ if (curUnpackSize != sizeToEncode)
+ return E_FAIL;
+ }
+
+ for (; startPackIndex < newDatabase.PackSizes.Size(); startPackIndex++)
+ lps->OutSize += newDatabase.PackSizes[startPackIndex];
+ lps->InSize += curUnpackSize;
+ }
+
+ newDatabase.NumUnpackStreamsVector.Add(rep.NumCopyFiles);
+
+ CNum indexInFolder = 0;
+ for (CNum fi = db->FolderStartFileIndex[folderIndex]; indexInFolder < numUnpackStreams; fi++)
+ {
+ if (db->Files[fi].HasStream)
+ {
+ indexInFolder++;
+ int updateIndex = fileIndexToUpdateIndexMap[fi];
+ if (updateIndex >= 0)
+ {
+ const CUpdateItem &ui = updateItems[updateIndex];
+ if (ui.NewData)
+ continue;
+
+ UString name;
+ CFileItem file;
+ CFileItem2 file2;
+ GetFile(*db, fi, file, file2);
+
+ if (ui.NewProps)
+ {
+ UpdateItem_To_FileItem2(ui, file2);
+ file.IsDir = ui.IsDir;
+ name = ui.Name;
+ }
+ else
+ db->GetPath(fi, name);
+
+ /*
+ file.Parent = ui.ParentFolderIndex;
+ if (ui.TreeFolderIndex >= 0)
+ treeFolderToArcIndex[ui.TreeFolderIndex] = newDatabase.Files.Size();
+ if (totalSecureDataSize != 0)
+ newDatabase.SecureIDs.Add(ui.SecureIndex);
+ */
+ newDatabase.AddFile(file, file2, name);
+ }
+ }
+ }
+ }
+
+
+ // ---------- Compress files to new solid blocks ----------
+
+ unsigned numFiles = group.Indices.Size();
+ if (numFiles == 0)
+ continue;
+ CRecordVector<CRefItem> refItems;
+ refItems.ClearAndSetSize(numFiles);
+ // bool sortByType = (options.UseTypeSorting && isSoid); // numSolidFiles > 1
+ bool sortByType = options.UseTypeSorting;
+
+ unsigned i;
+
+ for (i = 0; i < numFiles; i++)
+ refItems[i] = CRefItem(group.Indices[i], updateItems[group.Indices[i]], sortByType);
+
+ CSortParam sortParam;
+ // sortParam.TreeFolders = &treeFolders;
+ sortParam.SortByType = sortByType;
+ refItems.Sort(CompareUpdateItems, (void *)&sortParam);
+
+ CObjArray<UInt32> indices(numFiles);
+
+ for (i = 0; i < numFiles; i++)
+ {
+ UInt32 index = refItems[i].Index;
+ indices[i] = index;
+ /*
+ const CUpdateItem &ui = updateItems[index];
+ CFileItem file;
+ if (ui.NewProps)
+ UpdateItem_To_FileItem(ui, file);
+ else
+ file = db.Files[ui.IndexInArchive];
+ if (file.IsAnti || file.IsDir)
+ return E_FAIL;
+ newDatabase.Files.Add(file);
+ */
+ }
+
+ for (i = 0; i < numFiles;)
+ {
+ UInt64 totalSize = 0;
+ unsigned numSubFiles;
+
+ const wchar_t *prevExtension = NULL;
+
+ for (numSubFiles = 0; i + numSubFiles < numFiles && numSubFiles < numSolidFiles; numSubFiles++)
+ {
+ const CUpdateItem &ui = updateItems[indices[i + numSubFiles]];
+ totalSize += ui.Size;
+ if (totalSize > options.NumSolidBytes)
+ break;
+ if (options.SolidExtension)
+ {
+ int slashPos = ui.Name.ReverseFind_PathSepar();
+ int dotPos = ui.Name.ReverseFind_Dot();
+ const wchar_t *ext = ui.Name.Ptr(dotPos <= slashPos ? ui.Name.Len() : dotPos + 1);
+ if (numSubFiles == 0)
+ prevExtension = ext;
+ else if (!StringsAreEqualNoCase(ext, prevExtension))
+ break;
+ }
+ }
+
+ if (numSubFiles < 1)
+ numSubFiles = 1;
+
+ RINOK(lps->SetCur());
+
+ CFolderInStream *inStreamSpec = new CFolderInStream;
+ CMyComPtr<ISequentialInStream> solidInStream(inStreamSpec);
+ inStreamSpec->Init(updateCallback, &indices[i], numSubFiles);
+
+ unsigned startPackIndex = newDatabase.PackSizes.Size();
+ UInt64 curFolderUnpackSize = totalSize;
+ // curFolderUnpackSize = (UInt64)(Int64)-1;
+
+ RINOK(encoder.Encode(
+ EXTERNAL_CODECS_LOC_VARS
+ solidInStream,
+ // NULL,
+ &inSizeForReduce,
+ newDatabase.Folders.AddNew(), newDatabase.CoderUnpackSizes, curFolderUnpackSize,
+ archive.SeqStream, newDatabase.PackSizes, progress));
+
+ if (!inStreamSpec->WasFinished())
+ return E_FAIL;
+
+ for (; startPackIndex < newDatabase.PackSizes.Size(); startPackIndex++)
+ lps->OutSize += newDatabase.PackSizes[startPackIndex];
+
+ lps->InSize += curFolderUnpackSize;
+ // for ()
+ // newDatabase.PackCRCsDefined.Add(false);
+ // newDatabase.PackCRCs.Add(0);
+
+ CNum numUnpackStreams = 0;
+ UInt64 skippedSize = 0;
+
+ for (unsigned subIndex = 0; subIndex < numSubFiles; subIndex++)
+ {
+ const CUpdateItem &ui = updateItems[indices[i + subIndex]];
+ CFileItem file;
+ CFileItem2 file2;
+ UString name;
+ if (ui.NewProps)
+ {
+ UpdateItem_To_FileItem(ui, file, file2);
+ name = ui.Name;
+ }
+ else
+ {
+ GetFile(*db, ui.IndexInArchive, file, file2);
+ db->GetPath(ui.IndexInArchive, name);
+ }
+ if (file2.IsAnti || file.IsDir)
+ return E_FAIL;
+
+ /*
+ CFileItem &file = newDatabase.Files[
+ startFileIndexInDatabase + i + subIndex];
+ */
+ if (!inStreamSpec->Processed[subIndex])
+ {
+ skippedSize += ui.Size;
+ continue;
+ // file.Name += ".locked";
+ }
+
+ file.Crc = inStreamSpec->CRCs[subIndex];
+ file.Size = inStreamSpec->Sizes[subIndex];
+
+ // if (file.Size >= 0) // test purposes
+ if (file.Size != 0)
+ {
+ file.CrcDefined = true;
+ file.HasStream = true;
+ numUnpackStreams++;
+ }
+ else
+ {
+ file.CrcDefined = false;
+ file.HasStream = false;
+ }
+
+ /*
+ file.Parent = ui.ParentFolderIndex;
+ if (ui.TreeFolderIndex >= 0)
+ treeFolderToArcIndex[ui.TreeFolderIndex] = newDatabase.Files.Size();
+ if (totalSecureDataSize != 0)
+ newDatabase.SecureIDs.Add(ui.SecureIndex);
+ */
+ newDatabase.AddFile(file, file2, name);
+ }
+
+ // numUnpackStreams = 0 is very bad case for locked files
+ // v3.13 doesn't understand it.
+ newDatabase.NumUnpackStreamsVector.Add(numUnpackStreams);
+ i += numSubFiles;
+
+ if (skippedSize != 0 && complexity >= skippedSize)
+ {
+ complexity -= skippedSize;
+ RINOK(updateCallback->SetTotal(complexity));
+ }
+ }
+ }
+
+ RINOK(lps->SetCur());
+
+ /*
+ fileIndexToUpdateIndexMap.ClearAndFree();
+ groups.ClearAndFree();
+ */
+
+ /*
+ for (i = 0; i < newDatabase.Files.Size(); i++)
+ {
+ CFileItem &file = newDatabase.Files[i];
+ file.Parent = treeFolderToArcIndex[file.Parent];
+ }
+
+ if (totalSecureDataSize != 0)
+ {
+ newDatabase.SecureBuf.SetCapacity(totalSecureDataSize);
+ size_t pos = 0;
+ newDatabase.SecureSizes.Reserve(secureBlocks.Sorted.Size());
+ for (i = 0; i < secureBlocks.Sorted.Size(); i++)
+ {
+ const CByteBuffer &buf = secureBlocks.Bufs[secureBlocks.Sorted[i]];
+ size_t size = buf.GetCapacity();
+ if (size != 0)
+ memcpy(newDatabase.SecureBuf + pos, buf, size);
+ newDatabase.SecureSizes.Add((UInt32)size);
+ pos += size;
+ }
+ }
+ */
+ newDatabase.ReserveDown();
+
+ if (opCallback)
+ RINOK(opCallback->ReportOperation(NEventIndexType::kNoIndex, (UInt32)(Int32)-1, NUpdateNotifyOp::kHeader));
+
+ return S_OK;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.h
new file mode 100644
index 0000000000..06a0b05fb0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/7zUpdate.h
@@ -0,0 +1,139 @@
+// 7zUpdate.h
+
+#ifndef __7Z_UPDATE_H
+#define __7Z_UPDATE_H
+
+#include "../IArchive.h"
+
+// #include "../../Common/UniqBlocks.h"
+
+#include "7zCompressionMode.h"
+#include "7zIn.h"
+#include "7zOut.h"
+
+namespace NArchive {
+namespace N7z {
+
+/*
+struct CTreeFolder
+{
+ UString Name;
+ int Parent;
+ CIntVector SubFolders;
+ int UpdateItemIndex;
+ int SortIndex;
+ int SortIndexEnd;
+
+ CTreeFolder(): UpdateItemIndex(-1) {}
+};
+*/
+
+struct CUpdateItem
+{
+ int IndexInArchive;
+ int IndexInClient;
+
+ UInt64 CTime;
+ UInt64 ATime;
+ UInt64 MTime;
+
+ UInt64 Size;
+ UString Name;
+ /*
+ bool IsAltStream;
+ int ParentFolderIndex;
+ int TreeFolderIndex;
+ */
+
+ // that code is not used in 9.26
+ // int ParentSortIndex;
+ // int ParentSortIndexEnd;
+
+ UInt32 Attrib;
+
+ bool NewData;
+ bool NewProps;
+
+ bool IsAnti;
+ bool IsDir;
+
+ bool AttribDefined;
+ bool CTimeDefined;
+ bool ATimeDefined;
+ bool MTimeDefined;
+
+ // int SecureIndex; // 0 means (no_security)
+
+ bool HasStream() const { return !IsDir && !IsAnti && Size != 0; }
+ // bool HasStream() const { return !IsDir && !IsAnti /* && Size != 0 */; } // for test purposes
+
+ CUpdateItem():
+ // ParentSortIndex(-1),
+ // IsAltStream(false),
+ IsAnti(false),
+ IsDir(false),
+ AttribDefined(false),
+ CTimeDefined(false),
+ ATimeDefined(false),
+ MTimeDefined(false)
+ // SecureIndex(0)
+ {}
+ void SetDirStatusFromAttrib() { IsDir = ((Attrib & FILE_ATTRIBUTE_DIRECTORY) != 0); }
+
+ // unsigned GetExtensionPos() const;
+ // UString GetExtension() const;
+};
+
+struct CUpdateOptions
+{
+ const CCompressionMethodMode *Method;
+ const CCompressionMethodMode *HeaderMethod;
+ bool UseFilters; // use additional filters for some files
+ bool MaxFilter; // use BCJ2 filter instead of BCJ
+ int AnalysisLevel;
+
+ CHeaderOptions HeaderOptions;
+
+ UInt64 NumSolidFiles;
+ UInt64 NumSolidBytes;
+ bool SolidExtension;
+
+ bool UseTypeSorting;
+
+ bool RemoveSfxBlock;
+ bool MultiThreadMixer;
+
+ CUpdateOptions():
+ Method(NULL),
+ HeaderMethod(NULL),
+ UseFilters(false),
+ MaxFilter(false),
+ AnalysisLevel(-1),
+ NumSolidFiles((UInt64)(Int64)(-1)),
+ NumSolidBytes((UInt64)(Int64)(-1)),
+ SolidExtension(false),
+ UseTypeSorting(true),
+ RemoveSfxBlock(false),
+ MultiThreadMixer(true)
+ {}
+};
+
+HRESULT Update(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ IInStream *inStream,
+ const CDbEx *db,
+ const CObjectVector<CUpdateItem> &updateItems,
+ // const CObjectVector<CTreeFolder> &treeFolders, // treeFolders[0] is root
+ // const CUniqBlocks &secureBlocks,
+ COutArchive &archive,
+ CArchiveDatabaseOut &newDatabase,
+ ISequentialOutStream *seqOutStream,
+ IArchiveUpdateCallback *updateCallback,
+ const CUpdateOptions &options
+ #ifndef _NO_CRYPTO
+ , ICryptoGetTextPassword *getDecoderPassword
+ #endif
+ );
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.cpp
index c6d3b1fa62..c6d3b1fa62 100644
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/StdAfx.cpp
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.cpp
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/7z/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Archive.def b/other-licenses/7zstub/src/CPP/7zip/Archive/Archive.def
new file mode 100644
index 0000000000..a3fe6ddaaf
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Archive.def
@@ -0,0 +1,12 @@
+EXPORTS
+ CreateObject PRIVATE
+
+ GetHandlerProperty PRIVATE
+ GetNumberOfFormats PRIVATE
+ GetHandlerProperty2 PRIVATE
+ GetIsArc PRIVATE
+
+ SetCodecs PRIVATE
+
+ SetLargePageMode PRIVATE
+ SetCaseSensitive PRIVATE
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Archive2.def b/other-licenses/7zstub/src/CPP/7zip/Archive/Archive2.def
new file mode 100644
index 0000000000..de744b5f74
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Archive2.def
@@ -0,0 +1,19 @@
+EXPORTS
+ CreateObject PRIVATE
+
+ GetHandlerProperty PRIVATE
+ GetNumberOfFormats PRIVATE
+ GetHandlerProperty2 PRIVATE
+ GetIsArc PRIVATE
+
+ GetNumberOfMethods PRIVATE
+ GetMethodProperty PRIVATE
+ CreateDecoder PRIVATE
+ CreateEncoder PRIVATE
+
+ GetHashers PRIVATE
+
+ SetCodecs PRIVATE
+
+ SetLargePageMode PRIVATE
+ SetCaseSensitive PRIVATE
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/ArchiveExports.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/ArchiveExports.cpp
new file mode 100644
index 0000000000..94f2fff007
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/ArchiveExports.cpp
@@ -0,0 +1,151 @@
+// ArchiveExports.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/7zVersion.h"
+
+#include "../../Common/ComTry.h"
+
+#include "../../Windows/PropVariant.h"
+
+#include "../Common/RegisterArc.h"
+
+static const unsigned kNumArcsMax = 64;
+static unsigned g_NumArcs = 0;
+static unsigned g_DefaultArcIndex = 0;
+static const CArcInfo *g_Arcs[kNumArcsMax];
+
+void RegisterArc(const CArcInfo *arcInfo) throw()
+{
+ if (g_NumArcs < kNumArcsMax)
+ {
+ const char *p = arcInfo->Name;
+ if (p[0] == '7' && p[1] == 'z' && p[2] == 0)
+ g_DefaultArcIndex = g_NumArcs;
+ g_Arcs[g_NumArcs++] = arcInfo;
+ }
+}
+
+DEFINE_GUID(CLSID_CArchiveHandler,
+ k_7zip_GUID_Data1,
+ k_7zip_GUID_Data2,
+ k_7zip_GUID_Data3_Common,
+ 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00);
+
+#define CLS_ARC_ID_ITEM(cls) ((cls).Data4[5])
+
+static inline HRESULT SetPropStrFromBin(const char *s, unsigned size, PROPVARIANT *value)
+{
+ if ((value->bstrVal = ::SysAllocStringByteLen(s, size)) != 0)
+ value->vt = VT_BSTR;
+ return S_OK;
+}
+
+static inline HRESULT SetPropGUID(const GUID &guid, PROPVARIANT *value)
+{
+ return SetPropStrFromBin((const char *)&guid, sizeof(guid), value);
+}
+
+int FindFormatCalssId(const GUID *clsid)
+{
+ GUID cls = *clsid;
+ CLS_ARC_ID_ITEM(cls) = 0;
+ if (cls != CLSID_CArchiveHandler)
+ return -1;
+ Byte id = CLS_ARC_ID_ITEM(*clsid);
+ for (unsigned i = 0; i < g_NumArcs; i++)
+ if (g_Arcs[i]->Id == id)
+ return (int)i;
+ return -1;
+}
+
+STDAPI CreateArchiver(const GUID *clsid, const GUID *iid, void **outObject)
+{
+ COM_TRY_BEGIN
+ {
+ int needIn = (*iid == IID_IInArchive);
+ int needOut = (*iid == IID_IOutArchive);
+ if (!needIn && !needOut)
+ return E_NOINTERFACE;
+ int formatIndex = FindFormatCalssId(clsid);
+ if (formatIndex < 0)
+ return CLASS_E_CLASSNOTAVAILABLE;
+
+ const CArcInfo &arc = *g_Arcs[formatIndex];
+ if (needIn)
+ {
+ *outObject = arc.CreateInArchive();
+ ((IInArchive *)*outObject)->AddRef();
+ }
+ else
+ {
+ if (!arc.CreateOutArchive)
+ return CLASS_E_CLASSNOTAVAILABLE;
+ *outObject = arc.CreateOutArchive();
+ ((IOutArchive *)*outObject)->AddRef();
+ }
+ }
+ COM_TRY_END
+ return S_OK;
+}
+
+STDAPI GetHandlerProperty2(UInt32 formatIndex, PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ NWindows::NCOM::PropVariant_Clear(value);
+ if (formatIndex >= g_NumArcs)
+ return E_INVALIDARG;
+ const CArcInfo &arc = *g_Arcs[formatIndex];
+ NWindows::NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case NArchive::NHandlerPropID::kName: prop = arc.Name; break;
+ case NArchive::NHandlerPropID::kClassID:
+ {
+ GUID clsId = CLSID_CArchiveHandler;
+ CLS_ARC_ID_ITEM(clsId) = arc.Id;
+ return SetPropGUID(clsId, value);
+ }
+ case NArchive::NHandlerPropID::kExtension: if (arc.Ext) prop = arc.Ext; break;
+ case NArchive::NHandlerPropID::kAddExtension: if (arc.AddExt) prop = arc.AddExt; break;
+ case NArchive::NHandlerPropID::kUpdate: prop = (bool)(arc.CreateOutArchive != NULL); break;
+ case NArchive::NHandlerPropID::kKeepName: prop = ((arc.Flags & NArcInfoFlags::kKeepName) != 0); break;
+ case NArchive::NHandlerPropID::kAltStreams: prop = ((arc.Flags & NArcInfoFlags::kAltStreams) != 0); break;
+ case NArchive::NHandlerPropID::kNtSecure: prop = ((arc.Flags & NArcInfoFlags::kNtSecure) != 0); break;
+ case NArchive::NHandlerPropID::kFlags: prop = (UInt32)arc.Flags; break;
+ case NArchive::NHandlerPropID::kSignatureOffset: prop = (UInt32)arc.SignatureOffset; break;
+ // case NArchive::NHandlerPropID::kVersion: prop = (UInt32)MY_VER_MIX; break;
+
+ case NArchive::NHandlerPropID::kSignature:
+ if (arc.SignatureSize != 0 && !arc.IsMultiSignature())
+ return SetPropStrFromBin((const char *)arc.Signature, arc.SignatureSize, value);
+ break;
+ case NArchive::NHandlerPropID::kMultiSignature:
+ if (arc.SignatureSize != 0 && arc.IsMultiSignature())
+ return SetPropStrFromBin((const char *)arc.Signature, arc.SignatureSize, value);
+ break;
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+STDAPI GetHandlerProperty(PROPID propID, PROPVARIANT *value)
+{
+ return GetHandlerProperty2(g_DefaultArcIndex, propID, value);
+}
+
+STDAPI GetNumberOfFormats(UINT32 *numFormats)
+{
+ *numFormats = g_NumArcs;
+ return S_OK;
+}
+
+STDAPI GetIsArc(UInt32 formatIndex, Func_IsArc *isArc)
+{
+ *isArc = NULL;
+ if (formatIndex >= g_NumArcs)
+ return E_INVALIDARG;
+ *isArc = g_Arcs[formatIndex]->IsArc;
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.cpp
new file mode 100644
index 0000000000..d4d9949502
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.cpp
@@ -0,0 +1,1124 @@
+// CoderMixer2.cpp
+
+#include "StdAfx.h"
+
+#include "CoderMixer2.h"
+
+#ifdef USE_MIXER_ST
+
+STDMETHODIMP CSequentialInStreamCalcSize::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessed = 0;
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Read(data, size, &realProcessed);
+ _size += realProcessed;
+ if (size != 0 && realProcessed == 0)
+ _wasFinished = true;
+ if (processedSize)
+ *processedSize = realProcessed;
+ return result;
+}
+
+
+STDMETHODIMP COutStreamCalcSize::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Write(data, size, &size);
+ _size += size;
+ if (processedSize)
+ *processedSize = size;
+ return result;
+}
+
+STDMETHODIMP COutStreamCalcSize::OutStreamFinish()
+{
+ HRESULT result = S_OK;
+ if (_stream)
+ {
+ CMyComPtr<IOutStreamFinish> outStreamFinish;
+ _stream.QueryInterface(IID_IOutStreamFinish, &outStreamFinish);
+ if (outStreamFinish)
+ result = outStreamFinish->OutStreamFinish();
+ }
+ return result;
+}
+
+#endif
+
+
+
+
+namespace NCoderMixer2 {
+
+static void BoolVector_Fill_False(CBoolVector &v, unsigned size)
+{
+ v.ClearAndSetSize(size);
+ bool *p = &v[0];
+ for (unsigned i = 0; i < size; i++)
+ p[i] = false;
+}
+
+
+HRESULT CCoder::CheckDataAfterEnd(bool &dataAfterEnd_Error /* , bool &InternalPackSizeError */) const
+{
+ if (Coder)
+ {
+ if (PackSizePointers.IsEmpty() || !PackSizePointers[0])
+ return S_OK;
+ CMyComPtr<ICompressGetInStreamProcessedSize> getInStreamProcessedSize;
+ Coder.QueryInterface(IID_ICompressGetInStreamProcessedSize, (void **)&getInStreamProcessedSize);
+ // if (!getInStreamProcessedSize) return E_FAIL;
+ if (getInStreamProcessedSize)
+ {
+ UInt64 processed;
+ RINOK(getInStreamProcessedSize->GetInStreamProcessedSize(&processed));
+ if (processed != (UInt64)(Int64)-1)
+ {
+ const UInt64 size = PackSizes[0];
+ if (processed < size && Finish)
+ dataAfterEnd_Error = true;
+ if (processed > size)
+ {
+ // InternalPackSizeError = true;
+ // return S_FALSE;
+ }
+ }
+ }
+ }
+ else if (Coder2)
+ {
+ CMyComPtr<ICompressGetInStreamProcessedSize2> getInStreamProcessedSize2;
+ Coder2.QueryInterface(IID_ICompressGetInStreamProcessedSize2, (void **)&getInStreamProcessedSize2);
+ FOR_VECTOR (i, PackSizePointers)
+ {
+ if (!PackSizePointers[i])
+ continue;
+ UInt64 processed;
+ RINOK(getInStreamProcessedSize2->GetInStreamProcessedSize2(i, &processed));
+ if (processed != (UInt64)(Int64)-1)
+ {
+ const UInt64 size = PackSizes[i];
+ if (processed < size && Finish)
+ dataAfterEnd_Error = true;
+ else if (processed > size)
+ {
+ // InternalPackSizeError = true;
+ // return S_FALSE;
+ }
+ }
+ }
+ }
+
+ return S_OK;
+}
+
+
+
+class CBondsChecks
+{
+ CBoolVector _coderUsed;
+
+ bool Init();
+ bool CheckCoder(unsigned coderIndex);
+public:
+ const CBindInfo *BindInfo;
+
+ bool Check();
+};
+
+bool CBondsChecks::CheckCoder(unsigned coderIndex)
+{
+ const CCoderStreamsInfo &coder = BindInfo->Coders[coderIndex];
+
+ if (coderIndex >= _coderUsed.Size() || _coderUsed[coderIndex])
+ return false;
+ _coderUsed[coderIndex] = true;
+
+ UInt32 start = BindInfo->Coder_to_Stream[coderIndex];
+
+ for (unsigned i = 0; i < coder.NumStreams; i++)
+ {
+ UInt32 ind = start + i;
+
+ if (BindInfo->IsStream_in_PackStreams(ind))
+ continue;
+
+ int bond = BindInfo->FindBond_for_PackStream(ind);
+ if (bond < 0)
+ return false;
+ if (!CheckCoder(BindInfo->Bonds[bond].UnpackIndex))
+ return false;
+ }
+
+ return true;
+}
+
+bool CBondsChecks::Check()
+{
+ BoolVector_Fill_False(_coderUsed, BindInfo->Coders.Size());
+
+ if (!CheckCoder(BindInfo->UnpackCoder))
+ return false;
+
+ FOR_VECTOR(i, _coderUsed)
+ if (!_coderUsed[i])
+ return false;
+
+ return true;
+}
+
+void CBindInfo::ClearMaps()
+{
+ Coder_to_Stream.Clear();
+ Stream_to_Coder.Clear();
+}
+
+bool CBindInfo::CalcMapsAndCheck()
+{
+ ClearMaps();
+
+ UInt32 numStreams = 0;
+
+ if (Coders.Size() == 0)
+ return false;
+ if (Coders.Size() - 1 != Bonds.Size())
+ return false;
+
+ FOR_VECTOR(i, Coders)
+ {
+ Coder_to_Stream.Add(numStreams);
+
+ const CCoderStreamsInfo &c = Coders[i];
+
+ for (unsigned j = 0; j < c.NumStreams; j++)
+ Stream_to_Coder.Add(i);
+
+ numStreams += c.NumStreams;
+ }
+
+ if (numStreams != GetNum_Bonds_and_PackStreams())
+ return false;
+
+ CBondsChecks bc;
+ bc.BindInfo = this;
+ return bc.Check();
+}
+
+
+void CCoder::SetCoderInfo(const UInt64 *unpackSize, const UInt64 * const *packSizes, bool finish)
+{
+ Finish = finish;
+
+ if (unpackSize)
+ {
+ UnpackSize = *unpackSize;
+ UnpackSizePointer = &UnpackSize;
+ }
+ else
+ {
+ UnpackSize = 0;
+ UnpackSizePointer = NULL;
+ }
+
+ PackSizes.ClearAndSetSize((unsigned)NumStreams);
+ PackSizePointers.ClearAndSetSize((unsigned)NumStreams);
+
+ for (unsigned i = 0; i < NumStreams; i++)
+ {
+ if (packSizes && packSizes[i])
+ {
+ PackSizes[i] = *(packSizes[i]);
+ PackSizePointers[i] = &PackSizes[i];
+ }
+ else
+ {
+ PackSizes[i] = 0;
+ PackSizePointers[i] = NULL;
+ }
+ }
+}
+
+bool CMixer::Is_UnpackSize_Correct_for_Coder(UInt32 coderIndex)
+{
+ if (coderIndex == _bi.UnpackCoder)
+ return true;
+
+ int bond = _bi.FindBond_for_UnpackStream(coderIndex);
+ if (bond < 0)
+ throw 20150213;
+
+ /*
+ UInt32 coderIndex, coderStreamIndex;
+ _bi.GetCoder_for_Stream(_bi.Bonds[bond].PackIndex, coderIndex, coderStreamIndex);
+ */
+ UInt32 nextCoder = _bi.Stream_to_Coder[_bi.Bonds[bond].PackIndex];
+
+ if (!IsFilter_Vector[nextCoder])
+ return false;
+
+ return Is_UnpackSize_Correct_for_Coder(nextCoder);
+}
+
+bool CMixer::Is_PackSize_Correct_for_Stream(UInt32 streamIndex)
+{
+ if (_bi.IsStream_in_PackStreams(streamIndex))
+ return true;
+
+ int bond = _bi.FindBond_for_PackStream(streamIndex);
+ if (bond < 0)
+ throw 20150213;
+
+ UInt32 nextCoder = _bi.Bonds[bond].UnpackIndex;
+
+ if (!IsFilter_Vector[nextCoder])
+ return false;
+
+ return Is_PackSize_Correct_for_Coder(nextCoder);
+}
+
+bool CMixer::Is_PackSize_Correct_for_Coder(UInt32 coderIndex)
+{
+ UInt32 startIndex = _bi.Coder_to_Stream[coderIndex];
+ UInt32 numStreams = _bi.Coders[coderIndex].NumStreams;
+ for (UInt32 i = 0; i < numStreams; i++)
+ if (!Is_PackSize_Correct_for_Stream(startIndex + i))
+ return false;
+ return true;
+}
+
+bool CMixer::IsThere_ExternalCoder_in_PackTree(UInt32 coderIndex)
+{
+ if (IsExternal_Vector[coderIndex])
+ return true;
+ UInt32 startIndex = _bi.Coder_to_Stream[coderIndex];
+ UInt32 numStreams = _bi.Coders[coderIndex].NumStreams;
+ for (UInt32 i = 0; i < numStreams; i++)
+ {
+ UInt32 si = startIndex + i;
+ if (_bi.IsStream_in_PackStreams(si))
+ continue;
+
+ int bond = _bi.FindBond_for_PackStream(si);
+ if (bond < 0)
+ throw 20150213;
+
+ if (IsThere_ExternalCoder_in_PackTree(_bi.Bonds[bond].UnpackIndex))
+ return true;
+ }
+ return false;
+}
+
+
+
+
+#ifdef USE_MIXER_ST
+
+CMixerST::CMixerST(bool encodeMode):
+ CMixer(encodeMode)
+ {}
+
+CMixerST::~CMixerST() {}
+
+void CMixerST::AddCoder(const CCreatedCoder &cod)
+{
+ IsFilter_Vector.Add(cod.IsFilter);
+ IsExternal_Vector.Add(cod.IsExternal);
+ // const CCoderStreamsInfo &c = _bi.Coders[_coders.Size()];
+ CCoderST &c2 = _coders.AddNew();
+ c2.NumStreams = cod.NumStreams;
+ c2.Coder = cod.Coder;
+ c2.Coder2 = cod.Coder2;
+
+ /*
+ if (isFilter)
+ {
+ c2.CanRead = true;
+ c2.CanWrite = true;
+ }
+ else
+ */
+ {
+ IUnknown *unk = (cod.Coder ? (IUnknown *)cod.Coder : (IUnknown *)cod.Coder2);
+ {
+ CMyComPtr<ISequentialInStream> s;
+ unk->QueryInterface(IID_ISequentialInStream, (void**)&s);
+ c2.CanRead = (s != NULL);
+ }
+ {
+ CMyComPtr<ISequentialOutStream> s;
+ unk->QueryInterface(IID_ISequentialOutStream, (void**)&s);
+ c2.CanWrite = (s != NULL);
+ }
+ }
+}
+
+CCoder &CMixerST::GetCoder(unsigned index)
+{
+ return _coders[index];
+}
+
+void CMixerST::ReInit() {}
+
+HRESULT CMixerST::GetInStream2(
+ ISequentialInStream * const *inStreams, /* const UInt64 * const *inSizes, */
+ UInt32 outStreamIndex, ISequentialInStream **inStreamRes)
+{
+ UInt32 coderIndex = outStreamIndex, coderStreamIndex = 0;
+
+ if (EncodeMode)
+ {
+ _bi.GetCoder_for_Stream(outStreamIndex, coderIndex, coderStreamIndex);
+ if (coderStreamIndex != 0)
+ return E_NOTIMPL;
+ }
+
+ const CCoder &coder = _coders[coderIndex];
+
+ CMyComPtr<ISequentialInStream> seqInStream;
+ coder.QueryInterface(IID_ISequentialInStream, (void **)&seqInStream);
+ if (!seqInStream)
+ return E_NOTIMPL;
+
+ UInt32 numInStreams = EncodeMode ? 1 : coder.NumStreams;
+ UInt32 startIndex = EncodeMode ? coderIndex : _bi.Coder_to_Stream[coderIndex];
+
+ bool isSet = false;
+
+ if (numInStreams == 1)
+ {
+ CMyComPtr<ICompressSetInStream> setStream;
+ coder.QueryInterface(IID_ICompressSetInStream, (void **)&setStream);
+ if (setStream)
+ {
+ CMyComPtr<ISequentialInStream> seqInStream2;
+ RINOK(GetInStream(inStreams, /* inSizes, */ startIndex + 0, &seqInStream2));
+ RINOK(setStream->SetInStream(seqInStream2));
+ isSet = true;
+ }
+ }
+
+ if (!isSet && numInStreams != 0)
+ {
+ CMyComPtr<ICompressSetInStream2> setStream2;
+ coder.QueryInterface(IID_ICompressSetInStream2, (void **)&setStream2);
+ if (!setStream2)
+ return E_NOTIMPL;
+
+ for (UInt32 i = 0; i < numInStreams; i++)
+ {
+ CMyComPtr<ISequentialInStream> seqInStream2;
+ RINOK(GetInStream(inStreams, /* inSizes, */ startIndex + i, &seqInStream2));
+ RINOK(setStream2->SetInStream2(i, seqInStream2));
+ }
+ }
+
+ *inStreamRes = seqInStream.Detach();
+ return S_OK;
+}
+
+
+HRESULT CMixerST::GetInStream(
+ ISequentialInStream * const *inStreams, /* const UInt64 * const *inSizes, */
+ UInt32 inStreamIndex, ISequentialInStream **inStreamRes)
+{
+ CMyComPtr<ISequentialInStream> seqInStream;
+
+ {
+ int index = -1;
+ if (EncodeMode)
+ {
+ if (_bi.UnpackCoder == inStreamIndex)
+ index = 0;
+ }
+ else
+ index = _bi.FindStream_in_PackStreams(inStreamIndex);
+
+ if (index >= 0)
+ {
+ seqInStream = inStreams[(unsigned)index];
+ *inStreamRes = seqInStream.Detach();
+ return S_OK;
+ }
+ }
+
+ int bond = FindBond_for_Stream(
+ true, // forInputStream
+ inStreamIndex);
+ if (bond < 0)
+ return E_INVALIDARG;
+
+ RINOK(GetInStream2(inStreams, /* inSizes, */
+ _bi.Bonds[bond].Get_OutIndex(EncodeMode), &seqInStream));
+
+ while (_binderStreams.Size() <= (unsigned)bond)
+ _binderStreams.AddNew();
+ CStBinderStream &bs = _binderStreams[bond];
+
+ if (bs.StreamRef || bs.InStreamSpec)
+ return E_NOTIMPL;
+
+ CSequentialInStreamCalcSize *spec = new CSequentialInStreamCalcSize;
+ bs.StreamRef = spec;
+ bs.InStreamSpec = spec;
+
+ spec->SetStream(seqInStream);
+ spec->Init();
+
+ seqInStream = bs.InStreamSpec;
+
+ *inStreamRes = seqInStream.Detach();
+ return S_OK;
+}
+
+
+HRESULT CMixerST::GetOutStream(
+ ISequentialOutStream * const *outStreams, /* const UInt64 * const *outSizes, */
+ UInt32 outStreamIndex, ISequentialOutStream **outStreamRes)
+{
+ CMyComPtr<ISequentialOutStream> seqOutStream;
+
+ {
+ int index = -1;
+ if (!EncodeMode)
+ {
+ if (_bi.UnpackCoder == outStreamIndex)
+ index = 0;
+ }
+ else
+ index = _bi.FindStream_in_PackStreams(outStreamIndex);
+
+ if (index >= 0)
+ {
+ seqOutStream = outStreams[(unsigned)index];
+ *outStreamRes = seqOutStream.Detach();
+ return S_OK;
+ }
+ }
+
+ int bond = FindBond_for_Stream(
+ false, // forInputStream
+ outStreamIndex);
+ if (bond < 0)
+ return E_INVALIDARG;
+
+ UInt32 inStreamIndex = _bi.Bonds[bond].Get_InIndex(EncodeMode);
+
+ UInt32 coderIndex = inStreamIndex;
+ UInt32 coderStreamIndex = 0;
+
+ if (!EncodeMode)
+ _bi.GetCoder_for_Stream(inStreamIndex, coderIndex, coderStreamIndex);
+
+ CCoder &coder = _coders[coderIndex];
+
+ /*
+ if (!coder.Coder)
+ return E_NOTIMPL;
+ */
+
+ coder.QueryInterface(IID_ISequentialOutStream, (void **)&seqOutStream);
+ if (!seqOutStream)
+ return E_NOTIMPL;
+
+ UInt32 numOutStreams = EncodeMode ? coder.NumStreams : 1;
+ UInt32 startIndex = EncodeMode ? _bi.Coder_to_Stream[coderIndex]: coderIndex;
+
+ bool isSet = false;
+
+ if (numOutStreams == 1)
+ {
+ CMyComPtr<ICompressSetOutStream> setOutStream;
+ coder.Coder.QueryInterface(IID_ICompressSetOutStream, &setOutStream);
+ if (setOutStream)
+ {
+ CMyComPtr<ISequentialOutStream> seqOutStream2;
+ RINOK(GetOutStream(outStreams, /* outSizes, */ startIndex + 0, &seqOutStream2));
+ RINOK(setOutStream->SetOutStream(seqOutStream2));
+ isSet = true;
+ }
+ }
+
+ if (!isSet && numOutStreams != 0)
+ {
+ return E_NOTIMPL;
+ /*
+ CMyComPtr<ICompressSetOutStream2> setStream2;
+ coder.QueryInterface(IID_ICompressSetOutStream2, (void **)&setStream2);
+ if (!setStream2)
+ return E_NOTIMPL;
+ for (UInt32 i = 0; i < numOutStreams; i++)
+ {
+ CMyComPtr<ISequentialOutStream> seqOutStream2;
+ RINOK(GetOutStream(outStreams, startIndex + i, &seqOutStream2));
+ RINOK(setStream2->SetOutStream2(i, seqOutStream2));
+ }
+ */
+ }
+
+ while (_binderStreams.Size() <= (unsigned)bond)
+ _binderStreams.AddNew();
+ CStBinderStream &bs = _binderStreams[bond];
+
+ if (bs.StreamRef || bs.OutStreamSpec)
+ return E_NOTIMPL;
+
+ COutStreamCalcSize *spec = new COutStreamCalcSize;
+ bs.StreamRef = (ISequentialOutStream *)spec;
+ bs.OutStreamSpec = spec;
+
+ spec->SetStream(seqOutStream);
+ spec->Init();
+
+ seqOutStream = bs.OutStreamSpec;
+
+ *outStreamRes = seqOutStream.Detach();
+ return S_OK;
+}
+
+
+static HRESULT GetError(HRESULT res, HRESULT res2)
+{
+ if (res == res2)
+ return res;
+ if (res == S_OK)
+ return res2;
+ if (res == k_My_HRESULT_WritingWasCut)
+ {
+ if (res2 != S_OK)
+ return res2;
+ }
+ return res;
+}
+
+
+HRESULT CMixerST::FinishStream(UInt32 streamIndex)
+{
+ {
+ int index = -1;
+ if (!EncodeMode)
+ {
+ if (_bi.UnpackCoder == streamIndex)
+ index = 0;
+ }
+ else
+ index = _bi.FindStream_in_PackStreams(streamIndex);
+
+ if (index >= 0)
+ return S_OK;
+ }
+
+ int bond = FindBond_for_Stream(
+ false, // forInputStream
+ streamIndex);
+ if (bond < 0)
+ return E_INVALIDARG;
+
+ UInt32 inStreamIndex = _bi.Bonds[bond].Get_InIndex(EncodeMode);
+
+ UInt32 coderIndex = inStreamIndex;
+ UInt32 coderStreamIndex = 0;
+ if (!EncodeMode)
+ _bi.GetCoder_for_Stream(inStreamIndex, coderIndex, coderStreamIndex);
+
+ CCoder &coder = _coders[coderIndex];
+ CMyComPtr<IOutStreamFinish> finish;
+ coder.QueryInterface(IID_IOutStreamFinish, (void **)&finish);
+ HRESULT res = S_OK;
+ if (finish)
+ {
+ res = finish->OutStreamFinish();
+ }
+ return GetError(res, FinishCoder(coderIndex));
+}
+
+
+HRESULT CMixerST::FinishCoder(UInt32 coderIndex)
+{
+ CCoder &coder = _coders[coderIndex];
+
+ UInt32 numOutStreams = EncodeMode ? coder.NumStreams : 1;
+ UInt32 startIndex = EncodeMode ? _bi.Coder_to_Stream[coderIndex]: coderIndex;
+
+ HRESULT res = S_OK;
+ for (unsigned i = 0; i < numOutStreams; i++)
+ res = GetError(res, FinishStream(startIndex + i));
+ return res;
+}
+
+
+void CMixerST::SelectMainCoder(bool useFirst)
+{
+ unsigned ci = _bi.UnpackCoder;
+
+ int firstNonFilter = -1;
+ int firstAllowed = ci;
+
+ for (;;)
+ {
+ const CCoderST &coder = _coders[ci];
+ // break;
+
+ if (ci != _bi.UnpackCoder)
+ if (EncodeMode ? !coder.CanWrite : !coder.CanRead)
+ {
+ firstAllowed = ci;
+ firstNonFilter = -2;
+ }
+
+ if (coder.NumStreams != 1)
+ break;
+
+ UInt32 st = _bi.Coder_to_Stream[ci];
+ if (_bi.IsStream_in_PackStreams(st))
+ break;
+ int bond = _bi.FindBond_for_PackStream(st);
+ if (bond < 0)
+ throw 20150213;
+
+ if (EncodeMode ? !coder.CanRead : !coder.CanWrite)
+ break;
+
+ if (firstNonFilter == -1 && !IsFilter_Vector[ci])
+ firstNonFilter = ci;
+
+ ci = _bi.Bonds[bond].UnpackIndex;
+ }
+
+ if (useFirst)
+ ci = firstAllowed;
+ else if (firstNonFilter >= 0)
+ ci = firstNonFilter;
+
+ MainCoderIndex = ci;
+}
+
+
+HRESULT CMixerST::Code(
+ ISequentialInStream * const *inStreams,
+ ISequentialOutStream * const *outStreams,
+ ICompressProgressInfo *progress,
+ bool &dataAfterEnd_Error)
+{
+ // InternalPackSizeError = false;
+ dataAfterEnd_Error = false;
+
+ _binderStreams.Clear();
+ unsigned ci = MainCoderIndex;
+
+ const CCoder &mainCoder = _coders[MainCoderIndex];
+
+ CObjectVector< CMyComPtr<ISequentialInStream> > seqInStreams;
+ CObjectVector< CMyComPtr<ISequentialOutStream> > seqOutStreams;
+
+ UInt32 numInStreams = EncodeMode ? 1 : mainCoder.NumStreams;
+ UInt32 numOutStreams = !EncodeMode ? 1 : mainCoder.NumStreams;
+
+ UInt32 startInIndex = EncodeMode ? ci : _bi.Coder_to_Stream[ci];
+ UInt32 startOutIndex = !EncodeMode ? ci : _bi.Coder_to_Stream[ci];
+
+ UInt32 i;
+
+ for (i = 0; i < numInStreams; i++)
+ {
+ CMyComPtr<ISequentialInStream> seqInStream;
+ RINOK(GetInStream(inStreams, /* inSizes, */ startInIndex + i, &seqInStream));
+ seqInStreams.Add(seqInStream);
+ }
+
+ for (i = 0; i < numOutStreams; i++)
+ {
+ CMyComPtr<ISequentialOutStream> seqOutStream;
+ RINOK(GetOutStream(outStreams, /* outSizes, */ startOutIndex + i, &seqOutStream));
+ seqOutStreams.Add(seqOutStream);
+ }
+
+ CRecordVector< ISequentialInStream * > seqInStreamsSpec;
+ CRecordVector< ISequentialOutStream * > seqOutStreamsSpec;
+
+ for (i = 0; i < numInStreams; i++)
+ seqInStreamsSpec.Add(seqInStreams[i]);
+ for (i = 0; i < numOutStreams; i++)
+ seqOutStreamsSpec.Add(seqOutStreams[i]);
+
+ for (i = 0; i < _coders.Size(); i++)
+ {
+ if (i == ci)
+ continue;
+
+ CCoder &coder = _coders[i];
+
+ if (EncodeMode)
+ {
+ CMyComPtr<ICompressInitEncoder> initEncoder;
+ coder.QueryInterface(IID_ICompressInitEncoder, (void **)&initEncoder);
+ if (initEncoder)
+ RINOK(initEncoder->InitEncoder());
+ }
+ else
+ {
+ CMyComPtr<ICompressSetOutStreamSize> setOutStreamSize;
+ coder.QueryInterface(IID_ICompressSetOutStreamSize, (void **)&setOutStreamSize);
+ if (setOutStreamSize)
+ RINOK(setOutStreamSize->SetOutStreamSize(
+ EncodeMode ? coder.PackSizePointers[0] : coder.UnpackSizePointer));
+ }
+ }
+
+ const UInt64 * const *isSizes2 = EncodeMode ? &mainCoder.UnpackSizePointer : &mainCoder.PackSizePointers.Front();
+ const UInt64 * const *outSizes2 = EncodeMode ? &mainCoder.PackSizePointers.Front() : &mainCoder.UnpackSizePointer;
+
+ HRESULT res;
+ if (mainCoder.Coder)
+ {
+ res = mainCoder.Coder->Code(
+ seqInStreamsSpec[0], seqOutStreamsSpec[0],
+ isSizes2[0], outSizes2[0],
+ progress);
+ }
+ else
+ {
+ res = mainCoder.Coder2->Code(
+ &seqInStreamsSpec.Front(), isSizes2, numInStreams,
+ &seqOutStreamsSpec.Front(), outSizes2, numOutStreams,
+ progress);
+ }
+
+ if (res == k_My_HRESULT_WritingWasCut)
+ res = S_OK;
+
+ if (res == S_OK || res == S_FALSE)
+ {
+ res = GetError(res, FinishCoder(ci));
+ }
+
+ for (i = 0; i < _binderStreams.Size(); i++)
+ {
+ const CStBinderStream &bs = _binderStreams[i];
+ if (bs.InStreamSpec)
+ bs.InStreamSpec->ReleaseStream();
+ else
+ bs.OutStreamSpec->ReleaseStream();
+ }
+
+ if (res == k_My_HRESULT_WritingWasCut)
+ res = S_OK;
+
+ if (res != S_OK)
+ return res;
+
+ for (i = 0; i < _coders.Size(); i++)
+ {
+ RINOK(_coders[i].CheckDataAfterEnd(dataAfterEnd_Error /*, InternalPackSizeError */));
+ }
+
+ return S_OK;
+}
+
+
+HRESULT CMixerST::GetMainUnpackStream(
+ ISequentialInStream * const *inStreams,
+ ISequentialInStream **inStreamRes)
+{
+ CMyComPtr<ISequentialInStream> seqInStream;
+
+ RINOK(GetInStream2(inStreams, /* inSizes, */
+ _bi.UnpackCoder, &seqInStream))
+
+ FOR_VECTOR (i, _coders)
+ {
+ CCoder &coder = _coders[i];
+ CMyComPtr<ICompressSetOutStreamSize> setOutStreamSize;
+ coder.QueryInterface(IID_ICompressSetOutStreamSize, (void **)&setOutStreamSize);
+ if (setOutStreamSize)
+ {
+ RINOK(setOutStreamSize->SetOutStreamSize(coder.UnpackSizePointer));
+ }
+ }
+
+ *inStreamRes = seqInStream.Detach();
+ return S_OK;
+}
+
+
+UInt64 CMixerST::GetBondStreamSize(unsigned bondIndex) const
+{
+ const CStBinderStream &bs = _binderStreams[bondIndex];
+ if (bs.InStreamSpec)
+ return bs.InStreamSpec->GetSize();
+ return bs.OutStreamSpec->GetSize();
+}
+
+#endif
+
+
+
+
+
+
+#ifdef USE_MIXER_MT
+
+
+void CCoderMT::Execute()
+{
+ try
+ {
+ Code(NULL);
+ }
+ catch(...)
+ {
+ Result = E_FAIL;
+ }
+}
+
+void CCoderMT::Code(ICompressProgressInfo *progress)
+{
+ unsigned numInStreams = EncodeMode ? 1 : NumStreams;
+ unsigned numOutStreams = EncodeMode ? NumStreams : 1;
+
+ InStreamPointers.ClearAndReserve(numInStreams);
+ OutStreamPointers.ClearAndReserve(numOutStreams);
+
+ unsigned i;
+
+ for (i = 0; i < numInStreams; i++)
+ InStreamPointers.AddInReserved((ISequentialInStream *)InStreams[i]);
+
+ for (i = 0; i < numOutStreams; i++)
+ OutStreamPointers.AddInReserved((ISequentialOutStream *)OutStreams[i]);
+
+ // we suppose that UnpackSizePointer and PackSizePointers contain correct pointers.
+ /*
+ if (UnpackSizePointer)
+ UnpackSizePointer = &UnpackSize;
+ for (i = 0; i < NumStreams; i++)
+ if (PackSizePointers[i])
+ PackSizePointers[i] = &PackSizes[i];
+ */
+
+ CReleaser releaser(*this);
+
+ if (Coder)
+ Result = Coder->Code(InStreamPointers[0], OutStreamPointers[0],
+ EncodeMode ? UnpackSizePointer : PackSizePointers[0],
+ EncodeMode ? PackSizePointers[0] : UnpackSizePointer,
+ progress);
+ else
+ Result = Coder2->Code(
+ &InStreamPointers.Front(), EncodeMode ? &UnpackSizePointer : &PackSizePointers.Front(), numInStreams,
+ &OutStreamPointers.Front(), EncodeMode ? &PackSizePointers.Front(): &UnpackSizePointer, numOutStreams,
+ progress);
+}
+
+HRESULT CMixerMT::SetBindInfo(const CBindInfo &bindInfo)
+{
+ CMixer::SetBindInfo(bindInfo);
+
+ _streamBinders.Clear();
+ FOR_VECTOR (i, _bi.Bonds)
+ {
+ RINOK(_streamBinders.AddNew().CreateEvents());
+ }
+ return S_OK;
+}
+
+void CMixerMT::AddCoder(const CCreatedCoder &cod)
+{
+ IsFilter_Vector.Add(cod.IsFilter);
+ IsExternal_Vector.Add(cod.IsExternal);
+ // const CCoderStreamsInfo &c = _bi.Coders[_coders.Size()];
+ CCoderMT &c2 = _coders.AddNew();
+ c2.NumStreams = cod.NumStreams;
+ c2.Coder = cod.Coder;
+ c2.Coder2 = cod.Coder2;
+ c2.EncodeMode = EncodeMode;
+}
+
+CCoder &CMixerMT::GetCoder(unsigned index)
+{
+ return _coders[index];
+}
+
+void CMixerMT::ReInit()
+{
+ FOR_VECTOR (i, _streamBinders)
+ _streamBinders[i].ReInit();
+}
+
+void CMixerMT::SelectMainCoder(bool useFirst)
+{
+ unsigned ci = _bi.UnpackCoder;
+
+ if (!useFirst)
+ for (;;)
+ {
+ if (_coders[ci].NumStreams != 1)
+ break;
+ if (!IsFilter_Vector[ci])
+ break;
+
+ UInt32 st = _bi.Coder_to_Stream[ci];
+ if (_bi.IsStream_in_PackStreams(st))
+ break;
+ int bond = _bi.FindBond_for_PackStream(st);
+ if (bond < 0)
+ throw 20150213;
+ ci = _bi.Bonds[bond].UnpackIndex;
+ }
+
+ MainCoderIndex = ci;
+}
+
+HRESULT CMixerMT::Init(ISequentialInStream * const *inStreams, ISequentialOutStream * const *outStreams)
+{
+ unsigned i;
+
+ for (i = 0; i < _coders.Size(); i++)
+ {
+ CCoderMT &coderInfo = _coders[i];
+ const CCoderStreamsInfo &csi = _bi.Coders[i];
+
+ UInt32 j;
+
+ unsigned numInStreams = EncodeMode ? 1 : csi.NumStreams;
+ unsigned numOutStreams = EncodeMode ? csi.NumStreams : 1;
+
+ coderInfo.InStreams.Clear();
+ for (j = 0; j < numInStreams; j++)
+ coderInfo.InStreams.AddNew();
+
+ coderInfo.OutStreams.Clear();
+ for (j = 0; j < numOutStreams; j++)
+ coderInfo.OutStreams.AddNew();
+ }
+
+ for (i = 0; i < _bi.Bonds.Size(); i++)
+ {
+ const CBond &bond = _bi.Bonds[i];
+
+ UInt32 inCoderIndex, inCoderStreamIndex;
+ UInt32 outCoderIndex, outCoderStreamIndex;
+
+ {
+ UInt32 coderIndex, coderStreamIndex;
+ _bi.GetCoder_for_Stream(bond.PackIndex, coderIndex, coderStreamIndex);
+
+ inCoderIndex = EncodeMode ? bond.UnpackIndex : coderIndex;
+ outCoderIndex = EncodeMode ? coderIndex : bond.UnpackIndex;
+
+ inCoderStreamIndex = EncodeMode ? 0 : coderStreamIndex;
+ outCoderStreamIndex = EncodeMode ? coderStreamIndex : 0;
+ }
+
+ _streamBinders[i].CreateStreams(
+ &_coders[inCoderIndex].InStreams[inCoderStreamIndex],
+ &_coders[outCoderIndex].OutStreams[outCoderStreamIndex]);
+
+ CMyComPtr<ICompressSetBufSize> inSetSize, outSetSize;
+ _coders[inCoderIndex].QueryInterface(IID_ICompressSetBufSize, (void **)&inSetSize);
+ _coders[outCoderIndex].QueryInterface(IID_ICompressSetBufSize, (void **)&outSetSize);
+ if (inSetSize && outSetSize)
+ {
+ const UInt32 kBufSize = 1 << 19;
+ inSetSize->SetInBufSize(inCoderStreamIndex, kBufSize);
+ outSetSize->SetOutBufSize(outCoderStreamIndex, kBufSize);
+ }
+ }
+
+ {
+ CCoderMT &cod = _coders[_bi.UnpackCoder];
+ if (EncodeMode)
+ cod.InStreams[0] = inStreams[0];
+ else
+ cod.OutStreams[0] = outStreams[0];
+ }
+
+ for (i = 0; i < _bi.PackStreams.Size(); i++)
+ {
+ UInt32 coderIndex, coderStreamIndex;
+ _bi.GetCoder_for_Stream(_bi.PackStreams[i], coderIndex, coderStreamIndex);
+ CCoderMT &cod = _coders[coderIndex];
+ if (EncodeMode)
+ cod.OutStreams[coderStreamIndex] = outStreams[i];
+ else
+ cod.InStreams[coderStreamIndex] = inStreams[i];
+ }
+
+ return S_OK;
+}
+
+HRESULT CMixerMT::ReturnIfError(HRESULT code)
+{
+ FOR_VECTOR (i, _coders)
+ if (_coders[i].Result == code)
+ return code;
+ return S_OK;
+}
+
+HRESULT CMixerMT::Code(
+ ISequentialInStream * const *inStreams,
+ ISequentialOutStream * const *outStreams,
+ ICompressProgressInfo *progress,
+ bool &dataAfterEnd_Error)
+{
+ // InternalPackSizeError = false;
+ dataAfterEnd_Error = false;
+
+ Init(inStreams, outStreams);
+
+ unsigned i;
+ for (i = 0; i < _coders.Size(); i++)
+ if (i != MainCoderIndex)
+ {
+ RINOK(_coders[i].Create());
+ }
+
+ for (i = 0; i < _coders.Size(); i++)
+ if (i != MainCoderIndex)
+ _coders[i].Start();
+
+ _coders[MainCoderIndex].Code(progress);
+
+ for (i = 0; i < _coders.Size(); i++)
+ if (i != MainCoderIndex)
+ _coders[i].WaitExecuteFinish();
+
+ RINOK(ReturnIfError(E_ABORT));
+ RINOK(ReturnIfError(E_OUTOFMEMORY));
+
+ for (i = 0; i < _coders.Size(); i++)
+ {
+ HRESULT result = _coders[i].Result;
+ if (result != S_OK
+ && result != k_My_HRESULT_WritingWasCut
+ && result != S_FALSE
+ && result != E_FAIL)
+ return result;
+ }
+
+ RINOK(ReturnIfError(S_FALSE));
+
+ for (i = 0; i < _coders.Size(); i++)
+ {
+ HRESULT result = _coders[i].Result;
+ if (result != S_OK && result != k_My_HRESULT_WritingWasCut)
+ return result;
+ }
+
+ for (i = 0; i < _coders.Size(); i++)
+ {
+ RINOK(_coders[i].CheckDataAfterEnd(dataAfterEnd_Error /* , InternalPackSizeError */));
+ }
+
+ return S_OK;
+}
+
+UInt64 CMixerMT::GetBondStreamSize(unsigned bondIndex) const
+{
+ return _streamBinders[bondIndex].ProcessedSize;
+}
+
+#endif
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.h
new file mode 100644
index 0000000000..4bd6418351
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/CoderMixer2.h
@@ -0,0 +1,447 @@
+// CoderMixer2.h
+
+#ifndef __CODER_MIXER2_H
+#define __CODER_MIXER2_H
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/MyVector.h"
+
+#include "../../ICoder.h"
+
+#include "../../Common/CreateCoder.h"
+
+#ifdef _7ZIP_ST
+ #define USE_MIXER_ST
+#else
+ #define USE_MIXER_MT
+ #ifndef _SFX
+ #define USE_MIXER_ST
+ #endif
+#endif
+
+#ifdef USE_MIXER_MT
+#include "../../Common/StreamBinder.h"
+#include "../../Common/VirtThread.h"
+#endif
+
+
+
+#ifdef USE_MIXER_ST
+
+class CSequentialInStreamCalcSize:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(ISequentialInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+private:
+ CMyComPtr<ISequentialInStream> _stream;
+ UInt64 _size;
+ bool _wasFinished;
+public:
+ void SetStream(ISequentialInStream *stream) { _stream = stream; }
+ void Init()
+ {
+ _size = 0;
+ _wasFinished = false;
+ }
+ void ReleaseStream() { _stream.Release(); }
+ UInt64 GetSize() const { return _size; }
+ bool WasFinished() const { return _wasFinished; }
+};
+
+
+class COutStreamCalcSize:
+ public ISequentialOutStream,
+ public IOutStreamFinish,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+public:
+ MY_UNKNOWN_IMP2(ISequentialOutStream, IOutStreamFinish)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(OutStreamFinish)();
+
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void ReleaseStream() { _stream.Release(); }
+ void Init() { _size = 0; }
+ UInt64 GetSize() const { return _size; }
+};
+
+#endif
+
+
+
+namespace NCoderMixer2 {
+
+struct CBond
+{
+ UInt32 PackIndex;
+ UInt32 UnpackIndex;
+
+ UInt32 Get_InIndex(bool encodeMode) const { return encodeMode ? UnpackIndex : PackIndex; }
+ UInt32 Get_OutIndex(bool encodeMode) const { return encodeMode ? PackIndex : UnpackIndex; }
+};
+
+
+struct CCoderStreamsInfo
+{
+ UInt32 NumStreams;
+};
+
+
+struct CBindInfo
+{
+ CRecordVector<CCoderStreamsInfo> Coders;
+ CRecordVector<CBond> Bonds;
+ CRecordVector<UInt32> PackStreams;
+ unsigned UnpackCoder;
+
+ unsigned GetNum_Bonds_and_PackStreams() const { return Bonds.Size() + PackStreams.Size(); }
+
+ int FindBond_for_PackStream(UInt32 packStream) const
+ {
+ FOR_VECTOR (i, Bonds)
+ if (Bonds[i].PackIndex == packStream)
+ return i;
+ return -1;
+ }
+
+ int FindBond_for_UnpackStream(UInt32 unpackStream) const
+ {
+ FOR_VECTOR (i, Bonds)
+ if (Bonds[i].UnpackIndex == unpackStream)
+ return i;
+ return -1;
+ }
+
+ bool SetUnpackCoder()
+ {
+ bool isOk = false;
+ FOR_VECTOR(i, Coders)
+ {
+ if (FindBond_for_UnpackStream(i) < 0)
+ {
+ if (isOk)
+ return false;
+ UnpackCoder = i;
+ isOk = true;
+ }
+ }
+ return isOk;
+ }
+
+ bool IsStream_in_PackStreams(UInt32 streamIndex) const
+ {
+ return FindStream_in_PackStreams(streamIndex) >= 0;
+ }
+
+ int FindStream_in_PackStreams(UInt32 streamIndex) const
+ {
+ FOR_VECTOR(i, PackStreams)
+ if (PackStreams[i] == streamIndex)
+ return i;
+ return -1;
+ }
+
+
+ // that function is used before Maps is calculated
+
+ UInt32 GetStream_for_Coder(UInt32 coderIndex) const
+ {
+ UInt32 streamIndex = 0;
+ for (UInt32 i = 0; i < coderIndex; i++)
+ streamIndex += Coders[i].NumStreams;
+ return streamIndex;
+ }
+
+ // ---------- Maps Section ----------
+
+ CRecordVector<UInt32> Coder_to_Stream;
+ CRecordVector<UInt32> Stream_to_Coder;
+
+ void ClearMaps();
+ bool CalcMapsAndCheck();
+
+ // ---------- End of Maps Section ----------
+
+ void Clear()
+ {
+ Coders.Clear();
+ Bonds.Clear();
+ PackStreams.Clear();
+
+ ClearMaps();
+ }
+
+ void GetCoder_for_Stream(UInt32 streamIndex, UInt32 &coderIndex, UInt32 &coderStreamIndex) const
+ {
+ coderIndex = Stream_to_Coder[streamIndex];
+ coderStreamIndex = streamIndex - Coder_to_Stream[coderIndex];
+ }
+};
+
+
+
+class CCoder
+{
+ CLASS_NO_COPY(CCoder);
+public:
+ CMyComPtr<ICompressCoder> Coder;
+ CMyComPtr<ICompressCoder2> Coder2;
+ UInt32 NumStreams;
+
+ UInt64 UnpackSize;
+ const UInt64 *UnpackSizePointer;
+
+ CRecordVector<UInt64> PackSizes;
+ CRecordVector<const UInt64 *> PackSizePointers;
+
+ bool Finish;
+
+ CCoder(): Finish(false) {}
+
+ void SetCoderInfo(const UInt64 *unpackSize, const UInt64 * const *packSizes, bool finish);
+
+ HRESULT CheckDataAfterEnd(bool &dataAfterEnd_Error /* , bool &InternalPackSizeError */) const;
+
+ IUnknown *GetUnknown() const
+ {
+ return Coder ? (IUnknown *)Coder : (IUnknown *)Coder2;
+ }
+
+ HRESULT QueryInterface(REFGUID iid, void** pp) const
+ {
+ return GetUnknown()->QueryInterface(iid, pp);
+ }
+};
+
+
+
+class CMixer
+{
+ bool Is_PackSize_Correct_for_Stream(UInt32 streamIndex);
+
+protected:
+ CBindInfo _bi;
+
+ int FindBond_for_Stream(bool forInputStream, UInt32 streamIndex) const
+ {
+ if (EncodeMode == forInputStream)
+ return _bi.FindBond_for_UnpackStream(streamIndex);
+ else
+ return _bi.FindBond_for_PackStream(streamIndex);
+ }
+
+ CBoolVector IsFilter_Vector;
+ CBoolVector IsExternal_Vector;
+ bool EncodeMode;
+public:
+ unsigned MainCoderIndex;
+
+ // bool InternalPackSizeError;
+
+ CMixer(bool encodeMode):
+ EncodeMode(encodeMode),
+ MainCoderIndex(0)
+ // , InternalPackSizeError(false)
+ {}
+
+ /*
+ Sequence of calling:
+
+ SetBindInfo();
+ for each coder
+ AddCoder();
+ SelectMainCoder();
+
+ for each file
+ {
+ ReInit()
+ for each coder
+ SetCoderInfo();
+ Code();
+ }
+ */
+
+ virtual HRESULT SetBindInfo(const CBindInfo &bindInfo)
+ {
+ _bi = bindInfo;
+ IsFilter_Vector.Clear();
+ MainCoderIndex = 0;
+ return S_OK;
+ }
+
+ virtual void AddCoder(const CCreatedCoder &cod) = 0;
+ virtual CCoder &GetCoder(unsigned index) = 0;
+ virtual void SelectMainCoder(bool useFirst) = 0;
+ virtual void ReInit() = 0;
+ virtual void SetCoderInfo(unsigned coderIndex, const UInt64 *unpackSize, const UInt64 * const *packSizes, bool finish) = 0;
+ virtual HRESULT Code(
+ ISequentialInStream * const *inStreams,
+ ISequentialOutStream * const *outStreams,
+ ICompressProgressInfo *progress,
+ bool &dataAfterEnd_Error) = 0;
+ virtual UInt64 GetBondStreamSize(unsigned bondIndex) const = 0;
+
+ bool Is_UnpackSize_Correct_for_Coder(UInt32 coderIndex);
+ bool Is_PackSize_Correct_for_Coder(UInt32 coderIndex);
+ bool IsThere_ExternalCoder_in_PackTree(UInt32 coderIndex);
+};
+
+
+
+
+#ifdef USE_MIXER_ST
+
+struct CCoderST: public CCoder
+{
+ bool CanRead;
+ bool CanWrite;
+
+ CCoderST(): CanRead(false), CanWrite(false) {}
+};
+
+
+struct CStBinderStream
+{
+ CSequentialInStreamCalcSize *InStreamSpec;
+ COutStreamCalcSize *OutStreamSpec;
+ CMyComPtr<IUnknown> StreamRef;
+
+ CStBinderStream(): InStreamSpec(NULL), OutStreamSpec(NULL) {}
+};
+
+
+class CMixerST:
+ public IUnknown,
+ public CMixer,
+ public CMyUnknownImp
+{
+ HRESULT GetInStream2(ISequentialInStream * const *inStreams, /* const UInt64 * const *inSizes, */
+ UInt32 outStreamIndex, ISequentialInStream **inStreamRes);
+ HRESULT GetInStream(ISequentialInStream * const *inStreams, /* const UInt64 * const *inSizes, */
+ UInt32 inStreamIndex, ISequentialInStream **inStreamRes);
+ HRESULT GetOutStream(ISequentialOutStream * const *outStreams, /* const UInt64 * const *outSizes, */
+ UInt32 outStreamIndex, ISequentialOutStream **outStreamRes);
+
+ HRESULT FinishStream(UInt32 streamIndex);
+ HRESULT FinishCoder(UInt32 coderIndex);
+
+public:
+ CObjectVector<CCoderST> _coders;
+
+ CObjectVector<CStBinderStream> _binderStreams;
+
+ MY_UNKNOWN_IMP
+
+ CMixerST(bool encodeMode);
+ ~CMixerST();
+
+ virtual void AddCoder(const CCreatedCoder &cod);
+ virtual CCoder &GetCoder(unsigned index);
+ virtual void SelectMainCoder(bool useFirst);
+ virtual void ReInit();
+ virtual void SetCoderInfo(unsigned coderIndex, const UInt64 *unpackSize, const UInt64 * const *packSizes, bool finish)
+ { _coders[coderIndex].SetCoderInfo(unpackSize, packSizes, finish); }
+ virtual HRESULT Code(
+ ISequentialInStream * const *inStreams,
+ ISequentialOutStream * const *outStreams,
+ ICompressProgressInfo *progress,
+ bool &dataAfterEnd_Error);
+ virtual UInt64 GetBondStreamSize(unsigned bondIndex) const;
+
+ HRESULT GetMainUnpackStream(
+ ISequentialInStream * const *inStreams,
+ ISequentialInStream **inStreamRes);
+};
+
+#endif
+
+
+
+
+#ifdef USE_MIXER_MT
+
+class CCoderMT: public CCoder, public CVirtThread
+{
+ CLASS_NO_COPY(CCoderMT)
+ CRecordVector<ISequentialInStream*> InStreamPointers;
+ CRecordVector<ISequentialOutStream*> OutStreamPointers;
+
+private:
+ void Execute();
+public:
+ bool EncodeMode;
+ HRESULT Result;
+ CObjectVector< CMyComPtr<ISequentialInStream> > InStreams;
+ CObjectVector< CMyComPtr<ISequentialOutStream> > OutStreams;
+
+ void Release()
+ {
+ InStreamPointers.Clear();
+ OutStreamPointers.Clear();
+ unsigned i;
+ for (i = 0; i < InStreams.Size(); i++)
+ InStreams[i].Release();
+ for (i = 0; i < OutStreams.Size(); i++)
+ OutStreams[i].Release();
+ }
+
+ class CReleaser
+ {
+ CLASS_NO_COPY(CReleaser)
+ CCoderMT &_c;
+ public:
+ CReleaser(CCoderMT &c): _c(c) {}
+ ~CReleaser() { _c.Release(); }
+ };
+
+ CCoderMT(): EncodeMode(false) {}
+ ~CCoderMT() { CVirtThread::WaitThreadFinish(); }
+
+ void Code(ICompressProgressInfo *progress);
+};
+
+
+class CMixerMT:
+ public IUnknown,
+ public CMixer,
+ public CMyUnknownImp
+{
+ CObjectVector<CStreamBinder> _streamBinders;
+
+ HRESULT Init(ISequentialInStream * const *inStreams, ISequentialOutStream * const *outStreams);
+ HRESULT ReturnIfError(HRESULT code);
+
+public:
+ CObjectVector<CCoderMT> _coders;
+
+ MY_UNKNOWN_IMP
+
+ virtual HRESULT SetBindInfo(const CBindInfo &bindInfo);
+ virtual void AddCoder(const CCreatedCoder &cod);
+ virtual CCoder &GetCoder(unsigned index);
+ virtual void SelectMainCoder(bool useFirst);
+ virtual void ReInit();
+ virtual void SetCoderInfo(unsigned coderIndex, const UInt64 *unpackSize, const UInt64 * const *packSizes, bool finish)
+ { _coders[coderIndex].SetCoderInfo(unpackSize, packSizes, finish); }
+ virtual HRESULT Code(
+ ISequentialInStream * const *inStreams,
+ ISequentialOutStream * const *outStreams,
+ ICompressProgressInfo *progress,
+ bool &dataAfterEnd_Error);
+ virtual UInt64 GetBondStreamSize(unsigned bondIndex) const;
+
+ CMixerMT(bool encodeMode): CMixer(encodeMode) {}
+};
+
+#endif
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.cpp
new file mode 100644
index 0000000000..c7d45e7f9e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.cpp
@@ -0,0 +1,17 @@
+// DummyOutStream.cpp
+
+#include "StdAfx.h"
+
+#include "DummyOutStream.h"
+
+STDMETHODIMP CDummyOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessedSize = size;
+ HRESULT res = S_OK;
+ if (_stream)
+ res = _stream->Write(data, size, &realProcessedSize);
+ _size += realProcessedSize;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return res;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.h
new file mode 100644
index 0000000000..30e84c55da
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/DummyOutStream.h
@@ -0,0 +1,25 @@
+// DummyOutStream.h
+
+#ifndef __DUMMY_OUT_STREAM_H
+#define __DUMMY_OUT_STREAM_H
+
+#include "../../../Common/MyCom.h"
+
+#include "../../IStream.h"
+
+class CDummyOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+public:
+ void SetStream(ISequentialOutStream *outStream) { _stream = outStream; }
+ void ReleaseStream() { _stream.Release(); }
+ void Init() { _size = 0; }
+ MY_UNKNOWN_IMP
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ UInt64 GetSize() const { return _size; }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.cpp
new file mode 100644
index 0000000000..41762d9004
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.cpp
@@ -0,0 +1,232 @@
+// HandlerOut.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/StringToInt.h"
+
+#include "../Common/ParseProperties.h"
+
+#include "HandlerOut.h"
+
+namespace NArchive {
+
+bool ParseSizeString(const wchar_t *s, const PROPVARIANT &prop, UInt64 percentsBase, UInt64 &res)
+{
+ if (*s == 0)
+ {
+ switch (prop.vt)
+ {
+ case VT_UI4: res = prop.ulVal; return true;
+ case VT_UI8: res = prop.uhVal.QuadPart; return true;
+ case VT_BSTR:
+ s = prop.bstrVal;
+ break;
+ default: return false;
+ }
+ }
+ else if (prop.vt != VT_EMPTY)
+ return false;
+
+ const wchar_t *end;
+ UInt64 v = ConvertStringToUInt64(s, &end);
+ if (s == end)
+ return false;
+ wchar_t c = *end;
+ if (c == 0)
+ {
+ res = v;
+ return true;
+ }
+ if (end[1] != 0)
+ return false;
+
+ if (c == '%')
+ {
+ res = percentsBase / 100 * v;
+ return true;
+ }
+
+ unsigned numBits;
+ switch (MyCharLower_Ascii(c))
+ {
+ case 'b': numBits = 0; break;
+ case 'k': numBits = 10; break;
+ case 'm': numBits = 20; break;
+ case 'g': numBits = 30; break;
+ case 't': numBits = 40; break;
+ default: return false;
+ }
+ UInt64 val2 = v << numBits;
+ if ((val2 >> numBits) != v)
+ return false;
+ res = val2;
+ return true;
+}
+
+bool CCommonMethodProps::SetCommonProperty(const UString &name, const PROPVARIANT &value, HRESULT &hres)
+{
+ hres = S_OK;
+
+ if (name.IsPrefixedBy_Ascii_NoCase("mt"))
+ {
+ #ifndef _7ZIP_ST
+ hres = ParseMtProp(name.Ptr(2), value, _numProcessors, _numThreads);
+ #endif
+ return true;
+ }
+
+ if (name.IsPrefixedBy_Ascii_NoCase("memuse"))
+ {
+ if (!ParseSizeString(name.Ptr(6), value, _memAvail, _memUsage))
+ hres = E_INVALIDARG;
+ return true;
+ }
+
+ return false;
+}
+
+
+#ifndef EXTRACT_ONLY
+
+static void SetMethodProp32(COneMethodInfo &m, PROPID propID, UInt32 value)
+{
+ if (m.FindProp(propID) < 0)
+ m.AddProp32(propID, value);
+}
+
+void CMultiMethodProps::SetGlobalLevelTo(COneMethodInfo &oneMethodInfo) const
+{
+ UInt32 level = _level;
+ if (level != (UInt32)(Int32)-1)
+ SetMethodProp32(oneMethodInfo, NCoderPropID::kLevel, (UInt32)level);
+}
+
+#ifndef _7ZIP_ST
+void CMultiMethodProps::SetMethodThreadsTo(COneMethodInfo &oneMethodInfo, UInt32 numThreads)
+{
+ SetMethodProp32(oneMethodInfo, NCoderPropID::kNumThreads, numThreads);
+}
+#endif
+
+void CMultiMethodProps::InitMulti()
+{
+ _level = (UInt32)(Int32)-1;
+ _analysisLevel = -1;
+ _crcSize = 4;
+ _autoFilter = true;
+}
+
+void CMultiMethodProps::Init()
+{
+ InitCommon();
+ InitMulti();
+ _methods.Clear();
+ _filterMethod.Clear();
+}
+
+
+HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &value)
+{
+ UString name = nameSpec;
+ name.MakeLower_Ascii();
+ if (name.IsEmpty())
+ return E_INVALIDARG;
+
+ if (name[0] == 'x')
+ {
+ name.Delete(0);
+ _level = 9;
+ return ParsePropToUInt32(name, value, _level);
+ }
+
+ if (name.IsPrefixedBy_Ascii_NoCase("yx"))
+ {
+ name.Delete(0, 2);
+ UInt32 v = 9;
+ RINOK(ParsePropToUInt32(name, value, v));
+ _analysisLevel = (int)v;
+ return S_OK;
+ }
+
+ if (name.IsPrefixedBy_Ascii_NoCase("crc"))
+ {
+ name.Delete(0, 3);
+ _crcSize = 4;
+ return ParsePropToUInt32(name, value, _crcSize);
+ }
+
+ {
+ HRESULT hres;
+ if (SetCommonProperty(name, value, hres))
+ return hres;
+ }
+
+ UInt32 number;
+ unsigned index = ParseStringToUInt32(name, number);
+ UString realName = name.Ptr(index);
+ if (index == 0)
+ {
+ if (name.IsEqualTo("f"))
+ {
+ HRESULT res = PROPVARIANT_to_bool(value, _autoFilter);
+ if (res == S_OK)
+ return res;
+ if (value.vt != VT_BSTR)
+ return E_INVALIDARG;
+ return _filterMethod.ParseMethodFromPROPVARIANT(UString(), value);
+ }
+ number = 0;
+ }
+ if (number > 64)
+ return E_FAIL;
+ for (int j = _methods.Size(); j <= (int)number; j++)
+ _methods.Add(COneMethodInfo());
+ return _methods[number].ParseMethodFromPROPVARIANT(realName, value);
+}
+
+
+
+void CSingleMethodProps::Init()
+{
+ InitCommon();
+ InitSingle();
+ Clear();
+}
+
+
+HRESULT CSingleMethodProps::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps)
+{
+ Init();
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ UString name = names[i];
+ name.MakeLower_Ascii();
+ if (name.IsEmpty())
+ return E_INVALIDARG;
+ const PROPVARIANT &value = values[i];
+ if (name[0] == L'x')
+ {
+ UInt32 a = 9;
+ RINOK(ParsePropToUInt32(name.Ptr(1), value, a));
+ _level = a;
+ AddProp_Level(a);
+ continue;
+ }
+ {
+ HRESULT hres;
+ if (SetCommonProperty(name, value, hres))
+ {
+ RINOK(hres)
+ continue;
+ }
+ }
+ RINOK(ParseMethodFromPROPVARIANT(names[i], value));
+ }
+
+ return S_OK;
+}
+
+#endif
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.h
new file mode 100644
index 0000000000..90b000ac8b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/HandlerOut.h
@@ -0,0 +1,110 @@
+// HandlerOut.h
+
+#ifndef __HANDLER_OUT_H
+#define __HANDLER_OUT_H
+
+#include "../../../Windows/System.h"
+
+#include "../../Common/MethodProps.h"
+
+namespace NArchive {
+
+bool ParseSizeString(const wchar_t *name, const PROPVARIANT &prop, UInt64 percentsBase, UInt64 &res);
+
+class CCommonMethodProps
+{
+protected:
+ void InitCommon()
+ {
+ #ifndef _7ZIP_ST
+ _numProcessors = _numThreads = NWindows::NSystem::GetNumberOfProcessors();
+ #endif
+
+ UInt64 memAvail = (UInt64)(sizeof(size_t)) << 28;
+ _memAvail = memAvail;
+ _memUsage = memAvail;
+ if (NWindows::NSystem::GetRamSize(memAvail))
+ {
+ _memAvail = memAvail;
+ _memUsage = memAvail / 32 * 17;
+ }
+ }
+
+public:
+ #ifndef _7ZIP_ST
+ UInt32 _numThreads;
+ UInt32 _numProcessors;
+ #endif
+
+ UInt64 _memUsage;
+ UInt64 _memAvail;
+
+ bool SetCommonProperty(const UString &name, const PROPVARIANT &value, HRESULT &hres);
+
+ CCommonMethodProps() { InitCommon(); }
+};
+
+
+#ifndef EXTRACT_ONLY
+
+class CMultiMethodProps: public CCommonMethodProps
+{
+ UInt32 _level;
+ int _analysisLevel;
+
+ void InitMulti();
+public:
+ UInt32 _crcSize;
+ CObjectVector<COneMethodInfo> _methods;
+ COneMethodInfo _filterMethod;
+ bool _autoFilter;
+
+
+ void SetGlobalLevelTo(COneMethodInfo &oneMethodInfo) const;
+
+ #ifndef _7ZIP_ST
+ static void SetMethodThreadsTo(COneMethodInfo &oneMethodInfo, UInt32 numThreads);
+ #endif
+
+
+ unsigned GetNumEmptyMethods() const
+ {
+ unsigned i;
+ for (i = 0; i < _methods.Size(); i++)
+ if (!_methods[i].IsEmpty())
+ break;
+ return i;
+ }
+
+ int GetLevel() const { return _level == (UInt32)(Int32)-1 ? 5 : (int)_level; }
+ int GetAnalysisLevel() const { return _analysisLevel; }
+
+ void Init();
+ CMultiMethodProps() { InitMulti(); }
+
+ HRESULT SetProperty(const wchar_t *name, const PROPVARIANT &value);
+};
+
+
+class CSingleMethodProps: public COneMethodInfo, public CCommonMethodProps
+{
+ UInt32 _level;
+
+ void InitSingle()
+ {
+ _level = (UInt32)(Int32)-1;
+ }
+
+public:
+ void Init();
+ CSingleMethodProps() { InitSingle(); }
+
+ int GetLevel() const { return _level == (UInt32)(Int32)-1 ? 5 : (int)_level; }
+ HRESULT SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps);
+};
+
+#endif
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.cpp
new file mode 100644
index 0000000000..cddc083d64
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.cpp
@@ -0,0 +1,46 @@
+// InStreamWithCRC.cpp
+
+#include "StdAfx.h"
+
+#include "InStreamWithCRC.h"
+
+STDMETHODIMP CSequentialInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessed = 0;
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Read(data, size, &realProcessed);
+ _size += realProcessed;
+ if (size != 0 && realProcessed == 0)
+ _wasFinished = true;
+ _crc = CrcUpdate(_crc, data, realProcessed);
+ if (processedSize)
+ *processedSize = realProcessed;
+ return result;
+}
+
+STDMETHODIMP CInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessed = 0;
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Read(data, size, &realProcessed);
+ _size += realProcessed;
+ /*
+ if (size != 0 && realProcessed == 0)
+ _wasFinished = true;
+ */
+ _crc = CrcUpdate(_crc, data, realProcessed);
+ if (processedSize)
+ *processedSize = realProcessed;
+ return result;
+}
+
+STDMETHODIMP CInStreamWithCRC::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ if (seekOrigin != STREAM_SEEK_SET || offset != 0)
+ return E_FAIL;
+ _size = 0;
+ _crc = CRC_INIT_VAL;
+ return _stream->Seek(offset, seekOrigin, newPosition);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.h
new file mode 100644
index 0000000000..1a4b2c907e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/InStreamWithCRC.h
@@ -0,0 +1,67 @@
+// InStreamWithCRC.h
+
+#ifndef __IN_STREAM_WITH_CRC_H
+#define __IN_STREAM_WITH_CRC_H
+
+#include "../../../../C/7zCrc.h"
+
+#include "../../../Common/MyCom.h"
+
+#include "../../IStream.h"
+
+class CSequentialInStreamWithCRC:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+private:
+ CMyComPtr<ISequentialInStream> _stream;
+ UInt64 _size;
+ UInt32 _crc;
+ bool _wasFinished;
+public:
+ void SetStream(ISequentialInStream *stream) { _stream = stream; }
+ void Init()
+ {
+ _size = 0;
+ _wasFinished = false;
+ _crc = CRC_INIT_VAL;
+ }
+ void ReleaseStream() { _stream.Release(); }
+ UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); }
+ UInt64 GetSize() const { return _size; }
+ bool WasFinished() const { return _wasFinished; }
+};
+
+class CInStreamWithCRC:
+ public IInStream,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+private:
+ CMyComPtr<IInStream> _stream;
+ UInt64 _size;
+ UInt32 _crc;
+ // bool _wasFinished;
+public:
+ void SetStream(IInStream *stream) { _stream = stream; }
+ void Init()
+ {
+ _size = 0;
+ // _wasFinished = false;
+ _crc = CRC_INIT_VAL;
+ }
+ void ReleaseStream() { _stream.Release(); }
+ UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); }
+ UInt64 GetSize() const { return _size; }
+ // bool WasFinished() const { return _wasFinished; }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.cpp
new file mode 100644
index 0000000000..e0c35a9b02
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.cpp
@@ -0,0 +1,88 @@
+// Archive/Common/ItemNameUtils.cpp
+
+#include "StdAfx.h"
+
+#include "ItemNameUtils.h"
+
+namespace NArchive {
+namespace NItemName {
+
+static const wchar_t kOsPathSepar = WCHAR_PATH_SEPARATOR;
+static const wchar_t kUnixPathSepar = L'/';
+
+void ReplaceSlashes_OsToUnix
+#if WCHAR_PATH_SEPARATOR != L'/'
+ (UString &name)
+ {
+ name.Replace(kOsPathSepar, kUnixPathSepar);
+ }
+#else
+ (UString &) {}
+#endif
+
+
+UString GetOsPath(const UString &name)
+{
+ #if WCHAR_PATH_SEPARATOR != L'/'
+ UString newName = name;
+ newName.Replace(kUnixPathSepar, kOsPathSepar);
+ return newName;
+ #else
+ return name;
+ #endif
+}
+
+
+UString GetOsPath_Remove_TailSlash(const UString &name)
+{
+ if (name.IsEmpty())
+ return UString();
+ UString newName = GetOsPath(name);
+ if (newName.Back() == kOsPathSepar)
+ newName.DeleteBack();
+ return newName;
+}
+
+
+void ReplaceToOsSlashes_Remove_TailSlash(UString &name)
+{
+ if (!name.IsEmpty())
+ {
+ #if WCHAR_PATH_SEPARATOR != L'/'
+ name.Replace(kUnixPathSepar, kOsPathSepar);
+ #endif
+
+ if (name.Back() == kOsPathSepar)
+ name.DeleteBack();
+ }
+}
+
+
+bool HasTailSlash(const AString &name, UINT
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ codePage
+ #endif
+ )
+{
+ if (name.IsEmpty())
+ return false;
+ char c =
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ *CharPrevExA((WORD)codePage, name, name.Ptr(name.Len()), 0);
+ #else
+ name.Back();
+ #endif
+ return (c == '/');
+}
+
+
+#ifndef _WIN32
+UString WinPathToOsPath(const UString &name)
+{
+ UString newName = name;
+ newName.Replace(L'\\', WCHAR_PATH_SEPARATOR);
+ return newName;
+}
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.h
new file mode 100644
index 0000000000..404fce4698
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ItemNameUtils.h
@@ -0,0 +1,28 @@
+// Archive/Common/ItemNameUtils.h
+
+#ifndef __ARCHIVE_ITEM_NAME_UTILS_H
+#define __ARCHIVE_ITEM_NAME_UTILS_H
+
+#include "../../../Common/MyString.h"
+
+namespace NArchive {
+namespace NItemName {
+
+void ReplaceSlashes_OsToUnix(UString &name);
+
+UString GetOsPath(const UString &name);
+UString GetOsPath_Remove_TailSlash(const UString &name);
+
+void ReplaceToOsSlashes_Remove_TailSlash(UString &name);
+
+bool HasTailSlash(const AString &name, UINT codePage);
+
+#ifdef _WIN32
+ inline UString WinPathToOsPath(const UString &name) { return name; }
+#else
+ UString WinPathToOsPath(const UString &name);
+#endif
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.cpp
new file mode 100644
index 0000000000..39d15217f2
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.cpp
@@ -0,0 +1,191 @@
+// MultiStream.cpp
+
+#include "StdAfx.h"
+
+#include "MultiStream.h"
+
+STDMETHODIMP CMultiStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ if (_pos >= _totalLength)
+ return S_OK;
+
+ {
+ unsigned left = 0, mid = _streamIndex, right = Streams.Size();
+ for (;;)
+ {
+ CSubStreamInfo &m = Streams[mid];
+ if (_pos < m.GlobalOffset)
+ right = mid;
+ else if (_pos >= m.GlobalOffset + m.Size)
+ left = mid + 1;
+ else
+ {
+ _streamIndex = mid;
+ break;
+ }
+ mid = (left + right) / 2;
+ }
+ _streamIndex = mid;
+ }
+
+ CSubStreamInfo &s = Streams[_streamIndex];
+ UInt64 localPos = _pos - s.GlobalOffset;
+ if (localPos != s.LocalPos)
+ {
+ RINOK(s.Stream->Seek(localPos, STREAM_SEEK_SET, &s.LocalPos));
+ }
+ UInt64 rem = s.Size - localPos;
+ if (size > rem)
+ size = (UInt32)rem;
+ HRESULT result = s.Stream->Read(data, size, &size);
+ _pos += size;
+ s.LocalPos += size;
+ if (processedSize)
+ *processedSize = size;
+ return result;
+}
+
+STDMETHODIMP CMultiStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _pos; break;
+ case STREAM_SEEK_END: offset += _totalLength; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _pos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
+
+
+/*
+class COutVolumeStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ unsigned _volIndex;
+ UInt64 _volSize;
+ UInt64 _curPos;
+ CMyComPtr<ISequentialOutStream> _volumeStream;
+ COutArchive _archive;
+ CCRC _crc;
+
+public:
+ MY_UNKNOWN_IMP
+
+ CFileItem _file;
+ CUpdateOptions _options;
+ CMyComPtr<IArchiveUpdateCallback2> VolumeCallback;
+ void Init(IArchiveUpdateCallback2 *volumeCallback,
+ const UString &name)
+ {
+ _file.Name = name;
+ _file.IsStartPosDefined = true;
+ _file.StartPos = 0;
+
+ VolumeCallback = volumeCallback;
+ _volIndex = 0;
+ _volSize = 0;
+ }
+
+ HRESULT Flush();
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+HRESULT COutVolumeStream::Flush()
+{
+ if (_volumeStream)
+ {
+ _file.UnPackSize = _curPos;
+ _file.FileCRC = _crc.GetDigest();
+ RINOK(WriteVolumeHeader(_archive, _file, _options));
+ _archive.Close();
+ _volumeStream.Release();
+ _file.StartPos += _file.UnPackSize;
+ }
+ return S_OK;
+}
+*/
+
+/*
+STDMETHODIMP COutMultiStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ while (size > 0)
+ {
+ if (_streamIndex >= Streams.Size())
+ {
+ CSubStreamInfo subStream;
+ RINOK(VolumeCallback->GetVolumeSize(Streams.Size(), &subStream.Size));
+ RINOK(VolumeCallback->GetVolumeStream(Streams.Size(), &subStream.Stream));
+ subStream.Pos = 0;
+ Streams.Add(subStream);
+ continue;
+ }
+ CSubStreamInfo &subStream = Streams[_streamIndex];
+ if (_offsetPos >= subStream.Size)
+ {
+ _offsetPos -= subStream.Size;
+ _streamIndex++;
+ continue;
+ }
+ if (_offsetPos != subStream.Pos)
+ {
+ CMyComPtr<IOutStream> outStream;
+ RINOK(subStream.Stream.QueryInterface(IID_IOutStream, &outStream));
+ RINOK(outStream->Seek(_offsetPos, STREAM_SEEK_SET, NULL));
+ subStream.Pos = _offsetPos;
+ }
+
+ UInt32 curSize = (UInt32)MyMin((UInt64)size, subStream.Size - subStream.Pos);
+ UInt32 realProcessed;
+ RINOK(subStream.Stream->Write(data, curSize, &realProcessed));
+ data = (void *)((Byte *)data + realProcessed);
+ size -= realProcessed;
+ subStream.Pos += realProcessed;
+ _offsetPos += realProcessed;
+ _absPos += realProcessed;
+ if (_absPos > _length)
+ _length = _absPos;
+ if (processedSize)
+ *processedSize += realProcessed;
+ if (subStream.Pos == subStream.Size)
+ {
+ _streamIndex++;
+ _offsetPos = 0;
+ }
+ if (realProcessed != curSize && realProcessed == 0)
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP COutMultiStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _absPos; break;
+ case STREAM_SEEK_END: offset += _length; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _absPos = offset;
+ _offsetPos = _absPos;
+ _streamIndex = 0;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
+*/
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.h
new file mode 100644
index 0000000000..39e041def7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/MultiStream.h
@@ -0,0 +1,89 @@
+// MultiStream.h
+
+#ifndef __MULTI_STREAM_H
+#define __MULTI_STREAM_H
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/MyVector.h"
+
+#include "../../IStream.h"
+
+class CMultiStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ UInt64 _pos;
+ UInt64 _totalLength;
+ unsigned _streamIndex;
+
+public:
+
+ struct CSubStreamInfo
+ {
+ CMyComPtr<IInStream> Stream;
+ UInt64 Size;
+ UInt64 GlobalOffset;
+ UInt64 LocalPos;
+
+ CSubStreamInfo(): Size(0), GlobalOffset(0), LocalPos(0) {}
+ };
+
+ CObjectVector<CSubStreamInfo> Streams;
+
+ HRESULT Init()
+ {
+ UInt64 total = 0;
+ FOR_VECTOR (i, Streams)
+ {
+ CSubStreamInfo &s = Streams[i];
+ s.GlobalOffset = total;
+ total += Streams[i].Size;
+ RINOK(s.Stream->Seek(0, STREAM_SEEK_CUR, &s.LocalPos));
+ }
+ _totalLength = total;
+ _pos = 0;
+ _streamIndex = 0;
+ return S_OK;
+ }
+
+ MY_UNKNOWN_IMP1(IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+};
+
+/*
+class COutMultiStream:
+ public IOutStream,
+ public CMyUnknownImp
+{
+ unsigned _streamIndex; // required stream
+ UInt64 _offsetPos; // offset from start of _streamIndex index
+ UInt64 _absPos;
+ UInt64 _length;
+
+ struct CSubStreamInfo
+ {
+ CMyComPtr<ISequentialOutStream> Stream;
+ UInt64 Size;
+ UInt64 Pos;
+ };
+ CObjectVector<CSubStreamInfo> Streams;
+public:
+ CMyComPtr<IArchiveUpdateCallback2> VolumeCallback;
+ void Init()
+ {
+ _streamIndex = 0;
+ _offsetPos = 0;
+ _absPos = 0;
+ _length = 0;
+ }
+
+ MY_UNKNOWN_IMP1(IOutStream)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+};
+*/
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp
new file mode 100644
index 0000000000..e0d3894b52
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.cpp
@@ -0,0 +1,18 @@
+// OutStreamWithCRC.cpp
+
+#include "StdAfx.h"
+
+#include "OutStreamWithCRC.h"
+
+STDMETHODIMP COutStreamWithCRC::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Write(data, size, &size);
+ if (_calculate)
+ _crc = CrcUpdate(_crc, data, size);
+ _size += size;
+ if (processedSize != NULL)
+ *processedSize = size;
+ return result;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.h
new file mode 100644
index 0000000000..0cc9a859f8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/OutStreamWithCRC.h
@@ -0,0 +1,37 @@
+// OutStreamWithCRC.h
+
+#ifndef __OUT_STREAM_WITH_CRC_H
+#define __OUT_STREAM_WITH_CRC_H
+
+#include "../../../../C/7zCrc.h"
+
+#include "../../../Common/MyCom.h"
+
+#include "../../IStream.h"
+
+class COutStreamWithCRC:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+ UInt32 _crc;
+ bool _calculate;
+public:
+ MY_UNKNOWN_IMP
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void ReleaseStream() { _stream.Release(); }
+ void Init(bool calculate = true)
+ {
+ _size = 0;
+ _calculate = calculate;
+ _crc = CRC_INIT_VAL;
+ }
+ void EnableCalc(bool calculate) { _calculate = calculate; }
+ void InitCRC() { _crc = CRC_INIT_VAL; }
+ UInt64 GetSize() const { return _size; }
+ UInt32 GetCRC() const { return CRC_GET_DIGEST(_crc); }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.cpp
new file mode 100644
index 0000000000..0fe89b3d20
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.cpp
@@ -0,0 +1,3 @@
+// ParseProperties.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.h
new file mode 100644
index 0000000000..f4367a76f2
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/ParseProperties.h
@@ -0,0 +1,6 @@
+// ParseProperties.h
+
+#ifndef __PARSE_PROPERTIES_H
+#define __PARSE_PROPERTIES_H
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Common/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Common/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/DllExports2.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/DllExports2.cpp
new file mode 100644
index 0000000000..c43e72acc3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/DllExports2.cpp
@@ -0,0 +1,122 @@
+// DLLExports2.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/MyWindows.h"
+
+#include "../../Common/MyInitGuid.h"
+
+#if defined(_7ZIP_LARGE_PAGES)
+#include "../../../C/Alloc.h"
+#endif
+
+#include "../../Common/ComTry.h"
+
+#include "../../Windows/NtCheck.h"
+#include "../../Windows/PropVariant.h"
+
+#include "../ICoder.h"
+#include "../IPassword.h"
+
+#include "../Common/CreateCoder.h"
+
+#include "IArchive.h"
+
+HINSTANCE g_hInstance;
+
+#define NT_CHECK_FAIL_ACTION return FALSE;
+
+#ifdef _WIN32
+extern "C"
+BOOL WINAPI DllMain(
+ #ifdef UNDER_CE
+ HANDLE
+ #else
+ HINSTANCE
+ #endif
+ hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
+{
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ // OutputDebugStringA("7z.dll DLL_PROCESS_ATTACH");
+ g_hInstance = (HINSTANCE)hInstance;
+ NT_CHECK;
+ }
+ /*
+ if (dwReason == DLL_PROCESS_DETACH)
+ {
+ OutputDebugStringA("7z.dll DLL_PROCESS_DETACH");
+ }
+ */
+ return TRUE;
+}
+#endif
+
+DEFINE_GUID(CLSID_CArchiveHandler,
+ k_7zip_GUID_Data1,
+ k_7zip_GUID_Data2,
+ k_7zip_GUID_Data3_Common,
+ 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00);
+
+STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject);
+STDAPI CreateHasher(const GUID *clsid, IHasher **hasher);
+STDAPI CreateArchiver(const GUID *clsid, const GUID *iid, void **outObject);
+
+STDAPI CreateObject(const GUID *clsid, const GUID *iid, void **outObject)
+{
+ // COM_TRY_BEGIN
+ *outObject = 0;
+ if (*iid == IID_ICompressCoder ||
+ *iid == IID_ICompressCoder2 ||
+ *iid == IID_ICompressFilter)
+ return CreateCoder(clsid, iid, outObject);
+ if (*iid == IID_IHasher)
+ return CreateHasher(clsid, (IHasher **)outObject);
+ return CreateArchiver(clsid, iid, outObject);
+ // COM_TRY_END
+}
+
+STDAPI SetLargePageMode()
+{
+ #if defined(_7ZIP_LARGE_PAGES)
+ SetLargePageSize();
+ #endif
+ return S_OK;
+}
+
+extern bool g_CaseSensitive;
+
+STDAPI SetCaseSensitive(Int32 caseSensitive)
+{
+ g_CaseSensitive = (caseSensitive != 0);
+ return S_OK;
+}
+
+#ifdef EXTERNAL_CODECS
+
+CExternalCodecs g_ExternalCodecs;
+
+STDAPI SetCodecs(ICompressCodecsInfo *compressCodecsInfo)
+{
+ COM_TRY_BEGIN
+
+ // OutputDebugStringA(compressCodecsInfo ? "SetCodecs" : "SetCodecs NULL");
+ if (compressCodecsInfo)
+ {
+ g_ExternalCodecs.GetCodecs = compressCodecsInfo;
+ return g_ExternalCodecs.Load();
+ }
+ g_ExternalCodecs.ClearAndRelease();
+ return S_OK;
+
+ COM_TRY_END
+}
+
+#else
+
+STDAPI SetCodecs(ICompressCodecsInfo *)
+{
+ return S_OK;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/IArchive.h b/other-licenses/7zstub/src/CPP/7zip/Archive/IArchive.h
new file mode 100644
index 0000000000..96451a6bcd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/IArchive.h
@@ -0,0 +1,608 @@
+// IArchive.h
+
+#ifndef __IARCHIVE_H
+#define __IARCHIVE_H
+
+#include "../IProgress.h"
+#include "../IStream.h"
+#include "../PropID.h"
+
+#define ARCHIVE_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 6, x)
+#define ARCHIVE_INTERFACE(i, x) ARCHIVE_INTERFACE_SUB(i, IUnknown, x)
+
+namespace NFileTimeType
+{
+ enum EEnum
+ {
+ kWindows,
+ kUnix,
+ kDOS
+ };
+}
+
+namespace NArcInfoFlags
+{
+ const UInt32 kKeepName = 1 << 0; // keep name of file in archive name
+ const UInt32 kAltStreams = 1 << 1; // the handler supports alt streams
+ const UInt32 kNtSecure = 1 << 2; // the handler supports NT security
+ const UInt32 kFindSignature = 1 << 3; // the handler can find start of archive
+ const UInt32 kMultiSignature = 1 << 4; // there are several signatures
+ const UInt32 kUseGlobalOffset = 1 << 5; // the seek position of stream must be set as global offset
+ const UInt32 kStartOpen = 1 << 6; // call handler for each start position
+ const UInt32 kPureStartOpen = 1 << 7; // call handler only for start of file
+ const UInt32 kBackwardOpen = 1 << 8; // archive can be open backward
+ const UInt32 kPreArc = 1 << 9; // such archive can be stored before real archive (like SFX stub)
+ const UInt32 kSymLinks = 1 << 10; // the handler supports symbolic links
+ const UInt32 kHardLinks = 1 << 11; // the handler supports hard links
+}
+
+namespace NArchive
+{
+ namespace NHandlerPropID
+ {
+ enum
+ {
+ kName = 0, // VT_BSTR
+ kClassID, // binary GUID in VT_BSTR
+ kExtension, // VT_BSTR
+ kAddExtension, // VT_BSTR
+ kUpdate, // VT_BOOL
+ kKeepName, // VT_BOOL
+ kSignature, // binary in VT_BSTR
+ kMultiSignature, // binary in VT_BSTR
+ kSignatureOffset, // VT_UI4
+ kAltStreams, // VT_BOOL
+ kNtSecure, // VT_BOOL
+ kFlags // VT_UI4
+ // kVersion // VT_UI4 ((VER_MAJOR << 8) | VER_MINOR)
+ };
+ }
+
+ namespace NExtract
+ {
+ namespace NAskMode
+ {
+ enum
+ {
+ kExtract = 0,
+ kTest,
+ kSkip
+ };
+ }
+
+ namespace NOperationResult
+ {
+ enum
+ {
+ kOK = 0,
+ kUnsupportedMethod,
+ kDataError,
+ kCRCError,
+ kUnavailable,
+ kUnexpectedEnd,
+ kDataAfterEnd,
+ kIsNotArc,
+ kHeadersError,
+ kWrongPassword
+ };
+ }
+ }
+
+ namespace NEventIndexType
+ {
+ enum
+ {
+ kNoIndex = 0,
+ kInArcIndex,
+ kBlockIndex,
+ kOutArcIndex
+ };
+ }
+
+ namespace NUpdate
+ {
+ namespace NOperationResult
+ {
+ enum
+ {
+ kOK = 0
+ , // kError
+ };
+ }
+ }
+}
+
+#define INTERFACE_IArchiveOpenCallback(x) \
+ STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes) x; \
+ STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes) x; \
+
+ARCHIVE_INTERFACE(IArchiveOpenCallback, 0x10)
+{
+ INTERFACE_IArchiveOpenCallback(PURE);
+};
+
+/*
+IArchiveExtractCallback::
+
+7-Zip doesn't call IArchiveExtractCallback functions
+ GetStream()
+ PrepareOperation()
+ SetOperationResult()
+from different threads simultaneously.
+But 7-Zip can call functions for IProgress or ICompressProgressInfo functions
+from another threads simultaneously with calls for IArchiveExtractCallback interface.
+
+IArchiveExtractCallback::GetStream()
+ UInt32 index - index of item in Archive
+ Int32 askExtractMode (Extract::NAskMode)
+ if (askMode != NExtract::NAskMode::kExtract)
+ {
+ then the callee can not real stream: (*inStream == NULL)
+ }
+
+ Out:
+ (*inStream == NULL) - for directories
+ (*inStream == NULL) - if link (hard link or symbolic link) was created
+ if (*inStream == NULL && askMode == NExtract::NAskMode::kExtract)
+ {
+ then the caller must skip extracting of that file.
+ }
+
+ returns:
+ S_OK : OK
+ S_FALSE : data error (for decoders)
+
+if (IProgress::SetTotal() was called)
+{
+ IProgress::SetCompleted(completeValue) uses
+ packSize - for some stream formats (xz, gz, bz2, lzma, z, ppmd).
+ unpackSize - for another formats.
+}
+else
+{
+ IProgress::SetCompleted(completeValue) uses packSize.
+}
+
+SetOperationResult()
+ 7-Zip calls SetOperationResult at the end of extracting,
+ so the callee can close the file, set attributes, timestamps and security information.
+
+ Int32 opRes (NExtract::NOperationResult)
+*/
+
+#define INTERFACE_IArchiveExtractCallback(x) \
+ INTERFACE_IProgress(x) \
+ STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode) x; \
+ STDMETHOD(PrepareOperation)(Int32 askExtractMode) x; \
+ STDMETHOD(SetOperationResult)(Int32 opRes) x; \
+
+ARCHIVE_INTERFACE_SUB(IArchiveExtractCallback, IProgress, 0x20)
+{
+ INTERFACE_IArchiveExtractCallback(PURE)
+};
+
+
+
+/*
+IArchiveExtractCallbackMessage can be requested from IArchiveExtractCallback object
+ by Extract() or UpdateItems() functions to report about extracting errors
+ReportExtractResult()
+ UInt32 indexType (NEventIndexType)
+ UInt32 index
+ Int32 opRes (NExtract::NOperationResult)
+*/
+
+#define INTERFACE_IArchiveExtractCallbackMessage(x) \
+ STDMETHOD(ReportExtractResult)(UInt32 indexType, UInt32 index, Int32 opRes) x; \
+
+ARCHIVE_INTERFACE_SUB(IArchiveExtractCallbackMessage, IProgress, 0x21)
+{
+ INTERFACE_IArchiveExtractCallbackMessage(PURE)
+};
+
+
+#define INTERFACE_IArchiveOpenVolumeCallback(x) \
+ STDMETHOD(GetProperty)(PROPID propID, PROPVARIANT *value) x; \
+ STDMETHOD(GetStream)(const wchar_t *name, IInStream **inStream) x; \
+
+ARCHIVE_INTERFACE(IArchiveOpenVolumeCallback, 0x30)
+{
+ INTERFACE_IArchiveOpenVolumeCallback(PURE);
+};
+
+
+ARCHIVE_INTERFACE(IInArchiveGetStream, 0x40)
+{
+ STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream) PURE;
+};
+
+
+ARCHIVE_INTERFACE(IArchiveOpenSetSubArchiveName, 0x50)
+{
+ STDMETHOD(SetSubArchiveName)(const wchar_t *name) PURE;
+};
+
+
+/*
+IInArchive::Open
+ stream
+ if (kUseGlobalOffset), stream current position can be non 0.
+ if (!kUseGlobalOffset), stream current position is 0.
+ if (maxCheckStartPosition == NULL), the handler can try to search archive start in stream
+ if (*maxCheckStartPosition == 0), the handler must check only current position as archive start
+
+IInArchive::Extract:
+ indices must be sorted
+ numItems = (UInt32)(Int32)-1 = 0xFFFFFFFF means "all files"
+ testMode != 0 means "test files without writing to outStream"
+
+IInArchive::GetArchiveProperty:
+ kpidOffset - start offset of archive.
+ VT_EMPTY : means offset = 0.
+ VT_UI4, VT_UI8, VT_I8 : result offset; negative values is allowed
+ kpidPhySize - size of archive. VT_EMPTY means unknown size.
+ kpidPhySize is allowed to be larger than file size. In that case it must show
+ supposed size.
+
+ kpidIsDeleted:
+ kpidIsAltStream:
+ kpidIsAux:
+ kpidINode:
+ must return VARIANT_TRUE (VT_BOOL), if archive can support that property in GetProperty.
+
+
+Notes:
+ Don't call IInArchive functions for same IInArchive object from different threads simultaneously.
+ Some IInArchive handlers will work incorrectly in that case.
+*/
+
+#ifdef _MSC_VER
+ #define MY_NO_THROW_DECL_ONLY throw()
+#else
+ #define MY_NO_THROW_DECL_ONLY
+#endif
+
+#define INTERFACE_IInArchive(x) \
+ STDMETHOD(Open)(IInStream *stream, const UInt64 *maxCheckStartPosition, IArchiveOpenCallback *openCallback) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(Close)() MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetNumberOfItems)(UInt32 *numItems) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(Extract)(const UInt32* indices, UInt32 numItems, Int32 testMode, IArchiveExtractCallback *extractCallback) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetArchiveProperty)(PROPID propID, PROPVARIANT *value) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetNumberOfProperties)(UInt32 *numProps) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetPropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetNumberOfArchiveProperties)(UInt32 *numProps) MY_NO_THROW_DECL_ONLY x; \
+ STDMETHOD(GetArchivePropertyInfo)(UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) MY_NO_THROW_DECL_ONLY x; \
+
+ARCHIVE_INTERFACE(IInArchive, 0x60)
+{
+ INTERFACE_IInArchive(PURE)
+};
+
+namespace NParentType
+{
+ enum
+ {
+ kDir = 0,
+ kAltStream
+ };
+};
+
+namespace NPropDataType
+{
+ const UInt32 kMask_ZeroEnd = 1 << 4;
+ // const UInt32 kMask_BigEndian = 1 << 5;
+ const UInt32 kMask_Utf = 1 << 6;
+ const UInt32 kMask_Utf8 = kMask_Utf | 0;
+ const UInt32 kMask_Utf16 = kMask_Utf | 1;
+ // const UInt32 kMask_Utf32 = kMask_Utf | 2;
+
+ const UInt32 kNotDefined = 0;
+ const UInt32 kRaw = 1;
+
+ const UInt32 kUtf8z = kMask_Utf8 | kMask_ZeroEnd;
+ const UInt32 kUtf16z = kMask_Utf16 | kMask_ZeroEnd;
+};
+
+// UTF string (pointer to wchar_t) with zero end and little-endian.
+#define PROP_DATA_TYPE_wchar_t_PTR_Z_LE ((NPropDataType::kMask_Utf | NPropDataType::kMask_ZeroEnd) + (sizeof(wchar_t) >> 1))
+
+/*
+GetRawProp:
+ Result:
+ S_OK - even if property is not set
+*/
+
+#define INTERFACE_IArchiveGetRawProps(x) \
+ STDMETHOD(GetParent)(UInt32 index, UInt32 *parent, UInt32 *parentType) x; \
+ STDMETHOD(GetRawProp)(UInt32 index, PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType) x; \
+ STDMETHOD(GetNumRawProps)(UInt32 *numProps) x; \
+ STDMETHOD(GetRawPropInfo)(UInt32 index, BSTR *name, PROPID *propID) x;
+
+ARCHIVE_INTERFACE(IArchiveGetRawProps, 0x70)
+{
+ INTERFACE_IArchiveGetRawProps(PURE)
+};
+
+#define INTERFACE_IArchiveGetRootProps(x) \
+ STDMETHOD(GetRootProp)(PROPID propID, PROPVARIANT *value) x; \
+ STDMETHOD(GetRootRawProp)(PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType) x; \
+
+ARCHIVE_INTERFACE(IArchiveGetRootProps, 0x71)
+{
+ INTERFACE_IArchiveGetRootProps(PURE)
+};
+
+ARCHIVE_INTERFACE(IArchiveOpenSeq, 0x61)
+{
+ STDMETHOD(OpenSeq)(ISequentialInStream *stream) PURE;
+};
+
+/*
+ OpenForSize
+ Result:
+ S_FALSE - is not archive
+ ? - DATA error
+*/
+
+/*
+const UInt32 kOpenFlags_RealPhySize = 1 << 0;
+const UInt32 kOpenFlags_NoSeek = 1 << 1;
+// const UInt32 kOpenFlags_BeforeExtract = 1 << 2;
+*/
+
+/*
+Flags:
+ 0 - opens archive with IInStream, if IInStream interface is supported
+ - if phySize is not available, it doesn't try to make full parse to get phySize
+ kOpenFlags_NoSeek - ArcOpen2 function doesn't use IInStream interface, even if it's available
+ kOpenFlags_RealPhySize - the handler will try to get PhySize, even if it requires full decompression for file
+
+ if handler is not allowed to use IInStream and the flag kOpenFlags_RealPhySize is not specified,
+ the handler can return S_OK, but it doesn't check even Signature.
+ So next Extract can be called for that sequential stream.
+*/
+
+/*
+ARCHIVE_INTERFACE(IArchiveOpen2, 0x62)
+{
+ STDMETHOD(ArcOpen2)(ISequentialInStream *stream, UInt32 flags, IArchiveOpenCallback *openCallback) PURE;
+};
+*/
+
+// ---------- UPDATE ----------
+
+/*
+GetUpdateItemInfo outs:
+*newData *newProps
+ 0 0 - Copy data and properties from archive
+ 0 1 - Copy data from archive, request new properties
+ 1 0 - that combination is unused now
+ 1 1 - Request new data and new properties. It can be used even for folders
+
+ indexInArchive = -1 if there is no item in archive, or if it doesn't matter.
+
+
+GetStream out:
+ Result:
+ S_OK:
+ (*inStream == NULL) - only for directories
+ - the bug was fixed in 9.33: (*Stream == NULL) was in case of anti-file
+ (*inStream != NULL) - for any file, even for empty file or anti-file
+ S_FALSE - skip that file (don't add item to archive) - (client code can't open stream of that file by some reason)
+ (*inStream == NULL)
+
+The order of calling for hard links:
+ - GetStream()
+ - GetProperty(kpidHardLink)
+
+SetOperationResult()
+ Int32 opRes (NExtract::NOperationResult::kOK)
+*/
+
+#define INTERFACE_IArchiveUpdateCallback(x) \
+ INTERFACE_IProgress(x); \
+ STDMETHOD(GetUpdateItemInfo)(UInt32 index, Int32 *newData, Int32 *newProps, UInt32 *indexInArchive) x; \
+ STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) x; \
+ STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream) x; \
+ STDMETHOD(SetOperationResult)(Int32 operationResult) x; \
+
+ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback, IProgress, 0x80)
+{
+ INTERFACE_IArchiveUpdateCallback(PURE);
+};
+
+#define INTERFACE_IArchiveUpdateCallback2(x) \
+ INTERFACE_IArchiveUpdateCallback(x) \
+ STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size) x; \
+ STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream) x; \
+
+ARCHIVE_INTERFACE_SUB(IArchiveUpdateCallback2, IArchiveUpdateCallback, 0x82)
+{
+ INTERFACE_IArchiveUpdateCallback2(PURE);
+};
+
+namespace NUpdateNotifyOp
+{
+ enum
+ {
+ kAdd = 0,
+ kUpdate,
+ kAnalyze,
+ kReplicate,
+ kRepack,
+ kSkip,
+ kDelete,
+ kHeader
+
+ // kNumDefined
+ };
+};
+
+/*
+IArchiveUpdateCallbackFile::ReportOperation
+ UInt32 indexType (NEventIndexType)
+ UInt32 index
+ UInt32 notifyOp (NUpdateNotifyOp)
+*/
+
+#define INTERFACE_IArchiveUpdateCallbackFile(x) \
+ STDMETHOD(GetStream2)(UInt32 index, ISequentialInStream **inStream, UInt32 notifyOp) x; \
+ STDMETHOD(ReportOperation)(UInt32 indexType, UInt32 index, UInt32 notifyOp) x; \
+
+ARCHIVE_INTERFACE(IArchiveUpdateCallbackFile, 0x83)
+{
+ INTERFACE_IArchiveUpdateCallbackFile(PURE);
+};
+
+
+/*
+UpdateItems()
+-------------
+
+ outStream: output stream. (the handler) MUST support the case when
+ Seek position in outStream is not ZERO.
+ but the caller calls with empty outStream and seek position is ZERO??
+
+ archives with stub:
+
+ If archive is open and the handler and (Offset > 0), then the handler
+ knows about stub size.
+ UpdateItems():
+ 1) the handler MUST copy that stub to outStream
+ 2) the caller MUST NOT copy the stub to outStream, if
+ "rsfx" property is set with SetProperties
+
+ the handler must support the case where
+ ISequentialOutStream *outStream
+*/
+
+
+#define INTERFACE_IOutArchive(x) \
+ STDMETHOD(UpdateItems)(ISequentialOutStream *outStream, UInt32 numItems, IArchiveUpdateCallback *updateCallback) x; \
+ STDMETHOD(GetFileTimeType)(UInt32 *type) x;
+
+ARCHIVE_INTERFACE(IOutArchive, 0xA0)
+{
+ INTERFACE_IOutArchive(PURE)
+};
+
+
+/*
+ISetProperties::SetProperties()
+ PROPVARIANT values[i].vt:
+ VT_EMPTY
+ VT_BOOL
+ VT_UI4 - if 32-bit number
+ VT_UI8 - if 64-bit number
+ VT_BSTR
+*/
+
+ARCHIVE_INTERFACE(ISetProperties, 0x03)
+{
+ STDMETHOD(SetProperties)(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps) PURE;
+};
+
+ARCHIVE_INTERFACE(IArchiveKeepModeForNextOpen, 0x04)
+{
+ STDMETHOD(KeepModeForNextOpen)() PURE;
+};
+
+/* Exe handler: the handler for executable format (PE, ELF, Mach-O).
+ SFX archive: executable stub + some tail data.
+ before 9.31: exe handler didn't parse SFX archives as executable format.
+ for 9.31+: exe handler parses SFX archives as executable format, only if AllowTail(1) was called */
+
+ARCHIVE_INTERFACE(IArchiveAllowTail, 0x05)
+{
+ STDMETHOD(AllowTail)(Int32 allowTail) PURE;
+};
+
+
+#define IMP_IInArchive_GetProp(k) \
+ (UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) \
+ { if (index >= ARRAY_SIZE(k)) return E_INVALIDARG; \
+ *propID = k[index]; *varType = k7z_PROPID_To_VARTYPE[(unsigned)*propID]; *name = 0; return S_OK; } \
+
+
+struct CStatProp
+{
+ const char *Name;
+ UInt32 PropID;
+ VARTYPE vt;
+};
+
+namespace NWindows {
+namespace NCOM {
+// PropVariant.cpp
+BSTR AllocBstrFromAscii(const char *s) throw();
+}}
+
+#define IMP_IInArchive_GetProp_WITH_NAME(k) \
+ (UInt32 index, BSTR *name, PROPID *propID, VARTYPE *varType) \
+ { if (index >= ARRAY_SIZE(k)) return E_INVALIDARG; \
+ const CStatProp &prop = k[index]; \
+ *propID = (PROPID)prop.PropID; *varType = prop.vt; \
+ *name = NWindows::NCOM::AllocBstrFromAscii(prop.Name); return S_OK; } \
+
+#define IMP_IInArchive_Props \
+ STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProps) \
+ { *numProps = ARRAY_SIZE(kProps); return S_OK; } \
+ STDMETHODIMP CHandler::GetPropertyInfo IMP_IInArchive_GetProp(kProps)
+
+#define IMP_IInArchive_Props_WITH_NAME \
+ STDMETHODIMP CHandler::GetNumberOfProperties(UInt32 *numProps) \
+ { *numProps = ARRAY_SIZE(kProps); return S_OK; } \
+ STDMETHODIMP CHandler::GetPropertyInfo IMP_IInArchive_GetProp_WITH_NAME(kProps)
+
+
+#define IMP_IInArchive_ArcProps \
+ STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProps) \
+ { *numProps = ARRAY_SIZE(kArcProps); return S_OK; } \
+ STDMETHODIMP CHandler::GetArchivePropertyInfo IMP_IInArchive_GetProp(kArcProps)
+
+#define IMP_IInArchive_ArcProps_WITH_NAME \
+ STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProps) \
+ { *numProps = ARRAY_SIZE(kArcProps); return S_OK; } \
+ STDMETHODIMP CHandler::GetArchivePropertyInfo IMP_IInArchive_GetProp_WITH_NAME(kArcProps)
+
+#define IMP_IInArchive_ArcProps_NO_Table \
+ STDMETHODIMP CHandler::GetNumberOfArchiveProperties(UInt32 *numProps) \
+ { *numProps = 0; return S_OK; } \
+ STDMETHODIMP CHandler::GetArchivePropertyInfo(UInt32, BSTR *, PROPID *, VARTYPE *) \
+ { return E_NOTIMPL; } \
+
+#define IMP_IInArchive_ArcProps_NO \
+ IMP_IInArchive_ArcProps_NO_Table \
+ STDMETHODIMP CHandler::GetArchiveProperty(PROPID, PROPVARIANT *value) \
+ { value->vt = VT_EMPTY; return S_OK; }
+
+
+
+#define k_IsArc_Res_NO 0
+#define k_IsArc_Res_YES 1
+#define k_IsArc_Res_NEED_MORE 2
+// #define k_IsArc_Res_YES_LOW_PROB 3
+
+#define API_FUNC_IsArc EXTERN_C UInt32 WINAPI
+#define API_FUNC_static_IsArc extern "C" { static UInt32 WINAPI
+
+extern "C"
+{
+ typedef HRESULT (WINAPI *Func_CreateObject)(const GUID *clsID, const GUID *iid, void **outObject);
+
+ typedef UInt32 (WINAPI *Func_IsArc)(const Byte *p, size_t size);
+ typedef HRESULT (WINAPI *Func_GetIsArc)(UInt32 formatIndex, Func_IsArc *isArc);
+
+ typedef HRESULT (WINAPI *Func_GetNumberOfFormats)(UInt32 *numFormats);
+ typedef HRESULT (WINAPI *Func_GetHandlerProperty)(PROPID propID, PROPVARIANT *value);
+ typedef HRESULT (WINAPI *Func_GetHandlerProperty2)(UInt32 index, PROPID propID, PROPVARIANT *value);
+
+ typedef HRESULT (WINAPI *Func_SetCaseSensitive)(Int32 caseSensitive);
+ typedef HRESULT (WINAPI *Func_SetLargePageMode)();
+
+ typedef IOutArchive * (*Func_CreateOutArchive)();
+ typedef IInArchive * (*Func_CreateInArchive)();
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/Icons/7z.ico b/other-licenses/7zstub/src/CPP/7zip/Archive/Icons/7z.ico
new file mode 100644
index 0000000000..319753a177
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/Icons/7z.ico
Binary files differ
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/LzmaHandler.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/LzmaHandler.cpp
new file mode 100644
index 0000000000..28079dfc67
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/LzmaHandler.cpp
@@ -0,0 +1,605 @@
+// LzmaHandler.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/CpuArch.h"
+
+#include "../../Common/ComTry.h"
+#include "../../Common/IntToString.h"
+
+#include "../../Windows/PropVariant.h"
+
+#include "../Common/FilterCoder.h"
+#include "../Common/ProgressUtils.h"
+#include "../Common/RegisterArc.h"
+#include "../Common/StreamUtils.h"
+
+#include "../Compress/BcjCoder.h"
+#include "../Compress/LzmaDecoder.h"
+
+#include "Common/DummyOutStream.h"
+
+using namespace NWindows;
+
+namespace NArchive {
+namespace NLzma {
+
+static bool CheckDicSize(const Byte *p)
+{
+ UInt32 dicSize = GetUi32(p);
+ if (dicSize == 1)
+ return true;
+ for (unsigned i = 0; i <= 30; i++)
+ if (dicSize == ((UInt32)2 << i) || dicSize == ((UInt32)3 << i))
+ return true;
+ return (dicSize == 0xFFFFFFFF);
+}
+
+static const Byte kProps[] =
+{
+ kpidSize,
+ kpidPackSize,
+ kpidMethod
+};
+
+static const Byte kArcProps[] =
+{
+ kpidNumStreams,
+ kpidMethod
+};
+
+struct CHeader
+{
+ UInt64 Size;
+ Byte FilterID;
+ Byte LzmaProps[5];
+
+ Byte GetProp() const { return LzmaProps[0]; }
+ UInt32 GetDicSize() const { return GetUi32(LzmaProps + 1); }
+ bool HasSize() const { return (Size != (UInt64)(Int64)-1); }
+ bool Parse(const Byte *buf, bool isThereFilter);
+};
+
+bool CHeader::Parse(const Byte *buf, bool isThereFilter)
+{
+ FilterID = 0;
+ if (isThereFilter)
+ FilterID = buf[0];
+ const Byte *sig = buf + (isThereFilter ? 1 : 0);
+ for (int i = 0; i < 5; i++)
+ LzmaProps[i] = sig[i];
+ Size = GetUi64(sig + 5);
+ return
+ LzmaProps[0] < 5 * 5 * 9 &&
+ FilterID < 2 &&
+ (!HasSize() || Size < ((UInt64)1 << 56))
+ && CheckDicSize(LzmaProps + 1);
+}
+
+class CDecoder
+{
+ CMyComPtr<ISequentialOutStream> _bcjStream;
+ CFilterCoder *_filterCoder;
+ CMyComPtr<ICompressCoder> _lzmaDecoder;
+public:
+ NCompress::NLzma::CDecoder *_lzmaDecoderSpec;
+
+ ~CDecoder();
+ HRESULT Create(bool filtered, ISequentialInStream *inStream);
+
+ HRESULT Code(const CHeader &header, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
+
+ UInt64 GetInputProcessedSize() const { return _lzmaDecoderSpec->GetInputProcessedSize(); }
+
+ void ReleaseInStream() { if (_lzmaDecoder) _lzmaDecoderSpec->ReleaseInStream(); }
+
+ HRESULT ReadInput(Byte *data, UInt32 size, UInt32 *processedSize)
+ { return _lzmaDecoderSpec->ReadFromInputStream(data, size, processedSize); }
+};
+
+HRESULT CDecoder::Create(bool filteredMode, ISequentialInStream *inStream)
+{
+ if (!_lzmaDecoder)
+ {
+ _lzmaDecoderSpec = new NCompress::NLzma::CDecoder;
+ _lzmaDecoderSpec->FinishStream = true;
+ _lzmaDecoder = _lzmaDecoderSpec;
+ }
+
+ if (filteredMode)
+ {
+ if (!_bcjStream)
+ {
+ _filterCoder = new CFilterCoder(false);
+ CMyComPtr<ICompressCoder> coder = _filterCoder;
+ _filterCoder->Filter = new NCompress::NBcj::CCoder(false);
+ _bcjStream = _filterCoder;
+ }
+ }
+
+ return _lzmaDecoderSpec->SetInStream(inStream);
+}
+
+CDecoder::~CDecoder()
+{
+ ReleaseInStream();
+}
+
+HRESULT CDecoder::Code(const CHeader &header, ISequentialOutStream *outStream,
+ ICompressProgressInfo *progress)
+{
+ if (header.FilterID > 1)
+ return E_NOTIMPL;
+
+ {
+ CMyComPtr<ICompressSetDecoderProperties2> setDecoderProperties;
+ _lzmaDecoder.QueryInterface(IID_ICompressSetDecoderProperties2, &setDecoderProperties);
+ if (!setDecoderProperties)
+ return E_NOTIMPL;
+ RINOK(setDecoderProperties->SetDecoderProperties2(header.LzmaProps, 5));
+ }
+
+ bool filteredMode = (header.FilterID == 1);
+
+ if (filteredMode)
+ {
+ RINOK(_filterCoder->SetOutStream(outStream));
+ outStream = _bcjStream;
+ RINOK(_filterCoder->SetOutStreamSize(NULL));
+ }
+
+ const UInt64 *Size = header.HasSize() ? &header.Size : NULL;
+ HRESULT res = _lzmaDecoderSpec->CodeResume(outStream, Size, progress);
+
+ if (filteredMode)
+ {
+ {
+ HRESULT res2 = _filterCoder->OutStreamFinish();
+ if (res == S_OK)
+ res = res2;
+ }
+ HRESULT res2 = _filterCoder->ReleaseOutStream();
+ if (res == S_OK)
+ res = res2;
+ }
+
+ RINOK(res);
+
+ if (header.HasSize())
+ if (_lzmaDecoderSpec->GetOutputProcessedSize() != header.Size)
+ return S_FALSE;
+
+ return S_OK;
+}
+
+
+class CHandler:
+ public IInArchive,
+ public IArchiveOpenSeq,
+ public CMyUnknownImp
+{
+ CHeader _header;
+ bool _lzma86;
+ CMyComPtr<IInStream> _stream;
+ CMyComPtr<ISequentialInStream> _seqStream;
+
+ bool _isArc;
+ bool _needSeekToStart;
+ bool _dataAfterEnd;
+ bool _needMoreInput;
+
+ bool _packSize_Defined;
+ bool _unpackSize_Defined;
+ bool _numStreams_Defined;
+
+ bool _unsupported;
+ bool _dataError;
+
+ UInt64 _packSize;
+ UInt64 _unpackSize;
+ UInt64 _numStreams;
+
+ void GetMethod(NCOM::CPropVariant &prop);
+
+public:
+ MY_UNKNOWN_IMP2(IInArchive, IArchiveOpenSeq)
+
+ INTERFACE_IInArchive(;)
+ STDMETHOD(OpenSeq)(ISequentialInStream *stream);
+
+ CHandler(bool lzma86) { _lzma86 = lzma86; }
+
+ unsigned GetHeaderSize() const { return 5 + 8 + (_lzma86 ? 1 : 0); }
+
+};
+
+IMP_IInArchive_Props
+IMP_IInArchive_ArcProps
+
+STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidPhySize: if (_packSize_Defined) prop = _packSize; break;
+ case kpidNumStreams: if (_numStreams_Defined) prop = _numStreams; break;
+ case kpidUnpackSize: if (_unpackSize_Defined) prop = _unpackSize; break;
+ case kpidMethod: GetMethod(prop); break;
+ case kpidErrorFlags:
+ {
+ UInt32 v = 0;
+ if (!_isArc) v |= kpv_ErrorFlags_IsNotArc;;
+ if (_needMoreInput) v |= kpv_ErrorFlags_UnexpectedEnd;
+ if (_dataAfterEnd) v |= kpv_ErrorFlags_DataAfterEnd;
+ if (_unsupported) v |= kpv_ErrorFlags_UnsupportedMethod;
+ if (_dataError) v |= kpv_ErrorFlags_DataError;
+ prop = v;
+ break;
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
+{
+ *numItems = 1;
+ return S_OK;
+}
+
+
+static void DictSizeToString(UInt32 val, char *s)
+{
+ for (unsigned i = 0; i <= 31; i++)
+ if (((UInt32)1 << i) == val)
+ {
+ ::ConvertUInt32ToString(i, s);
+ return;
+ }
+ char c = 'b';
+ if ((val & ((1 << 20) - 1)) == 0) { val >>= 20; c = 'm'; }
+ else if ((val & ((1 << 10) - 1)) == 0) { val >>= 10; c = 'k'; }
+ ::ConvertUInt32ToString(val, s);
+ s += MyStringLen(s);
+ *s++ = c;
+ *s = 0;
+}
+
+static char *AddProp32(char *s, const char *name, UInt32 v)
+{
+ *s++ = ':';
+ s = MyStpCpy(s, name);
+ ::ConvertUInt32ToString(v, s);
+ return s + MyStringLen(s);
+}
+
+void CHandler::GetMethod(NCOM::CPropVariant &prop)
+{
+ if (!_stream)
+ return;
+
+ char sz[64];
+ char *s = sz;
+ if (_header.FilterID != 0)
+ s = MyStpCpy(s, "BCJ ");
+ s = MyStpCpy(s, "LZMA:");
+ DictSizeToString(_header.GetDicSize(), s);
+ s += strlen(s);
+
+ UInt32 d = _header.GetProp();
+ // if (d != 0x5D)
+ {
+ UInt32 lc = d % 9;
+ d /= 9;
+ UInt32 pb = d / 5;
+ UInt32 lp = d % 5;
+ if (lc != 3) s = AddProp32(s, "lc", lc);
+ if (lp != 0) s = AddProp32(s, "lp", lp);
+ if (pb != 2) s = AddProp32(s, "pb", pb);
+ }
+ prop = sz;
+}
+
+
+STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidSize: if (_stream && _header.HasSize()) prop = _header.Size; break;
+ case kpidPackSize: if (_packSize_Defined) prop = _packSize; break;
+ case kpidMethod: GetMethod(prop); break;
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+API_FUNC_static_IsArc IsArc_Lzma(const Byte *p, size_t size)
+{
+ const UInt32 kHeaderSize = 1 + 4 + 8;
+ if (size < kHeaderSize)
+ return k_IsArc_Res_NEED_MORE;
+ if (p[0] >= 5 * 5 * 9)
+ return k_IsArc_Res_NO;
+ UInt64 unpackSize = GetUi64(p + 1 + 4);
+ if (unpackSize != (UInt64)(Int64)-1)
+ {
+ if (size >= ((UInt64)1 << 56))
+ return k_IsArc_Res_NO;
+ }
+ if (unpackSize != 0)
+ {
+ if (size < kHeaderSize + 2)
+ return k_IsArc_Res_NEED_MORE;
+ if (p[kHeaderSize] != 0)
+ return k_IsArc_Res_NO;
+ if (unpackSize != (UInt64)(Int64)-1)
+ {
+ if ((p[kHeaderSize + 1] & 0x80) != 0)
+ return k_IsArc_Res_NO;
+ }
+ }
+ if (!CheckDicSize(p + 1))
+ // return k_IsArc_Res_YES_LOW_PROB;
+ return k_IsArc_Res_NO;
+ return k_IsArc_Res_YES;
+}
+}
+
+API_FUNC_static_IsArc IsArc_Lzma86(const Byte *p, size_t size)
+{
+ if (size < 1)
+ return k_IsArc_Res_NEED_MORE;
+ Byte filterID = p[0];
+ if (filterID != 0 && filterID != 1)
+ return k_IsArc_Res_NO;
+ return IsArc_Lzma(p + 1, size - 1);
+}
+}
+
+STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 *, IArchiveOpenCallback *)
+{
+ Close();
+
+ const UInt32 kBufSize = 1 + 5 + 8 + 2;
+ Byte buf[kBufSize];
+
+ RINOK(ReadStream_FALSE(inStream, buf, kBufSize));
+
+ if (!_header.Parse(buf, _lzma86))
+ return S_FALSE;
+ const Byte *start = buf + GetHeaderSize();
+ if (start[0] != 0 /* || (start[1] & 0x80) != 0 */ ) // empty stream with EOS is not 0x80
+ return S_FALSE;
+
+ RINOK(inStream->Seek(0, STREAM_SEEK_END, &_packSize));
+ if (_packSize >= 24 && _header.Size == 0 && _header.FilterID == 0 && _header.LzmaProps[0] == 0)
+ return S_FALSE;
+ _isArc = true;
+ _stream = inStream;
+ _seqStream = inStream;
+ _needSeekToStart = true;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::OpenSeq(ISequentialInStream *stream)
+{
+ Close();
+ _isArc = true;
+ _seqStream = stream;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::Close()
+{
+ _isArc = false;
+ _packSize_Defined = false;
+ _unpackSize_Defined = false;
+ _numStreams_Defined = false;
+
+ _dataAfterEnd = false;
+ _needMoreInput = false;
+ _unsupported = false;
+ _dataError = false;
+
+ _packSize = 0;
+
+ _needSeekToStart = false;
+
+ _stream.Release();
+ _seqStream.Release();
+ return S_OK;
+}
+
+class CCompressProgressInfoImp:
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+ CMyComPtr<IArchiveOpenCallback> Callback;
+public:
+ UInt64 Offset;
+
+ MY_UNKNOWN_IMP1(ICompressProgressInfo)
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+ void Init(IArchiveOpenCallback *callback) { Callback = callback; }
+};
+
+STDMETHODIMP CCompressProgressInfoImp::SetRatioInfo(const UInt64 *inSize, const UInt64 * /* outSize */)
+{
+ if (Callback)
+ {
+ const UInt64 files = 0;
+ const UInt64 val = Offset + *inSize;
+ return Callback->SetCompleted(&files, &val);
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
+ Int32 testMode, IArchiveExtractCallback *extractCallback)
+{
+ COM_TRY_BEGIN
+
+ if (numItems == 0)
+ return S_OK;
+ if (numItems != (UInt32)(Int32)-1 && (numItems != 1 || indices[0] != 0))
+ return E_INVALIDARG;
+
+ if (_packSize_Defined)
+ extractCallback->SetTotal(_packSize);
+
+
+ CMyComPtr<ISequentialOutStream> realOutStream;
+ Int32 askMode = testMode ?
+ NExtract::NAskMode::kTest :
+ NExtract::NAskMode::kExtract;
+ RINOK(extractCallback->GetStream(0, &realOutStream, askMode));
+ if (!testMode && !realOutStream)
+ return S_OK;
+
+ extractCallback->PrepareOperation(askMode);
+
+ CDummyOutStream *outStreamSpec = new CDummyOutStream;
+ CMyComPtr<ISequentialOutStream> outStream(outStreamSpec);
+ outStreamSpec->SetStream(realOutStream);
+ outStreamSpec->Init();
+ realOutStream.Release();
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(extractCallback, true);
+
+ if (_needSeekToStart)
+ {
+ if (!_stream)
+ return E_FAIL;
+ RINOK(_stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+ else
+ _needSeekToStart = true;
+
+ CDecoder decoder;
+ HRESULT result = decoder.Create(_lzma86, _seqStream);
+ RINOK(result);
+
+ bool firstItem = true;
+
+ UInt64 packSize = 0;
+ UInt64 unpackSize = 0;
+ UInt64 numStreams = 0;
+
+ bool dataAfterEnd = false;
+
+ for (;;)
+ {
+ lps->InSize = packSize;
+ lps->OutSize = unpackSize;
+ RINOK(lps->SetCur());
+
+ const UInt32 kBufSize = 1 + 5 + 8;
+ Byte buf[kBufSize];
+ const UInt32 headerSize = GetHeaderSize();
+ UInt32 processed;
+ RINOK(decoder.ReadInput(buf, headerSize, &processed));
+ if (processed != headerSize)
+ {
+ if (processed != 0)
+ dataAfterEnd = true;
+ break;
+ }
+
+ CHeader st;
+ if (!st.Parse(buf, _lzma86))
+ {
+ dataAfterEnd = true;
+ break;
+ }
+ numStreams++;
+ firstItem = false;
+
+ result = decoder.Code(st, outStream, progress);
+
+ packSize = decoder.GetInputProcessedSize();
+ unpackSize = outStreamSpec->GetSize();
+
+ if (result == E_NOTIMPL)
+ {
+ _unsupported = true;
+ result = S_FALSE;
+ break;
+ }
+ if (result == S_FALSE)
+ break;
+ RINOK(result);
+ }
+
+ if (firstItem)
+ {
+ _isArc = false;
+ result = S_FALSE;
+ }
+ else if (result == S_OK || result == S_FALSE)
+ {
+ if (dataAfterEnd)
+ _dataAfterEnd = true;
+ else if (decoder._lzmaDecoderSpec->NeedsMoreInput())
+ _needMoreInput = true;
+
+ _packSize = packSize;
+ _unpackSize = unpackSize;
+ _numStreams = numStreams;
+
+ _packSize_Defined = true;
+ _unpackSize_Defined = true;
+ _numStreams_Defined = true;
+ }
+
+ Int32 opResult = NExtract::NOperationResult::kOK;
+
+ if (!_isArc)
+ opResult = NExtract::NOperationResult::kIsNotArc;
+ else if (_needMoreInput)
+ opResult = NExtract::NOperationResult::kUnexpectedEnd;
+ else if (_unsupported)
+ opResult = NExtract::NOperationResult::kUnsupportedMethod;
+ else if (_dataAfterEnd)
+ opResult = NExtract::NOperationResult::kDataAfterEnd;
+ else if (result == S_FALSE)
+ opResult = NExtract::NOperationResult::kDataError;
+ else if (result == S_OK)
+ opResult = NExtract::NOperationResult::kOK;
+ else
+ return result;
+
+ outStream.Release();
+ return extractCallback->SetOperationResult(opResult);
+
+ COM_TRY_END
+}
+
+namespace NLzmaAr {
+
+// 2, { 0x5D, 0x00 },
+
+REGISTER_ARC_I_CLS_NO_SIG(
+ CHandler(false),
+ "lzma", "lzma", 0, 0xA,
+ 0,
+ NArcInfoFlags::kStartOpen |
+ NArcInfoFlags::kKeepName,
+ IsArc_Lzma)
+
+}
+
+namespace NLzma86Ar {
+
+REGISTER_ARC_I_CLS_NO_SIG(
+ CHandler(true),
+ "lzma86", "lzma86", 0, 0xB,
+ 0,
+ NArcInfoFlags::kKeepName,
+ IsArc_Lzma86)
+
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/SplitHandler.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/SplitHandler.cpp
new file mode 100644
index 0000000000..ffb0e3343c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/SplitHandler.cpp
@@ -0,0 +1,359 @@
+// SplitHandler.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/ComTry.h"
+#include "../../Common/MyString.h"
+
+#include "../../Windows/PropVariant.h"
+
+#include "../Common/ProgressUtils.h"
+#include "../Common/RegisterArc.h"
+
+#include "../Compress/CopyCoder.h"
+
+#include "Common/MultiStream.h"
+
+using namespace NWindows;
+
+namespace NArchive {
+namespace NSplit {
+
+static const Byte kProps[] =
+{
+ kpidPath,
+ kpidSize
+};
+
+static const Byte kArcProps[] =
+{
+ kpidNumVolumes,
+ kpidTotalPhySize
+};
+
+class CHandler:
+ public IInArchive,
+ public IInArchiveGetStream,
+ public CMyUnknownImp
+{
+ CObjectVector<CMyComPtr<IInStream> > _streams;
+ CRecordVector<UInt64> _sizes;
+ UString _subName;
+ UInt64 _totalSize;
+
+ HRESULT Open2(IInStream *stream, IArchiveOpenCallback *callback);
+public:
+ MY_UNKNOWN_IMP2(IInArchive, IInArchiveGetStream)
+ INTERFACE_IInArchive(;)
+ STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
+};
+
+IMP_IInArchive_Props
+IMP_IInArchive_ArcProps
+
+STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidMainSubfile: prop = (UInt32)0; break;
+ case kpidPhySize: if (!_sizes.IsEmpty()) prop = _sizes[0]; break;
+ case kpidTotalPhySize: prop = _totalSize; break;
+ case kpidNumVolumes: prop = (UInt32)_streams.Size(); break;
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+struct CSeqName
+{
+ UString _unchangedPart;
+ UString _changedPart;
+ bool _splitStyle;
+
+ bool GetNextName(UString &s)
+ {
+ {
+ unsigned i = _changedPart.Len();
+ for (;;)
+ {
+ wchar_t c = _changedPart[--i];
+
+ if (_splitStyle)
+ {
+ if (c == 'z')
+ {
+ _changedPart.ReplaceOneCharAtPos(i, L'a');
+ if (i == 0)
+ return false;
+ continue;
+ }
+ else if (c == 'Z')
+ {
+ _changedPart.ReplaceOneCharAtPos(i, L'A');
+ if (i == 0)
+ return false;
+ continue;
+ }
+ }
+ else
+ {
+ if (c == '9')
+ {
+ _changedPart.ReplaceOneCharAtPos(i, L'0');
+ if (i == 0)
+ {
+ _changedPart.InsertAtFront(L'1');
+ break;
+ }
+ continue;
+ }
+ }
+
+ c++;
+ _changedPart.ReplaceOneCharAtPos(i, c);
+ break;
+ }
+ }
+
+ s = _unchangedPart + _changedPart;
+ return true;
+ }
+};
+
+HRESULT CHandler::Open2(IInStream *stream, IArchiveOpenCallback *callback)
+{
+ Close();
+ if (!callback)
+ return S_FALSE;
+
+ CMyComPtr<IArchiveOpenVolumeCallback> volumeCallback;
+ callback->QueryInterface(IID_IArchiveOpenVolumeCallback, (void **)&volumeCallback);
+ if (!volumeCallback)
+ return S_FALSE;
+
+ UString name;
+ {
+ NCOM::CPropVariant prop;
+ RINOK(volumeCallback->GetProperty(kpidName, &prop));
+ if (prop.vt != VT_BSTR)
+ return S_FALSE;
+ name = prop.bstrVal;
+ }
+
+ int dotPos = name.ReverseFind_Dot();
+ const UString prefix = name.Left(dotPos + 1);
+ const UString ext = name.Ptr(dotPos + 1);
+ UString ext2 = ext;
+ ext2.MakeLower_Ascii();
+
+ CSeqName seqName;
+
+ unsigned numLetters = 2;
+ bool splitStyle = false;
+
+ if (ext2.Len() >= 2 && StringsAreEqual_Ascii(ext2.RightPtr(2), "aa"))
+ {
+ splitStyle = true;
+ while (numLetters < ext2.Len())
+ {
+ if (ext2[ext2.Len() - numLetters - 1] != 'a')
+ break;
+ numLetters++;
+ }
+ }
+ else if (ext.Len() >= 2 && StringsAreEqual_Ascii(ext2.RightPtr(2), "01"))
+ {
+ while (numLetters < ext2.Len())
+ {
+ if (ext2[ext2.Len() - numLetters - 1] != '0')
+ break;
+ numLetters++;
+ }
+ if (numLetters != ext.Len())
+ return S_FALSE;
+ }
+ else
+ return S_FALSE;
+
+ seqName._unchangedPart = prefix + ext.Left(ext2.Len() - numLetters);
+ seqName._changedPart = ext.RightPtr(numLetters);
+ seqName._splitStyle = splitStyle;
+
+ if (prefix.Len() < 1)
+ _subName = "file";
+ else
+ _subName.SetFrom(prefix, prefix.Len() - 1);
+
+ UInt64 size;
+ {
+ /*
+ NCOM::CPropVariant prop;
+ RINOK(volumeCallback->GetProperty(kpidSize, &prop));
+ if (prop.vt != VT_UI8)
+ return E_INVALIDARG;
+ size = prop.uhVal.QuadPart;
+ */
+ RINOK(stream->Seek(0, STREAM_SEEK_END, &size));
+ RINOK(stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+
+ _totalSize += size;
+ _sizes.Add(size);
+ _streams.Add(stream);
+
+ {
+ const UInt64 numFiles = _streams.Size();
+ RINOK(callback->SetCompleted(&numFiles, NULL));
+ }
+
+ for (;;)
+ {
+ UString fullName;
+ if (!seqName.GetNextName(fullName))
+ break;
+ CMyComPtr<IInStream> nextStream;
+ HRESULT result = volumeCallback->GetStream(fullName, &nextStream);
+ if (result == S_FALSE)
+ break;
+ if (result != S_OK)
+ return result;
+ if (!nextStream)
+ break;
+ {
+ /*
+ NCOM::CPropVariant prop;
+ RINOK(volumeCallback->GetProperty(kpidSize, &prop));
+ if (prop.vt != VT_UI8)
+ return E_INVALIDARG;
+ size = prop.uhVal.QuadPart;
+ */
+ RINOK(nextStream->Seek(0, STREAM_SEEK_END, &size));
+ RINOK(nextStream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+ _totalSize += size;
+ _sizes.Add(size);
+ _streams.Add(nextStream);
+ {
+ const UInt64 numFiles = _streams.Size();
+ RINOK(callback->SetCompleted(&numFiles, NULL));
+ }
+ }
+
+ if (_streams.Size() == 1)
+ {
+ if (splitStyle)
+ return S_FALSE;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallback *callback)
+{
+ COM_TRY_BEGIN
+ HRESULT res = Open2(stream, callback);
+ if (res != S_OK)
+ Close();
+ return res;
+ COM_TRY_END
+}
+
+STDMETHODIMP CHandler::Close()
+{
+ _totalSize = 0;
+ _subName.Empty();
+ _streams.Clear();
+ _sizes.Clear();
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
+{
+ *numItems = _streams.IsEmpty() ? 0 : 1;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetProperty(UInt32 /* index */, PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidPath: prop = _subName; break;
+ case kpidSize:
+ case kpidPackSize:
+ prop = _totalSize;
+ break;
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
+ Int32 testMode, IArchiveExtractCallback *extractCallback)
+{
+ COM_TRY_BEGIN
+ if (numItems == 0)
+ return S_OK;
+ if (numItems != (UInt32)(Int32)-1 && (numItems != 1 || indices[0] != 0))
+ return E_INVALIDARG;
+
+ UInt64 currentTotalSize = 0;
+ RINOK(extractCallback->SetTotal(_totalSize));
+ CMyComPtr<ISequentialOutStream> outStream;
+ Int32 askMode = testMode ?
+ NExtract::NAskMode::kTest :
+ NExtract::NAskMode::kExtract;
+ RINOK(extractCallback->GetStream(0, &outStream, askMode));
+ if (!testMode && !outStream)
+ return S_OK;
+ RINOK(extractCallback->PrepareOperation(askMode));
+
+ NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder;
+ CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec;
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(extractCallback, false);
+
+ FOR_VECTOR (i, _streams)
+ {
+ lps->InSize = lps->OutSize = currentTotalSize;
+ RINOK(lps->SetCur());
+ IInStream *inStream = _streams[i];
+ RINOK(inStream->Seek(0, STREAM_SEEK_SET, NULL));
+ RINOK(copyCoder->Code(inStream, outStream, NULL, NULL, progress));
+ currentTotalSize += copyCoderSpec->TotalSize;
+ }
+ outStream.Release();
+ return extractCallback->SetOperationResult(NExtract::NOperationResult::kOK);
+ COM_TRY_END
+}
+
+STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
+{
+ COM_TRY_BEGIN
+ if (index != 0)
+ return E_INVALIDARG;
+ *stream = 0;
+ CMultiStream *streamSpec = new CMultiStream;
+ CMyComPtr<ISequentialInStream> streamTemp = streamSpec;
+ FOR_VECTOR (i, _streams)
+ {
+ CMultiStream::CSubStreamInfo subStreamInfo;
+ subStreamInfo.Stream = _streams[i];
+ subStreamInfo.Size = _sizes[i];
+ streamSpec->Streams.Add(subStreamInfo);
+ }
+ streamSpec->Init();
+ *stream = streamTemp.Detach();
+ return S_OK;
+ COM_TRY_END
+}
+
+REGISTER_ARC_I_NO_SIG(
+ "Split", "001", 0, 0xEA,
+ 0,
+ 0,
+ NULL)
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Archive/StdAfx.h
new file mode 100644
index 0000000000..42a088f121
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.cpp b/other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.cpp
new file mode 100644
index 0000000000..74cbca9d59
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.cpp
@@ -0,0 +1,1308 @@
+// XzHandler.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../../Common/ComTry.h"
+#include "../../Common/Defs.h"
+#include "../../Common/IntToString.h"
+#include "../../Common/MyBuffer.h"
+#include "../../Common/StringToInt.h"
+
+#include "../../Windows/PropVariant.h"
+#include "../../Windows/System.h"
+
+#include "../Common/CWrappers.h"
+#include "../Common/ProgressUtils.h"
+#include "../Common/RegisterArc.h"
+#include "../Common/StreamUtils.h"
+
+#include "../Compress/CopyCoder.h"
+#include "../Compress/XzDecoder.h"
+#include "../Compress/XzEncoder.h"
+
+#include "IArchive.h"
+
+#include "Common/HandlerOut.h"
+
+using namespace NWindows;
+
+namespace NArchive {
+namespace NXz {
+
+#define k_LZMA2_Name "LZMA2"
+
+
+struct CBlockInfo
+{
+ unsigned StreamFlags;
+ UInt64 PackPos;
+ UInt64 PackSize; // pure value from Index record, it doesn't include pad zeros
+ UInt64 UnpackPos;
+};
+
+
+class CHandler:
+ public IInArchive,
+ public IArchiveOpenSeq,
+ public IInArchiveGetStream,
+ public ISetProperties,
+
+ #ifndef EXTRACT_ONLY
+ public IOutArchive,
+ #endif
+
+ public CMyUnknownImp,
+
+ #ifndef EXTRACT_ONLY
+ public CMultiMethodProps
+ #else
+ public CCommonMethodProps
+ #endif
+{
+ CXzStatInfo _stat;
+ SRes MainDecodeSRes;
+
+ bool _isArc;
+ bool _needSeekToStart;
+ bool _phySize_Defined;
+ bool _firstBlockWasRead;
+
+ AString _methodsString;
+
+ #ifndef EXTRACT_ONLY
+
+ UInt32 _filterId;
+
+ UInt64 _numSolidBytes;
+
+ void InitXz()
+ {
+ _filterId = 0;
+ _numSolidBytes = XZ_PROPS__BLOCK_SIZE__AUTO;
+ }
+
+ #endif
+
+ void Init()
+ {
+ #ifndef EXTRACT_ONLY
+ InitXz();
+ CMultiMethodProps::Init();
+ #else
+ CCommonMethodProps::InitCommon();
+ #endif
+ }
+
+ HRESULT SetProperty(const wchar_t *name, const PROPVARIANT &value);
+
+ HRESULT Open2(IInStream *inStream, /* UInt32 flags, */ IArchiveOpenCallback *callback);
+
+ HRESULT Decode(NCompress::NXz::CDecoder &decoder,
+ ISequentialInStream *seqInStream,
+ ISequentialOutStream *outStream,
+ ICompressProgressInfo *progress)
+ {
+ #ifndef _7ZIP_ST
+ decoder._numThreads = _numThreads;
+ #endif
+ decoder._memUsage = _memUsage;
+
+ MainDecodeSRes = SZ_OK;
+
+ RINOK(decoder.Decode(seqInStream, outStream,
+ NULL, // *outSizeLimit
+ true, // finishStream
+ progress));
+
+ _stat = decoder.Stat;
+ MainDecodeSRes = decoder.MainDecodeSRes;
+
+ _phySize_Defined = true;
+ return S_OK;
+ }
+
+public:
+ MY_QUERYINTERFACE_BEGIN2(IInArchive)
+ MY_QUERYINTERFACE_ENTRY(IArchiveOpenSeq)
+ MY_QUERYINTERFACE_ENTRY(IInArchiveGetStream)
+ MY_QUERYINTERFACE_ENTRY(ISetProperties)
+ #ifndef EXTRACT_ONLY
+ MY_QUERYINTERFACE_ENTRY(IOutArchive)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ INTERFACE_IInArchive(;)
+ STDMETHOD(OpenSeq)(ISequentialInStream *stream);
+ STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
+ STDMETHOD(SetProperties)(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps);
+
+ #ifndef EXTRACT_ONLY
+ INTERFACE_IOutArchive(;)
+ #endif
+
+ size_t _blocksArraySize;
+ CBlockInfo *_blocks;
+ UInt64 _maxBlocksSize;
+ CMyComPtr<IInStream> _stream;
+ CMyComPtr<ISequentialInStream> _seqStream;
+
+ CXzBlock _firstBlock;
+
+ CHandler();
+ ~CHandler();
+
+ HRESULT SeekToPackPos(UInt64 pos)
+ {
+ return _stream->Seek(pos, STREAM_SEEK_SET, NULL);
+ }
+};
+
+
+CHandler::CHandler():
+ _blocks(NULL),
+ _blocksArraySize(0)
+{
+ #ifndef EXTRACT_ONLY
+ InitXz();
+ #endif
+}
+
+CHandler::~CHandler()
+{
+ MyFree(_blocks);
+}
+
+
+static const Byte kProps[] =
+{
+ kpidSize,
+ kpidPackSize,
+ kpidMethod
+};
+
+static const Byte kArcProps[] =
+{
+ kpidMethod,
+ kpidNumStreams,
+ kpidNumBlocks,
+ kpidClusterSize,
+ kpidCharacts
+};
+
+IMP_IInArchive_Props
+IMP_IInArchive_ArcProps
+
+static inline char GetHex(unsigned value)
+{
+ return (char)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
+}
+
+static inline void AddHexToString(AString &s, Byte value)
+{
+ s += GetHex(value >> 4);
+ s += GetHex(value & 0xF);
+}
+
+static void Lzma2PropToString(AString &s, unsigned prop)
+{
+ char c = 0;
+ UInt32 size;
+ if ((prop & 1) == 0)
+ size = prop / 2 + 12;
+ else
+ {
+ c = 'k';
+ size = (UInt32)(2 | (prop & 1)) << (prop / 2 + 1);
+ if (prop > 17)
+ {
+ size >>= 10;
+ c = 'm';
+ }
+ }
+ s.Add_UInt32(size);
+ if (c != 0)
+ s += c;
+}
+
+struct CMethodNamePair
+{
+ UInt32 Id;
+ const char *Name;
+};
+
+static const CMethodNamePair g_NamePairs[] =
+{
+ { XZ_ID_Subblock, "SB" },
+ { XZ_ID_Delta, "Delta" },
+ { XZ_ID_X86, "BCJ" },
+ { XZ_ID_PPC, "PPC" },
+ { XZ_ID_IA64, "IA64" },
+ { XZ_ID_ARM, "ARM" },
+ { XZ_ID_ARMT, "ARMT" },
+ { XZ_ID_SPARC, "SPARC" },
+ { XZ_ID_LZMA2, "LZMA2" }
+};
+
+static void AddMethodString(AString &s, const CXzFilter &f)
+{
+ const char *p = NULL;
+ for (unsigned i = 0; i < ARRAY_SIZE(g_NamePairs); i++)
+ if (g_NamePairs[i].Id == f.id)
+ {
+ p = g_NamePairs[i].Name;
+ break;
+ }
+ char temp[32];
+ if (!p)
+ {
+ ::ConvertUInt64ToString(f.id, temp);
+ p = temp;
+ }
+
+ s += p;
+
+ if (f.propsSize > 0)
+ {
+ s += ':';
+ if (f.id == XZ_ID_LZMA2 && f.propsSize == 1)
+ Lzma2PropToString(s, f.props[0]);
+ else if (f.id == XZ_ID_Delta && f.propsSize == 1)
+ s.Add_UInt32((UInt32)f.props[0] + 1);
+ else
+ {
+ s += '[';
+ for (UInt32 bi = 0; bi < f.propsSize; bi++)
+ AddHexToString(s, f.props[bi]);
+ s += ']';
+ }
+ }
+}
+
+static const char * const kChecks[] =
+{
+ "NoCheck"
+ , "CRC32"
+ , NULL
+ , NULL
+ , "CRC64"
+ , NULL
+ , NULL
+ , NULL
+ , NULL
+ , NULL
+ , "SHA256"
+ , NULL
+ , NULL
+ , NULL
+ , NULL
+ , NULL
+};
+
+static void AddCheckString(AString &s, const CXzs &xzs)
+{
+ size_t i;
+ UInt32 mask = 0;
+ for (i = 0; i < xzs.num; i++)
+ mask |= ((UInt32)1 << XzFlags_GetCheckType(xzs.streams[i].flags));
+ for (i = 0; i <= XZ_CHECK_MASK; i++)
+ if (((mask >> i) & 1) != 0)
+ {
+ s.Add_Space_if_NotEmpty();
+ if (kChecks[i])
+ s += kChecks[i];
+ else
+ {
+ s += "Check-";
+ s.Add_UInt32((UInt32)i);
+ }
+ }
+}
+
+STDMETHODIMP CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidPhySize: if (_phySize_Defined) prop = _stat.InSize; break;
+ case kpidNumStreams: if (_stat.NumStreams_Defined) prop = _stat.NumStreams; break;
+ case kpidNumBlocks: if (_stat.NumBlocks_Defined) prop = _stat.NumBlocks; break;
+ case kpidUnpackSize: if (_stat.UnpackSize_Defined) prop = _stat.OutSize; break;
+ case kpidClusterSize: if (_stat.NumBlocks_Defined && _stat.NumBlocks > 1) prop = _maxBlocksSize; break;
+ case kpidCharacts:
+ if (_firstBlockWasRead)
+ {
+ AString s;
+ if (XzBlock_HasPackSize(&_firstBlock))
+ s.Add_OptSpaced("BlockPackSize");
+ if (XzBlock_HasUnpackSize(&_firstBlock))
+ s.Add_OptSpaced("BlockUnpackSize");
+ if (!s.IsEmpty())
+ prop = s;
+ }
+ break;
+
+
+ case kpidMethod: if (!_methodsString.IsEmpty()) prop = _methodsString; break;
+ case kpidErrorFlags:
+ {
+ UInt32 v = 0;
+ SRes sres = MainDecodeSRes; // _stat.DecodeRes2; //
+ if (!_isArc) v |= kpv_ErrorFlags_IsNotArc;
+ if (/*_stat.UnexpectedEnd */ sres == SZ_ERROR_INPUT_EOF) v |= kpv_ErrorFlags_UnexpectedEnd;
+ if (_stat.DataAfterEnd) v |= kpv_ErrorFlags_DataAfterEnd;
+ if (/* _stat.HeadersError */ sres == SZ_ERROR_ARCHIVE) v |= kpv_ErrorFlags_HeadersError;
+ if (/* _stat.Unsupported */ sres == SZ_ERROR_UNSUPPORTED) v |= kpv_ErrorFlags_UnsupportedMethod;
+ if (/* _stat.DataError */ sres == SZ_ERROR_DATA) v |= kpv_ErrorFlags_DataError;
+ if (/* _stat.CrcError */ sres == SZ_ERROR_CRC) v |= kpv_ErrorFlags_CrcError;
+ if (v != 0)
+ prop = v;
+ break;
+ }
+
+ case kpidMainSubfile:
+ {
+ // debug only, comment it:
+ // if (_blocks) prop = (UInt32)0;
+ break;
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
+{
+ *numItems = 1;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetProperty(UInt32, PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidSize: if (_stat.UnpackSize_Defined) prop = _stat.OutSize; break;
+ case kpidPackSize: if (_phySize_Defined) prop = _stat.InSize; break;
+ case kpidMethod: if (!_methodsString.IsEmpty()) prop = _methodsString; break;
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+
+struct COpenCallbackWrap
+{
+ ICompressProgress vt;
+ IArchiveOpenCallback *OpenCallback;
+ HRESULT Res;
+ COpenCallbackWrap(IArchiveOpenCallback *progress);
+};
+
+static SRes OpenCallbackProgress(const ICompressProgress *pp, UInt64 inSize, UInt64 /* outSize */)
+{
+ COpenCallbackWrap *p = CONTAINER_FROM_VTBL(pp, COpenCallbackWrap, vt);
+ if (p->OpenCallback)
+ p->Res = p->OpenCallback->SetCompleted(NULL, &inSize);
+ return HRESULT_To_SRes(p->Res, SZ_ERROR_PROGRESS);
+}
+
+COpenCallbackWrap::COpenCallbackWrap(IArchiveOpenCallback *callback)
+{
+ vt.Progress = OpenCallbackProgress;
+ OpenCallback = callback;
+ Res = SZ_OK;
+}
+
+
+struct CXzsCPP
+{
+ CXzs p;
+ CXzsCPP() { Xzs_Construct(&p); }
+ ~CXzsCPP() { Xzs_Free(&p, &g_Alloc); }
+};
+
+#define kInputBufSize ((size_t)1 << 10)
+
+struct CLookToRead2_CPP: public CLookToRead2
+{
+ CLookToRead2_CPP()
+ {
+ buf = NULL;
+ LookToRead2_CreateVTable(this,
+ True // Lookahead ?
+ );
+ }
+ void Alloc(size_t allocSize)
+ {
+ buf = (Byte *)MyAlloc(allocSize);
+ if (buf)
+ this->bufSize = allocSize;
+ }
+ ~CLookToRead2_CPP()
+ {
+ MyFree(buf);
+ }
+};
+
+
+static HRESULT SRes_to_Open_HRESULT(SRes res)
+{
+ switch (res)
+ {
+ case SZ_OK: return S_OK;
+ case SZ_ERROR_MEM: return E_OUTOFMEMORY;
+ case SZ_ERROR_PROGRESS: return E_ABORT;
+ /*
+ case SZ_ERROR_UNSUPPORTED:
+ case SZ_ERROR_CRC:
+ case SZ_ERROR_DATA:
+ case SZ_ERROR_ARCHIVE:
+ case SZ_ERROR_NO_ARCHIVE:
+ return S_FALSE;
+ */
+ }
+ return S_FALSE;
+}
+
+
+
+HRESULT CHandler::Open2(IInStream *inStream, /* UInt32 flags, */ IArchiveOpenCallback *callback)
+{
+ _needSeekToStart = true;
+
+ {
+ CXzStreamFlags st;
+ CSeqInStreamWrap inStreamWrap;
+
+ inStreamWrap.Init(inStream);
+ SRes res = Xz_ReadHeader(&st, &inStreamWrap.vt);
+ if (res != SZ_OK)
+ return SRes_to_Open_HRESULT(res);
+
+ {
+ CXzBlock block;
+ Bool isIndex;
+ UInt32 headerSizeRes;
+ SRes res2 = XzBlock_ReadHeader(&block, &inStreamWrap.vt, &isIndex, &headerSizeRes);
+ if (res2 == SZ_OK && !isIndex)
+ {
+ _firstBlockWasRead = true;
+ _firstBlock = block;
+
+ unsigned numFilters = XzBlock_GetNumFilters(&block);
+ for (unsigned i = 0; i < numFilters; i++)
+ {
+ _methodsString.Add_Space_if_NotEmpty();
+ AddMethodString(_methodsString, block.filters[i]);
+ }
+ }
+ }
+ }
+
+ RINOK(inStream->Seek(0, STREAM_SEEK_END, &_stat.InSize));
+ if (callback)
+ {
+ RINOK(callback->SetTotal(NULL, &_stat.InSize));
+ }
+
+ CSeekInStreamWrap inStreamImp;
+
+ inStreamImp.Init(inStream);
+
+ CLookToRead2_CPP lookStream;
+
+ lookStream.Alloc(kInputBufSize);
+
+ if (!lookStream.buf)
+ return E_OUTOFMEMORY;
+
+ lookStream.realStream = &inStreamImp.vt;
+ LookToRead2_Init(&lookStream);
+
+ COpenCallbackWrap openWrap(callback);
+
+ CXzsCPP xzs;
+ Int64 startPosition;
+ SRes res = Xzs_ReadBackward(&xzs.p, &lookStream.vt, &startPosition, &openWrap.vt, &g_Alloc);
+ if (res == SZ_ERROR_PROGRESS)
+ return (openWrap.Res == S_OK) ? E_FAIL : openWrap.Res;
+ /*
+ if (res == SZ_ERROR_NO_ARCHIVE && xzs.p.num > 0)
+ res = SZ_OK;
+ */
+ if (res == SZ_OK && startPosition == 0)
+ {
+ _phySize_Defined = true;
+
+ _stat.OutSize = Xzs_GetUnpackSize(&xzs.p);
+ _stat.UnpackSize_Defined = true;
+
+ _stat.NumStreams = xzs.p.num;
+ _stat.NumStreams_Defined = true;
+
+ _stat.NumBlocks = Xzs_GetNumBlocks(&xzs.p);
+ _stat.NumBlocks_Defined = true;
+
+ AddCheckString(_methodsString, xzs.p);
+
+ const size_t numBlocks = (size_t)_stat.NumBlocks + 1;
+ const size_t bytesAlloc = numBlocks * sizeof(CBlockInfo);
+
+ if (bytesAlloc / sizeof(CBlockInfo) == _stat.NumBlocks + 1)
+ {
+ _blocks = (CBlockInfo *)MyAlloc(bytesAlloc);
+ if (_blocks)
+ {
+ unsigned blockIndex = 0;
+ UInt64 unpackPos = 0;
+
+ for (size_t si = xzs.p.num; si != 0;)
+ {
+ si--;
+ const CXzStream &str = xzs.p.streams[si];
+ UInt64 packPos = str.startOffset + XZ_STREAM_HEADER_SIZE;
+
+ for (size_t bi = 0; bi < str.numBlocks; bi++)
+ {
+ const CXzBlockSizes &bs = str.blocks[bi];
+ const UInt64 packSizeAligned = bs.totalSize + ((0 - (unsigned)bs.totalSize) & 3);
+
+ if (bs.unpackSize != 0)
+ {
+ if (blockIndex >= _stat.NumBlocks)
+ return E_FAIL;
+
+ CBlockInfo &block = _blocks[blockIndex++];
+ block.StreamFlags = str.flags;
+ block.PackSize = bs.totalSize; // packSizeAligned;
+ block.PackPos = packPos;
+ block.UnpackPos = unpackPos;
+ }
+ packPos += packSizeAligned;
+ unpackPos += bs.unpackSize;
+ if (_maxBlocksSize < bs.unpackSize)
+ _maxBlocksSize = bs.unpackSize;
+ }
+ }
+
+ /*
+ if (blockIndex != _stat.NumBlocks)
+ {
+ // there are Empty blocks;
+ }
+ */
+ if (_stat.OutSize != unpackPos)
+ return E_FAIL;
+ CBlockInfo &block = _blocks[blockIndex++];
+ block.StreamFlags = 0;
+ block.PackSize = 0;
+ block.PackPos = 0;
+ block.UnpackPos = unpackPos;
+ _blocksArraySize = blockIndex;
+ }
+ }
+ }
+ else
+ {
+ res = SZ_OK;
+ }
+
+ RINOK(SRes_to_Open_HRESULT(res));
+ _stream = inStream;
+ _seqStream = inStream;
+ _isArc = true;
+ return S_OK;
+}
+
+
+
+STDMETHODIMP CHandler::Open(IInStream *inStream, const UInt64 *, IArchiveOpenCallback *callback)
+{
+ COM_TRY_BEGIN
+ {
+ Close();
+ return Open2(inStream, callback);
+ }
+ COM_TRY_END
+}
+
+STDMETHODIMP CHandler::OpenSeq(ISequentialInStream *stream)
+{
+ Close();
+ _seqStream = stream;
+ _isArc = true;
+ _needSeekToStart = false;
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::Close()
+{
+ XzStatInfo_Clear(&_stat);
+
+ _isArc = false;
+ _needSeekToStart = false;
+ _phySize_Defined = false;
+ _firstBlockWasRead = false;
+
+ _methodsString.Empty();
+ _stream.Release();
+ _seqStream.Release();
+
+ MyFree(_blocks);
+ _blocks = NULL;
+ _blocksArraySize = 0;
+ _maxBlocksSize = 0;
+
+ MainDecodeSRes = SZ_OK;
+
+ return S_OK;
+}
+
+
+struct CXzUnpackerCPP2
+{
+ Byte *InBuf;
+ // Byte *OutBuf;
+ CXzUnpacker p;
+
+ CXzUnpackerCPP2();
+ ~CXzUnpackerCPP2();
+};
+
+CXzUnpackerCPP2::CXzUnpackerCPP2(): InBuf(NULL)
+ // , OutBuf(NULL)
+{
+ XzUnpacker_Construct(&p, &g_Alloc);
+}
+
+CXzUnpackerCPP2::~CXzUnpackerCPP2()
+{
+ XzUnpacker_Free(&p);
+ MidFree(InBuf);
+ // MidFree(OutBuf);
+}
+
+
+class CInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+public:
+ UInt64 _virtPos;
+ UInt64 Size;
+ UInt64 _cacheStartPos;
+ size_t _cacheSize;
+ CByteBuffer _cache;
+ // UInt64 _startPos;
+ CXzUnpackerCPP2 xz;
+
+ void InitAndSeek()
+ {
+ _virtPos = 0;
+ _cacheStartPos = 0;
+ _cacheSize = 0;
+ // _startPos = startPos;
+ }
+
+ CHandler *_handlerSpec;
+ CMyComPtr<IUnknown> _handler;
+
+ MY_UNKNOWN_IMP1(IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+
+ ~CInStream();
+};
+
+
+CInStream::~CInStream()
+{
+ // _cache.Free();
+}
+
+
+size_t FindBlock(const CBlockInfo *blocks, size_t numBlocks, UInt64 pos)
+{
+ size_t left = 0, right = numBlocks;
+ for (;;)
+ {
+ size_t mid = (left + right) / 2;
+ if (mid == left)
+ return left;
+ if (pos < blocks[mid].UnpackPos)
+ right = mid;
+ else
+ left = mid;
+ }
+}
+
+
+
+static HRESULT DecodeBlock(CXzUnpackerCPP2 &xzu,
+ ISequentialInStream *seqInStream,
+ unsigned streamFlags,
+ UInt64 packSize, // pure size from Index record, it doesn't include pad zeros
+ size_t unpackSize, Byte *dest
+ // , ICompressProgressInfo *progress
+ )
+{
+ const size_t kInBufSize = (size_t)1 << 16;
+
+ XzUnpacker_Init(&xzu.p);
+
+ if (!xzu.InBuf)
+ {
+ xzu.InBuf = (Byte *)MidAlloc(kInBufSize);
+ if (!xzu.InBuf)
+ return E_OUTOFMEMORY;
+ }
+
+ xzu.p.streamFlags = (UInt16)streamFlags;
+ XzUnpacker_PrepareToRandomBlockDecoding(&xzu.p);
+
+ XzUnpacker_SetOutBuf(&xzu.p, dest, unpackSize);
+
+ const UInt64 packSizeAligned = packSize + ((0 - (unsigned)packSize) & 3);
+ UInt64 packRem = packSizeAligned;
+
+ UInt32 inSize = 0;
+ SizeT inPos = 0;
+ SizeT outPos = 0;
+
+ HRESULT readRes = S_OK;
+
+ for (;;)
+ {
+ if (inPos == inSize && readRes == S_OK)
+ {
+ inPos = 0;
+ inSize = 0;
+ UInt32 rem = kInBufSize;
+ if (rem > packRem)
+ rem = (UInt32)packRem;
+ if (rem != 0)
+ readRes = seqInStream->Read(xzu.InBuf, rem, &inSize);
+ }
+
+ SizeT inLen = inSize - inPos;
+ SizeT outLen = unpackSize - outPos;
+
+ ECoderStatus status;
+
+ SRes res = XzUnpacker_Code(&xzu.p,
+ // dest + outPos,
+ NULL,
+ &outLen,
+ xzu.InBuf + inPos, &inLen,
+ (inLen == 0), // srcFinished
+ CODER_FINISH_END, &status);
+
+ // return E_OUTOFMEMORY;
+ // res = SZ_ERROR_CRC;
+
+ if (res != SZ_OK)
+ {
+ if (res == SZ_ERROR_CRC)
+ return S_FALSE;
+ return SResToHRESULT(res);
+ }
+
+ inPos += inLen;
+ outPos += outLen;
+
+ packRem -= inLen;
+
+ Bool blockFinished = XzUnpacker_IsBlockFinished(&xzu.p);
+
+ if ((inLen == 0 && outLen == 0) || blockFinished)
+ {
+ if (packRem != 0 || !blockFinished || unpackSize != outPos)
+ return S_FALSE;
+ if (XzUnpacker_GetPackSizeForIndex(&xzu.p) != packSize)
+ return S_FALSE;
+ return S_OK;
+ }
+ }
+}
+
+
+STDMETHODIMP CInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ COM_TRY_BEGIN
+
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+
+ {
+ if (_virtPos >= Size)
+ return S_OK; // (Size == _virtPos) ? S_OK: E_FAIL;
+ {
+ UInt64 rem = Size - _virtPos;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ }
+
+ if (size == 0)
+ return S_OK;
+
+ if (_virtPos < _cacheStartPos || _virtPos >= _cacheStartPos + _cacheSize)
+ {
+ size_t bi = FindBlock(_handlerSpec->_blocks, _handlerSpec->_blocksArraySize, _virtPos);
+ const CBlockInfo &block = _handlerSpec->_blocks[bi];
+ const UInt64 unpackSize = _handlerSpec->_blocks[bi + 1].UnpackPos - block.UnpackPos;
+ if (_cache.Size() < unpackSize)
+ return E_FAIL;
+
+ _cacheSize = 0;
+
+ RINOK(_handlerSpec->SeekToPackPos(block.PackPos));
+ RINOK(DecodeBlock(xz, _handlerSpec->_seqStream, block.StreamFlags, block.PackSize,
+ (size_t)unpackSize, _cache));
+ _cacheStartPos = block.UnpackPos;
+ _cacheSize = (size_t)unpackSize;
+ }
+
+ {
+ size_t offset = (size_t)(_virtPos - _cacheStartPos);
+ size_t rem = _cacheSize - offset;
+ if (size > rem)
+ size = (UInt32)rem;
+ memcpy(data, _cache + offset, size);
+ _virtPos += size;
+ if (processedSize)
+ *processedSize = size;
+ return S_OK;
+ }
+
+ COM_TRY_END
+}
+
+
+STDMETHODIMP CInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END: offset += Size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
+
+
+
+static const UInt64 kMaxBlockSize_for_GetStream = (UInt64)1 << 40;
+
+STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
+{
+ COM_TRY_BEGIN
+
+ *stream = NULL;
+
+ if (index != 0)
+ return E_INVALIDARG;
+
+ if (!_stat.UnpackSize_Defined
+ || _maxBlocksSize == 0 // 18.02
+ || _maxBlocksSize > kMaxBlockSize_for_GetStream
+ || _maxBlocksSize != (size_t)_maxBlocksSize)
+ return S_FALSE;
+
+ UInt64 memSize;
+ if (!NSystem::GetRamSize(memSize))
+ memSize = (UInt64)(sizeof(size_t)) << 28;
+ {
+ if (_maxBlocksSize > memSize / 4)
+ return S_FALSE;
+ }
+
+ CInStream *spec = new CInStream;
+ CMyComPtr<ISequentialInStream> specStream = spec;
+ spec->_cache.Alloc((size_t)_maxBlocksSize);
+ spec->_handlerSpec = this;
+ spec->_handler = (IInArchive *)this;
+ spec->Size = _stat.OutSize;
+ spec->InitAndSeek();
+
+ *stream = specStream.Detach();
+ return S_OK;
+
+ COM_TRY_END
+}
+
+
+static Int32 Get_Extract_OperationResult(const NCompress::NXz::CDecoder &decoder)
+{
+ Int32 opRes;
+ SRes sres = decoder.MainDecodeSRes; // decoder.Stat.DecodeRes2;
+ if (sres == SZ_ERROR_NO_ARCHIVE) // (!IsArc)
+ opRes = NExtract::NOperationResult::kIsNotArc;
+ else if (sres == SZ_ERROR_INPUT_EOF) // (UnexpectedEnd)
+ opRes = NExtract::NOperationResult::kUnexpectedEnd;
+ else if (decoder.Stat.DataAfterEnd)
+ opRes = NExtract::NOperationResult::kDataAfterEnd;
+ else if (sres == SZ_ERROR_CRC) // (CrcError)
+ opRes = NExtract::NOperationResult::kCRCError;
+ else if (sres == SZ_ERROR_UNSUPPORTED) // (Unsupported)
+ opRes = NExtract::NOperationResult::kUnsupportedMethod;
+ else if (sres == SZ_ERROR_ARCHIVE) // (HeadersError)
+ opRes = NExtract::NOperationResult::kDataError;
+ else if (sres == SZ_ERROR_DATA) // (DataError)
+ opRes = NExtract::NOperationResult::kDataError;
+ else if (sres != SZ_OK)
+ opRes = NExtract::NOperationResult::kDataError;
+ else
+ opRes = NExtract::NOperationResult::kOK;
+ return opRes;
+}
+
+
+
+
+STDMETHODIMP CHandler::Extract(const UInt32 *indices, UInt32 numItems,
+ Int32 testMode, IArchiveExtractCallback *extractCallback)
+{
+ COM_TRY_BEGIN
+ if (numItems == 0)
+ return S_OK;
+ if (numItems != (UInt32)(Int32)-1 && (numItems != 1 || indices[0] != 0))
+ return E_INVALIDARG;
+
+ if (_phySize_Defined)
+ extractCallback->SetTotal(_stat.InSize);
+
+ UInt64 currentTotalPacked = 0;
+ RINOK(extractCallback->SetCompleted(&currentTotalPacked));
+ CMyComPtr<ISequentialOutStream> realOutStream;
+ Int32 askMode = testMode ?
+ NExtract::NAskMode::kTest :
+ NExtract::NAskMode::kExtract;
+
+ RINOK(extractCallback->GetStream(0, &realOutStream, askMode));
+
+ if (!testMode && !realOutStream)
+ return S_OK;
+
+ extractCallback->PrepareOperation(askMode);
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> lpsRef = lps;
+ lps->Init(extractCallback, true);
+
+ if (_needSeekToStart)
+ {
+ if (!_stream)
+ return E_FAIL;
+ RINOK(_stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+ else
+ _needSeekToStart = true;
+
+
+ NCompress::NXz::CDecoder decoder;
+
+ HRESULT hres = Decode(decoder, _seqStream, realOutStream, lpsRef);
+
+ if (!decoder.MainDecodeSRes_wasUsed)
+ return hres == S_OK ? E_FAIL : hres;
+
+ Int32 opRes = Get_Extract_OperationResult(decoder);
+ if (opRes == NExtract::NOperationResult::kOK
+ && hres != S_OK)
+ opRes = NExtract::NOperationResult::kDataError;
+
+ realOutStream.Release();
+ return extractCallback->SetOperationResult(opRes);
+ COM_TRY_END
+}
+
+
+
+#ifndef EXTRACT_ONLY
+
+STDMETHODIMP CHandler::GetFileTimeType(UInt32 *timeType)
+{
+ *timeType = NFileTimeType::kUnix;
+ return S_OK;
+}
+
+
+STDMETHODIMP CHandler::UpdateItems(ISequentialOutStream *outStream, UInt32 numItems,
+ IArchiveUpdateCallback *updateCallback)
+{
+ COM_TRY_BEGIN
+
+ if (numItems == 0)
+ {
+ CSeqOutStreamWrap seqOutStream;
+ seqOutStream.Init(outStream);
+ SRes res = Xz_EncodeEmpty(&seqOutStream.vt);
+ return SResToHRESULT(res);
+ }
+
+ if (numItems != 1)
+ return E_INVALIDARG;
+
+ Int32 newData, newProps;
+ UInt32 indexInArchive;
+ if (!updateCallback)
+ return E_FAIL;
+ RINOK(updateCallback->GetUpdateItemInfo(0, &newData, &newProps, &indexInArchive));
+
+ if (IntToBool(newProps))
+ {
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(0, kpidIsDir, &prop));
+ if (prop.vt != VT_EMPTY)
+ if (prop.vt != VT_BOOL || prop.boolVal != VARIANT_FALSE)
+ return E_INVALIDARG;
+ }
+ }
+
+ if (IntToBool(newData))
+ {
+ UInt64 size;
+ {
+ NCOM::CPropVariant prop;
+ RINOK(updateCallback->GetProperty(0, kpidSize, &prop));
+ if (prop.vt != VT_UI8)
+ return E_INVALIDARG;
+ size = prop.uhVal.QuadPart;
+ RINOK(updateCallback->SetTotal(size));
+ }
+
+ NCompress::NXz::CEncoder *encoderSpec = new NCompress::NXz::CEncoder;
+ CMyComPtr<ICompressCoder> encoder = encoderSpec;
+
+ CXzProps &xzProps = encoderSpec->xzProps;
+ CLzma2EncProps &lzma2Props = xzProps.lzma2Props;
+
+ lzma2Props.lzmaProps.level = GetLevel();
+
+ xzProps.reduceSize = size;
+ /*
+ {
+ NCOM::CPropVariant prop = (UInt64)size;
+ RINOK(encoderSpec->SetCoderProp(NCoderPropID::kReduceSize, prop));
+ }
+ */
+
+ #ifndef _7ZIP_ST
+ xzProps.numTotalThreads = _numThreads;
+ #endif
+
+ xzProps.blockSize = _numSolidBytes;
+ if (_numSolidBytes == XZ_PROPS__BLOCK_SIZE__SOLID)
+ {
+ xzProps.lzma2Props.blockSize = LZMA2_ENC_PROPS__BLOCK_SIZE__SOLID;
+ }
+
+ RINOK(encoderSpec->SetCheckSize(_crcSize));
+
+ {
+ CXzFilterProps &filter = xzProps.filterProps;
+
+ if (_filterId == XZ_ID_Delta)
+ {
+ bool deltaDefined = false;
+ FOR_VECTOR (j, _filterMethod.Props)
+ {
+ const CProp &prop = _filterMethod.Props[j];
+ if (prop.Id == NCoderPropID::kDefaultProp && prop.Value.vt == VT_UI4)
+ {
+ UInt32 delta = (UInt32)prop.Value.ulVal;
+ if (delta < 1 || delta > 256)
+ return E_INVALIDARG;
+ filter.delta = delta;
+ deltaDefined = true;
+ }
+ else
+ return E_INVALIDARG;
+ }
+ if (!deltaDefined)
+ return E_INVALIDARG;
+ }
+ filter.id = _filterId;
+ }
+
+ FOR_VECTOR (i, _methods)
+ {
+ COneMethodInfo &m = _methods[i];
+
+ FOR_VECTOR (j, m.Props)
+ {
+ const CProp &prop = m.Props[j];
+ RINOK(encoderSpec->SetCoderProp(prop.Id, prop.Value));
+ }
+ }
+
+ CMyComPtr<ISequentialInStream> fileInStream;
+ RINOK(updateCallback->GetStream(0, &fileInStream));
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(updateCallback, true);
+
+ return encoderSpec->Code(fileInStream, outStream, NULL, NULL, progress);
+ }
+
+ if (indexInArchive != 0)
+ return E_INVALIDARG;
+
+ CMyComPtr<IArchiveUpdateCallbackFile> opCallback;
+ updateCallback->QueryInterface(IID_IArchiveUpdateCallbackFile, (void **)&opCallback);
+ if (opCallback)
+ {
+ RINOK(opCallback->ReportOperation(NEventIndexType::kInArcIndex, 0, NUpdateNotifyOp::kReplicate))
+ }
+
+ if (_stream)
+ {
+ if (_phySize_Defined)
+ RINOK(updateCallback->SetTotal(_stat.InSize));
+ RINOK(_stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(updateCallback, true);
+
+ return NCompress::CopyStream(_stream, outStream, progress);
+
+ COM_TRY_END
+}
+
+#endif
+
+
+HRESULT CHandler::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &value)
+{
+ UString name = nameSpec;
+ name.MakeLower_Ascii();
+ if (name.IsEmpty())
+ return E_INVALIDARG;
+
+ #ifndef EXTRACT_ONLY
+
+ if (name[0] == L's')
+ {
+ const wchar_t *s = name.Ptr(1);
+ if (*s == 0)
+ {
+ bool useStr = false;
+ bool isSolid;
+ switch (value.vt)
+ {
+ case VT_EMPTY: isSolid = true; break;
+ case VT_BOOL: isSolid = (value.boolVal != VARIANT_FALSE); break;
+ case VT_BSTR:
+ if (!StringToBool(value.bstrVal, isSolid))
+ useStr = true;
+ break;
+ default: return E_INVALIDARG;
+ }
+ if (!useStr)
+ {
+ _numSolidBytes = (isSolid ? XZ_PROPS__BLOCK_SIZE__SOLID : XZ_PROPS__BLOCK_SIZE__AUTO);
+ return S_OK;
+ }
+ }
+ return ParseSizeString(s, value,
+ 0, // percentsBase
+ _numSolidBytes) ? S_OK: E_INVALIDARG;
+ }
+
+ return CMultiMethodProps::SetProperty(name, value);
+
+ #else
+
+ {
+ HRESULT hres;
+ if (SetCommonProperty(name, value, hres))
+ return hres;
+ }
+
+ return E_INVALIDARG;
+
+ #endif
+}
+
+
+
+STDMETHODIMP CHandler::SetProperties(const wchar_t * const *names, const PROPVARIANT *values, UInt32 numProps)
+{
+ COM_TRY_BEGIN
+
+ Init();
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ RINOK(SetProperty(names[i], values[i]));
+ }
+
+ #ifndef EXTRACT_ONLY
+
+ if (!_filterMethod.MethodName.IsEmpty())
+ {
+ unsigned k;
+ for (k = 0; k < ARRAY_SIZE(g_NamePairs); k++)
+ {
+ const CMethodNamePair &pair = g_NamePairs[k];
+ if (StringsAreEqualNoCase_Ascii(_filterMethod.MethodName, pair.Name))
+ {
+ _filterId = pair.Id;
+ break;
+ }
+ }
+ if (k == ARRAY_SIZE(g_NamePairs))
+ return E_INVALIDARG;
+ }
+
+ _methods.DeleteFrontal(GetNumEmptyMethods());
+ if (_methods.Size() > 1)
+ return E_INVALIDARG;
+ if (_methods.Size() == 1)
+ {
+ AString &methodName = _methods[0].MethodName;
+ if (methodName.IsEmpty())
+ methodName = k_LZMA2_Name;
+ else if (
+ !methodName.IsEqualTo_Ascii_NoCase(k_LZMA2_Name)
+ && !methodName.IsEqualTo_Ascii_NoCase("xz"))
+ return E_INVALIDARG;
+ }
+
+ #endif
+
+ return S_OK;
+
+ COM_TRY_END
+}
+
+
+REGISTER_ARC_IO(
+ "xz", "xz txz", "* .tar", 0xC,
+ XZ_SIG,
+ 0,
+ NArcInfoFlags::kKeepName,
+ NULL)
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.h b/other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.h
new file mode 100644
index 0000000000..18633fbc99
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Archive/XzHandler.h
@@ -0,0 +1,11 @@
+// XzHandler.h
+
+#ifndef __XZ_HANDLER_H
+#define __XZ_HANDLER_H
+
+namespace NArchive {
+namespace NXz {
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Asm.mak b/other-licenses/7zstub/src/CPP/7zip/Asm.mak
new file mode 100644
index 0000000000..3ad238a8e9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Asm.mak
@@ -0,0 +1,9 @@
+!IFDEF ASM_OBJS
+!IF "$(CPU)" == "ARM"
+$(ASM_OBJS): ../../../../Asm/Arm/$(*B).asm
+ $(COMPL_ASM)
+!ELSEIF "$(CPU)" != "IA64" && "$(CPU)" != "MIPS" && "$(CPU)" != "ARM64"
+$(ASM_OBJS): ../../../../Asm/x86/$(*B).asm
+ $(COMPL_ASM)
+!ENDIF
+!ENDIF
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsp b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsp
new file mode 100644
index 0000000000..6147e10568
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsp
@@ -0,0 +1,1901 @@
+# Microsoft Developer Studio Project File - Name="Alone" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Alone - Win32 DebugU
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Alone.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Alone.mak" CFG="Alone - Win32 DebugU"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Alone - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Alone - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE "Alone - Win32 ReleaseU" (based on "Win32 (x86) Console Application")
+!MESSAGE "Alone - Win32 DebugU" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /Gr /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /FAc /Yu"StdAfx.h" /FD /c
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\UTIL\7zr.exe" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /Gr /MDd /W3 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_MBCS" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7zr.exe" /pdbtype:sept
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseU"
+# PROP BASE Intermediate_Dir "ReleaseU"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseU"
+# PROP Intermediate_Dir "ReleaseU"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /Yu"StdAfx.h" /FD /c
+# ADD CPP /nologo /Gr /MD /W4 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /c
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\UTIL\7za.exe" /opt:NOWIN98
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"c:\UTIL\7zr.exe" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "DebugU"
+# PROP BASE Intermediate_Dir "DebugU"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "DebugU"
+# PROP Intermediate_Dir "DebugU"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
+# ADD CPP /nologo /Gr /MDd /W4 /Gm /GX /ZI /Od /I "..\..\..\\" /D "_DEBUG" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_CONSOLE" /D "_7ZIP_LARGE_PAGES" /D "SUPPORT_DEVICE_FILE" /Yu"StdAfx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7za.exe" /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"c:\UTIL\7zr.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "Alone - Win32 Release"
+# Name "Alone - Win32 Debug"
+# Name "Alone - Win32 ReleaseU"
+# Name "Alone - Win32 DebugU"
+# Begin Group "Console"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ArError.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\BenchCon.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\BenchCon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\CompressionMode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ConsoleClose.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ConsoleClose.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ExtractCallbackConsole.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ExtractCallbackConsole.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\HashCon.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\HashCon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\List.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\List.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\Main.cpp
+# ADD CPP /D "PROG_VARIANT_R"
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\MainAr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\OpenCallbackConsole.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\OpenCallbackConsole.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\PercentPrinter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\PercentPrinter.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\UpdateCallbackConsole.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\UpdateCallbackConsole.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\UserInputUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\UserInputUtils.h
+# End Source File
+# End Group
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"StdAfx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Common\AutoPtr.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Buffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\ComTry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CrcReg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Defs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\DynamicBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\ListFileUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\ListFileUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyCom.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyException.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyGuidDef.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyInitGuid.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyUnknown.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Sha256Reg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdInStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdInStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdOutStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdOutStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringToInt.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringToInt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Types.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\UTFConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\UTFConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\XzCrc64Init.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\XzCrc64Reg.cpp
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Defs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Device.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileLink.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileMapping.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileSystem.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileSystem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Handle.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\MemoryLock.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\MemoryLock.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Thread.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\TimeUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\TimeUtils.h
+# End Source File
+# End Group
+# Begin Group "7zip Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilePathAutoRename.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilePathAutoRename.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InOutTempBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InOutTempBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LockedStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LockedStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\MethodId.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\MethodId.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\MethodProps.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\MethodProps.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OffsetStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OffsetStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\PropId.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\RegisterArc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\RegisterCodec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\UniqBlocks.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\UniqBlocks.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.h
+# End Source File
+# End Group
+# Begin Group "Compress"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\ByteSwap.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\ByteSwap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\DeltaFilter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Encoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Encoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaEncoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaEncoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\XzDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\XzDecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\XzEncoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\XzEncoder.h
+# End Source File
+# End Group
+# Begin Group "Archive"
+
+# PROP Default_Filter ""
+# Begin Group "7z"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zCompressionMode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zCompressionMode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zEncode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zEncode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zExtract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zFolderInStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zFolderInStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandlerOut.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHeader.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHeader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zItem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zOut.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zOut.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zProperties.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zProperties.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zSpecStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zSpecStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zUpdate.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zUpdate.h
+# End Source File
+# End Group
+# Begin Group "Archive Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\DummyOutStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\DummyOutStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\HandlerOut.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\HandlerOut.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\InStreamWithCRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\InStreamWithCRC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\MultiStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\MultiStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ParseProperties.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ParseProperties.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\Archive\IArchive.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\LzmaHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\SplitHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\XzHandler.cpp
+# End Source File
+# End Group
+# Begin Group "UI Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveCommandLine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveCommandLine.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveExtractCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveExtractCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Bench.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Bench.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\EnumDirItems.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\EnumDirItems.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Extract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Extract.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractingFilePath.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractingFilePath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\HashCalc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\HashCalc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Property.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\PropIDUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\PropIDUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\SetProperties.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\SetProperties.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\SortUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\SortUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\TempFiles.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\TempFiles.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Update.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Update.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdateAction.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdateAction.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdateCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdateCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdatePair.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdatePair.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdateProduce.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\UpdateProduce.h
+# End Source File
+# End Group
+# Begin Group "7-zip"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\ICoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\IMyUnknown.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\IPassword.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\IProgress.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\IStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\PropID.h
+# End Source File
+# End Group
+# Begin Group "C"
+
+# PROP Default_Filter ""
+# Begin Group "Xz"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Sha256.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Sha256.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Xz.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Xz.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzCrc64.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzCrc64.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzCrc64Opt.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzDec.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzEnc.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzEnc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\XzIn.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrcOpt.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zStream.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Aes.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Aes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\AesOpt.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2Enc.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra86.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\BraIA64.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\IStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFind.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFindMt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFindMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Compress\Lz\LzHash.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzHash.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Enc.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Enc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaEnc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaEnc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtCoder.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.c
+
+!IF "$(CFG)" == "Alone - Win32 Release"
+
+# ADD CPP /O2
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 Debug"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 ReleaseU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ELSEIF "$(CFG)" == "Alone - Win32 DebugU"
+
+# SUBTRACT CPP /YX /Yc /Yu
+
+!ENDIF
+
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Types.h
+# End Source File
+# End Group
+# Begin Group "Crypto"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAesRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\MyAes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\MyAes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\RandGen.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\RandGen.h
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsw b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsw
new file mode 100644
index 0000000000..036aab454c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/Alone.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Alone"=.\Alone.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/makefile
new file mode 100644
index 0000000000..91ee1922dd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/makefile
@@ -0,0 +1,158 @@
+PROG = 7zr.exe
+MY_CONSOLE = 1
+CFLAGS = $(CFLAGS) -DPROG_VARIANT_R
+
+!IFNDEF UNDER_CE
+CFLAGS = $(CFLAGS) -DWIN_LONG_PATH -D_7ZIP_LARGE_PAGES -DSUPPORT_DEVICE_FILE
+!ENDIF
+
+COMMON_OBJS = \
+ $O\CommandLineParser.obj \
+ $O\CRC.obj \
+ $O\CrcReg.obj \
+ $O\IntToString.obj \
+ $O\ListFileUtils.obj \
+ $O\NewHandler.obj \
+ $O\StdInStream.obj \
+ $O\StdOutStream.obj \
+ $O\MyString.obj \
+ $O\Sha256Reg.obj \
+ $O\StringConvert.obj \
+ $O\StringToInt.obj \
+ $O\UTFConvert.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+ $O\XzCrc64Init.obj \
+ $O\XzCrc64Reg.obj \
+
+WIN_OBJS = \
+ $O\DLL.obj \
+ $O\ErrorMsg.obj \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileLink.obj \
+ $O\FileName.obj \
+ $O\FileSystem.obj \
+ $O\MemoryLock.obj \
+ $O\PropVariant.obj \
+ $O\PropVariantConv.obj \
+ $O\Synchronization.obj \
+ $O\System.obj \
+ $O\TimeUtils.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\CWrappers.obj \
+ $O\FilePathAutoRename.obj \
+ $O\FileStreams.obj \
+ $O\InBuffer.obj \
+ $O\InOutTempBuffer.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\MethodId.obj \
+ $O\MethodProps.obj \
+ $O\OffsetStream.obj \
+ $O\OutBuffer.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamBinder.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\UniqBlocks.obj \
+ $O\VirtThread.obj \
+
+AR_OBJS = \
+ $O\LzmaHandler.obj \
+ $O\SplitHandler.obj \
+ $O\XzHandler.obj \
+
+AR_COMMON_OBJS = \
+ $O\CoderMixer2.obj \
+ $O\DummyOutStream.obj \
+ $O\HandlerOut.obj \
+ $O\InStreamWithCRC.obj \
+ $O\ItemNameUtils.obj \
+ $O\MultiStream.obj \
+ $O\OutStreamWithCRC.obj \
+ $O\ParseProperties.obj \
+
+
+7Z_OBJS = \
+ $O\7zCompressionMode.obj \
+ $O\7zDecode.obj \
+ $O\7zEncode.obj \
+ $O\7zExtract.obj \
+ $O\7zFolderInStream.obj \
+ $O\7zHandler.obj \
+ $O\7zHandlerOut.obj \
+ $O\7zHeader.obj \
+ $O\7zIn.obj \
+ $O\7zOut.obj \
+ $O\7zProperties.obj \
+ $O\7zRegister.obj \
+ $O\7zSpecStream.obj \
+ $O\7zUpdate.obj \
+
+COMPRESS_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BranchMisc.obj \
+ $O\BranchRegister.obj \
+ $O\ByteSwap.obj \
+ $O\CopyCoder.obj \
+ $O\CopyRegister.obj \
+ $O\DeltaFilter.obj \
+ $O\Lzma2Decoder.obj \
+ $O\Lzma2Encoder.obj \
+ $O\Lzma2Register.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
+ $O\XzDecoder.obj \
+ $O\XzEncoder.obj \
+
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
+ $O\MyAesReg.obj \
+ $O\RandGen.obj \
+
+C_OBJS = \
+ $O\7zStream.obj \
+ $O\Alloc.obj \
+ $O\Bcj2.obj \
+ $O\Bcj2Enc.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\LzFind.obj \
+ $O\LzFindMt.obj \
+ $O\Lzma2Dec.obj \
+ $O\Lzma2DecMt.obj \
+ $O\Lzma2Enc.obj \
+ $O\LzmaDec.obj \
+ $O\LzmaEnc.obj \
+ $O\MtCoder.obj \
+ $O\MtDec.obj \
+ $O\Sha256.obj \
+ $O\Sort.obj \
+ $O\Threads.obj \
+ $O\Xz.obj \
+ $O\XzDec.obj \
+ $O\XzEnc.obj \
+ $O\XzIn.obj \
+
+!include "../../UI/Console/Console.mak"
+
+!include "../../Aes.mak"
+!include "../../Crc.mak"
+!include "../../Crc64.mak"
+!include "../../LzmaDec.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/resource.rc
new file mode 100644
index 0000000000..36d70e7d9c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Alone7z/resource.rc
@@ -0,0 +1,7 @@
+#include "../../../../C/7zVersion.rc"
+
+MY_VERSION_INFO_APP("7-Zip Reduced Standalone Console", "7zr")
+
+#ifndef UNDER_CE
+1 24 MOVEABLE PURE "../../UI/Console/Console.manifest"
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/makefile
new file mode 100644
index 0000000000..3a7f981699
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/makefile
@@ -0,0 +1,96 @@
+PROG = 7zxr.dll
+DEF_FILE = ../../Archive/Archive2.def
+CFLAGS = $(CFLAGS) \
+ -DEXTRACT_ONLY \
+ -D_NO_CRYPTO
+
+COMMON_OBJS = \
+ $O\CRC.obj \
+ $O\CrcReg.obj \
+ $O\IntToString.obj \
+ $O\NewHandler.obj \
+ $O\MyString.obj \
+ $O\StringConvert.obj \
+ $O\StringToInt.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+
+WIN_OBJS = \
+ $O\PropVariant.obj \
+ $O\Synchronization.obj \
+ $O\System.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\CWrappers.obj \
+ $O\InBuffer.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\MethodId.obj \
+ $O\MethodProps.obj \
+ $O\OutBuffer.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamBinder.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\VirtThread.obj \
+
+AR_OBJS = \
+ $O\ArchiveExports.obj \
+ $O\DllExports2.obj \
+
+AR_COMMON_OBJS = \
+ $O\CoderMixer2.obj \
+ $O\HandlerOut.obj \
+ $O\ItemNameUtils.obj \
+ $O\OutStreamWithCRC.obj \
+ $O\ParseProperties.obj \
+
+
+7Z_OBJS = \
+ $O\7zCompressionMode.obj \
+ $O\7zDecode.obj \
+ $O\7zExtract.obj \
+ $O\7zHandler.obj \
+ $O\7zHeader.obj \
+ $O\7zIn.obj \
+ $O\7zProperties.obj \
+ $O\7zRegister.obj \
+
+
+COMPRESS_OBJS = \
+ $O\CodecExports.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BranchMisc.obj \
+ $O\BranchRegister.obj \
+ $O\ByteSwap.obj \
+ $O\CopyCoder.obj \
+ $O\CopyRegister.obj \
+ $O\DeltaFilter.obj \
+ $O\Lzma2Decoder.obj \
+ $O\Lzma2Register.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\Lzma2Dec.obj \
+ $O\Lzma2DecMt.obj \
+ $O\LzmaDec.obj \
+ $O\MtDec.obj \
+ $O\Threads.obj \
+
+!include "../../Crc.mak"
+!include "../../LzmaDec.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/resource.rc
new file mode 100644
index 0000000000..dac02a6766
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zExtractR/resource.rc
@@ -0,0 +1,5 @@
+#include "../../../../C/7zVersion.rc"
+
+MY_VERSION_INFO_DLL("7z Extracting Reduced Standalone Plugin", "7zxr")
+
+101 ICON "../../Archive/Icons/7z.ico"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/makefile
new file mode 100644
index 0000000000..6a9dfb9199
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/makefile
@@ -0,0 +1,116 @@
+PROG = 7zra.dll
+DEF_FILE = ../../Archive/Archive2.def
+CFLAGS = $(CFLAGS) \
+ -D_NO_CRYPTO
+
+COMMON_OBJS = \
+ $O\CRC.obj \
+ $O\CrcReg.obj \
+ $O\IntToString.obj \
+ $O\NewHandler.obj \
+ $O\MyString.obj \
+ $O\StringConvert.obj \
+ $O\StringToInt.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+
+WIN_OBJS = \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileName.obj \
+ $O\PropVariant.obj \
+ $O\Synchronization.obj \
+ $O\System.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\CWrappers.obj \
+ $O\InBuffer.obj \
+ $O\InOutTempBuffer.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\MethodId.obj \
+ $O\MethodProps.obj \
+ $O\OutBuffer.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamBinder.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\UniqBlocks.obj \
+ $O\VirtThread.obj \
+
+AR_OBJS = \
+ $O\ArchiveExports.obj \
+ $O\DllExports2.obj \
+
+AR_COMMON_OBJS = \
+ $O\CoderMixer2.obj \
+ $O\HandlerOut.obj \
+ $O\InStreamWithCRC.obj \
+ $O\ItemNameUtils.obj \
+ $O\OutStreamWithCRC.obj \
+ $O\ParseProperties.obj \
+
+
+7Z_OBJS = \
+ $O\7zCompressionMode.obj \
+ $O\7zDecode.obj \
+ $O\7zEncode.obj \
+ $O\7zExtract.obj \
+ $O\7zFolderInStream.obj \
+ $O\7zHandler.obj \
+ $O\7zHandlerOut.obj \
+ $O\7zHeader.obj \
+ $O\7zIn.obj \
+ $O\7zOut.obj \
+ $O\7zProperties.obj \
+ $O\7zSpecStream.obj \
+ $O\7zUpdate.obj \
+ $O\7zRegister.obj \
+
+
+COMPRESS_OBJS = \
+ $O\CodecExports.obj \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BranchMisc.obj \
+ $O\BranchRegister.obj \
+ $O\ByteSwap.obj \
+ $O\CopyCoder.obj \
+ $O\CopyRegister.obj \
+ $O\DeltaFilter.obj \
+ $O\Lzma2Decoder.obj \
+ $O\Lzma2Encoder.obj \
+ $O\Lzma2Register.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\Bcj2.obj \
+ $O\Bcj2Enc.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\LzFind.obj \
+ $O\LzFindMt.obj \
+ $O\Lzma2Dec.obj \
+ $O\Lzma2DecMt.obj \
+ $O\Lzma2Enc.obj \
+ $O\LzmaDec.obj \
+ $O\LzmaEnc.obj \
+ $O\MtCoder.obj \
+ $O\MtDec.obj \
+ $O\Threads.obj \
+
+!include "../../Crc.mak"
+!include "../../LzmaDec.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/resource.rc
new file mode 100644
index 0000000000..262125c122
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/Format7zR/resource.rc
@@ -0,0 +1,5 @@
+#include "../../../../C/7zVersion.rc"
+
+MY_VERSION_INFO_DLL("7z Reduced Standalone Plugin", "7zr")
+
+101 ICON "../../Archive/Icons/7z.ico"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp
new file mode 100644
index 0000000000..f27333741f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaAlone.cpp
@@ -0,0 +1,799 @@
+// LzmaAlone.cpp
+
+#include "StdAfx.h"
+
+#include <stdio.h>
+
+#include "../../../../C/CpuArch.h"
+
+#if (defined(_WIN32) || defined(OS2) || defined(MSDOS)) && !defined(UNDER_CE)
+#include <fcntl.h>
+#include <io.h>
+#define MY_SET_BINARY_MODE(file) _setmode(_fileno(file), O_BINARY)
+#else
+#define MY_SET_BINARY_MODE(file)
+#endif
+
+#include "../../../Common/MyWindows.h"
+#include "../../../Common/MyInitGuid.h"
+
+#include "../../../../C/7zVersion.h"
+#include "../../../../C/Alloc.h"
+#include "../../../../C/Lzma86.h"
+
+#include "../../../Windows/NtCheck.h"
+
+#ifndef _7ZIP_ST
+#include "../../../Windows/System.h"
+#endif
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/CommandLineParser.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/StringToInt.h"
+
+#include "../../Common/FileStreams.h"
+#include "../../Common/StreamUtils.h"
+
+#include "../../Compress/LzmaDecoder.h"
+#include "../../Compress/LzmaEncoder.h"
+
+#include "../../UI/Console/BenchCon.h"
+#include "../../UI/Console/ConsoleClose.h"
+
+bool g_LargePagesMode = false;
+
+using namespace NCommandLineParser;
+
+static const unsigned kDictSizeLog = 24;
+
+#define kCopyrightString "\nLZMA " MY_VERSION_CPU " : " MY_COPYRIGHT_DATE "\n\n"
+
+static const char * const kHelpString =
+ "Usage: lzma <command> [inputFile] [outputFile] [<switches>...]\n"
+ "\n"
+ "<command>\n"
+ " e : Encode file\n"
+ " d : Decode file\n"
+ " b : Benchmark\n"
+ "<switches>\n"
+ " -a{N} : set compression mode : [0, 1] : default = 1 (max)\n"
+ " -d{N} : set dictionary size : [12, 30] : default = 24 (16 MiB)\n"
+ " -fb{N} : set number of fast bytes : [5, 273] : default = 128\n"
+ " -mc{N} : set number of cycles for match finder\n"
+ " -lc{N} : set number of literal context bits : [0, 8] : default = 3\n"
+ " -lp{N} : set number of literal pos bits : [0, 4] : default = 0\n"
+ " -pb{N} : set number of pos bits : [0, 4] : default = 2\n"
+ " -mf{M} : set match finder: [hc4, bt2, bt3, bt4] : default = bt4\n"
+ " -mt{N} : set number of CPU threads\n"
+ " -eos : write end of stream marker\n"
+ " -si : read data from stdin\n"
+ " -so : write data to stdout\n";
+
+
+static const char * const kCantAllocate = "Can not allocate memory";
+static const char * const kReadError = "Read error";
+static const char * const kWriteError = "Write error";
+
+
+namespace NKey {
+enum Enum
+{
+ kHelp1 = 0,
+ kHelp2,
+ kMethod,
+ kLevel,
+ kAlgo,
+ kDict,
+ kFb,
+ kMc,
+ kLc,
+ kLp,
+ kPb,
+ kMatchFinder,
+ kMultiThread,
+ kEOS,
+ kStdIn,
+ kStdOut,
+ kFilter86
+};
+}
+
+static const CSwitchForm kSwitchForms[] =
+{
+ { "?", NSwitchType::kSimple, false },
+ { "H", NSwitchType::kSimple, false },
+ { "MM", NSwitchType::kString, false, 1 },
+ { "X", NSwitchType::kString, false, 1 },
+ { "A", NSwitchType::kString, false, 1 },
+ { "D", NSwitchType::kString, false, 1 },
+ { "FB", NSwitchType::kString, false, 1 },
+ { "MC", NSwitchType::kString, false, 1 },
+ { "LC", NSwitchType::kString, false, 1 },
+ { "LP", NSwitchType::kString, false, 1 },
+ { "PB", NSwitchType::kString, false, 1 },
+ { "MF", NSwitchType::kString, false, 1 },
+ { "MT", NSwitchType::kString, false, 0 },
+ { "EOS", NSwitchType::kSimple, false },
+ { "SI", NSwitchType::kSimple, false },
+ { "SO", NSwitchType::kSimple, false },
+ { "F86", NSwitchType::kChar, false, 0, "+" }
+};
+
+
+static void Convert_UString_to_AString(const UString &s, AString &temp)
+{
+ int codePage = CP_OEMCP;
+ /*
+ int g_CodePage = -1;
+ int codePage = g_CodePage;
+ if (codePage == -1)
+ codePage = CP_OEMCP;
+ if (codePage == CP_UTF8)
+ ConvertUnicodeToUTF8(s, temp);
+ else
+ */
+ UnicodeStringToMultiByte2(temp, s, (UINT)codePage);
+}
+
+static void PrintErr(const char *s)
+{
+ fputs(s, stderr);
+}
+
+static void PrintErr_LF(const char *s)
+{
+ PrintErr(s);
+ fputc('\n', stderr);
+}
+
+
+static void PrintError(const char *s)
+{
+ PrintErr("\nERROR: ");
+ PrintErr_LF(s);
+}
+
+static void PrintError2(const char *s1, const UString &s2)
+{
+ PrintError(s1);
+ AString a;
+ Convert_UString_to_AString(s2, a);
+ PrintErr_LF(a);
+}
+
+static void PrintError_int(const char *s, int code)
+{
+ PrintError(s);
+ char temp[32];
+ ConvertInt64ToString(code, temp);
+ PrintErr("Error code = ");
+ PrintErr_LF(temp);
+}
+
+
+
+static void Print(const char *s)
+{
+ fputs(s, stdout);
+}
+
+static void Print_UInt64(UInt64 v)
+{
+ char temp[32];
+ ConvertUInt64ToString(v, temp);
+ Print(temp);
+}
+
+static void Print_MB(UInt64 v)
+{
+ Print_UInt64(v);
+ Print(" MiB");
+}
+
+static void Print_Size(const char *s, UInt64 v)
+{
+ Print(s);
+ Print_UInt64(v);
+ Print(" (");
+ Print_MB(v >> 20);
+ Print(")\n");
+}
+
+static void PrintTitle()
+{
+ Print(kCopyrightString);
+}
+
+static void PrintHelp()
+{
+ PrintTitle();
+ Print(kHelpString);
+}
+
+class CProgressPrint:
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+ UInt64 _size1;
+ UInt64 _size2;
+public:
+ CProgressPrint(): _size1(0), _size2(0) {}
+
+ void ClosePrint();
+
+ MY_UNKNOWN_IMP1(ICompressProgressInfo)
+
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+};
+
+#define BACK_STR \
+"\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b"
+static const char * const kBackSpaces =
+BACK_STR
+" "
+BACK_STR;
+
+
+void CProgressPrint::ClosePrint()
+{
+ Print(kBackSpaces);
+}
+
+STDMETHODIMP CProgressPrint::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ if (NConsoleClose::TestBreakSignal())
+ return E_ABORT;
+ if (inSize)
+ {
+ UInt64 v1 = *inSize >> 20;
+ UInt64 v2 = _size2;
+ if (outSize)
+ v2 = *outSize >> 20;
+ if (v1 != _size1 || v2 != _size2)
+ {
+ _size1 = v1;
+ _size2 = v2;
+ ClosePrint();
+ Print_MB(_size1);
+ Print(" -> ");
+ Print_MB(_size2);
+ }
+ }
+ return S_OK;
+}
+
+
+static void IncorrectCommand()
+{
+ throw "Incorrect command";
+}
+
+static UInt32 GetNumber(const wchar_t *s)
+{
+ const wchar_t *end;
+ UInt32 v = ConvertStringToUInt32(s, &end);
+ if (*end != 0)
+ IncorrectCommand();
+ return v;
+}
+
+static void ParseUInt32(const CParser &parser, unsigned index, UInt32 &res)
+{
+ if (parser[index].ThereIs)
+ res = GetNumber(parser[index].PostStrings[0]);
+}
+
+
+static int Error_HRESULT(const char *s, HRESULT res)
+{
+ if (res == E_ABORT)
+ {
+ Print("\n\nBreak signaled\n");
+ return 255;
+ }
+
+ PrintError(s);
+
+ if (res == E_OUTOFMEMORY)
+ {
+ PrintErr_LF(kCantAllocate);
+ return 8;
+ }
+ if (res == E_INVALIDARG)
+ {
+ PrintErr_LF("Ununsupported parameter");
+ }
+ else
+ {
+ char temp[32];
+ ConvertUInt32ToHex(res, temp);
+ PrintErr("Error code = 0x");
+ PrintErr_LF(temp);
+ }
+ return 1;
+}
+
+#define NT_CHECK_FAIL_ACTION PrintError("Unsupported Windows version"); return 1;
+
+static void AddProp(CObjectVector<CProperty> &props2, const char *name, const wchar_t *val)
+{
+ CProperty &prop = props2.AddNew();
+ prop.Name = name;
+ prop.Value = val;
+}
+
+static int main2(int numArgs, const char *args[])
+{
+ NT_CHECK
+
+ if (numArgs == 1)
+ {
+ PrintHelp();
+ return 0;
+ }
+
+ /*
+ bool unsupportedTypes = (sizeof(Byte) != 1 || sizeof(UInt32) < 4 || sizeof(UInt64) < 8);
+ if (unsupportedTypes)
+ throw "Unsupported base types. Edit Common/Types.h and recompile";
+ */
+
+ UStringVector commandStrings;
+ for (int i = 1; i < numArgs; i++)
+ commandStrings.Add(MultiByteToUnicodeString(args[i]));
+
+ CParser parser;
+ try
+ {
+ if (!parser.ParseStrings(kSwitchForms, ARRAY_SIZE(kSwitchForms), commandStrings))
+ {
+ PrintError2(parser.ErrorMessage, parser.ErrorLine);
+ return 1;
+ }
+ }
+ catch(...)
+ {
+ IncorrectCommand();
+ }
+
+ if (parser[NKey::kHelp1].ThereIs || parser[NKey::kHelp2].ThereIs)
+ {
+ PrintHelp();
+ return 0;
+ }
+
+ bool stdInMode = parser[NKey::kStdIn].ThereIs;
+ bool stdOutMode = parser[NKey::kStdOut].ThereIs;
+
+ if (!stdOutMode)
+ PrintTitle();
+
+ const UStringVector &params = parser.NonSwitchStrings;
+
+ unsigned paramIndex = 0;
+ if (paramIndex >= params.Size())
+ IncorrectCommand();
+ const UString &command = params[paramIndex++];
+
+ CObjectVector<CProperty> props2;
+ bool dictDefined = false;
+ UInt32 dict = (UInt32)(Int32)-1;
+
+ if (parser[NKey::kDict].ThereIs)
+ {
+ UInt32 dictLog;
+ const UString &s = parser[NKey::kDict].PostStrings[0];
+ dictLog = GetNumber(s);
+ dict = 1 << dictLog;
+ dictDefined = true;
+ AddProp(props2, "d", s);
+ }
+
+ if (parser[NKey::kLevel].ThereIs)
+ {
+ const UString &s = parser[NKey::kLevel].PostStrings[0];
+ /* UInt32 level = */ GetNumber(s);
+ AddProp(props2, "x", s);
+ }
+
+ UString mf ("BT4");
+ if (parser[NKey::kMatchFinder].ThereIs)
+ mf = parser[NKey::kMatchFinder].PostStrings[0];
+
+ UInt32 numThreads = (UInt32)(Int32)-1;
+
+ #ifndef _7ZIP_ST
+
+ if (parser[NKey::kMultiThread].ThereIs)
+ {
+ const UString &s = parser[NKey::kMultiThread].PostStrings[0];
+ if (s.IsEmpty())
+ numThreads = NWindows::NSystem::GetNumberOfProcessors();
+ else
+ numThreads = GetNumber(s);
+ AddProp(props2, "mt", s);
+ }
+
+ #endif
+
+
+ if (parser[NKey::kMethod].ThereIs)
+ {
+ const UString &s = parser[NKey::kMethod].PostStrings[0];
+ if (s.IsEmpty() || s[0] != '=')
+ IncorrectCommand();
+ AddProp(props2, "m", s.Ptr(1));
+ }
+
+ if (StringsAreEqualNoCase_Ascii(command, "b"))
+ {
+ UInt32 numIterations = 1;
+ if (paramIndex < params.Size())
+ numIterations = GetNumber(params[paramIndex++]);
+ if (params.Size() != paramIndex)
+ IncorrectCommand();
+
+ HRESULT res = BenchCon(props2, numIterations, stdout);
+
+ if (res == S_OK)
+ return 0;
+ return Error_HRESULT("Benchmark error", res);
+ }
+
+ {
+ UInt32 needParams = 3;
+ if (stdInMode) needParams--;
+ if (stdOutMode) needParams--;
+ if (needParams != params.Size())
+ IncorrectCommand();
+ }
+
+ if (numThreads == (UInt32)(Int32)-1)
+ numThreads = 1;
+
+ bool encodeMode = false;
+
+ if (StringsAreEqualNoCase_Ascii(command, "e"))
+ encodeMode = true;
+ else if (!StringsAreEqualNoCase_Ascii(command, "d"))
+ IncorrectCommand();
+
+ CMyComPtr<ISequentialInStream> inStream;
+ CInFileStream *inStreamSpec = NULL;
+
+ if (stdInMode)
+ {
+ inStream = new CStdInFileStream;
+ MY_SET_BINARY_MODE(stdin);
+ }
+ else
+ {
+ const UString &inputName = params[paramIndex++];
+ inStreamSpec = new CInFileStream;
+ inStream = inStreamSpec;
+ if (!inStreamSpec->Open(us2fs(inputName)))
+ {
+ PrintError2("can not open input file", inputName);
+ return 1;
+ }
+ }
+
+ CMyComPtr<ISequentialOutStream> outStream;
+ COutFileStream *outStreamSpec = NULL;
+
+ if (stdOutMode)
+ {
+ outStream = new CStdOutFileStream;
+ MY_SET_BINARY_MODE(stdout);
+ }
+ else
+ {
+ const UString &outputName = params[paramIndex++];
+ outStreamSpec = new COutFileStream;
+ outStream = outStreamSpec;
+ if (!outStreamSpec->Create(us2fs(outputName), true))
+ {
+ PrintError2("can not open output file", outputName);
+ return 1;
+ }
+ }
+
+ bool fileSizeDefined = false;
+ UInt64 fileSize = 0;
+
+ if (inStreamSpec)
+ {
+ if (!inStreamSpec->File.GetLength(fileSize))
+ throw "Can not get file length";
+ fileSizeDefined = true;
+ if (!stdOutMode)
+ Print_Size("Input size: ", fileSize);
+ }
+
+ if (encodeMode && !dictDefined)
+ {
+ dict = 1 << kDictSizeLog;
+ if (fileSizeDefined)
+ {
+ unsigned i;
+ for (i = 16; i < kDictSizeLog; i++)
+ if ((UInt32)((UInt32)1 << i) >= fileSize)
+ break;
+ dict = (UInt32)1 << i;
+ }
+ }
+
+ if (parser[NKey::kFilter86].ThereIs)
+ {
+ /* -f86 switch is for x86 filtered mode: BCJ + LZMA.
+ It uses modified header format.
+ It's not recommended to use -f86 mode now.
+ You can use xz format instead, if you want to use filters */
+
+ if (parser[NKey::kEOS].ThereIs || stdInMode)
+ throw "Can not use stdin in this mode";
+
+ size_t inSize = (size_t)fileSize;
+
+ if (inSize != fileSize)
+ throw "File is too big";
+
+ Byte *inBuffer = NULL;
+
+ if (inSize != 0)
+ {
+ inBuffer = (Byte *)MyAlloc((size_t)inSize);
+ if (!inBuffer)
+ throw kCantAllocate;
+ }
+
+ if (ReadStream_FAIL(inStream, inBuffer, inSize) != S_OK)
+ throw "Can not read";
+
+ Byte *outBuffer = NULL;
+ size_t outSize;
+
+ if (encodeMode)
+ {
+ // we allocate 105% of original size for output buffer
+ UInt64 outSize64 = fileSize / 20 * 21 + (1 << 16);
+
+ outSize = (size_t)outSize64;
+
+ if (outSize != outSize64)
+ throw "File is too big";
+
+ if (outSize != 0)
+ {
+ outBuffer = (Byte *)MyAlloc((size_t)outSize);
+ if (!outBuffer)
+ throw kCantAllocate;
+ }
+
+ int res = Lzma86_Encode(outBuffer, &outSize, inBuffer, inSize,
+ 5, dict, parser[NKey::kFilter86].PostCharIndex == 0 ? SZ_FILTER_YES : SZ_FILTER_AUTO);
+
+ if (res != 0)
+ {
+ PrintError_int("Encode error", (int)res);
+ return 1;
+ }
+ }
+ else
+ {
+ UInt64 outSize64;
+
+ if (Lzma86_GetUnpackSize(inBuffer, inSize, &outSize64) != 0)
+ throw "data error";
+
+ outSize = (size_t)outSize64;
+ if (outSize != outSize64)
+ throw "Unpack size is too big";
+ if (outSize != 0)
+ {
+ outBuffer = (Byte *)MyAlloc(outSize);
+ if (!outBuffer)
+ throw kCantAllocate;
+ }
+
+ int res = Lzma86_Decode(outBuffer, &outSize, inBuffer, &inSize);
+
+ if (inSize != (size_t)fileSize)
+ throw "incorrect processed size";
+ if (res != 0)
+ {
+ PrintError_int("Decode error", (int)res);
+ return 1;
+ }
+ }
+
+ if (WriteStream(outStream, outBuffer, outSize) != S_OK)
+ throw kWriteError;
+
+ MyFree(outBuffer);
+ MyFree(inBuffer);
+ }
+ else
+ {
+
+ CProgressPrint *progressSpec = NULL;
+ CMyComPtr<ICompressProgressInfo> progress;
+
+ if (!stdOutMode)
+ {
+ progressSpec = new CProgressPrint;
+ progress = progressSpec;
+ }
+
+ if (encodeMode)
+ {
+ NCompress::NLzma::CEncoder *encoderSpec = new NCompress::NLzma::CEncoder;
+ CMyComPtr<ICompressCoder> encoder = encoderSpec;
+
+ UInt32 pb = 2;
+ UInt32 lc = 3; // = 0; for 32-bit data
+ UInt32 lp = 0; // = 2; for 32-bit data
+ UInt32 algo = 1;
+ UInt32 fb = 128;
+ UInt32 mc = 16 + fb / 2;
+ bool mcDefined = false;
+
+ bool eos = parser[NKey::kEOS].ThereIs || stdInMode;
+
+ ParseUInt32(parser, NKey::kAlgo, algo);
+ ParseUInt32(parser, NKey::kFb, fb);
+ ParseUInt32(parser, NKey::kLc, lc);
+ ParseUInt32(parser, NKey::kLp, lp);
+ ParseUInt32(parser, NKey::kPb, pb);
+
+ mcDefined = parser[NKey::kMc].ThereIs;
+ if (mcDefined)
+ mc = GetNumber(parser[NKey::kMc].PostStrings[0]);
+
+ const PROPID propIDs[] =
+ {
+ NCoderPropID::kDictionarySize,
+ NCoderPropID::kPosStateBits,
+ NCoderPropID::kLitContextBits,
+ NCoderPropID::kLitPosBits,
+ NCoderPropID::kAlgorithm,
+ NCoderPropID::kNumFastBytes,
+ NCoderPropID::kMatchFinder,
+ NCoderPropID::kEndMarker,
+ NCoderPropID::kNumThreads,
+ NCoderPropID::kMatchFinderCycles,
+ };
+
+ const unsigned kNumPropsMax = ARRAY_SIZE(propIDs);
+
+ PROPVARIANT props[kNumPropsMax];
+ for (int p = 0; p < 6; p++)
+ props[p].vt = VT_UI4;
+
+ props[0].ulVal = (UInt32)dict;
+ props[1].ulVal = (UInt32)pb;
+ props[2].ulVal = (UInt32)lc;
+ props[3].ulVal = (UInt32)lp;
+ props[4].ulVal = (UInt32)algo;
+ props[5].ulVal = (UInt32)fb;
+
+ props[6].vt = VT_BSTR;
+ props[6].bstrVal = const_cast<BSTR>((const wchar_t *)mf);
+
+ props[7].vt = VT_BOOL;
+ props[7].boolVal = eos ? VARIANT_TRUE : VARIANT_FALSE;
+
+ props[8].vt = VT_UI4;
+ props[8].ulVal = (UInt32)numThreads;
+
+ // it must be last in property list
+ props[9].vt = VT_UI4;
+ props[9].ulVal = (UInt32)mc;
+
+ unsigned numProps = kNumPropsMax;
+ if (!mcDefined)
+ numProps--;
+
+ HRESULT res = encoderSpec->SetCoderProperties(propIDs, props, numProps);
+ if (res != S_OK)
+ return Error_HRESULT("incorrect encoder properties", res);
+
+ if (encoderSpec->WriteCoderProperties(outStream) != S_OK)
+ throw kWriteError;
+
+ bool fileSizeWasUsed = true;
+ if (eos || stdInMode)
+ {
+ fileSize = (UInt64)(Int64)-1;
+ fileSizeWasUsed = false;
+ }
+
+ {
+ Byte temp[8];
+ for (int i = 0; i < 8; i++)
+ temp[i]= (Byte)(fileSize >> (8 * i));
+ if (WriteStream(outStream, temp, 8) != S_OK)
+ throw kWriteError;
+ }
+
+ res = encoder->Code(inStream, outStream, NULL, NULL, progress);
+ if (progressSpec)
+ progressSpec->ClosePrint();
+
+ if (res != S_OK)
+ return Error_HRESULT("Encoding error", res);
+
+ UInt64 processedSize = encoderSpec->GetInputProcessedSize();
+
+ if (fileSizeWasUsed && processedSize != fileSize)
+ throw "Incorrect size of processed data";
+ }
+ else
+ {
+ NCompress::NLzma::CDecoder *decoderSpec = new NCompress::NLzma::CDecoder;
+ CMyComPtr<ICompressCoder> decoder = decoderSpec;
+
+ decoderSpec->FinishStream = true;
+
+ const unsigned kPropertiesSize = 5;
+ Byte header[kPropertiesSize + 8];
+
+ if (ReadStream_FALSE(inStream, header, kPropertiesSize + 8) != S_OK)
+ throw kReadError;
+
+ if (decoderSpec->SetDecoderProperties2(header, kPropertiesSize) != S_OK)
+ throw "SetDecoderProperties error";
+
+ UInt64 unpackSize = 0;
+ for (int i = 0; i < 8; i++)
+ unpackSize |= ((UInt64)header[kPropertiesSize + i]) << (8 * i);
+
+ bool unpackSizeDefined = (unpackSize != (UInt64)(Int64)-1);
+
+ HRESULT res = decoder->Code(inStream, outStream, NULL, unpackSizeDefined ? &unpackSize : NULL, progress);
+ if (progressSpec)
+ progressSpec->ClosePrint();
+
+ if (res != S_OK)
+ {
+ if (res == S_FALSE)
+ {
+ PrintError("Decoding error");
+ return 1;
+ }
+ return Error_HRESULT("Decoding error", res);
+ }
+
+ if (unpackSizeDefined && unpackSize != decoderSpec->GetOutputProcessedSize())
+ throw "incorrect uncompressed size in header";
+ }
+ }
+
+ if (outStreamSpec)
+ {
+ if (!stdOutMode)
+ Print_Size("Output size: ", outStreamSpec->ProcessedSize);
+ if (outStreamSpec->Close() != S_OK)
+ throw "File closing error";
+ }
+
+ return 0;
+}
+
+int MY_CDECL main(int numArgs, const char *args[])
+{
+ NConsoleClose::CCtrlHandlerSetter ctrlHandlerSetter;
+
+ try { return main2(numArgs, args); }
+ catch (const char *s)
+ {
+ PrintError(s);
+ return 1;
+ }
+ catch(...)
+ {
+ PrintError("Unknown Error");
+ return 1;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp
new file mode 100644
index 0000000000..bdc0c3e395
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsp
@@ -0,0 +1,477 @@
+# Microsoft Developer Studio Project File - Name="LzmaCon" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=LzmaCon - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "LzmaCon.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "LzmaCon.mak" CFG="LzmaCon - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "LzmaCon - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "LzmaCon - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "LzmaCon - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /Gr /MD /W4 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"StdAfx.h" /FD /c
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"C:\Util\lzma.exe"
+
+!ELSEIF "$(CFG)" == "LzmaCon - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W4 /WX /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"StdAfx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"C:\Util\lzma.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "LzmaCon - Win32 Release"
+# Name "LzmaCon - Win32 Debug"
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"StdAfx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Compress"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaEncoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaEncoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaRegister.cpp
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Thread.h
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\ComTry.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CrcReg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Defs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyCom.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyUnknown.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyWindows.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyWindows.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringToInt.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringToInt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Types.h
+# End Source File
+# End Group
+# Begin Group "7zip Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\MethodProps.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\MethodProps.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.h
+# End Source File
+# End Group
+# Begin Group "UI Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Bench.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Bench.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.h
+# End Source File
+# End Group
+# Begin Group "Console"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Console\BenchCon.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\BenchCon.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ConsoleClose.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ConsoleClose.h
+# End Source File
+# End Group
+# Begin Group "C"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrcOpt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zTypes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra86.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\BraIA64.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFind.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFindMt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzFindMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzHash.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma86.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma86Dec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma86Enc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaEnc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaEnc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\LzmaAlone.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw
new file mode 100644
index 0000000000..c6a6662760
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/LzmaCon.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "LzmaCon"=.\LzmaCon.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile
new file mode 100644
index 0000000000..260976304e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile
@@ -0,0 +1,59 @@
+PROG = lzma.exe
+MY_CONSOLE = 1
+CFLAGS = $(CFLAGS)
+
+CURRENT_OBJS = \
+ $O\LzmaAlone.obj \
+
+COMPRESS_OBJS = \
+ $O\LzmaDecoder.obj \
+ $O\LzmaEncoder.obj \
+ $O\LzmaRegister.obj \
+
+COMMON_OBJS = \
+ $O\CommandLineParser.obj \
+ $O\CRC.obj \
+ $O\CrcReg.obj \
+ $O\IntToString.obj \
+ $O\MyString.obj \
+ $O\NewHandler.obj \
+ $O\StringConvert.obj \
+ $O\StringToInt.obj \
+ $O\MyVector.obj
+
+WIN_OBJS = \
+ $O\FileIO.obj \
+ $O\PropVariant.obj \
+ $O\System.obj
+
+7ZIP_COMMON_OBJS = \
+ $O\CWrappers.obj \
+ $O\CreateCoder.obj \
+ $O\FileStreams.obj \
+ $O\FilterCoder.obj \
+ $O\MethodProps.obj \
+ $O\OutBuffer.obj \
+ $O\StreamUtils.obj \
+
+UI_COMMON_OBJS = \
+ $O\Bench.obj \
+
+CONSOLE_OBJS = \
+ $O\ConsoleClose.obj \
+ $O\BenchCon.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\Bra86.obj \
+ $O\CpuArch.obj \
+ $O\LzFind.obj \
+ $O\LzFindMt.obj \
+ $O\Lzma86Dec.obj \
+ $O\Lzma86Enc.obj \
+ $O\LzmaDec.obj \
+ $O\LzmaEnc.obj \
+ $O\Threads.obj \
+
+!include "../../Crc.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile.gcc b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile.gcc
new file mode 100644
index 0000000000..3fb5ec2081
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/makefile.gcc
@@ -0,0 +1,195 @@
+PROG = lzma
+CXX = g++ -O2
+# -Wall -Werror -Wno-delete-non-virtual-dtor
+CXX_C = gcc -O2 -Wall -Werror
+
+ifdef SystemDrive
+IS_MINGW = 1
+endif
+
+ifdef IS_MINGW
+
+RM = del
+CFLAGS = -c
+LIB2 = -loleaut32 -luuid
+LDFLAGS = -s
+
+FILE_IO =FileIO
+FILE_IO_2 =Windows/$(FILE_IO)
+
+MT_FILES = \
+ LzFindMt.o \
+ Threads.o \
+
+else
+
+RM = rm -f
+CFLAGS = -c -D_7ZIP_ST
+
+FILE_IO =C_FileIO
+FILE_IO_2 =Common/$(FILE_IO)
+
+
+endif
+
+
+OBJS = \
+ $(MT_FILES) \
+ $(FILE_IO).o \
+ LzmaAlone.o \
+ Bench.o \
+ BenchCon.o \
+ ConsoleClose.o \
+ LzmaDecoder.o \
+ LzmaEncoder.o \
+ LzmaRegister.o \
+ CreateCoder.o \
+ CWrappers.o \
+ FileStreams.o \
+ FilterCoder.o \
+ MethodProps.o \
+ StreamUtils.o \
+ CommandLineParser.o \
+ CRC.o \
+ CrcReg.o \
+ IntToString.o \
+ MyString.o \
+ MyVector.o \
+ MyWindows.o \
+ StringConvert.o \
+ StringToInt.o \
+ PropVariant.o \
+ System.o \
+ 7zCrc.o \
+ 7zCrcOpt.o \
+ Alloc.o \
+ Bra86.o \
+ CpuArch.o \
+ LzFind.o \
+ LzmaDec.o \
+ LzmaEnc.o \
+ Lzma86Dec.o \
+ Lzma86Enc.o \
+
+
+all: $(PROG)
+
+$(PROG): $(OBJS)
+ $(CXX) -o $(PROG) $(LDFLAGS) $(OBJS) $(LIB2)
+
+LzmaAlone.o: LzmaAlone.cpp
+ $(CXX) $(CFLAGS) LzmaAlone.cpp
+
+Bench.o: ../../UI/Common/Bench.cpp
+ $(CXX) $(CFLAGS) ../../UI/Common/Bench.cpp
+
+BenchCon.o: ../../UI/Console/BenchCon.cpp
+ $(CXX) $(CFLAGS) ../../UI/Console/BenchCon.cpp
+
+ConsoleClose.o: ../../UI/Console/ConsoleClose.cpp
+ $(CXX) $(CFLAGS) ../../UI/Console/ConsoleClose.cpp
+
+LzmaDecoder.o: ../../Compress/LzmaDecoder.cpp
+ $(CXX) $(CFLAGS) ../../Compress/LzmaDecoder.cpp
+
+LzmaEncoder.o: ../../Compress/LzmaEncoder.cpp
+ $(CXX) $(CFLAGS) ../../Compress/LzmaEncoder.cpp
+
+LzmaRegister.o: ../../Compress/LzmaRegister.cpp
+ $(CXX) $(CFLAGS) ../../Compress/LzmaRegister.cpp
+
+CreateCoder.o: ../../Common/CreateCoder.cpp
+ $(CXX) $(CFLAGS) ../../Common/CreateCoder.cpp
+
+CWrappers.o: ../../Common/CWrappers.cpp
+ $(CXX) $(CFLAGS) ../../Common/CWrappers.cpp
+
+FileStreams.o: ../../Common/FileStreams.cpp
+ $(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
+
+FilterCoder.o: ../../Common/FilterCoder.cpp
+ $(CXX) $(CFLAGS) ../../Common/FilterCoder.cpp
+
+MethodProps.o: ../../Common/MethodProps.cpp
+ $(CXX) $(CFLAGS) ../../Common/MethodProps.cpp
+
+StreamUtils.o: ../../Common/StreamUtils.cpp
+ $(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
+
+$(FILE_IO).o: ../../../$(FILE_IO_2).cpp
+ $(CXX) $(CFLAGS) ../../../$(FILE_IO_2).cpp
+
+
+CommandLineParser.o: ../../../Common/CommandLineParser.cpp
+ $(CXX) $(CFLAGS) ../../../Common/CommandLineParser.cpp
+
+CRC.o: ../../../Common/CRC.cpp
+ $(CXX) $(CFLAGS) ../../../Common/CRC.cpp
+
+CrcReg.o: ../../../Common/CrcReg.cpp
+ $(CXX) $(CFLAGS) ../../../Common/CrcReg.cpp
+
+IntToString.o: ../../../Common/IntToString.cpp
+ $(CXX) $(CFLAGS) ../../../Common/IntToString.cpp
+
+MyString.o: ../../../Common/MyString.cpp
+ $(CXX) $(CFLAGS) ../../../Common/MyString.cpp
+
+MyVector.o: ../../../Common/MyVector.cpp
+ $(CXX) $(CFLAGS) ../../../Common/MyVector.cpp
+
+MyWindows.o: ../../../Common/MyWindows.cpp
+ $(CXX) $(CFLAGS) ../../../Common/MyWindows.cpp
+
+StringConvert.o: ../../../Common/StringConvert.cpp
+ $(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
+
+StringToInt.o: ../../../Common/StringToInt.cpp
+ $(CXX) $(CFLAGS) ../../../Common/StringToInt.cpp
+
+PropVariant.o: ../../../Windows/PropVariant.cpp
+ $(CXX) $(CFLAGS) ../../../Windows/PropVariant.cpp
+
+System.o: ../../../Windows/System.cpp
+ $(CXX) $(CFLAGS) ../../../Windows/System.cpp
+
+7zCrc.o: ../../../../C/7zCrc.c
+ $(CXX_C) $(CFLAGS) ../../../../C/7zCrc.c
+
+7zCrcOpt.o: ../../../../C/7zCrcOpt.c
+ $(CXX_C) $(CFLAGS) ../../../../C/7zCrcOpt.c
+
+Alloc.o: ../../../../C/Alloc.c
+ $(CXX_C) $(CFLAGS) ../../../../C/Alloc.c
+
+Bra86.o: ../../../../C/Bra86.c
+ $(CXX_C) $(CFLAGS) ../../../../C/Bra86.c
+
+CpuArch.o: ../../../../C/CpuArch.c
+ $(CXX_C) $(CFLAGS) ../../../../C/CpuArch.c
+
+LzFind.o: ../../../../C/LzFind.c
+ $(CXX_C) $(CFLAGS) ../../../../C/LzFind.c
+
+ifdef MT_FILES
+LzFindMt.o: ../../../../C/LzFindMt.c
+ $(CXX_C) $(CFLAGS) ../../../../C/LzFindMt.c
+
+Threads.o: ../../../../C/Threads.c
+ $(CXX_C) $(CFLAGS) ../../../../C/Threads.c
+endif
+
+LzmaDec.o: ../../../../C/LzmaDec.c
+ $(CXX_C) $(CFLAGS) ../../../../C/LzmaDec.c
+
+LzmaEnc.o: ../../../../C/LzmaEnc.c
+ $(CXX_C) $(CFLAGS) ../../../../C/LzmaEnc.c
+
+Lzma86Dec.o: ../../../../C/Lzma86Dec.c
+ $(CXX_C) $(CFLAGS) ../../../../C/Lzma86Dec.c
+
+Lzma86Enc.o: ../../../../C/Lzma86Enc.c
+ $(CXX_C) $(CFLAGS) ../../../../C/Lzma86Enc.c
+
+clean:
+ -$(RM) $(PROG) $(OBJS)
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/resource.rc
new file mode 100644
index 0000000000..9b54fa80a8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaCon/resource.rc
@@ -0,0 +1,3 @@
+#include "../../MyVersionInfo.rc"
+
+MY_VERSION_INFO_APP("LZMA", "lzma")
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp
new file mode 100644
index 0000000000..67e8dfc799
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/LzmaSpec/LzmaSpec.cpp
@@ -0,0 +1,715 @@
+/* LzmaSpec.cpp -- LZMA Reference Decoder
+2015-06-14 : Igor Pavlov : Public domain */
+
+// This code implements LZMA file decoding according to LZMA specification.
+// This code is not optimized for speed.
+
+#include <stdio.h>
+
+#ifdef _MSC_VER
+ #pragma warning(disable : 4710) // function not inlined
+ #pragma warning(disable : 4996) // This function or variable may be unsafe
+#endif
+
+typedef unsigned char Byte;
+typedef unsigned short UInt16;
+
+#ifdef _LZMA_UINT32_IS_ULONG
+ typedef unsigned long UInt32;
+#else
+ typedef unsigned int UInt32;
+#endif
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+ typedef unsigned __int64 UInt64;
+#else
+ typedef unsigned long long int UInt64;
+#endif
+
+
+struct CInputStream
+{
+ FILE *File;
+ UInt64 Processed;
+
+ void Init() { Processed = 0; }
+
+ Byte ReadByte()
+ {
+ int c = getc(File);
+ if (c < 0)
+ throw "Unexpected end of file";
+ Processed++;
+ return (Byte)c;
+ }
+};
+
+
+struct COutStream
+{
+ FILE *File;
+ UInt64 Processed;
+
+ void Init() { Processed = 0; }
+
+ void WriteByte(Byte b)
+ {
+ if (putc(b, File) == EOF)
+ throw "File writing error";
+ Processed++;
+ }
+};
+
+
+class COutWindow
+{
+ Byte *Buf;
+ UInt32 Pos;
+ UInt32 Size;
+ bool IsFull;
+
+public:
+ unsigned TotalPos;
+ COutStream OutStream;
+
+ COutWindow(): Buf(NULL) {}
+ ~COutWindow() { delete []Buf; }
+
+ void Create(UInt32 dictSize)
+ {
+ Buf = new Byte[dictSize];
+ Pos = 0;
+ Size = dictSize;
+ IsFull = false;
+ TotalPos = 0;
+ }
+
+ void PutByte(Byte b)
+ {
+ TotalPos++;
+ Buf[Pos++] = b;
+ if (Pos == Size)
+ {
+ Pos = 0;
+ IsFull = true;
+ }
+ OutStream.WriteByte(b);
+ }
+
+ Byte GetByte(UInt32 dist) const
+ {
+ return Buf[dist <= Pos ? Pos - dist : Size - dist + Pos];
+ }
+
+ void CopyMatch(UInt32 dist, unsigned len)
+ {
+ for (; len > 0; len--)
+ PutByte(GetByte(dist));
+ }
+
+ bool CheckDistance(UInt32 dist) const
+ {
+ return dist <= Pos || IsFull;
+ }
+
+ bool IsEmpty() const
+ {
+ return Pos == 0 && !IsFull;
+ }
+};
+
+
+#define kNumBitModelTotalBits 11
+#define kNumMoveBits 5
+
+typedef UInt16 CProb;
+
+#define PROB_INIT_VAL ((1 << kNumBitModelTotalBits) / 2)
+
+#define INIT_PROBS(p) \
+ { for (unsigned i = 0; i < sizeof(p) / sizeof(p[0]); i++) p[i] = PROB_INIT_VAL; }
+
+class CRangeDecoder
+{
+ UInt32 Range;
+ UInt32 Code;
+
+ void Normalize();
+
+public:
+
+ CInputStream *InStream;
+ bool Corrupted;
+
+ bool Init();
+ bool IsFinishedOK() const { return Code == 0; }
+
+ UInt32 DecodeDirectBits(unsigned numBits);
+ unsigned DecodeBit(CProb *prob);
+};
+
+bool CRangeDecoder::Init()
+{
+ Corrupted = false;
+ Range = 0xFFFFFFFF;
+ Code = 0;
+
+ Byte b = InStream->ReadByte();
+
+ for (int i = 0; i < 4; i++)
+ Code = (Code << 8) | InStream->ReadByte();
+
+ if (b != 0 || Code == Range)
+ Corrupted = true;
+ return b == 0;
+}
+
+#define kTopValue ((UInt32)1 << 24)
+
+void CRangeDecoder::Normalize()
+{
+ if (Range < kTopValue)
+ {
+ Range <<= 8;
+ Code = (Code << 8) | InStream->ReadByte();
+ }
+}
+
+UInt32 CRangeDecoder::DecodeDirectBits(unsigned numBits)
+{
+ UInt32 res = 0;
+ do
+ {
+ Range >>= 1;
+ Code -= Range;
+ UInt32 t = 0 - ((UInt32)Code >> 31);
+ Code += Range & t;
+
+ if (Code == Range)
+ Corrupted = true;
+
+ Normalize();
+ res <<= 1;
+ res += t + 1;
+ }
+ while (--numBits);
+ return res;
+}
+
+unsigned CRangeDecoder::DecodeBit(CProb *prob)
+{
+ unsigned v = *prob;
+ UInt32 bound = (Range >> kNumBitModelTotalBits) * v;
+ unsigned symbol;
+ if (Code < bound)
+ {
+ v += ((1 << kNumBitModelTotalBits) - v) >> kNumMoveBits;
+ Range = bound;
+ symbol = 0;
+ }
+ else
+ {
+ v -= v >> kNumMoveBits;
+ Code -= bound;
+ Range -= bound;
+ symbol = 1;
+ }
+ *prob = (CProb)v;
+ Normalize();
+ return symbol;
+}
+
+
+unsigned BitTreeReverseDecode(CProb *probs, unsigned numBits, CRangeDecoder *rc)
+{
+ unsigned m = 1;
+ unsigned symbol = 0;
+ for (unsigned i = 0; i < numBits; i++)
+ {
+ unsigned bit = rc->DecodeBit(&probs[m]);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << i);
+ }
+ return symbol;
+}
+
+template <unsigned NumBits>
+class CBitTreeDecoder
+{
+ CProb Probs[(unsigned)1 << NumBits];
+
+public:
+
+ void Init()
+ {
+ INIT_PROBS(Probs);
+ }
+
+ unsigned Decode(CRangeDecoder *rc)
+ {
+ unsigned m = 1;
+ for (unsigned i = 0; i < NumBits; i++)
+ m = (m << 1) + rc->DecodeBit(&Probs[m]);
+ return m - ((unsigned)1 << NumBits);
+ }
+
+ unsigned ReverseDecode(CRangeDecoder *rc)
+ {
+ return BitTreeReverseDecode(Probs, NumBits, rc);
+ }
+};
+
+#define kNumPosBitsMax 4
+
+#define kNumStates 12
+#define kNumLenToPosStates 4
+#define kNumAlignBits 4
+#define kStartPosModelIndex 4
+#define kEndPosModelIndex 14
+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+#define kMatchMinLen 2
+
+class CLenDecoder
+{
+ CProb Choice;
+ CProb Choice2;
+ CBitTreeDecoder<3> LowCoder[1 << kNumPosBitsMax];
+ CBitTreeDecoder<3> MidCoder[1 << kNumPosBitsMax];
+ CBitTreeDecoder<8> HighCoder;
+
+public:
+
+ void Init()
+ {
+ Choice = PROB_INIT_VAL;
+ Choice2 = PROB_INIT_VAL;
+ HighCoder.Init();
+ for (unsigned i = 0; i < (1 << kNumPosBitsMax); i++)
+ {
+ LowCoder[i].Init();
+ MidCoder[i].Init();
+ }
+ }
+
+ unsigned Decode(CRangeDecoder *rc, unsigned posState)
+ {
+ if (rc->DecodeBit(&Choice) == 0)
+ return LowCoder[posState].Decode(rc);
+ if (rc->DecodeBit(&Choice2) == 0)
+ return 8 + MidCoder[posState].Decode(rc);
+ return 16 + HighCoder.Decode(rc);
+ }
+};
+
+unsigned UpdateState_Literal(unsigned state)
+{
+ if (state < 4) return 0;
+ else if (state < 10) return state - 3;
+ else return state - 6;
+}
+unsigned UpdateState_Match (unsigned state) { return state < 7 ? 7 : 10; }
+unsigned UpdateState_Rep (unsigned state) { return state < 7 ? 8 : 11; }
+unsigned UpdateState_ShortRep(unsigned state) { return state < 7 ? 9 : 11; }
+
+#define LZMA_DIC_MIN (1 << 12)
+
+class CLzmaDecoder
+{
+public:
+ CRangeDecoder RangeDec;
+ COutWindow OutWindow;
+
+ bool markerIsMandatory;
+ unsigned lc, pb, lp;
+ UInt32 dictSize;
+ UInt32 dictSizeInProperties;
+
+ void DecodeProperties(const Byte *properties)
+ {
+ unsigned d = properties[0];
+ if (d >= (9 * 5 * 5))
+ throw "Incorrect LZMA properties";
+ lc = d % 9;
+ d /= 9;
+ pb = d / 5;
+ lp = d % 5;
+ dictSizeInProperties = 0;
+ for (int i = 0; i < 4; i++)
+ dictSizeInProperties |= (UInt32)properties[i + 1] << (8 * i);
+ dictSize = dictSizeInProperties;
+ if (dictSize < LZMA_DIC_MIN)
+ dictSize = LZMA_DIC_MIN;
+ }
+
+ CLzmaDecoder(): LitProbs(NULL) {}
+ ~CLzmaDecoder() { delete []LitProbs; }
+
+ void Create()
+ {
+ OutWindow.Create(dictSize);
+ CreateLiterals();
+ }
+
+ int Decode(bool unpackSizeDefined, UInt64 unpackSize);
+
+private:
+
+ CProb *LitProbs;
+
+ void CreateLiterals()
+ {
+ LitProbs = new CProb[(UInt32)0x300 << (lc + lp)];
+ }
+
+ void InitLiterals()
+ {
+ UInt32 num = (UInt32)0x300 << (lc + lp);
+ for (UInt32 i = 0; i < num; i++)
+ LitProbs[i] = PROB_INIT_VAL;
+ }
+
+ void DecodeLiteral(unsigned state, UInt32 rep0)
+ {
+ unsigned prevByte = 0;
+ if (!OutWindow.IsEmpty())
+ prevByte = OutWindow.GetByte(1);
+
+ unsigned symbol = 1;
+ unsigned litState = ((OutWindow.TotalPos & ((1 << lp) - 1)) << lc) + (prevByte >> (8 - lc));
+ CProb *probs = &LitProbs[(UInt32)0x300 * litState];
+
+ if (state >= 7)
+ {
+ unsigned matchByte = OutWindow.GetByte(rep0 + 1);
+ do
+ {
+ unsigned matchBit = (matchByte >> 7) & 1;
+ matchByte <<= 1;
+ unsigned bit = RangeDec.DecodeBit(&probs[((1 + matchBit) << 8) + symbol]);
+ symbol = (symbol << 1) | bit;
+ if (matchBit != bit)
+ break;
+ }
+ while (symbol < 0x100);
+ }
+ while (symbol < 0x100)
+ symbol = (symbol << 1) | RangeDec.DecodeBit(&probs[symbol]);
+ OutWindow.PutByte((Byte)(symbol - 0x100));
+ }
+
+ CBitTreeDecoder<6> PosSlotDecoder[kNumLenToPosStates];
+ CBitTreeDecoder<kNumAlignBits> AlignDecoder;
+ CProb PosDecoders[1 + kNumFullDistances - kEndPosModelIndex];
+
+ void InitDist()
+ {
+ for (unsigned i = 0; i < kNumLenToPosStates; i++)
+ PosSlotDecoder[i].Init();
+ AlignDecoder.Init();
+ INIT_PROBS(PosDecoders);
+ }
+
+ unsigned DecodeDistance(unsigned len)
+ {
+ unsigned lenState = len;
+ if (lenState > kNumLenToPosStates - 1)
+ lenState = kNumLenToPosStates - 1;
+
+ unsigned posSlot = PosSlotDecoder[lenState].Decode(&RangeDec);
+ if (posSlot < 4)
+ return posSlot;
+
+ unsigned numDirectBits = (unsigned)((posSlot >> 1) - 1);
+ UInt32 dist = ((2 | (posSlot & 1)) << numDirectBits);
+ if (posSlot < kEndPosModelIndex)
+ dist += BitTreeReverseDecode(PosDecoders + dist - posSlot, numDirectBits, &RangeDec);
+ else
+ {
+ dist += RangeDec.DecodeDirectBits(numDirectBits - kNumAlignBits) << kNumAlignBits;
+ dist += AlignDecoder.ReverseDecode(&RangeDec);
+ }
+ return dist;
+ }
+
+ CProb IsMatch[kNumStates << kNumPosBitsMax];
+ CProb IsRep[kNumStates];
+ CProb IsRepG0[kNumStates];
+ CProb IsRepG1[kNumStates];
+ CProb IsRepG2[kNumStates];
+ CProb IsRep0Long[kNumStates << kNumPosBitsMax];
+
+ CLenDecoder LenDecoder;
+ CLenDecoder RepLenDecoder;
+
+ void Init()
+ {
+ InitLiterals();
+ InitDist();
+
+ INIT_PROBS(IsMatch);
+ INIT_PROBS(IsRep);
+ INIT_PROBS(IsRepG0);
+ INIT_PROBS(IsRepG1);
+ INIT_PROBS(IsRepG2);
+ INIT_PROBS(IsRep0Long);
+
+ LenDecoder.Init();
+ RepLenDecoder.Init();
+ }
+};
+
+
+#define LZMA_RES_ERROR 0
+#define LZMA_RES_FINISHED_WITH_MARKER 1
+#define LZMA_RES_FINISHED_WITHOUT_MARKER 2
+
+int CLzmaDecoder::Decode(bool unpackSizeDefined, UInt64 unpackSize)
+{
+ if (!RangeDec.Init())
+ return LZMA_RES_ERROR;
+
+ Init();
+
+ UInt32 rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0;
+ unsigned state = 0;
+
+ for (;;)
+ {
+ if (unpackSizeDefined && unpackSize == 0 && !markerIsMandatory)
+ if (RangeDec.IsFinishedOK())
+ return LZMA_RES_FINISHED_WITHOUT_MARKER;
+
+ unsigned posState = OutWindow.TotalPos & ((1 << pb) - 1);
+
+ if (RangeDec.DecodeBit(&IsMatch[(state << kNumPosBitsMax) + posState]) == 0)
+ {
+ if (unpackSizeDefined && unpackSize == 0)
+ return LZMA_RES_ERROR;
+ DecodeLiteral(state, rep0);
+ state = UpdateState_Literal(state);
+ unpackSize--;
+ continue;
+ }
+
+ unsigned len;
+
+ if (RangeDec.DecodeBit(&IsRep[state]) != 0)
+ {
+ if (unpackSizeDefined && unpackSize == 0)
+ return LZMA_RES_ERROR;
+ if (OutWindow.IsEmpty())
+ return LZMA_RES_ERROR;
+ if (RangeDec.DecodeBit(&IsRepG0[state]) == 0)
+ {
+ if (RangeDec.DecodeBit(&IsRep0Long[(state << kNumPosBitsMax) + posState]) == 0)
+ {
+ state = UpdateState_ShortRep(state);
+ OutWindow.PutByte(OutWindow.GetByte(rep0 + 1));
+ unpackSize--;
+ continue;
+ }
+ }
+ else
+ {
+ UInt32 dist;
+ if (RangeDec.DecodeBit(&IsRepG1[state]) == 0)
+ dist = rep1;
+ else
+ {
+ if (RangeDec.DecodeBit(&IsRepG2[state]) == 0)
+ dist = rep2;
+ else
+ {
+ dist = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = dist;
+ }
+ len = RepLenDecoder.Decode(&RangeDec, posState);
+ state = UpdateState_Rep(state);
+ }
+ else
+ {
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ len = LenDecoder.Decode(&RangeDec, posState);
+ state = UpdateState_Match(state);
+ rep0 = DecodeDistance(len);
+ if (rep0 == 0xFFFFFFFF)
+ return RangeDec.IsFinishedOK() ?
+ LZMA_RES_FINISHED_WITH_MARKER :
+ LZMA_RES_ERROR;
+
+ if (unpackSizeDefined && unpackSize == 0)
+ return LZMA_RES_ERROR;
+ if (rep0 >= dictSize || !OutWindow.CheckDistance(rep0))
+ return LZMA_RES_ERROR;
+ }
+ len += kMatchMinLen;
+ bool isError = false;
+ if (unpackSizeDefined && unpackSize < len)
+ {
+ len = (unsigned)unpackSize;
+ isError = true;
+ }
+ OutWindow.CopyMatch(rep0 + 1, len);
+ unpackSize -= len;
+ if (isError)
+ return LZMA_RES_ERROR;
+ }
+}
+
+static void Print(const char *s)
+{
+ fputs(s, stdout);
+}
+
+static void PrintError(const char *s)
+{
+ fputs(s, stderr);
+}
+
+
+#define CONVERT_INT_TO_STR(charType, tempSize) \
+
+void ConvertUInt64ToString(UInt64 val, char *s)
+{
+ char temp[32];
+ unsigned i = 0;
+ while (val >= 10)
+ {
+ temp[i++] = (char)('0' + (unsigned)(val % 10));
+ val /= 10;
+ }
+ *s++ = (char)('0' + (unsigned)val);
+ while (i != 0)
+ {
+ i--;
+ *s++ = temp[i];
+ }
+ *s = 0;
+}
+
+void PrintUInt64(const char *title, UInt64 v)
+{
+ Print(title);
+ Print(" : ");
+ char s[32];
+ ConvertUInt64ToString(v, s);
+ Print(s);
+ Print(" bytes \n");
+}
+
+int main2(int numArgs, const char *args[])
+{
+ Print("\nLZMA Reference Decoder 15.00 : Igor Pavlov : Public domain : 2015-04-16\n");
+ if (numArgs == 1)
+ Print("\nUse: lzmaSpec a.lzma outFile");
+
+ if (numArgs != 3)
+ throw "you must specify two parameters";
+
+ CInputStream inStream;
+ inStream.File = fopen(args[1], "rb");
+ inStream.Init();
+ if (inStream.File == 0)
+ throw "Can't open input file";
+
+ CLzmaDecoder lzmaDecoder;
+ lzmaDecoder.OutWindow.OutStream.File = fopen(args[2], "wb+");
+ lzmaDecoder.OutWindow.OutStream.Init();
+ if (inStream.File == 0)
+ throw "Can't open output file";
+
+ Byte header[13];
+ int i;
+ for (i = 0; i < 13; i++)
+ header[i] = inStream.ReadByte();
+
+ lzmaDecoder.DecodeProperties(header);
+
+ printf("\nlc=%d, lp=%d, pb=%d", lzmaDecoder.lc, lzmaDecoder.lp, lzmaDecoder.pb);
+ printf("\nDictionary Size in properties = %u", lzmaDecoder.dictSizeInProperties);
+ printf("\nDictionary Size for decoding = %u", lzmaDecoder.dictSize);
+
+ UInt64 unpackSize = 0;
+ bool unpackSizeDefined = false;
+ for (i = 0; i < 8; i++)
+ {
+ Byte b = header[5 + i];
+ if (b != 0xFF)
+ unpackSizeDefined = true;
+ unpackSize |= (UInt64)b << (8 * i);
+ }
+
+ lzmaDecoder.markerIsMandatory = !unpackSizeDefined;
+
+ Print("\n");
+ if (unpackSizeDefined)
+ PrintUInt64("Uncompressed Size", unpackSize);
+ else
+ Print("End marker is expected\n");
+ lzmaDecoder.RangeDec.InStream = &inStream;
+
+ Print("\n");
+
+ lzmaDecoder.Create();
+
+ int res = lzmaDecoder.Decode(unpackSizeDefined, unpackSize);
+
+ PrintUInt64("Read ", inStream.Processed);
+ PrintUInt64("Written ", lzmaDecoder.OutWindow.OutStream.Processed);
+
+ if (res == LZMA_RES_ERROR)
+ throw "LZMA decoding error";
+ else if (res == LZMA_RES_FINISHED_WITHOUT_MARKER)
+ Print("Finished without end marker");
+ else if (res == LZMA_RES_FINISHED_WITH_MARKER)
+ {
+ if (unpackSizeDefined)
+ {
+ if (lzmaDecoder.OutWindow.OutStream.Processed != unpackSize)
+ throw "Finished with end marker before than specified size";
+ Print("Warning: ");
+ }
+ Print("Finished with end marker");
+ }
+ else
+ throw "Internal Error";
+
+ Print("\n");
+
+ if (lzmaDecoder.RangeDec.Corrupted)
+ {
+ Print("\nWarning: LZMA stream is corrupted\n");
+ }
+
+ return 0;
+}
+
+
+int
+ #ifdef _MSC_VER
+ __cdecl
+ #endif
+main(int numArgs, const char *args[])
+{
+ try { return main2(numArgs, args); }
+ catch (const char *s)
+ {
+ PrintError("\nError:\n");
+ PrintError(s);
+ PrintError("\n");
+ return 1;
+ }
+ catch(...)
+ {
+ PrintError("\nError\n");
+ return 1;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/7z.ico b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/7z.ico
new file mode 100644
index 0000000000..47ffb781e0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/7z.ico
Binary files differ
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsp
new file mode 100644
index 0000000000..87753191ff
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsp
@@ -0,0 +1,912 @@
+# Microsoft Developer Studio Project File - Name="SFXCon" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=SFXCon - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SFXCon.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SFXCon.mak" CFG="SFXCon - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SFXCon - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "SFXCon - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "SFXCon - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "EXTRACT_ONLY" /D "_SFX" /D "NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /c
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"C:\Util\7zCon.exe" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "SFXCon - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /I "..\..\..\..\\" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "EXTRACT_ONLY" /D "_SFX" /D "NO_READ_FROM_CODER" /Yu"StdAfx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"C:\Util\7zCon.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "SFXCon - Win32 Release"
+# Name "SFXCon - Win32 Debug"
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"StdAfx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Archive Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\HandlerOut.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\MultiStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\MultiStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
+# End Source File
+# End Group
+# Begin Group "Console"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ConsoleClose.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ConsoleClose.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ExtractCallbackConsole.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\ExtractCallbackConsole.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\List.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\List.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\MainAr.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\OpenCallbackConsole.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\OpenCallbackConsole.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\PercentPrinter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\PercentPrinter.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\UserInputUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Console\UserInputUtils.h
+# End Source File
+# End Group
+# Begin Group "7z"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zExtract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHeader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zItem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\SplitHandler.cpp
+# End Source File
+# End Group
+# Begin Group "Compress"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\DeltaFilter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\PpmdDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\PpmdRegister.cpp
+# End Source File
+# End Group
+# Begin Group "Crypto"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAesRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\MyAes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\MyAes.h
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.h
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdInStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdInStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdOutStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StdOutStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\UTFConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\UTFConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.h
+# End Source File
+# End Group
+# Begin Group "7zip Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilePathAutoRename.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilePathAutoRename.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LockedStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LockedStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OffsetStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OffsetStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\PropId.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\RegisterArc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\RegisterCodec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.h
+# End Source File
+# End Group
+# Begin Group "UI"
+
+# PROP Default_Filter ""
+# Begin Group "UI Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveExtractCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveExtractCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExitCode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Extract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Extract.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractingFilePath.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractingFilePath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractMode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\PropIDUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\PropIDUtils.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "C"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrcOpt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Aes.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Aes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\AesOpt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra86.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\BraIA64.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\DllSecur.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\DllSecur.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Ppmd7.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Ppmd7.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Ppmd7Dec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Sha256.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Sha256.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\7z.ico
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\IArchive.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\SfxCon.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsw b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsw
new file mode 100644
index 0000000000..bfbc2b7f00
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SFXCon.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SFXCon"=.\SFXCon.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SfxCon.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SfxCon.cpp
new file mode 100644
index 0000000000..9b34a08190
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/SfxCon.cpp
@@ -0,0 +1,482 @@
+// Main.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/CpuArch.h"
+
+#include "../../../Common/MyWindows.h"
+
+#include "../../../Common/MyInitGuid.h"
+
+#include "../../../Common/CommandLineParser.h"
+#include "../../../Common/MyException.h"
+
+#ifdef _WIN32
+#include "../../../Windows/DLL.h"
+#include "../../../Windows/FileDir.h"
+#endif
+#include "../../../Windows/FileName.h"
+
+#include "../../UI/Common/ExitCode.h"
+#include "../../UI/Common/Extract.h"
+
+#include "../../UI/Console/ExtractCallbackConsole.h"
+#include "../../UI/Console/List.h"
+#include "../../UI/Console/OpenCallbackConsole.h"
+
+#include "../../MyVersion.h"
+
+#include "../../../../C/DllSecur.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+using namespace NCommandLineParser;
+
+#ifdef _WIN32
+HINSTANCE g_hInstance = 0;
+#endif
+int g_CodePage = -1;
+extern CStdOutStream *g_StdStream;
+
+static const char * const kCopyrightString =
+"\n7-Zip SFX " MY_VERSION_CPU " : " MY_COPYRIGHT_DATE "\n";
+
+static const int kNumSwitches = 6;
+
+namespace NKey {
+enum Enum
+{
+ kHelp1 = 0,
+ kHelp2,
+ kDisablePercents,
+ kYes,
+ kPassword,
+ kOutputDir
+};
+
+}
+
+namespace NRecursedType {
+enum EEnum
+{
+ kRecursed,
+ kWildcardOnlyRecursed,
+ kNonRecursed
+};
+}
+/*
+static const char kRecursedIDChar = 'R';
+
+namespace NRecursedPostCharIndex {
+ enum EEnum
+ {
+ kWildcardRecursionOnly = 0,
+ kNoRecursion = 1
+ };
+}
+
+static const char kFileListID = '@';
+static const char kImmediateNameID = '!';
+
+static const char kSomeCludePostStringMinSize = 2; // at least <@|!><N>ame must be
+static const char kSomeCludeAfterRecursedPostStringMinSize = 2; // at least <@|!><N>ame must be
+*/
+static const CSwitchForm kSwitchForms[kNumSwitches] =
+{
+ { "?", NSwitchType::kSimple },
+ { "H", NSwitchType::kSimple },
+ { "BD", NSwitchType::kSimple },
+ { "Y", NSwitchType::kSimple },
+ { "P", NSwitchType::kString, false, 1 },
+ { "O", NSwitchType::kString, false, 1 },
+};
+
+static const int kNumCommandForms = 3;
+
+static const NRecursedType::EEnum kCommandRecursedDefault[kNumCommandForms] =
+{
+ NRecursedType::kRecursed
+};
+
+// static const bool kTestExtractRecursedDefault = true;
+// static const bool kAddRecursedDefault = false;
+
+static const char * const kUniversalWildcard = "*";
+static const int kCommandIndex = 0;
+
+static const char * const kHelpString =
+ "\nUsage: 7zSFX [<command>] [<switches>...] [<file_name>...]\n"
+ "\n"
+ "<Commands>\n"
+ // " l: List contents of archive\n"
+ " t: Test integrity of archive\n"
+ " x: eXtract files with full pathname (default)\n"
+ "<Switches>\n"
+ // " -bd Disable percentage indicator\n"
+ " -o{Directory}: set Output directory\n"
+ " -p{Password}: set Password\n"
+ " -y: assume Yes on all queries\n";
+
+
+// ---------------------------
+// exception messages
+
+static const char * const kUserErrorMessage = "Incorrect command line"; // NExitCode::kUserError
+// static const char * const kIncorrectListFile = "Incorrect wildcard in listfile";
+static const char * const kIncorrectWildcardInCommandLine = "Incorrect wildcard in command line";
+
+// static const CSysString kFileIsNotArchiveMessageBefore = "File \"";
+// static const CSysString kFileIsNotArchiveMessageAfter = "\" is not archive";
+
+// static const char * const kProcessArchiveMessage = " archive: ";
+
+static const char * const kCantFindSFX = " cannot find sfx";
+
+namespace NCommandType
+{
+ enum EEnum
+ {
+ kTest = 0,
+ kFullExtract,
+ kList
+ };
+}
+
+static const char *g_Commands = "txl";
+
+struct CArchiveCommand
+{
+ NCommandType::EEnum CommandType;
+
+ NRecursedType::EEnum DefaultRecursedType() const;
+};
+
+bool ParseArchiveCommand(const UString &commandString, CArchiveCommand &command)
+{
+ UString s = commandString;
+ s.MakeLower_Ascii();
+ if (s.Len() != 1)
+ return false;
+ if (s[0] >= 0x80)
+ return false;
+ int index = FindCharPosInString(g_Commands, (char)s[0]);
+ if (index < 0)
+ return false;
+ command.CommandType = (NCommandType::EEnum)index;
+ return true;
+}
+
+NRecursedType::EEnum CArchiveCommand::DefaultRecursedType() const
+{
+ return kCommandRecursedDefault[CommandType];
+}
+
+void PrintHelp(void)
+{
+ g_StdOut << kHelpString;
+}
+
+static void ShowMessageAndThrowException(const char *message, NExitCode::EEnum code)
+{
+ g_StdOut << message << endl;
+ throw code;
+}
+
+static void PrintHelpAndExit() // yyy
+{
+ PrintHelp();
+ ShowMessageAndThrowException(kUserErrorMessage, NExitCode::kUserError);
+}
+
+// ------------------------------------------------------------------
+// filenames functions
+
+static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor,
+ const UString &name, bool include, NRecursedType::EEnum type)
+{
+ /*
+ if (!IsWildcardFilePathLegal(name))
+ return false;
+ */
+ bool isWildcard = DoesNameContainWildcard(name);
+ bool recursed = false;
+
+ switch (type)
+ {
+ case NRecursedType::kWildcardOnlyRecursed:
+ recursed = isWildcard;
+ break;
+ case NRecursedType::kRecursed:
+ recursed = true;
+ break;
+ case NRecursedType::kNonRecursed:
+ recursed = false;
+ break;
+ }
+ wildcardCensor.AddPreItem(include, name, recursed, true);
+ return true;
+}
+
+void AddCommandLineWildcardToCensor(NWildcard::CCensor &wildcardCensor,
+ const UString &name, bool include, NRecursedType::EEnum type)
+{
+ if (!AddNameToCensor(wildcardCensor, name, include, type))
+ ShowMessageAndThrowException(kIncorrectWildcardInCommandLine, NExitCode::kUserError);
+}
+
+
+#ifndef _WIN32
+static void GetArguments(int numArgs, const char *args[], UStringVector &parts)
+{
+ parts.Clear();
+ for (int i = 0; i < numArgs; i++)
+ {
+ UString s = MultiByteToUnicodeString(args[i]);
+ parts.Add(s);
+ }
+}
+#endif
+
+int Main2(
+ #ifndef _WIN32
+ int numArgs, const char *args[]
+ #endif
+)
+{
+ #ifdef _WIN32
+ // do we need load Security DLLs for console program?
+ LoadSecurityDlls();
+ #endif
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ SetFileApisToOEM();
+ #endif
+
+ g_StdOut << kCopyrightString;
+
+ UStringVector commandStrings;
+ #ifdef _WIN32
+ NCommandLineParser::SplitCommandLine(GetCommandLineW(), commandStrings);
+ #else
+ GetArguments(numArgs, args, commandStrings);
+ #endif
+
+ #ifdef _WIN32
+
+ FString arcPath;
+ {
+ FString path;
+ NDLL::MyGetModuleFileName(path);
+ if (!MyGetFullPathName(path, arcPath))
+ {
+ g_StdOut << "GetFullPathName Error";
+ return NExitCode::kFatalError;
+ }
+ }
+
+ #else
+
+ UString arcPath = commandStrings.Front();
+
+ #endif
+
+ #ifndef UNDER_CE
+ if (commandStrings.Size() > 0)
+ commandStrings.Delete(0);
+ #endif
+
+ NCommandLineParser::CParser parser;
+
+ try
+ {
+ if (!parser.ParseStrings(kSwitchForms, kNumSwitches, commandStrings))
+ {
+ g_StdOut << "Command line error:" << endl
+ << parser.ErrorMessage << endl
+ << parser.ErrorLine << endl;
+ return NExitCode::kUserError;
+ }
+ }
+ catch(...)
+ {
+ PrintHelpAndExit();
+ }
+
+ if (parser[NKey::kHelp1].ThereIs || parser[NKey::kHelp2].ThereIs)
+ {
+ PrintHelp();
+ return 0;
+ }
+
+ const UStringVector &nonSwitchStrings = parser.NonSwitchStrings;
+
+ unsigned curCommandIndex = 0;
+
+ CArchiveCommand command;
+ if (nonSwitchStrings.IsEmpty())
+ command.CommandType = NCommandType::kFullExtract;
+ else
+ {
+ const UString &cmd = nonSwitchStrings[curCommandIndex];
+ if (!ParseArchiveCommand(cmd, command))
+ {
+ g_StdOut << "ERROR: Unknown command:" << endl << cmd << endl;
+ return NExitCode::kUserError;
+ }
+ curCommandIndex = 1;
+ }
+
+
+ NRecursedType::EEnum recursedType;
+ recursedType = command.DefaultRecursedType();
+
+ NWildcard::CCensor wildcardCensor;
+
+ {
+ if (nonSwitchStrings.Size() == curCommandIndex)
+ AddCommandLineWildcardToCensor(wildcardCensor, (UString)kUniversalWildcard, true, recursedType);
+ for (; curCommandIndex < nonSwitchStrings.Size(); curCommandIndex++)
+ {
+ const UString &s = nonSwitchStrings[curCommandIndex];
+ if (s.IsEmpty())
+ throw "Empty file path";
+ AddCommandLineWildcardToCensor(wildcardCensor, s, true, recursedType);
+ }
+ }
+
+ bool yesToAll = parser[NKey::kYes].ThereIs;
+
+ // NExtractMode::EEnum extractMode;
+ // bool isExtractGroupCommand = command.IsFromExtractGroup(extractMode);
+
+ bool passwordEnabled = parser[NKey::kPassword].ThereIs;
+
+ UString password;
+ if (passwordEnabled)
+ password = parser[NKey::kPassword].PostStrings[0];
+
+ if (!NFind::DoesFileExist(arcPath))
+ throw kCantFindSFX;
+
+ FString outputDir;
+ if (parser[NKey::kOutputDir].ThereIs)
+ {
+ outputDir = us2fs(parser[NKey::kOutputDir].PostStrings[0]);
+ NName::NormalizeDirPathPrefix(outputDir);
+ }
+
+
+ wildcardCensor.AddPathsToCensor(NWildcard::k_RelatPath);
+
+ {
+ UStringVector v1, v2;
+ v1.Add(fs2us(arcPath));
+ v2.Add(fs2us(arcPath));
+ const NWildcard::CCensorNode &wildcardCensorHead =
+ wildcardCensor.Pairs.Front().Head;
+
+ CCodecs *codecs = new CCodecs;
+ CMyComPtr<
+ #ifdef EXTERNAL_CODECS
+ ICompressCodecsInfo
+ #else
+ IUnknown
+ #endif
+ > compressCodecsInfo = codecs;
+ {
+ HRESULT result = codecs->Load();
+ if (result != S_OK)
+ throw CSystemException(result);
+ }
+
+ if (command.CommandType != NCommandType::kList)
+ {
+ CExtractCallbackConsole *ecs = new CExtractCallbackConsole;
+ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
+ ecs->Init(g_StdStream, &g_StdErr, g_StdStream);
+
+ #ifndef _NO_CRYPTO
+ ecs->PasswordIsDefined = passwordEnabled;
+ ecs->Password = password;
+ #endif
+
+ /*
+ COpenCallbackConsole openCallback;
+ openCallback.Init(g_StdStream, g_StdStream);
+
+ #ifndef _NO_CRYPTO
+ openCallback.PasswordIsDefined = passwordEnabled;
+ openCallback.Password = password;
+ #endif
+ */
+
+ CExtractOptions eo;
+ eo.StdOutMode = false;
+ eo.YesToAll = yesToAll;
+ eo.TestMode = command.CommandType == NCommandType::kTest;
+ eo.PathMode = NExtract::NPathMode::kFullPaths;
+ eo.OverwriteMode = yesToAll ?
+ NExtract::NOverwriteMode::kOverwrite :
+ NExtract::NOverwriteMode::kAsk;
+ eo.OutputDir = outputDir;
+
+ UString errorMessage;
+ CDecompressStat stat;
+ HRESULT result = Extract(
+ codecs, CObjectVector<COpenType>(), CIntVector(),
+ v1, v2,
+ wildcardCensorHead,
+ eo, ecs, ecs,
+ // NULL, // hash
+ errorMessage, stat);
+ if (!errorMessage.IsEmpty())
+ {
+ (*g_StdStream) << endl << "Error: " << errorMessage;;
+ if (result == S_OK)
+ result = E_FAIL;
+ }
+
+ if (ecs->NumArcsWithError != 0 || ecs->NumFileErrors != 0)
+ {
+ if (ecs->NumArcsWithError != 0)
+ (*g_StdStream) << endl << "Archive Errors" << endl;
+ if (ecs->NumFileErrors != 0)
+ (*g_StdStream) << endl << "Sub items Errors: " << ecs->NumFileErrors << endl;
+ return NExitCode::kFatalError;
+ }
+ if (result != S_OK)
+ throw CSystemException(result);
+ }
+ else
+ {
+ throw CSystemException(E_NOTIMPL);
+
+ /*
+ UInt64 numErrors = 0;
+ UInt64 numWarnings = 0;
+ HRESULT result = ListArchives(
+ codecs, CObjectVector<COpenType>(), CIntVector(),
+ false, // stdInMode
+ v1, v2,
+ true, // processAltStreams
+ false, // showAltStreams
+ wildcardCensorHead,
+ true, // enableHeaders
+ false, // techMode
+ #ifndef _NO_CRYPTO
+ passwordEnabled, password,
+ #endif
+ numErrors, numWarnings);
+ if (numErrors > 0)
+ {
+ g_StdOut << endl << "Errors: " << numErrors;
+ return NExitCode::kFatalError;
+ }
+ if (result != S_OK)
+ throw CSystemException(result);
+ */
+ }
+ }
+ return 0;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/makefile
new file mode 100644
index 0000000000..30e8a388b4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/makefile
@@ -0,0 +1,135 @@
+PROG = 7zCon.sfx
+MY_CONSOLE = 1
+MY_FIXED = 1
+
+CFLAGS = $(CFLAGS) \
+ -DEXTRACT_ONLY \
+ -DNO_READ_FROM_CODER \
+ -D_SFX \
+ -D_CONSOLE \
+
+CURRENT_OBJS = \
+ $O\SfxCon.obj \
+
+CONSOLE_OBJS = \
+ $O\ConsoleClose.obj \
+ $O\ExtractCallbackConsole.obj \
+ $O\List.obj \
+ $O\MainAr.obj \
+ $O\OpenCallbackConsole.obj \
+ $O\PercentPrinter.obj \
+ $O\UserInputUtils.obj \
+
+COMMON_OBJS = \
+ $O\CommandLineParser.obj \
+ $O\CRC.obj \
+ $O\IntToString.obj \
+ $O\MyString.obj \
+ $O\MyVector.obj \
+ $O\NewHandler.obj \
+ $O\StdInStream.obj \
+ $O\StdOutStream.obj \
+ $O\StringConvert.obj \
+ $O\Wildcard.obj \
+ $O\UTFConvert.obj \
+
+WIN_OBJS = \
+ $O\DLL.obj \
+ $O\ErrorMsg.obj \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileName.obj \
+ $O\PropVariant.obj \
+ $O\PropVariantConv.obj \
+ $O\Synchronization.obj \
+ $O\System.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\CWrappers.obj \
+ $O\FilePathAutoRename.obj \
+ $O\FileStreams.obj \
+ $O\InBuffer.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\OutBuffer.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamBinder.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\VirtThread.obj \
+
+UI_COMMON_OBJS = \
+ $O\ArchiveExtractCallback.obj \
+ $O\ArchiveOpenCallback.obj \
+ $O\DefaultName.obj \
+ $O\LoadCodecs.obj \
+ $O\Extract.obj \
+ $O\ExtractingFilePath.obj \
+ $O\OpenArchive.obj \
+ $O\PropIDUtils.obj \
+
+AR_OBJS = \
+ $O\SplitHandler.obj \
+
+AR_COMMON_OBJS = \
+ $O\CoderMixer2.obj \
+ $O\ItemNameUtils.obj \
+ $O\MultiStream.obj \
+ $O\OutStreamWithCRC.obj \
+
+
+7Z_OBJS = \
+ $O\7zDecode.obj \
+ $O\7zExtract.obj \
+ $O\7zHandler.obj \
+ $O\7zIn.obj \
+ $O\7zRegister.obj \
+
+COMPRESS_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BranchMisc.obj \
+ $O\BranchRegister.obj \
+ $O\CopyCoder.obj \
+ $O\CopyRegister.obj \
+ $O\DeltaFilter.obj \
+ $O\Lzma2Decoder.obj \
+ $O\Lzma2Register.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdRegister.obj \
+
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\DllSecur.obj \
+ $O\Lzma2Dec.obj \
+ $O\Lzma2DecMt.obj \
+ $O\LzmaDec.obj \
+ $O\MtDec.obj \
+ $O\Ppmd7.obj \
+ $O\Ppmd7Dec.obj \
+ $O\Sha256.obj \
+ $O\Threads.obj \
+
+!include "../../Aes.mak"
+!include "../../Crc.mak"
+!include "../../LzmaDec.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/resource.rc
new file mode 100644
index 0000000000..97882cd3cb
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXCon/resource.rc
@@ -0,0 +1,5 @@
+#include "../../MyVersionInfo.rc"
+
+MY_VERSION_INFO_APP("7z Console SFX", "7z.sfx")
+
+101 ICON "7z.ico" \ No newline at end of file
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp
new file mode 100644
index 0000000000..d35a24fec0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.cpp
@@ -0,0 +1,246 @@
+// ExtractCallbackSfx.h
+
+#include "StdAfx.h"
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/PropVariant.h"
+
+#include "ExtractCallbackSfx.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static LPCSTR const kCantDeleteFile = "Can not delete output file";
+static LPCSTR const kCantOpenFile = "Can not open output file";
+static LPCSTR const kUnsupportedMethod = "Unsupported Method";
+
+void CExtractCallbackImp::Init(IInArchive *archiveHandler,
+ const FString &directoryPath,
+ const UString &itemDefaultName,
+ const FILETIME &defaultMTime,
+ UInt32 defaultAttributes)
+{
+ _message.Empty();
+ _isCorrupt = false;
+ _itemDefaultName = itemDefaultName;
+ _defaultMTime = defaultMTime;
+ _defaultAttributes = defaultAttributes;
+ _archiveHandler = archiveHandler;
+ _directoryPath = directoryPath;
+ NName::NormalizeDirPathPrefix(_directoryPath);
+}
+
+HRESULT CExtractCallbackImp::Open_CheckBreak()
+{
+ #ifndef _NO_PROGRESS
+ return ProgressDialog.Sync.ProcessStopAndPause();
+ #else
+ return S_OK;
+ #endif
+}
+
+HRESULT CExtractCallbackImp::Open_SetTotal(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
+{
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 * /* numFiles */, const UInt64 * /* numBytes */)
+{
+ #ifndef _NO_PROGRESS
+ return ProgressDialog.Sync.ProcessStopAndPause();
+ #else
+ return S_OK;
+ #endif
+}
+
+HRESULT CExtractCallbackImp::Open_Finished()
+{
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 size)
+{
+ #ifndef _NO_PROGRESS
+ ProgressDialog.Sync.SetProgress(size, 0);
+ #endif
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *completeValue)
+{
+ #ifndef _NO_PROGRESS
+ RINOK(ProgressDialog.Sync.ProcessStopAndPause());
+ if (completeValue != NULL)
+ ProgressDialog.Sync.SetPos(*completeValue);
+ #endif
+ return S_OK;
+}
+
+void CExtractCallbackImp::CreateComplexDirectory(const UStringVector &dirPathParts)
+{
+ FString fullPath = _directoryPath;
+ FOR_VECTOR (i, dirPathParts)
+ {
+ fullPath += us2fs(dirPathParts[i]);
+ CreateDir(fullPath);
+ fullPath.Add_PathSepar();
+ }
+}
+
+STDMETHODIMP CExtractCallbackImp::GetStream(UInt32 index,
+ ISequentialOutStream **outStream, Int32 askExtractMode)
+{
+ #ifndef _NO_PROGRESS
+ if (ProgressDialog.Sync.GetStopped())
+ return E_ABORT;
+ #endif
+ _outFileStream.Release();
+
+ UString fullPath;
+ {
+ NCOM::CPropVariant prop;
+ RINOK(_archiveHandler->GetProperty(index, kpidPath, &prop));
+ if (prop.vt == VT_EMPTY)
+ fullPath = _itemDefaultName;
+ else
+ {
+ if (prop.vt != VT_BSTR)
+ return E_FAIL;
+ fullPath.SetFromBstr(prop.bstrVal);
+ }
+ _filePath = fullPath;
+ }
+
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract)
+ {
+ NCOM::CPropVariant prop;
+ RINOK(_archiveHandler->GetProperty(index, kpidAttrib, &prop));
+ if (prop.vt == VT_EMPTY)
+ _processedFileInfo.Attributes = _defaultAttributes;
+ else
+ {
+ if (prop.vt != VT_UI4)
+ return E_FAIL;
+ _processedFileInfo.Attributes = prop.ulVal;
+ }
+
+ RINOK(_archiveHandler->GetProperty(index, kpidIsDir, &prop));
+ _processedFileInfo.IsDir = VARIANT_BOOLToBool(prop.boolVal);
+
+ bool isAnti = false;
+ {
+ NCOM::CPropVariant propTemp;
+ RINOK(_archiveHandler->GetProperty(index, kpidIsAnti, &propTemp));
+ if (propTemp.vt == VT_BOOL)
+ isAnti = VARIANT_BOOLToBool(propTemp.boolVal);
+ }
+
+ RINOK(_archiveHandler->GetProperty(index, kpidMTime, &prop));
+ switch (prop.vt)
+ {
+ case VT_EMPTY: _processedFileInfo.MTime = _defaultMTime; break;
+ case VT_FILETIME: _processedFileInfo.MTime = prop.filetime; break;
+ default: return E_FAIL;
+ }
+
+ UStringVector pathParts;
+ SplitPathToParts(fullPath, pathParts);
+ if (pathParts.IsEmpty())
+ return E_FAIL;
+
+ UString processedPath = fullPath;
+
+ if (!_processedFileInfo.IsDir)
+ pathParts.DeleteBack();
+ if (!pathParts.IsEmpty())
+ {
+ if (!isAnti)
+ CreateComplexDirectory(pathParts);
+ }
+
+ FString fullProcessedPath = _directoryPath + us2fs(processedPath);
+
+ if (_processedFileInfo.IsDir)
+ {
+ _diskFilePath = fullProcessedPath;
+
+ if (isAnti)
+ RemoveDir(_diskFilePath);
+ else
+ SetDirTime(_diskFilePath, NULL, NULL, &_processedFileInfo.MTime);
+ return S_OK;
+ }
+
+ NFind::CFileInfo fileInfo;
+ if (fileInfo.Find(fullProcessedPath))
+ {
+ if (!DeleteFileAlways(fullProcessedPath))
+ {
+ _message = kCantDeleteFile;
+ return E_FAIL;
+ }
+ }
+
+ if (!isAnti)
+ {
+ _outFileStreamSpec = new COutFileStream;
+ CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec);
+ if (!_outFileStreamSpec->Create(fullProcessedPath, true))
+ {
+ _message = kCantOpenFile;
+ return E_FAIL;
+ }
+ _outFileStream = outStreamLoc;
+ *outStream = outStreamLoc.Detach();
+ }
+ _diskFilePath = fullProcessedPath;
+ }
+ else
+ {
+ *outStream = NULL;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::PrepareOperation(Int32 askExtractMode)
+{
+ _extractMode = (askExtractMode == NArchive::NExtract::NAskMode::kExtract);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 resultEOperationResult)
+{
+ switch (resultEOperationResult)
+ {
+ case NArchive::NExtract::NOperationResult::kOK:
+ break;
+
+ default:
+ {
+ _outFileStream.Release();
+ switch (resultEOperationResult)
+ {
+ case NArchive::NExtract::NOperationResult::kUnsupportedMethod:
+ _message = kUnsupportedMethod;
+ break;
+ default:
+ _isCorrupt = true;
+ }
+ return E_FAIL;
+ }
+ }
+ if (_outFileStream != NULL)
+ {
+ _outFileStreamSpec->SetMTime(&_processedFileInfo.MTime);
+ RINOK(_outFileStreamSpec->Close());
+ }
+ _outFileStream.Release();
+ if (_extractMode)
+ SetFileAttrib(_diskFilePath, _processedFileInfo.Attributes);
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h
new file mode 100644
index 0000000000..b7f04e0ec0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractCallbackSfx.h
@@ -0,0 +1,86 @@
+// ExtractCallbackSfx.h
+
+#ifndef __EXTRACT_CALLBACK_SFX_H
+#define __EXTRACT_CALLBACK_SFX_H
+
+#include "resource.h"
+
+#include "../../../Windows/ResourceString.h"
+
+#include "../../Archive/IArchive.h"
+
+#include "../../Common/FileStreams.h"
+#include "../../ICoder.h"
+
+#include "../../UI/FileManager/LangUtils.h"
+
+#ifndef _NO_PROGRESS
+#include "../../UI/FileManager/ProgressDialog.h"
+#endif
+#include "../../UI/Common/ArchiveOpenCallback.h"
+
+class CExtractCallbackImp:
+ public IArchiveExtractCallback,
+ public IOpenCallbackUI,
+ public CMyUnknownImp
+{
+public:
+
+ MY_UNKNOWN_IMP
+
+ INTERFACE_IArchiveExtractCallback(;)
+ INTERFACE_IOpenCallbackUI(;)
+
+private:
+ CMyComPtr<IInArchive> _archiveHandler;
+ FString _directoryPath;
+ UString _filePath;
+ FString _diskFilePath;
+
+ bool _extractMode;
+ struct CProcessedFileInfo
+ {
+ FILETIME MTime;
+ bool IsDir;
+ UInt32 Attributes;
+ } _processedFileInfo;
+
+ COutFileStream *_outFileStreamSpec;
+ CMyComPtr<ISequentialOutStream> _outFileStream;
+
+ UString _itemDefaultName;
+ FILETIME _defaultMTime;
+ UInt32 _defaultAttributes;
+
+ void CreateComplexDirectory(const UStringVector &dirPathParts);
+public:
+ #ifndef _NO_PROGRESS
+ CProgressDialog ProgressDialog;
+ #endif
+
+ bool _isCorrupt;
+ UString _message;
+
+ void Init(IInArchive *archiveHandler,
+ const FString &directoryPath,
+ const UString &itemDefaultName,
+ const FILETIME &defaultMTime,
+ UInt32 defaultAttributes);
+
+ #ifndef _NO_PROGRESS
+ HRESULT StartProgressDialog(const UString &title, NWindows::CThread &thread)
+ {
+ ProgressDialog.Create(title, thread, 0);
+ {
+ ProgressDialog.SetText(LangString(IDS_PROGRESS_EXTRACTING));
+ }
+
+ ProgressDialog.Show(SW_SHOWNORMAL);
+ return S_OK;
+ }
+ virtual ~CExtractCallbackImp() { ProgressDialog.Destroy(); }
+ #endif
+
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp
new file mode 100644
index 0000000000..194e376143
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.cpp
@@ -0,0 +1,137 @@
+// ExtractEngine.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/Thread.h"
+
+#include "../../UI/Common/OpenArchive.h"
+
+#include "../../UI/FileManager/FormatUtils.h"
+#include "../../UI/FileManager/LangUtils.h"
+
+#include "ExtractCallbackSfx.h"
+#include "ExtractEngine.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static LPCSTR const kCantFindArchive = "Can not find archive file";
+static LPCSTR const kCantOpenArchive = "Can not open the file as archive";
+
+struct CThreadExtracting
+{
+ CCodecs *Codecs;
+ FString FileName;
+ FString DestFolder;
+
+ CExtractCallbackImp *ExtractCallbackSpec;
+ CMyComPtr<IArchiveExtractCallback> ExtractCallback;
+
+ CArchiveLink ArchiveLink;
+ HRESULT Result;
+ UString ErrorMessage;
+
+ void Process2()
+ {
+ NFind::CFileInfo fi;
+ if (!fi.Find(FileName))
+ {
+ ErrorMessage = kCantFindArchive;
+ Result = E_FAIL;
+ return;
+ }
+
+ CObjectVector<COpenType> incl;
+ CIntVector excl;
+ COpenOptions options;
+ options.codecs = Codecs;
+ options.types = &incl;
+ options.excludedFormats = &excl;
+ options.filePath = fs2us(FileName);
+
+ Result = ArchiveLink.Open2(options, ExtractCallbackSpec);
+ if (Result != S_OK)
+ {
+ ErrorMessage = kCantOpenArchive;
+ return;
+ }
+
+ FString dirPath = DestFolder;
+ NName::NormalizeDirPathPrefix(dirPath);
+
+ if (!CreateComplexDir(dirPath))
+ {
+ ErrorMessage = MyFormatNew(IDS_CANNOT_CREATE_FOLDER,
+ #ifdef LANG
+ 0x02000603,
+ #endif
+ fs2us(dirPath));
+ Result = E_FAIL;
+ return;
+ }
+
+ ExtractCallbackSpec->Init(ArchiveLink.GetArchive(), dirPath, (UString)"Default", fi.MTime, 0);
+
+ Result = ArchiveLink.GetArchive()->Extract(0, (UInt32)(Int32)-1 , BoolToInt(false), ExtractCallback);
+ }
+
+ void Process()
+ {
+ try
+ {
+ #ifndef _NO_PROGRESS
+ CProgressCloser closer(ExtractCallbackSpec->ProgressDialog);
+ #endif
+ Process2();
+ }
+ catch(...) { Result = E_FAIL; }
+ }
+
+ static THREAD_FUNC_DECL MyThreadFunction(void *param)
+ {
+ ((CThreadExtracting *)param)->Process();
+ return 0;
+ }
+};
+
+HRESULT ExtractArchive(CCodecs *codecs, const FString &fileName, const FString &destFolder,
+ bool showProgress, bool &isCorrupt, UString &errorMessage)
+{
+ isCorrupt = false;
+ CThreadExtracting t;
+
+ t.Codecs = codecs;
+ t.FileName = fileName;
+ t.DestFolder = destFolder;
+
+ t.ExtractCallbackSpec = new CExtractCallbackImp;
+ t.ExtractCallback = t.ExtractCallbackSpec;
+
+ #ifndef _NO_PROGRESS
+
+ if (showProgress)
+ {
+ t.ExtractCallbackSpec->ProgressDialog.IconID = IDI_ICON;
+ NWindows::CThread thread;
+ RINOK(thread.Create(CThreadExtracting::MyThreadFunction, &t));
+
+ UString title;
+ LangString(IDS_PROGRESS_EXTRACTING, title);
+ t.ExtractCallbackSpec->StartProgressDialog(title, thread);
+ }
+ else
+
+ #endif
+ {
+ t.Process2();
+ }
+
+ errorMessage = t.ErrorMessage;
+ if (errorMessage.IsEmpty())
+ errorMessage = t.ExtractCallbackSpec->_message;
+ isCorrupt = t.ExtractCallbackSpec->_isCorrupt;
+ return t.Result;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h
new file mode 100644
index 0000000000..8aa9724e27
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/ExtractEngine.h
@@ -0,0 +1,11 @@
+// ExtractEngine.h
+
+#ifndef __EXTRACT_ENGINE_H
+#define __EXTRACT_ENGINE_H
+
+#include "../../UI/Common/LoadCodecs.h"
+
+HRESULT ExtractArchive(CCodecs *codecs, const FString &fileName, const FString &destFolder,
+ bool showProgress, bool &isCorrupt, UString &errorMessage);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
new file mode 100644
index 0000000000..61cb260c1f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsp
@@ -0,0 +1,803 @@
+# Microsoft Developer Studio Project File - Name="SFXSetup" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=SFXSetup - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SFXSetup.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SFXSetup.mak" CFG="SFXSetup - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SFXSetup - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "SFXSetup - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE "SFXSetup - Win32 ReleaseD" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "SFXSetup - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /Gz /MT /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib delayimp.lib /nologo /subsystem:windows /machine:I386 /out:"Release\7zS.sfx" /opt:NOWIN98 /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "SFXSetup - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib delayimp.lib /nologo /subsystem:windows /debug /machine:I386 /out:"Debug\7zSfxS.exe" /pdbtype:sept /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
+
+!ELSEIF "$(CFG)" == "SFXSetup - Win32 ReleaseD"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "ReleaseD"
+# PROP BASE Intermediate_Dir "ReleaseD"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "ReleaseD"
+# PROP Intermediate_Dir "ReleaseD"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MD /W3 /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_SFX" /Yu"StdAfx.h" /FD /c
+# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "_SFX" /D "_NO_CRYPTO" /Yu"StdAfx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\UTIL\7zWinSR.exe"
+# SUBTRACT BASE LINK32 /debug /nodefaultlib
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib delayimp.lib /nologo /subsystem:windows /machine:I386 /out:"ReleaseD\7zSD.sfx" /opt:NOWIN98 /delayload:user32.dll /delayload:shell32.dll /delayload:oleaut32.dll
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "SFXSetup - Win32 Release"
+# Name "SFXSetup - Win32 Debug"
+# Name "SFXSetup - Win32 ReleaseD"
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"StdAfx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Interface"
+
+# PROP Default_Filter ""
+# End Group
+# Begin Group "7z"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zExtract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHeader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zItem.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zRegister.cpp
+# End Source File
+# End Group
+# Begin Group "Archive Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
+# End Source File
+# End Group
+# Begin Group "Compress"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\DeltaFilter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaRegister.cpp
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\TextConfig.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\TextConfig.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\UTFConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\UTFConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.h
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Group "Control"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\Dialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\Dialog.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ResourceString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ResourceString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Window.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Window.h
+# End Source File
+# End Group
+# Begin Group "7z Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\PropId.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.h
+# End Source File
+# End Group
+# Begin Group "UI"
+
+# PROP Default_Filter ""
+# Begin Group "Explorer"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Explorer\MyMessages.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Explorer\MyMessages.h
+# End Source File
+# End Group
+# Begin Group "UI Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractMode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "File Manager"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\FormatUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\FormatUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\LangUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ProgressDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ProgressDialog.h
+# End Source File
+# End Group
+# Begin Group "C"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrcOpt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra86.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\BraIA64.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\DllSecur.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\DllSecur.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ExtractCallbackSfx.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ExtractCallbackSfx.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\ExtractEngine.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\ExtractEngine.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\setup.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\SfxSetup.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw
new file mode 100644
index 0000000000..2970370140
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SFXSetup.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SFXSetup"=.\SFXSetup.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
new file mode 100644
index 0000000000..e3a3bb2c61
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/SfxSetup.cpp
@@ -0,0 +1,596 @@
+// Main.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/MyWindows.h"
+
+#include "../../../Common/MyInitGuid.h"
+
+#include "../../../Common/CommandLineParser.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/TextConfig.h"
+
+#include "../../../Windows/DLL.h"
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/FileIO.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/NtCheck.h"
+#include "../../../Windows/ResourceString.h"
+
+#include "../../UI/Explorer/MyMessages.h"
+
+#include "ExtractEngine.h"
+
+#include "../../../../C/DllSecur.h"
+
+#include "resource.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+HINSTANCE g_hInstance;
+
+static CFSTR const kTempDirPrefix = FTEXT("7zS");
+
+#define _SHELL_EXECUTE
+
+static bool ReadDataString(CFSTR fileName, LPCSTR startID,
+ LPCSTR endID, AString &stringResult)
+{
+ stringResult.Empty();
+ NIO::CInFile inFile;
+ if (!inFile.Open(fileName))
+ return false;
+ const int kBufferSize = (1 << 12);
+
+ Byte buffer[kBufferSize];
+ int signatureStartSize = MyStringLen(startID);
+ int signatureEndSize = MyStringLen(endID);
+
+ UInt32 numBytesPrev = 0;
+ bool writeMode = false;
+ UInt64 posTotal = 0;
+ for (;;)
+ {
+ if (posTotal > (1 << 20))
+ return (stringResult.IsEmpty());
+ UInt32 numReadBytes = kBufferSize - numBytesPrev;
+ UInt32 processedSize;
+ if (!inFile.Read(buffer + numBytesPrev, numReadBytes, processedSize))
+ return false;
+ if (processedSize == 0)
+ return true;
+ UInt32 numBytesInBuffer = numBytesPrev + processedSize;
+ UInt32 pos = 0;
+ for (;;)
+ {
+ if (writeMode)
+ {
+ if (pos > numBytesInBuffer - signatureEndSize)
+ break;
+ if (memcmp(buffer + pos, endID, signatureEndSize) == 0)
+ return true;
+ char b = buffer[pos];
+ if (b == 0)
+ return false;
+ stringResult += b;
+ pos++;
+ }
+ else
+ {
+ if (pos > numBytesInBuffer - signatureStartSize)
+ break;
+ if (memcmp(buffer + pos, startID, signatureStartSize) == 0)
+ {
+ writeMode = true;
+ pos += signatureStartSize;
+ }
+ else
+ pos++;
+ }
+ }
+ numBytesPrev = numBytesInBuffer - pos;
+ posTotal += pos;
+ memmove(buffer, buffer + pos, numBytesPrev);
+ }
+}
+
+static char kStartID[] = { ',','!','@','I','n','s','t','a','l','l','@','!','U','T','F','-','8','!', 0 };
+static char kEndID[] = { ',','!','@','I','n','s','t','a','l','l','E','n','d','@','!', 0 };
+
+struct CInstallIDInit
+{
+ CInstallIDInit()
+ {
+ kStartID[0] = ';';
+ kEndID[0] = ';';
+ };
+} g_CInstallIDInit;
+
+
+#define NT_CHECK_FAIL_ACTION ShowErrorMessage(L"Unsupported Windows version"); return 1;
+
+static void ShowErrorMessageSpec(const UString &name)
+{
+ UString message = NError::MyFormatMessage(::GetLastError());
+ int pos = message.Find(L"%1");
+ if (pos >= 0)
+ {
+ message.Delete(pos, 2);
+ message.Insert(pos, name);
+ }
+ ShowErrorMessage(NULL, message);
+}
+
+/* BEGIN Mozilla customizations */
+
+static char const *
+FindStrInBuf(char const * buf, size_t bufLen, char const * str)
+{
+ size_t index = 0;
+ while (index < bufLen) {
+ char const * result = strstr(buf + index, str);
+ if (result) {
+ return result;
+ }
+ while ((buf[index] != '\0') && (index < bufLen)) {
+ index++;
+ }
+ index++;
+ }
+ return NULL;
+}
+
+static bool
+ReadPostSigningDataFromView(char const * view, DWORD size, AString& data)
+{
+ // Find the offset and length of the certificate table,
+ // so we know the valid range to look for the token.
+ if (size < (0x3c + sizeof(UInt32))) {
+ return false;
+ }
+ UInt32 PEHeaderOffset = *(UInt32*)(view + 0x3c);
+ UInt32 optionalHeaderOffset = PEHeaderOffset + 24;
+ UInt32 certDirEntryOffset = 0;
+ if (size < (optionalHeaderOffset + sizeof(UInt16))) {
+ return false;
+ }
+ UInt16 magic = *(UInt16*)(view + optionalHeaderOffset);
+ if (magic == 0x010b) {
+ // 32-bit executable
+ certDirEntryOffset = optionalHeaderOffset + 128;
+ } else if (magic == 0x020b) {
+ // 64-bit executable; certain header fields are wider
+ certDirEntryOffset = optionalHeaderOffset + 144;
+ } else {
+ // Unknown executable
+ return false;
+ }
+ if (size < certDirEntryOffset + 8) {
+ return false;
+ }
+ UInt32 certTableOffset = *(UInt32*)(view + certDirEntryOffset);
+ UInt32 certTableLen = *(UInt32*)(view + certDirEntryOffset + sizeof(UInt32));
+ if (certTableOffset == 0 || certTableLen == 0 ||
+ size < (certTableOffset + certTableLen)) {
+ return false;
+ }
+
+ char const token[] = "__MOZCUSTOM__:";
+ // We're searching for a string inside a binary blob,
+ // so a normal strstr that bails on the first NUL won't work.
+ char const * tokenPos = FindStrInBuf(view + certTableOffset,
+ certTableLen, token);
+ if (tokenPos) {
+ size_t tokenLen = (sizeof(token) / sizeof(token[0])) - 1;
+ data = AString(tokenPos + tokenLen);
+ return true;
+ }
+ return false;
+}
+
+static bool
+ReadPostSigningData(UString exePath, AString& data)
+{
+ bool retval = false;
+ HANDLE exeFile = CreateFileW(exePath, GENERIC_READ, FILE_SHARE_READ, NULL,
+ OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (exeFile != INVALID_HANDLE_VALUE) {
+ HANDLE mapping = CreateFileMapping(exeFile, NULL, PAGE_READONLY, 0, 0, NULL);
+ if (mapping != INVALID_HANDLE_VALUE) {
+ // MSDN claims the return value on failure is NULL,
+ // but I've also seen it returned on success, so double-check.
+ if (mapping || GetLastError() == ERROR_SUCCESS) {
+ char * view = (char*)MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0);
+ if (view) {
+ DWORD fileSize = GetFileSize(exeFile, NULL);
+ retval = ReadPostSigningDataFromView(view, fileSize, data);
+ }
+ CloseHandle(mapping);
+ }
+ }
+ CloseHandle(exeFile);
+ }
+ return retval;
+}
+
+// Delayed load libraries are loaded when the first symbol is used.
+// The following ensures that we load the delayed loaded libraries from the
+// system directory.
+struct AutoLoadSystemDependencies
+{
+ AutoLoadSystemDependencies()
+ {
+ HMODULE module = ::GetModuleHandleW(L"kernel32.dll");
+ if (module) {
+ // SetDefaultDllDirectories is always available on Windows 8 and above. It
+ // is also available on Windows Vista, Windows Server 2008, and
+ // Windows 7 when MS KB2533623 has been applied.
+ typedef BOOL (WINAPI *SetDefaultDllDirectoriesType)(DWORD);
+ SetDefaultDllDirectoriesType setDefaultDllDirectories =
+ (SetDefaultDllDirectoriesType) GetProcAddress(module, "SetDefaultDllDirectories");
+ if (setDefaultDllDirectories) {
+ setDefaultDllDirectories(0x0800 /* LOAD_LIBRARY_SEARCH_SYSTEM32 */ );
+ return;
+ }
+ }
+
+ static LPCWSTR delayDLLs[] = { L"uxtheme.dll", L"userenv.dll",
+ L"setupapi.dll", L"apphelp.dll",
+ L"propsys.dll", L"dwmapi.dll",
+ L"cryptbase.dll", L"oleacc.dll",
+ L"clbcatq.dll" };
+ WCHAR systemDirectory[MAX_PATH + 1] = { L'\0' };
+ // If GetSystemDirectory fails we accept that we'll load the DLLs from the
+ // normal search path.
+ GetSystemDirectoryW(systemDirectory, MAX_PATH + 1);
+ size_t systemDirLen = wcslen(systemDirectory);
+
+ // Make the system directory path terminate with a slash
+ if (systemDirectory[systemDirLen - 1] != L'\\' && systemDirLen) {
+ systemDirectory[systemDirLen] = L'\\';
+ ++systemDirLen;
+ // No need to re-NULL terminate
+ }
+
+ // For each known DLL ensure it is loaded from the system32 directory
+ for (size_t i = 0; i < sizeof(delayDLLs) / sizeof(delayDLLs[0]); ++i) {
+ size_t fileLen = wcslen(delayDLLs[i]);
+ wcsncpy(systemDirectory + systemDirLen, delayDLLs[i],
+ MAX_PATH - systemDirLen);
+ if (systemDirLen + fileLen <= MAX_PATH) {
+ systemDirectory[systemDirLen + fileLen] = L'\0';
+ } else {
+ systemDirectory[MAX_PATH] = L'\0';
+ }
+ LPCWSTR fullModulePath = systemDirectory; // just for code readability
+ LoadLibraryW(fullModulePath);
+ }
+ }
+} loadDLLs;
+
+BOOL
+RemoveCurrentDirFromSearchPath()
+{
+ // kernel32.dll is in the knownDLL list so it is safe to load without a full path
+ HMODULE kernel32 = LoadLibraryW(L"kernel32.dll");
+ if (!kernel32) {
+ return FALSE;
+ }
+
+ typedef BOOL (WINAPI *SetDllDirectoryType)(LPCWSTR);
+ SetDllDirectoryType SetDllDirectoryFn =
+ (SetDllDirectoryType)GetProcAddress(kernel32, "SetDllDirectoryW");
+ if (!SetDllDirectoryFn) {
+ FreeLibrary(kernel32);
+ return FALSE;
+ }
+
+ // If this call fails we can't do much about it, so ignore it.
+ // It is unlikely to fail and this is just a precaution anyway.
+ SetDllDirectoryFn(L"");
+ FreeLibrary(kernel32);
+ return TRUE;
+}
+
+/* END Mozilla customizations */
+
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ #ifdef UNDER_CE
+ LPWSTR
+ #else
+ LPSTR
+ #endif
+ /* lpCmdLine */,int /* nCmdShow */)
+{
+ /* BEGIN Mozilla customizations */
+ // Disable current directory from being in the search path.
+ // This call does not help with implicitly loaded DLLs.
+ if (!RemoveCurrentDirFromSearchPath()) {
+ WCHAR minOSTitle[512] = { '\0' };
+ WCHAR minOSText[512] = { '\0' };
+ LoadStringW(NULL, IDS_MIN_OS_TITLE, minOSTitle,
+ sizeof(minOSTitle) / sizeof(minOSTitle[0]));
+ LoadStringW(NULL, IDS_MIN_OS_TEXT, minOSText,
+ sizeof(minOSText) / sizeof(minOSText[0]));
+ MessageBoxW(NULL, minOSText, minOSTitle, MB_OK | MB_ICONERROR);
+ return 1;
+ }
+ /* END Mozilla customizations */
+
+ g_hInstance = (HINSTANCE)hInstance;
+
+ NT_CHECK
+
+ // BEGIN Mozilla customizations
+ // Our AutoLoadSystemDependencies (see above) does the same job as the
+ // LoadSecurityDlls function, but slightly better because it runs as a static
+ // initializer, and it doesn't include LOAD_LIBRARY_SEARCH_USER_DIRS in
+ // the search path, which partially defeats the purpose of calling
+ // SetDefaultDllDirectories at all.
+ //#ifdef _WIN32
+ //LoadSecurityDlls();
+ //#endif
+ // END Mozilla customizations
+
+ // InitCommonControls();
+
+ UString archiveName, switches;
+ #ifdef _SHELL_EXECUTE
+ UString executeFile, executeParameters;
+ #endif
+ NCommandLineParser::SplitCommandLine(GetCommandLineW(), archiveName, switches);
+
+ FString fullPath;
+ NDLL::MyGetModuleFileName(fullPath);
+
+ switches.Trim();
+ bool assumeYes = false;
+ if (switches.IsPrefixedBy_Ascii_NoCase("-y"))
+ {
+ assumeYes = true;
+ switches = switches.Ptr(2);
+ switches.Trim();
+ }
+
+ AString config;
+ if (!ReadDataString(fullPath, kStartID, kEndID, config))
+ {
+ if (!assumeYes)
+ ShowErrorMessage(L"Can't load config info");
+ return 1;
+ }
+
+ UString dirPrefix ("." STRING_PATH_SEPARATOR);
+ UString appLaunched;
+ bool showProgress = true;
+
+ /* BEGIN Mozilla customizations */
+ bool extractOnly = false;
+ if (switches.IsPrefixedBy_NoCase(L"/extractdir=")) {
+ assumeYes = true;
+ showProgress = false;
+ extractOnly = true;
+ } else if (!switches.IsEmpty()) {
+ showProgress = false;
+ }
+ /* END Mozilla customizations */
+
+ if (!config.IsEmpty())
+ {
+ CObjectVector<CTextConfigPair> pairs;
+ if (!GetTextConfig(config, pairs))
+ {
+ if (!assumeYes)
+ ShowErrorMessage(L"Config failed");
+ return 1;
+ }
+ UString friendlyName = GetTextConfigValue(pairs, "Title");
+ UString installPrompt = GetTextConfigValue(pairs, "BeginPrompt");
+ UString progress = GetTextConfigValue(pairs, "Progress");
+ if (progress.IsEqualTo_Ascii_NoCase("no"))
+ showProgress = false;
+ int index = FindTextConfigItem(pairs, "Directory");
+ if (index >= 0)
+ dirPrefix = pairs[index].String;
+ if (!installPrompt.IsEmpty() && !assumeYes)
+ {
+ if (MessageBoxW(0, installPrompt, friendlyName, MB_YESNO |
+ MB_ICONQUESTION) != IDYES)
+ return 0;
+ }
+ appLaunched = GetTextConfigValue(pairs, "RunProgram");
+
+ #ifdef _SHELL_EXECUTE
+ executeFile = GetTextConfigValue(pairs, "ExecuteFile");
+ executeParameters = GetTextConfigValue(pairs, "ExecuteParameters");
+ #endif
+ }
+
+ CTempDir tempDir;
+ /* Mozilla customizations - Added !extractOnly */
+ if (!extractOnly && !tempDir.Create(kTempDirPrefix))
+ {
+ if (!assumeYes)
+ ShowErrorMessage(L"Can not create temp folder archive");
+ return 1;
+ }
+
+ CCodecs *codecs = new CCodecs;
+ CMyComPtr<IUnknown> compressCodecsInfo = codecs;
+ {
+ HRESULT result = codecs->Load();
+ if (result != S_OK)
+ {
+ ShowErrorMessage(L"Can not load codecs");
+ return 1;
+ }
+ }
+
+ /* BEGIN Mozilla customizations - added extractOnly parameter support */
+ const FString tempDirPath = extractOnly ? switches.Ptr(12) : GetUnicodeString(tempDir.GetPath());
+ /* END Mozilla customizations */
+ // tempDirPath = L"M:\\1\\"; // to test low disk space
+ {
+ bool isCorrupt = false;
+ UString errorMessage;
+ HRESULT result = ExtractArchive(codecs, fullPath, tempDirPath, showProgress,
+ isCorrupt, errorMessage);
+
+ if (result != S_OK)
+ {
+ if (!assumeYes)
+ {
+ if (result == S_FALSE || isCorrupt)
+ {
+ NWindows::MyLoadString(IDS_EXTRACTION_ERROR_MESSAGE, errorMessage);
+ result = E_FAIL;
+ }
+ if (result != E_ABORT)
+ {
+ if (errorMessage.IsEmpty())
+ errorMessage = NError::MyFormatMessage(result);
+ ::MessageBoxW(0, errorMessage, NWindows::MyLoadString(IDS_EXTRACTION_ERROR_TITLE), MB_ICONERROR);
+ }
+ }
+ return 1;
+ }
+ }
+
+ /* BEGIN Mozilla customizations */
+ // Retrieve and store any data added to this file after signing.
+ {
+ AString postSigningData;
+ if (ReadPostSigningData(fullPath, postSigningData)) {
+ FString postSigningDataFilePath(tempDirPath);
+ NFile::NName::NormalizeDirPathPrefix(postSigningDataFilePath);
+ postSigningDataFilePath += L"postSigningData";
+
+ NFile::NIO::COutFile postSigningDataFile;
+ postSigningDataFile.Create(postSigningDataFilePath, true);
+
+ UInt32 written = 0;
+ postSigningDataFile.Write(postSigningData, postSigningData.Len(), written);
+ }
+ }
+
+ if (extractOnly) {
+ return 0;
+ }
+ /* END Mozilla customizations */
+
+ #ifndef UNDER_CE
+ CCurrentDirRestorer currentDirRestorer;
+ if (!SetCurrentDir(tempDirPath))
+ return 1;
+ #endif
+
+ HANDLE hProcess = 0;
+#ifdef _SHELL_EXECUTE
+ if (!executeFile.IsEmpty())
+ {
+ CSysString filePath (GetSystemString(executeFile));
+ SHELLEXECUTEINFO execInfo;
+ execInfo.cbSize = sizeof(execInfo);
+ execInfo.fMask = SEE_MASK_NOCLOSEPROCESS
+ #ifndef UNDER_CE
+ | SEE_MASK_FLAG_DDEWAIT
+ #endif
+ ;
+ execInfo.hwnd = NULL;
+ execInfo.lpVerb = NULL;
+ execInfo.lpFile = filePath;
+
+ if (!switches.IsEmpty())
+ {
+ executeParameters.Add_Space_if_NotEmpty();
+ executeParameters += switches;
+ }
+
+ CSysString parametersSys (GetSystemString(executeParameters));
+ if (parametersSys.IsEmpty())
+ execInfo.lpParameters = NULL;
+ else
+ execInfo.lpParameters = parametersSys;
+
+ execInfo.lpDirectory = NULL;
+ execInfo.nShow = SW_SHOWNORMAL;
+ execInfo.hProcess = 0;
+ /* BOOL success = */ ::ShellExecuteEx(&execInfo);
+ UINT32 result = (UINT32)(UINT_PTR)execInfo.hInstApp;
+ if (result <= 32)
+ {
+ if (!assumeYes)
+ ShowErrorMessage(L"Can not open file");
+ return 1;
+ }
+ hProcess = execInfo.hProcess;
+ }
+ else
+#endif
+ {
+ if (appLaunched.IsEmpty())
+ {
+ appLaunched = L"setup.exe";
+ if (!NFind::DoesFileExist(us2fs(appLaunched)))
+ {
+ if (!assumeYes)
+ ShowErrorMessage(L"Can not find setup.exe");
+ return 1;
+ }
+ }
+
+ {
+ FString s2 = tempDirPath;
+ NName::NormalizeDirPathPrefix(s2);
+ appLaunched.Replace(L"%%T" WSTRING_PATH_SEPARATOR, fs2us(s2));
+ }
+
+ UString appNameForError = appLaunched; // actually we need to rtemove parameters also
+
+ appLaunched.Replace(L"%%T", fs2us(tempDirPath));
+
+ if (!switches.IsEmpty())
+ {
+ appLaunched.Add_Space();
+ appLaunched += switches;
+ }
+ STARTUPINFO startupInfo;
+ startupInfo.cb = sizeof(startupInfo);
+ startupInfo.lpReserved = 0;
+ startupInfo.lpDesktop = 0;
+ startupInfo.lpTitle = 0;
+ startupInfo.dwFlags = 0;
+ startupInfo.cbReserved2 = 0;
+ startupInfo.lpReserved2 = 0;
+
+ PROCESS_INFORMATION processInformation;
+
+ CSysString appLaunchedSys (GetSystemString(dirPrefix + appLaunched));
+
+ BOOL createResult = CreateProcess(NULL, (LPTSTR)(LPCTSTR)appLaunchedSys,
+ NULL, NULL, FALSE, 0, NULL, NULL /*tempDir.GetPath() */,
+ &startupInfo, &processInformation);
+ if (createResult == 0)
+ {
+ if (!assumeYes)
+ {
+ // we print name of exe file, if error message is
+ // ERROR_BAD_EXE_FORMAT: "%1 is not a valid Win32 application".
+ ShowErrorMessageSpec(appNameForError);
+ }
+ return 1;
+ }
+ ::CloseHandle(processInformation.hThread);
+ hProcess = processInformation.hProcess;
+ }
+ if (hProcess != 0)
+ {
+ WaitForSingleObject(hProcess, INFINITE);
+ ::CloseHandle(hProcess);
+ }
+ return 0;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.h
new file mode 100644
index 0000000000..72410eecd6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/StdAfx.h
@@ -0,0 +1,13 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#include <commctrl.h>
+
+// #define printf(x) NO_PRINTF_(x)
+// #define sprintf(x) NO_SPRINTF_(x)
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/makefile
new file mode 100644
index 0000000000..b97daad719
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/makefile
@@ -0,0 +1,117 @@
+PROG = 7zS.sfx
+MY_FIXED = 1
+
+CFLAGS = $(CFLAGS) \
+ -DNO_REGISTRY \
+ -DEXTRACT_ONLY \
+ -DNO_READ_FROM_CODER \
+ -D_SFX \
+ -D_NO_CRYPTO \
+
+CURRENT_OBJS = \
+ $O\SfxSetup.obj \
+ $O\ExtractCallbackSfx.obj \
+ $O\ExtractEngine.obj \
+
+COMMON_OBJS = \
+ $O\CommandLineParser.obj \
+ $O\CRC.obj \
+ $O\IntToString.obj \
+ $O\NewHandler.obj \
+ $O\MyString.obj \
+ $O\StringConvert.obj \
+ $O\TextConfig.obj \
+ $O\UTFConvert.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+
+WIN_OBJS = \
+ $O\DLL.obj \
+ $O\ErrorMsg.obj \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileName.obj \
+ $O\PropVariant.obj \
+ $O\ResourceString.obj \
+ $O\Synchronization.obj \
+ $O\System.obj \
+ $O\Window.obj \
+
+WIN_CTRL_OBJS = \
+ $O\Dialog.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\CWrappers.obj \
+ $O\FileStreams.obj \
+ $O\InBuffer.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\OutBuffer.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamBinder.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\VirtThread.obj \
+
+UI_COMMON_OBJS = \
+ $O\ArchiveOpenCallback.obj \
+ $O\DefaultName.obj \
+ $O\LoadCodecs.obj \
+ $O\OpenArchive.obj \
+
+EXPLORER_OBJS = \
+ $O\MyMessages.obj \
+
+FM_OBJS = \
+ $O\FormatUtils.obj \
+ $O\ProgressDialog.obj \
+
+AR_COMMON_OBJS = \
+ $O\CoderMixer2.obj \
+ $O\ItemNameUtils.obj \
+ $O\OutStreamWithCRC.obj \
+
+7Z_OBJS = \
+ $O\7zDecode.obj \
+ $O\7zExtract.obj \
+ $O\7zHandler.obj \
+ $O\7zIn.obj \
+ $O\7zRegister.obj \
+
+COMPRESS_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BranchMisc.obj \
+ $O\BranchRegister.obj \
+ $O\CopyCoder.obj \
+ $O\CopyRegister.obj \
+ $O\DeltaFilter.obj \
+ $O\Lzma2Decoder.obj \
+ $O\Lzma2Register.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\DllSecur.obj \
+ $O\Lzma2Dec.obj \
+ $O\Lzma2DecMt.obj \
+ $O\LzmaDec.obj \
+ $O\MtDec.obj \
+ $O\Threads.obj \
+
+!include "../../Crc.mak"
+!include "../../LzmaDec.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h
new file mode 100644
index 0000000000..975d7791d0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.h
@@ -0,0 +1,8 @@
+#define IDI_ICON 1
+
+#define IDS_EXTRACTION_ERROR_TITLE 7
+#define IDS_EXTRACTION_ERROR_MESSAGE 8
+#define IDS_CANNOT_CREATE_FOLDER 3003
+#define IDS_PROGRESS_EXTRACTING 3300
+#define IDS_MIN_OS_TITLE 70
+#define IDS_MIN_OS_TEXT 71
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc
new file mode 100644
index 0000000000..9fda0d0d16
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/resource.rc
@@ -0,0 +1,18 @@
+#include "../../MyVersionInfo.rc"
+#include "resource.h"
+
+MY_VERSION_INFO_APP("7z Setup SFX", "7zS.sfx")
+
+IDI_ICON ICON "setup.ico"
+
+STRINGTABLE
+BEGIN
+ IDS_EXTRACTION_ERROR_TITLE "Extraction Failed"
+ IDS_EXTRACTION_ERROR_MESSAGE "File is corrupt"
+ IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
+ IDS_PROGRESS_EXTRACTING "Extracting"
+ IDS_MIN_OS_TITLE "Setup Error"
+ IDS_MIN_OS_TEXT "Microsoft Windows 7 or newer is required."
+END
+
+#include "../../UI/FileManager/ProgressDialog.rc"
diff --git a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/setup.ico b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/setup.ico
index 9801fed54f..9801fed54f 100644
--- a/other-licenses/7zstub/src/7zip/Bundles/SFXSetup-moz/setup.ico
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXSetup/setup.ico
Binary files differ
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/7z.ico b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/7z.ico
new file mode 100644
index 0000000000..47ffb781e0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/7z.ico
Binary files differ
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsp
new file mode 100644
index 0000000000..83ec931153
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsp
@@ -0,0 +1,988 @@
+# Microsoft Developer Studio Project File - Name="SFXWin" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=SFXWin - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "SFXWin.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "SFXWin.mak" CFG="SFXWin - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "SFXWin - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "SFXWin - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE "SFXWin - Win32 ReleaseD" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "SFXWin - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "_SFXWIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "NO_READ_FROM_CODER" /D "_SFX" /Yu"StdAfx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7z.sfx" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ELSEIF "$(CFG)" == "SFXWin - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /Gz /MTd /W4 /WX /Gm /GX /ZI /Od /D "_DEBUG" /D "_SFXWIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "NO_READ_FROM_CODER" /D "_SFX" /Yu"StdAfx.h" /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /out:"C:\Util\7zsfx.exe" /pdbtype:sept
+
+!ELSEIF "$(CFG)" == "SFXWin - Win32 ReleaseD"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "SFXWin___Win32_ReleaseD"
+# PROP BASE Intermediate_Dir "SFXWin___Win32_ReleaseD"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "SFXWin___Win32_ReleaseD"
+# PROP Intermediate_Dir "SFXWin___Win32_ReleaseD"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /Gz /MT /W3 /GX /O1 /I "..\..\..\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "EXCLUDE_COM" /D "NO_REGISTRY" /D "_SFX" /Yu"StdAfx.h" /FD /c
+# ADD CPP /nologo /Gz /MD /W4 /WX /GX /O1 /D "NDEBUG" /D "_SFXWIN32" /D "_WINDOWS" /D "_MBCS" /D "EXTRACT_ONLY" /D "NO_REGISTRY" /D "NO_READ_FROM_CODER" /D "_SFX" /Yu"StdAfx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7z.sfx" /opt:NOWIN98
+# SUBTRACT BASE LINK32 /pdb:none
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /out:"C:\Util\7zD.sfx" /opt:NOWIN98
+# SUBTRACT LINK32 /pdb:none
+
+!ENDIF
+
+# Begin Target
+
+# Name "SFXWin - Win32 Release"
+# Name "SFXWin - Win32 Debug"
+# Name "SFXWin - Win32 ReleaseD"
+# Begin Group "Spec"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"StdAfx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "7z"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zDecode.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zExtract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zHeader.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zIn.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\7z\7zRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\SplitHandler.cpp
+# End Source File
+# End Group
+# Begin Group "Archive Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\CoderMixer2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\ItemNameUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\MultiStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\MultiStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Archive\Common\OutStreamWithCRC.h
+# End Source File
+# End Group
+# Begin Group "Compress"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Coder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Bcj2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BcjRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchMisc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\BranchRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\CopyRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\DeltaFilter.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Decoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\Lzma2Register.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\LzmaRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\PpmdDecoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Compress\PpmdRegister.cpp
+# End Source File
+# End Group
+# Begin Group "Crypto"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\7zAesRegister.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\MyAes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Crypto\MyAes.h
+# End Source File
+# End Group
+# Begin Group "Dialogs"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\BrowseDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\BrowseDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ComboDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ComboDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\OverwriteDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\OverwriteDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\PasswordDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\PasswordDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ProgressDialog2.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ProgressDialog2.h
+# End Source File
+# End Group
+# Begin Group "7zip Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CreateCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\CWrappers.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilePathAutoRename.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilePathAutoRename.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FilterCoder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\InBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LimitedStreams.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LockedStream.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\LockedStream.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\OutBuffer.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\ProgressUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\PropId.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamBinder.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamObjects.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\StreamUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\VirtThread.h
+# End Source File
+# End Group
+# Begin Group "File Manager"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ExtractCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\ExtractCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\FormatUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\FormatUtils.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\PropertyName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\PropertyName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\SysIconUtils.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\FileManager\SysIconUtils.h
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Group "Control"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\ComboBox.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\ComboBox.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\Dialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\Dialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\ListView.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Control\ListView.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=..\..\..\Windows\CommonDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\CommonDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ErrorMsg.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ResourceString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\ResourceString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Shell.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Shell.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Synchronization.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\System.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Window.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\Window.h
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CommandLineParser.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\CRC.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.h
+# End Source File
+# End Group
+# Begin Group "UI"
+
+# PROP Default_Filter ""
+# Begin Group "UI Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveExtractCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveExtractCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ArchiveOpenCallback.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\DefaultName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Extract.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\Extract.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractingFilePath.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\ExtractingFilePath.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\LoadCodecs.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Common\OpenArchive.h
+# End Source File
+# End Group
+# Begin Group "GUI"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\GUI\ExtractDialog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\GUI\ExtractDialog.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\GUI\ExtractGUI.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\GUI\ExtractGUI.h
+# End Source File
+# End Group
+# Begin Group "Explorer"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\UI\Explorer\MyMessages.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\UI\Explorer\MyMessages.h
+# End Source File
+# End Group
+# End Group
+# Begin Group "C"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\7zCrcOpt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Aes.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Aes.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\AesOpt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Alloc.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bcj2.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Bra86.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\BraIA64.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\CpuArch.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Delta.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\DllSecur.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\DllSecur.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2Dec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Lzma2DecMt.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\LzmaDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\MtDec.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Ppmd7.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Ppmd7.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Ppmd7Dec.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Sha256.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.c
+# SUBTRACT CPP /YX /Yc /Yu
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Threads.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\7z.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\7z1.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\SfxWin.cpp
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsw b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsw
new file mode 100644
index 0000000000..66958036b5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SFXWin.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "SFXWin"=.\SFXWin.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SfxWin.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SfxWin.cpp
new file mode 100644
index 0000000000..5eade1abd1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/SfxWin.cpp
@@ -0,0 +1,241 @@
+// Main.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/MyWindows.h"
+
+#include <Shlwapi.h>
+
+#include "../../../Common/MyInitGuid.h"
+
+#include "../../../Common/CommandLineParser.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/DLL.h"
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/NtCheck.h"
+#include "../../../Windows/ResourceString.h"
+
+#include "../../ICoder.h"
+#include "../../IPassword.h"
+#include "../../Archive/IArchive.h"
+#include "../../UI/Common/Extract.h"
+#include "../../UI/Common/ExitCode.h"
+#include "../../UI/Explorer/MyMessages.h"
+#include "../../UI/FileManager/MyWindowsNew.h"
+#include "../../UI/GUI/ExtractGUI.h"
+#include "../../UI/GUI/ExtractRes.h"
+
+#include "../../../../C/DllSecur.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+HINSTANCE g_hInstance;
+
+#ifndef UNDER_CE
+
+DWORD g_ComCtl32Version;
+
+static DWORD GetDllVersion(LPCTSTR dllName)
+{
+ DWORD dwVersion = 0;
+ HINSTANCE hinstDll = LoadLibrary(dllName);
+ if (hinstDll)
+ {
+ DLLGETVERSIONPROC pDllGetVersion = (DLLGETVERSIONPROC)GetProcAddress(hinstDll, "DllGetVersion");
+ if (pDllGetVersion)
+ {
+ DLLVERSIONINFO dvi;
+ ZeroMemory(&dvi, sizeof(dvi));
+ dvi.cbSize = sizeof(dvi);
+ HRESULT hr = (*pDllGetVersion)(&dvi);
+ if (SUCCEEDED(hr))
+ dwVersion = MAKELONG(dvi.dwMinorVersion, dvi.dwMajorVersion);
+ }
+ FreeLibrary(hinstDll);
+ }
+ return dwVersion;
+}
+
+#endif
+
+bool g_LVN_ITEMACTIVATE_Support = true;
+
+static const wchar_t * const kUnknownExceptionMessage = L"ERROR: Unknown Error!";
+
+void ErrorMessageForHRESULT(HRESULT res)
+{
+ ShowErrorMessage(HResultToMessage(res));
+}
+
+int APIENTRY WinMain2()
+{
+ // OleInitialize is required for ProgressBar in TaskBar.
+ #ifndef UNDER_CE
+ OleInitialize(NULL);
+ #endif
+
+ #ifndef UNDER_CE
+ g_ComCtl32Version = ::GetDllVersion(TEXT("comctl32.dll"));
+ g_LVN_ITEMACTIVATE_Support = (g_ComCtl32Version >= MAKELONG(71, 4));
+ #endif
+
+ UString password;
+ bool assumeYes = false;
+ bool outputFolderDefined = false;
+ FString outputFolder;
+ UStringVector commandStrings;
+ NCommandLineParser::SplitCommandLine(GetCommandLineW(), commandStrings);
+
+ #ifndef UNDER_CE
+ if (commandStrings.Size() > 0)
+ commandStrings.Delete(0);
+ #endif
+
+ FOR_VECTOR (i, commandStrings)
+ {
+ const UString &s = commandStrings[i];
+ if (s.Len() > 1 && s[0] == '-')
+ {
+ wchar_t c = MyCharLower_Ascii(s[1]);
+ if (c == 'y')
+ {
+ assumeYes = true;
+ if (s.Len() != 2)
+ {
+ ShowErrorMessage(L"Bad command");
+ return 1;
+ }
+ }
+ else if (c == 'o')
+ {
+ outputFolder = us2fs(s.Ptr(2));
+ NName::NormalizeDirPathPrefix(outputFolder);
+ outputFolderDefined = !outputFolder.IsEmpty();
+ }
+ else if (c == 'p')
+ {
+ password = s.Ptr(2);
+ }
+ }
+ }
+
+ FString path;
+ NDLL::MyGetModuleFileName(path);
+
+ FString fullPath;
+ if (!MyGetFullPathName(path, fullPath))
+ {
+ ShowErrorMessage(L"Error 1329484");
+ return 1;
+ }
+
+ CCodecs *codecs = new CCodecs;
+ CMyComPtr<IUnknown> compressCodecsInfo = codecs;
+ HRESULT result = codecs->Load();
+ if (result != S_OK)
+ {
+ ErrorMessageForHRESULT(result);
+ return 1;
+ }
+
+ // COpenCallbackGUI openCallback;
+
+ // openCallback.PasswordIsDefined = !password.IsEmpty();
+ // openCallback.Password = password;
+
+ CExtractCallbackImp *ecs = new CExtractCallbackImp;
+ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
+ ecs->Init();
+
+ #ifndef _NO_CRYPTO
+ ecs->PasswordIsDefined = !password.IsEmpty();
+ ecs->Password = password;
+ #endif
+
+ CExtractOptions eo;
+
+ FString dirPrefix;
+ if (!GetOnlyDirPrefix(path, dirPrefix))
+ {
+ ShowErrorMessage(L"Error 1329485");
+ return 1;
+ }
+
+ eo.OutputDir = outputFolderDefined ? outputFolder : dirPrefix;
+ eo.YesToAll = assumeYes;
+ eo.OverwriteMode = assumeYes ?
+ NExtract::NOverwriteMode::kOverwrite :
+ NExtract::NOverwriteMode::kAsk;
+ eo.PathMode = NExtract::NPathMode::kFullPaths;
+ eo.TestMode = false;
+
+ UStringVector v1, v2;
+ v1.Add(fs2us(fullPath));
+ v2.Add(fs2us(fullPath));
+ NWildcard::CCensorNode wildcardCensor;
+ wildcardCensor.AddItem(true, L"*", true, true, true, true);
+
+ bool messageWasDisplayed = false;
+ result = ExtractGUI(codecs,
+ CObjectVector<COpenType>(), CIntVector(),
+ v1, v2,
+ wildcardCensor, eo, (assumeYes ? false: true), messageWasDisplayed, ecs);
+
+ if (result == S_OK)
+ {
+ if (!ecs->IsOK())
+ return NExitCode::kFatalError;
+ return 0;
+ }
+ if (result == E_ABORT)
+ return NExitCode::kUserBreak;
+ if (!messageWasDisplayed)
+ {
+ if (result == S_FALSE)
+ ShowErrorMessage(L"Error in archive");
+ else
+ ErrorMessageForHRESULT(result);
+ }
+ if (result == E_OUTOFMEMORY)
+ return NExitCode::kMemoryError;
+ return NExitCode::kFatalError;
+}
+
+#define NT_CHECK_FAIL_ACTION ShowErrorMessage(L"Unsupported Windows version"); return NExitCode::kFatalError;
+
+int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /* hPrevInstance */,
+ #ifdef UNDER_CE
+ LPWSTR
+ #else
+ LPSTR
+ #endif
+ /* lpCmdLine */, int /* nCmdShow */)
+{
+ g_hInstance = (HINSTANCE)hInstance;
+
+ NT_CHECK
+
+ try
+ {
+ #ifdef _WIN32
+ LoadSecurityDlls();
+ #endif
+
+ return WinMain2();
+ }
+ catch(const CNewException &)
+ {
+ ErrorMessageForHRESULT(E_OUTOFMEMORY);
+ return NExitCode::kMemoryError;
+ }
+ catch(...)
+ {
+ ShowErrorMessage(kUnknownExceptionMessage);
+ return NExitCode::kFatalError;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.h
new file mode 100644
index 0000000000..f263ecb77c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/StdAfx.h
@@ -0,0 +1,14 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#include <commctrl.h>
+#include <ShlObj.h>
+
+// #define printf(x) NO_PRINTF_(x)
+// #define sprintf(x) NO_SPRINTF_(x)
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/makefile b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/makefile
new file mode 100644
index 0000000000..21a67dd4d8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/makefile
@@ -0,0 +1,153 @@
+PROG = 7z.sfx
+MY_FIXED = 1
+
+CFLAGS = $(CFLAGS) \
+ -DNO_REGISTRY \
+ -DEXTRACT_ONLY \
+ -DNO_READ_FROM_CODER \
+ -D_SFX \
+
+!IFDEF UNDER_CE
+LIBS = $(LIBS) ceshell.lib Commctrl.lib
+!ELSE
+LIBS = $(LIBS) comctl32.lib comdlg32.lib
+!ENDIF
+
+CURRENT_OBJS = \
+ $O\SfxWin.obj \
+
+GUI_OBJS = \
+ $O\ExtractDialog.obj \
+ $O\ExtractGUI.obj \
+
+COMMON_OBJS = \
+ $O\CRC.obj \
+ $O\CommandLineParser.obj \
+ $O\IntToString.obj \
+ $O\NewHandler.obj \
+ $O\MyString.obj \
+ $O\StringConvert.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+
+WIN_OBJS = \
+ $O\CommonDialog.obj \
+ $O\DLL.obj \
+ $O\ErrorMsg.obj \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileName.obj \
+ $O\PropVariant.obj \
+ $O\PropVariantConv.obj \
+ $O\ResourceString.obj \
+ $O\Shell.obj \
+ $O\Synchronization.obj \
+ $O\System.obj \
+ $O\Window.obj \
+
+WIN_CTRL_OBJS = \
+ $O\ComboBox.obj \
+ $O\Dialog.obj \
+ $O\ListView.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\CWrappers.obj \
+ $O\FilePathAutoRename.obj \
+ $O\FileStreams.obj \
+ $O\InBuffer.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\OutBuffer.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamBinder.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\VirtThread.obj \
+
+UI_COMMON_OBJS = \
+ $O\ArchiveExtractCallback.obj \
+ $O\ArchiveOpenCallback.obj \
+ $O\DefaultName.obj \
+ $O\Extract.obj \
+ $O\ExtractingFilePath.obj \
+ $O\LoadCodecs.obj \
+ $O\OpenArchive.obj \
+
+EXPLORER_OBJS = \
+ $O\MyMessages.obj \
+
+FM_OBJS = \
+ $O\BrowseDialog.obj \
+ $O\ComboDialog.obj \
+ $O\ExtractCallback.obj \
+ $O\FormatUtils.obj \
+ $O\OverwriteDialog.obj \
+ $O\PasswordDialog.obj \
+ $O\ProgressDialog2.obj \
+ $O\PropertyName.obj \
+ $O\SysIconUtils.obj \
+
+AR_OBJS = \
+ $O\SplitHandler.obj \
+
+AR_COMMON_OBJS = \
+ $O\CoderMixer2.obj \
+ $O\ItemNameUtils.obj \
+ $O\MultiStream.obj \
+ $O\OutStreamWithCRC.obj \
+
+7Z_OBJS = \
+ $O\7zDecode.obj \
+ $O\7zExtract.obj \
+ $O\7zHandler.obj \
+ $O\7zIn.obj \
+ $O\7zRegister.obj \
+
+COMPRESS_OBJS = \
+ $O\Bcj2Coder.obj \
+ $O\Bcj2Register.obj \
+ $O\BcjCoder.obj \
+ $O\BcjRegister.obj \
+ $O\BranchMisc.obj \
+ $O\BranchRegister.obj \
+ $O\CopyCoder.obj \
+ $O\CopyRegister.obj \
+ $O\DeltaFilter.obj \
+ $O\Lzma2Decoder.obj \
+ $O\Lzma2Register.obj \
+ $O\LzmaDecoder.obj \
+ $O\LzmaRegister.obj \
+ $O\PpmdDecoder.obj \
+ $O\PpmdRegister.obj \
+
+CRYPTO_OBJS = \
+ $O\7zAes.obj \
+ $O\7zAesRegister.obj \
+ $O\MyAes.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\Bcj2.obj \
+ $O\Bra.obj \
+ $O\Bra86.obj \
+ $O\BraIA64.obj \
+ $O\CpuArch.obj \
+ $O\Delta.obj \
+ $O\DllSecur.obj \
+ $O\Lzma2Dec.obj \
+ $O\Lzma2DecMt.obj \
+ $O\LzmaDec.obj \
+ $O\MtDec.obj \
+ $O\Ppmd7.obj \
+ $O\Ppmd7Dec.obj \
+ $O\Sha256.obj \
+ $O\Threads.obj \
+
+!include "../../Aes.mak"
+!include "../../Crc.mak"
+!include "../../LzmaDec.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.h b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.h
new file mode 100644
index 0000000000..d9fae1ba6e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.h
@@ -0,0 +1 @@
+#define IDI_ICON 1
diff --git a/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.rc b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.rc
new file mode 100644
index 0000000000..3b69b357e3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Bundles/SFXWin/resource.rc
@@ -0,0 +1,50 @@
+#include "../../MyVersionInfo.rc"
+#include "../../GuiCommon.rc"
+#include "../../UI/GUI/ExtractDialogRes.h"
+#include "../../UI/FileManager/PropertyNameRes.h"
+
+#include "resource.h"
+
+MY_VERSION_INFO_APP("7z SFX", "7z.sfx")
+
+#define xc 240
+#define yc 64
+
+IDI_ICON ICON "7z.ico"
+
+IDD_EXTRACT DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "7-Zip self-extracting archive"
+BEGIN
+ LTEXT "E&xtract to:", IDT_EXTRACT_EXTRACT_TO, m, m, xc, 8
+ EDITTEXT IDC_EXTRACT_PATH, m, 21, xc - bxsDots - 12, 14, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDB_EXTRACT_SET_PATH, xs - m - bxsDots, 20, bxsDots, bys, WS_GROUP
+ DEFPUSHBUTTON "Extract", IDOK, bx2, by, bxs, bys, WS_GROUP
+ PUSHBUTTON "Cancel", IDCANCEL, bx1, by, bxs, bys
+END
+
+#ifdef UNDER_CE
+
+#undef xc
+#define xc 144
+
+IDD_EXTRACT_2 DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "7-Zip self-extracting archive"
+BEGIN
+ LTEXT "E&xtract to:", IDT_EXTRACT_EXTRACT_TO, m, m, xc - bxsDots - 12, 8
+ EDITTEXT IDC_EXTRACT_PATH, m, m + bys + 4, xc, 14, ES_AUTOHSCROLL
+ PUSHBUTTON "...", IDB_EXTRACT_SET_PATH, xs - m - bxsDots, m, bxsDots, bys, WS_GROUP
+ DEFPUSHBUTTON "Extract", IDOK, bx2, by, bxs, bys, WS_GROUP
+ PUSHBUTTON "Cancel", IDCANCEL, bx1, by, bxs, bys
+END
+
+#endif
+
+#include "../../UI/FileManager/OverwriteDialog.rc"
+#include "../../UI/FileManager/PasswordDialog.rc"
+#include "../../UI/FileManager/ProgressDialog2.rc"
+#include "../../UI/GUI/Extract.rc"
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_PROP_MTIME "Modified"
+END
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.cpp
new file mode 100644
index 0000000000..e726dadc25
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.cpp
@@ -0,0 +1,250 @@
+// CWrappers.h
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "CWrappers.h"
+
+#include "StreamUtils.h"
+
+SRes HRESULT_To_SRes(HRESULT res, SRes defaultRes) throw()
+{
+ switch (res)
+ {
+ case S_OK: return SZ_OK;
+ case E_OUTOFMEMORY: return SZ_ERROR_MEM;
+ case E_INVALIDARG: return SZ_ERROR_PARAM;
+ case E_ABORT: return SZ_ERROR_PROGRESS;
+ case S_FALSE: return SZ_ERROR_DATA;
+ case E_NOTIMPL: return SZ_ERROR_UNSUPPORTED;
+ }
+ return defaultRes;
+}
+
+
+HRESULT SResToHRESULT(SRes res) throw()
+{
+ switch (res)
+ {
+ case SZ_OK: return S_OK;
+
+ case SZ_ERROR_DATA:
+ case SZ_ERROR_CRC:
+ case SZ_ERROR_INPUT_EOF:
+ return S_FALSE;
+
+ case SZ_ERROR_MEM: return E_OUTOFMEMORY;
+ case SZ_ERROR_PARAM: return E_INVALIDARG;
+ case SZ_ERROR_PROGRESS: return E_ABORT;
+ case SZ_ERROR_UNSUPPORTED: return E_NOTIMPL;
+ // case SZ_ERROR_OUTPUT_EOF:
+ // case SZ_ERROR_READ:
+ // case SZ_ERROR_WRITE:
+ // case SZ_ERROR_THREAD:
+ // case SZ_ERROR_ARCHIVE:
+ // case SZ_ERROR_NO_ARCHIVE:
+ // return E_FAIL;
+ }
+ if (res < 0)
+ return res;
+ return E_FAIL;
+}
+
+
+#define PROGRESS_UNKNOWN_VALUE ((UInt64)(Int64)-1)
+
+#define CONVERT_PR_VAL(x) (x == PROGRESS_UNKNOWN_VALUE ? NULL : &x)
+
+
+static SRes CompressProgress(const ICompressProgress *pp, UInt64 inSize, UInt64 outSize) throw()
+{
+ CCompressProgressWrap *p = CONTAINER_FROM_VTBL(pp, CCompressProgressWrap, vt);
+ p->Res = p->Progress->SetRatioInfo(CONVERT_PR_VAL(inSize), CONVERT_PR_VAL(outSize));
+ return HRESULT_To_SRes(p->Res, SZ_ERROR_PROGRESS);
+}
+
+void CCompressProgressWrap::Init(ICompressProgressInfo *progress) throw()
+{
+ vt.Progress = CompressProgress;
+ Progress = progress;
+ Res = SZ_OK;
+}
+
+static const UInt32 kStreamStepSize = (UInt32)1 << 31;
+
+static SRes MyRead(const ISeqInStream *pp, void *data, size_t *size) throw()
+{
+ CSeqInStreamWrap *p = CONTAINER_FROM_VTBL(pp, CSeqInStreamWrap, vt);
+ UInt32 curSize = ((*size < kStreamStepSize) ? (UInt32)*size : kStreamStepSize);
+ p->Res = (p->Stream->Read(data, curSize, &curSize));
+ *size = curSize;
+ p->Processed += curSize;
+ if (p->Res == S_OK)
+ return SZ_OK;
+ return HRESULT_To_SRes(p->Res, SZ_ERROR_READ);
+}
+
+static size_t MyWrite(const ISeqOutStream *pp, const void *data, size_t size) throw()
+{
+ CSeqOutStreamWrap *p = CONTAINER_FROM_VTBL(pp, CSeqOutStreamWrap, vt);
+ if (p->Stream)
+ {
+ p->Res = WriteStream(p->Stream, data, size);
+ if (p->Res != 0)
+ return 0;
+ }
+ else
+ p->Res = S_OK;
+ p->Processed += size;
+ return size;
+}
+
+
+void CSeqInStreamWrap::Init(ISequentialInStream *stream) throw()
+{
+ vt.Read = MyRead;
+ Stream = stream;
+ Processed = 0;
+ Res = S_OK;
+}
+
+void CSeqOutStreamWrap::Init(ISequentialOutStream *stream) throw()
+{
+ vt.Write = MyWrite;
+ Stream = stream;
+ Res = SZ_OK;
+ Processed = 0;
+}
+
+
+static SRes InStreamWrap_Read(const ISeekInStream *pp, void *data, size_t *size) throw()
+{
+ CSeekInStreamWrap *p = CONTAINER_FROM_VTBL(pp, CSeekInStreamWrap, vt);
+ UInt32 curSize = ((*size < kStreamStepSize) ? (UInt32)*size : kStreamStepSize);
+ p->Res = p->Stream->Read(data, curSize, &curSize);
+ *size = curSize;
+ return (p->Res == S_OK) ? SZ_OK : SZ_ERROR_READ;
+}
+
+static SRes InStreamWrap_Seek(const ISeekInStream *pp, Int64 *offset, ESzSeek origin) throw()
+{
+ CSeekInStreamWrap *p = CONTAINER_FROM_VTBL(pp, CSeekInStreamWrap, vt);
+ UInt32 moveMethod;
+ switch (origin)
+ {
+ case SZ_SEEK_SET: moveMethod = STREAM_SEEK_SET; break;
+ case SZ_SEEK_CUR: moveMethod = STREAM_SEEK_CUR; break;
+ case SZ_SEEK_END: moveMethod = STREAM_SEEK_END; break;
+ default: return SZ_ERROR_PARAM;
+ }
+ UInt64 newPosition;
+ p->Res = p->Stream->Seek(*offset, moveMethod, &newPosition);
+ *offset = (Int64)newPosition;
+ return (p->Res == S_OK) ? SZ_OK : SZ_ERROR_READ;
+}
+
+void CSeekInStreamWrap::Init(IInStream *stream) throw()
+{
+ Stream = stream;
+ vt.Read = InStreamWrap_Read;
+ vt.Seek = InStreamWrap_Seek;
+ Res = S_OK;
+}
+
+
+/* ---------- CByteInBufWrap ---------- */
+
+void CByteInBufWrap::Free() throw()
+{
+ ::MidFree(Buf);
+ Buf = 0;
+}
+
+bool CByteInBufWrap::Alloc(UInt32 size) throw()
+{
+ if (Buf == 0 || size != Size)
+ {
+ Free();
+ Lim = Cur = Buf = (Byte *)::MidAlloc((size_t)size);
+ Size = size;
+ }
+ return (Buf != 0);
+}
+
+Byte CByteInBufWrap::ReadByteFromNewBlock() throw()
+{
+ if (Res == S_OK)
+ {
+ UInt32 avail;
+ Processed += (Cur - Buf);
+ Res = Stream->Read(Buf, Size, &avail);
+ Cur = Buf;
+ Lim = Buf + avail;
+ if (avail != 0)
+ return *Cur++;
+ }
+ Extra = true;
+ return 0;
+}
+
+static Byte Wrap_ReadByte(const IByteIn *pp) throw()
+{
+ CByteInBufWrap *p = CONTAINER_FROM_VTBL_CLS(pp, CByteInBufWrap, vt);
+ if (p->Cur != p->Lim)
+ return *p->Cur++;
+ return p->ReadByteFromNewBlock();
+}
+
+CByteInBufWrap::CByteInBufWrap(): Buf(0)
+{
+ vt.Read = Wrap_ReadByte;
+}
+
+
+/* ---------- CByteOutBufWrap ---------- */
+
+void CByteOutBufWrap::Free() throw()
+{
+ ::MidFree(Buf);
+ Buf = 0;
+}
+
+bool CByteOutBufWrap::Alloc(size_t size) throw()
+{
+ if (Buf == 0 || size != Size)
+ {
+ Free();
+ Buf = (Byte *)::MidAlloc(size);
+ Size = size;
+ }
+ return (Buf != 0);
+}
+
+HRESULT CByteOutBufWrap::Flush() throw()
+{
+ if (Res == S_OK)
+ {
+ size_t size = (Cur - Buf);
+ Res = WriteStream(Stream, Buf, size);
+ if (Res == S_OK)
+ Processed += size;
+ Cur = Buf;
+ }
+ return Res;
+}
+
+static void Wrap_WriteByte(const IByteOut *pp, Byte b) throw()
+{
+ CByteOutBufWrap *p = CONTAINER_FROM_VTBL_CLS(pp, CByteOutBufWrap, vt);
+ Byte *dest = p->Cur;
+ *dest = b;
+ p->Cur = ++dest;
+ if (dest == p->Lim)
+ p->Flush();
+}
+
+CByteOutBufWrap::CByteOutBufWrap() throw(): Buf(0)
+{
+ vt.Write = Wrap_WriteByte;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.h b/other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.h
new file mode 100644
index 0000000000..f93c98adc7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/CWrappers.h
@@ -0,0 +1,120 @@
+// CWrappers.h
+
+#ifndef __C_WRAPPERS_H
+#define __C_WRAPPERS_H
+
+#include "../ICoder.h"
+#include "../../Common/MyCom.h"
+
+SRes HRESULT_To_SRes(HRESULT res, SRes defaultRes) throw();
+HRESULT SResToHRESULT(SRes res) throw();
+
+struct CCompressProgressWrap
+{
+ ICompressProgress vt;
+ ICompressProgressInfo *Progress;
+ HRESULT Res;
+
+ void Init(ICompressProgressInfo *progress) throw();
+};
+
+
+struct CSeqInStreamWrap
+{
+ ISeqInStream vt;
+ ISequentialInStream *Stream;
+ HRESULT Res;
+ UInt64 Processed;
+
+ void Init(ISequentialInStream *stream) throw();
+};
+
+
+struct CSeekInStreamWrap
+{
+ ISeekInStream vt;
+ IInStream *Stream;
+ HRESULT Res;
+
+ void Init(IInStream *stream) throw();
+};
+
+
+struct CSeqOutStreamWrap
+{
+ ISeqOutStream vt;
+ ISequentialOutStream *Stream;
+ HRESULT Res;
+ UInt64 Processed;
+
+ void Init(ISequentialOutStream *stream) throw();
+};
+
+
+struct CByteInBufWrap
+{
+ IByteIn vt;
+ const Byte *Cur;
+ const Byte *Lim;
+ Byte *Buf;
+ UInt32 Size;
+ ISequentialInStream *Stream;
+ UInt64 Processed;
+ bool Extra;
+ HRESULT Res;
+
+ CByteInBufWrap();
+ ~CByteInBufWrap() { Free(); }
+ void Free() throw();
+ bool Alloc(UInt32 size) throw();
+ void Init()
+ {
+ Lim = Cur = Buf;
+ Processed = 0;
+ Extra = false;
+ Res = S_OK;
+ }
+ UInt64 GetProcessed() const { return Processed + (Cur - Buf); }
+ Byte ReadByteFromNewBlock() throw();
+ Byte ReadByte()
+ {
+ if (Cur != Lim)
+ return *Cur++;
+ return ReadByteFromNewBlock();
+ }
+};
+
+
+struct CByteOutBufWrap
+{
+ IByteOut vt;
+ Byte *Cur;
+ const Byte *Lim;
+ Byte *Buf;
+ size_t Size;
+ ISequentialOutStream *Stream;
+ UInt64 Processed;
+ HRESULT Res;
+
+ CByteOutBufWrap() throw();
+ ~CByteOutBufWrap() { Free(); }
+ void Free() throw();
+ bool Alloc(size_t size) throw();
+ void Init()
+ {
+ Cur = Buf;
+ Lim = Buf + Size;
+ Processed = 0;
+ Res = S_OK;
+ }
+ UInt64 GetProcessed() const { return Processed + (Cur - Buf); }
+ HRESULT Flush() throw();
+ void WriteByte(Byte b)
+ {
+ *Cur++ = b;
+ if (Cur == Lim)
+ Flush();
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.cpp
new file mode 100644
index 0000000000..5040765731
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.cpp
@@ -0,0 +1,536 @@
+// CreateCoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../Windows/Defs.h"
+#include "../../Windows/PropVariant.h"
+
+#include "CreateCoder.h"
+
+#include "FilterCoder.h"
+#include "RegisterCodec.h"
+
+static const unsigned kNumCodecsMax = 64;
+unsigned g_NumCodecs = 0;
+const CCodecInfo *g_Codecs[kNumCodecsMax];
+
+// We use g_ExternalCodecs in other stages.
+/*
+#ifdef EXTERNAL_CODECS
+extern CExternalCodecs g_ExternalCodecs;
+#define CHECK_GLOBAL_CODECS \
+ if (!__externalCodecs || !__externalCodecs->IsSet()) __externalCodecs = &g_ExternalCodecs;
+#endif
+*/
+
+#define CHECK_GLOBAL_CODECS
+
+void RegisterCodec(const CCodecInfo *codecInfo) throw()
+{
+ if (g_NumCodecs < kNumCodecsMax)
+ g_Codecs[g_NumCodecs++] = codecInfo;
+}
+
+static const unsigned kNumHashersMax = 16;
+unsigned g_NumHashers = 0;
+const CHasherInfo *g_Hashers[kNumHashersMax];
+
+void RegisterHasher(const CHasherInfo *hashInfo) throw()
+{
+ if (g_NumHashers < kNumHashersMax)
+ g_Hashers[g_NumHashers++] = hashInfo;
+}
+
+
+#ifdef EXTERNAL_CODECS
+
+static HRESULT ReadNumberOfStreams(ICompressCodecsInfo *codecsInfo, UInt32 index, PROPID propID, UInt32 &res)
+{
+ NWindows::NCOM::CPropVariant prop;
+ RINOK(codecsInfo->GetProperty(index, propID, &prop));
+ if (prop.vt == VT_EMPTY)
+ res = 1;
+ else if (prop.vt == VT_UI4)
+ res = prop.ulVal;
+ else
+ return E_INVALIDARG;
+ return S_OK;
+}
+
+static HRESULT ReadIsAssignedProp(ICompressCodecsInfo *codecsInfo, UInt32 index, PROPID propID, bool &res)
+{
+ NWindows::NCOM::CPropVariant prop;
+ RINOK(codecsInfo->GetProperty(index, propID, &prop));
+ if (prop.vt == VT_EMPTY)
+ res = true;
+ else if (prop.vt == VT_BOOL)
+ res = VARIANT_BOOLToBool(prop.boolVal);
+ else
+ return E_INVALIDARG;
+ return S_OK;
+}
+
+HRESULT CExternalCodecs::Load()
+{
+ Codecs.Clear();
+ Hashers.Clear();
+
+ if (GetCodecs)
+ {
+ CCodecInfoEx info;
+
+ UString s;
+ UInt32 num;
+ RINOK(GetCodecs->GetNumMethods(&num));
+
+ for (UInt32 i = 0; i < num; i++)
+ {
+ NWindows::NCOM::CPropVariant prop;
+
+ RINOK(GetCodecs->GetProperty(i, NMethodPropID::kID, &prop));
+ if (prop.vt != VT_UI8)
+ continue; // old Interface
+ info.Id = prop.uhVal.QuadPart;
+
+ prop.Clear();
+
+ info.Name.Empty();
+ RINOK(GetCodecs->GetProperty(i, NMethodPropID::kName, &prop));
+ if (prop.vt == VT_BSTR)
+ info.Name.SetFromWStr_if_Ascii(prop.bstrVal);
+ else if (prop.vt != VT_EMPTY)
+ continue;
+
+ RINOK(ReadNumberOfStreams(GetCodecs, i, NMethodPropID::kPackStreams, info.NumStreams));
+ {
+ UInt32 numUnpackStreams = 1;
+ RINOK(ReadNumberOfStreams(GetCodecs, i, NMethodPropID::kUnpackStreams, numUnpackStreams));
+ if (numUnpackStreams != 1)
+ continue;
+ }
+ RINOK(ReadIsAssignedProp(GetCodecs, i, NMethodPropID::kEncoderIsAssigned, info.EncoderIsAssigned));
+ RINOK(ReadIsAssignedProp(GetCodecs, i, NMethodPropID::kDecoderIsAssigned, info.DecoderIsAssigned));
+
+ Codecs.Add(info);
+ }
+ }
+
+ if (GetHashers)
+ {
+ UInt32 num = GetHashers->GetNumHashers();
+ CHasherInfoEx info;
+
+ for (UInt32 i = 0; i < num; i++)
+ {
+ NWindows::NCOM::CPropVariant prop;
+
+ RINOK(GetHashers->GetHasherProp(i, NMethodPropID::kID, &prop));
+ if (prop.vt != VT_UI8)
+ continue;
+ info.Id = prop.uhVal.QuadPart;
+
+ prop.Clear();
+
+ info.Name.Empty();
+ RINOK(GetHashers->GetHasherProp(i, NMethodPropID::kName, &prop));
+ if (prop.vt == VT_BSTR)
+ info.Name.SetFromWStr_if_Ascii(prop.bstrVal);
+ else if (prop.vt != VT_EMPTY)
+ continue;
+
+ Hashers.Add(info);
+ }
+ }
+
+ return S_OK;
+}
+
+#endif
+
+
+int FindMethod_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const AString &name,
+ bool encode,
+ CMethodId &methodId,
+ UInt32 &numStreams)
+{
+ unsigned i;
+ for (i = 0; i < g_NumCodecs; i++)
+ {
+ const CCodecInfo &codec = *g_Codecs[i];
+ if ((encode ? codec.CreateEncoder : codec.CreateDecoder)
+ && StringsAreEqualNoCase_Ascii(name, codec.Name))
+ {
+ methodId = codec.Id;
+ numStreams = codec.NumStreams;
+ return i;
+ }
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (__externalCodecs)
+ for (i = 0; i < __externalCodecs->Codecs.Size(); i++)
+ {
+ const CCodecInfoEx &codec = __externalCodecs->Codecs[i];
+ if ((encode ? codec.EncoderIsAssigned : codec.DecoderIsAssigned)
+ && StringsAreEqualNoCase_Ascii(name, codec.Name))
+ {
+ methodId = codec.Id;
+ numStreams = codec.NumStreams;
+ return g_NumCodecs + i;
+ }
+ }
+
+ #endif
+
+ return -1;
+}
+
+
+static int FindMethod_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode)
+{
+ unsigned i;
+ for (i = 0; i < g_NumCodecs; i++)
+ {
+ const CCodecInfo &codec = *g_Codecs[i];
+ if (codec.Id == methodId && (encode ? codec.CreateEncoder : codec.CreateDecoder))
+ return i;
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (__externalCodecs)
+ for (i = 0; i < __externalCodecs->Codecs.Size(); i++)
+ {
+ const CCodecInfoEx &codec = __externalCodecs->Codecs[i];
+ if (codec.Id == methodId && (encode ? codec.EncoderIsAssigned : codec.DecoderIsAssigned))
+ return g_NumCodecs + i;
+ }
+
+ #endif
+
+ return -1;
+}
+
+
+bool FindMethod(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId,
+ AString &name)
+{
+ name.Empty();
+
+ unsigned i;
+ for (i = 0; i < g_NumCodecs; i++)
+ {
+ const CCodecInfo &codec = *g_Codecs[i];
+ if (methodId == codec.Id)
+ {
+ name = codec.Name;
+ return true;
+ }
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (__externalCodecs)
+ for (i = 0; i < __externalCodecs->Codecs.Size(); i++)
+ {
+ const CCodecInfoEx &codec = __externalCodecs->Codecs[i];
+ if (methodId == codec.Id)
+ {
+ name = codec.Name;
+ return true;
+ }
+ }
+
+ #endif
+
+ return false;
+}
+
+bool FindHashMethod(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const AString &name,
+ CMethodId &methodId)
+{
+ unsigned i;
+ for (i = 0; i < g_NumHashers; i++)
+ {
+ const CHasherInfo &codec = *g_Hashers[i];
+ if (StringsAreEqualNoCase_Ascii(name, codec.Name))
+ {
+ methodId = codec.Id;
+ return true;
+ }
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (__externalCodecs)
+ for (i = 0; i < __externalCodecs->Hashers.Size(); i++)
+ {
+ const CHasherInfoEx &codec = __externalCodecs->Hashers[i];
+ if (StringsAreEqualNoCase_Ascii(name, codec.Name))
+ {
+ methodId = codec.Id;
+ return true;
+ }
+ }
+
+ #endif
+
+ return false;
+}
+
+void GetHashMethods(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CRecordVector<CMethodId> &methods)
+{
+ methods.ClearAndSetSize(g_NumHashers);
+ unsigned i;
+ for (i = 0; i < g_NumHashers; i++)
+ methods[i] = (*g_Hashers[i]).Id;
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (__externalCodecs)
+ for (i = 0; i < __externalCodecs->Hashers.Size(); i++)
+ methods.Add(__externalCodecs->Hashers[i].Id);
+
+ #endif
+}
+
+
+
+HRESULT CreateCoder_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ unsigned i, bool encode,
+ CMyComPtr<ICompressFilter> &filter,
+ CCreatedCoder &cod)
+{
+ cod.IsExternal = false;
+ cod.IsFilter = false;
+ cod.NumStreams = 1;
+
+ if (i < g_NumCodecs)
+ {
+ const CCodecInfo &codec = *g_Codecs[i];
+ // if (codec.Id == methodId)
+ {
+ if (encode)
+ {
+ if (codec.CreateEncoder)
+ {
+ void *p = codec.CreateEncoder();
+ if (codec.IsFilter) filter = (ICompressFilter *)p;
+ else if (codec.NumStreams == 1) cod.Coder = (ICompressCoder *)p;
+ else { cod.Coder2 = (ICompressCoder2 *)p; cod.NumStreams = codec.NumStreams; }
+ return S_OK;
+ }
+ }
+ else
+ if (codec.CreateDecoder)
+ {
+ void *p = codec.CreateDecoder();
+ if (codec.IsFilter) filter = (ICompressFilter *)p;
+ else if (codec.NumStreams == 1) cod.Coder = (ICompressCoder *)p;
+ else { cod.Coder2 = (ICompressCoder2 *)p; cod.NumStreams = codec.NumStreams; }
+ return S_OK;
+ }
+ }
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (__externalCodecs)
+ {
+ i -= g_NumCodecs;
+ cod.IsExternal = true;
+ if (i < __externalCodecs->Codecs.Size())
+ {
+ const CCodecInfoEx &codec = __externalCodecs->Codecs[i];
+ // if (codec.Id == methodId)
+ {
+ if (encode)
+ {
+ if (codec.EncoderIsAssigned)
+ {
+ if (codec.NumStreams == 1)
+ {
+ HRESULT res = __externalCodecs->GetCodecs->CreateEncoder(i, &IID_ICompressCoder, (void **)&cod.Coder);
+ if (res != S_OK && res != E_NOINTERFACE && res != CLASS_E_CLASSNOTAVAILABLE)
+ return res;
+ if (cod.Coder)
+ return res;
+ return __externalCodecs->GetCodecs->CreateEncoder(i, &IID_ICompressFilter, (void **)&filter);
+ }
+ cod.NumStreams = codec.NumStreams;
+ return __externalCodecs->GetCodecs->CreateEncoder(i, &IID_ICompressCoder2, (void **)&cod.Coder2);
+ }
+ }
+ else
+ if (codec.DecoderIsAssigned)
+ {
+ if (codec.NumStreams == 1)
+ {
+ HRESULT res = __externalCodecs->GetCodecs->CreateDecoder(i, &IID_ICompressCoder, (void **)&cod.Coder);
+ if (res != S_OK && res != E_NOINTERFACE && res != CLASS_E_CLASSNOTAVAILABLE)
+ return res;
+ if (cod.Coder)
+ return res;
+ return __externalCodecs->GetCodecs->CreateDecoder(i, &IID_ICompressFilter, (void **)&filter);
+ }
+ cod.NumStreams = codec.NumStreams;
+ return __externalCodecs->GetCodecs->CreateDecoder(i, &IID_ICompressCoder2, (void **)&cod.Coder2);
+ }
+ }
+ }
+ }
+ #endif
+
+ return S_OK;
+}
+
+
+HRESULT CreateCoder_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ unsigned index, bool encode,
+ CCreatedCoder &cod)
+{
+ CMyComPtr<ICompressFilter> filter;
+ HRESULT res = CreateCoder_Index(
+ EXTERNAL_CODECS_LOC_VARS
+ index, encode,
+ filter, cod);
+
+ if (filter)
+ {
+ cod.IsFilter = true;
+ CFilterCoder *coderSpec = new CFilterCoder(encode);
+ cod.Coder = coderSpec;
+ coderSpec->Filter = filter;
+ }
+
+ return res;
+}
+
+
+HRESULT CreateCoder_Id(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CMyComPtr<ICompressFilter> &filter,
+ CCreatedCoder &cod)
+{
+ int index = FindMethod_Index(EXTERNAL_CODECS_LOC_VARS methodId, encode);
+ if (index < 0)
+ return S_OK;
+ return CreateCoder_Index(EXTERNAL_CODECS_LOC_VARS index, encode, filter, cod);
+}
+
+
+HRESULT CreateCoder_Id(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CCreatedCoder &cod)
+{
+ CMyComPtr<ICompressFilter> filter;
+ HRESULT res = CreateCoder_Id(
+ EXTERNAL_CODECS_LOC_VARS
+ methodId, encode,
+ filter, cod);
+
+ if (filter)
+ {
+ cod.IsFilter = true;
+ CFilterCoder *coderSpec = new CFilterCoder(encode);
+ cod.Coder = coderSpec;
+ coderSpec->Filter = filter;
+ }
+
+ return res;
+}
+
+
+HRESULT CreateCoder_Id(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CMyComPtr<ICompressCoder> &coder)
+{
+ CCreatedCoder cod;
+ HRESULT res = CreateCoder_Id(
+ EXTERNAL_CODECS_LOC_VARS
+ methodId, encode,
+ cod);
+ coder = cod.Coder;
+ return res;
+}
+
+HRESULT CreateFilter(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CMyComPtr<ICompressFilter> &filter)
+{
+ CCreatedCoder cod;
+ return CreateCoder_Id(
+ EXTERNAL_CODECS_LOC_VARS
+ methodId, encode,
+ filter, cod);
+}
+
+
+HRESULT CreateHasher(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId,
+ AString &name,
+ CMyComPtr<IHasher> &hasher)
+{
+ name.Empty();
+
+ unsigned i;
+ for (i = 0; i < g_NumHashers; i++)
+ {
+ const CHasherInfo &codec = *g_Hashers[i];
+ if (codec.Id == methodId)
+ {
+ hasher = codec.CreateHasher();
+ name = codec.Name;
+ break;
+ }
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ CHECK_GLOBAL_CODECS
+
+ if (!hasher && __externalCodecs)
+ for (i = 0; i < __externalCodecs->Hashers.Size(); i++)
+ {
+ const CHasherInfoEx &codec = __externalCodecs->Hashers[i];
+ if (codec.Id == methodId)
+ {
+ name = codec.Name;
+ return __externalCodecs->GetHashers->CreateHasher((UInt32)i, &hasher);
+ }
+ }
+
+ #endif
+
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.h b/other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.h
new file mode 100644
index 0000000000..2105818fbf
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/CreateCoder.h
@@ -0,0 +1,192 @@
+// CreateCoder.h
+
+#ifndef __CREATE_CODER_H
+#define __CREATE_CODER_H
+
+#include "../../Common/MyCom.h"
+#include "../../Common/MyString.h"
+
+#include "../ICoder.h"
+
+#include "MethodId.h"
+
+/*
+ if EXTERNAL_CODECS is not defined, the code supports only codecs that
+ are statically linked at compile-time and link-time.
+
+ if EXTERNAL_CODECS is defined, the code supports also codecs from another
+ executable modules, that can be linked dynamically at run-time:
+ - EXE module can use codecs from external DLL files.
+ - DLL module can use codecs from external EXE and DLL files.
+
+ CExternalCodecs contains information about codecs and interfaces to create them.
+
+ The order of codecs:
+ 1) Internal codecs
+ 2) External codecs
+*/
+
+#ifdef EXTERNAL_CODECS
+
+struct CCodecInfoEx
+{
+ CMethodId Id;
+ AString Name;
+ UInt32 NumStreams;
+ bool EncoderIsAssigned;
+ bool DecoderIsAssigned;
+
+ CCodecInfoEx(): EncoderIsAssigned(false), DecoderIsAssigned(false) {}
+};
+
+struct CHasherInfoEx
+{
+ CMethodId Id;
+ AString Name;
+};
+
+#define PUBLIC_ISetCompressCodecsInfo public ISetCompressCodecsInfo,
+#define QUERY_ENTRY_ISetCompressCodecsInfo MY_QUERYINTERFACE_ENTRY(ISetCompressCodecsInfo)
+#define DECL_ISetCompressCodecsInfo STDMETHOD(SetCompressCodecsInfo)(ICompressCodecsInfo *compressCodecsInfo);
+#define IMPL_ISetCompressCodecsInfo2(x) \
+STDMETHODIMP x::SetCompressCodecsInfo(ICompressCodecsInfo *compressCodecsInfo) { \
+ COM_TRY_BEGIN __externalCodecs.GetCodecs = compressCodecsInfo; return __externalCodecs.Load(); COM_TRY_END }
+#define IMPL_ISetCompressCodecsInfo IMPL_ISetCompressCodecsInfo2(CHandler)
+
+struct CExternalCodecs
+{
+ CMyComPtr<ICompressCodecsInfo> GetCodecs;
+ CMyComPtr<IHashers> GetHashers;
+
+ CObjectVector<CCodecInfoEx> Codecs;
+ CObjectVector<CHasherInfoEx> Hashers;
+
+ bool IsSet() const { return GetCodecs != NULL || GetHashers != NULL; }
+
+ HRESULT Load();
+
+ void ClearAndRelease()
+ {
+ Hashers.Clear();
+ Codecs.Clear();
+ GetHashers.Release();
+ GetCodecs.Release();
+ }
+
+ ~CExternalCodecs()
+ {
+ GetHashers.Release();
+ GetCodecs.Release();
+ }
+};
+
+extern CExternalCodecs g_ExternalCodecs;
+
+#define EXTERNAL_CODECS_VARS2 (__externalCodecs.IsSet() ? &__externalCodecs : &g_ExternalCodecs)
+#define EXTERNAL_CODECS_VARS2_L (&__externalCodecs)
+#define EXTERNAL_CODECS_VARS2_G (&g_ExternalCodecs)
+
+#define DECL_EXTERNAL_CODECS_VARS CExternalCodecs __externalCodecs;
+
+#define EXTERNAL_CODECS_VARS EXTERNAL_CODECS_VARS2,
+#define EXTERNAL_CODECS_VARS_L EXTERNAL_CODECS_VARS2_L,
+#define EXTERNAL_CODECS_VARS_G EXTERNAL_CODECS_VARS2_G,
+
+#define DECL_EXTERNAL_CODECS_LOC_VARS2 const CExternalCodecs *__externalCodecs
+#define EXTERNAL_CODECS_LOC_VARS2 __externalCodecs
+
+#define DECL_EXTERNAL_CODECS_LOC_VARS DECL_EXTERNAL_CODECS_LOC_VARS2,
+#define EXTERNAL_CODECS_LOC_VARS EXTERNAL_CODECS_LOC_VARS2,
+
+#else
+
+#define PUBLIC_ISetCompressCodecsInfo
+#define QUERY_ENTRY_ISetCompressCodecsInfo
+#define DECL_ISetCompressCodecsInfo
+#define IMPL_ISetCompressCodecsInfo
+#define EXTERNAL_CODECS_VARS2
+#define DECL_EXTERNAL_CODECS_VARS
+#define EXTERNAL_CODECS_VARS
+#define EXTERNAL_CODECS_VARS_L
+#define EXTERNAL_CODECS_VARS_G
+#define DECL_EXTERNAL_CODECS_LOC_VARS2
+#define EXTERNAL_CODECS_LOC_VARS2
+#define DECL_EXTERNAL_CODECS_LOC_VARS
+#define EXTERNAL_CODECS_LOC_VARS
+
+#endif
+
+int FindMethod_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const AString &name,
+ bool encode,
+ CMethodId &methodId,
+ UInt32 &numStreams);
+
+bool FindMethod(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId,
+ AString &name);
+
+bool FindHashMethod(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const AString &name,
+ CMethodId &methodId);
+
+void GetHashMethods(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CRecordVector<CMethodId> &methods);
+
+
+struct CCreatedCoder
+{
+ CMyComPtr<ICompressCoder> Coder;
+ CMyComPtr<ICompressCoder2> Coder2;
+
+ bool IsExternal;
+ bool IsFilter; // = true, if Coder was created from filter
+ UInt32 NumStreams;
+
+ // CCreatedCoder(): IsExternal(false), IsFilter(false), NumStreams(1) {}
+};
+
+
+HRESULT CreateCoder_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ unsigned codecIndex, bool encode,
+ CMyComPtr<ICompressFilter> &filter,
+ CCreatedCoder &cod);
+
+HRESULT CreateCoder_Index(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ unsigned index, bool encode,
+ CCreatedCoder &cod);
+
+HRESULT CreateCoder_Id(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CMyComPtr<ICompressFilter> &filter,
+ CCreatedCoder &cod);
+
+HRESULT CreateCoder_Id(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CCreatedCoder &cod);
+
+HRESULT CreateCoder_Id(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CMyComPtr<ICompressCoder> &coder);
+
+HRESULT CreateFilter(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId, bool encode,
+ CMyComPtr<ICompressFilter> &filter);
+
+HRESULT CreateHasher(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ CMethodId methodId,
+ AString &name,
+ CMyComPtr<IHasher> &hasher);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.cpp
new file mode 100644
index 0000000000..84c9e2bce8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.cpp
@@ -0,0 +1,46 @@
+// FilePathAutoRename.cpp
+
+#include "StdAfx.h"
+
+#include "../../Windows/FileFind.h"
+
+#include "FilePathAutoRename.h"
+
+using namespace NWindows;
+
+static bool MakeAutoName(const FString &name,
+ const FString &extension, UInt32 value, FString &path)
+{
+ path = name;
+ path.Add_UInt32(value);
+ path += extension;
+ return NFile::NFind::DoesFileOrDirExist(path);
+}
+
+bool AutoRenamePath(FString &path)
+{
+ int dotPos = path.ReverseFind_Dot();
+ int slashPos = path.ReverseFind_PathSepar();
+
+ FString name = path;
+ FString extension;
+ if (dotPos > slashPos + 1)
+ {
+ name.DeleteFrom(dotPos);
+ extension = path.Ptr(dotPos);
+ }
+ name += '_';
+
+ FString temp;
+
+ UInt32 left = 1, right = ((UInt32)1 << 30);
+ while (left != right)
+ {
+ UInt32 mid = (left + right) / 2;
+ if (MakeAutoName(name, extension, mid, temp))
+ left = mid + 1;
+ else
+ right = mid;
+ }
+ return !MakeAutoName(name, extension, right, path);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.h b/other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.h
new file mode 100644
index 0000000000..cb2d71b409
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/FilePathAutoRename.h
@@ -0,0 +1,10 @@
+// FilePathAutoRename.h
+
+#ifndef __FILE_PATH_AUTO_RENAME_H
+#define __FILE_PATH_AUTO_RENAME_H
+
+#include "../../Common/MyString.h"
+
+bool AutoRenamePath(FString &fullProcessedPath);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.cpp
new file mode 100644
index 0000000000..11c14d219d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.cpp
@@ -0,0 +1,475 @@
+// FileStreams.cpp
+
+#include "StdAfx.h"
+
+#ifndef _WIN32
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#endif
+
+#ifdef SUPPORT_DEVICE_FILE
+#include "../../../C/Alloc.h"
+#include "../../Common/Defs.h"
+#endif
+
+#include "FileStreams.h"
+
+static inline HRESULT ConvertBoolToHRESULT(bool result)
+{
+ #ifdef _WIN32
+ if (result)
+ return S_OK;
+ DWORD lastError = ::GetLastError();
+ if (lastError == 0)
+ return E_FAIL;
+ return HRESULT_FROM_WIN32(lastError);
+ #else
+ return result ? S_OK: E_FAIL;
+ #endif
+}
+
+
+static const UInt32 kClusterSize = 1 << 18;
+CInFileStream::CInFileStream():
+ #ifdef SUPPORT_DEVICE_FILE
+ VirtPos(0),
+ PhyPos(0),
+ Buf(0),
+ BufSize(0),
+ #endif
+ SupportHardLinks(false),
+ Callback(NULL),
+ CallbackRef(0)
+{
+}
+
+CInFileStream::~CInFileStream()
+{
+ #ifdef SUPPORT_DEVICE_FILE
+ MidFree(Buf);
+ #endif
+
+ if (Callback)
+ Callback->InFileStream_On_Destroy(CallbackRef);
+}
+
+STDMETHODIMP CInFileStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ #ifdef USE_WIN_FILE
+
+ #ifdef SUPPORT_DEVICE_FILE
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ if (File.IsDeviceFile)
+ {
+ if (File.SizeDefined)
+ {
+ if (VirtPos >= File.Size)
+ return VirtPos == File.Size ? S_OK : E_FAIL;
+ UInt64 rem = File.Size - VirtPos;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ for (;;)
+ {
+ const UInt32 mask = kClusterSize - 1;
+ const UInt64 mask2 = ~(UInt64)mask;
+ UInt64 alignedPos = VirtPos & mask2;
+ if (BufSize > 0 && BufStartPos == alignedPos)
+ {
+ UInt32 pos = (UInt32)VirtPos & mask;
+ if (pos >= BufSize)
+ return S_OK;
+ UInt32 rem = MyMin(BufSize - pos, size);
+ memcpy(data, Buf + pos, rem);
+ VirtPos += rem;
+ if (processedSize)
+ *processedSize += rem;
+ return S_OK;
+ }
+
+ bool useBuf = false;
+ if ((VirtPos & mask) != 0 || ((ptrdiff_t)data & mask) != 0 )
+ useBuf = true;
+ else
+ {
+ UInt64 end = VirtPos + size;
+ if ((end & mask) != 0)
+ {
+ end &= mask2;
+ if (end <= VirtPos)
+ useBuf = true;
+ else
+ size = (UInt32)(end - VirtPos);
+ }
+ }
+ if (!useBuf)
+ break;
+ if (alignedPos != PhyPos)
+ {
+ UInt64 realNewPosition;
+ bool result = File.Seek(alignedPos, FILE_BEGIN, realNewPosition);
+ if (!result)
+ return ConvertBoolToHRESULT(result);
+ PhyPos = realNewPosition;
+ }
+
+ BufStartPos = alignedPos;
+ UInt32 readSize = kClusterSize;
+ if (File.SizeDefined)
+ readSize = (UInt32)MyMin(File.Size - PhyPos, (UInt64)kClusterSize);
+
+ if (!Buf)
+ {
+ Buf = (Byte *)MidAlloc(kClusterSize);
+ if (!Buf)
+ return E_OUTOFMEMORY;
+ }
+ bool result = File.Read1(Buf, readSize, BufSize);
+ if (!result)
+ return ConvertBoolToHRESULT(result);
+
+ if (BufSize == 0)
+ return S_OK;
+ PhyPos += BufSize;
+ }
+
+ if (VirtPos != PhyPos)
+ {
+ UInt64 realNewPosition;
+ bool result = File.Seek(VirtPos, FILE_BEGIN, realNewPosition);
+ if (!result)
+ return ConvertBoolToHRESULT(result);
+ PhyPos = VirtPos = realNewPosition;
+ }
+ }
+ #endif
+
+ UInt32 realProcessedSize;
+ bool result = File.ReadPart(data, size, realProcessedSize);
+ if (processedSize)
+ *processedSize = realProcessedSize;
+
+ #ifdef SUPPORT_DEVICE_FILE
+ VirtPos += realProcessedSize;
+ PhyPos += realProcessedSize;
+ #endif
+
+ if (result)
+ return S_OK;
+
+ {
+ DWORD error = ::GetLastError();
+
+ if (Callback)
+ return Callback->InFileStream_On_Error(CallbackRef, error);
+ if (error == 0)
+ return E_FAIL;
+
+ return HRESULT_FROM_WIN32(error);
+ }
+
+ #else
+
+ if (processedSize)
+ *processedSize = 0;
+ ssize_t res = File.Read(data, (size_t)size);
+ if (res == -1)
+ {
+ if (Callback)
+ return Callback->InFileStream_On_Error(CallbackRef, E_FAIL);
+ return E_FAIL;
+ }
+ if (processedSize)
+ *processedSize = (UInt32)res;
+ return S_OK;
+
+ #endif
+}
+
+#ifdef UNDER_CE
+STDMETHODIMP CStdInFileStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ size_t s2 = fread(data, 1, size, stdin);
+ int error = ferror(stdin);
+ if (processedSize)
+ *processedSize = s2;
+ if (s2 <= size && error == 0)
+ return S_OK;
+ return E_FAIL;
+}
+#else
+STDMETHODIMP CStdInFileStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ #ifdef _WIN32
+
+ DWORD realProcessedSize;
+ UInt32 sizeTemp = (1 << 20);
+ if (sizeTemp > size)
+ sizeTemp = size;
+ BOOL res = ::ReadFile(GetStdHandle(STD_INPUT_HANDLE), data, sizeTemp, &realProcessedSize, NULL);
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ if (res == FALSE && GetLastError() == ERROR_BROKEN_PIPE)
+ return S_OK;
+ return ConvertBoolToHRESULT(res != FALSE);
+
+ #else
+
+ if (processedSize)
+ *processedSize = 0;
+ ssize_t res;
+ do
+ {
+ res = read(0, data, (size_t)size);
+ }
+ while (res < 0 && (errno == EINTR));
+ if (res == -1)
+ return E_FAIL;
+ if (processedSize)
+ *processedSize = (UInt32)res;
+ return S_OK;
+
+ #endif
+}
+
+#endif
+
+STDMETHODIMP CInFileStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ if (seekOrigin >= 3)
+ return STG_E_INVALIDFUNCTION;
+
+ #ifdef USE_WIN_FILE
+
+ #ifdef SUPPORT_DEVICE_FILE
+ if (File.IsDeviceFile && (File.SizeDefined || seekOrigin != STREAM_SEEK_END))
+ {
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += VirtPos; break;
+ case STREAM_SEEK_END: offset += File.Size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ VirtPos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+ }
+ #endif
+
+ UInt64 realNewPosition;
+ bool result = File.Seek(offset, seekOrigin, realNewPosition);
+
+ #ifdef SUPPORT_DEVICE_FILE
+ PhyPos = VirtPos = realNewPosition;
+ #endif
+
+ if (newPosition)
+ *newPosition = realNewPosition;
+ return ConvertBoolToHRESULT(result);
+
+ #else
+
+ off_t res = File.Seek((off_t)offset, seekOrigin);
+ if (res == -1)
+ return E_FAIL;
+ if (newPosition)
+ *newPosition = (UInt64)res;
+ return S_OK;
+
+ #endif
+}
+
+STDMETHODIMP CInFileStream::GetSize(UInt64 *size)
+{
+ return ConvertBoolToHRESULT(File.GetLength(*size));
+}
+
+#ifdef USE_WIN_FILE
+
+STDMETHODIMP CInFileStream::GetProps(UInt64 *size, FILETIME *cTime, FILETIME *aTime, FILETIME *mTime, UInt32 *attrib)
+{
+ BY_HANDLE_FILE_INFORMATION info;
+ if (File.GetFileInformation(&info))
+ {
+ if (size) *size = (((UInt64)info.nFileSizeHigh) << 32) + info.nFileSizeLow;
+ if (cTime) *cTime = info.ftCreationTime;
+ if (aTime) *aTime = info.ftLastAccessTime;
+ if (mTime) *mTime = info.ftLastWriteTime;
+ if (attrib) *attrib = info.dwFileAttributes;
+ return S_OK;
+ }
+ return GetLastError();
+}
+
+STDMETHODIMP CInFileStream::GetProps2(CStreamFileProps *props)
+{
+ BY_HANDLE_FILE_INFORMATION info;
+ if (File.GetFileInformation(&info))
+ {
+ props->Size = (((UInt64)info.nFileSizeHigh) << 32) + info.nFileSizeLow;
+ props->VolID = info.dwVolumeSerialNumber;
+ props->FileID_Low = (((UInt64)info.nFileIndexHigh) << 32) + info.nFileIndexLow;
+ props->FileID_High = 0;
+ props->NumLinks = SupportHardLinks ? info.nNumberOfLinks : 1;
+ props->Attrib = info.dwFileAttributes;
+ props->CTime = info.ftCreationTime;
+ props->ATime = info.ftLastAccessTime;
+ props->MTime = info.ftLastWriteTime;
+ return S_OK;
+ }
+ return GetLastError();
+}
+
+#endif
+
+//////////////////////////
+// COutFileStream
+
+HRESULT COutFileStream::Close()
+{
+ return ConvertBoolToHRESULT(File.Close());
+}
+
+STDMETHODIMP COutFileStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ #ifdef USE_WIN_FILE
+
+ UInt32 realProcessedSize;
+ bool result = File.Write(data, size, realProcessedSize);
+ ProcessedSize += realProcessedSize;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return ConvertBoolToHRESULT(result);
+
+ #else
+
+ if (processedSize)
+ *processedSize = 0;
+ ssize_t res = File.Write(data, (size_t)size);
+ if (res == -1)
+ return E_FAIL;
+ if (processedSize)
+ *processedSize = (UInt32)res;
+ ProcessedSize += res;
+ return S_OK;
+
+ #endif
+}
+
+STDMETHODIMP COutFileStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ if (seekOrigin >= 3)
+ return STG_E_INVALIDFUNCTION;
+
+ #ifdef USE_WIN_FILE
+
+ UInt64 realNewPosition;
+ bool result = File.Seek(offset, seekOrigin, realNewPosition);
+ if (newPosition)
+ *newPosition = realNewPosition;
+ return ConvertBoolToHRESULT(result);
+
+ #else
+
+ off_t res = File.Seek((off_t)offset, seekOrigin);
+ if (res == -1)
+ return E_FAIL;
+ if (newPosition)
+ *newPosition = (UInt64)res;
+ return S_OK;
+
+ #endif
+}
+
+STDMETHODIMP COutFileStream::SetSize(UInt64 newSize)
+{
+ #ifdef USE_WIN_FILE
+
+ UInt64 currentPos;
+ if (!File.Seek(0, FILE_CURRENT, currentPos))
+ return E_FAIL;
+ bool result = File.SetLength(newSize);
+ UInt64 currentPos2;
+ result = result && File.Seek(currentPos, currentPos2);
+ return result ? S_OK : E_FAIL;
+
+ #else
+
+ return E_FAIL;
+
+ #endif
+}
+
+HRESULT COutFileStream::GetSize(UInt64 *size)
+{
+ return ConvertBoolToHRESULT(File.GetLength(*size));
+}
+
+#ifdef UNDER_CE
+
+STDMETHODIMP CStdOutFileStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ size_t s2 = fwrite(data, 1, size, stdout);
+ if (processedSize)
+ *processedSize = s2;
+ return (s2 == size) ? S_OK : E_FAIL;
+}
+
+#else
+
+STDMETHODIMP CStdOutFileStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ #ifdef _WIN32
+
+ UInt32 realProcessedSize;
+ BOOL res = TRUE;
+ if (size > 0)
+ {
+ // Seems that Windows doesn't like big amounts writing to stdout.
+ // So we limit portions by 32KB.
+ UInt32 sizeTemp = (1 << 15);
+ if (sizeTemp > size)
+ sizeTemp = size;
+ res = ::WriteFile(GetStdHandle(STD_OUTPUT_HANDLE),
+ data, sizeTemp, (DWORD *)&realProcessedSize, NULL);
+ _size += realProcessedSize;
+ size -= realProcessedSize;
+ data = (const void *)((const Byte *)data + realProcessedSize);
+ if (processedSize)
+ *processedSize += realProcessedSize;
+ }
+ return ConvertBoolToHRESULT(res != FALSE);
+
+ #else
+
+ ssize_t res;
+
+ do
+ {
+ res = write(1, data, (size_t)size);
+ }
+ while (res < 0 && (errno == EINTR));
+
+ if (res == -1)
+ return E_FAIL;
+
+ _size += (size_t)res;
+ if (processedSize)
+ *processedSize = (UInt32)res;
+ return S_OK;
+
+ #endif
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.h b/other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.h
new file mode 100644
index 0000000000..a0996f80ac
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/FileStreams.h
@@ -0,0 +1,166 @@
+// FileStreams.h
+
+#ifndef __FILE_STREAMS_H
+#define __FILE_STREAMS_H
+
+#ifdef _WIN32
+#define USE_WIN_FILE
+#endif
+
+#include "../../Common/MyString.h"
+
+#ifdef USE_WIN_FILE
+#include "../../Windows/FileIO.h"
+#else
+#include "../../Common/C_FileIO.h"
+#endif
+
+#include "../../Common/MyCom.h"
+
+#include "../IStream.h"
+
+#ifdef _WIN32
+typedef UINT_PTR My_UINT_PTR;
+#else
+typedef UINT My_UINT_PTR;
+#endif
+
+struct IInFileStream_Callback
+{
+ virtual HRESULT InFileStream_On_Error(My_UINT_PTR val, DWORD error) = 0;
+ virtual void InFileStream_On_Destroy(My_UINT_PTR val) = 0;
+};
+
+class CInFileStream:
+ public IInStream,
+ public IStreamGetSize,
+ #ifdef USE_WIN_FILE
+ public IStreamGetProps,
+ public IStreamGetProps2,
+ #endif
+ public CMyUnknownImp
+{
+public:
+ #ifdef USE_WIN_FILE
+ NWindows::NFile::NIO::CInFile File;
+
+ #ifdef SUPPORT_DEVICE_FILE
+ UInt64 VirtPos;
+ UInt64 PhyPos;
+ UInt64 BufStartPos;
+ Byte *Buf;
+ UInt32 BufSize;
+ #endif
+
+ #else
+ NC::NFile::NIO::CInFile File;
+ #endif
+
+ bool SupportHardLinks;
+
+ IInFileStream_Callback *Callback;
+ My_UINT_PTR CallbackRef;
+
+ virtual ~CInFileStream();
+
+ CInFileStream();
+
+ bool Open(CFSTR fileName)
+ {
+ return File.Open(fileName);
+ }
+
+ bool OpenShared(CFSTR fileName, bool shareForWrite)
+ {
+ return File.OpenShared(fileName, shareForWrite);
+ }
+
+ MY_QUERYINTERFACE_BEGIN2(IInStream)
+ MY_QUERYINTERFACE_ENTRY(IStreamGetSize)
+ #ifdef USE_WIN_FILE
+ MY_QUERYINTERFACE_ENTRY(IStreamGetProps)
+ MY_QUERYINTERFACE_ENTRY(IStreamGetProps2)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+
+ STDMETHOD(GetSize)(UInt64 *size);
+ #ifdef USE_WIN_FILE
+ STDMETHOD(GetProps)(UInt64 *size, FILETIME *cTime, FILETIME *aTime, FILETIME *mTime, UInt32 *attrib);
+ STDMETHOD(GetProps2)(CStreamFileProps *props);
+ #endif
+};
+
+class CStdInFileStream:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP
+
+ virtual ~CStdInFileStream() {}
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+};
+
+class COutFileStream:
+ public IOutStream,
+ public CMyUnknownImp
+{
+public:
+ #ifdef USE_WIN_FILE
+ NWindows::NFile::NIO::COutFile File;
+ #else
+ NC::NFile::NIO::COutFile File;
+ #endif
+ virtual ~COutFileStream() {}
+ bool Create(CFSTR fileName, bool createAlways)
+ {
+ ProcessedSize = 0;
+ return File.Create(fileName, createAlways);
+ }
+ bool Open(CFSTR fileName, DWORD creationDisposition)
+ {
+ ProcessedSize = 0;
+ return File.Open(fileName, creationDisposition);
+ }
+
+ HRESULT Close();
+
+ UInt64 ProcessedSize;
+
+ #ifdef USE_WIN_FILE
+ bool SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime)
+ {
+ return File.SetTime(cTime, aTime, mTime);
+ }
+ bool SetMTime(const FILETIME *mTime) { return File.SetMTime(mTime); }
+ #endif
+
+
+ MY_UNKNOWN_IMP1(IOutStream)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+ STDMETHOD(SetSize)(UInt64 newSize);
+
+ HRESULT GetSize(UInt64 *size);
+};
+
+class CStdOutFileStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ UInt64 _size;
+public:
+ MY_UNKNOWN_IMP
+
+ UInt64 GetSize() const { return _size; }
+ CStdOutFileStream(): _size(0) {}
+ virtual ~CStdOutFileStream() {}
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.cpp
new file mode 100644
index 0000000000..275c60d4ba
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.cpp
@@ -0,0 +1,418 @@
+// FilterCoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/Defs.h"
+
+#include "FilterCoder.h"
+#include "StreamUtils.h"
+
+/*
+ AES filters need 16-bytes alignment for HARDWARE-AES instructions.
+ So we call IFilter::Filter(, size), where (size != 16 * N) only for last data block.
+
+ AES-CBC filters need data size aligned for 16-bytes.
+ So the encoder can add zeros to the end of original stream.
+
+ Some filters (BCJ and others) don't process data at the end of stream in some cases.
+ So the encoder and decoder write such last bytes without change.
+*/
+
+
+static const UInt32 kBufSize = 1 << 20;
+
+STDMETHODIMP CFilterCoder::SetInBufSize(UInt32 , UInt32 size) { _inBufSize = size; return S_OK; }
+STDMETHODIMP CFilterCoder::SetOutBufSize(UInt32 , UInt32 size) { _outBufSize = size; return S_OK; }
+
+HRESULT CFilterCoder::Alloc()
+{
+ UInt32 size = MyMin(_inBufSize, _outBufSize);
+ /* minimal bufSize is 16 bytes for AES and IA64 filter.
+ bufSize for AES must be aligned for 16 bytes.
+ We use (1 << 12) min size to support future aligned filters. */
+ const UInt32 kMinSize = 1 << 12;
+ size &= ~(UInt32)(kMinSize - 1);
+ if (size < kMinSize)
+ size = kMinSize;
+ if (!_buf || _bufSize != size)
+ {
+ AllocAlignedMask(size, 16 - 1);
+ if (!_buf)
+ return E_OUTOFMEMORY;
+ _bufSize = size;
+ }
+ return S_OK;
+}
+
+HRESULT CFilterCoder::Init_and_Alloc()
+{
+ RINOK(Filter->Init());
+ return Alloc();
+}
+
+CFilterCoder::CFilterCoder(bool encodeMode):
+ _bufSize(0),
+ _inBufSize(kBufSize),
+ _outBufSize(kBufSize),
+ _encodeMode(encodeMode),
+ _outSizeIsDefined(false),
+ _outSize(0),
+ _nowPos64(0)
+ {}
+
+CFilterCoder::~CFilterCoder()
+{
+}
+
+STDMETHODIMP CFilterCoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
+{
+ RINOK(Init_and_Alloc());
+
+ UInt64 nowPos64 = 0;
+ bool inputFinished = false;
+ UInt32 pos = 0;
+
+ while (!outSize || nowPos64 < *outSize)
+ {
+ UInt32 endPos = pos;
+
+ if (!inputFinished)
+ {
+ size_t processedSize = _bufSize - pos;
+ RINOK(ReadStream(inStream, _buf + pos, &processedSize));
+ endPos = pos + (UInt32)processedSize;
+ inputFinished = (endPos != _bufSize);
+ }
+
+ pos = Filter->Filter(_buf, endPos);
+
+ if (pos > endPos)
+ {
+ // AES
+ if (!inputFinished || pos > _bufSize)
+ return E_FAIL;
+ if (!_encodeMode)
+ return S_FALSE;
+
+ do
+ _buf[endPos] = 0;
+ while (++endPos != pos);
+
+ if (pos != Filter->Filter(_buf, pos))
+ return E_FAIL;
+ }
+
+ if (endPos == 0)
+ return S_OK;
+
+ UInt32 size = (pos != 0 ? pos : endPos);
+ if (outSize)
+ {
+ UInt64 remSize = *outSize - nowPos64;
+ if (size > remSize)
+ size = (UInt32)remSize;
+ }
+
+ RINOK(WriteStream(outStream, _buf, size));
+ nowPos64 += size;
+
+ if (pos == 0)
+ return S_OK;
+
+ if (progress)
+ RINOK(progress->SetRatioInfo(&nowPos64, &nowPos64));
+
+ UInt32 i = 0;
+ while (pos < endPos)
+ _buf[i++] = _buf[pos++];
+ pos = i;
+ }
+
+ return S_OK;
+}
+
+
+
+// ---------- Write to Filter ----------
+
+STDMETHODIMP CFilterCoder::SetOutStream(ISequentialOutStream *outStream)
+{
+ _outStream = outStream;
+ return S_OK;
+}
+
+STDMETHODIMP CFilterCoder::ReleaseOutStream()
+{
+ _outStream.Release();
+ return S_OK;
+}
+
+HRESULT CFilterCoder::Flush2()
+{
+ while (_convSize != 0)
+ {
+ UInt32 num = _convSize;
+ if (_outSizeIsDefined)
+ {
+ UInt64 rem = _outSize - _nowPos64;
+ if (num > rem)
+ num = (UInt32)rem;
+ if (num == 0)
+ return k_My_HRESULT_WritingWasCut;
+ }
+
+ UInt32 processed = 0;
+ HRESULT res = _outStream->Write(_buf + _convPos, num, &processed);
+ if (processed == 0)
+ return res != S_OK ? res : E_FAIL;
+
+ _convPos += processed;
+ _convSize -= processed;
+ _nowPos64 += processed;
+ RINOK(res);
+ }
+
+ if (_convPos != 0)
+ {
+ UInt32 num = _bufPos - _convPos;
+ for (UInt32 i = 0; i < num; i++)
+ _buf[i] = _buf[_convPos + i];
+ _bufPos = num;
+ _convPos = 0;
+ }
+
+ return S_OK;
+}
+
+STDMETHODIMP CFilterCoder::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ while (size != 0)
+ {
+ RINOK(Flush2());
+
+ // _convSize is 0
+ // _convPos is 0
+ // _bufPos is small
+
+ if (_bufPos != _bufSize)
+ {
+ UInt32 num = MyMin(size, _bufSize - _bufPos);
+ memcpy(_buf + _bufPos, data, num);
+ size -= num;
+ data = (const Byte *)data + num;
+ if (processedSize)
+ *processedSize += num;
+ _bufPos += num;
+ if (_bufPos != _bufSize)
+ continue;
+ }
+
+ // _bufPos == _bufSize
+ _convSize = Filter->Filter(_buf, _bufPos);
+
+ if (_convSize == 0)
+ break;
+ if (_convSize > _bufPos)
+ {
+ // that case is not possible.
+ _convSize = 0;
+ return E_FAIL;
+ }
+ }
+
+ return S_OK;
+}
+
+STDMETHODIMP CFilterCoder::OutStreamFinish()
+{
+ for (;;)
+ {
+ RINOK(Flush2());
+ if (_bufPos == 0)
+ break;
+ _convSize = Filter->Filter(_buf, _bufPos);
+ if (_convSize == 0)
+ _convSize = _bufPos;
+ else if (_convSize > _bufPos)
+ {
+ // AES
+ if (_convSize > _bufSize)
+ {
+ _convSize = 0;
+ return E_FAIL;
+ }
+ if (!_encodeMode)
+ {
+ _convSize = 0;
+ return S_FALSE;
+ }
+ for (; _bufPos < _convSize; _bufPos++)
+ _buf[_bufPos] = 0;
+ _convSize = Filter->Filter(_buf, _bufPos);
+ if (_convSize != _bufPos)
+ return E_FAIL;
+ }
+ }
+
+ CMyComPtr<IOutStreamFinish> finish;
+ _outStream.QueryInterface(IID_IOutStreamFinish, &finish);
+ if (finish)
+ return finish->OutStreamFinish();
+ return S_OK;
+}
+
+// ---------- Init functions ----------
+
+STDMETHODIMP CFilterCoder::InitEncoder()
+{
+ InitSpecVars();
+ return Init_and_Alloc();
+}
+
+HRESULT CFilterCoder::Init_NoSubFilterInit()
+{
+ InitSpecVars();
+ return Alloc();
+}
+
+STDMETHODIMP CFilterCoder::SetOutStreamSize(const UInt64 *outSize)
+{
+ InitSpecVars();
+ if (outSize)
+ {
+ _outSize = *outSize;
+ _outSizeIsDefined = true;
+ }
+ return Init_and_Alloc();
+}
+
+// ---------- Read from Filter ----------
+
+STDMETHODIMP CFilterCoder::SetInStream(ISequentialInStream *inStream)
+{
+ _inStream = inStream;
+ return S_OK;
+}
+
+STDMETHODIMP CFilterCoder::ReleaseInStream()
+{
+ _inStream.Release();
+ return S_OK;
+}
+
+
+STDMETHODIMP CFilterCoder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ while (size != 0)
+ {
+ if (_convSize != 0)
+ {
+ if (size > _convSize)
+ size = _convSize;
+ if (_outSizeIsDefined)
+ {
+ UInt64 rem = _outSize - _nowPos64;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ memcpy(data, _buf + _convPos, size);
+ _convPos += size;
+ _convSize -= size;
+ _nowPos64 += size;
+ if (processedSize)
+ *processedSize = size;
+ break;
+ }
+
+ if (_convPos != 0)
+ {
+ UInt32 num = _bufPos - _convPos;
+ for (UInt32 i = 0; i < num; i++)
+ _buf[i] = _buf[_convPos + i];
+ _bufPos = num;
+ _convPos = 0;
+ }
+
+ {
+ size_t readSize = _bufSize - _bufPos;
+ HRESULT res = ReadStream(_inStream, _buf + _bufPos, &readSize);
+ _bufPos += (UInt32)readSize;
+ RINOK(res);
+ }
+
+ _convSize = Filter->Filter(_buf, _bufPos);
+
+ if (_convSize == 0)
+ {
+ if (_bufPos == 0)
+ break;
+ // BCJ
+ _convSize = _bufPos;
+ continue;
+ }
+
+ if (_convSize > _bufPos)
+ {
+ // AES
+ if (_convSize > _bufSize)
+ return E_FAIL;
+ if (!_encodeMode)
+ return S_FALSE;
+
+ do
+ _buf[_bufPos] = 0;
+ while (++_bufPos != _convSize);
+
+ _convSize = Filter->Filter(_buf, _convSize);
+ if (_convSize != _bufPos)
+ return E_FAIL;
+ }
+ }
+
+ return S_OK;
+}
+
+
+#ifndef _NO_CRYPTO
+
+STDMETHODIMP CFilterCoder::CryptoSetPassword(const Byte *data, UInt32 size)
+ { return _SetPassword->CryptoSetPassword(data, size); }
+
+STDMETHODIMP CFilterCoder::SetKey(const Byte *data, UInt32 size)
+ { return _CryptoProperties->SetKey(data, size); }
+
+STDMETHODIMP CFilterCoder::SetInitVector(const Byte *data, UInt32 size)
+ { return _CryptoProperties->SetInitVector(data, size); }
+
+#endif
+
+
+#ifndef EXTRACT_ONLY
+
+STDMETHODIMP CFilterCoder::SetCoderProperties(const PROPID *propIDs,
+ const PROPVARIANT *properties, UInt32 numProperties)
+ { return _SetCoderProperties->SetCoderProperties(propIDs, properties, numProperties); }
+
+STDMETHODIMP CFilterCoder::WriteCoderProperties(ISequentialOutStream *outStream)
+ { return _WriteCoderProperties->WriteCoderProperties(outStream); }
+
+/*
+STDMETHODIMP CFilterCoder::ResetSalt()
+ { return _CryptoResetSalt->ResetSalt(); }
+*/
+
+STDMETHODIMP CFilterCoder::ResetInitVector()
+ { return _CryptoResetInitVector->ResetInitVector(); }
+
+#endif
+
+
+STDMETHODIMP CFilterCoder::SetDecoderProperties2(const Byte *data, UInt32 size)
+ { return _SetDecoderProperties2->SetDecoderProperties2(data, size); }
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.h b/other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.h
new file mode 100644
index 0000000000..0e2f84f115
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/FilterCoder.h
@@ -0,0 +1,235 @@
+// FilterCoder.h
+
+#ifndef __FILTER_CODER_H
+#define __FILTER_CODER_H
+
+#include "../../../C/Alloc.h"
+
+#include "../../Common/MyCom.h"
+#include "../ICoder.h"
+
+#ifndef _NO_CRYPTO
+#include "../IPassword.h"
+#endif
+
+#define MY_QUERYINTERFACE_ENTRY_AG(i, sub0, sub) else if (iid == IID_ ## i) \
+ { if (!sub) RINOK(sub0->QueryInterface(IID_ ## i, (void **)&sub)) \
+ *outObject = (void *)(i *)this; }
+
+
+struct CAlignedMidBuffer
+{
+ #ifdef _WIN32
+
+ Byte *_buf;
+
+ CAlignedMidBuffer(): _buf(NULL) {}
+ ~CAlignedMidBuffer() { ::MidFree(_buf); }
+
+ void AllocAlignedMask(size_t size, size_t)
+ {
+ ::MidFree(_buf);
+ _buf = (Byte *)::MidAlloc(size);
+ }
+
+ #else
+
+ Byte *_bufBase;
+ Byte *_buf;
+
+ CAlignedMidBuffer(): _bufBase(NULL), _buf(NULL) {}
+ ~CAlignedMidBuffer() { ::MidFree(_bufBase); }
+
+ void AllocAlignedMask(size_t size, size_t alignMask)
+ {
+ ::MidFree(_bufBase);
+ _buf = NULL;
+ _bufBase = (Byte *)::MidAlloc(size + alignMask);
+
+ if (_bufBase)
+ {
+ // _buf = (Byte *)(((uintptr_t)_bufBase + alignMask) & ~(uintptr_t)alignMask);
+ _buf = (Byte *)(((ptrdiff_t)_bufBase + alignMask) & ~(ptrdiff_t)alignMask);
+ }
+ }
+
+ #endif
+};
+
+class CFilterCoder:
+ public ICompressCoder,
+
+ public ICompressSetOutStreamSize,
+ public ICompressInitEncoder,
+
+ public ICompressSetInStream,
+ public ISequentialInStream,
+
+ public ICompressSetOutStream,
+ public ISequentialOutStream,
+ public IOutStreamFinish,
+
+ public ICompressSetBufSize,
+
+ #ifndef _NO_CRYPTO
+ public ICryptoSetPassword,
+ public ICryptoProperties,
+ #endif
+
+ #ifndef EXTRACT_ONLY
+ public ICompressSetCoderProperties,
+ public ICompressWriteCoderProperties,
+ // public ICryptoResetSalt,
+ public ICryptoResetInitVector,
+ #endif
+
+ public ICompressSetDecoderProperties2,
+ public CMyUnknownImp,
+ public CAlignedMidBuffer
+{
+ UInt32 _bufSize;
+ UInt32 _inBufSize;
+ UInt32 _outBufSize;
+
+ bool _encodeMode;
+ bool _outSizeIsDefined;
+ UInt64 _outSize;
+ UInt64 _nowPos64;
+
+ CMyComPtr<ISequentialInStream> _inStream;
+ CMyComPtr<ISequentialOutStream> _outStream;
+ UInt32 _bufPos;
+ UInt32 _convPos; // current pos in buffer for converted data
+ UInt32 _convSize; // size of converted data starting from _convPos
+
+ void InitSpecVars()
+ {
+ _bufPos = 0;
+ _convPos = 0;
+ _convSize = 0;
+
+ _outSizeIsDefined = false;
+ _outSize = 0;
+ _nowPos64 = 0;
+ }
+
+ HRESULT Alloc();
+ HRESULT Init_and_Alloc();
+ HRESULT Flush2();
+
+ #ifndef _NO_CRYPTO
+ CMyComPtr<ICryptoSetPassword> _SetPassword;
+ CMyComPtr<ICryptoProperties> _CryptoProperties;
+ #endif
+
+ #ifndef EXTRACT_ONLY
+ CMyComPtr<ICompressSetCoderProperties> _SetCoderProperties;
+ CMyComPtr<ICompressWriteCoderProperties> _WriteCoderProperties;
+ // CMyComPtr<ICryptoResetSalt> _CryptoResetSalt;
+ CMyComPtr<ICryptoResetInitVector> _CryptoResetInitVector;
+ #endif
+
+ CMyComPtr<ICompressSetDecoderProperties2> _SetDecoderProperties2;
+
+public:
+ CMyComPtr<ICompressFilter> Filter;
+
+ CFilterCoder(bool encodeMode);
+ ~CFilterCoder();
+
+ class C_InStream_Releaser
+ {
+ public:
+ CFilterCoder *FilterCoder;
+ C_InStream_Releaser(): FilterCoder(NULL) {}
+ ~C_InStream_Releaser() { if (FilterCoder) FilterCoder->ReleaseInStream(); }
+ };
+
+ class C_OutStream_Releaser
+ {
+ public:
+ CFilterCoder *FilterCoder;
+ C_OutStream_Releaser(): FilterCoder(NULL) {}
+ ~C_OutStream_Releaser() { if (FilterCoder) FilterCoder->ReleaseOutStream(); }
+ };
+
+ class C_Filter_Releaser
+ {
+ public:
+ CFilterCoder *FilterCoder;
+ C_Filter_Releaser(): FilterCoder(NULL) {}
+ ~C_Filter_Releaser() { if (FilterCoder) FilterCoder->Filter.Release(); }
+ };
+
+
+ MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
+
+ MY_QUERYINTERFACE_ENTRY(ICompressSetOutStreamSize)
+ MY_QUERYINTERFACE_ENTRY(ICompressInitEncoder)
+
+ MY_QUERYINTERFACE_ENTRY(ICompressSetInStream)
+ MY_QUERYINTERFACE_ENTRY(ISequentialInStream)
+
+ MY_QUERYINTERFACE_ENTRY(ICompressSetOutStream)
+ MY_QUERYINTERFACE_ENTRY(ISequentialOutStream)
+ MY_QUERYINTERFACE_ENTRY(IOutStreamFinish)
+
+ MY_QUERYINTERFACE_ENTRY(ICompressSetBufSize)
+
+ #ifndef _NO_CRYPTO
+ MY_QUERYINTERFACE_ENTRY_AG(ICryptoSetPassword, Filter, _SetPassword)
+ MY_QUERYINTERFACE_ENTRY_AG(ICryptoProperties, Filter, _CryptoProperties)
+ #endif
+
+ #ifndef EXTRACT_ONLY
+ MY_QUERYINTERFACE_ENTRY_AG(ICompressSetCoderProperties, Filter, _SetCoderProperties)
+ MY_QUERYINTERFACE_ENTRY_AG(ICompressWriteCoderProperties, Filter, _WriteCoderProperties)
+ // MY_QUERYINTERFACE_ENTRY_AG(ICryptoResetSalt, Filter, _CryptoResetSalt)
+ MY_QUERYINTERFACE_ENTRY_AG(ICryptoResetInitVector, Filter, _CryptoResetInitVector)
+ #endif
+
+ MY_QUERYINTERFACE_ENTRY_AG(ICompressSetDecoderProperties2, Filter, _SetDecoderProperties2)
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+
+ STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
+ STDMETHOD(InitEncoder)();
+
+ STDMETHOD(SetInStream)(ISequentialInStream *inStream);
+ STDMETHOD(ReleaseInStream)();
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+
+ STDMETHOD(SetOutStream)(ISequentialOutStream *outStream);
+ STDMETHOD(ReleaseOutStream)();
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(OutStreamFinish)();
+
+ STDMETHOD(SetInBufSize)(UInt32 streamIndex, UInt32 size);
+ STDMETHOD(SetOutBufSize)(UInt32 streamIndex, UInt32 size);
+
+ #ifndef _NO_CRYPTO
+ STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
+
+ STDMETHOD(SetKey)(const Byte *data, UInt32 size);
+ STDMETHOD(SetInitVector)(const Byte *data, UInt32 size);
+ #endif
+
+ #ifndef EXTRACT_ONLY
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs,
+ const PROPVARIANT *properties, UInt32 numProperties);
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
+ // STDMETHOD(ResetSalt)();
+ STDMETHOD(ResetInitVector)();
+ #endif
+
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+
+
+ HRESULT Init_NoSubFilterInit();
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.cpp
new file mode 100644
index 0000000000..826e98b191
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.cpp
@@ -0,0 +1,163 @@
+// InBuffer.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "InBuffer.h"
+
+CInBufferBase::CInBufferBase() throw():
+ _buf(0),
+ _bufLim(0),
+ _bufBase(0),
+ _stream(0),
+ _processedSize(0),
+ _bufSize(0),
+ _wasFinished(false),
+ NumExtraBytes(0)
+{}
+
+bool CInBuffer::Create(size_t bufSize) throw()
+{
+ const unsigned kMinBlockSize = 1;
+ if (bufSize < kMinBlockSize)
+ bufSize = kMinBlockSize;
+ if (_bufBase != 0 && _bufSize == bufSize)
+ return true;
+ Free();
+ _bufSize = bufSize;
+ _bufBase = (Byte *)::MidAlloc(bufSize);
+ return (_bufBase != 0);
+}
+
+void CInBuffer::Free() throw()
+{
+ ::MidFree(_bufBase);
+ _bufBase = 0;
+}
+
+void CInBufferBase::Init() throw()
+{
+ _processedSize = 0;
+ _buf = _bufBase;
+ _bufLim = _buf;
+ _wasFinished = false;
+ #ifdef _NO_EXCEPTIONS
+ ErrorCode = S_OK;
+ #endif
+ NumExtraBytes = 0;
+}
+
+bool CInBufferBase::ReadBlock()
+{
+ #ifdef _NO_EXCEPTIONS
+ if (ErrorCode != S_OK)
+ return false;
+ #endif
+ if (_wasFinished)
+ return false;
+ _processedSize += (_buf - _bufBase);
+ _buf = _bufBase;
+ _bufLim = _bufBase;
+ UInt32 processed;
+ // FIX_ME: we can improve it to support (_bufSize >= (1 << 32))
+ HRESULT result = _stream->Read(_bufBase, (UInt32)_bufSize, &processed);
+ #ifdef _NO_EXCEPTIONS
+ ErrorCode = result;
+ #else
+ if (result != S_OK)
+ throw CInBufferException(result);
+ #endif
+ _bufLim = _buf + processed;
+ _wasFinished = (processed == 0);
+ return !_wasFinished;
+}
+
+bool CInBufferBase::ReadByte_FromNewBlock(Byte &b)
+{
+ if (!ReadBlock())
+ {
+ NumExtraBytes++;
+ b = 0xFF;
+ return false;
+ }
+ b = *_buf++;
+ return true;
+}
+
+Byte CInBufferBase::ReadByte_FromNewBlock()
+{
+ if (!ReadBlock())
+ {
+ NumExtraBytes++;
+ return 0xFF;
+ }
+ return *_buf++;
+}
+
+size_t CInBufferBase::ReadBytes(Byte *buf, size_t size)
+{
+ size_t num = 0;
+ for (;;)
+ {
+ const size_t rem = _bufLim - _buf;
+ if (size <= rem)
+ {
+ if (size != 0)
+ {
+ memcpy(buf, _buf, size);
+ _buf += size;
+ num += size;
+ }
+ return num;
+ }
+ if (rem != 0)
+ {
+ memcpy(buf, _buf, rem);
+ _buf += rem;
+ buf += rem;
+ num += rem;
+ size -= rem;
+ }
+ if (!ReadBlock())
+ return num;
+ }
+
+ /*
+ if ((size_t)(_bufLim - _buf) >= size)
+ {
+ const Byte *src = _buf;
+ for (size_t i = 0; i < size; i++)
+ buf[i] = src[i];
+ _buf += size;
+ return size;
+ }
+ for (size_t i = 0; i < size; i++)
+ {
+ if (_buf >= _bufLim)
+ if (!ReadBlock())
+ return i;
+ buf[i] = *_buf++;
+ }
+ return size;
+ */
+}
+
+size_t CInBufferBase::Skip(size_t size)
+{
+ size_t processed = 0;
+ for (;;)
+ {
+ size_t rem = (_bufLim - _buf);
+ if (rem >= size)
+ {
+ _buf += size;
+ return processed + size;
+ }
+ _buf += rem;
+ processed += rem;
+ size -= rem;
+ if (!ReadBlock())
+ return processed;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.h b/other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.h
new file mode 100644
index 0000000000..76e359a00b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/InBuffer.h
@@ -0,0 +1,92 @@
+// InBuffer.h
+
+#ifndef __IN_BUFFER_H
+#define __IN_BUFFER_H
+
+#include "../../Common/MyException.h"
+#include "../IStream.h"
+
+#ifndef _NO_EXCEPTIONS
+struct CInBufferException: public CSystemException
+{
+ CInBufferException(HRESULT errorCode): CSystemException(errorCode) {}
+};
+#endif
+
+class CInBufferBase
+{
+protected:
+ Byte *_buf;
+ Byte *_bufLim;
+ Byte *_bufBase;
+
+ ISequentialInStream *_stream;
+ UInt64 _processedSize;
+ size_t _bufSize; // actually it's number of Bytes for next read. The buf can be larger
+ // only up to 32-bits values now are supported!
+ bool _wasFinished;
+
+ bool ReadBlock();
+ bool ReadByte_FromNewBlock(Byte &b);
+ Byte ReadByte_FromNewBlock();
+
+public:
+ #ifdef _NO_EXCEPTIONS
+ HRESULT ErrorCode;
+ #endif
+ UInt32 NumExtraBytes;
+
+ CInBufferBase() throw();
+
+ UInt64 GetStreamSize() const { return _processedSize + (_buf - _bufBase); }
+ UInt64 GetProcessedSize() const { return _processedSize + NumExtraBytes + (_buf - _bufBase); }
+ bool WasFinished() const { return _wasFinished; }
+
+ void SetStream(ISequentialInStream *stream) { _stream = stream; }
+
+ void SetBuf(Byte *buf, size_t bufSize, size_t end, size_t pos)
+ {
+ _bufBase = buf;
+ _bufSize = bufSize;
+ _processedSize = 0;
+ _buf = buf + pos;
+ _bufLim = buf + end;
+ _wasFinished = false;
+ #ifdef _NO_EXCEPTIONS
+ ErrorCode = S_OK;
+ #endif
+ NumExtraBytes = 0;
+ }
+
+ void Init() throw();
+
+ MY_FORCE_INLINE
+ bool ReadByte(Byte &b)
+ {
+ if (_buf >= _bufLim)
+ return ReadByte_FromNewBlock(b);
+ b = *_buf++;
+ return true;
+ }
+
+ MY_FORCE_INLINE
+ Byte ReadByte()
+ {
+ if (_buf >= _bufLim)
+ return ReadByte_FromNewBlock();
+ return *_buf++;
+ }
+
+ size_t ReadBytes(Byte *buf, size_t size);
+ size_t Skip(size_t size);
+};
+
+class CInBuffer: public CInBufferBase
+{
+public:
+ ~CInBuffer() { Free(); }
+ bool Create(size_t bufSize) throw(); // only up to 32-bits values now are supported!
+ void Free() throw();
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.cpp
new file mode 100644
index 0000000000..d83d67467e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.cpp
@@ -0,0 +1,127 @@
+// InOutTempBuffer.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/7zCrc.h"
+
+#include "../../Common/Defs.h"
+
+#include "InOutTempBuffer.h"
+#include "StreamUtils.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static const size_t kTempBufSize = (1 << 20);
+
+#define kTempFilePrefixString FTEXT("7zt")
+
+CInOutTempBuffer::CInOutTempBuffer(): _buf(NULL) { }
+
+void CInOutTempBuffer::Create()
+{
+ if (!_buf)
+ _buf = new Byte[kTempBufSize];
+}
+
+CInOutTempBuffer::~CInOutTempBuffer()
+{
+ delete []_buf;
+}
+
+void CInOutTempBuffer::InitWriting()
+{
+ _bufPos = 0;
+ _tempFileCreated = false;
+ _size = 0;
+ _crc = CRC_INIT_VAL;
+}
+
+bool CInOutTempBuffer::WriteToFile(const void *data, UInt32 size)
+{
+ if (size == 0)
+ return true;
+ if (!_tempFileCreated)
+ {
+ if (!_tempFile.CreateRandomInTempFolder(kTempFilePrefixString, &_outFile))
+ return false;
+ _tempFileCreated = true;
+ }
+ UInt32 processed;
+ if (!_outFile.Write(data, size, processed))
+ return false;
+ _crc = CrcUpdate(_crc, data, processed);
+ _size += processed;
+ return (processed == size);
+}
+
+bool CInOutTempBuffer::Write(const void *data, UInt32 size)
+{
+ if (size == 0)
+ return true;
+ size_t cur = kTempBufSize - _bufPos;
+ if (cur != 0)
+ {
+ if (cur > size)
+ cur = size;
+ memcpy(_buf + _bufPos, data, cur);
+ _crc = CrcUpdate(_crc, data, cur);
+ _bufPos += cur;
+ _size += cur;
+ size -= (UInt32)cur;
+ data = ((const Byte *)data) + cur;
+ }
+ return WriteToFile(data, size);
+}
+
+HRESULT CInOutTempBuffer::WriteToStream(ISequentialOutStream *stream)
+{
+ if (!_outFile.Close())
+ return E_FAIL;
+
+ UInt64 size = 0;
+ UInt32 crc = CRC_INIT_VAL;
+
+ if (_bufPos != 0)
+ {
+ RINOK(WriteStream(stream, _buf, _bufPos));
+ crc = CrcUpdate(crc, _buf, _bufPos);
+ size += _bufPos;
+ }
+
+ if (_tempFileCreated)
+ {
+ NIO::CInFile inFile;
+ if (!inFile.Open(_tempFile.GetPath()))
+ return E_FAIL;
+ while (size < _size)
+ {
+ UInt32 processed;
+ if (!inFile.ReadPart(_buf, kTempBufSize, processed))
+ return E_FAIL;
+ if (processed == 0)
+ break;
+ RINOK(WriteStream(stream, _buf, processed));
+ crc = CrcUpdate(crc, _buf, processed);
+ size += processed;
+ }
+ }
+
+ return (_crc == crc && size == _size) ? S_OK : E_FAIL;
+}
+
+/*
+STDMETHODIMP CSequentialOutTempBufferImp::Write(const void *data, UInt32 size, UInt32 *processed)
+{
+ if (!_buf->Write(data, size))
+ {
+ if (processed)
+ *processed = 0;
+ return E_FAIL;
+ }
+ if (processed)
+ *processed = size;
+ return S_OK;
+}
+*/
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.h b/other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.h
new file mode 100644
index 0000000000..4140d28308
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/InOutTempBuffer.h
@@ -0,0 +1,48 @@
+// InOutTempBuffer.h
+
+#ifndef __IN_OUT_TEMP_BUFFER_H
+#define __IN_OUT_TEMP_BUFFER_H
+
+#include "../../Common/MyCom.h"
+#include "../../Windows/FileDir.h"
+
+#include "../IStream.h"
+
+class CInOutTempBuffer
+{
+ NWindows::NFile::NDir::CTempFile _tempFile;
+ NWindows::NFile::NIO::COutFile _outFile;
+ Byte *_buf;
+ size_t _bufPos;
+ UInt64 _size;
+ UInt32 _crc;
+ bool _tempFileCreated;
+
+ bool WriteToFile(const void *data, UInt32 size);
+public:
+ CInOutTempBuffer();
+ ~CInOutTempBuffer();
+ void Create();
+
+ void InitWriting();
+ bool Write(const void *data, UInt32 size);
+
+ HRESULT WriteToStream(ISequentialOutStream *stream);
+ UInt64 GetDataSize() const { return _size; }
+};
+
+/*
+class CSequentialOutTempBufferImp:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CInOutTempBuffer *_buf;
+public:
+ void Init(CInOutTempBuffer *buffer) { _buf = buffer; }
+ MY_UNKNOWN_IMP
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+*/
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.cpp
new file mode 100644
index 0000000000..fc7e794cf8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.cpp
@@ -0,0 +1,367 @@
+// LimitedStreams.cpp
+
+#include "StdAfx.h"
+
+#include <string.h>
+
+#include "LimitedStreams.h"
+
+STDMETHODIMP CLimitedSequentialInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessedSize = 0;
+ {
+ const UInt64 rem = _size - _pos;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ HRESULT result = S_OK;
+ if (size != 0)
+ {
+ result = _stream->Read(data, size, &realProcessedSize);
+ _pos += realProcessedSize;
+ if (realProcessedSize == 0)
+ _wasFinished = true;
+ }
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return result;
+}
+
+STDMETHODIMP CLimitedInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (_virtPos >= _size)
+ {
+ // 9.31: Fixed. Windows doesn't return error in ReadFile and IStream->Read in that case.
+ return S_OK;
+ // return (_virtPos == _size) ? S_OK: E_FAIL; // ERROR_HANDLE_EOF
+ }
+ {
+ const UInt64 rem = _size - _virtPos;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ UInt64 newPos = _startOffset + _virtPos;
+ if (newPos != _physPos)
+ {
+ _physPos = newPos;
+ RINOK(SeekToPhys());
+ }
+ HRESULT res = _stream->Read(data, size, &size);
+ if (processedSize)
+ *processedSize = size;
+ _physPos += size;
+ _virtPos += size;
+ return res;
+}
+
+STDMETHODIMP CLimitedInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END: offset += _size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = _virtPos;
+ return S_OK;
+}
+
+HRESULT CreateLimitedInStream(IInStream *inStream, UInt64 pos, UInt64 size, ISequentialInStream **resStream)
+{
+ *resStream = 0;
+ CLimitedInStream *streamSpec = new CLimitedInStream;
+ CMyComPtr<ISequentialInStream> streamTemp = streamSpec;
+ streamSpec->SetStream(inStream);
+ RINOK(streamSpec->InitAndSeek(pos, size));
+ streamSpec->SeekToStart();
+ *resStream = streamTemp.Detach();
+ return S_OK;
+}
+
+STDMETHODIMP CClusterInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (_virtPos >= Size)
+ return S_OK;
+ {
+ UInt64 rem = Size - _virtPos;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ if (size == 0)
+ return S_OK;
+
+ if (_curRem == 0)
+ {
+ const UInt32 blockSize = (UInt32)1 << BlockSizeLog;
+ const UInt32 virtBlock = (UInt32)(_virtPos >> BlockSizeLog);
+ const UInt32 offsetInBlock = (UInt32)_virtPos & (blockSize - 1);
+ const UInt32 phyBlock = Vector[virtBlock];
+
+ UInt64 newPos = StartOffset + ((UInt64)phyBlock << BlockSizeLog) + offsetInBlock;
+ if (newPos != _physPos)
+ {
+ _physPos = newPos;
+ RINOK(SeekToPhys());
+ }
+
+ _curRem = blockSize - offsetInBlock;
+
+ for (int i = 1; i < 64 && (virtBlock + i) < (UInt32)Vector.Size() && phyBlock + i == Vector[virtBlock + i]; i++)
+ _curRem += (UInt32)1 << BlockSizeLog;
+ }
+
+ if (size > _curRem)
+ size = _curRem;
+ HRESULT res = Stream->Read(data, size, &size);
+ if (processedSize)
+ *processedSize = size;
+ _physPos += size;
+ _virtPos += size;
+ _curRem -= size;
+ return res;
+}
+
+STDMETHODIMP CClusterInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END: offset += Size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ if (_virtPos != (UInt64)offset)
+ _curRem = 0;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
+
+
+STDMETHODIMP CExtentsStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (_virtPos >= Extents.Back().Virt)
+ return S_OK;
+ if (size == 0)
+ return S_OK;
+
+ unsigned left = 0, right = Extents.Size() - 1;
+ for (;;)
+ {
+ unsigned mid = (left + right) / 2;
+ if (mid == left)
+ break;
+ if (_virtPos < Extents[mid].Virt)
+ right = mid;
+ else
+ left = mid;
+ }
+
+ const CSeekExtent &extent = Extents[left];
+ UInt64 phyPos = extent.Phy + (_virtPos - extent.Virt);
+ if (_needStartSeek || _phyPos != phyPos)
+ {
+ _needStartSeek = false;
+ _phyPos = phyPos;
+ RINOK(SeekToPhys());
+ }
+
+ UInt64 rem = Extents[left + 1].Virt - _virtPos;
+ if (size > rem)
+ size = (UInt32)rem;
+
+ HRESULT res = Stream->Read(data, size, &size);
+ _phyPos += size;
+ _virtPos += size;
+ if (processedSize)
+ *processedSize = size;
+ return res;
+}
+
+STDMETHODIMP CExtentsStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END: offset += Extents.Back().Virt; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = _virtPos;
+ return S_OK;
+}
+
+
+STDMETHODIMP CLimitedSequentialOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ HRESULT result = S_OK;
+ if (processedSize)
+ *processedSize = 0;
+ if (size > _size)
+ {
+ if (_size == 0)
+ {
+ _overflow = true;
+ if (!_overflowIsAllowed)
+ return E_FAIL;
+ if (processedSize)
+ *processedSize = size;
+ return S_OK;
+ }
+ size = (UInt32)_size;
+ }
+ if (_stream)
+ result = _stream->Write(data, size, &size);
+ _size -= size;
+ if (processedSize)
+ *processedSize = size;
+ return result;
+}
+
+
+STDMETHODIMP CTailInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 cur;
+ HRESULT res = Stream->Read(data, size, &cur);
+ if (processedSize)
+ *processedSize = cur;
+ _virtPos += cur;
+ return res;
+}
+
+STDMETHODIMP CTailInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END:
+ {
+ UInt64 pos = 0;
+ RINOK(Stream->Seek(offset, STREAM_SEEK_END, &pos));
+ if (pos < Offset)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = pos - Offset;
+ if (newPosition)
+ *newPosition = _virtPos;
+ return S_OK;
+ }
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = _virtPos;
+ return Stream->Seek(Offset + _virtPos, STREAM_SEEK_SET, NULL);
+}
+
+STDMETHODIMP CLimitedCachedInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (_virtPos >= _size)
+ {
+ // 9.31: Fixed. Windows doesn't return error in ReadFile and IStream->Read in that case.
+ return S_OK;
+ // return (_virtPos == _size) ? S_OK: E_FAIL; // ERROR_HANDLE_EOF
+ }
+ UInt64 rem = _size - _virtPos;
+ if (rem < size)
+ size = (UInt32)rem;
+
+ UInt64 newPos = _startOffset + _virtPos;
+ UInt64 offsetInCache = newPos - _cachePhyPos;
+ HRESULT res = S_OK;
+ if (newPos >= _cachePhyPos &&
+ offsetInCache <= _cacheSize &&
+ size <= _cacheSize - (size_t)offsetInCache)
+ {
+ if (size != 0)
+ memcpy(data, _cache + (size_t)offsetInCache, size);
+ }
+ else
+ {
+ if (newPos != _physPos)
+ {
+ _physPos = newPos;
+ RINOK(SeekToPhys());
+ }
+ res = _stream->Read(data, size, &size);
+ _physPos += size;
+ }
+ if (processedSize)
+ *processedSize = size;
+ _virtPos += size;
+ return res;
+}
+
+STDMETHODIMP CLimitedCachedInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END: offset += _size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = _virtPos;
+ return S_OK;
+}
+
+STDMETHODIMP CTailOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 cur;
+ HRESULT res = Stream->Write(data, size, &cur);
+ if (processedSize)
+ *processedSize = cur;
+ _virtPos += cur;
+ if (_virtSize < _virtPos)
+ _virtSize = _virtPos;
+ return res;
+}
+
+STDMETHODIMP CTailOutStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _virtPos; break;
+ case STREAM_SEEK_END: offset += _virtSize; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _virtPos = offset;
+ if (newPosition)
+ *newPosition = _virtPos;
+ return Stream->Seek(Offset + _virtPos, STREAM_SEEK_SET, NULL);
+}
+
+STDMETHODIMP CTailOutStream::SetSize(UInt64 newSize)
+{
+ _virtSize = newSize;
+ return Stream->SetSize(Offset + newSize);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.h b/other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.h
new file mode 100644
index 0000000000..2e55aa0b64
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/LimitedStreams.h
@@ -0,0 +1,252 @@
+// LimitedStreams.h
+
+#ifndef __LIMITED_STREAMS_H
+#define __LIMITED_STREAMS_H
+
+#include "../../Common/MyBuffer.h"
+#include "../../Common/MyCom.h"
+#include "../../Common/MyVector.h"
+#include "../IStream.h"
+
+class CLimitedSequentialInStream:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialInStream> _stream;
+ UInt64 _size;
+ UInt64 _pos;
+ bool _wasFinished;
+public:
+ void SetStream(ISequentialInStream *stream) { _stream = stream; }
+ void ReleaseStream() { _stream.Release(); }
+ void Init(UInt64 streamSize)
+ {
+ _size = streamSize;
+ _pos = 0;
+ _wasFinished = false;
+ }
+
+ MY_UNKNOWN_IMP1(ISequentialInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ UInt64 GetSize() const { return _pos; }
+ UInt64 GetRem() const { return _size - _pos; }
+ bool WasFinished() const { return _wasFinished; }
+};
+
+class CLimitedInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<IInStream> _stream;
+ UInt64 _virtPos;
+ UInt64 _physPos;
+ UInt64 _size;
+ UInt64 _startOffset;
+
+ HRESULT SeekToPhys() { return _stream->Seek(_physPos, STREAM_SEEK_SET, NULL); }
+public:
+ void SetStream(IInStream *stream) { _stream = stream; }
+ HRESULT InitAndSeek(UInt64 startOffset, UInt64 size)
+ {
+ _startOffset = startOffset;
+ _physPos = startOffset;
+ _virtPos = 0;
+ _size = size;
+ return SeekToPhys();
+ }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+
+ HRESULT SeekToStart() { return Seek(0, STREAM_SEEK_SET, NULL); }
+};
+
+HRESULT CreateLimitedInStream(IInStream *inStream, UInt64 pos, UInt64 size, ISequentialInStream **resStream);
+
+class CClusterInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ UInt64 _virtPos;
+ UInt64 _physPos;
+ UInt32 _curRem;
+public:
+ unsigned BlockSizeLog;
+ UInt64 Size;
+ CMyComPtr<IInStream> Stream;
+ CRecordVector<UInt32> Vector;
+ UInt64 StartOffset;
+
+ HRESULT SeekToPhys() { return Stream->Seek(_physPos, STREAM_SEEK_SET, NULL); }
+
+ HRESULT InitAndSeek()
+ {
+ _curRem = 0;
+ _virtPos = 0;
+ _physPos = StartOffset;
+ if (Vector.Size() > 0)
+ {
+ _physPos = StartOffset + (Vector[0] << BlockSizeLog);
+ return SeekToPhys();
+ }
+ return S_OK;
+ }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+};
+
+struct CSeekExtent
+{
+ UInt64 Phy;
+ UInt64 Virt;
+};
+
+class CExtentsStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ UInt64 _phyPos;
+ UInt64 _virtPos;
+ bool _needStartSeek;
+
+ HRESULT SeekToPhys() { return Stream->Seek(_phyPos, STREAM_SEEK_SET, NULL); }
+
+public:
+ CMyComPtr<IInStream> Stream;
+ CRecordVector<CSeekExtent> Extents;
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+ void ReleaseStream() { Stream.Release(); }
+
+ void Init()
+ {
+ _virtPos = 0;
+ _phyPos = 0;
+ _needStartSeek = true;
+ }
+};
+
+class CLimitedSequentialOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+ bool _overflow;
+ bool _overflowIsAllowed;
+public:
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void ReleaseStream() { _stream.Release(); }
+ void Init(UInt64 size, bool overflowIsAllowed = false)
+ {
+ _size = size;
+ _overflow = false;
+ _overflowIsAllowed = overflowIsAllowed;
+ }
+ bool IsFinishedOK() const { return (_size == 0 && !_overflow); }
+ UInt64 GetRem() const { return _size; }
+};
+
+
+class CTailInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ UInt64 _virtPos;
+public:
+ CMyComPtr<IInStream> Stream;
+ UInt64 Offset;
+
+ void Init()
+ {
+ _virtPos = 0;
+ }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+
+ HRESULT SeekToStart() { return Stream->Seek(Offset, STREAM_SEEK_SET, NULL); }
+};
+
+class CLimitedCachedInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<IInStream> _stream;
+ UInt64 _virtPos;
+ UInt64 _physPos;
+ UInt64 _size;
+ UInt64 _startOffset;
+
+ const Byte *_cache;
+ size_t _cacheSize;
+ size_t _cachePhyPos;
+
+
+ HRESULT SeekToPhys() { return _stream->Seek(_physPos, STREAM_SEEK_SET, NULL); }
+public:
+ CByteBuffer Buffer;
+
+ void SetStream(IInStream *stream) { _stream = stream; }
+ void SetCache(size_t cacheSize, size_t cachePos)
+ {
+ _cache = Buffer;
+ _cacheSize = cacheSize;
+ _cachePhyPos = cachePos;
+ }
+
+ HRESULT InitAndSeek(UInt64 startOffset, UInt64 size)
+ {
+ _startOffset = startOffset;
+ _physPos = startOffset;
+ _virtPos = 0;
+ _size = size;
+ return SeekToPhys();
+ }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+
+ HRESULT SeekToStart() { return Seek(0, STREAM_SEEK_SET, NULL); }
+};
+
+class CTailOutStream:
+ public IOutStream,
+ public CMyUnknownImp
+{
+ UInt64 _virtPos;
+ UInt64 _virtSize;
+public:
+ CMyComPtr<IOutStream> Stream;
+ UInt64 Offset;
+
+ virtual ~CTailOutStream() {}
+
+ MY_UNKNOWN_IMP2(ISequentialOutStream, IOutStream)
+
+ void Init()
+ {
+ _virtPos = 0;
+ _virtSize = 0;
+ }
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+ STDMETHOD(SetSize)(UInt64 newSize);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.cpp
new file mode 100644
index 0000000000..1223efe857
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.cpp
@@ -0,0 +1,3 @@
+// LockedStream.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.h b/other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.h
new file mode 100644
index 0000000000..5bf5c85a44
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/LockedStream.h
@@ -0,0 +1,6 @@
+// LockedStream.h
+
+#ifndef __LOCKED_STREAM_H
+#define __LOCKED_STREAM_H
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/MethodId.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/MethodId.cpp
new file mode 100644
index 0000000000..9a07e4c9a1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/MethodId.cpp
@@ -0,0 +1,3 @@
+// MethodId.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/MethodId.h b/other-licenses/7zstub/src/CPP/7zip/Common/MethodId.h
new file mode 100644
index 0000000000..1ba9f49afc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/MethodId.h
@@ -0,0 +1,10 @@
+// MethodId.h
+
+#ifndef __7Z_METHOD_ID_H
+#define __7Z_METHOD_ID_H
+
+#include "../../Common/MyTypes.h"
+
+typedef UInt64 CMethodId;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.cpp
new file mode 100644
index 0000000000..2134462c79
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.cpp
@@ -0,0 +1,509 @@
+// MethodProps.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/StringToInt.h"
+
+#include "MethodProps.h"
+
+using namespace NWindows;
+
+bool StringToBool(const wchar_t *s, bool &res)
+{
+ if (s[0] == 0 || (s[0] == '+' && s[1] == 0) || StringsAreEqualNoCase_Ascii(s, "ON"))
+ {
+ res = true;
+ return true;
+ }
+ if ((s[0] == '-' && s[1] == 0) || StringsAreEqualNoCase_Ascii(s, "OFF"))
+ {
+ res = false;
+ return true;
+ }
+ return false;
+}
+
+HRESULT PROPVARIANT_to_bool(const PROPVARIANT &prop, bool &dest)
+{
+ switch (prop.vt)
+ {
+ case VT_EMPTY: dest = true; return S_OK;
+ case VT_BOOL: dest = (prop.boolVal != VARIANT_FALSE); return S_OK;
+ case VT_BSTR: return StringToBool(prop.bstrVal, dest) ? S_OK : E_INVALIDARG;
+ }
+ return E_INVALIDARG;
+}
+
+unsigned ParseStringToUInt32(const UString &srcString, UInt32 &number)
+{
+ const wchar_t *start = srcString;
+ const wchar_t *end;
+ number = ConvertStringToUInt32(start, &end);
+ return (unsigned)(end - start);
+}
+
+static unsigned ParseStringToUInt64(const UString &srcString, UInt64 &number)
+{
+ const wchar_t *start = srcString;
+ const wchar_t *end;
+ number = ConvertStringToUInt64(start, &end);
+ return (unsigned)(end - start);
+}
+
+HRESULT ParsePropToUInt32(const UString &name, const PROPVARIANT &prop, UInt32 &resValue)
+{
+ // =VT_UI4
+ // =VT_EMPTY
+ // {stringUInt32}=VT_EMPTY
+
+ if (prop.vt == VT_UI4)
+ {
+ if (!name.IsEmpty())
+ return E_INVALIDARG;
+ resValue = prop.ulVal;
+ return S_OK;
+ }
+ if (prop.vt != VT_EMPTY)
+ return E_INVALIDARG;
+ if (name.IsEmpty())
+ return S_OK;
+ UInt32 v;
+ if (ParseStringToUInt32(name, v) != name.Len())
+ return E_INVALIDARG;
+ resValue = v;
+ return S_OK;
+}
+
+HRESULT ParseMtProp(const UString &name, const PROPVARIANT &prop, UInt32 defaultNumThreads, UInt32 &numThreads)
+{
+ if (name.IsEmpty())
+ {
+ switch (prop.vt)
+ {
+ case VT_UI4:
+ numThreads = prop.ulVal;
+ break;
+ default:
+ {
+ bool val;
+ RINOK(PROPVARIANT_to_bool(prop, val));
+ numThreads = (val ? defaultNumThreads : 1);
+ break;
+ }
+ }
+ return S_OK;
+ }
+ if (prop.vt != VT_EMPTY)
+ return E_INVALIDARG;
+ return ParsePropToUInt32(name, prop, numThreads);
+}
+
+
+static HRESULT StringToDictSize(const UString &s, NCOM::CPropVariant &destProp)
+{
+ const wchar_t *end;
+ UInt32 number = ConvertStringToUInt32(s, &end);
+ unsigned numDigits = (unsigned)(end - s.Ptr());
+ if (numDigits == 0 || s.Len() > numDigits + 1)
+ return E_INVALIDARG;
+
+ if (s.Len() == numDigits)
+ {
+ if (number >= 64)
+ return E_INVALIDARG;
+ if (number < 32)
+ destProp = (UInt32)((UInt32)1 << (unsigned)number);
+ else
+ destProp = (UInt64)((UInt64)1 << (unsigned)number);
+ return S_OK;
+ }
+
+ unsigned numBits;
+
+ switch (MyCharLower_Ascii(s[numDigits]))
+ {
+ case 'b': destProp = number; return S_OK;
+ case 'k': numBits = 10; break;
+ case 'm': numBits = 20; break;
+ case 'g': numBits = 30; break;
+ default: return E_INVALIDARG;
+ }
+
+ if (number < ((UInt32)1 << (32 - numBits)))
+ destProp = (UInt32)(number << numBits);
+ else
+ destProp = (UInt64)((UInt64)number << numBits);
+
+ return S_OK;
+}
+
+
+static HRESULT PROPVARIANT_to_DictSize(const PROPVARIANT &prop, NCOM::CPropVariant &destProp)
+{
+ if (prop.vt == VT_UI4)
+ {
+ UInt32 v = prop.ulVal;
+ if (v >= 64)
+ return E_INVALIDARG;
+ if (v < 32)
+ destProp = (UInt32)((UInt32)1 << (unsigned)v);
+ else
+ destProp = (UInt64)((UInt64)1 << (unsigned)v);
+ return S_OK;
+ }
+ if (prop.vt == VT_BSTR)
+ {
+ UString s;
+ s = prop.bstrVal;
+ return StringToDictSize(s, destProp);
+ }
+ return E_INVALIDARG;
+}
+
+
+void CProps::AddProp32(PROPID propid, UInt32 val)
+{
+ CProp &prop = Props.AddNew();
+ prop.IsOptional = true;
+ prop.Id = propid;
+ prop.Value = (UInt32)val;
+}
+
+void CProps::AddPropBool(PROPID propid, bool val)
+{
+ CProp &prop = Props.AddNew();
+ prop.IsOptional = true;
+ prop.Id = propid;
+ prop.Value = val;
+}
+
+class CCoderProps
+{
+ PROPID *_propIDs;
+ NCOM::CPropVariant *_props;
+ unsigned _numProps;
+ unsigned _numPropsMax;
+public:
+ CCoderProps(unsigned numPropsMax)
+ {
+ _numPropsMax = numPropsMax;
+ _numProps = 0;
+ _propIDs = new PROPID[numPropsMax];
+ _props = new NCOM::CPropVariant[numPropsMax];
+ }
+ ~CCoderProps()
+ {
+ delete []_propIDs;
+ delete []_props;
+ }
+ void AddProp(const CProp &prop);
+ HRESULT SetProps(ICompressSetCoderProperties *setCoderProperties)
+ {
+ return setCoderProperties->SetCoderProperties(_propIDs, _props, _numProps);
+ }
+};
+
+void CCoderProps::AddProp(const CProp &prop)
+{
+ if (_numProps >= _numPropsMax)
+ throw 1;
+ _propIDs[_numProps] = prop.Id;
+ _props[_numProps] = prop.Value;
+ _numProps++;
+}
+
+HRESULT CProps::SetCoderProps(ICompressSetCoderProperties *scp, const UInt64 *dataSizeReduce) const
+{
+ CCoderProps coderProps(Props.Size() + (dataSizeReduce ? 1 : 0));
+ FOR_VECTOR (i, Props)
+ coderProps.AddProp(Props[i]);
+ if (dataSizeReduce)
+ {
+ CProp prop;
+ prop.Id = NCoderPropID::kReduceSize;
+ prop.Value = *dataSizeReduce;
+ coderProps.AddProp(prop);
+ }
+ return coderProps.SetProps(scp);
+}
+
+
+int CMethodProps::FindProp(PROPID id) const
+{
+ for (int i = Props.Size() - 1; i >= 0; i--)
+ if (Props[i].Id == id)
+ return i;
+ return -1;
+}
+
+int CMethodProps::GetLevel() const
+{
+ int i = FindProp(NCoderPropID::kLevel);
+ if (i < 0)
+ return 5;
+ if (Props[i].Value.vt != VT_UI4)
+ return 9;
+ UInt32 level = Props[i].Value.ulVal;
+ return level > 9 ? 9 : (int)level;
+}
+
+struct CNameToPropID
+{
+ VARTYPE VarType;
+ const char *Name;
+};
+
+
+// the following are related to NCoderPropID::EEnum values
+
+static const CNameToPropID g_NameToPropID[] =
+{
+ { VT_UI4, "" },
+ { VT_UI4, "d" },
+ { VT_UI4, "mem" },
+ { VT_UI4, "o" },
+ { VT_UI4, "c" },
+ { VT_UI4, "pb" },
+ { VT_UI4, "lc" },
+ { VT_UI4, "lp" },
+ { VT_UI4, "fb" },
+ { VT_BSTR, "mf" },
+ { VT_UI4, "mc" },
+ { VT_UI4, "pass" },
+ { VT_UI4, "a" },
+ { VT_UI4, "mt" },
+ { VT_BOOL, "eos" },
+ { VT_UI4, "x" },
+ { VT_UI8, "reduce" },
+ { VT_UI8, "expect" },
+ { VT_UI4, "b" },
+ { VT_UI4, "check" },
+ { VT_BSTR, "filter" },
+ { VT_UI8, "memuse" }
+};
+
+static int FindPropIdExact(const UString &name)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(g_NameToPropID); i++)
+ if (StringsAreEqualNoCase_Ascii(name, g_NameToPropID[i].Name))
+ return i;
+ return -1;
+}
+
+static bool ConvertProperty(const PROPVARIANT &srcProp, VARTYPE varType, NCOM::CPropVariant &destProp)
+{
+ if (varType == srcProp.vt)
+ {
+ destProp = srcProp;
+ return true;
+ }
+
+ if (varType == VT_UI8 && srcProp.vt == VT_UI4)
+ {
+ destProp = (UInt64)srcProp.ulVal;
+ return true;
+ }
+
+ if (varType == VT_BOOL)
+ {
+ bool res;
+ if (PROPVARIANT_to_bool(srcProp, res) != S_OK)
+ return false;
+ destProp = res;
+ return true;
+ }
+ if (srcProp.vt == VT_EMPTY)
+ {
+ destProp = srcProp;
+ return true;
+ }
+ return false;
+}
+
+static void SplitParams(const UString &srcString, UStringVector &subStrings)
+{
+ subStrings.Clear();
+ UString s;
+ unsigned len = srcString.Len();
+ if (len == 0)
+ return;
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = srcString[i];
+ if (c == L':')
+ {
+ subStrings.Add(s);
+ s.Empty();
+ }
+ else
+ s += c;
+ }
+ subStrings.Add(s);
+}
+
+static void SplitParam(const UString &param, UString &name, UString &value)
+{
+ int eqPos = param.Find(L'=');
+ if (eqPos >= 0)
+ {
+ name.SetFrom(param, eqPos);
+ value = param.Ptr(eqPos + 1);
+ return;
+ }
+ unsigned i;
+ for (i = 0; i < param.Len(); i++)
+ {
+ wchar_t c = param[i];
+ if (c >= L'0' && c <= L'9')
+ break;
+ }
+ name.SetFrom(param, i);
+ value = param.Ptr(i);
+}
+
+static bool IsLogSizeProp(PROPID propid)
+{
+ switch (propid)
+ {
+ case NCoderPropID::kDictionarySize:
+ case NCoderPropID::kUsedMemorySize:
+ case NCoderPropID::kBlockSize:
+ case NCoderPropID::kBlockSize2:
+ // case NCoderPropID::kReduceSize:
+ return true;
+ }
+ return false;
+}
+
+HRESULT CMethodProps::SetParam(const UString &name, const UString &value)
+{
+ int index = FindPropIdExact(name);
+ if (index < 0)
+ return E_INVALIDARG;
+ const CNameToPropID &nameToPropID = g_NameToPropID[(unsigned)index];
+ CProp prop;
+ prop.Id = index;
+
+ if (IsLogSizeProp(prop.Id))
+ {
+ RINOK(StringToDictSize(value, prop.Value));
+ }
+ else
+ {
+ NCOM::CPropVariant propValue;
+ if (nameToPropID.VarType == VT_BSTR)
+ propValue = value;
+ else if (nameToPropID.VarType == VT_BOOL)
+ {
+ bool res;
+ if (!StringToBool(value, res))
+ return E_INVALIDARG;
+ propValue = res;
+ }
+ else if (!value.IsEmpty())
+ {
+ if (nameToPropID.VarType == VT_UI4)
+ {
+ UInt32 number;
+ if (ParseStringToUInt32(value, number) == value.Len())
+ propValue = number;
+ else
+ propValue = value;
+ }
+ else if (nameToPropID.VarType == VT_UI8)
+ {
+ UInt64 number;
+ if (ParseStringToUInt64(value, number) == value.Len())
+ propValue = number;
+ else
+ propValue = value;
+ }
+ else
+ propValue = value;
+ }
+ if (!ConvertProperty(propValue, nameToPropID.VarType, prop.Value))
+ return E_INVALIDARG;
+ }
+ Props.Add(prop);
+ return S_OK;
+}
+
+HRESULT CMethodProps::ParseParamsFromString(const UString &srcString)
+{
+ UStringVector params;
+ SplitParams(srcString, params);
+ FOR_VECTOR (i, params)
+ {
+ const UString &param = params[i];
+ UString name, value;
+ SplitParam(param, name, value);
+ RINOK(SetParam(name, value));
+ }
+ return S_OK;
+}
+
+HRESULT CMethodProps::ParseParamsFromPROPVARIANT(const UString &realName, const PROPVARIANT &value)
+{
+ if (realName.Len() == 0)
+ {
+ // [empty]=method
+ return E_INVALIDARG;
+ }
+ if (value.vt == VT_EMPTY)
+ {
+ // {realName}=[empty]
+ UString name, valueStr;
+ SplitParam(realName, name, valueStr);
+ return SetParam(name, valueStr);
+ }
+
+ // {realName}=value
+ int index = FindPropIdExact(realName);
+ if (index < 0)
+ return E_INVALIDARG;
+ const CNameToPropID &nameToPropID = g_NameToPropID[(unsigned)index];
+ CProp prop;
+ prop.Id = index;
+
+ if (IsLogSizeProp(prop.Id))
+ {
+ RINOK(PROPVARIANT_to_DictSize(value, prop.Value));
+ }
+ else
+ {
+ if (!ConvertProperty(value, nameToPropID.VarType, prop.Value))
+ return E_INVALIDARG;
+ }
+ Props.Add(prop);
+ return S_OK;
+}
+
+HRESULT COneMethodInfo::ParseMethodFromString(const UString &s)
+{
+ MethodName.Empty();
+ int splitPos = s.Find(L':');
+ {
+ UString temp = s;
+ if (splitPos >= 0)
+ temp.DeleteFrom(splitPos);
+ if (!temp.IsAscii())
+ return E_INVALIDARG;
+ MethodName.SetFromWStr_if_Ascii(temp);
+ }
+ if (splitPos < 0)
+ return S_OK;
+ PropsString = s.Ptr(splitPos + 1);
+ return ParseParamsFromString(PropsString);
+}
+
+HRESULT COneMethodInfo::ParseMethodFromPROPVARIANT(const UString &realName, const PROPVARIANT &value)
+{
+ if (!realName.IsEmpty() && !StringsAreEqualNoCase_Ascii(realName, "m"))
+ return ParseParamsFromPROPVARIANT(realName, value);
+ // -m{N}=method
+ if (value.vt != VT_BSTR)
+ return E_INVALIDARG;
+ UString s;
+ s = value.bstrVal;
+ return ParseMethodFromString(s);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.h b/other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.h
new file mode 100644
index 0000000000..c8a3d0dc3a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/MethodProps.h
@@ -0,0 +1,264 @@
+// MethodProps.h
+
+#ifndef __7Z_METHOD_PROPS_H
+#define __7Z_METHOD_PROPS_H
+
+#include "../../Common/MyString.h"
+#include "../../Common/Defs.h"
+
+#include "../../Windows/Defs.h"
+
+#include "../../Windows/PropVariant.h"
+
+#include "../ICoder.h"
+
+bool StringToBool(const wchar_t *s, bool &res);
+HRESULT PROPVARIANT_to_bool(const PROPVARIANT &prop, bool &dest);
+unsigned ParseStringToUInt32(const UString &srcString, UInt32 &number);
+HRESULT ParsePropToUInt32(const UString &name, const PROPVARIANT &prop, UInt32 &resValue);
+
+HRESULT ParseMtProp(const UString &name, const PROPVARIANT &prop, UInt32 defaultNumThreads, UInt32 &numThreads);
+
+struct CProp
+{
+ PROPID Id;
+ bool IsOptional;
+ NWindows::NCOM::CPropVariant Value;
+ CProp(): IsOptional(false) {}
+};
+
+struct CProps
+{
+ CObjectVector<CProp> Props;
+
+ void Clear() { Props.Clear(); }
+
+ bool AreThereNonOptionalProps() const
+ {
+ FOR_VECTOR (i, Props)
+ if (!Props[i].IsOptional)
+ return true;
+ return false;
+ }
+
+ void AddProp32(PROPID propid, UInt32 val);
+
+ void AddPropBool(PROPID propid, bool val);
+
+ void AddProp_Ascii(PROPID propid, const char *s)
+ {
+ CProp &prop = Props.AddNew();
+ prop.IsOptional = true;
+ prop.Id = propid;
+ prop.Value = s;
+ }
+
+ HRESULT SetCoderProps(ICompressSetCoderProperties *scp, const UInt64 *dataSizeReduce) const;
+};
+
+class CMethodProps: public CProps
+{
+ HRESULT SetParam(const UString &name, const UString &value);
+public:
+ int GetLevel() const;
+ int Get_NumThreads() const
+ {
+ int i = FindProp(NCoderPropID::kNumThreads);
+ if (i >= 0)
+ if (Props[i].Value.vt == VT_UI4)
+ return (int)Props[i].Value.ulVal;
+ return -1;
+ }
+
+ bool Get_DicSize(UInt32 &res) const
+ {
+ res = 0;
+ int i = FindProp(NCoderPropID::kDictionarySize);
+ if (i >= 0)
+ if (Props[i].Value.vt == VT_UI4)
+ {
+ res = Props[i].Value.ulVal;
+ return true;
+ }
+ return false;
+ }
+
+ int FindProp(PROPID id) const;
+
+ UInt32 Get_Lzma_Algo() const
+ {
+ int i = FindProp(NCoderPropID::kAlgorithm);
+ if (i >= 0)
+ if (Props[i].Value.vt == VT_UI4)
+ return Props[i].Value.ulVal;
+ return GetLevel() >= 5 ? 1 : 0;
+ }
+
+ UInt32 Get_Lzma_DicSize() const
+ {
+ int i = FindProp(NCoderPropID::kDictionarySize);
+ if (i >= 0)
+ if (Props[i].Value.vt == VT_UI4)
+ return Props[i].Value.ulVal;
+ int level = GetLevel();
+ return level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26));
+ }
+
+ bool Get_Lzma_Eos() const
+ {
+ int i = FindProp(NCoderPropID::kEndMarker);
+ if (i >= 0)
+ {
+ const NWindows::NCOM::CPropVariant &val = Props[i].Value;
+ if (val.vt == VT_BOOL)
+ return VARIANT_BOOLToBool(val.boolVal);
+ }
+ return false;
+ }
+
+ bool Are_Lzma_Model_Props_Defined() const
+ {
+ if (FindProp(NCoderPropID::kPosStateBits) >= 0) return true;
+ if (FindProp(NCoderPropID::kLitContextBits) >= 0) return true;
+ if (FindProp(NCoderPropID::kLitPosBits) >= 0) return true;
+ return false;
+ }
+
+ UInt32 Get_Lzma_NumThreads() const
+ {
+ if (Get_Lzma_Algo() == 0)
+ return 1;
+ int numThreads = Get_NumThreads();
+ if (numThreads >= 0)
+ return numThreads < 2 ? 1 : 2;
+ return 2;
+ }
+
+ int Get_Xz_NumThreads(UInt32 &lzmaThreads) const
+ {
+ lzmaThreads = 1;
+ int numThreads = Get_NumThreads();
+ if (numThreads >= 0 && numThreads <= 1)
+ return 1;
+ if (Get_Lzma_Algo() != 0)
+ lzmaThreads = 2;
+ return numThreads;
+ }
+
+ UInt64 GetProp_BlockSize(PROPID id) const
+ {
+ int i = FindProp(id);
+ if (i >= 0)
+ {
+ const NWindows::NCOM::CPropVariant &val = Props[i].Value;
+ if (val.vt == VT_UI4) { return val.ulVal; }
+ if (val.vt == VT_UI8) { return val.uhVal.QuadPart; }
+ }
+ return 0;
+ }
+
+ UInt64 Get_Xz_BlockSize() const
+ {
+ {
+ UInt64 blockSize1 = GetProp_BlockSize(NCoderPropID::kBlockSize);
+ UInt64 blockSize2 = GetProp_BlockSize(NCoderPropID::kBlockSize2);
+ UInt64 minSize = MyMin(blockSize1, blockSize2);
+ if (minSize != 0)
+ return minSize;
+ UInt64 maxSize = MyMax(blockSize1, blockSize2);
+ if (maxSize != 0)
+ return maxSize;
+ }
+ const UInt32 kMinSize = (UInt32)1 << 20;
+ const UInt32 kMaxSize = (UInt32)1 << 28;
+ UInt32 dictSize = Get_Lzma_DicSize();
+ UInt64 blockSize = (UInt64)dictSize << 2;
+ if (blockSize < kMinSize) blockSize = kMinSize;
+ if (blockSize > kMaxSize) blockSize = kMaxSize;
+ if (blockSize < dictSize) blockSize = dictSize;
+ blockSize += (kMinSize - 1);
+ blockSize &= ~(UInt64)(kMinSize - 1);
+ return blockSize;
+ }
+
+
+ UInt32 Get_BZip2_NumThreads(bool &fixedNumber) const
+ {
+ fixedNumber = false;
+ int numThreads = Get_NumThreads();
+ if (numThreads >= 0)
+ {
+ fixedNumber = true;
+ if (numThreads < 1) return 1;
+ const unsigned kNumBZip2ThreadsMax = 64;
+ if (numThreads > kNumBZip2ThreadsMax) return kNumBZip2ThreadsMax;
+ return numThreads;
+ }
+ return 1;
+ }
+
+ UInt32 Get_BZip2_BlockSize() const
+ {
+ int i = FindProp(NCoderPropID::kDictionarySize);
+ if (i >= 0)
+ if (Props[i].Value.vt == VT_UI4)
+ {
+ UInt32 blockSize = Props[i].Value.ulVal;
+ const UInt32 kDicSizeMin = 100000;
+ const UInt32 kDicSizeMax = 900000;
+ if (blockSize < kDicSizeMin) blockSize = kDicSizeMin;
+ if (blockSize > kDicSizeMax) blockSize = kDicSizeMax;
+ return blockSize;
+ }
+ int level = GetLevel();
+ return 100000 * (level >= 5 ? 9 : (level >= 1 ? level * 2 - 1: 1));
+ }
+
+ UInt32 Get_Ppmd_MemSize() const
+ {
+ int i = FindProp(NCoderPropID::kUsedMemorySize);
+ if (i >= 0)
+ if (Props[i].Value.vt == VT_UI4)
+ return Props[i].Value.ulVal;
+ int level = GetLevel();
+ return level >= 9 ? (192 << 20) : ((UInt32)1 << (level + 19));
+ }
+
+ void AddProp_Level(UInt32 level)
+ {
+ AddProp32(NCoderPropID::kLevel, level);
+ }
+
+ void AddProp_NumThreads(UInt32 numThreads)
+ {
+ AddProp32(NCoderPropID::kNumThreads, numThreads);
+ }
+
+ void AddProp_EndMarker_if_NotFound(bool eos)
+ {
+ if (FindProp(NCoderPropID::kEndMarker) < 0)
+ AddPropBool(NCoderPropID::kEndMarker, eos);
+ }
+
+ HRESULT ParseParamsFromString(const UString &srcString);
+ HRESULT ParseParamsFromPROPVARIANT(const UString &realName, const PROPVARIANT &value);
+};
+
+class COneMethodInfo: public CMethodProps
+{
+public:
+ AString MethodName;
+ UString PropsString;
+
+ void Clear()
+ {
+ CMethodProps::Clear();
+ MethodName.Empty();
+ PropsString.Empty();
+ }
+ bool IsEmpty() const { return MethodName.IsEmpty() && Props.IsEmpty(); }
+ HRESULT ParseMethodFromPROPVARIANT(const UString &realName, const PROPVARIANT &value);
+ HRESULT ParseMethodFromString(const UString &s);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.cpp
new file mode 100644
index 0000000000..3b01c7f651
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.cpp
@@ -0,0 +1,39 @@
+// OffsetStream.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/Defs.h"
+
+#include "OffsetStream.h"
+
+HRESULT COffsetOutStream::Init(IOutStream *stream, UInt64 offset)
+{
+ _offset = offset;
+ _stream = stream;
+ return _stream->Seek(offset, STREAM_SEEK_SET, NULL);
+}
+
+STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ return _stream->Write(data, size, processedSize);
+}
+
+STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ UInt64 absoluteNewPosition;
+ if (seekOrigin == STREAM_SEEK_SET)
+ {
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ offset += _offset;
+ }
+ HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
+ if (newPosition)
+ *newPosition = absoluteNewPosition - _offset;
+ return result;
+}
+
+STDMETHODIMP COffsetOutStream::SetSize(UInt64 newSize)
+{
+ return _stream->SetSize(_offset + newSize);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.h b/other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.h
new file mode 100644
index 0000000000..ad835f2dfc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/OffsetStream.h
@@ -0,0 +1,26 @@
+// OffsetStream.h
+
+#ifndef __OFFSET_STREAM_H
+#define __OFFSET_STREAM_H
+
+#include "../../Common/MyCom.h"
+
+#include "../IStream.h"
+
+class COffsetOutStream:
+ public IOutStream,
+ public CMyUnknownImp
+{
+ UInt64 _offset;
+ CMyComPtr<IOutStream> _stream;
+public:
+ HRESULT Init(IOutStream *stream, UInt64 offset);
+
+ MY_UNKNOWN_IMP
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+ STDMETHOD(SetSize)(UInt64 newSize);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.cpp
new file mode 100644
index 0000000000..fb8dc8d16d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.cpp
@@ -0,0 +1,111 @@
+// OutBuffer.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "OutBuffer.h"
+
+bool COutBuffer::Create(UInt32 bufSize) throw()
+{
+ const UInt32 kMinBlockSize = 1;
+ if (bufSize < kMinBlockSize)
+ bufSize = kMinBlockSize;
+ if (_buf != 0 && _bufSize == bufSize)
+ return true;
+ Free();
+ _bufSize = bufSize;
+ _buf = (Byte *)::MidAlloc(bufSize);
+ return (_buf != 0);
+}
+
+void COutBuffer::Free() throw()
+{
+ ::MidFree(_buf);
+ _buf = 0;
+}
+
+void COutBuffer::Init() throw()
+{
+ _streamPos = 0;
+ _limitPos = _bufSize;
+ _pos = 0;
+ _processedSize = 0;
+ _overDict = false;
+ #ifdef _NO_EXCEPTIONS
+ ErrorCode = S_OK;
+ #endif
+}
+
+UInt64 COutBuffer::GetProcessedSize() const throw()
+{
+ UInt64 res = _processedSize + _pos - _streamPos;
+ if (_streamPos > _pos)
+ res += _bufSize;
+ return res;
+}
+
+
+HRESULT COutBuffer::FlushPart() throw()
+{
+ // _streamPos < _bufSize
+ UInt32 size = (_streamPos >= _pos) ? (_bufSize - _streamPos) : (_pos - _streamPos);
+ HRESULT result = S_OK;
+ #ifdef _NO_EXCEPTIONS
+ result = ErrorCode;
+ #endif
+ if (_buf2 != 0)
+ {
+ memcpy(_buf2, _buf + _streamPos, size);
+ _buf2 += size;
+ }
+
+ if (_stream != 0
+ #ifdef _NO_EXCEPTIONS
+ && (ErrorCode == S_OK)
+ #endif
+ )
+ {
+ UInt32 processedSize = 0;
+ result = _stream->Write(_buf + _streamPos, size, &processedSize);
+ size = processedSize;
+ }
+ _streamPos += size;
+ if (_streamPos == _bufSize)
+ _streamPos = 0;
+ if (_pos == _bufSize)
+ {
+ _overDict = true;
+ _pos = 0;
+ }
+ _limitPos = (_streamPos > _pos) ? _streamPos : _bufSize;
+ _processedSize += size;
+ return result;
+}
+
+HRESULT COutBuffer::Flush() throw()
+{
+ #ifdef _NO_EXCEPTIONS
+ if (ErrorCode != S_OK)
+ return ErrorCode;
+ #endif
+
+ while (_streamPos != _pos)
+ {
+ HRESULT result = FlushPart();
+ if (result != S_OK)
+ return result;
+ }
+ return S_OK;
+}
+
+void COutBuffer::FlushWithCheck()
+{
+ HRESULT result = Flush();
+ #ifdef _NO_EXCEPTIONS
+ ErrorCode = result;
+ #else
+ if (result != S_OK)
+ throw COutBufferException(result);
+ #endif
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.h b/other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.h
new file mode 100644
index 0000000000..2ffb5cd323
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/OutBuffer.h
@@ -0,0 +1,66 @@
+// OutBuffer.h
+
+#ifndef __OUT_BUFFER_H
+#define __OUT_BUFFER_H
+
+#include "../IStream.h"
+#include "../../Common/MyCom.h"
+#include "../../Common/MyException.h"
+
+#ifndef _NO_EXCEPTIONS
+struct COutBufferException: public CSystemException
+{
+ COutBufferException(HRESULT errorCode): CSystemException(errorCode) {}
+};
+#endif
+
+class COutBuffer
+{
+protected:
+ Byte *_buf;
+ UInt32 _pos;
+ UInt32 _limitPos;
+ UInt32 _streamPos;
+ UInt32 _bufSize;
+ ISequentialOutStream *_stream;
+ UInt64 _processedSize;
+ Byte *_buf2;
+ bool _overDict;
+
+ HRESULT FlushPart() throw();
+public:
+ #ifdef _NO_EXCEPTIONS
+ HRESULT ErrorCode;
+ #endif
+
+ COutBuffer(): _buf(0), _pos(0), _stream(0), _buf2(0) {}
+ ~COutBuffer() { Free(); }
+
+ bool Create(UInt32 bufSize) throw();
+ void Free() throw();
+
+ void SetMemStream(Byte *buf) { _buf2 = buf; }
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void Init() throw();
+ HRESULT Flush() throw();
+ void FlushWithCheck();
+
+ void WriteByte(Byte b)
+ {
+ UInt32 pos = _pos;
+ _buf[pos] = b;
+ pos++;
+ _pos = pos;
+ if (pos == _limitPos)
+ FlushWithCheck();
+ }
+ void WriteBytes(const void *data, size_t size)
+ {
+ for (size_t i = 0; i < size; i++)
+ WriteByte(((const Byte *)data)[i]);
+ }
+
+ UInt64 GetProcessedSize() const throw();
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.cpp
new file mode 100644
index 0000000000..86f1e78268
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.cpp
@@ -0,0 +1,51 @@
+// ProgressUtils.cpp
+
+#include "StdAfx.h"
+
+#include "ProgressUtils.h"
+
+CLocalProgress::CLocalProgress():
+ ProgressOffset(0),
+ InSize(0),
+ OutSize(0),
+ SendRatio(true),
+ SendProgress(true)
+ {}
+
+void CLocalProgress::Init(IProgress *progress, bool inSizeIsMain)
+{
+ _ratioProgress.Release();
+ _progress = progress;
+ _progress.QueryInterface(IID_ICompressProgressInfo, &_ratioProgress);
+ _inSizeIsMain = inSizeIsMain;
+}
+
+STDMETHODIMP CLocalProgress::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ UInt64 inSize2 = InSize;
+ UInt64 outSize2 = OutSize;
+
+ if (inSize)
+ inSize2 += (*inSize);
+ if (outSize)
+ outSize2 += (*outSize);
+
+ if (SendRatio && _ratioProgress)
+ {
+ RINOK(_ratioProgress->SetRatioInfo(&inSize2, &outSize2));
+ }
+
+ if (SendProgress)
+ {
+ inSize2 += ProgressOffset;
+ outSize2 += ProgressOffset;
+ return _progress->SetCompleted(_inSizeIsMain ? &inSize2 : &outSize2);
+ }
+
+ return S_OK;
+}
+
+HRESULT CLocalProgress::SetCur()
+{
+ return SetRatioInfo(NULL, NULL);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.h b/other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.h
new file mode 100644
index 0000000000..176e8bb438
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/ProgressUtils.h
@@ -0,0 +1,35 @@
+// ProgressUtils.h
+
+#ifndef __PROGRESS_UTILS_H
+#define __PROGRESS_UTILS_H
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+#include "../IProgress.h"
+
+class CLocalProgress:
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+ CMyComPtr<IProgress> _progress;
+ CMyComPtr<ICompressProgressInfo> _ratioProgress;
+ bool _inSizeIsMain;
+public:
+ UInt64 ProgressOffset;
+ UInt64 InSize;
+ UInt64 OutSize;
+ bool SendRatio;
+ bool SendProgress;
+
+ CLocalProgress();
+
+ void Init(IProgress *progress, bool inSizeIsMain);
+ HRESULT SetCur();
+
+ MY_UNKNOWN_IMP1(ICompressProgressInfo)
+
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/PropId.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/PropId.cpp
new file mode 100644
index 0000000000..96f8f0564f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/PropId.cpp
@@ -0,0 +1,108 @@
+// PropId.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/MyWindows.h"
+
+#include "../PropID.h"
+
+// VARTYPE
+const Byte k7z_PROPID_To_VARTYPE[kpid_NUM_DEFINED] =
+{
+ VT_EMPTY,
+ VT_UI4,
+ VT_UI4,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BOOL,
+ VT_UI8,
+ VT_UI8,
+ VT_UI4,
+ VT_FILETIME,
+ VT_FILETIME,
+ VT_FILETIME,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BOOL,
+ VT_UI4,
+ VT_UI4,
+ VT_BSTR,
+ VT_BOOL,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR,
+ VT_UI8,
+ VT_BSTR,
+ VT_UI8,
+ VT_BSTR,
+ VT_UI8,
+ VT_UI8,
+ VT_BSTR, // or VT_UI8 kpidUnpackVer
+ VT_UI4, // or VT_UI8 kpidVolume
+ VT_BOOL,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_UI4,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BSTR,
+ VT_UI8,
+ VT_UI8,
+ VT_UI4, // kpidChecksum
+ VT_BSTR,
+ VT_UI8,
+ VT_BSTR, // or VT_UI8 kpidId
+ VT_BSTR,
+ VT_BSTR,
+ VT_UI4,
+ VT_UI4,
+ VT_BSTR,
+ VT_BSTR,
+ VT_UI8,
+ VT_UI8,
+ VT_UI4,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR, // kpidNtSecure
+ VT_BOOL,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BSTR, // SHA-1
+ VT_BSTR, // SHA-256
+ VT_BSTR,
+ VT_UI8,
+ VT_UI4,
+ VT_UI4,
+ VT_BSTR,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_UI8,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BSTR,
+ VT_BOOL,
+ VT_BOOL,
+ VT_BOOL,
+ VT_UI8,
+ VT_UI8,
+ VT_BSTR, // kpidNtReparse
+ VT_BSTR,
+ VT_UI8,
+ VT_UI8,
+ VT_BOOL,
+ VT_BSTR,
+ VT_BSTR
+};
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/RegisterArc.h b/other-licenses/7zstub/src/CPP/7zip/Common/RegisterArc.h
new file mode 100644
index 0000000000..08aa2d478e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/RegisterArc.h
@@ -0,0 +1,78 @@
+// RegisterArc.h
+
+#ifndef __REGISTER_ARC_H
+#define __REGISTER_ARC_H
+
+#include "../Archive/IArchive.h"
+
+struct CArcInfo
+{
+ UInt16 Flags;
+ Byte Id;
+ Byte SignatureSize;
+ UInt16 SignatureOffset;
+
+ const Byte *Signature;
+ const char *Name;
+ const char *Ext;
+ const char *AddExt;
+
+ Func_CreateInArchive CreateInArchive;
+ Func_CreateOutArchive CreateOutArchive;
+ Func_IsArc IsArc;
+
+ bool IsMultiSignature() const { return (Flags & NArcInfoFlags::kMultiSignature) != 0; }
+};
+
+void RegisterArc(const CArcInfo *arcInfo) throw();
+
+
+#define IMP_CreateArcIn_2(c) \
+ static IInArchive *CreateArc() { return new c; }
+
+#define IMP_CreateArcIn IMP_CreateArcIn_2(CHandler())
+
+#ifdef EXTRACT_ONLY
+ #define IMP_CreateArcOut
+ #define CreateArcOut NULL
+#else
+ #define IMP_CreateArcOut static IOutArchive *CreateArcOut() { return new CHandler(); }
+#endif
+
+#define REGISTER_ARC_V(n, e, ae, id, sigSize, sig, offs, flags, crIn, crOut, isArc) \
+ static const CArcInfo g_ArcInfo = { flags, id, sigSize, offs, sig, n, e, ae, crIn, crOut, isArc } ; \
+
+#define REGISTER_ARC_R(n, e, ae, id, sigSize, sig, offs, flags, crIn, crOut, isArc) \
+ REGISTER_ARC_V(n, e, ae, id, sigSize, sig, offs, flags, crIn, crOut, isArc) \
+ struct CRegisterArc { CRegisterArc() { RegisterArc(&g_ArcInfo); }}; \
+ static CRegisterArc g_RegisterArc;
+
+
+#define REGISTER_ARC_I_CLS(cls, n, e, ae, id, sig, offs, flags, isArc) \
+ IMP_CreateArcIn_2(cls) \
+ REGISTER_ARC_R(n, e, ae, id, ARRAY_SIZE(sig), sig, offs, flags, CreateArc, NULL, isArc)
+
+#define REGISTER_ARC_I_CLS_NO_SIG(cls, n, e, ae, id, offs, flags, isArc) \
+ IMP_CreateArcIn_2(cls) \
+ REGISTER_ARC_R(n, e, ae, id, 0, NULL, offs, flags, CreateArc, NULL, isArc)
+
+#define REGISTER_ARC_I(n, e, ae, id, sig, offs, flags, isArc) \
+ REGISTER_ARC_I_CLS(CHandler(), n, e, ae, id, sig, offs, flags, isArc)
+
+#define REGISTER_ARC_I_NO_SIG(n, e, ae, id, offs, flags, isArc) \
+ REGISTER_ARC_I_CLS_NO_SIG(CHandler(), n, e, ae, id, offs, flags, isArc)
+
+
+#define REGISTER_ARC_IO(n, e, ae, id, sig, offs, flags, isArc) \
+ IMP_CreateArcIn \
+ IMP_CreateArcOut \
+ REGISTER_ARC_R(n, e, ae, id, ARRAY_SIZE(sig), sig, offs, flags, CreateArc, CreateArcOut, isArc)
+
+#define REGISTER_ARC_IO_DECREMENT_SIG(n, e, ae, id, sig, offs, flags, isArc) \
+ IMP_CreateArcIn \
+ IMP_CreateArcOut \
+ REGISTER_ARC_V(n, e, ae, id, ARRAY_SIZE(sig), sig, offs, flags, CreateArc, CreateArcOut, isArc) \
+ struct CRegisterArcDecSig { CRegisterArcDecSig() { sig[0]--; RegisterArc(&g_ArcInfo); }}; \
+ static CRegisterArcDecSig g_RegisterArc;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/RegisterCodec.h b/other-licenses/7zstub/src/CPP/7zip/Common/RegisterCodec.h
new file mode 100644
index 0000000000..b5660658fd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/RegisterCodec.h
@@ -0,0 +1,106 @@
+// RegisterCodec.h
+
+#ifndef __REGISTER_CODEC_H
+#define __REGISTER_CODEC_H
+
+#include "../Common/MethodId.h"
+
+#include "../ICoder.h"
+
+typedef void * (*CreateCodecP)();
+
+struct CCodecInfo
+{
+ CreateCodecP CreateDecoder;
+ CreateCodecP CreateEncoder;
+ CMethodId Id;
+ const char *Name;
+ UInt32 NumStreams;
+ bool IsFilter;
+};
+
+void RegisterCodec(const CCodecInfo *codecInfo) throw();
+
+
+#define REGISTER_CODEC_CREATE_2(name, cls, i) static void *name() { return (void *)(i *)(new cls); }
+#define REGISTER_CODEC_CREATE(name, cls) REGISTER_CODEC_CREATE_2(name, cls, ICompressCoder)
+
+#define REGISTER_CODEC_NAME(x) CRegisterCodec ## x
+#define REGISTER_CODEC_VAR static const CCodecInfo g_CodecInfo =
+
+#define REGISTER_CODEC(x) struct REGISTER_CODEC_NAME(x) { \
+ REGISTER_CODEC_NAME(x)() { RegisterCodec(&g_CodecInfo); }}; \
+ static REGISTER_CODEC_NAME(x) g_RegisterCodec;
+
+
+#define REGISTER_CODECS_NAME(x) CRegisterCodecs ## x
+#define REGISTER_CODECS_VAR static const CCodecInfo g_CodecsInfo[] =
+
+#define REGISTER_CODECS(x) struct REGISTER_CODECS_NAME(x) { \
+ REGISTER_CODECS_NAME(x)() { for (unsigned i = 0; i < ARRAY_SIZE(g_CodecsInfo); i++) \
+ RegisterCodec(&g_CodecsInfo[i]); }}; \
+ static REGISTER_CODECS_NAME(x) g_RegisterCodecs;
+
+
+#define REGISTER_CODEC_2(x, crDec, crEnc, id, name) \
+ REGISTER_CODEC_VAR \
+ { crDec, crEnc, id, name, 1, false }; \
+ REGISTER_CODEC(x)
+
+
+#ifdef EXTRACT_ONLY
+ #define REGISTER_CODEC_E(x, clsDec, clsEnc, id, name) \
+ REGISTER_CODEC_CREATE(CreateDec, clsDec) \
+ REGISTER_CODEC_2(x, CreateDec, NULL, id, name)
+#else
+ #define REGISTER_CODEC_E(x, clsDec, clsEnc, id, name) \
+ REGISTER_CODEC_CREATE(CreateDec, clsDec) \
+ REGISTER_CODEC_CREATE(CreateEnc, clsEnc) \
+ REGISTER_CODEC_2(x, CreateDec, CreateEnc, id, name)
+#endif
+
+
+
+#define REGISTER_FILTER_CREATE(name, cls) REGISTER_CODEC_CREATE_2(name, cls, ICompressFilter)
+
+#define REGISTER_FILTER_ITEM(crDec, crEnc, id, name) \
+ { crDec, crEnc, id, name, 1, true }
+
+#define REGISTER_FILTER(x, crDec, crEnc, id, name) \
+ REGISTER_CODEC_VAR \
+ REGISTER_FILTER_ITEM(crDec, crEnc, id, name); \
+ REGISTER_CODEC(x)
+
+#ifdef EXTRACT_ONLY
+ #define REGISTER_FILTER_E(x, clsDec, clsEnc, id, name) \
+ REGISTER_FILTER_CREATE(CreateDec, clsDec) \
+ REGISTER_FILTER(x, CreateDec, NULL, id, name)
+#else
+ #define REGISTER_FILTER_E(x, clsDec, clsEnc, id, name) \
+ REGISTER_FILTER_CREATE(CreateDec, clsDec) \
+ REGISTER_FILTER_CREATE(CreateEnc, clsEnc) \
+ REGISTER_FILTER(x, CreateDec, CreateEnc, id, name)
+#endif
+
+
+
+struct CHasherInfo
+{
+ IHasher * (*CreateHasher)();
+ CMethodId Id;
+ const char *Name;
+ UInt32 DigestSize;
+};
+
+void RegisterHasher(const CHasherInfo *hasher) throw();
+
+#define REGISTER_HASHER_NAME(x) CRegHasher_ ## x
+
+#define REGISTER_HASHER(cls, id, name, size) \
+ STDMETHODIMP_(UInt32) cls::GetDigestSize() throw() { return size; } \
+ static IHasher *CreateHasherSpec() { return new cls(); } \
+ static const CHasherInfo g_HasherInfo = { CreateHasherSpec, id, name, size }; \
+ struct REGISTER_HASHER_NAME(cls) { REGISTER_HASHER_NAME(cls)() { RegisterHasher(&g_HasherInfo); }}; \
+ static REGISTER_HASHER_NAME(cls) g_RegisterHasher;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Common/StdAfx.h
new file mode 100644
index 0000000000..42a088f121
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.cpp
new file mode 100644
index 0000000000..a6627db213
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.cpp
@@ -0,0 +1,156 @@
+// StreamBinder.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/MyCom.h"
+
+#include "StreamBinder.h"
+
+class CBinderInStream:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+ CStreamBinder *_binder;
+public:
+ MY_UNKNOWN_IMP1(ISequentialInStream)
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ ~CBinderInStream() { _binder->CloseRead(); }
+ CBinderInStream(CStreamBinder *binder): _binder(binder) {}
+};
+
+STDMETHODIMP CBinderInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+ { return _binder->Read(data, size, processedSize); }
+
+class CBinderOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CStreamBinder *_binder;
+public:
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ ~CBinderOutStream() { _binder->CloseWrite(); }
+ CBinderOutStream(CStreamBinder *binder): _binder(binder) {}
+};
+
+STDMETHODIMP CBinderOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+ { return _binder->Write(data, size, processedSize); }
+
+
+
+WRes CStreamBinder::CreateEvents()
+{
+ RINOK(_canWrite_Event.Create());
+ RINOK(_canRead_Event.Create());
+ return _readingWasClosed_Event.Create();
+}
+
+void CStreamBinder::ReInit()
+{
+ _canWrite_Event.Reset();
+ _canRead_Event.Reset();
+ _readingWasClosed_Event.Reset();
+
+ // _readingWasClosed = false;
+ _readingWasClosed2 = false;
+
+ _waitWrite = true;
+ _bufSize = 0;
+ _buf = NULL;
+ ProcessedSize = 0;
+ // WritingWasCut = false;
+}
+
+
+void CStreamBinder::CreateStreams(ISequentialInStream **inStream, ISequentialOutStream **outStream)
+{
+ // _readingWasClosed = false;
+ _readingWasClosed2 = false;
+
+ _waitWrite = true;
+ _bufSize = 0;
+ _buf = NULL;
+ ProcessedSize = 0;
+ // WritingWasCut = false;
+
+ CBinderInStream *inStreamSpec = new CBinderInStream(this);
+ CMyComPtr<ISequentialInStream> inStreamLoc(inStreamSpec);
+ *inStream = inStreamLoc.Detach();
+
+ CBinderOutStream *outStreamSpec = new CBinderOutStream(this);
+ CMyComPtr<ISequentialOutStream> outStreamLoc(outStreamSpec);
+ *outStream = outStreamLoc.Detach();
+}
+
+// (_canRead_Event && _bufSize == 0) means that stream is finished.
+
+HRESULT CStreamBinder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size != 0)
+ {
+ if (_waitWrite)
+ {
+ RINOK(_canRead_Event.Lock());
+ _waitWrite = false;
+ }
+ if (size > _bufSize)
+ size = _bufSize;
+ if (size != 0)
+ {
+ memcpy(data, _buf, size);
+ _buf = ((const Byte *)_buf) + size;
+ ProcessedSize += size;
+ if (processedSize)
+ *processedSize = size;
+ _bufSize -= size;
+ if (_bufSize == 0)
+ {
+ _waitWrite = true;
+ _canRead_Event.Reset();
+ _canWrite_Event.Set();
+ }
+ }
+ }
+ return S_OK;
+}
+
+HRESULT CStreamBinder::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+
+ if (!_readingWasClosed2)
+ {
+ _buf = data;
+ _bufSize = size;
+ _canRead_Event.Set();
+
+ /*
+ _canWrite_Event.Lock();
+ if (_readingWasClosed)
+ _readingWasClosed2 = true;
+ */
+
+ HANDLE events[2] = { _canWrite_Event, _readingWasClosed_Event };
+ DWORD waitResult = ::WaitForMultipleObjects(2, events, FALSE, INFINITE);
+ if (waitResult >= WAIT_OBJECT_0 + 2)
+ return E_FAIL;
+
+ size -= _bufSize;
+ if (size != 0)
+ {
+ if (processedSize)
+ *processedSize = size;
+ return S_OK;
+ }
+ // if (waitResult == WAIT_OBJECT_0 + 1)
+ _readingWasClosed2 = true;
+ }
+
+ // WritingWasCut = true;
+ return k_My_HRESULT_WritingWasCut;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.h b/other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.h
new file mode 100644
index 0000000000..f4d4f3b42c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StreamBinder.h
@@ -0,0 +1,60 @@
+// StreamBinder.h
+
+#ifndef __STREAM_BINDER_H
+#define __STREAM_BINDER_H
+
+#include "../../Windows/Synchronization.h"
+
+#include "../IStream.h"
+
+/*
+We don't use probably UNSAFE version:
+reader thread:
+ _canWrite_Event.Set();
+ _readingWasClosed = true
+ _canWrite_Event.Set();
+writer thread:
+ _canWrite_Event.Wait()
+ if (_readingWasClosed)
+Can second call of _canWrite_Event.Set() be executed without memory barrier, if event is already set?
+*/
+
+class CStreamBinder
+{
+ NWindows::NSynchronization::CAutoResetEvent _canWrite_Event;
+ NWindows::NSynchronization::CManualResetEvent _canRead_Event;
+ NWindows::NSynchronization::CManualResetEvent _readingWasClosed_Event;
+
+ // bool _readingWasClosed;
+ bool _readingWasClosed2;
+ // bool WritingWasCut;
+ bool _waitWrite;
+ UInt32 _bufSize;
+ const void *_buf;
+public:
+ UInt64 ProcessedSize;
+
+ WRes CreateEvents();
+ void CreateStreams(ISequentialInStream **inStream, ISequentialOutStream **outStream);
+
+ void ReInit();
+
+ HRESULT Read(void *data, UInt32 size, UInt32 *processedSize);
+ HRESULT Write(const void *data, UInt32 size, UInt32 *processedSize);
+
+ void CloseRead()
+ {
+ _readingWasClosed_Event.Set();
+ // _readingWasClosed = true;
+ // _canWrite_Event.Set();
+ }
+
+ void CloseWrite()
+ {
+ _buf = NULL;
+ _bufSize = 0;
+ _canRead_Event.Set();
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.cpp
new file mode 100644
index 0000000000..4cd9cc65be
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.cpp
@@ -0,0 +1,285 @@
+// StreamObjects.cpp
+
+#include "StdAfx.h"
+
+#include <stdlib.h>
+
+#include "../../../C/Alloc.h"
+
+#include "StreamObjects.h"
+
+STDMETHODIMP CBufferInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ if (_pos >= Buf.Size())
+ return S_OK;
+ size_t rem = Buf.Size() - (size_t)_pos;
+ if (rem > size)
+ rem = (size_t)size;
+ memcpy(data, (const Byte *)Buf + (size_t)_pos, rem);
+ _pos += rem;
+ if (processedSize)
+ *processedSize = (UInt32)rem;
+ return S_OK;
+}
+
+STDMETHODIMP CBufferInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _pos; break;
+ case STREAM_SEEK_END: offset += Buf.Size(); break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _pos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
+
+STDMETHODIMP CBufInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ if (_pos >= _size)
+ return S_OK;
+ size_t rem = _size - (size_t)_pos;
+ if (rem > size)
+ rem = (size_t)size;
+ memcpy(data, _data + (size_t)_pos, rem);
+ _pos += rem;
+ if (processedSize)
+ *processedSize = (UInt32)rem;
+ return S_OK;
+}
+
+STDMETHODIMP CBufInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _pos; break;
+ case STREAM_SEEK_END: offset += _size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _pos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
+
+void Create_BufInStream_WithReference(const void *data, size_t size, IUnknown *ref, ISequentialInStream **stream)
+{
+ *stream = NULL;
+ CBufInStream *inStreamSpec = new CBufInStream;
+ CMyComPtr<ISequentialInStream> streamTemp = inStreamSpec;
+ inStreamSpec->Init((const Byte *)data, size, ref);
+ *stream = streamTemp.Detach();
+}
+
+void Create_BufInStream_WithNewBuffer(const void *data, size_t size, ISequentialInStream **stream)
+{
+ *stream = NULL;
+ CBufferInStream *inStreamSpec = new CBufferInStream;
+ CMyComPtr<ISequentialInStream> streamTemp = inStreamSpec;
+ inStreamSpec->Buf.CopyFrom((const Byte *)data, size);
+ inStreamSpec->Init();
+ *stream = streamTemp.Detach();
+}
+
+void CByteDynBuffer::Free() throw()
+{
+ free(_buf);
+ _buf = 0;
+ _capacity = 0;
+}
+
+bool CByteDynBuffer::EnsureCapacity(size_t cap) throw()
+{
+ if (cap <= _capacity)
+ return true;
+ size_t delta;
+ if (_capacity > 64)
+ delta = _capacity / 4;
+ else if (_capacity > 8)
+ delta = 16;
+ else
+ delta = 4;
+ cap = MyMax(_capacity + delta, cap);
+ Byte *buf = (Byte *)realloc(_buf, cap);
+ if (!buf)
+ return false;
+ _buf = buf;
+ _capacity = cap;
+ return true;
+}
+
+Byte *CDynBufSeqOutStream::GetBufPtrForWriting(size_t addSize)
+{
+ addSize += _size;
+ if (addSize < _size)
+ return NULL;
+ if (!_buffer.EnsureCapacity(addSize))
+ return NULL;
+ return (Byte *)_buffer + _size;
+}
+
+void CDynBufSeqOutStream::CopyToBuffer(CByteBuffer &dest) const
+{
+ dest.CopyFrom((const Byte *)_buffer, _size);
+}
+
+STDMETHODIMP CDynBufSeqOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ Byte *buf = GetBufPtrForWriting(size);
+ if (!buf)
+ return E_OUTOFMEMORY;
+ memcpy(buf, data, size);
+ UpdateSize(size);
+ if (processedSize)
+ *processedSize = size;
+ return S_OK;
+}
+
+STDMETHODIMP CBufPtrSeqOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ size_t rem = _size - _pos;
+ if (rem > size)
+ rem = (size_t)size;
+ if (rem != 0)
+ {
+ memcpy(_buffer + _pos, data, rem);
+ _pos += rem;
+ }
+ if (processedSize)
+ *processedSize = (UInt32)rem;
+ return (rem != 0 || size == 0) ? S_OK : E_FAIL;
+}
+
+STDMETHODIMP CSequentialOutStreamSizeCount::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessedSize;
+ HRESULT result = _stream->Write(data, size, &realProcessedSize);
+ _size += realProcessedSize;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return result;
+}
+
+static const UInt64 kEmptyTag = (UInt64)(Int64)-1;
+
+void CCachedInStream::Free() throw()
+{
+ MyFree(_tags);
+ _tags = 0;
+ MidFree(_data);
+ _data = 0;
+}
+
+bool CCachedInStream::Alloc(unsigned blockSizeLog, unsigned numBlocksLog) throw()
+{
+ unsigned sizeLog = blockSizeLog + numBlocksLog;
+ if (sizeLog >= sizeof(size_t) * 8)
+ return false;
+ size_t dataSize = (size_t)1 << sizeLog;
+ if (_data == 0 || dataSize != _dataSize)
+ {
+ MidFree(_data);
+ _data = (Byte *)MidAlloc(dataSize);
+ if (_data == 0)
+ return false;
+ _dataSize = dataSize;
+ }
+ if (_tags == 0 || numBlocksLog != _numBlocksLog)
+ {
+ MyFree(_tags);
+ _tags = (UInt64 *)MyAlloc(sizeof(UInt64) << numBlocksLog);
+ if (_tags == 0)
+ return false;
+ _numBlocksLog = numBlocksLog;
+ }
+ _blockSizeLog = blockSizeLog;
+ return true;
+}
+
+void CCachedInStream::Init(UInt64 size) throw()
+{
+ _size = size;
+ _pos = 0;
+ size_t numBlocks = (size_t)1 << _numBlocksLog;
+ for (size_t i = 0; i < numBlocks; i++)
+ _tags[i] = kEmptyTag;
+}
+
+STDMETHODIMP CCachedInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ if (_pos >= _size)
+ return S_OK;
+
+ {
+ UInt64 rem = _size - _pos;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+
+ while (size != 0)
+ {
+ UInt64 cacheTag = _pos >> _blockSizeLog;
+ size_t cacheIndex = (size_t)cacheTag & (((size_t)1 << _numBlocksLog) - 1);
+ Byte *p = _data + (cacheIndex << _blockSizeLog);
+ if (_tags[cacheIndex] != cacheTag)
+ {
+ UInt64 remInBlock = _size - (cacheTag << _blockSizeLog);
+ size_t blockSize = (size_t)1 << _blockSizeLog;
+ if (blockSize > remInBlock)
+ blockSize = (size_t)remInBlock;
+ RINOK(ReadBlock(cacheTag, p, blockSize));
+ _tags[cacheIndex] = cacheTag;
+ }
+ size_t offset = (size_t)_pos & (((size_t)1 << _blockSizeLog) - 1);
+ UInt32 cur = (UInt32)MyMin(((size_t)1 << _blockSizeLog) - offset, (size_t)size);
+ memcpy(data, p + offset, cur);
+ if (processedSize)
+ *processedSize += cur;
+ data = (void *)((const Byte *)data + cur);
+ _pos += cur;
+ size -= cur;
+ }
+
+ return S_OK;
+}
+
+STDMETHODIMP CCachedInStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: break;
+ case STREAM_SEEK_CUR: offset += _pos; break;
+ case STREAM_SEEK_END: offset += _size; break;
+ default: return STG_E_INVALIDFUNCTION;
+ }
+ if (offset < 0)
+ return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
+ _pos = offset;
+ if (newPosition)
+ *newPosition = offset;
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.h b/other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.h
new file mode 100644
index 0000000000..c3e083747f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StreamObjects.h
@@ -0,0 +1,157 @@
+// StreamObjects.h
+
+#ifndef __STREAM_OBJECTS_H
+#define __STREAM_OBJECTS_H
+
+#include "../../Common/MyBuffer.h"
+#include "../../Common/MyCom.h"
+#include "../../Common/MyVector.h"
+
+#include "../IStream.h"
+
+class CBufferInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ UInt64 _pos;
+public:
+ CByteBuffer Buf;
+ void Init() { _pos = 0; }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+};
+
+struct CReferenceBuf:
+ public IUnknown,
+ public CMyUnknownImp
+{
+ CByteBuffer Buf;
+ MY_UNKNOWN_IMP
+};
+
+class CBufInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ const Byte *_data;
+ UInt64 _pos;
+ size_t _size;
+ CMyComPtr<IUnknown> _ref;
+public:
+ void Init(const Byte *data, size_t size, IUnknown *ref = 0)
+ {
+ _data = data;
+ _size = size;
+ _pos = 0;
+ _ref = ref;
+ }
+ void Init(CReferenceBuf *ref) { Init(ref->Buf, ref->Buf.Size(), ref); }
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+};
+
+void Create_BufInStream_WithReference(const void *data, size_t size, IUnknown *ref, ISequentialInStream **stream);
+void Create_BufInStream_WithNewBuffer(const void *data, size_t size, ISequentialInStream **stream);
+inline void Create_BufInStream_WithNewBuffer(const CByteBuffer &buf, ISequentialInStream **stream)
+ { Create_BufInStream_WithNewBuffer(buf, buf.Size(), stream); }
+
+class CByteDynBuffer
+{
+ size_t _capacity;
+ Byte *_buf;
+public:
+ CByteDynBuffer(): _capacity(0), _buf(0) {};
+ // there is no copy constructor. So don't copy this object.
+ ~CByteDynBuffer() { Free(); }
+ void Free() throw();
+ size_t GetCapacity() const { return _capacity; }
+ operator Byte*() const { return _buf; }
+ operator const Byte*() const { return _buf; }
+ bool EnsureCapacity(size_t capacity) throw();
+};
+
+class CDynBufSeqOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CByteDynBuffer _buffer;
+ size_t _size;
+public:
+ CDynBufSeqOutStream(): _size(0) {}
+ void Init() { _size = 0; }
+ size_t GetSize() const { return _size; }
+ const Byte *GetBuffer() const { return _buffer; }
+ void CopyToBuffer(CByteBuffer &dest) const;
+ Byte *GetBufPtrForWriting(size_t addSize);
+ void UpdateSize(size_t addSize) { _size += addSize; }
+
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+class CBufPtrSeqOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ Byte *_buffer;
+ size_t _size;
+ size_t _pos;
+public:
+ void Init(Byte *buffer, size_t size)
+ {
+ _buffer = buffer;
+ _pos = 0;
+ _size = size;
+ }
+ size_t GetPos() const { return _pos; }
+
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+class CSequentialOutStreamSizeCount:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+public:
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void Init() { _size = 0; }
+ UInt64 GetSize() const { return _size; }
+
+ MY_UNKNOWN_IMP1(ISequentialOutStream)
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+class CCachedInStream:
+ public IInStream,
+ public CMyUnknownImp
+{
+ UInt64 *_tags;
+ Byte *_data;
+ size_t _dataSize;
+ unsigned _blockSizeLog;
+ unsigned _numBlocksLog;
+ UInt64 _size;
+ UInt64 _pos;
+protected:
+ virtual HRESULT ReadBlock(UInt64 blockIndex, Byte *dest, size_t blockSize) = 0;
+public:
+ CCachedInStream(): _tags(0), _data(0) {}
+ virtual ~CCachedInStream() { Free(); } // the destructor must be virtual (release calls it) !!!
+ void Free() throw();
+ bool Alloc(unsigned blockSizeLog, unsigned numBlocksLog) throw();
+ void Init(UInt64 size) throw();
+
+ MY_UNKNOWN_IMP2(ISequentialInStream, IInStream)
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.cpp
new file mode 100644
index 0000000000..a79de23525
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.cpp
@@ -0,0 +1,56 @@
+// StreamUtils.cpp
+
+#include "StdAfx.h"
+
+#include "StreamUtils.h"
+
+static const UInt32 kBlockSize = ((UInt32)1 << 31);
+
+HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *processedSize) throw()
+{
+ size_t size = *processedSize;
+ *processedSize = 0;
+ while (size != 0)
+ {
+ UInt32 curSize = (size < kBlockSize) ? (UInt32)size : kBlockSize;
+ UInt32 processedSizeLoc;
+ HRESULT res = stream->Read(data, curSize, &processedSizeLoc);
+ *processedSize += processedSizeLoc;
+ data = (void *)((Byte *)data + processedSizeLoc);
+ size -= processedSizeLoc;
+ RINOK(res);
+ if (processedSizeLoc == 0)
+ return S_OK;
+ }
+ return S_OK;
+}
+
+HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw()
+{
+ size_t processedSize = size;
+ RINOK(ReadStream(stream, data, &processedSize));
+ return (size == processedSize) ? S_OK : S_FALSE;
+}
+
+HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw()
+{
+ size_t processedSize = size;
+ RINOK(ReadStream(stream, data, &processedSize));
+ return (size == processedSize) ? S_OK : E_FAIL;
+}
+
+HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size) throw()
+{
+ while (size != 0)
+ {
+ UInt32 curSize = (size < kBlockSize) ? (UInt32)size : kBlockSize;
+ UInt32 processedSizeLoc;
+ HRESULT res = stream->Write(data, curSize, &processedSizeLoc);
+ data = (const void *)((const Byte *)data + processedSizeLoc);
+ size -= processedSizeLoc;
+ RINOK(res);
+ if (processedSizeLoc == 0)
+ return E_FAIL;
+ }
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.h b/other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.h
new file mode 100644
index 0000000000..799a8b9db1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/StreamUtils.h
@@ -0,0 +1,13 @@
+// StreamUtils.h
+
+#ifndef __STREAM_UTILS_H
+#define __STREAM_UTILS_H
+
+#include "../IStream.h"
+
+HRESULT ReadStream(ISequentialInStream *stream, void *data, size_t *size) throw();
+HRESULT ReadStream_FALSE(ISequentialInStream *stream, void *data, size_t size) throw();
+HRESULT ReadStream_FAIL(ISequentialInStream *stream, void *data, size_t size) throw();
+HRESULT WriteStream(ISequentialOutStream *stream, const void *data, size_t size) throw();
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.cpp
new file mode 100644
index 0000000000..5baf1a4953
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.cpp
@@ -0,0 +1,57 @@
+// UniqBlocks.cpp
+
+#include "StdAfx.h"
+
+#include <string.h>
+
+#include "UniqBlocks.h"
+
+unsigned CUniqBlocks::AddUniq(const Byte *data, size_t size)
+{
+ unsigned left = 0, right = Sorted.Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ unsigned index = Sorted[mid];
+ const CByteBuffer &buf = Bufs[index];
+ size_t sizeMid = buf.Size();
+ if (size < sizeMid)
+ right = mid;
+ else if (size > sizeMid)
+ left = mid + 1;
+ else
+ {
+ if (size == 0)
+ return index;
+ int cmp = memcmp(data, buf, size);
+ if (cmp == 0)
+ return index;
+ if (cmp < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ }
+ unsigned index = Bufs.Size();
+ Sorted.Insert(left, index);
+ Bufs.AddNew().CopyFrom(data, size);
+ return index;
+}
+
+UInt64 CUniqBlocks::GetTotalSizeInBytes() const
+{
+ UInt64 size = 0;
+ FOR_VECTOR (i, Bufs)
+ size += Bufs[i].Size();
+ return size;
+}
+
+void CUniqBlocks::GetReverseMap()
+{
+ unsigned num = Sorted.Size();
+ BufIndexToSortedIndex.ClearAndSetSize(num);
+ unsigned *p = &BufIndexToSortedIndex[0];
+ const unsigned *sorted = &Sorted[0];
+ for (unsigned i = 0; i < num; i++)
+ p[sorted[i]] = i;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.h b/other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.h
new file mode 100644
index 0000000000..d9ec17da11
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/UniqBlocks.h
@@ -0,0 +1,26 @@
+// UniqBlocks.h
+
+#ifndef __UNIQ_BLOCKS_H
+#define __UNIQ_BLOCKS_H
+
+#include "../../Common/MyTypes.h"
+#include "../../Common/MyBuffer.h"
+#include "../../Common/MyVector.h"
+
+struct CUniqBlocks
+{
+ CObjectVector<CByteBuffer> Bufs;
+ CUIntVector Sorted;
+ CUIntVector BufIndexToSortedIndex;
+
+ unsigned AddUniq(const Byte *data, size_t size);
+ UInt64 GetTotalSizeInBytes() const;
+ void GetReverseMap();
+
+ bool IsOnlyEmpty() const
+ {
+ return (Bufs.Size() == 0 || Bufs.Size() == 1 && Bufs[0].Size() == 0);
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.cpp b/other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.cpp
new file mode 100644
index 0000000000..3cf9acd3ea
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.cpp
@@ -0,0 +1,48 @@
+// VirtThread.cpp
+
+#include "StdAfx.h"
+
+#include "VirtThread.h"
+
+static THREAD_FUNC_DECL CoderThread(void *p)
+{
+ for (;;)
+ {
+ CVirtThread *t = (CVirtThread *)p;
+ t->StartEvent.Lock();
+ if (t->Exit)
+ return 0;
+ t->Execute();
+ t->FinishedEvent.Set();
+ }
+}
+
+WRes CVirtThread::Create()
+{
+ RINOK(StartEvent.CreateIfNotCreated());
+ RINOK(FinishedEvent.CreateIfNotCreated());
+ StartEvent.Reset();
+ FinishedEvent.Reset();
+ Exit = false;
+ if (Thread.IsCreated())
+ return S_OK;
+ return Thread.Create(CoderThread, this);
+}
+
+void CVirtThread::Start()
+{
+ Exit = false;
+ StartEvent.Set();
+}
+
+void CVirtThread::WaitThreadFinish()
+{
+ Exit = true;
+ if (StartEvent.IsCreated())
+ StartEvent.Set();
+ if (Thread.IsCreated())
+ {
+ Thread.Wait();
+ Thread.Close();
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.h b/other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.h
new file mode 100644
index 0000000000..a2711036ad
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Common/VirtThread.h
@@ -0,0 +1,24 @@
+// VirtThread.h
+
+#ifndef __VIRT_THREAD_H
+#define __VIRT_THREAD_H
+
+#include "../../Windows/Synchronization.h"
+#include "../../Windows/Thread.h"
+
+struct CVirtThread
+{
+ NWindows::NSynchronization::CAutoResetEvent StartEvent;
+ NWindows::NSynchronization::CAutoResetEvent FinishedEvent;
+ NWindows::CThread Thread;
+ bool Exit;
+
+ ~CVirtThread() { WaitThreadFinish(); }
+ void WaitThreadFinish(); // call it in destructor of child class !
+ WRes Create();
+ void Start();
+ virtual void Execute() = 0;
+ void WaitExecuteFinish() { FinishedEvent.Lock(); }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.cpp
new file mode 100644
index 0000000000..4e083bf194
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.cpp
@@ -0,0 +1,666 @@
+// Bcj2Coder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../Common/StreamUtils.h"
+
+#include "Bcj2Coder.h"
+
+namespace NCompress {
+namespace NBcj2 {
+
+CBaseCoder::CBaseCoder()
+{
+ for (int i = 0; i < BCJ2_NUM_STREAMS + 1; i++)
+ {
+ _bufs[i] = NULL;
+ _bufsCurSizes[i] = 0;
+ _bufsNewSizes[i] = (1 << 18);
+ }
+}
+
+CBaseCoder::~CBaseCoder()
+{
+ for (int i = 0; i < BCJ2_NUM_STREAMS + 1; i++)
+ ::MidFree(_bufs[i]);
+}
+
+HRESULT CBaseCoder::Alloc(bool allocForOrig)
+{
+ unsigned num = allocForOrig ? BCJ2_NUM_STREAMS + 1 : BCJ2_NUM_STREAMS;
+ for (unsigned i = 0; i < num; i++)
+ {
+ UInt32 newSize = _bufsNewSizes[i];
+ const UInt32 kMinBufSize = 1;
+ if (newSize < kMinBufSize)
+ newSize = kMinBufSize;
+ if (!_bufs[i] || newSize != _bufsCurSizes[i])
+ {
+ if (_bufs[i])
+ {
+ ::MidFree(_bufs[i]);
+ _bufs[i] = 0;
+ }
+ _bufsCurSizes[i] = 0;
+ Byte *buf = (Byte *)::MidAlloc(newSize);
+ _bufs[i] = buf;
+ if (!buf)
+ return E_OUTOFMEMORY;
+ _bufsCurSizes[i] = newSize;
+ }
+ }
+ return S_OK;
+}
+
+
+
+#ifndef EXTRACT_ONLY
+
+CEncoder::CEncoder(): _relatLim(BCJ2_RELAT_LIMIT) {}
+CEncoder::~CEncoder() {}
+
+STDMETHODIMP CEncoder::SetInBufSize(UInt32, UInt32 size) { _bufsNewSizes[BCJ2_NUM_STREAMS] = size; return S_OK; }
+STDMETHODIMP CEncoder::SetOutBufSize(UInt32 streamIndex, UInt32 size) { _bufsNewSizes[streamIndex] = size; return S_OK; }
+
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
+{
+ UInt32 relatLim = BCJ2_RELAT_LIMIT;
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = props[i];
+ PROPID propID = propIDs[i];
+ if (propID >= NCoderPropID::kReduceSize)
+ continue;
+ switch (propID)
+ {
+ /*
+ case NCoderPropID::kDefaultProp:
+ {
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ UInt32 v = prop.ulVal;
+ if (v > 31)
+ return E_INVALIDARG;
+ relatLim = (UInt32)1 << v;
+ break;
+ }
+ */
+ case NCoderPropID::kDictionarySize:
+ {
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ relatLim = prop.ulVal;
+ if (relatLim > ((UInt32)1 << 31))
+ return E_INVALIDARG;
+ break;
+ }
+
+ case NCoderPropID::kNumThreads:
+ continue;
+ case NCoderPropID::kLevel:
+ continue;
+
+ default: return E_INVALIDARG;
+ }
+ }
+
+ _relatLim = relatLim;
+
+ return S_OK;
+}
+
+
+HRESULT CEncoder::CodeReal(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const * /* outSizes */, UInt32 numOutStreams,
+ ICompressProgressInfo *progress)
+{
+ if (numInStreams != 1 || numOutStreams != BCJ2_NUM_STREAMS)
+ return E_INVALIDARG;
+
+ RINOK(Alloc());
+
+ UInt32 fileSize_for_Conv = 0;
+ if (inSizes && inSizes[0])
+ {
+ UInt64 inSize = *inSizes[0];
+ if (inSize <= BCJ2_FileSize_MAX)
+ fileSize_for_Conv = (UInt32)inSize;
+ }
+
+ CMyComPtr<ICompressGetSubStreamSize> getSubStreamSize;
+ inStreams[0]->QueryInterface(IID_ICompressGetSubStreamSize, (void **)&getSubStreamSize);
+
+ CBcj2Enc enc;
+
+ enc.src = _bufs[BCJ2_NUM_STREAMS];
+ enc.srcLim = enc.src;
+
+ {
+ for (int i = 0; i < BCJ2_NUM_STREAMS; i++)
+ {
+ enc.bufs[i] = _bufs[i];
+ enc.lims[i] = _bufs[i] + _bufsCurSizes[i];
+ }
+ }
+
+ size_t numBytes_in_ReadBuf = 0;
+ UInt64 prevProgress = 0;
+ UInt64 totalStreamRead = 0; // size read from InputStream
+ UInt64 currentInPos = 0; // data that was processed, it doesn't include data in input buffer and data in enc.temp
+ UInt64 outSizeRc = 0;
+
+ Bcj2Enc_Init(&enc);
+
+ enc.fileIp = 0;
+ enc.fileSize = fileSize_for_Conv;
+
+ enc.relatLimit = _relatLim;
+
+ enc.finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE;
+
+ bool needSubSize = false;
+ UInt64 subStreamIndex = 0;
+ UInt64 subStreamStartPos = 0;
+ bool readWasFinished = false;
+
+ for (;;)
+ {
+ if (needSubSize && getSubStreamSize)
+ {
+ enc.fileIp = 0;
+ enc.fileSize = fileSize_for_Conv;
+ enc.finishMode = BCJ2_ENC_FINISH_MODE_CONTINUE;
+
+ for (;;)
+ {
+ UInt64 subStreamSize = 0;
+ HRESULT result = getSubStreamSize->GetSubStreamSize(subStreamIndex, &subStreamSize);
+ needSubSize = false;
+
+ if (result == S_OK)
+ {
+ UInt64 newEndPos = subStreamStartPos + subStreamSize;
+
+ bool isAccurateEnd = (newEndPos < totalStreamRead ||
+ (newEndPos <= totalStreamRead && readWasFinished));
+
+ if (newEndPos <= currentInPos && isAccurateEnd)
+ {
+ subStreamStartPos = newEndPos;
+ subStreamIndex++;
+ continue;
+ }
+
+ enc.srcLim = _bufs[BCJ2_NUM_STREAMS] + numBytes_in_ReadBuf;
+
+ if (isAccurateEnd)
+ {
+ // data in enc.temp is possible here
+ size_t rem = (size_t)(totalStreamRead - newEndPos);
+
+ /* Pos_of(enc.src) <= old newEndPos <= newEndPos
+ in another case, it's fail in some code */
+ if ((size_t)(enc.srcLim - enc.src) < rem)
+ return E_FAIL;
+
+ enc.srcLim -= rem;
+ enc.finishMode = BCJ2_ENC_FINISH_MODE_END_BLOCK;
+ }
+
+ if (subStreamSize <= BCJ2_FileSize_MAX)
+ {
+ enc.fileIp = enc.ip + (UInt32)(subStreamStartPos - currentInPos);
+ enc.fileSize = (UInt32)subStreamSize;
+ }
+ break;
+ }
+
+ if (result == S_FALSE)
+ break;
+ if (result == E_NOTIMPL)
+ {
+ getSubStreamSize.Release();
+ break;
+ }
+ return result;
+ }
+ }
+
+ if (readWasFinished && totalStreamRead - currentInPos == Bcj2Enc_Get_InputData_Size(&enc))
+ enc.finishMode = BCJ2_ENC_FINISH_MODE_END_STREAM;
+
+ Bcj2Enc_Encode(&enc);
+
+ currentInPos = totalStreamRead - numBytes_in_ReadBuf + (enc.src - _bufs[BCJ2_NUM_STREAMS]) - enc.tempPos;
+
+ if (Bcj2Enc_IsFinished(&enc))
+ break;
+
+ if (enc.state < BCJ2_NUM_STREAMS)
+ {
+ size_t curSize = enc.bufs[enc.state] - _bufs[enc.state];
+ // printf("Write stream = %2d %6d\n", enc.state, curSize);
+ RINOK(WriteStream(outStreams[enc.state], _bufs[enc.state], curSize));
+ if (enc.state == BCJ2_STREAM_RC)
+ outSizeRc += curSize;
+
+ enc.bufs[enc.state] = _bufs[enc.state];
+ enc.lims[enc.state] = _bufs[enc.state] + _bufsCurSizes[enc.state];
+ }
+ else if (enc.state != BCJ2_ENC_STATE_ORIG)
+ return E_FAIL;
+ else
+ {
+ needSubSize = true;
+
+ if (numBytes_in_ReadBuf != (size_t)(enc.src - _bufs[BCJ2_NUM_STREAMS]))
+ {
+ enc.srcLim = _bufs[BCJ2_NUM_STREAMS] + numBytes_in_ReadBuf;
+ continue;
+ }
+
+ if (readWasFinished)
+ continue;
+
+ numBytes_in_ReadBuf = 0;
+ enc.src = _bufs[BCJ2_NUM_STREAMS];
+ enc.srcLim = _bufs[BCJ2_NUM_STREAMS];
+
+ UInt32 curSize = _bufsCurSizes[BCJ2_NUM_STREAMS];
+ RINOK(inStreams[0]->Read(_bufs[BCJ2_NUM_STREAMS], curSize, &curSize));
+
+ // printf("Read %6d bytes\n", curSize);
+ if (curSize == 0)
+ {
+ readWasFinished = true;
+ continue;
+ }
+
+ numBytes_in_ReadBuf = curSize;
+ totalStreamRead += numBytes_in_ReadBuf;
+ enc.srcLim = _bufs[BCJ2_NUM_STREAMS] + numBytes_in_ReadBuf;
+ }
+
+ if (progress && currentInPos - prevProgress >= (1 << 20))
+ {
+ UInt64 outSize2 = currentInPos + outSizeRc + enc.bufs[BCJ2_STREAM_RC] - enc.bufs[BCJ2_STREAM_RC];
+ prevProgress = currentInPos;
+ // printf("progress %8d, %8d\n", (int)inSize2, (int)outSize2);
+ RINOK(progress->SetRatioInfo(&currentInPos, &outSize2));
+ }
+ }
+
+ for (int i = 0; i < BCJ2_NUM_STREAMS; i++)
+ {
+ RINOK(WriteStream(outStreams[i], _bufs[i], enc.bufs[i] - _bufs[i]));
+ }
+
+ // if (currentInPos != subStreamStartPos + subStreamSize) return E_FAIL;
+
+ return S_OK;
+}
+
+STDMETHODIMP CEncoder::Code(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const *outSizes, UInt32 numOutStreams,
+ ICompressProgressInfo *progress)
+{
+ try
+ {
+ return CodeReal(inStreams, inSizes, numInStreams, outStreams, outSizes,numOutStreams, progress);
+ }
+ catch(...) { return E_FAIL; }
+}
+
+#endif
+
+
+
+
+
+
+STDMETHODIMP CDecoder::SetInBufSize(UInt32 streamIndex, UInt32 size) { _bufsNewSizes[streamIndex] = size; return S_OK; }
+STDMETHODIMP CDecoder::SetOutBufSize(UInt32 , UInt32 size) { _bufsNewSizes[BCJ2_NUM_STREAMS] = size; return S_OK; }
+
+CDecoder::CDecoder(): _finishMode(false), _outSizeDefined(false), _outSize(0)
+{}
+
+STDMETHODIMP CDecoder::SetFinishMode(UInt32 finishMode)
+{
+ _finishMode = (finishMode != 0);
+ return S_OK;
+}
+
+void CDecoder::InitCommon()
+{
+ {
+ for (int i = 0; i < BCJ2_NUM_STREAMS; i++)
+ dec.lims[i] = dec.bufs[i] = _bufs[i];
+ }
+
+ {
+ for (int i = 0; i < BCJ2_NUM_STREAMS; i++)
+ {
+ _extraReadSizes[i] = 0;
+ _inStreamsProcessed[i] = 0;
+ _readRes[i] = S_OK;
+ }
+ }
+
+ Bcj2Dec_Init(&dec);
+}
+
+HRESULT CDecoder::Code(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const *outSizes, UInt32 numOutStreams,
+ ICompressProgressInfo *progress)
+{
+ if (numInStreams != BCJ2_NUM_STREAMS || numOutStreams != 1)
+ return E_INVALIDARG;
+
+ RINOK(Alloc());
+
+ InitCommon();
+
+ dec.destLim = dec.dest = _bufs[BCJ2_NUM_STREAMS];
+
+ UInt64 outSizeProcessed = 0;
+ UInt64 prevProgress = 0;
+
+ HRESULT res = S_OK;
+
+ for (;;)
+ {
+ if (Bcj2Dec_Decode(&dec) != SZ_OK)
+ return S_FALSE;
+
+ if (dec.state < BCJ2_NUM_STREAMS)
+ {
+ size_t totalRead = _extraReadSizes[dec.state];
+ {
+ Byte *buf = _bufs[dec.state];
+ for (size_t i = 0; i < totalRead; i++)
+ buf[i] = dec.bufs[dec.state][i];
+ dec.lims[dec.state] =
+ dec.bufs[dec.state] = buf;
+ }
+
+ if (_readRes[dec.state] != S_OK)
+ {
+ res = _readRes[dec.state];
+ break;
+ }
+
+ do
+ {
+ UInt32 curSize = _bufsCurSizes[dec.state] - (UInt32)totalRead;
+ /*
+ we want to call Read even even if size is 0
+ if (inSizes && inSizes[dec.state])
+ {
+ UInt64 rem = *inSizes[dec.state] - _inStreamsProcessed[dec.state];
+ if (curSize > rem)
+ curSize = (UInt32)rem;
+ }
+ */
+
+ HRESULT res2 = inStreams[dec.state]->Read(_bufs[dec.state] + totalRead, curSize, &curSize);
+ _readRes[dec.state] = res2;
+ if (curSize == 0)
+ break;
+ _inStreamsProcessed[dec.state] += curSize;
+ totalRead += curSize;
+ if (res2 != S_OK)
+ break;
+ }
+ while (totalRead < 4 && BCJ2_IS_32BIT_STREAM(dec.state));
+
+ if (_readRes[dec.state] != S_OK)
+ res = _readRes[dec.state];
+
+ if (totalRead == 0)
+ break;
+
+ // res == S_OK;
+
+ if (BCJ2_IS_32BIT_STREAM(dec.state))
+ {
+ unsigned extraSize = ((unsigned)totalRead & 3);
+ _extraReadSizes[dec.state] = extraSize;
+ if (totalRead < 4)
+ {
+ res = (_readRes[dec.state] != S_OK) ? _readRes[dec.state] : S_FALSE;
+ break;
+ }
+ totalRead -= extraSize;
+ }
+
+ dec.lims[dec.state] = _bufs[dec.state] + totalRead;
+ }
+ else // if (dec.state <= BCJ2_STATE_ORIG)
+ {
+ size_t curSize = dec.dest - _bufs[BCJ2_NUM_STREAMS];
+ if (curSize != 0)
+ {
+ outSizeProcessed += curSize;
+ RINOK(WriteStream(outStreams[0], _bufs[BCJ2_NUM_STREAMS], curSize));
+ }
+ dec.dest = _bufs[BCJ2_NUM_STREAMS];
+ {
+ size_t rem = _bufsCurSizes[BCJ2_NUM_STREAMS];
+ if (outSizes && outSizes[0])
+ {
+ UInt64 outSize = *outSizes[0] - outSizeProcessed;
+ if (rem > outSize)
+ rem = (size_t)outSize;
+ }
+ dec.destLim = dec.dest + rem;
+ if (rem == 0)
+ break;
+ }
+ }
+
+ if (progress)
+ {
+ const UInt64 outSize2 = outSizeProcessed + (dec.dest - _bufs[BCJ2_NUM_STREAMS]);
+ if (outSize2 - prevProgress >= (1 << 22))
+ {
+ const UInt64 inSize2 = outSize2 + _inStreamsProcessed[BCJ2_STREAM_RC] - (dec.lims[BCJ2_STREAM_RC] - dec.bufs[BCJ2_STREAM_RC]);
+ RINOK(progress->SetRatioInfo(&inSize2, &outSize2));
+ prevProgress = outSize2;
+ }
+ }
+ }
+
+ size_t curSize = dec.dest - _bufs[BCJ2_NUM_STREAMS];
+ if (curSize != 0)
+ {
+ outSizeProcessed += curSize;
+ RINOK(WriteStream(outStreams[0], _bufs[BCJ2_NUM_STREAMS], curSize));
+ }
+
+ if (res != S_OK)
+ return res;
+
+ if (_finishMode)
+ {
+ if (!Bcj2Dec_IsFinished(&dec))
+ return S_FALSE;
+
+ // we still allow the cases when input streams are larger than required for decoding.
+ // so the case (dec.state == BCJ2_STATE_ORIG) is also allowed, if MAIN stream is larger than required.
+ if (dec.state != BCJ2_STREAM_MAIN &&
+ dec.state != BCJ2_DEC_STATE_ORIG)
+ return S_FALSE;
+
+ if (inSizes)
+ {
+ for (int i = 0; i < BCJ2_NUM_STREAMS; i++)
+ {
+ size_t rem = dec.lims[i] - dec.bufs[i] + _extraReadSizes[i];
+ /*
+ if (rem != 0)
+ return S_FALSE;
+ */
+ if (inSizes[i] && *inSizes[i] != _inStreamsProcessed[i] - rem)
+ return S_FALSE;
+ }
+ }
+ }
+
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::SetInStream2(UInt32 streamIndex, ISequentialInStream *inStream)
+{
+ _inStreams[streamIndex] = inStream;
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::ReleaseInStream2(UInt32 streamIndex)
+{
+ _inStreams[streamIndex].Release();
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::SetOutStreamSize(const UInt64 *outSize)
+{
+ _outSizeDefined = (outSize != NULL);
+ _outSize = 0;
+ if (_outSizeDefined)
+ _outSize = *outSize;
+
+ _outSize_Processed = 0;
+
+ HRESULT res = Alloc(false);
+
+ InitCommon();
+ dec.destLim = dec.dest = NULL;
+
+ return res;
+}
+
+
+STDMETHODIMP CDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ if (size == 0)
+ return S_OK;
+
+ UInt32 totalProcessed = 0;
+
+ if (_outSizeDefined)
+ {
+ UInt64 rem = _outSize - _outSize_Processed;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+ dec.dest = (Byte *)data;
+ dec.destLim = (const Byte *)data + size;
+
+ HRESULT res = S_OK;
+
+ for (;;)
+ {
+ SRes sres = Bcj2Dec_Decode(&dec);
+ if (sres != SZ_OK)
+ return S_FALSE;
+
+ {
+ UInt32 curSize = (UInt32)(dec.dest - (Byte *)data);
+ if (curSize != 0)
+ {
+ totalProcessed += curSize;
+ if (processedSize)
+ *processedSize = totalProcessed;
+ data = (void *)((Byte *)data + curSize);
+ size -= curSize;
+ _outSize_Processed += curSize;
+ }
+ }
+
+ if (dec.state >= BCJ2_NUM_STREAMS)
+ break;
+
+ {
+ size_t totalRead = _extraReadSizes[dec.state];
+ {
+ Byte *buf = _bufs[dec.state];
+ for (size_t i = 0; i < totalRead; i++)
+ buf[i] = dec.bufs[dec.state][i];
+ dec.lims[dec.state] =
+ dec.bufs[dec.state] = buf;
+ }
+
+ if (_readRes[dec.state] != S_OK)
+ return _readRes[dec.state];
+
+ do
+ {
+ UInt32 curSize = _bufsCurSizes[dec.state] - (UInt32)totalRead;
+ HRESULT res2 = _inStreams[dec.state]->Read(_bufs[dec.state] + totalRead, curSize, &curSize);
+ _readRes[dec.state] = res2;
+ if (curSize == 0)
+ break;
+ _inStreamsProcessed[dec.state] += curSize;
+ totalRead += curSize;
+ if (res2 != S_OK)
+ break;
+ }
+ while (totalRead < 4 && BCJ2_IS_32BIT_STREAM(dec.state));
+
+ if (totalRead == 0)
+ {
+ if (totalProcessed == 0)
+ res = _readRes[dec.state];
+ break;
+ }
+
+ if (BCJ2_IS_32BIT_STREAM(dec.state))
+ {
+ unsigned extraSize = ((unsigned)totalRead & 3);
+ _extraReadSizes[dec.state] = extraSize;
+ if (totalRead < 4)
+ {
+ if (totalProcessed != 0)
+ return S_OK;
+ return (_readRes[dec.state] != S_OK) ? _readRes[dec.state] : S_FALSE;
+ }
+ totalRead -= extraSize;
+ }
+
+ dec.lims[dec.state] = _bufs[dec.state] + totalRead;
+ }
+ }
+
+ if (_finishMode && _outSizeDefined && _outSize == _outSize_Processed)
+ {
+ if (!Bcj2Dec_IsFinished(&dec))
+ return S_FALSE;
+
+ if (dec.state != BCJ2_STREAM_MAIN &&
+ dec.state != BCJ2_DEC_STATE_ORIG)
+ return S_FALSE;
+
+ /*
+ for (int i = 0; i < BCJ2_NUM_STREAMS; i++)
+ if (dec.bufs[i] != dec.lims[i] || _extraReadSizes[i] != 0)
+ return S_FALSE;
+ */
+ }
+
+ return res;
+}
+
+
+STDMETHODIMP CDecoder::GetInStreamProcessedSize2(UInt32 streamIndex, UInt64 *value)
+{
+ const size_t rem = dec.lims[streamIndex] - dec.bufs[streamIndex] + _extraReadSizes[streamIndex];
+ *value = _inStreamsProcessed[streamIndex] - rem;
+ return S_OK;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.h
new file mode 100644
index 0000000000..666bf8c4cd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Coder.h
@@ -0,0 +1,120 @@
+// Bcj2Coder.h
+
+#ifndef __COMPRESS_BCJ2_CODER_H
+#define __COMPRESS_BCJ2_CODER_H
+
+#include "../../../C/Bcj2.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NBcj2 {
+
+class CBaseCoder
+{
+protected:
+ Byte *_bufs[BCJ2_NUM_STREAMS + 1];
+ UInt32 _bufsCurSizes[BCJ2_NUM_STREAMS + 1];
+ UInt32 _bufsNewSizes[BCJ2_NUM_STREAMS + 1];
+
+ HRESULT Alloc(bool allocForOrig = true);
+public:
+ CBaseCoder();
+ ~CBaseCoder();
+};
+
+
+#ifndef EXTRACT_ONLY
+
+class CEncoder:
+ public ICompressCoder2,
+ public ICompressSetCoderProperties,
+ public ICompressSetBufSize,
+ public CMyUnknownImp,
+ public CBaseCoder
+{
+ UInt32 _relatLim;
+
+ HRESULT CodeReal(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const *outSizes, UInt32 numOutStreams,
+ ICompressProgressInfo *progress);
+
+public:
+ MY_UNKNOWN_IMP3(ICompressCoder2, ICompressSetCoderProperties, ICompressSetBufSize)
+
+ STDMETHOD(Code)(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const *outSizes, UInt32 numOutStreams,
+ ICompressProgressInfo *progress);
+
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+
+ STDMETHOD(SetInBufSize)(UInt32 streamIndex, UInt32 size);
+ STDMETHOD(SetOutBufSize)(UInt32 streamIndex, UInt32 size);
+
+ CEncoder();
+ ~CEncoder();
+};
+
+#endif
+
+class CDecoder:
+ public ICompressCoder2,
+ public ICompressSetFinishMode,
+ public ICompressGetInStreamProcessedSize2,
+ public ICompressSetInStream2,
+ public ISequentialInStream,
+ public ICompressSetOutStreamSize,
+ public ICompressSetBufSize,
+ public CMyUnknownImp,
+ public CBaseCoder
+{
+ unsigned _extraReadSizes[BCJ2_NUM_STREAMS];
+ UInt64 _inStreamsProcessed[BCJ2_NUM_STREAMS];
+ HRESULT _readRes[BCJ2_NUM_STREAMS];
+ CMyComPtr<ISequentialInStream> _inStreams[BCJ2_NUM_STREAMS];
+
+ bool _finishMode;
+ bool _outSizeDefined;
+ UInt64 _outSize;
+ UInt64 _outSize_Processed;
+ CBcj2Dec dec;
+
+ void InitCommon();
+ // HRESULT ReadSpec();
+
+public:
+ MY_UNKNOWN_IMP7(
+ ICompressCoder2,
+ ICompressSetFinishMode,
+ ICompressGetInStreamProcessedSize2,
+ ICompressSetInStream2,
+ ISequentialInStream,
+ ICompressSetOutStreamSize,
+ ICompressSetBufSize
+ );
+
+ STDMETHOD(Code)(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const *outSizes, UInt32 numOutStreams,
+ ICompressProgressInfo *progress);
+
+ STDMETHOD(SetFinishMode)(UInt32 finishMode);
+ STDMETHOD(GetInStreamProcessedSize2)(UInt32 streamIndex, UInt64 *value);
+
+ STDMETHOD(SetInStream2)(UInt32 streamIndex, ISequentialInStream *inStream);
+ STDMETHOD(ReleaseInStream2)(UInt32 streamIndex);
+
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+
+ STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
+
+ STDMETHOD(SetInBufSize)(UInt32 streamIndex, UInt32 size);
+ STDMETHOD(SetOutBufSize)(UInt32 streamIndex, UInt32 size);
+
+ CDecoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Register.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Register.cpp
new file mode 100644
index 0000000000..bce617892f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Bcj2Register.cpp
@@ -0,0 +1,24 @@
+// Bcj2Register.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "Bcj2Coder.h"
+
+namespace NCompress {
+namespace NBcj2 {
+
+REGISTER_CODEC_CREATE_2(CreateCodec, CDecoder(), ICompressCoder2)
+#ifndef EXTRACT_ONLY
+REGISTER_CODEC_CREATE_2(CreateCodecOut, CEncoder(), ICompressCoder2)
+#else
+#define CreateCodecOut NULL
+#endif
+
+REGISTER_CODEC_VAR
+ { CreateCodec, CreateCodecOut, 0x303011B, "BCJ2", 4, false };
+
+REGISTER_CODEC(BCJ2)
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.cpp
new file mode 100644
index 0000000000..a50360c190
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.cpp
@@ -0,0 +1,24 @@
+// BcjCoder.cpp
+
+#include "StdAfx.h"
+
+#include "BcjCoder.h"
+
+namespace NCompress {
+namespace NBcj {
+
+STDMETHODIMP CCoder::Init()
+{
+ _bufferPos = 0;
+ x86_Convert_Init(_prevMask);
+ return S_OK;
+}
+
+STDMETHODIMP_(UInt32) CCoder::Filter(Byte *data, UInt32 size)
+{
+ UInt32 processed = (UInt32)::x86_Convert(data, size, _bufferPos, &_prevMask, _encode);
+ _bufferPos += processed;
+ return processed;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.h
new file mode 100644
index 0000000000..475dfe55a4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/BcjCoder.h
@@ -0,0 +1,31 @@
+// BcjCoder.h
+
+#ifndef __COMPRESS_BCJ_CODER_H
+#define __COMPRESS_BCJ_CODER_H
+
+#include "../../../C/Bra.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NBcj {
+
+class CCoder:
+ public ICompressFilter,
+ public CMyUnknownImp
+{
+ UInt32 _bufferPos;
+ UInt32 _prevMask;
+ int _encode;
+public:
+ MY_UNKNOWN_IMP1(ICompressFilter);
+ INTERFACE_ICompressFilter(;)
+
+ CCoder(int encode): _bufferPos(0), _encode(encode) { x86_Convert_Init(_prevMask); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/BcjRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/BcjRegister.cpp
new file mode 100644
index 0000000000..48cc057fa1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/BcjRegister.cpp
@@ -0,0 +1,17 @@
+// BcjRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "BcjCoder.h"
+
+namespace NCompress {
+namespace NBcj {
+
+REGISTER_FILTER_E(BCJ,
+ CCoder(false),
+ CCoder(true),
+ 0x3030103, "BCJ")
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.cpp
new file mode 100644
index 0000000000..d5a90f1794
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.cpp
@@ -0,0 +1,23 @@
+// BranchMisc.cpp
+
+#include "StdAfx.h"
+
+#include "BranchMisc.h"
+
+namespace NCompress {
+namespace NBranch {
+
+STDMETHODIMP CCoder::Init()
+{
+ _bufferPos = 0;
+ return S_OK;
+}
+
+STDMETHODIMP_(UInt32) CCoder::Filter(Byte *data, UInt32 size)
+{
+ UInt32 processed = (UInt32)BraFunc(data, size, _bufferPos, _encode);
+ _bufferPos += processed;
+ return processed;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.h b/other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.h
new file mode 100644
index 0000000000..02a56c3903
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/BranchMisc.h
@@ -0,0 +1,35 @@
+// BranchMisc.h
+
+#ifndef __COMPRESS_BRANCH_MISC_H
+#define __COMPRESS_BRANCH_MISC_H
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+EXTERN_C_BEGIN
+
+typedef SizeT (*Func_Bra)(Byte *data, SizeT size, UInt32 ip, int encoding);
+
+EXTERN_C_END
+
+namespace NCompress {
+namespace NBranch {
+
+class CCoder:
+ public ICompressFilter,
+ public CMyUnknownImp
+{
+ UInt32 _bufferPos;
+ int _encode;
+ Func_Bra BraFunc;
+public:
+ MY_UNKNOWN_IMP1(ICompressFilter);
+ INTERFACE_ICompressFilter(;)
+
+ CCoder(Func_Bra bra, int encode): _bufferPos(0), _encode(encode), BraFunc(bra) {}
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/BranchRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/BranchRegister.cpp
new file mode 100644
index 0000000000..b83c6bcbd3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/BranchRegister.cpp
@@ -0,0 +1,41 @@
+// BranchRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Bra.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "BranchMisc.h"
+
+namespace NCompress {
+namespace NBranch {
+
+#define CREATE_BRA(n) \
+ REGISTER_FILTER_CREATE(CreateBra_Decoder_ ## n, CCoder(n ## _Convert, false)) \
+ REGISTER_FILTER_CREATE(CreateBra_Encoder_ ## n, CCoder(n ## _Convert, true)) \
+
+CREATE_BRA(PPC)
+CREATE_BRA(IA64)
+CREATE_BRA(ARM)
+CREATE_BRA(ARMT)
+CREATE_BRA(SPARC)
+
+#define METHOD_ITEM(n, id, name) \
+ REGISTER_FILTER_ITEM( \
+ CreateBra_Decoder_ ## n, \
+ CreateBra_Encoder_ ## n, \
+ 0x3030000 + id, name)
+
+REGISTER_CODECS_VAR
+{
+ METHOD_ITEM(PPC, 0x205, "PPC"),
+ METHOD_ITEM(IA64, 0x401, "IA64"),
+ METHOD_ITEM(ARM, 0x501, "ARM"),
+ METHOD_ITEM(ARMT, 0x701, "ARMT"),
+ METHOD_ITEM(SPARC, 0x805, "SPARC")
+};
+
+REGISTER_CODECS(Branch)
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/ByteSwap.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/ByteSwap.cpp
new file mode 100644
index 0000000000..ee103afe7a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/ByteSwap.cpp
@@ -0,0 +1,92 @@
+// ByteSwap.cpp
+
+#include "StdAfx.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+#include "../Common/RegisterCodec.h"
+
+namespace NCompress {
+namespace NByteSwap {
+
+class CByteSwap2:
+ public ICompressFilter,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(ICompressFilter);
+ INTERFACE_ICompressFilter(;)
+};
+
+class CByteSwap4:
+ public ICompressFilter,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(ICompressFilter);
+ INTERFACE_ICompressFilter(;)
+};
+
+STDMETHODIMP CByteSwap2::Init() { return S_OK; }
+
+STDMETHODIMP_(UInt32) CByteSwap2::Filter(Byte *data, UInt32 size)
+{
+ const UInt32 kStep = 2;
+ if (size < kStep)
+ return 0;
+ size &= ~(kStep - 1);
+
+ const Byte *end = data + (size_t)size;
+
+ do
+ {
+ Byte b0 = data[0];
+ data[0] = data[1];
+ data[1] = b0;
+ data += kStep;
+ }
+ while (data != end);
+
+ return size;
+}
+
+STDMETHODIMP CByteSwap4::Init() { return S_OK; }
+
+STDMETHODIMP_(UInt32) CByteSwap4::Filter(Byte *data, UInt32 size)
+{
+ const UInt32 kStep = 4;
+ if (size < kStep)
+ return 0;
+ size &= ~(kStep - 1);
+
+ const Byte *end = data + (size_t)size;
+
+ do
+ {
+ Byte b0 = data[0];
+ Byte b1 = data[1];
+ data[0] = data[3];
+ data[1] = data[2];
+ data[2] = b1;
+ data[3] = b0;
+ data += kStep;
+ }
+ while (data != end);
+
+ return size;
+}
+
+REGISTER_FILTER_CREATE(CreateFilter2, CByteSwap2())
+REGISTER_FILTER_CREATE(CreateFilter4, CByteSwap4())
+
+REGISTER_CODECS_VAR
+{
+ REGISTER_FILTER_ITEM(CreateFilter2, CreateFilter2, 0x20302, "Swap2"),
+ REGISTER_FILTER_ITEM(CreateFilter4, CreateFilter4, 0x20304, "Swap4")
+};
+
+REGISTER_CODECS(ByteSwap)
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/CodecExports.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/CodecExports.cpp
new file mode 100644
index 0000000000..7be496c243
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/CodecExports.cpp
@@ -0,0 +1,344 @@
+// CodecExports.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/CpuArch.h"
+
+#include "../../Common/ComTry.h"
+#include "../../Common/MyCom.h"
+
+#include "../../Windows/Defs.h"
+
+#include "../ICoder.h"
+
+#include "../Common/RegisterCodec.h"
+
+extern unsigned g_NumCodecs;
+extern const CCodecInfo *g_Codecs[];
+
+extern unsigned g_NumHashers;
+extern const CHasherInfo *g_Hashers[];
+
+static void SetPropFromAscii(const char *s, PROPVARIANT *prop) throw()
+{
+ UINT len = (UINT)strlen(s);
+ BSTR dest = ::SysAllocStringLen(NULL, len);
+ if (dest)
+ {
+ for (UINT i = 0; i <= len; i++)
+ dest[i] = (Byte)s[i];
+ prop->bstrVal = dest;
+ prop->vt = VT_BSTR;
+ }
+}
+
+static inline HRESULT SetPropGUID(const GUID &guid, PROPVARIANT *value) throw()
+{
+ if ((value->bstrVal = ::SysAllocStringByteLen((const char *)&guid, sizeof(guid))) != NULL)
+ value->vt = VT_BSTR;
+ return S_OK;
+}
+
+static HRESULT MethodToClassID(UInt16 typeId, CMethodId id, PROPVARIANT *value) throw()
+{
+ GUID clsId;
+ clsId.Data1 = k_7zip_GUID_Data1;
+ clsId.Data2 = k_7zip_GUID_Data2;
+ clsId.Data3 = typeId;
+ SetUi64(clsId.Data4, id);
+ return SetPropGUID(clsId, value);
+}
+
+static HRESULT FindCodecClassId(const GUID *clsid, bool isCoder2, bool isFilter, bool &encode, int &index) throw()
+{
+ index = -1;
+ if (clsid->Data1 != k_7zip_GUID_Data1 ||
+ clsid->Data2 != k_7zip_GUID_Data2)
+ return S_OK;
+
+ encode = true;
+
+ if (clsid->Data3 == k_7zip_GUID_Data3_Decoder) encode = false;
+ else if (clsid->Data3 != k_7zip_GUID_Data3_Encoder) return S_OK;
+
+ UInt64 id = GetUi64(clsid->Data4);
+
+ for (unsigned i = 0; i < g_NumCodecs; i++)
+ {
+ const CCodecInfo &codec = *g_Codecs[i];
+
+ if (id != codec.Id
+ || (encode ? !codec.CreateEncoder : !codec.CreateDecoder)
+ || (isFilter ? !codec.IsFilter : codec.IsFilter))
+ continue;
+
+ if (codec.NumStreams == 1 ? isCoder2 : !isCoder2)
+ return E_NOINTERFACE;
+
+ index = i;
+ return S_OK;
+ }
+
+ return S_OK;
+}
+
+static HRESULT CreateCoderMain(unsigned index, bool encode, void **coder)
+{
+ COM_TRY_BEGIN
+
+ const CCodecInfo &codec = *g_Codecs[index];
+
+ void *c;
+ if (encode)
+ c = codec.CreateEncoder();
+ else
+ c = codec.CreateDecoder();
+
+ if (c)
+ {
+ IUnknown *unk;
+ if (codec.IsFilter)
+ unk = (IUnknown *)(ICompressFilter *)c;
+ else if (codec.NumStreams != 1)
+ unk = (IUnknown *)(ICompressCoder2 *)c;
+ else
+ unk = (IUnknown *)(ICompressCoder *)c;
+ unk->AddRef();
+ *coder = c;
+ }
+ return S_OK;
+
+ COM_TRY_END
+}
+
+static HRESULT CreateCoder2(bool encode, UInt32 index, const GUID *iid, void **outObject)
+{
+ *outObject = NULL;
+
+ const CCodecInfo &codec = *g_Codecs[index];
+
+ if (encode ? !codec.CreateEncoder : !codec.CreateDecoder)
+ return CLASS_E_CLASSNOTAVAILABLE;
+
+ if (codec.IsFilter)
+ {
+ if (*iid != IID_ICompressFilter) return E_NOINTERFACE;
+ }
+ else if (codec.NumStreams != 1)
+ {
+ if (*iid != IID_ICompressCoder2) return E_NOINTERFACE;
+ }
+ else
+ {
+ if (*iid != IID_ICompressCoder) return E_NOINTERFACE;
+ }
+
+ return CreateCoderMain(index, encode, outObject);
+}
+
+STDAPI CreateDecoder(UInt32 index, const GUID *iid, void **outObject)
+{
+ return CreateCoder2(false, index, iid, outObject);
+}
+
+STDAPI CreateEncoder(UInt32 index, const GUID *iid, void **outObject)
+{
+ return CreateCoder2(true, index, iid, outObject);
+}
+
+STDAPI CreateCoder(const GUID *clsid, const GUID *iid, void **outObject)
+{
+ *outObject = NULL;
+
+ bool isFilter = false;
+ bool isCoder2 = false;
+ bool isCoder = (*iid == IID_ICompressCoder) != 0;
+ if (!isCoder)
+ {
+ isFilter = (*iid == IID_ICompressFilter) != 0;
+ if (!isFilter)
+ {
+ isCoder2 = (*iid == IID_ICompressCoder2) != 0;
+ if (!isCoder2)
+ return E_NOINTERFACE;
+ }
+ }
+
+ bool encode;
+ int codecIndex;
+ HRESULT res = FindCodecClassId(clsid, isCoder2, isFilter, encode, codecIndex);
+ if (res != S_OK)
+ return res;
+ if (codecIndex < 0)
+ return CLASS_E_CLASSNOTAVAILABLE;
+
+ return CreateCoderMain(codecIndex, encode, outObject);
+}
+
+STDAPI GetMethodProperty(UInt32 codecIndex, PROPID propID, PROPVARIANT *value)
+{
+ ::VariantClear((VARIANTARG *)value);
+ const CCodecInfo &codec = *g_Codecs[codecIndex];
+ switch (propID)
+ {
+ case NMethodPropID::kID:
+ value->uhVal.QuadPart = (UInt64)codec.Id;
+ value->vt = VT_UI8;
+ break;
+ case NMethodPropID::kName:
+ SetPropFromAscii(codec.Name, value);
+ break;
+ case NMethodPropID::kDecoder:
+ if (codec.CreateDecoder)
+ return MethodToClassID(k_7zip_GUID_Data3_Decoder, codec.Id, value);
+ break;
+ case NMethodPropID::kEncoder:
+ if (codec.CreateEncoder)
+ return MethodToClassID(k_7zip_GUID_Data3_Encoder, codec.Id, value);
+ break;
+ case NMethodPropID::kDecoderIsAssigned:
+ value->vt = VT_BOOL;
+ value->boolVal = BoolToVARIANT_BOOL(codec.CreateDecoder != NULL);
+ break;
+ case NMethodPropID::kEncoderIsAssigned:
+ value->vt = VT_BOOL;
+ value->boolVal = BoolToVARIANT_BOOL(codec.CreateEncoder != NULL);
+ break;
+ case NMethodPropID::kPackStreams:
+ if (codec.NumStreams != 1)
+ {
+ value->vt = VT_UI4;
+ value->ulVal = (ULONG)codec.NumStreams;
+ }
+ break;
+ /*
+ case NMethodPropID::kIsFilter:
+ // if (codec.IsFilter)
+ {
+ value->vt = VT_BOOL;
+ value->boolVal = BoolToVARIANT_BOOL(codec.IsFilter);
+ }
+ break;
+ */
+ /*
+ case NMethodPropID::kDecoderFlags:
+ {
+ value->vt = VT_UI4;
+ value->ulVal = (ULONG)codec.DecoderFlags;
+ }
+ break;
+ case NMethodPropID::kEncoderFlags:
+ {
+ value->vt = VT_UI4;
+ value->ulVal = (ULONG)codec.EncoderFlags;
+ }
+ break;
+ */
+ }
+ return S_OK;
+}
+
+STDAPI GetNumberOfMethods(UINT32 *numCodecs)
+{
+ *numCodecs = g_NumCodecs;
+ return S_OK;
+}
+
+
+// ---------- Hashers ----------
+
+static int FindHasherClassId(const GUID *clsid) throw()
+{
+ if (clsid->Data1 != k_7zip_GUID_Data1 ||
+ clsid->Data2 != k_7zip_GUID_Data2 ||
+ clsid->Data3 != k_7zip_GUID_Data3_Hasher)
+ return -1;
+ UInt64 id = GetUi64(clsid->Data4);
+ for (unsigned i = 0; i < g_NumCodecs; i++)
+ if (id == g_Hashers[i]->Id)
+ return i;
+ return -1;
+}
+
+static HRESULT CreateHasher2(UInt32 index, IHasher **hasher)
+{
+ COM_TRY_BEGIN
+ *hasher = g_Hashers[index]->CreateHasher();
+ if (*hasher)
+ (*hasher)->AddRef();
+ return S_OK;
+ COM_TRY_END
+}
+
+STDAPI CreateHasher(const GUID *clsid, IHasher **outObject)
+{
+ COM_TRY_BEGIN
+ *outObject = 0;
+ int index = FindHasherClassId(clsid);
+ if (index < 0)
+ return CLASS_E_CLASSNOTAVAILABLE;
+ return CreateHasher2(index, outObject);
+ COM_TRY_END
+}
+
+STDAPI GetHasherProp(UInt32 codecIndex, PROPID propID, PROPVARIANT *value)
+{
+ ::VariantClear((VARIANTARG *)value);
+ const CHasherInfo &codec = *g_Hashers[codecIndex];
+ switch (propID)
+ {
+ case NMethodPropID::kID:
+ value->uhVal.QuadPart = (UInt64)codec.Id;
+ value->vt = VT_UI8;
+ break;
+ case NMethodPropID::kName:
+ SetPropFromAscii(codec.Name, value);
+ break;
+ case NMethodPropID::kEncoder:
+ if (codec.CreateHasher)
+ return MethodToClassID(k_7zip_GUID_Data3_Hasher, codec.Id, value);
+ break;
+ case NMethodPropID::kDigestSize:
+ value->ulVal = (ULONG)codec.DigestSize;
+ value->vt = VT_UI4;
+ break;
+ }
+ return S_OK;
+}
+
+class CHashers:
+ public IHashers,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(IHashers)
+
+ STDMETHOD_(UInt32, GetNumHashers)();
+ STDMETHOD(GetHasherProp)(UInt32 index, PROPID propID, PROPVARIANT *value);
+ STDMETHOD(CreateHasher)(UInt32 index, IHasher **hasher);
+};
+
+STDAPI GetHashers(IHashers **hashers)
+{
+ COM_TRY_BEGIN
+ *hashers = new CHashers;
+ if (*hashers)
+ (*hashers)->AddRef();
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP_(UInt32) CHashers::GetNumHashers()
+{
+ return g_NumHashers;
+}
+
+STDMETHODIMP CHashers::GetHasherProp(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ return ::GetHasherProp(index, propID, value);
+}
+
+STDMETHODIMP CHashers::CreateHasher(UInt32 index, IHasher **hasher)
+{
+ return ::CreateHasher2(index, hasher);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.cpp
new file mode 100644
index 0000000000..89b5237659
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.cpp
@@ -0,0 +1,120 @@
+// Compress/CopyCoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "CopyCoder.h"
+
+namespace NCompress {
+
+static const UInt32 kBufSize = 1 << 17;
+
+CCopyCoder::~CCopyCoder()
+{
+ ::MidFree(_buf);
+}
+
+STDMETHODIMP CCopyCoder::SetFinishMode(UInt32 /* finishMode */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CCopyCoder::Code(ISequentialInStream *inStream,
+ ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize,
+ ICompressProgressInfo *progress)
+{
+ if (!_buf)
+ {
+ _buf = (Byte *)::MidAlloc(kBufSize);
+ if (!_buf)
+ return E_OUTOFMEMORY;
+ }
+
+ TotalSize = 0;
+
+ for (;;)
+ {
+ UInt32 size = kBufSize;
+ if (outSize && size > *outSize - TotalSize)
+ size = (UInt32)(*outSize - TotalSize);
+ if (size == 0)
+ return S_OK;
+
+ HRESULT readRes = inStream->Read(_buf, size, &size);
+
+ if (size == 0)
+ return readRes;
+
+ if (outStream)
+ {
+ UInt32 pos = 0;
+ do
+ {
+ UInt32 curSize = size - pos;
+ HRESULT res = outStream->Write(_buf + pos, curSize, &curSize);
+ pos += curSize;
+ TotalSize += curSize;
+ RINOK(res);
+ if (curSize == 0)
+ return E_FAIL;
+ }
+ while (pos < size);
+ }
+ else
+ TotalSize += size;
+
+ RINOK(readRes);
+
+ if (progress)
+ {
+ RINOK(progress->SetRatioInfo(&TotalSize, &TotalSize));
+ }
+ }
+}
+
+STDMETHODIMP CCopyCoder::SetInStream(ISequentialInStream *inStream)
+{
+ _inStream = inStream;
+ TotalSize = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CCopyCoder::ReleaseInStream()
+{
+ _inStream.Release();
+ return S_OK;
+}
+
+STDMETHODIMP CCopyCoder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ UInt32 realProcessedSize = 0;
+ HRESULT res = _inStream->Read(data, size, &realProcessedSize);
+ TotalSize += realProcessedSize;
+ if (processedSize)
+ *processedSize = realProcessedSize;
+ return res;
+}
+
+STDMETHODIMP CCopyCoder::GetInStreamProcessedSize(UInt64 *value)
+{
+ *value = TotalSize;
+ return S_OK;
+}
+
+HRESULT CopyStream(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress)
+{
+ CMyComPtr<ICompressCoder> copyCoder = new CCopyCoder;
+ return copyCoder->Code(inStream, outStream, NULL, NULL, progress);
+}
+
+HRESULT CopyStream_ExactSize(ISequentialInStream *inStream, ISequentialOutStream *outStream, UInt64 size, ICompressProgressInfo *progress)
+{
+ NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder;
+ CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec;
+ RINOK(copyCoder->Code(inStream, outStream, NULL, &size, progress));
+ return copyCoderSpec->TotalSize == size ? S_OK : E_FAIL;
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.h
new file mode 100644
index 0000000000..b2fa491e09
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/CopyCoder.h
@@ -0,0 +1,49 @@
+// Compress/CopyCoder.h
+
+#ifndef __COMPRESS_COPY_CODER_H
+#define __COMPRESS_COPY_CODER_H
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+
+class CCopyCoder:
+ public ICompressCoder,
+ public ICompressSetInStream,
+ public ISequentialInStream,
+ public ICompressSetFinishMode,
+ public ICompressGetInStreamProcessedSize,
+ public CMyUnknownImp
+{
+ Byte *_buf;
+ CMyComPtr<ISequentialInStream> _inStream;
+public:
+ UInt64 TotalSize;
+
+ CCopyCoder(): _buf(0), TotalSize(0) {};
+ ~CCopyCoder();
+
+ MY_UNKNOWN_IMP5(
+ ICompressCoder,
+ ICompressSetInStream,
+ ISequentialInStream,
+ ICompressSetFinishMode,
+ ICompressGetInStreamProcessedSize)
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetInStream)(ISequentialInStream *inStream);
+ STDMETHOD(ReleaseInStream)();
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(SetFinishMode)(UInt32 finishMode);
+ STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
+};
+
+HRESULT CopyStream(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
+HRESULT CopyStream_ExactSize(ISequentialInStream *inStream, ISequentialOutStream *outStream, UInt64 size, ICompressProgressInfo *progress);
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/CopyRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/CopyRegister.cpp
new file mode 100644
index 0000000000..1c59fe0c00
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/CopyRegister.cpp
@@ -0,0 +1,15 @@
+// CopyRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "CopyCoder.h"
+
+namespace NCompress {
+
+REGISTER_CODEC_CREATE(CreateCodec, CCopyCoder())
+
+REGISTER_CODEC_2(Copy, CreateCodec, CreateCodec, 0, "Copy")
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/DeltaFilter.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/DeltaFilter.cpp
new file mode 100644
index 0000000000..cdbd33d4c7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/DeltaFilter.cpp
@@ -0,0 +1,128 @@
+// DeltaFilter.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Delta.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+#include "../Common/RegisterCodec.h"
+
+namespace NCompress {
+namespace NDelta {
+
+struct CDelta
+{
+ unsigned _delta;
+ Byte _state[DELTA_STATE_SIZE];
+
+ CDelta(): _delta(1) {}
+ void DeltaInit() { Delta_Init(_state); }
+};
+
+
+#ifndef EXTRACT_ONLY
+
+class CEncoder:
+ public ICompressFilter,
+ public ICompressSetCoderProperties,
+ public ICompressWriteCoderProperties,
+ CDelta,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP3(ICompressFilter, ICompressSetCoderProperties, ICompressWriteCoderProperties)
+ INTERFACE_ICompressFilter(;)
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
+};
+
+STDMETHODIMP CEncoder::Init()
+{
+ DeltaInit();
+ return S_OK;
+}
+
+STDMETHODIMP_(UInt32) CEncoder::Filter(Byte *data, UInt32 size)
+{
+ Delta_Encode(_state, _delta, data, size);
+ return size;
+}
+
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps)
+{
+ UInt32 delta = _delta;
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = props[i];
+ PROPID propID = propIDs[i];
+ if (propID >= NCoderPropID::kReduceSize)
+ continue;
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ switch (propID)
+ {
+ case NCoderPropID::kDefaultProp:
+ delta = (UInt32)prop.ulVal;
+ if (delta < 1 || delta > 256)
+ return E_INVALIDARG;
+ break;
+ case NCoderPropID::kNumThreads: break;
+ case NCoderPropID::kLevel: break;
+ default: return E_INVALIDARG;
+ }
+ }
+ _delta = delta;
+ return S_OK;
+}
+
+STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
+{
+ Byte prop = (Byte)(_delta - 1);
+ return outStream->Write(&prop, 1, NULL);
+}
+
+#endif
+
+
+class CDecoder:
+ public ICompressFilter,
+ public ICompressSetDecoderProperties2,
+ CDelta,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP2(ICompressFilter, ICompressSetDecoderProperties2)
+ INTERFACE_ICompressFilter(;)
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+};
+
+STDMETHODIMP CDecoder::Init()
+{
+ DeltaInit();
+ return S_OK;
+}
+
+STDMETHODIMP_(UInt32) CDecoder::Filter(Byte *data, UInt32 size)
+{
+ Delta_Decode(_state, _delta, data, size);
+ return size;
+}
+
+STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *props, UInt32 size)
+{
+ if (size != 1)
+ return E_INVALIDARG;
+ _delta = (unsigned)props[0] + 1;
+ return S_OK;
+}
+
+
+REGISTER_FILTER_E(Delta,
+ CDecoder(),
+ CEncoder(),
+ 3, "Delta")
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.cpp
new file mode 100644
index 0000000000..bb631c5c59
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.cpp
@@ -0,0 +1,265 @@
+// Lzma2Decoder.cpp
+
+#include "StdAfx.h"
+
+// #include <stdio.h>
+
+#include "../../../C/Alloc.h"
+// #include "../../../C/CpuTicks.h"
+
+#include "../Common/StreamUtils.h"
+
+#include "Lzma2Decoder.h"
+
+namespace NCompress {
+namespace NLzma2 {
+
+CDecoder::CDecoder():
+ _dec(NULL)
+ , _inProcessed(0)
+ , _prop(0xFF)
+ , _finishMode(false)
+ , _inBufSize(1 << 20)
+ , _outStep(1 << 20)
+ #ifndef _7ZIP_ST
+ , _tryMt(1)
+ , _numThreads(1)
+ , _memUsage((UInt64)(sizeof(size_t)) << 28)
+ #endif
+{}
+
+CDecoder::~CDecoder()
+{
+ if (_dec)
+ Lzma2DecMt_Destroy(_dec);
+}
+
+STDMETHODIMP CDecoder::SetInBufSize(UInt32 , UInt32 size) { _inBufSize = size; return S_OK; }
+STDMETHODIMP CDecoder::SetOutBufSize(UInt32 , UInt32 size) { _outStep = size; return S_OK; }
+
+STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *prop, UInt32 size)
+{
+ if (size != 1)
+ return E_NOTIMPL;
+ if (prop[0] > 40)
+ return E_NOTIMPL;
+ _prop = prop[0];
+ return S_OK;
+}
+
+
+STDMETHODIMP CDecoder::SetFinishMode(UInt32 finishMode)
+{
+ _finishMode = (finishMode != 0);
+ return S_OK;
+}
+
+
+
+#ifndef _7ZIP_ST
+
+static UInt64 Get_ExpectedBlockSize_From_Dict(UInt32 dictSize)
+{
+ const UInt32 kMinSize = (UInt32)1 << 20;
+ const UInt32 kMaxSize = (UInt32)1 << 28;
+ UInt64 blockSize = (UInt64)dictSize << 2;
+ if (blockSize < kMinSize) blockSize = kMinSize;
+ if (blockSize > kMaxSize) blockSize = kMaxSize;
+ if (blockSize < dictSize) blockSize = dictSize;
+ blockSize += (kMinSize - 1);
+ blockSize &= ~(UInt64)(kMinSize - 1);
+ return blockSize;
+}
+
+#define LZMA2_DIC_SIZE_FROM_PROP_FULL(p) ((p) == 40 ? 0xFFFFFFFF : (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11)))
+
+#endif
+
+#define RET_IF_WRAP_ERROR_CONFIRMED(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK && sRes == sResErrorCode) return wrapRes;
+
+#define RET_IF_WRAP_ERROR(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK /* && (sRes == SZ_OK || sRes == sResErrorCode) */) return wrapRes;
+
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
+{
+ _inProcessed = 0;
+
+ if (!_dec)
+ {
+ _dec = Lzma2DecMt_Create(
+ // &g_AlignedAlloc,
+ &g_Alloc,
+ &g_MidAlloc);
+ if (!_dec)
+ return E_OUTOFMEMORY;
+ }
+
+ CLzma2DecMtProps props;
+ Lzma2DecMtProps_Init(&props);
+
+ props.inBufSize_ST = _inBufSize;
+ props.outStep_ST = _outStep;
+
+ #ifndef _7ZIP_ST
+ {
+ props.numThreads = 1;
+ UInt32 numThreads = _numThreads;
+
+ if (_tryMt && numThreads >= 1)
+ {
+ UInt64 useLimit = _memUsage;
+ UInt32 dictSize = LZMA2_DIC_SIZE_FROM_PROP_FULL(_prop);
+ UInt64 expectedBlockSize64 = Get_ExpectedBlockSize_From_Dict(dictSize);
+ size_t expectedBlockSize = (size_t)expectedBlockSize64;
+ size_t inBlockMax = expectedBlockSize + expectedBlockSize / 16;
+ if (expectedBlockSize == expectedBlockSize64 && inBlockMax >= expectedBlockSize)
+ {
+ props.outBlockMax = expectedBlockSize;
+ props.inBlockMax = inBlockMax;
+ const size_t kOverheadSize = props.inBufSize_MT + (1 << 16);
+ UInt64 okThreads = useLimit / (props.outBlockMax + props.inBlockMax + kOverheadSize);
+ if (numThreads > okThreads)
+ numThreads = (UInt32)okThreads;
+ if (numThreads == 0)
+ numThreads = 1;
+ props.numThreads = numThreads;
+ }
+ }
+ }
+ #endif
+
+ CSeqInStreamWrap inWrap;
+ CSeqOutStreamWrap outWrap;
+ CCompressProgressWrap progressWrap;
+
+ inWrap.Init(inStream);
+ outWrap.Init(outStream);
+ progressWrap.Init(progress);
+
+ SRes res;
+
+ UInt64 inProcessed = 0;
+ int isMT = False;
+
+ #ifndef _7ZIP_ST
+ isMT = _tryMt;
+ #endif
+
+ // UInt64 cpuTicks = GetCpuTicks();
+
+ res = Lzma2DecMt_Decode(_dec, _prop, &props,
+ &outWrap.vt, outSize, _finishMode,
+ &inWrap.vt,
+ &inProcessed,
+ &isMT,
+ progress ? &progressWrap.vt : NULL);
+
+ /*
+ cpuTicks = GetCpuTicks() - cpuTicks;
+ printf("\n ticks = %10I64u\n", cpuTicks / 1000000);
+ */
+
+
+ #ifndef _7ZIP_ST
+ /* we reset _tryMt, only if p->props.numThreads was changed */
+ if (props.numThreads > 1)
+ _tryMt = isMT;
+ #endif
+
+ _inProcessed = inProcessed;
+
+ RET_IF_WRAP_ERROR(progressWrap.Res, res, SZ_ERROR_PROGRESS)
+ RET_IF_WRAP_ERROR(outWrap.Res, res, SZ_ERROR_WRITE)
+ RET_IF_WRAP_ERROR_CONFIRMED(inWrap.Res, res, SZ_ERROR_READ)
+
+ if (res == SZ_OK && _finishMode)
+ {
+ if (inSize && *inSize != inProcessed)
+ res = SZ_ERROR_DATA;
+ if (outSize && *outSize != outWrap.Processed)
+ res = SZ_ERROR_DATA;
+ }
+
+ return SResToHRESULT(res);
+}
+
+
+STDMETHODIMP CDecoder::GetInStreamProcessedSize(UInt64 *value)
+{
+ *value = _inProcessed;
+ return S_OK;
+}
+
+
+#ifndef _7ZIP_ST
+
+STDMETHODIMP CDecoder::SetNumberOfThreads(UInt32 numThreads)
+{
+ _numThreads = numThreads;
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::SetMemLimit(UInt64 memUsage)
+{
+ _memUsage = memUsage;
+ return S_OK;
+}
+
+#endif
+
+
+#ifndef NO_READ_FROM_CODER
+
+STDMETHODIMP CDecoder::SetOutStreamSize(const UInt64 *outSize)
+{
+ CLzma2DecMtProps props;
+ Lzma2DecMtProps_Init(&props);
+ props.inBufSize_ST = _inBufSize;
+ props.outStep_ST = _outStep;
+
+ _inProcessed = 0;
+
+ if (!_dec)
+ {
+ _dec = Lzma2DecMt_Create(&g_AlignedAlloc, &g_MidAlloc);
+ if (!_dec)
+ return E_OUTOFMEMORY;
+ }
+
+ _inWrap.Init(_inStream);
+
+ SRes res = Lzma2DecMt_Init(_dec, _prop, &props, outSize, _finishMode, &_inWrap.vt);
+
+ if (res != SZ_OK)
+ return SResToHRESULT(res);
+ return S_OK;
+}
+
+
+STDMETHODIMP CDecoder::SetInStream(ISequentialInStream *inStream) { _inStream = inStream; return S_OK; }
+STDMETHODIMP CDecoder::ReleaseInStream() { _inStream.Release(); return S_OK; }
+
+
+STDMETHODIMP CDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ size_t size2 = size;
+ UInt64 inProcessed = 0;
+
+ SRes res = Lzma2DecMt_Read(_dec, (Byte *)data, &size2, &inProcessed);
+
+ _inProcessed += inProcessed;
+ if (processedSize)
+ *processedSize = (UInt32)size2;
+ if (res != SZ_OK)
+ return SResToHRESULT(res);
+ return S_OK;
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.h
new file mode 100644
index 0000000000..b56488e0d8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Decoder.h
@@ -0,0 +1,96 @@
+// Lzma2Decoder.h
+
+#ifndef __LZMA2_DECODER_H
+#define __LZMA2_DECODER_H
+
+#include "../../../C/Lzma2DecMt.h"
+
+#include "../Common/CWrappers.h"
+
+namespace NCompress {
+namespace NLzma2 {
+
+class CDecoder:
+ public ICompressCoder,
+ public ICompressSetDecoderProperties2,
+ public ICompressSetFinishMode,
+ public ICompressGetInStreamProcessedSize,
+ public ICompressSetBufSize,
+
+ #ifndef NO_READ_FROM_CODER
+ public ICompressSetInStream,
+ public ICompressSetOutStreamSize,
+ public ISequentialInStream,
+ #endif
+
+ #ifndef _7ZIP_ST
+ public ICompressSetCoderMt,
+ public ICompressSetMemLimit,
+ #endif
+
+ public CMyUnknownImp
+{
+ CLzma2DecMtHandle _dec;
+ UInt64 _inProcessed;
+ Byte _prop;
+ int _finishMode;
+ UInt32 _inBufSize;
+ UInt32 _outStep;
+
+public:
+ MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetDecoderProperties2)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetFinishMode)
+ MY_QUERYINTERFACE_ENTRY(ICompressGetInStreamProcessedSize)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetBufSize)
+
+ #ifndef NO_READ_FROM_CODER
+ MY_QUERYINTERFACE_ENTRY(ICompressSetInStream)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetOutStreamSize)
+ MY_QUERYINTERFACE_ENTRY(ISequentialInStream)
+ #endif
+
+ #ifndef _7ZIP_ST
+ MY_QUERYINTERFACE_ENTRY(ICompressSetCoderMt)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetMemLimit)
+ #endif
+
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+ STDMETHOD(SetFinishMode)(UInt32 finishMode);
+ STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
+ STDMETHOD(SetInBufSize)(UInt32 streamIndex, UInt32 size);
+ STDMETHOD(SetOutBufSize)(UInt32 streamIndex, UInt32 size);
+
+ #ifndef _7ZIP_ST
+private:
+ int _tryMt;
+ UInt32 _numThreads;
+ UInt64 _memUsage;
+public:
+ STDMETHOD(SetNumberOfThreads)(UInt32 numThreads);
+ STDMETHOD(SetMemLimit)(UInt64 memUsage);
+ #endif
+
+ #ifndef NO_READ_FROM_CODER
+private:
+ CMyComPtr<ISequentialInStream> _inStream;
+ CSeqInStreamWrap _inWrap;
+public:
+ STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
+ STDMETHOD(SetInStream)(ISequentialInStream *inStream);
+ STDMETHOD(ReleaseInStream)();
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ #endif
+
+ CDecoder();
+ virtual ~CDecoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.cpp
new file mode 100644
index 0000000000..18f7d029d9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.cpp
@@ -0,0 +1,122 @@
+// Lzma2Encoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../Common/CWrappers.h"
+#include "../Common/StreamUtils.h"
+
+#include "Lzma2Encoder.h"
+
+namespace NCompress {
+
+namespace NLzma {
+
+HRESULT SetLzmaProp(PROPID propID, const PROPVARIANT &prop, CLzmaEncProps &ep);
+
+}
+
+namespace NLzma2 {
+
+CEncoder::CEncoder()
+{
+ _encoder = NULL;
+ _encoder = Lzma2Enc_Create(&g_AlignedAlloc, &g_BigAlloc);
+ if (!_encoder)
+ throw 1;
+}
+
+CEncoder::~CEncoder()
+{
+ if (_encoder)
+ Lzma2Enc_Destroy(_encoder);
+}
+
+
+HRESULT SetLzma2Prop(PROPID propID, const PROPVARIANT &prop, CLzma2EncProps &lzma2Props)
+{
+ switch (propID)
+ {
+ case NCoderPropID::kBlockSize:
+ {
+ if (prop.vt == VT_UI4)
+ lzma2Props.blockSize = prop.ulVal;
+ else if (prop.vt == VT_UI8)
+ lzma2Props.blockSize = prop.uhVal.QuadPart;
+ else
+ return E_INVALIDARG;
+ break;
+ }
+ case NCoderPropID::kNumThreads:
+ if (prop.vt != VT_UI4) return E_INVALIDARG; lzma2Props.numTotalThreads = (int)(prop.ulVal); break;
+ default:
+ RINOK(NLzma::SetLzmaProp(propID, prop, lzma2Props.lzmaProps));
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
+ const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ CLzma2EncProps lzma2Props;
+ Lzma2EncProps_Init(&lzma2Props);
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ RINOK(SetLzma2Prop(propIDs[i], coderProps[i], lzma2Props));
+ }
+ return SResToHRESULT(Lzma2Enc_SetProps(_encoder, &lzma2Props));
+}
+
+
+STDMETHODIMP CEncoder::SetCoderPropertiesOpt(const PROPID *propIDs,
+ const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ PROPID propID = propIDs[i];
+ if (propID == NCoderPropID::kExpectedDataSize)
+ if (prop.vt == VT_UI8)
+ Lzma2Enc_SetDataSize(_encoder, prop.uhVal.QuadPart);
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
+{
+ Byte prop = Lzma2Enc_WriteProperties(_encoder);
+ return WriteStream(outStream, &prop, 1);
+}
+
+
+#define RET_IF_WRAP_ERROR(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK /* && (sRes == SZ_OK || sRes == sResErrorCode) */) return wrapRes;
+
+STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
+{
+ CSeqInStreamWrap inWrap;
+ CSeqOutStreamWrap outWrap;
+ CCompressProgressWrap progressWrap;
+
+ inWrap.Init(inStream);
+ outWrap.Init(outStream);
+ progressWrap.Init(progress);
+
+ SRes res = Lzma2Enc_Encode2(_encoder,
+ &outWrap.vt, NULL, NULL,
+ &inWrap.vt, NULL, 0,
+ progress ? &progressWrap.vt : NULL);
+
+ RET_IF_WRAP_ERROR(inWrap.Res, res, SZ_ERROR_READ)
+ RET_IF_WRAP_ERROR(outWrap.Res, res, SZ_ERROR_WRITE)
+ RET_IF_WRAP_ERROR(progressWrap.Res, res, SZ_ERROR_PROGRESS)
+
+ return SResToHRESULT(res);
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.h
new file mode 100644
index 0000000000..6539e73acf
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Encoder.h
@@ -0,0 +1,42 @@
+// Lzma2Encoder.h
+
+#ifndef __LZMA2_ENCODER_H
+#define __LZMA2_ENCODER_H
+
+#include "../../../C/Lzma2Enc.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NLzma2 {
+
+class CEncoder:
+ public ICompressCoder,
+ public ICompressSetCoderProperties,
+ public ICompressWriteCoderProperties,
+ public ICompressSetCoderPropertiesOpt,
+ public CMyUnknownImp
+{
+ CLzma2EncHandle _encoder;
+public:
+ MY_UNKNOWN_IMP4(
+ ICompressCoder,
+ ICompressSetCoderProperties,
+ ICompressWriteCoderProperties,
+ ICompressSetCoderPropertiesOpt)
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
+ STDMETHOD(SetCoderPropertiesOpt)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+
+ CEncoder();
+ virtual ~CEncoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Register.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Register.cpp
new file mode 100644
index 0000000000..4367105635
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/Lzma2Register.cpp
@@ -0,0 +1,22 @@
+// Lzma2Register.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "Lzma2Decoder.h"
+
+#ifndef EXTRACT_ONLY
+#include "Lzma2Encoder.h"
+#endif
+
+namespace NCompress {
+namespace NLzma2 {
+
+REGISTER_CODEC_E(LZMA2,
+ CDecoder(),
+ CEncoder(),
+ 0x21,
+ "LZMA2")
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.cpp
new file mode 100644
index 0000000000..b6a8d3fbd3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.cpp
@@ -0,0 +1,343 @@
+// LzmaDecoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../Common/StreamUtils.h"
+
+#include "LzmaDecoder.h"
+
+static HRESULT SResToHRESULT(SRes res)
+{
+ switch (res)
+ {
+ case SZ_OK: return S_OK;
+ case SZ_ERROR_MEM: return E_OUTOFMEMORY;
+ case SZ_ERROR_PARAM: return E_INVALIDARG;
+ case SZ_ERROR_UNSUPPORTED: return E_NOTIMPL;
+ case SZ_ERROR_DATA: return S_FALSE;
+ }
+ return E_FAIL;
+}
+
+namespace NCompress {
+namespace NLzma {
+
+CDecoder::CDecoder():
+ _inBuf(NULL),
+ _lzmaStatus(LZMA_STATUS_NOT_SPECIFIED),
+ FinishStream(false),
+ _propsWereSet(false),
+ _outSizeDefined(false),
+ _outStep(1 << 20),
+ _inBufSize(0),
+ _inBufSizeNew(1 << 20)
+{
+ _inProcessed = 0;
+ _inPos = _inLim = 0;
+
+ /*
+ AlignOffsetAlloc_CreateVTable(&_alloc);
+ _alloc.numAlignBits = 7;
+ _alloc.offset = 0;
+ */
+ LzmaDec_Construct(&_state);
+}
+
+CDecoder::~CDecoder()
+{
+ LzmaDec_Free(&_state, &g_AlignedAlloc); // &_alloc.vt
+ MyFree(_inBuf);
+}
+
+STDMETHODIMP CDecoder::SetInBufSize(UInt32 , UInt32 size) { _inBufSizeNew = size; return S_OK; }
+STDMETHODIMP CDecoder::SetOutBufSize(UInt32 , UInt32 size) { _outStep = size; return S_OK; }
+
+HRESULT CDecoder::CreateInputBuffer()
+{
+ if (!_inBuf || _inBufSizeNew != _inBufSize)
+ {
+ MyFree(_inBuf);
+ _inBufSize = 0;
+ _inBuf = (Byte *)MyAlloc(_inBufSizeNew);
+ if (!_inBuf)
+ return E_OUTOFMEMORY;
+ _inBufSize = _inBufSizeNew;
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *prop, UInt32 size)
+{
+ RINOK(SResToHRESULT(LzmaDec_Allocate(&_state, prop, size, &g_AlignedAlloc))) // &_alloc.vt
+ _propsWereSet = true;
+ return CreateInputBuffer();
+}
+
+
+void CDecoder::SetOutStreamSizeResume(const UInt64 *outSize)
+{
+ _outSizeDefined = (outSize != NULL);
+ _outSize = 0;
+ if (_outSizeDefined)
+ _outSize = *outSize;
+ _outProcessed = 0;
+ _lzmaStatus = LZMA_STATUS_NOT_SPECIFIED;
+
+ LzmaDec_Init(&_state);
+}
+
+
+STDMETHODIMP CDecoder::SetOutStreamSize(const UInt64 *outSize)
+{
+ _inProcessed = 0;
+ _inPos = _inLim = 0;
+ SetOutStreamSizeResume(outSize);
+ return S_OK;
+}
+
+
+STDMETHODIMP CDecoder::SetFinishMode(UInt32 finishMode)
+{
+ FinishStream = (finishMode != 0);
+ return S_OK;
+}
+
+
+STDMETHODIMP CDecoder::GetInStreamProcessedSize(UInt64 *value)
+{
+ *value = _inProcessed;
+ return S_OK;
+}
+
+
+HRESULT CDecoder::CodeSpec(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress)
+{
+ if (!_inBuf || !_propsWereSet)
+ return S_FALSE;
+
+ const UInt64 startInProgress = _inProcessed;
+ SizeT wrPos = _state.dicPos;
+ HRESULT readRes = S_OK;
+
+ for (;;)
+ {
+ if (_inPos == _inLim && readRes == S_OK)
+ {
+ _inPos = _inLim = 0;
+ readRes = inStream->Read(_inBuf, _inBufSize, &_inLim);
+ }
+
+ const SizeT dicPos = _state.dicPos;
+ SizeT size;
+ {
+ SizeT next = _state.dicBufSize;
+ if (next - wrPos > _outStep)
+ next = wrPos + _outStep;
+ size = next - dicPos;
+ }
+
+ ELzmaFinishMode finishMode = LZMA_FINISH_ANY;
+ if (_outSizeDefined)
+ {
+ const UInt64 rem = _outSize - _outProcessed;
+ if (size >= rem)
+ {
+ size = (SizeT)rem;
+ if (FinishStream)
+ finishMode = LZMA_FINISH_END;
+ }
+ }
+
+ SizeT inProcessed = _inLim - _inPos;
+ ELzmaStatus status;
+
+ SRes res = LzmaDec_DecodeToDic(&_state, dicPos + size, _inBuf + _inPos, &inProcessed, finishMode, &status);
+
+ _lzmaStatus = status;
+ _inPos += (UInt32)inProcessed;
+ _inProcessed += inProcessed;
+ const SizeT outProcessed = _state.dicPos - dicPos;
+ _outProcessed += outProcessed;
+
+ // we check for LZMA_STATUS_NEEDS_MORE_INPUT to allow RangeCoder initialization, if (_outSizeDefined && _outSize == 0)
+ bool outFinished = (_outSizeDefined && _outProcessed >= _outSize);
+
+ bool needStop = (res != 0
+ || (inProcessed == 0 && outProcessed == 0)
+ || status == LZMA_STATUS_FINISHED_WITH_MARK
+ || (outFinished && status != LZMA_STATUS_NEEDS_MORE_INPUT));
+
+ if (needStop || outProcessed >= size)
+ {
+ HRESULT res2 = WriteStream(outStream, _state.dic + wrPos, _state.dicPos - wrPos);
+
+ if (_state.dicPos == _state.dicBufSize)
+ _state.dicPos = 0;
+ wrPos = _state.dicPos;
+
+ RINOK(res2);
+
+ if (needStop)
+ {
+ if (res != 0)
+ return S_FALSE;
+
+ if (status == LZMA_STATUS_FINISHED_WITH_MARK)
+ {
+ if (FinishStream)
+ if (_outSizeDefined && _outSize != _outProcessed)
+ return S_FALSE;
+ return readRes;
+ }
+
+ if (outFinished && status != LZMA_STATUS_NEEDS_MORE_INPUT)
+ if (!FinishStream || status == LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK)
+ return readRes;
+
+ return S_FALSE;
+ }
+ }
+
+ if (progress)
+ {
+ const UInt64 inSize = _inProcessed - startInProgress;
+ RINOK(progress->SetRatioInfo(&inSize, &_outProcessed));
+ }
+ }
+}
+
+
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress)
+{
+ if (!_inBuf)
+ return E_INVALIDARG;
+ SetOutStreamSize(outSize);
+ HRESULT res = CodeSpec(inStream, outStream, progress);
+ if (res == S_OK)
+ if (FinishStream && inSize && *inSize != _inProcessed)
+ res = S_FALSE;
+ return res;
+}
+
+
+#ifndef NO_READ_FROM_CODER
+
+STDMETHODIMP CDecoder::SetInStream(ISequentialInStream *inStream) { _inStream = inStream; return S_OK; }
+STDMETHODIMP CDecoder::ReleaseInStream() { _inStream.Release(); return S_OK; }
+
+
+STDMETHODIMP CDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+
+ ELzmaFinishMode finishMode = LZMA_FINISH_ANY;
+ if (_outSizeDefined)
+ {
+ const UInt64 rem = _outSize - _outProcessed;
+ if (size >= rem)
+ {
+ size = (UInt32)rem;
+ if (FinishStream)
+ finishMode = LZMA_FINISH_END;
+ }
+ }
+
+ HRESULT readRes = S_OK;
+
+ for (;;)
+ {
+ if (_inPos == _inLim && readRes == S_OK)
+ {
+ _inPos = _inLim = 0;
+ readRes = _inStream->Read(_inBuf, _inBufSize, &_inLim);
+ }
+
+ SizeT inProcessed = _inLim - _inPos;
+ SizeT outProcessed = size;
+ ELzmaStatus status;
+
+ SRes res = LzmaDec_DecodeToBuf(&_state, (Byte *)data, &outProcessed,
+ _inBuf + _inPos, &inProcessed, finishMode, &status);
+
+ _lzmaStatus = status;
+ _inPos += (UInt32)inProcessed;
+ _inProcessed += inProcessed;
+ _outProcessed += outProcessed;
+ size -= (UInt32)outProcessed;
+ data = (Byte *)data + outProcessed;
+ if (processedSize)
+ *processedSize += (UInt32)outProcessed;
+
+ if (res != 0)
+ return S_FALSE;
+
+ /*
+ if (status == LZMA_STATUS_FINISHED_WITH_MARK)
+ return readRes;
+
+ if (size == 0 && status != LZMA_STATUS_NEEDS_MORE_INPUT)
+ {
+ if (FinishStream
+ && _outSizeDefined && _outProcessed >= _outSize
+ && status != LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK)
+ return S_FALSE;
+ return readRes;
+ }
+ */
+
+ if (inProcessed == 0 && outProcessed == 0)
+ return readRes;
+ }
+}
+
+
+HRESULT CDecoder::CodeResume(ISequentialOutStream *outStream, const UInt64 *outSize, ICompressProgressInfo *progress)
+{
+ SetOutStreamSizeResume(outSize);
+ return CodeSpec(_inStream, outStream, progress);
+}
+
+
+HRESULT CDecoder::ReadFromInputStream(void *data, UInt32 size, UInt32 *processedSize)
+{
+ RINOK(CreateInputBuffer());
+
+ if (processedSize)
+ *processedSize = 0;
+
+ HRESULT readRes = S_OK;
+
+ while (size != 0)
+ {
+ if (_inPos == _inLim)
+ {
+ _inPos = _inLim = 0;
+ if (readRes == S_OK)
+ readRes = _inStream->Read(_inBuf, _inBufSize, &_inLim);
+ if (_inLim == 0)
+ break;
+ }
+
+ UInt32 cur = _inLim - _inPos;
+ if (cur > size)
+ cur = size;
+ memcpy(data, _inBuf + _inPos, cur);
+ _inPos += cur;
+ _inProcessed += cur;
+ size -= cur;
+ data = (Byte *)data + cur;
+ if (processedSize)
+ *processedSize += cur;
+ }
+
+ return readRes;
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.h
new file mode 100644
index 0000000000..08b7c1bc30
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaDecoder.h
@@ -0,0 +1,113 @@
+// LzmaDecoder.h
+
+#ifndef __LZMA_DECODER_H
+#define __LZMA_DECODER_H
+
+// #include "../../../C/Alloc.h"
+#include "../../../C/LzmaDec.h"
+
+#include "../../Common/MyCom.h"
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NLzma {
+
+class CDecoder:
+ public ICompressCoder,
+ public ICompressSetDecoderProperties2,
+ public ICompressSetFinishMode,
+ public ICompressGetInStreamProcessedSize,
+ public ICompressSetBufSize,
+ #ifndef NO_READ_FROM_CODER
+ public ICompressSetInStream,
+ public ICompressSetOutStreamSize,
+ public ISequentialInStream,
+ #endif
+ public CMyUnknownImp
+{
+ Byte *_inBuf;
+ UInt32 _inPos;
+ UInt32 _inLim;
+
+ ELzmaStatus _lzmaStatus;
+
+public:
+ bool FinishStream; // set it before decoding, if you need to decode full LZMA stream
+
+private:
+ bool _propsWereSet;
+ bool _outSizeDefined;
+ UInt64 _outSize;
+ UInt64 _inProcessed;
+ UInt64 _outProcessed;
+
+ UInt32 _outStep;
+ UInt32 _inBufSize;
+ UInt32 _inBufSizeNew;
+
+ // CAlignOffsetAlloc _alloc;
+
+ CLzmaDec _state;
+
+ HRESULT CreateInputBuffer();
+ HRESULT CodeSpec(ISequentialInStream *inStream, ISequentialOutStream *outStream, ICompressProgressInfo *progress);
+ void SetOutStreamSizeResume(const UInt64 *outSize);
+
+public:
+ MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetDecoderProperties2)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetFinishMode)
+ MY_QUERYINTERFACE_ENTRY(ICompressGetInStreamProcessedSize)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetBufSize)
+ #ifndef NO_READ_FROM_CODER
+ MY_QUERYINTERFACE_ENTRY(ICompressSetInStream)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetOutStreamSize)
+ MY_QUERYINTERFACE_ENTRY(ISequentialInStream)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+ STDMETHOD(SetFinishMode)(UInt32 finishMode);
+ STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
+ STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
+ STDMETHOD(SetInBufSize)(UInt32 streamIndex, UInt32 size);
+ STDMETHOD(SetOutBufSize)(UInt32 streamIndex, UInt32 size);
+
+ #ifndef NO_READ_FROM_CODER
+
+private:
+ CMyComPtr<ISequentialInStream> _inStream;
+public:
+
+ STDMETHOD(SetInStream)(ISequentialInStream *inStream);
+ STDMETHOD(ReleaseInStream)();
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+
+ HRESULT CodeResume(ISequentialOutStream *outStream, const UInt64 *outSize, ICompressProgressInfo *progress);
+ HRESULT ReadFromInputStream(void *data, UInt32 size, UInt32 *processedSize);
+
+ #endif
+
+ UInt64 GetInputProcessedSize() const { return _inProcessed; }
+
+ CDecoder();
+ virtual ~CDecoder();
+
+ UInt64 GetOutputProcessedSize() const { return _outProcessed; }
+
+ bool NeedsMoreInput() const { return _lzmaStatus == LZMA_STATUS_NEEDS_MORE_INPUT; }
+
+ bool CheckFinishStatus(bool withEndMark) const
+ {
+ return _lzmaStatus == (withEndMark ?
+ LZMA_STATUS_FINISHED_WITH_MARK :
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK);
+ }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.cpp
new file mode 100644
index 0000000000..3151c3d219
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.cpp
@@ -0,0 +1,182 @@
+// LzmaEncoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../Common/CWrappers.h"
+#include "../Common/StreamUtils.h"
+
+#include "LzmaEncoder.h"
+
+namespace NCompress {
+namespace NLzma {
+
+CEncoder::CEncoder()
+{
+ _encoder = NULL;
+ _encoder = LzmaEnc_Create(&g_AlignedAlloc);
+ if (!_encoder)
+ throw 1;
+}
+
+CEncoder::~CEncoder()
+{
+ if (_encoder)
+ LzmaEnc_Destroy(_encoder, &g_AlignedAlloc, &g_BigAlloc);
+}
+
+static inline wchar_t GetUpperChar(wchar_t c)
+{
+ if (c >= 'a' && c <= 'z')
+ c -= 0x20;
+ return c;
+}
+
+static int ParseMatchFinder(const wchar_t *s, int *btMode, int *numHashBytes)
+{
+ wchar_t c = GetUpperChar(*s++);
+ if (c == L'H')
+ {
+ if (GetUpperChar(*s++) != L'C')
+ return 0;
+ int numHashBytesLoc = (int)(*s++ - L'0');
+ if (numHashBytesLoc < 4 || numHashBytesLoc > 4)
+ return 0;
+ if (*s != 0)
+ return 0;
+ *btMode = 0;
+ *numHashBytes = numHashBytesLoc;
+ return 1;
+ }
+
+ if (c != L'B')
+ return 0;
+ if (GetUpperChar(*s++) != L'T')
+ return 0;
+ int numHashBytesLoc = (int)(*s++ - L'0');
+ if (numHashBytesLoc < 2 || numHashBytesLoc > 4)
+ return 0;
+ if (*s != 0)
+ return 0;
+ *btMode = 1;
+ *numHashBytes = numHashBytesLoc;
+ return 1;
+}
+
+#define SET_PROP_32(_id_, _dest_) case NCoderPropID::_id_: ep._dest_ = v; break;
+
+HRESULT SetLzmaProp(PROPID propID, const PROPVARIANT &prop, CLzmaEncProps &ep)
+{
+ if (propID == NCoderPropID::kMatchFinder)
+ {
+ if (prop.vt != VT_BSTR)
+ return E_INVALIDARG;
+ return ParseMatchFinder(prop.bstrVal, &ep.btMode, &ep.numHashBytes) ? S_OK : E_INVALIDARG;
+ }
+
+ if (propID > NCoderPropID::kReduceSize)
+ return S_OK;
+
+ if (propID == NCoderPropID::kReduceSize)
+ {
+ if (prop.vt == VT_UI8)
+ ep.reduceSize = prop.uhVal.QuadPart;
+ else
+ return E_INVALIDARG;
+ return S_OK;
+ }
+
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ UInt32 v = prop.ulVal;
+ switch (propID)
+ {
+ case NCoderPropID::kDefaultProp: if (v > 31) return E_INVALIDARG; ep.dictSize = (UInt32)1 << (unsigned)v; break;
+ SET_PROP_32(kLevel, level)
+ SET_PROP_32(kNumFastBytes, fb)
+ SET_PROP_32(kMatchFinderCycles, mc)
+ SET_PROP_32(kAlgorithm, algo)
+ SET_PROP_32(kDictionarySize, dictSize)
+ SET_PROP_32(kPosStateBits, pb)
+ SET_PROP_32(kLitPosBits, lp)
+ SET_PROP_32(kLitContextBits, lc)
+ SET_PROP_32(kNumThreads, numThreads)
+ default: return E_INVALIDARG;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
+ const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ CLzmaEncProps props;
+ LzmaEncProps_Init(&props);
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ PROPID propID = propIDs[i];
+ switch (propID)
+ {
+ case NCoderPropID::kEndMarker:
+ if (prop.vt != VT_BOOL) return E_INVALIDARG; props.writeEndMark = (prop.boolVal != VARIANT_FALSE); break;
+ default:
+ RINOK(SetLzmaProp(propID, prop, props));
+ }
+ }
+ return SResToHRESULT(LzmaEnc_SetProps(_encoder, &props));
+}
+
+
+STDMETHODIMP CEncoder::SetCoderPropertiesOpt(const PROPID *propIDs,
+ const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ PROPID propID = propIDs[i];
+ if (propID == NCoderPropID::kExpectedDataSize)
+ if (prop.vt == VT_UI8)
+ LzmaEnc_SetDataSize(_encoder, prop.uhVal.QuadPart);
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
+{
+ Byte props[LZMA_PROPS_SIZE];
+ size_t size = LZMA_PROPS_SIZE;
+ RINOK(LzmaEnc_WriteProperties(_encoder, props, &size));
+ return WriteStream(outStream, props, size);
+}
+
+
+#define RET_IF_WRAP_ERROR(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK /* && (sRes == SZ_OK || sRes == sResErrorCode) */) return wrapRes;
+
+STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
+{
+ CSeqInStreamWrap inWrap;
+ CSeqOutStreamWrap outWrap;
+ CCompressProgressWrap progressWrap;
+
+ inWrap.Init(inStream);
+ outWrap.Init(outStream);
+ progressWrap.Init(progress);
+
+ SRes res = LzmaEnc_Encode(_encoder, &outWrap.vt, &inWrap.vt,
+ progress ? &progressWrap.vt : NULL, &g_AlignedAlloc, &g_BigAlloc);
+
+ _inputProcessed = inWrap.Processed;
+
+ RET_IF_WRAP_ERROR(inWrap.Res, res, SZ_ERROR_READ)
+ RET_IF_WRAP_ERROR(outWrap.Res, res, SZ_ERROR_WRITE)
+ RET_IF_WRAP_ERROR(progressWrap.Res, res, SZ_ERROR_PROGRESS)
+
+ return SResToHRESULT(res);
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.h
new file mode 100644
index 0000000000..7b31c66d81
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaEncoder.h
@@ -0,0 +1,46 @@
+// LzmaEncoder.h
+
+#ifndef __LZMA_ENCODER_H
+#define __LZMA_ENCODER_H
+
+#include "../../../C/LzmaEnc.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NLzma {
+
+class CEncoder:
+ public ICompressCoder,
+ public ICompressSetCoderProperties,
+ public ICompressWriteCoderProperties,
+ public ICompressSetCoderPropertiesOpt,
+ public CMyUnknownImp
+{
+ CLzmaEncHandle _encoder;
+ UInt64 _inputProcessed;
+public:
+ MY_UNKNOWN_IMP4(
+ ICompressCoder,
+ ICompressSetCoderProperties,
+ ICompressWriteCoderProperties,
+ ICompressSetCoderPropertiesOpt)
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
+ STDMETHOD(SetCoderPropertiesOpt)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+
+ CEncoder();
+ virtual ~CEncoder();
+
+ UInt64 GetInputProcessedSize() const { return _inputProcessed; }
+ bool IsWriteEndMark() const { return LzmaEnc_IsWriteEndMark(_encoder) != 0; }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaRegister.cpp
new file mode 100644
index 0000000000..4397595081
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/LzmaRegister.cpp
@@ -0,0 +1,22 @@
+// LzmaRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "LzmaDecoder.h"
+
+#ifndef EXTRACT_ONLY
+#include "LzmaEncoder.h"
+#endif
+
+namespace NCompress {
+namespace NLzma {
+
+REGISTER_CODEC_E(LZMA,
+ CDecoder(),
+ CEncoder(),
+ 0x30101,
+ "LZMA")
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.cpp
new file mode 100644
index 0000000000..4820c0a7c0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.cpp
@@ -0,0 +1,170 @@
+// PpmdDecoder.cpp
+// 2009-03-11 : Igor Pavlov : Public domain
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+#include "../../../C/CpuArch.h"
+
+#include "../Common/StreamUtils.h"
+
+#include "PpmdDecoder.h"
+
+namespace NCompress {
+namespace NPpmd {
+
+static const UInt32 kBufSize = (1 << 20);
+
+enum
+{
+ kStatus_NeedInit,
+ kStatus_Normal,
+ kStatus_Finished,
+ kStatus_Error
+};
+
+CDecoder::~CDecoder()
+{
+ ::MidFree(_outBuf);
+ Ppmd7_Free(&_ppmd, &g_BigAlloc);
+}
+
+STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *props, UInt32 size)
+{
+ if (size < 5)
+ return E_INVALIDARG;
+ _order = props[0];
+ UInt32 memSize = GetUi32(props + 1);
+ if (_order < PPMD7_MIN_ORDER ||
+ _order > PPMD7_MAX_ORDER ||
+ memSize < PPMD7_MIN_MEM_SIZE ||
+ memSize > PPMD7_MAX_MEM_SIZE)
+ return E_NOTIMPL;
+ if (!_inStream.Alloc(1 << 20))
+ return E_OUTOFMEMORY;
+ if (!Ppmd7_Alloc(&_ppmd, memSize, &g_BigAlloc))
+ return E_OUTOFMEMORY;
+ return S_OK;
+}
+
+HRESULT CDecoder::CodeSpec(Byte *memStream, UInt32 size)
+{
+ switch (_status)
+ {
+ case kStatus_Finished: return S_OK;
+ case kStatus_Error: return S_FALSE;
+ case kStatus_NeedInit:
+ _inStream.Init();
+ if (!Ppmd7z_RangeDec_Init(&_rangeDec))
+ {
+ _status = kStatus_Error;
+ return S_FALSE;
+ }
+ _status = kStatus_Normal;
+ Ppmd7_Init(&_ppmd, _order);
+ break;
+ }
+ if (_outSizeDefined)
+ {
+ const UInt64 rem = _outSize - _processedSize;
+ if (size > rem)
+ size = (UInt32)rem;
+ }
+
+ UInt32 i;
+ int sym = 0;
+ for (i = 0; i != size; i++)
+ {
+ sym = Ppmd7_DecodeSymbol(&_ppmd, &_rangeDec.vt);
+ if (_inStream.Extra || sym < 0)
+ break;
+ memStream[i] = (Byte)sym;
+ }
+
+ _processedSize += i;
+ if (_inStream.Extra)
+ {
+ _status = kStatus_Error;
+ return _inStream.Res;
+ }
+ if (sym < 0)
+ _status = (sym < -1) ? kStatus_Error : kStatus_Finished;
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
+{
+ if (!_outBuf)
+ {
+ _outBuf = (Byte *)::MidAlloc(kBufSize);
+ if (!_outBuf)
+ return E_OUTOFMEMORY;
+ }
+
+ _inStream.Stream = inStream;
+ SetOutStreamSize(outSize);
+
+ do
+ {
+ const UInt64 startPos = _processedSize;
+ HRESULT res = CodeSpec(_outBuf, kBufSize);
+ size_t processed = (size_t)(_processedSize - startPos);
+ RINOK(WriteStream(outStream, _outBuf, processed));
+ RINOK(res);
+ if (_status == kStatus_Finished)
+ break;
+ if (progress)
+ {
+ UInt64 inSize = _inStream.GetProcessed();
+ RINOK(progress->SetRatioInfo(&inSize, &_processedSize));
+ }
+ }
+ while (!_outSizeDefined || _processedSize < _outSize);
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::SetOutStreamSize(const UInt64 *outSize)
+{
+ _outSizeDefined = (outSize != NULL);
+ if (_outSizeDefined)
+ _outSize = *outSize;
+ _processedSize = 0;
+ _status = kStatus_NeedInit;
+ return S_OK;
+}
+
+
+STDMETHODIMP CDecoder::GetInStreamProcessedSize(UInt64 *value)
+{
+ *value = _inStream.GetProcessed();
+ return S_OK;
+}
+
+#ifndef NO_READ_FROM_CODER
+
+STDMETHODIMP CDecoder::SetInStream(ISequentialInStream *inStream)
+{
+ InSeqStream = inStream;
+ _inStream.Stream = inStream;
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::ReleaseInStream()
+{
+ InSeqStream.Release();
+ return S_OK;
+}
+
+STDMETHODIMP CDecoder::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ const UInt64 startPos = _processedSize;
+ HRESULT res = CodeSpec((Byte *)data, size);
+ if (processedSize)
+ *processedSize = (UInt32)(_processedSize - startPos);
+ return res;
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.h
new file mode 100644
index 0000000000..3c2f493497
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdDecoder.h
@@ -0,0 +1,86 @@
+// PpmdDecoder.h
+// 2009-03-11 : Igor Pavlov : Public domain
+
+#ifndef __COMPRESS_PPMD_DECODER_H
+#define __COMPRESS_PPMD_DECODER_H
+
+#include "../../../C/Ppmd7.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../Common/CWrappers.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NPpmd {
+
+class CDecoder :
+ public ICompressCoder,
+ public ICompressSetDecoderProperties2,
+ public ICompressGetInStreamProcessedSize,
+ #ifndef NO_READ_FROM_CODER
+ public ICompressSetInStream,
+ public ICompressSetOutStreamSize,
+ public ISequentialInStream,
+ #endif
+ public CMyUnknownImp
+{
+ Byte *_outBuf;
+ CPpmd7z_RangeDec _rangeDec;
+ CByteInBufWrap _inStream;
+ CPpmd7 _ppmd;
+
+ Byte _order;
+ bool _outSizeDefined;
+ int _status;
+ UInt64 _outSize;
+ UInt64 _processedSize;
+
+ HRESULT CodeSpec(Byte *memStream, UInt32 size);
+
+public:
+
+ #ifndef NO_READ_FROM_CODER
+ CMyComPtr<ISequentialInStream> InSeqStream;
+ #endif
+
+ MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetDecoderProperties2)
+ // MY_QUERYINTERFACE_ENTRY(ICompressSetFinishMode)
+ MY_QUERYINTERFACE_ENTRY(ICompressGetInStreamProcessedSize)
+ #ifndef NO_READ_FROM_CODER
+ MY_QUERYINTERFACE_ENTRY(ICompressSetInStream)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetOutStreamSize)
+ MY_QUERYINTERFACE_ENTRY(ISequentialInStream)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+ STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
+
+ STDMETHOD(SetOutStreamSize)(const UInt64 *outSize);
+
+ #ifndef NO_READ_FROM_CODER
+ STDMETHOD(SetInStream)(ISequentialInStream *inStream);
+ STDMETHOD(ReleaseInStream)();
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+ #endif
+
+ CDecoder(): _outBuf(NULL), _outSizeDefined(false)
+ {
+ Ppmd7z_RangeDec_CreateVTable(&_rangeDec);
+ _rangeDec.Stream = &_inStream.vt;
+ Ppmd7_Construct(&_ppmd);
+ }
+
+ ~CDecoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.cpp
new file mode 100644
index 0000000000..0aef701d0e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.cpp
@@ -0,0 +1,152 @@
+// PpmdEncoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+#include "../../../C/CpuArch.h"
+
+#include "../Common/StreamUtils.h"
+
+#include "PpmdEncoder.h"
+
+namespace NCompress {
+namespace NPpmd {
+
+static const UInt32 kBufSize = (1 << 20);
+
+static const Byte kOrders[10] = { 3, 4, 4, 5, 5, 6, 8, 16, 24, 32 };
+
+void CEncProps::Normalize(int level)
+{
+ if (level < 0) level = 5;
+ if (level > 9) level = 9;
+ if (MemSize == (UInt32)(Int32)-1)
+ MemSize = level >= 9 ? ((UInt32)192 << 20) : ((UInt32)1 << (level + 19));
+ const unsigned kMult = 16;
+ if (MemSize / kMult > ReduceSize)
+ {
+ for (unsigned i = 16; i <= 31; i++)
+ {
+ UInt32 m = (UInt32)1 << i;
+ if (ReduceSize <= m / kMult)
+ {
+ if (MemSize > m)
+ MemSize = m;
+ break;
+ }
+ }
+ }
+ if (Order == -1) Order = kOrders[(unsigned)level];
+}
+
+CEncoder::CEncoder():
+ _inBuf(NULL)
+{
+ _props.Normalize(-1);
+ _rangeEnc.Stream = &_outStream.vt;
+ Ppmd7_Construct(&_ppmd);
+}
+
+CEncoder::~CEncoder()
+{
+ ::MidFree(_inBuf);
+ Ppmd7_Free(&_ppmd, &g_BigAlloc);
+}
+
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ int level = -1;
+ CEncProps props;
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ PROPID propID = propIDs[i];
+ if (propID > NCoderPropID::kReduceSize)
+ continue;
+ if (propID == NCoderPropID::kReduceSize)
+ {
+ if (prop.vt == VT_UI8 && prop.uhVal.QuadPart < (UInt32)(Int32)-1)
+ props.ReduceSize = (UInt32)prop.uhVal.QuadPart;
+ continue;
+ }
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ UInt32 v = (UInt32)prop.ulVal;
+ switch (propID)
+ {
+ case NCoderPropID::kUsedMemorySize:
+ if (v < (1 << 16) || v > PPMD7_MAX_MEM_SIZE || (v & 3) != 0)
+ return E_INVALIDARG;
+ props.MemSize = v;
+ break;
+ case NCoderPropID::kOrder:
+ if (v < 2 || v > 32)
+ return E_INVALIDARG;
+ props.Order = (Byte)v;
+ break;
+ case NCoderPropID::kNumThreads: break;
+ case NCoderPropID::kLevel: level = (int)v; break;
+ default: return E_INVALIDARG;
+ }
+ }
+ props.Normalize(level);
+ _props = props;
+ return S_OK;
+}
+
+STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
+{
+ const UInt32 kPropSize = 5;
+ Byte props[kPropSize];
+ props[0] = (Byte)_props.Order;
+ SetUi32(props + 1, _props.MemSize);
+ return WriteStream(outStream, props, kPropSize);
+}
+
+HRESULT CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
+{
+ if (!_inBuf)
+ {
+ _inBuf = (Byte *)::MidAlloc(kBufSize);
+ if (!_inBuf)
+ return E_OUTOFMEMORY;
+ }
+ if (!_outStream.Alloc(1 << 20))
+ return E_OUTOFMEMORY;
+ if (!Ppmd7_Alloc(&_ppmd, _props.MemSize, &g_BigAlloc))
+ return E_OUTOFMEMORY;
+
+ _outStream.Stream = outStream;
+ _outStream.Init();
+
+ Ppmd7z_RangeEnc_Init(&_rangeEnc);
+ Ppmd7_Init(&_ppmd, _props.Order);
+
+ UInt64 processed = 0;
+ for (;;)
+ {
+ UInt32 size;
+ RINOK(inStream->Read(_inBuf, kBufSize, &size));
+ if (size == 0)
+ {
+ // We don't write EndMark in PPMD-7z.
+ // Ppmd7_EncodeSymbol(&_ppmd, &_rangeEnc, -1);
+ Ppmd7z_RangeEnc_FlushData(&_rangeEnc);
+ return _outStream.Flush();
+ }
+ for (UInt32 i = 0; i < size; i++)
+ {
+ Ppmd7_EncodeSymbol(&_ppmd, &_rangeEnc, _inBuf[i]);
+ RINOK(_outStream.Res);
+ }
+ processed += size;
+ if (progress)
+ {
+ UInt64 outSize = _outStream.GetProcessed();
+ RINOK(progress->SetRatioInfo(&processed, &outSize));
+ }
+ }
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.h
new file mode 100644
index 0000000000..cdb0352b7b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdEncoder.h
@@ -0,0 +1,58 @@
+// PpmdEncoder.h
+
+#ifndef __COMPRESS_PPMD_ENCODER_H
+#define __COMPRESS_PPMD_ENCODER_H
+
+#include "../../../C/Ppmd7.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+#include "../Common/CWrappers.h"
+
+namespace NCompress {
+namespace NPpmd {
+
+struct CEncProps
+{
+ UInt32 MemSize;
+ UInt32 ReduceSize;
+ int Order;
+
+ CEncProps()
+ {
+ MemSize = (UInt32)(Int32)-1;
+ ReduceSize = (UInt32)(Int32)-1;
+ Order = -1;
+ }
+ void Normalize(int level);
+};
+
+class CEncoder :
+ public ICompressCoder,
+ public ICompressSetCoderProperties,
+ public ICompressWriteCoderProperties,
+ public CMyUnknownImp
+{
+ Byte *_inBuf;
+ CByteOutBufWrap _outStream;
+ CPpmd7z_RangeEnc _rangeEnc;
+ CPpmd7 _ppmd;
+ CEncProps _props;
+public:
+ MY_UNKNOWN_IMP3(
+ ICompressCoder,
+ ICompressSetCoderProperties,
+ ICompressWriteCoderProperties)
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
+ CEncoder();
+ ~CEncoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdRegister.cpp
new file mode 100644
index 0000000000..c7486966cb
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/PpmdRegister.cpp
@@ -0,0 +1,22 @@
+// PpmdRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "PpmdDecoder.h"
+
+#ifndef EXTRACT_ONLY
+#include "PpmdEncoder.h"
+#endif
+
+namespace NCompress {
+namespace NPpmd {
+
+REGISTER_CODEC_E(PPMD,
+ CDecoder(),
+ CEncoder(),
+ 0x30401,
+ "PPMD")
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Compress/StdAfx.h
new file mode 100644
index 0000000000..42a088f121
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.cpp
new file mode 100644
index 0000000000..4fcd09fe82
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.cpp
@@ -0,0 +1,150 @@
+// XzDecoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../Common/CWrappers.h"
+
+#include "XzDecoder.h"
+
+namespace NCompress {
+namespace NXz {
+
+#define RET_IF_WRAP_ERROR_CONFIRMED(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK && sRes == sResErrorCode) return wrapRes;
+
+#define RET_IF_WRAP_ERROR(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK /* && (sRes == SZ_OK || sRes == sResErrorCode) */) return wrapRes;
+
+static HRESULT SResToHRESULT_Code(SRes res) throw()
+{
+ if (res < 0)
+ return res;
+ switch (res)
+ {
+ case SZ_OK: return S_OK;
+ case SZ_ERROR_MEM: return E_OUTOFMEMORY;
+ case SZ_ERROR_UNSUPPORTED: return E_NOTIMPL;
+ }
+ return S_FALSE;
+}
+
+
+HRESULT CDecoder::Decode(ISequentialInStream *seqInStream, ISequentialOutStream *outStream,
+ const UInt64 *outSizeLimit, bool finishStream, ICompressProgressInfo *progress)
+{
+ MainDecodeSRes = S_OK;
+ MainDecodeSRes_wasUsed = false;
+ XzStatInfo_Clear(&Stat);
+
+ if (!xz)
+ {
+ xz = XzDecMt_Create(&g_Alloc, &g_MidAlloc);
+ if (!xz)
+ return E_OUTOFMEMORY;
+ }
+
+ CXzDecMtProps props;
+ XzDecMtProps_Init(&props);
+
+ int isMT = False;
+
+ #ifndef _7ZIP_ST
+ {
+ props.numThreads = 1;
+ UInt32 numThreads = _numThreads;
+
+ if (_tryMt && numThreads > 1)
+ {
+ size_t memUsage = (size_t)_memUsage;
+ if (memUsage != _memUsage)
+ memUsage = (size_t)0 - 1;
+ props.memUseMax = memUsage;
+ isMT = (numThreads > 1);
+ }
+
+ props.numThreads = numThreads;
+ }
+ #endif
+
+ CSeqInStreamWrap inWrap;
+ CSeqOutStreamWrap outWrap;
+ CCompressProgressWrap progressWrap;
+
+ inWrap.Init(seqInStream);
+ outWrap.Init(outStream);
+ progressWrap.Init(progress);
+
+ SRes res = XzDecMt_Decode(xz,
+ &props,
+ outSizeLimit, finishStream,
+ &outWrap.vt,
+ &inWrap.vt,
+ &Stat,
+ &isMT,
+ progress ? &progressWrap.vt : NULL);
+
+ MainDecodeSRes = res;
+
+ #ifndef _7ZIP_ST
+ // _tryMt = isMT;
+ #endif
+
+ RET_IF_WRAP_ERROR(outWrap.Res, res, SZ_ERROR_WRITE)
+ RET_IF_WRAP_ERROR(progressWrap.Res, res, SZ_ERROR_PROGRESS)
+ RET_IF_WRAP_ERROR_CONFIRMED(inWrap.Res, res, SZ_ERROR_READ)
+
+ // return E_OUTOFMEMORY;
+
+ MainDecodeSRes_wasUsed = true;
+
+ if (res == SZ_OK && finishStream)
+ {
+ /*
+ if (inSize && *inSize != Stat.PhySize)
+ res = SZ_ERROR_DATA;
+ */
+ if (outSizeLimit && *outSizeLimit != outWrap.Processed)
+ res = SZ_ERROR_DATA;
+ }
+
+ return SResToHRESULT_Code(res);
+}
+
+
+HRESULT CComDecoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 *outSize, ICompressProgressInfo *progress)
+{
+ return Decode(inStream, outStream, outSize, _finishStream, progress);
+}
+
+STDMETHODIMP CComDecoder::SetFinishMode(UInt32 finishMode)
+{
+ _finishStream = (finishMode != 0);
+ return S_OK;
+}
+
+STDMETHODIMP CComDecoder::GetInStreamProcessedSize(UInt64 *value)
+{
+ *value = Stat.InSize;
+ return S_OK;
+}
+
+#ifndef _7ZIP_ST
+
+STDMETHODIMP CComDecoder::SetNumberOfThreads(UInt32 numThreads)
+{
+ _numThreads = numThreads;
+ return S_OK;
+}
+
+STDMETHODIMP CComDecoder::SetMemLimit(UInt64 memUsage)
+{
+ _memUsage = memUsage;
+ return S_OK;
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.h
new file mode 100644
index 0000000000..76694eec07
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/XzDecoder.h
@@ -0,0 +1,92 @@
+// XzDecoder.h
+
+#ifndef __XZ_DECODER_H
+#define __XZ_DECODER_H
+
+#include "../../../C/Xz.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NXz {
+
+struct CDecoder
+{
+ CXzDecMtHandle xz;
+ int _tryMt;
+ UInt32 _numThreads;
+ UInt64 _memUsage;
+
+ SRes MainDecodeSRes; // it's not HRESULT
+ bool MainDecodeSRes_wasUsed;
+ CXzStatInfo Stat;
+
+ CDecoder():
+ xz(NULL),
+ _tryMt(True),
+ _numThreads(1),
+ _memUsage((UInt64)(sizeof(size_t)) << 28),
+ MainDecodeSRes(SZ_OK),
+ MainDecodeSRes_wasUsed(false)
+ {}
+
+ ~CDecoder()
+ {
+ if (xz)
+ XzDecMt_Destroy(xz);
+ }
+
+ /* Decode() can return ERROR code only if there is progress or stream error.
+ Decode() returns S_OK in case of xz decoding error, but DecodeRes and CStatInfo contain error information */
+ HRESULT Decode(ISequentialInStream *seqInStream, ISequentialOutStream *outStream,
+ const UInt64 *outSizeLimit, bool finishStream, ICompressProgressInfo *compressProgress);
+};
+
+
+class CComDecoder:
+ public ICompressCoder,
+ public ICompressSetFinishMode,
+ public ICompressGetInStreamProcessedSize,
+
+ #ifndef _7ZIP_ST
+ public ICompressSetCoderMt,
+ public ICompressSetMemLimit,
+ #endif
+
+ public CMyUnknownImp,
+ public CDecoder
+{
+ bool _finishStream;
+
+public:
+ MY_QUERYINTERFACE_BEGIN2(ICompressCoder)
+
+ MY_QUERYINTERFACE_ENTRY(ICompressSetFinishMode)
+ MY_QUERYINTERFACE_ENTRY(ICompressGetInStreamProcessedSize)
+
+ #ifndef _7ZIP_ST
+ MY_QUERYINTERFACE_ENTRY(ICompressSetCoderMt)
+ MY_QUERYINTERFACE_ENTRY(ICompressSetMemLimit)
+ #endif
+
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetFinishMode)(UInt32 finishMode);
+ STDMETHOD(GetInStreamProcessedSize)(UInt64 *value);
+
+ #ifndef _7ZIP_ST
+ STDMETHOD(SetNumberOfThreads)(UInt32 numThreads);
+ STDMETHOD(SetMemLimit)(UInt64 memUsage);
+ #endif
+
+ CComDecoder(): _finishStream(false) {}
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.cpp b/other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.cpp
new file mode 100644
index 0000000000..458a928c99
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.cpp
@@ -0,0 +1,245 @@
+// XzEncoder.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Alloc.h"
+
+#include "../../Common/MyString.h"
+#include "../../Common/StringToInt.h"
+
+#include "../Common/CWrappers.h"
+#include "../Common/StreamUtils.h"
+
+#include "XzEncoder.h"
+
+namespace NCompress {
+
+namespace NLzma2 {
+
+HRESULT SetLzma2Prop(PROPID propID, const PROPVARIANT &prop, CLzma2EncProps &lzma2Props);
+
+}
+
+namespace NXz {
+
+void CEncoder::InitCoderProps()
+{
+ XzProps_Init(&xzProps);
+}
+
+CEncoder::CEncoder()
+{
+ XzProps_Init(&xzProps);
+ _encoder = NULL;
+ _encoder = XzEnc_Create(&g_Alloc, &g_BigAlloc);
+ if (!_encoder)
+ throw 1;
+}
+
+CEncoder::~CEncoder()
+{
+ if (_encoder)
+ XzEnc_Destroy(_encoder);
+}
+
+
+struct CMethodNamePair
+{
+ UInt32 Id;
+ const char *Name;
+};
+
+static const CMethodNamePair g_NamePairs[] =
+{
+ { XZ_ID_Delta, "Delta" },
+ { XZ_ID_X86, "BCJ" },
+ { XZ_ID_PPC, "PPC" },
+ { XZ_ID_IA64, "IA64" },
+ { XZ_ID_ARM, "ARM" },
+ { XZ_ID_ARMT, "ARMT" },
+ { XZ_ID_SPARC, "SPARC" }
+ // { XZ_ID_LZMA2, "LZMA2" }
+};
+
+static int FilterIdFromName(const wchar_t *name)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(g_NamePairs); i++)
+ {
+ const CMethodNamePair &pair = g_NamePairs[i];
+ if (StringsAreEqualNoCase_Ascii(name, pair.Name))
+ return (int)pair.Id;
+ }
+ return -1;
+}
+
+
+HRESULT CEncoder::SetCheckSize(UInt32 checkSizeInBytes)
+{
+ unsigned id;
+ switch (checkSizeInBytes)
+ {
+ case 0: id = XZ_CHECK_NO; break;
+ case 4: id = XZ_CHECK_CRC32; break;
+ case 8: id = XZ_CHECK_CRC64; break;
+ case 32: id = XZ_CHECK_SHA256; break;
+ default: return E_INVALIDARG;
+ }
+ xzProps.checkId = id;
+ return S_OK;
+}
+
+
+HRESULT CEncoder::SetCoderProp(PROPID propID, const PROPVARIANT &prop)
+{
+ if (propID == NCoderPropID::kNumThreads)
+ {
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ xzProps.numTotalThreads = (int)(prop.ulVal);
+ return S_OK;
+ }
+
+ if (propID == NCoderPropID::kCheckSize)
+ {
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ return SetCheckSize(prop.ulVal);
+ }
+
+ if (propID == NCoderPropID::kBlockSize2)
+ {
+ if (prop.vt == VT_UI4)
+ xzProps.blockSize = prop.ulVal;
+ else if (prop.vt == VT_UI8)
+ xzProps.blockSize = prop.uhVal.QuadPart;
+ else
+ return E_INVALIDARG;
+ return S_OK;
+ }
+
+ if (propID == NCoderPropID::kReduceSize)
+ {
+ if (prop.vt == VT_UI8)
+ xzProps.reduceSize = prop.uhVal.QuadPart;
+ else
+ return E_INVALIDARG;
+ return S_OK;
+ }
+
+ if (propID == NCoderPropID::kFilter)
+ {
+ if (prop.vt == VT_UI4)
+ {
+ UInt32 id32 = prop.ulVal;
+ if (id32 == XZ_ID_Delta)
+ return E_INVALIDARG;
+ xzProps.filterProps.id = prop.ulVal;
+ }
+ else
+ {
+ if (prop.vt != VT_BSTR)
+ return E_INVALIDARG;
+
+ const wchar_t *name = prop.bstrVal;
+ const wchar_t *end;
+
+ UInt32 id32 = ConvertStringToUInt32(name, &end);
+
+ if (end != name)
+ name = end;
+ else
+ {
+ if (IsString1PrefixedByString2_NoCase_Ascii(name, "Delta"))
+ {
+ name += 5; // strlen("Delta");
+ id32 = XZ_ID_Delta;
+ }
+ else
+ {
+ int filterId = FilterIdFromName(prop.bstrVal);
+ if (filterId < 0 /* || filterId == XZ_ID_LZMA2 */)
+ return E_INVALIDARG;
+ id32 = filterId;
+ }
+ }
+
+ if (id32 == XZ_ID_Delta)
+ {
+ wchar_t c = *name;
+ if (c != '-' && c != ':')
+ return E_INVALIDARG;
+ name++;
+ UInt32 delta = ConvertStringToUInt32(name, &end);
+ if (end == name || *end != 0 || delta == 0 || delta > 256)
+ return E_INVALIDARG;
+ xzProps.filterProps.delta = delta;
+ }
+
+ xzProps.filterProps.id = id32;
+ }
+
+ return S_OK;
+ }
+
+ return NLzma2::SetLzma2Prop(propID, prop, xzProps.lzma2Props);
+}
+
+
+STDMETHODIMP CEncoder::SetCoderProperties(const PROPID *propIDs,
+ const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ XzProps_Init(&xzProps);
+
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ RINOK(SetCoderProp(propIDs[i], coderProps[i]));
+ }
+
+ return S_OK;
+ // return SResToHRESULT(XzEnc_SetProps(_encoder, &xzProps));
+}
+
+
+STDMETHODIMP CEncoder::SetCoderPropertiesOpt(const PROPID *propIDs,
+ const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ PROPID propID = propIDs[i];
+ if (propID == NCoderPropID::kExpectedDataSize)
+ if (prop.vt == VT_UI8)
+ XzEnc_SetDataSize(_encoder, prop.uhVal.QuadPart);
+ }
+ return S_OK;
+}
+
+
+#define RET_IF_WRAP_ERROR(wrapRes, sRes, sResErrorCode) \
+ if (wrapRes != S_OK /* && (sRes == SZ_OK || sRes == sResErrorCode) */) return wrapRes;
+
+STDMETHODIMP CEncoder::Code(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 * /* inSize */, const UInt64 * /* outSize */, ICompressProgressInfo *progress)
+{
+ CSeqInStreamWrap inWrap;
+ CSeqOutStreamWrap outWrap;
+ CCompressProgressWrap progressWrap;
+
+ inWrap.Init(inStream);
+ outWrap.Init(outStream);
+ progressWrap.Init(progress);
+
+ SRes res = XzEnc_SetProps(_encoder, &xzProps);
+ if (res == SZ_OK)
+ res = XzEnc_Encode(_encoder, &outWrap.vt, &inWrap.vt, progress ? &progressWrap.vt : NULL);
+
+ // SRes res = Xz_Encode(&outWrap.vt, &inWrap.vt, &xzProps, progress ? &progressWrap.vt : NULL);
+
+ RET_IF_WRAP_ERROR(inWrap.Res, res, SZ_ERROR_READ)
+ RET_IF_WRAP_ERROR(outWrap.Res, res, SZ_ERROR_WRITE)
+ RET_IF_WRAP_ERROR(progressWrap.Res, res, SZ_ERROR_PROGRESS)
+
+ return SResToHRESULT(res);
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.h b/other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.h
new file mode 100644
index 0000000000..79d81f7931
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Compress/XzEncoder.h
@@ -0,0 +1,46 @@
+// XzEncoder.h
+
+#ifndef __XZ_ENCODER_H
+#define __XZ_ENCODER_H
+
+#include "../../../C/XzEnc.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCompress {
+namespace NXz {
+
+
+class CEncoder:
+ public ICompressCoder,
+ public ICompressSetCoderProperties,
+ public ICompressSetCoderPropertiesOpt,
+ public CMyUnknownImp
+{
+ CXzEncHandle _encoder;
+public:
+ CXzProps xzProps;
+
+ MY_UNKNOWN_IMP3(
+ ICompressCoder,
+ ICompressSetCoderProperties,
+ ICompressSetCoderPropertiesOpt)
+
+ void InitCoderProps();
+ HRESULT SetCheckSize(UInt32 checkSizeInBytes);
+ HRESULT SetCoderProp(PROPID propID, const PROPVARIANT &prop);
+
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize, ICompressProgressInfo *progress);
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+ STDMETHOD(SetCoderPropertiesOpt)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+
+ CEncoder();
+ virtual ~CEncoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crc.mak b/other-licenses/7zstub/src/CPP/7zip/Crc.mak
new file mode 100644
index 0000000000..19a7f7b136
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crc.mak
@@ -0,0 +1,8 @@
+C_OBJS = $(C_OBJS) \
+ $O\7zCrc.obj
+!IF "$(CPU)" == "IA64" || "$(CPU)" == "MIPS" || "$(CPU)" == "ARM" || "$(CPU)" == "ARM64"
+C_OBJS = $(C_OBJS) \
+!ELSE
+ASM_OBJS = $(ASM_OBJS) \
+!ENDIF
+ $O\7zCrcOpt.obj
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crc64.mak b/other-licenses/7zstub/src/CPP/7zip/Crc64.mak
new file mode 100644
index 0000000000..1ac6a0ce6c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crc64.mak
@@ -0,0 +1,8 @@
+C_OBJS = $(C_OBJS) \
+ $O\XzCrc64.obj
+!IF "$(CPU)" == "IA64" || "$(CPU)" == "MIPS" || "$(CPU)" == "ARM" || "$(CPU)" == "ARM64"
+C_OBJS = $(C_OBJS) \
+!ELSE
+ASM_OBJS = $(ASM_OBJS) \
+!ENDIF
+ $O\XzCrc64Opt.obj
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.cpp b/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.cpp
new file mode 100644
index 0000000000..f412bf9d14
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.cpp
@@ -0,0 +1,280 @@
+// 7zAes.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/Sha256.h"
+
+#include "../../Common/ComTry.h"
+
+#ifndef _7ZIP_ST
+#include "../../Windows/Synchronization.h"
+#endif
+
+#include "../Common/StreamUtils.h"
+
+#include "7zAes.h"
+#include "MyAes.h"
+
+#ifndef EXTRACT_ONLY
+#include "RandGen.h"
+#endif
+
+namespace NCrypto {
+namespace N7z {
+
+static const unsigned k_NumCyclesPower_Supported_MAX = 24;
+
+bool CKeyInfo::IsEqualTo(const CKeyInfo &a) const
+{
+ if (SaltSize != a.SaltSize || NumCyclesPower != a.NumCyclesPower)
+ return false;
+ for (unsigned i = 0; i < SaltSize; i++)
+ if (Salt[i] != a.Salt[i])
+ return false;
+ return (Password == a.Password);
+}
+
+void CKeyInfo::CalcKey()
+{
+ if (NumCyclesPower == 0x3F)
+ {
+ unsigned pos;
+ for (pos = 0; pos < SaltSize; pos++)
+ Key[pos] = Salt[pos];
+ for (unsigned i = 0; i < Password.Size() && pos < kKeySize; i++)
+ Key[pos++] = Password[i];
+ for (; pos < kKeySize; pos++)
+ Key[pos] = 0;
+ }
+ else
+ {
+ size_t bufSize = 8 + SaltSize + Password.Size();
+ CObjArray<Byte> buf(bufSize);
+ memcpy(buf, Salt, SaltSize);
+ memcpy(buf + SaltSize, Password, Password.Size());
+
+ CSha256 sha;
+ Sha256_Init(&sha);
+
+ Byte *ctr = buf + SaltSize + Password.Size();
+
+ for (unsigned i = 0; i < 8; i++)
+ ctr[i] = 0;
+
+ UInt64 numRounds = (UInt64)1 << NumCyclesPower;
+
+ do
+ {
+ Sha256_Update(&sha, buf, bufSize);
+ for (unsigned i = 0; i < 8; i++)
+ if (++(ctr[i]) != 0)
+ break;
+ }
+ while (--numRounds != 0);
+
+ Sha256_Final(&sha, Key);
+ }
+}
+
+bool CKeyInfoCache::GetKey(CKeyInfo &key)
+{
+ FOR_VECTOR (i, Keys)
+ {
+ const CKeyInfo &cached = Keys[i];
+ if (key.IsEqualTo(cached))
+ {
+ for (unsigned j = 0; j < kKeySize; j++)
+ key.Key[j] = cached.Key[j];
+ if (i != 0)
+ Keys.MoveToFront(i);
+ return true;
+ }
+ }
+ return false;
+}
+
+void CKeyInfoCache::FindAndAdd(const CKeyInfo &key)
+{
+ FOR_VECTOR (i, Keys)
+ {
+ const CKeyInfo &cached = Keys[i];
+ if (key.IsEqualTo(cached))
+ {
+ if (i != 0)
+ Keys.MoveToFront(i);
+ return;
+ }
+ }
+ Add(key);
+}
+
+void CKeyInfoCache::Add(const CKeyInfo &key)
+{
+ if (Keys.Size() >= Size)
+ Keys.DeleteBack();
+ Keys.Insert(0, key);
+}
+
+static CKeyInfoCache g_GlobalKeyCache(32);
+
+#ifndef _7ZIP_ST
+ static NWindows::NSynchronization::CCriticalSection g_GlobalKeyCacheCriticalSection;
+ #define MT_LOCK NWindows::NSynchronization::CCriticalSectionLock lock(g_GlobalKeyCacheCriticalSection);
+#else
+ #define MT_LOCK
+#endif
+
+CBase::CBase():
+ _cachedKeys(16),
+ _ivSize(0)
+{
+ for (unsigned i = 0; i < sizeof(_iv); i++)
+ _iv[i] = 0;
+}
+
+void CBase::PrepareKey()
+{
+ // BCJ2 threads use same password. So we use long lock.
+ MT_LOCK
+
+ bool finded = false;
+ if (!_cachedKeys.GetKey(_key))
+ {
+ finded = g_GlobalKeyCache.GetKey(_key);
+ if (!finded)
+ _key.CalcKey();
+ _cachedKeys.Add(_key);
+ }
+ if (!finded)
+ g_GlobalKeyCache.FindAndAdd(_key);
+}
+
+#ifndef EXTRACT_ONLY
+
+/*
+STDMETHODIMP CEncoder::ResetSalt()
+{
+ _key.SaltSize = 4;
+ g_RandomGenerator.Generate(_key.Salt, _key.SaltSize);
+ return S_OK;
+}
+*/
+
+STDMETHODIMP CEncoder::ResetInitVector()
+{
+ for (unsigned i = 0; i < sizeof(_iv); i++)
+ _iv[i] = 0;
+ _ivSize = 8;
+ g_RandomGenerator.Generate(_iv, _ivSize);
+ return S_OK;
+}
+
+STDMETHODIMP CEncoder::WriteCoderProperties(ISequentialOutStream *outStream)
+{
+ Byte props[2 + sizeof(_key.Salt) + sizeof(_iv)];
+ unsigned propsSize = 1;
+
+ props[0] = (Byte)(_key.NumCyclesPower
+ | (_key.SaltSize == 0 ? 0 : (1 << 7))
+ | (_ivSize == 0 ? 0 : (1 << 6)));
+
+ if (_key.SaltSize != 0 || _ivSize != 0)
+ {
+ props[1] = (Byte)(
+ ((_key.SaltSize == 0 ? 0 : _key.SaltSize - 1) << 4)
+ | (_ivSize == 0 ? 0 : _ivSize - 1));
+ memcpy(props + 2, _key.Salt, _key.SaltSize);
+ propsSize = 2 + _key.SaltSize;
+ memcpy(props + propsSize, _iv, _ivSize);
+ propsSize += _ivSize;
+ }
+
+ return WriteStream(outStream, props, propsSize);
+}
+
+CEncoder::CEncoder()
+{
+ // _key.SaltSize = 4; g_RandomGenerator.Generate(_key.Salt, _key.SaltSize);
+ // _key.NumCyclesPower = 0x3F;
+ _key.NumCyclesPower = 19;
+ _aesFilter = new CAesCbcEncoder(kKeySize);
+}
+
+#endif
+
+CDecoder::CDecoder()
+{
+ _aesFilter = new CAesCbcDecoder(kKeySize);
+}
+
+STDMETHODIMP CDecoder::SetDecoderProperties2(const Byte *data, UInt32 size)
+{
+ _key.ClearProps();
+
+ _ivSize = 0;
+ unsigned i;
+ for (i = 0; i < sizeof(_iv); i++)
+ _iv[i] = 0;
+
+ if (size == 0)
+ return S_OK;
+
+ Byte b0 = data[0];
+
+ _key.NumCyclesPower = b0 & 0x3F;
+ if ((b0 & 0xC0) == 0)
+ return size == 1 ? S_OK : E_INVALIDARG;
+
+ if (size <= 1)
+ return E_INVALIDARG;
+
+ Byte b1 = data[1];
+
+ unsigned saltSize = ((b0 >> 7) & 1) + (b1 >> 4);
+ unsigned ivSize = ((b0 >> 6) & 1) + (b1 & 0x0F);
+
+ if (size != 2 + saltSize + ivSize)
+ return E_INVALIDARG;
+ _key.SaltSize = saltSize;
+ data += 2;
+ for (i = 0; i < saltSize; i++)
+ _key.Salt[i] = *data++;
+ for (i = 0; i < ivSize; i++)
+ _iv[i] = *data++;
+ return (_key.NumCyclesPower <= k_NumCyclesPower_Supported_MAX
+ || _key.NumCyclesPower == 0x3F) ? S_OK : E_NOTIMPL;
+}
+
+
+STDMETHODIMP CBaseCoder::CryptoSetPassword(const Byte *data, UInt32 size)
+{
+ COM_TRY_BEGIN
+
+ _key.Password.CopyFrom(data, (size_t)size);
+ return S_OK;
+
+ COM_TRY_END
+}
+
+STDMETHODIMP CBaseCoder::Init()
+{
+ COM_TRY_BEGIN
+
+ PrepareKey();
+ CMyComPtr<ICryptoProperties> cp;
+ RINOK(_aesFilter.QueryInterface(IID_ICryptoProperties, &cp));
+ if (!cp)
+ return E_FAIL;
+ RINOK(cp->SetKey(_key.Key, kKeySize));
+ RINOK(cp->SetInitVector(_iv, sizeof(_iv)));
+ return _aesFilter->Init();
+
+ COM_TRY_END
+}
+
+STDMETHODIMP_(UInt32) CBaseCoder::Filter(Byte *data, UInt32 size)
+{
+ return _aesFilter->Filter(data, size);
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.h b/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.h
new file mode 100644
index 0000000000..5a09436079
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAes.h
@@ -0,0 +1,118 @@
+// 7zAes.h
+
+#ifndef __CRYPTO_7Z_AES_H
+#define __CRYPTO_7Z_AES_H
+
+#include "../../Common/MyBuffer.h"
+#include "../../Common/MyCom.h"
+#include "../../Common/MyVector.h"
+
+#include "../ICoder.h"
+#include "../IPassword.h"
+
+namespace NCrypto {
+namespace N7z {
+
+const unsigned kKeySize = 32;
+const unsigned kSaltSizeMax = 16;
+const unsigned kIvSizeMax = 16; // AES_BLOCK_SIZE;
+
+class CKeyInfo
+{
+public:
+ unsigned NumCyclesPower;
+ unsigned SaltSize;
+ Byte Salt[kSaltSizeMax];
+ CByteBuffer Password;
+ Byte Key[kKeySize];
+
+ bool IsEqualTo(const CKeyInfo &a) const;
+ void CalcKey();
+
+ CKeyInfo() { ClearProps(); }
+ void ClearProps()
+ {
+ NumCyclesPower = 0;
+ SaltSize = 0;
+ for (unsigned i = 0; i < sizeof(Salt); i++)
+ Salt[i] = 0;
+ }
+};
+
+class CKeyInfoCache
+{
+ unsigned Size;
+ CObjectVector<CKeyInfo> Keys;
+public:
+ CKeyInfoCache(unsigned size): Size(size) {}
+ bool GetKey(CKeyInfo &key);
+ void Add(const CKeyInfo &key);
+ void FindAndAdd(const CKeyInfo &key);
+};
+
+class CBase
+{
+ CKeyInfoCache _cachedKeys;
+protected:
+ CKeyInfo _key;
+ Byte _iv[kIvSizeMax];
+ unsigned _ivSize;
+
+ void PrepareKey();
+ CBase();
+};
+
+class CBaseCoder:
+ public ICompressFilter,
+ public ICryptoSetPassword,
+ public CMyUnknownImp,
+ public CBase
+{
+protected:
+ CMyComPtr<ICompressFilter> _aesFilter;
+
+public:
+ INTERFACE_ICompressFilter(;)
+
+ STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size);
+};
+
+#ifndef EXTRACT_ONLY
+
+class CEncoder:
+ public CBaseCoder,
+ public ICompressWriteCoderProperties,
+ // public ICryptoResetSalt,
+ public ICryptoResetInitVector
+{
+public:
+ MY_UNKNOWN_IMP4(
+ ICompressFilter,
+ ICryptoSetPassword,
+ ICompressWriteCoderProperties,
+ // ICryptoResetSalt,
+ ICryptoResetInitVector)
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream);
+ // STDMETHOD(ResetSalt)();
+ STDMETHOD(ResetInitVector)();
+ CEncoder();
+};
+
+#endif
+
+class CDecoder:
+ public CBaseCoder,
+ public ICompressSetDecoderProperties2
+{
+public:
+ MY_UNKNOWN_IMP3(
+ ICompressFilter,
+ ICryptoSetPassword,
+ ICompressSetDecoderProperties2)
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size);
+ CDecoder();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAesRegister.cpp b/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAesRegister.cpp
new file mode 100644
index 0000000000..c0b2060939
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/7zAesRegister.cpp
@@ -0,0 +1,17 @@
+// 7zAesRegister.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "7zAes.h"
+
+namespace NCrypto {
+namespace N7z {
+
+REGISTER_FILTER_E(7zAES,
+ CDecoder(),
+ CEncoder(),
+ 0x6F10701, "7zAES")
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.cpp b/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.cpp
new file mode 100644
index 0000000000..1d399d707f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.cpp
@@ -0,0 +1,112 @@
+// Crypto/MyAes.cpp
+
+#include "StdAfx.h"
+
+#include "../../../C/CpuArch.h"
+
+#include "MyAes.h"
+
+namespace NCrypto {
+
+static struct CAesTabInit { CAesTabInit() { AesGenTables();} } g_AesTabInit;
+
+CAesCbcCoder::CAesCbcCoder(bool encodeMode, unsigned keySize):
+ _keySize(keySize),
+ _keyIsSet(false),
+ _encodeMode(encodeMode)
+{
+ _offset = ((0 - (unsigned)(ptrdiff_t)_aes) & 0xF) / sizeof(UInt32);
+ memset(_iv, 0, AES_BLOCK_SIZE);
+ SetFunctions(0);
+}
+
+STDMETHODIMP CAesCbcCoder::Init()
+{
+ AesCbc_Init(_aes + _offset, _iv);
+ return _keyIsSet ? S_OK : E_FAIL;
+}
+
+STDMETHODIMP_(UInt32) CAesCbcCoder::Filter(Byte *data, UInt32 size)
+{
+ if (!_keyIsSet)
+ return 0;
+ if (size == 0)
+ return 0;
+ if (size < AES_BLOCK_SIZE)
+ return AES_BLOCK_SIZE;
+ size >>= 4;
+ _codeFunc(_aes + _offset, data, size);
+ return size << 4;
+}
+
+STDMETHODIMP CAesCbcCoder::SetKey(const Byte *data, UInt32 size)
+{
+ if ((size & 0x7) != 0 || size < 16 || size > 32)
+ return E_INVALIDARG;
+ if (_keySize != 0 && size != _keySize)
+ return E_INVALIDARG;
+ AES_SET_KEY_FUNC setKeyFunc = _encodeMode ? Aes_SetKey_Enc : Aes_SetKey_Dec;
+ setKeyFunc(_aes + _offset + 4, data, size);
+ _keyIsSet = true;
+ return S_OK;
+}
+
+STDMETHODIMP CAesCbcCoder::SetInitVector(const Byte *data, UInt32 size)
+{
+ if (size != AES_BLOCK_SIZE)
+ return E_INVALIDARG;
+ memcpy(_iv, data, size);
+ CAesCbcCoder::Init(); // don't call virtual function here !!!
+ return S_OK;
+}
+
+EXTERN_C_BEGIN
+
+void MY_FAST_CALL AesCbc_Encode(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCbc_Decode(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCtr_Code(UInt32 *ivAes, Byte *data, size_t numBlocks);
+
+void MY_FAST_CALL AesCbc_Encode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCbc_Decode_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
+void MY_FAST_CALL AesCtr_Code_Intel(UInt32 *ivAes, Byte *data, size_t numBlocks);
+
+EXTERN_C_END
+
+bool CAesCbcCoder::SetFunctions(UInt32 algo)
+{
+ _codeFunc = _encodeMode ?
+ g_AesCbc_Encode :
+ g_AesCbc_Decode;
+ if (algo == 1)
+ {
+ _codeFunc = _encodeMode ?
+ AesCbc_Encode:
+ AesCbc_Decode;
+ }
+ if (algo == 2)
+ {
+ #ifdef MY_CPU_X86_OR_AMD64
+ if (g_AesCbc_Encode != AesCbc_Encode_Intel)
+ #endif
+ return false;
+ }
+ return true;
+}
+
+STDMETHODIMP CAesCbcCoder::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ if (propIDs[i] == NCoderPropID::kDefaultProp)
+ {
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ if (!SetFunctions(prop.ulVal))
+ return E_NOTIMPL;
+ }
+ }
+ return S_OK;
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.h b/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.h
new file mode 100644
index 0000000000..8d5ed98c3f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAes.h
@@ -0,0 +1,57 @@
+// Crypto/MyAes.h
+
+#ifndef __CRYPTO_MY_AES_H
+#define __CRYPTO_MY_AES_H
+
+#include "../../../C/Aes.h"
+
+#include "../../Common/MyCom.h"
+
+#include "../ICoder.h"
+
+namespace NCrypto {
+
+class CAesCbcCoder:
+ public ICompressFilter,
+ public ICryptoProperties,
+ public ICompressSetCoderProperties,
+ public CMyUnknownImp
+{
+ AES_CODE_FUNC _codeFunc;
+ unsigned _offset;
+ unsigned _keySize;
+ bool _keyIsSet;
+ bool _encodeMode;
+ UInt32 _aes[AES_NUM_IVMRK_WORDS + 3];
+ Byte _iv[AES_BLOCK_SIZE];
+
+ bool SetFunctions(UInt32 algo);
+
+public:
+ CAesCbcCoder(bool encodeMode, unsigned keySize);
+
+ virtual ~CAesCbcCoder() {}; // we need virtual destructor for derived classes
+
+ MY_UNKNOWN_IMP3(ICompressFilter, ICryptoProperties, ICompressSetCoderProperties)
+
+ INTERFACE_ICompressFilter(;)
+
+ STDMETHOD(SetKey)(const Byte *data, UInt32 size);
+ STDMETHOD(SetInitVector)(const Byte *data, UInt32 size);
+
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+};
+
+struct CAesCbcEncoder: public CAesCbcCoder
+{
+ CAesCbcEncoder(unsigned keySize = 0): CAesCbcCoder(true, keySize) {}
+};
+
+struct CAesCbcDecoder: public CAesCbcCoder
+{
+ CAesCbcDecoder(unsigned keySize = 0): CAesCbcCoder(false, keySize) {}
+};
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAesReg.cpp b/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAesReg.cpp
new file mode 100644
index 0000000000..3427ad6257
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/MyAesReg.cpp
@@ -0,0 +1,16 @@
+// MyAesReg.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/RegisterCodec.h"
+
+#include "MyAes.h"
+
+namespace NCrypto {
+
+REGISTER_FILTER_E(AES256CBC,
+ CAesCbcDecoder(32),
+ CAesCbcEncoder(32),
+ 0x6F00181, "AES256CBC")
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.cpp b/other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.cpp
new file mode 100644
index 0000000000..542f39bd56
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.cpp
@@ -0,0 +1,124 @@
+// RandGen.cpp
+
+#include "StdAfx.h"
+
+#ifndef _7ZIP_ST
+#include "../../Windows/Synchronization.h"
+#endif
+
+#include "RandGen.h"
+
+#ifndef _WIN32
+#include <unistd.h>
+#define USE_POSIX_TIME
+#define USE_POSIX_TIME2
+#endif
+
+#ifdef USE_POSIX_TIME
+#include <time.h>
+#ifdef USE_POSIX_TIME2
+#include <sys/time.h>
+#endif
+#endif
+
+// This is not very good random number generator.
+// Please use it only for salt.
+// First generated data block depends from timer and processID.
+// Other generated data blocks depend from previous state
+// Maybe it's possible to restore original timer value from generated value.
+
+#define HASH_UPD(x) Sha256_Update(&hash, (const Byte *)&x, sizeof(x));
+
+void CRandomGenerator::Init()
+{
+ CSha256 hash;
+ Sha256_Init(&hash);
+
+ #ifdef _WIN32
+ DWORD w = ::GetCurrentProcessId();
+ HASH_UPD(w);
+ w = ::GetCurrentThreadId();
+ HASH_UPD(w);
+ #else
+ pid_t pid = getpid();
+ HASH_UPD(pid);
+ pid = getppid();
+ HASH_UPD(pid);
+ #endif
+
+ for (unsigned i = 0; i <
+ #ifdef _DEBUG
+ 2;
+ #else
+ 1000;
+ #endif
+ i++)
+ {
+ #ifdef _WIN32
+ LARGE_INTEGER v;
+ if (::QueryPerformanceCounter(&v))
+ HASH_UPD(v.QuadPart);
+ #endif
+
+ #ifdef USE_POSIX_TIME
+ #ifdef USE_POSIX_TIME2
+ timeval v;
+ if (gettimeofday(&v, 0) == 0)
+ {
+ HASH_UPD(v.tv_sec);
+ HASH_UPD(v.tv_usec);
+ }
+ #endif
+ time_t v2 = time(NULL);
+ HASH_UPD(v2);
+ #endif
+
+ #ifdef _WIN32
+ DWORD tickCount = ::GetTickCount();
+ HASH_UPD(tickCount);
+ #endif
+
+ for (unsigned j = 0; j < 100; j++)
+ {
+ Sha256_Final(&hash, _buff);
+ Sha256_Init(&hash);
+ Sha256_Update(&hash, _buff, SHA256_DIGEST_SIZE);
+ }
+ }
+ Sha256_Final(&hash, _buff);
+ _needInit = false;
+}
+
+#ifndef _7ZIP_ST
+ static NWindows::NSynchronization::CCriticalSection g_CriticalSection;
+ #define MT_LOCK NWindows::NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+#else
+ #define MT_LOCK
+#endif
+
+void CRandomGenerator::Generate(Byte *data, unsigned size)
+{
+ MT_LOCK
+
+ if (_needInit)
+ Init();
+ while (size != 0)
+ {
+ CSha256 hash;
+
+ Sha256_Init(&hash);
+ Sha256_Update(&hash, _buff, SHA256_DIGEST_SIZE);
+ Sha256_Final(&hash, _buff);
+
+ Sha256_Init(&hash);
+ UInt32 salt = 0xF672ABD1;
+ HASH_UPD(salt);
+ Sha256_Update(&hash, _buff, SHA256_DIGEST_SIZE);
+ Byte buff[SHA256_DIGEST_SIZE];
+ Sha256_Final(&hash, buff);
+ for (unsigned i = 0; i < SHA256_DIGEST_SIZE && size != 0; i++, size--)
+ *data++ = buff[i];
+ }
+}
+
+CRandomGenerator g_RandomGenerator;
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.h b/other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.h
new file mode 100644
index 0000000000..ff44450f8f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/RandGen.h
@@ -0,0 +1,21 @@
+// RandGen.h
+
+#ifndef __CRYPTO_RAND_GEN_H
+#define __CRYPTO_RAND_GEN_H
+
+#include "../../../C/Sha256.h"
+
+class CRandomGenerator
+{
+ Byte _buff[SHA256_DIGEST_SIZE];
+ bool _needInit;
+
+ void Init();
+public:
+ CRandomGenerator(): _needInit(true) {};
+ void Generate(Byte *data, unsigned size);
+};
+
+extern CRandomGenerator g_RandomGenerator;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/Crypto/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/Crypto/StdAfx.h
new file mode 100644
index 0000000000..42a088f121
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Crypto/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/GuiCommon.rc b/other-licenses/7zstub/src/CPP/7zip/GuiCommon.rc
new file mode 100644
index 0000000000..565ee702ef
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/GuiCommon.rc
@@ -0,0 +1,84 @@
+#include <windows.h>
+
+// #include <winnt.h>
+// #include <WinUser.h>
+
+// for Windows CE:
+#include <CommCtrl.h>
+
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+#undef m
+#undef bxs
+#undef bys
+#undef bxsDots
+#undef y
+#undef xc
+#undef yc
+#undef xs
+#undef ys
+#undef bx
+#undef bx1
+#undef bx2
+#undef bx3
+#undef by
+#undef by1
+#undef by2
+#undef by3
+#undef gSpace
+#undef gSize
+#undef marg2
+#undef marg3
+
+#undef MY_DIALOG
+#undef MY_RESIZE_DIALOG
+#undef MY_PAGE
+
+#define m 8
+#define bxs 64
+#define bys 16
+#define bxsDots 20
+
+#define xs (xc + m + m)
+#define ys (yc + m + m)
+
+#define bx1 (xs - m - bxs)
+#define bx2 (bx1 - m - bxs)
+#define bx3 (bx2 - m - bxs)
+#define bx bx1
+
+#define by1 (ys - m - bys)
+#define by2 (by1 - m - bys)
+#define by by1
+
+
+#define MY_MODAL_DIALOG_STYLE STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
+
+#define MY_MODAL_RESIZE_DIALOG_STYLE MY_MODAL_DIALOG_STYLE | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX | WS_THICKFRAME
+
+#define MY_PAGE_STYLE STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
+
+#define MY_FONT FONT 8, "MS Shell Dlg"
+
+#define SMALL_PAGE_SIZE_X 120
+
+// #define MY_DIALOG DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+// #define MY_RESIZE_DIALOG DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT
+#define MY_PAGE DIALOG 0, 0, xs, ys MY_PAGE_STYLE MY_FONT
+
+#define OK_CANCEL \
+ DEFPUSHBUTTON "OK", IDOK, bx2, by, bxs, bys \
+ PUSHBUTTON "Cancel", IDCANCEL, bx1, by, bxs, bys
+
+#define MY_BUTTON__CLOSE \
+ DEFPUSHBUTTON "&Close", IDCLOSE, bx1, by, bxs, bys
+
+
+#define MY_COMBO CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+#define MY_COMBO_SORTED MY_COMBO | CBS_SORT
+#define MY_COMBO_WITH_EDIT CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+
+#define MY_CHECKBOX "Button", BS_AUTOCHECKBOX | WS_TABSTOP
+
+#define MY_TEXT_NOPREFIX 8, SS_NOPREFIX
diff --git a/other-licenses/7zstub/src/CPP/7zip/Guid.txt b/other-licenses/7zstub/src/CPP/7zip/Guid.txt
new file mode 100644
index 0000000000..e5e06126f1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/Guid.txt
@@ -0,0 +1,220 @@
+{23170F69-40C1-278A-0000-00yy00xx0000}
+
+00 IProgress.h
+
+ 05 IProgress
+ // 050002 IProgress2
+
+01 IFolderArchive.h
+
+ // 05 IArchiveFolder // old
+ // 06 IInFolderArchive // old
+ 07 IFileExtractCallback.h::IFolderArchiveExtractCallback
+ 08 IFileExtractCallback.h::IFolderArchiveExtractCallback2
+ // 0A IOutFolderArchive
+ 0B IFolderArchiveUpdateCallback
+ 0C Agent.h::IArchiveFolderInternal
+ 0D IArchiveFolder
+ 0E IInFolderArchive
+ 0F IOutFolderArchive
+ 10 IFolderArchiveUpdateCallback2
+ 11 IFolderScanProgress
+
+ 20 IFileExtractCallback.h::IGetProp
+ 30 IFileExtractCallback.h::IFolderExtractToStreamCallback
+
+03 IStream.h
+
+ 01 ISequentialInStream
+ 02 ISequentialOutStream
+ 03 IInStream
+ 04 IOutStream
+ 06 IStreamGetSize
+ 07 IOutStreamFinish
+ 08 IStreamGetProps
+ 09 IStreamGetProps2
+
+
+04 ICoder.h
+
+ 04 ICompressProgressInfo
+ 05 ICompressCoder
+ 18 ICompressCoder2
+ 1F ICompressSetCoderPropertiesOpt
+ 20 ICompressSetCoderProperties
+ 21 ICompressSetDecoderProperties //
+ 22 ICompressSetDecoderProperties2
+ 23 ICompressWriteCoderProperties
+ 24 ICompressGetInStreamProcessedSize
+ 25 ICompressSetCoderMt
+ 26 ICompressSetFinishMode
+ 27 ICompressGetInStreamProcessedSize2
+ 28 ICompressSetMemLimit
+
+ 30 ICompressGetSubStreamSize
+ 31 ICompressSetInStream
+ 32 ICompressSetOutStream
+// 33 ICompressSetInStreamSize
+ 34 ICompressSetOutStreamSize
+ 35 ICompressSetBufSize
+ 36 ICompressInitEncoder
+ 37 ICompressSetInStream2
+// 38 ICompressSetOutStream2
+// 39 SetInStreamSize2
+// 3A SetOutStreamSize2
+
+ 40 ICompressFilter
+ 60 ICompressCodecsInfo
+ 61 ISetCompressCodecsInfo
+ 80 ICryptoProperties
+ 88 ICryptoResetSalt
+ 8C ICryptoResetInitVector
+ 90 ICryptoSetPassword
+ A0 ICryptoSetCRC
+ C0 IHasher
+ C1 IHashers
+
+
+05 IPassword.h
+
+ 10 ICryptoGetTextPassword
+ 11 ICryptoGetTextPassword2
+
+
+06 IArchive.h
+
+ 03 ISetProperties
+ 04 IArchiveKeepModeForNextOpen
+ 05 IArchiveAllowTail
+
+ 10 IArchiveOpenCallback
+
+ 20 IArchiveExtractCallback
+ 21 IArchiveExtractCallbackMessage
+
+ 30 IArchiveOpenVolumeCallback
+ 40 IInArchiveGetStream
+ 50 IArchiveOpenSetSubArchiveName
+ 60 IInArchive
+ 61 IArchiveOpenSeq
+ 70 IArchiveGetRawProps
+ 71 IArchiveGetRootProps
+
+ 80 IArchiveUpdateCallback
+ 82 IArchiveUpdateCallback2
+ 83 IArchiveUpdateCallbackFile
+
+ A0 IOutArchive
+
+
+
+08 IFolder.h
+
+ 00 IFolderFolder
+ 01 IEnumProperties
+ 02 IFolderGetTypeID
+ 03 IFolderGetPath
+ 04 IFolderWasChanged
+ 05 // IFolderReload
+ 06 // IFolderOperations old
+ 07 IFolderGetSystemIconIndex
+ 08 IFolderGetItemFullSize
+ 09 IFolderClone
+ 0A IFolderSetFlatMode
+ 0B IFolderOperationsExtractCallback
+ 0C //
+ 0D //
+ 0E IFolderProperties
+ 0F
+ 10 IFolderArcProps
+ 11 IGetFolderArcProps
+ 12 // IFolderOperations
+ 13 IFolderOperations
+ 14 IFolderCalcItemFullSize
+ 15 IFolderCompare
+ 16 IFolderGetItemName
+ 17 IFolderAltStreams
+
+
+09 IFolder.h :: FOLDER_MANAGER_INTERFACE
+
+ 00 - 04 // old IFolderManager
+ 05 IFolderManager
+
+
+// 0A PluginInterface.h
+ 00 IInitContextMenu
+ 01 IPluginOptionsCallback
+ 02 IPluginOptions
+
+
+Handler GUIDs:
+
+{23170F69-40C1-278A-1000-000110xx0000}
+
+ 01 Zip
+ 02 BZip2
+ 03 Rar
+ 04 Arj
+ 05 Z
+ 06 Lzh
+ 07 7z
+ 08 Cab
+ 09 Nsis
+ 0A lzma
+ 0B lzma86
+ 0C xz
+ 0D ppmd
+
+ C6 COFF
+ C7 Ext
+ C8 VMDK
+ C9 VDI
+ CA Qcow
+ CB GPT
+ CC Rar5
+ CD IHex
+ CE Hxs
+ CF TE
+ D0 UEFIc
+ D1 UEFIs
+ D2 SquashFS
+ D3 CramFS
+ D4 APM
+ D5 Mslz
+ D6 Flv
+ D7 Swf
+ D8 Swfc
+ D9 Ntfs
+ DA Fat
+ DB Mbr
+ DC Vhd
+ DD Pe
+ DE Elf
+ DF Mach-O
+ E0 Udf
+ E1 Xar
+ E2 Mub
+ E3 Hfs
+ E4 Dmg
+ E5 Compound
+ E6 Wim
+ E7 Iso
+ E8
+ E9 Chm
+ EA Split
+ EB Rpm
+ EC Deb
+ ED Cpio
+ EE Tar
+ EF GZip
+
+{23170F69-40C1-278A-1000-000100020000} ContextMenu.h::CZipContextMenu
+
+// {23170F69-40C1-278A-1000-000100030000} // CAgentArchiveHandler
+// {23170F69-40C1-278B- old codecs clsids
+// {23170F69-40C1-278D-1000-000100020000} OptionsDialog.h::CLSID_CSevenZipOptions
+
+{23170F69-40C1-2790-id} Codec Decoders
+{23170F69-40C1-2791-id} Codec Encoders
+{23170F69-40C1-2792-id} Hashers
diff --git a/other-licenses/7zstub/src/CPP/7zip/ICoder.h b/other-licenses/7zstub/src/CPP/7zip/ICoder.h
new file mode 100644
index 0000000000..54b247653c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/ICoder.h
@@ -0,0 +1,399 @@
+// ICoder.h
+
+#ifndef __ICODER_H
+#define __ICODER_H
+
+#include "IStream.h"
+
+#define CODER_INTERFACE(i, x) DECL_INTERFACE(i, 4, x)
+
+CODER_INTERFACE(ICompressProgressInfo, 0x04)
+{
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize) PURE;
+
+ /* (inSize) can be NULL, if unknown
+ (outSize) can be NULL, if unknown
+
+ returns:
+ S_OK
+ E_ABORT : Break by user
+ another error codes
+ */
+};
+
+CODER_INTERFACE(ICompressCoder, 0x05)
+{
+ STDMETHOD(Code)(ISequentialInStream *inStream, ISequentialOutStream *outStream,
+ const UInt64 *inSize, const UInt64 *outSize,
+ ICompressProgressInfo *progress) PURE;
+};
+
+CODER_INTERFACE(ICompressCoder2, 0x18)
+{
+ STDMETHOD(Code)(ISequentialInStream * const *inStreams, const UInt64 * const *inSizes, UInt32 numInStreams,
+ ISequentialOutStream * const *outStreams, const UInt64 * const *outSizes, UInt32 numOutStreams,
+ ICompressProgressInfo *progress) PURE;
+};
+
+/*
+ ICompressCoder::Code
+ ICompressCoder2::Code
+
+ returns:
+ S_OK : OK
+ S_FALSE : data error (for decoders)
+ E_OUTOFMEMORY : memory allocation error
+ E_NOTIMPL : unsupported encoding method (for decoders)
+ another error code : some error. For example, it can be error code received from inStream or outStream function.
+
+ Parameters:
+ (inStream != NULL)
+ (outStream != NULL)
+
+ if (inSize != NULL)
+ {
+ Encoders in 7-Zip ignore (inSize).
+ Decoder can use (*inSize) to check that stream was decoded correctly.
+ Some decoder in 7-Zip check it, if (full_decoding mode was set via ICompressSetFinishMode)
+ }
+
+ If it's required to limit the reading from input stream (inStream), it can
+ be done with ISequentialInStream implementation.
+
+ if (outSize != NULL)
+ {
+ Encoders in 7-Zip ignore (outSize).
+ Decoder unpacks no more than (*outSize) bytes.
+ }
+
+ (progress == NULL) is allowed.
+
+
+ Decoding with Code() function
+ -----------------------------
+
+ You can request some interfaces before decoding
+ - ICompressSetDecoderProperties2
+ - ICompressSetFinishMode
+
+ If you need to decode full stream:
+ {
+ 1) try to set full_decoding mode with ICompressSetFinishMode::SetFinishMode(1);
+ 2) call the Code() function with specified (inSize) and (outSize), if these sizes are known.
+ }
+
+ If you need to decode only part of stream:
+ {
+ 1) try to set partial_decoding mode with ICompressSetFinishMode::SetFinishMode(0);
+ 2) Call the Code() function with specified (inSize = NULL) and specified (outSize).
+ }
+
+ Encoding with Code() function
+ -----------------------------
+
+ You can request some interfaces :
+ - ICompressSetCoderProperties - use it before encoding to set properties
+ - ICompressWriteCoderProperties - use it before or after encoding to request encoded properties.
+
+ ICompressCoder2 is used when (numInStreams != 1 || numOutStreams != 1)
+ The rules are similar to ICompressCoder rules
+*/
+
+
+namespace NCoderPropID
+{
+ enum EEnum
+ {
+ kDefaultProp = 0,
+ kDictionarySize, // VT_UI4
+ kUsedMemorySize, // VT_UI4
+ kOrder, // VT_UI4
+ kBlockSize, // VT_UI4 or VT_UI8
+ kPosStateBits, // VT_UI4
+ kLitContextBits, // VT_UI4
+ kLitPosBits, // VT_UI4
+ kNumFastBytes, // VT_UI4
+ kMatchFinder, // VT_BSTR
+ kMatchFinderCycles, // VT_UI4
+ kNumPasses, // VT_UI4
+ kAlgorithm, // VT_UI4
+ kNumThreads, // VT_UI4
+ kEndMarker, // VT_BOOL
+ kLevel, // VT_UI4
+ kReduceSize, // VT_UI8 : it's estimated size of largest data stream that will be compressed
+ // encoder can use this value to reduce dictionary size and allocate data buffers
+
+ kExpectedDataSize, // VT_UI8 : for ICompressSetCoderPropertiesOpt :
+ // it's estimated size of current data stream
+ // real data size can differ from that size
+ // encoder can use this value to optimize encoder initialization
+
+ kBlockSize2, // VT_UI4 or VT_UI8
+ kCheckSize, // VT_UI4 : size of digest in bytes
+ kFilter, // VT_BSTR
+ kMemUse // VT_UI8
+ };
+}
+
+CODER_INTERFACE(ICompressSetCoderPropertiesOpt, 0x1F)
+{
+ STDMETHOD(SetCoderPropertiesOpt)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps) PURE;
+};
+
+CODER_INTERFACE(ICompressSetCoderProperties, 0x20)
+{
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps) PURE;
+};
+
+/*
+CODER_INTERFACE(ICompressSetCoderProperties, 0x21)
+{
+ STDMETHOD(SetDecoderProperties)(ISequentialInStream *inStream) PURE;
+};
+*/
+
+CODER_INTERFACE(ICompressSetDecoderProperties2, 0x22)
+{
+ /* returns:
+ S_OK
+ E_NOTIMP : unsupported properties
+ E_INVALIDARG : incorrect (or unsupported) properties
+ E_OUTOFMEMORY : memory allocation error
+ */
+ STDMETHOD(SetDecoderProperties2)(const Byte *data, UInt32 size) PURE;
+};
+
+CODER_INTERFACE(ICompressWriteCoderProperties, 0x23)
+{
+ STDMETHOD(WriteCoderProperties)(ISequentialOutStream *outStream) PURE;
+};
+
+CODER_INTERFACE(ICompressGetInStreamProcessedSize, 0x24)
+{
+ STDMETHOD(GetInStreamProcessedSize)(UInt64 *value) PURE;
+};
+
+CODER_INTERFACE(ICompressSetCoderMt, 0x25)
+{
+ STDMETHOD(SetNumberOfThreads)(UInt32 numThreads) PURE;
+};
+
+CODER_INTERFACE(ICompressSetFinishMode, 0x26)
+{
+ STDMETHOD(SetFinishMode)(UInt32 finishMode) PURE;
+
+ /* finishMode:
+ 0 : partial decoding is allowed. It's default mode for ICompressCoder::Code(), if (outSize) is defined.
+ 1 : full decoding. The stream must be finished at the end of decoding. */
+};
+
+CODER_INTERFACE(ICompressGetInStreamProcessedSize2, 0x27)
+{
+ STDMETHOD(GetInStreamProcessedSize2)(UInt32 streamIndex, UInt64 *value) PURE;
+};
+
+CODER_INTERFACE(ICompressSetMemLimit, 0x28)
+{
+ STDMETHOD(SetMemLimit)(UInt64 memUsage) PURE;
+};
+
+
+
+CODER_INTERFACE(ICompressGetSubStreamSize, 0x30)
+{
+ STDMETHOD(GetSubStreamSize)(UInt64 subStream, UInt64 *value) PURE;
+
+ /* returns:
+ S_OK : (*value) contains the size or estimated size (can be incorrect size)
+ S_FALSE : size is undefined
+ E_NOTIMP : the feature is not implemented
+
+ Let's (read_size) is size of data that was already read by ISequentialInStream::Read().
+ The caller should call GetSubStreamSize() after each Read() and check sizes:
+ if (start_of_subStream + *value < read_size)
+ {
+ // (*value) is correct, and it's allowed to call GetSubStreamSize() for next subStream:
+ start_of_subStream += *value;
+ subStream++;
+ }
+ */
+};
+
+CODER_INTERFACE(ICompressSetInStream, 0x31)
+{
+ STDMETHOD(SetInStream)(ISequentialInStream *inStream) PURE;
+ STDMETHOD(ReleaseInStream)() PURE;
+};
+
+CODER_INTERFACE(ICompressSetOutStream, 0x32)
+{
+ STDMETHOD(SetOutStream)(ISequentialOutStream *outStream) PURE;
+ STDMETHOD(ReleaseOutStream)() PURE;
+};
+
+/*
+CODER_INTERFACE(ICompressSetInStreamSize, 0x33)
+{
+ STDMETHOD(SetInStreamSize)(const UInt64 *inSize) PURE;
+};
+*/
+
+CODER_INTERFACE(ICompressSetOutStreamSize, 0x34)
+{
+ STDMETHOD(SetOutStreamSize)(const UInt64 *outSize) PURE;
+
+ /* That function initializes decoder structures.
+ Call this function only for stream version of decoder.
+ if (outSize == NULL), then output size is unknown
+ if (outSize != NULL), then the decoder must stop decoding after (*outSize) bytes. */
+};
+
+CODER_INTERFACE(ICompressSetBufSize, 0x35)
+{
+ STDMETHOD(SetInBufSize)(UInt32 streamIndex, UInt32 size) PURE;
+ STDMETHOD(SetOutBufSize)(UInt32 streamIndex, UInt32 size) PURE;
+};
+
+CODER_INTERFACE(ICompressInitEncoder, 0x36)
+{
+ STDMETHOD(InitEncoder)() PURE;
+
+ /* That function initializes encoder structures.
+ Call this function only for stream version of encoder. */
+};
+
+CODER_INTERFACE(ICompressSetInStream2, 0x37)
+{
+ STDMETHOD(SetInStream2)(UInt32 streamIndex, ISequentialInStream *inStream) PURE;
+ STDMETHOD(ReleaseInStream2)(UInt32 streamIndex) PURE;
+};
+
+/*
+CODER_INTERFACE(ICompressSetOutStream2, 0x38)
+{
+ STDMETHOD(SetOutStream2)(UInt32 streamIndex, ISequentialOutStream *outStream) PURE;
+ STDMETHOD(ReleaseOutStream2)(UInt32 streamIndex) PURE;
+};
+
+CODER_INTERFACE(ICompressSetInStreamSize2, 0x39)
+{
+ STDMETHOD(SetInStreamSize2)(UInt32 streamIndex, const UInt64 *inSize) PURE;
+};
+*/
+
+
+/*
+ ICompressFilter
+ Filter() converts as most as possible bytes
+ returns: (outSize):
+ if (outSize <= size) : Filter have converted outSize bytes
+ if (outSize > size) : Filter have not converted anything.
+ and it needs at least outSize bytes to convert one block
+ (it's for crypto block algorithms).
+*/
+
+#define INTERFACE_ICompressFilter(x) \
+ STDMETHOD(Init)() x; \
+ STDMETHOD_(UInt32, Filter)(Byte *data, UInt32 size) x; \
+
+CODER_INTERFACE(ICompressFilter, 0x40)
+{
+ INTERFACE_ICompressFilter(PURE);
+};
+
+
+CODER_INTERFACE(ICompressCodecsInfo, 0x60)
+{
+ STDMETHOD(GetNumMethods)(UInt32 *numMethods) PURE;
+ STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
+ STDMETHOD(CreateDecoder)(UInt32 index, const GUID *iid, void **coder) PURE;
+ STDMETHOD(CreateEncoder)(UInt32 index, const GUID *iid, void **coder) PURE;
+};
+
+CODER_INTERFACE(ISetCompressCodecsInfo, 0x61)
+{
+ STDMETHOD(SetCompressCodecsInfo)(ICompressCodecsInfo *compressCodecsInfo) PURE;
+};
+
+CODER_INTERFACE(ICryptoProperties, 0x80)
+{
+ STDMETHOD(SetKey)(const Byte *data, UInt32 size) PURE;
+ STDMETHOD(SetInitVector)(const Byte *data, UInt32 size) PURE;
+};
+
+/*
+CODER_INTERFACE(ICryptoResetSalt, 0x88)
+{
+ STDMETHOD(ResetSalt)() PURE;
+};
+*/
+
+CODER_INTERFACE(ICryptoResetInitVector, 0x8C)
+{
+ STDMETHOD(ResetInitVector)() PURE;
+
+ /* Call ResetInitVector() only for encoding.
+ Call ResetInitVector() before encoding and before WriteCoderProperties().
+ Crypto encoder can create random IV in that function. */
+};
+
+CODER_INTERFACE(ICryptoSetPassword, 0x90)
+{
+ STDMETHOD(CryptoSetPassword)(const Byte *data, UInt32 size) PURE;
+};
+
+CODER_INTERFACE(ICryptoSetCRC, 0xA0)
+{
+ STDMETHOD(CryptoSetCRC)(UInt32 crc) PURE;
+};
+
+
+namespace NMethodPropID
+{
+ enum EEnum
+ {
+ kID,
+ kName,
+ kDecoder,
+ kEncoder,
+ kPackStreams,
+ kUnpackStreams,
+ kDescription,
+ kDecoderIsAssigned,
+ kEncoderIsAssigned,
+ kDigestSize
+ };
+}
+
+
+#define INTERFACE_IHasher(x) \
+ STDMETHOD_(void, Init)() throw() x; \
+ STDMETHOD_(void, Update)(const void *data, UInt32 size) throw() x; \
+ STDMETHOD_(void, Final)(Byte *digest) throw() x; \
+ STDMETHOD_(UInt32, GetDigestSize)() throw() x; \
+
+CODER_INTERFACE(IHasher, 0xC0)
+{
+ INTERFACE_IHasher(PURE)
+};
+
+CODER_INTERFACE(IHashers, 0xC1)
+{
+ STDMETHOD_(UInt32, GetNumHashers)() PURE;
+ STDMETHOD(GetHasherProp)(UInt32 index, PROPID propID, PROPVARIANT *value) PURE;
+ STDMETHOD(CreateHasher)(UInt32 index, IHasher **hasher) PURE;
+};
+
+extern "C"
+{
+ typedef HRESULT (WINAPI *Func_GetNumberOfMethods)(UInt32 *numMethods);
+ typedef HRESULT (WINAPI *Func_GetMethodProperty)(UInt32 index, PROPID propID, PROPVARIANT *value);
+ typedef HRESULT (WINAPI *Func_CreateDecoder)(UInt32 index, const GUID *iid, void **outObject);
+ typedef HRESULT (WINAPI *Func_CreateEncoder)(UInt32 index, const GUID *iid, void **outObject);
+
+ typedef HRESULT (WINAPI *Func_GetHashers)(IHashers **hashers);
+
+ typedef HRESULT (WINAPI *Func_SetCodecs)(ICompressCodecsInfo *compressCodecsInfo);
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/IDecl.h b/other-licenses/7zstub/src/CPP/7zip/IDecl.h
new file mode 100644
index 0000000000..5a34b0e441
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/IDecl.h
@@ -0,0 +1,28 @@
+// IDecl.h
+
+#ifndef __IDECL_H
+#define __IDECL_H
+
+#include "../Common/MyUnknown.h"
+
+#define k_7zip_GUID_Data1 0x23170F69
+#define k_7zip_GUID_Data2 0x40C1
+
+#define k_7zip_GUID_Data3_Common 0x278A
+
+#define k_7zip_GUID_Data3_Decoder 0x2790
+#define k_7zip_GUID_Data3_Encoder 0x2791
+#define k_7zip_GUID_Data3_Hasher 0x2792
+
+
+#define DECL_INTERFACE_SUB(i, base, groupId, subId) \
+ DEFINE_GUID(IID_ ## i, \
+ k_7zip_GUID_Data1, \
+ k_7zip_GUID_Data2, \
+ k_7zip_GUID_Data3_Common, \
+ 0, 0, 0, (groupId), 0, (subId), 0, 0); \
+ struct i: public base
+
+#define DECL_INTERFACE(i, groupId, subId) DECL_INTERFACE_SUB(i, IUnknown, groupId, subId)
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/IPassword.h b/other-licenses/7zstub/src/CPP/7zip/IPassword.h
new file mode 100644
index 0000000000..e366007041
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/IPassword.h
@@ -0,0 +1,23 @@
+// IPassword.h
+
+#ifndef __IPASSWORD_H
+#define __IPASSWORD_H
+
+#include "../Common/MyTypes.h"
+#include "../Common/MyUnknown.h"
+
+#include "IDecl.h"
+
+#define PASSWORD_INTERFACE(i, x) DECL_INTERFACE(i, 5, x)
+
+PASSWORD_INTERFACE(ICryptoGetTextPassword, 0x10)
+{
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password) PURE;
+};
+
+PASSWORD_INTERFACE(ICryptoGetTextPassword2, 0x11)
+{
+ STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password) PURE;
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/IProgress.h b/other-licenses/7zstub/src/CPP/7zip/IProgress.h
new file mode 100644
index 0000000000..d54529ca80
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/IProgress.h
@@ -0,0 +1,19 @@
+// IProgress.h
+
+#ifndef __IPROGRESS_H
+#define __IPROGRESS_H
+
+#include "../Common/MyTypes.h"
+
+#include "IDecl.h"
+
+#define INTERFACE_IProgress(x) \
+ STDMETHOD(SetTotal)(UInt64 total) x; \
+ STDMETHOD(SetCompleted)(const UInt64 *completeValue) x; \
+
+DECL_INTERFACE(IProgress, 0, 5)
+{
+ INTERFACE_IProgress(PURE)
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/IStream.h b/other-licenses/7zstub/src/CPP/7zip/IStream.h
new file mode 100644
index 0000000000..436e91987f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/IStream.h
@@ -0,0 +1,127 @@
+// IStream.h
+
+#ifndef __ISTREAM_H
+#define __ISTREAM_H
+
+#include "../Common/MyTypes.h"
+#include "../Common/MyWindows.h"
+
+#include "IDecl.h"
+
+#define STREAM_INTERFACE_SUB(i, base, x) DECL_INTERFACE_SUB(i, base, 3, x)
+#define STREAM_INTERFACE(i, x) STREAM_INTERFACE_SUB(i, IUnknown, x)
+
+STREAM_INTERFACE(ISequentialInStream, 0x01)
+{
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize) PURE;
+
+ /*
+ The requirement for caller: (processedSize != NULL).
+ The callee can allow (processedSize == NULL) for compatibility reasons.
+
+ if (size == 0), this function returns S_OK and (*processedSize) is set to 0.
+
+ if (size != 0)
+ {
+ Partial read is allowed: (*processedSize <= avail_size && *processedSize <= size),
+ where (avail_size) is the size of remaining bytes in stream.
+ If (avail_size != 0), this function must read at least 1 byte: (*processedSize > 0).
+ You must call Read() in loop, if you need to read exact amount of data.
+ }
+
+ If seek pointer before Read() call was changed to position past the end of stream:
+ if (seek_pointer >= stream_size), this function returns S_OK and (*processedSize) is set to 0.
+
+ ERROR CASES:
+ If the function returns error code, then (*processedSize) is size of
+ data written to (data) buffer (it can be data before error or data with errors).
+ The recommended way for callee to work with reading errors:
+ 1) write part of data before error to (data) buffer and return S_OK.
+ 2) return error code for further calls of Read().
+ */
+};
+
+STREAM_INTERFACE(ISequentialOutStream, 0x02)
+{
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize) PURE;
+
+ /*
+ The requirement for caller: (processedSize != NULL).
+ The callee can allow (processedSize == NULL) for compatibility reasons.
+
+ if (size != 0)
+ {
+ Partial write is allowed: (*processedSize <= size),
+ but this function must write at least 1 byte: (*processedSize > 0).
+ You must call Write() in loop, if you need to write exact amount of data.
+ }
+
+ ERROR CASES:
+ If the function returns error code, then (*processedSize) is size of
+ data written from (data) buffer.
+ */
+};
+
+#ifdef __HRESULT_FROM_WIN32
+#define HRESULT_WIN32_ERROR_NEGATIVE_SEEK __HRESULT_FROM_WIN32(ERROR_NEGATIVE_SEEK)
+#else
+#define HRESULT_WIN32_ERROR_NEGATIVE_SEEK HRESULT_FROM_WIN32(ERROR_NEGATIVE_SEEK)
+#endif
+
+/* Seek() Function
+ If you seek before the beginning of the stream, Seek() function returns error code:
+ Recommended error code is __HRESULT_FROM_WIN32(ERROR_NEGATIVE_SEEK).
+ or STG_E_INVALIDFUNCTION
+
+ It is allowed to seek past the end of the stream.
+
+
+ if Seek() returns error, then the value of *newPosition is undefined.
+*/
+
+STREAM_INTERFACE_SUB(IInStream, ISequentialInStream, 0x03)
+{
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
+};
+
+STREAM_INTERFACE_SUB(IOutStream, ISequentialOutStream, 0x04)
+{
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition) PURE;
+ STDMETHOD(SetSize)(UInt64 newSize) PURE;
+};
+
+STREAM_INTERFACE(IStreamGetSize, 0x06)
+{
+ STDMETHOD(GetSize)(UInt64 *size) PURE;
+};
+
+STREAM_INTERFACE(IOutStreamFinish, 0x07)
+{
+ STDMETHOD(OutStreamFinish)() PURE;
+};
+
+
+STREAM_INTERFACE(IStreamGetProps, 0x08)
+{
+ STDMETHOD(GetProps)(UInt64 *size, FILETIME *cTime, FILETIME *aTime, FILETIME *mTime, UInt32 *attrib) PURE;
+};
+
+struct CStreamFileProps
+{
+ UInt64 Size;
+ UInt64 VolID;
+ UInt64 FileID_Low;
+ UInt64 FileID_High;
+ UInt32 NumLinks;
+ UInt32 Attrib;
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+};
+
+STREAM_INTERFACE(IStreamGetProps2, 0x09)
+{
+ STDMETHOD(GetProps2)(CStreamFileProps *props) PURE;
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/LzmaDec.mak b/other-licenses/7zstub/src/CPP/7zip/LzmaDec.mak
new file mode 100644
index 0000000000..3c0e7c5baa
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/LzmaDec.mak
@@ -0,0 +1,5 @@
+!IF "$(CPU)" == "AMD64"
+CFLAGS_C_SPEC = -D_LZMA_DEC_OPT
+ASM_OBJS = $(ASM_OBJS) \
+ $O\LzmaDecOpt.obj
+!ENDIF
diff --git a/other-licenses/7zstub/src/CPP/7zip/MyVersion.h b/other-licenses/7zstub/src/CPP/7zip/MyVersion.h
new file mode 100644
index 0000000000..0d50f94269
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/MyVersion.h
@@ -0,0 +1,2 @@
+#define USE_COPYRIGHT_CR
+#include "../../C/7zVersion.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/MyVersionInfo.rc b/other-licenses/7zstub/src/CPP/7zip/MyVersionInfo.rc
new file mode 100644
index 0000000000..eddf8935c8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/MyVersionInfo.rc
@@ -0,0 +1,2 @@
+#include "MyVersion.h"
+#include "..\..\C\7zVersion.rc"
diff --git a/other-licenses/7zstub/src/CPP/7zip/PropID.h b/other-licenses/7zstub/src/CPP/7zip/PropID.h
new file mode 100644
index 0000000000..126af67857
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/PropID.h
@@ -0,0 +1,127 @@
+// PropID.h
+
+#ifndef __7ZIP_PROP_ID_H
+#define __7ZIP_PROP_ID_H
+
+#include "../Common/MyTypes.h"
+
+enum
+{
+ kpidNoProperty = 0,
+ kpidMainSubfile,
+ kpidHandlerItemIndex,
+ kpidPath,
+ kpidName,
+ kpidExtension,
+ kpidIsDir,
+ kpidSize,
+ kpidPackSize,
+ kpidAttrib,
+ kpidCTime,
+ kpidATime,
+ kpidMTime,
+ kpidSolid,
+ kpidCommented,
+ kpidEncrypted,
+ kpidSplitBefore,
+ kpidSplitAfter,
+ kpidDictionarySize,
+ kpidCRC,
+ kpidType,
+ kpidIsAnti,
+ kpidMethod,
+ kpidHostOS,
+ kpidFileSystem,
+ kpidUser,
+ kpidGroup,
+ kpidBlock,
+ kpidComment,
+ kpidPosition,
+ kpidPrefix,
+ kpidNumSubDirs,
+ kpidNumSubFiles,
+ kpidUnpackVer,
+ kpidVolume,
+ kpidIsVolume,
+ kpidOffset,
+ kpidLinks,
+ kpidNumBlocks,
+ kpidNumVolumes,
+ kpidTimeType,
+ kpidBit64,
+ kpidBigEndian,
+ kpidCpu,
+ kpidPhySize,
+ kpidHeadersSize,
+ kpidChecksum,
+ kpidCharacts,
+ kpidVa,
+ kpidId,
+ kpidShortName,
+ kpidCreatorApp,
+ kpidSectorSize,
+ kpidPosixAttrib,
+ kpidSymLink,
+ kpidError,
+ kpidTotalSize,
+ kpidFreeSpace,
+ kpidClusterSize,
+ kpidVolumeName,
+ kpidLocalName,
+ kpidProvider,
+ kpidNtSecure,
+ kpidIsAltStream,
+ kpidIsAux,
+ kpidIsDeleted,
+ kpidIsTree,
+ kpidSha1,
+ kpidSha256,
+ kpidErrorType,
+ kpidNumErrors,
+ kpidErrorFlags,
+ kpidWarningFlags,
+ kpidWarning,
+ kpidNumStreams,
+ kpidNumAltStreams,
+ kpidAltStreamsSize,
+ kpidVirtualSize,
+ kpidUnpackSize,
+ kpidTotalPhySize,
+ kpidVolumeIndex,
+ kpidSubType,
+ kpidShortComment,
+ kpidCodePage,
+ kpidIsNotArcType,
+ kpidPhySizeCantBeDetected,
+ kpidZerosTailIsAllowed,
+ kpidTailSize,
+ kpidEmbeddedStubSize,
+ kpidNtReparse,
+ kpidHardLink,
+ kpidINode,
+ kpidStreamId,
+ kpidReadOnly,
+ kpidOutName,
+ kpidCopyLink,
+
+ kpid_NUM_DEFINED,
+
+ kpidUserDefined = 0x10000
+};
+
+extern const Byte k7z_PROPID_To_VARTYPE[kpid_NUM_DEFINED]; // VARTYPE
+
+const UInt32 kpv_ErrorFlags_IsNotArc = 1 << 0;
+const UInt32 kpv_ErrorFlags_HeadersError = 1 << 1;
+const UInt32 kpv_ErrorFlags_EncryptedHeadersError = 1 << 2;
+const UInt32 kpv_ErrorFlags_UnavailableStart = 1 << 3;
+const UInt32 kpv_ErrorFlags_UnconfirmedStart = 1 << 4;
+const UInt32 kpv_ErrorFlags_UnexpectedEnd = 1 << 5;
+const UInt32 kpv_ErrorFlags_DataAfterEnd = 1 << 6;
+const UInt32 kpv_ErrorFlags_UnsupportedMethod = 1 << 7;
+const UInt32 kpv_ErrorFlags_UnsupportedFeature = 1 << 8;
+const UInt32 kpv_ErrorFlags_DataError = 1 << 9;
+const UInt32 kpv_ErrorFlags_CrcError = 1 << 10;
+// const UInt32 kpv_ErrorFlags_Unsupported = 1 << 11;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/SubBuild.mak b/other-licenses/7zstub/src/CPP/7zip/SubBuild.mak
new file mode 100644
index 0000000000..0c49d3b712
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/SubBuild.mak
@@ -0,0 +1,3 @@
+ cd $(@D)
+ $(MAKE) -nologo $(TARGETS)
+ cd ..
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.cpp
new file mode 100644
index 0000000000..9a06cdc1d1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.cpp
@@ -0,0 +1,993 @@
+// Client7z.cpp
+
+#include "StdAfx.h"
+
+#include <stdio.h>
+
+#include "../../../Common/MyWindows.h"
+
+#include "../../../Common/Defs.h"
+#include "../../../Common/MyInitGuid.h"
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/DLL.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/NtCheck.h"
+#include "../../../Windows/PropVariant.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#include "../../Common/FileStreams.h"
+
+#include "../../Archive/IArchive.h"
+
+#include "../../IPassword.h"
+#include "../../../../C/7zVersion.h"
+
+#ifdef _WIN32
+HINSTANCE g_hInstance = 0;
+#endif
+
+// Tou can find the list of all GUIDs in Guid.txt file.
+// use another CLSIDs, if you want to support other formats (zip, rar, ...).
+// {23170F69-40C1-278A-1000-000110070000}
+
+DEFINE_GUID(CLSID_CFormat7z,
+ 0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x07, 0x00, 0x00);
+DEFINE_GUID(CLSID_CFormatXz,
+ 0x23170F69, 0x40C1, 0x278A, 0x10, 0x00, 0x00, 0x01, 0x10, 0x0C, 0x00, 0x00);
+
+#define CLSID_Format CLSID_CFormat7z
+// #define CLSID_Format CLSID_CFormatXz
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+#define kDllName "7z.dll"
+
+static const char * const kCopyrightString =
+ "\n"
+ "7-Zip"
+ " (" kDllName " client)"
+ " " MY_VERSION
+ " : " MY_COPYRIGHT_DATE
+ "\n";
+
+static const char * const kHelpString =
+"Usage: 7zcl.exe [a | l | x] archive.7z [fileName ...]\n"
+"Examples:\n"
+" 7zcl.exe a archive.7z f1.txt f2.txt : compress two files to archive.7z\n"
+" 7zcl.exe l archive.7z : List contents of archive.7z\n"
+" 7zcl.exe x archive.7z : eXtract files from archive.7z\n";
+
+
+static void Convert_UString_to_AString(const UString &s, AString &temp)
+{
+ int codePage = CP_OEMCP;
+ /*
+ int g_CodePage = -1;
+ int codePage = g_CodePage;
+ if (codePage == -1)
+ codePage = CP_OEMCP;
+ if (codePage == CP_UTF8)
+ ConvertUnicodeToUTF8(s, temp);
+ else
+ */
+ UnicodeStringToMultiByte2(temp, s, (UINT)codePage);
+}
+
+static FString CmdStringToFString(const char *s)
+{
+ return us2fs(GetUnicodeString(s));
+}
+
+static void Print(const char *s)
+{
+ fputs(s, stdout);
+}
+
+static void Print(const AString &s)
+{
+ Print(s.Ptr());
+}
+
+static void Print(const UString &s)
+{
+ AString as;
+ Convert_UString_to_AString(s, as);
+ Print(as);
+}
+
+static void Print(const wchar_t *s)
+{
+ Print(UString(s));
+}
+
+static void PrintNewLine()
+{
+ Print("\n");
+}
+
+static void PrintStringLn(const char *s)
+{
+ Print(s);
+ PrintNewLine();
+}
+
+static void PrintError(const char *message)
+{
+ Print("Error: ");
+ PrintNewLine();
+ Print(message);
+ PrintNewLine();
+}
+
+static void PrintError(const char *message, const FString &name)
+{
+ PrintError(message);
+ Print(name);
+}
+
+
+static HRESULT IsArchiveItemProp(IInArchive *archive, UInt32 index, PROPID propID, bool &result)
+{
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, propID, &prop));
+ if (prop.vt == VT_BOOL)
+ result = VARIANT_BOOLToBool(prop.boolVal);
+ else if (prop.vt == VT_EMPTY)
+ result = false;
+ else
+ return E_FAIL;
+ return S_OK;
+}
+
+static HRESULT IsArchiveItemFolder(IInArchive *archive, UInt32 index, bool &result)
+{
+ return IsArchiveItemProp(archive, index, kpidIsDir, result);
+}
+
+
+static const wchar_t * const kEmptyFileAlias = L"[Content]";
+
+
+//////////////////////////////////////////////////////////////
+// Archive Open callback class
+
+
+class CArchiveOpenCallback:
+ public IArchiveOpenCallback,
+ public ICryptoGetTextPassword,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(ICryptoGetTextPassword)
+
+ STDMETHOD(SetTotal)(const UInt64 *files, const UInt64 *bytes);
+ STDMETHOD(SetCompleted)(const UInt64 *files, const UInt64 *bytes);
+
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+
+ bool PasswordIsDefined;
+ UString Password;
+
+ CArchiveOpenCallback() : PasswordIsDefined(false) {}
+};
+
+STDMETHODIMP CArchiveOpenCallback::SetTotal(const UInt64 * /* files */, const UInt64 * /* bytes */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveOpenCallback::SetCompleted(const UInt64 * /* files */, const UInt64 * /* bytes */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveOpenCallback::CryptoGetTextPassword(BSTR *password)
+{
+ if (!PasswordIsDefined)
+ {
+ // You can ask real password here from user
+ // Password = GetPassword(OutStream);
+ // PasswordIsDefined = true;
+ PrintError("Password is not defined");
+ return E_ABORT;
+ }
+ return StringToBstr(Password, password);
+}
+
+
+
+static const char * const kIncorrectCommand = "incorrect command";
+
+//////////////////////////////////////////////////////////////
+// Archive Extracting callback class
+
+static const char * const kTestingString = "Testing ";
+static const char * const kExtractingString = "Extracting ";
+static const char * const kSkippingString = "Skipping ";
+
+static const char * const kUnsupportedMethod = "Unsupported Method";
+static const char * const kCRCFailed = "CRC Failed";
+static const char * const kDataError = "Data Error";
+static const char * const kUnavailableData = "Unavailable data";
+static const char * const kUnexpectedEnd = "Unexpected end of data";
+static const char * const kDataAfterEnd = "There are some data after the end of the payload data";
+static const char * const kIsNotArc = "Is not archive";
+static const char * const kHeadersError = "Headers Error";
+
+
+class CArchiveExtractCallback:
+ public IArchiveExtractCallback,
+ public ICryptoGetTextPassword,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP1(ICryptoGetTextPassword)
+
+ // IProgress
+ STDMETHOD(SetTotal)(UInt64 size);
+ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
+
+ // IArchiveExtractCallback
+ STDMETHOD(GetStream)(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode);
+ STDMETHOD(PrepareOperation)(Int32 askExtractMode);
+ STDMETHOD(SetOperationResult)(Int32 resultEOperationResult);
+
+ // ICryptoGetTextPassword
+ STDMETHOD(CryptoGetTextPassword)(BSTR *aPassword);
+
+private:
+ CMyComPtr<IInArchive> _archiveHandler;
+ FString _directoryPath; // Output directory
+ UString _filePath; // name inside arcvhive
+ FString _diskFilePath; // full path to file on disk
+ bool _extractMode;
+ struct CProcessedFileInfo
+ {
+ FILETIME MTime;
+ UInt32 Attrib;
+ bool isDir;
+ bool AttribDefined;
+ bool MTimeDefined;
+ } _processedFileInfo;
+
+ COutFileStream *_outFileStreamSpec;
+ CMyComPtr<ISequentialOutStream> _outFileStream;
+
+public:
+ void Init(IInArchive *archiveHandler, const FString &directoryPath);
+
+ UInt64 NumErrors;
+ bool PasswordIsDefined;
+ UString Password;
+
+ CArchiveExtractCallback() : PasswordIsDefined(false) {}
+};
+
+void CArchiveExtractCallback::Init(IInArchive *archiveHandler, const FString &directoryPath)
+{
+ NumErrors = 0;
+ _archiveHandler = archiveHandler;
+ _directoryPath = directoryPath;
+ NName::NormalizeDirPathPrefix(_directoryPath);
+}
+
+STDMETHODIMP CArchiveExtractCallback::SetTotal(UInt64 /* size */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveExtractCallback::SetCompleted(const UInt64 * /* completeValue */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index,
+ ISequentialOutStream **outStream, Int32 askExtractMode)
+{
+ *outStream = 0;
+ _outFileStream.Release();
+
+ {
+ // Get Name
+ NCOM::CPropVariant prop;
+ RINOK(_archiveHandler->GetProperty(index, kpidPath, &prop));
+
+ UString fullPath;
+ if (prop.vt == VT_EMPTY)
+ fullPath = kEmptyFileAlias;
+ else
+ {
+ if (prop.vt != VT_BSTR)
+ return E_FAIL;
+ fullPath = prop.bstrVal;
+ }
+ _filePath = fullPath;
+ }
+
+ if (askExtractMode != NArchive::NExtract::NAskMode::kExtract)
+ return S_OK;
+
+ {
+ // Get Attrib
+ NCOM::CPropVariant prop;
+ RINOK(_archiveHandler->GetProperty(index, kpidAttrib, &prop));
+ if (prop.vt == VT_EMPTY)
+ {
+ _processedFileInfo.Attrib = 0;
+ _processedFileInfo.AttribDefined = false;
+ }
+ else
+ {
+ if (prop.vt != VT_UI4)
+ return E_FAIL;
+ _processedFileInfo.Attrib = prop.ulVal;
+ _processedFileInfo.AttribDefined = true;
+ }
+ }
+
+ RINOK(IsArchiveItemFolder(_archiveHandler, index, _processedFileInfo.isDir));
+
+ {
+ // Get Modified Time
+ NCOM::CPropVariant prop;
+ RINOK(_archiveHandler->GetProperty(index, kpidMTime, &prop));
+ _processedFileInfo.MTimeDefined = false;
+ switch (prop.vt)
+ {
+ case VT_EMPTY:
+ // _processedFileInfo.MTime = _utcMTimeDefault;
+ break;
+ case VT_FILETIME:
+ _processedFileInfo.MTime = prop.filetime;
+ _processedFileInfo.MTimeDefined = true;
+ break;
+ default:
+ return E_FAIL;
+ }
+
+ }
+ {
+ // Get Size
+ NCOM::CPropVariant prop;
+ RINOK(_archiveHandler->GetProperty(index, kpidSize, &prop));
+ UInt64 newFileSize;
+ /* bool newFileSizeDefined = */ ConvertPropVariantToUInt64(prop, newFileSize);
+ }
+
+
+ {
+ // Create folders for file
+ int slashPos = _filePath.ReverseFind_PathSepar();
+ if (slashPos >= 0)
+ CreateComplexDir(_directoryPath + us2fs(_filePath.Left(slashPos)));
+ }
+
+ FString fullProcessedPath = _directoryPath + us2fs(_filePath);
+ _diskFilePath = fullProcessedPath;
+
+ if (_processedFileInfo.isDir)
+ {
+ CreateComplexDir(fullProcessedPath);
+ }
+ else
+ {
+ NFind::CFileInfo fi;
+ if (fi.Find(fullProcessedPath))
+ {
+ if (!DeleteFileAlways(fullProcessedPath))
+ {
+ PrintError("Can not delete output file", fullProcessedPath);
+ return E_ABORT;
+ }
+ }
+
+ _outFileStreamSpec = new COutFileStream;
+ CMyComPtr<ISequentialOutStream> outStreamLoc(_outFileStreamSpec);
+ if (!_outFileStreamSpec->Open(fullProcessedPath, CREATE_ALWAYS))
+ {
+ PrintError("Can not open output file", fullProcessedPath);
+ return E_ABORT;
+ }
+ _outFileStream = outStreamLoc;
+ *outStream = outStreamLoc.Detach();
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode)
+{
+ _extractMode = false;
+ switch (askExtractMode)
+ {
+ case NArchive::NExtract::NAskMode::kExtract: _extractMode = true; break;
+ };
+ switch (askExtractMode)
+ {
+ case NArchive::NExtract::NAskMode::kExtract: Print(kExtractingString); break;
+ case NArchive::NExtract::NAskMode::kTest: Print(kTestingString); break;
+ case NArchive::NExtract::NAskMode::kSkip: Print(kSkippingString); break;
+ };
+ Print(_filePath);
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 operationResult)
+{
+ switch (operationResult)
+ {
+ case NArchive::NExtract::NOperationResult::kOK:
+ break;
+ default:
+ {
+ NumErrors++;
+ Print(" : ");
+ const char *s = NULL;
+ switch (operationResult)
+ {
+ case NArchive::NExtract::NOperationResult::kUnsupportedMethod:
+ s = kUnsupportedMethod;
+ break;
+ case NArchive::NExtract::NOperationResult::kCRCError:
+ s = kCRCFailed;
+ break;
+ case NArchive::NExtract::NOperationResult::kDataError:
+ s = kDataError;
+ break;
+ case NArchive::NExtract::NOperationResult::kUnavailable:
+ s = kUnavailableData;
+ break;
+ case NArchive::NExtract::NOperationResult::kUnexpectedEnd:
+ s = kUnexpectedEnd;
+ break;
+ case NArchive::NExtract::NOperationResult::kDataAfterEnd:
+ s = kDataAfterEnd;
+ break;
+ case NArchive::NExtract::NOperationResult::kIsNotArc:
+ s = kIsNotArc;
+ break;
+ case NArchive::NExtract::NOperationResult::kHeadersError:
+ s = kHeadersError;
+ break;
+ }
+ if (s)
+ {
+ Print("Error : ");
+ Print(s);
+ }
+ else
+ {
+ char temp[16];
+ ConvertUInt32ToString(operationResult, temp);
+ Print("Error #");
+ Print(temp);
+ }
+ }
+ }
+
+ if (_outFileStream)
+ {
+ if (_processedFileInfo.MTimeDefined)
+ _outFileStreamSpec->SetMTime(&_processedFileInfo.MTime);
+ RINOK(_outFileStreamSpec->Close());
+ }
+ _outFileStream.Release();
+ if (_extractMode && _processedFileInfo.AttribDefined)
+ SetFileAttrib_PosixHighDetect(_diskFilePath, _processedFileInfo.Attrib);
+ PrintNewLine();
+ return S_OK;
+}
+
+
+STDMETHODIMP CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password)
+{
+ if (!PasswordIsDefined)
+ {
+ // You can ask real password here from user
+ // Password = GetPassword(OutStream);
+ // PasswordIsDefined = true;
+ PrintError("Password is not defined");
+ return E_ABORT;
+ }
+ return StringToBstr(Password, password);
+}
+
+
+
+//////////////////////////////////////////////////////////////
+// Archive Creating callback class
+
+struct CDirItem
+{
+ UInt64 Size;
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+ UString Name;
+ FString FullPath;
+ UInt32 Attrib;
+
+ bool isDir() const { return (Attrib & FILE_ATTRIBUTE_DIRECTORY) != 0 ; }
+};
+
+class CArchiveUpdateCallback:
+ public IArchiveUpdateCallback2,
+ public ICryptoGetTextPassword2,
+ public CMyUnknownImp
+{
+public:
+ MY_UNKNOWN_IMP2(IArchiveUpdateCallback2, ICryptoGetTextPassword2)
+
+ // IProgress
+ STDMETHOD(SetTotal)(UInt64 size);
+ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
+
+ // IUpdateCallback2
+ STDMETHOD(GetUpdateItemInfo)(UInt32 index,
+ Int32 *newData, Int32 *newProperties, UInt32 *indexInArchive);
+ STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value);
+ STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **inStream);
+ STDMETHOD(SetOperationResult)(Int32 operationResult);
+ STDMETHOD(GetVolumeSize)(UInt32 index, UInt64 *size);
+ STDMETHOD(GetVolumeStream)(UInt32 index, ISequentialOutStream **volumeStream);
+
+ STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password);
+
+public:
+ CRecordVector<UInt64> VolumesSizes;
+ UString VolName;
+ UString VolExt;
+
+ FString DirPrefix;
+ const CObjectVector<CDirItem> *DirItems;
+
+ bool PasswordIsDefined;
+ UString Password;
+ bool AskPassword;
+
+ bool m_NeedBeClosed;
+
+ FStringVector FailedFiles;
+ CRecordVector<HRESULT> FailedCodes;
+
+ CArchiveUpdateCallback(): PasswordIsDefined(false), AskPassword(false), DirItems(0) {};
+
+ ~CArchiveUpdateCallback() { Finilize(); }
+ HRESULT Finilize();
+
+ void Init(const CObjectVector<CDirItem> *dirItems)
+ {
+ DirItems = dirItems;
+ m_NeedBeClosed = false;
+ FailedFiles.Clear();
+ FailedCodes.Clear();
+ }
+};
+
+STDMETHODIMP CArchiveUpdateCallback::SetTotal(UInt64 /* size */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::SetCompleted(const UInt64 * /* completeValue */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetUpdateItemInfo(UInt32 /* index */,
+ Int32 *newData, Int32 *newProperties, UInt32 *indexInArchive)
+{
+ if (newData)
+ *newData = BoolToInt(true);
+ if (newProperties)
+ *newProperties = BoolToInt(true);
+ if (indexInArchive)
+ *indexInArchive = (UInt32)(Int32)-1;
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+
+ if (propID == kpidIsAnti)
+ {
+ prop = false;
+ prop.Detach(value);
+ return S_OK;
+ }
+
+ {
+ const CDirItem &dirItem = (*DirItems)[index];
+ switch (propID)
+ {
+ case kpidPath: prop = dirItem.Name; break;
+ case kpidIsDir: prop = dirItem.isDir(); break;
+ case kpidSize: prop = dirItem.Size; break;
+ case kpidAttrib: prop = dirItem.Attrib; break;
+ case kpidCTime: prop = dirItem.CTime; break;
+ case kpidATime: prop = dirItem.ATime; break;
+ case kpidMTime: prop = dirItem.MTime; break;
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+HRESULT CArchiveUpdateCallback::Finilize()
+{
+ if (m_NeedBeClosed)
+ {
+ PrintNewLine();
+ m_NeedBeClosed = false;
+ }
+ return S_OK;
+}
+
+static void GetStream2(const wchar_t *name)
+{
+ Print("Compressing ");
+ if (name[0] == 0)
+ name = kEmptyFileAlias;
+ Print(name);
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetStream(UInt32 index, ISequentialInStream **inStream)
+{
+ RINOK(Finilize());
+
+ const CDirItem &dirItem = (*DirItems)[index];
+ GetStream2(dirItem.Name);
+
+ if (dirItem.isDir())
+ return S_OK;
+
+ {
+ CInFileStream *inStreamSpec = new CInFileStream;
+ CMyComPtr<ISequentialInStream> inStreamLoc(inStreamSpec);
+ FString path = DirPrefix + dirItem.FullPath;
+ if (!inStreamSpec->Open(path))
+ {
+ DWORD sysError = ::GetLastError();
+ FailedCodes.Add(sysError);
+ FailedFiles.Add(path);
+ // if (systemError == ERROR_SHARING_VIOLATION)
+ {
+ PrintNewLine();
+ PrintError("WARNING: can't open file");
+ // Print(NError::MyFormatMessageW(systemError));
+ return S_FALSE;
+ }
+ // return sysError;
+ }
+ *inStream = inStreamLoc.Detach();
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::SetOperationResult(Int32 /* operationResult */)
+{
+ m_NeedBeClosed = true;
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetVolumeSize(UInt32 index, UInt64 *size)
+{
+ if (VolumesSizes.Size() == 0)
+ return S_FALSE;
+ if (index >= (UInt32)VolumesSizes.Size())
+ index = VolumesSizes.Size() - 1;
+ *size = VolumesSizes[index];
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetVolumeStream(UInt32 index, ISequentialOutStream **volumeStream)
+{
+ wchar_t temp[16];
+ ConvertUInt32ToString(index + 1, temp);
+ UString res = temp;
+ while (res.Len() < 2)
+ res.InsertAtFront(L'0');
+ UString fileName = VolName;
+ fileName += '.';
+ fileName += res;
+ fileName += VolExt;
+ COutFileStream *streamSpec = new COutFileStream;
+ CMyComPtr<ISequentialOutStream> streamLoc(streamSpec);
+ if (!streamSpec->Create(us2fs(fileName), false))
+ return ::GetLastError();
+ *volumeStream = streamLoc.Detach();
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password)
+{
+ if (!PasswordIsDefined)
+ {
+ if (AskPassword)
+ {
+ // You can ask real password here from user
+ // Password = GetPassword(OutStream);
+ // PasswordIsDefined = true;
+ PrintError("Password is not defined");
+ return E_ABORT;
+ }
+ }
+ *passwordIsDefined = BoolToInt(PasswordIsDefined);
+ return StringToBstr(Password, password);
+}
+
+
+// Main function
+
+#define NT_CHECK_FAIL_ACTION PrintError("Unsupported Windows version"); return 1;
+
+int MY_CDECL main(int numArgs, const char *args[])
+{
+ NT_CHECK
+
+ PrintStringLn(kCopyrightString);
+
+ if (numArgs < 2)
+ {
+ PrintStringLn(kHelpString);
+ return 0;
+ }
+
+ if (numArgs < 3)
+ {
+ PrintError(kIncorrectCommand);
+ return 1;
+ }
+
+
+ NDLL::CLibrary lib;
+ if (!lib.Load(NDLL::GetModuleDirPrefix() + FTEXT(kDllName)))
+ {
+ PrintError("Can not load 7-zip library");
+ return 1;
+ }
+
+ Func_CreateObject createObjectFunc = (Func_CreateObject)lib.GetProc("CreateObject");
+ if (!createObjectFunc)
+ {
+ PrintError("Can not get CreateObject");
+ return 1;
+ }
+
+ char c;
+ {
+ AString command (args[1]);
+ if (command.Len() != 1)
+ {
+ PrintError(kIncorrectCommand);
+ return 1;
+ }
+ c = (char)MyCharLower_Ascii(command[0]);
+ }
+
+ FString archiveName = CmdStringToFString(args[2]);
+
+ if (c == 'a')
+ {
+ // create archive command
+ if (numArgs < 4)
+ {
+ PrintError(kIncorrectCommand);
+ return 1;
+ }
+ CObjectVector<CDirItem> dirItems;
+ {
+ int i;
+ for (i = 3; i < numArgs; i++)
+ {
+ CDirItem di;
+ FString name = CmdStringToFString(args[i]);
+
+ NFind::CFileInfo fi;
+ if (!fi.Find(name))
+ {
+ PrintError("Can't find file", name);
+ return 1;
+ }
+
+ di.Attrib = fi.Attrib;
+ di.Size = fi.Size;
+ di.CTime = fi.CTime;
+ di.ATime = fi.ATime;
+ di.MTime = fi.MTime;
+ di.Name = fs2us(name);
+ di.FullPath = name;
+ dirItems.Add(di);
+ }
+ }
+
+ COutFileStream *outFileStreamSpec = new COutFileStream;
+ CMyComPtr<IOutStream> outFileStream = outFileStreamSpec;
+ if (!outFileStreamSpec->Create(archiveName, false))
+ {
+ PrintError("can't create archive file");
+ return 1;
+ }
+
+ CMyComPtr<IOutArchive> outArchive;
+ if (createObjectFunc(&CLSID_Format, &IID_IOutArchive, (void **)&outArchive) != S_OK)
+ {
+ PrintError("Can not get class object");
+ return 1;
+ }
+
+ CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback;
+ CMyComPtr<IArchiveUpdateCallback2> updateCallback(updateCallbackSpec);
+ updateCallbackSpec->Init(&dirItems);
+ // updateCallbackSpec->PasswordIsDefined = true;
+ // updateCallbackSpec->Password = L"1";
+
+ /*
+ {
+ const wchar_t *names[] =
+ {
+ L"s",
+ L"x"
+ };
+ const unsigned kNumProps = ARRAY_SIZE(names);
+ NCOM::CPropVariant values[kNumProps] =
+ {
+ false, // solid mode OFF
+ (UInt32)9 // compression level = 9 - ultra
+ };
+ CMyComPtr<ISetProperties> setProperties;
+ outArchive->QueryInterface(IID_ISetProperties, (void **)&setProperties);
+ if (!setProperties)
+ {
+ PrintError("ISetProperties unsupported");
+ return 1;
+ }
+ RINOK(setProperties->SetProperties(names, values, kNumProps));
+ }
+ */
+
+ HRESULT result = outArchive->UpdateItems(outFileStream, dirItems.Size(), updateCallback);
+
+ updateCallbackSpec->Finilize();
+
+ if (result != S_OK)
+ {
+ PrintError("Update Error");
+ return 1;
+ }
+
+ FOR_VECTOR (i, updateCallbackSpec->FailedFiles)
+ {
+ PrintNewLine();
+ PrintError("Error for file", updateCallbackSpec->FailedFiles[i]);
+ }
+
+ if (updateCallbackSpec->FailedFiles.Size() != 0)
+ return 1;
+ }
+ else
+ {
+ if (numArgs != 3)
+ {
+ PrintError(kIncorrectCommand);
+ return 1;
+ }
+
+ bool listCommand;
+
+ if (c == 'l')
+ listCommand = true;
+ else if (c == 'x')
+ listCommand = false;
+ else
+ {
+ PrintError(kIncorrectCommand);
+ return 1;
+ }
+
+ CMyComPtr<IInArchive> archive;
+ if (createObjectFunc(&CLSID_Format, &IID_IInArchive, (void **)&archive) != S_OK)
+ {
+ PrintError("Can not get class object");
+ return 1;
+ }
+
+ CInFileStream *fileSpec = new CInFileStream;
+ CMyComPtr<IInStream> file = fileSpec;
+
+ if (!fileSpec->Open(archiveName))
+ {
+ PrintError("Can not open archive file", archiveName);
+ return 1;
+ }
+
+ {
+ CArchiveOpenCallback *openCallbackSpec = new CArchiveOpenCallback;
+ CMyComPtr<IArchiveOpenCallback> openCallback(openCallbackSpec);
+ openCallbackSpec->PasswordIsDefined = false;
+ // openCallbackSpec->PasswordIsDefined = true;
+ // openCallbackSpec->Password = L"1";
+
+ const UInt64 scanSize = 1 << 23;
+ if (archive->Open(file, &scanSize, openCallback) != S_OK)
+ {
+ PrintError("Can not open file as archive", archiveName);
+ return 1;
+ }
+ }
+
+ if (listCommand)
+ {
+ // List command
+ UInt32 numItems = 0;
+ archive->GetNumberOfItems(&numItems);
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ {
+ // Get uncompressed size of file
+ NCOM::CPropVariant prop;
+ archive->GetProperty(i, kpidSize, &prop);
+ char s[32];
+ ConvertPropVariantToShortString(prop, s);
+ Print(s);
+ Print(" ");
+ }
+ {
+ // Get name of file
+ NCOM::CPropVariant prop;
+ archive->GetProperty(i, kpidPath, &prop);
+ if (prop.vt == VT_BSTR)
+ Print(prop.bstrVal);
+ else if (prop.vt != VT_EMPTY)
+ Print("ERROR!");
+ }
+ PrintNewLine();
+ }
+ }
+ else
+ {
+ // Extract command
+ CArchiveExtractCallback *extractCallbackSpec = new CArchiveExtractCallback;
+ CMyComPtr<IArchiveExtractCallback> extractCallback(extractCallbackSpec);
+ extractCallbackSpec->Init(archive, FString()); // second parameter is output folder path
+ extractCallbackSpec->PasswordIsDefined = false;
+ // extractCallbackSpec->PasswordIsDefined = true;
+ // extractCallbackSpec->Password = "1";
+
+ /*
+ const wchar_t *names[] =
+ {
+ L"mt",
+ L"mtf"
+ };
+ const unsigned kNumProps = sizeof(names) / sizeof(names[0]);
+ NCOM::CPropVariant values[kNumProps] =
+ {
+ (UInt32)1,
+ false
+ };
+ CMyComPtr<ISetProperties> setProperties;
+ archive->QueryInterface(IID_ISetProperties, (void **)&setProperties);
+ if (setProperties)
+ setProperties->SetProperties(names, values, kNumProps);
+ */
+
+ HRESULT result = archive->Extract(NULL, (UInt32)(Int32)(-1), false, extractCallback);
+
+ if (result != S_OK)
+ {
+ PrintError("Extract Error");
+ return 1;
+ }
+ }
+ }
+
+ return 0;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsp b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsp
new file mode 100644
index 0000000000..d9ec4caf63
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsp
@@ -0,0 +1,235 @@
+# Microsoft Developer Studio Project File - Name="Client7z" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=Client7z - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "Client7z.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "Client7z.mak" CFG="Client7z - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "Client7z - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "Client7z - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "Client7z - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MD /W4 /WX /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
+# ADD BASE RSC /l 0x419 /d "NDEBUG"
+# ADD RSC /l 0x419 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 /out:"Release/7zcl.exe"
+
+!ELSEIF "$(CFG)" == "Client7z - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD CPP /nologo /MDd /W4 /WX /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
+# ADD BASE RSC /l 0x419 /d "_DEBUG"
+# ADD RSC /l 0x419 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/7zcl.exe" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "Client7z - Win32 Release"
+# Name "Client7z - Win32 Debug"
+# Begin Group "Spec"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\resource.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Windows"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\DLL.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileDir.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileFind.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileIO.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\FileName.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariant.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Windows\PropVariantConv.h
+# End Source File
+# End Group
+# Begin Group "Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\IntToString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyString.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\MyVector.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\NewHandler.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\StringConvert.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\Common\Wildcard.h
+# End Source File
+# End Group
+# Begin Group "7zip Common"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\Common\FileStreams.h
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\Client7z.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\C\Sort.h
+# End Source File
+# End Target
+# End Project
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsw b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsw
new file mode 100644
index 0000000000..4c26851183
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/Client7z.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "Client7z"=.\Client7z.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/makefile b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/makefile
new file mode 100644
index 0000000000..9f68f16720
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/makefile
@@ -0,0 +1,28 @@
+PROG = 7zcl.exe
+MY_CONSOLE = 1
+
+CURRENT_OBJS = \
+ $O\Client7z.obj \
+
+COMMON_OBJS = \
+ $O\IntToString.obj \
+ $O\NewHandler.obj \
+ $O\MyString.obj \
+ $O\StringConvert.obj \
+ $O\StringToInt.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+
+WIN_OBJS = \
+ $O\DLL.obj \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileName.obj \
+ $O\PropVariant.obj \
+ $O\PropVariantConv.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\FileStreams.obj \
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/resource.rc b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/resource.rc
new file mode 100644
index 0000000000..701a783e01
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Client7z/resource.rc
@@ -0,0 +1,3 @@
+#include "../../MyVersionInfo.rc"
+
+MY_VERSION_INFO_APP("7-Zip client" , "7zcl")
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
new file mode 100644
index 0000000000..f14aafbafa
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
@@ -0,0 +1,1281 @@
+// ArchiveCommandLine.cpp
+
+#include "StdAfx.h"
+#undef printf
+#undef sprintf
+
+#ifdef _WIN32
+#ifndef UNDER_CE
+#include <io.h>
+#endif
+#else
+// for isatty()
+#include <unistd.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef _7ZIP_LARGE_PAGES
+#include "../../../../C/Alloc.h"
+#endif
+
+#include "../../../Common/ListFileUtils.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/StringToInt.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileName.h"
+#ifdef _WIN32
+#include "../../../Windows/FileMapping.h"
+#include "../../../Windows/MemoryLock.h"
+#include "../../../Windows/Synchronization.h"
+#endif
+
+#include "ArchiveCommandLine.h"
+#include "EnumDirItems.h"
+#include "Update.h"
+#include "UpdateAction.h"
+
+extern bool g_CaseSensitive;
+extern bool g_PathTrailReplaceMode;
+
+bool g_LargePagesMode = false;
+
+#ifdef UNDER_CE
+
+#define MY_IS_TERMINAL(x) false;
+
+#else
+
+#if _MSC_VER >= 1400
+#define MY_isatty_fileno(x) _isatty(_fileno(x))
+#else
+#define MY_isatty_fileno(x) isatty(fileno(x))
+#endif
+
+#define MY_IS_TERMINAL(x) (MY_isatty_fileno(x) != 0);
+
+#endif
+
+using namespace NCommandLineParser;
+using namespace NWindows;
+using namespace NFile;
+
+static bool StringToUInt32(const wchar_t *s, UInt32 &v)
+{
+ if (*s == 0)
+ return false;
+ const wchar_t *end;
+ v = ConvertStringToUInt32(s, &end);
+ return *end == 0;
+}
+
+
+int g_CodePage = -1;
+
+namespace NKey {
+enum Enum
+{
+ kHelp1 = 0,
+ kHelp2,
+ kHelp3,
+
+ kDisableHeaders,
+ kDisablePercents,
+ kShowTime,
+ kLogLevel,
+
+ kOutStream,
+ kErrStream,
+ kPercentStream,
+
+ kYes,
+
+ kShowDialog,
+ kOverwrite,
+
+ kArchiveType,
+ kExcludedArcType,
+
+ kProperty,
+ kOutputDir,
+ kWorkingDir,
+
+ kInclude,
+ kExclude,
+ kArInclude,
+ kArExclude,
+ kNoArName,
+
+ kUpdate,
+ kVolume,
+ kRecursed,
+
+ kAffinity,
+ kSfx,
+ kEmail,
+ kHash,
+
+ kStdIn,
+ kStdOut,
+
+ kLargePages,
+ kListfileCharSet,
+ kConsoleCharSet,
+ kTechMode,
+
+ kShareForWrite,
+ kStopAfterOpenError,
+ kCaseSensitive,
+ kArcNameMode,
+
+ kDisableWildcardParsing,
+ kElimDup,
+ kFullPathMode,
+
+ kHardLinks,
+ kSymLinks,
+ kNtSecurity,
+
+ kAltStreams,
+ kReplaceColonForAltStream,
+ kWriteToAltStreamIfColon,
+
+ kNameTrailReplace,
+
+ kDeleteAfterCompressing,
+ kSetArcMTime
+
+ #ifndef _NO_CRYPTO
+ , kPassword
+ #endif
+};
+
+}
+
+
+static const wchar_t kRecursedIDChar = 'r';
+static const char * const kRecursedPostCharSet = "0-";
+
+static const char * const k_ArcNameMode_PostCharSet = "sea";
+
+static const char * const k_Stream_PostCharSet = "012";
+
+static inline const EArcNameMode ParseArcNameMode(int postCharIndex)
+{
+ switch (postCharIndex)
+ {
+ case 1: return k_ArcNameMode_Exact;
+ case 2: return k_ArcNameMode_Add;
+ default: return k_ArcNameMode_Smart;
+ }
+}
+
+namespace NRecursedPostCharIndex {
+ enum EEnum
+ {
+ kWildcardRecursionOnly = 0,
+ kNoRecursion = 1
+ };
+}
+
+static const char kImmediateNameID = '!';
+static const char kMapNameID = '#';
+static const char kFileListID = '@';
+
+static const char kSomeCludePostStringMinSize = 2; // at least <@|!><N>ame must be
+static const char kSomeCludeAfterRecursedPostStringMinSize = 2; // at least <@|!><N>ame must be
+
+static const char * const kOverwritePostCharSet = "asut";
+
+static const NExtract::NOverwriteMode::EEnum k_OverwriteModes[] =
+{
+ NExtract::NOverwriteMode::kOverwrite,
+ NExtract::NOverwriteMode::kSkip,
+ NExtract::NOverwriteMode::kRename,
+ NExtract::NOverwriteMode::kRenameExisting
+};
+
+static const CSwitchForm kSwitchForms[] =
+{
+ { "?" },
+ { "h" },
+ { "-help" },
+
+ { "ba" },
+ { "bd" },
+ { "bt" },
+ { "bb", NSwitchType::kString, false, 0 },
+
+ { "bso", NSwitchType::kChar, false, 1, k_Stream_PostCharSet },
+ { "bse", NSwitchType::kChar, false, 1, k_Stream_PostCharSet },
+ { "bsp", NSwitchType::kChar, false, 1, k_Stream_PostCharSet },
+
+ { "y" },
+
+ { "ad" },
+ { "ao", NSwitchType::kChar, false, 1, kOverwritePostCharSet},
+
+ { "t", NSwitchType::kString, false, 1 },
+ { "stx", NSwitchType::kString, true, 1 },
+
+ { "m", NSwitchType::kString, true, 1 },
+ { "o", NSwitchType::kString, false, 1 },
+ { "w", NSwitchType::kString },
+
+ { "i", NSwitchType::kString, true, kSomeCludePostStringMinSize},
+ { "x", NSwitchType::kString, true, kSomeCludePostStringMinSize},
+ { "ai", NSwitchType::kString, true, kSomeCludePostStringMinSize},
+ { "ax", NSwitchType::kString, true, kSomeCludePostStringMinSize},
+ { "an" },
+
+ { "u", NSwitchType::kString, true, 1},
+ { "v", NSwitchType::kString, true, 1},
+ { "r", NSwitchType::kChar, false, 0, kRecursedPostCharSet },
+
+ { "stm", NSwitchType::kString },
+ { "sfx", NSwitchType::kString },
+ { "seml", NSwitchType::kString, false, 0},
+ { "scrc", NSwitchType::kString, true, 0 },
+
+ { "si", NSwitchType::kString },
+ { "so" },
+
+ { "slp", NSwitchType::kString },
+ { "scs", NSwitchType::kString },
+ { "scc", NSwitchType::kString },
+ { "slt" },
+
+ { "ssw" },
+ { "sse" },
+ { "ssc", NSwitchType::kMinus },
+ { "sa", NSwitchType::kChar, false, 1, k_ArcNameMode_PostCharSet },
+
+ { "spd" },
+ { "spe", NSwitchType::kMinus },
+ { "spf", NSwitchType::kString, false, 0 },
+
+ { "snh", NSwitchType::kMinus },
+ { "snl", NSwitchType::kMinus },
+ { "sni" },
+
+ { "sns", NSwitchType::kMinus },
+ { "snr" },
+ { "snc" },
+
+ { "snt", NSwitchType::kMinus },
+
+ { "sdel" },
+ { "stl" }
+
+ #ifndef _NO_CRYPTO
+ , { "p", NSwitchType::kString }
+ #endif
+};
+
+static const char * const kUniversalWildcard = "*";
+static const unsigned kMinNonSwitchWords = 1;
+static const unsigned kCommandIndex = 0;
+
+// static const char * const kUserErrorMessage = "Incorrect command line";
+static const char * const kCannotFindListFile = "Cannot find listfile";
+static const char * const kIncorrectListFile = "Incorrect item in listfile.\nCheck charset encoding and -scs switch.";
+static const char * const kTerminalOutError = "I won't write compressed data to a terminal";
+static const char * const kSameTerminalError = "I won't write data and program's messages to same stream";
+static const char * const kEmptyFilePath = "Empty file path";
+
+bool CArcCommand::IsFromExtractGroup() const
+{
+ switch (CommandType)
+ {
+ case NCommandType::kTest:
+ case NCommandType::kExtract:
+ case NCommandType::kExtractFull:
+ return true;
+ }
+ return false;
+}
+
+NExtract::NPathMode::EEnum CArcCommand::GetPathMode() const
+{
+ switch (CommandType)
+ {
+ case NCommandType::kTest:
+ case NCommandType::kExtractFull:
+ return NExtract::NPathMode::kFullPaths;
+ }
+ return NExtract::NPathMode::kNoPaths;
+}
+
+bool CArcCommand::IsFromUpdateGroup() const
+{
+ switch (CommandType)
+ {
+ case NCommandType::kAdd:
+ case NCommandType::kUpdate:
+ case NCommandType::kDelete:
+ case NCommandType::kRename:
+ return true;
+ }
+ return false;
+}
+
+static NRecursedType::EEnum GetRecursedTypeFromIndex(int index)
+{
+ switch (index)
+ {
+ case NRecursedPostCharIndex::kWildcardRecursionOnly:
+ return NRecursedType::kWildcardOnlyRecursed;
+ case NRecursedPostCharIndex::kNoRecursion:
+ return NRecursedType::kNonRecursed;
+ default:
+ return NRecursedType::kRecursed;
+ }
+}
+
+static const char *g_Commands = "audtexlbih";
+
+static bool ParseArchiveCommand(const UString &commandString, CArcCommand &command)
+{
+ UString s (commandString);
+ s.MakeLower_Ascii();
+ if (s.Len() == 1)
+ {
+ if (s[0] > 0x7F)
+ return false;
+ int index = FindCharPosInString(g_Commands, (char)s[0]);
+ if (index < 0)
+ return false;
+ command.CommandType = (NCommandType::EEnum)index;
+ return true;
+ }
+ if (s.Len() == 2 && s[0] == 'r' && s[1] == 'n')
+ {
+ command.CommandType = (NCommandType::kRename);
+ return true;
+ }
+ return false;
+}
+
+// ------------------------------------------------------------------
+// filenames functions
+
+static void AddNameToCensor(NWildcard::CCensor &censor,
+ const UString &name, bool include, NRecursedType::EEnum type, bool wildcardMatching)
+{
+ bool recursed = false;
+
+ switch (type)
+ {
+ case NRecursedType::kWildcardOnlyRecursed:
+ recursed = DoesNameContainWildcard(name);
+ break;
+ case NRecursedType::kRecursed:
+ recursed = true;
+ break;
+ }
+ censor.AddPreItem(include, name, recursed, wildcardMatching);
+}
+
+static void AddRenamePair(CObjectVector<CRenamePair> *renamePairs,
+ const UString &oldName, const UString &newName, NRecursedType::EEnum type,
+ bool wildcardMatching)
+{
+ CRenamePair &pair = renamePairs->AddNew();
+ pair.OldName = oldName;
+ pair.NewName = newName;
+ pair.RecursedType = type;
+ pair.WildcardParsing = wildcardMatching;
+
+ if (!pair.Prepare())
+ {
+ UString val;
+ val += pair.OldName;
+ val.Add_LF();
+ val += pair.NewName;
+ val.Add_LF();
+ if (type == NRecursedType::kRecursed)
+ val += "-r";
+ else if (type == NRecursedType::kWildcardOnlyRecursed)
+ val += "-r0";
+ throw CArcCmdLineException("Unsupported rename command:", val);
+ }
+}
+
+static void AddToCensorFromListFile(
+ CObjectVector<CRenamePair> *renamePairs,
+ NWildcard::CCensor &censor,
+ LPCWSTR fileName, bool include, NRecursedType::EEnum type, bool wildcardMatching, Int32 codePage)
+{
+ UStringVector names;
+ if (!NFind::DoesFileExist(us2fs(fileName)))
+ throw CArcCmdLineException(kCannotFindListFile, fileName);
+ if (!ReadNamesFromListFile(us2fs(fileName), names, codePage))
+ throw CArcCmdLineException(kIncorrectListFile, fileName);
+ if (renamePairs)
+ {
+ if ((names.Size() & 1) != 0)
+ throw CArcCmdLineException(kIncorrectListFile, fileName);
+ for (unsigned i = 0; i < names.Size(); i += 2)
+ {
+ // change type !!!!
+ AddRenamePair(renamePairs, names[i], names[i + 1], type, wildcardMatching);
+ }
+ }
+ else
+ FOR_VECTOR (i, names)
+ AddNameToCensor(censor, names[i], include, type, wildcardMatching);
+}
+
+static void AddToCensorFromNonSwitchesStrings(
+ CObjectVector<CRenamePair> *renamePairs,
+ unsigned startIndex,
+ NWildcard::CCensor &censor,
+ const UStringVector &nonSwitchStrings,
+ int stopSwitchIndex,
+ NRecursedType::EEnum type,
+ bool wildcardMatching,
+ bool thereAreSwitchIncludes, Int32 codePage)
+{
+ if ((renamePairs || nonSwitchStrings.Size() == startIndex) && !thereAreSwitchIncludes)
+ AddNameToCensor(censor, UString(kUniversalWildcard), true, type,
+ true // wildcardMatching
+ );
+
+ int oldIndex = -1;
+
+ if (stopSwitchIndex < 0)
+ stopSwitchIndex = nonSwitchStrings.Size();
+
+ for (unsigned i = startIndex; i < nonSwitchStrings.Size(); i++)
+ {
+ const UString &s = nonSwitchStrings[i];
+ if (s.IsEmpty())
+ throw CArcCmdLineException(kEmptyFilePath);
+ if (i < (unsigned)stopSwitchIndex && s[0] == kFileListID)
+ AddToCensorFromListFile(renamePairs, censor, s.Ptr(1), true, type, wildcardMatching, codePage);
+ else if (renamePairs)
+ {
+ if (oldIndex == -1)
+ oldIndex = i;
+ else
+ {
+ // NRecursedType::EEnum type is used for global wildcard (-i! switches)
+ AddRenamePair(renamePairs, nonSwitchStrings[oldIndex], s, NRecursedType::kNonRecursed, wildcardMatching);
+ // AddRenamePair(renamePairs, nonSwitchStrings[oldIndex], s, type);
+ oldIndex = -1;
+ }
+ }
+ else
+ AddNameToCensor(censor, s, true, type, wildcardMatching);
+ }
+
+ if (oldIndex != -1)
+ {
+ throw CArcCmdLineException("There is no second file name for rename pair:", nonSwitchStrings[oldIndex]);
+ }
+}
+
+#ifdef _WIN32
+
+struct CEventSetEnd
+{
+ UString Name;
+
+ CEventSetEnd(const wchar_t *name): Name(name) {}
+ ~CEventSetEnd()
+ {
+ NSynchronization::CManualResetEvent event;
+ if (event.Open(EVENT_MODIFY_STATE, false, GetSystemString(Name)) == 0)
+ event.Set();
+ }
+};
+
+static const char * const k_IncorrectMapCommand = "Incorrect Map command";
+
+static const char *ParseMapWithPaths(
+ NWildcard::CCensor &censor,
+ const UString &s2, bool include,
+ NRecursedType::EEnum commonRecursedType,
+ bool wildcardMatching)
+{
+ UString s (s2);
+ int pos = s.Find(L':');
+ if (pos < 0)
+ return k_IncorrectMapCommand;
+ int pos2 = s.Find(L':', pos + 1);
+ if (pos2 < 0)
+ return k_IncorrectMapCommand;
+
+ CEventSetEnd eventSetEnd((const wchar_t *)s + ((unsigned)pos2 + 1));
+ s.DeleteFrom(pos2);
+ UInt32 size;
+ if (!StringToUInt32(s.Ptr(pos + 1), size)
+ || size < sizeof(wchar_t)
+ || size > ((UInt32)1 << 31)
+ || size % sizeof(wchar_t) != 0)
+ return "Unsupported Map data size";
+
+ s.DeleteFrom(pos);
+ CFileMapping map;
+ if (map.Open(FILE_MAP_READ, GetSystemString(s)) != 0)
+ return "Can not open mapping";
+ LPVOID data = map.Map(FILE_MAP_READ, 0, size);
+ if (!data)
+ return "MapViewOfFile error";
+ CFileUnmapper unmapper(data);
+
+ UString name;
+ const wchar_t *p = (const wchar_t *)data;
+ if (*p != 0) // data format marker
+ return "Unsupported Map data";
+ UInt32 numChars = size / sizeof(wchar_t);
+ for (UInt32 i = 1; i < numChars; i++)
+ {
+ wchar_t c = p[i];
+ if (c == 0)
+ {
+ // MessageBoxW(0, name, L"7-Zip", 0);
+ AddNameToCensor(censor, name, include, commonRecursedType, wildcardMatching);
+ name.Empty();
+ }
+ else
+ name += c;
+ }
+ if (!name.IsEmpty())
+ return "Map data error";
+
+ return NULL;
+}
+
+#endif
+
+static void AddSwitchWildcardsToCensor(
+ NWildcard::CCensor &censor,
+ const UStringVector &strings, bool include,
+ NRecursedType::EEnum commonRecursedType,
+ bool wildcardMatching,
+ Int32 codePage)
+{
+ const char *errorMessage = NULL;
+ unsigned i;
+ for (i = 0; i < strings.Size(); i++)
+ {
+ const UString &name = strings[i];
+ NRecursedType::EEnum recursedType;
+ unsigned pos = 0;
+
+ if (name.Len() < kSomeCludePostStringMinSize)
+ {
+ errorMessage = "Too short switch";
+ break;
+ }
+
+ if (::MyCharLower_Ascii(name[pos]) == kRecursedIDChar)
+ {
+ pos++;
+ wchar_t c = name[pos];
+ int index = -1;
+ if (c <= 0x7F)
+ index = FindCharPosInString(kRecursedPostCharSet, (char)c);
+ recursedType = GetRecursedTypeFromIndex(index);
+ if (index >= 0)
+ pos++;
+ }
+ else
+ recursedType = commonRecursedType;
+
+ if (name.Len() < pos + kSomeCludeAfterRecursedPostStringMinSize)
+ {
+ errorMessage = "Too short switch";
+ break;
+ }
+
+ const UString tail = name.Ptr(pos + 1);
+
+ if (name[pos] == kImmediateNameID)
+ AddNameToCensor(censor, tail, include, recursedType, wildcardMatching);
+ else if (name[pos] == kFileListID)
+ AddToCensorFromListFile(NULL, censor, tail, include, recursedType, wildcardMatching, codePage);
+ #ifdef _WIN32
+ else if (name[pos] == kMapNameID)
+ {
+ errorMessage = ParseMapWithPaths(censor, tail, include, recursedType, wildcardMatching);
+ if (errorMessage)
+ break;
+ }
+ #endif
+ else
+ {
+ errorMessage = "Incorrect wildcard type marker";
+ break;
+ }
+ }
+ if (i != strings.Size())
+ throw CArcCmdLineException(errorMessage, strings[i]);
+}
+
+/*
+static NUpdateArchive::NPairAction::EEnum GetUpdatePairActionType(int i)
+{
+ switch (i)
+ {
+ case NUpdateArchive::NPairAction::kIgnore: return NUpdateArchive::NPairAction::kIgnore;
+ case NUpdateArchive::NPairAction::kCopy: return NUpdateArchive::NPairAction::kCopy;
+ case NUpdateArchive::NPairAction::kCompress: return NUpdateArchive::NPairAction::kCompress;
+ case NUpdateArchive::NPairAction::kCompressAsAnti: return NUpdateArchive::NPairAction::kCompressAsAnti;
+ }
+ throw 98111603;
+}
+*/
+
+static const char * const kUpdatePairStateIDSet = "pqrxyzw";
+static const int kUpdatePairStateNotSupportedActions[] = {2, 2, 1, -1, -1, -1, -1};
+
+static const unsigned kNumUpdatePairActions = 4;
+static const char * const kUpdateIgnoreItselfPostStringID = "-";
+static const wchar_t kUpdateNewArchivePostCharID = '!';
+
+
+static bool ParseUpdateCommandString2(const UString &command,
+ NUpdateArchive::CActionSet &actionSet, UString &postString)
+{
+ for (unsigned i = 0; i < command.Len();)
+ {
+ wchar_t c = MyCharLower_Ascii(command[i]);
+ int statePos = FindCharPosInString(kUpdatePairStateIDSet, (char)c);
+ if (c > 0x7F || statePos < 0)
+ {
+ postString = command.Ptr(i);
+ return true;
+ }
+ i++;
+ if (i >= command.Len())
+ return false;
+ c = command[i];
+ if (c < '0' || c >= '0' + kNumUpdatePairActions)
+ return false;
+ unsigned actionPos = c - '0';
+ actionSet.StateActions[(unsigned)statePos] = (NUpdateArchive::NPairAction::EEnum)(actionPos);
+ if (kUpdatePairStateNotSupportedActions[(unsigned)statePos] == (int)actionPos)
+ return false;
+ i++;
+ }
+ postString.Empty();
+ return true;
+}
+
+static void ParseUpdateCommandString(CUpdateOptions &options,
+ const UStringVector &updatePostStrings,
+ const NUpdateArchive::CActionSet &defaultActionSet)
+{
+ const char *errorMessage = "incorrect update switch command";
+ unsigned i;
+ for (i = 0; i < updatePostStrings.Size(); i++)
+ {
+ const UString &updateString = updatePostStrings[i];
+ if (updateString.IsEqualTo(kUpdateIgnoreItselfPostStringID))
+ {
+ if (options.UpdateArchiveItself)
+ {
+ options.UpdateArchiveItself = false;
+ options.Commands.Delete(0);
+ }
+ }
+ else
+ {
+ NUpdateArchive::CActionSet actionSet = defaultActionSet;
+
+ UString postString;
+ if (!ParseUpdateCommandString2(updateString, actionSet, postString))
+ break;
+ if (postString.IsEmpty())
+ {
+ if (options.UpdateArchiveItself)
+ options.Commands[0].ActionSet = actionSet;
+ }
+ else
+ {
+ if (postString[0] != kUpdateNewArchivePostCharID)
+ break;
+ CUpdateArchiveCommand uc;
+ UString archivePath = postString.Ptr(1);
+ if (archivePath.IsEmpty())
+ break;
+ uc.UserArchivePath = archivePath;
+ uc.ActionSet = actionSet;
+ options.Commands.Add(uc);
+ }
+ }
+ }
+ if (i != updatePostStrings.Size())
+ throw CArcCmdLineException(errorMessage, updatePostStrings[i]);
+}
+
+bool ParseComplexSize(const wchar_t *s, UInt64 &result);
+
+static void SetAddCommandOptions(
+ NCommandType::EEnum commandType,
+ const CParser &parser,
+ CUpdateOptions &options)
+{
+ NUpdateArchive::CActionSet defaultActionSet;
+ switch (commandType)
+ {
+ case NCommandType::kAdd:
+ defaultActionSet = NUpdateArchive::k_ActionSet_Add;
+ break;
+ case NCommandType::kDelete:
+ defaultActionSet = NUpdateArchive::k_ActionSet_Delete;
+ break;
+ default:
+ defaultActionSet = NUpdateArchive::k_ActionSet_Update;
+ }
+
+ options.UpdateArchiveItself = true;
+
+ options.Commands.Clear();
+ CUpdateArchiveCommand updateMainCommand;
+ updateMainCommand.ActionSet = defaultActionSet;
+ options.Commands.Add(updateMainCommand);
+ if (parser[NKey::kUpdate].ThereIs)
+ ParseUpdateCommandString(options, parser[NKey::kUpdate].PostStrings,
+ defaultActionSet);
+ if (parser[NKey::kWorkingDir].ThereIs)
+ {
+ const UString &postString = parser[NKey::kWorkingDir].PostStrings[0];
+ if (postString.IsEmpty())
+ NDir::MyGetTempPath(options.WorkingDir);
+ else
+ options.WorkingDir = us2fs(postString);
+ }
+ options.SfxMode = parser[NKey::kSfx].ThereIs;
+ if (options.SfxMode)
+ options.SfxModule = us2fs(parser[NKey::kSfx].PostStrings[0]);
+
+ if (parser[NKey::kVolume].ThereIs)
+ {
+ const UStringVector &sv = parser[NKey::kVolume].PostStrings;
+ FOR_VECTOR (i, sv)
+ {
+ UInt64 size;
+ if (!ParseComplexSize(sv[i], size) || size == 0)
+ throw CArcCmdLineException("Incorrect volume size:", sv[i]);
+ options.VolumesSizes.Add(size);
+ }
+ }
+}
+
+static void SetMethodOptions(const CParser &parser, CObjectVector<CProperty> &properties)
+{
+ if (parser[NKey::kProperty].ThereIs)
+ {
+ FOR_VECTOR (i, parser[NKey::kProperty].PostStrings)
+ {
+ CProperty prop;
+ prop.Name = parser[NKey::kProperty].PostStrings[i];
+ int index = prop.Name.Find(L'=');
+ if (index >= 0)
+ {
+ prop.Value = prop.Name.Ptr(index + 1);
+ prop.Name.DeleteFrom(index);
+ }
+ properties.Add(prop);
+ }
+ }
+}
+
+
+static inline void SetStreamMode(const CSwitchResult &sw, unsigned &res)
+{
+ if (sw.ThereIs)
+ res = sw.PostCharIndex;
+}
+
+
+void CArcCmdLineParser::Parse1(const UStringVector &commandStrings,
+ CArcCmdLineOptions &options)
+{
+ if (!parser.ParseStrings(kSwitchForms, ARRAY_SIZE(kSwitchForms), commandStrings))
+ throw CArcCmdLineException(parser.ErrorMessage, parser.ErrorLine);
+
+ options.IsInTerminal = MY_IS_TERMINAL(stdin);
+ options.IsStdOutTerminal = MY_IS_TERMINAL(stdout);
+ options.IsStdErrTerminal = MY_IS_TERMINAL(stderr);
+
+ options.HelpMode = parser[NKey::kHelp1].ThereIs || parser[NKey::kHelp2].ThereIs || parser[NKey::kHelp3].ThereIs;
+
+ options.StdInMode = parser[NKey::kStdIn].ThereIs;
+ options.StdOutMode = parser[NKey::kStdOut].ThereIs;
+ options.EnableHeaders = !parser[NKey::kDisableHeaders].ThereIs;
+ options.TechMode = parser[NKey::kTechMode].ThereIs;
+ options.ShowTime = parser[NKey::kShowTime].ThereIs;
+
+ if (parser[NKey::kDisablePercents].ThereIs
+ || options.StdOutMode
+ || !options.IsStdOutTerminal)
+ options.Number_for_Percents = k_OutStream_disabled;
+
+ if (options.StdOutMode)
+ options.Number_for_Out = k_OutStream_disabled;
+
+ SetStreamMode(parser[NKey::kOutStream], options.Number_for_Out);
+ SetStreamMode(parser[NKey::kErrStream], options.Number_for_Errors);
+ SetStreamMode(parser[NKey::kPercentStream], options.Number_for_Percents);
+
+ if (parser[NKey::kLogLevel].ThereIs)
+ {
+ const UString &s = parser[NKey::kLogLevel].PostStrings[0];
+ if (s.IsEmpty())
+ options.LogLevel = 1;
+ else
+ {
+ UInt32 v;
+ if (!StringToUInt32(s, v))
+ throw CArcCmdLineException("Unsupported switch postfix -bb", s);
+ options.LogLevel = (unsigned)v;
+ }
+ }
+
+ if (parser[NKey::kCaseSensitive].ThereIs)
+ {
+ g_CaseSensitive = !parser[NKey::kCaseSensitive].WithMinus;
+ options.CaseSensitiveChange = true;
+ options.CaseSensitive = g_CaseSensitive;
+ }
+
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ NSecurity::EnablePrivilege_SymLink();
+ #endif
+
+ // options.LargePages = false;
+
+ if (parser[NKey::kLargePages].ThereIs)
+ {
+ unsigned slp = 0;
+ const UString &s = parser[NKey::kLargePages].PostStrings[0];
+ if (s.IsEmpty())
+ slp = 1;
+ else if (s != L"-")
+ {
+ if (!StringToUInt32(s, slp))
+ throw CArcCmdLineException("Unsupported switch postfix for -slp", s);
+ }
+
+ #ifdef _7ZIP_LARGE_PAGES
+ if (slp >
+ #ifndef UNDER_CE
+ (unsigned)NSecurity::Get_LargePages_RiskLevel()
+ #else
+ 0
+ #endif
+ )
+ {
+ SetLargePageSize();
+ // note: this process also can inherit that Privilege from parent process
+ g_LargePagesMode =
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ NSecurity::EnablePrivilege_LockMemory();
+ #else
+ true;
+ #endif
+ }
+ #endif
+ }
+
+
+ #ifndef UNDER_CE
+
+ if (parser[NKey::kAffinity].ThereIs)
+ {
+ const UString &s = parser[NKey::kAffinity].PostStrings[0];
+ if (!s.IsEmpty())
+ {
+ UInt32 v = 0;
+ AString a;
+ a.SetFromWStr_if_Ascii(s);
+ if (!a.IsEmpty())
+ {
+ const char *end;
+ v = ConvertHexStringToUInt32(a, &end);
+ if (*end != 0)
+ a.Empty();
+ }
+ if (a.IsEmpty())
+ throw CArcCmdLineException("Unsupported switch postfix -stm", s);
+
+ #ifdef _WIN32
+ SetProcessAffinityMask(GetCurrentProcess(), v);
+ #endif
+ }
+ }
+
+ #endif
+}
+
+struct CCodePagePair
+{
+ const char *Name;
+ Int32 CodePage;
+};
+
+static const unsigned kNumByteOnlyCodePages = 3;
+
+static const CCodePagePair g_CodePagePairs[] =
+{
+ { "utf-8", CP_UTF8 },
+ { "win", CP_ACP },
+ { "dos", CP_OEMCP },
+ { "utf-16le", MY__CP_UTF16 },
+ { "utf-16be", MY__CP_UTF16BE }
+};
+
+static Int32 FindCharset(const NCommandLineParser::CParser &parser, unsigned keyIndex,
+ bool byteOnlyCodePages, Int32 defaultVal)
+{
+ if (!parser[keyIndex].ThereIs)
+ return defaultVal;
+
+ UString name (parser[keyIndex].PostStrings.Back());
+ UInt32 v;
+ if (StringToUInt32(name, v))
+ if (v < ((UInt32)1 << 16))
+ return (Int32)v;
+ name.MakeLower_Ascii();
+ unsigned num = byteOnlyCodePages ? kNumByteOnlyCodePages : ARRAY_SIZE(g_CodePagePairs);
+ for (unsigned i = 0;; i++)
+ {
+ if (i == num) // to disable warnings from different compilers
+ throw CArcCmdLineException("Unsupported charset:", name);
+ const CCodePagePair &pair = g_CodePagePairs[i];
+ if (name.IsEqualTo(pair.Name))
+ return pair.CodePage;
+ }
+}
+
+
+static void SetBoolPair(NCommandLineParser::CParser &parser, unsigned switchID, CBoolPair &bp)
+{
+ bp.Def = parser[switchID].ThereIs;
+ if (bp.Def)
+ bp.Val = !parser[switchID].WithMinus;
+}
+
+void CArcCmdLineParser::Parse2(CArcCmdLineOptions &options)
+{
+ const UStringVector &nonSwitchStrings = parser.NonSwitchStrings;
+ const unsigned numNonSwitchStrings = nonSwitchStrings.Size();
+ if (numNonSwitchStrings < kMinNonSwitchWords)
+ throw CArcCmdLineException("The command must be specified");
+
+ if (!ParseArchiveCommand(nonSwitchStrings[kCommandIndex], options.Command))
+ throw CArcCmdLineException("Unsupported command:", nonSwitchStrings[kCommandIndex]);
+
+ if (parser[NKey::kHash].ThereIs)
+ options.HashMethods = parser[NKey::kHash].PostStrings;
+
+ if (parser[NKey::kElimDup].ThereIs)
+ {
+ options.ExtractOptions.ElimDup.Def = true;
+ options.ExtractOptions.ElimDup.Val = !parser[NKey::kElimDup].WithMinus;
+ }
+
+ NWildcard::ECensorPathMode censorPathMode = NWildcard::k_RelatPath;
+ bool fullPathMode = parser[NKey::kFullPathMode].ThereIs;
+ if (fullPathMode)
+ {
+ censorPathMode = NWildcard::k_AbsPath;
+ const UString &s = parser[NKey::kFullPathMode].PostStrings[0];
+ if (!s.IsEmpty())
+ {
+ if (s == L"2")
+ censorPathMode = NWildcard::k_FullPath;
+ else
+ throw CArcCmdLineException("Unsupported -spf:", s);
+ }
+ }
+
+ if (parser[NKey::kNameTrailReplace].ThereIs)
+ g_PathTrailReplaceMode = !parser[NKey::kNameTrailReplace].WithMinus;
+
+ NRecursedType::EEnum recursedType;
+ if (parser[NKey::kRecursed].ThereIs)
+ recursedType = GetRecursedTypeFromIndex(parser[NKey::kRecursed].PostCharIndex);
+ else
+ recursedType = NRecursedType::kNonRecursed;
+
+ bool wildcardMatching = true;
+ if (parser[NKey::kDisableWildcardParsing].ThereIs)
+ wildcardMatching = false;
+
+ g_CodePage = FindCharset(parser, NKey::kConsoleCharSet, true, -1);
+ Int32 codePage = FindCharset(parser, NKey::kListfileCharSet, false, CP_UTF8);
+
+ bool thereAreSwitchIncludes = false;
+
+ if (parser[NKey::kInclude].ThereIs)
+ {
+ thereAreSwitchIncludes = true;
+ AddSwitchWildcardsToCensor(options.Censor,
+ parser[NKey::kInclude].PostStrings, true, recursedType, wildcardMatching, codePage);
+ }
+
+ if (parser[NKey::kExclude].ThereIs)
+ AddSwitchWildcardsToCensor(options.Censor,
+ parser[NKey::kExclude].PostStrings, false, recursedType, wildcardMatching, codePage);
+
+ unsigned curCommandIndex = kCommandIndex + 1;
+ bool thereIsArchiveName = !parser[NKey::kNoArName].ThereIs &&
+ options.Command.CommandType != NCommandType::kBenchmark &&
+ options.Command.CommandType != NCommandType::kInfo &&
+ options.Command.CommandType != NCommandType::kHash;
+
+ bool isExtractGroupCommand = options.Command.IsFromExtractGroup();
+ bool isExtractOrList = isExtractGroupCommand || options.Command.CommandType == NCommandType::kList;
+ bool isRename = options.Command.CommandType == NCommandType::kRename;
+
+ if ((isExtractOrList || isRename) && options.StdInMode)
+ thereIsArchiveName = false;
+
+ if (parser[NKey::kArcNameMode].ThereIs)
+ options.UpdateOptions.ArcNameMode = ParseArcNameMode(parser[NKey::kArcNameMode].PostCharIndex);
+
+ if (thereIsArchiveName)
+ {
+ if (curCommandIndex >= numNonSwitchStrings)
+ throw CArcCmdLineException("Cannot find archive name");
+ options.ArchiveName = nonSwitchStrings[curCommandIndex++];
+ if (options.ArchiveName.IsEmpty())
+ throw CArcCmdLineException("Archive name cannot by empty");
+ #ifdef _WIN32
+ // options.ArchiveName.Replace(L'/', WCHAR_PATH_SEPARATOR);
+ #endif
+ }
+
+ AddToCensorFromNonSwitchesStrings(isRename ? &options.UpdateOptions.RenamePairs : NULL,
+ curCommandIndex, options.Censor,
+ nonSwitchStrings, parser.StopSwitchIndex,
+ recursedType, wildcardMatching,
+ thereAreSwitchIncludes, codePage);
+
+ options.YesToAll = parser[NKey::kYes].ThereIs;
+
+
+ #ifndef _NO_CRYPTO
+ options.PasswordEnabled = parser[NKey::kPassword].ThereIs;
+ if (options.PasswordEnabled)
+ options.Password = parser[NKey::kPassword].PostStrings[0];
+ #endif
+
+ options.ShowDialog = parser[NKey::kShowDialog].ThereIs;
+
+ if (parser[NKey::kArchiveType].ThereIs)
+ options.ArcType = parser[NKey::kArchiveType].PostStrings[0];
+
+ options.ExcludedArcTypes = parser[NKey::kExcludedArcType].PostStrings;
+
+ SetMethodOptions(parser, options.Properties);
+
+ if (parser[NKey::kNtSecurity].ThereIs) options.NtSecurity.SetTrueTrue();
+
+ SetBoolPair(parser, NKey::kAltStreams, options.AltStreams);
+ SetBoolPair(parser, NKey::kHardLinks, options.HardLinks);
+ SetBoolPair(parser, NKey::kSymLinks, options.SymLinks);
+
+ if (isExtractOrList)
+ {
+ CExtractOptionsBase &eo = options.ExtractOptions;
+
+ {
+ CExtractNtOptions &nt = eo.NtOptions;
+ nt.NtSecurity = options.NtSecurity;
+
+ nt.AltStreams = options.AltStreams;
+ if (!options.AltStreams.Def)
+ nt.AltStreams.Val = true;
+
+ nt.HardLinks = options.HardLinks;
+ if (!options.HardLinks.Def)
+ nt.HardLinks.Val = true;
+
+ nt.SymLinks = options.SymLinks;
+ if (!options.SymLinks.Def)
+ nt.SymLinks.Val = true;
+
+ nt.ReplaceColonForAltStream = parser[NKey::kReplaceColonForAltStream].ThereIs;
+ nt.WriteToAltStreamIfColon = parser[NKey::kWriteToAltStreamIfColon].ThereIs;
+ }
+
+ options.Censor.AddPathsToCensor(NWildcard::k_AbsPath);
+ options.Censor.ExtendExclude();
+
+ // are there paths that look as non-relative (!Prefix.IsEmpty())
+ if (!options.Censor.AllAreRelative())
+ throw CArcCmdLineException("Cannot use absolute pathnames for this command");
+
+ NWildcard::CCensor &arcCensor = options.arcCensor;
+
+ if (parser[NKey::kArInclude].ThereIs)
+ AddSwitchWildcardsToCensor(arcCensor, parser[NKey::kArInclude].PostStrings, true, NRecursedType::kNonRecursed, wildcardMatching, codePage);
+ if (parser[NKey::kArExclude].ThereIs)
+ AddSwitchWildcardsToCensor(arcCensor, parser[NKey::kArExclude].PostStrings, false, NRecursedType::kNonRecursed, wildcardMatching, codePage);
+
+ if (thereIsArchiveName)
+ AddNameToCensor(arcCensor, options.ArchiveName, true, NRecursedType::kNonRecursed, wildcardMatching);
+
+ arcCensor.AddPathsToCensor(NWildcard::k_RelatPath);
+
+ #ifdef _WIN32
+ ConvertToLongNames(arcCensor);
+ #endif
+
+ arcCensor.ExtendExclude();
+
+ if (options.StdInMode)
+ options.ArcName_for_StdInMode = parser[NKey::kStdIn].PostStrings.Front();
+
+ if (isExtractGroupCommand)
+ {
+ if (options.StdOutMode)
+ {
+ if (
+ options.Number_for_Percents == k_OutStream_stdout
+ // || options.Number_for_Out == k_OutStream_stdout
+ // || options.Number_for_Errors == k_OutStream_stdout
+ ||
+ (
+ (options.IsStdOutTerminal && options.IsStdErrTerminal)
+ &&
+ (
+ options.Number_for_Percents != k_OutStream_disabled
+ // || options.Number_for_Out != k_OutStream_disabled
+ // || options.Number_for_Errors != k_OutStream_disabled
+ )
+ )
+ )
+ throw CArcCmdLineException(kSameTerminalError);
+ }
+
+ if (parser[NKey::kOutputDir].ThereIs)
+ {
+ eo.OutputDir = us2fs(parser[NKey::kOutputDir].PostStrings[0]);
+ NFile::NName::NormalizeDirPathPrefix(eo.OutputDir);
+ }
+
+ eo.OverwriteMode = NExtract::NOverwriteMode::kAsk;
+ if (parser[NKey::kOverwrite].ThereIs)
+ {
+ eo.OverwriteMode = k_OverwriteModes[(unsigned)parser[NKey::kOverwrite].PostCharIndex];
+ eo.OverwriteMode_Force = true;
+ }
+ else if (options.YesToAll)
+ {
+ eo.OverwriteMode = NExtract::NOverwriteMode::kOverwrite;
+ eo.OverwriteMode_Force = true;
+ }
+ }
+
+ eo.PathMode = options.Command.GetPathMode();
+ if (censorPathMode == NWildcard::k_AbsPath)
+ {
+ eo.PathMode = NExtract::NPathMode::kAbsPaths;
+ eo.PathMode_Force = true;
+ }
+ else if (censorPathMode == NWildcard::k_FullPath)
+ {
+ eo.PathMode = NExtract::NPathMode::kFullPaths;
+ eo.PathMode_Force = true;
+ }
+ }
+ else if (options.Command.IsFromUpdateGroup())
+ {
+ if (parser[NKey::kArInclude].ThereIs)
+ throw CArcCmdLineException("-ai switch is not supported for this command");
+
+ CUpdateOptions &updateOptions = options.UpdateOptions;
+
+ SetAddCommandOptions(options.Command.CommandType, parser, updateOptions);
+
+ updateOptions.MethodMode.Properties = options.Properties;
+
+ if (parser[NKey::kShareForWrite].ThereIs)
+ updateOptions.OpenShareForWrite = true;
+ if (parser[NKey::kStopAfterOpenError].ThereIs)
+ updateOptions.StopAfterOpenError = true;
+
+ updateOptions.PathMode = censorPathMode;
+
+ updateOptions.AltStreams = options.AltStreams;
+ updateOptions.NtSecurity = options.NtSecurity;
+ updateOptions.HardLinks = options.HardLinks;
+ updateOptions.SymLinks = options.SymLinks;
+
+ updateOptions.EMailMode = parser[NKey::kEmail].ThereIs;
+ if (updateOptions.EMailMode)
+ {
+ updateOptions.EMailAddress = parser[NKey::kEmail].PostStrings.Front();
+ if (updateOptions.EMailAddress.Len() > 0)
+ if (updateOptions.EMailAddress[0] == L'.')
+ {
+ updateOptions.EMailRemoveAfter = true;
+ updateOptions.EMailAddress.Delete(0);
+ }
+ }
+
+ updateOptions.StdOutMode = options.StdOutMode;
+ updateOptions.StdInMode = options.StdInMode;
+
+ updateOptions.DeleteAfterCompressing = parser[NKey::kDeleteAfterCompressing].ThereIs;
+ updateOptions.SetArcMTime = parser[NKey::kSetArcMTime].ThereIs;
+
+ if (updateOptions.StdOutMode && updateOptions.EMailMode)
+ throw CArcCmdLineException("stdout mode and email mode cannot be combined");
+
+ if (updateOptions.StdOutMode)
+ {
+ if (options.IsStdOutTerminal)
+ throw CArcCmdLineException(kTerminalOutError);
+
+ if (options.Number_for_Percents == k_OutStream_stdout
+ || options.Number_for_Out == k_OutStream_stdout
+ || options.Number_for_Errors == k_OutStream_stdout)
+ throw CArcCmdLineException(kSameTerminalError);
+ }
+
+ if (updateOptions.StdInMode)
+ updateOptions.StdInFileName = parser[NKey::kStdIn].PostStrings.Front();
+
+ if (options.Command.CommandType == NCommandType::kRename)
+ if (updateOptions.Commands.Size() != 1)
+ throw CArcCmdLineException("Only one archive can be created with rename command");
+ }
+ else if (options.Command.CommandType == NCommandType::kBenchmark)
+ {
+ options.NumIterations = 1;
+ if (curCommandIndex < numNonSwitchStrings)
+ {
+ if (!StringToUInt32(nonSwitchStrings[curCommandIndex], options.NumIterations))
+ throw CArcCmdLineException("Incorrect Number of benmchmark iterations", nonSwitchStrings[curCommandIndex]);
+ curCommandIndex++;
+ }
+ }
+ else if (options.Command.CommandType == NCommandType::kHash)
+ {
+ options.Censor.AddPathsToCensor(censorPathMode);
+ options.Censor.ExtendExclude();
+
+ CHashOptions &hashOptions = options.HashOptions;
+ hashOptions.PathMode = censorPathMode;
+ hashOptions.Methods = options.HashMethods;
+ if (parser[NKey::kShareForWrite].ThereIs)
+ hashOptions.OpenShareForWrite = true;
+ hashOptions.StdInMode = options.StdInMode;
+ hashOptions.AltStreamsMode = options.AltStreams.Val;
+ }
+ else if (options.Command.CommandType == NCommandType::kInfo)
+ {
+ }
+ else
+ throw 20150919;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.h
new file mode 100644
index 0000000000..bba3c98aa6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveCommandLine.h
@@ -0,0 +1,136 @@
+// ArchiveCommandLine.h
+
+#ifndef __ARCHIVE_COMMAND_LINE_H
+#define __ARCHIVE_COMMAND_LINE_H
+
+#include "../../../Common/CommandLineParser.h"
+#include "../../../Common/Wildcard.h"
+
+#include "EnumDirItems.h"
+
+#include "Extract.h"
+#include "HashCalc.h"
+#include "Update.h"
+
+typedef CMessagePathException CArcCmdLineException;
+
+namespace NCommandType { enum EEnum
+{
+ kAdd = 0,
+ kUpdate,
+ kDelete,
+ kTest,
+ kExtract,
+ kExtractFull,
+ kList,
+ kBenchmark,
+ kInfo,
+ kHash,
+ kRename
+};}
+
+struct CArcCommand
+{
+ NCommandType::EEnum CommandType;
+
+ bool IsFromExtractGroup() const;
+ bool IsFromUpdateGroup() const;
+ bool IsTestCommand() const { return CommandType == NCommandType::kTest; }
+ NExtract::NPathMode::EEnum GetPathMode() const;
+};
+
+enum
+{
+ k_OutStream_disabled = 0,
+ k_OutStream_stdout = 1,
+ k_OutStream_stderr = 2
+};
+
+struct CArcCmdLineOptions
+{
+ bool HelpMode;
+
+ // bool LargePages;
+ bool CaseSensitiveChange;
+ bool CaseSensitive;
+
+ bool IsInTerminal;
+ bool IsStdOutTerminal;
+ bool IsStdErrTerminal;
+ bool StdInMode;
+ bool StdOutMode;
+ bool EnableHeaders;
+
+ bool YesToAll;
+ bool ShowDialog;
+ NWildcard::CCensor Censor;
+
+ CArcCommand Command;
+ UString ArchiveName;
+
+ #ifndef _NO_CRYPTO
+ bool PasswordEnabled;
+ UString Password;
+ #endif
+
+ bool TechMode;
+ bool ShowTime;
+
+ UStringVector HashMethods;
+
+ bool AppendName;
+ // UStringVector ArchivePathsSorted;
+ // UStringVector ArchivePathsFullSorted;
+ NWildcard::CCensor arcCensor;
+ UString ArcName_for_StdInMode;
+
+ CObjectVector<CProperty> Properties;
+
+ CExtractOptionsBase ExtractOptions;
+
+ CBoolPair NtSecurity;
+ CBoolPair AltStreams;
+ CBoolPair HardLinks;
+ CBoolPair SymLinks;
+
+ CUpdateOptions UpdateOptions;
+ CHashOptions HashOptions;
+ UString ArcType;
+ UStringVector ExcludedArcTypes;
+
+ unsigned Number_for_Out;
+ unsigned Number_for_Errors;
+ unsigned Number_for_Percents;
+ unsigned LogLevel;
+
+ // bool IsOutAllowed() const { return Number_for_Out != k_OutStream_disabled; }
+
+ // Benchmark
+ UInt32 NumIterations;
+
+ CArcCmdLineOptions():
+ // LargePages(false),
+ CaseSensitiveChange(false),
+ CaseSensitive(false),
+
+ StdInMode(false),
+ StdOutMode(false),
+
+ Number_for_Out(k_OutStream_stdout),
+ Number_for_Errors(k_OutStream_stderr),
+ Number_for_Percents(k_OutStream_stdout),
+
+ LogLevel(0)
+ {
+ };
+};
+
+class CArcCmdLineParser
+{
+ NCommandLineParser::CParser parser;
+public:
+ void Parse1(const UStringVector &commandStrings, CArcCmdLineOptions &options);
+ void Parse2(CArcCmdLineOptions &options);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
new file mode 100644
index 0000000000..1119d1b43e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.cpp
@@ -0,0 +1,1691 @@
+// ArchiveExtractCallback.cpp
+
+#include "StdAfx.h"
+
+#undef sprintf
+#undef printf
+
+// #include <stdio.h>
+// #include "../../../../C/CpuTicks.h"
+
+#include "../../../../C/Alloc.h"
+#include "../../../../C/CpuArch.h"
+
+
+#include "../../../Common/ComTry.h"
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/PropVariant.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#if defined(_WIN32) && !defined(UNDER_CE) && !defined(_SFX)
+#define _USE_SECURITY_CODE
+#include "../../../Windows/SecurityUtils.h"
+#endif
+
+#include "../../Common/FilePathAutoRename.h"
+// #include "../../Common/StreamUtils.h"
+
+#include "../Common/ExtractingFilePath.h"
+#include "../Common/PropIDUtils.h"
+
+#include "ArchiveExtractCallback.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static const char * const kCantAutoRename = "Can not create file with auto name";
+static const char * const kCantRenameFile = "Can not rename existing file";
+static const char * const kCantDeleteOutputFile = "Can not delete output file";
+static const char * const kCantDeleteOutputDir = "Can not delete output folder";
+static const char * const kCantCreateHardLink = "Can not create hard link";
+static const char * const kCantCreateSymLink = "Can not create symbolic link";
+static const char * const kCantOpenOutFile = "Can not open output file";
+static const char * const kCantSetFileLen = "Can not set length for output file";
+
+
+#ifndef _SFX
+
+STDMETHODIMP COutStreamWithHash::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ HRESULT result = S_OK;
+ if (_stream)
+ result = _stream->Write(data, size, &size);
+ if (_calculate)
+ _hash->Update(data, size);
+ _size += size;
+ if (processedSize)
+ *processedSize = size;
+ return result;
+}
+
+#endif
+
+#ifdef _USE_SECURITY_CODE
+bool InitLocalPrivileges()
+{
+ NSecurity::CAccessToken token;
+ if (!token.OpenProcessToken(GetCurrentProcess(),
+ TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES))
+ return false;
+
+ TOKEN_PRIVILEGES tp;
+
+ tp.PrivilegeCount = 1;
+ tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
+
+ if (!::LookupPrivilegeValue(NULL, SE_SECURITY_NAME, &tp.Privileges[0].Luid))
+ return false;
+ if (!token.AdjustPrivileges(&tp))
+ return false;
+ return (GetLastError() == ERROR_SUCCESS);
+}
+#endif
+
+#ifdef SUPPORT_LINKS
+
+int CHardLinkNode::Compare(const CHardLinkNode &a) const
+{
+ if (StreamId < a.StreamId) return -1;
+ if (StreamId > a.StreamId) return 1;
+ return MyCompare(INode, a.INode);
+}
+
+static HRESULT Archive_Get_HardLinkNode(IInArchive *archive, UInt32 index, CHardLinkNode &h, bool &defined)
+{
+ h.INode = 0;
+ h.StreamId = (UInt64)(Int64)-1;
+ defined = false;
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidINode, &prop));
+ if (!ConvertPropVariantToUInt64(prop, h.INode))
+ return S_OK;
+ }
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidStreamId, &prop));
+ ConvertPropVariantToUInt64(prop, h.StreamId);
+ }
+ defined = true;
+ return S_OK;
+}
+
+
+HRESULT CArchiveExtractCallback::PrepareHardLinks(const CRecordVector<UInt32> *realIndices)
+{
+ _hardLinks.Clear();
+
+ if (!_arc->Ask_INode)
+ return S_OK;
+
+ IInArchive *archive = _arc->Archive;
+ CRecordVector<CHardLinkNode> &hardIDs = _hardLinks.IDs;
+
+ {
+ UInt32 numItems;
+ if (realIndices)
+ numItems = realIndices->Size();
+ else
+ {
+ RINOK(archive->GetNumberOfItems(&numItems));
+ }
+
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ CHardLinkNode h;
+ bool defined;
+ UInt32 realIndex = realIndices ? (*realIndices)[i] : i;
+
+ RINOK(Archive_Get_HardLinkNode(archive, realIndex, h, defined));
+ if (defined)
+ {
+ bool isAltStream = false;
+ RINOK(Archive_IsItem_AltStream(archive, realIndex, isAltStream));
+ if (!isAltStream)
+ hardIDs.Add(h);
+ }
+ }
+ }
+
+ hardIDs.Sort2();
+
+ {
+ // wee keep only items that have 2 or more items
+ unsigned k = 0;
+ unsigned numSame = 1;
+ for (unsigned i = 1; i < hardIDs.Size(); i++)
+ {
+ if (hardIDs[i].Compare(hardIDs[i - 1]) != 0)
+ numSame = 1;
+ else if (++numSame == 2)
+ {
+ if (i - 1 != k)
+ hardIDs[k] = hardIDs[i - 1];
+ k++;
+ }
+ }
+ hardIDs.DeleteFrom(k);
+ }
+
+ _hardLinks.PrepareLinks();
+ return S_OK;
+}
+
+#endif
+
+CArchiveExtractCallback::CArchiveExtractCallback():
+ _arc(NULL),
+ WriteCTime(true),
+ WriteATime(true),
+ WriteMTime(true),
+ _multiArchives(false)
+{
+ LocalProgressSpec = new CLocalProgress();
+ _localProgress = LocalProgressSpec;
+
+ #ifdef _USE_SECURITY_CODE
+ _saclEnabled = InitLocalPrivileges();
+ #endif
+}
+
+void CArchiveExtractCallback::Init(
+ const CExtractNtOptions &ntOptions,
+ const NWildcard::CCensorNode *wildcardCensor,
+ const CArc *arc,
+ IFolderArchiveExtractCallback *extractCallback2,
+ bool stdOutMode, bool testMode,
+ const FString &directoryPath,
+ const UStringVector &removePathParts, bool removePartsForAltStreams,
+ UInt64 packSize)
+{
+ ClearExtractedDirsInfo();
+ _outFileStream.Release();
+
+ #ifdef SUPPORT_LINKS
+ _hardLinks.Clear();
+ #endif
+
+ #ifdef SUPPORT_ALT_STREAMS
+ _renamedFiles.Clear();
+ #endif
+
+ _ntOptions = ntOptions;
+ _wildcardCensor = wildcardCensor;
+
+ _stdOutMode = stdOutMode;
+ _testMode = testMode;
+
+ // _progressTotal = 0;
+ // _progressTotal_Defined = false;
+
+ _packTotal = packSize;
+ _progressTotal = packSize;
+ _progressTotal_Defined = true;
+
+ _extractCallback2 = extractCallback2;
+ _compressProgress.Release();
+ _extractCallback2.QueryInterface(IID_ICompressProgressInfo, &_compressProgress);
+ _extractCallback2.QueryInterface(IID_IArchiveExtractCallbackMessage, &_callbackMessage);
+ _extractCallback2.QueryInterface(IID_IFolderArchiveExtractCallback2, &_folderArchiveExtractCallback2);
+
+ #ifndef _SFX
+
+ _extractCallback2.QueryInterface(IID_IFolderExtractToStreamCallback, &ExtractToStreamCallback);
+ if (ExtractToStreamCallback)
+ {
+ Int32 useStreams = 0;
+ if (ExtractToStreamCallback->UseExtractToStream(&useStreams) != S_OK)
+ useStreams = 0;
+ if (useStreams == 0)
+ ExtractToStreamCallback.Release();
+ }
+
+ #endif
+
+ LocalProgressSpec->Init(extractCallback2, true);
+ LocalProgressSpec->SendProgress = false;
+
+ _removePathParts = removePathParts;
+ _removePartsForAltStreams = removePartsForAltStreams;
+
+ #ifndef _SFX
+ _baseParentFolder = (UInt32)(Int32)-1;
+ _use_baseParentFolder_mode = false;
+ #endif
+
+ _arc = arc;
+ _dirPathPrefix = directoryPath;
+ _dirPathPrefix_Full = directoryPath;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (!NName::IsAltPathPrefix(_dirPathPrefix))
+ #endif
+ {
+ NName::NormalizeDirPathPrefix(_dirPathPrefix);
+ NDir::MyGetFullPathName(directoryPath, _dirPathPrefix_Full);
+ NName::NormalizeDirPathPrefix(_dirPathPrefix_Full);
+ }
+}
+
+STDMETHODIMP CArchiveExtractCallback::SetTotal(UInt64 size)
+{
+ COM_TRY_BEGIN
+ _progressTotal = size;
+ _progressTotal_Defined = true;
+ if (!_multiArchives && _extractCallback2)
+ return _extractCallback2->SetTotal(size);
+ return S_OK;
+ COM_TRY_END
+}
+
+static void NormalizeVals(UInt64 &v1, UInt64 &v2)
+{
+ const UInt64 kMax = (UInt64)1 << 31;
+ while (v1 > kMax)
+ {
+ v1 >>= 1;
+ v2 >>= 1;
+ }
+}
+
+static UInt64 MyMultDiv64(UInt64 unpCur, UInt64 unpTotal, UInt64 packTotal)
+{
+ NormalizeVals(packTotal, unpTotal);
+ NormalizeVals(unpCur, unpTotal);
+ if (unpTotal == 0)
+ unpTotal = 1;
+ return unpCur * packTotal / unpTotal;
+}
+
+STDMETHODIMP CArchiveExtractCallback::SetCompleted(const UInt64 *completeValue)
+{
+ COM_TRY_BEGIN
+
+ if (!_extractCallback2)
+ return S_OK;
+
+ UInt64 packCur;
+ if (_multiArchives)
+ {
+ packCur = LocalProgressSpec->InSize;
+ if (completeValue && _progressTotal_Defined)
+ packCur += MyMultDiv64(*completeValue, _progressTotal, _packTotal);
+ completeValue = &packCur;
+ }
+ return _extractCallback2->SetCompleted(completeValue);
+
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveExtractCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ COM_TRY_BEGIN
+ return _localProgress->SetRatioInfo(inSize, outSize);
+ COM_TRY_END
+}
+
+void CArchiveExtractCallback::CreateComplexDirectory(const UStringVector &dirPathParts, FString &fullPath)
+{
+ bool isAbsPath = false;
+
+ if (!dirPathParts.IsEmpty())
+ {
+ const UString &s = dirPathParts[0];
+ if (s.IsEmpty())
+ isAbsPath = true;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ else
+ {
+ if (NName::IsDrivePath2(s))
+ isAbsPath = true;
+ }
+ #endif
+ }
+
+ if (_pathMode == NExtract::NPathMode::kAbsPaths && isAbsPath)
+ fullPath.Empty();
+ else
+ fullPath = _dirPathPrefix;
+
+ FOR_VECTOR (i, dirPathParts)
+ {
+ if (i != 0)
+ fullPath.Add_PathSepar();
+ const UString &s = dirPathParts[i];
+ fullPath += us2fs(s);
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (_pathMode == NExtract::NPathMode::kAbsPaths)
+ if (i == 0 && s.Len() == 2 && NName::IsDrivePath2(s))
+ continue;
+ #endif
+ CreateDir(fullPath);
+ }
+}
+
+HRESULT CArchiveExtractCallback::GetTime(UInt32 index, PROPID propID, FILETIME &filetime, bool &filetimeIsDefined)
+{
+ filetimeIsDefined = false;
+ filetime.dwLowDateTime = 0;
+ filetime.dwHighDateTime = 0;
+ NCOM::CPropVariant prop;
+ RINOK(_arc->Archive->GetProperty(index, propID, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ filetime = prop.filetime;
+ filetimeIsDefined = (filetime.dwHighDateTime != 0 || filetime.dwLowDateTime != 0);
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+HRESULT CArchiveExtractCallback::GetUnpackSize()
+{
+ return _arc->GetItemSize(_index, _curSize, _curSizeDefined);
+}
+
+static void AddPathToMessage(UString &s, const FString &path)
+{
+ s += " : ";
+ s += fs2us(path);
+}
+
+HRESULT CArchiveExtractCallback::SendMessageError(const char *message, const FString &path)
+{
+ UString s (message);
+ AddPathToMessage(s, path);
+ return _extractCallback2->MessageError(s);
+}
+
+HRESULT CArchiveExtractCallback::SendMessageError_with_LastError(const char *message, const FString &path)
+{
+ DWORD errorCode = GetLastError();
+ UString s (message);
+ if (errorCode != 0)
+ {
+ s += " : ";
+ s += NError::MyFormatMessage(errorCode);
+ }
+ AddPathToMessage(s, path);
+ return _extractCallback2->MessageError(s);
+}
+
+HRESULT CArchiveExtractCallback::SendMessageError2(const char *message, const FString &path1, const FString &path2)
+{
+ UString s (message);
+ AddPathToMessage(s, path1);
+ AddPathToMessage(s, path2);
+ return _extractCallback2->MessageError(s);
+}
+
+#ifndef _SFX
+
+STDMETHODIMP CGetProp::GetProp(PROPID propID, PROPVARIANT *value)
+{
+ /*
+ if (propID == kpidName)
+ {
+ COM_TRY_BEGIN
+ NCOM::CPropVariant prop = Name;
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+ }
+ */
+ return Arc->Archive->GetProperty(IndexInArc, propID, value);
+}
+
+#endif
+
+
+#ifdef SUPPORT_LINKS
+
+static UString GetDirPrefixOf(const UString &src)
+{
+ UString s (src);
+ if (!s.IsEmpty())
+ {
+ if (IsPathSepar(s.Back()))
+ s.DeleteBack();
+ int pos = s.ReverseFind_PathSepar();
+ s.DeleteFrom(pos + 1);
+ }
+ return s;
+}
+
+#endif
+
+
+bool IsSafePath(const UString &path)
+{
+ if (NName::IsAbsolutePath(path))
+ return false;
+
+ UStringVector parts;
+ SplitPathToParts(path, parts);
+ unsigned level = 0;
+
+ FOR_VECTOR (i, parts)
+ {
+ const UString &s = parts[i];
+ if (s.IsEmpty())
+ {
+ if (i == 0)
+ return false;
+ continue;
+ }
+ if (s == L".")
+ continue;
+ if (s == L"..")
+ {
+ if (level == 0)
+ return false;
+ level--;
+ }
+ else
+ level++;
+ }
+
+ return level > 0;
+}
+
+
+bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include)
+{
+ bool found = false;
+
+ if (node.CheckPathVect(item.PathParts, !item.MainIsDir, include))
+ {
+ if (!include)
+ return true;
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (!item.IsAltStream)
+ return true;
+ #endif
+
+ found = true;
+ }
+
+ #ifdef SUPPORT_ALT_STREAMS
+
+ if (!item.IsAltStream)
+ return false;
+
+ UStringVector pathParts2 = item.PathParts;
+ if (pathParts2.IsEmpty())
+ pathParts2.AddNew();
+ UString &back = pathParts2.Back();
+ back += ':';
+ back += item.AltStreamName;
+ bool include2;
+
+ if (node.CheckPathVect(pathParts2,
+ true, // isFile,
+ include2))
+ {
+ include = include2;
+ return true;
+ }
+
+ #endif
+
+ return found;
+}
+
+bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item)
+{
+ bool include;
+ if (CensorNode_CheckPath2(node, item, include))
+ return include;
+ return false;
+}
+
+static FString MakePath_from_2_Parts(const FString &prefix, const FString &path)
+{
+ FString s (prefix);
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (!path.IsEmpty() && path[0] == ':' && !prefix.IsEmpty() && IsPathSepar(prefix.Back()))
+ {
+ if (!NName::IsDriveRootPath_SuperAllowed(prefix))
+ s.DeleteBack();
+ }
+ #endif
+ s += path;
+ return s;
+}
+
+
+/*
+#ifdef SUPPORT_LINKS
+
+struct CTempMidBuffer
+{
+ void *Buf;
+
+ CTempMidBuffer(size_t size): Buf(NULL) { Buf = ::MidAlloc(size); }
+ ~CTempMidBuffer() { ::MidFree(Buf); }
+};
+
+HRESULT CArchiveExtractCallback::MyCopyFile(ISequentialOutStream *outStream)
+{
+ const size_t kBufSize = 1 << 16;
+ CTempMidBuffer buf(kBufSize);
+ if (!buf.Buf)
+ return E_OUTOFMEMORY;
+
+ NIO::CInFile inFile;
+ NIO::COutFile outFile;
+
+ if (!inFile.Open(_CopyFile_Path))
+ return SendMessageError_with_LastError("Open error", _CopyFile_Path);
+
+ for (;;)
+ {
+ UInt32 num;
+
+ if (!inFile.Read(buf.Buf, kBufSize, num))
+ return SendMessageError_with_LastError("Read error", _CopyFile_Path);
+
+ if (num == 0)
+ return S_OK;
+
+
+ RINOK(WriteStream(outStream, buf.Buf, num));
+ }
+}
+
+#endif
+*/
+
+
+STDMETHODIMP CArchiveExtractCallback::GetStream(UInt32 index, ISequentialOutStream **outStream, Int32 askExtractMode)
+{
+ COM_TRY_BEGIN
+
+ *outStream = NULL;
+
+ #ifndef _SFX
+ if (_hashStream)
+ _hashStreamSpec->ReleaseStream();
+ _hashStreamWasUsed = false;
+ #endif
+
+ _outFileStream.Release();
+
+ _encrypted = false;
+ _position = 0;
+ _isSplit = false;
+
+ _curSize = 0;
+ _curSizeDefined = false;
+ _fileLengthWasSet = false;
+ _index = index;
+
+ _diskFilePath.Empty();
+
+ // _fi.Clear();
+
+ #ifdef SUPPORT_LINKS
+ // _CopyFile_Path.Empty();
+ linkPath.Empty();
+ #endif
+
+ IInArchive *archive = _arc->Archive;
+
+ #ifndef _SFX
+ _item._use_baseParentFolder_mode = _use_baseParentFolder_mode;
+ if (_use_baseParentFolder_mode)
+ {
+ _item._baseParentFolder = _baseParentFolder;
+ if (_pathMode == NExtract::NPathMode::kFullPaths ||
+ _pathMode == NExtract::NPathMode::kAbsPaths)
+ _item._baseParentFolder = -1;
+ }
+ #endif
+
+ #ifdef SUPPORT_ALT_STREAMS
+ _item.WriteToAltStreamIfColon = _ntOptions.WriteToAltStreamIfColon;
+ #endif
+
+ RINOK(_arc->GetItem(index, _item));
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidPosition, &prop));
+ if (prop.vt != VT_EMPTY)
+ {
+ if (prop.vt != VT_UI8)
+ return E_FAIL;
+ _position = prop.uhVal.QuadPart;
+ _isSplit = true;
+ }
+ }
+
+ #ifdef SUPPORT_LINKS
+
+ // bool isCopyLink = false;
+ bool isHardLink = false;
+ bool isJunction = false;
+ bool isRelative = false;
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidHardLink, &prop));
+ if (prop.vt == VT_BSTR)
+ {
+ isHardLink = true;
+ // isCopyLink = false;
+ isRelative = false; // RAR5, TAR: hard links are from root folder of archive
+ linkPath.SetFromBstr(prop.bstrVal);
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ }
+
+ /*
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidCopyLink, &prop));
+ if (prop.vt == VT_BSTR)
+ {
+ isHardLink = false;
+ isCopyLink = true;
+ isRelative = false; // RAR5: copy links are from root folder of archive
+ linkPath.SetFromBstr(prop.bstrVal);
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ }
+ */
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidSymLink, &prop));
+ if (prop.vt == VT_BSTR)
+ {
+ isHardLink = false;
+ // isCopyLink = false;
+ isRelative = true; // RAR5, TAR: symbolic links can be relative
+ linkPath.SetFromBstr(prop.bstrVal);
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ }
+
+
+ bool isOkReparse = false;
+
+ if (linkPath.IsEmpty() && _arc->GetRawProps)
+ {
+ const void *data;
+ UInt32 dataSize;
+ UInt32 propType;
+
+ _arc->GetRawProps->GetRawProp(_index, kpidNtReparse, &data, &dataSize, &propType);
+
+ if (dataSize != 0)
+ {
+ if (propType != NPropDataType::kRaw)
+ return E_FAIL;
+ UString s;
+ CReparseAttr reparse;
+ DWORD errorCode = 0;
+ isOkReparse = reparse.Parse((const Byte *)data, dataSize, errorCode);
+ if (isOkReparse)
+ {
+ isHardLink = false;
+ // isCopyLink = false;
+ linkPath = reparse.GetPath();
+ isJunction = reparse.IsMountPoint();
+ isRelative = reparse.IsRelative();
+ #ifndef _WIN32
+ linkPath.Replace(L'\\', WCHAR_PATH_SEPARATOR);
+ #endif
+ }
+ }
+ }
+
+ if (!linkPath.IsEmpty())
+ {
+ #ifdef _WIN32
+ linkPath.Replace(L'/', WCHAR_PATH_SEPARATOR);
+ #endif
+
+ // rar5 uses "\??\" prefix for absolute links
+ if (linkPath.IsPrefixedBy(WSTRING_PATH_SEPARATOR L"??" WSTRING_PATH_SEPARATOR))
+ {
+ isRelative = false;
+ linkPath.DeleteFrontal(4);
+ }
+
+ for (;;)
+ // while (NName::IsAbsolutePath(linkPath))
+ {
+ unsigned n = NName::GetRootPrefixSize(linkPath);
+ if (n == 0)
+ break;
+ isRelative = false;
+ linkPath.DeleteFrontal(n);
+ }
+ }
+
+ if (!linkPath.IsEmpty() && !isRelative && _removePathParts.Size() != 0)
+ {
+ UStringVector pathParts;
+ SplitPathToParts(linkPath, pathParts);
+ bool badPrefix = false;
+ FOR_VECTOR (i, _removePathParts)
+ {
+ if (CompareFileNames(_removePathParts[i], pathParts[i]) != 0)
+ {
+ badPrefix = true;
+ break;
+ }
+ }
+ if (!badPrefix)
+ pathParts.DeleteFrontal(_removePathParts.Size());
+ linkPath = MakePathFromParts(pathParts);
+ }
+
+ #endif
+
+ RINOK(Archive_GetItemBoolProp(archive, index, kpidEncrypted, _encrypted));
+
+ RINOK(GetUnpackSize());
+
+ #ifdef SUPPORT_ALT_STREAMS
+
+ if (!_ntOptions.AltStreams.Val && _item.IsAltStream)
+ return S_OK;
+
+ #endif
+
+
+ UStringVector &pathParts = _item.PathParts;
+
+ if (_wildcardCensor)
+ {
+ if (!CensorNode_CheckPath(*_wildcardCensor, _item))
+ return S_OK;
+ }
+
+ #ifndef _SFX
+ if (_use_baseParentFolder_mode)
+ {
+ if (!pathParts.IsEmpty())
+ {
+ unsigned numRemovePathParts = 0;
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (_pathMode == NExtract::NPathMode::kNoPathsAlt && _item.IsAltStream)
+ numRemovePathParts = pathParts.Size();
+ else
+ #endif
+ if (_pathMode == NExtract::NPathMode::kNoPaths ||
+ _pathMode == NExtract::NPathMode::kNoPathsAlt)
+ numRemovePathParts = pathParts.Size() - 1;
+ pathParts.DeleteFrontal(numRemovePathParts);
+ }
+ }
+ else
+ #endif
+ {
+ if (pathParts.IsEmpty())
+ {
+ if (_item.IsDir)
+ return S_OK;
+ /*
+ #ifdef SUPPORT_ALT_STREAMS
+ if (!_item.IsAltStream)
+ #endif
+ return E_FAIL;
+ */
+ }
+
+ unsigned numRemovePathParts = 0;
+
+ switch (_pathMode)
+ {
+ case NExtract::NPathMode::kFullPaths:
+ case NExtract::NPathMode::kCurPaths:
+ {
+ if (_removePathParts.IsEmpty())
+ break;
+ bool badPrefix = false;
+
+ if (pathParts.Size() < _removePathParts.Size())
+ badPrefix = true;
+ else
+ {
+ if (pathParts.Size() == _removePathParts.Size())
+ {
+ if (_removePartsForAltStreams)
+ {
+ #ifdef SUPPORT_ALT_STREAMS
+ if (!_item.IsAltStream)
+ #endif
+ badPrefix = true;
+ }
+ else
+ {
+ if (!_item.MainIsDir)
+ badPrefix = true;
+ }
+ }
+
+ if (!badPrefix)
+ FOR_VECTOR (i, _removePathParts)
+ {
+ if (CompareFileNames(_removePathParts[i], pathParts[i]) != 0)
+ {
+ badPrefix = true;
+ break;
+ }
+ }
+ }
+
+ if (badPrefix)
+ {
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
+ return E_FAIL;
+ }
+ else
+ numRemovePathParts = _removePathParts.Size();
+ break;
+ }
+
+ case NExtract::NPathMode::kNoPaths:
+ {
+ if (!pathParts.IsEmpty())
+ numRemovePathParts = pathParts.Size() - 1;
+ break;
+ }
+ case NExtract::NPathMode::kNoPathsAlt:
+ {
+ #ifdef SUPPORT_ALT_STREAMS
+ if (_item.IsAltStream)
+ numRemovePathParts = pathParts.Size();
+ else
+ #endif
+ if (!pathParts.IsEmpty())
+ numRemovePathParts = pathParts.Size() - 1;
+ break;
+ }
+ /*
+ case NExtract::NPathMode::kFullPaths:
+ case NExtract::NPathMode::kAbsPaths:
+ break;
+ */
+ }
+
+ pathParts.DeleteFrontal(numRemovePathParts);
+ }
+
+ #ifndef _SFX
+
+ if (ExtractToStreamCallback)
+ {
+ if (!GetProp)
+ {
+ GetProp_Spec = new CGetProp;
+ GetProp = GetProp_Spec;
+ }
+ GetProp_Spec->Arc = _arc;
+ GetProp_Spec->IndexInArc = index;
+ UString name (MakePathFromParts(pathParts));
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (_item.IsAltStream)
+ {
+ if (!pathParts.IsEmpty() || (!_removePartsForAltStreams && _pathMode != NExtract::NPathMode::kNoPathsAlt))
+ name += ':';
+ name += _item.AltStreamName;
+ }
+ #endif
+
+ return ExtractToStreamCallback->GetStream7(name, BoolToInt(_item.IsDir), outStream, askExtractMode, GetProp);
+ }
+
+ #endif
+
+ CMyComPtr<ISequentialOutStream> outStreamLoc;
+
+if (askExtractMode == NArchive::NExtract::NAskMode::kExtract && !_testMode)
+{
+ if (_stdOutMode)
+ {
+ outStreamLoc = new CStdOutFileStream;
+ }
+ else
+ {
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidAttrib, &prop));
+ if (prop.vt == VT_UI4)
+ {
+ _fi.Attrib = prop.ulVal;
+ _fi.AttribDefined = true;
+ }
+ else if (prop.vt == VT_EMPTY)
+ _fi.AttribDefined = false;
+ else
+ return E_FAIL;
+ }
+
+ RINOK(GetTime(index, kpidCTime, _fi.CTime, _fi.CTimeDefined));
+ RINOK(GetTime(index, kpidATime, _fi.ATime, _fi.ATimeDefined));
+ RINOK(GetTime(index, kpidMTime, _fi.MTime, _fi.MTimeDefined));
+
+ bool isAnti = false;
+ RINOK(_arc->IsItemAnti(index, isAnti));
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (!_item.IsAltStream
+ || !pathParts.IsEmpty()
+ || !(_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt))
+ #endif
+ Correct_FsPath(_pathMode == NExtract::NPathMode::kAbsPaths, _keepAndReplaceEmptyDirPrefixes, pathParts, _item.MainIsDir);
+
+ #ifdef SUPPORT_ALT_STREAMS
+
+ if (_item.IsAltStream)
+ {
+ UString s (_item.AltStreamName);
+ Correct_AltStream_Name(s);
+ bool needColon = true;
+
+ if (pathParts.IsEmpty())
+ {
+ pathParts.AddNew();
+ if (_removePartsForAltStreams || _pathMode == NExtract::NPathMode::kNoPathsAlt)
+ needColon = false;
+ }
+ else if (_pathMode == NExtract::NPathMode::kAbsPaths &&
+ NWildcard::GetNumPrefixParts_if_DrivePath(pathParts) == pathParts.Size())
+ pathParts.AddNew();
+
+ UString &name = pathParts.Back();
+ if (needColon)
+ name += (char)(_ntOptions.ReplaceColonForAltStream ? '_' : ':');
+ name += s;
+ }
+
+ #endif
+
+ UString processedPath (MakePathFromParts(pathParts));
+
+ if (!isAnti)
+ {
+ if (!_item.IsDir)
+ {
+ if (!pathParts.IsEmpty())
+ pathParts.DeleteBack();
+ }
+
+ if (!pathParts.IsEmpty())
+ {
+ FString fullPathNew;
+ CreateComplexDirectory(pathParts, fullPathNew);
+
+ if (_item.IsDir)
+ {
+ CDirPathTime &pt = _extractedFolders.AddNew();
+
+ pt.CTime = _fi.CTime;
+ pt.CTimeDefined = (WriteCTime && _fi.CTimeDefined);
+
+ pt.ATime = _fi.ATime;
+ pt.ATimeDefined = (WriteATime && _fi.ATimeDefined);
+
+ pt.MTimeDefined = false;
+
+ if (WriteMTime)
+ {
+ if (_fi.MTimeDefined)
+ {
+ pt.MTime = _fi.MTime;
+ pt.MTimeDefined = true;
+ }
+ else if (_arc->MTimeDefined)
+ {
+ pt.MTime = _arc->MTime;
+ pt.MTimeDefined = true;
+ }
+ }
+
+ pt.Path = fullPathNew;
+
+ pt.SetDirTime();
+ }
+ }
+ }
+
+
+ FString fullProcessedPath (us2fs(processedPath));
+ if (_pathMode != NExtract::NPathMode::kAbsPaths
+ || !NName::IsAbsolutePath(processedPath))
+ {
+ fullProcessedPath = MakePath_from_2_Parts(_dirPathPrefix, fullProcessedPath);
+ }
+
+ #ifdef SUPPORT_ALT_STREAMS
+
+ if (_item.IsAltStream && _item.ParentIndex != (UInt32)(Int32)-1)
+ {
+ int renIndex = _renamedFiles.FindInSorted(CIndexToPathPair(_item.ParentIndex));
+ if (renIndex >= 0)
+ {
+ const CIndexToPathPair &pair = _renamedFiles[renIndex];
+ fullProcessedPath = pair.Path;
+ fullProcessedPath += ':';
+ UString s (_item.AltStreamName);
+ Correct_AltStream_Name(s);
+ fullProcessedPath += us2fs(s);
+ }
+ }
+
+ #endif
+
+ bool isRenamed = false;
+
+ if (_item.IsDir)
+ {
+ _diskFilePath = fullProcessedPath;
+ if (isAnti)
+ RemoveDir(_diskFilePath);
+ #ifdef SUPPORT_LINKS
+ if (linkPath.IsEmpty())
+ #endif
+ return S_OK;
+ }
+ else if (!_isSplit)
+ {
+
+ // ----- Is file (not split) -----
+ NFind::CFileInfo fileInfo;
+ if (fileInfo.Find(fullProcessedPath))
+ {
+ switch (_overwriteMode)
+ {
+ case NExtract::NOverwriteMode::kSkip:
+ return S_OK;
+ case NExtract::NOverwriteMode::kAsk:
+ {
+ int slashPos = fullProcessedPath.ReverseFind_PathSepar();
+ FString realFullProcessedPath (fullProcessedPath.Left(slashPos + 1) + fileInfo.Name);
+
+ Int32 overwriteResult;
+ RINOK(_extractCallback2->AskOverwrite(
+ fs2us(realFullProcessedPath), &fileInfo.MTime, &fileInfo.Size, _item.Path,
+ _fi.MTimeDefined ? &_fi.MTime : NULL,
+ _curSizeDefined ? &_curSize : NULL,
+ &overwriteResult))
+
+ switch (overwriteResult)
+ {
+ case NOverwriteAnswer::kCancel: return E_ABORT;
+ case NOverwriteAnswer::kNo: return S_OK;
+ case NOverwriteAnswer::kNoToAll: _overwriteMode = NExtract::NOverwriteMode::kSkip; return S_OK;
+ case NOverwriteAnswer::kYes: break;
+ case NOverwriteAnswer::kYesToAll: _overwriteMode = NExtract::NOverwriteMode::kOverwrite; break;
+ case NOverwriteAnswer::kAutoRename: _overwriteMode = NExtract::NOverwriteMode::kRename; break;
+ default:
+ return E_FAIL;
+ }
+ }
+ }
+ if (_overwriteMode == NExtract::NOverwriteMode::kRename)
+ {
+ if (!AutoRenamePath(fullProcessedPath))
+ {
+ RINOK(SendMessageError(kCantAutoRename, fullProcessedPath));
+ return E_FAIL;
+ }
+ isRenamed = true;
+ }
+ else if (_overwriteMode == NExtract::NOverwriteMode::kRenameExisting)
+ {
+ FString existPath (fullProcessedPath);
+ if (!AutoRenamePath(existPath))
+ {
+ RINOK(SendMessageError(kCantAutoRename, fullProcessedPath));
+ return E_FAIL;
+ }
+ // MyMoveFile can raname folders. So it's OK to use it for folders too
+ if (!MyMoveFile(fullProcessedPath, existPath))
+ {
+ RINOK(SendMessageError2(kCantRenameFile, existPath, fullProcessedPath));
+ return E_FAIL;
+ }
+ }
+ else
+ {
+ if (fileInfo.IsDir())
+ {
+ // do we need to delete all files in folder?
+ if (!RemoveDir(fullProcessedPath))
+ {
+ RINOK(SendMessageError_with_LastError(kCantDeleteOutputDir, fullProcessedPath));
+ return S_OK;
+ }
+ }
+ else
+ {
+ bool needDelete = true;
+ if (needDelete)
+ {
+ if (!DeleteFileAlways(fullProcessedPath))
+ {
+ RINOK(SendMessageError_with_LastError(kCantDeleteOutputFile, fullProcessedPath));
+ return S_OK;
+ // return E_FAIL;
+ }
+ }
+ }
+ }
+ }
+ else // not Find(fullProcessedPath)
+ {
+ // we need to clear READ-ONLY of parent before creating alt stream
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ int colonPos = NName::FindAltStreamColon(fullProcessedPath);
+ if (colonPos >= 0 && fullProcessedPath[(unsigned)colonPos + 1] != 0)
+ {
+ FString parentFsPath (fullProcessedPath);
+ parentFsPath.DeleteFrom(colonPos);
+ NFind::CFileInfo parentFi;
+ if (parentFi.Find(parentFsPath))
+ {
+ if (parentFi.IsReadOnly())
+ SetFileAttrib(parentFsPath, parentFi.Attrib & ~FILE_ATTRIBUTE_READONLY);
+ }
+ }
+ #endif
+ }
+ // ----- END of code for Is file (not split) -----
+
+ }
+ _diskFilePath = fullProcessedPath;
+
+
+ if (!isAnti)
+ {
+ #ifdef SUPPORT_LINKS
+
+ if (!linkPath.IsEmpty())
+ {
+ #ifndef UNDER_CE
+
+ UString relatPath;
+ if (isRelative)
+ relatPath = GetDirPrefixOf(_item.Path);
+ relatPath += linkPath;
+
+ if (!IsSafePath(relatPath))
+ {
+ RINOK(SendMessageError("Dangerous link path was ignored", us2fs(relatPath)));
+ }
+ else
+ {
+ FString existPath;
+ if (isHardLink /* || isCopyLink */ || !isRelative)
+ {
+ if (!NName::GetFullPath(_dirPathPrefix_Full, us2fs(relatPath), existPath))
+ {
+ RINOK(SendMessageError("Incorrect path", us2fs(relatPath)));
+ }
+ }
+ else
+ {
+ existPath = us2fs(linkPath);
+ }
+
+ if (!existPath.IsEmpty())
+ {
+ if (isHardLink /* || isCopyLink */)
+ {
+ // if (isHardLink)
+ {
+ if (!MyCreateHardLink(fullProcessedPath, existPath))
+ {
+ RINOK(SendMessageError2(kCantCreateHardLink, fullProcessedPath, existPath));
+ // return S_OK;
+ }
+ }
+ /*
+ else
+ {
+ NFind::CFileInfo fi;
+ if (!fi.Find(existPath))
+ {
+ RINOK(SendMessageError2("Can not find the file for copying", existPath, fullProcessedPath));
+ }
+ else
+ {
+ if (_curSizeDefined && _curSize == fi.Size)
+ _CopyFile_Path = existPath;
+ else
+ {
+ RINOK(SendMessageError2("File size collision for file copying", existPath, fullProcessedPath));
+ }
+
+ // RINOK(MyCopyFile(existPath, fullProcessedPath));
+ }
+ }
+ */
+ }
+ else if (_ntOptions.SymLinks.Val)
+ {
+ // bool isSymLink = true; // = false for junction
+ if (_item.IsDir && !isRelative)
+ {
+ // if it's before Vista we use Junction Point
+ // isJunction = true;
+ // convertToAbs = true;
+ }
+
+ CByteBuffer data;
+ if (FillLinkData(data, fs2us(existPath), !isJunction))
+ {
+ CReparseAttr attr;
+ DWORD errorCode = 0;
+ if (!attr.Parse(data, data.Size(), errorCode))
+ {
+ RINOK(SendMessageError("Internal error for symbolic link file", us2fs(_item.Path)));
+ // return E_FAIL;
+ }
+ else
+ if (!NFile::NIO::SetReparseData(fullProcessedPath, _item.IsDir, data, (DWORD)data.Size()))
+ {
+ RINOK(SendMessageError_with_LastError(kCantCreateSymLink, fullProcessedPath));
+ }
+ }
+ }
+ }
+ }
+
+ #endif
+ }
+
+ if (linkPath.IsEmpty() /* || !_CopyFile_Path.IsEmpty() */)
+ #endif // SUPPORT_LINKS
+ {
+ bool needWriteFile = true;
+
+ #ifdef SUPPORT_LINKS
+ if (!_hardLinks.IDs.IsEmpty() && !_item.IsAltStream)
+ {
+ CHardLinkNode h;
+ bool defined;
+ RINOK(Archive_Get_HardLinkNode(archive, index, h, defined));
+ if (defined)
+ {
+ {
+ int linkIndex = _hardLinks.IDs.FindInSorted2(h);
+ if (linkIndex >= 0)
+ {
+ FString &hl = _hardLinks.Links[linkIndex];
+ if (hl.IsEmpty())
+ hl = fullProcessedPath;
+ else
+ {
+ if (!MyCreateHardLink(fullProcessedPath, hl))
+ {
+ RINOK(SendMessageError2(kCantCreateHardLink, fullProcessedPath, hl));
+ return S_OK;
+ }
+ needWriteFile = false;
+ }
+ }
+ }
+ }
+ }
+ #endif
+
+ if (needWriteFile)
+ {
+ _outFileStreamSpec = new COutFileStream;
+ CMyComPtr<ISequentialOutStream> outStreamLoc2(_outFileStreamSpec);
+ if (!_outFileStreamSpec->Open(fullProcessedPath, _isSplit ? OPEN_ALWAYS: CREATE_ALWAYS))
+ {
+ // if (::GetLastError() != ERROR_FILE_EXISTS || !isSplit)
+ {
+ RINOK(SendMessageError_with_LastError(kCantOpenOutFile, fullProcessedPath));
+ return S_OK;
+ }
+ }
+
+ if (_ntOptions.PreAllocateOutFile && !_isSplit && _curSizeDefined && _curSize > (1 << 12))
+ {
+ // UInt64 ticks = GetCpuTicks();
+ bool res = _outFileStreamSpec->File.SetLength(_curSize);
+ _fileLengthWasSet = res;
+ _outFileStreamSpec->File.SeekToBegin();
+ // ticks = GetCpuTicks() - ticks;
+ // printf("\nticks = %10d\n", (unsigned)ticks);
+ if (!res)
+ {
+ RINOK(SendMessageError_with_LastError(kCantSetFileLen, fullProcessedPath));
+ }
+ }
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (isRenamed && !_item.IsAltStream)
+ {
+ CIndexToPathPair pair(index, fullProcessedPath);
+ unsigned oldSize = _renamedFiles.Size();
+ unsigned insertIndex = _renamedFiles.AddToUniqueSorted(pair);
+ if (oldSize == _renamedFiles.Size())
+ _renamedFiles[insertIndex].Path = fullProcessedPath;
+ }
+ #endif
+
+ if (_isSplit)
+ {
+ RINOK(_outFileStreamSpec->Seek(_position, STREAM_SEEK_SET, NULL));
+ }
+
+ _outFileStream = outStreamLoc2;
+ }
+ }
+ }
+
+ outStreamLoc = _outFileStream;
+ }
+}
+
+ #ifndef _SFX
+
+ if (_hashStream)
+ {
+ if (askExtractMode == NArchive::NExtract::NAskMode::kExtract ||
+ askExtractMode == NArchive::NExtract::NAskMode::kTest)
+ {
+ _hashStreamSpec->SetStream(outStreamLoc);
+ outStreamLoc = _hashStream;
+ _hashStreamSpec->Init(true);
+ _hashStreamWasUsed = true;
+ }
+ }
+
+ #endif
+
+
+ if (outStreamLoc)
+ {
+ /*
+ #ifdef SUPPORT_LINKS
+
+ if (!_CopyFile_Path.IsEmpty())
+ {
+ RINOK(PrepareOperation(askExtractMode));
+ RINOK(MyCopyFile(outStreamLoc));
+ return SetOperationResult(NArchive::NExtract::NOperationResult::kOK);
+ }
+
+ if (isCopyLink && _testMode)
+ return S_OK;
+
+ #endif
+ */
+
+ *outStream = outStreamLoc.Detach();
+ }
+
+ return S_OK;
+
+ COM_TRY_END
+}
+
+
+STDMETHODIMP CArchiveExtractCallback::PrepareOperation(Int32 askExtractMode)
+{
+ COM_TRY_BEGIN
+
+ #ifndef _SFX
+ if (ExtractToStreamCallback)
+ return ExtractToStreamCallback->PrepareOperation7(askExtractMode);
+ #endif
+
+ _extractMode = false;
+
+ switch (askExtractMode)
+ {
+ case NArchive::NExtract::NAskMode::kExtract:
+ if (_testMode)
+ askExtractMode = NArchive::NExtract::NAskMode::kTest;
+ else
+ _extractMode = true;
+ break;
+ };
+
+ return _extractCallback2->PrepareOperation(_item.Path, BoolToInt(_item.IsDir),
+ askExtractMode, _isSplit ? &_position: 0);
+
+ COM_TRY_END
+}
+
+
+HRESULT CArchiveExtractCallback::CloseFile()
+{
+ if (!_outFileStream)
+ return S_OK;
+
+ HRESULT hres = S_OK;
+ _outFileStreamSpec->SetTime(
+ (WriteCTime && _fi.CTimeDefined) ? &_fi.CTime : NULL,
+ (WriteATime && _fi.ATimeDefined) ? &_fi.ATime : NULL,
+ (WriteMTime && _fi.MTimeDefined) ? &_fi.MTime : (_arc->MTimeDefined ? &_arc->MTime : NULL));
+
+ const UInt64 processedSize = _outFileStreamSpec->ProcessedSize;
+ if (_fileLengthWasSet && _curSize > processedSize)
+ {
+ bool res = _outFileStreamSpec->File.SetLength(processedSize);
+ _fileLengthWasSet = res;
+ if (!res)
+ hres = SendMessageError_with_LastError(kCantSetFileLen, us2fs(_item.Path));
+ }
+ _curSize = processedSize;
+ _curSizeDefined = true;
+ RINOK(_outFileStreamSpec->Close());
+ _outFileStream.Release();
+ return hres;
+}
+
+
+STDMETHODIMP CArchiveExtractCallback::SetOperationResult(Int32 opRes)
+{
+ COM_TRY_BEGIN
+
+ #ifndef _SFX
+ if (ExtractToStreamCallback)
+ return ExtractToStreamCallback->SetOperationResult7(opRes, BoolToInt(_encrypted));
+ #endif
+
+ #ifndef _SFX
+
+ if (_hashStreamWasUsed)
+ {
+ _hashStreamSpec->_hash->Final(_item.IsDir,
+ #ifdef SUPPORT_ALT_STREAMS
+ _item.IsAltStream
+ #else
+ false
+ #endif
+ , _item.Path);
+ _curSize = _hashStreamSpec->GetSize();
+ _curSizeDefined = true;
+ _hashStreamSpec->ReleaseStream();
+ _hashStreamWasUsed = false;
+ }
+
+ #endif
+
+ RINOK(CloseFile());
+
+ #ifdef _USE_SECURITY_CODE
+ if (!_stdOutMode && _extractMode && _ntOptions.NtSecurity.Val && _arc->GetRawProps)
+ {
+ const void *data;
+ UInt32 dataSize;
+ UInt32 propType;
+ _arc->GetRawProps->GetRawProp(_index, kpidNtSecure, &data, &dataSize, &propType);
+ if (dataSize != 0)
+ {
+ if (propType != NPropDataType::kRaw)
+ return E_FAIL;
+ if (CheckNtSecure((const Byte *)data, dataSize))
+ {
+ SECURITY_INFORMATION securInfo = DACL_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | OWNER_SECURITY_INFORMATION;
+ if (_saclEnabled)
+ securInfo |= SACL_SECURITY_INFORMATION;
+ ::SetFileSecurityW(fs2us(_diskFilePath), securInfo, (PSECURITY_DESCRIPTOR)(void *)data);
+ }
+ }
+ }
+ #endif
+
+ if (!_curSizeDefined)
+ GetUnpackSize();
+
+ if (_curSizeDefined)
+ {
+ #ifdef SUPPORT_ALT_STREAMS
+ if (_item.IsAltStream)
+ AltStreams_UnpackSize += _curSize;
+ else
+ #endif
+ UnpackSize += _curSize;
+ }
+
+ if (_item.IsDir)
+ NumFolders++;
+ #ifdef SUPPORT_ALT_STREAMS
+ else if (_item.IsAltStream)
+ NumAltStreams++;
+ #endif
+ else
+ NumFiles++;
+
+ if (!_stdOutMode && _extractMode && _fi.AttribDefined)
+ SetFileAttrib_PosixHighDetect(_diskFilePath, _fi.Attrib);
+
+ RINOK(_extractCallback2->SetOperationResult(opRes, BoolToInt(_encrypted)));
+
+ return S_OK;
+
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveExtractCallback::ReportExtractResult(UInt32 indexType, UInt32 index, Int32 opRes)
+{
+ if (_folderArchiveExtractCallback2)
+ {
+ bool isEncrypted = false;
+ UString s;
+
+ if (indexType == NArchive::NEventIndexType::kInArcIndex && index != (UInt32)(Int32)-1)
+ {
+ CReadArcItem item;
+ RINOK(_arc->GetItem(index, item));
+ s = item.Path;
+ RINOK(Archive_GetItemBoolProp(_arc->Archive, index, kpidEncrypted, isEncrypted));
+ }
+ else
+ {
+ s = '#';
+ s.Add_UInt32(index);
+ // if (indexType == NArchive::NEventIndexType::kBlockIndex) {}
+ }
+
+ return _folderArchiveExtractCallback2->ReportExtractResult(opRes, isEncrypted, s);
+ }
+
+ return S_OK;
+}
+
+
+STDMETHODIMP CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password)
+{
+ COM_TRY_BEGIN
+ if (!_cryptoGetTextPassword)
+ {
+ RINOK(_extractCallback2.QueryInterface(IID_ICryptoGetTextPassword,
+ &_cryptoGetTextPassword));
+ }
+ return _cryptoGetTextPassword->CryptoGetTextPassword(password);
+ COM_TRY_END
+}
+
+
+void CDirPathSortPair::SetNumSlashes(const FChar *s)
+{
+ for (unsigned numSlashes = 0;;)
+ {
+ FChar c = *s++;
+ if (c == 0)
+ {
+ Len = numSlashes;
+ return;
+ }
+ if (IS_PATH_SEPAR(c))
+ numSlashes++;
+ }
+}
+
+
+bool CDirPathTime::SetDirTime()
+{
+ return NDir::SetDirTime(Path,
+ CTimeDefined ? &CTime : NULL,
+ ATimeDefined ? &ATime : NULL,
+ MTimeDefined ? &MTime : NULL);
+}
+
+
+HRESULT CArchiveExtractCallback::SetDirsTimes()
+{
+ if (!_arc)
+ return S_OK;
+
+ CRecordVector<CDirPathSortPair> pairs;
+ pairs.ClearAndSetSize(_extractedFolders.Size());
+ unsigned i;
+
+ for (i = 0; i < _extractedFolders.Size(); i++)
+ {
+ CDirPathSortPair &pair = pairs[i];
+ pair.Index = i;
+ pair.SetNumSlashes(_extractedFolders[i].Path);
+ }
+
+ pairs.Sort2();
+
+ for (i = 0; i < pairs.Size(); i++)
+ {
+ _extractedFolders[pairs[i].Index].SetDirTime();
+ // if (!) return GetLastError();
+ }
+
+ ClearExtractedDirsInfo();
+ return S_OK;
+}
+
+
+HRESULT CArchiveExtractCallback::CloseArc()
+{
+ HRESULT res = CloseFile();
+ HRESULT res2 = SetDirsTimes();
+ if (res == S_OK)
+ res = res2;
+ _arc = NULL;
+ return res;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.h
new file mode 100644
index 0000000000..af38f13c3b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveExtractCallback.h
@@ -0,0 +1,403 @@
+// ArchiveExtractCallback.h
+
+#ifndef __ARCHIVE_EXTRACT_CALLBACK_H
+#define __ARCHIVE_EXTRACT_CALLBACK_H
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../IPassword.h"
+
+#include "../../Common/FileStreams.h"
+#include "../../Common/ProgressUtils.h"
+
+#include "../../Archive/IArchive.h"
+
+#include "ExtractMode.h"
+#include "IFileExtractCallback.h"
+#include "OpenArchive.h"
+
+#include "HashCalc.h"
+
+#ifndef _SFX
+
+class COutStreamWithHash:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ CMyComPtr<ISequentialOutStream> _stream;
+ UInt64 _size;
+ bool _calculate;
+public:
+ IHashCalc *_hash;
+
+ MY_UNKNOWN_IMP
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ void SetStream(ISequentialOutStream *stream) { _stream = stream; }
+ void ReleaseStream() { _stream.Release(); }
+ void Init(bool calculate = true)
+ {
+ InitCRC();
+ _size = 0;
+ _calculate = calculate;
+ }
+ void EnableCalc(bool calculate) { _calculate = calculate; }
+ void InitCRC() { _hash->InitForNewFile(); }
+ UInt64 GetSize() const { return _size; }
+};
+
+#endif
+
+struct CExtractNtOptions
+{
+ CBoolPair NtSecurity;
+ CBoolPair SymLinks;
+ CBoolPair HardLinks;
+ CBoolPair AltStreams;
+ bool ReplaceColonForAltStream;
+ bool WriteToAltStreamIfColon;
+
+ bool PreAllocateOutFile;
+
+ CExtractNtOptions():
+ ReplaceColonForAltStream(false),
+ WriteToAltStreamIfColon(false)
+ {
+ SymLinks.Val = true;
+ HardLinks.Val = true;
+ AltStreams.Val = true;
+
+ PreAllocateOutFile =
+ #ifdef _WIN32
+ true;
+ #else
+ false;
+ #endif
+ }
+};
+
+#ifndef _SFX
+
+class CGetProp:
+ public IGetProp,
+ public CMyUnknownImp
+{
+public:
+ const CArc *Arc;
+ UInt32 IndexInArc;
+ // UString Name; // relative path
+
+ MY_UNKNOWN_IMP1(IGetProp)
+ INTERFACE_IGetProp(;)
+};
+
+#endif
+
+#ifndef _SFX
+#ifndef UNDER_CE
+
+#define SUPPORT_LINKS
+
+#endif
+#endif
+
+
+#ifdef SUPPORT_LINKS
+
+struct CHardLinkNode
+{
+ UInt64 StreamId;
+ UInt64 INode;
+
+ int Compare(const CHardLinkNode &a) const;
+};
+
+class CHardLinks
+{
+public:
+ CRecordVector<CHardLinkNode> IDs;
+ CObjectVector<FString> Links;
+
+ void Clear()
+ {
+ IDs.Clear();
+ Links.Clear();
+ }
+
+ void PrepareLinks()
+ {
+ while (Links.Size() < IDs.Size())
+ Links.AddNew();
+ }
+};
+
+#endif
+
+#ifdef SUPPORT_ALT_STREAMS
+
+struct CIndexToPathPair
+{
+ UInt32 Index;
+ FString Path;
+
+ CIndexToPathPair(UInt32 index): Index(index) {}
+ CIndexToPathPair(UInt32 index, const FString &path): Index(index), Path(path) {}
+
+ int Compare(const CIndexToPathPair &pair) const
+ {
+ return MyCompare(Index, pair.Index);
+ }
+};
+
+#endif
+
+
+
+struct CDirPathTime
+{
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+
+ bool CTimeDefined;
+ bool ATimeDefined;
+ bool MTimeDefined;
+
+ FString Path;
+
+ bool SetDirTime();
+};
+
+
+
+class CArchiveExtractCallback:
+ public IArchiveExtractCallback,
+ public IArchiveExtractCallbackMessage,
+ public ICryptoGetTextPassword,
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+ const CArc *_arc;
+ CExtractNtOptions _ntOptions;
+
+ const NWildcard::CCensorNode *_wildcardCensor; // we need wildcard for single pass mode (stdin)
+ CMyComPtr<IFolderArchiveExtractCallback> _extractCallback2;
+ CMyComPtr<ICompressProgressInfo> _compressProgress;
+ CMyComPtr<ICryptoGetTextPassword> _cryptoGetTextPassword;
+ CMyComPtr<IArchiveExtractCallbackMessage> _callbackMessage;
+ CMyComPtr<IFolderArchiveExtractCallback2> _folderArchiveExtractCallback2;
+
+ FString _dirPathPrefix;
+ FString _dirPathPrefix_Full;
+ NExtract::NPathMode::EEnum _pathMode;
+ NExtract::NOverwriteMode::EEnum _overwriteMode;
+ bool _keepAndReplaceEmptyDirPrefixes; // replace them to "_";
+
+ #ifndef _SFX
+
+ CMyComPtr<IFolderExtractToStreamCallback> ExtractToStreamCallback;
+ CGetProp *GetProp_Spec;
+ CMyComPtr<IGetProp> GetProp;
+
+ #endif
+
+ CReadArcItem _item;
+ FString _diskFilePath;
+ UInt64 _position;
+ bool _isSplit;
+
+ bool _extractMode;
+
+ bool WriteCTime;
+ bool WriteATime;
+ bool WriteMTime;
+
+ bool _encrypted;
+
+ struct CProcessedFileInfo
+ {
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+ UInt32 Attrib;
+
+ bool CTimeDefined;
+ bool ATimeDefined;
+ bool MTimeDefined;
+ bool AttribDefined;
+ } _fi;
+
+ UInt32 _index;
+ UInt64 _curSize;
+ bool _curSizeDefined;
+ bool _fileLengthWasSet;
+ COutFileStream *_outFileStreamSpec;
+ CMyComPtr<ISequentialOutStream> _outFileStream;
+
+ #ifndef _SFX
+
+ COutStreamWithHash *_hashStreamSpec;
+ CMyComPtr<ISequentialOutStream> _hashStream;
+ bool _hashStreamWasUsed;
+
+ #endif
+
+ bool _removePartsForAltStreams;
+ UStringVector _removePathParts;
+
+ #ifndef _SFX
+ bool _use_baseParentFolder_mode;
+ UInt32 _baseParentFolder;
+ #endif
+
+ bool _stdOutMode;
+ bool _testMode;
+ bool _multiArchives;
+
+ CMyComPtr<ICompressProgressInfo> _localProgress;
+ UInt64 _packTotal;
+
+ UInt64 _progressTotal;
+ bool _progressTotal_Defined;
+
+ CObjectVector<CDirPathTime> _extractedFolders;
+
+ #if defined(_WIN32) && !defined(UNDER_CE) && !defined(_SFX)
+ bool _saclEnabled;
+ #endif
+
+ void CreateComplexDirectory(const UStringVector &dirPathParts, FString &fullPath);
+ HRESULT GetTime(UInt32 index, PROPID propID, FILETIME &filetime, bool &filetimeIsDefined);
+ HRESULT GetUnpackSize();
+
+ HRESULT SendMessageError(const char *message, const FString &path);
+ HRESULT SendMessageError_with_LastError(const char *message, const FString &path);
+ HRESULT SendMessageError2(const char *message, const FString &path1, const FString &path2);
+
+public:
+
+ CLocalProgress *LocalProgressSpec;
+
+ UInt64 NumFolders;
+ UInt64 NumFiles;
+ UInt64 NumAltStreams;
+ UInt64 UnpackSize;
+ UInt64 AltStreams_UnpackSize;
+
+ MY_UNKNOWN_IMP3(IArchiveExtractCallbackMessage, ICryptoGetTextPassword, ICompressProgressInfo)
+
+ INTERFACE_IArchiveExtractCallback(;)
+ INTERFACE_IArchiveExtractCallbackMessage(;)
+
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+
+ CArchiveExtractCallback();
+
+ void InitForMulti(bool multiArchives,
+ NExtract::NPathMode::EEnum pathMode,
+ NExtract::NOverwriteMode::EEnum overwriteMode,
+ bool keepAndReplaceEmptyDirPrefixes)
+ {
+ _multiArchives = multiArchives;
+ _pathMode = pathMode;
+ _overwriteMode = overwriteMode;
+ _keepAndReplaceEmptyDirPrefixes = keepAndReplaceEmptyDirPrefixes;
+ NumFolders = NumFiles = NumAltStreams = UnpackSize = AltStreams_UnpackSize = 0;
+ }
+
+ #ifndef _SFX
+
+ void SetHashMethods(IHashCalc *hash)
+ {
+ if (!hash)
+ return;
+ _hashStreamSpec = new COutStreamWithHash;
+ _hashStream = _hashStreamSpec;
+ _hashStreamSpec->_hash = hash;
+ }
+
+ #endif
+
+ void Init(
+ const CExtractNtOptions &ntOptions,
+ const NWildcard::CCensorNode *wildcardCensor,
+ const CArc *arc,
+ IFolderArchiveExtractCallback *extractCallback2,
+ bool stdOutMode, bool testMode,
+ const FString &directoryPath,
+ const UStringVector &removePathParts, bool removePartsForAltStreams,
+ UInt64 packSize);
+
+
+ #ifdef SUPPORT_LINKS
+
+private:
+ CHardLinks _hardLinks;
+ UString linkPath;
+
+ // FString _CopyFile_Path;
+ // HRESULT MyCopyFile(ISequentialOutStream *outStream);
+
+public:
+ // call PrepareHardLinks() after Init()
+ HRESULT PrepareHardLinks(const CRecordVector<UInt32> *realIndices); // NULL means all items
+
+ #endif
+
+
+ #ifdef SUPPORT_ALT_STREAMS
+ CObjectVector<CIndexToPathPair> _renamedFiles;
+ #endif
+
+ // call it after Init()
+
+ #ifndef _SFX
+ void SetBaseParentFolderIndex(UInt32 indexInArc)
+ {
+ _baseParentFolder = indexInArc;
+ _use_baseParentFolder_mode = true;
+ }
+ #endif
+
+ HRESULT CloseArc();
+
+private:
+ void ClearExtractedDirsInfo()
+ {
+ _extractedFolders.Clear();
+ }
+
+ HRESULT CloseFile();
+ HRESULT SetDirsTimes();
+};
+
+
+struct CArchiveExtractCallback_Closer
+{
+ CArchiveExtractCallback *_ref;
+
+ CArchiveExtractCallback_Closer(CArchiveExtractCallback *ref): _ref(ref) {}
+
+ HRESULT Close()
+ {
+ HRESULT res = S_OK;
+ if (_ref)
+ {
+ res = _ref->CloseArc();
+ _ref = NULL;
+ }
+ return res;
+ }
+
+ ~CArchiveExtractCallback_Closer()
+ {
+ Close();
+ }
+};
+
+
+bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.cpp
new file mode 100644
index 0000000000..aa47f7afdd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.cpp
@@ -0,0 +1,78 @@
+// ArchiveName.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileName.h"
+
+#include "ExtractingFilePath.h"
+#include "ArchiveName.h"
+
+using namespace NWindows;
+using namespace NFile;
+
+UString CreateArchiveName(const NFind::CFileInfo &fi, bool keepName)
+{
+ FString resultName = fi.Name;
+ if (!fi.IsDir() && !keepName)
+ {
+ int dotPos = resultName.ReverseFind_Dot();
+ if (dotPos > 0)
+ {
+ FString archiveName2 = resultName.Left(dotPos);
+ if (archiveName2.ReverseFind_Dot() < 0)
+ resultName = archiveName2;
+ }
+ }
+ return Get_Correct_FsFile_Name(fs2us(resultName));
+}
+
+static FString CreateArchiveName2(const FString &path, bool fromPrev, bool keepName)
+{
+ FString resultName ("Archive");
+ if (fromPrev)
+ {
+ FString dirPrefix;
+ if (NDir::GetOnlyDirPrefix(path, dirPrefix))
+ {
+ if (!dirPrefix.IsEmpty() && IsPathSepar(dirPrefix.Back()))
+ {
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (NName::IsDriveRootPath_SuperAllowed(dirPrefix))
+ resultName = dirPrefix[dirPrefix.Len() - 3]; // only letter
+ else
+ #endif
+ {
+ dirPrefix.DeleteBack();
+ NFind::CFileInfo fi;
+ if (fi.Find(dirPrefix))
+ resultName = fi.Name;
+ }
+ }
+ }
+ }
+ else
+ {
+ NFind::CFileInfo fi;
+ if (fi.Find(path))
+ {
+ resultName = fi.Name;
+ if (!fi.IsDir() && !keepName)
+ {
+ int dotPos = resultName.ReverseFind_Dot();
+ if (dotPos > 0)
+ {
+ FString name2 = resultName.Left(dotPos);
+ if (name2.ReverseFind_Dot() < 0)
+ resultName = name2;
+ }
+ }
+ }
+ }
+ return resultName;
+}
+
+UString CreateArchiveName(const UString &path, bool fromPrev, bool keepName)
+{
+ return Get_Correct_FsFile_Name(fs2us(CreateArchiveName2(us2fs(path), fromPrev, keepName)));
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.h
new file mode 100644
index 0000000000..7b49c7bb97
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveName.h
@@ -0,0 +1,13 @@
+// ArchiveName.h
+
+#ifndef __ARCHIVE_NAME_H
+#define __ARCHIVE_NAME_H
+
+#include "../../../Common/MyString.h"
+
+#include "../../../Windows/FileFind.h"
+
+UString CreateArchiveName(const UString &path, bool fromPrev, bool keepName);
+UString CreateArchiveName(const NWindows::NFile::NFind::CFileInfo &fileInfo, bool keepName);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp
new file mode 100644
index 0000000000..a9fda7b2cb
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.cpp
@@ -0,0 +1,154 @@
+// ArchiveOpenCallback.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/ComTry.h"
+
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/PropVariant.h"
+
+#include "../../Common/FileStreams.h"
+
+#include "ArchiveOpenCallback.h"
+
+using namespace NWindows;
+
+STDMETHODIMP COpenCallbackImp::SetTotal(const UInt64 *files, const UInt64 *bytes)
+{
+ COM_TRY_BEGIN
+ if (ReOpenCallback)
+ return ReOpenCallback->SetTotal(files, bytes);
+ if (!Callback)
+ return S_OK;
+ return Callback->Open_SetTotal(files, bytes);
+ COM_TRY_END
+}
+
+STDMETHODIMP COpenCallbackImp::SetCompleted(const UInt64 *files, const UInt64 *bytes)
+{
+ COM_TRY_BEGIN
+ if (ReOpenCallback)
+ return ReOpenCallback->SetCompleted(files, bytes);
+ if (!Callback)
+ return S_OK;
+ return Callback->Open_SetCompleted(files, bytes);
+ COM_TRY_END
+}
+
+STDMETHODIMP COpenCallbackImp::GetProperty(PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ NCOM::CPropVariant prop;
+ if (_subArchiveMode)
+ switch (propID)
+ {
+ case kpidName: prop = _subArchiveName; break;
+ // case kpidSize: prop = _subArchiveSize; break; // we don't use it now
+ }
+ else
+ switch (propID)
+ {
+ case kpidName: prop = _fileInfo.Name; break;
+ case kpidIsDir: prop = _fileInfo.IsDir(); break;
+ case kpidSize: prop = _fileInfo.Size; break;
+ case kpidAttrib: prop = (UInt32)_fileInfo.Attrib; break;
+ case kpidCTime: prop = _fileInfo.CTime; break;
+ case kpidATime: prop = _fileInfo.ATime; break;
+ case kpidMTime: prop = _fileInfo.MTime; break;
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+struct CInFileStreamVol: public CInFileStream
+{
+ int FileNameIndex;
+ COpenCallbackImp *OpenCallbackImp;
+ CMyComPtr<IArchiveOpenCallback> OpenCallbackRef;
+
+ ~CInFileStreamVol()
+ {
+ if (OpenCallbackRef)
+ OpenCallbackImp->FileNames_WasUsed[FileNameIndex] = false;
+ }
+};
+
+
+// from ArchiveExtractCallback.cpp
+bool IsSafePath(const UString &path);
+
+STDMETHODIMP COpenCallbackImp::GetStream(const wchar_t *name, IInStream **inStream)
+{
+ COM_TRY_BEGIN
+ *inStream = NULL;
+
+ if (_subArchiveMode)
+ return S_FALSE;
+ if (Callback)
+ {
+ RINOK(Callback->Open_CheckBreak());
+ }
+
+ UString name2 = name;
+
+
+ #ifndef _SFX
+
+ #ifdef _WIN32
+ name2.Replace(L'/', WCHAR_PATH_SEPARATOR);
+ #endif
+
+ // if (!allowAbsVolPaths)
+ if (!IsSafePath(name2))
+ return S_FALSE;
+
+ #endif
+
+
+ FString fullPath;
+ if (!NFile::NName::GetFullPath(_folderPrefix, us2fs(name2), fullPath))
+ return S_FALSE;
+ if (!_fileInfo.Find(fullPath))
+ return S_FALSE;
+ if (_fileInfo.IsDir())
+ return S_FALSE;
+ CInFileStreamVol *inFile = new CInFileStreamVol;
+ CMyComPtr<IInStream> inStreamTemp = inFile;
+ if (!inFile->Open(fullPath))
+ {
+ DWORD lastError = ::GetLastError();
+ if (lastError == 0)
+ return E_FAIL;
+ return HRESULT_FROM_WIN32(lastError);
+ }
+
+ FileSizes.Add(_fileInfo.Size);
+ FileNames.Add(name2);
+ inFile->FileNameIndex = FileNames_WasUsed.Add(true);
+ inFile->OpenCallbackImp = this;
+ inFile->OpenCallbackRef = this;
+ // TotalSize += _fileInfo.Size;
+ *inStream = inStreamTemp.Detach();
+ return S_OK;
+ COM_TRY_END
+}
+
+#ifndef _NO_CRYPTO
+STDMETHODIMP COpenCallbackImp::CryptoGetTextPassword(BSTR *password)
+{
+ COM_TRY_BEGIN
+ if (ReOpenCallback)
+ {
+ CMyComPtr<ICryptoGetTextPassword> getTextPassword;
+ ReOpenCallback.QueryInterface(IID_ICryptoGetTextPassword, &getTextPassword);
+ if (getTextPassword)
+ return getTextPassword->CryptoGetTextPassword(password);
+ }
+ if (!Callback)
+ return E_NOTIMPL;
+ PasswordWasAsked = true;
+ return Callback->Open_CryptoGetTextPassword(password);
+ COM_TRY_END
+}
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.h
new file mode 100644
index 0000000000..7f7548f9c4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ArchiveOpenCallback.h
@@ -0,0 +1,112 @@
+// ArchiveOpenCallback.h
+
+#ifndef __ARCHIVE_OPEN_CALLBACK_H
+#define __ARCHIVE_OPEN_CALLBACK_H
+
+#include "../../../Common/MyCom.h"
+
+#include "../../../Windows/FileFind.h"
+
+#ifndef _NO_CRYPTO
+#include "../../IPassword.h"
+#endif
+#include "../../Archive/IArchive.h"
+
+#ifdef _NO_CRYPTO
+
+#define INTERFACE_IOpenCallbackUI_Crypto(x)
+
+#else
+
+#define INTERFACE_IOpenCallbackUI_Crypto(x) \
+ virtual HRESULT Open_CryptoGetTextPassword(BSTR *password) x; \
+ /* virtual HRESULT Open_GetPasswordIfAny(bool &passwordIsDefined, UString &password) x; */ \
+ /* virtual bool Open_WasPasswordAsked() x; */ \
+ /* virtual void Open_Clear_PasswordWasAsked_Flag() x; */ \
+
+#endif
+
+#define INTERFACE_IOpenCallbackUI(x) \
+ virtual HRESULT Open_CheckBreak() x; \
+ virtual HRESULT Open_SetTotal(const UInt64 *files, const UInt64 *bytes) x; \
+ virtual HRESULT Open_SetCompleted(const UInt64 *files, const UInt64 *bytes) x; \
+ virtual HRESULT Open_Finished() x; \
+ INTERFACE_IOpenCallbackUI_Crypto(x)
+
+struct IOpenCallbackUI
+{
+ INTERFACE_IOpenCallbackUI(=0)
+};
+
+class COpenCallbackImp:
+ public IArchiveOpenCallback,
+ public IArchiveOpenVolumeCallback,
+ public IArchiveOpenSetSubArchiveName,
+ #ifndef _NO_CRYPTO
+ public ICryptoGetTextPassword,
+ #endif
+ public CMyUnknownImp
+{
+public:
+ MY_QUERYINTERFACE_BEGIN2(IArchiveOpenVolumeCallback)
+ MY_QUERYINTERFACE_ENTRY(IArchiveOpenSetSubArchiveName)
+ #ifndef _NO_CRYPTO
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ INTERFACE_IArchiveOpenCallback(;)
+ INTERFACE_IArchiveOpenVolumeCallback(;)
+
+ #ifndef _NO_CRYPTO
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+ #endif
+
+ STDMETHOD(SetSubArchiveName(const wchar_t *name))
+ {
+ _subArchiveMode = true;
+ _subArchiveName = name;
+ // TotalSize = 0;
+ return S_OK;
+ }
+
+private:
+ FString _folderPrefix;
+ NWindows::NFile::NFind::CFileInfo _fileInfo;
+ bool _subArchiveMode;
+ UString _subArchiveName;
+
+public:
+ UStringVector FileNames;
+ CBoolVector FileNames_WasUsed;
+ CRecordVector<UInt64> FileSizes;
+
+ bool PasswordWasAsked;
+
+ IOpenCallbackUI *Callback;
+ CMyComPtr<IArchiveOpenCallback> ReOpenCallback;
+ // UInt64 TotalSize;
+
+ COpenCallbackImp(): Callback(NULL), _subArchiveMode(false) {}
+
+ void Init(const FString &folderPrefix, const FString &fileName)
+ {
+ _folderPrefix = folderPrefix;
+ if (!_fileInfo.Find(_folderPrefix + fileName))
+ throw 20121118;
+ FileNames.Clear();
+ FileNames_WasUsed.Clear();
+ FileSizes.Clear();
+ _subArchiveMode = false;
+ // TotalSize = 0;
+ PasswordWasAsked = false;
+ }
+
+ bool SetSecondFileInfo(CFSTR newName)
+ {
+ return _fileInfo.Find(newName) && !_fileInfo.IsDir();
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.cpp
new file mode 100644
index 0000000000..c0d0e5497c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.cpp
@@ -0,0 +1,3492 @@
+// Bench.cpp
+
+#include "StdAfx.h"
+
+#include <stdio.h>
+
+#ifndef _WIN32
+#define USE_POSIX_TIME
+#define USE_POSIX_TIME2
+#endif
+
+#ifdef USE_POSIX_TIME
+#include <time.h>
+#ifdef USE_POSIX_TIME2
+#include <sys/time.h>
+#endif
+#endif
+
+#ifdef _WIN32
+#define USE_ALLOCA
+#endif
+
+#ifdef USE_ALLOCA
+#ifdef _WIN32
+#include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
+#endif
+
+#include "../../../../C/7zCrc.h"
+#include "../../../../C/Alloc.h"
+#include "../../../../C/CpuArch.h"
+
+#ifndef _7ZIP_ST
+#include "../../../Windows/Synchronization.h"
+#include "../../../Windows/Thread.h"
+#endif
+
+#if defined(_WIN32) || defined(UNIX_USE_WIN_FILE)
+#define USE_WIN_FILE
+#endif
+
+#ifdef USE_WIN_FILE
+#include "../../../Windows/FileIO.h"
+#endif
+
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/StringToInt.h"
+
+#include "../../Common/MethodProps.h"
+#include "../../Common/StreamUtils.h"
+
+#include "Bench.h"
+
+using namespace NWindows;
+
+static const UInt32 k_LZMA = 0x030101;
+
+static const UInt64 kComplexInCommands = (UInt64)1 <<
+ #ifdef UNDER_CE
+ 31;
+ #else
+ 34;
+ #endif
+
+static const UInt32 kComplexInSeconds = 4;
+
+static void SetComplexCommands(UInt32 complexInSeconds,
+ bool isSpecifiedFreq, UInt64 cpuFreq, UInt64 &complexInCommands)
+{
+ complexInCommands = kComplexInCommands;
+ const UInt64 kMinFreq = (UInt64)1000000 * 4;
+ const UInt64 kMaxFreq = (UInt64)1000000 * 20000;
+ if (cpuFreq < kMinFreq && !isSpecifiedFreq)
+ cpuFreq = kMinFreq;
+ if (cpuFreq < kMaxFreq || isSpecifiedFreq)
+ {
+ if (complexInSeconds != 0)
+ complexInCommands = complexInSeconds * cpuFreq;
+ else
+ complexInCommands = cpuFreq >> 2;
+ }
+}
+
+static const unsigned kNumHashDictBits = 17;
+static const UInt32 kFilterUnpackSize = (48 << 10);
+
+static const unsigned kOldLzmaDictBits = 30;
+
+static const UInt32 kAdditionalSize = (1 << 16);
+static const UInt32 kCompressedAdditionalSize = (1 << 10);
+static const UInt32 kMaxLzmaPropSize = 5;
+
+class CBaseRandomGenerator
+{
+ UInt32 A1;
+ UInt32 A2;
+public:
+ CBaseRandomGenerator() { Init(); }
+ void Init() { A1 = 362436069; A2 = 521288629;}
+ UInt32 GetRnd()
+ {
+ return
+ ((A1 = 36969 * (A1 & 0xffff) + (A1 >> 16)) << 16) +
+ ((A2 = 18000 * (A2 & 0xffff) + (A2 >> 16)) );
+ }
+};
+
+
+static const unsigned kBufferAlignment = 1 << 4;
+
+struct CBenchBuffer
+{
+ size_t BufferSize;
+
+ #ifdef _WIN32
+
+ Byte *Buffer;
+
+ CBenchBuffer(): BufferSize(0), Buffer(NULL) {}
+ ~CBenchBuffer() { ::MidFree(Buffer); }
+
+ void AllocAlignedMask(size_t size, size_t)
+ {
+ ::MidFree(Buffer);
+ BufferSize = 0;
+ Buffer = (Byte *)::MidAlloc(size);
+ if (Buffer)
+ BufferSize = size;
+ }
+
+ #else
+
+ Byte *Buffer;
+ Byte *_bufBase;
+
+ CBenchBuffer(): BufferSize(0), Buffer(NULL), _bufBase(NULL){}
+ ~CBenchBuffer() { ::MidFree(_bufBase); }
+
+ void AllocAlignedMask(size_t size, size_t alignMask)
+ {
+ ::MidFree(_bufBase);
+ Buffer = NULL;
+ BufferSize = 0;
+ _bufBase = (Byte *)::MidAlloc(size + alignMask);
+
+ if (_bufBase)
+ {
+ // Buffer = (Byte *)(((uintptr_t)_bufBase + alignMask) & ~(uintptr_t)alignMask);
+ Buffer = (Byte *)(((ptrdiff_t)_bufBase + alignMask) & ~(ptrdiff_t)alignMask);
+ BufferSize = size;
+ }
+ }
+
+ #endif
+
+ bool Alloc(size_t size)
+ {
+ if (Buffer && BufferSize == size)
+ return true;
+ AllocAlignedMask(size, kBufferAlignment - 1);
+ return (Buffer != NULL || size == 0);
+ }
+};
+
+
+class CBenchRandomGenerator: public CBenchBuffer
+{
+ static UInt32 GetVal(UInt32 &res, unsigned numBits)
+ {
+ UInt32 val = res & (((UInt32)1 << numBits) - 1);
+ res >>= numBits;
+ return val;
+ }
+
+ static UInt32 GetLen(UInt32 &r)
+ {
+ UInt32 len = GetVal(r, 2);
+ return GetVal(r, 1 + len);
+ }
+
+public:
+
+ void GenerateSimpleRandom(CBaseRandomGenerator *_RG_)
+ {
+ CBaseRandomGenerator rg = *_RG_;
+ const size_t bufSize = BufferSize;
+ Byte *buf = Buffer;
+ for (size_t i = 0; i < bufSize; i++)
+ buf[i] = (Byte)rg.GetRnd();
+ *_RG_ = rg;
+ }
+
+ void GenerateLz(unsigned dictBits, CBaseRandomGenerator *_RG_)
+ {
+ CBaseRandomGenerator rg = *_RG_;
+ UInt32 pos = 0;
+ UInt32 rep0 = 1;
+ const size_t bufSize = BufferSize;
+ Byte *buf = Buffer;
+ unsigned posBits = 1;
+
+ while (pos < bufSize)
+ {
+ UInt32 r = rg.GetRnd();
+ if (GetVal(r, 1) == 0 || pos < 1024)
+ buf[pos++] = (Byte)(r & 0xFF);
+ else
+ {
+ UInt32 len;
+ len = 1 + GetLen(r);
+
+ if (GetVal(r, 3) != 0)
+ {
+ len += GetLen(r);
+
+ while (((UInt32)1 << posBits) < pos)
+ posBits++;
+
+ unsigned numBitsMax = dictBits;
+ if (numBitsMax > posBits)
+ numBitsMax = posBits;
+
+ const unsigned kAddBits = 6;
+ unsigned numLogBits = 5;
+ if (numBitsMax <= (1 << 4) - 1 + kAddBits)
+ numLogBits = 4;
+
+ for (;;)
+ {
+ UInt32 ppp = GetVal(r, numLogBits) + kAddBits;
+ r = rg.GetRnd();
+ if (ppp > numBitsMax)
+ continue;
+ rep0 = GetVal(r, ppp);
+ if (rep0 < pos)
+ break;
+ r = rg.GetRnd();
+ }
+ rep0++;
+ }
+
+ {
+ UInt32 rem = (UInt32)bufSize - pos;
+ if (len > rem)
+ len = rem;
+ }
+ Byte *dest = buf + pos;
+ const Byte *src = dest - rep0;
+ pos += len;
+ for (UInt32 i = 0; i < len; i++)
+ *dest++ = *src++;
+ }
+ }
+
+ *_RG_ = rg;
+ }
+};
+
+
+class CBenchmarkInStream:
+ public ISequentialInStream,
+ public CMyUnknownImp
+{
+ const Byte *Data;
+ size_t Pos;
+ size_t Size;
+public:
+ MY_UNKNOWN_IMP
+ void Init(const Byte *data, size_t size)
+ {
+ Data = data;
+ Size = size;
+ Pos = 0;
+ }
+ STDMETHOD(Read)(void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CBenchmarkInStream::Read(void *data, UInt32 size, UInt32 *processedSize)
+{
+ size_t remain = Size - Pos;
+ UInt32 kMaxBlockSize = (1 << 20);
+ if (size > kMaxBlockSize)
+ size = kMaxBlockSize;
+ if (size > remain)
+ size = (UInt32)remain;
+ for (UInt32 i = 0; i < size; i++)
+ ((Byte *)data)[i] = Data[Pos + i];
+ Pos += size;
+ if (processedSize)
+ *processedSize = size;
+ return S_OK;
+}
+
+class CBenchmarkOutStream:
+ public ISequentialOutStream,
+ public CBenchBuffer,
+ public CMyUnknownImp
+{
+ // bool _overflow;
+public:
+ size_t Pos;
+ bool RealCopy;
+ bool CalcCrc;
+ UInt32 Crc;
+
+ // CBenchmarkOutStream(): _overflow(false) {}
+ void Init(bool realCopy, bool calcCrc)
+ {
+ Crc = CRC_INIT_VAL;
+ RealCopy = realCopy;
+ CalcCrc = calcCrc;
+ // _overflow = false;
+ Pos = 0;
+ }
+
+ // void Print() { printf("\n%8d %8d\n", (unsigned)BufferSize, (unsigned)Pos); }
+
+ MY_UNKNOWN_IMP
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CBenchmarkOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ size_t curSize = BufferSize - Pos;
+ if (curSize > size)
+ curSize = size;
+ if (curSize != 0)
+ {
+ if (RealCopy)
+ memcpy(Buffer + Pos, data, curSize);
+ if (CalcCrc)
+ Crc = CrcUpdate(Crc, data, curSize);
+ Pos += curSize;
+ }
+ if (processedSize)
+ *processedSize = (UInt32)curSize;
+ if (curSize != size)
+ {
+ // _overflow = true;
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
+class CCrcOutStream:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+public:
+ bool CalcCrc;
+ UInt32 Crc;
+ MY_UNKNOWN_IMP
+
+ CCrcOutStream(): CalcCrc(true) {};
+ void Init() { Crc = CRC_INIT_VAL; }
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+STDMETHODIMP CCrcOutStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (CalcCrc)
+ Crc = CrcUpdate(Crc, data, size);
+ if (processedSize)
+ *processedSize = size;
+ return S_OK;
+}
+
+static UInt64 GetTimeCount()
+{
+ #ifdef USE_POSIX_TIME
+ #ifdef USE_POSIX_TIME2
+ timeval v;
+ if (gettimeofday(&v, 0) == 0)
+ return (UInt64)(v.tv_sec) * 1000000 + v.tv_usec;
+ return (UInt64)time(NULL) * 1000000;
+ #else
+ return time(NULL);
+ #endif
+ #else
+ /*
+ LARGE_INTEGER value;
+ if (::QueryPerformanceCounter(&value))
+ return value.QuadPart;
+ */
+ return GetTickCount();
+ #endif
+}
+
+static UInt64 GetFreq()
+{
+ #ifdef USE_POSIX_TIME
+ #ifdef USE_POSIX_TIME2
+ return 1000000;
+ #else
+ return 1;
+ #endif
+ #else
+ /*
+ LARGE_INTEGER value;
+ if (::QueryPerformanceFrequency(&value))
+ return value.QuadPart;
+ */
+ return 1000;
+ #endif
+}
+
+#ifdef USE_POSIX_TIME
+
+struct CUserTime
+{
+ UInt64 Sum;
+ clock_t Prev;
+
+ void Init()
+ {
+ Prev = clock();
+ Sum = 0;
+ }
+
+ UInt64 GetUserTime()
+ {
+ clock_t v = clock();
+ Sum += v - Prev;
+ Prev = v;
+ return Sum;
+ }
+};
+
+#else
+
+static inline UInt64 GetTime64(const FILETIME &t) { return ((UInt64)t.dwHighDateTime << 32) | t.dwLowDateTime; }
+UInt64 GetWinUserTime()
+{
+ FILETIME creationTime, exitTime, kernelTime, userTime;
+ if (
+ #ifdef UNDER_CE
+ ::GetThreadTimes(::GetCurrentThread()
+ #else
+ ::GetProcessTimes(::GetCurrentProcess()
+ #endif
+ , &creationTime, &exitTime, &kernelTime, &userTime) != 0)
+ return GetTime64(userTime) + GetTime64(kernelTime);
+ return (UInt64)GetTickCount() * 10000;
+}
+
+struct CUserTime
+{
+ UInt64 StartTime;
+
+ void Init() { StartTime = GetWinUserTime(); }
+ UInt64 GetUserTime() { return GetWinUserTime() - StartTime; }
+};
+
+#endif
+
+static UInt64 GetUserFreq()
+{
+ #ifdef USE_POSIX_TIME
+ return CLOCKS_PER_SEC;
+ #else
+ return 10000000;
+ #endif
+}
+
+class CBenchProgressStatus
+{
+ #ifndef _7ZIP_ST
+ NSynchronization::CCriticalSection CS;
+ #endif
+public:
+ HRESULT Res;
+ bool EncodeMode;
+ void SetResult(HRESULT res)
+ {
+ #ifndef _7ZIP_ST
+ NSynchronization::CCriticalSectionLock lock(CS);
+ #endif
+ Res = res;
+ }
+ HRESULT GetResult()
+ {
+ #ifndef _7ZIP_ST
+ NSynchronization::CCriticalSectionLock lock(CS);
+ #endif
+ return Res;
+ }
+};
+
+struct CBenchInfoCalc
+{
+ CBenchInfo BenchInfo;
+ CUserTime UserTime;
+
+ void SetStartTime();
+ void SetFinishTime(CBenchInfo &dest);
+};
+
+void CBenchInfoCalc::SetStartTime()
+{
+ BenchInfo.GlobalFreq = GetFreq();
+ BenchInfo.UserFreq = GetUserFreq();
+ BenchInfo.GlobalTime = ::GetTimeCount();
+ BenchInfo.UserTime = 0;
+ UserTime.Init();
+}
+
+void CBenchInfoCalc::SetFinishTime(CBenchInfo &dest)
+{
+ dest = BenchInfo;
+ dest.GlobalTime = ::GetTimeCount() - BenchInfo.GlobalTime;
+ dest.UserTime = UserTime.GetUserTime();
+}
+
+class CBenchProgressInfo:
+ public ICompressProgressInfo,
+ public CMyUnknownImp,
+ public CBenchInfoCalc
+{
+public:
+ CBenchProgressStatus *Status;
+ HRESULT Res;
+ IBenchCallback *Callback;
+
+ CBenchProgressInfo(): Callback(0) {}
+ MY_UNKNOWN_IMP
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+};
+
+STDMETHODIMP CBenchProgressInfo::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ HRESULT res = Status->GetResult();
+ if (res != S_OK)
+ return res;
+ if (!Callback)
+ return res;
+ CBenchInfo info;
+ SetFinishTime(info);
+ if (Status->EncodeMode)
+ {
+ info.UnpackSize = BenchInfo.UnpackSize + *inSize;
+ info.PackSize = BenchInfo.PackSize + *outSize;
+ res = Callback->SetEncodeResult(info, false);
+ }
+ else
+ {
+ info.PackSize = BenchInfo.PackSize + *inSize;
+ info.UnpackSize = BenchInfo.UnpackSize + *outSize;
+ res = Callback->SetDecodeResult(info, false);
+ }
+ if (res != S_OK)
+ Status->SetResult(res);
+ return res;
+}
+
+static const unsigned kSubBits = 8;
+
+static UInt32 GetLogSize(UInt32 size)
+{
+ for (unsigned i = kSubBits; i < 32; i++)
+ for (UInt32 j = 0; j < (1 << kSubBits); j++)
+ if (size <= (((UInt32)1) << i) + (j << (i - kSubBits)))
+ return (i << kSubBits) + j;
+ return (32 << kSubBits);
+}
+
+static void NormalizeVals(UInt64 &v1, UInt64 &v2)
+{
+ while (v1 > 1000000)
+ {
+ v1 >>= 1;
+ v2 >>= 1;
+ }
+}
+
+UInt64 CBenchInfo::GetUsage() const
+{
+ UInt64 userTime = UserTime;
+ UInt64 userFreq = UserFreq;
+ UInt64 globalTime = GlobalTime;
+ UInt64 globalFreq = GlobalFreq;
+ NormalizeVals(userTime, userFreq);
+ NormalizeVals(globalFreq, globalTime);
+ if (userFreq == 0)
+ userFreq = 1;
+ if (globalTime == 0)
+ globalTime = 1;
+ return userTime * globalFreq * 1000000 / userFreq / globalTime;
+}
+
+UInt64 CBenchInfo::GetRatingPerUsage(UInt64 rating) const
+{
+ UInt64 userTime = UserTime;
+ UInt64 userFreq = UserFreq;
+ UInt64 globalTime = GlobalTime;
+ UInt64 globalFreq = GlobalFreq;
+ NormalizeVals(userFreq, userTime);
+ NormalizeVals(globalTime, globalFreq);
+ if (globalFreq == 0)
+ globalFreq = 1;
+ if (userTime == 0)
+ userTime = 1;
+ return userFreq * globalTime / globalFreq * rating / userTime;
+}
+
+static UInt64 MyMultDiv64(UInt64 value, UInt64 elapsedTime, UInt64 freq)
+{
+ UInt64 elTime = elapsedTime;
+ NormalizeVals(freq, elTime);
+ if (elTime == 0)
+ elTime = 1;
+ return value * freq / elTime;
+}
+
+UInt64 CBenchInfo::GetSpeed(UInt64 numCommands) const
+{
+ return MyMultDiv64(numCommands, GlobalTime, GlobalFreq);
+}
+
+struct CBenchProps
+{
+ bool LzmaRatingMode;
+
+ UInt32 EncComplex;
+ UInt32 DecComplexCompr;
+ UInt32 DecComplexUnc;
+
+ CBenchProps(): LzmaRatingMode(false) {}
+ void SetLzmaCompexity();
+
+ UInt64 GeComprCommands(UInt64 unpackSize)
+ {
+ return unpackSize * EncComplex;
+ }
+
+ UInt64 GeDecomprCommands(UInt64 packSize, UInt64 unpackSize)
+ {
+ return (packSize * DecComplexCompr + unpackSize * DecComplexUnc);
+ }
+
+ UInt64 GetCompressRating(UInt32 dictSize, UInt64 elapsedTime, UInt64 freq, UInt64 size);
+ UInt64 GetDecompressRating(UInt64 elapsedTime, UInt64 freq, UInt64 outSize, UInt64 inSize, UInt64 numIterations);
+};
+
+void CBenchProps::SetLzmaCompexity()
+{
+ EncComplex = 1200;
+ DecComplexUnc = 4;
+ DecComplexCompr = 190;
+ LzmaRatingMode = true;
+}
+
+UInt64 CBenchProps::GetCompressRating(UInt32 dictSize, UInt64 elapsedTime, UInt64 freq, UInt64 size)
+{
+ if (dictSize < (1 << kBenchMinDicLogSize))
+ dictSize = (1 << kBenchMinDicLogSize);
+ UInt64 encComplex = EncComplex;
+ if (LzmaRatingMode)
+ {
+ UInt64 t = GetLogSize(dictSize) - (kBenchMinDicLogSize << kSubBits);
+ encComplex = 870 + ((t * t * 5) >> (2 * kSubBits));
+ }
+ UInt64 numCommands = (UInt64)size * encComplex;
+ return MyMultDiv64(numCommands, elapsedTime, freq);
+}
+
+UInt64 CBenchProps::GetDecompressRating(UInt64 elapsedTime, UInt64 freq, UInt64 outSize, UInt64 inSize, UInt64 numIterations)
+{
+ UInt64 numCommands = (inSize * DecComplexCompr + outSize * DecComplexUnc) * numIterations;
+ return MyMultDiv64(numCommands, elapsedTime, freq);
+}
+
+UInt64 GetCompressRating(UInt32 dictSize, UInt64 elapsedTime, UInt64 freq, UInt64 size)
+{
+ CBenchProps props;
+ props.SetLzmaCompexity();
+ return props.GetCompressRating(dictSize, elapsedTime, freq, size);
+}
+
+UInt64 GetDecompressRating(UInt64 elapsedTime, UInt64 freq, UInt64 outSize, UInt64 inSize, UInt64 numIterations)
+{
+ CBenchProps props;
+ props.SetLzmaCompexity();
+ return props.GetDecompressRating(elapsedTime, freq, outSize, inSize, numIterations);
+}
+
+struct CEncoderInfo;
+
+struct CEncoderInfo
+{
+ #ifndef _7ZIP_ST
+ NWindows::CThread thread[2];
+ UInt32 NumDecoderSubThreads;
+ #endif
+ CMyComPtr<ICompressCoder> _encoder;
+ CMyComPtr<ICompressFilter> _encoderFilter;
+ CBenchProgressInfo *progressInfoSpec[2];
+ CMyComPtr<ICompressProgressInfo> progressInfo[2];
+ UInt64 NumIterations;
+
+ #ifdef USE_ALLOCA
+ size_t AllocaSize;
+ #endif
+
+ Byte _key[32];
+ Byte _iv[16];
+ Byte _psw[16];
+ bool CheckCrc_Enc;
+ bool CheckCrc_Dec;
+
+ struct CDecoderInfo
+ {
+ CEncoderInfo *Encoder;
+ UInt32 DecoderIndex;
+ bool CallbackMode;
+
+ #ifdef USE_ALLOCA
+ size_t AllocaSize;
+ #endif
+ };
+ CDecoderInfo decodersInfo[2];
+
+ CMyComPtr<ICompressCoder> _decoders[2];
+ CMyComPtr<ICompressFilter> _decoderFilter;
+
+ HRESULT Results[2];
+ CBenchmarkOutStream *outStreamSpec;
+ CMyComPtr<ISequentialOutStream> outStream;
+ IBenchCallback *callback;
+ IBenchPrintCallback *printCallback;
+ UInt32 crc;
+ size_t kBufferSize;
+ size_t compressedSize;
+ const Byte *uncompressedDataPtr;
+
+ const Byte *fileData;
+ CBenchRandomGenerator rg;
+
+ CBenchBuffer rgCopy; // it must be 16-byte aligned !!!
+ CBenchmarkOutStream *propStreamSpec;
+ CMyComPtr<ISequentialOutStream> propStream;
+
+ // for decode
+ COneMethodInfo _method;
+ size_t _uncompressedDataSize;
+
+ HRESULT Init(
+ const COneMethodInfo &method,
+ unsigned generateDictBits,
+ CBaseRandomGenerator *rg);
+ HRESULT Encode();
+ HRESULT Decode(UInt32 decoderIndex);
+
+ CEncoderInfo():
+ fileData(NULL),
+ CheckCrc_Enc(true),
+ CheckCrc_Dec(true),
+ outStreamSpec(0), callback(0), printCallback(0), propStreamSpec(0) {}
+
+ #ifndef _7ZIP_ST
+
+ static THREAD_FUNC_DECL EncodeThreadFunction(void *param)
+ {
+ HRESULT res;
+ CEncoderInfo *encoder = (CEncoderInfo *)param;
+ try
+ {
+ #ifdef USE_ALLOCA
+ alloca(encoder->AllocaSize);
+ #endif
+
+ res = encoder->Encode();
+ encoder->Results[0] = res;
+ }
+ catch(...)
+ {
+ res = E_FAIL;
+ }
+ if (res != S_OK)
+ encoder->progressInfoSpec[0]->Status->SetResult(res);
+ return 0;
+ }
+
+ static THREAD_FUNC_DECL DecodeThreadFunction(void *param)
+ {
+ CDecoderInfo *decoder = (CDecoderInfo *)param;
+
+ #ifdef USE_ALLOCA
+ alloca(decoder->AllocaSize);
+ #endif
+
+ CEncoderInfo *encoder = decoder->Encoder;
+ encoder->Results[decoder->DecoderIndex] = encoder->Decode(decoder->DecoderIndex);
+ return 0;
+ }
+
+ HRESULT CreateEncoderThread()
+ {
+ return thread[0].Create(EncodeThreadFunction, this);
+ }
+
+ HRESULT CreateDecoderThread(unsigned index, bool callbackMode
+ #ifdef USE_ALLOCA
+ , size_t allocaSize
+ #endif
+ )
+ {
+ CDecoderInfo &decoder = decodersInfo[index];
+ decoder.DecoderIndex = index;
+ decoder.Encoder = this;
+
+ #ifdef USE_ALLOCA
+ decoder.AllocaSize = allocaSize;
+ #endif
+
+ decoder.CallbackMode = callbackMode;
+ return thread[index].Create(DecodeThreadFunction, &decoder);
+ }
+
+ #endif
+};
+
+
+HRESULT CEncoderInfo::Init(
+ const COneMethodInfo &method,
+ unsigned generateDictBits,
+ CBaseRandomGenerator *rgLoc)
+{
+ // we need extra space, if input data is already compressed
+ const size_t kCompressedBufferSize =
+ kCompressedAdditionalSize +
+ kBufferSize + kBufferSize / 16;
+ // kBufferSize / 2;
+
+ if (kCompressedBufferSize < kBufferSize)
+ return E_FAIL;
+
+ uncompressedDataPtr = fileData;
+
+ if (!fileData)
+ {
+ if (!rg.Alloc(kBufferSize))
+ return E_OUTOFMEMORY;
+
+ // DWORD ttt = GetTickCount();
+ if (generateDictBits == 0)
+ rg.GenerateSimpleRandom(rgLoc);
+ else
+ rg.GenerateLz(generateDictBits, rgLoc);
+ // printf("\n%d\n ", GetTickCount() - ttt);
+
+ crc = CrcCalc(rg.Buffer, rg.BufferSize);
+ uncompressedDataPtr = rg.Buffer;
+ }
+
+ if (_encoderFilter)
+ {
+ if (!rgCopy.Alloc(kBufferSize))
+ return E_OUTOFMEMORY;
+ }
+
+
+ outStreamSpec = new CBenchmarkOutStream;
+ outStream = outStreamSpec;
+ if (!outStreamSpec->Alloc(kCompressedBufferSize))
+ return E_OUTOFMEMORY;
+
+ propStreamSpec = 0;
+ if (!propStream)
+ {
+ propStreamSpec = new CBenchmarkOutStream;
+ propStream = propStreamSpec;
+ }
+ if (!propStreamSpec->Alloc(kMaxLzmaPropSize))
+ return E_OUTOFMEMORY;
+ propStreamSpec->Init(true, false);
+
+
+ CMyComPtr<IUnknown> coder;
+ if (_encoderFilter)
+ coder = _encoderFilter;
+ else
+ coder = _encoder;
+ {
+ CMyComPtr<ICompressSetCoderProperties> scp;
+ coder.QueryInterface(IID_ICompressSetCoderProperties, &scp);
+ if (scp)
+ {
+ UInt64 reduceSize = kBufferSize;
+ RINOK(method.SetCoderProps(scp, &reduceSize));
+ }
+ else
+ {
+ if (method.AreThereNonOptionalProps())
+ return E_INVALIDARG;
+ }
+
+ CMyComPtr<ICompressWriteCoderProperties> writeCoderProps;
+ coder.QueryInterface(IID_ICompressWriteCoderProperties, &writeCoderProps);
+ if (writeCoderProps)
+ {
+ RINOK(writeCoderProps->WriteCoderProperties(propStream));
+ }
+
+ {
+ CMyComPtr<ICryptoSetPassword> sp;
+ coder.QueryInterface(IID_ICryptoSetPassword, &sp);
+ if (sp)
+ {
+ RINOK(sp->CryptoSetPassword(_psw, sizeof(_psw)));
+
+ // we must call encoding one time to calculate password key for key cache.
+ // it must be after WriteCoderProperties!
+ Byte temp[16];
+ memset(temp, 0, sizeof(temp));
+
+ if (_encoderFilter)
+ {
+ _encoderFilter->Init();
+ _encoderFilter->Filter(temp, sizeof(temp));
+ }
+ else
+ {
+ CBenchmarkInStream *inStreamSpec = new CBenchmarkInStream;
+ CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
+ inStreamSpec->Init(temp, sizeof(temp));
+
+ CCrcOutStream *crcStreamSpec = new CCrcOutStream;
+ CMyComPtr<ISequentialOutStream> crcStream = crcStreamSpec;
+ crcStreamSpec->Init();
+
+ RINOK(_encoder->Code(inStream, crcStream, 0, 0, NULL));
+ }
+ }
+ }
+ }
+
+ return S_OK;
+}
+
+
+static void My_FilterBench(ICompressFilter *filter, Byte *data, size_t size)
+{
+ while (size != 0)
+ {
+ UInt32 cur = (UInt32)1 << 31;
+ if (cur > size)
+ cur = (UInt32)size;
+ UInt32 processed = filter->Filter(data, cur);
+ data += processed;
+ // if (processed > size) (in AES filter), we must fill last block with zeros.
+ // but it is not important for benchmark. So we just copy that data without filtering.
+ if (processed > size || processed == 0)
+ break;
+ size -= processed;
+ }
+}
+
+
+HRESULT CEncoderInfo::Encode()
+{
+ CBenchInfo &bi = progressInfoSpec[0]->BenchInfo;
+ bi.UnpackSize = 0;
+ bi.PackSize = 0;
+ CMyComPtr<ICryptoProperties> cp;
+ CMyComPtr<IUnknown> coder;
+ if (_encoderFilter)
+ coder = _encoderFilter;
+ else
+ coder = _encoder;
+ coder.QueryInterface(IID_ICryptoProperties, &cp);
+ CBenchmarkInStream *inStreamSpec = new CBenchmarkInStream;
+ CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
+ UInt64 prev = 0;
+
+ UInt32 crcPrev = 0;
+
+ if (cp)
+ {
+ RINOK(cp->SetKey(_key, sizeof(_key)));
+ RINOK(cp->SetInitVector(_iv, sizeof(_iv)));
+ }
+
+ for (UInt64 i = 0; i < NumIterations; i++)
+ {
+ if (printCallback && bi.UnpackSize - prev > (1 << 20))
+ {
+ RINOK(printCallback->CheckBreak());
+ prev = bi.UnpackSize;
+ }
+
+ bool isLast = (i == NumIterations - 1);
+ bool calcCrc = ((isLast || (i & 0x7F) == 0 || CheckCrc_Enc) && NumIterations != 1);
+ outStreamSpec->Init(isLast, calcCrc);
+
+ if (_encoderFilter)
+ {
+ memcpy(rgCopy.Buffer, uncompressedDataPtr, kBufferSize);
+ _encoderFilter->Init();
+ My_FilterBench(_encoderFilter, rgCopy.Buffer, kBufferSize);
+ RINOK(WriteStream(outStream, rgCopy.Buffer, kBufferSize));
+ }
+ else
+ {
+ inStreamSpec->Init(uncompressedDataPtr, kBufferSize);
+ RINOK(_encoder->Code(inStream, outStream, NULL, NULL, progressInfo[0]));
+ }
+
+ // outStreamSpec->Print();
+
+ UInt32 crcNew = CRC_GET_DIGEST(outStreamSpec->Crc);
+ if (i == 0)
+ crcPrev = crcNew;
+ else if (calcCrc && crcPrev != crcNew)
+ return E_FAIL;
+
+ compressedSize = outStreamSpec->Pos;
+ bi.UnpackSize += kBufferSize;
+ bi.PackSize += compressedSize;
+ }
+
+ _encoder.Release();
+ _encoderFilter.Release();
+ return S_OK;
+}
+
+
+HRESULT CEncoderInfo::Decode(UInt32 decoderIndex)
+{
+ CBenchmarkInStream *inStreamSpec = new CBenchmarkInStream;
+ CMyComPtr<ISequentialInStream> inStream = inStreamSpec;
+ CMyComPtr<ICompressCoder> &decoder = _decoders[decoderIndex];
+ CMyComPtr<IUnknown> coder;
+ if (_decoderFilter)
+ {
+ if (decoderIndex != 0)
+ return E_FAIL;
+ coder = _decoderFilter;
+ }
+ else
+ coder = decoder;
+
+ CMyComPtr<ICompressSetDecoderProperties2> setDecProps;
+ coder.QueryInterface(IID_ICompressSetDecoderProperties2, &setDecProps);
+ if (!setDecProps && propStreamSpec->Pos != 0)
+ return E_FAIL;
+
+ CCrcOutStream *crcOutStreamSpec = new CCrcOutStream;
+ CMyComPtr<ISequentialOutStream> crcOutStream = crcOutStreamSpec;
+
+ CBenchProgressInfo *pi = progressInfoSpec[decoderIndex];
+ pi->BenchInfo.UnpackSize = 0;
+ pi->BenchInfo.PackSize = 0;
+
+ #ifndef _7ZIP_ST
+ {
+ CMyComPtr<ICompressSetCoderMt> setCoderMt;
+ coder.QueryInterface(IID_ICompressSetCoderMt, &setCoderMt);
+ if (setCoderMt)
+ {
+ RINOK(setCoderMt->SetNumberOfThreads(NumDecoderSubThreads));
+ }
+ }
+ #endif
+
+ CMyComPtr<ICompressSetCoderProperties> scp;
+ coder.QueryInterface(IID_ICompressSetCoderProperties, &scp);
+ if (scp)
+ {
+ UInt64 reduceSize = _uncompressedDataSize;
+ RINOK(_method.SetCoderProps(scp, &reduceSize));
+ }
+
+ CMyComPtr<ICryptoProperties> cp;
+ coder.QueryInterface(IID_ICryptoProperties, &cp);
+
+ if (setDecProps)
+ {
+ RINOK(setDecProps->SetDecoderProperties2(propStreamSpec->Buffer, (UInt32)propStreamSpec->Pos));
+ }
+
+ {
+ CMyComPtr<ICryptoSetPassword> sp;
+ coder.QueryInterface(IID_ICryptoSetPassword, &sp);
+ if (sp)
+ {
+ RINOK(sp->CryptoSetPassword(_psw, sizeof(_psw)));
+ }
+ }
+
+ UInt64 prev = 0;
+
+ if (cp)
+ {
+ RINOK(cp->SetKey(_key, sizeof(_key)));
+ RINOK(cp->SetInitVector(_iv, sizeof(_iv)));
+ }
+
+ for (UInt64 i = 0; i < NumIterations; i++)
+ {
+ if (printCallback && pi->BenchInfo.UnpackSize - prev > (1 << 20))
+ {
+ RINOK(printCallback->CheckBreak());
+ prev = pi->BenchInfo.UnpackSize;
+ }
+
+ inStreamSpec->Init(outStreamSpec->Buffer, compressedSize);
+ crcOutStreamSpec->Init();
+
+ UInt64 outSize = kBufferSize;
+ crcOutStreamSpec->CalcCrc = ((i & 0x7F) == 0 || CheckCrc_Dec);
+
+ if (_decoderFilter)
+ {
+ if (compressedSize > rgCopy.BufferSize)
+ return E_FAIL;
+ memcpy(rgCopy.Buffer, outStreamSpec->Buffer, compressedSize);
+ _decoderFilter->Init();
+ My_FilterBench(_decoderFilter, rgCopy.Buffer, compressedSize);
+ RINOK(WriteStream(crcOutStream, rgCopy.Buffer, compressedSize));
+ }
+ else
+ {
+ RINOK(decoder->Code(inStream, crcOutStream, 0, &outSize, progressInfo[decoderIndex]));
+ }
+
+ if (crcOutStreamSpec->CalcCrc && CRC_GET_DIGEST(crcOutStreamSpec->Crc) != crc)
+ return S_FALSE;
+ pi->BenchInfo.UnpackSize += kBufferSize;
+ pi->BenchInfo.PackSize += compressedSize;
+ }
+
+ decoder.Release();
+ _decoderFilter.Release();
+ return S_OK;
+}
+
+
+static const UInt32 kNumThreadsMax = (1 << 12);
+
+struct CBenchEncoders
+{
+ CEncoderInfo *encoders;
+ CBenchEncoders(UInt32 num): encoders(0) { encoders = new CEncoderInfo[num]; }
+ ~CBenchEncoders() { delete []encoders; }
+};
+
+
+static UInt64 GetNumIterations(UInt64 numCommands, UInt64 complexInCommands)
+{
+ if (numCommands < (1 << 4))
+ numCommands = (1 << 4);
+ UInt64 res = complexInCommands / numCommands;
+ return (res == 0 ? 1 : res);
+}
+
+
+static HRESULT MethodBench(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ UInt64 complexInCommands,
+ bool
+ #ifndef _7ZIP_ST
+ oldLzmaBenchMode
+ #endif
+ ,
+ UInt32
+ #ifndef _7ZIP_ST
+ numThreads
+ #endif
+ ,
+ const COneMethodInfo &method2,
+ size_t uncompressedDataSize,
+ const Byte *fileData,
+ unsigned generateDictBits,
+
+ IBenchPrintCallback *printCallback,
+ IBenchCallback *callback,
+ CBenchProps *benchProps)
+{
+ COneMethodInfo method = method2;
+ UInt64 methodId;
+ UInt32 numStreams;
+ int codecIndex = FindMethod_Index(
+ EXTERNAL_CODECS_LOC_VARS
+ method.MethodName, true,
+ methodId, numStreams);
+ if (codecIndex < 0)
+ return E_NOTIMPL;
+ if (numStreams != 1)
+ return E_INVALIDARG;
+
+ UInt32 numEncoderThreads = 1;
+ UInt32 numSubDecoderThreads = 1;
+
+ #ifndef _7ZIP_ST
+ numEncoderThreads = numThreads;
+
+ if (oldLzmaBenchMode && methodId == k_LZMA)
+ {
+ if (numThreads == 1 && method.Get_NumThreads() < 0)
+ method.AddProp_NumThreads(1);
+ const UInt32 numLzmaThreads = method.Get_Lzma_NumThreads();
+ if (numThreads > 1 && numLzmaThreads > 1)
+ {
+ numEncoderThreads = numThreads / 2;
+ numSubDecoderThreads = 2;
+ }
+ }
+ #endif
+
+ CBenchEncoders encodersSpec(numEncoderThreads);
+ CEncoderInfo *encoders = encodersSpec.encoders;
+
+ UInt32 i;
+
+ for (i = 0; i < numEncoderThreads; i++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+ encoder.callback = (i == 0) ? callback : 0;
+ encoder.printCallback = printCallback;
+
+ {
+ CCreatedCoder cod;
+ RINOK(CreateCoder_Index(EXTERNAL_CODECS_LOC_VARS codecIndex, true, encoder._encoderFilter, cod));
+ encoder._encoder = cod.Coder;
+ if (!encoder._encoder && !encoder._encoderFilter)
+ return E_NOTIMPL;
+ }
+
+ encoder.CheckCrc_Enc = (benchProps->EncComplex) > 30 ;
+ encoder.CheckCrc_Dec = (benchProps->DecComplexCompr + benchProps->DecComplexUnc) > 30 ;
+
+ memset(encoder._iv, 0, sizeof(encoder._iv));
+ memset(encoder._key, 0, sizeof(encoder._key));
+ memset(encoder._psw, 0, sizeof(encoder._psw));
+
+ for (UInt32 j = 0; j < numSubDecoderThreads; j++)
+ {
+ CCreatedCoder cod;
+ CMyComPtr<ICompressCoder> &decoder = encoder._decoders[j];
+ RINOK(CreateCoder_Id(EXTERNAL_CODECS_LOC_VARS methodId, false, encoder._decoderFilter, cod));
+ decoder = cod.Coder;
+ if (!encoder._decoderFilter && !decoder)
+ return E_NOTIMPL;
+ }
+ }
+
+ CBaseRandomGenerator rg;
+ rg.Init();
+
+ UInt32 crc = 0;
+ if (fileData)
+ crc = CrcCalc(fileData, uncompressedDataSize);
+
+ for (i = 0; i < numEncoderThreads; i++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+ encoder._method = method;
+ encoder._uncompressedDataSize = uncompressedDataSize;
+ encoder.kBufferSize = uncompressedDataSize;
+ encoder.fileData = fileData;
+ encoder.crc = crc;
+
+ RINOK(encoders[i].Init(method, generateDictBits, &rg));
+ }
+
+ CBenchProgressStatus status;
+ status.Res = S_OK;
+ status.EncodeMode = true;
+
+ for (i = 0; i < numEncoderThreads; i++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+ encoder.NumIterations = GetNumIterations(benchProps->GeComprCommands(uncompressedDataSize), complexInCommands);
+
+ for (int j = 0; j < 2; j++)
+ {
+ CBenchProgressInfo *spec = new CBenchProgressInfo;
+ encoder.progressInfoSpec[j] = spec;
+ encoder.progressInfo[j] = spec;
+ spec->Status = &status;
+ }
+
+ if (i == 0)
+ {
+ CBenchProgressInfo *bpi = encoder.progressInfoSpec[0];
+ bpi->Callback = callback;
+ bpi->BenchInfo.NumIterations = numEncoderThreads;
+ bpi->SetStartTime();
+ }
+
+ #ifndef _7ZIP_ST
+ if (numEncoderThreads > 1)
+ {
+ #ifdef USE_ALLOCA
+ encoder.AllocaSize = (i * 16 * 21) & 0x7FF;
+ #endif
+
+ RINOK(encoder.CreateEncoderThread())
+ }
+ else
+ #endif
+ {
+ RINOK(encoder.Encode());
+ }
+ }
+
+ #ifndef _7ZIP_ST
+ if (numEncoderThreads > 1)
+ for (i = 0; i < numEncoderThreads; i++)
+ encoders[i].thread[0].Wait();
+ #endif
+
+ RINOK(status.Res);
+
+ CBenchInfo info;
+
+ encoders[0].progressInfoSpec[0]->SetFinishTime(info);
+ info.UnpackSize = 0;
+ info.PackSize = 0;
+ info.NumIterations = encoders[0].NumIterations;
+
+ for (i = 0; i < numEncoderThreads; i++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+ info.UnpackSize += encoder.kBufferSize;
+ info.PackSize += encoder.compressedSize;
+ }
+
+ RINOK(callback->SetEncodeResult(info, true));
+
+
+ status.Res = S_OK;
+ status.EncodeMode = false;
+
+ UInt32 numDecoderThreads = numEncoderThreads * numSubDecoderThreads;
+
+ for (i = 0; i < numEncoderThreads; i++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+
+ if (i == 0)
+ {
+ encoder.NumIterations = GetNumIterations(benchProps->GeDecomprCommands(encoder.compressedSize, encoder.kBufferSize), complexInCommands);
+ CBenchProgressInfo *bpi = encoder.progressInfoSpec[0];
+ bpi->Callback = callback;
+ bpi->BenchInfo.NumIterations = numDecoderThreads;
+ bpi->SetStartTime();
+ }
+ else
+ encoder.NumIterations = encoders[0].NumIterations;
+
+ #ifndef _7ZIP_ST
+ {
+ int numSubThreads = method.Get_NumThreads();
+ encoder.NumDecoderSubThreads = (numSubThreads <= 0) ? 1 : numSubThreads;
+ }
+ if (numDecoderThreads > 1)
+ {
+ for (UInt32 j = 0; j < numSubDecoderThreads; j++)
+ {
+ HRESULT res = encoder.CreateDecoderThread(j, (i == 0 && j == 0)
+ #ifdef USE_ALLOCA
+ , ((i * numSubDecoderThreads + j) * 16 * 21) & 0x7FF
+ #endif
+ );
+ RINOK(res);
+ }
+ }
+ else
+ #endif
+ {
+ RINOK(encoder.Decode(0));
+ }
+ }
+
+ #ifndef _7ZIP_ST
+ HRESULT res = S_OK;
+ if (numDecoderThreads > 1)
+ for (i = 0; i < numEncoderThreads; i++)
+ for (UInt32 j = 0; j < numSubDecoderThreads; j++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+ encoder.thread[j].Wait();
+ if (encoder.Results[j] != S_OK)
+ res = encoder.Results[j];
+ }
+ RINOK(res);
+ #endif
+
+ RINOK(status.Res);
+ encoders[0].progressInfoSpec[0]->SetFinishTime(info);
+
+ #ifndef _7ZIP_ST
+ #ifdef UNDER_CE
+ if (numDecoderThreads > 1)
+ for (i = 0; i < numEncoderThreads; i++)
+ for (UInt32 j = 0; j < numSubDecoderThreads; j++)
+ {
+ FILETIME creationTime, exitTime, kernelTime, userTime;
+ if (::GetThreadTimes(encoders[i].thread[j], &creationTime, &exitTime, &kernelTime, &userTime) != 0)
+ info.UserTime += GetTime64(userTime) + GetTime64(kernelTime);
+ }
+ #endif
+ #endif
+
+ info.UnpackSize = 0;
+ info.PackSize = 0;
+ info.NumIterations = numSubDecoderThreads * encoders[0].NumIterations;
+
+ for (i = 0; i < numEncoderThreads; i++)
+ {
+ CEncoderInfo &encoder = encoders[i];
+ info.UnpackSize += encoder.kBufferSize;
+ info.PackSize += encoder.compressedSize;
+ }
+
+ RINOK(callback->SetDecodeResult(info, false));
+ RINOK(callback->SetDecodeResult(info, true));
+
+ return S_OK;
+}
+
+
+static inline UInt64 GetLZMAUsage(bool multiThread, UInt32 dictionary)
+{
+ UInt32 hs = dictionary - 1;
+ hs |= (hs >> 1);
+ hs |= (hs >> 2);
+ hs |= (hs >> 4);
+ hs |= (hs >> 8);
+ hs >>= 1;
+ hs |= 0xFFFF;
+ if (hs > (1 << 24))
+ hs >>= 1;
+ hs++;
+ return ((hs + (1 << 16)) + (UInt64)dictionary * 2) * 4 + (UInt64)dictionary * 3 / 2 +
+ (1 << 20) + (multiThread ? (6 << 20) : 0);
+}
+
+UInt64 GetBenchMemoryUsage(UInt32 numThreads, UInt32 dictionary, bool totalBench)
+{
+ const UInt32 kBufferSize = dictionary;
+ const UInt32 kCompressedBufferSize = kBufferSize; // / 2;
+ bool lzmaMt = (totalBench || numThreads > 1);
+ UInt32 numBigThreads = numThreads;
+ if (!totalBench && lzmaMt)
+ numBigThreads /= 2;
+ return ((UInt64)kBufferSize + kCompressedBufferSize +
+ GetLZMAUsage(lzmaMt, dictionary) + (2 << 20)) * numBigThreads;
+}
+
+static HRESULT CrcBig(const void *data, UInt32 size, UInt64 numIterations,
+ const UInt32 *checkSum, IHasher *hf,
+ IBenchPrintCallback *callback)
+{
+ Byte hash[64];
+ UInt64 i;
+ for (i = 0; i < sizeof(hash); i++)
+ hash[i] = 0;
+ for (i = 0; i < numIterations; i++)
+ {
+ if (callback && (i & 0xFF) == 0)
+ {
+ RINOK(callback->CheckBreak());
+ }
+ hf->Init();
+ hf->Update(data, size);
+ hf->Final(hash);
+ UInt32 hashSize = hf->GetDigestSize();
+ if (hashSize > sizeof(hash))
+ return S_FALSE;
+ UInt32 sum = 0;
+ for (UInt32 j = 0; j < hashSize; j += 4)
+ sum ^= GetUi32(hash + j);
+ if (checkSum && sum != *checkSum)
+ {
+ return S_FALSE;
+ }
+ }
+ return S_OK;
+}
+
+UInt32 g_BenchCpuFreqTemp = 1;
+
+#define YY1 sum += val; sum ^= val;
+#define YY3 YY1 YY1 YY1 YY1
+#define YY5 YY3 YY3 YY3 YY3
+#define YY7 YY5 YY5 YY5 YY5
+static const UInt32 kNumFreqCommands = 128;
+
+EXTERN_C_BEGIN
+
+static UInt32 CountCpuFreq(UInt32 sum, UInt32 num, UInt32 val)
+{
+ for (UInt32 i = 0; i < num; i++)
+ {
+ YY7
+ }
+ return sum;
+}
+
+EXTERN_C_END
+
+
+#ifndef _7ZIP_ST
+
+struct CFreqInfo
+{
+ NWindows::CThread Thread;
+ IBenchPrintCallback *Callback;
+ HRESULT CallbackRes;
+ UInt32 ValRes;
+ UInt32 Size;
+ UInt64 NumIterations;
+
+ void Wait()
+ {
+ Thread.Wait();
+ Thread.Close();
+ }
+};
+
+static THREAD_FUNC_DECL FreqThreadFunction(void *param)
+{
+ CFreqInfo *p = (CFreqInfo *)param;
+
+ UInt32 sum = g_BenchCpuFreqTemp;
+ for (UInt64 k = p->NumIterations; k > 0; k--)
+ {
+ p->CallbackRes = p->Callback->CheckBreak();
+ if (p->CallbackRes != S_OK)
+ return 0;
+ sum = CountCpuFreq(sum, p->Size, g_BenchCpuFreqTemp);
+ }
+ p->ValRes = sum;
+ return 0;
+}
+
+struct CFreqThreads
+{
+ CFreqInfo *Items;
+ UInt32 NumThreads;
+
+ CFreqThreads(): Items(0), NumThreads(0) {}
+ void WaitAll()
+ {
+ for (UInt32 i = 0; i < NumThreads; i++)
+ Items[i].Wait();
+ NumThreads = 0;
+ }
+ ~CFreqThreads()
+ {
+ WaitAll();
+ delete []Items;
+ }
+};
+
+struct CCrcInfo
+{
+ NWindows::CThread Thread;
+ IBenchPrintCallback *Callback;
+ HRESULT CallbackRes;
+
+ const Byte *Data;
+ UInt32 Size;
+ UInt64 NumIterations;
+ bool CheckSumDefined;
+ UInt32 CheckSum;
+ CMyComPtr<IHasher> Hasher;
+ HRESULT Res;
+
+ #ifdef USE_ALLOCA
+ size_t AllocaSize;
+ #endif
+
+ void Wait()
+ {
+ Thread.Wait();
+ Thread.Close();
+ }
+};
+
+static THREAD_FUNC_DECL CrcThreadFunction(void *param)
+{
+ CCrcInfo *p = (CCrcInfo *)param;
+
+ #ifdef USE_ALLOCA
+ alloca(p->AllocaSize);
+ #endif
+
+ p->Res = CrcBig(p->Data, p->Size, p->NumIterations,
+ p->CheckSumDefined ? &p->CheckSum : NULL, p->Hasher,
+ p->Callback);
+ return 0;
+}
+
+struct CCrcThreads
+{
+ CCrcInfo *Items;
+ UInt32 NumThreads;
+
+ CCrcThreads(): Items(0), NumThreads(0) {}
+ void WaitAll()
+ {
+ for (UInt32 i = 0; i < NumThreads; i++)
+ Items[i].Wait();
+ NumThreads = 0;
+ }
+ ~CCrcThreads()
+ {
+ WaitAll();
+ delete []Items;
+ }
+};
+
+#endif
+
+static UInt32 CrcCalc1(const Byte *buf, UInt32 size)
+{
+ UInt32 crc = CRC_INIT_VAL;;
+ for (UInt32 i = 0; i < size; i++)
+ crc = CRC_UPDATE_BYTE(crc, buf[i]);
+ return CRC_GET_DIGEST(crc);
+}
+
+static void RandGen(Byte *buf, UInt32 size, CBaseRandomGenerator &RG)
+{
+ for (UInt32 i = 0; i < size; i++)
+ buf[i] = (Byte)RG.GetRnd();
+}
+
+static UInt32 RandGenCrc(Byte *buf, UInt32 size, CBaseRandomGenerator &RG)
+{
+ RandGen(buf, size, RG);
+ return CrcCalc1(buf, size);
+}
+
+bool CrcInternalTest()
+{
+ CBenchBuffer buffer;
+ const UInt32 kBufferSize0 = (1 << 8);
+ const UInt32 kBufferSize1 = (1 << 10);
+ const UInt32 kCheckSize = (1 << 5);
+ if (!buffer.Alloc(kBufferSize0 + kBufferSize1))
+ return false;
+ Byte *buf = buffer.Buffer;
+ UInt32 i;
+ for (i = 0; i < kBufferSize0; i++)
+ buf[i] = (Byte)i;
+ UInt32 crc1 = CrcCalc1(buf, kBufferSize0);
+ if (crc1 != 0x29058C73)
+ return false;
+ CBaseRandomGenerator RG;
+ RandGen(buf + kBufferSize0, kBufferSize1, RG);
+ for (i = 0; i < kBufferSize0 + kBufferSize1 - kCheckSize; i++)
+ for (UInt32 j = 0; j < kCheckSize; j++)
+ if (CrcCalc1(buf + i, j) != CrcCalc(buf + i, j))
+ return false;
+ return true;
+}
+
+struct CBenchMethod
+{
+ unsigned Weight;
+ unsigned DictBits;
+ UInt32 EncComplex;
+ UInt32 DecComplexCompr;
+ UInt32 DecComplexUnc;
+ const char *Name;
+};
+
+static const CBenchMethod g_Bench[] =
+{
+ { 40, 17, 357, 145, 20, "LZMA:x1" },
+ { 80, 24, 1220, 145, 20, "LZMA:x5:mt1" },
+ { 80, 24, 1220, 145, 20, "LZMA:x5:mt2" },
+
+ { 10, 16, 124, 40, 14, "Deflate:x1" },
+ { 20, 16, 376, 40, 14, "Deflate:x5" },
+ { 10, 16, 1082, 40, 14, "Deflate:x7" },
+ { 10, 17, 422, 40, 14, "Deflate64:x5" },
+
+ { 10, 15, 590, 69, 69, "BZip2:x1" },
+ { 20, 19, 815, 122, 122, "BZip2:x5" },
+ { 10, 19, 815, 122, 122, "BZip2:x5:mt2" },
+ { 10, 19, 2530, 122, 122, "BZip2:x7" },
+
+ { 10, 18, 1010, 0, 1150, "PPMD:x1" },
+ { 10, 22, 1655, 0, 1830, "PPMD:x5" },
+
+ { 2, 0, 6, 0, 6, "Delta:4" },
+ { 2, 0, 4, 0, 4, "BCJ" },
+
+ { 10, 0, 24, 0, 24, "AES256CBC:1" },
+ { 2, 0, 8, 0, 2, "AES256CBC:2" }
+};
+
+struct CBenchHash
+{
+ unsigned Weight;
+ UInt32 Complex;
+ UInt32 CheckSum;
+ const char *Name;
+};
+
+static const CBenchHash g_Hash[] =
+{
+ { 1, 1820, 0x8F8FEDAB, "CRC32:1" },
+ { 10, 558, 0x8F8FEDAB, "CRC32:4" },
+ { 10, 339, 0x8F8FEDAB, "CRC32:8" },
+ { 10, 512, 0xDF1C17CC, "CRC64" },
+ { 10, 5100, 0x2D79FF2E, "SHA256" },
+ { 10, 2340, 0x4C25132B, "SHA1" },
+ { 2, 5500, 0xE084E913, "BLAKE2sp" }
+};
+
+struct CTotalBenchRes
+{
+ // UInt64 NumIterations1; // for Usage
+ UInt64 NumIterations2; // for Rating / RPU
+
+ UInt64 Rating;
+ UInt64 Usage;
+ UInt64 RPU;
+
+ void Init() { /* NumIterations1 = 0; */ NumIterations2 = 0; Rating = 0; Usage = 0; RPU = 0; }
+
+ void SetSum(const CTotalBenchRes &r1, const CTotalBenchRes &r2)
+ {
+ Rating = (r1.Rating + r2.Rating);
+ Usage = (r1.Usage + r2.Usage);
+ RPU = (r1.RPU + r2.RPU);
+ // NumIterations1 = (r1.NumIterations1 + r2.NumIterations1);
+ NumIterations2 = (r1.NumIterations2 + r2.NumIterations2);
+ }
+};
+
+static void PrintNumber(IBenchPrintCallback &f, UInt64 value, unsigned size)
+{
+ char s[128];
+ unsigned startPos = (unsigned)sizeof(s) - 32;
+ memset(s, ' ', startPos);
+ ConvertUInt64ToString(value, s + startPos);
+ // if (withSpace)
+ {
+ startPos--;
+ size++;
+ }
+ unsigned len = (unsigned)strlen(s + startPos);
+ if (size > len)
+ {
+ startPos -= (size - len);
+ if (startPos < 0)
+ startPos = 0;
+ }
+ f.Print(s + startPos);
+}
+
+static const unsigned kFieldSize_Name = 12;
+static const unsigned kFieldSize_SmallName = 4;
+static const unsigned kFieldSize_Speed = 9;
+static const unsigned kFieldSize_Usage = 5;
+static const unsigned kFieldSize_RU = 6;
+static const unsigned kFieldSize_Rating = 6;
+static const unsigned kFieldSize_EU = 5;
+static const unsigned kFieldSize_Effec = 5;
+
+static const unsigned kFieldSize_TotalSize = 4 + kFieldSize_Speed + kFieldSize_Usage + kFieldSize_RU + kFieldSize_Rating;
+static const unsigned kFieldSize_EUAndEffec = 2 + kFieldSize_EU + kFieldSize_Effec;
+
+
+static void PrintRating(IBenchPrintCallback &f, UInt64 rating, unsigned size)
+{
+ PrintNumber(f, (rating + 500000) / 1000000, size);
+}
+
+
+static void PrintPercents(IBenchPrintCallback &f, UInt64 val, UInt64 divider, unsigned size)
+{
+ PrintNumber(f, (val * 100 + divider / 2) / divider, size);
+}
+
+static void PrintChars(IBenchPrintCallback &f, char c, unsigned size)
+{
+ char s[256];
+ memset(s, (Byte)c, size);
+ s[size] = 0;
+ f.Print(s);
+}
+
+static void PrintSpaces(IBenchPrintCallback &f, unsigned size)
+{
+ PrintChars(f, ' ', size);
+}
+
+static void PrintResults(IBenchPrintCallback &f, UInt64 usage, UInt64 rpu, UInt64 rating, bool showFreq, UInt64 cpuFreq)
+{
+ PrintNumber(f, (usage + 5000) / 10000, kFieldSize_Usage);
+ PrintRating(f, rpu, kFieldSize_RU);
+ PrintRating(f, rating, kFieldSize_Rating);
+ if (showFreq)
+ {
+ if (cpuFreq == 0)
+ PrintSpaces(f, kFieldSize_EUAndEffec);
+ else
+ {
+ UInt64 ddd = cpuFreq * usage / 100;
+ if (ddd == 0)
+ ddd = 1;
+ PrintPercents(f, (rating * 10000), ddd, kFieldSize_EU);
+ PrintPercents(f, rating, cpuFreq, kFieldSize_Effec);
+ }
+ }
+}
+
+static void PrintResults(IBenchPrintCallback *f,
+ const CBenchInfo &info,
+ unsigned weight,
+ UInt64 rating,
+ bool showFreq, UInt64 cpuFreq,
+ CTotalBenchRes *res)
+{
+ UInt64 speed = info.GetSpeed(info.UnpackSize * info.NumIterations);
+ if (f)
+ {
+ if (speed != 0)
+ PrintNumber(*f, speed / 1024, kFieldSize_Speed);
+ else
+ PrintSpaces(*f, 1 + kFieldSize_Speed);
+ }
+ UInt64 usage = info.GetUsage();
+ UInt64 rpu = info.GetRatingPerUsage(rating);
+ if (f)
+ {
+ PrintResults(*f, usage, rpu, rating, showFreq, cpuFreq);
+ }
+
+ if (res)
+ {
+ // res->NumIterations1++;
+ res->NumIterations2 += weight;
+ res->RPU += (rpu * weight);
+ res->Rating += (rating * weight);
+ res->Usage += (usage * weight);
+ }
+}
+
+static void PrintTotals(IBenchPrintCallback &f, bool showFreq, UInt64 cpuFreq, const CTotalBenchRes &res)
+{
+ PrintSpaces(f, 1 + kFieldSize_Speed);
+ // UInt64 numIterations1 = res.NumIterations1; if (numIterations1 == 0) numIterations1 = 1;
+ UInt64 numIterations2 = res.NumIterations2; if (numIterations2 == 0) numIterations2 = 1;
+ PrintResults(f, res.Usage / numIterations2, res.RPU / numIterations2, res.Rating / numIterations2, showFreq, cpuFreq);
+}
+
+
+static void PrintHex(AString &s, UInt64 v)
+{
+ char temp[32];
+ ConvertUInt64ToHex(v, temp);
+ s += temp;
+}
+
+AString GetProcessThreadsInfo(const NSystem::CProcessAffinity &ti)
+{
+ AString s;
+ // s.Add_UInt32(ti.numProcessThreads);
+ if (ti.processAffinityMask != ti.systemAffinityMask)
+ {
+ // if (ti.numProcessThreads != ti.numSysThreads)
+ {
+ s += " / ";
+ s.Add_UInt32(ti.GetNumSystemThreads());
+ }
+ s += " : ";
+ PrintHex(s, ti.processAffinityMask);
+ s += " / ";
+ PrintHex(s, ti.systemAffinityMask);
+ }
+ return s;
+}
+
+
+extern bool g_LargePagesMode;
+
+
+static void PrintRequirements(IBenchPrintCallback &f, const char *sizeString,
+ bool size_Defined, UInt64 size, const char *threadsString, UInt32 numThreads)
+{
+ f.Print("RAM ");
+ f.Print(sizeString);
+ if (size_Defined)
+ PrintNumber(f, (size >> 20), 6);
+ else
+ f.Print(" ?");
+ f.Print(" MB");
+ if (g_LargePagesMode)
+ f.Print(" LP");
+ f.Print(", # ");
+ f.Print(threadsString);
+ PrintNumber(f, numThreads, 3);
+}
+
+
+
+struct CBenchCallbackToPrint: public IBenchCallback
+{
+ CBenchProps BenchProps;
+ CTotalBenchRes EncodeRes;
+ CTotalBenchRes DecodeRes;
+ IBenchPrintCallback *_file;
+ UInt32 DictSize;
+
+ bool Use2Columns;
+ unsigned NameFieldSize;
+
+ bool ShowFreq;
+ UInt64 CpuFreq;
+
+ unsigned EncodeWeight;
+ unsigned DecodeWeight;
+
+ CBenchCallbackToPrint():
+ Use2Columns(false),
+ NameFieldSize(0),
+ ShowFreq(false),
+ CpuFreq(0),
+ EncodeWeight(1),
+ DecodeWeight(1)
+ {}
+
+ void Init() { EncodeRes.Init(); DecodeRes.Init(); }
+ void Print(const char *s);
+ void NewLine();
+
+ HRESULT SetFreq(bool showFreq, UInt64 cpuFreq);
+ HRESULT SetEncodeResult(const CBenchInfo &info, bool final);
+ HRESULT SetDecodeResult(const CBenchInfo &info, bool final);
+};
+
+HRESULT CBenchCallbackToPrint::SetFreq(bool showFreq, UInt64 cpuFreq)
+{
+ ShowFreq = showFreq;
+ CpuFreq = cpuFreq;
+ return S_OK;
+}
+
+HRESULT CBenchCallbackToPrint::SetEncodeResult(const CBenchInfo &info, bool final)
+{
+ RINOK(_file->CheckBreak());
+ if (final)
+ {
+ UInt64 rating = BenchProps.GetCompressRating(DictSize, info.GlobalTime, info.GlobalFreq, info.UnpackSize * info.NumIterations);
+ PrintResults(_file, info,
+ EncodeWeight, rating,
+ ShowFreq, CpuFreq, &EncodeRes);
+ if (!Use2Columns)
+ _file->NewLine();
+ }
+ return S_OK;
+}
+
+static const char * const kSep = " | ";
+
+HRESULT CBenchCallbackToPrint::SetDecodeResult(const CBenchInfo &info, bool final)
+{
+ RINOK(_file->CheckBreak());
+ if (final)
+ {
+ UInt64 rating = BenchProps.GetDecompressRating(info.GlobalTime, info.GlobalFreq, info.UnpackSize, info.PackSize, info.NumIterations);
+ if (Use2Columns)
+ _file->Print(kSep);
+ else
+ PrintSpaces(*_file, NameFieldSize);
+ CBenchInfo info2 = info;
+ info2.UnpackSize *= info2.NumIterations;
+ info2.PackSize *= info2.NumIterations;
+ info2.NumIterations = 1;
+ PrintResults(_file, info2,
+ DecodeWeight, rating,
+ ShowFreq, CpuFreq, &DecodeRes);
+ }
+ return S_OK;
+}
+
+void CBenchCallbackToPrint::Print(const char *s)
+{
+ _file->Print(s);
+}
+
+void CBenchCallbackToPrint::NewLine()
+{
+ _file->NewLine();
+}
+
+void PrintLeft(IBenchPrintCallback &f, const char *s, unsigned size)
+{
+ f.Print(s);
+ int numSpaces = size - MyStringLen(s);
+ if (numSpaces > 0)
+ PrintSpaces(f, numSpaces);
+}
+
+void PrintRight(IBenchPrintCallback &f, const char *s, unsigned size)
+{
+ int numSpaces = size - MyStringLen(s);
+ if (numSpaces > 0)
+ PrintSpaces(f, numSpaces);
+ f.Print(s);
+}
+
+static HRESULT TotalBench(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ UInt64 complexInCommands,
+ UInt32 numThreads,
+ bool forceUnpackSize,
+ size_t unpackSize,
+ const Byte *fileData,
+ IBenchPrintCallback *printCallback, CBenchCallbackToPrint *callback)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(g_Bench); i++)
+ {
+ const CBenchMethod &bench = g_Bench[i];
+ PrintLeft(*callback->_file, bench.Name, kFieldSize_Name);
+ callback->BenchProps.DecComplexUnc = bench.DecComplexUnc;
+ callback->BenchProps.DecComplexCompr = bench.DecComplexCompr;
+ callback->BenchProps.EncComplex = bench.EncComplex;
+
+ COneMethodInfo method;
+ NCOM::CPropVariant propVariant;
+ propVariant = bench.Name;
+ RINOK(method.ParseMethodFromPROPVARIANT(UString(), propVariant));
+
+ size_t unpackSize2 = unpackSize;
+ if (!forceUnpackSize && bench.DictBits == 0)
+ unpackSize2 = kFilterUnpackSize;
+
+ callback->EncodeWeight = bench.Weight;
+ callback->DecodeWeight = bench.Weight;
+
+ HRESULT res = MethodBench(
+ EXTERNAL_CODECS_LOC_VARS
+ complexInCommands,
+ false, numThreads, method,
+ unpackSize2, fileData,
+ bench.DictBits,
+ printCallback, callback, &callback->BenchProps);
+
+ if (res == E_NOTIMPL)
+ {
+ // callback->Print(" ---");
+ // we need additional empty line as line for decompression results
+ if (!callback->Use2Columns)
+ callback->NewLine();
+ }
+ else
+ {
+ RINOK(res);
+ }
+
+ callback->NewLine();
+ }
+ return S_OK;
+}
+
+
+static HRESULT FreqBench(
+ UInt64 complexInCommands,
+ UInt32 numThreads,
+ IBenchPrintCallback *_file,
+ bool showFreq,
+ UInt64 specifiedFreq,
+ UInt64 &cpuFreq,
+ UInt32 &res)
+{
+ res = 0;
+ cpuFreq = 0;
+
+ UInt32 bufferSize = 1 << 20;
+ UInt32 complexity = kNumFreqCommands;
+ if (numThreads == 0)
+ numThreads = 1;
+
+ #ifdef _7ZIP_ST
+ numThreads = 1;
+ #endif
+
+ UInt32 bsize = (bufferSize == 0 ? 1 : bufferSize);
+ UInt64 numIterations = complexInCommands / complexity / bsize;
+ if (numIterations == 0)
+ numIterations = 1;
+
+ CBenchInfoCalc progressInfoSpec;
+
+ #ifndef _7ZIP_ST
+ CFreqThreads threads;
+ if (numThreads > 1)
+ {
+ threads.Items = new CFreqInfo[numThreads];
+ UInt32 i;
+ for (i = 0; i < numThreads; i++)
+ {
+ CFreqInfo &info = threads.Items[i];
+ info.Callback = _file;
+ info.CallbackRes = S_OK;
+ info.NumIterations = numIterations;
+ info.Size = bufferSize;
+ }
+ progressInfoSpec.SetStartTime();
+ for (i = 0; i < numThreads; i++)
+ {
+ CFreqInfo &info = threads.Items[i];
+ RINOK(info.Thread.Create(FreqThreadFunction, &info));
+ threads.NumThreads++;
+ }
+ threads.WaitAll();
+ for (i = 0; i < numThreads; i++)
+ {
+ RINOK(threads.Items[i].CallbackRes);
+ }
+ }
+ else
+ #endif
+ {
+ progressInfoSpec.SetStartTime();
+ UInt32 sum = g_BenchCpuFreqTemp;
+ for (UInt64 k = numIterations; k > 0; k--)
+ {
+ RINOK(_file->CheckBreak());
+ sum = CountCpuFreq(sum, bufferSize, g_BenchCpuFreqTemp);
+ }
+ res += sum;
+ }
+
+ CBenchInfo info;
+ progressInfoSpec.SetFinishTime(info);
+
+ info.UnpackSize = 0;
+ info.PackSize = 0;
+ info.NumIterations = 1;
+
+ if (_file)
+ {
+ {
+ UInt64 numCommands = (UInt64)numIterations * bufferSize * numThreads * complexity;
+ UInt64 rating = info.GetSpeed(numCommands);
+ cpuFreq = rating / numThreads;
+ PrintResults(_file, info,
+ 0, // weight
+ rating,
+ showFreq, showFreq ? (specifiedFreq != 0 ? specifiedFreq : cpuFreq) : 0, NULL);
+ }
+ RINOK(_file->CheckBreak());
+ }
+
+ return S_OK;
+}
+
+
+
+static HRESULT CrcBench(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ UInt64 complexInCommands,
+ UInt32 numThreads, UInt32 bufferSize,
+ UInt64 &speed,
+ UInt32 complexity, unsigned benchWeight,
+ const UInt32 *checkSum,
+ const COneMethodInfo &method,
+ IBenchPrintCallback *_file,
+ CTotalBenchRes *encodeRes,
+ bool showFreq, UInt64 cpuFreq)
+{
+ if (numThreads == 0)
+ numThreads = 1;
+
+ #ifdef _7ZIP_ST
+ numThreads = 1;
+ #endif
+
+ const AString &methodName = method.MethodName;
+ // methodName.RemoveChar(L'-');
+ CMethodId hashID;
+ if (!FindHashMethod(
+ EXTERNAL_CODECS_LOC_VARS
+ methodName, hashID))
+ return E_NOTIMPL;
+
+ CBenchBuffer buffer;
+ size_t totalSize = (size_t)bufferSize * numThreads;
+ if (totalSize / numThreads != bufferSize)
+ return E_OUTOFMEMORY;
+ if (!buffer.Alloc(totalSize))
+ return E_OUTOFMEMORY;
+
+ Byte *buf = buffer.Buffer;
+ CBaseRandomGenerator RG;
+ UInt32 bsize = (bufferSize == 0 ? 1 : bufferSize);
+ UInt64 numIterations = complexInCommands * 256 / complexity / bsize;
+ if (numIterations == 0)
+ numIterations = 1;
+
+ CBenchInfoCalc progressInfoSpec;
+
+ #ifndef _7ZIP_ST
+ CCrcThreads threads;
+ if (numThreads > 1)
+ {
+ threads.Items = new CCrcInfo[numThreads];
+
+ UInt32 i;
+ for (i = 0; i < numThreads; i++)
+ {
+ CCrcInfo &info = threads.Items[i];
+ AString name;
+ RINOK(CreateHasher(EXTERNAL_CODECS_LOC_VARS hashID, name, info.Hasher));
+ if (!info.Hasher)
+ return E_NOTIMPL;
+ CMyComPtr<ICompressSetCoderProperties> scp;
+ info.Hasher.QueryInterface(IID_ICompressSetCoderProperties, &scp);
+ if (scp)
+ {
+ UInt64 reduceSize = 1;
+ RINOK(method.SetCoderProps(scp, &reduceSize));
+ }
+
+ Byte *data = buf + (size_t)bufferSize * i;
+ info.Callback = _file;
+ info.Data = data;
+ info.NumIterations = numIterations;
+ info.Size = bufferSize;
+ /* info.Crc = */ RandGenCrc(data, bufferSize, RG);
+ info.CheckSumDefined = false;
+ if (checkSum)
+ {
+ info.CheckSum = *checkSum;
+ info.CheckSumDefined = (checkSum && (i == 0));
+ }
+
+ #ifdef USE_ALLOCA
+ info.AllocaSize = (i * 16 * 21) & 0x7FF;
+ #endif
+ }
+
+ progressInfoSpec.SetStartTime();
+
+ for (i = 0; i < numThreads; i++)
+ {
+ CCrcInfo &info = threads.Items[i];
+ RINOK(info.Thread.Create(CrcThreadFunction, &info));
+ threads.NumThreads++;
+ }
+ threads.WaitAll();
+ for (i = 0; i < numThreads; i++)
+ {
+ RINOK(threads.Items[i].Res);
+ }
+ }
+ else
+ #endif
+ {
+ /* UInt32 crc = */ RandGenCrc(buf, bufferSize, RG);
+ progressInfoSpec.SetStartTime();
+ CMyComPtr<IHasher> hasher;
+ AString name;
+ RINOK(CreateHasher(EXTERNAL_CODECS_LOC_VARS hashID, name, hasher));
+ if (!hasher)
+ return E_NOTIMPL;
+ CMyComPtr<ICompressSetCoderProperties> scp;
+ hasher.QueryInterface(IID_ICompressSetCoderProperties, &scp);
+ if (scp)
+ {
+ UInt64 reduceSize = 1;
+ RINOK(method.SetCoderProps(scp, &reduceSize));
+ }
+ RINOK(CrcBig(buf, bufferSize, numIterations, checkSum, hasher, _file));
+ }
+
+ CBenchInfo info;
+ progressInfoSpec.SetFinishTime(info);
+
+ UInt64 unpSize = numIterations * bufferSize;
+ UInt64 unpSizeThreads = unpSize * numThreads;
+ info.UnpackSize = unpSizeThreads;
+ info.PackSize = unpSizeThreads;
+ info.NumIterations = 1;
+
+ if (_file)
+ {
+ {
+ UInt64 numCommands = unpSizeThreads * complexity / 256;
+ UInt64 rating = info.GetSpeed(numCommands);
+ PrintResults(_file, info,
+ benchWeight, rating,
+ showFreq, cpuFreq, encodeRes);
+ }
+ RINOK(_file->CheckBreak());
+ }
+
+ speed = info.GetSpeed(unpSizeThreads);
+
+ return S_OK;
+}
+
+static HRESULT TotalBench_Hash(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ UInt64 complexInCommands,
+ UInt32 numThreads, UInt32 bufSize,
+ IBenchPrintCallback *printCallback, CBenchCallbackToPrint *callback,
+ CTotalBenchRes *encodeRes,
+ bool showFreq, UInt64 cpuFreq)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(g_Hash); i++)
+ {
+ const CBenchHash &bench = g_Hash[i];
+ PrintLeft(*callback->_file, bench.Name, kFieldSize_Name);
+ // callback->BenchProps.DecComplexUnc = bench.DecComplexUnc;
+ // callback->BenchProps.DecComplexCompr = bench.DecComplexCompr;
+ // callback->BenchProps.EncComplex = bench.EncComplex;
+
+ COneMethodInfo method;
+ NCOM::CPropVariant propVariant;
+ propVariant = bench.Name;
+ RINOK(method.ParseMethodFromPROPVARIANT(UString(), propVariant));
+
+ UInt64 speed;
+ HRESULT res = CrcBench(
+ EXTERNAL_CODECS_LOC_VARS
+ complexInCommands,
+ numThreads, bufSize,
+ speed,
+ bench.Complex, bench.Weight,
+ &bench.CheckSum, method,
+ printCallback, encodeRes, showFreq, cpuFreq);
+ if (res == E_NOTIMPL)
+ {
+ // callback->Print(" ---");
+ }
+ else
+ {
+ RINOK(res);
+ }
+ callback->NewLine();
+ }
+ return S_OK;
+}
+
+struct CTempValues
+{
+ UInt64 *Values;
+ CTempValues(UInt32 num) { Values = new UInt64[num]; }
+ ~CTempValues() { delete []Values; }
+};
+
+static void ParseNumberString(const UString &s, NCOM::CPropVariant &prop)
+{
+ const wchar_t *end;
+ UInt64 result = ConvertStringToUInt64(s, &end);
+ if (*end != 0 || s.IsEmpty())
+ prop = s;
+ else if (result <= (UInt32)0xFFFFFFFF)
+ prop = (UInt32)result;
+ else
+ prop = result;
+}
+
+static UInt32 GetNumThreadsNext(unsigned i, UInt32 numThreads)
+{
+ if (i < 2)
+ return i + 1;
+ i -= 1;
+ UInt32 num = (UInt32)(2 + (i & 1)) << (i >> 1);
+ return (num <= numThreads) ? num : numThreads;
+}
+
+static bool AreSameMethodNames(const char *fullName, const char *shortName)
+{
+ return StringsAreEqualNoCase_Ascii(fullName, shortName);
+}
+
+
+#ifdef MY_CPU_X86_OR_AMD64
+
+static void PrintCpuChars(AString &s, UInt32 v)
+{
+ for (int j = 0; j < 4; j++)
+ {
+ Byte b = (Byte)(v & 0xFF);
+ v >>= 8;
+ if (b == 0)
+ break;
+ s += (char)b;
+ }
+}
+
+static void x86cpuid_to_String(const Cx86cpuid &c, AString &s)
+{
+ s.Empty();
+
+ UInt32 maxFunc2 = 0;
+ UInt32 t[3];
+
+ MyCPUID(0x80000000, &maxFunc2, &t[0], &t[1], &t[2]);
+
+ bool fullNameIsAvail = (maxFunc2 >= 0x80000004);
+
+ if (!fullNameIsAvail)
+ {
+ for (int i = 0; i < 3; i++)
+ PrintCpuChars(s, c.vendor[i]);
+ }
+ else
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ UInt32 d[4] = { 0 };
+ MyCPUID(0x80000002 + i, &d[0], &d[1], &d[2], &d[3]);
+ for (int j = 0; j < 4; j++)
+ PrintCpuChars(s, d[j]);
+ }
+ }
+
+ s.Add_Space_if_NotEmpty();
+ {
+ char temp[32];
+ ConvertUInt32ToHex(c.ver, temp);
+ s += '(';
+ s += temp;
+ s += ')';
+ }
+}
+
+#endif
+
+
+
+static const char * const k_PROCESSOR_ARCHITECTURE[] =
+{
+ "x86" // "INTEL"
+ , "MIPS"
+ , "ALPHA"
+ , "PPC"
+ , "SHX"
+ , "ARM"
+ , "IA64"
+ , "ALPHA64"
+ , "MSIL"
+ , "x64" // "AMD64"
+ , "IA32_ON_WIN64"
+ , "NEUTRAL"
+ , "ARM64"
+ , "ARM32_ON_WIN64"
+};
+
+#define MY__PROCESSOR_ARCHITECTURE_INTEL 0
+#define MY__PROCESSOR_ARCHITECTURE_AMD64 9
+
+
+#define MY__PROCESSOR_INTEL_PENTIUM 586
+#define MY__PROCESSOR_AMD_X8664 8664
+
+/*
+static const CUInt32PCharPair k_PROCESSOR[] =
+{
+ { 2200, "IA64" },
+ { 8664, "x64" }
+};
+
+#define PROCESSOR_INTEL_386 386
+#define PROCESSOR_INTEL_486 486
+#define PROCESSOR_INTEL_PENTIUM 586
+#define PROCESSOR_INTEL_860 860
+#define PROCESSOR_INTEL_IA64 2200
+#define PROCESSOR_AMD_X8664 8664
+#define PROCESSOR_MIPS_R2000 2000
+#define PROCESSOR_MIPS_R3000 3000
+#define PROCESSOR_MIPS_R4000 4000
+#define PROCESSOR_ALPHA_21064 21064
+#define PROCESSOR_PPC_601 601
+#define PROCESSOR_PPC_603 603
+#define PROCESSOR_PPC_604 604
+#define PROCESSOR_PPC_620 620
+#define PROCESSOR_HITACHI_SH3 10003
+#define PROCESSOR_HITACHI_SH3E 10004
+#define PROCESSOR_HITACHI_SH4 10005
+#define PROCESSOR_MOTOROLA_821 821
+#define PROCESSOR_SHx_SH3 103
+#define PROCESSOR_SHx_SH4 104
+#define PROCESSOR_STRONGARM 2577 // 0xA11
+#define PROCESSOR_ARM720 1824 // 0x720
+#define PROCESSOR_ARM820 2080 // 0x820
+#define PROCESSOR_ARM920 2336 // 0x920
+#define PROCESSOR_ARM_7TDMI 70001
+#define PROCESSOR_OPTIL 18767 // 0x494f
+*/
+
+#ifdef _WIN32
+
+static const char * const k_PF[] =
+{
+ "FP_ERRATA"
+ , "FP_EMU"
+ , "CMPXCHG"
+ , "MMX"
+ , "PPC_MOVEMEM_64BIT"
+ , "ALPHA_BYTE"
+ , "SSE"
+ , "3DNOW"
+ , "RDTSC"
+ , "PAE"
+ , "SSE2"
+ , "SSE_DAZ"
+ , "NX"
+ , "SSE3"
+ , "CMPXCHG16B"
+ , "CMP8XCHG16"
+ , "CHANNELS"
+ , "XSAVE"
+ , "ARM_VFP_32"
+ , "ARM_NEON"
+ , "L2AT"
+ , "VIRT_FIRMWARE"
+ , "RDWRFSGSBASE"
+ , "FASTFAIL"
+ , "ARM_DIVIDE"
+ , "ARM_64BIT_LOADSTORE_ATOMIC"
+ , "ARM_EXTERNAL_CACHE"
+ , "ARM_FMAC"
+ , "RDRAND"
+ , "ARM_V8"
+ , "ARM_V8_CRYPTO"
+ , "ARM_V8_CRC32"
+ , "RDTSCP"
+};
+
+#endif
+
+
+static void PrintSize(AString &s, UInt64 v)
+{
+ char c = 0;
+ if ((v & 0x3FF) == 0) { v >>= 10; c = 'K';
+ if ((v & 0x3FF) == 0) { v >>= 10; c = 'M';
+ if ((v & 0x3FF) == 0) { v >>= 10; c = 'G';
+ if ((v & 0x3FF) == 0) { v >>= 10; c = 'T';
+ }}}}
+ else
+ {
+ PrintHex(s, v);
+ return;
+ }
+ char temp[32];
+ ConvertUInt64ToString(v, temp);
+ s += temp;
+ if (c)
+ s += c;
+}
+
+
+static void PrintPage(AString &s, UInt32 v)
+{
+ if ((v & 0x3FF) == 0)
+ {
+ s.Add_UInt32(v >> 10);
+ s += "K";
+ }
+ else
+ s.Add_UInt32(v >> 10);
+}
+
+static AString TypeToString2(const char * const table[], unsigned num, UInt32 value)
+{
+ char sz[16];
+ const char *p = NULL;
+ if (value < num)
+ p = table[value];
+ if (!p)
+ {
+ ConvertUInt32ToString(value, sz);
+ p = sz;
+ }
+ return (AString)p;
+}
+
+#ifdef _WIN32
+
+static void SysInfo_To_String(AString &s, const SYSTEM_INFO &si)
+{
+ s += TypeToString2(k_PROCESSOR_ARCHITECTURE, ARRAY_SIZE(k_PROCESSOR_ARCHITECTURE), si.wProcessorArchitecture);
+
+ if (!( si.wProcessorArchitecture == MY__PROCESSOR_ARCHITECTURE_INTEL && si.dwProcessorType == MY__PROCESSOR_INTEL_PENTIUM
+ || si.wProcessorArchitecture == MY__PROCESSOR_ARCHITECTURE_AMD64 && si.dwProcessorType == MY__PROCESSOR_AMD_X8664))
+ {
+ s += " ";
+ // s += TypePairToString(k_PROCESSOR, ARRAY_SIZE(k_PROCESSOR), si.dwProcessorType);
+ s.Add_UInt32(si.dwProcessorType);
+ }
+ s += " ";
+ PrintHex(s, si.wProcessorLevel);
+ s += ".";
+ PrintHex(s, si.wProcessorRevision);
+ if ((UInt64)si.dwActiveProcessorMask + 1 != ((UInt64)1 << si.dwNumberOfProcessors))
+ if ((UInt64)si.dwActiveProcessorMask + 1 != 0 || si.dwNumberOfProcessors != sizeof(UInt64) * 8)
+ {
+ s += " act:";
+ PrintHex(s, si.dwActiveProcessorMask);
+ }
+ s += " cpus:";
+ s.Add_UInt32(si.dwNumberOfProcessors);
+ if (si.dwPageSize != 1 << 12)
+ {
+ s += " page:";
+ PrintPage(s, si.dwPageSize);
+ }
+ if (si.dwAllocationGranularity != 1 << 16)
+ {
+ s += " gran:";
+ PrintPage(s, si.dwAllocationGranularity);
+ }
+ s += " ";
+
+ DWORD_PTR minAdd = (DWORD_PTR)si.lpMinimumApplicationAddress;
+ UInt64 maxSize = (UInt64)(DWORD_PTR)si.lpMaximumApplicationAddress + 1;
+ const UInt32 kReserveSize = ((UInt32)1 << 16);
+ if (minAdd != kReserveSize)
+ {
+ PrintSize(s, minAdd);
+ s += "-";
+ }
+ else
+ {
+ if ((maxSize & (kReserveSize - 1)) == 0)
+ maxSize += kReserveSize;
+ }
+ PrintSize(s, maxSize);
+}
+
+#ifndef _WIN64
+typedef VOID (WINAPI *Func_GetNativeSystemInfo)(LPSYSTEM_INFO lpSystemInfo);
+#endif
+
+#endif
+
+void GetSysInfo(AString &s1, AString &s2)
+{
+ s1.Empty();
+ s2.Empty();
+
+ #ifdef _WIN32
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ {
+ SysInfo_To_String(s1, si);
+ // s += " : ";
+ }
+
+ #if !defined(_WIN64) && !defined(UNDER_CE)
+ Func_GetNativeSystemInfo fn_GetNativeSystemInfo = (Func_GetNativeSystemInfo)GetProcAddress(
+ GetModuleHandleA("kernel32.dll"), "GetNativeSystemInfo");
+ if (fn_GetNativeSystemInfo)
+ {
+ SYSTEM_INFO si2;
+ fn_GetNativeSystemInfo(&si2);
+ // if (memcmp(&si, &si2, sizeof(si)) != 0)
+ {
+ // s += " - ";
+ SysInfo_To_String(s2, si2);
+ }
+ }
+ #endif
+ #endif
+}
+
+
+void GetCpuName(AString &s)
+{
+ s.Empty();
+
+ #ifdef MY_CPU_X86_OR_AMD64
+ {
+ Cx86cpuid cpuid;
+ if (x86cpuid_CheckAndRead(&cpuid))
+ {
+ AString s2;
+ x86cpuid_to_String(cpuid, s2);
+ s += s2;
+ }
+ else
+ {
+ #ifdef MY_CPU_AMD64
+ s += "x64";
+ #else
+ s += "x86";
+ #endif
+ }
+ }
+ #else
+
+ #ifdef MY_CPU_LE
+ s += "LE";
+ #elif defined(MY_CPU_BE)
+ s += "BE";
+ #endif
+
+ #endif
+
+ if (g_LargePagesMode)
+ s += " (LP)";
+}
+
+
+void GetCpuFeatures(AString &s)
+{
+ s.Empty();
+
+ #ifdef _WIN32
+ const unsigned kNumFeatures_Extra = 32; // we check also for unknown features
+ const unsigned kNumFeatures = ARRAY_SIZE(k_PF) + kNumFeatures_Extra;
+ for (unsigned i = 0; i < kNumFeatures; i++)
+ {
+ if (IsProcessorFeaturePresent(i))
+ {
+ s.Add_Space_if_NotEmpty();
+ s += TypeToString2(k_PF, ARRAY_SIZE(k_PF), i);
+ }
+ }
+ #endif
+}
+
+
+#ifdef _WIN32
+#ifndef UNDER_CE
+
+typedef void (WINAPI * Func_RtlGetVersion) (OSVERSIONINFOEXW *);
+
+static BOOL My_RtlGetVersion(OSVERSIONINFOEXW *vi)
+{
+ HMODULE ntdll = ::GetModuleHandleW(L"ntdll.dll");
+ if (!ntdll)
+ return FALSE;
+ Func_RtlGetVersion func = (Func_RtlGetVersion)GetProcAddress(ntdll, "RtlGetVersion");
+ if (!func)
+ return FALSE;
+ func(vi);
+ return TRUE;
+}
+
+#endif
+#endif
+
+
+HRESULT Bench(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ IBenchPrintCallback *printCallback,
+ IBenchCallback *benchCallback,
+ // IBenchFreqCallback *freqCallback,
+ const CObjectVector<CProperty> &props,
+ UInt32 numIterations,
+ bool multiDict)
+{
+ if (!CrcInternalTest())
+ return S_FALSE;
+
+ UInt32 numCPUs = 1;
+ UInt64 ramSize = (UInt64)(sizeof(size_t)) << 29;
+
+ NSystem::CProcessAffinity threadsInfo;
+ threadsInfo.InitST();
+
+ #ifndef _7ZIP_ST
+
+ if (threadsInfo.Get() && threadsInfo.processAffinityMask != 0)
+ numCPUs = threadsInfo.GetNumProcessThreads();
+ else
+ numCPUs = NSystem::GetNumberOfProcessors();
+
+ #endif
+
+ bool ramSize_Defined = NSystem::GetRamSize(ramSize);
+
+ UInt32 numThreadsSpecified = numCPUs;
+
+ UInt32 testTime = kComplexInSeconds;
+
+ UInt64 specifiedFreq = 0;
+
+ bool multiThreadTests = false;
+
+ COneMethodInfo method;
+
+ CBenchBuffer fileDataBuffer;
+
+ {
+ unsigned i;
+ for (i = 0; i < props.Size(); i++)
+ {
+ const CProperty &property = props[i];
+ UString name (property.Name);
+ name.MakeLower_Ascii();
+
+ if (name.IsEqualTo("file"))
+ {
+ if (property.Value.IsEmpty())
+ return E_INVALIDARG;
+
+ #ifdef USE_WIN_FILE
+
+ NFile::NIO::CInFile file;
+ if (!file.Open(us2fs(property.Value)))
+ return E_INVALIDARG;
+ UInt64 len;
+ if (!file.GetLength(len))
+ return E_FAIL;
+ if (len >= ((UInt32)1 << 31) || len == 0)
+ return E_INVALIDARG;
+ if (!fileDataBuffer.Alloc((size_t)len))
+ return E_OUTOFMEMORY;
+ UInt32 processedSize;
+ file.Read(fileDataBuffer.Buffer, (UInt32)len, processedSize);
+ if (processedSize != len)
+ return E_FAIL;
+ if (printCallback)
+ {
+ printCallback->Print("file size =");
+ PrintNumber(*printCallback, len, 0);
+ printCallback->NewLine();
+ }
+ continue;
+
+ #else
+
+ return E_NOTIMPL;
+
+ #endif
+ }
+
+ NCOM::CPropVariant propVariant;
+ if (!property.Value.IsEmpty())
+ ParseNumberString(property.Value, propVariant);
+
+ if (name.IsEqualTo("time"))
+ {
+ RINOK(ParsePropToUInt32(UString(), propVariant, testTime));
+ continue;
+ }
+
+ if (name.IsEqualTo("freq"))
+ {
+ UInt32 freq32 = 0;
+ RINOK(ParsePropToUInt32(UString(), propVariant, freq32));
+ if (freq32 == 0)
+ return E_INVALIDARG;
+ specifiedFreq = (UInt64)freq32 * 1000000;
+
+ if (printCallback)
+ {
+ printCallback->Print("freq=");
+ PrintNumber(*printCallback, freq32, 0);
+ printCallback->NewLine();
+ }
+
+ continue;
+ }
+
+ if (name.IsPrefixedBy_Ascii_NoCase("mt"))
+ {
+ UString s = name.Ptr(2);
+ if (s.IsEqualTo("*")
+ || s.IsEmpty() && propVariant.vt == VT_BSTR && StringsAreEqual_Ascii(propVariant.bstrVal, "*"))
+ {
+ multiThreadTests = true;
+ continue;
+ }
+ #ifndef _7ZIP_ST
+ RINOK(ParseMtProp(s, propVariant, numCPUs, numThreadsSpecified));
+ #endif
+ continue;
+ }
+
+ RINOK(method.ParseMethodFromPROPVARIANT(name, propVariant));
+ }
+ }
+
+ if (printCallback)
+ {
+ #ifdef _WIN32
+ #ifndef UNDER_CE
+ {
+ AString s;
+ // OSVERSIONINFO vi;
+ OSVERSIONINFOEXW vi;
+ vi.dwOSVersionInfoSize = sizeof(vi);
+ // if (::GetVersionEx(&vi))
+ if (My_RtlGetVersion(&vi))
+ {
+ s += "Windows";
+ if (vi.dwPlatformId != VER_PLATFORM_WIN32_NT)
+ s.Add_UInt32(vi.dwPlatformId);
+ s += " "; s.Add_UInt32(vi.dwMajorVersion);
+ s += "."; s.Add_UInt32(vi.dwMinorVersion);
+ s += " "; s.Add_UInt32(vi.dwBuildNumber);
+ // s += " "; s += GetAnsiString(vi.szCSDVersion);
+ }
+ printCallback->Print(s);
+ printCallback->NewLine();
+ }
+ #endif
+ #endif
+
+ {
+ AString s1, s2;
+ GetSysInfo(s1, s2);
+ if (!s1.IsEmpty() || !s2.IsEmpty())
+ {
+ printCallback->Print(s1);
+ if (s1 != s2 && !s2.IsEmpty())
+ {
+ printCallback->Print(" - ");
+ printCallback->Print(s2);
+ }
+ printCallback->NewLine();
+ }
+ }
+ {
+ AString s;
+ GetCpuFeatures(s);
+ if (!s.IsEmpty())
+ {
+ printCallback->Print(s);
+ printCallback->NewLine();
+ }
+ }
+ {
+ AString s;
+ GetCpuName(s);
+ if (!s.IsEmpty())
+ {
+ printCallback->Print(s);
+ printCallback->NewLine();
+ }
+ }
+ }
+
+ if (printCallback)
+ {
+ printCallback->Print("CPU Freq:");
+ }
+
+ UInt64 complexInCommands = kComplexInCommands;
+
+ if (printCallback /* || freqCallback */)
+ {
+ UInt64 numMilCommands = 1 << 6;
+ if (specifiedFreq != 0)
+ {
+ while (numMilCommands > 1 && specifiedFreq < (numMilCommands * 1000000))
+ numMilCommands >>= 1;
+ }
+
+ for (int jj = 0;; jj++)
+ {
+ if (printCallback)
+ RINOK(printCallback->CheckBreak());
+
+ UInt64 start = ::GetTimeCount();
+ UInt32 sum = (UInt32)start;
+ sum = CountCpuFreq(sum, (UInt32)(numMilCommands * 1000000 / kNumFreqCommands), g_BenchCpuFreqTemp);
+ const UInt64 realDelta = ::GetTimeCount() - start;
+ start = realDelta;
+ if (start == 0)
+ start = 1;
+ UInt64 freq = GetFreq();
+ // mips is constant in some compilers
+ const UInt64 mipsVal = numMilCommands * freq / start;
+ if (printCallback)
+ {
+ if (realDelta == 0)
+ {
+ printCallback->Print(" -");
+ }
+ else
+ {
+ // PrintNumber(*printCallback, start, 0);
+ PrintNumber(*printCallback, mipsVal, 5 + ((sum == 0xF1541213) ? 1 : 0));
+ }
+ }
+ /*
+ if (freqCallback)
+ freqCallback->AddCpuFreq(mipsVal);
+ */
+
+ if (jj >= 3)
+ {
+ SetComplexCommands(testTime, false, mipsVal * 1000000, complexInCommands);
+ if (jj >= 8 || start >= freq)
+ break;
+ // break; // change it
+ numMilCommands <<= 1;
+ }
+ }
+ }
+
+ if (printCallback)
+ {
+ printCallback->NewLine();
+ printCallback->NewLine();
+ PrintRequirements(*printCallback, "size: ", ramSize_Defined, ramSize, "CPU hardware threads:", numCPUs);
+ printCallback->Print(GetProcessThreadsInfo(threadsInfo));
+ printCallback->NewLine();
+ }
+
+ if (numThreadsSpecified < 1 || numThreadsSpecified > kNumThreadsMax)
+ return E_INVALIDARG;
+
+ UInt32 dict;
+ bool dictIsDefined = method.Get_DicSize(dict);
+
+ if (method.MethodName.IsEmpty())
+ method.MethodName = "LZMA";
+
+ if (benchCallback)
+ {
+ CBenchProps benchProps;
+ benchProps.SetLzmaCompexity();
+ UInt32 dictSize = method.Get_Lzma_DicSize();
+ UInt32 uncompressedDataSize = kAdditionalSize + dictSize;
+ return MethodBench(
+ EXTERNAL_CODECS_LOC_VARS
+ complexInCommands,
+ true, numThreadsSpecified,
+ method,
+ uncompressedDataSize, fileDataBuffer.Buffer,
+ kOldLzmaDictBits, printCallback, benchCallback, &benchProps);
+ }
+
+ AString methodName (method.MethodName);
+ if (methodName.IsEqualTo_Ascii_NoCase("CRC"))
+ methodName = "crc32";
+ method.MethodName = methodName;
+ CMethodId hashID;
+
+ if (FindHashMethod(EXTERNAL_CODECS_LOC_VARS methodName, hashID))
+ {
+ if (!printCallback)
+ return S_FALSE;
+ IBenchPrintCallback &f = *printCallback;
+ if (!dictIsDefined)
+ dict = (1 << 24);
+
+
+ // methhodName.RemoveChar(L'-');
+ UInt32 complexity = 10000;
+ const UInt32 *checkSum = NULL;
+ {
+ unsigned i;
+ for (i = 0; i < ARRAY_SIZE(g_Hash); i++)
+ {
+ const CBenchHash &h = g_Hash[i];
+ AString benchMethod (h.Name);
+ AString benchProps;
+ int propPos = benchMethod.Find(':');
+ if (propPos >= 0)
+ {
+ benchProps = benchMethod.Ptr(propPos + 1);
+ benchMethod.DeleteFrom(propPos);
+ }
+
+ if (AreSameMethodNames(benchMethod, methodName))
+ {
+ if (benchProps.IsEmpty()
+ || benchMethod.IsEqualTo_Ascii_NoCase("crc32") && benchProps == "8" && method.PropsString.IsEmpty()
+ || method.PropsString.IsPrefixedBy_Ascii_NoCase(benchProps))
+ {
+ complexity = h.Complex;
+ checkSum = &h.CheckSum;
+ if (method.PropsString.IsEqualTo_Ascii_NoCase(benchProps))
+ break;
+ }
+ }
+ }
+ if (i == ARRAY_SIZE(g_Hash))
+ return E_NOTIMPL;
+ }
+
+ f.NewLine();
+ f.Print("Size");
+ const unsigned kFieldSize_CrcSpeed = 6;
+ unsigned numThreadsTests = 0;
+ for (;;)
+ {
+ UInt32 t = GetNumThreadsNext(numThreadsTests, numThreadsSpecified);
+ PrintNumber(f, t, kFieldSize_CrcSpeed);
+ numThreadsTests++;
+ if (t >= numThreadsSpecified)
+ break;
+ }
+ f.NewLine();
+ f.NewLine();
+ CTempValues speedTotals(numThreadsTests);
+ {
+ for (unsigned ti = 0; ti < numThreadsTests; ti++)
+ speedTotals.Values[ti] = 0;
+ }
+
+ UInt64 numSteps = 0;
+ for (UInt32 i = 0; i < numIterations; i++)
+ {
+ for (unsigned pow = 10; pow < 32; pow++)
+ {
+ UInt32 bufSize = (UInt32)1 << pow;
+ if (bufSize > dict)
+ break;
+ char s[16];
+ ConvertUInt32ToString(pow, s);
+ unsigned pos = MyStringLen(s);
+ s[pos++] = ':';
+ s[pos++] = ' ';
+ s[pos] = 0;
+ f.Print(s);
+
+ for (unsigned ti = 0; ti < numThreadsTests; ti++)
+ {
+ RINOK(f.CheckBreak());
+ UInt32 t = GetNumThreadsNext(ti, numThreadsSpecified);
+ UInt64 speed = 0;
+ RINOK(CrcBench(EXTERNAL_CODECS_LOC_VARS complexInCommands,
+ t, bufSize, speed,
+ complexity,
+ 1, // benchWeight,
+ (pow == kNumHashDictBits) ? checkSum : NULL, method, NULL, NULL, false, 0));
+ PrintNumber(f, (speed >> 20), kFieldSize_CrcSpeed);
+ speedTotals.Values[ti] += speed;
+ }
+ f.NewLine();
+ numSteps++;
+ }
+ }
+ if (numSteps != 0)
+ {
+ f.NewLine();
+ f.Print("Avg:");
+ for (unsigned ti = 0; ti < numThreadsTests; ti++)
+ {
+ PrintNumber(f, ((speedTotals.Values[ti] / numSteps) >> 20), kFieldSize_CrcSpeed);
+ }
+ f.NewLine();
+ }
+ return S_OK;
+ }
+
+ bool use2Columns = false;
+
+ bool totalBenchMode = (method.MethodName.IsEqualTo_Ascii_NoCase("*"));
+ bool onlyHashBench = false;
+ if (method.MethodName.IsEqualTo_Ascii_NoCase("hash"))
+ {
+ onlyHashBench = true;
+ totalBenchMode = true;
+ }
+
+ // ---------- Threads loop ----------
+ for (unsigned threadsPassIndex = 0; threadsPassIndex < 3; threadsPassIndex++)
+ {
+
+ UInt32 numThreads = numThreadsSpecified;
+
+ if (!multiThreadTests)
+ {
+ if (threadsPassIndex != 0)
+ break;
+ }
+ else
+ {
+ numThreads = 1;
+ if (threadsPassIndex != 0)
+ {
+ if (numCPUs < 2)
+ break;
+ numThreads = numCPUs;
+ if (threadsPassIndex == 1)
+ {
+ if (numCPUs >= 4)
+ numThreads = numCPUs / 2;
+ }
+ else if (numCPUs < 4)
+ break;
+ }
+ }
+
+ CBenchCallbackToPrint callback;
+ callback.Init();
+ callback._file = printCallback;
+
+ IBenchPrintCallback &f = *printCallback;
+
+ if (threadsPassIndex > 0)
+ {
+ f.NewLine();
+ f.NewLine();
+ }
+
+ if (!dictIsDefined)
+ {
+ const unsigned dicSizeLog_Main = (totalBenchMode ? 24 : 25);
+ unsigned dicSizeLog = dicSizeLog_Main;
+
+ #ifdef UNDER_CE
+ dicSizeLog = (UInt64)1 << 20;
+ #endif
+
+ if (ramSize_Defined)
+ for (; dicSizeLog > kBenchMinDicLogSize; dicSizeLog--)
+ if (GetBenchMemoryUsage(numThreads, ((UInt32)1 << dicSizeLog), totalBenchMode) + (8 << 20) <= ramSize)
+ break;
+
+ dict = (UInt32)1 << dicSizeLog;
+
+ if (totalBenchMode && dicSizeLog != dicSizeLog_Main)
+ {
+ f.Print("Dictionary reduced to: ");
+ PrintNumber(f, dicSizeLog, 1);
+ f.NewLine();
+ }
+ }
+
+ PrintRequirements(f, "usage:", true, GetBenchMemoryUsage(numThreads, dict, totalBenchMode), "Benchmark threads: ", numThreads);
+ f.NewLine();
+
+ f.NewLine();
+
+ if (totalBenchMode)
+ {
+ callback.NameFieldSize = kFieldSize_Name;
+ use2Columns = false;
+ }
+ else
+ {
+ callback.NameFieldSize = kFieldSize_SmallName;
+ use2Columns = true;
+ }
+ callback.Use2Columns = use2Columns;
+
+ bool showFreq = false;
+ UInt64 cpuFreq = 0;
+
+ if (totalBenchMode)
+ {
+ showFreq = true;
+ }
+
+ unsigned fileldSize = kFieldSize_TotalSize;
+ if (showFreq)
+ fileldSize += kFieldSize_EUAndEffec;
+
+ if (use2Columns)
+ {
+ PrintSpaces(f, callback.NameFieldSize);
+ PrintRight(f, "Compressing", fileldSize);
+ f.Print(kSep);
+ PrintRight(f, "Decompressing", fileldSize);
+ }
+ f.NewLine();
+ PrintLeft(f, totalBenchMode ? "Method" : "Dict", callback.NameFieldSize);
+
+ int j;
+
+ for (j = 0; j < 2; j++)
+ {
+ PrintRight(f, "Speed", kFieldSize_Speed + 1);
+ PrintRight(f, "Usage", kFieldSize_Usage + 1);
+ PrintRight(f, "R/U", kFieldSize_RU + 1);
+ PrintRight(f, "Rating", kFieldSize_Rating + 1);
+ if (showFreq)
+ {
+ PrintRight(f, "E/U", kFieldSize_EU + 1);
+ PrintRight(f, "Effec", kFieldSize_Effec + 1);
+ }
+ if (!use2Columns)
+ break;
+ if (j == 0)
+ f.Print(kSep);
+ }
+
+ f.NewLine();
+ PrintSpaces(f, callback.NameFieldSize);
+
+ for (j = 0; j < 2; j++)
+ {
+ PrintRight(f, "KiB/s", kFieldSize_Speed + 1);
+ PrintRight(f, "%", kFieldSize_Usage + 1);
+ PrintRight(f, "MIPS", kFieldSize_RU + 1);
+ PrintRight(f, "MIPS", kFieldSize_Rating + 1);
+ if (showFreq)
+ {
+ PrintRight(f, "%", kFieldSize_EU + 1);
+ PrintRight(f, "%", kFieldSize_Effec + 1);
+ }
+ if (!use2Columns)
+ break;
+ if (j == 0)
+ f.Print(kSep);
+ }
+
+ f.NewLine();
+ f.NewLine();
+
+ if (specifiedFreq != 0)
+ cpuFreq = specifiedFreq;
+
+
+ if (totalBenchMode)
+ {
+ for (UInt32 i = 0; i < numIterations; i++)
+ {
+ if (i != 0)
+ printCallback->NewLine();
+ HRESULT res;
+
+ const unsigned kNumCpuTests = 3;
+ for (unsigned freqTest = 0; freqTest < kNumCpuTests; freqTest++)
+ {
+ PrintLeft(f, "CPU", kFieldSize_Name);
+ UInt32 resVal;
+ RINOK(FreqBench(complexInCommands, numThreads, printCallback,
+ (freqTest == kNumCpuTests - 1 || specifiedFreq != 0), // showFreq
+ specifiedFreq,
+ cpuFreq, resVal));
+ callback.NewLine();
+
+ if (specifiedFreq != 0)
+ cpuFreq = specifiedFreq;
+
+ if (freqTest == kNumCpuTests - 1)
+ SetComplexCommands(testTime, specifiedFreq != 0, cpuFreq, complexInCommands);
+ }
+ callback.NewLine();
+
+ callback.SetFreq(true, cpuFreq);
+
+ if (!onlyHashBench)
+ {
+ res = TotalBench(EXTERNAL_CODECS_LOC_VARS
+ complexInCommands, numThreads,
+ dictIsDefined || fileDataBuffer.Buffer, // forceUnpackSize
+ fileDataBuffer.Buffer ? fileDataBuffer.BufferSize : dict,
+ fileDataBuffer.Buffer,
+ printCallback, &callback);
+ RINOK(res);
+ }
+
+ res = TotalBench_Hash(EXTERNAL_CODECS_LOC_VARS complexInCommands, numThreads,
+ 1 << kNumHashDictBits, printCallback, &callback, &callback.EncodeRes, true, cpuFreq);
+ RINOK(res);
+
+ callback.NewLine();
+ {
+ PrintLeft(f, "CPU", kFieldSize_Name);
+ UInt32 resVal;
+ UInt64 cpuFreqLastTemp = cpuFreq;
+ RINOK(FreqBench(complexInCommands, numThreads, printCallback,
+ specifiedFreq != 0, // showFreq
+ specifiedFreq,
+ cpuFreqLastTemp, resVal));
+ callback.NewLine();
+ }
+ }
+ }
+ else
+ {
+ bool needSetComplexity = true;
+ if (!methodName.IsEqualTo_Ascii_NoCase("LZMA"))
+ {
+ unsigned i;
+ for (i = 0; i < ARRAY_SIZE(g_Bench); i++)
+ {
+ const CBenchMethod &h = g_Bench[i];
+ AString benchMethod (h.Name);
+ AString benchProps;
+ int propPos = benchMethod.Find(':');
+ if (propPos >= 0)
+ {
+ benchProps = benchMethod.Ptr(propPos + 1);
+ benchMethod.DeleteFrom(propPos);
+ }
+
+ if (AreSameMethodNames(benchMethod, methodName))
+ {
+ if (benchProps.IsEmpty()
+ || benchProps == "x5" && method.PropsString.IsEmpty()
+ || method.PropsString.IsPrefixedBy_Ascii_NoCase(benchProps))
+ {
+ callback.BenchProps.EncComplex = h.EncComplex;
+ callback.BenchProps.DecComplexCompr = h.DecComplexCompr;
+ callback.BenchProps.DecComplexUnc = h.DecComplexUnc;;
+ needSetComplexity = false;
+ break;
+ }
+ }
+ }
+ if (i == ARRAY_SIZE(g_Bench))
+ return E_NOTIMPL;
+ }
+ if (needSetComplexity)
+ callback.BenchProps.SetLzmaCompexity();
+
+ for (unsigned i = 0; i < numIterations; i++)
+ {
+ const unsigned kStartDicLog = 22;
+ unsigned pow = (dict < ((UInt32)1 << kStartDicLog)) ? kBenchMinDicLogSize : kStartDicLog;
+ if (!multiDict)
+ pow = 31;
+ while (((UInt32)1 << pow) > dict && pow > 0)
+ pow--;
+ for (; ((UInt32)1 << pow) <= dict; pow++)
+ {
+ char s[16];
+ ConvertUInt32ToString(pow, s);
+ unsigned pos = MyStringLen(s);
+ s[pos++] = ':';
+ s[pos] = 0;
+ PrintLeft(f, s, kFieldSize_SmallName);
+ callback.DictSize = (UInt32)1 << pow;
+
+ COneMethodInfo method2 = method;
+
+ if (StringsAreEqualNoCase_Ascii(method2.MethodName, "LZMA"))
+ {
+ // We add dictionary size property.
+ // method2 can have two different dictionary size properties.
+ // And last property is main.
+ NCOM::CPropVariant propVariant = (UInt32)pow;
+ RINOK(method2.ParseMethodFromPROPVARIANT((UString)"d", propVariant));
+ }
+
+ size_t uncompressedDataSize;
+ if (fileDataBuffer.Buffer)
+ {
+ uncompressedDataSize = fileDataBuffer.BufferSize;
+ }
+ else
+ {
+ uncompressedDataSize = callback.DictSize;
+ if (uncompressedDataSize >= (1 << 18))
+ uncompressedDataSize += kAdditionalSize;
+ }
+
+ HRESULT res = MethodBench(
+ EXTERNAL_CODECS_LOC_VARS
+ complexInCommands,
+ true, numThreads,
+ method2,
+ uncompressedDataSize, fileDataBuffer.Buffer,
+ kOldLzmaDictBits, printCallback, &callback, &callback.BenchProps);
+ f.NewLine();
+ RINOK(res);
+ if (!multiDict)
+ break;
+ }
+ }
+ }
+
+ PrintChars(f, '-', callback.NameFieldSize + fileldSize);
+
+ if (use2Columns)
+ {
+ f.Print(kSep);
+ PrintChars(f, '-', fileldSize);
+ }
+
+ f.NewLine();
+
+ if (use2Columns)
+ {
+ PrintLeft(f, "Avr:", callback.NameFieldSize);
+ PrintTotals(f, showFreq, cpuFreq, callback.EncodeRes);
+ f.Print(kSep);
+ PrintTotals(f, showFreq, cpuFreq, callback.DecodeRes);
+ f.NewLine();
+ }
+
+ PrintLeft(f, "Tot:", callback.NameFieldSize);
+ CTotalBenchRes midRes;
+ midRes.SetSum(callback.EncodeRes, callback.DecodeRes);
+ PrintTotals(f, showFreq, cpuFreq, midRes);
+ f.NewLine();
+
+ }
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.h
new file mode 100644
index 0000000000..1990aab0d3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Bench.h
@@ -0,0 +1,72 @@
+// Bench.h
+
+#ifndef __7ZIP_BENCH_H
+#define __7ZIP_BENCH_H
+
+#include "../../../Windows/System.h"
+
+#include "../../Common/CreateCoder.h"
+#include "../../UI/Common/Property.h"
+
+struct CBenchInfo
+{
+ UInt64 GlobalTime;
+ UInt64 GlobalFreq;
+ UInt64 UserTime;
+ UInt64 UserFreq;
+ UInt64 UnpackSize;
+ UInt64 PackSize;
+ UInt64 NumIterations;
+
+ CBenchInfo(): NumIterations(0) {}
+ UInt64 GetUsage() const;
+ UInt64 GetRatingPerUsage(UInt64 rating) const;
+ UInt64 GetSpeed(UInt64 numCommands) const;
+};
+
+struct IBenchCallback
+{
+ virtual HRESULT SetFreq(bool showFreq, UInt64 cpuFreq) = 0;
+ virtual HRESULT SetEncodeResult(const CBenchInfo &info, bool final) = 0;
+ virtual HRESULT SetDecodeResult(const CBenchInfo &info, bool final) = 0;
+};
+
+UInt64 GetCompressRating(UInt32 dictSize, UInt64 elapsedTime, UInt64 freq, UInt64 size);
+UInt64 GetDecompressRating(UInt64 elapsedTime, UInt64 freq, UInt64 outSize, UInt64 inSize, UInt64 numIterations);
+
+const unsigned kBenchMinDicLogSize = 18;
+
+UInt64 GetBenchMemoryUsage(UInt32 numThreads, UInt32 dictionary, bool totalBench = false);
+
+struct IBenchPrintCallback
+{
+ virtual void Print(const char *s) = 0;
+ virtual void NewLine() = 0;
+ virtual HRESULT CheckBreak() = 0;
+};
+
+/*
+struct IBenchFreqCallback
+{
+ virtual void AddCpuFreq(UInt64 freq) = 0;
+};
+*/
+
+HRESULT Bench(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ IBenchPrintCallback *printCallback,
+ IBenchCallback *benchCallback,
+ // IBenchFreqCallback *freqCallback,
+ const CObjectVector<CProperty> &props,
+ UInt32 numIterations,
+ bool multiDict
+ );
+
+AString GetProcessThreadsInfo(const NWindows::NSystem::CProcessAffinity &ti);
+
+void GetSysInfo(AString &s1, AString &s2);
+void GetCpuName(AString &s);
+void GetCpuFeatures(AString &s);
+
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.cpp
new file mode 100644
index 0000000000..0c13e9ebcf
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.cpp
@@ -0,0 +1,37 @@
+// DefaultName.cpp
+
+#include "StdAfx.h"
+
+#include "DefaultName.h"
+
+static UString GetDefaultName3(const UString &fileName,
+ const UString &extension, const UString &addSubExtension)
+{
+ const unsigned extLen = extension.Len();
+ const unsigned fileNameLen = fileName.Len();
+
+ if (fileNameLen > extLen + 1)
+ {
+ const unsigned dotPos = fileNameLen - (extLen + 1);
+ if (fileName[dotPos] == '.')
+ if (extension.IsEqualTo_NoCase(fileName.Ptr(dotPos + 1)))
+ return fileName.Left(dotPos) + addSubExtension;
+ }
+
+ int dotPos = fileName.ReverseFind_Dot();
+ if (dotPos > 0)
+ return fileName.Left(dotPos) + addSubExtension;
+
+ if (addSubExtension.IsEmpty())
+ return fileName + L'~';
+ else
+ return fileName + addSubExtension;
+}
+
+UString GetDefaultName2(const UString &fileName,
+ const UString &extension, const UString &addSubExtension)
+{
+ UString name = GetDefaultName3(fileName, extension, addSubExtension);
+ name.TrimRight();
+ return name;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.h
new file mode 100644
index 0000000000..4484c3b5b4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/DefaultName.h
@@ -0,0 +1,11 @@
+// DefaultName.h
+
+#ifndef __DEFAULT_NAME_H
+#define __DEFAULT_NAME_H
+
+#include "../../../Common/MyString.h"
+
+UString GetDefaultName2(const UString &fileName,
+ const UString &extension, const UString &addSubExtension);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/DirItem.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/DirItem.h
new file mode 100644
index 0000000000..47485bec3d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/DirItem.h
@@ -0,0 +1,190 @@
+// DirItem.h
+
+#ifndef __DIR_ITEM_H
+#define __DIR_ITEM_H
+
+#include "../../../Common/MyString.h"
+
+#include "../../../Windows/FileFind.h"
+
+#include "../../Common/UniqBlocks.h"
+
+#include "../../Archive/IArchive.h"
+
+struct CDirItemsStat
+{
+ UInt64 NumDirs;
+ UInt64 NumFiles;
+ UInt64 NumAltStreams;
+ UInt64 FilesSize;
+ UInt64 AltStreamsSize;
+
+ UInt64 NumErrors;
+
+ // UInt64 Get_NumItems() const { return NumDirs + NumFiles + NumAltStreams; }
+ UInt64 Get_NumDataItems() const { return NumFiles + NumAltStreams; }
+ UInt64 GetTotalBytes() const { return FilesSize + AltStreamsSize; }
+
+ bool IsEmpty() const { return
+ 0 == NumDirs
+ && 0 == NumFiles
+ && 0 == NumAltStreams
+ && 0 == FilesSize
+ && 0 == AltStreamsSize
+ && 0 == NumErrors; }
+
+ CDirItemsStat():
+ NumDirs(0),
+ NumFiles(0),
+ NumAltStreams(0),
+ FilesSize(0),
+ AltStreamsSize(0),
+ NumErrors(0)
+ {}
+};
+
+
+struct CDirItemsStat2: public CDirItemsStat
+{
+ UInt64 Anti_NumDirs;
+ UInt64 Anti_NumFiles;
+ UInt64 Anti_NumAltStreams;
+
+ // UInt64 Get_NumItems() const { return Anti_NumDirs + Anti_NumFiles + Anti_NumAltStreams + CDirItemsStat::Get_NumItems(); }
+ UInt64 Get_NumDataItems2() const { return Anti_NumFiles + Anti_NumAltStreams + CDirItemsStat::Get_NumDataItems(); }
+
+ bool IsEmpty() const { return CDirItemsStat::IsEmpty()
+ && 0 == Anti_NumDirs
+ && 0 == Anti_NumFiles
+ && 0 == Anti_NumAltStreams; }
+
+ CDirItemsStat2():
+ Anti_NumDirs(0),
+ Anti_NumFiles(0),
+ Anti_NumAltStreams(0)
+ {}
+};
+
+
+
+#define INTERFACE_IDirItemsCallback(x) \
+ virtual HRESULT ScanError(const FString &path, DWORD systemError) x; \
+ virtual HRESULT ScanProgress(const CDirItemsStat &st, const FString &path, bool isDir) x; \
+
+struct IDirItemsCallback
+{
+ INTERFACE_IDirItemsCallback(=0)
+};
+
+struct CDirItem
+{
+ UInt64 Size;
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+ UString Name;
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // UString ShortName;
+ CByteBuffer ReparseData;
+ CByteBuffer ReparseData2; // fixed (reduced) absolute links
+
+ bool AreReparseData() const { return ReparseData.Size() != 0 || ReparseData2.Size() != 0; }
+ #endif
+
+ UInt32 Attrib;
+ int PhyParent;
+ int LogParent;
+ int SecureIndex;
+
+ bool IsAltStream;
+
+ CDirItem(): PhyParent(-1), LogParent(-1), SecureIndex(-1), IsAltStream(false) {}
+ bool IsDir() const { return (Attrib & FILE_ATTRIBUTE_DIRECTORY) != 0 ; }
+};
+
+class CDirItems
+{
+ UStringVector Prefixes;
+ CIntVector PhyParents;
+ CIntVector LogParents;
+
+ UString GetPrefixesPath(const CIntVector &parents, int index, const UString &name) const;
+
+ HRESULT EnumerateDir(int phyParent, int logParent, const FString &phyPrefix);
+
+public:
+ CObjectVector<CDirItem> Items;
+
+ bool SymLinks;
+
+ bool ScanAltStreams;
+
+ CDirItemsStat Stat;
+
+ #ifndef UNDER_CE
+ HRESULT SetLinkInfo(CDirItem &dirItem, const NWindows::NFile::NFind::CFileInfo &fi,
+ const FString &phyPrefix);
+ #endif
+
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+
+ CUniqBlocks SecureBlocks;
+ CByteBuffer TempSecureBuf;
+ bool _saclEnabled;
+ bool ReadSecure;
+
+ HRESULT AddSecurityItem(const FString &path, int &secureIndex);
+
+ #endif
+
+ IDirItemsCallback *Callback;
+
+ CDirItems();
+
+ void AddDirFileInfo(int phyParent, int logParent, int secureIndex,
+ const NWindows::NFile::NFind::CFileInfo &fi);
+
+ HRESULT AddError(const FString &path, DWORD errorCode);
+ HRESULT AddError(const FString &path);
+
+ HRESULT ScanProgress(const FString &path);
+
+ // unsigned GetNumFolders() const { return Prefixes.Size(); }
+ FString GetPhyPath(unsigned index) const;
+ UString GetLogPath(unsigned index) const;
+
+ unsigned AddPrefix(int phyParent, int logParent, const UString &prefix);
+ void DeleteLastPrefix();
+
+ HRESULT EnumerateItems2(
+ const FString &phyPrefix,
+ const UString &logPrefix,
+ const FStringVector &filePaths,
+ FStringVector *requestedPaths);
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ void FillFixedReparse();
+ #endif
+
+ void ReserveDown();
+};
+
+struct CArcItem
+{
+ UInt64 Size;
+ FILETIME MTime;
+ UString Name;
+ bool IsDir;
+ bool IsAltStream;
+ bool SizeDefined;
+ bool MTimeDefined;
+ bool Censored;
+ UInt32 IndexInServer;
+ int TimeType;
+
+ CArcItem(): IsDir(false), IsAltStream(false), SizeDefined(false), MTimeDefined(false), Censored(false), TimeType(-1) {}
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.cpp
new file mode 100644
index 0000000000..032e2fffe1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.cpp
@@ -0,0 +1,1086 @@
+// EnumDirItems.cpp
+
+#include "StdAfx.h"
+
+#include <wchar.h>
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileIO.h"
+#include "../../../Windows/FileName.h"
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+#define _USE_SECURITY_CODE
+#include "../../../Windows/SecurityUtils.h"
+#endif
+
+#include "EnumDirItems.h"
+#include "SortUtils.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+
+void CDirItems::AddDirFileInfo(int phyParent, int logParent, int secureIndex,
+ const NFind::CFileInfo &fi)
+{
+ CDirItem di;
+ di.Size = fi.Size;
+ di.CTime = fi.CTime;
+ di.ATime = fi.ATime;
+ di.MTime = fi.MTime;
+ di.Attrib = fi.Attrib;
+ di.IsAltStream = fi.IsAltStream;
+ di.PhyParent = phyParent;
+ di.LogParent = logParent;
+ di.SecureIndex = secureIndex;
+ di.Name = fs2us(fi.Name);
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // di.ShortName = fs2us(fi.ShortName);
+ #endif
+ Items.Add(di);
+
+ if (fi.IsDir())
+ Stat.NumDirs++;
+ else if (fi.IsAltStream)
+ {
+ Stat.NumAltStreams++;
+ Stat.AltStreamsSize += fi.Size;
+ }
+ else
+ {
+ Stat.NumFiles++;
+ Stat.FilesSize += fi.Size;
+ }
+}
+
+HRESULT CDirItems::AddError(const FString &path, DWORD errorCode)
+{
+ Stat.NumErrors++;
+ if (Callback)
+ return Callback->ScanError(path, errorCode);
+ return S_OK;
+}
+
+HRESULT CDirItems::AddError(const FString &path)
+{
+ return AddError(path, ::GetLastError());
+}
+
+static const unsigned kScanProgressStepMask = (1 << 12) - 1;
+
+HRESULT CDirItems::ScanProgress(const FString &dirPath)
+{
+ if (Callback)
+ return Callback->ScanProgress(Stat, dirPath, true);
+ return S_OK;
+}
+
+UString CDirItems::GetPrefixesPath(const CIntVector &parents, int index, const UString &name) const
+{
+ UString path;
+ unsigned len = name.Len();
+
+ int i;
+ for (i = index; i >= 0; i = parents[i])
+ len += Prefixes[i].Len();
+
+ wchar_t *p = path.GetBuf_SetEnd(len) + len;
+
+ p -= name.Len();
+ wmemcpy(p, (const wchar_t *)name, name.Len());
+
+ for (i = index; i >= 0; i = parents[i])
+ {
+ const UString &s = Prefixes[i];
+ p -= s.Len();
+ wmemcpy(p, (const wchar_t *)s, s.Len());
+ }
+
+ return path;
+}
+
+FString CDirItems::GetPhyPath(unsigned index) const
+{
+ const CDirItem &di = Items[index];
+ return us2fs(GetPrefixesPath(PhyParents, di.PhyParent, di.Name));
+}
+
+UString CDirItems::GetLogPath(unsigned index) const
+{
+ const CDirItem &di = Items[index];
+ return GetPrefixesPath(LogParents, di.LogParent, di.Name);
+}
+
+void CDirItems::ReserveDown()
+{
+ Prefixes.ReserveDown();
+ PhyParents.ReserveDown();
+ LogParents.ReserveDown();
+ Items.ReserveDown();
+}
+
+unsigned CDirItems::AddPrefix(int phyParent, int logParent, const UString &prefix)
+{
+ PhyParents.Add(phyParent);
+ LogParents.Add(logParent);
+ return Prefixes.Add(prefix);
+}
+
+void CDirItems::DeleteLastPrefix()
+{
+ PhyParents.DeleteBack();
+ LogParents.DeleteBack();
+ Prefixes.DeleteBack();
+}
+
+bool InitLocalPrivileges();
+
+CDirItems::CDirItems():
+ SymLinks(false),
+ ScanAltStreams(false)
+ #ifdef _USE_SECURITY_CODE
+ , ReadSecure(false)
+ #endif
+ , Callback(NULL)
+{
+ #ifdef _USE_SECURITY_CODE
+ _saclEnabled = InitLocalPrivileges();
+ #endif
+}
+
+#ifdef _USE_SECURITY_CODE
+
+HRESULT CDirItems::AddSecurityItem(const FString &path, int &secureIndex)
+{
+ secureIndex = -1;
+
+ SECURITY_INFORMATION securInfo =
+ DACL_SECURITY_INFORMATION |
+ GROUP_SECURITY_INFORMATION |
+ OWNER_SECURITY_INFORMATION;
+ if (_saclEnabled)
+ securInfo |= SACL_SECURITY_INFORMATION;
+
+ DWORD errorCode = 0;
+ DWORD secureSize;
+
+ BOOL res = ::GetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(Byte *)TempSecureBuf, (DWORD)TempSecureBuf.Size(), &secureSize);
+
+ if (res)
+ {
+ if (secureSize == 0)
+ return S_OK;
+ if (secureSize > TempSecureBuf.Size())
+ errorCode = ERROR_INVALID_FUNCTION;
+ }
+ else
+ {
+ errorCode = GetLastError();
+ if (errorCode == ERROR_INSUFFICIENT_BUFFER)
+ {
+ if (secureSize <= TempSecureBuf.Size())
+ errorCode = ERROR_INVALID_FUNCTION;
+ else
+ {
+ TempSecureBuf.Alloc(secureSize);
+ res = ::GetFileSecurityW(fs2us(path), securInfo, (PSECURITY_DESCRIPTOR)(Byte *)TempSecureBuf, (DWORD)TempSecureBuf.Size(), &secureSize);
+ if (res)
+ {
+ if (secureSize != TempSecureBuf.Size())
+ errorCode = ERROR_INVALID_FUNCTION;;
+ }
+ else
+ errorCode = GetLastError();
+ }
+ }
+ }
+
+ if (res)
+ {
+ secureIndex = SecureBlocks.AddUniq(TempSecureBuf, secureSize);
+ return S_OK;
+ }
+
+ if (errorCode == 0)
+ errorCode = ERROR_INVALID_FUNCTION;
+ return AddError(path, errorCode);
+}
+
+#endif
+
+HRESULT CDirItems::EnumerateDir(int phyParent, int logParent, const FString &phyPrefix)
+{
+ RINOK(ScanProgress(phyPrefix));
+
+ NFind::CEnumerator enumerator;
+ enumerator.SetDirPrefix(phyPrefix);
+ for (unsigned ttt = 0; ; ttt++)
+ {
+ NFind::CFileInfo fi;
+ bool found;
+ if (!enumerator.Next(fi, found))
+ {
+ return AddError(phyPrefix);
+ }
+ if (!found)
+ return S_OK;
+
+ int secureIndex = -1;
+ #ifdef _USE_SECURITY_CODE
+ if (ReadSecure)
+ {
+ RINOK(AddSecurityItem(phyPrefix + fi.Name, secureIndex));
+ }
+ #endif
+
+ AddDirFileInfo(phyParent, logParent, secureIndex, fi);
+
+ if (Callback && (ttt & kScanProgressStepMask) == kScanProgressStepMask)
+ {
+ RINOK(ScanProgress(phyPrefix));
+ }
+
+ if (fi.IsDir())
+ {
+ const FString name2 = fi.Name + FCHAR_PATH_SEPARATOR;
+ unsigned parent = AddPrefix(phyParent, logParent, fs2us(name2));
+ RINOK(EnumerateDir(parent, parent, phyPrefix + name2));
+ }
+ }
+}
+
+HRESULT CDirItems::EnumerateItems2(
+ const FString &phyPrefix,
+ const UString &logPrefix,
+ const FStringVector &filePaths,
+ FStringVector *requestedPaths)
+{
+ int phyParent = phyPrefix.IsEmpty() ? -1 : AddPrefix(-1, -1, fs2us(phyPrefix));
+ int logParent = logPrefix.IsEmpty() ? -1 : AddPrefix(-1, -1, logPrefix);
+
+ FOR_VECTOR (i, filePaths)
+ {
+ const FString &filePath = filePaths[i];
+ NFind::CFileInfo fi;
+ const FString phyPath = phyPrefix + filePath;
+ if (!fi.Find(phyPath))
+ {
+ RINOK(AddError(phyPath));
+ continue;
+ }
+ if (requestedPaths)
+ requestedPaths->Add(phyPath);
+
+ int delimiter = filePath.ReverseFind_PathSepar();
+ FString phyPrefixCur;
+ int phyParentCur = phyParent;
+ if (delimiter >= 0)
+ {
+ phyPrefixCur.SetFrom(filePath, delimiter + 1);
+ phyParentCur = AddPrefix(phyParent, logParent, fs2us(phyPrefixCur));
+ }
+
+ int secureIndex = -1;
+ #ifdef _USE_SECURITY_CODE
+ if (ReadSecure)
+ {
+ RINOK(AddSecurityItem(phyPath, secureIndex));
+ }
+ #endif
+
+ AddDirFileInfo(phyParentCur, logParent, secureIndex, fi);
+
+ if (fi.IsDir())
+ {
+ const FString name2 = fi.Name + FCHAR_PATH_SEPARATOR;
+ unsigned parent = AddPrefix(phyParentCur, logParent, fs2us(name2));
+ RINOK(EnumerateDir(parent, parent, phyPrefix + phyPrefixCur + name2));
+ }
+ }
+
+ ReserveDown();
+ return S_OK;
+}
+
+
+
+
+
+
+static HRESULT EnumerateDirItems(
+ const NWildcard::CCensorNode &curNode,
+ int phyParent, int logParent, const FString &phyPrefix,
+ const UStringVector &addArchivePrefix,
+ CDirItems &dirItems,
+ bool enterToSubFolders);
+
+static HRESULT EnumerateDirItems_Spec(
+ const NWildcard::CCensorNode &curNode,
+ int phyParent, int logParent, const FString &curFolderName,
+ const FString &phyPrefix,
+ const UStringVector &addArchivePrefix,
+ CDirItems &dirItems,
+ bool enterToSubFolders)
+{
+ const FString name2 = curFolderName + FCHAR_PATH_SEPARATOR;
+ unsigned parent = dirItems.AddPrefix(phyParent, logParent, fs2us(name2));
+ unsigned numItems = dirItems.Items.Size();
+ HRESULT res = EnumerateDirItems(
+ curNode, parent, parent, phyPrefix + name2,
+ addArchivePrefix, dirItems, enterToSubFolders);
+ if (numItems == dirItems.Items.Size())
+ dirItems.DeleteLastPrefix();
+ return res;
+}
+
+#ifndef UNDER_CE
+
+#ifdef _WIN32
+
+static HRESULT EnumerateAltStreams(
+ const NFind::CFileInfo &fi,
+ const NWildcard::CCensorNode &curNode,
+ int phyParent, int logParent, const FString &fullPath,
+ const UStringVector &addArchivePrefix, // prefix from curNode
+ bool addAllItems,
+ CDirItems &dirItems)
+{
+ NFind::CStreamEnumerator enumerator(fullPath);
+ for (;;)
+ {
+ NFind::CStreamInfo si;
+ bool found;
+ if (!enumerator.Next(si, found))
+ {
+ return dirItems.AddError(fullPath + FTEXT(":*")); // , (DWORD)E_FAIL
+ }
+ if (!found)
+ return S_OK;
+ if (si.IsMainStream())
+ continue;
+ UStringVector addArchivePrefixNew = addArchivePrefix;
+ UString reducedName = si.GetReducedName();
+ addArchivePrefixNew.Back() += reducedName;
+ if (curNode.CheckPathToRoot(false, addArchivePrefixNew, true))
+ continue;
+ if (!addAllItems)
+ if (!curNode.CheckPathToRoot(true, addArchivePrefixNew, true))
+ continue;
+
+ NFind::CFileInfo fi2 = fi;
+ fi2.Name += us2fs(reducedName);
+ fi2.Size = si.Size;
+ fi2.Attrib &= ~FILE_ATTRIBUTE_DIRECTORY;
+ fi2.IsAltStream = true;
+ dirItems.AddDirFileInfo(phyParent, logParent, -1, fi2);
+ }
+}
+
+#endif
+
+HRESULT CDirItems::SetLinkInfo(CDirItem &dirItem, const NFind::CFileInfo &fi,
+ const FString &phyPrefix)
+{
+ if (!SymLinks || !fi.HasReparsePoint())
+ return S_OK;
+ const FString path = phyPrefix + fi.Name;
+ CByteBuffer &buf = dirItem.ReparseData;
+ DWORD res = 0;
+ if (NIO::GetReparseData(path, buf))
+ {
+ CReparseAttr attr;
+ if (attr.Parse(buf, buf.Size(), res))
+ return S_OK;
+ // we ignore unknown reparse points
+ if (res != ERROR_INVALID_REPARSE_DATA)
+ res = 0;
+ }
+ else
+ {
+ res = ::GetLastError();
+ if (res == 0)
+ res = ERROR_INVALID_FUNCTION;
+ }
+
+ buf.Free();
+ if (res == 0)
+ return S_OK;
+ return AddError(path, res);
+}
+
+#endif
+
+static HRESULT EnumerateForItem(
+ NFind::CFileInfo &fi,
+ const NWildcard::CCensorNode &curNode,
+ int phyParent, int logParent, const FString &phyPrefix,
+ const UStringVector &addArchivePrefix, // prefix from curNode
+ CDirItems &dirItems,
+ bool enterToSubFolders)
+{
+ const UString name = fs2us(fi.Name);
+ bool enterToSubFolders2 = enterToSubFolders;
+ UStringVector addArchivePrefixNew = addArchivePrefix;
+ addArchivePrefixNew.Add(name);
+ {
+ UStringVector addArchivePrefixNewTemp(addArchivePrefixNew);
+ if (curNode.CheckPathToRoot(false, addArchivePrefixNewTemp, !fi.IsDir()))
+ return S_OK;
+ }
+ int dirItemIndex = -1;
+
+ bool addAllSubStreams = false;
+
+ if (curNode.CheckPathToRoot(true, addArchivePrefixNew, !fi.IsDir()))
+ {
+ int secureIndex = -1;
+ #ifdef _USE_SECURITY_CODE
+ if (dirItems.ReadSecure)
+ {
+ RINOK(dirItems.AddSecurityItem(phyPrefix + fi.Name, secureIndex));
+ }
+ #endif
+
+ dirItemIndex = dirItems.Items.Size();
+ dirItems.AddDirFileInfo(phyParent, logParent, secureIndex, fi);
+ if (fi.IsDir())
+ enterToSubFolders2 = true;
+
+ addAllSubStreams = true;
+ }
+
+ #ifndef UNDER_CE
+ if (dirItems.ScanAltStreams)
+ {
+ RINOK(EnumerateAltStreams(fi, curNode, phyParent, logParent,
+ phyPrefix + fi.Name,
+ addArchivePrefixNew,
+ addAllSubStreams,
+ dirItems));
+ }
+
+ if (dirItemIndex >= 0)
+ {
+ CDirItem &dirItem = dirItems.Items[dirItemIndex];
+ RINOK(dirItems.SetLinkInfo(dirItem, fi, phyPrefix));
+ if (dirItem.ReparseData.Size() != 0)
+ return S_OK;
+ }
+ #endif
+
+ if (!fi.IsDir())
+ return S_OK;
+
+ const NWildcard::CCensorNode *nextNode = 0;
+ if (addArchivePrefix.IsEmpty())
+ {
+ int index = curNode.FindSubNode(name);
+ if (index >= 0)
+ nextNode = &curNode.SubNodes[index];
+ }
+ if (!enterToSubFolders2 && nextNode == 0)
+ return S_OK;
+
+ addArchivePrefixNew = addArchivePrefix;
+ if (nextNode == 0)
+ {
+ nextNode = &curNode;
+ addArchivePrefixNew.Add(name);
+ }
+
+ return EnumerateDirItems_Spec(
+ *nextNode, phyParent, logParent, fi.Name, phyPrefix,
+ addArchivePrefixNew,
+ dirItems,
+ enterToSubFolders2);
+}
+
+
+static bool CanUseFsDirect(const NWildcard::CCensorNode &curNode)
+{
+ FOR_VECTOR (i, curNode.IncludeItems)
+ {
+ const NWildcard::CItem &item = curNode.IncludeItems[i];
+ if (item.Recursive || item.PathParts.Size() != 1)
+ return false;
+ const UString &name = item.PathParts.Front();
+ /*
+ if (name.IsEmpty())
+ return false;
+ */
+
+ /* Windows doesn't support file name with wildcard
+ But if another system supports file name with wildcard,
+ and wildcard mode is disabled, we can ignore wildcard in name */
+ /*
+ if (!item.WildcardParsing)
+ continue;
+ */
+ if (DoesNameContainWildcard(name))
+ return false;
+ }
+ return true;
+}
+
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+static bool IsVirtualFsFolder(const FString &prefix, const UString &name)
+{
+ UString s = fs2us(prefix);
+ s += name;
+ s.Add_PathSepar();
+ return IsPathSepar(s[0]) && GetRootPrefixSize(s) == 0;
+}
+
+#endif
+
+static HRESULT EnumerateDirItems(
+ const NWildcard::CCensorNode &curNode,
+ int phyParent, int logParent, const FString &phyPrefix,
+ const UStringVector &addArchivePrefix, // prefix from curNode
+ CDirItems &dirItems,
+ bool enterToSubFolders)
+{
+ if (!enterToSubFolders)
+ if (curNode.NeedCheckSubDirs())
+ enterToSubFolders = true;
+
+ RINOK(dirItems.ScanProgress(phyPrefix));
+
+ // try direct_names case at first
+ if (addArchivePrefix.IsEmpty() && !enterToSubFolders)
+ {
+ if (CanUseFsDirect(curNode))
+ {
+ // all names are direct (no wildcards)
+ // so we don't need file_system's dir enumerator
+ CRecordVector<bool> needEnterVector;
+ unsigned i;
+
+ for (i = 0; i < curNode.IncludeItems.Size(); i++)
+ {
+ const NWildcard::CItem &item = curNode.IncludeItems[i];
+ const UString &name = item.PathParts.Front();
+ FString fullPath = phyPrefix + us2fs(name);
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ bool needAltStreams = true;
+ #endif
+
+ #ifdef _USE_SECURITY_CODE
+ bool needSecurity = true;
+ #endif
+
+ if (phyPrefix.IsEmpty())
+ {
+ if (!item.ForFile)
+ {
+ /* we don't like some names for alt streams inside archive:
+ ":sname" for "\"
+ "c:::sname" for "C:\"
+ So we ignore alt streams for these cases */
+ if (name.IsEmpty())
+ {
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ needAltStreams = false;
+ #endif
+
+ /*
+ // do we need to ignore security info for "\\" folder ?
+ #ifdef _USE_SECURITY_CODE
+ needSecurity = false;
+ #endif
+ */
+
+ fullPath = CHAR_PATH_SEPARATOR;
+ }
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ else if (item.IsDriveItem())
+ {
+ needAltStreams = false;
+ fullPath.Add_PathSepar();
+ }
+ #endif
+ }
+ }
+
+ NFind::CFileInfo fi;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (IsVirtualFsFolder(phyPrefix, name))
+ {
+ fi.SetAsDir();
+ fi.Name = us2fs(name);
+ }
+ else
+ #endif
+ if (!fi.Find(fullPath))
+ {
+ RINOK(dirItems.AddError(fullPath));
+ continue;
+ }
+
+ bool isDir = fi.IsDir();
+ if (isDir && !item.ForDir || !isDir && !item.ForFile)
+ {
+ RINOK(dirItems.AddError(fullPath, (DWORD)E_FAIL));
+ continue;
+ }
+ {
+ UStringVector pathParts;
+ pathParts.Add(fs2us(fi.Name));
+ if (curNode.CheckPathToRoot(false, pathParts, !isDir))
+ continue;
+ }
+
+ int secureIndex = -1;
+ #ifdef _USE_SECURITY_CODE
+ if (needSecurity && dirItems.ReadSecure)
+ {
+ RINOK(dirItems.AddSecurityItem(fullPath, secureIndex));
+ }
+ #endif
+
+ dirItems.AddDirFileInfo(phyParent, logParent, secureIndex, fi);
+
+ #ifndef UNDER_CE
+ {
+ CDirItem &dirItem = dirItems.Items.Back();
+ RINOK(dirItems.SetLinkInfo(dirItem, fi, phyPrefix));
+ if (dirItem.ReparseData.Size() != 0)
+ {
+ if (fi.IsAltStream)
+ dirItems.Stat.AltStreamsSize -= fi.Size;
+ else
+ dirItems.Stat.FilesSize -= fi.Size;
+ continue;
+ }
+ }
+ #endif
+
+
+ #ifndef UNDER_CE
+ if (needAltStreams && dirItems.ScanAltStreams)
+ {
+ UStringVector pathParts;
+ pathParts.Add(fs2us(fi.Name));
+ RINOK(EnumerateAltStreams(fi, curNode, phyParent, logParent,
+ fullPath, pathParts,
+ true, /* addAllSubStreams */
+ dirItems));
+ }
+ #endif
+
+ if (!isDir)
+ continue;
+
+ UStringVector addArchivePrefixNew;
+ const NWildcard::CCensorNode *nextNode = 0;
+ int index = curNode.FindSubNode(name);
+ if (index >= 0)
+ {
+ for (int t = needEnterVector.Size(); t <= index; t++)
+ needEnterVector.Add(true);
+ needEnterVector[index] = false;
+ nextNode = &curNode.SubNodes[index];
+ }
+ else
+ {
+ nextNode = &curNode;
+ addArchivePrefixNew.Add(name); // don't change it to fi.Name. It's for shortnames support
+ }
+
+ RINOK(EnumerateDirItems_Spec(*nextNode, phyParent, logParent, fi.Name, phyPrefix,
+ addArchivePrefixNew, dirItems, true));
+ }
+
+ for (i = 0; i < curNode.SubNodes.Size(); i++)
+ {
+ if (i < needEnterVector.Size())
+ if (!needEnterVector[i])
+ continue;
+ const NWildcard::CCensorNode &nextNode = curNode.SubNodes[i];
+ FString fullPath = phyPrefix + us2fs(nextNode.Name);
+ NFind::CFileInfo fi;
+
+ if (phyPrefix.IsEmpty())
+ {
+ {
+ if (nextNode.Name.IsEmpty())
+ fullPath = CHAR_PATH_SEPARATOR;
+ #ifdef _WIN32
+ else if (NWildcard::IsDriveColonName(nextNode.Name))
+ fullPath.Add_PathSepar();
+ #endif
+ }
+ }
+
+ // we don't want to call fi.Find() for root folder or virtual folder
+ if (phyPrefix.IsEmpty() && nextNode.Name.IsEmpty()
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ || IsVirtualFsFolder(phyPrefix, nextNode.Name)
+ #endif
+ )
+ {
+ fi.SetAsDir();
+ fi.Name = us2fs(nextNode.Name);
+ }
+ else
+ {
+ if (!fi.Find(fullPath))
+ {
+ if (!nextNode.AreThereIncludeItems())
+ continue;
+ RINOK(dirItems.AddError(fullPath));
+ continue;
+ }
+
+ if (!fi.IsDir())
+ {
+ RINOK(dirItems.AddError(fullPath, (DWORD)E_FAIL));
+ continue;
+ }
+ }
+
+ RINOK(EnumerateDirItems_Spec(nextNode, phyParent, logParent, fi.Name, phyPrefix,
+ UStringVector(), dirItems, false));
+ }
+
+ return S_OK;
+ }
+ }
+
+ #ifdef _WIN32
+ #ifndef UNDER_CE
+
+ // scan drives, if wildcard is "*:\"
+
+ if (phyPrefix.IsEmpty() && curNode.IncludeItems.Size() > 0)
+ {
+ unsigned i;
+ for (i = 0; i < curNode.IncludeItems.Size(); i++)
+ {
+ const NWildcard::CItem &item = curNode.IncludeItems[i];
+ if (item.PathParts.Size() < 1)
+ break;
+ const UString &name = item.PathParts.Front();
+ if (name.Len() != 2 || name[1] != ':')
+ break;
+ if (item.PathParts.Size() == 1)
+ if (item.ForFile || !item.ForDir)
+ break;
+ if (NWildcard::IsDriveColonName(name))
+ continue;
+ if (name[0] != '*' && name[0] != '?')
+ break;
+ }
+ if (i == curNode.IncludeItems.Size())
+ {
+ FStringVector driveStrings;
+ NFind::MyGetLogicalDriveStrings(driveStrings);
+ for (i = 0; i < driveStrings.Size(); i++)
+ {
+ FString driveName = driveStrings[i];
+ if (driveName.Len() < 3 || driveName.Back() != '\\')
+ return E_FAIL;
+ driveName.DeleteBack();
+ NFind::CFileInfo fi;
+ fi.SetAsDir();
+ fi.Name = driveName;
+
+ RINOK(EnumerateForItem(fi, curNode, phyParent, logParent, phyPrefix,
+ addArchivePrefix, dirItems, enterToSubFolders));
+ }
+ return S_OK;
+ }
+ }
+
+ #endif
+ #endif
+
+ NFind::CEnumerator enumerator;
+ enumerator.SetDirPrefix(phyPrefix);
+
+ for (unsigned ttt = 0; ; ttt++)
+ {
+ NFind::CFileInfo fi;
+ bool found;
+ if (!enumerator.Next(fi, found))
+ {
+ RINOK(dirItems.AddError(phyPrefix));
+ break;
+ }
+ if (!found)
+ break;
+
+ if (dirItems.Callback && (ttt & kScanProgressStepMask) == kScanProgressStepMask)
+ {
+ RINOK(dirItems.ScanProgress(phyPrefix));
+ }
+
+ RINOK(EnumerateForItem(fi, curNode, phyParent, logParent, phyPrefix,
+ addArchivePrefix, dirItems, enterToSubFolders));
+ }
+
+ return S_OK;
+}
+
+HRESULT EnumerateItems(
+ const NWildcard::CCensor &censor,
+ const NWildcard::ECensorPathMode pathMode,
+ const UString &addPathPrefix,
+ CDirItems &dirItems)
+{
+ FOR_VECTOR (i, censor.Pairs)
+ {
+ const NWildcard::CPair &pair = censor.Pairs[i];
+ int phyParent = pair.Prefix.IsEmpty() ? -1 : dirItems.AddPrefix(-1, -1, pair.Prefix);
+ int logParent = -1;
+
+ if (pathMode == NWildcard::k_AbsPath)
+ logParent = phyParent;
+ else
+ {
+ if (!addPathPrefix.IsEmpty())
+ logParent = dirItems.AddPrefix(-1, -1, addPathPrefix);
+ }
+
+ RINOK(EnumerateDirItems(pair.Head, phyParent, logParent, us2fs(pair.Prefix), UStringVector(),
+ dirItems,
+ false // enterToSubFolders
+ ));
+ }
+ dirItems.ReserveDown();
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ dirItems.FillFixedReparse();
+ #endif
+
+ return S_OK;
+}
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+void CDirItems::FillFixedReparse()
+{
+ /* imagex/WIM reduces absolute pathes in links (raparse data),
+ if we archive non root folder. We do same thing here */
+
+ if (!SymLinks)
+ return;
+
+ FOR_VECTOR(i, Items)
+ {
+ CDirItem &item = Items[i];
+ if (item.ReparseData.Size() == 0)
+ continue;
+
+ CReparseAttr attr;
+ DWORD errorCode = 0;
+ if (!attr.Parse(item.ReparseData, item.ReparseData.Size(), errorCode))
+ continue;
+ if (attr.IsRelative())
+ continue;
+
+ const UString &link = attr.GetPath();
+ if (!IsDrivePath(link))
+ continue;
+ // maybe we need to support networks paths also ?
+
+ FString fullPathF;
+ if (!NDir::MyGetFullPathName(GetPhyPath(i), fullPathF))
+ continue;
+ UString fullPath = fs2us(fullPathF);
+ const UString logPath = GetLogPath(i);
+ if (logPath.Len() >= fullPath.Len())
+ continue;
+ if (CompareFileNames(logPath, fullPath.RightPtr(logPath.Len())) != 0)
+ continue;
+
+ const UString prefix = fullPath.Left(fullPath.Len() - logPath.Len());
+ if (!IsPathSepar(prefix.Back()))
+ continue;
+
+ unsigned rootPrefixSize = GetRootPrefixSize(prefix);
+ if (rootPrefixSize == 0)
+ continue;
+ if (rootPrefixSize == prefix.Len())
+ continue; // simple case: paths are from root
+
+ if (link.Len() <= prefix.Len())
+ continue;
+
+ if (CompareFileNames(link.Left(prefix.Len()), prefix) != 0)
+ continue;
+
+ UString newLink = prefix.Left(rootPrefixSize);
+ newLink += link.Ptr(prefix.Len());
+
+ CByteBuffer data;
+ if (!FillLinkData(data, newLink, attr.IsSymLink()))
+ continue;
+ item.ReparseData2 = data;
+ }
+}
+
+#endif
+
+
+
+static const char * const kCannotFindArchive = "Cannot find archive";
+
+HRESULT EnumerateDirItemsAndSort(
+ NWildcard::CCensor &censor,
+ NWildcard::ECensorPathMode censorPathMode,
+ const UString &addPathPrefix,
+ UStringVector &sortedPaths,
+ UStringVector &sortedFullPaths,
+ CDirItemsStat &st,
+ IDirItemsCallback *callback)
+{
+ FStringVector paths;
+
+ {
+ CDirItems dirItems;
+ dirItems.Callback = callback;
+ {
+ HRESULT res = EnumerateItems(censor, censorPathMode, addPathPrefix, dirItems);
+ st = dirItems.Stat;
+ RINOK(res);
+ }
+
+ FOR_VECTOR (i, dirItems.Items)
+ {
+ const CDirItem &dirItem = dirItems.Items[i];
+ if (!dirItem.IsDir())
+ paths.Add(dirItems.GetPhyPath(i));
+ }
+ }
+
+ if (paths.Size() == 0)
+ {
+ // return S_OK;
+ throw CMessagePathException(kCannotFindArchive);
+ }
+
+ UStringVector fullPaths;
+
+ unsigned i;
+
+ for (i = 0; i < paths.Size(); i++)
+ {
+ FString fullPath;
+ NFile::NDir::MyGetFullPathName(paths[i], fullPath);
+ fullPaths.Add(fs2us(fullPath));
+ }
+
+ CUIntVector indices;
+ SortFileNames(fullPaths, indices);
+ sortedPaths.ClearAndReserve(indices.Size());
+ sortedFullPaths.ClearAndReserve(indices.Size());
+
+ for (i = 0; i < indices.Size(); i++)
+ {
+ unsigned index = indices[i];
+ sortedPaths.AddInReserved(fs2us(paths[index]));
+ sortedFullPaths.AddInReserved(fullPaths[index]);
+ if (i > 0 && CompareFileNames(sortedFullPaths[i], sortedFullPaths[i - 1]) == 0)
+ throw CMessagePathException("Duplicate archive path:", sortedFullPaths[i]);
+ }
+
+ return S_OK;
+}
+
+
+
+
+#ifdef _WIN32
+
+// This code converts all short file names to long file names.
+
+static void ConvertToLongName(const UString &prefix, UString &name)
+{
+ if (name.IsEmpty() || DoesNameContainWildcard(name))
+ return;
+ NFind::CFileInfo fi;
+ const FString path (us2fs(prefix + name));
+ #ifndef UNDER_CE
+ if (NFile::NName::IsDevicePath(path))
+ return;
+ #endif
+ if (fi.Find(path))
+ name = fs2us(fi.Name);
+}
+
+static void ConvertToLongNames(const UString &prefix, CObjectVector<NWildcard::CItem> &items)
+{
+ FOR_VECTOR (i, items)
+ {
+ NWildcard::CItem &item = items[i];
+ if (item.Recursive || item.PathParts.Size() != 1)
+ continue;
+ if (prefix.IsEmpty() && item.IsDriveItem())
+ continue;
+ ConvertToLongName(prefix, item.PathParts.Front());
+ }
+}
+
+static void ConvertToLongNames(const UString &prefix, NWildcard::CCensorNode &node)
+{
+ ConvertToLongNames(prefix, node.IncludeItems);
+ ConvertToLongNames(prefix, node.ExcludeItems);
+ unsigned i;
+ for (i = 0; i < node.SubNodes.Size(); i++)
+ {
+ UString &name = node.SubNodes[i].Name;
+ if (prefix.IsEmpty() && NWildcard::IsDriveColonName(name))
+ continue;
+ ConvertToLongName(prefix, name);
+ }
+ // mix folders with same name
+ for (i = 0; i < node.SubNodes.Size(); i++)
+ {
+ NWildcard::CCensorNode &nextNode1 = node.SubNodes[i];
+ for (unsigned j = i + 1; j < node.SubNodes.Size();)
+ {
+ const NWildcard::CCensorNode &nextNode2 = node.SubNodes[j];
+ if (nextNode1.Name.IsEqualTo_NoCase(nextNode2.Name))
+ {
+ nextNode1.IncludeItems += nextNode2.IncludeItems;
+ nextNode1.ExcludeItems += nextNode2.ExcludeItems;
+ node.SubNodes.Delete(j);
+ }
+ else
+ j++;
+ }
+ }
+ for (i = 0; i < node.SubNodes.Size(); i++)
+ {
+ NWildcard::CCensorNode &nextNode = node.SubNodes[i];
+ ConvertToLongNames(prefix + nextNode.Name + WCHAR_PATH_SEPARATOR, nextNode);
+ }
+}
+
+void ConvertToLongNames(NWildcard::CCensor &censor)
+{
+ FOR_VECTOR (i, censor.Pairs)
+ {
+ NWildcard::CPair &pair = censor.Pairs[i];
+ ConvertToLongNames(pair.Prefix, pair.Head);
+ }
+}
+
+#endif
+
+
+CMessagePathException::CMessagePathException(const char *a, const wchar_t *u)
+{
+ (*this) += a;
+ if (u)
+ {
+ Add_LF();
+ (*this) += u;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.h
new file mode 100644
index 0000000000..6220500538
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/EnumDirItems.h
@@ -0,0 +1,41 @@
+// EnumDirItems.h
+
+#ifndef __ENUM_DIR_ITEMS_H
+#define __ENUM_DIR_ITEMS_H
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileFind.h"
+
+#include "DirItem.h"
+
+void AddDirFileInfo(int phyParent, int logParent, int secureIndex,
+ const NWindows::NFile::NFind::CFileInfo &fi, CObjectVector<CDirItem> &dirItems);
+
+HRESULT EnumerateItems(
+ const NWildcard::CCensor &censor,
+ NWildcard::ECensorPathMode pathMode,
+ const UString &addPathPrefix,
+ CDirItems &dirItems);
+
+
+struct CMessagePathException: public UString
+{
+ CMessagePathException(const char *a, const wchar_t *u = NULL);
+};
+
+
+HRESULT EnumerateDirItemsAndSort(
+ NWildcard::CCensor &censor,
+ NWildcard::ECensorPathMode pathMode,
+ const UString &addPathPrefix,
+ UStringVector &sortedPaths,
+ UStringVector &sortedFullPaths,
+ CDirItemsStat &st,
+ IDirItemsCallback *callback);
+
+#ifdef _WIN32
+void ConvertToLongNames(NWildcard::CCensor &censor);
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExitCode.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExitCode.h
new file mode 100644
index 0000000000..d03ec6d797
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExitCode.h
@@ -0,0 +1,27 @@
+// ExitCode.h
+
+#ifndef __EXIT_CODE_H
+#define __EXIT_CODE_H
+
+namespace NExitCode {
+
+enum EEnum {
+
+ kSuccess = 0, // Successful operation
+ kWarning = 1, // Non fatal error(s) occurred
+ kFatalError = 2, // A fatal error occurred
+ // kCRCError = 3, // A CRC error occurred when unpacking
+ // kLockedArchive = 4, // Attempt to modify an archive previously locked
+ // kWriteError = 5, // Write to disk error
+ // kOpenError = 6, // Open file error
+ kUserError = 7, // Command line option error
+ kMemoryError = 8, // Not enough memory for operation
+ // kCreateFileError = 9, // Create file error
+
+ kUserBreak = 255 // User stopped the process
+
+};
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.cpp
new file mode 100644
index 0000000000..2cb2c9b924
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.cpp
@@ -0,0 +1,482 @@
+// Extract.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/Sort.h"
+
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/PropVariant.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#include "../Common/ExtractingFilePath.h"
+
+#include "Extract.h"
+#include "SetProperties.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static HRESULT DecompressArchive(
+ CCodecs *codecs,
+ const CArchiveLink &arcLink,
+ UInt64 packSize,
+ const NWildcard::CCensorNode &wildcardCensor,
+ const CExtractOptions &options,
+ bool calcCrc,
+ IExtractCallbackUI *callback,
+ CArchiveExtractCallback *ecs,
+ UString &errorMessage,
+ UInt64 &stdInProcessed)
+{
+ const CArc &arc = arcLink.Arcs.Back();
+ stdInProcessed = 0;
+ IInArchive *archive = arc.Archive;
+ CRecordVector<UInt32> realIndices;
+
+ UStringVector removePathParts;
+
+ FString outDir = options.OutputDir;
+ UString replaceName = arc.DefaultName;
+
+ if (arcLink.Arcs.Size() > 1)
+ {
+ // Most "pe" archives have same name of archive subfile "[0]" or ".rsrc_1".
+ // So it extracts different archives to one folder.
+ // We will use top level archive name
+ const CArc &arc0 = arcLink.Arcs[0];
+ if (StringsAreEqualNoCase_Ascii(codecs->Formats[arc0.FormatIndex].Name, "pe"))
+ replaceName = arc0.DefaultName;
+ }
+
+ outDir.Replace(FString("*"), us2fs(Get_Correct_FsFile_Name(replaceName)));
+
+ bool elimIsPossible = false;
+ UString elimPrefix; // only pure name without dir delimiter
+ FString outDirReduced = outDir;
+
+ if (options.ElimDup.Val && options.PathMode != NExtract::NPathMode::kAbsPaths)
+ {
+ UString dirPrefix;
+ SplitPathToParts_Smart(fs2us(outDir), dirPrefix, elimPrefix);
+ if (!elimPrefix.IsEmpty())
+ {
+ if (IsPathSepar(elimPrefix.Back()))
+ elimPrefix.DeleteBack();
+ if (!elimPrefix.IsEmpty())
+ {
+ outDirReduced = us2fs(dirPrefix);
+ elimIsPossible = true;
+ }
+ }
+ }
+
+ bool allFilesAreAllowed = wildcardCensor.AreAllAllowed();
+
+ if (!options.StdInMode)
+ {
+ UInt32 numItems;
+ RINOK(archive->GetNumberOfItems(&numItems));
+
+ CReadArcItem item;
+
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ if (elimIsPossible || !allFilesAreAllowed)
+ {
+ RINOK(arc.GetItem(i, item));
+ }
+ else
+ {
+ #ifdef SUPPORT_ALT_STREAMS
+ item.IsAltStream = false;
+ if (!options.NtOptions.AltStreams.Val && arc.Ask_AltStream)
+ {
+ RINOK(Archive_IsItem_AltStream(arc.Archive, i, item.IsAltStream));
+ }
+ #endif
+ }
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (!options.NtOptions.AltStreams.Val && item.IsAltStream)
+ continue;
+ #endif
+
+ if (elimIsPossible)
+ {
+ const UString &s =
+ #ifdef SUPPORT_ALT_STREAMS
+ item.MainPath;
+ #else
+ item.Path;
+ #endif
+ if (!IsPath1PrefixedByPath2(s, elimPrefix))
+ elimIsPossible = false;
+ else
+ {
+ wchar_t c = s[elimPrefix.Len()];
+ if (c == 0)
+ {
+ if (!item.MainIsDir)
+ elimIsPossible = false;
+ }
+ else if (!IsPathSepar(c))
+ elimIsPossible = false;
+ }
+ }
+
+ if (!allFilesAreAllowed)
+ {
+ if (!CensorNode_CheckPath(wildcardCensor, item))
+ continue;
+ }
+
+ realIndices.Add(i);
+ }
+
+ if (realIndices.Size() == 0)
+ {
+ callback->ThereAreNoFiles();
+ return callback->ExtractResult(S_OK);
+ }
+ }
+
+ if (elimIsPossible)
+ {
+ removePathParts.Add(elimPrefix);
+ // outDir = outDirReduced;
+ }
+
+ #ifdef _WIN32
+ // GetCorrectFullFsPath doesn't like "..".
+ // outDir.TrimRight();
+ // outDir = GetCorrectFullFsPath(outDir);
+ #endif
+
+ if (outDir.IsEmpty())
+ outDir = "." STRING_PATH_SEPARATOR;
+ /*
+ #ifdef _WIN32
+ else if (NName::IsAltPathPrefix(outDir)) {}
+ #endif
+ */
+ else if (!CreateComplexDir(outDir))
+ {
+ HRESULT res = ::GetLastError();
+ if (res == S_OK)
+ res = E_FAIL;
+ errorMessage = "Can not create output directory: ";
+ errorMessage += fs2us(outDir);
+ return res;
+ }
+
+ ecs->Init(
+ options.NtOptions,
+ options.StdInMode ? &wildcardCensor : NULL,
+ &arc,
+ callback,
+ options.StdOutMode, options.TestMode,
+ outDir,
+ removePathParts, false,
+ packSize);
+
+
+ #ifdef SUPPORT_LINKS
+
+ if (!options.StdInMode &&
+ !options.TestMode &&
+ options.NtOptions.HardLinks.Val)
+ {
+ RINOK(ecs->PrepareHardLinks(&realIndices));
+ }
+
+ #endif
+
+
+ HRESULT result;
+ Int32 testMode = (options.TestMode && !calcCrc) ? 1: 0;
+
+ CArchiveExtractCallback_Closer ecsCloser(ecs);
+
+ if (options.StdInMode)
+ {
+ result = archive->Extract(NULL, (UInt32)(Int32)-1, testMode, ecs);
+ NCOM::CPropVariant prop;
+ if (archive->GetArchiveProperty(kpidPhySize, &prop) == S_OK)
+ ConvertPropVariantToUInt64(prop, stdInProcessed);
+ }
+ else
+ result = archive->Extract(&realIndices.Front(), realIndices.Size(), testMode, ecs);
+
+ HRESULT res2 = ecsCloser.Close();
+ if (result == S_OK)
+ result = res2;
+
+ return callback->ExtractResult(result);
+}
+
+/* v9.31: BUG was fixed:
+ Sorted list for file paths was sorted with case insensitive compare function.
+ But FindInSorted function did binary search via case sensitive compare function */
+
+int Find_FileName_InSortedVector(const UStringVector &fileName, const UString &name)
+{
+ unsigned left = 0, right = fileName.Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const UString &midValue = fileName[mid];
+ int compare = CompareFileNames(name, midValue);
+ if (compare == 0)
+ return mid;
+ if (compare < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ return -1;
+}
+
+HRESULT Extract(
+ CCodecs *codecs,
+ const CObjectVector<COpenType> &types,
+ const CIntVector &excludedFormats,
+ UStringVector &arcPaths, UStringVector &arcPathsFull,
+ const NWildcard::CCensorNode &wildcardCensor,
+ const CExtractOptions &options,
+ IOpenCallbackUI *openCallback,
+ IExtractCallbackUI *extractCallback,
+ #ifndef _SFX
+ IHashCalc *hash,
+ #endif
+ UString &errorMessage,
+ CDecompressStat &st)
+{
+ st.Clear();
+ UInt64 totalPackSize = 0;
+ CRecordVector<UInt64> arcSizes;
+
+ unsigned numArcs = options.StdInMode ? 1 : arcPaths.Size();
+
+ unsigned i;
+
+ for (i = 0; i < numArcs; i++)
+ {
+ NFind::CFileInfo fi;
+ fi.Size = 0;
+ if (!options.StdInMode)
+ {
+ const FString &arcPath = us2fs(arcPaths[i]);
+ if (!fi.Find(arcPath))
+ throw "there is no such archive";
+ if (fi.IsDir())
+ throw "can't decompress folder";
+ }
+ arcSizes.Add(fi.Size);
+ totalPackSize += fi.Size;
+ }
+
+ CBoolArr skipArcs(numArcs);
+ for (i = 0; i < numArcs; i++)
+ skipArcs[i] = false;
+
+ CArchiveExtractCallback *ecs = new CArchiveExtractCallback;
+ CMyComPtr<IArchiveExtractCallback> ec(ecs);
+ bool multi = (numArcs > 1);
+ ecs->InitForMulti(multi, options.PathMode, options.OverwriteMode,
+ false // keepEmptyDirParts
+ );
+ #ifndef _SFX
+ ecs->SetHashMethods(hash);
+ #endif
+
+ if (multi)
+ {
+ RINOK(extractCallback->SetTotal(totalPackSize));
+ }
+
+ UInt64 totalPackProcessed = 0;
+ bool thereAreNotOpenArcs = false;
+
+ for (i = 0; i < numArcs; i++)
+ {
+ if (skipArcs[i])
+ continue;
+
+ const UString &arcPath = arcPaths[i];
+ NFind::CFileInfo fi;
+ if (options.StdInMode)
+ {
+ fi.Size = 0;
+ fi.Attrib = 0;
+ }
+ else
+ {
+ if (!fi.Find(us2fs(arcPath)) || fi.IsDir())
+ throw "there is no such archive";
+ }
+
+ /*
+ #ifndef _NO_CRYPTO
+ openCallback->Open_Clear_PasswordWasAsked_Flag();
+ #endif
+ */
+
+ RINOK(extractCallback->BeforeOpen(arcPath, options.TestMode));
+ CArchiveLink arcLink;
+
+ CObjectVector<COpenType> types2 = types;
+ /*
+ #ifndef _SFX
+ if (types.IsEmpty())
+ {
+ int pos = arcPath.ReverseFind(L'.');
+ if (pos >= 0)
+ {
+ UString s = arcPath.Ptr(pos + 1);
+ int index = codecs->FindFormatForExtension(s);
+ if (index >= 0 && s == L"001")
+ {
+ s = arcPath.Left(pos);
+ pos = s.ReverseFind(L'.');
+ if (pos >= 0)
+ {
+ int index2 = codecs->FindFormatForExtension(s.Ptr(pos + 1));
+ if (index2 >= 0) // && s.CompareNoCase(L"rar") != 0
+ {
+ types2.Add(index2);
+ types2.Add(index);
+ }
+ }
+ }
+ }
+ }
+ #endif
+ */
+
+ COpenOptions op;
+ #ifndef _SFX
+ op.props = &options.Properties;
+ #endif
+ op.codecs = codecs;
+ op.types = &types2;
+ op.excludedFormats = &excludedFormats;
+ op.stdInMode = options.StdInMode;
+ op.stream = NULL;
+ op.filePath = arcPath;
+
+ HRESULT result = arcLink.Open_Strict(op, openCallback);
+
+ if (result == E_ABORT)
+ return result;
+
+ // arcLink.Set_ErrorsText();
+ RINOK(extractCallback->OpenResult(codecs, arcLink, arcPath, result));
+
+ if (result != S_OK)
+ {
+ thereAreNotOpenArcs = true;
+ if (!options.StdInMode)
+ {
+ NFind::CFileInfo fi2;
+ if (fi2.Find(us2fs(arcPath)))
+ if (!fi2.IsDir())
+ totalPackProcessed += fi2.Size;
+ }
+ continue;
+ }
+
+ if (!options.StdInMode)
+ {
+ // numVolumes += arcLink.VolumePaths.Size();
+ // arcLink.VolumesSize;
+
+ // totalPackSize -= DeleteUsedFileNamesFromList(arcLink, i + 1, arcPaths, arcPathsFull, &arcSizes);
+ // numArcs = arcPaths.Size();
+ if (arcLink.VolumePaths.Size() != 0)
+ {
+ Int64 correctionSize = arcLink.VolumesSize;
+ FOR_VECTOR (v, arcLink.VolumePaths)
+ {
+ int index = Find_FileName_InSortedVector(arcPathsFull, arcLink.VolumePaths[v]);
+ if (index >= 0)
+ {
+ if ((unsigned)index > i)
+ {
+ skipArcs[(unsigned)index] = true;
+ correctionSize -= arcSizes[(unsigned)index];
+ }
+ }
+ }
+ if (correctionSize != 0)
+ {
+ Int64 newPackSize = (Int64)totalPackSize + correctionSize;
+ if (newPackSize < 0)
+ newPackSize = 0;
+ totalPackSize = newPackSize;
+ RINOK(extractCallback->SetTotal(totalPackSize));
+ }
+ }
+ }
+
+ /*
+ // Now openCallback and extractCallback use same object. So we don't need to send password.
+
+ #ifndef _NO_CRYPTO
+ bool passwordIsDefined;
+ UString password;
+ RINOK(openCallback->Open_GetPasswordIfAny(passwordIsDefined, password));
+ if (passwordIsDefined)
+ {
+ RINOK(extractCallback->SetPassword(password));
+ }
+ #endif
+ */
+
+ CArc &arc = arcLink.Arcs.Back();
+ arc.MTimeDefined = (!options.StdInMode && !fi.IsDevice);
+ arc.MTime = fi.MTime;
+
+ UInt64 packProcessed;
+ bool calcCrc =
+ #ifndef _SFX
+ (hash != NULL);
+ #else
+ false;
+ #endif
+
+ RINOK(DecompressArchive(
+ codecs,
+ arcLink,
+ fi.Size + arcLink.VolumesSize,
+ wildcardCensor,
+ options,
+ calcCrc,
+ extractCallback, ecs, errorMessage, packProcessed));
+
+ if (!options.StdInMode)
+ packProcessed = fi.Size + arcLink.VolumesSize;
+ totalPackProcessed += packProcessed;
+ ecs->LocalProgressSpec->InSize += packProcessed;
+ ecs->LocalProgressSpec->OutSize = ecs->UnpackSize;
+ if (!errorMessage.IsEmpty())
+ return E_FAIL;
+ }
+
+ if (multi || thereAreNotOpenArcs)
+ {
+ RINOK(extractCallback->SetTotal(totalPackSize));
+ RINOK(extractCallback->SetCompleted(&totalPackProcessed));
+ }
+
+ st.NumFolders = ecs->NumFolders;
+ st.NumFiles = ecs->NumFiles;
+ st.NumAltStreams = ecs->NumAltStreams;
+ st.UnpackSize = ecs->UnpackSize;
+ st.AltStreams_UnpackSize = ecs->AltStreams_UnpackSize;
+ st.NumArchives = arcPaths.Size();
+ st.PackSize = ecs->LocalProgressSpec->InSize;
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.h
new file mode 100644
index 0000000000..9c806bee7e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Extract.h
@@ -0,0 +1,94 @@
+// Extract.h
+
+#ifndef __EXTRACT_H
+#define __EXTRACT_H
+
+#include "../../../Windows/FileFind.h"
+
+#include "../../Archive/IArchive.h"
+
+#include "ArchiveExtractCallback.h"
+#include "ArchiveOpenCallback.h"
+#include "ExtractMode.h"
+#include "Property.h"
+
+#include "../Common/LoadCodecs.h"
+
+struct CExtractOptionsBase
+{
+ CBoolPair ElimDup;
+
+ bool PathMode_Force;
+ bool OverwriteMode_Force;
+ NExtract::NPathMode::EEnum PathMode;
+ NExtract::NOverwriteMode::EEnum OverwriteMode;
+
+ FString OutputDir;
+ CExtractNtOptions NtOptions;
+
+ CExtractOptionsBase():
+ PathMode_Force(false),
+ OverwriteMode_Force(false),
+ PathMode(NExtract::NPathMode::kFullPaths),
+ OverwriteMode(NExtract::NOverwriteMode::kAsk)
+ {}
+};
+
+struct CExtractOptions: public CExtractOptionsBase
+{
+ bool StdInMode;
+ bool StdOutMode;
+ bool YesToAll;
+ bool TestMode;
+
+ // bool ShowDialog;
+ // bool PasswordEnabled;
+ // UString Password;
+ #ifndef _SFX
+ CObjectVector<CProperty> Properties;
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ CCodecs *Codecs;
+ #endif
+
+ CExtractOptions():
+ TestMode(false),
+ StdInMode(false),
+ StdOutMode(false),
+ YesToAll(false)
+ {}
+};
+
+struct CDecompressStat
+{
+ UInt64 NumArchives;
+ UInt64 UnpackSize;
+ UInt64 AltStreams_UnpackSize;
+ UInt64 PackSize;
+ UInt64 NumFolders;
+ UInt64 NumFiles;
+ UInt64 NumAltStreams;
+
+ void Clear()
+ {
+ NumArchives = UnpackSize = AltStreams_UnpackSize = PackSize = NumFolders = NumFiles = NumAltStreams = 0;
+ }
+};
+
+HRESULT Extract(
+ CCodecs *codecs,
+ const CObjectVector<COpenType> &types,
+ const CIntVector &excludedFormats,
+ UStringVector &archivePaths, UStringVector &archivePathsFull,
+ const NWildcard::CCensorNode &wildcardCensor,
+ const CExtractOptions &options,
+ IOpenCallbackUI *openCallback,
+ IExtractCallbackUI *extractCallback,
+ #ifndef _SFX
+ IHashCalc *hash,
+ #endif
+ UString &errorMessage,
+ CDecompressStat &st);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractMode.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractMode.h
new file mode 100644
index 0000000000..c28b7ccfa7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractMode.h
@@ -0,0 +1,34 @@
+// ExtractMode.h
+
+#ifndef __EXTRACT_MODE_H
+#define __EXTRACT_MODE_H
+
+namespace NExtract {
+
+namespace NPathMode
+{
+ enum EEnum
+ {
+ kFullPaths,
+ kCurPaths,
+ kNoPaths,
+ kAbsPaths,
+ kNoPathsAlt // alt streams must be extracted without name of base file
+ };
+}
+
+namespace NOverwriteMode
+{
+ enum EEnum
+ {
+ kAsk,
+ kOverwrite,
+ kSkip,
+ kRename,
+ kRenameExisting
+ };
+}
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.cpp
new file mode 100644
index 0000000000..13665de579
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.cpp
@@ -0,0 +1,280 @@
+// ExtractingFilePath.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileName.h"
+
+#include "ExtractingFilePath.h"
+
+bool g_PathTrailReplaceMode =
+ #ifdef _WIN32
+ true
+ #else
+ false
+ #endif
+ ;
+
+
+static void ReplaceIncorrectChars(UString &s)
+{
+ {
+ for (unsigned i = 0; i < s.Len(); i++)
+ {
+ wchar_t c = s[i];
+ if (
+ #ifdef _WIN32
+ c == ':' || c == '*' || c == '?' || c < 0x20 || c == '<' || c == '>' || c == '|' || c == '"'
+ || c == '/'
+ // || c == 0x202E // RLO
+ ||
+ #endif
+ c == WCHAR_PATH_SEPARATOR)
+ s.ReplaceOneCharAtPos(i, '_');
+ }
+ }
+
+ if (g_PathTrailReplaceMode)
+ {
+ /*
+ // if (g_PathTrailReplaceMode == 1)
+ {
+ if (!s.IsEmpty())
+ {
+ wchar_t c = s.Back();
+ if (c == '.' || c == ' ')
+ {
+ // s += (wchar_t)(0x9c); // STRING TERMINATOR
+ s += (wchar_t)'_';
+ }
+ }
+ }
+ else
+ */
+ {
+ unsigned i;
+ for (i = s.Len(); i != 0;)
+ {
+ wchar_t c = s[i - 1];
+ if (c != '.' && c != ' ')
+ break;
+ i--;
+ s.ReplaceOneCharAtPos(i, '_');
+ // s.ReplaceOneCharAtPos(i, (c == ' ' ? (wchar_t)(0x2423) : (wchar_t)0x00B7));
+ }
+ /*
+ if (g_PathTrailReplaceMode > 1 && i != s.Len())
+ {
+ s.DeleteFrom(i);
+ }
+ */
+ }
+ }
+}
+
+#ifdef _WIN32
+
+/* WinXP-64 doesn't support ':', '\\' and '/' symbols in name of alt stream.
+ But colon in postfix ":$DATA" is allowed.
+ WIN32 functions don't allow empty alt stream name "name:" */
+
+void Correct_AltStream_Name(UString &s)
+{
+ unsigned len = s.Len();
+ const unsigned kPostfixSize = 6;
+ if (s.Len() >= kPostfixSize
+ && StringsAreEqualNoCase_Ascii(s.RightPtr(kPostfixSize), ":$DATA"))
+ len -= kPostfixSize;
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = s[i];
+ if (c == ':' || c == '\\' || c == '/'
+ || c == 0x202E // RLO
+ )
+ s.ReplaceOneCharAtPos(i, '_');
+ }
+ if (s.IsEmpty())
+ s = '_';
+}
+
+static const unsigned g_ReservedWithNum_Index = 4;
+
+static const char * const g_ReservedNames[] =
+{
+ "CON", "PRN", "AUX", "NUL",
+ "COM", "LPT"
+};
+
+static bool IsSupportedName(const UString &name)
+{
+ for (unsigned i = 0; i < ARRAY_SIZE(g_ReservedNames); i++)
+ {
+ const char *reservedName = g_ReservedNames[i];
+ unsigned len = MyStringLen(reservedName);
+ if (name.Len() < len)
+ continue;
+ if (!name.IsPrefixedBy_Ascii_NoCase(reservedName))
+ continue;
+ if (i >= g_ReservedWithNum_Index)
+ {
+ wchar_t c = name[len];
+ if (c < L'0' || c > L'9')
+ continue;
+ len++;
+ }
+ for (;;)
+ {
+ wchar_t c = name[len++];
+ if (c == 0 || c == '.')
+ return false;
+ if (c != ' ')
+ break;
+ }
+ }
+ return true;
+}
+
+static void CorrectUnsupportedName(UString &name)
+{
+ if (!IsSupportedName(name))
+ name.InsertAtFront(L'_');
+}
+
+#endif
+
+static void Correct_PathPart(UString &s)
+{
+ // "." and ".."
+ if (s.IsEmpty())
+ return;
+
+ if (s[0] == '.' && (s[1] == 0 || s[1] == '.' && s[2] == 0))
+ s.Empty();
+ #ifdef _WIN32
+ else
+ ReplaceIncorrectChars(s);
+ #endif
+}
+
+// static const char * const k_EmptyReplaceName = "[]";
+static const char k_EmptyReplaceName = '_';
+
+UString Get_Correct_FsFile_Name(const UString &name)
+{
+ UString res = name;
+ Correct_PathPart(res);
+
+ #ifdef _WIN32
+ CorrectUnsupportedName(res);
+ #endif
+
+ if (res.IsEmpty())
+ res = k_EmptyReplaceName;
+ return res;
+}
+
+
+void Correct_FsPath(bool absIsAllowed, bool keepAndReplaceEmptyPrefixes, UStringVector &parts, bool isDir)
+{
+ unsigned i = 0;
+
+ if (absIsAllowed)
+ {
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ bool isDrive = false;
+ #endif
+
+ if (parts[0].IsEmpty())
+ {
+ i = 1;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (parts.Size() > 1 && parts[1].IsEmpty())
+ {
+ i = 2;
+ if (parts.Size() > 2 && parts[2] == L"?")
+ {
+ i = 3;
+ if (parts.Size() > 3 && NWindows::NFile::NName::IsDrivePath2(parts[3]))
+ {
+ isDrive = true;
+ i = 4;
+ }
+ }
+ }
+ #endif
+ }
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ else if (NWindows::NFile::NName::IsDrivePath2(parts[0]))
+ {
+ isDrive = true;
+ i = 1;
+ }
+
+ if (isDrive)
+ {
+ // we convert "c:name" to "c:\name", if absIsAllowed path.
+ UString &ds = parts[i - 1];
+ if (ds.Len() > 2)
+ {
+ parts.Insert(i, ds.Ptr(2));
+ ds.DeleteFrom(2);
+ }
+ }
+ #endif
+ }
+
+ if (i != 0)
+ keepAndReplaceEmptyPrefixes = false;
+
+ for (; i < parts.Size();)
+ {
+ UString &s = parts[i];
+
+ Correct_PathPart(s);
+
+ if (s.IsEmpty())
+ {
+ if (!keepAndReplaceEmptyPrefixes)
+ if (isDir || i != parts.Size() - 1)
+ {
+ parts.Delete(i);
+ continue;
+ }
+ s = k_EmptyReplaceName;
+ }
+ else
+ {
+ keepAndReplaceEmptyPrefixes = false;
+ #ifdef _WIN32
+ CorrectUnsupportedName(s);
+ #endif
+ }
+
+ i++;
+ }
+
+ if (!isDir)
+ {
+ if (parts.IsEmpty())
+ parts.Add((UString)k_EmptyReplaceName);
+ else
+ {
+ UString &s = parts.Back();
+ if (s.IsEmpty())
+ s = k_EmptyReplaceName;
+ }
+ }
+}
+
+UString MakePathFromParts(const UStringVector &parts)
+{
+ UString s;
+ FOR_VECTOR (i, parts)
+ {
+ if (i != 0)
+ s.Add_PathSepar();
+ s += parts[i];
+ }
+ return s;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.h
new file mode 100644
index 0000000000..12eb0bad7f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ExtractingFilePath.h
@@ -0,0 +1,31 @@
+// ExtractingFilePath.h
+
+#ifndef __EXTRACTING_FILE_PATH_H
+#define __EXTRACTING_FILE_PATH_H
+
+#include "../../../Common/MyString.h"
+
+#ifdef _WIN32
+void Correct_AltStream_Name(UString &s);
+#endif
+
+// replaces unsuported characters, and replaces "." , ".." and "" to "[]"
+UString Get_Correct_FsFile_Name(const UString &name);
+
+/*
+ Correct_FsPath() corrects path parts to prepare it for File System operations.
+ It also corrects empty path parts like "\\\\":
+ - frontal empty path parts : it removes them or changes them to "_"
+ - another empty path parts : it removes them
+ if (absIsAllowed && path is absolute) : it removes empty path parts after start absolute path prefix marker
+ else
+ {
+ if (!keepAndReplaceEmptyPrefixes) : it removes empty path parts
+ if ( keepAndReplaceEmptyPrefixes) : it changes each empty frontal path part to "_"
+ }
+*/
+void Correct_FsPath(bool absIsAllowed, bool keepAndReplaceEmptyPrefixes, UStringVector &parts, bool isDir);
+
+UString MakePathFromParts(const UStringVector &parts);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.cpp
new file mode 100644
index 0000000000..9c0a1d0ae0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.cpp
@@ -0,0 +1,347 @@
+// HashCalc.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/Alloc.h"
+
+#include "../../../Common/StringToInt.h"
+
+#include "../../Common/FileStreams.h"
+#include "../../Common/StreamUtils.h"
+
+#include "EnumDirItems.h"
+#include "HashCalc.h"
+
+using namespace NWindows;
+
+class CHashMidBuf
+{
+ void *_data;
+public:
+ CHashMidBuf(): _data(0) {}
+ operator void *() { return _data; }
+ bool Alloc(size_t size)
+ {
+ if (_data != 0)
+ return false;
+ _data = ::MidAlloc(size);
+ return _data != 0;
+ }
+ ~CHashMidBuf() { ::MidFree(_data); }
+};
+
+static const char * const k_DefaultHashMethod = "CRC32";
+
+HRESULT CHashBundle::SetMethods(DECL_EXTERNAL_CODECS_LOC_VARS const UStringVector &hashMethods)
+{
+ UStringVector names = hashMethods;
+ if (names.IsEmpty())
+ names.Add(UString(k_DefaultHashMethod));
+
+ CRecordVector<CMethodId> ids;
+ CObjectVector<COneMethodInfo> methods;
+
+ unsigned i;
+ for (i = 0; i < names.Size(); i++)
+ {
+ COneMethodInfo m;
+ RINOK(m.ParseMethodFromString(names[i]));
+
+ if (m.MethodName.IsEmpty())
+ m.MethodName = k_DefaultHashMethod;
+
+ if (m.MethodName == "*")
+ {
+ CRecordVector<CMethodId> tempMethods;
+ GetHashMethods(EXTERNAL_CODECS_LOC_VARS tempMethods);
+ methods.Clear();
+ ids.Clear();
+ FOR_VECTOR (t, tempMethods)
+ {
+ unsigned index = ids.AddToUniqueSorted(tempMethods[t]);
+ if (ids.Size() != methods.Size())
+ methods.Insert(index, m);
+ }
+ break;
+ }
+ else
+ {
+ // m.MethodName.RemoveChar(L'-');
+ CMethodId id;
+ if (!FindHashMethod(EXTERNAL_CODECS_LOC_VARS m.MethodName, id))
+ return E_NOTIMPL;
+ unsigned index = ids.AddToUniqueSorted(id);
+ if (ids.Size() != methods.Size())
+ methods.Insert(index, m);
+ }
+ }
+
+ for (i = 0; i < ids.Size(); i++)
+ {
+ CMyComPtr<IHasher> hasher;
+ AString name;
+ RINOK(CreateHasher(EXTERNAL_CODECS_LOC_VARS ids[i], name, hasher));
+ if (!hasher)
+ throw "Can't create hasher";
+ const COneMethodInfo &m = methods[i];
+ {
+ CMyComPtr<ICompressSetCoderProperties> scp;
+ hasher.QueryInterface(IID_ICompressSetCoderProperties, &scp);
+ if (scp)
+ RINOK(m.SetCoderProps(scp, NULL));
+ }
+ UInt32 digestSize = hasher->GetDigestSize();
+ if (digestSize > k_HashCalc_DigestSize_Max)
+ return E_NOTIMPL;
+ CHasherState &h = Hashers.AddNew();
+ h.Hasher = hasher;
+ h.Name = name;
+ h.DigestSize = digestSize;
+ for (unsigned k = 0; k < k_HashCalc_NumGroups; k++)
+ memset(h.Digests[k], 0, digestSize);
+ }
+
+ return S_OK;
+}
+
+void CHashBundle::InitForNewFile()
+{
+ CurSize = 0;
+ FOR_VECTOR (i, Hashers)
+ {
+ CHasherState &h = Hashers[i];
+ h.Hasher->Init();
+ memset(h.Digests[k_HashCalc_Index_Current], 0, h.DigestSize);
+ }
+}
+
+void CHashBundle::Update(const void *data, UInt32 size)
+{
+ CurSize += size;
+ FOR_VECTOR (i, Hashers)
+ Hashers[i].Hasher->Update(data, size);
+}
+
+void CHashBundle::SetSize(UInt64 size)
+{
+ CurSize = size;
+}
+
+static void AddDigests(Byte *dest, const Byte *src, UInt32 size)
+{
+ unsigned next = 0;
+ for (UInt32 i = 0; i < size; i++)
+ {
+ next += (unsigned)dest[i] + (unsigned)src[i];
+ dest[i] = (Byte)next;
+ next >>= 8;
+ }
+}
+
+void CHashBundle::Final(bool isDir, bool isAltStream, const UString &path)
+{
+ if (isDir)
+ NumDirs++;
+ else if (isAltStream)
+ {
+ NumAltStreams++;
+ AltStreamsSize += CurSize;
+ }
+ else
+ {
+ NumFiles++;
+ FilesSize += CurSize;
+ }
+
+ Byte pre[16];
+ memset(pre, 0, sizeof(pre));
+ if (isDir)
+ pre[0] = 1;
+
+ FOR_VECTOR (i, Hashers)
+ {
+ CHasherState &h = Hashers[i];
+ if (!isDir)
+ {
+ h.Hasher->Final(h.Digests[0]);
+ if (!isAltStream)
+ AddDigests(h.Digests[k_HashCalc_Index_DataSum], h.Digests[0], h.DigestSize);
+ }
+
+ h.Hasher->Init();
+ h.Hasher->Update(pre, sizeof(pre));
+ h.Hasher->Update(h.Digests[0], h.DigestSize);
+
+ for (unsigned k = 0; k < path.Len(); k++)
+ {
+ wchar_t c = path[k];
+ Byte temp[2] = { (Byte)(c & 0xFF), (Byte)((c >> 8) & 0xFF) };
+ h.Hasher->Update(temp, 2);
+ }
+
+ Byte tempDigest[k_HashCalc_DigestSize_Max];
+ h.Hasher->Final(tempDigest);
+ if (!isAltStream)
+ AddDigests(h.Digests[k_HashCalc_Index_NamesSum], tempDigest, h.DigestSize);
+ AddDigests(h.Digests[k_HashCalc_Index_StreamsSum], tempDigest, h.DigestSize);
+ }
+}
+
+
+HRESULT HashCalc(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const NWildcard::CCensor &censor,
+ const CHashOptions &options,
+ AString &errorInfo,
+ IHashCallbackUI *callback)
+{
+ CDirItems dirItems;
+ dirItems.Callback = callback;
+
+ if (options.StdInMode)
+ {
+ CDirItem di;
+ di.Size = (UInt64)(Int64)-1;
+ di.Attrib = 0;
+ di.MTime.dwLowDateTime = 0;
+ di.MTime.dwHighDateTime = 0;
+ di.CTime = di.ATime = di.MTime;
+ dirItems.Items.Add(di);
+ }
+ else
+ {
+ RINOK(callback->StartScanning());
+ dirItems.ScanAltStreams = options.AltStreamsMode;
+
+ HRESULT res = EnumerateItems(censor,
+ options.PathMode,
+ UString(),
+ dirItems);
+
+ if (res != S_OK)
+ {
+ if (res != E_ABORT)
+ errorInfo = "Scanning error";
+ return res;
+ }
+ RINOK(callback->FinishScanning(dirItems.Stat));
+ }
+
+ unsigned i;
+ CHashBundle hb;
+ RINOK(hb.SetMethods(EXTERNAL_CODECS_LOC_VARS options.Methods));
+ hb.Init();
+
+ hb.NumErrors = dirItems.Stat.NumErrors;
+
+ if (options.StdInMode)
+ {
+ RINOK(callback->SetNumFiles(1));
+ }
+ else
+ {
+ RINOK(callback->SetTotal(dirItems.Stat.GetTotalBytes()));
+ }
+
+ const UInt32 kBufSize = 1 << 15;
+ CHashMidBuf buf;
+ if (!buf.Alloc(kBufSize))
+ return E_OUTOFMEMORY;
+
+ UInt64 completeValue = 0;
+
+ RINOK(callback->BeforeFirstFile(hb));
+
+ for (i = 0; i < dirItems.Items.Size(); i++)
+ {
+ CMyComPtr<ISequentialInStream> inStream;
+ UString path;
+ bool isDir = false;
+ bool isAltStream = false;
+ if (options.StdInMode)
+ {
+ inStream = new CStdInFileStream;
+ }
+ else
+ {
+ CInFileStream *inStreamSpec = new CInFileStream;
+ inStream = inStreamSpec;
+ const CDirItem &dirItem = dirItems.Items[i];
+ isDir = dirItem.IsDir();
+ isAltStream = dirItem.IsAltStream;
+ path = dirItems.GetLogPath(i);
+ if (!isDir)
+ {
+ FString phyPath = dirItems.GetPhyPath(i);
+ if (!inStreamSpec->OpenShared(phyPath, options.OpenShareForWrite))
+ {
+ HRESULT res = callback->OpenFileError(phyPath, ::GetLastError());
+ hb.NumErrors++;
+ if (res != S_FALSE)
+ return res;
+ continue;
+ }
+ }
+ }
+ RINOK(callback->GetStream(path, isDir));
+ UInt64 fileSize = 0;
+
+ hb.InitForNewFile();
+ if (!isDir)
+ {
+ for (UInt32 step = 0;; step++)
+ {
+ if ((step & 0xFF) == 0)
+ RINOK(callback->SetCompleted(&completeValue));
+ UInt32 size;
+ RINOK(inStream->Read(buf, kBufSize, &size));
+ if (size == 0)
+ break;
+ hb.Update(buf, size);
+ fileSize += size;
+ completeValue += size;
+ }
+ }
+ hb.Final(isDir, isAltStream, path);
+ RINOK(callback->SetOperationResult(fileSize, hb, !isDir));
+ RINOK(callback->SetCompleted(&completeValue));
+ }
+ return callback->AfterLastFile(hb);
+}
+
+
+static inline char GetHex(unsigned v)
+{
+ return (char)((v < 10) ? ('0' + v) : ('A' + (v - 10)));
+}
+
+void AddHashHexToString(char *dest, const Byte *data, UInt32 size)
+{
+ dest[size * 2] = 0;
+
+ if (!data)
+ {
+ for (UInt32 i = 0; i < size; i++)
+ {
+ dest[0] = ' ';
+ dest[1] = ' ';
+ dest += 2;
+ }
+ return;
+ }
+
+ int step = 2;
+ if (size <= 8)
+ {
+ step = -2;
+ dest += size * 2 - 2;
+ }
+
+ for (UInt32 i = 0; i < size; i++)
+ {
+ unsigned b = data[i];
+ dest[0] = GetHex((b >> 4) & 0xF);
+ dest[1] = GetHex(b & 0xF);
+ dest += step;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.h
new file mode 100644
index 0000000000..77373b8534
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/HashCalc.h
@@ -0,0 +1,106 @@
+// HashCalc.h
+
+#ifndef __HASH_CALC_H
+#define __HASH_CALC_H
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../Common/CreateCoder.h"
+#include "../../Common/MethodProps.h"
+
+#include "DirItem.h"
+
+const unsigned k_HashCalc_DigestSize_Max = 64;
+
+const unsigned k_HashCalc_NumGroups = 4;
+
+enum
+{
+ k_HashCalc_Index_Current,
+ k_HashCalc_Index_DataSum,
+ k_HashCalc_Index_NamesSum,
+ k_HashCalc_Index_StreamsSum
+};
+
+struct CHasherState
+{
+ CMyComPtr<IHasher> Hasher;
+ AString Name;
+ UInt32 DigestSize;
+ Byte Digests[k_HashCalc_NumGroups][k_HashCalc_DigestSize_Max];
+};
+
+struct IHashCalc
+{
+ virtual void InitForNewFile() = 0;
+ virtual void Update(const void *data, UInt32 size) = 0;
+ virtual void SetSize(UInt64 size) = 0;
+ virtual void Final(bool isDir, bool isAltStream, const UString &path) = 0;
+};
+
+struct CHashBundle: public IHashCalc
+{
+ CObjectVector<CHasherState> Hashers;
+
+ UInt64 NumDirs;
+ UInt64 NumFiles;
+ UInt64 NumAltStreams;
+ UInt64 FilesSize;
+ UInt64 AltStreamsSize;
+ UInt64 NumErrors;
+
+ UInt64 CurSize;
+
+ HRESULT SetMethods(DECL_EXTERNAL_CODECS_LOC_VARS const UStringVector &methods);
+
+ void Init()
+ {
+ NumDirs = NumFiles = NumAltStreams = FilesSize = AltStreamsSize = NumErrors = 0;
+ }
+
+ void InitForNewFile();
+ void Update(const void *data, UInt32 size);
+ void SetSize(UInt64 size);
+ void Final(bool isDir, bool isAltStream, const UString &path);
+};
+
+#define INTERFACE_IHashCallbackUI(x) \
+ INTERFACE_IDirItemsCallback(x) \
+ virtual HRESULT StartScanning() x; \
+ virtual HRESULT FinishScanning(const CDirItemsStat &st) x; \
+ virtual HRESULT SetNumFiles(UInt64 numFiles) x; \
+ virtual HRESULT SetTotal(UInt64 size) x; \
+ virtual HRESULT SetCompleted(const UInt64 *completeValue) x; \
+ virtual HRESULT CheckBreak() x; \
+ virtual HRESULT BeforeFirstFile(const CHashBundle &hb) x; \
+ virtual HRESULT GetStream(const wchar_t *name, bool isFolder) x; \
+ virtual HRESULT OpenFileError(const FString &path, DWORD systemError) x; \
+ virtual HRESULT SetOperationResult(UInt64 fileSize, const CHashBundle &hb, bool showHash) x; \
+ virtual HRESULT AfterLastFile(const CHashBundle &hb) x; \
+
+struct IHashCallbackUI: public IDirItemsCallback
+{
+ INTERFACE_IHashCallbackUI(=0)
+};
+
+struct CHashOptions
+{
+ UStringVector Methods;
+ bool OpenShareForWrite;
+ bool StdInMode;
+ bool AltStreamsMode;
+ NWildcard::ECensorPathMode PathMode;
+
+ CHashOptions(): StdInMode(false), OpenShareForWrite(false), AltStreamsMode(false), PathMode(NWildcard::k_RelatPath) {};
+};
+
+HRESULT HashCalc(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const NWildcard::CCensor &censor,
+ const CHashOptions &options,
+ AString &errorInfo,
+ IHashCallbackUI *callback);
+
+void AddHashHexToString(char *dest, const Byte *data, UInt32 size);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/IFileExtractCallback.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/IFileExtractCallback.h
new file mode 100644
index 0000000000..3f554ef31d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/IFileExtractCallback.h
@@ -0,0 +1,114 @@
+// IFileExtractCallback.h
+
+#ifndef __I_FILE_EXTRACT_CALLBACK_H
+#define __I_FILE_EXTRACT_CALLBACK_H
+
+#include "../../../Common/MyString.h"
+
+#include "../../IDecl.h"
+
+#include "LoadCodecs.h"
+#include "OpenArchive.h"
+
+namespace NOverwriteAnswer
+{
+ enum EEnum
+ {
+ kYes,
+ kYesToAll,
+ kNo,
+ kNoToAll,
+ kAutoRename,
+ kCancel
+ };
+}
+
+
+/* ---------- IFolderArchiveExtractCallback ----------
+is implemented by
+ Console/ExtractCallbackConsole.h CExtractCallbackConsole
+ FileManager/ExtractCallback.h CExtractCallbackImp
+ FAR/ExtractEngine.cpp CExtractCallBackImp: (QueryInterface is not supported)
+
+IID_IFolderArchiveExtractCallback is requested by:
+ - Agent/ArchiveFolder.cpp
+ CAgentFolder::CopyTo(..., IFolderOperationsExtractCallback *callback)
+ is sent to IArchiveFolder::Extract()
+
+ - FileManager/PanelCopy.cpp
+ CPanel::CopyTo(), if (options->testMode)
+ is sent to IArchiveFolder::Extract()
+
+ IFolderArchiveExtractCallback is used by Common/ArchiveExtractCallback.cpp
+*/
+
+#define INTERFACE_IFolderArchiveExtractCallback(x) \
+ STDMETHOD(AskOverwrite)( \
+ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize, \
+ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize, \
+ Int32 *answer) x; \
+ STDMETHOD(PrepareOperation)(const wchar_t *name, Int32 isFolder, Int32 askExtractMode, const UInt64 *position) x; \
+ STDMETHOD(MessageError)(const wchar_t *message) x; \
+ STDMETHOD(SetOperationResult)(Int32 opRes, Int32 encrypted) x; \
+
+DECL_INTERFACE_SUB(IFolderArchiveExtractCallback, IProgress, 0x01, 0x07)
+{
+ INTERFACE_IFolderArchiveExtractCallback(PURE)
+};
+
+#define INTERFACE_IFolderArchiveExtractCallback2(x) \
+ STDMETHOD(ReportExtractResult)(Int32 opRes, Int32 encrypted, const wchar_t *name) x; \
+
+DECL_INTERFACE_SUB(IFolderArchiveExtractCallback2, IUnknown, 0x01, 0x08)
+{
+ INTERFACE_IFolderArchiveExtractCallback2(PURE)
+};
+
+/* ---------- IExtractCallbackUI ----------
+is implemented by
+ Console/ExtractCallbackConsole.h CExtractCallbackConsole
+ FileManager/ExtractCallback.h CExtractCallbackImp
+*/
+
+#ifdef _NO_CRYPTO
+ #define INTERFACE_IExtractCallbackUI_Crypto(x)
+#else
+ #define INTERFACE_IExtractCallbackUI_Crypto(x) \
+ virtual HRESULT SetPassword(const UString &password) x;
+#endif
+
+#define INTERFACE_IExtractCallbackUI(x) \
+ virtual HRESULT BeforeOpen(const wchar_t *name, bool testMode) x; \
+ virtual HRESULT OpenResult(const CCodecs *codecs, const CArchiveLink &arcLink, const wchar_t *name, HRESULT result) x; \
+ virtual HRESULT ThereAreNoFiles() x; \
+ virtual HRESULT ExtractResult(HRESULT result) x; \
+ INTERFACE_IExtractCallbackUI_Crypto(x)
+
+struct IExtractCallbackUI: IFolderArchiveExtractCallback
+{
+ INTERFACE_IExtractCallbackUI(PURE)
+};
+
+
+
+#define INTERFACE_IGetProp(x) \
+ STDMETHOD(GetProp)(PROPID propID, PROPVARIANT *value) x; \
+
+DECL_INTERFACE_SUB(IGetProp, IUnknown, 0x01, 0x20)
+{
+ INTERFACE_IGetProp(PURE)
+};
+
+#define INTERFACE_IFolderExtractToStreamCallback(x) \
+ STDMETHOD(UseExtractToStream)(Int32 *res) x; \
+ STDMETHOD(GetStream7)(const wchar_t *name, Int32 isDir, ISequentialOutStream **outStream, Int32 askExtractMode, IGetProp *getProp) x; \
+ STDMETHOD(PrepareOperation7)(Int32 askExtractMode) x; \
+ STDMETHOD(SetOperationResult7)(Int32 resultEOperationResult, Int32 encrypted) x; \
+
+DECL_INTERFACE_SUB(IFolderExtractToStreamCallback, IUnknown, 0x01, 0x30)
+{
+ INTERFACE_IFolderExtractToStreamCallback(PURE)
+};
+
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.cpp
new file mode 100644
index 0000000000..d31e05f196
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.cpp
@@ -0,0 +1,1074 @@
+// LoadCodecs.cpp
+
+/*
+EXTERNAL_CODECS
+---------------
+ CCodecs::Load() tries to detect the directory with plugins.
+ It stops the checking, if it can find any of the following items:
+ - 7z.dll file
+ - "Formats" subdir
+ - "Codecs" subdir
+ The order of check:
+ 1) directory of client executable
+ 2) WIN32: directory for REGISTRY item [HKEY_*\Software\7-Zip\Path**]
+ The order for HKEY_* : Path** :
+ - HKEY_CURRENT_USER : PathXX
+ - HKEY_LOCAL_MACHINE : PathXX
+ - HKEY_CURRENT_USER : Path
+ - HKEY_LOCAL_MACHINE : Path
+ PathXX is Path32 in 32-bit code
+ PathXX is Path64 in 64-bit code
+
+
+EXPORT_CODECS
+-------------
+ if (EXTERNAL_CODECS) is defined, then the code exports internal
+ codecs of client from CCodecs object to external plugins.
+ 7-Zip doesn't use that feature. 7-Zip uses the scheme:
+ - client application without internal plugins.
+ - 7z.dll module contains all (or almost all) plugins.
+ 7z.dll can use codecs from another plugins, if required.
+*/
+
+
+#include "StdAfx.h"
+
+#include "../../../../C/7zVersion.h"
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/StringToInt.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/PropVariant.h"
+
+#include "LoadCodecs.h"
+
+using namespace NWindows;
+
+#ifdef NEW_FOLDER_INTERFACE
+#include "../../../Common/StringToInt.h"
+#endif
+
+#include "../../ICoder.h"
+#include "../../Common/RegisterArc.h"
+
+#ifdef EXTERNAL_CODECS
+
+// #define EXPORT_CODECS
+
+#endif
+
+#ifdef NEW_FOLDER_INTERFACE
+extern HINSTANCE g_hInstance;
+#include "../../../Windows/ResourceString.h"
+static const UINT kIconTypesResId = 100;
+#endif
+
+#ifdef EXTERNAL_CODECS
+
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/DLL.h"
+
+#ifdef _WIN32
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/Registry.h"
+#endif
+
+using namespace NFile;
+
+
+#define kCodecsFolderName FTEXT("Codecs")
+#define kFormatsFolderName FTEXT("Formats")
+
+
+static CFSTR const kMainDll =
+ // #ifdef _WIN32
+ FTEXT("7z.dll");
+ // #else
+ // FTEXT("7z.so");
+ // #endif
+
+
+#ifdef _WIN32
+
+static LPCTSTR const kRegistryPath = TEXT("Software") TEXT(STRING_PATH_SEPARATOR) TEXT("7-zip");
+static LPCWSTR const kProgramPathValue = L"Path";
+static LPCWSTR const kProgramPath2Value = L"Path"
+ #ifdef _WIN64
+ L"64";
+ #else
+ L"32";
+ #endif
+
+static bool ReadPathFromRegistry(HKEY baseKey, LPCWSTR value, FString &path)
+{
+ NRegistry::CKey key;
+ if (key.Open(baseKey, kRegistryPath, KEY_READ) == ERROR_SUCCESS)
+ {
+ UString pathU;
+ if (key.QueryValue(value, pathU) == ERROR_SUCCESS)
+ {
+ path = us2fs(pathU);
+ NName::NormalizeDirPathPrefix(path);
+ return NFind::DoesFileExist(path + kMainDll);
+ }
+ }
+ return false;
+}
+
+#endif // _WIN32
+
+#endif // EXTERNAL_CODECS
+
+
+static const unsigned kNumArcsMax = 64;
+static unsigned g_NumArcs = 0;
+static const CArcInfo *g_Arcs[kNumArcsMax];
+
+void RegisterArc(const CArcInfo *arcInfo) throw()
+{
+ if (g_NumArcs < kNumArcsMax)
+ {
+ g_Arcs[g_NumArcs] = arcInfo;
+ g_NumArcs++;
+ }
+}
+
+static void SplitString(const UString &srcString, UStringVector &destStrings)
+{
+ destStrings.Clear();
+ UString s;
+ unsigned len = srcString.Len();
+ if (len == 0)
+ return;
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = srcString[i];
+ if (c == L' ')
+ {
+ if (!s.IsEmpty())
+ {
+ destStrings.Add(s);
+ s.Empty();
+ }
+ }
+ else
+ s += c;
+ }
+ if (!s.IsEmpty())
+ destStrings.Add(s);
+}
+
+int CArcInfoEx::FindExtension(const UString &ext) const
+{
+ FOR_VECTOR (i, Exts)
+ if (ext.IsEqualTo_NoCase(Exts[i].Ext))
+ return i;
+ return -1;
+}
+
+void CArcInfoEx::AddExts(const UString &ext, const UString &addExt)
+{
+ UStringVector exts, addExts;
+ SplitString(ext, exts);
+ SplitString(addExt, addExts);
+ FOR_VECTOR (i, exts)
+ {
+ CArcExtInfo extInfo;
+ extInfo.Ext = exts[i];
+ if (i < addExts.Size())
+ {
+ extInfo.AddExt = addExts[i];
+ if (extInfo.AddExt == L"*")
+ extInfo.AddExt.Empty();
+ }
+ Exts.Add(extInfo);
+ }
+}
+
+#ifndef _SFX
+
+static bool ParseSignatures(const Byte *data, unsigned size, CObjectVector<CByteBuffer> &signatures)
+{
+ signatures.Clear();
+ while (size > 0)
+ {
+ unsigned len = *data++;
+ size--;
+ if (len > size)
+ return false;
+ signatures.AddNew().CopyFrom(data, len);
+ data += len;
+ size -= len;
+ }
+ return true;
+}
+
+#endif // _SFX
+
+#ifdef EXTERNAL_CODECS
+
+static FString GetBaseFolderPrefixFromRegistry()
+{
+ FString moduleFolderPrefix = NDLL::GetModuleDirPrefix();
+ #ifdef _WIN32
+ if (!NFind::DoesFileExist(moduleFolderPrefix + kMainDll) &&
+ !NFind::DoesDirExist(moduleFolderPrefix + kCodecsFolderName) &&
+ !NFind::DoesDirExist(moduleFolderPrefix + kFormatsFolderName))
+ {
+ FString path;
+ if (ReadPathFromRegistry(HKEY_CURRENT_USER, kProgramPath2Value, path)) return path;
+ if (ReadPathFromRegistry(HKEY_LOCAL_MACHINE, kProgramPath2Value, path)) return path;
+ if (ReadPathFromRegistry(HKEY_CURRENT_USER, kProgramPathValue, path)) return path;
+ if (ReadPathFromRegistry(HKEY_LOCAL_MACHINE, kProgramPathValue, path)) return path;
+ }
+ #endif
+ return moduleFolderPrefix;
+}
+
+
+static HRESULT GetCoderClass(Func_GetMethodProperty getMethodProperty, UInt32 index,
+ PROPID propId, CLSID &clsId, bool &isAssigned)
+{
+ NCOM::CPropVariant prop;
+ isAssigned = false;
+ RINOK(getMethodProperty(index, propId, &prop));
+ if (prop.vt == VT_BSTR)
+ {
+ if (::SysStringByteLen(prop.bstrVal) != sizeof(GUID))
+ return E_FAIL;
+ isAssigned = true;
+ clsId = *(const GUID *)prop.bstrVal;
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+HRESULT CCodecs::LoadCodecs()
+{
+ CCodecLib &lib = Libs.Back();
+
+ lib.CreateDecoder = (Func_CreateDecoder)lib.Lib.GetProc("CreateDecoder");
+ lib.CreateEncoder = (Func_CreateEncoder)lib.Lib.GetProc("CreateEncoder");
+ lib.GetMethodProperty = (Func_GetMethodProperty)lib.Lib.GetProc("GetMethodProperty");
+
+ if (lib.GetMethodProperty)
+ {
+ UInt32 numMethods = 1;
+ Func_GetNumberOfMethods getNumberOfMethods = (Func_GetNumberOfMethods)lib.Lib.GetProc("GetNumberOfMethods");
+ if (getNumberOfMethods)
+ {
+ RINOK(getNumberOfMethods(&numMethods));
+ }
+ for (UInt32 i = 0; i < numMethods; i++)
+ {
+ CDllCodecInfo info;
+ info.LibIndex = Libs.Size() - 1;
+ info.CodecIndex = i;
+ RINOK(GetCoderClass(lib.GetMethodProperty, i, NMethodPropID::kEncoder, info.Encoder, info.EncoderIsAssigned));
+ RINOK(GetCoderClass(lib.GetMethodProperty, i, NMethodPropID::kDecoder, info.Decoder, info.DecoderIsAssigned));
+ Codecs.Add(info);
+ }
+ }
+
+ Func_GetHashers getHashers = (Func_GetHashers)lib.Lib.GetProc("GetHashers");
+ if (getHashers)
+ {
+ RINOK(getHashers(&lib.ComHashers));
+ if (lib.ComHashers)
+ {
+ UInt32 numMethods = lib.ComHashers->GetNumHashers();
+ for (UInt32 i = 0; i < numMethods; i++)
+ {
+ CDllHasherInfo info;
+ info.LibIndex = Libs.Size() - 1;
+ info.HasherIndex = i;
+ Hashers.Add(info);
+ }
+ }
+ }
+
+ return S_OK;
+}
+
+static HRESULT GetProp(
+ Func_GetHandlerProperty getProp,
+ Func_GetHandlerProperty2 getProp2,
+ UInt32 index, PROPID propID, NCOM::CPropVariant &prop)
+{
+ if (getProp2)
+ return getProp2(index, propID, &prop);;
+ return getProp(propID, &prop);
+}
+
+static HRESULT GetProp_Bool(
+ Func_GetHandlerProperty getProp,
+ Func_GetHandlerProperty2 getProp2,
+ UInt32 index, PROPID propID, bool &res)
+{
+ res = false;
+ NCOM::CPropVariant prop;
+ RINOK(GetProp(getProp, getProp2, index, propID, prop));
+ if (prop.vt == VT_BOOL)
+ res = VARIANT_BOOLToBool(prop.boolVal);
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+static HRESULT GetProp_UInt32(
+ Func_GetHandlerProperty getProp,
+ Func_GetHandlerProperty2 getProp2,
+ UInt32 index, PROPID propID, UInt32 &res, bool &defined)
+{
+ res = 0;
+ defined = false;
+ NCOM::CPropVariant prop;
+ RINOK(GetProp(getProp, getProp2, index, propID, prop));
+ if (prop.vt == VT_UI4)
+ {
+ res = prop.ulVal;
+ defined = true;
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+static HRESULT GetProp_String(
+ Func_GetHandlerProperty getProp,
+ Func_GetHandlerProperty2 getProp2,
+ UInt32 index, PROPID propID, UString &res)
+{
+ res.Empty();
+ NCOM::CPropVariant prop;
+ RINOK(GetProp(getProp, getProp2, index, propID, prop));
+ if (prop.vt == VT_BSTR)
+ res.SetFromBstr(prop.bstrVal);
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+static HRESULT GetProp_RawData(
+ Func_GetHandlerProperty getProp,
+ Func_GetHandlerProperty2 getProp2,
+ UInt32 index, PROPID propID, CByteBuffer &bb)
+{
+ bb.Free();
+ NCOM::CPropVariant prop;
+ RINOK(GetProp(getProp, getProp2, index, propID, prop));
+ if (prop.vt == VT_BSTR)
+ {
+ UINT len = ::SysStringByteLen(prop.bstrVal);
+ bb.CopyFrom((const Byte *)prop.bstrVal, len);
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+static const UInt32 kArcFlagsPars[] =
+{
+ NArchive::NHandlerPropID::kKeepName, NArcInfoFlags::kKeepName,
+ NArchive::NHandlerPropID::kAltStreams, NArcInfoFlags::kAltStreams,
+ NArchive::NHandlerPropID::kNtSecure, NArcInfoFlags::kNtSecure
+};
+
+HRESULT CCodecs::LoadFormats()
+{
+ const NDLL::CLibrary &lib = Libs.Back().Lib;
+
+ Func_GetHandlerProperty getProp = NULL;
+ Func_GetHandlerProperty2 getProp2 = (Func_GetHandlerProperty2)lib.GetProc("GetHandlerProperty2");
+ Func_GetIsArc getIsArc = (Func_GetIsArc)lib.GetProc("GetIsArc");
+
+ UInt32 numFormats = 1;
+
+ if (getProp2)
+ {
+ Func_GetNumberOfFormats getNumberOfFormats = (Func_GetNumberOfFormats)lib.GetProc("GetNumberOfFormats");
+ if (getNumberOfFormats)
+ {
+ RINOK(getNumberOfFormats(&numFormats));
+ }
+ }
+ else
+ {
+ getProp = (Func_GetHandlerProperty)lib.GetProc("GetHandlerProperty");
+ if (!getProp)
+ return S_OK;
+ }
+
+ for (UInt32 i = 0; i < numFormats; i++)
+ {
+ CArcInfoEx item;
+ item.LibIndex = Libs.Size() - 1;
+ item.FormatIndex = i;
+
+ RINOK(GetProp_String(getProp, getProp2, i, NArchive::NHandlerPropID::kName, item.Name));
+
+ {
+ NCOM::CPropVariant prop;
+ if (GetProp(getProp, getProp2, i, NArchive::NHandlerPropID::kClassID, prop) != S_OK)
+ continue;
+ if (prop.vt != VT_BSTR)
+ continue;
+ if (::SysStringByteLen(prop.bstrVal) != sizeof(GUID))
+ return E_FAIL;
+ item.ClassID = *(const GUID *)prop.bstrVal;
+ prop.Clear();
+ }
+
+ UString ext, addExt;
+ RINOK(GetProp_String(getProp, getProp2, i, NArchive::NHandlerPropID::kExtension, ext));
+ RINOK(GetProp_String(getProp, getProp2, i, NArchive::NHandlerPropID::kAddExtension, addExt));
+ item.AddExts(ext, addExt);
+
+ GetProp_Bool(getProp, getProp2, i, NArchive::NHandlerPropID::kUpdate, item.UpdateEnabled);
+ bool flags_Defined = false;
+ RINOK(GetProp_UInt32(getProp, getProp2, i, NArchive::NHandlerPropID::kFlags, item.Flags, flags_Defined));
+ item.NewInterface = flags_Defined;
+ if (!flags_Defined) // && item.UpdateEnabled
+ {
+ // support for DLL version before 9.31:
+ for (unsigned j = 0; j < ARRAY_SIZE(kArcFlagsPars); j += 2)
+ {
+ bool val = false;
+ GetProp_Bool(getProp, getProp2, i, kArcFlagsPars[j], val);
+ if (val)
+ item.Flags |= kArcFlagsPars[j + 1];
+ }
+ }
+
+ CByteBuffer sig;
+ RINOK(GetProp_RawData(getProp, getProp2, i, NArchive::NHandlerPropID::kSignature, sig));
+ if (sig.Size() != 0)
+ item.Signatures.Add(sig);
+ else
+ {
+ RINOK(GetProp_RawData(getProp, getProp2, i, NArchive::NHandlerPropID::kMultiSignature, sig));
+ ParseSignatures(sig, (unsigned)sig.Size(), item.Signatures);
+ }
+
+ bool signatureOffset_Defined;
+ RINOK(GetProp_UInt32(getProp, getProp2, i, NArchive::NHandlerPropID::kSignatureOffset, item.SignatureOffset, signatureOffset_Defined));
+
+ // bool version_Defined;
+ // RINOK(GetProp_UInt32(getProp, getProp2, i, NArchive::NHandlerPropID::kVersion, item.Version, version_Defined));
+
+ if (getIsArc)
+ getIsArc(i, &item.IsArcFunc);
+
+ Formats.Add(item);
+ }
+ return S_OK;
+}
+
+#ifdef _7ZIP_LARGE_PAGES
+extern "C"
+{
+ extern SIZE_T g_LargePageSize;
+}
+#endif
+
+HRESULT CCodecs::LoadDll(const FString &dllPath, bool needCheckDll, bool *loadedOK)
+{
+ if (loadedOK)
+ *loadedOK = false;
+
+ if (needCheckDll)
+ {
+ NDLL::CLibrary lib;
+ if (!lib.LoadEx(dllPath, LOAD_LIBRARY_AS_DATAFILE))
+ return S_OK;
+ }
+
+ Libs.AddNew();
+ CCodecLib &lib = Libs.Back();
+ lib.Path = dllPath;
+ bool used = false;
+ HRESULT res = S_OK;
+
+ if (lib.Lib.Load(dllPath))
+ {
+ if (loadedOK)
+ *loadedOK = true;
+ #ifdef NEW_FOLDER_INTERFACE
+ lib.LoadIcons();
+ #endif
+
+ #ifdef _7ZIP_LARGE_PAGES
+ if (g_LargePageSize != 0)
+ {
+ Func_SetLargePageMode setLargePageMode = (Func_SetLargePageMode)lib.Lib.GetProc("SetLargePageMode");
+ if (setLargePageMode)
+ setLargePageMode();
+ }
+ #endif
+
+ if (CaseSensitiveChange)
+ {
+ Func_SetCaseSensitive setCaseSensitive = (Func_SetCaseSensitive)lib.Lib.GetProc("SetCaseSensitive");
+ if (setCaseSensitive)
+ setCaseSensitive(CaseSensitive ? 1 : 0);
+ }
+
+ lib.CreateObject = (Func_CreateObject)lib.Lib.GetProc("CreateObject");
+ {
+ unsigned startSize = Codecs.Size() + Hashers.Size();
+ res = LoadCodecs();
+ used = (startSize != Codecs.Size() + Hashers.Size());
+ if (res == S_OK && lib.CreateObject)
+ {
+ startSize = Formats.Size();
+ res = LoadFormats();
+ if (startSize != Formats.Size())
+ used = true;
+ }
+ }
+ }
+
+ if (!used)
+ Libs.DeleteBack();
+
+ return res;
+}
+
+HRESULT CCodecs::LoadDllsFromFolder(const FString &folderPrefix)
+{
+ NFile::NFind::CEnumerator enumerator;
+ enumerator.SetDirPrefix(folderPrefix);
+ NFile::NFind::CFileInfo fi;
+ while (enumerator.Next(fi))
+ {
+ if (fi.IsDir())
+ continue;
+ RINOK(LoadDll(folderPrefix + fi.Name, true));
+ }
+ return S_OK;
+}
+
+void CCodecs::CloseLibs()
+{
+ // OutputDebugStringA("~CloseLibs start");
+ /*
+ WIN32: FreeLibrary() (CLibrary::Free()) function doesn't work as expected,
+ if it's called from another FreeLibrary() call.
+ So we need to call FreeLibrary() before global destructors.
+
+ Also we free global links from DLLs to object of this module before CLibrary::Free() call.
+ */
+
+ FOR_VECTOR(i, Libs)
+ {
+ const CCodecLib &lib = Libs[i];
+ if (lib.SetCodecs)
+ lib.SetCodecs(NULL);
+ }
+
+ // OutputDebugStringA("~CloseLibs after SetCodecs");
+ Libs.Clear();
+ // OutputDebugStringA("~CloseLibs end");
+}
+
+#endif // EXTERNAL_CODECS
+
+
+HRESULT CCodecs::Load()
+{
+ #ifdef NEW_FOLDER_INTERFACE
+ InternalIcons.LoadIcons(g_hInstance);
+ #endif
+
+ Formats.Clear();
+
+ #ifdef EXTERNAL_CODECS
+ MainDll_ErrorPath.Empty();
+ Codecs.Clear();
+ Hashers.Clear();
+ #endif
+
+ for (UInt32 i = 0; i < g_NumArcs; i++)
+ {
+ const CArcInfo &arc = *g_Arcs[i];
+ CArcInfoEx item;
+
+ item.Name = arc.Name;
+ item.CreateInArchive = arc.CreateInArchive;
+ item.IsArcFunc = arc.IsArc;
+ item.Flags = arc.Flags;
+
+ {
+ UString e, ae;
+ if (arc.Ext)
+ e = arc.Ext;
+ if (arc.AddExt)
+ ae = arc.AddExt;
+ item.AddExts(e, ae);
+ }
+
+ #ifndef _SFX
+
+ item.CreateOutArchive = arc.CreateOutArchive;
+ item.UpdateEnabled = (arc.CreateOutArchive != NULL);
+ item.SignatureOffset = arc.SignatureOffset;
+ // item.Version = MY_VER_MIX;
+ item.NewInterface = true;
+
+ if (arc.IsMultiSignature())
+ ParseSignatures(arc.Signature, arc.SignatureSize, item.Signatures);
+ else
+ item.Signatures.AddNew().CopyFrom(arc.Signature, arc.SignatureSize);
+
+ #endif
+
+ Formats.Add(item);
+ }
+
+ #ifdef EXTERNAL_CODECS
+ const FString baseFolder = GetBaseFolderPrefixFromRegistry();
+ {
+ bool loadedOK;
+ RINOK(LoadDll(baseFolder + kMainDll, false, &loadedOK));
+ if (!loadedOK)
+ MainDll_ErrorPath = kMainDll;
+ }
+ RINOK(LoadDllsFromFolder(baseFolder + kCodecsFolderName FSTRING_PATH_SEPARATOR));
+ RINOK(LoadDllsFromFolder(baseFolder + kFormatsFolderName FSTRING_PATH_SEPARATOR));
+
+ NeedSetLibCodecs = true;
+
+ if (Libs.Size() == 0)
+ NeedSetLibCodecs = false;
+ else if (Libs.Size() == 1)
+ {
+ // we don't need to set ISetCompressCodecsInfo, if all arcs and codecs are in one external module.
+ #ifndef EXPORT_CODECS
+ if (g_NumArcs == 0)
+ NeedSetLibCodecs = false;
+ #endif
+ }
+
+ if (NeedSetLibCodecs)
+ {
+ /* 15.00: now we call global function in DLL: SetCompressCodecsInfo(c)
+ old versions called only ISetCompressCodecsInfo::SetCompressCodecsInfo(c) for each archive handler */
+
+ FOR_VECTOR(i, Libs)
+ {
+ CCodecLib &lib = Libs[i];
+ lib.SetCodecs = (Func_SetCodecs)lib.Lib.GetProc("SetCodecs");
+ if (lib.SetCodecs)
+ {
+ RINOK(lib.SetCodecs(this));
+ }
+ }
+ }
+
+ #endif
+
+ return S_OK;
+}
+
+#ifndef _SFX
+
+int CCodecs::FindFormatForArchiveName(const UString &arcPath) const
+{
+ int dotPos = arcPath.ReverseFind_Dot();
+ if (dotPos <= arcPath.ReverseFind_PathSepar())
+ return -1;
+ const UString ext = arcPath.Ptr(dotPos + 1);
+ if (ext.IsEmpty())
+ return -1;
+ if (ext.IsEqualTo_Ascii_NoCase("exe"))
+ return -1;
+ FOR_VECTOR (i, Formats)
+ {
+ const CArcInfoEx &arc = Formats[i];
+ /*
+ if (!arc.UpdateEnabled)
+ continue;
+ */
+ if (arc.FindExtension(ext) >= 0)
+ return i;
+ }
+ return -1;
+}
+
+int CCodecs::FindFormatForExtension(const UString &ext) const
+{
+ if (ext.IsEmpty())
+ return -1;
+ FOR_VECTOR (i, Formats)
+ if (Formats[i].FindExtension(ext) >= 0)
+ return i;
+ return -1;
+}
+
+int CCodecs::FindFormatForArchiveType(const UString &arcType) const
+{
+ FOR_VECTOR (i, Formats)
+ if (Formats[i].Name.IsEqualTo_NoCase(arcType))
+ return i;
+ return -1;
+}
+
+bool CCodecs::FindFormatForArchiveType(const UString &arcType, CIntVector &formatIndices) const
+{
+ formatIndices.Clear();
+ for (unsigned pos = 0; pos < arcType.Len();)
+ {
+ int pos2 = arcType.Find(L'.', pos);
+ if (pos2 < 0)
+ pos2 = arcType.Len();
+ const UString name = arcType.Mid(pos, pos2 - pos);
+ if (name.IsEmpty())
+ return false;
+ int index = FindFormatForArchiveType(name);
+ if (index < 0 && name != L"*")
+ {
+ formatIndices.Clear();
+ return false;
+ }
+ formatIndices.Add(index);
+ pos = pos2 + 1;
+ }
+ return true;
+}
+
+#endif // _SFX
+
+
+#ifdef NEW_FOLDER_INTERFACE
+
+void CCodecIcons::LoadIcons(HMODULE m)
+{
+ UString iconTypes;
+ MyLoadString(m, kIconTypesResId, iconTypes);
+ UStringVector pairs;
+ SplitString(iconTypes, pairs);
+ FOR_VECTOR (i, pairs)
+ {
+ const UString &s = pairs[i];
+ int pos = s.Find(L':');
+ CIconPair iconPair;
+ iconPair.IconIndex = -1;
+ if (pos < 0)
+ pos = s.Len();
+ else
+ {
+ UString num = s.Ptr(pos + 1);
+ if (!num.IsEmpty())
+ {
+ const wchar_t *end;
+ iconPair.IconIndex = ConvertStringToUInt32(num, &end);
+ if (*end != 0)
+ continue;
+ }
+ }
+ iconPair.Ext = s.Left(pos);
+ IconPairs.Add(iconPair);
+ }
+}
+
+bool CCodecIcons::FindIconIndex(const UString &ext, int &iconIndex) const
+{
+ iconIndex = -1;
+ FOR_VECTOR (i, IconPairs)
+ {
+ const CIconPair &pair = IconPairs[i];
+ if (ext.IsEqualTo_NoCase(pair.Ext))
+ {
+ iconIndex = pair.IconIndex;
+ return true;
+ }
+ }
+ return false;
+}
+
+#endif // NEW_FOLDER_INTERFACE
+
+
+#ifdef EXTERNAL_CODECS
+
+// #define EXPORT_CODECS
+
+#ifdef EXPORT_CODECS
+
+extern unsigned g_NumCodecs;
+STDAPI CreateDecoder(UInt32 index, const GUID *iid, void **outObject);
+STDAPI CreateEncoder(UInt32 index, const GUID *iid, void **outObject);
+STDAPI GetMethodProperty(UInt32 codecIndex, PROPID propID, PROPVARIANT *value);
+#define NUM_EXPORT_CODECS g_NumCodecs
+
+extern unsigned g_NumHashers;
+STDAPI CreateHasher(UInt32 index, IHasher **hasher);
+STDAPI GetHasherProp(UInt32 codecIndex, PROPID propID, PROPVARIANT *value);
+#define NUM_EXPORT_HASHERS g_NumHashers
+
+#else // EXPORT_CODECS
+
+#define NUM_EXPORT_CODECS 0
+#define NUM_EXPORT_HASHERS 0
+
+#endif // EXPORT_CODECS
+
+STDMETHODIMP CCodecs::GetNumMethods(UInt32 *numMethods)
+{
+ *numMethods = NUM_EXPORT_CODECS
+ #ifdef EXTERNAL_CODECS
+ + Codecs.Size()
+ #endif
+ ;
+ return S_OK;
+}
+
+STDMETHODIMP CCodecs::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumCodecs)
+ return GetMethodProperty(index, propID, value);
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ const CDllCodecInfo &ci = Codecs[index - NUM_EXPORT_CODECS];
+
+ if (propID == NMethodPropID::kDecoderIsAssigned ||
+ propID == NMethodPropID::kEncoderIsAssigned)
+ {
+ NCOM::CPropVariant prop;
+ prop = (bool)((propID == NMethodPropID::kDecoderIsAssigned) ?
+ ci.DecoderIsAssigned :
+ ci.EncoderIsAssigned);
+ prop.Detach(value);
+ return S_OK;
+ }
+ const CCodecLib &lib = Libs[ci.LibIndex];
+ return lib.GetMethodProperty(ci.CodecIndex, propID, value);
+ #else
+ return E_FAIL;
+ #endif
+}
+
+STDMETHODIMP CCodecs::CreateDecoder(UInt32 index, const GUID *iid, void **coder)
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumCodecs)
+ return CreateDecoder(index, iid, coder);
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ const CDllCodecInfo &ci = Codecs[index - NUM_EXPORT_CODECS];
+ if (ci.DecoderIsAssigned)
+ {
+ const CCodecLib &lib = Libs[ci.LibIndex];
+ if (lib.CreateDecoder)
+ return lib.CreateDecoder(ci.CodecIndex, iid, (void **)coder);
+ if (lib.CreateObject)
+ return lib.CreateObject(&ci.Decoder, iid, (void **)coder);
+ }
+ return S_OK;
+ #else
+ return E_FAIL;
+ #endif
+}
+
+STDMETHODIMP CCodecs::CreateEncoder(UInt32 index, const GUID *iid, void **coder)
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumCodecs)
+ return CreateEncoder(index, iid, coder);
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ const CDllCodecInfo &ci = Codecs[index - NUM_EXPORT_CODECS];
+ if (ci.EncoderIsAssigned)
+ {
+ const CCodecLib &lib = Libs[ci.LibIndex];
+ if (lib.CreateEncoder)
+ return lib.CreateEncoder(ci.CodecIndex, iid, (void **)coder);
+ if (lib.CreateObject)
+ return lib.CreateObject(&ci.Encoder, iid, (void **)coder);
+ }
+ return S_OK;
+ #else
+ return E_FAIL;
+ #endif
+}
+
+
+STDMETHODIMP_(UInt32) CCodecs::GetNumHashers()
+{
+ return NUM_EXPORT_HASHERS
+ #ifdef EXTERNAL_CODECS
+ + Hashers.Size()
+ #endif
+ ;
+}
+
+STDMETHODIMP CCodecs::GetHasherProp(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumHashers)
+ return ::GetHasherProp(index, propID, value);
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ const CDllHasherInfo &ci = Hashers[index - NUM_EXPORT_HASHERS];
+ return Libs[ci.LibIndex].ComHashers->GetHasherProp(ci.HasherIndex, propID, value);
+ #else
+ return E_FAIL;
+ #endif
+}
+
+STDMETHODIMP CCodecs::CreateHasher(UInt32 index, IHasher **hasher)
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumHashers)
+ return CreateHasher(index, hasher);
+ #endif
+ #ifdef EXTERNAL_CODECS
+ const CDllHasherInfo &ci = Hashers[index - NUM_EXPORT_HASHERS];
+ return Libs[ci.LibIndex].ComHashers->CreateHasher(ci.HasherIndex, hasher);
+ #else
+ return E_FAIL;
+ #endif
+}
+
+int CCodecs::GetCodec_LibIndex(UInt32 index) const
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumCodecs)
+ return -1;
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ const CDllCodecInfo &ci = Codecs[index - NUM_EXPORT_CODECS];
+ return ci.LibIndex;
+ #else
+ return -1;
+ #endif
+}
+
+int CCodecs::GetHasherLibIndex(UInt32 index)
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumHashers)
+ return -1;
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ const CDllHasherInfo &ci = Hashers[index - NUM_EXPORT_HASHERS];
+ return ci.LibIndex;
+ #else
+ return -1;
+ #endif
+}
+
+bool CCodecs::GetCodec_DecoderIsAssigned(UInt32 index) const
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumCodecs)
+ {
+ NCOM::CPropVariant prop;
+ if (GetProperty(index, NMethodPropID::kDecoderIsAssigned, &prop) == S_OK)
+ {
+ if (prop.vt == VT_BOOL)
+ return VARIANT_BOOLToBool(prop.boolVal);
+ }
+ return false;
+ }
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ return Codecs[index - NUM_EXPORT_CODECS].DecoderIsAssigned;
+ #else
+ return false;
+ #endif
+}
+
+bool CCodecs::GetCodec_EncoderIsAssigned(UInt32 index) const
+{
+ #ifdef EXPORT_CODECS
+ if (index < g_NumCodecs)
+ {
+ NCOM::CPropVariant prop;
+ if (GetProperty(index, NMethodPropID::kEncoderIsAssigned, &prop) == S_OK)
+ {
+ if (prop.vt == VT_BOOL)
+ return VARIANT_BOOLToBool(prop.boolVal);
+ }
+ return false;
+ }
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ return Codecs[index - NUM_EXPORT_CODECS].EncoderIsAssigned;
+ #else
+ return false;
+ #endif
+}
+
+UInt32 CCodecs::GetCodec_NumStreams(UInt32 index)
+{
+ NCOM::CPropVariant prop;
+ RINOK(GetProperty(index, NMethodPropID::kPackStreams, &prop));
+ if (prop.vt == VT_UI4)
+ return (UInt32)prop.ulVal;
+ if (prop.vt == VT_EMPTY)
+ return 1;
+ return 0;
+}
+
+HRESULT CCodecs::GetCodec_Id(UInt32 index, UInt64 &id)
+{
+ NCOM::CPropVariant prop;
+ RINOK(GetProperty(index, NMethodPropID::kID, &prop));
+ if (prop.vt != VT_UI8)
+ return E_INVALIDARG;
+ id = prop.uhVal.QuadPart;
+ return S_OK;
+}
+
+AString CCodecs::GetCodec_Name(UInt32 index)
+{
+ AString s;
+ NCOM::CPropVariant prop;
+ if (GetProperty(index, NMethodPropID::kName, &prop) == S_OK)
+ if (prop.vt == VT_BSTR)
+ s.SetFromWStr_if_Ascii(prop.bstrVal);
+ return s;
+}
+
+UInt64 CCodecs::GetHasherId(UInt32 index)
+{
+ NCOM::CPropVariant prop;
+ if (GetHasherProp(index, NMethodPropID::kID, &prop) != S_OK)
+ return 0;
+ if (prop.vt != VT_UI8)
+ return 0;
+ return prop.uhVal.QuadPart;
+}
+
+AString CCodecs::GetHasherName(UInt32 index)
+{
+ AString s;
+ NCOM::CPropVariant prop;
+ if (GetHasherProp(index, NMethodPropID::kName, &prop) == S_OK)
+ if (prop.vt == VT_BSTR)
+ s.SetFromWStr_if_Ascii(prop.bstrVal);
+ return s;
+}
+
+UInt32 CCodecs::GetHasherDigestSize(UInt32 index)
+{
+ NCOM::CPropVariant prop;
+ RINOK(GetHasherProp(index, NMethodPropID::kDigestSize, &prop));
+ if (prop.vt != VT_UI4)
+ return 0;
+ return prop.ulVal;
+}
+
+#endif // EXTERNAL_CODECS
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.h
new file mode 100644
index 0000000000..9ba36d3e9e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/LoadCodecs.h
@@ -0,0 +1,424 @@
+// LoadCodecs.h
+
+#ifndef __LOAD_CODECS_H
+#define __LOAD_CODECS_H
+
+/*
+Client application uses LoadCodecs.* to load plugins to
+CCodecs object, that contains 3 lists of plugins:
+ 1) Formats - internal and external archive handlers
+ 2) Codecs - external codecs
+ 3) Hashers - external hashers
+
+EXTERNAL_CODECS
+---------------
+
+ if EXTERNAL_CODECS is defined, then the code tries to load external
+ plugins from DLL files (shared libraries).
+
+ There are two types of executables in 7-Zip:
+
+ 1) Executable that uses external plugins must be compiled
+ with EXTERNAL_CODECS defined:
+ - 7z.exe, 7zG.exe, 7zFM.exe
+
+ Note: EXTERNAL_CODECS is used also in CPP/7zip/Common/CreateCoder.h
+ that code is used in plugin module (7z.dll).
+
+ 2) Standalone modules are compiled without EXTERNAL_CODECS:
+ - SFX modules: 7z.sfx, 7zCon.sfx
+ - standalone versions of console 7-Zip: 7za.exe, 7zr.exe
+
+ if EXTERNAL_CODECS is defined, CCodecs class implements interfaces:
+ - ICompressCodecsInfo : for Codecs
+ - IHashers : for Hashers
+
+ The client application can send CCodecs object to each plugin module.
+ And plugin module can use ICompressCodecsInfo or IHashers interface to access
+ another plugins.
+
+ There are 2 ways to send (ICompressCodecsInfo * compressCodecsInfo) to plugin
+ 1) for old versions:
+ a) request ISetCompressCodecsInfo from created archive handler.
+ b) call ISetCompressCodecsInfo::SetCompressCodecsInfo(compressCodecsInfo)
+ 2) for new versions:
+ a) request "SetCodecs" function from DLL file
+ b) call SetCodecs(compressCodecsInfo) function from DLL file
+*/
+
+#include "../../../Common/MyBuffer.h"
+#include "../../../Common/MyCom.h"
+#include "../../../Common/MyString.h"
+#include "../../../Common/ComTry.h"
+
+#ifdef EXTERNAL_CODECS
+#include "../../../Windows/DLL.h"
+#endif
+
+#include "../../ICoder.h"
+
+#include "../../Archive/IArchive.h"
+
+
+#ifdef EXTERNAL_CODECS
+
+struct CDllCodecInfo
+{
+ unsigned LibIndex;
+ UInt32 CodecIndex;
+ bool EncoderIsAssigned;
+ bool DecoderIsAssigned;
+ CLSID Encoder;
+ CLSID Decoder;
+};
+
+struct CDllHasherInfo
+{
+ unsigned LibIndex;
+ UInt32 HasherIndex;
+};
+
+#endif
+
+struct CArcExtInfo
+{
+ UString Ext;
+ UString AddExt;
+
+ CArcExtInfo() {}
+ CArcExtInfo(const UString &ext): Ext(ext) {}
+ CArcExtInfo(const UString &ext, const UString &addExt): Ext(ext), AddExt(addExt) {}
+};
+
+
+struct CArcInfoEx
+{
+ UInt32 Flags;
+
+ Func_CreateInArchive CreateInArchive;
+ Func_IsArc IsArcFunc;
+
+ UString Name;
+ CObjectVector<CArcExtInfo> Exts;
+
+ #ifndef _SFX
+ Func_CreateOutArchive CreateOutArchive;
+ bool UpdateEnabled;
+ bool NewInterface;
+ // UInt32 Version;
+ UInt32 SignatureOffset;
+ CObjectVector<CByteBuffer> Signatures;
+ #ifdef NEW_FOLDER_INTERFACE
+ UStringVector AssociateExts;
+ #endif
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+ int LibIndex;
+ UInt32 FormatIndex;
+ CLSID ClassID;
+ #endif
+
+ bool Flags_KeepName() const { return (Flags & NArcInfoFlags::kKeepName) != 0; }
+ bool Flags_FindSignature() const { return (Flags & NArcInfoFlags::kFindSignature) != 0; }
+
+ bool Flags_AltStreams() const { return (Flags & NArcInfoFlags::kAltStreams) != 0; }
+ bool Flags_NtSecure() const { return (Flags & NArcInfoFlags::kNtSecure) != 0; }
+ bool Flags_SymLinks() const { return (Flags & NArcInfoFlags::kSymLinks) != 0; }
+ bool Flags_HardLinks() const { return (Flags & NArcInfoFlags::kHardLinks) != 0; }
+
+ bool Flags_UseGlobalOffset() const { return (Flags & NArcInfoFlags::kUseGlobalOffset) != 0; }
+ bool Flags_StartOpen() const { return (Flags & NArcInfoFlags::kStartOpen) != 0; }
+ bool Flags_BackwardOpen() const { return (Flags & NArcInfoFlags::kBackwardOpen) != 0; }
+ bool Flags_PreArc() const { return (Flags & NArcInfoFlags::kPreArc) != 0; }
+ bool Flags_PureStartOpen() const { return (Flags & NArcInfoFlags::kPureStartOpen) != 0; }
+
+ UString GetMainExt() const
+ {
+ if (Exts.IsEmpty())
+ return UString();
+ return Exts[0].Ext;
+ }
+ int FindExtension(const UString &ext) const;
+
+ /*
+ UString GetAllExtensions() const
+ {
+ UString s;
+ for (int i = 0; i < Exts.Size(); i++)
+ {
+ if (i > 0)
+ s += ' ';
+ s += Exts[i].Ext;
+ }
+ return s;
+ }
+ */
+
+ void AddExts(const UString &ext, const UString &addExt);
+
+ bool IsSplit() const { return StringsAreEqualNoCase_Ascii(Name, "Split"); }
+ // bool IsRar() const { return StringsAreEqualNoCase_Ascii(Name, "Rar"); }
+
+ CArcInfoEx():
+ Flags(0),
+ CreateInArchive(NULL),
+ IsArcFunc(NULL)
+ #ifndef _SFX
+ , CreateOutArchive(NULL)
+ , UpdateEnabled(false)
+ , NewInterface(false)
+ // , Version(0)
+ , SignatureOffset(0)
+ #endif
+ #ifdef EXTERNAL_CODECS
+ , LibIndex(-1)
+ #endif
+ {}
+};
+
+#ifdef NEW_FOLDER_INTERFACE
+
+struct CCodecIcons
+{
+ struct CIconPair
+ {
+ UString Ext;
+ int IconIndex;
+ };
+ CObjectVector<CIconPair> IconPairs;
+
+ void LoadIcons(HMODULE m);
+ bool FindIconIndex(const UString &ext, int &iconIndex) const;
+};
+
+#endif
+
+#ifdef EXTERNAL_CODECS
+
+struct CCodecLib
+ #ifdef NEW_FOLDER_INTERFACE
+ : public CCodecIcons
+ #endif
+{
+ NWindows::NDLL::CLibrary Lib;
+ FString Path;
+
+ Func_CreateObject CreateObject;
+ Func_GetMethodProperty GetMethodProperty;
+ Func_CreateDecoder CreateDecoder;
+ Func_CreateEncoder CreateEncoder;
+ Func_SetCodecs SetCodecs;
+
+ CMyComPtr<IHashers> ComHashers;
+
+ #ifdef NEW_FOLDER_INTERFACE
+ void LoadIcons() { CCodecIcons::LoadIcons((HMODULE)Lib); }
+ #endif
+
+ CCodecLib():
+ CreateObject(NULL),
+ GetMethodProperty(NULL),
+ CreateDecoder(NULL),
+ CreateEncoder(NULL),
+ SetCodecs(NULL)
+ {}
+};
+
+#endif
+
+
+class CCodecs:
+ #ifdef EXTERNAL_CODECS
+ public ICompressCodecsInfo,
+ public IHashers,
+ #else
+ public IUnknown,
+ #endif
+ public CMyUnknownImp
+{
+ CLASS_NO_COPY(CCodecs);
+public:
+ #ifdef EXTERNAL_CODECS
+
+ CObjectVector<CCodecLib> Libs;
+ FString MainDll_ErrorPath;
+
+ void CloseLibs();
+
+ class CReleaser
+ {
+ CLASS_NO_COPY(CReleaser);
+
+ /* CCodecsReleaser object releases CCodecs links.
+ 1) CCodecs is COM object that is deleted when all links to that object will be released/
+ 2) CCodecs::Libs[i] can hold (ICompressCodecsInfo *) link to CCodecs object itself.
+ To break that reference loop, we must close all CCodecs::Libs in CCodecsReleaser desttructor. */
+
+ CCodecs *_codecs;
+
+ public:
+ CReleaser(): _codecs(NULL) {}
+ void Set(CCodecs *codecs) { _codecs = codecs; }
+ ~CReleaser() { if (_codecs) _codecs->CloseLibs(); }
+ };
+
+ bool NeedSetLibCodecs; // = false, if we don't need to set codecs for archive handler via ISetCompressCodecsInfo
+
+ HRESULT LoadCodecs();
+ HRESULT LoadFormats();
+ HRESULT LoadDll(const FString &path, bool needCheckDll, bool *loadedOK = NULL);
+ HRESULT LoadDllsFromFolder(const FString &folderPrefix);
+
+ HRESULT CreateArchiveHandler(const CArcInfoEx &ai, bool outHandler, void **archive) const
+ {
+ return Libs[ai.LibIndex].CreateObject(&ai.ClassID, outHandler ? &IID_IOutArchive : &IID_IInArchive, (void **)archive);
+ }
+
+ #endif
+
+ #ifdef NEW_FOLDER_INTERFACE
+ CCodecIcons InternalIcons;
+ #endif
+
+ CObjectVector<CArcInfoEx> Formats;
+
+ #ifdef EXTERNAL_CODECS
+ CRecordVector<CDllCodecInfo> Codecs;
+ CRecordVector<CDllHasherInfo> Hashers;
+ #endif
+
+ bool CaseSensitiveChange;
+ bool CaseSensitive;
+
+ CCodecs():
+ #ifdef EXTERNAL_CODECS
+ NeedSetLibCodecs(true),
+ #endif
+ CaseSensitiveChange(false),
+ CaseSensitive(false)
+ {}
+
+ ~CCodecs()
+ {
+ // OutputDebugStringA("~CCodecs");
+ }
+
+ const wchar_t *GetFormatNamePtr(int formatIndex) const
+ {
+ return formatIndex < 0 ? L"#" : (const wchar_t *)Formats[formatIndex].Name;
+ }
+
+ HRESULT Load();
+
+ #ifndef _SFX
+ int FindFormatForArchiveName(const UString &arcPath) const;
+ int FindFormatForExtension(const UString &ext) const;
+ int FindFormatForArchiveType(const UString &arcType) const;
+ bool FindFormatForArchiveType(const UString &arcType, CIntVector &formatIndices) const;
+ #endif
+
+ #ifdef EXTERNAL_CODECS
+
+ MY_UNKNOWN_IMP2(ICompressCodecsInfo, IHashers)
+
+ STDMETHOD(GetNumMethods)(UInt32 *numMethods);
+ STDMETHOD(GetProperty)(UInt32 index, PROPID propID, PROPVARIANT *value);
+ STDMETHOD(CreateDecoder)(UInt32 index, const GUID *iid, void **coder);
+ STDMETHOD(CreateEncoder)(UInt32 index, const GUID *iid, void **coder);
+
+ STDMETHOD_(UInt32, GetNumHashers)();
+ STDMETHOD(GetHasherProp)(UInt32 index, PROPID propID, PROPVARIANT *value);
+ STDMETHOD(CreateHasher)(UInt32 index, IHasher **hasher);
+
+ #else
+
+ MY_UNKNOWN_IMP
+
+ #endif // EXTERNAL_CODECS
+
+
+ #ifdef EXTERNAL_CODECS
+
+ int GetCodec_LibIndex(UInt32 index) const;
+ bool GetCodec_DecoderIsAssigned(UInt32 index) const;
+ bool GetCodec_EncoderIsAssigned(UInt32 index) const;
+ UInt32 GetCodec_NumStreams(UInt32 index);
+ HRESULT GetCodec_Id(UInt32 index, UInt64 &id);
+ AString GetCodec_Name(UInt32 index);
+
+ int GetHasherLibIndex(UInt32 index);
+ UInt64 GetHasherId(UInt32 index);
+ AString GetHasherName(UInt32 index);
+ UInt32 GetHasherDigestSize(UInt32 index);
+
+ #endif
+
+ HRESULT CreateInArchive(unsigned formatIndex, CMyComPtr<IInArchive> &archive) const
+ {
+ const CArcInfoEx &ai = Formats[formatIndex];
+ #ifdef EXTERNAL_CODECS
+ if (ai.LibIndex < 0)
+ #endif
+ {
+ COM_TRY_BEGIN
+ archive = ai.CreateInArchive();
+ return S_OK;
+ COM_TRY_END
+ }
+ #ifdef EXTERNAL_CODECS
+ return CreateArchiveHandler(ai, false, (void **)&archive);
+ #endif
+ }
+
+ #ifndef _SFX
+
+ HRESULT CreateOutArchive(unsigned formatIndex, CMyComPtr<IOutArchive> &archive) const
+ {
+ const CArcInfoEx &ai = Formats[formatIndex];
+ #ifdef EXTERNAL_CODECS
+ if (ai.LibIndex < 0)
+ #endif
+ {
+ COM_TRY_BEGIN
+ archive = ai.CreateOutArchive();
+ return S_OK;
+ COM_TRY_END
+ }
+
+ #ifdef EXTERNAL_CODECS
+ return CreateArchiveHandler(ai, true, (void **)&archive);
+ #endif
+ }
+
+ int FindOutFormatFromName(const UString &name) const
+ {
+ FOR_VECTOR (i, Formats)
+ {
+ const CArcInfoEx &arc = Formats[i];
+ if (!arc.UpdateEnabled)
+ continue;
+ if (arc.Name.IsEqualTo_NoCase(name))
+ return i;
+ }
+ return -1;
+ }
+
+ #endif // _SFX
+};
+
+#ifdef EXTERNAL_CODECS
+ #define CREATE_CODECS_OBJECT \
+ CCodecs *codecs = new CCodecs; \
+ CExternalCodecs __externalCodecs; \
+ __externalCodecs.GetCodecs = codecs; \
+ __externalCodecs.GetHashers = codecs; \
+ CCodecs::CReleaser codecsReleaser; \
+ codecsReleaser.Set(codecs);
+#else
+ #define CREATE_CODECS_OBJECT \
+ CCodecs *codecs = new CCodecs; \
+ CMyComPtr<IUnknown> __codecsRef = codecs;
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.cpp
new file mode 100644
index 0000000000..9549269147
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.cpp
@@ -0,0 +1,3550 @@
+// OpenArchive.cpp
+
+#include "StdAfx.h"
+
+// #define SHOW_DEBUG_INFO
+
+#ifdef SHOW_DEBUG_INFO
+#include <stdio.h>
+#endif
+
+#include "../../../../C/CpuArch.h"
+
+#include "../../../Common/ComTry.h"
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/StringToInt.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileDir.h"
+
+#include "../../Common/FileStreams.h"
+#include "../../Common/LimitedStreams.h"
+#include "../../Common/ProgressUtils.h"
+#include "../../Common/StreamUtils.h"
+
+#include "../../Compress/CopyCoder.h"
+
+#include "DefaultName.h"
+#include "OpenArchive.h"
+
+#ifndef _SFX
+#include "SetProperties.h"
+#endif
+
+#ifdef SHOW_DEBUG_INFO
+#define PRF(x) x
+#else
+#define PRF(x)
+#endif
+
+// increase it, if you need to support larger SFX stubs
+static const UInt64 kMaxCheckStartPosition = 1 << 23;
+
+/*
+Open:
+ - formatIndex >= 0 (exact Format)
+ 1) Open with main type. Archive handler is allowed to use archive start finder.
+ Warning, if there is tail.
+
+ - formatIndex = -1 (Parser:0) (default)
+ - same as #1 but doesn't return Parser
+
+ - formatIndex = -2 (#1)
+ - file has supported extension (like a.7z)
+ Open with that main type (only starting from start of file).
+ - open OK:
+ - if there is no tail - return OK
+ - if there is tail:
+ - archive is not "Self Exe" - return OK with Warning, that there is tail
+ - archive is "Self Exe"
+ ignore "Self Exe" stub, and tries to open tail
+ - tail can be open as archive - shows that archive and stub size property.
+ - tail can't be open as archive - shows Parser ???
+ - open FAIL:
+ Try to open with all other types from offset 0 only.
+ If some open type is OK and physical archive size is uequal or larger
+ than file size, then return that archive with warning that can not be open as [extension type].
+ If extension was EXE, it will try to open as unknown_extension case
+ - file has unknown extension (like a.hhh)
+ It tries to open via parser code.
+ - if there is full archive or tail archive and unknown block or "Self Exe"
+ at front, it shows tail archive and stub size property.
+ - in another cases, if there is some archive inside file, it returns parser/
+ - in another cases, it retuens S_FALSE
+
+
+ - formatIndex = -3 (#2)
+ - same as #1, but
+ - stub (EXE) + archive is open in Parser
+
+ - formatIndex = -4 (#3)
+ - returns only Parser. skip full file archive. And show other sub-archives
+
+ - formatIndex = -5 (#4)
+ - returns only Parser. skip full file archive. And show other sub-archives for each byte pos
+
+*/
+
+
+
+
+using namespace NWindows;
+
+/*
+#ifdef _SFX
+#define OPEN_PROPS_PARAM
+#else
+#define OPEN_PROPS_PARAM , props
+#endif
+*/
+
+/*
+CArc::~CArc()
+{
+ GetRawProps.Release();
+ Archive.Release();
+ printf("\nCArc::~CArc()\n");
+}
+*/
+
+#ifndef _SFX
+
+namespace NArchive {
+namespace NParser {
+
+struct CParseItem
+{
+ UInt64 Offset;
+ UInt64 Size;
+ // UInt64 OkSize;
+ UString Name;
+ UString Extension;
+ FILETIME FileTime;
+ UString Comment;
+ UString ArcType;
+
+ bool FileTime_Defined;
+ bool UnpackSize_Defined;
+ bool NumSubDirs_Defined;
+ bool NumSubFiles_Defined;
+
+ bool IsSelfExe;
+ bool IsNotArcType;
+
+ UInt64 UnpackSize;
+ UInt64 NumSubDirs;
+ UInt64 NumSubFiles;
+
+ int FormatIndex;
+
+ bool LenIsUnknown;
+
+ CParseItem():
+ LenIsUnknown(false),
+ FileTime_Defined(false),
+ UnpackSize_Defined(false),
+ NumSubFiles_Defined(false),
+ NumSubDirs_Defined(false),
+ IsSelfExe(false),
+ IsNotArcType(false)
+ // OkSize(0)
+ {}
+
+ /*
+ bool IsEqualTo(const CParseItem &item) const
+ {
+ return Offset == item.Offset && Size == item.Size;
+ }
+ */
+
+ void NormalizeOffset()
+ {
+ if ((Int64)Offset < 0)
+ {
+ Size += Offset;
+ // OkSize += Offset;
+ Offset = 0;
+ }
+ }
+};
+
+class CHandler:
+ public IInArchive,
+ public IInArchiveGetStream,
+ public CMyUnknownImp
+{
+public:
+ CObjectVector<CParseItem> _items;
+ UInt64 _maxEndOffset;
+ CMyComPtr<IInStream> _stream;
+
+ MY_UNKNOWN_IMP2(
+ IInArchive,
+ IInArchiveGetStream)
+
+ INTERFACE_IInArchive(;)
+ STDMETHOD(GetStream)(UInt32 index, ISequentialInStream **stream);
+
+ UInt64 GetLastEnd() const
+ {
+ if (_items.IsEmpty())
+ return 0;
+ const CParseItem &back = _items.Back();
+ return back.Offset + back.Size;
+ }
+
+ void AddUnknownItem(UInt64 next);
+ int FindInsertPos(const CParseItem &item) const;
+ void AddItem(const CParseItem &item);
+
+ CHandler(): _maxEndOffset(0) {}
+};
+
+int CHandler::FindInsertPos(const CParseItem &item) const
+{
+ unsigned left = 0, right = _items.Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const CParseItem & midItem = _items[mid];
+ if (item.Offset < midItem.Offset)
+ right = mid;
+ else if (item.Offset > midItem.Offset)
+ left = mid + 1;
+ else if (item.Size < midItem.Size)
+ right = mid;
+ else if (item.Size > midItem.Size)
+ left = mid + 1;
+ else
+ {
+ left = mid + 1;
+ // return -1;
+ }
+ }
+ return left;
+}
+
+void CHandler::AddUnknownItem(UInt64 next)
+{
+ /*
+ UInt64 prevEnd = 0;
+ if (!_items.IsEmpty())
+ {
+ const CParseItem &back = _items.Back();
+ prevEnd = back.Offset + back.Size;
+ }
+ */
+ if (_maxEndOffset < next)
+ {
+ CParseItem item2;
+ item2.Offset = _maxEndOffset;
+ item2.Size = next - _maxEndOffset;
+ _maxEndOffset = next;
+ _items.Add(item2);
+ }
+ else if (_maxEndOffset > next && !_items.IsEmpty())
+ {
+ CParseItem &back = _items.Back();
+ if (back.LenIsUnknown)
+ {
+ back.Size = next - back.Offset;
+ _maxEndOffset = next;
+ }
+ }
+}
+
+void CHandler::AddItem(const CParseItem &item)
+{
+ AddUnknownItem(item.Offset);
+ int pos = FindInsertPos(item);
+ if (pos >= 0)
+ {
+ _items.Insert(pos, item);
+ UInt64 next = item.Offset + item.Size;
+ if (_maxEndOffset < next)
+ _maxEndOffset = next;
+ }
+}
+
+/*
+static const CStatProp kProps[] =
+{
+ { NULL, kpidPath, VT_BSTR},
+ { NULL, kpidSize, VT_UI8},
+ { NULL, kpidMTime, VT_FILETIME},
+ { NULL, kpidType, VT_BSTR},
+ { NULL, kpidComment, VT_BSTR},
+ { NULL, kpidOffset, VT_UI8},
+ { NULL, kpidUnpackSize, VT_UI8},
+// { NULL, kpidNumSubDirs, VT_UI8},
+};
+*/
+
+static const Byte kProps[] =
+{
+ kpidPath,
+ kpidSize,
+ kpidMTime,
+ kpidType,
+ kpidComment,
+ kpidOffset,
+ kpidUnpackSize
+};
+
+IMP_IInArchive_Props
+IMP_IInArchive_ArcProps_NO
+
+STDMETHODIMP CHandler::Open(IInStream *stream, const UInt64 *, IArchiveOpenCallback * /* openArchiveCallback */)
+{
+ COM_TRY_BEGIN
+ {
+ Close();
+ _stream = stream;
+ }
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CHandler::Close()
+{
+ _items.Clear();
+ _stream.Release();
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetNumberOfItems(UInt32 *numItems)
+{
+ *numItems = _items.Size();
+ return S_OK;
+}
+
+STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ NCOM::CPropVariant prop;
+
+ const CParseItem &item = _items[index];
+
+ switch (propID)
+ {
+ case kpidPath:
+ {
+ char sz[32];
+ ConvertUInt32ToString(index + 1, sz);
+ UString s(sz);
+ if (!item.Name.IsEmpty())
+ {
+ s += '.';
+ s += item.Name;
+ }
+ if (!item.Extension.IsEmpty())
+ {
+ s += '.';
+ s += item.Extension;
+ }
+ prop = s; break;
+ }
+ case kpidSize:
+ case kpidPackSize: prop = item.Size; break;
+ case kpidOffset: prop = item.Offset; break;
+ case kpidUnpackSize: if (item.UnpackSize_Defined) prop = item.UnpackSize; break;
+ case kpidNumSubFiles: if (item.NumSubFiles_Defined) prop = item.NumSubFiles; break;
+ case kpidNumSubDirs: if (item.NumSubDirs_Defined) prop = item.NumSubDirs; break;
+ case kpidMTime: if (item.FileTime_Defined) prop = item.FileTime; break;
+ case kpidComment: if (!item.Comment.IsEmpty()) prop = item.Comment; break;
+ case kpidType: if (!item.ArcType.IsEmpty()) prop = item.ArcType; break;
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+HRESULT CHandler::Extract(const UInt32 *indices, UInt32 numItems,
+ Int32 testMode, IArchiveExtractCallback *extractCallback)
+{
+ COM_TRY_BEGIN
+
+ bool allFilesMode = (numItems == (UInt32)(Int32)-1);
+ if (allFilesMode)
+ numItems = _items.Size();
+ if (_stream && numItems == 0)
+ return S_OK;
+ UInt64 totalSize = 0;
+ UInt32 i;
+ for (i = 0; i < numItems; i++)
+ totalSize += _items[allFilesMode ? i : indices[i]].Size;
+ extractCallback->SetTotal(totalSize);
+
+ totalSize = 0;
+
+ CLocalProgress *lps = new CLocalProgress;
+ CMyComPtr<ICompressProgressInfo> progress = lps;
+ lps->Init(extractCallback, false);
+
+ CLimitedSequentialInStream *streamSpec = new CLimitedSequentialInStream;
+ CMyComPtr<ISequentialInStream> inStream(streamSpec);
+ streamSpec->SetStream(_stream);
+
+ CLimitedSequentialOutStream *outStreamSpec = new CLimitedSequentialOutStream;
+ CMyComPtr<ISequentialOutStream> outStream(outStreamSpec);
+
+ NCompress::CCopyCoder *copyCoderSpec = new NCompress::CCopyCoder();
+ CMyComPtr<ICompressCoder> copyCoder = copyCoderSpec;
+
+ for (i = 0; i < numItems; i++)
+ {
+ lps->InSize = totalSize;
+ lps->OutSize = totalSize;
+ RINOK(lps->SetCur());
+ CMyComPtr<ISequentialOutStream> realOutStream;
+ Int32 askMode = testMode ?
+ NExtract::NAskMode::kTest :
+ NExtract::NAskMode::kExtract;
+ Int32 index = allFilesMode ? i : indices[i];
+ const CParseItem &item = _items[index];
+
+ RINOK(extractCallback->GetStream(index, &realOutStream, askMode));
+ UInt64 unpackSize = item.Size;
+ totalSize += unpackSize;
+ bool skipMode = false;
+ if (!testMode && !realOutStream)
+ continue;
+ RINOK(extractCallback->PrepareOperation(askMode));
+
+ outStreamSpec->SetStream(realOutStream);
+ realOutStream.Release();
+ outStreamSpec->Init(skipMode ? 0 : unpackSize, true);
+
+ Int32 opRes = NExtract::NOperationResult::kOK;
+ RINOK(_stream->Seek(item.Offset, STREAM_SEEK_SET, NULL));
+ streamSpec->Init(unpackSize);
+ RINOK(copyCoder->Code(inStream, outStream, NULL, NULL, progress));
+
+ if (outStreamSpec->GetRem() != 0)
+ opRes = NExtract::NOperationResult::kDataError;
+ outStreamSpec->ReleaseStream();
+ RINOK(extractCallback->SetOperationResult(opRes));
+ }
+
+ return S_OK;
+
+ COM_TRY_END
+}
+
+
+STDMETHODIMP CHandler::GetStream(UInt32 index, ISequentialInStream **stream)
+{
+ COM_TRY_BEGIN
+ const CParseItem &item = _items[index];
+ return CreateLimitedInStream(_stream, item.Offset, item.Size, stream);
+ COM_TRY_END
+}
+
+}}
+
+#endif
+
+HRESULT Archive_GetItemBoolProp(IInArchive *arc, UInt32 index, PROPID propID, bool &result) throw()
+{
+ NCOM::CPropVariant prop;
+ result = false;
+ RINOK(arc->GetProperty(index, propID, &prop));
+ if (prop.vt == VT_BOOL)
+ result = VARIANT_BOOLToBool(prop.boolVal);
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+HRESULT Archive_IsItem_Dir(IInArchive *arc, UInt32 index, bool &result) throw()
+{
+ return Archive_GetItemBoolProp(arc, index, kpidIsDir, result);
+}
+
+HRESULT Archive_IsItem_Aux(IInArchive *arc, UInt32 index, bool &result) throw()
+{
+ return Archive_GetItemBoolProp(arc, index, kpidIsAux, result);
+}
+
+HRESULT Archive_IsItem_AltStream(IInArchive *arc, UInt32 index, bool &result) throw()
+{
+ return Archive_GetItemBoolProp(arc, index, kpidIsAltStream, result);
+}
+
+HRESULT Archive_IsItem_Deleted(IInArchive *arc, UInt32 index, bool &result) throw()
+{
+ return Archive_GetItemBoolProp(arc, index, kpidIsDeleted, result);
+}
+
+static HRESULT Archive_GetArcBoolProp(IInArchive *arc, PROPID propid, bool &result) throw()
+{
+ NCOM::CPropVariant prop;
+ result = false;
+ RINOK(arc->GetArchiveProperty(propid, &prop));
+ if (prop.vt == VT_BOOL)
+ result = VARIANT_BOOLToBool(prop.boolVal);
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+static HRESULT Archive_GetArcProp_UInt(IInArchive *arc, PROPID propid, UInt64 &result, bool &defined)
+{
+ defined = false;
+ NCOM::CPropVariant prop;
+ RINOK(arc->GetArchiveProperty(propid, &prop));
+ switch (prop.vt)
+ {
+ case VT_UI4: result = prop.ulVal; defined = true; break;
+ case VT_I4: result = (Int64)prop.lVal; defined = true; break;
+ case VT_UI8: result = (UInt64)prop.uhVal.QuadPart; defined = true; break;
+ case VT_I8: result = (UInt64)prop.hVal.QuadPart; defined = true; break;
+ case VT_EMPTY: break;
+ default: return E_FAIL;
+ }
+ return S_OK;
+}
+
+static HRESULT Archive_GetArcProp_Int(IInArchive *arc, PROPID propid, Int64 &result, bool &defined)
+{
+ defined = false;
+ NCOM::CPropVariant prop;
+ RINOK(arc->GetArchiveProperty(propid, &prop));
+ switch (prop.vt)
+ {
+ case VT_UI4: result = prop.ulVal; defined = true; break;
+ case VT_I4: result = prop.lVal; defined = true; break;
+ case VT_UI8: result = (Int64)prop.uhVal.QuadPart; defined = true; break;
+ case VT_I8: result = (Int64)prop.hVal.QuadPart; defined = true; break;
+ case VT_EMPTY: break;
+ default: return E_FAIL;
+ }
+ return S_OK;
+}
+
+#ifndef _SFX
+
+HRESULT CArc::GetItemPathToParent(UInt32 index, UInt32 parent, UStringVector &parts) const
+{
+ if (!GetRawProps)
+ return E_FAIL;
+ if (index == parent)
+ return S_OK;
+ UInt32 curIndex = index;
+
+ UString s;
+
+ bool prevWasAltStream = false;
+
+ for (;;)
+ {
+ #ifdef MY_CPU_LE
+ const void *p;
+ UInt32 size;
+ UInt32 propType;
+ RINOK(GetRawProps->GetRawProp(curIndex, kpidName, &p, &size, &propType));
+ if (p && propType == PROP_DATA_TYPE_wchar_t_PTR_Z_LE)
+ s = (const wchar_t *)p;
+ else
+ #endif
+ {
+ NCOM::CPropVariant prop;
+ RINOK(Archive->GetProperty(curIndex, kpidName, &prop));
+ if (prop.vt == VT_BSTR && prop.bstrVal)
+ s.SetFromBstr(prop.bstrVal);
+ else if (prop.vt == VT_EMPTY)
+ s.Empty();
+ else
+ return E_FAIL;
+ }
+
+ UInt32 curParent = (UInt32)(Int32)-1;
+ UInt32 parentType = 0;
+ RINOK(GetRawProps->GetParent(curIndex, &curParent, &parentType));
+
+ if (parentType != NParentType::kAltStream)
+ {
+ for (;;)
+ {
+ int pos = s.ReverseFind_PathSepar();
+ if (pos < 0)
+ {
+ break;
+ }
+ parts.Insert(0, s.Ptr(pos + 1));
+ s.DeleteFrom(pos);
+ }
+ }
+
+ parts.Insert(0, s);
+
+ if (prevWasAltStream)
+ {
+ {
+ UString &s2 = parts[parts.Size() - 2];
+ s2 += ':';
+ s2 += parts.Back();
+ }
+ parts.DeleteBack();
+ }
+
+ if (parent == curParent)
+ return S_OK;
+
+ prevWasAltStream = false;
+ if (parentType == NParentType::kAltStream)
+ prevWasAltStream = true;
+
+ if (curParent == (UInt32)(Int32)-1)
+ return E_FAIL;
+ curIndex = curParent;
+ }
+}
+
+#endif
+
+HRESULT CArc::GetItemPath(UInt32 index, UString &result) const
+{
+ #ifdef MY_CPU_LE
+ if (GetRawProps)
+ {
+ const void *p;
+ UInt32 size;
+ UInt32 propType;
+ if (!IsTree)
+ {
+ if (GetRawProps->GetRawProp(index, kpidPath, &p, &size, &propType) == S_OK &&
+ propType == NPropDataType::kUtf16z)
+ {
+ unsigned len = size / 2 - 1;
+ wchar_t *s = result.GetBuf(len);
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = GetUi16(p);
+ p = (const void *)((const Byte *)p + 2);
+ #if WCHAR_PATH_SEPARATOR != L'/'
+ if (c == L'/')
+ c = WCHAR_PATH_SEPARATOR;
+ #endif
+ *s++ = c;
+ }
+ *s = 0;
+ result.ReleaseBuf_SetLen(len);
+ if (len != 0)
+ return S_OK;
+ }
+ }
+ /*
+ else if (GetRawProps->GetRawProp(index, kpidName, &p, &size, &propType) == S_OK &&
+ p && propType == NPropDataType::kUtf16z)
+ {
+ size -= 2;
+ UInt32 totalSize = size;
+ bool isOK = false;
+
+ {
+ UInt32 index2 = index;
+ for (;;)
+ {
+ UInt32 parent = (UInt32)(Int32)-1;
+ UInt32 parentType = 0;
+ if (GetRawProps->GetParent(index2, &parent, &parentType) != S_OK)
+ break;
+ if (parent == (UInt32)(Int32)-1)
+ {
+ if (parentType != 0)
+ totalSize += 2;
+ isOK = true;
+ break;
+ }
+ index2 = parent;
+ UInt32 size2;
+ const void *p2;
+ if (GetRawProps->GetRawProp(index2, kpidName, &p2, &size2, &propType) != S_OK &&
+ p2 && propType == NPropDataType::kUtf16z)
+ break;
+ totalSize += size2;
+ }
+ }
+
+ if (isOK)
+ {
+ wchar_t *sz = result.GetBuf_SetEnd(totalSize / 2);
+ UInt32 pos = totalSize - size;
+ memcpy((Byte *)sz + pos, p, size);
+ UInt32 index2 = index;
+ for (;;)
+ {
+ UInt32 parent = (UInt32)(Int32)-1;
+ UInt32 parentType = 0;
+ if (GetRawProps->GetParent(index2, &parent, &parentType) != S_OK)
+ break;
+ if (parent == (UInt32)(Int32)-1)
+ {
+ if (parentType != 0)
+ sz[pos / 2 - 1] = L':';
+ break;
+ }
+ index2 = parent;
+ UInt32 size2;
+ const void *p2;
+ if (GetRawProps->GetRawProp(index2, kpidName, &p2, &size2, &propType) != S_OK)
+ break;
+ pos -= size2;
+ memcpy((Byte *)sz + pos, p2, size2);
+ sz[(pos + size2 - 2) / 2] = (parentType == 0) ? WCHAR_PATH_SEPARATOR : L':';
+ }
+ #ifdef _WIN32
+ // result.Replace(L'/', WCHAR_PATH_SEPARATOR);
+ #endif
+ return S_OK;
+ }
+ }
+ */
+ }
+ #endif
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(Archive->GetProperty(index, kpidPath, &prop));
+ if (prop.vt == VT_BSTR && prop.bstrVal)
+ result.SetFromBstr(prop.bstrVal);
+ else if (prop.vt == VT_EMPTY)
+ result.Empty();
+ else
+ return E_FAIL;
+ }
+
+ if (result.IsEmpty())
+ return GetDefaultItemPath(index, result);
+ return S_OK;
+}
+
+HRESULT CArc::GetDefaultItemPath(UInt32 index, UString &result) const
+{
+ result.Empty();
+ bool isDir;
+ RINOK(Archive_IsItem_Dir(Archive, index, isDir));
+ if (!isDir)
+ {
+ result = DefaultName;
+ NCOM::CPropVariant prop;
+ RINOK(Archive->GetProperty(index, kpidExtension, &prop));
+ if (prop.vt == VT_BSTR)
+ {
+ result += '.';
+ result += prop.bstrVal;
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ }
+ return S_OK;
+}
+
+HRESULT CArc::GetItemPath2(UInt32 index, UString &result) const
+{
+ RINOK(GetItemPath(index, result));
+ if (Ask_Deleted)
+ {
+ bool isDeleted = false;
+ RINOK(Archive_IsItem_Deleted(Archive, index, isDeleted));
+ if (isDeleted)
+ result.Insert(0, L"[DELETED]" WSTRING_PATH_SEPARATOR);
+ }
+ return S_OK;
+}
+
+#ifdef SUPPORT_ALT_STREAMS
+
+int FindAltStreamColon_in_Path(const wchar_t *path)
+{
+ unsigned i = 0;
+ int colonPos = -1;
+ for (;; i++)
+ {
+ wchar_t c = path[i];
+ if (c == 0)
+ return colonPos;
+ if (c == ':')
+ {
+ if (colonPos < 0)
+ colonPos = i;
+ continue;
+ }
+ if (c == WCHAR_PATH_SEPARATOR)
+ colonPos = -1;
+ }
+}
+
+#endif
+
+HRESULT CArc::GetItem(UInt32 index, CReadArcItem &item) const
+{
+ #ifdef SUPPORT_ALT_STREAMS
+ item.IsAltStream = false;
+ item.AltStreamName.Empty();
+ item.MainPath.Empty();
+ #endif
+
+ item.IsDir = false;
+ item.Path.Empty();
+ item.ParentIndex = (UInt32)(Int32)-1;
+
+ item.PathParts.Clear();
+
+ RINOK(Archive_IsItem_Dir(Archive, index, item.IsDir));
+ item.MainIsDir = item.IsDir;
+
+ RINOK(GetItemPath2(index, item.Path));
+
+ #ifndef _SFX
+ UInt32 mainIndex = index;
+ #endif
+
+ #ifdef SUPPORT_ALT_STREAMS
+
+ item.MainPath = item.Path;
+ if (Ask_AltStream)
+ {
+ RINOK(Archive_IsItem_AltStream(Archive, index, item.IsAltStream));
+ }
+
+ bool needFindAltStream = false;
+
+ if (item.IsAltStream)
+ {
+ needFindAltStream = true;
+ if (GetRawProps)
+ {
+ UInt32 parentType = 0;
+ UInt32 parentIndex;
+ RINOK(GetRawProps->GetParent(index, &parentIndex, &parentType));
+ if (parentType == NParentType::kAltStream)
+ {
+ NCOM::CPropVariant prop;
+ RINOK(Archive->GetProperty(index, kpidName, &prop));
+ if (prop.vt == VT_BSTR && prop.bstrVal)
+ item.AltStreamName.SetFromBstr(prop.bstrVal);
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ else
+ {
+ // item.IsAltStream = false;
+ }
+ /*
+ if (item.AltStreamName.IsEmpty())
+ item.IsAltStream = false;
+ */
+
+ needFindAltStream = false;
+ item.ParentIndex = parentIndex;
+ mainIndex = parentIndex;
+
+ if (parentIndex == (UInt32)(Int32)-1)
+ {
+ item.MainPath.Empty();
+ item.MainIsDir = true;
+ }
+ else
+ {
+ RINOK(GetItemPath2(parentIndex, item.MainPath));
+ RINOK(Archive_IsItem_Dir(Archive, parentIndex, item.MainIsDir));
+ }
+ }
+ }
+ }
+
+ if (item.WriteToAltStreamIfColon || needFindAltStream)
+ {
+ /* Good handler must support GetRawProps::GetParent for alt streams.
+ So the following code currently is not used */
+ int colon = FindAltStreamColon_in_Path(item.Path);
+ if (colon >= 0)
+ {
+ item.MainPath.DeleteFrom(colon);
+ item.AltStreamName = item.Path.Ptr(colon + 1);
+ item.MainIsDir = (colon == 0 || IsPathSepar(item.Path[(unsigned)colon - 1]));
+ item.IsAltStream = true;
+ }
+ }
+
+ #endif
+
+ #ifndef _SFX
+ if (item._use_baseParentFolder_mode)
+ {
+ RINOK(GetItemPathToParent(mainIndex, item._baseParentFolder, item.PathParts));
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if ((item.WriteToAltStreamIfColon || needFindAltStream) && !item.PathParts.IsEmpty())
+ {
+ int colon;
+ {
+ UString &s = item.PathParts.Back();
+ colon = FindAltStreamColon_in_Path(s);
+ if (colon >= 0)
+ {
+ item.AltStreamName = s.Ptr(colon + 1);
+ item.MainIsDir = (colon == 0 || IsPathSepar(s[(unsigned)colon - 1]));
+ item.IsAltStream = true;
+ s.DeleteFrom(colon);
+ }
+ }
+ if (colon == 0)
+ item.PathParts.DeleteBack();
+ }
+ #endif
+
+ }
+ else
+ #endif
+ SplitPathToParts(
+ #ifdef SUPPORT_ALT_STREAMS
+ item.MainPath
+ #else
+ item.Path
+ #endif
+ , item.PathParts);
+
+ return S_OK;
+}
+
+#ifndef _SFX
+
+static HRESULT Archive_GetItem_Size(IInArchive *archive, UInt32 index, UInt64 &size, bool &defined)
+{
+ NCOM::CPropVariant prop;
+ defined = false;
+ size = 0;
+ RINOK(archive->GetProperty(index, kpidSize, &prop));
+ switch (prop.vt)
+ {
+ case VT_UI1: size = prop.bVal; break;
+ case VT_UI2: size = prop.uiVal; break;
+ case VT_UI4: size = prop.ulVal; break;
+ case VT_UI8: size = (UInt64)prop.uhVal.QuadPart; break;
+ case VT_EMPTY: return S_OK;
+ default: return E_FAIL;
+ }
+ defined = true;
+ return S_OK;
+}
+
+#endif
+
+HRESULT CArc::GetItemSize(UInt32 index, UInt64 &size, bool &defined) const
+{
+ NCOM::CPropVariant prop;
+ defined = false;
+ size = 0;
+ RINOK(Archive->GetProperty(index, kpidSize, &prop));
+ switch (prop.vt)
+ {
+ case VT_UI1: size = prop.bVal; break;
+ case VT_UI2: size = prop.uiVal; break;
+ case VT_UI4: size = prop.ulVal; break;
+ case VT_UI8: size = (UInt64)prop.uhVal.QuadPart; break;
+ case VT_EMPTY: return S_OK;
+ default: return E_FAIL;
+ }
+ defined = true;
+ return S_OK;
+}
+
+HRESULT CArc::GetItemMTime(UInt32 index, FILETIME &ft, bool &defined) const
+{
+ NCOM::CPropVariant prop;
+ defined = false;
+ ft.dwHighDateTime = ft.dwLowDateTime = 0;
+ RINOK(Archive->GetProperty(index, kpidMTime, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ ft = prop.filetime;
+ defined = true;
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ else if (MTimeDefined)
+ {
+ ft = MTime;
+ defined = true;
+ }
+ return S_OK;
+}
+
+#ifndef _SFX
+
+static inline bool TestSignature(const Byte *p1, const Byte *p2, size_t size)
+{
+ for (size_t i = 0; i < size; i++)
+ if (p1[i] != p2[i])
+ return false;
+ return true;
+}
+
+static void MakeCheckOrder(CCodecs *codecs,
+ CIntVector &orderIndices, unsigned numTypes, CIntVector &orderIndices2,
+ const Byte *data, size_t dataSize)
+{
+ for (unsigned i = 0; i < numTypes; i++)
+ {
+ int index = orderIndices[i];
+ if (index < 0)
+ continue;
+ const CArcInfoEx &ai = codecs->Formats[(unsigned)index];
+ if (ai.SignatureOffset != 0)
+ {
+ orderIndices2.Add(index);
+ orderIndices[i] = -1;
+ continue;
+ }
+
+ const CObjectVector<CByteBuffer> &sigs = ai.Signatures;
+ FOR_VECTOR (k, sigs)
+ {
+ const CByteBuffer &sig = sigs[k];
+ if (sig.Size() == 0 && dataSize == 0 ||
+ sig.Size() != 0 && sig.Size() <= dataSize &&
+ TestSignature(data, sig, sig.Size()))
+ {
+ orderIndices2.Add(index);
+ orderIndices[i] = -1;
+ break;
+ }
+ }
+ }
+}
+
+#endif
+
+#ifdef UNDER_CE
+ static const unsigned kNumHashBytes = 1;
+ #define HASH_VAL(buf) ((buf)[0])
+#else
+ static const unsigned kNumHashBytes = 2;
+ // #define HASH_VAL(buf) ((buf)[0] | ((UInt32)(buf)[1] << 8))
+ #define HASH_VAL(buf) GetUi16(buf)
+#endif
+
+
+#ifndef _SFX
+
+static bool IsExeExt(const UString &ext)
+{
+ return ext.IsEqualTo_Ascii_NoCase("exe");
+}
+
+static const char * const k_PreArcFormats[] =
+{
+ "pe"
+ , "elf"
+ , "macho"
+ , "mub"
+ , "te"
+};
+
+static bool IsNameFromList(const UString &s, const char * const names[], size_t num)
+{
+ for (unsigned i = 0; i < num; i++)
+ if (StringsAreEqualNoCase_Ascii(s, names[i]))
+ return true;
+ return false;
+}
+
+
+static bool IsPreArcFormat(const CArcInfoEx &ai)
+{
+ if (ai.Flags_PreArc())
+ return true;
+ return IsNameFromList(ai.Name, k_PreArcFormats, ARRAY_SIZE(k_PreArcFormats));
+}
+
+static const char * const k_Formats_with_simple_signuature[] =
+{
+ "7z"
+ , "xz"
+ , "rar"
+ , "bzip2"
+ , "gzip"
+ , "cab"
+ , "wim"
+ , "rpm"
+ , "vhd"
+ , "xar"
+};
+
+static bool IsNewStyleSignature(const CArcInfoEx &ai)
+{
+ // if (ai.Version >= 0x91F)
+ if (ai.NewInterface)
+ return true;
+ return IsNameFromList(ai.Name, k_Formats_with_simple_signuature, ARRAY_SIZE(k_Formats_with_simple_signuature));
+}
+
+class CArchiveOpenCallback_Offset:
+ public IArchiveOpenCallback,
+ public IArchiveOpenVolumeCallback,
+ #ifndef _NO_CRYPTO
+ public ICryptoGetTextPassword,
+ #endif
+ public CMyUnknownImp
+{
+public:
+ CMyComPtr<IArchiveOpenCallback> Callback;
+ CMyComPtr<IArchiveOpenVolumeCallback> OpenVolumeCallback;
+ UInt64 Files;
+ UInt64 Offset;
+
+ #ifndef _NO_CRYPTO
+ CMyComPtr<ICryptoGetTextPassword> GetTextPassword;
+ #endif
+
+ MY_QUERYINTERFACE_BEGIN2(IArchiveOpenCallback)
+ MY_QUERYINTERFACE_ENTRY(IArchiveOpenVolumeCallback)
+ #ifndef _NO_CRYPTO
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ INTERFACE_IArchiveOpenCallback(;)
+ INTERFACE_IArchiveOpenVolumeCallback(;)
+ #ifndef _NO_CRYPTO
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+ #endif
+};
+
+#ifndef _NO_CRYPTO
+STDMETHODIMP CArchiveOpenCallback_Offset::CryptoGetTextPassword(BSTR *password)
+{
+ COM_TRY_BEGIN
+ if (GetTextPassword)
+ return GetTextPassword->CryptoGetTextPassword(password);
+ return E_NOTIMPL;
+ COM_TRY_END
+}
+#endif
+
+STDMETHODIMP CArchiveOpenCallback_Offset::SetTotal(const UInt64 *, const UInt64 *)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveOpenCallback_Offset::SetCompleted(const UInt64 *, const UInt64 *bytes)
+{
+ if (!Callback)
+ return S_OK;
+ UInt64 value = Offset;
+ if (bytes)
+ value += *bytes;
+ return Callback->SetCompleted(&Files, &value);
+}
+
+STDMETHODIMP CArchiveOpenCallback_Offset::GetProperty(PROPID propID, PROPVARIANT *value)
+{
+ if (OpenVolumeCallback)
+ return OpenVolumeCallback->GetProperty(propID, value);
+ NCOM::PropVariant_Clear(value);
+ return S_OK;
+ // return E_NOTIMPL;
+}
+
+STDMETHODIMP CArchiveOpenCallback_Offset::GetStream(const wchar_t *name, IInStream **inStream)
+{
+ if (OpenVolumeCallback)
+ return OpenVolumeCallback->GetStream(name, inStream);
+ return S_FALSE;
+}
+
+#endif
+
+
+UInt32 GetOpenArcErrorFlags(const NCOM::CPropVariant &prop, bool *isDefinedProp)
+{
+ if (isDefinedProp != NULL)
+ *isDefinedProp = false;
+
+ switch (prop.vt)
+ {
+ case VT_UI8: if (isDefinedProp) *isDefinedProp = true; return (UInt32)prop.uhVal.QuadPart;
+ case VT_UI4: if (isDefinedProp) *isDefinedProp = true; return prop.ulVal;
+ case VT_EMPTY: return 0;
+ default: throw 151199;
+ }
+}
+
+void CArcErrorInfo::ClearErrors()
+{
+ // ErrorFormatIndex = -1; // we don't need to clear ErrorFormatIndex here !!!
+
+ ThereIsTail = false;
+ UnexpecedEnd = false;
+ IgnoreTail = false;
+ // NonZerosTail = false;
+ ErrorFlags_Defined = false;
+ ErrorFlags = 0;
+ WarningFlags = 0;
+ TailSize = 0;
+
+ ErrorMessage.Empty();
+ WarningMessage.Empty();
+}
+
+HRESULT CArc::ReadBasicProps(IInArchive *archive, UInt64 startPos, HRESULT openRes)
+{
+ // OkPhySize_Defined = false;
+ PhySizeDefined = false;
+ PhySize = 0;
+ Offset = 0;
+ AvailPhySize = FileSize - startPos;
+
+ ErrorInfo.ClearErrors();
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidErrorFlags, &prop));
+ ErrorInfo.ErrorFlags = GetOpenArcErrorFlags(prop, &ErrorInfo.ErrorFlags_Defined);
+ }
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidWarningFlags, &prop));
+ ErrorInfo.WarningFlags = GetOpenArcErrorFlags(prop);
+ }
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidError, &prop));
+ if (prop.vt != VT_EMPTY)
+ ErrorInfo.ErrorMessage = (prop.vt == VT_BSTR ? prop.bstrVal : L"Unknown error");
+ }
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidWarning, &prop));
+ if (prop.vt != VT_EMPTY)
+ ErrorInfo.WarningMessage = (prop.vt == VT_BSTR ? prop.bstrVal : L"Unknown warning");
+ }
+
+ if (openRes == S_OK || ErrorInfo.IsArc_After_NonOpen())
+ {
+ RINOK(Archive_GetArcProp_UInt(archive, kpidPhySize, PhySize, PhySizeDefined));
+ /*
+ RINOK(Archive_GetArcProp_UInt(archive, kpidOkPhySize, OkPhySize, OkPhySize_Defined));
+ if (!OkPhySize_Defined)
+ {
+ OkPhySize_Defined = PhySizeDefined;
+ OkPhySize = PhySize;
+ }
+ */
+
+ bool offsetDefined;
+ RINOK(Archive_GetArcProp_Int(archive, kpidOffset, Offset, offsetDefined));
+
+ Int64 globalOffset = startPos + Offset;
+ AvailPhySize = FileSize - globalOffset;
+ if (PhySizeDefined)
+ {
+ UInt64 endPos = globalOffset + PhySize;
+ if (endPos < FileSize)
+ {
+ AvailPhySize = PhySize;
+ ErrorInfo.ThereIsTail = true;
+ ErrorInfo.TailSize = FileSize - endPos;
+ }
+ else if (endPos > FileSize)
+ ErrorInfo.UnexpecedEnd = true;
+ }
+ }
+
+ return S_OK;
+}
+
+/*
+static PrintNumber(const char *s, int n)
+{
+ char temp[100];
+ sprintf(temp, "%s %d", s, n);
+ OutputDebugStringA(temp);
+}
+*/
+
+HRESULT CArc::PrepareToOpen(const COpenOptions &op, unsigned formatIndex, CMyComPtr<IInArchive> &archive)
+{
+ // OutputDebugStringA("a1");
+ // PrintNumber("formatIndex", formatIndex);
+
+ RINOK(op.codecs->CreateInArchive(formatIndex, archive));
+ // OutputDebugStringA("a2");
+ if (!archive)
+ return S_OK;
+
+ #ifdef EXTERNAL_CODECS
+ if (op.codecs->NeedSetLibCodecs)
+ {
+ const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
+ if (ai.LibIndex >= 0 ?
+ !op.codecs->Libs[ai.LibIndex].SetCodecs :
+ !op.codecs->Libs.IsEmpty())
+ {
+ CMyComPtr<ISetCompressCodecsInfo> setCompressCodecsInfo;
+ archive.QueryInterface(IID_ISetCompressCodecsInfo, (void **)&setCompressCodecsInfo);
+ if (setCompressCodecsInfo)
+ {
+ RINOK(setCompressCodecsInfo->SetCompressCodecsInfo(op.codecs));
+ }
+ }
+ }
+ #endif
+
+
+ #ifndef _SFX
+
+ const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
+
+ // OutputDebugStringW(ai.Name);
+ // OutputDebugStringA("a3");
+
+ if (ai.Flags_PreArc())
+ {
+ /* we notify parsers that extract executables, that they don't need
+ to open archive, if there is tail after executable (for SFX cases) */
+ CMyComPtr<IArchiveAllowTail> allowTail;
+ archive.QueryInterface(IID_IArchiveAllowTail, (void **)&allowTail);
+ if (allowTail)
+ allowTail->AllowTail(BoolToInt(true));
+ }
+
+ if (op.props)
+ {
+ /*
+ FOR_VECTOR (y, op.props)
+ {
+ const COptionalOpenProperties &optProps = (*op.props)[y];
+ if (optProps.FormatName.IsEmpty() || optProps.FormatName.CompareNoCase(ai.Name) == 0)
+ {
+ RINOK(SetProperties(archive, optProps.Props));
+ break;
+ }
+ }
+ */
+ RINOK(SetProperties(archive, *op.props));
+ }
+
+ #endif
+ return S_OK;
+}
+
+#ifndef _SFX
+
+static HRESULT ReadParseItemProps(IInArchive *archive, const CArcInfoEx &ai, NArchive::NParser::CParseItem &pi)
+{
+ pi.Extension = ai.GetMainExt();
+ pi.FileTime_Defined = false;
+ pi.ArcType = ai.Name;
+
+ RINOK(Archive_GetArcBoolProp(archive, kpidIsNotArcType, pi.IsNotArcType));
+
+ // RINOK(Archive_GetArcBoolProp(archive, kpidIsSelfExe, pi.IsSelfExe));
+ pi.IsSelfExe = ai.Flags_PreArc();
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidMTime, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ pi.FileTime_Defined = true;
+ pi.FileTime = prop.filetime;
+ }
+ }
+
+ if (!pi.FileTime_Defined)
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidCTime, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ pi.FileTime_Defined = true;
+ pi.FileTime = prop.filetime;
+ }
+ }
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidName, &prop));
+ if (prop.vt == VT_BSTR)
+ {
+ pi.Name.SetFromBstr(prop.bstrVal);
+ pi.Extension.Empty();
+ }
+ else
+ {
+ RINOK(archive->GetArchiveProperty(kpidExtension, &prop));
+ if (prop.vt == VT_BSTR)
+ pi.Extension.SetFromBstr(prop.bstrVal);
+ }
+ }
+
+ {
+ NCOM::CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(kpidShortComment, &prop));
+ if (prop.vt == VT_BSTR)
+ pi.Comment.SetFromBstr(prop.bstrVal);
+ }
+
+
+ UInt32 numItems;
+ RINOK(archive->GetNumberOfItems(&numItems));
+
+ // pi.NumSubFiles = numItems;
+ // RINOK(Archive_GetArcProp_UInt(archive, kpidUnpackSize, pi.UnpackSize, pi.UnpackSize_Defined));
+ // if (!pi.UnpackSize_Defined)
+ {
+ pi.NumSubFiles = 0;
+ pi.NumSubDirs = 0;
+ pi.UnpackSize = 0;
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ UInt64 size = 0;
+ bool defined = false;
+ Archive_GetItem_Size(archive, i, size, defined);
+ if (defined)
+ {
+ pi.UnpackSize_Defined = true;
+ pi.UnpackSize += size;
+ }
+
+ bool isDir = false;
+ Archive_IsItem_Dir(archive, i, isDir);
+ if (isDir)
+ pi.NumSubDirs++;
+ else
+ pi.NumSubFiles++;
+ }
+ if (pi.NumSubDirs != 0)
+ pi.NumSubDirs_Defined = true;
+ pi.NumSubFiles_Defined = true;
+ }
+
+ return S_OK;
+}
+
+#endif
+
+HRESULT CArc::CheckZerosTail(const COpenOptions &op, UInt64 offset)
+{
+ if (!op.stream)
+ return S_OK;
+ RINOK(op.stream->Seek(offset, STREAM_SEEK_SET, NULL));
+ const UInt32 kBufSize = 1 << 11;
+ Byte buf[kBufSize];
+
+ for (;;)
+ {
+ UInt32 processed = 0;
+ RINOK(op.stream->Read(buf, kBufSize, &processed));
+ if (processed == 0)
+ {
+ // ErrorInfo.NonZerosTail = false;
+ ErrorInfo.IgnoreTail = true;
+ return S_OK;
+ }
+ for (size_t i = 0; i < processed; i++)
+ {
+ if (buf[i] != 0)
+ {
+ // ErrorInfo.IgnoreTail = false;
+ // ErrorInfo.NonZerosTail = true;
+ return S_OK;
+ }
+ }
+ }
+}
+
+#ifndef _SFX
+
+class CExtractCallback_To_OpenCallback:
+ public IArchiveExtractCallback,
+ public ICompressProgressInfo,
+ public CMyUnknownImp
+{
+public:
+ CMyComPtr<IArchiveOpenCallback> Callback;
+ UInt64 Files;
+ UInt64 Offset;
+
+ MY_UNKNOWN_IMP2(IArchiveExtractCallback, ICompressProgressInfo)
+ INTERFACE_IArchiveExtractCallback(;)
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+ void Init(IArchiveOpenCallback *callback)
+ {
+ Callback = callback;
+ Files = 0;
+ Offset = 0;
+ }
+};
+
+STDMETHODIMP CExtractCallback_To_OpenCallback::SetTotal(UInt64 /* size */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallback_To_OpenCallback::SetCompleted(const UInt64 * /* completeValue */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallback_To_OpenCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 * /* outSize */)
+{
+ if (Callback)
+ {
+ UInt64 value = Offset;
+ if (inSize)
+ value += *inSize;
+ return Callback->SetCompleted(&Files, &value);
+ }
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallback_To_OpenCallback::GetStream(UInt32 /* index */, ISequentialOutStream **outStream, Int32 /* askExtractMode */)
+{
+ *outStream = 0;
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallback_To_OpenCallback::PrepareOperation(Int32 /* askExtractMode */)
+{
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallback_To_OpenCallback::SetOperationResult(Int32 /* operationResult */)
+{
+ return S_OK;
+}
+
+static HRESULT OpenArchiveSpec(IInArchive *archive, bool needPhySize,
+ IInStream *stream, const UInt64 *maxCheckStartPosition,
+ IArchiveOpenCallback *openCallback,
+ IArchiveExtractCallback *extractCallback)
+{
+ /*
+ if (needPhySize)
+ {
+ CMyComPtr<IArchiveOpen2> open2;
+ archive->QueryInterface(IID_IArchiveOpen2, (void **)&open2);
+ if (open2)
+ return open2->ArcOpen2(stream, kOpenFlags_RealPhySize, openCallback);
+ }
+ */
+ RINOK(archive->Open(stream, maxCheckStartPosition, openCallback));
+ if (needPhySize)
+ {
+ bool phySize_Defined = false;
+ UInt64 phySize = 0;
+ RINOK(Archive_GetArcProp_UInt(archive, kpidPhySize, phySize, phySize_Defined));
+ if (phySize_Defined)
+ return S_OK;
+
+ bool phySizeCantBeDetected = false;;
+ RINOK(Archive_GetArcBoolProp(archive, kpidPhySizeCantBeDetected, phySizeCantBeDetected));
+
+ if (!phySizeCantBeDetected)
+ {
+ RINOK(archive->Extract(0, (UInt32)(Int32)-1, BoolToInt(true), extractCallback));
+ }
+ }
+ return S_OK;
+}
+
+static int FindFormatForArchiveType(CCodecs *codecs, CIntVector orderIndices, const char *name)
+{
+ FOR_VECTOR (i, orderIndices)
+ if (StringsAreEqualNoCase_Ascii(codecs->Formats[orderIndices[i]].Name, name))
+ return i;
+ return -1;
+}
+
+#endif
+
+HRESULT CArc::OpenStream2(const COpenOptions &op)
+{
+ // fprintf(stdout, "\nOpen: %S", Path); fflush(stdout);
+
+ Archive.Release();
+ GetRawProps.Release();
+ GetRootProps.Release();
+
+ ErrorInfo.ClearErrors();
+ ErrorInfo.ErrorFormatIndex = -1;
+
+ IsParseArc = false;
+ ArcStreamOffset = 0;
+
+ // OutputDebugStringA("1");
+ // OutputDebugStringW(Path);
+
+ const UString fileName = ExtractFileNameFromPath(Path);
+ UString extension;
+ {
+ int dotPos = fileName.ReverseFind_Dot();
+ if (dotPos >= 0)
+ extension = fileName.Ptr(dotPos + 1);
+ }
+
+ CIntVector orderIndices;
+
+ bool searchMarkerInHandler = false;
+ #ifdef _SFX
+ searchMarkerInHandler = true;
+ #endif
+
+ CBoolArr isMainFormatArr(op.codecs->Formats.Size());
+ {
+ FOR_VECTOR(i, op.codecs->Formats)
+ isMainFormatArr[i] = false;
+ }
+
+ UInt64 maxStartOffset =
+ op.openType.MaxStartOffset_Defined ?
+ op.openType.MaxStartOffset :
+ kMaxCheckStartPosition;
+
+ #ifndef _SFX
+ bool isUnknownExt = false;
+ #endif
+
+ bool isForced = false;
+ unsigned numMainTypes = 0;
+ int formatIndex = op.openType.FormatIndex;
+
+ if (formatIndex >= 0)
+ {
+ isForced = true;
+ orderIndices.Add(formatIndex);
+ numMainTypes = 1;
+ isMainFormatArr[(unsigned)formatIndex] = true;
+
+ searchMarkerInHandler = true;
+ }
+ else
+ {
+ unsigned numFinded = 0;
+ #ifndef _SFX
+ bool isPrearcExt = false;
+ #endif
+
+ {
+ #ifndef _SFX
+
+ bool isZip = false;
+ bool isRar = false;
+
+ const wchar_t c = extension[0];
+ if (c == 'z' || c == 'Z' || c == 'r' || c == 'R')
+ {
+ bool isNumber = false;
+ for (unsigned k = 1;; k++)
+ {
+ const wchar_t d = extension[k];
+ if (d == 0)
+ break;
+ if (d < '0' || d > '9')
+ {
+ isNumber = false;
+ break;
+ }
+ isNumber = true;
+ }
+ if (isNumber)
+ if (c == 'z' || c == 'Z')
+ isZip = true;
+ else
+ isRar = true;
+ }
+
+ #endif
+
+ FOR_VECTOR (i, op.codecs->Formats)
+ {
+ const CArcInfoEx &ai = op.codecs->Formats[i];
+
+ if (IgnoreSplit || !op.openType.CanReturnArc)
+ if (ai.IsSplit())
+ continue;
+ if (op.excludedFormats->FindInSorted(i) >= 0)
+ continue;
+
+ #ifndef _SFX
+ if (IsPreArcFormat(ai))
+ isPrearcExt = true;
+ #endif
+
+ if (ai.FindExtension(extension) >= 0
+ #ifndef _SFX
+ || isZip && StringsAreEqualNoCase_Ascii(ai.Name, "zip")
+ || isRar && StringsAreEqualNoCase_Ascii(ai.Name, "rar")
+ #endif
+ )
+ {
+ // PrintNumber("orderIndices.Insert", i);
+ orderIndices.Insert(numFinded++, i);
+ isMainFormatArr[i] = true;
+ }
+ else
+ orderIndices.Add(i);
+ }
+ }
+
+ if (!op.stream)
+ {
+ if (numFinded != 1)
+ return E_NOTIMPL;
+ orderIndices.DeleteFrom(1);
+ }
+ // PrintNumber("numFinded", numFinded );
+
+ /*
+ if (op.openOnlySpecifiedByExtension)
+ {
+ if (numFinded != 0 && !IsExeExt(extension))
+ orderIndices.DeleteFrom(numFinded);
+ }
+ */
+
+ #ifndef _SFX
+
+ if (op.stream && orderIndices.Size() >= 2)
+ {
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+ CByteBuffer byteBuffer;
+ CIntVector orderIndices2;
+ if (numFinded == 0 || IsExeExt(extension))
+ {
+ // signature search was here
+ }
+ else if (extension.IsEqualTo("000") || extension.IsEqualTo("001"))
+ {
+ int i = FindFormatForArchiveType(op.codecs, orderIndices, "rar");
+ if (i >= 0)
+ {
+ const size_t kBufSize = (1 << 10);
+ byteBuffer.Alloc(kBufSize);
+ size_t processedSize = kBufSize;
+ RINOK(ReadStream(op.stream, byteBuffer, &processedSize));
+ if (processedSize >= 16)
+ {
+ const Byte *buf = byteBuffer;
+ const Byte kRarHeader[] = { 0x52 , 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 };
+ if (TestSignature(buf, kRarHeader, 7) && buf[9] == 0x73 && (buf[10] & 1) != 0)
+ {
+ orderIndices2.Add(orderIndices[i]);
+ orderIndices[i] = -1;
+ if (i >= (int)numFinded)
+ numFinded++;
+ }
+ }
+ }
+ }
+ else
+ {
+ const size_t kBufSize = (1 << 10);
+ byteBuffer.Alloc(kBufSize);
+ size_t processedSize = kBufSize;
+ RINOK(ReadStream(op.stream, byteBuffer, &processedSize));
+ if (processedSize == 0)
+ return S_FALSE;
+
+ /*
+ check type order:
+ 1) matched extension, no signuature
+ 2) matched extension, matched signuature
+ // 3) no signuature
+ // 4) matched signuature
+ */
+
+ MakeCheckOrder(op.codecs, orderIndices, numFinded, orderIndices2, NULL, 0);
+ MakeCheckOrder(op.codecs, orderIndices, numFinded, orderIndices2, byteBuffer, processedSize);
+ // MakeCheckOrder(op.codecs, orderIndices, orderIndices.Size(), orderIndices2, NULL, 0);
+ // MakeCheckOrder(op.codecs, orderIndices, orderIndices.Size(), orderIndices2, byteBuffer, processedSize);
+ }
+
+ FOR_VECTOR (i, orderIndices)
+ {
+ int val = orderIndices[i];
+ if (val != -1)
+ orderIndices2.Add(val);
+ }
+ orderIndices = orderIndices2;
+ }
+
+ if (orderIndices.Size() >= 2)
+ {
+ int iIso = FindFormatForArchiveType(op.codecs, orderIndices, "iso");
+ int iUdf = FindFormatForArchiveType(op.codecs, orderIndices, "udf");
+ if (iUdf > iIso && iIso >= 0)
+ {
+ int isoIndex = orderIndices[iIso];
+ int udfIndex = orderIndices[iUdf];
+ orderIndices[iUdf] = isoIndex;
+ orderIndices[iIso] = udfIndex;
+ }
+ }
+
+ numMainTypes = numFinded;
+ isUnknownExt = (numMainTypes == 0) || isPrearcExt;
+
+ #else // _SFX
+
+ numMainTypes = orderIndices.Size();
+
+ // we need correct numMainTypes for mutlivolume SFX (if some volume is missing)
+ if (numFinded != 0)
+ numMainTypes = numFinded;
+
+ #endif
+ }
+
+ UInt64 fileSize = 0;
+ if (op.stream)
+ {
+ RINOK(op.stream->Seek(0, STREAM_SEEK_END, &fileSize));
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+ FileSize = fileSize;
+
+
+ #ifndef _SFX
+
+ CBoolArr skipFrontalFormat(op.codecs->Formats.Size());
+ {
+ FOR_VECTOR(i, op.codecs->Formats)
+ skipFrontalFormat[i] = false;
+ }
+
+ #endif
+
+ const COpenType &mode = op.openType;
+
+
+
+
+
+ if (mode.CanReturnArc)
+ {
+ // ---------- OPEN main type by extenssion ----------
+
+ unsigned numCheckTypes = orderIndices.Size();
+ if (formatIndex >= 0)
+ numCheckTypes = numMainTypes;
+
+ for (unsigned i = 0; i < numCheckTypes; i++)
+ {
+ FormatIndex = orderIndices[i];
+
+ bool exactOnly = false;
+
+ #ifndef _SFX
+
+ const CArcInfoEx &ai = op.codecs->Formats[FormatIndex];
+ // OutputDebugStringW(ai.Name);
+ if (i >= numMainTypes)
+ {
+ if (!ai.Flags_BackwardOpen()
+ // && !ai.Flags_PureStartOpen()
+ )
+ continue;
+ exactOnly = true;
+ }
+
+ #endif
+
+ // Some handlers do not set total bytes. So we set it here
+ if (op.callback)
+ RINOK(op.callback->SetTotal(NULL, &fileSize));
+
+ if (op.stream)
+ {
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+
+ CMyComPtr<IInArchive> archive;
+
+ RINOK(PrepareToOpen(op, FormatIndex, archive));
+ if (!archive)
+ continue;
+
+ HRESULT result;
+ if (op.stream)
+ {
+ UInt64 searchLimit = (!exactOnly && searchMarkerInHandler) ? maxStartOffset: 0;
+ result = archive->Open(op.stream, &searchLimit, op.callback);
+ }
+ else
+ {
+ CMyComPtr<IArchiveOpenSeq> openSeq;
+ archive.QueryInterface(IID_IArchiveOpenSeq, (void **)&openSeq);
+ if (!openSeq)
+ return E_NOTIMPL;
+ result = openSeq->OpenSeq(op.seqStream);
+ }
+
+ RINOK(ReadBasicProps(archive, 0, result));
+
+ if (result == S_FALSE)
+ {
+ bool isArc = ErrorInfo.IsArc_After_NonOpen();
+
+ #ifndef _SFX
+ // if it's archive, we allow another open attempt for parser
+ if (!mode.CanReturnParser || !isArc)
+ skipFrontalFormat[(unsigned)FormatIndex] = true;
+ #endif
+
+ if (exactOnly)
+ continue;
+
+ if (i == 0 && numMainTypes == 1)
+ {
+ // we set NonOpenErrorInfo, only if there is only one main format (defined by extension).
+ ErrorInfo.ErrorFormatIndex = FormatIndex;
+ NonOpen_ErrorInfo = ErrorInfo;
+
+ if (!mode.CanReturnParser && isArc)
+ {
+ // if (formatIndex < 0 && !searchMarkerInHandler)
+ {
+ // if bad archive was detected, we don't need additional open attempts
+ #ifndef _SFX
+ if (!IsPreArcFormat(ai) /* || !mode.SkipSfxStub */)
+ #endif
+ return S_FALSE;
+ }
+ }
+ }
+
+ /*
+ #ifndef _SFX
+ if (IsExeExt(extension) || ai.Flags_PreArc())
+ {
+ // openOnlyFullArc = false;
+ // canReturnTailArc = true;
+ // limitSignatureSearch = true;
+ }
+ #endif
+ */
+
+ continue;
+ }
+
+ RINOK(result);
+
+ #ifndef _SFX
+
+ bool isMainFormat = isMainFormatArr[(unsigned)FormatIndex];
+ const COpenSpecFlags &specFlags = mode.GetSpec(isForced, isMainFormat, isUnknownExt);
+
+ bool thereIsTail = ErrorInfo.ThereIsTail;
+ if (thereIsTail && mode.ZerosTailIsAllowed)
+ {
+ RINOK(CheckZerosTail(op, Offset + PhySize));
+ if (ErrorInfo.IgnoreTail)
+ thereIsTail = false;
+ }
+
+ if (Offset > 0)
+ {
+ if (exactOnly
+ || !searchMarkerInHandler
+ || !specFlags.CanReturn_NonStart()
+ || (mode.MaxStartOffset_Defined && (UInt64)Offset > mode.MaxStartOffset))
+ continue;
+ }
+ if (thereIsTail)
+ {
+ if (Offset > 0)
+ {
+ if (!specFlags.CanReturnMid)
+ continue;
+ }
+ else if (!specFlags.CanReturnFrontal)
+ continue;
+ }
+
+ if (Offset > 0 || thereIsTail)
+ {
+ if (formatIndex < 0)
+ {
+ if (IsPreArcFormat(ai))
+ {
+ // openOnlyFullArc = false;
+ // canReturnTailArc = true;
+ /*
+ if (mode.SkipSfxStub)
+ limitSignatureSearch = true;
+ */
+ // if (mode.SkipSfxStub)
+ {
+ // skipFrontalFormat[FormatIndex] = true;
+ continue;
+ }
+ }
+ }
+ }
+
+ #endif
+
+ Archive = archive;
+ return S_OK;
+ }
+ }
+
+
+
+ #ifndef _SFX
+
+ if (!op.stream)
+ return S_FALSE;
+
+ if (formatIndex >= 0 && !mode.CanReturnParser)
+ {
+ if (mode.MaxStartOffset_Defined)
+ {
+ if (mode.MaxStartOffset == 0)
+ return S_FALSE;
+ }
+ else
+ {
+ const CArcInfoEx &ai = op.codecs->Formats[formatIndex];
+ if (ai.FindExtension(extension) >= 0)
+ {
+ if (ai.Flags_FindSignature() && searchMarkerInHandler)
+ return S_FALSE;
+ }
+ }
+ }
+
+ NArchive::NParser::CHandler *handlerSpec = new NArchive::NParser::CHandler;
+ CMyComPtr<IInArchive> handler = handlerSpec;
+
+ CExtractCallback_To_OpenCallback *extractCallback_To_OpenCallback_Spec = new CExtractCallback_To_OpenCallback;
+ CMyComPtr<IArchiveExtractCallback> extractCallback_To_OpenCallback = extractCallback_To_OpenCallback_Spec;
+ extractCallback_To_OpenCallback_Spec->Init(op.callback);
+
+ {
+ // ---------- Check all possible START archives ----------
+ // this code is better for full file archives than Parser's code.
+
+ CByteBuffer byteBuffer;
+ bool endOfFile = false;
+ size_t processedSize;
+ {
+ size_t bufSize = 1 << 20; // it must be larger than max signature offset or IsArcFunc offset ((1 << 19) + x for UDF)
+ if (bufSize > fileSize)
+ {
+ bufSize = (size_t)fileSize;
+ endOfFile = true;
+ }
+ byteBuffer.Alloc(bufSize);
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+ processedSize = bufSize;
+ RINOK(ReadStream(op.stream, byteBuffer, &processedSize));
+ if (processedSize == 0)
+ return S_FALSE;
+ if (processedSize < bufSize)
+ endOfFile = true;
+ }
+ CUIntVector sortedFormats;
+
+ unsigned i;
+
+ int splitIndex = -1;
+
+ for (i = 0; i < orderIndices.Size(); i++)
+ {
+ unsigned form = orderIndices[i];
+ if (skipFrontalFormat[form])
+ continue;
+ const CArcInfoEx &ai = op.codecs->Formats[form];
+ if (ai.IsSplit())
+ {
+ splitIndex = form;
+ continue;
+ }
+
+ if (ai.IsArcFunc)
+ {
+ UInt32 isArcRes = ai.IsArcFunc(byteBuffer, processedSize);
+ if (isArcRes == k_IsArc_Res_NO)
+ continue;
+ if (isArcRes == k_IsArc_Res_NEED_MORE && endOfFile)
+ continue;
+ // if (isArcRes == k_IsArc_Res_YES_LOW_PROB) continue;
+ sortedFormats.Insert(0, form);
+ continue;
+ }
+
+ bool isNewStyleSignature = IsNewStyleSignature(ai);
+ bool needCheck = !isNewStyleSignature
+ || ai.Signatures.IsEmpty()
+ || ai.Flags_PureStartOpen()
+ || ai.Flags_StartOpen()
+ || ai.Flags_BackwardOpen();
+
+ if (isNewStyleSignature && !ai.Signatures.IsEmpty())
+ {
+ unsigned k;
+ for (k = 0; k < ai.Signatures.Size(); k++)
+ {
+ const CByteBuffer &sig = ai.Signatures[k];
+ UInt32 signatureEnd = ai.SignatureOffset + (UInt32)sig.Size();
+ if (processedSize < signatureEnd)
+ {
+ if (!endOfFile)
+ needCheck = true;
+ }
+ else if (memcmp(sig, byteBuffer + ai.SignatureOffset, sig.Size()) == 0)
+ break;
+ }
+ if (k != ai.Signatures.Size())
+ {
+ sortedFormats.Insert(0, form);
+ continue;
+ }
+ }
+ if (needCheck)
+ sortedFormats.Add(form);
+ }
+
+ if (splitIndex >= 0)
+ sortedFormats.Insert(0, splitIndex);
+
+ for (i = 0; i < sortedFormats.Size(); i++)
+ {
+ FormatIndex = sortedFormats[i];
+ const CArcInfoEx &ai = op.codecs->Formats[FormatIndex];
+
+ if (op.callback)
+ RINOK(op.callback->SetTotal(NULL, &fileSize));
+
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+
+ CMyComPtr<IInArchive> archive;
+ RINOK(PrepareToOpen(op, FormatIndex, archive));
+ if (!archive)
+ continue;
+
+ PRF(printf("\nSorted Open %S", (const wchar_t *)ai.Name));
+ HRESULT result;
+ {
+ UInt64 searchLimit = 0;
+ /*
+ if (mode.CanReturnArc)
+ result = archive->Open(op.stream, &searchLimit, op.callback);
+ else
+ */
+ result = OpenArchiveSpec(archive, !mode.CanReturnArc, op.stream, &searchLimit, op.callback, extractCallback_To_OpenCallback);
+ }
+
+ if (result == S_FALSE)
+ {
+ skipFrontalFormat[(unsigned)FormatIndex] = true;
+ // FIXME: maybe we must use LenIsUnknown.
+ // printf(" OpenForSize Error");
+ continue;
+ }
+ RINOK(result);
+
+ RINOK(ReadBasicProps(archive, 0, result));
+
+ if (Offset > 0)
+ {
+ continue; // good handler doesn't return such Offset > 0
+ // but there are some cases like false prefixed PK00 archive, when
+ // we can support it?
+ }
+
+ NArchive::NParser::CParseItem pi;
+ pi.Offset = Offset;
+ pi.Size = AvailPhySize;
+
+ // bool needScan = false;
+
+ if (!PhySizeDefined)
+ {
+ // it's for Z format
+ pi.LenIsUnknown = true;
+ // needScan = true;
+ // phySize = arcRem;
+ // nextNeedCheckStartOpen = false;
+ }
+
+ /*
+ if (OkPhySize_Defined)
+ pi.OkSize = pi.OkPhySize;
+ else
+ pi.OkSize = pi.Size;
+ */
+
+ pi.NormalizeOffset();
+ // printf(" phySize = %8d", (unsigned)phySize);
+
+
+ if (mode.CanReturnArc)
+ {
+ bool isMainFormat = isMainFormatArr[(unsigned)FormatIndex];
+ const COpenSpecFlags &specFlags = mode.GetSpec(isForced, isMainFormat, isUnknownExt);
+ bool openCur = false;
+
+ if (!ErrorInfo.ThereIsTail)
+ openCur = true;
+ else
+ {
+ if (mode.ZerosTailIsAllowed)
+ {
+ RINOK(CheckZerosTail(op, Offset + PhySize));
+ if (ErrorInfo.IgnoreTail)
+ openCur = true;
+ }
+ if (!openCur)
+ {
+ openCur = specFlags.CanReturnFrontal;
+ if (formatIndex < 0) // format is not forced
+ {
+ if (IsPreArcFormat(ai))
+ {
+ // if (mode.SkipSfxStub)
+ {
+ openCur = false;
+ }
+ }
+ }
+ }
+ }
+
+ if (openCur)
+ {
+ InStream = op.stream;
+ Archive = archive;
+ return S_OK;
+ }
+ }
+
+ skipFrontalFormat[(unsigned)FormatIndex] = true;
+
+
+ // if (!mode.CanReturnArc)
+ /*
+ if (!ErrorInfo.ThereIsTail)
+ continue;
+ */
+ if (pi.Offset == 0 && !pi.LenIsUnknown && pi.Size >= FileSize)
+ continue;
+
+ // printf("\nAdd offset = %d", (int)pi.Offset);
+ RINOK(ReadParseItemProps(archive, ai, pi));
+ handlerSpec->AddItem(pi);
+ }
+ }
+
+
+
+
+
+ // ---------- PARSER ----------
+
+ CUIntVector arc2sig; // formatIndex to signatureIndex
+ CUIntVector sig2arc; // signatureIndex to formatIndex;
+ {
+ unsigned sum = 0;
+ FOR_VECTOR (i, op.codecs->Formats)
+ {
+ arc2sig.Add(sum);
+ const CObjectVector<CByteBuffer> &sigs = op.codecs->Formats[i].Signatures;
+ sum += sigs.Size();
+ FOR_VECTOR (k, sigs)
+ sig2arc.Add(i);
+ }
+ }
+
+ {
+ const size_t kBeforeSize = 1 << 16;
+ const size_t kAfterSize = 1 << 20;
+ const size_t kBufSize = 1 << 22; // it must be more than kBeforeSize + kAfterSize
+
+ const UInt32 kNumVals = (UInt32)1 << (kNumHashBytes * 8);
+ CByteArr hashBuffer(kNumVals);
+ Byte *hash = hashBuffer;
+ memset(hash, 0xFF, kNumVals);
+ Byte prevs[256];
+ memset(prevs, 0xFF, sizeof(prevs));
+ if (sig2arc.Size() >= 0xFF)
+ return S_FALSE;
+
+ CUIntVector difficultFormats;
+ CBoolArr difficultBools(256);
+ {
+ for (unsigned i = 0; i < 256; i++)
+ difficultBools[i] = false;
+ }
+
+ bool thereAreHandlersForSearch = false;
+
+ // UInt32 maxSignatureEnd = 0;
+
+ FOR_VECTOR (i, orderIndices)
+ {
+ int index = orderIndices[i];
+ if (index < 0)
+ continue;
+ const CArcInfoEx &ai = op.codecs->Formats[(unsigned)index];
+ bool isDifficult = false;
+ // if (ai.Version < 0x91F) // we don't use parser with old DLL (before 9.31)
+ if (!ai.NewInterface)
+ isDifficult = true;
+ else
+ {
+ if (ai.Flags_StartOpen())
+ isDifficult = true;
+ FOR_VECTOR (k, ai.Signatures)
+ {
+ const CByteBuffer &sig = ai.Signatures[k];
+ /*
+ UInt32 signatureEnd = ai.SignatureOffset + (UInt32)sig.Size();
+ if (maxSignatureEnd < signatureEnd)
+ maxSignatureEnd = signatureEnd;
+ */
+ if (sig.Size() < kNumHashBytes)
+ {
+ isDifficult = true;
+ continue;
+ }
+ thereAreHandlersForSearch = true;
+ UInt32 v = HASH_VAL(sig);
+ unsigned sigIndex = arc2sig[(unsigned)index] + k;
+ prevs[sigIndex] = hash[v];
+ hash[v] = (Byte)sigIndex;
+ }
+ }
+ if (isDifficult)
+ {
+ difficultFormats.Add(index);
+ difficultBools[(unsigned)index] = true;
+ }
+ }
+
+ if (!thereAreHandlersForSearch)
+ {
+ // openOnlyFullArc = true;
+ // canReturnTailArc = true;
+ }
+
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+
+ CLimitedCachedInStream *limitedStreamSpec = new CLimitedCachedInStream;
+ CMyComPtr<IInStream> limitedStream = limitedStreamSpec;
+ limitedStreamSpec->SetStream(op.stream);
+
+ CArchiveOpenCallback_Offset *openCallback_Offset_Spec = NULL;
+ CMyComPtr<IArchiveOpenCallback> openCallback_Offset;
+ if (op.callback)
+ {
+ openCallback_Offset_Spec = new CArchiveOpenCallback_Offset;
+ openCallback_Offset = openCallback_Offset_Spec;
+ openCallback_Offset_Spec->Callback = op.callback;
+ openCallback_Offset_Spec->Callback.QueryInterface(IID_IArchiveOpenVolumeCallback, &openCallback_Offset_Spec->OpenVolumeCallback);
+ #ifndef _NO_CRYPTO
+ openCallback_Offset_Spec->Callback.QueryInterface(IID_ICryptoGetTextPassword, &openCallback_Offset_Spec->GetTextPassword);
+ #endif
+ }
+
+ if (op.callback)
+ RINOK(op.callback->SetTotal(NULL, &fileSize));
+
+ CByteBuffer &byteBuffer = limitedStreamSpec->Buffer;
+ byteBuffer.Alloc(kBufSize);
+
+ UInt64 callbackPrev = 0;
+ bool needCheckStartOpen = true; // = true, if we need to test all archives types for current pos.
+
+ bool endOfFile = false;
+ UInt64 bufPhyPos = 0;
+ size_t bytesInBuf = 0;
+ // UInt64 prevPos = 0;
+
+ // ---------- Main Scan Loop ----------
+
+ UInt64 pos = 0;
+
+ if (!mode.EachPos && handlerSpec->_items.Size() == 1)
+ {
+ NArchive::NParser::CParseItem &pi = handlerSpec->_items[0];
+ if (!pi.LenIsUnknown && pi.Offset == 0)
+ pos = pi.Size;
+ }
+
+ for (;;)
+ {
+ // printf("\nPos = %d", (int)pos);
+ UInt64 posInBuf = pos - bufPhyPos;
+
+ // if (pos > ((UInt64)1 << 35)) break;
+
+ if (!endOfFile)
+ {
+ if (bytesInBuf < kBufSize)
+ {
+ size_t processedSize = kBufSize - bytesInBuf;
+ // printf("\nRead ask = %d", (unsigned)processedSize);
+ UInt64 seekPos = bufPhyPos + bytesInBuf;
+ RINOK(op.stream->Seek(bufPhyPos + bytesInBuf, STREAM_SEEK_SET, NULL));
+ RINOK(ReadStream(op.stream, byteBuffer + bytesInBuf, &processedSize));
+ // printf(" processed = %d", (unsigned)processedSize);
+ if (processedSize == 0)
+ {
+ fileSize = seekPos;
+ endOfFile = true;
+ }
+ else
+ {
+ bytesInBuf += processedSize;
+ limitedStreamSpec->SetCache(processedSize, (size_t)bufPhyPos);
+ }
+ continue;
+ }
+
+ if (bytesInBuf < posInBuf)
+ {
+ UInt64 skipSize = posInBuf - bytesInBuf;
+ if (skipSize <= kBeforeSize)
+ {
+ size_t keepSize = (size_t)(kBeforeSize - skipSize);
+ // printf("\nmemmove skip = %d", (int)keepSize);
+ memmove(byteBuffer, byteBuffer + bytesInBuf - keepSize, keepSize);
+ bytesInBuf = keepSize;
+ bufPhyPos = pos - keepSize;
+ continue;
+ }
+ // printf("\nSkip %d", (int)(skipSize - kBeforeSize));
+ // RINOK(op.stream->Seek(skipSize - kBeforeSize, STREAM_SEEK_CUR, NULL));
+ bytesInBuf = 0;
+ bufPhyPos = pos - kBeforeSize;
+ continue;
+ }
+
+ if (bytesInBuf - posInBuf < kAfterSize)
+ {
+ size_t beg = (size_t)posInBuf - kBeforeSize;
+ // printf("\nmemmove for after beg = %d", (int)beg);
+ memmove(byteBuffer, byteBuffer + beg, bytesInBuf - beg);
+ bufPhyPos += beg;
+ bytesInBuf -= beg;
+ continue;
+ }
+ }
+
+ if (bytesInBuf <= (size_t)posInBuf)
+ break;
+
+ bool useOffsetCallback = false;
+ if (openCallback_Offset)
+ {
+ openCallback_Offset_Spec->Files = handlerSpec->_items.Size();
+ openCallback_Offset_Spec->Offset = pos;
+
+ useOffsetCallback = (!op.openType.CanReturnArc || handlerSpec->_items.Size() > 1);
+
+ if (pos >= callbackPrev + (1 << 23))
+ {
+ RINOK(openCallback_Offset_Spec->SetCompleted(NULL, NULL));
+ callbackPrev = pos;
+ }
+ }
+
+ {
+ UInt64 endPos = bufPhyPos + bytesInBuf;
+ if (fileSize < endPos)
+ {
+ FileSize = fileSize; // why ????
+ fileSize = endPos;
+ }
+ }
+
+ size_t availSize = bytesInBuf - (size_t)posInBuf;
+ if (availSize < kNumHashBytes)
+ break;
+ size_t scanSize = availSize -
+ ((availSize >= kAfterSize) ? kAfterSize : kNumHashBytes);
+
+ {
+ /*
+ UInt64 scanLimit = openOnlyFullArc ?
+ maxSignatureEnd :
+ op.openType.ScanSize + maxSignatureEnd;
+ */
+ if (!mode.CanReturnParser)
+ {
+ if (pos > maxStartOffset)
+ break;
+ UInt64 remScan = maxStartOffset - pos;
+ if (scanSize > remScan)
+ scanSize = (size_t)remScan;
+ }
+ }
+
+ scanSize++;
+
+ const Byte *buf = byteBuffer + (size_t)posInBuf;
+ const Byte *bufLimit = buf + scanSize;
+ size_t ppp = 0;
+
+ if (!needCheckStartOpen)
+ {
+ for (; buf < bufLimit && hash[HASH_VAL(buf)] == 0xFF; buf++);
+ ppp = buf - (byteBuffer + (size_t)posInBuf);
+ pos += ppp;
+ if (buf == bufLimit)
+ continue;
+ }
+
+ UInt32 v = HASH_VAL(buf);
+ bool nextNeedCheckStartOpen = true;
+ unsigned i = hash[v];
+ unsigned indexOfDifficult = 0;
+
+ // ---------- Open Loop for Current Pos ----------
+ bool wasOpen = false;
+
+ for (;;)
+ {
+ unsigned index;
+ bool isDifficult;
+ if (needCheckStartOpen && indexOfDifficult < difficultFormats.Size())
+ {
+ index = difficultFormats[indexOfDifficult++];
+ isDifficult = true;
+ }
+ else
+ {
+ if (i == 0xFF)
+ break;
+ index = sig2arc[i];
+ unsigned sigIndex = i - arc2sig[index];
+ i = prevs[i];
+ if (needCheckStartOpen && difficultBools[index])
+ continue;
+ const CArcInfoEx &ai = op.codecs->Formats[index];
+
+ if (pos < ai.SignatureOffset)
+ continue;
+
+ /*
+ if (openOnlyFullArc)
+ if (pos != ai.SignatureOffset)
+ continue;
+ */
+
+ const CByteBuffer &sig = ai.Signatures[sigIndex];
+
+ if (ppp + sig.Size() > availSize
+ || !TestSignature(buf, sig, sig.Size()))
+ continue;
+ // printf("\nSignature OK: %10S %8x %5d", (const wchar_t *)ai.Name, (int)pos, (int)(pos - prevPos));
+ // prevPos = pos;
+ isDifficult = false;
+ }
+
+ const CArcInfoEx &ai = op.codecs->Formats[index];
+
+
+ if ((isDifficult && pos == 0) || ai.SignatureOffset == pos)
+ {
+ // we don't check same archive second time */
+ if (skipFrontalFormat[index])
+ continue;
+ }
+
+ UInt64 startArcPos = pos;
+ if (!isDifficult)
+ {
+ if (pos < ai.SignatureOffset)
+ continue;
+ startArcPos = pos - ai.SignatureOffset;
+ /*
+ // we don't need the check for Z files
+ if (startArcPos < handlerSpec->GetLastEnd())
+ continue;
+ */
+ }
+
+ if (ai.IsArcFunc && startArcPos >= bufPhyPos)
+ {
+ size_t offsetInBuf = (size_t)(startArcPos - bufPhyPos);
+ if (offsetInBuf < bytesInBuf)
+ {
+ UInt32 isArcRes = ai.IsArcFunc(byteBuffer + offsetInBuf, bytesInBuf - offsetInBuf);
+ if (isArcRes == k_IsArc_Res_NO)
+ continue;
+ if (isArcRes == k_IsArc_Res_NEED_MORE && endOfFile)
+ continue;
+ /*
+ if (isArcRes == k_IsArc_Res_YES_LOW_PROB)
+ {
+ // if (pos != ai.SignatureOffset)
+ continue;
+ }
+ */
+ }
+ // printf("\nIsArc OK: %S", (const wchar_t *)ai.Name);
+ }
+
+ /*
+ if (pos == 67109888)
+ pos = pos;
+ */
+ PRF(printf("\npos = %9I64d : %S", pos, (const wchar_t *)ai.Name));
+
+ bool isMainFormat = isMainFormatArr[index];
+ const COpenSpecFlags &specFlags = mode.GetSpec(isForced, isMainFormat, isUnknownExt);
+
+ CMyComPtr<IInArchive> archive;
+ RINOK(PrepareToOpen(op, index, archive));
+ if (!archive)
+ return E_FAIL;
+
+ // OutputDebugStringW(ai.Name);
+
+ UInt64 rem = fileSize - startArcPos;
+
+ UInt64 arcStreamOffset = 0;
+
+ if (ai.Flags_UseGlobalOffset())
+ {
+ limitedStreamSpec->InitAndSeek(0, fileSize);
+ limitedStream->Seek(startArcPos, STREAM_SEEK_SET, NULL);
+ }
+ else
+ {
+ limitedStreamSpec->InitAndSeek(startArcPos, rem);
+ arcStreamOffset = startArcPos;
+ }
+
+ UInt64 maxCheckStartPosition = 0;
+
+ if (openCallback_Offset)
+ {
+ openCallback_Offset_Spec->Files = handlerSpec->_items.Size();
+ openCallback_Offset_Spec->Offset = startArcPos;
+ }
+
+ // HRESULT result = archive->Open(limitedStream, &maxCheckStartPosition, openCallback_Offset);
+ extractCallback_To_OpenCallback_Spec->Files = 0;
+ extractCallback_To_OpenCallback_Spec->Offset = startArcPos;
+
+ HRESULT result = OpenArchiveSpec(archive, true, limitedStream, &maxCheckStartPosition,
+ useOffsetCallback ? (IArchiveOpenCallback *)openCallback_Offset : (IArchiveOpenCallback *)op.callback,
+ extractCallback_To_OpenCallback);
+
+ RINOK(ReadBasicProps(archive, ai.Flags_UseGlobalOffset() ? 0 : startArcPos, result));
+
+ bool isOpen = false;
+ if (result == S_FALSE)
+ {
+ if (!mode.CanReturnParser)
+ {
+ if (formatIndex < 0 && ErrorInfo.IsArc_After_NonOpen())
+ {
+ ErrorInfo.ErrorFormatIndex = index;
+ NonOpen_ErrorInfo = ErrorInfo;
+ // if archive was detected, we don't need additional open attempts
+ return S_FALSE;
+ }
+ continue;
+ }
+ if (!ErrorInfo.IsArc_After_NonOpen() || !PhySizeDefined || PhySize == 0)
+ continue;
+ }
+ else
+ {
+ isOpen = true;
+ RINOK(result);
+ PRF(printf(" OK "));
+ }
+
+ // fprintf(stderr, "\n %8X %S", startArcPos, Path);
+ // printf("\nOpen OK: %S", ai.Name);
+
+
+ NArchive::NParser::CParseItem pi;
+ pi.Offset = startArcPos;
+
+ if (ai.Flags_UseGlobalOffset())
+ pi.Offset = Offset;
+ else if (Offset != 0)
+ return E_FAIL;
+ UInt64 arcRem = FileSize - pi.Offset;
+ UInt64 phySize = arcRem;
+ bool phySizeDefined = PhySizeDefined;
+ if (phySizeDefined)
+ {
+ if (pi.Offset + PhySize > FileSize)
+ {
+ // ErrorInfo.ThereIsTail = true;
+ PhySize = FileSize - pi.Offset;
+ }
+ phySize = PhySize;
+ }
+ if (phySize == 0 || (UInt64)phySize > ((UInt64)1 << 63))
+ return E_FAIL;
+
+ /*
+ if (!ai.UseGlobalOffset)
+ {
+ if (phySize > arcRem)
+ {
+ ThereIsTail = true;
+ phySize = arcRem;
+ }
+ }
+ */
+
+ bool needScan = false;
+
+
+ if (isOpen && !phySizeDefined)
+ {
+ // it's for Z format
+ pi.LenIsUnknown = true;
+ needScan = true;
+ phySize = arcRem;
+ nextNeedCheckStartOpen = false;
+ }
+
+ pi.Size = phySize;
+ /*
+ if (OkPhySize_Defined)
+ pi.OkSize = OkPhySize;
+ */
+ pi.NormalizeOffset();
+ // printf(" phySize = %8d", (unsigned)phySize);
+
+ /*
+ if (needSkipFullArc)
+ if (pi.Offset == 0 && phySizeDefined && pi.Size >= fileSize)
+ continue;
+ */
+ if (pi.Offset == 0 && !pi.LenIsUnknown && pi.Size >= FileSize)
+ {
+ // it's possible for dmg archives
+ if (!mode.CanReturnArc)
+ continue;
+ }
+
+ if (mode.EachPos)
+ pos++;
+ else if (needScan)
+ {
+ pos++;
+ /*
+ if (!OkPhySize_Defined)
+ pos++;
+ else
+ pos = pi.Offset + pi.OkSize;
+ */
+ }
+ else
+ pos = pi.Offset + pi.Size;
+
+
+ RINOK(ReadParseItemProps(archive, ai, pi));
+
+ if (pi.Offset < startArcPos && !mode.EachPos /* && phySizeDefined */)
+ {
+ /* It's for DMG format.
+ This code deletes all previous items that are included to current item */
+
+ while (!handlerSpec->_items.IsEmpty())
+ {
+ {
+ const NArchive::NParser::CParseItem &back = handlerSpec->_items.Back();
+ if (back.Offset < pi.Offset)
+ break;
+ if (back.Offset + back.Size > pi.Offset + pi.Size)
+ break;
+ }
+ handlerSpec->_items.DeleteBack();
+ }
+ }
+
+
+ if (isOpen && mode.CanReturnArc && phySizeDefined)
+ {
+ // if (pi.Offset + pi.Size >= fileSize)
+ bool openCur = false;
+
+ bool thereIsTail = ErrorInfo.ThereIsTail;
+ if (thereIsTail && mode.ZerosTailIsAllowed)
+ {
+ RINOK(CheckZerosTail(op, arcStreamOffset + Offset + PhySize));
+ if (ErrorInfo.IgnoreTail)
+ thereIsTail = false;
+ }
+
+ if (pi.Offset != 0)
+ {
+ if (!pi.IsNotArcType)
+ if (thereIsTail)
+ openCur = specFlags.CanReturnMid;
+ else
+ openCur = specFlags.CanReturnTail;
+ }
+ else
+ {
+ if (!thereIsTail)
+ openCur = true;
+ else
+ openCur = specFlags.CanReturnFrontal;
+
+
+ if (formatIndex >= -2)
+ openCur = true;
+ }
+ if (formatIndex < 0 && pi.IsSelfExe /* && mode.SkipSfxStub */)
+ openCur = false;
+
+ // We open file as SFX, if there is front archive or first archive is "Self Executable"
+ if (!openCur && !pi.IsSelfExe && !thereIsTail &&
+ (!pi.IsNotArcType || pi.Offset == 0))
+ {
+ if (handlerSpec->_items.IsEmpty())
+ {
+ if (specFlags.CanReturnTail)
+ openCur = true;
+ }
+ else if (handlerSpec->_items.Size() == 1)
+ {
+ if (handlerSpec->_items[0].IsSelfExe)
+ {
+ if (mode.SpecUnknownExt.CanReturnTail)
+ openCur = true;
+ }
+ }
+ }
+
+ if (openCur)
+ {
+ InStream = op.stream;
+ Archive = archive;
+ FormatIndex = index;
+ ArcStreamOffset = arcStreamOffset;
+ return S_OK;
+ }
+ }
+
+ /*
+ if (openOnlyFullArc)
+ {
+ ErrorInfo.ClearErrors();
+ return S_FALSE;
+ }
+ */
+
+ pi.FormatIndex = index;
+
+ // printf("\nAdd offset = %d", (int)pi.Offset);
+ handlerSpec->AddItem(pi);
+ wasOpen = true;
+ break;
+ }
+ // ---------- End of Open Loop for Current Pos ----------
+
+ if (!wasOpen)
+ pos++;
+ needCheckStartOpen = (nextNeedCheckStartOpen && wasOpen);
+ }
+ // ---------- End of Main Scan Loop ----------
+
+ /*
+ if (handlerSpec->_items.Size() == 1)
+ {
+ const NArchive::NParser::CParseItem &pi = handlerSpec->_items[0];
+ if (pi.Size == fileSize && pi.Offset == 0)
+ {
+ Archive = archive;
+ FormatIndex2 = pi.FormatIndex;
+ return S_OK;
+ }
+ }
+ */
+
+ if (mode.CanReturnParser)
+ {
+ bool returnParser = (handlerSpec->_items.Size() == 1); // it's possible if fileSize was not correct at start of parsing
+ handlerSpec->AddUnknownItem(fileSize);
+ if (handlerSpec->_items.Size() == 0)
+ return S_FALSE;
+ if (returnParser || handlerSpec->_items.Size() != 1)
+ {
+ // return S_FALSE;
+ handlerSpec->_stream = op.stream;
+ Archive = handler;
+ ErrorInfo.ClearErrors();
+ IsParseArc = true;
+ FormatIndex = -1; // It's parser
+ Offset = 0;
+ return S_OK;
+ }
+ }
+ }
+
+ #endif
+
+ if (!Archive)
+ return S_FALSE;
+ return S_OK;
+}
+
+HRESULT CArc::OpenStream(const COpenOptions &op)
+{
+ RINOK(OpenStream2(op));
+ // PrintNumber("op.formatIndex 3", op.formatIndex);
+
+ if (Archive)
+ {
+ GetRawProps.Release();
+ GetRootProps.Release();
+ Archive->QueryInterface(IID_IArchiveGetRawProps, (void **)&GetRawProps);
+ Archive->QueryInterface(IID_IArchiveGetRootProps, (void **)&GetRootProps);
+
+ RINOK(Archive_GetArcBoolProp(Archive, kpidIsTree, IsTree));
+ RINOK(Archive_GetArcBoolProp(Archive, kpidIsDeleted, Ask_Deleted));
+ RINOK(Archive_GetArcBoolProp(Archive, kpidIsAltStream, Ask_AltStream));
+ RINOK(Archive_GetArcBoolProp(Archive, kpidIsAux, Ask_Aux));
+ RINOK(Archive_GetArcBoolProp(Archive, kpidINode, Ask_INode));
+ RINOK(Archive_GetArcBoolProp(Archive, kpidReadOnly, IsReadOnly));
+
+ const UString fileName = ExtractFileNameFromPath(Path);
+ UString extension;
+ {
+ int dotPos = fileName.ReverseFind_Dot();
+ if (dotPos >= 0)
+ extension = fileName.Ptr(dotPos + 1);
+ }
+
+ DefaultName.Empty();
+ if (FormatIndex >= 0)
+ {
+ const CArcInfoEx &ai = op.codecs->Formats[FormatIndex];
+ if (ai.Exts.Size() == 0)
+ DefaultName = GetDefaultName2(fileName, UString(), UString());
+ else
+ {
+ int subExtIndex = ai.FindExtension(extension);
+ if (subExtIndex < 0)
+ subExtIndex = 0;
+ const CArcExtInfo &extInfo = ai.Exts[subExtIndex];
+ DefaultName = GetDefaultName2(fileName, extInfo.Ext, extInfo.AddExt);
+ }
+ }
+ }
+
+ return S_OK;
+}
+
+#ifdef _SFX
+
+#ifdef _WIN32
+ #define k_ExeExt ".exe"
+ static const unsigned k_ExeExt_Len = 4;
+#else
+ #define k_ExeExt ""
+ static const unsigned k_ExeExt_Len = 0;
+#endif
+
+#endif
+
+HRESULT CArc::OpenStreamOrFile(COpenOptions &op)
+{
+ CMyComPtr<IInStream> fileStream;
+ CMyComPtr<ISequentialInStream> seqStream;
+ CInFileStream *fileStreamSpec = NULL;
+
+ if (op.stdInMode)
+ {
+ seqStream = new CStdInFileStream;
+ op.seqStream = seqStream;
+ }
+ else if (!op.stream)
+ {
+ fileStreamSpec = new CInFileStream;
+ fileStream = fileStreamSpec;
+ Path = filePath;
+ if (!fileStreamSpec->Open(us2fs(Path)))
+ {
+ return GetLastError();
+ }
+ op.stream = fileStream;
+ #ifdef _SFX
+ IgnoreSplit = true;
+ #endif
+ }
+
+ /*
+ if (callback)
+ {
+ UInt64 fileSize;
+ RINOK(op.stream->Seek(0, STREAM_SEEK_END, &fileSize));
+ RINOK(op.callback->SetTotal(NULL, &fileSize))
+ }
+ */
+
+ HRESULT res = OpenStream(op);
+ IgnoreSplit = false;
+
+ #ifdef _SFX
+
+ if (res != S_FALSE
+ || !fileStreamSpec
+ || !op.callbackSpec
+ || NonOpen_ErrorInfo.IsArc_After_NonOpen())
+ return res;
+
+ {
+ if (filePath.Len() > k_ExeExt_Len
+ && StringsAreEqualNoCase_Ascii(filePath.RightPtr(k_ExeExt_Len), k_ExeExt))
+ {
+ const UString path2 = filePath.Left(filePath.Len() - k_ExeExt_Len);
+ FOR_VECTOR (i, op.codecs->Formats)
+ {
+ const CArcInfoEx &ai = op.codecs->Formats[i];
+ if (ai.IsSplit())
+ continue;
+ UString path3 = path2;
+ path3 += '.';
+ path3 += ai.GetMainExt(); // "7z" for SFX.
+ Path = path3;
+ Path += ".001";
+ bool isOk = op.callbackSpec->SetSecondFileInfo(us2fs(Path));
+ if (!isOk)
+ {
+ Path = path3;
+ isOk = op.callbackSpec->SetSecondFileInfo(us2fs(Path));
+ }
+ if (isOk)
+ {
+ if (fileStreamSpec->Open(us2fs(Path)))
+ {
+ op.stream = fileStream;
+ NonOpen_ErrorInfo.ClearErrors_Full();
+ if (OpenStream(op) == S_OK)
+ return S_OK;
+ }
+ }
+ }
+ }
+ }
+
+ #endif
+
+ return res;
+}
+
+void CArchiveLink::KeepModeForNextOpen()
+{
+ for (unsigned i = Arcs.Size(); i != 0;)
+ {
+ i--;
+ CMyComPtr<IArchiveKeepModeForNextOpen> keep;
+ Arcs[i].Archive->QueryInterface(IID_IArchiveKeepModeForNextOpen, (void **)&keep);
+ if (keep)
+ keep->KeepModeForNextOpen();
+ }
+}
+
+HRESULT CArchiveLink::Close()
+{
+ for (unsigned i = Arcs.Size(); i != 0;)
+ {
+ i--;
+ RINOK(Arcs[i].Close());
+ }
+ IsOpen = false;
+ // ErrorsText.Empty();
+ return S_OK;
+}
+
+void CArchiveLink::Release()
+{
+ // NonOpenErrorFormatIndex = -1;
+ NonOpen_ErrorInfo.ClearErrors();
+ NonOpen_ArcPath.Empty();
+ while (!Arcs.IsEmpty())
+ Arcs.DeleteBack();
+}
+
+/*
+void CArchiveLink::Set_ErrorsText()
+{
+ FOR_VECTOR(i, Arcs)
+ {
+ const CArc &arc = Arcs[i];
+ if (!arc.ErrorFlagsText.IsEmpty())
+ {
+ if (!ErrorsText.IsEmpty())
+ ErrorsText.Add_LF();
+ ErrorsText += GetUnicodeString(arc.ErrorFlagsText);
+ }
+ if (!arc.ErrorMessage.IsEmpty())
+ {
+ if (!ErrorsText.IsEmpty())
+ ErrorsText.Add_LF();
+ ErrorsText += arc.ErrorMessage;
+ }
+
+ if (!arc.WarningMessage.IsEmpty())
+ {
+ if (!ErrorsText.IsEmpty())
+ ErrorsText.Add_LF();
+ ErrorsText += arc.WarningMessage;
+ }
+ }
+}
+*/
+
+HRESULT CArchiveLink::Open(COpenOptions &op)
+{
+ Release();
+ if (op.types->Size() >= 32)
+ return E_NOTIMPL;
+
+ HRESULT resSpec;
+
+ for (;;)
+ {
+ resSpec = S_OK;
+
+ op.openType = COpenType();
+ if (op.types->Size() >= 1)
+ {
+ COpenType latest;
+ if (Arcs.Size() < op.types->Size())
+ latest = (*op.types)[op.types->Size() - Arcs.Size() - 1];
+ else
+ {
+ latest = (*op.types)[0];
+ if (!latest.Recursive)
+ break;
+ }
+ op.openType = latest;
+ }
+ else if (Arcs.Size() >= 32)
+ break;
+
+ /*
+ op.formatIndex = -1;
+ if (op.types->Size() >= 1)
+ {
+ int latest;
+ if (Arcs.Size() < op.types->Size())
+ latest = (*op.types)[op.types->Size() - Arcs.Size() - 1];
+ else
+ {
+ latest = (*op.types)[0];
+ if (latest != -2 && latest != -3)
+ break;
+ }
+ if (latest >= 0)
+ op.formatIndex = latest;
+ else if (latest == -1 || latest == -2)
+ {
+ // default
+ }
+ else if (latest == -3)
+ op.formatIndex = -2;
+ else
+ op.formatIndex = latest + 2;
+ }
+ else if (Arcs.Size() >= 32)
+ break;
+ */
+
+ if (Arcs.IsEmpty())
+ {
+ CArc arc;
+ arc.filePath = op.filePath;
+ arc.Path = op.filePath;
+ arc.SubfileIndex = (UInt32)(Int32)-1;
+ HRESULT result = arc.OpenStreamOrFile(op);
+ if (result != S_OK)
+ {
+ if (result == S_FALSE)
+ {
+ NonOpen_ErrorInfo = arc.NonOpen_ErrorInfo;
+ // NonOpenErrorFormatIndex = arc.ErrorFormatIndex;
+ NonOpen_ArcPath = arc.Path;
+ }
+ return result;
+ }
+ Arcs.Add(arc);
+ continue;
+ }
+
+ // PrintNumber("op.formatIndex 11", op.formatIndex);
+
+ const CArc &arc = Arcs.Back();
+
+ if (op.types->Size() > Arcs.Size())
+ resSpec = E_NOTIMPL;
+
+ UInt32 mainSubfile;
+ {
+ NCOM::CPropVariant prop;
+ RINOK(arc.Archive->GetArchiveProperty(kpidMainSubfile, &prop));
+ if (prop.vt == VT_UI4)
+ mainSubfile = prop.ulVal;
+ else
+ break;
+ UInt32 numItems;
+ RINOK(arc.Archive->GetNumberOfItems(&numItems));
+ if (mainSubfile >= numItems)
+ break;
+ }
+
+
+ CMyComPtr<IInArchiveGetStream> getStream;
+ if (arc.Archive->QueryInterface(IID_IInArchiveGetStream, (void **)&getStream) != S_OK || !getStream)
+ break;
+
+ CMyComPtr<ISequentialInStream> subSeqStream;
+ if (getStream->GetStream(mainSubfile, &subSeqStream) != S_OK || !subSeqStream)
+ break;
+
+ CMyComPtr<IInStream> subStream;
+ if (subSeqStream.QueryInterface(IID_IInStream, &subStream) != S_OK || !subStream)
+ break;
+
+ CArc arc2;
+ RINOK(arc.GetItemPath(mainSubfile, arc2.Path));
+
+ bool zerosTailIsAllowed;
+ RINOK(Archive_GetItemBoolProp(arc.Archive, mainSubfile, kpidZerosTailIsAllowed, zerosTailIsAllowed));
+
+
+ if (op.callback)
+ {
+ CMyComPtr<IArchiveOpenSetSubArchiveName> setSubArchiveName;
+ op.callback->QueryInterface(IID_IArchiveOpenSetSubArchiveName, (void **)&setSubArchiveName);
+ if (setSubArchiveName)
+ setSubArchiveName->SetSubArchiveName(arc2.Path);
+ }
+
+ arc2.SubfileIndex = mainSubfile;
+
+ // CIntVector incl;
+ CIntVector excl;
+
+ COpenOptions op2;
+ #ifndef _SFX
+ op2.props = op.props;
+ #endif
+ op2.codecs = op.codecs;
+ // op2.types = &incl;
+ op2.openType = op.openType;
+ op2.openType.ZerosTailIsAllowed = zerosTailIsAllowed;
+ op2.excludedFormats = &excl;
+ op2.stdInMode = false;
+ op2.stream = subStream;
+ op2.filePath = arc2.Path;
+ op2.callback = op.callback;
+ op2.callbackSpec = op.callbackSpec;
+
+
+ HRESULT result = arc2.OpenStream(op2);
+ resSpec = (op.types->Size() == 0 ? S_OK : S_FALSE);
+ if (result == S_FALSE)
+ {
+ NonOpen_ErrorInfo = arc2.ErrorInfo;
+ NonOpen_ArcPath = arc2.Path;
+ break;
+ }
+ RINOK(result);
+ RINOK(arc.GetItemMTime(mainSubfile, arc2.MTime, arc2.MTimeDefined));
+ Arcs.Add(arc2);
+ }
+ IsOpen = !Arcs.IsEmpty();
+ return resSpec;
+}
+
+HRESULT CArchiveLink::Open2(COpenOptions &op, IOpenCallbackUI *callbackUI)
+{
+ VolumesSize = 0;
+ COpenCallbackImp *openCallbackSpec = new COpenCallbackImp;
+ CMyComPtr<IArchiveOpenCallback> callback = openCallbackSpec;
+ openCallbackSpec->Callback = callbackUI;
+
+ FString prefix, name;
+
+ if (!op.stream && !op.stdInMode)
+ {
+ NFile::NDir::GetFullPathAndSplit(us2fs(op.filePath), prefix, name);
+ openCallbackSpec->Init(prefix, name);
+ }
+ else
+ {
+ openCallbackSpec->SetSubArchiveName(op.filePath);
+ }
+
+ op.callback = callback;
+ op.callbackSpec = openCallbackSpec;
+
+ HRESULT res = Open(op);
+
+ PasswordWasAsked = openCallbackSpec->PasswordWasAsked;
+ // Password = openCallbackSpec->Password;
+
+ RINOK(res);
+ // VolumePaths.Add(fs2us(prefix + name));
+
+ FOR_VECTOR (i, openCallbackSpec->FileNames_WasUsed)
+ {
+ if (openCallbackSpec->FileNames_WasUsed[i])
+ {
+ VolumePaths.Add(fs2us(prefix) + openCallbackSpec->FileNames[i]);
+ VolumesSize += openCallbackSpec->FileSizes[i];
+ }
+ }
+ // VolumesSize = openCallbackSpec->TotalSize;
+ return S_OK;
+}
+
+HRESULT CArc::ReOpen(const COpenOptions &op)
+{
+ ErrorInfo.ClearErrors();
+ ErrorInfo.ErrorFormatIndex = -1;
+
+ UInt64 fileSize = 0;
+ if (op.stream)
+ {
+ RINOK(op.stream->Seek(0, STREAM_SEEK_END, &fileSize));
+ RINOK(op.stream->Seek(0, STREAM_SEEK_SET, NULL));
+ }
+ FileSize = fileSize;
+
+ CMyComPtr<IInStream> stream2;
+ Int64 globalOffset = GetGlobalOffset();
+ if (globalOffset <= 0)
+ stream2 = op.stream;
+ else
+ {
+ CTailInStream *tailStreamSpec = new CTailInStream;
+ stream2 = tailStreamSpec;
+ tailStreamSpec->Stream = op.stream;
+ tailStreamSpec->Offset = globalOffset;
+ tailStreamSpec->Init();
+ RINOK(tailStreamSpec->SeekToStart());
+ }
+
+ // There are archives with embedded STUBs (like ZIP), so we must support signature scanning
+ // But for another archives we can use 0 here. So the code can be fixed !!!
+ UInt64 maxStartPosition = kMaxCheckStartPosition;
+ HRESULT res = Archive->Open(stream2, &maxStartPosition, op.callback);
+
+ if (res == S_OK)
+ {
+ RINOK(ReadBasicProps(Archive, globalOffset, res));
+ ArcStreamOffset = globalOffset;
+ if (ArcStreamOffset != 0)
+ InStream = op.stream;
+ }
+ return res;
+}
+
+HRESULT CArchiveLink::Open3(COpenOptions &op, IOpenCallbackUI *callbackUI)
+{
+ HRESULT res = Open2(op, callbackUI);
+ if (callbackUI)
+ {
+ RINOK(callbackUI->Open_Finished());
+ }
+ return res;
+}
+
+HRESULT CArchiveLink::ReOpen(COpenOptions &op)
+{
+ if (Arcs.Size() > 1)
+ return E_NOTIMPL;
+
+ CObjectVector<COpenType> inc;
+ CIntVector excl;
+
+ op.types = &inc;
+ op.excludedFormats = &excl;
+ op.stdInMode = false;
+ op.stream = NULL;
+ if (Arcs.Size() == 0) // ???
+ return Open2(op, NULL);
+
+ COpenCallbackImp *openCallbackSpec = new COpenCallbackImp;
+ CMyComPtr<IArchiveOpenCallback> openCallbackNew = openCallbackSpec;
+
+ openCallbackSpec->Callback = NULL;
+ openCallbackSpec->ReOpenCallback = op.callback;
+ {
+ FString dirPrefix, fileName;
+ NFile::NDir::GetFullPathAndSplit(us2fs(op.filePath), dirPrefix, fileName);
+ openCallbackSpec->Init(dirPrefix, fileName);
+ }
+
+
+ CInFileStream *fileStreamSpec = new CInFileStream;
+ CMyComPtr<IInStream> stream(fileStreamSpec);
+ if (!fileStreamSpec->Open(us2fs(op.filePath)))
+ return GetLastError();
+ op.stream = stream;
+
+ CArc &arc = Arcs[0];
+ HRESULT res = arc.ReOpen(op);
+
+ PasswordWasAsked = openCallbackSpec->PasswordWasAsked;
+ // Password = openCallbackSpec->Password;
+
+ IsOpen = (res == S_OK);
+ return res;
+}
+
+#ifndef _SFX
+
+bool ParseComplexSize(const wchar_t *s, UInt64 &result)
+{
+ result = 0;
+ const wchar_t *end;
+ UInt64 number = ConvertStringToUInt64(s, &end);
+ if (end == s)
+ return false;
+ if (*end == 0)
+ {
+ result = number;
+ return true;
+ }
+ if (end[1] != 0)
+ return false;
+ unsigned numBits;
+ switch (MyCharLower_Ascii(*end))
+ {
+ case 'b': result = number; return true;
+ case 'k': numBits = 10; break;
+ case 'm': numBits = 20; break;
+ case 'g': numBits = 30; break;
+ case 't': numBits = 40; break;
+ default: return false;
+ }
+ if (number >= ((UInt64)1 << (64 - numBits)))
+ return false;
+ result = number << numBits;
+ return true;
+}
+
+static bool ParseTypeParams(const UString &s, COpenType &type)
+{
+ if (s[0] == 0)
+ return true;
+ if (s[1] == 0)
+ {
+ switch ((unsigned)(Byte)s[0])
+ {
+ case 'e': type.EachPos = true; return true;
+ case 'a': type.CanReturnArc = true; return true;
+ case 'r': type.Recursive = true; return true;
+ }
+ return false;
+ }
+ if (s[0] == 's')
+ {
+ UInt64 result;
+ if (!ParseComplexSize(s.Ptr(1), result))
+ return false;
+ type.MaxStartOffset = result;
+ type.MaxStartOffset_Defined = true;
+ return true;
+ }
+
+ return false;
+}
+
+bool ParseType(CCodecs &codecs, const UString &s, COpenType &type)
+{
+ int pos2 = s.Find(L':');
+
+ {
+ UString name;
+ if (pos2 < 0)
+ {
+ name = s;
+ pos2 = s.Len();
+ }
+ else
+ {
+ name = s.Left(pos2);
+ pos2++;
+ }
+
+ int index = codecs.FindFormatForArchiveType(name);
+ type.Recursive = false;
+
+ if (index < 0)
+ {
+ if (name[0] == '*')
+ {
+ if (name[1] != 0)
+ return false;
+ }
+ else if (name[0] == '#')
+ {
+ if (name[1] != 0)
+ return false;
+ type.CanReturnArc = false;
+ type.CanReturnParser = true;
+ }
+ else
+ return false;
+ }
+
+ type.FormatIndex = index;
+
+ }
+
+ for (unsigned i = pos2; i < s.Len();)
+ {
+ int next = s.Find(L':', i);
+ if (next < 0)
+ next = s.Len();
+ const UString name = s.Mid(i, next - i);
+ if (name.IsEmpty())
+ return false;
+ if (!ParseTypeParams(name, type))
+ return false;
+ i = next + 1;
+ }
+
+ return true;
+}
+
+bool ParseOpenTypes(CCodecs &codecs, const UString &s, CObjectVector<COpenType> &types)
+{
+ types.Clear();
+ for (unsigned pos = 0; pos < s.Len();)
+ {
+ int pos2 = s.Find(L'.', pos);
+ if (pos2 < 0)
+ pos2 = s.Len();
+ UString name = s.Mid(pos, pos2 - pos);
+ if (name.IsEmpty())
+ return false;
+ COpenType type;
+ if (!ParseType(codecs, name, type))
+ return false;
+ types.Add(type);
+ pos = pos2 + 1;
+ }
+ return true;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.h
new file mode 100644
index 0000000000..033cb960f3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/OpenArchive.h
@@ -0,0 +1,436 @@
+// OpenArchive.h
+
+#ifndef __OPEN_ARCHIVE_H
+#define __OPEN_ARCHIVE_H
+
+#include "../../../Windows/PropVariant.h"
+
+#include "ArchiveOpenCallback.h"
+#include "LoadCodecs.h"
+#include "Property.h"
+
+#ifndef _SFX
+
+#define SUPPORT_ALT_STREAMS
+
+#endif
+
+HRESULT Archive_GetItemBoolProp(IInArchive *arc, UInt32 index, PROPID propID, bool &result) throw();
+HRESULT Archive_IsItem_Dir(IInArchive *arc, UInt32 index, bool &result) throw();
+HRESULT Archive_IsItem_Aux(IInArchive *arc, UInt32 index, bool &result) throw();
+HRESULT Archive_IsItem_AltStream(IInArchive *arc, UInt32 index, bool &result) throw();
+HRESULT Archive_IsItem_Deleted(IInArchive *arc, UInt32 index, bool &deleted) throw();
+
+#ifdef SUPPORT_ALT_STREAMS
+int FindAltStreamColon_in_Path(const wchar_t *path);
+#endif
+
+/*
+struct COptionalOpenProperties
+{
+ UString FormatName;
+ CObjectVector<CProperty> Props;
+};
+*/
+
+#ifdef _SFX
+#define OPEN_PROPS_DECL
+#else
+#define OPEN_PROPS_DECL const CObjectVector<CProperty> *props;
+// #define OPEN_PROPS_DECL , const CObjectVector<COptionalOpenProperties> *props
+#endif
+
+struct COpenSpecFlags
+{
+ // bool CanReturnFull;
+ bool CanReturnFrontal;
+ bool CanReturnTail;
+ bool CanReturnMid;
+
+ bool CanReturn_NonStart() const { return CanReturnTail || CanReturnMid; }
+
+ COpenSpecFlags():
+ // CanReturnFull(true),
+ CanReturnFrontal(false),
+ CanReturnTail(false),
+ CanReturnMid(false)
+ {}
+};
+
+struct COpenType
+{
+ int FormatIndex;
+
+ COpenSpecFlags SpecForcedType;
+ COpenSpecFlags SpecMainType;
+ COpenSpecFlags SpecWrongExt;
+ COpenSpecFlags SpecUnknownExt;
+
+ bool Recursive;
+
+ bool CanReturnArc;
+ bool CanReturnParser;
+ bool EachPos;
+
+ // bool SkipSfxStub;
+ // bool ExeAsUnknown;
+
+ bool ZerosTailIsAllowed;
+
+ bool MaxStartOffset_Defined;
+ UInt64 MaxStartOffset;
+
+ const COpenSpecFlags &GetSpec(bool isForced, bool isMain, bool isUnknown) const
+ {
+ return isForced ? SpecForcedType : (isMain ? SpecMainType : (isUnknown ? SpecUnknownExt : SpecWrongExt));
+ }
+
+ COpenType():
+ FormatIndex(-1),
+ Recursive(true),
+ EachPos(false),
+ CanReturnArc(true),
+ CanReturnParser(false),
+ // SkipSfxStub(true),
+ // ExeAsUnknown(true),
+ ZerosTailIsAllowed(false),
+ MaxStartOffset_Defined(false),
+ MaxStartOffset(0)
+ {
+ SpecForcedType.CanReturnFrontal = true;
+ SpecForcedType.CanReturnTail = true;
+ SpecForcedType.CanReturnMid = true;
+
+ SpecMainType.CanReturnFrontal = true;
+
+ SpecUnknownExt.CanReturnTail = true; // for sfx
+ SpecUnknownExt.CanReturnMid = true;
+ SpecUnknownExt.CanReturnFrontal = true; // for alt streams of sfx with pad
+
+ // ZerosTailIsAllowed = true;
+ }
+};
+
+struct COpenOptions
+{
+ CCodecs *codecs;
+ COpenType openType;
+ const CObjectVector<COpenType> *types;
+ const CIntVector *excludedFormats;
+
+ IInStream *stream;
+ ISequentialInStream *seqStream;
+ IArchiveOpenCallback *callback;
+ COpenCallbackImp *callbackSpec;
+ OPEN_PROPS_DECL
+ // bool openOnlySpecifiedByExtension,
+
+ bool stdInMode;
+ UString filePath;
+
+ COpenOptions():
+ codecs(NULL),
+ types(NULL),
+ excludedFormats(NULL),
+ stream(NULL),
+ seqStream(NULL),
+ callback(NULL),
+ callbackSpec(NULL),
+ stdInMode(false)
+ {}
+
+};
+
+UInt32 GetOpenArcErrorFlags(const NWindows::NCOM::CPropVariant &prop, bool *isDefinedProp = NULL);
+
+struct CArcErrorInfo
+{
+ bool ThereIsTail;
+ bool UnexpecedEnd;
+ bool IgnoreTail; // all are zeros
+ // bool NonZerosTail;
+ bool ErrorFlags_Defined;
+ UInt32 ErrorFlags;
+ UInt32 WarningFlags;
+ int ErrorFormatIndex; // - 1 means no Error.
+ // if FormatIndex == ErrorFormatIndex, the archive is open with offset
+ UInt64 TailSize;
+
+ /* if CArc is Open OK with some format:
+ - ErrorFormatIndex shows error format index, if extension is incorrect
+ - other variables show message and warnings of archive that is open */
+
+ UString ErrorMessage;
+ UString WarningMessage;
+
+ // call IsArc_After_NonOpen only if Open returns S_FALSE
+ bool IsArc_After_NonOpen() const
+ {
+ return (ErrorFlags_Defined && (ErrorFlags & kpv_ErrorFlags_IsNotArc) == 0);
+ }
+
+
+ CArcErrorInfo():
+ ThereIsTail(false),
+ UnexpecedEnd(false),
+ IgnoreTail(false),
+ // NonZerosTail(false),
+ ErrorFlags_Defined(false),
+ ErrorFlags(0),
+ WarningFlags(0),
+ ErrorFormatIndex(-1),
+ TailSize(0)
+ {}
+
+ void ClearErrors();
+
+ void ClearErrors_Full()
+ {
+ ErrorFormatIndex = -1;
+ ClearErrors();
+ }
+
+ bool IsThereErrorOrWarning() const
+ {
+ return ErrorFlags != 0
+ || WarningFlags != 0
+ || NeedTailWarning()
+ || UnexpecedEnd
+ || !ErrorMessage.IsEmpty()
+ || !WarningMessage.IsEmpty();
+ }
+
+ bool AreThereErrors() const { return ErrorFlags != 0 || UnexpecedEnd; }
+ bool AreThereWarnings() const { return WarningFlags != 0 || NeedTailWarning(); }
+
+ bool NeedTailWarning() const { return !IgnoreTail && ThereIsTail; }
+
+ UInt32 GetWarningFlags() const
+ {
+ UInt32 a = WarningFlags;
+ if (NeedTailWarning() && (ErrorFlags & kpv_ErrorFlags_DataAfterEnd) == 0)
+ a |= kpv_ErrorFlags_DataAfterEnd;
+ return a;
+ }
+
+ UInt32 GetErrorFlags() const
+ {
+ UInt32 a = ErrorFlags;
+ if (UnexpecedEnd)
+ a |= kpv_ErrorFlags_UnexpectedEnd;
+ return a;
+ }
+};
+
+struct CReadArcItem
+{
+ UString Path; // Path from root (including alt stream name, if alt stream)
+ UStringVector PathParts; // without altStream name, path from root or from _baseParentFolder, if _use_baseParentFolder_mode
+
+ #ifdef SUPPORT_ALT_STREAMS
+ UString MainPath;
+ /* MainPath = Path for non-AltStream,
+ MainPath = Path of parent, if there is parent for AltStream. */
+ UString AltStreamName;
+ bool IsAltStream;
+ bool WriteToAltStreamIfColon;
+ #endif
+
+ bool IsDir;
+ bool MainIsDir;
+ UInt32 ParentIndex; // use it, if IsAltStream
+
+ #ifndef _SFX
+ bool _use_baseParentFolder_mode;
+ int _baseParentFolder;
+ #endif
+
+ CReadArcItem()
+ {
+ #ifdef SUPPORT_ALT_STREAMS
+ WriteToAltStreamIfColon = false;
+ #endif
+
+ #ifndef _SFX
+ _use_baseParentFolder_mode = false;
+ _baseParentFolder = -1;
+ #endif
+ }
+};
+
+class CArc
+{
+ HRESULT PrepareToOpen(const COpenOptions &op, unsigned formatIndex, CMyComPtr<IInArchive> &archive);
+ HRESULT CheckZerosTail(const COpenOptions &op, UInt64 offset);
+ HRESULT OpenStream2(const COpenOptions &options);
+
+ #ifndef _SFX
+ // parts.Back() can contain alt stream name "nams:AltName"
+ HRESULT GetItemPathToParent(UInt32 index, UInt32 parent, UStringVector &parts) const;
+ #endif
+
+public:
+ CMyComPtr<IInArchive> Archive;
+ CMyComPtr<IInStream> InStream;
+ // we use InStream in 2 cases (ArcStreamOffset != 0):
+ // 1) if we use additional cache stream
+ // 2) we reopen sfx archive with CTailInStream
+
+ CMyComPtr<IArchiveGetRawProps> GetRawProps;
+ CMyComPtr<IArchiveGetRootProps> GetRootProps;
+
+ CArcErrorInfo ErrorInfo; // for OK archives
+ CArcErrorInfo NonOpen_ErrorInfo; // ErrorInfo for mainArchive (false OPEN)
+
+ UString Path;
+ UString filePath;
+ UString DefaultName;
+ int FormatIndex; // - 1 means Parser.
+ int SubfileIndex;
+ FILETIME MTime;
+ bool MTimeDefined;
+
+ Int64 Offset; // it's offset of start of archive inside stream that is open by Archive Handler
+ UInt64 PhySize;
+ // UInt64 OkPhySize;
+ bool PhySizeDefined;
+ // bool OkPhySize_Defined;
+ UInt64 FileSize;
+ UInt64 AvailPhySize; // PhySize, but it's reduced if exceed end of file
+ // bool offsetDefined;
+
+ UInt64 GetEstmatedPhySize() const { return PhySizeDefined ? PhySize : FileSize; }
+
+ UInt64 ArcStreamOffset; // offset of stream that is open by Archive Handler
+ Int64 GetGlobalOffset() const { return ArcStreamOffset + Offset; } // it's global offset of archive
+
+ // AString ErrorFlagsText;
+
+ bool IsParseArc;
+
+ bool IsTree;
+ bool IsReadOnly;
+
+ bool Ask_Deleted;
+ bool Ask_AltStream;
+ bool Ask_Aux;
+ bool Ask_INode;
+
+ bool IgnoreSplit; // don't try split handler
+
+ // void Set_ErrorFlagsText();
+
+ CArc():
+ MTimeDefined(false),
+ IsTree(false),
+ IsReadOnly(false),
+ Ask_Deleted(false),
+ Ask_AltStream(false),
+ Ask_Aux(false),
+ Ask_INode(false),
+ IgnoreSplit(false)
+ {}
+
+ HRESULT ReadBasicProps(IInArchive *archive, UInt64 startPos, HRESULT openRes);
+
+ // ~CArc();
+
+ HRESULT Close()
+ {
+ InStream.Release();
+ return Archive->Close();
+ }
+
+ HRESULT GetItemPath(UInt32 index, UString &result) const;
+ HRESULT GetDefaultItemPath(UInt32 index, UString &result) const;
+
+ // GetItemPath2 adds [DELETED] dir prefix for deleted items.
+ HRESULT GetItemPath2(UInt32 index, UString &result) const;
+
+ HRESULT GetItem(UInt32 index, CReadArcItem &item) const;
+
+ HRESULT GetItemSize(UInt32 index, UInt64 &size, bool &defined) const;
+ HRESULT GetItemMTime(UInt32 index, FILETIME &ft, bool &defined) const;
+ HRESULT IsItemAnti(UInt32 index, bool &result) const
+ { return Archive_GetItemBoolProp(Archive, index, kpidIsAnti, result); }
+
+
+ HRESULT OpenStream(const COpenOptions &options);
+ HRESULT OpenStreamOrFile(COpenOptions &options);
+
+ HRESULT ReOpen(const COpenOptions &options);
+
+ HRESULT CreateNewTailStream(CMyComPtr<IInStream> &stream);
+};
+
+struct CArchiveLink
+{
+ CObjectVector<CArc> Arcs;
+ UStringVector VolumePaths;
+ UInt64 VolumesSize;
+ bool IsOpen;
+
+ bool PasswordWasAsked;
+ // UString Password;
+
+ // int NonOpenErrorFormatIndex; // - 1 means no Error.
+ UString NonOpen_ArcPath;
+
+ CArcErrorInfo NonOpen_ErrorInfo;
+
+ // UString ErrorsText;
+ // void Set_ErrorsText();
+
+ CArchiveLink():
+ VolumesSize(0),
+ IsOpen(false),
+ PasswordWasAsked(false)
+ {}
+
+ void KeepModeForNextOpen();
+ HRESULT Close();
+ void Release();
+ ~CArchiveLink() { Release(); }
+
+ const CArc *GetArc() const { return &Arcs.Back(); }
+ IInArchive *GetArchive() const { return Arcs.Back().Archive; }
+ IArchiveGetRawProps *GetArchiveGetRawProps() const { return Arcs.Back().GetRawProps; }
+ IArchiveGetRootProps *GetArchiveGetRootProps() const { return Arcs.Back().GetRootProps; }
+
+ HRESULT Open(COpenOptions &options);
+ HRESULT Open2(COpenOptions &options, IOpenCallbackUI *callbackUI);
+ HRESULT Open3(COpenOptions &options, IOpenCallbackUI *callbackUI);
+
+ HRESULT Open_Strict(COpenOptions &options, IOpenCallbackUI *callbackUI)
+ {
+ HRESULT result = Open3(options, callbackUI);
+ if (result == S_OK && NonOpen_ErrorInfo.ErrorFormatIndex >= 0)
+ result = S_FALSE;
+ return result;
+ }
+
+ HRESULT ReOpen(COpenOptions &options);
+};
+
+bool ParseOpenTypes(CCodecs &codecs, const UString &s, CObjectVector<COpenType> &types);
+
+
+struct CDirPathSortPair
+{
+ unsigned Len;
+ unsigned Index;
+
+ void SetNumSlashes(const FChar *s);
+
+ int Compare(const CDirPathSortPair &a) const
+ {
+ // We need sorting order where parent items will be after child items
+ if (Len < a.Len) return 1;
+ if (Len > a.Len) return -1;
+ if (Index < a.Index) return -1;
+ if (Index > a.Index) return 1;
+ return 0;
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.cpp
new file mode 100644
index 0000000000..bb9c89f2dc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.cpp
@@ -0,0 +1,668 @@
+// PropIDUtils.cpp
+
+#include "StdAfx.h"
+
+#include "../../../../C/CpuArch.h"
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/FileIO.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#include "../../PropID.h"
+
+#include "PropIDUtils.h"
+
+#define Get16(x) GetUi16(x)
+#define Get32(x) GetUi32(x)
+
+using namespace NWindows;
+
+static const unsigned kNumWinAtrribFlags = 21;
+static const char g_WinAttribChars[kNumWinAtrribFlags + 1] = "RHS8DAdNTsLCOIEV.X.PU";
+
+/*
+FILE_ATTRIBUTE_
+
+0 READONLY
+1 HIDDEN
+2 SYSTEM
+3 (Volume label - obsolete)
+4 DIRECTORY
+5 ARCHIVE
+6 DEVICE
+7 NORMAL
+8 TEMPORARY
+9 SPARSE_FILE
+10 REPARSE_POINT
+11 COMPRESSED
+12 OFFLINE
+13 NOT_CONTENT_INDEXED (I - Win10 attrib/Explorer)
+14 ENCRYPTED
+15 INTEGRITY_STREAM (V - ReFS Win8/Win2012)
+16 VIRTUAL (reserved)
+17 NO_SCRUB_DATA (X - ReFS Win8/Win2012 attrib)
+18 RECALL_ON_OPEN or EA
+19 PINNED
+20 UNPINNED
+21 STRICTLY_SEQUENTIAL
+22 RECALL_ON_DATA_ACCESS
+*/
+
+
+static const char kPosixTypes[16] = { '0', 'p', 'c', '3', 'd', '5', 'b', '7', '-', '9', 'l', 'B', 's', 'D', 'E', 'F' };
+#define MY_ATTR_CHAR(a, n, c) ((a) & (1 << (n))) ? c : '-';
+
+static void ConvertPosixAttribToString(char *s, UInt32 a) throw()
+{
+ s[0] = kPosixTypes[(a >> 12) & 0xF];
+ for (int i = 6; i >= 0; i -= 3)
+ {
+ s[7 - i] = MY_ATTR_CHAR(a, i + 2, 'r');
+ s[8 - i] = MY_ATTR_CHAR(a, i + 1, 'w');
+ s[9 - i] = MY_ATTR_CHAR(a, i + 0, 'x');
+ }
+ if ((a & 0x800) != 0) s[3] = ((a & (1 << 6)) ? 's' : 'S');
+ if ((a & 0x400) != 0) s[6] = ((a & (1 << 3)) ? 's' : 'S');
+ if ((a & 0x200) != 0) s[9] = ((a & (1 << 0)) ? 't' : 'T');
+ s[10] = 0;
+
+ a &= ~(UInt32)0xFFFF;
+ if (a != 0)
+ {
+ s[10] = ' ';
+ ConvertUInt32ToHex8Digits(a, s + 11);
+ }
+}
+
+
+void ConvertWinAttribToString(char *s, UInt32 wa) throw()
+{
+ /*
+ some programs store posix attributes in high 16 bits.
+ p7zip - stores additional 0x8000 flag marker.
+ macos - stores additional 0x4000 flag marker.
+ info-zip - no additional marker.
+ */
+
+ bool isPosix = ((wa & 0xF0000000) != 0);
+
+ UInt32 posix = 0;
+ if (isPosix)
+ {
+ posix = wa >> 16;
+ wa &= (UInt32)0x3FFF;
+ }
+
+ for (unsigned i = 0; i < kNumWinAtrribFlags; i++)
+ {
+ UInt32 flag = (1 << i);
+ if ((wa & flag) != 0)
+ {
+ char c = g_WinAttribChars[i];
+ if (c != '.')
+ {
+ wa &= ~flag;
+ // if (i != 7) // we can disable N (NORMAL) printing
+ *s++ = c;
+ }
+ }
+ }
+
+ if (wa != 0)
+ {
+ *s++ = ' ';
+ ConvertUInt32ToHex8Digits(wa, s);
+ s += strlen(s);
+ }
+
+ *s = 0;
+
+ if (isPosix)
+ {
+ *s++ = ' ';
+ ConvertPosixAttribToString(s, posix);
+ }
+}
+
+
+void ConvertPropertyToShortString2(char *dest, const PROPVARIANT &prop, PROPID propID, int level) throw()
+{
+ *dest = 0;
+
+ if (prop.vt == VT_FILETIME)
+ {
+ const FILETIME &ft = prop.filetime;
+ if ((ft.dwHighDateTime == 0 &&
+ ft.dwLowDateTime == 0))
+ return;
+ ConvertUtcFileTimeToString(prop.filetime, dest, level);
+ return;
+ }
+
+ switch (propID)
+ {
+ case kpidCRC:
+ {
+ if (prop.vt != VT_UI4)
+ break;
+ ConvertUInt32ToHex8Digits(prop.ulVal, dest);
+ return;
+ }
+ case kpidAttrib:
+ {
+ if (prop.vt != VT_UI4)
+ break;
+ UInt32 a = prop.ulVal;
+
+ /*
+ if ((a & 0x8000) && (a & 0x7FFF) == 0)
+ ConvertPosixAttribToString(dest, a >> 16);
+ else
+ */
+ ConvertWinAttribToString(dest, a);
+ return;
+ }
+ case kpidPosixAttrib:
+ {
+ if (prop.vt != VT_UI4)
+ break;
+ ConvertPosixAttribToString(dest, prop.ulVal);
+ return;
+ }
+ case kpidINode:
+ {
+ if (prop.vt != VT_UI8)
+ break;
+ ConvertUInt32ToString((UInt32)(prop.uhVal.QuadPart >> 48), dest);
+ dest += strlen(dest);
+ *dest++ = '-';
+ UInt64 low = prop.uhVal.QuadPart & (((UInt64)1 << 48) - 1);
+ ConvertUInt64ToString(low, dest);
+ return;
+ }
+ case kpidVa:
+ {
+ UInt64 v = 0;
+ if (prop.vt == VT_UI4)
+ v = prop.ulVal;
+ else if (prop.vt == VT_UI8)
+ v = (UInt64)prop.uhVal.QuadPart;
+ else
+ break;
+ dest[0] = '0';
+ dest[1] = 'x';
+ ConvertUInt64ToHex(v, dest + 2);
+ return;
+ }
+ }
+
+ ConvertPropVariantToShortString(prop, dest);
+}
+
+void ConvertPropertyToString2(UString &dest, const PROPVARIANT &prop, PROPID propID, int level)
+{
+ if (prop.vt == VT_BSTR)
+ {
+ dest.SetFromBstr(prop.bstrVal);
+ return;
+ }
+ char temp[64];
+ ConvertPropertyToShortString2(temp, prop, propID, level);
+ dest = temp;
+}
+
+static inline unsigned GetHex(unsigned v)
+{
+ return (v < 10) ? ('0' + v) : ('A' + (v - 10));
+}
+
+#ifndef _SFX
+
+static inline void AddHexToString(AString &res, unsigned v)
+{
+ res += (char)GetHex(v >> 4);
+ res += (char)GetHex(v & 0xF);
+}
+
+/*
+static AString Data_To_Hex(const Byte *data, size_t size)
+{
+ AString s;
+ for (size_t i = 0; i < size; i++)
+ AddHexToString(s, data[i]);
+ return s;
+}
+*/
+
+static const char * const sidNames[] =
+{
+ "0"
+ , "Dialup"
+ , "Network"
+ , "Batch"
+ , "Interactive"
+ , "Logon" // S-1-5-5-X-Y
+ , "Service"
+ , "Anonymous"
+ , "Proxy"
+ , "EnterpriseDC"
+ , "Self"
+ , "AuthenticatedUsers"
+ , "RestrictedCode"
+ , "TerminalServer"
+ , "RemoteInteractiveLogon"
+ , "ThisOrganization"
+ , "16"
+ , "IUserIIS"
+ , "LocalSystem"
+ , "LocalService"
+ , "NetworkService"
+ , "Domains"
+};
+
+struct CSecID2Name
+{
+ UInt32 n;
+ const char *sz;
+};
+
+static int FindPairIndex(const CSecID2Name * pairs, unsigned num, UInt32 id)
+{
+ for (unsigned i = 0; i < num; i++)
+ if (pairs[i].n == id)
+ return i;
+ return -1;
+}
+
+static const CSecID2Name sid_32_Names[] =
+{
+ { 544, "Administrators" },
+ { 545, "Users" },
+ { 546, "Guests" },
+ { 547, "PowerUsers" },
+ { 548, "AccountOperators" },
+ { 549, "ServerOperators" },
+ { 550, "PrintOperators" },
+ { 551, "BackupOperators" },
+ { 552, "Replicators" },
+ { 553, "Backup Operators" },
+ { 554, "PreWindows2000CompatibleAccess" },
+ { 555, "RemoteDesktopUsers" },
+ { 556, "NetworkConfigurationOperators" },
+ { 557, "IncomingForestTrustBuilders" },
+ { 558, "PerformanceMonitorUsers" },
+ { 559, "PerformanceLogUsers" },
+ { 560, "WindowsAuthorizationAccessGroup" },
+ { 561, "TerminalServerLicenseServers" },
+ { 562, "DistributedCOMUsers" },
+ { 569, "CryptographicOperators" },
+ { 573, "EventLogReaders" },
+ { 574, "CertificateServiceDCOMAccess" }
+};
+
+static const CSecID2Name sid_21_Names[] =
+{
+ { 500, "Administrator" },
+ { 501, "Guest" },
+ { 502, "KRBTGT" },
+ { 512, "DomainAdmins" },
+ { 513, "DomainUsers" },
+ { 515, "DomainComputers" },
+ { 516, "DomainControllers" },
+ { 517, "CertPublishers" },
+ { 518, "SchemaAdmins" },
+ { 519, "EnterpriseAdmins" },
+ { 520, "GroupPolicyCreatorOwners" },
+ { 553, "RASandIASServers" },
+ { 553, "RASandIASServers" },
+ { 571, "AllowedRODCPasswordReplicationGroup" },
+ { 572, "DeniedRODCPasswordReplicationGroup" }
+};
+
+struct CServicesToName
+{
+ UInt32 n[5];
+ const char *sz;
+};
+
+static const CServicesToName services_to_name[] =
+{
+ { { 0x38FB89B5, 0xCBC28419, 0x6D236C5C, 0x6E770057, 0x876402C0 } , "TrustedInstaller" }
+};
+
+static void ParseSid(AString &s, const Byte *p, UInt32 lim, UInt32 &sidSize)
+{
+ sidSize = 0;
+ if (lim < 8)
+ {
+ s += "ERROR";
+ return;
+ }
+ UInt32 rev = p[0];
+ if (rev != 1)
+ {
+ s += "UNSUPPORTED";
+ return;
+ }
+ UInt32 num = p[1];
+ if (8 + num * 4 > lim)
+ {
+ s += "ERROR";
+ return;
+ }
+ sidSize = 8 + num * 4;
+ UInt32 authority = GetBe32(p + 4);
+
+ if (p[2] == 0 && p[3] == 0 && authority == 5 && num >= 1)
+ {
+ UInt32 v0 = Get32(p + 8);
+ if (v0 < ARRAY_SIZE(sidNames))
+ {
+ s += sidNames[v0];
+ return;
+ }
+ if (v0 == 32 && num == 2)
+ {
+ UInt32 v1 = Get32(p + 12);
+ int index = FindPairIndex(sid_32_Names, ARRAY_SIZE(sid_32_Names), v1);
+ if (index >= 0)
+ {
+ s += sid_32_Names[(unsigned)index].sz;
+ return;
+ }
+ }
+ if (v0 == 21 && num == 5)
+ {
+ UInt32 v4 = Get32(p + 8 + 4 * 4);
+ int index = FindPairIndex(sid_21_Names, ARRAY_SIZE(sid_21_Names), v4);
+ if (index >= 0)
+ {
+ s += sid_21_Names[(unsigned)index].sz;
+ return;
+ }
+ }
+ if (v0 == 80 && num == 6)
+ {
+ for (unsigned i = 0; i < ARRAY_SIZE(services_to_name); i++)
+ {
+ const CServicesToName &sn = services_to_name[i];
+ int j;
+ for (j = 0; j < 5 && sn.n[j] == Get32(p + 8 + 4 + j * 4); j++);
+ if (j == 5)
+ {
+ s += sn.sz;
+ return;
+ }
+ }
+ }
+ }
+
+ s += "S-1-";
+ if (p[2] == 0 && p[3] == 0)
+ s.Add_UInt32(authority);
+ else
+ {
+ s += "0x";
+ for (int i = 2; i < 8; i++)
+ AddHexToString(s, p[i]);
+ }
+ for (UInt32 i = 0; i < num; i++)
+ {
+ s += '-';
+ s.Add_UInt32(Get32(p + 8 + i * 4));
+ }
+}
+
+static void ParseOwner(AString &s, const Byte *p, UInt32 size, UInt32 pos)
+{
+ if (pos > size)
+ {
+ s += "ERROR";
+ return;
+ }
+ UInt32 sidSize = 0;
+ ParseSid(s, p + pos, size - pos, sidSize);
+}
+
+static void ParseAcl(AString &s, const Byte *p, UInt32 size, const char *strName, UInt32 flags, UInt32 offset)
+{
+ UInt32 control = Get16(p + 2);
+ if ((flags & control) == 0)
+ return;
+ UInt32 pos = Get32(p + offset);
+ s.Add_Space();
+ s += strName;
+ if (pos >= size)
+ return;
+ p += pos;
+ size -= pos;
+ if (size < 8)
+ return;
+ if (Get16(p) != 2) // revision
+ return;
+ UInt32 num = Get32(p + 4);
+ s.Add_UInt32(num);
+
+ /*
+ UInt32 aclSize = Get16(p + 2);
+ if (num >= (1 << 16))
+ return;
+ if (aclSize > size)
+ return;
+ size = aclSize;
+ size -= 8;
+ p += 8;
+ for (UInt32 i = 0 ; i < num; i++)
+ {
+ if (size <= 8)
+ return;
+ // Byte type = p[0];
+ // Byte flags = p[1];
+ // UInt32 aceSize = Get16(p + 2);
+ // UInt32 mask = Get32(p + 4);
+ p += 8;
+ size -= 8;
+
+ UInt32 sidSize = 0;
+ s.Add_Space();
+ ParseSid(s, p, size, sidSize);
+ if (sidSize == 0)
+ return;
+ p += sidSize;
+ size -= sidSize;
+ }
+
+ // the tail can contain zeros. So (size != 0) is not ERROR
+ // if (size != 0) s += " ERROR";
+ */
+}
+
+#define MY_SE_OWNER_DEFAULTED (0x0001)
+#define MY_SE_GROUP_DEFAULTED (0x0002)
+#define MY_SE_DACL_PRESENT (0x0004)
+#define MY_SE_DACL_DEFAULTED (0x0008)
+#define MY_SE_SACL_PRESENT (0x0010)
+#define MY_SE_SACL_DEFAULTED (0x0020)
+#define MY_SE_DACL_AUTO_INHERIT_REQ (0x0100)
+#define MY_SE_SACL_AUTO_INHERIT_REQ (0x0200)
+#define MY_SE_DACL_AUTO_INHERITED (0x0400)
+#define MY_SE_SACL_AUTO_INHERITED (0x0800)
+#define MY_SE_DACL_PROTECTED (0x1000)
+#define MY_SE_SACL_PROTECTED (0x2000)
+#define MY_SE_RM_CONTROL_VALID (0x4000)
+#define MY_SE_SELF_RELATIVE (0x8000)
+
+void ConvertNtSecureToString(const Byte *data, UInt32 size, AString &s)
+{
+ s.Empty();
+ if (size < 20 || size > (1 << 18))
+ {
+ s += "ERROR";
+ return;
+ }
+ if (Get16(data) != 1) // revision
+ {
+ s += "UNSUPPORTED";
+ return;
+ }
+ ParseOwner(s, data, size, Get32(data + 4));
+ s.Add_Space();
+ ParseOwner(s, data, size, Get32(data + 8));
+ ParseAcl(s, data, size, "s:", MY_SE_SACL_PRESENT, 12);
+ ParseAcl(s, data, size, "d:", MY_SE_DACL_PRESENT, 16);
+ s.Add_Space();
+ s.Add_UInt32(size);
+ // s += '\n';
+ // s += Data_To_Hex(data, size);
+}
+
+#ifdef _WIN32
+
+static bool CheckSid(const Byte *data, UInt32 size, UInt32 pos) throw()
+{
+ if (pos >= size)
+ return false;
+ size -= pos;
+ if (size < 8)
+ return false;
+ UInt32 rev = data[pos];
+ if (rev != 1)
+ return false;
+ UInt32 num = data[pos + 1];
+ return (8 + num * 4 <= size);
+}
+
+static bool CheckAcl(const Byte *p, UInt32 size, UInt32 flags, UInt32 offset) throw()
+{
+ UInt32 control = Get16(p + 2);
+ if ((flags & control) == 0)
+ return true;
+ UInt32 pos = Get32(p + offset);
+ if (pos >= size)
+ return false;
+ p += pos;
+ size -= pos;
+ if (size < 8)
+ return false;
+ UInt32 aclSize = Get16(p + 2);
+ return (aclSize <= size);
+}
+
+bool CheckNtSecure(const Byte *data, UInt32 size) throw()
+{
+ if (size < 20)
+ return false;
+ if (Get16(data) != 1) // revision
+ return true; // windows function can handle such error, so we allow it
+ if (size > (1 << 18))
+ return false;
+ if (!CheckSid(data, size, Get32(data + 4))) return false;
+ if (!CheckSid(data, size, Get32(data + 8))) return false;
+ if (!CheckAcl(data, size, MY_SE_SACL_PRESENT, 12)) return false;
+ if (!CheckAcl(data, size, MY_SE_DACL_PRESENT, 16)) return false;
+ return true;
+}
+
+#endif
+
+
+
+// IO_REPARSE_TAG_*
+
+static const CSecID2Name k_ReparseTags[] =
+{
+ { 0xA0000003, "MOUNT_POINT" },
+ { 0xC0000004, "HSM" },
+ { 0x80000005, "DRIVE_EXTENDER" },
+ { 0x80000006, "HSM2" },
+ { 0x80000007, "SIS" },
+ { 0x80000008, "WIM" },
+ { 0x80000009, "CSV" },
+ { 0x8000000A, "DFS" },
+ { 0x8000000B, "FILTER_MANAGER" },
+ { 0xA000000C, "SYMLINK" },
+ { 0xA0000010, "IIS_CACHE" },
+ { 0x80000012, "DFSR" },
+ { 0x80000013, "DEDUP" },
+ { 0xC0000014, "APPXSTRM" },
+ { 0x80000014, "NFS" },
+ { 0x80000015, "FILE_PLACEHOLDER" },
+ { 0x80000016, "DFM" },
+ { 0x80000017, "WOF" }
+};
+
+bool ConvertNtReparseToString(const Byte *data, UInt32 size, UString &s)
+{
+ s.Empty();
+ NFile::CReparseAttr attr;
+ DWORD errorCode = 0;
+ if (attr.Parse(data, size, errorCode))
+ {
+ if (!attr.IsSymLink())
+ s += "Junction: ";
+ s += attr.GetPath();
+ if (!attr.IsOkNamePair())
+ {
+ s += " : ";
+ s += attr.PrintName;
+ }
+ return true;
+ }
+
+ if (size < 8)
+ return false;
+ UInt32 tag = Get32(data);
+ UInt32 len = Get16(data + 4);
+ if (len + 8 > size)
+ return false;
+ if (Get16(data + 6) != 0) // padding
+ return false;
+
+ /*
+ #define _my_IO_REPARSE_TAG_DEDUP (0x80000013L)
+ if (tag == _my_IO_REPARSE_TAG_DEDUP)
+ {
+ }
+ */
+
+ {
+ int index = FindPairIndex(k_ReparseTags, ARRAY_SIZE(k_ReparseTags), tag);
+ if (index >= 0)
+ s += k_ReparseTags[(unsigned)index].sz;
+ else
+ {
+ s += "REPARSE:";
+ char hex[16];
+ ConvertUInt32ToHex8Digits(tag, hex);
+ s += hex;
+ }
+ }
+
+ s += ":";
+ s.Add_UInt32(len);
+
+ if (len != 0)
+ {
+ s.Add_Space();
+
+ data += 8;
+
+ for (UInt32 i = 0; i < len; i++)
+ {
+ if (i >= 8)
+ {
+ s += "...";
+ break;
+ }
+ unsigned b = data[i];
+ s += (char)GetHex((b >> 4) & 0xF);
+ s += (char)GetHex(b & 0xF);
+ }
+ }
+
+ return true;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.h
new file mode 100644
index 0000000000..e94e6d798c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/PropIDUtils.h
@@ -0,0 +1,18 @@
+// PropIDUtils.h
+
+#ifndef __PROPID_UTILS_H
+#define __PROPID_UTILS_H
+
+#include "../../../Common/MyString.h"
+
+// provide at least 64 bytes for buffer including zero-end
+void ConvertPropertyToShortString2(char *dest, const PROPVARIANT &propVariant, PROPID propID, int level = 0) throw();
+void ConvertPropertyToString2(UString &dest, const PROPVARIANT &propVariant, PROPID propID, int level = 0);
+
+bool ConvertNtReparseToString(const Byte *data, UInt32 size, UString &s);
+void ConvertNtSecureToString(const Byte *data, UInt32 size, AString &s);
+bool CheckNtSecure(const Byte *data, UInt32 size) throw();;
+
+void ConvertWinAttribToString(char *s, UInt32 wa) throw();
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Property.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Property.h
new file mode 100644
index 0000000000..31234ad3c5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Property.h
@@ -0,0 +1,14 @@
+// Property.h
+
+#ifndef __7Z_PROPERTY_H
+#define __7Z_PROPERTY_H
+
+#include "../../../Common/MyString.h"
+
+struct CProperty
+{
+ UString Name;
+ UString Value;
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.cpp
new file mode 100644
index 0000000000..3cd4d57184
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.cpp
@@ -0,0 +1,80 @@
+// SetProperties.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/MyString.h"
+#include "../../../Common/StringToInt.h"
+
+#include "../../../Windows/PropVariant.h"
+
+#include "../../Archive/IArchive.h"
+
+#include "SetProperties.h"
+
+using namespace NWindows;
+using namespace NCOM;
+
+static void ParseNumberString(const UString &s, NCOM::CPropVariant &prop)
+{
+ const wchar_t *end;
+ UInt64 result = ConvertStringToUInt64(s, &end);
+ if (*end != 0 || s.IsEmpty())
+ prop = s;
+ else if (result <= (UInt32)0xFFFFFFFF)
+ prop = (UInt32)result;
+ else
+ prop = result;
+}
+
+HRESULT SetProperties(IUnknown *unknown, const CObjectVector<CProperty> &properties)
+{
+ if (properties.IsEmpty())
+ return S_OK;
+ CMyComPtr<ISetProperties> setProperties;
+ unknown->QueryInterface(IID_ISetProperties, (void **)&setProperties);
+ if (!setProperties)
+ return S_OK;
+
+ UStringVector realNames;
+ CPropVariant *values = new CPropVariant[properties.Size()];
+ try
+ {
+ unsigned i;
+ for (i = 0; i < properties.Size(); i++)
+ {
+ const CProperty &property = properties[i];
+ NCOM::CPropVariant propVariant;
+ UString name = property.Name;
+ if (property.Value.IsEmpty())
+ {
+ if (!name.IsEmpty())
+ {
+ wchar_t c = name.Back();
+ if (c == L'-')
+ propVariant = false;
+ else if (c == L'+')
+ propVariant = true;
+ if (propVariant.vt != VT_EMPTY)
+ name.DeleteBack();
+ }
+ }
+ else
+ ParseNumberString(property.Value, propVariant);
+ realNames.Add(name);
+ values[i] = propVariant;
+ }
+ CRecordVector<const wchar_t *> names;
+ for (i = 0; i < realNames.Size(); i++)
+ names.Add((const wchar_t *)realNames[i]);
+
+ RINOK(setProperties->SetProperties(&names.Front(), values, names.Size()));
+ }
+ catch(...)
+ {
+ delete []values;
+ throw;
+ }
+ delete []values;
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.h
new file mode 100644
index 0000000000..64c947cf86
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SetProperties.h
@@ -0,0 +1,10 @@
+// SetProperties.h
+
+#ifndef __SETPROPERTIES_H
+#define __SETPROPERTIES_H
+
+#include "Property.h"
+
+HRESULT SetProperties(IUnknown *unknown, const CObjectVector<CProperty> &properties);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.cpp
new file mode 100644
index 0000000000..f73ece86e0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.cpp
@@ -0,0 +1,25 @@
+// SortUtils.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/Wildcard.h"
+
+#include "SortUtils.h"
+
+static int CompareStrings(const unsigned *p1, const unsigned *p2, void *param)
+{
+ const UStringVector &strings = *(const UStringVector *)param;
+ return CompareFileNames(strings[*p1], strings[*p2]);
+}
+
+void SortFileNames(const UStringVector &strings, CUIntVector &indices)
+{
+ const unsigned numItems = strings.Size();
+ indices.ClearAndSetSize(numItems);
+ if (numItems == 0)
+ return;
+ unsigned *vals = &indices[0];
+ for (unsigned i = 0; i < numItems; i++)
+ vals[i] = i;
+ indices.Sort(CompareStrings, (void *)&strings);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.h
new file mode 100644
index 0000000000..82d5e4cb2e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/SortUtils.h
@@ -0,0 +1,10 @@
+// SortUtils.h
+
+#ifndef __SORT_UTLS_H
+#define __SORT_UTLS_H
+
+#include "../../../Common/MyString.h"
+
+void SortFileNames(const UStringVector &strings, CUIntVector &indices);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.cpp
new file mode 100644
index 0000000000..56bba9a1f0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.cpp
@@ -0,0 +1,19 @@
+// TempFiles.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Windows/FileDir.h"
+
+#include "TempFiles.h"
+
+using namespace NWindows;
+using namespace NFile;
+
+void CTempFiles::Clear()
+{
+ while (!Paths.IsEmpty())
+ {
+ NDir::DeleteFileAlways(Paths.Back());
+ Paths.DeleteBack();
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.h
new file mode 100644
index 0000000000..f62192dd5b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/TempFiles.h
@@ -0,0 +1,16 @@
+// TempFiles.h
+
+#ifndef __TEMP_FILES_H
+#define __TEMP_FILES_H
+
+#include "../../../Common/MyString.h"
+
+class CTempFiles
+{
+ void Clear();
+public:
+ FStringVector Paths;
+ ~CTempFiles() { Clear(); }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.cpp
new file mode 100644
index 0000000000..fc1eede4d5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.cpp
@@ -0,0 +1,1667 @@
+// Update.cpp
+
+#include "StdAfx.h"
+
+#include "Update.h"
+
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/DLL.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/PropVariant.h"
+#include "../../../Windows/PropVariantConv.h"
+#include "../../../Windows/TimeUtils.h"
+
+#include "../../Common/FileStreams.h"
+#include "../../Common/LimitedStreams.h"
+
+#include "../../Compress/CopyCoder.h"
+
+#include "../Common/DirItem.h"
+#include "../Common/EnumDirItems.h"
+#include "../Common/OpenArchive.h"
+#include "../Common/UpdateProduce.h"
+
+#include "EnumDirItems.h"
+#include "SetProperties.h"
+#include "TempFiles.h"
+#include "UpdateCallback.h"
+
+static const char * const kUpdateIsNotSupoorted =
+ "update operations are not supported for this archive";
+
+static const char * const kUpdateIsNotSupoorted_MultiVol =
+ "Updating for multivolume archives is not implemented";
+
+using namespace NWindows;
+using namespace NCOM;
+using namespace NFile;
+using namespace NDir;
+using namespace NName;
+
+static CFSTR const kTempFolderPrefix = FTEXT("7zE");
+
+
+void CUpdateErrorInfo::SetFromLastError(const char *message)
+{
+ SystemError = ::GetLastError();
+ Message = message;
+}
+
+HRESULT CUpdateErrorInfo::SetFromLastError(const char *message, const FString &fileName)
+{
+ SetFromLastError(message);
+ FileNames.Add(fileName);
+ return Get_HRESULT_Error();
+}
+
+static bool DeleteEmptyFolderAndEmptySubFolders(const FString &path)
+{
+ NFind::CFileInfo fileInfo;
+ FString pathPrefix = path + FCHAR_PATH_SEPARATOR;
+ {
+ NFind::CEnumerator enumerator;
+ enumerator.SetDirPrefix(pathPrefix);
+ while (enumerator.Next(fileInfo))
+ {
+ if (fileInfo.IsDir())
+ if (!DeleteEmptyFolderAndEmptySubFolders(pathPrefix + fileInfo.Name))
+ return false;
+ }
+ }
+ /*
+ // we don't need clear read-only for folders
+ if (!MySetFileAttributes(path, 0))
+ return false;
+ */
+ return RemoveDir(path);
+}
+
+
+using namespace NUpdateArchive;
+
+class COutMultiVolStream:
+ public IOutStream,
+ public CMyUnknownImp
+{
+ unsigned _streamIndex; // required stream
+ UInt64 _offsetPos; // offset from start of _streamIndex index
+ UInt64 _absPos;
+ UInt64 _length;
+
+ struct CAltStreamInfo
+ {
+ COutFileStream *StreamSpec;
+ CMyComPtr<IOutStream> Stream;
+ FString Name;
+ UInt64 Pos;
+ UInt64 RealSize;
+ };
+ CObjectVector<CAltStreamInfo> Streams;
+public:
+ // CMyComPtr<IArchiveUpdateCallback2> VolumeCallback;
+ CRecordVector<UInt64> Sizes;
+ FString Prefix;
+ CTempFiles *TempFiles;
+
+ void Init()
+ {
+ _streamIndex = 0;
+ _offsetPos = 0;
+ _absPos = 0;
+ _length = 0;
+ }
+
+ bool SetMTime(const FILETIME *mTime);
+ HRESULT Close();
+
+ UInt64 GetSize() const { return _length; }
+
+ MY_UNKNOWN_IMP1(IOutStream)
+
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+ STDMETHOD(Seek)(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition);
+ STDMETHOD(SetSize)(UInt64 newSize);
+};
+
+// static NSynchronization::CCriticalSection g_TempPathsCS;
+
+HRESULT COutMultiVolStream::Close()
+{
+ HRESULT res = S_OK;
+ FOR_VECTOR (i, Streams)
+ {
+ COutFileStream *s = Streams[i].StreamSpec;
+ if (s)
+ {
+ HRESULT res2 = s->Close();
+ if (res2 != S_OK)
+ res = res2;
+ }
+ }
+ return res;
+}
+
+bool COutMultiVolStream::SetMTime(const FILETIME *mTime)
+{
+ bool res = true;
+ FOR_VECTOR (i, Streams)
+ {
+ COutFileStream *s = Streams[i].StreamSpec;
+ if (s)
+ if (!s->SetMTime(mTime))
+ res = false;
+ }
+ return res;
+}
+
+STDMETHODIMP COutMultiVolStream::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ while (size > 0)
+ {
+ if (_streamIndex >= Streams.Size())
+ {
+ CAltStreamInfo altStream;
+
+ FString name;
+ name.Add_UInt32(_streamIndex + 1);
+ while (name.Len() < 3)
+ name.InsertAtFront(FTEXT('0'));
+ name.Insert(0, Prefix);
+ altStream.StreamSpec = new COutFileStream;
+ altStream.Stream = altStream.StreamSpec;
+ if (!altStream.StreamSpec->Create(name, false))
+ return ::GetLastError();
+ {
+ // NSynchronization::CCriticalSectionLock lock(g_TempPathsCS);
+ TempFiles->Paths.Add(name);
+ }
+
+ altStream.Pos = 0;
+ altStream.RealSize = 0;
+ altStream.Name = name;
+ Streams.Add(altStream);
+ continue;
+ }
+ CAltStreamInfo &altStream = Streams[_streamIndex];
+
+ unsigned index = _streamIndex;
+ if (index >= Sizes.Size())
+ index = Sizes.Size() - 1;
+ UInt64 volSize = Sizes[index];
+
+ if (_offsetPos >= volSize)
+ {
+ _offsetPos -= volSize;
+ _streamIndex++;
+ continue;
+ }
+ if (_offsetPos != altStream.Pos)
+ {
+ // CMyComPtr<IOutStream> outStream;
+ // RINOK(altStream.Stream.QueryInterface(IID_IOutStream, &outStream));
+ RINOK(altStream.Stream->Seek(_offsetPos, STREAM_SEEK_SET, NULL));
+ altStream.Pos = _offsetPos;
+ }
+
+ UInt32 curSize = (UInt32)MyMin((UInt64)size, volSize - altStream.Pos);
+ UInt32 realProcessed;
+ RINOK(altStream.Stream->Write(data, curSize, &realProcessed));
+ data = (void *)((Byte *)data + realProcessed);
+ size -= realProcessed;
+ altStream.Pos += realProcessed;
+ _offsetPos += realProcessed;
+ _absPos += realProcessed;
+ if (_absPos > _length)
+ _length = _absPos;
+ if (_offsetPos > altStream.RealSize)
+ altStream.RealSize = _offsetPos;
+ if (processedSize)
+ *processedSize += realProcessed;
+ if (altStream.Pos == volSize)
+ {
+ _streamIndex++;
+ _offsetPos = 0;
+ }
+ if (realProcessed == 0 && curSize != 0)
+ return E_FAIL;
+ break;
+ }
+ return S_OK;
+}
+
+STDMETHODIMP COutMultiVolStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
+{
+ if (seekOrigin >= 3)
+ return STG_E_INVALIDFUNCTION;
+ switch (seekOrigin)
+ {
+ case STREAM_SEEK_SET: _absPos = offset; break;
+ case STREAM_SEEK_CUR: _absPos += offset; break;
+ case STREAM_SEEK_END: _absPos = _length + offset; break;
+ }
+ _offsetPos = _absPos;
+ if (newPosition)
+ *newPosition = _absPos;
+ _streamIndex = 0;
+ return S_OK;
+}
+
+STDMETHODIMP COutMultiVolStream::SetSize(UInt64 newSize)
+{
+ unsigned i = 0;
+ while (i < Streams.Size())
+ {
+ CAltStreamInfo &altStream = Streams[i++];
+ if ((UInt64)newSize < altStream.RealSize)
+ {
+ RINOK(altStream.Stream->SetSize(newSize));
+ altStream.RealSize = newSize;
+ break;
+ }
+ newSize -= altStream.RealSize;
+ }
+ while (i < Streams.Size())
+ {
+ {
+ CAltStreamInfo &altStream = Streams.Back();
+ altStream.Stream.Release();
+ DeleteFileAlways(altStream.Name);
+ }
+ Streams.DeleteBack();
+ }
+ _offsetPos = _absPos;
+ _streamIndex = 0;
+ _length = newSize;
+ return S_OK;
+}
+
+void CArchivePath::ParseFromPath(const UString &path, EArcNameMode mode)
+{
+ OriginalPath = path;
+
+ SplitPathToParts_2(path, Prefix, Name);
+
+ if (mode == k_ArcNameMode_Add)
+ return;
+ if (mode == k_ArcNameMode_Exact)
+ {
+ BaseExtension.Empty();
+ return;
+ }
+
+ int dotPos = Name.ReverseFind_Dot();
+ if (dotPos < 0)
+ return;
+ if ((unsigned)dotPos == Name.Len() - 1)
+ {
+ Name.DeleteBack();
+ BaseExtension.Empty();
+ return;
+ }
+ const UString ext = Name.Ptr(dotPos + 1);
+ if (BaseExtension.IsEqualTo_NoCase(ext))
+ {
+ BaseExtension = ext;
+ Name.DeleteFrom(dotPos);
+ }
+ else
+ BaseExtension.Empty();
+}
+
+UString CArchivePath::GetFinalPath() const
+{
+ UString path = GetPathWithoutExt();
+ if (!BaseExtension.IsEmpty())
+ {
+ path += '.';
+ path += BaseExtension;
+ }
+ return path;
+}
+
+UString CArchivePath::GetFinalVolPath() const
+{
+ UString path = GetPathWithoutExt();
+ if (!BaseExtension.IsEmpty())
+ {
+ path += '.';
+ path += VolExtension;
+ }
+ return path;
+}
+
+FString CArchivePath::GetTempPath() const
+{
+ FString path = TempPrefix;
+ path += us2fs(Name);
+ if (!BaseExtension.IsEmpty())
+ {
+ path += '.';
+ path += us2fs(BaseExtension);
+ }
+ path += ".tmp";
+ path += TempPostfix;
+ return path;
+}
+
+static const char * const kDefaultArcType = "7z";
+static const char * const kDefaultArcExt = "7z";
+static const char * const kSFXExtension =
+ #ifdef _WIN32
+ "exe";
+ #else
+ "";
+ #endif
+
+bool CUpdateOptions::InitFormatIndex(const CCodecs *codecs,
+ const CObjectVector<COpenType> &types, const UString &arcPath)
+{
+ if (types.Size() > 1)
+ return false;
+ // int arcTypeIndex = -1;
+ if (types.Size() != 0)
+ {
+ MethodMode.Type = types[0];
+ MethodMode.Type_Defined = true;
+ }
+ if (MethodMode.Type.FormatIndex < 0)
+ {
+ // MethodMode.Type = -1;
+ MethodMode.Type = COpenType();
+ if (ArcNameMode != k_ArcNameMode_Add)
+ {
+ MethodMode.Type.FormatIndex = codecs->FindFormatForArchiveName(arcPath);
+ if (MethodMode.Type.FormatIndex >= 0)
+ MethodMode.Type_Defined = true;
+ }
+ }
+ return true;
+}
+
+bool CUpdateOptions::SetArcPath(const CCodecs *codecs, const UString &arcPath)
+{
+ UString typeExt;
+ int formatIndex = MethodMode.Type.FormatIndex;
+ if (formatIndex < 0)
+ {
+ typeExt = kDefaultArcExt;
+ }
+ else
+ {
+ const CArcInfoEx &arcInfo = codecs->Formats[formatIndex];
+ if (!arcInfo.UpdateEnabled)
+ return false;
+ typeExt = arcInfo.GetMainExt();
+ }
+ UString ext = typeExt;
+ if (SfxMode)
+ ext = kSFXExtension;
+ ArchivePath.BaseExtension = ext;
+ ArchivePath.VolExtension = typeExt;
+ ArchivePath.ParseFromPath(arcPath, ArcNameMode);
+ FOR_VECTOR (i, Commands)
+ {
+ CUpdateArchiveCommand &uc = Commands[i];
+ uc.ArchivePath.BaseExtension = ext;
+ uc.ArchivePath.VolExtension = typeExt;
+ uc.ArchivePath.ParseFromPath(uc.UserArchivePath, ArcNameMode);
+ }
+ return true;
+}
+
+
+struct CUpdateProduceCallbackImp: public IUpdateProduceCallback
+{
+ const CObjectVector<CArcItem> *_arcItems;
+ IUpdateCallbackUI *_callback;
+ CDirItemsStat *_stat;
+
+ CUpdateProduceCallbackImp(
+ const CObjectVector<CArcItem> *a,
+ CDirItemsStat *stat,
+ IUpdateCallbackUI *callback):
+ _arcItems(a),
+ _stat(stat),
+ _callback(callback) {}
+
+ virtual HRESULT ShowDeleteFile(unsigned arcIndex);
+};
+
+
+HRESULT CUpdateProduceCallbackImp::ShowDeleteFile(unsigned arcIndex)
+{
+ const CArcItem &ai = (*_arcItems)[arcIndex];
+ {
+ CDirItemsStat &stat = *_stat;
+ if (ai.IsDir)
+ stat.NumDirs++;
+ else if (ai.IsAltStream)
+ {
+ stat.NumAltStreams++;
+ stat.AltStreamsSize += ai.Size;
+ }
+ else
+ {
+ stat.NumFiles++;
+ stat.FilesSize += ai.Size;
+ }
+ }
+ return _callback->ShowDeleteFile(ai.Name, ai.IsDir);
+}
+
+bool CRenamePair::Prepare()
+{
+ if (RecursedType != NRecursedType::kNonRecursed)
+ return false;
+ if (!WildcardParsing)
+ return true;
+ return !DoesNameContainWildcard(OldName);
+}
+
+extern bool g_CaseSensitive;
+
+static unsigned CompareTwoNames(const wchar_t *s1, const wchar_t *s2)
+{
+ for (unsigned i = 0;; i++)
+ {
+ wchar_t c1 = s1[i];
+ wchar_t c2 = s2[i];
+ if (c1 == 0 || c2 == 0)
+ return i;
+ if (c1 == c2)
+ continue;
+ if (!g_CaseSensitive && (MyCharUpper(c1) == MyCharUpper(c2)))
+ continue;
+ if (IsPathSepar(c1) && IsPathSepar(c2))
+ continue;
+ return i;
+ }
+}
+
+bool CRenamePair::GetNewPath(bool isFolder, const UString &src, UString &dest) const
+{
+ unsigned num = CompareTwoNames(OldName, src);
+ if (OldName[num] == 0)
+ {
+ if (src[num] != 0 && !IsPathSepar(src[num]) && num != 0 && !IsPathSepar(src[num - 1]))
+ return false;
+ }
+ else
+ {
+ // OldName[num] != 0
+ // OldName = "1\1a.txt"
+ // src = "1"
+
+ if (!isFolder
+ || src[num] != 0
+ || !IsPathSepar(OldName[num])
+ || OldName[num + 1] != 0)
+ return false;
+ }
+ dest = NewName + src.Ptr(num);
+ return true;
+}
+
+#ifdef SUPPORT_ALT_STREAMS
+int FindAltStreamColon_in_Path(const wchar_t *path);
+#endif
+
+static HRESULT Compress(
+ const CUpdateOptions &options,
+ bool isUpdatingItself,
+ CCodecs *codecs,
+ const CActionSet &actionSet,
+ const CArc *arc,
+ CArchivePath &archivePath,
+ const CObjectVector<CArcItem> &arcItems,
+ Byte *processedItemsStatuses,
+ const CDirItems &dirItems,
+ const CDirItem *parentDirItem,
+ CTempFiles &tempFiles,
+ CUpdateErrorInfo &errorInfo,
+ IUpdateCallbackUI *callback,
+ CFinishArchiveStat &st)
+{
+ CMyComPtr<IOutArchive> outArchive;
+ int formatIndex = options.MethodMode.Type.FormatIndex;
+
+ if (arc)
+ {
+ formatIndex = arc->FormatIndex;
+ if (formatIndex < 0)
+ return E_NOTIMPL;
+ CMyComPtr<IInArchive> archive2 = arc->Archive;
+ HRESULT result = archive2.QueryInterface(IID_IOutArchive, &outArchive);
+ if (result != S_OK)
+ throw kUpdateIsNotSupoorted;
+ }
+ else
+ {
+ RINOK(codecs->CreateOutArchive(formatIndex, outArchive));
+
+ #ifdef EXTERNAL_CODECS
+ {
+ CMyComPtr<ISetCompressCodecsInfo> setCompressCodecsInfo;
+ outArchive.QueryInterface(IID_ISetCompressCodecsInfo, (void **)&setCompressCodecsInfo);
+ if (setCompressCodecsInfo)
+ {
+ RINOK(setCompressCodecsInfo->SetCompressCodecsInfo(codecs));
+ }
+ }
+ #endif
+ }
+
+ if (outArchive == 0)
+ throw kUpdateIsNotSupoorted;
+
+ NFileTimeType::EEnum fileTimeType;
+ {
+ UInt32 value;
+ RINOK(outArchive->GetFileTimeType(&value));
+
+ switch (value)
+ {
+ case NFileTimeType::kWindows:
+ case NFileTimeType::kUnix:
+ case NFileTimeType::kDOS:
+ fileTimeType = (NFileTimeType::EEnum)value;
+ break;
+ default:
+ return E_FAIL;
+ }
+ }
+
+ {
+ const CArcInfoEx &arcInfo = codecs->Formats[formatIndex];
+ if (options.AltStreams.Val && !arcInfo.Flags_AltStreams())
+ return E_NOTIMPL;
+ if (options.NtSecurity.Val && !arcInfo.Flags_NtSecure())
+ return E_NOTIMPL;
+ }
+
+ CRecordVector<CUpdatePair2> updatePairs2;
+
+ UStringVector newNames;
+
+ CArcToDoStat stat2;
+
+ if (options.RenamePairs.Size() != 0)
+ {
+ FOR_VECTOR (i, arcItems)
+ {
+ const CArcItem &ai = arcItems[i];
+ bool needRename = false;
+ UString dest;
+
+ if (ai.Censored)
+ {
+ FOR_VECTOR (j, options.RenamePairs)
+ {
+ const CRenamePair &rp = options.RenamePairs[j];
+ if (rp.GetNewPath(ai.IsDir, ai.Name, dest))
+ {
+ needRename = true;
+ break;
+ }
+
+ #ifdef SUPPORT_ALT_STREAMS
+ if (ai.IsAltStream)
+ {
+ int colonPos = FindAltStreamColon_in_Path(ai.Name);
+ if (colonPos >= 0)
+ {
+ UString mainName = ai.Name.Left(colonPos);
+ /*
+ actually we must improve that code to support cases
+ with folder renaming like: rn arc dir1\ dir2\
+ */
+ if (rp.GetNewPath(false, mainName, dest))
+ {
+ needRename = true;
+ dest += ':';
+ dest += ai.Name.Ptr(colonPos + 1);
+ break;
+ }
+ }
+ }
+ #endif
+ }
+ }
+
+ CUpdatePair2 up2;
+ up2.SetAs_NoChangeArcItem(ai.IndexInServer);
+ if (needRename)
+ {
+ up2.NewProps = true;
+ RINOK(arc->IsItemAnti(i, up2.IsAnti));
+ up2.NewNameIndex = newNames.Add(dest);
+ }
+ updatePairs2.Add(up2);
+ }
+ }
+ else
+ {
+ CRecordVector<CUpdatePair> updatePairs;
+ GetUpdatePairInfoList(dirItems, arcItems, fileTimeType, updatePairs); // must be done only once!!!
+ CUpdateProduceCallbackImp upCallback(&arcItems, &stat2.DeleteData, callback);
+
+ UpdateProduce(updatePairs, actionSet, updatePairs2, isUpdatingItself ? &upCallback : NULL);
+ }
+
+ {
+ FOR_VECTOR (i, updatePairs2)
+ {
+ const CUpdatePair2 &up = updatePairs2[i];
+
+ // 17.01: anti-item is (up.NewData && (p.UseArcProps in most cases))
+
+ if (up.NewData && !up.UseArcProps)
+ {
+ if (up.ExistOnDisk())
+ {
+ CDirItemsStat2 &stat = stat2.NewData;
+ const CDirItem &di = dirItems.Items[up.DirIndex];
+ if (di.IsDir())
+ {
+ if (up.IsAnti)
+ stat.Anti_NumDirs++;
+ else
+ stat.NumDirs++;
+ }
+ else if (di.IsAltStream)
+ {
+ if (up.IsAnti)
+ stat.Anti_NumAltStreams++;
+ else
+ {
+ stat.NumAltStreams++;
+ stat.AltStreamsSize += di.Size;
+ }
+ }
+ else
+ {
+ if (up.IsAnti)
+ stat.Anti_NumFiles++;
+ else
+ {
+ stat.NumFiles++;
+ stat.FilesSize += di.Size;
+ }
+ }
+ }
+ }
+ else if (up.ArcIndex >= 0)
+ {
+ CDirItemsStat2 &stat = *(up.NewData ? &stat2.NewData : &stat2.OldData);
+ const CArcItem &ai = arcItems[up.ArcIndex];
+ if (ai.IsDir)
+ {
+ if (up.IsAnti)
+ stat.Anti_NumDirs++;
+ else
+ stat.NumDirs++;
+ }
+ else if (ai.IsAltStream)
+ {
+ if (up.IsAnti)
+ stat.Anti_NumAltStreams++;
+ else
+ {
+ stat.NumAltStreams++;
+ stat.AltStreamsSize += ai.Size;
+ }
+ }
+ else
+ {
+ if (up.IsAnti)
+ stat.Anti_NumFiles++;
+ else
+ {
+ stat.NumFiles++;
+ stat.FilesSize += ai.Size;
+ }
+ }
+ }
+ }
+ RINOK(callback->SetNumItems(stat2));
+ }
+
+ CArchiveUpdateCallback *updateCallbackSpec = new CArchiveUpdateCallback;
+ CMyComPtr<IArchiveUpdateCallback> updateCallback(updateCallbackSpec);
+
+ updateCallbackSpec->ShareForWrite = options.OpenShareForWrite;
+ updateCallbackSpec->StopAfterOpenError = options.StopAfterOpenError;
+ updateCallbackSpec->StdInMode = options.StdInMode;
+ updateCallbackSpec->Callback = callback;
+
+ if (arc)
+ {
+ // we set Archive to allow to transfer GetProperty requests back to DLL.
+ updateCallbackSpec->Archive = arc->Archive;
+ }
+
+ updateCallbackSpec->DirItems = &dirItems;
+ updateCallbackSpec->ParentDirItem = parentDirItem;
+
+ updateCallbackSpec->StoreNtSecurity = options.NtSecurity.Val;
+ updateCallbackSpec->StoreHardLinks = options.HardLinks.Val;
+ updateCallbackSpec->StoreSymLinks = options.SymLinks.Val;
+
+ updateCallbackSpec->Arc = arc;
+ updateCallbackSpec->ArcItems = &arcItems;
+ updateCallbackSpec->UpdatePairs = &updatePairs2;
+
+ updateCallbackSpec->ProcessedItemsStatuses = processedItemsStatuses;
+
+ if (options.RenamePairs.Size() != 0)
+ updateCallbackSpec->NewNames = &newNames;
+
+ CMyComPtr<IOutStream> outSeekStream;
+ CMyComPtr<ISequentialOutStream> outStream;
+
+ if (!options.StdOutMode)
+ {
+ FString dirPrefix;
+ if (!GetOnlyDirPrefix(us2fs(archivePath.GetFinalPath()), dirPrefix))
+ throw 1417161;
+ CreateComplexDir(dirPrefix);
+ }
+
+ COutFileStream *outStreamSpec = NULL;
+ CStdOutFileStream *stdOutFileStreamSpec = NULL;
+ COutMultiVolStream *volStreamSpec = NULL;
+
+ if (options.VolumesSizes.Size() == 0)
+ {
+ if (options.StdOutMode)
+ {
+ stdOutFileStreamSpec = new CStdOutFileStream;
+ outStream = stdOutFileStreamSpec;
+ }
+ else
+ {
+ outStreamSpec = new COutFileStream;
+ outSeekStream = outStreamSpec;
+ outStream = outSeekStream;
+ bool isOK = false;
+ FString realPath;
+
+ for (unsigned i = 0; i < (1 << 16); i++)
+ {
+ if (archivePath.Temp)
+ {
+ if (i > 0)
+ {
+ archivePath.TempPostfix.Empty();
+ archivePath.TempPostfix.Add_UInt32(i);
+ }
+ realPath = archivePath.GetTempPath();
+ }
+ else
+ realPath = us2fs(archivePath.GetFinalPath());
+ if (outStreamSpec->Create(realPath, false))
+ {
+ tempFiles.Paths.Add(realPath);
+ isOK = true;
+ break;
+ }
+ if (::GetLastError() != ERROR_FILE_EXISTS)
+ break;
+ if (!archivePath.Temp)
+ break;
+ }
+
+ if (!isOK)
+ return errorInfo.SetFromLastError("cannot open file", realPath);
+ }
+ }
+ else
+ {
+ if (options.StdOutMode)
+ return E_FAIL;
+ if (arc && arc->GetGlobalOffset() > 0)
+ return E_NOTIMPL;
+
+ volStreamSpec = new COutMultiVolStream;
+ outSeekStream = volStreamSpec;
+ outStream = outSeekStream;
+ volStreamSpec->Sizes = options.VolumesSizes;
+ volStreamSpec->Prefix = us2fs(archivePath.GetFinalVolPath());
+ volStreamSpec->Prefix += '.';
+ volStreamSpec->TempFiles = &tempFiles;
+ volStreamSpec->Init();
+
+ /*
+ updateCallbackSpec->VolumesSizes = volumesSizes;
+ updateCallbackSpec->VolName = archivePath.Prefix + archivePath.Name;
+ if (!archivePath.VolExtension.IsEmpty())
+ updateCallbackSpec->VolExt = UString('.') + archivePath.VolExtension;
+ */
+ }
+
+ RINOK(SetProperties(outArchive, options.MethodMode.Properties));
+
+ if (options.SfxMode)
+ {
+ CInFileStream *sfxStreamSpec = new CInFileStream;
+ CMyComPtr<IInStream> sfxStream(sfxStreamSpec);
+ if (!sfxStreamSpec->Open(options.SfxModule))
+ return errorInfo.SetFromLastError("cannot open SFX module", options.SfxModule);
+
+ CMyComPtr<ISequentialOutStream> sfxOutStream;
+ COutFileStream *outStreamSpec2 = NULL;
+ if (options.VolumesSizes.Size() == 0)
+ sfxOutStream = outStream;
+ else
+ {
+ outStreamSpec2 = new COutFileStream;
+ sfxOutStream = outStreamSpec2;
+ FString realPath = us2fs(archivePath.GetFinalPath());
+ if (!outStreamSpec2->Create(realPath, false))
+ return errorInfo.SetFromLastError("cannot open file", realPath);
+ }
+
+ {
+ UInt64 sfxSize;
+ RINOK(sfxStreamSpec->GetSize(&sfxSize));
+ RINOK(callback->WriteSfx(fs2us(options.SfxModule), sfxSize));
+ }
+
+ RINOK(NCompress::CopyStream(sfxStream, sfxOutStream, NULL));
+
+ if (outStreamSpec2)
+ {
+ RINOK(outStreamSpec2->Close());
+ }
+ }
+
+ CMyComPtr<ISequentialOutStream> tailStream;
+
+ if (options.SfxMode || !arc || arc->ArcStreamOffset == 0)
+ tailStream = outStream;
+ else
+ {
+ // Int64 globalOffset = arc->GetGlobalOffset();
+ RINOK(arc->InStream->Seek(0, STREAM_SEEK_SET, NULL));
+ RINOK(NCompress::CopyStream_ExactSize(arc->InStream, outStream, arc->ArcStreamOffset, NULL));
+ if (options.StdOutMode)
+ tailStream = outStream;
+ else
+ {
+ CTailOutStream *tailStreamSpec = new CTailOutStream;
+ tailStream = tailStreamSpec;
+ tailStreamSpec->Stream = outSeekStream;
+ tailStreamSpec->Offset = arc->ArcStreamOffset;
+ tailStreamSpec->Init();
+ }
+ }
+
+
+ HRESULT result = outArchive->UpdateItems(tailStream, updatePairs2.Size(), updateCallback);
+ // callback->Finalize();
+ RINOK(result);
+
+ if (!updateCallbackSpec->AreAllFilesClosed())
+ {
+ errorInfo.Message = "There are unclosed input file:";
+ errorInfo.FileNames = updateCallbackSpec->_openFiles_Paths;
+ return E_FAIL;
+ }
+
+ if (options.SetArcMTime)
+ {
+ FILETIME ft;
+ ft.dwLowDateTime = 0;
+ ft.dwHighDateTime = 0;
+ FOR_VECTOR (i, updatePairs2)
+ {
+ CUpdatePair2 &pair2 = updatePairs2[i];
+ const FILETIME *ft2 = NULL;
+ if (pair2.NewProps && pair2.DirIndex >= 0)
+ ft2 = &dirItems.Items[pair2.DirIndex].MTime;
+ else if (pair2.UseArcProps && pair2.ArcIndex >= 0)
+ ft2 = &arcItems[pair2.ArcIndex].MTime;
+ if (ft2)
+ {
+ if (::CompareFileTime(&ft, ft2) < 0)
+ ft = *ft2;
+ }
+ }
+ if (ft.dwLowDateTime != 0 || ft.dwHighDateTime != 0)
+ {
+ if (outStreamSpec)
+ outStreamSpec->SetMTime(&ft);
+ else if (volStreamSpec)
+ volStreamSpec->SetMTime(&ft);;
+ }
+ }
+
+ if (callback)
+ {
+ UInt64 size = 0;
+ if (outStreamSpec)
+ outStreamSpec->GetSize(&size);
+ else if (stdOutFileStreamSpec)
+ size = stdOutFileStreamSpec->GetSize();
+ else
+ size = volStreamSpec->GetSize();
+
+ st.OutArcFileSize = size;
+ }
+
+ if (outStreamSpec)
+ result = outStreamSpec->Close();
+ else if (volStreamSpec)
+ result = volStreamSpec->Close();
+ return result;
+}
+
+bool CensorNode_CheckPath2(const NWildcard::CCensorNode &node, const CReadArcItem &item, bool &include);
+
+static bool Censor_CheckPath(const NWildcard::CCensor &censor, const CReadArcItem &item)
+{
+ bool finded = false;
+ FOR_VECTOR (i, censor.Pairs)
+ {
+ bool include;
+ if (CensorNode_CheckPath2(censor.Pairs[i].Head, item, include))
+ {
+ if (!include)
+ return false;
+ finded = true;
+ }
+ }
+ return finded;
+}
+
+static HRESULT EnumerateInArchiveItems(
+ // bool storeStreamsMode,
+ const NWildcard::CCensor &censor,
+ const CArc &arc,
+ CObjectVector<CArcItem> &arcItems)
+{
+ arcItems.Clear();
+ UInt32 numItems;
+ IInArchive *archive = arc.Archive;
+ RINOK(archive->GetNumberOfItems(&numItems));
+ arcItems.ClearAndReserve(numItems);
+
+ CReadArcItem item;
+
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ CArcItem ai;
+
+ RINOK(arc.GetItem(i, item));
+ ai.Name = item.Path;
+ ai.IsDir = item.IsDir;
+ ai.IsAltStream =
+ #ifdef SUPPORT_ALT_STREAMS
+ item.IsAltStream;
+ #else
+ false;
+ #endif
+
+ /*
+ if (!storeStreamsMode && ai.IsAltStream)
+ continue;
+ */
+ ai.Censored = Censor_CheckPath(censor, item);
+
+ RINOK(arc.GetItemMTime(i, ai.MTime, ai.MTimeDefined));
+ RINOK(arc.GetItemSize(i, ai.Size, ai.SizeDefined));
+
+ {
+ CPropVariant prop;
+ RINOK(archive->GetProperty(i, kpidTimeType, &prop));
+ if (prop.vt == VT_UI4)
+ {
+ ai.TimeType = (int)(NFileTimeType::EEnum)prop.ulVal;
+ switch (ai.TimeType)
+ {
+ case NFileTimeType::kWindows:
+ case NFileTimeType::kUnix:
+ case NFileTimeType::kDOS:
+ break;
+ default:
+ return E_FAIL;
+ }
+ }
+ }
+
+ ai.IndexInServer = i;
+ arcItems.AddInReserved(ai);
+ }
+ return S_OK;
+}
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+#include <mapi.h>
+
+#endif
+
+HRESULT UpdateArchive(
+ CCodecs *codecs,
+ const CObjectVector<COpenType> &types,
+ const UString &cmdArcPath2,
+ NWildcard::CCensor &censor,
+ CUpdateOptions &options,
+ CUpdateErrorInfo &errorInfo,
+ IOpenCallbackUI *openCallback,
+ IUpdateCallbackUI2 *callback,
+ bool needSetPath)
+{
+ if (options.StdOutMode && options.EMailMode)
+ return E_FAIL;
+
+ if (types.Size() > 1)
+ return E_NOTIMPL;
+
+ bool renameMode = !options.RenamePairs.IsEmpty();
+ if (renameMode)
+ {
+ if (options.Commands.Size() != 1)
+ return E_FAIL;
+ }
+
+ if (options.DeleteAfterCompressing)
+ {
+ if (options.Commands.Size() != 1)
+ return E_NOTIMPL;
+ const CActionSet &as = options.Commands[0].ActionSet;
+ for (int i = 2; i < NPairState::kNumValues; i++)
+ if (as.StateActions[i] != NPairAction::kCompress)
+ return E_NOTIMPL;
+ }
+
+ censor.AddPathsToCensor(options.PathMode);
+ #ifdef _WIN32
+ ConvertToLongNames(censor);
+ #endif
+ censor.ExtendExclude();
+
+
+ if (options.VolumesSizes.Size() > 0 && (options.EMailMode /* || options.SfxMode */))
+ return E_NOTIMPL;
+
+ if (options.SfxMode)
+ {
+ CProperty property;
+ property.Name = "rsfx";
+ options.MethodMode.Properties.Add(property);
+ if (options.SfxModule.IsEmpty())
+ {
+ errorInfo.Message = "SFX file is not specified";
+ return E_FAIL;
+ }
+ bool found = false;
+ if (options.SfxModule.Find(FCHAR_PATH_SEPARATOR) < 0)
+ {
+ const FString fullName = NDLL::GetModuleDirPrefix() + options.SfxModule;
+ if (NFind::DoesFileExist(fullName))
+ {
+ options.SfxModule = fullName;
+ found = true;
+ }
+ }
+ if (!found)
+ {
+ if (!NFind::DoesFileExist(options.SfxModule))
+ return errorInfo.SetFromLastError("cannot find specified SFX module", options.SfxModule);
+ }
+ }
+
+ CArchiveLink arcLink;
+
+
+ if (needSetPath)
+ {
+ if (!options.InitFormatIndex(codecs, types, cmdArcPath2) ||
+ !options.SetArcPath(codecs, cmdArcPath2))
+ return E_NOTIMPL;
+ }
+
+ UString arcPath = options.ArchivePath.GetFinalPath();
+
+ if (!options.VolumesSizes.IsEmpty())
+ {
+ arcPath = options.ArchivePath.GetFinalVolPath();
+ arcPath += '.';
+ arcPath += "001";
+ }
+
+ if (cmdArcPath2.IsEmpty())
+ {
+ if (options.MethodMode.Type.FormatIndex < 0)
+ throw "type of archive is not specified";
+ }
+ else
+ {
+ NFind::CFileInfo fi;
+ if (!fi.Find(us2fs(arcPath)))
+ {
+ if (renameMode)
+ throw "can't find archive";;
+ if (options.MethodMode.Type.FormatIndex < 0)
+ {
+ if (!options.SetArcPath(codecs, cmdArcPath2))
+ return E_NOTIMPL;
+ }
+ }
+ else
+ {
+ if (fi.IsDir())
+ throw "there is no such archive";
+ if (fi.IsDevice)
+ return E_NOTIMPL;
+
+ if (!options.StdOutMode && options.UpdateArchiveItself)
+ if (fi.IsReadOnly())
+ {
+ errorInfo.SystemError = ERROR_ACCESS_DENIED;
+ errorInfo.Message = "The file is read-only";
+ errorInfo.FileNames.Add(arcPath);
+ return errorInfo.Get_HRESULT_Error();
+ }
+
+ if (options.VolumesSizes.Size() > 0)
+ {
+ errorInfo.FileNames.Add(us2fs(arcPath));
+ errorInfo.SystemError = (DWORD)E_NOTIMPL;
+ errorInfo.Message = kUpdateIsNotSupoorted_MultiVol;
+ return E_NOTIMPL;
+ }
+ CObjectVector<COpenType> types2;
+ // change it.
+ if (options.MethodMode.Type_Defined)
+ types2.Add(options.MethodMode.Type);
+ // We need to set Properties to open archive only in some cases (WIM archives).
+
+ CIntVector excl;
+ COpenOptions op;
+ #ifndef _SFX
+ op.props = &options.MethodMode.Properties;
+ #endif
+ op.codecs = codecs;
+ op.types = &types2;
+ op.excludedFormats = &excl;
+ op.stdInMode = false;
+ op.stream = NULL;
+ op.filePath = arcPath;
+
+ RINOK(callback->StartOpenArchive(arcPath));
+
+ HRESULT result = arcLink.Open_Strict(op, openCallback);
+
+ if (result == E_ABORT)
+ return result;
+
+ HRESULT res2 = callback->OpenResult(codecs, arcLink, arcPath, result);
+ /*
+ if (result == S_FALSE)
+ return E_FAIL;
+ */
+ RINOK(res2);
+ RINOK(result);
+
+ if (arcLink.VolumePaths.Size() > 1)
+ {
+ errorInfo.SystemError = (DWORD)E_NOTIMPL;
+ errorInfo.Message = kUpdateIsNotSupoorted_MultiVol;
+ return E_NOTIMPL;
+ }
+
+ CArc &arc = arcLink.Arcs.Back();
+ arc.MTimeDefined = !fi.IsDevice;
+ arc.MTime = fi.MTime;
+
+ if (arc.ErrorInfo.ThereIsTail)
+ {
+ errorInfo.SystemError = (DWORD)E_NOTIMPL;
+ errorInfo.Message = "There is some data block after the end of the archive";
+ return E_NOTIMPL;
+ }
+ if (options.MethodMode.Type.FormatIndex < 0)
+ {
+ options.MethodMode.Type.FormatIndex = arcLink.GetArc()->FormatIndex;
+ if (!options.SetArcPath(codecs, cmdArcPath2))
+ return E_NOTIMPL;
+ }
+ }
+ }
+
+ if (options.MethodMode.Type.FormatIndex < 0)
+ {
+ options.MethodMode.Type.FormatIndex = codecs->FindFormatForArchiveType((UString)kDefaultArcType);
+ if (options.MethodMode.Type.FormatIndex < 0)
+ return E_NOTIMPL;
+ }
+
+ bool thereIsInArchive = arcLink.IsOpen;
+ if (!thereIsInArchive && renameMode)
+ return E_FAIL;
+
+ CDirItems dirItems;
+ dirItems.Callback = callback;
+
+ CDirItem parentDirItem;
+ CDirItem *parentDirItem_Ptr = NULL;
+
+ /*
+ FStringVector requestedPaths;
+ FStringVector *requestedPaths_Ptr = NULL;
+ if (options.DeleteAfterCompressing)
+ requestedPaths_Ptr = &requestedPaths;
+ */
+
+ if (options.StdInMode)
+ {
+ CDirItem di;
+ di.Name = options.StdInFileName;
+ di.Size = (UInt64)(Int64)-1;
+ di.Attrib = 0;
+ NTime::GetCurUtcFileTime(di.MTime);
+ di.CTime = di.ATime = di.MTime;
+ dirItems.Items.Add(di);
+ }
+ else
+ {
+ bool needScanning = false;
+
+ if (!renameMode)
+ FOR_VECTOR (i, options.Commands)
+ if (options.Commands[i].ActionSet.NeedScanning())
+ needScanning = true;
+
+ if (needScanning)
+ {
+ RINOK(callback->StartScanning());
+
+ dirItems.SymLinks = options.SymLinks.Val;
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ dirItems.ReadSecure = options.NtSecurity.Val;
+ #endif
+
+ dirItems.ScanAltStreams = options.AltStreams.Val;
+
+ HRESULT res = EnumerateItems(censor,
+ options.PathMode,
+ options.AddPathPrefix,
+ dirItems);
+
+ if (res != S_OK)
+ {
+ if (res != E_ABORT)
+ errorInfo.Message = "Scanning error";
+ return res;
+ }
+
+ RINOK(callback->FinishScanning(dirItems.Stat));
+
+ if (censor.Pairs.Size() == 1)
+ {
+ NFind::CFileInfo fi;
+ FString prefix = us2fs(censor.Pairs[0].Prefix);
+ prefix += '.';
+ // UString prefix = censor.Pairs[0].Prefix;
+ /*
+ if (prefix.Back() == WCHAR_PATH_SEPARATOR)
+ {
+ prefix.DeleteBack();
+ }
+ */
+ if (fi.Find(prefix))
+ if (fi.IsDir())
+ {
+ parentDirItem.Size = fi.Size;
+ parentDirItem.CTime = fi.CTime;
+ parentDirItem.ATime = fi.ATime;
+ parentDirItem.MTime = fi.MTime;
+ parentDirItem.Attrib = fi.Attrib;
+ parentDirItem_Ptr = &parentDirItem;
+
+ int secureIndex = -1;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (options.NtSecurity.Val)
+ dirItems.AddSecurityItem(prefix, secureIndex);
+ #endif
+ parentDirItem.SecureIndex = secureIndex;
+
+ parentDirItem_Ptr = &parentDirItem;
+ }
+ }
+ }
+ }
+
+ FString tempDirPrefix;
+ bool usesTempDir = false;
+
+ #ifdef _WIN32
+ CTempDir tempDirectory;
+ if (options.EMailMode && options.EMailRemoveAfter)
+ {
+ tempDirectory.Create(kTempFolderPrefix);
+ tempDirPrefix = tempDirectory.GetPath();
+ NormalizeDirPathPrefix(tempDirPrefix);
+ usesTempDir = true;
+ }
+ #endif
+
+ CTempFiles tempFiles;
+
+ bool createTempFile = false;
+
+ if (!options.StdOutMode && options.UpdateArchiveItself)
+ {
+ CArchivePath &ap = options.Commands[0].ArchivePath;
+ ap = options.ArchivePath;
+ // if ((archive != 0 && !usesTempDir) || !options.WorkingDir.IsEmpty())
+ if ((thereIsInArchive || !options.WorkingDir.IsEmpty()) && !usesTempDir && options.VolumesSizes.Size() == 0)
+ {
+ createTempFile = true;
+ ap.Temp = true;
+ if (!options.WorkingDir.IsEmpty())
+ ap.TempPrefix = options.WorkingDir;
+ else
+ ap.TempPrefix = us2fs(ap.Prefix);
+ NormalizeDirPathPrefix(ap.TempPrefix);
+ }
+ }
+
+ unsigned ci;
+
+ for (ci = 0; ci < options.Commands.Size(); ci++)
+ {
+ CArchivePath &ap = options.Commands[ci].ArchivePath;
+ if (usesTempDir)
+ {
+ // Check it
+ ap.Prefix = fs2us(tempDirPrefix);
+ // ap.Temp = true;
+ // ap.TempPrefix = tempDirPrefix;
+ }
+ if (!options.StdOutMode &&
+ (ci > 0 || !createTempFile))
+ {
+ const FString path = us2fs(ap.GetFinalPath());
+ if (NFind::DoesFileOrDirExist(path))
+ {
+ errorInfo.SystemError = ERROR_FILE_EXISTS;
+ errorInfo.Message = "The file already exists";
+ errorInfo.FileNames.Add(path);
+ return errorInfo.Get_HRESULT_Error();
+ }
+ }
+ }
+
+ CObjectVector<CArcItem> arcItems;
+ if (thereIsInArchive)
+ {
+ RINOK(EnumerateInArchiveItems(
+ // options.StoreAltStreams,
+ censor, arcLink.Arcs.Back(), arcItems));
+ }
+
+ /*
+ FStringVector processedFilePaths;
+ FStringVector *processedFilePaths_Ptr = NULL;
+ if (options.DeleteAfterCompressing)
+ processedFilePaths_Ptr = &processedFilePaths;
+ */
+
+ CByteBuffer processedItems;
+ if (options.DeleteAfterCompressing)
+ {
+ unsigned num = dirItems.Items.Size();
+ processedItems.Alloc(num);
+ for (unsigned i = 0; i < num; i++)
+ processedItems[i] = 0;
+ }
+
+ /*
+ #ifndef _NO_CRYPTO
+ if (arcLink.PasswordWasAsked)
+ {
+ // We set password, if open have requested password
+ RINOK(callback->SetPassword(arcLink.Password));
+ }
+ #endif
+ */
+
+ for (ci = 0; ci < options.Commands.Size(); ci++)
+ {
+ const CArc *arc = thereIsInArchive ? arcLink.GetArc() : NULL;
+ CUpdateArchiveCommand &command = options.Commands[ci];
+ UString name;
+ bool isUpdating;
+
+ if (options.StdOutMode)
+ {
+ name = "stdout";
+ isUpdating = thereIsInArchive;
+ }
+ else
+ {
+ name = command.ArchivePath.GetFinalPath();
+ isUpdating = (ci == 0 && options.UpdateArchiveItself && thereIsInArchive);
+ }
+
+ RINOK(callback->StartArchive(name, isUpdating))
+
+ CFinishArchiveStat st;
+
+ RINOK(Compress(options,
+ isUpdating,
+ codecs,
+ command.ActionSet,
+ arc,
+ command.ArchivePath,
+ arcItems,
+ options.DeleteAfterCompressing ? (Byte *)processedItems : NULL,
+
+ dirItems,
+ parentDirItem_Ptr,
+
+ tempFiles,
+ errorInfo, callback, st));
+
+ RINOK(callback->FinishArchive(st));
+ }
+
+
+ if (thereIsInArchive)
+ {
+ RINOK(arcLink.Close());
+ arcLink.Release();
+ }
+
+ tempFiles.Paths.Clear();
+ if (createTempFile)
+ {
+ try
+ {
+ CArchivePath &ap = options.Commands[0].ArchivePath;
+ const FString &tempPath = ap.GetTempPath();
+
+ // DWORD attrib = 0;
+ if (thereIsInArchive)
+ {
+ // attrib = NFind::GetFileAttrib(us2fs(arcPath));
+ if (!DeleteFileAlways(us2fs(arcPath)))
+ return errorInfo.SetFromLastError("cannot delete the file", us2fs(arcPath));
+ }
+
+ if (!MyMoveFile(tempPath, us2fs(arcPath)))
+ {
+ errorInfo.SetFromLastError("cannot move the file", tempPath);
+ errorInfo.FileNames.Add(us2fs(arcPath));
+ return errorInfo.Get_HRESULT_Error();
+ }
+
+ /*
+ if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_READONLY))
+ {
+ DWORD attrib2 = NFind::GetFileAttrib(us2fs(arcPath));
+ if (attrib2 != INVALID_FILE_ATTRIBUTES)
+ NDir::SetFileAttrib(us2fs(arcPath), attrib2 | FILE_ATTRIBUTE_READONLY);
+ }
+ */
+ }
+ catch(...)
+ {
+ throw;
+ }
+ }
+
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+
+ if (options.EMailMode)
+ {
+ NDLL::CLibrary mapiLib;
+ if (!mapiLib.Load(FTEXT("Mapi32.dll")))
+ {
+ errorInfo.SetFromLastError("cannot load Mapi32.dll");
+ return errorInfo.Get_HRESULT_Error();
+ }
+
+ /*
+ LPMAPISENDDOCUMENTS fnSend = (LPMAPISENDDOCUMENTS)mapiLib.GetProc("MAPISendDocuments");
+ if (fnSend == 0)
+ {
+ errorInfo.SetFromLastError)("7-Zip cannot find MAPISendDocuments function");
+ return errorInfo.Get_HRESULT_Error();
+ }
+ */
+
+ LPMAPISENDMAIL sendMail = (LPMAPISENDMAIL)mapiLib.GetProc("MAPISendMail");
+ if (sendMail == 0)
+ {
+ errorInfo.SetFromLastError("7-Zip cannot find MAPISendMail function");
+ return errorInfo.Get_HRESULT_Error();;
+ }
+
+ FStringVector fullPaths;
+ unsigned i;
+
+ for (i = 0; i < options.Commands.Size(); i++)
+ {
+ CArchivePath &ap = options.Commands[i].ArchivePath;
+ FString finalPath = us2fs(ap.GetFinalPath());
+ FString arcPath2;
+ if (!MyGetFullPathName(finalPath, arcPath2))
+ return errorInfo.SetFromLastError("GetFullPathName error", finalPath);
+ fullPaths.Add(arcPath2);
+ }
+
+ CCurrentDirRestorer curDirRestorer;
+
+ for (i = 0; i < fullPaths.Size(); i++)
+ {
+ const UString arcPath2 = fs2us(fullPaths[i]);
+ const UString fileName = ExtractFileNameFromPath(arcPath2);
+ const AString path (GetAnsiString(arcPath2));
+ const AString name (GetAnsiString(fileName));
+ // Warning!!! MAPISendDocuments function changes Current directory
+ // fnSend(0, ";", (LPSTR)(LPCSTR)path, (LPSTR)(LPCSTR)name, 0);
+
+ MapiFileDesc f;
+ memset(&f, 0, sizeof(f));
+ f.nPosition = 0xFFFFFFFF;
+ f.lpszPathName = (char *)(const char *)path;
+ f.lpszFileName = (char *)(const char *)name;
+
+ MapiMessage m;
+ memset(&m, 0, sizeof(m));
+ m.nFileCount = 1;
+ m.lpFiles = &f;
+
+ const AString addr (GetAnsiString(options.EMailAddress));
+ MapiRecipDesc rec;
+ if (!addr.IsEmpty())
+ {
+ memset(&rec, 0, sizeof(rec));
+ rec.ulRecipClass = MAPI_TO;
+ rec.lpszAddress = (char *)(const char *)addr;
+ m.nRecipCount = 1;
+ m.lpRecips = &rec;
+ }
+
+ sendMail((LHANDLE)0, 0, &m, MAPI_DIALOG, 0);
+ }
+ }
+
+ #endif
+
+ if (options.DeleteAfterCompressing)
+ {
+ CRecordVector<CDirPathSortPair> pairs;
+ FStringVector foldersNames;
+
+ unsigned i;
+
+ for (i = 0; i < dirItems.Items.Size(); i++)
+ {
+ const CDirItem &dirItem = dirItems.Items[i];
+ const FString phyPath = dirItems.GetPhyPath(i);
+ if (dirItem.IsDir())
+ {
+ CDirPathSortPair pair;
+ pair.Index = i;
+ pair.SetNumSlashes(phyPath);
+ pairs.Add(pair);
+ }
+ else
+ {
+ if (processedItems[i] != 0 || dirItem.Size == 0)
+ {
+ NFind::CFileInfo fileInfo;
+ if (fileInfo.Find(phyPath))
+ {
+ // maybe we must exclude also files with archive name: "a a.7z * -sdel"
+ if (fileInfo.Size == dirItem.Size
+ && CompareFileTime(&fileInfo.MTime, &dirItem.MTime) == 0
+ && CompareFileTime(&fileInfo.CTime, &dirItem.CTime) == 0)
+ {
+ RINOK(callback->DeletingAfterArchiving(phyPath, false));
+ DeleteFileAlways(phyPath);
+ }
+ }
+ }
+ else
+ {
+ // file was skipped
+ /*
+ errorInfo.SystemError = 0;
+ errorInfo.Message = "file was not processed";
+ errorInfo.FileName = phyPath;
+ return E_FAIL;
+ */
+ }
+ }
+ }
+
+ pairs.Sort2();
+
+ for (i = 0; i < pairs.Size(); i++)
+ {
+ const FString phyPath = dirItems.GetPhyPath(pairs[i].Index);
+ if (NFind::DoesDirExist(phyPath))
+ {
+ RINOK(callback->DeletingAfterArchiving(phyPath, true));
+ RemoveDir(phyPath);
+ }
+ }
+
+ RINOK(callback->FinishDeletingAfterArchiving());
+ }
+
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.h
new file mode 100644
index 0000000000..45b02d7408
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/Update.h
@@ -0,0 +1,200 @@
+// Update.h
+
+#ifndef __COMMON_UPDATE_H
+#define __COMMON_UPDATE_H
+
+#include "../../../Common/Wildcard.h"
+
+#include "ArchiveOpenCallback.h"
+#include "LoadCodecs.h"
+#include "OpenArchive.h"
+#include "Property.h"
+#include "UpdateAction.h"
+#include "UpdateCallback.h"
+
+#include "DirItem.h"
+
+enum EArcNameMode
+{
+ k_ArcNameMode_Smart,
+ k_ArcNameMode_Exact,
+ k_ArcNameMode_Add,
+};
+
+struct CArchivePath
+{
+ UString OriginalPath;
+
+ UString Prefix; // path(folder) prefix including slash
+ UString Name; // base name
+ UString BaseExtension; // archive type extension or "exe" extension
+ UString VolExtension; // archive type extension for volumes
+
+ bool Temp;
+ FString TempPrefix; // path(folder) for temp location
+ FString TempPostfix;
+
+ CArchivePath(): Temp(false) {};
+
+ void ParseFromPath(const UString &path, EArcNameMode mode);
+ UString GetPathWithoutExt() const { return Prefix + Name; }
+ UString GetFinalPath() const;
+ UString GetFinalVolPath() const;
+ FString GetTempPath() const;
+};
+
+struct CUpdateArchiveCommand
+{
+ UString UserArchivePath;
+ CArchivePath ArchivePath;
+ NUpdateArchive::CActionSet ActionSet;
+};
+
+struct CCompressionMethodMode
+{
+ bool Type_Defined;
+ COpenType Type;
+ CObjectVector<CProperty> Properties;
+
+ CCompressionMethodMode(): Type_Defined(false) {}
+};
+
+namespace NRecursedType { enum EEnum
+{
+ kRecursed,
+ kWildcardOnlyRecursed,
+ kNonRecursed
+};}
+
+struct CRenamePair
+{
+ UString OldName;
+ UString NewName;
+ bool WildcardParsing;
+ NRecursedType::EEnum RecursedType;
+
+ CRenamePair(): WildcardParsing(true), RecursedType(NRecursedType::kNonRecursed) {}
+
+ bool Prepare();
+ bool GetNewPath(bool isFolder, const UString &src, UString &dest) const;
+};
+
+struct CUpdateOptions
+{
+ CCompressionMethodMode MethodMode;
+
+ CObjectVector<CUpdateArchiveCommand> Commands;
+ bool UpdateArchiveItself;
+ CArchivePath ArchivePath;
+ EArcNameMode ArcNameMode;
+
+ bool SfxMode;
+ FString SfxModule;
+
+ bool OpenShareForWrite;
+ bool StopAfterOpenError;
+
+ bool StdInMode;
+ UString StdInFileName;
+ bool StdOutMode;
+
+ bool EMailMode;
+ bool EMailRemoveAfter;
+ UString EMailAddress;
+
+ FString WorkingDir;
+ NWildcard::ECensorPathMode PathMode;
+ UString AddPathPrefix;
+
+ CBoolPair NtSecurity;
+ CBoolPair AltStreams;
+ CBoolPair HardLinks;
+ CBoolPair SymLinks;
+
+ bool DeleteAfterCompressing;
+
+ bool SetArcMTime;
+
+ CObjectVector<CRenamePair> RenamePairs;
+
+ bool InitFormatIndex(const CCodecs *codecs, const CObjectVector<COpenType> &types, const UString &arcPath);
+ bool SetArcPath(const CCodecs *codecs, const UString &arcPath);
+
+ CUpdateOptions():
+ UpdateArchiveItself(true),
+ SfxMode(false),
+ StdInMode(false),
+ StdOutMode(false),
+ EMailMode(false),
+ EMailRemoveAfter(false),
+ OpenShareForWrite(false),
+ StopAfterOpenError(false),
+ ArcNameMode(k_ArcNameMode_Smart),
+ PathMode(NWildcard::k_RelatPath),
+
+ DeleteAfterCompressing(false),
+ SetArcMTime(false)
+
+ {};
+
+ void SetActionCommand_Add()
+ {
+ Commands.Clear();
+ CUpdateArchiveCommand c;
+ c.ActionSet = NUpdateArchive::k_ActionSet_Add;
+ Commands.Add(c);
+ }
+
+ CRecordVector<UInt64> VolumesSizes;
+};
+
+struct CUpdateErrorInfo
+{
+ DWORD SystemError;
+ AString Message;
+ FStringVector FileNames;
+
+ bool ThereIsError() const { return SystemError != 0 || !Message.IsEmpty() || !FileNames.IsEmpty(); }
+ HRESULT Get_HRESULT_Error() const { return SystemError == 0 ? E_FAIL : HRESULT_FROM_WIN32(SystemError); }
+ void SetFromLastError(const char *message);
+ HRESULT SetFromLastError(const char *message, const FString &fileName);
+
+ CUpdateErrorInfo(): SystemError(0) {};
+};
+
+struct CFinishArchiveStat
+{
+ UInt64 OutArcFileSize;
+
+ CFinishArchiveStat(): OutArcFileSize(0) {}
+};
+
+#define INTERFACE_IUpdateCallbackUI2(x) \
+ INTERFACE_IUpdateCallbackUI(x) \
+ INTERFACE_IDirItemsCallback(x) \
+ virtual HRESULT OpenResult(const CCodecs *codecs, const CArchiveLink &arcLink, const wchar_t *name, HRESULT result) x; \
+ virtual HRESULT StartScanning() x; \
+ virtual HRESULT FinishScanning(const CDirItemsStat &st) x; \
+ virtual HRESULT StartOpenArchive(const wchar_t *name) x; \
+ virtual HRESULT StartArchive(const wchar_t *name, bool updating) x; \
+ virtual HRESULT FinishArchive(const CFinishArchiveStat &st) x; \
+ virtual HRESULT DeletingAfterArchiving(const FString &path, bool isDir) x; \
+ virtual HRESULT FinishDeletingAfterArchiving() x; \
+
+struct IUpdateCallbackUI2: public IUpdateCallbackUI, public IDirItemsCallback
+{
+ INTERFACE_IUpdateCallbackUI2(=0)
+};
+
+HRESULT UpdateArchive(
+ CCodecs *codecs,
+ const CObjectVector<COpenType> &types,
+ const UString &cmdArcPath2,
+ NWildcard::CCensor &censor,
+ CUpdateOptions &options,
+ CUpdateErrorInfo &errorInfo,
+ IOpenCallbackUI *openCallback,
+ IUpdateCallbackUI2 *callback,
+ bool needSetPath);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.cpp
new file mode 100644
index 0000000000..ba138d201c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.cpp
@@ -0,0 +1,64 @@
+// UpdateAction.cpp
+
+#include "StdAfx.h"
+
+#include "UpdateAction.h"
+
+namespace NUpdateArchive {
+
+const CActionSet k_ActionSet_Add =
+{{
+ NPairAction::kCopy,
+ NPairAction::kCopy,
+ NPairAction::kCompress,
+ NPairAction::kCompress,
+ NPairAction::kCompress,
+ NPairAction::kCompress,
+ NPairAction::kCompress
+}};
+
+const CActionSet k_ActionSet_Update =
+{{
+ NPairAction::kCopy,
+ NPairAction::kCopy,
+ NPairAction::kCompress,
+ NPairAction::kCopy,
+ NPairAction::kCompress,
+ NPairAction::kCopy,
+ NPairAction::kCompress
+}};
+
+const CActionSet k_ActionSet_Fresh =
+{{
+ NPairAction::kCopy,
+ NPairAction::kCopy,
+ NPairAction::kIgnore,
+ NPairAction::kCopy,
+ NPairAction::kCompress,
+ NPairAction::kCopy,
+ NPairAction::kCompress
+}};
+
+const CActionSet k_ActionSet_Sync =
+{{
+ NPairAction::kCopy,
+ NPairAction::kIgnore,
+ NPairAction::kCompress,
+ NPairAction::kCopy,
+ NPairAction::kCompress,
+ NPairAction::kCopy,
+ NPairAction::kCompress,
+}};
+
+const CActionSet k_ActionSet_Delete =
+{{
+ NPairAction::kCopy,
+ NPairAction::kIgnore,
+ NPairAction::kIgnore,
+ NPairAction::kIgnore,
+ NPairAction::kIgnore,
+ NPairAction::kIgnore,
+ NPairAction::kIgnore
+}};
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.h
new file mode 100644
index 0000000000..8d6002f0bd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateAction.h
@@ -0,0 +1,66 @@
+// UpdateAction.h
+
+#ifndef __UPDATE_ACTION_H
+#define __UPDATE_ACTION_H
+
+namespace NUpdateArchive {
+
+ namespace NPairState
+ {
+ const unsigned kNumValues = 7;
+ enum EEnum
+ {
+ kNotMasked = 0,
+ kOnlyInArchive,
+ kOnlyOnDisk,
+ kNewInArchive,
+ kOldInArchive,
+ kSameFiles,
+ kUnknowNewerFiles
+ };
+ }
+
+ namespace NPairAction
+ {
+ enum EEnum
+ {
+ kIgnore = 0,
+ kCopy,
+ kCompress,
+ kCompressAsAnti
+ };
+ }
+
+ struct CActionSet
+ {
+ NPairAction::EEnum StateActions[NPairState::kNumValues];
+
+ bool IsEqualTo(const CActionSet &a) const
+ {
+ for (unsigned i = 0; i < NPairState::kNumValues; i++)
+ if (StateActions[i] != a.StateActions[i])
+ return false;
+ return true;
+ }
+
+ bool NeedScanning() const
+ {
+ unsigned i;
+ for (i = 0; i < NPairState::kNumValues; i++)
+ if (StateActions[i] == NPairAction::kCompress)
+ return true;
+ for (i = 1; i < NPairState::kNumValues; i++)
+ if (StateActions[i] != NPairAction::kIgnore)
+ return true;
+ return false;
+ }
+ };
+
+ extern const CActionSet k_ActionSet_Add;
+ extern const CActionSet k_ActionSet_Update;
+ extern const CActionSet k_ActionSet_Fresh;
+ extern const CActionSet k_ActionSet_Sync;
+ extern const CActionSet k_ActionSet_Delete;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.cpp
new file mode 100644
index 0000000000..9c165fe939
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.cpp
@@ -0,0 +1,771 @@
+// UpdateCallback.cpp
+
+#include "StdAfx.h"
+
+#ifndef _7ZIP_ST
+#include "../../../Windows/Synchronization.h"
+#endif
+
+#include "../../../Common/ComTry.h"
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/PropVariant.h"
+
+#include "../../Common/StreamObjects.h"
+
+#include "UpdateCallback.h"
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+#define _USE_SECURITY_CODE
+#include "../../../Windows/SecurityUtils.h"
+#endif
+
+using namespace NWindows;
+using namespace NFile;
+
+#ifndef _7ZIP_ST
+static NSynchronization::CCriticalSection g_CriticalSection;
+#define MT_LOCK NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+#else
+#define MT_LOCK
+#endif
+
+
+#ifdef _USE_SECURITY_CODE
+bool InitLocalPrivileges();
+#endif
+
+CArchiveUpdateCallback::CArchiveUpdateCallback():
+ _hardIndex_From((UInt32)(Int32)-1),
+
+ Callback(NULL),
+
+ DirItems(NULL),
+ ParentDirItem(NULL),
+
+ Arc(NULL),
+ ArcItems(NULL),
+ UpdatePairs(NULL),
+ NewNames(NULL),
+ CommentIndex(-1),
+ Comment(NULL),
+
+ ShareForWrite(false),
+ StopAfterOpenError(false),
+ StdInMode(false),
+
+ KeepOriginalItemNames(false),
+ StoreNtSecurity(false),
+ StoreHardLinks(false),
+ StoreSymLinks(false),
+
+ ProcessedItemsStatuses(NULL)
+{
+ #ifdef _USE_SECURITY_CODE
+ _saclEnabled = InitLocalPrivileges();
+ #endif
+}
+
+
+STDMETHODIMP CArchiveUpdateCallback::SetTotal(UInt64 size)
+{
+ COM_TRY_BEGIN
+ return Callback->SetTotal(size);
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::SetCompleted(const UInt64 *completeValue)
+{
+ COM_TRY_BEGIN
+ return Callback->SetCompleted(completeValue);
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ COM_TRY_BEGIN
+ return Callback->SetRatioInfo(inSize, outSize);
+ COM_TRY_END
+}
+
+
+/*
+static const CStatProp kProps[] =
+{
+ { NULL, kpidPath, VT_BSTR},
+ { NULL, kpidIsDir, VT_BOOL},
+ { NULL, kpidSize, VT_UI8},
+ { NULL, kpidCTime, VT_FILETIME},
+ { NULL, kpidATime, VT_FILETIME},
+ { NULL, kpidMTime, VT_FILETIME},
+ { NULL, kpidAttrib, VT_UI4},
+ { NULL, kpidIsAnti, VT_BOOL}
+};
+
+STDMETHODIMP CArchiveUpdateCallback::EnumProperties(IEnumSTATPROPSTG **)
+{
+ return CStatPropEnumerator::CreateEnumerator(kProps, ARRAY_SIZE(kProps), enumerator);
+}
+*/
+
+STDMETHODIMP CArchiveUpdateCallback::GetUpdateItemInfo(UInt32 index,
+ Int32 *newData, Int32 *newProps, UInt32 *indexInArchive)
+{
+ COM_TRY_BEGIN
+ RINOK(Callback->CheckBreak());
+ const CUpdatePair2 &up = (*UpdatePairs)[index];
+ if (newData) *newData = BoolToInt(up.NewData);
+ if (newProps) *newProps = BoolToInt(up.NewProps);
+ if (indexInArchive)
+ {
+ *indexInArchive = (UInt32)(Int32)-1;
+ if (up.ExistInArchive())
+ *indexInArchive = (ArcItems == 0) ? up.ArcIndex : (*ArcItems)[up.ArcIndex].IndexInServer;
+ }
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetRootProp(PROPID propID, PROPVARIANT *value)
+{
+ NCOM::CPropVariant prop;
+ switch (propID)
+ {
+ case kpidIsDir: prop = true; break;
+ case kpidAttrib: if (ParentDirItem) prop = ParentDirItem->Attrib; break;
+ case kpidCTime: if (ParentDirItem) prop = ParentDirItem->CTime; break;
+ case kpidATime: if (ParentDirItem) prop = ParentDirItem->ATime; break;
+ case kpidMTime: if (ParentDirItem) prop = ParentDirItem->MTime; break;
+ }
+ prop.Detach(value);
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetParent(UInt32 /* index */, UInt32 *parent, UInt32 *parentType)
+{
+ *parentType = NParentType::kDir;
+ *parent = (UInt32)(Int32)-1;
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetNumRawProps(UInt32 *numProps)
+{
+ *numProps = 0;
+ if (StoreNtSecurity)
+ *numProps = 1;
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetRawPropInfo(UInt32 /* index */, BSTR *name, PROPID *propID)
+{
+ *name = NULL;
+ *propID = kpidNtSecure;
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetRootRawProp(PROPID
+ #ifdef _USE_SECURITY_CODE
+ propID
+ #endif
+ , const void **data, UInt32 *dataSize, UInt32 *propType)
+{
+ *data = 0;
+ *dataSize = 0;
+ *propType = 0;
+ if (!StoreNtSecurity)
+ return S_OK;
+ #ifdef _USE_SECURITY_CODE
+ if (propID == kpidNtSecure)
+ {
+ if (StdInMode)
+ return S_OK;
+
+ if (ParentDirItem)
+ {
+ if (ParentDirItem->SecureIndex < 0)
+ return S_OK;
+ const CByteBuffer &buf = DirItems->SecureBlocks.Bufs[ParentDirItem->SecureIndex];
+ *data = buf;
+ *dataSize = (UInt32)buf.Size();
+ *propType = NPropDataType::kRaw;
+ return S_OK;
+ }
+
+ if (Arc && Arc->GetRootProps)
+ return Arc->GetRootProps->GetRootRawProp(propID, data, dataSize, propType);
+ }
+ #endif
+ return S_OK;
+}
+
+// #ifdef _USE_SECURITY_CODE
+// #endif
+
+STDMETHODIMP CArchiveUpdateCallback::GetRawProp(UInt32 index, PROPID propID, const void **data, UInt32 *dataSize, UInt32 *propType)
+{
+ *data = 0;
+ *dataSize = 0;
+ *propType = 0;
+
+ if (propID == kpidNtSecure ||
+ propID == kpidNtReparse)
+ {
+ if (StdInMode)
+ return S_OK;
+
+ const CUpdatePair2 &up = (*UpdatePairs)[index];
+ if (up.UseArcProps && up.ExistInArchive() && Arc->GetRawProps)
+ return Arc->GetRawProps->GetRawProp(
+ ArcItems ? (*ArcItems)[up.ArcIndex].IndexInServer : up.ArcIndex,
+ propID, data, dataSize, propType);
+ {
+ /*
+ if (!up.NewData)
+ return E_FAIL;
+ */
+ if (up.IsAnti)
+ return S_OK;
+
+ #ifndef UNDER_CE
+ const CDirItem &di = DirItems->Items[up.DirIndex];
+ #endif
+
+ #ifdef _USE_SECURITY_CODE
+ if (propID == kpidNtSecure)
+ {
+ if (!StoreNtSecurity)
+ return S_OK;
+ if (di.SecureIndex < 0)
+ return S_OK;
+ const CByteBuffer &buf = DirItems->SecureBlocks.Bufs[di.SecureIndex];
+ *data = buf;
+ *dataSize = (UInt32)buf.Size();
+ *propType = NPropDataType::kRaw;
+ }
+ else
+ #endif
+ {
+ // propID == kpidNtReparse
+ if (!StoreSymLinks)
+ return S_OK;
+ #ifndef UNDER_CE
+ const CByteBuffer *buf = &di.ReparseData2;
+ if (buf->Size() == 0)
+ buf = &di.ReparseData;
+ if (buf->Size() != 0)
+ {
+ *data = *buf;
+ *dataSize = (UInt32)buf->Size();
+ *propType = NPropDataType::kRaw;
+ }
+ #endif
+ }
+
+ return S_OK;
+ }
+ }
+
+ return S_OK;
+}
+
+#ifndef UNDER_CE
+
+static UString GetRelativePath(const UString &to, const UString &from)
+{
+ UStringVector partsTo, partsFrom;
+ SplitPathToParts(to, partsTo);
+ SplitPathToParts(from, partsFrom);
+
+ unsigned i;
+ for (i = 0;; i++)
+ {
+ if (i + 1 >= partsFrom.Size() ||
+ i + 1 >= partsTo.Size())
+ break;
+ if (CompareFileNames(partsFrom[i], partsTo[i]) != 0)
+ break;
+ }
+
+ if (i == 0)
+ {
+ #ifdef _WIN32
+ if (NName::IsDrivePath(to) ||
+ NName::IsDrivePath(from))
+ return to;
+ #endif
+ }
+
+ UString s;
+ unsigned k;
+
+ for (k = i + 1; k < partsFrom.Size(); k++)
+ s += ".." STRING_PATH_SEPARATOR;
+
+ for (k = i; k < partsTo.Size(); k++)
+ {
+ if (k != i)
+ s.Add_PathSepar();
+ s += partsTo[k];
+ }
+
+ return s;
+}
+
+#endif
+
+STDMETHODIMP CArchiveUpdateCallback::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *value)
+{
+ COM_TRY_BEGIN
+ const CUpdatePair2 &up = (*UpdatePairs)[index];
+ NCOM::CPropVariant prop;
+
+ if (up.NewData)
+ {
+ /*
+ if (propID == kpidIsHardLink)
+ {
+ prop = _isHardLink;
+ prop.Detach(value);
+ return S_OK;
+ }
+ */
+ if (propID == kpidSymLink)
+ {
+ if (index == _hardIndex_From)
+ {
+ prop.Detach(value);
+ return S_OK;
+ }
+ if (up.DirIndex >= 0)
+ {
+ #ifndef UNDER_CE
+ const CDirItem &di = DirItems->Items[up.DirIndex];
+ // if (di.IsDir())
+ {
+ CReparseAttr attr;
+ DWORD errorCode = 0;
+ if (attr.Parse(di.ReparseData, di.ReparseData.Size(), errorCode))
+ {
+ UString simpleName = attr.GetPath();
+ if (attr.IsRelative())
+ prop = simpleName;
+ else
+ {
+ const FString phyPath = DirItems->GetPhyPath(up.DirIndex);
+ FString fullPath;
+ if (NDir::MyGetFullPathName(phyPath, fullPath))
+ {
+ prop = GetRelativePath(simpleName, fs2us(fullPath));
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+ }
+ }
+ #endif
+ }
+ }
+ else if (propID == kpidHardLink)
+ {
+ if (index == _hardIndex_From)
+ {
+ const CKeyKeyValPair &pair = _map[_hardIndex_To];
+ const CUpdatePair2 &up2 = (*UpdatePairs)[pair.Value];
+ prop = DirItems->GetLogPath(up2.DirIndex);
+ prop.Detach(value);
+ return S_OK;
+ }
+ if (up.DirIndex >= 0)
+ {
+ prop.Detach(value);
+ return S_OK;
+ }
+ }
+ }
+
+ if (up.IsAnti
+ && propID != kpidIsDir
+ && propID != kpidPath
+ && propID != kpidIsAltStream)
+ {
+ switch (propID)
+ {
+ case kpidSize: prop = (UInt64)0; break;
+ case kpidIsAnti: prop = true; break;
+ }
+ }
+ else if (propID == kpidPath && up.NewNameIndex >= 0)
+ prop = (*NewNames)[up.NewNameIndex];
+ else if (propID == kpidComment
+ && CommentIndex >= 0
+ && (unsigned)CommentIndex == index
+ && Comment)
+ prop = *Comment;
+ else if (propID == kpidShortName && up.NewNameIndex >= 0 && up.IsMainRenameItem)
+ {
+ // we can generate new ShortName here;
+ }
+ else if ((up.UseArcProps || (KeepOriginalItemNames && (propID == kpidPath || propID == kpidIsAltStream)))
+ && up.ExistInArchive() && Archive)
+ return Archive->GetProperty(ArcItems ? (*ArcItems)[up.ArcIndex].IndexInServer : up.ArcIndex, propID, value);
+ else if (up.ExistOnDisk())
+ {
+ const CDirItem &di = DirItems->Items[up.DirIndex];
+ switch (propID)
+ {
+ case kpidPath: prop = DirItems->GetLogPath(up.DirIndex); break;
+ case kpidIsDir: prop = di.IsDir(); break;
+ case kpidSize: prop = di.IsDir() ? (UInt64)0 : di.Size; break;
+ case kpidAttrib: prop = di.Attrib; break;
+ case kpidCTime: prop = di.CTime; break;
+ case kpidATime: prop = di.ATime; break;
+ case kpidMTime: prop = di.MTime; break;
+ case kpidIsAltStream: prop = di.IsAltStream; break;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // case kpidShortName: prop = di.ShortName; break;
+ #endif
+ }
+ }
+ prop.Detach(value);
+ return S_OK;
+ COM_TRY_END
+}
+
+#ifndef _7ZIP_ST
+static NSynchronization::CCriticalSection CS;
+#endif
+
+STDMETHODIMP CArchiveUpdateCallback::GetStream2(UInt32 index, ISequentialInStream **inStream, UInt32 mode)
+{
+ COM_TRY_BEGIN
+ *inStream = NULL;
+ const CUpdatePair2 &up = (*UpdatePairs)[index];
+ if (!up.NewData)
+ return E_FAIL;
+
+ RINOK(Callback->CheckBreak());
+ // RINOK(Callback->Finalize());
+
+ bool isDir = IsDir(up);
+
+ if (up.IsAnti)
+ {
+ UString name;
+ if (up.ArcIndex >= 0)
+ name = (*ArcItems)[up.ArcIndex].Name;
+ else if (up.DirIndex >= 0)
+ name = DirItems->GetLogPath(up.DirIndex);
+ RINOK(Callback->GetStream(name, isDir, true, mode));
+
+ /* 9.33: fixed. Handlers expect real stream object for files, even for anti-file.
+ so we return empty stream */
+
+ if (!isDir)
+ {
+ CBufInStream *inStreamSpec = new CBufInStream();
+ CMyComPtr<ISequentialInStream> inStreamLoc = inStreamSpec;
+ inStreamSpec->Init(NULL, 0);
+ *inStream = inStreamLoc.Detach();
+ }
+ return S_OK;
+ }
+
+ RINOK(Callback->GetStream(DirItems->GetLogPath(up.DirIndex), isDir, false, mode));
+
+ if (isDir)
+ return S_OK;
+
+ if (StdInMode)
+ {
+ if (mode != NUpdateNotifyOp::kAdd &&
+ mode != NUpdateNotifyOp::kUpdate)
+ return S_OK;
+
+ CStdInFileStream *inStreamSpec = new CStdInFileStream;
+ CMyComPtr<ISequentialInStream> inStreamLoc(inStreamSpec);
+ *inStream = inStreamLoc.Detach();
+ }
+ else
+ {
+ CInFileStream *inStreamSpec = new CInFileStream;
+ CMyComPtr<ISequentialInStream> inStreamLoc(inStreamSpec);
+
+ inStreamSpec->SupportHardLinks = StoreHardLinks;
+ inStreamSpec->Callback = this;
+ inStreamSpec->CallbackRef = index;
+
+ const FString path = DirItems->GetPhyPath(up.DirIndex);
+ _openFiles_Indexes.Add(index);
+ _openFiles_Paths.Add(path);
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (DirItems->Items[up.DirIndex].AreReparseData())
+ {
+ if (!inStreamSpec->File.OpenReparse(path))
+ {
+ return Callback->OpenFileError(path, ::GetLastError());
+ }
+ }
+ else
+ #endif
+ if (!inStreamSpec->OpenShared(path, ShareForWrite))
+ {
+ DWORD error = ::GetLastError();
+ HRESULT hres = Callback->OpenFileError(path, error);
+ if (StopAfterOpenError)
+ if (hres == S_OK || hres == S_FALSE)
+ return HRESULT_FROM_WIN32(error);
+ return hres;
+ }
+
+ if (StoreHardLinks)
+ {
+ CStreamFileProps props;
+ if (inStreamSpec->GetProps2(&props) == S_OK)
+ {
+ if (props.NumLinks > 1)
+ {
+ CKeyKeyValPair pair;
+ pair.Key1 = props.VolID;
+ pair.Key2 = props.FileID_Low;
+ pair.Value = index;
+ unsigned numItems = _map.Size();
+ unsigned pairIndex = _map.AddToUniqueSorted2(pair);
+ if (numItems == _map.Size())
+ {
+ // const CKeyKeyValPair &pair2 = _map.Pairs[pairIndex];
+ _hardIndex_From = index;
+ _hardIndex_To = pairIndex;
+ // we could return NULL as stream, but it's better to return real stream
+ // return S_OK;
+ }
+ }
+ }
+ }
+
+ if (ProcessedItemsStatuses)
+ {
+ #ifndef _7ZIP_ST
+ NSynchronization::CCriticalSectionLock lock(CS);
+ #endif
+ ProcessedItemsStatuses[(unsigned)up.DirIndex] = 1;
+ }
+ *inStream = inStreamLoc.Detach();
+ }
+
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::SetOperationResult(Int32 opRes)
+{
+ COM_TRY_BEGIN
+ return Callback->SetOperationResult(opRes);
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetStream(UInt32 index, ISequentialInStream **inStream)
+{
+ COM_TRY_BEGIN
+ return GetStream2(index, inStream,
+ (*UpdatePairs)[index].ArcIndex < 0 ?
+ NUpdateNotifyOp::kAdd :
+ NUpdateNotifyOp::kUpdate);
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::ReportOperation(UInt32 indexType, UInt32 index, UInt32 op)
+{
+ COM_TRY_BEGIN
+
+ bool isDir = false;
+
+ if (indexType == NArchive::NEventIndexType::kOutArcIndex)
+ {
+ UString name;
+ if (index != (UInt32)(Int32)-1)
+ {
+ const CUpdatePair2 &up = (*UpdatePairs)[index];
+ if (up.ExistOnDisk())
+ {
+ name = DirItems->GetLogPath(up.DirIndex);
+ isDir = DirItems->Items[up.DirIndex].IsDir();
+ }
+ }
+ return Callback->ReportUpdateOpeartion(op, name.IsEmpty() ? NULL : name.Ptr(), isDir);
+ }
+
+ wchar_t temp[16];
+ UString s2;
+ const wchar_t *s = NULL;
+
+ if (indexType == NArchive::NEventIndexType::kInArcIndex)
+ {
+ if (index != (UInt32)(Int32)-1)
+ {
+ if (ArcItems)
+ {
+ const CArcItem &ai = (*ArcItems)[index];
+ s = ai.Name;
+ isDir = ai.IsDir;
+ }
+ else if (Arc)
+ {
+ RINOK(Arc->GetItemPath(index, s2));
+ s = s2;
+ RINOK(Archive_IsItem_Dir(Arc->Archive, index, isDir));
+ }
+ }
+ }
+ else if (indexType == NArchive::NEventIndexType::kBlockIndex)
+ {
+ temp[0] = '#';
+ ConvertUInt32ToString(index, temp + 1);
+ s = temp;
+ }
+
+ if (!s)
+ s = L"";
+
+ return Callback->ReportUpdateOpeartion(op, s, isDir);
+
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::ReportExtractResult(UInt32 indexType, UInt32 index, Int32 opRes)
+{
+ COM_TRY_BEGIN
+
+ bool isEncrypted = false;
+ wchar_t temp[16];
+ UString s2;
+ const wchar_t *s = NULL;
+
+ if (indexType == NArchive::NEventIndexType::kOutArcIndex)
+ {
+ /*
+ UString name;
+ if (index != (UInt32)(Int32)-1)
+ {
+ const CUpdatePair2 &up = (*UpdatePairs)[index];
+ if (up.ExistOnDisk())
+ {
+ s2 = DirItems->GetLogPath(up.DirIndex);
+ s = s2;
+ }
+ }
+ */
+ return E_FAIL;
+ }
+
+ if (indexType == NArchive::NEventIndexType::kInArcIndex)
+ {
+ if (index != (UInt32)(Int32)-1)
+ {
+ if (ArcItems)
+ s = (*ArcItems)[index].Name;
+ else if (Arc)
+ {
+ RINOK(Arc->GetItemPath(index, s2));
+ s = s2;
+ }
+ if (Archive)
+ {
+ RINOK(Archive_GetItemBoolProp(Archive, index, kpidEncrypted, isEncrypted));
+ }
+ }
+ }
+ else if (indexType == NArchive::NEventIndexType::kBlockIndex)
+ {
+ temp[0] = '#';
+ ConvertUInt32ToString(index, temp + 1);
+ s = temp;
+ }
+
+ return Callback->ReportExtractResult(opRes, BoolToInt(isEncrypted), s);
+
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetVolumeSize(UInt32 index, UInt64 *size)
+{
+ if (VolumesSizes.Size() == 0)
+ return S_FALSE;
+ if (index >= (UInt32)VolumesSizes.Size())
+ index = VolumesSizes.Size() - 1;
+ *size = VolumesSizes[index];
+ return S_OK;
+}
+
+STDMETHODIMP CArchiveUpdateCallback::GetVolumeStream(UInt32 index, ISequentialOutStream **volumeStream)
+{
+ COM_TRY_BEGIN
+ char temp[16];
+ ConvertUInt32ToString(index + 1, temp);
+ FString res (temp);
+ while (res.Len() < 2)
+ res.InsertAtFront(FTEXT('0'));
+ FString fileName = VolName;
+ fileName += '.';
+ fileName += res;
+ fileName += VolExt;
+ COutFileStream *streamSpec = new COutFileStream;
+ CMyComPtr<ISequentialOutStream> streamLoc(streamSpec);
+ if (!streamSpec->Create(fileName, false))
+ return ::GetLastError();
+ *volumeStream = streamLoc.Detach();
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password)
+{
+ COM_TRY_BEGIN
+ return Callback->CryptoGetTextPassword2(passwordIsDefined, password);
+ COM_TRY_END
+}
+
+STDMETHODIMP CArchiveUpdateCallback::CryptoGetTextPassword(BSTR *password)
+{
+ COM_TRY_BEGIN
+ return Callback->CryptoGetTextPassword(password);
+ COM_TRY_END
+}
+
+HRESULT CArchiveUpdateCallback::InFileStream_On_Error(UINT_PTR val, DWORD error)
+{
+ if (error == ERROR_LOCK_VIOLATION)
+ {
+ MT_LOCK
+ UInt32 index = (UInt32)val;
+ FOR_VECTOR(i, _openFiles_Indexes)
+ {
+ if (_openFiles_Indexes[i] == index)
+ {
+ RINOK(Callback->ReadingFileError(_openFiles_Paths[i], error));
+ break;
+ }
+ }
+ }
+ return HRESULT_FROM_WIN32(error);
+}
+
+void CArchiveUpdateCallback::InFileStream_On_Destroy(UINT_PTR val)
+{
+ MT_LOCK
+ UInt32 index = (UInt32)val;
+ FOR_VECTOR(i, _openFiles_Indexes)
+ {
+ if (_openFiles_Indexes[i] == index)
+ {
+ _openFiles_Indexes.Delete(i);
+ _openFiles_Paths.Delete(i);
+ return;
+ }
+ }
+ throw 20141125;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.h
new file mode 100644
index 0000000000..1b5d1eee8e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateCallback.h
@@ -0,0 +1,162 @@
+// UpdateCallback.h
+
+#ifndef __UPDATE_CALLBACK_H
+#define __UPDATE_CALLBACK_H
+
+#include "../../../Common/MyCom.h"
+
+#include "../../Common/FileStreams.h"
+
+#include "../../IPassword.h"
+#include "../../ICoder.h"
+
+#include "../Common/UpdatePair.h"
+#include "../Common/UpdateProduce.h"
+
+#include "OpenArchive.h"
+
+struct CArcToDoStat
+{
+ CDirItemsStat2 NewData;
+ CDirItemsStat2 OldData;
+ CDirItemsStat2 DeleteData;
+
+ UInt64 Get_NumDataItems_Total() const
+ {
+ return NewData.Get_NumDataItems2() + OldData.Get_NumDataItems2();
+ }
+};
+
+#define INTERFACE_IUpdateCallbackUI(x) \
+ virtual HRESULT WriteSfx(const wchar_t *name, UInt64 size) x; \
+ virtual HRESULT SetTotal(UInt64 size) x; \
+ virtual HRESULT SetCompleted(const UInt64 *completeValue) x; \
+ virtual HRESULT SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize) x; \
+ virtual HRESULT CheckBreak() x; \
+ /* virtual HRESULT Finalize() x; */ \
+ virtual HRESULT SetNumItems(const CArcToDoStat &stat) x; \
+ virtual HRESULT GetStream(const wchar_t *name, bool isDir, bool isAnti, UInt32 mode) x; \
+ virtual HRESULT OpenFileError(const FString &path, DWORD systemError) x; \
+ virtual HRESULT ReadingFileError(const FString &path, DWORD systemError) x; \
+ virtual HRESULT SetOperationResult(Int32 opRes) x; \
+ virtual HRESULT ReportExtractResult(Int32 opRes, Int32 isEncrypted, const wchar_t *name) x; \
+ virtual HRESULT ReportUpdateOpeartion(UInt32 op, const wchar_t *name, bool isDir) x; \
+ /* virtual HRESULT SetPassword(const UString &password) x; */ \
+ virtual HRESULT CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password) x; \
+ virtual HRESULT CryptoGetTextPassword(BSTR *password) x; \
+ virtual HRESULT ShowDeleteFile(const wchar_t *name, bool isDir) x; \
+ /* virtual HRESULT CloseProgress() { return S_OK; } */
+
+struct IUpdateCallbackUI
+{
+ INTERFACE_IUpdateCallbackUI(=0)
+};
+
+struct CKeyKeyValPair
+{
+ UInt64 Key1;
+ UInt64 Key2;
+ unsigned Value;
+
+ int Compare(const CKeyKeyValPair &a) const
+ {
+ if (Key1 < a.Key1) return -1;
+ if (Key1 > a.Key1) return 1;
+ return MyCompare(Key2, a.Key2);
+ }
+};
+
+
+class CArchiveUpdateCallback:
+ public IArchiveUpdateCallback2,
+ public IArchiveUpdateCallbackFile,
+ public IArchiveExtractCallbackMessage,
+ public IArchiveGetRawProps,
+ public IArchiveGetRootProps,
+ public ICryptoGetTextPassword2,
+ public ICryptoGetTextPassword,
+ public ICompressProgressInfo,
+ public IInFileStream_Callback,
+ public CMyUnknownImp
+{
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ bool _saclEnabled;
+ #endif
+ CRecordVector<CKeyKeyValPair> _map;
+
+ UInt32 _hardIndex_From;
+ UInt32 _hardIndex_To;
+
+public:
+ MY_QUERYINTERFACE_BEGIN2(IArchiveUpdateCallback2)
+ MY_QUERYINTERFACE_ENTRY(IArchiveUpdateCallbackFile)
+ MY_QUERYINTERFACE_ENTRY(IArchiveExtractCallbackMessage)
+ MY_QUERYINTERFACE_ENTRY(IArchiveGetRawProps)
+ MY_QUERYINTERFACE_ENTRY(IArchiveGetRootProps)
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword2)
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword)
+ MY_QUERYINTERFACE_ENTRY(ICompressProgressInfo)
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+
+ INTERFACE_IArchiveUpdateCallback2(;)
+ INTERFACE_IArchiveUpdateCallbackFile(;)
+ INTERFACE_IArchiveExtractCallbackMessage(;)
+ INTERFACE_IArchiveGetRawProps(;)
+ INTERFACE_IArchiveGetRootProps(;)
+
+ STDMETHOD(CryptoGetTextPassword2)(Int32 *passwordIsDefined, BSTR *password);
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+
+ CRecordVector<UInt32> _openFiles_Indexes;
+ FStringVector _openFiles_Paths;
+
+ bool AreAllFilesClosed() const { return _openFiles_Indexes.IsEmpty(); }
+ virtual HRESULT InFileStream_On_Error(UINT_PTR val, DWORD error);
+ virtual void InFileStream_On_Destroy(UINT_PTR val);
+
+ CRecordVector<UInt64> VolumesSizes;
+ FString VolName;
+ FString VolExt;
+
+ IUpdateCallbackUI *Callback;
+
+ const CDirItems *DirItems;
+ const CDirItem *ParentDirItem;
+
+ const CArc *Arc;
+ CMyComPtr<IInArchive> Archive;
+ const CObjectVector<CArcItem> *ArcItems;
+ const CRecordVector<CUpdatePair2> *UpdatePairs;
+ const UStringVector *NewNames;
+ int CommentIndex;
+ const UString *Comment;
+
+ bool ShareForWrite;
+ bool StopAfterOpenError;
+ bool StdInMode;
+
+ bool KeepOriginalItemNames;
+ bool StoreNtSecurity;
+ bool StoreHardLinks;
+ bool StoreSymLinks;
+
+ Byte *ProcessedItemsStatuses;
+
+
+ CArchiveUpdateCallback();
+
+ bool IsDir(const CUpdatePair2 &up) const
+ {
+ if (up.DirIndex >= 0)
+ return DirItems->Items[up.DirIndex].IsDir();
+ else if (up.ArcIndex >= 0)
+ return (*ArcItems)[up.ArcIndex].IsDir;
+ return false;
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.cpp
new file mode 100644
index 0000000000..5153671a7c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.cpp
@@ -0,0 +1,233 @@
+// UpdatePair.cpp
+
+#include "StdAfx.h"
+
+#include <time.h>
+
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/TimeUtils.h"
+
+#include "SortUtils.h"
+#include "UpdatePair.h"
+
+using namespace NWindows;
+using namespace NTime;
+
+static int MyCompareTime(NFileTimeType::EEnum fileTimeType, const FILETIME &time1, const FILETIME &time2)
+{
+ switch (fileTimeType)
+ {
+ case NFileTimeType::kWindows:
+ return ::CompareFileTime(&time1, &time2);
+ case NFileTimeType::kUnix:
+ {
+ UInt32 unixTime1, unixTime2;
+ FileTimeToUnixTime(time1, unixTime1);
+ FileTimeToUnixTime(time2, unixTime2);
+ return MyCompare(unixTime1, unixTime2);
+ }
+ case NFileTimeType::kDOS:
+ {
+ UInt32 dosTime1, dosTime2;
+ FileTimeToDosTime(time1, dosTime1);
+ FileTimeToDosTime(time2, dosTime2);
+ return MyCompare(dosTime1, dosTime2);
+ }
+ }
+ throw 4191618;
+}
+
+static const char * const k_Duplicate_inArc_Message = "Duplicate filename in archive:";
+static const char * const k_Duplicate_inDir_Message = "Duplicate filename on disk:";
+static const char * const k_NotCensoredCollision_Message = "Internal file name collision (file on disk, file in archive):";
+
+static void ThrowError(const char *message, const UString &s1, const UString &s2)
+{
+ UString m (message);
+ m.Add_LF(); m += s1;
+ m.Add_LF(); m += s2;
+ throw m;
+}
+
+static int CompareArcItemsBase(const CArcItem &ai1, const CArcItem &ai2)
+{
+ int res = CompareFileNames(ai1.Name, ai2.Name);
+ if (res != 0)
+ return res;
+ if (ai1.IsDir != ai2.IsDir)
+ return ai1.IsDir ? -1 : 1;
+ return 0;
+}
+
+static int CompareArcItems(const unsigned *p1, const unsigned *p2, void *param)
+{
+ unsigned i1 = *p1;
+ unsigned i2 = *p2;
+ const CObjectVector<CArcItem> &arcItems = *(const CObjectVector<CArcItem> *)param;
+ int res = CompareArcItemsBase(arcItems[i1], arcItems[i2]);
+ if (res != 0)
+ return res;
+ return MyCompare(i1, i2);
+}
+
+void GetUpdatePairInfoList(
+ const CDirItems &dirItems,
+ const CObjectVector<CArcItem> &arcItems,
+ NFileTimeType::EEnum fileTimeType,
+ CRecordVector<CUpdatePair> &updatePairs)
+{
+ CUIntVector dirIndices, arcIndices;
+
+ unsigned numDirItems = dirItems.Items.Size();
+ unsigned numArcItems = arcItems.Size();
+
+ CIntArr duplicatedArcItem(numArcItems);
+ {
+ int *vals = &duplicatedArcItem[0];
+ for (unsigned i = 0; i < numArcItems; i++)
+ vals[i] = 0;
+ }
+
+ {
+ arcIndices.ClearAndSetSize(numArcItems);
+ if (numArcItems != 0)
+ {
+ unsigned *vals = &arcIndices[0];
+ for (unsigned i = 0; i < numArcItems; i++)
+ vals[i] = i;
+ }
+ arcIndices.Sort(CompareArcItems, (void *)&arcItems);
+ for (unsigned i = 0; i + 1 < numArcItems; i++)
+ if (CompareArcItemsBase(
+ arcItems[arcIndices[i]],
+ arcItems[arcIndices[i + 1]]) == 0)
+ {
+ duplicatedArcItem[i] = 1;
+ duplicatedArcItem[i + 1] = -1;
+ }
+ }
+
+ UStringVector dirNames;
+ {
+ dirNames.ClearAndReserve(numDirItems);
+ unsigned i;
+ for (i = 0; i < numDirItems; i++)
+ dirNames.AddInReserved(dirItems.GetLogPath(i));
+ SortFileNames(dirNames, dirIndices);
+ for (i = 0; i + 1 < numDirItems; i++)
+ {
+ const UString &s1 = dirNames[dirIndices[i]];
+ const UString &s2 = dirNames[dirIndices[i + 1]];
+ if (CompareFileNames(s1, s2) == 0)
+ ThrowError(k_Duplicate_inDir_Message, s1, s2);
+ }
+ }
+
+ unsigned dirIndex = 0;
+ unsigned arcIndex = 0;
+
+ int prevHostFile = -1;
+ const UString *prevHostName = NULL;
+
+ while (dirIndex < numDirItems || arcIndex < numArcItems)
+ {
+ CUpdatePair pair;
+
+ int dirIndex2 = -1;
+ int arcIndex2 = -1;
+ const CDirItem *di = NULL;
+ const CArcItem *ai = NULL;
+
+ int compareResult = -1;
+ const UString *name = NULL;
+
+ if (dirIndex < numDirItems)
+ {
+ dirIndex2 = dirIndices[dirIndex];
+ di = &dirItems.Items[dirIndex2];
+ }
+
+ if (arcIndex < numArcItems)
+ {
+ arcIndex2 = arcIndices[arcIndex];
+ ai = &arcItems[arcIndex2];
+ compareResult = 1;
+ if (dirIndex < numDirItems)
+ {
+ compareResult = CompareFileNames(dirNames[dirIndex2], ai->Name);
+ if (compareResult == 0)
+ {
+ if (di->IsDir() != ai->IsDir)
+ compareResult = (ai->IsDir ? 1 : -1);
+ }
+ }
+ }
+
+ if (compareResult < 0)
+ {
+ name = &dirNames[dirIndex2];
+ pair.State = NUpdateArchive::NPairState::kOnlyOnDisk;
+ pair.DirIndex = dirIndex2;
+ dirIndex++;
+ }
+ else if (compareResult > 0)
+ {
+ name = &ai->Name;
+ pair.State = ai->Censored ?
+ NUpdateArchive::NPairState::kOnlyInArchive:
+ NUpdateArchive::NPairState::kNotMasked;
+ pair.ArcIndex = arcIndex2;
+ arcIndex++;
+ }
+ else
+ {
+ int dupl = duplicatedArcItem[arcIndex];
+ if (dupl != 0)
+ ThrowError(k_Duplicate_inArc_Message, ai->Name, arcItems[arcIndices[arcIndex + dupl]].Name);
+
+ name = &dirNames[dirIndex2];
+ if (!ai->Censored)
+ ThrowError(k_NotCensoredCollision_Message, *name, ai->Name);
+
+ pair.DirIndex = dirIndex2;
+ pair.ArcIndex = arcIndex2;
+
+ switch (ai->MTimeDefined ? MyCompareTime(
+ ai->TimeType != - 1 ? (NFileTimeType::EEnum)ai->TimeType : fileTimeType,
+ di->MTime, ai->MTime): 0)
+ {
+ case -1: pair.State = NUpdateArchive::NPairState::kNewInArchive; break;
+ case 1: pair.State = NUpdateArchive::NPairState::kOldInArchive; break;
+ default:
+ pair.State = (ai->SizeDefined && di->Size == ai->Size) ?
+ NUpdateArchive::NPairState::kSameFiles :
+ NUpdateArchive::NPairState::kUnknowNewerFiles;
+ }
+
+ dirIndex++;
+ arcIndex++;
+ }
+
+ if ((di && di->IsAltStream) ||
+ (ai && ai->IsAltStream))
+ {
+ if (prevHostName)
+ {
+ unsigned hostLen = prevHostName->Len();
+ if (name->Len() > hostLen)
+ if ((*name)[hostLen] == ':' && CompareFileNames(*prevHostName, name->Left(hostLen)) == 0)
+ pair.HostIndex = prevHostFile;
+ }
+ }
+ else
+ {
+ prevHostFile = updatePairs.Size();
+ prevHostName = name;
+ }
+
+ updatePairs.Add(pair);
+ }
+
+ updatePairs.ReserveDown();
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.h
new file mode 100644
index 0000000000..36da243428
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdatePair.h
@@ -0,0 +1,27 @@
+// UpdatePair.h
+
+#ifndef __UPDATE_PAIR_H
+#define __UPDATE_PAIR_H
+
+#include "DirItem.h"
+#include "UpdateAction.h"
+
+#include "../../Archive/IArchive.h"
+
+struct CUpdatePair
+{
+ NUpdateArchive::NPairState::EEnum State;
+ int ArcIndex;
+ int DirIndex;
+ int HostIndex; // >= 0 for alt streams only, contains index of host pair
+
+ CUpdatePair(): ArcIndex(-1), DirIndex(-1), HostIndex(-1) {}
+};
+
+void GetUpdatePairInfoList(
+ const CDirItems &dirItems,
+ const CObjectVector<CArcItem> &arcItems,
+ NFileTimeType::EEnum fileTimeType,
+ CRecordVector<CUpdatePair> &updatePairs);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.cpp
new file mode 100644
index 0000000000..c025ac4680
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.cpp
@@ -0,0 +1,70 @@
+// UpdateProduce.cpp
+
+#include "StdAfx.h"
+
+#include "UpdateProduce.h"
+
+using namespace NUpdateArchive;
+
+static const char * const kUpdateActionSetCollision = "Internal collision in update action set";
+
+void UpdateProduce(
+ const CRecordVector<CUpdatePair> &updatePairs,
+ const CActionSet &actionSet,
+ CRecordVector<CUpdatePair2> &operationChain,
+ IUpdateProduceCallback *callback)
+{
+ FOR_VECTOR (i, updatePairs)
+ {
+ const CUpdatePair &pair = updatePairs[i];
+
+ CUpdatePair2 up2;
+ up2.DirIndex = pair.DirIndex;
+ up2.ArcIndex = pair.ArcIndex;
+ up2.NewData = up2.NewProps = true;
+ up2.UseArcProps = false;
+
+ switch (actionSet.StateActions[(unsigned)pair.State])
+ {
+ case NPairAction::kIgnore:
+ if (pair.ArcIndex >= 0 && callback)
+ callback->ShowDeleteFile(pair.ArcIndex);
+ continue;
+
+ case NPairAction::kCopy:
+ if (pair.State == NPairState::kOnlyOnDisk)
+ throw kUpdateActionSetCollision;
+ if (pair.State == NPairState::kOnlyInArchive)
+ {
+ if (pair.HostIndex >= 0)
+ {
+ /*
+ ignore alt stream if
+ 1) no such alt stream in Disk
+ 2) there is Host file in disk
+ */
+ if (updatePairs[pair.HostIndex].DirIndex >= 0)
+ continue;
+ }
+ }
+ up2.NewData = up2.NewProps = false;
+ up2.UseArcProps = true;
+ break;
+
+ case NPairAction::kCompress:
+ if (pair.State == NPairState::kOnlyInArchive ||
+ pair.State == NPairState::kNotMasked)
+ throw kUpdateActionSetCollision;
+ break;
+
+ case NPairAction::kCompressAsAnti:
+ up2.IsAnti = true;
+ up2.UseArcProps = (pair.ArcIndex >= 0);
+ break;
+ }
+
+ operationChain.Add(up2);
+ }
+
+ operationChain.ReserveDown();
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.h
new file mode 100644
index 0000000000..8467543839
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/UpdateProduce.h
@@ -0,0 +1,55 @@
+// UpdateProduce.h
+
+#ifndef __UPDATE_PRODUCE_H
+#define __UPDATE_PRODUCE_H
+
+#include "UpdatePair.h"
+
+struct CUpdatePair2
+{
+ bool NewData;
+ bool NewProps;
+ bool UseArcProps; // if (UseArcProps && NewProps), we want to change only some properties.
+ bool IsAnti; // if (!IsAnti) we use other ways to detect Anti status
+
+ int DirIndex;
+ int ArcIndex;
+ int NewNameIndex;
+
+ bool IsMainRenameItem;
+
+ void SetAs_NoChangeArcItem(int arcIndex)
+ {
+ NewData = NewProps = false;
+ UseArcProps = true;
+ IsAnti = false;
+ ArcIndex = arcIndex;
+ }
+
+ bool ExistOnDisk() const { return DirIndex != -1; }
+ bool ExistInArchive() const { return ArcIndex != -1; }
+
+ CUpdatePair2():
+ NewData(false),
+ NewProps(false),
+ UseArcProps(false),
+ IsAnti(false),
+ DirIndex(-1),
+ ArcIndex(-1),
+ NewNameIndex(-1),
+ IsMainRenameItem(false)
+ {}
+};
+
+struct IUpdateProduceCallback
+{
+ virtual HRESULT ShowDeleteFile(unsigned arcIndex) = 0;
+};
+
+void UpdateProduce(
+ const CRecordVector<CUpdatePair> &updatePairs,
+ const NUpdateArchive::CActionSet &actionSet,
+ CRecordVector<CUpdatePair2> &operationChain,
+ IUpdateProduceCallback *callback);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.cpp
new file mode 100644
index 0000000000..03d6eed107
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.cpp
@@ -0,0 +1,94 @@
+// WorkDir.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileName.h"
+
+#include "WorkDir.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+FString GetWorkDir(const NWorkDir::CInfo &workDirInfo, const FString &path, FString &fileName)
+{
+ NWorkDir::NMode::EEnum mode = workDirInfo.Mode;
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (workDirInfo.ForRemovableOnly)
+ {
+ mode = NWorkDir::NMode::kCurrent;
+ FString prefix = path.Left(3);
+ if (prefix[1] == FTEXT(':') && prefix[2] == FTEXT('\\'))
+ {
+ UINT driveType = GetDriveType(GetSystemString(prefix, ::AreFileApisANSI() ? CP_ACP : CP_OEMCP));
+ if (driveType == DRIVE_CDROM || driveType == DRIVE_REMOVABLE)
+ mode = workDirInfo.Mode;
+ }
+ /*
+ CParsedPath parsedPath;
+ parsedPath.ParsePath(archiveName);
+ UINT driveType = GetDriveType(parsedPath.Prefix);
+ if ((driveType != DRIVE_CDROM) && (driveType != DRIVE_REMOVABLE))
+ mode = NZipSettings::NWorkDir::NMode::kCurrent;
+ */
+ }
+ #endif
+
+ int pos = path.ReverseFind_PathSepar() + 1;
+ fileName = path.Ptr(pos);
+
+ switch (mode)
+ {
+ case NWorkDir::NMode::kCurrent:
+ {
+ return path.Left(pos);
+ }
+ case NWorkDir::NMode::kSpecified:
+ {
+ FString tempDir = workDirInfo.Path;
+ NName::NormalizeDirPathPrefix(tempDir);
+ return tempDir;
+ }
+ default:
+ {
+ FString tempDir;
+ if (!MyGetTempPath(tempDir))
+ throw 141717;
+ return tempDir;
+ }
+ }
+}
+
+HRESULT CWorkDirTempFile::CreateTempFile(const FString &originalPath)
+{
+ NWorkDir::CInfo workDirInfo;
+ workDirInfo.Load();
+ FString namePart;
+ FString workDir = GetWorkDir(workDirInfo, originalPath, namePart);
+ CreateComplexDir(workDir);
+ CTempFile tempFile;
+ _outStreamSpec = new COutFileStream;
+ OutStream = _outStreamSpec;
+ if (!_tempFile.Create(workDir + namePart, &_outStreamSpec->File))
+ {
+ DWORD error = GetLastError();
+ return error ? error : E_FAIL;
+ }
+ _originalPath = originalPath;
+ return S_OK;
+}
+
+HRESULT CWorkDirTempFile::MoveToOriginal(bool deleteOriginal)
+{
+ OutStream.Release();
+ if (!_tempFile.MoveTo(_originalPath, deleteOriginal))
+ {
+ DWORD error = GetLastError();
+ return error ? error : E_FAIL;
+ }
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.h
new file mode 100644
index 0000000000..13d4ed9fea
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/WorkDir.h
@@ -0,0 +1,26 @@
+// WorkDir.h
+
+#ifndef __WORK_DIR_H
+#define __WORK_DIR_H
+
+#include "../../../Windows/FileDir.h"
+
+#include "../../Common/FileStreams.h"
+
+#include "ZipRegistry.h"
+
+FString GetWorkDir(const NWorkDir::CInfo &workDirInfo, const FString &path, FString &fileName);
+
+class CWorkDirTempFile
+{
+ FString _originalPath;
+ NWindows::NFile::NDir::CTempFile _tempFile;
+ COutFileStream *_outStreamSpec;
+public:
+ CMyComPtr<IOutStream> OutStream;
+
+ HRESULT CreateTempFile(const FString &originalPath);
+ HRESULT MoveToOriginal(bool deleteOriginal);
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Common/ZipRegistry.h b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ZipRegistry.h
new file mode 100644
index 0000000000..4c16b61c48
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Common/ZipRegistry.h
@@ -0,0 +1,130 @@
+// ZipRegistry.h
+
+#ifndef __ZIP_REGISTRY_H
+#define __ZIP_REGISTRY_H
+
+#include "../../../Common/MyTypes.h"
+#include "../../../Common/MyString.h"
+
+#include "ExtractMode.h"
+
+namespace NExtract
+{
+ struct CInfo
+ {
+ NPathMode::EEnum PathMode;
+ NOverwriteMode::EEnum OverwriteMode;
+ bool PathMode_Force;
+ bool OverwriteMode_Force;
+
+ CBoolPair SplitDest;
+ CBoolPair ElimDup;
+ // CBoolPair AltStreams;
+ CBoolPair NtSecurity;
+ CBoolPair ShowPassword;
+
+ UStringVector Paths;
+
+ void Save() const;
+ void Load();
+ };
+
+ void Save_ShowPassword(bool showPassword);
+ bool Read_ShowPassword();
+}
+
+namespace NCompression
+{
+ struct CFormatOptions
+ {
+ UInt32 Level;
+ UInt32 Dictionary;
+ UInt32 Order;
+ UInt32 BlockLogSize;
+ UInt32 NumThreads;
+
+ CSysString FormatID;
+ UString Method;
+ UString Options;
+ UString EncryptionMethod;
+
+ void Reset_BlockLogSize()
+ {
+ BlockLogSize = (UInt32)(Int32)-1;
+ }
+
+ void ResetForLevelChange()
+ {
+ BlockLogSize = NumThreads = Level = Dictionary = Order = (UInt32)(Int32)-1;
+ Method.Empty();
+ // Options.Empty();
+ // EncryptionMethod.Empty();
+ }
+ CFormatOptions() { ResetForLevelChange(); }
+ };
+
+ struct CInfo
+ {
+ UInt32 Level;
+ bool ShowPassword;
+ bool EncryptHeaders;
+ UString ArcType;
+ UStringVector ArcPaths;
+
+ CObjectVector<CFormatOptions> Formats;
+
+ CBoolPair NtSecurity;
+ CBoolPair AltStreams;
+ CBoolPair HardLinks;
+ CBoolPair SymLinks;
+
+ void Save() const;
+ void Load();
+ };
+}
+
+namespace NWorkDir
+{
+ namespace NMode
+ {
+ enum EEnum
+ {
+ kSystem,
+ kCurrent,
+ kSpecified
+ };
+ }
+ struct CInfo
+ {
+ NMode::EEnum Mode;
+ FString Path;
+ bool ForRemovableOnly;
+
+ void SetForRemovableOnlyDefault() { ForRemovableOnly = true; }
+ void SetDefault()
+ {
+ Mode = NMode::kSystem;
+ Path.Empty();
+ SetForRemovableOnlyDefault();
+ }
+
+ void Save() const;
+ void Load();
+ };
+}
+
+
+struct CContextMenuInfo
+{
+ CBoolPair Cascaded;
+ CBoolPair MenuIcons;
+ CBoolPair ElimDup;
+
+ bool Flags_Def;
+ UInt32 Flags;
+
+ void Save() const;
+ void Load();
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.cpp
new file mode 100644
index 0000000000..9cf8dd6dc9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.cpp
@@ -0,0 +1,41 @@
+// BenchCon.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/Bench.h"
+
+#include "BenchCon.h"
+#include "ConsoleClose.h"
+
+struct CPrintBenchCallback: public IBenchPrintCallback
+{
+ FILE *_file;
+
+ void Print(const char *s);
+ void NewLine();
+ HRESULT CheckBreak();
+};
+
+void CPrintBenchCallback::Print(const char *s)
+{
+ fputs(s, _file);
+}
+
+void CPrintBenchCallback::NewLine()
+{
+ fputc('\n', _file);
+}
+
+HRESULT CPrintBenchCallback::CheckBreak()
+{
+ return NConsoleClose::TestBreakSignal() ? E_ABORT: S_OK;
+}
+
+HRESULT BenchCon(DECL_EXTERNAL_CODECS_LOC_VARS
+ const CObjectVector<CProperty> &props, UInt32 numIterations, FILE *f)
+{
+ CPrintBenchCallback callback;
+ callback._file = f;
+ return Bench(EXTERNAL_CODECS_LOC_VARS
+ &callback, NULL, props, numIterations, true);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.h
new file mode 100644
index 0000000000..ef235eea31
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/BenchCon.h
@@ -0,0 +1,14 @@
+// BenchCon.h
+
+#ifndef __BENCH_CON_H
+#define __BENCH_CON_H
+
+#include <stdio.h>
+
+#include "../../Common/CreateCoder.h"
+#include "../../UI/Common/Property.h"
+
+HRESULT BenchCon(DECL_EXTERNAL_CODECS_LOC_VARS
+ const CObjectVector<CProperty> &props, UInt32 numIterations, FILE *f);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.mak b/other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.mak
new file mode 100644
index 0000000000..6757e6b442
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.mak
@@ -0,0 +1,36 @@
+CONSOLE_OBJS = \
+ $O\BenchCon.obj \
+ $O\ConsoleClose.obj \
+ $O\ExtractCallbackConsole.obj \
+ $O\HashCon.obj \
+ $O\List.obj \
+ $O\Main.obj \
+ $O\MainAr.obj \
+ $O\OpenCallbackConsole.obj \
+ $O\PercentPrinter.obj \
+ $O\UpdateCallbackConsole.obj \
+ $O\UserInputUtils.obj \
+
+UI_COMMON_OBJS = \
+ $O\ArchiveCommandLine.obj \
+ $O\ArchiveExtractCallback.obj \
+ $O\ArchiveOpenCallback.obj \
+ $O\Bench.obj \
+ $O\DefaultName.obj \
+ $O\EnumDirItems.obj \
+ $O\Extract.obj \
+ $O\ExtractingFilePath.obj \
+ $O\HashCalc.obj \
+ $O\LoadCodecs.obj \
+ $O\OpenArchive.obj \
+ $O\PropIDUtils.obj \
+ $O\SetProperties.obj \
+ $O\SortUtils.obj \
+ $O\TempFiles.obj \
+ $O\Update.obj \
+ $O\UpdateAction.obj \
+ $O\UpdateCallback.obj \
+ $O\UpdatePair.obj \
+ $O\UpdateProduce.obj \
+
+#
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.manifest b/other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.manifest
new file mode 100644
index 0000000000..77ecaad72d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/Console.manifest
@@ -0,0 +1,13 @@
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="7z" type="win32"></assemblyIdentity>
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+<security><requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false">
+</requestedExecutionLevel></requestedPrivileges></security></trustInfo>
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"><application>
+<!-- Vista --> <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+<!-- Win 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+<!-- Win 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+<!-- Win 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+<!-- Win 10 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+</application></compatibility>
+</assembly> \ No newline at end of file
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.cpp
new file mode 100644
index 0000000000..a6f17af930
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.cpp
@@ -0,0 +1,69 @@
+// ConsoleClose.cpp
+
+#include "StdAfx.h"
+
+#include "ConsoleClose.h"
+
+#if !defined(UNDER_CE) && defined(_WIN32)
+#include "../../../Common/MyWindows.h"
+#endif
+
+namespace NConsoleClose {
+
+unsigned g_BreakCounter = 0;
+static const unsigned kBreakAbortThreshold = 2;
+
+#if !defined(UNDER_CE) && defined(_WIN32)
+static BOOL WINAPI HandlerRoutine(DWORD ctrlType)
+{
+ if (ctrlType == CTRL_LOGOFF_EVENT)
+ {
+ // printf("\nCTRL_LOGOFF_EVENT\n");
+ return TRUE;
+ }
+
+ g_BreakCounter++;
+ if (g_BreakCounter < kBreakAbortThreshold)
+ return TRUE;
+ return FALSE;
+ /*
+ switch (ctrlType)
+ {
+ case CTRL_C_EVENT:
+ case CTRL_BREAK_EVENT:
+ if (g_BreakCounter < kBreakAbortThreshold)
+ return TRUE;
+ }
+ return FALSE;
+ */
+}
+#endif
+
+/*
+void CheckCtrlBreak()
+{
+ if (TestBreakSignal())
+ throw CCtrlBreakException();
+}
+*/
+
+CCtrlHandlerSetter::CCtrlHandlerSetter()
+{
+ #if !defined(UNDER_CE) && defined(_WIN32)
+ if (!SetConsoleCtrlHandler(HandlerRoutine, TRUE))
+ throw "SetConsoleCtrlHandler fails";
+ #endif
+}
+
+CCtrlHandlerSetter::~CCtrlHandlerSetter()
+{
+ #if !defined(UNDER_CE) && defined(_WIN32)
+ if (!SetConsoleCtrlHandler(HandlerRoutine, FALSE))
+ {
+ // warning for throw in destructor.
+ // throw "SetConsoleCtrlHandler fails";
+ }
+ #endif
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.h
new file mode 100644
index 0000000000..0a0bbf0e0a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ConsoleClose.h
@@ -0,0 +1,33 @@
+// ConsoleClose.h
+
+#ifndef __CONSOLE_CLOSE_H
+#define __CONSOLE_CLOSE_H
+
+namespace NConsoleClose {
+
+extern unsigned g_BreakCounter;
+
+inline bool TestBreakSignal()
+{
+ #ifdef UNDER_CE
+ return false;
+ #else
+ return (g_BreakCounter != 0);
+ #endif
+}
+
+class CCtrlHandlerSetter
+{
+public:
+ CCtrlHandlerSetter();
+ virtual ~CCtrlHandlerSetter();
+};
+
+class CCtrlBreakException
+{};
+
+// void CheckCtrlBreak();
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp
new file mode 100644
index 0000000000..bdf954998c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.cpp
@@ -0,0 +1,825 @@
+// ExtractCallbackConsole.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/TimeUtils.h"
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#ifndef _7ZIP_ST
+#include "../../../Windows/Synchronization.h"
+#endif
+
+#include "../../Common/FilePathAutoRename.h"
+
+#include "../Common/ExtractingFilePath.h"
+
+#include "ConsoleClose.h"
+#include "ExtractCallbackConsole.h"
+#include "UserInputUtils.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static HRESULT CheckBreak2()
+{
+ return NConsoleClose::TestBreakSignal() ? E_ABORT : S_OK;
+}
+
+static const char * const kError = "ERROR: ";
+
+
+void CExtractScanConsole::StartScanning()
+{
+ if (NeedPercents())
+ _percent.Command = "Scan";
+}
+
+HRESULT CExtractScanConsole::ScanProgress(const CDirItemsStat &st, const FString &path, bool /* isDir */)
+{
+ if (NeedPercents())
+ {
+ _percent.Files = st.NumDirs + st.NumFiles;
+ _percent.Completed = st.GetTotalBytes();
+ _percent.FileName = fs2us(path);
+ _percent.Print();
+ }
+
+ return CheckBreak2();
+}
+
+HRESULT CExtractScanConsole::ScanError(const FString &path, DWORD systemError)
+{
+ ClosePercentsAndFlush();
+
+ if (_se)
+ {
+ *_se << endl << kError << NError::MyFormatMessage(systemError) << endl;
+ _se->NormalizePrint_UString(fs2us(path));
+ *_se << endl << endl;
+ _se->Flush();
+ }
+ return HRESULT_FROM_WIN32(systemError);
+}
+
+
+void Print_UInt64_and_String(AString &s, UInt64 val, const char *name)
+{
+ char temp[32];
+ ConvertUInt64ToString(val, temp);
+ s += temp;
+ s.Add_Space();
+ s += name;
+}
+
+void PrintSize_bytes_Smart(AString &s, UInt64 val)
+{
+ Print_UInt64_and_String(s, val, "bytes");
+
+ if (val == 0)
+ return;
+
+ unsigned numBits = 10;
+ char c = 'K';
+ char temp[4] = { 'K', 'i', 'B', 0 };
+ if (val >= ((UInt64)10 << 30)) { numBits = 30; c = 'G'; }
+ else if (val >= ((UInt64)10 << 20)) { numBits = 20; c = 'M'; }
+ temp[0] = c;
+ s += " (";
+ Print_UInt64_and_String(s, ((val + ((UInt64)1 << numBits) - 1) >> numBits), temp);
+ s += ')';
+}
+
+void PrintSize_bytes_Smart_comma(AString &s, UInt64 val)
+{
+ if (val == (UInt64)(Int64)-1)
+ return;
+ s += ", ";
+ PrintSize_bytes_Smart(s, val);
+}
+
+
+
+void Print_DirItemsStat(AString &s, const CDirItemsStat &st)
+{
+ if (st.NumDirs != 0)
+ {
+ Print_UInt64_and_String(s, st.NumDirs, st.NumDirs == 1 ? "folder" : "folders");
+ s += ", ";
+ }
+ Print_UInt64_and_String(s, st.NumFiles, st.NumFiles == 1 ? "file" : "files");
+ PrintSize_bytes_Smart_comma(s, st.FilesSize);
+ if (st.NumAltStreams != 0)
+ {
+ s.Add_LF();
+ Print_UInt64_and_String(s, st.NumAltStreams, "alternate streams");
+ PrintSize_bytes_Smart_comma(s, st.AltStreamsSize);
+ }
+}
+
+
+void Print_DirItemsStat2(AString &s, const CDirItemsStat2 &st)
+{
+ Print_DirItemsStat(s, (CDirItemsStat &)st);
+ bool needLF = true;
+ if (st.Anti_NumDirs != 0)
+ {
+ if (needLF)
+ s.Add_LF();
+ needLF = false;
+ Print_UInt64_and_String(s, st.Anti_NumDirs, st.Anti_NumDirs == 1 ? "anti-folder" : "anti-folders");
+ }
+ if (st.Anti_NumFiles != 0)
+ {
+ if (needLF)
+ s.Add_LF();
+ else
+ s += ", ";
+ needLF = false;
+ Print_UInt64_and_String(s, st.Anti_NumFiles, st.Anti_NumFiles == 1 ? "anti-file" : "anti-files");
+ }
+ if (st.Anti_NumAltStreams != 0)
+ {
+ if (needLF)
+ s.Add_LF();
+ else
+ s += ", ";
+ needLF = false;
+ Print_UInt64_and_String(s, st.Anti_NumAltStreams, "anti-alternate-streams");
+ }
+}
+
+
+void CExtractScanConsole::PrintStat(const CDirItemsStat &st)
+{
+ if (_so)
+ {
+ AString s;
+ Print_DirItemsStat(s, st);
+ *_so << s << endl;
+ }
+}
+
+
+
+
+
+
+
+#ifndef _7ZIP_ST
+static NSynchronization::CCriticalSection g_CriticalSection;
+#define MT_LOCK NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+#else
+#define MT_LOCK
+#endif
+
+
+static const char * const kTestString = "T";
+static const char * const kExtractString = "-";
+static const char * const kSkipString = ".";
+
+// static const char * const kCantAutoRename = "can not create file with auto name\n";
+// static const char * const kCantRenameFile = "can not rename existing file\n";
+// static const char * const kCantDeleteOutputFile = "can not delete output file ";
+
+static const char * const kMemoryExceptionMessage = "Can't allocate required memory!";
+
+static const char * const kExtracting = "Extracting archive: ";
+static const char * const kTesting = "Testing archive: ";
+
+static const char * const kEverythingIsOk = "Everything is Ok";
+static const char * const kNoFiles = "No files to process";
+
+static const char * const kUnsupportedMethod = "Unsupported Method";
+static const char * const kCrcFailed = "CRC Failed";
+static const char * const kCrcFailedEncrypted = "CRC Failed in encrypted file. Wrong password?";
+static const char * const kDataError = "Data Error";
+static const char * const kDataErrorEncrypted = "Data Error in encrypted file. Wrong password?";
+static const char * const kUnavailableData = "Unavailable data";
+static const char * const kUnexpectedEnd = "Unexpected end of data";
+static const char * const kDataAfterEnd = "There are some data after the end of the payload data";
+static const char * const kIsNotArc = "Is not archive";
+static const char * const kHeadersError = "Headers Error";
+static const char * const kWrongPassword = "Wrong password";
+
+static const char * const k_ErrorFlagsMessages[] =
+{
+ "Is not archive"
+ , "Headers Error"
+ , "Headers Error in encrypted archive. Wrong password?"
+ , "Unavailable start of archive"
+ , "Unconfirmed start of archive"
+ , "Unexpected end of archive"
+ , "There are data after the end of archive"
+ , "Unsupported method"
+ , "Unsupported feature"
+ , "Data Error"
+ , "CRC Error"
+};
+
+STDMETHODIMP CExtractCallbackConsole::SetTotal(UInt64 size)
+{
+ MT_LOCK
+
+ if (NeedPercents())
+ {
+ _percent.Total = size;
+ _percent.Print();
+ }
+ return CheckBreak2();
+}
+
+STDMETHODIMP CExtractCallbackConsole::SetCompleted(const UInt64 *completeValue)
+{
+ MT_LOCK
+
+ if (NeedPercents())
+ {
+ if (completeValue)
+ _percent.Completed = *completeValue;
+ _percent.Print();
+ }
+ return CheckBreak2();
+}
+
+static const char * const kTab = " ";
+
+static void PrintFileInfo(CStdOutStream *_so, const wchar_t *path, const FILETIME *ft, const UInt64 *size)
+{
+ *_so << kTab << "Path: ";
+ _so->NormalizePrint_wstr(path);
+ *_so << endl;
+ if (size && *size != (UInt64)(Int64)-1)
+ {
+ AString s;
+ PrintSize_bytes_Smart(s, *size);
+ *_so << kTab << "Size: " << s << endl;
+ }
+ if (ft)
+ {
+ char temp[64];
+ if (ConvertUtcFileTimeToString(*ft, temp, kTimestampPrintLevel_SEC))
+ *_so << kTab << "Modified: " << temp << endl;
+ }
+}
+
+STDMETHODIMP CExtractCallbackConsole::AskOverwrite(
+ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
+ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
+ Int32 *answer)
+{
+ MT_LOCK
+
+ RINOK(CheckBreak2());
+
+ ClosePercentsAndFlush();
+
+ if (_so)
+ {
+ *_so << endl << "Would you like to replace the existing file:\n";
+ PrintFileInfo(_so, existName, existTime, existSize);
+ *_so << "with the file from archive:\n";
+ PrintFileInfo(_so, newName, newTime, newSize);
+ }
+
+ NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(_so);
+
+ switch (overwriteAnswer)
+ {
+ case NUserAnswerMode::kQuit: return E_ABORT;
+ case NUserAnswerMode::kNo: *answer = NOverwriteAnswer::kNo; break;
+ case NUserAnswerMode::kNoAll: *answer = NOverwriteAnswer::kNoToAll; break;
+ case NUserAnswerMode::kYesAll: *answer = NOverwriteAnswer::kYesToAll; break;
+ case NUserAnswerMode::kYes: *answer = NOverwriteAnswer::kYes; break;
+ case NUserAnswerMode::kAutoRenameAll: *answer = NOverwriteAnswer::kAutoRename; break;
+ case NUserAnswerMode::kEof: return E_ABORT;
+ case NUserAnswerMode::kError: return E_FAIL;
+ default: return E_FAIL;
+ }
+
+ if (_so)
+ {
+ *_so << endl;
+ if (NeedFlush)
+ _so->Flush();
+ }
+
+ return CheckBreak2();
+}
+
+STDMETHODIMP CExtractCallbackConsole::PrepareOperation(const wchar_t *name, Int32 /* isFolder */, Int32 askExtractMode, const UInt64 *position)
+{
+ MT_LOCK
+
+ _currentName = name;
+
+ const char *s;
+ unsigned requiredLevel = 1;
+
+ switch (askExtractMode)
+ {
+ case NArchive::NExtract::NAskMode::kExtract: s = kExtractString; break;
+ case NArchive::NExtract::NAskMode::kTest: s = kTestString; break;
+ case NArchive::NExtract::NAskMode::kSkip: s = kSkipString; requiredLevel = 2; break;
+ default: s = "???"; requiredLevel = 2;
+ };
+
+ bool show2 = (LogLevel >= requiredLevel && _so);
+
+ if (show2)
+ {
+ ClosePercents_for_so();
+
+ _tempA = s;
+ if (name)
+ _tempA.Add_Space();
+ *_so << _tempA;
+
+ _tempU.Empty();
+ if (name)
+ {
+ _tempU = name;
+ _so->Normalize_UString(_tempU);
+ }
+ _so->PrintUString(_tempU, _tempA);
+ if (position)
+ *_so << " <" << *position << ">";
+ *_so << endl;
+
+ if (NeedFlush)
+ _so->Flush();
+ }
+
+ if (NeedPercents())
+ {
+ if (PercentsNameLevel >= 1)
+ {
+ _percent.FileName.Empty();
+ _percent.Command.Empty();
+ if (PercentsNameLevel > 1 || !show2)
+ {
+ _percent.Command = s;
+ if (name)
+ _percent.FileName = name;
+ }
+ }
+ _percent.Print();
+ }
+
+ return CheckBreak2();
+}
+
+STDMETHODIMP CExtractCallbackConsole::MessageError(const wchar_t *message)
+{
+ MT_LOCK
+
+ RINOK(CheckBreak2());
+
+ NumFileErrors_in_Current++;
+ NumFileErrors++;
+
+ ClosePercentsAndFlush();
+ if (_se)
+ {
+ *_se << kError << message << endl;
+ _se->Flush();
+ }
+
+ return CheckBreak2();
+}
+
+void SetExtractErrorMessage(Int32 opRes, Int32 encrypted, AString &dest)
+{
+ dest.Empty();
+ const char *s = NULL;
+
+ switch (opRes)
+ {
+ case NArchive::NExtract::NOperationResult::kUnsupportedMethod:
+ s = kUnsupportedMethod;
+ break;
+ case NArchive::NExtract::NOperationResult::kCRCError:
+ s = (encrypted ? kCrcFailedEncrypted : kCrcFailed);
+ break;
+ case NArchive::NExtract::NOperationResult::kDataError:
+ s = (encrypted ? kDataErrorEncrypted : kDataError);
+ break;
+ case NArchive::NExtract::NOperationResult::kUnavailable:
+ s = kUnavailableData;
+ break;
+ case NArchive::NExtract::NOperationResult::kUnexpectedEnd:
+ s = kUnexpectedEnd;
+ break;
+ case NArchive::NExtract::NOperationResult::kDataAfterEnd:
+ s = kDataAfterEnd;
+ break;
+ case NArchive::NExtract::NOperationResult::kIsNotArc:
+ s = kIsNotArc;
+ break;
+ case NArchive::NExtract::NOperationResult::kHeadersError:
+ s = kHeadersError;
+ break;
+ case NArchive::NExtract::NOperationResult::kWrongPassword:
+ s = kWrongPassword;
+ break;
+ }
+
+ dest += kError;
+ if (s)
+ dest += s;
+ else
+ {
+ dest += "Error #";
+ dest.Add_UInt32(opRes);
+ }
+}
+
+STDMETHODIMP CExtractCallbackConsole::SetOperationResult(Int32 opRes, Int32 encrypted)
+{
+ MT_LOCK
+
+ if (opRes == NArchive::NExtract::NOperationResult::kOK)
+ {
+ if (NeedPercents())
+ {
+ _percent.Command.Empty();
+ _percent.FileName.Empty();
+ _percent.Files++;
+ }
+ }
+ else
+ {
+ NumFileErrors_in_Current++;
+ NumFileErrors++;
+
+ if (_se)
+ {
+ ClosePercentsAndFlush();
+
+ AString s;
+ SetExtractErrorMessage(opRes, encrypted, s);
+
+ *_se << s;
+ if (!_currentName.IsEmpty())
+ {
+ *_se << " : ";
+ _se->NormalizePrint_UString(_currentName);
+ }
+ *_se << endl;
+ _se->Flush();
+ }
+ }
+
+ return CheckBreak2();
+}
+
+STDMETHODIMP CExtractCallbackConsole::ReportExtractResult(Int32 opRes, Int32 encrypted, const wchar_t *name)
+{
+ if (opRes != NArchive::NExtract::NOperationResult::kOK)
+ {
+ _currentName = name;
+ return SetOperationResult(opRes, encrypted);
+ }
+
+ return CheckBreak2();
+}
+
+
+
+#ifndef _NO_CRYPTO
+
+HRESULT CExtractCallbackConsole::SetPassword(const UString &password)
+{
+ PasswordIsDefined = true;
+ Password = password;
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackConsole::CryptoGetTextPassword(BSTR *password)
+{
+ COM_TRY_BEGIN
+ MT_LOCK
+ return Open_CryptoGetTextPassword(password);
+ COM_TRY_END
+}
+
+#endif
+
+HRESULT CExtractCallbackConsole::BeforeOpen(const wchar_t *name, bool testMode)
+{
+ RINOK(CheckBreak2());
+
+ NumTryArcs++;
+ ThereIsError_in_Current = false;
+ ThereIsWarning_in_Current = false;
+ NumFileErrors_in_Current = 0;
+
+ ClosePercents_for_so();
+ if (_so)
+ {
+ *_so << endl << (testMode ? kTesting : kExtracting);
+ _so->NormalizePrint_wstr(name);
+ *_so << endl;
+ }
+
+ if (NeedPercents())
+ _percent.Command = "Open";
+ return S_OK;
+}
+
+HRESULT Print_OpenArchive_Props(CStdOutStream &so, const CCodecs *codecs, const CArchiveLink &arcLink);
+HRESULT Print_OpenArchive_Error(CStdOutStream &so, const CCodecs *codecs, const CArchiveLink &arcLink);
+
+static AString GetOpenArcErrorMessage(UInt32 errorFlags)
+{
+ AString s;
+
+ for (unsigned i = 0; i < ARRAY_SIZE(k_ErrorFlagsMessages); i++)
+ {
+ UInt32 f = (1 << i);
+ if ((errorFlags & f) == 0)
+ continue;
+ const char *m = k_ErrorFlagsMessages[i];
+ if (!s.IsEmpty())
+ s.Add_LF();
+ s += m;
+ errorFlags &= ~f;
+ }
+
+ if (errorFlags != 0)
+ {
+ char sz[16];
+ sz[0] = '0';
+ sz[1] = 'x';
+ ConvertUInt32ToHex(errorFlags, sz + 2);
+ if (!s.IsEmpty())
+ s.Add_LF();
+ s += sz;
+ }
+
+ return s;
+}
+
+void PrintErrorFlags(CStdOutStream &so, const char *s, UInt32 errorFlags)
+{
+ if (errorFlags == 0)
+ return;
+ so << s << endl << GetOpenArcErrorMessage(errorFlags) << endl;
+}
+
+void Add_Messsage_Pre_ArcType(UString &s, const char *pre, const wchar_t *arcType)
+{
+ s.Add_LF();
+ s += pre;
+ s += " as [";
+ s += arcType;
+ s += "] archive";
+}
+
+void Print_ErrorFormatIndex_Warning(CStdOutStream *_so, const CCodecs *codecs, const CArc &arc)
+{
+ const CArcErrorInfo &er = arc.ErrorInfo;
+
+ *_so << "WARNING:\n";
+ _so->NormalizePrint_UString(arc.Path);
+ UString s;
+ if (arc.FormatIndex == er.ErrorFormatIndex)
+ {
+ s.Add_LF();
+ s += "The archive is open with offset";
+ }
+ else
+ {
+ Add_Messsage_Pre_ArcType(s, "Can not open the file", codecs->GetFormatNamePtr(er.ErrorFormatIndex));
+ Add_Messsage_Pre_ArcType(s, "The file is open", codecs->GetFormatNamePtr(arc.FormatIndex));
+ }
+
+ *_so << s << endl << endl;
+}
+
+
+HRESULT CExtractCallbackConsole::OpenResult(
+ const CCodecs *codecs, const CArchiveLink &arcLink,
+ const wchar_t *name, HRESULT result)
+{
+ ClosePercents();
+
+ if (NeedPercents())
+ {
+ _percent.Files = 0;
+ _percent.Command.Empty();
+ _percent.FileName.Empty();
+ }
+
+
+ ClosePercentsAndFlush();
+
+ FOR_VECTOR (level, arcLink.Arcs)
+ {
+ const CArc &arc = arcLink.Arcs[level];
+ const CArcErrorInfo &er = arc.ErrorInfo;
+
+ UInt32 errorFlags = er.GetErrorFlags();
+
+ if (errorFlags != 0 || !er.ErrorMessage.IsEmpty())
+ {
+ if (_se)
+ {
+ *_se << endl;
+ if (level != 0)
+ {
+ _se->NormalizePrint_UString(arc.Path);
+ *_se << endl;
+ }
+ }
+
+ if (errorFlags != 0)
+ {
+ if (_se)
+ PrintErrorFlags(*_se, "ERRORS:", errorFlags);
+ NumOpenArcErrors++;
+ ThereIsError_in_Current = true;
+ }
+
+ if (!er.ErrorMessage.IsEmpty())
+ {
+ if (_se)
+ *_se << "ERRORS:" << endl << er.ErrorMessage << endl;
+ NumOpenArcErrors++;
+ ThereIsError_in_Current = true;
+ }
+
+ if (_se)
+ {
+ *_se << endl;
+ _se->Flush();
+ }
+ }
+
+ UInt32 warningFlags = er.GetWarningFlags();
+
+ if (warningFlags != 0 || !er.WarningMessage.IsEmpty())
+ {
+ if (_so)
+ {
+ *_so << endl;
+ if (level != 0)
+ {
+ _so->NormalizePrint_UString(arc.Path);
+ *_so << endl;
+ }
+ }
+
+ if (warningFlags != 0)
+ {
+ if (_so)
+ PrintErrorFlags(*_so, "WARNINGS:", warningFlags);
+ NumOpenArcWarnings++;
+ ThereIsWarning_in_Current = true;
+ }
+
+ if (!er.WarningMessage.IsEmpty())
+ {
+ if (_so)
+ *_so << "WARNINGS:" << endl << er.WarningMessage << endl;
+ NumOpenArcWarnings++;
+ ThereIsWarning_in_Current = true;
+ }
+
+ if (_so)
+ {
+ *_so << endl;
+ if (NeedFlush)
+ _so->Flush();
+ }
+ }
+
+
+ if (er.ErrorFormatIndex >= 0)
+ {
+ if (_so)
+ {
+ Print_ErrorFormatIndex_Warning(_so, codecs, arc);
+ if (NeedFlush)
+ _so->Flush();
+ }
+ ThereIsWarning_in_Current = true;
+ }
+ }
+
+ if (result == S_OK)
+ {
+ if (_so)
+ {
+ RINOK(Print_OpenArchive_Props(*_so, codecs, arcLink));
+ *_so << endl;
+ }
+ }
+ else
+ {
+ NumCantOpenArcs++;
+ if (_so)
+ _so->Flush();
+ if (_se)
+ {
+ *_se << kError;
+ _se->NormalizePrint_wstr(name);
+ *_se << endl;
+ HRESULT res = Print_OpenArchive_Error(*_se, codecs, arcLink);
+ RINOK(res);
+ if (result == S_FALSE)
+ {
+ }
+ else
+ {
+ if (result == E_OUTOFMEMORY)
+ *_se << "Can't allocate required memory";
+ else
+ *_se << NError::MyFormatMessage(result);
+ *_se << endl;
+ }
+ _se->Flush();
+ }
+ }
+
+
+ return CheckBreak2();
+}
+
+HRESULT CExtractCallbackConsole::ThereAreNoFiles()
+{
+ ClosePercents_for_so();
+
+ if (_so)
+ {
+ *_so << endl << kNoFiles << endl;
+ if (NeedFlush)
+ _so->Flush();
+ }
+ return CheckBreak2();
+}
+
+HRESULT CExtractCallbackConsole::ExtractResult(HRESULT result)
+{
+ MT_LOCK
+
+ if (NeedPercents())
+ {
+ _percent.ClosePrint(true);
+ _percent.Command.Empty();
+ _percent.FileName.Empty();
+ }
+
+ if (_so)
+ _so->Flush();
+
+ if (result == S_OK)
+ {
+ if (NumFileErrors_in_Current == 0 && !ThereIsError_in_Current)
+ {
+ if (ThereIsWarning_in_Current)
+ NumArcsWithWarnings++;
+ else
+ NumOkArcs++;
+ if (_so)
+ *_so << kEverythingIsOk << endl;
+ }
+ else
+ {
+ NumArcsWithError++;
+ if (_so)
+ {
+ *_so << endl;
+ if (NumFileErrors_in_Current != 0)
+ *_so << "Sub items Errors: " << NumFileErrors_in_Current << endl;
+ }
+ }
+ if (_so && NeedFlush)
+ _so->Flush();
+ }
+ else
+ {
+ NumArcsWithError++;
+ if (result == E_ABORT || result == ERROR_DISK_FULL)
+ return result;
+
+ if (_se)
+ {
+ *_se << endl << kError;
+ if (result == E_OUTOFMEMORY)
+ *_se << kMemoryExceptionMessage;
+ else
+ *_se << NError::MyFormatMessage(result);
+ *_se << endl;
+ _se->Flush();
+ }
+ }
+
+ return CheckBreak2();
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.h
new file mode 100644
index 0000000000..5de6c5b2a2
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/ExtractCallbackConsole.h
@@ -0,0 +1,164 @@
+// ExtractCallbackConsole.h
+
+#ifndef __EXTRACT_CALLBACK_CONSOLE_H
+#define __EXTRACT_CALLBACK_CONSOLE_H
+
+#include "../../../Common/StdOutStream.h"
+
+#include "../../IPassword.h"
+
+#include "../../Archive/IArchive.h"
+
+#include "../Common/ArchiveExtractCallback.h"
+
+#include "PercentPrinter.h"
+
+#include "OpenCallbackConsole.h"
+
+class CExtractScanConsole: public IDirItemsCallback
+{
+ CStdOutStream *_so;
+ CStdOutStream *_se;
+ CPercentPrinter _percent;
+
+ bool NeedPercents() const { return _percent._so != NULL; }
+
+ void ClosePercentsAndFlush()
+ {
+ if (NeedPercents())
+ _percent.ClosePrint(true);
+ if (_so)
+ _so->Flush();
+ }
+
+public:
+ void Init(CStdOutStream *outStream, CStdOutStream *errorStream, CStdOutStream *percentStream)
+ {
+ _so = outStream;
+ _se = errorStream;
+ _percent._so = percentStream;
+ }
+
+ void SetWindowWidth(unsigned width) { _percent.MaxLen = width - 1; }
+
+ void StartScanning();
+
+ INTERFACE_IDirItemsCallback(;)
+
+ void CloseScanning()
+ {
+ if (NeedPercents())
+ _percent.ClosePrint(true);
+ }
+
+ void PrintStat(const CDirItemsStat &st);
+};
+
+
+
+
+class CExtractCallbackConsole:
+ public IExtractCallbackUI,
+ // public IArchiveExtractCallbackMessage,
+ public IFolderArchiveExtractCallback2,
+ #ifndef _NO_CRYPTO
+ public ICryptoGetTextPassword,
+ #endif
+ public COpenCallbackConsole,
+ public CMyUnknownImp
+{
+ AString _tempA;
+ UString _tempU;
+
+ UString _currentName;
+
+ void ClosePercents_for_so()
+ {
+ if (NeedPercents() && _so == _percent._so)
+ _percent.ClosePrint(false);
+ }
+
+ void ClosePercentsAndFlush()
+ {
+ if (NeedPercents())
+ _percent.ClosePrint(true);
+ if (_so)
+ _so->Flush();
+ }
+
+public:
+ MY_QUERYINTERFACE_BEGIN2(IFolderArchiveExtractCallback)
+ // MY_QUERYINTERFACE_ENTRY(IArchiveExtractCallbackMessage)
+ MY_QUERYINTERFACE_ENTRY(IFolderArchiveExtractCallback2)
+ #ifndef _NO_CRYPTO
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ STDMETHOD(SetTotal)(UInt64 total);
+ STDMETHOD(SetCompleted)(const UInt64 *completeValue);
+
+ INTERFACE_IFolderArchiveExtractCallback(;)
+
+ INTERFACE_IExtractCallbackUI(;)
+ // INTERFACE_IArchiveExtractCallbackMessage(;)
+ INTERFACE_IFolderArchiveExtractCallback2(;)
+
+ #ifndef _NO_CRYPTO
+
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+
+ #endif
+
+ UInt64 NumTryArcs;
+
+ bool ThereIsError_in_Current;
+ bool ThereIsWarning_in_Current;
+
+ UInt64 NumOkArcs;
+ UInt64 NumCantOpenArcs;
+ UInt64 NumArcsWithError;
+ UInt64 NumArcsWithWarnings;
+
+ UInt64 NumOpenArcErrors;
+ UInt64 NumOpenArcWarnings;
+
+ UInt64 NumFileErrors;
+ UInt64 NumFileErrors_in_Current;
+
+ bool NeedFlush;
+ unsigned PercentsNameLevel;
+ unsigned LogLevel;
+
+ CExtractCallbackConsole():
+ NeedFlush(false),
+ PercentsNameLevel(1),
+ LogLevel(0)
+ {}
+
+ void SetWindowWidth(unsigned width) { _percent.MaxLen = width - 1; }
+
+ void Init(CStdOutStream *outStream, CStdOutStream *errorStream, CStdOutStream *percentStream)
+ {
+ COpenCallbackConsole::Init(outStream, errorStream, percentStream);
+
+ NumTryArcs = 0;
+
+ ThereIsError_in_Current = false;
+ ThereIsWarning_in_Current = false;
+
+ NumOkArcs = 0;
+ NumCantOpenArcs = 0;
+ NumArcsWithError = 0;
+ NumArcsWithWarnings = 0;
+
+ NumOpenArcErrors = 0;
+ NumOpenArcWarnings = 0;
+
+ NumFileErrors = 0;
+ NumFileErrors_in_Current = 0;
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.cpp
new file mode 100644
index 0000000000..ec8e6dca94
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.cpp
@@ -0,0 +1,367 @@
+// HashCon.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+
+#include "ConsoleClose.h"
+#include "HashCon.h"
+
+static const char * const kEmptyFileAlias = "[Content]";
+
+static const char * const kScanningMessage = "Scanning";
+
+static HRESULT CheckBreak2()
+{
+ return NConsoleClose::TestBreakSignal() ? E_ABORT : S_OK;
+}
+
+HRESULT CHashCallbackConsole::CheckBreak()
+{
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::StartScanning()
+{
+ if (PrintHeaders && _so)
+ *_so << kScanningMessage << endl;
+ if (NeedPercents())
+ {
+ _percent.ClearCurState();
+ _percent.Command = "Scan";
+ }
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::ScanProgress(const CDirItemsStat &st, const FString &path, bool /* isDir */)
+{
+ if (NeedPercents())
+ {
+ _percent.Files = st.NumDirs + st.NumFiles + st.NumAltStreams;
+ _percent.Completed = st.GetTotalBytes();
+ _percent.FileName = fs2us(path);
+ _percent.Print();
+ }
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::ScanError(const FString &path, DWORD systemError)
+{
+ return ScanError_Base(path, systemError);
+}
+
+void Print_DirItemsStat(AString &s, const CDirItemsStat &st);
+
+HRESULT CHashCallbackConsole::FinishScanning(const CDirItemsStat &st)
+{
+ if (NeedPercents())
+ {
+ _percent.ClosePrint(true);
+ _percent.ClearCurState();
+ }
+ if (PrintHeaders && _so)
+ {
+ Print_DirItemsStat(_s, st);
+ *_so << _s << endl << endl;
+ }
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::SetNumFiles(UInt64 /* numFiles */)
+{
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::SetTotal(UInt64 size)
+{
+ if (NeedPercents())
+ {
+ _percent.Total = size;
+ _percent.Print();
+ }
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::SetCompleted(const UInt64 *completeValue)
+{
+ if (completeValue && NeedPercents())
+ {
+ _percent.Completed = *completeValue;
+ _percent.Print();
+ }
+ return CheckBreak2();
+}
+
+static void AddMinuses(AString &s, unsigned num)
+{
+ for (unsigned i = 0; i < num; i++)
+ s += '-';
+}
+
+static void AddSpaces_if_Positive(AString &s, int num)
+{
+ for (int i = 0; i < num; i++)
+ s.Add_Space();
+}
+
+static void SetSpacesAndNul(char *s, unsigned num)
+{
+ for (unsigned i = 0; i < num; i++)
+ s[i] = ' ';
+ s[num] = 0;
+}
+
+static const unsigned kSizeField_Len = 13;
+static const unsigned kNameField_Len = 12;
+
+static const unsigned kHashColumnWidth_Min = 4 * 2;
+
+static unsigned GetColumnWidth(unsigned digestSize)
+{
+ unsigned width = digestSize * 2;
+ return width < kHashColumnWidth_Min ? kHashColumnWidth_Min: width;
+}
+
+void CHashCallbackConsole::PrintSeparatorLine(const CObjectVector<CHasherState> &hashers)
+{
+ _s.Empty();
+
+ for (unsigned i = 0; i < hashers.Size(); i++)
+ {
+ if (i != 0)
+ _s.Add_Space();
+ const CHasherState &h = hashers[i];
+ AddMinuses(_s, GetColumnWidth(h.DigestSize));
+ }
+
+ if (PrintSize)
+ {
+ _s.Add_Space();
+ AddMinuses(_s, kSizeField_Len);
+ }
+
+ if (PrintName)
+ {
+ AddSpacesBeforeName();
+ AddMinuses(_s, kNameField_Len);
+ }
+
+ *_so << _s << endl;
+}
+
+HRESULT CHashCallbackConsole::BeforeFirstFile(const CHashBundle &hb)
+{
+ if (PrintHeaders && _so)
+ {
+ _s.Empty();
+ ClosePercents_for_so();
+
+ FOR_VECTOR (i, hb.Hashers)
+ {
+ if (i != 0)
+ _s.Add_Space();
+ const CHasherState &h = hb.Hashers[i];
+ _s += h.Name;
+ AddSpaces_if_Positive(_s, (int)GetColumnWidth(h.DigestSize) - (int)h.Name.Len());
+ }
+
+ if (PrintSize)
+ {
+ _s.Add_Space();
+ const AString s2 ("Size");
+ AddSpaces_if_Positive(_s, (int)kSizeField_Len - (int)s2.Len());
+ _s += s2;
+ }
+
+ if (PrintName)
+ {
+ AddSpacesBeforeName();
+ _s += "Name";
+ }
+
+ *_so << _s << endl;
+ PrintSeparatorLine(hb.Hashers);
+ }
+
+ return CheckBreak2();
+}
+
+HRESULT CHashCallbackConsole::OpenFileError(const FString &path, DWORD systemError)
+{
+ return OpenFileError_Base(path, systemError);
+}
+
+HRESULT CHashCallbackConsole::GetStream(const wchar_t *name, bool /* isFolder */)
+{
+ _fileName = name;
+
+ if (NeedPercents())
+ {
+ if (PrintNameInPercents)
+ {
+ _percent.FileName.Empty();
+ if (name)
+ _percent.FileName = name;
+ }
+ _percent.Print();
+ }
+ return CheckBreak2();
+}
+
+void CHashCallbackConsole::PrintResultLine(UInt64 fileSize,
+ const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash)
+{
+ ClosePercents_for_so();
+
+ _s.Empty();
+
+ FOR_VECTOR (i, hashers)
+ {
+ const CHasherState &h = hashers[i];
+ char s[k_HashCalc_DigestSize_Max * 2 + 64];
+ s[0] = 0;
+ if (showHash)
+ AddHashHexToString(s, h.Digests[digestIndex], h.DigestSize);
+ SetSpacesAndNul(s + strlen(s), (int)GetColumnWidth(h.DigestSize) - (int)strlen(s));
+ if (i != 0)
+ _s.Add_Space();
+ _s += s;
+ }
+
+ if (PrintSize)
+ {
+ _s.Add_Space();
+
+ char s[kSizeField_Len + 32];
+ char *p = s;
+
+ if (showHash)
+ {
+ p = s + kSizeField_Len;
+ ConvertUInt64ToString(fileSize, p);
+ int numSpaces = kSizeField_Len - (int)strlen(p);
+ if (numSpaces > 0)
+ {
+ p -= (unsigned)numSpaces;
+ for (unsigned i = 0; i < (unsigned)numSpaces; i++)
+ p[i] = ' ';
+ }
+ }
+ else
+ SetSpacesAndNul(s, kSizeField_Len);
+
+ _s += p;
+ }
+
+ if (PrintName)
+ AddSpacesBeforeName();
+
+ *_so << _s;
+}
+
+HRESULT CHashCallbackConsole::SetOperationResult(UInt64 fileSize, const CHashBundle &hb, bool showHash)
+{
+ if (_so)
+ {
+ PrintResultLine(fileSize, hb.Hashers, k_HashCalc_Index_Current, showHash);
+ if (PrintName)
+ {
+ if (_fileName.IsEmpty())
+ *_so << kEmptyFileAlias;
+ else
+ _so->NormalizePrint_UString(_fileName);
+ }
+ *_so << endl;
+ }
+
+ if (NeedPercents())
+ {
+ _percent.Files++;
+ _percent.Print();
+ }
+
+ return CheckBreak2();
+}
+
+static const char * const k_DigestTitles[] =
+{
+ " : "
+ , " for data: "
+ , " for data and names: "
+ , " for streams and names: "
+};
+
+static void PrintSum(CStdOutStream &so, const CHasherState &h, unsigned digestIndex)
+{
+ so << h.Name;
+
+ {
+ AString temp;
+ AddSpaces_if_Positive(temp, 6 - (int)h.Name.Len());
+ so << temp;
+ }
+
+ so << k_DigestTitles[digestIndex];
+
+ char s[k_HashCalc_DigestSize_Max * 2 + 64];
+ s[0] = 0;
+ AddHashHexToString(s, h.Digests[digestIndex], h.DigestSize);
+ so << s << endl;
+}
+
+void PrintHashStat(CStdOutStream &so, const CHashBundle &hb)
+{
+ FOR_VECTOR (i, hb.Hashers)
+ {
+ const CHasherState &h = hb.Hashers[i];
+ PrintSum(so, h, k_HashCalc_Index_DataSum);
+ if (hb.NumFiles != 1 || hb.NumDirs != 0)
+ PrintSum(so, h, k_HashCalc_Index_NamesSum);
+ if (hb.NumAltStreams != 0)
+ PrintSum(so, h, k_HashCalc_Index_StreamsSum);
+ so << endl;
+ }
+}
+
+void CHashCallbackConsole::PrintProperty(const char *name, UInt64 value)
+{
+ char s[32];
+ s[0] = ':';
+ s[1] = ' ';
+ ConvertUInt64ToString(value, s + 2);
+ *_so << name << s << endl;
+}
+
+HRESULT CHashCallbackConsole::AfterLastFile(const CHashBundle &hb)
+{
+ ClosePercents2();
+
+ if (PrintHeaders && _so)
+ {
+ PrintSeparatorLine(hb.Hashers);
+
+ PrintResultLine(hb.FilesSize, hb.Hashers, k_HashCalc_Index_DataSum, true);
+
+ *_so << endl << endl;
+
+ if (hb.NumFiles != 1 || hb.NumDirs != 0)
+ {
+ if (hb.NumDirs != 0)
+ PrintProperty("Folders", hb.NumDirs);
+ PrintProperty("Files", hb.NumFiles);
+ }
+
+ PrintProperty("Size", hb.FilesSize);
+
+ if (hb.NumAltStreams != 0)
+ {
+ PrintProperty("Alternate streams", hb.NumAltStreams);
+ PrintProperty("Alternate streams size", hb.AltStreamsSize);
+ }
+
+ *_so << endl;
+ PrintHashStat(*_so, hb);
+ }
+
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.h
new file mode 100644
index 0000000000..9c12869eb6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/HashCon.h
@@ -0,0 +1,48 @@
+// HashCon.h
+
+#ifndef __HASH_CON_H
+#define __HASH_CON_H
+
+#include "../Common/HashCalc.h"
+
+#include "UpdateCallbackConsole.h"
+
+class CHashCallbackConsole: public IHashCallbackUI, public CCallbackConsoleBase
+{
+ UString _fileName;
+ AString _s;
+
+ void AddSpacesBeforeName()
+ {
+ _s.Add_Space();
+ _s.Add_Space();
+ }
+
+ void PrintSeparatorLine(const CObjectVector<CHasherState> &hashers);
+ void PrintResultLine(UInt64 fileSize,
+ const CObjectVector<CHasherState> &hashers, unsigned digestIndex, bool showHash);
+ void PrintProperty(const char *name, UInt64 value);
+
+public:
+ bool PrintNameInPercents;
+
+ bool PrintHeaders;
+
+ bool PrintSize;
+ bool PrintName;
+
+ CHashCallbackConsole():
+ PrintNameInPercents(true),
+ PrintHeaders(false),
+ PrintSize(true),
+ PrintName(true)
+ {}
+
+ ~CHashCallbackConsole() { }
+
+ INTERFACE_IHashCallbackUI(;)
+};
+
+void PrintHashStat(CStdOutStream &so, const CHashBundle &hb);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/List.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/List.cpp
new file mode 100644
index 0000000000..ebcabb6853
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/List.cpp
@@ -0,0 +1,1349 @@
+// List.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/MyCom.h"
+#include "../../../Common/StdOutStream.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/UTFConvert.h"
+
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/PropVariant.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#include "../Common/OpenArchive.h"
+#include "../Common/PropIDUtils.h"
+
+#include "ConsoleClose.h"
+#include "List.h"
+#include "OpenCallbackConsole.h"
+
+using namespace NWindows;
+using namespace NCOM;
+
+extern CStdOutStream *g_StdStream;
+extern CStdOutStream *g_ErrStream;
+
+static const char * const kPropIdToName[] =
+{
+ "0"
+ , "1"
+ , "2"
+ , "Path"
+ , "Name"
+ , "Extension"
+ , "Folder"
+ , "Size"
+ , "Packed Size"
+ , "Attributes"
+ , "Created"
+ , "Accessed"
+ , "Modified"
+ , "Solid"
+ , "Commented"
+ , "Encrypted"
+ , "Split Before"
+ , "Split After"
+ , "Dictionary Size"
+ , "CRC"
+ , "Type"
+ , "Anti"
+ , "Method"
+ , "Host OS"
+ , "File System"
+ , "User"
+ , "Group"
+ , "Block"
+ , "Comment"
+ , "Position"
+ , "Path Prefix"
+ , "Folders"
+ , "Files"
+ , "Version"
+ , "Volume"
+ , "Multivolume"
+ , "Offset"
+ , "Links"
+ , "Blocks"
+ , "Volumes"
+ , "Time Type"
+ , "64-bit"
+ , "Big-endian"
+ , "CPU"
+ , "Physical Size"
+ , "Headers Size"
+ , "Checksum"
+ , "Characteristics"
+ , "Virtual Address"
+ , "ID"
+ , "Short Name"
+ , "Creator Application"
+ , "Sector Size"
+ , "Mode"
+ , "Symbolic Link"
+ , "Error"
+ , "Total Size"
+ , "Free Space"
+ , "Cluster Size"
+ , "Label"
+ , "Local Name"
+ , "Provider"
+ , "NT Security"
+ , "Alternate Stream"
+ , "Aux"
+ , "Deleted"
+ , "Tree"
+ , "SHA-1"
+ , "SHA-256"
+ , "Error Type"
+ , "Errors"
+ , "Errors"
+ , "Warnings"
+ , "Warning"
+ , "Streams"
+ , "Alternate Streams"
+ , "Alternate Streams Size"
+ , "Virtual Size"
+ , "Unpack Size"
+ , "Total Physical Size"
+ , "Volume Index"
+ , "SubType"
+ , "Short Comment"
+ , "Code Page"
+ , "Is not archive type"
+ , "Physical Size can't be detected"
+ , "Zeros Tail Is Allowed"
+ , "Tail Size"
+ , "Embedded Stub Size"
+ , "Link"
+ , "Hard Link"
+ , "iNode"
+ , "Stream ID"
+ , "Read-only"
+ , "Out Name"
+ , "Copy Link"
+};
+
+static const char kEmptyAttribChar = '.';
+
+static const char * const kListing = "Listing archive: ";
+
+static const char * const kString_Files = "files";
+static const char * const kString_Dirs = "folders";
+static const char * const kString_AltStreams = "alternate streams";
+static const char * const kString_Streams = "streams";
+
+static const char * const kError = "ERROR: ";
+
+static void GetAttribString(UInt32 wa, bool isDir, bool allAttribs, char *s)
+{
+ if (isDir)
+ wa |= FILE_ATTRIBUTE_DIRECTORY;
+ if (allAttribs)
+ {
+ ConvertWinAttribToString(s, wa);
+ return;
+ }
+ s[0] = ((wa & FILE_ATTRIBUTE_DIRECTORY) != 0) ? 'D': kEmptyAttribChar;
+ s[1] = ((wa & FILE_ATTRIBUTE_READONLY) != 0) ? 'R': kEmptyAttribChar;
+ s[2] = ((wa & FILE_ATTRIBUTE_HIDDEN) != 0) ? 'H': kEmptyAttribChar;
+ s[3] = ((wa & FILE_ATTRIBUTE_SYSTEM) != 0) ? 'S': kEmptyAttribChar;
+ s[4] = ((wa & FILE_ATTRIBUTE_ARCHIVE) != 0) ? 'A': kEmptyAttribChar;
+ s[5] = 0;
+}
+
+enum EAdjustment
+{
+ kLeft,
+ kCenter,
+ kRight
+};
+
+struct CFieldInfo
+{
+ PROPID PropID;
+ bool IsRawProp;
+ UString NameU;
+ AString NameA;
+ EAdjustment TitleAdjustment;
+ EAdjustment TextAdjustment;
+ unsigned PrefixSpacesWidth;
+ unsigned Width;
+};
+
+struct CFieldInfoInit
+{
+ PROPID PropID;
+ const char *Name;
+ EAdjustment TitleAdjustment;
+ EAdjustment TextAdjustment;
+ unsigned PrefixSpacesWidth;
+ unsigned Width;
+};
+
+static const CFieldInfoInit kStandardFieldTable[] =
+{
+ { kpidMTime, " Date Time", kLeft, kLeft, 0, 19 },
+ { kpidAttrib, "Attr", kRight, kCenter, 1, 5 },
+ { kpidSize, "Size", kRight, kRight, 1, 12 },
+ { kpidPackSize, "Compressed", kRight, kRight, 1, 12 },
+ { kpidPath, "Name", kLeft, kLeft, 2, 24 }
+};
+
+const unsigned kNumSpacesMax = 32; // it must be larger than max CFieldInfoInit.Width
+static const char *g_Spaces =
+" " ;
+
+static void PrintSpaces(unsigned numSpaces)
+{
+ if (numSpaces > 0 && numSpaces <= kNumSpacesMax)
+ g_StdOut << g_Spaces + (kNumSpacesMax - numSpaces);
+}
+
+static void PrintSpacesToString(char *dest, unsigned numSpaces)
+{
+ unsigned i;
+ for (i = 0; i < numSpaces; i++)
+ dest[i] = ' ';
+ dest[i] = 0;
+}
+
+// extern int g_CodePage;
+
+static void PrintUString(EAdjustment adj, unsigned width, const UString &s, AString &temp)
+{
+ /*
+ // we don't need multibyte align.
+ int codePage = g_CodePage;
+ if (codePage == -1)
+ codePage = CP_OEMCP;
+ if (codePage == CP_UTF8)
+ ConvertUnicodeToUTF8(s, temp);
+ else
+ UnicodeStringToMultiByte2(temp, s, (UINT)codePage);
+ */
+
+ unsigned numSpaces = 0;
+
+ if (width > s.Len())
+ {
+ numSpaces = width - s.Len();
+ unsigned numLeftSpaces = 0;
+ switch (adj)
+ {
+ case kLeft: numLeftSpaces = 0; break;
+ case kCenter: numLeftSpaces = numSpaces / 2; break;
+ case kRight: numLeftSpaces = numSpaces; break;
+ }
+ PrintSpaces(numLeftSpaces);
+ numSpaces -= numLeftSpaces;
+ }
+
+ g_StdOut.PrintUString(s, temp);
+ PrintSpaces(numSpaces);
+}
+
+static void PrintString(EAdjustment adj, unsigned width, const char *s)
+{
+ unsigned numSpaces = 0;
+ unsigned len = (unsigned)strlen(s);
+
+ if (width > len)
+ {
+ numSpaces = width - len;
+ unsigned numLeftSpaces = 0;
+ switch (adj)
+ {
+ case kLeft: numLeftSpaces = 0; break;
+ case kCenter: numLeftSpaces = numSpaces / 2; break;
+ case kRight: numLeftSpaces = numSpaces; break;
+ }
+ PrintSpaces(numLeftSpaces);
+ numSpaces -= numLeftSpaces;
+ }
+
+ g_StdOut << s;
+ PrintSpaces(numSpaces);
+}
+
+static void PrintStringToString(char *dest, EAdjustment adj, unsigned width, const char *textString)
+{
+ unsigned numSpaces = 0;
+ unsigned len = (unsigned)strlen(textString);
+
+ if (width > len)
+ {
+ numSpaces = width - len;
+ unsigned numLeftSpaces = 0;
+ switch (adj)
+ {
+ case kLeft: numLeftSpaces = 0; break;
+ case kCenter: numLeftSpaces = numSpaces / 2; break;
+ case kRight: numLeftSpaces = numSpaces; break;
+ }
+ PrintSpacesToString(dest, numLeftSpaces);
+ dest += numLeftSpaces;
+ numSpaces -= numLeftSpaces;
+ }
+
+ memcpy(dest, textString, len);
+ dest += len;
+ PrintSpacesToString(dest, numSpaces);
+}
+
+struct CListUInt64Def
+{
+ UInt64 Val;
+ bool Def;
+
+ CListUInt64Def(): Val(0), Def(false) {}
+ void Add(UInt64 v) { Val += v; Def = true; }
+ void Add(const CListUInt64Def &v) { if (v.Def) Add(v.Val); }
+};
+
+struct CListFileTimeDef
+{
+ FILETIME Val;
+ bool Def;
+
+ CListFileTimeDef(): Def(false) { Val.dwLowDateTime = 0; Val.dwHighDateTime = 0; }
+ void Update(const CListFileTimeDef &t)
+ {
+ if (t.Def && (!Def || CompareFileTime(&Val, &t.Val) < 0))
+ {
+ Val = t.Val;
+ Def = true;
+ }
+ }
+};
+
+struct CListStat
+{
+ CListUInt64Def Size;
+ CListUInt64Def PackSize;
+ CListFileTimeDef MTime;
+ UInt64 NumFiles;
+
+ CListStat(): NumFiles(0) {}
+ void Update(const CListStat &st)
+ {
+ Size.Add(st.Size);
+ PackSize.Add(st.PackSize);
+ MTime.Update(st.MTime);
+ NumFiles += st.NumFiles;
+ }
+ void SetSizeDefIfNoFiles() { if (NumFiles == 0) Size.Def = true; }
+};
+
+struct CListStat2
+{
+ CListStat MainFiles;
+ CListStat AltStreams;
+ UInt64 NumDirs;
+
+ CListStat2(): NumDirs(0) {}
+
+ void Update(const CListStat2 &st)
+ {
+ MainFiles.Update(st.MainFiles);
+ AltStreams.Update(st.AltStreams);
+ NumDirs += st.NumDirs;
+ }
+ const UInt64 GetNumStreams() const { return MainFiles.NumFiles + AltStreams.NumFiles; }
+ CListStat &GetStat(bool altStreamsMode) { return altStreamsMode ? AltStreams : MainFiles; }
+};
+
+class CFieldPrinter
+{
+ CObjectVector<CFieldInfo> _fields;
+
+ void AddProp(const wchar_t *name, PROPID propID, bool isRawProp);
+public:
+ const CArc *Arc;
+ bool TechMode;
+ UString FilePath;
+ AString TempAString;
+ UString TempWString;
+ bool IsDir;
+
+ AString LinesString;
+
+ void Clear() { _fields.Clear(); LinesString.Empty(); }
+ void Init(const CFieldInfoInit *standardFieldTable, unsigned numItems);
+
+ HRESULT AddMainProps(IInArchive *archive);
+ HRESULT AddRawProps(IArchiveGetRawProps *getRawProps);
+
+ void PrintTitle();
+ void PrintTitleLines();
+ HRESULT PrintItemInfo(UInt32 index, const CListStat &st);
+ void PrintSum(const CListStat &st, UInt64 numDirs, const char *str);
+ void PrintSum(const CListStat2 &stat2);
+};
+
+void CFieldPrinter::Init(const CFieldInfoInit *standardFieldTable, unsigned numItems)
+{
+ Clear();
+ for (unsigned i = 0; i < numItems; i++)
+ {
+ CFieldInfo &f = _fields.AddNew();
+ const CFieldInfoInit &fii = standardFieldTable[i];
+ f.PropID = fii.PropID;
+ f.IsRawProp = false;
+ f.NameA = fii.Name;
+ f.TitleAdjustment = fii.TitleAdjustment;
+ f.TextAdjustment = fii.TextAdjustment;
+ f.PrefixSpacesWidth = fii.PrefixSpacesWidth;
+ f.Width = fii.Width;
+
+ unsigned k;
+ for (k = 0; k < fii.PrefixSpacesWidth; k++)
+ LinesString.Add_Space();
+ for (k = 0; k < fii.Width; k++)
+ LinesString += '-';
+ }
+}
+
+static void GetPropName(PROPID propID, const wchar_t *name, AString &nameA, UString &nameU)
+{
+ if (propID < ARRAY_SIZE(kPropIdToName))
+ {
+ nameA = kPropIdToName[propID];
+ return;
+ }
+ if (name)
+ nameU = name;
+ else
+ {
+ nameA.Empty();
+ nameA.Add_UInt32(propID);
+ }
+}
+
+void CFieldPrinter::AddProp(const wchar_t *name, PROPID propID, bool isRawProp)
+{
+ CFieldInfo f;
+ f.PropID = propID;
+ f.IsRawProp = isRawProp;
+ GetPropName(propID, name, f.NameA, f.NameU);
+ f.NameU += " = ";
+ if (!f.NameA.IsEmpty())
+ f.NameA += " = ";
+ else
+ {
+ const UString &s = f.NameU;
+ AString sA;
+ unsigned i;
+ for (i = 0; i < s.Len(); i++)
+ {
+ wchar_t c = s[i];
+ if (c >= 0x80)
+ break;
+ sA += (char)c;
+ }
+ if (i == s.Len())
+ f.NameA = sA;
+ }
+ _fields.Add(f);
+}
+
+HRESULT CFieldPrinter::AddMainProps(IInArchive *archive)
+{
+ UInt32 numProps;
+ RINOK(archive->GetNumberOfProperties(&numProps));
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE vt;
+ RINOK(archive->GetPropertyInfo(i, &name, &propID, &vt));
+ AddProp(name, propID, false);
+ }
+ return S_OK;
+}
+
+HRESULT CFieldPrinter::AddRawProps(IArchiveGetRawProps *getRawProps)
+{
+ UInt32 numProps;
+ RINOK(getRawProps->GetNumRawProps(&numProps));
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ RINOK(getRawProps->GetRawPropInfo(i, &name, &propID));
+ AddProp(name, propID, true);
+ }
+ return S_OK;
+}
+
+void CFieldPrinter::PrintTitle()
+{
+ FOR_VECTOR (i, _fields)
+ {
+ const CFieldInfo &f = _fields[i];
+ PrintSpaces(f.PrefixSpacesWidth);
+ PrintString(f.TitleAdjustment, ((f.PropID == kpidPath) ? 0: f.Width), f.NameA);
+ }
+}
+
+void CFieldPrinter::PrintTitleLines()
+{
+ g_StdOut << LinesString;
+}
+
+static void PrintTime(char *dest, const FILETIME *ft)
+{
+ *dest = 0;
+ if (ft->dwLowDateTime == 0 && ft->dwHighDateTime == 0)
+ return;
+ ConvertUtcFileTimeToString(*ft, dest, kTimestampPrintLevel_SEC);
+}
+
+#ifndef _SFX
+
+static inline char GetHex(Byte value)
+{
+ return (char)((value < 10) ? ('0' + value) : ('A' + (value - 10)));
+}
+
+static void HexToString(char *dest, const Byte *data, UInt32 size)
+{
+ for (UInt32 i = 0; i < size; i++)
+ {
+ Byte b = data[i];
+ dest[0] = GetHex((Byte)((b >> 4) & 0xF));
+ dest[1] = GetHex((Byte)(b & 0xF));
+ dest += 2;
+ }
+ *dest = 0;
+}
+
+#endif
+
+#define MY_ENDL endl
+
+HRESULT CFieldPrinter::PrintItemInfo(UInt32 index, const CListStat &st)
+{
+ char temp[128];
+ size_t tempPos = 0;
+
+ bool techMode = this->TechMode;
+ /*
+ if (techMode)
+ {
+ g_StdOut << "Index = ";
+ g_StdOut << (UInt64)index;
+ g_StdOut << endl;
+ }
+ */
+ FOR_VECTOR (i, _fields)
+ {
+ const CFieldInfo &f = _fields[i];
+
+ if (!techMode)
+ {
+ PrintSpacesToString(temp + tempPos, f.PrefixSpacesWidth);
+ tempPos += f.PrefixSpacesWidth;
+ }
+
+ if (techMode)
+ {
+ if (!f.NameA.IsEmpty())
+ g_StdOut << f.NameA;
+ else
+ g_StdOut << f.NameU;
+ }
+
+ if (f.PropID == kpidPath)
+ {
+ if (!techMode)
+ g_StdOut << temp;
+ g_StdOut.NormalizePrint_UString(FilePath, TempWString, TempAString);
+ if (techMode)
+ g_StdOut << MY_ENDL;
+ continue;
+ }
+
+ const unsigned width = f.Width;
+
+ if (f.IsRawProp)
+ {
+ #ifndef _SFX
+
+ const void *data;
+ UInt32 dataSize;
+ UInt32 propType;
+ RINOK(Arc->GetRawProps->GetRawProp(index, f.PropID, &data, &dataSize, &propType));
+
+ if (dataSize != 0)
+ {
+ bool needPrint = true;
+
+ if (f.PropID == kpidNtSecure)
+ {
+ if (propType != NPropDataType::kRaw)
+ return E_FAIL;
+ #ifndef _SFX
+ ConvertNtSecureToString((const Byte *)data, dataSize, TempAString);
+ g_StdOut << TempAString;
+ needPrint = false;
+ #endif
+ }
+ else if (f.PropID == kpidNtReparse)
+ {
+ UString s;
+ if (ConvertNtReparseToString((const Byte *)data, dataSize, s))
+ {
+ needPrint = false;
+ g_StdOut.PrintUString(s, TempAString);
+ }
+ }
+
+ if (needPrint)
+ {
+ if (propType != NPropDataType::kRaw)
+ return E_FAIL;
+
+ const UInt32 kMaxDataSize = 64;
+
+ if (dataSize > kMaxDataSize)
+ {
+ g_StdOut << "data:";
+ g_StdOut << dataSize;
+ }
+ else
+ {
+ char hexStr[kMaxDataSize * 2 + 4];
+ HexToString(hexStr, (const Byte *)data, dataSize);
+ g_StdOut << hexStr;
+ }
+ }
+ }
+
+ #endif
+ }
+ else
+ {
+ CPropVariant prop;
+ switch (f.PropID)
+ {
+ case kpidSize: if (st.Size.Def) prop = st.Size.Val; break;
+ case kpidPackSize: if (st.PackSize.Def) prop = st.PackSize.Val; break;
+ case kpidMTime: if (st.MTime.Def) prop = st.MTime.Val; break;
+ default:
+ RINOK(Arc->Archive->GetProperty(index, f.PropID, &prop));
+ }
+ if (f.PropID == kpidAttrib && (prop.vt == VT_EMPTY || prop.vt == VT_UI4))
+ {
+ GetAttribString((prop.vt == VT_EMPTY) ? 0 : prop.ulVal, IsDir, techMode, temp + tempPos);
+ if (techMode)
+ g_StdOut << temp + tempPos;
+ else
+ tempPos += strlen(temp + tempPos);
+ }
+ else if (prop.vt == VT_EMPTY)
+ {
+ if (!techMode)
+ {
+ PrintSpacesToString(temp + tempPos, width);
+ tempPos += width;
+ }
+ }
+ else if (prop.vt == VT_FILETIME)
+ {
+ PrintTime(temp + tempPos, &prop.filetime);
+ if (techMode)
+ g_StdOut << temp + tempPos;
+ else
+ {
+ size_t len = strlen(temp + tempPos);
+ tempPos += len;
+ if (len < (unsigned)f.Width)
+ {
+ len = f.Width - len;
+ PrintSpacesToString(temp + tempPos, (unsigned)len);
+ tempPos += len;
+ }
+ }
+ }
+ else if (prop.vt == VT_BSTR)
+ {
+ TempWString.SetFromBstr(prop.bstrVal);
+ // do we need multi-line support here ?
+ g_StdOut.Normalize_UString(TempWString);
+ if (techMode)
+ {
+ g_StdOut.PrintUString(TempWString, TempAString);
+ }
+ else
+ PrintUString(f.TextAdjustment, width, TempWString, TempAString);
+ }
+ else
+ {
+ char s[64];
+ ConvertPropertyToShortString2(s, prop, f.PropID);
+ if (techMode)
+ g_StdOut << s;
+ else
+ {
+ PrintStringToString(temp + tempPos, f.TextAdjustment, width, s);
+ tempPos += strlen(temp + tempPos);
+ }
+ }
+ }
+ if (techMode)
+ g_StdOut << MY_ENDL;
+ }
+ g_StdOut << MY_ENDL;
+ return S_OK;
+}
+
+static void PrintNumber(EAdjustment adj, unsigned width, const CListUInt64Def &value)
+{
+ char s[32];
+ s[0] = 0;
+ if (value.Def)
+ ConvertUInt64ToString(value.Val, s);
+ PrintString(adj, width, s);
+}
+
+void Print_UInt64_and_String(AString &s, UInt64 val, const char *name);
+
+void CFieldPrinter::PrintSum(const CListStat &st, UInt64 numDirs, const char *str)
+{
+ FOR_VECTOR (i, _fields)
+ {
+ const CFieldInfo &f = _fields[i];
+ PrintSpaces(f.PrefixSpacesWidth);
+ if (f.PropID == kpidSize)
+ PrintNumber(f.TextAdjustment, f.Width, st.Size);
+ else if (f.PropID == kpidPackSize)
+ PrintNumber(f.TextAdjustment, f.Width, st.PackSize);
+ else if (f.PropID == kpidMTime)
+ {
+ char s[64];
+ s[0] = 0;
+ if (st.MTime.Def)
+ PrintTime(s, &st.MTime.Val);
+ PrintString(f.TextAdjustment, f.Width, s);
+ }
+ else if (f.PropID == kpidPath)
+ {
+ AString s;
+ Print_UInt64_and_String(s, st.NumFiles, str);
+ if (numDirs != 0)
+ {
+ s += ", ";
+ Print_UInt64_and_String(s, numDirs, kString_Dirs);
+ }
+ PrintString(f.TextAdjustment, 0, s);
+ }
+ else
+ PrintString(f.TextAdjustment, f.Width, "");
+ }
+ g_StdOut << endl;
+}
+
+void CFieldPrinter::PrintSum(const CListStat2 &stat2)
+{
+ PrintSum(stat2.MainFiles, stat2.NumDirs, kString_Files);
+ if (stat2.AltStreams.NumFiles != 0)
+ {
+ PrintSum(stat2.AltStreams, 0, kString_AltStreams);;
+ CListStat st = stat2.MainFiles;
+ st.Update(stat2.AltStreams);
+ PrintSum(st, 0, kString_Streams);
+ }
+}
+
+static HRESULT GetUInt64Value(IInArchive *archive, UInt32 index, PROPID propID, CListUInt64Def &value)
+{
+ value.Val = 0;
+ value.Def = false;
+ CPropVariant prop;
+ RINOK(archive->GetProperty(index, propID, &prop));
+ value.Def = ConvertPropVariantToUInt64(prop, value.Val);
+ return S_OK;
+}
+
+static HRESULT GetItemMTime(IInArchive *archive, UInt32 index, CListFileTimeDef &t)
+{
+ t.Val.dwLowDateTime = 0;
+ t.Val.dwHighDateTime = 0;
+ t.Def = false;
+ CPropVariant prop;
+ RINOK(archive->GetProperty(index, kpidMTime, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ t.Val = prop.filetime;
+ t.Def = true;
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+static void PrintPropNameAndNumber(CStdOutStream &so, const char *name, UInt64 val)
+{
+ so << name << ": " << val << endl;
+}
+
+static void PrintPropName_and_Eq(CStdOutStream &so, PROPID propID)
+{
+ const char *s;
+ char temp[16];
+ if (propID < ARRAY_SIZE(kPropIdToName))
+ s = kPropIdToName[propID];
+ else
+ {
+ ConvertUInt32ToString(propID, temp);
+ s = temp;
+ }
+ so << s << " = ";
+}
+
+static void PrintPropNameAndNumber(CStdOutStream &so, PROPID propID, UInt64 val)
+{
+ PrintPropName_and_Eq(so, propID);
+ so << val << endl;
+}
+
+static void PrintPropNameAndNumber_Signed(CStdOutStream &so, PROPID propID, Int64 val)
+{
+ PrintPropName_and_Eq(so, propID);
+ so << val << endl;
+}
+
+
+static void UString_Replace_CRLF_to_LF(UString &s)
+{
+ // s.Replace(L"\r\n", L"\n");
+ wchar_t *src = s.GetBuf();
+ wchar_t *dest = src;
+ for (;;)
+ {
+ wchar_t c = *src++;
+ if (c == 0)
+ break;
+ if (c == '\r' && *src == '\n')
+ {
+ src++;
+ c = '\n';
+ }
+ *dest++ = c;
+ }
+ s.ReleaseBuf_SetEnd((unsigned)(dest - s.GetBuf()));
+}
+
+
+static void PrintPropVal_MultiLine(CStdOutStream &so, const wchar_t *val)
+{
+ UString s = val;
+ if (s.Find(L'\n') >= 0)
+ {
+ so << endl;
+ so << "{";
+ so << endl;
+ UString_Replace_CRLF_to_LF(s);
+ so.Normalize_UString__LF_Allowed(s);
+ so << s;
+ so << endl;
+ so << "}";
+ }
+ else
+ {
+ so.Normalize_UString(s);
+ so << s;
+ }
+ so << endl;
+}
+
+
+static void PrintPropPair(CStdOutStream &so, const char *name, const wchar_t *val, bool multiLine)
+{
+ so << name << " = ";
+ if (multiLine)
+ {
+ PrintPropVal_MultiLine(so, val);
+ return;
+ }
+ UString s = val;
+ so.Normalize_UString(s);
+ so << s;
+ so << endl;
+}
+
+
+static void PrintPropertyPair2(CStdOutStream &so, PROPID propID, const wchar_t *name, const CPropVariant &prop)
+{
+ UString s;
+ ConvertPropertyToString2(s, prop, propID);
+ if (!s.IsEmpty())
+ {
+ AString nameA;
+ UString nameU;
+ GetPropName(propID, name, nameA, nameU);
+ if (!nameA.IsEmpty())
+ so << nameA;
+ else
+ so << nameU;
+ so << " = ";
+ PrintPropVal_MultiLine(so, s);
+ }
+}
+
+static HRESULT PrintArcProp(CStdOutStream &so, IInArchive *archive, PROPID propID, const wchar_t *name)
+{
+ CPropVariant prop;
+ RINOK(archive->GetArchiveProperty(propID, &prop));
+ PrintPropertyPair2(so, propID, name, prop);
+ return S_OK;
+}
+
+static void PrintArcTypeError(CStdOutStream &so, const UString &type, bool isWarning)
+{
+ so << "Open " << (isWarning ? "WARNING" : "ERROR")
+ << ": Can not open the file as ["
+ << type
+ << "] archive"
+ << endl;
+}
+
+int Find_FileName_InSortedVector(const UStringVector &fileName, const UString& name);
+
+void PrintErrorFlags(CStdOutStream &so, const char *s, UInt32 errorFlags);
+
+static void ErrorInfo_Print(CStdOutStream &so, const CArcErrorInfo &er)
+{
+ PrintErrorFlags(so, "ERRORS:", er.GetErrorFlags());
+ if (!er.ErrorMessage.IsEmpty())
+ PrintPropPair(so, "ERROR", er.ErrorMessage, true);
+
+ PrintErrorFlags(so, "WARNINGS:", er.GetWarningFlags());
+ if (!er.WarningMessage.IsEmpty())
+ PrintPropPair(so, "WARNING", er.WarningMessage, true);
+}
+
+HRESULT Print_OpenArchive_Props(CStdOutStream &so, const CCodecs *codecs, const CArchiveLink &arcLink)
+{
+ FOR_VECTOR (r, arcLink.Arcs)
+ {
+ const CArc &arc = arcLink.Arcs[r];
+ const CArcErrorInfo &er = arc.ErrorInfo;
+
+ so << "--\n";
+ PrintPropPair(so, "Path", arc.Path, false);
+ if (er.ErrorFormatIndex >= 0)
+ {
+ if (er.ErrorFormatIndex == arc.FormatIndex)
+ so << "Warning: The archive is open with offset" << endl;
+ else
+ PrintArcTypeError(so, codecs->GetFormatNamePtr(er.ErrorFormatIndex), true);
+ }
+ PrintPropPair(so, "Type", codecs->GetFormatNamePtr(arc.FormatIndex), false);
+
+ ErrorInfo_Print(so, er);
+
+ Int64 offset = arc.GetGlobalOffset();
+ if (offset != 0)
+ PrintPropNameAndNumber_Signed(so, kpidOffset, offset);
+ IInArchive *archive = arc.Archive;
+ RINOK(PrintArcProp(so, archive, kpidPhySize, NULL));
+ if (er.TailSize != 0)
+ PrintPropNameAndNumber(so, kpidTailSize, er.TailSize);
+ {
+ UInt32 numProps;
+ RINOK(archive->GetNumberOfArchiveProperties(&numProps));
+
+ for (UInt32 j = 0; j < numProps; j++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE vt;
+ RINOK(archive->GetArchivePropertyInfo(j, &name, &propID, &vt));
+ RINOK(PrintArcProp(so, archive, propID, name));
+ }
+ }
+
+ if (r != arcLink.Arcs.Size() - 1)
+ {
+ UInt32 numProps;
+ so << "----\n";
+ if (archive->GetNumberOfProperties(&numProps) == S_OK)
+ {
+ UInt32 mainIndex = arcLink.Arcs[r + 1].SubfileIndex;
+ for (UInt32 j = 0; j < numProps; j++)
+ {
+ CMyComBSTR name;
+ PROPID propID;
+ VARTYPE vt;
+ RINOK(archive->GetPropertyInfo(j, &name, &propID, &vt));
+ CPropVariant prop;
+ RINOK(archive->GetProperty(mainIndex, propID, &prop));
+ PrintPropertyPair2(so, propID, name, prop);
+ }
+ }
+ }
+ }
+ return S_OK;
+}
+
+HRESULT Print_OpenArchive_Error(CStdOutStream &so, const CCodecs *codecs, const CArchiveLink &arcLink)
+{
+ #ifndef _NO_CRYPTO
+ if (arcLink.PasswordWasAsked)
+ so << "Can not open encrypted archive. Wrong password?";
+ else
+ #endif
+ {
+ if (arcLink.NonOpen_ErrorInfo.ErrorFormatIndex >= 0)
+ {
+ so.NormalizePrint_UString(arcLink.NonOpen_ArcPath);
+ so << endl;
+ PrintArcTypeError(so, codecs->Formats[arcLink.NonOpen_ErrorInfo.ErrorFormatIndex].Name, false);
+ }
+ else
+ so << "Can not open the file as archive";
+ }
+
+ so << endl;
+ so << endl;
+ ErrorInfo_Print(so, arcLink.NonOpen_ErrorInfo);
+
+ return S_OK;
+}
+
+bool CensorNode_CheckPath(const NWildcard::CCensorNode &node, const CReadArcItem &item);
+
+HRESULT ListArchives(CCodecs *codecs,
+ const CObjectVector<COpenType> &types,
+ const CIntVector &excludedFormats,
+ bool stdInMode,
+ UStringVector &arcPaths, UStringVector &arcPathsFull,
+ bool processAltStreams, bool showAltStreams,
+ const NWildcard::CCensorNode &wildcardCensor,
+ bool enableHeaders, bool techMode,
+ #ifndef _NO_CRYPTO
+ bool &passwordEnabled, UString &password,
+ #endif
+ #ifndef _SFX
+ const CObjectVector<CProperty> *props,
+ #endif
+ UInt64 &numErrors,
+ UInt64 &numWarnings)
+{
+ bool allFilesAreAllowed = wildcardCensor.AreAllAllowed();
+
+ numErrors = 0;
+ numWarnings = 0;
+
+ CFieldPrinter fp;
+ if (!techMode)
+ fp.Init(kStandardFieldTable, ARRAY_SIZE(kStandardFieldTable));
+
+ CListStat2 stat2total;
+
+ CBoolArr skipArcs(arcPaths.Size());
+ unsigned arcIndex;
+ for (arcIndex = 0; arcIndex < arcPaths.Size(); arcIndex++)
+ skipArcs[arcIndex] = false;
+ UInt64 numVolumes = 0;
+ UInt64 numArcs = 0;
+ UInt64 totalArcSizes = 0;
+
+ HRESULT lastError = 0;
+
+ for (arcIndex = 0; arcIndex < arcPaths.Size(); arcIndex++)
+ {
+ if (skipArcs[arcIndex])
+ continue;
+ const UString &arcPath = arcPaths[arcIndex];
+ UInt64 arcPackSize = 0;
+
+ if (!stdInMode)
+ {
+ NFile::NFind::CFileInfo fi;
+ if (!fi.Find(us2fs(arcPath)))
+ {
+ DWORD errorCode = GetLastError();
+ if (errorCode == 0)
+ errorCode = ERROR_FILE_NOT_FOUND;
+ lastError = HRESULT_FROM_WIN32(lastError);;
+ g_StdOut.Flush();
+ *g_ErrStream << endl << kError << NError::MyFormatMessage(errorCode) << endl;
+ g_ErrStream->NormalizePrint_UString(arcPath);
+ *g_ErrStream << endl << endl;
+ numErrors++;
+ continue;
+ }
+ if (fi.IsDir())
+ {
+ g_StdOut.Flush();
+ *g_ErrStream << endl << kError;
+ g_ErrStream->NormalizePrint_UString(arcPath);
+ *g_ErrStream << " is not a file" << endl << endl;
+ numErrors++;
+ continue;
+ }
+ arcPackSize = fi.Size;
+ totalArcSizes += arcPackSize;
+ }
+
+ CArchiveLink arcLink;
+
+ COpenCallbackConsole openCallback;
+ openCallback.Init(&g_StdOut, g_ErrStream, NULL);
+
+ #ifndef _NO_CRYPTO
+
+ openCallback.PasswordIsDefined = passwordEnabled;
+ openCallback.Password = password;
+
+ #endif
+
+ /*
+ CObjectVector<COptionalOpenProperties> optPropsVector;
+ COptionalOpenProperties &optProps = optPropsVector.AddNew();
+ optProps.Props = *props;
+ */
+
+ COpenOptions options;
+ #ifndef _SFX
+ options.props = props;
+ #endif
+ options.codecs = codecs;
+ options.types = &types;
+ options.excludedFormats = &excludedFormats;
+ options.stdInMode = stdInMode;
+ options.stream = NULL;
+ options.filePath = arcPath;
+
+ if (enableHeaders)
+ {
+ g_StdOut << endl << kListing;
+ g_StdOut.NormalizePrint_UString(arcPath);
+ g_StdOut << endl << endl;
+ }
+
+ HRESULT result = arcLink.Open_Strict(options, &openCallback);
+
+ if (result != S_OK)
+ {
+ if (result == E_ABORT)
+ return result;
+ g_StdOut.Flush();
+ *g_ErrStream << endl << kError;
+ g_ErrStream->NormalizePrint_UString(arcPath);
+ *g_ErrStream << " : ";
+ if (result == S_FALSE)
+ {
+ Print_OpenArchive_Error(*g_ErrStream, codecs, arcLink);
+ }
+ else
+ {
+ lastError = result;
+ *g_ErrStream << "opening : ";
+ if (result == E_OUTOFMEMORY)
+ *g_ErrStream << "Can't allocate required memory";
+ else
+ *g_ErrStream << NError::MyFormatMessage(result);
+ }
+ *g_ErrStream << endl;
+ numErrors++;
+ continue;
+ }
+
+ {
+ FOR_VECTOR (r, arcLink.Arcs)
+ {
+ const CArcErrorInfo &arc = arcLink.Arcs[r].ErrorInfo;
+ if (!arc.WarningMessage.IsEmpty())
+ numWarnings++;
+ if (arc.AreThereWarnings())
+ numWarnings++;
+ if (arc.ErrorFormatIndex >= 0)
+ numWarnings++;
+ if (arc.AreThereErrors())
+ {
+ numErrors++;
+ // break;
+ }
+ if (!arc.ErrorMessage.IsEmpty())
+ numErrors++;
+ }
+ }
+
+ numArcs++;
+ numVolumes++;
+
+ if (!stdInMode)
+ {
+ numVolumes += arcLink.VolumePaths.Size();
+ totalArcSizes += arcLink.VolumesSize;
+ FOR_VECTOR (v, arcLink.VolumePaths)
+ {
+ int index = Find_FileName_InSortedVector(arcPathsFull, arcLink.VolumePaths[v]);
+ if (index >= 0 && (unsigned)index > arcIndex)
+ skipArcs[(unsigned)index] = true;
+ }
+ }
+
+
+ if (enableHeaders)
+ {
+ RINOK(Print_OpenArchive_Props(g_StdOut, codecs, arcLink));
+
+ g_StdOut << endl;
+ if (techMode)
+ g_StdOut << "----------\n";
+ }
+
+ if (enableHeaders && !techMode)
+ {
+ fp.PrintTitle();
+ g_StdOut << endl;
+ fp.PrintTitleLines();
+ g_StdOut << endl;
+ }
+
+ const CArc &arc = arcLink.Arcs.Back();
+ fp.Arc = &arc;
+ fp.TechMode = techMode;
+ IInArchive *archive = arc.Archive;
+ if (techMode)
+ {
+ fp.Clear();
+ RINOK(fp.AddMainProps(archive));
+ if (arc.GetRawProps)
+ {
+ RINOK(fp.AddRawProps(arc.GetRawProps));
+ }
+ }
+
+ CListStat2 stat2;
+
+ UInt32 numItems;
+ RINOK(archive->GetNumberOfItems(&numItems));
+
+ CReadArcItem item;
+ UStringVector pathParts;
+
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ if (NConsoleClose::TestBreakSignal())
+ return E_ABORT;
+
+ HRESULT res = arc.GetItemPath2(i, fp.FilePath);
+
+ if (stdInMode && res == E_INVALIDARG)
+ break;
+ RINOK(res);
+
+ if (arc.Ask_Aux)
+ {
+ bool isAux;
+ RINOK(Archive_IsItem_Aux(archive, i, isAux));
+ if (isAux)
+ continue;
+ }
+
+ bool isAltStream = false;
+ if (arc.Ask_AltStream)
+ {
+ RINOK(Archive_IsItem_AltStream(archive, i, isAltStream));
+ if (isAltStream && !processAltStreams)
+ continue;
+ }
+
+ RINOK(Archive_IsItem_Dir(archive, i, fp.IsDir));
+
+ if (!allFilesAreAllowed)
+ {
+ if (isAltStream)
+ {
+ RINOK(arc.GetItem(i, item));
+ if (!CensorNode_CheckPath(wildcardCensor, item))
+ continue;
+ }
+ else
+ {
+ SplitPathToParts(fp.FilePath, pathParts);;
+ bool include;
+ if (!wildcardCensor.CheckPathVect(pathParts, !fp.IsDir, include))
+ continue;
+ if (!include)
+ continue;
+ }
+ }
+
+ CListStat st;
+
+ RINOK(GetUInt64Value(archive, i, kpidSize, st.Size));
+ RINOK(GetUInt64Value(archive, i, kpidPackSize, st.PackSize));
+ RINOK(GetItemMTime(archive, i, st.MTime));
+
+ if (fp.IsDir)
+ stat2.NumDirs++;
+ else
+ st.NumFiles = 1;
+ stat2.GetStat(isAltStream).Update(st);
+
+ if (isAltStream && !showAltStreams)
+ continue;
+ RINOK(fp.PrintItemInfo(i, st));
+ }
+
+ UInt64 numStreams = stat2.GetNumStreams();
+ if (!stdInMode
+ && !stat2.MainFiles.PackSize.Def
+ && !stat2.AltStreams.PackSize.Def)
+ {
+ if (arcLink.VolumePaths.Size() != 0)
+ arcPackSize += arcLink.VolumesSize;
+ stat2.MainFiles.PackSize.Add((numStreams == 0) ? 0 : arcPackSize);
+ }
+
+ stat2.MainFiles.SetSizeDefIfNoFiles();
+ stat2.AltStreams.SetSizeDefIfNoFiles();
+
+ if (enableHeaders && !techMode)
+ {
+ fp.PrintTitleLines();
+ g_StdOut << endl;
+ fp.PrintSum(stat2);
+ }
+
+ if (enableHeaders)
+ {
+ if (arcLink.NonOpen_ErrorInfo.ErrorFormatIndex >= 0)
+ {
+ g_StdOut << "----------\n";
+ PrintPropPair(g_StdOut, "Path", arcLink.NonOpen_ArcPath, false);
+ PrintArcTypeError(g_StdOut, codecs->Formats[arcLink.NonOpen_ErrorInfo.ErrorFormatIndex].Name, false);
+ }
+ }
+
+ stat2total.Update(stat2);
+
+ g_StdOut.Flush();
+ }
+
+ if (enableHeaders && !techMode && (arcPaths.Size() > 1 || numVolumes > 1))
+ {
+ g_StdOut << endl;
+ fp.PrintTitleLines();
+ g_StdOut << endl;
+ fp.PrintSum(stat2total);
+ g_StdOut << endl;
+ PrintPropNameAndNumber(g_StdOut, "Archives", numArcs);
+ PrintPropNameAndNumber(g_StdOut, "Volumes", numVolumes);
+ PrintPropNameAndNumber(g_StdOut, "Total archives size", totalArcSizes);
+ }
+
+ if (numErrors == 1 && lastError != 0)
+ return lastError;
+
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/List.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/List.h
new file mode 100644
index 0000000000..dabbc2a604
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/List.h
@@ -0,0 +1,27 @@
+// List.h
+
+#ifndef __LIST_H
+#define __LIST_H
+
+#include "../../../Common/Wildcard.h"
+
+#include "../Common/LoadCodecs.h"
+
+HRESULT ListArchives(CCodecs *codecs,
+ const CObjectVector<COpenType> &types,
+ const CIntVector &excludedFormats,
+ bool stdInMode,
+ UStringVector &archivePaths, UStringVector &archivePathsFull,
+ bool processAltStreams, bool showAltStreams,
+ const NWildcard::CCensorNode &wildcardCensor,
+ bool enableHeaders, bool techMode,
+ #ifndef _NO_CRYPTO
+ bool &passwordEnabled, UString &password,
+ #endif
+ #ifndef _SFX
+ const CObjectVector<CProperty> *props,
+ #endif
+ UInt64 &errors,
+ UInt64 &numWarnings);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/Main.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/Main.cpp
new file mode 100644
index 0000000000..8f2825cad1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/Main.cpp
@@ -0,0 +1,1151 @@
+// Main.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/MyWindows.h"
+
+#ifdef _WIN32
+#include <Psapi.h>
+#endif
+
+#include "../../../../C/CpuArch.h"
+
+#include "../../../Common/MyInitGuid.h"
+
+#include "../../../Common/CommandLineParser.h"
+#include "../../../Common/IntToString.h"
+#include "../../../Common/MyException.h"
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/StringToInt.h"
+#include "../../../Common/UTFConvert.h"
+
+#include "../../../Windows/ErrorMsg.h"
+
+#include "../../../Windows/TimeUtils.h"
+
+#include "../Common/ArchiveCommandLine.h"
+#include "../Common/ExitCode.h"
+#include "../Common/Extract.h"
+
+#ifdef EXTERNAL_CODECS
+#include "../Common/LoadCodecs.h"
+#endif
+
+#include "../../Common/RegisterCodec.h"
+
+#include "BenchCon.h"
+#include "ConsoleClose.h"
+#include "ExtractCallbackConsole.h"
+#include "List.h"
+#include "OpenCallbackConsole.h"
+#include "UpdateCallbackConsole.h"
+
+#include "HashCon.h"
+
+#ifdef PROG_VARIANT_R
+#include "../../../../C/7zVersion.h"
+#else
+#include "../../MyVersion.h"
+#endif
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NCommandLineParser;
+
+#ifdef _WIN32
+HINSTANCE g_hInstance = 0;
+#endif
+
+extern bool g_LargePagesMode;
+
+extern CStdOutStream *g_StdStream;
+extern CStdOutStream *g_ErrStream;
+
+extern unsigned g_NumCodecs;
+extern const CCodecInfo *g_Codecs[];
+
+extern unsigned g_NumHashers;
+extern const CHasherInfo *g_Hashers[];
+
+static const char * const kCopyrightString = "\n7-Zip"
+ #ifndef EXTERNAL_CODECS
+ #ifdef PROG_VARIANT_R
+ " (r)"
+ #else
+ " (a)"
+ #endif
+ #endif
+
+ " " MY_VERSION_CPU
+ " : " MY_COPYRIGHT_DATE "\n\n";
+
+static const char * const kHelpString =
+ "Usage: 7z"
+#ifndef EXTERNAL_CODECS
+#ifdef PROG_VARIANT_R
+ "r"
+#else
+ "a"
+#endif
+#endif
+ " <command> [<switches>...] <archive_name> [<file_names>...]\n"
+ "\n"
+ "<Commands>\n"
+ " a : Add files to archive\n"
+ " b : Benchmark\n"
+ " d : Delete files from archive\n"
+ " e : Extract files from archive (without using directory names)\n"
+ " h : Calculate hash values for files\n"
+ " i : Show information about supported formats\n"
+ " l : List contents of archive\n"
+ " rn : Rename files in archive\n"
+ " t : Test integrity of archive\n"
+ " u : Update files to archive\n"
+ " x : eXtract files with full paths\n"
+ "\n"
+ "<Switches>\n"
+ " -- : Stop switches parsing\n"
+ " @listfile : set path to listfile that contains file names\n"
+ " -ai[r[-|0]]{@listfile|!wildcard} : Include archives\n"
+ " -ax[r[-|0]]{@listfile|!wildcard} : eXclude archives\n"
+ " -ao{a|s|t|u} : set Overwrite mode\n"
+ " -an : disable archive_name field\n"
+ " -bb[0-3] : set output log level\n"
+ " -bd : disable progress indicator\n"
+ " -bs{o|e|p}{0|1|2} : set output stream for output/error/progress line\n"
+ " -bt : show execution time statistics\n"
+ " -i[r[-|0]]{@listfile|!wildcard} : Include filenames\n"
+ " -m{Parameters} : set compression Method\n"
+ " -mmt[N] : set number of CPU threads\n"
+ " -mx[N] : set compression level: -mx1 (fastest) ... -mx9 (ultra)\n"
+ " -o{Directory} : set Output directory\n"
+ #ifndef _NO_CRYPTO
+ " -p{Password} : set Password\n"
+ #endif
+ " -r[-|0] : Recurse subdirectories\n"
+ " -sa{a|e|s} : set Archive name mode\n"
+ " -scc{UTF-8|WIN|DOS} : set charset for for console input/output\n"
+ " -scs{UTF-8|UTF-16LE|UTF-16BE|WIN|DOS|{id}} : set charset for list files\n"
+ " -scrc[CRC32|CRC64|SHA1|SHA256|*] : set hash function for x, e, h commands\n"
+ " -sdel : delete files after compression\n"
+ " -seml[.] : send archive by email\n"
+ " -sfx[{name}] : Create SFX archive\n"
+ " -si[{name}] : read data from stdin\n"
+ " -slp : set Large Pages mode\n"
+ " -slt : show technical information for l (List) command\n"
+ " -snh : store hard links as links\n"
+ " -snl : store symbolic links as links\n"
+ " -sni : store NT security information\n"
+ " -sns[-] : store NTFS alternate streams\n"
+ " -so : write data to stdout\n"
+ " -spd : disable wildcard matching for file names\n"
+ " -spe : eliminate duplication of root folder for extract command\n"
+ " -spf : use fully qualified file paths\n"
+ " -ssc[-] : set sensitive case mode\n"
+ " -sse : stop archive creating, if it can't open some input file\n"
+ " -ssw : compress shared files\n"
+ " -stl : set archive timestamp from the most recently modified file\n"
+ " -stm{HexMask} : set CPU thread affinity mask (hexadecimal number)\n"
+ " -stx{Type} : exclude archive type\n"
+ " -t{Type} : Set type of archive\n"
+ " -u[-][p#][q#][r#][x#][y#][z#][!newArchiveName] : Update options\n"
+ " -v{Size}[b|k|m|g] : Create volumes\n"
+ " -w[{path}] : assign Work directory. Empty path means a temporary directory\n"
+ " -x[r[-|0]]{@listfile|!wildcard} : eXclude filenames\n"
+ " -y : assume Yes on all queries\n";
+
+// ---------------------------
+// exception messages
+
+static const char * const kEverythingIsOk = "Everything is Ok";
+static const char * const kUserErrorMessage = "Incorrect command line";
+static const char * const kNoFormats = "7-Zip cannot find the code that works with archives.";
+static const char * const kUnsupportedArcTypeMessage = "Unsupported archive type";
+// static const char * const kUnsupportedUpdateArcType = "Can't create archive for that type";
+
+#define kDefaultSfxModule "7zCon.sfx"
+
+static void ShowMessageAndThrowException(LPCSTR message, NExitCode::EEnum code)
+{
+ if (g_ErrStream)
+ *g_ErrStream << endl << "ERROR: " << message << endl;
+ throw code;
+}
+
+#ifndef _WIN32
+static void GetArguments(int numArgs, const char *args[], UStringVector &parts)
+{
+ parts.Clear();
+ for (int i = 0; i < numArgs; i++)
+ {
+ UString s = MultiByteToUnicodeString(args[i]);
+ parts.Add(s);
+ }
+}
+#endif
+
+static void ShowCopyrightAndHelp(CStdOutStream *so, bool needHelp)
+{
+ if (!so)
+ return;
+ *so << kCopyrightString;
+ // *so << "# CPUs: " << (UInt64)NWindows::NSystem::GetNumberOfProcessors() << endl;
+ if (needHelp)
+ *so << kHelpString;
+}
+
+
+static void PrintStringRight(CStdOutStream &so, const char *s, unsigned size)
+{
+ unsigned len = MyStringLen(s);
+ for (unsigned i = len; i < size; i++)
+ so << ' ';
+ so << s;
+}
+
+static void PrintUInt32(CStdOutStream &so, UInt32 val, unsigned size)
+{
+ char s[16];
+ ConvertUInt32ToString(val, s);
+ PrintStringRight(so, s, size);
+}
+
+static void PrintLibIndex(CStdOutStream &so, int libIndex)
+{
+ if (libIndex >= 0)
+ PrintUInt32(so, libIndex, 2);
+ else
+ so << " ";
+ so << ' ';
+}
+
+static void PrintString(CStdOutStream &so, const UString &s, unsigned size)
+{
+ unsigned len = s.Len();
+ so << s;
+ for (unsigned i = len; i < size; i++)
+ so << ' ';
+}
+
+static inline char GetHex(unsigned val)
+{
+ return (char)((val < 10) ? ('0' + val) : ('A' + (val - 10)));
+}
+
+static void PrintWarningsPaths(const CErrorPathCodes &pc, CStdOutStream &so)
+{
+ FOR_VECTOR(i, pc.Paths)
+ {
+ so.NormalizePrint_UString(pc.Paths[i]);
+ so << " : ";
+ so << NError::MyFormatMessage(pc.Codes[i]) << endl;
+ }
+ so << "----------------" << endl;
+}
+
+static int WarningsCheck(HRESULT result, const CCallbackConsoleBase &callback,
+ const CUpdateErrorInfo &errorInfo,
+ CStdOutStream *so,
+ CStdOutStream *se,
+ bool showHeaders)
+{
+ int exitCode = NExitCode::kSuccess;
+
+ if (callback.ScanErrors.Paths.Size() != 0)
+ {
+ if (se)
+ {
+ *se << endl;
+ *se << "Scan WARNINGS for files and folders:" << endl << endl;
+ PrintWarningsPaths(callback.ScanErrors, *se);
+ *se << "Scan WARNINGS: " << callback.ScanErrors.Paths.Size();
+ *se << endl;
+ }
+ exitCode = NExitCode::kWarning;
+ }
+
+ if (result != S_OK || errorInfo.ThereIsError())
+ {
+ if (se)
+ {
+ UString message;
+ if (!errorInfo.Message.IsEmpty())
+ {
+ message += errorInfo.Message.Ptr();
+ message.Add_LF();
+ }
+ {
+ FOR_VECTOR(i, errorInfo.FileNames)
+ {
+ message += fs2us(errorInfo.FileNames[i]);
+ message.Add_LF();
+ }
+ }
+ if (errorInfo.SystemError != 0)
+ {
+ message += NError::MyFormatMessage(errorInfo.SystemError);
+ message.Add_LF();
+ }
+ if (!message.IsEmpty())
+ *se << L"\nError:\n" << message;
+ }
+
+ // we will work with (result) later
+ // throw CSystemException(result);
+ return NExitCode::kFatalError;
+ }
+
+ unsigned numErrors = callback.FailedFiles.Paths.Size();
+ if (numErrors == 0)
+ {
+ if (showHeaders)
+ if (callback.ScanErrors.Paths.Size() == 0)
+ if (so)
+ {
+ if (se)
+ se->Flush();
+ *so << kEverythingIsOk << endl;
+ }
+ }
+ else
+ {
+ if (se)
+ {
+ *se << endl;
+ *se << "WARNINGS for files:" << endl << endl;
+ PrintWarningsPaths(callback.FailedFiles, *se);
+ *se << "WARNING: Cannot open " << numErrors << " file";
+ if (numErrors > 1)
+ *se << 's';
+ *se << endl;
+ }
+ exitCode = NExitCode::kWarning;
+ }
+
+ return exitCode;
+}
+
+static void ThrowException_if_Error(HRESULT res)
+{
+ if (res != S_OK)
+ throw CSystemException(res);
+}
+
+
+static void PrintNum(UInt64 val, unsigned numDigits, char c = ' ')
+{
+ char temp[64];
+ char *p = temp + 32;
+ ConvertUInt64ToString(val, p);
+ unsigned len = MyStringLen(p);
+ for (; len < numDigits; len++)
+ *--p = c;
+ *g_StdStream << p;
+}
+
+static void PrintTime(const char *s, UInt64 val, UInt64 total)
+{
+ *g_StdStream << endl << s << " Time =";
+ const UInt32 kFreq = 10000000;
+ UInt64 sec = val / kFreq;
+ PrintNum(sec, 6);
+ *g_StdStream << '.';
+ UInt32 ms = (UInt32)(val - (sec * kFreq)) / (kFreq / 1000);
+ PrintNum(ms, 3, '0');
+
+ while (val > ((UInt64)1 << 56))
+ {
+ val >>= 1;
+ total >>= 1;
+ }
+
+ UInt64 percent = 0;
+ if (total != 0)
+ percent = val * 100 / total;
+ *g_StdStream << " =";
+ PrintNum(percent, 5);
+ *g_StdStream << '%';
+}
+
+#ifndef UNDER_CE
+
+#define SHIFT_SIZE_VALUE(x, num) (((x) + (1 << (num)) - 1) >> (num))
+
+static void PrintMemUsage(const char *s, UInt64 val)
+{
+ *g_StdStream << " " << s << " Memory =";
+ PrintNum(SHIFT_SIZE_VALUE(val, 20), 7);
+ *g_StdStream << " MB";
+ if (g_LargePagesMode)
+ *g_StdStream << " (LP)";
+}
+
+EXTERN_C_BEGIN
+typedef BOOL (WINAPI *Func_GetProcessMemoryInfo)(HANDLE Process,
+ PPROCESS_MEMORY_COUNTERS ppsmemCounters, DWORD cb);
+typedef BOOL (WINAPI *Func_QueryProcessCycleTime)(HANDLE Process, PULONG64 CycleTime);
+EXTERN_C_END
+
+#endif
+
+static inline UInt64 GetTime64(const FILETIME &t) { return ((UInt64)t.dwHighDateTime << 32) | t.dwLowDateTime; }
+
+static void PrintStat()
+{
+ FILETIME creationTimeFT, exitTimeFT, kernelTimeFT, userTimeFT;
+ if (!
+ #ifdef UNDER_CE
+ ::GetThreadTimes(::GetCurrentThread()
+ #else
+ // NT 3.5
+ ::GetProcessTimes(::GetCurrentProcess()
+ #endif
+ , &creationTimeFT, &exitTimeFT, &kernelTimeFT, &userTimeFT))
+ return;
+ FILETIME curTimeFT;
+ NTime::GetCurUtcFileTime(curTimeFT);
+
+ #ifndef UNDER_CE
+
+ PROCESS_MEMORY_COUNTERS m;
+ memset(&m, 0, sizeof(m));
+ BOOL memDefined = FALSE;
+ BOOL cycleDefined = FALSE;
+ ULONG64 cycleTime = 0;
+ {
+ /* NT 4.0: GetProcessMemoryInfo() in Psapi.dll
+ Win7: new function K32GetProcessMemoryInfo() in kernel32.dll
+ It's faster to call kernel32.dll code than Psapi.dll code
+ GetProcessMemoryInfo() requires Psapi.lib
+ Psapi.lib in SDK7+ can link to K32GetProcessMemoryInfo in kernel32.dll
+ The program with K32GetProcessMemoryInfo will not work on systems before Win7
+ // memDefined = GetProcessMemoryInfo(GetCurrentProcess(), &m, sizeof(m));
+ */
+
+ HMODULE kern = ::GetModuleHandleW(L"kernel32.dll");
+ Func_GetProcessMemoryInfo my_GetProcessMemoryInfo = (Func_GetProcessMemoryInfo)
+ ::GetProcAddress(kern, "K32GetProcessMemoryInfo");
+ if (!my_GetProcessMemoryInfo)
+ {
+ HMODULE lib = LoadLibraryW(L"Psapi.dll");
+ if (lib)
+ my_GetProcessMemoryInfo = (Func_GetProcessMemoryInfo)::GetProcAddress(lib, "GetProcessMemoryInfo");
+ }
+ if (my_GetProcessMemoryInfo)
+ memDefined = my_GetProcessMemoryInfo(GetCurrentProcess(), &m, sizeof(m));
+ // FreeLibrary(lib);
+
+ Func_QueryProcessCycleTime my_QueryProcessCycleTime = (Func_QueryProcessCycleTime)
+ ::GetProcAddress(kern, "QueryProcessCycleTime");
+ if (my_QueryProcessCycleTime)
+ cycleDefined = my_QueryProcessCycleTime(GetCurrentProcess(), &cycleTime);
+ }
+
+ #endif
+
+ UInt64 curTime = GetTime64(curTimeFT);
+ UInt64 creationTime = GetTime64(creationTimeFT);
+ UInt64 kernelTime = GetTime64(kernelTimeFT);
+ UInt64 userTime = GetTime64(userTimeFT);
+
+ UInt64 totalTime = curTime - creationTime;
+
+ PrintTime("Kernel ", kernelTime, totalTime);
+
+ #ifndef UNDER_CE
+ if (cycleDefined)
+ {
+ *g_StdStream << " ";
+ PrintNum(cycleTime / 1000000, 22);
+ *g_StdStream << " MCycles";
+ }
+ #endif
+
+ PrintTime("User ", userTime, totalTime);
+
+ PrintTime("Process", kernelTime + userTime, totalTime);
+ #ifndef UNDER_CE
+ if (memDefined) PrintMemUsage("Virtual ", m.PeakPagefileUsage);
+ #endif
+
+ PrintTime("Global ", totalTime, totalTime);
+ #ifndef UNDER_CE
+ if (memDefined) PrintMemUsage("Physical", m.PeakWorkingSetSize);
+ #endif
+
+ *g_StdStream << endl;
+}
+
+static void PrintHexId(CStdOutStream &so, UInt64 id)
+{
+ char s[32];
+ ConvertUInt64ToHex(id, s);
+ PrintStringRight(so, s, 8);
+}
+
+
+int Main2(
+ #ifndef _WIN32
+ int numArgs, char *args[]
+ #endif
+)
+{
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ SetFileApisToOEM();
+ #endif
+
+ UStringVector commandStrings;
+
+ #ifdef _WIN32
+ NCommandLineParser::SplitCommandLine(GetCommandLineW(), commandStrings);
+ #else
+ GetArguments(numArgs, args, commandStrings);
+ #endif
+
+ #ifndef UNDER_CE
+ if (commandStrings.Size() > 0)
+ commandStrings.Delete(0);
+ #endif
+
+ if (commandStrings.Size() == 0)
+ {
+ ShowCopyrightAndHelp(g_StdStream, true);
+ return 0;
+ }
+
+ CArcCmdLineOptions options;
+
+ CArcCmdLineParser parser;
+
+ parser.Parse1(commandStrings, options);
+
+ g_StdOut.IsTerminalMode = options.IsStdOutTerminal;
+ g_StdErr.IsTerminalMode = options.IsStdErrTerminal;
+
+ if (options.Number_for_Out != k_OutStream_stdout)
+ g_StdStream = (options.Number_for_Out == k_OutStream_stderr ? &g_StdErr : NULL);
+
+ if (options.Number_for_Errors != k_OutStream_stderr)
+ g_ErrStream = (options.Number_for_Errors == k_OutStream_stdout ? &g_StdOut : NULL);
+
+ CStdOutStream *percentsStream = NULL;
+ if (options.Number_for_Percents != k_OutStream_disabled)
+ percentsStream = (options.Number_for_Percents == k_OutStream_stderr) ? &g_StdErr : &g_StdOut;;
+
+ if (options.HelpMode)
+ {
+ ShowCopyrightAndHelp(g_StdStream, true);
+ return 0;
+ }
+
+ if (options.EnableHeaders)
+ ShowCopyrightAndHelp(g_StdStream, false);
+
+ parser.Parse2(options);
+
+ unsigned percentsNameLevel = 1;
+ if (options.LogLevel == 0 || options.Number_for_Percents != options.Number_for_Out)
+ percentsNameLevel = 2;
+
+ unsigned consoleWidth = 80;
+
+ if (percentsStream)
+ {
+ #ifdef _WIN32
+
+ #if !defined(UNDER_CE)
+ CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
+ if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &consoleInfo))
+ consoleWidth = consoleInfo.dwSize.X;
+ #endif
+
+ #else
+
+ struct winsize w;
+ if (ioctl(0, TIOCGWINSZ, &w) == )
+ consoleWidth = w.ws_col;
+
+ #endif
+ }
+
+ CREATE_CODECS_OBJECT
+
+ codecs->CaseSensitiveChange = options.CaseSensitiveChange;
+ codecs->CaseSensitive = options.CaseSensitive;
+ ThrowException_if_Error(codecs->Load());
+
+ bool isExtractGroupCommand = options.Command.IsFromExtractGroup();
+
+ if (codecs->Formats.Size() == 0 &&
+ (isExtractGroupCommand
+ || options.Command.CommandType == NCommandType::kList
+ || options.Command.IsFromUpdateGroup()))
+ {
+ #ifdef EXTERNAL_CODECS
+ if (!codecs->MainDll_ErrorPath.IsEmpty())
+ {
+ UString s ("Can't load module: ");
+ s += fs2us(codecs->MainDll_ErrorPath);
+ throw s;
+ }
+ #endif
+
+ throw kNoFormats;
+ }
+
+ CObjectVector<COpenType> types;
+ if (!ParseOpenTypes(*codecs, options.ArcType, types))
+ throw kUnsupportedArcTypeMessage;
+
+ CIntVector excludedFormats;
+ FOR_VECTOR (k, options.ExcludedArcTypes)
+ {
+ CIntVector tempIndices;
+ if (!codecs->FindFormatForArchiveType(options.ExcludedArcTypes[k], tempIndices)
+ || tempIndices.Size() != 1)
+ throw kUnsupportedArcTypeMessage;
+ excludedFormats.AddToUniqueSorted(tempIndices[0]);
+ // excludedFormats.Sort();
+ }
+
+
+ #ifdef EXTERNAL_CODECS
+ if (isExtractGroupCommand
+ || options.Command.CommandType == NCommandType::kHash
+ || options.Command.CommandType == NCommandType::kBenchmark)
+ ThrowException_if_Error(__externalCodecs.Load());
+ #endif
+
+ int retCode = NExitCode::kSuccess;
+ HRESULT hresultMain = S_OK;
+
+ // bool showStat = options.ShowTime;
+
+ /*
+ if (!options.EnableHeaders ||
+ options.TechMode)
+ showStat = false;
+ */
+
+
+ if (options.Command.CommandType == NCommandType::kInfo)
+ {
+ CStdOutStream &so = (g_StdStream ? *g_StdStream : g_StdOut);
+ unsigned i;
+
+ #ifdef EXTERNAL_CODECS
+ so << endl << "Libs:" << endl;
+ for (i = 0; i < codecs->Libs.Size(); i++)
+ {
+ PrintLibIndex(so, i);
+ so << ' ' << codecs->Libs[i].Path << endl;
+ }
+ #endif
+
+ so << endl << "Formats:" << endl;
+
+ const char * const kArcFlags = "KSNFMGOPBELH";
+ const unsigned kNumArcFlags = (unsigned)strlen(kArcFlags);
+
+ for (i = 0; i < codecs->Formats.Size(); i++)
+ {
+ const CArcInfoEx &arc = codecs->Formats[i];
+
+ #ifdef EXTERNAL_CODECS
+ PrintLibIndex(so, arc.LibIndex);
+ #else
+ so << " ";
+ #endif
+
+ so << (char)(arc.UpdateEnabled ? 'C' : ' ');
+
+ for (unsigned b = 0; b < kNumArcFlags; b++)
+ {
+ so << (char)
+ ((arc.Flags & ((UInt32)1 << b)) != 0 ? kArcFlags[b] : ' ');
+ }
+
+ so << ' ';
+ PrintString(so, arc.Name, 8);
+ so << ' ';
+ UString s;
+
+ FOR_VECTOR (t, arc.Exts)
+ {
+ if (t != 0)
+ s.Add_Space();
+ const CArcExtInfo &ext = arc.Exts[t];
+ s += ext.Ext;
+ if (!ext.AddExt.IsEmpty())
+ {
+ s += " (";
+ s += ext.AddExt;
+ s += ')';
+ }
+ }
+
+ PrintString(so, s, 13);
+ so << ' ';
+
+ if (arc.SignatureOffset != 0)
+ so << "offset=" << arc.SignatureOffset << ' ';
+
+ FOR_VECTOR(si, arc.Signatures)
+ {
+ if (si != 0)
+ so << " || ";
+
+ const CByteBuffer &sig = arc.Signatures[si];
+
+ for (size_t j = 0; j < sig.Size(); j++)
+ {
+ if (j != 0)
+ so << ' ';
+ Byte b = sig[j];
+ if (b > 0x20 && b < 0x80)
+ {
+ so << (char)b;
+ }
+ else
+ {
+ so << GetHex((b >> 4) & 0xF);
+ so << GetHex(b & 0xF);
+ }
+ }
+ }
+ so << endl;
+ }
+
+ so << endl << "Codecs:" << endl; // << "Lib ID Name" << endl;
+
+ for (i = 0; i < g_NumCodecs; i++)
+ {
+ const CCodecInfo &cod = *g_Codecs[i];
+
+ PrintLibIndex(so, -1);
+
+ if (cod.NumStreams == 1)
+ so << ' ';
+ else
+ so << cod.NumStreams;
+
+ so << (char)(cod.CreateEncoder ? 'E' : ' ');
+ so << (char)(cod.CreateDecoder ? 'D' : ' ');
+
+ so << ' ';
+ PrintHexId(so, cod.Id);
+ so << ' ' << cod.Name << endl;
+ }
+
+
+ #ifdef EXTERNAL_CODECS
+
+ UInt32 numMethods;
+ if (codecs->GetNumMethods(&numMethods) == S_OK)
+ for (UInt32 j = 0; j < numMethods; j++)
+ {
+ PrintLibIndex(so, codecs->GetCodec_LibIndex(j));
+
+ UInt32 numStreams = codecs->GetCodec_NumStreams(j);
+ if (numStreams == 1)
+ so << ' ';
+ else
+ so << numStreams;
+
+ so << (char)(codecs->GetCodec_EncoderIsAssigned(j) ? 'E' : ' ');
+ so << (char)(codecs->GetCodec_DecoderIsAssigned(j) ? 'D' : ' ');
+
+ so << ' ';
+ UInt64 id;
+ HRESULT res = codecs->GetCodec_Id(j, id);
+ if (res != S_OK)
+ id = (UInt64)(Int64)-1;
+ PrintHexId(so, id);
+ so << ' ' << codecs->GetCodec_Name(j) << endl;
+ }
+
+ #endif
+
+
+ so << endl << "Hashers:" << endl; // << " L Size ID Name" << endl;
+
+ for (i = 0; i < g_NumHashers; i++)
+ {
+ const CHasherInfo &codec = *g_Hashers[i];
+ PrintLibIndex(so, -1);
+ PrintUInt32(so, codec.DigestSize, 4);
+ so << ' ';
+ PrintHexId(so, codec.Id);
+ so << ' ' << codec.Name << endl;
+ }
+
+ #ifdef EXTERNAL_CODECS
+
+ numMethods = codecs->GetNumHashers();
+ for (UInt32 j = 0; j < numMethods; j++)
+ {
+ PrintLibIndex(so, codecs->GetHasherLibIndex(j));
+ PrintUInt32(so, codecs->GetHasherDigestSize(j), 4);
+ so << ' ';
+ PrintHexId(so, codecs->GetHasherId(j));
+ so << ' ' << codecs->GetHasherName(j) << endl;
+ }
+
+ #endif
+
+ }
+ else if (options.Command.CommandType == NCommandType::kBenchmark)
+ {
+ CStdOutStream &so = (g_StdStream ? *g_StdStream : g_StdOut);
+ hresultMain = BenchCon(EXTERNAL_CODECS_VARS_L
+ options.Properties, options.NumIterations, (FILE *)so);
+ if (hresultMain == S_FALSE)
+ {
+ if (g_ErrStream)
+ *g_ErrStream << "\nDecoding ERROR\n";
+ retCode = NExitCode::kFatalError;
+ hresultMain = S_OK;
+ }
+ }
+ else if (isExtractGroupCommand || options.Command.CommandType == NCommandType::kList)
+ {
+ UStringVector ArchivePathsSorted;
+ UStringVector ArchivePathsFullSorted;
+
+ if (options.StdInMode)
+ {
+ ArchivePathsSorted.Add(options.ArcName_for_StdInMode);
+ ArchivePathsFullSorted.Add(options.ArcName_for_StdInMode);
+ }
+ else
+ {
+ CExtractScanConsole scan;
+
+ scan.Init(options.EnableHeaders ? g_StdStream : NULL, g_ErrStream, percentsStream);
+ scan.SetWindowWidth(consoleWidth);
+
+ if (g_StdStream && options.EnableHeaders)
+ *g_StdStream << "Scanning the drive for archives:" << endl;
+
+ CDirItemsStat st;
+
+ scan.StartScanning();
+
+ hresultMain = EnumerateDirItemsAndSort(
+ options.arcCensor,
+ NWildcard::k_RelatPath,
+ UString(), // addPathPrefix
+ ArchivePathsSorted,
+ ArchivePathsFullSorted,
+ st,
+ &scan);
+
+ scan.CloseScanning();
+
+ if (hresultMain == S_OK)
+ {
+ if (options.EnableHeaders)
+ scan.PrintStat(st);
+ }
+ else
+ {
+ /*
+ if (res != E_ABORT)
+ {
+ throw CSystemException(res);
+ // errorInfo.Message = "Scanning error";
+ }
+ return res;
+ */
+ }
+ }
+
+ if (hresultMain == S_OK)
+ if (isExtractGroupCommand)
+ {
+ CExtractCallbackConsole *ecs = new CExtractCallbackConsole;
+ CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
+
+ #ifndef _NO_CRYPTO
+ ecs->PasswordIsDefined = options.PasswordEnabled;
+ ecs->Password = options.Password;
+ #endif
+
+ ecs->Init(g_StdStream, g_ErrStream, percentsStream);
+ ecs->MultiArcMode = (ArchivePathsSorted.Size() > 1);
+
+ ecs->LogLevel = options.LogLevel;
+ ecs->PercentsNameLevel = percentsNameLevel;
+
+ if (percentsStream)
+ ecs->SetWindowWidth(consoleWidth);
+
+ /*
+ COpenCallbackConsole openCallback;
+ openCallback.Init(g_StdStream, g_ErrStream);
+
+ #ifndef _NO_CRYPTO
+ openCallback.PasswordIsDefined = options.PasswordEnabled;
+ openCallback.Password = options.Password;
+ #endif
+ */
+
+ CExtractOptions eo;
+ (CExtractOptionsBase &)eo = options.ExtractOptions;
+
+ eo.StdInMode = options.StdInMode;
+ eo.StdOutMode = options.StdOutMode;
+ eo.YesToAll = options.YesToAll;
+ eo.TestMode = options.Command.IsTestCommand();
+
+ #ifndef _SFX
+ eo.Properties = options.Properties;
+ #endif
+
+ UString errorMessage;
+ CDecompressStat stat;
+ CHashBundle hb;
+ IHashCalc *hashCalc = NULL;
+
+ if (!options.HashMethods.IsEmpty())
+ {
+ hashCalc = &hb;
+ ThrowException_if_Error(hb.SetMethods(EXTERNAL_CODECS_VARS_L options.HashMethods));
+ hb.Init();
+ }
+
+ hresultMain = Extract(
+ codecs,
+ types,
+ excludedFormats,
+ ArchivePathsSorted,
+ ArchivePathsFullSorted,
+ options.Censor.Pairs.Front().Head,
+ eo, ecs, ecs, hashCalc, errorMessage, stat);
+
+ ecs->ClosePercents();
+
+ if (!errorMessage.IsEmpty())
+ {
+ if (g_ErrStream)
+ *g_ErrStream << endl << "ERROR:" << endl << errorMessage << endl;
+ if (hresultMain == S_OK)
+ hresultMain = E_FAIL;
+ }
+
+ CStdOutStream *so = g_StdStream;
+
+ bool isError = false;
+
+ if (so)
+ {
+ *so << endl;
+
+ if (ecs->NumTryArcs > 1)
+ {
+ *so << "Archives: " << ecs->NumTryArcs << endl;
+ *so << "OK archives: " << ecs->NumOkArcs << endl;
+ }
+ }
+
+ if (ecs->NumCantOpenArcs != 0)
+ {
+ isError = true;
+ if (so)
+ *so << "Can't open as archive: " << ecs->NumCantOpenArcs << endl;
+ }
+
+ if (ecs->NumArcsWithError != 0)
+ {
+ isError = true;
+ if (so)
+ *so << "Archives with Errors: " << ecs->NumArcsWithError << endl;
+ }
+
+ if (so)
+ {
+ if (ecs->NumArcsWithWarnings != 0)
+ *so << "Archives with Warnings: " << ecs->NumArcsWithWarnings << endl;
+
+ if (ecs->NumOpenArcWarnings != 0)
+ {
+ *so << endl;
+ if (ecs->NumOpenArcWarnings != 0)
+ *so << "Warnings: " << ecs->NumOpenArcWarnings << endl;
+ }
+ }
+
+ if (ecs->NumOpenArcErrors != 0)
+ {
+ isError = true;
+ if (so)
+ {
+ *so << endl;
+ if (ecs->NumOpenArcErrors != 0)
+ *so << "Open Errors: " << ecs->NumOpenArcErrors << endl;
+ }
+ }
+
+ if (isError)
+ retCode = NExitCode::kFatalError;
+
+ if (so)
+ if (ecs->NumArcsWithError != 0 || ecs->NumFileErrors != 0)
+ {
+ // if (ecs->NumArchives > 1)
+ {
+ *so << endl;
+ if (ecs->NumFileErrors != 0)
+ *so << "Sub items Errors: " << ecs->NumFileErrors << endl;
+ }
+ }
+ else if (hresultMain == S_OK)
+ {
+ if (stat.NumFolders != 0)
+ *so << "Folders: " << stat.NumFolders << endl;
+ if (stat.NumFiles != 1 || stat.NumFolders != 0 || stat.NumAltStreams != 0)
+ *so << "Files: " << stat.NumFiles << endl;
+ if (stat.NumAltStreams != 0)
+ {
+ *so << "Alternate Streams: " << stat.NumAltStreams << endl;
+ *so << "Alternate Streams Size: " << stat.AltStreams_UnpackSize << endl;
+ }
+
+ *so
+ << "Size: " << stat.UnpackSize << endl
+ << "Compressed: " << stat.PackSize << endl;
+ if (hashCalc)
+ {
+ *so << endl;
+ PrintHashStat(*so, hb);
+ }
+ }
+ }
+ else
+ {
+ UInt64 numErrors = 0;
+ UInt64 numWarnings = 0;
+
+ // options.ExtractNtOptions.StoreAltStreams = true, if -sns[-] is not definmed
+
+ hresultMain = ListArchives(
+ codecs,
+ types,
+ excludedFormats,
+ options.StdInMode,
+ ArchivePathsSorted,
+ ArchivePathsFullSorted,
+ options.ExtractOptions.NtOptions.AltStreams.Val,
+ options.AltStreams.Val, // we don't want to show AltStreams by default
+ options.Censor.Pairs.Front().Head,
+ options.EnableHeaders,
+ options.TechMode,
+ #ifndef _NO_CRYPTO
+ options.PasswordEnabled,
+ options.Password,
+ #endif
+ &options.Properties,
+ numErrors, numWarnings);
+
+ if (options.EnableHeaders)
+ if (numWarnings > 0)
+ g_StdOut << endl << "Warnings: " << numWarnings << endl;
+
+ if (numErrors > 0)
+ {
+ if (options.EnableHeaders)
+ g_StdOut << endl << "Errors: " << numErrors << endl;
+ retCode = NExitCode::kFatalError;
+ }
+ }
+ }
+ else if (options.Command.IsFromUpdateGroup())
+ {
+ CUpdateOptions &uo = options.UpdateOptions;
+ if (uo.SfxMode && uo.SfxModule.IsEmpty())
+ uo.SfxModule = kDefaultSfxModule;
+
+ COpenCallbackConsole openCallback;
+ openCallback.Init(g_StdStream, g_ErrStream, percentsStream);
+
+ #ifndef _NO_CRYPTO
+ bool passwordIsDefined =
+ (options.PasswordEnabled && !options.Password.IsEmpty());
+ openCallback.PasswordIsDefined = passwordIsDefined;
+ openCallback.Password = options.Password;
+ #endif
+
+ CUpdateCallbackConsole callback;
+ callback.LogLevel = options.LogLevel;
+ callback.PercentsNameLevel = percentsNameLevel;
+
+ if (percentsStream)
+ callback.SetWindowWidth(consoleWidth);
+
+ #ifndef _NO_CRYPTO
+ callback.PasswordIsDefined = passwordIsDefined;
+ callback.AskPassword = (options.PasswordEnabled && options.Password.IsEmpty());
+ callback.Password = options.Password;
+ #endif
+
+ callback.StdOutMode = uo.StdOutMode;
+ callback.Init(
+ // NULL,
+ g_StdStream, g_ErrStream, percentsStream);
+
+ CUpdateErrorInfo errorInfo;
+
+ /*
+ if (!uo.Init(codecs, types, options.ArchiveName))
+ throw kUnsupportedUpdateArcType;
+ */
+ hresultMain = UpdateArchive(codecs,
+ types,
+ options.ArchiveName,
+ options.Censor,
+ uo,
+ errorInfo, &openCallback, &callback, true);
+
+ callback.ClosePercents2();
+
+ CStdOutStream *se = g_StdStream;
+ if (!se)
+ se = g_ErrStream;
+
+ retCode = WarningsCheck(hresultMain, callback, errorInfo,
+ g_StdStream, se,
+ true // options.EnableHeaders
+ );
+ }
+ else if (options.Command.CommandType == NCommandType::kHash)
+ {
+ const CHashOptions &uo = options.HashOptions;
+
+ CHashCallbackConsole callback;
+ if (percentsStream)
+ callback.SetWindowWidth(consoleWidth);
+
+ callback.Init(g_StdStream, g_ErrStream, percentsStream);
+ callback.PrintHeaders = options.EnableHeaders;
+
+ AString errorInfoString;
+ hresultMain = HashCalc(EXTERNAL_CODECS_VARS_L
+ options.Censor, uo,
+ errorInfoString, &callback);
+ CUpdateErrorInfo errorInfo;
+ errorInfo.Message = errorInfoString;
+ CStdOutStream *se = g_StdStream;
+ if (!se)
+ se = g_ErrStream;
+ retCode = WarningsCheck(hresultMain, callback, errorInfo, g_StdStream, se, options.EnableHeaders);
+ }
+ else
+ ShowMessageAndThrowException(kUserErrorMessage, NExitCode::kUserError);
+
+ if (options.ShowTime && g_StdStream)
+ PrintStat();
+
+ ThrowException_if_Error(hresultMain);
+
+ return retCode;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/MainAr.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/MainAr.cpp
new file mode 100644
index 0000000000..fdac64340d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/MainAr.cpp
@@ -0,0 +1,167 @@
+// MainAr.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/MyException.h"
+#include "../../../Common/StdOutStream.h"
+
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/NtCheck.h"
+
+#include "../Common/ArchiveCommandLine.h"
+#include "../Common/ExitCode.h"
+
+#include "ConsoleClose.h"
+
+using namespace NWindows;
+
+CStdOutStream *g_StdStream = NULL;
+CStdOutStream *g_ErrStream = NULL;
+
+extern int Main2(
+ #ifndef _WIN32
+ int numArgs, char *args[]
+ #endif
+);
+
+static const char * const kException_CmdLine_Error_Message = "Command Line Error:";
+static const char * const kExceptionErrorMessage = "ERROR:";
+static const char * const kUserBreakMessage = "Break signaled";
+static const char * const kMemoryExceptionMessage = "ERROR: Can't allocate required memory!";
+static const char * const kUnknownExceptionMessage = "Unknown Error";
+static const char * const kInternalExceptionMessage = "\n\nInternal Error #";
+
+static void FlushStreams()
+{
+ if (g_StdStream)
+ g_StdStream->Flush();
+}
+
+static void PrintError(const char *message)
+{
+ FlushStreams();
+ if (g_ErrStream)
+ *g_ErrStream << "\n\n" << message << endl;
+}
+
+#define NT_CHECK_FAIL_ACTION *g_StdStream << "Unsupported Windows version"; return NExitCode::kFatalError;
+
+int MY_CDECL main
+(
+ #ifndef _WIN32
+ int numArgs, char *args[]
+ #endif
+)
+{
+ g_ErrStream = &g_StdErr;
+ g_StdStream = &g_StdOut;
+
+ NT_CHECK
+
+ NConsoleClose::CCtrlHandlerSetter ctrlHandlerSetter;
+ int res = 0;
+
+ try
+ {
+ res = Main2(
+ #ifndef _WIN32
+ numArgs, args
+ #endif
+ );
+ }
+ catch(const CNewException &)
+ {
+ PrintError(kMemoryExceptionMessage);
+ return (NExitCode::kMemoryError);
+ }
+ catch(const NConsoleClose::CCtrlBreakException &)
+ {
+ PrintError(kUserBreakMessage);
+ return (NExitCode::kUserBreak);
+ }
+ catch(const CMessagePathException &e)
+ {
+ PrintError(kException_CmdLine_Error_Message);
+ if (g_ErrStream)
+ *g_ErrStream << e << endl;
+ return (NExitCode::kUserError);
+ }
+ catch(const CSystemException &systemError)
+ {
+ if (systemError.ErrorCode == E_OUTOFMEMORY)
+ {
+ PrintError(kMemoryExceptionMessage);
+ return (NExitCode::kMemoryError);
+ }
+ if (systemError.ErrorCode == E_ABORT)
+ {
+ PrintError(kUserBreakMessage);
+ return (NExitCode::kUserBreak);
+ }
+ if (g_ErrStream)
+ {
+ PrintError("System ERROR:");
+ *g_ErrStream << NError::MyFormatMessage(systemError.ErrorCode) << endl;
+ }
+ return (NExitCode::kFatalError);
+ }
+ catch(NExitCode::EEnum &exitCode)
+ {
+ FlushStreams();
+ if (g_ErrStream)
+ *g_ErrStream << kInternalExceptionMessage << exitCode << endl;
+ return (exitCode);
+ }
+ catch(const UString &s)
+ {
+ if (g_ErrStream)
+ {
+ PrintError(kExceptionErrorMessage);
+ *g_ErrStream << s << endl;
+ }
+ return (NExitCode::kFatalError);
+ }
+ catch(const AString &s)
+ {
+ if (g_ErrStream)
+ {
+ PrintError(kExceptionErrorMessage);
+ *g_ErrStream << s << endl;
+ }
+ return (NExitCode::kFatalError);
+ }
+ catch(const char *s)
+ {
+ if (g_ErrStream)
+ {
+ PrintError(kExceptionErrorMessage);
+ *g_ErrStream << s << endl;
+ }
+ return (NExitCode::kFatalError);
+ }
+ catch(const wchar_t *s)
+ {
+ if (g_ErrStream)
+ {
+ PrintError(kExceptionErrorMessage);
+ *g_ErrStream << s << endl;
+ }
+ return (NExitCode::kFatalError);
+ }
+ catch(int t)
+ {
+ if (g_ErrStream)
+ {
+ FlushStreams();
+ *g_ErrStream << kInternalExceptionMessage << t << endl;
+ return (NExitCode::kFatalError);
+ }
+ }
+ catch(...)
+ {
+ PrintError(kUnknownExceptionMessage);
+ return (NExitCode::kFatalError);
+ }
+
+ return res;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.cpp
new file mode 100644
index 0000000000..6e58c1f96c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.cpp
@@ -0,0 +1,115 @@
+// OpenCallbackConsole.cpp
+
+#include "StdAfx.h"
+
+#include "OpenCallbackConsole.h"
+
+#include "ConsoleClose.h"
+#include "UserInputUtils.h"
+
+static HRESULT CheckBreak2()
+{
+ return NConsoleClose::TestBreakSignal() ? E_ABORT : S_OK;
+}
+
+HRESULT COpenCallbackConsole::Open_CheckBreak()
+{
+ return CheckBreak2();
+}
+
+HRESULT COpenCallbackConsole::Open_SetTotal(const UInt64 *files, const UInt64 *bytes)
+{
+ if (!MultiArcMode && NeedPercents())
+ {
+ if (files)
+ {
+ _totalFilesDefined = true;
+ // _totalFiles = *files;
+ _percent.Total = *files;
+ }
+ else
+ _totalFilesDefined = false;
+
+ if (bytes)
+ {
+ // _totalBytesDefined = true;
+ _totalBytes = *bytes;
+ if (!files)
+ _percent.Total = *bytes;
+ }
+ else
+ {
+ // _totalBytesDefined = false;
+ if (!files)
+ _percent.Total = _totalBytes;
+ }
+ }
+
+ return CheckBreak2();
+}
+
+HRESULT COpenCallbackConsole::Open_SetCompleted(const UInt64 *files, const UInt64 *bytes)
+{
+ if (!MultiArcMode && NeedPercents())
+ {
+ if (files)
+ {
+ _percent.Files = *files;
+ if (_totalFilesDefined)
+ _percent.Completed = *files;
+ }
+
+ if (bytes)
+ {
+ if (!_totalFilesDefined)
+ _percent.Completed = *bytes;
+ }
+ _percent.Print();
+ }
+
+ return CheckBreak2();
+}
+
+HRESULT COpenCallbackConsole::Open_Finished()
+{
+ ClosePercents();
+ return S_OK;
+}
+
+
+#ifndef _NO_CRYPTO
+
+HRESULT COpenCallbackConsole::Open_CryptoGetTextPassword(BSTR *password)
+{
+ *password = NULL;
+ RINOK(CheckBreak2());
+
+ if (!PasswordIsDefined)
+ {
+ ClosePercents();
+ RINOK(GetPassword_HRESULT(_so, Password));
+ PasswordIsDefined = true;
+ }
+ return StringToBstr(Password, password);
+}
+
+/*
+HRESULT COpenCallbackConsole::Open_GetPasswordIfAny(bool &passwordIsDefined, UString &password)
+{
+ passwordIsDefined = PasswordIsDefined;
+ password = Password;
+ return S_OK;
+}
+
+bool COpenCallbackConsole::Open_WasPasswordAsked()
+{
+ return PasswordWasAsked;
+}
+
+void COpenCallbackConsole::Open_Clear_PasswordWasAsked_Flag ()
+{
+ PasswordWasAsked = false;
+}
+*/
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.h
new file mode 100644
index 0000000000..b9270f8e2c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/OpenCallbackConsole.h
@@ -0,0 +1,66 @@
+// OpenCallbackConsole.h
+
+#ifndef __OPEN_CALLBACK_CONSOLE_H
+#define __OPEN_CALLBACK_CONSOLE_H
+
+#include "../../../Common/StdOutStream.h"
+
+#include "../Common/ArchiveOpenCallback.h"
+
+#include "PercentPrinter.h"
+
+class COpenCallbackConsole: public IOpenCallbackUI
+{
+protected:
+ CPercentPrinter _percent;
+
+ CStdOutStream *_so;
+ CStdOutStream *_se;
+
+ bool _totalFilesDefined;
+ // bool _totalBytesDefined;
+ // UInt64 _totalFiles;
+ UInt64 _totalBytes;
+
+ bool NeedPercents() const { return _percent._so != NULL; }
+
+public:
+
+ bool MultiArcMode;
+
+ void ClosePercents()
+ {
+ if (NeedPercents())
+ _percent.ClosePrint(true);
+ }
+
+ COpenCallbackConsole():
+ _totalFilesDefined(false),
+ // _totalBytesDefined(false),
+ _totalBytes(0),
+ MultiArcMode(false)
+
+ #ifndef _NO_CRYPTO
+ , PasswordIsDefined(false)
+ // , PasswordWasAsked(false)
+ #endif
+
+ {}
+
+ void Init(CStdOutStream *outStream, CStdOutStream *errorStream, CStdOutStream *percentStream)
+ {
+ _so = outStream;
+ _se = errorStream;
+ _percent._so = percentStream;
+ }
+
+ INTERFACE_IOpenCallbackUI(;)
+
+ #ifndef _NO_CRYPTO
+ bool PasswordIsDefined;
+ // bool PasswordWasAsked;
+ UString Password;
+ #endif
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.cpp
new file mode 100644
index 0000000000..20249ed031
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.cpp
@@ -0,0 +1,183 @@
+// PercentPrinter.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+
+#include "PercentPrinter.h"
+
+static const unsigned kPercentsSize = 4;
+
+CPercentPrinter::~CPercentPrinter()
+{
+ ClosePrint(false);
+}
+
+void CPercentPrinterState::ClearCurState()
+{
+ Completed = 0;
+ Total = ((UInt64)(Int64)-1);
+ Files = 0;
+ Command.Empty();
+ FileName.Empty();
+}
+
+void CPercentPrinter::ClosePrint(bool needFlush)
+{
+ unsigned num = _printedString.Len();
+ if (num != 0)
+ {
+
+ unsigned i;
+
+ /* '\r' in old MAC OS means "new line".
+ So we can't use '\r' in some systems */
+
+ #ifdef _WIN32
+ char *start = _temp.GetBuf(num + 2);
+ char *p = start;
+ *p++ = '\r';
+ for (i = 0; i < num; i++) *p++ = ' ';
+ *p++ = '\r';
+ #else
+ char *start = _temp.GetBuf(num * 3);
+ char *p = start;
+ for (i = 0; i < num; i++) *p++ = '\b';
+ for (i = 0; i < num; i++) *p++ = ' ';
+ for (i = 0; i < num; i++) *p++ = '\b';
+ #endif
+
+ *p = 0;
+ _temp.ReleaseBuf_SetLen((unsigned)(p - start));
+ *_so << _temp;
+ }
+ if (needFlush)
+ _so->Flush();
+ _printedString.Empty();
+}
+
+void CPercentPrinter::GetPercents()
+{
+ char s[32];
+ unsigned size;
+ {
+ char c = '%';
+ UInt64 val = 0;
+ if (Total == (UInt64)(Int64)-1)
+ {
+ val = Completed >> 20;
+ c = 'M';
+ }
+ else if (Total != 0)
+ val = Completed * 100 / Total;
+ ConvertUInt64ToString(val, s);
+ size = (unsigned)strlen(s);
+ s[size++] = c;
+ s[size] = 0;
+ }
+
+ while (size < kPercentsSize)
+ {
+ _s += ' ';
+ size++;
+ }
+
+ _s += s;
+}
+
+void CPercentPrinter::Print()
+{
+ DWORD tick = 0;
+ if (_tickStep != 0)
+ tick = GetTickCount();
+
+ bool onlyPercentsChanged = false;
+
+ if (!_printedString.IsEmpty())
+ {
+ if (_tickStep != 0 && (UInt32)(tick - _prevTick) < _tickStep)
+ return;
+
+ CPercentPrinterState &st = *this;
+ if (_printedState.Command == st.Command
+ && _printedState.FileName == st.FileName
+ && _printedState.Files == st.Files)
+ {
+ if (_printedState.Total == st.Total
+ && _printedState.Completed == st.Completed)
+ return;
+ onlyPercentsChanged = true;
+ }
+ }
+
+ _s.Empty();
+
+ GetPercents();
+
+ if (onlyPercentsChanged && _s == _printedPercents)
+ return;
+
+ _printedPercents = _s;
+
+ if (Files != 0)
+ {
+ char s[32];
+ ConvertUInt64ToString(Files, s);
+ // unsigned size = (unsigned)strlen(s);
+ // for (; size < 3; size++) _s += ' ';
+ _s += ' ';
+ _s += s;
+ // _s += "f";
+ }
+
+
+ if (!Command.IsEmpty())
+ {
+ _s += ' ';
+ _s += Command;
+ }
+
+ if (!FileName.IsEmpty() && _s.Len() < MaxLen)
+ {
+ _s += ' ';
+
+ _tempU = FileName;
+ _so->Normalize_UString(_tempU);
+ StdOut_Convert_UString_to_AString(_tempU, _temp);
+ if (_s.Len() + _temp.Len() > MaxLen)
+ {
+ unsigned len = FileName.Len();
+ for (; len != 0;)
+ {
+ unsigned delta = len / 8;
+ if (delta == 0)
+ delta = 1;
+ len -= delta;
+ _tempU = FileName;
+ _tempU.Delete(len / 2, _tempU.Len() - len);
+ _tempU.Insert(len / 2, L" . ");
+ _so->Normalize_UString(_tempU);
+ StdOut_Convert_UString_to_AString(_tempU, _temp);
+ if (_s.Len() + _temp.Len() <= MaxLen)
+ break;
+ }
+ if (len == 0)
+ _temp.Empty();
+ }
+ _s += _temp;
+ }
+
+ if (_printedString != _s)
+ {
+ ClosePrint(false);
+ *_so << _s;
+ if (NeedFlush)
+ _so->Flush();
+ _printedString = _s;
+ }
+
+ _printedState = *this;
+
+ if (_tickStep != 0)
+ _prevTick = tick;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.h
new file mode 100644
index 0000000000..90b4083ed3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/PercentPrinter.h
@@ -0,0 +1,62 @@
+// PercentPrinter.h
+
+#ifndef __PERCENT_PRINTER_H
+#define __PERCENT_PRINTER_H
+
+#include "../../../Common/StdOutStream.h"
+
+struct CPercentPrinterState
+{
+ UInt64 Completed;
+ UInt64 Total;
+
+ UInt64 Files;
+
+ AString Command;
+ UString FileName;
+
+ void ClearCurState();
+
+ CPercentPrinterState():
+ Completed(0),
+ Total((UInt64)(Int64)-1),
+ Files(0)
+ {}
+};
+
+class CPercentPrinter: public CPercentPrinterState
+{
+ UInt32 _tickStep;
+ DWORD _prevTick;
+
+ AString _s;
+
+ AString _printedString;
+ AString _temp;
+ UString _tempU;
+
+ CPercentPrinterState _printedState;
+ AString _printedPercents;
+
+ void GetPercents();
+
+public:
+ CStdOutStream *_so;
+
+ bool NeedFlush;
+ unsigned MaxLen;
+
+ CPercentPrinter(UInt32 tickStep = 200):
+ _tickStep(tickStep),
+ _prevTick(0),
+ NeedFlush(true),
+ MaxLen(80 - 1)
+ {}
+
+ ~CPercentPrinter();
+
+ void ClosePrint(bool needFlush);
+ void Print();
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.cpp
new file mode 100644
index 0000000000..c6d3b1fa62
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.cpp
@@ -0,0 +1,3 @@
+// StdAfx.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.h
new file mode 100644
index 0000000000..59d9ac15b1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
new file mode 100644
index 0000000000..46ffaba021
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.cpp
@@ -0,0 +1,702 @@
+// UpdateCallbackConsole.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+
+#include "../../../Windows/ErrorMsg.h"
+
+#ifndef _7ZIP_ST
+#include "../../../Windows/Synchronization.h"
+#endif
+
+#include "ConsoleClose.h"
+#include "UserInputUtils.h"
+#include "UpdateCallbackConsole.h"
+
+using namespace NWindows;
+
+#ifndef _7ZIP_ST
+static NSynchronization::CCriticalSection g_CriticalSection;
+#define MT_LOCK NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
+#else
+#define MT_LOCK
+#endif
+
+static const wchar_t * const kEmptyFileAlias = L"[Content]";
+
+static const char * const kOpenArchiveMessage = "Open archive: ";
+static const char * const kCreatingArchiveMessage = "Creating archive: ";
+static const char * const kUpdatingArchiveMessage = "Updating archive: ";
+static const char * const kScanningMessage = "Scanning the drive:";
+
+static const char * const kError = "ERROR: ";
+static const char * const kWarning = "WARNING: ";
+
+static HRESULT CheckBreak2()
+{
+ return NConsoleClose::TestBreakSignal() ? E_ABORT : S_OK;
+}
+
+HRESULT Print_OpenArchive_Props(CStdOutStream &so, const CCodecs *codecs, const CArchiveLink &arcLink);
+HRESULT Print_OpenArchive_Error(CStdOutStream &so, const CCodecs *codecs, const CArchiveLink &arcLink);
+
+void PrintErrorFlags(CStdOutStream &so, const char *s, UInt32 errorFlags);
+
+void Print_ErrorFormatIndex_Warning(CStdOutStream *_so, const CCodecs *codecs, const CArc &arc);
+
+HRESULT CUpdateCallbackConsole::OpenResult(
+ const CCodecs *codecs, const CArchiveLink &arcLink,
+ const wchar_t *name, HRESULT result)
+{
+ ClosePercents2();
+
+ FOR_VECTOR (level, arcLink.Arcs)
+ {
+ const CArc &arc = arcLink.Arcs[level];
+ const CArcErrorInfo &er = arc.ErrorInfo;
+
+ UInt32 errorFlags = er.GetErrorFlags();
+
+ if (errorFlags != 0 || !er.ErrorMessage.IsEmpty())
+ {
+ if (_se)
+ {
+ *_se << endl;
+ if (level != 0)
+ *_se << arc.Path << endl;
+ }
+
+ if (errorFlags != 0)
+ {
+ if (_se)
+ PrintErrorFlags(*_se, "ERRORS:", errorFlags);
+ }
+
+ if (!er.ErrorMessage.IsEmpty())
+ {
+ if (_se)
+ *_se << "ERRORS:" << endl << er.ErrorMessage << endl;
+ }
+
+ if (_se)
+ {
+ *_se << endl;
+ _se->Flush();
+ }
+ }
+
+ UInt32 warningFlags = er.GetWarningFlags();
+
+ if (warningFlags != 0 || !er.WarningMessage.IsEmpty())
+ {
+ if (_so)
+ {
+ *_so << endl;
+ if (level != 0)
+ *_so << arc.Path << endl;
+ }
+
+ if (warningFlags != 0)
+ {
+ if (_so)
+ PrintErrorFlags(*_so, "WARNINGS:", warningFlags);
+ }
+
+ if (!er.WarningMessage.IsEmpty())
+ {
+ if (_so)
+ *_so << "WARNINGS:" << endl << er.WarningMessage << endl;
+ }
+
+ if (_so)
+ {
+ *_so << endl;
+ if (NeedFlush)
+ _so->Flush();
+ }
+ }
+
+
+ if (er.ErrorFormatIndex >= 0)
+ {
+ if (_so)
+ {
+ Print_ErrorFormatIndex_Warning(_so, codecs, arc);
+ if (NeedFlush)
+ _so->Flush();
+ }
+ }
+ }
+
+ if (result == S_OK)
+ {
+ if (_so)
+ {
+ RINOK(Print_OpenArchive_Props(*_so, codecs, arcLink));
+ *_so << endl;
+ }
+ }
+ else
+ {
+ if (_so)
+ _so->Flush();
+ if (_se)
+ {
+ *_se << kError;
+ _se->NormalizePrint_wstr(name);
+ *_se << endl;
+ HRESULT res = Print_OpenArchive_Error(*_se, codecs, arcLink);
+ RINOK(res);
+ _se->Flush();
+ }
+ }
+
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::StartScanning()
+{
+ if (_so)
+ *_so << kScanningMessage << endl;
+ _percent.Command = "Scan ";
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::ScanProgress(const CDirItemsStat &st, const FString &path, bool /* isDir */)
+{
+ if (NeedPercents())
+ {
+ _percent.Files = st.NumDirs + st.NumFiles + st.NumAltStreams;
+ _percent.Completed = st.GetTotalBytes();
+ _percent.FileName = fs2us(path);
+ _percent.Print();
+ }
+
+ return CheckBreak();
+}
+
+void CCallbackConsoleBase::CommonError(const FString &path, DWORD systemError, bool isWarning)
+{
+ ClosePercents2();
+
+ if (_se)
+ {
+ if (_so)
+ _so->Flush();
+
+ *_se << endl << (isWarning ? kWarning : kError)
+ << NError::MyFormatMessage(systemError)
+ << endl;
+ _se->NormalizePrint_UString(fs2us(path));
+ *_se << endl << endl;
+ _se->Flush();
+ }
+}
+
+
+HRESULT CCallbackConsoleBase::ScanError_Base(const FString &path, DWORD systemError)
+{
+ MT_LOCK
+
+ ScanErrors.AddError(path, systemError);
+ CommonError(path, systemError, true);
+
+ return S_OK;
+}
+
+HRESULT CCallbackConsoleBase::OpenFileError_Base(const FString &path, DWORD systemError)
+{
+ MT_LOCK
+ FailedFiles.AddError(path, systemError);
+ /*
+ if (systemError == ERROR_SHARING_VIOLATION)
+ {
+ */
+ CommonError(path, systemError, true);
+ return S_FALSE;
+ /*
+ }
+ return systemError;
+ */
+}
+
+HRESULT CCallbackConsoleBase::ReadingFileError_Base(const FString &path, DWORD systemError)
+{
+ MT_LOCK
+ CommonError(path, systemError, false);
+ return HRESULT_FROM_WIN32(systemError);
+}
+
+HRESULT CUpdateCallbackConsole::ScanError(const FString &path, DWORD systemError)
+{
+ return ScanError_Base(path, systemError);
+}
+
+
+static void PrintPropPair(AString &s, const char *name, UInt64 val)
+{
+ char temp[32];
+ ConvertUInt64ToString(val, temp);
+ s += name;
+ s += ": ";
+ s += temp;
+}
+
+void PrintSize_bytes_Smart(AString &s, UInt64 val);
+void Print_DirItemsStat(AString &s, const CDirItemsStat &st);
+void Print_DirItemsStat2(AString &s, const CDirItemsStat2 &st);
+
+HRESULT CUpdateCallbackConsole::FinishScanning(const CDirItemsStat &st)
+{
+ if (NeedPercents())
+ {
+ _percent.ClosePrint(true);
+ _percent.ClearCurState();
+ }
+
+ if (_so)
+ {
+ AString s;
+ Print_DirItemsStat(s, st);
+ *_so << s << endl << endl;
+ }
+ return S_OK;
+}
+
+static const char * const k_StdOut_ArcName = "StdOut";
+
+HRESULT CUpdateCallbackConsole::StartOpenArchive(const wchar_t *name)
+{
+ if (_so)
+ {
+ *_so << kOpenArchiveMessage;
+ if (name)
+ *_so << name;
+ else
+ *_so << k_StdOut_ArcName;
+ *_so << endl;
+ }
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::StartArchive(const wchar_t *name, bool updating)
+{
+ if (_so)
+ {
+ *_so << (updating ? kUpdatingArchiveMessage : kCreatingArchiveMessage);
+ if (name)
+ _so->NormalizePrint_wstr(name);
+ else
+ *_so << k_StdOut_ArcName;
+ *_so << endl << endl;
+ }
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::FinishArchive(const CFinishArchiveStat &st)
+{
+ ClosePercents2();
+
+ if (_so)
+ {
+ AString s;
+ // Print_UInt64_and_String(s, _percent.Files == 1 ? "file" : "files", _percent.Files);
+ PrintPropPair(s, "Files read from disk", _percent.Files);
+ s.Add_LF();
+ s += "Archive size: ";
+ PrintSize_bytes_Smart(s, st.OutArcFileSize);
+ s.Add_LF();
+ *_so << endl;
+ *_so << s;
+ // *_so << endl;
+ }
+
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::WriteSfx(const wchar_t *name, UInt64 size)
+{
+ if (_so)
+ {
+ *_so << "Write SFX: ";
+ *_so << name;
+ AString s (" : ");
+ PrintSize_bytes_Smart(s, size);
+ *_so << s << endl;
+ }
+ return S_OK;
+}
+
+
+HRESULT CUpdateCallbackConsole::DeletingAfterArchiving(const FString &path, bool /* isDir */)
+{
+ if (LogLevel > 0 && _so)
+ {
+ ClosePercents_for_so();
+
+ if (!DeleteMessageWasShown)
+ {
+ if (_so)
+ *_so << endl << ": Removing files after including to archive" << endl;
+ }
+
+ {
+ {
+ _tempA = "Removing";
+ _tempA.Add_Space();
+ *_so << _tempA;
+ _tempU = fs2us(path);
+ _so->Normalize_UString(_tempU);
+ _so->PrintUString(_tempU, _tempA);
+ *_so << endl;
+ if (NeedFlush)
+ _so->Flush();
+ }
+ }
+ }
+
+ if (!DeleteMessageWasShown)
+ {
+ if (NeedPercents())
+ {
+ _percent.ClearCurState();
+ }
+ DeleteMessageWasShown = true;
+ }
+ else
+ {
+ _percent.Files++;
+ }
+
+ if (NeedPercents())
+ {
+ // if (!FullLog)
+ {
+ _percent.Command = "Removing";
+ _percent.FileName = fs2us(path);
+ }
+ _percent.Print();
+ }
+
+ return S_OK;
+}
+
+
+HRESULT CUpdateCallbackConsole::FinishDeletingAfterArchiving()
+{
+ ClosePercents2();
+ if (_so && DeleteMessageWasShown)
+ *_so << endl;
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::CheckBreak()
+{
+ return CheckBreak2();
+}
+
+/*
+HRESULT CUpdateCallbackConsole::Finalize()
+{
+ // MT_LOCK
+ return S_OK;
+}
+*/
+
+
+void static PrintToDoStat(CStdOutStream *_so, const CDirItemsStat2 &stat, const char *name)
+{
+ AString s;
+ Print_DirItemsStat2(s, stat);
+ *_so << name << ": " << s << endl;
+}
+
+HRESULT CUpdateCallbackConsole::SetNumItems(const CArcToDoStat &stat)
+{
+ if (_so)
+ {
+ ClosePercents_for_so();
+ if (!stat.DeleteData.IsEmpty())
+ {
+ *_so << endl;
+ PrintToDoStat(_so, stat.DeleteData, "Delete data from archive");
+ }
+ if (!stat.OldData.IsEmpty())
+ PrintToDoStat(_so, stat.OldData, "Keep old data in archive");
+ // if (!stat.NewData.IsEmpty())
+ {
+ PrintToDoStat(_so, stat.NewData, "Add new data to archive");
+ }
+ *_so << endl;
+ }
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::SetTotal(UInt64 size)
+{
+ MT_LOCK
+ if (NeedPercents())
+ {
+ _percent.Total = size;
+ _percent.Print();
+ }
+ return S_OK;
+}
+
+HRESULT CUpdateCallbackConsole::SetCompleted(const UInt64 *completeValue)
+{
+ MT_LOCK
+ if (completeValue)
+ {
+ if (NeedPercents())
+ {
+ _percent.Completed = *completeValue;
+ _percent.Print();
+ }
+ }
+ return CheckBreak2();
+}
+
+HRESULT CUpdateCallbackConsole::SetRatioInfo(const UInt64 * /* inSize */, const UInt64 * /* outSize */)
+{
+ return CheckBreak2();
+}
+
+HRESULT CCallbackConsoleBase::PrintProgress(const wchar_t *name, const char *command, bool showInLog)
+{
+ MT_LOCK
+
+ bool show2 = (showInLog && _so);
+
+ if (show2)
+ {
+ ClosePercents_for_so();
+
+ _tempA = command;
+ if (name)
+ _tempA.Add_Space();
+ *_so << _tempA;
+
+ _tempU.Empty();
+ if (name)
+ {
+ _tempU = name;
+ _so->Normalize_UString(_tempU);
+ }
+ _so->PrintUString(_tempU, _tempA);
+ *_so << endl;
+ if (NeedFlush)
+ _so->Flush();
+ }
+
+ if (NeedPercents())
+ {
+ if (PercentsNameLevel >= 1)
+ {
+ _percent.FileName.Empty();
+ _percent.Command.Empty();
+ if (PercentsNameLevel > 1 || !show2)
+ {
+ _percent.Command = command;
+ if (name)
+ _percent.FileName = name;
+ }
+ }
+ _percent.Print();
+ }
+
+ return CheckBreak2();
+}
+
+HRESULT CUpdateCallbackConsole::GetStream(const wchar_t *name, bool /* isDir */, bool isAnti, UInt32 mode)
+{
+ if (StdOutMode)
+ return S_OK;
+
+ if (!name || name[0] == 0)
+ name = kEmptyFileAlias;
+
+ unsigned requiredLevel = 1;
+
+ const char *s;
+ if (mode == NUpdateNotifyOp::kAdd ||
+ mode == NUpdateNotifyOp::kUpdate)
+ {
+ if (isAnti)
+ s = "Anti";
+ else if (mode == NUpdateNotifyOp::kAdd)
+ s = "+";
+ else
+ s = "U";
+ }
+ else
+ {
+ requiredLevel = 3;
+ if (mode == NUpdateNotifyOp::kAnalyze)
+ s = "A";
+ else
+ s = "Reading";
+ }
+
+ return PrintProgress(name, s, LogLevel >= requiredLevel);
+}
+
+HRESULT CUpdateCallbackConsole::OpenFileError(const FString &path, DWORD systemError)
+{
+ return OpenFileError_Base(path, systemError);
+}
+
+HRESULT CUpdateCallbackConsole::ReadingFileError(const FString &path, DWORD systemError)
+{
+ return ReadingFileError_Base(path, systemError);
+}
+
+HRESULT CUpdateCallbackConsole::SetOperationResult(Int32)
+{
+ MT_LOCK
+ _percent.Files++;
+ return S_OK;
+}
+
+void SetExtractErrorMessage(Int32 opRes, Int32 encrypted, AString &dest);
+
+HRESULT CUpdateCallbackConsole::ReportExtractResult(Int32 opRes, Int32 isEncrypted, const wchar_t *name)
+{
+ // if (StdOutMode) return S_OK;
+
+ if (opRes != NArchive::NExtract::NOperationResult::kOK)
+ {
+ ClosePercents2();
+
+ if (_se)
+ {
+ if (_so)
+ _so->Flush();
+
+ AString s;
+ SetExtractErrorMessage(opRes, isEncrypted, s);
+ *_se << s << " : " << endl;
+ _se->NormalizePrint_wstr(name);
+ *_se << endl << endl;
+ _se->Flush();
+ }
+ return S_OK;
+ }
+ return S_OK;
+}
+
+
+HRESULT CUpdateCallbackConsole::ReportUpdateOpeartion(UInt32 op, const wchar_t *name, bool /* isDir */)
+{
+ // if (StdOutMode) return S_OK;
+
+ char temp[16];
+ const char *s;
+
+ unsigned requiredLevel = 1;
+
+ switch (op)
+ {
+ case NUpdateNotifyOp::kAdd: s = "+"; break;
+ case NUpdateNotifyOp::kUpdate: s = "U"; break;
+ case NUpdateNotifyOp::kAnalyze: s = "A"; requiredLevel = 3; break;
+ case NUpdateNotifyOp::kReplicate: s = "="; requiredLevel = 3; break;
+ case NUpdateNotifyOp::kRepack: s = "R"; requiredLevel = 2; break;
+ case NUpdateNotifyOp::kSkip: s = "."; requiredLevel = 2; break;
+ case NUpdateNotifyOp::kDelete: s = "D"; requiredLevel = 3; break;
+ case NUpdateNotifyOp::kHeader: s = "Header creation"; requiredLevel = 100; break;
+ default:
+ {
+ temp[0] = 'o';
+ temp[1] = 'p';
+ ConvertUInt64ToString(op, temp + 2);
+ s = temp;
+ }
+ }
+
+ return PrintProgress(name, s, LogLevel >= requiredLevel);
+}
+
+/*
+HRESULT CUpdateCallbackConsole::SetPassword(const UString &
+ #ifndef _NO_CRYPTO
+ password
+ #endif
+ )
+{
+ #ifndef _NO_CRYPTO
+ PasswordIsDefined = true;
+ Password = password;
+ #endif
+ return S_OK;
+}
+*/
+
+HRESULT CUpdateCallbackConsole::CryptoGetTextPassword2(Int32 *passwordIsDefined, BSTR *password)
+{
+ COM_TRY_BEGIN
+
+ *password = NULL;
+
+ #ifdef _NO_CRYPTO
+
+ *passwordIsDefined = false;
+ return S_OK;
+
+ #else
+
+ if (!PasswordIsDefined)
+ {
+ if (AskPassword)
+ {
+ RINOK(GetPassword_HRESULT(_so, Password));
+ PasswordIsDefined = true;
+ }
+ }
+ *passwordIsDefined = BoolToInt(PasswordIsDefined);
+ return StringToBstr(Password, password);
+
+ #endif
+
+ COM_TRY_END
+}
+
+HRESULT CUpdateCallbackConsole::CryptoGetTextPassword(BSTR *password)
+{
+ COM_TRY_BEGIN
+
+ *password = NULL;
+
+ #ifdef _NO_CRYPTO
+
+ return E_NOTIMPL;
+
+ #else
+
+ if (!PasswordIsDefined)
+ {
+ {
+ RINOK(GetPassword_HRESULT(_so, Password))
+ PasswordIsDefined = true;
+ }
+ }
+ return StringToBstr(Password, password);
+
+ #endif
+ COM_TRY_END
+}
+
+HRESULT CUpdateCallbackConsole::ShowDeleteFile(const wchar_t *name, bool /* isDir */)
+{
+ if (StdOutMode)
+ return S_OK;
+
+ if (LogLevel > 7)
+ {
+ if (!name || name[0] == 0)
+ name = kEmptyFileAlias;
+ return PrintProgress(name, "D", true);
+ }
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.h
new file mode 100644
index 0000000000..6765db6774
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UpdateCallbackConsole.h
@@ -0,0 +1,124 @@
+// UpdateCallbackConsole.h
+
+#ifndef __UPDATE_CALLBACK_CONSOLE_H
+#define __UPDATE_CALLBACK_CONSOLE_H
+
+#include "../../../Common/StdOutStream.h"
+
+#include "../Common/Update.h"
+
+#include "PercentPrinter.h"
+
+struct CErrorPathCodes
+{
+ FStringVector Paths;
+ CRecordVector<DWORD> Codes;
+
+ void AddError(const FString &path, DWORD systemError)
+ {
+ Paths.Add(path);
+ Codes.Add(systemError);
+ }
+ void Clear()
+ {
+ Paths.Clear();
+ Codes.Clear();
+ }
+};
+
+class CCallbackConsoleBase
+{
+protected:
+ CPercentPrinter _percent;
+
+ CStdOutStream *_so;
+ CStdOutStream *_se;
+
+ void CommonError(const FString &path, DWORD systemError, bool isWarning);
+
+ HRESULT ScanError_Base(const FString &path, DWORD systemError);
+ HRESULT OpenFileError_Base(const FString &name, DWORD systemError);
+ HRESULT ReadingFileError_Base(const FString &name, DWORD systemError);
+
+public:
+ bool NeedPercents() const { return _percent._so != NULL; };
+
+ bool StdOutMode;
+
+ bool NeedFlush;
+ unsigned PercentsNameLevel;
+ unsigned LogLevel;
+
+ AString _tempA;
+ UString _tempU;
+
+ CCallbackConsoleBase():
+ StdOutMode(false),
+ NeedFlush(false),
+ PercentsNameLevel(1),
+ LogLevel(0)
+ {}
+
+ void SetWindowWidth(unsigned width) { _percent.MaxLen = width - 1; }
+
+ void Init(CStdOutStream *outStream, CStdOutStream *errorStream, CStdOutStream *percentStream)
+ {
+ FailedFiles.Clear();
+
+ _so = outStream;
+ _se = errorStream;
+ _percent._so = percentStream;
+ }
+
+ void ClosePercents2()
+ {
+ if (NeedPercents())
+ _percent.ClosePrint(true);
+ }
+
+ void ClosePercents_for_so()
+ {
+ if (NeedPercents() && _so == _percent._so)
+ _percent.ClosePrint(false);
+ }
+
+
+ CErrorPathCodes FailedFiles;
+ CErrorPathCodes ScanErrors;
+
+ HRESULT PrintProgress(const wchar_t *name, const char *command, bool showInLog);
+
+};
+
+class CUpdateCallbackConsole: public IUpdateCallbackUI2, public CCallbackConsoleBase
+{
+ // void PrintPropPair(const char *name, const wchar_t *val);
+
+public:
+ #ifndef _NO_CRYPTO
+ bool PasswordIsDefined;
+ UString Password;
+ bool AskPassword;
+ #endif
+
+ bool DeleteMessageWasShown;
+
+ CUpdateCallbackConsole()
+ : DeleteMessageWasShown(false)
+ #ifndef _NO_CRYPTO
+ , PasswordIsDefined(false)
+ , AskPassword(false)
+ #endif
+ {}
+
+ /*
+ void Init(CStdOutStream *outStream)
+ {
+ CCallbackConsoleBase::Init(outStream);
+ }
+ */
+ // ~CUpdateCallbackConsole() { if (NeedPercents()) _percent.ClosePrint(); }
+ INTERFACE_IUpdateCallbackUI2(;)
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.cpp
new file mode 100644
index 0000000000..7bdafdae55
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.cpp
@@ -0,0 +1,110 @@
+// UserInputUtils.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/StdInStream.h"
+#include "../../../Common/StringConvert.h"
+
+#include "UserInputUtils.h"
+
+static const char kYes = 'y';
+static const char kNo = 'n';
+static const char kYesAll = 'a';
+static const char kNoAll = 's';
+static const char kAutoRenameAll = 'u';
+static const char kQuit = 'q';
+
+static const char * const kFirstQuestionMessage = "? ";
+static const char * const kHelpQuestionMessage =
+ "(Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit? ";
+
+// return true if pressed Quite;
+
+NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream)
+{
+ if (outStream)
+ *outStream << kFirstQuestionMessage;
+ for (;;)
+ {
+ if (outStream)
+ {
+ *outStream << kHelpQuestionMessage;
+ outStream->Flush();
+ }
+ AString scannedString;
+ if (!g_StdIn.ScanAStringUntilNewLine(scannedString))
+ return NUserAnswerMode::kError;
+ if (g_StdIn.Error())
+ return NUserAnswerMode::kError;
+ scannedString.Trim();
+ if (scannedString.IsEmpty() && g_StdIn.Eof())
+ return NUserAnswerMode::kEof;
+
+ if (scannedString.Len() == 1)
+ switch (::MyCharLower_Ascii(scannedString[0]))
+ {
+ case kYes: return NUserAnswerMode::kYes;
+ case kNo: return NUserAnswerMode::kNo;
+ case kYesAll: return NUserAnswerMode::kYesAll;
+ case kNoAll: return NUserAnswerMode::kNoAll;
+ case kAutoRenameAll: return NUserAnswerMode::kAutoRenameAll;
+ case kQuit: return NUserAnswerMode::kQuit;
+ }
+ }
+}
+
+#ifdef _WIN32
+#ifndef UNDER_CE
+#define MY_DISABLE_ECHO
+#endif
+#endif
+
+static bool GetPassword(CStdOutStream *outStream, UString &psw)
+{
+ if (outStream)
+ {
+ *outStream << "\nEnter password"
+ #ifdef MY_DISABLE_ECHO
+ " (will not be echoed)"
+ #endif
+ ":";
+ outStream->Flush();
+ }
+
+ #ifdef MY_DISABLE_ECHO
+
+ HANDLE console = GetStdHandle(STD_INPUT_HANDLE);
+ bool wasChanged = false;
+ DWORD mode = 0;
+ if (console != INVALID_HANDLE_VALUE && console != 0)
+ if (GetConsoleMode(console, &mode))
+ wasChanged = (SetConsoleMode(console, mode & ~ENABLE_ECHO_INPUT) != 0);
+ bool res = g_StdIn.ScanUStringUntilNewLine(psw);
+ if (wasChanged)
+ SetConsoleMode(console, mode);
+
+ #else
+
+ bool res = g_StdIn.ScanUStringUntilNewLine(psw);
+
+ #endif
+
+ if (outStream)
+ {
+ *outStream << endl;
+ outStream->Flush();
+ }
+
+ return res;
+}
+
+HRESULT GetPassword_HRESULT(CStdOutStream *outStream, UString &psw)
+{
+ if (!GetPassword(outStream, psw))
+ return E_INVALIDARG;
+ if (g_StdIn.Error())
+ return E_FAIL;
+ if (g_StdIn.Eof() && psw.IsEmpty())
+ return E_ABORT;
+ return S_OK;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.h b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.h
new file mode 100644
index 0000000000..ebe09c1eb9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/UserInputUtils.h
@@ -0,0 +1,27 @@
+// UserInputUtils.h
+
+#ifndef __USER_INPUT_UTILS_H
+#define __USER_INPUT_UTILS_H
+
+#include "../../../Common/StdOutStream.h"
+
+namespace NUserAnswerMode {
+
+enum EEnum
+{
+ kYes,
+ kNo,
+ kYesAll,
+ kNoAll,
+ kAutoRenameAll,
+ kQuit,
+ kEof,
+ kError
+};
+}
+
+NUserAnswerMode::EEnum ScanUserYesNoAllQuit(CStdOutStream *outStream);
+// bool GetPassword(CStdOutStream *outStream, UString &psw);
+HRESULT GetPassword_HRESULT(CStdOutStream *outStream, UString &psw);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/makefile b/other-licenses/7zstub/src/CPP/7zip/UI/Console/makefile
new file mode 100644
index 0000000000..31bc5c2829
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/makefile
@@ -0,0 +1,69 @@
+PROG = 7z.exe
+MY_CONSOLE = 1
+CFLAGS = $(CFLAGS) \
+ -DEXTERNAL_CODECS \
+
+!IFNDEF UNDER_CE
+CFLAGS = $(CFLAGS) -DWIN_LONG_PATH -D_7ZIP_LARGE_PAGES -DSUPPORT_DEVICE_FILE
+!ENDIF
+
+COMMON_OBJS = \
+ $O\CommandLineParser.obj \
+ $O\CRC.obj \
+ $O\IntToString.obj \
+ $O\ListFileUtils.obj \
+ $O\NewHandler.obj \
+ $O\StdInStream.obj \
+ $O\StdOutStream.obj \
+ $O\MyString.obj \
+ $O\StringConvert.obj \
+ $O\StringToInt.obj \
+ $O\UTFConvert.obj \
+ $O\MyVector.obj \
+ $O\Wildcard.obj \
+
+WIN_OBJS = \
+ $O\DLL.obj \
+ $O\ErrorMsg.obj \
+ $O\FileDir.obj \
+ $O\FileFind.obj \
+ $O\FileIO.obj \
+ $O\FileLink.obj \
+ $O\FileName.obj \
+ $O\FileSystem.obj \
+ $O\MemoryLock.obj \
+ $O\PropVariant.obj \
+ $O\PropVariantConv.obj \
+ $O\Registry.obj \
+ $O\System.obj \
+ $O\TimeUtils.obj \
+
+7ZIP_COMMON_OBJS = \
+ $O\CreateCoder.obj \
+ $O\FilePathAutoRename.obj \
+ $O\FileStreams.obj \
+ $O\FilterCoder.obj \
+ $O\LimitedStreams.obj \
+ $O\MethodProps.obj \
+ $O\ProgressUtils.obj \
+ $O\PropId.obj \
+ $O\StreamObjects.obj \
+ $O\StreamUtils.obj \
+ $O\UniqBlocks.obj \
+
+AR_COMMON_OBJS = \
+ $O\OutStreamWithCRC.obj \
+
+COMPRESS_OBJS = \
+ $O\CopyCoder.obj \
+
+C_OBJS = \
+ $O\Alloc.obj \
+ $O\CpuArch.obj \
+ $O\Sort.obj \
+ $O\Threads.obj \
+
+!include "../../Crc.mak"
+!include "Console.mak"
+
+!include "../../7zip.mak"
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Console/resource.rc b/other-licenses/7zstub/src/CPP/7zip/UI/Console/resource.rc
new file mode 100644
index 0000000000..8d721f5092
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Console/resource.rc
@@ -0,0 +1,7 @@
+#include "../../MyVersionInfo.rc"
+
+MY_VERSION_INFO_APP("7-Zip Console" , "7z")
+
+#ifndef UNDER_CE
+1 24 MOVEABLE PURE "Console.manifest"
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.cpp
new file mode 100644
index 0000000000..1ef0d9c86f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.cpp
@@ -0,0 +1,37 @@
+// MyMessages.cpp
+
+#include "StdAfx.h"
+
+#include "MyMessages.h"
+
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/ResourceString.h"
+
+#include "../FileManager/LangUtils.h"
+
+using namespace NWindows;
+
+void ShowErrorMessage(HWND window, LPCWSTR message)
+{
+ ::MessageBoxW(window, message, L"7-Zip", MB_OK | MB_ICONSTOP);
+}
+
+void ShowErrorMessageHwndRes(HWND window, UINT resID)
+{
+ ShowErrorMessage(window, LangString(resID));
+}
+
+void ShowErrorMessageRes(UINT resID)
+{
+ ShowErrorMessageHwndRes(0, resID);
+}
+
+void ShowErrorMessageDWORD(HWND window, DWORD errorCode)
+{
+ ShowErrorMessage(window, NError::MyFormatMessage(errorCode));
+}
+
+void ShowLastErrorMessage(HWND window)
+{
+ ShowErrorMessageDWORD(window, ::GetLastError());
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.h b/other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.h
new file mode 100644
index 0000000000..c175e8a174
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/Explorer/MyMessages.h
@@ -0,0 +1,16 @@
+// MyMessages.h
+
+#ifndef __MY_MESSAGES_H
+#define __MY_MESSAGES_H
+
+#include "../../../Common/MyString.h"
+
+void ShowErrorMessage(HWND window, LPCWSTR message);
+inline void ShowErrorMessage(LPCWSTR message) { ShowErrorMessage(0, message); }
+
+void ShowErrorMessageHwndRes(HWND window, UInt32 langID);
+void ShowErrorMessageRes(UInt32 langID);
+
+void ShowLastErrorMessage(HWND window = 0);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.cpp
new file mode 100644
index 0000000000..d5c981c54b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.cpp
@@ -0,0 +1,1025 @@
+// BrowseDialog.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/MyWindows.h"
+
+#include <commctrl.h>
+
+#ifndef UNDER_CE
+#include "../../../Windows/CommonDialog.h"
+#include "../../../Windows/Shell.h"
+#endif
+
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/FileFind.h"
+
+#ifdef UNDER_CE
+#include <commdlg.h>
+#endif
+
+#include "BrowseDialog.h"
+
+#define USE_MY_BROWSE_DIALOG
+
+#ifdef USE_MY_BROWSE_DIALOG
+
+#include "../../../Common/Defs.h"
+#include "../../../Common/IntToString.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#include "../../../Windows/Control/ComboBox.h"
+#include "../../../Windows/Control/Dialog.h"
+#include "../../../Windows/Control/Edit.h"
+#include "../../../Windows/Control/ListView.h"
+
+#include "BrowseDialogRes.h"
+#include "PropertyNameRes.h"
+#include "SysIconUtils.h"
+
+#ifndef _SFX
+#include "RegistryUtils.h"
+#endif
+
+#endif
+
+#include "ComboDialog.h"
+#include "LangUtils.h"
+
+#include "resource.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+using namespace NFind;
+
+#ifdef USE_MY_BROWSE_DIALOG
+
+extern bool g_LVN_ITEMACTIVATE_Support;
+
+static const int kParentIndex = -1;
+static const UINT k_Message_RefreshPathEdit = WM_APP + 1;
+
+static HRESULT GetNormalizedError()
+{
+ DWORD errorCode = GetLastError();
+ return errorCode == 0 ? E_FAIL : errorCode;
+}
+
+extern UString HResultToMessage(HRESULT errorCode);
+
+static void MessageBox_Error_Global(HWND wnd, const wchar_t *message)
+{
+ ::MessageBoxW(wnd, message, L"7-Zip", MB_ICONERROR);
+}
+
+static void MessageBox_HResError(HWND wnd, HRESULT errorCode, const wchar_t *name)
+{
+ UString s = HResultToMessage(errorCode);
+ if (name)
+ {
+ s.Add_LF();
+ s += name;
+ }
+ MessageBox_Error_Global(wnd, s);
+}
+
+class CBrowseDialog: public NControl::CModalDialog
+{
+ NControl::CListView _list;
+ NControl::CEdit _pathEdit;
+ NControl::CComboBox _filterCombo;
+
+ CObjectVector<CFileInfo> _files;
+
+ CExtToIconMap _extToIconMap;
+ int _sortIndex;
+ bool _ascending;
+ bool _showDots;
+ UString _topDirPrefix; // we don't open parent of that folder
+ UString DirPrefix;
+
+ virtual bool OnInit();
+ virtual bool OnSize(WPARAM wParam, int xSize, int ySize);
+ virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+ virtual bool OnNotify(UINT controlID, LPNMHDR header);
+ virtual bool OnKeyDown(LPNMLVKEYDOWN keyDownInfo);
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ virtual void OnOK();
+
+ void Post_RefreshPathEdit() { PostMsg(k_Message_RefreshPathEdit); }
+
+ bool GetParentPath(const UString &path, UString &parentPrefix, UString &name);
+ // Reload changes DirPrefix. Don't send DirPrefix in pathPrefix parameter
+ HRESULT Reload(const UString &pathPrefix, const UString &selectedName);
+ HRESULT Reload();
+
+ void OpenParentFolder();
+ void SetPathEditText();
+ void OnCreateDir();
+ void OnItemEnter();
+ void FinishOnOK();
+
+ int GetRealItemIndex(int indexInListView) const
+ {
+ LPARAM param;
+ if (!_list.GetItemParam(indexInListView, param))
+ return (int)-1;
+ return (int)param;
+ }
+
+public:
+ bool FolderMode;
+ UString Title;
+ UString FilePath; // input/ result path
+ bool ShowAllFiles;
+ UStringVector Filters;
+ UString FilterDescription;
+
+ CBrowseDialog(): FolderMode(false), _showDots(false), ShowAllFiles(true) {}
+ void SetFilter(const UString &s);
+ INT_PTR Create(HWND parent = 0) { return CModalDialog::Create(IDD_BROWSE, parent); }
+ int CompareItems(LPARAM lParam1, LPARAM lParam2);
+};
+
+void CBrowseDialog::SetFilter(const UString &s)
+{
+ Filters.Clear();
+ UString mask;
+ unsigned i;
+ for (i = 0; i < s.Len(); i++)
+ {
+ wchar_t c = s[i];
+ if (c == ';')
+ {
+ if (!mask.IsEmpty())
+ Filters.Add(mask);
+ mask.Empty();
+ }
+ else
+ mask += c;
+ }
+ if (!mask.IsEmpty())
+ Filters.Add(mask);
+ ShowAllFiles = Filters.IsEmpty();
+ for (i = 0; i < Filters.Size(); i++)
+ {
+ const UString &f = Filters[i];
+ if (f == L"*.*" || f == L"*")
+ {
+ ShowAllFiles = true;
+ break;
+ }
+ }
+}
+
+bool CBrowseDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetDlgItems(*this, NULL, 0);
+ #endif
+ if (!Title.IsEmpty())
+ SetText(Title);
+ _list.Attach(GetItem(IDL_BROWSE));
+ _filterCombo.Attach(GetItem(IDC_BROWSE_FILTER));
+ _pathEdit.Attach(GetItem(IDE_BROWSE_PATH));
+
+ if (FolderMode)
+ HideItem(IDC_BROWSE_FILTER);
+ else
+ EnableItem(IDC_BROWSE_FILTER, false);
+
+ #ifndef UNDER_CE
+ _list.SetUnicodeFormat();
+ #endif
+
+ #ifndef _SFX
+ CFmSettings st;
+ st.Load();
+ if (st.SingleClick)
+ _list.SetExtendedListViewStyle(LVS_EX_ONECLICKACTIVATE | LVS_EX_TRACKSELECT);
+ _showDots = st.ShowDots;
+ #endif
+
+ {
+ UString s;
+ if (!FilterDescription.IsEmpty())
+ s = FilterDescription;
+ else if (ShowAllFiles)
+ s = "*.*";
+ else
+ {
+ FOR_VECTOR (i, Filters)
+ {
+ if (i != 0)
+ s.Add_Space();
+ s += Filters[i];
+ }
+ }
+ _filterCombo.AddString(s);
+ _filterCombo.SetCurSel(0);
+ }
+
+ _list.SetImageList(GetSysImageList(true), LVSIL_SMALL);
+ _list.SetImageList(GetSysImageList(false), LVSIL_NORMAL);
+
+ _list.InsertColumn(0, LangString(IDS_PROP_NAME), 100);
+ _list.InsertColumn(1, LangString(IDS_PROP_MTIME), 100);
+ {
+ LV_COLUMNW column;
+ column.iSubItem = 2;
+ column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+ column.fmt = LVCFMT_RIGHT;
+ column.cx = 100;
+ const UString s = LangString(IDS_PROP_SIZE);
+ column.pszText = (wchar_t *)(const wchar_t *)s;
+ _list.InsertColumn(2, &column);
+ }
+
+ _list.InsertItem(0, L"12345678901234567"
+ #ifndef UNDER_CE
+ L"1234567890"
+ #endif
+ );
+ _list.SetSubItem(0, 1, L"2009-09-09"
+ #ifndef UNDER_CE
+ L" 09:09"
+ #endif
+ );
+ _list.SetSubItem(0, 2, L"9999 MB");
+ for (int i = 0; i < 3; i++)
+ _list.SetColumnWidthAuto(i);
+ _list.DeleteAllItems();
+
+ _ascending = true;
+ _sortIndex = 0;
+
+ NormalizeSize();
+
+ _topDirPrefix.Empty();
+ {
+ int rootSize = GetRootPrefixSize(FilePath);
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // We can go up from root folder to drives list
+ if (IsDrivePath(FilePath))
+ rootSize = 0;
+ else if (IsSuperPath(FilePath))
+ {
+ if (IsDrivePath(FilePath.Ptr(kSuperPathPrefixSize)))
+ rootSize = kSuperPathPrefixSize;
+ }
+ #endif
+ _topDirPrefix.SetFrom(FilePath, rootSize);
+ }
+
+ UString name;
+ if (!GetParentPath(FilePath, DirPrefix, name))
+ DirPrefix = _topDirPrefix;
+
+ for (;;)
+ {
+ UString baseFolder = DirPrefix;
+ if (Reload(baseFolder, name) == S_OK)
+ break;
+ name.Empty();
+ if (DirPrefix.IsEmpty())
+ break;
+ UString parent, name2;
+ GetParentPath(DirPrefix, parent, name2);
+ DirPrefix = parent;
+ }
+
+ if (name.IsEmpty())
+ name = FilePath;
+ if (FolderMode)
+ NormalizeDirPathPrefix(name);
+ _pathEdit.SetText(name);
+
+ #ifndef UNDER_CE
+ /* If we clear UISF_HIDEFOCUS, the focus rectangle in ListView will be visible,
+ even if we use mouse for pressing the button to open this dialog. */
+ PostMsg(MY__WM_UPDATEUISTATE, MAKEWPARAM(MY__UIS_CLEAR, MY__UISF_HIDEFOCUS));
+ #endif
+
+ return CModalDialog::OnInit();
+}
+
+bool CBrowseDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
+{
+ int mx, my;
+ {
+ RECT r;
+ GetClientRectOfItem(IDB_BROWSE_PARENT, r);
+ mx = r.left;
+ my = r.top;
+ }
+ InvalidateRect(NULL);
+
+ int xLim = xSize - mx;
+ {
+ RECT r;
+ GetClientRectOfItem(IDT_BROWSE_FOLDER, r);
+ MoveItem(IDT_BROWSE_FOLDER, r.left, r.top, xLim - r.left, RECT_SIZE_Y(r));
+ }
+
+ int bx1, bx2, by;
+ GetItemSizes(IDCANCEL, bx1, by);
+ GetItemSizes(IDOK, bx2, by);
+ int y = ySize - my - by;
+ int x = xLim - bx1;
+ MoveItem(IDCANCEL, x, y, bx1, by);
+ MoveItem(IDOK, x - mx - bx2, y, bx2, by);
+
+ // Y_Size of ComboBox is tricky. So we use Y_Size of _pathEdit instead
+
+ int yPathSize;
+ {
+ RECT r;
+ GetClientRectOfItem(IDE_BROWSE_PATH, r);
+ yPathSize = RECT_SIZE_Y(r);
+ _pathEdit.Move(r.left, y - my - yPathSize - my - yPathSize, xLim - r.left, yPathSize);
+ }
+
+ {
+ RECT r;
+ GetClientRectOfItem(IDC_BROWSE_FILTER, r);
+ _filterCombo.Move(r.left, y - my - yPathSize, xLim - r.left, RECT_SIZE_Y(r));
+ }
+
+ {
+ RECT r;
+ GetClientRectOfItem(IDL_BROWSE, r);
+ _list.Move(r.left, r.top, xLim - r.left, y - my - yPathSize - my - yPathSize - my - r.top);
+ }
+
+ return false;
+}
+
+bool CBrowseDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ if (message == k_Message_RefreshPathEdit)
+ {
+ SetPathEditText();
+ return true;
+ }
+ return CModalDialog::OnMessage(message, wParam, lParam);
+}
+
+bool CBrowseDialog::OnNotify(UINT /* controlID */, LPNMHDR header)
+{
+ if (header->hwndFrom != _list)
+ return false;
+ switch (header->code)
+ {
+ case LVN_ITEMACTIVATE:
+ if (g_LVN_ITEMACTIVATE_Support)
+ OnItemEnter();
+ break;
+ case NM_DBLCLK:
+ case NM_RETURN: // probabably it's unused
+ if (!g_LVN_ITEMACTIVATE_Support)
+ OnItemEnter();
+ break;
+ case LVN_COLUMNCLICK:
+ {
+ int index = LPNMLISTVIEW(header)->iSubItem;
+ if (index == _sortIndex)
+ _ascending = !_ascending;
+ else
+ {
+ _ascending = (index == 0);
+ _sortIndex = index;
+ }
+ Reload();
+ return false;
+ }
+ case LVN_KEYDOWN:
+ {
+ bool boolResult = OnKeyDown(LPNMLVKEYDOWN(header));
+ Post_RefreshPathEdit();
+ return boolResult;
+ }
+ case NM_RCLICK:
+ case NM_CLICK:
+ case LVN_BEGINDRAG:
+ Post_RefreshPathEdit();
+ break;
+ }
+ return false;
+}
+
+bool CBrowseDialog::OnKeyDown(LPNMLVKEYDOWN keyDownInfo)
+{
+ bool ctrl = IsKeyDown(VK_CONTROL);
+
+ switch (keyDownInfo->wVKey)
+ {
+ case VK_BACK:
+ OpenParentFolder();
+ return true;
+ case 'R':
+ if (ctrl)
+ {
+ Reload();
+ return true;
+ }
+ return false;
+ case VK_F7:
+ OnCreateDir();
+ return true;
+ }
+ return false;
+}
+
+bool CBrowseDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch (buttonID)
+ {
+ case IDB_BROWSE_PARENT: OpenParentFolder(); break;
+ case IDB_BROWSE_CREATE_DIR: OnCreateDir(); break;
+ default: return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+ }
+ _list.SetFocus();
+ return true;
+}
+
+void CBrowseDialog::OnOK()
+{
+ /* When we press "Enter" in listview, Windows sends message to first Button.
+ We check that message was from ListView; */
+ if (GetFocus() == _list)
+ {
+ OnItemEnter();
+ return;
+ }
+ FinishOnOK();
+}
+
+
+bool CBrowseDialog::GetParentPath(const UString &path, UString &parentPrefix, UString &name)
+{
+ parentPrefix.Empty();
+ name.Empty();
+ if (path.IsEmpty())
+ return false;
+ if (_topDirPrefix == path)
+ return false;
+ UString s = path;
+ if (IS_PATH_SEPAR(s.Back()))
+ s.DeleteBack();
+ if (s.IsEmpty())
+ return false;
+ if (IS_PATH_SEPAR(s.Back()))
+ return false;
+ int pos = s.ReverseFind_PathSepar();
+ parentPrefix.SetFrom(s, pos + 1);
+ name = s.Ptr(pos + 1);
+ return true;
+}
+
+int CBrowseDialog::CompareItems(LPARAM lParam1, LPARAM lParam2)
+{
+ if (lParam1 == kParentIndex) return -1;
+ if (lParam2 == kParentIndex) return 1;
+ const CFileInfo &f1 = _files[(int)lParam1];
+ const CFileInfo &f2 = _files[(int)lParam2];
+
+ bool isDir1 = f1.IsDir();
+ bool isDir2 = f2.IsDir();
+ if (isDir1 && !isDir2) return -1;
+ if (isDir2 && !isDir1) return 1;
+
+ int res = 0;
+ switch (_sortIndex)
+ {
+ case 0: res = CompareFileNames(fs2us(f1.Name), fs2us(f2.Name)); break;
+ case 1: res = CompareFileTime(&f1.MTime, &f2.MTime); break;
+ case 2: res = MyCompare(f1.Size, f2.Size); break;
+ }
+ return _ascending ? res: -res;
+}
+
+static int CALLBACK CompareItems2(LPARAM lParam1, LPARAM lParam2, LPARAM lpData)
+{
+ return ((CBrowseDialog *)lpData)->CompareItems(lParam1, lParam2);
+}
+
+static void ConvertSizeToString(UInt64 v, wchar_t *s)
+{
+ Byte c = 0;
+ if (v >= ((UInt64)10000 << 20)) { v >>= 30; c = 'G'; }
+ else if (v >= ((UInt64)10000 << 10)) { v >>= 20; c = 'M'; }
+ else if (v >= ((UInt64)10000 << 0)) { v >>= 10; c = 'K'; }
+ ConvertUInt64ToString(v, s);
+ if (c != 0)
+ {
+ s += MyStringLen(s);
+ *s++ = ' ';
+ *s++ = c;
+ *s++ = 0;
+ }
+}
+
+// Reload changes DirPrefix. Don't send DirPrefix in pathPrefix parameter
+
+HRESULT CBrowseDialog::Reload(const UString &pathPrefix, const UString &selectedName)
+{
+ CObjectVector<CFileInfo> files;
+
+ #ifndef UNDER_CE
+ bool isDrive = false;
+ if (pathPrefix.IsEmpty() || pathPrefix.IsEqualTo(kSuperPathPrefix))
+ {
+ isDrive = true;
+ FStringVector drives;
+ if (!MyGetLogicalDriveStrings(drives))
+ return GetNormalizedError();
+ FOR_VECTOR (i, drives)
+ {
+ FString d = drives[i];
+ if (d.Len() < 3 || d.Back() != '\\')
+ return E_FAIL;
+ d.DeleteBack();
+ CFileInfo &fi = files.AddNew();
+ fi.SetAsDir();
+ fi.Name = d;
+ }
+ }
+ else
+ #endif
+ {
+ CEnumerator enumerator;
+ enumerator.SetDirPrefix(us2fs(pathPrefix));
+ for (;;)
+ {
+ bool found;
+ CFileInfo fi;
+ if (!enumerator.Next(fi, found))
+ return GetNormalizedError();
+ if (!found)
+ break;
+ if (!fi.IsDir())
+ {
+ if (FolderMode)
+ continue;
+ if (!ShowAllFiles)
+ {
+ unsigned i;
+ for (i = 0; i < Filters.Size(); i++)
+ if (DoesWildcardMatchName(Filters[i], fs2us(fi.Name)))
+ break;
+ if (i == Filters.Size())
+ continue;
+ }
+ }
+ files.Add(fi);
+ }
+ }
+
+ DirPrefix = pathPrefix;
+
+ _files = files;
+
+ SetItemText(IDT_BROWSE_FOLDER, DirPrefix);
+
+ _list.SetRedraw(false);
+ _list.DeleteAllItems();
+
+ LVITEMW item;
+
+ int index = 0;
+ int cursorIndex = -1;
+
+ #ifndef _SFX
+ if (_showDots && _topDirPrefix != DirPrefix)
+ {
+ item.iItem = index;
+ const UString itemName ("..");
+ if (selectedName.IsEmpty())
+ cursorIndex = index;
+ item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
+ int subItem = 0;
+ item.iSubItem = subItem++;
+ item.lParam = kParentIndex;
+ item.pszText = (wchar_t *)(const wchar_t *)itemName;
+ item.iImage = _extToIconMap.GetIconIndex(FILE_ATTRIBUTE_DIRECTORY, DirPrefix);
+ if (item.iImage < 0)
+ item.iImage = 0;
+ _list.InsertItem(&item);
+ _list.SetSubItem(index, subItem++, L"");
+ _list.SetSubItem(index, subItem++, L"");
+ index++;
+ }
+ #endif
+
+ for (unsigned i = 0; i < _files.Size(); i++, index++)
+ {
+ item.iItem = index;
+ const CFileInfo &fi = _files[i];
+ const UString name = fs2us(fi.Name);
+ if (!selectedName.IsEmpty() && CompareFileNames(name, selectedName) == 0)
+ cursorIndex = index;
+ item.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
+ int subItem = 0;
+ item.iSubItem = subItem++;
+ item.lParam = i;
+ item.pszText = (wchar_t *)(const wchar_t *)name;
+
+ const UString fullPath = DirPrefix + name;
+ #ifndef UNDER_CE
+ if (isDrive)
+ {
+ if (GetRealIconIndex(fi.Name + FCHAR_PATH_SEPARATOR, FILE_ATTRIBUTE_DIRECTORY, item.iImage) == 0)
+ item.iImage = 0;
+ }
+ else
+ #endif
+ item.iImage = _extToIconMap.GetIconIndex(fi.Attrib, fullPath);
+ if (item.iImage < 0)
+ item.iImage = 0;
+ _list.InsertItem(&item);
+ wchar_t s[32];
+ {
+ s[0] = 0;
+ ConvertUtcFileTimeToString(fi.MTime, s,
+ #ifndef UNDER_CE
+ kTimestampPrintLevel_MIN
+ #else
+ kTimestampPrintLevel_DAY
+ #endif
+ );
+ _list.SetSubItem(index, subItem++, s);
+ }
+ {
+ s[0] = 0;
+ if (!fi.IsDir())
+ ConvertSizeToString(fi.Size, s);
+ _list.SetSubItem(index, subItem++, s);
+ }
+ }
+
+ if (_list.GetItemCount() > 0 && cursorIndex >= 0)
+ _list.SetItemState_FocusedSelected(cursorIndex);
+ _list.SortItems(CompareItems2, (LPARAM)this);
+ if (_list.GetItemCount() > 0 && cursorIndex < 0)
+ _list.SetItemState(0, LVIS_FOCUSED, LVIS_FOCUSED);
+ _list.EnsureVisible(_list.GetFocusedItem(), false);
+ _list.SetRedraw(true);
+ _list.InvalidateRect(NULL, true);
+ return S_OK;
+}
+
+HRESULT CBrowseDialog::Reload()
+{
+ UString selected;
+ int index = _list.GetNextSelectedItem(-1);
+ if (index >= 0)
+ {
+ int fileIndex = GetRealItemIndex(index);
+ if (fileIndex != kParentIndex)
+ selected = fs2us(_files[fileIndex].Name);
+ }
+ UString dirPathTemp = DirPrefix;
+ return Reload(dirPathTemp, selected);
+}
+
+void CBrowseDialog::OpenParentFolder()
+{
+ UString parent, selected;
+ if (GetParentPath(DirPrefix, parent, selected))
+ {
+ Reload(parent, selected);
+ SetPathEditText();
+ }
+}
+
+void CBrowseDialog::SetPathEditText()
+{
+ int index = _list.GetNextSelectedItem(-1);
+ if (index < 0)
+ {
+ if (FolderMode)
+ _pathEdit.SetText(DirPrefix);
+ return;
+ }
+ int fileIndex = GetRealItemIndex(index);
+ if (fileIndex == kParentIndex)
+ {
+ if (FolderMode)
+ _pathEdit.SetText(L".." WSTRING_PATH_SEPARATOR);
+ return;
+ }
+ const CFileInfo &file = _files[fileIndex];
+ if (file.IsDir())
+ {
+ if (!FolderMode)
+ return;
+ _pathEdit.SetText(fs2us(file.Name) + WCHAR_PATH_SEPARATOR);
+ }
+ else
+ _pathEdit.SetText(fs2us(file.Name));
+}
+
+void CBrowseDialog::OnCreateDir()
+{
+ UString name;
+ {
+ UString enteredName;
+ Dlg_CreateFolder((HWND)*this, enteredName);
+ if (enteredName.IsEmpty())
+ return;
+ if (!CorrectFsPath(DirPrefix, enteredName, name))
+ {
+ MessageBox_HResError((HWND)*this, ERROR_INVALID_NAME, name);
+ return;
+ }
+ }
+ if (name.IsEmpty())
+ return;
+
+ FString destPath;
+ if (GetFullPath(us2fs(DirPrefix), us2fs(name), destPath))
+ {
+ if (!NDir::CreateComplexDir(destPath))
+ {
+ MessageBox_HResError((HWND)*this, GetNormalizedError(), fs2us(destPath));
+ }
+ else
+ {
+ UString tempPath = DirPrefix;
+ Reload(tempPath, name);
+ SetPathEditText();
+ }
+ _list.SetFocus();
+ }
+}
+
+void CBrowseDialog::OnItemEnter()
+{
+ int index = _list.GetNextSelectedItem(-1);
+ if (index < 0)
+ return;
+ int fileIndex = GetRealItemIndex(index);
+ if (fileIndex == kParentIndex)
+ OpenParentFolder();
+ else
+ {
+ const CFileInfo &file = _files[fileIndex];
+ if (!file.IsDir())
+ {
+ if (!FolderMode)
+ FinishOnOK();
+ /*
+ MessageBox_Error_Global(*this, FolderMode ?
+ L"You must select some folder":
+ L"You must select some file");
+ */
+ return;
+ }
+ UString s = DirPrefix;
+ s += fs2us(file.Name);
+ s.Add_PathSepar();
+ HRESULT res = Reload(s, UString());
+ if (res != S_OK)
+ MessageBox_HResError(*this, res, s);
+ SetPathEditText();
+ }
+}
+
+void CBrowseDialog::FinishOnOK()
+{
+ UString s;
+ _pathEdit.GetText(s);
+ FString destPath;
+ if (!GetFullPath(us2fs(DirPrefix), us2fs(s), destPath))
+ {
+ MessageBox_HResError((HWND)*this, ERROR_INVALID_NAME, s);
+ return;
+ }
+ FilePath = fs2us(destPath);
+ if (FolderMode)
+ NormalizeDirPathPrefix(FilePath);
+ End(IDOK);
+}
+
+#endif
+
+bool MyBrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR path, UString &resultPath)
+{
+ resultPath.Empty();
+
+ #ifndef UNDER_CE
+
+ #ifdef USE_MY_BROWSE_DIALOG
+ if (!IsSuperOrDevicePath(path))
+ #endif
+ return NShell::BrowseForFolder(owner, title, path, resultPath);
+
+ #endif
+
+ #ifdef USE_MY_BROWSE_DIALOG
+
+ CBrowseDialog dialog;
+ dialog.FolderMode = true;
+ if (title)
+ dialog.Title = title;
+ if (path)
+ dialog.FilePath = path;
+ if (dialog.Create(owner) != IDOK)
+ return false;
+ resultPath = dialog.FilePath;
+ #endif
+
+ return true;
+}
+
+bool MyBrowseForFile(HWND owner, LPCWSTR title, LPCWSTR path,
+ LPCWSTR filterDescription, LPCWSTR filter, UString &resultPath)
+{
+ resultPath.Empty();
+
+ #ifndef UNDER_CE
+
+ #ifdef USE_MY_BROWSE_DIALOG
+ if (!IsSuperOrDevicePath(path))
+ #endif
+ {
+ if (MyGetOpenFileName(owner, title, NULL, path, filterDescription, filter, resultPath))
+ return true;
+ #ifdef UNDER_CE
+ return false;
+ #else
+ // maybe we must use GetLastError in WinCE.
+ DWORD errorCode = CommDlgExtendedError();
+ const char *errorMessage = NULL;
+ switch (errorCode)
+ {
+ case 0: return false; // cancel or close obn dialog
+ case FNERR_INVALIDFILENAME: errorMessage = "Invalid File Name"; break;
+ default: errorMessage = "Open Dialog Error";
+ }
+ if (!errorMessage)
+ return false;
+ {
+ UString s (errorMessage);
+ s.Add_LF();
+ s += path;
+ MessageBox_Error_Global(owner, s);
+ }
+ #endif
+ }
+
+ #endif
+
+ #ifdef USE_MY_BROWSE_DIALOG
+ CBrowseDialog dialog;
+ if (title)
+ dialog.Title = title;
+ if (path)
+ dialog.FilePath = path;
+ dialog.FolderMode = false;
+ if (filter)
+ dialog.SetFilter(filter);
+ if (filterDescription)
+ dialog.FilterDescription = filterDescription;
+ if (dialog.Create(owner) != IDOK)
+ return false;
+ resultPath = dialog.FilePath;
+ #endif
+
+ return true;
+}
+
+
+#ifdef _WIN32
+
+static void RemoveDotsAndSpaces(UString &path)
+{
+ while (!path.IsEmpty())
+ {
+ wchar_t c = path.Back();
+ if (c != ' ' && c != '.')
+ return;
+ path.DeleteBack();
+ }
+}
+
+
+bool CorrectFsPath(const UString &relBase, const UString &path2, UString &result)
+{
+ result.Empty();
+
+ UString path = path2;
+ path.Replace(L'/', WCHAR_PATH_SEPARATOR);
+ unsigned start = 0;
+ UString base;
+
+ if (IsAbsolutePath(path))
+ {
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (IsSuperOrDevicePath(path))
+ {
+ result = path;
+ return true;
+ }
+ #endif
+ int pos = GetRootPrefixSize(path);
+ if (pos > 0)
+ start = pos;
+ }
+ else
+ {
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (IsSuperOrDevicePath(relBase))
+ {
+ result = path;
+ return true;
+ }
+ #endif
+ base = relBase;
+ }
+
+ /* We can't use backward, since we must change only disk paths */
+ /*
+ for (;;)
+ {
+ if (path.Len() <= start)
+ break;
+ if (DoesFileOrDirExist(us2fs(path)))
+ break;
+ if (path.Back() == WCHAR_PATH_SEPARATOR)
+ {
+ path.DeleteBack();
+ result.Insert(0, WCHAR_PATH_SEPARATOR);;
+ }
+ int pos = path.ReverseFind(WCHAR_PATH_SEPARATOR) + 1;
+ UString cur = path.Ptr(pos);
+ RemoveDotsAndSpaces(cur);
+ result.Insert(0, cur);
+ path.DeleteFrom(pos);
+ }
+ result.Insert(0, path);
+ return true;
+ */
+
+ result += path.Left(start);
+ bool checkExist = true;
+ UString cur;
+
+ for (;;)
+ {
+ if (start == path.Len())
+ break;
+ int slashPos = path.Find(WCHAR_PATH_SEPARATOR, start);
+ cur.SetFrom(path.Ptr(start), (slashPos < 0 ? path.Len() : slashPos) - start);
+ if (checkExist)
+ {
+ CFileInfo fi;
+ if (fi.Find(us2fs(base + result + cur)))
+ {
+ if (!fi.IsDir())
+ {
+ result = path;
+ break;
+ }
+ }
+ else
+ checkExist = false;
+ }
+ if (!checkExist)
+ RemoveDotsAndSpaces(cur);
+ result += cur;
+ if (slashPos < 0)
+ break;
+ result.Add_PathSepar();
+ start = slashPos + 1;
+ }
+
+ return true;
+}
+
+#else
+
+bool CorrectFsPath(const UString & /* relBase */, const UString &path, UString &result)
+{
+ result = path;
+ return true;
+}
+
+#endif
+
+bool Dlg_CreateFolder(HWND wnd, UString &destName)
+{
+ destName.Empty();
+ CComboDialog dlg;
+ LangString(IDS_CREATE_FOLDER, dlg.Title);
+ LangString(IDS_CREATE_FOLDER_NAME, dlg.Static);
+ LangString(IDS_CREATE_FOLDER_DEFAULT_NAME, dlg.Value);
+ if (dlg.Create(wnd) != IDOK)
+ return false;
+ destName = dlg.Value;
+ return true;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.h
new file mode 100644
index 0000000000..be51085bfa
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialog.h
@@ -0,0 +1,21 @@
+// BrowseDialog.h
+
+#ifndef __BROWSE_DIALOG_H
+#define __BROWSE_DIALOG_H
+
+#include "../../../Common/MyString.h"
+
+bool MyBrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR path, UString &resultPath);
+bool MyBrowseForFile(HWND owner, LPCWSTR title, LPCWSTR path, LPCWSTR filterDescription, LPCWSTR filter, UString &resultPath);
+
+/* CorrectFsPath removes undesirable characters in names (dots and spaces at the end of file)
+ But it doesn't change "bad" name in any of the following cases:
+ - path is Super Path (with \\?\ prefix)
+ - path is relative and relBase is Super Path
+ - there is file or dir in filesystem with specified "bad" name */
+
+bool CorrectFsPath(const UString &relBase, const UString &path, UString &result);
+
+bool Dlg_CreateFolder(HWND wnd, UString &destName);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialogRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialogRes.h
new file mode 100644
index 0000000000..f211b7374b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/BrowseDialogRes.h
@@ -0,0 +1,9 @@
+#define IDD_BROWSE 95
+
+#define IDL_BROWSE 100
+#define IDT_BROWSE_FOLDER 101
+#define IDE_BROWSE_PATH 102
+#define IDC_BROWSE_FILTER 103
+
+#define IDB_BROWSE_PARENT 110
+#define IDB_BROWSE_CREATE_DIR 112
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.cpp
new file mode 100644
index 0000000000..e846c56134
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.cpp
@@ -0,0 +1,64 @@
+// ComboDialog.cpp
+
+#include "StdAfx.h"
+#include "ComboDialog.h"
+
+#include "../../../Windows/Control/Static.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+using namespace NWindows;
+
+bool CComboDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetDlgItems(*this, NULL, 0);
+ #endif
+ _comboBox.Attach(GetItem(IDC_COMBO));
+
+ /*
+ // why it doesn't work ?
+ DWORD style = _comboBox.GetStyle();
+ if (Sorted)
+ style |= CBS_SORT;
+ else
+ style &= ~CBS_SORT;
+ _comboBox.SetStyle(style);
+ */
+ SetText(Title);
+
+ NControl::CStatic staticContol;
+ staticContol.Attach(GetItem(IDT_COMBO));
+ staticContol.SetText(Static);
+ _comboBox.SetText(Value);
+ FOR_VECTOR (i, Strings)
+ _comboBox.AddString(Strings[i]);
+ NormalizeSize();
+ return CModalDialog::OnInit();
+}
+
+bool CComboDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
+{
+ int mx, my;
+ GetMargins(8, mx, my);
+ int bx1, bx2, by;
+ GetItemSizes(IDCANCEL, bx1, by);
+ GetItemSizes(IDOK, bx2, by);
+ int y = ySize - my - by;
+ int x = xSize - mx - bx1;
+
+ InvalidateRect(NULL);
+
+ MoveItem(IDCANCEL, x, y, bx1, by);
+ MoveItem(IDOK, x - mx - bx2, y, bx2, by);
+ ChangeSubWindowSizeX(_comboBox, xSize - mx * 2);
+ return false;
+}
+
+void CComboDialog::OnOK()
+{
+ _comboBox.GetText(Value);
+ CModalDialog::OnOK();
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.h
new file mode 100644
index 0000000000..6869cff703
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialog.h
@@ -0,0 +1,28 @@
+// ComboDialog.h
+
+#ifndef __COMBO_DIALOG_H
+#define __COMBO_DIALOG_H
+
+#include "../../../Windows/Control/ComboBox.h"
+#include "../../../Windows/Control/Dialog.h"
+
+#include "ComboDialogRes.h"
+
+class CComboDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CComboBox _comboBox;
+ virtual void OnOK();
+ virtual bool OnInit();
+ virtual bool OnSize(WPARAM wParam, int xSize, int ySize);
+public:
+ // bool Sorted;
+ UString Title;
+ UString Static;
+ UString Value;
+ UStringVector Strings;
+
+ // CComboDialog(): Sorted(false) {};
+ INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_COMBO, parentWindow); }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialogRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialogRes.h
new file mode 100644
index 0000000000..98938b63bc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ComboDialogRes.h
@@ -0,0 +1,4 @@
+#define IDD_COMBO 98
+
+#define IDT_COMBO 100
+#define IDC_COMBO 101
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/DialogSize.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/DialogSize.h
new file mode 100644
index 0000000000..bbce15982b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/DialogSize.h
@@ -0,0 +1,16 @@
+// DialogSize.h
+
+#ifndef __DIALOG_SIZE_H
+#define __DIALOG_SIZE_H
+
+#include "../../../Windows/Control/Dialog.h"
+
+#ifdef UNDER_CE
+#define BIG_DIALOG_SIZE(x, y) bool isBig = NWindows::NControl::IsDialogSizeOK(x, y);
+#define SIZED_DIALOG(big) (isBig ? big : big ## _2)
+#else
+#define BIG_DIALOG_SIZE(x, y)
+#define SIZED_DIALOG(big) big
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.cpp
new file mode 100644
index 0000000000..6433e917dc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.cpp
@@ -0,0 +1,1033 @@
+// ExtractCallback.cpp
+
+#include "StdAfx.h"
+
+
+#include "../../../Common/ComTry.h"
+#include "../../../Common/IntToString.h"
+#include "../../../Common/Lang.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/PropVariantConv.h"
+
+#include "../../Common/FilePathAutoRename.h"
+#include "../../Common/StreamUtils.h"
+#include "../Common/ExtractingFilePath.h"
+
+#ifndef _SFX
+#include "../Common/ZipRegistry.h"
+#endif
+
+#include "../GUI/ExtractRes.h"
+#include "resourceGui.h"
+
+#include "ExtractCallback.h"
+#include "FormatUtils.h"
+#include "LangUtils.h"
+#include "OverwriteDialog.h"
+#ifndef _NO_CRYPTO
+#include "PasswordDialog.h"
+#endif
+#include "PropertyName.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NFind;
+
+CExtractCallbackImp::~CExtractCallbackImp() {}
+
+void CExtractCallbackImp::Init()
+{
+ _lang_Extracting = LangString(IDS_PROGRESS_EXTRACTING);
+ _lang_Testing = LangString(IDS_PROGRESS_TESTING);
+ _lang_Skipping = LangString(IDS_PROGRESS_SKIPPING);
+
+ NumArchiveErrors = 0;
+ ThereAreMessageErrors = false;
+ #ifndef _SFX
+ NumFolders = NumFiles = 0;
+ NeedAddFile = false;
+ #endif
+}
+
+void CExtractCallbackImp::AddError_Message(LPCWSTR s)
+{
+ ThereAreMessageErrors = true;
+ ProgressDialog->Sync.AddError_Message(s);
+}
+
+#ifndef _SFX
+
+STDMETHODIMP CExtractCallbackImp::SetNumFiles(UInt64
+ #ifndef _SFX
+ numFiles
+ #endif
+ )
+{
+ #ifndef _SFX
+ ProgressDialog->Sync.Set_NumFilesTotal(numFiles);
+ #endif
+ return S_OK;
+}
+
+#endif
+
+STDMETHODIMP CExtractCallbackImp::SetTotal(UInt64 total)
+{
+ ProgressDialog->Sync.Set_NumBytesTotal(total);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetCompleted(const UInt64 *value)
+{
+ return ProgressDialog->Sync.Set_NumBytesCur(value);
+}
+
+HRESULT CExtractCallbackImp::Open_CheckBreak()
+{
+ return ProgressDialog->Sync.CheckStop();
+}
+
+HRESULT CExtractCallbackImp::Open_SetTotal(const UInt64 *files, const UInt64 *bytes)
+{
+ HRESULT res = S_OK;
+ if (!MultiArcMode)
+ {
+ if (files)
+ {
+ _totalFilesDefined = true;
+ // res = ProgressDialog->Sync.Set_NumFilesTotal(*files);
+ }
+ else
+ _totalFilesDefined = false;
+
+ if (bytes)
+ {
+ _totalBytesDefined = true;
+ ProgressDialog->Sync.Set_NumBytesTotal(*bytes);
+ }
+ else
+ _totalBytesDefined = false;
+ }
+
+ return res;
+}
+
+HRESULT CExtractCallbackImp::Open_SetCompleted(const UInt64 *files, const UInt64 *bytes)
+{
+ if (!MultiArcMode)
+ {
+ if (files)
+ {
+ ProgressDialog->Sync.Set_NumFilesCur(*files);
+ }
+
+ if (bytes)
+ {
+ }
+ }
+
+ return ProgressDialog->Sync.CheckStop();
+}
+
+HRESULT CExtractCallbackImp::Open_Finished()
+{
+ return ProgressDialog->Sync.CheckStop();
+}
+
+#ifndef _NO_CRYPTO
+
+HRESULT CExtractCallbackImp::Open_CryptoGetTextPassword(BSTR *password)
+{
+ return CryptoGetTextPassword(password);
+}
+
+/*
+HRESULT CExtractCallbackImp::Open_GetPasswordIfAny(bool &passwordIsDefined, UString &password)
+{
+ passwordIsDefined = PasswordIsDefined;
+ password = Password;
+ return S_OK;
+}
+
+bool CExtractCallbackImp::Open_WasPasswordAsked()
+{
+ return PasswordWasAsked;
+}
+
+void CExtractCallbackImp::Open_Clear_PasswordWasAsked_Flag()
+{
+ PasswordWasAsked = false;
+}
+*/
+
+#endif
+
+
+#ifndef _SFX
+STDMETHODIMP CExtractCallbackImp::SetRatioInfo(const UInt64 *inSize, const UInt64 *outSize)
+{
+ ProgressDialog->Sync.Set_Ratio(inSize, outSize);
+ return S_OK;
+}
+#endif
+
+/*
+STDMETHODIMP CExtractCallbackImp::SetTotalFiles(UInt64 total)
+{
+ ProgressDialog->Sync.SetNumFilesTotal(total);
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::SetCompletedFiles(const UInt64 *value)
+{
+ if (value != NULL)
+ ProgressDialog->Sync.SetNumFilesCur(*value);
+ return S_OK;
+}
+*/
+
+STDMETHODIMP CExtractCallbackImp::AskOverwrite(
+ const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
+ const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
+ Int32 *answer)
+{
+ COverwriteDialog dialog;
+
+ dialog.OldFileInfo.SetTime(existTime);
+ dialog.OldFileInfo.SetSize(existSize);
+ dialog.OldFileInfo.Name = existName;
+
+ dialog.NewFileInfo.SetTime(newTime);
+ dialog.NewFileInfo.SetSize(newSize);
+ dialog.NewFileInfo.Name = newName;
+
+ ProgressDialog->WaitCreating();
+ INT_PTR writeAnswer = dialog.Create(*ProgressDialog);
+
+ switch (writeAnswer)
+ {
+ case IDCANCEL: *answer = NOverwriteAnswer::kCancel; return E_ABORT;
+ case IDYES: *answer = NOverwriteAnswer::kYes; break;
+ case IDNO: *answer = NOverwriteAnswer::kNo; break;
+ case IDB_YES_TO_ALL: *answer = NOverwriteAnswer::kYesToAll; break;
+ case IDB_NO_TO_ALL: *answer = NOverwriteAnswer::kNoToAll; break;
+ case IDB_AUTO_RENAME: *answer = NOverwriteAnswer::kAutoRename; break;
+ default: return E_FAIL;
+ }
+ return S_OK;
+}
+
+
+STDMETHODIMP CExtractCallbackImp::PrepareOperation(const wchar_t *name, Int32 isFolder, Int32 askExtractMode, const UInt64 * /* position */)
+{
+ _isFolder = IntToBool(isFolder);
+ _currentFilePath = name;
+
+ const UString *msg = &_lang_Empty;
+ switch (askExtractMode)
+ {
+ case NArchive::NExtract::NAskMode::kExtract: msg = &_lang_Extracting; break;
+ case NArchive::NExtract::NAskMode::kTest: msg = &_lang_Testing; break;
+ case NArchive::NExtract::NAskMode::kSkip: msg = &_lang_Skipping; break;
+ // default: s = "Unknown operation";
+ }
+
+ return ProgressDialog->Sync.Set_Status2(*msg, name, IntToBool(isFolder));
+}
+
+STDMETHODIMP CExtractCallbackImp::MessageError(const wchar_t *s)
+{
+ AddError_Message(s);
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::MessageError(const char *message, const FString &path)
+{
+ ThereAreMessageErrors = true;
+ ProgressDialog->Sync.AddError_Message_Name(GetUnicodeString(message), fs2us(path));
+ return S_OK;
+}
+
+#ifndef _SFX
+
+STDMETHODIMP CExtractCallbackImp::ShowMessage(const wchar_t *s)
+{
+ AddError_Message(s);
+ return S_OK;
+}
+
+#endif
+
+void SetExtractErrorMessage(Int32 opRes, Int32 encrypted, const wchar_t *fileName, UString &s)
+{
+ s.Empty();
+
+ if (opRes == NArchive::NExtract::NOperationResult::kOK)
+ return;
+
+ UINT messageID = 0;
+ UINT id = 0;
+
+ switch (opRes)
+ {
+ case NArchive::NExtract::NOperationResult::kUnsupportedMethod:
+ messageID = IDS_EXTRACT_MESSAGE_UNSUPPORTED_METHOD;
+ id = IDS_EXTRACT_MSG_UNSUPPORTED_METHOD;
+ break;
+ case NArchive::NExtract::NOperationResult::kDataError:
+ messageID = encrypted ?
+ IDS_EXTRACT_MESSAGE_DATA_ERROR_ENCRYPTED:
+ IDS_EXTRACT_MESSAGE_DATA_ERROR;
+ id = IDS_EXTRACT_MSG_DATA_ERROR;
+ break;
+ case NArchive::NExtract::NOperationResult::kCRCError:
+ messageID = encrypted ?
+ IDS_EXTRACT_MESSAGE_CRC_ERROR_ENCRYPTED:
+ IDS_EXTRACT_MESSAGE_CRC_ERROR;
+ id = IDS_EXTRACT_MSG_CRC_ERROR;
+ break;
+ case NArchive::NExtract::NOperationResult::kUnavailable:
+ id = IDS_EXTRACT_MSG_UNAVAILABLE_DATA;
+ break;
+ case NArchive::NExtract::NOperationResult::kUnexpectedEnd:
+ id = IDS_EXTRACT_MSG_UEXPECTED_END;
+ break;
+ case NArchive::NExtract::NOperationResult::kDataAfterEnd:
+ id = IDS_EXTRACT_MSG_DATA_AFTER_END;
+ break;
+ case NArchive::NExtract::NOperationResult::kIsNotArc:
+ id = IDS_EXTRACT_MSG_IS_NOT_ARC;
+ break;
+ case NArchive::NExtract::NOperationResult::kHeadersError:
+ id = IDS_EXTRACT_MSG_HEADERS_ERROR;
+ break;
+ case NArchive::NExtract::NOperationResult::kWrongPassword:
+ id = IDS_EXTRACT_MSG_WRONG_PSW_CLAIM;
+ break;
+ /*
+ default:
+ messageID = IDS_EXTRACT_MESSAGE_UNKNOWN_ERROR;
+ break;
+ */
+ }
+
+ UString msg;
+ UString msgOld;
+
+ #ifndef _SFX
+ if (id != 0)
+ LangString_OnlyFromLangFile(id, msg);
+ if (messageID != 0 && msg.IsEmpty())
+ LangString_OnlyFromLangFile(messageID, msgOld);
+ #endif
+
+ if (msg.IsEmpty() && !msgOld.IsEmpty())
+ s = MyFormatNew(msgOld, fileName);
+ else
+ {
+ if (msg.IsEmpty() && id != 0)
+ LangString(id, msg);
+ if (!msg.IsEmpty())
+ s += msg;
+ else
+ {
+ s += "Error #";
+ s.Add_UInt32(opRes);
+ }
+
+ if (encrypted && opRes != NArchive::NExtract::NOperationResult::kWrongPassword)
+ {
+ // s += " : ";
+ // AddLangString(s, IDS_EXTRACT_MSG_ENCRYPTED);
+ s += " : ";
+ AddLangString(s, IDS_EXTRACT_MSG_WRONG_PSW_GUESS);
+ }
+ s += " : ";
+ s += fileName;
+ }
+}
+
+STDMETHODIMP CExtractCallbackImp::SetOperationResult(Int32 opRes, Int32 encrypted)
+{
+ switch (opRes)
+ {
+ case NArchive::NExtract::NOperationResult::kOK:
+ break;
+ default:
+ {
+ UString s;
+ SetExtractErrorMessage(opRes, encrypted, _currentFilePath, s);
+ Add_ArchiveName_Error();
+ AddError_Message(s);
+ }
+ }
+
+ #ifndef _SFX
+ if (_isFolder)
+ NumFolders++;
+ else
+ NumFiles++;
+ ProgressDialog->Sync.Set_NumFilesCur(NumFiles);
+ #endif
+
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::ReportExtractResult(Int32 opRes, Int32 encrypted, const wchar_t *name)
+{
+ if (opRes != NArchive::NExtract::NOperationResult::kOK)
+ {
+ UString s;
+ SetExtractErrorMessage(opRes, encrypted, name, s);
+ Add_ArchiveName_Error();
+ AddError_Message(s);
+ }
+ return S_OK;
+}
+
+////////////////////////////////////////
+// IExtractCallbackUI
+
+HRESULT CExtractCallbackImp::BeforeOpen(const wchar_t *name, bool /* testMode */)
+{
+ #ifndef _SFX
+ RINOK(ProgressDialog->Sync.CheckStop());
+ ProgressDialog->Sync.Set_TitleFileName(name);
+ #endif
+ _currentArchivePath = name;
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::SetCurrentFilePath2(const wchar_t *path)
+{
+ _currentFilePath = path;
+ #ifndef _SFX
+ ProgressDialog->Sync.Set_FilePath(path);
+ #endif
+ return S_OK;
+}
+
+#ifndef _SFX
+
+HRESULT CExtractCallbackImp::SetCurrentFilePath(const wchar_t *path)
+{
+ #ifndef _SFX
+ if (NeedAddFile)
+ NumFiles++;
+ NeedAddFile = true;
+ ProgressDialog->Sync.Set_NumFilesCur(NumFiles);
+ #endif
+ return SetCurrentFilePath2(path);
+}
+
+#endif
+
+UString HResultToMessage(HRESULT errorCode);
+
+static const UInt32 k_ErrorFlagsIds[] =
+{
+ IDS_EXTRACT_MSG_IS_NOT_ARC,
+ IDS_EXTRACT_MSG_HEADERS_ERROR,
+ IDS_EXTRACT_MSG_HEADERS_ERROR,
+ IDS_OPEN_MSG_UNAVAILABLE_START,
+ IDS_OPEN_MSG_UNCONFIRMED_START,
+ IDS_EXTRACT_MSG_UEXPECTED_END,
+ IDS_EXTRACT_MSG_DATA_AFTER_END,
+ IDS_EXTRACT_MSG_UNSUPPORTED_METHOD,
+ IDS_OPEN_MSG_UNSUPPORTED_FEATURE,
+ IDS_EXTRACT_MSG_DATA_ERROR,
+ IDS_EXTRACT_MSG_CRC_ERROR
+};
+
+static void AddNewLineString(UString &s, const UString &m)
+{
+ s += m;
+ s.Add_LF();
+}
+
+UString GetOpenArcErrorMessage(UInt32 errorFlags)
+{
+ UString s;
+
+ for (unsigned i = 0; i < ARRAY_SIZE(k_ErrorFlagsIds); i++)
+ {
+ UInt32 f = ((UInt32)1 << i);
+ if ((errorFlags & f) == 0)
+ continue;
+ UInt32 id = k_ErrorFlagsIds[i];
+ UString m = LangString(id);
+ if (m.IsEmpty())
+ continue;
+ if (f == kpv_ErrorFlags_EncryptedHeadersError)
+ {
+ m += " : ";
+ AddLangString(m, IDS_EXTRACT_MSG_WRONG_PSW_GUESS);
+ }
+ if (!s.IsEmpty())
+ s.Add_LF();
+ s += m;
+ errorFlags &= ~f;
+ }
+
+ if (errorFlags != 0)
+ {
+ char sz[16];
+ sz[0] = '0';
+ sz[1] = 'x';
+ ConvertUInt32ToHex(errorFlags, sz + 2);
+ if (!s.IsEmpty())
+ s.Add_LF();
+ s += sz;
+ }
+
+ return s;
+}
+
+static void ErrorInfo_Print(UString &s, const CArcErrorInfo &er)
+{
+ UInt32 errorFlags = er.GetErrorFlags();
+ UInt32 warningFlags = er.GetWarningFlags();
+
+ if (errorFlags != 0)
+ AddNewLineString(s, GetOpenArcErrorMessage(errorFlags));
+
+ if (!er.ErrorMessage.IsEmpty())
+ AddNewLineString(s, er.ErrorMessage);
+
+ if (warningFlags != 0)
+ {
+ s += GetNameOfProperty(kpidWarningFlags, L"Warnings");
+ s += ":";
+ s.Add_LF();
+ AddNewLineString(s, GetOpenArcErrorMessage(warningFlags));
+ }
+
+ if (!er.WarningMessage.IsEmpty())
+ {
+ s += GetNameOfProperty(kpidWarning, L"Warning");
+ s += ": ";
+ s += er.WarningMessage;
+ s.Add_LF();
+ }
+}
+
+static UString GetBracedType(const wchar_t *type)
+{
+ UString s ('[');
+ s += type;
+ s += ']';
+ return s;
+}
+
+void OpenResult_GUI(UString &s, const CCodecs *codecs, const CArchiveLink &arcLink, const wchar_t *name, HRESULT result)
+{
+ FOR_VECTOR (level, arcLink.Arcs)
+ {
+ const CArc &arc = arcLink.Arcs[level];
+ const CArcErrorInfo &er = arc.ErrorInfo;
+
+ if (!er.IsThereErrorOrWarning() && er.ErrorFormatIndex < 0)
+ continue;
+
+ if (s.IsEmpty())
+ {
+ s += name;
+ s.Add_LF();
+ }
+
+ if (level != 0)
+ {
+ AddNewLineString(s, arc.Path);
+ }
+
+ ErrorInfo_Print(s, er);
+
+ if (er.ErrorFormatIndex >= 0)
+ {
+ AddNewLineString(s, GetNameOfProperty(kpidWarning, L"Warning"));
+ if (arc.FormatIndex == er.ErrorFormatIndex)
+ {
+ AddNewLineString(s, LangString(IDS_IS_OPEN_WITH_OFFSET));
+ }
+ else
+ {
+ AddNewLineString(s, MyFormatNew(IDS_CANT_OPEN_AS_TYPE, GetBracedType(codecs->GetFormatNamePtr(er.ErrorFormatIndex))));
+ AddNewLineString(s, MyFormatNew(IDS_IS_OPEN_AS_TYPE, GetBracedType(codecs->GetFormatNamePtr(arc.FormatIndex))));
+ }
+ }
+ }
+
+ if (arcLink.NonOpen_ErrorInfo.ErrorFormatIndex >= 0 || result != S_OK)
+ {
+ s += name;
+ s.Add_LF();
+ if (!arcLink.Arcs.IsEmpty())
+ AddNewLineString(s, arcLink.NonOpen_ArcPath);
+
+ if (arcLink.NonOpen_ErrorInfo.ErrorFormatIndex >= 0 || result == S_FALSE)
+ {
+ UINT id = IDS_CANT_OPEN_ARCHIVE;
+ UString param;
+ if (arcLink.PasswordWasAsked)
+ id = IDS_CANT_OPEN_ENCRYPTED_ARCHIVE;
+ else if (arcLink.NonOpen_ErrorInfo.ErrorFormatIndex >= 0)
+ {
+ id = IDS_CANT_OPEN_AS_TYPE;
+ param = GetBracedType(codecs->GetFormatNamePtr(arcLink.NonOpen_ErrorInfo.ErrorFormatIndex));
+ }
+ UString s2 = MyFormatNew(id, param);
+ s2.Replace(L" ''", L"");
+ s2.Replace(L"''", L"");
+ s += s2;
+ }
+ else
+ s += HResultToMessage(result);
+
+ s.Add_LF();
+ ErrorInfo_Print(s, arcLink.NonOpen_ErrorInfo);
+ }
+
+ if (!s.IsEmpty() && s.Back() == '\n')
+ s.DeleteBack();
+}
+
+HRESULT CExtractCallbackImp::OpenResult(const CCodecs *codecs, const CArchiveLink &arcLink, const wchar_t *name, HRESULT result)
+{
+ _currentArchivePath = name;
+ _needWriteArchivePath = true;
+
+ UString s;
+ OpenResult_GUI(s, codecs, arcLink, name, result);
+ if (!s.IsEmpty())
+ {
+ NumArchiveErrors++;
+ AddError_Message(s);
+ _needWriteArchivePath = false;
+ }
+
+ return S_OK;
+}
+
+HRESULT CExtractCallbackImp::ThereAreNoFiles()
+{
+ return S_OK;
+}
+
+void CExtractCallbackImp::Add_ArchiveName_Error()
+{
+ if (_needWriteArchivePath)
+ {
+ if (!_currentArchivePath.IsEmpty())
+ AddError_Message(_currentArchivePath);
+ _needWriteArchivePath = false;
+ }
+}
+
+HRESULT CExtractCallbackImp::ExtractResult(HRESULT result)
+{
+ if (result == S_OK)
+ return result;
+ NumArchiveErrors++;
+ if (result == E_ABORT || result == ERROR_DISK_FULL)
+ return result;
+
+ Add_ArchiveName_Error();
+ if (!_currentFilePath.IsEmpty())
+ MessageError(_currentFilePath);
+ MessageError(NError::MyFormatMessage(result));
+ return S_OK;
+}
+
+#ifndef _NO_CRYPTO
+
+HRESULT CExtractCallbackImp::SetPassword(const UString &password)
+{
+ PasswordIsDefined = true;
+ Password = password;
+ return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackImp::CryptoGetTextPassword(BSTR *password)
+{
+ PasswordWasAsked = true;
+ if (!PasswordIsDefined)
+ {
+ CPasswordDialog dialog;
+ #ifndef _SFX
+ bool showPassword = NExtract::Read_ShowPassword();
+ dialog.ShowPassword = showPassword;
+ #endif
+ ProgressDialog->WaitCreating();
+ if (dialog.Create(*ProgressDialog) != IDOK)
+ return E_ABORT;
+ Password = dialog.Password;
+ PasswordIsDefined = true;
+ #ifndef _SFX
+ if (dialog.ShowPassword != showPassword)
+ NExtract::Save_ShowPassword(dialog.ShowPassword);
+ #endif
+ }
+ return StringToBstr(Password, password);
+}
+
+#endif
+
+#ifndef _SFX
+
+STDMETHODIMP CExtractCallbackImp::AskWrite(
+ const wchar_t *srcPath, Int32 srcIsFolder,
+ const FILETIME *srcTime, const UInt64 *srcSize,
+ const wchar_t *destPath,
+ BSTR *destPathResult,
+ Int32 *writeAnswer)
+{
+ UString destPathResultTemp = destPath;
+
+ // RINOK(StringToBstr(destPath, destPathResult));
+
+ *destPathResult = 0;
+ *writeAnswer = BoolToInt(false);
+
+ FString destPathSys = us2fs(destPath);
+ bool srcIsFolderSpec = IntToBool(srcIsFolder);
+ CFileInfo destFileInfo;
+
+ if (destFileInfo.Find(destPathSys))
+ {
+ if (srcIsFolderSpec)
+ {
+ if (!destFileInfo.IsDir())
+ {
+ RINOK(MessageError("can not replace file with folder with same name", destPathSys));
+ return E_ABORT;
+ }
+ *writeAnswer = BoolToInt(false);
+ return S_OK;
+ }
+
+ if (destFileInfo.IsDir())
+ {
+ RINOK(MessageError("can not replace folder with file with same name", destPathSys));
+ *writeAnswer = BoolToInt(false);
+ return S_OK;
+ }
+
+ switch (OverwriteMode)
+ {
+ case NExtract::NOverwriteMode::kSkip:
+ return S_OK;
+ case NExtract::NOverwriteMode::kAsk:
+ {
+ Int32 overwriteResult;
+ UString destPathSpec = destPath;
+ int slashPos = destPathSpec.ReverseFind_PathSepar();
+ destPathSpec.DeleteFrom(slashPos + 1);
+ destPathSpec += fs2us(destFileInfo.Name);
+
+ RINOK(AskOverwrite(
+ destPathSpec,
+ &destFileInfo.MTime, &destFileInfo.Size,
+ srcPath,
+ srcTime, srcSize,
+ &overwriteResult));
+
+ switch (overwriteResult)
+ {
+ case NOverwriteAnswer::kCancel: return E_ABORT;
+ case NOverwriteAnswer::kNo: return S_OK;
+ case NOverwriteAnswer::kNoToAll: OverwriteMode = NExtract::NOverwriteMode::kSkip; return S_OK;
+ case NOverwriteAnswer::kYes: break;
+ case NOverwriteAnswer::kYesToAll: OverwriteMode = NExtract::NOverwriteMode::kOverwrite; break;
+ case NOverwriteAnswer::kAutoRename: OverwriteMode = NExtract::NOverwriteMode::kRename; break;
+ default:
+ return E_FAIL;
+ }
+ }
+ }
+
+ if (OverwriteMode == NExtract::NOverwriteMode::kRename)
+ {
+ if (!AutoRenamePath(destPathSys))
+ {
+ RINOK(MessageError("can not create name for file", destPathSys));
+ return E_ABORT;
+ }
+ destPathResultTemp = fs2us(destPathSys);
+ }
+ else
+ if (!NDir::DeleteFileAlways(destPathSys))
+ {
+ RINOK(MessageError("can not delete output file", destPathSys));
+ return E_ABORT;
+ }
+ }
+ *writeAnswer = BoolToInt(true);
+ return StringToBstr(destPathResultTemp, destPathResult);
+}
+
+
+STDMETHODIMP CExtractCallbackImp::UseExtractToStream(Int32 *res)
+{
+ *res = BoolToInt(StreamMode);
+ return S_OK;
+}
+
+static HRESULT GetTime(IGetProp *getProp, PROPID propID, FILETIME &ft, bool &ftDefined)
+{
+ ftDefined = false;
+ NCOM::CPropVariant prop;
+ RINOK(getProp->GetProp(propID, &prop));
+ if (prop.vt == VT_FILETIME)
+ {
+ ft = prop.filetime;
+ ftDefined = (ft.dwHighDateTime != 0 || ft.dwLowDateTime != 0);
+ }
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+
+static HRESULT GetItemBoolProp(IGetProp *getProp, PROPID propID, bool &result)
+{
+ NCOM::CPropVariant prop;
+ result = false;
+ RINOK(getProp->GetProp(propID, &prop));
+ if (prop.vt == VT_BOOL)
+ result = VARIANT_BOOLToBool(prop.boolVal);
+ else if (prop.vt != VT_EMPTY)
+ return E_FAIL;
+ return S_OK;
+}
+
+
+STDMETHODIMP CExtractCallbackImp::GetStream7(const wchar_t *name,
+ Int32 isDir,
+ ISequentialOutStream **outStream, Int32 askExtractMode,
+ IGetProp *getProp)
+{
+ COM_TRY_BEGIN
+ *outStream = 0;
+ _newVirtFileWasAdded = false;
+ _hashStreamWasUsed = false;
+ _needUpdateStat = false;
+
+ if (_hashStream)
+ _hashStreamSpec->ReleaseStream();
+
+ GetItemBoolProp(getProp, kpidIsAltStream, _isAltStream);
+
+ if (!ProcessAltStreams && _isAltStream)
+ return S_OK;
+
+ _filePath = name;
+ _isFolder = IntToBool(isDir);
+ _curSize = 0;
+ _curSizeDefined = false;
+
+ UInt64 size = 0;
+ bool sizeDefined;
+ {
+ NCOM::CPropVariant prop;
+ RINOK(getProp->GetProp(kpidSize, &prop));
+ sizeDefined = ConvertPropVariantToUInt64(prop, size);
+ }
+
+ if (sizeDefined)
+ {
+ _curSize = size;
+ _curSizeDefined = true;
+ }
+
+ if (askExtractMode != NArchive::NExtract::NAskMode::kExtract &&
+ askExtractMode != NArchive::NExtract::NAskMode::kTest)
+ return S_OK;
+
+ _needUpdateStat = true;
+
+ CMyComPtr<ISequentialOutStream> outStreamLoc;
+
+ if (VirtFileSystem && askExtractMode == NArchive::NExtract::NAskMode::kExtract)
+ {
+ CVirtFile &file = VirtFileSystemSpec->AddNewFile();
+ _newVirtFileWasAdded = true;
+ file.Name = name;
+ file.IsDir = IntToBool(isDir);
+ file.IsAltStream = _isAltStream;
+ file.Size = 0;
+
+ RINOK(GetTime(getProp, kpidCTime, file.CTime, file.CTimeDefined));
+ RINOK(GetTime(getProp, kpidATime, file.ATime, file.ATimeDefined));
+ RINOK(GetTime(getProp, kpidMTime, file.MTime, file.MTimeDefined));
+
+ NCOM::CPropVariant prop;
+ RINOK(getProp->GetProp(kpidAttrib, &prop));
+ if (prop.vt == VT_UI4)
+ {
+ file.Attrib = prop.ulVal;
+ file.AttribDefined = true;
+ }
+ // else if (isDir) file.Attrib = FILE_ATTRIBUTE_DIRECTORY;
+
+ file.ExpectedSize = 0;
+ if (sizeDefined)
+ file.ExpectedSize = size;
+ outStreamLoc = VirtFileSystem;
+ }
+
+ if (_hashStream)
+ {
+ {
+ _hashStreamSpec->SetStream(outStreamLoc);
+ outStreamLoc = _hashStream;
+ _hashStreamSpec->Init(true);
+ _hashStreamWasUsed = true;
+ }
+ }
+
+ if (outStreamLoc)
+ *outStream = outStreamLoc.Detach();
+ return S_OK;
+ COM_TRY_END
+}
+
+STDMETHODIMP CExtractCallbackImp::PrepareOperation7(Int32 askExtractMode)
+{
+ COM_TRY_BEGIN
+ _needUpdateStat = (
+ askExtractMode == NArchive::NExtract::NAskMode::kExtract ||
+ askExtractMode == NArchive::NExtract::NAskMode::kTest);
+
+ /*
+ _extractMode = false;
+ switch (askExtractMode)
+ {
+ case NArchive::NExtract::NAskMode::kExtract:
+ if (_testMode)
+ askExtractMode = NArchive::NExtract::NAskMode::kTest;
+ else
+ _extractMode = true;
+ break;
+ };
+ */
+ return SetCurrentFilePath2(_filePath);
+ COM_TRY_END
+}
+
+STDMETHODIMP CExtractCallbackImp::SetOperationResult7(Int32 opRes, Int32 encrypted)
+{
+ COM_TRY_BEGIN
+ if (VirtFileSystem && _newVirtFileWasAdded)
+ {
+ // FIXME: probably we must request file size from VirtFileSystem
+ // _curSize = VirtFileSystem->GetLastFileSize()
+ // _curSizeDefined = true;
+ RINOK(VirtFileSystemSpec->CloseMemFile());
+ }
+ if (_hashStream && _hashStreamWasUsed)
+ {
+ _hashStreamSpec->_hash->Final(_isFolder, _isAltStream, _filePath);
+ _curSize = _hashStreamSpec->GetSize();
+ _curSizeDefined = true;
+ _hashStreamSpec->ReleaseStream();
+ _hashStreamWasUsed = false;
+ }
+ else if (_hashCalc && _needUpdateStat)
+ {
+ _hashCalc->SetSize(_curSize);
+ _hashCalc->Final(_isFolder, _isAltStream, _filePath);
+ }
+ return SetOperationResult(opRes, encrypted);
+ COM_TRY_END
+}
+
+
+static const size_t k_SizeT_MAX = (size_t)((size_t)0 - 1);
+
+static const UInt32 kBlockSize = ((UInt32)1 << 31);
+
+STDMETHODIMP CVirtFileSystem::Write(const void *data, UInt32 size, UInt32 *processedSize)
+{
+ if (processedSize)
+ *processedSize = 0;
+ if (size == 0)
+ return S_OK;
+ if (!_fileMode)
+ {
+ CVirtFile &file = Files.Back();
+ size_t rem = file.Data.Size() - (size_t)file.Size;
+ bool useMem = true;
+ if (rem < size)
+ {
+ UInt64 b = 0;
+ if (file.Data.Size() == 0)
+ b = file.ExpectedSize;
+ UInt64 a = file.Size + size;
+ if (b < a)
+ b = a;
+ a = (UInt64)file.Data.Size() * 2;
+ if (b < a)
+ b = a;
+ useMem = false;
+ if (b <= k_SizeT_MAX && b <= MaxTotalAllocSize)
+ useMem = file.Data.ReAlloc_KeepData((size_t)b, (size_t)file.Size);
+ }
+ if (useMem)
+ {
+ memcpy(file.Data + file.Size, data, size);
+ file.Size += size;
+ if (processedSize)
+ *processedSize = (UInt32)size;
+ return S_OK;
+ }
+ _fileMode = true;
+ }
+ RINOK(FlushToDisk(false));
+ return _outFileStream->Write(data, size, processedSize);
+}
+
+HRESULT CVirtFileSystem::FlushToDisk(bool closeLast)
+{
+ if (!_outFileStream)
+ {
+ _outFileStreamSpec = new COutFileStream;
+ _outFileStream = _outFileStreamSpec;
+ }
+ while (_numFlushed < Files.Size())
+ {
+ const CVirtFile &file = Files[_numFlushed];
+ const FString path = DirPrefix + us2fs(Get_Correct_FsFile_Name(file.Name));
+ if (!_fileIsOpen)
+ {
+ if (!_outFileStreamSpec->Create(path, false))
+ {
+ _outFileStream.Release();
+ return E_FAIL;
+ // MessageBoxMyError(UString("Can't create file ") + fs2us(tempFilePath));
+ }
+ _fileIsOpen = true;
+ RINOK(WriteStream(_outFileStream, file.Data, (size_t)file.Size));
+ }
+ if (_numFlushed == Files.Size() - 1 && !closeLast)
+ break;
+ if (file.CTimeDefined ||
+ file.ATimeDefined ||
+ file.MTimeDefined)
+ _outFileStreamSpec->SetTime(
+ file.CTimeDefined ? &file.CTime : NULL,
+ file.ATimeDefined ? &file.ATime : NULL,
+ file.MTimeDefined ? &file.MTime : NULL);
+ _outFileStreamSpec->Close();
+ _numFlushed++;
+ _fileIsOpen = false;
+ if (file.AttribDefined)
+ NDir::SetFileAttrib_PosixHighDetect(path, file.Attrib);
+ }
+ return S_OK;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.h
new file mode 100644
index 0000000000..a6d5ae3a43
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ExtractCallback.h
@@ -0,0 +1,328 @@
+// ExtractCallback.h
+
+#ifndef __EXTRACT_CALLBACK_H
+#define __EXTRACT_CALLBACK_H
+
+#include "../../../../C/Alloc.h"
+
+#include "../../../Common/MyCom.h"
+#include "../../../Common/StringConvert.h"
+
+#ifndef _SFX
+#include "../Agent/IFolderArchive.h"
+#endif
+
+#include "../Common/ArchiveExtractCallback.h"
+#include "../Common/ArchiveOpenCallback.h"
+
+#ifndef _NO_CRYPTO
+#include "../../IPassword.h"
+#endif
+
+#ifndef _SFX
+#include "IFolder.h"
+#endif
+
+#include "ProgressDialog2.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+#ifndef _SFX
+
+class CGrowBuf
+{
+ Byte *_items;
+ size_t _size;
+
+ CLASS_NO_COPY(CGrowBuf);
+
+public:
+ bool ReAlloc_KeepData(size_t newSize, size_t keepSize)
+ {
+ void *buf = MyAlloc(newSize);
+ if (!buf)
+ return false;
+ if (keepSize != 0)
+ memcpy(buf, _items, keepSize);
+ MyFree(_items);
+ _items = (Byte *)buf;
+ _size = newSize;
+ return true;
+ }
+
+ CGrowBuf(): _items(0), _size(0) {}
+ ~CGrowBuf() { MyFree(_items); }
+
+ operator Byte *() { return _items; }
+ operator const Byte *() const { return _items; }
+ size_t Size() const { return _size; }
+};
+
+struct CVirtFile
+{
+ CGrowBuf Data;
+
+ UInt64 Size; // real size
+ UInt64 ExpectedSize; // the size from props request. 0 if unknown
+
+ UString Name;
+
+ bool CTimeDefined;
+ bool ATimeDefined;
+ bool MTimeDefined;
+ bool AttribDefined;
+
+ bool IsDir;
+ bool IsAltStream;
+
+ DWORD Attrib;
+
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+
+ CVirtFile():
+ CTimeDefined(false),
+ ATimeDefined(false),
+ MTimeDefined(false),
+ AttribDefined(false),
+ IsDir(false),
+ IsAltStream(false) {}
+};
+
+class CVirtFileSystem:
+ public ISequentialOutStream,
+ public CMyUnknownImp
+{
+ UInt64 _totalAllocSize;
+
+ size_t _pos;
+ unsigned _numFlushed;
+ bool _fileIsOpen;
+ bool _fileMode;
+ COutFileStream *_outFileStreamSpec;
+ CMyComPtr<ISequentialOutStream> _outFileStream;
+public:
+ CObjectVector<CVirtFile> Files;
+ UInt64 MaxTotalAllocSize;
+ FString DirPrefix;
+
+ CVirtFile &AddNewFile()
+ {
+ if (!Files.IsEmpty())
+ {
+ MaxTotalAllocSize -= Files.Back().Data.Size();
+ }
+ return Files.AddNew();
+ }
+ HRESULT CloseMemFile()
+ {
+ if (_fileMode)
+ {
+ return FlushToDisk(true);
+ }
+ CVirtFile &file = Files.Back();
+ if (file.Data.Size() != file.Size)
+ {
+ file.Data.ReAlloc_KeepData((size_t)file.Size, (size_t)file.Size);
+ }
+ return S_OK;
+ }
+
+ bool IsStreamInMem() const
+ {
+ if (_fileMode)
+ return false;
+ if (Files.Size() < 1 || /* Files[0].IsAltStream || */ Files[0].IsDir)
+ return false;
+ return true;
+ }
+
+ size_t GetMemStreamWrittenSize() const { return _pos; }
+
+ CVirtFileSystem(): _outFileStreamSpec(NULL), MaxTotalAllocSize((UInt64)0 - 1) {}
+
+ void Init()
+ {
+ _totalAllocSize = 0;
+ _fileMode = false;
+ _pos = 0;
+ _numFlushed = 0;
+ _fileIsOpen = false;
+ }
+
+ HRESULT CloseFile(const FString &path);
+ HRESULT FlushToDisk(bool closeLast);
+ size_t GetPos() const { return _pos; }
+
+ MY_UNKNOWN_IMP
+ STDMETHOD(Write)(const void *data, UInt32 size, UInt32 *processedSize);
+};
+
+#endif
+
+class CExtractCallbackImp:
+ public IExtractCallbackUI, // it includes IFolderArchiveExtractCallback
+ public IOpenCallbackUI,
+ public IFolderArchiveExtractCallback2,
+ #ifndef _SFX
+ public IFolderOperationsExtractCallback,
+ public IFolderExtractToStreamCallback,
+ public ICompressProgressInfo,
+ #endif
+ #ifndef _NO_CRYPTO
+ public ICryptoGetTextPassword,
+ #endif
+ public CMyUnknownImp
+{
+ HRESULT MessageError(const char *message, const FString &path);
+ void Add_ArchiveName_Error();
+public:
+ MY_QUERYINTERFACE_BEGIN2(IFolderArchiveExtractCallback)
+ MY_QUERYINTERFACE_ENTRY(IFolderArchiveExtractCallback2)
+ #ifndef _SFX
+ MY_QUERYINTERFACE_ENTRY(IFolderOperationsExtractCallback)
+ MY_QUERYINTERFACE_ENTRY(IFolderExtractToStreamCallback)
+ MY_QUERYINTERFACE_ENTRY(ICompressProgressInfo)
+ #endif
+ #ifndef _NO_CRYPTO
+ MY_QUERYINTERFACE_ENTRY(ICryptoGetTextPassword)
+ #endif
+ MY_QUERYINTERFACE_END
+ MY_ADDREF_RELEASE
+
+ INTERFACE_IProgress(;)
+ INTERFACE_IOpenCallbackUI(;)
+ INTERFACE_IFolderArchiveExtractCallback(;)
+ INTERFACE_IFolderArchiveExtractCallback2(;)
+ // STDMETHOD(SetTotalFiles)(UInt64 total);
+ // STDMETHOD(SetCompletedFiles)(const UInt64 *value);
+
+ INTERFACE_IExtractCallbackUI(;)
+
+ #ifndef _SFX
+ // IFolderOperationsExtractCallback
+ STDMETHOD(AskWrite)(
+ const wchar_t *srcPath,
+ Int32 srcIsFolder,
+ const FILETIME *srcTime,
+ const UInt64 *srcSize,
+ const wchar_t *destPathRequest,
+ BSTR *destPathResult,
+ Int32 *writeAnswer);
+ STDMETHOD(ShowMessage)(const wchar_t *message);
+ STDMETHOD(SetCurrentFilePath)(const wchar_t *filePath);
+ STDMETHOD(SetNumFiles)(UInt64 numFiles);
+ INTERFACE_IFolderExtractToStreamCallback(;)
+ STDMETHOD(SetRatioInfo)(const UInt64 *inSize, const UInt64 *outSize);
+ #endif
+
+ // ICryptoGetTextPassword
+ #ifndef _NO_CRYPTO
+ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+ #endif
+
+private:
+ UString _currentArchivePath;
+ bool _needWriteArchivePath;
+
+ UString _currentFilePath;
+ bool _isFolder;
+
+ bool _isAltStream;
+ UInt64 _curSize;
+ bool _curSizeDefined;
+ UString _filePath;
+ // bool _extractMode;
+ // bool _testMode;
+ bool _newVirtFileWasAdded;
+ bool _needUpdateStat;
+
+
+ HRESULT SetCurrentFilePath2(const wchar_t *filePath);
+ void AddError_Message(LPCWSTR message);
+
+ #ifndef _SFX
+ bool _hashStreamWasUsed;
+ COutStreamWithHash *_hashStreamSpec;
+ CMyComPtr<ISequentialOutStream> _hashStream;
+ IHashCalc *_hashCalc; // it's for stat in Test operation
+ #endif
+
+public:
+
+ #ifndef _SFX
+ CVirtFileSystem *VirtFileSystemSpec;
+ CMyComPtr<ISequentialOutStream> VirtFileSystem;
+ #endif
+
+ bool ProcessAltStreams;
+
+ bool StreamMode;
+
+ CProgressDialog *ProgressDialog;
+ #ifndef _SFX
+ UInt64 NumFolders;
+ UInt64 NumFiles;
+ bool NeedAddFile;
+ #endif
+ UInt32 NumArchiveErrors;
+ bool ThereAreMessageErrors;
+ NExtract::NOverwriteMode::EEnum OverwriteMode;
+
+ #ifndef _NO_CRYPTO
+ bool PasswordIsDefined;
+ bool PasswordWasAsked;
+ UString Password;
+ #endif
+
+
+ UString _lang_Extracting;
+ UString _lang_Testing;
+ UString _lang_Skipping;
+ UString _lang_Empty;
+
+ bool _totalFilesDefined;
+ bool _totalBytesDefined;
+ bool MultiArcMode;
+
+ CExtractCallbackImp():
+ #ifndef _NO_CRYPTO
+ PasswordIsDefined(false),
+ PasswordWasAsked(false),
+ #endif
+ OverwriteMode(NExtract::NOverwriteMode::kAsk),
+ StreamMode(false),
+ ProcessAltStreams(true),
+
+ _totalFilesDefined(false),
+ _totalBytesDefined(false),
+ MultiArcMode(false)
+
+ #ifndef _SFX
+ , _hashCalc(NULL)
+ #endif
+ {}
+
+ ~CExtractCallbackImp();
+ void Init();
+
+ #ifndef _SFX
+ void SetHashCalc(IHashCalc *hashCalc) { _hashCalc = hashCalc; }
+
+ void SetHashMethods(IHashCalc *hash)
+ {
+ if (!hash)
+ return;
+ _hashStreamSpec = new COutStreamWithHash;
+ _hashStream = _hashStreamSpec;
+ _hashStreamSpec->_hash = hash;
+ }
+ #endif
+
+ bool IsOK() const { return NumArchiveErrors == 0 && !ThereAreMessageErrors; }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.cpp
new file mode 100644
index 0000000000..4f7ef74e55
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.cpp
@@ -0,0 +1,28 @@
+// FormatUtils.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+
+#include "FormatUtils.h"
+
+#include "LangUtils.h"
+
+UString NumberToString(UInt64 number)
+{
+ wchar_t numberString[32];
+ ConvertUInt64ToString(number, numberString);
+ return numberString;
+}
+
+UString MyFormatNew(const UString &format, const UString &argument)
+{
+ UString result = format;
+ result.Replace(L"{0}", argument);
+ return result;
+}
+
+UString MyFormatNew(UINT resourceID, const UString &argument)
+{
+ return MyFormatNew(LangString(resourceID), argument);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.h
new file mode 100644
index 0000000000..f221cd2334
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/FormatUtils.h
@@ -0,0 +1,14 @@
+// FormatUtils.h
+
+#ifndef __FORMAT_UTILS_H
+#define __FORMAT_UTILS_H
+
+#include "../../../Common/MyTypes.h"
+#include "../../../Common/MyString.h"
+
+UString NumberToString(UInt64 number);
+
+UString MyFormatNew(const UString &format, const UString &argument);
+UString MyFormatNew(UINT resourceID, const UString &argument);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/LangUtils.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/LangUtils.h
new file mode 100644
index 0000000000..c694423902
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/LangUtils.h
@@ -0,0 +1,40 @@
+// LangUtils.h
+
+#ifndef __LANG_UTILS_H
+#define __LANG_UTILS_H
+
+#include "../../../Windows/ResourceString.h"
+
+#ifdef LANG
+
+extern UString g_LangID;
+
+struct CIDLangPair
+{
+ UInt32 ControlID;
+ UInt32 LangID;
+};
+
+void ReloadLang();
+void LoadLangOneTime();
+FString GetLangDirPrefix();
+
+void LangSetDlgItemText(HWND dialog, UInt32 controlID, UInt32 langID);
+void LangSetDlgItems(HWND dialog, const UInt32 *ids, unsigned numItems);
+void LangSetDlgItems_Colon(HWND dialog, const UInt32 *ids, unsigned numItems);
+void LangSetWindowText(HWND window, UInt32 langID);
+
+UString LangString(UInt32 langID);
+void AddLangString(UString &s, UInt32 langID);
+void LangString(UInt32 langID, UString &dest);
+void LangString_OnlyFromLangFile(UInt32 langID, UString &dest);
+
+#else
+
+inline UString LangString(UInt32 langID) { return NWindows::MyLoadString(langID); }
+inline void LangString(UInt32 langID, UString &dest) { NWindows::MyLoadString(langID, dest); }
+inline void AddLangString(UString &s, UInt32 langID) { s += NWindows::MyLoadString(langID); }
+
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/MyWindowsNew.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/MyWindowsNew.h
new file mode 100644
index 0000000000..c0fe8439b9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/MyWindowsNew.h
@@ -0,0 +1,76 @@
+// MyWindowsNew.h
+
+#ifndef __MY_WINDOWS_NEW_H
+#define __MY_WINDOWS_NEW_H
+
+#ifdef _MSC_VER
+
+#include <ShObjIdl.h>
+
+#ifndef __ITaskbarList3_INTERFACE_DEFINED__
+#define __ITaskbarList3_INTERFACE_DEFINED__
+
+typedef enum THUMBBUTTONFLAGS
+{
+ THBF_ENABLED = 0,
+ THBF_DISABLED = 0x1,
+ THBF_DISMISSONCLICK = 0x2,
+ THBF_NOBACKGROUND = 0x4,
+ THBF_HIDDEN = 0x8,
+ THBF_NONINTERACTIVE = 0x10
+} THUMBBUTTONFLAGS;
+
+typedef enum THUMBBUTTONMASK
+{
+ THB_BITMAP = 0x1,
+ THB_ICON = 0x2,
+ THB_TOOLTIP = 0x4,
+ THB_FLAGS = 0x8
+} THUMBBUTTONMASK;
+
+// #include <pshpack8.h>
+
+typedef struct THUMBBUTTON
+{
+ THUMBBUTTONMASK dwMask;
+ UINT iId;
+ UINT iBitmap;
+ HICON hIcon;
+ WCHAR szTip[260];
+ THUMBBUTTONFLAGS dwFlags;
+} THUMBBUTTON;
+
+typedef struct THUMBBUTTON *LPTHUMBBUTTON;
+
+typedef enum TBPFLAG
+{
+ TBPF_NOPROGRESS = 0,
+ TBPF_INDETERMINATE = 0x1,
+ TBPF_NORMAL = 0x2,
+ TBPF_ERROR = 0x4,
+ TBPF_PAUSED = 0x8
+} TBPFLAG;
+
+DEFINE_GUID(IID_ITaskbarList3, 0xEA1AFB91, 0x9E28, 0x4B86, 0x90, 0xE9, 0x9E, 0x9F, 0x8A, 0x5E, 0xEF, 0xAF);
+
+struct ITaskbarList3: public ITaskbarList2
+{
+ STDMETHOD(SetProgressValue)(HWND hwnd, ULONGLONG ullCompleted, ULONGLONG ullTotal) = 0;
+ STDMETHOD(SetProgressState)(HWND hwnd, TBPFLAG tbpFlags) = 0;
+ STDMETHOD(RegisterTab)(HWND hwndTab, HWND hwndMDI) = 0;
+ STDMETHOD(UnregisterTab)(HWND hwndTab) = 0;
+ STDMETHOD(SetTabOrder)(HWND hwndTab, HWND hwndInsertBefore) = 0;
+ STDMETHOD(SetTabActive)(HWND hwndTab, HWND hwndMDI, DWORD dwReserved) = 0;
+ STDMETHOD(ThumbBarAddButtons)(HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) = 0;
+ STDMETHOD(ThumbBarUpdateButtons)(HWND hwnd, UINT cButtons, LPTHUMBBUTTON pButton) = 0;
+ STDMETHOD(ThumbBarSetImageList)(HWND hwnd, HIMAGELIST himl) = 0;
+ STDMETHOD(SetOverlayIcon)(HWND hwnd, HICON hIcon, LPCWSTR pszDescription) = 0;
+ STDMETHOD(SetThumbnailTooltip)(HWND hwnd, LPCWSTR pszTip) = 0;
+ STDMETHOD(SetThumbnailClip)(HWND hwnd, RECT *prcClip) = 0;
+};
+
+#endif
+
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.cpp
new file mode 100644
index 0000000000..3f0180decc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.cpp
@@ -0,0 +1,122 @@
+// OverwriteDialog.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/PropVariantConv.h"
+#include "../../../Windows/ResourceString.h"
+
+#include "../../../Windows/Control/Static.h"
+
+#include "FormatUtils.h"
+#include "LangUtils.h"
+#include "OverwriteDialog.h"
+
+#include "PropertyNameRes.h"
+
+using namespace NWindows;
+
+#ifdef LANG
+static const UInt32 kLangIDs[] =
+{
+ IDT_OVERWRITE_HEADER,
+ IDT_OVERWRITE_QUESTION_BEGIN,
+ IDT_OVERWRITE_QUESTION_END,
+ IDB_YES_TO_ALL,
+ IDB_NO_TO_ALL,
+ IDB_AUTO_RENAME
+};
+#endif
+
+static const unsigned kCurrentFileNameSizeLimit = 82;
+static const unsigned kCurrentFileNameSizeLimit2 = 30;
+
+void COverwriteDialog::ReduceString(UString &s)
+{
+ unsigned size = _isBig ? kCurrentFileNameSizeLimit : kCurrentFileNameSizeLimit2;
+ if (s.Len() > size)
+ {
+ s.Delete(size / 2, s.Len() - size);
+ s.Insert(size / 2, L" ... ");
+ }
+ if (!s.IsEmpty() && s.Back() == ' ')
+ {
+ // s += (wchar_t)(0x2423);
+ s.InsertAtFront(L'\"');
+ s += L'\"';
+ }
+}
+
+void COverwriteDialog::SetFileInfoControl(int textID, int iconID,
+ const NOverwriteDialog::CFileInfo &fileInfo)
+{
+ UString sizeString;
+ if (fileInfo.SizeIsDefined)
+ sizeString = MyFormatNew(IDS_FILE_SIZE, NumberToString(fileInfo.Size));
+
+ const UString &fileName = fileInfo.Name;
+ int slashPos = fileName.ReverseFind_PathSepar();
+ UString s1 = fileName.Left(slashPos + 1);
+ UString s2 = fileName.Ptr(slashPos + 1);
+
+ ReduceString(s1);
+ ReduceString(s2);
+
+ UString s = s1;
+ s.Add_LF();
+ s += s2;
+ s.Add_LF();
+ s += sizeString;
+ s.Add_LF();
+
+ if (fileInfo.TimeIsDefined)
+ {
+ AddLangString(s, IDS_PROP_MTIME);
+ s += ": ";
+ char t[32];
+ ConvertUtcFileTimeToString(fileInfo.Time, t);
+ s += t;
+ }
+
+ NControl::CDialogChildControl control;
+ control.Init(*this, textID);
+ control.SetText(s);
+
+ SHFILEINFO shellFileInfo;
+ if (::SHGetFileInfo(
+ GetSystemString(fileInfo.Name), FILE_ATTRIBUTE_NORMAL, &shellFileInfo,
+ sizeof(shellFileInfo), SHGFI_ICON | SHGFI_USEFILEATTRIBUTES | SHGFI_LARGEICON))
+ {
+ NControl::CStatic staticContol;
+ staticContol.Attach(GetItem(iconID));
+ staticContol.SetIcon(shellFileInfo.hIcon);
+ }
+}
+
+bool COverwriteDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetWindowText(*this, IDD_OVERWRITE);
+ LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
+ #endif
+ SetFileInfoControl(IDT_OVERWRITE_OLD_FILE_SIZE_TIME, IDI_OVERWRITE_OLD_FILE, OldFileInfo);
+ SetFileInfoControl(IDT_OVERWRITE_NEW_FILE_SIZE_TIME, IDI_OVERWRITE_NEW_FILE, NewFileInfo);
+ NormalizePosition();
+ return CModalDialog::OnInit();
+}
+
+bool COverwriteDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch (buttonID)
+ {
+ case IDYES:
+ case IDNO:
+ case IDB_YES_TO_ALL:
+ case IDB_NO_TO_ALL:
+ case IDB_AUTO_RENAME:
+ End(buttonID);
+ return true;
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.h
new file mode 100644
index 0000000000..4564a472d8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.h
@@ -0,0 +1,69 @@
+// OverwriteDialog.h
+
+#ifndef __OVERWRITE_DIALOG_H
+#define __OVERWRITE_DIALOG_H
+
+#include "../../../Windows/Control/Dialog.h"
+
+#include "DialogSize.h"
+#include "OverwriteDialogRes.h"
+
+namespace NOverwriteDialog
+{
+ struct CFileInfo
+ {
+ bool SizeIsDefined;
+ bool TimeIsDefined;
+ UInt64 Size;
+ FILETIME Time;
+ UString Name;
+
+ void SetTime(const FILETIME *t)
+ {
+ if (t == 0)
+ TimeIsDefined = false;
+ else
+ {
+ TimeIsDefined = true;
+ Time = *t;
+ }
+ }
+ void SetSize(const UInt64 *size)
+ {
+ if (size == 0)
+ SizeIsDefined = false;
+ else
+ {
+ SizeIsDefined = true;
+ Size = *size;
+ }
+ }
+ };
+}
+
+class COverwriteDialog: public NWindows::NControl::CModalDialog
+{
+ bool _isBig;
+
+ void SetFileInfoControl(int textID, int iconID, const NOverwriteDialog::CFileInfo &fileInfo);
+ virtual bool OnInit();
+ bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ void ReduceString(UString &s);
+
+public:
+ INT_PTR Create(HWND parent = 0)
+ {
+ BIG_DIALOG_SIZE(280, 200);
+ #ifdef UNDER_CE
+ _isBig = isBig;
+ #else
+ _isBig = true;
+ #endif
+ return CModalDialog::Create(SIZED_DIALOG(IDD_OVERWRITE), parent);
+ }
+
+ NOverwriteDialog::CFileInfo OldFileInfo;
+ NOverwriteDialog::CFileInfo NewFileInfo;
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.rc b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.rc
new file mode 100644
index 0000000000..80f48b007a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialog.rc
@@ -0,0 +1,91 @@
+#include "OverwriteDialogRes.h"
+#include "../../GuiCommon.rc"
+
+#define xc 280
+#define yc 200
+
+#undef iconSize
+#define iconSize 24
+
+#undef x
+#undef fx
+#undef fy
+#define x (m + iconSize + m)
+#define fx (xc - iconSize - m)
+#define fy 50
+
+#define bSizeBig 104
+#undef bx1
+#define bx1 (xs - m - bSizeBig)
+
+IDD_OVERWRITE DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "Confirm File Replace"
+BEGIN
+ LTEXT "Destination folder already contains processed file.", IDT_OVERWRITE_HEADER, m, 7, xc, 8
+ LTEXT "Would you like to replace the existing file", IDT_OVERWRITE_QUESTION_BEGIN, m, 28, xc, 8
+
+ ICON "", IDI_OVERWRITE_OLD_FILE, m, 44, iconSize, iconSize
+ LTEXT "", IDT_OVERWRITE_OLD_FILE_SIZE_TIME, x, 44, fx, fy, SS_NOPREFIX
+
+ LTEXT "with this one?", IDT_OVERWRITE_QUESTION_END, m, 98, xc, 8
+
+ ICON "", IDI_OVERWRITE_NEW_FILE, m, 114, iconSize, iconSize
+ LTEXT "", IDT_OVERWRITE_NEW_FILE_SIZE_TIME, x, 114, fx, fy, SS_NOPREFIX
+
+ PUSHBUTTON "&Yes", IDYES, bx3, by2, bxs, bys
+ PUSHBUTTON "Yes to &All", IDB_YES_TO_ALL, bx2, by2, bxs, bys
+ PUSHBUTTON "A&uto Rename", IDB_AUTO_RENAME, bx1, by2, bSizeBig, bys
+ PUSHBUTTON "&No", IDNO, bx3, by1, bxs, bys
+ PUSHBUTTON "No to A&ll", IDB_NO_TO_ALL, bx2, by1, bxs, bys
+ PUSHBUTTON "&Cancel", IDCANCEL, xs - m - bxs, by1, bxs, bys
+END
+
+
+#ifdef UNDER_CE
+
+#undef m
+#undef xc
+#undef yc
+
+#define m 4
+#define xc 152
+#define yc 144
+
+#undef fy
+#define fy 40
+
+#undef bxs
+#define bxs 48
+
+#undef bx1
+
+#define bx1 (xs - m - bxs)
+
+IDD_OVERWRITE_2 DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "Confirm File Replace"
+BEGIN
+ LTEXT "Would you like to replace the existing file", IDT_OVERWRITE_QUESTION_BEGIN, m, m, xc, 8
+
+ ICON "", IDI_OVERWRITE_OLD_FILE, m, 20, iconSize, iconSize
+ LTEXT "", IDT_OVERWRITE_OLD_FILE_SIZE_TIME, x, 20, fx, fy, SS_NOPREFIX
+
+ LTEXT "with this one?", IDT_OVERWRITE_QUESTION_END, m, 60, xc, 8
+
+ ICON "", IDI_OVERWRITE_NEW_FILE, m, 72, iconSize, iconSize
+ LTEXT "", IDT_OVERWRITE_NEW_FILE_SIZE_TIME, x, 72, fx, fy, SS_NOPREFIX
+
+ PUSHBUTTON "&Yes", IDYES, bx3, by2, bxs, bys
+ PUSHBUTTON "Yes to &All", IDB_YES_TO_ALL, bx2, by2, bxs, bys
+ PUSHBUTTON "A&uto Rename", IDB_AUTO_RENAME, bx1, by2, bxs, bys
+ PUSHBUTTON "&No", IDNO, bx3, by1, bxs, bys
+ PUSHBUTTON "No to A&ll", IDB_NO_TO_ALL, bx2, by1, bxs, bys
+ PUSHBUTTON "&Cancel", IDCANCEL, bx1, by1, bxs, bys
+END
+
+#endif
+
+
+STRINGTABLE
+BEGIN
+ IDS_FILE_SIZE "{0} bytes"
+END
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialogRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialogRes.h
new file mode 100644
index 0000000000..28bc0d0aa9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/OverwriteDialogRes.h
@@ -0,0 +1,17 @@
+#define IDD_OVERWRITE 3500
+#define IDD_OVERWRITE_2 13500
+
+#define IDT_OVERWRITE_HEADER 3501
+#define IDT_OVERWRITE_QUESTION_BEGIN 3502
+#define IDT_OVERWRITE_QUESTION_END 3503
+#define IDS_FILE_SIZE 3504
+
+#define IDB_AUTO_RENAME 3505
+#define IDB_YES_TO_ALL 440
+#define IDB_NO_TO_ALL 441
+
+#define IDI_OVERWRITE_OLD_FILE 100
+#define IDI_OVERWRITE_NEW_FILE 101
+
+#define IDT_OVERWRITE_OLD_FILE_SIZE_TIME 102
+#define IDT_OVERWRITE_NEW_FILE_SIZE_TIME 103
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.cpp
new file mode 100644
index 0000000000..95e83fe452
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.cpp
@@ -0,0 +1,58 @@
+// PasswordDialog.cpp
+
+#include "StdAfx.h"
+
+#include "PasswordDialog.h"
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+#ifdef LANG
+static const UInt32 kLangIDs[] =
+{
+ IDT_PASSWORD_ENTER,
+ IDX_PASSWORD_SHOW
+};
+#endif
+
+void CPasswordDialog::ReadControls()
+{
+ _passwordEdit.GetText(Password);
+ ShowPassword = IsButtonCheckedBool(IDX_PASSWORD_SHOW);
+}
+
+void CPasswordDialog::SetTextSpec()
+{
+ _passwordEdit.SetPasswordChar(ShowPassword ? 0: TEXT('*'));
+ _passwordEdit.SetText(Password);
+}
+
+bool CPasswordDialog::OnInit()
+{
+ #ifdef LANG
+ LangSetWindowText(*this, IDD_PASSWORD);
+ LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
+ #endif
+ _passwordEdit.Attach(GetItem(IDE_PASSWORD_PASSWORD));
+ CheckButton(IDX_PASSWORD_SHOW, ShowPassword);
+ SetTextSpec();
+ return CModalDialog::OnInit();
+}
+
+bool CPasswordDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ if (buttonID == IDX_PASSWORD_SHOW)
+ {
+ ReadControls();
+ SetTextSpec();
+ return true;
+ }
+ return CDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CPasswordDialog::OnOK()
+{
+ ReadControls();
+ CModalDialog::OnOK();
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.h
new file mode 100644
index 0000000000..b756a1c4d4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.h
@@ -0,0 +1,28 @@
+// PasswordDialog.h
+
+#ifndef __PASSWORD_DIALOG_H
+#define __PASSWORD_DIALOG_H
+
+#include "../../../Windows/Control/Dialog.h"
+#include "../../../Windows/Control/Edit.h"
+
+#include "PasswordDialogRes.h"
+
+class CPasswordDialog: public NWindows::NControl::CModalDialog
+{
+ NWindows::NControl::CEdit _passwordEdit;
+
+ virtual void OnOK();
+ virtual bool OnInit();
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ void SetTextSpec();
+ void ReadControls();
+public:
+ UString Password;
+ bool ShowPassword;
+
+ CPasswordDialog(): ShowPassword(false) {}
+ INT_PTR Create(HWND parentWindow = 0) { return CModalDialog::Create(IDD_PASSWORD, parentWindow); }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.rc b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.rc
new file mode 100644
index 0000000000..51dd5bc473
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialog.rc
@@ -0,0 +1,14 @@
+#include "PasswordDialogRes.h"
+#include "../../GuiCommon.rc"
+
+#define xc 140
+#define yc 72
+
+IDD_PASSWORD DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "Enter password"
+BEGIN
+ LTEXT "&Enter password:", IDT_PASSWORD_ENTER, m, m, xc, 8
+ EDITTEXT IDE_PASSWORD_PASSWORD, m, 20, xc, 14, ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "&Show password", IDX_PASSWORD_SHOW, MY_CHECKBOX, m, 42, xc, 10
+ OK_CANCEL
+END
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialogRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialogRes.h
new file mode 100644
index 0000000000..f9300d6bc2
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PasswordDialogRes.h
@@ -0,0 +1,5 @@
+#define IDD_PASSWORD 3800
+#define IDT_PASSWORD_ENTER 3801
+#define IDX_PASSWORD_SHOW 3803
+
+#define IDE_PASSWORD_PASSWORD 120
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp
new file mode 100644
index 0000000000..9b61369372
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.cpp
@@ -0,0 +1,197 @@
+// ProgressDialog.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+
+#include "resource.h"
+
+#include "ProgressDialog.h"
+
+using namespace NWindows;
+
+extern HINSTANCE g_hInstance;
+
+static const UINT_PTR kTimerID = 3;
+static const UINT kTimerElapse = 100;
+
+#ifdef LANG
+#include "LangUtils.h"
+#endif
+
+HRESULT CProgressSync::ProcessStopAndPause()
+{
+ for (;;)
+ {
+ if (GetStopped())
+ return E_ABORT;
+ if (!GetPaused())
+ break;
+ ::Sleep(100);
+ }
+ return S_OK;
+}
+
+#ifndef _SFX
+CProgressDialog::~CProgressDialog()
+{
+ AddToTitle(L"");
+}
+void CProgressDialog::AddToTitle(LPCWSTR s)
+{
+ if (MainWindow != 0)
+ MySetWindowText(MainWindow, UString(s) + MainTitle);
+}
+#endif
+
+
+bool CProgressDialog::OnInit()
+{
+ _range = (UInt64)(Int64)-1;
+ _prevPercentValue = -1;
+
+ _wasCreated = true;
+ _dialogCreatedEvent.Set();
+
+ #ifdef LANG
+ LangSetDlgItems(*this, NULL, 0);
+ #endif
+
+ m_ProgressBar.Attach(GetItem(IDC_PROGRESS1));
+
+ if (IconID >= 0)
+ {
+ HICON icon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IconID));
+ SetIcon(ICON_BIG, icon);
+ }
+
+ _timer = SetTimer(kTimerID, kTimerElapse);
+ SetText(_title);
+ CheckNeedClose();
+ return CModalDialog::OnInit();
+}
+
+void CProgressDialog::OnCancel() { Sync.SetStopped(true); }
+void CProgressDialog::OnOK() { }
+
+void CProgressDialog::SetRange(UInt64 range)
+{
+ _range = range;
+ _peviousPos = (UInt64)(Int64)-1;
+ _converter.Init(range);
+ m_ProgressBar.SetRange32(0 , _converter.Count(range)); // Test it for 100%
+}
+
+void CProgressDialog::SetPos(UInt64 pos)
+{
+ bool redraw = true;
+ if (pos < _range && pos > _peviousPos)
+ {
+ UInt64 posDelta = pos - _peviousPos;
+ if (posDelta < (_range >> 10))
+ redraw = false;
+ }
+ if (redraw)
+ {
+ m_ProgressBar.SetPos(_converter.Count(pos)); // Test it for 100%
+ _peviousPos = pos;
+ }
+}
+
+bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */)
+{
+ if (Sync.GetPaused())
+ return true;
+
+ CheckNeedClose();
+
+ UInt64 total, completed;
+ Sync.GetProgress(total, completed);
+ if (total != _range)
+ SetRange(total);
+ SetPos(completed);
+
+ if (total == 0)
+ total = 1;
+
+ int percentValue = (int)(completed * 100 / total);
+ if (percentValue != _prevPercentValue)
+ {
+ wchar_t s[64];
+ ConvertUInt64ToString(percentValue, s);
+ UString title = s;
+ title += "% ";
+ SetText(title + _title);
+ #ifndef _SFX
+ AddToTitle(title + MainAddTitle);
+ #endif
+ _prevPercentValue = percentValue;
+ }
+ return true;
+}
+
+bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message)
+ {
+ case kCloseMessage:
+ {
+ KillTimer(_timer);
+ _timer = 0;
+ if (_inCancelMessageBox)
+ {
+ _externalCloseMessageWasReceived = true;
+ break;
+ }
+ return OnExternalCloseMessage();
+ }
+ /*
+ case WM_SETTEXT:
+ {
+ if (_timer == 0)
+ return true;
+ }
+ */
+ }
+ return CModalDialog::OnMessage(message, wParam, lParam);
+}
+
+bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch (buttonID)
+ {
+ case IDCANCEL:
+ {
+ bool paused = Sync.GetPaused();
+ Sync.SetPaused(true);
+ _inCancelMessageBox = true;
+ // Mozilla Customization - Removed redundant cancel button from dialog.
+ int res = ::MessageBoxW(*this, L"Are you sure you want to cancel?", _title, MB_YESNO);
+ _inCancelMessageBox = false;
+ Sync.SetPaused(paused);
+ if (res == IDCANCEL || res == IDNO)
+ {
+ if (_externalCloseMessageWasReceived)
+ OnExternalCloseMessage();
+ return true;
+ }
+ break;
+ }
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CProgressDialog::CheckNeedClose()
+{
+ if (_needClose)
+ {
+ PostMsg(kCloseMessage);
+ _needClose = false;
+ }
+}
+
+bool CProgressDialog::OnExternalCloseMessage()
+{
+ End(0);
+ return true;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.h
new file mode 100644
index 0000000000..2a9d26d117
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.h
@@ -0,0 +1,170 @@
+// ProgressDialog.h
+
+#ifndef __PROGRESS_DIALOG_H
+#define __PROGRESS_DIALOG_H
+
+#include "../../../Windows/Synchronization.h"
+#include "../../../Windows/Thread.h"
+
+#include "../../../Windows/Control/Dialog.h"
+#include "../../../Windows/Control/ProgressBar.h"
+
+#include "ProgressDialogRes.h"
+
+class CProgressSync
+{
+ NWindows::NSynchronization::CCriticalSection _cs;
+ bool _stopped;
+ bool _paused;
+ UInt64 _total;
+ UInt64 _completed;
+public:
+ CProgressSync(): _stopped(false), _paused(false), _total(1), _completed(0) {}
+
+ HRESULT ProcessStopAndPause();
+ bool GetStopped()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ return _stopped;
+ }
+ void SetStopped(bool value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _stopped = value;
+ }
+ bool GetPaused()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ return _paused;
+ }
+ void SetPaused(bool value)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _paused = value;
+ }
+ void SetProgress(UInt64 total, UInt64 completed)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _total = total;
+ _completed = completed;
+ }
+ void SetPos(UInt64 completed)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _completed = completed;
+ }
+ void GetProgress(UInt64 &total, UInt64 &completed)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ total = _total;
+ completed = _completed;
+ }
+};
+
+class CU64ToI32Converter
+{
+ UInt64 _numShiftBits;
+public:
+ void Init(UInt64 range)
+ {
+ // Windows CE doesn't like big number here.
+ for (_numShiftBits = 0; range > (1 << 15); _numShiftBits++)
+ range >>= 1;
+ }
+ int Count(UInt64 value) { return int(value >> _numShiftBits); }
+};
+
+class CProgressDialog: public NWindows::NControl::CModalDialog
+{
+private:
+ UINT_PTR _timer;
+
+ UString _title;
+ CU64ToI32Converter _converter;
+ UInt64 _peviousPos;
+ UInt64 _range;
+ NWindows::NControl::CProgressBar m_ProgressBar;
+
+ int _prevPercentValue;
+
+ bool _wasCreated;
+ bool _needClose;
+ bool _inCancelMessageBox;
+ bool _externalCloseMessageWasReceived;
+
+ bool OnTimer(WPARAM timerID, LPARAM callback);
+ void SetRange(UInt64 range);
+ void SetPos(UInt64 pos);
+ virtual bool OnInit();
+ virtual void OnCancel();
+ virtual void OnOK();
+ NWindows::NSynchronization::CManualResetEvent _dialogCreatedEvent;
+ #ifndef _SFX
+ void AddToTitle(LPCWSTR string);
+ #endif
+ bool OnButtonClicked(int buttonID, HWND buttonHWND);
+
+ void WaitCreating() { _dialogCreatedEvent.Lock(); }
+ void CheckNeedClose();
+ bool OnExternalCloseMessage();
+public:
+ CProgressSync Sync;
+ int IconID;
+
+ #ifndef _SFX
+ HWND MainWindow;
+ UString MainTitle;
+ UString MainAddTitle;
+ ~CProgressDialog();
+ #endif
+
+ CProgressDialog(): _timer(0)
+ #ifndef _SFX
+ ,MainWindow(0)
+ #endif
+ {
+ IconID = -1;
+ _wasCreated = false;
+ _needClose = false;
+ _inCancelMessageBox = false;
+ _externalCloseMessageWasReceived = false;
+
+ if (_dialogCreatedEvent.Create() != S_OK)
+ throw 1334987;
+ }
+
+ INT_PTR Create(const UString &title, NWindows::CThread &thread, HWND wndParent = 0)
+ {
+ _title = title;
+ INT_PTR res = CModalDialog::Create(IDD_PROGRESS, wndParent);
+ thread.Wait();
+ return res;
+ }
+
+ enum
+ {
+ kCloseMessage = WM_APP + 1
+ };
+
+ virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+
+ void ProcessWasFinished()
+ {
+ WaitCreating();
+ if (_wasCreated)
+ PostMsg(kCloseMessage);
+ else
+ _needClose = true;
+ };
+};
+
+
+class CProgressCloser
+{
+ CProgressDialog *_p;
+public:
+ CProgressCloser(CProgressDialog &p) : _p(&p) {}
+ ~CProgressCloser() { _p->ProcessWasFinished(); }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.rc b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.rc
new file mode 100644
index 0000000000..5af370f74e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog.rc
@@ -0,0 +1,12 @@
+#include "ProgressDialogRes.h"
+#include "../../GuiCommon.rc"
+
+#define xc 172
+#define yc 44
+
+IDD_PROGRESS DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "Progress"
+BEGIN
+ PUSHBUTTON "Cancel", IDCANCEL, bx, by, bxs, bys
+ CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, m, m, xc, 14
+END
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.cpp
new file mode 100644
index 0000000000..bdb2be3f17
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.cpp
@@ -0,0 +1,1337 @@
+// ProgressDialog2.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/Control/Static.h"
+#include "../../../Windows/ErrorMsg.h"
+
+#include "../GUI/ExtractRes.h"
+
+#include "LangUtils.h"
+
+#include "DialogSize.h"
+#include "ProgressDialog2.h"
+#include "ProgressDialog2Res.h"
+
+using namespace NWindows;
+
+extern HINSTANCE g_hInstance;
+
+static const UINT_PTR kTimerID = 3;
+
+static const UINT kCloseMessage = WM_APP + 1;
+// we can't use WM_USER, since WM_USER can be used by standard Windows procedure for Dialog
+
+static const UINT kTimerElapse =
+ #ifdef UNDER_CE
+ 500
+ #else
+ 200
+ #endif
+ ;
+
+static const UINT kCreateDelay =
+ #ifdef UNDER_CE
+ 2500
+ #else
+ 500
+ #endif
+ ;
+
+static const DWORD kPauseSleepTime = 100;
+
+#ifdef LANG
+
+static const UInt32 kLangIDs[] =
+{
+ IDT_PROGRESS_ELAPSED,
+ IDT_PROGRESS_REMAINING,
+ IDT_PROGRESS_TOTAL,
+ IDT_PROGRESS_SPEED,
+ IDT_PROGRESS_PROCESSED,
+ IDT_PROGRESS_RATIO,
+ IDT_PROGRESS_ERRORS,
+ IDB_PROGRESS_BACKGROUND,
+ IDB_PAUSE
+};
+
+static const UInt32 kLangIDs_Colon[] =
+{
+ IDT_PROGRESS_PACKED,
+ IDT_PROGRESS_FILES
+};
+
+#endif
+
+
+#define UNDEFINED_VAL ((UInt64)(Int64)-1)
+#define INIT_AS_UNDEFINED(v) v = UNDEFINED_VAL;
+#define IS_UNDEFINED_VAL(v) ((v) == UNDEFINED_VAL)
+#define IS_DEFINED_VAL(v) ((v) != UNDEFINED_VAL)
+
+CProgressSync::CProgressSync():
+ _stopped(false), _paused(false),
+ _bytesProgressMode(true),
+ _totalBytes(UNDEFINED_VAL), _completedBytes(0),
+ _totalFiles(UNDEFINED_VAL), _curFiles(0),
+ _inSize(UNDEFINED_VAL),
+ _outSize(UNDEFINED_VAL),
+ _isDir(false)
+ {}
+
+#define CHECK_STOP if (_stopped) return E_ABORT; if (!_paused) return S_OK;
+#define CRITICAL_LOCK NSynchronization::CCriticalSectionLock lock(_cs);
+
+bool CProgressSync::Get_Paused()
+{
+ CRITICAL_LOCK
+ return _paused;
+}
+
+HRESULT CProgressSync::CheckStop()
+{
+ for (;;)
+ {
+ {
+ CRITICAL_LOCK
+ CHECK_STOP
+ }
+ ::Sleep(kPauseSleepTime);
+ }
+}
+
+HRESULT CProgressSync::ScanProgress(UInt64 numFiles, UInt64 totalSize, const FString &fileName, bool isDir)
+{
+ {
+ CRITICAL_LOCK
+ _totalFiles = numFiles;
+ _totalBytes = totalSize;
+ _filePath = fs2us(fileName);
+ _isDir = isDir;
+ // _completedBytes = 0;
+ CHECK_STOP
+ }
+ return CheckStop();
+}
+
+HRESULT CProgressSync::Set_NumFilesTotal(UInt64 val)
+{
+ {
+ CRITICAL_LOCK
+ _totalFiles = val;
+ CHECK_STOP
+ }
+ return CheckStop();
+}
+
+void CProgressSync::Set_NumBytesTotal(UInt64 val)
+{
+ CRITICAL_LOCK
+ _totalBytes = val;
+}
+
+void CProgressSync::Set_NumFilesCur(UInt64 val)
+{
+ CRITICAL_LOCK
+ _curFiles = val;
+}
+
+HRESULT CProgressSync::Set_NumBytesCur(const UInt64 *val)
+{
+ {
+ CRITICAL_LOCK
+ if (val)
+ _completedBytes = *val;
+ CHECK_STOP
+ }
+ return CheckStop();
+}
+
+HRESULT CProgressSync::Set_NumBytesCur(UInt64 val)
+{
+ {
+ CRITICAL_LOCK
+ _completedBytes = val;
+ CHECK_STOP
+ }
+ return CheckStop();
+}
+
+void CProgressSync::Set_Ratio(const UInt64 *inSize, const UInt64 *outSize)
+{
+ CRITICAL_LOCK
+ if (inSize)
+ _inSize = *inSize;
+ if (outSize)
+ _outSize = *outSize;
+}
+
+void CProgressSync::Set_TitleFileName(const UString &fileName)
+{
+ CRITICAL_LOCK
+ _titleFileName = fileName;
+}
+
+void CProgressSync::Set_Status(const UString &s)
+{
+ CRITICAL_LOCK
+ _status = s;
+}
+
+HRESULT CProgressSync::Set_Status2(const UString &s, const wchar_t *path, bool isDir)
+{
+ {
+ CRITICAL_LOCK
+ _status = s;
+ if (path)
+ _filePath = path;
+ else
+ _filePath.Empty();
+ _isDir = isDir;
+ }
+ return CheckStop();
+}
+
+void CProgressSync::Set_FilePath(const wchar_t *path, bool isDir)
+{
+ CRITICAL_LOCK
+ if (path)
+ _filePath = path;
+ else
+ _filePath.Empty();
+ _isDir = isDir;
+}
+
+
+void CProgressSync::AddError_Message(const wchar_t *message)
+{
+ CRITICAL_LOCK
+ Messages.Add(message);
+}
+
+void CProgressSync::AddError_Message_Name(const wchar_t *message, const wchar_t *name)
+{
+ UString s;
+ if (name && *name != 0)
+ s += name;
+ if (message && *message != 0)
+ {
+ if (!s.IsEmpty())
+ s.Add_LF();
+ s += message;
+ if (!s.IsEmpty() && s.Back() == L'\n')
+ s.DeleteBack();
+ }
+ AddError_Message(s);
+}
+
+void CProgressSync::AddError_Code_Name(DWORD systemError, const wchar_t *name)
+{
+ UString s = NError::MyFormatMessage(systemError);
+ if (systemError == 0)
+ s = "Error";
+ AddError_Message_Name(s, name);
+}
+
+CProgressDialog::CProgressDialog():
+ _timer(0),
+ CompressingMode(true),
+ MainWindow(0)
+{
+ _isDir = false;
+
+ _numMessages = 0;
+ IconID = -1;
+ MessagesDisplayed = false;
+ _wasCreated = false;
+ _needClose = false;
+ _inCancelMessageBox = false;
+ _externalCloseMessageWasReceived = false;
+
+ _numPostedMessages = 0;
+ _numAutoSizeMessages = 0;
+ _errorsWereDisplayed = false;
+ _waitCloseByCancelButton = false;
+ _cancelWasPressed = false;
+ ShowCompressionInfo = true;
+ WaitMode = false;
+ if (_dialogCreatedEvent.Create() != S_OK)
+ throw 1334987;
+ if (_createDialogEvent.Create() != S_OK)
+ throw 1334987;
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_ITaskbarList3, (void**)&_taskbarList);
+ if (_taskbarList)
+ _taskbarList->HrInit();
+ #endif
+}
+
+#ifndef _SFX
+
+CProgressDialog::~CProgressDialog()
+{
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ SetTaskbarProgressState(TBPF_NOPROGRESS);
+ #endif
+ AddToTitle(L"");
+}
+void CProgressDialog::AddToTitle(LPCWSTR s)
+{
+ if (MainWindow != 0)
+ {
+ CWindow window(MainWindow);
+ window.SetText((UString)s + MainTitle);
+ }
+}
+
+#endif
+
+
+void CProgressDialog::SetTaskbarProgressState()
+{
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ if (_taskbarList && _hwndForTaskbar)
+ {
+ TBPFLAG tbpFlags;
+ if (Sync.Get_Paused())
+ tbpFlags = TBPF_PAUSED;
+ else
+ tbpFlags = _errorsWereDisplayed ? TBPF_ERROR: TBPF_NORMAL;
+ SetTaskbarProgressState(tbpFlags);
+ }
+ #endif
+}
+
+static const unsigned kTitleFileNameSizeLimit = 36;
+static const unsigned kCurrentFileNameSizeLimit = 82;
+
+static void ReduceString(UString &s, unsigned size)
+{
+ if (s.Len() <= size)
+ return;
+ s.Delete(size / 2, s.Len() - size);
+ s.Insert(size / 2, L" ... ");
+}
+
+void CProgressDialog::EnableErrorsControls(bool enable)
+{
+ ShowItem_Bool(IDT_PROGRESS_ERRORS, enable);
+ ShowItem_Bool(IDT_PROGRESS_ERRORS_VAL, enable);
+ ShowItem_Bool(IDL_PROGRESS_MESSAGES, enable);
+}
+
+bool CProgressDialog::OnInit()
+{
+ _hwndForTaskbar = MainWindow;
+ if (!_hwndForTaskbar)
+ _hwndForTaskbar = GetParent();
+ if (!_hwndForTaskbar)
+ _hwndForTaskbar = *this;
+
+ INIT_AS_UNDEFINED(_progressBar_Range);
+ INIT_AS_UNDEFINED(_progressBar_Pos);
+
+ INIT_AS_UNDEFINED(_prevPercentValue);
+ INIT_AS_UNDEFINED(_prevElapsedSec);
+ INIT_AS_UNDEFINED(_prevRemainingSec);
+
+ INIT_AS_UNDEFINED(_prevSpeed);
+ _prevSpeed_MoveBits = 0;
+
+ _prevTime = ::GetTickCount();
+ _elapsedTime = 0;
+
+ INIT_AS_UNDEFINED(_totalBytes_Prev);
+ INIT_AS_UNDEFINED(_processed_Prev);
+ INIT_AS_UNDEFINED(_packed_Prev);
+ INIT_AS_UNDEFINED(_ratio_Prev);
+ _filesStr_Prev.Empty();
+
+ _foreground = true;
+
+ m_ProgressBar.Attach(GetItem(IDC_PROGRESS1));
+ _messageList.Attach(GetItem(IDL_PROGRESS_MESSAGES));
+ _messageList.SetUnicodeFormat();
+
+ _wasCreated = true;
+ _dialogCreatedEvent.Set();
+
+ #ifdef LANG
+ LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
+ LangSetDlgItems_Colon(*this, kLangIDs_Colon, ARRAY_SIZE(kLangIDs_Colon));
+ #endif
+
+ CWindow window(GetItem(IDB_PROGRESS_BACKGROUND));
+ window.GetText(_background_String);
+ _backgrounded_String = _background_String;
+ _backgrounded_String.RemoveChar(L'&');
+
+ window = GetItem(IDB_PAUSE);
+ window.GetText(_pause_String);
+
+ LangString(IDS_PROGRESS_FOREGROUND, _foreground_String);
+ LangString(IDS_CONTINUE, _continue_String);
+ LangString(IDS_PROGRESS_PAUSED, _paused_String);
+
+ SetText(_title);
+ SetPauseText();
+ SetPriorityText();
+
+ _messageList.InsertColumn(0, L"", 30);
+ _messageList.InsertColumn(1, L"", 600);
+
+ _messageList.SetColumnWidthAuto(0);
+ _messageList.SetColumnWidthAuto(1);
+
+ EnableErrorsControls(false);
+
+ GetItemSizes(IDCANCEL, _buttonSizeX, _buttonSizeY);
+ _numReduceSymbols = kCurrentFileNameSizeLimit;
+ NormalizeSize(true);
+
+ if (!ShowCompressionInfo)
+ {
+ HideItem(IDT_PROGRESS_PACKED);
+ HideItem(IDT_PROGRESS_PACKED_VAL);
+ HideItem(IDT_PROGRESS_RATIO);
+ HideItem(IDT_PROGRESS_RATIO_VAL);
+ }
+
+ if (IconID >= 0)
+ {
+ HICON icon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IconID));
+ // SetIcon(ICON_SMALL, icon);
+ SetIcon(ICON_BIG, icon);
+ }
+ _timer = SetTimer(kTimerID, kTimerElapse);
+ #ifdef UNDER_CE
+ Foreground();
+ #endif
+
+ CheckNeedClose();
+
+ SetTaskbarProgressState();
+
+ return CModalDialog::OnInit();
+}
+
+static const UINT kIDs[] =
+{
+ IDT_PROGRESS_ELAPSED, IDT_PROGRESS_ELAPSED_VAL,
+ IDT_PROGRESS_REMAINING, IDT_PROGRESS_REMAINING_VAL,
+ IDT_PROGRESS_FILES, IDT_PROGRESS_FILES_VAL,
+ IDT_PROGRESS_RATIO, IDT_PROGRESS_RATIO_VAL,
+ IDT_PROGRESS_ERRORS, IDT_PROGRESS_ERRORS_VAL,
+
+ IDT_PROGRESS_TOTAL, IDT_PROGRESS_TOTAL_VAL,
+ IDT_PROGRESS_SPEED, IDT_PROGRESS_SPEED_VAL,
+ IDT_PROGRESS_PROCESSED, IDT_PROGRESS_PROCESSED_VAL,
+ IDT_PROGRESS_PACKED, IDT_PROGRESS_PACKED_VAL
+};
+
+bool CProgressDialog::OnSize(WPARAM /* wParam */, int xSize, int ySize)
+{
+ int sY;
+ int sStep;
+ int mx, my;
+ {
+ RECT r;
+ GetClientRectOfItem(IDT_PROGRESS_ELAPSED, r);
+ mx = r.left;
+ my = r.top;
+ sY = RECT_SIZE_Y(r);
+ GetClientRectOfItem(IDT_PROGRESS_REMAINING, r);
+ sStep = r.top - my;
+ }
+
+ InvalidateRect(NULL);
+
+ int xSizeClient = xSize - mx * 2;
+
+ {
+ int i;
+ for (i = 800; i > 40; i = i * 9 / 10)
+ if (Units_To_Pixels_X(i) <= xSizeClient)
+ break;
+ _numReduceSymbols = i / 4;
+ }
+
+ int yPos = ySize - my - _buttonSizeY;
+
+ ChangeSubWindowSizeX(GetItem(IDT_PROGRESS_STATUS), xSize - mx * 2);
+ ChangeSubWindowSizeX(GetItem(IDT_PROGRESS_FILE_NAME), xSize - mx * 2);
+ ChangeSubWindowSizeX(GetItem(IDC_PROGRESS1), xSize - mx * 2);
+
+ int bSizeX = _buttonSizeX;
+ int mx2 = mx;
+ for (;; mx2--)
+ {
+ int bSize2 = bSizeX * 3 + mx2 * 2;
+ if (bSize2 <= xSizeClient)
+ break;
+ if (mx2 < 5)
+ {
+ bSizeX = (xSizeClient - mx2 * 2) / 3;
+ break;
+ }
+ }
+ if (bSizeX < 2)
+ bSizeX = 2;
+
+ {
+ RECT r;
+ GetClientRectOfItem(IDL_PROGRESS_MESSAGES, r);
+ int y = r.top;
+ int ySize2 = yPos - my - y;
+ const int kMinYSize = _buttonSizeY + _buttonSizeY * 3 / 4;
+ int xx = xSize - mx * 2;
+ if (ySize2 < kMinYSize)
+ {
+ ySize2 = kMinYSize;
+ if (xx > bSizeX * 2)
+ xx -= bSizeX;
+ }
+
+ _messageList.Move(mx, y, xx, ySize2);
+ }
+
+ {
+ int xPos = xSize - mx;
+ xPos -= bSizeX;
+ MoveItem(IDCANCEL, xPos, yPos, bSizeX, _buttonSizeY);
+ xPos -= (mx2 + bSizeX);
+ MoveItem(IDB_PAUSE, xPos, yPos, bSizeX, _buttonSizeY);
+ xPos -= (mx2 + bSizeX);
+ MoveItem(IDB_PROGRESS_BACKGROUND, xPos, yPos, bSizeX, _buttonSizeY);
+ }
+
+ int valueSize;
+ int labelSize;
+ int padSize;
+
+ labelSize = Units_To_Pixels_X(MY_PROGRESS_LABEL_UNITS_MIN);
+ valueSize = Units_To_Pixels_X(MY_PROGRESS_VAL_UNITS);
+ padSize = Units_To_Pixels_X(MY_PROGRESS_PAD_UNITS);
+ int requiredSize = (labelSize + valueSize) * 2 + padSize;
+
+ int gSize;
+ {
+ if (requiredSize < xSizeClient)
+ {
+ int incr = (xSizeClient - requiredSize) / 3;
+ labelSize += incr;
+ }
+ else
+ labelSize = (xSizeClient - valueSize * 2 - padSize) / 2;
+ if (labelSize < 0)
+ labelSize = 0;
+
+ gSize = labelSize + valueSize;
+ padSize = xSizeClient - gSize * 2;
+ }
+
+ labelSize = gSize - valueSize;
+
+ yPos = my;
+ for (int i = 0; i < ARRAY_SIZE(kIDs); i += 2)
+ {
+ int x = mx;
+ const int kNumColumn1Items = 5 * 2;
+ if (i >= kNumColumn1Items)
+ {
+ if (i == kNumColumn1Items)
+ yPos = my;
+ x = mx + gSize + padSize;
+ }
+ MoveItem(kIDs[i], x, yPos, labelSize, sY);
+ MoveItem(kIDs[i + 1], x + labelSize, yPos, valueSize, sY);
+ yPos += sStep;
+ }
+ return false;
+}
+
+void CProgressDialog::OnCancel() { Sync.Set_Stopped(true); }
+void CProgressDialog::OnOK() { }
+
+void CProgressDialog::SetProgressRange(UInt64 range)
+{
+ if (range == _progressBar_Range)
+ return;
+ _progressBar_Range = range;
+ INIT_AS_UNDEFINED(_progressBar_Pos);
+ _progressConv.Init(range);
+ m_ProgressBar.SetRange32(0, _progressConv.Count(range));
+}
+
+void CProgressDialog::SetProgressPos(UInt64 pos)
+{
+ if (pos >= _progressBar_Range ||
+ pos <= _progressBar_Pos ||
+ pos - _progressBar_Pos >= (_progressBar_Range >> 10))
+ {
+ m_ProgressBar.SetPos(_progressConv.Count(pos));
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ if (_taskbarList && _hwndForTaskbar)
+ _taskbarList->SetProgressValue(_hwndForTaskbar, pos, _progressBar_Range);
+ #endif
+ _progressBar_Pos = pos;
+ }
+}
+
+#define UINT_TO_STR_2(val) { s[0] = (wchar_t)('0' + (val) / 10); s[1] = (wchar_t)('0' + (val) % 10); s += 2; }
+
+void GetTimeString(UInt64 timeValue, wchar_t *s)
+{
+ UInt64 hours = timeValue / 3600;
+ UInt32 seconds = (UInt32)(timeValue - hours * 3600);
+ UInt32 minutes = seconds / 60;
+ seconds %= 60;
+ if (hours > 99)
+ {
+ ConvertUInt64ToString(hours, s);
+ for (; *s != 0; s++);
+ }
+ else
+ {
+ UInt32 hours32 = (UInt32)hours;
+ UINT_TO_STR_2(hours32);
+ }
+ *s++ = ':'; UINT_TO_STR_2(minutes);
+ *s++ = ':'; UINT_TO_STR_2(seconds);
+ *s = 0;
+}
+
+static void ConvertSizeToString(UInt64 v, wchar_t *s)
+{
+ Byte c = 0;
+ if (v >= ((UInt64)100000 << 20)) { v >>= 30; c = 'G'; }
+ else if (v >= ((UInt64)100000 << 10)) { v >>= 20; c = 'M'; }
+ else if (v >= ((UInt64)100000 << 0)) { v >>= 10; c = 'K'; }
+ ConvertUInt64ToString(v, s);
+ if (c != 0)
+ {
+ s += MyStringLen(s);
+ *s++ = ' ';
+ *s++ = c;
+ *s++ = 0;
+ }
+}
+
+void CProgressDialog::ShowSize(int id, UInt64 val, UInt64 &prev)
+{
+ if (val == prev)
+ return;
+ prev = val;
+ wchar_t s[40];
+ s[0] = 0;
+ if (IS_DEFINED_VAL(val))
+ ConvertSizeToString(val, s);
+ SetItemText(id, s);
+}
+
+static void GetChangedString(const UString &newStr, UString &prevStr, bool &hasChanged)
+{
+ hasChanged = !(prevStr == newStr);
+ if (hasChanged)
+ prevStr = newStr;
+}
+
+static unsigned GetPower32(UInt32 val)
+{
+ const unsigned kStart = 32;
+ UInt32 mask = ((UInt32)1 << (kStart - 1));
+ for (unsigned i = kStart;; i--)
+ {
+ if (i == 0 || (val & mask) != 0)
+ return i;
+ mask >>= 1;
+ }
+}
+
+static unsigned GetPower64(UInt64 val)
+{
+ UInt32 high = (UInt32)(val >> 32);
+ if (high == 0)
+ return GetPower32((UInt32)val);
+ return GetPower32(high) + 32;
+}
+
+static UInt64 MyMultAndDiv(UInt64 mult1, UInt64 mult2, UInt64 divider)
+{
+ unsigned pow1 = GetPower64(mult1);
+ unsigned pow2 = GetPower64(mult2);
+ while (pow1 + pow2 > 64)
+ {
+ if (pow1 > pow2) { pow1--; mult1 >>= 1; }
+ else { pow2--; mult2 >>= 1; }
+ divider >>= 1;
+ }
+ UInt64 res = mult1 * mult2;
+ if (divider != 0)
+ res /= divider;
+ return res;
+}
+
+void CProgressDialog::UpdateStatInfo(bool showAll)
+{
+ UInt64 total, completed, totalFiles, completedFiles, inSize, outSize;
+ bool bytesProgressMode;
+
+ bool titleFileName_Changed;
+ bool curFilePath_Changed;
+ bool status_Changed;
+ unsigned numErrors;
+ {
+ NSynchronization::CCriticalSectionLock lock(Sync._cs);
+ total = Sync._totalBytes;
+ completed = Sync._completedBytes;
+ totalFiles = Sync._totalFiles;
+ completedFiles = Sync._curFiles;
+ inSize = Sync._inSize;
+ outSize = Sync._outSize;
+ bytesProgressMode = Sync._bytesProgressMode;
+
+ GetChangedString(Sync._titleFileName, _titleFileName, titleFileName_Changed);
+ GetChangedString(Sync._filePath, _filePath, curFilePath_Changed);
+ GetChangedString(Sync._status, _status, status_Changed);
+ if (_isDir != Sync._isDir)
+ {
+ curFilePath_Changed = true;
+ _isDir = Sync._isDir;
+ }
+ numErrors = Sync.Messages.Size();
+ }
+
+ UInt32 curTime = ::GetTickCount();
+
+ const UInt64 progressTotal = bytesProgressMode ? total : totalFiles;
+ const UInt64 progressCompleted = bytesProgressMode ? completed : completedFiles;
+ {
+ if (IS_UNDEFINED_VAL(progressTotal))
+ {
+ // SetPos(0);
+ // SetRange(progressCompleted);
+ }
+ else
+ {
+ if (_progressBar_Pos != 0 || progressCompleted != 0 ||
+ (_progressBar_Range == 0 && progressTotal != 0))
+ {
+ SetProgressRange(progressTotal);
+ SetProgressPos(progressCompleted);
+ }
+ }
+ }
+
+ ShowSize(IDT_PROGRESS_TOTAL_VAL, total, _totalBytes_Prev);
+
+ _elapsedTime += (curTime - _prevTime);
+ _prevTime = curTime;
+ UInt64 elapsedSec = _elapsedTime / 1000;
+ bool elapsedChanged = false;
+ if (elapsedSec != _prevElapsedSec)
+ {
+ _prevElapsedSec = elapsedSec;
+ elapsedChanged = true;
+ wchar_t s[40];
+ GetTimeString(elapsedSec, s);
+ SetItemText(IDT_PROGRESS_ELAPSED_VAL, s);
+ }
+
+ bool needSetTitle = false;
+ if (elapsedChanged || showAll)
+ {
+ if (numErrors > _numPostedMessages)
+ {
+ UpdateMessagesDialog();
+ wchar_t s[32];
+ ConvertUInt64ToString(numErrors, s);
+ SetItemText(IDT_PROGRESS_ERRORS_VAL, s);
+ if (!_errorsWereDisplayed)
+ {
+ _errorsWereDisplayed = true;
+ EnableErrorsControls(true);
+ SetTaskbarProgressState();
+ }
+ }
+
+ if (progressCompleted != 0)
+ {
+ if (IS_UNDEFINED_VAL(progressTotal))
+ {
+ if (IS_DEFINED_VAL(_prevRemainingSec))
+ {
+ INIT_AS_UNDEFINED(_prevRemainingSec);
+ SetItemText(IDT_PROGRESS_REMAINING_VAL, L"");
+ }
+ }
+ else
+ {
+ UInt64 remainingTime = 0;
+ if (progressCompleted < progressTotal)
+ remainingTime = MyMultAndDiv(_elapsedTime, progressTotal - progressCompleted, progressCompleted);
+ UInt64 remainingSec = remainingTime / 1000;
+ if (remainingSec != _prevRemainingSec)
+ {
+ _prevRemainingSec = remainingSec;
+ wchar_t s[40];
+ GetTimeString(remainingSec, s);
+ SetItemText(IDT_PROGRESS_REMAINING_VAL, s);
+ }
+ }
+ {
+ UInt64 elapsedTime = (_elapsedTime == 0) ? 1 : _elapsedTime;
+ UInt64 v = (progressCompleted * 1000) / elapsedTime;
+ Byte c = 0;
+ unsigned moveBits = 0;
+ if (v >= ((UInt64)10000 << 10)) { moveBits = 20; c = 'M'; }
+ else if (v >= ((UInt64)10000 << 0)) { moveBits = 10; c = 'K'; }
+ v >>= moveBits;
+ if (moveBits != _prevSpeed_MoveBits || v != _prevSpeed)
+ {
+ _prevSpeed_MoveBits = moveBits;
+ _prevSpeed = v;
+ wchar_t s[40];
+ ConvertUInt64ToString(v, s);
+ unsigned pos = MyStringLen(s);
+ s[pos++] = ' ';
+ if (moveBits != 0)
+ s[pos++] = c;
+ s[pos++] = 'B';
+ s[pos++] = '/';
+ s[pos++] = 's';
+ s[pos++] = 0;
+ SetItemText(IDT_PROGRESS_SPEED_VAL, s);
+ }
+ }
+ }
+
+ {
+ UInt64 percent = 0;
+ {
+ if (IS_DEFINED_VAL(progressTotal))
+ {
+ percent = progressCompleted * 100;
+ if (progressTotal != 0)
+ percent /= progressTotal;
+ }
+ }
+ if (percent != _prevPercentValue)
+ {
+ _prevPercentValue = percent;
+ needSetTitle = true;
+ }
+ }
+
+ {
+ wchar_t s[64];
+ ConvertUInt64ToString(completedFiles, s);
+ if (IS_DEFINED_VAL(totalFiles))
+ {
+ MyStringCat(s, L" / ");
+ ConvertUInt64ToString(totalFiles, s + MyStringLen(s));
+ }
+ if (_filesStr_Prev != s)
+ {
+ _filesStr_Prev = s;
+ SetItemText(IDT_PROGRESS_FILES_VAL, s);
+ }
+ }
+
+ const UInt64 packSize = CompressingMode ? outSize : inSize;
+ const UInt64 unpackSize = CompressingMode ? inSize : outSize;
+
+ if (IS_UNDEFINED_VAL(unpackSize) &&
+ IS_UNDEFINED_VAL(packSize))
+ {
+ ShowSize(IDT_PROGRESS_PROCESSED_VAL, completed, _processed_Prev);
+ ShowSize(IDT_PROGRESS_PACKED_VAL, UNDEFINED_VAL, _packed_Prev);
+ }
+ else
+ {
+ ShowSize(IDT_PROGRESS_PROCESSED_VAL, unpackSize, _processed_Prev);
+ ShowSize(IDT_PROGRESS_PACKED_VAL, packSize, _packed_Prev);
+
+ if (IS_DEFINED_VAL(packSize) &&
+ IS_DEFINED_VAL(unpackSize) &&
+ unpackSize != 0)
+ {
+ wchar_t s[32];
+ UInt64 ratio = packSize * 100 / unpackSize;
+ if (_ratio_Prev != ratio)
+ {
+ _ratio_Prev = ratio;
+ ConvertUInt64ToString(ratio, s);
+ MyStringCat(s, L"%");
+ SetItemText(IDT_PROGRESS_RATIO_VAL, s);
+ }
+ }
+ }
+ }
+
+ if (needSetTitle || titleFileName_Changed)
+ SetTitleText();
+
+ if (status_Changed)
+ {
+ UString s = _status;
+ ReduceString(s, _numReduceSymbols);
+ SetItemText(IDT_PROGRESS_STATUS, _status);
+ }
+
+ if (curFilePath_Changed)
+ {
+ UString s1, s2;
+ if (_isDir)
+ s1 = _filePath;
+ else
+ {
+ int slashPos = _filePath.ReverseFind_PathSepar();
+ if (slashPos >= 0)
+ {
+ s1.SetFrom(_filePath, slashPos + 1);
+ s2 = _filePath.Ptr(slashPos + 1);
+ }
+ else
+ s2 = _filePath;
+ }
+ ReduceString(s1, _numReduceSymbols);
+ ReduceString(s2, _numReduceSymbols);
+ s1.Add_LF();
+ s1 += s2;
+ SetItemText(IDT_PROGRESS_FILE_NAME, s1);
+ }
+}
+
+bool CProgressDialog::OnTimer(WPARAM /* timerID */, LPARAM /* callback */)
+{
+ if (Sync.Get_Paused())
+ return true;
+ CheckNeedClose();
+ UpdateStatInfo(false);
+ return true;
+}
+
+struct CWaitCursor
+{
+ HCURSOR _waitCursor;
+ HCURSOR _oldCursor;
+ CWaitCursor()
+ {
+ _waitCursor = LoadCursor(NULL, IDC_WAIT);
+ if (_waitCursor != NULL)
+ _oldCursor = SetCursor(_waitCursor);
+ }
+ ~CWaitCursor()
+ {
+ if (_waitCursor != NULL)
+ SetCursor(_oldCursor);
+ }
+};
+
+INT_PTR CProgressDialog::Create(const UString &title, NWindows::CThread &thread, HWND wndParent)
+{
+ INT_PTR res = 0;
+ try
+ {
+ if (WaitMode)
+ {
+ CWaitCursor waitCursor;
+ HANDLE h[] = { thread, _createDialogEvent };
+
+ WRes res2 = WaitForMultipleObjects(ARRAY_SIZE(h), h, FALSE, kCreateDelay);
+ if (res2 == WAIT_OBJECT_0 && !Sync.ThereIsMessage())
+ return 0;
+ }
+ _title = title;
+ BIG_DIALOG_SIZE(360, 192);
+ res = CModalDialog::Create(SIZED_DIALOG(IDD_PROGRESS), wndParent);
+ }
+ catch(...)
+ {
+ _wasCreated = true;
+ _dialogCreatedEvent.Set();
+ res = res;
+ }
+ thread.Wait();
+ if (!MessagesDisplayed)
+ MessageBoxW(wndParent, L"Progress Error", L"7-Zip", MB_ICONERROR);
+ return res;
+}
+
+bool CProgressDialog::OnExternalCloseMessage()
+{
+ // it doesn't work if there is MessageBox.
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ SetTaskbarProgressState(TBPF_NOPROGRESS);
+ #endif
+ // AddToTitle(L"Finished ");
+ // SetText(L"Finished2 ");
+
+ UpdateStatInfo(true);
+
+ SetItemText(IDCANCEL, LangString(IDS_CLOSE));
+ ::SendMessage(GetItem(IDCANCEL), BM_SETSTYLE, BS_DEFPUSHBUTTON, MAKELPARAM(TRUE, 0));
+ HideItem(IDB_PROGRESS_BACKGROUND);
+ HideItem(IDB_PAUSE);
+
+ ProcessWasFinished_GuiVirt();
+
+ bool thereAreMessages;
+ CProgressFinalMessage fm;
+ {
+ NSynchronization::CCriticalSectionLock lock(Sync._cs);
+ thereAreMessages = !Sync.Messages.IsEmpty();
+ fm = Sync.FinalMessage;
+ }
+
+ if (!fm.ErrorMessage.Message.IsEmpty())
+ {
+ MessagesDisplayed = true;
+ if (fm.ErrorMessage.Title.IsEmpty())
+ fm.ErrorMessage.Title = "7-Zip";
+ MessageBoxW(*this, fm.ErrorMessage.Message, fm.ErrorMessage.Title, MB_ICONERROR);
+ }
+ else if (!thereAreMessages)
+ {
+ MessagesDisplayed = true;
+
+ if (!fm.OkMessage.Message.IsEmpty())
+ {
+ if (fm.OkMessage.Title.IsEmpty())
+ fm.OkMessage.Title = "7-Zip";
+ MessageBoxW(*this, fm.OkMessage.Message, fm.OkMessage.Title, MB_OK);
+ }
+ }
+
+ if (thereAreMessages && !_cancelWasPressed)
+ {
+ _waitCloseByCancelButton = true;
+ UpdateMessagesDialog();
+ return true;
+ }
+
+ End(0);
+ return true;
+}
+
+bool CProgressDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message)
+ {
+ case kCloseMessage:
+ {
+ KillTimer(_timer);
+ _timer = 0;
+ if (_inCancelMessageBox)
+ {
+ _externalCloseMessageWasReceived = true;
+ break;
+ }
+ return OnExternalCloseMessage();
+ }
+ /*
+ case WM_SETTEXT:
+ {
+ if (_timer == 0)
+ return true;
+ break;
+ }
+ */
+ }
+ return CModalDialog::OnMessage(message, wParam, lParam);
+}
+
+void CProgressDialog::SetTitleText()
+{
+ UString s;
+ if (Sync.Get_Paused())
+ {
+ s += _paused_String;
+ s.Add_Space();
+ }
+ if (IS_DEFINED_VAL(_prevPercentValue))
+ {
+ char temp[32];
+ ConvertUInt64ToString(_prevPercentValue, temp);
+ s += temp;
+ s += '%';
+ }
+ if (!_foreground)
+ {
+ s.Add_Space();
+ s += _backgrounded_String;
+ }
+
+ s.Add_Space();
+ #ifndef _SFX
+ {
+ unsigned len = s.Len();
+ s += MainAddTitle;
+ AddToTitle(s);
+ s.DeleteFrom(len);
+ }
+ #endif
+
+ s += _title;
+ if (!_titleFileName.IsEmpty())
+ {
+ UString fileName = _titleFileName;
+ ReduceString(fileName, kTitleFileNameSizeLimit);
+ s.Add_Space();
+ s += fileName;
+ }
+ SetText(s);
+}
+
+void CProgressDialog::SetPauseText()
+{
+ SetItemText(IDB_PAUSE, Sync.Get_Paused() ? _continue_String : _pause_String);
+ SetTitleText();
+}
+
+void CProgressDialog::OnPauseButton()
+{
+ bool paused = !Sync.Get_Paused();
+ Sync.Set_Paused(paused);
+ UInt32 curTime = ::GetTickCount();
+ if (paused)
+ _elapsedTime += (curTime - _prevTime);
+ SetTaskbarProgressState();
+ _prevTime = curTime;
+ SetPauseText();
+}
+
+void CProgressDialog::SetPriorityText()
+{
+ SetItemText(IDB_PROGRESS_BACKGROUND, _foreground ?
+ _background_String :
+ _foreground_String);
+ SetTitleText();
+}
+
+void CProgressDialog::OnPriorityButton()
+{
+ _foreground = !_foreground;
+ #ifndef UNDER_CE
+ SetPriorityClass(GetCurrentProcess(), _foreground ? NORMAL_PRIORITY_CLASS: IDLE_PRIORITY_CLASS);
+ #endif
+ SetPriorityText();
+}
+
+void CProgressDialog::AddMessageDirect(LPCWSTR message, bool needNumber)
+{
+ int itemIndex = _messageList.GetItemCount();
+ wchar_t sz[16];
+ sz[0] = 0;
+ if (needNumber)
+ ConvertUInt32ToString(_numMessages + 1, sz);
+ _messageList.InsertItem(itemIndex, sz);
+ _messageList.SetSubItem(itemIndex, 1, message);
+}
+
+void CProgressDialog::AddMessage(LPCWSTR message)
+{
+ UString s = message;
+ bool needNumber = true;
+ while (!s.IsEmpty())
+ {
+ int pos = s.Find(L'\n');
+ if (pos < 0)
+ break;
+ AddMessageDirect(s.Left(pos), needNumber);
+ needNumber = false;
+ s.DeleteFrontal(pos + 1);
+ }
+ AddMessageDirect(s, needNumber);
+ _numMessages++;
+}
+
+static unsigned GetNumDigits(UInt32 val)
+{
+ unsigned i;
+ for (i = 0; val >= 10; i++)
+ val /= 10;
+ return i;
+}
+
+void CProgressDialog::UpdateMessagesDialog()
+{
+ UStringVector messages;
+ {
+ NSynchronization::CCriticalSectionLock lock(Sync._cs);
+ unsigned num = Sync.Messages.Size();
+ if (num > _numPostedMessages)
+ {
+ messages.ClearAndReserve(num - _numPostedMessages);
+ for (unsigned i = _numPostedMessages; i < num; i++)
+ messages.AddInReserved(Sync.Messages[i]);
+ _numPostedMessages = num;
+ }
+ }
+ if (!messages.IsEmpty())
+ {
+ FOR_VECTOR (i, messages)
+ AddMessage(messages[i]);
+ if (_numAutoSizeMessages < 256 || GetNumDigits(_numPostedMessages) > GetNumDigits(_numAutoSizeMessages))
+ {
+ _messageList.SetColumnWidthAuto(0);
+ _messageList.SetColumnWidthAuto(1);
+ _numAutoSizeMessages = _numPostedMessages;
+ }
+ }
+}
+
+
+bool CProgressDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch (buttonID)
+ {
+ // case IDOK: // if IDCANCEL is not DEFPUSHBUTTON
+ case IDCANCEL:
+ {
+ if (_waitCloseByCancelButton)
+ {
+ MessagesDisplayed = true;
+ End(IDCLOSE);
+ break;
+ }
+
+ bool paused = Sync.Get_Paused();
+ if (!paused)
+ OnPauseButton();
+ _inCancelMessageBox = true;
+ int res = ::MessageBoxW(*this, LangString(IDS_PROGRESS_ASK_CANCEL), _title, MB_YESNOCANCEL);
+ _inCancelMessageBox = false;
+ if (!paused)
+ OnPauseButton();
+ if (res == IDCANCEL || res == IDNO)
+ {
+ if (_externalCloseMessageWasReceived)
+ OnExternalCloseMessage();
+ return true;
+ }
+
+ _cancelWasPressed = true;
+ MessagesDisplayed = true;
+ break;
+ }
+
+ case IDB_PAUSE:
+ OnPauseButton();
+ return true;
+ case IDB_PROGRESS_BACKGROUND:
+ OnPriorityButton();
+ return true;
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CProgressDialog::CheckNeedClose()
+{
+ if (_needClose)
+ {
+ PostMsg(kCloseMessage);
+ _needClose = false;
+ }
+}
+
+void CProgressDialog::ProcessWasFinished()
+{
+ // Set Window title here.
+ if (!WaitMode)
+ WaitCreating();
+
+ if (_wasCreated)
+ PostMsg(kCloseMessage);
+ else
+ _needClose = true;
+}
+
+
+static THREAD_FUNC_DECL MyThreadFunction(void *param)
+{
+ CProgressThreadVirt *p = (CProgressThreadVirt *)param;
+ try
+ {
+ p->Process();
+ p->ThreadFinishedOK = true;
+ }
+ catch (...) { p->Result = E_FAIL; }
+ return 0;
+}
+
+
+HRESULT CProgressThreadVirt::Create(const UString &title, HWND parentWindow)
+{
+ NWindows::CThread thread;
+ RINOK(thread.Create(MyThreadFunction, this));
+ CProgressDialog::Create(title, thread, parentWindow);
+ return S_OK;
+}
+
+static void AddMessageToString(UString &dest, const UString &src)
+{
+ if (!src.IsEmpty())
+ {
+ if (!dest.IsEmpty())
+ dest.Add_LF();
+ dest += src;
+ }
+}
+
+void CProgressThreadVirt::Process()
+{
+ CProgressCloser closer(*this);
+ UString m;
+ try { Result = ProcessVirt(); }
+ catch(const wchar_t *s) { m = s; }
+ catch(const UString &s) { m = s; }
+ catch(const char *s) { m = GetUnicodeString(s); }
+ catch(int v)
+ {
+ m = "Error #";
+ m.Add_UInt32(v);
+ }
+ catch(...) { m = "Error"; }
+ if (Result != E_ABORT)
+ {
+ if (m.IsEmpty() && Result != S_OK)
+ m = HResultToMessage(Result);
+ }
+ AddMessageToString(m, FinalMessage.ErrorMessage.Message);
+
+ {
+ FOR_VECTOR(i, ErrorPaths)
+ {
+ if (i >= 32)
+ break;
+ AddMessageToString(m, fs2us(ErrorPaths[i]));
+ }
+ }
+
+ CProgressSync &sync = Sync;
+ NSynchronization::CCriticalSectionLock lock(sync._cs);
+ if (m.IsEmpty())
+ {
+ if (!FinalMessage.OkMessage.Message.IsEmpty())
+ sync.FinalMessage.OkMessage = FinalMessage.OkMessage;
+ }
+ else
+ {
+ sync.FinalMessage.ErrorMessage.Message = m;
+ if (Result == S_OK)
+ Result = E_FAIL;
+ }
+}
+
+UString HResultToMessage(HRESULT errorCode)
+{
+ if (errorCode == E_OUTOFMEMORY)
+ return LangString(IDS_MEM_ERROR);
+ else
+ return NError::MyFormatMessage(errorCode);
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.h
new file mode 100644
index 0000000000..5e916e6f9f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.h
@@ -0,0 +1,351 @@
+// ProgressDialog2.h
+
+#ifndef __PROGRESS_DIALOG_2_H
+#define __PROGRESS_DIALOG_2_H
+
+#include "../../../Common/MyCom.h"
+
+#include "../../../Windows/ErrorMsg.h"
+#include "../../../Windows/Synchronization.h"
+#include "../../../Windows/Thread.h"
+
+#include "../../../Windows/Control/Dialog.h"
+#include "../../../Windows/Control/ListView.h"
+#include "../../../Windows/Control/ProgressBar.h"
+
+#include "MyWindowsNew.h"
+
+struct CProgressMessageBoxPair
+{
+ UString Title;
+ UString Message;
+};
+
+struct CProgressFinalMessage
+{
+ CProgressMessageBoxPair ErrorMessage;
+ CProgressMessageBoxPair OkMessage;
+
+ bool ThereIsMessage() const { return !ErrorMessage.Message.IsEmpty() || !OkMessage.Message.IsEmpty(); }
+};
+
+class CProgressSync
+{
+ bool _stopped;
+ bool _paused;
+
+public:
+ bool _bytesProgressMode;
+ UInt64 _totalBytes;
+ UInt64 _completedBytes;
+ UInt64 _totalFiles;
+ UInt64 _curFiles;
+ UInt64 _inSize;
+ UInt64 _outSize;
+
+ UString _titleFileName;
+ UString _status;
+ UString _filePath;
+ bool _isDir;
+
+ UStringVector Messages;
+ CProgressFinalMessage FinalMessage;
+
+ NWindows::NSynchronization::CCriticalSection _cs;
+
+ CProgressSync();
+
+ bool Get_Stopped()
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ return _stopped;
+ }
+ void Set_Stopped(bool val)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _stopped = val;
+ }
+
+ bool Get_Paused();
+ void Set_Paused(bool val)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _paused = val;
+ }
+
+ void Set_BytesProgressMode(bool bytesProgressMode)
+ {
+ NWindows::NSynchronization::CCriticalSectionLock lock(_cs);
+ _bytesProgressMode = bytesProgressMode;
+ }
+
+ HRESULT CheckStop();
+ HRESULT ScanProgress(UInt64 numFiles, UInt64 totalSize, const FString &fileName, bool isDir = false);
+
+ HRESULT Set_NumFilesTotal(UInt64 val);
+ void Set_NumBytesTotal(UInt64 val);
+ void Set_NumFilesCur(UInt64 val);
+ HRESULT Set_NumBytesCur(const UInt64 *val);
+ HRESULT Set_NumBytesCur(UInt64 val);
+ void Set_Ratio(const UInt64 *inSize, const UInt64 *outSize);
+
+ void Set_TitleFileName(const UString &fileName);
+ void Set_Status(const UString &s);
+ HRESULT Set_Status2(const UString &s, const wchar_t *path, bool isDir = false);
+ void Set_FilePath(const wchar_t *path, bool isDir = false);
+
+ void AddError_Message(const wchar_t *message);
+ void AddError_Message_Name(const wchar_t *message, const wchar_t *name);
+ void AddError_Code_Name(DWORD systemError, const wchar_t *name);
+
+ bool ThereIsMessage() const { return !Messages.IsEmpty() || FinalMessage.ThereIsMessage(); }
+};
+
+class CProgressDialog: public NWindows::NControl::CModalDialog
+{
+ UString _titleFileName;
+ UString _filePath;
+ UString _status;
+ bool _isDir;
+
+ UString _background_String;
+ UString _backgrounded_String;
+ UString _foreground_String;
+ UString _pause_String;
+ UString _continue_String;
+ UString _paused_String;
+
+ int _buttonSizeX;
+ int _buttonSizeY;
+
+ UINT_PTR _timer;
+
+ UString _title;
+
+ class CU64ToI32Converter
+ {
+ unsigned _numShiftBits;
+ UInt64 _range;
+ public:
+ CU64ToI32Converter(): _numShiftBits(0), _range(1) {}
+ void Init(UInt64 range)
+ {
+ _range = range;
+ // Windows CE doesn't like big number for ProgressBar.
+ for (_numShiftBits = 0; range >= ((UInt32)1 << 15); _numShiftBits++)
+ range >>= 1;
+ }
+ int Count(UInt64 val)
+ {
+ int res = (int)(val >> _numShiftBits);
+ if (val == _range)
+ res++;
+ return res;
+ }
+ };
+
+ CU64ToI32Converter _progressConv;
+ UInt64 _progressBar_Pos;
+ UInt64 _progressBar_Range;
+
+ NWindows::NControl::CProgressBar m_ProgressBar;
+ NWindows::NControl::CListView _messageList;
+
+ int _numMessages;
+
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ CMyComPtr<ITaskbarList3> _taskbarList;
+ #endif
+ HWND _hwndForTaskbar;
+
+ UInt32 _prevTime;
+ UInt64 _elapsedTime;
+
+ UInt64 _prevPercentValue;
+ UInt64 _prevElapsedSec;
+ UInt64 _prevRemainingSec;
+
+ UInt64 _totalBytes_Prev;
+ UInt64 _processed_Prev;
+ UInt64 _packed_Prev;
+ UInt64 _ratio_Prev;
+ UString _filesStr_Prev;
+
+ unsigned _prevSpeed_MoveBits;
+ UInt64 _prevSpeed;
+
+ bool _foreground;
+
+ unsigned _numReduceSymbols;
+
+ bool _wasCreated;
+ bool _needClose;
+
+ unsigned _numPostedMessages;
+ UInt32 _numAutoSizeMessages;
+
+ bool _errorsWereDisplayed;
+
+ bool _waitCloseByCancelButton;
+ bool _cancelWasPressed;
+
+ bool _inCancelMessageBox;
+ bool _externalCloseMessageWasReceived;
+
+
+ #ifdef __ITaskbarList3_INTERFACE_DEFINED__
+ void SetTaskbarProgressState(TBPFLAG tbpFlags)
+ {
+ if (_taskbarList && _hwndForTaskbar)
+ _taskbarList->SetProgressState(_hwndForTaskbar, tbpFlags);
+ }
+ #endif
+ void SetTaskbarProgressState();
+
+ void UpdateStatInfo(bool showAll);
+ bool OnTimer(WPARAM timerID, LPARAM callback);
+ void SetProgressRange(UInt64 range);
+ void SetProgressPos(UInt64 pos);
+ virtual bool OnInit();
+ virtual bool OnSize(WPARAM wParam, int xSize, int ySize);
+ virtual void OnCancel();
+ virtual void OnOK();
+ NWindows::NSynchronization::CManualResetEvent _createDialogEvent;
+ NWindows::NSynchronization::CManualResetEvent _dialogCreatedEvent;
+ #ifndef _SFX
+ void AddToTitle(LPCWSTR string);
+ #endif
+
+ void SetPauseText();
+ void SetPriorityText();
+ void OnPauseButton();
+ void OnPriorityButton();
+ bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+
+ void SetTitleText();
+ void ShowSize(int id, UInt64 val, UInt64 &prev);
+
+ void UpdateMessagesDialog();
+
+ void AddMessageDirect(LPCWSTR message, bool needNumber);
+ void AddMessage(LPCWSTR message);
+
+ bool OnExternalCloseMessage();
+ void EnableErrorsControls(bool enable);
+
+ void ShowAfterMessages(HWND wndParent);
+
+ void CheckNeedClose();
+public:
+ CProgressSync Sync;
+ bool CompressingMode;
+ bool WaitMode;
+ bool ShowCompressionInfo;
+ bool MessagesDisplayed; // = true if user pressed OK on all messages or there are no messages.
+ int IconID;
+
+ HWND MainWindow;
+ #ifndef _SFX
+ UString MainTitle;
+ UString MainAddTitle;
+ ~CProgressDialog();
+ #endif
+
+ CProgressDialog();
+ void WaitCreating()
+ {
+ _createDialogEvent.Set();
+ _dialogCreatedEvent.Lock();
+ }
+
+ INT_PTR Create(const UString &title, NWindows::CThread &thread, HWND wndParent = 0);
+
+
+ /* how it works:
+ 1) the working thread calls ProcessWasFinished()
+ that sends kCloseMessage message to CProgressDialog (GUI) thread
+ 2) CProgressDialog (GUI) thread receives kCloseMessage message and
+ calls ProcessWasFinished_GuiVirt();
+ So we can implement ProcessWasFinished_GuiVirt() and show special
+ results window in GUI thread with CProgressDialog as parent window
+ */
+
+ void ProcessWasFinished();
+ virtual void ProcessWasFinished_GuiVirt() {}
+};
+
+
+class CProgressCloser
+{
+ CProgressDialog *_p;
+public:
+ CProgressCloser(CProgressDialog &p) : _p(&p) {}
+ ~CProgressCloser() { _p->ProcessWasFinished(); }
+};
+
+
+class CProgressThreadVirt: public CProgressDialog
+{
+protected:
+ FStringVector ErrorPaths;
+ CProgressFinalMessage FinalMessage;
+
+ // error if any of HRESULT, ErrorMessage, ErrorPath
+ virtual HRESULT ProcessVirt() = 0;
+public:
+ HRESULT Result;
+ bool ThreadFinishedOK; // if there is no fatal exception
+
+ void Process();
+ void AddErrorPath(const FString &path) { ErrorPaths.Add(path); }
+
+ HRESULT Create(const UString &title, HWND parentWindow = 0);
+ CProgressThreadVirt(): Result(E_FAIL), ThreadFinishedOK(false) {}
+
+ CProgressMessageBoxPair &GetMessagePair(bool isError) { return isError ? FinalMessage.ErrorMessage : FinalMessage.OkMessage; }
+};
+
+UString HResultToMessage(HRESULT errorCode);
+
+/*
+how it works:
+
+client code inherits CProgressThreadVirt and calls
+CProgressThreadVirt::Create()
+{
+ it creates new thread that calls CProgressThreadVirt::Process();
+ it creates modal progress dialog window with ProgressDialog.Create()
+}
+
+CProgressThreadVirt::Process()
+{
+ {
+ ProcessVirt(); // virtual function that must implement real work
+ }
+ if (exceptions) or FinalMessage.ErrorMessage.Message
+ {
+ set message to ProgressDialog.Sync.FinalMessage.ErrorMessage.Message
+ }
+ else if (FinalMessage.OkMessage.Message)
+ {
+ set message to ProgressDialog.Sync.FinalMessage.OkMessage
+ }
+
+ PostMsg(kCloseMessage);
+}
+
+
+CProgressDialog::OnExternalCloseMessage()
+{
+ if (ProgressDialog.Sync.FinalMessage)
+ {
+ WorkWasFinishedVirt();
+ Show (ProgressDialog.Sync.FinalMessage)
+ MessagesDisplayed = true;
+ }
+}
+
+*/
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.rc b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.rc
new file mode 100644
index 0000000000..535a008178
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2.rc
@@ -0,0 +1,40 @@
+#include "ProgressDialog2Res.h"
+#include "../../GuiCommon.rc"
+
+#undef DIALOG_ID
+#define DIALOG_ID IDD_PROGRESS
+#define xc 360
+#define k 11
+#define z1s 16
+
+#include "ProgressDialog2a.rc"
+
+#ifdef UNDER_CE
+
+#include "../../GuiCommon.rc"
+
+
+#undef DIALOG_ID
+#undef m
+#undef k
+#undef z1s
+
+#define DIALOG_ID IDD_PROGRESS_2
+#define m 4
+#define k 8
+#define z1s 12
+
+#define xc 280
+
+#include "ProgressDialog2a.rc"
+
+#endif
+
+STRINGTABLE DISCARDABLE
+{
+ IDS_PROGRESS_PAUSED "Paused"
+ IDS_PROGRESS_FOREGROUND "&Foreground"
+ IDS_CONTINUE "&Continue"
+ IDS_PROGRESS_ASK_CANCEL "Are you sure you want to cancel?"
+ IDS_CLOSE "&Close"
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2Res.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2Res.h
new file mode 100644
index 0000000000..54f02f0308
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2Res.h
@@ -0,0 +1,48 @@
+#define IDD_PROGRESS 97
+#define IDD_PROGRESS_2 10097
+
+#define IDS_CLOSE 408
+#define IDS_CONTINUE 411
+
+#define IDB_PROGRESS_BACKGROUND 444
+#define IDS_PROGRESS_FOREGROUND 445
+#define IDB_PAUSE 446
+#define IDS_PROGRESS_PAUSED 447
+#define IDS_PROGRESS_ASK_CANCEL 448
+
+#define IDT_PROGRESS_PACKED 1008
+#define IDT_PROGRESS_FILES 1032
+
+#define IDT_PROGRESS_ELAPSED 3900
+#define IDT_PROGRESS_REMAINING 3901
+#define IDT_PROGRESS_TOTAL 3902
+#define IDT_PROGRESS_SPEED 3903
+#define IDT_PROGRESS_PROCESSED 3904
+#define IDT_PROGRESS_RATIO 3905
+#define IDT_PROGRESS_ERRORS 3906
+
+#define IDC_PROGRESS1 100
+#define IDL_PROGRESS_MESSAGES 101
+#define IDT_PROGRESS_FILE_NAME 102
+#define IDT_PROGRESS_STATUS 103
+
+#define IDT_PROGRESS_PACKED_VAL 110
+#define IDT_PROGRESS_FILES_VAL 111
+
+#define IDT_PROGRESS_ELAPSED_VAL 120
+#define IDT_PROGRESS_REMAINING_VAL 121
+#define IDT_PROGRESS_TOTAL_VAL 122
+#define IDT_PROGRESS_SPEED_VAL 123
+#define IDT_PROGRESS_PROCESSED_VAL 124
+#define IDT_PROGRESS_RATIO_VAL 125
+#define IDT_PROGRESS_ERRORS_VAL 126
+
+
+#ifdef UNDER_CE
+#define MY_PROGRESS_VAL_UNITS 44
+#else
+#define MY_PROGRESS_VAL_UNITS 76
+#endif
+#define MY_PROGRESS_LABEL_UNITS_MIN 60
+#define MY_PROGRESS_LABEL_UNITS_START 90
+#define MY_PROGRESS_PAD_UNITS 4
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2a.rc b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2a.rc
new file mode 100644
index 0000000000..f1daec70ad
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialog2a.rc
@@ -0,0 +1,80 @@
+#undef bxs
+#define bxs 80
+
+#define x0s MY_PROGRESS_LABEL_UNITS_START
+#define x1s MY_PROGRESS_VAL_UNITS
+#define x2s MY_PROGRESS_LABEL_UNITS_START
+#define x3s MY_PROGRESS_VAL_UNITS
+
+#define x1 (m + x0s)
+#define x3 (xs - m - x3s)
+#define x2 (x3 - x2s)
+
+#undef y0
+#undef y1
+#undef y2
+#undef y3
+#undef y4
+
+#undef z0
+#undef z1
+#undef z2
+#undef z3
+
+#define y0 m
+#define y1 (y0 + k)
+#define y2 (y1 + k)
+#define y3 (y2 + k)
+#define y4 (y3 + k)
+
+#define z3 (y4 + k + 1)
+
+#define z2 (z3 + k + 1)
+#define z2s 24
+
+#define z1 (z2 + z2s)
+
+#define z0 (z1 + z1s + m)
+#define z0s 48
+
+#define yc (z0 + z0s + bys)
+
+
+DIALOG_ID DIALOG 0, 0, xs, ys MY_MODAL_RESIZE_DIALOG_STYLE MY_FONT
+CAPTION "Progress"
+{
+ DEFPUSHBUTTON "&Background", IDB_PROGRESS_BACKGROUND, bx3, by, bxs, bys
+ PUSHBUTTON "&Pause", IDB_PAUSE bx2, by, bxs, bys
+ PUSHBUTTON "Cancel", IDCANCEL, bx1, by, bxs, bys
+
+ LTEXT "Elapsed time:", IDT_PROGRESS_ELAPSED, m, y0, x0s, 8
+ LTEXT "Remaining time:", IDT_PROGRESS_REMAINING, m, y1, x0s, 8
+ LTEXT "Files:", IDT_PROGRESS_FILES, m, y2, x0s, 8
+ LTEXT "Compression ratio:", IDT_PROGRESS_RATIO, m, y3, x0s, 8
+ LTEXT "Errors:", IDT_PROGRESS_ERRORS, m, y4, x0s, 8
+
+ LTEXT "Total size:", IDT_PROGRESS_TOTAL, x2, y0, x2s, 8
+ LTEXT "Speed:", IDT_PROGRESS_SPEED, x2, y1, x2s, 8
+ LTEXT "Processed:", IDT_PROGRESS_PROCESSED,x2, y2, x2s, 8
+ LTEXT "Compressed size:" , IDT_PROGRESS_PACKED, x2, y3, x2s, 8
+
+ RTEXT "", IDT_PROGRESS_ELAPSED_VAL, x1, y0, x1s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_REMAINING_VAL, x1, y1, x1s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_FILES_VAL, x1, y2, x1s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_RATIO_VAL, x1, y3, x1s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_ERRORS_VAL, x1, y4, x1s, MY_TEXT_NOPREFIX
+
+ RTEXT "", IDT_PROGRESS_TOTAL_VAL, x3, y0, x3s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_SPEED_VAL, x3, y1, x3s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_PROCESSED_VAL, x3, y2, x3s, MY_TEXT_NOPREFIX
+ RTEXT "", IDT_PROGRESS_PACKED_VAL, x3, y3, x3s, MY_TEXT_NOPREFIX
+
+ LTEXT "", IDT_PROGRESS_STATUS, m, z3, xc, MY_TEXT_NOPREFIX
+ CONTROL "", IDT_PROGRESS_FILE_NAME, "Static", SS_NOPREFIX | SS_LEFTNOWORDWRAP, m, z2, xc, z2s
+
+ CONTROL "Progress1", IDC_PROGRESS1, "msctls_progress32", PBS_SMOOTH | WS_BORDER, m, z1, xc, z1s
+
+ CONTROL "List1", IDL_PROGRESS_MESSAGES, "SysListView32",
+ LVS_REPORT | LVS_SHOWSELALWAYS | LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,
+ m, z0, xc, z0s
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialogRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialogRes.h
new file mode 100644
index 0000000000..a2814188a5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/ProgressDialogRes.h
@@ -0,0 +1,3 @@
+#define IDD_PROGRESS 97
+
+#define IDC_PROGRESS1 100
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.cpp
new file mode 100644
index 0000000000..a9552415f1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.cpp
@@ -0,0 +1,23 @@
+// PropertyName.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+
+#include "LangUtils.h"
+#include "PropertyName.h"
+
+UString GetNameOfProperty(PROPID propID, const wchar_t *name)
+{
+ if (propID < 1000)
+ {
+ UString s = LangString(1000 + propID);
+ if (!s.IsEmpty())
+ return s;
+ }
+ if (name)
+ return name;
+ wchar_t temp[16];
+ ConvertUInt32ToString(propID, temp);
+ return temp;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.h
new file mode 100644
index 0000000000..a1061b74f5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyName.h
@@ -0,0 +1,10 @@
+// PropertyName.h
+
+#ifndef __PROPERTY_NAME_H
+#define __PROPERTY_NAME_H
+
+#include "../../../Common/MyString.h"
+
+UString GetNameOfProperty(PROPID propID, const wchar_t *name);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyNameRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyNameRes.h
new file mode 100644
index 0000000000..1315b8995e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/PropertyNameRes.h
@@ -0,0 +1,95 @@
+
+
+#define IDS_PROP_PATH 1003
+#define IDS_PROP_NAME 1004
+#define IDS_PROP_EXTENSION 1005
+#define IDS_PROP_IS_FOLDER 1006
+#define IDS_PROP_SIZE 1007
+#define IDS_PROP_PACKED_SIZE 1008
+#define IDS_PROP_ATTRIBUTES 1009
+#define IDS_PROP_CTIME 1010
+#define IDS_PROP_ATIME 1011
+#define IDS_PROP_MTIME 1012
+#define IDS_PROP_SOLID 1013
+#define IDS_PROP_C0MMENTED 1014
+#define IDS_PROP_ENCRYPTED 1015
+#define IDS_PROP_SPLIT_BEFORE 1016
+#define IDS_PROP_SPLIT_AFTER 1017
+#define IDS_PROP_DICTIONARY_SIZE 1018
+#define IDS_PROP_CRC 1019
+#define IDS_PROP_FILE_TYPE 1020
+#define IDS_PROP_ANTI 1021
+#define IDS_PROP_METHOD 1022
+#define IDS_PROP_HOST_OS 1023
+#define IDS_PROP_FILE_SYSTEM 1024
+#define IDS_PROP_USER 1025
+#define IDS_PROP_GROUP 1026
+#define IDS_PROP_BLOCK 1027
+#define IDS_PROP_COMMENT 1028
+#define IDS_PROP_POSITION 1029
+#define IDS_PROP_PREFIX 1030
+#define IDS_PROP_FOLDERS 1031
+#define IDS_PROP_FILES 1032
+#define IDS_PROP_VERSION 1033
+#define IDS_PROP_VOLUME 1034
+#define IDS_PROP_IS_VOLUME 1035
+#define IDS_PROP_OFFSET 1036
+#define IDS_PROP_LINKS 1037
+#define IDS_PROP_NUM_BLOCKS 1038
+#define IDS_PROP_NUM_VOLUMES 1039
+
+#define IDS_PROP_BIT64 1041
+#define IDS_PROP_BIG_ENDIAN 1042
+#define IDS_PROP_CPU 1043
+#define IDS_PROP_PHY_SIZE 1044
+#define IDS_PROP_HEADERS_SIZE 1045
+#define IDS_PROP_CHECKSUM 1046
+#define IDS_PROP_CHARACTS 1047
+#define IDS_PROP_VA 1048
+#define IDS_PROP_ID 1049
+#define IDS_PROP_SHORT_NAME 1050
+#define IDS_PROP_CREATOR_APP 1051
+#define IDS_PROP_SECTOR_SIZE 1052
+#define IDS_PROP_POSIX_ATTRIB 1053
+#define IDS_PROP_SYM_LINK 1054
+#define IDS_PROP_ERROR 1055
+#define IDS_PROP_TOTAL_SIZE 1056
+#define IDS_PROP_FREE_SPACE 1057
+#define IDS_PROP_CLUSTER_SIZE 1058
+#define IDS_PROP_VOLUME_NAME 1059
+#define IDS_PROP_LOCAL_NAME 1060
+#define IDS_PROP_PROVIDER 1061
+#define IDS_PROP_NT_SECURITY 1062
+#define IDS_PROP_ALT_STREAM 1063
+#define IDS_PROP_AUX 1064
+#define IDS_PROP_DELETED 1065
+#define IDS_PROP_IS_TREE 1066
+#define IDS_PROP_SHA1 1067
+#define IDS_PROP_SHA256 1068
+#define IDS_PROP_ERROR_TYPE 1069
+#define IDS_PROP_NUM_ERRORS 1070
+#define IDS_PROP_ERROR_FLAGS 1071
+#define IDS_PROP_WARNING_FLAGS 1072
+#define IDS_PROP_WARNING 1073
+#define IDS_PROP_NUM_STREAMS 1074
+#define IDS_PROP_NUM_ALT_STREAMS 1075
+#define IDS_PROP_ALT_STREAMS_SIZE 1076
+#define IDS_PROP_VIRTUAL_SIZE 1077
+#define IDS_PROP_UNPACK_SIZE 1078
+#define IDS_PROP_TOTAL_PHY_SIZE 1079
+#define IDS_PROP_VOLUME_INDEX 1080
+#define IDS_PROP_SUBTYPE 1081
+#define IDS_PROP_SHORT_COMMENT 1082
+#define IDS_PROP_CODE_PAGE 1083
+#define IDS_PROP_IS_NOT_ARC_TYPE 1084
+#define IDS_PROP_PHY_SIZE_CANT_BE_DETECTED 1085
+#define IDS_PROP_ZEROS_TAIL_IS_ALLOWED 1086
+#define IDS_PROP_TAIL_SIZE 1087
+#define IDS_PROP_EMB_STUB_SIZE 1088
+#define IDS_PROP_NT_REPARSE 1089
+#define IDS_PROP_HARD_LINK 1090
+#define IDS_PROP_INODE 1091
+#define IDS_PROP_STREAM_ID 1092
+#define IDS_PROP_READ_ONLY 1093
+#define IDS_PROP_OUT_NAME 1094
+#define IDS_PROP_COPY_LINK 1095
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.cpp
new file mode 100644
index 0000000000..2100e82944
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.cpp
@@ -0,0 +1,255 @@
+// SysIconUtils.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../../../Common/StringConvert.h"
+#endif
+
+#include "../../../Windows/FileDir.h"
+
+#include "SysIconUtils.h"
+
+#include <ShlObj.h>
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+int GetIconIndexForCSIDL(int csidl)
+{
+ LPITEMIDLIST pidl = 0;
+ SHGetSpecialFolderLocation(NULL, csidl, &pidl);
+ if (pidl)
+ {
+ SHFILEINFO shellInfo;
+ SHGetFileInfo(LPCTSTR(pidl), FILE_ATTRIBUTE_NORMAL,
+ &shellInfo, sizeof(shellInfo),
+ SHGFI_PIDL | SHGFI_SYSICONINDEX);
+ IMalloc *pMalloc;
+ SHGetMalloc(&pMalloc);
+ if (pMalloc)
+ {
+ pMalloc->Free(pidl);
+ pMalloc->Release();
+ }
+ return shellInfo.iIcon;
+ }
+ return 0;
+}
+
+#ifndef _UNICODE
+typedef int (WINAPI * SHGetFileInfoWP)(LPCWSTR pszPath, DWORD attrib, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags);
+
+struct CSHGetFileInfoInit
+{
+ SHGetFileInfoWP shGetFileInfoW;
+ CSHGetFileInfoInit()
+ {
+ shGetFileInfoW = (SHGetFileInfoWP)
+ ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHGetFileInfoW");
+ }
+} g_SHGetFileInfoInit;
+#endif
+
+static DWORD_PTR MySHGetFileInfoW(LPCWSTR pszPath, DWORD attrib, SHFILEINFOW *psfi, UINT cbFileInfo, UINT uFlags)
+{
+ #ifdef _UNICODE
+ return SHGetFileInfo
+ #else
+ if (g_SHGetFileInfoInit.shGetFileInfoW == 0)
+ return 0;
+ return g_SHGetFileInfoInit.shGetFileInfoW
+ #endif
+ (pszPath, attrib, psfi, cbFileInfo, uFlags);
+}
+
+DWORD_PTR GetRealIconIndex(CFSTR path, DWORD attrib, int &iconIndex)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ SHFILEINFO shellInfo;
+ DWORD_PTR res = ::SHGetFileInfo(fs2fas(path), FILE_ATTRIBUTE_NORMAL | attrib, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX);
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+ else
+ #endif
+ {
+ SHFILEINFOW shellInfo;
+ DWORD_PTR res = ::MySHGetFileInfoW(fs2us(path), FILE_ATTRIBUTE_NORMAL | attrib, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX);
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+}
+
+/*
+DWORD_PTR GetRealIconIndex(const UString &fileName, DWORD attrib, int &iconIndex, UString *typeName)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ SHFILEINFO shellInfo;
+ shellInfo.szTypeName[0] = 0;
+ DWORD_PTR res = ::SHGetFileInfoA(GetSystemString(fileName), FILE_ATTRIBUTE_NORMAL | attrib, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX | SHGFI_TYPENAME);
+ if (typeName)
+ *typeName = GetUnicodeString(shellInfo.szTypeName);
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+ else
+ #endif
+ {
+ SHFILEINFOW shellInfo;
+ shellInfo.szTypeName[0] = 0;
+ DWORD_PTR res = ::MySHGetFileInfoW(fileName, FILE_ATTRIBUTE_NORMAL | attrib, &shellInfo,
+ sizeof(shellInfo), SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX | SHGFI_TYPENAME);
+ if (typeName)
+ *typeName = shellInfo.szTypeName;
+ iconIndex = shellInfo.iIcon;
+ return res;
+ }
+}
+*/
+
+static int FindInSorted_Attrib(const CRecordVector<CAttribIconPair> &vect, DWORD attrib, int &insertPos)
+{
+ unsigned left = 0, right = vect.Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ DWORD midAttrib = vect[mid].Attrib;
+ if (attrib == midAttrib)
+ return mid;
+ if (attrib < midAttrib)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ insertPos = left;
+ return -1;
+}
+
+static int FindInSorted_Ext(const CObjectVector<CExtIconPair> &vect, const wchar_t *ext, int &insertPos)
+{
+ unsigned left = 0, right = vect.Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ int compare = MyStringCompareNoCase(ext, vect[mid].Ext);
+ if (compare == 0)
+ return mid;
+ if (compare < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ insertPos = left;
+ return -1;
+}
+
+int CExtToIconMap::GetIconIndex(DWORD attrib, const wchar_t *fileName /*, UString *typeName */)
+{
+ int dotPos = -1;
+ unsigned i;
+ for (i = 0;; i++)
+ {
+ wchar_t c = fileName[i];
+ if (c == 0)
+ break;
+ if (c == '.')
+ dotPos = i;
+ }
+
+ /*
+ if (MyStringCompareNoCase(fileName, L"$Recycle.Bin") == 0)
+ {
+ char s[256];
+ sprintf(s, "SPEC i = %3d, attr = %7x", _attribMap.Size(), attrib);
+ OutputDebugStringA(s);
+ OutputDebugStringW(fileName);
+ }
+ */
+
+ if ((attrib & FILE_ATTRIBUTE_DIRECTORY) != 0 || dotPos < 0)
+ {
+ int insertPos = 0;
+ int index = FindInSorted_Attrib(_attribMap, attrib, insertPos);
+ if (index >= 0)
+ {
+ // if (typeName) *typeName = _attribMap[index].TypeName;
+ return _attribMap[index].IconIndex;
+ }
+ CAttribIconPair pair;
+ GetRealIconIndex(
+ #ifdef UNDER_CE
+ FTEXT("\\")
+ #endif
+ FTEXT("__DIR__")
+ , attrib, pair.IconIndex
+ // , pair.TypeName
+ );
+
+ /*
+ char s[256];
+ sprintf(s, "i = %3d, attr = %7x", _attribMap.Size(), attrib);
+ OutputDebugStringA(s);
+ */
+
+ pair.Attrib = attrib;
+ _attribMap.Insert(insertPos, pair);
+ // if (typeName) *typeName = pair.TypeName;
+ return pair.IconIndex;
+ }
+
+ const wchar_t *ext = fileName + dotPos + 1;
+ int insertPos = 0;
+ int index = FindInSorted_Ext(_extMap, ext, insertPos);
+ if (index >= 0)
+ {
+ const CExtIconPair &pa = _extMap[index];
+ // if (typeName) *typeName = pa.TypeName;
+ return pa.IconIndex;
+ }
+
+ for (i = 0;; i++)
+ {
+ wchar_t c = ext[i];
+ if (c == 0)
+ break;
+ if (c < L'0' || c > L'9')
+ break;
+ }
+ if (i != 0 && ext[i] == 0)
+ {
+ // GetRealIconIndex is too slow for big number of split extensions: .001, .002, .003
+ if (!SplitIconIndex_Defined)
+ {
+ GetRealIconIndex(
+ #ifdef UNDER_CE
+ FTEXT("\\")
+ #endif
+ FTEXT("__FILE__.001"), 0, SplitIconIndex);
+ SplitIconIndex_Defined = true;
+ }
+ return SplitIconIndex;
+ }
+
+ CExtIconPair pair;
+ pair.Ext = ext;
+ GetRealIconIndex(us2fs(fileName + dotPos), attrib, pair.IconIndex);
+ _extMap.Insert(insertPos, pair);
+ // if (typeName) *typeName = pair.TypeName;
+ return pair.IconIndex;
+}
+
+/*
+int CExtToIconMap::GetIconIndex(DWORD attrib, const UString &fileName)
+{
+ return GetIconIndex(attrib, fileName, NULL);
+}
+*/
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.h
new file mode 100644
index 0000000000..2eedc4be40
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/SysIconUtils.h
@@ -0,0 +1,62 @@
+// SysIconUtils.h
+
+#ifndef __SYS_ICON_UTILS_H
+#define __SYS_ICON_UTILS_H
+
+#include "../../../Common/MyWindows.h"
+
+#include <commctrl.h>
+
+#include "../../../Common/MyString.h"
+
+struct CExtIconPair
+{
+ UString Ext;
+ int IconIndex;
+ // UString TypeName;
+
+ // int Compare(const CExtIconPair &a) const { return MyStringCompareNoCase(Ext, a.Ext); }
+};
+
+struct CAttribIconPair
+{
+ DWORD Attrib;
+ int IconIndex;
+ // UString TypeName;
+
+ // int Compare(const CAttribIconPair &a) const { return Ext.Compare(a.Ext); }
+};
+
+class CExtToIconMap
+{
+public:
+ CRecordVector<CAttribIconPair> _attribMap;
+ CObjectVector<CExtIconPair> _extMap;
+ int SplitIconIndex;
+ int SplitIconIndex_Defined;
+
+ CExtToIconMap(): SplitIconIndex_Defined(false) {}
+
+ void Clear()
+ {
+ SplitIconIndex_Defined = false;
+ _extMap.Clear();
+ _attribMap.Clear();
+ }
+ int GetIconIndex(DWORD attrib, const wchar_t *fileName /* , UString *typeName */);
+ // int GetIconIndex(DWORD attrib, const UString &fileName);
+};
+
+DWORD_PTR GetRealIconIndex(CFSTR path, DWORD attrib, int &iconIndex);
+int GetIconIndexForCSIDL(int csidl);
+
+inline HIMAGELIST GetSysImageList(bool smallIcons)
+{
+ SHFILEINFO shellInfo;
+ return (HIMAGELIST)SHGetFileInfo(TEXT(""),
+ FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY,
+ &shellInfo, sizeof(shellInfo),
+ SHGFI_USEFILEATTRIBUTES | SHGFI_SYSICONINDEX | (smallIcons ? SHGFI_SMALLICON : SHGFI_ICON));
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resource.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resource.h
new file mode 100644
index 0000000000..466626925e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resource.h
@@ -0,0 +1,177 @@
+#include "resourceGui.h"
+
+#define IDR_MENUBAR1 70
+#define IDM_MENU 71
+#define IDR_ACCELERATOR1 72
+
+#define IDB_ADD 100
+#define IDB_EXTRACT 101
+#define IDB_TEST 102
+#define IDB_COPY 103
+#define IDB_MOVE 104
+#define IDB_DELETE 105
+#define IDB_INFO 106
+
+#define IDB_ADD2 150
+#define IDB_EXTRACT2 151
+#define IDB_TEST2 152
+#define IDB_COPY2 153
+#define IDB_MOVE2 154
+#define IDB_DELETE2 155
+#define IDB_INFO2 156
+
+#define IDM_HASH_ALL 101
+#define IDM_CRC32 102
+#define IDM_CRC64 103
+#define IDM_SHA1 104
+#define IDM_SHA256 105
+
+#define IDM_OPEN 540
+#define IDM_OPEN_INSIDE 541
+#define IDM_OPEN_OUTSIDE 542
+#define IDM_FILE_VIEW 543
+#define IDM_FILE_EDIT 544
+#define IDM_RENAME 545
+#define IDM_COPY_TO 546
+#define IDM_MOVE_TO 547
+#define IDM_DELETE 548
+#define IDM_SPLIT 549
+#define IDM_COMBINE 550
+#define IDM_PROPERTIES 551
+#define IDM_COMMENT 552
+#define IDM_CRC 553
+#define IDM_DIFF 554
+#define IDM_CREATE_FOLDER 555
+#define IDM_CREATE_FILE 556
+// #define IDM_EXIT 557
+#define IDM_LINK 558
+#define IDM_ALT_STREAMS 559
+
+#define IDM_OPEN_INSIDE_ONE 590
+#define IDM_OPEN_INSIDE_PARSER 591
+
+#define IDM_SELECT_ALL 600
+#define IDM_DESELECT_ALL 601
+#define IDM_INVERT_SELECTION 602
+#define IDM_SELECT 603
+#define IDM_DESELECT 604
+#define IDM_SELECT_BY_TYPE 605
+#define IDM_DESELECT_BY_TYPE 606
+
+#define IDM_VIEW_LARGE_ICONS 700
+#define IDM_VIEW_SMALL_ICONS 701
+#define IDM_VIEW_LIST 702
+#define IDM_VIEW_DETAILS 703
+
+#define IDM_VIEW_ARANGE_BY_NAME 710
+#define IDM_VIEW_ARANGE_BY_TYPE 711
+#define IDM_VIEW_ARANGE_BY_DATE 712
+#define IDM_VIEW_ARANGE_BY_SIZE 713
+
+#define IDM_VIEW_ARANGE_NO_SORT 730
+#define IDM_VIEW_FLAT_VIEW 731
+#define IDM_VIEW_TWO_PANELS 732
+#define IDM_VIEW_TOOLBARS 733
+#define IDM_OPEN_ROOT_FOLDER 734
+#define IDM_OPEN_PARENT_FOLDER 735
+#define IDM_FOLDERS_HISTORY 736
+#define IDM_VIEW_REFRESH 737
+#define IDM_VIEW_AUTO_REFRESH 738
+// #define IDM_VIEW_SHOW_DELETED 739
+// #define IDM_VIEW_SHOW_STREAMS 740
+
+#define IDM_VIEW_ARCHIVE_TOOLBAR 750
+#define IDM_VIEW_STANDARD_TOOLBAR 751
+#define IDM_VIEW_TOOLBARS_LARGE_BUTTONS 752
+#define IDM_VIEW_TOOLBARS_SHOW_BUTTONS_TEXT 753
+
+#define IDM_VIEW_TIME 761
+
+#define IDS_BOOKMARK 801
+
+#define IDM_OPTIONS 900
+#define IDM_BENCHMARK 901
+#define IDM_BENCHMARK2 902
+
+#define IDM_HELP_CONTENTS 960
+#define IDM_ABOUT 961
+
+#define IDS_OPTIONS 2100
+
+#define IDS_N_SELECTED_ITEMS 3002
+
+#define IDS_FILE_EXIST 3008
+#define IDS_WANT_UPDATE_MODIFIED_FILE 3009
+#define IDS_CANNOT_UPDATE_FILE 3010
+#define IDS_CANNOT_START_EDITOR 3011
+#define IDS_VIRUS 3012
+#define IDS_MESSAGE_UNSUPPORTED_OPERATION_FOR_LONG_PATH_FOLDER 3013
+#define IDS_SELECT_ONE_FILE 3014
+#define IDS_SELECT_FILES 3015
+#define IDS_TOO_MANY_ITEMS 3016
+
+#define IDS_COPY 6000
+#define IDS_MOVE 6001
+#define IDS_COPY_TO 6002
+#define IDS_MOVE_TO 6003
+#define IDS_COPYING 6004
+#define IDS_MOVING 6005
+#define IDS_RENAMING 6006
+
+#define IDS_OPERATION_IS_NOT_SUPPORTED 6008
+#define IDS_ERROR_RENAMING 6009
+#define IDS_CONFIRM_FILE_COPY 6010
+#define IDS_WANT_TO_COPY_FILES 6011
+
+#define IDS_CONFIRM_FILE_DELETE 6100
+#define IDS_CONFIRM_FOLDER_DELETE 6101
+#define IDS_CONFIRM_ITEMS_DELETE 6102
+#define IDS_WANT_TO_DELETE_FILE 6103
+#define IDS_WANT_TO_DELETE_FOLDER 6104
+#define IDS_WANT_TO_DELETE_ITEMS 6105
+#define IDS_DELETING 6106
+#define IDS_ERROR_DELETING 6107
+#define IDS_ERROR_LONG_PATH_TO_RECYCLE 6108
+
+#define IDS_CREATE_FOLDER 6300
+#define IDS_CREATE_FILE 6301
+#define IDS_CREATE_FOLDER_NAME 6302
+#define IDS_CREATE_FILE_NAME 6303
+#define IDS_CREATE_FOLDER_DEFAULT_NAME 6304
+#define IDS_CREATE_FILE_DEFAULT_NAME 6305
+#define IDS_CREATE_FOLDER_ERROR 6306
+#define IDS_CREATE_FILE_ERROR 6307
+
+#define IDS_COMMENT 6400
+#define IDS_COMMENT2 6401
+#define IDS_SELECT 6402
+#define IDS_DESELECT 6403
+#define IDS_SELECT_MASK 6404
+
+#define IDS_PROPERTIES 6600
+#define IDS_FOLDERS_HISTORY 6601
+
+#define IDS_COMPUTER 7100
+#define IDS_NETWORK 7101
+#define IDS_DOCUMENTS 7102
+#define IDS_SYSTEM 7103
+
+#define IDS_ADD 7200
+#define IDS_EXTRACT 7201
+#define IDS_TEST 7202
+#define IDS_BUTTON_COPY 7203
+#define IDS_BUTTON_MOVE 7204
+#define IDS_BUTTON_DELETE 7205
+#define IDS_BUTTON_INFO 7206
+
+#define IDS_SPLITTING 7303
+#define IDS_SPLIT_CONFIRM_TITLE 7304
+#define IDS_SPLIT_CONFIRM_MESSAGE 7305
+#define IDS_SPLIT_VOL_MUST_BE_SMALLER 7306
+
+#define IDS_COMBINE 7400
+#define IDS_COMBINE_TO 7401
+#define IDS_COMBINING 7402
+#define IDS_COMBINE_SELECT_ONE_FILE 7403
+#define IDS_COMBINE_CANT_DETECT_SPLIT_FILE 7404
+#define IDS_COMBINE_CANT_FIND_MORE_THAN_ONE_PART 7405
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resourceGui.h b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resourceGui.h
new file mode 100644
index 0000000000..025f316ecc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/FileManager/resourceGui.h
@@ -0,0 +1,15 @@
+#define IDI_ICON 1
+
+#define IDS_MESSAGE_NO_ERRORS 3001
+
+#define IDS_PROGRESS_TESTING 3302
+#define IDS_OPENNING 3303
+#define IDS_SCANNING 3304
+
+#define IDS_CHECKSUM_CALCULATING 7500
+#define IDS_CHECKSUM_INFORMATION 7501
+#define IDS_CHECKSUM_CRC_DATA 7502
+#define IDS_CHECKSUM_CRC_DATA_NAMES 7503
+#define IDS_CHECKSUM_CRC_STREAMS_NAMES 7504
+
+#define IDS_INCORRECT_VOLUME_SIZE 7307
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/Extract.rc b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/Extract.rc
new file mode 100644
index 0000000000..6bda89e393
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/Extract.rc
@@ -0,0 +1,59 @@
+#include "ExtractRes.h"
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ IDS_MEM_ERROR "The system cannot allocate the required amount of memory"
+ IDS_CANNOT_CREATE_FOLDER "Cannot create folder '{0}'"
+ IDS_UPDATE_NOT_SUPPORTED "Update operations are not supported for this archive."
+ IDS_CANT_OPEN_ARCHIVE "Can not open file '{0}' as archive"
+ IDS_CANT_OPEN_ENCRYPTED_ARCHIVE "Can not open encrypted archive '{0}'. Wrong password?"
+ IDS_UNSUPPORTED_ARCHIVE_TYPE "Unsupported archive type"
+
+ IDS_CANT_OPEN_AS_TYPE "Can not open the file as {0} archive"
+ IDS_IS_OPEN_AS_TYPE "The file is open as {0} archive"
+ IDS_IS_OPEN_WITH_OFFSET "The archive is open with offset"
+
+ IDS_PROGRESS_EXTRACTING "Extracting"
+
+ IDS_PROGRESS_SKIPPING "Skipping"
+
+ IDS_EXTRACT_SET_FOLDER "Specify a location for extracted files."
+
+ IDS_EXTRACT_PATHS_FULL "Full pathnames"
+ IDS_EXTRACT_PATHS_NO "No pathnames"
+ IDS_EXTRACT_PATHS_ABS "Absolute pathnames"
+ IDS_PATH_MODE_RELAT "Relative pathnames"
+
+ IDS_EXTRACT_OVERWRITE_ASK "Ask before overwrite"
+ IDS_EXTRACT_OVERWRITE_WITHOUT_PROMPT "Overwrite without prompt"
+ IDS_EXTRACT_OVERWRITE_SKIP_EXISTING "Skip existing files"
+ IDS_EXTRACT_OVERWRITE_RENAME "Auto rename"
+ IDS_EXTRACT_OVERWRITE_RENAME_EXISTING "Auto rename existing files"
+
+ IDS_EXTRACT_MESSAGE_UNSUPPORTED_METHOD "Unsupported compression method for '{0}'."
+ IDS_EXTRACT_MESSAGE_DATA_ERROR "Data error in '{0}'. File is broken"
+ IDS_EXTRACT_MESSAGE_CRC_ERROR "CRC failed in '{0}'. File is broken."
+ IDS_EXTRACT_MESSAGE_DATA_ERROR_ENCRYPTED "Data error in encrypted file '{0}'. Wrong password?"
+ IDS_EXTRACT_MESSAGE_CRC_ERROR_ENCRYPTED "CRC failed in encrypted file '{0}'. Wrong password?"
+
+ IDS_EXTRACT_MSG_WRONG_PSW_GUESS "Wrong password?"
+ // IDS_EXTRACT_MSG_ENCRYPTED "Encrypted file"
+
+ IDS_EXTRACT_MSG_UNSUPPORTED_METHOD "Unsupported compression method"
+ IDS_EXTRACT_MSG_DATA_ERROR "Data error"
+ IDS_EXTRACT_MSG_CRC_ERROR "CRC failed"
+ IDS_EXTRACT_MSG_UNAVAILABLE_DATA "Unavailable data"
+ IDS_EXTRACT_MSG_UEXPECTED_END "Unexpected end of data";
+ IDS_EXTRACT_MSG_DATA_AFTER_END "There are some data after the end of the payload data"
+ IDS_EXTRACT_MSG_IS_NOT_ARC "Is not archive"
+ IDS_EXTRACT_MSG_HEADERS_ERROR "Headers Error"
+ IDS_EXTRACT_MSG_WRONG_PSW_CLAIM "Wrong password"
+
+ IDS_OPEN_MSG_UNAVAILABLE_START "Unavailable start of archive"
+ IDS_OPEN_MSG_UNCONFIRMED_START "Unconfirmed start of archive"
+ // IDS_OPEN_MSG_ERROR_FLAGS + 5 "Unexpected end of archive"
+ // IDS_OPEN_MSG_ERROR_FLAGS + 6 "There are data after the end of archive"
+ IDS_OPEN_MSG_UNSUPPORTED_FEATURE "Unsupported feature"
+END
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.cpp
new file mode 100644
index 0000000000..71c2a3b614
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.cpp
@@ -0,0 +1,418 @@
+// ExtractDialog.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/StringConvert.h"
+#include "../../../Common/Wildcard.h"
+
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/ResourceString.h"
+
+#ifndef NO_REGISTRY
+#include "../FileManager/HelpUtils.h"
+#endif
+
+
+#include "../FileManager/BrowseDialog.h"
+#include "../FileManager/LangUtils.h"
+#include "../FileManager/resourceGui.h"
+
+#include "ExtractDialog.h"
+#include "ExtractDialogRes.h"
+#include "ExtractRes.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+
+extern HINSTANCE g_hInstance;
+
+static const UInt32 kPathMode_IDs[] =
+{
+ IDS_EXTRACT_PATHS_FULL,
+ IDS_EXTRACT_PATHS_NO,
+ IDS_EXTRACT_PATHS_ABS
+};
+
+static const UInt32 kOverwriteMode_IDs[] =
+{
+ IDS_EXTRACT_OVERWRITE_ASK,
+ IDS_EXTRACT_OVERWRITE_WITHOUT_PROMPT,
+ IDS_EXTRACT_OVERWRITE_SKIP_EXISTING,
+ IDS_EXTRACT_OVERWRITE_RENAME,
+ IDS_EXTRACT_OVERWRITE_RENAME_EXISTING
+};
+
+#ifndef _SFX
+
+static const
+ // NExtract::NPathMode::EEnum
+ int
+ kPathModeButtonsVals[] =
+{
+ NExtract::NPathMode::kFullPaths,
+ NExtract::NPathMode::kNoPaths,
+ NExtract::NPathMode::kAbsPaths
+};
+
+static const
+ int
+ // NExtract::NOverwriteMode::EEnum
+ kOverwriteButtonsVals[] =
+{
+ NExtract::NOverwriteMode::kAsk,
+ NExtract::NOverwriteMode::kOverwrite,
+ NExtract::NOverwriteMode::kSkip,
+ NExtract::NOverwriteMode::kRename,
+ NExtract::NOverwriteMode::kRenameExisting
+};
+
+#endif
+
+#ifdef LANG
+
+static const UInt32 kLangIDs[] =
+{
+ IDT_EXTRACT_EXTRACT_TO,
+ IDT_EXTRACT_PATH_MODE,
+ IDT_EXTRACT_OVERWRITE_MODE,
+ // IDX_EXTRACT_ALT_STREAMS,
+ IDX_EXTRACT_NT_SECUR,
+ IDX_EXTRACT_ELIM_DUP,
+ IDG_PASSWORD,
+ IDX_PASSWORD_SHOW
+};
+#endif
+
+// static const int kWildcardsButtonIndex = 2;
+
+#ifndef NO_REGISTRY
+static const unsigned kHistorySize = 16;
+#endif
+
+#ifndef _SFX
+
+// it's used in CompressDialog also
+void AddComboItems(NControl::CComboBox &combo, const UInt32 *langIDs, unsigned numItems, const int *values, int curVal)
+{
+ int curSel = 0;
+ for (unsigned i = 0; i < numItems; i++)
+ {
+ UString s = LangString(langIDs[i]);
+ s.RemoveChar(L'&');
+ int index = (int)combo.AddString(s);
+ combo.SetItemData(index, i);
+ if (values[i] == curVal)
+ curSel = i;
+ }
+ combo.SetCurSel(curSel);
+}
+
+// it's used in CompressDialog also
+bool GetBoolsVal(const CBoolPair &b1, const CBoolPair &b2)
+{
+ if (b1.Def) return b1.Val;
+ if (b2.Def) return b2.Val;
+ return b1.Val;
+}
+
+void CExtractDialog::CheckButton_TwoBools(UINT id, const CBoolPair &b1, const CBoolPair &b2)
+{
+ CheckButton(id, GetBoolsVal(b1, b2));
+}
+
+void CExtractDialog::GetButton_Bools(UINT id, CBoolPair &b1, CBoolPair &b2)
+{
+ bool val = IsButtonCheckedBool(id);
+ bool oldVal = GetBoolsVal(b1, b2);
+ if (val != oldVal)
+ b1.Def = b2.Def = true;
+ b1.Val = b2.Val = val;
+}
+
+#endif
+
+bool CExtractDialog::OnInit()
+{
+ #ifdef LANG
+ {
+ UString s;
+ LangString_OnlyFromLangFile(IDD_EXTRACT, s);
+ if (s.IsEmpty())
+ GetText(s);
+ if (!ArcPath.IsEmpty())
+ {
+ s += " : ";
+ s += ArcPath;
+ }
+ SetText(s);
+ // LangSetWindowText(*this, IDD_EXTRACT);
+ LangSetDlgItems(*this, kLangIDs, ARRAY_SIZE(kLangIDs));
+ }
+ #endif
+
+ #ifndef _SFX
+ _passwordControl.Attach(GetItem(IDE_EXTRACT_PASSWORD));
+ _passwordControl.SetText(Password);
+ _passwordControl.SetPasswordChar(TEXT('*'));
+ _pathName.Attach(GetItem(IDE_EXTRACT_NAME));
+ #endif
+
+ #ifdef NO_REGISTRY
+
+ PathMode = NExtract::NPathMode::kFullPaths;
+ OverwriteMode = NExtract::NOverwriteMode::kAsk;
+
+ #else
+
+ _info.Load();
+
+ if (_info.PathMode == NExtract::NPathMode::kCurPaths)
+ _info.PathMode = NExtract::NPathMode::kFullPaths;
+
+ if (!PathMode_Force && _info.PathMode_Force)
+ PathMode = _info.PathMode;
+ if (!OverwriteMode_Force && _info.OverwriteMode_Force)
+ OverwriteMode = _info.OverwriteMode;
+
+ // CheckButton_TwoBools(IDX_EXTRACT_ALT_STREAMS, AltStreams, _info.AltStreams);
+ CheckButton_TwoBools(IDX_EXTRACT_NT_SECUR, NtSecurity, _info.NtSecurity);
+ CheckButton_TwoBools(IDX_EXTRACT_ELIM_DUP, ElimDup, _info.ElimDup);
+
+ CheckButton(IDX_PASSWORD_SHOW, _info.ShowPassword.Val);
+ UpdatePasswordControl();
+
+ #endif
+
+ _path.Attach(GetItem(IDC_EXTRACT_PATH));
+
+ UString pathPrefix = DirPath;
+
+ #ifndef _SFX
+
+ if (_info.SplitDest.Val)
+ {
+ CheckButton(IDX_EXTRACT_NAME_ENABLE, true);
+ UString pathName;
+ SplitPathToParts_Smart(DirPath, pathPrefix, pathName);
+ if (pathPrefix.IsEmpty())
+ pathPrefix = pathName;
+ else
+ _pathName.SetText(pathName);
+ }
+ else
+ ShowItem_Bool(IDE_EXTRACT_NAME, false);
+
+ #endif
+
+ _path.SetText(pathPrefix);
+
+ #ifndef NO_REGISTRY
+ for (unsigned i = 0; i < _info.Paths.Size() && i < kHistorySize; i++)
+ _path.AddString(_info.Paths[i]);
+ #endif
+
+ /*
+ if (_info.Paths.Size() > 0)
+ _path.SetCurSel(0);
+ else
+ _path.SetCurSel(-1);
+ */
+
+ #ifndef _SFX
+
+ _pathMode.Attach(GetItem(IDC_EXTRACT_PATH_MODE));
+ _overwriteMode.Attach(GetItem(IDC_EXTRACT_OVERWRITE_MODE));
+
+ AddComboItems(_pathMode, kPathMode_IDs, ARRAY_SIZE(kPathMode_IDs), kPathModeButtonsVals, PathMode);
+ AddComboItems(_overwriteMode, kOverwriteMode_IDs, ARRAY_SIZE(kOverwriteMode_IDs), kOverwriteButtonsVals, OverwriteMode);
+
+ #endif
+
+ HICON icon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_ICON));
+ SetIcon(ICON_BIG, icon);
+
+ // CWindow filesWindow = GetItem(IDC_EXTRACT_RADIO_FILES);
+ // filesWindow.Enable(_enableFilesButton);
+
+ NormalizePosition();
+
+ return CModalDialog::OnInit();
+}
+
+#ifndef _SFX
+void CExtractDialog::UpdatePasswordControl()
+{
+ _passwordControl.SetPasswordChar(IsShowPasswordChecked() ? 0 : TEXT('*'));
+ UString password;
+ _passwordControl.GetText(password);
+ _passwordControl.SetText(password);
+}
+#endif
+
+bool CExtractDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch (buttonID)
+ {
+ case IDB_EXTRACT_SET_PATH:
+ OnButtonSetPath();
+ return true;
+ #ifndef _SFX
+ case IDX_EXTRACT_NAME_ENABLE:
+ ShowItem_Bool(IDE_EXTRACT_NAME, IsButtonCheckedBool(IDX_EXTRACT_NAME_ENABLE));
+ return true;
+ case IDX_PASSWORD_SHOW:
+ {
+ UpdatePasswordControl();
+ return true;
+ }
+ #endif
+ }
+ return CModalDialog::OnButtonClicked(buttonID, buttonHWND);
+}
+
+void CExtractDialog::OnButtonSetPath()
+{
+ UString currentPath;
+ _path.GetText(currentPath);
+ UString title = LangString(IDS_EXTRACT_SET_FOLDER);
+ UString resultPath;
+ if (!MyBrowseForFolder(*this, title, currentPath, resultPath))
+ return;
+ #ifndef NO_REGISTRY
+ _path.SetCurSel(-1);
+ #endif
+ _path.SetText(resultPath);
+}
+
+void AddUniqueString(UStringVector &list, const UString &s)
+{
+ FOR_VECTOR (i, list)
+ if (s.IsEqualTo_NoCase(list[i]))
+ return;
+ list.Add(s);
+}
+
+void CExtractDialog::OnOK()
+{
+ #ifndef _SFX
+ int pathMode2 = kPathModeButtonsVals[_pathMode.GetCurSel()];
+ if (PathMode != NExtract::NPathMode::kCurPaths ||
+ pathMode2 != NExtract::NPathMode::kFullPaths)
+ PathMode = (NExtract::NPathMode::EEnum)pathMode2;
+
+ OverwriteMode = (NExtract::NOverwriteMode::EEnum)kOverwriteButtonsVals[_overwriteMode.GetCurSel()];
+
+ // _filesMode = (NExtractionDialog::NFilesMode::EEnum)GetFilesMode();
+
+ _passwordControl.GetText(Password);
+
+ #endif
+
+ #ifndef NO_REGISTRY
+
+ // GetButton_Bools(IDX_EXTRACT_ALT_STREAMS, AltStreams, _info.AltStreams);
+ GetButton_Bools(IDX_EXTRACT_NT_SECUR, NtSecurity, _info.NtSecurity);
+ GetButton_Bools(IDX_EXTRACT_ELIM_DUP, ElimDup, _info.ElimDup);
+
+ bool showPassword = IsShowPasswordChecked();
+ if (showPassword != _info.ShowPassword.Val)
+ {
+ _info.ShowPassword.Def = true;
+ _info.ShowPassword.Val = showPassword;
+ }
+
+ if (_info.PathMode != pathMode2)
+ {
+ _info.PathMode_Force = true;
+ _info.PathMode = (NExtract::NPathMode::EEnum)pathMode2;
+ /*
+ // we allow kAbsPaths in registry.
+ if (_info.PathMode == NExtract::NPathMode::kAbsPaths)
+ _info.PathMode = NExtract::NPathMode::kFullPaths;
+ */
+ }
+
+ if (!OverwriteMode_Force && _info.OverwriteMode != OverwriteMode)
+ _info.OverwriteMode_Force = true;
+ _info.OverwriteMode = OverwriteMode;
+
+
+ #else
+
+ ElimDup.Val = IsButtonCheckedBool(IDX_EXTRACT_ELIM_DUP);
+
+ #endif
+
+ UString s;
+
+ #ifdef NO_REGISTRY
+
+ _path.GetText(s);
+
+ #else
+
+ int currentItem = _path.GetCurSel();
+ if (currentItem == CB_ERR)
+ {
+ _path.GetText(s);
+ if (_path.GetCount() >= kHistorySize)
+ currentItem = _path.GetCount() - 1;
+ }
+ else
+ _path.GetLBText(currentItem, s);
+
+ #endif
+
+ s.Trim();
+ NName::NormalizeDirPathPrefix(s);
+
+ #ifndef _SFX
+
+ bool splitDest = IsButtonCheckedBool(IDX_EXTRACT_NAME_ENABLE);
+ if (splitDest)
+ {
+ UString pathName;
+ _pathName.GetText(pathName);
+ pathName.Trim();
+ s += pathName;
+ NName::NormalizeDirPathPrefix(s);
+ }
+ if (splitDest != _info.SplitDest.Val)
+ {
+ _info.SplitDest.Def = true;
+ _info.SplitDest.Val = splitDest;
+ }
+
+ #endif
+
+ DirPath = s;
+
+ #ifndef NO_REGISTRY
+ _info.Paths.Clear();
+ #ifndef _SFX
+ AddUniqueString(_info.Paths, s);
+ #endif
+ for (int i = 0; i < _path.GetCount(); i++)
+ if (i != currentItem)
+ {
+ UString sTemp;
+ _path.GetLBText(i, sTemp);
+ sTemp.Trim();
+ AddUniqueString(_info.Paths, sTemp);
+ }
+ _info.Save();
+ #endif
+
+ CModalDialog::OnOK();
+}
+
+#ifndef NO_REGISTRY
+#define kHelpTopic "fm/plugins/7-zip/extract.htm"
+void CExtractDialog::OnHelp()
+{
+ ShowHelpWindow(kHelpTopic);
+ CModalDialog::OnHelp();
+}
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.h b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.h
new file mode 100644
index 0000000000..308c786764
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.h
@@ -0,0 +1,113 @@
+// ExtractDialog.h
+
+#ifndef __EXTRACT_DIALOG_H
+#define __EXTRACT_DIALOG_H
+
+#include "ExtractDialogRes.h"
+
+#include "../../../Windows/Control/ComboBox.h"
+#include "../../../Windows/Control/Edit.h"
+
+#include "../Common/ExtractMode.h"
+
+#include "../FileManager/DialogSize.h"
+
+#ifndef NO_REGISTRY
+#include "../Common/ZipRegistry.h"
+#endif
+
+namespace NExtractionDialog
+{
+ /*
+ namespace NFilesMode
+ {
+ enum EEnum
+ {
+ kSelected,
+ kAll,
+ kSpecified
+ };
+ }
+ */
+}
+
+class CExtractDialog: public NWindows::NControl::CModalDialog
+{
+ #ifdef NO_REGISTRY
+ NWindows::NControl::CDialogChildControl _path;
+ #else
+ NWindows::NControl::CComboBox _path;
+ #endif
+
+ #ifndef _SFX
+ NWindows::NControl::CEdit _pathName;
+ NWindows::NControl::CEdit _passwordControl;
+ NWindows::NControl::CComboBox _pathMode;
+ NWindows::NControl::CComboBox _overwriteMode;
+ #endif
+
+ #ifndef _SFX
+ // int GetFilesMode() const;
+ void UpdatePasswordControl();
+ #endif
+
+ void OnButtonSetPath();
+
+ void CheckButton_TwoBools(UINT id, const CBoolPair &b1, const CBoolPair &b2);
+ void GetButton_Bools(UINT id, CBoolPair &b1, CBoolPair &b2);
+ virtual bool OnInit();
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ virtual void OnOK();
+
+ #ifndef NO_REGISTRY
+
+ virtual void OnHelp();
+
+ NExtract::CInfo _info;
+
+ #endif
+
+ bool IsShowPasswordChecked() const { return IsButtonCheckedBool(IDX_PASSWORD_SHOW); }
+public:
+ // bool _enableSelectedFilesButton;
+ // bool _enableFilesButton;
+ // NExtractionDialog::NFilesMode::EEnum FilesMode;
+
+ UString DirPath;
+ UString ArcPath;
+
+ #ifndef _SFX
+ UString Password;
+ #endif
+ bool PathMode_Force;
+ bool OverwriteMode_Force;
+ NExtract::NPathMode::EEnum PathMode;
+ NExtract::NOverwriteMode::EEnum OverwriteMode;
+
+ #ifndef _SFX
+ // CBoolPair AltStreams;
+ CBoolPair NtSecurity;
+ #endif
+
+ CBoolPair ElimDup;
+
+ INT_PTR Create(HWND aWndParent = 0)
+ {
+ #ifdef _SFX
+ BIG_DIALOG_SIZE(240, 64);
+ #else
+ BIG_DIALOG_SIZE(300, 160);
+ #endif
+ return CModalDialog::Create(SIZED_DIALOG(IDD_EXTRACT), aWndParent);
+ }
+
+ CExtractDialog():
+ PathMode_Force(false),
+ OverwriteMode_Force(false)
+ {
+ ElimDup.Val = true;
+ }
+
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.rc b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.rc
new file mode 100644
index 0000000000..f5d65281cb
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialog.rc
@@ -0,0 +1,98 @@
+#include "ExtractDialogRes.h"
+#include "../../GuiCommon.rc"
+
+#define xc 336
+#define yc 168
+
+#undef g1xs
+#undef g2x
+#undef g2x2
+#undef g2xs
+#undef g2xs2
+
+#define g1xs 160
+
+#define gSpace 20
+#define g2x (m + g1xs + gSpace)
+#define g2x2 (g2x + m)
+#define g2xs (xc - g1xs - gSpace)
+#define g2xs2 (g2xs - m - m)
+
+#undef GROUP_Y_SIZE
+#ifdef UNDER_CE
+#define GROUP_Y_SIZE 8
+#else
+#define GROUP_Y_SIZE 56
+#endif
+
+IDD_EXTRACT DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "Extract"
+BEGIN
+ LTEXT "E&xtract to:", IDT_EXTRACT_EXTRACT_TO, m, m, xc, 8
+ COMBOBOX IDC_EXTRACT_PATH, m, m + 12, xc - bxsDots - 12, 100, MY_COMBO_WITH_EDIT
+ PUSHBUTTON "...", IDB_EXTRACT_SET_PATH, xs - m - bxsDots, m + 12 - 2, bxsDots, bys, WS_GROUP
+
+ CONTROL "", IDX_EXTRACT_NAME_ENABLE, MY_CHECKBOX, m, m + 34, 12, 10
+ EDITTEXT IDE_EXTRACT_NAME, m + 12 + 2, m + 32, g1xs - 12 - 2, 14, ES_AUTOHSCROLL
+
+ LTEXT "Path mode:", IDT_EXTRACT_PATH_MODE, m, m + 52, g1xs, 8
+ COMBOBOX IDC_EXTRACT_PATH_MODE, m, m + 64, g1xs, 140, MY_COMBO
+
+ CONTROL "Eliminate duplication of root folder", IDX_EXTRACT_ELIM_DUP, MY_CHECKBOX,
+ m, m + 84, g1xs, 10
+
+ LTEXT "Overwrite mode:", IDT_EXTRACT_OVERWRITE_MODE, m, m + 104, g1xs, 8
+ COMBOBOX IDC_EXTRACT_OVERWRITE_MODE, m, m + 116, g1xs, 140, MY_COMBO
+
+
+ GROUPBOX "Password", IDG_PASSWORD, g2x, m + 36, g2xs, GROUP_Y_SIZE
+ EDITTEXT IDE_EXTRACT_PASSWORD, g2x2, m + 50, g2xs2, 14, ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "Show Password", IDX_PASSWORD_SHOW, MY_CHECKBOX, g2x2, m + 72, g2xs2, 10
+
+// CONTROL "Restore alternate data streams", IDX_EXTRACT_ALT_STREAMS, MY_CHECKBOX,
+// g2x, m + 104, g2xs, 10
+ CONTROL "Restore file security", IDX_EXTRACT_NT_SECUR, MY_CHECKBOX,
+ g2x, m + 104, g2xs, 10
+
+ DEFPUSHBUTTON "OK", IDOK, bx3, by, bxs, bys, WS_GROUP
+ PUSHBUTTON "Cancel", IDCANCEL, bx2, by, bxs, bys
+ PUSHBUTTON "Help", IDHELP, bx1, by, bxs, bys
+END
+
+
+#ifdef UNDER_CE
+
+#undef m
+#define m 4
+
+#undef xc
+#undef yc
+
+#define xc 152
+#define yc 128
+
+#undef g1xs
+
+#define g1xs 64
+
+IDD_EXTRACT_2 DIALOG 0, 0, xs, ys MY_MODAL_DIALOG_STYLE MY_FONT
+CAPTION "Extract"
+BEGIN
+ LTEXT "E&xtract to:", IDT_EXTRACT_EXTRACT_TO, m, m, xc - bxsDots - 8, 8
+ COMBOBOX IDC_EXTRACT_PATH, m, m + 12, xc - bxsDots - 8, 100, MY_COMBO_WITH_EDIT
+ PUSHBUTTON "...", IDB_EXTRACT_SET_PATH, xs - m - bxsDots, m + 12 - 3, bxsDots, bys, WS_GROUP
+
+ LTEXT "Path mode:", IDT_EXTRACT_PATH_MODE, m, m + 36, g1xs, 8
+ COMBOBOX IDC_EXTRACT_PATH_MODE, m + g1xs, m + 36, xc - g1xs, 100, MY_COMBO
+
+ LTEXT "Overwrite mode:", IDT_EXTRACT_OVERWRITE_MODE, m, m + 56, g1xs, 8
+ COMBOBOX IDC_EXTRACT_OVERWRITE_MODE, m + g1xs, m + 56, xc - g1xs, 100, MY_COMBO
+
+ LTEXT "Password", IDG_PASSWORD, m, m + 76, g1xs, 8
+ EDITTEXT IDE_EXTRACT_PASSWORD, m + g1xs, m + 76, xc - g1xs, 14, ES_PASSWORD | ES_AUTOHSCROLL
+ CONTROL "Show Password", IDX_PASSWORD_SHOW, MY_CHECKBOX, m, m + 92, xc, 10
+
+ OK_CANCEL
+END
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialogRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialogRes.h
new file mode 100644
index 0000000000..e198796aa5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractDialogRes.h
@@ -0,0 +1,24 @@
+#define IDD_EXTRACT 3400
+#define IDD_EXTRACT_2 13400
+
+#define IDC_EXTRACT_PATH 100
+#define IDB_EXTRACT_SET_PATH 101
+#define IDC_EXTRACT_PATH_MODE 102
+#define IDC_EXTRACT_OVERWRITE_MODE 103
+
+#define IDE_EXTRACT_PASSWORD 120
+
+#define IDE_EXTRACT_NAME 130
+#define IDX_EXTRACT_NAME_ENABLE 131
+
+
+#define IDT_EXTRACT_EXTRACT_TO 3401
+#define IDT_EXTRACT_PATH_MODE 3410
+#define IDT_EXTRACT_OVERWRITE_MODE 3420
+
+#define IDX_EXTRACT_ELIM_DUP 3430
+#define IDX_EXTRACT_NT_SECUR 3431
+// #define IDX_EXTRACT_ALT_STREAMS 3432
+
+#define IDX_PASSWORD_SHOW 3803
+#define IDG_PASSWORD 3807
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.cpp b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.cpp
new file mode 100644
index 0000000000..37aa45b3f4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.cpp
@@ -0,0 +1,278 @@
+// ExtractGUI.cpp
+
+#include "StdAfx.h"
+
+#include "../../../Common/IntToString.h"
+#include "../../../Common/StringConvert.h"
+
+#include "../../../Windows/FileDir.h"
+#include "../../../Windows/FileFind.h"
+#include "../../../Windows/FileName.h"
+#include "../../../Windows/Thread.h"
+
+#include "../FileManager/ExtractCallback.h"
+#include "../FileManager/FormatUtils.h"
+#include "../FileManager/LangUtils.h"
+#include "../FileManager/resourceGui.h"
+#include "../FileManager/OverwriteDialogRes.h"
+
+#include "../Common/ArchiveExtractCallback.h"
+#include "../Common/PropIDUtils.h"
+
+#include "../Explorer/MyMessages.h"
+
+#include "resource2.h"
+#include "ExtractRes.h"
+
+#include "ExtractDialog.h"
+#include "ExtractGUI.h"
+#include "HashGUI.h"
+
+#include "../FileManager/PropertyNameRes.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDir;
+
+static const wchar_t * const kIncorrectOutDir = L"Incorrect output directory path";
+
+#ifndef _SFX
+
+static void AddValuePair(UString &s, UINT resourceID, UInt64 value, bool addColon = true)
+{
+ AddLangString(s, resourceID);
+ if (addColon)
+ s += ':';
+ s.Add_Space();
+ char sz[32];
+ ConvertUInt64ToString(value, sz);
+ s += sz;
+ s.Add_LF();
+}
+
+static void AddSizePair(UString &s, UINT resourceID, UInt64 value)
+{
+ AddLangString(s, resourceID);
+ s += ": ";
+ AddSizeValue(s, value);
+ s.Add_LF();
+}
+
+#endif
+
+class CThreadExtracting: public CProgressThreadVirt
+{
+ HRESULT ProcessVirt();
+public:
+ CCodecs *codecs;
+ CExtractCallbackImp *ExtractCallbackSpec;
+ const CObjectVector<COpenType> *FormatIndices;
+ const CIntVector *ExcludedFormatIndices;
+
+ UStringVector *ArchivePaths;
+ UStringVector *ArchivePathsFull;
+ const NWildcard::CCensorNode *WildcardCensor;
+ const CExtractOptions *Options;
+
+ #ifndef _SFX
+ CHashBundle *HashBundle;
+ virtual void ProcessWasFinished_GuiVirt();
+ #endif
+
+ CMyComPtr<IExtractCallbackUI> ExtractCallback;
+ UString Title;
+
+ CPropNameValPairs Pairs;
+};
+
+
+#ifndef _SFX
+void CThreadExtracting::ProcessWasFinished_GuiVirt()
+{
+ if (HashBundle && !Pairs.IsEmpty())
+ ShowHashResults(Pairs, *this);
+}
+#endif
+
+HRESULT CThreadExtracting::ProcessVirt()
+{
+ CDecompressStat Stat;
+
+ #ifndef _SFX
+ if (HashBundle)
+ HashBundle->Init();
+ #endif
+
+ HRESULT res = Extract(codecs,
+ *FormatIndices, *ExcludedFormatIndices,
+ *ArchivePaths, *ArchivePathsFull,
+ *WildcardCensor, *Options, ExtractCallbackSpec, ExtractCallback,
+ #ifndef _SFX
+ HashBundle,
+ #endif
+ FinalMessage.ErrorMessage.Message, Stat);
+
+ #ifndef _SFX
+ if (res == S_OK && ExtractCallbackSpec->IsOK())
+ {
+ if (HashBundle)
+ {
+ AddValuePair(Pairs, IDS_ARCHIVES_COLON, Stat.NumArchives);
+ AddSizeValuePair(Pairs, IDS_PROP_PACKED_SIZE, Stat.PackSize);
+ AddHashBundleRes(Pairs, *HashBundle, UString());
+ }
+ else if (Options->TestMode)
+ {
+ UString s;
+
+ AddValuePair(s, IDS_ARCHIVES_COLON, Stat.NumArchives, false);
+ AddSizePair(s, IDS_PROP_PACKED_SIZE, Stat.PackSize);
+
+ if (Stat.NumFolders != 0)
+ AddValuePair(s, IDS_PROP_FOLDERS, Stat.NumFolders);
+ AddValuePair(s, IDS_PROP_FILES, Stat.NumFiles);
+ AddSizePair(s, IDS_PROP_SIZE, Stat.UnpackSize);
+ if (Stat.NumAltStreams != 0)
+ {
+ s.Add_LF();
+ AddValuePair(s, IDS_PROP_NUM_ALT_STREAMS, Stat.NumAltStreams);
+ AddSizePair(s, IDS_PROP_ALT_STREAMS_SIZE, Stat.AltStreams_UnpackSize);
+ }
+ s.Add_LF();
+ AddLangString(s, IDS_MESSAGE_NO_ERRORS);
+ FinalMessage.OkMessage.Title = Title;
+ FinalMessage.OkMessage.Message = s;
+ }
+ }
+ #endif
+
+ return res;
+}
+
+
+
+HRESULT ExtractGUI(
+ CCodecs *codecs,
+ const CObjectVector<COpenType> &formatIndices,
+ const CIntVector &excludedFormatIndices,
+ UStringVector &archivePaths,
+ UStringVector &archivePathsFull,
+ const NWildcard::CCensorNode &wildcardCensor,
+ CExtractOptions &options,
+ #ifndef _SFX
+ CHashBundle *hb,
+ #endif
+ bool showDialog,
+ bool &messageWasDisplayed,
+ CExtractCallbackImp *extractCallback,
+ HWND hwndParent)
+{
+ messageWasDisplayed = false;
+
+ CThreadExtracting extracter;
+ extracter.codecs = codecs;
+ extracter.FormatIndices = &formatIndices;
+ extracter.ExcludedFormatIndices = &excludedFormatIndices;
+
+ if (!options.TestMode)
+ {
+ FString outputDir = options.OutputDir;
+ #ifndef UNDER_CE
+ if (outputDir.IsEmpty())
+ GetCurrentDir(outputDir);
+ #endif
+ if (showDialog)
+ {
+ CExtractDialog dialog;
+ FString outputDirFull;
+ if (!MyGetFullPathName(outputDir, outputDirFull))
+ {
+ ShowErrorMessage(kIncorrectOutDir);
+ messageWasDisplayed = true;
+ return E_FAIL;
+ }
+ NName::NormalizeDirPathPrefix(outputDirFull);
+
+ dialog.DirPath = fs2us(outputDirFull);
+
+ dialog.OverwriteMode = options.OverwriteMode;
+ dialog.OverwriteMode_Force = options.OverwriteMode_Force;
+ dialog.PathMode = options.PathMode;
+ dialog.PathMode_Force = options.PathMode_Force;
+ dialog.ElimDup = options.ElimDup;
+
+ if (archivePathsFull.Size() == 1)
+ dialog.ArcPath = archivePathsFull[0];
+
+ #ifndef _SFX
+ // dialog.AltStreams = options.NtOptions.AltStreams;
+ dialog.NtSecurity = options.NtOptions.NtSecurity;
+ if (extractCallback->PasswordIsDefined)
+ dialog.Password = extractCallback->Password;
+ #endif
+
+ if (dialog.Create(hwndParent) != IDOK)
+ return E_ABORT;
+
+ outputDir = us2fs(dialog.DirPath);
+
+ options.OverwriteMode = dialog.OverwriteMode;
+ options.PathMode = dialog.PathMode;
+ options.ElimDup = dialog.ElimDup;
+
+ #ifndef _SFX
+ // options.NtOptions.AltStreams = dialog.AltStreams;
+ options.NtOptions.NtSecurity = dialog.NtSecurity;
+ extractCallback->Password = dialog.Password;
+ extractCallback->PasswordIsDefined = !dialog.Password.IsEmpty();
+ #endif
+ }
+ if (!MyGetFullPathName(outputDir, options.OutputDir))
+ {
+ ShowErrorMessage(kIncorrectOutDir);
+ messageWasDisplayed = true;
+ return E_FAIL;
+ }
+ NName::NormalizeDirPathPrefix(options.OutputDir);
+
+ /*
+ if (!CreateComplexDirectory(options.OutputDir))
+ {
+ UString s = GetUnicodeString(NError::MyFormatMessage(GetLastError()));
+ UString s2 = MyFormatNew(IDS_CANNOT_CREATE_FOLDER,
+ #ifdef LANG
+ 0x02000603,
+ #endif
+ options.OutputDir);
+ s2.Add_LF();
+ s2 += s;
+ MyMessageBox(s2);
+ return E_FAIL;
+ }
+ */
+ }
+
+ UString title = LangString(options.TestMode ? IDS_PROGRESS_TESTING : IDS_PROGRESS_EXTRACTING);
+
+ extracter.Title = title;
+ extracter.ExtractCallbackSpec = extractCallback;
+ extracter.ExtractCallbackSpec->ProgressDialog = &extracter;
+ extracter.ExtractCallback = extractCallback;
+ extracter.ExtractCallbackSpec->Init();
+
+ extracter.CompressingMode = false;
+
+ extracter.ArchivePaths = &archivePaths;
+ extracter.ArchivePathsFull = &archivePathsFull;
+ extracter.WildcardCensor = &wildcardCensor;
+ extracter.Options = &options;
+ #ifndef _SFX
+ extracter.HashBundle = hb;
+ #endif
+
+ extracter.IconID = IDI_ICON;
+
+ RINOK(extracter.Create(title, hwndParent));
+ messageWasDisplayed = extracter.ThreadFinishedOK && extracter.MessagesDisplayed;
+ return extracter.Result;
+}
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.h b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.h
new file mode 100644
index 0000000000..466e524e0c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractGUI.h
@@ -0,0 +1,38 @@
+// GUI/ExtractGUI.h
+
+#ifndef __EXTRACT_GUI_H
+#define __EXTRACT_GUI_H
+
+#include "../Common/Extract.h"
+
+#include "../FileManager/ExtractCallback.h"
+
+/*
+ RESULT can be S_OK, even if there are errors!!!
+ if RESULT == S_OK, check extractCallback->IsOK() after ExtractGUI().
+
+ RESULT = E_ABORT - user break.
+ RESULT != E_ABORT:
+ {
+ messageWasDisplayed = true - message was displayed already.
+ messageWasDisplayed = false - there was some internal error, so you must show error message.
+ }
+*/
+
+HRESULT ExtractGUI(
+ CCodecs *codecs,
+ const CObjectVector<COpenType> &formatIndices,
+ const CIntVector &excludedFormatIndices,
+ UStringVector &archivePaths,
+ UStringVector &archivePathsFull,
+ const NWildcard::CCensorNode &wildcardCensor,
+ CExtractOptions &options,
+ #ifndef _SFX
+ CHashBundle *hb,
+ #endif
+ bool showDialog,
+ bool &messageWasDisplayed,
+ CExtractCallbackImp *extractCallback,
+ HWND hwndParent = NULL);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractRes.h b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractRes.h
new file mode 100644
index 0000000000..6437d953f8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/ExtractRes.h
@@ -0,0 +1,51 @@
+#define IDS_MEM_ERROR 3000
+
+#define IDS_CANNOT_CREATE_FOLDER 3003
+#define IDS_UPDATE_NOT_SUPPORTED 3004
+#define IDS_CANT_OPEN_ARCHIVE 3005
+#define IDS_CANT_OPEN_ENCRYPTED_ARCHIVE 3006
+#define IDS_UNSUPPORTED_ARCHIVE_TYPE 3007
+
+#define IDS_CANT_OPEN_AS_TYPE 3017
+#define IDS_IS_OPEN_AS_TYPE 3018
+#define IDS_IS_OPEN_WITH_OFFSET 3019
+
+#define IDS_PROGRESS_EXTRACTING 3300
+
+#define IDS_PROGRESS_SKIPPING 3325
+
+#define IDS_EXTRACT_SET_FOLDER 3402
+
+#define IDS_EXTRACT_PATHS_FULL 3411
+#define IDS_EXTRACT_PATHS_NO 3412
+#define IDS_EXTRACT_PATHS_ABS 3413
+#define IDS_PATH_MODE_RELAT 3414
+
+#define IDS_EXTRACT_OVERWRITE_ASK 3421
+#define IDS_EXTRACT_OVERWRITE_WITHOUT_PROMPT 3422
+#define IDS_EXTRACT_OVERWRITE_SKIP_EXISTING 3423
+#define IDS_EXTRACT_OVERWRITE_RENAME 3424
+#define IDS_EXTRACT_OVERWRITE_RENAME_EXISTING 3425
+
+#define IDS_EXTRACT_MESSAGE_UNSUPPORTED_METHOD 3700
+#define IDS_EXTRACT_MESSAGE_DATA_ERROR 3701
+#define IDS_EXTRACT_MESSAGE_CRC_ERROR 3702
+#define IDS_EXTRACT_MESSAGE_DATA_ERROR_ENCRYPTED 3703
+#define IDS_EXTRACT_MESSAGE_CRC_ERROR_ENCRYPTED 3704
+
+#define IDS_EXTRACT_MSG_WRONG_PSW_GUESS 3710
+// #define IDS_EXTRACT_MSG_ENCRYPTED 3711
+
+#define IDS_EXTRACT_MSG_UNSUPPORTED_METHOD 3721
+#define IDS_EXTRACT_MSG_DATA_ERROR 3722
+#define IDS_EXTRACT_MSG_CRC_ERROR 3723
+#define IDS_EXTRACT_MSG_UNAVAILABLE_DATA 3724
+#define IDS_EXTRACT_MSG_UEXPECTED_END 3725
+#define IDS_EXTRACT_MSG_DATA_AFTER_END 3726
+#define IDS_EXTRACT_MSG_IS_NOT_ARC 3727
+#define IDS_EXTRACT_MSG_HEADERS_ERROR 3728
+#define IDS_EXTRACT_MSG_WRONG_PSW_CLAIM 3729
+
+#define IDS_OPEN_MSG_UNAVAILABLE_START 3763
+#define IDS_OPEN_MSG_UNCONFIRMED_START 3764
+#define IDS_OPEN_MSG_UNSUPPORTED_FEATURE 3768
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/HashGUI.h b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/HashGUI.h
new file mode 100644
index 0000000000..d6caa53e5b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/HashGUI.h
@@ -0,0 +1,27 @@
+// HashGUI.h
+
+#ifndef __HASH_GUI_H
+#define __HASH_GUI_H
+
+#include "../Common/HashCalc.h"
+#include "../Common/Property.h"
+
+HRESULT HashCalcGUI(
+ DECL_EXTERNAL_CODECS_LOC_VARS
+ const NWildcard::CCensor &censor,
+ const CHashOptions &options,
+ bool &messageWasDisplayed);
+
+typedef CObjectVector<CProperty> CPropNameValPairs;
+
+void AddValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value);
+void AddSizeValue(UString &s, UInt64 value);
+void AddSizeValuePair(CPropNameValPairs &pairs, UINT resourceID, UInt64 value);
+
+void AddHashBundleRes(CPropNameValPairs &s, const CHashBundle &hb, const UString &firstFileName);
+void AddHashBundleRes(UString &s, const CHashBundle &hb, const UString &firstFileName);
+
+void ShowHashResults(const CPropNameValPairs &propPairs, HWND hwnd);
+void ShowHashResults(const CHashBundle &hb, const UString &firstFileName, HWND hwnd);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/7zip/UI/GUI/resource2.h b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/resource2.h
new file mode 100644
index 0000000000..152e71f8a6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/7zip/UI/GUI/resource2.h
@@ -0,0 +1,2 @@
+#define IDS_PROGRESS_COMPRESSING 3301
+#define IDS_ARCHIVES_COLON 3907
diff --git a/other-licenses/7zstub/src/CPP/Build.mak b/other-licenses/7zstub/src/CPP/Build.mak
new file mode 100644
index 0000000000..28d5eca27d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Build.mak
@@ -0,0 +1,145 @@
+LIBS = $(LIBS) oleaut32.lib ole32.lib
+
+!IFNDEF MY_NO_UNICODE
+CFLAGS = $(CFLAGS) -DUNICODE -D_UNICODE
+!ENDIF
+
+# CFLAGS = $(CFLAGS) -FAsc -Fa$O/Asm/
+
+!IFNDEF O
+!IFDEF CPU
+O=$(CPU)
+!ELSE
+O=O
+!ENDIF
+!ENDIF
+
+!IF "$(CPU)" == "AMD64"
+MY_ML = ml64 -Dx64 -WX
+!ELSEIF "$(CPU)" == "ARM"
+MY_ML = armasm -WX
+!ELSE
+MY_ML = ml -WX
+!ENDIF
+
+
+!IFDEF UNDER_CE
+RFLAGS = $(RFLAGS) -dUNDER_CE
+!IFDEF MY_CONSOLE
+LFLAGS = $(LFLAGS) /ENTRY:mainACRTStartup
+!ENDIF
+!ELSE
+!IFNDEF NEW_COMPILER
+LFLAGS = $(LFLAGS) -OPT:NOWIN98
+!ENDIF
+!IF "$(CPU)" != "ARM" && "$(CPU)" != "ARM64"
+CFLAGS = $(CFLAGS) -Gr
+!ENDIF
+LIBS = $(LIBS) user32.lib advapi32.lib shell32.lib
+!ENDIF
+
+!IF "$(CPU)" == "ARM"
+COMPL_ASM = $(MY_ML) $** $O/$(*B).obj
+!ELSE
+COMPL_ASM = $(MY_ML) -c -Fo$O/ $**
+!ENDIF
+
+CFLAGS = $(CFLAGS) -nologo -c -Fo$O/ -W4 -WX -EHsc -Gy -GR- -GF
+
+!IFDEF MY_STATIC_LINK
+!IFNDEF MY_SINGLE_THREAD
+CFLAGS = $(CFLAGS) -MT
+!ENDIF
+!ELSE
+CFLAGS = $(CFLAGS) -MD
+!ENDIF
+
+!IFDEF NEW_COMPILER
+CFLAGS = $(CFLAGS) -GS- -Zc:forScope -Zc:wchar_t
+!IFNDEF UNDER_CE
+CFLAGS = $(CFLAGS) -MP2
+!IFNDEF CPU
+# CFLAGS = $(CFLAGS) -arch:IA32
+!ENDIF
+!ENDIF
+!ELSE
+CFLAGS = $(CFLAGS)
+!ENDIF
+
+!IF "$(CPU)" == "AMD64"
+CFLAGS_O1 = $(CFLAGS) -O1
+!ELSE
+CFLAGS_O1 = $(CFLAGS) -O1
+!ENDIF
+CFLAGS_O2 = $(CFLAGS) -O2
+
+LFLAGS = $(LFLAGS) -nologo -OPT:REF -OPT:ICF
+
+!IFNDEF UNDER_CE
+LFLAGS = $(LFLAGS) /LARGEADDRESSAWARE
+!ENDIF
+
+!IFDEF DEF_FILE
+LFLAGS = $(LFLAGS) -DLL -DEF:$(DEF_FILE)
+!ELSE
+!IF defined(MY_FIXED) && "$(CPU)" != "ARM" && "$(CPU)" != "ARM64"
+LFLAGS = $(LFLAGS) /FIXED
+!ELSE
+LFLAGS = $(LFLAGS) /FIXED:NO
+!ENDIF
+# /BASE:0x400000
+!ENDIF
+
+
+# !IF "$(CPU)" == "AMD64"
+
+!IFDEF SUB_SYS_VER
+
+MY_SUB_SYS_VER=5.02
+
+!IFDEF MY_CONSOLE
+LFLAGS = $(LFLAGS) /SUBSYSTEM:console,$(MY_SUB_SYS_VER)
+!ELSE
+LFLAGS = $(LFLAGS) /SUBSYSTEM:windows,$(MY_SUB_SYS_VER)
+!ENDIF
+
+!ENDIF
+
+
+PROGPATH = $O\$(PROG)
+
+COMPL_O1 = $(CC) $(CFLAGS_O1) $**
+COMPL_O2 = $(CC) $(CFLAGS_O2) $**
+COMPL_PCH = $(CC) $(CFLAGS_O1) -Yc"StdAfx.h" -Fp$O/a.pch $**
+COMPL = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $**
+
+COMPLB = $(CC) $(CFLAGS_O1) -Yu"StdAfx.h" -Fp$O/a.pch $<
+# COMPLB_O2 = $(CC) $(CFLAGS_O2) -Yu"StdAfx.h" -Fp$O/a.pch $<
+COMPLB_O2 = $(CC) $(CFLAGS_O2) $<
+
+CFLAGS_C_ALL = $(CFLAGS_O2) $(CFLAGS_C_SPEC)
+CCOMPL_PCH = $(CC) $(CFLAGS_C_ALL) -Yc"Precomp.h" -Fp$O/a.pch $**
+CCOMPL_USE = $(CC) $(CFLAGS_C_ALL) -Yu"Precomp.h" -Fp$O/a.pch $**
+CCOMPL = $(CC) $(CFLAGS_C_ALL) $**
+CCOMPLB = $(CC) $(CFLAGS_C_ALL) $<
+
+
+all: $(PROGPATH)
+
+clean:
+ -del /Q $(PROGPATH) $O\*.exe $O\*.dll $O\*.obj $O\*.lib $O\*.exp $O\*.res $O\*.pch $O\*.asm
+
+$O:
+ if not exist "$O" mkdir "$O"
+$O/Asm:
+ if not exist "$O/Asm" mkdir "$O/Asm"
+
+$(PROGPATH): $O $O/Asm $(OBJS) $(DEF_FILE)
+ link $(LFLAGS) -out:$(PROGPATH) $(OBJS) $(LIBS)
+
+!IFNDEF NO_DEFAULT_RES
+$O\resource.res: $(*B).rc
+ rc $(RFLAGS) -fo$@ $**
+!ENDIF
+$O\StdAfx.obj: $(*B).cpp
+ $(COMPL_PCH)
diff --git a/other-licenses/7zstub/src/CPP/Common/AutoPtr.h b/other-licenses/7zstub/src/CPP/Common/AutoPtr.h
new file mode 100644
index 0000000000..e53fb7f5d5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/AutoPtr.h
@@ -0,0 +1,35 @@
+// Common/AutoPtr.h
+
+#ifndef __COMMON_AUTOPTR_H
+#define __COMMON_AUTOPTR_H
+
+template<class T> class CMyAutoPtr
+{
+ T *_p;
+public:
+ CMyAutoPtr(T *p = 0) : _p(p) {}
+ CMyAutoPtr(CMyAutoPtr<T>& p): _p(p.release()) {}
+ CMyAutoPtr<T>& operator=(CMyAutoPtr<T>& p)
+ {
+ reset(p.release());
+ return (*this);
+ }
+ ~CMyAutoPtr() { delete _p; }
+ T& operator*() const { return *_p; }
+ // T* operator->() const { return (&**this); }
+ T* get() const { return _p; }
+ T* release()
+ {
+ T *tmp = _p;
+ _p = 0;
+ return tmp;
+ }
+ void reset(T* p = 0)
+ {
+ if (p != _p)
+ delete _p;
+ _p = p;
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/CRC.cpp b/other-licenses/7zstub/src/CPP/Common/CRC.cpp
new file mode 100644
index 0000000000..6ac52c4c12
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/CRC.cpp
@@ -0,0 +1,7 @@
+// Common/CRC.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/7zCrc.h"
+
+struct CCRCTableInit { CCRCTableInit() { CrcGenerateTable(); } } g_CRCTableInit;
diff --git a/other-licenses/7zstub/src/CPP/Common/C_FileIO.cpp b/other-licenses/7zstub/src/CPP/Common/C_FileIO.cpp
new file mode 100644
index 0000000000..d68a427793
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/C_FileIO.cpp
@@ -0,0 +1,92 @@
+// Common/C_FileIO.cpp
+
+#include "C_FileIO.h"
+
+#include <fcntl.h>
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
+namespace NC {
+namespace NFile {
+namespace NIO {
+
+bool CFileBase::OpenBinary(const char *name, int flags)
+{
+ #ifdef O_BINARY
+ flags |= O_BINARY;
+ #endif
+ Close();
+ _handle = ::open(name, flags, 0666);
+ return _handle != -1;
+}
+
+bool CFileBase::Close()
+{
+ if (_handle == -1)
+ return true;
+ if (close(_handle) != 0)
+ return false;
+ _handle = -1;
+ return true;
+}
+
+bool CFileBase::GetLength(UInt64 &length) const
+{
+ off_t curPos = Seek(0, SEEK_CUR);
+ off_t lengthTemp = Seek(0, SEEK_END);
+ Seek(curPos, SEEK_SET);
+ length = (UInt64)lengthTemp;
+ return true;
+}
+
+off_t CFileBase::Seek(off_t distanceToMove, int moveMethod) const
+{
+ return ::lseek(_handle, distanceToMove, moveMethod);
+}
+
+/////////////////////////
+// CInFile
+
+bool CInFile::Open(const char *name)
+{
+ return CFileBase::OpenBinary(name, O_RDONLY);
+}
+
+bool CInFile::OpenShared(const char *name, bool)
+{
+ return Open(name);
+}
+
+ssize_t CInFile::Read(void *data, size_t size)
+{
+ return read(_handle, data, size);
+}
+
+/////////////////////////
+// COutFile
+
+bool COutFile::Create(const char *name, bool createAlways)
+{
+ if (createAlways)
+ {
+ Close();
+ _handle = ::creat(name, 0666);
+ return _handle != -1;
+ }
+ return OpenBinary(name, O_CREAT | O_EXCL | O_WRONLY);
+}
+
+bool COutFile::Open(const char *name, DWORD creationDisposition)
+{
+ return Create(name, false);
+}
+
+ssize_t COutFile::Write(const void *data, size_t size)
+{
+ return write(_handle, data, size);
+}
+
+}}}
diff --git a/other-licenses/7zstub/src/CPP/Common/C_FileIO.h b/other-licenses/7zstub/src/CPP/Common/C_FileIO.h
new file mode 100644
index 0000000000..4c400b41f2
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/C_FileIO.h
@@ -0,0 +1,53 @@
+// Common/C_FileIO.h
+
+#ifndef __COMMON_C_FILEIO_H
+#define __COMMON_C_FILEIO_H
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "MyTypes.h"
+#include "MyWindows.h"
+
+#ifdef _WIN32
+#ifdef _MSC_VER
+typedef size_t ssize_t;
+#endif
+#endif
+
+namespace NC {
+namespace NFile {
+namespace NIO {
+
+class CFileBase
+{
+protected:
+ int _handle;
+ bool OpenBinary(const char *name, int flags);
+public:
+ CFileBase(): _handle(-1) {};
+ ~CFileBase() { Close(); }
+ bool Close();
+ bool GetLength(UInt64 &length) const;
+ off_t Seek(off_t distanceToMove, int moveMethod) const;
+};
+
+class CInFile: public CFileBase
+{
+public:
+ bool Open(const char *name);
+ bool OpenShared(const char *name, bool shareForWrite);
+ ssize_t Read(void *data, size_t size);
+};
+
+class COutFile: public CFileBase
+{
+public:
+ bool Create(const char *name, bool createAlways);
+ bool Open(const char *name, DWORD creationDisposition);
+ ssize_t Write(const void *data, size_t size);
+};
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/ComTry.h b/other-licenses/7zstub/src/CPP/Common/ComTry.h
new file mode 100644
index 0000000000..e6b514d44e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/ComTry.h
@@ -0,0 +1,21 @@
+// ComTry.h
+
+#ifndef __COM_TRY_H
+#define __COM_TRY_H
+
+#include "MyWindows.h"
+// #include "Exception.h"
+// #include "NewHandler.h"
+
+#define COM_TRY_BEGIN try {
+#define COM_TRY_END } catch(...) { return E_OUTOFMEMORY; }
+
+/*
+#define COM_TRY_END } \
+ catch(const CNewException &) { return E_OUTOFMEMORY; } \
+ catch(...) { return HRESULT_FROM_WIN32(ERROR_NOACCESS); } \
+*/
+ // catch(const CSystemException &e) { return e.ErrorCode; }
+ // catch(...) { return E_FAIL; }
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/CommandLineParser.cpp b/other-licenses/7zstub/src/CPP/Common/CommandLineParser.cpp
new file mode 100644
index 0000000000..94aabce6dd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/CommandLineParser.cpp
@@ -0,0 +1,197 @@
+// CommandLineParser.cpp
+
+#include "StdAfx.h"
+
+#include "CommandLineParser.h"
+
+namespace NCommandLineParser {
+
+bool SplitCommandLine(const UString &src, UString &dest1, UString &dest2)
+{
+ dest1.Empty();
+ dest2.Empty();
+ bool quoteMode = false;
+ unsigned i;
+ for (i = 0; i < src.Len(); i++)
+ {
+ wchar_t c = src[i];
+ if ((c == L' ' || c == L'\t') && !quoteMode)
+ {
+ dest2 = src.Ptr(i + 1);
+ return i != 0;
+ }
+ if (c == L'\"')
+ quoteMode = !quoteMode;
+ else
+ dest1 += c;
+ }
+ return i != 0;
+}
+
+void SplitCommandLine(const UString &s, UStringVector &parts)
+{
+ UString sTemp (s);
+ sTemp.Trim();
+ parts.Clear();
+ for (;;)
+ {
+ UString s1, s2;
+ if (SplitCommandLine(sTemp, s1, s2))
+ parts.Add(s1);
+ if (s2.IsEmpty())
+ break;
+ sTemp = s2;
+ }
+}
+
+
+static const char * const kStopSwitchParsing = "--";
+
+static bool inline IsItSwitchChar(wchar_t c)
+{
+ return (c == '-');
+}
+
+CParser::CParser():
+ _switches(NULL),
+ StopSwitchIndex(-1)
+{
+}
+
+CParser::~CParser()
+{
+ delete []_switches;
+}
+
+
+// if (s) contains switch then function updates switch structures
+// out: true, if (s) is a switch
+bool CParser::ParseString(const UString &s, const CSwitchForm *switchForms, unsigned numSwitches)
+{
+ if (s.IsEmpty() || !IsItSwitchChar(s[0]))
+ return false;
+
+ unsigned pos = 1;
+ unsigned switchIndex = 0;
+ int maxLen = -1;
+
+ for (unsigned i = 0; i < numSwitches; i++)
+ {
+ const char * const key = switchForms[i].Key;
+ unsigned switchLen = MyStringLen(key);
+ if ((int)switchLen <= maxLen || pos + switchLen > s.Len())
+ continue;
+ if (IsString1PrefixedByString2_NoCase_Ascii((const wchar_t *)s + pos, key))
+ {
+ switchIndex = i;
+ maxLen = switchLen;
+ }
+ }
+
+ if (maxLen < 0)
+ {
+ ErrorMessage = "Unknown switch:";
+ return false;
+ }
+
+ pos += maxLen;
+
+ CSwitchResult &sw = _switches[switchIndex];
+ const CSwitchForm &form = switchForms[switchIndex];
+
+ if (!form.Multi && sw.ThereIs)
+ {
+ ErrorMessage = "Multiple instances for switch:";
+ return false;
+ }
+
+ sw.ThereIs = true;
+
+ int rem = s.Len() - pos;
+ if (rem < form.MinLen)
+ {
+ ErrorMessage = "Too short switch:";
+ return false;
+ }
+
+ sw.WithMinus = false;
+ sw.PostCharIndex = -1;
+
+ switch (form.Type)
+ {
+ case NSwitchType::kMinus:
+ if (rem == 1)
+ {
+ sw.WithMinus = (s[pos] == '-');
+ if (sw.WithMinus)
+ return true;
+ ErrorMessage = "Incorrect switch postfix:";
+ return false;
+ }
+ break;
+
+ case NSwitchType::kChar:
+ if (rem == 1)
+ {
+ wchar_t c = s[pos];
+ if (c <= 0x7F)
+ {
+ sw.PostCharIndex = FindCharPosInString(form.PostCharSet, (char)c);
+ if (sw.PostCharIndex >= 0)
+ return true;
+ }
+ ErrorMessage = "Incorrect switch postfix:";
+ return false;
+ }
+ break;
+
+ case NSwitchType::kString:
+ {
+ sw.PostStrings.Add(s.Ptr(pos));
+ return true;
+ }
+ }
+
+ if (pos != s.Len())
+ {
+ ErrorMessage = "Too long switch:";
+ return false;
+ }
+ return true;
+}
+
+
+bool CParser::ParseStrings(const CSwitchForm *switchForms, unsigned numSwitches, const UStringVector &commandStrings)
+{
+ StopSwitchIndex = -1;
+ ErrorMessage.Empty();
+ ErrorLine.Empty();
+ NonSwitchStrings.Clear();
+ delete []_switches;
+ _switches = NULL;
+ _switches = new CSwitchResult[numSwitches];
+
+ FOR_VECTOR (i, commandStrings)
+ {
+ const UString &s = commandStrings[i];
+ if (StopSwitchIndex < 0)
+ {
+ if (s.IsEqualTo(kStopSwitchParsing))
+ {
+ StopSwitchIndex = NonSwitchStrings.Size();
+ continue;
+ }
+ if (!s.IsEmpty() && IsItSwitchChar(s[0]))
+ {
+ if (ParseString(s, switchForms, numSwitches))
+ continue;
+ ErrorLine = s;
+ return false;
+ }
+ }
+ NonSwitchStrings.Add(s);
+ }
+ return true;
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/CommandLineParser.h b/other-licenses/7zstub/src/CPP/Common/CommandLineParser.h
new file mode 100644
index 0000000000..ec6336c81d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/CommandLineParser.h
@@ -0,0 +1,63 @@
+// Common/CommandLineParser.h
+
+#ifndef __COMMON_COMMAND_LINE_PARSER_H
+#define __COMMON_COMMAND_LINE_PARSER_H
+
+#include "MyString.h"
+
+namespace NCommandLineParser {
+
+bool SplitCommandLine(const UString &src, UString &dest1, UString &dest2);
+void SplitCommandLine(const UString &s, UStringVector &parts);
+
+namespace NSwitchType
+{
+ enum EEnum
+ {
+ kSimple,
+ kMinus,
+ kString,
+ kChar
+ };
+}
+
+struct CSwitchForm
+{
+ const char *Key;
+ Byte Type;
+ bool Multi;
+ Byte MinLen;
+ // int MaxLen;
+ const char *PostCharSet;
+};
+
+struct CSwitchResult
+{
+ bool ThereIs;
+ bool WithMinus;
+ int PostCharIndex;
+ UStringVector PostStrings;
+
+ CSwitchResult(): ThereIs(false) {};
+};
+
+class CParser
+{
+ CSwitchResult *_switches;
+
+ bool ParseString(const UString &s, const CSwitchForm *switchForms, unsigned numSwitches);
+public:
+ UStringVector NonSwitchStrings;
+ int StopSwitchIndex; // NonSwitchStrings[StopSwitchIndex+] are after "--"
+ AString ErrorMessage;
+ UString ErrorLine;
+
+ CParser();
+ ~CParser();
+ bool ParseStrings(const CSwitchForm *switchForms, unsigned numSwitches, const UStringVector &commandStrings);
+ const CSwitchResult& operator[](unsigned index) const { return _switches[index]; }
+};
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/Common.h b/other-licenses/7zstub/src/CPP/Common/Common.h
new file mode 100644
index 0000000000..c1ecc7ed44
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/Common.h
@@ -0,0 +1,43 @@
+// Common.h
+
+#ifndef __COMMON_COMMON_H
+#define __COMMON_COMMON_H
+
+/*
+This file is included to all cpp files in 7-Zip.
+Each folder contains StdAfx.h file that includes "Common.h".
+So 7-Zip includes "Common.h" in both modes:
+ with precompiled StdAfx.h
+and
+ without precompiled StdAfx.h
+
+If you use 7-Zip code, you must include "Common.h" before other h files of 7-zip.
+If you don't need some things that are used in 7-Zip,
+you can change this h file or h files included in this file.
+*/
+
+// compiler pragmas to disable some warnings
+#include "../../C/Compiler.h"
+
+// it's <windows.h> or code that defines windows things, if it's not _WIN32
+#include "MyWindows.h"
+
+// NewHandler.h and NewHandler.cpp redefine operator new() to throw exceptions, if compiled with old MSVC compilers
+#include "NewHandler.h"
+
+
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
+
+/* There is BUG in MSVC 6.0 compiler for operator new[]:
+ It doesn't check overflow, when it calculates size in bytes for allocated array.
+ So we can use MY_ARRAY_NEW macro instead of new[] operator. */
+
+#if defined(_MSC_VER) && (_MSC_VER == 1200) && !defined(_WIN64)
+ #define MY_ARRAY_NEW(p, T, size) p = new T[(size > (unsigned)0xFFFFFFFF / sizeof(T)) ? (unsigned)0xFFFFFFFF / sizeof(T) : size];
+#else
+ #define MY_ARRAY_NEW(p, T, size) p = new T[size];
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/CrcReg.cpp b/other-licenses/7zstub/src/CPP/Common/CrcReg.cpp
new file mode 100644
index 0000000000..1d9d009038
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/CrcReg.cpp
@@ -0,0 +1,98 @@
+// CrcReg.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/7zCrc.h"
+#include "../../C/CpuArch.h"
+
+#include "../Common/MyCom.h"
+
+#include "../7zip/Common/RegisterCodec.h"
+
+EXTERN_C_BEGIN
+
+typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
+
+UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table);
+
+extern CRC_FUNC g_CrcUpdate;
+extern CRC_FUNC g_CrcUpdateT8;
+extern CRC_FUNC g_CrcUpdateT4;
+
+EXTERN_C_END
+
+class CCrcHasher:
+ public IHasher,
+ public ICompressSetCoderProperties,
+ public CMyUnknownImp
+{
+ UInt32 _crc;
+ CRC_FUNC _updateFunc;
+ Byte mtDummy[1 << 7];
+
+ bool SetFunctions(UInt32 tSize);
+public:
+ CCrcHasher(): _crc(CRC_INIT_VAL) { SetFunctions(0); }
+
+ MY_UNKNOWN_IMP2(IHasher, ICompressSetCoderProperties)
+ INTERFACE_IHasher(;)
+ STDMETHOD(SetCoderProperties)(const PROPID *propIDs, const PROPVARIANT *props, UInt32 numProps);
+};
+
+bool CCrcHasher::SetFunctions(UInt32 tSize)
+{
+ _updateFunc = g_CrcUpdate;
+
+ if (tSize == 1)
+ _updateFunc = CrcUpdateT1;
+ else if (tSize == 4)
+ {
+ if (g_CrcUpdateT4)
+ _updateFunc = g_CrcUpdateT4;
+ else
+ return false;
+ }
+ else if (tSize == 8)
+ {
+ if (g_CrcUpdateT8)
+ _updateFunc = g_CrcUpdateT8;
+ else
+ return false;
+ }
+
+ return true;
+}
+
+STDMETHODIMP CCrcHasher::SetCoderProperties(const PROPID *propIDs, const PROPVARIANT *coderProps, UInt32 numProps)
+{
+ for (UInt32 i = 0; i < numProps; i++)
+ {
+ const PROPVARIANT &prop = coderProps[i];
+ if (propIDs[i] == NCoderPropID::kDefaultProp)
+ {
+ if (prop.vt != VT_UI4)
+ return E_INVALIDARG;
+ if (!SetFunctions(prop.ulVal))
+ return E_NOTIMPL;
+ }
+ }
+ return S_OK;
+}
+
+STDMETHODIMP_(void) CCrcHasher::Init() throw()
+{
+ _crc = CRC_INIT_VAL;
+}
+
+STDMETHODIMP_(void) CCrcHasher::Update(const void *data, UInt32 size) throw()
+{
+ _crc = _updateFunc(_crc, data, size, g_CrcTable);
+}
+
+STDMETHODIMP_(void) CCrcHasher::Final(Byte *digest) throw()
+{
+ UInt32 val = CRC_GET_DIGEST(_crc);
+ SetUi32(digest, val);
+}
+
+REGISTER_HASHER(CCrcHasher, 0x1, "CRC32", 4)
diff --git a/other-licenses/7zstub/src/CPP/Common/Defs.h b/other-licenses/7zstub/src/CPP/Common/Defs.h
new file mode 100644
index 0000000000..9416098132
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/Defs.h
@@ -0,0 +1,15 @@
+// Common/Defs.h
+
+#ifndef __COMMON_DEFS_H
+#define __COMMON_DEFS_H
+
+template <class T> inline T MyMin(T a, T b) { return a < b ? a : b; }
+template <class T> inline T MyMax(T a, T b) { return a > b ? a : b; }
+
+template <class T> inline int MyCompare(T a, T b)
+ { return a == b ? 0 : (a < b ? -1 : 1); }
+
+inline int BoolToInt(bool v) { return (v ? 1 : 0); }
+inline bool IntToBool(int v) { return (v != 0); }
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/DynamicBuffer.h b/other-licenses/7zstub/src/CPP/Common/DynamicBuffer.h
new file mode 100644
index 0000000000..16c925010e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/DynamicBuffer.h
@@ -0,0 +1,64 @@
+// Common/DynamicBuffer.h
+
+#ifndef __COMMON_DYNAMIC_BUFFER_H
+#define __COMMON_DYNAMIC_BUFFER_H
+
+template <class T> class CDynamicBuffer
+{
+ T *_items;
+ size_t _size;
+ size_t _pos;
+
+ CDynamicBuffer(const CDynamicBuffer &buffer);
+ void operator=(const CDynamicBuffer &buffer);
+
+ void Grow(size_t size)
+ {
+ size_t delta = _size >= 64 ? _size : 64;
+ if (delta < size)
+ delta = size;
+ size_t newCap = _size + delta;
+ if (newCap < delta)
+ {
+ newCap = _size + size;
+ if (newCap < size)
+ throw 20120116;
+ }
+
+ T *newBuffer = new T[newCap];
+ if (_pos != 0)
+ memcpy(newBuffer, _items, _pos * sizeof(T));
+ delete []_items;
+ _items = newBuffer;
+ _size = newCap;
+ }
+
+public:
+ CDynamicBuffer(): _items(0), _size(0), _pos(0) {}
+ // operator T *() { return _items; }
+ operator const T *() const { return _items; }
+ ~CDynamicBuffer() { delete []_items; }
+
+ T *GetCurPtrAndGrow(size_t addSize)
+ {
+ size_t rem = _size - _pos;
+ if (rem < addSize)
+ Grow(addSize - rem);
+ T *res = _items + _pos;
+ _pos += addSize;
+ return res;
+ }
+
+ void AddData(const T *data, size_t size)
+ {
+ memcpy(GetCurPtrAndGrow(size), data, size * sizeof(T));
+ }
+
+ const size_t GetPos() const { return _pos; }
+
+ // void Empty() { _pos = 0; }
+};
+
+typedef CDynamicBuffer<unsigned char> CByteDynamicBuffer;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/IntToString.cpp b/other-licenses/7zstub/src/CPP/Common/IntToString.cpp
new file mode 100644
index 0000000000..da627caefc
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/IntToString.cpp
@@ -0,0 +1,193 @@
+// Common/IntToString.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/CpuArch.h"
+
+#include "IntToString.h"
+
+#define CONVERT_INT_TO_STR(charType, tempSize) \
+ unsigned char temp[tempSize]; unsigned i = 0; \
+ while (val >= 10) { temp[i++] = (unsigned char)('0' + (unsigned)(val % 10)); val /= 10; } \
+ *s++ = (charType)('0' + (unsigned)val); \
+ while (i != 0) { i--; *s++ = temp[i]; } \
+ *s = 0;
+
+void ConvertUInt32ToString(UInt32 val, char *s) throw()
+{
+ CONVERT_INT_TO_STR(char, 16);
+}
+
+void ConvertUInt64ToString(UInt64 val, char *s) throw()
+{
+ if (val <= (UInt32)0xFFFFFFFF)
+ {
+ ConvertUInt32ToString((UInt32)val, s);
+ return;
+ }
+ CONVERT_INT_TO_STR(char, 24);
+}
+
+void ConvertUInt64ToOct(UInt64 val, char *s) throw()
+{
+ UInt64 v = val;
+ unsigned i;
+ for (i = 1;; i++)
+ {
+ v >>= 3;
+ if (v == 0)
+ break;
+ }
+ s[i] = 0;
+ do
+ {
+ unsigned t = (unsigned)(val & 0x7);
+ val >>= 3;
+ s[--i] = (char)('0' + t);
+ }
+ while (i);
+}
+
+
+#define GET_HEX_CHAR(t) ((char)(((t < 10) ? ('0' + t) : ('A' + (t - 10)))))
+
+static inline char GetHexChar(unsigned t) { return GET_HEX_CHAR(t); }
+
+
+void ConvertUInt32ToHex(UInt32 val, char *s) throw()
+{
+ UInt32 v = val;
+ unsigned i;
+ for (i = 1;; i++)
+ {
+ v >>= 4;
+ if (v == 0)
+ break;
+ }
+ s[i] = 0;
+ do
+ {
+ unsigned t = (unsigned)(val & 0xF);
+ val >>= 4;
+ s[--i] = GET_HEX_CHAR(t);
+ }
+ while (i);
+}
+
+
+void ConvertUInt64ToHex(UInt64 val, char *s) throw()
+{
+ UInt64 v = val;
+ unsigned i;
+ for (i = 1;; i++)
+ {
+ v >>= 4;
+ if (v == 0)
+ break;
+ }
+ s[i] = 0;
+ do
+ {
+ unsigned t = (unsigned)(val & 0xF);
+ val >>= 4;
+ s[--i] = GET_HEX_CHAR(t);
+ }
+ while (i);
+}
+
+void ConvertUInt32ToHex8Digits(UInt32 val, char *s) throw()
+{
+ s[8] = 0;
+ for (int i = 7; i >= 0; i--)
+ {
+ unsigned t = val & 0xF;
+ val >>= 4;
+ s[i] = GET_HEX_CHAR(t);;
+ }
+}
+
+/*
+void ConvertUInt32ToHex8Digits(UInt32 val, wchar_t *s)
+{
+ s[8] = 0;
+ for (int i = 7; i >= 0; i--)
+ {
+ unsigned t = val & 0xF;
+ val >>= 4;
+ s[i] = (wchar_t)(((t < 10) ? ('0' + t) : ('A' + (t - 10))));
+ }
+}
+*/
+
+void ConvertUInt32ToString(UInt32 val, wchar_t *s) throw()
+{
+ CONVERT_INT_TO_STR(wchar_t, 16);
+}
+
+void ConvertUInt64ToString(UInt64 val, wchar_t *s) throw()
+{
+ if (val <= (UInt32)0xFFFFFFFF)
+ {
+ ConvertUInt32ToString((UInt32)val, s);
+ return;
+ }
+ CONVERT_INT_TO_STR(wchar_t, 24);
+}
+
+void ConvertInt64ToString(Int64 val, char *s) throw()
+{
+ if (val < 0)
+ {
+ *s++ = '-';
+ val = -val;
+ }
+ ConvertUInt64ToString(val, s);
+}
+
+void ConvertInt64ToString(Int64 val, wchar_t *s) throw()
+{
+ if (val < 0)
+ {
+ *s++ = L'-';
+ val = -val;
+ }
+ ConvertUInt64ToString(val, s);
+}
+
+
+static void ConvertByteToHex2Digits(unsigned v, char *s) throw()
+{
+ s[0] = GetHexChar(v >> 4);
+ s[1] = GetHexChar(v & 0xF);
+}
+
+static void ConvertUInt16ToHex4Digits(UInt32 val, char *s) throw()
+{
+ ConvertByteToHex2Digits(val >> 8, s);
+ ConvertByteToHex2Digits(val & 0xFF, s + 2);
+}
+
+char *RawLeGuidToString(const Byte *g, char *s) throw()
+{
+ ConvertUInt32ToHex8Digits(GetUi32(g ), s); s += 8; *s++ = '-';
+ ConvertUInt16ToHex4Digits(GetUi16(g + 4), s); s += 4; *s++ = '-';
+ ConvertUInt16ToHex4Digits(GetUi16(g + 6), s); s += 4; *s++ = '-';
+ for (unsigned i = 0; i < 8; i++)
+ {
+ if (i == 2)
+ *s++ = '-';
+ ConvertByteToHex2Digits(g[8 + i], s);
+ s += 2;
+ }
+ *s = 0;
+ return s;
+}
+
+char *RawLeGuidToString_Braced(const Byte *g, char *s) throw()
+{
+ *s++ = '{';
+ s = RawLeGuidToString(g, s);
+ *s++ = '}';
+ *s = 0;
+ return s;
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/IntToString.h b/other-licenses/7zstub/src/CPP/Common/IntToString.h
new file mode 100644
index 0000000000..07b67c31fa
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/IntToString.h
@@ -0,0 +1,28 @@
+// Common/IntToString.h
+
+#ifndef __COMMON_INT_TO_STRING_H
+#define __COMMON_INT_TO_STRING_H
+
+#include "MyTypes.h"
+
+void ConvertUInt32ToString(UInt32 value, char *s) throw();
+void ConvertUInt64ToString(UInt64 value, char *s) throw();
+
+void ConvertUInt32ToString(UInt32 value, wchar_t *s) throw();
+void ConvertUInt64ToString(UInt64 value, wchar_t *s) throw();
+
+void ConvertUInt64ToOct(UInt64 value, char *s) throw();
+
+void ConvertUInt32ToHex(UInt32 value, char *s) throw();
+void ConvertUInt64ToHex(UInt64 value, char *s) throw();
+void ConvertUInt32ToHex8Digits(UInt32 value, char *s) throw();
+// void ConvertUInt32ToHex8Digits(UInt32 value, wchar_t *s) throw();
+
+void ConvertInt64ToString(Int64 value, char *s) throw();
+void ConvertInt64ToString(Int64 value, wchar_t *s) throw();
+
+// use RawLeGuid only for RAW bytes that contain stored GUID as Little-endian.
+char *RawLeGuidToString(const Byte *guid, char *s) throw();
+char *RawLeGuidToString_Braced(const Byte *guid, char *s) throw();
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/Lang.h b/other-licenses/7zstub/src/CPP/Common/Lang.h
new file mode 100644
index 0000000000..e95de6859d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/Lang.h
@@ -0,0 +1,23 @@
+// Common/Lang.h
+
+#ifndef __COMMON_LANG_H
+#define __COMMON_LANG_H
+
+#include "MyString.h"
+
+class CLang
+{
+ wchar_t *_text;
+ CRecordVector<UInt32> _ids;
+ CRecordVector<UInt32> _offsets;
+
+ bool OpenFromString(const AString &s);
+public:
+ CLang(): _text(0) {}
+ ~CLang() { Clear(); }
+ bool Open(CFSTR fileName, const char *id);
+ void Clear() throw();
+ const wchar_t *Get(UInt32 id) const throw();
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/ListFileUtils.cpp b/other-licenses/7zstub/src/CPP/Common/ListFileUtils.cpp
new file mode 100644
index 0000000000..f22680b504
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/ListFileUtils.cpp
@@ -0,0 +1,117 @@
+// Common/ListFileUtils.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/CpuArch.h"
+
+#include "../Windows/FileIO.h"
+
+#include "ListFileUtils.h"
+#include "MyBuffer.h"
+#include "StringConvert.h"
+#include "UTFConvert.h"
+
+static const char kQuoteChar = '\"';
+
+static void AddName(UStringVector &strings, UString &s)
+{
+ s.Trim();
+ if (s.Len() >= 2 && s[0] == kQuoteChar && s.Back() == kQuoteChar)
+ {
+ s.DeleteBack();
+ s.Delete(0);
+ }
+ if (!s.IsEmpty())
+ strings.Add(s);
+}
+
+bool ReadNamesFromListFile(CFSTR fileName, UStringVector &strings, UINT codePage)
+{
+ NWindows::NFile::NIO::CInFile file;
+ if (!file.Open(fileName))
+ return false;
+ UInt64 fileSize;
+ if (!file.GetLength(fileSize))
+ return false;
+ if (fileSize >= ((UInt32)1 << 31) - 32)
+ return false;
+ UString u;
+ if (codePage == MY__CP_UTF16 || codePage == MY__CP_UTF16BE)
+ {
+ if ((fileSize & 1) != 0)
+ return false;
+ CByteArr buf((size_t)fileSize);
+ UInt32 processed;
+ if (!file.Read(buf, (UInt32)fileSize, processed))
+ return false;
+ if (processed != fileSize)
+ return false;
+ file.Close();
+ unsigned num = (unsigned)fileSize / 2;
+ wchar_t *p = u.GetBuf(num);
+ if (codePage == MY__CP_UTF16)
+ for (unsigned i = 0; i < num; i++)
+ {
+ wchar_t c = GetUi16(buf + (size_t)i * 2);
+ if (c == 0)
+ return false;
+ p[i] = c;
+ }
+ else
+ for (unsigned i = 0; i < num; i++)
+ {
+ wchar_t c = (wchar_t)GetBe16(buf + (size_t)i * 2);
+ if (c == 0)
+ return false;
+ p[i] = c;
+ }
+ p[num] = 0;
+ u.ReleaseBuf_SetLen(num);
+ }
+ else
+ {
+ AString s;
+ char *p = s.GetBuf((unsigned)fileSize);
+ UInt32 processed;
+ if (!file.Read(p, (UInt32)fileSize, processed))
+ return false;
+ if (processed != fileSize)
+ return false;
+ file.Close();
+ s.ReleaseBuf_CalcLen((unsigned)processed);
+ if (s.Len() != processed)
+ return false;
+
+ // #ifdef CP_UTF8
+ if (codePage == CP_UTF8)
+ {
+ if (!ConvertUTF8ToUnicode(s, u))
+ return false;
+ }
+ else
+ // #endif
+ MultiByteToUnicodeString2(u, s, codePage);
+ }
+
+ const wchar_t kGoodBOM = 0xFEFF;
+ const wchar_t kBadBOM = 0xFFFE;
+
+ UString s;
+ unsigned i = 0;
+ for (; i < u.Len() && u[i] == kGoodBOM; i++);
+ for (; i < u.Len(); i++)
+ {
+ wchar_t c = u[i];
+ if (c == kGoodBOM || c == kBadBOM)
+ return false;
+ if (c == '\n' || c == 0xD)
+ {
+ AddName(strings, s);
+ s.Empty();
+ }
+ else
+ s += c;
+ }
+ AddName(strings, s);
+ return true;
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/ListFileUtils.h b/other-licenses/7zstub/src/CPP/Common/ListFileUtils.h
new file mode 100644
index 0000000000..ec32d8e048
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/ListFileUtils.h
@@ -0,0 +1,14 @@
+// Common/ListFileUtils.h
+
+#ifndef __COMMON_LIST_FILE_UTILS_H
+#define __COMMON_LIST_FILE_UTILS_H
+
+#include "MyString.h"
+#include "MyTypes.h"
+
+#define MY__CP_UTF16 1200
+#define MY__CP_UTF16BE 1201
+
+bool ReadNamesFromListFile(CFSTR fileName, UStringVector &strings, UINT codePage = CP_OEMCP);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyBuffer.h b/other-licenses/7zstub/src/CPP/Common/MyBuffer.h
new file mode 100644
index 0000000000..ae320eefe9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyBuffer.h
@@ -0,0 +1,259 @@
+// Common/MyBuffer.h
+
+#ifndef __COMMON_MY_BUFFER_H
+#define __COMMON_MY_BUFFER_H
+
+#include "Defs.h"
+
+/* 7-Zip now uses CBuffer only as CByteBuffer.
+ So there is no need to use MY_ARRAY_NEW macro in CBuffer code. */
+
+template <class T> class CBuffer
+{
+ T *_items;
+ size_t _size;
+
+public:
+ void Free()
+ {
+ if (_items)
+ {
+ delete []_items;
+ _items = 0;
+ }
+ _size = 0;
+ }
+
+ CBuffer(): _items(0), _size(0) {};
+ CBuffer(size_t size): _items(0), _size(0) { _items = new T[size]; _size = size; }
+ CBuffer(const CBuffer &buffer): _items(0), _size(0)
+ {
+ size_t size = buffer._size;
+ if (size != 0)
+ {
+ _items = new T[size];
+ memcpy(_items, buffer._items, size * sizeof(T));
+ _size = size;
+ }
+ }
+
+ ~CBuffer() { delete []_items; }
+
+ operator T *() { return _items; }
+ operator const T *() const { return _items; }
+ size_t Size() const { return _size; }
+
+ void Alloc(size_t size)
+ {
+ if (size != _size)
+ {
+ Free();
+ if (size != 0)
+ {
+ _items = new T[size];
+ _size = size;
+ }
+ }
+ }
+
+ void AllocAtLeast(size_t size)
+ {
+ if (size > _size)
+ {
+ Free();
+ _items = new T[size];
+ _size = size;
+ }
+ }
+
+ void CopyFrom(const T *data, size_t size)
+ {
+ Alloc(size);
+ if (size != 0)
+ memcpy(_items, data, size * sizeof(T));
+ }
+
+ void ChangeSize_KeepData(size_t newSize, size_t keepSize)
+ {
+ if (newSize == _size)
+ return;
+ T *newBuffer = NULL;
+ if (newSize != 0)
+ {
+ newBuffer = new T[newSize];
+ if (keepSize > _size)
+ keepSize = _size;
+ if (keepSize != 0)
+ memcpy(newBuffer, _items, MyMin(keepSize, newSize) * sizeof(T));
+ }
+ delete []_items;
+ _items = newBuffer;
+ _size = newSize;
+ }
+
+ CBuffer& operator=(const CBuffer &buffer)
+ {
+ if (&buffer != this)
+ CopyFrom(buffer, buffer._size);
+ return *this;
+ }
+};
+
+template <class T>
+bool operator==(const CBuffer<T>& b1, const CBuffer<T>& b2)
+{
+ size_t size1 = b1.Size();
+ if (size1 != b2.Size())
+ return false;
+ if (size1 == 0)
+ return true;
+ return memcmp(b1, b2, size1 * sizeof(T)) == 0;
+}
+
+template <class T>
+bool operator!=(const CBuffer<T>& b1, const CBuffer<T>& b2)
+{
+ size_t size1 = b1.Size();
+ if (size1 != b2.Size())
+ return true;
+ if (size1 == 0)
+ return false;
+ return memcmp(b1, b2, size1 * sizeof(T)) != 0;
+}
+
+
+// typedef CBuffer<char> CCharBuffer;
+// typedef CBuffer<wchar_t> CWCharBuffer;
+typedef CBuffer<unsigned char> CByteBuffer;
+
+
+template <class T> class CObjArray
+{
+protected:
+ T *_items;
+private:
+ // we disable copy
+ CObjArray(const CObjArray &buffer);
+ void operator=(const CObjArray &buffer);
+public:
+ void Free()
+ {
+ delete []_items;
+ _items = 0;
+ }
+ CObjArray(size_t size): _items(0)
+ {
+ if (size != 0)
+ {
+ MY_ARRAY_NEW(_items, T, size)
+ // _items = new T[size];
+ }
+ }
+ CObjArray(): _items(0) {};
+ ~CObjArray() { delete []_items; }
+
+ operator T *() { return _items; }
+ operator const T *() const { return _items; }
+
+ void Alloc(size_t newSize)
+ {
+ delete []_items;
+ _items = 0;
+ MY_ARRAY_NEW(_items, T, newSize)
+ // _items = new T[newSize];
+ }
+};
+
+typedef CObjArray<unsigned char> CByteArr;
+typedef CObjArray<bool> CBoolArr;
+typedef CObjArray<int> CIntArr;
+typedef CObjArray<unsigned> CUIntArr;
+
+
+template <class T> class CObjArray2
+{
+ T *_items;
+ unsigned _size;
+
+ // we disable copy
+ CObjArray2(const CObjArray2 &buffer);
+ void operator=(const CObjArray2 &buffer);
+public:
+
+ void Free()
+ {
+ delete []_items;
+ _items = 0;
+ _size = 0;
+ }
+ CObjArray2(): _items(0), _size(0) {};
+ /*
+ CObjArray2(const CObjArray2 &buffer): _items(0), _size(0)
+ {
+ size_t newSize = buffer._size;
+ if (newSize != 0)
+ {
+ T *newBuffer = new T[newSize];;
+ _items = newBuffer;
+ _size = newSize;
+ const T *src = buffer;
+ for (size_t i = 0; i < newSize; i++)
+ newBuffer[i] = src[i];
+ }
+ }
+ */
+ /*
+ CObjArray2(size_t size): _items(0), _size(0)
+ {
+ if (size != 0)
+ {
+ _items = new T[size];
+ _size = size;
+ }
+ }
+ */
+
+ ~CObjArray2() { delete []_items; }
+
+ operator T *() { return _items; }
+ operator const T *() const { return _items; }
+
+ unsigned Size() const { return (unsigned)_size; }
+ bool IsEmpty() const { return _size == 0; }
+
+ // SetSize doesn't keep old items. It allocates new array if size is not equal
+ void SetSize(unsigned size)
+ {
+ if (size == _size)
+ return;
+ T *newBuffer = NULL;
+ if (size != 0)
+ {
+ MY_ARRAY_NEW(newBuffer, T, size)
+ // newBuffer = new T[size];
+ }
+ delete []_items;
+ _items = newBuffer;
+ _size = size;
+ }
+
+ /*
+ CObjArray2& operator=(const CObjArray2 &buffer)
+ {
+ Free();
+ size_t newSize = buffer._size;
+ if (newSize != 0)
+ {
+ T *newBuffer = new T[newSize];;
+ _items = newBuffer;
+ _size = newSize;
+ const T *src = buffer;
+ for (size_t i = 0; i < newSize; i++)
+ newBuffer[i] = src[i];
+ }
+ return *this;
+ }
+ */
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyBuffer2.h b/other-licenses/7zstub/src/CPP/Common/MyBuffer2.h
new file mode 100644
index 0000000000..5cabd73c5e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyBuffer2.h
@@ -0,0 +1,45 @@
+// Common/MyBuffer2.h
+
+#ifndef __COMMON_MY_BUFFER2_H
+#define __COMMON_MY_BUFFER2_H
+
+#include "../../C/Alloc.h"
+
+#include "Defs.h"
+
+class CMidBuffer
+{
+ Byte *_data;
+ size_t _size;
+
+ CLASS_NO_COPY(CMidBuffer)
+
+public:
+ CMidBuffer(): _data(NULL), _size(0) {};
+ ~CMidBuffer() { ::MidFree(_data); }
+
+ void Free() { ::MidFree(_data); _data = NULL; _size = 0; }
+
+ bool IsAllocated() const { return _data != NULL; }
+ operator Byte *() { return _data; }
+ operator const Byte *() const { return _data; }
+ size_t Size() const { return _size; }
+
+ void AllocAtLeast(size_t size)
+ {
+ if (!_data || size > _size)
+ {
+ const size_t kMinSize = (size_t)1 << 16;
+ if (size < kMinSize)
+ size = kMinSize;
+ ::MidFree(_data);
+ _size = 0;
+ _data = 0;
+ _data = (Byte *)::MidAlloc(size);
+ if (_data)
+ _size = size;
+ }
+ }
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyCom.h b/other-licenses/7zstub/src/CPP/Common/MyCom.h
new file mode 100644
index 0000000000..ca49ead992
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyCom.h
@@ -0,0 +1,277 @@
+// MyCom.h
+
+#ifndef __MY_COM_H
+#define __MY_COM_H
+
+#include "MyWindows.h"
+
+#ifndef RINOK
+#define RINOK(x) { HRESULT __result_ = (x); if (__result_ != S_OK) return __result_; }
+#endif
+
+template <class T>
+class CMyComPtr
+{
+ T* _p;
+public:
+ CMyComPtr(): _p(NULL) {}
+ CMyComPtr(T* p) throw() { if ((_p = p) != NULL) p->AddRef(); }
+ CMyComPtr(const CMyComPtr<T>& lp) throw() { if ((_p = lp._p) != NULL) _p->AddRef(); }
+ ~CMyComPtr() { if (_p) _p->Release(); }
+ void Release() { if (_p) { _p->Release(); _p = NULL; } }
+ operator T*() const { return (T*)_p; }
+ // T& operator*() const { return *_p; }
+ T** operator&() { return &_p; }
+ T* operator->() const { return _p; }
+ T* operator=(T* p)
+ {
+ if (p)
+ p->AddRef();
+ if (_p)
+ _p->Release();
+ _p = p;
+ return p;
+ }
+ T* operator=(const CMyComPtr<T>& lp) { return (*this = lp._p); }
+ bool operator!() const { return (_p == NULL); }
+ // bool operator==(T* pT) const { return _p == pT; }
+ void Attach(T* p2)
+ {
+ Release();
+ _p = p2;
+ }
+ T* Detach()
+ {
+ T* pt = _p;
+ _p = NULL;
+ return pt;
+ }
+ #ifdef _WIN32
+ HRESULT CoCreateInstance(REFCLSID rclsid, REFIID iid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
+ {
+ return ::CoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, (void**)&_p);
+ }
+ #endif
+ /*
+ HRESULT CoCreateInstance(LPCOLESTR szProgID, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
+ {
+ CLSID clsid;
+ HRESULT hr = CLSIDFromProgID(szProgID, &clsid);
+ ATLASSERT(_p == NULL);
+ if (SUCCEEDED(hr))
+ hr = ::CoCreateInstance(clsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&_p);
+ return hr;
+ }
+ */
+ template <class Q>
+ HRESULT QueryInterface(REFGUID iid, Q** pp) const throw()
+ {
+ return _p->QueryInterface(iid, (void**)pp);
+ }
+};
+
+//////////////////////////////////////////////////////////
+
+inline HRESULT StringToBstr(LPCOLESTR src, BSTR *bstr)
+{
+ *bstr = ::SysAllocString(src);
+ return (*bstr) ? S_OK : E_OUTOFMEMORY;
+}
+
+class CMyComBSTR
+{
+ BSTR m_str;
+
+public:
+ CMyComBSTR(): m_str(NULL) {}
+ ~CMyComBSTR() { ::SysFreeString(m_str); }
+ BSTR* operator&() { return &m_str; }
+ operator LPCOLESTR() const { return m_str; }
+ // operator bool() const { return m_str != NULL; }
+ // bool operator!() const { return m_str == NULL; }
+private:
+ // operator BSTR() const { return m_str; }
+
+ CMyComBSTR(LPCOLESTR src) { m_str = ::SysAllocString(src); }
+ // CMyComBSTR(int nSize) { m_str = ::SysAllocStringLen(NULL, nSize); }
+ // CMyComBSTR(int nSize, LPCOLESTR sz) { m_str = ::SysAllocStringLen(sz, nSize); }
+ CMyComBSTR(const CMyComBSTR& src) { m_str = src.MyCopy(); }
+
+ /*
+ CMyComBSTR(REFGUID src)
+ {
+ LPOLESTR szGuid;
+ StringFromCLSID(src, &szGuid);
+ m_str = ::SysAllocString(szGuid);
+ CoTaskMemFree(szGuid);
+ }
+ */
+
+ CMyComBSTR& operator=(const CMyComBSTR& src)
+ {
+ if (m_str != src.m_str)
+ {
+ if (m_str)
+ ::SysFreeString(m_str);
+ m_str = src.MyCopy();
+ }
+ return *this;
+ }
+
+ CMyComBSTR& operator=(LPCOLESTR src)
+ {
+ ::SysFreeString(m_str);
+ m_str = ::SysAllocString(src);
+ return *this;
+ }
+
+ unsigned Len() const { return ::SysStringLen(m_str); }
+
+ BSTR MyCopy() const
+ {
+ // We don't support Byte BSTRs here
+ return ::SysAllocStringLen(m_str, ::SysStringLen(m_str));
+ /*
+ UINT byteLen = ::SysStringByteLen(m_str);
+ BSTR res = ::SysAllocStringByteLen(NULL, byteLen);
+ if (res && byteLen != 0 && m_str)
+ memcpy(res, m_str, byteLen);
+ return res;
+ */
+ }
+
+ /*
+ void Attach(BSTR src) { m_str = src; }
+ BSTR Detach()
+ {
+ BSTR s = m_str;
+ m_str = NULL;
+ return s;
+ }
+ */
+
+ void Empty()
+ {
+ ::SysFreeString(m_str);
+ m_str = NULL;
+ }
+};
+
+
+
+/*
+ If CMyUnknownImp doesn't use virtual destructor, the code size is smaller.
+ But if some class_1 derived from CMyUnknownImp
+ uses MY_ADDREF_RELEASE and IUnknown::Release()
+ and some another class_2 is derived from class_1,
+ then class_1 must use virtual destructor:
+ virtual ~class_1();
+ In that case, class_1::Release() calls correct destructor of class_2.
+
+ Also you can use virtual ~CMyUnknownImp(), if you want to disable warning
+ "class has virtual functions, but destructor is not virtual".
+*/
+
+class CMyUnknownImp
+{
+public:
+ ULONG __m_RefCount;
+ CMyUnknownImp(): __m_RefCount(0) {}
+
+ // virtual
+ ~CMyUnknownImp() {}
+};
+
+
+
+#define MY_QUERYINTERFACE_BEGIN STDMETHOD(QueryInterface) \
+(REFGUID iid, void **outObject) throw() { *outObject = NULL;
+
+#define MY_QUERYINTERFACE_ENTRY(i) else if (iid == IID_ ## i) \
+ { *outObject = (void *)(i *)this; }
+
+#define MY_QUERYINTERFACE_ENTRY_UNKNOWN(i) if (iid == IID_IUnknown) \
+ { *outObject = (void *)(IUnknown *)(i *)this; }
+
+#define MY_QUERYINTERFACE_BEGIN2(i) MY_QUERYINTERFACE_BEGIN \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i) \
+ MY_QUERYINTERFACE_ENTRY(i)
+
+#define MY_QUERYINTERFACE_END else return E_NOINTERFACE; ++__m_RefCount; /* AddRef(); */ return S_OK; }
+
+#define MY_ADDREF_RELEASE \
+STDMETHOD_(ULONG, AddRef)() throw() { return ++__m_RefCount; } \
+STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \
+ return __m_RefCount; delete this; return 0; }
+
+#define MY_UNKNOWN_IMP_SPEC(i) \
+ MY_QUERYINTERFACE_BEGIN \
+ i \
+ MY_QUERYINTERFACE_END \
+ MY_ADDREF_RELEASE
+
+
+#define MY_UNKNOWN_IMP MY_QUERYINTERFACE_BEGIN \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(IUnknown) \
+ MY_QUERYINTERFACE_END \
+ MY_ADDREF_RELEASE
+
+#define MY_UNKNOWN_IMP1(i) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i) \
+ MY_QUERYINTERFACE_ENTRY(i) \
+ )
+
+#define MY_UNKNOWN_IMP2(i1, i2) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i1) \
+ MY_QUERYINTERFACE_ENTRY(i1) \
+ MY_QUERYINTERFACE_ENTRY(i2) \
+ )
+
+#define MY_UNKNOWN_IMP3(i1, i2, i3) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i1) \
+ MY_QUERYINTERFACE_ENTRY(i1) \
+ MY_QUERYINTERFACE_ENTRY(i2) \
+ MY_QUERYINTERFACE_ENTRY(i3) \
+ )
+
+#define MY_UNKNOWN_IMP4(i1, i2, i3, i4) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i1) \
+ MY_QUERYINTERFACE_ENTRY(i1) \
+ MY_QUERYINTERFACE_ENTRY(i2) \
+ MY_QUERYINTERFACE_ENTRY(i3) \
+ MY_QUERYINTERFACE_ENTRY(i4) \
+ )
+
+#define MY_UNKNOWN_IMP5(i1, i2, i3, i4, i5) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i1) \
+ MY_QUERYINTERFACE_ENTRY(i1) \
+ MY_QUERYINTERFACE_ENTRY(i2) \
+ MY_QUERYINTERFACE_ENTRY(i3) \
+ MY_QUERYINTERFACE_ENTRY(i4) \
+ MY_QUERYINTERFACE_ENTRY(i5) \
+ )
+
+#define MY_UNKNOWN_IMP6(i1, i2, i3, i4, i5, i6) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i1) \
+ MY_QUERYINTERFACE_ENTRY(i1) \
+ MY_QUERYINTERFACE_ENTRY(i2) \
+ MY_QUERYINTERFACE_ENTRY(i3) \
+ MY_QUERYINTERFACE_ENTRY(i4) \
+ MY_QUERYINTERFACE_ENTRY(i5) \
+ MY_QUERYINTERFACE_ENTRY(i6) \
+ )
+
+#define MY_UNKNOWN_IMP7(i1, i2, i3, i4, i5, i6, i7) MY_UNKNOWN_IMP_SPEC( \
+ MY_QUERYINTERFACE_ENTRY_UNKNOWN(i1) \
+ MY_QUERYINTERFACE_ENTRY(i1) \
+ MY_QUERYINTERFACE_ENTRY(i2) \
+ MY_QUERYINTERFACE_ENTRY(i3) \
+ MY_QUERYINTERFACE_ENTRY(i4) \
+ MY_QUERYINTERFACE_ENTRY(i5) \
+ MY_QUERYINTERFACE_ENTRY(i6) \
+ MY_QUERYINTERFACE_ENTRY(i7) \
+ )
+
+const HRESULT k_My_HRESULT_WritingWasCut = 0x20000010;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyException.h b/other-licenses/7zstub/src/CPP/Common/MyException.h
new file mode 100644
index 0000000000..cd9fe6948b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyException.h
@@ -0,0 +1,14 @@
+// Common/Exception.h
+
+#ifndef __COMMON_EXCEPTION_H
+#define __COMMON_EXCEPTION_H
+
+#include "MyWindows.h"
+
+struct CSystemException
+{
+ HRESULT ErrorCode;
+ CSystemException(HRESULT errorCode): ErrorCode(errorCode) {}
+};
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyGuidDef.h b/other-licenses/7zstub/src/CPP/Common/MyGuidDef.h
new file mode 100644
index 0000000000..e0359e203a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyGuidDef.h
@@ -0,0 +1,54 @@
+// Common/MyGuidDef.h
+
+#ifndef GUID_DEFINED
+#define GUID_DEFINED
+
+#include "MyTypes.h"
+
+typedef struct {
+ UInt32 Data1;
+ UInt16 Data2;
+ UInt16 Data3;
+ unsigned char Data4[8];
+} GUID;
+
+#ifdef __cplusplus
+#define REFGUID const GUID &
+#else
+#define REFGUID const GUID *
+#endif
+
+#define REFCLSID REFGUID
+#define REFIID REFGUID
+
+#ifdef __cplusplus
+inline int operator==(REFGUID g1, REFGUID g2)
+{
+ for (int i = 0; i < (int)sizeof(g1); i++)
+ if (((unsigned char *)&g1)[i] != ((unsigned char *)&g2)[i])
+ return 0;
+ return 1;
+}
+inline int operator!=(REFGUID g1, REFGUID g2) { return !(g1 == g2); }
+#endif
+
+#ifdef __cplusplus
+ #define MY_EXTERN_C extern "C"
+#else
+ #define MY_EXTERN_C extern
+#endif
+
+#endif
+
+
+#ifdef DEFINE_GUID
+#undef DEFINE_GUID
+#endif
+
+#ifdef INITGUID
+ #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ MY_EXTERN_C const GUID name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
+#else
+ #define DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ MY_EXTERN_C const GUID name
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyInitGuid.h b/other-licenses/7zstub/src/CPP/Common/MyInitGuid.h
new file mode 100644
index 0000000000..79fea19ab8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyInitGuid.h
@@ -0,0 +1,45 @@
+// Common/MyInitGuid.h
+
+#ifndef __COMMON_MY_INITGUID_H
+#define __COMMON_MY_INITGUID_H
+
+/*
+This file must be included only to one C++ file in project before
+declarations of COM interfaces with DEFINE_GUID macro.
+
+Each GUID must be initialized exactly once in project.
+There are two different versions of the DEFINE_GUID macro in guiddef.h (MyGuidDef.h):
+ - if INITGUID is not defined: DEFINE_GUID declares an external reference to the symbol name.
+ - if INITGUID is defined: DEFINE_GUID initializes the symbol name to the value of the GUID.
+
+Also we need IID_IUnknown that is initialized in some file for linking:
+ MSVC: by default the linker uses some lib file that contains IID_IUnknown
+ MinGW: add -luuid switch for linker
+ WinCE: we define IID_IUnknown in this file
+ Other: we define IID_IUnknown in this file
+*/
+
+#ifdef _WIN32
+
+#ifdef UNDER_CE
+#include <basetyps.h>
+#endif
+
+#include <initguid.h>
+
+#ifdef UNDER_CE
+DEFINE_GUID(IID_IUnknown,
+0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+#endif
+
+#else
+
+#define INITGUID
+#include "MyGuidDef.h"
+DEFINE_GUID(IID_IUnknown,
+0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+
+#endif
+
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyLinux.h b/other-licenses/7zstub/src/CPP/Common/MyLinux.h
new file mode 100644
index 0000000000..b4e7605226
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyLinux.h
@@ -0,0 +1,42 @@
+// MyLinux.h
+
+#ifndef __MY_LIN_LINUX_H
+#define __MY_LIN_LINUX_H
+
+#define MY_LIN_S_IFMT 00170000
+#define MY_LIN_S_IFSOCK 0140000
+#define MY_LIN_S_IFLNK 0120000
+#define MY_LIN_S_IFREG 0100000
+#define MY_LIN_S_IFBLK 0060000
+#define MY_LIN_S_IFDIR 0040000
+#define MY_LIN_S_IFCHR 0020000
+#define MY_LIN_S_IFIFO 0010000
+
+#define MY_LIN_S_ISLNK(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFLNK)
+#define MY_LIN_S_ISREG(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFREG)
+#define MY_LIN_S_ISDIR(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFDIR)
+#define MY_LIN_S_ISCHR(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFCHR)
+#define MY_LIN_S_ISBLK(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFBLK)
+#define MY_LIN_S_ISFIFO(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFIFO)
+#define MY_LIN_S_ISSOCK(m) (((m) & MY_LIN_S_IFMT) == MY_LIN_S_IFSOCK)
+
+#define MY_LIN_S_ISUID 0004000
+#define MY_LIN_S_ISGID 0002000
+#define MY_LIN_S_ISVTX 0001000
+
+#define MY_LIN_S_IRWXU 00700
+#define MY_LIN_S_IRUSR 00400
+#define MY_LIN_S_IWUSR 00200
+#define MY_LIN_S_IXUSR 00100
+
+#define MY_LIN_S_IRWXG 00070
+#define MY_LIN_S_IRGRP 00040
+#define MY_LIN_S_IWGRP 00020
+#define MY_LIN_S_IXGRP 00010
+
+#define MY_LIN_S_IRWXO 00007
+#define MY_LIN_S_IROTH 00004
+#define MY_LIN_S_IWOTH 00002
+#define MY_LIN_S_IXOTH 00001
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyString.cpp b/other-licenses/7zstub/src/CPP/Common/MyString.cpp
new file mode 100644
index 0000000000..bf62303df1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyString.cpp
@@ -0,0 +1,1659 @@
+// Common/MyString.cpp
+
+#include "StdAfx.h"
+
+#ifdef _WIN32
+#include <wchar.h>
+#else
+#include <ctype.h>
+#endif
+
+#include "IntToString.h"
+
+#if !defined(_UNICODE) || !defined(USE_UNICODE_FSTRING)
+#include "StringConvert.h"
+#endif
+
+#include "MyString.h"
+
+#define MY_STRING_NEW(_T_, _size_) new _T_[_size_]
+// #define MY_STRING_NEW(_T_, _size_) ((_T_ *)my_new((size_t)(_size_) * sizeof(_T_)))
+
+/*
+inline const char* MyStringGetNextCharPointer(const char *p) throw()
+{
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ return CharNextA(p);
+ #else
+ return p + 1;
+ #endif
+}
+*/
+
+#define MY_STRING_NEW_char(_size_) MY_STRING_NEW(char, _size_)
+#define MY_STRING_NEW_wchar_t(_size_) MY_STRING_NEW(wchar_t, _size_)
+
+
+int FindCharPosInString(const char *s, char c) throw()
+{
+ for (const char *p = s;; p++)
+ {
+ if (*p == c)
+ return (int)(p - s);
+ if (*p == 0)
+ return -1;
+ // MyStringGetNextCharPointer(p);
+ }
+}
+
+int FindCharPosInString(const wchar_t *s, wchar_t c) throw()
+{
+ for (const wchar_t *p = s;; p++)
+ {
+ if (*p == c)
+ return (int)(p - s);
+ if (*p == 0)
+ return -1;
+ }
+}
+
+/*
+void MyStringUpper_Ascii(char *s) throw()
+{
+ for (;;)
+ {
+ char c = *s;
+ if (c == 0)
+ return;
+ *s++ = MyCharUpper_Ascii(c);
+ }
+}
+
+void MyStringUpper_Ascii(wchar_t *s) throw()
+{
+ for (;;)
+ {
+ wchar_t c = *s;
+ if (c == 0)
+ return;
+ *s++ = MyCharUpper_Ascii(c);
+ }
+}
+*/
+
+void MyStringLower_Ascii(char *s) throw()
+{
+ for (;;)
+ {
+ char c = *s;
+ if (c == 0)
+ return;
+ *s++ = MyCharLower_Ascii(c);
+ }
+}
+
+void MyStringLower_Ascii(wchar_t *s) throw()
+{
+ for (;;)
+ {
+ wchar_t c = *s;
+ if (c == 0)
+ return;
+ *s++ = MyCharLower_Ascii(c);
+ }
+}
+
+#ifdef _WIN32
+
+#ifdef _UNICODE
+
+// wchar_t * MyStringUpper(wchar_t *s) { return CharUpperW(s); }
+// wchar_t * MyStringLower(wchar_t *s) { return CharLowerW(s); }
+// for WinCE - FString - char
+// const char *MyStringGetPrevCharPointer(const char * /* base */, const char *p) { return p - 1; }
+
+#else
+
+// const char * MyStringGetPrevCharPointer(const char *base, const char *p) throw() { return CharPrevA(base, p); }
+// char * MyStringUpper(char *s) { return CharUpperA(s); }
+// char * MyStringLower(char *s) { return CharLowerA(s); }
+
+wchar_t MyCharUpper_WIN(wchar_t c) throw()
+{
+ wchar_t *res = CharUpperW((LPWSTR)(UINT_PTR)(unsigned)c);
+ if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return (wchar_t)(unsigned)(UINT_PTR)res;
+ const int kBufSize = 4;
+ char s[kBufSize + 1];
+ int numChars = ::WideCharToMultiByte(CP_ACP, 0, &c, 1, s, kBufSize, 0, 0);
+ if (numChars == 0 || numChars > kBufSize)
+ return c;
+ s[numChars] = 0;
+ ::CharUpperA(s);
+ ::MultiByteToWideChar(CP_ACP, 0, s, numChars, &c, 1);
+ return c;
+}
+
+/*
+wchar_t MyCharLower_WIN(wchar_t c)
+{
+ wchar_t *res = CharLowerW((LPWSTR)(UINT_PTR)(unsigned)c);
+ if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return (wchar_t)(unsigned)(UINT_PTR)res;
+ const int kBufSize = 4;
+ char s[kBufSize + 1];
+ int numChars = ::WideCharToMultiByte(CP_ACP, 0, &c, 1, s, kBufSize, 0, 0);
+ if (numChars == 0 || numChars > kBufSize)
+ return c;
+ s[numChars] = 0;
+ ::CharLowerA(s);
+ ::MultiByteToWideChar(CP_ACP, 0, s, numChars, &c, 1);
+ return c;
+}
+*/
+
+/*
+wchar_t * MyStringUpper(wchar_t *s)
+{
+ if (s == 0)
+ return 0;
+ wchar_t *res = CharUpperW(s);
+ if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return res;
+ AString a = UnicodeStringToMultiByte(s);
+ a.MakeUpper();
+ MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
+ return s;
+}
+*/
+
+/*
+wchar_t * MyStringLower(wchar_t *s)
+{
+ if (s == 0)
+ return 0;
+ wchar_t *res = CharLowerW(s);
+ if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
+ return res;
+ AString a = UnicodeStringToMultiByte(s);
+ a.MakeLower();
+ MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
+ return s;
+}
+*/
+
+#endif
+
+#endif
+
+bool IsString1PrefixedByString2(const char *s1, const char *s2) throw()
+{
+ for (;;)
+ {
+ unsigned char c2 = (unsigned char)*s2++; if (c2 == 0) return true;
+ unsigned char c1 = (unsigned char)*s1++; if (c1 != c2) return false;
+ }
+}
+
+bool StringsAreEqualNoCase(const wchar_t *s1, const wchar_t *s2) throw()
+{
+ for (;;)
+ {
+ wchar_t c1 = *s1++;
+ wchar_t c2 = *s2++;
+ if (c1 != c2 && MyCharUpper(c1) != MyCharUpper(c2)) return false;
+ if (c1 == 0) return true;
+ }
+}
+
+// ---------- ASCII ----------
+
+bool AString::IsPrefixedBy_Ascii_NoCase(const char *s) const throw()
+{
+ const char *s1 = _chars;
+ for (;;)
+ {
+ char c2 = *s++;
+ if (c2 == 0)
+ return true;
+ char c1 = *s1++;
+ if (MyCharLower_Ascii(c1) !=
+ MyCharLower_Ascii(c2))
+ return false;
+ }
+}
+
+bool UString::IsPrefixedBy_Ascii_NoCase(const char *s) const throw()
+{
+ const wchar_t *s1 = _chars;
+ for (;;)
+ {
+ char c2 = *s++;
+ if (c2 == 0)
+ return true;
+ wchar_t c1 = *s1++;
+ if (MyCharLower_Ascii(c1) != (unsigned char)MyCharLower_Ascii(c2))
+ return false;
+ }
+}
+
+bool StringsAreEqual_Ascii(const wchar_t *u, const char *a) throw()
+{
+ for (;;)
+ {
+ unsigned char c = *a;
+ if (c != *u)
+ return false;
+ if (c == 0)
+ return true;
+ a++;
+ u++;
+ }
+}
+
+bool StringsAreEqualNoCase_Ascii(const char *s1, const char *s2) throw()
+{
+ for (;;)
+ {
+ char c1 = *s1++;
+ char c2 = *s2++;
+ if (c1 != c2 && MyCharLower_Ascii(c1) != MyCharLower_Ascii(c2))
+ return false;
+ if (c1 == 0)
+ return true;
+ }
+}
+
+bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const wchar_t *s2) throw()
+{
+ for (;;)
+ {
+ wchar_t c1 = *s1++;
+ wchar_t c2 = *s2++;
+ if (c1 != c2 && MyCharLower_Ascii(c1) != MyCharLower_Ascii(c2))
+ return false;
+ if (c1 == 0)
+ return true;
+ }
+}
+
+bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const char *s2) throw()
+{
+ for (;;)
+ {
+ wchar_t c1 = *s1++;
+ char c2 = *s2++;
+ if (c1 != (unsigned char)c2 && (c1 > 0x7F || MyCharLower_Ascii(c1) != (unsigned char)MyCharLower_Ascii(c2)))
+ return false;
+ if (c1 == 0)
+ return true;
+ }
+}
+
+bool IsString1PrefixedByString2(const wchar_t *s1, const wchar_t *s2) throw()
+{
+ for (;;)
+ {
+ wchar_t c2 = *s2++; if (c2 == 0) return true;
+ wchar_t c1 = *s1++; if (c1 != c2) return false;
+ }
+}
+
+bool IsString1PrefixedByString2(const wchar_t *s1, const char *s2) throw()
+{
+ for (;;)
+ {
+ unsigned char c2 = (unsigned char)(*s2++); if (c2 == 0) return true;
+ wchar_t c1 = *s1++; if (c1 != c2) return false;
+ }
+}
+
+bool IsString1PrefixedByString2_NoCase_Ascii(const wchar_t *s1, const char *s2) throw()
+{
+ for (;;)
+ {
+ char c2 = *s2++; if (c2 == 0) return true;
+ wchar_t c1 = *s1++;
+ if (c1 != (unsigned char)c2 && MyCharLower_Ascii(c1) != (unsigned char)MyCharLower_Ascii(c2))
+ return false;
+ }
+}
+
+bool IsString1PrefixedByString2_NoCase(const wchar_t *s1, const wchar_t *s2) throw()
+{
+ for (;;)
+ {
+ wchar_t c2 = *s2++; if (c2 == 0) return true;
+ wchar_t c1 = *s1++;
+ if (c1 != c2 && MyCharUpper(c1) != MyCharUpper(c2))
+ return false;
+ }
+}
+
+// NTFS order: uses upper case
+int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2) throw()
+{
+ for (;;)
+ {
+ wchar_t c1 = *s1++;
+ wchar_t c2 = *s2++;
+ if (c1 != c2)
+ {
+ wchar_t u1 = MyCharUpper(c1);
+ wchar_t u2 = MyCharUpper(c2);
+ if (u1 < u2) return -1;
+ if (u1 > u2) return 1;
+ }
+ if (c1 == 0) return 0;
+ }
+}
+
+/*
+int MyStringCompareNoCase_N(const wchar_t *s1, const wchar_t *s2, unsigned num)
+{
+ for (; num != 0; num--)
+ {
+ wchar_t c1 = *s1++;
+ wchar_t c2 = *s2++;
+ if (c1 != c2)
+ {
+ wchar_t u1 = MyCharUpper(c1);
+ wchar_t u2 = MyCharUpper(c2);
+ if (u1 < u2) return -1;
+ if (u1 > u2) return 1;
+ }
+ if (c1 == 0) return 0;
+ }
+ return 0;
+}
+*/
+
+// ---------- AString ----------
+
+void AString::InsertSpace(unsigned &index, unsigned size)
+{
+ Grow(size);
+ MoveItems(index + size, index);
+}
+
+#define k_Alloc_Len_Limit 0x40000000
+
+void AString::ReAlloc(unsigned newLimit)
+{
+ if (newLimit < _len || newLimit >= k_Alloc_Len_Limit) throw 20130220;
+ // MY_STRING_REALLOC(_chars, char, newLimit + 1, _len + 1);
+ char *newBuf = MY_STRING_NEW_char(newLimit + 1);
+ memcpy(newBuf, _chars, (size_t)(_len + 1));
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = newLimit;
+}
+
+void AString::ReAlloc2(unsigned newLimit)
+{
+ if (newLimit >= k_Alloc_Len_Limit) throw 20130220;
+ // MY_STRING_REALLOC(_chars, char, newLimit + 1, 0);
+ char *newBuf = MY_STRING_NEW_char(newLimit + 1);
+ newBuf[0] = 0;
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = newLimit;
+}
+
+void AString::SetStartLen(unsigned len)
+{
+ _chars = 0;
+ _chars = MY_STRING_NEW_char(len + 1);
+ _len = len;
+ _limit = len;
+}
+
+void AString::Grow_1()
+{
+ unsigned next = _len;
+ next += next / 2;
+ next += 16;
+ next &= ~(unsigned)15;
+ ReAlloc(next - 1);
+}
+
+void AString::Grow(unsigned n)
+{
+ unsigned freeSize = _limit - _len;
+ if (n <= freeSize)
+ return;
+
+ unsigned next = _len + n;
+ next += next / 2;
+ next += 16;
+ next &= ~(unsigned)15;
+ ReAlloc(next - 1);
+}
+
+AString::AString(unsigned num, const char *s)
+{
+ unsigned len = MyStringLen(s);
+ if (num > len)
+ num = len;
+ SetStartLen(num);
+ memcpy(_chars, s, num);
+ _chars[num] = 0;
+}
+
+AString::AString(unsigned num, const AString &s)
+{
+ if (num > s._len)
+ num = s._len;
+ SetStartLen(num);
+ memcpy(_chars, s._chars, num);
+ _chars[num] = 0;
+}
+
+AString::AString(const AString &s, char c)
+{
+ SetStartLen(s.Len() + 1);
+ char *chars = _chars;
+ unsigned len = s.Len();
+ memcpy(chars, s, len);
+ chars[len] = c;
+ chars[(size_t)len + 1] = 0;
+}
+
+AString::AString(const char *s1, unsigned num1, const char *s2, unsigned num2)
+{
+ SetStartLen(num1 + num2);
+ char *chars = _chars;
+ memcpy(chars, s1, num1);
+ memcpy(chars + num1, s2, num2 + 1);
+}
+
+AString operator+(const AString &s1, const AString &s2) { return AString(s1, s1.Len(), s2, s2.Len()); }
+AString operator+(const AString &s1, const char *s2) { return AString(s1, s1.Len(), s2, MyStringLen(s2)); }
+AString operator+(const char *s1, const AString &s2) { return AString(s1, MyStringLen(s1), s2, s2.Len()); }
+
+static const unsigned kStartStringCapacity = 4;
+
+AString::AString()
+{
+ _chars = 0;
+ _chars = MY_STRING_NEW_char(kStartStringCapacity);
+ _len = 0;
+ _limit = kStartStringCapacity - 1;
+ _chars[0] = 0;
+}
+
+AString::AString(char c)
+{
+ SetStartLen(1);
+ char *chars = _chars;
+ chars[0] = c;
+ chars[1] = 0;
+}
+
+AString::AString(const char *s)
+{
+ SetStartLen(MyStringLen(s));
+ MyStringCopy(_chars, s);
+}
+
+AString::AString(const AString &s)
+{
+ SetStartLen(s._len);
+ MyStringCopy(_chars, s._chars);
+}
+
+AString &AString::operator=(char c)
+{
+ if (1 > _limit)
+ {
+ char *newBuf = MY_STRING_NEW_char(1 + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = 1;
+ }
+ _len = 1;
+ char *chars = _chars;
+ chars[0] = c;
+ chars[1] = 0;
+ return *this;
+}
+
+AString &AString::operator=(const char *s)
+{
+ unsigned len = MyStringLen(s);
+ if (len > _limit)
+ {
+ char *newBuf = MY_STRING_NEW_char(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ MyStringCopy(_chars, s);
+ return *this;
+}
+
+AString &AString::operator=(const AString &s)
+{
+ if (&s == this)
+ return *this;
+ unsigned len = s._len;
+ if (len > _limit)
+ {
+ char *newBuf = MY_STRING_NEW_char(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ MyStringCopy(_chars, s._chars);
+ return *this;
+}
+
+void AString::SetFromWStr_if_Ascii(const wchar_t *s)
+{
+ unsigned len = 0;
+ {
+ for (;; len++)
+ {
+ wchar_t c = s[len];
+ if (c == 0)
+ break;
+ if (c >= 0x80)
+ return;
+ }
+ }
+ if (len > _limit)
+ {
+ char *newBuf = MY_STRING_NEW_char(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ char *dest = _chars;
+ unsigned i;
+ for (i = 0; i < len; i++)
+ dest[i] = (char)s[i];
+ dest[i] = 0;
+}
+
+/*
+void AString::SetFromBstr_if_Ascii(BSTR s)
+{
+ unsigned len = ::SysStringLen(s);
+ {
+ for (unsigned i = 0; i < len; i++)
+ if (s[i] <= 0 || s[i] >= 0x80)
+ return;
+ }
+ if (len > _limit)
+ {
+ char *newBuf = MY_STRING_NEW_char(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ char *dest = _chars;
+ unsigned i;
+ for (i = 0; i < len; i++)
+ dest[i] = (char)s[i];
+ dest[i] = 0;
+}
+*/
+
+void AString::Add_Space() { operator+=(' '); }
+void AString::Add_Space_if_NotEmpty() { if (!IsEmpty()) Add_Space(); }
+void AString::Add_LF() { operator+=('\n'); }
+
+AString &AString::operator+=(const char *s)
+{
+ unsigned len = MyStringLen(s);
+ Grow(len);
+ MyStringCopy(_chars + _len, s);
+ _len += len;
+ return *this;
+}
+
+void AString::Add_OptSpaced(const char *s)
+{
+ Add_Space_if_NotEmpty();
+ (*this) += s;
+}
+
+AString &AString::operator+=(const AString &s)
+{
+ Grow(s._len);
+ MyStringCopy(_chars + _len, s._chars);
+ _len += s._len;
+ return *this;
+}
+
+void AString::Add_UInt32(UInt32 v)
+{
+ char sz[16];
+ ConvertUInt32ToString(v, sz);
+ (*this) += sz;
+}
+
+void AString::SetFrom(const char *s, unsigned len) // no check
+{
+ if (len > _limit)
+ {
+ char *newBuf = MY_STRING_NEW_char(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ if (len != 0)
+ memcpy(_chars, s, len);
+ _chars[len] = 0;
+ _len = len;
+}
+
+void AString::SetFrom_CalcLen(const char *s, unsigned len) // no check
+{
+ unsigned i;
+ for (i = 0; i < len; i++)
+ if (s[i] == 0)
+ break;
+ SetFrom(s, i);
+}
+
+int AString::Find(const char *s, unsigned startIndex) const throw()
+{
+ const char *fs = strstr(_chars + startIndex, s);
+ if (!fs)
+ return -1;
+ return (int)(fs - _chars);
+
+ /*
+ if (s[0] == 0)
+ return startIndex;
+ unsigned len = MyStringLen(s);
+ const char *p = _chars + startIndex;
+ for (;; p++)
+ {
+ const char c = *p;
+ if (c != s[0])
+ {
+ if (c == 0)
+ return -1;
+ continue;
+ }
+ unsigned i;
+ for (i = 1; i < len; i++)
+ if (p[i] != s[i])
+ break;
+ if (i == len)
+ return (int)(p - _chars);
+ }
+ */
+}
+
+int AString::ReverseFind(char c) const throw()
+{
+ if (_len == 0)
+ return -1;
+ const char *p = _chars + _len - 1;
+ for (;;)
+ {
+ if (*p == c)
+ return (int)(p - _chars);
+ if (p == _chars)
+ return -1;
+ p--; // p = GetPrevCharPointer(_chars, p);
+ }
+}
+
+int AString::ReverseFind_PathSepar() const throw()
+{
+ if (_len == 0)
+ return -1;
+ const char *p = _chars + _len - 1;
+ for (;;)
+ {
+ char c = *p;
+ if (IS_PATH_SEPAR(c))
+ return (int)(p - _chars);
+ if (p == _chars)
+ return -1;
+ p--;
+ }
+}
+
+void AString::TrimLeft() throw()
+{
+ const char *p = _chars;
+ for (;; p++)
+ {
+ char c = *p;
+ if (c != ' ' && c != '\n' && c != '\t')
+ break;
+ }
+ unsigned pos = (unsigned)(p - _chars);
+ if (pos != 0)
+ {
+ MoveItems(0, pos);
+ _len -= pos;
+ }
+}
+
+void AString::TrimRight() throw()
+{
+ const char *p = _chars;
+ unsigned i;
+ for (i = _len; i != 0; i--)
+ {
+ char c = p[(size_t)i - 1];
+ if (c != ' ' && c != '\n' && c != '\t')
+ break;
+ }
+ if (i != _len)
+ {
+ _chars[i] = 0;
+ _len = i;
+ }
+}
+
+void AString::InsertAtFront(char c)
+{
+ if (_limit == _len)
+ Grow_1();
+ MoveItems(1, 0);
+ _chars[0] = c;
+ _len++;
+}
+
+/*
+void AString::Insert(unsigned index, char c)
+{
+ InsertSpace(index, 1);
+ _chars[index] = c;
+ _len++;
+}
+*/
+
+void AString::Insert(unsigned index, const char *s)
+{
+ unsigned num = MyStringLen(s);
+ if (num != 0)
+ {
+ InsertSpace(index, num);
+ memcpy(_chars + index, s, num);
+ _len += num;
+ }
+}
+
+void AString::Insert(unsigned index, const AString &s)
+{
+ unsigned num = s.Len();
+ if (num != 0)
+ {
+ InsertSpace(index, num);
+ memcpy(_chars + index, s, num);
+ _len += num;
+ }
+}
+
+void AString::RemoveChar(char ch) throw()
+{
+ char *src = _chars;
+
+ for (;;)
+ {
+ char c = *src++;
+ if (c == 0)
+ return;
+ if (c == ch)
+ break;
+ }
+
+ char *dest = src - 1;
+
+ for (;;)
+ {
+ char c = *src++;
+ if (c == 0)
+ break;
+ if (c != ch)
+ *dest++ = c;
+ }
+
+ *dest = 0;
+ _len = (unsigned)(dest - _chars);
+}
+
+// !!!!!!!!!!!!!!! test it if newChar = '\0'
+void AString::Replace(char oldChar, char newChar) throw()
+{
+ if (oldChar == newChar)
+ return; // 0;
+ // unsigned number = 0;
+ int pos = 0;
+ char *chars = _chars;
+ while ((unsigned)pos < _len)
+ {
+ pos = Find(oldChar, pos);
+ if (pos < 0)
+ break;
+ chars[(unsigned)pos] = newChar;
+ pos++;
+ // number++;
+ }
+ return; // number;
+}
+
+void AString::Replace(const AString &oldString, const AString &newString)
+{
+ if (oldString.IsEmpty())
+ return; // 0;
+ if (oldString == newString)
+ return; // 0;
+ unsigned oldLen = oldString.Len();
+ unsigned newLen = newString.Len();
+ // unsigned number = 0;
+ int pos = 0;
+ while ((unsigned)pos < _len)
+ {
+ pos = Find(oldString, pos);
+ if (pos < 0)
+ break;
+ Delete(pos, oldLen);
+ Insert(pos, newString);
+ pos += newLen;
+ // number++;
+ }
+ // return number;
+}
+
+void AString::Delete(unsigned index) throw()
+{
+ MoveItems(index, index + 1);
+ _len--;
+}
+
+void AString::Delete(unsigned index, unsigned count) throw()
+{
+ if (index + count > _len)
+ count = _len - index;
+ if (count > 0)
+ {
+ MoveItems(index, index + count);
+ _len -= count;
+ }
+}
+
+void AString::DeleteFrontal(unsigned num) throw()
+{
+ if (num != 0)
+ {
+ MoveItems(0, num);
+ _len -= num;
+ }
+}
+
+/*
+AString operator+(const AString &s1, const AString &s2)
+{
+ AString result(s1);
+ result += s2;
+ return result;
+}
+
+AString operator+(const AString &s, const char *chars)
+{
+ AString result(s);
+ result += chars;
+ return result;
+}
+
+AString operator+(const char *chars, const AString &s)
+{
+ AString result(chars);
+ result += s;
+ return result;
+}
+
+AString operator+(const AString &s, char c)
+{
+ AString result(s);
+ result += c;
+ return result;
+}
+*/
+
+/*
+AString operator+(char c, const AString &s)
+{
+ AString result(c);
+ result += s;
+ return result;
+}
+*/
+
+
+
+
+// ---------- UString ----------
+
+void UString::InsertSpace(unsigned index, unsigned size)
+{
+ Grow(size);
+ MoveItems(index + size, index);
+}
+
+void UString::ReAlloc(unsigned newLimit)
+{
+ if (newLimit < _len || newLimit >= k_Alloc_Len_Limit) throw 20130221;
+ // MY_STRING_REALLOC(_chars, wchar_t, newLimit + 1, _len + 1);
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(newLimit + 1);
+ wmemcpy(newBuf, _chars, _len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = newLimit;
+}
+
+void UString::ReAlloc2(unsigned newLimit)
+{
+ if (newLimit >= k_Alloc_Len_Limit) throw 20130221;
+ // MY_STRING_REALLOC(_chars, wchar_t, newLimit + 1, 0);
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(newLimit + 1);
+ newBuf[0] = 0;
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = newLimit;
+}
+
+void UString::SetStartLen(unsigned len)
+{
+ _chars = 0;
+ _chars = MY_STRING_NEW_wchar_t(len + 1);
+ _len = len;
+ _limit = len;
+}
+
+void UString::Grow_1()
+{
+ unsigned next = _len;
+ next += next / 2;
+ next += 16;
+ next &= ~(unsigned)15;
+ ReAlloc(next - 1);
+}
+
+void UString::Grow(unsigned n)
+{
+ unsigned freeSize = _limit - _len;
+ if (n <= freeSize)
+ return;
+
+ unsigned next = _len + n;
+ next += next / 2;
+ next += 16;
+ next &= ~(unsigned)15;
+ ReAlloc(next - 1);
+}
+
+
+UString::UString(unsigned num, const wchar_t *s)
+{
+ unsigned len = MyStringLen(s);
+ if (num > len)
+ num = len;
+ SetStartLen(num);
+ wmemcpy(_chars, s, num);
+ _chars[num] = 0;
+}
+
+
+UString::UString(unsigned num, const UString &s)
+{
+ if (num > s._len)
+ num = s._len;
+ SetStartLen(num);
+ wmemcpy(_chars, s._chars, num);
+ _chars[num] = 0;
+}
+
+UString::UString(const UString &s, wchar_t c)
+{
+ SetStartLen(s.Len() + 1);
+ wchar_t *chars = _chars;
+ unsigned len = s.Len();
+ wmemcpy(chars, s, len);
+ chars[len] = c;
+ chars[(size_t)len + 1] = 0;
+}
+
+UString::UString(const wchar_t *s1, unsigned num1, const wchar_t *s2, unsigned num2)
+{
+ SetStartLen(num1 + num2);
+ wchar_t *chars = _chars;
+ wmemcpy(chars, s1, num1);
+ wmemcpy(chars + num1, s2, num2 + 1);
+}
+
+UString operator+(const UString &s1, const UString &s2) { return UString(s1, s1.Len(), s2, s2.Len()); }
+UString operator+(const UString &s1, const wchar_t *s2) { return UString(s1, s1.Len(), s2, MyStringLen(s2)); }
+UString operator+(const wchar_t *s1, const UString &s2) { return UString(s1, MyStringLen(s1), s2, s2.Len()); }
+
+UString::UString()
+{
+ _chars = 0;
+ _chars = MY_STRING_NEW_wchar_t(kStartStringCapacity);
+ _len = 0;
+ _limit = kStartStringCapacity - 1;
+ _chars[0] = 0;
+}
+
+UString::UString(wchar_t c)
+{
+ SetStartLen(1);
+ wchar_t *chars = _chars;
+ chars[0] = c;
+ chars[1] = 0;
+}
+
+UString::UString(char c)
+{
+ SetStartLen(1);
+ wchar_t *chars = _chars;
+ chars[0] = (unsigned char)c;
+ chars[1] = 0;
+}
+
+UString::UString(const wchar_t *s)
+{
+ unsigned len = MyStringLen(s);
+ SetStartLen(len);
+ wmemcpy(_chars, s, len + 1);
+}
+
+UString::UString(const char *s)
+{
+ unsigned len = MyStringLen(s);
+ SetStartLen(len);
+ wchar_t *chars = _chars;
+ for (unsigned i = 0; i < len; i++)
+ chars[i] = (unsigned char)s[i];
+ chars[len] = 0;
+}
+
+UString::UString(const UString &s)
+{
+ SetStartLen(s._len);
+ wmemcpy(_chars, s._chars, s._len + 1);
+}
+
+UString &UString::operator=(wchar_t c)
+{
+ if (1 > _limit)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(1 + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = 1;
+ }
+ _len = 1;
+ wchar_t *chars = _chars;
+ chars[0] = c;
+ chars[1] = 0;
+ return *this;
+}
+
+UString &UString::operator=(const wchar_t *s)
+{
+ unsigned len = MyStringLen(s);
+ if (len > _limit)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ wmemcpy(_chars, s, len + 1);
+ return *this;
+}
+
+UString &UString::operator=(const UString &s)
+{
+ if (&s == this)
+ return *this;
+ unsigned len = s._len;
+ if (len > _limit)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ wmemcpy(_chars, s._chars, len + 1);
+ return *this;
+}
+
+void UString::SetFrom(const wchar_t *s, unsigned len) // no check
+{
+ if (len > _limit)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ if (len != 0)
+ wmemcpy(_chars, s, len);
+ _chars[len] = 0;
+ _len = len;
+}
+
+void UString::SetFromBstr(BSTR s)
+{
+ unsigned len = ::SysStringLen(s);
+ if (len > _limit)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ _len = len;
+ // if (s)
+ wmemcpy(_chars, s, len + 1);
+}
+
+UString &UString::operator=(const char *s)
+{
+ unsigned len = MyStringLen(s);
+ if (len > _limit)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ _limit = len;
+ }
+ wchar_t *chars = _chars;
+ for (unsigned i = 0; i < len; i++)
+ chars[i] = (unsigned char)s[i];
+ chars[len] = 0;
+ _len = len;
+ return *this;
+}
+
+void UString::Add_Space() { operator+=(L' '); }
+void UString::Add_Space_if_NotEmpty() { if (!IsEmpty()) Add_Space(); }
+
+void UString::Add_LF()
+{
+ if (_limit == _len)
+ Grow_1();
+ unsigned len = _len;
+ wchar_t *chars = _chars;
+ chars[len++] = L'\n';
+ chars[len] = 0;
+ _len = len;
+}
+
+UString &UString::operator+=(const wchar_t *s)
+{
+ unsigned len = MyStringLen(s);
+ Grow(len);
+ wmemcpy(_chars + _len, s, len + 1);
+ _len += len;
+ return *this;
+}
+
+UString &UString::operator+=(const UString &s)
+{
+ Grow(s._len);
+ wmemcpy(_chars + _len, s._chars, s._len + 1);
+ _len += s._len;
+ return *this;
+}
+
+UString &UString::operator+=(const char *s)
+{
+ unsigned len = MyStringLen(s);
+ Grow(len);
+ wchar_t *chars = _chars + _len;
+ for (unsigned i = 0; i < len; i++)
+ chars[i] = (unsigned char)s[i];
+ chars[len] = 0;
+ _len += len;
+ return *this;
+}
+
+
+void UString::Add_UInt32(UInt32 v)
+{
+ char sz[16];
+ ConvertUInt32ToString(v, sz);
+ (*this) += sz;
+}
+
+
+int UString::Find(const wchar_t *s, unsigned startIndex) const throw()
+{
+ const wchar_t *fs = wcsstr(_chars + startIndex, s);
+ if (!fs)
+ return -1;
+ return (int)(fs - _chars);
+
+ /*
+ if (s[0] == 0)
+ return startIndex;
+ unsigned len = MyStringLen(s);
+ const wchar_t *p = _chars + startIndex;
+ for (;; p++)
+ {
+ const wchar_t c = *p;
+ if (c != s[0])
+ {
+ if (c == 0)
+ return -1;
+ continue;
+ }
+ unsigned i;
+ for (i = 1; i < len; i++)
+ if (p[i] != s[i])
+ break;
+ if (i == len)
+ return (int)(p - _chars);
+ }
+ */
+}
+
+int UString::ReverseFind(wchar_t c) const throw()
+{
+ if (_len == 0)
+ return -1;
+ const wchar_t *p = _chars + _len - 1;
+ for (;;)
+ {
+ if (*p == c)
+ return (int)(p - _chars);
+ if (p == _chars)
+ return -1;
+ p--;
+ }
+}
+
+int UString::ReverseFind_PathSepar() const throw()
+{
+ if (_len == 0)
+ return -1;
+ const wchar_t *p = _chars + _len - 1;
+ for (;;)
+ {
+ wchar_t c = *p;
+ if (IS_PATH_SEPAR(c))
+ return (int)(p - _chars);
+ if (p == _chars)
+ return -1;
+ p--;
+ }
+}
+
+void UString::TrimLeft() throw()
+{
+ const wchar_t *p = _chars;
+ for (;; p++)
+ {
+ wchar_t c = *p;
+ if (c != ' ' && c != '\n' && c != '\t')
+ break;
+ }
+ unsigned pos = (unsigned)(p - _chars);
+ if (pos != 0)
+ {
+ MoveItems(0, pos);
+ _len -= pos;
+ }
+}
+
+void UString::TrimRight() throw()
+{
+ const wchar_t *p = _chars;
+ unsigned i;
+ for (i = _len; i != 0; i--)
+ {
+ wchar_t c = p[(size_t)i - 1];
+ if (c != ' ' && c != '\n' && c != '\t')
+ break;
+ }
+ if (i != _len)
+ {
+ _chars[i] = 0;
+ _len = i;
+ }
+}
+
+void UString::InsertAtFront(wchar_t c)
+{
+ if (_limit == _len)
+ Grow_1();
+ MoveItems(1, 0);
+ _chars[0] = c;
+ _len++;
+}
+
+/*
+void UString::Insert(unsigned index, wchar_t c)
+{
+ InsertSpace(index, 1);
+ _chars[index] = c;
+ _len++;
+}
+*/
+
+void UString::Insert(unsigned index, const wchar_t *s)
+{
+ unsigned num = MyStringLen(s);
+ if (num != 0)
+ {
+ InsertSpace(index, num);
+ wmemcpy(_chars + index, s, num);
+ _len += num;
+ }
+}
+
+void UString::Insert(unsigned index, const UString &s)
+{
+ unsigned num = s.Len();
+ if (num != 0)
+ {
+ InsertSpace(index, num);
+ wmemcpy(_chars + index, s, num);
+ _len += num;
+ }
+}
+
+void UString::RemoveChar(wchar_t ch) throw()
+{
+ wchar_t *src = _chars;
+
+ for (;;)
+ {
+ wchar_t c = *src++;
+ if (c == 0)
+ return;
+ if (c == ch)
+ break;
+ }
+
+ wchar_t *dest = src - 1;
+
+ for (;;)
+ {
+ wchar_t c = *src++;
+ if (c == 0)
+ break;
+ if (c != ch)
+ *dest++ = c;
+ }
+
+ *dest = 0;
+ _len = (unsigned)(dest - _chars);
+}
+
+// !!!!!!!!!!!!!!! test it if newChar = '\0'
+void UString::Replace(wchar_t oldChar, wchar_t newChar) throw()
+{
+ if (oldChar == newChar)
+ return; // 0;
+ // unsigned number = 0;
+ int pos = 0;
+ wchar_t *chars = _chars;
+ while ((unsigned)pos < _len)
+ {
+ pos = Find(oldChar, pos);
+ if (pos < 0)
+ break;
+ chars[(unsigned)pos] = newChar;
+ pos++;
+ // number++;
+ }
+ return; // number;
+}
+
+void UString::Replace(const UString &oldString, const UString &newString)
+{
+ if (oldString.IsEmpty())
+ return; // 0;
+ if (oldString == newString)
+ return; // 0;
+ unsigned oldLen = oldString.Len();
+ unsigned newLen = newString.Len();
+ // unsigned number = 0;
+ int pos = 0;
+ while ((unsigned)pos < _len)
+ {
+ pos = Find(oldString, pos);
+ if (pos < 0)
+ break;
+ Delete(pos, oldLen);
+ Insert(pos, newString);
+ pos += newLen;
+ // number++;
+ }
+ // return number;
+}
+
+void UString::Delete(unsigned index) throw()
+{
+ MoveItems(index, index + 1);
+ _len--;
+}
+
+void UString::Delete(unsigned index, unsigned count) throw()
+{
+ if (index + count > _len)
+ count = _len - index;
+ if (count > 0)
+ {
+ MoveItems(index, index + count);
+ _len -= count;
+ }
+}
+
+void UString::DeleteFrontal(unsigned num) throw()
+{
+ if (num != 0)
+ {
+ MoveItems(0, num);
+ _len -= num;
+ }
+}
+
+
+// ---------- UString2 ----------
+
+void UString2::ReAlloc2(unsigned newLimit)
+{
+ if (newLimit >= k_Alloc_Len_Limit) throw 20130221;
+ // MY_STRING_REALLOC(_chars, wchar_t, newLimit + 1, 0);
+ _chars = MY_STRING_NEW_wchar_t(newLimit + 1);
+}
+
+void UString2::SetStartLen(unsigned len)
+{
+ _chars = 0;
+ _chars = MY_STRING_NEW_wchar_t(len + 1);
+ _len = len;
+}
+
+
+/*
+UString2::UString2(wchar_t c)
+{
+ SetStartLen(1);
+ wchar_t *chars = _chars;
+ chars[0] = c;
+ chars[1] = 0;
+}
+*/
+
+UString2::UString2(const wchar_t *s)
+{
+ unsigned len = MyStringLen(s);
+ SetStartLen(len);
+ wmemcpy(_chars, s, len + 1);
+}
+
+UString2::UString2(const UString2 &s): _chars(NULL), _len(0)
+{
+ if (s._chars)
+ {
+ SetStartLen(s._len);
+ wmemcpy(_chars, s._chars, s._len + 1);
+ }
+}
+
+/*
+UString2 &UString2::operator=(wchar_t c)
+{
+ if (1 > _len)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(1 + 1);
+ if (_chars)
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ }
+ _len = 1;
+ wchar_t *chars = _chars;
+ chars[0] = c;
+ chars[1] = 0;
+ return *this;
+}
+*/
+
+UString2 &UString2::operator=(const wchar_t *s)
+{
+ unsigned len = MyStringLen(s);
+ if (len > _len)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ if (_chars)
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ }
+ _len = len;
+ MyStringCopy(_chars, s);
+ return *this;
+}
+
+void UString2::SetFromAscii(const char *s)
+{
+ unsigned len = MyStringLen(s);
+ if (len > _len)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ if (_chars)
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ }
+ wchar_t *chars = _chars;
+ for (unsigned i = 0; i < len; i++)
+ chars[i] = (unsigned char)s[i];
+ chars[len] = 0;
+ _len = len;
+}
+
+UString2 &UString2::operator=(const UString2 &s)
+{
+ if (&s == this)
+ return *this;
+ unsigned len = s._len;
+ if (len > _len)
+ {
+ wchar_t *newBuf = MY_STRING_NEW_wchar_t(len + 1);
+ if (_chars)
+ MY_STRING_DELETE(_chars);
+ _chars = newBuf;
+ }
+ _len = len;
+ MyStringCopy(_chars, s._chars);
+ return *this;
+}
+
+bool operator==(const UString2 &s1, const UString2 &s2)
+{
+ return s1.Len() == s2.Len() && (s1.IsEmpty() || wcscmp(s1.GetRawPtr(), s2.GetRawPtr()) == 0);
+}
+
+bool operator==(const UString2 &s1, const wchar_t *s2)
+{
+ if (s1.IsEmpty())
+ return (*s2 == 0);
+ return wcscmp(s1.GetRawPtr(), s2) == 0;
+}
+
+bool operator==(const wchar_t *s1, const UString2 &s2)
+{
+ if (s2.IsEmpty())
+ return (*s1 == 0);
+ return wcscmp(s1, s2.GetRawPtr()) == 0;
+}
+
+
+
+// ----------------------------------------
+
+/*
+int MyStringCompareNoCase(const char *s1, const char *s2)
+{
+ return MyStringCompareNoCase(MultiByteToUnicodeString(s1), MultiByteToUnicodeString(s2));
+}
+*/
+
+static inline UINT GetCurrentCodePage()
+{
+ #if defined(UNDER_CE) || !defined(_WIN32)
+ return CP_ACP;
+ #else
+ return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP;
+ #endif
+}
+
+#ifdef USE_UNICODE_FSTRING
+
+#ifndef _UNICODE
+
+AString fs2fas(CFSTR s)
+{
+ return UnicodeStringToMultiByte(s, GetCurrentCodePage());
+}
+
+FString fas2fs(const char *s)
+{
+ return MultiByteToUnicodeString(s, GetCurrentCodePage());
+}
+
+FString fas2fs(const AString &s)
+{
+ return MultiByteToUnicodeString(s, GetCurrentCodePage());
+}
+
+#endif
+
+#else
+
+UString fs2us(const FChar *s)
+{
+ return MultiByteToUnicodeString(s, GetCurrentCodePage());
+}
+
+UString fs2us(const FString &s)
+{
+ return MultiByteToUnicodeString(s, GetCurrentCodePage());
+}
+
+FString us2fs(const wchar_t *s)
+{
+ return UnicodeStringToMultiByte(s, GetCurrentCodePage());
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyString.h b/other-licenses/7zstub/src/CPP/Common/MyString.h
new file mode 100644
index 0000000000..f484ad225f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyString.h
@@ -0,0 +1,867 @@
+// Common/String.h
+
+#ifndef __COMMON_STRING_H
+#define __COMMON_STRING_H
+
+#include <string.h>
+
+#ifndef _WIN32
+#include <wctype.h>
+#include <wchar.h>
+#endif
+
+#include "MyWindows.h"
+#include "MyTypes.h"
+#include "MyVector.h"
+
+
+#ifdef _MSC_VER
+ #ifdef _NATIVE_WCHAR_T_DEFINED
+ #define MY_NATIVE_WCHAR_T_DEFINED
+ #endif
+#else
+ #define MY_NATIVE_WCHAR_T_DEFINED
+#endif
+
+/*
+ native support for wchar_t:
+ _MSC_VER == 1600 : /Zc:wchar_t is not supported
+ _MSC_VER == 1310 (VS2003)
+ ? _MSC_VER == 1400 (VS2005) : wchar_t <- unsigned short
+ /Zc:wchar_t : wchar_t <- __wchar_t, _WCHAR_T_DEFINED and _NATIVE_WCHAR_T_DEFINED
+ _MSC_VER > 1400 (VS2008+)
+ /Zc:wchar_t[-]
+ /Zc:wchar_t is on by default
+*/
+
+#ifdef _WIN32
+#define IS_PATH_SEPAR(c) ((c) == '\\' || (c) == '/')
+#else
+#define IS_PATH_SEPAR(c) ((c) == CHAR_PATH_SEPARATOR)
+#endif
+
+inline bool IsPathSepar(char c) { return IS_PATH_SEPAR(c); }
+inline bool IsPathSepar(wchar_t c) { return IS_PATH_SEPAR(c); }
+
+inline unsigned MyStringLen(const char *s)
+{
+ unsigned i;
+ for (i = 0; s[i] != 0; i++);
+ return i;
+}
+
+inline void MyStringCopy(char *dest, const char *src)
+{
+ while ((*dest++ = *src++) != 0);
+}
+
+inline char *MyStpCpy(char *dest, const char *src)
+{
+ for (;;)
+ {
+ char c = *src;
+ *dest = c;
+ if (c == 0)
+ return dest;
+ src++;
+ dest++;
+ }
+}
+
+inline unsigned MyStringLen(const wchar_t *s)
+{
+ unsigned i;
+ for (i = 0; s[i] != 0; i++);
+ return i;
+}
+
+inline void MyStringCopy(wchar_t *dest, const wchar_t *src)
+{
+ while ((*dest++ = *src++) != 0);
+}
+
+inline void MyStringCat(wchar_t *dest, const wchar_t *src)
+{
+ MyStringCopy(dest + MyStringLen(dest), src);
+}
+
+
+/*
+inline wchar_t *MyWcpCpy(wchar_t *dest, const wchar_t *src)
+{
+ for (;;)
+ {
+ wchar_t c = *src;
+ *dest = c;
+ if (c == 0)
+ return dest;
+ src++;
+ dest++;
+ }
+}
+*/
+
+int FindCharPosInString(const char *s, char c) throw();
+int FindCharPosInString(const wchar_t *s, wchar_t c) throw();
+
+#ifdef _WIN32
+ #ifndef _UNICODE
+ #define STRING_UNICODE_THROW
+ #endif
+#endif
+
+#ifndef STRING_UNICODE_THROW
+ #define STRING_UNICODE_THROW throw()
+#endif
+
+
+inline char MyCharUpper_Ascii(char c)
+{
+ if (c >= 'a' && c <= 'z')
+ return (char)((unsigned char)c - 0x20);
+ return c;
+}
+
+/*
+inline wchar_t MyCharUpper_Ascii(wchar_t c)
+{
+ if (c >= 'a' && c <= 'z')
+ return (wchar_t)(c - 0x20);
+ return c;
+}
+*/
+
+inline char MyCharLower_Ascii(char c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return (char)((unsigned char)c + 0x20);
+ return c;
+}
+
+inline wchar_t MyCharLower_Ascii(wchar_t c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return (wchar_t)(c + 0x20);
+ return c;
+}
+
+wchar_t MyCharUpper_WIN(wchar_t c) throw();
+
+inline wchar_t MyCharUpper(wchar_t c) throw()
+{
+ if (c < 'a') return c;
+ if (c <= 'z') return (wchar_t)(c - 0x20);
+ if (c <= 0x7F) return c;
+ #ifdef _WIN32
+ #ifdef _UNICODE
+ return (wchar_t)(unsigned)(UINT_PTR)CharUpperW((LPWSTR)(UINT_PTR)(unsigned)c);
+ #else
+ return (wchar_t)MyCharUpper_WIN(c);
+ #endif
+ #else
+ return (wchar_t)towupper(c);
+ #endif
+}
+
+/*
+wchar_t MyCharLower_WIN(wchar_t c) throw();
+
+inline wchar_t MyCharLower(wchar_t c) throw()
+{
+ if (c < 'A') return c;
+ if (c <= 'Z') return (wchar_t)(c + 0x20);
+ if (c <= 0x7F) return c;
+ #ifdef _WIN32
+ #ifdef _UNICODE
+ return (wchar_t)(unsigned)(UINT_PTR)CharLowerW((LPWSTR)(UINT_PTR)(unsigned)c);
+ #else
+ return (wchar_t)MyCharLower_WIN(c);
+ #endif
+ #else
+ return (wchar_t)tolower(c);
+ #endif
+}
+*/
+
+// char *MyStringUpper(char *s) throw();
+// char *MyStringLower(char *s) throw();
+
+// void MyStringUpper_Ascii(char *s) throw();
+// void MyStringUpper_Ascii(wchar_t *s) throw();
+void MyStringLower_Ascii(char *s) throw();
+void MyStringLower_Ascii(wchar_t *s) throw();
+// wchar_t *MyStringUpper(wchar_t *s) STRING_UNICODE_THROW;
+// wchar_t *MyStringLower(wchar_t *s) STRING_UNICODE_THROW;
+
+bool StringsAreEqualNoCase(const wchar_t *s1, const wchar_t *s2) throw();
+
+bool IsString1PrefixedByString2(const char *s1, const char *s2) throw();
+bool IsString1PrefixedByString2(const wchar_t *s1, const wchar_t *s2) throw();
+bool IsString1PrefixedByString2(const wchar_t *s1, const char *s2) throw();
+bool IsString1PrefixedByString2_NoCase_Ascii(const wchar_t *u, const char *a) throw();
+bool IsString1PrefixedByString2_NoCase(const wchar_t *s1, const wchar_t *s2) throw();
+
+#define MyStringCompare(s1, s2) wcscmp(s1, s2)
+int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2) throw();
+// int MyStringCompareNoCase_N(const wchar_t *s1, const wchar_t *s2, unsigned num) throw();
+
+// ---------- ASCII ----------
+// char values in ASCII strings must be less then 128
+bool StringsAreEqual_Ascii(const wchar_t *u, const char *a) throw();
+bool StringsAreEqualNoCase_Ascii(const char *s1, const char *s2) throw();
+bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const char *s2) throw();
+bool StringsAreEqualNoCase_Ascii(const wchar_t *s1, const wchar_t *s2) throw();
+
+#define MY_STRING_DELETE(_p_) delete []_p_;
+// #define MY_STRING_DELETE(_p_) my_delete(_p_);
+
+
+#define FORBID_STRING_OPS_2(cls, t) \
+ void Find(t) const; \
+ void Find(t, unsigned startIndex) const; \
+ void ReverseFind(t) const; \
+ void InsertAtFront(t); \
+ void RemoveChar(t); \
+ void Replace(t, t); \
+
+#define FORBID_STRING_OPS(cls, t) \
+ explicit cls(t); \
+ explicit cls(const t *); \
+ cls &operator=(t); \
+ cls &operator=(const t *); \
+ cls &operator+=(t); \
+ cls &operator+=(const t *); \
+ FORBID_STRING_OPS_2(cls, t); \
+
+/*
+ cls &operator+(t); \
+ cls &operator+(const t *); \
+*/
+
+#define FORBID_STRING_OPS_AString(t) FORBID_STRING_OPS(AString, t)
+#define FORBID_STRING_OPS_UString(t) FORBID_STRING_OPS(UString, t)
+#define FORBID_STRING_OPS_UString2(t) FORBID_STRING_OPS(UString2, t)
+
+class AString
+{
+ char *_chars;
+ unsigned _len;
+ unsigned _limit;
+
+ void MoveItems(unsigned dest, unsigned src)
+ {
+ memmove(_chars + dest, _chars + src, (size_t)(_len - src + 1) * sizeof(char));
+ }
+
+ void InsertSpace(unsigned &index, unsigned size);
+
+ void ReAlloc(unsigned newLimit);
+ void ReAlloc2(unsigned newLimit);
+ void SetStartLen(unsigned len);
+ void Grow_1();
+ void Grow(unsigned n);
+
+ AString(unsigned num, const char *s);
+ AString(unsigned num, const AString &s);
+ AString(const AString &s, char c); // it's for String + char
+ AString(const char *s1, unsigned num1, const char *s2, unsigned num2);
+
+ friend AString operator+(const AString &s, char c) { return AString(s, c); } ;
+ // friend AString operator+(char c, const AString &s); // is not supported
+
+ friend AString operator+(const AString &s1, const AString &s2);
+ friend AString operator+(const AString &s1, const char *s2);
+ friend AString operator+(const char *s1, const AString &s2);
+
+ // ---------- forbidden functions ----------
+
+ #ifdef MY_NATIVE_WCHAR_T_DEFINED
+ FORBID_STRING_OPS_AString(wchar_t)
+ #endif
+
+ FORBID_STRING_OPS_AString(signed char)
+ FORBID_STRING_OPS_AString(unsigned char)
+ FORBID_STRING_OPS_AString(short)
+ FORBID_STRING_OPS_AString(unsigned short)
+ FORBID_STRING_OPS_AString(int)
+ FORBID_STRING_OPS_AString(unsigned)
+ FORBID_STRING_OPS_AString(long)
+ FORBID_STRING_OPS_AString(unsigned long)
+
+public:
+ explicit AString();
+ explicit AString(char c);
+ explicit AString(const char *s);
+ AString(const AString &s);
+ ~AString() { MY_STRING_DELETE(_chars); }
+
+ unsigned Len() const { return _len; }
+ bool IsEmpty() const { return _len == 0; }
+ void Empty() { _len = 0; _chars[0] = 0; }
+
+ operator const char *() const { return _chars; }
+ const char *Ptr() const { return _chars; }
+ const char *Ptr(unsigned pos) const { return _chars + pos; }
+ const char *RightPtr(unsigned num) const { return _chars + _len - num; }
+ char Back() const { return _chars[(size_t)_len - 1]; }
+
+ void ReplaceOneCharAtPos(unsigned pos, char c) { _chars[pos] = c; }
+
+ /* GetBuf(minLen): provides the buffer that can store
+ at least (minLen) characters and additional null terminator.
+ 9.35: GetBuf doesn't preserve old characters and terminator */
+ char *GetBuf(unsigned minLen)
+ {
+ if (minLen > _limit)
+ ReAlloc2(minLen);
+ return _chars;
+ }
+ char *GetBuf_SetEnd(unsigned minLen)
+ {
+ if (minLen > _limit)
+ ReAlloc2(minLen);
+ char *chars = _chars;
+ chars[minLen] = 0;
+ _len = minLen;
+ return chars;
+ }
+
+ void ReleaseBuf_SetLen(unsigned newLen) { _len = newLen; }
+ void ReleaseBuf_SetEnd(unsigned newLen) { _len = newLen; _chars[newLen] = 0; }
+ void ReleaseBuf_CalcLen(unsigned maxLen)
+ {
+ char *chars = _chars;
+ chars[maxLen] = 0;
+ _len = MyStringLen(chars);
+ }
+
+ AString &operator=(char c);
+ AString &operator=(const char *s);
+ AString &operator=(const AString &s);
+ void SetFromWStr_if_Ascii(const wchar_t *s);
+ // void SetFromBstr_if_Ascii(BSTR s);
+
+ AString &operator+=(char c)
+ {
+ if (_limit == _len)
+ Grow_1();
+ unsigned len = _len;
+ char *chars = _chars;
+ chars[len++] = c;
+ chars[len] = 0;
+ _len = len;
+ return *this;
+ }
+
+ void Add_Space();
+ void Add_Space_if_NotEmpty();
+ void Add_OptSpaced(const char *s);
+ void Add_LF();
+ void Add_PathSepar() { operator+=(CHAR_PATH_SEPARATOR); }
+
+ AString &operator+=(const char *s);
+ AString &operator+=(const AString &s);
+
+ void Add_UInt32(UInt32 v);
+
+ void SetFrom(const char *s, unsigned len); // no check
+ void SetFrom_CalcLen(const char *s, unsigned len);
+
+ AString Mid(unsigned startIndex, unsigned count) const { return AString(count, _chars + startIndex); }
+ AString Left(unsigned count) const { return AString(count, *this); }
+
+ // void MakeUpper() { MyStringUpper(_chars); }
+ // void MakeLower() { MyStringLower(_chars); }
+ void MakeLower_Ascii() { MyStringLower_Ascii(_chars); }
+
+
+ bool IsEqualTo(const char *s) const { return strcmp(_chars, s) == 0; }
+ bool IsEqualTo_Ascii_NoCase(const char *s) const { return StringsAreEqualNoCase_Ascii(_chars, s); }
+ // int Compare(const char *s) const { return MyStringCompare(_chars, s); }
+ // int Compare(const AString &s) const { return MyStringCompare(_chars, s._chars); }
+ // int CompareNoCase(const char *s) const { return MyStringCompareNoCase(_chars, s); }
+ // int CompareNoCase(const AString &s) const { return MyStringCompareNoCase(_chars, s._chars); }
+ bool IsPrefixedBy(const char *s) const { return IsString1PrefixedByString2(_chars, s); }
+ bool IsPrefixedBy_Ascii_NoCase(const char *s) const throw();
+
+ bool IsAscii() const
+ {
+ unsigned len = Len();
+ const char *s = _chars;
+ for (unsigned i = 0; i < len; i++)
+ if ((unsigned char)s[i] >= 0x80)
+ return false;
+ return true;
+ }
+ int Find(char c) const { return FindCharPosInString(_chars, c); }
+ int Find(char c, unsigned startIndex) const
+ {
+ int pos = FindCharPosInString(_chars + startIndex, c);
+ return pos < 0 ? -1 : (int)startIndex + pos;
+ }
+
+ int ReverseFind(char c) const throw();
+ int ReverseFind_Dot() const throw() { return ReverseFind('.'); }
+ int ReverseFind_PathSepar() const throw();
+
+ int Find(const char *s) const { return Find(s, 0); }
+ int Find(const char *s, unsigned startIndex) const throw();
+
+ void TrimLeft() throw();
+ void TrimRight() throw();
+ void Trim()
+ {
+ TrimRight();
+ TrimLeft();
+ }
+
+ void InsertAtFront(char c);
+ // void Insert(unsigned index, char c);
+ void Insert(unsigned index, const char *s);
+ void Insert(unsigned index, const AString &s);
+
+ void RemoveChar(char ch) throw();
+
+ void Replace(char oldChar, char newChar) throw();
+ void Replace(const AString &oldString, const AString &newString);
+
+ void Delete(unsigned index) throw();
+ void Delete(unsigned index, unsigned count) throw();
+ void DeleteFrontal(unsigned num) throw();
+ void DeleteBack() { _chars[--_len] = 0; }
+ void DeleteFrom(unsigned index)
+ {
+ if (index < _len)
+ {
+ _len = index;
+ _chars[index] = 0;
+ }
+ }
+};
+
+bool operator<(const AString &s1, const AString &s2);
+bool operator>(const AString &s1, const AString &s2);
+
+/*
+bool operator==(const AString &s1, const AString &s2);
+bool operator==(const AString &s1, const char *s2);
+bool operator==(const char *s1, const AString &s2);
+
+bool operator!=(const AString &s1, const AString &s2);
+bool operator!=(const AString &s1, const char *s2);
+bool operator!=(const char *s1, const AString &s2);
+*/
+
+inline bool operator==(const AString &s1, const AString &s2) { return s1.Len() == s2.Len() && strcmp(s1, s2) == 0; }
+inline bool operator==(const AString &s1, const char *s2) { return strcmp(s1, s2) == 0; }
+inline bool operator==(const char *s1, const AString &s2) { return strcmp(s1, s2) == 0; }
+
+inline bool operator!=(const AString &s1, const AString &s2) { return s1.Len() != s2.Len() || strcmp(s1, s2) != 0; }
+inline bool operator!=(const AString &s1, const char *s2) { return strcmp(s1, s2) != 0; }
+inline bool operator!=(const char *s1, const AString &s2) { return strcmp(s1, s2) != 0; }
+
+// ---------- forbidden functions ----------
+
+void operator==(char c1, const AString &s2);
+void operator==(const AString &s1, char c2);
+
+void operator+(char c, const AString &s); // this function can be OK, but we don't use it
+
+void operator+(const AString &s, int c);
+void operator+(const AString &s, unsigned c);
+void operator+(int c, const AString &s);
+void operator+(unsigned c, const AString &s);
+void operator-(const AString &s, int c);
+void operator-(const AString &s, unsigned c);
+
+
+class UString
+{
+ wchar_t *_chars;
+ unsigned _len;
+ unsigned _limit;
+
+ void MoveItems(unsigned dest, unsigned src)
+ {
+ memmove(_chars + dest, _chars + src, (size_t)(_len - src + 1) * sizeof(wchar_t));
+ }
+
+ void InsertSpace(unsigned index, unsigned size);
+
+ void ReAlloc(unsigned newLimit);
+ void ReAlloc2(unsigned newLimit);
+ void SetStartLen(unsigned len);
+ void Grow_1();
+ void Grow(unsigned n);
+
+ UString(unsigned num, const wchar_t *s); // for Mid
+ UString(unsigned num, const UString &s); // for Left
+ UString(const UString &s, wchar_t c); // it's for String + char
+ UString(const wchar_t *s1, unsigned num1, const wchar_t *s2, unsigned num2);
+
+ friend UString operator+(const UString &s, wchar_t c) { return UString(s, c); } ;
+ // friend UString operator+(wchar_t c, const UString &s); // is not supported
+
+ friend UString operator+(const UString &s1, const UString &s2);
+ friend UString operator+(const UString &s1, const wchar_t *s2);
+ friend UString operator+(const wchar_t *s1, const UString &s2);
+
+ // ---------- forbidden functions ----------
+
+ FORBID_STRING_OPS_UString(signed char)
+ FORBID_STRING_OPS_UString(unsigned char)
+ FORBID_STRING_OPS_UString(short)
+
+ #ifdef MY_NATIVE_WCHAR_T_DEFINED
+ FORBID_STRING_OPS_UString(unsigned short)
+ #endif
+
+ FORBID_STRING_OPS_UString(int)
+ FORBID_STRING_OPS_UString(unsigned)
+ FORBID_STRING_OPS_UString(long)
+ FORBID_STRING_OPS_UString(unsigned long)
+
+ FORBID_STRING_OPS_2(UString, char)
+
+public:
+ UString();
+ explicit UString(wchar_t c);
+ explicit UString(char c);
+ explicit UString(const char *s);
+ // UString(const AString &s);
+ UString(const wchar_t *s);
+ UString(const UString &s);
+ ~UString() { MY_STRING_DELETE(_chars); }
+
+ unsigned Len() const { return _len; }
+ bool IsEmpty() const { return _len == 0; }
+ void Empty() { _len = 0; _chars[0] = 0; }
+
+ operator const wchar_t *() const { return _chars; }
+ const wchar_t *Ptr() const { return _chars; }
+ const wchar_t *Ptr(unsigned pos) const { return _chars + pos; }
+ const wchar_t *RightPtr(unsigned num) const { return _chars + _len - num; }
+ wchar_t Back() const { return _chars[(size_t)_len - 1]; }
+
+ void ReplaceOneCharAtPos(unsigned pos, wchar_t c) { _chars[pos] = c; }
+
+ wchar_t *GetBuf() { return _chars; }
+
+ wchar_t *GetBuf(unsigned minLen)
+ {
+ if (minLen > _limit)
+ ReAlloc2(minLen);
+ return _chars;
+ }
+ wchar_t *GetBuf_SetEnd(unsigned minLen)
+ {
+ if (minLen > _limit)
+ ReAlloc2(minLen);
+ wchar_t *chars = _chars;
+ chars[minLen] = 0;
+ _len = minLen;
+ return chars;
+ }
+
+ void ReleaseBuf_SetLen(unsigned newLen) { _len = newLen; }
+ void ReleaseBuf_SetEnd(unsigned newLen) { _len = newLen; _chars[newLen] = 0; }
+ void ReleaseBuf_CalcLen(unsigned maxLen)
+ {
+ wchar_t *chars = _chars;
+ chars[maxLen] = 0;
+ _len = MyStringLen(chars);
+ }
+
+ UString &operator=(wchar_t c);
+ UString &operator=(char c) { return (*this)=((wchar_t)(unsigned char)c); }
+ UString &operator=(const wchar_t *s);
+ UString &operator=(const UString &s);
+ void SetFrom(const wchar_t *s, unsigned len); // no check
+ void SetFromBstr(BSTR s);
+ UString &operator=(const char *s);
+ UString &operator=(const AString &s) { return operator=(s.Ptr()); }
+
+ UString &operator+=(wchar_t c)
+ {
+ if (_limit == _len)
+ Grow_1();
+ unsigned len = _len;
+ wchar_t *chars = _chars;
+ chars[len++] = c;
+ chars[len] = 0;
+ _len = len;
+ return *this;
+ }
+
+ UString &operator+=(char c) { return (*this)+=((wchar_t)(unsigned char)c); }
+
+ void Add_Space();
+ void Add_Space_if_NotEmpty();
+ void Add_LF();
+ void Add_PathSepar() { operator+=(WCHAR_PATH_SEPARATOR); }
+
+ UString &operator+=(const wchar_t *s);
+ UString &operator+=(const UString &s);
+ UString &operator+=(const char *s);
+ UString &operator+=(const AString &s) { return operator+=(s.Ptr()); }
+
+ void Add_UInt32(UInt32 v);
+
+ UString Mid(unsigned startIndex, unsigned count) const { return UString(count, _chars + startIndex); }
+ UString Left(unsigned count) const { return UString(count, *this); }
+
+ // void MakeUpper() { MyStringUpper(_chars); }
+ // void MakeUpper() { MyStringUpper_Ascii(_chars); }
+ // void MakeUpper_Ascii() { MyStringUpper_Ascii(_chars); }
+ void MakeLower_Ascii() { MyStringLower_Ascii(_chars); }
+
+ bool IsEqualTo(const char *s) const { return StringsAreEqual_Ascii(_chars, s); }
+ bool IsEqualTo_NoCase(const wchar_t *s) const { return StringsAreEqualNoCase(_chars, s); }
+ bool IsEqualTo_Ascii_NoCase(const char *s) const { return StringsAreEqualNoCase_Ascii(_chars, s); }
+ int Compare(const wchar_t *s) const { return wcscmp(_chars, s); }
+ // int Compare(const UString &s) const { return MyStringCompare(_chars, s._chars); }
+ // int CompareNoCase(const wchar_t *s) const { return MyStringCompareNoCase(_chars, s); }
+ // int CompareNoCase(const UString &s) const { return MyStringCompareNoCase(_chars, s._chars); }
+ bool IsPrefixedBy(const wchar_t *s) const { return IsString1PrefixedByString2(_chars, s); }
+ bool IsPrefixedBy_NoCase(const wchar_t *s) const { return IsString1PrefixedByString2_NoCase(_chars, s); }
+ bool IsPrefixedBy_Ascii_NoCase(const char *s) const throw();
+
+ bool IsAscii() const
+ {
+ unsigned len = Len();
+ const wchar_t *s = _chars;
+ for (unsigned i = 0; i < len; i++)
+ if (s[i] >= 0x80)
+ return false;
+ return true;
+ }
+ int Find(wchar_t c) const { return FindCharPosInString(_chars, c); }
+ int Find(wchar_t c, unsigned startIndex) const
+ {
+ int pos = FindCharPosInString(_chars + startIndex, c);
+ return pos < 0 ? -1 : (int)startIndex + pos;
+ }
+
+ int ReverseFind(wchar_t c) const throw();
+ int ReverseFind_Dot() const throw() { return ReverseFind(L'.'); }
+ int ReverseFind_PathSepar() const throw();
+
+ int Find(const wchar_t *s) const { return Find(s, 0); }
+ int Find(const wchar_t *s, unsigned startIndex) const throw();
+
+ void TrimLeft() throw();
+ void TrimRight() throw();
+ void Trim()
+ {
+ TrimRight();
+ TrimLeft();
+ }
+
+ void InsertAtFront(wchar_t c);
+ // void Insert(unsigned index, wchar_t c);
+ void Insert(unsigned index, const wchar_t *s);
+ void Insert(unsigned index, const UString &s);
+
+ void RemoveChar(wchar_t ch) throw();
+
+ void Replace(wchar_t oldChar, wchar_t newChar) throw();
+ void Replace(const UString &oldString, const UString &newString);
+
+ void Delete(unsigned index) throw();
+ void Delete(unsigned index, unsigned count) throw();
+ void DeleteFrontal(unsigned num) throw();
+ void DeleteBack() { _chars[--_len] = 0; }
+ void DeleteFrom(unsigned index)
+ {
+ if (index < _len)
+ {
+ _len = index;
+ _chars[index] = 0;
+ }
+ }
+};
+
+bool operator<(const UString &s1, const UString &s2);
+bool operator>(const UString &s1, const UString &s2);
+
+inline bool operator==(const UString &s1, const UString &s2) { return s1.Len() == s2.Len() && wcscmp(s1, s2) == 0; }
+inline bool operator==(const UString &s1, const wchar_t *s2) { return wcscmp(s1, s2) == 0; }
+inline bool operator==(const wchar_t *s1, const UString &s2) { return wcscmp(s1, s2) == 0; }
+
+inline bool operator!=(const UString &s1, const UString &s2) { return s1.Len() != s2.Len() || wcscmp(s1, s2) != 0; }
+inline bool operator!=(const UString &s1, const wchar_t *s2) { return wcscmp(s1, s2) != 0; }
+inline bool operator!=(const wchar_t *s1, const UString &s2) { return wcscmp(s1, s2) != 0; }
+
+
+// ---------- forbidden functions ----------
+
+void operator==(wchar_t c1, const UString &s2);
+void operator==(const UString &s1, wchar_t c2);
+
+void operator+(wchar_t c, const UString &s); // this function can be OK, but we don't use it
+
+void operator+(const AString &s1, const UString &s2);
+void operator+(const UString &s1, const AString &s2);
+
+void operator+(const UString &s1, const char *s2);
+void operator+(const char *s1, const UString &s2);
+
+void operator+(const UString &s, char c);
+void operator+(const UString &s, unsigned char c);
+void operator+(char c, const UString &s);
+void operator+(unsigned char c, const UString &s);
+void operator-(const UString &s1, wchar_t c);
+
+#ifdef _WIN32
+// can we forbid these functions, if wchar_t is 32-bit ?
+void operator+(const UString &s, int c);
+void operator+(const UString &s, unsigned c);
+void operator+(int c, const UString &s);
+void operator+(unsigned c, const UString &s);
+void operator-(const UString &s1, int c);
+void operator-(const UString &s1, unsigned c);
+#endif
+
+
+
+
+
+
+
+class UString2
+{
+ wchar_t *_chars;
+ unsigned _len;
+
+ void ReAlloc2(unsigned newLimit);
+ void SetStartLen(unsigned len);
+
+ // ---------- forbidden functions ----------
+
+ FORBID_STRING_OPS_UString2(char)
+ FORBID_STRING_OPS_UString2(signed char)
+ FORBID_STRING_OPS_UString2(unsigned char)
+ FORBID_STRING_OPS_UString2(short)
+
+ UString2 &operator=(wchar_t c);
+ UString2(wchar_t c);
+
+public:
+ UString2(): _chars(NULL), _len(0) {}
+ UString2(const wchar_t *s);
+ UString2(const UString2 &s);
+ ~UString2() { if (_chars) MY_STRING_DELETE(_chars); }
+
+ unsigned Len() const { return _len; }
+ bool IsEmpty() const { return _len == 0; }
+ // void Empty() { _len = 0; _chars[0] = 0; }
+
+ // operator const wchar_t *() const { return _chars; }
+ const wchar_t *GetRawPtr() const { return _chars; }
+
+ int Compare(const wchar_t *s) const { return wcscmp(_chars, s); }
+
+ wchar_t *GetBuf(unsigned minLen)
+ {
+ if (!_chars || minLen > _len)
+ ReAlloc2(minLen);
+ return _chars;
+ }
+ void ReleaseBuf_SetLen(unsigned newLen) { _len = newLen; }
+
+ UString2 &operator=(const wchar_t *s);
+ UString2 &operator=(const UString2 &s);
+ void SetFromAscii(const char *s);
+};
+
+bool operator==(const UString2 &s1, const UString2 &s2);
+bool operator==(const UString2 &s1, const wchar_t *s2);
+bool operator==(const wchar_t *s1, const UString2 &s2);
+
+inline bool operator!=(const UString2 &s1, const UString2 &s2) { return !(s1 == s2); }
+inline bool operator!=(const UString2 &s1, const wchar_t *s2) { return !(s1 == s2); }
+inline bool operator!=(const wchar_t *s1, const UString2 &s2) { return !(s1 == s2); }
+
+
+// ---------- forbidden functions ----------
+
+void operator==(wchar_t c1, const UString2 &s2);
+void operator==(const UString2 &s1, wchar_t c2);
+bool operator<(const UString2 &s1, const UString2 &s2);
+bool operator>(const UString2 &s1, const UString2 &s2);
+
+void operator+(const UString2 &s1, const UString2 &s2);
+void operator+(const UString2 &s1, const wchar_t *s2);
+void operator+(const wchar_t *s1, const UString2 &s2);
+void operator+(wchar_t c, const UString2 &s);
+void operator+(const UString2 &s, wchar_t c);
+void operator+(const UString2 &s, char c);
+void operator+(const UString2 &s, unsigned char c);
+void operator+(char c, const UString2 &s);
+void operator+(unsigned char c, const UString2 &s);
+void operator-(const UString2 &s1, wchar_t c);
+
+
+
+
+
+
+typedef CObjectVector<AString> AStringVector;
+typedef CObjectVector<UString> UStringVector;
+
+#ifdef _UNICODE
+ typedef UString CSysString;
+#else
+ typedef AString CSysString;
+#endif
+
+typedef CObjectVector<CSysString> CSysStringVector;
+
+
+// ---------- FString ----------
+
+#ifdef _WIN32
+ #define USE_UNICODE_FSTRING
+#endif
+
+#ifdef USE_UNICODE_FSTRING
+
+ #define __FTEXT(quote) L##quote
+
+ typedef wchar_t FChar;
+ typedef UString FString;
+
+ #define fs2us(_x_) (_x_)
+ #define us2fs(_x_) (_x_)
+ FString fas2fs(const char *s);
+ FString fas2fs(const AString &s);
+ AString fs2fas(const FChar *s);
+
+#else
+
+ #define __FTEXT(quote) quote
+
+ typedef char FChar;
+ typedef AString FString;
+
+ UString fs2us(const FChar *s);
+ UString fs2us(const FString &s);
+ FString us2fs(const wchar_t *s);
+ #define fas2fs(_x_) (_x_)
+ #define fs2fas(_x_) (_x_)
+
+#endif
+
+#define FTEXT(quote) __FTEXT(quote)
+
+#define FCHAR_PATH_SEPARATOR FTEXT(CHAR_PATH_SEPARATOR)
+#define FSTRING_PATH_SEPARATOR FTEXT(STRING_PATH_SEPARATOR)
+
+// #define FCHAR_ANY_MASK FTEXT('*')
+// #define FSTRING_ANY_MASK FTEXT("*")
+
+typedef const FChar *CFSTR;
+
+typedef CObjectVector<FString> FStringVector;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyTypes.h b/other-licenses/7zstub/src/CPP/Common/MyTypes.h
new file mode 100644
index 0000000000..6e73aca31e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyTypes.h
@@ -0,0 +1,35 @@
+// Common/MyTypes.h
+
+#ifndef __COMMON_MY_TYPES_H
+#define __COMMON_MY_TYPES_H
+
+#include "../../C/7zTypes.h"
+
+typedef int HRes;
+
+struct CBoolPair
+{
+ bool Val;
+ bool Def;
+
+ CBoolPair(): Val(false), Def(false) {}
+
+ void Init()
+ {
+ Val = false;
+ Def = false;
+ }
+
+ void SetTrueTrue()
+ {
+ Val = true;
+ Def = true;
+ }
+};
+
+#define CLASS_NO_COPY(cls) \
+ private: \
+ cls(const cls &); \
+ cls &operator=(const cls &);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyUnknown.h b/other-licenses/7zstub/src/CPP/Common/MyUnknown.h
new file mode 100644
index 0000000000..b1d476ffb8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyUnknown.h
@@ -0,0 +1,17 @@
+// MyUnknown.h
+
+#ifndef __MY_UNKNOWN_H
+#define __MY_UNKNOWN_H
+
+#include "MyWindows.h"
+
+/*
+#ifdef _WIN32
+#include <basetyps.h>
+#include <unknwn.h>
+#else
+#include "MyWindows.h"
+#endif
+*/
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyVector.cpp b/other-licenses/7zstub/src/CPP/Common/MyVector.cpp
new file mode 100644
index 0000000000..9a6d1d5aee
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyVector.cpp
@@ -0,0 +1,3 @@
+// Common/MyVector.cpp
+
+#include "StdAfx.h"
diff --git a/other-licenses/7zstub/src/CPP/Common/MyVector.h b/other-licenses/7zstub/src/CPP/Common/MyVector.h
new file mode 100644
index 0000000000..21125fa7da
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyVector.h
@@ -0,0 +1,634 @@
+// Common/MyVector.h
+
+#ifndef __COMMON_MY_VECTOR_H
+#define __COMMON_MY_VECTOR_H
+
+#include <string.h>
+
+template <class T>
+class CRecordVector
+{
+ T *_items;
+ unsigned _size;
+ unsigned _capacity;
+
+ void MoveItems(unsigned destIndex, unsigned srcIndex)
+ {
+ memmove(_items + destIndex, _items + srcIndex, (size_t)(_size - srcIndex) * sizeof(T));
+ }
+
+ void ReserveOnePosition()
+ {
+ if (_size == _capacity)
+ {
+ unsigned newCapacity = _capacity + (_capacity >> 2) + 1;
+ T *p;
+ MY_ARRAY_NEW(p, T, newCapacity);
+ // p = new T[newCapacity];
+ if (_size != 0)
+ memcpy(p, _items, (size_t)_size * sizeof(T));
+ delete []_items;
+ _items = p;
+ _capacity = newCapacity;
+ }
+ }
+
+public:
+
+ CRecordVector(): _items(0), _size(0), _capacity(0) {}
+
+ CRecordVector(const CRecordVector &v): _items(0), _size(0), _capacity(0)
+ {
+ unsigned size = v.Size();
+ if (size != 0)
+ {
+ _items = new T[size];
+ _size = size;
+ _capacity = size;
+ memcpy(_items, v._items, (size_t)size * sizeof(T));
+ }
+ }
+
+ unsigned Size() const { return _size; }
+ bool IsEmpty() const { return _size == 0; }
+
+ void ConstructReserve(unsigned size)
+ {
+ if (size != 0)
+ {
+ MY_ARRAY_NEW(_items, T, size)
+ // _items = new T[size];
+ _capacity = size;
+ }
+ }
+
+ void Reserve(unsigned newCapacity)
+ {
+ if (newCapacity > _capacity)
+ {
+ T *p;
+ MY_ARRAY_NEW(p, T, newCapacity);
+ // p = new T[newCapacity];
+ if (_size != 0)
+ memcpy(p, _items, (size_t)_size * sizeof(T));
+ delete []_items;
+ _items = p;
+ _capacity = newCapacity;
+ }
+ }
+
+ void ClearAndReserve(unsigned newCapacity)
+ {
+ Clear();
+ if (newCapacity > _capacity)
+ {
+ delete []_items;
+ _items = NULL;
+ _capacity = 0;
+ MY_ARRAY_NEW(_items, T, newCapacity)
+ // _items = new T[newCapacity];
+ _capacity = newCapacity;
+ }
+ }
+
+ void ClearAndSetSize(unsigned newSize)
+ {
+ ClearAndReserve(newSize);
+ _size = newSize;
+ }
+
+ void ChangeSize_KeepData(unsigned newSize)
+ {
+ if (newSize > _capacity)
+ {
+ T *p;
+ MY_ARRAY_NEW(p, T, newSize)
+ // p = new T[newSize];
+ if (_size != 0)
+ memcpy(p, _items, (size_t)_size * sizeof(T));
+ delete []_items;
+ _items = p;
+ _capacity = newSize;
+ }
+ _size = newSize;
+ }
+
+ void ReserveDown()
+ {
+ if (_size == _capacity)
+ return;
+ T *p = NULL;
+ if (_size != 0)
+ {
+ p = new T[_size];
+ memcpy(p, _items, (size_t)_size * sizeof(T));
+ }
+ delete []_items;
+ _items = p;
+ _capacity = _size;
+ }
+
+ ~CRecordVector() { delete []_items; }
+
+ void ClearAndFree()
+ {
+ delete []_items;
+ _items = NULL;
+ _size = 0;
+ _capacity = 0;
+ }
+
+ void Clear() { _size = 0; }
+
+ void DeleteBack() { _size--; }
+
+ void DeleteFrom(unsigned index)
+ {
+ // if (index <= _size)
+ _size = index;
+ }
+
+ void DeleteFrontal(unsigned num)
+ {
+ if (num != 0)
+ {
+ MoveItems(0, num);
+ _size -= num;
+ }
+ }
+
+ void Delete(unsigned index)
+ {
+ MoveItems(index, index + 1);
+ _size -= 1;
+ }
+
+ /*
+ void Delete(unsigned index, unsigned num)
+ {
+ if (num > 0)
+ {
+ MoveItems(index, index + num);
+ _size -= num;
+ }
+ }
+ */
+
+ CRecordVector& operator=(const CRecordVector &v)
+ {
+ if (&v == this)
+ return *this;
+ unsigned size = v.Size();
+ if (size > _capacity)
+ {
+ delete []_items;
+ _capacity = 0;
+ _size = 0;
+ _items = NULL;
+ _items = new T[size];
+ _capacity = size;
+ }
+ _size = size;
+ if (size != 0)
+ memcpy(_items, v._items, (size_t)size * sizeof(T));
+ return *this;
+ }
+
+ CRecordVector& operator+=(const CRecordVector &v)
+ {
+ unsigned size = v.Size();
+ Reserve(_size + size);
+ if (size != 0)
+ memcpy(_items + _size, v._items, (size_t)size * sizeof(T));
+ _size += size;
+ return *this;
+ }
+
+ unsigned Add(const T item)
+ {
+ ReserveOnePosition();
+ _items[_size] = item;
+ return _size++;
+ }
+
+ void AddInReserved(const T item)
+ {
+ _items[_size++] = item;
+ }
+
+ void Insert(unsigned index, const T item)
+ {
+ ReserveOnePosition();
+ MoveItems(index + 1, index);
+ _items[index] = item;
+ _size++;
+ }
+
+ void MoveToFront(unsigned index)
+ {
+ if (index != 0)
+ {
+ T temp = _items[index];
+ memmove(_items + 1, _items, (size_t)index * sizeof(T));
+ _items[0] = temp;
+ }
+ }
+
+ const T& operator[](unsigned index) const { return _items[index]; }
+ T& operator[](unsigned index) { return _items[index]; }
+ const T& Front() const { return _items[0]; }
+ T& Front() { return _items[0]; }
+ const T& Back() const { return _items[(size_t)_size - 1]; }
+ T& Back() { return _items[(size_t)_size - 1]; }
+
+ /*
+ void Swap(unsigned i, unsigned j)
+ {
+ T temp = _items[i];
+ _items[i] = _items[j];
+ _items[j] = temp;
+ }
+ */
+
+ int FindInSorted(const T item, unsigned left, unsigned right) const
+ {
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T midVal = (*this)[mid];
+ if (item == midVal)
+ return mid;
+ if (item < midVal)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ return -1;
+ }
+
+ int FindInSorted2(const T &item, unsigned left, unsigned right) const
+ {
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T& midVal = (*this)[mid];
+ int comp = item.Compare(midVal);
+ if (comp == 0)
+ return mid;
+ if (comp < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ return -1;
+ }
+
+ int FindInSorted(const T item) const
+ {
+ return FindInSorted(item, 0, _size);
+ }
+
+ int FindInSorted2(const T &item) const
+ {
+ return FindInSorted2(item, 0, _size);
+ }
+
+ unsigned AddToUniqueSorted(const T item)
+ {
+ unsigned left = 0, right = _size;
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T midVal = (*this)[mid];
+ if (item == midVal)
+ return mid;
+ if (item < midVal)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ Insert(right, item);
+ return right;
+ }
+
+ unsigned AddToUniqueSorted2(const T &item)
+ {
+ unsigned left = 0, right = _size;
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T& midVal = (*this)[mid];
+ int comp = item.Compare(midVal);
+ if (comp == 0)
+ return mid;
+ if (comp < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ Insert(right, item);
+ return right;
+ }
+
+ static void SortRefDown(T* p, unsigned k, unsigned size, int (*compare)(const T*, const T*, void *), void *param)
+ {
+ T temp = p[k];
+ for (;;)
+ {
+ unsigned s = (k << 1);
+ if (s > size)
+ break;
+ if (s < size && compare(p + s + 1, p + s, param) > 0)
+ s++;
+ if (compare(&temp, p + s, param) >= 0)
+ break;
+ p[k] = p[s];
+ k = s;
+ }
+ p[k] = temp;
+ }
+
+ void Sort(int (*compare)(const T*, const T*, void *), void *param)
+ {
+ unsigned size = _size;
+ if (size <= 1)
+ return;
+ T* p = (&Front()) - 1;
+ {
+ unsigned i = size >> 1;
+ do
+ SortRefDown(p, i, size, compare, param);
+ while (--i != 0);
+ }
+ do
+ {
+ T temp = p[size];
+ p[size--] = p[1];
+ p[1] = temp;
+ SortRefDown(p, 1, size, compare, param);
+ }
+ while (size > 1);
+ }
+
+ static void SortRefDown2(T* p, unsigned k, unsigned size)
+ {
+ T temp = p[k];
+ for (;;)
+ {
+ unsigned s = (k << 1);
+ if (s > size)
+ break;
+ if (s < size && p[(size_t)s + 1].Compare(p[s]) > 0)
+ s++;
+ if (temp.Compare(p[s]) >= 0)
+ break;
+ p[k] = p[s];
+ k = s;
+ }
+ p[k] = temp;
+ }
+
+ void Sort2()
+ {
+ unsigned size = _size;
+ if (size <= 1)
+ return;
+ T* p = (&Front()) - 1;
+ {
+ unsigned i = size >> 1;
+ do
+ SortRefDown2(p, i, size);
+ while (--i != 0);
+ }
+ do
+ {
+ T temp = p[size];
+ p[size--] = p[1];
+ p[1] = temp;
+ SortRefDown2(p, 1, size);
+ }
+ while (size > 1);
+ }
+};
+
+typedef CRecordVector<int> CIntVector;
+typedef CRecordVector<unsigned int> CUIntVector;
+typedef CRecordVector<bool> CBoolVector;
+typedef CRecordVector<unsigned char> CByteVector;
+typedef CRecordVector<void *> CPointerVector;
+
+template <class T>
+class CObjectVector
+{
+ CPointerVector _v;
+public:
+ unsigned Size() const { return _v.Size(); }
+ bool IsEmpty() const { return _v.IsEmpty(); }
+ void ReserveDown() { _v.ReserveDown(); }
+ // void Reserve(unsigned newCapacity) { _v.Reserve(newCapacity); }
+ void ClearAndReserve(unsigned newCapacity) { Clear(); _v.ClearAndReserve(newCapacity); }
+
+ CObjectVector() {};
+ CObjectVector(const CObjectVector &v)
+ {
+ unsigned size = v.Size();
+ _v.ConstructReserve(size);
+ for (unsigned i = 0; i < size; i++)
+ _v.AddInReserved(new T(v[i]));
+ }
+ CObjectVector& operator=(const CObjectVector &v)
+ {
+ if (&v == this)
+ return *this;
+ Clear();
+ unsigned size = v.Size();
+ _v.Reserve(size);
+ for (unsigned i = 0; i < size; i++)
+ _v.AddInReserved(new T(v[i]));
+ return *this;
+ }
+
+ CObjectVector& operator+=(const CObjectVector &v)
+ {
+ unsigned size = v.Size();
+ _v.Reserve(Size() + size);
+ for (unsigned i = 0; i < size; i++)
+ _v.AddInReserved(new T(v[i]));
+ return *this;
+ }
+
+ const T& operator[](unsigned index) const { return *((T *)_v[index]); }
+ T& operator[](unsigned index) { return *((T *)_v[index]); }
+ const T& Front() const { return operator[](0); }
+ T& Front() { return operator[](0); }
+ const T& Back() const { return *(T *)_v.Back(); }
+ T& Back() { return *(T *)_v.Back(); }
+
+ void MoveToFront(unsigned index) { _v.MoveToFront(index); }
+
+ unsigned Add(const T& item) { return _v.Add(new T(item)); }
+
+ void AddInReserved(const T& item) { _v.AddInReserved(new T(item)); }
+
+ T& AddNew()
+ {
+ T *p = new T;
+ _v.Add(p);
+ return *p;
+ }
+
+ T& AddNewInReserved()
+ {
+ T *p = new T;
+ _v.AddInReserved(p);
+ return *p;
+ }
+
+ void Insert(unsigned index, const T& item) { _v.Insert(index, new T(item)); }
+
+ T& InsertNew(unsigned index)
+ {
+ T *p = new T;
+ _v.Insert(index, p);
+ return *p;
+ }
+
+ ~CObjectVector()
+ {
+ for (unsigned i = _v.Size(); i != 0;)
+ delete (T *)_v[--i];
+ }
+
+ void ClearAndFree()
+ {
+ Clear();
+ _v.ClearAndFree();
+ }
+
+ void Clear()
+ {
+ for (unsigned i = _v.Size(); i != 0;)
+ delete (T *)_v[--i];
+ _v.Clear();
+ }
+
+ void DeleteFrom(unsigned index)
+ {
+ unsigned size = _v.Size();
+ for (unsigned i = index; i < size; i++)
+ delete (T *)_v[i];
+ _v.DeleteFrom(index);
+ }
+
+ void DeleteFrontal(unsigned num)
+ {
+ for (unsigned i = 0; i < num; i++)
+ delete (T *)_v[i];
+ _v.DeleteFrontal(num);
+ }
+
+ void DeleteBack()
+ {
+ delete (T *)_v.Back();
+ _v.DeleteBack();
+ }
+
+ void Delete(unsigned index)
+ {
+ delete (T *)_v[index];
+ _v.Delete(index);
+ }
+
+ /*
+ void Delete(unsigned index, unsigned num)
+ {
+ for (unsigned i = 0; i < num; i++)
+ delete (T *)_v[index + i];
+ _v.Delete(index, num);
+ }
+ */
+
+ /*
+ int Find(const T& item) const
+ {
+ unsigned size = Size();
+ for (unsigned i = 0; i < size; i++)
+ if (item == (*this)[i])
+ return i;
+ return -1;
+ }
+ */
+
+ int FindInSorted(const T& item) const
+ {
+ unsigned left = 0, right = Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T& midVal = (*this)[mid];
+ int comp = item.Compare(midVal);
+ if (comp == 0)
+ return mid;
+ if (comp < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ return -1;
+ }
+
+ unsigned AddToUniqueSorted(const T& item)
+ {
+ unsigned left = 0, right = Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T& midVal = (*this)[mid];
+ int comp = item.Compare(midVal);
+ if (comp == 0)
+ return mid;
+ if (comp < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ Insert(right, item);
+ return right;
+ }
+
+ /*
+ unsigned AddToSorted(const T& item)
+ {
+ unsigned left = 0, right = Size();
+ while (left != right)
+ {
+ unsigned mid = (left + right) / 2;
+ const T& midVal = (*this)[mid];
+ int comp = item.Compare(midVal);
+ if (comp == 0)
+ {
+ right = mid + 1;
+ break;
+ }
+ if (comp < 0)
+ right = mid;
+ else
+ left = mid + 1;
+ }
+ Insert(right, item);
+ return right;
+ }
+ */
+
+ void Sort(int (*compare)(void *const *, void *const *, void *), void *param)
+ { _v.Sort(compare, param); }
+
+ static int CompareObjectItems(void *const *a1, void *const *a2, void * /* param */)
+ { return (*(*((const T **)a1))).Compare(*(*((const T **)a2))); }
+
+ void Sort() { _v.Sort(CompareObjectItems, 0); }
+};
+
+#define FOR_VECTOR(_i_, _v_) for (unsigned _i_ = 0; _i_ < (_v_).Size(); _i_++)
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyWindows.cpp b/other-licenses/7zstub/src/CPP/Common/MyWindows.cpp
new file mode 100644
index 0000000000..bc9f7be3f5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyWindows.cpp
@@ -0,0 +1,145 @@
+// MyWindows.cpp
+
+#include "StdAfx.h"
+
+#ifndef _WIN32
+
+#include <stdlib.h>
+
+#include "MyWindows.h"
+
+static inline void *AllocateForBSTR(size_t cb) { return ::malloc(cb); }
+static inline void FreeForBSTR(void *pv) { ::free(pv);}
+
+/* Win32 uses DWORD (32-bit) type to store size of string before (OLECHAR *) string.
+ We must select CBstrSizeType for another systems (not Win32):
+
+ if (CBstrSizeType is UINT32),
+ then we support only strings smaller than 4 GB.
+ Win32 version always has that limitation.
+
+ if (CBstrSizeType is UINT),
+ (UINT can be 16/32/64-bit)
+ We can support strings larger than 4 GB (if UINT is 64-bit),
+ but sizeof(UINT) can be different in parts compiled by
+ different compilers/settings,
+ and we can't send such BSTR strings between such parts.
+*/
+
+typedef UINT32 CBstrSizeType;
+// typedef UINT CBstrSizeType;
+
+#define k_BstrSize_Max 0xFFFFFFFF
+// #define k_BstrSize_Max UINT_MAX
+// #define k_BstrSize_Max ((UINT)(INT)-1)
+
+BSTR SysAllocStringByteLen(LPCSTR s, UINT len)
+{
+ /* Original SysAllocStringByteLen in Win32 maybe fills only unaligned null OLECHAR at the end.
+ We provide also aligned null OLECHAR at the end. */
+
+ if (len >= (k_BstrSize_Max - sizeof(OLECHAR) - sizeof(OLECHAR) - sizeof(CBstrSizeType)))
+ return NULL;
+
+ UINT size = (len + sizeof(OLECHAR) + sizeof(OLECHAR) - 1) & ~(sizeof(OLECHAR) - 1);
+ void *p = AllocateForBSTR(size + sizeof(CBstrSizeType));
+ if (!p)
+ return NULL;
+ *(CBstrSizeType *)p = (CBstrSizeType)len;
+ BSTR bstr = (BSTR)((CBstrSizeType *)p + 1);
+ if (s)
+ memcpy(bstr, s, len);
+ for (; len < size; len++)
+ ((Byte *)bstr)[len] = 0;
+ return bstr;
+}
+
+BSTR SysAllocStringLen(const OLECHAR *s, UINT len)
+{
+ if (len >= (k_BstrSize_Max - sizeof(OLECHAR) - sizeof(CBstrSizeType)) / sizeof(OLECHAR))
+ return NULL;
+
+ UINT size = len * sizeof(OLECHAR);
+ void *p = AllocateForBSTR(size + sizeof(CBstrSizeType) + sizeof(OLECHAR));
+ if (!p)
+ return NULL;
+ *(CBstrSizeType *)p = (CBstrSizeType)size;
+ BSTR bstr = (BSTR)((CBstrSizeType *)p + 1);
+ if (s)
+ memcpy(bstr, s, size);
+ bstr[len] = 0;
+ return bstr;
+}
+
+BSTR SysAllocString(const OLECHAR *s)
+{
+ if (!s)
+ return 0;
+ const OLECHAR *s2 = s;
+ while (*s2 != 0)
+ s2++;
+ return SysAllocStringLen(s, (UINT)(s2 - s));
+}
+
+void SysFreeString(BSTR bstr)
+{
+ if (bstr)
+ FreeForBSTR((CBstrSizeType *)bstr - 1);
+}
+
+UINT SysStringByteLen(BSTR bstr)
+{
+ if (!bstr)
+ return 0;
+ return *((CBstrSizeType *)bstr - 1);
+}
+
+UINT SysStringLen(BSTR bstr)
+{
+ if (!bstr)
+ return 0;
+ return *((CBstrSizeType *)bstr - 1) / sizeof(OLECHAR);
+}
+
+
+HRESULT VariantClear(VARIANTARG *prop)
+{
+ if (prop->vt == VT_BSTR)
+ SysFreeString(prop->bstrVal);
+ prop->vt = VT_EMPTY;
+ return S_OK;
+}
+
+HRESULT VariantCopy(VARIANTARG *dest, const VARIANTARG *src)
+{
+ HRESULT res = ::VariantClear(dest);
+ if (res != S_OK)
+ return res;
+ if (src->vt == VT_BSTR)
+ {
+ dest->bstrVal = SysAllocStringByteLen((LPCSTR)src->bstrVal,
+ SysStringByteLen(src->bstrVal));
+ if (!dest->bstrVal)
+ return E_OUTOFMEMORY;
+ dest->vt = VT_BSTR;
+ }
+ else
+ *dest = *src;
+ return S_OK;
+}
+
+LONG CompareFileTime(const FILETIME* ft1, const FILETIME* ft2)
+{
+ if (ft1->dwHighDateTime < ft2->dwHighDateTime) return -1;
+ if (ft1->dwHighDateTime > ft2->dwHighDateTime) return 1;
+ if (ft1->dwLowDateTime < ft2->dwLowDateTime) return -1;
+ if (ft1->dwLowDateTime > ft2->dwLowDateTime) return 1;
+ return 0;
+}
+
+DWORD GetLastError()
+{
+ return 0;
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/MyWindows.h b/other-licenses/7zstub/src/CPP/Common/MyWindows.h
new file mode 100644
index 0000000000..cc78478150
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/MyWindows.h
@@ -0,0 +1,231 @@
+// MyWindows.h
+
+#ifndef __MY_WINDOWS_H
+#define __MY_WINDOWS_H
+
+#ifdef _WIN32
+
+#include <windows.h>
+
+#ifdef UNDER_CE
+ #undef VARIANT_TRUE
+ #define VARIANT_TRUE ((VARIANT_BOOL)-1)
+#endif
+
+#else
+
+#include <stddef.h> // for wchar_t
+#include <string.h>
+// #include <stdint.h> // for uintptr_t
+
+#include "MyGuidDef.h"
+
+#define WINAPI
+
+typedef char CHAR;
+typedef unsigned char UCHAR;
+
+#undef BYTE
+typedef unsigned char BYTE;
+
+typedef short SHORT;
+typedef unsigned short USHORT;
+
+#undef WORD
+typedef unsigned short WORD;
+typedef short VARIANT_BOOL;
+
+typedef int INT;
+typedef Int32 INT32;
+typedef unsigned int UINT;
+typedef UInt32 UINT32;
+typedef INT32 LONG; // LONG, ULONG and DWORD must be 32-bit
+typedef UINT32 ULONG;
+
+#undef DWORD
+typedef UINT32 DWORD;
+
+typedef long BOOL;
+
+#ifndef FALSE
+ #define FALSE 0
+ #define TRUE 1
+#endif
+
+// typedef size_t ULONG_PTR;
+typedef size_t DWORD_PTR;
+// typedef uintptr_t UINT_PTR;
+// typedef ptrdiff_t UINT_PTR;
+
+typedef Int64 LONGLONG;
+typedef UInt64 ULONGLONG;
+
+typedef struct _LARGE_INTEGER { LONGLONG QuadPart; } LARGE_INTEGER;
+typedef struct _ULARGE_INTEGER { ULONGLONG QuadPart; } ULARGE_INTEGER;
+
+typedef const CHAR *LPCSTR;
+typedef CHAR TCHAR;
+typedef const TCHAR *LPCTSTR;
+typedef wchar_t WCHAR;
+typedef WCHAR OLECHAR;
+typedef const WCHAR *LPCWSTR;
+typedef OLECHAR *BSTR;
+typedef const OLECHAR *LPCOLESTR;
+typedef OLECHAR *LPOLESTR;
+
+typedef struct _FILETIME
+{
+ DWORD dwLowDateTime;
+ DWORD dwHighDateTime;
+} FILETIME;
+
+#define HRESULT LONG
+#define FAILED(Status) ((HRESULT)(Status)<0)
+typedef ULONG PROPID;
+typedef LONG SCODE;
+
+#define ERROR_NEGATIVE_SEEK 131L
+
+#define S_OK ((HRESULT)0x00000000L)
+#define S_FALSE ((HRESULT)0x00000001L)
+#define E_NOTIMPL ((HRESULT)0x80004001L)
+#define E_NOINTERFACE ((HRESULT)0x80004002L)
+#define E_ABORT ((HRESULT)0x80004004L)
+#define E_FAIL ((HRESULT)0x80004005L)
+#define STG_E_INVALIDFUNCTION ((HRESULT)0x80030001L)
+#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
+#define E_INVALIDARG ((HRESULT)0x80070057L)
+
+#ifdef _MSC_VER
+#define STDMETHODCALLTYPE __stdcall
+#else
+#define STDMETHODCALLTYPE
+#endif
+
+#define STDMETHOD_(t, f) virtual t STDMETHODCALLTYPE f
+#define STDMETHOD(f) STDMETHOD_(HRESULT, f)
+#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
+#define STDMETHODIMP STDMETHODIMP_(HRESULT)
+
+#define PURE = 0
+
+#define MIDL_INTERFACE(x) struct
+
+#ifdef __cplusplus
+
+DEFINE_GUID(IID_IUnknown,
+0x00000000, 0x0000, 0x0000, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46);
+struct IUnknown
+{
+ STDMETHOD(QueryInterface) (REFIID iid, void **outObject) PURE;
+ STDMETHOD_(ULONG, AddRef)() PURE;
+ STDMETHOD_(ULONG, Release)() PURE;
+ #ifndef _WIN32
+ virtual ~IUnknown() {}
+ #endif
+};
+
+typedef IUnknown *LPUNKNOWN;
+
+#endif
+
+#define VARIANT_TRUE ((VARIANT_BOOL)-1)
+#define VARIANT_FALSE ((VARIANT_BOOL)0)
+
+enum VARENUM
+{
+ VT_EMPTY = 0,
+ VT_NULL = 1,
+ VT_I2 = 2,
+ VT_I4 = 3,
+ VT_R4 = 4,
+ VT_R8 = 5,
+ VT_CY = 6,
+ VT_DATE = 7,
+ VT_BSTR = 8,
+ VT_DISPATCH = 9,
+ VT_ERROR = 10,
+ VT_BOOL = 11,
+ VT_VARIANT = 12,
+ VT_UNKNOWN = 13,
+ VT_DECIMAL = 14,
+ VT_I1 = 16,
+ VT_UI1 = 17,
+ VT_UI2 = 18,
+ VT_UI4 = 19,
+ VT_I8 = 20,
+ VT_UI8 = 21,
+ VT_INT = 22,
+ VT_UINT = 23,
+ VT_VOID = 24,
+ VT_HRESULT = 25,
+ VT_FILETIME = 64
+};
+
+typedef unsigned short VARTYPE;
+typedef WORD PROPVAR_PAD1;
+typedef WORD PROPVAR_PAD2;
+typedef WORD PROPVAR_PAD3;
+
+typedef struct tagPROPVARIANT
+{
+ VARTYPE vt;
+ PROPVAR_PAD1 wReserved1;
+ PROPVAR_PAD2 wReserved2;
+ PROPVAR_PAD3 wReserved3;
+ union
+ {
+ CHAR cVal;
+ UCHAR bVal;
+ SHORT iVal;
+ USHORT uiVal;
+ LONG lVal;
+ ULONG ulVal;
+ INT intVal;
+ UINT uintVal;
+ LARGE_INTEGER hVal;
+ ULARGE_INTEGER uhVal;
+ VARIANT_BOOL boolVal;
+ SCODE scode;
+ FILETIME filetime;
+ BSTR bstrVal;
+ };
+} PROPVARIANT;
+
+typedef PROPVARIANT tagVARIANT;
+typedef tagVARIANT VARIANT;
+typedef VARIANT VARIANTARG;
+
+MY_EXTERN_C HRESULT VariantClear(VARIANTARG *prop);
+MY_EXTERN_C HRESULT VariantCopy(VARIANTARG *dest, const VARIANTARG *src);
+
+typedef struct tagSTATPROPSTG
+{
+ LPOLESTR lpwstrName;
+ PROPID propid;
+ VARTYPE vt;
+} STATPROPSTG;
+
+MY_EXTERN_C BSTR SysAllocStringByteLen(LPCSTR psz, UINT len);
+MY_EXTERN_C BSTR SysAllocStringLen(const OLECHAR *sz, UINT len);
+MY_EXTERN_C BSTR SysAllocString(const OLECHAR *sz);
+MY_EXTERN_C void SysFreeString(BSTR bstr);
+MY_EXTERN_C UINT SysStringByteLen(BSTR bstr);
+MY_EXTERN_C UINT SysStringLen(BSTR bstr);
+
+MY_EXTERN_C DWORD GetLastError();
+MY_EXTERN_C LONG CompareFileTime(const FILETIME* ft1, const FILETIME* ft2);
+
+#define CP_ACP 0
+#define CP_OEMCP 1
+#define CP_UTF8 65001
+
+typedef enum tagSTREAM_SEEK
+{
+ STREAM_SEEK_SET = 0,
+ STREAM_SEEK_CUR = 1,
+ STREAM_SEEK_END = 2
+} STREAM_SEEK;
+
+#endif
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/NewHandler.cpp b/other-licenses/7zstub/src/CPP/Common/NewHandler.cpp
new file mode 100644
index 0000000000..18d2d1865b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/NewHandler.cpp
@@ -0,0 +1,163 @@
+// NewHandler.cpp
+
+#include "StdAfx.h"
+
+#include <stdlib.h>
+
+#include "NewHandler.h"
+
+// #define DEBUG_MEMORY_LEAK
+
+#ifndef DEBUG_MEMORY_LEAK
+
+#ifdef _7ZIP_REDEFINE_OPERATOR_NEW
+
+/*
+void * my_new(size_t size)
+{
+ // void *p = ::HeapAlloc(::GetProcessHeap(), 0, size);
+ void *p = ::malloc(size);
+ if (p == 0)
+ throw CNewException();
+ return p;
+}
+
+void my_delete(void *p) throw()
+{
+ // if (p == 0) return; ::HeapFree(::GetProcessHeap(), 0, p);
+ ::free(p);
+}
+
+void * my_Realloc(void *p, size_t newSize, size_t oldSize)
+{
+ void *newBuf = my_new(newSize);
+ if (oldSize != 0)
+ memcpy(newBuf, p, oldSize);
+ my_delete(p);
+ return newBuf;
+}
+*/
+
+void *
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator new(size_t size)
+{
+ // void *p = ::HeapAlloc(::GetProcessHeap(), 0, size);
+ void *p = ::malloc(size);
+ if (p == 0)
+ throw CNewException();
+ return p;
+}
+
+void
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator delete(void *p) throw()
+{
+ // if (p == 0) return; ::HeapFree(::GetProcessHeap(), 0, p);
+ ::free(p);
+}
+
+/*
+void *
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator new[](size_t size)
+{
+ // void *p = ::HeapAlloc(::GetProcessHeap(), 0, size);
+ void *p = ::malloc(size);
+ if (p == 0)
+ throw CNewException();
+ return p;
+}
+
+void
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator delete[](void *p) throw()
+{
+ // if (p == 0) return; ::HeapFree(::GetProcessHeap(), 0, p);
+ ::free(p);
+}
+*/
+
+#endif
+
+#else
+
+#include <stdio.h>
+
+// #pragma init_seg(lib)
+const int kDebugSize = 1000000;
+static void *a[kDebugSize];
+static int index = 0;
+
+static int numAllocs = 0;
+void * __cdecl operator new(size_t size)
+{
+ numAllocs++;
+ void *p = HeapAlloc(GetProcessHeap(), 0, size);
+ if (index < kDebugSize)
+ {
+ a[index] = p;
+ index++;
+ }
+ if (p == 0)
+ throw CNewException();
+ printf("Alloc %6d, size = %8u\n", numAllocs, (unsigned)size);
+ return p;
+}
+
+class CC
+{
+public:
+ CC()
+ {
+ for (int i = 0; i < kDebugSize; i++)
+ a[i] = 0;
+ }
+ ~CC()
+ {
+ for (int i = 0; i < kDebugSize; i++)
+ if (a[i] != 0)
+ return;
+ }
+} g_CC;
+
+
+void __cdecl operator delete(void *p)
+{
+ if (p == 0)
+ return;
+ /*
+ for (int i = 0; i < index; i++)
+ if (a[i] == p)
+ a[i] = 0;
+ */
+ HeapFree(GetProcessHeap(), 0, p);
+ numAllocs--;
+ printf("Free %d\n", numAllocs);
+}
+
+#endif
+
+/*
+int MemErrorVC(size_t)
+{
+ throw CNewException();
+ // return 1;
+}
+CNewHandlerSetter::CNewHandlerSetter()
+{
+ // MemErrorOldVCFunction = _set_new_handler(MemErrorVC);
+}
+CNewHandlerSetter::~CNewHandlerSetter()
+{
+ // _set_new_handler(MemErrorOldVCFunction);
+}
+*/
diff --git a/other-licenses/7zstub/src/CPP/Common/NewHandler.h b/other-licenses/7zstub/src/CPP/Common/NewHandler.h
new file mode 100644
index 0000000000..9d20ee1347
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/NewHandler.h
@@ -0,0 +1,88 @@
+// Common/NewHandler.h
+
+#ifndef __COMMON_NEW_HANDLER_H
+#define __COMMON_NEW_HANDLER_H
+
+/*
+NewHandler.h and NewHandler.cpp allows to solve problem with compilers that
+don't throw exception in operator new().
+
+This file must be included before any code that uses operators new() or delete()
+and you must compile and link "NewHandler.cpp", if you use some old MSVC compiler.
+
+The operator new() in some MSVC versions doesn't throw exception std::bad_alloc.
+MSVC 6.0 (_MSC_VER == 1200) doesn't throw exception.
+The code produced by some another MSVC compilers also can be linked
+to library that doesn't throw exception.
+We suppose that code compiled with VS2015+ (_MSC_VER >= 1900) throws exception std::bad_alloc.
+For older _MSC_VER versions we redefine operator new() and operator delete().
+Our version of operator new() throws CNewException() exception on failure.
+
+It's still allowed to use redefined version of operator new() from "NewHandler.cpp"
+with any compiler. 7-Zip's code can work with std::bad_alloc and CNewException() exceptions.
+But if you use some additional code (outside of 7-Zip's code), you must check
+that redefined version of operator new() is not problem for your code.
+*/
+
+#include <stddef.h>
+
+#ifdef _WIN32
+// We can compile my_new and my_delete with _fastcall
+/*
+void * my_new(size_t size);
+void my_delete(void *p) throw();
+// void * my_Realloc(void *p, size_t newSize, size_t oldSize);
+*/
+#endif
+
+
+#if defined(_MSC_VER) && (_MSC_VER < 1900)
+ // If you want to use default operator new(), you can disable the following line
+ #define _7ZIP_REDEFINE_OPERATOR_NEW
+#endif
+
+
+#ifdef _7ZIP_REDEFINE_OPERATOR_NEW
+
+// std::bad_alloc can require additional DLL dependency.
+// So we don't define CNewException as std::bad_alloc here.
+
+class CNewException {};
+
+void *
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator new(size_t size);
+
+void
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator delete(void *p) throw();
+
+#else
+
+#include <new>
+
+#define CNewException std::bad_alloc
+
+#endif
+
+/*
+#ifdef _WIN32
+void *
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator new[](size_t size);
+
+void
+#ifdef _MSC_VER
+__cdecl
+#endif
+operator delete[](void *p) throw();
+#endif
+*/
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/Sha256Reg.cpp b/other-licenses/7zstub/src/CPP/Common/Sha256Reg.cpp
new file mode 100644
index 0000000000..14a3652377
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/Sha256Reg.cpp
@@ -0,0 +1,40 @@
+// Sha256Reg.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/Sha256.h"
+
+#include "../Common/MyCom.h"
+
+#include "../7zip/Common/RegisterCodec.h"
+
+class CSha256Hasher:
+ public IHasher,
+ public CMyUnknownImp
+{
+ CSha256 _sha;
+ Byte mtDummy[1 << 7];
+
+public:
+ CSha256Hasher() { Sha256_Init(&_sha); }
+
+ MY_UNKNOWN_IMP1(IHasher)
+ INTERFACE_IHasher(;)
+};
+
+STDMETHODIMP_(void) CSha256Hasher::Init() throw()
+{
+ Sha256_Init(&_sha);
+}
+
+STDMETHODIMP_(void) CSha256Hasher::Update(const void *data, UInt32 size) throw()
+{
+ Sha256_Update(&_sha, (const Byte *)data, size);
+}
+
+STDMETHODIMP_(void) CSha256Hasher::Final(Byte *digest) throw()
+{
+ Sha256_Final(&_sha, digest);
+}
+
+REGISTER_HASHER(CSha256Hasher, 0xA, "SHA256", SHA256_DIGEST_SIZE)
diff --git a/other-licenses/7zstub/src/CPP/Common/StdAfx.h b/other-licenses/7zstub/src/CPP/Common/StdAfx.h
new file mode 100644
index 0000000000..3f1890a278
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/StdInStream.cpp b/other-licenses/7zstub/src/CPP/Common/StdInStream.cpp
new file mode 100644
index 0000000000..f547b54fb5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StdInStream.cpp
@@ -0,0 +1,89 @@
+// Common/StdInStream.cpp
+
+#include "StdAfx.h"
+
+#include <tchar.h>
+
+#include "StdInStream.h"
+#include "StringConvert.h"
+#include "UTFConvert.h"
+
+// #define kEOFMessage "Unexpected end of input stream"
+// #define kReadErrorMessage "Error reading input stream"
+// #define kIllegalCharMessage "Illegal zero character in input stream"
+
+#define kFileOpenMode TEXT("r")
+
+extern int g_CodePage;
+
+CStdInStream g_StdIn(stdin);
+
+bool CStdInStream::Open(LPCTSTR fileName) throw()
+{
+ Close();
+ _stream = _tfopen(fileName, kFileOpenMode);
+ _streamIsOpen = (_stream != 0);
+ return _streamIsOpen;
+}
+
+bool CStdInStream::Close() throw()
+{
+ if (!_streamIsOpen)
+ return true;
+ _streamIsOpen = (fclose(_stream) != 0);
+ return !_streamIsOpen;
+}
+
+bool CStdInStream::ScanAStringUntilNewLine(AString &s)
+{
+ s.Empty();
+ for (;;)
+ {
+ int intChar = GetChar();
+ if (intChar == EOF)
+ return true;
+ char c = (char)intChar;
+ if (c == 0)
+ return false;
+ if (c == '\n')
+ return true;
+ s += c;
+ }
+}
+
+bool CStdInStream::ScanUStringUntilNewLine(UString &dest)
+{
+ dest.Empty();
+ AString s;
+ bool res = ScanAStringUntilNewLine(s);
+ int codePage = g_CodePage;
+ if (codePage == -1)
+ codePage = CP_OEMCP;
+ if (codePage == CP_UTF8)
+ ConvertUTF8ToUnicode(s, dest);
+ else
+ MultiByteToUnicodeString2(dest, s, (UINT)codePage);
+ return res;
+}
+
+/*
+bool CStdInStream::ReadToString(AString &resultString)
+{
+ resultString.Empty();
+ for (;;)
+ {
+ int intChar = GetChar();
+ if (intChar == EOF)
+ return !Error();
+ char c = (char)intChar;
+ if (c == 0)
+ return false;
+ resultString += c;
+ }
+}
+*/
+
+int CStdInStream::GetChar()
+{
+ return fgetc(_stream); // getc() doesn't work in BeOS?
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/StdInStream.h b/other-licenses/7zstub/src/CPP/Common/StdInStream.h
new file mode 100644
index 0000000000..20f9ce3436
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StdInStream.h
@@ -0,0 +1,38 @@
+// Common/StdInStream.h
+
+#ifndef __COMMON_STD_IN_STREAM_H
+#define __COMMON_STD_IN_STREAM_H
+
+#include <stdio.h>
+
+#include "MyString.h"
+#include "MyTypes.h"
+
+class CStdInStream
+{
+ FILE *_stream;
+ bool _streamIsOpen;
+public:
+ CStdInStream(): _stream(0), _streamIsOpen(false) {};
+ CStdInStream(FILE *stream): _stream(stream), _streamIsOpen(false) {};
+ ~CStdInStream() { Close(); }
+
+ bool Open(LPCTSTR fileName) throw();
+ bool Close() throw();
+
+ // returns:
+ // false, if ZERO character in stream
+ // true, if EOF or '\n'
+ bool ScanAStringUntilNewLine(AString &s);
+ bool ScanUStringUntilNewLine(UString &s);
+ // bool ReadToString(AString &resultString);
+
+ bool Eof() const throw() { return (feof(_stream) != 0); }
+ bool Error() const throw() { return (ferror(_stream) != 0); }
+
+ int GetChar();
+};
+
+extern CStdInStream g_StdIn;
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/StdOutStream.cpp b/other-licenses/7zstub/src/CPP/Common/StdOutStream.cpp
new file mode 100644
index 0000000000..dc6d4bd4a9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StdOutStream.cpp
@@ -0,0 +1,163 @@
+// Common/StdOutStream.cpp
+
+#include "StdAfx.h"
+
+#include <tchar.h>
+
+#include "IntToString.h"
+#include "StdOutStream.h"
+#include "StringConvert.h"
+#include "UTFConvert.h"
+
+#define kFileOpenMode "wt"
+
+extern int g_CodePage;
+
+CStdOutStream g_StdOut(stdout);
+CStdOutStream g_StdErr(stderr);
+
+bool CStdOutStream::Open(const char *fileName) throw()
+{
+ Close();
+ _stream = fopen(fileName, kFileOpenMode);
+ _streamIsOpen = (_stream != 0);
+ return _streamIsOpen;
+}
+
+bool CStdOutStream::Close() throw()
+{
+ if (!_streamIsOpen)
+ return true;
+ if (fclose(_stream) != 0)
+ return false;
+ _stream = 0;
+ _streamIsOpen = false;
+ return true;
+}
+
+bool CStdOutStream::Flush() throw()
+{
+ return (fflush(_stream) == 0);
+}
+
+CStdOutStream & endl(CStdOutStream & outStream) throw()
+{
+ return outStream << '\n';
+}
+
+CStdOutStream & CStdOutStream::operator<<(const wchar_t *s)
+{
+ int codePage = g_CodePage;
+ if (codePage == -1)
+ codePage = CP_OEMCP;
+ AString dest;
+ if (codePage == CP_UTF8)
+ ConvertUnicodeToUTF8(s, dest);
+ else
+ UnicodeStringToMultiByte2(dest, s, (UINT)codePage);
+ return operator<<((const char *)dest);
+}
+
+void StdOut_Convert_UString_to_AString(const UString &s, AString &temp)
+{
+ int codePage = g_CodePage;
+ if (codePage == -1)
+ codePage = CP_OEMCP;
+ if (codePage == CP_UTF8)
+ ConvertUnicodeToUTF8(s, temp);
+ else
+ UnicodeStringToMultiByte2(temp, s, (UINT)codePage);
+}
+
+void CStdOutStream::PrintUString(const UString &s, AString &temp)
+{
+ StdOut_Convert_UString_to_AString(s, temp);
+ *this << (const char *)temp;
+}
+
+
+static const wchar_t kReplaceChar = '_';
+
+void CStdOutStream::Normalize_UString__LF_Allowed(UString &s)
+{
+ unsigned len = s.Len();
+ wchar_t *d = s.GetBuf();
+
+ if (IsTerminalMode)
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = d[i];
+ if (c <= 13 && c >= 7 && c != '\n')
+ d[i] = kReplaceChar;
+ }
+}
+
+void CStdOutStream::Normalize_UString(UString &s)
+{
+ unsigned len = s.Len();
+ wchar_t *d = s.GetBuf();
+
+ if (IsTerminalMode)
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = d[i];
+ if (c <= 13 && c >= 7)
+ d[i] = kReplaceChar;
+ }
+ else
+ for (unsigned i = 0; i < len; i++)
+ {
+ wchar_t c = d[i];
+ if (c == '\n')
+ d[i] = kReplaceChar;
+ }
+}
+
+void CStdOutStream::NormalizePrint_UString(const UString &s, UString &tempU, AString &tempA)
+{
+ tempU = s;
+ Normalize_UString(tempU);
+ PrintUString(tempU, tempA);
+}
+
+void CStdOutStream::NormalizePrint_UString(const UString &s)
+{
+ NormalizePrint_wstr(s);
+}
+
+void CStdOutStream::NormalizePrint_wstr(const wchar_t *s)
+{
+ UString tempU = s;
+ Normalize_UString(tempU);
+ AString tempA;
+ PrintUString(tempU, tempA);
+}
+
+
+CStdOutStream & CStdOutStream::operator<<(Int32 number) throw()
+{
+ char s[32];
+ ConvertInt64ToString(number, s);
+ return operator<<(s);
+}
+
+CStdOutStream & CStdOutStream::operator<<(Int64 number) throw()
+{
+ char s[32];
+ ConvertInt64ToString(number, s);
+ return operator<<(s);
+}
+
+CStdOutStream & CStdOutStream::operator<<(UInt32 number) throw()
+{
+ char s[16];
+ ConvertUInt32ToString(number, s);
+ return operator<<(s);
+}
+
+CStdOutStream & CStdOutStream::operator<<(UInt64 number) throw()
+{
+ char s[32];
+ ConvertUInt64ToString(number, s);
+ return operator<<(s);
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/StdOutStream.h b/other-licenses/7zstub/src/CPP/Common/StdOutStream.h
new file mode 100644
index 0000000000..475954c069
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StdOutStream.h
@@ -0,0 +1,71 @@
+// Common/StdOutStream.h
+
+#ifndef __COMMON_STD_OUT_STREAM_H
+#define __COMMON_STD_OUT_STREAM_H
+
+#include <stdio.h>
+
+#include "MyString.h"
+#include "MyTypes.h"
+
+class CStdOutStream
+{
+ FILE *_stream;
+ bool _streamIsOpen;
+public:
+ bool IsTerminalMode;
+
+ CStdOutStream(): _stream(0), _streamIsOpen(false), IsTerminalMode(false) {};
+ CStdOutStream(FILE *stream): _stream(stream), _streamIsOpen(false) {};
+ ~CStdOutStream() { Close(); }
+
+ // void AttachStdStream(FILE *stream) { _stream = stream; _streamIsOpen = false; }
+ // bool IsDefined() const { return _stream != NULL; }
+
+ operator FILE *() { return _stream; }
+ bool Open(const char *fileName) throw();
+ bool Close() throw();
+ bool Flush() throw();
+
+ CStdOutStream & operator<<(CStdOutStream & (* func)(CStdOutStream &))
+ {
+ (*func)(*this);
+ return *this;
+ }
+
+ CStdOutStream & operator<<(const char *s) throw()
+ {
+ fputs(s, _stream);
+ return *this;
+ }
+
+ CStdOutStream & operator<<(char c) throw()
+ {
+ fputc((unsigned char)c, _stream);
+ return *this;
+ }
+
+ CStdOutStream & operator<<(Int32 number) throw();
+ CStdOutStream & operator<<(Int64 number) throw();
+ CStdOutStream & operator<<(UInt32 number) throw();
+ CStdOutStream & operator<<(UInt64 number) throw();
+
+ CStdOutStream & operator<<(const wchar_t *s);
+ void PrintUString(const UString &s, AString &temp);
+
+ void Normalize_UString__LF_Allowed(UString &s);
+ void Normalize_UString(UString &s);
+
+ void NormalizePrint_UString(const UString &s, UString &tempU, AString &tempA);
+ void NormalizePrint_UString(const UString &s);
+ void NormalizePrint_wstr(const wchar_t *s);
+};
+
+CStdOutStream & endl(CStdOutStream & outStream) throw();
+
+extern CStdOutStream g_StdOut;
+extern CStdOutStream g_StdErr;
+
+void StdOut_Convert_UString_to_AString(const UString &s, AString &temp);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/StringConvert.cpp b/other-licenses/7zstub/src/CPP/Common/StringConvert.cpp
new file mode 100644
index 0000000000..b8f33cd63a
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StringConvert.cpp
@@ -0,0 +1,319 @@
+// Common/StringConvert.cpp
+
+#include "StdAfx.h"
+
+#include "StringConvert.h"
+
+#ifndef _WIN32
+#include <stdlib.h>
+#endif
+
+static const char k_DefultChar = '_';
+
+#ifdef _WIN32
+
+/*
+MultiByteToWideChar(CodePage, DWORD dwFlags,
+ LPCSTR lpMultiByteStr, int cbMultiByte,
+ LPWSTR lpWideCharStr, int cchWideChar)
+
+ if (cbMultiByte == 0)
+ return: 0. ERR: ERROR_INVALID_PARAMETER
+
+ if (cchWideChar == 0)
+ return: the required buffer size in characters.
+
+ if (supplied buffer size was not large enough)
+ return: 0. ERR: ERROR_INSUFFICIENT_BUFFER
+ The number of filled characters in lpWideCharStr can be smaller than cchWideChar (if last character is complex)
+
+ If there are illegal characters:
+ if MB_ERR_INVALID_CHARS is set in dwFlags:
+ - the function stops conversion on illegal character.
+ - Return: 0. ERR: ERROR_NO_UNICODE_TRANSLATION.
+
+ if MB_ERR_INVALID_CHARS is NOT set in dwFlags:
+ before Vista: illegal character is dropped (skipped). WinXP-64: GetLastError() returns 0.
+ in Vista+: illegal character is not dropped (MSDN). Undocumented: illegal
+ character is converted to U+FFFD, which is REPLACEMENT CHARACTER.
+*/
+
+
+void MultiByteToUnicodeString2(UString &dest, const AString &src, UINT codePage)
+{
+ dest.Empty();
+ if (src.IsEmpty())
+ return;
+ {
+ /*
+ wchar_t *d = dest.GetBuf(src.Len());
+ const char *s = (const char *)src;
+ unsigned i;
+
+ for (i = 0;;)
+ {
+ Byte c = (Byte)s[i];
+ if (c >= 0x80 || c == 0)
+ break;
+ d[i++] = (wchar_t)c;
+ }
+
+ if (i != src.Len())
+ {
+ unsigned len = MultiByteToWideChar(codePage, 0, s + i,
+ src.Len() - i, d + i,
+ src.Len() + 1 - i);
+ if (len == 0)
+ throw 282228;
+ i += len;
+ }
+
+ d[i] = 0;
+ dest.ReleaseBuf_SetLen(i);
+ */
+ unsigned len = MultiByteToWideChar(codePage, 0, src, src.Len(), NULL, 0);
+ if (len == 0)
+ {
+ if (GetLastError() != 0)
+ throw 282228;
+ }
+ else
+ {
+ len = MultiByteToWideChar(codePage, 0, src, src.Len(), dest.GetBuf(len), len);
+ if (len == 0)
+ throw 282228;
+ dest.ReleaseBuf_SetEnd(len);
+ }
+ }
+}
+
+/*
+ int WideCharToMultiByte(
+ UINT CodePage, DWORD dwFlags,
+ LPCWSTR lpWideCharStr, int cchWideChar,
+ LPSTR lpMultiByteStr, int cbMultiByte,
+ LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar);
+
+if (lpDefaultChar == NULL),
+ - it uses system default value.
+
+if (CodePage == CP_UTF7 || CodePage == CP_UTF8)
+ if (lpDefaultChar != NULL || lpUsedDefaultChar != NULL)
+ return: 0. ERR: ERROR_INVALID_PARAMETER.
+
+The function operates most efficiently, if (lpDefaultChar == NULL && lpUsedDefaultChar == NULL)
+
+*/
+
+static void UnicodeStringToMultiByte2(AString &dest, const UString &src, UINT codePage, char defaultChar, bool &defaultCharWasUsed)
+{
+ dest.Empty();
+ defaultCharWasUsed = false;
+ if (src.IsEmpty())
+ return;
+ {
+ /*
+ unsigned numRequiredBytes = src.Len() * 2;
+ char *d = dest.GetBuf(numRequiredBytes);
+ const wchar_t *s = (const wchar_t *)src;
+ unsigned i;
+
+ for (i = 0;;)
+ {
+ wchar_t c = s[i];
+ if (c >= 0x80 || c == 0)
+ break;
+ d[i++] = (char)c;
+ }
+
+ if (i != src.Len())
+ {
+ BOOL defUsed = FALSE;
+ defaultChar = defaultChar;
+
+ bool isUtf = (codePage == CP_UTF8 || codePage == CP_UTF7);
+ unsigned len = WideCharToMultiByte(codePage, 0, s + i, src.Len() - i,
+ d + i, numRequiredBytes + 1 - i,
+ (isUtf ? NULL : &defaultChar),
+ (isUtf ? NULL : &defUsed));
+ defaultCharWasUsed = (defUsed != FALSE);
+ if (len == 0)
+ throw 282229;
+ i += len;
+ }
+
+ d[i] = 0;
+ dest.ReleaseBuf_SetLen(i);
+ */
+
+ /*
+ if (codePage != CP_UTF7)
+ {
+ const wchar_t *s = (const wchar_t *)src;
+ unsigned i;
+ for (i = 0;; i++)
+ {
+ wchar_t c = s[i];
+ if (c >= 0x80 || c == 0)
+ break;
+ }
+
+ if (s[i] == 0)
+ {
+ char *d = dest.GetBuf(src.Len());
+ for (i = 0;;)
+ {
+ wchar_t c = s[i];
+ if (c == 0)
+ break;
+ d[i++] = (char)c;
+ }
+ d[i] = 0;
+ dest.ReleaseBuf_SetLen(i);
+ return;
+ }
+ }
+ */
+
+ unsigned len = WideCharToMultiByte(codePage, 0, src, src.Len(), NULL, 0, NULL, NULL);
+ if (len == 0)
+ {
+ if (GetLastError() != 0)
+ throw 282228;
+ }
+ else
+ {
+ BOOL defUsed = FALSE;
+ bool isUtf = (codePage == CP_UTF8 || codePage == CP_UTF7);
+ // defaultChar = defaultChar;
+ len = WideCharToMultiByte(codePage, 0, src, src.Len(),
+ dest.GetBuf(len), len,
+ (isUtf ? NULL : &defaultChar),
+ (isUtf ? NULL : &defUsed)
+ );
+ if (!isUtf)
+ defaultCharWasUsed = (defUsed != FALSE);
+ if (len == 0)
+ throw 282228;
+ dest.ReleaseBuf_SetEnd(len);
+ }
+ }
+}
+
+/*
+#ifndef UNDER_CE
+AString SystemStringToOemString(const CSysString &src)
+{
+ AString dest;
+ const unsigned len = src.Len() * 2;
+ CharToOem(src, dest.GetBuf(len));
+ dest.ReleaseBuf_CalcLen(len);
+ return dest;
+}
+#endif
+*/
+
+#else
+
+void MultiByteToUnicodeString2(UString &dest, const AString &src, UINT /* codePage */)
+{
+ dest.Empty();
+ if (src.IsEmpty())
+ return;
+
+ size_t limit = ((size_t)src.Len() + 1) * 2;
+ wchar_t *d = dest.GetBuf((unsigned)limit);
+ size_t len = mbstowcs(d, src, limit);
+ if (len != (size_t)-1)
+ {
+ dest.ReleaseBuf_SetEnd((unsigned)len);
+ return;
+ }
+
+ {
+ unsigned i;
+ const char *s = (const char *)src;
+ for (i = 0;;)
+ {
+ Byte c = (Byte)s[i];
+ if (c == 0)
+ break;
+ d[i++] = (wchar_t)c;
+ }
+ d[i] = 0;
+ dest.ReleaseBuf_SetLen(i);
+ }
+}
+
+static void UnicodeStringToMultiByte2(AString &dest, const UString &src, UINT /* codePage */, char defaultChar, bool &defaultCharWasUsed)
+{
+ dest.Empty();
+ defaultCharWasUsed = false;
+ if (src.IsEmpty())
+ return;
+
+ size_t limit = ((size_t)src.Len() + 1) * 6;
+ char *d = dest.GetBuf((unsigned)limit);
+ size_t len = wcstombs(d, src, limit);
+ if (len != (size_t)-1)
+ {
+ dest.ReleaseBuf_SetEnd((unsigned)len);
+ return;
+ }
+
+ {
+ const wchar_t *s = (const wchar_t *)src;
+ unsigned i;
+ for (i = 0;;)
+ {
+ wchar_t c = s[i];
+ if (c == 0)
+ break;
+ if (c >= 0x100)
+ {
+ c = defaultChar;
+ defaultCharWasUsed = true;
+ }
+ d[i++] = (char)c;
+ }
+ d[i] = 0;
+ dest.ReleaseBuf_SetLen(i);
+ }
+}
+
+#endif
+
+
+UString MultiByteToUnicodeString(const AString &src, UINT codePage)
+{
+ UString dest;
+ MultiByteToUnicodeString2(dest, src, codePage);
+ return dest;
+}
+
+UString MultiByteToUnicodeString(const char *src, UINT codePage)
+{
+ return MultiByteToUnicodeString(AString(src), codePage);
+}
+
+
+void UnicodeStringToMultiByte2(AString &dest, const UString &src, UINT codePage)
+{
+ bool defaultCharWasUsed;
+ UnicodeStringToMultiByte2(dest, src, codePage, k_DefultChar, defaultCharWasUsed);
+}
+
+AString UnicodeStringToMultiByte(const UString &src, UINT codePage, char defaultChar, bool &defaultCharWasUsed)
+{
+ AString dest;
+ UnicodeStringToMultiByte2(dest, src, codePage, defaultChar, defaultCharWasUsed);
+ return dest;
+}
+
+AString UnicodeStringToMultiByte(const UString &src, UINT codePage)
+{
+ AString dest;
+ bool defaultCharWasUsed;
+ UnicodeStringToMultiByte2(dest, src, codePage, k_DefultChar, defaultCharWasUsed);
+ return dest;
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/StringConvert.h b/other-licenses/7zstub/src/CPP/Common/StringConvert.h
new file mode 100644
index 0000000000..05a21556d4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StringConvert.h
@@ -0,0 +1,88 @@
+// Common/StringConvert.h
+
+#ifndef __COMMON_STRING_CONVERT_H
+#define __COMMON_STRING_CONVERT_H
+
+#include "MyString.h"
+#include "MyWindows.h"
+
+UString MultiByteToUnicodeString(const AString &src, UINT codePage = CP_ACP);
+UString MultiByteToUnicodeString(const char *src, UINT codePage = CP_ACP);
+
+// optimized versions that work faster for ASCII strings
+void MultiByteToUnicodeString2(UString &dest, const AString &src, UINT codePage = CP_ACP);
+// void UnicodeStringToMultiByte2(AString &dest, const UString &s, UINT codePage, char defaultChar, bool &defaultCharWasUsed);
+void UnicodeStringToMultiByte2(AString &dest, const UString &src, UINT codePage);
+
+AString UnicodeStringToMultiByte(const UString &src, UINT codePage, char defaultChar, bool &defaultCharWasUsed);
+AString UnicodeStringToMultiByte(const UString &src, UINT codePage = CP_ACP);
+
+inline const wchar_t* GetUnicodeString(const wchar_t *u) { return u; }
+inline const UString& GetUnicodeString(const UString &u) { return u; }
+
+inline UString GetUnicodeString(const AString &a) { return MultiByteToUnicodeString(a); }
+inline UString GetUnicodeString(const char *a) { return MultiByteToUnicodeString(a); }
+
+inline UString GetUnicodeString(const AString &a, UINT codePage)
+ { return MultiByteToUnicodeString(a, codePage); }
+inline UString GetUnicodeString(const char *a, UINT codePage)
+ { return MultiByteToUnicodeString(a, codePage); }
+
+inline const wchar_t* GetUnicodeString(const wchar_t *u, UINT) { return u; }
+inline const UString& GetUnicodeString(const UString &u, UINT) { return u; }
+
+inline const char* GetAnsiString(const char *a) { return a; }
+inline const AString& GetAnsiString(const AString &a) { return a; }
+
+inline AString GetAnsiString(const wchar_t *u) { return UnicodeStringToMultiByte(UString(u)); }
+inline AString GetAnsiString(const UString &u) { return UnicodeStringToMultiByte(u); }
+
+/*
+inline const char* GetOemString(const char* oem)
+ { return oem; }
+inline const AString& GetOemString(const AString &oem)
+ { return oem; }
+*/
+const char* GetOemString(const char* oem);
+const AString& GetOemString(const AString &oem);
+inline AString GetOemString(const UString &u)
+ { return UnicodeStringToMultiByte(u, CP_OEMCP); }
+
+#ifdef _UNICODE
+ inline const wchar_t* GetSystemString(const wchar_t *u) { return u;}
+ inline const UString& GetSystemString(const UString &u) { return u;}
+ inline const wchar_t* GetSystemString(const wchar_t *u, UINT /* codePage */) { return u;}
+ inline const UString& GetSystemString(const UString &u, UINT /* codePage */) { return u;}
+
+ inline UString GetSystemString(const AString &a, UINT codePage) { return MultiByteToUnicodeString(a, codePage); }
+ inline UString GetSystemString(const char *a, UINT codePage) { return MultiByteToUnicodeString(a, codePage); }
+ inline UString GetSystemString(const AString &a) { return MultiByteToUnicodeString(a); }
+ inline UString GetSystemString(const char *a) { return MultiByteToUnicodeString(a); }
+#else
+ inline const char* GetSystemString(const char *a) { return a; }
+ inline const AString& GetSystemString(const AString &a) { return a; }
+ inline const char* GetSystemString(const char *a, UINT) { return a; }
+ inline const AString& GetSystemString(const AString &a, UINT) { return a; }
+
+ inline AString GetSystemString(const wchar_t *u) { return UnicodeStringToMultiByte(UString(u)); }
+ inline AString GetSystemString(const UString &u) { return UnicodeStringToMultiByte(u); }
+ inline AString GetSystemString(const UString &u, UINT codePage) { return UnicodeStringToMultiByte(u, codePage); }
+
+
+
+ /*
+ inline AString GetSystemString(const wchar_t *u)
+ {
+ UString s;
+ s = u;
+ return UnicodeStringToMultiByte(s);
+ }
+ */
+
+#endif
+
+#ifndef UNDER_CE
+AString SystemStringToOemString(const CSysString &src);
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/StringToInt.cpp b/other-licenses/7zstub/src/CPP/Common/StringToInt.cpp
new file mode 100644
index 0000000000..295816e16f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StringToInt.cpp
@@ -0,0 +1,144 @@
+// Common/StringToInt.cpp
+
+#include "StdAfx.h"
+
+#include "StringToInt.h"
+
+static const UInt32 k_UInt32_max = 0xFFFFFFFF;
+static const UInt64 k_UInt64_max = UINT64_CONST(0xFFFFFFFFFFFFFFFF);
+// static const UInt64 k_UInt64_max = (UInt64)(Int64)-1;
+
+#define CONVERT_STRING_TO_UINT_FUNC(uintType, charType, charTypeUnsigned) \
+ uintType ConvertStringTo ## uintType(const charType *s, const charType **end) throw() { \
+ if (end) *end = s; \
+ uintType res = 0; \
+ for (;; s++) { \
+ charTypeUnsigned c = (charTypeUnsigned)*s; \
+ if (c < '0' || c > '9') { if (end) *end = s; return res; } \
+ if (res > (k_ ## uintType ## _max) / 10) return 0; \
+ res *= 10; \
+ unsigned v = (c - '0'); \
+ if (res > (k_ ## uintType ## _max) - v) return 0; \
+ res += v; }}
+
+CONVERT_STRING_TO_UINT_FUNC(UInt32, char, Byte)
+CONVERT_STRING_TO_UINT_FUNC(UInt32, wchar_t, wchar_t)
+CONVERT_STRING_TO_UINT_FUNC(UInt64, char, Byte)
+CONVERT_STRING_TO_UINT_FUNC(UInt64, wchar_t, wchar_t)
+
+Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) throw()
+{
+ if (end)
+ *end = s;
+ const wchar_t *s2 = s;
+ if (*s == '-')
+ s2++;
+ if (*s2 == 0)
+ return 0;
+ const wchar_t *end2;
+ UInt32 res = ConvertStringToUInt32(s2, &end2);
+ if (*s == '-')
+ {
+ if (res > ((UInt32)1 << (32 - 1)))
+ return 0;
+ }
+ else if ((res & ((UInt32)1 << (32 - 1))) != 0)
+ return 0;
+ if (end)
+ *end = end2;
+ if (*s == '-')
+ return -(Int32)res;
+ return (Int32)res;
+}
+
+UInt32 ConvertOctStringToUInt32(const char *s, const char **end) throw()
+{
+ if (end)
+ *end = s;
+ UInt32 res = 0;
+ for (;; s++)
+ {
+ unsigned c = (unsigned char)*s;
+ if (c < '0' || c > '7')
+ {
+ if (end)
+ *end = s;
+ return res;
+ }
+ if ((res & (UInt32)7 << (32 - 3)) != 0)
+ return 0;
+ res <<= 3;
+ res |= (unsigned)(c - '0');
+ }
+}
+
+UInt64 ConvertOctStringToUInt64(const char *s, const char **end) throw()
+{
+ if (end)
+ *end = s;
+ UInt64 res = 0;
+ for (;; s++)
+ {
+ unsigned c = (unsigned char)*s;
+ if (c < '0' || c > '7')
+ {
+ if (end)
+ *end = s;
+ return res;
+ }
+ if ((res & (UInt64)7 << (64 - 3)) != 0)
+ return 0;
+ res <<= 3;
+ res |= (unsigned)(c - '0');
+ }
+}
+
+UInt32 ConvertHexStringToUInt32(const char *s, const char **end) throw()
+{
+ if (end)
+ *end = s;
+ UInt32 res = 0;
+ for (;; s++)
+ {
+ unsigned c = (Byte)*s;
+ unsigned v;
+ if (c >= '0' && c <= '9') v = (c - '0');
+ else if (c >= 'A' && c <= 'F') v = 10 + (c - 'A');
+ else if (c >= 'a' && c <= 'f') v = 10 + (c - 'a');
+ else
+ {
+ if (end)
+ *end = s;
+ return res;
+ }
+ if ((res & (UInt32)0xF << (32 - 4)) != 0)
+ return 0;
+ res <<= 4;
+ res |= v;
+ }
+}
+
+UInt64 ConvertHexStringToUInt64(const char *s, const char **end) throw()
+{
+ if (end)
+ *end = s;
+ UInt64 res = 0;
+ for (;; s++)
+ {
+ unsigned c = (Byte)*s;
+ unsigned v;
+ if (c >= '0' && c <= '9') v = (c - '0');
+ else if (c >= 'A' && c <= 'F') v = 10 + (c - 'A');
+ else if (c >= 'a' && c <= 'f') v = 10 + (c - 'a');
+ else
+ {
+ if (end)
+ *end = s;
+ return res;
+ }
+ if ((res & (UInt64)0xF << (64 - 4)) != 0)
+ return 0;
+ res <<= 4;
+ res |= v;
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/StringToInt.h b/other-licenses/7zstub/src/CPP/Common/StringToInt.h
new file mode 100644
index 0000000000..140d1ee2dd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/StringToInt.h
@@ -0,0 +1,21 @@
+// Common/StringToInt.h
+
+#ifndef __COMMON_STRING_TO_INT_H
+#define __COMMON_STRING_TO_INT_H
+
+#include "MyTypes.h"
+
+UInt32 ConvertStringToUInt32(const char *s, const char **end) throw();
+UInt64 ConvertStringToUInt64(const char *s, const char **end) throw();
+UInt32 ConvertStringToUInt32(const wchar_t *s, const wchar_t **end) throw();
+UInt64 ConvertStringToUInt64(const wchar_t *s, const wchar_t **end) throw();
+
+Int32 ConvertStringToInt32(const wchar_t *s, const wchar_t **end) throw();
+
+UInt32 ConvertOctStringToUInt32(const char *s, const char **end) throw();
+UInt64 ConvertOctStringToUInt64(const char *s, const char **end) throw();
+
+UInt32 ConvertHexStringToUInt32(const char *s, const char **end) throw();
+UInt64 ConvertHexStringToUInt64(const char *s, const char **end) throw();
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/TextConfig.cpp b/other-licenses/7zstub/src/CPP/Common/TextConfig.cpp
new file mode 100644
index 0000000000..f54aa3f6d4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/TextConfig.cpp
@@ -0,0 +1,124 @@
+// Common/TextConfig.cpp
+
+#include "StdAfx.h"
+
+#include "TextConfig.h"
+#include "UTFConvert.h"
+
+static inline bool IsDelimitChar(char c)
+{
+ return (c == ' ' || c == 0x0A || c == 0x0D || c == '\0' || c == '\t');
+}
+
+static AString GetIDString(const char *s, unsigned &finishPos)
+{
+ AString result;
+ for (finishPos = 0; ; finishPos++)
+ {
+ char c = s[finishPos];
+ if (IsDelimitChar(c) || c == '=')
+ break;
+ result += c;
+ }
+ return result;
+}
+
+static bool WaitNextLine(const AString &s, unsigned &pos)
+{
+ for (; pos < s.Len(); pos++)
+ if (s[pos] == 0x0A)
+ return true;
+ return false;
+}
+
+static bool SkipSpaces(const AString &s, unsigned &pos)
+{
+ for (; pos < s.Len(); pos++)
+ {
+ char c = s[pos];
+ if (!IsDelimitChar(c))
+ {
+ if (c != ';')
+ return true;
+ if (!WaitNextLine(s, pos))
+ return false;
+ }
+ }
+ return false;
+}
+
+bool GetTextConfig(const AString &s, CObjectVector<CTextConfigPair> &pairs)
+{
+ pairs.Clear();
+ unsigned pos = 0;
+
+ /////////////////////
+ // read strings
+
+ for (;;)
+ {
+ if (!SkipSpaces(s, pos))
+ break;
+ CTextConfigPair pair;
+ unsigned finishPos;
+ const AString temp (GetIDString(((const char *)s) + pos, finishPos));
+ if (!ConvertUTF8ToUnicode(temp, pair.ID))
+ return false;
+ if (finishPos == 0)
+ return false;
+ pos += finishPos;
+ if (!SkipSpaces(s, pos))
+ return false;
+ if (s[pos] != '=')
+ return false;
+ pos++;
+ if (!SkipSpaces(s, pos))
+ return false;
+ if (s[pos] != '\"')
+ return false;
+ pos++;
+ AString message;
+ for (;;)
+ {
+ if (pos >= s.Len())
+ return false;
+ char c = s[pos++];
+ if (c == '\"')
+ break;
+ if (c == '\\')
+ {
+ c = s[pos++];
+ switch (c)
+ {
+ case 'n': message += '\n'; break;
+ case 't': message += '\t'; break;
+ case '\\': message += '\\'; break;
+ case '\"': message += '\"'; break;
+ default: message += '\\'; message += c; break;
+ }
+ }
+ else
+ message += c;
+ }
+ if (!ConvertUTF8ToUnicode(message, pair.String))
+ return false;
+ pairs.Add(pair);
+ }
+ return true;
+}
+
+int FindTextConfigItem(const CObjectVector<CTextConfigPair> &pairs, const char *id) throw()
+{
+ FOR_VECTOR (i, pairs)
+ if (pairs[i].ID.IsEqualTo(id))
+ return i;
+ return -1;
+}
+
+UString GetTextConfigValue(const CObjectVector<CTextConfigPair> &pairs, const char *id)
+{
+ int index = FindTextConfigItem(pairs, id);
+ if (index < 0)
+ return UString();
+ return pairs[index].String;
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/TextConfig.h b/other-licenses/7zstub/src/CPP/Common/TextConfig.h
new file mode 100644
index 0000000000..c39e3634fb
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/TextConfig.h
@@ -0,0 +1,19 @@
+// Common/TextConfig.h
+
+#ifndef __COMMON_TEXT_CONFIG_H
+#define __COMMON_TEXT_CONFIG_H
+
+#include "MyString.h"
+
+struct CTextConfigPair
+{
+ UString ID;
+ UString String;
+};
+
+bool GetTextConfig(const AString &text, CObjectVector<CTextConfigPair> &pairs);
+
+int FindTextConfigItem(const CObjectVector<CTextConfigPair> &pairs, const char *id) throw();
+UString GetTextConfigValue(const CObjectVector<CTextConfigPair> &pairs, const char *id);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/UTFConvert.cpp b/other-licenses/7zstub/src/CPP/Common/UTFConvert.cpp
new file mode 100644
index 0000000000..b09bbcdb37
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/UTFConvert.cpp
@@ -0,0 +1,288 @@
+// UTFConvert.cpp
+
+#include "StdAfx.h"
+
+#include "MyTypes.h"
+#include "UTFConvert.h"
+
+#ifdef _WIN32
+#define _WCHART_IS_16BIT 1
+#endif
+
+/*
+ _UTF8_START(n) - is a base value for start byte (head), if there are (n) additional bytes after start byte
+
+ n : _UTF8_START(n) : Bits of code point
+
+ 0 : 0x80 : : unused
+ 1 : 0xC0 : 11 :
+ 2 : 0xE0 : 16 : Basic Multilingual Plane
+ 3 : 0xF0 : 21 : Unicode space
+ 3 : 0xF8 : 26 :
+ 5 : 0xFC : 31 : UCS-4
+ 6 : 0xFE : 36 : We can use it, if we want to encode any 32-bit value
+ 7 : 0xFF :
+*/
+
+#define _UTF8_START(n) (0x100 - (1 << (7 - (n))))
+
+#define _UTF8_HEAD_PARSE2(n) if (c < _UTF8_START((n) + 1)) { numBytes = (n); c -= _UTF8_START(n); }
+
+#define _UTF8_HEAD_PARSE \
+ _UTF8_HEAD_PARSE2(1) \
+ else _UTF8_HEAD_PARSE2(2) \
+ else _UTF8_HEAD_PARSE2(3) \
+ else _UTF8_HEAD_PARSE2(4) \
+ else _UTF8_HEAD_PARSE2(5) \
+
+ // else _UTF8_HEAD_PARSE2(6)
+
+bool CheckUTF8(const char *src, bool allowReduced) throw()
+{
+ for (;;)
+ {
+ Byte c = *src++;
+ if (c == 0)
+ return true;
+
+ if (c < 0x80)
+ continue;
+ if (c < 0xC0) // (c < 0xC0 + 2) // if we support only optimal encoding chars
+ return false;
+
+ unsigned numBytes;
+ _UTF8_HEAD_PARSE
+ else
+ return false;
+
+ UInt32 val = c;
+
+ do
+ {
+ Byte c2 = *src++;
+ if (c2 < 0x80 || c2 >= 0xC0)
+ return allowReduced && c2 == 0;
+ val <<= 6;
+ val |= (c2 - 0x80);
+ }
+ while (--numBytes);
+
+ if (val >= 0x110000)
+ return false;
+ }
+}
+
+
+#define _ERROR_UTF8 \
+ { if (dest) dest[destPos] = (wchar_t)0xFFFD; destPos++; ok = false; continue; }
+
+static bool Utf8_To_Utf16(wchar_t *dest, size_t *destLen, const char *src, const char *srcLim) throw()
+{
+ size_t destPos = 0;
+ bool ok = true;
+
+ for (;;)
+ {
+ Byte c;
+ if (src == srcLim)
+ {
+ *destLen = destPos;
+ return ok;
+ }
+ c = *src++;
+
+ if (c < 0x80)
+ {
+ if (dest)
+ dest[destPos] = (wchar_t)c;
+ destPos++;
+ continue;
+ }
+ if (c < 0xC0)
+ _ERROR_UTF8
+
+ unsigned numBytes;
+ _UTF8_HEAD_PARSE
+ else
+ _ERROR_UTF8
+
+ UInt32 val = c;
+
+ do
+ {
+ Byte c2;
+ if (src == srcLim)
+ break;
+ c2 = *src;
+ if (c2 < 0x80 || c2 >= 0xC0)
+ break;
+ src++;
+ val <<= 6;
+ val |= (c2 - 0x80);
+ }
+ while (--numBytes);
+
+ if (numBytes != 0)
+ _ERROR_UTF8
+
+ if (val < 0x10000)
+ {
+ if (dest)
+ dest[destPos] = (wchar_t)val;
+ destPos++;
+ }
+ else
+ {
+ val -= 0x10000;
+ if (val >= 0x100000)
+ _ERROR_UTF8
+ if (dest)
+ {
+ dest[destPos + 0] = (wchar_t)(0xD800 + (val >> 10));
+ dest[destPos + 1] = (wchar_t)(0xDC00 + (val & 0x3FF));
+ }
+ destPos += 2;
+ }
+ }
+}
+
+#define _UTF8_RANGE(n) (((UInt32)1) << ((n) * 5 + 6))
+
+#define _UTF8_HEAD(n, val) ((char)(_UTF8_START(n) + (val >> (6 * (n)))))
+#define _UTF8_CHAR(n, val) ((char)(0x80 + (((val) >> (6 * (n))) & 0x3F)))
+
+static size_t Utf16_To_Utf8_Calc(const wchar_t *src, const wchar_t *srcLim)
+{
+ size_t size = srcLim - src;
+ for (;;)
+ {
+ if (src == srcLim)
+ return size;
+
+ UInt32 val = *src++;
+
+ if (val < 0x80)
+ continue;
+
+ if (val < _UTF8_RANGE(1))
+ {
+ size++;
+ continue;
+ }
+
+ if (val >= 0xD800 && val < 0xDC00 && src != srcLim)
+ {
+ UInt32 c2 = *src;
+ if (c2 >= 0xDC00 && c2 < 0xE000)
+ {
+ src++;
+ size += 2;
+ continue;
+ }
+ }
+
+ #ifdef _WCHART_IS_16BIT
+
+ size += 2;
+
+ #else
+
+ if (val < _UTF8_RANGE(2)) size += 2;
+ else if (val < _UTF8_RANGE(3)) size += 3;
+ else if (val < _UTF8_RANGE(4)) size += 4;
+ else if (val < _UTF8_RANGE(5)) size += 5;
+ else size += 6;
+
+ #endif
+ }
+}
+
+static char *Utf16_To_Utf8(char *dest, const wchar_t *src, const wchar_t *srcLim)
+{
+ for (;;)
+ {
+ if (src == srcLim)
+ return dest;
+
+ UInt32 val = *src++;
+
+ if (val < 0x80)
+ {
+ *dest++ = (char)val;
+ continue;
+ }
+
+ if (val < _UTF8_RANGE(1))
+ {
+ dest[0] = _UTF8_HEAD(1, val);
+ dest[1] = _UTF8_CHAR(0, val);
+ dest += 2;
+ continue;
+ }
+
+ if (val >= 0xD800 && val < 0xDC00 && src != srcLim)
+ {
+ UInt32 c2 = *src;
+ if (c2 >= 0xDC00 && c2 < 0xE000)
+ {
+ src++;
+ val = (((val - 0xD800) << 10) | (c2 - 0xDC00)) + 0x10000;
+ dest[0] = _UTF8_HEAD(3, val);
+ dest[1] = _UTF8_CHAR(2, val);
+ dest[2] = _UTF8_CHAR(1, val);
+ dest[3] = _UTF8_CHAR(0, val);
+ dest += 4;
+ continue;
+ }
+ }
+
+ #ifndef _WCHART_IS_16BIT
+ if (val < _UTF8_RANGE(2))
+ #endif
+ {
+ dest[0] = _UTF8_HEAD(2, val);
+ dest[1] = _UTF8_CHAR(1, val);
+ dest[2] = _UTF8_CHAR(0, val);
+ dest += 3;
+ continue;
+ }
+
+ #ifndef _WCHART_IS_16BIT
+
+ UInt32 b;
+ unsigned numBits;
+ if (val < _UTF8_RANGE(3)) { numBits = 6 * 3; b = _UTF8_HEAD(3, val); }
+ else if (val < _UTF8_RANGE(4)) { numBits = 6 * 4; b = _UTF8_HEAD(4, val); }
+ else if (val < _UTF8_RANGE(5)) { numBits = 6 * 5; b = _UTF8_HEAD(5, val); }
+ else { numBits = 6 * 6; b = _UTF8_START(6); }
+
+ *dest++ = (Byte)b;
+
+ do
+ {
+ numBits -= 6;
+ *dest++ = (char)(0x80 + ((val >> numBits) & 0x3F));
+ }
+ while (numBits != 0);
+
+ #endif
+ }
+}
+
+bool ConvertUTF8ToUnicode(const AString &src, UString &dest)
+{
+ dest.Empty();
+ size_t destLen = 0;
+ Utf8_To_Utf16(NULL, &destLen, src, src.Ptr(src.Len()));
+ bool res = Utf8_To_Utf16(dest.GetBuf((unsigned)destLen), &destLen, src, src.Ptr(src.Len()));
+ dest.ReleaseBuf_SetEnd((unsigned)destLen);
+ return res;
+}
+
+void ConvertUnicodeToUTF8(const UString &src, AString &dest)
+{
+ dest.Empty();
+ size_t destLen = Utf16_To_Utf8_Calc(src, src.Ptr(src.Len()));
+ Utf16_To_Utf8(dest.GetBuf((unsigned)destLen), src, src.Ptr(src.Len()));
+ dest.ReleaseBuf_SetEnd((unsigned)destLen);
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/UTFConvert.h b/other-licenses/7zstub/src/CPP/Common/UTFConvert.h
new file mode 100644
index 0000000000..11831700c7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/UTFConvert.h
@@ -0,0 +1,12 @@
+// Common/UTFConvert.h
+
+#ifndef __COMMON_UTF_CONVERT_H
+#define __COMMON_UTF_CONVERT_H
+
+#include "MyString.h"
+
+bool CheckUTF8(const char *src, bool allowReduced = false) throw();
+bool ConvertUTF8ToUnicode(const AString &utfString, UString &resultString);
+void ConvertUnicodeToUTF8(const UString &unicodeString, AString &resultString);
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/Wildcard.cpp b/other-licenses/7zstub/src/CPP/Common/Wildcard.cpp
new file mode 100644
index 0000000000..43e4baa179
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/Wildcard.cpp
@@ -0,0 +1,676 @@
+// Common/Wildcard.cpp
+
+#include "StdAfx.h"
+
+#include "Wildcard.h"
+
+bool g_CaseSensitive =
+ #ifdef _WIN32
+ false;
+ #else
+ true;
+ #endif
+
+
+bool IsPath1PrefixedByPath2(const wchar_t *s1, const wchar_t *s2)
+{
+ if (g_CaseSensitive)
+ return IsString1PrefixedByString2(s1, s2);
+ return IsString1PrefixedByString2_NoCase(s1, s2);
+}
+
+int CompareFileNames(const wchar_t *s1, const wchar_t *s2) STRING_UNICODE_THROW
+{
+ if (g_CaseSensitive)
+ return MyStringCompare(s1, s2);
+ return MyStringCompareNoCase(s1, s2);
+}
+
+#ifndef USE_UNICODE_FSTRING
+int CompareFileNames(const char *s1, const char *s2)
+{
+ const UString u1 = fs2us(s1);
+ const UString u2 = fs2us(s2);
+ if (g_CaseSensitive)
+ return MyStringCompare(u1, u2);
+ return MyStringCompareNoCase(u1, u2);
+}
+#endif
+
+// -----------------------------------------
+// this function compares name with mask
+// ? - any char
+// * - any char or empty
+
+static bool EnhancedMaskTest(const wchar_t *mask, const wchar_t *name)
+{
+ for (;;)
+ {
+ wchar_t m = *mask;
+ wchar_t c = *name;
+ if (m == 0)
+ return (c == 0);
+ if (m == '*')
+ {
+ if (EnhancedMaskTest(mask + 1, name))
+ return true;
+ if (c == 0)
+ return false;
+ }
+ else
+ {
+ if (m == '?')
+ {
+ if (c == 0)
+ return false;
+ }
+ else if (m != c)
+ if (g_CaseSensitive || MyCharUpper(m) != MyCharUpper(c))
+ return false;
+ mask++;
+ }
+ name++;
+ }
+}
+
+// --------------------------------------------------
+// Splits path to strings
+
+void SplitPathToParts(const UString &path, UStringVector &pathParts)
+{
+ pathParts.Clear();
+ unsigned len = path.Len();
+ if (len == 0)
+ return;
+ UString name;
+ unsigned prev = 0;
+ for (unsigned i = 0; i < len; i++)
+ if (IsPathSepar(path[i]))
+ {
+ name.SetFrom(path.Ptr(prev), i - prev);
+ pathParts.Add(name);
+ prev = i + 1;
+ }
+ name.SetFrom(path.Ptr(prev), len - prev);
+ pathParts.Add(name);
+}
+
+void SplitPathToParts_2(const UString &path, UString &dirPrefix, UString &name)
+{
+ const wchar_t *start = path;
+ const wchar_t *p = start + path.Len();
+ for (; p != start; p--)
+ if (IsPathSepar(*(p - 1)))
+ break;
+ dirPrefix.SetFrom(path, (unsigned)(p - start));
+ name = p;
+}
+
+void SplitPathToParts_Smart(const UString &path, UString &dirPrefix, UString &name)
+{
+ const wchar_t *start = path;
+ const wchar_t *p = start + path.Len();
+ if (p != start)
+ {
+ if (IsPathSepar(*(p - 1)))
+ p--;
+ for (; p != start; p--)
+ if (IsPathSepar(*(p - 1)))
+ break;
+ }
+ dirPrefix.SetFrom(path, (unsigned)(p - start));
+ name = p;
+}
+
+/*
+UString ExtractDirPrefixFromPath(const UString &path)
+{
+ return path.Left(path.ReverseFind_PathSepar() + 1));
+}
+*/
+
+UString ExtractFileNameFromPath(const UString &path)
+{
+ return UString(path.Ptr(path.ReverseFind_PathSepar() + 1));
+}
+
+
+bool DoesWildcardMatchName(const UString &mask, const UString &name)
+{
+ return EnhancedMaskTest(mask, name);
+}
+
+bool DoesNameContainWildcard(const UString &path)
+{
+ for (unsigned i = 0; i < path.Len(); i++)
+ {
+ wchar_t c = path[i];
+ if (c == '*' || c == '?')
+ return true;
+ }
+ return false;
+}
+
+
+// ----------------------------------------------------------'
+// NWildcard
+
+namespace NWildcard {
+
+/*
+
+M = MaskParts.Size();
+N = TestNameParts.Size();
+
+ File Dir
+ForFile rec M<=N [N-M, N) -
+!ForDir nonrec M=N [0, M) -
+
+ForDir rec M<N [0, M) ... [N-M-1, N-1) same as ForBoth-File
+!ForFile nonrec [0, M) same as ForBoth-File
+
+ForFile rec m<=N [0, M) ... [N-M, N) same as ForBoth-File
+ForDir nonrec [0, M) same as ForBoth-File
+
+*/
+
+bool CItem::AreAllAllowed() const
+{
+ return ForFile && ForDir && WildcardMatching && PathParts.Size() == 1 && PathParts.Front() == L"*";
+}
+
+bool CItem::CheckPath(const UStringVector &pathParts, bool isFile) const
+{
+ if (!isFile && !ForDir)
+ return false;
+
+ /*
+ if (PathParts.IsEmpty())
+ {
+ // PathParts.IsEmpty() means all items (universal wildcard)
+ if (!isFile)
+ return true;
+ if (pathParts.Size() <= 1)
+ return ForFile;
+ return (ForDir || Recursive && ForFile);
+ }
+ */
+
+ int delta = (int)pathParts.Size() - (int)PathParts.Size();
+ if (delta < 0)
+ return false;
+ int start = 0;
+ int finish = 0;
+
+ if (isFile)
+ {
+ if (!ForDir)
+ {
+ if (Recursive)
+ start = delta;
+ else if (delta !=0)
+ return false;
+ }
+ if (!ForFile && delta == 0)
+ return false;
+ }
+
+ if (Recursive)
+ {
+ finish = delta;
+ if (isFile && !ForFile)
+ finish = delta - 1;
+ }
+
+ for (int d = start; d <= finish; d++)
+ {
+ unsigned i;
+ for (i = 0; i < PathParts.Size(); i++)
+ {
+ if (WildcardMatching)
+ {
+ if (!DoesWildcardMatchName(PathParts[i], pathParts[i + d]))
+ break;
+ }
+ else
+ {
+ if (CompareFileNames(PathParts[i], pathParts[i + d]) != 0)
+ break;
+ }
+ }
+ if (i == PathParts.Size())
+ return true;
+ }
+ return false;
+}
+
+bool CCensorNode::AreAllAllowed() const
+{
+ if (!Name.IsEmpty() ||
+ !SubNodes.IsEmpty() ||
+ !ExcludeItems.IsEmpty() ||
+ IncludeItems.Size() != 1)
+ return false;
+ return IncludeItems.Front().AreAllAllowed();
+}
+
+int CCensorNode::FindSubNode(const UString &name) const
+{
+ FOR_VECTOR (i, SubNodes)
+ if (CompareFileNames(SubNodes[i].Name, name) == 0)
+ return i;
+ return -1;
+}
+
+void CCensorNode::AddItemSimple(bool include, CItem &item)
+{
+ if (include)
+ IncludeItems.Add(item);
+ else
+ ExcludeItems.Add(item);
+}
+
+void CCensorNode::AddItem(bool include, CItem &item, int ignoreWildcardIndex)
+{
+ if (item.PathParts.Size() <= 1)
+ {
+ if (item.PathParts.Size() != 0 && item.WildcardMatching)
+ {
+ if (!DoesNameContainWildcard(item.PathParts.Front()))
+ item.WildcardMatching = false;
+ }
+ AddItemSimple(include, item);
+ return;
+ }
+ const UString &front = item.PathParts.Front();
+
+ // WIN32 doesn't support wildcards in file names
+ if (item.WildcardMatching
+ && ignoreWildcardIndex != 0
+ && DoesNameContainWildcard(front))
+ {
+ AddItemSimple(include, item);
+ return;
+ }
+ int index = FindSubNode(front);
+ if (index < 0)
+ index = SubNodes.Add(CCensorNode(front, this));
+ item.PathParts.Delete(0);
+ SubNodes[index].AddItem(include, item, ignoreWildcardIndex - 1);
+}
+
+void CCensorNode::AddItem(bool include, const UString &path, bool recursive, bool forFile, bool forDir, bool wildcardMatching)
+{
+ CItem item;
+ SplitPathToParts(path, item.PathParts);
+ item.Recursive = recursive;
+ item.ForFile = forFile;
+ item.ForDir = forDir;
+ item.WildcardMatching = wildcardMatching;
+ AddItem(include, item);
+}
+
+bool CCensorNode::NeedCheckSubDirs() const
+{
+ FOR_VECTOR (i, IncludeItems)
+ {
+ const CItem &item = IncludeItems[i];
+ if (item.Recursive || item.PathParts.Size() > 1)
+ return true;
+ }
+ return false;
+}
+
+bool CCensorNode::AreThereIncludeItems() const
+{
+ if (IncludeItems.Size() > 0)
+ return true;
+ FOR_VECTOR (i, SubNodes)
+ if (SubNodes[i].AreThereIncludeItems())
+ return true;
+ return false;
+}
+
+bool CCensorNode::CheckPathCurrent(bool include, const UStringVector &pathParts, bool isFile) const
+{
+ const CObjectVector<CItem> &items = include ? IncludeItems : ExcludeItems;
+ FOR_VECTOR (i, items)
+ if (items[i].CheckPath(pathParts, isFile))
+ return true;
+ return false;
+}
+
+bool CCensorNode::CheckPathVect(const UStringVector &pathParts, bool isFile, bool &include) const
+{
+ if (CheckPathCurrent(false, pathParts, isFile))
+ {
+ include = false;
+ return true;
+ }
+ include = true;
+ bool finded = CheckPathCurrent(true, pathParts, isFile);
+ if (pathParts.Size() <= 1)
+ return finded;
+ int index = FindSubNode(pathParts.Front());
+ if (index >= 0)
+ {
+ UStringVector pathParts2 = pathParts;
+ pathParts2.Delete(0);
+ if (SubNodes[index].CheckPathVect(pathParts2, isFile, include))
+ return true;
+ }
+ return finded;
+}
+
+/*
+bool CCensorNode::CheckPath2(bool isAltStream, const UString &path, bool isFile, bool &include) const
+{
+ UStringVector pathParts;
+ SplitPathToParts(path, pathParts);
+ if (CheckPathVect(pathParts, isFile, include))
+ {
+ if (!include || !isAltStream)
+ return true;
+ }
+ if (isAltStream && !pathParts.IsEmpty())
+ {
+ UString &back = pathParts.Back();
+ int pos = back.Find(L':');
+ if (pos > 0)
+ {
+ back.DeleteFrom(pos);
+ return CheckPathVect(pathParts, isFile, include);
+ }
+ }
+ return false;
+}
+
+bool CCensorNode::CheckPath(bool isAltStream, const UString &path, bool isFile) const
+{
+ bool include;
+ if (CheckPath2(isAltStream, path, isFile, include))
+ return include;
+ return false;
+}
+*/
+
+bool CCensorNode::CheckPathToRoot(bool include, UStringVector &pathParts, bool isFile) const
+{
+ if (CheckPathCurrent(include, pathParts, isFile))
+ return true;
+ if (Parent == 0)
+ return false;
+ pathParts.Insert(0, Name);
+ return Parent->CheckPathToRoot(include, pathParts, isFile);
+}
+
+/*
+bool CCensorNode::CheckPathToRoot(bool include, const UString &path, bool isFile) const
+{
+ UStringVector pathParts;
+ SplitPathToParts(path, pathParts);
+ return CheckPathToRoot(include, pathParts, isFile);
+}
+*/
+
+void CCensorNode::AddItem2(bool include, const UString &path, bool recursive, bool wildcardMatching)
+{
+ if (path.IsEmpty())
+ return;
+ bool forFile = true;
+ bool forFolder = true;
+ UString path2 (path);
+ if (IsPathSepar(path.Back()))
+ {
+ path2.DeleteBack();
+ forFile = false;
+ }
+ AddItem(include, path2, recursive, forFile, forFolder, wildcardMatching);
+}
+
+void CCensorNode::ExtendExclude(const CCensorNode &fromNodes)
+{
+ ExcludeItems += fromNodes.ExcludeItems;
+ FOR_VECTOR (i, fromNodes.SubNodes)
+ {
+ const CCensorNode &node = fromNodes.SubNodes[i];
+ int subNodeIndex = FindSubNode(node.Name);
+ if (subNodeIndex < 0)
+ subNodeIndex = SubNodes.Add(CCensorNode(node.Name, this));
+ SubNodes[subNodeIndex].ExtendExclude(node);
+ }
+}
+
+int CCensor::FindPrefix(const UString &prefix) const
+{
+ FOR_VECTOR (i, Pairs)
+ if (CompareFileNames(Pairs[i].Prefix, prefix) == 0)
+ return i;
+ return -1;
+}
+
+#ifdef _WIN32
+
+bool IsDriveColonName(const wchar_t *s)
+{
+ wchar_t c = s[0];
+ return c != 0 && s[1] == ':' && s[2] == 0 && (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z');
+}
+
+unsigned GetNumPrefixParts_if_DrivePath(UStringVector &pathParts)
+{
+ if (pathParts.IsEmpty())
+ return 0;
+
+ unsigned testIndex = 0;
+ if (pathParts[0].IsEmpty())
+ {
+ if (pathParts.Size() < 4
+ || !pathParts[1].IsEmpty()
+ || pathParts[2] != L"?")
+ return 0;
+ testIndex = 3;
+ }
+ if (NWildcard::IsDriveColonName(pathParts[testIndex]))
+ return testIndex + 1;
+ return 0;
+}
+
+#endif
+
+static unsigned GetNumPrefixParts(const UStringVector &pathParts)
+{
+ if (pathParts.IsEmpty())
+ return 0;
+
+ #ifdef _WIN32
+
+ if (IsDriveColonName(pathParts[0]))
+ return 1;
+ if (!pathParts[0].IsEmpty())
+ return 0;
+
+ if (pathParts.Size() == 1)
+ return 1;
+ if (!pathParts[1].IsEmpty())
+ return 1;
+ if (pathParts.Size() == 2)
+ return 2;
+ if (pathParts[2] == L".")
+ return 3;
+
+ unsigned networkParts = 2;
+ if (pathParts[2] == L"?")
+ {
+ if (pathParts.Size() == 3)
+ return 3;
+ if (IsDriveColonName(pathParts[3]))
+ return 4;
+ if (!pathParts[3].IsEqualTo_Ascii_NoCase("UNC"))
+ return 3;
+ networkParts = 4;
+ }
+
+ networkParts +=
+ // 2; // server/share
+ 1; // server
+ if (pathParts.Size() <= networkParts)
+ return pathParts.Size();
+ return networkParts;
+
+ #else
+
+ return pathParts[0].IsEmpty() ? 1 : 0;
+
+ #endif
+}
+
+void CCensor::AddItem(ECensorPathMode pathMode, bool include, const UString &path, bool recursive, bool wildcardMatching)
+{
+ if (path.IsEmpty())
+ throw "Empty file path";
+
+ UStringVector pathParts;
+ SplitPathToParts(path, pathParts);
+
+ bool forFile = true;
+ if (pathParts.Back().IsEmpty())
+ {
+ forFile = false;
+ pathParts.DeleteBack();
+ }
+
+ UString prefix;
+
+ int ignoreWildcardIndex = -1;
+
+ // #ifdef _WIN32
+ // we ignore "?" wildcard in "\\?\" prefix.
+ if (pathParts.Size() >= 3
+ && pathParts[0].IsEmpty()
+ && pathParts[1].IsEmpty()
+ && pathParts[2] == L"?")
+ ignoreWildcardIndex = 2;
+ // #endif
+
+ if (pathMode != k_AbsPath)
+ {
+ ignoreWildcardIndex = -1;
+
+ const unsigned numPrefixParts = GetNumPrefixParts(pathParts);
+ unsigned numSkipParts = numPrefixParts;
+
+ if (pathMode != k_FullPath)
+ {
+ if (numPrefixParts != 0 && pathParts.Size() > numPrefixParts)
+ numSkipParts = pathParts.Size() - 1;
+ }
+ {
+ int dotsIndex = -1;
+ for (unsigned i = numPrefixParts; i < pathParts.Size(); i++)
+ {
+ const UString &part = pathParts[i];
+ if (part == L".." || part == L".")
+ dotsIndex = i;
+ }
+
+ if (dotsIndex >= 0)
+ if (dotsIndex == (int)pathParts.Size() - 1)
+ numSkipParts = pathParts.Size();
+ else
+ numSkipParts = pathParts.Size() - 1;
+ }
+
+ for (unsigned i = 0; i < numSkipParts; i++)
+ {
+ {
+ const UString &front = pathParts.Front();
+ // WIN32 doesn't support wildcards in file names
+ if (wildcardMatching)
+ if (i >= numPrefixParts && DoesNameContainWildcard(front))
+ break;
+ prefix += front;
+ prefix.Add_PathSepar();
+ }
+ pathParts.Delete(0);
+ }
+ }
+
+ int index = FindPrefix(prefix);
+ if (index < 0)
+ index = Pairs.Add(CPair(prefix));
+
+ if (pathMode != k_AbsPath)
+ {
+ if (pathParts.IsEmpty() || pathParts.Size() == 1 && pathParts[0].IsEmpty())
+ {
+ // we create universal item, if we skip all parts as prefix (like \ or L:\ )
+ pathParts.Clear();
+ pathParts.Add(UString("*"));
+ forFile = true;
+ wildcardMatching = true;
+ recursive = false;
+ }
+ }
+
+ CItem item;
+ item.PathParts = pathParts;
+ item.ForDir = true;
+ item.ForFile = forFile;
+ item.Recursive = recursive;
+ item.WildcardMatching = wildcardMatching;
+ Pairs[index].Head.AddItem(include, item, ignoreWildcardIndex);
+}
+
+/*
+bool CCensor::CheckPath(bool isAltStream, const UString &path, bool isFile) const
+{
+ bool finded = false;
+ FOR_VECTOR (i, Pairs)
+ {
+ bool include;
+ if (Pairs[i].Head.CheckPath2(isAltStream, path, isFile, include))
+ {
+ if (!include)
+ return false;
+ finded = true;
+ }
+ }
+ return finded;
+}
+*/
+
+void CCensor::ExtendExclude()
+{
+ unsigned i;
+ for (i = 0; i < Pairs.Size(); i++)
+ if (Pairs[i].Prefix.IsEmpty())
+ break;
+ if (i == Pairs.Size())
+ return;
+ unsigned index = i;
+ for (i = 0; i < Pairs.Size(); i++)
+ if (index != i)
+ Pairs[i].Head.ExtendExclude(Pairs[index].Head);
+}
+
+void CCensor::AddPathsToCensor(ECensorPathMode censorPathMode)
+{
+ FOR_VECTOR(i, CensorPaths)
+ {
+ const CCensorPath &cp = CensorPaths[i];
+ AddItem(censorPathMode, cp.Include, cp.Path, cp.Recursive, cp.WildcardMatching);
+ }
+ CensorPaths.Clear();
+}
+
+void CCensor::AddPreItem(bool include, const UString &path, bool recursive, bool wildcardMatching)
+{
+ CCensorPath &cp = CensorPaths.AddNew();
+ cp.Path = path;
+ cp.Include = include;
+ cp.Recursive = recursive;
+ cp.WildcardMatching = wildcardMatching;
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/Common/Wildcard.h b/other-licenses/7zstub/src/CPP/Common/Wildcard.h
new file mode 100644
index 0000000000..6e5f013418
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/Wildcard.h
@@ -0,0 +1,149 @@
+// Common/Wildcard.h
+
+#ifndef __COMMON_WILDCARD_H
+#define __COMMON_WILDCARD_H
+
+#include "MyString.h"
+
+int CompareFileNames(const wchar_t *s1, const wchar_t *s2) STRING_UNICODE_THROW;
+#ifndef USE_UNICODE_FSTRING
+ int CompareFileNames(const char *s1, const char *s2);
+#endif
+
+bool IsPath1PrefixedByPath2(const wchar_t *s1, const wchar_t *s2);
+
+void SplitPathToParts(const UString &path, UStringVector &pathParts);
+void SplitPathToParts_2(const UString &path, UString &dirPrefix, UString &name);
+void SplitPathToParts_Smart(const UString &path, UString &dirPrefix, UString &name); // ignores dir delimiter at the end of (path)
+
+UString ExtractDirPrefixFromPath(const UString &path);
+UString ExtractFileNameFromPath(const UString &path);
+
+bool DoesNameContainWildcard(const UString &path);
+bool DoesWildcardMatchName(const UString &mask, const UString &name);
+
+namespace NWildcard {
+
+#ifdef _WIN32
+// returns true, if name is like "a:", "c:", ...
+bool IsDriveColonName(const wchar_t *s);
+unsigned GetNumPrefixParts_if_DrivePath(UStringVector &pathParts);
+#endif
+
+struct CItem
+{
+ UStringVector PathParts;
+ bool Recursive;
+ bool ForFile;
+ bool ForDir;
+ bool WildcardMatching;
+
+ #ifdef _WIN32
+ bool IsDriveItem() const
+ {
+ return PathParts.Size() == 1 && !ForFile && ForDir && IsDriveColonName(PathParts[0]);
+ }
+ #endif
+
+ // CItem(): WildcardMatching(true) {}
+
+ bool AreAllAllowed() const;
+ bool CheckPath(const UStringVector &pathParts, bool isFile) const;
+};
+
+class CCensorNode
+{
+ CCensorNode *Parent;
+
+ bool CheckPathCurrent(bool include, const UStringVector &pathParts, bool isFile) const;
+ void AddItemSimple(bool include, CItem &item);
+public:
+ bool CheckPathVect(const UStringVector &pathParts, bool isFile, bool &include) const;
+
+ CCensorNode(): Parent(0) { };
+ CCensorNode(const UString &name, CCensorNode *parent): Name(name), Parent(parent) { };
+
+ UString Name; // WIN32 doesn't support wildcards in file names
+ CObjectVector<CCensorNode> SubNodes;
+ CObjectVector<CItem> IncludeItems;
+ CObjectVector<CItem> ExcludeItems;
+
+ bool AreAllAllowed() const;
+
+ int FindSubNode(const UString &path) const;
+
+ void AddItem(bool include, CItem &item, int ignoreWildcardIndex = -1);
+ void AddItem(bool include, const UString &path, bool recursive, bool forFile, bool forDir, bool wildcardMatching);
+ void AddItem2(bool include, const UString &path, bool recursive, bool wildcardMatching);
+
+ bool NeedCheckSubDirs() const;
+ bool AreThereIncludeItems() const;
+
+ // bool CheckPath2(bool isAltStream, const UString &path, bool isFile, bool &include) const;
+ // bool CheckPath(bool isAltStream, const UString &path, bool isFile) const;
+
+ bool CheckPathToRoot(bool include, UStringVector &pathParts, bool isFile) const;
+ // bool CheckPathToRoot(const UString &path, bool isFile, bool include) const;
+ void ExtendExclude(const CCensorNode &fromNodes);
+};
+
+struct CPair
+{
+ UString Prefix;
+ CCensorNode Head;
+
+ CPair(const UString &prefix): Prefix(prefix) { };
+};
+
+enum ECensorPathMode
+{
+ k_RelatPath, // absolute prefix as Prefix, remain path in Tree
+ k_FullPath, // drive prefix as Prefix, remain path in Tree
+ k_AbsPath // full path in Tree
+};
+
+struct CCensorPath
+{
+ UString Path;
+ bool Include;
+ bool Recursive;
+ bool WildcardMatching;
+
+ CCensorPath():
+ Include(true),
+ Recursive(false),
+ WildcardMatching(true)
+ {}
+};
+
+class CCensor
+{
+ int FindPrefix(const UString &prefix) const;
+public:
+ CObjectVector<CPair> Pairs;
+
+ CObjectVector<NWildcard::CCensorPath> CensorPaths;
+
+ bool AllAreRelative() const
+ { return (Pairs.Size() == 1 && Pairs.Front().Prefix.IsEmpty()); }
+
+ void AddItem(ECensorPathMode pathMode, bool include, const UString &path, bool recursive, bool wildcardMatching);
+ // bool CheckPath(bool isAltStream, const UString &path, bool isFile) const;
+ void ExtendExclude();
+
+ void AddPathsToCensor(NWildcard::ECensorPathMode censorPathMode);
+ void AddPreItem(bool include, const UString &path, bool recursive, bool wildcardMatching);
+ void AddPreItem(const UString &path)
+ {
+ AddPreItem(true, path, false, false);
+ }
+ void AddPreItem_Wildcard()
+ {
+ AddPreItem(true, UString("*"), false, true);
+ }
+};
+
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Common/XzCrc64Init.cpp b/other-licenses/7zstub/src/CPP/Common/XzCrc64Init.cpp
new file mode 100644
index 0000000000..1eae72ad9b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/XzCrc64Init.cpp
@@ -0,0 +1,7 @@
+// XzCrc64Init.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/XzCrc64.h"
+
+static struct CCrc64Gen { CCrc64Gen() { Crc64GenerateTable(); } } g_Crc64TableInit;
diff --git a/other-licenses/7zstub/src/CPP/Common/XzCrc64Reg.cpp b/other-licenses/7zstub/src/CPP/Common/XzCrc64Reg.cpp
new file mode 100644
index 0000000000..92fce0a1a0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Common/XzCrc64Reg.cpp
@@ -0,0 +1,42 @@
+// XzCrc64Reg.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/CpuArch.h"
+#include "../../C/XzCrc64.h"
+
+#include "../Common/MyCom.h"
+
+#include "../7zip/Common/RegisterCodec.h"
+
+class CXzCrc64Hasher:
+ public IHasher,
+ public CMyUnknownImp
+{
+ UInt64 _crc;
+ Byte mtDummy[1 << 7];
+
+public:
+ CXzCrc64Hasher(): _crc(CRC64_INIT_VAL) {}
+
+ MY_UNKNOWN_IMP1(IHasher)
+ INTERFACE_IHasher(;)
+};
+
+STDMETHODIMP_(void) CXzCrc64Hasher::Init() throw()
+{
+ _crc = CRC64_INIT_VAL;
+}
+
+STDMETHODIMP_(void) CXzCrc64Hasher::Update(const void *data, UInt32 size) throw()
+{
+ _crc = Crc64Update(_crc, data, size);
+}
+
+STDMETHODIMP_(void) CXzCrc64Hasher::Final(Byte *digest) throw()
+{
+ UInt64 val = CRC64_GET_DIGEST(_crc);
+ SetUi64(digest, val);
+}
+
+REGISTER_HASHER(CXzCrc64Hasher, 0x4, "CRC64", 8)
diff --git a/other-licenses/7zstub/src/CPP/Windows/COM.h b/other-licenses/7zstub/src/CPP/Windows/COM.h
new file mode 100644
index 0000000000..e2cb002bf7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/COM.h
@@ -0,0 +1,70 @@
+// Windows/COM.h
+
+#ifndef __WINDOWS_COM_H
+#define __WINDOWS_COM_H
+
+#include "../Common/MyString.h"
+
+namespace NWindows {
+namespace NCOM {
+
+#ifdef _WIN32
+
+class CComInitializer
+{
+public:
+ CComInitializer()
+ {
+ #ifdef UNDER_CE
+ CoInitializeEx(NULL, COINIT_MULTITHREADED);
+ #else
+ // it's single thread. Do we need multithread?
+ CoInitialize(NULL);
+ #endif
+ };
+ ~CComInitializer() { CoUninitialize(); }
+};
+
+class CStgMedium
+{
+ STGMEDIUM _object;
+public:
+ bool _mustBeReleased;
+ CStgMedium(): _mustBeReleased(false) {}
+ ~CStgMedium() { Free(); }
+ void Free()
+ {
+ if (_mustBeReleased)
+ ReleaseStgMedium(&_object);
+ _mustBeReleased = false;
+ }
+ const STGMEDIUM* operator->() const { return &_object;}
+ STGMEDIUM* operator->() { return &_object;}
+ STGMEDIUM* operator&() { return &_object; }
+};
+
+#endif
+
+/*
+//////////////////////////////////
+// GUID <--> String Conversions
+UString GUIDToStringW(REFGUID guid);
+AString GUIDToStringA(REFGUID guid);
+#ifdef UNICODE
+ #define GUIDToString GUIDToStringW
+#else
+ #define GUIDToString GUIDToStringA
+#endif
+
+HRESULT StringToGUIDW(const wchar_t *string, GUID &classID);
+HRESULT StringToGUIDA(const char *string, GUID &classID);
+#ifdef UNICODE
+ #define StringToGUID StringToGUIDW
+#else
+ #define StringToGUID StringToGUIDA
+#endif
+*/
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/CommonDialog.cpp b/other-licenses/7zstub/src/CPP/Windows/CommonDialog.cpp
new file mode 100644
index 0000000000..8b3828cf76
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/CommonDialog.cpp
@@ -0,0 +1,185 @@
+// Windows/CommonDialog.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/MyWindows.h"
+
+#ifdef UNDER_CE
+#include <commdlg.h>
+#endif
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "CommonDialog.h"
+#include "Defs.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+
+#ifndef _UNICODE
+
+class CDoubleZeroStringListA
+{
+ LPTSTR Buf;
+ unsigned Size;
+public:
+ CDoubleZeroStringListA(LPSTR buf, unsigned size): Buf(buf), Size(size) {}
+ bool Add(LPCSTR s) throw();
+ void Finish() { *Buf = 0; }
+};
+
+bool CDoubleZeroStringListA::Add(LPCSTR s) throw()
+{
+ unsigned len = MyStringLen(s) + 1;
+ if (len >= Size)
+ return false;
+ MyStringCopy(Buf, s);
+ Buf += len;
+ Size -= len;
+ return true;
+}
+
+#endif
+
+class CDoubleZeroStringListW
+{
+ LPWSTR Buf;
+ unsigned Size;
+public:
+ CDoubleZeroStringListW(LPWSTR buf, unsigned size): Buf(buf), Size(size) {}
+ bool Add(LPCWSTR s) throw();
+ void Finish() { *Buf = 0; }
+};
+
+bool CDoubleZeroStringListW::Add(LPCWSTR s) throw()
+{
+ unsigned len = MyStringLen(s) + 1;
+ if (len >= Size)
+ return false;
+ MyStringCopy(Buf, s);
+ Buf += len;
+ Size -= len;
+ return true;
+}
+
+#define MY__OFN_PROJECT 0x00400000
+#define MY__OFN_SHOW_ALL 0x01000000
+
+/* if (lpstrFilter == NULL && nFilterIndex == 0)
+ MSDN : "the system doesn't show any files",
+ but WinXP-64 shows all files. Why ??? */
+
+/*
+structures
+ OPENFILENAMEW
+ OPENFILENAMEA
+contain additional members:
+#if (_WIN32_WINNT >= 0x0500)
+ void *pvReserved;
+ DWORD dwReserved;
+ DWORD FlagsEx;
+#endif
+
+If we compile the source code with (_WIN32_WINNT >= 0x0500), some functions
+will not work at NT 4.0, if we use sizeof(OPENFILENAME*).
+So we use size of old version of structure. */
+
+#if defined(UNDER_CE) || defined(_WIN64) || (_WIN32_WINNT < 0x0500)
+// || !defined(WINVER)
+ #define my_compatib_OPENFILENAMEA_size sizeof(OPENFILENAMEA)
+ #define my_compatib_OPENFILENAMEW_size sizeof(OPENFILENAMEW)
+#else
+ #define my_compatib_OPENFILENAMEA_size OPENFILENAME_SIZE_VERSION_400A
+ #define my_compatib_OPENFILENAMEW_size OPENFILENAME_SIZE_VERSION_400W
+#endif
+
+#define CONV_U_To_A(dest, src, temp) AString temp; if (src) { temp = GetSystemString(src); dest = temp; }
+
+bool MyGetOpenFileName(HWND hwnd, LPCWSTR title,
+ LPCWSTR initialDir,
+ LPCWSTR filePath,
+ LPCWSTR filterDescription,
+ LPCWSTR filter,
+ UString &resPath
+ #ifdef UNDER_CE
+ , bool openFolder
+ #endif
+ )
+{
+ const unsigned kBufSize = MAX_PATH * 2;
+ const unsigned kFilterBufSize = MAX_PATH;
+ if (!filter)
+ filter = L"*.*";
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ CHAR buf[kBufSize];
+ MyStringCopy(buf, (const char *)GetSystemString(filePath));
+ // OPENFILENAME_NT4A
+ OPENFILENAMEA p;
+ memset(&p, 0, sizeof(p));
+ p.lStructSize = my_compatib_OPENFILENAMEA_size;
+ p.hwndOwner = hwnd;
+ CHAR filterBuf[kFilterBufSize];
+ {
+ CDoubleZeroStringListA dz(filterBuf, kFilterBufSize);
+ dz.Add(GetSystemString(filterDescription ? filterDescription : filter));
+ dz.Add(GetSystemString(filter));
+ dz.Finish();
+ p.lpstrFilter = filterBuf;
+ p.nFilterIndex = 1;
+ }
+
+ p.lpstrFile = buf;
+ p.nMaxFile = kBufSize;
+ CONV_U_To_A(p.lpstrInitialDir, initialDir, initialDirA);
+ CONV_U_To_A(p.lpstrTitle, title, titleA);
+ p.Flags = OFN_EXPLORER | OFN_HIDEREADONLY;
+
+ bool res = BOOLToBool(::GetOpenFileNameA(&p));
+ resPath = GetUnicodeString(buf);
+ return res;
+ }
+ else
+ #endif
+ {
+ WCHAR buf[kBufSize];
+ MyStringCopy(buf, filePath);
+ // OPENFILENAME_NT4W
+ OPENFILENAMEW p;
+ memset(&p, 0, sizeof(p));
+ p.lStructSize = my_compatib_OPENFILENAMEW_size;
+ p.hwndOwner = hwnd;
+
+ WCHAR filterBuf[kFilterBufSize];
+ {
+ CDoubleZeroStringListW dz(filterBuf, kFilterBufSize);
+ dz.Add(filterDescription ? filterDescription : filter);
+ dz.Add(filter);
+ dz.Finish();
+ p.lpstrFilter = filterBuf;
+ p.nFilterIndex = 1;
+ }
+
+ p.lpstrFile = buf;
+ p.nMaxFile = kBufSize;
+ p.lpstrInitialDir = initialDir;
+ p.lpstrTitle = title;
+ p.Flags = OFN_EXPLORER | OFN_HIDEREADONLY
+ #ifdef UNDER_CE
+ | (openFolder ? (MY__OFN_PROJECT | MY__OFN_SHOW_ALL) : 0)
+ #endif
+ ;
+
+ bool res = BOOLToBool(::GetOpenFileNameW(&p));
+ resPath = buf;
+ return res;
+ }
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/Windows/CommonDialog.h b/other-licenses/7zstub/src/CPP/Windows/CommonDialog.h
new file mode 100644
index 0000000000..2bfec28d91
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/CommonDialog.h
@@ -0,0 +1,23 @@
+// Windows/CommonDialog.h
+
+#ifndef __WINDOWS_COMMON_DIALOG_H
+#define __WINDOWS_COMMON_DIALOG_H
+
+#include "../Common/MyString.h"
+
+namespace NWindows {
+
+bool MyGetOpenFileName(HWND hwnd, LPCWSTR title,
+ LPCWSTR initialDir, // can be NULL, so dir prefix in filePath will be used
+ LPCWSTR filePath, // full path
+ LPCWSTR filterDescription, // like "All files (*.*)"
+ LPCWSTR filter, // like "*.exe"
+ UString &resPath
+ #ifdef UNDER_CE
+ , bool openFolder = false
+ #endif
+);
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.cpp b/other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.cpp
new file mode 100644
index 0000000000..6ab4717122
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.cpp
@@ -0,0 +1,66 @@
+// Windows/Control/ComboBox.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../../Common/StringConvert.h"
+#endif
+
+#include "ComboBox.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NControl {
+
+LRESULT CComboBox::GetLBText(int index, CSysString &s)
+{
+ s.Empty();
+ LRESULT len = GetLBTextLen(index); // length, excluding the terminating null character
+ if (len == CB_ERR)
+ return len;
+ LRESULT len2 = GetLBText(index, s.GetBuf((unsigned)len));
+ if (len2 == CB_ERR)
+ return len;
+ if (len > len2)
+ len = len2;
+ s.ReleaseBuf_CalcLen((unsigned)len);
+ return len;
+}
+
+#ifndef _UNICODE
+LRESULT CComboBox::AddString(LPCWSTR s)
+{
+ if (g_IsNT)
+ return SendMsgW(CB_ADDSTRING, 0, (LPARAM)s);
+ return AddString(GetSystemString(s));
+}
+
+LRESULT CComboBox::GetLBText(int index, UString &s)
+{
+ s.Empty();
+ if (g_IsNT)
+ {
+ LRESULT len = SendMsgW(CB_GETLBTEXTLEN, index, 0);
+ if (len == CB_ERR)
+ return len;
+ LRESULT len2 = SendMsgW(CB_GETLBTEXT, index, (LPARAM)s.GetBuf((unsigned)len));
+ if (len2 == CB_ERR)
+ return len;
+ if (len > len2)
+ len = len2;
+ s.ReleaseBuf_CalcLen((unsigned)len);
+ return len;
+ }
+ AString sa;
+ LRESULT len = GetLBText(index, sa);
+ if (len == CB_ERR)
+ return len;
+ s = GetUnicodeString(sa);
+ return s.Len();
+}
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.h b/other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.h
new file mode 100644
index 0000000000..3439655fe1
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ComboBox.h
@@ -0,0 +1,65 @@
+// Windows/Control/ComboBox.h
+
+#ifndef __WINDOWS_CONTROL_COMBOBOX_H
+#define __WINDOWS_CONTROL_COMBOBOX_H
+
+#include "../../Common/MyWindows.h"
+
+#include <commctrl.h>
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CComboBox: public CWindow
+{
+public:
+ void ResetContent() { SendMsg(CB_RESETCONTENT, 0, 0); }
+ LRESULT AddString(LPCTSTR s) { return SendMsg(CB_ADDSTRING, 0, (LPARAM)s); }
+ #ifndef _UNICODE
+ LRESULT AddString(LPCWSTR s);
+ #endif
+ LRESULT SetCurSel(int index) { return SendMsg(CB_SETCURSEL, index, 0); }
+ int GetCurSel() { return (int)SendMsg(CB_GETCURSEL, 0, 0); }
+ int GetCount() { return (int)SendMsg(CB_GETCOUNT, 0, 0); }
+
+ LRESULT GetLBTextLen(int index) { return SendMsg(CB_GETLBTEXTLEN, index, 0); }
+ LRESULT GetLBText(int index, LPTSTR s) { return SendMsg(CB_GETLBTEXT, index, (LPARAM)s); }
+ LRESULT GetLBText(int index, CSysString &s);
+ #ifndef _UNICODE
+ LRESULT GetLBText(int index, UString &s);
+ #endif
+
+ LRESULT SetItemData(int index, LPARAM lParam) { return SendMsg(CB_SETITEMDATA, index, lParam); }
+ LRESULT GetItemData(int index) { return SendMsg(CB_GETITEMDATA, index, 0); }
+
+ LRESULT GetItemData_of_CurSel() { return GetItemData(GetCurSel()); }
+
+ void ShowDropDown(bool show = true) { SendMsg(CB_SHOWDROPDOWN, show ? TRUE : FALSE, 0); }
+};
+
+#ifndef UNDER_CE
+
+class CComboBoxEx: public CComboBox
+{
+public:
+ bool SetUnicodeFormat(bool fUnicode) { return LRESULTToBool(SendMsg(CBEM_SETUNICODEFORMAT, BOOLToBool(fUnicode), 0)); }
+
+ LRESULT DeleteItem(int index) { return SendMsg(CBEM_DELETEITEM, index, 0); }
+ LRESULT InsertItem(COMBOBOXEXITEM *item) { return SendMsg(CBEM_INSERTITEM, 0, (LPARAM)item); }
+ #ifndef _UNICODE
+ LRESULT InsertItem(COMBOBOXEXITEMW *item) { return SendMsg(CBEM_INSERTITEMW, 0, (LPARAM)item); }
+ #endif
+
+ LRESULT SetItem(COMBOBOXEXITEM *item) { return SendMsg(CBEM_SETITEM, 0, (LPARAM)item); }
+ DWORD SetExtendedStyle(DWORD exMask, DWORD exStyle) { return (DWORD)SendMsg(CBEM_SETEXTENDEDSTYLE, exMask, exStyle); }
+ HWND GetEditControl() { return (HWND)SendMsg(CBEM_GETEDITCONTROL, 0, 0); }
+ HIMAGELIST SetImageList(HIMAGELIST imageList) { return (HIMAGELIST)SendMsg(CBEM_SETIMAGELIST, 0, (LPARAM)imageList); }
+};
+
+#endif
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/CommandBar.h b/other-licenses/7zstub/src/CPP/Windows/Control/CommandBar.h
new file mode 100644
index 0000000000..c4355680a7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/CommandBar.h
@@ -0,0 +1,52 @@
+// Windows/Control/CommandBar.h
+
+#ifndef __WINDOWS_CONTROL_COMMANDBAR_H
+#define __WINDOWS_CONTROL_COMMANDBAR_H
+
+#ifdef UNDER_CE
+
+#include "../../Common/MyWindows.h"
+
+#include <commctrl.h>
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CCommandBar: public NWindows::CWindow
+{
+public:
+ bool Create(HINSTANCE hInst, HWND hwndParent, int idCmdBar)
+ {
+ _window = ::CommandBar_Create(hInst, hwndParent, idCmdBar);
+ return (_window != NULL);
+ }
+
+ // Macros
+ // void Destroy() { CommandBar_Destroy(_window); }
+ // bool AddButtons(UINT numButtons, LPTBBUTTON buttons) { return BOOLToBool(SendMsg(TB_ADDBUTTONS, (WPARAM)numButtons, (LPARAM)buttons)); }
+ bool InsertButton(int iButton, LPTBBUTTON button) { return BOOLToBool(SendMsg(TB_INSERTBUTTON, (WPARAM)iButton, (LPARAM)button)); }
+ BOOL AddToolTips(UINT numToolTips, LPTSTR toolTips) { return BOOLToBool(SendMsg(TB_SETTOOLTIPS, (WPARAM)numToolTips, (LPARAM)toolTips)); }
+ void AutoSize() { SendMsg(TB_AUTOSIZE, 0, 0); }
+
+ bool AddAdornments(DWORD dwFlags) { return BOOLToBool(::CommandBar_AddAdornments(_window, dwFlags, 0)); }
+ int AddBitmap(HINSTANCE hInst, int idBitmap, int iNumImages, int iImageWidth, int iImageHeight) { return ::CommandBar_AddBitmap(_window, hInst, idBitmap, iNumImages, iImageWidth, iImageHeight); }
+ bool DrawMenuBar(WORD iButton) { return BOOLToBool(::CommandBar_DrawMenuBar(_window, iButton)); }
+ HMENU GetMenu(WORD iButton) { return ::CommandBar_GetMenu(_window, iButton); }
+ int Height() { return CommandBar_Height(_window); }
+ HWND InsertComboBox(HINSTANCE hInst, int iWidth, UINT dwStyle, WORD idComboBox, WORD iButton) { return ::CommandBar_InsertComboBox(_window, hInst, iWidth, dwStyle, idComboBox, iButton); }
+ bool InsertMenubar(HINSTANCE hInst, WORD idMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubar(_window, hInst, idMenu, iButton)); }
+ bool InsertMenubarEx(HINSTANCE hInst, LPTSTR pszMenu, WORD iButton) { return BOOLToBool(::CommandBar_InsertMenubarEx(_window, hInst, pszMenu, iButton)); }
+ bool Show(bool cmdShow) { return BOOLToBool(::CommandBar_Show(_window, BoolToBOOL(cmdShow))); }
+
+
+ // CE 4.0
+ void AlignAdornments() { CommandBar_AlignAdornments(_window); }
+};
+
+}}
+
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Dialog.cpp b/other-licenses/7zstub/src/CPP/Windows/Control/Dialog.cpp
new file mode 100644
index 0000000000..8e61a2b2c8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Dialog.cpp
@@ -0,0 +1,251 @@
+// Windows/Control/Dialog.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../../Common/StringConvert.h"
+#endif
+
+#include "Dialog.h"
+
+extern HINSTANCE g_hInstance;
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NControl {
+
+static INT_PTR APIENTRY DialogProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow tempDialog(dialogHWND);
+ if (message == WM_INITDIALOG)
+ tempDialog.SetUserDataLongPtr(lParam);
+ CDialog *dialog = (CDialog *)(tempDialog.GetUserDataLongPtr());
+ if (dialog == NULL)
+ return FALSE;
+ if (message == WM_INITDIALOG)
+ dialog->Attach(dialogHWND);
+ try { return BoolToBOOL(dialog->OnMessage(message, wParam, lParam)); }
+ catch(...) { return TRUE; }
+}
+
+bool CDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch (message)
+ {
+ case WM_INITDIALOG: return OnInit();
+ case WM_COMMAND: return OnCommand(wParam, lParam);
+ case WM_NOTIFY: return OnNotify((UINT)wParam, (LPNMHDR) lParam);
+ case WM_TIMER: return OnTimer(wParam, lParam);
+ case WM_SIZE: return OnSize(wParam, LOWORD(lParam), HIWORD(lParam));
+ case WM_HELP: OnHelp(); return true;
+ /*
+ OnHelp(
+ #ifdef UNDER_CE
+ (void *)
+ #else
+ (LPHELPINFO)
+ #endif
+ lParam);
+ return true;
+ */
+ default: return false;
+ }
+}
+
+bool CDialog::OnCommand(WPARAM wParam, LPARAM lParam)
+{
+ return OnCommand(HIWORD(wParam), LOWORD(wParam), lParam);
+}
+
+bool CDialog::OnCommand(int code, int itemID, LPARAM lParam)
+{
+ if (code == BN_CLICKED)
+ return OnButtonClicked(itemID, (HWND)lParam);
+ return false;
+}
+
+bool CDialog::OnButtonClicked(int buttonID, HWND /* buttonHWND */)
+{
+ switch (buttonID)
+ {
+ case IDOK: OnOK(); break;
+ case IDCANCEL: OnCancel(); break;
+ case IDCLOSE: OnClose(); break;
+ case IDHELP: OnHelp(); break;
+ default: return false;
+ }
+ return true;
+}
+
+static bool GetWorkAreaRect(RECT *rect)
+{
+ // use another function for multi-monitor.
+ return BOOLToBool(::SystemParametersInfo(SPI_GETWORKAREA, 0, rect, 0));
+}
+
+bool IsDialogSizeOK(int xSize, int ySize)
+{
+ // it returns for system font. Real font uses another values
+ LONG v = GetDialogBaseUnits();
+ int x = LOWORD(v);
+ int y = HIWORD(v);
+
+ RECT rect;
+ GetWorkAreaRect(&rect);
+ int wx = RECT_SIZE_X(rect);
+ int wy = RECT_SIZE_Y(rect);
+ return
+ xSize / 4 * x <= wx &&
+ ySize / 8 * y <= wy;
+}
+
+bool CDialog::GetMargins(int margin, int &x, int &y)
+{
+ x = margin;
+ y = margin;
+ RECT rect;
+ rect.left = 0;
+ rect.top = 0;
+ rect.right = margin;
+ rect.bottom = margin;
+ if (!MapRect(&rect))
+ return false;
+ x = rect.right - rect.left;
+ y = rect.bottom - rect.top;
+ return true;
+}
+
+int CDialog::Units_To_Pixels_X(int units)
+{
+ RECT rect;
+ rect.left = 0;
+ rect.top = 0;
+ rect.right = units;
+ rect.bottom = units;
+ if (!MapRect(&rect))
+ return units * 3 / 2;
+ return rect.right - rect.left;
+}
+
+bool CDialog::GetItemSizes(int id, int &x, int &y)
+{
+ RECT rect;
+ if (!::GetWindowRect(GetItem(id), &rect))
+ return false;
+ x = RECT_SIZE_X(rect);
+ y = RECT_SIZE_Y(rect);
+ return true;
+}
+
+void CDialog::GetClientRectOfItem(int id, RECT &rect)
+{
+ ::GetWindowRect(GetItem(id), &rect);
+ ScreenToClient(&rect);
+}
+
+bool CDialog::MoveItem(int id, int x, int y, int width, int height, bool repaint)
+{
+ return BOOLToBool(::MoveWindow(GetItem(id), x, y, width, height, BoolToBOOL(repaint)));
+}
+
+void CDialog::NormalizeSize(bool fullNormalize)
+{
+ RECT workRect;
+ GetWorkAreaRect(&workRect);
+ int xSize = RECT_SIZE_X(workRect);
+ int ySize = RECT_SIZE_Y(workRect);
+ RECT rect;
+ GetWindowRect(&rect);
+ int xSize2 = RECT_SIZE_X(rect);
+ int ySize2 = RECT_SIZE_Y(rect);
+ bool needMove = (xSize2 > xSize || ySize2 > ySize);
+ if (xSize2 > xSize || (needMove && fullNormalize))
+ {
+ rect.left = workRect.left;
+ rect.right = workRect.right;
+ xSize2 = xSize;
+ }
+ if (ySize2 > ySize || (needMove && fullNormalize))
+ {
+ rect.top = workRect.top;
+ rect.bottom = workRect.bottom;
+ ySize2 = ySize;
+ }
+ if (needMove)
+ {
+ if (fullNormalize)
+ Show(SW_SHOWMAXIMIZED);
+ else
+ Move(rect.left, rect.top, xSize2, ySize2, true);
+ }
+}
+
+void CDialog::NormalizePosition()
+{
+ RECT workRect, rect;
+ GetWorkAreaRect(&workRect);
+ GetWindowRect(&rect);
+ if (rect.bottom > workRect.bottom && rect.top > workRect.top)
+ Move(rect.left, workRect.top, RECT_SIZE_X(rect), RECT_SIZE_Y(rect), true);
+}
+
+bool CModelessDialog::Create(LPCTSTR templateName, HWND parentWindow)
+{
+ HWND aHWND = CreateDialogParam(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
+ if (aHWND == 0)
+ return false;
+ Attach(aHWND);
+ return true;
+}
+
+INT_PTR CModalDialog::Create(LPCTSTR templateName, HWND parentWindow)
+{
+ return DialogBoxParam(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
+}
+
+#ifndef _UNICODE
+
+bool CModelessDialog::Create(LPCWSTR templateName, HWND parentWindow)
+{
+ HWND aHWND;
+ if (g_IsNT)
+ aHWND = CreateDialogParamW(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
+ else
+ {
+ AString name;
+ LPCSTR templateNameA;
+ if (IS_INTRESOURCE(templateName))
+ templateNameA = (LPCSTR)templateName;
+ else
+ {
+ name = GetSystemString(templateName);
+ templateNameA = name;
+ }
+ aHWND = CreateDialogParamA(g_hInstance, templateNameA, parentWindow, DialogProcedure, (LPARAM)this);
+ }
+ if (aHWND == 0)
+ return false;
+ Attach(aHWND);
+ return true;
+}
+
+INT_PTR CModalDialog::Create(LPCWSTR templateName, HWND parentWindow)
+{
+ if (g_IsNT)
+ return DialogBoxParamW(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
+ AString name;
+ LPCSTR templateNameA;
+ if (IS_INTRESOURCE(templateName))
+ templateNameA = (LPCSTR)templateName;
+ else
+ {
+ name = GetSystemString(templateName);
+ templateNameA = name;
+ }
+ return DialogBoxParamA(g_hInstance, templateNameA, parentWindow, DialogProcedure, (LPARAM)this);
+}
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Dialog.h b/other-licenses/7zstub/src/CPP/Windows/Control/Dialog.h
new file mode 100644
index 0000000000..f9c3442fdd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Dialog.h
@@ -0,0 +1,170 @@
+// Windows/Control/Dialog.h
+
+#ifndef __WINDOWS_CONTROL_DIALOG_H
+#define __WINDOWS_CONTROL_DIALOG_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CDialog: public CWindow
+{
+public:
+ CDialog(HWND wnd = NULL): CWindow(wnd){};
+ virtual ~CDialog() {};
+
+ HWND GetItem(int itemID) const
+ { return GetDlgItem(_window, itemID); }
+
+ bool EnableItem(int itemID, bool enable) const
+ { return BOOLToBool(::EnableWindow(GetItem(itemID), BoolToBOOL(enable))); }
+
+ bool ShowItem(int itemID, int cmdShow) const
+ { return BOOLToBool(::ShowWindow(GetItem(itemID), cmdShow)); }
+
+ bool ShowItem_Bool(int itemID, bool show) const
+ { return ShowItem(itemID, show ? SW_SHOW: SW_HIDE); }
+
+ bool HideItem(int itemID) const { return ShowItem(itemID, SW_HIDE); }
+
+ bool SetItemText(int itemID, LPCTSTR s)
+ { return BOOLToBool(SetDlgItemText(_window, itemID, s)); }
+
+ #ifndef _UNICODE
+ bool SetItemText(int itemID, LPCWSTR s)
+ {
+ CWindow window(GetItem(itemID));
+ return window.SetText(s);
+ }
+ #endif
+
+ UINT GetItemText(int itemID, LPTSTR string, int maxCount)
+ { return GetDlgItemText(_window, itemID, string, maxCount); }
+ #ifndef _UNICODE
+ /*
+ bool GetItemText(int itemID, LPWSTR string, int maxCount)
+ {
+ CWindow window(GetItem(itemID));
+ return window.GetText(string, maxCount);
+ }
+ */
+ #endif
+
+ bool SetItemInt(int itemID, UINT value, bool isSigned)
+ { return BOOLToBool(SetDlgItemInt(_window, itemID, value, BoolToBOOL(isSigned))); }
+ bool GetItemInt(int itemID, bool isSigned, UINT &value)
+ {
+ BOOL result;
+ value = GetDlgItemInt(_window, itemID, &result, BoolToBOOL(isSigned));
+ return BOOLToBool(result);
+ }
+
+ HWND GetNextGroupItem(HWND control, bool previous)
+ { return GetNextDlgGroupItem(_window, control, BoolToBOOL(previous)); }
+ HWND GetNextTabItem(HWND control, bool previous)
+ { return GetNextDlgTabItem(_window, control, BoolToBOOL(previous)); }
+
+ bool MapRect(LPRECT rect)
+ { return BOOLToBool(MapDialogRect(_window, rect)); }
+
+ bool IsMessage(LPMSG message)
+ { return BOOLToBool(IsDialogMessage(_window, message)); }
+
+ LRESULT SendItemMessage(int itemID, UINT message, WPARAM wParam, LPARAM lParam)
+ { return SendDlgItemMessage(_window, itemID, message, wParam, lParam); }
+
+ bool CheckButton(int buttonID, UINT checkState)
+ { return BOOLToBool(CheckDlgButton(_window, buttonID, checkState)); }
+ bool CheckButton(int buttonID, bool checkState)
+ { return CheckButton(buttonID, UINT(checkState ? BST_CHECKED : BST_UNCHECKED)); }
+
+ UINT IsButtonChecked(int buttonID) const
+ { return IsDlgButtonChecked(_window, buttonID); }
+ bool IsButtonCheckedBool(int buttonID) const
+ { return (IsButtonChecked(buttonID) == BST_CHECKED); }
+
+ bool CheckRadioButton(int firstButtonID, int lastButtonID, int checkButtonID)
+ { return BOOLToBool(::CheckRadioButton(_window, firstButtonID, lastButtonID, checkButtonID)); }
+
+ virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+ virtual bool OnInit() { return true; }
+ virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
+ virtual bool OnCommand(int code, int itemID, LPARAM lParam);
+ virtual bool OnSize(WPARAM /* wParam */, int /* xSize */, int /* ySize */) { return false; }
+
+ /*
+ #ifdef UNDER_CE
+ virtual void OnHelp(void *) { OnHelp(); }
+ #else
+ virtual void OnHelp(LPHELPINFO) { OnHelp(); }
+ #endif
+ */
+ virtual void OnHelp() {};
+
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ virtual void OnOK() {};
+ virtual void OnCancel() {};
+ virtual void OnClose() {}
+ virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */) { return false; }
+ virtual bool OnTimer(WPARAM /* timerID */, LPARAM /* callback */) { return false; }
+
+ LONG_PTR SetMsgResult(LONG_PTR newLongPtr )
+ { return SetLongPtr(DWLP_MSGRESULT, newLongPtr); }
+ LONG_PTR GetMsgResult() const
+ { return GetLongPtr(DWLP_MSGRESULT); }
+
+ bool GetMargins(int margin, int &x, int &y);
+ int Units_To_Pixels_X(int units);
+ bool GetItemSizes(int id, int &x, int &y);
+ void GetClientRectOfItem(int id, RECT &rect);
+ bool MoveItem(int id, int x, int y, int width, int height, bool repaint = true);
+
+ void NormalizeSize(bool fullNormalize = false);
+ void NormalizePosition();
+};
+
+class CModelessDialog: public CDialog
+{
+public:
+ bool Create(LPCTSTR templateName, HWND parentWindow);
+ bool Create(UINT resID, HWND parentWindow) { return Create(MAKEINTRESOURCEW(resID), parentWindow); }
+ #ifndef _UNICODE
+ bool Create(LPCWSTR templateName, HWND parentWindow);
+ #endif
+ virtual void OnOK() { Destroy(); }
+ virtual void OnCancel() { Destroy(); }
+ virtual void OnClose() { Destroy(); }
+};
+
+class CModalDialog: public CDialog
+{
+public:
+ INT_PTR Create(LPCTSTR templateName, HWND parentWindow);
+ INT_PTR Create(UINT resID, HWND parentWindow) { return Create(MAKEINTRESOURCEW(resID), parentWindow); }
+ #ifndef _UNICODE
+ INT_PTR Create(LPCWSTR templateName, HWND parentWindow);
+ #endif
+
+ bool End(INT_PTR result) { return BOOLToBool(::EndDialog(_window, result)); }
+ virtual void OnOK() { End(IDOK); }
+ virtual void OnCancel() { End(IDCANCEL); }
+ virtual void OnClose() { End(IDCLOSE); }
+};
+
+class CDialogChildControl: public NWindows::CWindow
+{
+ int m_ID;
+public:
+ void Init(const NWindows::NControl::CDialog &parentDialog, int id)
+ {
+ m_ID = id;
+ Attach(parentDialog.GetItem(id));
+ }
+};
+
+bool IsDialogSizeOK(int xSize, int ySize);
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Edit.h b/other-licenses/7zstub/src/CPP/Windows/Control/Edit.h
new file mode 100644
index 0000000000..4f503aa7a5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Edit.h
@@ -0,0 +1,19 @@
+// Windows/Control/Edit.h
+
+#ifndef __WINDOWS_CONTROL_EDIT_H
+#define __WINDOWS_CONTROL_EDIT_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CEdit: public CWindow
+{
+public:
+ void SetPasswordChar(WPARAM c) { SendMsg(EM_SETPASSWORDCHAR, c); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ImageList.cpp b/other-licenses/7zstub/src/CPP/Windows/Control/ImageList.cpp
new file mode 100644
index 0000000000..d201c8fd7e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ImageList.cpp
@@ -0,0 +1,10 @@
+// Windows/Control/ImageList.cpp
+
+#include "StdAfx.h"
+
+#include "ImageList.h"
+
+namespace NWindows {
+namespace NControl {
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ImageList.h b/other-licenses/7zstub/src/CPP/Windows/Control/ImageList.h
new file mode 100644
index 0000000000..f72ea0d199
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ImageList.h
@@ -0,0 +1,87 @@
+// Windows/Control/ImageList.h
+
+#ifndef __WINDOWS_CONTROL_IMAGE_LIST_H
+#define __WINDOWS_CONTROL_IMAGE_LIST_H
+
+#include <commctrl.h>
+
+#include "../Defs.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CImageList
+{
+ HIMAGELIST m_Object;
+public:
+ operator HIMAGELIST() const {return m_Object; }
+ CImageList(): m_Object(NULL) {}
+ bool Attach(HIMAGELIST imageList)
+ {
+ if (imageList == NULL)
+ return false;
+ m_Object = imageList;
+ return true;
+ }
+
+ HIMAGELIST Detach()
+ {
+ HIMAGELIST imageList = m_Object;
+ m_Object = NULL;
+ return imageList;
+ }
+
+ bool Create(int width, int height, UINT flags, int initialNumber, int grow)
+ {
+ HIMAGELIST a = ImageList_Create(width, height, flags,
+ initialNumber, grow);
+ if (a == NULL)
+ return false;
+ return Attach(a);
+ }
+
+ bool Destroy() // DeleteImageList() in MFC
+ {
+ if (m_Object == NULL)
+ return false;
+ return BOOLToBool(ImageList_Destroy(Detach()));
+ }
+
+ ~CImageList()
+ { Destroy(); }
+
+ int GetImageCount() const
+ { return ImageList_GetImageCount(m_Object); }
+
+ bool GetImageInfo(int index, IMAGEINFO* imageInfo) const
+ { return BOOLToBool(ImageList_GetImageInfo(m_Object, index, imageInfo)); }
+
+ int Add(HBITMAP hbmImage, HBITMAP hbmMask = 0)
+ { return ImageList_Add(m_Object, hbmImage, hbmMask); }
+ int AddMasked(HBITMAP hbmImage, COLORREF mask)
+ { return ImageList_AddMasked(m_Object, hbmImage, mask); }
+ int AddIcon(HICON icon)
+ { return ImageList_AddIcon(m_Object, icon); }
+ int Replace(int index, HICON icon)
+ { return ImageList_ReplaceIcon(m_Object, index, icon); }
+
+ // If index is -1, the function removes all images.
+ bool Remove(int index)
+ { return BOOLToBool(ImageList_Remove(m_Object, index)); }
+ bool RemoveAll()
+ { return BOOLToBool(ImageList_RemoveAll(m_Object)); }
+
+ HICON ExtractIcon(int index)
+ { return ImageList_ExtractIcon(NULL, m_Object, index); }
+ HICON GetIcon(int index, UINT flags)
+ { return ImageList_GetIcon(m_Object, index, flags); }
+
+ bool GetIconSize(int &width, int &height) const
+ { return BOOLToBool(ImageList_GetIconSize(m_Object, &width, &height)); }
+ bool SetIconSize(int width, int height)
+ { return BOOLToBool(ImageList_SetIconSize(m_Object, width, height)); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ListView.cpp b/other-licenses/7zstub/src/CPP/Windows/Control/ListView.cpp
new file mode 100644
index 0000000000..fb22f95c1b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ListView.cpp
@@ -0,0 +1,155 @@
+// Windows/Control/ListView.cpp
+
+#include "StdAfx.h"
+
+#include "ListView.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NControl {
+
+bool CListView::CreateEx(DWORD exStyle, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam)
+{
+ return CWindow::CreateEx(exStyle, WC_LISTVIEW, TEXT(""), style, x, y, width,
+ height, parentWindow, idOrHMenu, instance, createParam);
+}
+
+bool CListView::GetItemParam(int index, LPARAM &param) const
+{
+ LVITEM item;
+ item.iItem = index;
+ item.iSubItem = 0;
+ item.mask = LVIF_PARAM;
+ bool aResult = GetItem(&item);
+ param = item.lParam;
+ return aResult;
+}
+
+int CListView::InsertColumn(int columnIndex, LPCTSTR text, int width)
+{
+ LVCOLUMN ci;
+ ci.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
+ ci.pszText = (LPTSTR)text;
+ ci.iSubItem = columnIndex;
+ ci.cx = width;
+ return InsertColumn(columnIndex, &ci);
+}
+
+int CListView::InsertItem(int index, LPCTSTR text)
+{
+ LVITEM item;
+ item.mask = LVIF_TEXT | LVIF_PARAM;
+ item.iItem = index;
+ item.lParam = index;
+ item.pszText = (LPTSTR)text;
+ item.iSubItem = 0;
+ return InsertItem(&item);
+}
+
+int CListView::SetSubItem(int index, int subIndex, LPCTSTR text)
+{
+ LVITEM item;
+ item.mask = LVIF_TEXT;
+ item.iItem = index;
+ item.pszText = (LPTSTR)text;
+ item.iSubItem = subIndex;
+ return SetItem(&item);
+}
+
+#ifndef _UNICODE
+
+int CListView::InsertColumn(int columnIndex, LPCWSTR text, int width)
+{
+ LVCOLUMNW ci;
+ ci.mask = LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM;
+ ci.pszText = (LPWSTR)text;
+ ci.iSubItem = columnIndex;
+ ci.cx = width;
+ return InsertColumn(columnIndex, &ci);
+}
+
+int CListView::InsertItem(int index, LPCWSTR text)
+{
+ LVITEMW item;
+ item.mask = LVIF_TEXT | LVIF_PARAM;
+ item.iItem = index;
+ item.lParam = index;
+ item.pszText = (LPWSTR)text;
+ item.iSubItem = 0;
+ return InsertItem(&item);
+}
+
+int CListView::SetSubItem(int index, int subIndex, LPCWSTR text)
+{
+ LVITEMW item;
+ item.mask = LVIF_TEXT;
+ item.iItem = index;
+ item.pszText = (LPWSTR)text;
+ item.iSubItem = subIndex;
+ return SetItem(&item);
+}
+
+#endif
+
+static LRESULT APIENTRY ListViewSubclassProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow window(hwnd);
+ CListView2 *w = (CListView2 *)(window.GetUserDataLongPtr());
+ if (w == NULL)
+ return 0;
+ return w->OnMessage(message, wParam, lParam);
+}
+
+LRESULT CListView2::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ #ifndef _UNICODE
+ if (g_IsNT)
+ return CallWindowProcW(_origWindowProc, *this, message, wParam, lParam);
+ else
+ #endif
+ return CallWindowProc(_origWindowProc, *this, message, wParam, lParam);
+}
+
+void CListView2::SetWindowProc()
+{
+ SetUserDataLongPtr((LONG_PTR)this);
+ #ifndef _UNICODE
+ if (g_IsNT)
+ _origWindowProc = (WNDPROC)SetLongPtrW(GWLP_WNDPROC, (LONG_PTR)ListViewSubclassProc);
+ else
+ #endif
+ _origWindowProc = (WNDPROC)SetLongPtr(GWLP_WNDPROC, (LONG_PTR)ListViewSubclassProc);
+}
+
+/*
+LRESULT CListView3::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT res = CListView2::OnMessage(message, wParam, lParam);
+ if (message == WM_GETDLGCODE)
+ {
+ // when user presses RETURN, windows sends default (first) button command to parent dialog.
+ // we disable this:
+ MSG *msg = (MSG *)lParam;
+ WPARAM key = wParam;
+ bool change = false;
+ if (msg)
+ {
+ if (msg->message == WM_KEYDOWN && msg->wParam == VK_RETURN)
+ change = true;
+ }
+ else if (wParam == VK_RETURN)
+ change = true;
+ if (change)
+ res |= DLGC_WANTALLKEYS;
+ }
+ return res;
+}
+*/
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ListView.h b/other-licenses/7zstub/src/CPP/Windows/Control/ListView.h
new file mode 100644
index 0000000000..1ed496d7e6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ListView.h
@@ -0,0 +1,146 @@
+// Windows/Control/ListView.h
+
+#ifndef __WINDOWS_CONTROL_LISTVIEW_H
+#define __WINDOWS_CONTROL_LISTVIEW_H
+
+#include "../../Common/MyWindows.h"
+
+#include <commctrl.h>
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CListView: public NWindows::CWindow
+{
+public:
+ bool CreateEx(DWORD exStyle, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam);
+
+ void SetUnicodeFormat()
+ {
+ #ifndef UNDER_CE
+ ListView_SetUnicodeFormat(_window, TRUE);
+ #endif
+ }
+
+ bool DeleteAllItems() { return BOOLToBool(ListView_DeleteAllItems(_window)); }
+ bool DeleteColumn(int columnIndex) { return BOOLToBool(ListView_DeleteColumn(_window, columnIndex)); }
+
+ int InsertColumn(int columnIndex, const LVCOLUMN *columnInfo) { return ListView_InsertColumn(_window, columnIndex, columnInfo); }
+ int InsertColumn(int columnIndex, LPCTSTR text, int width);
+ bool SetColumnOrderArray(int count, const int *columns) { return BOOLToBool(ListView_SetColumnOrderArray(_window, count, columns)); }
+
+ /*
+ int GetNumColumns()
+ {
+ HWND header = ListView_GetHeader(_window);
+ if (!header)
+ return -1;
+ return Header_GetItemCount(header);
+ }
+ */
+
+ int InsertItem(const LVITEM* item) { return ListView_InsertItem(_window, item); }
+ int InsertItem(int index, LPCTSTR text);
+ bool SetItem(const LVITEM* item) { return BOOLToBool(ListView_SetItem(_window, item)); }
+ int SetSubItem(int index, int subIndex, LPCTSTR text);
+
+ #ifndef _UNICODE
+
+ int InsertColumn(int columnIndex, const LVCOLUMNW *columnInfo) { return (int)SendMsg(LVM_INSERTCOLUMNW, (WPARAM)columnIndex, (LPARAM)columnInfo); }
+ int InsertColumn(int columnIndex, LPCWSTR text, int width);
+ int InsertItem(const LV_ITEMW* item) { return (int)SendMsg(LVM_INSERTITEMW, 0, (LPARAM)item); }
+ int InsertItem(int index, LPCWSTR text);
+ bool SetItem(const LV_ITEMW* item) { return BOOLToBool((BOOL)SendMsg(LVM_SETITEMW, 0, (LPARAM)item)); }
+ int SetSubItem(int index, int subIndex, LPCWSTR text);
+
+ #endif
+
+ bool DeleteItem(int itemIndex) { return BOOLToBool(ListView_DeleteItem(_window, itemIndex)); }
+
+ UINT GetSelectedCount() const { return ListView_GetSelectedCount(_window); }
+ int GetItemCount() const { return ListView_GetItemCount(_window); }
+
+ INT GetSelectionMark() const { return ListView_GetSelectionMark(_window); }
+
+ void SetItemCount(int numItems) { ListView_SetItemCount(_window, numItems); }
+ void SetItemCountEx(int numItems, DWORD flags) { ListView_SetItemCountEx(_window, numItems, flags); }
+
+ int GetNextItem(int startIndex, UINT flags) const { return ListView_GetNextItem(_window, startIndex, flags); }
+ int GetNextSelectedItem(int startIndex) const { return GetNextItem(startIndex, LVNI_SELECTED); }
+ int GetFocusedItem() const { return GetNextItem(-1, LVNI_FOCUSED); }
+
+ bool GetItem(LVITEM* item) const { return BOOLToBool(ListView_GetItem(_window, item)); }
+ bool GetItemParam(int itemIndex, LPARAM &param) const;
+ void GetItemText(int itemIndex, int subItemIndex, LPTSTR text, int textSizeMax) const
+ { ListView_GetItemText(_window, itemIndex, subItemIndex, text, textSizeMax); }
+ bool SortItems(PFNLVCOMPARE compareFunction, LPARAM dataParam)
+ { return BOOLToBool(ListView_SortItems(_window, compareFunction, dataParam)); }
+
+ void SetItemState(int index, UINT state, UINT mask) { ListView_SetItemState(_window, index, state, mask); }
+ void SetItemState_Selected(int index, bool select) { SetItemState(index, select ? LVIS_SELECTED : 0, LVIS_SELECTED); }
+ void SetItemState_Selected(int index) { SetItemState(index, LVIS_SELECTED, LVIS_SELECTED); }
+ void SelectAll() { SetItemState_Selected(-1); }
+ void SetItemState_FocusedSelected(int index) { SetItemState(index, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED); }
+ UINT GetItemState(int index, UINT mask) const { return ListView_GetItemState(_window, index, mask); }
+ bool IsItemSelected(int index) const { return GetItemState(index, LVIS_SELECTED) == LVIS_SELECTED; }
+
+ bool GetColumn(int columnIndex, LVCOLUMN* columnInfo) const
+ { return BOOLToBool(ListView_GetColumn(_window, columnIndex, columnInfo)); }
+
+ HIMAGELIST SetImageList(HIMAGELIST imageList, int imageListType)
+ { return ListView_SetImageList(_window, imageList, imageListType); }
+
+ // version 4.70: NT5 | (NT4 + ie3) | w98 | (w95 + ie3)
+ DWORD GetExtendedListViewStyle() { return ListView_GetExtendedListViewStyle(_window); }
+ void SetExtendedListViewStyle(DWORD exStyle) { ListView_SetExtendedListViewStyle(_window, exStyle); }
+ void SetExtendedListViewStyle(DWORD exMask, DWORD exStyle) { ListView_SetExtendedListViewStyleEx(_window, exMask, exStyle); }
+
+ void SetCheckState(UINT index, bool checkState) { ListView_SetCheckState(_window, index, BoolToBOOL(checkState)); }
+ bool GetCheckState(UINT index) { return BOOLToBool(ListView_GetCheckState(_window, index)); }
+
+ bool EnsureVisible(int index, bool partialOK) { return BOOLToBool(ListView_EnsureVisible(_window, index, BoolToBOOL(partialOK))); }
+
+ bool GetItemRect(int index, RECT *rect, int code) { return BOOLToBool(ListView_GetItemRect(_window, index, rect, code)); }
+
+ HWND GetEditControl() { return ListView_GetEditControl(_window) ; }
+ HWND EditLabel(int itemIndex) { return ListView_EditLabel(_window, itemIndex) ; }
+
+ bool RedrawItems(int firstIndex, int lastIndex) { return BOOLToBool(ListView_RedrawItems(_window, firstIndex, lastIndex)); }
+ bool RedrawAllItems()
+ {
+ if (GetItemCount() > 0)
+ return RedrawItems(0, GetItemCount() - 1);
+ return true;
+ }
+ bool RedrawItem(int index) { return RedrawItems(index, index); }
+
+ int HitTest(LPLVHITTESTINFO info) { return ListView_HitTest(_window, info); }
+ COLORREF GetBkColor() { return ListView_GetBkColor(_window); }
+ bool SetColumnWidth(int iCol, int cx) { return BOOLToBool(ListView_SetColumnWidth(_window, iCol, cx)); }
+ bool SetColumnWidthAuto(int iCol) { return SetColumnWidth(iCol, LVSCW_AUTOSIZE); }
+};
+
+class CListView2: public CListView
+{
+ WNDPROC _origWindowProc;
+public:
+ void SetWindowProc();
+ virtual LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+};
+
+/*
+class CListView3: public CListView2
+{
+public:
+ virtual LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+};
+*/
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ProgressBar.h b/other-licenses/7zstub/src/CPP/Windows/Control/ProgressBar.h
new file mode 100644
index 0000000000..f18d89c14f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ProgressBar.h
@@ -0,0 +1,35 @@
+// Windows/Control/ProgressBar.h
+
+#ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
+#define __WINDOWS_CONTROL_PROGRESSBAR_H
+
+#include "../../Common/MyWindows.h"
+
+#include <commctrl.h>
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CProgressBar: public CWindow
+{
+public:
+ LRESULT SetPos(int pos) { return SendMsg(PBM_SETPOS, pos, 0); }
+ LRESULT DeltaPos(int increment) { return SendMsg(PBM_DELTAPOS, increment, 0); }
+ UINT GetPos() { return (UINT)SendMsg(PBM_GETPOS, 0, 0); }
+ LRESULT SetRange(unsigned short minValue, unsigned short maxValue) { return SendMsg(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
+ DWORD SetRange32(int minValue, int maxValue) { return (DWORD)SendMsg(PBM_SETRANGE32, minValue, maxValue); }
+ int SetStep(int step) { return (int)SendMsg(PBM_SETSTEP, step, 0); }
+ LRESULT StepIt() { return SendMsg(PBM_STEPIT, 0, 0); }
+ INT GetRange(bool minValue, PPBRANGE range) { return (INT)SendMsg(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
+
+ #ifndef UNDER_CE
+ COLORREF SetBarColor(COLORREF color) { return (COLORREF)SendMsg(PBM_SETBARCOLOR, 0, color); }
+ COLORREF SetBackgroundColor(COLORREF color) { return (COLORREF)SendMsg(PBM_SETBKCOLOR, 0, color); }
+ #endif
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.cpp b/other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.cpp
new file mode 100644
index 0000000000..48947c018d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.cpp
@@ -0,0 +1,143 @@
+// Windows/Control/PropertyPage.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../../Common/StringConvert.h"
+#endif
+
+#include "PropertyPage.h"
+
+extern HINSTANCE g_hInstance;
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NControl {
+
+static INT_PTR APIENTRY MyProperyPageProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow tempDialog(dialogHWND);
+ if (message == WM_INITDIALOG)
+ tempDialog.SetUserDataLongPtr(((PROPSHEETPAGE *)lParam)->lParam);
+ CDialog *dialog = (CDialog *)(tempDialog.GetUserDataLongPtr());
+ if (dialog == NULL)
+ return FALSE;
+ if (message == WM_INITDIALOG)
+ dialog->Attach(dialogHWND);
+ try { return BoolToBOOL(dialog->OnMessage(message, wParam, lParam)); }
+ catch(...) { return TRUE; }
+}
+
+bool CPropertyPage::OnNotify(UINT /* controlID */, LPNMHDR lParam)
+{
+ switch (lParam->code)
+ {
+ case PSN_APPLY: SetMsgResult(OnApply(LPPSHNOTIFY(lParam))); break;
+ case PSN_KILLACTIVE: SetMsgResult(BoolToBOOL(OnKillActive(LPPSHNOTIFY(lParam)))); break;
+ case PSN_SETACTIVE: SetMsgResult(OnSetActive(LPPSHNOTIFY(lParam))); break;
+ case PSN_RESET: OnReset(LPPSHNOTIFY(lParam)); break;
+ case PSN_HELP: OnNotifyHelp(LPPSHNOTIFY(lParam)); break;
+ default: return false;
+ }
+ return true;
+}
+
+INT_PTR MyPropertySheet(const CObjectVector<CPageInfo> &pagesInfo, HWND hwndParent, const UString &title)
+{
+ #ifndef _UNICODE
+ AStringVector titles;
+ #endif
+ #ifndef _UNICODE
+ CRecordVector<PROPSHEETPAGEA> pagesA;
+ #endif
+ CRecordVector<PROPSHEETPAGEW> pagesW;
+
+ unsigned i;
+ #ifndef _UNICODE
+ for (i = 0; i < pagesInfo.Size(); i++)
+ titles.Add(GetSystemString(pagesInfo[i].Title));
+ #endif
+
+ for (i = 0; i < pagesInfo.Size(); i++)
+ {
+ const CPageInfo &pageInfo = pagesInfo[i];
+ #ifndef _UNICODE
+ {
+ PROPSHEETPAGE page;
+ page.dwSize = sizeof(page);
+ page.dwFlags = PSP_HASHELP;
+ page.hInstance = g_hInstance;
+ page.pszTemplate = MAKEINTRESOURCE(pageInfo.ID);
+ page.pszIcon = NULL;
+ page.pfnDlgProc = NWindows::NControl::MyProperyPageProcedure;
+
+ if (titles[i].IsEmpty())
+ page.pszTitle = NULL;
+ else
+ {
+ page.dwFlags |= PSP_USETITLE;
+ page.pszTitle = titles[i];
+ }
+ page.lParam = (LPARAM)pageInfo.Page;
+ page.pfnCallback = NULL;
+ pagesA.Add(page);
+ }
+ #endif
+ {
+ PROPSHEETPAGEW page;
+ page.dwSize = sizeof(page);
+ page.dwFlags = PSP_HASHELP;
+ page.hInstance = g_hInstance;
+ page.pszTemplate = MAKEINTRESOURCEW(pageInfo.ID);
+ page.pszIcon = NULL;
+ page.pfnDlgProc = NWindows::NControl::MyProperyPageProcedure;
+
+ if (pageInfo.Title.IsEmpty())
+ page.pszTitle = NULL;
+ else
+ {
+ page.dwFlags |= PSP_USETITLE;
+ page.pszTitle = pageInfo.Title;
+ }
+ page.lParam = (LPARAM)pageInfo.Page;
+ page.pfnCallback = NULL;
+ pagesW.Add(page);
+ }
+ }
+
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ PROPSHEETHEADER sheet;
+ sheet.dwSize = sizeof(sheet);
+ sheet.dwFlags = PSH_PROPSHEETPAGE;
+ sheet.hwndParent = hwndParent;
+ sheet.hInstance = g_hInstance;
+ AString titleA (GetSystemString(title));
+ sheet.pszCaption = titleA;
+ sheet.nPages = pagesInfo.Size();
+ sheet.nStartPage = 0;
+ sheet.ppsp = &pagesA.Front();
+ sheet.pfnCallback = NULL;
+ return ::PropertySheetA(&sheet);
+ }
+ else
+ #endif
+ {
+ PROPSHEETHEADERW sheet;
+ sheet.dwSize = sizeof(sheet);
+ sheet.dwFlags = PSH_PROPSHEETPAGE;
+ sheet.hwndParent = hwndParent;
+ sheet.hInstance = g_hInstance;
+ sheet.pszCaption = title;
+ sheet.nPages = pagesInfo.Size();
+ sheet.nStartPage = 0;
+ sheet.ppsp = &pagesW.Front();
+ sheet.pfnCallback = NULL;
+ return ::PropertySheetW(&sheet);
+ }
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.h b/other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.h
new file mode 100644
index 0000000000..551c95994c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/PropertyPage.h
@@ -0,0 +1,50 @@
+// Windows/Control/PropertyPage.h
+
+#ifndef __WINDOWS_CONTROL_PROPERTYPAGE_H
+#define __WINDOWS_CONTROL_PROPERTYPAGE_H
+
+#include "../../Common/MyWindows.h"
+
+#include <prsht.h>
+
+#include "Dialog.h"
+
+namespace NWindows {
+namespace NControl {
+
+INT_PTR APIENTRY ProperyPageProcedure(HWND dialogHWND, UINT message, WPARAM wParam, LPARAM lParam);
+
+class CPropertyPage: public CDialog
+{
+public:
+ CPropertyPage(HWND window = NULL): CDialog(window){};
+
+ void Changed() { PropSheet_Changed(GetParent(), (HWND)*this); }
+ void UnChanged() { PropSheet_UnChanged(GetParent(), (HWND)*this); }
+
+ virtual bool OnNotify(UINT controlID, LPNMHDR lParam);
+
+ virtual bool OnKillActive() { return false; } // false = OK
+ virtual bool OnKillActive(const PSHNOTIFY *) { return OnKillActive(); }
+ virtual LONG OnSetActive() { return false; } // false = OK
+ virtual LONG OnSetActive(const PSHNOTIFY *) { return OnSetActive(); }
+ virtual LONG OnApply() { return PSNRET_NOERROR; }
+ virtual LONG OnApply(const PSHNOTIFY *) { return OnApply(); }
+ virtual void OnNotifyHelp() {}
+ virtual void OnNotifyHelp(const PSHNOTIFY *) { OnNotifyHelp(); }
+ virtual void OnReset() {}
+ virtual void OnReset(const PSHNOTIFY *) { OnReset(); }
+};
+
+struct CPageInfo
+{
+ CPropertyPage *Page;
+ UString Title;
+ UINT ID;
+};
+
+INT_PTR MyPropertySheet(const CObjectVector<CPageInfo> &pagesInfo, HWND hwndParent, const UString &title);
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ReBar.h b/other-licenses/7zstub/src/CPP/Windows/Control/ReBar.h
new file mode 100644
index 0000000000..26fa311053
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ReBar.h
@@ -0,0 +1,34 @@
+// Windows/Control/ReBar.h
+
+#ifndef __WINDOWS_CONTROL_REBAR_H
+#define __WINDOWS_CONTROL_REBAR_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CReBar: public NWindows::CWindow
+{
+public:
+ bool SetBarInfo(LPREBARINFO barInfo)
+ { return LRESULTToBool(SendMsg(RB_SETBARINFO, 0, (LPARAM)barInfo)); }
+ bool InsertBand(int index, LPREBARBANDINFO bandInfo)
+ { return LRESULTToBool(SendMsg(RB_INSERTBAND, index, (LPARAM)bandInfo)); }
+ bool SetBandInfo(unsigned index, LPREBARBANDINFO bandInfo)
+ { return LRESULTToBool(SendMsg(RB_SETBANDINFO, index, (LPARAM)bandInfo)); }
+ void MaximizeBand(unsigned index, bool ideal)
+ { SendMsg(RB_MAXIMIZEBAND, index, BoolToBOOL(ideal)); }
+ bool SizeToRect(LPRECT rect)
+ { return LRESULTToBool(SendMsg(RB_SIZETORECT, 0, (LPARAM)rect)); }
+ UINT GetHeight()
+ { return (UINT)SendMsg(RB_GETBARHEIGHT); }
+ UINT GetBandCount()
+ { return (UINT)SendMsg(RB_GETBANDCOUNT); }
+ bool DeleteBand(UINT index)
+ { return LRESULTToBool(SendMsg(RB_DELETEBAND, index)); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Static.h b/other-licenses/7zstub/src/CPP/Windows/Control/Static.h
new file mode 100644
index 0000000000..936dd3c881
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Static.h
@@ -0,0 +1,28 @@
+// Windows/Control/Static.h
+
+#ifndef __WINDOWS_CONTROL_STATIC_H
+#define __WINDOWS_CONTROL_STATIC_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CStatic: public CWindow
+{
+public:
+ HANDLE SetImage(WPARAM imageType, HANDLE handle) { return (HANDLE)SendMsg(STM_SETIMAGE, imageType, (LPARAM)handle); }
+ HANDLE GetImage(WPARAM imageType) { return (HANDLE)SendMsg(STM_GETIMAGE, imageType, 0); }
+
+ #ifdef UNDER_CE
+ HICON SetIcon(HICON icon) { return (HICON)SetImage(IMAGE_ICON, icon); }
+ HICON GetIcon() { return (HICON)GetImage(IMAGE_ICON); }
+ #else
+ HICON SetIcon(HICON icon) { return (HICON)SendMsg(STM_SETICON, (WPARAM)icon, 0); }
+ HICON GetIcon() { return (HICON)SendMsg(STM_GETICON, 0, 0); }
+ #endif
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/StatusBar.h b/other-licenses/7zstub/src/CPP/Windows/Control/StatusBar.h
new file mode 100644
index 0000000000..7f7d66b0bf
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/StatusBar.h
@@ -0,0 +1,42 @@
+// Windows/Control/StatusBar.h
+
+#ifndef __WINDOWS_CONTROL_STATUSBAR_H
+#define __WINDOWS_CONTROL_STATUSBAR_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CStatusBar: public NWindows::CWindow
+{
+public:
+ bool Create(LONG style, LPCTSTR text, HWND hwndParent, UINT id)
+ { return (_window = ::CreateStatusWindow(style, text, hwndParent, id)) != 0; }
+ bool SetText(LPCTSTR text)
+ { return CWindow::SetText(text); }
+ bool SetText(unsigned index, LPCTSTR text, UINT type)
+ { return LRESULTToBool(SendMsg(SB_SETTEXT, index | type, (LPARAM)text)); }
+ bool SetText(unsigned index, LPCTSTR text)
+ { return SetText(index, text, 0); }
+
+ #ifndef _UNICODE
+ bool Create(LONG style, LPCWSTR text, HWND hwndParent, UINT id)
+ { return (_window = ::CreateStatusWindowW(style, text, hwndParent, id)) != 0; }
+ bool SetText(LPCWSTR text)
+ { return CWindow::SetText(text); }
+ bool SetText(unsigned index, LPCWSTR text, UINT type)
+ { return LRESULTToBool(SendMsg(SB_SETTEXTW, index | type, (LPARAM)text)); }
+ bool SetText(unsigned index, LPCWSTR text)
+ { return SetText(index, text, 0); }
+ #endif
+
+ bool SetParts(unsigned numParts, const int *edgePostions)
+ { return LRESULTToBool(SendMsg(SB_SETPARTS, numParts, (LPARAM)edgePostions)); }
+ void Simple(bool simple)
+ { SendMsg(SB_SIMPLE, BoolToBOOL(simple), 0); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/StdAfx.h b/other-licenses/7zstub/src/CPP/Windows/Control/StdAfx.h
new file mode 100644
index 0000000000..42a088f121
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/ToolBar.h b/other-licenses/7zstub/src/CPP/Windows/Control/ToolBar.h
new file mode 100644
index 0000000000..02ed9a1423
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/ToolBar.h
@@ -0,0 +1,43 @@
+// Windows/Control/ToolBar.h
+
+#ifndef __WINDOWS_CONTROL_TOOLBAR_H
+#define __WINDOWS_CONTROL_TOOLBAR_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CToolBar: public NWindows::CWindow
+{
+public:
+ void AutoSize() { SendMsg(TB_AUTOSIZE, 0, 0); }
+ DWORD GetButtonSize() { return (DWORD)SendMsg(TB_GETBUTTONSIZE, 0, 0); }
+
+ bool GetMaxSize(LPSIZE size)
+ #ifdef UNDER_CE
+ {
+ // maybe it must be fixed for more than 1 buttons
+ DWORD val = GetButtonSize();
+ size->cx = LOWORD(val);
+ size->cy = HIWORD(val);
+ return true;
+ }
+ #else
+ {
+ return LRESULTToBool(SendMsg(TB_GETMAXSIZE, 0, (LPARAM)size));
+ }
+ #endif
+
+ bool EnableButton(UINT buttonID, bool enable) { return LRESULTToBool(SendMsg(TB_ENABLEBUTTON, buttonID, MAKELONG(BoolToBOOL(enable), 0))); }
+ void ButtonStructSize() { SendMsg(TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON)); }
+ HIMAGELIST SetImageList(UINT listIndex, HIMAGELIST imageList) { return HIMAGELIST(SendMsg(TB_SETIMAGELIST, listIndex, (LPARAM)imageList)); }
+ bool AddButton(UINT numButtons, LPTBBUTTON buttons) { return LRESULTToBool(SendMsg(TB_ADDBUTTONS, numButtons, (LPARAM)buttons)); }
+ #ifndef _UNICODE
+ bool AddButtonW(UINT numButtons, LPTBBUTTON buttons) { return LRESULTToBool(SendMsg(TB_ADDBUTTONSW, numButtons, (LPARAM)buttons)); }
+ #endif
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Trackbar.h b/other-licenses/7zstub/src/CPP/Windows/Control/Trackbar.h
new file mode 100644
index 0000000000..afc9bf25c5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Trackbar.h
@@ -0,0 +1,27 @@
+// Windows/Control/Trackbar.h
+
+#ifndef __WINDOWS_CONTROL_TRACKBAR_H
+#define __WINDOWS_CONTROL_TRACKBAR_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CTrackbar: public CWindow
+{
+public:
+ void SetRange(int minimum, int maximum, bool redraw = true)
+ { SendMsg(TBM_SETRANGE, BoolToBOOL(redraw), MAKELONG(minimum, maximum)); }
+ void SetPos(int pos, bool redraw = true)
+ { SendMsg(TBM_SETPOS, BoolToBOOL(redraw), pos); }
+ void SetTicFreq(int freq)
+ { SendMsg(TBM_SETTICFREQ, freq); }
+
+ int GetPos()
+ { return (int)SendMsg(TBM_GETPOS); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Window2.cpp b/other-licenses/7zstub/src/CPP/Windows/Control/Window2.cpp
new file mode 100644
index 0000000000..b6e6d67daf
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Window2.cpp
@@ -0,0 +1,200 @@
+// Windows/Control/Window2.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../../Common/StringConvert.h"
+#endif
+
+#include "Window2.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+
+#ifndef _UNICODE
+ATOM MyRegisterClass(CONST WNDCLASSW *wndClass);
+#endif
+
+namespace NControl {
+
+#ifdef UNDER_CE
+#define MY_START_WM_CREATE WM_CREATE
+#else
+#define MY_START_WM_CREATE WM_NCCREATE
+#endif
+
+static LRESULT CALLBACK WindowProcedure(HWND aHWND, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ CWindow tempWindow(aHWND);
+ if (message == MY_START_WM_CREATE)
+ tempWindow.SetUserDataLongPtr((LONG_PTR)(((LPCREATESTRUCT)lParam)->lpCreateParams));
+ CWindow2 *window = (CWindow2 *)(tempWindow.GetUserDataLongPtr());
+ if (window != NULL && message == MY_START_WM_CREATE)
+ window->Attach(aHWND);
+ if (window == 0)
+ {
+ #ifndef _UNICODE
+ if (g_IsNT)
+ return DefWindowProcW(aHWND, message, wParam, lParam);
+ else
+ #endif
+ return DefWindowProc(aHWND, message, wParam, lParam);
+ }
+ return window->OnMessage(message, wParam, lParam);
+}
+
+bool CWindow2::CreateEx(DWORD exStyle, LPCTSTR className, LPCTSTR windowName,
+ DWORD style, int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance)
+{
+ WNDCLASS wc;
+ if (!::GetClassInfo(instance, className, &wc))
+ {
+ // wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.style = 0;
+ wc.lpfnWndProc = WindowProcedure;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = instance;
+ wc.hIcon = NULL;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = className;
+ if (::RegisterClass(&wc) == 0)
+ return false;
+ }
+ return CWindow::CreateEx(exStyle, className, windowName, style,
+ x, y, width, height, parentWindow, idOrHMenu, instance, this);
+}
+
+#ifndef _UNICODE
+
+bool CWindow2::CreateEx(DWORD exStyle, LPCWSTR className, LPCWSTR windowName,
+ DWORD style, int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance)
+{
+ bool needRegister;
+ if (g_IsNT)
+ {
+ WNDCLASSW wc;
+ needRegister = ::GetClassInfoW(instance, className, &wc) == 0;
+ }
+ else
+ {
+ WNDCLASSA windowClassA;
+ AString classNameA;
+ LPCSTR classNameP;
+ if (IS_INTRESOURCE(className))
+ classNameP = (LPCSTR)className;
+ else
+ {
+ classNameA = GetSystemString(className);
+ classNameP = classNameA;
+ }
+ needRegister = ::GetClassInfoA(instance, classNameP, &windowClassA) == 0;
+ }
+ if (needRegister)
+ {
+ WNDCLASSW wc;
+ // wc.style = CS_HREDRAW | CS_VREDRAW;
+ wc.style = 0;
+ wc.lpfnWndProc = WindowProcedure;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 0;
+ wc.hInstance = instance;
+ wc.hIcon = NULL;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = className;
+ if (MyRegisterClass(&wc) == 0)
+ return false;
+ }
+ return CWindow::CreateEx(exStyle, className, windowName, style,
+ x, y, width, height, parentWindow, idOrHMenu, instance, this);
+}
+
+#endif
+
+LRESULT CWindow2::DefProc(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ #ifndef _UNICODE
+ if (g_IsNT)
+ return DefWindowProcW(_window, message, wParam, lParam);
+ else
+ #endif
+ return DefWindowProc(_window, message, wParam, lParam);
+}
+
+LRESULT CWindow2::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
+{
+ LRESULT result;
+ switch (message)
+ {
+ case WM_CREATE:
+ if (!OnCreate((CREATESTRUCT *)lParam))
+ return -1;
+ break;
+ case WM_COMMAND:
+ if (OnCommand(wParam, lParam, result))
+ return result;
+ break;
+ case WM_NOTIFY:
+ if (OnNotify((UINT)wParam, (LPNMHDR) lParam, result))
+ return result;
+ break;
+ case WM_DESTROY:
+ OnDestroy();
+ break;
+ case WM_CLOSE:
+ OnClose();
+ return 0;
+ case WM_SIZE:
+ if (OnSize(wParam, LOWORD(lParam), HIWORD(lParam)))
+ return 0;
+ }
+ return DefProc(message, wParam, lParam);
+}
+
+bool CWindow2::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT &result)
+{
+ return OnCommand(HIWORD(wParam), LOWORD(wParam), lParam, result);
+}
+
+bool CWindow2::OnCommand(int /* code */, int /* itemID */, LPARAM /* lParam */, LRESULT & /* result */)
+{
+ return false;
+ // return DefProc(message, wParam, lParam);
+ /*
+ if (code == BN_CLICKED)
+ return OnButtonClicked(itemID, (HWND)lParam);
+ */
+}
+
+/*
+bool CDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
+{
+ switch (buttonID)
+ {
+ case IDOK:
+ OnOK();
+ break;
+ case IDCANCEL:
+ OnCancel();
+ break;
+ case IDHELP:
+ OnHelp();
+ break;
+ default:
+ return false;
+ }
+ return true;
+}
+
+*/
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Control/Window2.h b/other-licenses/7zstub/src/CPP/Windows/Control/Window2.h
new file mode 100644
index 0000000000..d632b86fea
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Control/Window2.h
@@ -0,0 +1,51 @@
+// Windows/Control/Window2.h
+
+#ifndef __WINDOWS_CONTROL_WINDOW2_H
+#define __WINDOWS_CONTROL_WINDOW2_H
+
+#include "../Window.h"
+
+namespace NWindows {
+namespace NControl {
+
+class CWindow2: public CWindow
+{
+ LRESULT DefProc(UINT message, WPARAM wParam, LPARAM lParam);
+public:
+ CWindow2(HWND newWindow = NULL): CWindow(newWindow){};
+ virtual ~CWindow2() {};
+
+ bool CreateEx(DWORD exStyle, LPCTSTR className, LPCTSTR windowName,
+ DWORD style, int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance);
+
+ #ifndef _UNICODE
+ bool CreateEx(DWORD exStyle, LPCWSTR className, LPCWSTR windowName,
+ DWORD style, int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu, HINSTANCE instance);
+ #endif
+
+ virtual LRESULT OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
+ virtual bool OnCreate(CREATESTRUCT * /* createStruct */) { return true; }
+ // virtual LRESULT OnCommand(WPARAM wParam, LPARAM lParam);
+ virtual bool OnCommand(WPARAM wParam, LPARAM lParam, LRESULT &result);
+ virtual bool OnCommand(int code, int itemID, LPARAM lParam, LRESULT &result);
+ virtual bool OnSize(WPARAM /* wParam */, int /* xSize */, int /* ySize */) { return false; }
+ virtual bool OnNotify(UINT /* controlID */, LPNMHDR /* lParam */, LRESULT & /* result */) { return false; }
+ virtual void OnDestroy() { PostQuitMessage(0); }
+ virtual void OnClose() { Destroy(); }
+ /*
+ virtual LRESULT OnHelp(LPHELPINFO helpInfo) { OnHelp(); }
+ virtual LRESULT OnHelp() {};
+ virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
+ virtual void OnOK() {};
+ virtual void OnCancel() {};
+ */
+
+ LONG_PTR SetMsgResult(LONG_PTR newLongPtr) { return SetLongPtr(DWLP_MSGRESULT, newLongPtr); }
+ LONG_PTR GetMsgResult() const { return GetLongPtr(DWLP_MSGRESULT); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/DLL.cpp b/other-licenses/7zstub/src/CPP/Windows/DLL.cpp
new file mode 100644
index 0000000000..efee379b7e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/DLL.cpp
@@ -0,0 +1,109 @@
+// Windows/DLL.cpp
+
+#include "StdAfx.h"
+
+#include "DLL.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+extern HINSTANCE g_hInstance;
+
+namespace NWindows {
+namespace NDLL {
+
+bool CLibrary::Free() throw()
+{
+ if (_module == 0)
+ return true;
+ if (!::FreeLibrary(_module))
+ return false;
+ _module = 0;
+ return true;
+}
+
+bool CLibrary::LoadEx(CFSTR path, DWORD flags) throw()
+{
+ if (!Free())
+ return false;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ _module = ::LoadLibraryEx(fs2fas(path), NULL, flags);
+ }
+ else
+ #endif
+ {
+ _module = ::LoadLibraryExW(fs2us(path), NULL, flags);
+ }
+ return (_module != NULL);
+}
+
+bool CLibrary::Load(CFSTR path) throw()
+{
+ if (!Free())
+ return false;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ _module = ::LoadLibrary(fs2fas(path));
+ }
+ else
+ #endif
+ {
+ _module = ::LoadLibraryW(fs2us(path));
+ }
+ return (_module != NULL);
+}
+
+bool MyGetModuleFileName(FString &path)
+{
+ HMODULE hModule = g_hInstance;
+ path.Empty();
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ DWORD size = ::GetModuleFileName(hModule, s, MAX_PATH + 1);
+ if (size <= MAX_PATH && size != 0)
+ {
+ path = fas2fs(s);
+ return true;
+ }
+ }
+ else
+ #endif
+ {
+ WCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ DWORD size = ::GetModuleFileNameW(hModule, s, MAX_PATH + 1);
+ if (size <= MAX_PATH && size != 0)
+ {
+ path = us2fs(s);
+ return true;
+ }
+ }
+ return false;
+}
+
+#ifndef _SFX
+
+FString GetModuleDirPrefix()
+{
+ FString s;
+ if (MyGetModuleFileName(s))
+ {
+ int pos = s.ReverseFind_PathSepar();
+ if (pos >= 0)
+ s.DeleteFrom(pos + 1);
+ }
+ if (s.IsEmpty())
+ s = "." STRING_PATH_SEPARATOR;
+ return s;
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/DLL.h b/other-licenses/7zstub/src/CPP/Windows/DLL.h
new file mode 100644
index 0000000000..58bcf19549
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/DLL.h
@@ -0,0 +1,58 @@
+// Windows/DLL.h
+
+#ifndef __WINDOWS_DLL_H
+#define __WINDOWS_DLL_H
+
+#include "../Common/MyString.h"
+
+namespace NWindows {
+namespace NDLL {
+
+#ifdef UNDER_CE
+#define My_GetProcAddress(module, procName) ::GetProcAddressA(module, procName)
+#else
+#define My_GetProcAddress(module, procName) ::GetProcAddress(module, procName)
+#endif
+
+/* Win32: Don't call CLibrary::Free() and FreeLibrary() from another
+ FreeLibrary() code: detaching code in DLL entry-point or in
+ destructors of global objects in DLL module. */
+
+class CLibrary
+{
+ HMODULE _module;
+
+ // CLASS_NO_COPY(CLibrary);
+public:
+ CLibrary(): _module(NULL) {};
+ ~CLibrary() { Free(); }
+
+ operator HMODULE() const { return _module; }
+ HMODULE* operator&() { return &_module; }
+ bool IsLoaded() const { return (_module != NULL); }
+
+ void Attach(HMODULE m)
+ {
+ Free();
+ _module = m;
+ }
+ HMODULE Detach()
+ {
+ HMODULE m = _module;
+ _module = NULL;
+ return m;
+ }
+
+ bool Free() throw();
+ bool LoadEx(CFSTR path, DWORD flags = LOAD_LIBRARY_AS_DATAFILE) throw();
+ bool Load(CFSTR path) throw();
+ FARPROC GetProc(LPCSTR procName) const { return My_GetProcAddress(_module, procName); }
+};
+
+bool MyGetModuleFileName(FString &path);
+
+FString GetModuleDirPrefix();
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Defs.h b/other-licenses/7zstub/src/CPP/Windows/Defs.h
new file mode 100644
index 0000000000..f3d692f3dd
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Defs.h
@@ -0,0 +1,17 @@
+// Windows/Defs.h
+
+#ifndef __WINDOWS_DEFS_H
+#define __WINDOWS_DEFS_H
+
+#include "../Common/MyWindows.h"
+
+#ifdef _WIN32
+inline bool LRESULTToBool(LRESULT v) { return (v != FALSE); }
+inline bool BOOLToBool(BOOL v) { return (v != FALSE); }
+inline BOOL BoolToBOOL(bool v) { return (v ? TRUE: FALSE); }
+#endif
+
+inline VARIANT_BOOL BoolToVARIANT_BOOL(bool v) { return (v ? VARIANT_TRUE: VARIANT_FALSE); }
+inline bool VARIANT_BOOLToBool(VARIANT_BOOL v) { return (v != VARIANT_FALSE); }
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/ErrorMsg.cpp b/other-licenses/7zstub/src/CPP/Windows/ErrorMsg.cpp
new file mode 100644
index 0000000000..6434ec2f7d
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/ErrorMsg.cpp
@@ -0,0 +1,66 @@
+// Windows/ErrorMsg.h
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "ErrorMsg.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NError {
+
+static bool MyFormatMessage(DWORD errorCode, UString &message)
+{
+ LPVOID msgBuf;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, errorCode, 0, (LPTSTR) &msgBuf, 0, NULL) == 0)
+ return false;
+ message = GetUnicodeString((LPCTSTR)msgBuf);
+ }
+ else
+ #endif
+ {
+ if (::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
+ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, errorCode, 0, (LPWSTR) &msgBuf, 0, NULL) == 0)
+ return false;
+ message = (LPCWSTR)msgBuf;
+ }
+ ::LocalFree(msgBuf);
+ return true;
+}
+
+UString MyFormatMessage(DWORD errorCode)
+{
+ UString m;
+ if (!MyFormatMessage(errorCode, m) || m.IsEmpty())
+ {
+ char s[16];
+ for (int i = 0; i < 8; i++)
+ {
+ unsigned t = errorCode & 0xF;
+ errorCode >>= 4;
+ s[7 - i] = (char)((t < 10) ? ('0' + t) : ('A' + (t - 10)));
+ }
+ s[8] = 0;
+ m += "Error #";
+ m += s;
+ }
+ else if (m.Len() >= 2
+ && m[m.Len() - 1] == 0x0A
+ && m[m.Len() - 2] == 0x0D)
+ m.DeleteFrom(m.Len() - 2);
+ return m;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/ErrorMsg.h b/other-licenses/7zstub/src/CPP/Windows/ErrorMsg.h
new file mode 100644
index 0000000000..e05e950438
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/ErrorMsg.h
@@ -0,0 +1,15 @@
+// Windows/ErrorMsg.h
+
+#ifndef __WINDOWS_ERROR_MSG_H
+#define __WINDOWS_ERROR_MSG_H
+
+#include "../Common/MyString.h"
+
+namespace NWindows {
+namespace NError {
+
+UString MyFormatMessage(DWORD errorCode);
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileDir.cpp b/other-licenses/7zstub/src/CPP/Windows/FileDir.cpp
new file mode 100644
index 0000000000..124569e3f5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileDir.cpp
@@ -0,0 +1,714 @@
+// Windows/FileDir.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "FileDir.h"
+#include "FileFind.h"
+#include "FileName.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+
+namespace NWindows {
+namespace NFile {
+namespace NDir {
+
+#ifndef UNDER_CE
+
+bool GetWindowsDir(FString &path)
+{
+ UINT needLength;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetWindowsDirectory(s, MAX_PATH + 1);
+ path = fas2fs(s);
+ }
+ else
+ #endif
+ {
+ WCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetWindowsDirectoryW(s, MAX_PATH + 1);
+ path = us2fs(s);
+ }
+ return (needLength > 0 && needLength <= MAX_PATH);
+}
+
+bool GetSystemDir(FString &path)
+{
+ UINT needLength;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetSystemDirectory(s, MAX_PATH + 1);
+ path = fas2fs(s);
+ }
+ else
+ #endif
+ {
+ WCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetSystemDirectoryW(s, MAX_PATH + 1);
+ path = us2fs(s);
+ }
+ return (needLength > 0 && needLength <= MAX_PATH);
+}
+#endif
+
+bool SetDirTime(CFSTR path, const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ ::SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return false;
+ }
+ #endif
+
+ HANDLE hDir = INVALID_HANDLE_VALUE;
+ IF_USE_MAIN_PATH
+ hDir = ::CreateFileW(fs2us(path), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ #ifdef WIN_LONG_PATH
+ if (hDir == INVALID_HANDLE_VALUE && USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ hDir = ::CreateFileW(superPath, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ }
+ #endif
+
+ bool res = false;
+ if (hDir != INVALID_HANDLE_VALUE)
+ {
+ res = BOOLToBool(::SetFileTime(hDir, cTime, aTime, mTime));
+ ::CloseHandle(hDir);
+ }
+ return res;
+}
+
+bool SetFileAttrib(CFSTR path, DWORD attrib)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::SetFileAttributes(fs2fas(path), attrib))
+ return true;
+ }
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ if (::SetFileAttributesW(fs2us(path), attrib))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ return BOOLToBool(::SetFileAttributesW(superPath, attrib));
+ }
+ #endif
+ }
+ return false;
+}
+
+
+bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib)
+{
+ if ((attrib & 0xF0000000) != 0)
+ attrib &= 0x3FFF;
+ return SetFileAttrib(path, attrib);
+}
+
+
+bool RemoveDir(CFSTR path)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::RemoveDirectory(fs2fas(path)))
+ return true;
+ }
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ if (::RemoveDirectoryW(fs2us(path)))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ return BOOLToBool(::RemoveDirectoryW(superPath));
+ }
+ #endif
+ }
+ return false;
+}
+
+bool MyMoveFile(CFSTR oldFile, CFSTR newFile)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::MoveFile(fs2fas(oldFile), fs2fas(newFile)))
+ return true;
+ }
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH_2(oldFile, newFile)
+ if (::MoveFileW(fs2us(oldFile), fs2us(newFile)))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH_2)
+ {
+ UString d1, d2;
+ if (GetSuperPaths(oldFile, newFile, d1, d2, USE_MAIN_PATH_2))
+ return BOOLToBool(::MoveFileW(d1, d2));
+ }
+ #endif
+ }
+ return false;
+}
+
+#ifndef UNDER_CE
+
+EXTERN_C_BEGIN
+typedef BOOL (WINAPI *Func_CreateHardLinkW)(
+ LPCWSTR lpFileName,
+ LPCWSTR lpExistingFileName,
+ LPSECURITY_ATTRIBUTES lpSecurityAttributes
+ );
+EXTERN_C_END
+
+bool MyCreateHardLink(CFSTR newFileName, CFSTR existFileName)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return false;
+ /*
+ if (::CreateHardLink(fs2fas(newFileName), fs2fas(existFileName), NULL))
+ return true;
+ */
+ }
+ else
+ #endif
+ {
+ Func_CreateHardLinkW my_CreateHardLinkW = (Func_CreateHardLinkW)
+ ::GetProcAddress(::GetModuleHandleW(L"kernel32.dll"), "CreateHardLinkW");
+ if (!my_CreateHardLinkW)
+ return false;
+ IF_USE_MAIN_PATH_2(newFileName, existFileName)
+ if (my_CreateHardLinkW(fs2us(newFileName), fs2us(existFileName), NULL))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH_2)
+ {
+ UString d1, d2;
+ if (GetSuperPaths(newFileName, existFileName, d1, d2, USE_MAIN_PATH_2))
+ return BOOLToBool(my_CreateHardLinkW(d1, d2, NULL));
+ }
+ #endif
+ }
+ return false;
+}
+
+#endif
+
+/*
+WinXP-64 CreateDir():
+ "" - ERROR_PATH_NOT_FOUND
+ \ - ERROR_ACCESS_DENIED
+ C:\ - ERROR_ACCESS_DENIED, if there is such drive,
+
+ D:\folder - ERROR_PATH_NOT_FOUND, if there is no such drive,
+ C:\nonExistent\folder - ERROR_PATH_NOT_FOUND
+
+ C:\existFolder - ERROR_ALREADY_EXISTS
+ C:\existFolder\ - ERROR_ALREADY_EXISTS
+
+ C:\folder - OK
+ C:\folder\ - OK
+
+ \\Server\nonExistent - ERROR_BAD_NETPATH
+ \\Server\Share_Readonly - ERROR_ACCESS_DENIED
+ \\Server\Share - ERROR_ALREADY_EXISTS
+
+ \\Server\Share_NTFS_drive - ERROR_ACCESS_DENIED
+ \\Server\Share_FAT_drive - ERROR_ALREADY_EXISTS
+*/
+
+bool CreateDir(CFSTR path)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::CreateDirectory(fs2fas(path), NULL))
+ return true;
+ }
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ if (::CreateDirectoryW(fs2us(path), NULL))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if ((!USE_MAIN_PATH || ::GetLastError() != ERROR_ALREADY_EXISTS) && USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ return BOOLToBool(::CreateDirectoryW(superPath, NULL));
+ }
+ #endif
+ }
+ return false;
+}
+
+/*
+ CreateDir2 returns true, if directory can contain files after the call (two cases):
+ 1) the directory already exists
+ 2) the directory was created
+ path must be WITHOUT trailing path separator.
+
+ We need CreateDir2, since fileInfo.Find() for reserved names like "com8"
+ returns FILE instead of DIRECTORY. And we need to use SuperPath */
+
+static bool CreateDir2(CFSTR path)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::CreateDirectory(fs2fas(path), NULL))
+ return true;
+ }
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ if (::CreateDirectoryW(fs2us(path), NULL))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if ((!USE_MAIN_PATH || ::GetLastError() != ERROR_ALREADY_EXISTS) && USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ {
+ if (::CreateDirectoryW(superPath, NULL))
+ return true;
+ if (::GetLastError() != ERROR_ALREADY_EXISTS)
+ return false;
+ NFind::CFileInfo fi;
+ if (!fi.Find(us2fs(superPath)))
+ return false;
+ return fi.IsDir();
+ }
+ }
+ #endif
+ }
+ if (::GetLastError() != ERROR_ALREADY_EXISTS)
+ return false;
+ NFind::CFileInfo fi;
+ if (!fi.Find(path))
+ return false;
+ return fi.IsDir();
+}
+
+bool CreateComplexDir(CFSTR _path)
+{
+ #ifdef _WIN32
+
+ {
+ DWORD attrib = NFind::GetFileAttrib(_path);
+ if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ return true;
+ }
+
+ #ifndef UNDER_CE
+
+ if (IsDriveRootPath_SuperAllowed(_path))
+ return false;
+
+ unsigned prefixSize = GetRootPrefixSize(_path);
+
+ #endif
+
+ #endif
+
+ FString path (_path);
+
+ int pos = path.ReverseFind_PathSepar();
+ if (pos >= 0 && (unsigned)pos == path.Len() - 1)
+ {
+ if (path.Len() == 1)
+ return true;
+ path.DeleteBack();
+ }
+
+ const FString path2 (path);
+ pos = path.Len();
+
+ for (;;)
+ {
+ if (CreateDir2(path))
+ break;
+ if (::GetLastError() == ERROR_ALREADY_EXISTS)
+ return false;
+ pos = path.ReverseFind_PathSepar();
+ if (pos < 0 || pos == 0)
+ return false;
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (pos == 1 && IS_PATH_SEPAR(path[0]))
+ return false;
+ if (prefixSize >= (unsigned)pos + 1)
+ return false;
+ #endif
+
+ path.DeleteFrom(pos);
+ }
+
+ while (pos < (int)path2.Len())
+ {
+ int pos2 = NName::FindSepar(path2.Ptr(pos + 1));
+ if (pos2 < 0)
+ pos = path2.Len();
+ else
+ pos += 1 + pos2;
+ path.SetFrom(path2, pos);
+ if (!CreateDir(path))
+ return false;
+ }
+
+ return true;
+}
+
+bool DeleteFileAlways(CFSTR path)
+{
+ /* If alt stream, we also need to clear READ-ONLY attribute of main file before delete.
+ SetFileAttrib("name:stream", ) changes attributes of main file. */
+ {
+ DWORD attrib = NFind::GetFileAttrib(path);
+ if (attrib != INVALID_FILE_ATTRIBUTES
+ && (attrib & FILE_ATTRIBUTE_DIRECTORY) == 0
+ && (attrib & FILE_ATTRIBUTE_READONLY) != 0)
+ {
+ if (!SetFileAttrib(path, attrib & ~FILE_ATTRIBUTE_READONLY))
+ return false;
+ }
+ }
+
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ if (::DeleteFile(fs2fas(path)))
+ return true;
+ }
+ else
+ #endif
+ {
+ /* DeleteFile("name::$DATA") deletes all alt streams (same as delete DeleteFile("name")).
+ Maybe it's better to open "name::$DATA" and clear data for unnamed stream? */
+ IF_USE_MAIN_PATH
+ if (::DeleteFileW(fs2us(path)))
+ return true;
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ return BOOLToBool(::DeleteFileW(superPath));
+ }
+ #endif
+ }
+ return false;
+}
+
+bool RemoveDirWithSubItems(const FString &path)
+{
+ bool needRemoveSubItems = true;
+ {
+ NFind::CFileInfo fi;
+ if (!fi.Find(path))
+ return false;
+ if (!fi.IsDir())
+ {
+ ::SetLastError(ERROR_DIRECTORY);
+ return false;
+ }
+ if (fi.HasReparsePoint())
+ needRemoveSubItems = false;
+ }
+
+ if (needRemoveSubItems)
+ {
+ FString s (path);
+ s.Add_PathSepar();
+ const unsigned prefixSize = s.Len();
+ NFind::CEnumerator enumerator;
+ enumerator.SetDirPrefix(s);
+ NFind::CFileInfo fi;
+ while (enumerator.Next(fi))
+ {
+ s.DeleteFrom(prefixSize);
+ s += fi.Name;
+ if (fi.IsDir())
+ {
+ if (!RemoveDirWithSubItems(s))
+ return false;
+ }
+ else if (!DeleteFileAlways(s))
+ return false;
+ }
+ }
+
+ if (!SetFileAttrib(path, 0))
+ return false;
+ return RemoveDir(path);
+}
+
+#ifdef UNDER_CE
+
+bool MyGetFullPathName(CFSTR path, FString &resFullPath)
+{
+ resFullPath = path;
+ return true;
+}
+
+#else
+
+bool MyGetFullPathName(CFSTR path, FString &resFullPath)
+{
+ return GetFullPath(path, resFullPath);
+}
+
+bool SetCurrentDir(CFSTR path)
+{
+ // SetCurrentDirectory doesn't support \\?\ prefix
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ return BOOLToBool(::SetCurrentDirectory(fs2fas(path)));
+ }
+ else
+ #endif
+ {
+ return BOOLToBool(::SetCurrentDirectoryW(fs2us(path)));
+ }
+}
+
+bool GetCurrentDir(FString &path)
+{
+ path.Empty();
+ DWORD needLength;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetCurrentDirectory(MAX_PATH + 1, s);
+ path = fas2fs(s);
+ }
+ else
+ #endif
+ {
+ WCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetCurrentDirectoryW(MAX_PATH + 1, s);
+ path = us2fs(s);
+ }
+ return (needLength > 0 && needLength <= MAX_PATH);
+}
+
+#endif
+
+bool GetFullPathAndSplit(CFSTR path, FString &resDirPrefix, FString &resFileName)
+{
+ bool res = MyGetFullPathName(path, resDirPrefix);
+ if (!res)
+ resDirPrefix = path;
+ int pos = resDirPrefix.ReverseFind_PathSepar();
+ resFileName = resDirPrefix.Ptr(pos + 1);
+ resDirPrefix.DeleteFrom(pos + 1);
+ return res;
+}
+
+bool GetOnlyDirPrefix(CFSTR path, FString &resDirPrefix)
+{
+ FString resFileName;
+ return GetFullPathAndSplit(path, resDirPrefix, resFileName);
+}
+
+bool MyGetTempPath(FString &path)
+{
+ path.Empty();
+ DWORD needLength;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetTempPath(MAX_PATH + 1, s);
+ path = fas2fs(s);
+ }
+ else
+ #endif
+ {
+ WCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetTempPathW(MAX_PATH + 1, s);;
+ path = us2fs(s);
+ }
+ return (needLength > 0 && needLength <= MAX_PATH);
+}
+
+static bool CreateTempFile(CFSTR prefix, bool addRandom, FString &path, NIO::COutFile *outFile)
+{
+ UInt32 d = (GetTickCount() << 12) ^ (GetCurrentThreadId() << 14) ^ GetCurrentProcessId();
+ for (unsigned i = 0; i < 100; i++)
+ {
+ path = prefix;
+ if (addRandom)
+ {
+ char s[16];
+ UInt32 val = d;
+ unsigned k;
+ for (k = 0; k < 8; k++)
+ {
+ unsigned t = val & 0xF;
+ val >>= 4;
+ s[k] = (char)((t < 10) ? ('0' + t) : ('A' + (t - 10)));
+ }
+ s[k] = '\0';
+ if (outFile)
+ path += '.';
+ path += s;
+ UInt32 step = GetTickCount() + 2;
+ if (step == 0)
+ step = 1;
+ d += step;
+ }
+ addRandom = true;
+ if (outFile)
+ path += ".tmp";
+ if (NFind::DoesFileOrDirExist(path))
+ {
+ SetLastError(ERROR_ALREADY_EXISTS);
+ continue;
+ }
+ if (outFile)
+ {
+ if (outFile->Create(path, false))
+ return true;
+ }
+ else
+ {
+ if (CreateDir(path))
+ return true;
+ }
+ DWORD error = GetLastError();
+ if (error != ERROR_FILE_EXISTS &&
+ error != ERROR_ALREADY_EXISTS)
+ break;
+ }
+ path.Empty();
+ return false;
+}
+
+bool CTempFile::Create(CFSTR prefix, NIO::COutFile *outFile)
+{
+ if (!Remove())
+ return false;
+ if (!CreateTempFile(prefix, false, _path, outFile))
+ return false;
+ _mustBeDeleted = true;
+ return true;
+}
+
+bool CTempFile::CreateRandomInTempFolder(CFSTR namePrefix, NIO::COutFile *outFile)
+{
+ if (!Remove())
+ return false;
+ FString tempPath;
+ if (!MyGetTempPath(tempPath))
+ return false;
+ if (!CreateTempFile(tempPath + namePrefix, true, _path, outFile))
+ return false;
+ _mustBeDeleted = true;
+ return true;
+}
+
+bool CTempFile::Remove()
+{
+ if (!_mustBeDeleted)
+ return true;
+ _mustBeDeleted = !DeleteFileAlways(_path);
+ return !_mustBeDeleted;
+}
+
+bool CTempFile::MoveTo(CFSTR name, bool deleteDestBefore)
+{
+ // DWORD attrib = 0;
+ if (deleteDestBefore)
+ {
+ if (NFind::DoesFileExist(name))
+ {
+ // attrib = NFind::GetFileAttrib(name);
+ if (!DeleteFileAlways(name))
+ return false;
+ }
+ }
+ DisableDeleting();
+ return MyMoveFile(_path, name);
+
+ /*
+ if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_READONLY))
+ {
+ DWORD attrib2 = NFind::GetFileAttrib(name);
+ if (attrib2 != INVALID_FILE_ATTRIBUTES)
+ SetFileAttrib(name, attrib2 | FILE_ATTRIBUTE_READONLY);
+ }
+ */
+}
+
+bool CTempDir::Create(CFSTR prefix)
+{
+ if (!Remove())
+ return false;
+ FString tempPath;
+ if (!MyGetTempPath(tempPath))
+ return false;
+ if (!CreateTempFile(tempPath + prefix, true, _path, NULL))
+ return false;
+ _mustBeDeleted = true;
+ return true;
+}
+
+bool CTempDir::Remove()
+{
+ if (!_mustBeDeleted)
+ return true;
+ _mustBeDeleted = !RemoveDirWithSubItems(_path);
+ return !_mustBeDeleted;
+}
+
+}}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileDir.h b/other-licenses/7zstub/src/CPP/Windows/FileDir.h
new file mode 100644
index 0000000000..8d2b56a6aa
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileDir.h
@@ -0,0 +1,117 @@
+// Windows/FileDir.h
+
+#ifndef __WINDOWS_FILE_DIR_H
+#define __WINDOWS_FILE_DIR_H
+
+#include "../Common/MyString.h"
+
+#include "FileIO.h"
+
+namespace NWindows {
+namespace NFile {
+namespace NDir {
+
+bool GetWindowsDir(FString &path);
+bool GetSystemDir(FString &path);
+
+bool SetDirTime(CFSTR path, const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime);
+
+
+bool SetFileAttrib(CFSTR path, DWORD attrib);
+
+/*
+ Some programs store posix attributes in high 16 bits of windows attributes field.
+ Also some programs use additional flag markers: 0x8000 or 0x4000.
+ SetFileAttrib_PosixHighDetect() tries to detect posix field, and it extracts only attribute
+ bits that are related to current system only.
+*/
+
+bool SetFileAttrib_PosixHighDetect(CFSTR path, DWORD attrib);
+
+
+bool MyMoveFile(CFSTR existFileName, CFSTR newFileName);
+
+#ifndef UNDER_CE
+bool MyCreateHardLink(CFSTR newFileName, CFSTR existFileName);
+#endif
+
+bool RemoveDir(CFSTR path);
+bool CreateDir(CFSTR path);
+
+/* CreateComplexDir returns true, if directory can contain files after the call (two cases):
+ 1) the directory already exists (network shares and drive paths are supported)
+ 2) the directory was created
+ path can be WITH or WITHOUT trailing path separator. */
+
+bool CreateComplexDir(CFSTR path);
+
+bool DeleteFileAlways(CFSTR name);
+bool RemoveDirWithSubItems(const FString &path);
+
+bool MyGetFullPathName(CFSTR path, FString &resFullPath);
+bool GetFullPathAndSplit(CFSTR path, FString &resDirPrefix, FString &resFileName);
+bool GetOnlyDirPrefix(CFSTR path, FString &resDirPrefix);
+
+#ifndef UNDER_CE
+
+bool SetCurrentDir(CFSTR path);
+bool GetCurrentDir(FString &resultPath);
+
+#endif
+
+bool MyGetTempPath(FString &resultPath);
+
+class CTempFile
+{
+ bool _mustBeDeleted;
+ FString _path;
+ void DisableDeleting() { _mustBeDeleted = false; }
+public:
+ CTempFile(): _mustBeDeleted(false) {}
+ ~CTempFile() { Remove(); }
+ const FString &GetPath() const { return _path; }
+ bool Create(CFSTR pathPrefix, NIO::COutFile *outFile); // pathPrefix is not folder prefix
+ bool CreateRandomInTempFolder(CFSTR namePrefix, NIO::COutFile *outFile);
+ bool Remove();
+ bool MoveTo(CFSTR name, bool deleteDestBefore);
+};
+
+class CTempDir
+{
+ bool _mustBeDeleted;
+ FString _path;
+public:
+ CTempDir(): _mustBeDeleted(false) {}
+ ~CTempDir() { Remove(); }
+ const FString &GetPath() const { return _path; }
+ void DisableDeleting() { _mustBeDeleted = false; }
+ bool Create(CFSTR namePrefix) ;
+ bool Remove();
+};
+
+#if !defined(UNDER_CE)
+class CCurrentDirRestorer
+{
+ FString _path;
+public:
+ bool NeedRestore;
+
+ CCurrentDirRestorer(): NeedRestore(true)
+ {
+ GetCurrentDir(_path);
+ }
+ ~CCurrentDirRestorer()
+ {
+ if (!NeedRestore)
+ return;
+ FString s;
+ if (GetCurrentDir(s))
+ if (s != _path)
+ SetCurrentDir(_path);
+ }
+};
+#endif
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileFind.cpp b/other-licenses/7zstub/src/CPP/Windows/FileFind.cpp
new file mode 100644
index 0000000000..8c6255bda5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileFind.cpp
@@ -0,0 +1,749 @@
+// Windows/FileFind.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "FileFind.h"
+#include "FileIO.h"
+#include "FileName.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+EXTERN_C_BEGIN
+
+typedef enum
+{
+ My_FindStreamInfoStandard,
+ My_FindStreamInfoMaxInfoLevel
+} MY_STREAM_INFO_LEVELS;
+
+typedef struct
+{
+ LARGE_INTEGER StreamSize;
+ WCHAR cStreamName[MAX_PATH + 36];
+} MY_WIN32_FIND_STREAM_DATA, *MY_PWIN32_FIND_STREAM_DATA;
+
+typedef WINBASEAPI HANDLE (WINAPI *FindFirstStreamW_Ptr)(LPCWSTR fileName, MY_STREAM_INFO_LEVELS infoLevel,
+ LPVOID findStreamData, DWORD flags);
+
+typedef WINBASEAPI BOOL (APIENTRY *FindNextStreamW_Ptr)(HANDLE findStream, LPVOID findStreamData);
+
+EXTERN_C_END
+
+#endif
+
+namespace NWindows {
+namespace NFile {
+
+#ifdef SUPPORT_DEVICE_FILE
+namespace NSystem
+{
+bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, UInt64 &freeSize);
+}
+#endif
+
+namespace NFind {
+
+bool CFileInfo::IsDots() const throw()
+{
+ if (!IsDir() || Name.IsEmpty())
+ return false;
+ if (Name[0] != '.')
+ return false;
+ return Name.Len() == 1 || (Name.Len() == 2 && Name[1] == '.');
+}
+
+#define WIN_FD_TO_MY_FI(fi, fd) \
+ fi.Attrib = fd.dwFileAttributes; \
+ fi.CTime = fd.ftCreationTime; \
+ fi.ATime = fd.ftLastAccessTime; \
+ fi.MTime = fd.ftLastWriteTime; \
+ fi.Size = (((UInt64)fd.nFileSizeHigh) << 32) + fd.nFileSizeLow; \
+ fi.IsAltStream = false; \
+ fi.IsDevice = false;
+
+ /*
+ #ifdef UNDER_CE
+ fi.ObjectID = fd.dwOID;
+ #else
+ fi.ReparseTag = fd.dwReserved0;
+ #endif
+ */
+
+static void Convert_WIN32_FIND_DATA_to_FileInfo(const WIN32_FIND_DATAW &fd, CFileInfo &fi)
+{
+ WIN_FD_TO_MY_FI(fi, fd);
+ fi.Name = us2fs(fd.cFileName);
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // fi.ShortName = us2fs(fd.cAlternateFileName);
+ #endif
+}
+
+#ifndef _UNICODE
+
+static void Convert_WIN32_FIND_DATA_to_FileInfo(const WIN32_FIND_DATA &fd, CFileInfo &fi)
+{
+ WIN_FD_TO_MY_FI(fi, fd);
+ fi.Name = fas2fs(fd.cFileName);
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // fi.ShortName = fas2fs(fd.cAlternateFileName);
+ #endif
+}
+#endif
+
+////////////////////////////////
+// CFindFile
+
+bool CFindFileBase::Close() throw()
+{
+ if (_handle == INVALID_HANDLE_VALUE)
+ return true;
+ if (!::FindClose(_handle))
+ return false;
+ _handle = INVALID_HANDLE_VALUE;
+ return true;
+}
+
+/*
+WinXP-64 FindFirstFile():
+ "" - ERROR_PATH_NOT_FOUND
+ folder\ - ERROR_FILE_NOT_FOUND
+ \ - ERROR_FILE_NOT_FOUND
+ c:\ - ERROR_FILE_NOT_FOUND
+ c: - ERROR_FILE_NOT_FOUND, if current dir is ROOT ( c:\ )
+ c: - OK, if current dir is NOT ROOT ( c:\folder )
+ folder - OK
+
+ \\ - ERROR_INVALID_NAME
+ \\Server - ERROR_INVALID_NAME
+ \\Server\ - ERROR_INVALID_NAME
+
+ \\Server\Share - ERROR_BAD_NETPATH
+ \\Server\Share - ERROR_BAD_NET_NAME (Win7).
+ !!! There is problem : Win7 makes some requests for "\\Server\Shar" (look in Procmon),
+ when we call it for "\\Server\Share"
+
+ \\Server\Share\ - ERROR_FILE_NOT_FOUND
+
+ \\?\UNC\Server\Share - ERROR_INVALID_NAME
+ \\?\UNC\Server\Share - ERROR_BAD_PATHNAME (Win7)
+ \\?\UNC\Server\Share\ - ERROR_FILE_NOT_FOUND
+
+ \\Server\Share_RootDrive - ERROR_INVALID_NAME
+ \\Server\Share_RootDrive\ - ERROR_INVALID_NAME
+
+ c:\* - ERROR_FILE_NOT_FOUND, if thare are no item in that folder
+*/
+
+bool CFindFile::FindFirst(CFSTR path, CFileInfo &fi)
+{
+ if (!Close())
+ return false;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ WIN32_FIND_DATAA fd;
+ _handle = ::FindFirstFileA(fs2fas(path), &fd);
+ if (_handle == INVALID_HANDLE_VALUE)
+ return false;
+ Convert_WIN32_FIND_DATA_to_FileInfo(fd, fi);
+ }
+ else
+ #endif
+ {
+ WIN32_FIND_DATAW fd;
+
+ IF_USE_MAIN_PATH
+ _handle = ::FindFirstFileW(fs2us(path), &fd);
+ #ifdef WIN_LONG_PATH
+ if (_handle == INVALID_HANDLE_VALUE && USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ _handle = ::FindFirstFileW(superPath, &fd);
+ }
+ #endif
+ if (_handle == INVALID_HANDLE_VALUE)
+ return false;
+ Convert_WIN32_FIND_DATA_to_FileInfo(fd, fi);
+ }
+ return true;
+}
+
+bool CFindFile::FindNext(CFileInfo &fi)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ WIN32_FIND_DATAA fd;
+ if (!::FindNextFileA(_handle, &fd))
+ return false;
+ Convert_WIN32_FIND_DATA_to_FileInfo(fd, fi);
+ }
+ else
+ #endif
+ {
+ WIN32_FIND_DATAW fd;
+ if (!::FindNextFileW(_handle, &fd))
+ return false;
+ Convert_WIN32_FIND_DATA_to_FileInfo(fd, fi);
+ }
+ return true;
+}
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+////////////////////////////////
+// AltStreams
+
+static FindFirstStreamW_Ptr g_FindFirstStreamW;
+static FindNextStreamW_Ptr g_FindNextStreamW;
+
+struct CFindStreamLoader
+{
+ CFindStreamLoader()
+ {
+ g_FindFirstStreamW = (FindFirstStreamW_Ptr)::GetProcAddress(::GetModuleHandleA("kernel32.dll"), "FindFirstStreamW");
+ g_FindNextStreamW = (FindNextStreamW_Ptr)::GetProcAddress(::GetModuleHandleA("kernel32.dll"), "FindNextStreamW");
+ }
+} g_FindStreamLoader;
+
+bool CStreamInfo::IsMainStream() const throw()
+{
+ return StringsAreEqualNoCase_Ascii(Name, "::$DATA");
+};
+
+UString CStreamInfo::GetReducedName() const
+{
+ // remove ":$DATA" postfix, but keep postfix, if Name is "::$DATA"
+ UString s (Name);
+ if (s.Len() > 6 + 1 && StringsAreEqualNoCase_Ascii(s.RightPtr(6), ":$DATA"))
+ s.DeleteFrom(s.Len() - 6);
+ return s;
+}
+
+/*
+UString CStreamInfo::GetReducedName2() const
+{
+ UString s = GetReducedName();
+ if (!s.IsEmpty() && s[0] == ':')
+ s.Delete(0);
+ return s;
+}
+*/
+
+static void Convert_WIN32_FIND_STREAM_DATA_to_StreamInfo(const MY_WIN32_FIND_STREAM_DATA &sd, CStreamInfo &si)
+{
+ si.Size = sd.StreamSize.QuadPart;
+ si.Name = sd.cStreamName;
+}
+
+/*
+ WinXP-64 FindFirstStream():
+ "" - ERROR_PATH_NOT_FOUND
+ folder\ - OK
+ folder - OK
+ \ - OK
+ c:\ - OK
+ c: - OK, if current dir is ROOT ( c:\ )
+ c: - OK, if current dir is NOT ROOT ( c:\folder )
+ \\Server\Share - OK
+ \\Server\Share\ - OK
+
+ \\ - ERROR_INVALID_NAME
+ \\Server - ERROR_INVALID_NAME
+ \\Server\ - ERROR_INVALID_NAME
+*/
+
+bool CFindStream::FindFirst(CFSTR path, CStreamInfo &si)
+{
+ if (!Close())
+ return false;
+ if (!g_FindFirstStreamW)
+ {
+ ::SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return false;
+ }
+ {
+ MY_WIN32_FIND_STREAM_DATA sd;
+ SetLastError(0);
+ IF_USE_MAIN_PATH
+ _handle = g_FindFirstStreamW(fs2us(path), My_FindStreamInfoStandard, &sd, 0);
+ if (_handle == INVALID_HANDLE_VALUE)
+ {
+ if (::GetLastError() == ERROR_HANDLE_EOF)
+ return false;
+ // long name can be tricky for path like ".\dirName".
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ _handle = g_FindFirstStreamW(superPath, My_FindStreamInfoStandard, &sd, 0);
+ }
+ #endif
+ }
+ if (_handle == INVALID_HANDLE_VALUE)
+ return false;
+ Convert_WIN32_FIND_STREAM_DATA_to_StreamInfo(sd, si);
+ }
+ return true;
+}
+
+bool CFindStream::FindNext(CStreamInfo &si)
+{
+ if (!g_FindNextStreamW)
+ {
+ ::SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return false;
+ }
+ {
+ MY_WIN32_FIND_STREAM_DATA sd;
+ if (!g_FindNextStreamW(_handle, &sd))
+ return false;
+ Convert_WIN32_FIND_STREAM_DATA_to_StreamInfo(sd, si);
+ }
+ return true;
+}
+
+bool CStreamEnumerator::Next(CStreamInfo &si, bool &found)
+{
+ bool res;
+ if (_find.IsHandleAllocated())
+ res = _find.FindNext(si);
+ else
+ res = _find.FindFirst(_filePath, si);
+ if (res)
+ {
+ found = true;
+ return true;
+ }
+ found = false;
+ return (::GetLastError() == ERROR_HANDLE_EOF);
+}
+
+#endif
+
+
+#define MY_CLEAR_FILETIME(ft) ft.dwLowDateTime = ft.dwHighDateTime = 0;
+
+void CFileInfoBase::ClearBase() throw()
+{
+ Size = 0;
+ MY_CLEAR_FILETIME(CTime);
+ MY_CLEAR_FILETIME(ATime);
+ MY_CLEAR_FILETIME(MTime);
+ Attrib = 0;
+ IsAltStream = false;
+ IsDevice = false;
+}
+
+/*
+WinXP-64 GetFileAttributes():
+ If the function fails, it returns INVALID_FILE_ATTRIBUTES and use GetLastError() to get error code
+
+ \ - OK
+ C:\ - OK, if there is such drive,
+ D:\ - ERROR_PATH_NOT_FOUND, if there is no such drive,
+
+ C:\folder - OK
+ C:\folder\ - OK
+ C:\folderBad - ERROR_FILE_NOT_FOUND
+
+ \\Server\BadShare - ERROR_BAD_NETPATH
+ \\Server\Share - WORKS OK, but MSDN says:
+ GetFileAttributes for a network share, the function fails, and GetLastError
+ returns ERROR_BAD_NETPATH. You must specify a path to a subfolder on that share.
+*/
+
+DWORD GetFileAttrib(CFSTR path)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ return ::GetFileAttributes(fs2fas(path));
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ {
+ DWORD dw = ::GetFileAttributesW(fs2us(path));
+ if (dw != INVALID_FILE_ATTRIBUTES)
+ return dw;
+ }
+ #ifdef WIN_LONG_PATH
+ if (USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ return ::GetFileAttributesW(superPath);
+ }
+ #endif
+ return INVALID_FILE_ATTRIBUTES;
+ }
+}
+
+/* if path is "c:" or "c::" then CFileInfo::Find() returns name of current folder for that disk
+ so instead of absolute path we have relative path in Name. That is not good in some calls */
+
+/* In CFileInfo::Find() we want to support same names for alt streams as in CreateFile(). */
+
+/* CFileInfo::Find()
+We alow the following paths (as FindFirstFile):
+ C:\folder
+ c: - if current dir is NOT ROOT ( c:\folder )
+
+also we support paths that are not supported by FindFirstFile:
+ \
+ \\.\c:
+ c:\ - Name will be without tail slash ( c: )
+ \\?\c:\ - Name will be without tail slash ( c: )
+ \\Server\Share
+ \\?\UNC\Server\Share
+
+ c:\folder:stream - Name = folder:stream
+ c:\:stream - Name = :stream
+ c::stream - Name = c::stream
+*/
+
+bool CFileInfo::Find(CFSTR path)
+{
+ #ifdef SUPPORT_DEVICE_FILE
+ if (IsDevicePath(path))
+ {
+ ClearBase();
+ Name = path + 4;
+ IsDevice = true;
+
+ if (NName::IsDrivePath2(path + 4) && path[6] == 0)
+ {
+ FChar drive[4] = { path[4], ':', '\\', 0 };
+ UInt64 clusterSize, totalSize, freeSize;
+ if (NSystem::MyGetDiskFreeSpace(drive, clusterSize, totalSize, freeSize))
+ {
+ Size = totalSize;
+ return true;
+ }
+ }
+
+ NIO::CInFile inFile;
+ // ::OutputDebugStringW(path);
+ if (!inFile.Open(path))
+ return false;
+ // ::OutputDebugStringW(L"---");
+ if (inFile.SizeDefined)
+ Size = inFile.Size;
+ return true;
+ }
+ #endif
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+
+ int colonPos = FindAltStreamColon(path);
+ if (colonPos >= 0 && path[(unsigned)colonPos + 1] != 0)
+ {
+ UString streamName = fs2us(path + (unsigned)colonPos);
+ FString filePath (path);
+ filePath.DeleteFrom(colonPos);
+ /* we allow both cases:
+ name:stream
+ name:stream:$DATA
+ */
+ const unsigned kPostfixSize = 6;
+ if (streamName.Len() <= kPostfixSize
+ || !StringsAreEqualNoCase_Ascii(streamName.RightPtr(kPostfixSize), ":$DATA"))
+ streamName += ":$DATA";
+
+ bool isOk = true;
+
+ if (IsDrivePath2(filePath) &&
+ (colonPos == 2 || colonPos == 3 && filePath[2] == '\\'))
+ {
+ // FindFirstFile doesn't work for "c:\" and for "c:" (if current dir is ROOT)
+ ClearBase();
+ Name.Empty();
+ if (colonPos == 2)
+ Name = filePath;
+ }
+ else
+ isOk = Find(filePath);
+
+ if (isOk)
+ {
+ Attrib &= ~(FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_REPARSE_POINT);
+ Size = 0;
+ CStreamEnumerator enumerator(filePath);
+ for (;;)
+ {
+ CStreamInfo si;
+ bool found;
+ if (!enumerator.Next(si, found))
+ return false;
+ if (!found)
+ {
+ ::SetLastError(ERROR_FILE_NOT_FOUND);
+ return false;
+ }
+ if (si.Name.IsEqualTo_NoCase(streamName))
+ {
+ // we delete postfix, if alt stream name is not "::$DATA"
+ if (si.Name.Len() > kPostfixSize + 1)
+ si.Name.DeleteFrom(si.Name.Len() - kPostfixSize);
+ Name += us2fs(si.Name);
+ Size = si.Size;
+ IsAltStream = true;
+ return true;
+ }
+ }
+ }
+ }
+
+ #endif
+
+ CFindFile finder;
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ {
+ /*
+ DWORD lastError = GetLastError();
+ if (lastError == ERROR_FILE_NOT_FOUND
+ || lastError == ERROR_BAD_NETPATH // XP64: "\\Server\Share"
+ || lastError == ERROR_BAD_NET_NAME // Win7: "\\Server\Share"
+ || lastError == ERROR_INVALID_NAME // XP64: "\\?\UNC\Server\Share"
+ || lastError == ERROR_BAD_PATHNAME // Win7: "\\?\UNC\Server\Share"
+ )
+ */
+
+ unsigned rootSize = 0;
+ if (IsSuperPath(path))
+ rootSize = kSuperPathPrefixSize;
+
+ if (NName::IsDrivePath(path + rootSize) && path[rootSize + 3] == 0)
+ {
+ DWORD attrib = GetFileAttrib(path);
+ if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ ClearBase();
+ Attrib = attrib;
+ Name = path + rootSize;
+ Name.DeleteFrom(2); // we don't need backslash (C:)
+ return true;
+ }
+ }
+ else if (IS_PATH_SEPAR(path[0]))
+ if (path[1] == 0)
+ {
+ DWORD attrib = GetFileAttrib(path);
+ if (attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ ClearBase();
+ Name.Empty();
+ Attrib = attrib;
+ return true;
+ }
+ }
+ else
+ {
+ const unsigned prefixSize = GetNetworkServerPrefixSize(path);
+ if (prefixSize > 0 && path[prefixSize] != 0)
+ {
+ if (NName::FindSepar(path + prefixSize) < 0)
+ {
+ FString s (path);
+ s.Add_PathSepar();
+ s += '*'; // CHAR_ANY_MASK
+
+ bool isOK = false;
+ if (finder.FindFirst(s, *this))
+ {
+ if (Name == FTEXT("."))
+ {
+ Name = path + prefixSize;
+ return true;
+ }
+ isOK = true;
+ /* if "\\server\share" maps to root folder "d:\", there is no "." item.
+ But it's possible that there are another items */
+ }
+ {
+ DWORD attrib = GetFileAttrib(path);
+ if (isOK || attrib != INVALID_FILE_ATTRIBUTES && (attrib & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ ClearBase();
+ if (attrib != INVALID_FILE_ATTRIBUTES)
+ Attrib = attrib;
+ else
+ SetAsDir();
+ Name = path + prefixSize;
+ return true;
+ }
+ }
+ // ::SetLastError(lastError);
+ }
+ }
+ }
+ }
+ #endif
+
+ return finder.FindFirst(path, *this);
+}
+
+
+bool DoesFileExist(CFSTR name)
+{
+ CFileInfo fi;
+ return fi.Find(name) && !fi.IsDir();
+}
+
+bool DoesDirExist(CFSTR name)
+{
+ CFileInfo fi;
+ return fi.Find(name) && fi.IsDir();
+}
+
+bool DoesFileOrDirExist(CFSTR name)
+{
+ CFileInfo fi;
+ return fi.Find(name);
+}
+
+
+void CEnumerator::SetDirPrefix(const FString &dirPrefix)
+{
+ _wildcard = dirPrefix;
+ _wildcard += '*';
+}
+
+bool CEnumerator::NextAny(CFileInfo &fi)
+{
+ if (_findFile.IsHandleAllocated())
+ return _findFile.FindNext(fi);
+ else
+ return _findFile.FindFirst(_wildcard, fi);
+}
+
+bool CEnumerator::Next(CFileInfo &fi)
+{
+ for (;;)
+ {
+ if (!NextAny(fi))
+ return false;
+ if (!fi.IsDots())
+ return true;
+ }
+}
+
+bool CEnumerator::Next(CFileInfo &fi, bool &found)
+{
+ if (Next(fi))
+ {
+ found = true;
+ return true;
+ }
+ found = false;
+ return (::GetLastError() == ERROR_NO_MORE_FILES);
+}
+
+////////////////////////////////
+// CFindChangeNotification
+// FindFirstChangeNotification can return 0. MSDN doesn't tell about it.
+
+bool CFindChangeNotification::Close() throw()
+{
+ if (!IsHandleAllocated())
+ return true;
+ if (!::FindCloseChangeNotification(_handle))
+ return false;
+ _handle = INVALID_HANDLE_VALUE;
+ return true;
+}
+
+HANDLE CFindChangeNotification::FindFirst(CFSTR path, bool watchSubtree, DWORD notifyFilter)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ _handle = ::FindFirstChangeNotification(fs2fas(path), BoolToBOOL(watchSubtree), notifyFilter);
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ _handle = ::FindFirstChangeNotificationW(fs2us(path), BoolToBOOL(watchSubtree), notifyFilter);
+ #ifdef WIN_LONG_PATH
+ if (!IsHandleAllocated())
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ _handle = ::FindFirstChangeNotificationW(superPath, BoolToBOOL(watchSubtree), notifyFilter);
+ }
+ #endif
+ }
+ return _handle;
+}
+
+#ifndef UNDER_CE
+
+bool MyGetLogicalDriveStrings(CObjectVector<FString> &driveStrings)
+{
+ driveStrings.Clear();
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ driveStrings.Clear();
+ UINT32 size = GetLogicalDriveStrings(0, NULL);
+ if (size == 0)
+ return false;
+ CObjArray<char> buf(size);
+ UINT32 newSize = GetLogicalDriveStrings(size, buf);
+ if (newSize == 0 || newSize > size)
+ return false;
+ AString s;
+ UINT32 prev = 0;
+ for (UINT32 i = 0; i < newSize; i++)
+ {
+ if (buf[i] == 0)
+ {
+ s = buf + prev;
+ prev = i + 1;
+ driveStrings.Add(fas2fs(s));
+ }
+ }
+ return prev == newSize;
+ }
+ else
+ #endif
+ {
+ UINT32 size = GetLogicalDriveStringsW(0, NULL);
+ if (size == 0)
+ return false;
+ CObjArray<wchar_t> buf(size);
+ UINT32 newSize = GetLogicalDriveStringsW(size, buf);
+ if (newSize == 0 || newSize > size)
+ return false;
+ UString s;
+ UINT32 prev = 0;
+ for (UINT32 i = 0; i < newSize; i++)
+ {
+ if (buf[i] == 0)
+ {
+ s = buf + prev;
+ prev = i + 1;
+ driveStrings.Add(us2fs(s));
+ }
+ }
+ return prev == newSize;
+ }
+}
+
+#endif
+
+}}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileFind.h b/other-licenses/7zstub/src/CPP/Windows/FileFind.h
new file mode 100644
index 0000000000..77d8dc35c7
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileFind.h
@@ -0,0 +1,161 @@
+// Windows/FileFind.h
+
+#ifndef __WINDOWS_FILE_FIND_H
+#define __WINDOWS_FILE_FIND_H
+
+#include "../Common/MyString.h"
+#include "Defs.h"
+
+namespace NWindows {
+namespace NFile {
+namespace NFind {
+
+namespace NAttributes
+{
+ inline bool IsReadOnly(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_READONLY) != 0; }
+ inline bool IsHidden(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_HIDDEN) != 0; }
+ inline bool IsSystem(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_SYSTEM) != 0; }
+ inline bool IsDir(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_DIRECTORY) != 0; }
+ inline bool IsArchived(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_ARCHIVE) != 0; }
+ inline bool IsCompressed(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_COMPRESSED) != 0; }
+ inline bool IsEncrypted(DWORD attrib) { return (attrib & FILE_ATTRIBUTE_ENCRYPTED) != 0; }
+}
+
+class CFileInfoBase
+{
+ bool MatchesMask(UINT32 mask) const { return ((Attrib & mask) != 0); }
+public:
+ UInt64 Size;
+ FILETIME CTime;
+ FILETIME ATime;
+ FILETIME MTime;
+ DWORD Attrib;
+ bool IsAltStream;
+ bool IsDevice;
+
+ /*
+ #ifdef UNDER_CE
+ DWORD ObjectID;
+ #else
+ UINT32 ReparseTag;
+ #endif
+ */
+
+ CFileInfoBase() { ClearBase(); }
+ void ClearBase() throw();
+
+ void SetAsDir() { Attrib = FILE_ATTRIBUTE_DIRECTORY; }
+
+ bool IsArchived() const { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); }
+ bool IsCompressed() const { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); }
+ bool IsDir() const { return MatchesMask(FILE_ATTRIBUTE_DIRECTORY); }
+ bool IsEncrypted() const { return MatchesMask(FILE_ATTRIBUTE_ENCRYPTED); }
+ bool IsHidden() const { return MatchesMask(FILE_ATTRIBUTE_HIDDEN); }
+ bool IsNormal() const { return MatchesMask(FILE_ATTRIBUTE_NORMAL); }
+ bool IsOffline() const { return MatchesMask(FILE_ATTRIBUTE_OFFLINE); }
+ bool IsReadOnly() const { return MatchesMask(FILE_ATTRIBUTE_READONLY); }
+ bool HasReparsePoint() const { return MatchesMask(FILE_ATTRIBUTE_REPARSE_POINT); }
+ bool IsSparse() const { return MatchesMask(FILE_ATTRIBUTE_SPARSE_FILE); }
+ bool IsSystem() const { return MatchesMask(FILE_ATTRIBUTE_SYSTEM); }
+ bool IsTemporary() const { return MatchesMask(FILE_ATTRIBUTE_TEMPORARY); }
+};
+
+struct CFileInfo: public CFileInfoBase
+{
+ FString Name;
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ // FString ShortName;
+ #endif
+
+ bool IsDots() const throw();
+ bool Find(CFSTR path);
+};
+
+class CFindFileBase
+{
+protected:
+ HANDLE _handle;
+public:
+ bool IsHandleAllocated() const { return _handle != INVALID_HANDLE_VALUE; }
+ CFindFileBase(): _handle(INVALID_HANDLE_VALUE) {}
+ ~CFindFileBase() { Close(); }
+ bool Close() throw();
+};
+
+class CFindFile: public CFindFileBase
+{
+public:
+ bool FindFirst(CFSTR wildcard, CFileInfo &fileInfo);
+ bool FindNext(CFileInfo &fileInfo);
+};
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+struct CStreamInfo
+{
+ UString Name;
+ UInt64 Size;
+
+ UString GetReducedName() const; // returns ":Name"
+ // UString GetReducedName2() const; // returns "Name"
+ bool IsMainStream() const throw();
+};
+
+class CFindStream: public CFindFileBase
+{
+public:
+ bool FindFirst(CFSTR filePath, CStreamInfo &streamInfo);
+ bool FindNext(CStreamInfo &streamInfo);
+};
+
+class CStreamEnumerator
+{
+ CFindStream _find;
+ FString _filePath;
+
+ bool NextAny(CFileInfo &fileInfo);
+public:
+ CStreamEnumerator(const FString &filePath): _filePath(filePath) {}
+ bool Next(CStreamInfo &streamInfo, bool &found);
+};
+
+#endif
+
+bool DoesFileExist(CFSTR name);
+bool DoesDirExist(CFSTR name);
+bool DoesFileOrDirExist(CFSTR name);
+
+DWORD GetFileAttrib(CFSTR path);
+
+class CEnumerator
+{
+ CFindFile _findFile;
+ FString _wildcard;
+
+ bool NextAny(CFileInfo &fileInfo);
+public:
+ void SetDirPrefix(const FString &dirPrefix);
+ bool Next(CFileInfo &fileInfo);
+ bool Next(CFileInfo &fileInfo, bool &found);
+};
+
+class CFindChangeNotification
+{
+ HANDLE _handle;
+public:
+ operator HANDLE () { return _handle; }
+ bool IsHandleAllocated() const { return _handle != INVALID_HANDLE_VALUE && _handle != 0; }
+ CFindChangeNotification(): _handle(INVALID_HANDLE_VALUE) {}
+ ~CFindChangeNotification() { Close(); }
+ bool Close() throw();
+ HANDLE FindFirst(CFSTR pathName, bool watchSubtree, DWORD notifyFilter);
+ bool FindNext() { return BOOLToBool(::FindNextChangeNotification(_handle)); }
+};
+
+#ifndef UNDER_CE
+bool MyGetLogicalDriveStrings(CObjectVector<FString> &driveStrings);
+#endif
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileIO.cpp b/other-licenses/7zstub/src/CPP/Windows/FileIO.cpp
new file mode 100644
index 0000000000..a1d52c0fe0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileIO.cpp
@@ -0,0 +1,432 @@
+// Windows/FileIO.cpp
+
+#include "StdAfx.h"
+
+#ifdef SUPPORT_DEVICE_FILE
+#include "../../C/Alloc.h"
+#endif
+
+#include "FileIO.h"
+#include "FileName.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NName;
+
+namespace NWindows {
+namespace NFile {
+
+#ifdef SUPPORT_DEVICE_FILE
+
+namespace NSystem
+{
+bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, UInt64 &freeSize);
+}
+#endif
+
+namespace NIO {
+
+/*
+WinXP-64 CreateFile():
+ "" - ERROR_PATH_NOT_FOUND
+ :stream - OK
+ .:stream - ERROR_PATH_NOT_FOUND
+ .\:stream - OK
+
+ folder\:stream - ERROR_INVALID_NAME
+ folder:stream - OK
+
+ c:\:stream - OK
+
+ c::stream - ERROR_INVALID_NAME, if current dir is NOT ROOT ( c:\dir1 )
+ c::stream - OK, if current dir is ROOT ( c:\ )
+*/
+
+bool CFileBase::Create(CFSTR path, DWORD desiredAccess,
+ DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
+{
+ if (!Close())
+ return false;
+
+ #ifdef SUPPORT_DEVICE_FILE
+ IsDeviceFile = false;
+ #endif
+
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ _handle = ::CreateFile(fs2fas(path), desiredAccess, shareMode,
+ (LPSECURITY_ATTRIBUTES)NULL, creationDisposition, flagsAndAttributes, (HANDLE)NULL);
+ }
+ else
+ #endif
+ {
+ IF_USE_MAIN_PATH
+ _handle = ::CreateFileW(fs2us(path), desiredAccess, shareMode,
+ (LPSECURITY_ATTRIBUTES)NULL, creationDisposition, flagsAndAttributes, (HANDLE)NULL);
+ #ifdef WIN_LONG_PATH
+ if (_handle == INVALID_HANDLE_VALUE && USE_SUPER_PATH)
+ {
+ UString superPath;
+ if (GetSuperPath(path, superPath, USE_MAIN_PATH))
+ _handle = ::CreateFileW(superPath, desiredAccess, shareMode,
+ (LPSECURITY_ATTRIBUTES)NULL, creationDisposition, flagsAndAttributes, (HANDLE)NULL);
+ }
+ #endif
+ }
+ return (_handle != INVALID_HANDLE_VALUE);
+}
+
+bool CFileBase::Close() throw()
+{
+ if (_handle == INVALID_HANDLE_VALUE)
+ return true;
+ if (!::CloseHandle(_handle))
+ return false;
+ _handle = INVALID_HANDLE_VALUE;
+ return true;
+}
+
+bool CFileBase::GetPosition(UInt64 &position) const throw()
+{
+ return Seek(0, FILE_CURRENT, position);
+}
+
+bool CFileBase::GetLength(UInt64 &length) const throw()
+{
+ #ifdef SUPPORT_DEVICE_FILE
+ if (IsDeviceFile && SizeDefined)
+ {
+ length = Size;
+ return true;
+ }
+ #endif
+
+ DWORD sizeHigh;
+ DWORD sizeLow = ::GetFileSize(_handle, &sizeHigh);
+ if (sizeLow == 0xFFFFFFFF)
+ if (::GetLastError() != NO_ERROR)
+ return false;
+ length = (((UInt64)sizeHigh) << 32) + sizeLow;
+ return true;
+}
+
+bool CFileBase::Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition) const throw()
+{
+ #ifdef SUPPORT_DEVICE_FILE
+ if (IsDeviceFile && SizeDefined && moveMethod == FILE_END)
+ {
+ distanceToMove += Size;
+ moveMethod = FILE_BEGIN;
+ }
+ #endif
+
+ LONG high = (LONG)(distanceToMove >> 32);
+ DWORD low = ::SetFilePointer(_handle, (LONG)(distanceToMove & 0xFFFFFFFF), &high, moveMethod);
+ if (low == 0xFFFFFFFF)
+ if (::GetLastError() != NO_ERROR)
+ return false;
+ newPosition = (((UInt64)(UInt32)high) << 32) + low;
+ return true;
+}
+
+bool CFileBase::Seek(UInt64 position, UInt64 &newPosition) const throw()
+{
+ return Seek(position, FILE_BEGIN, newPosition);
+}
+
+bool CFileBase::SeekToBegin() const throw()
+{
+ UInt64 newPosition;
+ return Seek(0, newPosition);
+}
+
+bool CFileBase::SeekToEnd(UInt64 &newPosition) const throw()
+{
+ return Seek(0, FILE_END, newPosition);
+}
+
+// ---------- CInFile ---------
+
+#ifdef SUPPORT_DEVICE_FILE
+
+void CInFile::CorrectDeviceSize()
+{
+ // maybe we must decrease kClusterSize to 1 << 12, if we want correct size at tail
+ static const UInt32 kClusterSize = 1 << 14;
+ UInt64 pos = Size & ~(UInt64)(kClusterSize - 1);
+ UInt64 realNewPosition;
+ if (!Seek(pos, realNewPosition))
+ return;
+ Byte *buf = (Byte *)MidAlloc(kClusterSize);
+
+ bool needbackward = true;
+
+ for (;;)
+ {
+ UInt32 processed = 0;
+ // up test is slow for "PhysicalDrive".
+ // processed size for latest block for "PhysicalDrive0" is 0.
+ if (!Read1(buf, kClusterSize, processed))
+ break;
+ if (processed == 0)
+ break;
+ needbackward = false;
+ Size = pos + processed;
+ if (processed != kClusterSize)
+ break;
+ pos += kClusterSize;
+ }
+
+ if (needbackward && pos != 0)
+ {
+ pos -= kClusterSize;
+ for (;;)
+ {
+ // break;
+ if (!Seek(pos, realNewPosition))
+ break;
+ if (!buf)
+ {
+ buf = (Byte *)MidAlloc(kClusterSize);
+ if (!buf)
+ break;
+ }
+ UInt32 processed = 0;
+ // that code doesn't work for "PhysicalDrive0"
+ if (!Read1(buf, kClusterSize, processed))
+ break;
+ if (processed != 0)
+ {
+ Size = pos + processed;
+ break;
+ }
+ if (pos == 0)
+ break;
+ pos -= kClusterSize;
+ }
+ }
+ MidFree(buf);
+}
+
+
+void CInFile::CalcDeviceSize(CFSTR s)
+{
+ SizeDefined = false;
+ Size = 0;
+ if (_handle == INVALID_HANDLE_VALUE || !IsDeviceFile)
+ return;
+ #ifdef UNDER_CE
+
+ SizeDefined = true;
+ Size = 128 << 20;
+
+ #else
+
+ PARTITION_INFORMATION partInfo;
+ bool needCorrectSize = true;
+
+ /*
+ WinXP 64-bit:
+
+ HDD \\.\PhysicalDrive0 (MBR):
+ GetPartitionInfo == GeometryEx : corrrect size? (includes tail)
+ Geometry : smaller than GeometryEx (no tail, maybe correct too?)
+ MyGetDiskFreeSpace : FAIL
+ Size correction is slow and block size (kClusterSize) must be small?
+
+ HDD partition \\.\N: (NTFS):
+ MyGetDiskFreeSpace : Size of NTFS clusters. Same size can be calculated after correction
+ GetPartitionInfo : size of partition data: NTFS clusters + TAIL; TAIL contains extra empty sectors and copy of first sector of NTFS
+ Geometry / CdRomGeometry / GeometryEx : size of HDD (not that partition)
+
+ CD-ROM drive (ISO):
+ MyGetDiskFreeSpace : correct size. Same size can be calculated after correction
+ Geometry == CdRomGeometry : smaller than corrrect size
+ GetPartitionInfo == GeometryEx : larger than corrrect size
+
+ Floppy \\.\a: (FAT):
+ Geometry : correct size.
+ CdRomGeometry / GeometryEx / GetPartitionInfo / MyGetDiskFreeSpace - FAIL
+ correction works OK for FAT.
+ correction works OK for non-FAT, if kClusterSize = 512.
+ */
+
+ if (GetPartitionInfo(&partInfo))
+ {
+ Size = partInfo.PartitionLength.QuadPart;
+ SizeDefined = true;
+ needCorrectSize = false;
+ if ((s)[0] == '\\' && (s)[1] == '\\' && (s)[2] == '.' && (s)[3] == '\\' && (s)[5] == ':' && (s)[6] == 0)
+ {
+ FChar path[4] = { s[4], ':', '\\', 0 };
+ UInt64 clusterSize, totalSize, freeSize;
+ if (NSystem::MyGetDiskFreeSpace(path, clusterSize, totalSize, freeSize))
+ Size = totalSize;
+ else
+ needCorrectSize = true;
+ }
+ }
+
+ if (!SizeDefined)
+ {
+ my_DISK_GEOMETRY_EX geomEx;
+ SizeDefined = GetGeometryEx(&geomEx);
+ if (SizeDefined)
+ Size = geomEx.DiskSize.QuadPart;
+ else
+ {
+ DISK_GEOMETRY geom;
+ SizeDefined = GetGeometry(&geom);
+ if (!SizeDefined)
+ SizeDefined = GetCdRomGeometry(&geom);
+ if (SizeDefined)
+ Size = geom.Cylinders.QuadPart * geom.TracksPerCylinder * geom.SectorsPerTrack * geom.BytesPerSector;
+ }
+ }
+
+ if (needCorrectSize && SizeDefined && Size != 0)
+ {
+ CorrectDeviceSize();
+ SeekToBegin();
+ }
+
+ // SeekToBegin();
+ #endif
+}
+
+// ((desiredAccess & (FILE_WRITE_DATA | FILE_APPEND_DATA | GENERIC_WRITE)) == 0 &&
+
+#define MY_DEVICE_EXTRA_CODE \
+ IsDeviceFile = IsDevicePath(fileName); \
+ CalcDeviceSize(fileName);
+#else
+#define MY_DEVICE_EXTRA_CODE
+#endif
+
+bool CInFile::Open(CFSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
+{
+ bool res = Create(fileName, GENERIC_READ, shareMode, creationDisposition, flagsAndAttributes);
+ MY_DEVICE_EXTRA_CODE
+ return res;
+}
+
+bool CInFile::OpenShared(CFSTR fileName, bool shareForWrite)
+{ return Open(fileName, FILE_SHARE_READ | (shareForWrite ? FILE_SHARE_WRITE : 0), OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL); }
+
+bool CInFile::Open(CFSTR fileName)
+ { return OpenShared(fileName, false); }
+
+// ReadFile and WriteFile functions in Windows have BUG:
+// If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
+// from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
+// (Insufficient system resources exist to complete the requested service).
+
+// Probably in some version of Windows there are problems with other sizes:
+// for 32 MB (maybe also for 16 MB).
+// And message can be "Network connection was lost"
+
+static UInt32 kChunkSizeMax = (1 << 22);
+
+bool CInFile::Read1(void *data, UInt32 size, UInt32 &processedSize) throw()
+{
+ DWORD processedLoc = 0;
+ bool res = BOOLToBool(::ReadFile(_handle, data, size, &processedLoc, NULL));
+ processedSize = (UInt32)processedLoc;
+ return res;
+}
+
+bool CInFile::ReadPart(void *data, UInt32 size, UInt32 &processedSize) throw()
+{
+ if (size > kChunkSizeMax)
+ size = kChunkSizeMax;
+ return Read1(data, size, processedSize);
+}
+
+bool CInFile::Read(void *data, UInt32 size, UInt32 &processedSize) throw()
+{
+ processedSize = 0;
+ do
+ {
+ UInt32 processedLoc = 0;
+ bool res = ReadPart(data, size, processedLoc);
+ processedSize += processedLoc;
+ if (!res)
+ return false;
+ if (processedLoc == 0)
+ return true;
+ data = (void *)((unsigned char *)data + processedLoc);
+ size -= processedLoc;
+ }
+ while (size > 0);
+ return true;
+}
+
+// ---------- COutFile ---------
+
+static inline DWORD GetCreationDisposition(bool createAlways)
+ { return createAlways? CREATE_ALWAYS: CREATE_NEW; }
+
+bool COutFile::Open(CFSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
+ { return CFileBase::Create(fileName, GENERIC_WRITE, shareMode, creationDisposition, flagsAndAttributes); }
+
+bool COutFile::Open(CFSTR fileName, DWORD creationDisposition)
+ { return Open(fileName, FILE_SHARE_READ, creationDisposition, FILE_ATTRIBUTE_NORMAL); }
+
+bool COutFile::Create(CFSTR fileName, bool createAlways)
+ { return Open(fileName, GetCreationDisposition(createAlways)); }
+
+bool COutFile::CreateAlways(CFSTR fileName, DWORD flagsAndAttributes)
+ { return Open(fileName, FILE_SHARE_READ, GetCreationDisposition(true), flagsAndAttributes); }
+
+bool COutFile::SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime) throw()
+ { return BOOLToBool(::SetFileTime(_handle, cTime, aTime, mTime)); }
+
+bool COutFile::SetMTime(const FILETIME *mTime) throw() { return SetTime(NULL, NULL, mTime); }
+
+bool COutFile::WritePart(const void *data, UInt32 size, UInt32 &processedSize) throw()
+{
+ if (size > kChunkSizeMax)
+ size = kChunkSizeMax;
+ DWORD processedLoc = 0;
+ bool res = BOOLToBool(::WriteFile(_handle, data, size, &processedLoc, NULL));
+ processedSize = (UInt32)processedLoc;
+ return res;
+}
+
+bool COutFile::Write(const void *data, UInt32 size, UInt32 &processedSize) throw()
+{
+ processedSize = 0;
+ do
+ {
+ UInt32 processedLoc = 0;
+ bool res = WritePart(data, size, processedLoc);
+ processedSize += processedLoc;
+ if (!res)
+ return false;
+ if (processedLoc == 0)
+ return true;
+ data = (const void *)((const unsigned char *)data + processedLoc);
+ size -= processedLoc;
+ }
+ while (size > 0);
+ return true;
+}
+
+bool COutFile::SetEndOfFile() throw() { return BOOLToBool(::SetEndOfFile(_handle)); }
+
+bool COutFile::SetLength(UInt64 length) throw()
+{
+ UInt64 newPosition;
+ if (!Seek(length, newPosition))
+ return false;
+ if (newPosition != length)
+ return false;
+ return SetEndOfFile();
+}
+
+}}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileIO.h b/other-licenses/7zstub/src/CPP/Windows/FileIO.h
new file mode 100644
index 0000000000..e31bc20cc3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileIO.h
@@ -0,0 +1,212 @@
+// Windows/FileIO.h
+
+#ifndef __WINDOWS_FILE_IO_H
+#define __WINDOWS_FILE_IO_H
+
+#include "../Common/MyWindows.h"
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+#include <winioctl.h>
+#endif
+
+#include "../Common/MyString.h"
+#include "../Common/MyBuffer.h"
+
+#include "Defs.h"
+
+#define _my_IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L)
+#define _my_IO_REPARSE_TAG_SYMLINK (0xA000000CL)
+
+#define _my_SYMLINK_FLAG_RELATIVE 1
+
+#define my_FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // REPARSE_DATA_BUFFER
+#define my_FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) // REPARSE_DATA_BUFFER
+
+namespace NWindows {
+namespace NFile {
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+bool FillLinkData(CByteBuffer &dest, const wchar_t *path, bool isSymLink);
+#endif
+
+struct CReparseShortInfo
+{
+ unsigned Offset;
+ unsigned Size;
+
+ bool Parse(const Byte *p, size_t size);
+};
+
+struct CReparseAttr
+{
+ UInt32 Tag;
+ UInt32 Flags;
+ UString SubsName;
+ UString PrintName;
+
+ CReparseAttr(): Tag(0), Flags(0) {}
+
+ // Parse()
+ // returns true and (errorCode = 0), if (correct MOUNT_POINT or SYMLINK)
+ // returns false and (errorCode = ERROR_REPARSE_TAG_MISMATCH), if not (MOUNT_POINT or SYMLINK)
+ bool Parse(const Byte *p, size_t size, DWORD &errorCode);
+
+ bool IsMountPoint() const { return Tag == _my_IO_REPARSE_TAG_MOUNT_POINT; } // it's Junction
+ bool IsSymLink() const { return Tag == _my_IO_REPARSE_TAG_SYMLINK; }
+ bool IsRelative() const { return Flags == _my_SYMLINK_FLAG_RELATIVE; }
+ // bool IsVolume() const;
+
+ bool IsOkNamePair() const;
+ UString GetPath() const;
+};
+
+namespace NIO {
+
+bool GetReparseData(CFSTR path, CByteBuffer &reparseData, BY_HANDLE_FILE_INFORMATION *fileInfo = NULL);
+bool SetReparseData(CFSTR path, bool isDir, const void *data, DWORD size);
+
+class CFileBase
+{
+protected:
+ HANDLE _handle;
+
+ bool Create(CFSTR path, DWORD desiredAccess,
+ DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
+
+public:
+
+ bool DeviceIoControl(DWORD controlCode, LPVOID inBuffer, DWORD inSize,
+ LPVOID outBuffer, DWORD outSize, LPDWORD bytesReturned, LPOVERLAPPED overlapped = NULL) const
+ {
+ return BOOLToBool(::DeviceIoControl(_handle, controlCode, inBuffer, inSize,
+ outBuffer, outSize, bytesReturned, overlapped));
+ }
+
+ bool DeviceIoControlOut(DWORD controlCode, LPVOID outBuffer, DWORD outSize, LPDWORD bytesReturned) const
+ {
+ return DeviceIoControl(controlCode, NULL, 0, outBuffer, outSize, bytesReturned);
+ }
+
+ bool DeviceIoControlOut(DWORD controlCode, LPVOID outBuffer, DWORD outSize) const
+ {
+ DWORD bytesReturned;
+ return DeviceIoControlOut(controlCode, outBuffer, outSize, &bytesReturned);
+ }
+
+public:
+ #ifdef SUPPORT_DEVICE_FILE
+ bool IsDeviceFile;
+ bool SizeDefined;
+ UInt64 Size; // it can be larger than real available size
+ #endif
+
+ CFileBase(): _handle(INVALID_HANDLE_VALUE) {};
+ ~CFileBase() { Close(); }
+
+ bool Close() throw();
+
+ bool GetPosition(UInt64 &position) const throw();
+ bool GetLength(UInt64 &length) const throw();
+
+ bool Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition) const throw();
+ bool Seek(UInt64 position, UInt64 &newPosition) const throw();
+ bool SeekToBegin() const throw();
+ bool SeekToEnd(UInt64 &newPosition) const throw();
+
+ bool GetFileInformation(BY_HANDLE_FILE_INFORMATION *info) const
+ { return BOOLToBool(GetFileInformationByHandle(_handle, info)); }
+
+ static bool GetFileInformation(CFSTR path, BY_HANDLE_FILE_INFORMATION *info)
+ {
+ NIO::CFileBase file;
+ if (!file.Create(path, 0, FILE_SHARE_READ, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS))
+ return false;
+ return file.GetFileInformation(info);
+ }
+};
+
+#ifndef UNDER_CE
+#define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM
+#define IOCTL_CDROM_GET_DRIVE_GEOMETRY CTL_CODE(IOCTL_CDROM_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS)
+// #define IOCTL_CDROM_MEDIA_REMOVAL CTL_CODE(IOCTL_CDROM_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
+
+// IOCTL_DISK_GET_DRIVE_GEOMETRY_EX works since WinXP
+#define my_IOCTL_DISK_GET_DRIVE_GEOMETRY_EX CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+struct my_DISK_GEOMETRY_EX
+{
+ DISK_GEOMETRY Geometry;
+ LARGE_INTEGER DiskSize;
+ BYTE Data[1];
+};
+#endif
+
+class CInFile: public CFileBase
+{
+ #ifdef SUPPORT_DEVICE_FILE
+
+ #ifndef UNDER_CE
+
+ bool GetGeometry(DISK_GEOMETRY *res) const
+ { return DeviceIoControlOut(IOCTL_DISK_GET_DRIVE_GEOMETRY, res, sizeof(*res)); }
+
+ bool GetGeometryEx(my_DISK_GEOMETRY_EX *res) const
+ { return DeviceIoControlOut(my_IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, res, sizeof(*res)); }
+
+ bool GetCdRomGeometry(DISK_GEOMETRY *res) const
+ { return DeviceIoControlOut(IOCTL_CDROM_GET_DRIVE_GEOMETRY, res, sizeof(*res)); }
+
+ bool GetPartitionInfo(PARTITION_INFORMATION *res)
+ { return DeviceIoControlOut(IOCTL_DISK_GET_PARTITION_INFO, LPVOID(res), sizeof(*res)); }
+
+ #endif
+
+ void CorrectDeviceSize();
+ void CalcDeviceSize(CFSTR name);
+
+ #endif
+
+public:
+ bool Open(CFSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
+ bool OpenShared(CFSTR fileName, bool shareForWrite);
+ bool Open(CFSTR fileName);
+
+ #ifndef UNDER_CE
+
+ bool OpenReparse(CFSTR fileName)
+ {
+ // 17.02 fix: to support Windows XP compatibility junctions:
+ // we use Create() with (desiredAccess = 0) instead of Open() with GENERIC_READ
+ return
+ Create(fileName, 0,
+ // Open(fileName,
+ FILE_SHARE_READ, OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS);
+ }
+
+ #endif
+
+ bool Read1(void *data, UInt32 size, UInt32 &processedSize) throw();
+ bool ReadPart(void *data, UInt32 size, UInt32 &processedSize) throw();
+ bool Read(void *data, UInt32 size, UInt32 &processedSize) throw();
+};
+
+class COutFile: public CFileBase
+{
+public:
+ bool Open(CFSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
+ bool Open(CFSTR fileName, DWORD creationDisposition);
+ bool Create(CFSTR fileName, bool createAlways);
+ bool CreateAlways(CFSTR fileName, DWORD flagsAndAttributes);
+
+ bool SetTime(const FILETIME *cTime, const FILETIME *aTime, const FILETIME *mTime) throw();
+ bool SetMTime(const FILETIME *mTime) throw();
+ bool WritePart(const void *data, UInt32 size, UInt32 &processedSize) throw();
+ bool Write(const void *data, UInt32 size, UInt32 &processedSize) throw();
+ bool SetEndOfFile() throw();
+ bool SetLength(UInt64 length) throw();
+};
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileLink.cpp b/other-licenses/7zstub/src/CPP/Windows/FileLink.cpp
new file mode 100644
index 0000000000..b5e47e73c5
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileLink.cpp
@@ -0,0 +1,440 @@
+// Windows/FileLink.cpp
+
+#include "StdAfx.h"
+
+#include "../../C/CpuArch.h"
+
+#ifdef SUPPORT_DEVICE_FILE
+#include "../../C/Alloc.h"
+#endif
+
+#include "FileDir.h"
+#include "FileFind.h"
+#include "FileIO.h"
+#include "FileName.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NFile {
+
+using namespace NName;
+
+/*
+ Reparse Points (Junctions and Symbolic Links):
+ struct
+ {
+ UInt32 Tag;
+ UInt16 Size; // not including starting 8 bytes
+ UInt16 Reserved; // = 0
+
+ UInt16 SubstituteOffset; // offset in bytes from start of namesChars
+ UInt16 SubstituteLen; // size in bytes, it doesn't include tailed NUL
+ UInt16 PrintOffset; // offset in bytes from start of namesChars
+ UInt16 PrintLen; // size in bytes, it doesn't include tailed NUL
+
+ [UInt32] Flags; // for Symbolic Links only.
+
+ UInt16 namesChars[]
+ }
+
+ MOUNT_POINT (Junction point):
+ 1) there is NUL wchar after path
+ 2) Default Order in table:
+ Substitute Path
+ Print Path
+ 3) pathnames can not contain dot directory names
+
+ SYMLINK:
+ 1) there is no NUL wchar after path
+ 2) Default Order in table:
+ Print Path
+ Substitute Path
+*/
+
+/*
+static const UInt32 kReparseFlags_Alias = (1 << 29);
+static const UInt32 kReparseFlags_HighLatency = (1 << 30);
+static const UInt32 kReparseFlags_Microsoft = ((UInt32)1 << 31);
+
+#define _my_IO_REPARSE_TAG_HSM (0xC0000004L)
+#define _my_IO_REPARSE_TAG_HSM2 (0x80000006L)
+#define _my_IO_REPARSE_TAG_SIS (0x80000007L)
+#define _my_IO_REPARSE_TAG_WIM (0x80000008L)
+#define _my_IO_REPARSE_TAG_CSV (0x80000009L)
+#define _my_IO_REPARSE_TAG_DFS (0x8000000AL)
+#define _my_IO_REPARSE_TAG_DFSR (0x80000012L)
+*/
+
+#define Get16(p) GetUi16(p)
+#define Get32(p) GetUi32(p)
+
+#define Set16(p, v) SetUi16(p, v)
+#define Set32(p, v) SetUi32(p, v)
+
+static const wchar_t * const k_LinkPrefix = L"\\??\\";
+static const unsigned k_LinkPrefix_Size = 4;
+
+static const bool IsLinkPrefix(const wchar_t *s)
+{
+ return IsString1PrefixedByString2(s, k_LinkPrefix);
+}
+
+/*
+static const wchar_t * const k_VolumePrefix = L"Volume{";
+static const bool IsVolumeName(const wchar_t *s)
+{
+ return IsString1PrefixedByString2(s, k_VolumePrefix);
+}
+*/
+
+void WriteString(Byte *dest, const wchar_t *path)
+{
+ for (;;)
+ {
+ wchar_t c = *path++;
+ if (c == 0)
+ return;
+ Set16(dest, (UInt16)c);
+ dest += 2;
+ }
+}
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+bool FillLinkData(CByteBuffer &dest, const wchar_t *path, bool isSymLink)
+{
+ bool isAbs = IsAbsolutePath(path);
+ if (!isAbs && !isSymLink)
+ return false;
+
+ bool needPrintName = true;
+
+ if (IsSuperPath(path))
+ {
+ path += kSuperPathPrefixSize;
+ if (!IsDrivePath(path))
+ needPrintName = false;
+ }
+
+ const unsigned add_Prefix_Len = isAbs ? k_LinkPrefix_Size : 0;
+
+ unsigned len2 = MyStringLen(path) * 2;
+ const unsigned len1 = len2 + add_Prefix_Len * 2;
+ if (!needPrintName)
+ len2 = 0;
+
+ unsigned totalNamesSize = (len1 + len2);
+
+ /* some WIM imagex software uses old scheme for symbolic links.
+ so we can old scheme for byte to byte compatibility */
+
+ bool newOrderScheme = isSymLink;
+ // newOrderScheme = false;
+
+ if (!newOrderScheme)
+ totalNamesSize += 2 * 2;
+
+ const size_t size = 8 + 8 + (isSymLink ? 4 : 0) + totalNamesSize;
+ dest.Alloc(size);
+ memset(dest, 0, size);
+ const UInt32 tag = isSymLink ?
+ _my_IO_REPARSE_TAG_SYMLINK :
+ _my_IO_REPARSE_TAG_MOUNT_POINT;
+ Byte *p = dest;
+ Set32(p, tag);
+ Set16(p + 4, (UInt16)(size - 8));
+ Set16(p + 6, 0);
+ p += 8;
+
+ unsigned subOffs = 0;
+ unsigned printOffs = 0;
+ if (newOrderScheme)
+ subOffs = len2;
+ else
+ printOffs = len1 + 2;
+
+ Set16(p + 0, (UInt16)subOffs);
+ Set16(p + 2, (UInt16)len1);
+ Set16(p + 4, (UInt16)printOffs);
+ Set16(p + 6, (UInt16)len2);
+
+ p += 8;
+ if (isSymLink)
+ {
+ UInt32 flags = isAbs ? 0 : _my_SYMLINK_FLAG_RELATIVE;
+ Set32(p, flags);
+ p += 4;
+ }
+
+ if (add_Prefix_Len != 0)
+ WriteString(p + subOffs, k_LinkPrefix);
+ WriteString(p + subOffs + add_Prefix_Len * 2, path);
+ if (needPrintName)
+ WriteString(p + printOffs, path);
+ return true;
+}
+
+#endif
+
+static void GetString(const Byte *p, unsigned len, UString &res)
+{
+ wchar_t *s = res.GetBuf(len);
+ unsigned i;
+ for (i = 0; i < len; i++)
+ {
+ wchar_t c = Get16(p + i * 2);
+ if (c == 0)
+ break;
+ s[i] = c;
+ }
+ s[i] = 0;
+ res.ReleaseBuf_SetLen(i);
+}
+
+bool CReparseAttr::Parse(const Byte *p, size_t size, DWORD &errorCode)
+{
+ errorCode = ERROR_INVALID_REPARSE_DATA;
+ if (size < 8)
+ return false;
+ Tag = Get32(p);
+ UInt32 len = Get16(p + 4);
+ if (len + 8 > size)
+ return false;
+ /*
+ if ((type & kReparseFlags_Alias) == 0 ||
+ (type & kReparseFlags_Microsoft) == 0 ||
+ (type & 0xFFFF) != 3)
+ */
+ if (Tag != _my_IO_REPARSE_TAG_MOUNT_POINT &&
+ Tag != _my_IO_REPARSE_TAG_SYMLINK)
+ {
+ errorCode = ERROR_REPARSE_TAG_MISMATCH; // ERROR_REPARSE_TAG_INVALID
+ return false;
+ }
+
+ if (Get16(p + 6) != 0) // padding
+ return false;
+
+ p += 8;
+ size -= 8;
+
+ if (len != size) // do we need that check?
+ return false;
+
+ if (len < 8)
+ return false;
+ unsigned subOffs = Get16(p);
+ unsigned subLen = Get16(p + 2);
+ unsigned printOffs = Get16(p + 4);
+ unsigned printLen = Get16(p + 6);
+ len -= 8;
+ p += 8;
+
+ Flags = 0;
+ if (Tag == _my_IO_REPARSE_TAG_SYMLINK)
+ {
+ if (len < 4)
+ return false;
+ Flags = Get32(p);
+ len -= 4;
+ p += 4;
+ }
+
+ if ((subOffs & 1) != 0 || subOffs > len || len - subOffs < subLen)
+ return false;
+ if ((printOffs & 1) != 0 || printOffs > len || len - printOffs < printLen)
+ return false;
+ GetString(p + subOffs, subLen >> 1, SubsName);
+ GetString(p + printOffs, printLen >> 1, PrintName);
+
+ errorCode = 0;
+ return true;
+}
+
+bool CReparseShortInfo::Parse(const Byte *p, size_t size)
+{
+ const Byte *start = p;
+ Offset= 0;
+ Size = 0;
+ if (size < 8)
+ return false;
+ UInt32 Tag = Get32(p);
+ UInt32 len = Get16(p + 4);
+ if (len + 8 > size)
+ return false;
+ /*
+ if ((type & kReparseFlags_Alias) == 0 ||
+ (type & kReparseFlags_Microsoft) == 0 ||
+ (type & 0xFFFF) != 3)
+ */
+ if (Tag != _my_IO_REPARSE_TAG_MOUNT_POINT &&
+ Tag != _my_IO_REPARSE_TAG_SYMLINK)
+ // return true;
+ return false;
+
+ if (Get16(p + 6) != 0) // padding
+ return false;
+
+ p += 8;
+ size -= 8;
+
+ if (len != size) // do we need that check?
+ return false;
+
+ if (len < 8)
+ return false;
+ unsigned subOffs = Get16(p);
+ unsigned subLen = Get16(p + 2);
+ unsigned printOffs = Get16(p + 4);
+ unsigned printLen = Get16(p + 6);
+ len -= 8;
+ p += 8;
+
+ // UInt32 Flags = 0;
+ if (Tag == _my_IO_REPARSE_TAG_SYMLINK)
+ {
+ if (len < 4)
+ return false;
+ // Flags = Get32(p);
+ len -= 4;
+ p += 4;
+ }
+
+ if ((subOffs & 1) != 0 || subOffs > len || len - subOffs < subLen)
+ return false;
+ if ((printOffs & 1) != 0 || printOffs > len || len - printOffs < printLen)
+ return false;
+
+ Offset = (unsigned)(p - start) + subOffs;
+ Size = subLen;
+ return true;
+}
+
+bool CReparseAttr::IsOkNamePair() const
+{
+ if (IsLinkPrefix(SubsName))
+ {
+ if (!IsDrivePath(SubsName.Ptr(k_LinkPrefix_Size)))
+ return PrintName.IsEmpty();
+ if (wcscmp(SubsName.Ptr(k_LinkPrefix_Size), PrintName) == 0)
+ return true;
+ }
+ return wcscmp(SubsName, PrintName) == 0;
+}
+
+/*
+bool CReparseAttr::IsVolume() const
+{
+ if (!IsLinkPrefix(SubsName))
+ return false;
+ return IsVolumeName(SubsName.Ptr(k_LinkPrefix_Size));
+}
+*/
+
+UString CReparseAttr::GetPath() const
+{
+ UString s (SubsName);
+ if (IsLinkPrefix(s))
+ {
+ s.ReplaceOneCharAtPos(1, '\\');
+ if (IsDrivePath(s.Ptr(k_LinkPrefix_Size)))
+ s.DeleteFrontal(k_LinkPrefix_Size);
+ }
+ return s;
+}
+
+
+#ifdef SUPPORT_DEVICE_FILE
+
+namespace NSystem
+{
+bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, UInt64 &freeSize);
+}
+#endif
+
+#ifndef UNDER_CE
+
+namespace NIO {
+
+bool GetReparseData(CFSTR path, CByteBuffer &reparseData, BY_HANDLE_FILE_INFORMATION *fileInfo)
+{
+ reparseData.Free();
+ CInFile file;
+ if (!file.OpenReparse(path))
+ return false;
+
+ if (fileInfo)
+ file.GetFileInformation(fileInfo);
+
+ const unsigned kBufSize = MAXIMUM_REPARSE_DATA_BUFFER_SIZE;
+ CByteArr buf(kBufSize);
+ DWORD returnedSize;
+ if (!file.DeviceIoControlOut(my_FSCTL_GET_REPARSE_POINT, buf, kBufSize, &returnedSize))
+ return false;
+ reparseData.CopyFrom(buf, returnedSize);
+ return true;
+}
+
+static bool CreatePrefixDirOfFile(CFSTR path)
+{
+ FString path2 (path);
+ int pos = path2.ReverseFind_PathSepar();
+ if (pos < 0)
+ return true;
+ #ifdef _WIN32
+ if (pos == 2 && path2[1] == L':')
+ return true; // we don't create Disk folder;
+ #endif
+ path2.DeleteFrom(pos);
+ return NDir::CreateComplexDir(path2);
+}
+
+// If there is Reprase data already, it still writes new Reparse data
+bool SetReparseData(CFSTR path, bool isDir, const void *data, DWORD size)
+{
+ NFile::NFind::CFileInfo fi;
+ if (fi.Find(path))
+ {
+ if (fi.IsDir() != isDir)
+ {
+ ::SetLastError(ERROR_DIRECTORY);
+ return false;
+ }
+ }
+ else
+ {
+ if (isDir)
+ {
+ if (!NDir::CreateComplexDir(path))
+ return false;
+ }
+ else
+ {
+ CreatePrefixDirOfFile(path);
+ COutFile file;
+ if (!file.Create(path, CREATE_NEW))
+ return false;
+ }
+ }
+
+ COutFile file;
+ if (!file.Open(path,
+ FILE_SHARE_WRITE,
+ OPEN_EXISTING,
+ FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS))
+ return false;
+
+ DWORD returnedSize;
+ if (!file.DeviceIoControl(my_FSCTL_SET_REPARSE_POINT, (void *)data, size, NULL, 0, &returnedSize))
+ return false;
+ return true;
+}
+
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileMapping.cpp b/other-licenses/7zstub/src/CPP/Windows/FileMapping.cpp
new file mode 100644
index 0000000000..01c4a943d4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileMapping.cpp
@@ -0,0 +1,12 @@
+// Windows/FileMapping.cpp
+
+#include "StdAfx.h"
+
+#include "FileMapping.h"
+
+namespace NWindows {
+namespace NFile {
+namespace NMapping {
+
+
+}}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileMapping.h b/other-licenses/7zstub/src/CPP/Windows/FileMapping.h
new file mode 100644
index 0000000000..27d076b83b
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileMapping.h
@@ -0,0 +1,66 @@
+// Windows/FileMapping.h
+
+#ifndef __WINDOWS_FILEMAPPING_H
+#define __WINDOWS_FILEMAPPING_H
+
+#include "../Common/MyTypes.h"
+
+#include "Handle.h"
+
+namespace NWindows {
+
+class CFileMapping: public CHandle
+{
+public:
+ WRes Create(DWORD protect, UInt64 maxSize, LPCTSTR name)
+ {
+ _handle = ::CreateFileMapping(INVALID_HANDLE_VALUE, NULL, protect, (DWORD)(maxSize >> 32), (DWORD)maxSize, name);
+ return ::GetLastError();
+ }
+
+ WRes Open(DWORD
+ #ifndef UNDER_CE
+ desiredAccess
+ #endif
+ , LPCTSTR name)
+ {
+ #ifdef UNDER_CE
+ WRes res = Create(PAGE_READONLY, 0, name);
+ if (res == ERROR_ALREADY_EXISTS)
+ return 0;
+ Close();
+ if (res == 0)
+ res = ERROR_FILE_NOT_FOUND;
+ return res;
+ #else
+ _handle = ::OpenFileMapping(desiredAccess, FALSE, name);
+ if (_handle != 0)
+ return 0;
+ return ::GetLastError();
+ #endif
+ }
+
+ LPVOID Map(DWORD desiredAccess, UInt64 fileOffset, SIZE_T numberOfBytesToMap)
+ {
+ return ::MapViewOfFile(_handle, desiredAccess, (DWORD)(fileOffset >> 32), (DWORD)fileOffset, numberOfBytesToMap);
+ }
+
+ #ifndef UNDER_CE
+ LPVOID Map(DWORD desiredAccess, UInt64 fileOffset, SIZE_T numberOfBytesToMap, LPVOID baseAddress)
+ {
+ return ::MapViewOfFileEx(_handle, desiredAccess, (DWORD)(fileOffset >> 32), (DWORD)fileOffset, numberOfBytesToMap, baseAddress);
+ }
+ #endif
+};
+
+class CFileUnmapper
+{
+ const void *_data;
+public:
+ CFileUnmapper(const void *data) : _data(data) {}
+ ~CFileUnmapper() { ::UnmapViewOfFile(_data); }
+};
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileName.cpp b/other-licenses/7zstub/src/CPP/Windows/FileName.cpp
new file mode 100644
index 0000000000..2a227dc600
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileName.cpp
@@ -0,0 +1,839 @@
+// Windows/FileName.cpp
+
+#include "StdAfx.h"
+
+#include "FileName.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NFile {
+namespace NName {
+
+#define IS_SEPAR(c) IS_PATH_SEPAR(c)
+
+int FindSepar(const wchar_t *s) throw()
+{
+ for (const wchar_t *p = s;; p++)
+ {
+ const wchar_t c = *p;
+ if (c == 0)
+ return -1;
+ if (IS_SEPAR(c))
+ return (int)(p - s);
+ }
+}
+
+#ifndef USE_UNICODE_FSTRING
+int FindSepar(const FChar *s) throw()
+{
+ for (const FChar *p = s;; p++)
+ {
+ const FChar c = *p;
+ if (c == 0)
+ return -1;
+ if (IS_SEPAR(c))
+ return (int)(p - s);
+ }
+}
+#endif
+
+#ifndef USE_UNICODE_FSTRING
+void NormalizeDirPathPrefix(FString &dirPath)
+{
+ if (dirPath.IsEmpty())
+ return;
+ if (!IsPathSepar(dirPath.Back()))
+ dirPath.Add_PathSepar();
+}
+#endif
+
+void NormalizeDirPathPrefix(UString &dirPath)
+{
+ if (dirPath.IsEmpty())
+ return;
+ if (!IsPathSepar(dirPath.Back()))
+ dirPath.Add_PathSepar();
+}
+
+#define IS_LETTER_CHAR(c) ((c) >= 'a' && (c) <= 'z' || (c) >= 'A' && (c) <= 'Z')
+
+bool IsDrivePath(const wchar_t *s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && IS_SEPAR(s[2]); }
+
+bool IsAltPathPrefix(CFSTR s) throw()
+{
+ unsigned len = MyStringLen(s);
+ if (len == 0)
+ return false;
+ if (s[len - 1] != ':')
+ return false;
+
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ if (IsDevicePath(s))
+ return false;
+ if (IsSuperPath(s))
+ {
+ s += kSuperPathPrefixSize;
+ len -= kSuperPathPrefixSize;
+ }
+ if (len == 2 && IsDrivePath2(s))
+ return false;
+ #endif
+
+ return true;
+}
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+const char * const kSuperPathPrefix = "\\\\?\\";
+static const char * const kSuperUncPrefix = "\\\\?\\UNC\\";
+
+#define IS_DEVICE_PATH(s) (IS_SEPAR((s)[0]) && IS_SEPAR((s)[1]) && (s)[2] == '.' && IS_SEPAR((s)[3]))
+#define IS_SUPER_PREFIX(s) (IS_SEPAR((s)[0]) && IS_SEPAR((s)[1]) && (s)[2] == '?' && IS_SEPAR((s)[3]))
+#define IS_SUPER_OR_DEVICE_PATH(s) (IS_SEPAR((s)[0]) && IS_SEPAR((s)[1]) && ((s)[2] == '?' || (s)[2] == '.') && IS_SEPAR((s)[3]))
+
+#define IS_UNC_WITH_SLASH(s) ( \
+ ((s)[0] == 'U' || (s)[0] == 'u') \
+ && ((s)[1] == 'N' || (s)[1] == 'n') \
+ && ((s)[2] == 'C' || (s)[2] == 'c') \
+ && IS_SEPAR((s)[3]))
+
+bool IsDevicePath(CFSTR s) throw()
+{
+ #ifdef UNDER_CE
+
+ s = s;
+ return false;
+ /*
+ // actually we don't know the way to open device file in WinCE.
+ unsigned len = MyStringLen(s);
+ if (len < 5 || len > 5 || !IsString1PrefixedByString2(s, "DSK"))
+ return false;
+ if (s[4] != ':')
+ return false;
+ // for reading use SG_REQ sg; if (DeviceIoControl(dsk, IOCTL_DISK_READ));
+ */
+
+ #else
+
+ if (!IS_DEVICE_PATH(s))
+ return false;
+ unsigned len = MyStringLen(s);
+ if (len == 6 && s[5] == ':')
+ return true;
+ if (len < 18 || len > 22 || !IsString1PrefixedByString2(s + kDevicePathPrefixSize, "PhysicalDrive"))
+ return false;
+ for (unsigned i = 17; i < len; i++)
+ if (s[i] < '0' || s[i] > '9')
+ return false;
+ return true;
+
+ #endif
+}
+
+bool IsSuperUncPath(CFSTR s) throw() { return (IS_SUPER_PREFIX(s) && IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)); }
+bool IsNetworkPath(CFSTR s) throw()
+{
+ if (!IS_SEPAR(s[0]) || !IS_SEPAR(s[1]))
+ return false;
+ if (IsSuperUncPath(s))
+ return true;
+ FChar c = s[2];
+ return (c != '.' && c != '?');
+}
+
+unsigned GetNetworkServerPrefixSize(CFSTR s) throw()
+{
+ if (!IS_SEPAR(s[0]) || !IS_SEPAR(s[1]))
+ return 0;
+ unsigned prefixSize = 2;
+ if (IsSuperUncPath(s))
+ prefixSize = kSuperUncPathPrefixSize;
+ else
+ {
+ FChar c = s[2];
+ if (c == '.' || c == '?')
+ return 0;
+ }
+ int pos = FindSepar(s + prefixSize);
+ if (pos < 0)
+ return 0;
+ return prefixSize + pos + 1;
+}
+
+bool IsNetworkShareRootPath(CFSTR s) throw()
+{
+ unsigned prefixSize = GetNetworkServerPrefixSize(s);
+ if (prefixSize == 0)
+ return false;
+ s += prefixSize;
+ int pos = FindSepar(s);
+ if (pos < 0)
+ return true;
+ return s[(unsigned)pos + 1] == 0;
+}
+
+static const unsigned kDrivePrefixSize = 3; /* c:\ */
+
+bool IsDrivePath2(const wchar_t *s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':'; }
+// bool IsDriveName2(const wchar_t *s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == 0; }
+bool IsSuperPath(const wchar_t *s) throw() { return IS_SUPER_PREFIX(s); }
+bool IsSuperOrDevicePath(const wchar_t *s) throw() { return IS_SUPER_OR_DEVICE_PATH(s); }
+// bool IsSuperUncPath(const wchar_t *s) throw() { return (IS_SUPER_PREFIX(s) && IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize)); }
+
+#ifndef USE_UNICODE_FSTRING
+bool IsDrivePath2(CFSTR s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':'; }
+// bool IsDriveName2(CFSTR s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && s[2] == 0; }
+bool IsDrivePath(CFSTR s) throw() { return IS_LETTER_CHAR(s[0]) && s[1] == ':' && IS_SEPAR(s[2]); }
+bool IsSuperPath(CFSTR s) throw() { return IS_SUPER_PREFIX(s); }
+bool IsSuperOrDevicePath(CFSTR s) throw() { return IS_SUPER_OR_DEVICE_PATH(s); }
+#endif // USE_UNICODE_FSTRING
+
+bool IsDrivePath_SuperAllowed(CFSTR s) throw()
+{
+ if (IsSuperPath(s))
+ s += kSuperPathPrefixSize;
+ return IsDrivePath(s);
+}
+
+bool IsDriveRootPath_SuperAllowed(CFSTR s) throw()
+{
+ if (IsSuperPath(s))
+ s += kSuperPathPrefixSize;
+ return IsDrivePath(s) && s[kDrivePrefixSize] == 0;
+}
+
+bool IsAbsolutePath(const wchar_t *s) throw()
+{
+ return IS_SEPAR(s[0]) || IsDrivePath2(s);
+}
+
+int FindAltStreamColon(CFSTR path) throw()
+{
+ unsigned i = 0;
+ if (IsDrivePath2(path))
+ i = 2;
+ int colonPos = -1;
+ for (;; i++)
+ {
+ FChar c = path[i];
+ if (c == 0)
+ return colonPos;
+ if (c == ':')
+ {
+ if (colonPos < 0)
+ colonPos = i;
+ continue;
+ }
+ if (IS_SEPAR(c))
+ colonPos = -1;
+ }
+}
+
+#ifndef USE_UNICODE_FSTRING
+
+static unsigned GetRootPrefixSize_Of_NetworkPath(CFSTR s)
+{
+ // Network path: we look "server\path\" as root prefix
+ int pos = FindSepar(s);
+ if (pos < 0)
+ return 0;
+ int pos2 = FindSepar(s + (unsigned)pos + 1);
+ if (pos2 < 0)
+ return 0;
+ return pos + pos2 + 2;
+}
+
+static unsigned GetRootPrefixSize_Of_SimplePath(CFSTR s)
+{
+ if (IsDrivePath(s))
+ return kDrivePrefixSize;
+ if (!IS_SEPAR(s[0]))
+ return 0;
+ if (s[1] == 0 || !IS_SEPAR(s[1]))
+ return 1;
+ unsigned size = GetRootPrefixSize_Of_NetworkPath(s + 2);
+ return (size == 0) ? 0 : 2 + size;
+}
+
+static unsigned GetRootPrefixSize_Of_SuperPath(CFSTR s)
+{
+ if (IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize))
+ {
+ unsigned size = GetRootPrefixSize_Of_NetworkPath(s + kSuperUncPathPrefixSize);
+ return (size == 0) ? 0 : kSuperUncPathPrefixSize + size;
+ }
+ // we support \\?\c:\ paths and volume GUID paths \\?\Volume{GUID}\"
+ int pos = FindSepar(s + kSuperPathPrefixSize);
+ if (pos < 0)
+ return 0;
+ return kSuperPathPrefixSize + pos + 1;
+}
+
+unsigned GetRootPrefixSize(CFSTR s) throw()
+{
+ if (IS_DEVICE_PATH(s))
+ return kDevicePathPrefixSize;
+ if (IsSuperPath(s))
+ return GetRootPrefixSize_Of_SuperPath(s);
+ return GetRootPrefixSize_Of_SimplePath(s);
+}
+
+#endif // USE_UNICODE_FSTRING
+
+static unsigned GetRootPrefixSize_Of_NetworkPath(const wchar_t *s) throw()
+{
+ // Network path: we look "server\path\" as root prefix
+ int pos = FindSepar(s);
+ if (pos < 0)
+ return 0;
+ int pos2 = FindSepar(s + (unsigned)pos + 1);
+ if (pos2 < 0)
+ return 0;
+ return pos + pos2 + 2;
+}
+
+static unsigned GetRootPrefixSize_Of_SimplePath(const wchar_t *s) throw()
+{
+ if (IsDrivePath(s))
+ return kDrivePrefixSize;
+ if (!IS_SEPAR(s[0]))
+ return 0;
+ if (s[1] == 0 || !IS_SEPAR(s[1]))
+ return 1;
+ unsigned size = GetRootPrefixSize_Of_NetworkPath(s + 2);
+ return (size == 0) ? 0 : 2 + size;
+}
+
+static unsigned GetRootPrefixSize_Of_SuperPath(const wchar_t *s) throw()
+{
+ if (IS_UNC_WITH_SLASH(s + kSuperPathPrefixSize))
+ {
+ unsigned size = GetRootPrefixSize_Of_NetworkPath(s + kSuperUncPathPrefixSize);
+ return (size == 0) ? 0 : kSuperUncPathPrefixSize + size;
+ }
+ // we support \\?\c:\ paths and volume GUID paths \\?\Volume{GUID}\"
+ int pos = FindSepar(s + kSuperPathPrefixSize);
+ if (pos < 0)
+ return 0;
+ return kSuperPathPrefixSize + pos + 1;
+}
+
+unsigned GetRootPrefixSize(const wchar_t *s) throw()
+{
+ if (IS_DEVICE_PATH(s))
+ return kDevicePathPrefixSize;
+ if (IsSuperPath(s))
+ return GetRootPrefixSize_Of_SuperPath(s);
+ return GetRootPrefixSize_Of_SimplePath(s);
+}
+
+#else // _WIN32
+
+bool IsAbsolutePath(const wchar_t *s) { return IS_SEPAR(s[0]); }
+
+#ifndef USE_UNICODE_FSTRING
+unsigned GetRootPrefixSize(CFSTR s) { return IS_SEPAR(s[0]) ? 1 : 0; }
+#endif
+unsigned GetRootPrefixSize(const wchar_t *s) { return IS_SEPAR(s[0]) ? 1 : 0; }
+
+#endif // _WIN32
+
+
+#ifndef UNDER_CE
+
+static bool GetCurDir(UString &path)
+{
+ path.Empty();
+ DWORD needLength;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetCurrentDirectory(MAX_PATH + 1, s);
+ path = fs2us(fas2fs(s));
+ }
+ else
+ #endif
+ {
+ WCHAR s[MAX_PATH + 2];
+ s[0] = 0;
+ needLength = ::GetCurrentDirectoryW(MAX_PATH + 1, s);
+ path = s;
+ }
+ return (needLength > 0 && needLength <= MAX_PATH);
+}
+
+static bool ResolveDotsFolders(UString &s)
+{
+ #ifdef _WIN32
+ // s.Replace(L'/', WCHAR_PATH_SEPARATOR);
+ #endif
+
+ for (unsigned i = 0;;)
+ {
+ const wchar_t c = s[i];
+ if (c == 0)
+ return true;
+ if (c == '.' && (i == 0 || IS_SEPAR(s[i - 1])))
+ {
+ const wchar_t c1 = s[i + 1];
+ if (c1 == '.')
+ {
+ const wchar_t c2 = s[i + 2];
+ if (IS_SEPAR(c2) || c2 == 0)
+ {
+ if (i == 0)
+ return false;
+ int k = i - 2;
+ i += 2;
+
+ for (;; k--)
+ {
+ if (k < 0)
+ return false;
+ if (!IS_SEPAR(s[(unsigned)k]))
+ break;
+ }
+
+ do
+ k--;
+ while (k >= 0 && !IS_SEPAR(s[(unsigned)k]));
+
+ unsigned num;
+
+ if (k >= 0)
+ {
+ num = i - k;
+ i = k;
+ }
+ else
+ {
+ num = (c2 == 0 ? i : (i + 1));
+ i = 0;
+ }
+
+ s.Delete(i, num);
+ continue;
+ }
+ }
+ else if (IS_SEPAR(c1) || c1 == 0)
+ {
+ unsigned num = 2;
+ if (i != 0)
+ i--;
+ else if (c1 == 0)
+ num = 1;
+ s.Delete(i, num);
+ continue;
+ }
+ }
+
+ i++;
+ }
+}
+
+#endif // UNDER_CE
+
+#define LONG_PATH_DOTS_FOLDERS_PARSING
+
+
+/*
+Windows (at least 64-bit XP) can't resolve "." or ".." in paths that start with SuperPrefix \\?\
+To solve that problem we check such path:
+ - super path contains "." or ".." - we use kSuperPathType_UseOnlySuper
+ - super path doesn't contain "." or ".." - we use kSuperPathType_UseOnlyMain
+*/
+#ifdef LONG_PATH_DOTS_FOLDERS_PARSING
+#ifndef UNDER_CE
+static bool AreThereDotsFolders(CFSTR s)
+{
+ for (unsigned i = 0;; i++)
+ {
+ FChar c = s[i];
+ if (c == 0)
+ return false;
+ if (c == '.' && (i == 0 || IS_SEPAR(s[i - 1])))
+ {
+ FChar c1 = s[i + 1];
+ if (c1 == 0 || IS_SEPAR(c1) ||
+ (c1 == '.' && (s[i + 2] == 0 || IS_SEPAR(s[i + 2]))))
+ return true;
+ }
+ }
+}
+#endif
+#endif // LONG_PATH_DOTS_FOLDERS_PARSING
+
+#ifdef WIN_LONG_PATH
+
+/*
+Most of Windows versions have problems, if some file or dir name
+contains '.' or ' ' at the end of name (Bad Path).
+To solve that problem, we always use Super Path ("\\?\" prefix and full path)
+in such cases. Note that "." and ".." are not bad names.
+
+There are 3 cases:
+ 1) If the path is already Super Path, we use that path
+ 2) If the path is not Super Path :
+ 2.1) Bad Path; we use only Super Path.
+ 2.2) Good Path; we use Main Path. If it fails, we use Super Path.
+
+ NeedToUseOriginalPath returns:
+ kSuperPathType_UseOnlyMain : Super already
+ kSuperPathType_UseOnlySuper : not Super, Bad Path
+ kSuperPathType_UseMainAndSuper : not Super, Good Path
+*/
+
+int GetUseSuperPathType(CFSTR s) throw()
+{
+ if (IsSuperOrDevicePath(s))
+ {
+ #ifdef LONG_PATH_DOTS_FOLDERS_PARSING
+ if ((s)[2] != '.')
+ if (AreThereDotsFolders(s + kSuperPathPrefixSize))
+ return kSuperPathType_UseOnlySuper;
+ #endif
+ return kSuperPathType_UseOnlyMain;
+ }
+
+ for (unsigned i = 0;; i++)
+ {
+ FChar c = s[i];
+ if (c == 0)
+ return kSuperPathType_UseMainAndSuper;
+ if (c == '.' || c == ' ')
+ {
+ FChar c2 = s[i + 1];
+ if (c2 == 0 || IS_SEPAR(c2))
+ {
+ // if it's "." or "..", it's not bad name.
+ if (c == '.')
+ {
+ if (i == 0 || IS_SEPAR(s[i - 1]))
+ continue;
+ if (s[i - 1] == '.')
+ {
+ if (i - 1 == 0 || IS_SEPAR(s[i - 2]))
+ continue;
+ }
+ }
+ return kSuperPathType_UseOnlySuper;
+ }
+ }
+ }
+}
+
+
+/*
+ returns false in two cases:
+ - if GetCurDir was used, and GetCurDir returned error.
+ - if we can't resolve ".." name.
+ if path is ".", "..", res is empty.
+ if it's Super Path already, res is empty.
+ for \**** , and if GetCurDir is not drive (c:\), res is empty
+ for absolute paths, returns true, res is Super path.
+*/
+
+
+static bool GetSuperPathBase(CFSTR s, UString &res)
+{
+ res.Empty();
+
+ FChar c = s[0];
+ if (c == 0)
+ return true;
+ if (c == '.' && (s[1] == 0 || (s[1] == '.' && s[2] == 0)))
+ return true;
+
+ if (IsSuperOrDevicePath(s))
+ {
+ #ifdef LONG_PATH_DOTS_FOLDERS_PARSING
+
+ if ((s)[2] == '.')
+ return true;
+
+ // we will return true here, so we will try to use these problem paths.
+
+ if (!AreThereDotsFolders(s + kSuperPathPrefixSize))
+ return true;
+
+ UString temp = fs2us(s);
+ unsigned fixedSize = GetRootPrefixSize_Of_SuperPath(temp);
+ if (fixedSize == 0)
+ return true;
+
+ UString rem = &temp[fixedSize];
+ if (!ResolveDotsFolders(rem))
+ return true;
+
+ temp.DeleteFrom(fixedSize);
+ res += temp;
+ res += rem;
+
+ #endif
+
+ return true;
+ }
+
+ if (IS_SEPAR(c))
+ {
+ if (IS_SEPAR(s[1]))
+ {
+ UString temp = fs2us(s + 2);
+ unsigned fixedSize = GetRootPrefixSize_Of_NetworkPath(temp);
+ // we ignore that error to allow short network paths server\share?
+ /*
+ if (fixedSize == 0)
+ return false;
+ */
+ UString rem = &temp[fixedSize];
+ if (!ResolveDotsFolders(rem))
+ return false;
+ res += kSuperUncPrefix;
+ temp.DeleteFrom(fixedSize);
+ res += temp;
+ res += rem;
+ return true;
+ }
+ }
+ else
+ {
+ if (IsDrivePath2(s))
+ {
+ UString temp = fs2us(s);
+ unsigned prefixSize = 2;
+ if (IsDrivePath(s))
+ prefixSize = kDrivePrefixSize;
+ UString rem = temp.Ptr(prefixSize);
+ if (!ResolveDotsFolders(rem))
+ return true;
+ res += kSuperPathPrefix;
+ temp.DeleteFrom(prefixSize);
+ res += temp;
+ res += rem;
+ return true;
+ }
+ }
+
+ UString curDir;
+ if (!GetCurDir(curDir))
+ return false;
+ NormalizeDirPathPrefix(curDir);
+
+ unsigned fixedSizeStart = 0;
+ unsigned fixedSize = 0;
+ const char *superMarker = NULL;
+ if (IsSuperPath(curDir))
+ {
+ fixedSize = GetRootPrefixSize_Of_SuperPath(curDir);
+ if (fixedSize == 0)
+ return false;
+ }
+ else
+ {
+ if (IsDrivePath(curDir))
+ {
+ superMarker = kSuperPathPrefix;
+ fixedSize = kDrivePrefixSize;
+ }
+ else
+ {
+ if (!IsPathSepar(curDir[0]) || !IsPathSepar(curDir[1]))
+ return false;
+ fixedSizeStart = 2;
+ fixedSize = GetRootPrefixSize_Of_NetworkPath(curDir.Ptr(2));
+ if (fixedSize == 0)
+ return false;
+ superMarker = kSuperUncPrefix;
+ }
+ }
+
+ UString temp;
+ if (IS_SEPAR(c))
+ {
+ temp = fs2us(s + 1);
+ }
+ else
+ {
+ temp += &curDir[fixedSizeStart + fixedSize];
+ temp += fs2us(s);
+ }
+ if (!ResolveDotsFolders(temp))
+ return false;
+ if (superMarker)
+ res += superMarker;
+ res += curDir.Mid(fixedSizeStart, fixedSize);
+ res += temp;
+ return true;
+}
+
+
+/*
+ In that case if GetSuperPathBase doesn't return new path, we don't need
+ to use same path that was used as main path
+
+ GetSuperPathBase superPath.IsEmpty() onlyIfNew
+ false * * GetCurDir Error
+ true false * use Super path
+ true true true don't use any path, we already used mainPath
+ true true false use main path as Super Path, we don't try mainMath
+ That case is possible now if GetCurDir returns unknow
+ type of path (not drive and not network)
+
+ We can change that code if we want to try mainPath, if GetSuperPathBase returns error,
+ and we didn't try mainPath still.
+ If we want to work that way, we don't need to use GetSuperPathBase return code.
+*/
+
+bool GetSuperPath(CFSTR path, UString &superPath, bool onlyIfNew)
+{
+ if (GetSuperPathBase(path, superPath))
+ {
+ if (superPath.IsEmpty())
+ {
+ // actually the only possible when onlyIfNew == true and superPath is empty
+ // is case when
+
+ if (onlyIfNew)
+ return false;
+ superPath = fs2us(path);
+ }
+ return true;
+ }
+ return false;
+}
+
+bool GetSuperPaths(CFSTR s1, CFSTR s2, UString &d1, UString &d2, bool onlyIfNew)
+{
+ if (!GetSuperPathBase(s1, d1) ||
+ !GetSuperPathBase(s2, d2))
+ return false;
+ if (d1.IsEmpty() && d2.IsEmpty() && onlyIfNew)
+ return false;
+ if (d1.IsEmpty()) d1 = fs2us(s1);
+ if (d2.IsEmpty()) d2 = fs2us(s2);
+ return true;
+}
+
+
+/*
+// returns true, if we need additional use with New Super path.
+bool GetSuperPath(CFSTR path, UString &superPath)
+{
+ if (GetSuperPathBase(path, superPath))
+ return !superPath.IsEmpty();
+ return false;
+}
+*/
+#endif // WIN_LONG_PATH
+
+bool GetFullPath(CFSTR dirPrefix, CFSTR s, FString &res)
+{
+ res = s;
+
+ #ifdef UNDER_CE
+
+ if (!IS_SEPAR(s[0]))
+ {
+ if (!dirPrefix)
+ return false;
+ res = dirPrefix;
+ res += s;
+ }
+
+ #else
+
+ unsigned prefixSize = GetRootPrefixSize(s);
+ if (prefixSize != 0)
+ {
+ if (!AreThereDotsFolders(s + prefixSize))
+ return true;
+
+ UString rem = fs2us(s + prefixSize);
+ if (!ResolveDotsFolders(rem))
+ return true; // maybe false;
+ res.DeleteFrom(prefixSize);
+ res += us2fs(rem);
+ return true;
+ }
+
+ /*
+ FChar c = s[0];
+ if (c == 0)
+ return true;
+ if (c == '.' && (s[1] == 0 || (s[1] == '.' && s[2] == 0)))
+ return true;
+ if (IS_SEPAR(c) && IS_SEPAR(s[1]))
+ return true;
+ if (IsDrivePath(s))
+ return true;
+ */
+
+ UString curDir;
+ if (dirPrefix)
+ curDir = fs2us(dirPrefix);
+ else
+ {
+ if (!GetCurDir(curDir))
+ return false;
+ }
+ NormalizeDirPathPrefix(curDir);
+
+ unsigned fixedSize = 0;
+
+ #ifdef _WIN32
+
+ if (IsSuperPath(curDir))
+ {
+ fixedSize = GetRootPrefixSize_Of_SuperPath(curDir);
+ if (fixedSize == 0)
+ return false;
+ }
+ else
+ {
+ if (IsDrivePath(curDir))
+ fixedSize = kDrivePrefixSize;
+ else
+ {
+ if (!IsPathSepar(curDir[0]) || !IsPathSepar(curDir[1]))
+ return false;
+ fixedSize = GetRootPrefixSize_Of_NetworkPath(curDir.Ptr(2));
+ if (fixedSize == 0)
+ return false;
+ fixedSize += 2;
+ }
+ }
+
+ #endif // _WIN32
+
+ UString temp;
+ if (IS_SEPAR(s[0]))
+ {
+ temp = fs2us(s + 1);
+ }
+ else
+ {
+ temp += curDir.Ptr(fixedSize);
+ temp += fs2us(s);
+ }
+ if (!ResolveDotsFolders(temp))
+ return false;
+ curDir.DeleteFrom(fixedSize);
+ res = us2fs(curDir);
+ res += us2fs(temp);
+
+ #endif // UNDER_CE
+
+ return true;
+}
+
+bool GetFullPath(CFSTR path, FString &fullPath)
+{
+ return GetFullPath(NULL, path, fullPath);
+}
+
+}}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileName.h b/other-licenses/7zstub/src/CPP/Windows/FileName.h
new file mode 100644
index 0000000000..1e47098632
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileName.h
@@ -0,0 +1,115 @@
+// Windows/FileName.h
+
+#ifndef __WINDOWS_FILE_NAME_H
+#define __WINDOWS_FILE_NAME_H
+
+#include "../Common/MyString.h"
+
+namespace NWindows {
+namespace NFile {
+namespace NName {
+
+int FindSepar(const wchar_t *s) throw();
+#ifndef USE_UNICODE_FSTRING
+int FindSepar(const FChar *s) throw();
+#endif
+
+void NormalizeDirPathPrefix(FString &dirPath); // ensures that it ended with '\\', if dirPath is not epmty
+void NormalizeDirPathPrefix(UString &dirPath);
+
+bool IsDrivePath(const wchar_t *s) throw(); // first 3 chars are drive chars like "a:\\"
+
+bool IsAltPathPrefix(CFSTR s) throw(); /* name: */
+
+#if defined(_WIN32) && !defined(UNDER_CE)
+
+extern const char * const kSuperPathPrefix; /* \\?\ */
+const unsigned kDevicePathPrefixSize = 4;
+const unsigned kSuperPathPrefixSize = 4;
+const unsigned kSuperUncPathPrefixSize = kSuperPathPrefixSize + 4;
+
+bool IsDevicePath(CFSTR s) throw(); /* \\.\ */
+bool IsSuperUncPath(CFSTR s) throw(); /* \\?\UNC\ */
+bool IsNetworkPath(CFSTR s) throw(); /* \\?\UNC\ or \\SERVER */
+
+/* GetNetworkServerPrefixSize() returns size of server prefix:
+ \\?\UNC\SERVER\
+ \\SERVER\
+ in another cases it returns 0
+*/
+
+unsigned GetNetworkServerPrefixSize(CFSTR s) throw();
+
+bool IsNetworkShareRootPath(CFSTR s) throw(); /* \\?\UNC\SERVER\share or \\SERVER\share or with slash */
+
+bool IsDrivePath_SuperAllowed(CFSTR s) throw(); // first chars are drive chars like "a:\" or "\\?\a:\"
+bool IsDriveRootPath_SuperAllowed(CFSTR s) throw(); // exact drive root path "a:\" or "\\?\a:\"
+
+bool IsDrivePath2(const wchar_t *s) throw(); // first 2 chars are drive chars like "a:"
+// bool IsDriveName2(const wchar_t *s) throw(); // is drive name like "a:"
+bool IsSuperPath(const wchar_t *s) throw();
+bool IsSuperOrDevicePath(const wchar_t *s) throw();
+
+#ifndef USE_UNICODE_FSTRING
+bool IsDrivePath2(CFSTR s) throw(); // first 2 chars are drive chars like "a:"
+// bool IsDriveName2(CFSTR s) throw(); // is drive name like "a:"
+bool IsDrivePath(CFSTR s) throw();
+bool IsSuperPath(CFSTR s) throw();
+bool IsSuperOrDevicePath(CFSTR s) throw();
+
+/* GetRootPrefixSize() returns size of ROOT PREFIX for cases:
+ \
+ \\.\
+ C:\
+ \\?\C:\
+ \\?\UNC\SERVER\Shared\
+ \\SERVER\Shared\
+ in another cases it returns 0
+*/
+
+unsigned GetRootPrefixSize(CFSTR s) throw();
+
+#endif
+
+int FindAltStreamColon(CFSTR path) throw();
+
+#endif // _WIN32
+
+bool IsAbsolutePath(const wchar_t *s) throw();
+unsigned GetRootPrefixSize(const wchar_t *s) throw();
+
+#ifdef WIN_LONG_PATH
+
+const int kSuperPathType_UseOnlyMain = 0;
+const int kSuperPathType_UseOnlySuper = 1;
+const int kSuperPathType_UseMainAndSuper = 2;
+
+int GetUseSuperPathType(CFSTR s) throw();
+bool GetSuperPath(CFSTR path, UString &superPath, bool onlyIfNew);
+bool GetSuperPaths(CFSTR s1, CFSTR s2, UString &d1, UString &d2, bool onlyIfNew);
+
+#define USE_MAIN_PATH (__useSuperPathType != kSuperPathType_UseOnlySuper)
+#define USE_MAIN_PATH_2 (__useSuperPathType1 != kSuperPathType_UseOnlySuper && __useSuperPathType2 != kSuperPathType_UseOnlySuper)
+
+#define USE_SUPER_PATH (__useSuperPathType != kSuperPathType_UseOnlyMain)
+#define USE_SUPER_PATH_2 (__useSuperPathType1 != kSuperPathType_UseOnlyMain || __useSuperPathType2 != kSuperPathType_UseOnlyMain)
+
+#define IF_USE_MAIN_PATH int __useSuperPathType = GetUseSuperPathType(path); if (USE_MAIN_PATH)
+#define IF_USE_MAIN_PATH_2(x1, x2) \
+ int __useSuperPathType1 = GetUseSuperPathType(x1); \
+ int __useSuperPathType2 = GetUseSuperPathType(x2); \
+ if (USE_MAIN_PATH_2)
+
+#else
+
+#define IF_USE_MAIN_PATH
+#define IF_USE_MAIN_PATH_2(x1, x2)
+
+#endif // WIN_LONG_PATH
+
+bool GetFullPath(CFSTR dirPrefix, CFSTR path, FString &fullPath);
+bool GetFullPath(CFSTR path, FString &fullPath);
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileSystem.cpp b/other-licenses/7zstub/src/CPP/Windows/FileSystem.cpp
new file mode 100644
index 0000000000..9861062808
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileSystem.cpp
@@ -0,0 +1,131 @@
+// Windows/FileSystem.cpp
+
+#include "StdAfx.h"
+
+#ifndef UNDER_CE
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "FileSystem.h"
+#include "Defs.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NFile {
+namespace NSystem {
+
+bool MyGetVolumeInformation(
+ CFSTR rootPath,
+ UString &volumeName,
+ LPDWORD volumeSerialNumber,
+ LPDWORD maximumComponentLength,
+ LPDWORD fileSystemFlags,
+ UString &fileSystemName)
+{
+ BOOL res;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ TCHAR v[MAX_PATH + 2]; v[0] = 0;
+ TCHAR f[MAX_PATH + 2]; f[0] = 0;
+ res = GetVolumeInformation(fs2fas(rootPath),
+ v, MAX_PATH,
+ volumeSerialNumber, maximumComponentLength, fileSystemFlags,
+ f, MAX_PATH);
+ volumeName = MultiByteToUnicodeString(v);
+ fileSystemName = MultiByteToUnicodeString(f);
+ }
+ else
+ #endif
+ {
+ WCHAR v[MAX_PATH + 2]; v[0] = 0;
+ WCHAR f[MAX_PATH + 2]; f[0] = 0;
+ res = GetVolumeInformationW(fs2us(rootPath),
+ v, MAX_PATH,
+ volumeSerialNumber, maximumComponentLength, fileSystemFlags,
+ f, MAX_PATH);
+ volumeName = v;
+ fileSystemName = f;
+ }
+ return BOOLToBool(res);
+}
+
+UINT MyGetDriveType(CFSTR pathName)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ return GetDriveType(fs2fas(pathName));
+ }
+ else
+ #endif
+ {
+ return GetDriveTypeW(fs2us(pathName));
+ }
+}
+
+typedef BOOL (WINAPI * GetDiskFreeSpaceExA_Pointer)(
+ LPCSTR lpDirectoryName, // directory name
+ PULARGE_INTEGER lpFreeBytesAvailable, // bytes available to caller
+ PULARGE_INTEGER lpTotalNumberOfBytes, // bytes on disk
+ PULARGE_INTEGER lpTotalNumberOfFreeBytes // free bytes on disk
+);
+
+typedef BOOL (WINAPI * GetDiskFreeSpaceExW_Pointer)(
+ LPCWSTR lpDirectoryName, // directory name
+ PULARGE_INTEGER lpFreeBytesAvailable, // bytes available to caller
+ PULARGE_INTEGER lpTotalNumberOfBytes, // bytes on disk
+ PULARGE_INTEGER lpTotalNumberOfFreeBytes // free bytes on disk
+);
+
+bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, UInt64 &freeSize)
+{
+ DWORD numSectorsPerCluster, bytesPerSector, numFreeClusters, numClusters;
+ bool sizeIsDetected = false;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ GetDiskFreeSpaceExA_Pointer pGetDiskFreeSpaceEx = (GetDiskFreeSpaceExA_Pointer)GetProcAddress(
+ GetModuleHandle(TEXT("kernel32.dll")), "GetDiskFreeSpaceExA");
+ if (pGetDiskFreeSpaceEx)
+ {
+ ULARGE_INTEGER freeBytesToCaller2, totalSize2, freeSize2;
+ sizeIsDetected = BOOLToBool(pGetDiskFreeSpaceEx(fs2fas(rootPath), &freeBytesToCaller2, &totalSize2, &freeSize2));
+ totalSize = totalSize2.QuadPart;
+ freeSize = freeSize2.QuadPart;
+ }
+ if (!::GetDiskFreeSpace(fs2fas(rootPath), &numSectorsPerCluster, &bytesPerSector, &numFreeClusters, &numClusters))
+ return false;
+ }
+ else
+ #endif
+ {
+ GetDiskFreeSpaceExW_Pointer pGetDiskFreeSpaceEx = (GetDiskFreeSpaceExW_Pointer)GetProcAddress(
+ GetModuleHandle(TEXT("kernel32.dll")), "GetDiskFreeSpaceExW");
+ if (pGetDiskFreeSpaceEx)
+ {
+ ULARGE_INTEGER freeBytesToCaller2, totalSize2, freeSize2;
+ sizeIsDetected = BOOLToBool(pGetDiskFreeSpaceEx(fs2us(rootPath), &freeBytesToCaller2, &totalSize2, &freeSize2));
+ totalSize = totalSize2.QuadPart;
+ freeSize = freeSize2.QuadPart;
+ }
+ if (!::GetDiskFreeSpaceW(fs2us(rootPath), &numSectorsPerCluster, &bytesPerSector, &numFreeClusters, &numClusters))
+ return false;
+ }
+ clusterSize = (UInt64)bytesPerSector * (UInt64)numSectorsPerCluster;
+ if (!sizeIsDetected)
+ {
+ totalSize = clusterSize * (UInt64)numClusters;
+ freeSize = clusterSize * (UInt64)numFreeClusters;
+ }
+ return true;
+}
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/FileSystem.h b/other-licenses/7zstub/src/CPP/Windows/FileSystem.h
new file mode 100644
index 0000000000..b0149de421
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/FileSystem.h
@@ -0,0 +1,27 @@
+// Windows/FileSystem.h
+
+#ifndef __WINDOWS_FILE_SYSTEM_H
+#define __WINDOWS_FILE_SYSTEM_H
+
+#include "../Common/MyString.h"
+#include "../Common/MyTypes.h"
+
+namespace NWindows {
+namespace NFile {
+namespace NSystem {
+
+bool MyGetVolumeInformation(
+ CFSTR rootPath ,
+ UString &volumeName,
+ LPDWORD volumeSerialNumber,
+ LPDWORD maximumComponentLength,
+ LPDWORD fileSystemFlags,
+ UString &fileSystemName);
+
+UINT MyGetDriveType(CFSTR pathName);
+
+bool MyGetDiskFreeSpace(CFSTR rootPath, UInt64 &clusterSize, UInt64 &totalSize, UInt64 &freeSize);
+
+}}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Handle.h b/other-licenses/7zstub/src/CPP/Windows/Handle.h
new file mode 100644
index 0000000000..755eeb8c5f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Handle.h
@@ -0,0 +1,37 @@
+// Windows/Handle.h
+
+#ifndef __WINDOWS_HANDLE_H
+#define __WINDOWS_HANDLE_H
+
+namespace NWindows {
+
+class CHandle
+{
+protected:
+ HANDLE _handle;
+public:
+ operator HANDLE() { return _handle; }
+ CHandle(): _handle(NULL) {}
+ ~CHandle() { Close(); }
+ bool IsCreated() const { return (_handle != NULL); }
+ bool Close()
+ {
+ if (_handle == NULL)
+ return true;
+ if (!::CloseHandle(_handle))
+ return false;
+ _handle = NULL;
+ return true;
+ }
+ void Attach(HANDLE handle) { _handle = handle; }
+ HANDLE Detach()
+ {
+ HANDLE handle = _handle;
+ _handle = NULL;
+ return handle;
+ }
+};
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/MemoryLock.cpp b/other-licenses/7zstub/src/CPP/Windows/MemoryLock.cpp
new file mode 100644
index 0000000000..3cd82e50e8
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/MemoryLock.cpp
@@ -0,0 +1,97 @@
+// Windows/MemoryLock.cpp
+
+#include "StdAfx.h"
+
+#include "MemoryLock.h"
+
+namespace NWindows {
+namespace NSecurity {
+
+#ifndef UNDER_CE
+
+#ifdef _UNICODE
+#define MY_FUNC_SELECT(f) :: f
+#else
+#define MY_FUNC_SELECT(f) my_ ## f
+extern "C" {
+typedef BOOL (WINAPI * Func_OpenProcessToken)(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle);
+typedef BOOL (WINAPI * Func_LookupPrivilegeValue)(LPCTSTR lpSystemName, LPCTSTR lpName, PLUID lpLuid);
+typedef BOOL (WINAPI * Func_AdjustTokenPrivileges)(HANDLE TokenHandle, BOOL DisableAllPrivileges,
+ PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength);
+}
+#define GET_PROC_ADDR(fff, name) Func_ ## fff my_ ## fff = (Func_ ## fff)GetProcAddress(hModule, name)
+#endif
+
+bool EnablePrivilege(LPCTSTR privilegeName, bool enable)
+{
+ bool res = false;
+
+ #ifndef _UNICODE
+
+ HMODULE hModule = ::LoadLibrary(TEXT("Advapi32.dll"));
+ if (hModule == NULL)
+ return false;
+
+ GET_PROC_ADDR(OpenProcessToken, "OpenProcessToken");
+ GET_PROC_ADDR(LookupPrivilegeValue, "LookupPrivilegeValueA");
+ GET_PROC_ADDR(AdjustTokenPrivileges, "AdjustTokenPrivileges");
+
+ if (my_OpenProcessToken &&
+ my_AdjustTokenPrivileges &&
+ my_LookupPrivilegeValue)
+
+ #endif
+
+ {
+ HANDLE token;
+ if (MY_FUNC_SELECT(OpenProcessToken)(::GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
+ {
+ TOKEN_PRIVILEGES tp;
+ if (MY_FUNC_SELECT(LookupPrivilegeValue)(NULL, privilegeName, &(tp.Privileges[0].Luid)))
+ {
+ tp.PrivilegeCount = 1;
+ tp.Privileges[0].Attributes = (enable ? SE_PRIVILEGE_ENABLED : 0);
+ if (MY_FUNC_SELECT(AdjustTokenPrivileges)(token, FALSE, &tp, 0, NULL, NULL))
+ res = (GetLastError() == ERROR_SUCCESS);
+ }
+ ::CloseHandle(token);
+ }
+ }
+
+ #ifndef _UNICODE
+
+ ::FreeLibrary(hModule);
+
+ #endif
+
+ return res;
+}
+
+
+
+typedef void (WINAPI * Func_RtlGetVersion) (OSVERSIONINFOEXW *);
+
+/*
+ We suppose that Window 10 works incorrectly with "Large Pages" at:
+ - Windows 10 1703 (15063)
+ - Windows 10 1709 (16299)
+*/
+
+unsigned Get_LargePages_RiskLevel()
+{
+ OSVERSIONINFOEXW vi;
+ HMODULE ntdll = ::GetModuleHandleW(L"ntdll.dll");
+ if (!ntdll)
+ return 0;
+ Func_RtlGetVersion func = (Func_RtlGetVersion)GetProcAddress(ntdll, "RtlGetVersion");
+ if (!func)
+ return 0;
+ func(&vi);
+ return (vi.dwPlatformId == VER_PLATFORM_WIN32_NT
+ && vi.dwMajorVersion + vi.dwMinorVersion == 10
+ && vi.dwBuildNumber <= 16299) ? 1 : 0;
+}
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/MemoryLock.h b/other-licenses/7zstub/src/CPP/Windows/MemoryLock.h
new file mode 100644
index 0000000000..d82910feb9
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/MemoryLock.h
@@ -0,0 +1,40 @@
+// Windows/MemoryLock.h
+
+#ifndef __WINDOWS_MEMORY_LOCK_H
+#define __WINDOWS_MEMORY_LOCK_H
+
+#include "../Common/MyWindows.h"
+
+namespace NWindows {
+namespace NSecurity {
+
+#ifndef UNDER_CE
+
+bool EnablePrivilege(LPCTSTR privilegeName, bool enable = true);
+
+inline bool EnablePrivilege_LockMemory(bool enable = true)
+{
+ return EnablePrivilege(SE_LOCK_MEMORY_NAME, enable);
+}
+
+inline void EnablePrivilege_SymLink()
+{
+ /* Probably we do not to set any Privilege for junction points.
+ But we need them for Symbolic links */
+ NSecurity::EnablePrivilege(SE_RESTORE_NAME);
+
+ /* Probably we need only SE_RESTORE_NAME, but there is also
+ SE_CREATE_SYMBOLIC_LINK_NAME. So we set it also. Do we need it? */
+
+ NSecurity::EnablePrivilege(TEXT("SeCreateSymbolicLinkPrivilege")); // SE_CREATE_SYMBOLIC_LINK_NAME
+
+ // Do we need to set SE_BACKUP_NAME ?
+}
+
+unsigned Get_LargePages_RiskLevel();
+
+#endif
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/NtCheck.h b/other-licenses/7zstub/src/CPP/Windows/NtCheck.h
new file mode 100644
index 0000000000..401e239e06
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/NtCheck.h
@@ -0,0 +1,46 @@
+// Windows/NtCheck.h
+
+#ifndef __WINDOWS_NT_CHECK_H
+#define __WINDOWS_NT_CHECK_H
+
+#ifdef _WIN32
+
+#include "../Common/MyWindows.h"
+
+#if !defined(_WIN64) && !defined(UNDER_CE)
+static inline bool IsItWindowsNT()
+{
+ OSVERSIONINFO vi;
+ vi.dwOSVersionInfoSize = sizeof(vi);
+ return (::GetVersionEx(&vi) && vi.dwPlatformId == VER_PLATFORM_WIN32_NT);
+}
+#endif
+
+#ifndef _UNICODE
+ #if defined(_WIN64) || defined(UNDER_CE)
+ bool g_IsNT = true;
+ #define SET_IS_NT
+ #else
+ bool g_IsNT = false;
+ #define SET_IS_NT g_IsNT = IsItWindowsNT();
+ #endif
+ #define NT_CHECK_ACTION
+ // #define NT_CHECK_ACTION { NT_CHECK_FAIL_ACTION }
+#else
+ #if !defined(_WIN64) && !defined(UNDER_CE)
+ #define NT_CHECK_ACTION if (!IsItWindowsNT()) { NT_CHECK_FAIL_ACTION }
+ #else
+ #define NT_CHECK_ACTION
+ #endif
+ #define SET_IS_NT
+#endif
+
+#define NT_CHECK NT_CHECK_ACTION SET_IS_NT
+
+#else
+
+#define NT_CHECK
+
+#endif
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/PropVariant.cpp b/other-licenses/7zstub/src/CPP/Windows/PropVariant.cpp
new file mode 100644
index 0000000000..6d9fb48ed4
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/PropVariant.cpp
@@ -0,0 +1,347 @@
+// Windows/PropVariant.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/Defs.h"
+
+#include "PropVariant.h"
+
+namespace NWindows {
+namespace NCOM {
+
+BSTR AllocBstrFromAscii(const char *s) throw()
+{
+ if (!s)
+ return NULL;
+ UINT len = (UINT)strlen(s);
+ BSTR p = ::SysAllocStringLen(NULL, len);
+ if (p)
+ {
+ for (UINT i = 0; i <= len; i++)
+ p[i] = (Byte)s[i];
+ }
+ return p;
+}
+
+HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) throw()
+{
+ p->bstrVal = ::SysAllocStringLen(NULL, numChars);
+ if (!p->bstrVal)
+ {
+ p->vt = VT_ERROR;
+ p->scode = E_OUTOFMEMORY;
+ return E_OUTOFMEMORY;
+ }
+ p->vt = VT_BSTR;
+ return S_OK;
+}
+
+HRESULT PropVarEm_Set_Str(PROPVARIANT *p, const char *s) throw()
+{
+ p->bstrVal = AllocBstrFromAscii(s);
+ if (p->bstrVal)
+ {
+ p->vt = VT_BSTR;
+ return S_OK;
+ }
+ p->vt = VT_ERROR;
+ p->scode = E_OUTOFMEMORY;
+ return E_OUTOFMEMORY;
+}
+
+CPropVariant::CPropVariant(const PROPVARIANT &varSrc)
+{
+ vt = VT_EMPTY;
+ InternalCopy(&varSrc);
+}
+
+CPropVariant::CPropVariant(const CPropVariant &varSrc)
+{
+ vt = VT_EMPTY;
+ InternalCopy(&varSrc);
+}
+
+CPropVariant::CPropVariant(BSTR bstrSrc)
+{
+ vt = VT_EMPTY;
+ *this = bstrSrc;
+}
+
+CPropVariant::CPropVariant(LPCOLESTR lpszSrc)
+{
+ vt = VT_EMPTY;
+ *this = lpszSrc;
+}
+
+CPropVariant& CPropVariant::operator=(const CPropVariant &varSrc)
+{
+ InternalCopy(&varSrc);
+ return *this;
+}
+
+CPropVariant& CPropVariant::operator=(const PROPVARIANT &varSrc)
+{
+ InternalCopy(&varSrc);
+ return *this;
+}
+
+CPropVariant& CPropVariant::operator=(BSTR bstrSrc)
+{
+ *this = (LPCOLESTR)bstrSrc;
+ return *this;
+}
+
+static const char * const kMemException = "out of memory";
+
+CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc)
+{
+ InternalClear();
+ vt = VT_BSTR;
+ wReserved1 = 0;
+ bstrVal = ::SysAllocString(lpszSrc);
+ if (!bstrVal && lpszSrc)
+ {
+ throw kMemException;
+ // vt = VT_ERROR;
+ // scode = E_OUTOFMEMORY;
+ }
+ return *this;
+}
+
+CPropVariant& CPropVariant::operator=(const UString &s)
+{
+ InternalClear();
+ vt = VT_BSTR;
+ wReserved1 = 0;
+ bstrVal = ::SysAllocStringLen(s, s.Len());
+ if (!bstrVal)
+ throw kMemException;
+ return *this;
+}
+
+CPropVariant& CPropVariant::operator=(const UString2 &s)
+{
+ /*
+ if (s.IsEmpty())
+ *this = L"";
+ else
+ */
+ {
+ InternalClear();
+ vt = VT_BSTR;
+ wReserved1 = 0;
+ bstrVal = ::SysAllocStringLen(s.GetRawPtr(), s.Len());
+ if (!bstrVal)
+ throw kMemException;
+ /* SysAllocStringLen probably appends a null-terminating character for NULL string.
+ But it doesn't specified in MSDN.
+ But we suppose that it works
+
+ if (!s.GetRawPtr())
+ {
+ *bstrVal = 0;
+ }
+ */
+
+ /* MSDN: Windows CE: SysAllocStringLen() : Passing invalid (and under some circumstances NULL)
+ pointers to this function causes an unexpected termination of the application.
+ Is it safe? Maybe we must chamnge the code for that case ? */
+ }
+ return *this;
+}
+
+CPropVariant& CPropVariant::operator=(const char *s)
+{
+ InternalClear();
+ vt = VT_BSTR;
+ wReserved1 = 0;
+ bstrVal = AllocBstrFromAscii(s);
+ if (!bstrVal)
+ {
+ throw kMemException;
+ // vt = VT_ERROR;
+ // scode = E_OUTOFMEMORY;
+ }
+ return *this;
+}
+
+CPropVariant& CPropVariant::operator=(bool bSrc) throw()
+{
+ if (vt != VT_BOOL)
+ {
+ InternalClear();
+ vt = VT_BOOL;
+ }
+ boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
+ return *this;
+}
+
+BSTR CPropVariant::AllocBstr(unsigned numChars)
+{
+ if (vt != VT_EMPTY)
+ InternalClear();
+ vt = VT_BSTR;
+ wReserved1 = 0;
+ bstrVal = ::SysAllocStringLen(NULL, numChars);
+ if (!bstrVal)
+ {
+ throw kMemException;
+ // vt = VT_ERROR;
+ // scode = E_OUTOFMEMORY;
+ }
+ return bstrVal;
+}
+
+#define SET_PROP_FUNC(type, id, dest) \
+ CPropVariant& CPropVariant::operator=(type value) throw() \
+ { if (vt != id) { InternalClear(); vt = id; } \
+ dest = value; return *this; }
+
+SET_PROP_FUNC(Byte, VT_UI1, bVal)
+// SET_PROP_FUNC(Int16, VT_I2, iVal)
+SET_PROP_FUNC(Int32, VT_I4, lVal)
+SET_PROP_FUNC(UInt32, VT_UI4, ulVal)
+SET_PROP_FUNC(UInt64, VT_UI8, uhVal.QuadPart)
+SET_PROP_FUNC(Int64, VT_I8, hVal.QuadPart)
+SET_PROP_FUNC(const FILETIME &, VT_FILETIME, filetime)
+
+HRESULT PropVariant_Clear(PROPVARIANT *prop) throw()
+{
+ switch (prop->vt)
+ {
+ case VT_EMPTY:
+ case VT_UI1:
+ case VT_I1:
+ case VT_I2:
+ case VT_UI2:
+ case VT_BOOL:
+ case VT_I4:
+ case VT_UI4:
+ case VT_R4:
+ case VT_INT:
+ case VT_UINT:
+ case VT_ERROR:
+ case VT_FILETIME:
+ case VT_UI8:
+ case VT_R8:
+ case VT_CY:
+ case VT_DATE:
+ prop->vt = VT_EMPTY;
+ prop->wReserved1 = 0;
+ prop->wReserved2 = 0;
+ prop->wReserved3 = 0;
+ prop->uhVal.QuadPart = 0;
+ return S_OK;
+ }
+ return ::VariantClear((VARIANTARG *)prop);
+ // return ::PropVariantClear(prop);
+ // PropVariantClear can clear VT_BLOB.
+}
+
+HRESULT CPropVariant::Clear() throw()
+{
+ if (vt == VT_EMPTY)
+ return S_OK;
+ return PropVariant_Clear(this);
+}
+
+HRESULT CPropVariant::Copy(const PROPVARIANT* pSrc) throw()
+{
+ ::VariantClear((tagVARIANT *)this);
+ switch (pSrc->vt)
+ {
+ case VT_UI1:
+ case VT_I1:
+ case VT_I2:
+ case VT_UI2:
+ case VT_BOOL:
+ case VT_I4:
+ case VT_UI4:
+ case VT_R4:
+ case VT_INT:
+ case VT_UINT:
+ case VT_ERROR:
+ case VT_FILETIME:
+ case VT_UI8:
+ case VT_R8:
+ case VT_CY:
+ case VT_DATE:
+ memmove((PROPVARIANT*)this, pSrc, sizeof(PROPVARIANT));
+ return S_OK;
+ }
+ return ::VariantCopy((tagVARIANT *)this, (tagVARIANT *)const_cast<PROPVARIANT *>(pSrc));
+}
+
+
+HRESULT CPropVariant::Attach(PROPVARIANT *pSrc) throw()
+{
+ HRESULT hr = Clear();
+ if (FAILED(hr))
+ return hr;
+ memcpy(this, pSrc, sizeof(PROPVARIANT));
+ pSrc->vt = VT_EMPTY;
+ return S_OK;
+}
+
+HRESULT CPropVariant::Detach(PROPVARIANT *pDest) throw()
+{
+ if (pDest->vt != VT_EMPTY)
+ {
+ HRESULT hr = PropVariant_Clear(pDest);
+ if (FAILED(hr))
+ return hr;
+ }
+ memcpy(pDest, this, sizeof(PROPVARIANT));
+ vt = VT_EMPTY;
+ return S_OK;
+}
+
+HRESULT CPropVariant::InternalClear() throw()
+{
+ if (vt == VT_EMPTY)
+ return S_OK;
+ HRESULT hr = Clear();
+ if (FAILED(hr))
+ {
+ vt = VT_ERROR;
+ scode = hr;
+ }
+ return hr;
+}
+
+void CPropVariant::InternalCopy(const PROPVARIANT *pSrc)
+{
+ HRESULT hr = Copy(pSrc);
+ if (FAILED(hr))
+ {
+ if (hr == E_OUTOFMEMORY)
+ throw kMemException;
+ vt = VT_ERROR;
+ scode = hr;
+ }
+}
+
+int CPropVariant::Compare(const CPropVariant &a) throw()
+{
+ if (vt != a.vt)
+ return MyCompare(vt, a.vt);
+ switch (vt)
+ {
+ case VT_EMPTY: return 0;
+ // case VT_I1: return MyCompare(cVal, a.cVal);
+ case VT_UI1: return MyCompare(bVal, a.bVal);
+ case VT_I2: return MyCompare(iVal, a.iVal);
+ case VT_UI2: return MyCompare(uiVal, a.uiVal);
+ case VT_I4: return MyCompare(lVal, a.lVal);
+ case VT_UI4: return MyCompare(ulVal, a.ulVal);
+ // case VT_UINT: return MyCompare(uintVal, a.uintVal);
+ case VT_I8: return MyCompare(hVal.QuadPart, a.hVal.QuadPart);
+ case VT_UI8: return MyCompare(uhVal.QuadPart, a.uhVal.QuadPart);
+ case VT_BOOL: return -MyCompare(boolVal, a.boolVal);
+ case VT_FILETIME: return ::CompareFileTime(&filetime, &a.filetime);
+ case VT_BSTR: return 0; // Not implemented
+ default: return 0;
+ }
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/PropVariant.h b/other-licenses/7zstub/src/CPP/Windows/PropVariant.h
new file mode 100644
index 0000000000..f2eaba2fd0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/PropVariant.h
@@ -0,0 +1,114 @@
+// Windows/PropVariant.h
+
+#ifndef __WINDOWS_PROP_VARIANT_H
+#define __WINDOWS_PROP_VARIANT_H
+
+#include "../Common/MyTypes.h"
+#include "../Common/MyWindows.h"
+#include "../Common/MyString.h"
+
+namespace NWindows {
+namespace NCOM {
+
+BSTR AllocBstrFromAscii(const char *s) throw();
+
+HRESULT PropVariant_Clear(PROPVARIANT *p) throw();
+
+HRESULT PropVarEm_Alloc_Bstr(PROPVARIANT *p, unsigned numChars) throw();
+HRESULT PropVarEm_Set_Str(PROPVARIANT *p, const char *s) throw();
+
+inline void PropVarEm_Set_UInt32(PROPVARIANT *p, UInt32 v) throw()
+{
+ p->vt = VT_UI4;
+ p->ulVal = v;
+}
+
+inline void PropVarEm_Set_UInt64(PROPVARIANT *p, UInt64 v) throw()
+{
+ p->vt = VT_UI8;
+ p->uhVal.QuadPart = v;
+}
+
+inline void PropVarEm_Set_FileTime64(PROPVARIANT *p, UInt64 v) throw()
+{
+ p->vt = VT_FILETIME;
+ p->filetime.dwLowDateTime = (DWORD)v;
+ p->filetime.dwHighDateTime = (DWORD)(v >> 32);
+}
+
+inline void PropVarEm_Set_Bool(PROPVARIANT *p, bool b) throw()
+{
+ p->vt = VT_BOOL;
+ p->boolVal = (b ? VARIANT_TRUE : VARIANT_FALSE);
+}
+
+
+class CPropVariant : public tagPROPVARIANT
+{
+public:
+ CPropVariant()
+ {
+ vt = VT_EMPTY;
+ wReserved1 = 0;
+ // wReserved2 = 0;
+ // wReserved3 = 0;
+ // uhVal.QuadPart = 0;
+ bstrVal = 0;
+ }
+ ~CPropVariant() throw() { Clear(); }
+ CPropVariant(const PROPVARIANT &varSrc);
+ CPropVariant(const CPropVariant &varSrc);
+ CPropVariant(BSTR bstrSrc);
+ CPropVariant(LPCOLESTR lpszSrc);
+ CPropVariant(bool bSrc) { vt = VT_BOOL; wReserved1 = 0; boolVal = (bSrc ? VARIANT_TRUE : VARIANT_FALSE); }
+ CPropVariant(Byte value) { vt = VT_UI1; wReserved1 = 0; bVal = value; }
+
+private:
+ CPropVariant(Int16 value); // { vt = VT_I2; wReserved1 = 0; iVal = value; }
+ CPropVariant(Int32 value); // { vt = VT_I4; wReserved1 = 0; lVal = value; }
+
+public:
+ CPropVariant(UInt32 value) { vt = VT_UI4; wReserved1 = 0; ulVal = value; }
+ CPropVariant(UInt64 value) { vt = VT_UI8; wReserved1 = 0; uhVal.QuadPart = value; }
+ CPropVariant(Int64 value) { vt = VT_I8; wReserved1 = 0; hVal.QuadPart = value; }
+ CPropVariant(const FILETIME &value) { vt = VT_FILETIME; wReserved1 = 0; filetime = value; }
+
+ CPropVariant& operator=(const CPropVariant &varSrc);
+ CPropVariant& operator=(const PROPVARIANT &varSrc);
+ CPropVariant& operator=(BSTR bstrSrc);
+ CPropVariant& operator=(LPCOLESTR lpszSrc);
+ CPropVariant& operator=(const UString &s);
+ CPropVariant& operator=(const UString2 &s);
+ CPropVariant& operator=(const char *s);
+ CPropVariant& operator=(const AString &s)
+ { return (*this)=(const char *)s; }
+
+ CPropVariant& operator=(bool bSrc) throw();
+ CPropVariant& operator=(Byte value) throw();
+
+private:
+ CPropVariant& operator=(Int16 value) throw();
+
+public:
+ CPropVariant& operator=(Int32 value) throw();
+ CPropVariant& operator=(UInt32 value) throw();
+ CPropVariant& operator=(UInt64 value) throw();
+ CPropVariant& operator=(Int64 value) throw();
+ CPropVariant& operator=(const FILETIME &value) throw();
+
+ BSTR AllocBstr(unsigned numChars);
+
+ HRESULT Clear() throw();
+ HRESULT Copy(const PROPVARIANT *pSrc) throw();
+ HRESULT Attach(PROPVARIANT *pSrc) throw();
+ HRESULT Detach(PROPVARIANT *pDest) throw();
+
+ HRESULT InternalClear() throw();
+ void InternalCopy(const PROPVARIANT *pSrc);
+
+ int Compare(const CPropVariant &a) throw();
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/PropVariantConv.cpp b/other-licenses/7zstub/src/CPP/Windows/PropVariantConv.cpp
new file mode 100644
index 0000000000..c5ac212602
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/PropVariantConv.cpp
@@ -0,0 +1,138 @@
+// PropVariantConvert.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/IntToString.h"
+
+#include "Defs.h"
+#include "PropVariantConv.h"
+
+#define UINT_TO_STR_2(c, val) { s[0] = (c); s[1] = (char)('0' + (val) / 10); s[2] = (char)('0' + (val) % 10); s += 3; }
+
+bool ConvertUtcFileTimeToString(const FILETIME &utc, char *s, int level) throw()
+{
+ *s = 0;
+ FILETIME ft;
+ if (!FileTimeToLocalFileTime(&utc, &ft))
+ return false;
+
+ SYSTEMTIME st;
+ if (!BOOLToBool(FileTimeToSystemTime(&ft, &st)))
+ return false;
+
+ {
+ unsigned val = st.wYear;
+ if (val >= 10000)
+ {
+ *s++ = (char)('0' + val / 10000);
+ val %= 10000;
+ }
+ s[3] = (char)('0' + val % 10); val /= 10;
+ s[2] = (char)('0' + val % 10); val /= 10;
+ s[1] = (char)('0' + val % 10);
+ s[0] = (char)('0' + val / 10);
+ s += 4;
+ }
+ UINT_TO_STR_2('-', st.wMonth);
+ UINT_TO_STR_2('-', st.wDay);
+
+ if (level > kTimestampPrintLevel_DAY)
+ {
+ UINT_TO_STR_2(' ', st.wHour);
+ UINT_TO_STR_2(':', st.wMinute);
+
+ if (level >= kTimestampPrintLevel_SEC)
+ {
+ UINT_TO_STR_2(':', st.wSecond);
+
+ if (level > kTimestampPrintLevel_SEC)
+ {
+ *s++ = '.';
+ /*
+ {
+ unsigned val = st.wMilliseconds;
+ s[2] = (char)('0' + val % 10); val /= 10;
+ s[1] = (char)('0' + val % 10);
+ s[0] = (char)('0' + val / 10);
+ s += 3;
+ }
+ *s++ = ' ';
+ */
+
+ {
+ unsigned numDigits = 7;
+ UInt32 val = (UInt32)((((UInt64)ft.dwHighDateTime << 32) + ft.dwLowDateTime) % 10000000);
+ for (unsigned i = numDigits; i != 0;)
+ {
+ i--;
+ s[i] = (char)('0' + val % 10); val /= 10;
+ }
+ if (numDigits > (unsigned)level)
+ numDigits = (unsigned)level;
+ s += numDigits;
+ }
+ }
+ }
+ }
+
+ *s = 0;
+ return true;
+}
+
+
+bool ConvertUtcFileTimeToString(const FILETIME &ft, wchar_t *dest, int level) throw()
+{
+ char s[32];
+ bool res = ConvertUtcFileTimeToString(ft, s, level);
+ for (unsigned i = 0;; i++)
+ {
+ unsigned char c = s[i];
+ dest[i] = c;
+ if (c == 0)
+ break;
+ }
+ return res;
+}
+
+
+void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) throw()
+{
+ *dest = 0;
+ switch (prop.vt)
+ {
+ case VT_EMPTY: return;
+ case VT_BSTR: dest[0] = '?'; dest[1] = 0; return;
+ case VT_UI1: ConvertUInt32ToString(prop.bVal, dest); return;
+ case VT_UI2: ConvertUInt32ToString(prop.uiVal, dest); return;
+ case VT_UI4: ConvertUInt32ToString(prop.ulVal, dest); return;
+ case VT_UI8: ConvertUInt64ToString(prop.uhVal.QuadPart, dest); return;
+ case VT_FILETIME: ConvertUtcFileTimeToString(prop.filetime, dest); return;
+ // case VT_I1: return ConvertInt64ToString(prop.cVal, dest); return;
+ case VT_I2: ConvertInt64ToString(prop.iVal, dest); return;
+ case VT_I4: ConvertInt64ToString(prop.lVal, dest); return;
+ case VT_I8: ConvertInt64ToString(prop.hVal.QuadPart, dest); return;
+ case VT_BOOL: dest[0] = VARIANT_BOOLToBool(prop.boolVal) ? '+' : '-'; dest[1] = 0; return;
+ default: dest[0] = '?'; dest[1] = ':'; ConvertUInt64ToString(prop.vt, dest + 2);
+ }
+}
+
+void ConvertPropVariantToShortString(const PROPVARIANT &prop, wchar_t *dest) throw()
+{
+ *dest = 0;
+ switch (prop.vt)
+ {
+ case VT_EMPTY: return;
+ case VT_BSTR: dest[0] = '?'; dest[1] = 0; return;
+ case VT_UI1: ConvertUInt32ToString(prop.bVal, dest); return;
+ case VT_UI2: ConvertUInt32ToString(prop.uiVal, dest); return;
+ case VT_UI4: ConvertUInt32ToString(prop.ulVal, dest); return;
+ case VT_UI8: ConvertUInt64ToString(prop.uhVal.QuadPart, dest); return;
+ case VT_FILETIME: ConvertUtcFileTimeToString(prop.filetime, dest); return;
+ // case VT_I1: return ConvertInt64ToString(prop.cVal, dest); return;
+ case VT_I2: ConvertInt64ToString(prop.iVal, dest); return;
+ case VT_I4: ConvertInt64ToString(prop.lVal, dest); return;
+ case VT_I8: ConvertInt64ToString(prop.hVal.QuadPart, dest); return;
+ case VT_BOOL: dest[0] = VARIANT_BOOLToBool(prop.boolVal) ? (wchar_t)'+' : (wchar_t)'-'; dest[1] = 0; return;
+ default: dest[0] = '?'; dest[1] = ':'; ConvertUInt32ToString(prop.vt, dest + 2);
+ }
+}
diff --git a/other-licenses/7zstub/src/CPP/Windows/PropVariantConv.h b/other-licenses/7zstub/src/CPP/Windows/PropVariantConv.h
new file mode 100644
index 0000000000..3e2456926e
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/PropVariantConv.h
@@ -0,0 +1,37 @@
+// Windows/PropVariantConv.h
+
+#ifndef __PROP_VARIANT_CONV_H
+#define __PROP_VARIANT_CONV_H
+
+#include "../Common/MyTypes.h"
+
+// provide at least 32 bytes for buffer including zero-end
+
+#define kTimestampPrintLevel_DAY -3
+// #define kTimestampPrintLevel_HOUR -2
+#define kTimestampPrintLevel_MIN -1
+#define kTimestampPrintLevel_SEC 0
+#define kTimestampPrintLevel_NTFS 7
+
+bool ConvertUtcFileTimeToString(const FILETIME &ft, char *s, int level = kTimestampPrintLevel_SEC) throw();
+bool ConvertUtcFileTimeToString(const FILETIME &ft, wchar_t *s, int level = kTimestampPrintLevel_SEC) throw();
+
+// provide at least 32 bytes for buffer including zero-end
+// don't send VT_BSTR to these functions
+void ConvertPropVariantToShortString(const PROPVARIANT &prop, char *dest) throw();
+void ConvertPropVariantToShortString(const PROPVARIANT &prop, wchar_t *dest) throw();
+
+inline bool ConvertPropVariantToUInt64(const PROPVARIANT &prop, UInt64 &value)
+{
+ switch (prop.vt)
+ {
+ case VT_UI8: value = (UInt64)prop.uhVal.QuadPart; return true;
+ case VT_UI4: value = prop.ulVal; return true;
+ case VT_UI2: value = prop.uiVal; return true;
+ case VT_UI1: value = prop.bVal; return true;
+ case VT_EMPTY: return false;
+ default: throw 151199;
+ }
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Registry.cpp b/other-licenses/7zstub/src/CPP/Windows/Registry.cpp
new file mode 100644
index 0000000000..0146621402
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Registry.cpp
@@ -0,0 +1,390 @@
+// Windows/Registry.cpp
+
+#include "StdAfx.h"
+
+#include <wchar.h>
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+#include "Registry.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NRegistry {
+
+#define MYASSERT(expr) // _ASSERTE(expr)
+
+LONG CKey::Create(HKEY parentKey, LPCTSTR keyName,
+ LPTSTR keyClass, DWORD options, REGSAM accessMask,
+ LPSECURITY_ATTRIBUTES securityAttributes, LPDWORD disposition) throw()
+{
+ MYASSERT(parentKey != NULL);
+ DWORD dispositionReal;
+ HKEY key = NULL;
+ LONG res = RegCreateKeyEx(parentKey, keyName, 0, keyClass,
+ options, accessMask, securityAttributes, &key, &dispositionReal);
+ if (disposition != NULL)
+ *disposition = dispositionReal;
+ if (res == ERROR_SUCCESS)
+ {
+ res = Close();
+ _object = key;
+ }
+ return res;
+}
+
+LONG CKey::Open(HKEY parentKey, LPCTSTR keyName, REGSAM accessMask) throw()
+{
+ MYASSERT(parentKey != NULL);
+ HKEY key = NULL;
+ LONG res = RegOpenKeyEx(parentKey, keyName, 0, accessMask, &key);
+ if (res == ERROR_SUCCESS)
+ {
+ res = Close();
+ MYASSERT(res == ERROR_SUCCESS);
+ _object = key;
+ }
+ return res;
+}
+
+LONG CKey::Close() throw()
+{
+ LONG res = ERROR_SUCCESS;
+ if (_object != NULL)
+ {
+ res = RegCloseKey(_object);
+ _object = NULL;
+ }
+ return res;
+}
+
+// win95, win98: deletes sunkey and all its subkeys
+// winNT to be deleted must not have subkeys
+LONG CKey::DeleteSubKey(LPCTSTR subKeyName) throw()
+{
+ MYASSERT(_object != NULL);
+ return RegDeleteKey(_object, subKeyName);
+}
+
+LONG CKey::RecurseDeleteKey(LPCTSTR subKeyName) throw()
+{
+ CKey key;
+ LONG res = key.Open(_object, subKeyName, KEY_READ | KEY_WRITE);
+ if (res != ERROR_SUCCESS)
+ return res;
+ FILETIME fileTime;
+ const UInt32 kBufSize = MAX_PATH + 1; // 256 in ATL
+ DWORD size = kBufSize;
+ TCHAR buffer[kBufSize];
+ while (RegEnumKeyEx(key._object, 0, buffer, &size, NULL, NULL, NULL, &fileTime) == ERROR_SUCCESS)
+ {
+ res = key.RecurseDeleteKey(buffer);
+ if (res != ERROR_SUCCESS)
+ return res;
+ size = kBufSize;
+ }
+ key.Close();
+ return DeleteSubKey(subKeyName);
+}
+
+
+/////////////////////////
+// Value Functions
+
+static inline UInt32 BoolToUINT32(bool value) { return (value ? 1: 0); }
+static inline bool UINT32ToBool(UInt32 value) { return (value != 0); }
+
+
+LONG CKey::DeleteValue(LPCTSTR name) throw()
+{
+ MYASSERT(_object != NULL);
+ return ::RegDeleteValue(_object, name);
+}
+
+#ifndef _UNICODE
+LONG CKey::DeleteValue(LPCWSTR name)
+{
+ MYASSERT(_object != NULL);
+ if (g_IsNT)
+ return ::RegDeleteValueW(_object, name);
+ return DeleteValue(name == 0 ? 0 : (LPCSTR)GetSystemString(name));
+}
+#endif
+
+LONG CKey::SetValue(LPCTSTR name, UInt32 value) throw()
+{
+ MYASSERT(_object != NULL);
+ return RegSetValueEx(_object, name, 0, REG_DWORD,
+ (BYTE * const)&value, sizeof(UInt32));
+}
+
+LONG CKey::SetValue(LPCTSTR name, bool value) throw()
+{
+ return SetValue(name, BoolToUINT32(value));
+}
+
+LONG CKey::SetValue(LPCTSTR name, LPCTSTR value) throw()
+{
+ MYASSERT(value != NULL);
+ MYASSERT(_object != NULL);
+ return RegSetValueEx(_object, name, 0, REG_SZ,
+ (const BYTE * )value, (lstrlen(value) + 1) * sizeof(TCHAR));
+}
+
+/*
+LONG CKey::SetValue(LPCTSTR name, const CSysString &value)
+{
+ MYASSERT(value != NULL);
+ MYASSERT(_object != NULL);
+ return RegSetValueEx(_object, name, NULL, REG_SZ,
+ (const BYTE *)(const TCHAR *)value, (value.Len() + 1) * sizeof(TCHAR));
+}
+*/
+
+#ifndef _UNICODE
+
+LONG CKey::SetValue(LPCWSTR name, LPCWSTR value)
+{
+ MYASSERT(value != NULL);
+ MYASSERT(_object != NULL);
+ if (g_IsNT)
+ return RegSetValueExW(_object, name, 0, REG_SZ,
+ (const BYTE * )value, (DWORD)((wcslen(value) + 1) * sizeof(wchar_t)));
+ return SetValue(name == 0 ? 0 : (LPCSTR)GetSystemString(name),
+ value == 0 ? 0 : (LPCSTR)GetSystemString(value));
+}
+
+#endif
+
+
+LONG CKey::SetValue(LPCTSTR name, const void *value, UInt32 size) throw()
+{
+ MYASSERT(value != NULL);
+ MYASSERT(_object != NULL);
+ return RegSetValueEx(_object, name, 0, REG_BINARY,
+ (const BYTE *)value, size);
+}
+
+LONG SetValue(HKEY parentKey, LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value)
+{
+ MYASSERT(value != NULL);
+ CKey key;
+ LONG res = key.Create(parentKey, keyName);
+ if (res == ERROR_SUCCESS)
+ res = key.SetValue(valueName, value);
+ return res;
+}
+
+LONG CKey::SetKeyValue(LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value) throw()
+{
+ MYASSERT(value != NULL);
+ CKey key;
+ LONG res = key.Create(_object, keyName);
+ if (res == ERROR_SUCCESS)
+ res = key.SetValue(valueName, value);
+ return res;
+}
+
+LONG CKey::QueryValue(LPCTSTR name, UInt32 &value) throw()
+{
+ DWORD type = 0;
+ DWORD count = sizeof(DWORD);
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type,
+ (LPBYTE)&value, &count);
+ MYASSERT((res != ERROR_SUCCESS) || (type == REG_DWORD));
+ MYASSERT((res != ERROR_SUCCESS) || (count == sizeof(UInt32)));
+ return res;
+}
+
+LONG CKey::QueryValue(LPCTSTR name, bool &value) throw()
+{
+ UInt32 uintValue = BoolToUINT32(value);
+ LONG res = QueryValue(name, uintValue);
+ value = UINT32ToBool(uintValue);
+ return res;
+}
+
+LONG CKey::GetValue_IfOk(LPCTSTR name, UInt32 &value) throw()
+{
+ UInt32 newVal;
+ LONG res = QueryValue(name, newVal);
+ if (res == ERROR_SUCCESS)
+ value = newVal;
+ return res;
+}
+
+LONG CKey::GetValue_IfOk(LPCTSTR name, bool &value) throw()
+{
+ bool newVal;
+ LONG res = QueryValue(name, newVal);
+ if (res == ERROR_SUCCESS)
+ value = newVal;
+ return res;
+}
+
+LONG CKey::QueryValue(LPCTSTR name, LPTSTR value, UInt32 &count) throw()
+{
+ DWORD type = 0;
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)value, (DWORD *)&count);
+ MYASSERT((res != ERROR_SUCCESS) || (type == REG_SZ) || (type == REG_MULTI_SZ) || (type == REG_EXPAND_SZ));
+ return res;
+}
+
+LONG CKey::QueryValue(LPCTSTR name, CSysString &value)
+{
+ value.Empty();
+ DWORD type = 0;
+ UInt32 curSize = 0;
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, NULL, (DWORD *)&curSize);
+ if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
+ return res;
+ UInt32 curSize2 = curSize;
+ res = QueryValue(name, value.GetBuf(curSize), curSize2);
+ if (curSize > curSize2)
+ curSize = curSize2;
+ value.ReleaseBuf_CalcLen(curSize / sizeof(TCHAR));
+ return res;
+}
+
+
+#ifndef _UNICODE
+
+LONG CKey::QueryValue(LPCWSTR name, LPWSTR value, UInt32 &count)
+{
+ DWORD type = 0;
+ LONG res = RegQueryValueExW(_object, name, NULL, &type, (LPBYTE)value, (DWORD *)&count);
+ MYASSERT((res != ERROR_SUCCESS) || (type == REG_SZ) || (type == REG_MULTI_SZ) || (type == REG_EXPAND_SZ));
+ return res;
+}
+
+LONG CKey::QueryValue(LPCWSTR name, UString &value)
+{
+ value.Empty();
+ DWORD type = 0;
+ UInt32 curSize = 0;
+
+ LONG res;
+
+ if (g_IsNT)
+ {
+ res = RegQueryValueExW(_object, name, NULL, &type, NULL, (DWORD *)&curSize);
+ if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
+ return res;
+ UInt32 curSize2 = curSize;
+ res = QueryValue(name, value.GetBuf(curSize), curSize2);
+ if (curSize > curSize2)
+ curSize = curSize2;
+ value.ReleaseBuf_CalcLen(curSize / sizeof(wchar_t));
+ }
+ else
+ {
+ AString vTemp;
+ res = QueryValue(name == 0 ? 0 : (LPCSTR)GetSystemString(name), vTemp);
+ value = GetUnicodeString(vTemp);
+ }
+
+ return res;
+}
+
+#endif
+
+
+LONG CKey::QueryValue(LPCTSTR name, void *value, UInt32 &count) throw()
+{
+ DWORD type = 0;
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, (LPBYTE)value, (DWORD *)&count);
+ MYASSERT((res != ERROR_SUCCESS) || (type == REG_BINARY));
+ return res;
+}
+
+
+LONG CKey::QueryValue(LPCTSTR name, CByteBuffer &value, UInt32 &dataSize)
+{
+ DWORD type = 0;
+ dataSize = 0;
+ LONG res = RegQueryValueEx(_object, (LPTSTR)name, NULL, &type, NULL, (DWORD *)&dataSize);
+ if (res != ERROR_SUCCESS && res != ERROR_MORE_DATA)
+ return res;
+ value.Alloc(dataSize);
+ return QueryValue(name, (BYTE *)value, dataSize);
+}
+
+LONG CKey::EnumKeys(CSysStringVector &keyNames)
+{
+ keyNames.Clear();
+ CSysString keyName;
+ for (DWORD index = 0; ; index++)
+ {
+ const unsigned kBufSize = MAX_PATH + 1; // 256 in ATL
+ FILETIME lastWriteTime;
+ UInt32 nameSize = kBufSize;
+ LONG result = ::RegEnumKeyEx(_object, index, keyName.GetBuf(kBufSize),
+ (DWORD *)&nameSize, NULL, NULL, NULL, &lastWriteTime);
+ keyName.ReleaseBuf_CalcLen(kBufSize);
+ if (result == ERROR_NO_MORE_ITEMS)
+ break;
+ if (result != ERROR_SUCCESS)
+ return result;
+ keyNames.Add(keyName);
+ }
+ return ERROR_SUCCESS;
+}
+
+LONG CKey::SetValue_Strings(LPCTSTR valueName, const UStringVector &strings)
+{
+ size_t numChars = 0;
+
+ unsigned i;
+
+ for (i = 0; i < strings.Size(); i++)
+ numChars += strings[i].Len() + 1;
+
+ CObjArray<wchar_t> buffer(numChars);
+ size_t pos = 0;
+
+ for (i = 0; i < strings.Size(); i++)
+ {
+ const UString &s = strings[i];
+ size_t size = s.Len() + 1;
+ wmemcpy(buffer + pos, s, size);
+ pos += size;
+ }
+ return SetValue(valueName, buffer, (UInt32)numChars * sizeof(wchar_t));
+}
+
+LONG CKey::GetValue_Strings(LPCTSTR valueName, UStringVector &strings)
+{
+ strings.Clear();
+ CByteBuffer buffer;
+ UInt32 dataSize = 0;
+ LONG res = QueryValue(valueName, buffer, dataSize);
+ if (res != ERROR_SUCCESS)
+ return res;
+ if (dataSize > buffer.Size())
+ return E_FAIL;
+ if (dataSize % sizeof(wchar_t) != 0)
+ return E_FAIL;
+
+ const wchar_t *data = (const wchar_t *)(const Byte *)buffer;
+ size_t numChars = dataSize / sizeof(wchar_t);
+ size_t prev = 0;
+ UString s;
+
+ for (size_t i = 0; i < numChars; i++)
+ {
+ if (data[i] == 0)
+ {
+ s = data + prev;
+ strings.Add(s);
+ prev = i + 1;
+ }
+ }
+
+ return res;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Registry.h b/other-licenses/7zstub/src/CPP/Windows/Registry.h
new file mode 100644
index 0000000000..0a312304b0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Registry.h
@@ -0,0 +1,84 @@
+// Windows/Registry.h
+
+#ifndef __WINDOWS_REGISTRY_H
+#define __WINDOWS_REGISTRY_H
+
+#include "../Common/MyBuffer.h"
+#include "../Common/MyString.h"
+
+namespace NWindows {
+namespace NRegistry {
+
+LONG SetValue(HKEY parentKey, LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value);
+
+class CKey
+{
+ HKEY _object;
+public:
+ CKey(): _object(NULL) {}
+ ~CKey() { Close(); }
+
+ operator HKEY() const { return _object; }
+ void Attach(HKEY key) { _object = key; }
+ HKEY Detach()
+ {
+ HKEY key = _object;
+ _object = NULL;
+ return key;
+ }
+
+ LONG Create(HKEY parentKey, LPCTSTR keyName,
+ LPTSTR keyClass = REG_NONE, DWORD options = REG_OPTION_NON_VOLATILE,
+ REGSAM accessMask = KEY_ALL_ACCESS,
+ LPSECURITY_ATTRIBUTES securityAttributes = NULL,
+ LPDWORD disposition = NULL) throw();
+ LONG Open(HKEY parentKey, LPCTSTR keyName, REGSAM accessMask = KEY_ALL_ACCESS) throw();
+
+ LONG Close() throw();
+
+ LONG DeleteSubKey(LPCTSTR subKeyName) throw();
+ LONG RecurseDeleteKey(LPCTSTR subKeyName) throw();
+
+ LONG DeleteValue(LPCTSTR name) throw();
+ #ifndef _UNICODE
+ LONG DeleteValue(LPCWSTR name);
+ #endif
+
+ LONG SetValue(LPCTSTR valueName, UInt32 value) throw();
+ LONG SetValue(LPCTSTR valueName, bool value) throw();
+ LONG SetValue(LPCTSTR valueName, LPCTSTR value) throw();
+ // LONG SetValue(LPCTSTR valueName, const CSysString &value);
+ #ifndef _UNICODE
+ LONG SetValue(LPCWSTR name, LPCWSTR value);
+ // LONG SetValue(LPCWSTR name, const UString &value);
+ #endif
+
+ LONG SetValue(LPCTSTR name, const void *value, UInt32 size) throw();
+
+ LONG SetValue_Strings(LPCTSTR valueName, const UStringVector &strings);
+ LONG GetValue_Strings(LPCTSTR valueName, UStringVector &strings);
+
+ LONG SetKeyValue(LPCTSTR keyName, LPCTSTR valueName, LPCTSTR value) throw();
+
+ LONG QueryValue(LPCTSTR name, UInt32 &value) throw();
+ LONG QueryValue(LPCTSTR name, bool &value) throw();
+ LONG QueryValue(LPCTSTR name, LPTSTR value, UInt32 &dataSize) throw();
+ LONG QueryValue(LPCTSTR name, CSysString &value);
+
+ LONG GetValue_IfOk(LPCTSTR name, UInt32 &value) throw();
+ LONG GetValue_IfOk(LPCTSTR name, bool &value) throw();
+
+ #ifndef _UNICODE
+ LONG QueryValue(LPCWSTR name, LPWSTR value, UInt32 &dataSize);
+ LONG QueryValue(LPCWSTR name, UString &value);
+ #endif
+
+ LONG QueryValue(LPCTSTR name, void *value, UInt32 &dataSize) throw();
+ LONG QueryValue(LPCTSTR name, CByteBuffer &value, UInt32 &dataSize);
+
+ LONG EnumKeys(CSysStringVector &keyNames);
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/ResourceString.cpp b/other-licenses/7zstub/src/CPP/Windows/ResourceString.cpp
new file mode 100644
index 0000000000..c28e60e07c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/ResourceString.cpp
@@ -0,0 +1,103 @@
+// Windows/ResourceString.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "ResourceString.h"
+
+extern HINSTANCE g_hInstance;
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+
+#ifndef _UNICODE
+
+static CSysString MyLoadStringA(HINSTANCE hInstance, UINT resourceID)
+{
+ CSysString s;
+ int size = 128;
+ int len;
+ do
+ {
+ size <<= 1;
+ len = ::LoadString(hInstance, resourceID, s.GetBuf(size - 1), size);
+ }
+ while (size - len <= 1);
+ s.ReleaseBuf_CalcLen(len);
+ return s;
+}
+
+#endif
+
+static const int kStartSize = 256;
+
+static void MyLoadString2(HINSTANCE hInstance, UINT resourceID, UString &s)
+{
+ int size = kStartSize;
+ int len;
+ do
+ {
+ size <<= 1;
+ len = ::LoadStringW(hInstance, resourceID, s.GetBuf(size - 1), size);
+ }
+ while (size - len <= 1);
+ s.ReleaseBuf_CalcLen(len);
+}
+
+// NT4 doesn't support LoadStringW(,,, 0) to get pointer to resource string. So we don't use it.
+
+UString MyLoadString(UINT resourceID)
+{
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ return GetUnicodeString(MyLoadStringA(g_hInstance, resourceID));
+ else
+ #endif
+ {
+ {
+ wchar_t s[kStartSize];
+ s[0] = 0;
+ int len = ::LoadStringW(g_hInstance, resourceID, s, kStartSize);
+ if (kStartSize - len > 1)
+ return s;
+ }
+ UString dest;
+ MyLoadString2(g_hInstance, resourceID, dest);
+ return dest;
+ }
+}
+
+void MyLoadString(HINSTANCE hInstance, UINT resourceID, UString &dest)
+{
+ dest.Empty();
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ MultiByteToUnicodeString2(dest, MyLoadStringA(hInstance, resourceID));
+ else
+ #endif
+ {
+ {
+ wchar_t s[kStartSize];
+ s[0] = 0;
+ int len = ::LoadStringW(hInstance, resourceID, s, kStartSize);
+ if (kStartSize - len > 1)
+ {
+ dest = s;
+ return;
+ }
+ }
+ MyLoadString2(hInstance, resourceID, dest);
+ }
+}
+
+void MyLoadString(UINT resourceID, UString &dest)
+{
+ MyLoadString(g_hInstance, resourceID, dest);
+}
+
+}
diff --git a/other-licenses/7zstub/src/CPP/Windows/ResourceString.h b/other-licenses/7zstub/src/CPP/Windows/ResourceString.h
new file mode 100644
index 0000000000..cbaef4bfb3
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/ResourceString.h
@@ -0,0 +1,16 @@
+// Windows/ResourceString.h
+
+#ifndef __WINDOWS_RESOURCE_STRING_H
+#define __WINDOWS_RESOURCE_STRING_H
+
+#include "../Common/MyString.h"
+
+namespace NWindows {
+
+UString MyLoadString(UINT resourceID);
+void MyLoadString(HINSTANCE hInstance, UINT resourceID, UString &dest);
+void MyLoadString(UINT resourceID, UString &dest);
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/SecurityUtils.cpp b/other-licenses/7zstub/src/CPP/Windows/SecurityUtils.cpp
new file mode 100644
index 0000000000..8646cc9841
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/SecurityUtils.cpp
@@ -0,0 +1,181 @@
+// Windows/SecurityUtils.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/MyString.h"
+
+#include "SecurityUtils.h"
+
+namespace NWindows {
+namespace NSecurity {
+
+/*
+bool MyLookupAccountSid(LPCTSTR systemName, PSID sid,
+ CSysString &accountName, CSysString &domainName, PSID_NAME_USE sidNameUse)
+{
+ DWORD accountNameSize = 0, domainNameSize = 0;
+
+ if (!::LookupAccountSid(systemName, sid,
+ accountName.GetBuf(0), &accountNameSize,
+ domainName.GetBuf(0), &domainNameSize, sidNameUse))
+ {
+ if (::GetLastError() != ERROR_INSUFFICIENT_BUFFER)
+ return false;
+ }
+ DWORD accountNameSize2 = accountNameSize, domainNameSize2 = domainNameSize;
+ bool result = BOOLToBool(::LookupAccountSid(systemName, sid,
+ accountName.GetBuf(accountNameSize), &accountNameSize2,
+ domainName.GetBuf(domainNameSize), &domainNameSize2, sidNameUse));
+ accountName.ReleaseBuf_CalcLen(accountNameSize);
+ domainName.ReleaseBuf_CalcLen(domainNameSize);
+ return result;
+}
+*/
+
+static void SetLsaString(LPWSTR src, PLSA_UNICODE_STRING dest)
+{
+ int len = (int)wcslen(src);
+ dest->Length = (USHORT)(len * sizeof(WCHAR));
+ dest->MaximumLength = (USHORT)((len + 1) * sizeof(WCHAR));
+ dest->Buffer = src;
+}
+
+/*
+static void MyLookupSids(CPolicy &policy, PSID ps)
+{
+ LSA_REFERENCED_DOMAIN_LIST *referencedDomains = NULL;
+ LSA_TRANSLATED_NAME *names = NULL;
+ NTSTATUS nts = policy.LookupSids(1, &ps, &referencedDomains, &names);
+ int res = LsaNtStatusToWinError(nts);
+ LsaFreeMemory(referencedDomains);
+ LsaFreeMemory(names);
+}
+*/
+
+#ifndef _UNICODE
+typedef BOOL (WINAPI * LookupAccountNameWP)(
+ LPCWSTR lpSystemName,
+ LPCWSTR lpAccountName,
+ PSID Sid,
+ LPDWORD cbSid,
+ LPWSTR ReferencedDomainName,
+ LPDWORD cchReferencedDomainName,
+ PSID_NAME_USE peUse
+ );
+#endif
+
+static PSID GetSid(LPWSTR accountName)
+{
+ #ifndef _UNICODE
+ HMODULE hModule = GetModuleHandle(TEXT("Advapi32.dll"));
+ if (hModule == NULL)
+ return NULL;
+ LookupAccountNameWP lookupAccountNameW = (LookupAccountNameWP)GetProcAddress(hModule, "LookupAccountNameW");
+ if (lookupAccountNameW == NULL)
+ return NULL;
+ #endif
+
+ DWORD sidLen = 0, domainLen = 0;
+ SID_NAME_USE sidNameUse;
+ if (!
+ #ifdef _UNICODE
+ ::LookupAccountNameW
+ #else
+ lookupAccountNameW
+ #endif
+ (NULL, accountName, NULL, &sidLen, NULL, &domainLen, &sidNameUse))
+ {
+ if (::GetLastError() == ERROR_INSUFFICIENT_BUFFER)
+ {
+ PSID pSid = ::HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sidLen);
+ LPWSTR domainName = (LPWSTR)::HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (domainLen + 1) * sizeof(WCHAR));
+ BOOL res =
+ #ifdef _UNICODE
+ ::LookupAccountNameW
+ #else
+ lookupAccountNameW
+ #endif
+ (NULL, accountName, pSid, &sidLen, domainName, &domainLen, &sidNameUse);
+ ::HeapFree(GetProcessHeap(), 0, domainName);
+ if (res)
+ return pSid;
+ }
+ }
+ return NULL;
+}
+
+#define MY__SE_LOCK_MEMORY_NAME L"SeLockMemoryPrivilege"
+
+bool AddLockMemoryPrivilege()
+{
+ CPolicy policy;
+ LSA_OBJECT_ATTRIBUTES attr;
+ attr.Length = sizeof(attr);
+ attr.RootDirectory = NULL;
+ attr.ObjectName = NULL;
+ attr.Attributes = 0;
+ attr.SecurityDescriptor = NULL;
+ attr.SecurityQualityOfService = NULL;
+ if (policy.Open(NULL, &attr,
+ // GENERIC_WRITE)
+ POLICY_ALL_ACCESS)
+ // STANDARD_RIGHTS_REQUIRED,
+ // GENERIC_READ | GENERIC_EXECUTE | POLICY_VIEW_LOCAL_INFORMATION | POLICY_LOOKUP_NAMES)
+ != 0)
+ return false;
+ LSA_UNICODE_STRING userRights;
+ wchar_t s[128] = MY__SE_LOCK_MEMORY_NAME;
+ SetLsaString(s, &userRights);
+ WCHAR userName[256 + 2];
+ DWORD size = 256;
+ if (!GetUserNameW(userName, &size))
+ return false;
+ PSID psid = GetSid(userName);
+ if (psid == NULL)
+ return false;
+ bool res = false;
+
+ /*
+ PLSA_UNICODE_STRING userRightsArray;
+ ULONG countOfRights;
+ NTSTATUS status = policy.EnumerateAccountRights(psid, &userRightsArray, &countOfRights);
+ if (status != 0)
+ return false;
+ bool finded = false;
+ for (ULONG i = 0; i < countOfRights; i++)
+ {
+ LSA_UNICODE_STRING &ur = userRightsArray[i];
+ if (ur.Length != s.Length() * sizeof(WCHAR))
+ continue;
+ if (wcsncmp(ur.Buffer, s, s.Length()) != 0)
+ continue;
+ finded = true;
+ res = true;
+ break;
+ }
+ if (!finded)
+ */
+ {
+ /*
+ LSA_ENUMERATION_INFORMATION *enums;
+ ULONG countReturned;
+ NTSTATUS status = policy.EnumerateAccountsWithUserRight(&userRights, &enums, &countReturned);
+ if (status == 0)
+ {
+ for (ULONG i = 0; i < countReturned; i++)
+ MyLookupSids(policy, enums[i].Sid);
+ if (enums)
+ ::LsaFreeMemory(enums);
+ res = true;
+ }
+ */
+ NTSTATUS status = policy.AddAccountRights(psid, &userRights);
+ if (status == 0)
+ res = true;
+ // ULONG res = LsaNtStatusToWinError(status);
+ }
+ HeapFree(GetProcessHeap(), 0, psid);
+ return res;
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/SecurityUtils.h b/other-licenses/7zstub/src/CPP/Windows/SecurityUtils.h
new file mode 100644
index 0000000000..16b6606e6c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/SecurityUtils.h
@@ -0,0 +1,167 @@
+// Windows/SecurityUtils.h
+
+#ifndef __WINDOWS_SECURITY_UTILS_H
+#define __WINDOWS_SECURITY_UTILS_H
+
+#include <NTSecAPI.h>
+
+#include "Defs.h"
+
+namespace NWindows {
+namespace NSecurity {
+
+class CAccessToken
+{
+ HANDLE _handle;
+public:
+ CAccessToken(): _handle(NULL) {};
+ ~CAccessToken() { Close(); }
+ bool Close()
+ {
+ if (_handle == NULL)
+ return true;
+ bool res = BOOLToBool(::CloseHandle(_handle));
+ if (res)
+ _handle = NULL;
+ return res;
+ }
+
+ bool OpenProcessToken(HANDLE processHandle, DWORD desiredAccess)
+ {
+ Close();
+ return BOOLToBool(::OpenProcessToken(processHandle, desiredAccess, &_handle));
+ }
+
+ /*
+ bool OpenThreadToken(HANDLE threadHandle, DWORD desiredAccess, bool openAsSelf)
+ {
+ Close();
+ return BOOLToBool(::OpenTreadToken(threadHandle, desiredAccess, BoolToBOOL(anOpenAsSelf), &_handle));
+ }
+ */
+
+ bool AdjustPrivileges(bool disableAllPrivileges, PTOKEN_PRIVILEGES newState,
+ DWORD bufferLength, PTOKEN_PRIVILEGES previousState, PDWORD returnLength)
+ { return BOOLToBool(::AdjustTokenPrivileges(_handle, BoolToBOOL(disableAllPrivileges),
+ newState, bufferLength, previousState, returnLength)); }
+
+ bool AdjustPrivileges(bool disableAllPrivileges, PTOKEN_PRIVILEGES newState)
+ { return AdjustPrivileges(disableAllPrivileges, newState, 0, NULL, NULL); }
+
+ bool AdjustPrivileges(PTOKEN_PRIVILEGES newState)
+ { return AdjustPrivileges(false, newState); }
+
+};
+
+#ifndef _UNICODE
+typedef NTSTATUS (NTAPI *LsaOpenPolicyP)(PLSA_UNICODE_STRING SystemName,
+ PLSA_OBJECT_ATTRIBUTES ObjectAttributes, ACCESS_MASK DesiredAccess, PLSA_HANDLE PolicyHandle);
+typedef NTSTATUS (NTAPI *LsaCloseP)(LSA_HANDLE ObjectHandle);
+typedef NTSTATUS (NTAPI *LsaAddAccountRightsP)(LSA_HANDLE PolicyHandle,
+ PSID AccountSid, PLSA_UNICODE_STRING UserRights, ULONG CountOfRights );
+#define MY_STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002L)
+#endif
+
+struct CPolicy
+{
+protected:
+ LSA_HANDLE _handle;
+ #ifndef _UNICODE
+ HMODULE hModule;
+ #endif
+public:
+ operator LSA_HANDLE() const { return _handle; }
+ CPolicy(): _handle(NULL)
+ {
+ #ifndef _UNICODE
+ hModule = GetModuleHandle(TEXT("Advapi32.dll"));
+ #endif
+ };
+ ~CPolicy() { Close(); }
+
+ NTSTATUS Open(PLSA_UNICODE_STRING systemName, PLSA_OBJECT_ATTRIBUTES objectAttributes,
+ ACCESS_MASK desiredAccess)
+ {
+ #ifndef _UNICODE
+ if (hModule == NULL)
+ return MY_STATUS_NOT_IMPLEMENTED;
+ LsaOpenPolicyP lsaOpenPolicy = (LsaOpenPolicyP)GetProcAddress(hModule, "LsaOpenPolicy");
+ if (lsaOpenPolicy == NULL)
+ return MY_STATUS_NOT_IMPLEMENTED;
+ #endif
+
+ Close();
+ return
+ #ifdef _UNICODE
+ ::LsaOpenPolicy
+ #else
+ lsaOpenPolicy
+ #endif
+ (systemName, objectAttributes, desiredAccess, &_handle);
+ }
+
+ NTSTATUS Close()
+ {
+ if (_handle == NULL)
+ return 0;
+
+ #ifndef _UNICODE
+ if (hModule == NULL)
+ return MY_STATUS_NOT_IMPLEMENTED;
+ LsaCloseP lsaClose = (LsaCloseP)GetProcAddress(hModule, "LsaClose");
+ if (lsaClose == NULL)
+ return MY_STATUS_NOT_IMPLEMENTED;
+ #endif
+
+ NTSTATUS res =
+ #ifdef _UNICODE
+ ::LsaClose
+ #else
+ lsaClose
+ #endif
+ (_handle);
+ _handle = NULL;
+ return res;
+ }
+
+ NTSTATUS EnumerateAccountsWithUserRight(PLSA_UNICODE_STRING userRights,
+ PLSA_ENUMERATION_INFORMATION *enumerationBuffer, PULONG countReturned)
+ { return LsaEnumerateAccountsWithUserRight(_handle, userRights, (void **)enumerationBuffer, countReturned); }
+
+ NTSTATUS EnumerateAccountRights(PSID sid, PLSA_UNICODE_STRING* userRights, PULONG countOfRights)
+ { return ::LsaEnumerateAccountRights(_handle, sid, userRights, countOfRights); }
+
+ NTSTATUS LookupSids(ULONG count, PSID* sids,
+ PLSA_REFERENCED_DOMAIN_LIST* referencedDomains, PLSA_TRANSLATED_NAME* names)
+ { return LsaLookupSids(_handle, count, sids, referencedDomains, names); }
+
+ NTSTATUS AddAccountRights(PSID accountSid, PLSA_UNICODE_STRING userRights, ULONG countOfRights)
+ {
+ #ifndef _UNICODE
+ if (hModule == NULL)
+ return MY_STATUS_NOT_IMPLEMENTED;
+ LsaAddAccountRightsP lsaAddAccountRights = (LsaAddAccountRightsP)GetProcAddress(hModule, "LsaAddAccountRights");
+ if (lsaAddAccountRights == NULL)
+ return MY_STATUS_NOT_IMPLEMENTED;
+ #endif
+
+ return
+ #ifdef _UNICODE
+ ::LsaAddAccountRights
+ #else
+ lsaAddAccountRights
+ #endif
+ (_handle, accountSid, userRights, countOfRights);
+ }
+ NTSTATUS AddAccountRights(PSID accountSid, PLSA_UNICODE_STRING userRights)
+ { return AddAccountRights(accountSid, userRights, 1); }
+
+ NTSTATUS RemoveAccountRights(PSID accountSid, bool allRights, PLSA_UNICODE_STRING userRights, ULONG countOfRights)
+ { return LsaRemoveAccountRights(_handle, accountSid, (BOOLEAN)(allRights ? TRUE : FALSE), userRights, countOfRights); }
+};
+
+bool AddLockMemoryPrivilege();
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Shell.cpp b/other-licenses/7zstub/src/CPP/Windows/Shell.cpp
new file mode 100644
index 0000000000..fde29ac7f0
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Shell.cpp
@@ -0,0 +1,340 @@
+// Windows/Shell.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/MyCom.h"
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+
+#include "COM.h"
+#include "Shell.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+namespace NShell {
+
+#ifndef UNDER_CE
+
+// SHGetMalloc is unsupported in Windows Mobile?
+
+void CItemIDList::Free()
+{
+ if (m_Object == NULL)
+ return;
+ CMyComPtr<IMalloc> shellMalloc;
+ if (::SHGetMalloc(&shellMalloc) != NOERROR)
+ throw 41099;
+ shellMalloc->Free(m_Object);
+ m_Object = NULL;
+}
+
+/*
+CItemIDList::(LPCITEMIDLIST itemIDList): m_Object(NULL)
+ { *this = itemIDList; }
+CItemIDList::(const CItemIDList& itemIDList): m_Object(NULL)
+ { *this = itemIDList; }
+
+CItemIDList& CItemIDList::operator=(LPCITEMIDLIST object)
+{
+ Free();
+ if (object != 0)
+ {
+ UINT32 size = GetSize(object);
+ m_Object = (LPITEMIDLIST)CoTaskMemAlloc(size);
+ if (m_Object != NULL)
+ MoveMemory(m_Object, object, size);
+ }
+ return *this;
+}
+
+CItemIDList& CItemIDList::operator=(const CItemIDList &object)
+{
+ Free();
+ if (object.m_Object != NULL)
+ {
+ UINT32 size = GetSize(object.m_Object);
+ m_Object = (LPITEMIDLIST)CoTaskMemAlloc(size);
+ if (m_Object != NULL)
+ MoveMemory(m_Object, object.m_Object, size);
+ }
+ return *this;
+}
+*/
+
+/////////////////////////////
+// CDrop
+
+void CDrop::Attach(HDROP object)
+{
+ Free();
+ m_Object = object;
+ m_Assigned = true;
+}
+
+void CDrop::Free()
+{
+ if (m_MustBeFinished && m_Assigned)
+ Finish();
+ m_Assigned = false;
+}
+
+UINT CDrop::QueryCountOfFiles()
+{
+ return QueryFile(0xFFFFFFFF, (LPTSTR)NULL, 0);
+}
+
+UString CDrop::QueryFileName(UINT fileIndex)
+{
+ UString fileName;
+ #ifndef _UNICODE
+ if (!g_IsNT)
+ {
+ AString fileNameA;
+ UINT bufferSize = QueryFile(fileIndex, (LPTSTR)NULL, 0);
+ const unsigned len = bufferSize + 2;
+ QueryFile(fileIndex, fileNameA.GetBuf(len), bufferSize + 1);
+ fileNameA.ReleaseBuf_CalcLen(len);
+ fileName = GetUnicodeString(fileNameA);
+ }
+ else
+ #endif
+ {
+ UINT bufferSize = QueryFile(fileIndex, (LPWSTR)NULL, 0);
+ const unsigned len = bufferSize + 2;
+ QueryFile(fileIndex, fileName.GetBuf(len), bufferSize + 1);
+ fileName.ReleaseBuf_CalcLen(len);
+ }
+ return fileName;
+}
+
+void CDrop::QueryFileNames(UStringVector &fileNames)
+{
+ UINT numFiles = QueryCountOfFiles();
+ fileNames.ClearAndReserve(numFiles);
+ for (UINT i = 0; i < numFiles; i++)
+ fileNames.AddInReserved(QueryFileName(i));
+}
+
+
+bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path)
+{
+ const unsigned len = MAX_PATH * 2;
+ bool result = BOOLToBool(::SHGetPathFromIDList(itemIDList, path.GetBuf(len)));
+ path.ReleaseBuf_CalcLen(len);
+ return result;
+}
+
+#endif
+
+#ifdef UNDER_CE
+
+bool BrowseForFolder(LPBROWSEINFO, CSysString)
+{
+ return false;
+}
+
+bool BrowseForFolder(HWND, LPCTSTR, UINT, LPCTSTR, CSysString &)
+{
+ return false;
+}
+
+bool BrowseForFolder(HWND /* owner */, LPCTSTR /* title */,
+ LPCTSTR /* initialFolder */, CSysString & /* resultPath */)
+{
+ /*
+ // SHBrowseForFolder doesn't work before CE 6.0 ?
+ if (GetProcAddress(LoadLibrary(L"ceshell.dll", L"SHBrowseForFolder") == 0)
+ MessageBoxW(0, L"no", L"", 0);
+ else
+ MessageBoxW(0, L"yes", L"", 0);
+ */
+ /*
+ UString s = "all files";
+ s += " (*.*)";
+ return MyGetOpenFileName(owner, title, initialFolder, s, resultPath, true);
+ */
+ return false;
+}
+
+#else
+
+bool BrowseForFolder(LPBROWSEINFO browseInfo, CSysString &resultPath)
+{
+ NWindows::NCOM::CComInitializer comInitializer;
+ LPITEMIDLIST itemIDList = ::SHBrowseForFolder(browseInfo);
+ if (itemIDList == NULL)
+ return false;
+ CItemIDList itemIDListHolder;
+ itemIDListHolder.Attach(itemIDList);
+ return GetPathFromIDList(itemIDList, resultPath);
+}
+
+
+int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM /* lp */, LPARAM data)
+{
+ #ifndef UNDER_CE
+ switch (uMsg)
+ {
+ case BFFM_INITIALIZED:
+ {
+ SendMessage(hwnd, BFFM_SETSELECTION, TRUE, data);
+ break;
+ }
+ /*
+ case BFFM_SELCHANGED:
+ {
+ TCHAR dir[MAX_PATH];
+ if (::SHGetPathFromIDList((LPITEMIDLIST) lp , dir))
+ SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)dir);
+ else
+ SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM)TEXT(""));
+ break;
+ }
+ */
+ default:
+ break;
+ }
+ #endif
+ return 0;
+}
+
+
+bool BrowseForFolder(HWND owner, LPCTSTR title, UINT ulFlags,
+ LPCTSTR initialFolder, CSysString &resultPath)
+{
+ CSysString displayName;
+ BROWSEINFO browseInfo;
+ browseInfo.hwndOwner = owner;
+ browseInfo.pidlRoot = NULL;
+
+ // there are Unicode/Astring problems in some WinCE SDK ?
+ /*
+ #ifdef UNDER_CE
+ browseInfo.pszDisplayName = (LPSTR)displayName.GetBuf(MAX_PATH);
+ browseInfo.lpszTitle = (LPCSTR)title;
+ #else
+ */
+ browseInfo.pszDisplayName = displayName.GetBuf(MAX_PATH);
+ browseInfo.lpszTitle = title;
+ // #endif
+ browseInfo.ulFlags = ulFlags;
+ browseInfo.lpfn = (initialFolder != NULL) ? BrowseCallbackProc : NULL;
+ browseInfo.lParam = (LPARAM)initialFolder;
+ return BrowseForFolder(&browseInfo, resultPath);
+}
+
+bool BrowseForFolder(HWND owner, LPCTSTR title,
+ LPCTSTR initialFolder, CSysString &resultPath)
+{
+ return BrowseForFolder(owner, title,
+ #ifndef UNDER_CE
+ BIF_NEWDIALOGSTYLE |
+ #endif
+ BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT, initialFolder, resultPath);
+ // BIF_STATUSTEXT; BIF_USENEWUI (Version 5.0)
+}
+
+#ifndef _UNICODE
+
+typedef BOOL (WINAPI * SHGetPathFromIDListWP)(LPCITEMIDLIST pidl, LPWSTR pszPath);
+
+bool GetPathFromIDList(LPCITEMIDLIST itemIDList, UString &path)
+{
+ path.Empty();
+ SHGetPathFromIDListWP shGetPathFromIDListW = (SHGetPathFromIDListWP)
+ ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHGetPathFromIDListW");
+ if (shGetPathFromIDListW == 0)
+ return false;
+ const unsigned len = MAX_PATH * 2;
+ bool result = BOOLToBool(shGetPathFromIDListW(itemIDList, path.GetBuf(len)));
+ path.ReleaseBuf_CalcLen(len);
+ return result;
+}
+
+typedef LPITEMIDLIST (WINAPI * SHBrowseForFolderWP)(LPBROWSEINFOW lpbi);
+
+bool BrowseForFolder(LPBROWSEINFOW browseInfo, UString &resultPath)
+{
+ NWindows::NCOM::CComInitializer comInitializer;
+ SHBrowseForFolderWP shBrowseForFolderW = (SHBrowseForFolderWP)
+ ::GetProcAddress(::GetModuleHandleW(L"shell32.dll"), "SHBrowseForFolderW");
+ if (shBrowseForFolderW == 0)
+ return false;
+ LPITEMIDLIST itemIDList = shBrowseForFolderW(browseInfo);
+ if (itemIDList == NULL)
+ return false;
+ CItemIDList itemIDListHolder;
+ itemIDListHolder.Attach(itemIDList);
+ return GetPathFromIDList(itemIDList, resultPath);
+}
+
+
+int CALLBACK BrowseCallbackProc2(HWND hwnd, UINT uMsg, LPARAM /* lp */, LPARAM data)
+{
+ switch (uMsg)
+ {
+ case BFFM_INITIALIZED:
+ {
+ SendMessageW(hwnd, BFFM_SETSELECTIONW, TRUE, data);
+ break;
+ }
+ /*
+ case BFFM_SELCHANGED:
+ {
+ wchar_t dir[MAX_PATH * 2];
+
+ if (shGetPathFromIDListW((LPITEMIDLIST)lp , dir))
+ SendMessageW(hwnd, BFFM_SETSTATUSTEXTW, 0, (LPARAM)dir);
+ else
+ SendMessageW(hwnd, BFFM_SETSTATUSTEXTW, 0, (LPARAM)L"");
+ break;
+ }
+ */
+ default:
+ break;
+ }
+ return 0;
+}
+
+
+static bool BrowseForFolder(HWND owner, LPCWSTR title, UINT ulFlags,
+ LPCWSTR initialFolder, UString &resultPath)
+{
+ UString displayName;
+ BROWSEINFOW browseInfo;
+ browseInfo.hwndOwner = owner;
+ browseInfo.pidlRoot = NULL;
+ browseInfo.pszDisplayName = displayName.GetBuf(MAX_PATH);
+ browseInfo.lpszTitle = title;
+ browseInfo.ulFlags = ulFlags;
+ browseInfo.lpfn = (initialFolder != NULL) ? BrowseCallbackProc2 : NULL;
+ browseInfo.lParam = (LPARAM)initialFolder;
+ return BrowseForFolder(&browseInfo, resultPath);
+}
+
+bool BrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR initialFolder, UString &resultPath)
+{
+ if (g_IsNT)
+ return BrowseForFolder(owner, title,
+ BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS
+ // | BIF_STATUSTEXT // This flag is not supported when BIF_NEWDIALOGSTYLE is specified.
+ , initialFolder, resultPath);
+ // BIF_STATUSTEXT; BIF_USENEWUI (Version 5.0)
+ CSysString s;
+ bool res = BrowseForFolder(owner, GetSystemString(title),
+ BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS
+ // | BIF_STATUSTEXT // This flag is not supported when BIF_NEWDIALOGSTYLE is specified.
+ , GetSystemString(initialFolder), s);
+ resultPath = GetUnicodeString(s);
+ return res;
+}
+
+#endif
+
+#endif
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Shell.h b/other-licenses/7zstub/src/CPP/Windows/Shell.h
new file mode 100644
index 0000000000..9068040980
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Shell.h
@@ -0,0 +1,94 @@
+// Windows/Shell.h
+
+#ifndef __WINDOWS_SHELL_H
+#define __WINDOWS_SHELL_H
+
+#include <windows.h>
+#include <shlobj.h>
+
+#include "../Common/MyString.h"
+
+#include "Defs.h"
+
+namespace NWindows{
+namespace NShell{
+
+/////////////////////////
+// CItemIDList
+#ifndef UNDER_CE
+
+class CItemIDList
+{
+ LPITEMIDLIST m_Object;
+public:
+ CItemIDList(): m_Object(NULL) {}
+ // CItemIDList(LPCITEMIDLIST itemIDList);
+ // CItemIDList(const CItemIDList& itemIDList);
+ ~CItemIDList() { Free(); }
+ void Free();
+ void Attach(LPITEMIDLIST object)
+ {
+ Free();
+ m_Object = object;
+ }
+ LPITEMIDLIST Detach()
+ {
+ LPITEMIDLIST object = m_Object;
+ m_Object = NULL;
+ return object;
+ }
+ operator LPITEMIDLIST() { return m_Object;}
+ operator LPCITEMIDLIST() const { return m_Object;}
+ LPITEMIDLIST* operator&() { return &m_Object; }
+ LPITEMIDLIST operator->() { return m_Object; }
+
+ // CItemIDList& operator=(LPCITEMIDLIST object);
+ // CItemIDList& operator=(const CItemIDList &object);
+};
+
+/////////////////////////////
+// CDrop
+
+class CDrop
+{
+ HDROP m_Object;
+ bool m_MustBeFinished;
+ bool m_Assigned;
+ void Free();
+public:
+ CDrop(bool mustBeFinished) : m_MustBeFinished(mustBeFinished), m_Assigned(false) {}
+ ~CDrop() { Free(); }
+
+ void Attach(HDROP object);
+ operator HDROP() { return m_Object;}
+ bool QueryPoint(LPPOINT point)
+ { return BOOLToBool(::DragQueryPoint(m_Object, point)); }
+ void Finish() { ::DragFinish(m_Object); }
+ UINT QueryFile(UINT fileIndex, LPTSTR fileName, UINT fileNameSize)
+ { return ::DragQueryFile(m_Object, fileIndex, fileName, fileNameSize); }
+ #ifndef _UNICODE
+ UINT QueryFile(UINT fileIndex, LPWSTR fileName, UINT fileNameSize)
+ { return ::DragQueryFileW(m_Object, fileIndex, fileName, fileNameSize); }
+ #endif
+ UINT QueryCountOfFiles();
+ UString QueryFileName(UINT fileIndex);
+ void QueryFileNames(UStringVector &fileNames);
+};
+
+#endif
+
+/////////////////////////////
+// Functions
+
+bool GetPathFromIDList(LPCITEMIDLIST itemIDList, CSysString &path);
+bool BrowseForFolder(LPBROWSEINFO lpbi, CSysString &resultPath);
+bool BrowseForFolder(HWND owner, LPCTSTR title, LPCTSTR initialFolder, CSysString &resultPath);
+
+#ifndef _UNICODE
+bool GetPathFromIDList(LPCITEMIDLIST itemIDList, UString &path);
+bool BrowseForFolder(LPBROWSEINFO lpbi, UString &resultPath);
+bool BrowseForFolder(HWND owner, LPCWSTR title, LPCWSTR initialFolder, UString &resultPath);
+#endif
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/StdAfx.h b/other-licenses/7zstub/src/CPP/Windows/StdAfx.h
new file mode 100644
index 0000000000..47a4895278
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/StdAfx.h
@@ -0,0 +1,8 @@
+// StdAfx.h
+
+#ifndef __STDAFX_H
+#define __STDAFX_H
+
+#include "../Common/Common.h"
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Synchronization.cpp b/other-licenses/7zstub/src/CPP/Windows/Synchronization.cpp
new file mode 100644
index 0000000000..01f1ad90f6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Synchronization.cpp
@@ -0,0 +1,10 @@
+// Windows/Synchronization.cpp
+
+#include "StdAfx.h"
+
+#include "Synchronization.h"
+
+namespace NWindows {
+namespace NSynchronization {
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Synchronization.h b/other-licenses/7zstub/src/CPP/Windows/Synchronization.h
new file mode 100644
index 0000000000..786da00c6f
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Synchronization.h
@@ -0,0 +1,164 @@
+// Windows/Synchronization.h
+
+#ifndef __WINDOWS_SYNCHRONIZATION_H
+#define __WINDOWS_SYNCHRONIZATION_H
+
+#include "../../C/Threads.h"
+
+#include "Defs.h"
+
+#ifdef _WIN32
+#include "Handle.h"
+#endif
+
+namespace NWindows {
+namespace NSynchronization {
+
+class CBaseEvent
+{
+protected:
+ ::CEvent _object;
+public:
+ bool IsCreated() { return Event_IsCreated(&_object) != 0; }
+ operator HANDLE() { return _object; }
+ CBaseEvent() { Event_Construct(&_object); }
+ ~CBaseEvent() { Close(); }
+ WRes Close() { return Event_Close(&_object); }
+ #ifdef _WIN32
+ WRes Create(bool manualReset, bool initiallyOwn, LPCTSTR name = NULL, LPSECURITY_ATTRIBUTES sa = NULL)
+ {
+ _object = ::CreateEvent(sa, BoolToBOOL(manualReset), BoolToBOOL(initiallyOwn), name);
+ if (name == NULL && _object != 0)
+ return 0;
+ return ::GetLastError();
+ }
+ WRes Open(DWORD desiredAccess, bool inheritHandle, LPCTSTR name)
+ {
+ _object = ::OpenEvent(desiredAccess, BoolToBOOL(inheritHandle), name);
+ if (_object != 0)
+ return 0;
+ return ::GetLastError();
+ }
+ #endif
+
+ WRes Set() { return Event_Set(&_object); }
+ // bool Pulse() { return BOOLToBool(::PulseEvent(_handle)); }
+ WRes Reset() { return Event_Reset(&_object); }
+ WRes Lock() { return Event_Wait(&_object); }
+};
+
+class CManualResetEvent: public CBaseEvent
+{
+public:
+ WRes Create(bool initiallyOwn = false)
+ {
+ return ManualResetEvent_Create(&_object, initiallyOwn ? 1: 0);
+ }
+ WRes CreateIfNotCreated()
+ {
+ if (IsCreated())
+ return 0;
+ return ManualResetEvent_CreateNotSignaled(&_object);
+ }
+ #ifdef _WIN32
+ WRes CreateWithName(bool initiallyOwn, LPCTSTR name)
+ {
+ return CBaseEvent::Create(true, initiallyOwn, name);
+ }
+ #endif
+};
+
+class CAutoResetEvent: public CBaseEvent
+{
+public:
+ WRes Create()
+ {
+ return AutoResetEvent_CreateNotSignaled(&_object);
+ }
+ WRes CreateIfNotCreated()
+ {
+ if (IsCreated())
+ return 0;
+ return AutoResetEvent_CreateNotSignaled(&_object);
+ }
+};
+
+#ifdef _WIN32
+class CObject: public CHandle
+{
+public:
+ WRes Lock(DWORD timeoutInterval = INFINITE)
+ { return (::WaitForSingleObject(_handle, timeoutInterval) == WAIT_OBJECT_0 ? 0 : ::GetLastError()); }
+};
+class CMutex: public CObject
+{
+public:
+ WRes Create(bool initiallyOwn, LPCTSTR name = NULL, LPSECURITY_ATTRIBUTES sa = NULL)
+ {
+ _handle = ::CreateMutex(sa, BoolToBOOL(initiallyOwn), name);
+ if (name == NULL && _handle != 0)
+ return 0;
+ return ::GetLastError();
+ }
+ #ifndef UNDER_CE
+ WRes Open(DWORD desiredAccess, bool inheritHandle, LPCTSTR name)
+ {
+ _handle = ::OpenMutex(desiredAccess, BoolToBOOL(inheritHandle), name);
+ if (_handle != 0)
+ return 0;
+ return ::GetLastError();
+ }
+ #endif
+ WRes Release()
+ {
+ return ::ReleaseMutex(_handle) ? 0 : ::GetLastError();
+ }
+};
+class CMutexLock
+{
+ CMutex *_object;
+public:
+ CMutexLock(CMutex &object): _object(&object) { _object->Lock(); }
+ ~CMutexLock() { _object->Release(); }
+};
+#endif
+
+class CSemaphore
+{
+ ::CSemaphore _object;
+public:
+ CSemaphore() { Semaphore_Construct(&_object); }
+ ~CSemaphore() { Close(); }
+ WRes Close() { return Semaphore_Close(&_object); }
+ operator HANDLE() { return _object; }
+ WRes Create(UInt32 initiallyCount, UInt32 maxCount)
+ {
+ return Semaphore_Create(&_object, initiallyCount, maxCount);
+ }
+ WRes Release() { return Semaphore_Release1(&_object); }
+ WRes Release(UInt32 releaseCount) { return Semaphore_ReleaseN(&_object, releaseCount); }
+ WRes Lock() { return Semaphore_Wait(&_object); }
+};
+
+class CCriticalSection
+{
+ ::CCriticalSection _object;
+public:
+ CCriticalSection() { CriticalSection_Init(&_object); }
+ ~CCriticalSection() { CriticalSection_Delete(&_object); }
+ void Enter() { CriticalSection_Enter(&_object); }
+ void Leave() { CriticalSection_Leave(&_object); }
+};
+
+class CCriticalSectionLock
+{
+ CCriticalSection *_object;
+ void Unlock() { _object->Leave(); }
+public:
+ CCriticalSectionLock(CCriticalSection &object): _object(&object) {_object->Enter(); }
+ ~CCriticalSectionLock() { Unlock(); }
+};
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/System.cpp b/other-licenses/7zstub/src/CPP/Windows/System.cpp
new file mode 100644
index 0000000000..c6f8275889
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/System.cpp
@@ -0,0 +1,142 @@
+// Windows/System.cpp
+
+#include "StdAfx.h"
+
+#include "../Common/MyWindows.h"
+
+#include "../Common/Defs.h"
+
+#include "System.h"
+
+namespace NWindows {
+namespace NSystem {
+
+UInt32 CountAffinity(DWORD_PTR mask)
+{
+ UInt32 num = 0;
+ for (unsigned i = 0; i < sizeof(mask) * 8; i++)
+ num += (UInt32)((mask >> i) & 1);
+ return num;
+}
+
+#ifdef _WIN32
+
+BOOL CProcessAffinity::Get()
+{
+ #ifndef UNDER_CE
+ return GetProcessAffinityMask(GetCurrentProcess(), &processAffinityMask, &systemAffinityMask);
+ #else
+ return FALSE;
+ #endif
+}
+
+
+UInt32 GetNumberOfProcessors()
+{
+ // We need to know how many threads we can use.
+ // By default the process is assigned to one group.
+ // So we get the number of logical processors (threads)
+ // assigned to current process in the current group.
+ // Group size can be smaller than total number logical processors, for exammple, 2x36
+
+ CProcessAffinity pa;
+
+ if (pa.Get() && pa.processAffinityMask != 0)
+ return pa.GetNumProcessThreads();
+
+ SYSTEM_INFO systemInfo;
+ GetSystemInfo(&systemInfo);
+ // the number of logical processors in the current group
+ return (UInt32)systemInfo.dwNumberOfProcessors;
+}
+
+#else
+
+UInt32 GetNumberOfProcessors()
+{
+ return 1;
+}
+
+#endif
+
+
+#ifdef _WIN32
+
+#ifndef UNDER_CE
+
+#if !defined(_WIN64) && defined(__GNUC__)
+
+typedef struct _MY_MEMORYSTATUSEX {
+ DWORD dwLength;
+ DWORD dwMemoryLoad;
+ DWORDLONG ullTotalPhys;
+ DWORDLONG ullAvailPhys;
+ DWORDLONG ullTotalPageFile;
+ DWORDLONG ullAvailPageFile;
+ DWORDLONG ullTotalVirtual;
+ DWORDLONG ullAvailVirtual;
+ DWORDLONG ullAvailExtendedVirtual;
+} MY_MEMORYSTATUSEX, *MY_LPMEMORYSTATUSEX;
+
+#else
+
+#define MY_MEMORYSTATUSEX MEMORYSTATUSEX
+#define MY_LPMEMORYSTATUSEX LPMEMORYSTATUSEX
+
+#endif
+
+typedef BOOL (WINAPI *GlobalMemoryStatusExP)(MY_LPMEMORYSTATUSEX lpBuffer);
+
+#endif
+
+#endif
+
+
+bool GetRamSize(UInt64 &size)
+{
+ size = (UInt64)(sizeof(size_t)) << 29;
+
+ #ifdef _WIN32
+
+ #ifndef UNDER_CE
+ MY_MEMORYSTATUSEX stat;
+ stat.dwLength = sizeof(stat);
+ #endif
+
+ #ifdef _WIN64
+
+ if (!::GlobalMemoryStatusEx(&stat))
+ return false;
+ size = MyMin(stat.ullTotalVirtual, stat.ullTotalPhys);
+ return true;
+
+ #else
+
+ #ifndef UNDER_CE
+ GlobalMemoryStatusExP globalMemoryStatusEx = (GlobalMemoryStatusExP)
+ ::GetProcAddress(::GetModuleHandle(TEXT("kernel32.dll")), "GlobalMemoryStatusEx");
+ if (globalMemoryStatusEx && globalMemoryStatusEx(&stat))
+ {
+ size = MyMin(stat.ullTotalVirtual, stat.ullTotalPhys);
+ return true;
+ }
+ #endif
+
+ {
+ MEMORYSTATUS stat2;
+ stat2.dwLength = sizeof(stat2);
+ ::GlobalMemoryStatus(&stat2);
+ size = MyMin(stat2.dwTotalVirtual, stat2.dwTotalPhys);
+ return true;
+ }
+
+ #endif
+
+ #else
+
+ return false;
+
+ #endif
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/System.h b/other-licenses/7zstub/src/CPP/Windows/System.h
new file mode 100644
index 0000000000..bc28f47802
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/System.h
@@ -0,0 +1,40 @@
+// Windows/System.h
+
+#ifndef __WINDOWS_SYSTEM_H
+#define __WINDOWS_SYSTEM_H
+
+#include "../Common/MyTypes.h"
+
+namespace NWindows {
+namespace NSystem {
+
+UInt32 CountAffinity(DWORD_PTR mask);
+
+struct CProcessAffinity
+{
+ // UInt32 numProcessThreads;
+ // UInt32 numSysThreads;
+ DWORD_PTR processAffinityMask;
+ DWORD_PTR systemAffinityMask;
+
+ void InitST()
+ {
+ // numProcessThreads = 1;
+ // numSysThreads = 1;
+ processAffinityMask = 1;
+ systemAffinityMask = 1;
+ }
+
+ UInt32 GetNumProcessThreads() const { return CountAffinity(processAffinityMask); }
+ UInt32 GetNumSystemThreads() const { return CountAffinity(systemAffinityMask); }
+
+ BOOL Get();
+};
+
+UInt32 GetNumberOfProcessors();
+
+bool GetRamSize(UInt64 &size); // returns false, if unknown ram size
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Thread.h b/other-licenses/7zstub/src/CPP/Windows/Thread.h
new file mode 100644
index 0000000000..1b5863ce4c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Thread.h
@@ -0,0 +1,38 @@
+// Windows/Thread.h
+
+#ifndef __WINDOWS_THREAD_H
+#define __WINDOWS_THREAD_H
+
+#include "../../C/Threads.h"
+
+#include "Defs.h"
+
+namespace NWindows {
+
+class CThread
+{
+ ::CThread thread;
+public:
+ CThread() { Thread_Construct(&thread); }
+ ~CThread() { Close(); }
+ bool IsCreated() { return Thread_WasCreated(&thread) != 0; }
+ WRes Close() { return Thread_Close(&thread); }
+ WRes Create(THREAD_FUNC_RET_TYPE (THREAD_FUNC_CALL_TYPE *startAddress)(void *), LPVOID parameter)
+ { return Thread_Create(&thread, startAddress, parameter); }
+ WRes Wait() { return Thread_Wait(&thread); }
+
+ #ifdef _WIN32
+ operator HANDLE() { return thread; }
+ void Attach(HANDLE handle) { thread = handle; }
+ HANDLE Detach() { HANDLE h = thread; thread = NULL; return h; }
+ DWORD Resume() { return ::ResumeThread(thread); }
+ DWORD Suspend() { return ::SuspendThread(thread); }
+ bool Terminate(DWORD exitCode) { return BOOLToBool(::TerminateThread(thread, exitCode)); }
+ int GetPriority() { return ::GetThreadPriority(thread); }
+ bool SetPriority(int priority) { return BOOLToBool(::SetThreadPriority(thread, priority)); }
+ #endif
+};
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/TimeUtils.cpp b/other-licenses/7zstub/src/CPP/Windows/TimeUtils.cpp
new file mode 100644
index 0000000000..3fc02bc868
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/TimeUtils.cpp
@@ -0,0 +1,213 @@
+// Windows/TimeUtils.cpp
+
+#include "StdAfx.h"
+
+#include "Defs.h"
+#include "TimeUtils.h"
+
+namespace NWindows {
+namespace NTime {
+
+static const UInt32 kNumTimeQuantumsInSecond = 10000000;
+static const UInt32 kFileTimeStartYear = 1601;
+static const UInt32 kDosTimeStartYear = 1980;
+static const UInt32 kUnixTimeStartYear = 1970;
+static const UInt64 kUnixTimeOffset =
+ (UInt64)60 * 60 * 24 * (89 + 365 * (kUnixTimeStartYear - kFileTimeStartYear));
+static const UInt64 kNumSecondsInFileTime = (UInt64)(Int64)-1 / kNumTimeQuantumsInSecond;
+
+bool DosTimeToFileTime(UInt32 dosTime, FILETIME &ft) throw()
+{
+ #if defined(_WIN32) && !defined(UNDER_CE)
+ return BOOLToBool(::DosDateTimeToFileTime((UInt16)(dosTime >> 16), (UInt16)(dosTime & 0xFFFF), &ft));
+ #else
+ ft.dwLowDateTime = 0;
+ ft.dwHighDateTime = 0;
+ UInt64 res;
+ if (!GetSecondsSince1601(kDosTimeStartYear + (dosTime >> 25), (dosTime >> 21) & 0xF, (dosTime >> 16) & 0x1F,
+ (dosTime >> 11) & 0x1F, (dosTime >> 5) & 0x3F, (dosTime & 0x1F) * 2, res))
+ return false;
+ res *= kNumTimeQuantumsInSecond;
+ ft.dwLowDateTime = (UInt32)res;
+ ft.dwHighDateTime = (UInt32)(res >> 32);
+ return true;
+ #endif
+}
+
+static const UInt32 kHighDosTime = 0xFF9FBF7D;
+static const UInt32 kLowDosTime = 0x210000;
+
+#define PERIOD_4 (4 * 365 + 1)
+#define PERIOD_100 (PERIOD_4 * 25 - 1)
+#define PERIOD_400 (PERIOD_100 * 4 + 1)
+
+bool FileTimeToDosTime(const FILETIME &ft, UInt32 &dosTime) throw()
+{
+ #if defined(_WIN32) && !defined(UNDER_CE)
+
+ WORD datePart, timePart;
+ if (!::FileTimeToDosDateTime(&ft, &datePart, &timePart))
+ {
+ dosTime = (ft.dwHighDateTime >= 0x01C00000) ? kHighDosTime : kLowDosTime;
+ return false;
+ }
+ dosTime = (((UInt32)datePart) << 16) + timePart;
+
+ #else
+
+ unsigned year, mon, day, hour, min, sec;
+ UInt64 v64 = ft.dwLowDateTime | ((UInt64)ft.dwHighDateTime << 32);
+ Byte ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+ unsigned temp;
+ UInt32 v;
+ v64 += (kNumTimeQuantumsInSecond * 2 - 1);
+ v64 /= kNumTimeQuantumsInSecond;
+ sec = (unsigned)(v64 % 60);
+ v64 /= 60;
+ min = (unsigned)(v64 % 60);
+ v64 /= 60;
+ hour = (unsigned)(v64 % 24);
+ v64 /= 24;
+
+ v = (UInt32)v64;
+
+ year = (unsigned)(kFileTimeStartYear + v / PERIOD_400 * 400);
+ v %= PERIOD_400;
+
+ temp = (unsigned)(v / PERIOD_100);
+ if (temp == 4)
+ temp = 3;
+ year += temp * 100;
+ v -= temp * PERIOD_100;
+
+ temp = v / PERIOD_4;
+ if (temp == 25)
+ temp = 24;
+ year += temp * 4;
+ v -= temp * PERIOD_4;
+
+ temp = v / 365;
+ if (temp == 4)
+ temp = 3;
+ year += temp;
+ v -= temp * 365;
+
+ if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
+ ms[1] = 29;
+ for (mon = 1; mon <= 12; mon++)
+ {
+ unsigned s = ms[mon - 1];
+ if (v < s)
+ break;
+ v -= s;
+ }
+ day = (unsigned)v + 1;
+
+ dosTime = kLowDosTime;
+ if (year < kDosTimeStartYear)
+ return false;
+ year -= kDosTimeStartYear;
+ dosTime = kHighDosTime;
+ if (year >= 128)
+ return false;
+ dosTime = (year << 25) | (mon << 21) | (day << 16) | (hour << 11) | (min << 5) | (sec >> 1);
+ #endif
+ return true;
+}
+
+UInt64 UnixTimeToFileTime64(UInt32 unixTime) throw()
+{
+ return (kUnixTimeOffset + (UInt64)unixTime) * kNumTimeQuantumsInSecond;
+}
+
+void UnixTimeToFileTime(UInt32 unixTime, FILETIME &ft) throw()
+{
+ UInt64 v = UnixTimeToFileTime64(unixTime);
+ ft.dwLowDateTime = (DWORD)v;
+ ft.dwHighDateTime = (DWORD)(v >> 32);
+}
+
+UInt64 UnixTime64ToFileTime64(Int64 unixTime) throw()
+{
+ return (UInt64)(kUnixTimeOffset + unixTime) * kNumTimeQuantumsInSecond;
+}
+
+bool UnixTime64ToFileTime(Int64 unixTime, FILETIME &ft) throw()
+{
+ if (unixTime > (Int64)(kNumSecondsInFileTime - kUnixTimeOffset))
+ {
+ ft.dwLowDateTime = ft.dwHighDateTime = (UInt32)(Int32)-1;
+ return false;
+ }
+ Int64 v = (Int64)kUnixTimeOffset + unixTime;
+ if (v < 0)
+ {
+ ft.dwLowDateTime = ft.dwHighDateTime = 0;
+ return false;
+ }
+ UInt64 v2 = (UInt64)v * kNumTimeQuantumsInSecond;
+ ft.dwLowDateTime = (DWORD)v2;
+ ft.dwHighDateTime = (DWORD)(v2 >> 32);
+ return true;
+}
+
+Int64 FileTimeToUnixTime64(const FILETIME &ft) throw()
+{
+ UInt64 winTime = (((UInt64)ft.dwHighDateTime) << 32) + ft.dwLowDateTime;
+ return (Int64)(winTime / kNumTimeQuantumsInSecond) - (Int64)kUnixTimeOffset;
+}
+
+bool FileTimeToUnixTime(const FILETIME &ft, UInt32 &unixTime) throw()
+{
+ UInt64 winTime = (((UInt64)ft.dwHighDateTime) << 32) + ft.dwLowDateTime;
+ winTime /= kNumTimeQuantumsInSecond;
+ if (winTime < kUnixTimeOffset)
+ {
+ unixTime = 0;
+ return false;
+ }
+ winTime -= kUnixTimeOffset;
+ if (winTime > 0xFFFFFFFF)
+ {
+ unixTime = 0xFFFFFFFF;
+ return false;
+ }
+ unixTime = (UInt32)winTime;
+ return true;
+}
+
+bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day,
+ unsigned hour, unsigned min, unsigned sec, UInt64 &resSeconds) throw()
+{
+ resSeconds = 0;
+ if (year < kFileTimeStartYear || year >= 10000 || month < 1 || month > 12 ||
+ day < 1 || day > 31 || hour > 23 || min > 59 || sec > 59)
+ return false;
+ UInt32 numYears = year - kFileTimeStartYear;
+ UInt32 numDays = numYears * 365 + numYears / 4 - numYears / 100 + numYears / 400;
+ Byte ms[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+ if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
+ ms[1] = 29;
+ month--;
+ for (unsigned i = 0; i < month; i++)
+ numDays += ms[i];
+ numDays += day - 1;
+ resSeconds = ((UInt64)(numDays * 24 + hour) * 60 + min) * 60 + sec;
+ return true;
+}
+
+void GetCurUtcFileTime(FILETIME &ft) throw()
+{
+ // Both variants provide same low resolution on WinXP: about 15 ms.
+ // But GetSystemTimeAsFileTime is much faster.
+
+ #ifdef UNDER_CE
+ SYSTEMTIME st;
+ GetSystemTime(&st);
+ SystemTimeToFileTime(&st, &ft);
+ #else
+ GetSystemTimeAsFileTime(&ft);
+ #endif
+}
+
+}}
diff --git a/other-licenses/7zstub/src/CPP/Windows/TimeUtils.h b/other-licenses/7zstub/src/CPP/Windows/TimeUtils.h
new file mode 100644
index 0000000000..b0092f8702
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/TimeUtils.h
@@ -0,0 +1,32 @@
+// Windows/TimeUtils.h
+
+#ifndef __WINDOWS_TIME_UTILS_H
+#define __WINDOWS_TIME_UTILS_H
+
+#include "../Common/MyTypes.h"
+#include "../Common/MyWindows.h"
+
+namespace NWindows {
+namespace NTime {
+
+bool DosTimeToFileTime(UInt32 dosTime, FILETIME &fileTime) throw();
+bool FileTimeToDosTime(const FILETIME &fileTime, UInt32 &dosTime) throw();
+
+// UInt32 Unix Time : for dates 1970-2106
+UInt64 UnixTimeToFileTime64(UInt32 unixTime) throw();
+void UnixTimeToFileTime(UInt32 unixTime, FILETIME &fileTime) throw();
+
+// Int64 Unix Time : negative values for dates before 1970
+UInt64 UnixTime64ToFileTime64(Int64 unixTime) throw();
+bool UnixTime64ToFileTime(Int64 unixTime, FILETIME &fileTime) throw();
+
+bool FileTimeToUnixTime(const FILETIME &fileTime, UInt32 &unixTime) throw();
+Int64 FileTimeToUnixTime64(const FILETIME &ft) throw();
+
+bool GetSecondsSince1601(unsigned year, unsigned month, unsigned day,
+ unsigned hour, unsigned min, unsigned sec, UInt64 &resSeconds) throw();
+void GetCurUtcFileTime(FILETIME &ft) throw();
+
+}}
+
+#endif
diff --git a/other-licenses/7zstub/src/CPP/Windows/Window.cpp b/other-licenses/7zstub/src/CPP/Windows/Window.cpp
new file mode 100644
index 0000000000..0c7422240c
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Window.cpp
@@ -0,0 +1,179 @@
+// Windows/Window.cpp
+
+#include "StdAfx.h"
+
+#ifndef _UNICODE
+#include "../Common/StringConvert.h"
+#endif
+#include "Window.h"
+
+#ifndef _UNICODE
+extern bool g_IsNT;
+#endif
+
+namespace NWindows {
+
+#ifndef _UNICODE
+ATOM MyRegisterClass(CONST WNDCLASSW *wndClass)
+{
+ if (g_IsNT)
+ return RegisterClassW(wndClass);
+ WNDCLASSA wndClassA;
+ wndClassA.style = wndClass->style;
+ wndClassA.lpfnWndProc = wndClass->lpfnWndProc;
+ wndClassA.cbClsExtra = wndClass->cbClsExtra;
+ wndClassA.cbWndExtra = wndClass->cbWndExtra;
+ wndClassA.hInstance = wndClass->hInstance;
+ wndClassA.hIcon = wndClass->hIcon;
+ wndClassA.hCursor = wndClass->hCursor;
+ wndClassA.hbrBackground = wndClass->hbrBackground;
+ AString menuName;
+ AString className;
+ if (IS_INTRESOURCE(wndClass->lpszMenuName))
+ wndClassA.lpszMenuName = (LPCSTR)wndClass->lpszMenuName;
+ else
+ {
+ menuName = GetSystemString(wndClass->lpszMenuName);
+ wndClassA.lpszMenuName = menuName;
+ }
+ if (IS_INTRESOURCE(wndClass->lpszClassName))
+ wndClassA.lpszClassName = (LPCSTR)wndClass->lpszClassName;
+ else
+ {
+ className = GetSystemString(wndClass->lpszClassName);
+ wndClassA.lpszClassName = className;
+ }
+ return RegisterClassA(&wndClassA);
+}
+
+bool CWindow::Create(LPCWSTR className,
+ LPCWSTR windowName, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam)
+{
+ if (g_IsNT)
+ {
+ _window = ::CreateWindowW(className, windowName,
+ style, x, y, width, height, parentWindow,
+ idOrHMenu, instance, createParam);
+ return (_window != NULL);
+ }
+ return Create(GetSystemString(className), GetSystemString(windowName),
+ style, x, y, width, height, parentWindow,
+ idOrHMenu, instance, createParam);
+}
+
+bool CWindow::CreateEx(DWORD exStyle, LPCWSTR className,
+ LPCWSTR windowName, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam)
+{
+ if (g_IsNT)
+ {
+ _window = ::CreateWindowExW(exStyle, className, windowName,
+ style, x, y, width, height, parentWindow,
+ idOrHMenu, instance, createParam);
+ return (_window != NULL);
+ }
+ AString classNameA;
+ LPCSTR classNameP;
+ if (IS_INTRESOURCE(className))
+ classNameP = (LPCSTR)className;
+ else
+ {
+ classNameA = GetSystemString(className);
+ classNameP = classNameA;
+ }
+ AString windowNameA;
+ LPCSTR windowNameP;
+ if (IS_INTRESOURCE(windowName))
+ windowNameP = (LPCSTR)windowName;
+ else
+ {
+ windowNameA = GetSystemString(windowName);
+ windowNameP = windowNameA;
+ }
+ return CreateEx(exStyle, classNameP, windowNameP,
+ style, x, y, width, height, parentWindow,
+ idOrHMenu, instance, createParam);
+}
+
+#endif
+
+#ifndef _UNICODE
+bool MySetWindowText(HWND wnd, LPCWSTR s)
+{
+ if (g_IsNT)
+ return BOOLToBool(::SetWindowTextW(wnd, s));
+ return BOOLToBool(::SetWindowTextA(wnd, UnicodeStringToMultiByte(s)));
+}
+#endif
+
+bool CWindow::GetText(CSysString &s)
+{
+ s.Empty();
+ int len = GetTextLength();
+ if (len == 0)
+ return (::GetLastError() == ERROR_SUCCESS);
+ TCHAR *p = s.GetBuf(len);
+ {
+ int len2 = GetText(p, len + 1);
+ if (len > len2)
+ len = len2;
+ }
+ s.ReleaseBuf_CalcLen(len);
+ if (len == 0)
+ return (::GetLastError() == ERROR_SUCCESS);
+ return true;
+}
+
+#ifndef _UNICODE
+bool CWindow::GetText(UString &s)
+{
+ if (g_IsNT)
+ {
+ s.Empty();
+ int len = GetWindowTextLengthW(_window);
+ if (len == 0)
+ return (::GetLastError() == ERROR_SUCCESS);
+ wchar_t *p = s.GetBuf(len);
+ {
+ int len2 = GetWindowTextW(_window, p, len + 1);
+ if (len > len2)
+ len = len2;
+ }
+ s.ReleaseBuf_CalcLen(len);
+ if (len == 0)
+ return (::GetLastError() == ERROR_SUCCESS);
+ return true;
+ }
+ CSysString sysString;
+ bool result = GetText(sysString);
+ MultiByteToUnicodeString2(s, sysString);
+ return result;
+}
+#endif
+
+
+/*
+bool CWindow::ModifyStyleBase(int styleOffset,
+ DWORD remove, DWORD add, UINT flags)
+{
+ DWORD style = GetWindowLong(styleOffset);
+ DWORD newStyle = (style & ~remove) | add;
+ if (style == newStyle)
+ return false; // it is not good
+
+ SetWindowLong(styleOffset, newStyle);
+ if (flags != 0)
+ {
+ ::SetWindowPos(_window, NULL, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | flags);
+ }
+ return TRUE;
+}
+*/
+
+}
diff --git a/other-licenses/7zstub/src/CPP/Windows/Window.h b/other-licenses/7zstub/src/CPP/Windows/Window.h
new file mode 100644
index 0000000000..4c80a5b4f6
--- /dev/null
+++ b/other-licenses/7zstub/src/CPP/Windows/Window.h
@@ -0,0 +1,284 @@
+// Windows/Window.h
+
+#ifndef __WINDOWS_WINDOW_H
+#define __WINDOWS_WINDOW_H
+
+#include "../Common/MyWindows.h"
+#include "../Common/MyString.h"
+
+#include "Defs.h"
+
+#ifndef UNDER_CE
+
+#define MY__WM_CHANGEUISTATE 0x0127
+#define MY__WM_UPDATEUISTATE 0x0128
+#define MY__WM_QUERYUISTATE 0x0129
+
+// LOWORD(wParam) values in WM_*UISTATE
+#define MY__UIS_SET 1
+#define MY__UIS_CLEAR 2
+#define MY__UIS_INITIALIZE 3
+
+// HIWORD(wParam) values in WM_*UISTATE
+#define MY__UISF_HIDEFOCUS 0x1
+#define MY__UISF_HIDEACCEL 0x2
+#define MY__UISF_ACTIVE 0x4
+
+#endif
+
+namespace NWindows {
+
+inline ATOM MyRegisterClass(CONST WNDCLASS *wndClass)
+ { return ::RegisterClass(wndClass); }
+
+#ifndef _UNICODE
+ATOM MyRegisterClass(CONST WNDCLASSW *wndClass);
+#endif
+
+#ifdef _UNICODE
+inline bool MySetWindowText(HWND wnd, LPCWSTR s) { return BOOLToBool(::SetWindowText(wnd, s)); }
+#else
+bool MySetWindowText(HWND wnd, LPCWSTR s);
+#endif
+
+
+#ifdef UNDER_CE
+#define GWLP_USERDATA GWL_USERDATA
+#define GWLP_WNDPROC GWL_WNDPROC
+#define BTNS_BUTTON TBSTYLE_BUTTON
+#define WC_COMBOBOXW L"ComboBox"
+#define DWLP_MSGRESULT DWL_MSGRESULT
+#endif
+
+class CWindow
+{
+private:
+ // bool ModifyStyleBase(int styleOffset, DWORD remove, DWORD add, UINT flags);
+protected:
+ HWND _window;
+public:
+ CWindow(HWND newWindow = NULL): _window(newWindow){};
+ CWindow& operator=(HWND newWindow)
+ {
+ _window = newWindow;
+ return *this;
+ }
+ operator HWND() const { return _window; }
+ void Attach(HWND newWindow) { _window = newWindow; }
+ HWND Detach()
+ {
+ HWND window = _window;
+ _window = NULL;
+ return window;
+ }
+
+ bool Foreground() { return BOOLToBool(::SetForegroundWindow(_window)); }
+
+ HWND GetParent() const { return ::GetParent(_window); }
+ bool GetWindowRect(LPRECT rect) const { return BOOLToBool(::GetWindowRect(_window,rect)); }
+ #ifndef UNDER_CE
+ bool IsZoomed() const { return BOOLToBool(::IsZoomed(_window)); }
+ #endif
+ bool ClientToScreen(LPPOINT point) const { return BOOLToBool(::ClientToScreen(_window, point)); }
+ bool ScreenToClient(LPPOINT point) const { return BOOLToBool(::ScreenToClient(_window, point)); }
+
+ bool CreateEx(DWORD exStyle, LPCTSTR className,
+ LPCTSTR windowName, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam)
+ {
+ _window = ::CreateWindowEx(exStyle, className, windowName,
+ style, x, y, width, height, parentWindow,
+ idOrHMenu, instance, createParam);
+ return (_window != NULL);
+ }
+
+ bool Create(LPCTSTR className,
+ LPCTSTR windowName, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam)
+ {
+ _window = ::CreateWindow(className, windowName,
+ style, x, y, width, height, parentWindow,
+ idOrHMenu, instance, createParam);
+ return (_window != NULL);
+ }
+
+ #ifndef _UNICODE
+ bool Create(LPCWSTR className,
+ LPCWSTR windowName, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam);
+ bool CreateEx(DWORD exStyle, LPCWSTR className,
+ LPCWSTR windowName, DWORD style,
+ int x, int y, int width, int height,
+ HWND parentWindow, HMENU idOrHMenu,
+ HINSTANCE instance, LPVOID createParam);
+ #endif
+
+
+ bool Destroy()
+ {
+ if (_window == NULL)
+ return true;
+ bool result = BOOLToBool(::DestroyWindow(_window));
+ if (result)
+ _window = NULL;
+ return result;
+ }
+ bool IsWindow() { return BOOLToBool(::IsWindow(_window)); }
+ bool Move(int x, int y, int width, int height, bool repaint = true)
+ { return BOOLToBool(::MoveWindow(_window, x, y, width, height, BoolToBOOL(repaint))); }
+
+ bool ChangeSubWindowSizeX(HWND hwnd, int xSize)
+ {
+ RECT rect;
+ ::GetWindowRect(hwnd, &rect);
+ POINT p1;
+ p1.x = rect.left;
+ p1.y = rect.top;
+ ScreenToClient(&p1);
+ return BOOLToBool(::MoveWindow(hwnd, p1.x, p1.y, xSize, rect.bottom - rect.top, TRUE));
+ }
+
+ void ScreenToClient(RECT *rect)
+ {
+ POINT p1, p2;
+ p1.x = rect->left;
+ p1.y = rect->top;
+ p2.x = rect->right;
+ p2.y = rect->bottom;
+ ScreenToClient(&p1);
+ ScreenToClient(&p2);
+
+ rect->left = p1.x;
+ rect->top = p1.y;
+ rect->right = p2.x;
+ rect->bottom = p2.y;
+ }
+
+ bool GetClientRect(LPRECT rect) { return BOOLToBool(::GetClientRect(_window, rect)); }
+ bool Show(int cmdShow) { return BOOLToBool(::ShowWindow(_window, cmdShow)); }
+ bool Show_Bool(bool show) { return Show(show ? SW_SHOW: SW_HIDE); }
+
+ #ifndef UNDER_CE
+ bool SetPlacement(CONST WINDOWPLACEMENT *placement) { return BOOLToBool(::SetWindowPlacement(_window, placement)); }
+ bool GetPlacement(WINDOWPLACEMENT *placement) { return BOOLToBool(::GetWindowPlacement(_window, placement)); }
+ #endif
+ bool Update() { return BOOLToBool(::UpdateWindow(_window)); }
+ bool InvalidateRect(LPCRECT rect, bool backgroundErase = true)
+ { return BOOLToBool(::InvalidateRect(_window, rect, BoolToBOOL(backgroundErase))); }
+ void SetRedraw(bool redraw = true) { SendMsg(WM_SETREDRAW, BoolToBOOL(redraw), 0); }
+
+ LONG_PTR SetStyle(LONG_PTR style) { return SetLongPtr(GWL_STYLE, style); }
+ LONG_PTR GetStyle() const { return GetLongPtr(GWL_STYLE); }
+ // bool MyIsMaximized() const { return ((GetStyle() & WS_MAXIMIZE) != 0); }
+
+ LONG_PTR SetLong(int index, LONG newLongPtr) { return ::SetWindowLong(_window, index, newLongPtr); }
+ LONG_PTR GetLong(int index) const { return ::GetWindowLong(_window, index); }
+ LONG_PTR SetUserDataLong(LONG newLongPtr) { return SetLong(GWLP_USERDATA, newLongPtr); }
+ LONG_PTR GetUserDataLong() const { return GetLong(GWLP_USERDATA); }
+
+
+ #ifdef UNDER_CE
+
+ LONG_PTR SetLongPtr(int index, LONG_PTR newLongPtr) { return SetLong(index, newLongPtr); }
+ LONG_PTR GetLongPtr(int index) const { return GetLong(index); }
+
+ LONG_PTR SetUserDataLongPtr(LONG_PTR newLongPtr) { return SetUserDataLong(newLongPtr); }
+ LONG_PTR GetUserDataLongPtr() const { return GetUserDataLong(); }
+
+ #else
+
+ LONG_PTR SetLongPtr(int index, LONG_PTR newLongPtr)
+ { return ::SetWindowLongPtr(_window, index,
+ #ifndef _WIN64
+ (LONG)
+ #endif
+ newLongPtr); }
+ #ifndef _UNICODE
+ LONG_PTR SetLongPtrW(int index, LONG_PTR newLongPtr)
+ { return ::SetWindowLongPtrW(_window, index,
+ #ifndef _WIN64
+ (LONG)
+ #endif
+ newLongPtr); }
+ #endif
+
+ LONG_PTR GetLongPtr(int index) const { return ::GetWindowLongPtr(_window, index); }
+ LONG_PTR SetUserDataLongPtr(LONG_PTR newLongPtr) { return SetLongPtr(GWLP_USERDATA, newLongPtr); }
+ LONG_PTR GetUserDataLongPtr() const { return GetLongPtr(GWLP_USERDATA); }
+
+ #endif
+
+ /*
+ bool ModifyStyle(HWND hWnd, DWORD remove, DWORD add, UINT flags = 0)
+ { return ModifyStyleBase(GWL_STYLE, remove, add, flags); }
+ bool ModifyStyleEx(HWND hWnd, DWORD remove, DWORD add, UINT flags = 0)
+ { return ModifyStyleBase(GWL_EXSTYLE, remove, add, flags); }
+ */
+
+ HWND SetFocus() { return ::SetFocus(_window); }
+
+ LRESULT SendMsg(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
+ { return ::SendMessage(_window, message, wParam, lParam); }
+ #ifndef _UNICODE
+ LRESULT SendMsgW(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
+ { return ::SendMessageW(_window, message, wParam, lParam); }
+ #endif
+
+ bool PostMsg(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
+ { return BOOLToBool(::PostMessage(_window, message, wParam, lParam)); }
+ #ifndef _UNICODE
+ bool PostMsgW(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
+ { return BOOLToBool(::PostMessageW(_window, message, wParam, lParam)); }
+ #endif
+
+ bool SetText(LPCTSTR s) { return BOOLToBool(::SetWindowText(_window, s)); }
+ #ifndef _UNICODE
+ bool SetText(LPCWSTR s) { return MySetWindowText(_window, s); }
+ #endif
+
+ int GetTextLength() const
+ { return GetWindowTextLength(_window); }
+ UINT GetText(LPTSTR string, int maxCount) const
+ { return GetWindowText(_window, string, maxCount); }
+ bool GetText(CSysString &s);
+ #ifndef _UNICODE
+ /*
+ UINT GetText(LPWSTR string, int maxCount) const
+ { return GetWindowTextW(_window, string, maxCount); }
+ */
+ bool GetText(UString &s);
+ #endif
+
+ bool Enable(bool enable)
+ { return BOOLToBool(::EnableWindow(_window, BoolToBOOL(enable))); }
+
+ bool IsEnabled()
+ { return BOOLToBool(::IsWindowEnabled(_window)); }
+
+ #ifndef UNDER_CE
+ HMENU GetSystemMenu(bool revert)
+ { return ::GetSystemMenu(_window, BoolToBOOL(revert)); }
+ #endif
+
+ UINT_PTR SetTimer(UINT_PTR idEvent, UINT elapse, TIMERPROC timerFunc = 0)
+ { return ::SetTimer(_window, idEvent, elapse, timerFunc); }
+ bool KillTimer(UINT_PTR idEvent)
+ {return BOOLToBool(::KillTimer(_window, idEvent)); }
+
+ HICON SetIcon(WPARAM sizeType, HICON icon) { return (HICON)SendMsg(WM_SETICON, sizeType, (LPARAM)icon); }
+};
+
+#define RECT_SIZE_X(r) ((r).right - (r).left)
+#define RECT_SIZE_Y(r) ((r).bottom - (r).top)
+
+inline bool IsKeyDown(int virtKey) { return (::GetKeyState(virtKey) & 0x8000) != 0; }
+
+}
+
+#endif
diff --git a/other-licenses/7zstub/src/CS/7zip/Common/CRC.cs b/other-licenses/7zstub/src/CS/7zip/Common/CRC.cs
new file mode 100644
index 0000000000..62bb8478ba
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Common/CRC.cs
@@ -0,0 +1,55 @@
+// Common/CRC.cs
+
+namespace SevenZip
+{
+ class CRC
+ {
+ public static readonly uint[] Table;
+
+ static CRC()
+ {
+ Table = new uint[256];
+ const uint kPoly = 0xEDB88320;
+ for (uint i = 0; i < 256; i++)
+ {
+ uint r = i;
+ for (int j = 0; j < 8; j++)
+ if ((r & 1) != 0)
+ r = (r >> 1) ^ kPoly;
+ else
+ r >>= 1;
+ Table[i] = r;
+ }
+ }
+
+ uint _value = 0xFFFFFFFF;
+
+ public void Init() { _value = 0xFFFFFFFF; }
+
+ public void UpdateByte(byte b)
+ {
+ _value = Table[(((byte)(_value)) ^ b)] ^ (_value >> 8);
+ }
+
+ public void Update(byte[] data, uint offset, uint size)
+ {
+ for (uint i = 0; i < size; i++)
+ _value = Table[(((byte)(_value)) ^ data[offset + i])] ^ (_value >> 8);
+ }
+
+ public uint GetDigest() { return _value ^ 0xFFFFFFFF; }
+
+ static uint CalculateDigest(byte[] data, uint offset, uint size)
+ {
+ CRC crc = new CRC();
+ // crc.Init();
+ crc.Update(data, offset, size);
+ return crc.GetDigest();
+ }
+
+ static bool VerifyDigest(uint digest, byte[] data, uint offset, uint size)
+ {
+ return (CalculateDigest(data, offset, size) == digest);
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Common/CommandLineParser.cs b/other-licenses/7zstub/src/CS/7zip/Common/CommandLineParser.cs
new file mode 100644
index 0000000000..b46f6f2095
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Common/CommandLineParser.cs
@@ -0,0 +1,274 @@
+// CommandLineParser.cs
+
+using System;
+using System.Collections;
+
+namespace SevenZip.CommandLineParser
+{
+ public enum SwitchType
+ {
+ Simple,
+ PostMinus,
+ LimitedPostString,
+ UnLimitedPostString,
+ PostChar
+ }
+
+ public class SwitchForm
+ {
+ public string IDString;
+ public SwitchType Type;
+ public bool Multi;
+ public int MinLen;
+ public int MaxLen;
+ public string PostCharSet;
+
+ public SwitchForm(string idString, SwitchType type, bool multi,
+ int minLen, int maxLen, string postCharSet)
+ {
+ IDString = idString;
+ Type = type;
+ Multi = multi;
+ MinLen = minLen;
+ MaxLen = maxLen;
+ PostCharSet = postCharSet;
+ }
+ public SwitchForm(string idString, SwitchType type, bool multi, int minLen):
+ this(idString, type, multi, minLen, 0, "")
+ {
+ }
+ public SwitchForm(string idString, SwitchType type, bool multi):
+ this(idString, type, multi, 0)
+ {
+ }
+ }
+
+ public class SwitchResult
+ {
+ public bool ThereIs;
+ public bool WithMinus;
+ public ArrayList PostStrings = new ArrayList();
+ public int PostCharIndex;
+ public SwitchResult()
+ {
+ ThereIs = false;
+ }
+ }
+
+ public class Parser
+ {
+ public ArrayList NonSwitchStrings = new ArrayList();
+ SwitchResult[] _switches;
+
+ public Parser(int numSwitches)
+ {
+ _switches = new SwitchResult[numSwitches];
+ for (int i = 0; i < numSwitches; i++)
+ _switches[i] = new SwitchResult();
+ }
+
+ bool ParseString(string srcString, SwitchForm[] switchForms)
+ {
+ int len = srcString.Length;
+ if (len == 0)
+ return false;
+ int pos = 0;
+ if (!IsItSwitchChar(srcString[pos]))
+ return false;
+ while (pos < len)
+ {
+ if (IsItSwitchChar(srcString[pos]))
+ pos++;
+ const int kNoLen = -1;
+ int matchedSwitchIndex = 0;
+ int maxLen = kNoLen;
+ for (int switchIndex = 0; switchIndex < _switches.Length; switchIndex++)
+ {
+ int switchLen = switchForms[switchIndex].IDString.Length;
+ if (switchLen <= maxLen || pos + switchLen > len)
+ continue;
+ if (String.Compare(switchForms[switchIndex].IDString, 0,
+ srcString, pos, switchLen, true) == 0)
+ {
+ matchedSwitchIndex = switchIndex;
+ maxLen = switchLen;
+ }
+ }
+ if (maxLen == kNoLen)
+ throw new Exception("maxLen == kNoLen");
+ SwitchResult matchedSwitch = _switches[matchedSwitchIndex];
+ SwitchForm switchForm = switchForms[matchedSwitchIndex];
+ if ((!switchForm.Multi) && matchedSwitch.ThereIs)
+ throw new Exception("switch must be single");
+ matchedSwitch.ThereIs = true;
+ pos += maxLen;
+ int tailSize = len - pos;
+ SwitchType type = switchForm.Type;
+ switch (type)
+ {
+ case SwitchType.PostMinus:
+ {
+ if (tailSize == 0)
+ matchedSwitch.WithMinus = false;
+ else
+ {
+ matchedSwitch.WithMinus = (srcString[pos] == kSwitchMinus);
+ if (matchedSwitch.WithMinus)
+ pos++;
+ }
+ break;
+ }
+ case SwitchType.PostChar:
+ {
+ if (tailSize < switchForm.MinLen)
+ throw new Exception("switch is not full");
+ string charSet = switchForm.PostCharSet;
+ const int kEmptyCharValue = -1;
+ if (tailSize == 0)
+ matchedSwitch.PostCharIndex = kEmptyCharValue;
+ else
+ {
+ int index = charSet.IndexOf(srcString[pos]);
+ if (index < 0)
+ matchedSwitch.PostCharIndex = kEmptyCharValue;
+ else
+ {
+ matchedSwitch.PostCharIndex = index;
+ pos++;
+ }
+ }
+ break;
+ }
+ case SwitchType.LimitedPostString:
+ case SwitchType.UnLimitedPostString:
+ {
+ int minLen = switchForm.MinLen;
+ if (tailSize < minLen)
+ throw new Exception("switch is not full");
+ if (type == SwitchType.UnLimitedPostString)
+ {
+ matchedSwitch.PostStrings.Add(srcString.Substring(pos));
+ return true;
+ }
+ String stringSwitch = srcString.Substring(pos, minLen);
+ pos += minLen;
+ for (int i = minLen; i < switchForm.MaxLen && pos < len; i++, pos++)
+ {
+ char c = srcString[pos];
+ if (IsItSwitchChar(c))
+ break;
+ stringSwitch += c;
+ }
+ matchedSwitch.PostStrings.Add(stringSwitch);
+ break;
+ }
+ }
+ }
+ return true;
+
+ }
+
+ public void ParseStrings(SwitchForm[] switchForms, string[] commandStrings)
+ {
+ int numCommandStrings = commandStrings.Length;
+ bool stopSwitch = false;
+ for (int i = 0; i < numCommandStrings; i++)
+ {
+ string s = commandStrings[i];
+ if (stopSwitch)
+ NonSwitchStrings.Add(s);
+ else
+ if (s == kStopSwitchParsing)
+ stopSwitch = true;
+ else
+ if (!ParseString(s, switchForms))
+ NonSwitchStrings.Add(s);
+ }
+ }
+
+ public SwitchResult this[int index] { get { return _switches[index]; } }
+
+ public static int ParseCommand(CommandForm[] commandForms, string commandString,
+ out string postString)
+ {
+ for (int i = 0; i < commandForms.Length; i++)
+ {
+ string id = commandForms[i].IDString;
+ if (commandForms[i].PostStringMode)
+ {
+ if (commandString.IndexOf(id) == 0)
+ {
+ postString = commandString.Substring(id.Length);
+ return i;
+ }
+ }
+ else
+ if (commandString == id)
+ {
+ postString = "";
+ return i;
+ }
+ }
+ postString = "";
+ return -1;
+ }
+
+ static bool ParseSubCharsCommand(int numForms, CommandSubCharsSet[] forms,
+ string commandString, ArrayList indices)
+ {
+ indices.Clear();
+ int numUsedChars = 0;
+ for (int i = 0; i < numForms; i++)
+ {
+ CommandSubCharsSet charsSet = forms[i];
+ int currentIndex = -1;
+ int len = charsSet.Chars.Length;
+ for (int j = 0; j < len; j++)
+ {
+ char c = charsSet.Chars[j];
+ int newIndex = commandString.IndexOf(c);
+ if (newIndex >= 0)
+ {
+ if (currentIndex >= 0)
+ return false;
+ if (commandString.IndexOf(c, newIndex + 1) >= 0)
+ return false;
+ currentIndex = j;
+ numUsedChars++;
+ }
+ }
+ if (currentIndex == -1 && !charsSet.EmptyAllowed)
+ return false;
+ indices.Add(currentIndex);
+ }
+ return (numUsedChars == commandString.Length);
+ }
+ const char kSwitchID1 = '-';
+ const char kSwitchID2 = '/';
+
+ const char kSwitchMinus = '-';
+ const string kStopSwitchParsing = "--";
+
+ static bool IsItSwitchChar(char c)
+ {
+ return (c == kSwitchID1 || c == kSwitchID2);
+ }
+ }
+
+ public class CommandForm
+ {
+ public string IDString = "";
+ public bool PostStringMode = false;
+ public CommandForm(string idString, bool postStringMode)
+ {
+ IDString = idString;
+ PostStringMode = postStringMode;
+ }
+ }
+
+ class CommandSubCharsSet
+ {
+ public string Chars = "";
+ public bool EmptyAllowed = false;
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Common/InBuffer.cs b/other-licenses/7zstub/src/CS/7zip/Common/InBuffer.cs
new file mode 100644
index 0000000000..9c47c73ae3
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Common/InBuffer.cs
@@ -0,0 +1,72 @@
+// InBuffer.cs
+
+namespace SevenZip.Buffer
+{
+ public class InBuffer
+ {
+ byte[] m_Buffer;
+ uint m_Pos;
+ uint m_Limit;
+ uint m_BufferSize;
+ System.IO.Stream m_Stream;
+ bool m_StreamWasExhausted;
+ ulong m_ProcessedSize;
+
+ public InBuffer(uint bufferSize)
+ {
+ m_Buffer = new byte[bufferSize];
+ m_BufferSize = bufferSize;
+ }
+
+ public void Init(System.IO.Stream stream)
+ {
+ m_Stream = stream;
+ m_ProcessedSize = 0;
+ m_Limit = 0;
+ m_Pos = 0;
+ m_StreamWasExhausted = false;
+ }
+
+ public bool ReadBlock()
+ {
+ if (m_StreamWasExhausted)
+ return false;
+ m_ProcessedSize += m_Pos;
+ int aNumProcessedBytes = m_Stream.Read(m_Buffer, 0, (int)m_BufferSize);
+ m_Pos = 0;
+ m_Limit = (uint)aNumProcessedBytes;
+ m_StreamWasExhausted = (aNumProcessedBytes == 0);
+ return (!m_StreamWasExhausted);
+ }
+
+
+ public void ReleaseStream()
+ {
+ // m_Stream.Close();
+ m_Stream = null;
+ }
+
+ public bool ReadByte(byte b) // check it
+ {
+ if (m_Pos >= m_Limit)
+ if (!ReadBlock())
+ return false;
+ b = m_Buffer[m_Pos++];
+ return true;
+ }
+
+ public byte ReadByte()
+ {
+ // return (byte)m_Stream.ReadByte();
+ if (m_Pos >= m_Limit)
+ if (!ReadBlock())
+ return 0xFF;
+ return m_Buffer[m_Pos++];
+ }
+
+ public ulong GetProcessedSize()
+ {
+ return m_ProcessedSize + m_Pos;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Common/OutBuffer.cs b/other-licenses/7zstub/src/CS/7zip/Common/OutBuffer.cs
new file mode 100644
index 0000000000..c205aa6346
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Common/OutBuffer.cs
@@ -0,0 +1,47 @@
+// OutBuffer.cs
+
+namespace SevenZip.Buffer
+{
+ public class OutBuffer
+ {
+ byte[] m_Buffer;
+ uint m_Pos;
+ uint m_BufferSize;
+ System.IO.Stream m_Stream;
+ ulong m_ProcessedSize;
+
+ public OutBuffer(uint bufferSize)
+ {
+ m_Buffer = new byte[bufferSize];
+ m_BufferSize = bufferSize;
+ }
+
+ public void SetStream(System.IO.Stream stream) { m_Stream = stream; }
+ public void FlushStream() { m_Stream.Flush(); }
+ public void CloseStream() { m_Stream.Close(); }
+ public void ReleaseStream() { m_Stream = null; }
+
+ public void Init()
+ {
+ m_ProcessedSize = 0;
+ m_Pos = 0;
+ }
+
+ public void WriteByte(byte b)
+ {
+ m_Buffer[m_Pos++] = b;
+ if (m_Pos >= m_BufferSize)
+ FlushData();
+ }
+
+ public void FlushData()
+ {
+ if (m_Pos == 0)
+ return;
+ m_Stream.Write(m_Buffer, 0, (int)m_Pos);
+ m_Pos = 0;
+ }
+
+ public ulong GetProcessedSize() { return m_ProcessedSize + m_Pos; }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZ/IMatchFinder.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/IMatchFinder.cs
new file mode 100644
index 0000000000..30fab86501
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/IMatchFinder.cs
@@ -0,0 +1,24 @@
+// IMatchFinder.cs
+
+using System;
+
+namespace SevenZip.Compression.LZ
+{
+ interface IInWindowStream
+ {
+ void SetStream(System.IO.Stream inStream);
+ void Init();
+ void ReleaseStream();
+ Byte GetIndexByte(Int32 index);
+ UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit);
+ UInt32 GetNumAvailableBytes();
+ }
+
+ interface IMatchFinder : IInWindowStream
+ {
+ void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
+ UInt32 matchMaxLen, UInt32 keepAddBufferAfter);
+ UInt32 GetMatches(UInt32[] distances);
+ void Skip(UInt32 num);
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzBinTree.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzBinTree.cs
new file mode 100644
index 0000000000..7a9ca2092c
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzBinTree.cs
@@ -0,0 +1,367 @@
+// LzBinTree.cs
+
+using System;
+
+namespace SevenZip.Compression.LZ
+{
+ public class BinTree : InWindow, IMatchFinder
+ {
+ UInt32 _cyclicBufferPos;
+ UInt32 _cyclicBufferSize = 0;
+ UInt32 _matchMaxLen;
+
+ UInt32[] _son;
+ UInt32[] _hash;
+
+ UInt32 _cutValue = 0xFF;
+ UInt32 _hashMask;
+ UInt32 _hashSizeSum = 0;
+
+ bool HASH_ARRAY = true;
+
+ const UInt32 kHash2Size = 1 << 10;
+ const UInt32 kHash3Size = 1 << 16;
+ const UInt32 kBT2HashSize = 1 << 16;
+ const UInt32 kStartMaxLen = 1;
+ const UInt32 kHash3Offset = kHash2Size;
+ const UInt32 kEmptyHashValue = 0;
+ const UInt32 kMaxValForNormalize = ((UInt32)1 << 31) - 1;
+
+ UInt32 kNumHashDirectBytes = 0;
+ UInt32 kMinMatchCheck = 4;
+ UInt32 kFixHashSize = kHash2Size + kHash3Size;
+
+ public void SetType(int numHashBytes)
+ {
+ HASH_ARRAY = (numHashBytes > 2);
+ if (HASH_ARRAY)
+ {
+ kNumHashDirectBytes = 0;
+ kMinMatchCheck = 4;
+ kFixHashSize = kHash2Size + kHash3Size;
+ }
+ else
+ {
+ kNumHashDirectBytes = 2;
+ kMinMatchCheck = 2 + 1;
+ kFixHashSize = 0;
+ }
+ }
+
+ public new void SetStream(System.IO.Stream stream) { base.SetStream(stream); }
+ public new void ReleaseStream() { base.ReleaseStream(); }
+
+ public new void Init()
+ {
+ base.Init();
+ for (UInt32 i = 0; i < _hashSizeSum; i++)
+ _hash[i] = kEmptyHashValue;
+ _cyclicBufferPos = 0;
+ ReduceOffsets(-1);
+ }
+
+ public new void MovePos()
+ {
+ if (++_cyclicBufferPos >= _cyclicBufferSize)
+ _cyclicBufferPos = 0;
+ base.MovePos();
+ if (_pos == kMaxValForNormalize)
+ Normalize();
+ }
+
+ public new Byte GetIndexByte(Int32 index) { return base.GetIndexByte(index); }
+
+ public new UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
+ { return base.GetMatchLen(index, distance, limit); }
+
+ public new UInt32 GetNumAvailableBytes() { return base.GetNumAvailableBytes(); }
+
+ public void Create(UInt32 historySize, UInt32 keepAddBufferBefore,
+ UInt32 matchMaxLen, UInt32 keepAddBufferAfter)
+ {
+ if (historySize > kMaxValForNormalize - 256)
+ throw new Exception();
+ _cutValue = 16 + (matchMaxLen >> 1);
+
+ UInt32 windowReservSize = (historySize + keepAddBufferBefore +
+ matchMaxLen + keepAddBufferAfter) / 2 + 256;
+
+ base.Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, windowReservSize);
+
+ _matchMaxLen = matchMaxLen;
+
+ UInt32 cyclicBufferSize = historySize + 1;
+ if (_cyclicBufferSize != cyclicBufferSize)
+ _son = new UInt32[(_cyclicBufferSize = cyclicBufferSize) * 2];
+
+ UInt32 hs = kBT2HashSize;
+
+ if (HASH_ARRAY)
+ {
+ hs = historySize - 1;
+ hs |= (hs >> 1);
+ hs |= (hs >> 2);
+ hs |= (hs >> 4);
+ hs |= (hs >> 8);
+ hs >>= 1;
+ hs |= 0xFFFF;
+ if (hs > (1 << 24))
+ hs >>= 1;
+ _hashMask = hs;
+ hs++;
+ hs += kFixHashSize;
+ }
+ if (hs != _hashSizeSum)
+ _hash = new UInt32[_hashSizeSum = hs];
+ }
+
+ public UInt32 GetMatches(UInt32[] distances)
+ {
+ UInt32 lenLimit;
+ if (_pos + _matchMaxLen <= _streamPos)
+ lenLimit = _matchMaxLen;
+ else
+ {
+ lenLimit = _streamPos - _pos;
+ if (lenLimit < kMinMatchCheck)
+ {
+ MovePos();
+ return 0;
+ }
+ }
+
+ UInt32 offset = 0;
+ UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
+ UInt32 cur = _bufferOffset + _pos;
+ UInt32 maxLen = kStartMaxLen; // to avoid items for len < hashSize;
+ UInt32 hashValue, hash2Value = 0, hash3Value = 0;
+
+ if (HASH_ARRAY)
+ {
+ UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
+ hash2Value = temp & (kHash2Size - 1);
+ temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
+ hash3Value = temp & (kHash3Size - 1);
+ hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
+ }
+ else
+ hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
+
+ UInt32 curMatch = _hash[kFixHashSize + hashValue];
+ if (HASH_ARRAY)
+ {
+ UInt32 curMatch2 = _hash[hash2Value];
+ UInt32 curMatch3 = _hash[kHash3Offset + hash3Value];
+ _hash[hash2Value] = _pos;
+ _hash[kHash3Offset + hash3Value] = _pos;
+ if (curMatch2 > matchMinPos)
+ if (_bufferBase[_bufferOffset + curMatch2] == _bufferBase[cur])
+ {
+ distances[offset++] = maxLen = 2;
+ distances[offset++] = _pos - curMatch2 - 1;
+ }
+ if (curMatch3 > matchMinPos)
+ if (_bufferBase[_bufferOffset + curMatch3] == _bufferBase[cur])
+ {
+ if (curMatch3 == curMatch2)
+ offset -= 2;
+ distances[offset++] = maxLen = 3;
+ distances[offset++] = _pos - curMatch3 - 1;
+ curMatch2 = curMatch3;
+ }
+ if (offset != 0 && curMatch2 == curMatch)
+ {
+ offset -= 2;
+ maxLen = kStartMaxLen;
+ }
+ }
+
+ _hash[kFixHashSize + hashValue] = _pos;
+
+ UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
+ UInt32 ptr1 = (_cyclicBufferPos << 1);
+
+ UInt32 len0, len1;
+ len0 = len1 = kNumHashDirectBytes;
+
+ if (kNumHashDirectBytes != 0)
+ {
+ if (curMatch > matchMinPos)
+ {
+ if (_bufferBase[_bufferOffset + curMatch + kNumHashDirectBytes] !=
+ _bufferBase[cur + kNumHashDirectBytes])
+ {
+ distances[offset++] = maxLen = kNumHashDirectBytes;
+ distances[offset++] = _pos - curMatch - 1;
+ }
+ }
+ }
+
+ UInt32 count = _cutValue;
+
+ while(true)
+ {
+ if(curMatch <= matchMinPos || count-- == 0)
+ {
+ _son[ptr0] = _son[ptr1] = kEmptyHashValue;
+ break;
+ }
+ UInt32 delta = _pos - curMatch;
+ UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
+ (_cyclicBufferPos - delta) :
+ (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
+
+ UInt32 pby1 = _bufferOffset + curMatch;
+ UInt32 len = Math.Min(len0, len1);
+ if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
+ {
+ while(++len != lenLimit)
+ if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
+ break;
+ if (maxLen < len)
+ {
+ distances[offset++] = maxLen = len;
+ distances[offset++] = delta - 1;
+ if (len == lenLimit)
+ {
+ _son[ptr1] = _son[cyclicPos];
+ _son[ptr0] = _son[cyclicPos + 1];
+ break;
+ }
+ }
+ }
+ if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
+ {
+ _son[ptr1] = curMatch;
+ ptr1 = cyclicPos + 1;
+ curMatch = _son[ptr1];
+ len1 = len;
+ }
+ else
+ {
+ _son[ptr0] = curMatch;
+ ptr0 = cyclicPos;
+ curMatch = _son[ptr0];
+ len0 = len;
+ }
+ }
+ MovePos();
+ return offset;
+ }
+
+ public void Skip(UInt32 num)
+ {
+ do
+ {
+ UInt32 lenLimit;
+ if (_pos + _matchMaxLen <= _streamPos)
+ lenLimit = _matchMaxLen;
+ else
+ {
+ lenLimit = _streamPos - _pos;
+ if (lenLimit < kMinMatchCheck)
+ {
+ MovePos();
+ continue;
+ }
+ }
+
+ UInt32 matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
+ UInt32 cur = _bufferOffset + _pos;
+
+ UInt32 hashValue;
+
+ if (HASH_ARRAY)
+ {
+ UInt32 temp = CRC.Table[_bufferBase[cur]] ^ _bufferBase[cur + 1];
+ UInt32 hash2Value = temp & (kHash2Size - 1);
+ _hash[hash2Value] = _pos;
+ temp ^= ((UInt32)(_bufferBase[cur + 2]) << 8);
+ UInt32 hash3Value = temp & (kHash3Size - 1);
+ _hash[kHash3Offset + hash3Value] = _pos;
+ hashValue = (temp ^ (CRC.Table[_bufferBase[cur + 3]] << 5)) & _hashMask;
+ }
+ else
+ hashValue = _bufferBase[cur] ^ ((UInt32)(_bufferBase[cur + 1]) << 8);
+
+ UInt32 curMatch = _hash[kFixHashSize + hashValue];
+ _hash[kFixHashSize + hashValue] = _pos;
+
+ UInt32 ptr0 = (_cyclicBufferPos << 1) + 1;
+ UInt32 ptr1 = (_cyclicBufferPos << 1);
+
+ UInt32 len0, len1;
+ len0 = len1 = kNumHashDirectBytes;
+
+ UInt32 count = _cutValue;
+ while (true)
+ {
+ if (curMatch <= matchMinPos || count-- == 0)
+ {
+ _son[ptr0] = _son[ptr1] = kEmptyHashValue;
+ break;
+ }
+
+ UInt32 delta = _pos - curMatch;
+ UInt32 cyclicPos = ((delta <= _cyclicBufferPos) ?
+ (_cyclicBufferPos - delta) :
+ (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
+
+ UInt32 pby1 = _bufferOffset + curMatch;
+ UInt32 len = Math.Min(len0, len1);
+ if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
+ {
+ while (++len != lenLimit)
+ if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
+ break;
+ if (len == lenLimit)
+ {
+ _son[ptr1] = _son[cyclicPos];
+ _son[ptr0] = _son[cyclicPos + 1];
+ break;
+ }
+ }
+ if (_bufferBase[pby1 + len] < _bufferBase[cur + len])
+ {
+ _son[ptr1] = curMatch;
+ ptr1 = cyclicPos + 1;
+ curMatch = _son[ptr1];
+ len1 = len;
+ }
+ else
+ {
+ _son[ptr0] = curMatch;
+ ptr0 = cyclicPos;
+ curMatch = _son[ptr0];
+ len0 = len;
+ }
+ }
+ MovePos();
+ }
+ while (--num != 0);
+ }
+
+ void NormalizeLinks(UInt32[] items, UInt32 numItems, UInt32 subValue)
+ {
+ for (UInt32 i = 0; i < numItems; i++)
+ {
+ UInt32 value = items[i];
+ if (value <= subValue)
+ value = kEmptyHashValue;
+ else
+ value -= subValue;
+ items[i] = value;
+ }
+ }
+
+ void Normalize()
+ {
+ UInt32 subValue = _pos - _cyclicBufferSize;
+ NormalizeLinks(_son, _cyclicBufferSize * 2, subValue);
+ NormalizeLinks(_hash, _hashSizeSum, subValue);
+ ReduceOffsets((Int32)subValue);
+ }
+
+ public void SetCutValue(UInt32 cutValue) { _cutValue = cutValue; }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzInWindow.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzInWindow.cs
new file mode 100644
index 0000000000..f1974cef50
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzInWindow.cs
@@ -0,0 +1,132 @@
+// LzInWindow.cs
+
+using System;
+
+namespace SevenZip.Compression.LZ
+{
+ public class InWindow
+ {
+ public Byte[] _bufferBase = null; // pointer to buffer with data
+ System.IO.Stream _stream;
+ UInt32 _posLimit; // offset (from _buffer) of first byte when new block reading must be done
+ bool _streamEndWasReached; // if (true) then _streamPos shows real end of stream
+
+ UInt32 _pointerToLastSafePosition;
+
+ public UInt32 _bufferOffset;
+
+ public UInt32 _blockSize; // Size of Allocated memory block
+ public UInt32 _pos; // offset (from _buffer) of curent byte
+ UInt32 _keepSizeBefore; // how many BYTEs must be kept in buffer before _pos
+ UInt32 _keepSizeAfter; // how many BYTEs must be kept buffer after _pos
+ public UInt32 _streamPos; // offset (from _buffer) of first not read byte from Stream
+
+ public void MoveBlock()
+ {
+ UInt32 offset = (UInt32)(_bufferOffset) + _pos - _keepSizeBefore;
+ // we need one additional byte, since MovePos moves on 1 byte.
+ if (offset > 0)
+ offset--;
+
+ UInt32 numBytes = (UInt32)(_bufferOffset) + _streamPos - offset;
+
+ // check negative offset ????
+ for (UInt32 i = 0; i < numBytes; i++)
+ _bufferBase[i] = _bufferBase[offset + i];
+ _bufferOffset -= offset;
+ }
+
+ public virtual void ReadBlock()
+ {
+ if (_streamEndWasReached)
+ return;
+ while (true)
+ {
+ int size = (int)((0 - _bufferOffset) + _blockSize - _streamPos);
+ if (size == 0)
+ return;
+ int numReadBytes = _stream.Read(_bufferBase, (int)(_bufferOffset + _streamPos), size);
+ if (numReadBytes == 0)
+ {
+ _posLimit = _streamPos;
+ UInt32 pointerToPostion = _bufferOffset + _posLimit;
+ if (pointerToPostion > _pointerToLastSafePosition)
+ _posLimit = (UInt32)(_pointerToLastSafePosition - _bufferOffset);
+
+ _streamEndWasReached = true;
+ return;
+ }
+ _streamPos += (UInt32)numReadBytes;
+ if (_streamPos >= _pos + _keepSizeAfter)
+ _posLimit = _streamPos - _keepSizeAfter;
+ }
+ }
+
+ void Free() { _bufferBase = null; }
+
+ public void Create(UInt32 keepSizeBefore, UInt32 keepSizeAfter, UInt32 keepSizeReserv)
+ {
+ _keepSizeBefore = keepSizeBefore;
+ _keepSizeAfter = keepSizeAfter;
+ UInt32 blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv;
+ if (_bufferBase == null || _blockSize != blockSize)
+ {
+ Free();
+ _blockSize = blockSize;
+ _bufferBase = new Byte[_blockSize];
+ }
+ _pointerToLastSafePosition = _blockSize - keepSizeAfter;
+ }
+
+ public void SetStream(System.IO.Stream stream) { _stream = stream; }
+ public void ReleaseStream() { _stream = null; }
+
+ public void Init()
+ {
+ _bufferOffset = 0;
+ _pos = 0;
+ _streamPos = 0;
+ _streamEndWasReached = false;
+ ReadBlock();
+ }
+
+ public void MovePos()
+ {
+ _pos++;
+ if (_pos > _posLimit)
+ {
+ UInt32 pointerToPostion = _bufferOffset + _pos;
+ if (pointerToPostion > _pointerToLastSafePosition)
+ MoveBlock();
+ ReadBlock();
+ }
+ }
+
+ public Byte GetIndexByte(Int32 index) { return _bufferBase[_bufferOffset + _pos + index]; }
+
+ // index + limit have not to exceed _keepSizeAfter;
+ public UInt32 GetMatchLen(Int32 index, UInt32 distance, UInt32 limit)
+ {
+ if (_streamEndWasReached)
+ if ((_pos + index) + limit > _streamPos)
+ limit = _streamPos - (UInt32)(_pos + index);
+ distance++;
+ // Byte *pby = _buffer + (size_t)_pos + index;
+ UInt32 pby = _bufferOffset + _pos + (UInt32)index;
+
+ UInt32 i;
+ for (i = 0; i < limit && _bufferBase[pby + i] == _bufferBase[pby + i - distance]; i++);
+ return i;
+ }
+
+ public UInt32 GetNumAvailableBytes() { return _streamPos - _pos; }
+
+ public void ReduceOffsets(Int32 subValue)
+ {
+ _bufferOffset += (UInt32)subValue;
+ _posLimit -= (UInt32)subValue;
+ _pos -= (UInt32)subValue;
+ _streamPos -= (UInt32)subValue;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzOutWindow.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzOutWindow.cs
new file mode 100644
index 0000000000..84914f0d94
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZ/LzOutWindow.cs
@@ -0,0 +1,110 @@
+// LzOutWindow.cs
+
+namespace SevenZip.Compression.LZ
+{
+ public class OutWindow
+ {
+ byte[] _buffer = null;
+ uint _pos;
+ uint _windowSize = 0;
+ uint _streamPos;
+ System.IO.Stream _stream;
+
+ public uint TrainSize = 0;
+
+ public void Create(uint windowSize)
+ {
+ if (_windowSize != windowSize)
+ {
+ // System.GC.Collect();
+ _buffer = new byte[windowSize];
+ }
+ _windowSize = windowSize;
+ _pos = 0;
+ _streamPos = 0;
+ }
+
+ public void Init(System.IO.Stream stream, bool solid)
+ {
+ ReleaseStream();
+ _stream = stream;
+ if (!solid)
+ {
+ _streamPos = 0;
+ _pos = 0;
+ TrainSize = 0;
+ }
+ }
+
+ public bool Train(System.IO.Stream stream)
+ {
+ long len = stream.Length;
+ uint size = (len < _windowSize) ? (uint)len : _windowSize;
+ TrainSize = size;
+ stream.Position = len - size;
+ _streamPos = _pos = 0;
+ while (size > 0)
+ {
+ uint curSize = _windowSize - _pos;
+ if (size < curSize)
+ curSize = size;
+ int numReadBytes = stream.Read(_buffer, (int)_pos, (int)curSize);
+ if (numReadBytes == 0)
+ return false;
+ size -= (uint)numReadBytes;
+ _pos += (uint)numReadBytes;
+ _streamPos += (uint)numReadBytes;
+ if (_pos == _windowSize)
+ _streamPos = _pos = 0;
+ }
+ return true;
+ }
+
+ public void ReleaseStream()
+ {
+ Flush();
+ _stream = null;
+ }
+
+ public void Flush()
+ {
+ uint size = _pos - _streamPos;
+ if (size == 0)
+ return;
+ _stream.Write(_buffer, (int)_streamPos, (int)size);
+ if (_pos >= _windowSize)
+ _pos = 0;
+ _streamPos = _pos;
+ }
+
+ public void CopyBlock(uint distance, uint len)
+ {
+ uint pos = _pos - distance - 1;
+ if (pos >= _windowSize)
+ pos += _windowSize;
+ for (; len > 0; len--)
+ {
+ if (pos >= _windowSize)
+ pos = 0;
+ _buffer[_pos++] = _buffer[pos++];
+ if (_pos >= _windowSize)
+ Flush();
+ }
+ }
+
+ public void PutByte(byte b)
+ {
+ _buffer[_pos++] = b;
+ if (_pos >= _windowSize)
+ Flush();
+ }
+
+ public byte GetByte(uint distance)
+ {
+ uint pos = _pos - distance - 1;
+ if (pos >= _windowSize)
+ pos += _windowSize;
+ return _buffer[pos];
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaBase.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaBase.cs
new file mode 100644
index 0000000000..8447a2a0ff
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaBase.cs
@@ -0,0 +1,76 @@
+// LzmaBase.cs
+
+namespace SevenZip.Compression.LZMA
+{
+ internal abstract class Base
+ {
+ public const uint kNumRepDistances = 4;
+ public const uint kNumStates = 12;
+
+ // static byte []kLiteralNextStates = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5};
+ // static byte []kMatchNextStates = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10};
+ // static byte []kRepNextStates = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11};
+ // static byte []kShortRepNextStates = {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11};
+
+ public struct State
+ {
+ public uint Index;
+ public void Init() { Index = 0; }
+ public void UpdateChar()
+ {
+ if (Index < 4) Index = 0;
+ else if (Index < 10) Index -= 3;
+ else Index -= 6;
+ }
+ public void UpdateMatch() { Index = (uint)(Index < 7 ? 7 : 10); }
+ public void UpdateRep() { Index = (uint)(Index < 7 ? 8 : 11); }
+ public void UpdateShortRep() { Index = (uint)(Index < 7 ? 9 : 11); }
+ public bool IsCharState() { return Index < 7; }
+ }
+
+ public const int kNumPosSlotBits = 6;
+ public const int kDicLogSizeMin = 0;
+ // public const int kDicLogSizeMax = 30;
+ // public const uint kDistTableSizeMax = kDicLogSizeMax * 2;
+
+ public const int kNumLenToPosStatesBits = 2; // it's for speed optimization
+ public const uint kNumLenToPosStates = 1 << kNumLenToPosStatesBits;
+
+ public const uint kMatchMinLen = 2;
+
+ public static uint GetLenToPosState(uint len)
+ {
+ len -= kMatchMinLen;
+ if (len < kNumLenToPosStates)
+ return len;
+ return (uint)(kNumLenToPosStates - 1);
+ }
+
+ public const int kNumAlignBits = 4;
+ public const uint kAlignTableSize = 1 << kNumAlignBits;
+ public const uint kAlignMask = (kAlignTableSize - 1);
+
+ public const uint kStartPosModelIndex = 4;
+ public const uint kEndPosModelIndex = 14;
+ public const uint kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
+
+ public const uint kNumFullDistances = 1 << ((int)kEndPosModelIndex / 2);
+
+ public const uint kNumLitPosStatesBitsEncodingMax = 4;
+ public const uint kNumLitContextBitsMax = 8;
+
+ public const int kNumPosStatesBitsMax = 4;
+ public const uint kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
+ public const int kNumPosStatesBitsEncodingMax = 4;
+ public const uint kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
+
+ public const int kNumLowLenBits = 3;
+ public const int kNumMidLenBits = 3;
+ public const int kNumHighLenBits = 8;
+ public const uint kNumLowLenSymbols = 1 << kNumLowLenBits;
+ public const uint kNumMidLenSymbols = 1 << kNumMidLenBits;
+ public const uint kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols +
+ (1 << kNumHighLenBits);
+ public const uint kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaDecoder.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaDecoder.cs
new file mode 100644
index 0000000000..00bfe63802
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaDecoder.cs
@@ -0,0 +1,398 @@
+// LzmaDecoder.cs
+
+using System;
+
+namespace SevenZip.Compression.LZMA
+{
+ using RangeCoder;
+
+ public class Decoder : ICoder, ISetDecoderProperties // ,System.IO.Stream
+ {
+ class LenDecoder
+ {
+ BitDecoder m_Choice = new BitDecoder();
+ BitDecoder m_Choice2 = new BitDecoder();
+ BitTreeDecoder[] m_LowCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
+ BitTreeDecoder[] m_MidCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
+ BitTreeDecoder m_HighCoder = new BitTreeDecoder(Base.kNumHighLenBits);
+ uint m_NumPosStates = 0;
+
+ public void Create(uint numPosStates)
+ {
+ for (uint posState = m_NumPosStates; posState < numPosStates; posState++)
+ {
+ m_LowCoder[posState] = new BitTreeDecoder(Base.kNumLowLenBits);
+ m_MidCoder[posState] = new BitTreeDecoder(Base.kNumMidLenBits);
+ }
+ m_NumPosStates = numPosStates;
+ }
+
+ public void Init()
+ {
+ m_Choice.Init();
+ for (uint posState = 0; posState < m_NumPosStates; posState++)
+ {
+ m_LowCoder[posState].Init();
+ m_MidCoder[posState].Init();
+ }
+ m_Choice2.Init();
+ m_HighCoder.Init();
+ }
+
+ public uint Decode(RangeCoder.Decoder rangeDecoder, uint posState)
+ {
+ if (m_Choice.Decode(rangeDecoder) == 0)
+ return m_LowCoder[posState].Decode(rangeDecoder);
+ else
+ {
+ uint symbol = Base.kNumLowLenSymbols;
+ if (m_Choice2.Decode(rangeDecoder) == 0)
+ symbol += m_MidCoder[posState].Decode(rangeDecoder);
+ else
+ {
+ symbol += Base.kNumMidLenSymbols;
+ symbol += m_HighCoder.Decode(rangeDecoder);
+ }
+ return symbol;
+ }
+ }
+ }
+
+ class LiteralDecoder
+ {
+ struct Decoder2
+ {
+ BitDecoder[] m_Decoders;
+ public void Create() { m_Decoders = new BitDecoder[0x300]; }
+ public void Init() { for (int i = 0; i < 0x300; i++) m_Decoders[i].Init(); }
+
+ public byte DecodeNormal(RangeCoder.Decoder rangeDecoder)
+ {
+ uint symbol = 1;
+ do
+ symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
+ while (symbol < 0x100);
+ return (byte)symbol;
+ }
+
+ public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, byte matchByte)
+ {
+ uint symbol = 1;
+ do
+ {
+ uint matchBit = (uint)(matchByte >> 7) & 1;
+ matchByte <<= 1;
+ uint bit = m_Decoders[((1 + matchBit) << 8) + symbol].Decode(rangeDecoder);
+ symbol = (symbol << 1) | bit;
+ if (matchBit != bit)
+ {
+ while (symbol < 0x100)
+ symbol = (symbol << 1) | m_Decoders[symbol].Decode(rangeDecoder);
+ break;
+ }
+ }
+ while (symbol < 0x100);
+ return (byte)symbol;
+ }
+ }
+
+ Decoder2[] m_Coders;
+ int m_NumPrevBits;
+ int m_NumPosBits;
+ uint m_PosMask;
+
+ public void Create(int numPosBits, int numPrevBits)
+ {
+ if (m_Coders != null && m_NumPrevBits == numPrevBits &&
+ m_NumPosBits == numPosBits)
+ return;
+ m_NumPosBits = numPosBits;
+ m_PosMask = ((uint)1 << numPosBits) - 1;
+ m_NumPrevBits = numPrevBits;
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ m_Coders = new Decoder2[numStates];
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Create();
+ }
+
+ public void Init()
+ {
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Init();
+ }
+
+ uint GetState(uint pos, byte prevByte)
+ { return ((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits)); }
+
+ public byte DecodeNormal(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte)
+ { return m_Coders[GetState(pos, prevByte)].DecodeNormal(rangeDecoder); }
+
+ public byte DecodeWithMatchByte(RangeCoder.Decoder rangeDecoder, uint pos, byte prevByte, byte matchByte)
+ { return m_Coders[GetState(pos, prevByte)].DecodeWithMatchByte(rangeDecoder, matchByte); }
+ };
+
+ LZ.OutWindow m_OutWindow = new LZ.OutWindow();
+ RangeCoder.Decoder m_RangeDecoder = new RangeCoder.Decoder();
+
+ BitDecoder[] m_IsMatchDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+ BitDecoder[] m_IsRepDecoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRepG0Decoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRepG1Decoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRepG2Decoders = new BitDecoder[Base.kNumStates];
+ BitDecoder[] m_IsRep0LongDecoders = new BitDecoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+
+ BitTreeDecoder[] m_PosSlotDecoder = new BitTreeDecoder[Base.kNumLenToPosStates];
+ BitDecoder[] m_PosDecoders = new BitDecoder[Base.kNumFullDistances - Base.kEndPosModelIndex];
+
+ BitTreeDecoder m_PosAlignDecoder = new BitTreeDecoder(Base.kNumAlignBits);
+
+ LenDecoder m_LenDecoder = new LenDecoder();
+ LenDecoder m_RepLenDecoder = new LenDecoder();
+
+ LiteralDecoder m_LiteralDecoder = new LiteralDecoder();
+
+ uint m_DictionarySize;
+ uint m_DictionarySizeCheck;
+
+ uint m_PosStateMask;
+
+ public Decoder()
+ {
+ m_DictionarySize = 0xFFFFFFFF;
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ m_PosSlotDecoder[i] = new BitTreeDecoder(Base.kNumPosSlotBits);
+ }
+
+ void SetDictionarySize(uint dictionarySize)
+ {
+ if (m_DictionarySize != dictionarySize)
+ {
+ m_DictionarySize = dictionarySize;
+ m_DictionarySizeCheck = Math.Max(m_DictionarySize, 1);
+ uint blockSize = Math.Max(m_DictionarySizeCheck, (1 << 12));
+ m_OutWindow.Create(blockSize);
+ }
+ }
+
+ void SetLiteralProperties(int lp, int lc)
+ {
+ if (lp > 8)
+ throw new InvalidParamException();
+ if (lc > 8)
+ throw new InvalidParamException();
+ m_LiteralDecoder.Create(lp, lc);
+ }
+
+ void SetPosBitsProperties(int pb)
+ {
+ if (pb > Base.kNumPosStatesBitsMax)
+ throw new InvalidParamException();
+ uint numPosStates = (uint)1 << pb;
+ m_LenDecoder.Create(numPosStates);
+ m_RepLenDecoder.Create(numPosStates);
+ m_PosStateMask = numPosStates - 1;
+ }
+
+ bool _solid = false;
+ void Init(System.IO.Stream inStream, System.IO.Stream outStream)
+ {
+ m_RangeDecoder.Init(inStream);
+ m_OutWindow.Init(outStream, _solid);
+
+ uint i;
+ for (i = 0; i < Base.kNumStates; i++)
+ {
+ for (uint j = 0; j <= m_PosStateMask; j++)
+ {
+ uint index = (i << Base.kNumPosStatesBitsMax) + j;
+ m_IsMatchDecoders[index].Init();
+ m_IsRep0LongDecoders[index].Init();
+ }
+ m_IsRepDecoders[i].Init();
+ m_IsRepG0Decoders[i].Init();
+ m_IsRepG1Decoders[i].Init();
+ m_IsRepG2Decoders[i].Init();
+ }
+
+ m_LiteralDecoder.Init();
+ for (i = 0; i < Base.kNumLenToPosStates; i++)
+ m_PosSlotDecoder[i].Init();
+ // m_PosSpecDecoder.Init();
+ for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++)
+ m_PosDecoders[i].Init();
+
+ m_LenDecoder.Init();
+ m_RepLenDecoder.Init();
+ m_PosAlignDecoder.Init();
+ }
+
+ public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize, ICodeProgress progress)
+ {
+ Init(inStream, outStream);
+
+ Base.State state = new Base.State();
+ state.Init();
+ uint rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0;
+
+ UInt64 nowPos64 = 0;
+ UInt64 outSize64 = (UInt64)outSize;
+ if (nowPos64 < outSize64)
+ {
+ if (m_IsMatchDecoders[state.Index << Base.kNumPosStatesBitsMax].Decode(m_RangeDecoder) != 0)
+ throw new DataErrorException();
+ state.UpdateChar();
+ byte b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, 0, 0);
+ m_OutWindow.PutByte(b);
+ nowPos64++;
+ }
+ while (nowPos64 < outSize64)
+ {
+ // UInt64 next = Math.Min(nowPos64 + (1 << 18), outSize64);
+ // while(nowPos64 < next)
+ {
+ uint posState = (uint)nowPos64 & m_PosStateMask;
+ if (m_IsMatchDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
+ {
+ byte b;
+ byte prevByte = m_OutWindow.GetByte(0);
+ if (!state.IsCharState())
+ b = m_LiteralDecoder.DecodeWithMatchByte(m_RangeDecoder,
+ (uint)nowPos64, prevByte, m_OutWindow.GetByte(rep0));
+ else
+ b = m_LiteralDecoder.DecodeNormal(m_RangeDecoder, (uint)nowPos64, prevByte);
+ m_OutWindow.PutByte(b);
+ state.UpdateChar();
+ nowPos64++;
+ }
+ else
+ {
+ uint len;
+ if (m_IsRepDecoders[state.Index].Decode(m_RangeDecoder) == 1)
+ {
+ if (m_IsRepG0Decoders[state.Index].Decode(m_RangeDecoder) == 0)
+ {
+ if (m_IsRep0LongDecoders[(state.Index << Base.kNumPosStatesBitsMax) + posState].Decode(m_RangeDecoder) == 0)
+ {
+ state.UpdateShortRep();
+ m_OutWindow.PutByte(m_OutWindow.GetByte(rep0));
+ nowPos64++;
+ continue;
+ }
+ }
+ else
+ {
+ UInt32 distance;
+ if (m_IsRepG1Decoders[state.Index].Decode(m_RangeDecoder) == 0)
+ {
+ distance = rep1;
+ }
+ else
+ {
+ if (m_IsRepG2Decoders[state.Index].Decode(m_RangeDecoder) == 0)
+ distance = rep2;
+ else
+ {
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ len = m_RepLenDecoder.Decode(m_RangeDecoder, posState) + Base.kMatchMinLen;
+ state.UpdateRep();
+ }
+ else
+ {
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ len = Base.kMatchMinLen + m_LenDecoder.Decode(m_RangeDecoder, posState);
+ state.UpdateMatch();
+ uint posSlot = m_PosSlotDecoder[Base.GetLenToPosState(len)].Decode(m_RangeDecoder);
+ if (posSlot >= Base.kStartPosModelIndex)
+ {
+ int numDirectBits = (int)((posSlot >> 1) - 1);
+ rep0 = ((2 | (posSlot & 1)) << numDirectBits);
+ if (posSlot < Base.kEndPosModelIndex)
+ rep0 += BitTreeDecoder.ReverseDecode(m_PosDecoders,
+ rep0 - posSlot - 1, m_RangeDecoder, numDirectBits);
+ else
+ {
+ rep0 += (m_RangeDecoder.DecodeDirectBits(
+ numDirectBits - Base.kNumAlignBits) << Base.kNumAlignBits);
+ rep0 += m_PosAlignDecoder.ReverseDecode(m_RangeDecoder);
+ }
+ }
+ else
+ rep0 = posSlot;
+ }
+ if (rep0 >= m_OutWindow.TrainSize + nowPos64 || rep0 >= m_DictionarySizeCheck)
+ {
+ if (rep0 == 0xFFFFFFFF)
+ break;
+ throw new DataErrorException();
+ }
+ m_OutWindow.CopyBlock(rep0, len);
+ nowPos64 += len;
+ }
+ }
+ }
+ m_OutWindow.Flush();
+ m_OutWindow.ReleaseStream();
+ m_RangeDecoder.ReleaseStream();
+ }
+
+ public void SetDecoderProperties(byte[] properties)
+ {
+ if (properties.Length < 5)
+ throw new InvalidParamException();
+ int lc = properties[0] % 9;
+ int remainder = properties[0] / 9;
+ int lp = remainder % 5;
+ int pb = remainder / 5;
+ if (pb > Base.kNumPosStatesBitsMax)
+ throw new InvalidParamException();
+ UInt32 dictionarySize = 0;
+ for (int i = 0; i < 4; i++)
+ dictionarySize += ((UInt32)(properties[1 + i])) << (i * 8);
+ SetDictionarySize(dictionarySize);
+ SetLiteralProperties(lp, lc);
+ SetPosBitsProperties(pb);
+ }
+
+ public bool Train(System.IO.Stream stream)
+ {
+ _solid = true;
+ return m_OutWindow.Train(stream);
+ }
+
+ /*
+ public override bool CanRead { get { return true; }}
+ public override bool CanWrite { get { return true; }}
+ public override bool CanSeek { get { return true; }}
+ public override long Length { get { return 0; }}
+ public override long Position
+ {
+ get { return 0; }
+ set { }
+ }
+ public override void Flush() { }
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ return 0;
+ }
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ }
+ public override long Seek(long offset, System.IO.SeekOrigin origin)
+ {
+ return 0;
+ }
+ public override void SetLength(long value) {}
+ */
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaEncoder.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaEncoder.cs
new file mode 100644
index 0000000000..6dc2708bdf
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LZMA/LzmaEncoder.cs
@@ -0,0 +1,1480 @@
+// LzmaEncoder.cs
+
+using System;
+
+namespace SevenZip.Compression.LZMA
+{
+ using RangeCoder;
+
+ public class Encoder : ICoder, ISetCoderProperties, IWriteCoderProperties
+ {
+ enum EMatchFinderType
+ {
+ BT2,
+ BT4,
+ };
+
+ const UInt32 kIfinityPrice = 0xFFFFFFF;
+
+ static Byte[] g_FastPos = new Byte[1 << 11];
+
+ static Encoder()
+ {
+ const Byte kFastSlots = 22;
+ int c = 2;
+ g_FastPos[0] = 0;
+ g_FastPos[1] = 1;
+ for (Byte slotFast = 2; slotFast < kFastSlots; slotFast++)
+ {
+ UInt32 k = ((UInt32)1 << ((slotFast >> 1) - 1));
+ for (UInt32 j = 0; j < k; j++, c++)
+ g_FastPos[c] = slotFast;
+ }
+ }
+
+ static UInt32 GetPosSlot(UInt32 pos)
+ {
+ if (pos < (1 << 11))
+ return g_FastPos[pos];
+ if (pos < (1 << 21))
+ return (UInt32)(g_FastPos[pos >> 10] + 20);
+ return (UInt32)(g_FastPos[pos >> 20] + 40);
+ }
+
+ static UInt32 GetPosSlot2(UInt32 pos)
+ {
+ if (pos < (1 << 17))
+ return (UInt32)(g_FastPos[pos >> 6] + 12);
+ if (pos < (1 << 27))
+ return (UInt32)(g_FastPos[pos >> 16] + 32);
+ return (UInt32)(g_FastPos[pos >> 26] + 52);
+ }
+
+ Base.State _state = new Base.State();
+ Byte _previousByte;
+ UInt32[] _repDistances = new UInt32[Base.kNumRepDistances];
+
+ void BaseInit()
+ {
+ _state.Init();
+ _previousByte = 0;
+ for (UInt32 i = 0; i < Base.kNumRepDistances; i++)
+ _repDistances[i] = 0;
+ }
+
+ const int kDefaultDictionaryLogSize = 22;
+ const UInt32 kNumFastBytesDefault = 0x20;
+
+ class LiteralEncoder
+ {
+ public struct Encoder2
+ {
+ BitEncoder[] m_Encoders;
+
+ public void Create() { m_Encoders = new BitEncoder[0x300]; }
+
+ public void Init() { for (int i = 0; i < 0x300; i++) m_Encoders[i].Init(); }
+
+ public void Encode(RangeCoder.Encoder rangeEncoder, byte symbol)
+ {
+ uint context = 1;
+ for (int i = 7; i >= 0; i--)
+ {
+ uint bit = (uint)((symbol >> i) & 1);
+ m_Encoders[context].Encode(rangeEncoder, bit);
+ context = (context << 1) | bit;
+ }
+ }
+
+ public void EncodeMatched(RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol)
+ {
+ uint context = 1;
+ bool same = true;
+ for (int i = 7; i >= 0; i--)
+ {
+ uint bit = (uint)((symbol >> i) & 1);
+ uint state = context;
+ if (same)
+ {
+ uint matchBit = (uint)((matchByte >> i) & 1);
+ state += ((1 + matchBit) << 8);
+ same = (matchBit == bit);
+ }
+ m_Encoders[state].Encode(rangeEncoder, bit);
+ context = (context << 1) | bit;
+ }
+ }
+
+ public uint GetPrice(bool matchMode, byte matchByte, byte symbol)
+ {
+ uint price = 0;
+ uint context = 1;
+ int i = 7;
+ if (matchMode)
+ {
+ for (; i >= 0; i--)
+ {
+ uint matchBit = (uint)(matchByte >> i) & 1;
+ uint bit = (uint)(symbol >> i) & 1;
+ price += m_Encoders[((1 + matchBit) << 8) + context].GetPrice(bit);
+ context = (context << 1) | bit;
+ if (matchBit != bit)
+ {
+ i--;
+ break;
+ }
+ }
+ }
+ for (; i >= 0; i--)
+ {
+ uint bit = (uint)(symbol >> i) & 1;
+ price += m_Encoders[context].GetPrice(bit);
+ context = (context << 1) | bit;
+ }
+ return price;
+ }
+ }
+
+ Encoder2[] m_Coders;
+ int m_NumPrevBits;
+ int m_NumPosBits;
+ uint m_PosMask;
+
+ public void Create(int numPosBits, int numPrevBits)
+ {
+ if (m_Coders != null && m_NumPrevBits == numPrevBits && m_NumPosBits == numPosBits)
+ return;
+ m_NumPosBits = numPosBits;
+ m_PosMask = ((uint)1 << numPosBits) - 1;
+ m_NumPrevBits = numPrevBits;
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ m_Coders = new Encoder2[numStates];
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Create();
+ }
+
+ public void Init()
+ {
+ uint numStates = (uint)1 << (m_NumPrevBits + m_NumPosBits);
+ for (uint i = 0; i < numStates; i++)
+ m_Coders[i].Init();
+ }
+
+ public Encoder2 GetSubCoder(UInt32 pos, Byte prevByte)
+ { return m_Coders[((pos & m_PosMask) << m_NumPrevBits) + (uint)(prevByte >> (8 - m_NumPrevBits))]; }
+ }
+
+ class LenEncoder
+ {
+ RangeCoder.BitEncoder _choice = new RangeCoder.BitEncoder();
+ RangeCoder.BitEncoder _choice2 = new RangeCoder.BitEncoder();
+ RangeCoder.BitTreeEncoder[] _lowCoder = new RangeCoder.BitTreeEncoder[Base.kNumPosStatesEncodingMax];
+ RangeCoder.BitTreeEncoder[] _midCoder = new RangeCoder.BitTreeEncoder[Base.kNumPosStatesEncodingMax];
+ RangeCoder.BitTreeEncoder _highCoder = new RangeCoder.BitTreeEncoder(Base.kNumHighLenBits);
+
+ public LenEncoder()
+ {
+ for (UInt32 posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++)
+ {
+ _lowCoder[posState] = new RangeCoder.BitTreeEncoder(Base.kNumLowLenBits);
+ _midCoder[posState] = new RangeCoder.BitTreeEncoder(Base.kNumMidLenBits);
+ }
+ }
+
+ public void Init(UInt32 numPosStates)
+ {
+ _choice.Init();
+ _choice2.Init();
+ for (UInt32 posState = 0; posState < numPosStates; posState++)
+ {
+ _lowCoder[posState].Init();
+ _midCoder[posState].Init();
+ }
+ _highCoder.Init();
+ }
+
+ public void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState)
+ {
+ if (symbol < Base.kNumLowLenSymbols)
+ {
+ _choice.Encode(rangeEncoder, 0);
+ _lowCoder[posState].Encode(rangeEncoder, symbol);
+ }
+ else
+ {
+ symbol -= Base.kNumLowLenSymbols;
+ _choice.Encode(rangeEncoder, 1);
+ if (symbol < Base.kNumMidLenSymbols)
+ {
+ _choice2.Encode(rangeEncoder, 0);
+ _midCoder[posState].Encode(rangeEncoder, symbol);
+ }
+ else
+ {
+ _choice2.Encode(rangeEncoder, 1);
+ _highCoder.Encode(rangeEncoder, symbol - Base.kNumMidLenSymbols);
+ }
+ }
+ }
+
+ public void SetPrices(UInt32 posState, UInt32 numSymbols, UInt32[] prices, UInt32 st)
+ {
+ UInt32 a0 = _choice.GetPrice0();
+ UInt32 a1 = _choice.GetPrice1();
+ UInt32 b0 = a1 + _choice2.GetPrice0();
+ UInt32 b1 = a1 + _choice2.GetPrice1();
+ UInt32 i = 0;
+ for (i = 0; i < Base.kNumLowLenSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[st + i] = a0 + _lowCoder[posState].GetPrice(i);
+ }
+ for (; i < Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[st + i] = b0 + _midCoder[posState].GetPrice(i - Base.kNumLowLenSymbols);
+ }
+ for (; i < numSymbols; i++)
+ prices[st + i] = b1 + _highCoder.GetPrice(i - Base.kNumLowLenSymbols - Base.kNumMidLenSymbols);
+ }
+ };
+
+ const UInt32 kNumLenSpecSymbols = Base.kNumLowLenSymbols + Base.kNumMidLenSymbols;
+
+ class LenPriceTableEncoder : LenEncoder
+ {
+ UInt32[] _prices = new UInt32[Base.kNumLenSymbols << Base.kNumPosStatesBitsEncodingMax];
+ UInt32 _tableSize;
+ UInt32[] _counters = new UInt32[Base.kNumPosStatesEncodingMax];
+
+ public void SetTableSize(UInt32 tableSize) { _tableSize = tableSize; }
+
+ public UInt32 GetPrice(UInt32 symbol, UInt32 posState)
+ {
+ return _prices[posState * Base.kNumLenSymbols + symbol];
+ }
+
+ void UpdateTable(UInt32 posState)
+ {
+ SetPrices(posState, _tableSize, _prices, posState * Base.kNumLenSymbols);
+ _counters[posState] = _tableSize;
+ }
+
+ public void UpdateTables(UInt32 numPosStates)
+ {
+ for (UInt32 posState = 0; posState < numPosStates; posState++)
+ UpdateTable(posState);
+ }
+
+ public new void Encode(RangeCoder.Encoder rangeEncoder, UInt32 symbol, UInt32 posState)
+ {
+ base.Encode(rangeEncoder, symbol, posState);
+ if (--_counters[posState] == 0)
+ UpdateTable(posState);
+ }
+ }
+
+ const UInt32 kNumOpts = 1 << 12;
+ class Optimal
+ {
+ public Base.State State;
+
+ public bool Prev1IsChar;
+ public bool Prev2;
+
+ public UInt32 PosPrev2;
+ public UInt32 BackPrev2;
+
+ public UInt32 Price;
+ public UInt32 PosPrev;
+ public UInt32 BackPrev;
+
+ public UInt32 Backs0;
+ public UInt32 Backs1;
+ public UInt32 Backs2;
+ public UInt32 Backs3;
+
+ public void MakeAsChar() { BackPrev = 0xFFFFFFFF; Prev1IsChar = false; }
+ public void MakeAsShortRep() { BackPrev = 0; ; Prev1IsChar = false; }
+ public bool IsShortRep() { return (BackPrev == 0); }
+ };
+ Optimal[] _optimum = new Optimal[kNumOpts];
+ LZ.IMatchFinder _matchFinder = null;
+ RangeCoder.Encoder _rangeEncoder = new RangeCoder.Encoder();
+
+ RangeCoder.BitEncoder[] _isMatch = new RangeCoder.BitEncoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+ RangeCoder.BitEncoder[] _isRep = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRepG0 = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRepG1 = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRepG2 = new RangeCoder.BitEncoder[Base.kNumStates];
+ RangeCoder.BitEncoder[] _isRep0Long = new RangeCoder.BitEncoder[Base.kNumStates << Base.kNumPosStatesBitsMax];
+
+ RangeCoder.BitTreeEncoder[] _posSlotEncoder = new RangeCoder.BitTreeEncoder[Base.kNumLenToPosStates];
+
+ RangeCoder.BitEncoder[] _posEncoders = new RangeCoder.BitEncoder[Base.kNumFullDistances - Base.kEndPosModelIndex];
+ RangeCoder.BitTreeEncoder _posAlignEncoder = new RangeCoder.BitTreeEncoder(Base.kNumAlignBits);
+
+ LenPriceTableEncoder _lenEncoder = new LenPriceTableEncoder();
+ LenPriceTableEncoder _repMatchLenEncoder = new LenPriceTableEncoder();
+
+ LiteralEncoder _literalEncoder = new LiteralEncoder();
+
+ UInt32[] _matchDistances = new UInt32[Base.kMatchMaxLen * 2 + 2];
+
+ UInt32 _numFastBytes = kNumFastBytesDefault;
+ UInt32 _longestMatchLength;
+ UInt32 _numDistancePairs;
+
+ UInt32 _additionalOffset;
+
+ UInt32 _optimumEndIndex;
+ UInt32 _optimumCurrentIndex;
+
+ bool _longestMatchWasFound;
+
+ UInt32[] _posSlotPrices = new UInt32[1 << (Base.kNumPosSlotBits + Base.kNumLenToPosStatesBits)];
+ UInt32[] _distancesPrices = new UInt32[Base.kNumFullDistances << Base.kNumLenToPosStatesBits];
+ UInt32[] _alignPrices = new UInt32[Base.kAlignTableSize];
+ UInt32 _alignPriceCount;
+
+ UInt32 _distTableSize = (kDefaultDictionaryLogSize * 2);
+
+ int _posStateBits = 2;
+ UInt32 _posStateMask = (4 - 1);
+ int _numLiteralPosStateBits = 0;
+ int _numLiteralContextBits = 3;
+
+ UInt32 _dictionarySize = (1 << kDefaultDictionaryLogSize);
+ UInt32 _dictionarySizePrev = 0xFFFFFFFF;
+ UInt32 _numFastBytesPrev = 0xFFFFFFFF;
+
+ Int64 nowPos64;
+ bool _finished;
+ System.IO.Stream _inStream;
+
+ EMatchFinderType _matchFinderType = EMatchFinderType.BT4;
+ bool _writeEndMark = false;
+
+ bool _needReleaseMFStream;
+
+ void Create()
+ {
+ if (_matchFinder == null)
+ {
+ LZ.BinTree bt = new LZ.BinTree();
+ int numHashBytes = 4;
+ if (_matchFinderType == EMatchFinderType.BT2)
+ numHashBytes = 2;
+ bt.SetType(numHashBytes);
+ _matchFinder = bt;
+ }
+ _literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits);
+
+ if (_dictionarySize == _dictionarySizePrev && _numFastBytesPrev == _numFastBytes)
+ return;
+ _matchFinder.Create(_dictionarySize, kNumOpts, _numFastBytes, Base.kMatchMaxLen + 1);
+ _dictionarySizePrev = _dictionarySize;
+ _numFastBytesPrev = _numFastBytes;
+ }
+
+ public Encoder()
+ {
+ for (int i = 0; i < kNumOpts; i++)
+ _optimum[i] = new Optimal();
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ _posSlotEncoder[i] = new RangeCoder.BitTreeEncoder(Base.kNumPosSlotBits);
+ }
+
+ void SetWriteEndMarkerMode(bool writeEndMarker)
+ {
+ _writeEndMark = writeEndMarker;
+ }
+
+ void Init()
+ {
+ BaseInit();
+ _rangeEncoder.Init();
+
+ uint i;
+ for (i = 0; i < Base.kNumStates; i++)
+ {
+ for (uint j = 0; j <= _posStateMask; j++)
+ {
+ uint complexState = (i << Base.kNumPosStatesBitsMax) + j;
+ _isMatch[complexState].Init();
+ _isRep0Long[complexState].Init();
+ }
+ _isRep[i].Init();
+ _isRepG0[i].Init();
+ _isRepG1[i].Init();
+ _isRepG2[i].Init();
+ }
+ _literalEncoder.Init();
+ for (i = 0; i < Base.kNumLenToPosStates; i++)
+ _posSlotEncoder[i].Init();
+ for (i = 0; i < Base.kNumFullDistances - Base.kEndPosModelIndex; i++)
+ _posEncoders[i].Init();
+
+ _lenEncoder.Init((UInt32)1 << _posStateBits);
+ _repMatchLenEncoder.Init((UInt32)1 << _posStateBits);
+
+ _posAlignEncoder.Init();
+
+ _longestMatchWasFound = false;
+ _optimumEndIndex = 0;
+ _optimumCurrentIndex = 0;
+ _additionalOffset = 0;
+ }
+
+ void ReadMatchDistances(out UInt32 lenRes, out UInt32 numDistancePairs)
+ {
+ lenRes = 0;
+ numDistancePairs = _matchFinder.GetMatches(_matchDistances);
+ if (numDistancePairs > 0)
+ {
+ lenRes = _matchDistances[numDistancePairs - 2];
+ if (lenRes == _numFastBytes)
+ lenRes += _matchFinder.GetMatchLen((int)lenRes - 1, _matchDistances[numDistancePairs - 1],
+ Base.kMatchMaxLen - lenRes);
+ }
+ _additionalOffset++;
+ }
+
+
+ void MovePos(UInt32 num)
+ {
+ if (num > 0)
+ {
+ _matchFinder.Skip(num);
+ _additionalOffset += num;
+ }
+ }
+
+ UInt32 GetRepLen1Price(Base.State state, UInt32 posState)
+ {
+ return _isRepG0[state.Index].GetPrice0() +
+ _isRep0Long[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0();
+ }
+
+ UInt32 GetPureRepPrice(UInt32 repIndex, Base.State state, UInt32 posState)
+ {
+ UInt32 price;
+ if (repIndex == 0)
+ {
+ price = _isRepG0[state.Index].GetPrice0();
+ price += _isRep0Long[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
+ }
+ else
+ {
+ price = _isRepG0[state.Index].GetPrice1();
+ if (repIndex == 1)
+ price += _isRepG1[state.Index].GetPrice0();
+ else
+ {
+ price += _isRepG1[state.Index].GetPrice1();
+ price += _isRepG2[state.Index].GetPrice(repIndex - 2);
+ }
+ }
+ return price;
+ }
+
+ UInt32 GetRepPrice(UInt32 repIndex, UInt32 len, Base.State state, UInt32 posState)
+ {
+ UInt32 price = _repMatchLenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
+ return price + GetPureRepPrice(repIndex, state, posState);
+ }
+
+ UInt32 GetPosLenPrice(UInt32 pos, UInt32 len, UInt32 posState)
+ {
+ UInt32 price;
+ UInt32 lenToPosState = Base.GetLenToPosState(len);
+ if (pos < Base.kNumFullDistances)
+ price = _distancesPrices[(lenToPosState * Base.kNumFullDistances) + pos];
+ else
+ price = _posSlotPrices[(lenToPosState << Base.kNumPosSlotBits) + GetPosSlot2(pos)] +
+ _alignPrices[pos & Base.kAlignMask];
+ return price + _lenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
+ }
+
+ UInt32 Backward(out UInt32 backRes, UInt32 cur)
+ {
+ _optimumEndIndex = cur;
+ UInt32 posMem = _optimum[cur].PosPrev;
+ UInt32 backMem = _optimum[cur].BackPrev;
+ do
+ {
+ if (_optimum[cur].Prev1IsChar)
+ {
+ _optimum[posMem].MakeAsChar();
+ _optimum[posMem].PosPrev = posMem - 1;
+ if (_optimum[cur].Prev2)
+ {
+ _optimum[posMem - 1].Prev1IsChar = false;
+ _optimum[posMem - 1].PosPrev = _optimum[cur].PosPrev2;
+ _optimum[posMem - 1].BackPrev = _optimum[cur].BackPrev2;
+ }
+ }
+ UInt32 posPrev = posMem;
+ UInt32 backCur = backMem;
+
+ backMem = _optimum[posPrev].BackPrev;
+ posMem = _optimum[posPrev].PosPrev;
+
+ _optimum[posPrev].BackPrev = backCur;
+ _optimum[posPrev].PosPrev = cur;
+ cur = posPrev;
+ }
+ while (cur > 0);
+ backRes = _optimum[0].BackPrev;
+ _optimumCurrentIndex = _optimum[0].PosPrev;
+ return _optimumCurrentIndex;
+ }
+
+ UInt32[] reps = new UInt32[Base.kNumRepDistances];
+ UInt32[] repLens = new UInt32[Base.kNumRepDistances];
+
+
+ UInt32 GetOptimum(UInt32 position, out UInt32 backRes)
+ {
+ if (_optimumEndIndex != _optimumCurrentIndex)
+ {
+ UInt32 lenRes = _optimum[_optimumCurrentIndex].PosPrev - _optimumCurrentIndex;
+ backRes = _optimum[_optimumCurrentIndex].BackPrev;
+ _optimumCurrentIndex = _optimum[_optimumCurrentIndex].PosPrev;
+ return lenRes;
+ }
+ _optimumCurrentIndex = _optimumEndIndex = 0;
+
+ UInt32 lenMain, numDistancePairs;
+ if (!_longestMatchWasFound)
+ {
+ ReadMatchDistances(out lenMain, out numDistancePairs);
+ }
+ else
+ {
+ lenMain = _longestMatchLength;
+ numDistancePairs = _numDistancePairs;
+ _longestMatchWasFound = false;
+ }
+
+ UInt32 numAvailableBytes = _matchFinder.GetNumAvailableBytes() + 1;
+ if (numAvailableBytes < 2)
+ {
+ backRes = 0xFFFFFFFF;
+ return 1;
+ }
+ if (numAvailableBytes > Base.kMatchMaxLen)
+ numAvailableBytes = Base.kMatchMaxLen;
+
+ UInt32 repMaxIndex = 0;
+ UInt32 i;
+ for (i = 0; i < Base.kNumRepDistances; i++)
+ {
+ reps[i] = _repDistances[i];
+ repLens[i] = _matchFinder.GetMatchLen(0 - 1, reps[i], Base.kMatchMaxLen);
+ if (repLens[i] > repLens[repMaxIndex])
+ repMaxIndex = i;
+ }
+ if (repLens[repMaxIndex] >= _numFastBytes)
+ {
+ backRes = repMaxIndex;
+ UInt32 lenRes = repLens[repMaxIndex];
+ MovePos(lenRes - 1);
+ return lenRes;
+ }
+
+ if (lenMain >= _numFastBytes)
+ {
+ backRes = _matchDistances[numDistancePairs - 1] + Base.kNumRepDistances;
+ MovePos(lenMain - 1);
+ return lenMain;
+ }
+
+ Byte currentByte = _matchFinder.GetIndexByte(0 - 1);
+ Byte matchByte = _matchFinder.GetIndexByte((Int32)(0 - _repDistances[0] - 1 - 1));
+
+ if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2)
+ {
+ backRes = (UInt32)0xFFFFFFFF;
+ return 1;
+ }
+
+ _optimum[0].State = _state;
+
+ UInt32 posState = (position & _posStateMask);
+
+ _optimum[1].Price = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0() +
+ _literalEncoder.GetSubCoder(position, _previousByte).GetPrice(!_state.IsCharState(), matchByte, currentByte);
+ _optimum[1].MakeAsChar();
+
+ UInt32 matchPrice = _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
+ UInt32 repMatchPrice = matchPrice + _isRep[_state.Index].GetPrice1();
+
+ if (matchByte == currentByte)
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(_state, posState);
+ if (shortRepPrice < _optimum[1].Price)
+ {
+ _optimum[1].Price = shortRepPrice;
+ _optimum[1].MakeAsShortRep();
+ }
+ }
+
+ UInt32 lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]);
+
+ if(lenEnd < 2)
+ {
+ backRes = _optimum[1].BackPrev;
+ return 1;
+ }
+
+ _optimum[1].PosPrev = 0;
+
+ _optimum[0].Backs0 = reps[0];
+ _optimum[0].Backs1 = reps[1];
+ _optimum[0].Backs2 = reps[2];
+ _optimum[0].Backs3 = reps[3];
+
+ UInt32 len = lenEnd;
+ do
+ _optimum[len--].Price = kIfinityPrice;
+ while (len >= 2);
+
+ for (i = 0; i < Base.kNumRepDistances; i++)
+ {
+ UInt32 repLen = repLens[i];
+ if (repLen < 2)
+ continue;
+ UInt32 price = repMatchPrice + GetPureRepPrice(i, _state, posState);
+ do
+ {
+ UInt32 curAndLenPrice = price + _repMatchLenEncoder.GetPrice(repLen - 2, posState);
+ Optimal optimum = _optimum[repLen];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = 0;
+ optimum.BackPrev = i;
+ optimum.Prev1IsChar = false;
+ }
+ }
+ while (--repLen >= 2);
+ }
+
+ UInt32 normalMatchPrice = matchPrice + _isRep[_state.Index].GetPrice0();
+
+ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
+ if (len <= lenMain)
+ {
+ UInt32 offs = 0;
+ while (len > _matchDistances[offs])
+ offs += 2;
+ for (; ; len++)
+ {
+ UInt32 distance = _matchDistances[offs + 1];
+ UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(distance, len, posState);
+ Optimal optimum = _optimum[len];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = 0;
+ optimum.BackPrev = distance + Base.kNumRepDistances;
+ optimum.Prev1IsChar = false;
+ }
+ if (len == _matchDistances[offs])
+ {
+ offs += 2;
+ if (offs == numDistancePairs)
+ break;
+ }
+ }
+ }
+
+ UInt32 cur = 0;
+
+ while (true)
+ {
+ cur++;
+ if (cur == lenEnd)
+ return Backward(out backRes, cur);
+ UInt32 newLen;
+ ReadMatchDistances(out newLen, out numDistancePairs);
+ if (newLen >= _numFastBytes)
+ {
+ _numDistancePairs = numDistancePairs;
+ _longestMatchLength = newLen;
+ _longestMatchWasFound = true;
+ return Backward(out backRes, cur);
+ }
+ position++;
+ UInt32 posPrev = _optimum[cur].PosPrev;
+ Base.State state;
+ if (_optimum[cur].Prev1IsChar)
+ {
+ posPrev--;
+ if (_optimum[cur].Prev2)
+ {
+ state = _optimum[_optimum[cur].PosPrev2].State;
+ if (_optimum[cur].BackPrev2 < Base.kNumRepDistances)
+ state.UpdateRep();
+ else
+ state.UpdateMatch();
+ }
+ else
+ state = _optimum[posPrev].State;
+ state.UpdateChar();
+ }
+ else
+ state = _optimum[posPrev].State;
+ if (posPrev == cur - 1)
+ {
+ if (_optimum[cur].IsShortRep())
+ state.UpdateShortRep();
+ else
+ state.UpdateChar();
+ }
+ else
+ {
+ UInt32 pos;
+ if (_optimum[cur].Prev1IsChar && _optimum[cur].Prev2)
+ {
+ posPrev = _optimum[cur].PosPrev2;
+ pos = _optimum[cur].BackPrev2;
+ state.UpdateRep();
+ }
+ else
+ {
+ pos = _optimum[cur].BackPrev;
+ if (pos < Base.kNumRepDistances)
+ state.UpdateRep();
+ else
+ state.UpdateMatch();
+ }
+ Optimal opt = _optimum[posPrev];
+ if (pos < Base.kNumRepDistances)
+ {
+ if (pos == 0)
+ {
+ reps[0] = opt.Backs0;
+ reps[1] = opt.Backs1;
+ reps[2] = opt.Backs2;
+ reps[3] = opt.Backs3;
+ }
+ else if (pos == 1)
+ {
+ reps[0] = opt.Backs1;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs2;
+ reps[3] = opt.Backs3;
+ }
+ else if (pos == 2)
+ {
+ reps[0] = opt.Backs2;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs3;
+ }
+ else
+ {
+ reps[0] = opt.Backs3;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs2;
+ }
+ }
+ else
+ {
+ reps[0] = (pos - Base.kNumRepDistances);
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs2;
+ }
+ }
+ _optimum[cur].State = state;
+ _optimum[cur].Backs0 = reps[0];
+ _optimum[cur].Backs1 = reps[1];
+ _optimum[cur].Backs2 = reps[2];
+ _optimum[cur].Backs3 = reps[3];
+ UInt32 curPrice = _optimum[cur].Price;
+
+ currentByte = _matchFinder.GetIndexByte(0 - 1);
+ matchByte = _matchFinder.GetIndexByte((Int32)(0 - reps[0] - 1 - 1));
+
+ posState = (position & _posStateMask);
+
+ UInt32 curAnd1Price = curPrice +
+ _isMatch[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice0() +
+ _literalEncoder.GetSubCoder(position, _matchFinder.GetIndexByte(0 - 2)).
+ GetPrice(!state.IsCharState(), matchByte, currentByte);
+
+ Optimal nextOptimum = _optimum[cur + 1];
+
+ bool nextIsChar = false;
+ if (curAnd1Price < nextOptimum.Price)
+ {
+ nextOptimum.Price = curAnd1Price;
+ nextOptimum.PosPrev = cur;
+ nextOptimum.MakeAsChar();
+ nextIsChar = true;
+ }
+
+ matchPrice = curPrice + _isMatch[(state.Index << Base.kNumPosStatesBitsMax) + posState].GetPrice1();
+ repMatchPrice = matchPrice + _isRep[state.Index].GetPrice1();
+
+ if (matchByte == currentByte &&
+ !(nextOptimum.PosPrev < cur && nextOptimum.BackPrev == 0))
+ {
+ UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(state, posState);
+ if (shortRepPrice <= nextOptimum.Price)
+ {
+ nextOptimum.Price = shortRepPrice;
+ nextOptimum.PosPrev = cur;
+ nextOptimum.MakeAsShortRep();
+ nextIsChar = true;
+ }
+ }
+
+ UInt32 numAvailableBytesFull = _matchFinder.GetNumAvailableBytes() + 1;
+ numAvailableBytesFull = Math.Min(kNumOpts - 1 - cur, numAvailableBytesFull);
+ numAvailableBytes = numAvailableBytesFull;
+
+ if (numAvailableBytes < 2)
+ continue;
+ if (numAvailableBytes > _numFastBytes)
+ numAvailableBytes = _numFastBytes;
+ if (!nextIsChar && matchByte != currentByte)
+ {
+ // try Literal + rep0
+ UInt32 t = Math.Min(numAvailableBytesFull - 1, _numFastBytes);
+ UInt32 lenTest2 = _matchFinder.GetMatchLen(0, reps[0], t);
+ if (lenTest2 >= 2)
+ {
+ Base.State state2 = state;
+ state2.UpdateChar();
+ UInt32 posStateNext = (position + 1) & _posStateMask;
+ UInt32 nextRepMatchPrice = curAnd1Price +
+ _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1() +
+ _isRep[state2.Index].GetPrice1();
+ {
+ UInt32 offset = cur + 1 + lenTest2;
+ while (lenEnd < offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(
+ 0, lenTest2, state2, posStateNext);
+ Optimal optimum = _optimum[offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = false;
+ }
+ }
+ }
+ }
+
+ UInt32 startLen = 2; // speed optimization
+
+ for (UInt32 repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++)
+ {
+ UInt32 lenTest = _matchFinder.GetMatchLen(0 - 1, reps[repIndex], numAvailableBytes);
+ if (lenTest < 2)
+ continue;
+ UInt32 lenTestTemp = lenTest;
+ do
+ {
+ while (lenEnd < cur + lenTest)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ UInt32 curAndLenPrice = repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState);
+ Optimal optimum = _optimum[cur + lenTest];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur;
+ optimum.BackPrev = repIndex;
+ optimum.Prev1IsChar = false;
+ }
+ }
+ while(--lenTest >= 2);
+ lenTest = lenTestTemp;
+
+ if (repIndex == 0)
+ startLen = lenTest + 1;
+
+ // if (_maxMode)
+ if (lenTest < numAvailableBytesFull)
+ {
+ UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
+ UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, reps[repIndex], t);
+ if (lenTest2 >= 2)
+ {
+ Base.State state2 = state;
+ state2.UpdateRep();
+ UInt32 posStateNext = (position + lenTest) & _posStateMask;
+ UInt32 curAndLenCharPrice =
+ repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState) +
+ _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice0() +
+ _literalEncoder.GetSubCoder(position + lenTest,
+ _matchFinder.GetIndexByte((Int32)lenTest - 1 - 1)).GetPrice(true,
+ _matchFinder.GetIndexByte((Int32)((Int32)lenTest - 1 - (Int32)(reps[repIndex] + 1))),
+ _matchFinder.GetIndexByte((Int32)lenTest - 1));
+ state2.UpdateChar();
+ posStateNext = (position + lenTest + 1) & _posStateMask;
+ UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1();
+ UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1();
+
+ // for(; lenTest2 >= 2; lenTest2--)
+ {
+ UInt32 offset = lenTest + 1 + lenTest2;
+ while(lenEnd < cur + offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ UInt32 curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
+ Optimal optimum = _optimum[cur + offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + lenTest + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = true;
+ optimum.PosPrev2 = cur;
+ optimum.BackPrev2 = repIndex;
+ }
+ }
+ }
+ }
+ }
+
+ if (newLen > numAvailableBytes)
+ {
+ newLen = numAvailableBytes;
+ for (numDistancePairs = 0; newLen > _matchDistances[numDistancePairs]; numDistancePairs += 2) ;
+ _matchDistances[numDistancePairs] = newLen;
+ numDistancePairs += 2;
+ }
+ if (newLen >= startLen)
+ {
+ normalMatchPrice = matchPrice + _isRep[state.Index].GetPrice0();
+ while (lenEnd < cur + newLen)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+
+ UInt32 offs = 0;
+ while (startLen > _matchDistances[offs])
+ offs += 2;
+
+ for (UInt32 lenTest = startLen; ; lenTest++)
+ {
+ UInt32 curBack = _matchDistances[offs + 1];
+ UInt32 curAndLenPrice = normalMatchPrice + GetPosLenPrice(curBack, lenTest, posState);
+ Optimal optimum = _optimum[cur + lenTest];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur;
+ optimum.BackPrev = curBack + Base.kNumRepDistances;
+ optimum.Prev1IsChar = false;
+ }
+
+ if (lenTest == _matchDistances[offs])
+ {
+ if (lenTest < numAvailableBytesFull)
+ {
+ UInt32 t = Math.Min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
+ UInt32 lenTest2 = _matchFinder.GetMatchLen((Int32)lenTest, curBack, t);
+ if (lenTest2 >= 2)
+ {
+ Base.State state2 = state;
+ state2.UpdateMatch();
+ UInt32 posStateNext = (position + lenTest) & _posStateMask;
+ UInt32 curAndLenCharPrice = curAndLenPrice +
+ _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice0() +
+ _literalEncoder.GetSubCoder(position + lenTest,
+ _matchFinder.GetIndexByte((Int32)lenTest - 1 - 1)).
+ GetPrice(true,
+ _matchFinder.GetIndexByte((Int32)lenTest - (Int32)(curBack + 1) - 1),
+ _matchFinder.GetIndexByte((Int32)lenTest - 1));
+ state2.UpdateChar();
+ posStateNext = (position + lenTest + 1) & _posStateMask;
+ UInt32 nextMatchPrice = curAndLenCharPrice + _isMatch[(state2.Index << Base.kNumPosStatesBitsMax) + posStateNext].GetPrice1();
+ UInt32 nextRepMatchPrice = nextMatchPrice + _isRep[state2.Index].GetPrice1();
+
+ UInt32 offset = lenTest + 1 + lenTest2;
+ while (lenEnd < cur + offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
+ optimum = _optimum[cur + offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + lenTest + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = true;
+ optimum.PosPrev2 = cur;
+ optimum.BackPrev2 = curBack + Base.kNumRepDistances;
+ }
+ }
+ }
+ offs += 2;
+ if (offs == numDistancePairs)
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ bool ChangePair(UInt32 smallDist, UInt32 bigDist)
+ {
+ const int kDif = 7;
+ return (smallDist < ((UInt32)(1) << (32 - kDif)) && bigDist >= (smallDist << kDif));
+ }
+
+ void WriteEndMarker(UInt32 posState)
+ {
+ if (!_writeEndMark)
+ return;
+
+ _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].Encode(_rangeEncoder, 1);
+ _isRep[_state.Index].Encode(_rangeEncoder, 0);
+ _state.UpdateMatch();
+ UInt32 len = Base.kMatchMinLen;
+ _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ UInt32 posSlot = (1 << Base.kNumPosSlotBits) - 1;
+ UInt32 lenToPosState = Base.GetLenToPosState(len);
+ _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
+ int footerBits = 30;
+ UInt32 posReduced = (((UInt32)1) << footerBits) - 1;
+ _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
+ _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
+ }
+
+ void Flush(UInt32 nowPos)
+ {
+ ReleaseMFStream();
+ WriteEndMarker(nowPos & _posStateMask);
+ _rangeEncoder.FlushData();
+ _rangeEncoder.FlushStream();
+ }
+
+ public void CodeOneBlock(out Int64 inSize, out Int64 outSize, out bool finished)
+ {
+ inSize = 0;
+ outSize = 0;
+ finished = true;
+
+ if (_inStream != null)
+ {
+ _matchFinder.SetStream(_inStream);
+ _matchFinder.Init();
+ _needReleaseMFStream = true;
+ _inStream = null;
+ if (_trainSize > 0)
+ _matchFinder.Skip(_trainSize);
+ }
+
+ if (_finished)
+ return;
+ _finished = true;
+
+
+ Int64 progressPosValuePrev = nowPos64;
+ if (nowPos64 == 0)
+ {
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((UInt32)nowPos64);
+ return;
+ }
+ UInt32 len, numDistancePairs; // it's not used
+ ReadMatchDistances(out len, out numDistancePairs);
+ UInt32 posState = (UInt32)(nowPos64) & _posStateMask;
+ _isMatch[(_state.Index << Base.kNumPosStatesBitsMax) + posState].Encode(_rangeEncoder, 0);
+ _state.UpdateChar();
+ Byte curByte = _matchFinder.GetIndexByte((Int32)(0 - _additionalOffset));
+ _literalEncoder.GetSubCoder((UInt32)(nowPos64), _previousByte).Encode(_rangeEncoder, curByte);
+ _previousByte = curByte;
+ _additionalOffset--;
+ nowPos64++;
+ }
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((UInt32)nowPos64);
+ return;
+ }
+ while (true)
+ {
+ UInt32 pos;
+ UInt32 len = GetOptimum((UInt32)nowPos64, out pos);
+
+ UInt32 posState = ((UInt32)nowPos64) & _posStateMask;
+ UInt32 complexState = (_state.Index << Base.kNumPosStatesBitsMax) + posState;
+ if (len == 1 && pos == 0xFFFFFFFF)
+ {
+ _isMatch[complexState].Encode(_rangeEncoder, 0);
+ Byte curByte = _matchFinder.GetIndexByte((Int32)(0 - _additionalOffset));
+ LiteralEncoder.Encoder2 subCoder = _literalEncoder.GetSubCoder((UInt32)nowPos64, _previousByte);
+ if (!_state.IsCharState())
+ {
+ Byte matchByte = _matchFinder.GetIndexByte((Int32)(0 - _repDistances[0] - 1 - _additionalOffset));
+ subCoder.EncodeMatched(_rangeEncoder, matchByte, curByte);
+ }
+ else
+ subCoder.Encode(_rangeEncoder, curByte);
+ _previousByte = curByte;
+ _state.UpdateChar();
+ }
+ else
+ {
+ _isMatch[complexState].Encode(_rangeEncoder, 1);
+ if (pos < Base.kNumRepDistances)
+ {
+ _isRep[_state.Index].Encode(_rangeEncoder, 1);
+ if (pos == 0)
+ {
+ _isRepG0[_state.Index].Encode(_rangeEncoder, 0);
+ if (len == 1)
+ _isRep0Long[complexState].Encode(_rangeEncoder, 0);
+ else
+ _isRep0Long[complexState].Encode(_rangeEncoder, 1);
+ }
+ else
+ {
+ _isRepG0[_state.Index].Encode(_rangeEncoder, 1);
+ if (pos == 1)
+ _isRepG1[_state.Index].Encode(_rangeEncoder, 0);
+ else
+ {
+ _isRepG1[_state.Index].Encode(_rangeEncoder, 1);
+ _isRepG2[_state.Index].Encode(_rangeEncoder, pos - 2);
+ }
+ }
+ if (len == 1)
+ _state.UpdateShortRep();
+ else
+ {
+ _repMatchLenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ _state.UpdateRep();
+ }
+ UInt32 distance = _repDistances[pos];
+ if (pos != 0)
+ {
+ for (UInt32 i = pos; i >= 1; i--)
+ _repDistances[i] = _repDistances[i - 1];
+ _repDistances[0] = distance;
+ }
+ }
+ else
+ {
+ _isRep[_state.Index].Encode(_rangeEncoder, 0);
+ _state.UpdateMatch();
+ _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ pos -= Base.kNumRepDistances;
+ UInt32 posSlot = GetPosSlot(pos);
+ UInt32 lenToPosState = Base.GetLenToPosState(len);
+ _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
+
+ if (posSlot >= Base.kStartPosModelIndex)
+ {
+ int footerBits = (int)((posSlot >> 1) - 1);
+ UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits);
+ UInt32 posReduced = pos - baseVal;
+
+ if (posSlot < Base.kEndPosModelIndex)
+ RangeCoder.BitTreeEncoder.ReverseEncode(_posEncoders,
+ baseVal - posSlot - 1, _rangeEncoder, footerBits, posReduced);
+ else
+ {
+ _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
+ _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
+ _alignPriceCount++;
+ }
+ }
+ UInt32 distance = pos;
+ for (UInt32 i = Base.kNumRepDistances - 1; i >= 1; i--)
+ _repDistances[i] = _repDistances[i - 1];
+ _repDistances[0] = distance;
+ _matchPriceCount++;
+ }
+ _previousByte = _matchFinder.GetIndexByte((Int32)(len - 1 - _additionalOffset));
+ }
+ _additionalOffset -= len;
+ nowPos64 += len;
+ if (_additionalOffset == 0)
+ {
+ // if (!_fastMode)
+ if (_matchPriceCount >= (1 << 7))
+ FillDistancesPrices();
+ if (_alignPriceCount >= Base.kAlignTableSize)
+ FillAlignPrices();
+ inSize = nowPos64;
+ outSize = _rangeEncoder.GetProcessedSizeAdd();
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((UInt32)nowPos64);
+ return;
+ }
+
+ if (nowPos64 - progressPosValuePrev >= (1 << 12))
+ {
+ _finished = false;
+ finished = false;
+ return;
+ }
+ }
+ }
+ }
+
+ void ReleaseMFStream()
+ {
+ if (_matchFinder != null && _needReleaseMFStream)
+ {
+ _matchFinder.ReleaseStream();
+ _needReleaseMFStream = false;
+ }
+ }
+
+ void SetOutStream(System.IO.Stream outStream) { _rangeEncoder.SetStream(outStream); }
+ void ReleaseOutStream() { _rangeEncoder.ReleaseStream(); }
+
+ void ReleaseStreams()
+ {
+ ReleaseMFStream();
+ ReleaseOutStream();
+ }
+
+ void SetStreams(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize)
+ {
+ _inStream = inStream;
+ _finished = false;
+ Create();
+ SetOutStream(outStream);
+ Init();
+
+ // if (!_fastMode)
+ {
+ FillDistancesPrices();
+ FillAlignPrices();
+ }
+
+ _lenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
+ _lenEncoder.UpdateTables((UInt32)1 << _posStateBits);
+ _repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
+ _repMatchLenEncoder.UpdateTables((UInt32)1 << _posStateBits);
+
+ nowPos64 = 0;
+ }
+
+
+ public void Code(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize, ICodeProgress progress)
+ {
+ _needReleaseMFStream = false;
+ try
+ {
+ SetStreams(inStream, outStream, inSize, outSize);
+ while (true)
+ {
+ Int64 processedInSize;
+ Int64 processedOutSize;
+ bool finished;
+ CodeOneBlock(out processedInSize, out processedOutSize, out finished);
+ if (finished)
+ return;
+ if (progress != null)
+ {
+ progress.SetProgress(processedInSize, processedOutSize);
+ }
+ }
+ }
+ finally
+ {
+ ReleaseStreams();
+ }
+ }
+
+ const int kPropSize = 5;
+ Byte[] properties = new Byte[kPropSize];
+
+ public void WriteCoderProperties(System.IO.Stream outStream)
+ {
+ properties[0] = (Byte)((_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits);
+ for (int i = 0; i < 4; i++)
+ properties[1 + i] = (Byte)((_dictionarySize >> (8 * i)) & 0xFF);
+ outStream.Write(properties, 0, kPropSize);
+ }
+
+ UInt32[] tempPrices = new UInt32[Base.kNumFullDistances];
+ UInt32 _matchPriceCount;
+
+ void FillDistancesPrices()
+ {
+ for (UInt32 i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++)
+ {
+ UInt32 posSlot = GetPosSlot(i);
+ int footerBits = (int)((posSlot >> 1) - 1);
+ UInt32 baseVal = ((2 | (posSlot & 1)) << footerBits);
+ tempPrices[i] = BitTreeEncoder.ReverseGetPrice(_posEncoders,
+ baseVal - posSlot - 1, footerBits, i - baseVal);
+ }
+
+ for (UInt32 lenToPosState = 0; lenToPosState < Base.kNumLenToPosStates; lenToPosState++)
+ {
+ UInt32 posSlot;
+ RangeCoder.BitTreeEncoder encoder = _posSlotEncoder[lenToPosState];
+
+ UInt32 st = (lenToPosState << Base.kNumPosSlotBits);
+ for (posSlot = 0; posSlot < _distTableSize; posSlot++)
+ _posSlotPrices[st + posSlot] = encoder.GetPrice(posSlot);
+ for (posSlot = Base.kEndPosModelIndex; posSlot < _distTableSize; posSlot++)
+ _posSlotPrices[st + posSlot] += ((((posSlot >> 1) - 1) - Base.kNumAlignBits) << RangeCoder.BitEncoder.kNumBitPriceShiftBits);
+
+ UInt32 st2 = lenToPosState * Base.kNumFullDistances;
+ UInt32 i;
+ for (i = 0; i < Base.kStartPosModelIndex; i++)
+ _distancesPrices[st2 + i] = _posSlotPrices[st + i];
+ for (; i < Base.kNumFullDistances; i++)
+ _distancesPrices[st2 + i] = _posSlotPrices[st + GetPosSlot(i)] + tempPrices[i];
+ }
+ _matchPriceCount = 0;
+ }
+
+ void FillAlignPrices()
+ {
+ for (UInt32 i = 0; i < Base.kAlignTableSize; i++)
+ _alignPrices[i] = _posAlignEncoder.ReverseGetPrice(i);
+ _alignPriceCount = 0;
+ }
+
+
+ static string[] kMatchFinderIDs =
+ {
+ "BT2",
+ "BT4",
+ };
+
+ static int FindMatchFinder(string s)
+ {
+ for (int m = 0; m < kMatchFinderIDs.Length; m++)
+ if (s == kMatchFinderIDs[m])
+ return m;
+ return -1;
+ }
+
+ public void SetCoderProperties(CoderPropID[] propIDs, object[] properties)
+ {
+ for (UInt32 i = 0; i < properties.Length; i++)
+ {
+ object prop = properties[i];
+ switch (propIDs[i])
+ {
+ case CoderPropID.NumFastBytes:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 numFastBytes = (Int32)prop;
+ if (numFastBytes < 5 || numFastBytes > Base.kMatchMaxLen)
+ throw new InvalidParamException();
+ _numFastBytes = (UInt32)numFastBytes;
+ break;
+ }
+ case CoderPropID.Algorithm:
+ {
+ /*
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 maximize = (Int32)prop;
+ _fastMode = (maximize == 0);
+ _maxMode = (maximize >= 2);
+ */
+ break;
+ }
+ case CoderPropID.MatchFinder:
+ {
+ if (!(prop is String))
+ throw new InvalidParamException();
+ EMatchFinderType matchFinderIndexPrev = _matchFinderType;
+ int m = FindMatchFinder(((string)prop).ToUpper());
+ if (m < 0)
+ throw new InvalidParamException();
+ _matchFinderType = (EMatchFinderType)m;
+ if (_matchFinder != null && matchFinderIndexPrev != _matchFinderType)
+ {
+ _dictionarySizePrev = 0xFFFFFFFF;
+ _matchFinder = null;
+ }
+ break;
+ }
+ case CoderPropID.DictionarySize:
+ {
+ const int kDicLogSizeMaxCompress = 30;
+ if (!(prop is Int32))
+ throw new InvalidParamException(); ;
+ Int32 dictionarySize = (Int32)prop;
+ if (dictionarySize < (UInt32)(1 << Base.kDicLogSizeMin) ||
+ dictionarySize > (UInt32)(1 << kDicLogSizeMaxCompress))
+ throw new InvalidParamException();
+ _dictionarySize = (UInt32)dictionarySize;
+ int dicLogSize;
+ for (dicLogSize = 0; dicLogSize < (UInt32)kDicLogSizeMaxCompress; dicLogSize++)
+ if (dictionarySize <= ((UInt32)(1) << dicLogSize))
+ break;
+ _distTableSize = (UInt32)dicLogSize * 2;
+ break;
+ }
+ case CoderPropID.PosStateBits:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 v = (Int32)prop;
+ if (v < 0 || v > (UInt32)Base.kNumPosStatesBitsEncodingMax)
+ throw new InvalidParamException();
+ _posStateBits = (int)v;
+ _posStateMask = (((UInt32)1) << (int)_posStateBits) - 1;
+ break;
+ }
+ case CoderPropID.LitPosBits:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 v = (Int32)prop;
+ if (v < 0 || v > (UInt32)Base.kNumLitPosStatesBitsEncodingMax)
+ throw new InvalidParamException();
+ _numLiteralPosStateBits = (int)v;
+ break;
+ }
+ case CoderPropID.LitContextBits:
+ {
+ if (!(prop is Int32))
+ throw new InvalidParamException();
+ Int32 v = (Int32)prop;
+ if (v < 0 || v > (UInt32)Base.kNumLitContextBitsMax)
+ throw new InvalidParamException(); ;
+ _numLiteralContextBits = (int)v;
+ break;
+ }
+ case CoderPropID.EndMarker:
+ {
+ if (!(prop is Boolean))
+ throw new InvalidParamException();
+ SetWriteEndMarkerMode((Boolean)prop);
+ break;
+ }
+ default:
+ throw new InvalidParamException();
+ }
+ }
+ }
+
+ uint _trainSize = 0;
+ public void SetTrainSize(uint trainSize)
+ {
+ _trainSize = trainSize;
+ }
+
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs
new file mode 100644
index 0000000000..8aa446267a
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.cs
@@ -0,0 +1,364 @@
+using System;
+using System.IO;
+namespace SevenZip
+{
+ using CommandLineParser;
+
+ public class CDoubleStream: Stream
+ {
+ public System.IO.Stream s1;
+ public System.IO.Stream s2;
+ public int fileIndex;
+ public long skipSize;
+
+ public override bool CanRead { get { return true; }}
+ public override bool CanWrite { get { return false; }}
+ public override bool CanSeek { get { return false; }}
+ public override long Length { get { return s1.Length + s2.Length - skipSize; } }
+ public override long Position
+ {
+ get { return 0; }
+ set { }
+ }
+ public override void Flush() { }
+ public override int Read(byte[] buffer, int offset, int count)
+ {
+ int numTotal = 0;
+ while (count > 0)
+ {
+ if (fileIndex == 0)
+ {
+ int num = s1.Read(buffer, offset, count);
+ offset += num;
+ count -= num;
+ numTotal += num;
+ if (num == 0)
+ fileIndex++;
+ }
+ if (fileIndex == 1)
+ {
+ numTotal += s2.Read(buffer, offset, count);
+ return numTotal;
+ }
+ }
+ return numTotal;
+ }
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ throw (new Exception("can't Write"));
+ }
+ public override long Seek(long offset, System.IO.SeekOrigin origin)
+ {
+ throw (new Exception("can't Seek"));
+ }
+ public override void SetLength(long value)
+ {
+ throw (new Exception("can't SetLength"));
+ }
+ }
+
+ class LzmaAlone
+ {
+ enum Key
+ {
+ Help1 = 0,
+ Help2,
+ Mode,
+ Dictionary,
+ FastBytes,
+ LitContext,
+ LitPos,
+ PosBits,
+ MatchFinder,
+ EOS,
+ StdIn,
+ StdOut,
+ Train
+ };
+
+ static void PrintHelp()
+ {
+ System.Console.WriteLine("\nUsage: LZMA <e|d> [<switches>...] inputFile outputFile\n" +
+ " e: encode file\n" +
+ " d: decode file\n" +
+ " b: Benchmark\n" +
+ "<Switches>\n" +
+ // " -a{N}: set compression mode - [0, 1], default: 1 (max)\n" +
+ " -d{N}: set dictionary - [0, 29], default: 23 (8MB)\n" +
+ " -fb{N}: set number of fast bytes - [5, 273], default: 128\n" +
+ " -lc{N}: set number of literal context bits - [0, 8], default: 3\n" +
+ " -lp{N}: set number of literal pos bits - [0, 4], default: 0\n" +
+ " -pb{N}: set number of pos bits - [0, 4], default: 2\n" +
+ " -mf{MF_ID}: set Match Finder: [bt2, bt4], default: bt4\n" +
+ " -eos: write End Of Stream marker\n"
+ // + " -si: read data from stdin\n"
+ // + " -so: write data to stdout\n"
+ );
+ }
+
+ static bool GetNumber(string s, out Int32 v)
+ {
+ v = 0;
+ for (int i = 0; i < s.Length; i++)
+ {
+ char c = s[i];
+ if (c < '0' || c > '9')
+ return false;
+ v *= 10;
+ v += (Int32)(c - '0');
+ }
+ return true;
+ }
+
+ static int IncorrectCommand()
+ {
+ throw (new Exception("Command line error"));
+ // System.Console.WriteLine("\nCommand line error\n");
+ // return 1;
+ }
+ static int Main2(string[] args)
+ {
+ System.Console.WriteLine("\nLZMA# 4.61 2008-11-23\n");
+
+ if (args.Length == 0)
+ {
+ PrintHelp();
+ return 0;
+ }
+
+ SwitchForm[] kSwitchForms = new SwitchForm[13];
+ int sw = 0;
+ kSwitchForms[sw++] = new SwitchForm("?", SwitchType.Simple, false);
+ kSwitchForms[sw++] = new SwitchForm("H", SwitchType.Simple, false);
+ kSwitchForms[sw++] = new SwitchForm("A", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("D", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("FB", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("LC", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("LP", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("PB", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("MF", SwitchType.UnLimitedPostString, false, 1);
+ kSwitchForms[sw++] = new SwitchForm("EOS", SwitchType.Simple, false);
+ kSwitchForms[sw++] = new SwitchForm("SI", SwitchType.Simple, false);
+ kSwitchForms[sw++] = new SwitchForm("SO", SwitchType.Simple, false);
+ kSwitchForms[sw++] = new SwitchForm("T", SwitchType.UnLimitedPostString, false, 1);
+
+
+ Parser parser = new Parser(sw);
+ try
+ {
+ parser.ParseStrings(kSwitchForms, args);
+ }
+ catch
+ {
+ return IncorrectCommand();
+ }
+
+ if (parser[(int)Key.Help1].ThereIs || parser[(int)Key.Help2].ThereIs)
+ {
+ PrintHelp();
+ return 0;
+ }
+
+ System.Collections.ArrayList nonSwitchStrings = parser.NonSwitchStrings;
+
+ int paramIndex = 0;
+ if (paramIndex >= nonSwitchStrings.Count)
+ return IncorrectCommand();
+ string command = (string)nonSwitchStrings[paramIndex++];
+ command = command.ToLower();
+
+ bool dictionaryIsDefined = false;
+ Int32 dictionary = 1 << 21;
+ if (parser[(int)Key.Dictionary].ThereIs)
+ {
+ Int32 dicLog;
+ if (!GetNumber((string)parser[(int)Key.Dictionary].PostStrings[0], out dicLog))
+ IncorrectCommand();
+ dictionary = (Int32)1 << dicLog;
+ dictionaryIsDefined = true;
+ }
+ string mf = "bt4";
+ if (parser[(int)Key.MatchFinder].ThereIs)
+ mf = (string)parser[(int)Key.MatchFinder].PostStrings[0];
+ mf = mf.ToLower();
+
+ if (command == "b")
+ {
+ const Int32 kNumDefaultItereations = 10;
+ Int32 numIterations = kNumDefaultItereations;
+ if (paramIndex < nonSwitchStrings.Count)
+ if (!GetNumber((string)nonSwitchStrings[paramIndex++], out numIterations))
+ numIterations = kNumDefaultItereations;
+ return LzmaBench.LzmaBenchmark(numIterations, (UInt32)dictionary);
+ }
+
+ string train = "";
+ if (parser[(int)Key.Train].ThereIs)
+ train = (string)parser[(int)Key.Train].PostStrings[0];
+
+ bool encodeMode = false;
+ if (command == "e")
+ encodeMode = true;
+ else if (command == "d")
+ encodeMode = false;
+ else
+ IncorrectCommand();
+
+ bool stdInMode = parser[(int)Key.StdIn].ThereIs;
+ bool stdOutMode = parser[(int)Key.StdOut].ThereIs;
+
+ Stream inStream = null;
+ if (stdInMode)
+ {
+ throw (new Exception("Not implemeted"));
+ }
+ else
+ {
+ if (paramIndex >= nonSwitchStrings.Count)
+ IncorrectCommand();
+ string inputName = (string)nonSwitchStrings[paramIndex++];
+ inStream = new FileStream(inputName, FileMode.Open, FileAccess.Read);
+ }
+
+ FileStream outStream = null;
+ if (stdOutMode)
+ {
+ throw (new Exception("Not implemeted"));
+ }
+ else
+ {
+ if (paramIndex >= nonSwitchStrings.Count)
+ IncorrectCommand();
+ string outputName = (string)nonSwitchStrings[paramIndex++];
+ outStream = new FileStream(outputName, FileMode.Create, FileAccess.Write);
+ }
+
+ FileStream trainStream = null;
+ if (train.Length != 0)
+ trainStream = new FileStream(train, FileMode.Open, FileAccess.Read);
+
+ if (encodeMode)
+ {
+ if (!dictionaryIsDefined)
+ dictionary = 1 << 23;
+
+ Int32 posStateBits = 2;
+ Int32 litContextBits = 3; // for normal files
+ // UInt32 litContextBits = 0; // for 32-bit data
+ Int32 litPosBits = 0;
+ // UInt32 litPosBits = 2; // for 32-bit data
+ Int32 algorithm = 2;
+ Int32 numFastBytes = 128;
+
+ bool eos = parser[(int)Key.EOS].ThereIs || stdInMode;
+
+ if (parser[(int)Key.Mode].ThereIs)
+ if (!GetNumber((string)parser[(int)Key.Mode].PostStrings[0], out algorithm))
+ IncorrectCommand();
+
+ if (parser[(int)Key.FastBytes].ThereIs)
+ if (!GetNumber((string)parser[(int)Key.FastBytes].PostStrings[0], out numFastBytes))
+ IncorrectCommand();
+ if (parser[(int)Key.LitContext].ThereIs)
+ if (!GetNumber((string)parser[(int)Key.LitContext].PostStrings[0], out litContextBits))
+ IncorrectCommand();
+ if (parser[(int)Key.LitPos].ThereIs)
+ if (!GetNumber((string)parser[(int)Key.LitPos].PostStrings[0], out litPosBits))
+ IncorrectCommand();
+ if (parser[(int)Key.PosBits].ThereIs)
+ if (!GetNumber((string)parser[(int)Key.PosBits].PostStrings[0], out posStateBits))
+ IncorrectCommand();
+
+ CoderPropID[] propIDs =
+ {
+ CoderPropID.DictionarySize,
+ CoderPropID.PosStateBits,
+ CoderPropID.LitContextBits,
+ CoderPropID.LitPosBits,
+ CoderPropID.Algorithm,
+ CoderPropID.NumFastBytes,
+ CoderPropID.MatchFinder,
+ CoderPropID.EndMarker
+ };
+ object[] properties =
+ {
+ (Int32)(dictionary),
+ (Int32)(posStateBits),
+ (Int32)(litContextBits),
+ (Int32)(litPosBits),
+ (Int32)(algorithm),
+ (Int32)(numFastBytes),
+ mf,
+ eos
+ };
+
+ Compression.LZMA.Encoder encoder = new Compression.LZMA.Encoder();
+ encoder.SetCoderProperties(propIDs, properties);
+ encoder.WriteCoderProperties(outStream);
+ Int64 fileSize;
+ if (eos || stdInMode)
+ fileSize = -1;
+ else
+ fileSize = inStream.Length;
+ for (int i = 0; i < 8; i++)
+ outStream.WriteByte((Byte)(fileSize >> (8 * i)));
+ if (trainStream != null)
+ {
+ CDoubleStream doubleStream = new CDoubleStream();
+ doubleStream.s1 = trainStream;
+ doubleStream.s2 = inStream;
+ doubleStream.fileIndex = 0;
+ inStream = doubleStream;
+ long trainFileSize = trainStream.Length;
+ doubleStream.skipSize = 0;
+ if (trainFileSize > dictionary)
+ doubleStream.skipSize = trainFileSize - dictionary;
+ trainStream.Seek(doubleStream.skipSize, SeekOrigin.Begin);
+ encoder.SetTrainSize((uint)(trainFileSize - doubleStream.skipSize));
+ }
+ encoder.Code(inStream, outStream, -1, -1, null);
+ }
+ else if (command == "d")
+ {
+ byte[] properties = new byte[5];
+ if (inStream.Read(properties, 0, 5) != 5)
+ throw (new Exception("input .lzma is too short"));
+ Compression.LZMA.Decoder decoder = new Compression.LZMA.Decoder();
+ decoder.SetDecoderProperties(properties);
+ if (trainStream != null)
+ {
+ if (!decoder.Train(trainStream))
+ throw (new Exception("can't train"));
+ }
+ long outSize = 0;
+ for (int i = 0; i < 8; i++)
+ {
+ int v = inStream.ReadByte();
+ if (v < 0)
+ throw (new Exception("Can't Read 1"));
+ outSize |= ((long)(byte)v) << (8 * i);
+ }
+ long compressedSize = inStream.Length - inStream.Position;
+ decoder.Code(inStream, outStream, compressedSize, outSize, null);
+ }
+ else
+ throw (new Exception("Command Error"));
+ return 0;
+ }
+
+ [STAThread]
+ static int Main(string[] args)
+ {
+ try
+ {
+ return Main2(args);
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("{0} Caught exception #1.", e);
+ // throw e;
+ return 1;
+ }
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj
new file mode 100644
index 0000000000..ceb7073504
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.csproj
@@ -0,0 +1,90 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{CE33DF18-F9C8-4D6F-9057-DBB4DB96E973}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>LzmaAlone</RootNamespace>
+ <AssemblyName>Lzma#</AssemblyName>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>.\bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugSymbols>false</DebugSymbols>
+ <Optimize>true</Optimize>
+ <OutputPath>.\bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <PlatformTarget>AnyCPU</PlatformTarget>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="..\..\Common\CommandLineParser.cs">
+ <Link>Common\CommandLineParser.cs</Link>
+ </Compile>
+ <Compile Include="..\..\Common\CRC.cs">
+ <Link>Common\CRC.cs</Link>
+ </Compile>
+ <Compile Include="..\..\ICoder.cs">
+ <Link>ICoder.cs</Link>
+ </Compile>
+ <Compile Include="..\LZ\IMatchFinder.cs">
+ <Link>LZ\IMatchFinder.cs</Link>
+ </Compile>
+ <Compile Include="..\LZ\LzBinTree.cs">
+ <Link>LZ\LzBinTree.cs</Link>
+ </Compile>
+ <Compile Include="..\LZ\LzInWindow.cs">
+ <Link>LZ\LzInWindow.cs</Link>
+ </Compile>
+ <Compile Include="..\LZ\LzOutWindow.cs">
+ <Link>LZ\LzOutWindow.cs</Link>
+ </Compile>
+ <Compile Include="..\LZMA\LzmaBase.cs">
+ <Link>LZMA\LzmaBase.cs</Link>
+ </Compile>
+ <Compile Include="..\LZMA\LzmaDecoder.cs">
+ <Link>LZMA\LzmaDecoder.cs</Link>
+ </Compile>
+ <Compile Include="..\LZMA\LzmaEncoder.cs">
+ <Link>LZMA\LzmaEncoder.cs</Link>
+ </Compile>
+ <Compile Include="..\RangeCoder\RangeCoder.cs">
+ <Link>RangeCoder\RangeCoder.cs</Link>
+ </Compile>
+ <Compile Include="..\RangeCoder\RangeCoderBit.cs">
+ <Link>RangeCoder\RangeCoderBit.cs</Link>
+ </Compile>
+ <Compile Include="..\RangeCoder\RangeCoderBitTree.cs">
+ <Link>RangeCoder\RangeCoderBitTree.cs</Link>
+ </Compile>
+ <Compile Include="LzmaAlone.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="LzmaBench.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="Properties\Settings.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ </Compile>
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.cs</LastGenOutput>
+ </None>
+ <AppDesigner Include="Properties\" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
+</Project> \ No newline at end of file
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln
new file mode 100644
index 0000000000..a96ee3e433
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaAlone.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C# Express 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LzmaAlone", "LzmaAlone.csproj", "{CE33DF18-F9C8-4D6F-9057-DBB4DB96E973}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {CE33DF18-F9C8-4D6F-9057-DBB4DB96E973}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CE33DF18-F9C8-4D6F-9057-DBB4DB96E973}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CE33DF18-F9C8-4D6F-9057-DBB4DB96E973}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CE33DF18-F9C8-4D6F-9057-DBB4DB96E973}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaBench.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaBench.cs
new file mode 100644
index 0000000000..6a1ffe2460
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/LzmaBench.cs
@@ -0,0 +1,340 @@
+// LzmaBench.cs
+
+using System;
+using System.IO;
+
+namespace SevenZip
+{
+ /// <summary>
+ /// LZMA Benchmark
+ /// </summary>
+ internal abstract class LzmaBench
+ {
+ const UInt32 kAdditionalSize = (6 << 20);
+ const UInt32 kCompressedAdditionalSize = (1 << 10);
+ const UInt32 kMaxLzmaPropSize = 10;
+
+ class CRandomGenerator
+ {
+ UInt32 A1;
+ UInt32 A2;
+ public CRandomGenerator() { Init(); }
+ public void Init() { A1 = 362436069; A2 = 521288629; }
+ public UInt32 GetRnd()
+ {
+ return
+ ((A1 = 36969 * (A1 & 0xffff) + (A1 >> 16)) << 16) ^
+ ((A2 = 18000 * (A2 & 0xffff) + (A2 >> 16)));
+ }
+ };
+
+ class CBitRandomGenerator
+ {
+ CRandomGenerator RG = new CRandomGenerator();
+ UInt32 Value;
+ int NumBits;
+ public void Init()
+ {
+ Value = 0;
+ NumBits = 0;
+ }
+ public UInt32 GetRnd(int numBits)
+ {
+ UInt32 result;
+ if (NumBits > numBits)
+ {
+ result = Value & (((UInt32)1 << numBits) - 1);
+ Value >>= numBits;
+ NumBits -= numBits;
+ return result;
+ }
+ numBits -= NumBits;
+ result = (Value << numBits);
+ Value = RG.GetRnd();
+ result |= Value & (((UInt32)1 << numBits) - 1);
+ Value >>= numBits;
+ NumBits = 32 - numBits;
+ return result;
+ }
+ };
+
+ class CBenchRandomGenerator
+ {
+ CBitRandomGenerator RG = new CBitRandomGenerator();
+ UInt32 Pos;
+ UInt32 Rep0;
+
+ public UInt32 BufferSize;
+ public Byte[] Buffer = null;
+
+ public CBenchRandomGenerator() { }
+
+ public void Set(UInt32 bufferSize)
+ {
+ Buffer = new Byte[bufferSize];
+ Pos = 0;
+ BufferSize = bufferSize;
+ }
+ UInt32 GetRndBit() { return RG.GetRnd(1); }
+ UInt32 GetLogRandBits(int numBits)
+ {
+ UInt32 len = RG.GetRnd(numBits);
+ return RG.GetRnd((int)len);
+ }
+ UInt32 GetOffset()
+ {
+ if (GetRndBit() == 0)
+ return GetLogRandBits(4);
+ return (GetLogRandBits(4) << 10) | RG.GetRnd(10);
+ }
+ UInt32 GetLen1() { return RG.GetRnd(1 + (int)RG.GetRnd(2)); }
+ UInt32 GetLen2() { return RG.GetRnd(2 + (int)RG.GetRnd(2)); }
+ public void Generate()
+ {
+ RG.Init();
+ Rep0 = 1;
+ while (Pos < BufferSize)
+ {
+ if (GetRndBit() == 0 || Pos < 1)
+ Buffer[Pos++] = (Byte)RG.GetRnd(8);
+ else
+ {
+ UInt32 len;
+ if (RG.GetRnd(3) == 0)
+ len = 1 + GetLen1();
+ else
+ {
+ do
+ Rep0 = GetOffset();
+ while (Rep0 >= Pos);
+ Rep0++;
+ len = 2 + GetLen2();
+ }
+ for (UInt32 i = 0; i < len && Pos < BufferSize; i++, Pos++)
+ Buffer[Pos] = Buffer[Pos - Rep0];
+ }
+ }
+ }
+ };
+
+ class CrcOutStream : System.IO.Stream
+ {
+ public CRC CRC = new CRC();
+ public void Init() { CRC.Init(); }
+ public UInt32 GetDigest() { return CRC.GetDigest(); }
+
+ public override bool CanRead { get { return false; } }
+ public override bool CanSeek { get { return false; } }
+ public override bool CanWrite { get { return true; } }
+ public override Int64 Length { get { return 0; } }
+ public override Int64 Position { get { return 0; } set { } }
+ public override void Flush() { }
+ public override long Seek(long offset, SeekOrigin origin) { return 0; }
+ public override void SetLength(long value) { }
+ public override int Read(byte[] buffer, int offset, int count) { return 0; }
+
+ public override void WriteByte(byte b)
+ {
+ CRC.UpdateByte(b);
+ }
+ public override void Write(byte[] buffer, int offset, int count)
+ {
+ CRC.Update(buffer, (uint)offset, (uint)count);
+ }
+ };
+
+ class CProgressInfo : ICodeProgress
+ {
+ public Int64 ApprovedStart;
+ public Int64 InSize;
+ public System.DateTime Time;
+ public void Init() { InSize = 0; }
+ public void SetProgress(Int64 inSize, Int64 outSize)
+ {
+ if (inSize >= ApprovedStart && InSize == 0)
+ {
+ Time = DateTime.UtcNow;
+ InSize = inSize;
+ }
+ }
+ }
+ const int kSubBits = 8;
+
+ static UInt32 GetLogSize(UInt32 size)
+ {
+ for (int i = kSubBits; i < 32; i++)
+ for (UInt32 j = 0; j < (1 << kSubBits); j++)
+ if (size <= (((UInt32)1) << i) + (j << (i - kSubBits)))
+ return (UInt32)(i << kSubBits) + j;
+ return (32 << kSubBits);
+ }
+
+ static UInt64 MyMultDiv64(UInt64 value, UInt64 elapsedTime)
+ {
+ UInt64 freq = TimeSpan.TicksPerSecond;
+ UInt64 elTime = elapsedTime;
+ while (freq > 1000000)
+ {
+ freq >>= 1;
+ elTime >>= 1;
+ }
+ if (elTime == 0)
+ elTime = 1;
+ return value * freq / elTime;
+ }
+
+ static UInt64 GetCompressRating(UInt32 dictionarySize, UInt64 elapsedTime, UInt64 size)
+ {
+ UInt64 t = GetLogSize(dictionarySize) - (18 << kSubBits);
+ UInt64 numCommandsForOne = 1060 + ((t * t * 10) >> (2 * kSubBits));
+ UInt64 numCommands = (UInt64)(size) * numCommandsForOne;
+ return MyMultDiv64(numCommands, elapsedTime);
+ }
+
+ static UInt64 GetDecompressRating(UInt64 elapsedTime, UInt64 outSize, UInt64 inSize)
+ {
+ UInt64 numCommands = inSize * 220 + outSize * 20;
+ return MyMultDiv64(numCommands, elapsedTime);
+ }
+
+ static UInt64 GetTotalRating(
+ UInt32 dictionarySize,
+ UInt64 elapsedTimeEn, UInt64 sizeEn,
+ UInt64 elapsedTimeDe,
+ UInt64 inSizeDe, UInt64 outSizeDe)
+ {
+ return (GetCompressRating(dictionarySize, elapsedTimeEn, sizeEn) +
+ GetDecompressRating(elapsedTimeDe, inSizeDe, outSizeDe)) / 2;
+ }
+
+ static void PrintValue(UInt64 v)
+ {
+ string s = v.ToString();
+ for (int i = 0; i + s.Length < 6; i++)
+ System.Console.Write(" ");
+ System.Console.Write(s);
+ }
+
+ static void PrintRating(UInt64 rating)
+ {
+ PrintValue(rating / 1000000);
+ System.Console.Write(" MIPS");
+ }
+
+ static void PrintResults(
+ UInt32 dictionarySize,
+ UInt64 elapsedTime,
+ UInt64 size,
+ bool decompressMode, UInt64 secondSize)
+ {
+ UInt64 speed = MyMultDiv64(size, elapsedTime);
+ PrintValue(speed / 1024);
+ System.Console.Write(" KB/s ");
+ UInt64 rating;
+ if (decompressMode)
+ rating = GetDecompressRating(elapsedTime, size, secondSize);
+ else
+ rating = GetCompressRating(dictionarySize, elapsedTime, size);
+ PrintRating(rating);
+ }
+
+ static public int LzmaBenchmark(Int32 numIterations, UInt32 dictionarySize)
+ {
+ if (numIterations <= 0)
+ return 0;
+ if (dictionarySize < (1 << 18))
+ {
+ System.Console.WriteLine("\nError: dictionary size for benchmark must be >= 19 (512 KB)");
+ return 1;
+ }
+ System.Console.Write("\n Compressing Decompressing\n\n");
+
+ Compression.LZMA.Encoder encoder = new Compression.LZMA.Encoder();
+ Compression.LZMA.Decoder decoder = new Compression.LZMA.Decoder();
+
+
+ CoderPropID[] propIDs =
+ {
+ CoderPropID.DictionarySize,
+ };
+ object[] properties =
+ {
+ (Int32)(dictionarySize),
+ };
+
+ UInt32 kBufferSize = dictionarySize + kAdditionalSize;
+ UInt32 kCompressedBufferSize = (kBufferSize / 2) + kCompressedAdditionalSize;
+
+ encoder.SetCoderProperties(propIDs, properties);
+ System.IO.MemoryStream propStream = new System.IO.MemoryStream();
+ encoder.WriteCoderProperties(propStream);
+ byte[] propArray = propStream.ToArray();
+
+ CBenchRandomGenerator rg = new CBenchRandomGenerator();
+
+ rg.Set(kBufferSize);
+ rg.Generate();
+ CRC crc = new CRC();
+ crc.Init();
+ crc.Update(rg.Buffer, 0, rg.BufferSize);
+
+ CProgressInfo progressInfo = new CProgressInfo();
+ progressInfo.ApprovedStart = dictionarySize;
+
+ UInt64 totalBenchSize = 0;
+ UInt64 totalEncodeTime = 0;
+ UInt64 totalDecodeTime = 0;
+ UInt64 totalCompressedSize = 0;
+
+ MemoryStream inStream = new MemoryStream(rg.Buffer, 0, (int)rg.BufferSize);
+ MemoryStream compressedStream = new MemoryStream((int)kCompressedBufferSize);
+ CrcOutStream crcOutStream = new CrcOutStream();
+ for (Int32 i = 0; i < numIterations; i++)
+ {
+ progressInfo.Init();
+ inStream.Seek(0, SeekOrigin.Begin);
+ compressedStream.Seek(0, SeekOrigin.Begin);
+ encoder.Code(inStream, compressedStream, -1, -1, progressInfo);
+ TimeSpan sp2 = DateTime.UtcNow - progressInfo.Time;
+ UInt64 encodeTime = (UInt64)sp2.Ticks;
+
+ long compressedSize = compressedStream.Position;
+ if (progressInfo.InSize == 0)
+ throw (new Exception("Internal ERROR 1282"));
+
+ UInt64 decodeTime = 0;
+ for (int j = 0; j < 2; j++)
+ {
+ compressedStream.Seek(0, SeekOrigin.Begin);
+ crcOutStream.Init();
+
+ decoder.SetDecoderProperties(propArray);
+ UInt64 outSize = kBufferSize;
+ System.DateTime startTime = DateTime.UtcNow;
+ decoder.Code(compressedStream, crcOutStream, 0, (Int64)outSize, null);
+ TimeSpan sp = (DateTime.UtcNow - startTime);
+ decodeTime = (ulong)sp.Ticks;
+ if (crcOutStream.GetDigest() != crc.GetDigest())
+ throw (new Exception("CRC Error"));
+ }
+ UInt64 benchSize = kBufferSize - (UInt64)progressInfo.InSize;
+ PrintResults(dictionarySize, encodeTime, benchSize, false, 0);
+ System.Console.Write(" ");
+ PrintResults(dictionarySize, decodeTime, kBufferSize, true, (ulong)compressedSize);
+ System.Console.WriteLine();
+
+ totalBenchSize += benchSize;
+ totalEncodeTime += encodeTime;
+ totalDecodeTime += decodeTime;
+ totalCompressedSize += (ulong)compressedSize;
+ }
+ System.Console.WriteLine("---------------------------------------------------");
+ PrintResults(dictionarySize, totalEncodeTime, totalBenchSize, false, 0);
+ System.Console.Write(" ");
+ PrintResults(dictionarySize, totalDecodeTime,
+ kBufferSize * (UInt64)numIterations, true, totalCompressedSize);
+ System.Console.WriteLine(" Average");
+ return 0;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..a394aee877
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/AssemblyInfo.cs
@@ -0,0 +1,29 @@
+#region Using directives
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+#endregion
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("LZMA#")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Igor Pavlov")]
+[assembly: AssemblyProduct("LZMA# SDK")]
+[assembly: AssemblyCopyright("Copyright @ Igor Pavlov 1999-2004")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("4.12.*")]
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs
new file mode 100644
index 0000000000..efe4ee9af8
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Resources.cs
@@ -0,0 +1,70 @@
+//------------------------------------------------------------------------------
+// <autogenerated>
+// This code was generated by a tool.
+// Runtime Version:2.0.40607.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </autogenerated>
+//------------------------------------------------------------------------------
+
+namespace LzmaAlone.Properties
+{
+ using System;
+ using System.IO;
+ using System.Resources;
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the Strongly Typed Resource Builder
+ // class via a tool like ResGen or Visual Studio.NET.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ class Resources
+ {
+
+ private static System.Resources.ResourceManager _resMgr;
+
+ private static System.Globalization.CultureInfo _resCulture;
+
+ /*FamANDAssem*/
+ internal Resources()
+ {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((_resMgr == null))
+ {
+ System.Resources.ResourceManager temp = new System.Resources.ResourceManager("Resources", typeof(Resources).Assembly);
+ _resMgr = temp;
+ }
+ return _resMgr;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
+ public static System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return _resCulture;
+ }
+ set
+ {
+ _resCulture = value;
+ }
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs
new file mode 100644
index 0000000000..1281fd2e09
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/LzmaAlone/Properties/Settings.cs
@@ -0,0 +1,42 @@
+//------------------------------------------------------------------------------
+// <autogenerated>
+// This code was generated by a tool.
+// Runtime Version:2.0.40607.42
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </autogenerated>
+//------------------------------------------------------------------------------
+
+namespace LzmaAlone.Properties
+{
+ public partial class Settings : System.Configuration.ApplicationSettingsBase
+ {
+ private static Settings m_Value;
+
+ private static object m_SyncObject = new object();
+
+ public static Settings Value
+ {
+ get
+ {
+ if ((Settings.m_Value == null))
+ {
+ System.Threading.Monitor.Enter(Settings.m_SyncObject);
+ if ((Settings.m_Value == null))
+ {
+ try
+ {
+ Settings.m_Value = new Settings();
+ }
+ finally
+ {
+ System.Threading.Monitor.Exit(Settings.m_SyncObject);
+ }
+ }
+ }
+ return Settings.m_Value;
+ }
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoder.cs b/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoder.cs
new file mode 100644
index 0000000000..4ced2477e4
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoder.cs
@@ -0,0 +1,234 @@
+using System;
+
+namespace SevenZip.Compression.RangeCoder
+{
+ class Encoder
+ {
+ public const uint kTopValue = (1 << 24);
+
+ System.IO.Stream Stream;
+
+ public UInt64 Low;
+ public uint Range;
+ uint _cacheSize;
+ byte _cache;
+
+ long StartPosition;
+
+ public void SetStream(System.IO.Stream stream)
+ {
+ Stream = stream;
+ }
+
+ public void ReleaseStream()
+ {
+ Stream = null;
+ }
+
+ public void Init()
+ {
+ StartPosition = Stream.Position;
+
+ Low = 0;
+ Range = 0xFFFFFFFF;
+ _cacheSize = 1;
+ _cache = 0;
+ }
+
+ public void FlushData()
+ {
+ for (int i = 0; i < 5; i++)
+ ShiftLow();
+ }
+
+ public void FlushStream()
+ {
+ Stream.Flush();
+ }
+
+ public void CloseStream()
+ {
+ Stream.Close();
+ }
+
+ public void Encode(uint start, uint size, uint total)
+ {
+ Low += start * (Range /= total);
+ Range *= size;
+ while (Range < kTopValue)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+
+ public void ShiftLow()
+ {
+ if ((uint)Low < (uint)0xFF000000 || (uint)(Low >> 32) == 1)
+ {
+ byte temp = _cache;
+ do
+ {
+ Stream.WriteByte((byte)(temp + (Low >> 32)));
+ temp = 0xFF;
+ }
+ while (--_cacheSize != 0);
+ _cache = (byte)(((uint)Low) >> 24);
+ }
+ _cacheSize++;
+ Low = ((uint)Low) << 8;
+ }
+
+ public void EncodeDirectBits(uint v, int numTotalBits)
+ {
+ for (int i = numTotalBits - 1; i >= 0; i--)
+ {
+ Range >>= 1;
+ if (((v >> i) & 1) == 1)
+ Low += Range;
+ if (Range < kTopValue)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+ }
+
+ public void EncodeBit(uint size0, int numTotalBits, uint symbol)
+ {
+ uint newBound = (Range >> numTotalBits) * size0;
+ if (symbol == 0)
+ Range = newBound;
+ else
+ {
+ Low += newBound;
+ Range -= newBound;
+ }
+ while (Range < kTopValue)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+
+ public long GetProcessedSizeAdd()
+ {
+ return _cacheSize +
+ Stream.Position - StartPosition + 4;
+ // (long)Stream.GetProcessedSize();
+ }
+ }
+
+ class Decoder
+ {
+ public const uint kTopValue = (1 << 24);
+ public uint Range;
+ public uint Code;
+ // public Buffer.InBuffer Stream = new Buffer.InBuffer(1 << 16);
+ public System.IO.Stream Stream;
+
+ public void Init(System.IO.Stream stream)
+ {
+ // Stream.Init(stream);
+ Stream = stream;
+
+ Code = 0;
+ Range = 0xFFFFFFFF;
+ for (int i = 0; i < 5; i++)
+ Code = (Code << 8) | (byte)Stream.ReadByte();
+ }
+
+ public void ReleaseStream()
+ {
+ // Stream.ReleaseStream();
+ Stream = null;
+ }
+
+ public void CloseStream()
+ {
+ Stream.Close();
+ }
+
+ public void Normalize()
+ {
+ while (Range < kTopValue)
+ {
+ Code = (Code << 8) | (byte)Stream.ReadByte();
+ Range <<= 8;
+ }
+ }
+
+ public void Normalize2()
+ {
+ if (Range < kTopValue)
+ {
+ Code = (Code << 8) | (byte)Stream.ReadByte();
+ Range <<= 8;
+ }
+ }
+
+ public uint GetThreshold(uint total)
+ {
+ return Code / (Range /= total);
+ }
+
+ public void Decode(uint start, uint size, uint total)
+ {
+ Code -= start * Range;
+ Range *= size;
+ Normalize();
+ }
+
+ public uint DecodeDirectBits(int numTotalBits)
+ {
+ uint range = Range;
+ uint code = Code;
+ uint result = 0;
+ for (int i = numTotalBits; i > 0; i--)
+ {
+ range >>= 1;
+ /*
+ result <<= 1;
+ if (code >= range)
+ {
+ code -= range;
+ result |= 1;
+ }
+ */
+ uint t = (code - range) >> 31;
+ code -= range & (t - 1);
+ result = (result << 1) | (1 - t);
+
+ if (range < kTopValue)
+ {
+ code = (code << 8) | (byte)Stream.ReadByte();
+ range <<= 8;
+ }
+ }
+ Range = range;
+ Code = code;
+ return result;
+ }
+
+ public uint DecodeBit(uint size0, int numTotalBits)
+ {
+ uint newBound = (Range >> numTotalBits) * size0;
+ uint symbol;
+ if (Code < newBound)
+ {
+ symbol = 0;
+ Range = newBound;
+ }
+ else
+ {
+ symbol = 1;
+ Code -= newBound;
+ Range -= newBound;
+ }
+ Normalize();
+ return symbol;
+ }
+
+ // ulong GetProcessedSize() {return Stream.GetProcessedSize(); }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs b/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs
new file mode 100644
index 0000000000..000a5a0787
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBit.cs
@@ -0,0 +1,117 @@
+using System;
+
+namespace SevenZip.Compression.RangeCoder
+{
+ struct BitEncoder
+ {
+ public const int kNumBitModelTotalBits = 11;
+ public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
+ const int kNumMoveBits = 5;
+ const int kNumMoveReducingBits = 2;
+ public const int kNumBitPriceShiftBits = 6;
+
+ uint Prob;
+
+ public void Init() { Prob = kBitModelTotal >> 1; }
+
+ public void UpdateModel(uint symbol)
+ {
+ if (symbol == 0)
+ Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
+ else
+ Prob -= (Prob) >> kNumMoveBits;
+ }
+
+ public void Encode(Encoder encoder, uint symbol)
+ {
+ // encoder.EncodeBit(Prob, kNumBitModelTotalBits, symbol);
+ // UpdateModel(symbol);
+ uint newBound = (encoder.Range >> kNumBitModelTotalBits) * Prob;
+ if (symbol == 0)
+ {
+ encoder.Range = newBound;
+ Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
+ }
+ else
+ {
+ encoder.Low += newBound;
+ encoder.Range -= newBound;
+ Prob -= (Prob) >> kNumMoveBits;
+ }
+ if (encoder.Range < Encoder.kTopValue)
+ {
+ encoder.Range <<= 8;
+ encoder.ShiftLow();
+ }
+ }
+
+ private static UInt32[] ProbPrices = new UInt32[kBitModelTotal >> kNumMoveReducingBits];
+
+ static BitEncoder()
+ {
+ const int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
+ for (int i = kNumBits - 1; i >= 0; i--)
+ {
+ UInt32 start = (UInt32)1 << (kNumBits - i - 1);
+ UInt32 end = (UInt32)1 << (kNumBits - i);
+ for (UInt32 j = start; j < end; j++)
+ ProbPrices[j] = ((UInt32)i << kNumBitPriceShiftBits) +
+ (((end - j) << kNumBitPriceShiftBits) >> (kNumBits - i - 1));
+ }
+ }
+
+ public uint GetPrice(uint symbol)
+ {
+ return ProbPrices[(((Prob - symbol) ^ ((-(int)symbol))) & (kBitModelTotal - 1)) >> kNumMoveReducingBits];
+ }
+ public uint GetPrice0() { return ProbPrices[Prob >> kNumMoveReducingBits]; }
+ public uint GetPrice1() { return ProbPrices[(kBitModelTotal - Prob) >> kNumMoveReducingBits]; }
+ }
+
+ struct BitDecoder
+ {
+ public const int kNumBitModelTotalBits = 11;
+ public const uint kBitModelTotal = (1 << kNumBitModelTotalBits);
+ const int kNumMoveBits = 5;
+
+ uint Prob;
+
+ public void UpdateModel(int numMoveBits, uint symbol)
+ {
+ if (symbol == 0)
+ Prob += (kBitModelTotal - Prob) >> numMoveBits;
+ else
+ Prob -= (Prob) >> numMoveBits;
+ }
+
+ public void Init() { Prob = kBitModelTotal >> 1; }
+
+ public uint Decode(RangeCoder.Decoder rangeDecoder)
+ {
+ uint newBound = (uint)(rangeDecoder.Range >> kNumBitModelTotalBits) * (uint)Prob;
+ if (rangeDecoder.Code < newBound)
+ {
+ rangeDecoder.Range = newBound;
+ Prob += (kBitModelTotal - Prob) >> kNumMoveBits;
+ if (rangeDecoder.Range < Decoder.kTopValue)
+ {
+ rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
+ rangeDecoder.Range <<= 8;
+ }
+ return 0;
+ }
+ else
+ {
+ rangeDecoder.Range -= newBound;
+ rangeDecoder.Code -= newBound;
+ Prob -= (Prob) >> kNumMoveBits;
+ if (rangeDecoder.Range < Decoder.kTopValue)
+ {
+ rangeDecoder.Code = (rangeDecoder.Code << 8) | (byte)rangeDecoder.Stream.ReadByte();
+ rangeDecoder.Range <<= 8;
+ }
+ return 1;
+ }
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs b/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs
new file mode 100644
index 0000000000..3309c14a50
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/Compress/RangeCoder/RangeCoderBitTree.cs
@@ -0,0 +1,157 @@
+using System;
+
+namespace SevenZip.Compression.RangeCoder
+{
+ struct BitTreeEncoder
+ {
+ BitEncoder[] Models;
+ int NumBitLevels;
+
+ public BitTreeEncoder(int numBitLevels)
+ {
+ NumBitLevels = numBitLevels;
+ Models = new BitEncoder[1 << numBitLevels];
+ }
+
+ public void Init()
+ {
+ for (uint i = 1; i < (1 << NumBitLevels); i++)
+ Models[i].Init();
+ }
+
+ public void Encode(Encoder rangeEncoder, UInt32 symbol)
+ {
+ UInt32 m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex > 0; )
+ {
+ bitIndex--;
+ UInt32 bit = (symbol >> bitIndex) & 1;
+ Models[m].Encode(rangeEncoder, bit);
+ m = (m << 1) | bit;
+ }
+ }
+
+ public void ReverseEncode(Encoder rangeEncoder, UInt32 symbol)
+ {
+ UInt32 m = 1;
+ for (UInt32 i = 0; i < NumBitLevels; i++)
+ {
+ UInt32 bit = symbol & 1;
+ Models[m].Encode(rangeEncoder, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+ }
+
+ public UInt32 GetPrice(UInt32 symbol)
+ {
+ UInt32 price = 0;
+ UInt32 m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex > 0; )
+ {
+ bitIndex--;
+ UInt32 bit = (symbol >> bitIndex) & 1;
+ price += Models[m].GetPrice(bit);
+ m = (m << 1) + bit;
+ }
+ return price;
+ }
+
+ public UInt32 ReverseGetPrice(UInt32 symbol)
+ {
+ UInt32 price = 0;
+ UInt32 m = 1;
+ for (int i = NumBitLevels; i > 0; i--)
+ {
+ UInt32 bit = symbol & 1;
+ symbol >>= 1;
+ price += Models[m].GetPrice(bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+ }
+
+ public static UInt32 ReverseGetPrice(BitEncoder[] Models, UInt32 startIndex,
+ int NumBitLevels, UInt32 symbol)
+ {
+ UInt32 price = 0;
+ UInt32 m = 1;
+ for (int i = NumBitLevels; i > 0; i--)
+ {
+ UInt32 bit = symbol & 1;
+ symbol >>= 1;
+ price += Models[startIndex + m].GetPrice(bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+ }
+
+ public static void ReverseEncode(BitEncoder[] Models, UInt32 startIndex,
+ Encoder rangeEncoder, int NumBitLevels, UInt32 symbol)
+ {
+ UInt32 m = 1;
+ for (int i = 0; i < NumBitLevels; i++)
+ {
+ UInt32 bit = symbol & 1;
+ Models[startIndex + m].Encode(rangeEncoder, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+ }
+ }
+
+ struct BitTreeDecoder
+ {
+ BitDecoder[] Models;
+ int NumBitLevels;
+
+ public BitTreeDecoder(int numBitLevels)
+ {
+ NumBitLevels = numBitLevels;
+ Models = new BitDecoder[1 << numBitLevels];
+ }
+
+ public void Init()
+ {
+ for (uint i = 1; i < (1 << NumBitLevels); i++)
+ Models[i].Init();
+ }
+
+ public uint Decode(RangeCoder.Decoder rangeDecoder)
+ {
+ uint m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex > 0; bitIndex--)
+ m = (m << 1) + Models[m].Decode(rangeDecoder);
+ return m - ((uint)1 << NumBitLevels);
+ }
+
+ public uint ReverseDecode(RangeCoder.Decoder rangeDecoder)
+ {
+ uint m = 1;
+ uint symbol = 0;
+ for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
+ {
+ uint bit = Models[m].Decode(rangeDecoder);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << bitIndex);
+ }
+ return symbol;
+ }
+
+ public static uint ReverseDecode(BitDecoder[] Models, UInt32 startIndex,
+ RangeCoder.Decoder rangeDecoder, int NumBitLevels)
+ {
+ uint m = 1;
+ uint symbol = 0;
+ for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
+ {
+ uint bit = Models[startIndex + m].Decode(rangeDecoder);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << bitIndex);
+ }
+ return symbol;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/CS/7zip/ICoder.cs b/other-licenses/7zstub/src/CS/7zip/ICoder.cs
new file mode 100644
index 0000000000..875cb2739e
--- /dev/null
+++ b/other-licenses/7zstub/src/CS/7zip/ICoder.cs
@@ -0,0 +1,157 @@
+// ICoder.h
+
+using System;
+
+namespace SevenZip
+{
+ /// <summary>
+ /// The exception that is thrown when an error in input stream occurs during decoding.
+ /// </summary>
+ class DataErrorException : ApplicationException
+ {
+ public DataErrorException(): base("Data Error") { }
+ }
+
+ /// <summary>
+ /// The exception that is thrown when the value of an argument is outside the allowable range.
+ /// </summary>
+ class InvalidParamException : ApplicationException
+ {
+ public InvalidParamException(): base("Invalid Parameter") { }
+ }
+
+ public interface ICodeProgress
+ {
+ /// <summary>
+ /// Callback progress.
+ /// </summary>
+ /// <param name="inSize">
+ /// input size. -1 if unknown.
+ /// </param>
+ /// <param name="outSize">
+ /// output size. -1 if unknown.
+ /// </param>
+ void SetProgress(Int64 inSize, Int64 outSize);
+ };
+
+ public interface ICoder
+ {
+ /// <summary>
+ /// Codes streams.
+ /// </summary>
+ /// <param name="inStream">
+ /// input Stream.
+ /// </param>
+ /// <param name="outStream">
+ /// output Stream.
+ /// </param>
+ /// <param name="inSize">
+ /// input Size. -1 if unknown.
+ /// </param>
+ /// <param name="outSize">
+ /// output Size. -1 if unknown.
+ /// </param>
+ /// <param name="progress">
+ /// callback progress reference.
+ /// </param>
+ /// <exception cref="SevenZip.DataErrorException">
+ /// if input stream is not valid
+ /// </exception>
+ void Code(System.IO.Stream inStream, System.IO.Stream outStream,
+ Int64 inSize, Int64 outSize, ICodeProgress progress);
+ };
+
+ /*
+ public interface ICoder2
+ {
+ void Code(ISequentialInStream []inStreams,
+ const UInt64 []inSizes,
+ ISequentialOutStream []outStreams,
+ UInt64 []outSizes,
+ ICodeProgress progress);
+ };
+ */
+
+ /// <summary>
+ /// Provides the fields that represent properties idenitifiers for compressing.
+ /// </summary>
+ public enum CoderPropID
+ {
+ /// <summary>
+ /// Specifies default property.
+ /// </summary>
+ DefaultProp = 0,
+ /// <summary>
+ /// Specifies size of dictionary.
+ /// </summary>
+ DictionarySize,
+ /// <summary>
+ /// Specifies size of memory for PPM*.
+ /// </summary>
+ UsedMemorySize,
+ /// <summary>
+ /// Specifies order for PPM methods.
+ /// </summary>
+ Order,
+ /// <summary>
+ /// Specifies Block Size.
+ /// </summary>
+ BlockSize,
+ /// <summary>
+ /// Specifies number of postion state bits for LZMA (0 <= x <= 4).
+ /// </summary>
+ PosStateBits,
+ /// <summary>
+ /// Specifies number of literal context bits for LZMA (0 <= x <= 8).
+ /// </summary>
+ LitContextBits,
+ /// <summary>
+ /// Specifies number of literal position bits for LZMA (0 <= x <= 4).
+ /// </summary>
+ LitPosBits,
+ /// <summary>
+ /// Specifies number of fast bytes for LZ*.
+ /// </summary>
+ NumFastBytes,
+ /// <summary>
+ /// Specifies match finder. LZMA: "BT2", "BT4" or "BT4B".
+ /// </summary>
+ MatchFinder,
+ /// <summary>
+ /// Specifies the number of match finder cyckes.
+ /// </summary>
+ MatchFinderCycles,
+ /// <summary>
+ /// Specifies number of passes.
+ /// </summary>
+ NumPasses,
+ /// <summary>
+ /// Specifies number of algorithm.
+ /// </summary>
+ Algorithm,
+ /// <summary>
+ /// Specifies the number of threads.
+ /// </summary>
+ NumThreads,
+ /// <summary>
+ /// Specifies mode with end marker.
+ /// </summary>
+ EndMarker
+ };
+
+
+ public interface ISetCoderProperties
+ {
+ void SetCoderProperties(CoderPropID[] propIDs, object[] properties);
+ };
+
+ public interface IWriteCoderProperties
+ {
+ void WriteCoderProperties(System.IO.Stream outStream);
+ }
+
+ public interface ISetDecoderProperties
+ {
+ void SetDecoderProperties(byte[] properties);
+ }
+}
diff --git a/other-licenses/7zstub/src/Common/Alloc.cpp b/other-licenses/7zstub/src/Common/Alloc.cpp
deleted file mode 100644
index dcb331ee9f..0000000000
--- a/other-licenses/7zstub/src/Common/Alloc.cpp
+++ /dev/null
@@ -1,118 +0,0 @@
-// Common/Alloc.cpp
-
-#include "StdAfx.h"
-
-#ifdef _WIN32
-#include "MyWindows.h"
-#else
-#include <stdlib.h>
-#endif
-
-#include "Alloc.h"
-
-/* #define _SZ_ALLOC_DEBUG */
-/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
-#ifdef _SZ_ALLOC_DEBUG
-#include <stdio.h>
-int g_allocCount = 0;
-int g_allocCountMid = 0;
-int g_allocCountBig = 0;
-#endif
-
-void *MyAlloc(size_t size) throw()
-{
- if (size == 0)
- return 0;
- #ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc %10d bytes; count = %10d", size, g_allocCount++);
- #endif
- return ::malloc(size);
-}
-
-void MyFree(void *address) throw()
-{
- #ifdef _SZ_ALLOC_DEBUG
- if (address != 0)
- fprintf(stderr, "\nFree; count = %10d", --g_allocCount);
- #endif
-
- ::free(address);
-}
-
-#ifdef _WIN32
-
-void *MidAlloc(size_t size) throw()
-{
- if (size == 0)
- return 0;
- #ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++);
- #endif
- return ::VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
-}
-
-void MidFree(void *address) throw()
-{
- #ifdef _SZ_ALLOC_DEBUG
- if (address != 0)
- fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid);
- #endif
- if (address == 0)
- return;
- ::VirtualFree(address, 0, MEM_RELEASE);
-}
-
-static SIZE_T g_LargePageSize =
- #ifdef _WIN64
- (1 << 21);
- #else
- (1 << 22);
- #endif
-
-typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
-
-bool SetLargePageSize()
-{
- GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
- ::GetProcAddress(::GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
- if (largePageMinimum == 0)
- return false;
- SIZE_T size = largePageMinimum();
- if (size == 0 || (size & (size - 1)) != 0)
- return false;
- g_LargePageSize = size;
- return true;
-}
-
-
-void *BigAlloc(size_t size) throw()
-{
- if (size == 0)
- return 0;
- #ifdef _SZ_ALLOC_DEBUG
- fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
- #endif
-
- if (size >= (1 << 18))
- {
- void *res = ::VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
- MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
- if (res != 0)
- return res;
- }
- return ::VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
-}
-
-void BigFree(void *address) throw()
-{
- #ifdef _SZ_ALLOC_DEBUG
- if (address != 0)
- fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
- #endif
-
- if (address == 0)
- return;
- ::VirtualFree(address, 0, MEM_RELEASE);
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/Alloc.h b/other-licenses/7zstub/src/Common/Alloc.h
deleted file mode 100644
index 2ae3891de6..0000000000
--- a/other-licenses/7zstub/src/Common/Alloc.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Common/Alloc.h
-
-#ifndef __COMMON_ALLOC_H
-#define __COMMON_ALLOC_H
-
-#include <stddef.h>
-
-void *MyAlloc(size_t size) throw();
-void MyFree(void *address) throw();
-
-#ifdef _WIN32
-
-bool SetLargePageSize();
-
-void *MidAlloc(size_t size) throw();
-void MidFree(void *address) throw();
-void *BigAlloc(size_t size) throw();
-void BigFree(void *address) throw();
-
-#else
-
-#define MidAlloc(size) MyAlloc(size)
-#define MidFree(address) MyFree(address)
-#define BigAlloc(size) MyAlloc(size)
-#define BigFree(address) MyFree(address)
-
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/Buffer.h b/other-licenses/7zstub/src/Common/Buffer.h
deleted file mode 100644
index 5099a15ad7..0000000000
--- a/other-licenses/7zstub/src/Common/Buffer.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Common/Buffer.h
-
-#ifndef __COMMON_BUFFER_H
-#define __COMMON_BUFFER_H
-
-#include "Defs.h"
-
-template <class T> class CBuffer
-{
-protected:
- size_t _capacity;
- T *_items;
- void Free()
- {
- delete []_items;
- _items = 0;
- _capacity = 0;
- }
-public:
- CBuffer(): _capacity(0), _items(0) {};
- CBuffer(const CBuffer &buffer): _capacity(0), _items(0) { *this = buffer; }
- CBuffer(size_t size): _items(0), _capacity(0) { SetCapacity(size); }
- virtual ~CBuffer() { delete []_items; }
- operator T *() { return _items; };
- operator const T *() const { return _items; };
- size_t GetCapacity() const { return _capacity; }
- void SetCapacity(size_t newCapacity)
- {
- if (newCapacity == _capacity)
- return;
- T *newBuffer;
- if (newCapacity > 0)
- {
- newBuffer = new T[newCapacity];
- if(_capacity > 0)
- memmove(newBuffer, _items, MyMin(_capacity, newCapacity) * sizeof(T));
- }
- else
- newBuffer = 0;
- delete []_items;
- _items = newBuffer;
- _capacity = newCapacity;
- }
- CBuffer& operator=(const CBuffer &buffer)
- {
- Free();
- if(buffer._capacity > 0)
- {
- SetCapacity(buffer._capacity);
- memmove(_items, buffer._items, buffer._capacity * sizeof(T));
- }
- return *this;
- }
-};
-
-template <class T>
-bool operator==(const CBuffer<T>& b1, const CBuffer<T>& b2)
-{
- if (b1.GetCapacity() != b2.GetCapacity())
- return false;
- for (size_t i = 0; i < b1.GetCapacity(); i++)
- if (b1[i] != b2[i])
- return false;
- return true;
-}
-
-template <class T>
-bool operator!=(const CBuffer<T>& b1, const CBuffer<T>& b2)
-{
- return !(b1 == b2);
-}
-
-typedef CBuffer<char> CCharBuffer;
-typedef CBuffer<wchar_t> CWCharBuffer;
-typedef CBuffer<unsigned char> CByteBuffer;
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/CRC.cpp b/other-licenses/7zstub/src/Common/CRC.cpp
deleted file mode 100644
index 92bc009c2f..0000000000
--- a/other-licenses/7zstub/src/Common/CRC.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// Common/CRC.cpp
-
-#include "StdAfx.h"
-
-#include "CRC.h"
-
-static const UInt32 kCRCPoly = 0xEDB88320;
-
-UInt32 CCRC::Table[256];
-
-void CCRC::InitTable()
-{
- for (UInt32 i = 0; i < 256; i++)
- {
- UInt32 r = i;
- for (int j = 0; j < 8; j++)
- if (r & 1)
- r = (r >> 1) ^ kCRCPoly;
- else
- r >>= 1;
- CCRC::Table[i] = r;
- }
-}
-
-class CCRCTableInit
-{
-public:
- CCRCTableInit() { CCRC::InitTable(); }
-} g_CRCTableInit;
-
-void CCRC::UpdateByte(Byte b)
-{
- _value = Table[((Byte)(_value)) ^ b] ^ (_value >> 8);
-}
-
-void CCRC::UpdateUInt16(UInt16 v)
-{
- UpdateByte(Byte(v));
- UpdateByte(Byte(v >> 8));
-}
-
-void CCRC::UpdateUInt32(UInt32 v)
-{
- for (int i = 0; i < 4; i++)
- UpdateByte((Byte)(v >> (8 * i)));
-}
-
-void CCRC::UpdateUInt64(UInt64 v)
-{
- for (int i = 0; i < 8; i++)
- UpdateByte((Byte)(v >> (8 * i)));
-}
-
-void CCRC::Update(const void *data, size_t size)
-{
- UInt32 v = _value;
- const Byte *p = (const Byte *)data;
- for (; size > 0 ; size--, p++)
- v = Table[((Byte)(v)) ^ *p] ^ (v >> 8);
- _value = v;
-}
diff --git a/other-licenses/7zstub/src/Common/CRC.h b/other-licenses/7zstub/src/Common/CRC.h
deleted file mode 100644
index c9d43d0055..0000000000
--- a/other-licenses/7zstub/src/Common/CRC.h
+++ /dev/null
@@ -1,36 +0,0 @@
-// Common/CRC.h
-
-#ifndef __COMMON_CRC_H
-#define __COMMON_CRC_H
-
-#include <stddef.h>
-#include "Types.h"
-
-class CCRC
-{
- UInt32 _value;
-public:
- static UInt32 Table[256];
- static void InitTable();
-
- CCRC(): _value(0xFFFFFFFF){};
- void Init() { _value = 0xFFFFFFFF; }
- void UpdateByte(Byte v);
- void UpdateUInt16(UInt16 v);
- void UpdateUInt32(UInt32 v);
- void UpdateUInt64(UInt64 v);
- void Update(const void *data, size_t size);
- UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
- static UInt32 CalculateDigest(const void *data, size_t size)
- {
- CCRC crc;
- crc.Update(data, size);
- return crc.GetDigest();
- }
- static bool VerifyDigest(UInt32 digest, const void *data, size_t size)
- {
- return (CalculateDigest(data, size) == digest);
- }
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/ComTry.h b/other-licenses/7zstub/src/Common/ComTry.h
deleted file mode 100644
index 98e5927663..0000000000
--- a/other-licenses/7zstub/src/Common/ComTry.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// ComTry.h
-
-#ifndef __COM_TRY_H
-#define __COM_TRY_H
-
-#include "MyWindows.h"
-// #include "Exception.h"
-// #include "NewHandler.h"
-
-#define COM_TRY_BEGIN try {
-#define COM_TRY_END } catch(...) { return E_OUTOFMEMORY; }
-
- // catch(const CNewException &) { return E_OUTOFMEMORY; }\
- // catch(const CSystemException &e) { return e.ErrorCode; }\
- // catch(...) { return E_FAIL; }
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/CommandLineParser.cpp b/other-licenses/7zstub/src/Common/CommandLineParser.cpp
deleted file mode 100644
index 8f6d2f8130..0000000000
--- a/other-licenses/7zstub/src/Common/CommandLineParser.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-// CommandLineParser.cpp
-
-#include "StdAfx.h"
-
-#include "CommandLineParser.h"
-
-namespace NCommandLineParser {
-
-void SplitCommandLine(const UString &src, UString &dest1, UString &dest2)
-{
- dest1.Empty();
- dest2.Empty();
- bool quoteMode = false;
- int i;
- for (i = 0; i < src.Length(); i++)
- {
- wchar_t c = src[i];
- if (c == L'\"')
- quoteMode = !quoteMode;
- else if (c == L' ' && !quoteMode)
- {
- i++;
- break;
- }
- else
- dest1 += c;
- }
- dest2 = src.Mid(i);
-}
-
-void SplitCommandLine(const UString &s, UStringVector &parts)
-{
- UString sTemp = s;
- sTemp.Trim();
- parts.Clear();
- while (true)
- {
- UString s1, s2;
- SplitCommandLine(sTemp, s1, s2);
- // s1.Trim();
- // s2.Trim();
- if (!s1.IsEmpty())
- parts.Add(s1);
- if (s2.IsEmpty())
- return;
- sTemp = s2;
- }
-}
-
-
-static const wchar_t kSwitchID1 = '-';
-// static const wchar_t kSwitchID2 = '/';
-
-static const wchar_t kSwitchMinus = '-';
-static const wchar_t *kStopSwitchParsing = L"--";
-
-static bool IsItSwitchChar(wchar_t c)
-{
- return (c == kSwitchID1 /*|| c == kSwitchID2 */);
-}
-
-CParser::CParser(int numSwitches):
- _numSwitches(numSwitches)
-{
- _switches = new CSwitchResult[_numSwitches];
-}
-
-CParser::~CParser()
-{
- delete []_switches;
-}
-
-void CParser::ParseStrings(const CSwitchForm *switchForms,
- const UStringVector &commandStrings)
-{
- int numCommandStrings = commandStrings.Size();
- bool stopSwitch = false;
- for (int i = 0; i < numCommandStrings; i++)
- {
- const UString &s = commandStrings[i];
- if (stopSwitch)
- NonSwitchStrings.Add(s);
- else
- if (s == kStopSwitchParsing)
- stopSwitch = true;
- else
- if (!ParseString(s, switchForms))
- NonSwitchStrings.Add(s);
- }
-}
-
-// if string contains switch then function updates switch structures
-// out: (string is a switch)
-bool CParser::ParseString(const UString &s, const CSwitchForm *switchForms)
-{
- int len = s.Length();
- if (len == 0)
- return false;
- int pos = 0;
- if (!IsItSwitchChar(s[pos]))
- return false;
- while(pos < len)
- {
- if (IsItSwitchChar(s[pos]))
- pos++;
- const int kNoLen = -1;
- int matchedSwitchIndex = 0; // GCC Warning
- int maxLen = kNoLen;
- for(int switchIndex = 0; switchIndex < _numSwitches; switchIndex++)
- {
- int switchLen = MyStringLen(switchForms[switchIndex].IDString);
- if (switchLen <= maxLen || pos + switchLen > len)
- continue;
-
- UString temp = s + pos;
- temp = temp.Left(switchLen);
- if(temp.CompareNoCase(switchForms[switchIndex].IDString) == 0)
- // if(_strnicmp(switchForms[switchIndex].IDString, LPCSTR(s) + pos, switchLen) == 0)
- {
- matchedSwitchIndex = switchIndex;
- maxLen = switchLen;
- }
- }
- if (maxLen == kNoLen)
- throw "maxLen == kNoLen";
- CSwitchResult &matchedSwitch = _switches[matchedSwitchIndex];
- const CSwitchForm &switchForm = switchForms[matchedSwitchIndex];
- if ((!switchForm.Multi) && matchedSwitch.ThereIs)
- throw "switch must be single";
- matchedSwitch.ThereIs = true;
- pos += maxLen;
- int tailSize = len - pos;
- NSwitchType::EEnum type = switchForm.Type;
- switch(type)
- {
- case NSwitchType::kPostMinus:
- {
- if (tailSize == 0)
- matchedSwitch.WithMinus = false;
- else
- {
- matchedSwitch.WithMinus = (s[pos] == kSwitchMinus);
- if (matchedSwitch.WithMinus)
- pos++;
- }
- break;
- }
- case NSwitchType::kPostChar:
- {
- if (tailSize < switchForm.MinLen)
- throw "switch is not full";
- UString set = switchForm.PostCharSet;
- const int kEmptyCharValue = -1;
- if (tailSize == 0)
- matchedSwitch.PostCharIndex = kEmptyCharValue;
- else
- {
- int index = set.Find(s[pos]);
- if (index < 0)
- matchedSwitch.PostCharIndex = kEmptyCharValue;
- else
- {
- matchedSwitch.PostCharIndex = index;
- pos++;
- }
- }
- break;
- }
- case NSwitchType::kLimitedPostString:
- case NSwitchType::kUnLimitedPostString:
- {
- int minLen = switchForm.MinLen;
- if (tailSize < minLen)
- throw "switch is not full";
- if (type == NSwitchType::kUnLimitedPostString)
- {
- matchedSwitch.PostStrings.Add(s.Mid(pos));
- return true;
- }
- int maxLen = switchForm.MaxLen;
- UString stringSwitch = s.Mid(pos, minLen);
- pos += minLen;
- for(int i = minLen; i < maxLen && pos < len; i++, pos++)
- {
- wchar_t c = s[pos];
- if (IsItSwitchChar(c))
- break;
- stringSwitch += c;
- }
- matchedSwitch.PostStrings.Add(stringSwitch);
- break;
- }
- case NSwitchType::kSimple:
- break;
- }
- }
- return true;
-}
-
-const CSwitchResult& CParser::operator[](size_t index) const
-{
- return _switches[index];
-}
-
-/////////////////////////////////
-// Command parsing procedures
-
-int ParseCommand(int numCommandForms, const CCommandForm *commandForms,
- const UString &commandString, UString &postString)
-{
- for(int i = 0; i < numCommandForms; i++)
- {
- const UString id = commandForms[i].IDString;
- if (commandForms[i].PostStringMode)
- {
- if(commandString.Find(id) == 0)
- {
- postString = commandString.Mid(id.Length());
- return i;
- }
- }
- else
- if (commandString == id)
- {
- postString.Empty();
- return i;
- }
- }
- return -1;
-}
-
-}
diff --git a/other-licenses/7zstub/src/Common/CommandLineParser.h b/other-licenses/7zstub/src/Common/CommandLineParser.h
deleted file mode 100644
index b74801a382..0000000000
--- a/other-licenses/7zstub/src/Common/CommandLineParser.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Common/CommandLineParser.h
-
-#ifndef __COMMON_COMMANDLINEPARSER_H
-#define __COMMON_COMMANDLINEPARSER_H
-
-#include "Common/String.h"
-
-namespace NCommandLineParser {
-
-void SplitCommandLine(const UString &src, UString &dest1, UString &dest2);
-void SplitCommandLine(const UString &s, UStringVector &parts);
-
-namespace NSwitchType {
- enum EEnum
- {
- kSimple,
- kPostMinus,
- kLimitedPostString,
- kUnLimitedPostString,
- kPostChar
- };
-}
-
-struct CSwitchForm
-{
- const wchar_t *IDString;
- NSwitchType::EEnum Type;
- bool Multi;
- int MinLen;
- int MaxLen;
- const wchar_t *PostCharSet;
-};
-
-struct CSwitchResult
-{
- bool ThereIs;
- bool WithMinus;
- UStringVector PostStrings;
- int PostCharIndex;
- CSwitchResult(): ThereIs(false) {};
-};
-
-class CParser
-{
- int _numSwitches;
- CSwitchResult *_switches;
- bool ParseString(const UString &s, const CSwitchForm *switchForms);
-public:
- UStringVector NonSwitchStrings;
- CParser(int numSwitches);
- ~CParser();
- void ParseStrings(const CSwitchForm *switchForms,
- const UStringVector &commandStrings);
- const CSwitchResult& operator[](size_t index) const;
-};
-
-/////////////////////////////////
-// Command parsing procedures
-
-struct CCommandForm
-{
- wchar_t *IDString;
- bool PostStringMode;
-};
-
-// Returns: Index of form and postString; -1, if there is no match
-int ParseCommand(int numCommandForms, const CCommandForm *commandForms,
- const UString &commandString, UString &postString);
-
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/Defs.h b/other-licenses/7zstub/src/Common/Defs.h
deleted file mode 100644
index 69b8ecea82..0000000000
--- a/other-licenses/7zstub/src/Common/Defs.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Common/Defs.h
-
-#ifndef __COMMON_DEFS_H
-#define __COMMON_DEFS_H
-
-template <class T> inline T MyMin(T a, T b)
- { return a < b ? a : b; }
-template <class T> inline T MyMax(T a, T b)
- { return a > b ? a : b; }
-
-template <class T> inline int MyCompare(T a, T b)
- { return a < b ? -1 : (a == b ? 0 : 1); }
-
-inline int BoolToInt(bool value)
- { return (value ? 1: 0); }
-
-inline bool IntToBool(int value)
- { return (value != 0); }
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/DynamicBuffer.h b/other-licenses/7zstub/src/Common/DynamicBuffer.h
deleted file mode 100644
index e75e3c4735..0000000000
--- a/other-licenses/7zstub/src/Common/DynamicBuffer.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Common/DynamicBuffer.h
-
-#ifndef __COMMON_DYNAMICBUFFER_H
-#define __COMMON_DYNAMICBUFFER_H
-
-#include "Buffer.h"
-
-template <class T> class CDynamicBuffer: public CBuffer<T>
-{
- void GrowLength(size_t size)
- {
- size_t delta;
- if (this->_capacity > 64)
- delta = this->_capacity / 4;
- else if (this->_capacity > 8)
- delta = 16;
- else
- delta = 4;
- delta = MyMax(delta, size);
- SetCapacity(this->_capacity + delta);
- }
-public:
- CDynamicBuffer(): CBuffer<T>() {};
- CDynamicBuffer(const CDynamicBuffer &buffer): CBuffer<T>(buffer) {};
- CDynamicBuffer(size_t size): CBuffer<T>(size) {};
- CDynamicBuffer& operator=(const CDynamicBuffer &buffer)
- {
- this->Free();
- if(buffer._capacity > 0)
- {
- SetCapacity(buffer._capacity);
- memmove(this->_items, buffer._items, buffer._capacity * sizeof(T));
- }
- return *this;
- }
- void EnsureCapacity(size_t capacity)
- {
- if (this->_capacity < capacity)
- GrowLength(capacity - this->_capacity);
- }
-};
-
-typedef CDynamicBuffer<char> CCharDynamicBuffer;
-typedef CDynamicBuffer<wchar_t> CWCharDynamicBuffer;
-typedef CDynamicBuffer<unsigned char> CByteDynamicBuffer;
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/IntToString.cpp b/other-licenses/7zstub/src/Common/IntToString.cpp
deleted file mode 100644
index 4f22781441..0000000000
--- a/other-licenses/7zstub/src/Common/IntToString.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// Common/IntToString.cpp
-
-#include "StdAfx.h"
-
-#include "IntToString.h"
-
-void ConvertUInt64ToString(UInt64 value, char *s, UInt32 base)
-{
- if (base < 2 || base > 36)
- {
- *s = L'\0';
- return;
- }
- char temp[72];
- int pos = 0;
- do
- {
- int delta = (int)(value % base);
- temp[pos++] = (delta < 10) ? ('0' + delta) : ('a' + (delta - 10));
- value /= base;
- }
- while (value != 0);
- do
- *s++ = temp[--pos];
- while(pos > 0);
- *s = '\0';
-}
-
-void ConvertUInt64ToString(UInt64 value, wchar_t *s)
-{
- wchar_t temp[32];
- int pos = 0;
- do
- {
- temp[pos++] = L'0' + (int)(value % 10);
- value /= 10;
- }
- while (value != 0);
- do
- *s++ = temp[--pos];
- while(pos > 0);
- *s = L'\0';
-}
-
-void ConvertInt64ToString(Int64 value, char *s)
-{
- if (value < 0)
- {
- *s++ = '-';
- value = -value;
- }
- ConvertUInt64ToString(value, s);
-}
-
-void ConvertInt64ToString(Int64 value, wchar_t *s)
-{
- if (value < 0)
- {
- *s++ = L'-';
- value = -value;
- }
- ConvertUInt64ToString(value, s);
-}
diff --git a/other-licenses/7zstub/src/Common/IntToString.h b/other-licenses/7zstub/src/Common/IntToString.h
deleted file mode 100644
index 2f50ba95ab..0000000000
--- a/other-licenses/7zstub/src/Common/IntToString.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Common/IntToString.h
-
-#ifndef __COMMON_INTTOSTRING_H
-#define __COMMON_INTTOSTRING_H
-
-#include <stddef.h>
-#include "Types.h"
-
-void ConvertUInt64ToString(UInt64 value, char *s, UInt32 base = 10);
-void ConvertUInt64ToString(UInt64 value, wchar_t *s);
-
-void ConvertInt64ToString(Int64 value, char *s);
-void ConvertInt64ToString(Int64 value, wchar_t *s);
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/MyCom.h b/other-licenses/7zstub/src/Common/MyCom.h
deleted file mode 100644
index 8476b57282..0000000000
--- a/other-licenses/7zstub/src/Common/MyCom.h
+++ /dev/null
@@ -1,203 +0,0 @@
-// MyCom.h
-
-#ifndef __MYCOM_H
-#define __MYCOM_H
-
-#include "MyWindows.h"
-
-#define RINOK(x) { HRESULT __result_ = (x); if(__result_ != S_OK) return __result_; }
-
-template <class T>
-class CMyComPtr
-{
- T* _p;
-public:
- // typedef T _PtrClass;
- CMyComPtr() { _p = NULL;}
- CMyComPtr(T* p) {if ((_p = p) != NULL) p->AddRef(); }
- CMyComPtr(const CMyComPtr<T>& lp)
- {
- if ((_p = lp._p) != NULL)
- _p->AddRef();
- }
- ~CMyComPtr() { if (_p) _p->Release(); }
- void Release() { if (_p) { _p->Release(); _p = NULL; } }
- operator T*() const { return (T*)_p; }
- // T& operator*() const { return *_p; }
- T** operator&() { return &_p; }
- T* operator->() const { return _p; }
- T* operator=(T* p)
- {
- if (p != 0)
- p->AddRef();
- if (_p)
- _p->Release();
- _p = p;
- return p;
- }
- T* operator=(const CMyComPtr<T>& lp) { return (*this = lp._p); }
- bool operator!() const { return (_p == NULL); }
- // bool operator==(T* pT) const { return _p == pT; }
- // Compare two objects for equivalence
- void Attach(T* p2)
- {
- Release();
- _p = p2;
- }
- T* Detach()
- {
- T* pt = _p;
- _p = NULL;
- return pt;
- }
- #ifdef _WIN32
- HRESULT CoCreateInstance(REFCLSID rclsid, REFIID iid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
- {
- return ::CoCreateInstance(rclsid, pUnkOuter, dwClsContext, iid, (void**)&_p);
- }
- #endif
- /*
- HRESULT CoCreateInstance(LPCOLESTR szProgID, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL)
- {
- CLSID clsid;
- HRESULT hr = CLSIDFromProgID(szProgID, &clsid);
- ATLASSERT(_p == NULL);
- if (SUCCEEDED(hr))
- hr = ::CoCreateInstance(clsid, pUnkOuter, dwClsContext, __uuidof(T), (void**)&_p);
- return hr;
- }
- */
- template <class Q>
- HRESULT QueryInterface(REFGUID iid, Q** pp) const
- {
- return _p->QueryInterface(iid, (void**)pp);
- }
-};
-
-//////////////////////////////////////////////////////////
-
-class CMyComBSTR
-{
-public:
- BSTR m_str;
- CMyComBSTR() { m_str = NULL; }
- CMyComBSTR(LPCOLESTR pSrc) { m_str = ::SysAllocString(pSrc); }
- // CMyComBSTR(int nSize) { m_str = ::SysAllocStringLen(NULL, nSize); }
- // CMyComBSTR(int nSize, LPCOLESTR sz) { m_str = ::SysAllocStringLen(sz, nSize); }
- CMyComBSTR(const CMyComBSTR& src) { m_str = src.MyCopy(); }
- /*
- CMyComBSTR(REFGUID src)
- {
- LPOLESTR szGuid;
- StringFromCLSID(src, &szGuid);
- m_str = ::SysAllocString(szGuid);
- CoTaskMemFree(szGuid);
- }
- */
- ~CMyComBSTR() { ::SysFreeString(m_str); }
- CMyComBSTR& operator=(const CMyComBSTR& src)
- {
- if (m_str != src.m_str)
- {
- if (m_str)
- ::SysFreeString(m_str);
- m_str = src.MyCopy();
- }
- return *this;
- }
- CMyComBSTR& operator=(LPCOLESTR pSrc)
- {
- ::SysFreeString(m_str);
- m_str = ::SysAllocString(pSrc);
- return *this;
- }
- unsigned int Length() const { return ::SysStringLen(m_str); }
- operator BSTR() const { return m_str; }
- BSTR* operator&() { return &m_str; }
- BSTR MyCopy() const
- {
- int byteLen = ::SysStringByteLen(m_str);
- BSTR res = ::SysAllocStringByteLen(NULL, byteLen);
- memmove(res, m_str, byteLen);
- return res;
- }
- void Attach(BSTR src) { m_str = src; }
- BSTR Detach()
- {
- BSTR s = m_str;
- m_str = NULL;
- return s;
- }
- void Empty()
- {
- ::SysFreeString(m_str);
- m_str = NULL;
- }
- bool operator!() const { return (m_str == NULL); }
-};
-
-
-//////////////////////////////////////////////////////////
-
-class CMyUnknownImp
-{
-public:
- ULONG __m_RefCount;
- CMyUnknownImp(): __m_RefCount(0) {}
-};
-
-#define MY_QUERYINTERFACE_BEGIN STDMETHOD(QueryInterface) \
- (REFGUID iid, void **outObject) {
-
-#define MY_QUERYINTERFACE_ENTRY(i) if (iid == IID_ ## i) \
- { *outObject = (void *)(i *)this; AddRef(); return S_OK; }
-
-#define MY_QUERYINTERFACE_END return E_NOINTERFACE; }
-
-#define MY_ADDREF_RELEASE \
-STDMETHOD_(ULONG, AddRef)() { return ++__m_RefCount; } \
-STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \
- return __m_RefCount; delete this; return 0; }
-
-#define MY_UNKNOWN_IMP_SPEC(i) \
- MY_QUERYINTERFACE_BEGIN \
- i \
- MY_QUERYINTERFACE_END \
- MY_ADDREF_RELEASE
-
-
-#define MY_UNKNOWN_IMP STDMETHOD(QueryInterface)(REFGUID, void **) { \
- MY_QUERYINTERFACE_END \
- MY_ADDREF_RELEASE
-
-#define MY_UNKNOWN_IMP1(i) MY_UNKNOWN_IMP_SPEC( \
- MY_QUERYINTERFACE_ENTRY(i) \
- )
-
-#define MY_UNKNOWN_IMP2(i1, i2) MY_UNKNOWN_IMP_SPEC( \
- MY_QUERYINTERFACE_ENTRY(i1) \
- MY_QUERYINTERFACE_ENTRY(i2) \
- )
-
-#define MY_UNKNOWN_IMP3(i1, i2, i3) MY_UNKNOWN_IMP_SPEC( \
- MY_QUERYINTERFACE_ENTRY(i1) \
- MY_QUERYINTERFACE_ENTRY(i2) \
- MY_QUERYINTERFACE_ENTRY(i3) \
- )
-
-#define MY_UNKNOWN_IMP4(i1, i2, i3, i4) MY_UNKNOWN_IMP_SPEC( \
- MY_QUERYINTERFACE_ENTRY(i1) \
- MY_QUERYINTERFACE_ENTRY(i2) \
- MY_QUERYINTERFACE_ENTRY(i3) \
- MY_QUERYINTERFACE_ENTRY(i4) \
- )
-
-#define MY_UNKNOWN_IMP5(i1, i2, i3, i4, i5) MY_UNKNOWN_IMP_SPEC( \
- MY_QUERYINTERFACE_ENTRY(i1) \
- MY_QUERYINTERFACE_ENTRY(i2) \
- MY_QUERYINTERFACE_ENTRY(i3) \
- MY_QUERYINTERFACE_ENTRY(i4) \
- MY_QUERYINTERFACE_ENTRY(i5) \
- )
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/MyUnknown.h b/other-licenses/7zstub/src/Common/MyUnknown.h
deleted file mode 100644
index 6cd32caddb..0000000000
--- a/other-licenses/7zstub/src/Common/MyUnknown.h
+++ /dev/null
@@ -1,24 +0,0 @@
-// MyUnknown.h
-
-#ifndef __MYUNKNOWN_H
-#define __MYUNKNOWN_H
-
-#ifdef _WIN32
-
-#ifdef _WIN32_WCE
-#if (_WIN32_WCE > 300)
-#include <basetyps.h>
-#else
-#define MIDL_INTERFACE(x) struct
-#endif
-#else
-#include <basetyps.h>
-#endif
-
-#include <unknwn.h>
-
-#else
-#include "MyWindows.h"
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/MyWindows.cpp b/other-licenses/7zstub/src/Common/MyWindows.cpp
deleted file mode 100644
index a715036376..0000000000
--- a/other-licenses/7zstub/src/Common/MyWindows.cpp
+++ /dev/null
@@ -1,113 +0,0 @@
-// MyWindows.cpp
-
-#include "StdAfx.h"
-
-#ifndef _WIN32
-
-#include "MyWindows.h"
-#include "Types.h"
-#include <malloc.h>
-
-static inline void *AllocateForBSTR(size_t cb) { return ::malloc(cb); }
-static inline void FreeForBSTR(void *pv) { ::free(pv);}
-
-static UINT MyStringLen(const wchar_t *s)
-{
- UINT i;
- for (i = 0; s[i] != '\0'; i++);
- return i;
-}
-
-BSTR SysAllocStringByteLen(LPCSTR psz, UINT len)
-{
- int realLen = len + sizeof(UINT) + sizeof(OLECHAR) + sizeof(OLECHAR);
- void *p = AllocateForBSTR(realLen);
- if (p == 0)
- return 0;
- *(UINT *)p = len;
- BSTR bstr = (BSTR)((UINT *)p + 1);
- memmove(bstr, psz, len);
- Byte *pb = ((Byte *)bstr) + len;
- for (int i = 0; i < sizeof(OLECHAR) * 2; i++)
- pb[i] = 0;
- return bstr;
-}
-
-BSTR SysAllocString(const OLECHAR *sz)
-{
- if (sz == 0)
- return 0;
- UINT strLen = MyStringLen(sz);
- UINT len = (strLen + 1) * sizeof(OLECHAR);
- void *p = AllocateForBSTR(len + sizeof(UINT));
- if (p == 0)
- return 0;
- *(UINT *)p = strLen;
- BSTR bstr = (BSTR)((UINT *)p + 1);
- memmove(bstr, sz, len);
- return bstr;
-}
-
-void SysFreeString(BSTR bstr)
-{
- if (bstr != 0)
- FreeForBSTR((UINT *)bstr - 1);
-}
-
-UINT SysStringByteLen(BSTR bstr)
-{
- if (bstr == 0)
- return 0;
- return *((UINT *)bstr - 1);
-}
-
-UINT SysStringLen(BSTR bstr)
-{
- return SysStringByteLen(bstr) / sizeof(OLECHAR);
-}
-
-HRESULT VariantClear(VARIANTARG *prop)
-{
- if (prop->vt == VT_BSTR)
- SysFreeString(prop->bstrVal);
- prop->vt = VT_EMPTY;
- return S_OK;
-}
-
-HRESULT VariantCopy(VARIANTARG *dest, VARIANTARG *src)
-{
- HRESULT res = ::VariantClear(dest);
- if (res != S_OK)
- return res;
- if (src->vt == VT_BSTR)
- {
- dest->bstrVal = SysAllocStringByteLen((LPCSTR)src->bstrVal,
- SysStringByteLen(src->bstrVal));
- if (dest->bstrVal == 0)
- return E_OUTOFMEMORY;
- dest->vt = VT_BSTR;
- }
- else
- *dest = *src;
- return S_OK;
-}
-
-LONG CompareFileTime(const FILETIME* ft1, const FILETIME* ft2)
-{
- if(ft1->dwHighDateTime < ft2->dwHighDateTime)
- return -1;
- if(ft1->dwHighDateTime > ft2->dwHighDateTime)
- return 1;
- if(ft1->dwLowDateTime < ft2->dwLowDateTime)
- return -1;
- if(ft1->dwLowDateTime > ft2->dwLowDateTime)
- return 1;
- return 0;
-}
-
-DWORD GetLastError()
-{
- return 0;
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/MyWindows.h b/other-licenses/7zstub/src/Common/MyWindows.h
deleted file mode 100644
index 773d185fe9..0000000000
--- a/other-licenses/7zstub/src/Common/MyWindows.h
+++ /dev/null
@@ -1,200 +0,0 @@
-// MyWindows.h
-
-#ifndef __MYWINDOWS_H
-#define __MYWINDOWS_H
-
-#ifdef _WIN32
-
-#include <windows.h>
-
-#define CHAR_PATH_SEPARATOR '\\'
-#define WCHAR_PATH_SEPARATOR L'\\'
-#define STRING_PATH_SEPARATOR "\\"
-#define WSTRING_PATH_SEPARATOR L"\\"
-
-#else
-
-#define CHAR_PATH_SEPARATOR '/'
-#define WCHAR_PATH_SEPARATOR L'/'
-#define STRING_PATH_SEPARATOR "/"
-#define WSTRING_PATH_SEPARATOR L"/"
-
-#include <stddef.h> // for wchar_t
-#include <string.h>
-
-#include "MyGuidDef.h"
-
-typedef char CHAR;
-typedef unsigned char UCHAR;
-
-#undef BYTE
-typedef unsigned char BYTE;
-
-typedef short SHORT;
-typedef unsigned short USHORT;
-
-#undef WORD
-typedef unsigned short WORD;
-typedef short VARIANT_BOOL;
-
-typedef int INT;
-typedef Int32 INT32;
-typedef unsigned int UINT;
-typedef UInt32 UINT32;
-typedef INT32 LONG; // LONG, ULONG and DWORD must be 32-bit
-typedef UINT32 ULONG;
-
-#undef DWORD
-typedef UINT32 DWORD;
-
-typedef Int64 LONGLONG;
-typedef UInt64 ULONGLONG;
-
-typedef struct LARGE_INTEGER { LONGLONG QuadPart; }LARGE_INTEGER;
-typedef struct _ULARGE_INTEGER { ULONGLONG QuadPart;} ULARGE_INTEGER;
-
-typedef const CHAR *LPCSTR;
-typedef CHAR TCHAR;
-typedef const TCHAR *LPCTSTR;
-typedef wchar_t WCHAR;
-typedef WCHAR OLECHAR;
-typedef const WCHAR *LPCWSTR;
-typedef OLECHAR *BSTR;
-typedef const OLECHAR *LPCOLESTR;
-typedef OLECHAR *LPOLESTR;
-
-typedef struct _FILETIME
-{
- DWORD dwLowDateTime;
- DWORD dwHighDateTime;
-}FILETIME;
-
-#define HRESULT LONG
-#define FAILED(Status) ((HRESULT)(Status)<0)
-typedef ULONG PROPID;
-typedef LONG SCODE;
-
-#define S_OK ((HRESULT)0x00000000L)
-#define S_FALSE ((HRESULT)0x00000001L)
-#define E_NOTIMPL ((HRESULT)0x80004001L)
-#define E_NOINTERFACE ((HRESULT)0x80004002L)
-#define E_ABORT ((HRESULT)0x80004004L)
-#define E_FAIL ((HRESULT)0x80004005L)
-#define STG_E_INVALIDFUNCTION ((HRESULT)0x80030001L)
-#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
-#define E_INVALIDARG ((HRESULT)0x80070057L)
-
-#ifdef _MSC_VER
-#define STDMETHODCALLTYPE __stdcall
-#else
-#define STDMETHODCALLTYPE
-#endif
-
-#define STDMETHOD_(t, f) virtual t STDMETHODCALLTYPE f
-#define STDMETHOD(f) STDMETHOD_(HRESULT, f)
-#define STDMETHODIMP_(type) type STDMETHODCALLTYPE
-#define STDMETHODIMP STDMETHODIMP_(HRESULT)
-
-#define PURE = 0
-
-#define MIDL_INTERFACE(x) struct
-
-struct IUnknown
-{
- STDMETHOD(QueryInterface) (REFIID iid, void **outObject) PURE;
- STDMETHOD_(ULONG, AddRef)() PURE;
- STDMETHOD_(ULONG, Release)() PURE;
-};
-
-typedef IUnknown *LPUNKNOWN;
-
-#define VARIANT_TRUE ((VARIANT_BOOL)-1)
-#define VARIANT_FALSE ((VARIANT_BOOL)0)
-
-enum VARENUM
-{
- VT_EMPTY = 0,
- VT_NULL = 1,
- VT_I2 = 2,
- VT_I4 = 3,
- VT_R4 = 4,
- VT_R8 = 5,
- VT_CY = 6,
- VT_DATE = 7,
- VT_BSTR = 8,
- VT_DISPATCH = 9,
- VT_ERROR = 10,
- VT_BOOL = 11,
- VT_VARIANT = 12,
- VT_UNKNOWN = 13,
- VT_DECIMAL = 14,
- VT_I1 = 16,
- VT_UI1 = 17,
- VT_UI2 = 18,
- VT_UI4 = 19,
- VT_I8 = 20,
- VT_UI8 = 21,
- VT_INT = 22,
- VT_UINT = 23,
- VT_VOID = 24,
- VT_HRESULT = 25,
- VT_FILETIME = 64
-};
-
-typedef unsigned short VARTYPE;
-typedef WORD PROPVAR_PAD1;
-typedef WORD PROPVAR_PAD2;
-typedef WORD PROPVAR_PAD3;
-
-typedef struct tagPROPVARIANT
-{
- VARTYPE vt;
- PROPVAR_PAD1 wReserved1;
- PROPVAR_PAD2 wReserved2;
- PROPVAR_PAD3 wReserved3;
- union
- {
- CHAR cVal;
- UCHAR bVal;
- SHORT iVal;
- USHORT uiVal;
- LONG lVal;
- ULONG ulVal;
- INT intVal;
- UINT uintVal;
- LARGE_INTEGER hVal;
- ULARGE_INTEGER uhVal;
- VARIANT_BOOL boolVal;
- SCODE scode;
- FILETIME filetime;
- BSTR bstrVal;
- };
-} PROPVARIANT;
-
-typedef PROPVARIANT tagVARIANT;
-typedef tagVARIANT VARIANT;
-typedef VARIANT VARIANTARG;
-
-MY_EXTERN_C BSTR SysAllocStringByteLen(LPCSTR psz, UINT len);
-MY_EXTERN_C BSTR SysAllocString(const OLECHAR *sz);
-MY_EXTERN_C void SysFreeString(BSTR bstr);
-MY_EXTERN_C UINT SysStringByteLen(BSTR bstr);
-MY_EXTERN_C UINT SysStringLen(BSTR bstr);
-
-MY_EXTERN_C DWORD GetLastError();
-MY_EXTERN_C HRESULT VariantClear(VARIANTARG *prop);
-MY_EXTERN_C HRESULT VariantCopy(VARIANTARG *dest, VARIANTARG *src);
-MY_EXTERN_C LONG CompareFileTime(const FILETIME* ft1, const FILETIME* ft2);
-
-#define CP_ACP 0
-#define CP_OEMCP 1
-
-typedef enum tagSTREAM_SEEK
-{
- STREAM_SEEK_SET = 0,
- STREAM_SEEK_CUR = 1,
- STREAM_SEEK_END = 2
-} STREAM_SEEK;
-
-#endif
-#endif
diff --git a/other-licenses/7zstub/src/Common/NewHandler.cpp b/other-licenses/7zstub/src/Common/NewHandler.cpp
deleted file mode 100644
index 75b1cf7dc3..0000000000
--- a/other-licenses/7zstub/src/Common/NewHandler.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-// NewHandler.cpp
-
-#include "StdAfx.h"
-
-#include <stdlib.h>
-
-#include "NewHandler.h"
-
-// #define DEBUG_MEMORY_LEAK
-
-#ifndef DEBUG_MEMORY_LEAK
-
-#ifdef _WIN32
-void *
-#ifdef _MSC_VER
-__cdecl
-#endif
-operator new(size_t size)
-{
- // void *p = ::HeapAlloc(::GetProcessHeap(), 0, size);
- void *p = ::malloc(size);
- if (p == 0)
- throw CNewException();
- return p;
-}
-
-void
-#ifdef _MSC_VER
-__cdecl
-#endif
-operator delete(void *p) throw()
-{
- /*
- if (p == 0)
- return;
- ::HeapFree(::GetProcessHeap(), 0, p);
- */
- ::free(p);
-}
-#endif
-
-#else
-
-#pragma init_seg(lib)
-const int kDebugSize = 1000000;
-static void *a[kDebugSize];
-static int index = 0;
-
-static int numAllocs = 0;
-void * __cdecl operator new(size_t size)
-{
- numAllocs++;
- void *p = HeapAlloc(GetProcessHeap(), 0, size);
- if (index == 40)
- {
- int t = 1;
- }
- if (index < kDebugSize)
- {
- a[index] = p;
- index++;
- }
- if (p == 0)
- throw CNewException();
- printf("Alloc %6d, size = %8d\n", numAllocs, size);
- return p;
-}
-
-class CC
-{
-public:
- CC()
- {
- for (int i = 0; i < kDebugSize; i++)
- a[i] = 0;
- }
- ~CC()
- {
- for (int i = 0; i < kDebugSize; i++)
- if (a[i] != 0)
- return;
- }
-} g_CC;
-
-
-void __cdecl operator delete(void *p)
-{
- if (p == 0)
- return;
- /*
- for (int i = 0; i < index; i++)
- if (a[i] == p)
- a[i] = 0;
- */
- HeapFree(GetProcessHeap(), 0, p);
- numAllocs--;
- printf("Free %d\n", numAllocs);
-}
-
-#endif
-
-/*
-int MemErrorVC(size_t)
-{
- throw CNewException();
- // return 1;
-}
-CNewHandlerSetter::CNewHandlerSetter()
-{
- // MemErrorOldVCFunction = _set_new_handler(MemErrorVC);
-}
-CNewHandlerSetter::~CNewHandlerSetter()
-{
- // _set_new_handler(MemErrorOldVCFunction);
-}
-*/
diff --git a/other-licenses/7zstub/src/Common/NewHandler.h b/other-licenses/7zstub/src/Common/NewHandler.h
deleted file mode 100644
index 4c1727f824..0000000000
--- a/other-licenses/7zstub/src/Common/NewHandler.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Common/NewHandler.h
-
-#ifndef __COMMON_NEWHANDLER_H
-#define __COMMON_NEWHANDLER_H
-
-class CNewException {};
-
-#ifdef _WIN32
-void
-#ifdef _MSC_VER
-__cdecl
-#endif
-operator delete(void *p) throw();
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/Random.cpp b/other-licenses/7zstub/src/Common/Random.cpp
deleted file mode 100644
index 85d275c237..0000000000
--- a/other-licenses/7zstub/src/Common/Random.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// Common/Random.cpp
-
-#include "StdAfx.h"
-
-#include <time.h>
-#include <stdlib.h>
-
-#include "Common/Random.h"
-
-void CRandom::Init(unsigned int seed)
- { srand(seed); }
-
-void CRandom::Init()
- { Init((unsigned int)time(NULL)); }
-
-int CRandom::Generate() const
- { return rand(); }
diff --git a/other-licenses/7zstub/src/Common/Random.h b/other-licenses/7zstub/src/Common/Random.h
deleted file mode 100644
index f6fe5c4ef4..0000000000
--- a/other-licenses/7zstub/src/Common/Random.h
+++ /dev/null
@@ -1,16 +0,0 @@
-// Common/Random.h
-
-#ifndef __COMMON_RANDOM_H
-#define __COMMON_RANDOM_H
-
-class CRandom
-{
-public:
- void Init();
- void Init(unsigned int seed);
- int Generate() const;
-};
-
-#endif
-
-
diff --git a/other-licenses/7zstub/src/Common/StdInStream.cpp b/other-licenses/7zstub/src/Common/StdInStream.cpp
deleted file mode 100644
index e014f60b5b..0000000000
--- a/other-licenses/7zstub/src/Common/StdInStream.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Common/StdInStream.cpp
-
-#include "StdAfx.h"
-
-#include <tchar.h>
-#include "StdInStream.h"
-
-static const char kIllegalChar = '\0';
-static const char kNewLineChar = '\n';
-
-static const char *kEOFMessage = "Unexpected end of input stream";
-static const char *kReadErrorMessage ="Error reading input stream";
-static const char *kIllegalCharMessage = "Illegal character in input stream";
-
-static LPCTSTR kFileOpenMode = TEXT("r");
-
-CStdInStream g_StdIn(stdin);
-
-bool CStdInStream::Open(LPCTSTR fileName)
-{
- Close();
- _stream = _tfopen(fileName, kFileOpenMode);
- _streamIsOpen = (_stream != 0);
- return _streamIsOpen;
-}
-
-bool CStdInStream::Close()
-{
- if(!_streamIsOpen)
- return true;
- _streamIsOpen = (fclose(_stream) != 0);
- return !_streamIsOpen;
-}
-
-CStdInStream::~CStdInStream()
-{
- Close();
-}
-
-AString CStdInStream::ScanStringUntilNewLine()
-{
- AString s;
- while(true)
- {
- int intChar = GetChar();
- if(intChar == EOF)
- throw kEOFMessage;
- char c = char(intChar);
- if (c == kIllegalChar)
- throw kIllegalCharMessage;
- if(c == kNewLineChar)
- return s;
- s += c;
- }
-}
-
-void CStdInStream::ReadToString(AString &resultString)
-{
- resultString.Empty();
- int c;
- while((c = GetChar()) != EOF)
- resultString += char(c);
-}
-
-bool CStdInStream::Eof()
-{
- return (feof(_stream) != 0);
-}
-
-int CStdInStream::GetChar()
-{
- int c = getc(_stream);
- if(c == EOF && !Eof())
- throw kReadErrorMessage;
- return c;
-}
-
-
diff --git a/other-licenses/7zstub/src/Common/StdInStream.h b/other-licenses/7zstub/src/Common/StdInStream.h
deleted file mode 100644
index 4e81cef7a4..0000000000
--- a/other-licenses/7zstub/src/Common/StdInStream.h
+++ /dev/null
@@ -1,31 +0,0 @@
-// Common/StdInStream.h
-
-#ifndef __COMMON_STDINSTREAM_H
-#define __COMMON_STDINSTREAM_H
-
-#include <stdio.h>
-
-#include "Common/String.h"
-#include "Types.h"
-
-class CStdInStream
-{
- bool _streamIsOpen;
- FILE *_stream;
-public:
- CStdInStream(): _streamIsOpen(false) {};
- CStdInStream(FILE *stream): _streamIsOpen(false), _stream(stream) {};
- ~CStdInStream();
- bool Open(LPCTSTR fileName);
- bool Close();
-
- AString ScanStringUntilNewLine();
- void ReadToString(AString &resultString);
-
- bool Eof();
- int GetChar();
-};
-
-extern CStdInStream g_StdIn;
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/StdOutStream.cpp b/other-licenses/7zstub/src/Common/StdOutStream.cpp
deleted file mode 100644
index b66bc31546..0000000000
--- a/other-licenses/7zstub/src/Common/StdOutStream.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// Common/StdOutStream.cpp
-
-#include "StdAfx.h"
-
-#include <tchar.h>
-
-#include "StdOutStream.h"
-#include "Common/IntToString.h"
-#include "Common/StringConvert.h"
-
-static const char kNewLineChar = '\n';
-
-static const char *kFileOpenMode = "wt";
-
-CStdOutStream g_StdOut(stdout);
-CStdOutStream g_StdErr(stderr);
-
-bool CStdOutStream::Open(const char *fileName)
-{
- Close();
- _stream = fopen(fileName, kFileOpenMode);
- _streamIsOpen = (_stream != 0);
- return _streamIsOpen;
-}
-
-bool CStdOutStream::Close()
-{
- if(!_streamIsOpen)
- return true;
- _streamIsOpen = (fclose(_stream) != 0);
- return !_streamIsOpen;
-}
-
-bool CStdOutStream::Flush()
-{
- if(!_streamIsOpen)
- return false;
- return (fflush(_stream) == 0);
-}
-
-CStdOutStream::~CStdOutStream ()
-{
- Close();
-}
-
-CStdOutStream & CStdOutStream::operator<<(CStdOutStream & (*aFunction)(CStdOutStream &))
-{
- (*aFunction)(*this);
- return *this;
-}
-
-CStdOutStream & endl(CStdOutStream & outStream)
-{
- return outStream << kNewLineChar;
-}
-
-CStdOutStream & CStdOutStream::operator<<(const char *string)
-{
- fputs(string, _stream);
- return *this;
-}
-
-CStdOutStream & CStdOutStream::operator<<(const wchar_t *string)
-{
- *this << (const char *)UnicodeStringToMultiByte(string, CP_OEMCP);
- return *this;
-}
-
-CStdOutStream & CStdOutStream::operator<<(char c)
-{
- fputc(c, _stream);
- return *this;
-}
-
-CStdOutStream & CStdOutStream::operator<<(int number)
-{
- char textString[32];
- ConvertInt64ToString(number, textString);
- return operator<<(textString);
-}
-
-CStdOutStream & CStdOutStream::operator<<(UInt64 number)
-{
- char textString[32];
- ConvertUInt64ToString(number, textString);
- return operator<<(textString);
-}
diff --git a/other-licenses/7zstub/src/Common/StdOutStream.h b/other-licenses/7zstub/src/Common/StdOutStream.h
deleted file mode 100644
index 390bcb2a3d..0000000000
--- a/other-licenses/7zstub/src/Common/StdOutStream.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Common/StdOutStream.h
-
-#ifndef __COMMON_STDOUTSTREAM_H
-#define __COMMON_STDOUTSTREAM_H
-
-#include <stdio.h>
-
-#include "Types.h"
-
-class CStdOutStream
-{
- bool _streamIsOpen;
- FILE *_stream;
-public:
- CStdOutStream (): _streamIsOpen(false) {};
- CStdOutStream (FILE *stream): _streamIsOpen(false), _stream(stream) {};
- ~CStdOutStream ();
- bool Open(const char *fileName);
- bool Close();
- bool Flush();
-
- CStdOutStream & operator<<(CStdOutStream & (* aFunction)(CStdOutStream &));
- CStdOutStream & operator<<(const char *string);
- CStdOutStream & operator<<(const wchar_t *string);
- CStdOutStream & operator<<(char c);
- CStdOutStream & operator<<(int number);
- CStdOutStream & operator<<(UInt64 number);
-};
-
-CStdOutStream & endl(CStdOutStream & outStream);
-
-extern CStdOutStream g_StdOut;
-extern CStdOutStream g_StdErr;
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/String.cpp b/other-licenses/7zstub/src/Common/String.cpp
deleted file mode 100644
index b6c12e99bf..0000000000
--- a/other-licenses/7zstub/src/Common/String.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-// Common/String.cpp
-
-#include "StdAfx.h"
-
-#ifdef _WIN32
-#include "StringConvert.h"
-#else
-#include <ctype.h>
-#endif
-
-#include "Common/String.h"
-
-
-#ifdef _WIN32
-
-#ifndef _UNICODE
-
-wchar_t MyCharUpper(wchar_t c)
-{
- if (c == 0)
- return 0;
- wchar_t *res = CharUpperW((LPWSTR)(unsigned int)c);
- if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return (wchar_t)(unsigned int)res;
- const int kBufferSize = 4;
- char s[kBufferSize + 1];
- int numChars = ::WideCharToMultiByte(CP_ACP, 0, &c, 1, s, kBufferSize, 0, 0);
- if (numChars == 0 || numChars > kBufferSize)
- return c;
- s[numChars] = 0;
- ::CharUpperA(s);
- ::MultiByteToWideChar(CP_ACP, 0, s, numChars, &c, 1);
- return c;
-}
-
-wchar_t MyCharLower(wchar_t c)
-{
- if (c == 0)
- return 0;
- wchar_t *res = CharLowerW((LPWSTR)(unsigned int)c);
- if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return (wchar_t)(unsigned int)res;
- const int kBufferSize = 4;
- char s[kBufferSize + 1];
- int numChars = ::WideCharToMultiByte(CP_ACP, 0, &c, 1, s, kBufferSize, 0, 0);
- if (numChars == 0 || numChars > kBufferSize)
- return c;
- s[numChars] = 0;
- ::CharLowerA(s);
- ::MultiByteToWideChar(CP_ACP, 0, s, numChars, &c, 1);
- return c;
-}
-
-wchar_t * MyStringUpper(wchar_t *s)
-{
- if (s == 0)
- return 0;
- wchar_t *res = CharUpperW(s);
- if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return res;
- AString a = UnicodeStringToMultiByte(s);
- a.MakeUpper();
- return MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
-}
-
-wchar_t * MyStringLower(wchar_t *s)
-{
- if (s == 0)
- return 0;
- wchar_t *res = CharLowerW(s);
- if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return res;
- AString a = UnicodeStringToMultiByte(s);
- a.MakeLower();
- return MyStringCopy(s, (const wchar_t *)MultiByteToUnicodeString(a));
-}
-
-#endif
-
-/*
-inline int ConvertCompareResult(int r) { return r - 2; }
-
-int MyStringCollate(const wchar_t *s1, const wchar_t *s2)
-{
- int res = CompareStringW(
- LOCALE_USER_DEFAULT, SORT_STRINGSORT, s1, -1, s2, -1);
- #ifdef _UNICODE
- return ConvertCompareResult(res);
- #else
- if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return ConvertCompareResult(res);
- return MyStringCollate(UnicodeStringToMultiByte(s1),
- UnicodeStringToMultiByte(s2));
- #endif
-}
-
-#ifndef _WIN32_WCE
-int MyStringCollate(const char *s1, const char *s2)
-{
- return ConvertCompareResult(CompareStringA(
- LOCALE_USER_DEFAULT, SORT_STRINGSORT, s1, -1, s2, -1));
-}
-
-int MyStringCollateNoCase(const char *s1, const char *s2)
-{
- return ConvertCompareResult(CompareStringA(
- LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, s1, -1, s2, -1));
-}
-#endif
-
-int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2)
-{
- int res = CompareStringW(
- LOCALE_USER_DEFAULT, NORM_IGNORECASE | SORT_STRINGSORT, s1, -1, s2, -1);
- #ifdef _UNICODE
- return ConvertCompareResult(res);
- #else
- if (res != 0 || ::GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
- return ConvertCompareResult(res);
- return MyStringCollateNoCase(UnicodeStringToMultiByte(s1),
- UnicodeStringToMultiByte(s2));
- #endif
-}
-*/
-
-#else
-
-wchar_t MyCharUpper(wchar_t c)
-{
- return toupper(c);
-}
-
-/*
-int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2)
-{
- while (true)
- {
- wchar_t c1 = *s1++;
- wchar_t c2 = *s2++;
- wchar_t u1 = MyCharUpper(c1);
- wchar_t u2 = MyCharUpper(c2);
-
- if (u1 < u2) return -1;
- if (u1 > u2) return 1;
- if (u1 == 0) return 0;
- }
-}
-*/
-
-#endif
-
-int MyStringCompare(const char *s1, const char *s2)
-{
- while (true)
- {
- unsigned char c1 = (unsigned char)*s1++;
- unsigned char c2 = (unsigned char)*s2++;
- if (c1 < c2) return -1;
- if (c1 > c2) return 1;
- if (c1 == 0) return 0;
- }
-}
-
-int MyStringCompare(const wchar_t *s1, const wchar_t *s2)
-{
- while (true)
- {
- wchar_t c1 = *s1++;
- wchar_t c2 = *s2++;
- if (c1 < c2) return -1;
- if (c1 > c2) return 1;
- if (c1 == 0) return 0;
- }
-}
-
-int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2)
-{
- while (true)
- {
- wchar_t c1 = *s1++;
- wchar_t c2 = *s2++;
- if (c1 != c2)
- {
- wchar_t u1 = MyCharUpper(c1);
- wchar_t u2 = MyCharUpper(c2);
- if (u1 < u2) return -1;
- if (u1 > u2) return 1;
- }
- if (c1 == 0) return 0;
- }
-}
-
-#ifdef _WIN32
-int MyStringCompareNoCase(const char *s1, const char *s2)
-{
- return MyStringCompareNoCase(MultiByteToUnicodeString(s1), MultiByteToUnicodeString(s2));
-}
-#endif
diff --git a/other-licenses/7zstub/src/Common/String.h b/other-licenses/7zstub/src/Common/String.h
deleted file mode 100644
index 72a2c741a4..0000000000
--- a/other-licenses/7zstub/src/Common/String.h
+++ /dev/null
@@ -1,631 +0,0 @@
-// Common/String.h
-
-#ifndef __COMMON_STRING_H
-#define __COMMON_STRING_H
-
-#include <string.h>
-// #include <wchar.h>
-
-#include "Vector.h"
-
-#ifdef _WIN32
-#include "MyWindows.h"
-#endif
-
-static const char *kTrimDefaultCharSet = " \n\t";
-
-template <class T>
-inline int MyStringLen(const T *s)
-{
- int i;
- for (i = 0; s[i] != '\0'; i++);
- return i;
-}
-
-template <class T>
-inline T * MyStringCopy(T *dest, const T *src)
-{
- T *destStart = dest;
- while((*dest++ = *src++) != 0);
- return destStart;
-}
-
-inline wchar_t* MyStringGetNextCharPointer(wchar_t *p)
- { return (p + 1); }
-inline const wchar_t* MyStringGetNextCharPointer(const wchar_t *p)
- { return (p + 1); }
-inline wchar_t* MyStringGetPrevCharPointer(const wchar_t *, wchar_t *p)
- { return (p - 1); }
-inline const wchar_t* MyStringGetPrevCharPointer(const wchar_t *, const wchar_t *p)
- { return (p - 1); }
-
-#ifdef _WIN32
-
-inline char* MyStringGetNextCharPointer(char *p)
- { return CharNextA(p); }
-inline const char* MyStringGetNextCharPointer(const char *p)
- { return CharNextA(p); }
-
-inline char* MyStringGetPrevCharPointer(char *base, char *p)
- { return CharPrevA(base, p); }
-inline const char* MyStringGetPrevCharPointer(const char *base, const char *p)
- { return CharPrevA(base, p); }
-
-inline char MyCharUpper(char c)
- { return (char)(unsigned int)CharUpperA((LPSTR)(unsigned int)(unsigned char)c); }
-#ifdef _UNICODE
-inline wchar_t MyCharUpper(wchar_t c)
- { return (wchar_t)CharUpperW((LPWSTR)c); }
-#else
-wchar_t MyCharUpper(wchar_t c);
-#endif
-
-inline char MyCharLower(char c)
- { return (char)(unsigned int)CharLowerA((LPSTR)(unsigned int)(unsigned char)c); }
-#ifdef _UNICODE
-inline wchar_t MyCharLower(wchar_t c)
- { return (wchar_t)CharLowerW((LPWSTR)c); }
-#else
-wchar_t MyCharLower(wchar_t c);
-#endif
-
-inline char * MyStringUpper(char *s) { return CharUpperA(s); }
-#ifdef _UNICODE
-inline wchar_t * MyStringUpper(wchar_t *s) { return CharUpperW(s); }
-#else
-wchar_t * MyStringUpper(wchar_t *s);
-#endif
-
-inline char * MyStringLower(char *s) { return CharLowerA(s); }
-#ifdef _UNICODE
-inline wchar_t * MyStringLower(wchar_t *s) { return CharLowerW(s); }
-#else
-wchar_t * MyStringLower(wchar_t *s);
-#endif
-
-#else // Standard-C
-wchar_t MyCharUpper(wchar_t c);
-#endif
-
-//////////////////////////////////////
-// Compare
-
-/*
-#ifndef _WIN32_WCE
-int MyStringCollate(const char *s1, const char *s2);
-int MyStringCollateNoCase(const char *s1, const char *s2);
-#endif
-int MyStringCollate(const wchar_t *s1, const wchar_t *s2);
-int MyStringCollateNoCase(const wchar_t *s1, const wchar_t *s2);
-*/
-
-int MyStringCompare(const char *s1, const char *s2);
-int MyStringCompare(const wchar_t *s1, const wchar_t *s2);
-
-#ifdef _WIN32
-int MyStringCompareNoCase(const char *s1, const char *s2);
-#endif
-
-int MyStringCompareNoCase(const wchar_t *s1, const wchar_t *s2);
-
-template <class T>
-class CStringBase
-{
- void TrimLeftWithCharSet(const CStringBase &charSet)
- {
- const T *p = _chars;
- while (charSet.Find(*p) >= 0 && (*p != 0))
- p = GetNextCharPointer(p);
- Delete(0, (int)(p - _chars));
- }
- void TrimRightWithCharSet(const CStringBase &charSet)
- {
- const T *p = _chars;
- const T *pLast = NULL;
- while (*p != 0)
- {
- if (charSet.Find(*p) >= 0)
- {
- if (pLast == NULL)
- pLast = p;
- }
- else
- pLast = NULL;
- p = GetNextCharPointer(p);
- }
- if(pLast != NULL)
- {
- int i = (int)(pLast - _chars);
- Delete(i, _length - i);
- }
-
- }
- void MoveItems(int destIndex, int srcIndex)
- {
- memmove(_chars + destIndex, _chars + srcIndex,
- sizeof(T) * (_length - srcIndex + 1));
- }
-
- void InsertSpace(int &index, int size)
- {
- CorrectIndex(index);
- GrowLength(size);
- MoveItems(index + size, index);
- }
-
- static T *GetNextCharPointer(T *p)
- { return MyStringGetNextCharPointer(p); }
- static const T *GetNextCharPointer(const T *p)
- { return MyStringGetNextCharPointer(p); }
- static T *GetPrevCharPointer(T *base, T *p)
- { return MyStringGetPrevCharPointer(base, p); }
- static const T *GetPrevCharPointer(const T *base, const T *p)
- { return MyStringGetPrevCharPointer(base, p); }
-protected:
- T *_chars;
- int _length;
- int _capacity;
-
- void SetCapacity(int newCapacity)
- {
- int realCapacity = newCapacity + 1;
- if(realCapacity == _capacity)
- return;
- /*
- const int kMaxStringSize = 0x20000000;
- #ifndef _WIN32_WCE
- if(newCapacity > kMaxStringSize || newCapacity < _length)
- throw 1052337;
- #endif
- */
- T *newBuffer = new T[realCapacity];
- if(_capacity > 0)
- {
- for (int i = 0; i < (_length + 1); i++)
- newBuffer[i] = _chars[i];
- delete []_chars;
- _chars = newBuffer;
- }
- else
- {
- _chars = newBuffer;
- _chars[0] = 0;
- }
- _capacity = realCapacity;
- }
-
- void GrowLength(int n)
- {
- int freeSize = _capacity - _length - 1;
- if (n <= freeSize)
- return;
- int delta;
- if (_capacity > 64)
- delta = _capacity / 2;
- else if (_capacity > 8)
- delta = 16;
- else
- delta = 4;
- if (freeSize + delta < n)
- delta = n - freeSize;
- SetCapacity(_capacity + delta);
- }
-
- void CorrectIndex(int &index) const
- {
- if (index > _length)
- index = _length;
- }
-
-public:
- CStringBase(): _chars(0), _length(0), _capacity(0)
- { SetCapacity(16 - 1); }
- CStringBase(T c): _chars(0), _length(0), _capacity(0)
- {
- SetCapacity(1);
- _chars[0] = c;
- _chars[1] = 0;
- _length = 1;
- }
- CStringBase(const T *chars): _chars(0), _length(0), _capacity(0)
- {
- int length = MyStringLen(chars);
- SetCapacity(length);
- MyStringCopy(_chars, chars); // can be optimized by memove()
- _length = length;
- }
- CStringBase(const CStringBase &s): _chars(0), _length(0), _capacity(0)
- {
- SetCapacity(s._length);
- MyStringCopy(_chars, s._chars);
- _length = s._length;
- }
- ~CStringBase() { delete []_chars; }
-
- operator const T*() const { return _chars;}
-
- // The minimum size of the character buffer in characters.
- // This value does not include space for a null terminator.
- T* GetBuffer(int minBufLength)
- {
- if(minBufLength >= _capacity)
- SetCapacity(minBufLength + 1);
- return _chars;
- }
- void ReleaseBuffer() { ReleaseBuffer(MyStringLen(_chars)); }
- void ReleaseBuffer(int newLength)
- {
- /*
- #ifndef _WIN32_WCE
- if(newLength >= _capacity)
- throw 282217;
- #endif
- */
- _chars[newLength] = 0;
- _length = newLength;
- }
-
- CStringBase& operator=(T c)
- {
- Empty();
- SetCapacity(1);
- _chars[0] = c;
- _chars[1] = 0;
- _length = 1;
- return *this;
- }
- CStringBase& operator=(const T *chars)
- {
- Empty();
- int length = MyStringLen(chars);
- SetCapacity(length);
- MyStringCopy(_chars, chars);
- _length = length;
- return *this;
- }
- CStringBase& operator=(const CStringBase& s)
- {
- if(&s == this)
- return *this;
- Empty();
- SetCapacity(s._length);
- MyStringCopy(_chars, s._chars);
- _length = s._length;
- return *this;
- }
-
- CStringBase& operator+=(T c)
- {
- GrowLength(1);
- _chars[_length] = c;
- _chars[++_length] = 0;
- return *this;
- }
- CStringBase& operator+=(const T *s)
- {
- int len = MyStringLen(s);
- GrowLength(len);
- MyStringCopy(_chars + _length, s);
- _length += len;
- return *this;
- }
- CStringBase& operator+=(const CStringBase &s)
- {
- GrowLength(s._length);
- MyStringCopy(_chars + _length, s._chars);
- _length += s._length;
- return *this;
- }
- void Empty()
- {
- _length = 0;
- _chars[0] = 0;
- }
- int Length() const { return _length; }
- bool IsEmpty() const { return (_length == 0); }
-
- CStringBase Mid(int startIndex) const
- { return Mid(startIndex, _length - startIndex); }
- CStringBase Mid(int startIndex, int count ) const
- {
- if (startIndex + count > _length)
- count = _length - startIndex;
-
- if (startIndex == 0 && startIndex + count == _length)
- return *this;
-
- CStringBase<T> result;
- result.SetCapacity(count);
- // MyStringNCopy(result._chars, _chars + startIndex, count);
- for (int i = 0; i < count; i++)
- result._chars[i] = _chars[startIndex + i];
- result._chars[count] = 0;
- result._length = count;
- return result;
- }
- CStringBase Left(int count) const
- { return Mid(0, count); }
- CStringBase Right(int count) const
- {
- if (count > _length)
- count = _length;
- return Mid(_length - count, count);
- }
-
- void MakeUpper()
- { MyStringUpper(_chars); }
- void MakeLower()
- { MyStringLower(_chars); }
-
- int Compare(const CStringBase& s) const
- { return MyStringCompare(_chars, s._chars); }
-
- int CompareNoCase(const CStringBase& s) const
- { return MyStringCompareNoCase(_chars, s._chars); }
- /*
- int Collate(const CStringBase& s) const
- { return MyStringCollate(_chars, s._chars); }
- int CollateNoCase(const CStringBase& s) const
- { return MyStringCollateNoCase(_chars, s._chars); }
- */
-
- int Find(T c) const { return Find(c, 0); }
- int Find(T c, int startIndex) const
- {
- T *p = _chars + startIndex;
- while (true)
- {
- if (*p == c)
- return (int)(p - _chars);
- if (*p == 0)
- return -1;
- p = GetNextCharPointer(p);
- }
- }
- int Find(const CStringBase &s) const { return Find(s, 0); }
- int Find(const CStringBase &s, int startIndex) const
- {
- if (s.IsEmpty())
- return startIndex;
- for (; startIndex < _length; startIndex++)
- {
- int j;
- for (j = 0; j < s._length && startIndex + j < _length; j++)
- if (_chars[startIndex+j] != s._chars[j])
- break;
- if (j == s._length)
- return startIndex;
- }
- return -1;
- }
- int ReverseFind(T c) const
- {
- if (_length == 0)
- return -1;
- T *p = _chars + _length - 1;
- while (true)
- {
- if (*p == c)
- return (int)(p - _chars);
- if (p == _chars)
- return -1;
- p = GetPrevCharPointer(_chars, p);
- }
- }
- int FindOneOf(const CStringBase &s) const
- {
- for(int i = 0; i < _length; i++)
- if (s.Find(_chars[i]) >= 0)
- return i;
- return -1;
- }
-
- void TrimLeft(T c)
- {
- const T *p = _chars;
- while (c == *p)
- p = GetNextCharPointer(p);
- Delete(0, p - _chars);
- }
- private:
- CStringBase GetTrimDefaultCharSet()
- {
- CStringBase<T> charSet;
- for(int i = 0; i < (int)(sizeof(kTrimDefaultCharSet) /
- sizeof(kTrimDefaultCharSet[0])); i++)
- charSet += (T)kTrimDefaultCharSet[i];
- return charSet;
- }
- public:
-
- void TrimLeft()
- {
- TrimLeftWithCharSet(GetTrimDefaultCharSet());
- }
- void TrimRight()
- {
- TrimRightWithCharSet(GetTrimDefaultCharSet());
- }
- void TrimRight(T c)
- {
- const T *p = _chars;
- const T *pLast = NULL;
- while (*p != 0)
- {
- if (*p == c)
- {
- if (pLast == NULL)
- pLast = p;
- }
- else
- pLast = NULL;
- p = GetNextCharPointer(p);
- }
- if(pLast != NULL)
- {
- int i = pLast - _chars;
- Delete(i, _length - i);
- }
- }
- void Trim()
- {
- TrimRight();
- TrimLeft();
- }
-
- int Insert(int index, T c)
- {
- InsertSpace(index, 1);
- _chars[index] = c;
- _length++;
- return _length;
- }
- int Insert(int index, const CStringBase &s)
- {
- CorrectIndex(index);
- if (s.IsEmpty())
- return _length;
- int numInsertChars = s.Length();
- InsertSpace(index, numInsertChars);
- for(int i = 0; i < numInsertChars; i++)
- _chars[index + i] = s[i];
- _length += numInsertChars;
- return _length;
- }
-
- // !!!!!!!!!!!!!!! test it if newChar = '\0'
- int Replace(T oldChar, T newChar)
- {
- if (oldChar == newChar)
- return 0;
- int number = 0;
- int pos = 0;
- while (pos < Length())
- {
- pos = Find(oldChar, pos);
- if (pos < 0)
- break;
- _chars[pos] = newChar;
- pos++;
- number++;
- }
- return number;
- }
- int Replace(const CStringBase &oldString, const CStringBase &newString)
- {
- if (oldString.IsEmpty())
- return 0;
- if (oldString == newString)
- return 0;
- int oldStringLength = oldString.Length();
- int newStringLength = newString.Length();
- int number = 0;
- int pos = 0;
- while (pos < _length)
- {
- pos = Find(oldString, pos);
- if (pos < 0)
- break;
- Delete(pos, oldStringLength);
- Insert(pos, newString);
- pos += newStringLength;
- number++;
- }
- return number;
- }
- int Delete(int index, int count = 1 )
- {
- if (index + count > _length)
- count = _length - index;
- if (count > 0)
- {
- MoveItems(index, index + count);
- _length -= count;
- }
- return _length;
- }
-};
-
-template <class T>
-CStringBase<T> operator+(const CStringBase<T>& s1, const CStringBase<T>& s2)
-{
- CStringBase<T> result(s1);
- result += s2;
- return result;
-}
-
-template <class T>
-CStringBase<T> operator+(const CStringBase<T>& s, T c)
-{
- CStringBase<T> result(s);
- result += c;
- return result;
-}
-
-template <class T>
-CStringBase<T> operator+(T c, const CStringBase<T>& s)
-{
- CStringBase<T> result(c);
- result += s;
- return result;
-}
-
-template <class T>
-CStringBase<T> operator+(const CStringBase<T>& s, const T * chars)
-{
- CStringBase<T> result(s);
- result += chars;
- return result;
-}
-
-template <class T>
-CStringBase<T> operator+(const T * chars, const CStringBase<T>& s)
-{
- CStringBase<T> result(chars);
- result += s;
- return result;
-}
-
-template <class T>
-bool operator==(const CStringBase<T>& s1, const CStringBase<T>& s2)
- { return (s1.Compare(s2) == 0); }
-
-template <class T>
-bool operator<(const CStringBase<T>& s1, const CStringBase<T>& s2)
- { return (s1.Compare(s2) < 0); }
-
-template <class T>
-bool operator==(const T *s1, const CStringBase<T>& s2)
- { return (s2.Compare(s1) == 0); }
-
-template <class T>
-bool operator==(const CStringBase<T>& s1, const T *s2)
- { return (s1.Compare(s2) == 0); }
-
-template <class T>
-bool operator!=(const CStringBase<T>& s1, const CStringBase<T>& s2)
- { return (s1.Compare(s2) != 0); }
-
-template <class T>
-bool operator!=(const T *s1, const CStringBase<T>& s2)
- { return (s2.Compare(s1) != 0); }
-
-template <class T>
-bool operator!=(const CStringBase<T>& s1, const T *s2)
- { return (s1.Compare(s2) != 0); }
-
-typedef CStringBase<char> AString;
-typedef CStringBase<wchar_t> UString;
-
-typedef CObjectVector<AString> AStringVector;
-typedef CObjectVector<UString> UStringVector;
-
-#ifdef _UNICODE
- typedef UString CSysString;
-#else
- typedef AString CSysString;
-#endif
-
-typedef CObjectVector<CSysString> CSysStringVector;
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/StringConvert.cpp b/other-licenses/7zstub/src/Common/StringConvert.cpp
deleted file mode 100644
index 4b5913ade7..0000000000
--- a/other-licenses/7zstub/src/Common/StringConvert.cpp
+++ /dev/null
@@ -1,93 +0,0 @@
-// Common/StringConvert.cpp
-
-#include "StdAfx.h"
-
-#include "StringConvert.h"
-
-#ifndef _WIN32
-#include <stdlib.h>
-#endif
-
-#ifdef _WIN32
-UString MultiByteToUnicodeString(const AString &srcString, UINT codePage)
-{
- UString resultString;
- if(!srcString.IsEmpty())
- {
- int numChars = MultiByteToWideChar(codePage, 0, srcString,
- srcString.Length(), resultString.GetBuffer(srcString.Length()),
- srcString.Length() + 1);
- #ifndef _WIN32_WCE
- if(numChars == 0)
- throw 282228;
- #endif
- resultString.ReleaseBuffer(numChars);
- }
- return resultString;
-}
-
-AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage)
-{
- AString resultString;
- if(!srcString.IsEmpty())
- {
- int numRequiredBytes = srcString.Length() * 2;
- int numChars = WideCharToMultiByte(codePage, 0, srcString,
- srcString.Length(), resultString.GetBuffer(numRequiredBytes),
- numRequiredBytes + 1, NULL, NULL);
- #ifndef _WIN32_WCE
- if(numChars == 0)
- throw 282229;
- #endif
- resultString.ReleaseBuffer(numChars);
- }
- return resultString;
-}
-
-#ifndef _WIN32_WCE
-AString SystemStringToOemString(const CSysString &srcString)
-{
- AString result;
- CharToOem(srcString, result.GetBuffer(srcString.Length() * 2));
- result.ReleaseBuffer();
- return result;
-}
-#endif
-
-#else
-
-UString MultiByteToUnicodeString(const AString &srcString, UINT codePage)
-{
- UString resultString;
- for (int i = 0; i < srcString.Length(); i++)
- resultString += wchar_t(srcString[i]);
- /*
- if(!srcString.IsEmpty())
- {
- int numChars = mbstowcs(resultString.GetBuffer(srcString.Length()), srcString, srcString.Length() + 1);
- if (numChars < 0) throw "Your environment does not support UNICODE";
- resultString.ReleaseBuffer(numChars);
- }
- */
- return resultString;
-}
-
-AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage)
-{
- AString resultString;
- for (int i = 0; i < srcString.Length(); i++)
- resultString += char(srcString[i]);
- /*
- if(!srcString.IsEmpty())
- {
- int numRequiredBytes = srcString.Length() * 6 + 1;
- int numChars = wcstombs(resultString.GetBuffer(numRequiredBytes), srcString, numRequiredBytes);
- if (numChars < 0) throw "Your environment does not support UNICODE";
- resultString.ReleaseBuffer(numChars);
- }
- */
- return resultString;
-}
-
-#endif
-
diff --git a/other-licenses/7zstub/src/Common/StringConvert.h b/other-licenses/7zstub/src/Common/StringConvert.h
deleted file mode 100644
index 921e33c70e..0000000000
--- a/other-licenses/7zstub/src/Common/StringConvert.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Common/StringConvert.h
-
-#ifndef __COMMON_STRINGCONVERT_H
-#define __COMMON_STRINGCONVERT_H
-
-#include "MyWindows.h"
-#include "Common/String.h"
-#include "Types.h"
-
-UString MultiByteToUnicodeString(const AString &srcString, UINT codePage = CP_ACP);
-AString UnicodeStringToMultiByte(const UString &srcString, UINT codePage = CP_ACP);
-
-inline const wchar_t* GetUnicodeString(const wchar_t* unicodeString)
- { return unicodeString; }
-inline const UString& GetUnicodeString(const UString &unicodeString)
- { return unicodeString; }
-inline UString GetUnicodeString(const AString &ansiString)
- { return MultiByteToUnicodeString(ansiString); }
-inline UString GetUnicodeString(const AString &multiByteString, UINT codePage)
- { return MultiByteToUnicodeString(multiByteString, codePage); }
-inline const wchar_t* GetUnicodeString(const wchar_t* unicodeString, UINT)
- { return unicodeString; }
-inline const UString& GetUnicodeString(const UString &unicodeString, UINT)
- { return unicodeString; }
-
-inline const char* GetAnsiString(const char* ansiString)
- { return ansiString; }
-inline const AString& GetAnsiString(const AString &ansiString)
- { return ansiString; }
-inline AString GetAnsiString(const UString &unicodeString)
- { return UnicodeStringToMultiByte(unicodeString); }
-
-inline const char* GetOemString(const char* oemString)
- { return oemString; }
-inline const AString& GetOemString(const AString &oemString)
- { return oemString; }
-inline AString GetOemString(const UString &unicodeString)
- { return UnicodeStringToMultiByte(unicodeString, CP_OEMCP); }
-
-
-#ifdef _UNICODE
- inline const wchar_t* GetSystemString(const wchar_t* unicodeString)
- { return unicodeString;}
- inline const UString& GetSystemString(const UString &unicodeString)
- { return unicodeString;}
- inline const wchar_t* GetSystemString(const wchar_t* unicodeString, UINT codePage)
- { return unicodeString;}
- inline const UString& GetSystemString(const UString &unicodeString, UINT codePage)
- { return unicodeString;}
- inline UString GetSystemString(const AString &multiByteString, UINT codePage)
- { return MultiByteToUnicodeString(multiByteString, codePage);}
- inline UString GetSystemString(const AString &multiByteString)
- { return MultiByteToUnicodeString(multiByteString);}
-#else
- inline const char* GetSystemString(const char *ansiString)
- { return ansiString; }
- inline const AString& GetSystemString(const AString &multiByteString, UINT)
- { return multiByteString; }
- inline const char * GetSystemString(const char *multiByteString, UINT)
- { return multiByteString; }
- inline AString GetSystemString(const UString &unicodeString)
- { return UnicodeStringToMultiByte(unicodeString); }
- inline AString GetSystemString(const UString &unicodeString, UINT codePage)
- { return UnicodeStringToMultiByte(unicodeString, codePage); }
-#endif
-
-#ifndef _WIN32_WCE
-AString SystemStringToOemString(const CSysString &srcString);
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/TextConfig.cpp b/other-licenses/7zstub/src/Common/TextConfig.cpp
deleted file mode 100644
index 0e19b5eee5..0000000000
--- a/other-licenses/7zstub/src/Common/TextConfig.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-// Common/TextConfig.cpp
-
-#include "StdAfx.h"
-
-#include "Common/TextConfig.h"
-
-#include "Defs.h"
-#include "Common/UTFConvert.h"
-
-static bool IsDelimitChar(char c)
-{
- return (c == ' ' || c == 0x0A || c == 0x0D ||
- c == '\0' || c == '\t');
-}
-
-static AString GetIDString(const char *string, int &finishPos)
-{
- AString result;
- for (finishPos = 0; true; finishPos++)
- {
- char c = string[finishPos];
- if (IsDelimitChar(c) || c == '=')
- return result;
- result += c;
- }
-}
-
-static bool WaitNextLine(const AString &string, int &pos)
-{
- for (;pos < string.Length(); pos++)
- if (string[pos] == 0x0A)
- return true;
- return false;
-}
-
-static bool SkipSpaces(const AString &string, int &pos)
-{
- for (;pos < string.Length(); pos++)
- {
- char c = string[pos];
- if (!IsDelimitChar(c))
- {
- if (c != ';')
- return true;
- if (!WaitNextLine(string, pos))
- return false;
- }
- }
- return false;
-}
-
-bool GetTextConfig(const AString &string, CObjectVector<CTextConfigPair> &pairs)
-{
- pairs.Clear();
- int pos = 0;
-
- /////////////////////
- // read strings
-
- while (true)
- {
- if (!SkipSpaces(string, pos))
- break;
- CTextConfigPair pair;
- int finishPos;
- AString temp = GetIDString(((const char *)string) + pos, finishPos);
- if (!ConvertUTF8ToUnicode(temp, pair.ID))
- return false;
- if (finishPos == 0)
- return false;
- pos += finishPos;
- if (!SkipSpaces(string, pos))
- return false;
- if (string[pos] != '=')
- return false;
- pos++;
- if (!SkipSpaces(string, pos))
- return false;
- if (string[pos] != '\"')
- return false;
- pos++;
- AString message;
- while(true)
- {
- if (pos >= string.Length())
- return false;
- char c = string[pos++];
- if (c == '\"')
- break;
- if (c == '\\')
- {
- char c = string[pos++];
- switch(c)
- {
- case 'n':
- message += '\n';
- break;
- case 't':
- message += '\t';
- break;
- case '\\':
- message += '\\';
- break;
- case '\"':
- message += '\"';
- break;
- default:
- message += '\\';
- message += c;
- break;
- }
- }
- else
- message += c;
- }
- if (!ConvertUTF8ToUnicode(message, pair.String))
- return false;
- pairs.Add(pair);
- }
- return true;
-}
-
-int FindTextConfigItem(const CObjectVector<CTextConfigPair> &pairs, const UString &id)
-{
- for (int i = 0; i < pairs.Size(); i++)
- if (pairs[i].ID.Compare(id) == 0)
- return i;
- return -1;
-}
-
-UString GetTextConfigValue(const CObjectVector<CTextConfigPair> &pairs, const UString &id)
-{
- int index = FindTextConfigItem(pairs, id);
- if (index < 0)
- return UString();
- return pairs[index].String;
-}
diff --git a/other-licenses/7zstub/src/Common/TextConfig.h b/other-licenses/7zstub/src/Common/TextConfig.h
deleted file mode 100644
index 09e65761bd..0000000000
--- a/other-licenses/7zstub/src/Common/TextConfig.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Common/TextConfig.h
-
-#ifndef __COMMON_TEXTCONFIG_H
-#define __COMMON_TEXTCONFIG_H
-
-#include "Common/Vector.h"
-#include "Common/String.h"
-
-struct CTextConfigPair
-{
- UString ID;
- UString String;
-};
-
-bool GetTextConfig(const AString &text, CObjectVector<CTextConfigPair> &pairs);
-
-int FindTextConfigItem(const CObjectVector<CTextConfigPair> &pairs, const UString &id);
-UString GetTextConfigValue(const CObjectVector<CTextConfigPair> &pairs, const UString &id);
-
-#endif
-
-
diff --git a/other-licenses/7zstub/src/Common/Types.h b/other-licenses/7zstub/src/Common/Types.h
deleted file mode 100644
index 52d07081e8..0000000000
--- a/other-licenses/7zstub/src/Common/Types.h
+++ /dev/null
@@ -1,19 +0,0 @@
-// Common/Types.h
-
-#ifndef __COMMON_TYPES_H
-#define __COMMON_TYPES_H
-
-typedef unsigned char Byte;
-typedef short Int16;
-typedef unsigned short UInt16;
-typedef int Int32;
-typedef unsigned int UInt32;
-#ifdef _MSC_VER
-typedef __int64 Int64;
-typedef unsigned __int64 UInt64;
-#else
-typedef long long int Int64;
-typedef unsigned long long int UInt64;
-#endif
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/UTFConvert.cpp b/other-licenses/7zstub/src/Common/UTFConvert.cpp
deleted file mode 100644
index 5414e6b8db..0000000000
--- a/other-licenses/7zstub/src/Common/UTFConvert.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-// UTFConvert.cpp
-
-#include "StdAfx.h"
-
-#include "UTFConvert.h"
-#include "Types.h"
-
-static Byte kUtf8Limits[5] = { 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-
-// These functions are for UTF8 <-> UTF16 conversion.
-
-bool ConvertUTF8ToUnicode(const AString &src, UString &dest)
-{
- dest.Empty();
- for(int i = 0; i < src.Length();)
- {
- Byte c = (Byte)src[i++];
- if (c < 0x80)
- {
- dest += (wchar_t)c;
- continue;
- }
- if(c < 0xC0)
- return false;
- int numAdds;
- for (numAdds = 1; numAdds < 5; numAdds++)
- if (c < kUtf8Limits[numAdds])
- break;
- UInt32 value = (c - kUtf8Limits[numAdds - 1]);
- do
- {
- if (i >= src.Length())
- return false;
- Byte c2 = (Byte)src[i++];
- if (c2 < 0x80 || c2 >= 0xC0)
- return false;
- value <<= 6;
- value |= (c2 - 0x80);
- numAdds--;
- }
- while(numAdds > 0);
- if (value < 0x10000)
- dest += (wchar_t)(value);
- else
- {
- value -= 0x10000;
- if (value >= 0x100000)
- return false;
- dest += (wchar_t)(0xD800 + (value >> 10));
- dest += (wchar_t)(0xDC00 + (value & 0x3FF));
- }
- }
- return true;
-}
-
-bool ConvertUnicodeToUTF8(const UString &src, AString &dest)
-{
- dest.Empty();
- for(int i = 0; i < src.Length();)
- {
- UInt32 value = (UInt32)src[i++];
- if (value < 0x80)
- {
- dest += (char)value;
- continue;
- }
- if (value >= 0xD800 && value < 0xE000)
- {
- if (value >= 0xDC00)
- return false;
- if (i >= src.Length())
- return false;
- UInt32 c2 = (UInt32)src[i++];
- if (c2 < 0xDC00 || c2 >= 0xE000)
- return false;
- value = ((value - 0xD800) << 10) | (c2 - 0xDC00);
- }
- int numAdds;
- for (numAdds = 1; numAdds < 5; numAdds++)
- if (value < (((UInt32)1) << (numAdds * 5 + 6)))
- break;
- dest += (char)(kUtf8Limits[numAdds - 1] + (value >> (6 * numAdds)));
- do
- {
- numAdds--;
- dest += (char)(0x80 + ((value >> (6 * numAdds)) & 0x3F));
- }
- while(numAdds > 0);
- }
- return true;
-}
diff --git a/other-licenses/7zstub/src/Common/UTFConvert.h b/other-licenses/7zstub/src/Common/UTFConvert.h
deleted file mode 100644
index 3dfff3fe82..0000000000
--- a/other-licenses/7zstub/src/Common/UTFConvert.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// Common/UTFConvert.h
-
-#ifndef __COMMON_UTFCONVERT_H
-#define __COMMON_UTFCONVERT_H
-
-#include "Common/String.h"
-
-bool ConvertUTF8ToUnicode(const AString &utfString, UString &resultString);
-bool ConvertUnicodeToUTF8(const UString &unicodeString, AString &resultString);
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/Vector.cpp b/other-licenses/7zstub/src/Common/Vector.cpp
deleted file mode 100644
index f74d4c6c29..0000000000
--- a/other-licenses/7zstub/src/Common/Vector.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// Common/Vector.cpp
-
-#include "StdAfx.h"
-
-#include <string.h>
-
-#include "Vector.h"
-
-CBaseRecordVector::~CBaseRecordVector()
- { delete []((unsigned char *)_items); }
-void CBaseRecordVector::Clear()
- { DeleteFrom(0); }
-void CBaseRecordVector::DeleteBack()
- { Delete(_size - 1); }
-void CBaseRecordVector::DeleteFrom(int index)
- { Delete(index, _size - index); }
-
-void CBaseRecordVector::ReserveOnePosition()
-{
- if(_size != _capacity)
- return;
- int delta;
- if (_capacity > 64)
- delta = _capacity / 2;
- else if (_capacity > 8)
- delta = 8;
- else
- delta = 4;
- Reserve(_capacity + delta);
-}
-
-void CBaseRecordVector::Reserve(int newCapacity)
-{
- if(newCapacity <= _capacity)
- return;
- /*
- #ifndef _DEBUG
- static const unsigned int kMaxVectorSize = 0xF0000000;
- if(newCapacity < _size ||
- ((unsigned int )newCapacity * (unsigned int )_itemSize) > kMaxVectorSize)
- throw 1052354;
- #endif
- */
- unsigned char *p = new unsigned char[newCapacity * _itemSize];
- int numRecordsToMove = _capacity;
- memmove(p, _items, _itemSize * numRecordsToMove);
- delete [](unsigned char *)_items;
- _items = p;
- _capacity = newCapacity;
-}
-
-void CBaseRecordVector::MoveItems(int destIndex, int srcIndex)
-{
- memmove(((unsigned char *)_items) + destIndex * _itemSize,
- ((unsigned char *)_items) + srcIndex * _itemSize,
- _itemSize * (_size - srcIndex));
-}
-
-void CBaseRecordVector::InsertOneItem(int index)
-{
- ReserveOnePosition();
- MoveItems(index + 1, index);
- _size++;
-}
-
-void CBaseRecordVector::Delete(int index, int num)
-{
- TestIndexAndCorrectNum(index, num);
- if (num > 0)
- {
- MoveItems(index, index + num);
- _size -= num;
- }
-}
diff --git a/other-licenses/7zstub/src/Common/Vector.h b/other-licenses/7zstub/src/Common/Vector.h
deleted file mode 100644
index 593c64354c..0000000000
--- a/other-licenses/7zstub/src/Common/Vector.h
+++ /dev/null
@@ -1,228 +0,0 @@
-// Common/Vector.h
-
-#ifndef __COMMON_VECTOR_H
-#define __COMMON_VECTOR_H
-
-#include "Defs.h"
-
-class CBaseRecordVector
-{
- void MoveItems(int destIndex, int srcIndex);
-protected:
- int _capacity;
- int _size;
- void *_items;
- size_t _itemSize;
-
- void ReserveOnePosition();
- void InsertOneItem(int index);
- void TestIndexAndCorrectNum(int index, int &num) const
- { if (index + num > _size) num = _size - index; }
-public:
- CBaseRecordVector(size_t itemSize):
- _capacity(0), _size(0), _items(0), _itemSize(itemSize) {}
- virtual ~CBaseRecordVector();
- int Size() const { return _size; }
- bool IsEmpty() const { return (_size == 0); }
- void Reserve(int newCapacity);
- virtual void Delete(int index, int num = 1);
- void Clear();
- void DeleteFrom(int index);
- void DeleteBack();
-};
-
-template <class T>
-class CRecordVector: public CBaseRecordVector
-{
-public:
- CRecordVector():CBaseRecordVector(sizeof(T)){};
- CRecordVector(const CRecordVector &v):
- CBaseRecordVector(sizeof(T)) { *this = v;}
- CRecordVector& operator=(const CRecordVector &v)
- {
- Clear();
- return (*this += v);
- }
- CRecordVector& operator+=(const CRecordVector &v)
- {
- int size = v.Size();
- Reserve(Size() + size);
- for(int i = 0; i < size; i++)
- Add(v[i]);
- return *this;
- }
- int Add(T item)
- {
- ReserveOnePosition();
- ((T *)_items)[_size] = item;
- return _size++;
- }
- void Insert(int index, T item)
- {
- InsertOneItem(index);
- ((T *)_items)[index] = item;
- }
- // T* GetPointer() const { return (T*)_items; }
- // operator const T *() const { return _items; };
- const T& operator[](int index) const { return ((T *)_items)[index]; }
- T& operator[](int index) { return ((T *)_items)[index]; }
- const T& Front() const { return operator[](0); }
- T& Front() { return operator[](0); }
- const T& Back() const { return operator[](_size - 1); }
- T& Back() { return operator[](_size - 1); }
-
- void Swap(int i, int j)
- {
- T temp = operator[](i);
- operator[](i) = operator[](j);
- operator[](j) = temp;
- }
-
- int FindInSorted(const T& item) const
- {
- int left = 0, right = Size();
- while (left != right)
- {
- int mid = (left + right) / 2;
- const T& midValue = (*this)[mid];
- if (item == midValue)
- return mid;
- if (item < midValue)
- right = mid;
- else
- left = mid + 1;
- }
- return -1;
- }
-
- void Sort(int left, int right)
- {
- if (right - left < 2)
- return;
- Swap(left, (left + right) / 2);
- int last = left;
- for (int i = left; i < right; i++)
- if (operator[](i) < operator[](left))
- Swap(++last, i);
- Swap(left, last);
- Sort(left, last);
- Sort(last + 1, right);
- }
- void Sort() { Sort(0, Size()); }
- void Sort(int left, int right, int (*compare)(const T*, const T*, void *), void *param)
- {
- if (right - left < 2)
- return;
- Swap(left, (left + right) / 2);
- int last = left;
- for (int i = left; i < right; i++)
- if (compare(&operator[](i), &operator[](left), param) < 0)
- Swap(++last, i);
- Swap(left, last);
- Sort(left, last, compare, param);
- Sort(last + 1, right, compare, param);
- }
-
- void Sort(int (*compare)(const T*, const T*, void *), void *param)
- {
- Sort(0, Size(), compare, param);
- }
-};
-
-typedef CRecordVector<int> CIntVector;
-typedef CRecordVector<unsigned int> CUIntVector;
-typedef CRecordVector<bool> CBoolVector;
-typedef CRecordVector<unsigned char> CByteVector;
-typedef CRecordVector<void *> CPointerVector;
-
-template <class T>
-class CObjectVector: public CPointerVector
-{
-public:
- CObjectVector(){};
- ~CObjectVector() { Clear(); }
- CObjectVector(const CObjectVector &objectVector)
- { *this = objectVector; }
- CObjectVector& operator=(const CObjectVector &objectVector)
- {
- Clear();
- return (*this += objectVector);
- }
- CObjectVector& operator+=(const CObjectVector &objectVector)
- {
- int size = objectVector.Size();
- Reserve(Size() + size);
- for(int i = 0; i < size; i++)
- Add(objectVector[i]);
- return *this;
- }
- const T& operator[](int index) const { return *((T *)CPointerVector::operator[](index)); }
- T& operator[](int index) { return *((T *)CPointerVector::operator[](index)); }
- T& Front() { return operator[](0); }
- const T& Front() const { return operator[](0); }
- T& Back() { return operator[](_size - 1); }
- const T& Back() const { return operator[](_size - 1); }
- int Add(const T& item)
- { return CPointerVector::Add(new T(item)); }
- void Insert(int index, const T& item)
- { CPointerVector::Insert(index, new T(item)); }
- virtual void Delete(int index, int num = 1)
- {
- TestIndexAndCorrectNum(index, num);
- for(int i = 0; i < num; i++)
- delete (T *)(((void **)_items)[index + i]);
- CPointerVector::Delete(index, num);
- }
- int Find(const T& item) const
- {
- for(int i = 0; i < Size(); i++)
- if (item == (*this)[i])
- return i;
- return -1;
- }
- int FindInSorted(const T& item) const
- {
- int left = 0, right = Size();
- while (left != right)
- {
- int mid = (left + right) / 2;
- const T& midValue = (*this)[mid];
- if (item == midValue)
- return mid;
- if (item < midValue)
- right = mid;
- else
- left = mid + 1;
- }
- return -1;
- }
- int AddToSorted(const T& item)
- {
- int left = 0, right = Size();
- while (left != right)
- {
- int mid = (left + right) / 2;
- const T& midValue = (*this)[mid];
- if (item == midValue)
- {
- right = mid + 1;
- break;
- }
- if (item < midValue)
- right = mid;
- else
- left = mid + 1;
- }
- Insert(right, item);
- return right;
- }
-
- void Sort(int (*compare)(void *const *, void *const *, void *), void *param)
- { CPointerVector::Sort(compare, param); }
-
- static int CompareObjectItems(void *const *a1, void *const *a2, void *param)
- { return MyCompare(*(*((const T **)a1)), *(*((const T **)a2))); }
- void Sort() { CPointerVector::Sort(CompareObjectItems, 0); }
-};
-
-#endif
diff --git a/other-licenses/7zstub/src/Common/Wildcard.cpp b/other-licenses/7zstub/src/Common/Wildcard.cpp
deleted file mode 100644
index 4b9e754e75..0000000000
--- a/other-licenses/7zstub/src/Common/Wildcard.cpp
+++ /dev/null
@@ -1,462 +0,0 @@
-// Common/Wildcard.cpp
-
-#include "StdAfx.h"
-
-#include "Wildcard.h"
-
-static const wchar_t kPeriodChar = L'.';
-static const wchar_t kAnyCharsChar = L'*';
-static const wchar_t kAnyCharChar = L'?';
-
-#ifdef _WIN32
-static const wchar_t kDirDelimiter1 = L'\\';
-#endif
-static const wchar_t kDirDelimiter2 = L'/';
-
-static const UString kWildCardCharSet = L"?*";
-
-static const UString kIllegalWildCardFileNameChars=
- L"\x1\x2\x3\x4\x5\x6\x7\x8\x9\xA\xB\xC\xD\xE\xF"
- L"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
- L"\"/:<>\\|";
-
-static const UString kIllegalFileNameChars = kIllegalWildCardFileNameChars +
- kWildCardCharSet;
-
-static inline bool IsCharDirLimiter(wchar_t c)
-{
- return (
- #ifdef _WIN32
- c == kDirDelimiter1 ||
- #endif
- c == kDirDelimiter2);
-}
-
-// -----------------------------------------
-// this function tests is name matches mask
-// ? - any wchar_t or empty
-// * - any characters or empty
-
-static bool EnhancedMaskTest(const UString &mask, int maskPos,
- const UString &name, int namePos)
-{
- int maskLen = mask.Length() - maskPos;
- int nameLen = name.Length() - namePos;
- if (maskLen == 0)
- if (nameLen == 0)
- return true;
- else
- return false;
- wchar_t maskChar = mask[maskPos];
- if(maskChar == kAnyCharChar)
- {
- /*
- if (EnhancedMaskTest(mask, maskPos + 1, name, namePos))
- return true;
- */
- if (nameLen == 0)
- return false;
- return EnhancedMaskTest(mask, maskPos + 1, name, namePos + 1);
- }
- else if(maskChar == kAnyCharsChar)
- {
- if (EnhancedMaskTest(mask, maskPos + 1, name, namePos))
- return true;
- if (nameLen == 0)
- return false;
- return EnhancedMaskTest(mask, maskPos, name, namePos + 1);
- }
- else
- {
- wchar_t c = name[namePos];
- if (maskChar != c)
-#ifdef _WIN32
- if (MyCharUpper(maskChar) != MyCharUpper(c))
-#endif
- return false;
- return EnhancedMaskTest(mask, maskPos + 1, name, namePos + 1);
- }
-}
-
-// --------------------------------------------------
-// Splits path to strings
-
-void SplitPathToParts(const UString &path, UStringVector &pathParts)
-{
- pathParts.Clear();
- UString name;
- int len = path.Length();
- if (len == 0)
- return;
- for (int i = 0; i < len; i++)
- {
- wchar_t c = path[i];
- if (IsCharDirLimiter(c))
- {
- pathParts.Add(name);
- name.Empty();
- }
- else
- name += c;
- }
- pathParts.Add(name);
-}
-
-void SplitPathToParts(const UString &path, UString &dirPrefix, UString &name)
-{
- int i;
- for(i = path.Length() - 1; i >= 0; i--)
- if(IsCharDirLimiter(path[i]))
- break;
- dirPrefix = path.Left(i + 1);
- name = path.Mid(i + 1);
-}
-
-UString ExtractDirPrefixFromPath(const UString &path)
-{
- int i;
- for(i = path.Length() - 1; i >= 0; i--)
- if(IsCharDirLimiter(path[i]))
- break;
- return path.Left(i + 1);
-}
-
-UString ExtractFileNameFromPath(const UString &path)
-{
- int i;
- for(i = path.Length() - 1; i >= 0; i--)
- if(IsCharDirLimiter(path[i]))
- break;
- return path.Mid(i + 1);
-}
-
-
-bool CompareWildCardWithName(const UString &mask, const UString &name)
-{
- return EnhancedMaskTest(mask, 0, name, 0);
-}
-
-bool DoesNameContainWildCard(const UString &path)
-{
- return (path.FindOneOf(kWildCardCharSet) >= 0);
-}
-
-
-// ----------------------------------------------------------'
-// NWildcard
-
-namespace NWildcard {
-
-static inline int BoolToIndex(bool value)
-{
- return value ? 1: 0;
-}
-
-
-/*
-M = MaskParts.Size();
-N = TestNameParts.Size();
-
- File Dir
-ForFile req M<=N [N-M, N) -
- nonreq M=N [0, M) -
-
-ForDir req M<N [0, M) ... [N-M-1, N-1) same as ForBoth-File
- nonreq [0, M) same as ForBoth-File
-
-ForBoth req m<=N [0, M) ... [N-M, N) same as ForBoth-File
- nonreq [0, M) same as ForBoth-File
-
-*/
-
-bool CItem::CheckPath(const UStringVector &pathParts, bool isFile) const
-{
- if (!isFile && !ForDir)
- return false;
- int delta = (int)pathParts.Size() - (int)PathParts.Size();
- if (delta < 0)
- return false;
- int start = 0;
- int finish = 0;
- if (isFile)
- {
- if (!ForDir && !Recursive && delta !=0)
- return false;
- if (!ForFile && delta == 0)
- return false;
- if (!ForDir && Recursive)
- start = delta;
- }
- if (Recursive)
- {
- finish = delta;
- if (isFile && !ForFile)
- finish = delta - 1;
- }
- for (int d = start; d <= finish; d++)
- {
- int i;
- for (i = 0; i < PathParts.Size(); i++)
- if (!CompareWildCardWithName(PathParts[i], pathParts[i + d]))
- break;
- if (i == PathParts.Size())
- return true;
- }
- return false;
-}
-
-int CCensorNode::FindSubNode(const UString &name) const
-{
- for (int i = 0; i < SubNodes.Size(); i++)
- if (SubNodes[i].Name.CompareNoCase(name) == 0)
- return i;
- return -1;
-}
-
-void CCensorNode::AddItemSimple(bool include, CItem &item)
-{
- if (include)
- IncludeItems.Add(item);
- else
- ExcludeItems.Add(item);
-}
-
-void CCensorNode::AddItem(bool include, CItem &item)
-{
- if (item.PathParts.Size() <= 1)
- {
- AddItemSimple(include, item);
- return;
- }
- const UString &front = item.PathParts.Front();
- if (DoesNameContainWildCard(front))
- {
- AddItemSimple(include, item);
- return;
- }
- int index = FindSubNode(front);
- if (index < 0)
- index = SubNodes.Add(CCensorNode(front, this));
- item.PathParts.Delete(0);
- SubNodes[index].AddItem(include, item);
-}
-
-void CCensorNode::AddItem(bool include, const UString &path, bool recursive, bool forFile, bool forDir)
-{
- CItem item;
- SplitPathToParts(path, item.PathParts);
- item.Recursive = recursive;
- item.ForFile = forFile;
- item.ForDir = forDir;
- AddItem(include, item);
-}
-
-bool CCensorNode::NeedCheckSubDirs() const
-{
- for (int i = 0; i < IncludeItems.Size(); i++)
- {
- const CItem &item = IncludeItems[i];
- if (item.Recursive || item.PathParts.Size() > 1)
- return true;
- }
- return false;
-}
-
-bool CCensorNode::AreThereIncludeItems() const
-{
- if (IncludeItems.Size() > 0)
- return true;
- for (int i = 0; i < SubNodes.Size(); i++)
- if (SubNodes[i].AreThereIncludeItems())
- return true;
- return false;
-}
-
-bool CCensorNode::CheckPathCurrent(bool include, const UStringVector &pathParts, bool isFile) const
-{
- const CObjectVector<CItem> &items = include ? IncludeItems : ExcludeItems;
- for (int i = 0; i < items.Size(); i++)
- if (items[i].CheckPath(pathParts, isFile))
- return true;
- return false;
-}
-
-bool CCensorNode::CheckPath(UStringVector &pathParts, bool isFile, bool &include) const
-{
- if (CheckPathCurrent(false, pathParts, isFile))
- {
- include = false;
- return true;
- }
- include = true;
- bool finded = CheckPathCurrent(true, pathParts, isFile);
- if (pathParts.Size() == 1)
- return finded;
- int index = FindSubNode(pathParts.Front());
- if (index >= 0)
- {
- UStringVector pathParts2 = pathParts;
- pathParts2.Delete(0);
- if (SubNodes[index].CheckPath(pathParts2, isFile, include))
- return true;
- }
- return finded;
-}
-
-bool CCensorNode::CheckPath(const UString &path, bool isFile, bool &include) const
-{
- UStringVector pathParts;
- SplitPathToParts(path, pathParts);
- return CheckPath(pathParts, isFile, include);
-}
-
-bool CCensorNode::CheckPath(const UString &path, bool isFile) const
-{
- bool include;
- if(CheckPath(path, isFile, include))
- return include;
- return false;
-}
-
-bool CCensorNode::CheckPathToRoot(bool include, UStringVector &pathParts, bool isFile) const
-{
- if (CheckPathCurrent(include, pathParts, isFile))
- return true;
- if (Parent == 0)
- return false;
- pathParts.Insert(0, Name);
- return Parent->CheckPathToRoot(include, pathParts, isFile);
-}
-
-/*
-bool CCensorNode::CheckPathToRoot(bool include, const UString &path, bool isFile) const
-{
- UStringVector pathParts;
- SplitPathToParts(path, pathParts);
- return CheckPathToRoot(include, pathParts, isFile);
-}
-*/
-
-void CCensorNode::AddItem2(bool include, const UString &path, bool recursive)
-{
- if (path.IsEmpty())
- return;
- bool forFile = true;
- bool forFolder = true;
- UString path2 = path;
- if (IsCharDirLimiter(path[path.Length() - 1]))
- {
- path2.Delete(path.Length() - 1);
- forFile = false;
- }
- AddItem(include, path2, recursive, forFile, forFolder);
-}
-
-void CCensorNode::ExtendExclude(const CCensorNode &fromNodes)
-{
- ExcludeItems += fromNodes.ExcludeItems;
- for (int i = 0; i < fromNodes.SubNodes.Size(); i++)
- {
- const CCensorNode &node = fromNodes.SubNodes[i];
- int subNodeIndex = FindSubNode(node.Name);
- if (subNodeIndex < 0)
- subNodeIndex = SubNodes.Add(CCensorNode(node.Name, this));
- SubNodes[subNodeIndex].ExtendExclude(node);
- }
-}
-
-int CCensor::FindPrefix(const UString &prefix) const
-{
- for (int i = 0; i < Pairs.Size(); i++)
- if (Pairs[i].Prefix.CompareNoCase(prefix) == 0)
- return i;
- return -1;
-}
-
-void CCensor::AddItem(bool include, const UString &path, bool recursive)
-{
- UStringVector pathParts;
- SplitPathToParts(path, pathParts);
- bool forFile = true;
- if (pathParts.Back().IsEmpty())
- {
- forFile = false;
- pathParts.DeleteBack();
- }
- const UString &front = pathParts.Front();
- bool isAbs = false;
- if (front.IsEmpty())
- isAbs = true;
- else if (front.Length() == 2 && front[1] == L':')
- isAbs = true;
- else
- {
- for (int i = 0; i < pathParts.Size(); i++)
- {
- const UString &part = pathParts[i];
- if (part == L".." || part == L".")
- {
- isAbs = true;
- break;
- }
- }
- }
- int numAbsParts = 0;
- if (isAbs)
- if (pathParts.Size() > 1)
- numAbsParts = pathParts.Size() - 1;
- else
- numAbsParts = 1;
- UString prefix;
- for (int i = 0; i < numAbsParts; i++)
- {
- const UString &front = pathParts.Front();
- if (DoesNameContainWildCard(front))
- break;
- prefix += front;
- prefix += WCHAR_PATH_SEPARATOR;
- pathParts.Delete(0);
- }
- int index = FindPrefix(prefix);
- if (index < 0)
- index = Pairs.Add(CPair(prefix));
-
- CItem item;
- item.PathParts = pathParts;
- item.ForDir = true;
- item.ForFile = forFile;
- item.Recursive = recursive;
- Pairs[index].Head.AddItem(include, item);
-}
-
-bool CCensor::CheckPath(const UString &path, bool isFile) const
-{
- bool finded = false;
- for (int i = 0; i < Pairs.Size(); i++)
- {
- bool include;
- if (Pairs[i].Head.CheckPath(path, isFile, include))
- {
- if (!include)
- return false;
- finded = true;
- }
- }
- return finded;
-}
-
-void CCensor::ExtendExclude()
-{
- int i;
- for (i = 0; i < Pairs.Size(); i++)
- if (Pairs[i].Prefix.IsEmpty())
- break;
- if (i == Pairs.Size())
- return;
- int index = i;
- for (i = 0; i < Pairs.Size(); i++)
- if (index != i)
- Pairs[i].Head.ExtendExclude(Pairs[index].Head);
-}
-
-}
diff --git a/other-licenses/7zstub/src/Common/Wildcard.h b/other-licenses/7zstub/src/Common/Wildcard.h
deleted file mode 100644
index 7c94b4329f..0000000000
--- a/other-licenses/7zstub/src/Common/Wildcard.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Common/Wildcard.h
-
-#ifndef __COMMON_WILDCARD_H
-#define __COMMON_WILDCARD_H
-
-#include "Common/String.h"
-
-void SplitPathToParts(const UString &path, UStringVector &pathParts);
-void SplitPathToParts(const UString &path, UString &dirPrefix, UString &name);
-UString ExtractDirPrefixFromPath(const UString &path);
-UString ExtractFileNameFromPath(const UString &path);
-bool DoesNameContainWildCard(const UString &path);
-bool CompareWildCardWithName(const UString &mask, const UString &name);
-
-namespace NWildcard {
-
-struct CItem
-{
- UStringVector PathParts;
- bool Recursive;
- bool ForFile;
- bool ForDir;
- bool CheckPath(const UStringVector &pathParts, bool isFile) const;
-};
-
-class CCensorNode
-{
- CCensorNode *Parent;
- bool CheckPathCurrent(bool include, const UStringVector &pathParts, bool isFile) const;
- void AddItemSimple(bool include, CItem &item);
- bool CheckPath(UStringVector &pathParts, bool isFile, bool &include) const;
-public:
- CCensorNode(): Parent(0) { };
- CCensorNode(const UString &name, CCensorNode *parent): Name(name), Parent(parent) { };
- UString Name;
- CObjectVector<CCensorNode> SubNodes;
- CObjectVector<CItem> IncludeItems;
- CObjectVector<CItem> ExcludeItems;
-
- int FindSubNode(const UString &path) const;
-
- void AddItem(bool include, CItem &item);
- void AddItem(bool include, const UString &path, bool recursive, bool forFile, bool forDir);
- void AddItem2(bool include, const UString &path, bool recursive);
-
- bool NeedCheckSubDirs() const;
- bool AreThereIncludeItems() const;
-
- bool CheckPath(const UString &path, bool isFile, bool &include) const;
- bool CheckPath(const UString &path, bool isFile) const;
-
- bool CheckPathToRoot(bool include, UStringVector &pathParts, bool isFile) const;
- // bool CheckPathToRoot(const UString &path, bool isFile, bool include) const;
- void ExtendExclude(const CCensorNode &fromNodes);
-};
-
-struct CPair
-{
- UString Prefix;
- CCensorNode Head;
- CPair(const UString &prefix): Prefix(prefix) { };
-};
-
-class CCensor
-{
- int FindPrefix(const UString &prefix) const;
-public:
- CObjectVector<CPair> Pairs;
- bool AllAreRelative() const
- { return (Pairs.Size() == 1 && Pairs.Front().Prefix.IsEmpty()); }
- void AddItem(bool include, const UString &path, bool recursive);
- bool CheckPath(const UString &path, bool isFile) const;
- void ExtendExclude();
-};
-
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/DOC/7zC.txt b/other-licenses/7zstub/src/DOC/7zC.txt
index 2b67f9dcb5..49276787f8 100644
--- a/other-licenses/7zstub/src/DOC/7zC.txt
+++ b/other-licenses/7zstub/src/DOC/7zC.txt
@@ -1,8 +1,6 @@
-7z ANSI-C Decoder 4.23
+7z ANSI-C Decoder 9.35
----------------------
-7z ANSI-C Decoder 4.23 Copyright (C) 1999-2005 Igor Pavlov
-
7z ANSI-C provides 7z/LZMA decoding.
7z ANSI-C version is simplified version ported from C++ code.
@@ -14,38 +12,31 @@ compression ratio and very fast decompression.
LICENSE
-------
-Read lzma.txt for information about license.
-
+7z ANSI-C Decoder is part of the LZMA SDK.
+LZMA SDK is written and placed in the public domain by Igor Pavlov.
Files
---------------------
-7zAlloc.* - Allocate and Free
-7zBuffer.* - Buffer structure
-7zCrc.* - CRC32 code
-7zDecode.* - Low level memory->memory decoding
-7zExtract.* - High level stream->memory decoding
+7zDecode.* - Low level 7z decoding
+7zExtract.* - High level 7z decoding
7zHeader.* - .7z format constants
7zIn.* - .7z archive opening
7zItem.* - .7z structures
7zMain.c - Test application
-7zMethodID.* - MethodID structure
-7zTypes.h - Base types and constants
How To Use
----------
-You must download 7-Zip program from www.7-zip.org.
-
-You can create .7z archive with 7z.exe or 7za.exe:
+You can create .7z archive with 7z.exe, 7za.exe or 7zr.exe:
- 7za.exe a archive.7z *.htm -r -mx -m0fb=255 -mf=off
+ 7z.exe a archive.7z *.htm -r -mx -m0fb=255
If you have big number of files in archive, and you need fast extracting,
you can use partly-solid archives:
- 7za.exe a archive.7z *.htm -ms=512K -r -mx -m0fb=255 -m0d=512K -mf=off
+ 7za.exe a archive.7z *.htm -ms=512K -r -mx -m0fb=255 -m0d=512K
In that example 7-Zip will use 512KB solid blocks. So it needs to decompress only
512KB for extracting one file from such archive.
@@ -54,8 +45,8 @@ In that example 7-Zip will use 512KB solid blocks. So it needs to decompress onl
Limitations of current version of 7z ANSI-C Decoder
---------------------------------------------------
- - It reads only "FileName", "Size", and "CRC" information for each file in archive.
- - It supports only LZMA and Copy (no compression) methods.
+ - It reads only "FileName", "Size", "LastWriteTime" and "CRC" information for each file in archive.
+ - It supports only LZMA and Copy (no compression) methods with BCJ or BCJ2 filters.
- It converts original UTF-16 Unicode file names to UTF-8 Unicode file names.
These limitations will be fixed in future versions.
@@ -85,17 +76,6 @@ extracts files from archive.7z to current folder.
How to use .7z Decoder
----------------------
-.7z Decoder can be compiled in one of two modes:
-
-1) Default mode. In that mode 7z Decoder will read full compressed
- block to RAM before decompressing.
-
-2) Mode with defined _LZMA_IN_CB. In that mode 7z Decoder can read
- compressed block by parts. And you can specify desired buffer size.
- So memory requirements can be reduced. But decompressing speed will
- be 5-10% lower and code size is slightly larger.
-
-
Memory allocation
~~~~~~~~~~~~~~~~~
@@ -104,46 +84,42 @@ Memory allocation
2) Main pool
Such scheme can allow you to avoid fragmentation of allocated blocks.
+
Steps for using 7z decoder
--------------------------
Use code at 7zMain.c as example.
1) Declare variables:
- inStream /* implements ISzInStream interface */
- CArchiveDatabaseEx db; /* 7z archive database structure */
- ISzAlloc allocImp; /* memory functions for main pool */
- ISzAlloc allocTempImp; /* memory functions for temporary pool */
+ inStream /* implements ILookInStream interface */
+ CSzArEx db; /* 7z archive database structure */
+ ISzAlloc allocImp; /* memory functions for main pool */
+ ISzAlloc allocTempImp; /* memory functions for temporary pool */
-2) call InitCrcTable(); function to initialize CRC structures.
+2) call CrcGenerateTable(); function to initialize CRC structures.
-3) call SzArDbExInit(&db); function to initialize db structures.
+3) call SzArEx_Init(&db); function to initialize db structures.
-4) call SzArchiveOpen(inStream, &db, &allocMain, &allocTemp) to open archive
+4) call SzArEx_Open(&db, inStream, &allocMain, &allocTemp) to open archive
This function opens archive "inStream" and reads headers to "db".
All items in "db" will be allocated with "allocMain" functions.
-SzArchiveOpen function allocates and frees temporary structures by "allocTemp" functions.
+SzArEx_Open function allocates and frees temporary structures by "allocTemp" functions.
5) List items or Extract items
Listing code:
~~~~~~~~~~~~~
- {
- UInt32 i;
- for (i = 0; i < db.Database.NumFiles; i++)
- {
- CFileItem *f = db.Database.Files + i;
- printf("%10d %s\n", (int)f->Size, f->Name);
- }
- }
+
+ Use SzArEx_GetFileNameUtf16 function. Look example code in C\Util\7z\7zMain.c file.
+
Extracting code:
~~~~~~~~~~~~~~~~
- SZ_RESULT SzExtract(
- ISzInStream *inStream,
+ SZ_RESULT SzAr_Extract(
CArchiveDatabaseEx *db,
+ ILookInStream *inStream,
UInt32 fileIndex, /* index of file */
UInt32 *blockIndex, /* index of solid block */
Byte **outBuffer, /* pointer to pointer to output buffer (allocated with allocMain) */
@@ -163,7 +139,7 @@ SzArchiveOpen function allocates and frees temporary structures by "allocTemp" f
After decompressing you must free "outBuffer":
allocImp.Free(outBuffer);
-6) call SzArDbExFree(&db, allocImp.Free) to free allocated items in "db".
+6) call SzArEx_Free(&db, allocImp.Free) to free allocated items in "db".
@@ -173,7 +149,6 @@ Memory requirements for .7z decoding
Memory usage for Archive opening:
- Temporary pool:
- - Memory for compressed .7z headers (if _LZMA_IN_CB is not defined)
- Memory for uncompressed .7z headers
- some other temporary blocks
- Main pool:
@@ -181,55 +156,32 @@ Memory usage for Archive opening:
Estimated size of one file structures in solid archive:
- Size (4 or 8 Bytes)
- CRC32 (4 bytes)
+ - LastWriteTime (8 bytes)
- Some file information (4 bytes)
- File Name (variable length) + pointer + allocation structures
Memory usage for archive Decompressing:
- Temporary pool:
- - Memory for compressed solid block (if _LZMA_IN_CB is not defined)
- Memory for LZMA decompressing structures
- Main pool:
- Memory for decompressed solid block
+ - Memory for temprorary buffers, if BCJ2 fileter is used. Usually these
+ temprorary buffers can be about 15% of solid block size.
-If _LZMA_IN_CB is defined, 7z Decoder will not allocate memory for
-compressed blocks. Instead of this, you must allocate buffer with desired
+7z Decoder doesn't allocate memory for compressed blocks.
+Instead of this, you must allocate buffer with desired
size before calling 7z Decoder. Use 7zMain.c as example.
+Defines
+-------
-EXIT codes
------------
-
-7z Decoder functions can return one of the following codes:
-
-#define SZ_OK (0)
-#define SZE_DATA_ERROR (1)
-#define SZE_OUTOFMEMORY (2)
-#define SZE_CRC_ERROR (3)
-
-#define SZE_NOTIMPL (4)
-#define SZE_FAIL (5)
-
-#define SZE_ARCHIVE_ERROR (6)
-
-
-
-LZMA Defines
-------------
-
-_LZMA_IN_CB - Use special callback mode for input stream to reduce memory requirements
-
-_SZ_FILE_SIZE_64 - define it if you need support for files larger than 4 GB
-_SZ_NO_INT_64 - define it if your compiler doesn't support long long int
-
-_LZMA_PROB32 - it can increase LZMA decompressing speed on some 32-bit CPUs.
-
-_SZ_ONE_DIRECTORY - define it if you want to locate all source files to one directory
_SZ_ALLOC_DEBUG - define it if you want to debug alloc/free operations to stderr.
---
http://www.7-zip.org
+http://www.7-zip.org/sdk.html
http://www.7-zip.org/support.html
diff --git a/other-licenses/7zstub/src/DOC/7zFormat.txt b/other-licenses/7zstub/src/DOC/7zFormat.txt
new file mode 100644
index 0000000000..6b8678fbb4
--- /dev/null
+++ b/other-licenses/7zstub/src/DOC/7zFormat.txt
@@ -0,0 +1,469 @@
+7z Format description (4.59)
+----------------------------
+
+This file contains description of 7z archive format.
+7z archive can contain files compressed with any method.
+See "Methods.txt" for description for defined compressing methods.
+
+
+Format structure Overview
+-------------------------
+
+Some fields can be optional.
+
+Archive structure
+~~~~~~~~~~~~~~~~~
+SignatureHeader
+[PackedStreams]
+[PackedStreamsForHeaders]
+[
+ Header
+ or
+ {
+ Packed Header
+ HeaderInfo
+ }
+]
+
+
+
+Header structure
+~~~~~~~~~~~~~~~~
+{
+ ArchiveProperties
+ AdditionalStreams
+ {
+ PackInfo
+ {
+ PackPos
+ NumPackStreams
+ Sizes[NumPackStreams]
+ CRCs[NumPackStreams]
+ }
+ CodersInfo
+ {
+ NumFolders
+ Folders[NumFolders]
+ {
+ NumCoders
+ CodersInfo[NumCoders]
+ {
+ ID
+ NumInStreams;
+ NumOutStreams;
+ PropertiesSize
+ Properties[PropertiesSize]
+ }
+ NumBindPairs
+ BindPairsInfo[NumBindPairs]
+ {
+ InIndex;
+ OutIndex;
+ }
+ PackedIndices
+ }
+ UnPackSize[Folders][Folders.NumOutstreams]
+ CRCs[NumFolders]
+ }
+ SubStreamsInfo
+ {
+ NumUnPackStreamsInFolders[NumFolders];
+ UnPackSizes[]
+ CRCs[]
+ }
+ }
+ MainStreamsInfo
+ {
+ (Same as in AdditionalStreams)
+ }
+ FilesInfo
+ {
+ NumFiles
+ Properties[]
+ {
+ ID
+ Size
+ Data
+ }
+ }
+}
+
+HeaderInfo structure
+~~~~~~~~~~~~~~~~~~~~
+{
+ (Same as in AdditionalStreams)
+}
+
+
+
+Notes about Notation and encoding
+---------------------------------
+
+7z uses little endian encoding.
+
+7z archive format has optional headers that are marked as
+[]
+Header
+[]
+
+REAL_UINT64 means real UINT64.
+
+UINT64 means real UINT64 encoded with the following scheme:
+
+ Size of encoding sequence depends from first byte:
+ First_Byte Extra_Bytes Value
+ (binary)
+ 0xxxxxxx : ( xxxxxxx )
+ 10xxxxxx BYTE y[1] : ( xxxxxx << (8 * 1)) + y
+ 110xxxxx BYTE y[2] : ( xxxxx << (8 * 2)) + y
+ ...
+ 1111110x BYTE y[6] : ( x << (8 * 6)) + y
+ 11111110 BYTE y[7] : y
+ 11111111 BYTE y[8] : y
+
+
+
+Property IDs
+------------
+
+0x00 = kEnd
+
+0x01 = kHeader
+
+0x02 = kArchiveProperties
+
+0x03 = kAdditionalStreamsInfo
+0x04 = kMainStreamsInfo
+0x05 = kFilesInfo
+
+0x06 = kPackInfo
+0x07 = kUnPackInfo
+0x08 = kSubStreamsInfo
+
+0x09 = kSize
+0x0A = kCRC
+
+0x0B = kFolder
+
+0x0C = kCodersUnPackSize
+0x0D = kNumUnPackStream
+
+0x0E = kEmptyStream
+0x0F = kEmptyFile
+0x10 = kAnti
+
+0x11 = kName
+0x12 = kCTime
+0x13 = kATime
+0x14 = kMTime
+0x15 = kWinAttributes
+0x16 = kComment
+
+0x17 = kEncodedHeader
+
+0x18 = kStartPos
+0x19 = kDummy
+
+
+7z format headers
+-----------------
+
+SignatureHeader
+~~~~~~~~~~~~~~~
+ BYTE kSignature[6] = {'7', 'z', 0xBC, 0xAF, 0x27, 0x1C};
+
+ ArchiveVersion
+ {
+ BYTE Major; // now = 0
+ BYTE Minor; // now = 2
+ };
+
+ UINT32 StartHeaderCRC;
+
+ StartHeader
+ {
+ REAL_UINT64 NextHeaderOffset
+ REAL_UINT64 NextHeaderSize
+ UINT32 NextHeaderCRC
+ }
+
+
+...........................
+
+
+ArchiveProperties
+~~~~~~~~~~~~~~~~~
+BYTE NID::kArchiveProperties (0x02)
+for (;;)
+{
+ BYTE PropertyType;
+ if (aType == 0)
+ break;
+ UINT64 PropertySize;
+ BYTE PropertyData[PropertySize];
+}
+
+
+Digests (NumStreams)
+~~~~~~~~~~~~~~~~~~~~~
+ BYTE AllAreDefined
+ if (AllAreDefined == 0)
+ {
+ for(NumStreams)
+ BIT Defined
+ }
+ UINT32 CRCs[NumDefined]
+
+
+PackInfo
+~~~~~~~~~~~~
+ BYTE NID::kPackInfo (0x06)
+ UINT64 PackPos
+ UINT64 NumPackStreams
+
+ []
+ BYTE NID::kSize (0x09)
+ UINT64 PackSizes[NumPackStreams]
+ []
+
+ []
+ BYTE NID::kCRC (0x0A)
+ PackStreamDigests[NumPackStreams]
+ []
+
+ BYTE NID::kEnd
+
+
+Folder
+~~~~~~
+ UINT64 NumCoders;
+ for (NumCoders)
+ {
+ BYTE
+ {
+ 0:3 CodecIdSize
+ 4: Is Complex Coder
+ 5: There Are Attributes
+ 6: Reserved
+ 7: There are more alternative methods. (Not used anymore, must be 0).
+ }
+ BYTE CodecId[CodecIdSize]
+ if (Is Complex Coder)
+ {
+ UINT64 NumInStreams;
+ UINT64 NumOutStreams;
+ }
+ if (There Are Attributes)
+ {
+ UINT64 PropertiesSize
+ BYTE Properties[PropertiesSize]
+ }
+ }
+
+ NumBindPairs = NumOutStreamsTotal - 1;
+
+ for (NumBindPairs)
+ {
+ UINT64 InIndex;
+ UINT64 OutIndex;
+ }
+
+ NumPackedStreams = NumInStreamsTotal - NumBindPairs;
+ if (NumPackedStreams > 1)
+ for(NumPackedStreams)
+ {
+ UINT64 Index;
+ };
+
+
+
+
+Coders Info
+~~~~~~~~~~~
+
+ BYTE NID::kUnPackInfo (0x07)
+
+
+ BYTE NID::kFolder (0x0B)
+ UINT64 NumFolders
+ BYTE External
+ switch(External)
+ {
+ case 0:
+ Folders[NumFolders]
+ case 1:
+ UINT64 DataStreamIndex
+ }
+
+
+ BYTE ID::kCodersUnPackSize (0x0C)
+ for(Folders)
+ for(Folder.NumOutStreams)
+ UINT64 UnPackSize;
+
+
+ []
+ BYTE NID::kCRC (0x0A)
+ UnPackDigests[NumFolders]
+ []
+
+
+
+ BYTE NID::kEnd
+
+
+
+SubStreams Info
+~~~~~~~~~~~~~~
+ BYTE NID::kSubStreamsInfo; (0x08)
+
+ []
+ BYTE NID::kNumUnPackStream; (0x0D)
+ UINT64 NumUnPackStreamsInFolders[NumFolders];
+ []
+
+
+ []
+ BYTE NID::kSize (0x09)
+ UINT64 UnPackSizes[]
+ []
+
+
+ []
+ BYTE NID::kCRC (0x0A)
+ Digests[Number of streams with unknown CRC]
+ []
+
+
+ BYTE NID::kEnd
+
+
+Streams Info
+~~~~~~~~~~~~
+
+ []
+ PackInfo
+ []
+
+
+ []
+ CodersInfo
+ []
+
+
+ []
+ SubStreamsInfo
+ []
+
+ BYTE NID::kEnd
+
+
+FilesInfo
+~~~~~~~~~
+ BYTE NID::kFilesInfo; (0x05)
+ UINT64 NumFiles
+
+ for (;;)
+ {
+ BYTE PropertyType;
+ if (aType == 0)
+ break;
+
+ UINT64 Size;
+
+ switch(PropertyType)
+ {
+ kEmptyStream: (0x0E)
+ for(NumFiles)
+ BIT IsEmptyStream
+
+ kEmptyFile: (0x0F)
+ for(EmptyStreams)
+ BIT IsEmptyFile
+
+ kAnti: (0x10)
+ for(EmptyStreams)
+ BIT IsAntiFile
+
+ case kCTime: (0x12)
+ case kATime: (0x13)
+ case kMTime: (0x14)
+ BYTE AllAreDefined
+ if (AllAreDefined == 0)
+ {
+ for(NumFiles)
+ BIT TimeDefined
+ }
+ BYTE External;
+ if(External != 0)
+ UINT64 DataIndex
+ []
+ for(Definded Items)
+ UINT64 Time
+ []
+
+ kNames: (0x11)
+ BYTE External;
+ if(External != 0)
+ UINT64 DataIndex
+ []
+ for(Files)
+ {
+ wchar_t Names[NameSize];
+ wchar_t 0;
+ }
+ []
+
+ kAttributes: (0x15)
+ BYTE AllAreDefined
+ if (AllAreDefined == 0)
+ {
+ for(NumFiles)
+ BIT AttributesAreDefined
+ }
+ BYTE External;
+ if(External != 0)
+ UINT64 DataIndex
+ []
+ for(Definded Attributes)
+ UINT32 Attributes
+ []
+ }
+ }
+
+
+Header
+~~~~~~
+ BYTE NID::kHeader (0x01)
+
+ []
+ ArchiveProperties
+ []
+
+ []
+ BYTE NID::kAdditionalStreamsInfo; (0x03)
+ StreamsInfo
+ []
+
+ []
+ BYTE NID::kMainStreamsInfo; (0x04)
+ StreamsInfo
+ []
+
+ []
+ FilesInfo
+ []
+
+ BYTE NID::kEnd
+
+
+HeaderInfo
+~~~~~~~~~~
+ []
+ BYTE NID::kEncodedHeader; (0x17)
+ StreamsInfo for Encoded Header
+ []
+
+
+---
+End of document
diff --git a/other-licenses/7zstub/src/DOC/Methods.txt b/other-licenses/7zstub/src/DOC/Methods.txt
new file mode 100644
index 0000000000..11adcb0ba3
--- /dev/null
+++ b/other-licenses/7zstub/src/DOC/Methods.txt
@@ -0,0 +1,167 @@
+7-Zip method IDs for 7z and xz archives
+---------------------------------------
+
+Version: 17.01
+Date: 2017-05-27
+
+Each compression or crypto method in 7z is associated with unique binary value (ID).
+The length of ID in bytes is arbitrary but it can not exceed 63 bits (8 bytes).
+
+xz and 7z formats use same ID map.
+
+If you want to add some new ID, you have two ways:
+ 1) Write request for allocating IDs to 7-Zip developers.
+ 2) Generate 8-bytes ID:
+
+ 3F ZZ ZZ ZZ ZZ ZZ MM MM
+
+ 3F - Prefix for random IDs (1 byte)
+ ZZ ZZ ZZ ZZ ZZ - Developer ID (5 bytes). Use real random bytes.
+
+ MM MM - Method ID (2 bytes)
+
+ You can notify 7-Zip developers about your Developer ID / Method ID.
+
+ Note: Use new ID, if old codec can not decode data encoded with new version.
+
+
+List of defined IDs
+-------------------
+
+00 - Copy
+
+03 - Delta
+04 - BCJ (x86)
+05 - PPC (big-endian)
+06 - IA64
+07 - ARM (little-endian)
+08 - ARMT (little-endian)
+09 - SPARC
+
+21 - LZMA2
+
+02.. - Common
+ 03 [Swap]
+ - 2 Swap2
+ - 4 Swap4
+
+03.. - 7z
+ 01 -
+ 01 - LZMA
+
+ 03 - [Branch Codecs]
+ 01 - [x86 Codecs]
+ 03 - BCJ
+ 1B - BCJ2 (4 packed streams)
+ 02 -
+ 05 - PPC (big-endian)
+ 03 -
+ 01 - Alpha
+ 04 -
+ 01 - IA64
+ 05 -
+ 01 - ARM (little-endian)
+ 06 -
+ 05 - M68 (big-endian)
+ 07 -
+ 01 - ARMT (little-endian)
+ 08 -
+ 05 - SPARC
+
+ 04 -
+ 01 - PPMD
+
+ 7F -
+ 01 - experimental method.
+
+
+04.. - Misc codecs
+
+ 00 - Reserved
+
+ 01 - [Zip]
+ 00 - Copy (not used. Use {00} instead)
+ 01 - Shrink
+ 06 - Implode
+ 08 - Deflate
+ 09 - Deflate64
+ 0A - Imploding
+ 0C - BZip2 (not used. Use {040202} instead)
+ 0E - LZMA (LZMA-zip)
+ 5F - xz
+ 60 - Jpeg
+ 61 - WavPack
+ 62 - PPMd (PPMd-zip)
+ 63 - wzAES
+
+ 02 -
+ 02 - BZip2
+
+ 03 - [Rar]
+ 01 - Rar1
+ 02 - Rar2
+ 03 - Rar3
+ 05 - Rar5
+
+ 04 - [Arj]
+ 01 - Arj(1,2,3)
+ 02 - Arj4
+
+ 05 - [Z]
+
+ 06 - [Lzh]
+
+ 07 - Reserved for 7z
+
+ 08 - [Cab]
+
+ 09 - [NSIS]
+ 01 - DeflateNSIS
+ 02 - BZip2NSIS
+
+ F7 - External codecs (that are not included to 7-Zip)
+
+ 0x xx - reserved
+
+ 10 xx - reserved (LZHAM)
+ 01 - LZHAM
+
+ 11 xx - reserved (Tino Reichardt)
+ 01 - ZSTD
+ 02 - BROTLI
+ 04 - LZ4
+ 05 - LZ5
+ 06 - LIZARD
+
+
+06.. - Crypto
+
+ F0 - Ciphers without hashing algo
+
+ 01 - [AES]
+ 0x - AES-128
+ 4x - AES-192
+ 8x - AES-256
+ Cx - AES
+
+ x0 - ECB
+ x1 - CBC
+ x2 - CFB
+ x3 - OFB
+ x4 - CTR
+
+ F1 - Combine Ciphers
+
+ 01 - [Zip]
+ 01 - ZipCrypto (Main Zip crypto algo)
+
+ 03 - [RAR]
+ 02 -
+ 03 - Rar29AES (AES-128 + modified SHA-1)
+
+ 07 - [7z]
+ 01 - 7zAES (AES-256 + SHA-256)
+
+
+---
+End of document
diff --git a/other-licenses/7zstub/src/DOC/copying.txt b/other-licenses/7zstub/src/DOC/copying.txt
deleted file mode 100644
index f3926a6155..0000000000
--- a/other-licenses/7zstub/src/DOC/copying.txt
+++ /dev/null
@@ -1,504 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
- <one line to give the library's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- <signature of Ty Coon>, 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
diff --git a/other-licenses/7zstub/src/DOC/installer.txt b/other-licenses/7zstub/src/DOC/installer.txt
new file mode 100644
index 0000000000..70ad7dc6a6
--- /dev/null
+++ b/other-licenses/7zstub/src/DOC/installer.txt
@@ -0,0 +1,166 @@
+7-Zip for installers 9.38
+-------------------------
+
+7-Zip is a file archiver for Windows NT/2000/2003/2008/XP/Vista/7/8/10.
+
+7-Zip for installers is part of LZMA SDK.
+LZMA SDK is written and placed in the public domain by Igor Pavlov.
+
+It's allowed to join 7-Zip SFX module with another software.
+It's allowed to change resources of 7-Zip's SFX modules.
+
+
+HOW to use
+-----------
+
+7zr.exe is reduced version of 7za.exe of 7-Zip.
+7zr.exe supports only format with these codecs: LZMA, LZMA2, BCJ, BCJ2, ARM, Copy.
+
+Example of compressing command for installation packages:
+
+7zr a archive.7z files
+
+7zSD.sfx is SFX module for installers. 7zSD.sfx uses msvcrt.dll.
+
+SFX modules for installers allow to create installation program.
+Such module extracts archive to temp folder and then runs specified program and removes
+temp files after program finishing. Self-extract archive for installers must be created
+as joining 3 files: SFX_Module, Installer_Config, 7z_Archive.
+Installer_Config is optional file. You can use the following command to create installer
+self-extract archive:
+
+copy /b 7zSD.sfx + config.txt + archive.7z archive.exe
+
+The smallest installation package size can be achieved, if installation files was
+uncompressed before including to 7z archive.
+
+-y switch for installer module (at runtime) specifies quiet mode for extracting.
+
+Installer Config file format
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Config file contains commands for Installer. File begins from string
+;!@Install@!UTF-8! and ends with ;!@InstallEnd@!. File must be written
+in UTF-8 encoding. File contains string pairs:
+
+ID_String="Value"
+
+ID_String Description
+
+Title Title for messages
+BeginPrompt Begin Prompt message
+Progress Value can be "yes" or "no". Default value is "yes".
+RunProgram Command for executing. Default value is "setup.exe".
+ Substring %%T will be replaced with path to temporary
+ folder, where files were extracted
+Directory Directory prefix for "RunProgram". Default value is ".\\"
+ExecuteFile Name of file for executing
+ExecuteParameters Parameters for "ExecuteFile"
+
+
+You can omit any string pair.
+
+There are two ways to run program: RunProgram and ExecuteFile.
+Use RunProgram, if you want to run some program from .7z archive.
+Use ExecuteFile, if you want to open some document from .7z archive or
+if you want to execute some command from Windows.
+
+If you use RunProgram and if you specify empty directory prefix: Directory="",
+the system searches for the executable file in the following sequence:
+
+1. The directory from which the application (installer) loaded.
+2. The temporary folder, where files were extracted.
+3. The Windows system directory.
+
+
+Config file Examples
+~~~~~~~~~~~~~~~~~~~~
+
+;!@Install@!UTF-8!
+Title="7-Zip 4.00"
+BeginPrompt="Do you want to install the 7-Zip 4.00?"
+RunProgram="setup.exe"
+;!@InstallEnd@!
+
+
+
+;!@Install@!UTF-8!
+Title="7-Zip 4.00"
+BeginPrompt="Do you want to install the 7-Zip 4.00?"
+ExecuteFile="7zip.msi"
+;!@InstallEnd@!
+
+
+
+;!@Install@!UTF-8!
+Title="7-Zip 4.01 Update"
+BeginPrompt="Do you want to install the 7-Zip 4.01 Update?"
+ExecuteFile="msiexec.exe"
+ExecuteParameters="/i 7zip.msi REINSTALL=ALL REINSTALLMODE=vomus"
+;!@InstallEnd@!
+
+
+
+Small SFX modules for installers
+--------------------------------
+
+7zS2.sfx - small SFX module (GUI version)
+7zS2con.sfx - small SFX module (Console version)
+
+Small SFX modules support this codecs: LZMA, LZMA2, BCJ, BCJ2, ARM, COPY
+
+Small SFX module is similar to common SFX module for installers.
+The difference (what's new in small version):
+ - Smaller size (30 KB vs 100 KB)
+ - C source code instead of Ñ++
+ - No installer Configuration file
+ - No extracting progress window
+ - It decompresses solid 7z blocks (it can be whole 7z archive) to RAM.
+ So user that calls SFX installer must have free RAM of size of largest
+ solid 7z block (size of 7z archive at simplest case).
+
+How to use
+----------
+
+copy /b 7zS2.sfx + archive.7z sfx.exe
+
+When you run installer sfx module (sfx.exe)
+1) It creates "7zNNNNNNNN" temp folder in system temp folder.
+2) It extracts .7z archive to that folder
+3) It executes one file from "7zNNNNNNNN" temp folder.
+4) It removes "7zNNNNNNNN" temp folder
+
+You can send parameters to installer, and installer will transfer them to extracted .exe file.
+
+Small SFX uses 3 levels of priorities to select file to execute:
+
+ 1) Files in root folder have higher priority than files in subfolders.
+ 2) File extension priorities (from high to low priority order):
+ bat, cmd, exe, inf, msi, cab (under Windows CE), html, htm
+ 3) File name priorities (from high to low priority order):
+ setup, install, run, start
+
+Windows CE (ARM) version of 7zS2.sfx is included to 7-Zip for Windows Mobile package.
+
+
+Examples
+--------
+
+1) To create compressed console 7-Zip:
+
+7zr a c.7z 7z.exe 7z.dll -mx
+copy /b 7zS2con.sfx + c.7z 7zCompr.exe
+7zCompr.exe b -md22
+
+
+2) To create compressed GUI 7-Zip:
+
+7zr a g.7z 7zg.exe 7z.dll -mx
+copy /b 7zS2.sfx + g.7z 7zgCompr.exe
+7zgCompr.exe b -md22
+
+
+3) To open some file:
+
+7zr a h.7z readme.txt -mx
+copy /b 7zS2.sfx + h.7z 7zTxt.exe
+7zTxt.exe
diff --git a/other-licenses/7zstub/src/DOC/lzma-history.txt b/other-licenses/7zstub/src/DOC/lzma-history.txt
new file mode 100644
index 0000000000..c53e3bd702
--- /dev/null
+++ b/other-licenses/7zstub/src/DOC/lzma-history.txt
@@ -0,0 +1,424 @@
+HISTORY of the LZMA SDK
+-----------------------
+
+18.05 2018-04-30
+-------------------------
+- The speed for LZMA/LZMA2 compressing was increased
+ by 8% for fastest/fast compression levels and
+ by 3% for normal/maximum compression levels.
+- Previous versions of 7-Zip could work incorrectly in "Large memory pages" mode in
+ Windows 10 because of some BUG with "Large Pages" in Windows 10.
+ Now 7-Zip doesn't use "Large Pages" on Windows 10 up to revision 1709 (16299).
+- The BUG was fixed in Lzma2Enc.c
+ Lzma2Enc_Encode2() function worked incorretly,
+ if (inStream == NULL) and the number of block threads is more than 1.
+
+
+18.03 beta 2018-03-04
+-------------------------
+- Asm\x86\LzmaDecOpt.asm: new optimized LZMA decoder written in asm
+ for x64 with about 30% higher speed than main version of LZMA decoder written in C.
+- The speed for single-thread LZMA/LZMA2 decoder written in C was increased by 3%.
+- 7-Zip now can use multi-threading for 7z/LZMA2 decoding,
+ if there are multiple independent data chunks in LZMA2 stream.
+- 7-Zip now can use multi-threading for xz decoding,
+ if there are multiple blocks in xz stream.
+
+
+18.01 2019-01-28
+-------------------------
+- The BUG in 17.01 - 18.00 beta was fixed:
+ XzDec.c : random block unpacking and XzUnpacker_IsBlockFinished()
+ didn't work correctly for xz archives without checksum (CRC).
+
+
+18.00 beta 2019-01-10
+-------------------------
+- The BUG in xz encoder was fixed:
+ There was memory leak of 16 KB for each file compressed with
+ xz compression method, if additional filter was used.
+
+
+17.01 beta 2017-08-28
+-------------------------
+- Minor speed optimization for LZMA2 (xz and 7z) multi-threading compression.
+ 7-Zip now uses additional memory buffers for multi-block LZMA2 compression.
+ CPU utilization was slightly improved.
+- 7-zip now creates multi-block xz archives by default. Block size can be
+ specified with -ms[Size]{m|g} switch.
+- xz decoder now can unpack random block from multi-block xz archives.
+- 7-Zip command line: @listfile now doesn't work after -- switch.
+ Use -i@listfile before -- switch instead.
+- The BUGs were fixed:
+ 7-Zip 17.00 beta crashed for commands that write anti-item to 7z archive.
+
+
+17.00 beta 2017-04-29
+-------------------------
+- NewHandler.h / NewHandler.cpp:
+ now it redefines operator new() only for old MSVC compilers (_MSC_VER < 1900).
+- C/7zTypes.h : the names of variables in interface structures were changed (vt).
+- Some bugs were fixed. 7-Zip could crash in some cases.
+- Some internal changes in code.
+
+
+16.04 2016-10-04
+-------------------------
+- The bug was fixed in DllSecur.c.
+
+
+16.03 2016-09-28
+-------------------------
+- SFX modules now use some protection against DLL preloading attack.
+- Some bugs in 7z code were fixed.
+
+
+16.02 2016-05-21
+-------------------------
+- The BUG in 16.00 - 16.01 was fixed:
+ Split Handler (SplitHandler.cpp) returned incorrect
+ total size value (kpidSize) for split archives.
+
+
+16.01 2016-05-19
+-------------------------
+- Some internal changes to reduce the number of compiler warnings.
+
+
+16.00 2016-05-10
+-------------------------
+- Some bugs were fixed.
+
+
+15.12 2015-11-19
+-------------------------
+- The BUG in C version of 7z decoder was fixed:
+ 7zDec.c : SzDecodeLzma2()
+ 7z decoder could mistakenly report about decoding error for some 7z archives
+ that use LZMA2 compression method.
+ The probability to get that mistaken decoding error report was about
+ one error per 16384 solid blocks for solid blocks larger than 16 KB (compressed size).
+- The BUG (in 9.26-15.11) in C version of 7z decoder was fixed:
+ 7zArcIn.c : SzReadHeader2()
+ 7z decoder worked incorrectly for 7z archives that contain
+ empty solid blocks, that can be placed to 7z archive, if some file is
+ unavailable for reading during archive creation.
+
+
+15.09 beta 2015-10-16
+-------------------------
+- The BUG in LZMA / LZMA2 encoding code was fixed.
+ The BUG in LzFind.c::MatchFinder_ReadBlock() function.
+ If input data size is larger than (4 GiB - dictionary_size),
+ the following code worked incorrectly:
+ - LZMA : LzmaEnc_MemEncode(), LzmaEncode() : LZMA encoding functions
+ for compressing from memory to memory.
+ That BUG is not related to LZMA encoder version that works via streams.
+ - LZMA2 : multi-threaded version of LZMA2 encoder worked incorrectly, if
+ default value of chunk size (CLzma2EncProps::blockSize) is changed
+ to value larger than (4 GiB - dictionary_size).
+
+
+9.38 beta 2015-01-03
+-------------------------
+- The BUG in 9.31-9.37 was fixed:
+ IArchiveGetRawProps interface was disabled for 7z archives.
+- The BUG in 9.26-9.36 was fixed:
+ Some code in CPP\7zip\Archive\7z\ worked correctly only under Windows.
+
+
+9.36 beta 2014-12-26
+-------------------------
+- The BUG in command line version was fixed:
+ 7-Zip created temporary archive in current folder during update archive
+ operation, if -w{Path} switch was not specified.
+ The fixed 7-Zip creates temporary archive in folder that contains updated archive.
+- The BUG in 9.33-9.35 was fixed:
+ 7-Zip silently ignored file reading errors during 7z or gz archive creation,
+ and the created archive contained only part of file that was read before error.
+ The fixed 7-Zip stops archive creation and it reports about error.
+
+
+9.35 beta 2014-12-07
+-------------------------
+- 7zr.exe now support AES encryption.
+- SFX mudules were added to LZMA SDK
+- Some bugs were fixed.
+
+
+9.21 beta 2011-04-11
+-------------------------
+- New class FString for file names at file systems.
+- Speed optimization in CRC code for big-endian CPUs.
+- The BUG in Lzma2Dec.c was fixed:
+ Lzma2Decode function didn't work.
+
+
+9.18 beta 2010-11-02
+-------------------------
+- New small SFX module for installers (SfxSetup).
+
+
+9.12 beta 2010-03-24
+-------------------------
+- The BUG in LZMA SDK 9.* was fixed: LZMA2 codec didn't work,
+ if more than 10 threads were used (or more than 20 threads in some modes).
+
+
+9.11 beta 2010-03-15
+-------------------------
+- PPMd compression method support
+
+
+9.09 2009-12-12
+-------------------------
+- The bug was fixed:
+ Utf16_To_Utf8 funstions in UTFConvert.cpp and 7zMain.c
+ incorrectly converted surrogate characters (the code >= 0x10000) to UTF-8.
+- Some bugs were fixed
+
+
+9.06 2009-08-17
+-------------------------
+- Some changes in ANSI-C 7z Decoder interfaces.
+
+
+9.04 2009-05-30
+-------------------------
+- LZMA2 compression method support
+- xz format support
+
+
+4.65 2009-02-03
+-------------------------
+- Some minor fixes
+
+
+4.63 2008-12-31
+-------------------------
+- Some minor fixes
+
+
+4.61 beta 2008-11-23
+-------------------------
+- The bug in ANSI-C LZMA Decoder was fixed:
+ If encoded stream was corrupted, decoder could access memory
+ outside of allocated range.
+- Some changes in ANSI-C 7z Decoder interfaces.
+- LZMA SDK is placed in the public domain.
+
+
+4.60 beta 2008-08-19
+-------------------------
+- Some minor fixes.
+
+
+4.59 beta 2008-08-13
+-------------------------
+- The bug was fixed:
+ LZMA Encoder in fast compression mode could access memory outside of
+ allocated range in some rare cases.
+
+
+4.58 beta 2008-05-05
+-------------------------
+- ANSI-C LZMA Decoder was rewritten for speed optimizations.
+- ANSI-C LZMA Encoder was included to LZMA SDK.
+- C++ LZMA code now is just wrapper over ANSI-C code.
+
+
+4.57 2007-12-12
+-------------------------
+- Speed optimizations in Ñ++ LZMA Decoder.
+- Small changes for more compatibility with some C/C++ compilers.
+
+
+4.49 beta 2007-07-05
+-------------------------
+- .7z ANSI-C Decoder:
+ - now it supports BCJ and BCJ2 filters
+ - now it supports files larger than 4 GB.
+ - now it supports "Last Write Time" field for files.
+- C++ code for .7z archives compressing/decompressing from 7-zip
+ was included to LZMA SDK.
+
+
+4.43 2006-06-04
+-------------------------
+- Small changes for more compatibility with some C/C++ compilers.
+
+
+4.42 2006-05-15
+-------------------------
+- Small changes in .h files in ANSI-C version.
+
+
+4.39 beta 2006-04-14
+-------------------------
+- The bug in versions 4.33b:4.38b was fixed:
+ C++ version of LZMA encoder could not correctly compress
+ files larger than 2 GB with HC4 match finder (-mfhc4).
+
+
+4.37 beta 2005-04-06
+-------------------------
+- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined.
+
+
+4.35 beta 2005-03-02
+-------------------------
+- The bug was fixed in C++ version of LZMA Decoder:
+ If encoded stream was corrupted, decoder could access memory
+ outside of allocated range.
+
+
+4.34 beta 2006-02-27
+-------------------------
+- Compressing speed and memory requirements for compressing were increased
+- LZMA now can use only these match finders: HC4, BT2, BT3, BT4
+
+
+4.32 2005-12-09
+-------------------------
+- Java version of LZMA SDK was included
+
+
+4.30 2005-11-20
+-------------------------
+- Compression ratio was improved in -a2 mode
+- Speed optimizations for compressing in -a2 mode
+- -fb switch now supports values up to 273
+- The bug in 7z_C (7zIn.c) was fixed:
+ It used Alloc/Free functions from different memory pools.
+ So if program used two memory pools, it worked incorrectly.
+- 7z_C: .7z format supporting was improved
+- LZMA# SDK (C#.NET version) was included
+
+
+4.27 (Updated) 2005-09-21
+-------------------------
+- Some GUIDs/interfaces in C++ were changed.
+ IStream.h:
+ ISequentialInStream::Read now works as old ReadPart
+ ISequentialOutStream::Write now works as old WritePart
+
+
+4.27 2005-08-07
+-------------------------
+- The bug in LzmaDecodeSize.c was fixed:
+ if _LZMA_IN_CB and _LZMA_OUT_READ were defined,
+ decompressing worked incorrectly.
+
+
+4.26 2005-08-05
+-------------------------
+- Fixes in 7z_C code and LzmaTest.c:
+ previous versions could work incorrectly,
+ if malloc(0) returns 0
+
+
+4.23 2005-06-29
+-------------------------
+- Small fixes in C++ code
+
+
+4.22 2005-06-10
+-------------------------
+- Small fixes
+
+
+4.21 2005-06-08
+-------------------------
+- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed
+- New additional version of ANSI-C LZMA Decoder with zlib-like interface:
+ - LzmaStateDecode.h
+ - LzmaStateDecode.c
+ - LzmaStateTest.c
+- ANSI-C LZMA Decoder now can decompress files larger than 4 GB
+
+
+4.17 2005-04-18
+-------------------------
+- New example for RAM->RAM compressing/decompressing:
+ LZMA + BCJ (filter for x86 code):
+ - LzmaRam.h
+ - LzmaRam.cpp
+ - LzmaRamDecode.h
+ - LzmaRamDecode.c
+ - -f86 switch for lzma.exe
+
+
+4.16 2005-03-29
+-------------------------
+- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder):
+ If _LZMA_OUT_READ was defined, and if encoded stream was corrupted,
+ decoder could access memory outside of allocated range.
+- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster).
+ Old version of LZMA Decoder now is in file LzmaDecodeSize.c.
+ LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c
+- Small speed optimization in LZMA C++ code
+- filter for SPARC's code was added
+- Simplified version of .7z ANSI-C Decoder was included
+
+
+4.06 2004-09-05
+-------------------------
+- The bug in v4.05 was fixed:
+ LZMA-Encoder didn't release output stream in some cases.
+
+
+4.05 2004-08-25
+-------------------------
+- Source code of filters for x86, IA-64, ARM, ARM-Thumb
+ and PowerPC code was included to SDK
+- Some internal minor changes
+
+
+4.04 2004-07-28
+-------------------------
+- More compatibility with some C++ compilers
+
+
+4.03 2004-06-18
+-------------------------
+- "Benchmark" command was added. It measures compressing
+ and decompressing speed and shows rating values.
+ Also it checks hardware errors.
+
+
+4.02 2004-06-10
+-------------------------
+- C++ LZMA Encoder/Decoder code now is more portable
+ and it can be compiled by GCC on Linux.
+
+
+4.01 2004-02-15
+-------------------------
+- Some detection of data corruption was enabled.
+ LzmaDecode.c / RangeDecoderReadByte
+ .....
+ {
+ rd->ExtraBytes = 1;
+ return 0xFF;
+ }
+
+
+4.00 2004-02-13
+-------------------------
+- Original version of LZMA SDK
+
+
+
+HISTORY of the LZMA
+-------------------
+ 2001-2008: Improvements to LZMA compressing/decompressing code,
+ keeping compatibility with original LZMA format
+ 1996-2001: Development of LZMA compression format
+
+ Some milestones:
+
+ 2001-08-30: LZMA compression was added to 7-Zip
+ 1999-01-02: First version of 7-Zip was released
+
+
+End of document
diff --git a/other-licenses/7zstub/src/DOC/lzma-sdk.txt b/other-licenses/7zstub/src/DOC/lzma-sdk.txt
new file mode 100644
index 0000000000..01521e9398
--- /dev/null
+++ b/other-licenses/7zstub/src/DOC/lzma-sdk.txt
@@ -0,0 +1,357 @@
+LZMA SDK 18.05
+--------------
+
+LZMA SDK provides the documentation, samples, header files,
+libraries, and tools you need to develop applications that
+use 7z / LZMA / LZMA2 / XZ compression.
+
+LZMA is an improved version of famous LZ77 compression algorithm.
+It was improved in way of maximum increasing of compression ratio,
+keeping high decompression speed and low memory requirements for
+decompressing.
+
+LZMA2 is a LZMA based compression method. LZMA2 provides better
+multithreading support for compression than LZMA and some other improvements.
+
+7z is a file format for data compression and file archiving.
+7z is a main file format for 7-Zip compression program (www.7-zip.org).
+7z format supports different compression methods: LZMA, LZMA2 and others.
+7z also supports AES-256 based encryption.
+
+XZ is a file format for data compression that uses LZMA2 compression.
+XZ format provides additional features: SHA/CRC check, filters for
+improved compression ratio, splitting to blocks and streams,
+
+
+
+LICENSE
+-------
+
+LZMA SDK is written and placed in the public domain by Igor Pavlov.
+
+Some code in LZMA SDK is based on public domain code from another developers:
+ 1) PPMd var.H (2001): Dmitry Shkarin
+ 2) SHA-256: Wei Dai (Crypto++ library)
+
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute the
+original LZMA SDK code, either in source code form or as a compiled binary, for
+any purpose, commercial or non-commercial, and by any means.
+
+LZMA SDK code is compatible with open source licenses, for example, you can
+include it to GNU GPL or GNU LGPL code.
+
+
+LZMA SDK Contents
+-----------------
+
+ Source code:
+
+ - C / C++ / C# / Java - LZMA compression and decompression
+ - C / C++ - LZMA2 compression and decompression
+ - C / C++ - XZ compression and decompression
+ - C - 7z decompression
+ - C++ - 7z compression and decompression
+ - C - small SFXs for installers (7z decompression)
+ - C++ - SFXs and SFXs for installers (7z decompression)
+
+ Precomiled binaries:
+
+ - console programs for lzma / 7z / xz compression and decompression
+ - SFX modules for installers.
+
+
+UNIX/Linux version
+------------------
+To compile C++ version of file->file LZMA encoding, go to directory
+CPP/7zip/Bundles/LzmaCon
+and call make to recompile it:
+ make -f makefile.gcc clean all
+
+In some UNIX/Linux versions you must compile LZMA with static libraries.
+To compile with static libraries, you can use
+LIB = -lm -static
+
+Also you can use p7zip (port of 7-Zip for POSIX systems like Unix or Linux):
+
+ http://p7zip.sourceforge.net/
+
+
+Files
+-----
+
+DOC/7zC.txt - 7z ANSI-C Decoder description
+DOC/7zFormat.txt - 7z Format description
+DOC/installer.txt - information about 7-Zip for installers
+DOC/lzma.txt - LZMA compression description
+DOC/lzma-sdk.txt - LZMA SDK description (this file)
+DOC/lzma-history.txt - history of LZMA SDK
+DOC/lzma-specification.txt - Specification of LZMA
+DOC/Methods.txt - Compression method IDs for .7z
+
+bin/installer/ - example script to create installer that uses SFX module,
+
+bin/7zdec.exe - simplified 7z archive decoder
+bin/7zr.exe - 7-Zip console program (reduced version)
+bin/x64/7zr.exe - 7-Zip console program (reduced version) (x64 version)
+bin/lzma.exe - file->file LZMA encoder/decoder for Windows
+bin/7zS2.sfx - small SFX module for installers (GUI version)
+bin/7zS2con.sfx - small SFX module for installers (Console version)
+bin/7zSD.sfx - SFX module for installers.
+
+
+7zDec.exe
+---------
+7zDec.exe is simplified 7z archive decoder.
+It supports only LZMA, LZMA2, and PPMd methods.
+7zDec decodes whole solid block from 7z archive to RAM.
+The RAM consumption can be high.
+
+
+
+
+Source code structure
+---------------------
+
+
+Asm/ - asm files (optimized code for CRC calculation and Intel-AES encryption)
+
+C/ - C files (compression / decompression and other)
+ Util/
+ 7z - 7z decoder program (decoding 7z files)
+ Lzma - LZMA program (file->file LZMA encoder/decoder).
+ LzmaLib - LZMA library (.DLL for Windows)
+ SfxSetup - small SFX module for installers
+
+CPP/ -- CPP files
+
+ Common - common files for C++ projects
+ Windows - common files for Windows related code
+
+ 7zip - files related to 7-Zip
+
+ Archive - files related to archiving
+
+ Common - common files for archive handling
+ 7z - 7z C++ Encoder/Decoder
+
+ Bundles - Modules that are bundles of other modules (files)
+
+ Alone7z - 7zr.exe: Standalone 7-Zip console program (reduced version)
+ Format7zExtractR - 7zxr.dll: Reduced version of 7z DLL: extracting from 7z/LZMA/BCJ/BCJ2.
+ Format7zR - 7zr.dll: Reduced version of 7z DLL: extracting/compressing to 7z/LZMA/BCJ/BCJ2
+ LzmaCon - lzma.exe: LZMA compression/decompression
+ LzmaSpec - example code for LZMA Specification
+ SFXCon - 7zCon.sfx: Console 7z SFX module
+ SFXSetup - 7zS.sfx: 7z SFX module for installers
+ SFXWin - 7z.sfx: GUI 7z SFX module
+
+ Common - common files for 7-Zip
+
+ Compress - files for compression/decompression
+
+ Crypto - files for encryption / decompression
+
+ UI - User Interface files
+
+ Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll
+ Common - Common UI files
+ Console - Code for console program (7z.exe)
+ Explorer - Some code from 7-Zip Shell extension
+ FileManager - Some GUI code from 7-Zip File Manager
+ GUI - Some GUI code from 7-Zip
+
+
+CS/ - C# files
+ 7zip
+ Common - some common files for 7-Zip
+ Compress - files related to compression/decompression
+ LZ - files related to LZ (Lempel-Ziv) compression algorithm
+ LZMA - LZMA compression/decompression
+ LzmaAlone - file->file LZMA compression/decompression
+ RangeCoder - Range Coder (special code of compression/decompression)
+
+Java/ - Java files
+ SevenZip
+ Compression - files related to compression/decompression
+ LZ - files related to LZ (Lempel-Ziv) compression algorithm
+ LZMA - LZMA compression/decompression
+ RangeCoder - Range Coder (special code of compression/decompression)
+
+
+Note:
+ Asm / C / C++ source code of LZMA SDK is part of 7-Zip's source code.
+ 7-Zip's source code can be downloaded from 7-Zip's SourceForge page:
+
+ http://sourceforge.net/projects/sevenzip/
+
+
+
+LZMA features
+-------------
+ - Variable dictionary size (up to 1 GB)
+ - Estimated compressing speed: about 2 MB/s on 2 GHz CPU
+ - Estimated decompressing speed:
+ - 20-30 MB/s on modern 2 GHz cpu
+ - 1-2 MB/s on 200 MHz simple RISC cpu: (ARM, MIPS, PowerPC)
+ - Small memory requirements for decompressing (16 KB + DictionarySize)
+ - Small code size for decompressing: 5-8 KB
+
+LZMA decoder uses only integer operations and can be
+implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
+
+Some critical operations that affect the speed of LZMA decompression:
+ 1) 32*16 bit integer multiply
+ 2) Mispredicted branches (penalty mostly depends from pipeline length)
+ 3) 32-bit shift and arithmetic operations
+
+The speed of LZMA decompressing mostly depends from CPU speed.
+Memory speed has no big meaning. But if your CPU has small data cache,
+overall weight of memory speed will slightly increase.
+
+
+How To Use
+----------
+
+Using LZMA encoder/decoder executable
+--------------------------------------
+
+Usage: LZMA <e|d> inputFile outputFile [<switches>...]
+
+ e: encode file
+
+ d: decode file
+
+ b: Benchmark. There are two tests: compressing and decompressing
+ with LZMA method. Benchmark shows rating in MIPS (million
+ instructions per second). Rating value is calculated from
+ measured speed and it is normalized with Intel's Core 2 results.
+ Also Benchmark checks possible hardware errors (RAM
+ errors in most cases). Benchmark uses these settings:
+ (-a1, -d21, -fb32, -mfbt4). You can change only -d parameter.
+ Also you can change the number of iterations. Example for 30 iterations:
+ LZMA b 30
+ Default number of iterations is 10.
+
+<Switches>
+
+
+ -a{N}: set compression mode 0 = fast, 1 = normal
+ default: 1 (normal)
+
+ d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
+ The maximum value for dictionary size is 1 GB = 2^30 bytes.
+ Dictionary size is calculated as DictionarySize = 2^N bytes.
+ For decompressing file compressed by LZMA method with dictionary
+ size D = 2^N you need about D bytes of memory (RAM).
+
+ -fb{N}: set number of fast bytes - [5, 273], default: 128
+ Usually big number gives a little bit better compression ratio
+ and slower compression process.
+
+ -lc{N}: set number of literal context bits - [0, 8], default: 3
+ Sometimes lc=4 gives gain for big files.
+
+ -lp{N}: set number of literal pos bits - [0, 4], default: 0
+ lp switch is intended for periodical data when period is
+ equal 2^N. For example, for 32-bit (4 bytes)
+ periodical data you can use lp=2. Often it's better to set lc0,
+ if you change lp switch.
+
+ -pb{N}: set number of pos bits - [0, 4], default: 2
+ pb switch is intended for periodical data
+ when period is equal 2^N.
+
+ -mf{MF_ID}: set Match Finder. Default: bt4.
+ Algorithms from hc* group doesn't provide good compression
+ ratio, but they often works pretty fast in combination with
+ fast mode (-a0).
+
+ Memory requirements depend from dictionary size
+ (parameter "d" in table below).
+
+ MF_ID Memory Description
+
+ bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
+ bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
+ bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
+ hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
+
+ -eos: write End Of Stream marker. By default LZMA doesn't write
+ eos marker, since LZMA decoder knows uncompressed size
+ stored in .lzma file header.
+
+ -si: Read data from stdin (it will write End Of Stream marker).
+ -so: Write data to stdout
+
+
+Examples:
+
+1) LZMA e file.bin file.lzma -d16 -lc0
+
+compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
+and 0 literal context bits. -lc0 allows to reduce memory requirements
+for decompression.
+
+
+2) LZMA e file.bin file.lzma -lc0 -lp2
+
+compresses file.bin to file.lzma with settings suitable
+for 32-bit periodical data (for example, ARM or MIPS code).
+
+3) LZMA d file.lzma file.bin
+
+decompresses file.lzma to file.bin.
+
+
+Compression ratio hints
+-----------------------
+
+Recommendations
+---------------
+
+To increase the compression ratio for LZMA compressing it's desirable
+to have aligned data (if it's possible) and also it's desirable to locate
+data in such order, where code is grouped in one place and data is
+grouped in other place (it's better than such mixing: code, data, code,
+data, ...).
+
+
+Filters
+-------
+You can increase the compression ratio for some data types, using
+special filters before compressing. For example, it's possible to
+increase the compression ratio on 5-10% for code for those CPU ISAs:
+x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
+
+You can find C source code of such filters in C/Bra*.* files
+
+You can check the compression ratio gain of these filters with such
+7-Zip commands (example for ARM code):
+No filter:
+ 7z a a1.7z a.bin -m0=lzma
+
+With filter for little-endian ARM code:
+ 7z a a2.7z a.bin -m0=arm -m1=lzma
+
+It works in such manner:
+Compressing = Filter_encoding + LZMA_encoding
+Decompressing = LZMA_decoding + Filter_decoding
+
+Compressing and decompressing speed of such filters is very high,
+so it will not increase decompressing time too much.
+Moreover, it reduces decompression time for LZMA_decoding,
+since compression ratio with filtering is higher.
+
+These filters convert CALL (calling procedure) instructions
+from relative offsets to absolute addresses, so such data becomes more
+compressible.
+
+For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
+
+
+
+---
+
+http://www.7-zip.org
+http://www.7-zip.org/sdk.html
+http://www.7-zip.org/support.html
diff --git a/other-licenses/7zstub/src/DOC/lzma-specification.txt b/other-licenses/7zstub/src/DOC/lzma-specification.txt
new file mode 100644
index 0000000000..b6796df756
--- /dev/null
+++ b/other-licenses/7zstub/src/DOC/lzma-specification.txt
@@ -0,0 +1,1176 @@
+LZMA specification (DRAFT version)
+----------------------------------
+
+Author: Igor Pavlov
+Date: 2015-06-14
+
+This specification defines the format of LZMA compressed data and lzma file format.
+
+Notation
+--------
+
+We use the syntax of C++ programming language.
+We use the following types in C++ code:
+ unsigned - unsigned integer, at least 16 bits in size
+ int - signed integer, at least 16 bits in size
+ UInt64 - 64-bit unsigned integer
+ UInt32 - 32-bit unsigned integer
+ UInt16 - 16-bit unsigned integer
+ Byte - 8-bit unsigned integer
+ bool - boolean type with two possible values: false, true
+
+
+lzma file format
+================
+
+The lzma file contains the raw LZMA stream and the header with related properties.
+
+The files in that format use ".lzma" extension.
+
+The lzma file format layout:
+
+Offset Size Description
+
+ 0 1 LZMA model properties (lc, lp, pb) in encoded form
+ 1 4 Dictionary size (32-bit unsigned integer, little-endian)
+ 5 8 Uncompressed size (64-bit unsigned integer, little-endian)
+ 13 Compressed data (LZMA stream)
+
+LZMA properties:
+
+ name Range Description
+
+ lc [0, 8] the number of "literal context" bits
+ lp [0, 4] the number of "literal pos" bits
+ pb [0, 4] the number of "pos" bits
+dictSize [0, 2^32 - 1] the dictionary size
+
+The following code encodes LZMA properties:
+
+void EncodeProperties(Byte *properties)
+{
+ properties[0] = (Byte)((pb * 5 + lp) * 9 + lc);
+ Set_UInt32_LittleEndian(properties + 1, dictSize);
+}
+
+If the value of dictionary size in properties is smaller than (1 << 12),
+the LZMA decoder must set the dictionary size variable to (1 << 12).
+
+#define LZMA_DIC_MIN (1 << 12)
+
+ unsigned lc, pb, lp;
+ UInt32 dictSize;
+ UInt32 dictSizeInProperties;
+
+ void DecodeProperties(const Byte *properties)
+ {
+ unsigned d = properties[0];
+ if (d >= (9 * 5 * 5))
+ throw "Incorrect LZMA properties";
+ lc = d % 9;
+ d /= 9;
+ pb = d / 5;
+ lp = d % 5;
+ dictSizeInProperties = 0;
+ for (int i = 0; i < 4; i++)
+ dictSizeInProperties |= (UInt32)properties[i + 1] << (8 * i);
+ dictSize = dictSizeInProperties;
+ if (dictSize < LZMA_DIC_MIN)
+ dictSize = LZMA_DIC_MIN;
+ }
+
+If "Uncompressed size" field contains ones in all 64 bits, it means that
+uncompressed size is unknown and there is the "end marker" in stream,
+that indicates the end of decoding point.
+In opposite case, if the value from "Uncompressed size" field is not
+equal to ((2^64) - 1), the LZMA stream decoding must be finished after
+specified number of bytes (Uncompressed size) is decoded. And if there
+is the "end marker", the LZMA decoder must read that marker also.
+
+
+The new scheme to encode LZMA properties
+----------------------------------------
+
+If LZMA compression is used for some another format, it's recommended to
+use a new improved scheme to encode LZMA properties. That new scheme was
+used in xz format that uses the LZMA2 compression algorithm.
+The LZMA2 is a new compression algorithm that is based on the LZMA algorithm.
+
+The dictionary size in LZMA2 is encoded with just one byte and LZMA2 supports
+only reduced set of dictionary sizes:
+ (2 << 11), (3 << 11),
+ (2 << 12), (3 << 12),
+ ...
+ (2 << 30), (3 << 30),
+ (2 << 31) - 1
+
+The dictionary size can be extracted from encoded value with the following code:
+
+ dictSize = (p == 40) ? 0xFFFFFFFF : (((UInt32)2 | ((p) & 1)) << ((p) / 2 + 11));
+
+Also there is additional limitation (lc + lp <= 4) in LZMA2 for values of
+"lc" and "lp" properties:
+
+ if (lc + lp > 4)
+ throw "Unsupported properties: (lc + lp) > 4";
+
+There are some advantages for LZMA decoder with such (lc + lp) value
+limitation. It reduces the maximum size of tables allocated by decoder.
+And it reduces the complexity of initialization procedure, that can be
+important to keep high speed of decoding of big number of small LZMA streams.
+
+It's recommended to use that limitation (lc + lp <= 4) for any new format
+that uses LZMA compression. Note that the combinations of "lc" and "lp"
+parameters, where (lc + lp > 4), can provide significant improvement in
+compression ratio only in some rare cases.
+
+The LZMA properties can be encoded into two bytes in new scheme:
+
+Offset Size Description
+
+ 0 1 The dictionary size encoded with LZMA2 scheme
+ 1 1 LZMA model properties (lc, lp, pb) in encoded form
+
+
+The RAM usage
+=============
+
+The RAM usage for LZMA decoder is determined by the following parts:
+
+1) The Sliding Window (from 4 KiB to 4 GiB).
+2) The probability model counter arrays (arrays of 16-bit variables).
+3) Some additional state variables (about 10 variables of 32-bit integers).
+
+
+The RAM usage for Sliding Window
+--------------------------------
+
+There are two main scenarios of decoding:
+
+1) The decoding of full stream to one RAM buffer.
+
+ If we decode full LZMA stream to one output buffer in RAM, the decoder
+ can use that output buffer as sliding window. So the decoder doesn't
+ need additional buffer allocated for sliding window.
+
+2) The decoding to some external storage.
+
+ If we decode LZMA stream to external storage, the decoder must allocate
+ the buffer for sliding window. The size of that buffer must be equal
+ or larger than the value of dictionary size from properties of LZMA stream.
+
+In this specification we describe the code for decoding to some external
+storage. The optimized version of code for decoding of full stream to one
+output RAM buffer can require some minor changes in code.
+
+
+The RAM usage for the probability model counters
+------------------------------------------------
+
+The size of the probability model counter arrays is calculated with the
+following formula:
+
+size_of_prob_arrays = 1846 + 768 * (1 << (lp + lc))
+
+Each probability model counter is 11-bit unsigned integer.
+If we use 16-bit integer variables (2-byte integers) for these probability
+model counters, the RAM usage required by probability model counter arrays
+can be estimated with the following formula:
+
+ RAM = 4 KiB + 1.5 KiB * (1 << (lp + lc))
+
+For example, for default LZMA parameters (lp = 0 and lc = 3), the RAM usage is
+
+ RAM_lc3_lp0 = 4 KiB + 1.5 KiB * 8 = 16 KiB
+
+The maximum RAM state usage is required for decoding the stream with lp = 4
+and lc = 8:
+
+ RAM_lc8_lp4 = 4 KiB + 1.5 KiB * 4096 = 6148 KiB
+
+If the decoder uses LZMA2's limited property condition
+(lc + lp <= 4), the RAM usage will be not larger than
+
+ RAM_lc_lp_4 = 4 KiB + 1.5 KiB * 16 = 28 KiB
+
+
+The RAM usage for encoder
+-------------------------
+
+There are many variants for LZMA encoding code.
+These variants have different values for memory consumption.
+Note that memory consumption for LZMA Encoder can not be
+smaller than memory consumption of LZMA Decoder for same stream.
+
+The RAM usage required by modern effective implementation of
+LZMA Encoder can be estimated with the following formula:
+
+ Encoder_RAM_Usage = 4 MiB + 11 * dictionarySize.
+
+But there are some modes of the encoder that require less memory.
+
+
+LZMA Decoding
+=============
+
+The LZMA compression algorithm uses LZ-based compression with Sliding Window
+and Range Encoding as entropy coding method.
+
+
+Sliding Window
+--------------
+
+LZMA uses Sliding Window compression similar to LZ77 algorithm.
+
+LZMA stream must be decoded to the sequence that consists
+of MATCHES and LITERALS:
+
+ - a LITERAL is a 8-bit character (one byte).
+ The decoder just puts that LITERAL to the uncompressed stream.
+
+ - a MATCH is a pair of two numbers (DISTANCE-LENGTH pair).
+ The decoder takes one byte exactly "DISTANCE" characters behind
+ current position in the uncompressed stream and puts it to
+ uncompressed stream. The decoder must repeat it "LENGTH" times.
+
+The "DISTANCE" can not be larger than dictionary size.
+And the "DISTANCE" can not be larger than the number of bytes in
+the uncompressed stream that were decoded before that match.
+
+In this specification we use cyclic buffer to implement Sliding Window
+for LZMA decoder:
+
+class COutWindow
+{
+ Byte *Buf;
+ UInt32 Pos;
+ UInt32 Size;
+ bool IsFull;
+
+public:
+ unsigned TotalPos;
+ COutStream OutStream;
+
+ COutWindow(): Buf(NULL) {}
+ ~COutWindow() { delete []Buf; }
+
+ void Create(UInt32 dictSize)
+ {
+ Buf = new Byte[dictSize];
+ Pos = 0;
+ Size = dictSize;
+ IsFull = false;
+ TotalPos = 0;
+ }
+
+ void PutByte(Byte b)
+ {
+ TotalPos++;
+ Buf[Pos++] = b;
+ if (Pos == Size)
+ {
+ Pos = 0;
+ IsFull = true;
+ }
+ OutStream.WriteByte(b);
+ }
+
+ Byte GetByte(UInt32 dist) const
+ {
+ return Buf[dist <= Pos ? Pos - dist : Size - dist + Pos];
+ }
+
+ void CopyMatch(UInt32 dist, unsigned len)
+ {
+ for (; len > 0; len--)
+ PutByte(GetByte(dist));
+ }
+
+ bool CheckDistance(UInt32 dist) const
+ {
+ return dist <= Pos || IsFull;
+ }
+
+ bool IsEmpty() const
+ {
+ return Pos == 0 && !IsFull;
+ }
+};
+
+
+In another implementation it's possible to use one buffer that contains
+Sliding Window and the whole data stream after uncompressing.
+
+
+Range Decoder
+-------------
+
+LZMA algorithm uses Range Encoding (1) as entropy coding method.
+
+LZMA stream contains just one very big number in big-endian encoding.
+LZMA decoder uses the Range Decoder to extract a sequence of binary
+symbols from that big number.
+
+The state of the Range Decoder:
+
+struct CRangeDecoder
+{
+ UInt32 Range;
+ UInt32 Code;
+ InputStream *InStream;
+
+ bool Corrupted;
+}
+
+The notes about UInt32 type for the "Range" and "Code" variables:
+
+ It's possible to use 64-bit (unsigned or signed) integer type
+ for the "Range" and the "Code" variables instead of 32-bit unsigned,
+ but some additional code must be used to truncate the values to
+ low 32-bits after some operations.
+
+ If the programming language does not support 32-bit unsigned integer type
+ (like in case of JAVA language), it's possible to use 32-bit signed integer,
+ but some code must be changed. For example, it's required to change the code
+ that uses comparison operations for UInt32 variables in this specification.
+
+The Range Decoder can be in some states that can be treated as
+"Corruption" in LZMA stream. The Range Decoder uses the variable "Corrupted":
+
+ (Corrupted == false), if the Range Decoder has not detected any corruption.
+ (Corrupted == true), if the Range Decoder has detected some corruption.
+
+The reference LZMA Decoder ignores the value of the "Corrupted" variable.
+So it continues to decode the stream, even if the corruption can be detected
+in the Range Decoder. To provide the full compatibility with output of the
+reference LZMA Decoder, another LZMA Decoder implementations must also
+ignore the value of the "Corrupted" variable.
+
+The LZMA Encoder is required to create only such LZMA streams, that will not
+lead the Range Decoder to states, where the "Corrupted" variable is set to true.
+
+The Range Decoder reads first 5 bytes from input stream to initialize
+the state:
+
+bool CRangeDecoder::Init()
+{
+ Corrupted = false;
+ Range = 0xFFFFFFFF;
+ Code = 0;
+
+ Byte b = InStream->ReadByte();
+
+ for (int i = 0; i < 4; i++)
+ Code = (Code << 8) | InStream->ReadByte();
+
+ if (b != 0 || Code == Range)
+ Corrupted = true;
+ return b == 0;
+}
+
+The LZMA Encoder always writes ZERO in initial byte of compressed stream.
+That scheme allows to simplify the code of the Range Encoder in the
+LZMA Encoder. If initial byte is not equal to ZERO, the LZMA Decoder must
+stop decoding and report error.
+
+After the last bit of data was decoded by Range Decoder, the value of the
+"Code" variable must be equal to 0. The LZMA Decoder must check it by
+calling the IsFinishedOK() function:
+
+ bool IsFinishedOK() const { return Code == 0; }
+
+If there is corruption in data stream, there is big probability that
+the "Code" value will be not equal to 0 in the Finish() function. So that
+check in the IsFinishedOK() function provides very good feature for
+corruption detection.
+
+The value of the "Range" variable before each bit decoding can not be smaller
+than ((UInt32)1 << 24). The Normalize() function keeps the "Range" value in
+described range.
+
+#define kTopValue ((UInt32)1 << 24)
+
+void CRangeDecoder::Normalize()
+{
+ if (Range < kTopValue)
+ {
+ Range <<= 8;
+ Code = (Code << 8) | InStream->ReadByte();
+ }
+}
+
+Notes: if the size of the "Code" variable is larger than 32 bits, it's
+required to keep only low 32 bits of the "Code" variable after the change
+in Normalize() function.
+
+If the LZMA Stream is not corrupted, the value of the "Code" variable is
+always smaller than value of the "Range" variable.
+But the Range Decoder ignores some types of corruptions, so the value of
+the "Code" variable can be equal or larger than value of the "Range" variable
+for some "Corrupted" archives.
+
+
+LZMA uses Range Encoding only with binary symbols of two types:
+ 1) binary symbols with fixed and equal probabilities (direct bits)
+ 2) binary symbols with predicted probabilities
+
+The DecodeDirectBits() function decodes the sequence of direct bits:
+
+UInt32 CRangeDecoder::DecodeDirectBits(unsigned numBits)
+{
+ UInt32 res = 0;
+ do
+ {
+ Range >>= 1;
+ Code -= Range;
+ UInt32 t = 0 - ((UInt32)Code >> 31);
+ Code += Range & t;
+
+ if (Code == Range)
+ Corrupted = true;
+
+ Normalize();
+ res <<= 1;
+ res += t + 1;
+ }
+ while (--numBits);
+ return res;
+}
+
+
+The Bit Decoding with Probability Model
+---------------------------------------
+
+The task of Bit Probability Model is to estimate probabilities of binary
+symbols. And then it provides the Range Decoder with that information.
+The better prediction provides better compression ratio.
+The Bit Probability Model uses statistical data of previous decoded
+symbols.
+
+That estimated probability is presented as 11-bit unsigned integer value
+that represents the probability of symbol "0".
+
+#define kNumBitModelTotalBits 11
+
+Mathematical probabilities can be presented with the following formulas:
+ probability(symbol_0) = prob / 2048.
+ probability(symbol_1) = 1 - Probability(symbol_0) =
+ = 1 - prob / 2048 =
+ = (2048 - prob) / 2048
+where the "prob" variable contains 11-bit integer probability counter.
+
+It's recommended to use 16-bit unsigned integer type, to store these 11-bit
+probability values:
+
+typedef UInt16 CProb;
+
+Each probability value must be initialized with value ((1 << 11) / 2),
+that represents the state, where probabilities of symbols 0 and 1
+are equal to 0.5:
+
+#define PROB_INIT_VAL ((1 << kNumBitModelTotalBits) / 2)
+
+The INIT_PROBS macro is used to initialize the array of CProb variables:
+
+#define INIT_PROBS(p) \
+ { for (unsigned i = 0; i < sizeof(p) / sizeof(p[0]); i++) p[i] = PROB_INIT_VAL; }
+
+
+The DecodeBit() function decodes one bit.
+The LZMA decoder provides the pointer to CProb variable that contains
+information about estimated probability for symbol 0 and the Range Decoder
+updates that CProb variable after decoding. The Range Decoder increases
+estimated probability of the symbol that was decoded:
+
+#define kNumMoveBits 5
+
+unsigned CRangeDecoder::DecodeBit(CProb *prob)
+{
+ unsigned v = *prob;
+ UInt32 bound = (Range >> kNumBitModelTotalBits) * v;
+ unsigned symbol;
+ if (Code < bound)
+ {
+ v += ((1 << kNumBitModelTotalBits) - v) >> kNumMoveBits;
+ Range = bound;
+ symbol = 0;
+ }
+ else
+ {
+ v -= v >> kNumMoveBits;
+ Code -= bound;
+ Range -= bound;
+ symbol = 1;
+ }
+ *prob = (CProb)v;
+ Normalize();
+ return symbol;
+}
+
+
+The Binary Tree of bit model counters
+-------------------------------------
+
+LZMA uses a tree of Bit model variables to decode symbol that needs
+several bits for storing. There are two versions of such trees in LZMA:
+ 1) the tree that decodes bits from high bit to low bit (the normal scheme).
+ 2) the tree that decodes bits from low bit to high bit (the reverse scheme).
+
+Each binary tree structure supports different size of decoded symbol
+(the size of binary sequence that contains value of symbol).
+If that size of decoded symbol is "NumBits" bits, the tree structure
+uses the array of (2 << NumBits) counters of CProb type.
+But only ((2 << NumBits) - 1) items are used by encoder and decoder.
+The first item (the item with index equal to 0) in array is unused.
+That scheme with unused array's item allows to simplify the code.
+
+unsigned BitTreeReverseDecode(CProb *probs, unsigned numBits, CRangeDecoder *rc)
+{
+ unsigned m = 1;
+ unsigned symbol = 0;
+ for (unsigned i = 0; i < numBits; i++)
+ {
+ unsigned bit = rc->DecodeBit(&probs[m]);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << i);
+ }
+ return symbol;
+}
+
+template <unsigned NumBits>
+class CBitTreeDecoder
+{
+ CProb Probs[(unsigned)1 << NumBits];
+
+public:
+
+ void Init()
+ {
+ INIT_PROBS(Probs);
+ }
+
+ unsigned Decode(CRangeDecoder *rc)
+ {
+ unsigned m = 1;
+ for (unsigned i = 0; i < NumBits; i++)
+ m = (m << 1) + rc->DecodeBit(&Probs[m]);
+ return m - ((unsigned)1 << NumBits);
+ }
+
+ unsigned ReverseDecode(CRangeDecoder *rc)
+ {
+ return BitTreeReverseDecode(Probs, NumBits, rc);
+ }
+};
+
+
+LZ part of LZMA
+---------------
+
+LZ part of LZMA describes details about the decoding of MATCHES and LITERALS.
+
+
+The Literal Decoding
+--------------------
+
+The LZMA Decoder uses (1 << (lc + lp)) tables with CProb values, where
+each table contains 0x300 CProb values:
+
+ CProb *LitProbs;
+
+ void CreateLiterals()
+ {
+ LitProbs = new CProb[(UInt32)0x300 << (lc + lp)];
+ }
+
+ void InitLiterals()
+ {
+ UInt32 num = (UInt32)0x300 << (lc + lp);
+ for (UInt32 i = 0; i < num; i++)
+ LitProbs[i] = PROB_INIT_VAL;
+ }
+
+To select the table for decoding it uses the context that consists of
+(lc) high bits from previous literal and (lp) low bits from value that
+represents current position in outputStream.
+
+If (State > 7), the Literal Decoder also uses "matchByte" that represents
+the byte in OutputStream at position the is the DISTANCE bytes before
+current position, where the DISTANCE is the distance in DISTANCE-LENGTH pair
+of latest decoded match.
+
+The following code decodes one literal and puts it to Sliding Window buffer:
+
+ void DecodeLiteral(unsigned state, UInt32 rep0)
+ {
+ unsigned prevByte = 0;
+ if (!OutWindow.IsEmpty())
+ prevByte = OutWindow.GetByte(1);
+
+ unsigned symbol = 1;
+ unsigned litState = ((OutWindow.TotalPos & ((1 << lp) - 1)) << lc) + (prevByte >> (8 - lc));
+ CProb *probs = &LitProbs[(UInt32)0x300 * litState];
+
+ if (state >= 7)
+ {
+ unsigned matchByte = OutWindow.GetByte(rep0 + 1);
+ do
+ {
+ unsigned matchBit = (matchByte >> 7) & 1;
+ matchByte <<= 1;
+ unsigned bit = RangeDec.DecodeBit(&probs[((1 + matchBit) << 8) + symbol]);
+ symbol = (symbol << 1) | bit;
+ if (matchBit != bit)
+ break;
+ }
+ while (symbol < 0x100);
+ }
+ while (symbol < 0x100)
+ symbol = (symbol << 1) | RangeDec.DecodeBit(&probs[symbol]);
+ OutWindow.PutByte((Byte)(symbol - 0x100));
+ }
+
+
+The match length decoding
+-------------------------
+
+The match length decoder returns normalized (zero-based value)
+length of match. That value can be converted to real length of the match
+with the following code:
+
+#define kMatchMinLen 2
+
+ matchLen = len + kMatchMinLen;
+
+The match length decoder can return the values from 0 to 271.
+And the corresponded real match length values can be in the range
+from 2 to 273.
+
+The following scheme is used for the match length encoding:
+
+ Binary encoding Binary Tree structure Zero-based match length
+ sequence (binary + decimal):
+
+ 0 xxx LowCoder[posState] xxx
+ 1 0 yyy MidCoder[posState] yyy + 8
+ 1 1 zzzzzzzz HighCoder zzzzzzzz + 16
+
+LZMA uses bit model variable "Choice" to decode the first selection bit.
+
+If the first selection bit is equal to 0, the decoder uses binary tree
+ LowCoder[posState] to decode 3-bit zero-based match length (xxx).
+
+If the first selection bit is equal to 1, the decoder uses bit model
+ variable "Choice2" to decode the second selection bit.
+
+ If the second selection bit is equal to 0, the decoder uses binary tree
+ MidCoder[posState] to decode 3-bit "yyy" value, and zero-based match
+ length is equal to (yyy + 8).
+
+ If the second selection bit is equal to 1, the decoder uses binary tree
+ HighCoder to decode 8-bit "zzzzzzzz" value, and zero-based
+ match length is equal to (zzzzzzzz + 16).
+
+LZMA uses "posState" value as context to select the binary tree
+from LowCoder and MidCoder binary tree arrays:
+
+ unsigned posState = OutWindow.TotalPos & ((1 << pb) - 1);
+
+The full code of the length decoder:
+
+class CLenDecoder
+{
+ CProb Choice;
+ CProb Choice2;
+ CBitTreeDecoder<3> LowCoder[1 << kNumPosBitsMax];
+ CBitTreeDecoder<3> MidCoder[1 << kNumPosBitsMax];
+ CBitTreeDecoder<8> HighCoder;
+
+public:
+
+ void Init()
+ {
+ Choice = PROB_INIT_VAL;
+ Choice2 = PROB_INIT_VAL;
+ HighCoder.Init();
+ for (unsigned i = 0; i < (1 << kNumPosBitsMax); i++)
+ {
+ LowCoder[i].Init();
+ MidCoder[i].Init();
+ }
+ }
+
+ unsigned Decode(CRangeDecoder *rc, unsigned posState)
+ {
+ if (rc->DecodeBit(&Choice) == 0)
+ return LowCoder[posState].Decode(rc);
+ if (rc->DecodeBit(&Choice2) == 0)
+ return 8 + MidCoder[posState].Decode(rc);
+ return 16 + HighCoder.Decode(rc);
+ }
+};
+
+The LZMA decoder uses two instances of CLenDecoder class.
+The first instance is for the matches of "Simple Match" type,
+and the second instance is for the matches of "Rep Match" type:
+
+ CLenDecoder LenDecoder;
+ CLenDecoder RepLenDecoder;
+
+
+The match distance decoding
+---------------------------
+
+LZMA supports dictionary sizes up to 4 GiB minus 1.
+The value of match distance (decoded by distance decoder) can be
+from 1 to 2^32. But the distance value that is equal to 2^32 is used to
+indicate the "End of stream" marker. So real largest match distance
+that is used for LZ-window match is (2^32 - 1).
+
+LZMA uses normalized match length (zero-based length)
+to calculate the context state "lenState" do decode the distance value:
+
+#define kNumLenToPosStates 4
+
+ unsigned lenState = len;
+ if (lenState > kNumLenToPosStates - 1)
+ lenState = kNumLenToPosStates - 1;
+
+The distance decoder returns the "dist" value that is zero-based value
+of match distance. The real match distance can be calculated with the
+following code:
+
+ matchDistance = dist + 1;
+
+The state of the distance decoder and the initialization code:
+
+ #define kEndPosModelIndex 14
+ #define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
+ #define kNumAlignBits 4
+
+ CBitTreeDecoder<6> PosSlotDecoder[kNumLenToPosStates];
+ CProb PosDecoders[1 + kNumFullDistances - kEndPosModelIndex];
+ CBitTreeDecoder<kNumAlignBits> AlignDecoder;
+
+ void InitDist()
+ {
+ for (unsigned i = 0; i < kNumLenToPosStates; i++)
+ PosSlotDecoder[i].Init();
+ AlignDecoder.Init();
+ INIT_PROBS(PosDecoders);
+ }
+
+At first stage the distance decoder decodes 6-bit "posSlot" value with bit
+tree decoder from PosSlotDecoder array. It's possible to get 2^6=64 different
+"posSlot" values.
+
+ unsigned posSlot = PosSlotDecoder[lenState].Decode(&RangeDec);
+
+The encoding scheme for distance value is shown in the following table:
+
+posSlot (decimal) /
+ zero-based distance (binary)
+ 0 0
+ 1 1
+ 2 10
+ 3 11
+
+ 4 10 x
+ 5 11 x
+ 6 10 xx
+ 7 11 xx
+ 8 10 xxx
+ 9 11 xxx
+10 10 xxxx
+11 11 xxxx
+12 10 xxxxx
+13 11 xxxxx
+
+14 10 yy zzzz
+15 11 yy zzzz
+16 10 yyy zzzz
+17 11 yyy zzzz
+...
+62 10 yyyyyyyyyyyyyyyyyyyyyyyyyy zzzz
+63 11 yyyyyyyyyyyyyyyyyyyyyyyyyy zzzz
+
+where
+ "x ... x" means the sequence of binary symbols encoded with binary tree and
+ "Reverse" scheme. It uses separated binary tree for each posSlot from 4 to 13.
+ "y" means direct bit encoded with range coder.
+ "zzzz" means the sequence of four binary symbols encoded with binary
+ tree with "Reverse" scheme, where one common binary tree "AlignDecoder"
+ is used for all posSlot values.
+
+If (posSlot < 4), the "dist" value is equal to posSlot value.
+
+If (posSlot >= 4), the decoder uses "posSlot" value to calculate the value of
+ the high bits of "dist" value and the number of the low bits.
+
+ If (4 <= posSlot < kEndPosModelIndex), the decoder uses bit tree decoders.
+ (one separated bit tree decoder per one posSlot value) and "Reverse" scheme.
+ In this implementation we use one CProb array "PosDecoders" that contains
+ all CProb variables for all these bit decoders.
+
+ if (posSlot >= kEndPosModelIndex), the middle bits are decoded as direct
+ bits from RangeDecoder and the low 4 bits are decoded with a bit tree
+ decoder "AlignDecoder" with "Reverse" scheme.
+
+The code to decode zero-based match distance:
+
+ unsigned DecodeDistance(unsigned len)
+ {
+ unsigned lenState = len;
+ if (lenState > kNumLenToPosStates - 1)
+ lenState = kNumLenToPosStates - 1;
+
+ unsigned posSlot = PosSlotDecoder[lenState].Decode(&RangeDec);
+ if (posSlot < 4)
+ return posSlot;
+
+ unsigned numDirectBits = (unsigned)((posSlot >> 1) - 1);
+ UInt32 dist = ((2 | (posSlot & 1)) << numDirectBits);
+ if (posSlot < kEndPosModelIndex)
+ dist += BitTreeReverseDecode(PosDecoders + dist - posSlot, numDirectBits, &RangeDec);
+ else
+ {
+ dist += RangeDec.DecodeDirectBits(numDirectBits - kNumAlignBits) << kNumAlignBits;
+ dist += AlignDecoder.ReverseDecode(&RangeDec);
+ }
+ return dist;
+ }
+
+
+
+LZMA Decoding modes
+-------------------
+
+There are 2 types of LZMA streams:
+
+1) The stream with "End of stream" marker.
+2) The stream without "End of stream" marker.
+
+And the LZMA Decoder supports 3 modes of decoding:
+
+1) The unpack size is undefined. The LZMA decoder stops decoding after
+ getting "End of stream" marker.
+ The input variables for that case:
+
+ markerIsMandatory = true
+ unpackSizeDefined = false
+ unpackSize contains any value
+
+2) The unpack size is defined and LZMA decoder supports both variants,
+ where the stream can contain "End of stream" marker or the stream is
+ finished without "End of stream" marker. The LZMA decoder must detect
+ any of these situations.
+ The input variables for that case:
+
+ markerIsMandatory = false
+ unpackSizeDefined = true
+ unpackSize contains unpack size
+
+3) The unpack size is defined and the LZMA stream must contain
+ "End of stream" marker
+ The input variables for that case:
+
+ markerIsMandatory = true
+ unpackSizeDefined = true
+ unpackSize contains unpack size
+
+
+The main loop of decoder
+------------------------
+
+The main loop of LZMA decoder:
+
+Initialize the LZMA state.
+loop
+{
+ // begin of loop
+ Check "end of stream" conditions.
+ Decode Type of MATCH / LITERAL.
+ If it's LITERAL, decode LITERAL value and put the LITERAL to Window.
+ If it's MATCH, decode the length of match and the match distance.
+ Check error conditions, check end of stream conditions and copy
+ the sequence of match bytes from sliding window to current position
+ in window.
+ Go to begin of loop
+}
+
+The reference implementation of LZMA decoder uses "unpackSize" variable
+to keep the number of remaining bytes in output stream. So it reduces
+"unpackSize" value after each decoded LITERAL or MATCH.
+
+The following code contains the "end of stream" condition check at the start
+of the loop:
+
+ if (unpackSizeDefined && unpackSize == 0 && !markerIsMandatory)
+ if (RangeDec.IsFinishedOK())
+ return LZMA_RES_FINISHED_WITHOUT_MARKER;
+
+LZMA uses three types of matches:
+
+1) "Simple Match" - the match with distance value encoded with bit models.
+
+2) "Rep Match" - the match that uses the distance from distance
+ history table.
+
+3) "Short Rep Match" - the match of single byte length, that uses the latest
+ distance from distance history table.
+
+The LZMA decoder keeps the history of latest 4 match distances that were used
+by decoder. That set of 4 variables contains zero-based match distances and
+these variables are initialized with zero values:
+
+ UInt32 rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0;
+
+The LZMA decoder uses binary model variables to select type of MATCH or LITERAL:
+
+#define kNumStates 12
+#define kNumPosBitsMax 4
+
+ CProb IsMatch[kNumStates << kNumPosBitsMax];
+ CProb IsRep[kNumStates];
+ CProb IsRepG0[kNumStates];
+ CProb IsRepG1[kNumStates];
+ CProb IsRepG2[kNumStates];
+ CProb IsRep0Long[kNumStates << kNumPosBitsMax];
+
+The decoder uses "state" variable value to select exact variable
+from "IsRep", "IsRepG0", "IsRepG1" and "IsRepG2" arrays.
+The "state" variable can get the value from 0 to 11.
+Initial value for "state" variable is zero:
+
+ unsigned state = 0;
+
+The "state" variable is updated after each LITERAL or MATCH with one of the
+following functions:
+
+unsigned UpdateState_Literal(unsigned state)
+{
+ if (state < 4) return 0;
+ else if (state < 10) return state - 3;
+ else return state - 6;
+}
+unsigned UpdateState_Match (unsigned state) { return state < 7 ? 7 : 10; }
+unsigned UpdateState_Rep (unsigned state) { return state < 7 ? 8 : 11; }
+unsigned UpdateState_ShortRep(unsigned state) { return state < 7 ? 9 : 11; }
+
+The decoder calculates "state2" variable value to select exact variable from
+"IsMatch" and "IsRep0Long" arrays:
+
+unsigned posState = OutWindow.TotalPos & ((1 << pb) - 1);
+unsigned state2 = (state << kNumPosBitsMax) + posState;
+
+The decoder uses the following code flow scheme to select exact
+type of LITERAL or MATCH:
+
+IsMatch[state2] decode
+ 0 - the Literal
+ 1 - the Match
+ IsRep[state] decode
+ 0 - Simple Match
+ 1 - Rep Match
+ IsRepG0[state] decode
+ 0 - the distance is rep0
+ IsRep0Long[state2] decode
+ 0 - Short Rep Match
+ 1 - Rep Match 0
+ 1 -
+ IsRepG1[state] decode
+ 0 - Rep Match 1
+ 1 -
+ IsRepG2[state] decode
+ 0 - Rep Match 2
+ 1 - Rep Match 3
+
+
+LITERAL symbol
+--------------
+If the value "0" was decoded with IsMatch[state2] decoding, we have "LITERAL" type.
+
+At first the LZMA decoder must check that it doesn't exceed
+specified uncompressed size:
+
+ if (unpackSizeDefined && unpackSize == 0)
+ return LZMA_RES_ERROR;
+
+Then it decodes literal value and puts it to sliding window:
+
+ DecodeLiteral(state, rep0);
+
+Then the decoder must update the "state" value and "unpackSize" value;
+
+ state = UpdateState_Literal(state);
+ unpackSize--;
+
+Then the decoder must go to the begin of main loop to decode next Match or Literal.
+
+
+Simple Match
+------------
+
+If the value "1" was decoded with IsMatch[state2] decoding,
+we have the "Simple Match" type.
+
+The distance history table is updated with the following scheme:
+
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+
+The zero-based length is decoded with "LenDecoder":
+
+ len = LenDecoder.Decode(&RangeDec, posState);
+
+The state is update with UpdateState_Match function:
+
+ state = UpdateState_Match(state);
+
+and the new "rep0" value is decoded with DecodeDistance:
+
+ rep0 = DecodeDistance(len);
+
+That "rep0" will be used as zero-based distance for current match.
+
+If the value of "rep0" is equal to 0xFFFFFFFF, it means that we have
+"End of stream" marker, so we can stop decoding and check finishing
+condition in Range Decoder:
+
+ if (rep0 == 0xFFFFFFFF)
+ return RangeDec.IsFinishedOK() ?
+ LZMA_RES_FINISHED_WITH_MARKER :
+ LZMA_RES_ERROR;
+
+If uncompressed size is defined, LZMA decoder must check that it doesn't
+exceed that specified uncompressed size:
+
+ if (unpackSizeDefined && unpackSize == 0)
+ return LZMA_RES_ERROR;
+
+Also the decoder must check that "rep0" value is not larger than dictionary size
+and is not larger than the number of already decoded bytes:
+
+ if (rep0 >= dictSize || !OutWindow.CheckDistance(rep0))
+ return LZMA_RES_ERROR;
+
+Then the decoder must copy match bytes as described in
+"The match symbols copying" section.
+
+
+Rep Match
+---------
+
+If the LZMA decoder has decoded the value "1" with IsRep[state] variable,
+we have "Rep Match" type.
+
+At first the LZMA decoder must check that it doesn't exceed
+specified uncompressed size:
+
+ if (unpackSizeDefined && unpackSize == 0)
+ return LZMA_RES_ERROR;
+
+Also the decoder must return error, if the LZ window is empty:
+
+ if (OutWindow.IsEmpty())
+ return LZMA_RES_ERROR;
+
+If the match type is "Rep Match", the decoder uses one of the 4 variables of
+distance history table to get the value of distance for current match.
+And there are 4 corresponding ways of decoding flow.
+
+The decoder updates the distance history with the following scheme
+depending from type of match:
+
+- "Rep Match 0" or "Short Rep Match":
+ ; LZMA doesn't update the distance history
+
+- "Rep Match 1":
+ UInt32 dist = rep1;
+ rep1 = rep0;
+ rep0 = dist;
+
+- "Rep Match 2":
+ UInt32 dist = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ rep0 = dist;
+
+- "Rep Match 3":
+ UInt32 dist = rep3;
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ rep0 = dist;
+
+Then the decoder decodes exact subtype of "Rep Match" using "IsRepG0", "IsRep0Long",
+"IsRepG1", "IsRepG2".
+
+If the subtype is "Short Rep Match", the decoder updates the state, puts
+the one byte from window to current position in window and goes to next
+MATCH/LITERAL symbol (the begin of main loop):
+
+ state = UpdateState_ShortRep(state);
+ OutWindow.PutByte(OutWindow.GetByte(rep0 + 1));
+ unpackSize--;
+ continue;
+
+In other cases (Rep Match 0/1/2/3), it decodes the zero-based
+length of match with "RepLenDecoder" decoder:
+
+ len = RepLenDecoder.Decode(&RangeDec, posState);
+
+Then it updates the state:
+
+ state = UpdateState_Rep(state);
+
+Then the decoder must copy match bytes as described in
+"The Match symbols copying" section.
+
+
+The match symbols copying
+-------------------------
+
+If we have the match (Simple Match or Rep Match 0/1/2/3), the decoder must
+copy the sequence of bytes with calculated match distance and match length.
+If uncompressed size is defined, LZMA decoder must check that it doesn't
+exceed that specified uncompressed size:
+
+ len += kMatchMinLen;
+ bool isError = false;
+ if (unpackSizeDefined && unpackSize < len)
+ {
+ len = (unsigned)unpackSize;
+ isError = true;
+ }
+ OutWindow.CopyMatch(rep0 + 1, len);
+ unpackSize -= len;
+ if (isError)
+ return LZMA_RES_ERROR;
+
+Then the decoder must go to the begin of main loop to decode next MATCH or LITERAL.
+
+
+
+NOTES
+-----
+
+This specification doesn't describe the variant of decoder implementation
+that supports partial decoding. Such partial decoding case can require some
+changes in "end of stream" condition checks code. Also such code
+can use additional status codes, returned by decoder.
+
+This specification uses C++ code with templates to simplify describing.
+The optimized version of LZMA decoder doesn't need templates.
+Such optimized version can use just two arrays of CProb variables:
+ 1) The dynamic array of CProb variables allocated for the Literal Decoder.
+ 2) The one common array that contains all other CProb variables.
+
+
+References:
+
+1. G. N. N. Martin, Range encoding: an algorithm for removing redundancy
+ from a digitized message, Video & Data Recording Conference,
+ Southampton, UK, July 24-27, 1979.
diff --git a/other-licenses/7zstub/src/DOC/lzma.txt b/other-licenses/7zstub/src/DOC/lzma.txt
index fc7fae1bca..1f92142ead 100644
--- a/other-licenses/7zstub/src/DOC/lzma.txt
+++ b/other-licenses/7zstub/src/DOC/lzma.txt
@@ -1,630 +1,328 @@
-LZMA SDK 4.40
--------------
+LZMA compression
+----------------
+Version: 9.35
-LZMA SDK Copyright (C) 1999-2006 Igor Pavlov
-
-LZMA SDK provides the documentation, samples, header files, libraries,
-and tools you need to develop applications that use LZMA compression.
-
-LZMA is default and general compression method of 7z format
-in 7-Zip compression program (www.7-zip.org). LZMA provides high
-compression ratio and very fast decompression.
+This file describes LZMA encoding and decoding functions written in C language.
LZMA is an improved version of famous LZ77 compression algorithm.
It was improved in way of maximum increasing of compression ratio,
keeping high decompression speed and low memory requirements for
decompressing.
+Note: you can read also LZMA Specification (lzma-specification.txt from LZMA SDK)
-
-LICENSE
--------
-
-LZMA SDK is available under any of the following licenses:
-
-1) GNU Lesser General Public License (GNU LGPL)
-2) Common Public License (CPL)
-3) Simplified license for unmodified code (read SPECIAL EXCEPTION)
-4) Proprietary license
-
-It means that you can select one of these four options and follow rules of that license.
-
-
-1,2) GNU LGPL and CPL licenses are pretty similar and both these
-licenses are classified as
- - "Free software licenses" at http://www.gnu.org/
- - "OSI-approved" at http://www.opensource.org/
-
-
-3) SPECIAL EXCEPTION
-
-Igor Pavlov, as the author of this code, expressly permits you
-to statically or dynamically link your code (or bind by name)
-to the files from LZMA SDK without subjecting your linked
-code to the terms of the CPL or GNU LGPL.
-Any modifications or additions to files from LZMA SDK, however,
-are subject to the GNU LGPL or CPL terms.
-
-SPECIAL EXCEPTION allows you to use LZMA SDK in applications with closed code,
-while you keep LZMA SDK code unmodified.
-
-
-SPECIAL EXCEPTION #2: Igor Pavlov, as the author of this code, expressly permits
-you to use this code under the same terms and conditions contained in the License
-Agreement you have for any previous version of LZMA SDK developed by Igor Pavlov.
-
-SPECIAL EXCEPTION #2 allows owners of proprietary licenses to use latest version
-of LZMA SDK as update for previous versions.
-
-
-SPECIAL EXCEPTION #3: Igor Pavlov, as the author of this code, expressly permits
-you to use code of the following files:
-BranchTypes.h, LzmaTypes.h, LzmaTest.c, LzmaStateTest.c, LzmaAlone.cpp,
-LzmaAlone.cs, LzmaAlone.java
-as public domain code.
-
-
-4) Proprietary license
-
-LZMA SDK also can be available under a proprietary license which
-can include:
-
-1) Right to modify code without subjecting modified code to the
-terms of the CPL or GNU LGPL
-2) Technical support for code
-
-To request such proprietary license or any additional consultations,
-send email message from that page:
-http://www.7-zip.org/support.html
-
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-You should have received a copy of the Common Public License
-along with this library.
-
-
-LZMA SDK Contents
------------------
-
-LZMA SDK includes:
-
- - C++ source code of LZMA compressing and decompressing
- - ANSI-C compatible source code for LZMA decompressing
- - C# source code for LZMA compressing and decompressing
- - Java source code for LZMA compressing and decompressing
- - Compiled file->file LZMA compressing/decompressing program for Windows system
-
-ANSI-C LZMA decompression code was ported from original C++ sources to C.
-Also it was simplified and optimized for code size.
-But it is fully compatible with LZMA from 7-Zip.
-
-
-UNIX/Linux version
-------------------
-To compile C++ version of file->file LZMA, go to directory
-C/7zip/Compress/LZMA_Alone
-and type "make" or "make clean all" to recompile all.
-
-In some UNIX/Linux versions you must compile LZMA with static libraries.
-To compile with static libraries, change string in makefile
-LIB = -lm
-to string
-LIB = -lm -static
-
-
-Files
----------------------
-C - C / CPP source code
-CS - C# source code
-Java - Java source code
-lzma.txt - LZMA SDK description (this file)
-7zFormat.txt - 7z Format description
-7zC.txt - 7z ANSI-C Decoder description (this file)
-methods.txt - Compression method IDs for .7z
-LGPL.txt - GNU Lesser General Public License
-CPL.html - Common Public License
-lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
-history.txt - history of the LZMA SDK
-
-
-Source code structure
----------------------
-
-C - C / CPP files
- Common - common files for C++ projects
- Windows - common files for Windows related code
- 7zip - files related to 7-Zip Project
- Common - common files for 7-Zip
- Compress - files related to compression/decompression
- LZ - files related to LZ (Lempel-Ziv) compression algorithm
- BinTree - Binary Tree Match Finder for LZ algorithm
- HashChain - Hash Chain Match Finder for LZ algorithm
- Patricia - Patricia Match Finder for LZ algorithm
- RangeCoder - Range Coder (special code of compression/decompression)
- LZMA - LZMA compression/decompression on C++
- LZMA_Alone - file->file LZMA compression/decompression
- LZMA_C - ANSI-C compatible LZMA decompressor
- LzmaDecode.h - interface for LZMA decoding on ANSI-C
- LzmaDecode.c - LZMA decoding on ANSI-C (new fastest version)
- LzmaDecodeSize.c - LZMA decoding on ANSI-C (old size-optimized version)
- LzmaTest.c - test application that decodes LZMA encoded file
- LzmaTypes.h - basic types for LZMA Decoder
- LzmaStateDecode.h - interface for LZMA decoding (State version)
- LzmaStateDecode.c - LZMA decoding on ANSI-C (State version)
- LzmaStateTest.c - test application (State version)
- Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
- Archive - files related to archiving
- 7z_C - 7z ANSI-C Decoder
-
-CS - C# files
- 7zip
- Common - some common files for 7-Zip
- Compress - files related to compression/decompression
- LZ - files related to LZ (Lempel-Ziv) compression algorithm
- LZMA - LZMA compression/decompression
- LzmaAlone - file->file LZMA compression/decompression
- RangeCoder - Range Coder (special code of compression/decompression)
-
-Java - Java files
- SevenZip
- Compression - files related to compression/decompression
- LZ - files related to LZ (Lempel-Ziv) compression algorithm
- LZMA - LZMA compression/decompression
- RangeCoder - Range Coder (special code of compression/decompression)
-
-C/C++ source code of LZMA SDK is part of 7-Zip project.
-
-You can find ANSI-C LZMA decompressing code at folder
- C/7zip/Compress/LZMA_C
-7-Zip doesn't use that ANSI-C LZMA code and that code was developed
-specially for this SDK. And files from LZMA_C do not need files from
-other directories of SDK for compiling.
-
-7-Zip source code can be downloaded from 7-Zip's SourceForge page:
-
- http://sourceforge.net/projects/sevenzip/
-
-
-LZMA features
--------------
- - Variable dictionary size (up to 1 GB)
- - Estimated compressing speed: about 1 MB/s on 1 GHz CPU
- - Estimated decompressing speed:
- - 8-12 MB/s on 1 GHz Intel Pentium 3 or AMD Athlon
- - 500-1000 KB/s on 100 MHz ARM, MIPS, PowerPC or other simple RISC
- - Small memory requirements for decompressing (8-32 KB + DictionarySize)
- - Small code size for decompressing: 2-8 KB (depending from
- speed optimizations)
-
-LZMA decoder uses only integer operations and can be
-implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
-
-Some critical operations that affect to speed of LZMA decompression:
- 1) 32*16 bit integer multiply
- 2) Misspredicted branches (penalty mostly depends from pipeline length)
- 3) 32-bit shift and arithmetic operations
-
-Speed of LZMA decompressing mostly depends from CPU speed.
-Memory speed has no big meaning. But if your CPU has small data cache,
-overall weight of memory speed will slightly increase.
-
-
-How To Use
-----------
-
-Using LZMA encoder/decoder executable
---------------------------------------
-
-Usage: LZMA <e|d> inputFile outputFile [<switches>...]
-
- e: encode file
-
- d: decode file
-
- b: Benchmark. There are two tests: compressing and decompressing
- with LZMA method. Benchmark shows rating in MIPS (million
- instructions per second). Rating value is calculated from
- measured speed and it is normalized with AMD Athlon 64 X2 CPU
- results. Also Benchmark checks possible hardware errors (RAM
- errors in most cases). Benchmark uses these settings:
- (-a1, -d21, -fb32, -mfbt4). You can change only -d. Also you
- can change number of iterations. Example for 30 iterations:
- LZMA b 30
- Default number of iterations is 10.
-
-<Switches>
-
-
- -a{N}: set compression mode 0 = fast, 1 = normal
- default: 1 (normal)
-
- d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
- The maximum value for dictionary size is 1 GB = 2^30 bytes.
- Dictionary size is calculated as DictionarySize = 2^N bytes.
- For decompressing file compressed by LZMA method with dictionary
- size D = 2^N you need about D bytes of memory (RAM).
-
- -fb{N}: set number of fast bytes - [5, 273], default: 128
- Usually big number gives a little bit better compression ratio
- and slower compression process.
-
- -lc{N}: set number of literal context bits - [0, 8], default: 3
- Sometimes lc=4 gives gain for big files.
-
- -lp{N}: set number of literal pos bits - [0, 4], default: 0
- lp switch is intended for periodical data when period is
- equal 2^N. For example, for 32-bit (4 bytes)
- periodical data you can use lp=2. Often it's better to set lc0,
- if you change lp switch.
-
- -pb{N}: set number of pos bits - [0, 4], default: 2
- pb switch is intended for periodical data
- when period is equal 2^N.
-
- -mf{MF_ID}: set Match Finder. Default: bt4.
- Algorithms from hc* group doesn't provide good compression
- ratio, but they often works pretty fast in combination with
- fast mode (-a0).
-
- Memory requirements depend from dictionary size
- (parameter "d" in table below).
-
- MF_ID Memory Description
-
- bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
- bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
- bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
- hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
-
- -eos: write End Of Stream marker. By default LZMA doesn't write
- eos marker, since LZMA decoder knows uncompressed size
- stored in .lzma file header.
-
- -si: Read data from stdin (it will write End Of Stream marker).
- -so: Write data to stdout
-
-
-Examples:
-
-1) LZMA e file.bin file.lzma -d16 -lc0
-
-compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
-and 0 literal context bits. -lc0 allows to reduce memory requirements
-for decompression.
-
-
-2) LZMA e file.bin file.lzma -lc0 -lp2
-
-compresses file.bin to file.lzma with settings suitable
-for 32-bit periodical data (for example, ARM or MIPS code).
-
-3) LZMA d file.lzma file.bin
-
-decompresses file.lzma to file.bin.
-
-
-Compression ratio hints
------------------------
-
-Recommendations
----------------
-
-To increase compression ratio for LZMA compressing it's desirable
-to have aligned data (if it's possible) and also it's desirable to locate
-data in such order, where code is grouped in one place and data is
-grouped in other place (it's better than such mixing: code, data, code,
-data, ...).
-
-
-Using Filters
--------------
-You can increase compression ratio for some data types, using
-special filters before compressing. For example, it's possible to
-increase compression ratio on 5-10% for code for those CPU ISAs:
-x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
-
-You can find C/C++ source code of such filters in folder "7zip/Compress/Branch"
-
-You can check compression ratio gain of these filters with such
-7-Zip commands (example for ARM code):
-No filter:
- 7z a a1.7z a.bin -m0=lzma
-
-With filter for little-endian ARM code:
- 7z a a2.7z a.bin -m0=bc_arm -m1=lzma
-
-With filter for big-endian ARM code (using additional Swap4 filter):
- 7z a a3.7z a.bin -m0=swap4 -m1=bc_arm -m2=lzma
-
-It works in such manner:
-Compressing = Filter_encoding + LZMA_encoding
-Decompressing = LZMA_decoding + Filter_decoding
-
-Compressing and decompressing speed of such filters is very high,
-so it will not increase decompressing time too much.
-Moreover, it reduces decompression time for LZMA_decoding,
-since compression ratio with filtering is higher.
-
-These filters convert CALL (calling procedure) instructions
-from relative offsets to absolute addresses, so such data becomes more
-compressible. Source code of these CALL filters is pretty simple
-(about 20 lines of C++), so you can convert it from C++ version yourself.
-
-For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
+Also you can look source code for LZMA encoding and decoding:
+ C/Util/Lzma/LzmaUtil.c
LZMA compressed file format
---------------------------
Offset Size Description
- 0 1 Special LZMA properties for compressed data
+ 0 1 Special LZMA properties (lc,lp, pb in encoded form)
1 4 Dictionary size (little endian)
5 8 Uncompressed size (little endian). -1 means unknown size
13 Compressed data
+
ANSI-C LZMA Decoder
~~~~~~~~~~~~~~~~~~~
-To compile ANSI-C LZMA Decoder you can use one of the following files sets:
-1) LzmaDecode.h + LzmaDecode.c + LzmaTest.c (fastest version)
-2) LzmaDecode.h + LzmaDecodeSize.c + LzmaTest.c (old size-optimized version)
-3) LzmaStateDecode.h + LzmaStateDecode.c + LzmaStateTest.c (zlib-like interface)
+Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58.
+If you want to use old interfaces you can download previous version of LZMA SDK
+from sourceforge.net site.
+
+To use ANSI-C LZMA Decoder you need the following files:
+1) LzmaDec.h + LzmaDec.c + 7zTypes.h + Precomp.h + Compiler.h
+
+Look example code:
+ C/Util/Lzma/LzmaUtil.c
Memory requirements for LZMA decoding
-------------------------------------
-LZMA decoder doesn't allocate memory itself, so you must
-allocate memory and send it to LZMA.
-
Stack usage of LZMA decoding function for local variables is not
-larger than 200 bytes.
+larger than 200-400 bytes.
+
+LZMA Decoder uses dictionary buffer and internal state structure.
+Internal state structure consumes
+ state_size = (4 + (1.5 << (lc + lp))) KB
+by default (lc=3, lp=0), state_size = 16 KB.
+
How To decompress data
----------------------
-LZMA Decoder (ANSI-C version) now supports 5 interfaces:
+LZMA Decoder (ANSI-C version) now supports 2 interfaces:
1) Single-call Decompressing
-2) Single-call Decompressing with input stream callback
-3) Multi-call Decompressing with output buffer
-4) Multi-call Decompressing with input callback and output buffer
-5) Multi-call State Decompressing (zlib-like interface)
+2) Multi-call State Decompressing (zlib-like interface)
-Variant-5 is similar to Variant-4, but Variant-5 doesn't use callback functions.
+You must use external allocator:
+Example:
+void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
+void SzFree(void *p, void *address) { p = p; free(address); }
+ISzAlloc alloc = { SzAlloc, SzFree };
-Decompressing steps
--------------------
+You can use p = p; operator to disable compiler warnings.
-1) read LZMA properties (5 bytes):
- unsigned char properties[LZMA_PROPERTIES_SIZE];
-2) read uncompressed size (8 bytes, little-endian)
+Single-call Decompressing
+-------------------------
+When to use: RAM->RAM decompressing
+Compile files: LzmaDec.h + LzmaDec.c + 7zTypes.h
+Compile defines: no defines
+Memory Requirements:
+ - Input buffer: compressed size
+ - Output buffer: uncompressed size
+ - LZMA Internal Structures: state_size (16 KB for default settings)
-3) Decode properties:
+Interface:
+ int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
+ const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+ ELzmaStatus *status, ISzAlloc *alloc);
+ In:
+ dest - output data
+ destLen - output data size
+ src - input data
+ srcLen - input data size
+ propData - LZMA properties (5 bytes)
+ propSize - size of propData buffer (5 bytes)
+ finishMode - It has meaning only if the decoding reaches output limit (*destLen).
+ LZMA_FINISH_ANY - Decode just destLen bytes.
+ LZMA_FINISH_END - Stream must be finished after (*destLen).
+ You can use LZMA_FINISH_END, when you know that
+ current output buffer covers last bytes of stream.
+ alloc - Memory allocator.
+
+ Out:
+ destLen - processed output size
+ srcLen - processed input size
+
+ Output:
+ SZ_OK
+ status:
+ LZMA_STATUS_FINISHED_WITH_MARK
+ LZMA_STATUS_NOT_FINISHED
+ LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
+ SZ_ERROR_DATA - Data error
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_UNSUPPORTED - Unsupported properties
+ SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
+
+ If LZMA decoder sees end_marker before reaching output limit, it returns OK result,
+ and output value of destLen will be less than output buffer size limit.
+
+ You can use multiple checks to test data integrity after full decompression:
+ 1) Check Result and "status" variable.
+ 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
+ 3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
+ You must use correct finish mode in that case. */
+
+
+Multi-call State Decompressing (zlib-like interface)
+----------------------------------------------------
- CLzmaDecoderState state; /* it's 24-140 bytes structure, if int is 32-bit */
+When to use: file->file decompressing
+Compile files: LzmaDec.h + LzmaDec.c + 7zTypes.h
- if (LzmaDecodeProperties(&state.Properties, properties, LZMA_PROPERTIES_SIZE) != LZMA_RESULT_OK)
- return PrintError(rs, "Incorrect stream properties");
+Memory Requirements:
+ - Buffer for input stream: any size (for example, 16 KB)
+ - Buffer for output stream: any size (for example, 16 KB)
+ - LZMA Internal Structures: state_size (16 KB for default settings)
+ - LZMA dictionary (dictionary size is encoded in LZMA properties header)
-4) Allocate memory block for internal Structures:
+1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:
+ unsigned char header[LZMA_PROPS_SIZE + 8];
+ ReadFile(inFile, header, sizeof(header)
- state.Probs = (CProb *)malloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb));
- if (state.Probs == 0)
- return PrintError(rs, kCantAllocateMessage);
+2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties
- LZMA decoder uses array of CProb variables as internal structure.
- By default, CProb is unsigned_short. But you can define _LZMA_PROB32 to make
- it unsigned_int. It can increase speed on some 32-bit CPUs, but memory
- usage will be doubled in that case.
+ CLzmaDec state;
+ LzmaDec_Constr(&state);
+ res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc);
+ if (res != SZ_OK)
+ return res;
+3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop
-5) Main Decompressing
+ LzmaDec_Init(&state);
+ for (;;)
+ {
+ ...
+ int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
+ const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
+ ...
+ }
-You must use one of the following interfaces:
-5.1 Single-call Decompressing
------------------------------
-When to use: RAM->RAM decompressing
-Compile files: LzmaDecode.h, LzmaDecode.c
-Compile defines: no defines
-Memory Requirements:
- - Input buffer: compressed size
- - Output buffer: uncompressed size
- - LZMA Internal Structures (~16 KB for default settings)
+4) Free all allocated structures
+ LzmaDec_Free(&state, &g_Alloc);
-Interface:
- int res = LzmaDecode(&state,
- inStream, compressedSize, &inProcessed,
- outStream, outSize, &outProcessed);
+Look example code:
+ C/Util/Lzma/LzmaUtil.c
+
+
+How To compress data
+--------------------
+Compile files:
+ 7zTypes.h
+ Threads.h
+ LzmaEnc.h
+ LzmaEnc.c
+ LzFind.h
+ LzFind.c
+ LzFindMt.h
+ LzFindMt.c
+ LzHash.h
-5.2 Single-call Decompressing with input stream callback
---------------------------------------------------------
-When to use: File->RAM or Flash->RAM decompressing.
-Compile files: LzmaDecode.h, LzmaDecode.c
-Compile defines: _LZMA_IN_CB
Memory Requirements:
- - Buffer for input stream: any size (for example, 16 KB)
- - Output buffer: uncompressed size
- - LZMA Internal Structures (~16 KB for default settings)
+ - (dictSize * 11.5 + 6 MB) + state_size
-Interface:
- typedef struct _CBuffer
- {
- ILzmaInCallback InCallback;
- FILE *File;
- unsigned char Buffer[kInBufferSize];
- } CBuffer;
+Lzma Encoder can use two memory allocators:
+1) alloc - for small arrays.
+2) allocBig - for big arrays.
- int LzmaReadCompressed(void *object, const unsigned char **buffer, SizeT *size)
- {
- CBuffer *bo = (CBuffer *)object;
- *buffer = bo->Buffer;
- *size = MyReadFile(bo->File, bo->Buffer, kInBufferSize);
- return LZMA_RESULT_OK;
- }
+For example, you can use Large RAM Pages (2 MB) in allocBig allocator for
+better compression speed. Note that Windows has bad implementation for
+Large RAM Pages.
+It's OK to use same allocator for alloc and allocBig.
- CBuffer g_InBuffer;
- g_InBuffer.File = inFile;
- g_InBuffer.InCallback.Read = LzmaReadCompressed;
- int res = LzmaDecode(&state,
- &g_InBuffer.InCallback,
- outStream, outSize, &outProcessed);
+Single-call Compression with callbacks
+--------------------------------------
+Look example code:
+ C/Util/Lzma/LzmaUtil.c
-5.3 Multi-call decompressing with output buffer
------------------------------------------------
-When to use: RAM->File decompressing
-Compile files: LzmaDecode.h, LzmaDecode.c
-Compile defines: _LZMA_OUT_READ
-Memory Requirements:
- - Input buffer: compressed size
- - Buffer for output stream: any size (for example, 16 KB)
- - LZMA Internal Structures (~16 KB for default settings)
- - LZMA dictionary (dictionary size is encoded in stream properties)
-
-Interface:
+When to use: file->file compressing
- state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
+1) you must implement callback structures for interfaces:
+ISeqInStream
+ISeqOutStream
+ICompressProgress
+ISzAlloc
- LzmaDecoderInit(&state);
- do
- {
- LzmaDecode(&state,
- inBuffer, inAvail, &inProcessed,
- g_OutBuffer, outAvail, &outProcessed);
- inAvail -= inProcessed;
- inBuffer += inProcessed;
- }
- while you need more bytes
+static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
+static void SzFree(void *p, void *address) { p = p; MyFree(address); }
+static ISzAlloc g_Alloc = { SzAlloc, SzFree };
- see LzmaTest.c for more details.
+ CFileSeqInStream inStream;
+ CFileSeqOutStream outStream;
+ inStream.funcTable.Read = MyRead;
+ inStream.file = inFile;
+ outStream.funcTable.Write = MyWrite;
+ outStream.file = outFile;
-5.4 Multi-call decompressing with input callback and output buffer
-------------------------------------------------------------------
-When to use: File->File decompressing
-Compile files: LzmaDecode.h, LzmaDecode.c
-Compile defines: _LZMA_IN_CB, _LZMA_OUT_READ
-Memory Requirements:
- - Buffer for input stream: any size (for example, 16 KB)
- - Buffer for output stream: any size (for example, 16 KB)
- - LZMA Internal Structures (~16 KB for default settings)
- - LZMA dictionary (dictionary size is encoded in stream properties)
-
-Interface:
- state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
-
- LzmaDecoderInit(&state);
- do
- {
- LzmaDecode(&state,
- &bo.InCallback,
- g_OutBuffer, outAvail, &outProcessed);
- }
- while you need more bytes
+2) Create CLzmaEncHandle object;
- see LzmaTest.c for more details:
+ CLzmaEncHandle enc;
+ enc = LzmaEnc_Create(&g_Alloc);
+ if (enc == 0)
+ return SZ_ERROR_MEM;
-5.5 Multi-call State Decompressing (zlib-like interface)
-------------------------------------------------------------------
-When to use: file->file decompressing
-Compile files: LzmaStateDecode.h, LzmaStateDecode.c
-Compile defines:
-Memory Requirements:
- - Buffer for input stream: any size (for example, 16 KB)
- - Buffer for output stream: any size (for example, 16 KB)
- - LZMA Internal Structures (~16 KB for default settings)
- - LZMA dictionary (dictionary size is encoded in stream properties)
-
-Interface:
- state.Dictionary = (unsigned char *)malloc(state.Properties.DictionarySize);
+3) initialize CLzmaEncProps properties;
-
- LzmaDecoderInit(&state);
- do
- {
- res = LzmaDecode(&state,
- inBuffer, inAvail, &inProcessed,
- g_OutBuffer, outAvail, &outProcessed,
- finishDecoding);
- inAvail -= inProcessed;
- inBuffer += inProcessed;
- }
- while you need more bytes
+ LzmaEncProps_Init(&props);
+
+ Then you can change some properties in that structure.
- see LzmaStateTest.c for more details:
+4) Send LZMA properties to LZMA Encoder
+ res = LzmaEnc_SetProps(enc, &props);
-6) Free all allocated blocks
+5) Write encoded properties to header
+ Byte header[LZMA_PROPS_SIZE + 8];
+ size_t headerSize = LZMA_PROPS_SIZE;
+ UInt64 fileSize;
+ int i;
-Note
-----
-LzmaDecodeSize.c is size-optimized version of LzmaDecode.c.
-But compiled code of LzmaDecodeSize.c can be larger than
-compiled code of LzmaDecode.c. So it's better to use
-LzmaDecode.c in most cases.
+ res = LzmaEnc_WriteProperties(enc, header, &headerSize);
+ fileSize = MyGetFileLength(inFile);
+ for (i = 0; i < 8; i++)
+ header[headerSize++] = (Byte)(fileSize >> (8 * i));
+ MyWriteFileAndCheck(outFile, header, headerSize)
+6) Call encoding function:
+ res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable,
+ NULL, &g_Alloc, &g_Alloc);
-EXIT codes
------------
+7) Destroy LZMA Encoder Object
+ LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
-LZMA decoder can return one of the following codes:
-#define LZMA_RESULT_OK 0
-#define LZMA_RESULT_DATA_ERROR 1
+If callback function return some error code, LzmaEnc_Encode also returns that code
+or it can return the code like SZ_ERROR_READ, SZ_ERROR_WRITE or SZ_ERROR_PROGRESS.
-If you use callback function for input data and you return some
-error code, LZMA Decoder also returns that code.
+Single-call RAM->RAM Compression
+--------------------------------
+Single-call RAM->RAM Compression is similar to Compression with callbacks,
+but you provide pointers to buffers instead of pointers to stream callbacks:
-LZMA Defines
-------------
+SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
+ const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
+ ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
-_LZMA_IN_CB - Use callback for input data
+Return code:
+ SZ_OK - OK
+ SZ_ERROR_MEM - Memory allocation error
+ SZ_ERROR_PARAM - Incorrect paramater
+ SZ_ERROR_OUTPUT_EOF - output buffer overflow
+ SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
-_LZMA_OUT_READ - Use read function for output data
-_LZMA_LOC_OPT - Enable local speed optimizations inside code.
- _LZMA_LOC_OPT is only for LzmaDecodeSize.c (size-optimized version).
- _LZMA_LOC_OPT doesn't affect LzmaDecode.c (speed-optimized version)
- and LzmaStateDecode.c
-_LZMA_PROB32 - It can increase speed on some 32-bit CPUs,
- but memory usage will be doubled in that case
+Defines
+-------
+
+_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
-_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler
- and long is 32-bit.
+_LZMA_PROB32 - It can increase the speed on some 32-bit CPUs, but memory usage for
+ some structures will be doubled in that case.
-_LZMA_SYSTEM_SIZE_T - Define it if you want to use system's size_t.
- You can use it to enable 64-bit sizes supporting
+_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is 32-bit.
+_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type.
+
+
+_7ZIP_PPMD_SUPPPORT - Define it if you don't want to support PPMD method in AMSI-C .7z decoder.
C++ LZMA Encoder/Decoder
~~~~~~~~~~~~~~~~~~~~~~~~
C++ LZMA code use COM-like interfaces. So if you want to use it,
you can study basics of COM/OLE.
+C++ LZMA code is just wrapper over ANSI-C code.
-By default, LZMA Encoder contains all Match Finders.
-But for compressing it's enough to have just one of them.
-So for reducing size of compressing code you can define:
- #define COMPRESS_MF_BT
- #define COMPRESS_MF_BT4
-and it will use only bt4 match finder.
+C++ Notes
+~~~~~~~~~~~~~~~~~~~~~~~~
+If you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling),
+you must check that you correctly work with "new" operator.
+7-Zip can be compiled with MSVC 6.0 that doesn't throw "exception" from "new" operator.
+So 7-Zip uses "CPP\Common\NewHandler.cpp" that redefines "new" operator:
+operator new(size_t size)
+{
+ void *p = ::malloc(size);
+ if (p == 0)
+ throw CNewException();
+ return p;
+}
+If you use MSCV that throws exception for "new" operator, you can compile without
+"NewHandler.cpp". So standard exception will be used. Actually some code of
+7-Zip catches any exception in internal code and converts it to HRESULT code.
+So you don't need to catch CNewException, if you call COM interfaces of 7-Zip.
---
http://www.7-zip.org
+http://www.7-zip.org/sdk.html
http://www.7-zip.org/support.html
diff --git a/other-licenses/7zstub/src/DOC/readme.txt b/other-licenses/7zstub/src/DOC/readme.txt
deleted file mode 100644
index d12260367c..0000000000
--- a/other-licenses/7zstub/src/DOC/readme.txt
+++ /dev/null
@@ -1,226 +0,0 @@
-7-Zip 4.42 Sources
-------------------
-
-7-Zip is a file archiver for Windows 95/98/ME/NT/2000/2003/XP.
-
-7-Zip Copyright (C) 1999-2006 Igor Pavlov.
-
-
-License Info
-------------
-
-Most of 7-Zip source code is under GNU LGPL.
-
-Files in folders
- 7zip/Compress/Rar20
- 7zip/Compress/Rar29
- 7zip/Compress/Rar29/Original
-are licensed under "unRAR license + GNU LGPL" license.
-Source code files in all other folders of this package are under GNU LGPL.
-
-"unRAR license + GNU LGPL" means that you must follow
-GNU LGPL in all aspects while it is in agreement
-with unRAR license. But you can not break unRAR license rules.
-It means that unRAR license is main license in that pair.
-
-You can find unRAR license in file unrarLicense.txt
-You can find GNU LGPL license in file copying.txt
-
-
-GNU LGPL information:
----------------------
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-unRAR license + GNU LGPL Notes
-------------------------------
-
-Please check main restriction from unRar license:
-
- 2. The unRAR sources may be used in any software to handle RAR
- archives without limitations free of charge, but cannot be used
- to re-create the RAR compression algorithm, which is proprietary.
- Distribution of modified unRAR sources in separate form or as a
- part of other software is permitted, provided that it is clearly
- stated in the documentation and source comments that the code may
- not be used to develop a RAR (WinRAR) compatible archiver.
-
-In brief it means:
-1) You can compile and use compiled files under GNU LGPL rules, since
- unRAR license almost has no restrictions for compiled files.
- You can link these compiled files to LGPL programs.
-2) You can fix bugs in source code and use compiled fixed version.
-3) You can not use unRAR sources to re-create the RAR compression algorithm.
-
-
-7zip\Compress\Rar29\Original folder contains files that are modified
-versions of original unRAR source code files.
-
-
-License notes
--------------
-
-You can support development of 7-Zip by registering.
-
-7-Zip is free software distributed under the GNU LGPL.
-If you need license with other conditions, write to
-http://www.7-zip.org/support.html
-
----
-Also this package contains files from LZMA SDK
-you can download LZMA SDK from this page:
-http://www.7-zip.org/sdk.html
-read about addtional licenses for LZMA SDK in file
-DOC/lzma.txt
-
-
-How to compile
---------------
-To compile sources you need Visual C++ 6.0.
-For compiling some files you also need
-new Platform SDK from Microsoft' Site:
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm
-or
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/XPSP2FULLInstall.htm
-or
-http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
-
-If you use MSVC6, specify SDK directories at top of directories lists:
-Tools / Options / Directories
- - Include files
- - Library files
-
-
-To compile 7-Zip for AMD64 and IA64 you need:
- Windows Server 2003 SP1 Platform SDK from microsoft.com
-
-
-
-Compiling under Unix/Linux
---------------------------
-Check this site for Posix/Linux version:
-http://sourceforge.net/projects/p7zip/
-
-
-Notes:
-------
-7-Zip consists of COM modules (DLL files).
-But 7-Zip doesn't use standard COM interfaces for creating objects.
-Look at
-7zip\UI\Client7z folder for example of using DLL files of 7-Zip.
-Some DLL files can use other DLL files from 7-Zip.
-If you don't like it, you must use standalone version of DLL.
-To compile standalone version of DLL you must include all used parts
-to project and define some defs.
-For example, 7zip\Bundles\Format7z is a standalone version of 7z.dll
-that works with 7z format. So you can use such DLL in your project
-without additional DLL files.
-
-
-Description of 7-Zip sources package
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-DOC Documentation
----
- 7zFormat.txt - 7z format description
- copying.txt - GNU LGPL license
- unRarLicense.txt - License for unRAR part of source code
- history.txt - Sources history
- Methods.txt - Compression method IDs
- readme.txt - Readme file
- lzma.txt - LZMA SDK description
- 7zip.nsi - installer script for NSIS
-
-
-Common Common modules
-Windows Win32 wrappers
-
-7zip
--------
- Common Common modules for 7-zip
-
- Archive 7-Zip Archive Format Plugins
- --------
- Common
- 7z
- Arj
- BZip2
- Cab
- Cpio
- GZip
- Rar
- Rpm
- Split
- Tar
- Zip
-
- Bundle Modules that are bundles of other modules
- ------
- Alone 7za.exe: Standalone version of 7z
- Alone7z 7zr.exe: Standalone version of 7z that supports only 7z/LZMA/BCJ/BCJ2
- SFXCon 7zCon.sfx: Console 7z SFX module
- SFXWin 7z.sfx: Windows 7z SFX module
- SFXSetup 7zS.sfx: Windows 7z SFX module for Installers
- Format7z 7za.dll: Standalone version of 7z.dll
-
- UI
- --
- Agent Intermediary modules for FAR plugin and Explorer plugin
- Console 7z.exe Console version
- Explorer Explorer plugin
- Resource Resources
- Far FAR plugin
- Client7z Test application for 7za.dll
-
- Compress
- --------
- BZip2 BZip2 compressor
- Original Download BZip2 compression sources from
- http://sources.redhat.com/bzip2/index.html
- to that folder.
- Branch Branch converter
- ByteSwap Byte Swap converter
- Copy Copy coder
- Deflate
- Implode
- Arj
- LZMA
- PPMd Dmitry Shkarin's PPMdH with small changes.
- LZ Lempel - Ziv
- MT Multi Thread Match finder
- BinTree Match Finder based on Binary Tree
- Patricia Match Finder based on Patricia algoritm
- HashChain Match Finder based on Hash Chains
-
- Crypto Crypto modules
- ------
- 7zAES Cipher for 7z
- AES AES Cipher
- Rar20 Cipher for Rar 2.0
- RarAES Cipher for Rar 3.0
- Zip Cipher for Zip
-
- FileManager File Manager
-
-
----
-Igor Pavlov
-http://www.7-zip.org
-
-
----
-End of document
-
diff --git a/other-licenses/7zstub/src/Java/SevenZip/CRC.java b/other-licenses/7zstub/src/Java/SevenZip/CRC.java
new file mode 100644
index 0000000000..f2f791f17a
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/CRC.java
@@ -0,0 +1,52 @@
+// SevenZip/CRC.java
+
+package SevenZip;
+
+public class CRC
+{
+ static public int[] Table = new int[256];
+
+ static
+ {
+ for (int i = 0; i < 256; i++)
+ {
+ int r = i;
+ for (int j = 0; j < 8; j++)
+ if ((r & 1) != 0)
+ r = (r >>> 1) ^ 0xEDB88320;
+ else
+ r >>>= 1;
+ Table[i] = r;
+ }
+ }
+
+ int _value = -1;
+
+ public void Init()
+ {
+ _value = -1;
+ }
+
+ public void Update(byte[] data, int offset, int size)
+ {
+ for (int i = 0; i < size; i++)
+ _value = Table[(_value ^ data[offset + i]) & 0xFF] ^ (_value >>> 8);
+ }
+
+ public void Update(byte[] data)
+ {
+ int size = data.length;
+ for (int i = 0; i < size; i++)
+ _value = Table[(_value ^ data[i]) & 0xFF] ^ (_value >>> 8);
+ }
+
+ public void UpdateByte(int b)
+ {
+ _value = Table[(_value ^ b) & 0xFF] ^ (_value >>> 8);
+ }
+
+ public int GetDigest()
+ {
+ return _value ^ (-1);
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/BinTree.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/BinTree.java
new file mode 100644
index 0000000000..63d58c05a0
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/BinTree.java
@@ -0,0 +1,382 @@
+// LZ.BinTree
+
+package SevenZip.Compression.LZ;
+import java.io.IOException;
+
+
+public class BinTree extends InWindow
+{
+ int _cyclicBufferPos;
+ int _cyclicBufferSize = 0;
+ int _matchMaxLen;
+
+ int[] _son;
+ int[] _hash;
+
+ int _cutValue = 0xFF;
+ int _hashMask;
+ int _hashSizeSum = 0;
+
+ boolean HASH_ARRAY = true;
+
+ static final int kHash2Size = 1 << 10;
+ static final int kHash3Size = 1 << 16;
+ static final int kBT2HashSize = 1 << 16;
+ static final int kStartMaxLen = 1;
+ static final int kHash3Offset = kHash2Size;
+ static final int kEmptyHashValue = 0;
+ static final int kMaxValForNormalize = (1 << 30) - 1;
+
+ int kNumHashDirectBytes = 0;
+ int kMinMatchCheck = 4;
+ int kFixHashSize = kHash2Size + kHash3Size;
+
+ public void SetType(int numHashBytes)
+ {
+ HASH_ARRAY = (numHashBytes > 2);
+ if (HASH_ARRAY)
+ {
+ kNumHashDirectBytes = 0;
+ kMinMatchCheck = 4;
+ kFixHashSize = kHash2Size + kHash3Size;
+ }
+ else
+ {
+ kNumHashDirectBytes = 2;
+ kMinMatchCheck = 2 + 1;
+ kFixHashSize = 0;
+ }
+ }
+
+
+
+
+ public void Init() throws IOException
+ {
+ super.Init();
+ for (int i = 0; i < _hashSizeSum; i++)
+ _hash[i] = kEmptyHashValue;
+ _cyclicBufferPos = 0;
+ ReduceOffsets(-1);
+ }
+
+ public void MovePos() throws IOException
+ {
+ if (++_cyclicBufferPos >= _cyclicBufferSize)
+ _cyclicBufferPos = 0;
+ super.MovePos();
+ if (_pos == kMaxValForNormalize)
+ Normalize();
+ }
+
+
+
+
+
+
+
+
+ public boolean Create(int historySize, int keepAddBufferBefore,
+ int matchMaxLen, int keepAddBufferAfter)
+ {
+ if (historySize > kMaxValForNormalize - 256)
+ return false;
+ _cutValue = 16 + (matchMaxLen >> 1);
+
+ int windowReservSize = (historySize + keepAddBufferBefore +
+ matchMaxLen + keepAddBufferAfter) / 2 + 256;
+
+ super.Create(historySize + keepAddBufferBefore, matchMaxLen + keepAddBufferAfter, windowReservSize);
+
+ _matchMaxLen = matchMaxLen;
+
+ int cyclicBufferSize = historySize + 1;
+ if (_cyclicBufferSize != cyclicBufferSize)
+ _son = new int[(_cyclicBufferSize = cyclicBufferSize) * 2];
+
+ int hs = kBT2HashSize;
+
+ if (HASH_ARRAY)
+ {
+ hs = historySize - 1;
+ hs |= (hs >> 1);
+ hs |= (hs >> 2);
+ hs |= (hs >> 4);
+ hs |= (hs >> 8);
+ hs >>= 1;
+ hs |= 0xFFFF;
+ if (hs > (1 << 24))
+ hs >>= 1;
+ _hashMask = hs;
+ hs++;
+ hs += kFixHashSize;
+ }
+ if (hs != _hashSizeSum)
+ _hash = new int [_hashSizeSum = hs];
+ return true;
+ }
+ public int GetMatches(int[] distances) throws IOException
+ {
+ int lenLimit;
+ if (_pos + _matchMaxLen <= _streamPos)
+ lenLimit = _matchMaxLen;
+ else
+ {
+ lenLimit = _streamPos - _pos;
+ if (lenLimit < kMinMatchCheck)
+ {
+ MovePos();
+ return 0;
+ }
+ }
+
+ int offset = 0;
+ int matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
+ int cur = _bufferOffset + _pos;
+ int maxLen = kStartMaxLen; // to avoid items for len < hashSize;
+ int hashValue, hash2Value = 0, hash3Value = 0;
+
+ if (HASH_ARRAY)
+ {
+ int temp = CrcTable[_bufferBase[cur] & 0xFF] ^ (_bufferBase[cur + 1] & 0xFF);
+ hash2Value = temp & (kHash2Size - 1);
+ temp ^= ((int)(_bufferBase[cur + 2] & 0xFF) << 8);
+ hash3Value = temp & (kHash3Size - 1);
+ hashValue = (temp ^ (CrcTable[_bufferBase[cur + 3] & 0xFF] << 5)) & _hashMask;
+ }
+ else
+ hashValue = ((_bufferBase[cur] & 0xFF) ^ ((int)(_bufferBase[cur + 1] & 0xFF) << 8));
+
+ int curMatch = _hash[kFixHashSize + hashValue];
+ if (HASH_ARRAY)
+ {
+ int curMatch2 = _hash[hash2Value];
+ int curMatch3 = _hash[kHash3Offset + hash3Value];
+ _hash[hash2Value] = _pos;
+ _hash[kHash3Offset + hash3Value] = _pos;
+ if (curMatch2 > matchMinPos)
+ if (_bufferBase[_bufferOffset + curMatch2] == _bufferBase[cur])
+ {
+ distances[offset++] = maxLen = 2;
+ distances[offset++] = _pos - curMatch2 - 1;
+ }
+ if (curMatch3 > matchMinPos)
+ if (_bufferBase[_bufferOffset + curMatch3] == _bufferBase[cur])
+ {
+ if (curMatch3 == curMatch2)
+ offset -= 2;
+ distances[offset++] = maxLen = 3;
+ distances[offset++] = _pos - curMatch3 - 1;
+ curMatch2 = curMatch3;
+ }
+ if (offset != 0 && curMatch2 == curMatch)
+ {
+ offset -= 2;
+ maxLen = kStartMaxLen;
+ }
+ }
+
+ _hash[kFixHashSize + hashValue] = _pos;
+
+ int ptr0 = (_cyclicBufferPos << 1) + 1;
+ int ptr1 = (_cyclicBufferPos << 1);
+
+ int len0, len1;
+ len0 = len1 = kNumHashDirectBytes;
+
+ if (kNumHashDirectBytes != 0)
+ {
+ if (curMatch > matchMinPos)
+ {
+ if (_bufferBase[_bufferOffset + curMatch + kNumHashDirectBytes] !=
+ _bufferBase[cur + kNumHashDirectBytes])
+ {
+ distances[offset++] = maxLen = kNumHashDirectBytes;
+ distances[offset++] = _pos - curMatch - 1;
+ }
+ }
+ }
+
+ int count = _cutValue;
+
+ while (true)
+ {
+ if (curMatch <= matchMinPos || count-- == 0)
+ {
+ _son[ptr0] = _son[ptr1] = kEmptyHashValue;
+ break;
+ }
+ int delta = _pos - curMatch;
+ int cyclicPos = ((delta <= _cyclicBufferPos) ?
+ (_cyclicBufferPos - delta) :
+ (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
+
+ int pby1 = _bufferOffset + curMatch;
+ int len = Math.min(len0, len1);
+ if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
+ {
+ while(++len != lenLimit)
+ if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
+ break;
+ if (maxLen < len)
+ {
+ distances[offset++] = maxLen = len;
+ distances[offset++] = delta - 1;
+ if (len == lenLimit)
+ {
+ _son[ptr1] = _son[cyclicPos];
+ _son[ptr0] = _son[cyclicPos + 1];
+ break;
+ }
+ }
+ }
+ if ((_bufferBase[pby1 + len] & 0xFF) < (_bufferBase[cur + len] & 0xFF))
+ {
+ _son[ptr1] = curMatch;
+ ptr1 = cyclicPos + 1;
+ curMatch = _son[ptr1];
+ len1 = len;
+ }
+ else
+ {
+ _son[ptr0] = curMatch;
+ ptr0 = cyclicPos;
+ curMatch = _son[ptr0];
+ len0 = len;
+ }
+ }
+ MovePos();
+ return offset;
+ }
+
+ public void Skip(int num) throws IOException
+ {
+ do
+ {
+ int lenLimit;
+ if (_pos + _matchMaxLen <= _streamPos)
+ lenLimit = _matchMaxLen;
+ else
+ {
+ lenLimit = _streamPos - _pos;
+ if (lenLimit < kMinMatchCheck)
+ {
+ MovePos();
+ continue;
+ }
+ }
+
+ int matchMinPos = (_pos > _cyclicBufferSize) ? (_pos - _cyclicBufferSize) : 0;
+ int cur = _bufferOffset + _pos;
+
+ int hashValue;
+
+ if (HASH_ARRAY)
+ {
+ int temp = CrcTable[_bufferBase[cur] & 0xFF] ^ (_bufferBase[cur + 1] & 0xFF);
+ int hash2Value = temp & (kHash2Size - 1);
+ _hash[hash2Value] = _pos;
+ temp ^= ((int)(_bufferBase[cur + 2] & 0xFF) << 8);
+ int hash3Value = temp & (kHash3Size - 1);
+ _hash[kHash3Offset + hash3Value] = _pos;
+ hashValue = (temp ^ (CrcTable[_bufferBase[cur + 3] & 0xFF] << 5)) & _hashMask;
+ }
+ else
+ hashValue = ((_bufferBase[cur] & 0xFF) ^ ((int)(_bufferBase[cur + 1] & 0xFF) << 8));
+
+ int curMatch = _hash[kFixHashSize + hashValue];
+ _hash[kFixHashSize + hashValue] = _pos;
+
+ int ptr0 = (_cyclicBufferPos << 1) + 1;
+ int ptr1 = (_cyclicBufferPos << 1);
+
+ int len0, len1;
+ len0 = len1 = kNumHashDirectBytes;
+
+ int count = _cutValue;
+ while (true)
+ {
+ if (curMatch <= matchMinPos || count-- == 0)
+ {
+ _son[ptr0] = _son[ptr1] = kEmptyHashValue;
+ break;
+ }
+
+ int delta = _pos - curMatch;
+ int cyclicPos = ((delta <= _cyclicBufferPos) ?
+ (_cyclicBufferPos - delta) :
+ (_cyclicBufferPos - delta + _cyclicBufferSize)) << 1;
+
+ int pby1 = _bufferOffset + curMatch;
+ int len = Math.min(len0, len1);
+ if (_bufferBase[pby1 + len] == _bufferBase[cur + len])
+ {
+ while (++len != lenLimit)
+ if (_bufferBase[pby1 + len] != _bufferBase[cur + len])
+ break;
+ if (len == lenLimit)
+ {
+ _son[ptr1] = _son[cyclicPos];
+ _son[ptr0] = _son[cyclicPos + 1];
+ break;
+ }
+ }
+ if ((_bufferBase[pby1 + len] & 0xFF) < (_bufferBase[cur + len] & 0xFF))
+ {
+ _son[ptr1] = curMatch;
+ ptr1 = cyclicPos + 1;
+ curMatch = _son[ptr1];
+ len1 = len;
+ }
+ else
+ {
+ _son[ptr0] = curMatch;
+ ptr0 = cyclicPos;
+ curMatch = _son[ptr0];
+ len0 = len;
+ }
+ }
+ MovePos();
+ }
+ while (--num != 0);
+ }
+
+ void NormalizeLinks(int[] items, int numItems, int subValue)
+ {
+ for (int i = 0; i < numItems; i++)
+ {
+ int value = items[i];
+ if (value <= subValue)
+ value = kEmptyHashValue;
+ else
+ value -= subValue;
+ items[i] = value;
+ }
+ }
+
+ void Normalize()
+ {
+ int subValue = _pos - _cyclicBufferSize;
+ NormalizeLinks(_son, _cyclicBufferSize * 2, subValue);
+ NormalizeLinks(_hash, _hashSizeSum, subValue);
+ ReduceOffsets(subValue);
+ }
+
+ public void SetCutValue(int cutValue) { _cutValue = cutValue; }
+
+ private static final int[] CrcTable = new int[256];
+
+ static
+ {
+ for (int i = 0; i < 256; i++)
+ {
+ int r = i;
+ for (int j = 0; j < 8; j++)
+ if ((r & 1) != 0)
+ r = (r >>> 1) ^ 0xEDB88320;
+ else
+ r >>>= 1;
+ CrcTable[i] = r;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/InWindow.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/InWindow.java
new file mode 100644
index 0000000000..5f3f0b4d09
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/InWindow.java
@@ -0,0 +1,131 @@
+// LZ.InWindow
+
+package SevenZip.Compression.LZ;
+
+import java.io.IOException;
+
+public class InWindow
+{
+ public byte[] _bufferBase; // pointer to buffer with data
+ java.io.InputStream _stream;
+ int _posLimit; // offset (from _buffer) of first byte when new block reading must be done
+ boolean _streamEndWasReached; // if (true) then _streamPos shows real end of stream
+
+ int _pointerToLastSafePosition;
+
+ public int _bufferOffset;
+
+ public int _blockSize; // Size of Allocated memory block
+ public int _pos; // offset (from _buffer) of curent byte
+ int _keepSizeBefore; // how many BYTEs must be kept in buffer before _pos
+ int _keepSizeAfter; // how many BYTEs must be kept buffer after _pos
+ public int _streamPos; // offset (from _buffer) of first not read byte from Stream
+
+ public void MoveBlock()
+ {
+ int offset = _bufferOffset + _pos - _keepSizeBefore;
+ // we need one additional byte, since MovePos moves on 1 byte.
+ if (offset > 0)
+ offset--;
+
+ int numBytes = _bufferOffset + _streamPos - offset;
+
+ // check negative offset ????
+ for (int i = 0; i < numBytes; i++)
+ _bufferBase[i] = _bufferBase[offset + i];
+ _bufferOffset -= offset;
+ }
+
+ public void ReadBlock() throws IOException
+ {
+ if (_streamEndWasReached)
+ return;
+ while (true)
+ {
+ int size = (0 - _bufferOffset) + _blockSize - _streamPos;
+ if (size == 0)
+ return;
+ int numReadBytes = _stream.read(_bufferBase, _bufferOffset + _streamPos, size);
+ if (numReadBytes == -1)
+ {
+ _posLimit = _streamPos;
+ int pointerToPostion = _bufferOffset + _posLimit;
+ if (pointerToPostion > _pointerToLastSafePosition)
+ _posLimit = _pointerToLastSafePosition - _bufferOffset;
+
+ _streamEndWasReached = true;
+ return;
+ }
+ _streamPos += numReadBytes;
+ if (_streamPos >= _pos + _keepSizeAfter)
+ _posLimit = _streamPos - _keepSizeAfter;
+ }
+ }
+
+ void Free() { _bufferBase = null; }
+
+ public void Create(int keepSizeBefore, int keepSizeAfter, int keepSizeReserv)
+ {
+ _keepSizeBefore = keepSizeBefore;
+ _keepSizeAfter = keepSizeAfter;
+ int blockSize = keepSizeBefore + keepSizeAfter + keepSizeReserv;
+ if (_bufferBase == null || _blockSize != blockSize)
+ {
+ Free();
+ _blockSize = blockSize;
+ _bufferBase = new byte[_blockSize];
+ }
+ _pointerToLastSafePosition = _blockSize - keepSizeAfter;
+ }
+
+ public void SetStream(java.io.InputStream stream) { _stream = stream; }
+ public void ReleaseStream() { _stream = null; }
+
+ public void Init() throws IOException
+ {
+ _bufferOffset = 0;
+ _pos = 0;
+ _streamPos = 0;
+ _streamEndWasReached = false;
+ ReadBlock();
+ }
+
+ public void MovePos() throws IOException
+ {
+ _pos++;
+ if (_pos > _posLimit)
+ {
+ int pointerToPostion = _bufferOffset + _pos;
+ if (pointerToPostion > _pointerToLastSafePosition)
+ MoveBlock();
+ ReadBlock();
+ }
+ }
+
+ public byte GetIndexByte(int index) { return _bufferBase[_bufferOffset + _pos + index]; }
+
+ // index + limit have not to exceed _keepSizeAfter;
+ public int GetMatchLen(int index, int distance, int limit)
+ {
+ if (_streamEndWasReached)
+ if ((_pos + index) + limit > _streamPos)
+ limit = _streamPos - (_pos + index);
+ distance++;
+ // Byte *pby = _buffer + (size_t)_pos + index;
+ int pby = _bufferOffset + _pos + index;
+
+ int i;
+ for (i = 0; i < limit && _bufferBase[pby + i] == _bufferBase[pby + i - distance]; i++);
+ return i;
+ }
+
+ public int GetNumAvailableBytes() { return _streamPos - _pos; }
+
+ public void ReduceOffsets(int subValue)
+ {
+ _bufferOffset += subValue;
+ _posLimit -= subValue;
+ _pos -= subValue;
+ _streamPos -= subValue;
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/OutWindow.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/OutWindow.java
new file mode 100644
index 0000000000..620cb41b47
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZ/OutWindow.java
@@ -0,0 +1,85 @@
+// LZ.OutWindow
+
+package SevenZip.Compression.LZ;
+
+import java.io.IOException;
+
+public class OutWindow
+{
+ byte[] _buffer;
+ int _pos;
+ int _windowSize = 0;
+ int _streamPos;
+ java.io.OutputStream _stream;
+
+ public void Create(int windowSize)
+ {
+ if (_buffer == null || _windowSize != windowSize)
+ _buffer = new byte[windowSize];
+ _windowSize = windowSize;
+ _pos = 0;
+ _streamPos = 0;
+ }
+
+ public void SetStream(java.io.OutputStream stream) throws IOException
+ {
+ ReleaseStream();
+ _stream = stream;
+ }
+
+ public void ReleaseStream() throws IOException
+ {
+ Flush();
+ _stream = null;
+ }
+
+ public void Init(boolean solid)
+ {
+ if (!solid)
+ {
+ _streamPos = 0;
+ _pos = 0;
+ }
+ }
+
+ public void Flush() throws IOException
+ {
+ int size = _pos - _streamPos;
+ if (size == 0)
+ return;
+ _stream.write(_buffer, _streamPos, size);
+ if (_pos >= _windowSize)
+ _pos = 0;
+ _streamPos = _pos;
+ }
+
+ public void CopyBlock(int distance, int len) throws IOException
+ {
+ int pos = _pos - distance - 1;
+ if (pos < 0)
+ pos += _windowSize;
+ for (; len != 0; len--)
+ {
+ if (pos >= _windowSize)
+ pos = 0;
+ _buffer[_pos++] = _buffer[pos++];
+ if (_pos >= _windowSize)
+ Flush();
+ }
+ }
+
+ public void PutByte(byte b) throws IOException
+ {
+ _buffer[_pos++] = b;
+ if (_pos >= _windowSize)
+ Flush();
+ }
+
+ public byte GetByte(int distance)
+ {
+ int pos = _pos - distance - 1;
+ if (pos < 0)
+ pos += _windowSize;
+ return _buffer[pos];
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Base.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Base.java
new file mode 100644
index 0000000000..18deed9232
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Base.java
@@ -0,0 +1,88 @@
+// Base.java
+
+package SevenZip.Compression.LZMA;
+
+public class Base
+{
+ public static final int kNumRepDistances = 4;
+ public static final int kNumStates = 12;
+
+ public static final int StateInit()
+ {
+ return 0;
+ }
+
+ public static final int StateUpdateChar(int index)
+ {
+ if (index < 4)
+ return 0;
+ if (index < 10)
+ return index - 3;
+ return index - 6;
+ }
+
+ public static final int StateUpdateMatch(int index)
+ {
+ return (index < 7 ? 7 : 10);
+ }
+
+ public static final int StateUpdateRep(int index)
+ {
+ return (index < 7 ? 8 : 11);
+ }
+
+ public static final int StateUpdateShortRep(int index)
+ {
+ return (index < 7 ? 9 : 11);
+ }
+
+ public static final boolean StateIsCharState(int index)
+ {
+ return index < 7;
+ }
+
+ public static final int kNumPosSlotBits = 6;
+ public static final int kDicLogSizeMin = 0;
+ // public static final int kDicLogSizeMax = 28;
+ // public static final int kDistTableSizeMax = kDicLogSizeMax * 2;
+
+ public static final int kNumLenToPosStatesBits = 2; // it's for speed optimization
+ public static final int kNumLenToPosStates = 1 << kNumLenToPosStatesBits;
+
+ public static final int kMatchMinLen = 2;
+
+ public static final int GetLenToPosState(int len)
+ {
+ len -= kMatchMinLen;
+ if (len < kNumLenToPosStates)
+ return len;
+ return (int)(kNumLenToPosStates - 1);
+ }
+
+ public static final int kNumAlignBits = 4;
+ public static final int kAlignTableSize = 1 << kNumAlignBits;
+ public static final int kAlignMask = (kAlignTableSize - 1);
+
+ public static final int kStartPosModelIndex = 4;
+ public static final int kEndPosModelIndex = 14;
+ public static final int kNumPosModels = kEndPosModelIndex - kStartPosModelIndex;
+
+ public static final int kNumFullDistances = 1 << (kEndPosModelIndex / 2);
+
+ public static final int kNumLitPosStatesBitsEncodingMax = 4;
+ public static final int kNumLitContextBitsMax = 8;
+
+ public static final int kNumPosStatesBitsMax = 4;
+ public static final int kNumPosStatesMax = (1 << kNumPosStatesBitsMax);
+ public static final int kNumPosStatesBitsEncodingMax = 4;
+ public static final int kNumPosStatesEncodingMax = (1 << kNumPosStatesBitsEncodingMax);
+
+ public static final int kNumLowLenBits = 3;
+ public static final int kNumMidLenBits = 3;
+ public static final int kNumHighLenBits = 8;
+ public static final int kNumLowLenSymbols = 1 << kNumLowLenBits;
+ public static final int kNumMidLenSymbols = 1 << kNumMidLenBits;
+ public static final int kNumLenSymbols = kNumLowLenSymbols + kNumMidLenSymbols +
+ (1 << kNumHighLenBits);
+ public static final int kMatchMaxLen = kMatchMinLen + kNumLenSymbols - 1;
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Decoder.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Decoder.java
new file mode 100644
index 0000000000..4ebd571106
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Decoder.java
@@ -0,0 +1,329 @@
+package SevenZip.Compression.LZMA;
+
+import SevenZip.Compression.RangeCoder.BitTreeDecoder;
+import SevenZip.Compression.LZMA.Base;
+import SevenZip.Compression.LZ.OutWindow;
+import java.io.IOException;
+
+public class Decoder
+{
+ class LenDecoder
+ {
+ short[] m_Choice = new short[2];
+ BitTreeDecoder[] m_LowCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
+ BitTreeDecoder[] m_MidCoder = new BitTreeDecoder[Base.kNumPosStatesMax];
+ BitTreeDecoder m_HighCoder = new BitTreeDecoder(Base.kNumHighLenBits);
+ int m_NumPosStates = 0;
+
+ public void Create(int numPosStates)
+ {
+ for (; m_NumPosStates < numPosStates; m_NumPosStates++)
+ {
+ m_LowCoder[m_NumPosStates] = new BitTreeDecoder(Base.kNumLowLenBits);
+ m_MidCoder[m_NumPosStates] = new BitTreeDecoder(Base.kNumMidLenBits);
+ }
+ }
+
+ public void Init()
+ {
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_Choice);
+ for (int posState = 0; posState < m_NumPosStates; posState++)
+ {
+ m_LowCoder[posState].Init();
+ m_MidCoder[posState].Init();
+ }
+ m_HighCoder.Init();
+ }
+
+ public int Decode(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, int posState) throws IOException
+ {
+ if (rangeDecoder.DecodeBit(m_Choice, 0) == 0)
+ return m_LowCoder[posState].Decode(rangeDecoder);
+ int symbol = Base.kNumLowLenSymbols;
+ if (rangeDecoder.DecodeBit(m_Choice, 1) == 0)
+ symbol += m_MidCoder[posState].Decode(rangeDecoder);
+ else
+ symbol += Base.kNumMidLenSymbols + m_HighCoder.Decode(rangeDecoder);
+ return symbol;
+ }
+ }
+
+ class LiteralDecoder
+ {
+ class Decoder2
+ {
+ short[] m_Decoders = new short[0x300];
+
+ public void Init()
+ {
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_Decoders);
+ }
+
+ public byte DecodeNormal(SevenZip.Compression.RangeCoder.Decoder rangeDecoder) throws IOException
+ {
+ int symbol = 1;
+ do
+ symbol = (symbol << 1) | rangeDecoder.DecodeBit(m_Decoders, symbol);
+ while (symbol < 0x100);
+ return (byte)symbol;
+ }
+
+ public byte DecodeWithMatchByte(SevenZip.Compression.RangeCoder.Decoder rangeDecoder, byte matchByte) throws IOException
+ {
+ int symbol = 1;
+ do
+ {
+ int matchBit = (matchByte >> 7) & 1;
+ matchByte <<= 1;
+ int bit = rangeDecoder.DecodeBit(m_Decoders, ((1 + matchBit) << 8) + symbol);
+ symbol = (symbol << 1) | bit;
+ if (matchBit != bit)
+ {
+ while (symbol < 0x100)
+ symbol = (symbol << 1) | rangeDecoder.DecodeBit(m_Decoders, symbol);
+ break;
+ }
+ }
+ while (symbol < 0x100);
+ return (byte)symbol;
+ }
+ }
+
+ Decoder2[] m_Coders;
+ int m_NumPrevBits;
+ int m_NumPosBits;
+ int m_PosMask;
+
+ public void Create(int numPosBits, int numPrevBits)
+ {
+ if (m_Coders != null && m_NumPrevBits == numPrevBits && m_NumPosBits == numPosBits)
+ return;
+ m_NumPosBits = numPosBits;
+ m_PosMask = (1 << numPosBits) - 1;
+ m_NumPrevBits = numPrevBits;
+ int numStates = 1 << (m_NumPrevBits + m_NumPosBits);
+ m_Coders = new Decoder2[numStates];
+ for (int i = 0; i < numStates; i++)
+ m_Coders[i] = new Decoder2();
+ }
+
+ public void Init()
+ {
+ int numStates = 1 << (m_NumPrevBits + m_NumPosBits);
+ for (int i = 0; i < numStates; i++)
+ m_Coders[i].Init();
+ }
+
+ Decoder2 GetDecoder(int pos, byte prevByte)
+ {
+ return m_Coders[((pos & m_PosMask) << m_NumPrevBits) + ((prevByte & 0xFF) >>> (8 - m_NumPrevBits))];
+ }
+ }
+
+ OutWindow m_OutWindow = new OutWindow();
+ SevenZip.Compression.RangeCoder.Decoder m_RangeDecoder = new SevenZip.Compression.RangeCoder.Decoder();
+
+ short[] m_IsMatchDecoders = new short[Base.kNumStates << Base.kNumPosStatesBitsMax];
+ short[] m_IsRepDecoders = new short[Base.kNumStates];
+ short[] m_IsRepG0Decoders = new short[Base.kNumStates];
+ short[] m_IsRepG1Decoders = new short[Base.kNumStates];
+ short[] m_IsRepG2Decoders = new short[Base.kNumStates];
+ short[] m_IsRep0LongDecoders = new short[Base.kNumStates << Base.kNumPosStatesBitsMax];
+
+ BitTreeDecoder[] m_PosSlotDecoder = new BitTreeDecoder[Base.kNumLenToPosStates];
+ short[] m_PosDecoders = new short[Base.kNumFullDistances - Base.kEndPosModelIndex];
+
+ BitTreeDecoder m_PosAlignDecoder = new BitTreeDecoder(Base.kNumAlignBits);
+
+ LenDecoder m_LenDecoder = new LenDecoder();
+ LenDecoder m_RepLenDecoder = new LenDecoder();
+
+ LiteralDecoder m_LiteralDecoder = new LiteralDecoder();
+
+ int m_DictionarySize = -1;
+ int m_DictionarySizeCheck = -1;
+
+ int m_PosStateMask;
+
+ public Decoder()
+ {
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ m_PosSlotDecoder[i] = new BitTreeDecoder(Base.kNumPosSlotBits);
+ }
+
+ boolean SetDictionarySize(int dictionarySize)
+ {
+ if (dictionarySize < 0)
+ return false;
+ if (m_DictionarySize != dictionarySize)
+ {
+ m_DictionarySize = dictionarySize;
+ m_DictionarySizeCheck = Math.max(m_DictionarySize, 1);
+ m_OutWindow.Create(Math.max(m_DictionarySizeCheck, (1 << 12)));
+ }
+ return true;
+ }
+
+ boolean SetLcLpPb(int lc, int lp, int pb)
+ {
+ if (lc > Base.kNumLitContextBitsMax || lp > 4 || pb > Base.kNumPosStatesBitsMax)
+ return false;
+ m_LiteralDecoder.Create(lp, lc);
+ int numPosStates = 1 << pb;
+ m_LenDecoder.Create(numPosStates);
+ m_RepLenDecoder.Create(numPosStates);
+ m_PosStateMask = numPosStates - 1;
+ return true;
+ }
+
+ void Init() throws IOException
+ {
+ m_OutWindow.Init(false);
+
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsMatchDecoders);
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRep0LongDecoders);
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepDecoders);
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG0Decoders);
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG1Decoders);
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_IsRepG2Decoders);
+ SevenZip.Compression.RangeCoder.Decoder.InitBitModels(m_PosDecoders);
+
+ m_LiteralDecoder.Init();
+ int i;
+ for (i = 0; i < Base.kNumLenToPosStates; i++)
+ m_PosSlotDecoder[i].Init();
+ m_LenDecoder.Init();
+ m_RepLenDecoder.Init();
+ m_PosAlignDecoder.Init();
+ m_RangeDecoder.Init();
+ }
+
+ public boolean Code(java.io.InputStream inStream, java.io.OutputStream outStream,
+ long outSize) throws IOException
+ {
+ m_RangeDecoder.SetStream(inStream);
+ m_OutWindow.SetStream(outStream);
+ Init();
+
+ int state = Base.StateInit();
+ int rep0 = 0, rep1 = 0, rep2 = 0, rep3 = 0;
+
+ long nowPos64 = 0;
+ byte prevByte = 0;
+ while (outSize < 0 || nowPos64 < outSize)
+ {
+ int posState = (int)nowPos64 & m_PosStateMask;
+ if (m_RangeDecoder.DecodeBit(m_IsMatchDecoders, (state << Base.kNumPosStatesBitsMax) + posState) == 0)
+ {
+ LiteralDecoder.Decoder2 decoder2 = m_LiteralDecoder.GetDecoder((int)nowPos64, prevByte);
+ if (!Base.StateIsCharState(state))
+ prevByte = decoder2.DecodeWithMatchByte(m_RangeDecoder, m_OutWindow.GetByte(rep0));
+ else
+ prevByte = decoder2.DecodeNormal(m_RangeDecoder);
+ m_OutWindow.PutByte(prevByte);
+ state = Base.StateUpdateChar(state);
+ nowPos64++;
+ }
+ else
+ {
+ int len;
+ if (m_RangeDecoder.DecodeBit(m_IsRepDecoders, state) == 1)
+ {
+ len = 0;
+ if (m_RangeDecoder.DecodeBit(m_IsRepG0Decoders, state) == 0)
+ {
+ if (m_RangeDecoder.DecodeBit(m_IsRep0LongDecoders, (state << Base.kNumPosStatesBitsMax) + posState) == 0)
+ {
+ state = Base.StateUpdateShortRep(state);
+ len = 1;
+ }
+ }
+ else
+ {
+ int distance;
+ if (m_RangeDecoder.DecodeBit(m_IsRepG1Decoders, state) == 0)
+ distance = rep1;
+ else
+ {
+ if (m_RangeDecoder.DecodeBit(m_IsRepG2Decoders, state) == 0)
+ distance = rep2;
+ else
+ {
+ distance = rep3;
+ rep3 = rep2;
+ }
+ rep2 = rep1;
+ }
+ rep1 = rep0;
+ rep0 = distance;
+ }
+ if (len == 0)
+ {
+ len = m_RepLenDecoder.Decode(m_RangeDecoder, posState) + Base.kMatchMinLen;
+ state = Base.StateUpdateRep(state);
+ }
+ }
+ else
+ {
+ rep3 = rep2;
+ rep2 = rep1;
+ rep1 = rep0;
+ len = Base.kMatchMinLen + m_LenDecoder.Decode(m_RangeDecoder, posState);
+ state = Base.StateUpdateMatch(state);
+ int posSlot = m_PosSlotDecoder[Base.GetLenToPosState(len)].Decode(m_RangeDecoder);
+ if (posSlot >= Base.kStartPosModelIndex)
+ {
+ int numDirectBits = (posSlot >> 1) - 1;
+ rep0 = ((2 | (posSlot & 1)) << numDirectBits);
+ if (posSlot < Base.kEndPosModelIndex)
+ rep0 += BitTreeDecoder.ReverseDecode(m_PosDecoders,
+ rep0 - posSlot - 1, m_RangeDecoder, numDirectBits);
+ else
+ {
+ rep0 += (m_RangeDecoder.DecodeDirectBits(
+ numDirectBits - Base.kNumAlignBits) << Base.kNumAlignBits);
+ rep0 += m_PosAlignDecoder.ReverseDecode(m_RangeDecoder);
+ if (rep0 < 0)
+ {
+ if (rep0 == -1)
+ break;
+ return false;
+ }
+ }
+ }
+ else
+ rep0 = posSlot;
+ }
+ if (rep0 >= nowPos64 || rep0 >= m_DictionarySizeCheck)
+ {
+ // m_OutWindow.Flush();
+ return false;
+ }
+ m_OutWindow.CopyBlock(rep0, len);
+ nowPos64 += len;
+ prevByte = m_OutWindow.GetByte(0);
+ }
+ }
+ m_OutWindow.Flush();
+ m_OutWindow.ReleaseStream();
+ m_RangeDecoder.ReleaseStream();
+ return true;
+ }
+
+ public boolean SetDecoderProperties(byte[] properties)
+ {
+ if (properties.length < 5)
+ return false;
+ int val = properties[0] & 0xFF;
+ int lc = val % 9;
+ int remainder = val / 9;
+ int lp = remainder % 5;
+ int pb = remainder / 5;
+ int dictionarySize = 0;
+ for (int i = 0; i < 4; i++)
+ dictionarySize += ((int)(properties[1 + i]) & 0xFF) << (i * 8);
+ if (!SetLcLpPb(lc, lp, pb))
+ return false;
+ return SetDictionarySize(dictionarySize);
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Encoder.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Encoder.java
new file mode 100644
index 0000000000..771fb21946
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/LZMA/Encoder.java
@@ -0,0 +1,1416 @@
+package SevenZip.Compression.LZMA;
+
+import SevenZip.Compression.RangeCoder.BitTreeEncoder;
+import SevenZip.Compression.LZMA.Base;
+import SevenZip.Compression.LZ.BinTree;
+import SevenZip.ICodeProgress;
+import java.io.IOException;
+
+public class Encoder
+{
+ public static final int EMatchFinderTypeBT2 = 0;
+ public static final int EMatchFinderTypeBT4 = 1;
+
+
+
+
+ static final int kIfinityPrice = 0xFFFFFFF;
+
+ static byte[] g_FastPos = new byte[1 << 11];
+
+ static
+ {
+ int kFastSlots = 22;
+ int c = 2;
+ g_FastPos[0] = 0;
+ g_FastPos[1] = 1;
+ for (int slotFast = 2; slotFast < kFastSlots; slotFast++)
+ {
+ int k = (1 << ((slotFast >> 1) - 1));
+ for (int j = 0; j < k; j++, c++)
+ g_FastPos[c] = (byte)slotFast;
+ }
+ }
+
+ static int GetPosSlot(int pos)
+ {
+ if (pos < (1 << 11))
+ return g_FastPos[pos];
+ if (pos < (1 << 21))
+ return (g_FastPos[pos >> 10] + 20);
+ return (g_FastPos[pos >> 20] + 40);
+ }
+
+ static int GetPosSlot2(int pos)
+ {
+ if (pos < (1 << 17))
+ return (g_FastPos[pos >> 6] + 12);
+ if (pos < (1 << 27))
+ return (g_FastPos[pos >> 16] + 32);
+ return (g_FastPos[pos >> 26] + 52);
+ }
+
+ int _state = Base.StateInit();
+ byte _previousByte;
+ int[] _repDistances = new int[Base.kNumRepDistances];
+
+ void BaseInit()
+ {
+ _state = Base.StateInit();
+ _previousByte = 0;
+ for (int i = 0; i < Base.kNumRepDistances; i++)
+ _repDistances[i] = 0;
+ }
+
+ static final int kDefaultDictionaryLogSize = 22;
+ static final int kNumFastBytesDefault = 0x20;
+
+ class LiteralEncoder
+ {
+ class Encoder2
+ {
+ short[] m_Encoders = new short[0x300];
+
+ public void Init() { SevenZip.Compression.RangeCoder.Encoder.InitBitModels(m_Encoders); }
+
+
+
+ public void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte symbol) throws IOException
+ {
+ int context = 1;
+ for (int i = 7; i >= 0; i--)
+ {
+ int bit = ((symbol >> i) & 1);
+ rangeEncoder.Encode(m_Encoders, context, bit);
+ context = (context << 1) | bit;
+ }
+ }
+
+ public void EncodeMatched(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, byte matchByte, byte symbol) throws IOException
+ {
+ int context = 1;
+ boolean same = true;
+ for (int i = 7; i >= 0; i--)
+ {
+ int bit = ((symbol >> i) & 1);
+ int state = context;
+ if (same)
+ {
+ int matchBit = ((matchByte >> i) & 1);
+ state += ((1 + matchBit) << 8);
+ same = (matchBit == bit);
+ }
+ rangeEncoder.Encode(m_Encoders, state, bit);
+ context = (context << 1) | bit;
+ }
+ }
+
+ public int GetPrice(boolean matchMode, byte matchByte, byte symbol)
+ {
+ int price = 0;
+ int context = 1;
+ int i = 7;
+ if (matchMode)
+ {
+ for (; i >= 0; i--)
+ {
+ int matchBit = (matchByte >> i) & 1;
+ int bit = (symbol >> i) & 1;
+ price += SevenZip.Compression.RangeCoder.Encoder.GetPrice(m_Encoders[((1 + matchBit) << 8) + context], bit);
+ context = (context << 1) | bit;
+ if (matchBit != bit)
+ {
+ i--;
+ break;
+ }
+ }
+ }
+ for (; i >= 0; i--)
+ {
+ int bit = (symbol >> i) & 1;
+ price += SevenZip.Compression.RangeCoder.Encoder.GetPrice(m_Encoders[context], bit);
+ context = (context << 1) | bit;
+ }
+ return price;
+ }
+ }
+
+ Encoder2[] m_Coders;
+ int m_NumPrevBits;
+ int m_NumPosBits;
+ int m_PosMask;
+
+ public void Create(int numPosBits, int numPrevBits)
+ {
+ if (m_Coders != null && m_NumPrevBits == numPrevBits && m_NumPosBits == numPosBits)
+ return;
+ m_NumPosBits = numPosBits;
+ m_PosMask = (1 << numPosBits) - 1;
+ m_NumPrevBits = numPrevBits;
+ int numStates = 1 << (m_NumPrevBits + m_NumPosBits);
+ m_Coders = new Encoder2[numStates];
+ for (int i = 0; i < numStates; i++)
+ m_Coders[i] = new Encoder2();
+ }
+
+ public void Init()
+ {
+ int numStates = 1 << (m_NumPrevBits + m_NumPosBits);
+ for (int i = 0; i < numStates; i++)
+ m_Coders[i].Init();
+ }
+
+ public Encoder2 GetSubCoder(int pos, byte prevByte)
+ { return m_Coders[((pos & m_PosMask) << m_NumPrevBits) + ((prevByte & 0xFF) >>> (8 - m_NumPrevBits))]; }
+ }
+
+ class LenEncoder
+ {
+ short[] _choice = new short[2];
+ BitTreeEncoder[] _lowCoder = new BitTreeEncoder[Base.kNumPosStatesEncodingMax];
+ BitTreeEncoder[] _midCoder = new BitTreeEncoder[Base.kNumPosStatesEncodingMax];
+ BitTreeEncoder _highCoder = new BitTreeEncoder(Base.kNumHighLenBits);
+
+
+ public LenEncoder()
+ {
+ for (int posState = 0; posState < Base.kNumPosStatesEncodingMax; posState++)
+ {
+ _lowCoder[posState] = new BitTreeEncoder(Base.kNumLowLenBits);
+ _midCoder[posState] = new BitTreeEncoder(Base.kNumMidLenBits);
+ }
+ }
+
+ public void Init(int numPosStates)
+ {
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_choice);
+
+ for (int posState = 0; posState < numPosStates; posState++)
+ {
+ _lowCoder[posState].Init();
+ _midCoder[posState].Init();
+ }
+ _highCoder.Init();
+ }
+
+ public void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, int symbol, int posState) throws IOException
+ {
+ if (symbol < Base.kNumLowLenSymbols)
+ {
+ rangeEncoder.Encode(_choice, 0, 0);
+ _lowCoder[posState].Encode(rangeEncoder, symbol);
+ }
+ else
+ {
+ symbol -= Base.kNumLowLenSymbols;
+ rangeEncoder.Encode(_choice, 0, 1);
+ if (symbol < Base.kNumMidLenSymbols)
+ {
+ rangeEncoder.Encode(_choice, 1, 0);
+ _midCoder[posState].Encode(rangeEncoder, symbol);
+ }
+ else
+ {
+ rangeEncoder.Encode(_choice, 1, 1);
+ _highCoder.Encode(rangeEncoder, symbol - Base.kNumMidLenSymbols);
+ }
+ }
+ }
+
+ public void SetPrices(int posState, int numSymbols, int[] prices, int st)
+ {
+ int a0 = SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_choice[0]);
+ int a1 = SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_choice[0]);
+ int b0 = a1 + SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_choice[1]);
+ int b1 = a1 + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_choice[1]);
+ int i = 0;
+ for (i = 0; i < Base.kNumLowLenSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[st + i] = a0 + _lowCoder[posState].GetPrice(i);
+ }
+ for (; i < Base.kNumLowLenSymbols + Base.kNumMidLenSymbols; i++)
+ {
+ if (i >= numSymbols)
+ return;
+ prices[st + i] = b0 + _midCoder[posState].GetPrice(i - Base.kNumLowLenSymbols);
+ }
+ for (; i < numSymbols; i++)
+ prices[st + i] = b1 + _highCoder.GetPrice(i - Base.kNumLowLenSymbols - Base.kNumMidLenSymbols);
+ }
+ };
+
+ public static final int kNumLenSpecSymbols = Base.kNumLowLenSymbols + Base.kNumMidLenSymbols;
+
+ class LenPriceTableEncoder extends LenEncoder
+ {
+ int[] _prices = new int[Base.kNumLenSymbols<<Base.kNumPosStatesBitsEncodingMax];
+ int _tableSize;
+ int[] _counters = new int[Base.kNumPosStatesEncodingMax];
+
+ public void SetTableSize(int tableSize) { _tableSize = tableSize; }
+
+ public int GetPrice(int symbol, int posState)
+ {
+ return _prices[posState * Base.kNumLenSymbols + symbol];
+ }
+
+ void UpdateTable(int posState)
+ {
+ SetPrices(posState, _tableSize, _prices, posState * Base.kNumLenSymbols);
+ _counters[posState] = _tableSize;
+ }
+
+ public void UpdateTables(int numPosStates)
+ {
+ for (int posState = 0; posState < numPosStates; posState++)
+ UpdateTable(posState);
+ }
+
+ public void Encode(SevenZip.Compression.RangeCoder.Encoder rangeEncoder, int symbol, int posState) throws IOException
+ {
+ super.Encode(rangeEncoder, symbol, posState);
+ if (--_counters[posState] == 0)
+ UpdateTable(posState);
+ }
+ }
+
+ static final int kNumOpts = 1 << 12;
+ class Optimal
+ {
+ public int State;
+
+ public boolean Prev1IsChar;
+ public boolean Prev2;
+
+ public int PosPrev2;
+ public int BackPrev2;
+
+ public int Price;
+ public int PosPrev;
+ public int BackPrev;
+
+ public int Backs0;
+ public int Backs1;
+ public int Backs2;
+ public int Backs3;
+
+ public void MakeAsChar() { BackPrev = -1; Prev1IsChar = false; }
+ public void MakeAsShortRep() { BackPrev = 0; ; Prev1IsChar = false; }
+ public boolean IsShortRep() { return (BackPrev == 0); }
+ };
+ Optimal[] _optimum = new Optimal[kNumOpts];
+ SevenZip.Compression.LZ.BinTree _matchFinder = null;
+ SevenZip.Compression.RangeCoder.Encoder _rangeEncoder = new SevenZip.Compression.RangeCoder.Encoder();
+
+ short[] _isMatch = new short[Base.kNumStates<<Base.kNumPosStatesBitsMax];
+ short[] _isRep = new short[Base.kNumStates];
+ short[] _isRepG0 = new short[Base.kNumStates];
+ short[] _isRepG1 = new short[Base.kNumStates];
+ short[] _isRepG2 = new short[Base.kNumStates];
+ short[] _isRep0Long = new short[Base.kNumStates<<Base.kNumPosStatesBitsMax];
+
+ BitTreeEncoder[] _posSlotEncoder = new BitTreeEncoder[Base.kNumLenToPosStates]; // kNumPosSlotBits
+
+ short[] _posEncoders = new short[Base.kNumFullDistances-Base.kEndPosModelIndex];
+ BitTreeEncoder _posAlignEncoder = new BitTreeEncoder(Base.kNumAlignBits);
+
+ LenPriceTableEncoder _lenEncoder = new LenPriceTableEncoder();
+ LenPriceTableEncoder _repMatchLenEncoder = new LenPriceTableEncoder();
+
+ LiteralEncoder _literalEncoder = new LiteralEncoder();
+
+ int[] _matchDistances = new int[Base.kMatchMaxLen*2+2];
+
+ int _numFastBytes = kNumFastBytesDefault;
+ int _longestMatchLength;
+ int _numDistancePairs;
+
+ int _additionalOffset;
+
+ int _optimumEndIndex;
+ int _optimumCurrentIndex;
+
+ boolean _longestMatchWasFound;
+
+ int[] _posSlotPrices = new int[1<<(Base.kNumPosSlotBits+Base.kNumLenToPosStatesBits)];
+ int[] _distancesPrices = new int[Base.kNumFullDistances<<Base.kNumLenToPosStatesBits];
+ int[] _alignPrices = new int[Base.kAlignTableSize];
+ int _alignPriceCount;
+
+ int _distTableSize = (kDefaultDictionaryLogSize * 2);
+
+ int _posStateBits = 2;
+ int _posStateMask = (4 - 1);
+ int _numLiteralPosStateBits = 0;
+ int _numLiteralContextBits = 3;
+
+ int _dictionarySize = (1 << kDefaultDictionaryLogSize);
+ int _dictionarySizePrev = -1;
+ int _numFastBytesPrev = -1;
+
+ long nowPos64;
+ boolean _finished;
+ java.io.InputStream _inStream;
+
+ int _matchFinderType = EMatchFinderTypeBT4;
+ boolean _writeEndMark = false;
+
+ boolean _needReleaseMFStream = false;
+
+ void Create()
+ {
+ if (_matchFinder == null)
+ {
+ SevenZip.Compression.LZ.BinTree bt = new SevenZip.Compression.LZ.BinTree();
+ int numHashBytes = 4;
+ if (_matchFinderType == EMatchFinderTypeBT2)
+ numHashBytes = 2;
+ bt.SetType(numHashBytes);
+ _matchFinder = bt;
+ }
+ _literalEncoder.Create(_numLiteralPosStateBits, _numLiteralContextBits);
+
+ if (_dictionarySize == _dictionarySizePrev && _numFastBytesPrev == _numFastBytes)
+ return;
+ _matchFinder.Create(_dictionarySize, kNumOpts, _numFastBytes, Base.kMatchMaxLen + 1);
+ _dictionarySizePrev = _dictionarySize;
+ _numFastBytesPrev = _numFastBytes;
+ }
+
+ public Encoder()
+ {
+ for (int i = 0; i < kNumOpts; i++)
+ _optimum[i] = new Optimal();
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ _posSlotEncoder[i] = new BitTreeEncoder(Base.kNumPosSlotBits);
+ }
+
+ void SetWriteEndMarkerMode(boolean writeEndMarker)
+ {
+ _writeEndMark = writeEndMarker;
+ }
+
+ void Init()
+ {
+ BaseInit();
+ _rangeEncoder.Init();
+
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_isMatch);
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_isRep0Long);
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_isRep);
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_isRepG0);
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_isRepG1);
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_isRepG2);
+ SevenZip.Compression.RangeCoder.Encoder.InitBitModels(_posEncoders);
+
+
+
+
+
+
+
+ _literalEncoder.Init();
+ for (int i = 0; i < Base.kNumLenToPosStates; i++)
+ _posSlotEncoder[i].Init();
+
+
+
+ _lenEncoder.Init(1 << _posStateBits);
+ _repMatchLenEncoder.Init(1 << _posStateBits);
+
+ _posAlignEncoder.Init();
+
+ _longestMatchWasFound = false;
+ _optimumEndIndex = 0;
+ _optimumCurrentIndex = 0;
+ _additionalOffset = 0;
+ }
+
+ int ReadMatchDistances() throws java.io.IOException
+ {
+ int lenRes = 0;
+ _numDistancePairs = _matchFinder.GetMatches(_matchDistances);
+ if (_numDistancePairs > 0)
+ {
+ lenRes = _matchDistances[_numDistancePairs - 2];
+ if (lenRes == _numFastBytes)
+ lenRes += _matchFinder.GetMatchLen((int)lenRes - 1, _matchDistances[_numDistancePairs - 1],
+ Base.kMatchMaxLen - lenRes);
+ }
+ _additionalOffset++;
+ return lenRes;
+ }
+
+ void MovePos(int num) throws java.io.IOException
+ {
+ if (num > 0)
+ {
+ _matchFinder.Skip(num);
+ _additionalOffset += num;
+ }
+ }
+
+ int GetRepLen1Price(int state, int posState)
+ {
+ return SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRepG0[state]) +
+ SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRep0Long[(state << Base.kNumPosStatesBitsMax) + posState]);
+ }
+
+ int GetPureRepPrice(int repIndex, int state, int posState)
+ {
+ int price;
+ if (repIndex == 0)
+ {
+ price = SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRepG0[state]);
+ price += SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep0Long[(state << Base.kNumPosStatesBitsMax) + posState]);
+ }
+ else
+ {
+ price = SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRepG0[state]);
+ if (repIndex == 1)
+ price += SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRepG1[state]);
+ else
+ {
+ price += SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRepG1[state]);
+ price += SevenZip.Compression.RangeCoder.Encoder.GetPrice(_isRepG2[state], repIndex - 2);
+ }
+ }
+ return price;
+ }
+
+ int GetRepPrice(int repIndex, int len, int state, int posState)
+ {
+ int price = _repMatchLenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
+ return price + GetPureRepPrice(repIndex, state, posState);
+ }
+
+ int GetPosLenPrice(int pos, int len, int posState)
+ {
+ int price;
+ int lenToPosState = Base.GetLenToPosState(len);
+ if (pos < Base.kNumFullDistances)
+ price = _distancesPrices[(lenToPosState * Base.kNumFullDistances) + pos];
+ else
+ price = _posSlotPrices[(lenToPosState << Base.kNumPosSlotBits) + GetPosSlot2(pos)] +
+ _alignPrices[pos & Base.kAlignMask];
+ return price + _lenEncoder.GetPrice(len - Base.kMatchMinLen, posState);
+ }
+
+ int Backward(int cur)
+ {
+ _optimumEndIndex = cur;
+ int posMem = _optimum[cur].PosPrev;
+ int backMem = _optimum[cur].BackPrev;
+ do
+ {
+ if (_optimum[cur].Prev1IsChar)
+ {
+ _optimum[posMem].MakeAsChar();
+ _optimum[posMem].PosPrev = posMem - 1;
+ if (_optimum[cur].Prev2)
+ {
+ _optimum[posMem - 1].Prev1IsChar = false;
+ _optimum[posMem - 1].PosPrev = _optimum[cur].PosPrev2;
+ _optimum[posMem - 1].BackPrev = _optimum[cur].BackPrev2;
+ }
+ }
+ int posPrev = posMem;
+ int backCur = backMem;
+
+ backMem = _optimum[posPrev].BackPrev;
+ posMem = _optimum[posPrev].PosPrev;
+
+ _optimum[posPrev].BackPrev = backCur;
+ _optimum[posPrev].PosPrev = cur;
+ cur = posPrev;
+ }
+ while (cur > 0);
+ backRes = _optimum[0].BackPrev;
+ _optimumCurrentIndex = _optimum[0].PosPrev;
+ return _optimumCurrentIndex;
+ }
+
+ int[] reps = new int[Base.kNumRepDistances];
+ int[] repLens = new int[Base.kNumRepDistances];
+ int backRes;
+
+ int GetOptimum(int position) throws IOException
+ {
+ if (_optimumEndIndex != _optimumCurrentIndex)
+ {
+ int lenRes = _optimum[_optimumCurrentIndex].PosPrev - _optimumCurrentIndex;
+ backRes = _optimum[_optimumCurrentIndex].BackPrev;
+ _optimumCurrentIndex = _optimum[_optimumCurrentIndex].PosPrev;
+ return lenRes;
+ }
+ _optimumCurrentIndex = _optimumEndIndex = 0;
+
+ int lenMain, numDistancePairs;
+ if (!_longestMatchWasFound)
+ {
+ lenMain = ReadMatchDistances();
+ }
+ else
+ {
+ lenMain = _longestMatchLength;
+ _longestMatchWasFound = false;
+ }
+ numDistancePairs = _numDistancePairs;
+
+ int numAvailableBytes = _matchFinder.GetNumAvailableBytes() + 1;
+ if (numAvailableBytes < 2)
+ {
+ backRes = -1;
+ return 1;
+ }
+ if (numAvailableBytes > Base.kMatchMaxLen)
+ numAvailableBytes = Base.kMatchMaxLen;
+
+ int repMaxIndex = 0;
+ int i;
+ for (i = 0; i < Base.kNumRepDistances; i++)
+ {
+ reps[i] = _repDistances[i];
+ repLens[i] = _matchFinder.GetMatchLen(0 - 1, reps[i], Base.kMatchMaxLen);
+ if (repLens[i] > repLens[repMaxIndex])
+ repMaxIndex = i;
+ }
+ if (repLens[repMaxIndex] >= _numFastBytes)
+ {
+ backRes = repMaxIndex;
+ int lenRes = repLens[repMaxIndex];
+ MovePos(lenRes - 1);
+ return lenRes;
+ }
+
+ if (lenMain >= _numFastBytes)
+ {
+ backRes = _matchDistances[numDistancePairs - 1] + Base.kNumRepDistances;
+ MovePos(lenMain - 1);
+ return lenMain;
+ }
+
+ byte currentByte = _matchFinder.GetIndexByte(0 - 1);
+ byte matchByte = _matchFinder.GetIndexByte(0 - _repDistances[0] - 1 - 1);
+
+ if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2)
+ {
+ backRes = -1;
+ return 1;
+ }
+
+ _optimum[0].State = _state;
+
+ int posState = (position & _posStateMask);
+
+ _optimum[1].Price = SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(_state << Base.kNumPosStatesBitsMax) + posState]) +
+ _literalEncoder.GetSubCoder(position, _previousByte).GetPrice(!Base.StateIsCharState(_state), matchByte, currentByte);
+ _optimum[1].MakeAsChar();
+
+ int matchPrice = SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(_state << Base.kNumPosStatesBitsMax) + posState]);
+ int repMatchPrice = matchPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep[_state]);
+
+ if (matchByte == currentByte)
+ {
+ int shortRepPrice = repMatchPrice + GetRepLen1Price(_state, posState);
+ if (shortRepPrice < _optimum[1].Price)
+ {
+ _optimum[1].Price = shortRepPrice;
+ _optimum[1].MakeAsShortRep();
+ }
+ }
+
+ int lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]);
+
+ if (lenEnd < 2)
+ {
+ backRes = _optimum[1].BackPrev;
+ return 1;
+ }
+
+ _optimum[1].PosPrev = 0;
+
+ _optimum[0].Backs0 = reps[0];
+ _optimum[0].Backs1 = reps[1];
+ _optimum[0].Backs2 = reps[2];
+ _optimum[0].Backs3 = reps[3];
+
+ int len = lenEnd;
+ do
+ _optimum[len--].Price = kIfinityPrice;
+ while (len >= 2);
+
+ for (i = 0; i < Base.kNumRepDistances; i++)
+ {
+ int repLen = repLens[i];
+ if (repLen < 2)
+ continue;
+ int price = repMatchPrice + GetPureRepPrice(i, _state, posState);
+ do
+ {
+ int curAndLenPrice = price + _repMatchLenEncoder.GetPrice(repLen - 2, posState);
+ Optimal optimum = _optimum[repLen];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = 0;
+ optimum.BackPrev = i;
+ optimum.Prev1IsChar = false;
+ }
+ }
+ while (--repLen >= 2);
+ }
+
+ int normalMatchPrice = matchPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRep[_state]);
+
+ len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2);
+ if (len <= lenMain)
+ {
+ int offs = 0;
+ while (len > _matchDistances[offs])
+ offs += 2;
+ for (; ; len++)
+ {
+ int distance = _matchDistances[offs + 1];
+ int curAndLenPrice = normalMatchPrice + GetPosLenPrice(distance, len, posState);
+ Optimal optimum = _optimum[len];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = 0;
+ optimum.BackPrev = distance + Base.kNumRepDistances;
+ optimum.Prev1IsChar = false;
+ }
+ if (len == _matchDistances[offs])
+ {
+ offs += 2;
+ if (offs == numDistancePairs)
+ break;
+ }
+ }
+ }
+
+ int cur = 0;
+
+ while (true)
+ {
+ cur++;
+ if (cur == lenEnd)
+ return Backward(cur);
+ int newLen = ReadMatchDistances();
+ numDistancePairs = _numDistancePairs;
+ if (newLen >= _numFastBytes)
+ {
+
+ _longestMatchLength = newLen;
+ _longestMatchWasFound = true;
+ return Backward(cur);
+ }
+ position++;
+ int posPrev = _optimum[cur].PosPrev;
+ int state;
+ if (_optimum[cur].Prev1IsChar)
+ {
+ posPrev--;
+ if (_optimum[cur].Prev2)
+ {
+ state = _optimum[_optimum[cur].PosPrev2].State;
+ if (_optimum[cur].BackPrev2 < Base.kNumRepDistances)
+ state = Base.StateUpdateRep(state);
+ else
+ state = Base.StateUpdateMatch(state);
+ }
+ else
+ state = _optimum[posPrev].State;
+ state = Base.StateUpdateChar(state);
+ }
+ else
+ state = _optimum[posPrev].State;
+ if (posPrev == cur - 1)
+ {
+ if (_optimum[cur].IsShortRep())
+ state = Base.StateUpdateShortRep(state);
+ else
+ state = Base.StateUpdateChar(state);
+ }
+ else
+ {
+ int pos;
+ if (_optimum[cur].Prev1IsChar && _optimum[cur].Prev2)
+ {
+ posPrev = _optimum[cur].PosPrev2;
+ pos = _optimum[cur].BackPrev2;
+ state = Base.StateUpdateRep(state);
+ }
+ else
+ {
+ pos = _optimum[cur].BackPrev;
+ if (pos < Base.kNumRepDistances)
+ state = Base.StateUpdateRep(state);
+ else
+ state = Base.StateUpdateMatch(state);
+ }
+ Optimal opt = _optimum[posPrev];
+ if (pos < Base.kNumRepDistances)
+ {
+ if (pos == 0)
+ {
+ reps[0] = opt.Backs0;
+ reps[1] = opt.Backs1;
+ reps[2] = opt.Backs2;
+ reps[3] = opt.Backs3;
+ }
+ else if (pos == 1)
+ {
+ reps[0] = opt.Backs1;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs2;
+ reps[3] = opt.Backs3;
+ }
+ else if (pos == 2)
+ {
+ reps[0] = opt.Backs2;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs3;
+ }
+ else
+ {
+ reps[0] = opt.Backs3;
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs2;
+ }
+ }
+ else
+ {
+ reps[0] = (pos - Base.kNumRepDistances);
+ reps[1] = opt.Backs0;
+ reps[2] = opt.Backs1;
+ reps[3] = opt.Backs2;
+ }
+ }
+ _optimum[cur].State = state;
+ _optimum[cur].Backs0 = reps[0];
+ _optimum[cur].Backs1 = reps[1];
+ _optimum[cur].Backs2 = reps[2];
+ _optimum[cur].Backs3 = reps[3];
+ int curPrice = _optimum[cur].Price;
+
+ currentByte = _matchFinder.GetIndexByte(0 - 1);
+ matchByte = _matchFinder.GetIndexByte(0 - reps[0] - 1 - 1);
+
+ posState = (position & _posStateMask);
+
+ int curAnd1Price = curPrice +
+ SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(state << Base.kNumPosStatesBitsMax) + posState]) +
+ _literalEncoder.GetSubCoder(position, _matchFinder.GetIndexByte(0 - 2)).
+ GetPrice(!Base.StateIsCharState(state), matchByte, currentByte);
+
+ Optimal nextOptimum = _optimum[cur + 1];
+
+ boolean nextIsChar = false;
+ if (curAnd1Price < nextOptimum.Price)
+ {
+ nextOptimum.Price = curAnd1Price;
+ nextOptimum.PosPrev = cur;
+ nextOptimum.MakeAsChar();
+ nextIsChar = true;
+ }
+
+ matchPrice = curPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state << Base.kNumPosStatesBitsMax) + posState]);
+ repMatchPrice = matchPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep[state]);
+
+ if (matchByte == currentByte &&
+ !(nextOptimum.PosPrev < cur && nextOptimum.BackPrev == 0))
+ {
+ int shortRepPrice = repMatchPrice + GetRepLen1Price(state, posState);
+ if (shortRepPrice <= nextOptimum.Price)
+ {
+ nextOptimum.Price = shortRepPrice;
+ nextOptimum.PosPrev = cur;
+ nextOptimum.MakeAsShortRep();
+ nextIsChar = true;
+ }
+ }
+
+ int numAvailableBytesFull = _matchFinder.GetNumAvailableBytes() + 1;
+ numAvailableBytesFull = Math.min(kNumOpts - 1 - cur, numAvailableBytesFull);
+ numAvailableBytes = numAvailableBytesFull;
+
+ if (numAvailableBytes < 2)
+ continue;
+ if (numAvailableBytes > _numFastBytes)
+ numAvailableBytes = _numFastBytes;
+ if (!nextIsChar && matchByte != currentByte)
+ {
+ // try Literal + rep0
+ int t = Math.min(numAvailableBytesFull - 1, _numFastBytes);
+ int lenTest2 = _matchFinder.GetMatchLen(0, reps[0], t);
+ if (lenTest2 >= 2)
+ {
+ int state2 = Base.StateUpdateChar(state);
+
+ int posStateNext = (position + 1) & _posStateMask;
+ int nextRepMatchPrice = curAnd1Price +
+ SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state2 << Base.kNumPosStatesBitsMax) + posStateNext]) +
+ SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep[state2]);
+ {
+ int offset = cur + 1 + lenTest2;
+ while (lenEnd < offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ int curAndLenPrice = nextRepMatchPrice + GetRepPrice(
+ 0, lenTest2, state2, posStateNext);
+ Optimal optimum = _optimum[offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = false;
+ }
+ }
+ }
+ }
+
+ int startLen = 2; // speed optimization
+
+ for (int repIndex = 0; repIndex < Base.kNumRepDistances; repIndex++)
+ {
+ int lenTest = _matchFinder.GetMatchLen(0 - 1, reps[repIndex], numAvailableBytes);
+ if (lenTest < 2)
+ continue;
+ int lenTestTemp = lenTest;
+ do
+ {
+ while (lenEnd < cur + lenTest)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ int curAndLenPrice = repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState);
+ Optimal optimum = _optimum[cur + lenTest];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur;
+ optimum.BackPrev = repIndex;
+ optimum.Prev1IsChar = false;
+ }
+ }
+ while (--lenTest >= 2);
+ lenTest = lenTestTemp;
+
+ if (repIndex == 0)
+ startLen = lenTest + 1;
+
+ // if (_maxMode)
+ if (lenTest < numAvailableBytesFull)
+ {
+ int t = Math.min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
+ int lenTest2 = _matchFinder.GetMatchLen(lenTest, reps[repIndex], t);
+ if (lenTest2 >= 2)
+ {
+ int state2 = Base.StateUpdateRep(state);
+
+ int posStateNext = (position + lenTest) & _posStateMask;
+ int curAndLenCharPrice =
+ repMatchPrice + GetRepPrice(repIndex, lenTest, state, posState) +
+ SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(state2 << Base.kNumPosStatesBitsMax) + posStateNext]) +
+ _literalEncoder.GetSubCoder(position + lenTest,
+ _matchFinder.GetIndexByte(lenTest - 1 - 1)).GetPrice(true,
+ _matchFinder.GetIndexByte(lenTest - 1 - (reps[repIndex] + 1)),
+ _matchFinder.GetIndexByte(lenTest - 1));
+ state2 = Base.StateUpdateChar(state2);
+ posStateNext = (position + lenTest + 1) & _posStateMask;
+ int nextMatchPrice = curAndLenCharPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state2 << Base.kNumPosStatesBitsMax) + posStateNext]);
+ int nextRepMatchPrice = nextMatchPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep[state2]);
+
+ // for(; lenTest2 >= 2; lenTest2--)
+ {
+ int offset = lenTest + 1 + lenTest2;
+ while (lenEnd < cur + offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ int curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
+ Optimal optimum = _optimum[cur + offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + lenTest + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = true;
+ optimum.PosPrev2 = cur;
+ optimum.BackPrev2 = repIndex;
+ }
+ }
+ }
+ }
+ }
+
+ if (newLen > numAvailableBytes)
+ {
+ newLen = numAvailableBytes;
+ for (numDistancePairs = 0; newLen > _matchDistances[numDistancePairs]; numDistancePairs += 2) ;
+ _matchDistances[numDistancePairs] = newLen;
+ numDistancePairs += 2;
+ }
+ if (newLen >= startLen)
+ {
+ normalMatchPrice = matchPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isRep[state]);
+ while (lenEnd < cur + newLen)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+
+ int offs = 0;
+ while (startLen > _matchDistances[offs])
+ offs += 2;
+
+ for (int lenTest = startLen; ; lenTest++)
+ {
+ int curBack = _matchDistances[offs + 1];
+ int curAndLenPrice = normalMatchPrice + GetPosLenPrice(curBack, lenTest, posState);
+ Optimal optimum = _optimum[cur + lenTest];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur;
+ optimum.BackPrev = curBack + Base.kNumRepDistances;
+ optimum.Prev1IsChar = false;
+ }
+
+ if (lenTest == _matchDistances[offs])
+ {
+ if (lenTest < numAvailableBytesFull)
+ {
+ int t = Math.min(numAvailableBytesFull - 1 - lenTest, _numFastBytes);
+ int lenTest2 = _matchFinder.GetMatchLen(lenTest, curBack, t);
+ if (lenTest2 >= 2)
+ {
+ int state2 = Base.StateUpdateMatch(state);
+
+ int posStateNext = (position + lenTest) & _posStateMask;
+ int curAndLenCharPrice = curAndLenPrice +
+ SevenZip.Compression.RangeCoder.Encoder.GetPrice0(_isMatch[(state2 << Base.kNumPosStatesBitsMax) + posStateNext]) +
+ _literalEncoder.GetSubCoder(position + lenTest,
+ _matchFinder.GetIndexByte(lenTest - 1 - 1)).
+ GetPrice(true,
+ _matchFinder.GetIndexByte(lenTest - (curBack + 1) - 1),
+ _matchFinder.GetIndexByte(lenTest - 1));
+ state2 = Base.StateUpdateChar(state2);
+ posStateNext = (position + lenTest + 1) & _posStateMask;
+ int nextMatchPrice = curAndLenCharPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isMatch[(state2 << Base.kNumPosStatesBitsMax) + posStateNext]);
+ int nextRepMatchPrice = nextMatchPrice + SevenZip.Compression.RangeCoder.Encoder.GetPrice1(_isRep[state2]);
+
+ int offset = lenTest + 1 + lenTest2;
+ while (lenEnd < cur + offset)
+ _optimum[++lenEnd].Price = kIfinityPrice;
+ curAndLenPrice = nextRepMatchPrice + GetRepPrice(0, lenTest2, state2, posStateNext);
+ optimum = _optimum[cur + offset];
+ if (curAndLenPrice < optimum.Price)
+ {
+ optimum.Price = curAndLenPrice;
+ optimum.PosPrev = cur + lenTest + 1;
+ optimum.BackPrev = 0;
+ optimum.Prev1IsChar = true;
+ optimum.Prev2 = true;
+ optimum.PosPrev2 = cur;
+ optimum.BackPrev2 = curBack + Base.kNumRepDistances;
+ }
+ }
+ }
+ offs += 2;
+ if (offs == numDistancePairs)
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ boolean ChangePair(int smallDist, int bigDist)
+ {
+ int kDif = 7;
+ return (smallDist < (1 << (32 - kDif)) && bigDist >= (smallDist << kDif));
+ }
+
+ void WriteEndMarker(int posState) throws IOException
+ {
+ if (!_writeEndMark)
+ return;
+
+ _rangeEncoder.Encode(_isMatch, (_state << Base.kNumPosStatesBitsMax) + posState, 1);
+ _rangeEncoder.Encode(_isRep, _state, 0);
+ _state = Base.StateUpdateMatch(_state);
+ int len = Base.kMatchMinLen;
+ _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ int posSlot = (1 << Base.kNumPosSlotBits) - 1;
+ int lenToPosState = Base.GetLenToPosState(len);
+ _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
+ int footerBits = 30;
+ int posReduced = (1 << footerBits) - 1;
+ _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
+ _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
+ }
+
+ void Flush(int nowPos) throws IOException
+ {
+ ReleaseMFStream();
+ WriteEndMarker(nowPos & _posStateMask);
+ _rangeEncoder.FlushData();
+ _rangeEncoder.FlushStream();
+ }
+
+ public void CodeOneBlock(long[] inSize, long[] outSize, boolean[] finished) throws IOException
+ {
+ inSize[0] = 0;
+ outSize[0] = 0;
+ finished[0] = true;
+
+ if (_inStream != null)
+ {
+ _matchFinder.SetStream(_inStream);
+ _matchFinder.Init();
+ _needReleaseMFStream = true;
+ _inStream = null;
+ }
+
+ if (_finished)
+ return;
+ _finished = true;
+
+
+ long progressPosValuePrev = nowPos64;
+ if (nowPos64 == 0)
+ {
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((int)nowPos64);
+ return;
+ }
+
+ ReadMatchDistances();
+ int posState = (int)(nowPos64) & _posStateMask;
+ _rangeEncoder.Encode(_isMatch, (_state << Base.kNumPosStatesBitsMax) + posState, 0);
+ _state = Base.StateUpdateChar(_state);
+ byte curByte = _matchFinder.GetIndexByte(0 - _additionalOffset);
+ _literalEncoder.GetSubCoder((int)(nowPos64), _previousByte).Encode(_rangeEncoder, curByte);
+ _previousByte = curByte;
+ _additionalOffset--;
+ nowPos64++;
+ }
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((int)nowPos64);
+ return;
+ }
+ while (true)
+ {
+
+ int len = GetOptimum((int)nowPos64);
+ int pos = backRes;
+ int posState = ((int)nowPos64) & _posStateMask;
+ int complexState = (_state << Base.kNumPosStatesBitsMax) + posState;
+ if (len == 1 && pos == -1)
+ {
+ _rangeEncoder.Encode(_isMatch, complexState, 0);
+ byte curByte = _matchFinder.GetIndexByte((int)(0 - _additionalOffset));
+ LiteralEncoder.Encoder2 subCoder = _literalEncoder.GetSubCoder((int)nowPos64, _previousByte);
+ if (!Base.StateIsCharState(_state))
+ {
+ byte matchByte = _matchFinder.GetIndexByte((int)(0 - _repDistances[0] - 1 - _additionalOffset));
+ subCoder.EncodeMatched(_rangeEncoder, matchByte, curByte);
+ }
+ else
+ subCoder.Encode(_rangeEncoder, curByte);
+ _previousByte = curByte;
+ _state = Base.StateUpdateChar(_state);
+ }
+ else
+ {
+ _rangeEncoder.Encode(_isMatch, complexState, 1);
+ if (pos < Base.kNumRepDistances)
+ {
+ _rangeEncoder.Encode(_isRep, _state, 1);
+ if (pos == 0)
+ {
+ _rangeEncoder.Encode(_isRepG0, _state, 0);
+ if (len == 1)
+ _rangeEncoder.Encode(_isRep0Long, complexState, 0);
+ else
+ _rangeEncoder.Encode(_isRep0Long, complexState, 1);
+ }
+ else
+ {
+ _rangeEncoder.Encode(_isRepG0, _state, 1);
+ if (pos == 1)
+ _rangeEncoder.Encode(_isRepG1, _state, 0);
+ else
+ {
+ _rangeEncoder.Encode(_isRepG1, _state, 1);
+ _rangeEncoder.Encode(_isRepG2, _state, pos - 2);
+ }
+ }
+ if (len == 1)
+ _state = Base.StateUpdateShortRep(_state);
+ else
+ {
+ _repMatchLenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ _state = Base.StateUpdateRep(_state);
+ }
+ int distance = _repDistances[pos];
+ if (pos != 0)
+ {
+ for (int i = pos; i >= 1; i--)
+ _repDistances[i] = _repDistances[i - 1];
+ _repDistances[0] = distance;
+ }
+ }
+ else
+ {
+ _rangeEncoder.Encode(_isRep, _state, 0);
+ _state = Base.StateUpdateMatch(_state);
+ _lenEncoder.Encode(_rangeEncoder, len - Base.kMatchMinLen, posState);
+ pos -= Base.kNumRepDistances;
+ int posSlot = GetPosSlot(pos);
+ int lenToPosState = Base.GetLenToPosState(len);
+ _posSlotEncoder[lenToPosState].Encode(_rangeEncoder, posSlot);
+
+ if (posSlot >= Base.kStartPosModelIndex)
+ {
+ int footerBits = (int)((posSlot >> 1) - 1);
+ int baseVal = ((2 | (posSlot & 1)) << footerBits);
+ int posReduced = pos - baseVal;
+
+ if (posSlot < Base.kEndPosModelIndex)
+ BitTreeEncoder.ReverseEncode(_posEncoders,
+ baseVal - posSlot - 1, _rangeEncoder, footerBits, posReduced);
+ else
+ {
+ _rangeEncoder.EncodeDirectBits(posReduced >> Base.kNumAlignBits, footerBits - Base.kNumAlignBits);
+ _posAlignEncoder.ReverseEncode(_rangeEncoder, posReduced & Base.kAlignMask);
+ _alignPriceCount++;
+ }
+ }
+ int distance = pos;
+ for (int i = Base.kNumRepDistances - 1; i >= 1; i--)
+ _repDistances[i] = _repDistances[i - 1];
+ _repDistances[0] = distance;
+ _matchPriceCount++;
+ }
+ _previousByte = _matchFinder.GetIndexByte(len - 1 - _additionalOffset);
+ }
+ _additionalOffset -= len;
+ nowPos64 += len;
+ if (_additionalOffset == 0)
+ {
+ // if (!_fastMode)
+ if (_matchPriceCount >= (1 << 7))
+ FillDistancesPrices();
+ if (_alignPriceCount >= Base.kAlignTableSize)
+ FillAlignPrices();
+ inSize[0] = nowPos64;
+ outSize[0] = _rangeEncoder.GetProcessedSizeAdd();
+ if (_matchFinder.GetNumAvailableBytes() == 0)
+ {
+ Flush((int)nowPos64);
+ return;
+ }
+
+ if (nowPos64 - progressPosValuePrev >= (1 << 12))
+ {
+ _finished = false;
+ finished[0] = false;
+ return;
+ }
+ }
+ }
+ }
+
+ void ReleaseMFStream()
+ {
+ if (_matchFinder != null && _needReleaseMFStream)
+ {
+ _matchFinder.ReleaseStream();
+ _needReleaseMFStream = false;
+ }
+ }
+
+ void SetOutStream(java.io.OutputStream outStream)
+ { _rangeEncoder.SetStream(outStream); }
+ void ReleaseOutStream()
+ { _rangeEncoder.ReleaseStream(); }
+
+ void ReleaseStreams()
+ {
+ ReleaseMFStream();
+ ReleaseOutStream();
+ }
+
+ void SetStreams(java.io.InputStream inStream, java.io.OutputStream outStream,
+ long inSize, long outSize)
+ {
+ _inStream = inStream;
+ _finished = false;
+ Create();
+ SetOutStream(outStream);
+ Init();
+
+ // if (!_fastMode)
+ {
+ FillDistancesPrices();
+ FillAlignPrices();
+ }
+
+ _lenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
+ _lenEncoder.UpdateTables(1 << _posStateBits);
+ _repMatchLenEncoder.SetTableSize(_numFastBytes + 1 - Base.kMatchMinLen);
+ _repMatchLenEncoder.UpdateTables(1 << _posStateBits);
+
+ nowPos64 = 0;
+ }
+
+ long[] processedInSize = new long[1]; long[] processedOutSize = new long[1]; boolean[] finished = new boolean[1];
+ public void Code(java.io.InputStream inStream, java.io.OutputStream outStream,
+ long inSize, long outSize, ICodeProgress progress) throws IOException
+ {
+ _needReleaseMFStream = false;
+ try
+ {
+ SetStreams(inStream, outStream, inSize, outSize);
+ while (true)
+ {
+
+
+
+ CodeOneBlock(processedInSize, processedOutSize, finished);
+ if (finished[0])
+ return;
+ if (progress != null)
+ {
+ progress.SetProgress(processedInSize[0], processedOutSize[0]);
+ }
+ }
+ }
+ finally
+ {
+ ReleaseStreams();
+ }
+ }
+
+ public static final int kPropSize = 5;
+ byte[] properties = new byte[kPropSize];
+
+ public void WriteCoderProperties(java.io.OutputStream outStream) throws IOException
+ {
+ properties[0] = (byte)((_posStateBits * 5 + _numLiteralPosStateBits) * 9 + _numLiteralContextBits);
+ for (int i = 0; i < 4; i++)
+ properties[1 + i] = (byte)(_dictionarySize >> (8 * i));
+ outStream.write(properties, 0, kPropSize);
+ }
+
+ int[] tempPrices = new int[Base.kNumFullDistances];
+ int _matchPriceCount;
+
+ void FillDistancesPrices()
+ {
+ for (int i = Base.kStartPosModelIndex; i < Base.kNumFullDistances; i++)
+ {
+ int posSlot = GetPosSlot(i);
+ int footerBits = (int)((posSlot >> 1) - 1);
+ int baseVal = ((2 | (posSlot & 1)) << footerBits);
+ tempPrices[i] = BitTreeEncoder.ReverseGetPrice(_posEncoders,
+ baseVal - posSlot - 1, footerBits, i - baseVal);
+ }
+
+ for (int lenToPosState = 0; lenToPosState < Base.kNumLenToPosStates; lenToPosState++)
+ {
+ int posSlot;
+ BitTreeEncoder encoder = _posSlotEncoder[lenToPosState];
+
+ int st = (lenToPosState << Base.kNumPosSlotBits);
+ for (posSlot = 0; posSlot < _distTableSize; posSlot++)
+ _posSlotPrices[st + posSlot] = encoder.GetPrice(posSlot);
+ for (posSlot = Base.kEndPosModelIndex; posSlot < _distTableSize; posSlot++)
+ _posSlotPrices[st + posSlot] += ((((posSlot >> 1) - 1) - Base.kNumAlignBits) << SevenZip.Compression.RangeCoder.Encoder.kNumBitPriceShiftBits);
+
+ int st2 = lenToPosState * Base.kNumFullDistances;
+ int i;
+ for (i = 0; i < Base.kStartPosModelIndex; i++)
+ _distancesPrices[st2 + i] = _posSlotPrices[st + i];
+ for (; i < Base.kNumFullDistances; i++)
+ _distancesPrices[st2 + i] = _posSlotPrices[st + GetPosSlot(i)] + tempPrices[i];
+ }
+ _matchPriceCount = 0;
+ }
+
+ void FillAlignPrices()
+ {
+ for (int i = 0; i < Base.kAlignTableSize; i++)
+ _alignPrices[i] = _posAlignEncoder.ReverseGetPrice(i);
+ _alignPriceCount = 0;
+ }
+
+
+ public boolean SetAlgorithm(int algorithm)
+ {
+ /*
+ _fastMode = (algorithm == 0);
+ _maxMode = (algorithm >= 2);
+ */
+ return true;
+ }
+
+ public boolean SetDictionarySize(int dictionarySize)
+ {
+ int kDicLogSizeMaxCompress = 29;
+ if (dictionarySize < (1 << Base.kDicLogSizeMin) || dictionarySize > (1 << kDicLogSizeMaxCompress))
+ return false;
+ _dictionarySize = dictionarySize;
+ int dicLogSize;
+ for (dicLogSize = 0; dictionarySize > (1 << dicLogSize); dicLogSize++) ;
+ _distTableSize = dicLogSize * 2;
+ return true;
+ }
+
+ public boolean SetNumFastBytes(int numFastBytes)
+ {
+ if (numFastBytes < 5 || numFastBytes > Base.kMatchMaxLen)
+ return false;
+ _numFastBytes = numFastBytes;
+ return true;
+ }
+
+ public boolean SetMatchFinder(int matchFinderIndex)
+ {
+ if (matchFinderIndex < 0 || matchFinderIndex > 2)
+ return false;
+ int matchFinderIndexPrev = _matchFinderType;
+ _matchFinderType = matchFinderIndex;
+ if (_matchFinder != null && matchFinderIndexPrev != _matchFinderType)
+ {
+ _dictionarySizePrev = -1;
+ _matchFinder = null;
+ }
+ return true;
+ }
+
+ public boolean SetLcLpPb(int lc, int lp, int pb)
+ {
+ if (
+ lp < 0 || lp > Base.kNumLitPosStatesBitsEncodingMax ||
+ lc < 0 || lc > Base.kNumLitContextBitsMax ||
+ pb < 0 || pb > Base.kNumPosStatesBitsEncodingMax)
+ return false;
+ _numLiteralPosStateBits = lp;
+ _numLiteralContextBits = lc;
+ _posStateBits = pb;
+ _posStateMask = ((1) << _posStateBits) - 1;
+ return true;
+ }
+
+ public void SetEndMarkerMode(boolean endMarkerMode)
+ {
+ _writeEndMark = endMarkerMode;
+ }
+}
+
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java
new file mode 100644
index 0000000000..6864c69cef
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeDecoder.java
@@ -0,0 +1,55 @@
+package SevenZip.Compression.RangeCoder;
+
+public class BitTreeDecoder
+{
+ short[] Models;
+ int NumBitLevels;
+
+ public BitTreeDecoder(int numBitLevels)
+ {
+ NumBitLevels = numBitLevels;
+ Models = new short[1 << numBitLevels];
+ }
+
+ public void Init()
+ {
+ Decoder.InitBitModels(Models);
+ }
+
+ public int Decode(Decoder rangeDecoder) throws java.io.IOException
+ {
+ int m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex != 0; bitIndex--)
+ m = (m << 1) + rangeDecoder.DecodeBit(Models, m);
+ return m - (1 << NumBitLevels);
+ }
+
+ public int ReverseDecode(Decoder rangeDecoder) throws java.io.IOException
+ {
+ int m = 1;
+ int symbol = 0;
+ for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
+ {
+ int bit = rangeDecoder.DecodeBit(Models, m);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << bitIndex);
+ }
+ return symbol;
+ }
+
+ public static int ReverseDecode(short[] Models, int startIndex,
+ Decoder rangeDecoder, int NumBitLevels) throws java.io.IOException
+ {
+ int m = 1;
+ int symbol = 0;
+ for (int bitIndex = 0; bitIndex < NumBitLevels; bitIndex++)
+ {
+ int bit = rangeDecoder.DecodeBit(Models, startIndex + m);
+ m <<= 1;
+ m += bit;
+ symbol |= (bit << bitIndex);
+ }
+ return symbol;
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java
new file mode 100644
index 0000000000..b4c0a0721d
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/BitTreeEncoder.java
@@ -0,0 +1,99 @@
+package SevenZip.Compression.RangeCoder;
+import java.io.IOException;
+
+public class BitTreeEncoder
+{
+ short[] Models;
+ int NumBitLevels;
+
+ public BitTreeEncoder(int numBitLevels)
+ {
+ NumBitLevels = numBitLevels;
+ Models = new short[1 << numBitLevels];
+ }
+
+ public void Init()
+ {
+ Decoder.InitBitModels(Models);
+ }
+
+ public void Encode(Encoder rangeEncoder, int symbol) throws IOException
+ {
+ int m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex != 0; )
+ {
+ bitIndex--;
+ int bit = (symbol >>> bitIndex) & 1;
+ rangeEncoder.Encode(Models, m, bit);
+ m = (m << 1) | bit;
+ }
+ }
+
+ public void ReverseEncode(Encoder rangeEncoder, int symbol) throws IOException
+ {
+ int m = 1;
+ for (int i = 0; i < NumBitLevels; i++)
+ {
+ int bit = symbol & 1;
+ rangeEncoder.Encode(Models, m, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+ }
+
+ public int GetPrice(int symbol)
+ {
+ int price = 0;
+ int m = 1;
+ for (int bitIndex = NumBitLevels; bitIndex != 0; )
+ {
+ bitIndex--;
+ int bit = (symbol >>> bitIndex) & 1;
+ price += Encoder.GetPrice(Models[m], bit);
+ m = (m << 1) + bit;
+ }
+ return price;
+ }
+
+ public int ReverseGetPrice(int symbol)
+ {
+ int price = 0;
+ int m = 1;
+ for (int i = NumBitLevels; i != 0; i--)
+ {
+ int bit = symbol & 1;
+ symbol >>>= 1;
+ price += Encoder.GetPrice(Models[m], bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+ }
+
+ public static int ReverseGetPrice(short[] Models, int startIndex,
+ int NumBitLevels, int symbol)
+ {
+ int price = 0;
+ int m = 1;
+ for (int i = NumBitLevels; i != 0; i--)
+ {
+ int bit = symbol & 1;
+ symbol >>>= 1;
+ price += Encoder.GetPrice(Models[startIndex + m], bit);
+ m = (m << 1) | bit;
+ }
+ return price;
+ }
+
+ public static void ReverseEncode(short[] Models, int startIndex,
+ Encoder rangeEncoder, int NumBitLevels, int symbol) throws IOException
+ {
+ int m = 1;
+ for (int i = 0; i < NumBitLevels; i++)
+ {
+ int bit = symbol & 1;
+ rangeEncoder.Encode(Models, startIndex + m, bit);
+ m = (m << 1) | bit;
+ symbol >>= 1;
+ }
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Decoder.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Decoder.java
new file mode 100644
index 0000000000..7453383483
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Decoder.java
@@ -0,0 +1,88 @@
+package SevenZip.Compression.RangeCoder;
+import java.io.IOException;
+
+public class Decoder
+{
+ static final int kTopMask = ~((1 << 24) - 1);
+
+ static final int kNumBitModelTotalBits = 11;
+ static final int kBitModelTotal = (1 << kNumBitModelTotalBits);
+ static final int kNumMoveBits = 5;
+
+ int Range;
+ int Code;
+
+ java.io.InputStream Stream;
+
+ public final void SetStream(java.io.InputStream stream)
+ {
+ Stream = stream;
+ }
+
+ public final void ReleaseStream()
+ {
+ Stream = null;
+ }
+
+ public final void Init() throws IOException
+ {
+ Code = 0;
+ Range = -1;
+ for (int i = 0; i < 5; i++)
+ Code = (Code << 8) | Stream.read();
+ }
+
+ public final int DecodeDirectBits(int numTotalBits) throws IOException
+ {
+ int result = 0;
+ for (int i = numTotalBits; i != 0; i--)
+ {
+ Range >>>= 1;
+ int t = ((Code - Range) >>> 31);
+ Code -= Range & (t - 1);
+ result = (result << 1) | (1 - t);
+
+ if ((Range & kTopMask) == 0)
+ {
+ Code = (Code << 8) | Stream.read();
+ Range <<= 8;
+ }
+ }
+ return result;
+ }
+
+ public int DecodeBit(short []probs, int index) throws IOException
+ {
+ int prob = probs[index];
+ int newBound = (Range >>> kNumBitModelTotalBits) * prob;
+ if ((Code ^ 0x80000000) < (newBound ^ 0x80000000))
+ {
+ Range = newBound;
+ probs[index] = (short)(prob + ((kBitModelTotal - prob) >>> kNumMoveBits));
+ if ((Range & kTopMask) == 0)
+ {
+ Code = (Code << 8) | Stream.read();
+ Range <<= 8;
+ }
+ return 0;
+ }
+ else
+ {
+ Range -= newBound;
+ Code -= newBound;
+ probs[index] = (short)(prob - ((prob) >>> kNumMoveBits));
+ if ((Range & kTopMask) == 0)
+ {
+ Code = (Code << 8) | Stream.read();
+ Range <<= 8;
+ }
+ return 1;
+ }
+ }
+
+ public static void InitBitModels(short []probs)
+ {
+ for (int i = 0; i < probs.length; i++)
+ probs[i] = (kBitModelTotal >>> 1);
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Encoder.java b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Encoder.java
new file mode 100644
index 0000000000..2273e92e50
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/Compression/RangeCoder/Encoder.java
@@ -0,0 +1,151 @@
+package SevenZip.Compression.RangeCoder;
+import java.io.IOException;
+
+public class Encoder
+{
+ static final int kTopMask = ~((1 << 24) - 1);
+
+ static final int kNumBitModelTotalBits = 11;
+ static final int kBitModelTotal = (1 << kNumBitModelTotalBits);
+ static final int kNumMoveBits = 5;
+
+ java.io.OutputStream Stream;
+
+ long Low;
+ int Range;
+ int _cacheSize;
+ int _cache;
+
+ long _position;
+
+ public void SetStream(java.io.OutputStream stream)
+ {
+ Stream = stream;
+ }
+
+ public void ReleaseStream()
+ {
+ Stream = null;
+ }
+
+ public void Init()
+ {
+ _position = 0;
+ Low = 0;
+ Range = -1;
+ _cacheSize = 1;
+ _cache = 0;
+ }
+
+ public void FlushData() throws IOException
+ {
+ for (int i = 0; i < 5; i++)
+ ShiftLow();
+ }
+
+ public void FlushStream() throws IOException
+ {
+ Stream.flush();
+ }
+
+ public void ShiftLow() throws IOException
+ {
+ int LowHi = (int)(Low >>> 32);
+ if (LowHi != 0 || Low < 0xFF000000L)
+ {
+ _position += _cacheSize;
+ int temp = _cache;
+ do
+ {
+ Stream.write(temp + LowHi);
+ temp = 0xFF;
+ }
+ while(--_cacheSize != 0);
+ _cache = (((int)Low) >>> 24);
+ }
+ _cacheSize++;
+ Low = (Low & 0xFFFFFF) << 8;
+ }
+
+ public void EncodeDirectBits(int v, int numTotalBits) throws IOException
+ {
+ for (int i = numTotalBits - 1; i >= 0; i--)
+ {
+ Range >>>= 1;
+ if (((v >>> i) & 1) == 1)
+ Low += Range;
+ if ((Range & Encoder.kTopMask) == 0)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+ }
+
+
+ public long GetProcessedSizeAdd()
+ {
+ return _cacheSize + _position + 4;
+ }
+
+
+
+ static final int kNumMoveReducingBits = 2;
+ public static final int kNumBitPriceShiftBits = 6;
+
+ public static void InitBitModels(short []probs)
+ {
+ for (int i = 0; i < probs.length; i++)
+ probs[i] = (kBitModelTotal >>> 1);
+ }
+
+ public void Encode(short []probs, int index, int symbol) throws IOException
+ {
+ int prob = probs[index];
+ int newBound = (Range >>> kNumBitModelTotalBits) * prob;
+ if (symbol == 0)
+ {
+ Range = newBound;
+ probs[index] = (short)(prob + ((kBitModelTotal - prob) >>> kNumMoveBits));
+ }
+ else
+ {
+ Low += (newBound & 0xFFFFFFFFL);
+ Range -= newBound;
+ probs[index] = (short)(prob - ((prob) >>> kNumMoveBits));
+ }
+ if ((Range & kTopMask) == 0)
+ {
+ Range <<= 8;
+ ShiftLow();
+ }
+ }
+
+ private static int[] ProbPrices = new int[kBitModelTotal >>> kNumMoveReducingBits];
+
+ static
+ {
+ int kNumBits = (kNumBitModelTotalBits - kNumMoveReducingBits);
+ for (int i = kNumBits - 1; i >= 0; i--)
+ {
+ int start = 1 << (kNumBits - i - 1);
+ int end = 1 << (kNumBits - i);
+ for (int j = start; j < end; j++)
+ ProbPrices[j] = (i << kNumBitPriceShiftBits) +
+ (((end - j) << kNumBitPriceShiftBits) >>> (kNumBits - i - 1));
+ }
+ }
+
+ static public int GetPrice(int Prob, int symbol)
+ {
+ return ProbPrices[(((Prob - symbol) ^ ((-symbol))) & (kBitModelTotal - 1)) >>> kNumMoveReducingBits];
+ }
+ static public int GetPrice0(int Prob)
+ {
+ return ProbPrices[Prob >>> kNumMoveReducingBits];
+ }
+ static public int GetPrice1(int Prob)
+ {
+ return ProbPrices[(kBitModelTotal - Prob) >>> kNumMoveReducingBits];
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/ICodeProgress.java b/other-licenses/7zstub/src/Java/SevenZip/ICodeProgress.java
new file mode 100644
index 0000000000..290bd2d024
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/ICodeProgress.java
@@ -0,0 +1,6 @@
+package SevenZip;
+
+public interface ICodeProgress
+{
+ public void SetProgress(long inSize, long outSize);
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/LzmaAlone.java b/other-licenses/7zstub/src/Java/SevenZip/LzmaAlone.java
new file mode 100644
index 0000000000..de39a22cc2
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/LzmaAlone.java
@@ -0,0 +1,253 @@
+package SevenZip;
+
+public class LzmaAlone
+{
+ static public class CommandLine
+ {
+ public static final int kEncode = 0;
+ public static final int kDecode = 1;
+ public static final int kBenchmak = 2;
+
+ public int Command = -1;
+ public int NumBenchmarkPasses = 10;
+
+ public int DictionarySize = 1 << 23;
+ public boolean DictionarySizeIsDefined = false;
+
+ public int Lc = 3;
+ public int Lp = 0;
+ public int Pb = 2;
+
+ public int Fb = 128;
+ public boolean FbIsDefined = false;
+
+ public boolean Eos = false;
+
+ public int Algorithm = 2;
+ public int MatchFinder = 1;
+
+ public String InFile;
+ public String OutFile;
+
+ boolean ParseSwitch(String s)
+ {
+ if (s.startsWith("d"))
+ {
+ DictionarySize = 1 << Integer.parseInt(s.substring(1));
+ DictionarySizeIsDefined = true;
+ }
+ else if (s.startsWith("fb"))
+ {
+ Fb = Integer.parseInt(s.substring(2));
+ FbIsDefined = true;
+ }
+ else if (s.startsWith("a"))
+ Algorithm = Integer.parseInt(s.substring(1));
+ else if (s.startsWith("lc"))
+ Lc = Integer.parseInt(s.substring(2));
+ else if (s.startsWith("lp"))
+ Lp = Integer.parseInt(s.substring(2));
+ else if (s.startsWith("pb"))
+ Pb = Integer.parseInt(s.substring(2));
+ else if (s.startsWith("eos"))
+ Eos = true;
+ else if (s.startsWith("mf"))
+ {
+ String mfs = s.substring(2);
+ if (mfs.equals("bt2"))
+ MatchFinder = 0;
+ else if (mfs.equals("bt4"))
+ MatchFinder = 1;
+ else if (mfs.equals("bt4b"))
+ MatchFinder = 2;
+ else
+ return false;
+ }
+ else
+ return false;
+ return true;
+ }
+
+ public boolean Parse(String[] args) throws Exception
+ {
+ int pos = 0;
+ boolean switchMode = true;
+ for (int i = 0; i < args.length; i++)
+ {
+ String s = args[i];
+ if (s.length() == 0)
+ return false;
+ if (switchMode)
+ {
+ if (s.compareTo("--") == 0)
+ {
+ switchMode = false;
+ continue;
+ }
+ if (s.charAt(0) == '-')
+ {
+ String sw = s.substring(1).toLowerCase();
+ if (sw.length() == 0)
+ return false;
+ try
+ {
+ if (!ParseSwitch(sw))
+ return false;
+ }
+ catch (NumberFormatException e)
+ {
+ return false;
+ }
+ continue;
+ }
+ }
+ if (pos == 0)
+ {
+ if (s.equalsIgnoreCase("e"))
+ Command = kEncode;
+ else if (s.equalsIgnoreCase("d"))
+ Command = kDecode;
+ else if (s.equalsIgnoreCase("b"))
+ Command = kBenchmak;
+ else
+ return false;
+ }
+ else if(pos == 1)
+ {
+ if (Command == kBenchmak)
+ {
+ try
+ {
+ NumBenchmarkPasses = Integer.parseInt(s);
+ if (NumBenchmarkPasses < 1)
+ return false;
+ }
+ catch (NumberFormatException e)
+ {
+ return false;
+ }
+ }
+ else
+ InFile = s;
+ }
+ else if(pos == 2)
+ OutFile = s;
+ else
+ return false;
+ pos++;
+ continue;
+ }
+ return true;
+ }
+ }
+
+
+ static void PrintHelp()
+ {
+ System.out.println(
+ "\nUsage: LZMA <e|d> [<switches>...] inputFile outputFile\n" +
+ " e: encode file\n" +
+ " d: decode file\n" +
+ " b: Benchmark\n" +
+ "<Switches>\n" +
+ // " -a{N}: set compression mode - [0, 1], default: 1 (max)\n" +
+ " -d{N}: set dictionary - [0,28], default: 23 (8MB)\n" +
+ " -fb{N}: set number of fast bytes - [5, 273], default: 128\n" +
+ " -lc{N}: set number of literal context bits - [0, 8], default: 3\n" +
+ " -lp{N}: set number of literal pos bits - [0, 4], default: 0\n" +
+ " -pb{N}: set number of pos bits - [0, 4], default: 2\n" +
+ " -mf{MF_ID}: set Match Finder: [bt2, bt4], default: bt4\n" +
+ " -eos: write End Of Stream marker\n"
+ );
+ }
+
+ public static void main(String[] args) throws Exception
+ {
+ System.out.println("\nLZMA (Java) 4.61 2008-11-23\n");
+
+ if (args.length < 1)
+ {
+ PrintHelp();
+ return;
+ }
+
+ CommandLine params = new CommandLine();
+ if (!params.Parse(args))
+ {
+ System.out.println("\nIncorrect command");
+ return;
+ }
+
+ if (params.Command == CommandLine.kBenchmak)
+ {
+ int dictionary = (1 << 21);
+ if (params.DictionarySizeIsDefined)
+ dictionary = params.DictionarySize;
+ if (params.MatchFinder > 1)
+ throw new Exception("Unsupported match finder");
+ SevenZip.LzmaBench.LzmaBenchmark(params.NumBenchmarkPasses, dictionary);
+ }
+ else if (params.Command == CommandLine.kEncode || params.Command == CommandLine.kDecode)
+ {
+ java.io.File inFile = new java.io.File(params.InFile);
+ java.io.File outFile = new java.io.File(params.OutFile);
+
+ java.io.BufferedInputStream inStream = new java.io.BufferedInputStream(new java.io.FileInputStream(inFile));
+ java.io.BufferedOutputStream outStream = new java.io.BufferedOutputStream(new java.io.FileOutputStream(outFile));
+
+ boolean eos = false;
+ if (params.Eos)
+ eos = true;
+ if (params.Command == CommandLine.kEncode)
+ {
+ SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();
+ if (!encoder.SetAlgorithm(params.Algorithm))
+ throw new Exception("Incorrect compression mode");
+ if (!encoder.SetDictionarySize(params.DictionarySize))
+ throw new Exception("Incorrect dictionary size");
+ if (!encoder.SetNumFastBytes(params.Fb))
+ throw new Exception("Incorrect -fb value");
+ if (!encoder.SetMatchFinder(params.MatchFinder))
+ throw new Exception("Incorrect -mf value");
+ if (!encoder.SetLcLpPb(params.Lc, params.Lp, params.Pb))
+ throw new Exception("Incorrect -lc or -lp or -pb value");
+ encoder.SetEndMarkerMode(eos);
+ encoder.WriteCoderProperties(outStream);
+ long fileSize;
+ if (eos)
+ fileSize = -1;
+ else
+ fileSize = inFile.length();
+ for (int i = 0; i < 8; i++)
+ outStream.write((int)(fileSize >>> (8 * i)) & 0xFF);
+ encoder.Code(inStream, outStream, -1, -1, null);
+ }
+ else
+ {
+ int propertiesSize = 5;
+ byte[] properties = new byte[propertiesSize];
+ if (inStream.read(properties, 0, propertiesSize) != propertiesSize)
+ throw new Exception("input .lzma file is too short");
+ SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
+ if (!decoder.SetDecoderProperties(properties))
+ throw new Exception("Incorrect stream properties");
+ long outSize = 0;
+ for (int i = 0; i < 8; i++)
+ {
+ int v = inStream.read();
+ if (v < 0)
+ throw new Exception("Can't read stream size");
+ outSize |= ((long)v) << (8 * i);
+ }
+ if (!decoder.Code(inStream, outStream, outSize))
+ throw new Exception("Error in data stream");
+ }
+ outStream.flush();
+ outStream.close();
+ inStream.close();
+ }
+ else
+ throw new Exception("Incorrect command");
+ return;
+ }
+}
diff --git a/other-licenses/7zstub/src/Java/SevenZip/LzmaBench.java b/other-licenses/7zstub/src/Java/SevenZip/LzmaBench.java
new file mode 100644
index 0000000000..cceda24da2
--- /dev/null
+++ b/other-licenses/7zstub/src/Java/SevenZip/LzmaBench.java
@@ -0,0 +1,392 @@
+package SevenZip;
+
+import java.io.ByteArrayOutputStream;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+
+public class LzmaBench
+{
+ static final int kAdditionalSize = (1 << 21);
+ static final int kCompressedAdditionalSize = (1 << 10);
+
+ static class CRandomGenerator
+ {
+ int A1;
+ int A2;
+ public CRandomGenerator() { Init(); }
+ public void Init() { A1 = 362436069; A2 = 521288629; }
+ public int GetRnd()
+ {
+ return
+ ((A1 = 36969 * (A1 & 0xffff) + (A1 >>> 16)) << 16) ^
+ ((A2 = 18000 * (A2 & 0xffff) + (A2 >>> 16)));
+ }
+ };
+
+ static class CBitRandomGenerator
+ {
+ CRandomGenerator RG = new CRandomGenerator();
+ int Value;
+ int NumBits;
+ public void Init()
+ {
+ Value = 0;
+ NumBits = 0;
+ }
+ public int GetRnd(int numBits)
+ {
+ int result;
+ if (NumBits > numBits)
+ {
+ result = Value & ((1 << numBits) - 1);
+ Value >>>= numBits;
+ NumBits -= numBits;
+ return result;
+ }
+ numBits -= NumBits;
+ result = (Value << numBits);
+ Value = RG.GetRnd();
+ result |= Value & (((int)1 << numBits) - 1);
+ Value >>>= numBits;
+ NumBits = 32 - numBits;
+ return result;
+ }
+ };
+
+ static class CBenchRandomGenerator
+ {
+ CBitRandomGenerator RG = new CBitRandomGenerator();
+ int Pos;
+ int Rep0;
+
+ public int BufferSize;
+ public byte[] Buffer = null;
+
+ public CBenchRandomGenerator() { }
+ public void Set(int bufferSize)
+ {
+ Buffer = new byte[bufferSize];
+ Pos = 0;
+ BufferSize = bufferSize;
+ }
+ int GetRndBit() { return RG.GetRnd(1); }
+ int GetLogRandBits(int numBits)
+ {
+ int len = RG.GetRnd(numBits);
+ return RG.GetRnd((int)len);
+ }
+ int GetOffset()
+ {
+ if (GetRndBit() == 0)
+ return GetLogRandBits(4);
+ return (GetLogRandBits(4) << 10) | RG.GetRnd(10);
+ }
+ int GetLen1() { return RG.GetRnd(1 + (int)RG.GetRnd(2)); }
+ int GetLen2() { return RG.GetRnd(2 + (int)RG.GetRnd(2)); }
+ public void Generate()
+ {
+ RG.Init();
+ Rep0 = 1;
+ while (Pos < BufferSize)
+ {
+ if (GetRndBit() == 0 || Pos < 1)
+ Buffer[Pos++] = (byte)(RG.GetRnd(8));
+ else
+ {
+ int len;
+ if (RG.GetRnd(3) == 0)
+ len = 1 + GetLen1();
+ else
+ {
+ do
+ Rep0 = GetOffset();
+ while (Rep0 >= Pos);
+ Rep0++;
+ len = 2 + GetLen2();
+ }
+ for (int i = 0; i < len && Pos < BufferSize; i++, Pos++)
+ Buffer[Pos] = Buffer[Pos - Rep0];
+ }
+ }
+ }
+ };
+
+ static class CrcOutStream extends java.io.OutputStream
+ {
+ public CRC CRC = new CRC();
+
+ public void Init()
+ {
+ CRC.Init();
+ }
+ public int GetDigest()
+ {
+ return CRC.GetDigest();
+ }
+ public void write(byte[] b)
+ {
+ CRC.Update(b);
+ }
+ public void write(byte[] b, int off, int len)
+ {
+ CRC.Update(b, off, len);
+ }
+ public void write(int b)
+ {
+ CRC.UpdateByte(b);
+ }
+ };
+
+ static class MyOutputStream extends java.io.OutputStream
+ {
+ byte[] _buffer;
+ int _size;
+ int _pos;
+
+ public MyOutputStream(byte[] buffer)
+ {
+ _buffer = buffer;
+ _size = _buffer.length;
+ }
+
+ public void reset()
+ {
+ _pos = 0;
+ }
+
+ public void write(int b) throws IOException
+ {
+ if (_pos >= _size)
+ throw new IOException("Error");
+ _buffer[_pos++] = (byte)b;
+ }
+
+ public int size()
+ {
+ return _pos;
+ }
+ };
+
+ static class MyInputStream extends java.io.InputStream
+ {
+ byte[] _buffer;
+ int _size;
+ int _pos;
+
+ public MyInputStream(byte[] buffer, int size)
+ {
+ _buffer = buffer;
+ _size = size;
+ }
+
+ public void reset()
+ {
+ _pos = 0;
+ }
+
+ public int read()
+ {
+ if (_pos >= _size)
+ return -1;
+ return _buffer[_pos++] & 0xFF;
+ }
+ };
+
+ static class CProgressInfo implements ICodeProgress
+ {
+ public long ApprovedStart;
+ public long InSize;
+ public long Time;
+ public void Init()
+ { InSize = 0; }
+ public void SetProgress(long inSize, long outSize)
+ {
+ if (inSize >= ApprovedStart && InSize == 0)
+ {
+ Time = System.currentTimeMillis();
+ InSize = inSize;
+ }
+ }
+ }
+ static final int kSubBits = 8;
+
+ static int GetLogSize(int size)
+ {
+ for (int i = kSubBits; i < 32; i++)
+ for (int j = 0; j < (1 << kSubBits); j++)
+ if (size <= ((1) << i) + (j << (i - kSubBits)))
+ return (i << kSubBits) + j;
+ return (32 << kSubBits);
+ }
+
+ static long MyMultDiv64(long value, long elapsedTime)
+ {
+ long freq = 1000; // ms
+ long elTime = elapsedTime;
+ while (freq > 1000000)
+ {
+ freq >>>= 1;
+ elTime >>>= 1;
+ }
+ if (elTime == 0)
+ elTime = 1;
+ return value * freq / elTime;
+ }
+
+ static long GetCompressRating(int dictionarySize, long elapsedTime, long size)
+ {
+ long t = GetLogSize(dictionarySize) - (18 << kSubBits);
+ long numCommandsForOne = 1060 + ((t * t * 10) >> (2 * kSubBits));
+ long numCommands = (long)(size) * numCommandsForOne;
+ return MyMultDiv64(numCommands, elapsedTime);
+ }
+
+ static long GetDecompressRating(long elapsedTime, long outSize, long inSize)
+ {
+ long numCommands = inSize * 220 + outSize * 20;
+ return MyMultDiv64(numCommands, elapsedTime);
+ }
+
+ static long GetTotalRating(
+ int dictionarySize,
+ long elapsedTimeEn, long sizeEn,
+ long elapsedTimeDe,
+ long inSizeDe, long outSizeDe)
+ {
+ return (GetCompressRating(dictionarySize, elapsedTimeEn, sizeEn) +
+ GetDecompressRating(elapsedTimeDe, inSizeDe, outSizeDe)) / 2;
+ }
+
+ static void PrintValue(long v)
+ {
+ String s = "";
+ s += v;
+ for (int i = 0; i + s.length() < 6; i++)
+ System.out.print(" ");
+ System.out.print(s);
+ }
+
+ static void PrintRating(long rating)
+ {
+ PrintValue(rating / 1000000);
+ System.out.print(" MIPS");
+ }
+
+ static void PrintResults(
+ int dictionarySize,
+ long elapsedTime,
+ long size,
+ boolean decompressMode, long secondSize)
+ {
+ long speed = MyMultDiv64(size, elapsedTime);
+ PrintValue(speed / 1024);
+ System.out.print(" KB/s ");
+ long rating;
+ if (decompressMode)
+ rating = GetDecompressRating(elapsedTime, size, secondSize);
+ else
+ rating = GetCompressRating(dictionarySize, elapsedTime, size);
+ PrintRating(rating);
+ }
+
+ static public int LzmaBenchmark(int numIterations, int dictionarySize) throws Exception
+ {
+ if (numIterations <= 0)
+ return 0;
+ if (dictionarySize < (1 << 18))
+ {
+ System.out.println("\nError: dictionary size for benchmark must be >= 18 (256 KB)");
+ return 1;
+ }
+ System.out.print("\n Compressing Decompressing\n\n");
+
+ SevenZip.Compression.LZMA.Encoder encoder = new SevenZip.Compression.LZMA.Encoder();
+ SevenZip.Compression.LZMA.Decoder decoder = new SevenZip.Compression.LZMA.Decoder();
+
+ if (!encoder.SetDictionarySize(dictionarySize))
+ throw new Exception("Incorrect dictionary size");
+
+ int kBufferSize = dictionarySize + kAdditionalSize;
+ int kCompressedBufferSize = (kBufferSize / 2) + kCompressedAdditionalSize;
+
+ ByteArrayOutputStream propStream = new ByteArrayOutputStream();
+ encoder.WriteCoderProperties(propStream);
+ byte[] propArray = propStream.toByteArray();
+ decoder.SetDecoderProperties(propArray);
+
+ CBenchRandomGenerator rg = new CBenchRandomGenerator();
+
+ rg.Set(kBufferSize);
+ rg.Generate();
+ CRC crc = new CRC();
+ crc.Init();
+ crc.Update(rg.Buffer, 0, rg.BufferSize);
+
+ CProgressInfo progressInfo = new CProgressInfo();
+ progressInfo.ApprovedStart = dictionarySize;
+
+ long totalBenchSize = 0;
+ long totalEncodeTime = 0;
+ long totalDecodeTime = 0;
+ long totalCompressedSize = 0;
+
+ MyInputStream inStream = new MyInputStream(rg.Buffer, rg.BufferSize);
+
+ byte[] compressedBuffer = new byte[kCompressedBufferSize];
+ MyOutputStream compressedStream = new MyOutputStream(compressedBuffer);
+ CrcOutStream crcOutStream = new CrcOutStream();
+ MyInputStream inputCompressedStream = null;
+ int compressedSize = 0;
+ for (int i = 0; i < numIterations; i++)
+ {
+ progressInfo.Init();
+ inStream.reset();
+ compressedStream.reset();
+ encoder.Code(inStream, compressedStream, -1, -1, progressInfo);
+ long encodeTime = System.currentTimeMillis() - progressInfo.Time;
+
+ if (i == 0)
+ {
+ compressedSize = compressedStream.size();
+ inputCompressedStream = new MyInputStream(compressedBuffer, compressedSize);
+ }
+ else if (compressedSize != compressedStream.size())
+ throw (new Exception("Encoding error"));
+
+ if (progressInfo.InSize == 0)
+ throw (new Exception("Internal ERROR 1282"));
+
+ long decodeTime = 0;
+ for (int j = 0; j < 2; j++)
+ {
+ inputCompressedStream.reset();
+ crcOutStream.Init();
+
+ long outSize = kBufferSize;
+ long startTime = System.currentTimeMillis();
+ if (!decoder.Code(inputCompressedStream, crcOutStream, outSize))
+ throw (new Exception("Decoding Error"));;
+ decodeTime = System.currentTimeMillis() - startTime;
+ if (crcOutStream.GetDigest() != crc.GetDigest())
+ throw (new Exception("CRC Error"));
+ }
+ long benchSize = kBufferSize - (long)progressInfo.InSize;
+ PrintResults(dictionarySize, encodeTime, benchSize, false, 0);
+ System.out.print(" ");
+ PrintResults(dictionarySize, decodeTime, kBufferSize, true, compressedSize);
+ System.out.println();
+
+ totalBenchSize += benchSize;
+ totalEncodeTime += encodeTime;
+ totalDecodeTime += decodeTime;
+ totalCompressedSize += compressedSize;
+ }
+ System.out.println("---------------------------------------------------");
+ PrintResults(dictionarySize, totalEncodeTime, totalBenchSize, false, 0);
+ System.out.print(" ");
+ PrintResults(dictionarySize, totalDecodeTime,
+ kBufferSize * (long)numIterations, true, totalCompressedSize);
+ System.out.println(" Average");
+ return 0;
+ }
+}
diff --git a/other-licenses/7zstub/src/Windows/COM.cpp b/other-licenses/7zstub/src/Windows/COM.cpp
deleted file mode 100644
index f7ed066ae7..0000000000
--- a/other-licenses/7zstub/src/Windows/COM.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// Windows/COM.cpp
-
-#include "StdAfx.h"
-
-#include "Windows/COM.h"
-#include "Common/StringConvert.h"
-
-namespace NWindows {
-namespace NCOM {
-
-// CoInitialize (NULL); must be called!
-
-UString GUIDToStringW(REFGUID guid)
-{
- UString string;
- const int kStringSize = 48;
- StringFromGUID2(guid, string.GetBuffer(kStringSize), kStringSize);
- string.ReleaseBuffer();
- return string;
-}
-
-AString GUIDToStringA(REFGUID guid)
-{
- return UnicodeStringToMultiByte(GUIDToStringW(guid));
-}
-
-HRESULT StringToGUIDW(const wchar_t *string, GUID &classID)
-{
- return CLSIDFromString((wchar_t *)string, &classID);
-}
-
-HRESULT StringToGUIDA(const char *string, GUID &classID)
-{
- return StringToGUIDW(MultiByteToUnicodeString(string), classID);
-}
-
-}} \ No newline at end of file
diff --git a/other-licenses/7zstub/src/Windows/COM.h b/other-licenses/7zstub/src/Windows/COM.h
deleted file mode 100644
index b0890c6c40..0000000000
--- a/other-licenses/7zstub/src/Windows/COM.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Windows/COM.h
-
-#ifndef __WINDOWS_COM_H
-#define __WINDOWS_COM_H
-
-#include "Common/String.h"
-
-namespace NWindows {
-namespace NCOM {
-
-class CComInitializer
-{
-public:
- CComInitializer() { CoInitialize(NULL);};
- ~CComInitializer() { CoUninitialize(); };
-};
-
-class CStgMedium
-{
- STGMEDIUM _object;
-public:
- bool _mustBeReleased;
- CStgMedium(): _mustBeReleased(false) {}
- ~CStgMedium() { Free(); }
- void Free()
- {
- if(_mustBeReleased)
- ReleaseStgMedium(&_object);
- _mustBeReleased = false;
- }
- const STGMEDIUM* operator->() const { return &_object;}
- STGMEDIUM* operator->() { return &_object;}
- STGMEDIUM* operator&() { return &_object; }
-};
-
-//////////////////////////////////
-// GUID <--> String Conversions
-UString GUIDToStringW(REFGUID guid);
-AString GUIDToStringA(REFGUID guid);
-#ifdef UNICODE
- #define GUIDToString GUIDToStringW
-#else
- #define GUIDToString GUIDToStringA
-#endif // !UNICODE
-
-HRESULT StringToGUIDW(const wchar_t *string, GUID &classID);
-HRESULT StringToGUIDA(const char *string, GUID &classID);
-#ifdef UNICODE
- #define StringToGUID StringToGUIDW
-#else
- #define StringToGUID StringToGUIDA
-#endif // !UNICODE
-
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Control/Dialog.cpp b/other-licenses/7zstub/src/Windows/Control/Dialog.cpp
deleted file mode 100644
index 9d9891f512..0000000000
--- a/other-licenses/7zstub/src/Windows/Control/Dialog.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-// Windows/Control/Dialog.cpp
-
-#include "StdAfx.h"
-
-#ifndef _UNICODE
-#include "Common/StringConvert.h"
-#endif
-#include "Windows/Control/Dialog.h"
-
-extern HINSTANCE g_hInstance;
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-namespace NControl {
-
-static INT_PTR APIENTRY DialogProcedure(HWND dialogHWND, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- CWindow dialogTmp(dialogHWND);
- if (message == WM_INITDIALOG)
- dialogTmp.SetUserDataLongPtr(lParam);
- CDialog *dialog = (CDialog *)(dialogTmp.GetUserDataLongPtr());
- if (dialog == NULL)
- return FALSE;
- if (message == WM_INITDIALOG)
- dialog->Attach(dialogHWND);
-
- return BoolToBOOL(dialog->OnMessage(message, wParam, lParam));
-}
-
-bool CDialog::OnMessage(UINT message, WPARAM wParam, LPARAM lParam)
-{
- switch (message)
- {
- case WM_INITDIALOG:
- return OnInit();
- case WM_COMMAND:
- return OnCommand(wParam, lParam);
- case WM_NOTIFY:
- return OnNotify(wParam, (LPNMHDR) lParam);
- case WM_HELP:
- {
- OnHelp((LPHELPINFO)lParam);
- return true;
- }
- case WM_TIMER:
- {
- return OnTimer(wParam, lParam);
- }
- default:
- return false;
- }
-}
-
-bool CDialog::OnCommand(WPARAM wParam, LPARAM lParam)
-{
- return OnCommand(HIWORD(wParam), LOWORD(wParam), lParam);
-}
-
-bool CDialog::OnCommand(int code, int itemID, LPARAM lParam)
-{
- if (code == BN_CLICKED)
- return OnButtonClicked(itemID, (HWND)lParam);
- return false;
-}
-
-bool CDialog::OnButtonClicked(int buttonID, HWND buttonHWND)
-{
- switch(buttonID)
- {
- case IDOK:
- OnOK();
- break;
- case IDCANCEL:
- OnCancel();
- break;
- case IDHELP:
- OnHelp();
- break;
- default:
- return false;
- }
- return true;
-}
-
-bool CModelessDialog::Create(LPCTSTR templateName, HWND parentWindow)
-{
- HWND aHWND = CreateDialogParam(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
- if (aHWND == 0)
- return false;
- Attach(aHWND);
- return true;
-}
-
-INT_PTR CModalDialog::Create(LPCTSTR templateName, HWND parentWindow)
-{
- return DialogBoxParam(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
-}
-
-#ifndef _UNICODE
-
-bool CModelessDialog::Create(LPCWSTR templateName, HWND parentWindow)
-{
- HWND aHWND;
- if (g_IsNT)
- aHWND = CreateDialogParamW(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
- else
- {
- AString name;
- LPCSTR templateNameA;
- if (IS_INTRESOURCE(templateName))
- templateNameA = (LPCSTR)templateName;
- else
- {
- name = GetSystemString(templateName);
- templateNameA = name;
- }
- aHWND = CreateDialogParamA(g_hInstance, templateNameA, parentWindow, DialogProcedure, (LPARAM)this);
- }
- if (aHWND == 0)
- return false;
- Attach(aHWND);
- return true;
-}
-
-INT_PTR CModalDialog::Create(LPCWSTR templateName, HWND parentWindow)
-{
- if (g_IsNT)
- return DialogBoxParamW(g_hInstance, templateName, parentWindow, DialogProcedure, (LPARAM)this);
- AString name;
- LPCSTR templateNameA;
- if (IS_INTRESOURCE(templateName))
- templateNameA = (LPCSTR)templateName;
- else
- {
- name = GetSystemString(templateName);
- templateNameA = name;
- }
- return DialogBoxParamA(g_hInstance, templateNameA, parentWindow, DialogProcedure, (LPARAM)this);
-}
-#endif
-
-}}
diff --git a/other-licenses/7zstub/src/Windows/Control/Dialog.h b/other-licenses/7zstub/src/Windows/Control/Dialog.h
deleted file mode 100644
index 2c78efcbac..0000000000
--- a/other-licenses/7zstub/src/Windows/Control/Dialog.h
+++ /dev/null
@@ -1,141 +0,0 @@
-// Windows/Control/Dialog.h
-
-#ifndef __WINDOWS_CONTROL_DIALOG_H
-#define __WINDOWS_CONTROL_DIALOG_H
-
-#include "Windows/Window.h"
-#include "Windows/Defs.h"
-
-namespace NWindows {
-namespace NControl {
-
-class CDialog: public CWindow
-{
-public:
- CDialog(HWND wndow = NULL): CWindow(wndow){};
- virtual ~CDialog() {};
-
- HWND GetItem(int itemID) const
- { return GetDlgItem(_window, itemID); }
-
- bool EnableItem(int itemID, bool enable) const
- { return BOOLToBool(::EnableWindow(GetItem(itemID), BoolToBOOL(enable))); }
-
- bool SetItemText(int itemID, LPCTSTR s)
- { return BOOLToBool(SetDlgItemText(_window, itemID, s)); }
-
- #ifndef _UNICODE
- bool SetItemText(int itemID, LPCWSTR s)
- {
- CWindow window(GetItem(itemID));
- return window.SetText(s);
- }
- #endif
-
- UINT GetItemText(int itemID, LPTSTR string, int maxCount)
- { return GetDlgItemText(_window, itemID, string, maxCount); }
- #ifndef _UNICODE
- /*
- bool GetItemText(int itemID, LPWSTR string, int maxCount)
- {
- CWindow window(GetItem(itemID));
- return window.GetText(string, maxCount);
- }
- */
- #endif
-
- bool SetItemInt(int itemID, UINT value, bool isSigned)
- { return BOOLToBool(SetDlgItemInt(_window, itemID, value, BoolToBOOL(isSigned))); }
- bool GetItemInt(int itemID, bool isSigned, UINT &value)
- {
- BOOL result;
- value = GetDlgItemInt(_window, itemID, &result, BoolToBOOL(isSigned));
- return BOOLToBool(result);
- }
-
- HWND GetNextGroupItem(HWND control, bool previous)
- { return GetNextDlgGroupItem(_window, control, BoolToBOOL(previous)); }
- HWND GetNextTabItem(HWND control, bool previous)
- { return GetNextDlgTabItem(_window, control, BoolToBOOL(previous)); }
-
- bool MapRect(LPRECT rect)
- { return BOOLToBool(MapDialogRect(_window, rect)); }
-
- bool IsMessage(LPMSG message)
- { return BOOLToBool(IsDialogMessage(_window, message)); }
-
- LRESULT SendItemMessage(int itemID, UINT message, WPARAM wParam, LPARAM lParam)
- { return SendDlgItemMessage(_window, itemID, message, wParam, lParam); }
-
- bool CheckButton(int buttonID, UINT checkState)
- { return BOOLToBool(CheckDlgButton(_window, buttonID, checkState)); }
- bool CheckButton(int buttonID, bool checkState)
- { return CheckButton(buttonID, UINT(checkState ? BST_CHECKED : BST_UNCHECKED)); }
-
- UINT IsButtonChecked(int buttonID) const
- { return IsDlgButtonChecked(_window, buttonID); }
- bool IsButtonCheckedBool(int buttonID) const
- { return (IsButtonChecked(buttonID) == BST_CHECKED); }
-
- bool CheckRadioButton(int firstButtonID, int lastButtonID, int checkButtonID)
- { return BOOLToBool(::CheckRadioButton(_window, firstButtonID, lastButtonID, checkButtonID)); }
-
- virtual bool OnMessage(UINT message, WPARAM wParam, LPARAM lParam);
- virtual bool OnInit() { return true; }
- virtual bool OnCommand(WPARAM wParam, LPARAM lParam);
- virtual bool OnCommand(int code, int itemID, LPARAM lParam);
- virtual void OnHelp(LPHELPINFO helpInfo) { OnHelp(); };
- virtual void OnHelp() {};
- virtual bool OnButtonClicked(int buttonID, HWND buttonHWND);
- virtual void OnOK() {};
- virtual void OnCancel() {};
- virtual bool OnNotify(UINT controlID, LPNMHDR lParam) { return false; }
- virtual bool OnTimer(WPARAM timerID, LPARAM callback) { return false; }
-
- LONG_PTR SetMsgResult(LONG_PTR newLongPtr )
- { return SetLongPtr(DWLP_MSGRESULT, newLongPtr); }
- LONG_PTR GetMsgResult() const
- { return GetLongPtr(DWLP_MSGRESULT); }
-};
-
-class CModelessDialog: public CDialog
-{
-public:
- bool Create(LPCTSTR templateName, HWND parentWindow);
- #ifndef _UNICODE
- bool Create(LPCWSTR templateName, HWND parentWindow);
- #endif
- virtual void OnOK() { Destroy(); }
- virtual void OnCancel() { Destroy(); }
-};
-
-class CModalDialog: public CDialog
-{
-public:
- INT_PTR Create(LPCTSTR templateName, HWND parentWindow);
- INT_PTR Create(UINT resID, HWND parentWindow)
- { return Create(MAKEINTRESOURCEW(resID), parentWindow); }
- #ifndef _UNICODE
- INT_PTR Create(LPCWSTR templateName, HWND parentWindow);
- #endif
-
- bool End(INT_PTR result)
- { return BOOLToBool(::EndDialog(_window, result)); }
- virtual void OnOK() { End(IDOK); }
- virtual void OnCancel() { End(IDCANCEL); }
-};
-
-class CDialogChildControl: public NWindows::CWindow
-{
-public:
- int m_ID;
- void Init(const NWindows::NControl::CDialog &parentDialog, int id)
- {
- m_ID = id;
- Attach(parentDialog.GetItem(id));
- }
-};
-
-}}
-
-#endif \ No newline at end of file
diff --git a/other-licenses/7zstub/src/Windows/Control/ProgressBar.h b/other-licenses/7zstub/src/Windows/Control/ProgressBar.h
deleted file mode 100644
index 682bab7043..0000000000
--- a/other-licenses/7zstub/src/Windows/Control/ProgressBar.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Windows/Control/ProgressBar.h
-
-#ifndef __WINDOWS_CONTROL_PROGRESSBAR_H
-#define __WINDOWS_CONTROL_PROGRESSBAR_H
-
-#include "Windows/Window.h"
-#include "Windows/Defs.h"
-
-namespace NWindows {
-namespace NControl {
-
-class CProgressBar: public CWindow
-{
-public:
- LRESULT SetPos(int pos)
- { return SendMessage(PBM_SETPOS, pos, 0); }
- LRESULT DeltaPos(int increment)
- { return SendMessage(PBM_DELTAPOS, increment, 0); }
- UINT GetPos()
- { return SendMessage(PBM_GETPOS, 0, 0); }
- LRESULT SetRange(unsigned short minValue, unsigned short maxValue)
- { return SendMessage(PBM_SETRANGE, 0, MAKELPARAM(minValue, maxValue)); }
- DWORD SetRange32(int minValue, int maxValue)
- { return SendMessage(PBM_SETRANGE32, minValue, maxValue); }
- int SetStep(int aStep)
- { return SendMessage(PBM_SETSTEP, aStep, 0); }
- int StepIt()
- { return SendMessage(PBM_STEPIT, 0, 0); }
-
- int GetRange(bool minValue, PPBRANGE range)
- { return SendMessage(PBM_GETRANGE, BoolToBOOL(minValue), (LPARAM)range); }
-
- COLORREF SetBarColor(COLORREF color)
- { return SendMessage(PBM_SETBARCOLOR, 0, color); }
- COLORREF SetBackgroundColor(COLORREF color)
- { return SendMessage(PBM_SETBKCOLOR, 0, color); }
-};
-
-}}
-
-#endif \ No newline at end of file
diff --git a/other-licenses/7zstub/src/Windows/DLL.cpp b/other-licenses/7zstub/src/Windows/DLL.cpp
deleted file mode 100644
index b5aca7098d..0000000000
--- a/other-licenses/7zstub/src/Windows/DLL.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-// Windows/DLL.cpp
-
-#include "StdAfx.h"
-
-#include "DLL.h"
-#include "Defs.h"
-#ifndef _UNICODE
-#include "../Common/StringConvert.h"
-#endif
-
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-namespace NDLL {
-
-CLibrary::~CLibrary()
-{
- Free();
-}
-
-bool CLibrary::Free()
-{
- if (_module == 0)
- return true;
- // MessageBox(0, TEXT(""), TEXT("Free"), 0);
- // Sleep(5000);
- if (!::FreeLibrary(_module))
- return false;
- _module = 0;
- return true;
-}
-
-bool CLibrary::LoadOperations(HMODULE newModule)
-{
- if (newModule == NULL)
- return false;
- if(!Free())
- return false;
- _module = newModule;
- return true;
-}
-
-bool CLibrary::LoadEx(LPCTSTR fileName, DWORD flags)
-{
- // MessageBox(0, fileName, TEXT("LoadEx"), 0);
- return LoadOperations(::LoadLibraryEx(fileName, NULL, flags));
-}
-
-bool CLibrary::Load(LPCTSTR fileName)
-{
- // MessageBox(0, fileName, TEXT("Load"), 0);
- // Sleep(5000);
- // OutputDebugString(fileName);
- // OutputDebugString(TEXT("\n"));
- return LoadOperations(::LoadLibrary(fileName));
-}
-
-#ifndef _UNICODE
-static inline UINT GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
-CSysString GetSysPath(LPCWSTR sysPath)
- { return UnicodeStringToMultiByte(sysPath, GetCurrentCodePage()); }
-
-bool CLibrary::LoadEx(LPCWSTR fileName, DWORD flags)
-{
- if (g_IsNT)
- return LoadOperations(::LoadLibraryExW(fileName, NULL, flags));
- return LoadEx(GetSysPath(fileName), flags);
-}
-bool CLibrary::Load(LPCWSTR fileName)
-{
- if (g_IsNT)
- return LoadOperations(::LoadLibraryW(fileName));
- return Load(GetSysPath(fileName));
-}
-#endif
-
-bool MyGetModuleFileName(HMODULE hModule, CSysString &result)
-{
- result.Empty();
- TCHAR fullPath[MAX_PATH + 2];
- DWORD size = ::GetModuleFileName(hModule, fullPath, MAX_PATH + 1);
- if (size <= MAX_PATH && size != 0)
- {
- result = fullPath;
- return true;
- }
- return false;
-}
-
-#ifndef _UNICODE
-bool MyGetModuleFileName(HMODULE hModule, UString &result)
-{
- result.Empty();
- if (g_IsNT)
- {
- wchar_t fullPath[MAX_PATH + 2];
- DWORD size = ::GetModuleFileNameW(hModule, fullPath, MAX_PATH + 1);
- if (size <= MAX_PATH && size != 0)
- {
- result = fullPath;
- return true;
- }
- return false;
- }
- CSysString resultSys;
- if (!MyGetModuleFileName(hModule, resultSys))
- return false;
- result = MultiByteToUnicodeString(resultSys, GetCurrentCodePage());
- return true;
-}
-#endif
-
-}}
diff --git a/other-licenses/7zstub/src/Windows/DLL.h b/other-licenses/7zstub/src/Windows/DLL.h
deleted file mode 100644
index 6e60369661..0000000000
--- a/other-licenses/7zstub/src/Windows/DLL.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Windows/DLL.h
-
-#ifndef __WINDOWS_DLL_H
-#define __WINDOWS_DLL_H
-
-#include "../Common/String.h"
-
-namespace NWindows {
-namespace NDLL {
-
-class CLibrary
-{
- bool LoadOperations(HMODULE newModule);
-protected:
- HMODULE _module;
-public:
- operator HMODULE() const { return _module; }
- HMODULE* operator&() { return &_module; }
-
- CLibrary():_module(NULL) {};
- ~CLibrary();
- void Attach(HMODULE m)
- {
- Free();
- _module = m;
- }
- HMODULE Detach()
- {
- HMODULE m = _module;
- _module = NULL;
- return m;
- }
-
- // operator HMODULE() const { return _module; };
- // bool IsLoaded() const { return (_module != NULL); };
- bool Free();
- bool LoadEx(LPCTSTR fileName, DWORD flags = LOAD_LIBRARY_AS_DATAFILE);
- bool Load(LPCTSTR fileName);
- #ifndef _UNICODE
- bool LoadEx(LPCWSTR fileName, DWORD flags = LOAD_LIBRARY_AS_DATAFILE);
- bool Load(LPCWSTR fileName);
- #endif
- FARPROC GetProcAddress(LPCSTR procName) const
- { return ::GetProcAddress(_module, procName); }
-};
-
-bool MyGetModuleFileName(HMODULE hModule, CSysString &result);
-#ifndef _UNICODE
-bool MyGetModuleFileName(HMODULE hModule, UString &result);
-#endif
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Defs.h b/other-licenses/7zstub/src/Windows/Defs.h
deleted file mode 100644
index 1b0c97a52d..0000000000
--- a/other-licenses/7zstub/src/Windows/Defs.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// Windows/Defs.h
-
-#ifndef __WINDOWS_DEFS_H
-#define __WINDOWS_DEFS_H
-
-inline bool BOOLToBool(BOOL value)
- { return (value != FALSE); }
-
-inline BOOL BoolToBOOL(bool value)
- { return (value ? TRUE: FALSE); }
-
-inline VARIANT_BOOL BoolToVARIANT_BOOL(bool value)
- { return (value ? VARIANT_TRUE: VARIANT_FALSE); }
-
-inline bool VARIANT_BOOLToBool(VARIANT_BOOL value)
- { return (value != VARIANT_FALSE); }
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Error.cpp b/other-licenses/7zstub/src/Windows/Error.cpp
deleted file mode 100644
index a361a49657..0000000000
--- a/other-licenses/7zstub/src/Windows/Error.cpp
+++ /dev/null
@@ -1,50 +0,0 @@
-// Windows/Error.h
-
-#include "StdAfx.h"
-
-#include "Windows/Error.h"
-#ifndef _UNICODE
-#include "Common/StringConvert.h"
-#endif
-
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-namespace NError {
-
-bool MyFormatMessage(DWORD messageID, CSysString &message)
-{
- LPVOID msgBuf;
- if(::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,messageID, 0, (LPTSTR) &msgBuf,0, NULL) == 0)
- return false;
- message = (LPCTSTR)msgBuf;
- ::LocalFree(msgBuf);
- return true;
-}
-
-#ifndef _UNICODE
-bool MyFormatMessage(DWORD messageID, UString &message)
-{
- if (g_IsNT)
- {
- LPVOID msgBuf;
- if(::FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL, messageID, 0, (LPWSTR) &msgBuf, 0, NULL) == 0)
- return false;
- message = (LPCWSTR)msgBuf;
- ::LocalFree(msgBuf);
- return true;
- }
- CSysString messageSys;
- bool result = MyFormatMessage(messageID, messageSys);
- message = GetUnicodeString(messageSys);
- return result;
-}
-#endif
-
-}}
diff --git a/other-licenses/7zstub/src/Windows/Error.h b/other-licenses/7zstub/src/Windows/Error.h
deleted file mode 100644
index de6ed20793..0000000000
--- a/other-licenses/7zstub/src/Windows/Error.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Windows/Error.h
-
-#ifndef __WINDOWS_ERROR_H
-#define __WINDOWS_ERROR_H
-
-#include "Common/String.h"
-
-namespace NWindows {
-namespace NError {
-
-bool MyFormatMessage(DWORD messageID, CSysString &message);
-inline CSysString MyFormatMessage(DWORD messageID)
-{
- CSysString message;
- MyFormatMessage(messageID, message);
- return message;
-}
-#ifdef _UNICODE
-inline UString MyFormatMessageW(DWORD messageID)
- { return MyFormatMessage(messageID); }
-#else
-bool MyFormatMessage(DWORD messageID, UString &message);
-inline UString MyFormatMessageW(DWORD messageID)
-{
- UString message;
- MyFormatMessage(messageID, message);
- return message;
-}
-#endif
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/FileDir.cpp b/other-licenses/7zstub/src/Windows/FileDir.cpp
deleted file mode 100644
index 5023172ab6..0000000000
--- a/other-licenses/7zstub/src/Windows/FileDir.cpp
+++ /dev/null
@@ -1,672 +0,0 @@
-// Windows/FileDir.cpp
-
-#include "StdAfx.h"
-
-#include "FileDir.h"
-#include "FileName.h"
-#include "FileFind.h"
-#include "Defs.h"
-#ifndef _UNICODE
-#include "../Common/StringConvert.h"
-#endif
-
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-namespace NFile {
-namespace NDirectory {
-
-#ifndef _UNICODE
-static inline UINT GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
-static UString GetUnicodePath(const CSysString &sysPath)
- { return MultiByteToUnicodeString(sysPath, GetCurrentCodePage()); }
-static CSysString GetSysPath(LPCWSTR sysPath)
- { return UnicodeStringToMultiByte(sysPath, GetCurrentCodePage()); }
-#endif
-
-bool MyGetWindowsDirectory(CSysString &path)
-{
- UINT needLength = ::GetWindowsDirectory(path.GetBuffer(MAX_PATH + 1), MAX_PATH + 1);
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
-}
-
-bool MyGetSystemDirectory(CSysString &path)
-{
- UINT needLength = ::GetSystemDirectory(path.GetBuffer(MAX_PATH + 1), MAX_PATH + 1);
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
-}
-
-#ifndef _UNICODE
-bool MyGetWindowsDirectory(UString &path)
-{
- if (g_IsNT)
- {
- UINT needLength = ::GetWindowsDirectoryW(path.GetBuffer(MAX_PATH + 1), MAX_PATH + 1);
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
- }
- CSysString sysPath;
- if (!MyGetWindowsDirectory(sysPath))
- return false;
- path = GetUnicodePath(sysPath);
- return true;
-}
-
-bool MyGetSystemDirectory(UString &path)
-{
- if (g_IsNT)
- {
- UINT needLength = ::GetSystemDirectoryW(path.GetBuffer(MAX_PATH + 1), MAX_PATH + 1);
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
- }
- CSysString sysPath;
- if (!MyGetSystemDirectory(sysPath))
- return false;
- path = GetUnicodePath(sysPath);
- return true;
-}
-#endif
-
-#ifndef _UNICODE
-bool MySetFileAttributes(LPCWSTR fileName, DWORD fileAttributes)
-{
- if (g_IsNT)
- return BOOLToBool(::SetFileAttributesW(fileName, fileAttributes));
- return MySetFileAttributes(GetSysPath(fileName), fileAttributes);
-}
-
-bool MyRemoveDirectory(LPCWSTR pathName)
-{
- if (g_IsNT)
- return BOOLToBool(::RemoveDirectoryW(pathName));
- return MyRemoveDirectory(GetSysPath(pathName));
-}
-
-bool MyMoveFile(LPCWSTR existFileName, LPCWSTR newFileName)
-{
- if (g_IsNT)
- return BOOLToBool(::MoveFileW(existFileName, newFileName));
- return MyMoveFile(GetSysPath(existFileName), GetSysPath(newFileName));
-}
-#endif
-
-bool MyCreateDirectory(LPCTSTR pathName) { return BOOLToBool(::CreateDirectory(pathName, NULL)); }
-
-#ifndef _UNICODE
-bool MyCreateDirectory(LPCWSTR pathName)
-{
- if (g_IsNT)
- return BOOLToBool(::CreateDirectoryW(pathName, NULL));
- return MyCreateDirectory(GetSysPath(pathName));
-}
-#endif
-
-/*
-bool CreateComplexDirectory(LPCTSTR pathName)
-{
- NName::CParsedPath path;
- path.ParsePath(pathName);
- CSysString fullPath = path.Prefix;
- DWORD errorCode = ERROR_SUCCESS;
- for(int i = 0; i < path.PathParts.Size(); i++)
- {
- const CSysString &string = path.PathParts[i];
- if(string.IsEmpty())
- {
- if(i != path.PathParts.Size() - 1)
- return false;
- return true;
- }
- fullPath += path.PathParts[i];
- if(!MyCreateDirectory(fullPath))
- {
- DWORD errorCode = GetLastError();
- if(errorCode != ERROR_ALREADY_EXISTS)
- return false;
- }
- fullPath += NName::kDirDelimiter;
- }
- return true;
-}
-*/
-
-bool CreateComplexDirectory(LPCTSTR _aPathName)
-{
- CSysString pathName = _aPathName;
- int pos = pathName.ReverseFind(TEXT(CHAR_PATH_SEPARATOR));
- if (pos > 0 && pos == pathName.Length() - 1)
- {
- if (pathName.Length() == 3 && pathName[1] == ':')
- return true; // Disk folder;
- pathName.Delete(pos);
- }
- CSysString pathName2 = pathName;
- pos = pathName.Length();
- while(true)
- {
- if(MyCreateDirectory(pathName))
- break;
- if(::GetLastError() == ERROR_ALREADY_EXISTS)
- {
- NFind::CFileInfo fileInfo;
- if (!NFind::FindFile(pathName, fileInfo)) // For network folders
- return true;
- if (!fileInfo.IsDirectory())
- return false;
- break;
- }
- pos = pathName.ReverseFind(TEXT(CHAR_PATH_SEPARATOR));
- if (pos < 0 || pos == 0)
- return false;
- if (pathName[pos - 1] == ':')
- return false;
- pathName = pathName.Left(pos);
- }
- pathName = pathName2;
- while(pos < pathName.Length())
- {
- pos = pathName.Find(TEXT(CHAR_PATH_SEPARATOR), pos + 1);
- if (pos < 0)
- pos = pathName.Length();
- if(!MyCreateDirectory(pathName.Left(pos)))
- return false;
- }
- return true;
-}
-
-#ifndef _UNICODE
-
-bool CreateComplexDirectory(LPCWSTR _aPathName)
-{
- UString pathName = _aPathName;
- int pos = pathName.ReverseFind(WCHAR_PATH_SEPARATOR);
- if (pos > 0 && pos == pathName.Length() - 1)
- {
- if (pathName.Length() == 3 && pathName[1] == L':')
- return true; // Disk folder;
- pathName.Delete(pos);
- }
- UString pathName2 = pathName;
- pos = pathName.Length();
- while(true)
- {
- if(MyCreateDirectory(pathName))
- break;
- if(::GetLastError() == ERROR_ALREADY_EXISTS)
- {
- NFind::CFileInfoW fileInfo;
- if (!NFind::FindFile(pathName, fileInfo)) // For network folders
- return true;
- if (!fileInfo.IsDirectory())
- return false;
- break;
- }
- pos = pathName.ReverseFind(WCHAR_PATH_SEPARATOR);
- if (pos < 0 || pos == 0)
- return false;
- if (pathName[pos - 1] == L':')
- return false;
- pathName = pathName.Left(pos);
- }
- pathName = pathName2;
- while(pos < pathName.Length())
- {
- pos = pathName.Find(WCHAR_PATH_SEPARATOR, pos + 1);
- if (pos < 0)
- pos = pathName.Length();
- if(!MyCreateDirectory(pathName.Left(pos)))
- return false;
- }
- return true;
-}
-
-#endif
-
-bool DeleteFileAlways(LPCTSTR name)
-{
- if(!::SetFileAttributes(name, 0))
- return false;
- return BOOLToBool(::DeleteFile(name));
-}
-
-#ifndef _UNICODE
-bool DeleteFileAlways(LPCWSTR name)
-{
- if (g_IsNT)
- {
- if(!MySetFileAttributes(name, 0))
- return false;
- return BOOLToBool(::DeleteFileW(name));
- }
- return DeleteFileAlways(GetSysPath(name));
-}
-#endif
-
-static bool RemoveDirectorySubItems2(const CSysString pathPrefix, const NFind::CFileInfo &fileInfo)
-{
- if(fileInfo.IsDirectory())
- return RemoveDirectoryWithSubItems(pathPrefix + fileInfo.Name);
- else
- return DeleteFileAlways(pathPrefix + fileInfo.Name);
-}
-
-bool RemoveDirectoryWithSubItems(const CSysString &path)
-{
- NFind::CFileInfo fileInfo;
- CSysString pathPrefix = path + NName::kDirDelimiter;
- {
- NFind::CEnumerator enumerator(pathPrefix + TCHAR(NName::kAnyStringWildcard));
- while(enumerator.Next(fileInfo))
- if(!RemoveDirectorySubItems2(pathPrefix, fileInfo))
- return false;
- }
- if(!BOOLToBool(::SetFileAttributes(path, 0)))
- return false;
- return BOOLToBool(::RemoveDirectory(path));
-}
-
-#ifndef _UNICODE
-static bool RemoveDirectorySubItems2(const UString pathPrefix, const NFind::CFileInfoW &fileInfo)
-{
- if(fileInfo.IsDirectory())
- return RemoveDirectoryWithSubItems(pathPrefix + fileInfo.Name);
- else
- return DeleteFileAlways(pathPrefix + fileInfo.Name);
-}
-bool RemoveDirectoryWithSubItems(const UString &path)
-{
- NFind::CFileInfoW fileInfo;
- UString pathPrefix = path + UString(NName::kDirDelimiter);
- {
- NFind::CEnumeratorW enumerator(pathPrefix + UString(NName::kAnyStringWildcard));
- while(enumerator.Next(fileInfo))
- if(!RemoveDirectorySubItems2(pathPrefix, fileInfo))
- return false;
- }
- if(!MySetFileAttributes(path, 0))
- return false;
- return MyRemoveDirectory(path);
-}
-#endif
-
-#ifndef _WIN32_WCE
-
-bool MyGetShortPathName(LPCTSTR longPath, CSysString &shortPath)
-{
- DWORD needLength = ::GetShortPathName(longPath, shortPath.GetBuffer(MAX_PATH + 1), MAX_PATH + 1);
- shortPath.ReleaseBuffer();
- return (needLength > 0 && needLength < MAX_PATH);
-}
-
-bool MyGetFullPathName(LPCTSTR fileName, CSysString &resultPath, int &fileNamePartStartIndex)
-{
- resultPath.Empty();
- LPTSTR fileNamePointer = 0;
- LPTSTR buffer = resultPath.GetBuffer(MAX_PATH);
- DWORD needLength = ::GetFullPathName(fileName, MAX_PATH + 1, buffer, &fileNamePointer);
- resultPath.ReleaseBuffer();
- if (needLength == 0 || needLength >= MAX_PATH)
- return false;
- if (fileNamePointer == 0)
- fileNamePartStartIndex = lstrlen(fileName);
- else
- fileNamePartStartIndex = (int)(fileNamePointer - buffer);
- return true;
-}
-
-#ifndef _UNICODE
-bool MyGetFullPathName(LPCWSTR fileName, UString &resultPath, int &fileNamePartStartIndex)
-{
- resultPath.Empty();
- if (g_IsNT)
- {
- LPWSTR fileNamePointer = 0;
- LPWSTR buffer = resultPath.GetBuffer(MAX_PATH);
- DWORD needLength = ::GetFullPathNameW(fileName, MAX_PATH + 1, buffer, &fileNamePointer);
- resultPath.ReleaseBuffer();
- if (needLength == 0 || needLength >= MAX_PATH)
- return false;
- if (fileNamePointer == 0)
- fileNamePartStartIndex = MyStringLen(fileName);
- else
- fileNamePartStartIndex = (int)(fileNamePointer - buffer);
- }
- else
- {
- CSysString sysPath;
- if (!MyGetFullPathName(GetSysPath(fileName), sysPath, fileNamePartStartIndex))
- return false;
- UString resultPath1 = GetUnicodePath(sysPath.Left(fileNamePartStartIndex));
- UString resultPath2 = GetUnicodePath(sysPath.Mid(fileNamePartStartIndex));
- fileNamePartStartIndex = resultPath1.Length();
- resultPath = resultPath1 + resultPath2;
- }
- return true;
-}
-#endif
-
-
-bool MyGetFullPathName(LPCTSTR fileName, CSysString &path)
-{
- int index;
- return MyGetFullPathName(fileName, path, index);
-}
-
-#ifndef _UNICODE
-bool MyGetFullPathName(LPCWSTR fileName, UString &path)
-{
- int index;
- return MyGetFullPathName(fileName, path, index);
-}
-#endif
-
-bool GetOnlyName(LPCTSTR fileName, CSysString &resultName)
-{
- int index;
- if (!MyGetFullPathName(fileName, resultName, index))
- return false;
- resultName = resultName.Mid(index);
- return true;
-}
-
-#ifndef _UNICODE
-bool GetOnlyName(LPCWSTR fileName, UString &resultName)
-{
- int index;
- if (!MyGetFullPathName(fileName, resultName, index))
- return false;
- resultName = resultName.Mid(index);
- return true;
-}
-#endif
-
-bool GetOnlyDirPrefix(LPCTSTR fileName, CSysString &resultName)
-{
- int index;
- if (!MyGetFullPathName(fileName, resultName, index))
- return false;
- resultName = resultName.Left(index);
- return true;
-}
-
-#ifndef _UNICODE
-bool GetOnlyDirPrefix(LPCWSTR fileName, UString &resultName)
-{
- int index;
- if (!MyGetFullPathName(fileName, resultName, index))
- return false;
- resultName = resultName.Left(index);
- return true;
-}
-#endif
-
-bool MyGetCurrentDirectory(CSysString &path)
-{
- DWORD needLength = ::GetCurrentDirectory(MAX_PATH + 1, path.GetBuffer(MAX_PATH + 1));
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
-}
-
-#ifndef _UNICODE
-bool MySetCurrentDirectory(LPCWSTR path)
-{
- if (g_IsNT)
- return BOOLToBool(::SetCurrentDirectoryW(path));
- return MySetCurrentDirectory(GetSysPath(path));
-}
-bool MyGetCurrentDirectory(UString &path)
-{
- if (g_IsNT)
- {
- DWORD needLength = ::GetCurrentDirectoryW(MAX_PATH + 1, path.GetBuffer(MAX_PATH + 1));
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
- }
- CSysString sysPath;
- if (!MyGetCurrentDirectory(sysPath))
- return false;
- path = GetUnicodePath(sysPath);
- return true;
-}
-#endif
-#endif
-
-bool MySearchPath(LPCTSTR path, LPCTSTR fileName, LPCTSTR extension,
- CSysString &resultPath, UINT32 &filePart)
-{
- LPTSTR filePartPointer;
- DWORD value = ::SearchPath(path, fileName, extension,
- MAX_PATH, resultPath.GetBuffer(MAX_PATH + 1), &filePartPointer);
- filePart = (UINT32)(filePartPointer - (LPCTSTR)resultPath);
- resultPath.ReleaseBuffer();
- return (value > 0 && value <= MAX_PATH);
-}
-
-#ifndef _UNICODE
-bool MySearchPath(LPCWSTR path, LPCWSTR fileName, LPCWSTR extension,
- UString &resultPath, UINT32 &filePart)
-{
- if (g_IsNT)
- {
- LPWSTR filePartPointer = 0;
- DWORD value = ::SearchPathW(path, fileName, extension,
- MAX_PATH, resultPath.GetBuffer(MAX_PATH + 1), &filePartPointer);
- filePart = (UINT32)(filePartPointer - (LPCWSTR)resultPath);
- resultPath.ReleaseBuffer();
- return (value > 0 && value <= MAX_PATH);
- }
-
- CSysString sysPath;
- if (!MySearchPath(
- path != 0 ? (LPCTSTR)GetSysPath(path): 0,
- fileName != 0 ? (LPCTSTR)GetSysPath(fileName): 0,
- extension != 0 ? (LPCTSTR)GetSysPath(extension): 0,
- sysPath, filePart))
- return false;
- UString resultPath1 = GetUnicodePath(sysPath.Left(filePart));
- UString resultPath2 = GetUnicodePath(sysPath.Mid(filePart));
- filePart = resultPath1.Length();
- resultPath = resultPath1 + resultPath2;
- return true;
-}
-#endif
-
-bool MyGetTempPath(CSysString &path)
-{
- DWORD needLength = ::GetTempPath(MAX_PATH + 1, path.GetBuffer(MAX_PATH + 1));
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
-}
-
-#ifndef _UNICODE
-bool MyGetTempPath(UString &path)
-{
- path.Empty();
- if (g_IsNT)
- {
- DWORD needLength = ::GetTempPathW(MAX_PATH + 1, path.GetBuffer(MAX_PATH + 1));
- path.ReleaseBuffer();
- return (needLength > 0 && needLength <= MAX_PATH);
- }
- CSysString sysPath;
- if (!MyGetTempPath(sysPath))
- return false;
- path = GetUnicodePath(sysPath);
- return true;
-}
-#endif
-
-UINT MyGetTempFileName(LPCTSTR dirPath, LPCTSTR prefix, CSysString &path)
-{
- UINT number = ::GetTempFileName(dirPath, prefix, 0, path.GetBuffer(MAX_PATH + 1));
- path.ReleaseBuffer();
- return number;
-}
-
-#ifndef _UNICODE
-UINT MyGetTempFileName(LPCWSTR dirPath, LPCWSTR prefix, UString &path)
-{
- if (g_IsNT)
- {
- UINT number = ::GetTempFileNameW(dirPath, prefix, 0, path.GetBuffer(MAX_PATH));
- path.ReleaseBuffer();
- return number;
- }
- CSysString sysPath;
- UINT number = MyGetTempFileName(
- dirPath ? (LPCTSTR)GetSysPath(dirPath): 0,
- prefix ? (LPCTSTR)GetSysPath(prefix): 0,
- sysPath);
- path = GetUnicodePath(sysPath);
- return number;
-}
-#endif
-
-UINT CTempFile::Create(LPCTSTR dirPath, LPCTSTR prefix, CSysString &resultPath)
-{
- Remove();
- UINT number = MyGetTempFileName(dirPath, prefix, resultPath);
- if(number != 0)
- {
- _fileName = resultPath;
- _mustBeDeleted = true;
- }
- return number;
-}
-
-bool CTempFile::Create(LPCTSTR prefix, CSysString &resultPath)
-{
- CSysString tempPath;
- if(!MyGetTempPath(tempPath))
- return false;
- if (Create(tempPath, prefix, resultPath) != 0)
- return true;
- if(!MyGetWindowsDirectory(tempPath))
- return false;
- return (Create(tempPath, prefix, resultPath) != 0);
-}
-
-bool CTempFile::Remove()
-{
- if (!_mustBeDeleted)
- return true;
- _mustBeDeleted = !DeleteFileAlways(_fileName);
- return !_mustBeDeleted;
-}
-
-#ifndef _UNICODE
-
-UINT CTempFileW::Create(LPCWSTR dirPath, LPCWSTR prefix, UString &resultPath)
-{
- Remove();
- UINT number = MyGetTempFileName(dirPath, prefix, resultPath);
- if(number != 0)
- {
- _fileName = resultPath;
- _mustBeDeleted = true;
- }
- return number;
-}
-
-bool CTempFileW::Create(LPCWSTR prefix, UString &resultPath)
-{
- UString tempPath;
- if(!MyGetTempPath(tempPath))
- return false;
- if (Create(tempPath, prefix, resultPath) != 0)
- return true;
- if(!MyGetWindowsDirectory(tempPath))
- return false;
- return (Create(tempPath, prefix, resultPath) != 0);
-}
-
-bool CTempFileW::Remove()
-{
- if (!_mustBeDeleted)
- return true;
- _mustBeDeleted = !DeleteFileAlways(_fileName);
- return !_mustBeDeleted;
-}
-
-#endif
-
-bool CreateTempDirectory(LPCTSTR prefix, CSysString &dirName)
-{
- /*
- CSysString prefix = tempPath + prefixChars;
- CRandom random;
- random.Init();
- */
- while(true)
- {
- CTempFile tempFile;
- if (!tempFile.Create(prefix, dirName))
- return false;
- if (!::DeleteFile(dirName))
- return false;
- /*
- UINT32 randomNumber = random.Generate();
- TCHAR randomNumberString[32];
- _stprintf(randomNumberString, _T("%04X"), randomNumber);
- dirName = prefix + randomNumberString;
- */
- if(NFind::DoesFileExist(dirName))
- continue;
- if (MyCreateDirectory(dirName))
- return true;
- if (::GetLastError() != ERROR_ALREADY_EXISTS)
- return false;
- }
-}
-
-bool CTempDirectory::Create(LPCTSTR prefix)
-{
- Remove();
- return (_mustBeDeleted = CreateTempDirectory(prefix, _tempDir));
-}
-
-#ifndef _UNICODE
-
-bool CreateTempDirectory(LPCWSTR prefix, UString &dirName)
-{
- /*
- CSysString prefix = tempPath + prefixChars;
- CRandom random;
- random.Init();
- */
- while(true)
- {
- CTempFileW tempFile;
- if (!tempFile.Create(prefix, dirName))
- return false;
- if (!DeleteFileAlways(dirName))
- return false;
- /*
- UINT32 randomNumber = random.Generate();
- TCHAR randomNumberString[32];
- _stprintf(randomNumberString, _T("%04X"), randomNumber);
- dirName = prefix + randomNumberString;
- */
- if(NFind::DoesFileExist(dirName))
- continue;
- if (MyCreateDirectory(dirName))
- return true;
- if (::GetLastError() != ERROR_ALREADY_EXISTS)
- return false;
- }
-}
-
-bool CTempDirectoryW::Create(LPCWSTR prefix)
-{
- Remove();
- return (_mustBeDeleted = CreateTempDirectory(prefix, _tempDir));
-}
-
-#endif
-
-}}}
diff --git a/other-licenses/7zstub/src/Windows/FileDir.h b/other-licenses/7zstub/src/Windows/FileDir.h
deleted file mode 100644
index da9a5bbcc2..0000000000
--- a/other-licenses/7zstub/src/Windows/FileDir.h
+++ /dev/null
@@ -1,189 +0,0 @@
-// Windows/FileDir.h
-
-#ifndef __WINDOWS_FILEDIR_H
-#define __WINDOWS_FILEDIR_H
-
-#include "../Common/String.h"
-#include "Defs.h"
-
-namespace NWindows {
-namespace NFile {
-namespace NDirectory {
-
-bool MyGetWindowsDirectory(CSysString &path);
-bool MyGetSystemDirectory(CSysString &path);
-#ifndef _UNICODE
-bool MyGetWindowsDirectory(UString &path);
-bool MyGetSystemDirectory(UString &path);
-#endif
-
-inline bool MySetFileAttributes(LPCTSTR fileName, DWORD fileAttributes)
- { return BOOLToBool(::SetFileAttributes(fileName, fileAttributes)); }
-#ifndef _UNICODE
-bool MySetFileAttributes(LPCWSTR fileName, DWORD fileAttributes);
-#endif
-
-inline bool MyMoveFile(LPCTSTR existFileName, LPCTSTR newFileName)
- { return BOOLToBool(::MoveFile(existFileName, newFileName)); }
-#ifndef _UNICODE
-bool MyMoveFile(LPCWSTR existFileName, LPCWSTR newFileName);
-#endif
-
-inline bool MyRemoveDirectory(LPCTSTR pathName)
- { return BOOLToBool(::RemoveDirectory(pathName)); }
-#ifndef _UNICODE
-bool MyRemoveDirectory(LPCWSTR pathName);
-#endif
-
-bool MyCreateDirectory(LPCTSTR pathName);
-bool CreateComplexDirectory(LPCTSTR pathName);
-#ifndef _UNICODE
-bool MyCreateDirectory(LPCWSTR pathName);
-bool CreateComplexDirectory(LPCWSTR pathName);
-#endif
-
-bool DeleteFileAlways(LPCTSTR name);
-#ifndef _UNICODE
-bool DeleteFileAlways(LPCWSTR name);
-#endif
-
-bool RemoveDirectoryWithSubItems(const CSysString &path);
-#ifndef _UNICODE
-bool RemoveDirectoryWithSubItems(const UString &path);
-#endif
-
-#ifndef _WIN32_WCE
-bool MyGetShortPathName(LPCTSTR longPath, CSysString &shortPath);
-
-bool MyGetFullPathName(LPCTSTR fileName, CSysString &resultPath,
- int &fileNamePartStartIndex);
-bool MyGetFullPathName(LPCTSTR fileName, CSysString &resultPath);
-bool GetOnlyName(LPCTSTR fileName, CSysString &resultName);
-bool GetOnlyDirPrefix(LPCTSTR fileName, CSysString &resultName);
-#ifndef _UNICODE
-bool MyGetFullPathName(LPCWSTR fileName, UString &resultPath,
- int &fileNamePartStartIndex);
-bool MyGetFullPathName(LPCWSTR fileName, UString &resultPath);
-bool GetOnlyName(LPCWSTR fileName, UString &resultName);
-bool GetOnlyDirPrefix(LPCWSTR fileName, UString &resultName);
-#endif
-
-inline bool MySetCurrentDirectory(LPCTSTR path)
- { return BOOLToBool(::SetCurrentDirectory(path)); }
-bool MyGetCurrentDirectory(CSysString &resultPath);
-#ifndef _UNICODE
-bool MySetCurrentDirectory(LPCWSTR path);
-bool MyGetCurrentDirectory(UString &resultPath);
-#endif
-#endif
-
-bool MySearchPath(LPCTSTR path, LPCTSTR fileName, LPCTSTR extension,
- CSysString &resultPath, UINT32 &filePart);
-#ifndef _UNICODE
-bool MySearchPath(LPCWSTR path, LPCWSTR fileName, LPCWSTR extension,
- UString &resultPath, UINT32 &filePart);
-#endif
-
-inline bool MySearchPath(LPCTSTR path, LPCTSTR fileName, LPCTSTR extension,
- CSysString &resultPath)
-{
- UINT32 value;
- return MySearchPath(path, fileName, extension, resultPath, value);
-}
-
-#ifndef _UNICODE
-inline bool MySearchPath(LPCWSTR path, LPCWSTR fileName, LPCWSTR extension,
- UString &resultPath)
-{
- UINT32 value;
- return MySearchPath(path, fileName, extension, resultPath, value);
-}
-#endif
-
-bool MyGetTempPath(CSysString &resultPath);
-#ifndef _UNICODE
-bool MyGetTempPath(UString &resultPath);
-#endif
-
-UINT MyGetTempFileName(LPCTSTR dirPath, LPCTSTR prefix, CSysString &resultPath);
-#ifndef _UNICODE
-UINT MyGetTempFileName(LPCWSTR dirPath, LPCWSTR prefix, UString &resultPath);
-#endif
-
-class CTempFile
-{
- bool _mustBeDeleted;
- CSysString _fileName;
-public:
- CTempFile(): _mustBeDeleted(false) {}
- ~CTempFile() { Remove(); }
- void DisableDeleting() { _mustBeDeleted = false; }
- UINT Create(LPCTSTR dirPath, LPCTSTR prefix, CSysString &resultPath);
- bool Create(LPCTSTR prefix, CSysString &resultPath);
- bool Remove();
-};
-
-#ifdef _UNICODE
-typedef CTempFile CTempFileW;
-#else
-class CTempFileW
-{
- bool _mustBeDeleted;
- UString _fileName;
-public:
- CTempFileW(): _mustBeDeleted(false) {}
- ~CTempFileW() { Remove(); }
- void DisableDeleting() { _mustBeDeleted = false; }
- UINT Create(LPCWSTR dirPath, LPCWSTR prefix, UString &resultPath);
- bool Create(LPCWSTR prefix, UString &resultPath);
- bool Remove();
-};
-#endif
-
-bool CreateTempDirectory(LPCTSTR prefixChars, CSysString &dirName);
-
-class CTempDirectory
-{
- bool _mustBeDeleted;
- CSysString _tempDir;
-public:
- const CSysString &GetPath() const { return _tempDir; }
- CTempDirectory(): _mustBeDeleted(false) {}
- ~CTempDirectory() { Remove(); }
- bool Create(LPCTSTR prefix) ;
- bool Remove()
- {
- if (!_mustBeDeleted)
- return true;
- _mustBeDeleted = !RemoveDirectoryWithSubItems(_tempDir);
- return (!_mustBeDeleted);
- }
- void DisableDeleting() { _mustBeDeleted = false; }
-};
-
-#ifdef _UNICODE
-typedef CTempDirectory CTempDirectoryW;
-#else
-class CTempDirectoryW
-{
- bool _mustBeDeleted;
- UString _tempDir;
-public:
- const UString &GetPath() const { return _tempDir; }
- CTempDirectoryW(): _mustBeDeleted(false) {}
- ~CTempDirectoryW() { Remove(); }
- bool Create(LPCWSTR prefix) ;
- bool Remove()
- {
- if (!_mustBeDeleted)
- return true;
- _mustBeDeleted = !RemoveDirectoryWithSubItems(_tempDir);
- return (!_mustBeDeleted);
- }
- void DisableDeleting() { _mustBeDeleted = false; }
-};
-#endif
-
-}}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/FileFind.cpp b/other-licenses/7zstub/src/Windows/FileFind.cpp
deleted file mode 100644
index 298df46440..0000000000
--- a/other-licenses/7zstub/src/Windows/FileFind.cpp
+++ /dev/null
@@ -1,365 +0,0 @@
-// Windows/FileFind.cpp
-
-#include "StdAfx.h"
-
-#include "FileFind.h"
-#ifndef _UNICODE
-#include "../Common/StringConvert.h"
-#endif
-
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-namespace NFile {
-namespace NFind {
-
-static const TCHAR kDot = TEXT('.');
-
-bool CFileInfo::IsDots() const
-{
- if (!IsDirectory() || Name.IsEmpty())
- return false;
- if (Name[0] != kDot)
- return false;
- return Name.Length() == 1 || (Name[1] == kDot && Name.Length() == 2);
-}
-
-#ifndef _UNICODE
-bool CFileInfoW::IsDots() const
-{
- if (!IsDirectory() || Name.IsEmpty())
- return false;
- if (Name[0] != kDot)
- return false;
- return Name.Length() == 1 || (Name[1] == kDot && Name.Length() == 2);
-}
-#endif
-
-static void ConvertWIN32_FIND_DATA_To_FileInfo(
- const WIN32_FIND_DATA &findData,
- CFileInfo &fileInfo)
-{
- fileInfo.Attributes = findData.dwFileAttributes;
- fileInfo.CreationTime = findData.ftCreationTime;
- fileInfo.LastAccessTime = findData.ftLastAccessTime;
- fileInfo.LastWriteTime = findData.ftLastWriteTime;
- fileInfo.Size = (((UInt64)findData.nFileSizeHigh) << 32) + findData.nFileSizeLow;
- fileInfo.Name = findData.cFileName;
- #ifndef _WIN32_WCE
- fileInfo.ReparseTag = findData.dwReserved0;
- #else
- fileInfo.ObjectID = findData.dwOID;
- #endif
-}
-
-#ifndef _UNICODE
-
-static inline UINT GetCurrentCodePage() { return ::AreFileApisANSI() ? CP_ACP : CP_OEMCP; }
-
-static void ConvertWIN32_FIND_DATA_To_FileInfo(
- const WIN32_FIND_DATAW &findData,
- CFileInfoW &fileInfo)
-{
- fileInfo.Attributes = findData.dwFileAttributes;
- fileInfo.CreationTime = findData.ftCreationTime;
- fileInfo.LastAccessTime = findData.ftLastAccessTime;
- fileInfo.LastWriteTime = findData.ftLastWriteTime;
- fileInfo.Size = (((UInt64)findData.nFileSizeHigh) << 32) + findData.nFileSizeLow;
- fileInfo.Name = findData.cFileName;
- #ifndef _WIN32_WCE
- fileInfo.ReparseTag = findData.dwReserved0;
- #else
- fileInfo.ObjectID = findData.dwOID;
- #endif
-}
-
-static void ConvertWIN32_FIND_DATA_To_FileInfo(
- const WIN32_FIND_DATA &findData,
- CFileInfoW &fileInfo)
-{
- fileInfo.Attributes = findData.dwFileAttributes;
- fileInfo.CreationTime = findData.ftCreationTime;
- fileInfo.LastAccessTime = findData.ftLastAccessTime;
- fileInfo.LastWriteTime = findData.ftLastWriteTime;
- fileInfo.Size = (((UInt64)findData.nFileSizeHigh) << 32) + findData.nFileSizeLow;
- fileInfo.Name = GetUnicodeString(findData.cFileName, GetCurrentCodePage());
- #ifndef _WIN32_WCE
- fileInfo.ReparseTag = findData.dwReserved0;
- #else
- fileInfo.ObjectID = findData.dwOID;
- #endif
-}
-#endif
-
-////////////////////////////////
-// CFindFile
-
-bool CFindFile::Close()
-{
- if(!_handleAllocated)
- return true;
- bool result = BOOLToBool(::FindClose(_handle));
- _handleAllocated = !result;
- return result;
-}
-
-bool CFindFile::FindFirst(LPCTSTR wildcard, CFileInfo &fileInfo)
-{
- Close();
- WIN32_FIND_DATA findData;
- _handle = ::FindFirstFile(wildcard, &findData);
- if (_handleAllocated = (_handle != INVALID_HANDLE_VALUE))
- ConvertWIN32_FIND_DATA_To_FileInfo(findData, fileInfo);
- return _handleAllocated;
-}
-
-#ifndef _UNICODE
-bool CFindFile::FindFirst(LPCWSTR wildcard, CFileInfoW &fileInfo)
-{
- Close();
- if (g_IsNT)
- {
- WIN32_FIND_DATAW findData;
- _handle = ::FindFirstFileW(wildcard, &findData);
- if (_handleAllocated = (_handle != INVALID_HANDLE_VALUE))
- ConvertWIN32_FIND_DATA_To_FileInfo(findData, fileInfo);
- }
- else
- {
- WIN32_FIND_DATAA findData;
- _handle = ::FindFirstFileA(UnicodeStringToMultiByte(wildcard,
- GetCurrentCodePage()), &findData);
- if (_handleAllocated = (_handle != INVALID_HANDLE_VALUE))
- ConvertWIN32_FIND_DATA_To_FileInfo(findData, fileInfo);
- }
- return _handleAllocated;
-}
-#endif
-
-bool CFindFile::FindNext(CFileInfo &fileInfo)
-{
- WIN32_FIND_DATA findData;
- bool result = BOOLToBool(::FindNextFile(_handle, &findData));
- if (result)
- ConvertWIN32_FIND_DATA_To_FileInfo(findData, fileInfo);
- return result;
-}
-
-#ifndef _UNICODE
-bool CFindFile::FindNext(CFileInfoW &fileInfo)
-{
- if (g_IsNT)
- {
- WIN32_FIND_DATAW findData;
- if (!::FindNextFileW(_handle, &findData))
- return false;
- ConvertWIN32_FIND_DATA_To_FileInfo(findData, fileInfo);
- }
- else
- {
- WIN32_FIND_DATAA findData;
- if (!::FindNextFileA(_handle, &findData))
- return false;
- ConvertWIN32_FIND_DATA_To_FileInfo(findData, fileInfo);
- }
- return true;
-}
-#endif
-
-bool FindFile(LPCTSTR wildcard, CFileInfo &fileInfo)
-{
- CFindFile finder;
- return finder.FindFirst(wildcard, fileInfo);
-}
-
-#ifndef _UNICODE
-bool FindFile(LPCWSTR wildcard, CFileInfoW &fileInfo)
-{
- CFindFile finder;
- return finder.FindFirst(wildcard, fileInfo);
-}
-#endif
-
-bool DoesFileExist(LPCTSTR name)
-{
- CFileInfo fileInfo;
- return FindFile(name, fileInfo);
-}
-
-#ifndef _UNICODE
-bool DoesFileExist(LPCWSTR name)
-{
- CFileInfoW fileInfo;
- return FindFile(name, fileInfo);
-}
-#endif
-
-/////////////////////////////////////
-// CEnumerator
-
-bool CEnumerator::NextAny(CFileInfo &fileInfo)
-{
- if(_findFile.IsHandleAllocated())
- return _findFile.FindNext(fileInfo);
- else
- return _findFile.FindFirst(_wildcard, fileInfo);
-}
-
-bool CEnumerator::Next(CFileInfo &fileInfo)
-{
- while(true)
- {
- if(!NextAny(fileInfo))
- return false;
- if(!fileInfo.IsDots())
- return true;
- }
-}
-
-bool CEnumerator::Next(CFileInfo &fileInfo, bool &found)
-{
- if (Next(fileInfo))
- {
- found = true;
- return true;
- }
- found = false;
- return (::GetLastError() == ERROR_NO_MORE_FILES);
-}
-
-#ifndef _UNICODE
-bool CEnumeratorW::NextAny(CFileInfoW &fileInfo)
-{
- if(_findFile.IsHandleAllocated())
- return _findFile.FindNext(fileInfo);
- else
- return _findFile.FindFirst(_wildcard, fileInfo);
-}
-
-bool CEnumeratorW::Next(CFileInfoW &fileInfo)
-{
- while(true)
- {
- if(!NextAny(fileInfo))
- return false;
- if(!fileInfo.IsDots())
- return true;
- }
-}
-
-bool CEnumeratorW::Next(CFileInfoW &fileInfo, bool &found)
-{
- if (Next(fileInfo))
- {
- found = true;
- return true;
- }
- found = false;
- return (::GetLastError() == ERROR_NO_MORE_FILES);
-}
-
-#endif
-
-////////////////////////////////
-// CFindChangeNotification
-
-bool CFindChangeNotification::Close()
-{
- if(_handle == INVALID_HANDLE_VALUE || _handle == 0)
- return true;
- bool result = BOOLToBool(::FindCloseChangeNotification(_handle));
- if (result)
- _handle = INVALID_HANDLE_VALUE;
- return result;
-}
-
-HANDLE CFindChangeNotification::FindFirst(LPCTSTR pathName, bool watchSubtree,
- DWORD notifyFilter)
-{
- _handle = ::FindFirstChangeNotification(pathName,
- BoolToBOOL(watchSubtree), notifyFilter);
- return _handle;
-}
-
-#ifndef _UNICODE
-HANDLE CFindChangeNotification::FindFirst(LPCWSTR pathName, bool watchSubtree,
- DWORD notifyFilter)
-{
- if (g_IsNT)
- return (_handle = ::FindFirstChangeNotificationW(pathName, BoolToBOOL(watchSubtree), notifyFilter));
- return FindFirst(UnicodeStringToMultiByte(pathName, GetCurrentCodePage()), watchSubtree, notifyFilter);
-}
-#endif
-
-#ifndef _WIN32_WCE
-bool MyGetLogicalDriveStrings(CSysStringVector &driveStrings)
-{
- driveStrings.Clear();
- UINT32 size = GetLogicalDriveStrings(0, NULL);
- if(size == 0)
- return false;
- CSysString buffer;
- UINT32 newSize = GetLogicalDriveStrings(size, buffer.GetBuffer(size));
- if(newSize == 0)
- return false;
- if(newSize > size)
- return false;
- CSysString string;
- for(UINT32 i = 0; i < newSize; i++)
- {
- TCHAR c = buffer[i];
- if(c == TEXT('\0'))
- {
- driveStrings.Add(string);
- string.Empty();
- }
- else
- string += c;
- }
- if(!string.IsEmpty())
- return false;
- return true;
-}
-
-#ifndef _UNICODE
-bool MyGetLogicalDriveStrings(UStringVector &driveStrings)
-{
- driveStrings.Clear();
- if (g_IsNT)
- {
- UINT32 size = GetLogicalDriveStringsW(0, NULL);
- if (size == 0)
- return false;
- UString buffer;
- UINT32 newSize = GetLogicalDriveStringsW(size, buffer.GetBuffer(size));
- if(newSize == 0)
- return false;
- if(newSize > size)
- return false;
- UString string;
- for(UINT32 i = 0; i < newSize; i++)
- {
- WCHAR c = buffer[i];
- if(c == L'\0')
- {
- driveStrings.Add(string);
- string.Empty();
- }
- else
- string += c;
- }
- return string.IsEmpty();
- }
- CSysStringVector driveStringsA;
- bool res = MyGetLogicalDriveStrings(driveStringsA);
- for (int i = 0; i < driveStringsA.Size(); i++)
- driveStrings.Add(GetUnicodeString(driveStringsA[i]));
- return res;
-}
-#endif
-
-#endif
-
-}}}
diff --git a/other-licenses/7zstub/src/Windows/FileFind.h b/other-licenses/7zstub/src/Windows/FileFind.h
deleted file mode 100644
index 19c8fe3ede..0000000000
--- a/other-licenses/7zstub/src/Windows/FileFind.h
+++ /dev/null
@@ -1,176 +0,0 @@
-// Windows/FileFind.h
-
-#ifndef __WINDOWS_FILEFIND_H
-#define __WINDOWS_FILEFIND_H
-
-#include "../Common/String.h"
-#include "../Common/Types.h"
-#include "FileName.h"
-#include "Defs.h"
-
-namespace NWindows {
-namespace NFile {
-namespace NFind {
-
-namespace NAttributes
-{
- inline bool IsReadOnly(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_READONLY) != 0; }
- inline bool IsHidden(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_HIDDEN) != 0; }
- inline bool IsSystem(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_SYSTEM) != 0; }
- inline bool IsDirectory(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }
- inline bool IsArchived(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_ARCHIVE) != 0; }
- inline bool IsCompressed(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_COMPRESSED) != 0; }
- inline bool IsEncrypted(DWORD attributes) { return (attributes & FILE_ATTRIBUTE_ENCRYPTED) != 0; }
-}
-
-class CFileInfoBase
-{
- bool MatchesMask(UINT32 mask) const { return ((Attributes & mask) != 0); }
-public:
- DWORD Attributes;
- FILETIME CreationTime;
- FILETIME LastAccessTime;
- FILETIME LastWriteTime;
- UInt64 Size;
-
- #ifndef _WIN32_WCE
- UINT32 ReparseTag;
- #else
- DWORD ObjectID;
- #endif
-
- bool IsArchived() const { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); }
- bool IsCompressed() const { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); }
- bool IsDirectory() const { return MatchesMask(FILE_ATTRIBUTE_DIRECTORY); }
- bool IsEncrypted() const { return MatchesMask(FILE_ATTRIBUTE_ENCRYPTED); }
- bool IsHidden() const { return MatchesMask(FILE_ATTRIBUTE_HIDDEN); }
- bool IsNormal() const { return MatchesMask(FILE_ATTRIBUTE_NORMAL); }
- bool IsOffline() const { return MatchesMask(FILE_ATTRIBUTE_OFFLINE); }
- bool IsReadOnly() const { return MatchesMask(FILE_ATTRIBUTE_READONLY); }
- bool HasReparsePoint() const { return MatchesMask(FILE_ATTRIBUTE_REPARSE_POINT); }
- bool IsSparse() const { return MatchesMask(FILE_ATTRIBUTE_SPARSE_FILE); }
- bool IsSystem() const { return MatchesMask(FILE_ATTRIBUTE_SYSTEM); }
- bool IsTemporary() const { return MatchesMask(FILE_ATTRIBUTE_TEMPORARY); }
-};
-
-class CFileInfo: public CFileInfoBase
-{
-public:
- CSysString Name;
- bool IsDots() const;
-};
-
-#ifdef _UNICODE
-typedef CFileInfo CFileInfoW;
-#else
-class CFileInfoW: public CFileInfoBase
-{
-public:
- UString Name;
- bool IsDots() const;
-};
-#endif
-
-class CFindFile
-{
- friend class CEnumerator;
- HANDLE _handle;
- bool _handleAllocated;
-public:
- bool IsHandleAllocated() const { return _handleAllocated; }
- CFindFile(): _handleAllocated(false) {}
- ~CFindFile() { Close(); }
- bool FindFirst(LPCTSTR wildcard, CFileInfo &fileInfo);
- bool FindNext(CFileInfo &fileInfo);
- #ifndef _UNICODE
- bool FindFirst(LPCWSTR wildcard, CFileInfoW &fileInfo);
- bool FindNext(CFileInfoW &fileInfo);
- #endif
- bool Close();
-};
-
-bool FindFile(LPCTSTR wildcard, CFileInfo &fileInfo);
-
-bool DoesFileExist(LPCTSTR name);
-#ifndef _UNICODE
-bool FindFile(LPCWSTR wildcard, CFileInfoW &fileInfo);
-bool DoesFileExist(LPCWSTR name);
-#endif
-
-class CEnumerator
-{
- CFindFile _findFile;
- CSysString _wildcard;
- bool NextAny(CFileInfo &fileInfo);
-public:
- CEnumerator(): _wildcard(NName::kAnyStringWildcard) {}
- CEnumerator(const CSysString &wildcard): _wildcard(wildcard) {}
- bool Next(CFileInfo &fileInfo);
- bool Next(CFileInfo &fileInfo, bool &found);
-};
-
-#ifdef _UNICODE
-typedef CEnumerator CEnumeratorW;
-#else
-class CEnumeratorW
-{
- CFindFile _findFile;
- UString _wildcard;
- bool NextAny(CFileInfoW &fileInfo);
-public:
- CEnumeratorW(): _wildcard(NName::kAnyStringWildcard) {}
- CEnumeratorW(const UString &wildcard): _wildcard(wildcard) {}
- bool Next(CFileInfoW &fileInfo);
- bool Next(CFileInfoW &fileInfo, bool &found);
-};
-#endif
-
-class CFindChangeNotification
-{
- HANDLE _handle;
-public:
- operator HANDLE () { return _handle; }
- CFindChangeNotification(): _handle(INVALID_HANDLE_VALUE) {}
- ~CFindChangeNotification() { Close(); }
- bool Close();
- HANDLE FindFirst(LPCTSTR pathName, bool watchSubtree, DWORD notifyFilter);
- #ifndef _UNICODE
- HANDLE FindFirst(LPCWSTR pathName, bool watchSubtree, DWORD notifyFilter);
- #endif
- bool FindNext()
- { return BOOLToBool(::FindNextChangeNotification(_handle)); }
-};
-
-#ifndef _WIN32_WCE
-bool MyGetLogicalDriveStrings(CSysStringVector &driveStrings);
-#ifndef _UNICODE
-bool MyGetLogicalDriveStrings(UStringVector &driveStrings);
-#endif
-#endif
-
-inline bool MyGetCompressedFileSize(LPCTSTR fileName, UInt64 &size)
-{
- DWORD highPart;
- DWORD lowPart = ::GetCompressedFileSize(fileName, &highPart);
- if (lowPart == INVALID_FILE_SIZE)
- if (::GetLastError() != NO_ERROR)
- return false;
- size = (UInt64(highPart) << 32) | lowPart;
- return true;
-}
-
-inline bool MyGetCompressedFileSizeW(LPCWSTR fileName, UInt64 &size)
-{
- DWORD highPart;
- DWORD lowPart = ::GetCompressedFileSizeW(fileName, &highPart);
- if (lowPart == INVALID_FILE_SIZE)
- if (::GetLastError() != NO_ERROR)
- return false;
- size = (UInt64(highPart) << 32) | lowPart;
- return true;
-}
-
-}}}
-
-#endif
-
diff --git a/other-licenses/7zstub/src/Windows/FileIO.cpp b/other-licenses/7zstub/src/Windows/FileIO.cpp
deleted file mode 100644
index 20b5fc1594..0000000000
--- a/other-licenses/7zstub/src/Windows/FileIO.cpp
+++ /dev/null
@@ -1,245 +0,0 @@
-// Windows/FileIO.cpp
-
-#include "StdAfx.h"
-
-#include "FileIO.h"
-#include "Defs.h"
-#ifndef _UNICODE
-#include "../Common/StringConvert.h"
-#endif
-
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-namespace NFile {
-namespace NIO {
-
-CFileBase::~CFileBase() { Close(); }
-
-bool CFileBase::Create(LPCTSTR fileName, DWORD desiredAccess,
- DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
-{
- Close();
- _handle = ::CreateFile(fileName, desiredAccess, shareMode,
- (LPSECURITY_ATTRIBUTES)NULL, creationDisposition,
- flagsAndAttributes, (HANDLE) NULL);
- return (_fileIsOpen = (_handle != INVALID_HANDLE_VALUE));
-}
-
-#ifndef _UNICODE
-bool CFileBase::Create(LPCWSTR fileName, DWORD desiredAccess,
- DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
-{
- if (g_IsNT)
- {
- Close();
- _handle = ::CreateFileW(fileName, desiredAccess, shareMode,
- (LPSECURITY_ATTRIBUTES)NULL, creationDisposition,
- flagsAndAttributes, (HANDLE) NULL);
- return (_fileIsOpen = (_handle != INVALID_HANDLE_VALUE));
- }
- return Create(UnicodeStringToMultiByte(fileName, ::AreFileApisANSI() ? CP_ACP : CP_OEMCP),
- desiredAccess, shareMode, creationDisposition, flagsAndAttributes);
-}
-#endif
-
-bool CFileBase::Close()
-{
- if(!_fileIsOpen)
- return true;
- bool result = BOOLToBool(::CloseHandle(_handle));
- _fileIsOpen = !result;
- return result;
-}
-
-bool CFileBase::GetPosition(UInt64 &position) const
-{
- return Seek(0, FILE_CURRENT, position);
-}
-
-bool CFileBase::GetLength(UInt64 &length) const
-{
- DWORD sizeHigh;
- DWORD sizeLow = ::GetFileSize(_handle, &sizeHigh);
- if(sizeLow == 0xFFFFFFFF)
- if(::GetLastError() != NO_ERROR)
- return false;
- length = (((UInt64)sizeHigh) << 32) + sizeLow;
- return true;
-}
-
-bool CFileBase::Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition) const
-{
- LARGE_INTEGER value;
- value.QuadPart = distanceToMove;
- value.LowPart = ::SetFilePointer(_handle, value.LowPart, &value.HighPart, moveMethod);
- if (value.LowPart == 0xFFFFFFFF)
- if(::GetLastError() != NO_ERROR)
- return false;
- newPosition = value.QuadPart;
- return true;
-}
-
-bool CFileBase::Seek(UInt64 position, UInt64 &newPosition)
-{
- return Seek(position, FILE_BEGIN, newPosition);
-}
-
-bool CFileBase::SeekToBegin()
-{
- UInt64 newPosition;
- return Seek(0, newPosition);
-}
-
-bool CFileBase::SeekToEnd(UInt64 &newPosition)
-{
- return Seek(0, FILE_END, newPosition);
-}
-
-bool CFileBase::GetFileInformation(CByHandleFileInfo &fileInfo) const
-{
- BY_HANDLE_FILE_INFORMATION winFileInfo;
- if(!::GetFileInformationByHandle(_handle, &winFileInfo))
- return false;
- fileInfo.Attributes = winFileInfo.dwFileAttributes;
- fileInfo.CreationTime = winFileInfo.ftCreationTime;
- fileInfo.LastAccessTime = winFileInfo.ftLastAccessTime;
- fileInfo.LastWriteTime = winFileInfo.ftLastWriteTime;
- fileInfo.VolumeSerialNumber = winFileInfo.dwFileAttributes;
- fileInfo.Size = (((UInt64)winFileInfo.nFileSizeHigh) << 32) + winFileInfo.nFileSizeLow;
- fileInfo.NumberOfLinks = winFileInfo.nNumberOfLinks;
- fileInfo.FileIndex = (((UInt64)winFileInfo.nFileIndexHigh) << 32) + winFileInfo.nFileIndexLow;
- return true;
-}
-
-/////////////////////////
-// CInFile
-
-bool CInFile::Open(LPCTSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
- { return Create(fileName, GENERIC_READ, shareMode, creationDisposition, flagsAndAttributes); }
-
-bool CInFile::Open(LPCTSTR fileName)
- { return Open(fileName, FILE_SHARE_READ, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL); }
-
-#ifndef _UNICODE
-bool CInFile::Open(LPCWSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
- { return Create(fileName, GENERIC_READ, shareMode, creationDisposition, flagsAndAttributes); }
-
-bool CInFile::Open(LPCWSTR fileName)
- { return Open(fileName, FILE_SHARE_READ, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL); }
-#endif
-
-// ReadFile and WriteFile functions in Windows have BUG:
-// If you Read or Write 64MB or more (probably min_failure_size = 64MB - 32KB + 1)
-// from/to Network file, it returns ERROR_NO_SYSTEM_RESOURCES
-// (Insufficient system resources exist to complete the requested service).
-
-static UInt32 kChunkSizeMax = (1 << 24);
-
-bool CInFile::ReadPart(void *data, UInt32 size, UInt32 &processedSize)
-{
- if (size > kChunkSizeMax)
- size = kChunkSizeMax;
- DWORD processedLoc = 0;
- bool res = BOOLToBool(::ReadFile(_handle, data, size, &processedLoc, NULL));
- processedSize = (UInt32)processedLoc;
- return res;
-}
-
-bool CInFile::Read(void *data, UInt32 size, UInt32 &processedSize)
-{
- processedSize = 0;
- do
- {
- UInt32 processedLoc = 0;
- bool res = ReadPart(data, size, processedLoc);
- processedSize += processedLoc;
- if (!res)
- return false;
- if (processedLoc == 0)
- return true;
- data = (void *)((unsigned char *)data + processedLoc);
- size -= processedLoc;
- }
- while (size > 0);
- return true;
-}
-
-/////////////////////////
-// COutFile
-
-bool COutFile::Open(LPCTSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
- { return CFileBase::Create(fileName, GENERIC_WRITE, shareMode, creationDisposition, flagsAndAttributes); }
-
-static inline DWORD GetCreationDisposition(bool createAlways)
- { return createAlways? CREATE_ALWAYS: CREATE_NEW; }
-
-bool COutFile::Open(LPCTSTR fileName, DWORD creationDisposition)
- { return Open(fileName, FILE_SHARE_READ, creationDisposition, FILE_ATTRIBUTE_NORMAL); }
-
-bool COutFile::Create(LPCTSTR fileName, bool createAlways)
- { return Open(fileName, GetCreationDisposition(createAlways)); }
-
-#ifndef _UNICODE
-
-bool COutFile::Open(LPCWSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes)
- { return CFileBase::Create(fileName, GENERIC_WRITE, shareMode, creationDisposition, flagsAndAttributes); }
-
-bool COutFile::Open(LPCWSTR fileName, DWORD creationDisposition)
- { return Open(fileName, FILE_SHARE_READ, creationDisposition, FILE_ATTRIBUTE_NORMAL); }
-
-bool COutFile::Create(LPCWSTR fileName, bool createAlways)
- { return Open(fileName, GetCreationDisposition(createAlways)); }
-
-#endif
-
-bool COutFile::SetTime(const FILETIME *creationTime, const FILETIME *lastAccessTime, const FILETIME *lastWriteTime)
- { return BOOLToBool(::SetFileTime(_handle, creationTime, lastAccessTime, lastWriteTime)); }
-
-bool COutFile::SetLastWriteTime(const FILETIME *lastWriteTime)
- { return SetTime(NULL, NULL, lastWriteTime); }
-
-bool COutFile::WritePart(const void *data, UInt32 size, UInt32 &processedSize)
-{
- if (size > kChunkSizeMax)
- size = kChunkSizeMax;
- DWORD processedLoc = 0;
- bool res = BOOLToBool(::WriteFile(_handle, data, size, &processedLoc, NULL));
- processedSize = (UInt32)processedLoc;
- return res;
-}
-
-bool COutFile::Write(const void *data, UInt32 size, UInt32 &processedSize)
-{
- processedSize = 0;
- do
- {
- UInt32 processedLoc = 0;
- bool res = WritePart(data, size, processedLoc);
- processedSize += processedLoc;
- if (!res)
- return false;
- if (processedLoc == 0)
- return true;
- data = (const void *)((const unsigned char *)data + processedLoc);
- size -= processedLoc;
- }
- while (size > 0);
- return true;
-}
-
-bool COutFile::SetEndOfFile() { return BOOLToBool(::SetEndOfFile(_handle)); }
-
-bool COutFile::SetLength(UInt64 length)
-{
- UInt64 newPosition;
- if(!Seek(length, newPosition))
- return false;
- if(newPosition != length)
- return false;
- return SetEndOfFile();
-}
-
-}}}
diff --git a/other-licenses/7zstub/src/Windows/FileIO.h b/other-licenses/7zstub/src/Windows/FileIO.h
deleted file mode 100644
index de66d7f3a9..0000000000
--- a/other-licenses/7zstub/src/Windows/FileIO.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Windows/FileIO.h
-
-#ifndef __WINDOWS_FILEIO_H
-#define __WINDOWS_FILEIO_H
-
-#include "../Common/Types.h"
-
-namespace NWindows {
-namespace NFile {
-namespace NIO {
-
-struct CByHandleFileInfo
-{
- DWORD Attributes;
- FILETIME CreationTime;
- FILETIME LastAccessTime;
- FILETIME LastWriteTime;
- DWORD VolumeSerialNumber;
- UInt64 Size;
- DWORD NumberOfLinks;
- UInt64 FileIndex;
-};
-
-class CFileBase
-{
-protected:
- bool _fileIsOpen;
- HANDLE _handle;
- bool Create(LPCTSTR fileName, DWORD desiredAccess,
- DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
- #ifndef _UNICODE
- bool Create(LPCWSTR fileName, DWORD desiredAccess,
- DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
- #endif
-
-public:
- CFileBase(): _fileIsOpen(false){};
- virtual ~CFileBase();
-
- virtual bool Close();
-
- bool GetPosition(UInt64 &position) const;
- bool GetLength(UInt64 &length) const;
-
- bool Seek(Int64 distanceToMove, DWORD moveMethod, UInt64 &newPosition) const;
- bool Seek(UInt64 position, UInt64 &newPosition);
- bool SeekToBegin();
- bool SeekToEnd(UInt64 &newPosition);
-
- bool GetFileInformation(CByHandleFileInfo &fileInfo) const;
-};
-
-class CInFile: public CFileBase
-{
-public:
- bool Open(LPCTSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
- bool Open(LPCTSTR fileName);
- #ifndef _UNICODE
- bool Open(LPCWSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
- bool Open(LPCWSTR fileName);
- #endif
- bool ReadPart(void *data, UInt32 size, UInt32 &processedSize);
- bool Read(void *data, UInt32 size, UInt32 &processedSize);
-};
-
-class COutFile: public CFileBase
-{
- // DWORD m_CreationDisposition;
-public:
- // COutFile(): m_CreationDisposition(CREATE_NEW){};
- bool Open(LPCTSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
- bool Open(LPCTSTR fileName, DWORD creationDisposition);
- bool Create(LPCTSTR fileName, bool createAlways);
-
- #ifndef _UNICODE
- bool Open(LPCWSTR fileName, DWORD shareMode, DWORD creationDisposition, DWORD flagsAndAttributes);
- bool Open(LPCWSTR fileName, DWORD creationDisposition);
- bool Create(LPCWSTR fileName, bool createAlways);
- #endif
-
- /*
- void SetOpenCreationDisposition(DWORD creationDisposition)
- { m_CreationDisposition = creationDisposition; }
- void SetOpenCreationDispositionCreateAlways()
- { m_CreationDisposition = CREATE_ALWAYS; }
- */
-
- bool SetTime(const FILETIME *creationTime, const FILETIME *lastAccessTime, const FILETIME *lastWriteTime);
- bool SetLastWriteTime(const FILETIME *lastWriteTime);
- bool WritePart(const void *data, UInt32 size, UInt32 &processedSize);
- bool Write(const void *data, UInt32 size, UInt32 &processedSize);
- bool SetEndOfFile();
- bool SetLength(UInt64 length);
-};
-
-}}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/FileName.cpp b/other-licenses/7zstub/src/Windows/FileName.cpp
deleted file mode 100644
index 4a8a504e35..0000000000
--- a/other-licenses/7zstub/src/Windows/FileName.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-// Windows/FileName.cpp
-
-#include "StdAfx.h"
-
-#include "Windows/FileName.h"
-#include "Common/Wildcard.h"
-
-namespace NWindows {
-namespace NFile {
-namespace NName {
-
-static const wchar_t kDiskDelimiter = L':';
-
-/*
-static bool IsCharAPrefixDelimiter(wchar_t c)
- { return (c == kDirDelimiter || c == kDiskDelimiter); }
-*/
-
-void NormalizeDirPathPrefix(CSysString &dirPath)
-{
- if (dirPath.IsEmpty())
- return;
- if (dirPath.ReverseFind(kDirDelimiter) != dirPath.Length() - 1)
- dirPath += kDirDelimiter;
-}
-
-#ifndef _UNICODE
-void NormalizeDirPathPrefix(UString &dirPath)
-{
- if (dirPath.IsEmpty())
- return;
- if (dirPath.ReverseFind(wchar_t(kDirDelimiter)) != dirPath.Length() - 1)
- dirPath += wchar_t(kDirDelimiter);
-}
-#endif
-
-namespace NPathType
-{
- EEnum GetPathType(const UString &path)
- {
- if (path.Length() <= 2)
- return kLocal;
- if (path[0] == kDirDelimiter && path[1] == kDirDelimiter)
- return kUNC;
- return kLocal;
- }
-}
-
-void CParsedPath::ParsePath(const UString &path)
-{
- int curPos = 0;
- switch (NPathType::GetPathType(path))
- {
- case NPathType::kLocal:
- {
- int posDiskDelimiter = path.Find(kDiskDelimiter);
- if(posDiskDelimiter >= 0)
- {
- curPos = posDiskDelimiter + 1;
- if (path.Length() > curPos)
- if(path[curPos] == kDirDelimiter)
- curPos++;
- }
- break;
- }
- case NPathType::kUNC:
- {
- int curPos = path.Find(kDirDelimiter, 2);
- if(curPos < 0)
- curPos = path.Length();
- else
- curPos++;
- }
- }
- Prefix = path.Left(curPos);
- SplitPathToParts(path.Mid(curPos), PathParts);
-}
-
-UString CParsedPath::MergePath() const
-{
- UString result = Prefix;
- for(int i = 0; i < PathParts.Size(); i++)
- {
- if (i != 0)
- result += kDirDelimiter;
- result += PathParts[i];
- }
- return result;
-}
-
-const wchar_t kExtensionDelimiter = L'.';
-
-void SplitNameToPureNameAndExtension(const UString &fullName,
- UString &pureName, UString &extensionDelimiter, UString &extension)
-{
- int index = fullName.ReverseFind(kExtensionDelimiter);
- if (index < 0)
- {
- pureName = fullName;
- extensionDelimiter.Empty();
- extension.Empty();
- }
- else
- {
- pureName = fullName.Left(index);
- extensionDelimiter = kExtensionDelimiter;
- extension = fullName.Mid(index + 1);
- }
-}
-
-}}}
diff --git a/other-licenses/7zstub/src/Windows/FileName.h b/other-licenses/7zstub/src/Windows/FileName.h
deleted file mode 100644
index a4e9f36c32..0000000000
--- a/other-licenses/7zstub/src/Windows/FileName.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Windows/FileName.h
-
-#ifndef __WINDOWS_FILENAME_H
-#define __WINDOWS_FILENAME_H
-
-#include "../Common/String.h"
-
-namespace NWindows {
-namespace NFile {
-namespace NName {
-
-const TCHAR kDirDelimiter = CHAR_PATH_SEPARATOR;
-const TCHAR kAnyStringWildcard = '*';
-
-void NormalizeDirPathPrefix(CSysString &dirPath); // ensures that it ended with '\\'
-#ifndef _UNICODE
-void NormalizeDirPathPrefix(UString &dirPath); // ensures that it ended with '\\'
-#endif
-
-namespace NPathType
-{
- enum EEnum
- {
- kLocal,
- kUNC
- };
- EEnum GetPathType(const UString &path);
-}
-
-struct CParsedPath
-{
- UString Prefix; // Disk or UNC with slash
- UStringVector PathParts;
- void ParsePath(const UString &path);
- UString MergePath() const;
-};
-
-void SplitNameToPureNameAndExtension(const UString &fullName,
- UString &pureName, UString &extensionDelimiter, UString &extension);
-
-}}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Handle.h b/other-licenses/7zstub/src/Windows/Handle.h
deleted file mode 100644
index 9e559e89e3..0000000000
--- a/other-licenses/7zstub/src/Windows/Handle.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Windows/Handle.h
-
-#ifndef __WINDOWS_HANDLE_H
-#define __WINDOWS_HANDLE_H
-
-namespace NWindows {
-
-class CHandle
-{
-protected:
- HANDLE _handle;
-public:
- operator HANDLE() { return _handle; }
- CHandle(): _handle(NULL) {}
- ~CHandle() { Close(); }
- bool Close()
- {
- if (_handle == NULL)
- return true;
- if (!::CloseHandle(_handle))
- return false;
- _handle = NULL;
- return true;
- }
- void Attach(HANDLE handle)
- { _handle = handle; }
- HANDLE Detach()
- {
- HANDLE handle = _handle;
- _handle = NULL;
- return handle;
- }
-};
-
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/PropVariant.cpp b/other-licenses/7zstub/src/Windows/PropVariant.cpp
deleted file mode 100644
index a4bfdd35b3..0000000000
--- a/other-licenses/7zstub/src/Windows/PropVariant.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-// Windows/PropVariant.cpp
-
-#include "StdAfx.h"
-
-#include "PropVariant.h"
-
-#include "../Common/Defs.h"
-
-namespace NWindows {
-namespace NCOM {
-
-CPropVariant::CPropVariant(const PROPVARIANT& varSrc)
-{
- vt = VT_EMPTY;
- InternalCopy(&varSrc);
-}
-
-CPropVariant::CPropVariant(const CPropVariant& varSrc)
-{
- vt = VT_EMPTY;
- InternalCopy(&varSrc);
-}
-
-CPropVariant::CPropVariant(BSTR bstrSrc)
-{
- vt = VT_EMPTY;
- *this = bstrSrc;
-}
-
-CPropVariant::CPropVariant(LPCOLESTR lpszSrc)
-{
- vt = VT_EMPTY;
- *this = lpszSrc;
-}
-
-CPropVariant& CPropVariant::operator=(const CPropVariant& varSrc)
-{
- InternalCopy(&varSrc);
- return *this;
-}
-CPropVariant& CPropVariant::operator=(const PROPVARIANT& varSrc)
-{
- InternalCopy(&varSrc);
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(BSTR bstrSrc)
-{
- *this = (LPCOLESTR)bstrSrc;
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(LPCOLESTR lpszSrc)
-{
- InternalClear();
- vt = VT_BSTR;
- bstrVal = ::SysAllocString(lpszSrc);
- if (bstrVal == NULL && lpszSrc != NULL)
- {
- vt = VT_ERROR;
- scode = E_OUTOFMEMORY;
- }
- return *this;
-}
-
-
-CPropVariant& CPropVariant::operator=(bool bSrc)
-{
- if (vt != VT_BOOL)
- {
- InternalClear();
- vt = VT_BOOL;
- }
- boolVal = bSrc ? VARIANT_TRUE : VARIANT_FALSE;
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(UInt32 value)
-{
- if (vt != VT_UI4)
- {
- InternalClear();
- vt = VT_UI4;
- }
- ulVal = value;
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(UInt64 value)
-{
- if (vt != VT_UI8)
- {
- InternalClear();
- vt = VT_UI8;
- }
- uhVal.QuadPart = value;
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(const FILETIME &value)
-{
- if (vt != VT_FILETIME)
- {
- InternalClear();
- vt = VT_FILETIME;
- }
- filetime = value;
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(Int32 value)
-{
- if (vt != VT_I4)
- {
- InternalClear();
- vt = VT_I4;
- }
- lVal = value;
-
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(Byte value)
-{
- if (vt != VT_UI1)
- {
- InternalClear();
- vt = VT_UI1;
- }
- bVal = value;
- return *this;
-}
-
-CPropVariant& CPropVariant::operator=(Int16 value)
-{
- if (vt != VT_I2)
- {
- InternalClear();
- vt = VT_I2;
- }
- iVal = value;
- return *this;
-}
-
-/*
-CPropVariant& CPropVariant::operator=(LONG value)
-{
- if (vt != VT_I4)
- {
- InternalClear();
- vt = VT_I4;
- }
- lVal = value;
- return *this;
-}
-*/
-
-static HRESULT MyPropVariantClear(PROPVARIANT *propVariant)
-{
- switch(propVariant->vt)
- {
- case VT_UI1:
- case VT_I1:
- case VT_I2:
- case VT_UI2:
- case VT_BOOL:
- case VT_I4:
- case VT_UI4:
- case VT_R4:
- case VT_INT:
- case VT_UINT:
- case VT_ERROR:
- case VT_FILETIME:
- case VT_UI8:
- case VT_R8:
- case VT_CY:
- case VT_DATE:
- propVariant->vt = VT_EMPTY;
- return S_OK;
- }
- return ::VariantClear((VARIANTARG *)propVariant);
-}
-
-HRESULT CPropVariant::Clear()
-{
- return MyPropVariantClear(this);
-}
-
-HRESULT CPropVariant::Copy(const PROPVARIANT* pSrc)
-{
- ::VariantClear((tagVARIANT *)this);
- switch(pSrc->vt)
- {
- case VT_UI1:
- case VT_I1:
- case VT_I2:
- case VT_UI2:
- case VT_BOOL:
- case VT_I4:
- case VT_UI4:
- case VT_R4:
- case VT_INT:
- case VT_UINT:
- case VT_ERROR:
- case VT_FILETIME:
- case VT_UI8:
- case VT_R8:
- case VT_CY:
- case VT_DATE:
- memmove((PROPVARIANT*)this, pSrc, sizeof(PROPVARIANT));
- return S_OK;
- }
- return ::VariantCopy((tagVARIANT *)this, (tagVARIANT *)(pSrc));
-}
-
-
-HRESULT CPropVariant::Attach(PROPVARIANT* pSrc)
-{
- HRESULT hr = Clear();
- if (FAILED(hr))
- return hr;
- memcpy(this, pSrc, sizeof(PROPVARIANT));
- pSrc->vt = VT_EMPTY;
- return S_OK;
-}
-
-HRESULT CPropVariant::Detach(PROPVARIANT* pDest)
-{
- HRESULT hr = MyPropVariantClear(pDest);
- if (FAILED(hr))
- return hr;
- memcpy(pDest, this, sizeof(PROPVARIANT));
- vt = VT_EMPTY;
- return S_OK;
-}
-
-HRESULT CPropVariant::InternalClear()
-{
- HRESULT hr = Clear();
- if (FAILED(hr))
- {
- vt = VT_ERROR;
- scode = hr;
- }
- return hr;
-}
-
-void CPropVariant::InternalCopy(const PROPVARIANT* pSrc)
-{
- HRESULT hr = Copy(pSrc);
- if (FAILED(hr))
- {
- vt = VT_ERROR;
- scode = hr;
- }
-}
-
-int CPropVariant::Compare(const CPropVariant &a)
-{
- if(vt != a.vt)
- return 0; // it's mean some bug
- switch (vt)
- {
- case VT_EMPTY:
- return 0;
-
- /*
- case VT_I1:
- return MyCompare(cVal, a.cVal);
- */
- case VT_UI1:
- return MyCompare(bVal, a.bVal);
-
- case VT_I2:
- return MyCompare(iVal, a.iVal);
- case VT_UI2:
- return MyCompare(uiVal, a.uiVal);
-
- case VT_I4:
- return MyCompare(lVal, a.lVal);
- /*
- case VT_INT:
- return MyCompare(intVal, a.intVal);
- */
- case VT_UI4:
- return MyCompare(ulVal, a.ulVal);
- /*
- case VT_UINT:
- return MyCompare(uintVal, a.uintVal);
- */
- case VT_I8:
- return MyCompare(hVal.QuadPart, a.hVal.QuadPart);
- case VT_UI8:
- return MyCompare(uhVal.QuadPart, a.uhVal.QuadPart);
-
- case VT_BOOL:
- return -MyCompare(boolVal, a.boolVal);
-
- case VT_FILETIME:
- return ::CompareFileTime(&filetime, &a.filetime);
- case VT_BSTR:
- return 0; // Not implemented
- // return MyCompare(aPropVarint.cVal);
-
- default:
- return 0;
- }
-}
-
-}}
diff --git a/other-licenses/7zstub/src/Windows/PropVariant.h b/other-licenses/7zstub/src/Windows/PropVariant.h
deleted file mode 100644
index 604a4b11b6..0000000000
--- a/other-licenses/7zstub/src/Windows/PropVariant.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Windows/PropVariant.h
-
-#ifndef __WINDOWS_PROPVARIANT_H
-#define __WINDOWS_PROPVARIANT_H
-
-#include "../Common/MyWindows.h"
-#include "../Common/Types.h"
-
-namespace NWindows {
-namespace NCOM {
-
-class CPropVariant : public tagPROPVARIANT
-{
-public:
- CPropVariant() { vt = VT_EMPTY; }
- ~CPropVariant() { Clear(); }
- CPropVariant(const PROPVARIANT& varSrc);
- CPropVariant(const CPropVariant& varSrc);
- CPropVariant(BSTR bstrSrc);
- CPropVariant(LPCOLESTR lpszSrc);
- CPropVariant(bool bSrc) { vt = VT_BOOL; boolVal = (bSrc ? VARIANT_TRUE : VARIANT_FALSE); };
- CPropVariant(UInt32 value) { vt = VT_UI4; ulVal = value; }
- CPropVariant(UInt64 value) { vt = VT_UI8; uhVal = *(ULARGE_INTEGER*)&value; }
- CPropVariant(const FILETIME &value) { vt = VT_FILETIME; filetime = value; }
- CPropVariant(Int32 value) { vt = VT_I4; lVal = value; }
- CPropVariant(Byte value) { vt = VT_UI1; bVal = value; }
- CPropVariant(Int16 value) { vt = VT_I2; iVal = value; }
- // CPropVariant(LONG value, VARTYPE vtSrc = VT_I4) { vt = vtSrc; lVal = value; }
-
- CPropVariant& operator=(const CPropVariant& varSrc);
- CPropVariant& operator=(const PROPVARIANT& varSrc);
- CPropVariant& operator=(BSTR bstrSrc);
- CPropVariant& operator=(LPCOLESTR lpszSrc);
- CPropVariant& operator=(bool bSrc);
- CPropVariant& operator=(UInt32 value);
- CPropVariant& operator=(UInt64 value);
- CPropVariant& operator=(const FILETIME &value);
-
- CPropVariant& operator=(Int32 value);
- CPropVariant& operator=(Byte value);
- CPropVariant& operator=(Int16 value);
- // CPropVariant& operator=(LONG value);
-
- HRESULT Clear();
- HRESULT Copy(const PROPVARIANT* pSrc);
- HRESULT Attach(PROPVARIANT* pSrc);
- HRESULT Detach(PROPVARIANT* pDest);
-
- HRESULT InternalClear();
- void InternalCopy(const PROPVARIANT* pSrc);
-
- int Compare(const CPropVariant &a1);
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/PropVariantConversions.cpp b/other-licenses/7zstub/src/Windows/PropVariantConversions.cpp
deleted file mode 100644
index acf7955cb0..0000000000
--- a/other-licenses/7zstub/src/Windows/PropVariantConversions.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-// PropVariantConversions.cpp
-
-#include "StdAfx.h"
-
-#include <stdio.h>
-
-#include "PropVariantConversions.h"
-
-#include "Windows/Defs.h"
-
-#include "Common/StringConvert.h"
-#include "Common/IntToString.h"
-
-static UString ConvertUInt64ToString(UInt64 value)
-{
- wchar_t buffer[32];
- ConvertUInt64ToString(value, buffer);
- return buffer;
-}
-
-static UString ConvertInt64ToString(Int64 value)
-{
- wchar_t buffer[32];
- ConvertInt64ToString(value, buffer);
- return buffer;
-}
-
-/*
-static void UIntToStringSpec(UInt32 value, char *s, int numPos)
-{
- char s2[32];
- ConvertUInt64ToString(value, s2);
- int len = strlen(s2);
- int i;
- for (i = 0; i < numPos - len; i++)
- s[i] = '0';
- for (int j = 0; j < len; j++, i++)
- s[i] = s2[j];
- s[i] = '\0';
-}
-*/
-
-bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime, bool includeSeconds)
-{
- s[0] = '\0';
- SYSTEMTIME st;
- if(!BOOLToBool(FileTimeToSystemTime(&ft, &st)))
- return false;
- /*
- UIntToStringSpec(st.wYear, s, 4);
- strcat(s, "-");
- UIntToStringSpec(st.wMonth, s + strlen(s), 2);
- strcat(s, "-");
- UIntToStringSpec(st.wDay, s + strlen(s), 2);
- if (includeTime)
- {
- strcat(s, " ");
- UIntToStringSpec(st.wHour, s + strlen(s), 2);
- strcat(s, ":");
- UIntToStringSpec(st.wMinute, s + strlen(s), 2);
- if (includeSeconds)
- {
- strcat(s, ":");
- UIntToStringSpec(st.wSecond, s + strlen(s), 2);
- }
- }
- */
- sprintf(s, "%04d-%02d-%02d", st.wYear, st.wMonth, st.wDay);
- if (includeTime)
- {
- sprintf(s + strlen(s), " %02d:%02d", st.wHour, st.wMinute);
- if (includeSeconds)
- sprintf(s + strlen(s), ":%02d", st.wSecond);
- }
- return true;
-}
-
-UString ConvertFileTimeToString(const FILETIME &fileTime, bool includeTime, bool includeSeconds)
-{
- char s[32];
- ConvertFileTimeToString(fileTime, s, includeTime, includeSeconds);
- return GetUnicodeString(s);
-}
-
-
-UString ConvertPropVariantToString(const PROPVARIANT &propVariant)
-{
- switch (propVariant.vt)
- {
- case VT_EMPTY:
- return UString();
- case VT_BSTR:
- return propVariant.bstrVal;
- case VT_UI1:
- return ConvertUInt64ToString(propVariant.bVal);
- case VT_UI2:
- return ConvertUInt64ToString(propVariant.uiVal);
- case VT_UI4:
- return ConvertUInt64ToString(propVariant.ulVal);
- case VT_UI8:
- return ConvertUInt64ToString(propVariant.uhVal.QuadPart);
- case VT_FILETIME:
- return ConvertFileTimeToString(propVariant.filetime, true, true);
- /*
- case VT_I1:
- return ConvertInt64ToString(propVariant.cVal);
- */
- case VT_I2:
- return ConvertInt64ToString(propVariant.iVal);
- case VT_I4:
- return ConvertInt64ToString(propVariant.lVal);
- case VT_I8:
- return ConvertInt64ToString(propVariant.hVal.QuadPart);
-
- case VT_BOOL:
- return VARIANT_BOOLToBool(propVariant.boolVal) ? L"1" : L"0";
- default:
- #ifndef _WIN32_WCE
- throw 150245;
- #else
- return UString();
- #endif
- }
-}
-
-UInt64 ConvertPropVariantToUInt64(const PROPVARIANT &propVariant)
-{
- switch (propVariant.vt)
- {
- case VT_UI1:
- return propVariant.bVal;
- case VT_UI2:
- return propVariant.uiVal;
- case VT_UI4:
- return propVariant.ulVal;
- case VT_UI8:
- return (UInt64)propVariant.uhVal.QuadPart;
- default:
- #ifndef _WIN32_WCE
- throw 151199;
- #else
- return 0;
- #endif
- }
-}
diff --git a/other-licenses/7zstub/src/Windows/PropVariantConversions.h b/other-licenses/7zstub/src/Windows/PropVariantConversions.h
deleted file mode 100644
index ea7e72417e..0000000000
--- a/other-licenses/7zstub/src/Windows/PropVariantConversions.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// Windows/PropVariantConversions.h
-
-#ifndef __PROPVARIANTCONVERSIONS_H
-#define __PROPVARIANTCONVERSIONS_H
-
-#include "Common/Types.h"
-#include "Common/String.h"
-
-bool ConvertFileTimeToString(const FILETIME &ft, char *s, bool includeTime = true, bool includeSeconds = true);
-UString ConvertFileTimeToString(const FILETIME &ft, bool includeTime = true, bool includeSeconds = true);
-UString ConvertPropVariantToString(const PROPVARIANT &propVariant);
-UInt64 ConvertPropVariantToUInt64(const PROPVARIANT &propVariant);
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/ResourceString.cpp b/other-licenses/7zstub/src/Windows/ResourceString.cpp
deleted file mode 100644
index 679d5ef0ea..0000000000
--- a/other-licenses/7zstub/src/Windows/ResourceString.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// Windows/ResourceString.cpp
-
-#include "StdAfx.h"
-
-#include "Windows/ResourceString.h"
-#ifndef _UNICODE
-#include "Common/StringConvert.h"
-#endif
-
-extern HINSTANCE g_hInstance;
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-
-CSysString MyLoadString(UINT resourceID)
-{
- CSysString s;
- int size = 256;
- int len;
- do
- {
- size += 256;
- len = ::LoadString(g_hInstance, resourceID, s.GetBuffer(size - 1), size);
- }
- while (size - len <= 1);
- s.ReleaseBuffer();
- return s;
-}
-
-#ifndef _UNICODE
-UString MyLoadStringW(UINT resourceID)
-{
- if (g_IsNT)
- {
- UString s;
- int size = 256;
- int len;
- do
- {
- size += 256;
- len = ::LoadStringW(g_hInstance, resourceID, s.GetBuffer(size - 1), size);
- }
- while (size - len <= 1);
- s.ReleaseBuffer();
- return s;
- }
- return GetUnicodeString(MyLoadString(resourceID));
-}
-#endif
-
-}
diff --git a/other-licenses/7zstub/src/Windows/ResourceString.h b/other-licenses/7zstub/src/Windows/ResourceString.h
deleted file mode 100644
index 3a447514f7..0000000000
--- a/other-licenses/7zstub/src/Windows/ResourceString.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Windows/ResourceString.h
-
-#ifndef __WINDOWS_RESOURCESTRING_H
-#define __WINDOWS_RESOURCESTRING_H
-
-#include "Common/String.h"
-
-namespace NWindows {
-
-CSysString MyLoadString(UINT resourceID);
-#ifdef _UNICODE
-inline UString MyLoadStringW(UINT resourceID)
- { return MyLoadString(resourceID); }
-#else
-UString MyLoadStringW(UINT resourceID);
-#endif
-
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Synchronization.cpp b/other-licenses/7zstub/src/Windows/Synchronization.cpp
deleted file mode 100644
index 942d868609..0000000000
--- a/other-licenses/7zstub/src/Windows/Synchronization.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// Windows/Synchronization.cpp
-
-#include "StdAfx.h"
-
-#include "Synchronization.h"
-
-namespace NWindows {
-namespace NSynchronization {
-
-CEvent::CEvent(bool manualReset, bool initiallyOwn, LPCTSTR name,
- LPSECURITY_ATTRIBUTES securityAttributes)
-{
- if (!Create(manualReset, initiallyOwn, name, securityAttributes))
- throw "CreateEvent error";
-}
-
-}}
diff --git a/other-licenses/7zstub/src/Windows/Synchronization.h b/other-licenses/7zstub/src/Windows/Synchronization.h
deleted file mode 100644
index aff3356be5..0000000000
--- a/other-licenses/7zstub/src/Windows/Synchronization.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// Windows/Synchronization.h
-
-#ifndef __WINDOWS_SYNCHRONIZATION_H
-#define __WINDOWS_SYNCHRONIZATION_H
-
-#include "Defs.h"
-#include "Handle.h"
-
-namespace NWindows {
-namespace NSynchronization {
-
-class CObject: public CHandle
-{
-public:
- bool Lock(DWORD timeoutInterval = INFINITE)
- { return (::WaitForSingleObject(_handle, timeoutInterval) == WAIT_OBJECT_0); }
-};
-
-class CBaseEvent: public CObject
-{
-public:
- bool Create(bool manualReset, bool initiallyOwn, LPCTSTR name = NULL,
- LPSECURITY_ATTRIBUTES securityAttributes = NULL)
- {
- _handle = ::CreateEvent(securityAttributes, BoolToBOOL(manualReset),
- BoolToBOOL(initiallyOwn), name);
- return (_handle != 0);
- }
-
- bool Open(DWORD desiredAccess, bool inheritHandle, LPCTSTR name)
- {
- _handle = ::OpenEvent(desiredAccess, BoolToBOOL(inheritHandle), name);
- return (_handle != 0);
- }
-
- bool Set() { return BOOLToBool(::SetEvent(_handle)); }
- bool Pulse() { return BOOLToBool(::PulseEvent(_handle)); }
- bool Reset() { return BOOLToBool(::ResetEvent(_handle)); }
-};
-
-class CEvent: public CBaseEvent
-{
-public:
- CEvent() {};
- CEvent(bool manualReset, bool initiallyOwn,
- LPCTSTR name = NULL, LPSECURITY_ATTRIBUTES securityAttributes = NULL);
-};
-
-class CManualResetEvent: public CEvent
-{
-public:
- CManualResetEvent(bool initiallyOwn = false, LPCTSTR name = NULL,
- LPSECURITY_ATTRIBUTES securityAttributes = NULL):
- CEvent(true, initiallyOwn, name, securityAttributes) {};
-};
-
-class CAutoResetEvent: public CEvent
-{
-public:
- CAutoResetEvent(bool initiallyOwn = false, LPCTSTR name = NULL,
- LPSECURITY_ATTRIBUTES securityAttributes = NULL):
- CEvent(false, initiallyOwn, name, securityAttributes) {};
-};
-
-class CMutex: public CObject
-{
-public:
- bool Create(bool initiallyOwn, LPCTSTR name = NULL,
- LPSECURITY_ATTRIBUTES securityAttributes = NULL)
- {
- _handle = ::CreateMutex(securityAttributes, BoolToBOOL(initiallyOwn), name);
- return (_handle != 0);
- }
- bool Open(DWORD desiredAccess, bool inheritHandle, LPCTSTR name)
- {
- _handle = ::OpenMutex(desiredAccess, BoolToBOOL(inheritHandle), name);
- return (_handle != 0);
- }
- bool Release() { return BOOLToBool(::ReleaseMutex(_handle)); }
-};
-
-class CMutexLock
-{
- CMutex &_object;
-public:
- CMutexLock(CMutex &object): _object(object) { _object.Lock(); }
- ~CMutexLock() { _object.Release(); }
-};
-
-class CCriticalSection
-{
- CRITICAL_SECTION _object;
- // void Initialize() { ::InitializeCriticalSection(&_object); }
- // void Delete() { ::DeleteCriticalSection(&_object); }
-public:
- CCriticalSection() { ::InitializeCriticalSection(&_object); }
- ~CCriticalSection() { ::DeleteCriticalSection(&_object); }
- void Enter() { ::EnterCriticalSection(&_object); }
- void Leave() { ::LeaveCriticalSection(&_object); }
-};
-
-class CCriticalSectionLock
-{
- CCriticalSection &_object;
- void Unlock() { _object.Leave(); }
-public:
- CCriticalSectionLock(CCriticalSection &object): _object(object)
- {_object.Enter(); }
- ~CCriticalSectionLock() { Unlock(); }
-};
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Thread.h b/other-licenses/7zstub/src/Windows/Thread.h
deleted file mode 100644
index 76be6dfba1..0000000000
--- a/other-licenses/7zstub/src/Windows/Thread.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Windows/Thread.h
-
-#ifndef __WINDOWS_THREAD_H
-#define __WINDOWS_THREAD_H
-
-#include "Handle.h"
-#include "Defs.h"
-
-namespace NWindows {
-
-class CThread: public CHandle
-{
- bool IsOpen() const { return _handle != 0; }
-public:
- bool Create(LPSECURITY_ATTRIBUTES threadAttributes,
- SIZE_T stackSize, LPTHREAD_START_ROUTINE startAddress,
- LPVOID parameter, DWORD creationFlags, LPDWORD threadId)
- {
- _handle = ::CreateThread(threadAttributes, stackSize, startAddress,
- parameter, creationFlags, threadId);
- return (_handle != NULL);
- }
- bool Create(LPTHREAD_START_ROUTINE startAddress, LPVOID parameter)
- {
- DWORD threadId;
- return Create(NULL, 0, startAddress, parameter, 0, &threadId);
- }
-
- DWORD Resume()
- { return ::ResumeThread(_handle); }
- DWORD Suspend()
- { return ::SuspendThread(_handle); }
- bool Terminate(DWORD exitCode)
- { return BOOLToBool(::TerminateThread(_handle, exitCode)); }
-
- int GetPriority()
- { return ::GetThreadPriority(_handle); }
- bool SetPriority(int priority)
- { return BOOLToBool(::SetThreadPriority(_handle, priority)); }
-
- bool Wait()
- {
- if (!IsOpen())
- return true;
- return (::WaitForSingleObject(_handle, INFINITE) == WAIT_OBJECT_0);
- }
-
-};
-
-}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Time.h b/other-licenses/7zstub/src/Windows/Time.h
deleted file mode 100644
index b16602aa18..0000000000
--- a/other-licenses/7zstub/src/Windows/Time.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Windows/Time.h
-
-#ifndef __WINDOWS_TIME_H
-#define __WINDOWS_TIME_H
-
-#include "Common/Types.h"
-#include "Windows/Defs.h"
-
-namespace NWindows {
-namespace NTime {
-
-inline bool DosTimeToFileTime(UInt32 dosTime, FILETIME &fileTime)
-{
- return BOOLToBool(::DosDateTimeToFileTime(UInt16(dosTime >> 16),
- UInt16(dosTime & 0xFFFF), &fileTime));
-}
-
-const UInt32 kHighDosTime = 0xFF9FBF7D;
-const UInt32 kLowDosTime = 0x210000;
-
-inline bool FileTimeToDosTime(const FILETIME &fileTime, UInt32 &dosTime)
-{
- WORD datePart, timePart;
- if (!::FileTimeToDosDateTime(&fileTime, &datePart, &timePart))
- {
- if (fileTime.dwHighDateTime >= 0x01C00000) // 2000
- dosTime = kHighDosTime;
- else
- dosTime = kLowDosTime;
- return false;
- }
- dosTime = (((UInt32)datePart) << 16) + timePart;
- return true;
-}
-
-const UInt32 kNumTimeQuantumsInSecond = 10000000;
-const UInt64 kUnixTimeStartValue = ((UInt64)kNumTimeQuantumsInSecond) * 60 * 60 * 24 * 134774;
-
-inline void UnixTimeToFileTime(UInt32 unixTime, FILETIME &fileTime)
-{
- UInt64 v = kUnixTimeStartValue + ((UInt64)unixTime) * kNumTimeQuantumsInSecond;
- fileTime.dwLowDateTime = (DWORD)v;
- fileTime.dwHighDateTime = (DWORD)(v >> 32);
-}
-
-inline bool FileTimeToUnixTime(const FILETIME &fileTime, UInt32 &unixTime)
-{
- UInt64 winTime = (((UInt64)fileTime.dwHighDateTime) << 32) + fileTime.dwLowDateTime;
- if (winTime < kUnixTimeStartValue)
- {
- unixTime = 0;
- return false;
- }
- winTime = (winTime - kUnixTimeStartValue) / kNumTimeQuantumsInSecond;
- if (winTime > 0xFFFFFFFF)
- {
- unixTime = 0xFFFFFFFF;
- return false;
- }
- unixTime = (UInt32)winTime;
- return true;
-}
-
-}}
-
-#endif
diff --git a/other-licenses/7zstub/src/Windows/Window.cpp b/other-licenses/7zstub/src/Windows/Window.cpp
deleted file mode 100644
index da87687073..0000000000
--- a/other-licenses/7zstub/src/Windows/Window.cpp
+++ /dev/null
@@ -1,169 +0,0 @@
-// Windows/Window.cpp
-
-#include "StdAfx.h"
-
-#ifndef _UNICODE
-#include "Common/StringConvert.h"
-#endif
-#include "Windows/Window.h"
-
-#ifndef _UNICODE
-extern bool g_IsNT;
-#endif
-
-namespace NWindows {
-
-#ifndef _UNICODE
-ATOM MyRegisterClass(CONST WNDCLASSW *wndClass)
-{
- if (g_IsNT)
- return RegisterClassW(wndClass);
- WNDCLASSA wndClassA;
- wndClassA.style = wndClass->style;
- wndClassA.lpfnWndProc = wndClass->lpfnWndProc;
- wndClassA.cbClsExtra = wndClass->cbClsExtra;
- wndClassA.cbWndExtra = wndClass->cbWndExtra;
- wndClassA.hInstance = wndClass->hInstance;
- wndClassA.hIcon = wndClass->hIcon;
- wndClassA.hCursor = wndClass->hCursor;
- wndClassA.hbrBackground = wndClass->hbrBackground;
- AString menuName;
- AString className;
- if (IS_INTRESOURCE(wndClass->lpszMenuName))
- wndClassA.lpszMenuName = (LPCSTR)wndClass->lpszMenuName;
- else
- {
- menuName = GetSystemString(wndClass->lpszMenuName);
- wndClassA.lpszMenuName = menuName;
- }
- if (IS_INTRESOURCE(wndClass->lpszClassName))
- wndClassA.lpszClassName = (LPCSTR)wndClass->lpszClassName;
- else
- {
- className = GetSystemString(wndClass->lpszClassName);
- wndClassA.lpszClassName = className;
- }
- return RegisterClassA(&wndClassA);
-}
-
-bool CWindow::Create(LPCWSTR className,
- LPCWSTR windowName, DWORD style,
- int x, int y, int width, int height,
- HWND parentWindow, HMENU idOrHMenu,
- HINSTANCE instance, LPVOID createParam)
-{
- if (g_IsNT)
- {
- _window = ::CreateWindowW(className, windowName,
- style, x, y, width, height, parentWindow,
- idOrHMenu, instance, createParam);
- return (_window != NULL);
- }
- return Create(GetSystemString(className), GetSystemString(windowName),
- style, x, y, width, height, parentWindow,
- idOrHMenu, instance, createParam);
-}
-
-bool CWindow::CreateEx(DWORD exStyle, LPCWSTR className,
- LPCWSTR windowName, DWORD style,
- int x, int y, int width, int height,
- HWND parentWindow, HMENU idOrHMenu,
- HINSTANCE instance, LPVOID createParam)
-{
- if (g_IsNT)
- {
- _window = ::CreateWindowExW(exStyle, className, windowName,
- style, x, y, width, height, parentWindow,
- idOrHMenu, instance, createParam);
- return (_window != NULL);
- }
- AString classNameA;
- LPCSTR classNameP;
- if (IS_INTRESOURCE(className))
- classNameP = (LPCSTR)className;
- else
- {
- classNameA = GetSystemString(className);
- classNameP = classNameA;
- }
- AString windowNameA;
- LPCSTR windowNameP;
- if (IS_INTRESOURCE(windowName))
- windowNameP = (LPCSTR)windowName;
- else
- {
- windowNameA = GetSystemString(windowName);
- windowNameP = windowNameA;
- }
- return CreateEx(exStyle, classNameP, windowNameP,
- style, x, y, width, height, parentWindow,
- idOrHMenu, instance, createParam);
-}
-
-#endif
-
-#ifndef _UNICODE
-bool MySetWindowText(HWND wnd, LPCWSTR s)
-{
- if (g_IsNT)
- return BOOLToBool(::SetWindowTextW(wnd, s));
- return BOOLToBool(::SetWindowTextA(wnd, UnicodeStringToMultiByte(s)));
-}
-#endif
-
-bool CWindow::GetText(CSysString &s)
-{
- s.Empty();
- int length = GetTextLength();
- if (length == 0)
- return (::GetLastError() == ERROR_SUCCESS);
- length = GetText(s.GetBuffer(length), length + 1);
- s.ReleaseBuffer();
- if (length == 0)
- return (::GetLastError() != ERROR_SUCCESS);
- return true;
-}
-
-#ifndef _UNICODE
-bool CWindow::GetText(UString &s)
-{
- if (g_IsNT)
- {
- s.Empty();
- int length = GetWindowTextLengthW(_window);
- if (length == 0)
- return (::GetLastError() == ERROR_SUCCESS);
- length = GetWindowTextW(_window, s.GetBuffer(length), length + 1);
- s.ReleaseBuffer();
- if (length == 0)
- return (::GetLastError() == ERROR_SUCCESS);
- return true;
- }
- CSysString sysString;
- bool result = GetText(sysString);
- s = GetUnicodeString(sysString);
- return result;
-}
-#endif
-
-
-/*
-bool CWindow::ModifyStyleBase(int styleOffset,
- DWORD remove, DWORD add, UINT flags)
-{
- DWORD style = GetWindowLong(styleOffset);
- DWORD newStyle = (style & ~remove) | add;
- if (style == newStyle)
- return false; // it is not good
-
- SetWindowLong(styleOffset, newStyle);
- if (flags != 0)
- {
- ::SetWindowPos(_window, NULL, 0, 0, 0, 0,
- SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | flags);
- }
- return TRUE;
-}
-*/
-
-}
diff --git a/other-licenses/7zstub/src/Windows/Window.h b/other-licenses/7zstub/src/Windows/Window.h
deleted file mode 100644
index b7788a83d5..0000000000
--- a/other-licenses/7zstub/src/Windows/Window.h
+++ /dev/null
@@ -1,211 +0,0 @@
-// Windows/Window.h
-
-#ifndef __WINDOWS_WINDOW_H
-#define __WINDOWS_WINDOW_H
-
-#include "Windows/Defs.h"
-#include "Common/String.h"
-
-namespace NWindows {
-
-inline ATOM MyRegisterClass(CONST WNDCLASS *wndClass)
- { return ::RegisterClass(wndClass); }
-
-#ifndef _UNICODE
-ATOM MyRegisterClass(CONST WNDCLASSW *wndClass);
-#endif
-
-#ifdef _UNICODE
-inline bool MySetWindowText(HWND wnd, LPCWSTR s) { return BOOLToBool(::SetWindowText(wnd, s)); }
-#else
-bool MySetWindowText(HWND wnd, LPCWSTR s);
-#endif
-
-
-
-class CWindow
-{
-private:
- // bool ModifyStyleBase(int styleOffset, DWORD remove, DWORD add, UINT flags);
-protected:
- HWND _window;
-public:
- CWindow(HWND newWindow = NULL): _window(newWindow){};
- CWindow& operator=(HWND newWindow)
- {
- _window = newWindow;
- return *this;
- }
- operator HWND() const { return _window; }
- void Attach(HWND newWindow) { _window = newWindow; }
- HWND Detach()
- {
- HWND window = _window;
- _window = NULL;
- return window;
- }
-
- HWND GetParent() const { return ::GetParent(_window); }
- bool GetWindowRect(LPRECT rect) const { return BOOLToBool(::GetWindowRect(_window,rect )); }
- bool IsZoomed() const { return BOOLToBool(::IsZoomed(_window)); }
- bool ClientToScreen(LPPOINT point) const { return BOOLToBool(::ClientToScreen(_window, point)); }
- bool ScreenToClient(LPPOINT point) const { return BOOLToBool(::ScreenToClient(_window, point)); }
-
- bool CreateEx(DWORD exStyle, LPCTSTR className,
- LPCTSTR windowName, DWORD style,
- int x, int y, int width, int height,
- HWND parentWindow, HMENU idOrHMenu,
- HINSTANCE instance, LPVOID createParam)
- {
- _window = ::CreateWindowEx(exStyle, className, windowName,
- style, x, y, width, height, parentWindow,
- idOrHMenu, instance, createParam);
- return (_window != NULL);
- }
-
- bool Create(LPCTSTR className,
- LPCTSTR windowName, DWORD style,
- int x, int y, int width, int height,
- HWND parentWindow, HMENU idOrHMenu,
- HINSTANCE instance, LPVOID createParam)
- {
- _window = ::CreateWindow(className, windowName,
- style, x, y, width, height, parentWindow,
- idOrHMenu, instance, createParam);
- return (_window != NULL);
- }
-
- #ifndef _UNICODE
- bool Create(LPCWSTR className,
- LPCWSTR windowName, DWORD style,
- int x, int y, int width, int height,
- HWND parentWindow, HMENU idOrHMenu,
- HINSTANCE instance, LPVOID createParam);
- bool CreateEx(DWORD exStyle, LPCWSTR className,
- LPCWSTR windowName, DWORD style,
- int x, int y, int width, int height,
- HWND parentWindow, HMENU idOrHMenu,
- HINSTANCE instance, LPVOID createParam);
- #endif
-
-
- bool Destroy()
- {
- if (_window == NULL)
- return true;
- bool result = BOOLToBool(::DestroyWindow(_window));
- if(result)
- _window = NULL;
- return result;
- }
- bool IsWindow() { return BOOLToBool(::IsWindow(_window)); }
- bool Move(int x, int y, int width, int height, bool repaint = true)
- { return BOOLToBool(::MoveWindow(_window, x, y, width, height, BoolToBOOL(repaint))); }
- bool GetClientRect(LPRECT rect) { return BOOLToBool(::GetClientRect(_window, rect)); }
- bool Show(int cmdShow) { return BOOLToBool(::ShowWindow(_window, cmdShow)); }
- bool SetPlacement(CONST WINDOWPLACEMENT *placement) { return BOOLToBool(::SetWindowPlacement(_window, placement)); }
- bool GetPlacement(WINDOWPLACEMENT *placement) { return BOOLToBool(::GetWindowPlacement(_window, placement)); }
- bool Update() { return BOOLToBool(::UpdateWindow(_window)); }
- bool InvalidateRect(LPCRECT rect, bool backgroundErase = true)
- { return BOOLToBool(::InvalidateRect(_window, rect, BoolToBOOL(backgroundErase))); }
- void SetRedraw(bool redraw = true) { SendMessage(WM_SETREDRAW, BoolToBOOL(redraw), 0); }
-
- #ifndef _WIN32_WCE
- LONG SetStyle(LONG_PTR style)
- { return SetLongPtr(GWL_STYLE, style); }
- DWORD GetStyle( ) const
- { return GetLongPtr(GWL_STYLE); }
- #else
- LONG SetStyle(LONG_PTR style)
- { return SetLong(GWL_STYLE, style); }
- DWORD GetStyle( ) const
- { return GetLong(GWL_STYLE); }
- #endif
-
- LONG_PTR SetLong(int index, LONG_PTR newLongPtr )
- { return ::SetWindowLong(_window, index, newLongPtr); }
- LONG_PTR GetLong(int index) const
- { return ::GetWindowLong(_window, index ); }
- LONG_PTR SetUserDataLong(LONG_PTR newLongPtr )
- { return SetLong(GWLP_USERDATA, newLongPtr); }
- LONG_PTR GetUserDataLong() const
- { return GetLong(GWLP_USERDATA); }
-
- #ifndef _WIN32_WCE
- LONG_PTR SetLongPtr(int index, LONG_PTR newLongPtr )
- { return ::SetWindowLongPtr(_window, index, newLongPtr); }
- #ifndef _UNICODE
- LONG_PTR SetLongPtrW(int index, LONG_PTR newLongPtr )
- { return ::SetWindowLongPtrW(_window, index, newLongPtr); }
- #endif
-
- LONG_PTR GetLongPtr(int index) const
- { return ::GetWindowLongPtr(_window, index ); }
- LONG_PTR SetUserDataLongPtr(LONG_PTR newLongPtr )
- { return SetLongPtr(GWLP_USERDATA, newLongPtr); }
- LONG_PTR GetUserDataLongPtr() const
- { return GetLongPtr(GWLP_USERDATA); }
- #endif
-
- /*
- bool ModifyStyle(HWND hWnd, DWORD remove, DWORD add, UINT flags = 0)
- { return ModifyStyleBase(GWL_STYLE, remove, add, flags); }
- bool ModifyStyleEx(HWND hWnd, DWORD remove, DWORD add, UINT flags = 0)
- { return ModifyStyleBase(GWL_EXSTYLE, remove, add, flags); }
- */
-
- HWND SetFocus() { return ::SetFocus(_window); }
-
- LRESULT SendMessage(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
- { return ::SendMessage(_window, message, wParam, lParam) ;}
- #ifndef _UNICODE
- LRESULT SendMessageW(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
- { return ::SendMessageW(_window, message, wParam, lParam) ;}
- #endif
-
- bool PostMessage(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
- { return BOOLToBool(::PostMessage(_window, message, wParam, lParam)) ;}
- #ifndef _UNICODE
- LRESULT PostMessageW(UINT message, WPARAM wParam = 0, LPARAM lParam = 0)
- { return ::PostMessageW(_window, message, wParam, lParam) ;}
- #endif
-
- bool SetText(LPCTSTR s) { return BOOLToBool(::SetWindowText(_window, s)); }
- #ifndef _UNICODE
- bool CWindow::SetText(LPCWSTR s) { return MySetWindowText(_window, s); }
- #endif
-
- int GetTextLength() const
- { return GetWindowTextLength(_window); }
- UINT GetText(LPTSTR string, int maxCount) const
- { return GetWindowText(_window, string, maxCount); }
- bool GetText(CSysString &s);
- #ifndef _UNICODE
- /*
- UINT GetText(LPWSTR string, int maxCount) const
- { return GetWindowTextW(_window, string, maxCount); }
- */
- bool GetText(UString &s);
- #endif
-
- bool Enable(bool enable)
- { return BOOLToBool(::EnableWindow(_window, BoolToBOOL(enable))); }
-
- bool IsEnabled()
- { return BOOLToBool(::IsWindowEnabled(_window)); }
-
- #ifndef _WIN32_WCE
- HMENU GetSystemMenu(bool revert)
- { return ::GetSystemMenu(_window, BoolToBOOL(revert)); }
- #endif
-
- UINT_PTR SetTimer(UINT_PTR idEvent, UINT elapse, TIMERPROC timerFunc = 0)
- { return ::SetTimer(_window, idEvent, elapse, timerFunc); }
- bool KillTimer(UINT_PTR idEvent)
- {return BOOLToBool(::KillTimer(_window, idEvent)); }
-};
-
-}
-
-#endif
-
diff --git a/other-licenses/7zstub/src/bin/7zS2.sfx b/other-licenses/7zstub/src/bin/7zS2.sfx
new file mode 100644
index 0000000000..261214ffc1
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/7zS2.sfx
Binary files differ
diff --git a/other-licenses/7zstub/src/bin/7zS2con.sfx b/other-licenses/7zstub/src/bin/7zS2con.sfx
new file mode 100644
index 0000000000..137b83cbe3
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/7zS2con.sfx
Binary files differ
diff --git a/other-licenses/7zstub/src/bin/7zSD.sfx b/other-licenses/7zstub/src/bin/7zSD.sfx
new file mode 100644
index 0000000000..caff364a97
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/7zSD.sfx
Binary files differ
diff --git a/other-licenses/7zstub/src/bin/7zdec.exe b/other-licenses/7zstub/src/bin/7zdec.exe
new file mode 100644
index 0000000000..4d3fe370fd
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/7zdec.exe
Binary files differ
diff --git a/other-licenses/7zstub/src/bin/7zr.exe b/other-licenses/7zstub/src/bin/7zr.exe
new file mode 100644
index 0000000000..04e96e7235
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/7zr.exe
Binary files differ
diff --git a/other-licenses/7zstub/src/bin/installer/config.txt b/other-licenses/7zstub/src/bin/installer/config.txt
new file mode 100644
index 0000000000..f7f8fb42ec
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/installer/config.txt
@@ -0,0 +1,5 @@
+;!@Install@!UTF-8!
+Title="Software 7.00"
+BeginPrompt="Do you want to install the Software 7.00?"
+RunProgram="7zr.exe b"
+;!@InstallEnd@!
diff --git a/other-licenses/7zstub/src/bin/installer/cr.bat b/other-licenses/7zstub/src/bin/installer/cr.bat
new file mode 100644
index 0000000000..b51a52ae8a
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/installer/cr.bat
@@ -0,0 +1,5 @@
+del archive.7z
+del archive.exe
+..\7zr a archive.7z ..\7zr.exe -mx -mf=BCJ2
+copy /b ..\7zSD.sfx + config.txt + archive.7z archive.exe
+
diff --git a/other-licenses/7zstub/src/bin/lzma.exe b/other-licenses/7zstub/src/bin/lzma.exe
new file mode 100644
index 0000000000..533e24c53a
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/lzma.exe
Binary files differ
diff --git a/other-licenses/7zstub/src/bin/x64/7zr.exe b/other-licenses/7zstub/src/bin/x64/7zr.exe
new file mode 100644
index 0000000000..b41277429f
--- /dev/null
+++ b/other-licenses/7zstub/src/bin/x64/7zr.exe
Binary files differ
diff --git a/other-licenses/7zstub/uxp/7zSD.manifest b/other-licenses/7zstub/uxp/7zSD.manifest
new file mode 100644
index 0000000000..14639d7f56
--- /dev/null
+++ b/other-licenses/7zstub/uxp/7zSD.manifest
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="7zS.sfx.exe" type="win32"/>
+<description>7-Zip Self-extracting Archive v18.05</description>
+<dependency>
+<dependentAssembly>
+<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="X86" publicKeyToken="6595b64144ccf1df" language="*"/>
+</dependentAssembly>
+</dependency>
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+<security>
+<requestedPrivileges><requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+</requestedPrivileges>
+</security>
+</trustInfo>
+<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+<application>
+<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
+<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
+<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
+<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
+<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
+</application>
+</compatibility>
+<application xmlns="urn:schemas-microsoft-com:asm.v3"><windowsSettings>
+<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+</windowsSettings>
+</application>
+</assembly>
diff --git a/other-licenses/7zstub/uxp/7zSD.sfx b/other-licenses/7zstub/uxp/7zSD.sfx
index 62318e1f36..821f4e5049 100644
--- a/other-licenses/7zstub/uxp/7zSD.sfx
+++ b/other-licenses/7zstub/uxp/7zSD.sfx
Binary files differ
diff --git a/security/manager/ssl/nsSTSPreloadList.errors b/security/manager/ssl/nsSTSPreloadList.errors
index 58b52e9b04..b50899521b 100644
--- a/security/manager/ssl/nsSTSPreloadList.errors
+++ b/security/manager/ssl/nsSTSPreloadList.errors
@@ -1,7 +1,7 @@
0-1.party: could not connect to host
0.me.uk: did not receive HSTS header
00001.am: max-age too low: 129600
-0005.com: did not receive HSTS header
+0005.com: could not connect to host
0005aa.com: could not connect to host
0005pay.com: did not receive HSTS header
00100010.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -51,6 +51,7 @@
040fit.nl: did not receive HSTS header
040fitvitality.nl: did not receive HSTS header
048.ag: could not connect to host
+04911701.cn: could not connect to host
04sun.com: could not connect to host
050508.com: could not connect to host
055268.com: did not receive HSTS header
@@ -61,14 +62,15 @@
066938.com: could not connect to host
06se.com: could not connect to host
070709.net: could not connect to host
-07733.win: did not receive HSTS header
+07733.win: could not connect to host
078805.com: did not receive HSTS header
078810.com: did not receive HSTS header
078820.com: did not receive HSTS header
078860.com: did not receive HSTS header
-078890.com: did not receive HSTS header
+078890.com: could not connect to host
081638.com: did not receive HSTS header
086628.com: did not receive HSTS header
+08detaxe.fr: could not connect to host
09115.com: could not connect to host
0c.eu: did not receive HSTS header
0cdn.ga: could not connect to host
@@ -77,10 +79,12 @@
0fl.com: did not receive HSTS header
0g.org.uk: could not connect to host
0i0.nl: could not connect to host
+0o0.edu.pl: could not connect to host
0o0.ooo: could not connect to host
0p.no: did not receive HSTS header
0vi.org: could not connect to host
0w0.vc: could not connect to host
+0x0.cloud: could not connect to host
0x0a.net: could not connect to host
0x1337.eu: could not connect to host
0x44.net: could not connect to host
@@ -96,7 +100,6 @@
0xaa55.me: could not connect to host
0xb612.org: could not connect to host
0xcafec0.de: did not receive HSTS header
-0xf00.ch: could not connect to host
1.0.0.1: max-age too low: 0
1000hats.com: did not receive HSTS header
1000serien.com: could not connect to host
@@ -108,7 +111,6 @@
1018hosting.nl: did not receive HSTS header
1022996493.rsc.cdn77.org: could not connect to host
10414.org: could not connect to host
-1066.io: could not connect to host
1091.jp: could not connect to host
10gbit.ovh: could not connect to host
10seos.com: did not receive HSTS header
@@ -120,14 +122,21 @@
110110110.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
1116pay.com: did not receive HSTS header
112112112.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+11221jz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
113113113.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
118118118.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
11bt.cc: did not receive HSTS header
11recruitment.com.au: did not receive HSTS header
11scc.com: could not connect to host
120dayweightloss.com: could not connect to host
+123.gg: could not connect to host
+123110.com: could not connect to host
+1231212.com: did not receive HSTS header
+123123q.com: did not receive HSTS header
123movies.fyi: did not receive HSTS header
+123nutricion.es: could not connect to host
123pay.ir: did not receive HSTS header
+123plons.nl: could not connect to host
123share.org: did not receive HSTS header
123termpapers.com: could not connect to host
123test.com: did not receive HSTS header
@@ -138,6 +147,8 @@
126ium.moe: could not connect to host
127011-networks.ch: could not connect to host
1288366.com: could not connect to host
+1288fc.com: could not connect to host
+12photos.eu: max-age too low: 0
12vpn.org: could not connect to host
12vpnchina.com: could not connect to host
130978.com: did not receive HSTS header
@@ -148,6 +159,7 @@
1395kj.com: did not receive HSTS header
1396.cc: could not connect to host
1396.net: did not receive HSTS header
+13th-dover.uk: could not connect to host
1481481.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
1481481.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
1481482.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -157,8 +169,9 @@
1481485.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
1481485.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
1481486.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-1481486.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+1481486.net: could not connect to host
1536.cf: could not connect to host
+159cp.com: did not receive HSTS header
16164f.com: could not connect to host
163pwd.com: could not connect to host
166166.com: could not connect to host
@@ -167,7 +180,7 @@
168bo9.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
168bo9.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
168esb.com: could not connect to host
-16book.org: could not connect to host
+16book.org: did not receive HSTS header
16deza.com: did not receive HSTS header
16packets.com: could not connect to host
173vpn.cn: could not connect to host
@@ -177,13 +190,15 @@
174343.com: could not connect to host
17hats.com: did not receive HSTS header
188522.com: did not receive HSTS header
-18888msc.com: could not connect to host
1888zr.com: could not connect to host
188betwarriors.co.uk: could not connect to host
188trafalgar.ca: did not receive HSTS header
-1895media.com: could not connect to host
189dv.com: could not connect to host
+189fc.com: could not connect to host
+18celebration.com: did not receive HSTS header
+18celebration.org: did not receive HSTS header
1912x.com: could not connect to host
+192.io: could not connect to host
19216811.online: did not receive HSTS header
192168ll.repair: could not connect to host
1921958389.rsc.cdn77.org: could not connect to host
@@ -216,7 +231,6 @@
1xcess.com: did not receive HSTS header
1years.cc: could not connect to host
2-cpu.de: could not connect to host
-2001y.me: could not connect to host
200fcw.com: could not connect to host
2018.wales: could not connect to host
2048-spiel.de: could not connect to host
@@ -232,6 +246,8 @@
22digital.agency: could not connect to host
22scc.com: could not connect to host
2333.press: could not connect to host
+23333.link: did not receive HSTS header
+233abc.com: could not connect to host
247a.co.uk: could not connect to host
247quickbooks.com: did not receive HSTS header
2488.ch: did not receive HSTS header
@@ -244,19 +260,19 @@
24sihu.com: could not connect to host
2566335.xyz: could not connect to host
256k.me: could not connect to host
-258da.com: did not receive HSTS header
+258da.com: could not connect to host
25daysof.io: could not connect to host
27728522.com: could not connect to host
2859cc.com: could not connect to host
288da.com: did not receive HSTS header
29227.com: could not connect to host
-298da.com: did not receive HSTS header
+298da.com: could not connect to host
2acbi-asso.fr: did not receive HSTS header
2b3b.com: could not connect to host
2bad2c0.de: did not receive HSTS header
2bitout.com: could not connect to host
2bizi.ru: could not connect to host
-2bouncy.com: did not receive HSTS header
+2bouncy.com: could not connect to host
2brokegirls.org: could not connect to host
2carpros.com: did not receive HSTS header
2fl.me: did not receive HSTS header
@@ -274,11 +290,13 @@
30yearmortgagerates.net: could not connect to host
3133780x.com: did not receive HSTS header
314166.com: could not connect to host
+314553.com: did not receive HSTS header
314chan.org: could not connect to host
31tv.ru: did not receive HSTS header
32ph.com: could not connect to host
330.net: could not connect to host
-33836.com: could not connect to host
+336yh.com: could not connect to host
+33836.com: did not receive HSTS header
338da.com: could not connect to host
33drugstore.com: could not connect to host
33scc.com: could not connect to host
@@ -289,6 +307,7 @@
35792.de: could not connect to host
360gradus.com: did not receive HSTS header
360woodworking.com: could not connect to host
+364553.com: did not receive HSTS header
365.or.jp: could not connect to host
365maya.com: did not receive HSTS header
368mibn.com: could not connect to host
@@ -297,8 +316,7 @@
3839.ca: could not connect to host
38888msc.com: could not connect to host
38blog.com: did not receive HSTS header
-38sihu.com: could not connect to host
-398.info: could not connect to host
+394553.com: did not receive HSTS header
39sihu.com: could not connect to host
3candy.com: could not connect to host
3chit.cf: could not connect to host
@@ -311,7 +329,9 @@
3fl.com: did not receive HSTS header
3ik.us: could not connect to host
3mbo.de: did not receive HSTS header
+3phase.pw: could not connect to host
3sreporting.com: did not receive HSTS header
+3trees.tk: could not connect to host
3wecommerce.com.br: could not connect to host
3weekdietworks.com: did not receive HSTS header
3xx.link: could not connect to host
@@ -323,6 +343,7 @@
404.sh: could not connect to host
404404.info: could not connect to host
404forest.com: did not receive HSTS header
+414553.com: did not receive HSTS header
41844.de: could not connect to host
420dongstorm.com: could not connect to host
4237.com: could not connect to host
@@ -332,12 +353,14 @@
439191.com: could not connect to host
440hz-radio.de: did not receive HSTS header
4455software.com: did not receive HSTS header
-448da.com: did not receive HSTS header
+448da.com: could not connect to host
44957.com: could not connect to host
44scc.com: could not connect to host
4500.co.il: did not receive HSTS header
+4553s.com: did not receive HSTS header
4553vip.com: could not connect to host
4679.space: did not receive HSTS header
+4736666.com: could not connect to host
478933.com: could not connect to host
47essays.com: could not connect to host
47tech.com: could not connect to host
@@ -348,6 +371,7 @@
4cclothing.com: could not connect to host
4d2.xyz: could not connect to host
4decor.org: max-age too low: 0
+4everproxy.com: did not receive HSTS header
4hvac.com: did not receive HSTS header
4loc.us: could not connect to host
4miners.net: could not connect to host
@@ -357,23 +381,47 @@
4sqsu.eu: could not connect to host
4w-performers.link: could not connect to host
4web-hosting.com: could not connect to host
-4winds.pt: did not receive HSTS header
+4winds.pt: could not connect to host
5000yz.com: could not connect to host
500103.com: did not receive HSTS header
500108.com: did not receive HSTS header
+500a500.com: did not receive HSTS header
+500b500.com: did not receive HSTS header
+500c500.com: did not receive HSTS header
+500d500.com: did not receive HSTS header
+500e500.com: did not receive HSTS header
+500f500.com: did not receive HSTS header
500fcw.com: could not connect to host
-506pay.com: could not connect to host
+500g500.com: did not receive HSTS header
+500h500.com: did not receive HSTS header
+500i500.com: did not receive HSTS header
+500j500.com: did not receive HSTS header
+500k500.com: did not receive HSTS header
+500l500.com: did not receive HSTS header
+500m500.com: did not receive HSTS header
+500n500.com: did not receive HSTS header
+500o500.com: did not receive HSTS header
+500p500.com: did not receive HSTS header
+500pingtai.com: did not receive HSTS header
+500q500.com: did not receive HSTS header
+500r500.com: did not receive HSTS header
+500s500.com: did not receive HSTS header
+500t500.com: did not receive HSTS header
+500u500.com: did not receive HSTS header
+500y500.com: did not receive HSTS header
+500z500.com: did not receive HSTS header
+506pay.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
50ma.xyz: could not connect to host
50millionablaze.org: could not connect to host
50plusnet.nl: could not connect to host
513vpn.net: could not connect to host
517vpn.cn: could not connect to host
518maicai.com: could not connect to host
-51aifuli.com: could not connect to host
5214889.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
5214889.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
52b9.com: could not connect to host
52b9.net: could not connect to host
+52hentai.us: did not receive HSTS header
52kb.net: could not connect to host
52kb1.com: could not connect to host
52neptune.com: did not receive HSTS header
@@ -382,17 +430,22 @@
5364.com: could not connect to host
540.co: did not receive HSTS header
5432.cc: did not receive HSTS header
+545755.com: could not connect to host
54bf.com: could not connect to host
555xl.com: could not connect to host
55797.com: could not connect to host
+558da.com: did not receive HSTS header
55bt.cc: did not receive HSTS header
55scc.com: could not connect to host
56877.com: could not connect to host
56ct.com: could not connect to host
57aromas.com: did not receive HSTS header
57he.com: did not receive HSTS header
+588da.com: did not receive HSTS header
598598598.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
5986fc.com: could not connect to host
+5chat.it: could not connect to host
+5crowd.com: did not receive HSTS header
5ece.de: could not connect to host
5piecesofadvice.com: could not connect to host
5starbouncycastlehire.co.uk: could not connect to host
@@ -401,19 +454,21 @@
605508.com: could not connect to host
60ych.net: did not receive HSTS header
6120.eu: did not receive HSTS header
-62755.com: could not connect to host
+62755.com: did not receive HSTS header
645ds.cn: did not receive HSTS header
645ds.com: did not receive HSTS header
64616e.xyz: could not connect to host
64970.com: did not receive HSTS header
64bitgaming.de: could not connect to host
64bitservers.net: could not connect to host
-65d88.com: did not receive HSTS header
-660011.com: did not receive HSTS header
+660011.com: could not connect to host
6616fc.com: could not connect to host
66205.net: did not receive HSTS header
+6664553.com: did not receive HSTS header
+666omg.com: could not connect to host
6677.us: could not connect to host
668da.com: did not receive HSTS header
+66b.com: did not receive HSTS header
66bwf.com: could not connect to host
67899876.com: did not receive HSTS header
680226.com: could not connect to host
@@ -421,17 +476,20 @@
692b8c32.de: could not connect to host
69mentor.com: could not connect to host
69square.com: could not connect to host
+6pm.com: did not receive HSTS header
6t-montjoye.org: could not connect to host
6w6.la: could not connect to host
6z3.net: could not connect to host
+7045.com: could not connect to host
7183.org: could not connect to host
-721av.com: max-age too low: 2592000
+721av.com: could not connect to host
724go.com: could not connect to host
7261696e626f77.net: could not connect to host
72ty.com: could not connect to host
72ty.net: could not connect to host
73223.com: did not receive HSTS header
7570.com: did not receive HSTS header
+758global.com: did not receive HSTS header
771122.tv: did not receive HSTS header
772244.net: did not receive HSTS header
776573.net: did not receive HSTS header
@@ -439,7 +497,8 @@
77890k.com: could not connect to host
778da.com: did not receive HSTS header
77book.cn: could not connect to host
-788da.com: did not receive HSTS header
+77dostavkaroz.ru: did not receive HSTS header
+788da.com: could not connect to host
789zr.com: could not connect to host
7f-wgg.cf: could not connect to host
7kovrikov.ru: did not receive HSTS header
@@ -452,6 +511,7 @@
808.lv: did not receive HSTS header
808phone.net: could not connect to host
818bwf.com: could not connect to host
+818da.com: could not connect to host
81uc.com: could not connect to host
8206688.com: did not receive HSTS header
826468.com: could not connect to host
@@ -463,6 +523,7 @@
8522cn.com: did not receive HSTS header
8522top.com: could not connect to host
8560.be: could not connect to host
+86286286.com: did not receive HSTS header
8649955.com: could not connect to host
8649966.com: could not connect to host
8649977.com: could not connect to host
@@ -471,6 +532,8 @@
87577.com: could not connect to host
88.to: did not receive HSTS header
8876205.com: did not receive HSTS header
+8880057.com: did not receive HSTS header
+8884553.com: could not connect to host
8887999.com: could not connect to host
8888av.co: could not connect to host
8888esb.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -500,8 +563,11 @@
89he.com: could not connect to host
8azino777.ru: did not receive HSTS header
8ballbombom.uk: could not connect to host
+8da188.com: could not connect to host
8da2017.com: did not receive HSTS header
8da2018.com: could not connect to host
+8da88.com: could not connect to host
+8da999.com: could not connect to host
8mpay.com: did not receive HSTS header
8pecxstudios.com: could not connect to host
8shequapp.com: could not connect to host
@@ -510,13 +576,15 @@
8ung.online: could not connect to host
8xx.bet: could not connect to host
8xx.io: could not connect to host
-8xx888.com: could not connect to host
-8y.network: could not connect to host
+8xxbet.net: could not connect to host
+8xxxxxxx.com: could not connect to host
+8yun.ga: could not connect to host
90smthng.com: could not connect to host
91-freedom.com: could not connect to host
9118b.com: could not connect to host
911911.pw: could not connect to host
915ers.com: could not connect to host
+918116.com: max-age too low: 2592000
918yy.com: could not connect to host
919945.com: did not receive HSTS header
91dh.cc: could not connect to host
@@ -532,16 +600,16 @@
9651678.ru: could not connect to host
9696178.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
9696178.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+97bros.com: did not receive HSTS header
9822.com: did not receive HSTS header
9822.info: did not receive HSTS header
987987.com: did not receive HSTS header
9906753.net: did not receive HSTS header
99511.fi: did not receive HSTS header
99599.net: could not connect to host
-9998722.com: could not connect to host
+9994553.com: did not receive HSTS header
99buffets.com: could not connect to host
9bingo.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-9iwan.net: did not receive HSTS header
9jadirect.com: could not connect to host
9jaxtreme.com.ng: did not receive HSTS header
9point6.com: could not connect to host
@@ -560,6 +628,7 @@ a1798.com: could not connect to host
a200k.xyz: did not receive HSTS header
a2c-co.net: could not connect to host
a2it.gr: max-age too low: 0
+a2os.club: did not receive HSTS header
a3.pm: did not receive HSTS header
a3workshop.swiss: could not connect to host
a8q.org: could not connect to host
@@ -577,23 +646,29 @@ aapp.space: could not connect to host
aardvarksolutions.co.za: did not receive HSTS header
aariefhaafiz.com: could not connect to host
aaron-gustafson.com: did not receive HSTS header
+aaronburt.co.uk: max-age too low: 7776000
aaronmcguire.me: did not receive HSTS header
aarvinproperties.com: could not connect to host
-ab-bauservice-berlin.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+ab-bauservice-berlin.de: did not receive HSTS header
abacus-events.co.uk: did not receive HSTS header
+abaev.uk: could not connect to host
abareplace.com: did not receive HSTS header
abasky.net: could not connect to host
+abbradar.net: could not connect to host
abcdef.be: could not connect to host
abcdentalcare.com: did not receive HSTS header
abcdobebe.com: did not receive HSTS header
abchelp.net: could not connect to host
+abdelsater.net: did not receive HSTS header
abdullah.pw: could not connect to host
abearofsoap.com: could not connect to host
abecodes.net: could not connect to host
+abeontech.com: could not connect to host
aberdeenalmeras.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
abi-fvs.de: could not connect to host
abigailstark.com: could not connect to host
abilitylist.org: did not receive HSTS header
+abinferis.com: could not connect to host
abioniere.de: could not connect to host
ablogagency.net: could not connect to host
abloop.com: could not connect to host
@@ -611,13 +686,11 @@ absimple.ca: did not receive HSTS header
absinthium.ch: could not connect to host
absolutewaterproofingsolutions.com: did not receive HSTS header
abstractbarista.com: could not connect to host
-abstractbarista.net: could not connect to host
abt.de: did not receive HSTS header
abtom.de: did not receive HSTS header
abury.fr: did not receive HSTS header
abury.me: did not receive HSTS header
abyssgaming.eu: could not connect to host
-ac.milan.it: did not receive HSTS header
acabadosboston.com: could not connect to host
academialowcost.com.br: did not receive HSTS header
academicenterprise.org: did not receive HSTS header
@@ -625,6 +698,7 @@ academy4.net: did not receive HSTS header
acadianapatios.com: did not receive HSTS header
acai51.net: could not connect to host
acaonegocios.com.br: could not connect to host
+acat.io: could not connect to host
acbc.ie: max-age too low: 0
accadoro.it: did not receive HSTS header
accbay.com: could not connect to host
@@ -633,22 +707,23 @@ accelerole.com: did not receive HSTS header
accelight.co.jp: did not receive HSTS header
accelight.jp: did not receive HSTS header
access-sofia.org: did not receive HSTS header
+accessibility.gov: did not receive HSTS header
accolade.com.br: could not connect to host
accoun.technology: could not connect to host
accounts-p.com: did not receive HSTS header
accountsuspended.club: could not connect to host
accwing.com: could not connect to host
aceadvisory.biz: did not receive HSTS header
+acecerts.co.uk: did not receive HSTS header
acemypaper.com: could not connect to host
-acessoeducacao.com: could not connect to host
-acevik.de: could not connect to host
+acevik.de: did not receive HSTS header
acg.mn: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
acg.sb: could not connect to host
acg18.us: max-age too low: 0
acgaudio.com: could not connect to host
acgpiano.club: could not connect to host
acheirj.com.br: could not connect to host
-acheritage.co.uk: could not connect to host
+acheritage.co.uk: did not receive HSTS header
achmadfamily.com: could not connect to host
achow101.com: did not receive HSTS header
achterhoekseveiligheidsbeurs.nl: could not connect to host
@@ -666,18 +741,20 @@ acritelli.com: did not receive HSTS header
acroso.me: could not connect to host
across.ml: could not connect to host
acrossgw.com: could not connect to host
-acsihostingsolutions.com: did not receive HSTS header
+acs-chantal.com: did not receive HSTS header
+acsihostingsolutions.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
acslimited.co.uk: did not receive HSTS header
actc81.fr: could not connect to host
actilove.ch: could not connect to host
actiontowingroundrock.com: could not connect to host
-activateplay.com: could not connect to host
+activateplay.com: did not receive HSTS header
active-escape.com: did not receive HSTS header
activeclearweb.com: could not connect to host
activeweb.top: could not connect to host
activeworld.net: max-age too low: 2592000
activistasconstructivos.org: did not receive HSTS header
activiti.alfresco.com: did not receive HSTS header
+actorsroom.com: could not connect to host
actu-film.com: max-age too low: 0
actu-medias.com: could not connect to host
actualite-videos.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -688,7 +765,6 @@ ad13.in: did not receive HSTS header
ada.is: max-age too low: 2592000
adajwells.me: could not connect to host
adamcoffee.net: could not connect to host
-adamdixon.co.uk: could not connect to host
adamjoycegames.co.uk: could not connect to host
adamricheimer.com: could not connect to host
adamsfoundationrepair.com: did not receive HSTS header
@@ -698,12 +774,11 @@ adastra.re: could not connect to host
adblock.ovh: could not connect to host
adboos.com: could not connect to host
addaxpetroleum.com: could not connect to host
-addiko.net: could not connect to host
addvocate.com: could not connect to host
adec-emsa.ae: could not connect to host
adelaides.com: did not receive HSTS header
adelevie.com: could not connect to host
-adeline.mobi: could not connect to host
+adelianz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
adelinlydia-coach.com: did not receive HSTS header
adequatetechnology.com: could not connect to host
aderal.io: could not connect to host
@@ -725,6 +800,7 @@ admsel.ec: could not connect to host
adoal.net: did not receive HSTS header
adoge.me: could not connect to host
adonairelogios.com.br: could not connect to host
+adoniscabaret.co.uk: could not connect to host
adopteunsiteflash.com: could not connect to host
adora-illustrations.fr: did not receive HSTS header
adorade.ro: could not connect to host
@@ -734,7 +810,7 @@ adquisitio.in: could not connect to host
adrenaline-gaming.ru: could not connect to host
adrianajewelry.my: could not connect to host
adriancohea.ninja: did not receive HSTS header
-adrianseo.ro: did not receive HSTS header
+adrianseo.ro: could not connect to host
adrien.vin: max-age too low: 172800
adrinet.tk: could not connect to host
adrl.ca: could not connect to host
@@ -752,21 +828,25 @@ advancedstudio.ro: could not connect to host
advancedwriters.com: could not connect to host
advantagemechanicalinc.com: did not receive HSTS header
advelty.cz: could not connect to host
+adventaholdings.com: did not receive HSTS header
adventistdeploy.org: could not connect to host
adventures.is: did not receive HSTS header
adver.top: did not receive HSTS header
advertisemant.com: could not connect to host
advicepro.org.uk: did not receive HSTS header
adviespuntklokkenluiders.nl: could not connect to host
+adwokatkosterka.pl: did not receive HSTS header
adzie.xyz: could not connect to host
adzuna.co.uk: did not receive HSTS header
aegialis.com: did not receive HSTS header
aegisinsight.com: did not receive HSTS header
aelisya.ch: could not connect to host
-aelurus.com: could not connect to host
aemoria.com: could not connect to host
aeon.wiki: could not connect to host
+aep-digital.com: did not receive HSTS header
+aerapass.io: did not receive HSTS header
aerialmediapro.net: could not connect to host
+aerobasegroup.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
aerolog.co: did not receive HSTS header
aeroparking.es: did not receive HSTS header
aerotheque.fr: did not receive HSTS header
@@ -785,7 +865,7 @@ afeefzarapackages.com: did not receive HSTS header
affily.io: could not connect to host
affinity.vc: did not receive HSTS header
affordablebouncycastle.co.uk: did not receive HSTS header
-affordableenergyadvocates.com: did not receive HSTS header
+affordableenergyadvocates.com: could not connect to host
affordablepapers.com: could not connect to host
aficotroceni.ro: did not receive HSTS header
afiru.net: could not connect to host
@@ -793,7 +873,6 @@ aflamtorrent.com: could not connect to host
afmchandler.com: could not connect to host
afp548.tk: could not connect to host
africatravel.de: did not receive HSTS header
-aftab-alam.de: could not connect to host
after.im: could not connect to host
afterskool.eu: could not connect to host
afterstack.net: could not connect to host
@@ -805,25 +884,27 @@ agalaxyfarfaraway.co.uk: could not connect to host
agatheetraphael.fr: could not connect to host
agbremen.de: could not connect to host
agdalieso.com.ba: could not connect to host
+ageg.ca: could not connect to host
agelesscitizen.com: could not connect to host
agelesscitizens.com: could not connect to host
agenbettingasia.com: did not receive HSTS header
agenceactiv.immo: did not receive HSTS header
agenceklic.com: did not receive HSTS header
-agenciafiscal.pe: could not connect to host
agenciagriff.com: did not receive HSTS header
agencymanager.be: could not connect to host
+agent6.com.au: did not receive HSTS header
agentseeker.ca: could not connect to host
agevio.com: could not connect to host
+agglo-sion.ch: could not connect to host
aggr.pw: did not receive HSTS header
agiairini.cz: could not connect to host
agic.io: could not connect to host
agilebits.net: could not connect to host
agingstop.net: could not connect to host
-agonswim.com: could not connect to host
+agonswim.com: did not receive HSTS header
agoravm.tk: could not connect to host
agowa.eu: did not receive HSTS header
-agowa338.de: did not receive HSTS header
+agracan.com: could not connect to host
agrafix.design: did not receive HSTS header
agrias.com.br: did not receive HSTS header
agrikulturchic.com: could not connect to host
@@ -851,24 +932,25 @@ aide-admin.com: did not receive HSTS header
aide-valais.ch: could not connect to host
aidikofflaw.com: did not receive HSTS header
aiesecarad.ro: could not connect to host
+aiforsocialmedia.com: could not connect to host
aifreeze.ru: could not connect to host
aify.eu: could not connect to host
-aiheisi.com: did not receive HSTS header
+aiheisi.com: could not connect to host
aikenorganics.com: could not connect to host
aim-consultants.com: did not receive HSTS header
-aimerworld.com: did not receive HSTS header
+aimerworld.com: could not connect to host
aimrom.org: could not connect to host
-aimstoreglobal.com: did not receive HSTS header
ainrb.com: could not connect to host
+aintevenmad.ch: could not connect to host
aioboot.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
aip-marine.com: could not connect to host
aiphyron.com: could not connect to host
aiponne.com: could not connect to host
airbly.com: did not receive HSTS header
airconsalberton.co.za: did not receive HSTS header
-airconsboksburg.co.za: did not receive HSTS header
airconsfourways.co.za: did not receive HSTS header
airconsmidrand.co.za: did not receive HSTS header
+airconsrandburg.co.za: did not receive HSTS header
airconssandton.co.za: did not receive HSTS header
airedaleterrier.com.br: could not connect to host
airfax.io: could not connect to host
@@ -876,7 +958,6 @@ airlea.com: could not connect to host
airlinecheckins.com: did not receive HSTS header
airlinesettlement.com: did not receive HSTS header
airmazinginflatables.com: could not connect to host
-airportlimototoronto.com: did not receive HSTS header
airproto.com: did not receive HSTS header
airsick.guide: did not receive HSTS header
airtimefranchise.com: did not receive HSTS header
@@ -887,7 +968,6 @@ aiticon.de: did not receive HSTS header
aivene.com: could not connect to host
aiw-thkoeln.online: could not connect to host
aixxe.net: did not receive HSTS header
-aizxxs.com: could not connect to host
aizxxs.net: could not connect to host
ajetaci.cz: could not connect to host
ajibot.com: could not connect to host
@@ -915,10 +995,11 @@ akselimedia.fi: could not connect to host
akstudentsfirst.org: could not connect to host
aktan.com.br: could not connect to host
aktivist.in: did not receive HSTS header
-aktuelle-uhrzeit.at: did not receive HSTS header
akul.co.in: could not connect to host
al-f.net: could not connect to host
al-shami.net: could not connect to host
+alamgir.works: could not connect to host
+alanhuang.name: could not connect to host
alanlee.net: could not connect to host
alanrickmanflipstable.com: did not receive HSTS header
alanya.law: did not receive HSTS header
@@ -926,6 +1007,7 @@ alariel.de: did not receive HSTS header
alarme-gps.ch: could not connect to host
alarmegps.ch: could not connect to host
alarmsystemreviews.com: did not receive HSTS header
+alarna.de: could not connect to host
alasta.info: could not connect to host
alauda-home.de: could not connect to host
alaundeil.xyz: could not connect to host
@@ -934,6 +1016,7 @@ alberguecimballa.es: could not connect to host
albertify.xyz: could not connect to host
albertonplumber24-7.co.za: did not receive HSTS header
albertopimienta.com: did not receive HSTS header
+albinma.com: could not connect to host
albuic.tk: could not connect to host
alcantarafleuriste.com: did not receive HSTS header
alcatelonetouch.us: could not connect to host
@@ -945,21 +1028,21 @@ aldes.co.za: did not receive HSTS header
aldred.cloud: could not connect to host
aleax.me: could not connect to host
alecvannoten.be: did not receive HSTS header
-aledg.cl: could not connect to host
+aledg.cl: did not receive HSTS header
alenan.org: could not connect to host
-aleph.land: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
alertaenlinea.gov: did not receive HSTS header
-alessandro.pw: could not connect to host
+alessandro.pw: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
alessandroz.ddns.net: could not connect to host
alessandroz.pro: could not connect to host
-alethearose.com: did not receive HSTS header
-alexander-beck.eu: could not connect to host
+alethearose.com: could not connect to host
alexandernorth.ch: could not connect to host
-alexanderzinn.com: could not connect to host
+alexanderzinn.com: did not receive HSTS header
+alexandrastylist.com: could not connect to host
alexandre.sh: did not receive HSTS header
alexandros.io: could not connect to host
alexdaulby.com: did not receive HSTS header
alexdodge.ca: did not receive HSTS header
+alexei.su: max-age too low: 7776000
alexfisherhealth.com.au: did not receive HSTS header
alexhaydock.co.uk: did not receive HSTS header
alexischaussy.xyz: could not connect to host
@@ -971,6 +1054,7 @@ alexismeza.nl: could not connect to host
alexkidd.de: could not connect to host
alexmak.net: did not receive HSTS header
alexmol.tk: could not connect to host
+alexmroberts.net: could not connect to host
alexperry.io: could not connect to host
alexsinnott.me: could not connect to host
alfa24.pro: could not connect to host
@@ -978,13 +1062,13 @@ alfaperfumes.com.br: could not connect to host
alfaponny.se: could not connect to host
alfirous.com: could not connect to host
alfredxing.com: did not receive HSTS header
+alftrain.com: could not connect to host
algarmatic-automatismos.pt: could not connect to host
algebraaec.com: did not receive HSTS header
algercounty.gov: could not connect to host
alghaib.com: could not connect to host
alibababee.com: could not connect to host
alibip.de: could not connect to host
-alicetone.net: could not connect to host
alicialab.org: could not connect to host
alien.bz: did not receive HSTS header
aliim.gdn: could not connect to host
@@ -997,7 +1081,7 @@ alistairpialek.com: max-age too low: 86400
alisync.com: could not connect to host
alittlebitcheeky.com: did not receive HSTS header
aliwebstore.com: could not connect to host
-aljammaz.holdings: could not connect to host
+aljammaz.holdings: did not receive HSTS header
aljmz.com: did not receive HSTS header
alkami.com: max-age too low: 0
alkamitech.com: max-age too low: 0
@@ -1007,19 +1091,22 @@ all.tf: could not connect to host
all4os.com: did not receive HSTS header
allaboutbelgaum.com: did not receive HSTS header
alldaymonitoring.com: could not connect to host
+alldigitalsolutions.com: did not receive HSTS header
alldm.ru: could not connect to host
allegro-inc.com: did not receive HSTS header
allemobieleproviders.nl: could not connect to host
allenosgood.com: could not connect to host
-allerbestefreunde.de: could not connect to host
+allerbestefreunde.de: did not receive HSTS header
allfreelancers.su: did not receive HSTS header
allgrass.es: did not receive HSTS header
allgrass.net: did not receive HSTS header
+allhard.org: could not connect to host
alliance-compacts.com: did not receive HSTS header
allinnote.com: could not connect to host
allinone-ranking150.com: did not receive HSTS header
allinonecyprus.com: did not receive HSTS header
allkindzabeats.com: could not connect to host
+allladyboys.com: could not connect to host
allmbw.com: could not connect to host
allmystery.de: did not receive HSTS header
allo-symo.fr: did not receive HSTS header
@@ -1027,6 +1114,8 @@ allods-zone.ru: did not receive HSTS header
alloffice.com.ua: did not receive HSTS header
alloinformatique.net: could not connect to host
alloutatl.com: could not connect to host
+alloydevil.nl: did not receive HSTS header
+allplayer.tk: did not receive HSTS header
allpropertyservices.com: did not receive HSTS header
allprorisk.com: did not receive HSTS header
allrealty.co.za: could not connect to host
@@ -1041,20 +1130,22 @@ allstorebrasil.com.br: could not connect to host
alltheducks.com: max-age too low: 43200
allthingsblogging.com: could not connect to host
allthingsfpl.com: could not connect to host
-alltubedownload.net: could not connect to host
+allvips.ru: could not connect to host
almagalla.com: could not connect to host
+almatinki.com: could not connect to host
aloalabs.com: did not receive HSTS header
alocato.com: could not connect to host
alorenzi.eu: did not receive HSTS header
alp.net.cn: could not connect to host
alparque.com: did not receive HSTS header
alpe-d-or.dyn-o-saur.com: could not connect to host
-alpencam.com: could not connect to host
alpha.irccloud.com: could not connect to host
alphabit-secure.com: could not connect to host
alphabuild.io: could not connect to host
-alphagamers.net: did not receive HSTS header
+alphagamers.net: could not connect to host
alphalabs.xyz: could not connect to host
+alqassam.net: did not receive HSTS header
+alquiladoramexico.com: did not receive HSTS header
als-hardware.co.za: did not receive HSTS header
alspolska.pl: max-age too low: 2592000
alt-tab-design.com: did not receive HSTS header
@@ -1062,13 +1153,14 @@ alt33c3.org: could not connect to host
altahrim.net: could not connect to host
altaide.com: did not receive HSTS header
altailife.ru: did not receive HSTS header
-altamarea.se: could not connect to host
+altamarea.se: did not receive HSTS header
+altbinaries.com: could not connect to host
alteqnia.com: could not connect to host
altercpa.ru: max-age too low: 0
altered.network: could not connect to host
altfire.ca: could not connect to host
altiacaselight.com: could not connect to host
-altitudemoversdenver.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+altitudemoversdenver.com: max-age too low: 300
altoneum.com: could not connect to host
altporn.xyz: could not connect to host
altruistgroup.net: max-age too low: 300
@@ -1078,34 +1170,39 @@ alunjam.es: did not receive HSTS header
alunonaescola.com.br: did not receive HSTS header
aluoblog.pw: could not connect to host
aluoblog.top: could not connect to host
+aluroof.eu: could not connect to host
alusta.co: could not connect to host
alvis-audio.com: did not receive HSTS header
alvn.ga: could not connect to host
-am3.se: could not connect to host
+alwaysonssl.com: could not connect to host
am8888.top: could not connect to host
amaderelectronics.com: max-age too low: 2592000
amadilo.de: could not connect to host
+amadoraslindas.com: could not connect to host
amaforro.com: could not connect to host
amaforums.org: did not receive HSTS header
amalficoastchauffeur.com: could not connect to host
amandaonishi.com: could not connect to host
amandaworldstudies.com: could not connect to host
amaranthus.com.ph: could not connect to host
+amateri.com: could not connect to host
amatzen.dk: did not receive HSTS header
amavis.org: did not receive HSTS header
amazing-gaming.fr: could not connect to host
amazingbouncycastles.co.uk: did not receive HSTS header
amazingfloridagulfhomes.com: could not connect to host
ambiancestudio.ro: did not receive HSTS header
+ambouncyhire.com: could not connect to host
ambrosius.io: could not connect to host
amcvega.com: could not connect to host
amdouglas.uk: could not connect to host
amechancez.site: could not connect to host
+amelandadventure.nl: did not receive HSTS header
amerhd.com: could not connect to host
american-truck-simulator.de: could not connect to host
american-truck-simulator.net: could not connect to host
americanbio.com: did not receive HSTS header
-americandistribuidora.com: could not connect to host
+americandistribuidora.com: did not receive HSTS header
americanoutlawjeepparts.com: did not receive HSTS header
americansforcommunitydevelopment.org: did not receive HSTS header
americansportsinstitute.org: did not receive HSTS header
@@ -1153,10 +1250,14 @@ anagra.ms: could not connect to host
anaisypirueta.es: did not receive HSTS header
anajianu.ro: max-age too low: 2592000
anakros.me: could not connect to host
+analangelsteen.com: could not connect to host
+analisilaica.it: did not receive HSTS header
analpantyhose.org: could not connect to host
+analteengirls.net: could not connect to host
analytic-s.ml: could not connect to host
analyticsinmotion.net: could not connect to host
analyzemyfriends.com: could not connect to host
+anarchyrp.life: could not connect to host
anassiriphotography.com: could not connect to host
anastasiafond.com: did not receive HSTS header
anaveragehuman.eu.org: did not receive HSTS header
@@ -1182,10 +1283,11 @@ andreasr.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERR
andreastoneman.com: could not connect to host
andrefaber.nl: did not receive HSTS header
andrei-coman.com: did not receive HSTS header
-andreigec.net: did not receive HSTS header
+andreigec.net: could not connect to host
andrejstefanovski.com: did not receive HSTS header
andrepicard.de: could not connect to host
andrerose.ca: did not receive HSTS header
+andrespaz.com: max-age too low: 0
andrewbroekman.com: could not connect to host
andrewdavidwong.com: did not receive HSTS header
andrewdaws.co: could not connect to host
@@ -1198,14 +1300,12 @@ andrewregan.me: could not connect to host
andrewtebert.com: did not receive HSTS header
andrewthelott.net: did not receive HSTS header
andrewvoce.com: did not receive HSTS header
-andrewx.net: could not connect to host
andrewyg.net: could not connect to host
andreypopp.com: could not connect to host
android: could not connect to host
androidprosmart.com: could not connect to host
androidsphone.com: did not receive HSTS header
androled.fr: max-age too low: 5184000
-andronika.net: could not connect to host
androoz.se: could not connect to host
andyclark.io: could not connect to host
andycloud.dynu.net: could not connect to host
@@ -1224,6 +1324,7 @@ ange-de-bonheur444.com: could not connect to host
angelic47.com: could not connect to host
angeloroberto.ch: did not receive HSTS header
angeloventuri.com: did not receive HSTS header
+angelsgirl.eu.org: could not connect to host
angervillelorcher.fr: did not receive HSTS header
anghami.com: did not receive HSTS header
anglertanke.de: could not connect to host
@@ -1234,6 +1335,7 @@ angrylab.com: did not receive HSTS header
angryroute.com: could not connect to host
anguiao.com: did not receive HSTS header
aniaimichal.eu: could not connect to host
+aniforprez.net: could not connect to host
anim.ee: could not connect to host
animal-nature-human.com: could not connect to host
animalnet.de: max-age too low: 7776000
@@ -1273,36 +1375,38 @@ annsbouncycastles.com: could not connect to host
anomaly.ws: did not receive HSTS header
anonboards.com: could not connect to host
anonrea.ch: could not connect to host
+anons.fr: could not connect to host
anonukradio.org: could not connect to host
anonymo.co.uk: could not connect to host
anonymo.uk: could not connect to host
anonymousstatecollegelulzsec.com: could not connect to host
anothermilan.net: could not connect to host
+anoxinon.de: max-age too low: 2628000
ansdell.info: could not connect to host
anseo.ninja: could not connect to host
ansermfg.com: max-age too low: 0
ansgar.tk: could not connect to host
anshuman-chatterjee.com: did not receive HSTS header
anshumanbiswas.com: could not connect to host
-ansibeast.net: did not receive HSTS header
answers-online.ru: could not connect to host
ant.land: could not connect to host
antecim.fr: could not connect to host
antenasmundosat.com.br: did not receive HSTS header
anthenor.co.uk: could not connect to host
-anthony-rouanet.com: could not connect to host
+anthony-rouanet.com: did not receive HSTS header
anthonyaires.com: did not receive HSTS header
anthonyavon.com: could not connect to host
anthonyloop.com: did not receive HSTS header
anthro.id: did not receive HSTS header
antibioticshome.com: max-age too low: 604800
antifraud.net.ru: could not connect to host
+antiled.by: could not connect to host
antimatiere.space: did not receive HSTS header
antimine.kr: could not connect to host
antipa.ch: could not connect to host
antirayapmalang.com: max-age too low: 36000
antoine-roux.fr: did not receive HSTS header
-antoinebetas.be: max-age too low: 0
+antoinebetas.be: did not receive HSTS header
antoined.fr: did not receive HSTS header
antoinemary.io: did not receive HSTS header
antoineschaller.ch: did not receive HSTS header
@@ -1312,23 +1416,25 @@ antons.io: did not receive HSTS header
antraxx.ee: could not connect to host
antscript.com: did not receive HSTS header
anunayk.com: could not connect to host
-anycoin.me: did not receive HSTS header
+anycoin.me: could not connect to host
anyfood.fi: could not connect to host
anypool.fr: did not receive HSTS header
anypool.net: did not receive HSTS header
anyprime.net: could not connect to host
+anythingautowebster.com: did not receive HSTS header
anytonetech.com: did not receive HSTS header
anyways.at: could not connect to host
ao-dev.com: could not connect to host
aobogo.com: could not connect to host
aocast.info: could not connect to host
-aofusa.net: could not connect to host
aojao.cn: could not connect to host
aojf.fr: could not connect to host
+aoku3d.com: could not connect to host
aolabs.nz: did not receive HSTS header
aomberg.com: did not receive HSTS header
aomonk.com: did not receive HSTS header
aooobo.com: could not connect to host
+aosus.org: did not receive HSTS header
aov.io: could not connect to host
aovcentrum.nl: did not receive HSTS header
aozora.moe: could not connect to host
@@ -1345,10 +1451,10 @@ apis.blue: could not connect to host
apis.google.com: did not receive HSTS header (error ignored - included regardless)
apis.world: could not connect to host
apivia.fr: did not receive HSTS header
-apkdv.com: could not connect to host
+apkdv.com: did not receive HSTS header
apkmod.id: did not receive HSTS header
apkoyunlar.club: could not connect to host
-apkriver.com: did not receive HSTS header
+apkriver.com: could not connect to host
apl2bits.net: did not receive HSTS header
apmg-certified.com: did not receive HSTS header
apmg-cyber.com: did not receive HSTS header
@@ -1361,8 +1467,10 @@ apollyon.work: could not connect to host
aponkral.site: could not connect to host
aponkralsunucu.com: could not connect to host
aponow.de: did not receive HSTS header
+aporter.ddns.net: could not connect to host
apostilasaprovacao.com: could not connect to host
apotheek-nl.org: did not receive HSTS header
+apotheke-ch.org: could not connect to host
app: could not connect to host
app-arena.com: did not receive HSTS header
app.manilla.com: could not connect to host
@@ -1379,27 +1487,26 @@ appimlab.it: could not connect to host
apple-watch-zubehoer.de: could not connect to host
apple.ax: could not connect to host
applejacks-bouncy-castles.co.uk: could not connect to host
+applesana.es: could not connect to host
applewatch.co.nz: did not receive HSTS header
applez.xyz: could not connect to host
appliancerepairlosangeles.com: did not receive HSTS header
applic8.com: did not receive HSTS header
apply55gx.com: could not connect to host
appointed.at: did not receive HSTS header
-apponline.com: could not connect to host
appraisal-comps.com: could not connect to host
appreciationkards.com: did not receive HSTS header
approlys.fr: did not receive HSTS header
apps-for-fishing.com: could not connect to host
apps4all.sytes.net: could not connect to host
-appsbystudio.co.uk: did not receive HSTS header
+appsbystudio.co.uk: could not connect to host
appsdash.io: could not connect to host
appson.co.uk: did not receive HSTS header
apptoutou.com: could not connect to host
appuro.com: did not receive HSTS header
-appxcrypto.com: did not receive HSTS header
-apratimsaha.com: did not receive HSTS header
aprefix.com: could not connect to host
aprpullmanportermuseum.org: did not receive HSTS header
+aprsdroid.org: could not connect to host
aptitude9.com: could not connect to host
aqilacademy.com.au: could not connect to host
aqqrate.com: could not connect to host
@@ -1410,13 +1517,16 @@ aquilalab.com: could not connect to host
aquireceitas.com: did not receive HSTS header
ar.al: did not receive HSTS header
arabdigitalexpression.org: did not receive HSTS header
+arabsexi.info: could not connect to host
aradulconteaza.ro: could not connect to host
aran.me.uk: could not connect to host
aranel.me: could not connect to host
-arawaza.biz: did not receive HSTS header
+arawaza.biz: could not connect to host
arawaza.info: could not connect to host
arboineuropa.nl: did not receive HSTS header
arboleda-hurtado.com: could not connect to host
+arboworks.com: could not connect to host
+arbu.eu: could not connect to host
arcadiaeng.com: did not receive HSTS header
arcbit.io: could not connect to host
archii.ca: did not receive HSTS header
@@ -1457,7 +1567,6 @@ arlen.io: could not connect to host
arlen.se: could not connect to host
arlet.click: could not connect to host
arlingtonwine.net: could not connect to host
-arm.gov: could not connect to host
armazemdaminiatura.com.br: could not connect to host
armeni-jewellery.gr: did not receive HSTS header
armenians.online: could not connect to host
@@ -1473,9 +1582,10 @@ armytricka.cz: did not receive HSTS header
arnaudminable.net: could not connect to host
arne-petersen.net: did not receive HSTS header
arnesolutions.com: could not connect to host
+arnevankauter.com: could not connect to host
aromaclub.nl: did not receive HSTS header
around-the-blog.com: did not receive HSTS header
-aroundme.org: did not receive HSTS header
+aroundme.org: could not connect to host
arpa.ph: did not receive HSTS header
arpr.co: did not receive HSTS header
arrayify.com: could not connect to host
@@ -1490,19 +1600,17 @@ artansoft.com: could not connect to host
artaronquieres.com: did not receive HSTS header
artartefatos.com.br: could not connect to host
artbytik.ru: did not receive HSTS header
-arteequipamientos.com.uy: did not receive HSTS header
artefakt.es: could not connect to host
artegusto.ru: did not receive HSTS header
artemicroway.com.br: could not connect to host
arteseideias.com.pt: did not receive HSTS header
artesupra.com: did not receive HSTS header
-arti-group.ml: max-age too low: 2592000
+arti-group.ml: did not receive HSTS header
articaexports.com: could not connect to host
artifex21.com: did not receive HSTS header
artifex21.fr: did not receive HSTS header
artiming.com: could not connect to host
artisanhd.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-artisavotins.com: could not connect to host
artisense.de: could not connect to host
artisphere.ch: did not receive HSTS header
artisticedgegranite.net: could not connect to host
@@ -1528,7 +1636,7 @@ asc16.com: could not connect to host
aschaefer.net: could not connect to host
asdpress.cn: could not connect to host
aseko.gr: did not receive HSTS header
-asepms.com: max-age too low: 7776000
+asepms.com: could not connect to host
ashlane-cottages.com: could not connect to host
ashleakunowski.com: could not connect to host
ashleyadum.com: could not connect to host
@@ -1538,6 +1646,7 @@ ashleymedway.com: could not connect to host
asian-archi.com.tw: did not receive HSTS header
asianbet77.co: did not receive HSTS header
asianbet77.net: did not receive HSTS header
+asianodor.com: could not connect to host
asisee.co.il: could not connect to host
askfit.cz: did not receive HSTS header
askmagicconch.com: could not connect to host
@@ -1559,15 +1668,16 @@ assekuranzjobs.de: could not connect to host
asset-alive.com: did not receive HSTS header
asset-alive.net: could not connect to host
assetict.com: max-age too low: 0
-assetsupervision.com: could not connect to host
+assetsupervision.com: did not receive HSTS header
assindia.nl: did not receive HSTS header
assistance-personnes-agees.ch: could not connect to host
assistcart.com: could not connect to host
assurancesmons.be: did not receive HSTS header
+astaninki.com: could not connect to host
astenretail.com: could not connect to host
asthon.cn: could not connect to host
astraalivankila.net: could not connect to host
-astral.gq: did not receive HSTS header
+astral.gq: could not connect to host
astrath.net: could not connect to host
astrea-voetbal-groningen.nl: could not connect to host
astrolpost.com: could not connect to host
@@ -1575,6 +1685,7 @@ astromelody.com: did not receive HSTS header
astronomie-fulda.de: did not receive HSTS header
astrosnail.pt.eu.org: could not connect to host
astutr.co: could not connect to host
+asucrews.com: could not connect to host
asuhe.cc: could not connect to host
asuhe.win: did not receive HSTS header
asuhe.xyz: could not connect to host
@@ -1592,8 +1703,9 @@ atelier-viennois-cannes.fr: could not connect to host
atelierhupsakee.nl: did not receive HSTS header
ateliernihongo.ch: did not receive HSTS header
ateliersantgervasi.com: did not receive HSTS header
-atg.soy: could not connect to host
+atendimentodelta.com.br: did not receive HSTS header
athaliasoft.com: could not connect to host
+athena-garage.co.uk: could not connect to host
athenelive.com: could not connect to host
athensbusinessresources.us: could not connect to host
atheoryofchange.com: could not connect to host
@@ -1613,32 +1725,35 @@ atlseccon.com: did not receive HSTS header
atmocdn.com: could not connect to host
atomic.menu: could not connect to host
atomic.red: could not connect to host
-atomik.pro: could not connect to host
+atomicbounce.co.uk: could not connect to host
+atomik.pro: did not receive HSTS header
atop.io: could not connect to host
atracaosexshop.com.br: could not connect to host
-atrevillot.com: could not connect to host
attelage.net: did not receive HSTS header
attic118.com: could not connect to host
attimidesigns.com: did not receive HSTS header
attogproductions.com: did not receive HSTS header
+atulhost.com: did not receive HSTS header
au-pair24.de: did not receive HSTS header
au.search.yahoo.com: max-age too low: 172800
au2pb.net: could not connect to host
aubiosales.com: could not connect to host
aucubin.moe: could not connect to host
-audiblox.co.za: could not connect to host
+audiblox.co.za: did not receive HSTS header
audioonly.stream: could not connect to host
audiovisualdevices.com.au: did not receive HSTS header
-audividi.shop: did not receive HSTS header
+audividi.shop: could not connect to host
aufmerksamkeitsstudie.com: could not connect to host
aufprise.de: did not receive HSTS header
augaware.org: did not receive HSTS header
augenblicke-blog.de: could not connect to host
augias.org: could not connect to host
augrandinquisiteur.com: did not receive HSTS header
+august.black: did not receive HSTS header
aujapan.ru: could not connect to host
aulaschrank.gq: could not connect to host
auntieme.com: did not receive HSTS header
+auntmia.com: could not connect to host
aur.rocks: did not receive HSTS header
aurainfosec.com: did not receive HSTS header
aurainfosec.com.au: did not receive HSTS header
@@ -1646,14 +1761,13 @@ auraredeye.com: could not connect to host
auraredshield.com: could not connect to host
aurora-terraria.org: could not connect to host
aurorarecordings.com: could not connect to host
-auroratownshipfd.org: could not connect to host
-aurosa.cz: could not connect to host
+auroratownshipfd.org: did not receive HSTS header
+aurosa.cz: did not receive HSTS header
aurugs.com: did not receive HSTS header
ausec.ch: could not connect to host
-auskunftsbegehren.at: did not receive HSTS header
+auskunftsbegehren.at: could not connect to host
auslandsjahr-usa.de: did not receive HSTS header
ausnah.me: could not connect to host
-ausschreibungen-suedtirol.it: did not receive HSTS header
aussiecable.org: could not connect to host
aussiegreenmarks.com.au: did not receive HSTS header
aussiehq.com.au: did not receive HSTS header
@@ -1661,16 +1775,17 @@ aussiewebmarketing.com.au: did not receive HSTS header
austinmobilemechanics.net: did not receive HSTS header
austinstore.com.br: could not connect to host
austinsutphin.com: could not connect to host
+australianarmedforces.org: did not receive HSTS header
australiancattle.dog: could not connect to host
australianfreebets.com.au: did not receive HSTS header
auth.mail.ru: did not receive HSTS header
-authenitech.com: did not receive HSTS header
+authenitech.com: could not connect to host
authentication.io: could not connect to host
authinfo-bestellen.de: could not connect to host
authint.com: could not connect to host
author24.ru: did not receive HSTS header
authoritynutrition.com: did not receive HSTS header
-authorsguild.in: did not receive HSTS header
+authorsguild.in: could not connect to host
authsrv.nl.eu.org: could not connect to host
auto-serwis.zgorzelec.pl: could not connect to host
auto3d.cn: could not connect to host
@@ -1682,7 +1797,7 @@ autodeploy.it: could not connect to host
autoecolebudget.ch: did not receive HSTS header
autoecoledumontblanc.com: could not connect to host
autoeet.cz: did not receive HSTS header
-autohaus-snater.de: did not receive HSTS header
+autoepc.ro: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
autojuhos.sk: could not connect to host
autokovrik-diskont.ru: did not receive HSTS header
automobiles5.com: could not connect to host
@@ -1694,11 +1809,13 @@ autostop-occasions.be: could not connect to host
autotsum.com: could not connect to host
autoxy.it: did not receive HSTS header
autumnwindsagility.com: could not connect to host
+auux.com: max-age too low: 2592000
auverbox.ovh: could not connect to host
auvious.com: did not receive HSTS header
auxetek.se: could not connect to host
auxiliumincrementum.co.uk: could not connect to host
av.de: did not receive HSTS header
+av01.tv: could not connect to host
av163.cc: could not connect to host
avadatravel.com: did not receive HSTS header
avalon-studios.de: could not connect to host
@@ -1710,6 +1827,7 @@ avdelivers.com: did not receive HSTS header
avdh.top: could not connect to host
avec-ou-sans-ordonnance.fr: could not connect to host
aveling-adventure.co.uk: did not receive HSTS header
+avestawebbtjanst.se: could not connect to host
avg.club: did not receive HSTS header
avi9526.pp.ua: could not connect to host
aviacao.pt: did not receive HSTS header
@@ -1718,6 +1836,8 @@ aviodeals.com: could not connect to host
avitres.com: could not connect to host
avmemo.com: could not connect to host
avmo.pw: could not connect to host
+avmoo.com: could not connect to host
+avnet.ws: could not connect to host
avocadooo.stream: could not connect to host
avonlearningcampus.com: could not connect to host
avotoma.com: could not connect to host
@@ -1725,15 +1845,18 @@ avs-building-services.co.uk: did not receive HSTS header
avso.pw: could not connect to host
avspot.net: could not connect to host
avus-automobile.com: did not receive HSTS header
+avv.li: did not receive HSTS header
avxo.pw: could not connect to host
awan.tech: could not connect to host
awanderlustadventure.com: did not receive HSTS header
-awccanadianpharmacy.com: did not receive HSTS header
+awccanadianpharmacy.com: could not connect to host
awei.pub: could not connect to host
awen.me: did not receive HSTS header
+awesomesit.es: could not connect to host
awf0.xyz: could not connect to host
awg-mode.de: did not receive HSTS header
-awin.la: did not receive HSTS header
+awin.la: could not connect to host
+awomaninherprime.com: could not connect to host
aww.moe: did not receive HSTS header
awxg.eu.org: could not connect to host
awxg.org: could not connect to host
@@ -1745,7 +1868,7 @@ axelchv.fr: could not connect to host
axem.co.jp: did not receive HSTS header
axeny.com: did not receive HSTS header
axg.io: did not receive HSTS header
-axialsports.com: did not receive HSTS header
+axialsports.com: could not connect to host
axis-stralis.co.uk: could not connect to host
axiumacademy.com: did not receive HSTS header
axka.com: could not connect to host
@@ -1763,14 +1886,16 @@ ayor.tech: could not connect to host
ayuru.info: could not connect to host
az-vinyl-boden.de: could not connect to host
azamra.com: did not receive HSTS header
-azane.ga: could not connect to host
+azane.ga: did not receive HSTS header
azia.info: could not connect to host
aziende.com.ar: could not connect to host
azirevpn.com: did not receive HSTS header
+azizfirat.com: did not receive HSTS header
azlo.com: did not receive HSTS header
azmusica.com: did not receive HSTS header
azprep.us: could not connect to host
azun.pl: did not receive HSTS header
+azuxul.fr: could not connect to host
azzag.co.uk: did not receive HSTS header
b-entropy.com: could not connect to host
b-landia.net: did not receive HSTS header
@@ -1789,14 +1914,14 @@ b1758.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_
b1768.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
b1768.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
b1788.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+b1rd.tk: could not connect to host
b2486.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
b2486.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
b2b-nestle.com.br: could not connect to host
b2bpromoteit.com: did not receive HSTS header
-b303.me: could not connect to host
b3orion.com: could not connect to host
b422edu.com: could not connect to host
-b4r7.de: did not receive HSTS header
+b4r7.de: could not connect to host
b5189.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
b5189.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
b5289.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -1923,37 +2048,44 @@ backpacken.org: could not connect to host
backscattering.de: did not receive HSTS header
backyardbbqbash.com: did not receive HSTS header
baconate.com: did not receive HSTS header
+bad-wurzach.de: did not receive HSTS header
bad.show: could not connect to host
badai.at: could not connect to host
badbee.cc: could not connect to host
badcronjob.com: could not connect to host
badenhard.eu: could not connect to host
+badgirlsbible.com: could not connect to host
badkamergigant.com: could not connect to host
baff.lu: could not connect to host
baffinlee.com: did not receive HSTS header
bagiobella.com: max-age too low: 0
-baglu.com: could not connect to host
bagstage.de: did not receive HSTS header
baiduaccount.com: could not connect to host
baildonhottubs.co.uk: could not connect to host
bair.io: could not connect to host
bairdzhang.com: could not connect to host
baito-j.jp: did not receive HSTS header
+baitulongbaycruises.com: could not connect to host
baixoutudo.com: did not receive HSTS header
bajajfinserv.in: did not receive HSTS header
+baka.red: could not connect to host
bakabt.info: could not connect to host
bakanin.ru: could not connect to host
bakaweb.fr: could not connect to host
bakhansen.com: did not receive HSTS header
+bakim.li: could not connect to host
bakkerdesignandbuild.com: did not receive HSTS header
+bakongcondo.com: could not connect to host
bakxnet.com: could not connect to host
balatoni-nyar.hu: did not receive HSTS header
balcan-underground.net: could not connect to host
+balcarek.pl: could not connect to host
baldwinkoo.com: could not connect to host
baleares.party: could not connect to host
balenciaspa.com: did not receive HSTS header
balihai.com: did not receive HSTS header
balilingo.ooo: could not connect to host
+ball3d.es: did not receive HSTS header
ballbusting-cbt.com: could not connect to host
balle.dk: did not receive HSTS header
ballitolocksmith.com: could not connect to host
@@ -1963,7 +2095,6 @@ balonmano.co: could not connect to host
bals.org: did not receive HSTS header
balticer.de: did not receive HSTS header
bambambaby.com.br: could not connect to host
-bambooforest.nl: could not connect to host
bambumania.com.br: could not connect to host
bamtoki.com: could not connect to host
bamtoki.se: could not connect to host
@@ -2000,7 +2131,7 @@ baodan666.com: could not connect to host
baosuckhoedoisong.net: could not connect to host
baptistboard.com: did not receive HSTS header
baptiste-destombes.fr: did not receive HSTS header
-barbaros.info: could not connect to host
+barcoderealty.com: could not connect to host
barcouniforms.com: did not receive HSTS header
barely.sexy: did not receive HSTS header
barf-alarm.de: did not receive HSTS header
@@ -2017,11 +2148,11 @@ barrett.ag: did not receive HSTS header
barrut.me: did not receive HSTS header
barshout.co.uk: could not connect to host
barss.io: could not connect to host
-bartel.ws: could not connect to host
bartelldrugs.com: did not receive HSTS header
barunisystems.com: could not connect to host
bascht.com: did not receive HSTS header
basculasconfiables.com: could not connect to host
+basementdoctor.com: did not receive HSTS header
basercap.co.ke: could not connect to host
bashc.at: could not connect to host
bashcode.ninja: could not connect to host
@@ -2032,9 +2163,10 @@ basilm.co: could not connect to host
basketsbymaurice.com: did not receive HSTS header
baskettemple.com: did not receive HSTS header
basnieuwenhuizen.nl: did not receive HSTS header
+basnoslovno.com.ua: did not receive HSTS header
bassh.net: did not receive HSTS header
bastadigital.com: did not receive HSTS header
-bastivmobile.com: could not connect to host
+bastivmobile.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bat909.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bat909.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bat9vip.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -2053,6 +2185,7 @@ bayinstruments.com: could not connect to host
bayrisch-fuer-anfaenger.de: did not receive HSTS header
baysse.eu: did not receive HSTS header
bazarstupava.sk: could not connect to host
+bazinga-events.nl: did not receive HSTS header
bazisszoftver.hu: could not connect to host
bb-shiokaze.jp: did not receive HSTS header
bbb1991.me: could not connect to host
@@ -2087,7 +2220,6 @@ bcnet.com.hk: could not connect to host
bcnet.hk: could not connect to host
bcodeur.com: did not receive HSTS header
bcradio.org: could not connect to host
-bcrook.com: could not connect to host
bcs.adv.br: did not receive HSTS header
bcsytv.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bcweightlifting.ca: could not connect to host
@@ -2128,6 +2260,7 @@ beautyconcept.co: did not receive HSTS header
beavers.io: could not connect to host
bebeefy.uk: could not connect to host
bebesurdoue.com: could not connect to host
+bebout.domains: could not connect to host
beccajoshwedding.com: could not connect to host
becklove.cn: could not connect to host
beckon.com: did not receive HSTS header
@@ -2136,21 +2269,23 @@ becubed.co: could not connect to host
bedabox.com: did not receive HSTS header
bedeta.de: could not connect to host
bedlingtonterrier.com.br: could not connect to host
+bednar.co: did not receive HSTS header
bedouille.com: could not connect to host
bedreid.dk: did not receive HSTS header
bedrijvenadministratie.nl: could not connect to host
bee.supply: could not connect to host
beerboutique.com.br: could not connect to host
-beermedlar.com: could not connect to host
beersandco.ch: could not connect to host
beerview.ga: could not connect to host
beetgroup.id: could not connect to host
beetleroadstories.com: could not connect to host
beforesunrise.de: did not receive HSTS header
befundup.com: could not connect to host
+begabungsfoerderung.info: could not connect to host
begcykel.com: did not receive HSTS header
begoodny.co.il: max-age too low: 7889238
behere.be: could not connect to host
+behoerden-online-dienste.de: did not receive HSTS header
beholdthehurricane.com: could not connect to host
beier.io: could not connect to host
beikeil.de: did not receive HSTS header
@@ -2188,21 +2323,21 @@ benjakesjohnson.com: could not connect to host
benjamin-horvath.com: could not connect to host
benjamin-suess.de: could not connect to host
benjamindietrich.com: could not connect to host
+benjamindietrich.de: did not receive HSTS header
benjaminesims.com: did not receive HSTS header
benjaminjurke.net: did not receive HSTS header
benk.press: could not connect to host
benmorecentre.co.uk: did not receive HSTS header
-benny003.de: did not receive HSTS header
+bennythink.com: could not connect to host
benohead.com: did not receive HSTS header
bentphotos.se: could not connect to host
-benwattie.com: did not receive HSTS header
+benwattie.com: could not connect to host
benzkosmetik.de: did not receive HSTS header
benzou-space.com: could not connect to host
beourvictim.com: max-age too low: 2678400
bep.gov: did not receive HSTS header
bep362.vn: could not connect to host
beraru.tk: could not connect to host
-beraten-entwickeln-steuern.de: could not connect to host
berdaguermontes.eu: could not connect to host
berduri.com: did not receive HSTS header
beretech.fr: could not connect to host
@@ -2216,9 +2351,9 @@ berliancom.com: did not receive HSTS header
berlin-kohlefrei.de: could not connect to host
berlinleaks.com: could not connect to host
bermytraq.bm: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+berna.fr: could not connect to host
bernardfischer.fr: did not receive HSTS header
bernexskiclub.ch: did not receive HSTS header
-bernieware.de: could not connect to host
berrymark.be: did not receive HSTS header
berseb.se: could not connect to host
berthelier.me: could not connect to host
@@ -2236,6 +2371,7 @@ besola.de: could not connect to host
bespaarnu.click: could not connect to host
best-of-bounce.co.uk: could not connect to host
best-wedding-quotes.com: could not connect to host
+best66.me: did not receive HSTS header
bestattorney.com: did not receive HSTS header
bestbeards.ca: could not connect to host
bestbestbitcoin.com: could not connect to host
@@ -2247,6 +2383,7 @@ bestfitnesswatchreview.info: could not connect to host
besthost.cz: did not receive HSTS header
besthotsales.com: could not connect to host
bestiahosting.com: could not connect to host
+bestlashesandbrows.com: did not receive HSTS header
bestlashesandbrows.hu: did not receive HSTS header
bestleftwild.com: could not connect to host
bestmodels.su: did not receive HSTS header
@@ -2254,7 +2391,7 @@ bestof1001.de: could not connect to host
bestorangeseo.com: could not connect to host
bestpaintings.nl: did not receive HSTS header
bestparking.xyz: could not connect to host
-bestperfumebrands.com: could not connect to host
+bestpig.fr: could not connect to host
bestwarezone.com: could not connect to host
bet-99.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bet-99.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -2271,7 +2408,6 @@ betamint.org: did not receive HSTS header
betcafearena.ro: could not connect to host
betformular.com: could not connect to host
betgo9.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-bethanyduke.com: did not receive HSTS header
bethditto.com: did not receive HSTS header
betkoo.com: could not connect to host
betleakbot.com: could not connect to host
@@ -2291,6 +2427,7 @@ betwin9.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERRO
betz.ro: could not connect to host
beulahtabernacle.com: could not connect to host
bevapehappy.com: did not receive HSTS header
+bewertet.de: could not connect to host
bexit-hosting.nl: could not connect to host
bexit-security.eu: could not connect to host
bexit-security.nl: could not connect to host
@@ -2319,6 +2456,7 @@ bg16.de: could not connect to host
bgcparkstad.nl: did not receive HSTS header
bgdaddy.com: did not receive HSTS header
bgenlisted.com: could not connect to host
+bgfashion.net: could not connect to host
bgneuesheim.de: did not receive HSTS header
bgp.ee: could not connect to host
bhatia.at: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -2328,7 +2466,6 @@ bianinapiccanovias.com: could not connect to host
biaoqingfuhao.net: did not receive HSTS header
biaoqingfuhao.org: did not receive HSTS header
biapinheiro.com.br: max-age too low: 5184000
-biathloncup.ru: could not connect to host
biblerhymes.com: did not receive HSTS header
bibliafeminina.com.br: could not connect to host
bichines.es: did not receive HSTS header
@@ -2341,6 +2478,8 @@ biego.cn: did not receive HSTS header
biehl.co: did not receive HSTS header
bielsa.me: did not receive HSTS header
bienenblog.cc: could not connect to host
+biensenvue.com: could not connect to host
+bienstar.tv: could not connect to host
bier.jp: did not receive HSTS header
bierbringer.at: could not connect to host
bierochs.org: could not connect to host
@@ -2355,13 +2494,13 @@ bigerbio.com: could not connect to host
bigfunbouncycastles.com: could not connect to host
bigjohn.ru: did not receive HSTS header
biglagoonrentals.com: did not receive HSTS header
+bignumworks.com: could not connect to host
bigshinylock.minazo.net: could not connect to host
bigshort.org: could not connect to host
biguixhe.net: could not connect to host
bijouxbrasil.com.br: did not receive HSTS header
bijouxdegriffe.com.br: could not connect to host
bijugeral.com.br: could not connect to host
-bijuteriicualint.ro: could not connect to host
bikelifetvkidsquads.co.uk: could not connect to host
bikermusic.net: could not connect to host
bikeshopitalia.com: could not connect to host
@@ -2369,17 +2508,20 @@ bilanligne.com: did not receive HSTS header
bildermachr.de: could not connect to host
biletru.net: could not connect to host
biletua.de: could not connect to host
+biletyplus.com: could not connect to host
biletyplus.ru: did not receive HSTS header
-bilibili.red: did not receive HSTS header
bill-nye-the.science: could not connect to host
billdestler.com: did not receive HSTS header
billigssl.dk: did not receive HSTS header
-billkiss.com: could not connect to host
+billkiss.com: max-age too low: 0
billninja.com: did not receive HSTS header
billpro.com.au: could not connect to host
billrobinson.io: could not connect to host
billrusling.com: could not connect to host
+biloplysninger.dk: did not receive HSTS header
+bilsho.com: could not connect to host
binam.center: could not connect to host
+binarization.com: did not receive HSTS header
binarization.net: could not connect to host
binarization.org: did not receive HSTS header
binaryabstraction.com: could not connect to host
@@ -2409,6 +2551,7 @@ bip.gov.sa: could not connect to host
birchbarkfurniture.ch: could not connect to host
birdandbranchnyc.com: max-age too low: 43200
birkengarten.ch: could not connect to host
+birkhoff.me: did not receive HSTS header
birkman.com: did not receive HSTS header
biscuits-rec.com: could not connect to host
biscuits-shop.com: could not connect to host
@@ -2420,6 +2563,7 @@ bit.voyage: did not receive HSTS header
bitace.com: did not receive HSTS header
bitbit.org: did not receive HSTS header
bitbr.net: did not receive HSTS header
+bitcalt.eu.org: could not connect to host
bitcalt.ga: could not connect to host
bitcantor.com: did not receive HSTS header
bitchan.it: could not connect to host
@@ -2433,7 +2577,7 @@ bitcoinec.info: could not connect to host
bitcoinfo.jp: did not receive HSTS header
bitcoinhk.org: did not receive HSTS header
bitcoinjpn.com: could not connect to host
-bitcoinprivacy.net: did not receive HSTS header
+bitcoinprivacy.net: could not connect to host
bitcoinwalletscript.tk: could not connect to host
bitcoinworld.me: could not connect to host
bitconcepts.co.uk: could not connect to host
@@ -2445,12 +2589,13 @@ bitf.ly: could not connect to host
bitfactory.ws: could not connect to host
bitfarm-archiv.com: did not receive HSTS header
bitfarm-archiv.de: did not receive HSTS header
+bitfolio.org: did not receive HSTS header
bitheus.com: could not connect to host
bithosting.io: did not receive HSTS header
-bitk.co: did not receive HSTS header
-bitk.co.uk: did not receive HSTS header
-bitk.eu: did not receive HSTS header
-bitk.uk: did not receive HSTS header
+bitk.co: could not connect to host
+bitk.co.uk: could not connect to host
+bitk.eu: could not connect to host
+bitk.uk: could not connect to host
bitmain.com.ua: could not connect to host
bitmaincare.com.ua: could not connect to host
bitmaincare.ru: could not connect to host
@@ -2464,16 +2609,17 @@ bitplay.space: could not connect to host
bitpod.de: could not connect to host
bitrage.de: could not connect to host
bitraum.io: could not connect to host
-bitroll.com: did not receive HSTS header
+bitroll.com: could not connect to host
bitsafe.systems: could not connect to host
+bitsburg.ru: could not connect to host
bitsensor.io: did not receive HSTS header
bitshaker.net: did not receive HSTS header
+bitstep.ca: could not connect to host
bittervault.xyz: could not connect to host
bituptick.com: did not receive HSTS header
bitvegas.com: did not receive HSTS header
bitvigor.com: could not connect to host
bitwrought.net: could not connect to host
-bitxel.com.co: did not receive HSTS header
bityes.org: could not connect to host
bivsi.com: could not connect to host
biyori.moe: did not receive HSTS header
@@ -2489,17 +2635,20 @@ bjl5689.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERRO
bjl5689.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bjrn.io: could not connect to host
bjtxl.cn: could not connect to host
+bk-wife.com: could not connect to host
bkb-skandal.ch: could not connect to host
-bkhayes.com: did not receive HSTS header
blaauwgeers.travel: could not connect to host
black-armada.com: could not connect to host
black-armada.com.pl: could not connect to host
black-armada.pl: could not connect to host
+black-gay-porn.biz: could not connect to host
black-octopus.ru: could not connect to host
+black-pool.net: could not connect to host
blackapron.com.br: could not connect to host
blackberrycentral.com: could not connect to host
blackberryforums.be: did not receive HSTS header
blackburn.link: could not connect to host
+blackcicada.com: could not connect to host
blackdesertsp.com: could not connect to host
blackdiam.net: did not receive HSTS header
blackdragoninc.org: could not connect to host
@@ -2513,10 +2662,10 @@ blackphantom.de: could not connect to host
blackroot.eu: max-age too low: 10368000
blackscreen.me: could not connect to host
blackunicorn.wtf: could not connect to host
-bladesmith.io: did not receive HSTS header
+bladesmith.io: could not connect to host
blakerandall.xyz: did not receive HSTS header
+blankersfamily.com: did not receive HSTS header
blantik.net: could not connect to host
-blantr.com: could not connect to host
blarg.co: could not connect to host
blauwwit.be: did not receive HSTS header
blazeit.io: could not connect to host
@@ -2525,10 +2674,12 @@ bleep.zone: could not connect to host
blendlecdn.com: could not connect to host
blenheimchalcot.com: did not receive HSTS header
blessedearth.com.au: max-age too low: 7889238
+blessedguy.net: did not receive HSTS header
blessnet.jp: did not receive HSTS header
bleutecmedia.com: did not receive HSTS header
blha303.com.au: could not connect to host
bliker.ga: could not connect to host
+blikund.swedbank.se: did not receive HSTS header
blindaryproduction.tk: could not connect to host
blindsexdate.nl: did not receive HSTS header
bling9.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -2537,11 +2688,9 @@ bling999.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERR
bling999.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
blinkenlight.co.uk: could not connect to host
blinkenlight.com.au: could not connect to host
-blissjoe.com: could not connect to host
blitzvendor.com: could not connect to host
blizz.news: max-age too low: 0
blmiller.com: did not receive HSTS header
-blockchainced.com: could not connect to host
blocksatz-medien.de: could not connect to host
blockshopauto.com: could not connect to host
blog-ritaline.com: could not connect to host
@@ -2552,18 +2701,16 @@ blog.torproject.org: max-age too low: 1000
blogabout.ru: could not connect to host
blogcuaviet.com: could not connect to host
blogdeyugioh.com: could not connect to host
-blogdieconomia.it: did not receive HSTS header
-blogdimoda.com: did not receive HSTS header
bloglife-bb.com: could not connect to host
bloglikepro.com: could not connect to host
blognone.com: did not receive HSTS header
blognr.com: could not connect to host
blogonblogspot.com: did not receive HSTS header
-blogtroterzy.pl: could not connect to host
blokino.org: did not receive HSTS header
blokuhaka.fr: did not receive HSTS header
blood4pets.tk: could not connect to host
bloodyexcellent.com: did not receive HSTS header
+bloogle.top: did not receive HSTS header
bloomnbud.com: did not receive HSTS header
bloomzoomy.ru: could not connect to host
blowjs.com: could not connect to host
@@ -2575,6 +2722,7 @@ bludnykoren.ml: could not connect to host
blue17.co.uk: did not receive HSTS header
bluebill.net: did not receive HSTS header
bluecardlottery.eu: could not connect to host
+bluecards.eu: max-age too low: 0
bluecon.eu: could not connect to host
bluedata.ltd: did not receive HSTS header
bluefinger.nl: did not receive HSTS header
@@ -2582,10 +2730,12 @@ blueglobalmedia.com: could not connect to host
bluehawk.cloud: could not connect to host
bluehelixmusic.com: could not connect to host
blueliv.com: did not receive HSTS header
+bluemoonroleplaying.com: could not connect to host
+blueoceantech.us: did not receive HSTS header
bluepearl.tk: could not connect to host
bluepoint.foundation: could not connect to host
bluepoint.institute: could not connect to host
-blueprintloans.co.uk: did not receive HSTS header
+blueprintloans.co.uk: could not connect to host
blueridgesecuritycameras.com: did not receive HSTS header
blues-and-pictures.com: could not connect to host
bluescloud.xyz: could not connect to host
@@ -2593,9 +2743,10 @@ bluesecure.com.br: could not connect to host
bluetenmeer.com: did not receive HSTS header
bluezonehealth.co.uk: did not receive HSTS header
blui.cf: max-age too low: 1209600
+blui.ml: could not connect to host
bluketing.com: did not receive HSTS header
blumen-binder.ch: did not receive HSTS header
-blumen-garage.de: could not connect to host
+blumen-garage.de: did not receive HSTS header
blumenwiese.xyz: did not receive HSTS header
blundell.wedding: could not connect to host
blunderify.se: could not connect to host
@@ -2608,11 +2759,10 @@ blvdmb.com: did not receive HSTS header
bm-i.ch: could not connect to host
bm-trading.nl: did not receive HSTS header
bmet.de: did not receive HSTS header
-bmoattachments.org: did not receive HSTS header
bnb-buddy.nl: could not connect to host
bnboy.cn: could not connect to host
bngsecure.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-bnhlibrary.com: did not receive HSTS header
+bnhlibrary.com: could not connect to host
bo1689.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bo1689.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bo9club.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -2624,6 +2774,7 @@ bo9game.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERRO
bo9game.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
bo9king.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
board-buy.ru: could not connect to host
+bobaobei.net: could not connect to host
bobaobei.org: could not connect to host
bobep.ru: could not connect to host
bobiji.com: could not connect to host
@@ -2642,9 +2793,9 @@ bohan.life: could not connect to host
bohyn.cz: could not connect to host
boiadeirodeberna.com: could not connect to host
boilesen.com: did not receive HSTS header
-bokeyy.com: could not connect to host
+bokeyy.com: did not receive HSTS header
bolainfoasia.com: did not receive HSTS header
-bollywood.uno: did not receive HSTS header
+bollywood.uno: could not connect to host
boltdata.io: could not connect to host
boltn.uk: could not connect to host
bolwerk.com.br: did not receive HSTS header
@@ -2652,15 +2803,16 @@ bomberus.de: could not connect to host
bombsquad.studio: could not connect to host
bonamihome.ro: could not connect to host
bonapp.restaurant: could not connect to host
+bondagefetishstore.com: could not connect to host
bondtofte.dk: max-age too low: 2592000
boneko.de: did not receive HSTS header
+bonibuty.com: max-age too low: 2592000
bonigo.de: could not connect to host
bonita.com.br: could not connect to host
bonitabrazilian.co.nz: did not receive HSTS header
-bonniekitchen.com: could not connect to host
bonnin.fr: did not receive HSTS header
bonobo.cz: could not connect to host
-bonop.com: did not receive HSTS header
+bonop.com: could not connect to host
bonta.one: could not connect to host
bonus-flexi.com: did not receive HSTS header
boobox.xyz: could not connect to host
@@ -2691,7 +2843,6 @@ bopera.co.uk: could not connect to host
borchers-media.de: could not connect to host
borderlinegroup.com: could not connect to host
borgmestervangen.xyz: could not connect to host
-borgodigatteraia.it: could not connect to host
boringsecurity.net: could not connect to host
boris.one: could not connect to host
borisavstankovic.rs: could not connect to host
@@ -2702,13 +2853,10 @@ borrelioz.com: did not receive HSTS header
borscheid-wenig.com: did not receive HSTS header
borzoi.com.br: could not connect to host
boschee.net: could not connect to host
-bostonadvisors.com: could not connect to host
bosworthdental.co.uk: did not receive HSTS header
botlab.ch: could not connect to host
botmanager.pl: could not connect to host
-botox.bz: did not receive HSTS header
bots.cat: could not connect to host
-botserver.de: did not receive HSTS header
botsindiscord.me: could not connect to host
botstack.host: could not connect to host
boueki.jp: did not receive HSTS header
@@ -2724,8 +2872,8 @@ bouncemasters.co.uk: could not connect to host
bouncewithbovells.com: could not connect to host
bouncing4joy.co.uk: could not connect to host
bouncingbuzzybees.co.uk: could not connect to host
-bouncourseplanner.net: could not connect to host
bouncycastleandparty.co.uk: could not connect to host
+bouncycastlehireauckland.co.nz: could not connect to host
bouncycastlehiremedway.com: did not receive HSTS header
bouncycastles.me: could not connect to host
bouncycastlesperth.net: could not connect to host
@@ -2746,12 +2894,13 @@ boxmoe.cn: did not receive HSTS header
boxview.com: could not connect to host
boyan.in: could not connect to host
boyfriendhusband.men: did not receive HSTS header
+boypoint.de: could not connect to host
bozemancarpetcleaningservices.com: did not receive HSTS header
bp-wahl.at: did not receive HSTS header
bpadvisors.eu: could not connect to host
bpaste.net: did not receive HSTS header
bqcp.net: could not connect to host
-bqtoolbox.com: could not connect to host
+bqtoolbox.com: did not receive HSTS header
bracoitaliano.com.br: could not connect to host
braemer-it-consulting.de: could not connect to host
bragasoft.com.br: did not receive HSTS header
@@ -2762,7 +2911,6 @@ braineet.com: did not receive HSTS header
brainfork.ml: could not connect to host
brainfpv.com: did not receive HSTS header
brainlag.org: could not connect to host
-brainsik.net: could not connect to host
braintensive.com: could not connect to host
braintm.com: could not connect to host
braintreebouncycastles.com: could not connect to host
@@ -2784,21 +2932,22 @@ brandons.site: could not connect to host
brandontaylor-black.com: could not connect to host
brandred.net: could not connect to host
brandspray.com: could not connect to host
-brandtrapselfie.nl: could not connect to host
brasilien.guide: could not connect to host
brasilmorar.com: did not receive HSTS header
bravz.de: could not connect to host
-brb.city: did not receive HSTS header
breatheav.com: did not receive HSTS header
breatheproduction.com: did not receive HSTS header
breeswish.org: did not receive HSTS header
bregnedalsystems.dk: did not receive HSTS header
+breitbild-beamer.de: max-age too low: 1209600
bremensaki.com: max-age too low: 2592000
brenden.net.au: could not connect to host
bress.cloud: did not receive HSTS header
+brettelliff.com: did not receive HSTS header
brettpemberton.xyz: did not receive HSTS header
bretz-hufer.de: did not receive HSTS header
brewtrackr.com: did not receive HSTS header
+breznet.com: could not connect to host
brfvh24.se: could not connect to host
briangarcia.ga: could not connect to host
brianmwaters.net: did not receive HSTS header
@@ -2806,9 +2955,13 @@ brianpcurran.com: did not receive HSTS header
brickoo.com: could not connect to host
brickwerks.io: could not connect to host
brickyardbuffalo.com: did not receive HSTS header
+brideandgroomdirect.ie: did not receive HSTS header
bridgeout.com: could not connect to host
bridholm.se: could not connect to host
+bridzius.lt: did not receive HSTS header
+briggsleroux.com: could not connect to host
brightfuturemadebyme.com: could not connect to host
+brightlifedirect.com: max-age too low: 7889238
brightstarkids.co.uk: did not receive HSTS header
brightstarkids.com.au: did not receive HSTS header
brightstarkids.net: did not receive HSTS header
@@ -2824,41 +2977,45 @@ brio-ukraine.store: could not connect to host
britishchronicles.com: could not connect to host
britishmeat.com: could not connect to host
britzer-toner.de: did not receive HSTS header
-brivadois.ovh: did not receive HSTS header
+brivadois.ovh: could not connect to host
brix.ninja: did not receive HSTS header
brks.xyz: could not connect to host
brmascots.com: could not connect to host
-brn.by: could not connect to host
-broerweb.nl: did not receive HSTS header
+broerweb.nl: could not connect to host
broken-oak.com: could not connect to host
brokenjoysticks.net: did not receive HSTS header
-brookechase.com: could not connect to host
+brooke-fan.com: did not receive HSTS header
+brookechase.com: did not receive HSTS header
brookframework.org: could not connect to host
brossman.it: could not connect to host
+brother-printsmart.nl: did not receive HSTS header
brouwerijkoelit.nl: could not connect to host
+brown-devost.com: did not receive HSTS header
brownlawoffice.us: did not receive HSTS header
browserid.org: could not connect to host
brplusdigital.com: could not connect to host
-brucemobile.de: could not connect to host
brunix.net: did not receive HSTS header
brunoonline.co.uk: could not connect to host
+brunoramos.com: could not connect to host
brunoramos.org: could not connect to host
+brutus2.ga: could not connect to host
bryancastillo.site: could not connect to host
bryanshearer.accountant: did not receive HSTS header
bryn.xyz: could not connect to host
brynnan.nl: could not connect to host
brztec.com: did not receive HSTS header
-bs.sb: could not connect to host
bsagan.fr: did not receive HSTS header
bsalyzer.com: could not connect to host
bsc01.dyndns.org: could not connect to host
bsd.com.ro: could not connect to host
+bsdlab.com: could not connect to host
bsdtips.com: could not connect to host
bsdug.org: could not connect to host
bsg-aok-muenchen.de: did not receive HSTS header
bsklabels.com: did not receive HSTS header
bsktweetup.info: could not connect to host
bsohoekvanholland.nl: could not connect to host
+bsquared.org: could not connect to host
bsuess.de: could not connect to host
bsuru.xyz: could not connect to host
bt78.cn: could not connect to host
@@ -2878,11 +3035,13 @@ btcycle.org: did not receive HSTS header
btku.org: could not connect to host
btrb.ml: could not connect to host
btserv.de: did not receive HSTS header
+btth.live: could not connect to host
btth.xyz: could not connect to host
bturboo.com: could not connect to host
btxiaobai.com: did not receive HSTS header
bubba.cc: could not connect to host
-buben.tech: did not receive HSTS header
+buben.tech: could not connect to host
+bubhub.io: could not connect to host
buchheld.at: could not connect to host
buchverlag-scholz.de: did not receive HSTS header
buck.com: did not receive HSTS header
@@ -2899,6 +3058,7 @@ buenotour.ru: did not receive HSTS header
buergerdialog.net: could not connect to host
buergerhaushalt.com: did not receive HSTS header
buffalodrinkinggame.beer: did not receive HSTS header
+buffetbouc.com: could not connect to host
bugtrack.co.uk: did not receive HSTS header
bugtrack.io: could not connect to host
buhler.pro: did not receive HSTS header
@@ -2912,6 +3072,7 @@ buildingclouds.ch: could not connect to host
buildingclouds.es: could not connect to host
buildingclouds.eu: could not connect to host
buildingclouds.fr: could not connect to host
+buildrightbuildingservicesltd.co.uk: did not receive HSTS header
buildsaver.co.za: did not receive HSTS header
builmaker.com: did not receive HSTS header
built.by: did not receive HSTS header
@@ -2922,21 +3083,24 @@ bulbgenie.com: could not connect to host
buldogueingles.com.br: could not connect to host
bulgarien.guide: could not connect to host
bulkbuy.tech: could not connect to host
+bull.id.au: could not connect to host
bullbits.com: max-age too low: 0
bulletbabu.com: could not connect to host
bullpay.com: did not receive HSTS header
bullterrier.me: could not connect to host
bulmafox.com: could not connect to host
bulmastife.com.br: could not connect to host
-bumarkamoda.com: could not connect to host
+bumarkamoda.com: did not receive HSTS header
bumshow.ru: did not receive HSTS header
bunadarbankinn.is: could not connect to host
bunaken.asia: could not connect to host
bunbomenu.de: could not connect to host
+bunbun.be: could not connect to host
bundaberg.com: did not receive HSTS header
+bunny.tk: did not receive HSTS header
bunsenlabs.org: max-age too low: 2592000
buonventosbt.eu: did not receive HSTS header
-buradangonder.com: could not connect to host
+bupu.ml: could not connect to host
burckardtnet.de: did not receive HSTS header
bureaubolster.nl: did not receive HSTS header
bureaugravity.com: did not receive HSTS header
@@ -2948,7 +3112,7 @@ burpsuite.site: could not connect to host
burroughsid.com: could not connect to host
burrow.ovh: could not connect to host
burrowingsec.com: could not connect to host
-bursa3bydgoszcz.pl: did not receive HSTS header
+bursa3bydgoszcz.pl: could not connect to host
burtrum.top: could not connect to host
buryat-mongol.cf: could not connect to host
buryit.net: did not receive HSTS header
@@ -2964,7 +3128,10 @@ businessamongus.com: could not connect to host
businessetmarketing.com: could not connect to host
businessfurs.info: could not connect to host
businesshosting.nl: did not receive HSTS header
-businessmodeler.se: could not connect to host
+businessimmigration-eu.com: could not connect to host
+businessimmigration-eu.ru: could not connect to host
+businessmodeler.se: did not receive HSTS header
+businessradar.com.au: could not connect to host
bustabit.com: could not connect to host
bustimes.org.uk: did not receive HSTS header
busybee360.com: could not connect to host
@@ -2976,6 +3143,7 @@ buttercoin.com: could not connect to host
buttercupstraining.co.uk: did not receive HSTS header
butterfieldstraining.com: could not connect to host
buttermilk.cf: could not connect to host
+buturyu.net: did not receive HSTS header
buturyu.org: did not receive HSTS header
buvinghausen.com: max-age too low: 86400
buy-thing.com: could not connect to host
@@ -3008,20 +3176,19 @@ bwf6.com: could not connect to host
bwf66.com: could not connect to host
bwf77.com: could not connect to host
bwf99.com: could not connect to host
-bwilkinson.co.uk: could not connect to host
-bwin86.com: did not receive HSTS header
+bwin86.com: could not connect to host
bwwb.nu: did not receive HSTS header
bx-web.com: did not receive HSTS header
+bxdev.me: could not connect to host
by.cx: did not receive HSTS header
by1896.com: could not connect to host
by1898.com: did not receive HSTS header
by1899.com: could not connect to host
by4cqb.cn: could not connect to host
-by77.com: could not connect to host
+by77.com: did not receive HSTS header
by777.com: did not receive HSTS header
bydisk.com: could not connect to host
byji.com: could not connect to host
-byken.cn: could not connect to host
bynet.cz: could not connect to host
bypass.kr: could not connect to host
bypassed.bid: could not connect to host
@@ -3043,13 +3210,14 @@ bypassed.today: could not connect to host
bypassed.works: could not connect to host
bypassed.world: could not connect to host
bypro.xyz: could not connect to host
-byrko.cz: could not connect to host
byronprivaterehab.com.au: did not receive HSTS header
-byronr.com: did not receive HSTS header
+byronr.com: could not connect to host
byronwade.com: could not connect to host
byte.chat: did not receive HSTS header
byte.wtf: did not receive HSTS header
bytelog.org: did not receive HSTS header
+byteowls.com: did not receive HSTS header
+bytepark.de: did not receive HSTS header
bytesatwork.eu: could not connect to host
byteshift.ca: could not connect to host
bytesofcode.de: could not connect to host
@@ -3063,16 +3231,17 @@ c0rn3j.com: could not connect to host
c12discountonline.com: did not receive HSTS header
c16t.uk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
c1yd3i.me: could not connect to host
-c2lab.net: did not receive HSTS header
c2o2.xyz: could not connect to host
c3-compose.com: could not connect to host
c3.pm: could not connect to host
+c376.site: could not connect to host
c3b.info: could not connect to host
c3bbs.com: could not connect to host
c3hv.cn: could not connect to host
c3ie.com: did not receive HSTS header
c4.hk: could not connect to host
-ca-terminal-multiservices.fr: did not receive HSTS header
+ca-terminal-multiservices.fr: could not connect to host
+cabarave.com: could not connect to host
cablehighspeed.net: could not connect to host
cabsites.com: could not connect to host
cabusar.fr: could not connect to host
@@ -3081,6 +3250,7 @@ cachethq.io: did not receive HSTS header
cacn.pw: could not connect to host
caconnect.org: could not connect to host
cacr.pw: could not connect to host
+cadacoon.com: did not receive HSTS header
cadao.me: did not receive HSTS header
cadburymovies.in.net: did not receive HSTS header
cadenadg.gr: did not receive HSTS header
@@ -3093,7 +3263,6 @@ cafe-service.ru: could not connect to host
cafechesscourt.com: could not connect to host
cafefresco.pe: did not receive HSTS header
cafesg.net: did not receive HSTS header
-caijunyi.net: did not receive HSTS header
caim.cz: did not receive HSTS header
caipai.fm: could not connect to host
cairnterrier.com.br: could not connect to host
@@ -3104,25 +3273,22 @@ cal.goip.de: could not connect to host
calcularpagerank.com.br: could not connect to host
calculatoaresecondhand.xyz: could not connect to host
caldecotevillagehall.co.uk: could not connect to host
-calebmorris.com: could not connect to host
+calebmorris.com: max-age too low: 900
calgaryconstructionjobs.com: did not receive HSTS header
calidoinvierno.com: could not connect to host
callabs.net: could not connect to host
callanbryant.co.uk: did not receive HSTS header
-callawayracing.se: could not connect to host
calleveryday.com: could not connect to host
callision.com: did not receive HSTS header
callmereda.com: could not connect to host
callsigns.ca: could not connect to host
calltrackingreports.com: could not connect to host
-calomel.org: max-age too low: 2764800
calories.org: could not connect to host
caltonnutrition.com: did not receive HSTS header
calvin.me: did not receive HSTS header
calypso-tour.net: could not connect to host
calypsogames.net: could not connect to host
camaya.net: did not receive HSTS header
-cambridge-security.com: could not connect to host
cambridgeanalytica.net: could not connect to host
cambridgeanalytica.org: did not receive HSTS header
camisadotorcedor.com.br: could not connect to host
@@ -3142,6 +3308,9 @@ campingdreams.com: did not receive HSTS header
campus-cybersecurity.team: did not receive HSTS header
campusportalng.com: did not receive HSTS header
camsanalytics.com: could not connect to host
+camshowdir.com: could not connect to host
+camshowhub.com: could not connect to host
+canadianchristianity.com: did not receive HSTS header
canadiangamblingchoice.com: did not receive HSTS header
canarianlegalalliance.com: did not receive HSTS header
cancelmyprofile.com: could not connect to host
@@ -3151,7 +3320,7 @@ candratech.com: could not connect to host
candygirl.shop: could not connect to host
candykidsentertainment.co.uk: did not receive HSTS header
candylion.rocks: could not connect to host
-canerkorkmaz.com: could not connect to host
+canerkorkmaz.com: did not receive HSTS header
canfield.gov: did not receive HSTS header
canifis.net: did not receive HSTS header
cannarobotics.com: could not connect to host
@@ -3179,7 +3348,9 @@ car-rental24.com: could not connect to host
carano-service.de: did not receive HSTS header
caraudio69.cz: did not receive HSTS header
carbonmonoxidelawyer.net: could not connect to host
-card-cashing.com: max-age too low: 0
+carck.co.uk: could not connect to host
+carck.uk: could not connect to host
+card-cashing.com: did not receive HSTS header
card-toka.jp: could not connect to host
cardloan-manual.net: could not connect to host
cardoni.net: did not receive HSTS header
@@ -3187,15 +3358,16 @@ cardse.net: could not connect to host
cardstream.com: did not receive HSTS header
cardurl.com: did not receive HSTS header
cardwars.hu: could not connect to host
-career.support: could not connect to host
careeraid.in: could not connect to host
careerstuds.com: did not receive HSTS header
careplasticsurgery.com: did not receive HSTS header
carey.bio: did not receive HSTS header
carey.li: did not receive HSTS header
-carif-idf.net: could not connect to host
-carif-idf.org: could not connect to host
-carlandfaith.com: could not connect to host
+carfinancehelp.com: could not connect to host
+carif-idf.net: did not receive HSTS header
+carif-idf.org: did not receive HSTS header
+carinsurance.es: could not connect to host
+carlandfaith.com: did not receive HSTS header
carlolly.co.uk: could not connect to host
carlosalves.info: could not connect to host
carloshmm.com: could not connect to host
@@ -3208,13 +3380,24 @@ caroli.info: could not connect to host
carpliyz.com: did not receive HSTS header
carrando.de: could not connect to host
carredejardin.com: did not receive HSTS header
-carrentalsathens.com: could not connect to host
carroarmato0.be: did not receive HSTS header
+carrollservicecompany.com: did not receive HSTS header
carrosserie-dubois.com: did not receive HSTS header
carsforbackpackers.com: could not connect to host
-carson-matthews.co.uk: could not connect to host
carsten.pw: did not receive HSTS header
carstenfeuls.de: did not receive HSTS header
+cartadeviajes.cl: did not receive HSTS header
+cartadeviajes.co: did not receive HSTS header
+cartadeviajes.com: did not receive HSTS header
+cartadeviajes.com.ar: did not receive HSTS header
+cartadeviajes.com.ve: did not receive HSTS header
+cartadeviajes.de: did not receive HSTS header
+cartadeviajes.ec: did not receive HSTS header
+cartadeviajes.es: did not receive HSTS header
+cartadeviajes.fr: did not receive HSTS header
+cartadeviajes.mx: did not receive HSTS header
+cartadeviajes.pe: did not receive HSTS header
+cartadeviajes.uk: did not receive HSTS header
cartelcircuit.com: did not receive HSTS header
carterorland.com: could not connect to host
cartesunicef.be: did not receive HSTS header
@@ -3227,14 +3410,14 @@ casashopp.com.br: could not connect to host
casasuleletrodomesticos.com.br: could not connect to host
casedi.org: max-age too low: 0
casefall.com: could not connect to host
-caseof.tk: max-age too low: 0
cash-pos.com: did not receive HSTS header
cashfortulsahouses.com: could not connect to host
cashless.fr: did not receive HSTS header
+cashlink.de: did not receive HSTS header
cashlink.io: did not receive HSTS header
cashmyphone.ch: could not connect to host
cashsector.ga: could not connect to host
-casinocashflow.ru: could not connect to host
+casinocashflow.ru: did not receive HSTS header
casinolistings.com: could not connect to host
casinoluck.com: could not connect to host
casinoreal.com: could not connect to host
@@ -3246,9 +3429,11 @@ casovi.cf: could not connect to host
castagnonavocats.com: did not receive HSTS header
castlejackpot.com: did not receive HSTS header
castleswa.com.au: could not connect to host
-cata.ga: could not connect to host
+cat-box.de: did not receive HSTS header
+cata.ga: did not receive HSTS header
catalin.pw: could not connect to host
catarsisvr.com: could not connect to host
+catchfotografie.nl: did not receive HSTS header
catcontent.cloud: could not connect to host
caterkids.com: did not receive HSTS header
catgirl.me: did not receive HSTS header
@@ -3256,12 +3441,14 @@ catgirl.pics: could not connect to host
catharisme.org: could not connect to host
catherineidylle.com: max-age too low: 0
catherinesarasin.com: did not receive HSTS header
+catherinescastles.co.uk: did not receive HSTS header
cathosting.org: could not connect to host
catinmay.com: did not receive HSTS header
catnapstudios.com: could not connect to host
catnmeow.com: could not connect to host
catprog.org: did not receive HSTS header
catsmagic.pp.ua: could not connect to host
+caughtredhanded.co.nz: could not connect to host
causae-fincas.es: did not receive HSTS header
causae.es: did not receive HSTS header
cavaleria.ro: did not receive HSTS header
@@ -3275,6 +3462,7 @@ cavevinsdefrance.fr: did not receive HSTS header
cayafashion.de: did not receive HSTS header
cayounglab.co.jp: did not receive HSTS header
cbamo.org: did not receive HSTS header
+cbdcontact.pl: could not connect to host
cbi-epa.gov: could not connect to host
cc2729.com: did not receive HSTS header
ccayearbook.com: could not connect to host
@@ -3283,6 +3471,7 @@ ccgn.co: could not connect to host
ccja.ro: did not receive HSTS header
ccl-sti.ch: did not receive HSTS header
ccretreatandfarm.com: did not receive HSTS header
+ccsys.com: could not connect to host
cctech.ph: could not connect to host
cctld.com: could not connect to host
ccu.io: could not connect to host
@@ -3293,7 +3482,6 @@ ccv.nl: did not receive HSTS header
cd0.us: could not connect to host
cdcpartners.gov: could not connect to host
cdeck.net: could not connect to host
-cdkeyworld.de: did not receive HSTS header
cdlcenter.com: did not receive HSTS header
cdmhp.org.nz: could not connect to host
cdmlb.net: could not connect to host
@@ -3302,10 +3490,8 @@ cdn.sx.cn: could not connect to host
cdnb.co: could not connect to host
cdndepo.com: could not connect to host
cdnk39.com: could not connect to host
-cdns.cloud: could not connect to host
cdreporting.co.uk: did not receive HSTS header
cdt.org: did not receive HSTS header
-ce-agentur.de: did not receive HSTS header
ceagriproducts.com: did not receive HSTS header
cecilwalker.com.au: did not receive HSTS header
cee.io: could not connect to host
@@ -3326,18 +3512,18 @@ cem.pw: did not receive HSTS header
cencalvia.org: could not connect to host
centennialrewards.com: did not receive HSTS header
centerforpolicy.org: could not connect to host
-centerpoint.ovh: did not receive HSTS header
centillien.com: did not receive HSTS header
centos.pub: could not connect to host
central4.me: could not connect to host
centralcountiesservices.org: did not receive HSTS header
centrallead.net: could not connect to host
-centralvacsunlimited.net: did not receive HSTS header
+centrallotus.com: did not receive HSTS header
+centralvacsunlimited.net: could not connect to host
centralvoice.org: could not connect to host
centralync.com: could not connect to host
centrepoint-community.com: could not connect to host
centricbeats.com: did not receive HSTS header
-centrolavoro.org: did not receive HSTS header
+centrym.top: did not receive HSTS header
centsforchange.net: could not connect to host
century-group.com: max-age too low: 2592000
ceoimon.com: did not receive HSTS header
@@ -3349,7 +3535,7 @@ ceritamalam.net: could not connect to host
cerize.love: could not connect to host
cernega.ro: did not receive HSTS header
cerpa.com.br: did not receive HSTS header
-cerstve-korenie.sk: did not receive HSTS header
+cerstve-korenie.sk: could not connect to host
cerstvekorenie.sk: did not receive HSTS header
cert.se: max-age too low: 2628001
certcenter.fr: could not connect to host
@@ -3361,12 +3547,14 @@ ceruleanmainbeach.com.au: did not receive HSTS header
cesal.net: could not connect to host
cesantias.co: could not connect to host
cesidianroot.eu: could not connect to host
-cespri.com.pe: did not receive HSTS header
+cespri.com.pe: could not connect to host
+cestunmetier.ch: could not connect to host
ceta.one: did not receive HSTS header
+cetangarana.com: did not receive HSTS header
cevrimici.com: could not connect to host
+cf-tm.net: could not connect to host
cf11.de: did not receive HSTS header
cfa.gov: did not receive HSTS header
-cfan.space: could not connect to host
cfcnexus.org: could not connect to host
cfcproperties.com: did not receive HSTS header
cfetengineering.com: could not connect to host
@@ -3380,6 +3568,7 @@ chabaojia.com: did not receive HSTS header
chadklass.com: could not connect to host
chadtaljaardt.com: could not connect to host
chahub.com: could not connect to host
+chainedunion.info: could not connect to host
chainmonitor.com: could not connect to host
chairinstitute.com: did not receive HSTS header
chaldeen.pro: did not receive HSTS header
@@ -3390,7 +3579,6 @@ chamilo.org: did not receive HSTS header
champ.dog: did not receive HSTS header
championnat-romand-cuisiniers-amateurs.ch: could not connect to host
championsofregnum.com: did not receive HSTS header
-champserver.net: did not receive HSTS header
chancat.blog: could not connect to host
chandlerredding.com: could not connect to host
changelab.cc: max-age too low: 0
@@ -3404,7 +3592,6 @@ channyc.com: could not connect to host
chaos.fail: could not connect to host
chaoscastles.co.uk: did not receive HSTS header
chaoswebs.net: did not receive HSTS header
-chaotichive.com: could not connect to host
chaoticlaw.com: did not receive HSTS header
chaouby.com: could not connect to host
chapelaria.tf: could not connect to host
@@ -3413,21 +3600,23 @@ chargejuice.com: [Exception... "Component returned failure code: 0x80004005 (NS_
charityclear.com: could not connect to host
charitystreet.co.uk: could not connect to host
charl.eu: could not connect to host
-charlesjay.com: could not connect to host
+charlenevondell.com: could not connect to host
+charlesjay.com: did not receive HSTS header
charlestonsecuritysystems.net: did not receive HSTS header
charliemcneive.com: could not connect to host
charlimarie.com: did not receive HSTS header
charlipopkids.com.au: did not receive HSTS header
+charmanterelefant.at: did not receive HSTS header
charnleyhouse.co.uk: did not receive HSTS header
charonsecurity.com: could not connect to host
charp.eu: could not connect to host
chartstoffarm.de: did not receive HSTS header
chasafilli.ch: could not connect to host
+chaseandzoey.de: could not connect to host
chaseganey.com: did not receive HSTS header
chasing-coins.com: did not receive HSTS header
chaska.co.za: could not connect to host
chasse-et-plaisir.com: did not receive HSTS header
-chat-porc.eu: did not receive HSTS header
chatbot.me: did not receive HSTS header
chatbot.one: could not connect to host
chatbotclic.com: could not connect to host
@@ -3436,13 +3625,14 @@ chatbots.email: could not connect to host
chateau-belvoir.com: could not connect to host
chateauconstellation.ch: did not receive HSTS header
chateaudevaugrigneuse.com: did not receive HSTS header
-chatnbook.com: could not connect to host
+chatnbook.com: did not receive HSTS header
chatup.cf: could not connect to host
chatxp.com: could not connect to host
chaulootz.com: did not receive HSTS header
chaverde.org: could not connect to host
chazgie.se: did not receive HSTS header
chcemvediet.sk: max-age too low: 1555200
+chci-web.cz: max-age too low: 0
chdgaming.xyz: could not connect to host
cheah.xyz: did not receive HSTS header
cheapdns.org: could not connect to host
@@ -3455,6 +3645,7 @@ checkhost.org: could not connect to host
checkmateshoes.com: did not receive HSTS header
checkmatewebsolutions.com: max-age too low: 0
checkout.google.com: could not connect to host (error ignored - included regardless)
+checkras.tk: could not connect to host
checkyourmeds.com: did not receive HSTS header
cheekylittlerascals.co.uk: did not receive HSTS header
cheerflow.com: could not connect to host
@@ -3478,11 +3669,12 @@ cherekerry.com: could not connect to host
cherrett.digital: did not receive HSTS header
cherrydropscandycarts.co.uk: could not connect to host
cherylsoleway.com: did not receive HSTS header
+chesscoders.com: did not receive HSTS header
chessreporter.nl: did not receive HSTS header
chesterbrass.uk: did not receive HSTS header
-chestnut.cf: could not connect to host
chhy.at: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
chiamata-aiuto.ch: could not connect to host
+chiaraiuola.com: could not connect to host
chiaramail.com: could not connect to host
chib.chat: could not connect to host
chicorycom.net: did not receive HSTS header
@@ -3501,6 +3693,7 @@ chinacdn.org: could not connect to host
chinawhale.com: could not connect to host
chinternet.xyz: could not connect to host
chiphell.com: did not receive HSTS header
+chiralsoftware.com: could not connect to host
chirgui.eu: could not connect to host
chloca.jp: could not connect to host
chloe.re: did not receive HSTS header
@@ -3517,14 +3710,18 @@ choiralberta.ca: did not receive HSTS header
choisirmonerp.com: did not receive HSTS header
chollima.pro: could not connect to host
chontalpa.pw: could not connect to host
-choootto.club: could not connect to host
+choootto.club: did not receive HSTS header
chopperforums.com: could not connect to host
chordso.com: did not receive HSTS header
+chorkley.co.uk: could not connect to host
+chorkley.com: could not connect to host
chorkley.me: could not connect to host
+chorkley.uk: could not connect to host
chorleiterverband.de: did not receive HSTS header
choruscrowd.com: could not connect to host
-chosenplaintext.org: could not connect to host
+chotlo.com: did not receive HSTS header
chotu.net: could not connect to host
+chr0me.sh: could not connect to host
chris-web.info: could not connect to host
chrisandsarahinasia.com: could not connect to host
chrisbrakebill.com: did not receive HSTS header
@@ -3536,7 +3733,9 @@ chriskirchner.de: did not receive HSTS header
chriskyrouac.com: could not connect to host
chrisopperwall.com: could not connect to host
chrisself.xyz: could not connect to host
+christchurchbouncycastles.co.uk: could not connect to host
christiaandruif.nl: could not connect to host
+christian-fischer.pictures: did not receive HSTS header
christian-krug.website: did not receive HSTS header
christianbro.gq: could not connect to host
christianhoffmann.info: could not connect to host
@@ -3568,7 +3767,6 @@ chua.family: did not receive HSTS header
chuckame.fr: could not connect to host
chulado.com: did not receive HSTS header
chundelac.com: could not connect to host
-chunk.science: could not connect to host
churchlinkpro.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
churchux.co: could not connect to host
churrasqueirafacil.com.br: could not connect to host
@@ -3577,7 +3775,7 @@ cianmawhinney.xyz: could not connect to host
cidadedopoker.com.br: did not receive HSTS header
ciderclub.com: could not connect to host
cidr.ml: could not connect to host
-cienbeaute-lidl.fr: could not connect to host
+cienbeaute-lidl.fr: did not receive HSTS header
cigarblogs.net: could not connect to host
cigarterminal.com: could not connect to host
cigi.site: could not connect to host
@@ -3588,6 +3786,7 @@ cimalando.eu: could not connect to host
cinartelorgu.com: did not receive HSTS header
cinay.pw: could not connect to host
cindey.io: could not connect to host
+cindydudley.com: did not receive HSTS header
cinefilia.tk: could not connect to host
cinelite.club: could not connect to host
cinema5.ru: did not receive HSTS header
@@ -3635,7 +3834,6 @@ clacetandil.com.ar: could not connect to host
clad.cf: could not connect to host
claibornecountytn.gov: could not connect to host
claimit.ml: could not connect to host
-clangwarnings.com: could not connect to host
clanthor.com: did not receive HSTS header
clapping-rhymes.com: could not connect to host
clara-baumert.de: could not connect to host
@@ -3657,14 +3855,15 @@ claudio4.com: did not receive HSTS header
claytoncondon.com: could not connect to host
clcleaningco.com: could not connect to host
cleanbeautymarket.com.au: did not receive HSTS header
-cleancode.club: could not connect to host
cleanexperts.co.uk: could not connect to host
cleaningsquad.ca: did not receive HSTS header
cleanmta.com: could not connect to host
-cleanstar.org: could not connect to host
+cleanstar.org: did not receive HSTS header
clear.ml: could not connect to host
clearc.tk: could not connect to host
clearchatsandbox.com: could not connect to host
+clearer.cloud: could not connect to host
+clearkonjac.com: did not receive HSTS header
clearsky.me: did not receive HSTS header
clearviewwealthprojector.com.au: could not connect to host
clementfevrier.fr: could not connect to host
@@ -3673,10 +3872,8 @@ clerkendweller.uk: could not connect to host
clevelandokla.com: could not connect to host
clic-music.com: could not connect to host
click-2-order.co.uk: did not receive HSTS header
-click2order.co.uk: did not receive HSTS header
clickandgo.com: did not receive HSTS header
clickandshoot.nl: could not connect to host
-clickclickphish.com: did not receive HSTS header
clickforclever.com: did not receive HSTS header
clickgram.biz: could not connect to host
clickomobile.com: did not receive HSTS header
@@ -3686,8 +3883,8 @@ clicn.bio: could not connect to host
clicnbio.com: could not connect to host
cliftons.com: did not receive HSTS header
climaencusco.com: could not connect to host
+clingout.com: could not connect to host
clinia.ca: did not receive HSTS header
-clinicadam.com: did not receive HSTS header
clinicadelogopedia.net: did not receive HSTS header
clinicaferrusbratos.com: did not receive HSTS header
clinicasilos.com: did not receive HSTS header
@@ -3699,10 +3896,11 @@ clintwilson.technology: max-age too low: 2592000
clip.ovh: did not receive HSTS header
clipped4u.com: could not connect to host
clnet.com.au: did not receive HSTS header
+clod-hacking.com: could not connect to host
cloghercastles.co.uk: did not receive HSTS header
clojurescript.ru: could not connect to host
clorik.com: could not connect to host
-closient.com: did not receive HSTS header
+closient.com: could not connect to host
closingholding.com: could not connect to host
cloturea.fr: could not connect to host
cloud-crowd.com.au: did not receive HSTS header
@@ -3713,7 +3911,7 @@ cloud58.org: did not receive HSTS header
cloudalice.com: could not connect to host
cloudalice.net: could not connect to host
cloudapi.vc: could not connect to host
-cloudbased.info: did not receive HSTS header
+cloudbased.info: could not connect to host
cloudbasedsite.com: did not receive HSTS header
cloudberlin.goip.de: could not connect to host
cloudbleed.info: could not connect to host
@@ -3750,6 +3948,7 @@ clowde.in: could not connect to host
clownaroundbouncycastles.co.uk: did not receive HSTS header
clownish.co.il: could not connect to host
clsimplex.com: did not receive HSTS header
+club-duomo.com: could not connect to host
clubcall.com: did not receive HSTS header
clubdeslecteurs.net: could not connect to host
clubmate.rocks: could not connect to host
@@ -3764,18 +3963,18 @@ clycat.ru: could not connect to host
clywedogmaths.co.uk: could not connect to host
cm3.pw: could not connect to host
cmahy.be: did not receive HSTS header
-cmangos.net: did not receive HSTS header
+cmangos.net: could not connect to host
cmc-versand.de: did not receive HSTS header
cmcc.network: could not connect to host
cmci.dk: did not receive HSTS header
cmdtelecom.net.br: did not receive HSTS header
-cmpr.es: could not connect to host
+cmpr.es: did not receive HSTS header
cmrss.com: could not connect to host
cmsbattle.com: could not connect to host
cmscafe.ru: did not receive HSTS header
cmskh.co.uk: could not connect to host
cmso-cal.com: could not connect to host
-cmusical.es: could not connect to host
+cmusical.es: did not receive HSTS header
cmweller.com: could not connect to host
cnam.net: did not receive HSTS header
cnaprograms.online: could not connect to host
@@ -3783,19 +3982,19 @@ cncfraises.fr: did not receive HSTS header
cncmachinemetal.com: did not receive HSTS header
cncn.us: did not receive HSTS header
cnetw.xyz: could not connect to host
-cnitdog.com: could not connect to host
cnlau.com: could not connect to host
cnlic.com: could not connect to host
-cnrd.me: did not receive HSTS header
+cnnet.in: could not connect to host
+cnrd.me: could not connect to host
cnsyear.com: did not receive HSTS header
cnwage.com: could not connect to host
cnwarn.com: could not connect to host
co-driversphoto.se: did not receive HSTS header
co-yutaka.com: could not connect to host
coa.one: could not connect to host
-coach-sportif.paris: did not receive HSTS header
+coach-sportif.paris: could not connect to host
coachingconsultancy.com: did not receive HSTS header
-cobaltlp.com: could not connect to host
+coam.co: could not connect to host
cobcode.com: could not connect to host
cobrax.net: could not connect to host
coccinellaskitchen.com: could not connect to host
@@ -3825,36 +4024,36 @@ codejunkie.de: could not connect to host
codelayer.ca: could not connect to host
codelitmus.com: did not receive HSTS header
codeloop.pw: could not connect to host
-codelove.de: could not connect to host
-codemonkeyrawks.net: did not receive HSTS header
+codelove.de: did not receive HSTS header
+codemonkeyrawks.net: could not connect to host
codemperium.com: could not connect to host
codenlife.xyz: could not connect to host
codeofhonor.tech: could not connect to host
-codeplay.org: could not connect to host
+codeplay.org: did not receive HSTS header
codepoet.de: did not receive HSTS header
codeproxy.ddns.net: could not connect to host
codepx.com: could not connect to host
+codercross.com: could not connect to host
codercy.com: could not connect to host
coderhangout.com: could not connect to host
+coderme.com: could not connect to host
codersatlas.co: could not connect to host
codersatlas.com: could not connect to host
+codersatlas.xyz: could not connect to host
codersbase.org: could not connect to host
codersbistro.com: did not receive HSTS header
codesplain.in: could not connect to host
codestep.io: could not connect to host
-codevat.com: could not connect to host
codewiththepros.org: could not connect to host
codewiz.xyz: could not connect to host
-codymoniz.com: could not connect to host
coecrafters.com: could not connect to host
coffeedino.com: did not receive HSTS header
coffeeetc.co.uk: could not connect to host
coffeestrategies.com: max-age too low: 5184000
-coffeetocode.me: did not receive HSTS header
cogniflex.com: could not connect to host
cognixia.com: did not receive HSTS header
cogumelosmagicos.org: could not connect to host
-cohesive.io: did not receive HSTS header
+cohesive.io: could not connect to host
coin-exchange.cz: could not connect to host
coincoele.com.br: could not connect to host
coindam.com: could not connect to host
@@ -3862,18 +4061,17 @@ coindatabase.net: could not connect to host
coinessa.com: could not connect to host
coinjar-sandbox.com: could not connect to host
colarelli.ch: could not connect to host
-colasjourdain.fr: could not connect to host
coldaddy.com: could not connect to host
coldlostsick.net: did not receive HSTS header
coldwatericecream.com: did not receive HSTS header
colearnr.com: could not connect to host
-colegiocierp.com.br: could not connect to host
-colincampbell.me: could not connect to host
-colinchartier.com: could not connect to host
-collablynk.com: could not connect to host
+colegiocierp.com.br: did not receive HSTS header
+colincampbell.me: did not receive HSTS header
+collablynk.com: did not receive HSTS header
collabra.email: did not receive HSTS header
collard.tk: could not connect to host
collbox.co: did not receive HSTS header
+collectivesupply.com: could not connect to host
collectosaurus.com: could not connect to host
colleencornez.com: could not connect to host
collegepaperworld.com: could not connect to host
@@ -3885,22 +4083,24 @@ collins.press: could not connect to host
collinsartworks.com: did not receive HSTS header
collision.fyi: could not connect to host
colmexpro.com: did not receive HSTS header
-colo-tech.com: could not connect to host
colognegaming.net: could not connect to host
+coloppe.com: could not connect to host
coloradocomputernetworking.net: could not connect to host
colorcentertoner.com.br: did not receive HSTS header
coloringnotebook.com: did not receive HSTS header
colorlib.com: did not receive HSTS header
colorunhas.com.br: did not receive HSTS header
+colpatriaws.azurewebsites.net: did not receive HSTS header
+coltonrb.com: could not connect to host
com-news.io: could not connect to host
com.cc: could not connect to host
combatshield.cz: did not receive HSTS header
comchezmeme.com: could not connect to host
+comdotgame.com: could not connect to host
comeoncolleen.com: did not receive HSTS header
comercialtrading.eu: could not connect to host
cometbot.cf: could not connect to host
cometrueunlimited.com: could not connect to host
-comff.net: could not connect to host
comfortdom.ua: did not receive HSTS header
comfortticket.de: did not receive HSTS header
comfy.cafe: could not connect to host
@@ -3920,7 +4120,9 @@ commune-preuilly.fr: did not receive HSTS header
community-cupboard.org: did not receive HSTS header
comocurarlashemorroides.org: did not receive HSTS header
comocurarlashemorroidesya.com: did not receive HSTS header
+comodormirmasrapido.com: did not receive HSTS header
comoeliminarlaspapulasperladasenelglande.com: did not receive HSTS header
+comopuededejardefumar.net: did not receive HSTS header
comorecuperaratumujerpdf.com: could not connect to host
comosatisfaceraunhombreenlacamaydejarloloco.com: did not receive HSTS header
comotalk.com: could not connect to host
@@ -3951,7 +4153,7 @@ compusolve.nl: could not connect to host
computercraft.net: could not connect to host
computertal.de: could not connect to host
comssa.org.au: did not receive HSTS header
-comw.cc: could not connect to host
+comtily.com: could not connect to host
comyuno.com: did not receive HSTS header
concentrade.de: did not receive HSTS header
conceptatelier.de: could not connect to host
@@ -3961,7 +4163,7 @@ conclave.global: could not connect to host
conclinica.com.br: did not receive HSTS header
concord-group.co.jp: did not receive HSTS header
conectalmeria.com: did not receive HSTS header
-conference.dnsfor.me: could not connect to host
+conectar.ru: did not receive HSTS header
confidential.network: could not connect to host
confirm365.com: could not connect to host
conflux.tw: did not receive HSTS header
@@ -3982,7 +4184,7 @@ connected-verhuurservice.nl: did not receive HSTS header
connectfss.com: could not connect to host
connectingconcepts.com: could not connect to host
conniesacademy.com: could not connect to host
-connorsmith.co: could not connect to host
+connorsmith.co: did not receive HSTS header
conocimientosdigitales.com: could not connect to host
conrad.am: could not connect to host
consciousandglamorous.com: could not connect to host
@@ -3994,13 +4196,12 @@ conseil-gli.fr: did not receive HSTS header
consejosdehogar.com: did not receive HSTS header
console.python.org: did not receive HSTS header
console.support: did not receive HSTS header
-construct-trust.com: could not connect to host
-constructexpres.ro: could not connect to host
+construct-trust.com: did not receive HSTS header
+consultanta-in-afaceri.ro: max-age too low: 0
consultcelerity.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
consultingroupitaly.com: did not receive HSTS header
consultorcr.net: did not receive HSTS header
consumer.gov: did not receive HSTS header
-consumersentinel.gov: could not connect to host
consumidor.gov: did not receive HSTS header
contactbig.com: did not receive HSTS header
contaimo.com: did not receive HSTS header
@@ -4012,19 +4213,23 @@ contentdesign.de: did not receive HSTS header
contents.ga: did not receive HSTS header
continuation.io: could not connect to host
continuumgaming.com: could not connect to host
-contractdigital.co.uk: did not receive HSTS header
contraout.com: could not connect to host
+controlarlaansiedad.com: did not receive HSTS header
controlcenter.gigahost.dk: did not receive HSTS header
contxt-agentur.de: did not receive HSTS header
convergemagazine.com: did not receive HSTS header
+convergence.fi: could not connect to host
conversionsciences.com: did not receive HSTS header
convert.zone: could not connect to host
converter.ml: could not connect to host
-convertimg.com: could not connect to host
+convertimg.com: did not receive HSTS header
convoitises.com: did not receive HSTS header
cooink.net: could not connect to host
cookiestudies.cf: could not connect to host
cookingbazart.com: did not receive HSTS header
+cooksbookscorks.com: did not receive HSTS header
+cool110.tk: did not receive HSTS header
+cool110.xyz: did not receive HSTS header
coolaj86.com: did not receive HSTS header
coolbutbroken.com: did not receive HSTS header
coolchevy.org.ua: did not receive HSTS header
@@ -4032,17 +4237,19 @@ coole-meister.de: could not connect to host
cooljs.me: could not connect to host
coolkidsbouncycastles.co.uk: did not receive HSTS header
coolrc.me: did not receive HSTS header
-cooltang.ooo: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
coolviewthermostat.com: did not receive HSTS header
coolvox.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+coolwallet.io: did not receive HSTS header
coonelnel.net: did not receive HSTS header
-cooperativehandmade.com: did not receive HSTS header
+coopens.com: could not connect to host
cooperativehandmade.pe: did not receive HSTS header
-cooxa.com: did not receive HSTS header
+coor.fun: could not connect to host
+cooxa.com: could not connect to host
copperhead.co: did not receive HSTS header
copshop.com.br: could not connect to host
coptic-treasures.com: max-age too low: 2592000
-copycaught.com: could not connect to host
+copycaught.co: could not connect to host
+copycaught.xyz: could not connect to host
copytrack.com: did not receive HSTS header
cor-ser.es: could not connect to host
coralproject.net: did not receive HSTS header
@@ -4050,11 +4257,11 @@ coralrosado.com.br: did not receive HSTS header
coramcdaniel.com: could not connect to host
corbinhesse.com: did not receive HSTS header
corderoscleaning.com: did not receive HSTS header
-cordeydesign.ch: could not connect to host
cordial-restaurant.com: did not receive HSTS header
core4system.de: could not connect to host
coreapm.com: could not connect to host
corecdn.org: could not connect to host
+coredump.gr: did not receive HSTS header
coreinfrastructure.org: did not receive HSTS header
corenetworking.de: could not connect to host
coresos.com: could not connect to host
@@ -4072,13 +4279,15 @@ corozanu.ro: did not receive HSTS header
corpoatletico.com.br: could not connect to host
corporateencryption.com: could not connect to host
corporatesubscriptions.com.au: did not receive HSTS header
+corporativoarval.info: did not receive HSTS header
corpsepaint.life: could not connect to host
-correct.horse: did not receive HSTS header
+correct.horse: could not connect to host
correctpaardbatterijnietje.nl: did not receive HSTS header
correiodovale.com.br: did not receive HSTS header
corruption-mc.net: could not connect to host
corruption-rsps.net: could not connect to host
corruption-server.net: could not connect to host
+coslinker.com: could not connect to host
cosmeticosdelivery.com.br: could not connect to host
cosmeticosnet.com.br: did not receive HSTS header
cosmiatria.pe: could not connect to host
@@ -4097,7 +4306,6 @@ coughlan.de: did not receive HSTS header
counselling.network: could not connect to host
counsellingtime.co.uk: could not connect to host
count.sh: could not connect to host
-countryoutlaws.ca: did not receive HSTS header
coup-dun-soir.ch: could not connect to host
couponcodeq.com: could not connect to host
couragewhispers.ca: could not connect to host
@@ -4113,21 +4321,24 @@ covenantbank.net: could not connect to host
covenantmatrix.com: did not receive HSTS header
coverdat.com: could not connect to host
coverduck.ru: could not connect to host
-coworkingmanifesto.com: did not receive HSTS header
+cowo.group: did not receive HSTS header
+coworkingmanifesto.com: could not connect to host
+coxxs.moe: could not connect to host
cozitop.com.br: could not connect to host
cozmaadrian.ro: could not connect to host
cozy.io: did not receive HSTS header
cozycloud.cc: did not receive HSTS header
-cpahunt.com: did not receive HSTS header
cpaneltips.com: could not connect to host
-cpbanq.com: could not connect to host
-cpgarmor.com: did not receive HSTS header
+cplala.com: could not connect to host
+cptoon.com: could not connect to host
cpuvinf.eu.org: could not connect to host
cqchome.com: did not receive HSTS header
+crackers4cheese.com: could not connect to host
cracking.org: did not receive HSTS header
-crackingking.com: did not receive HSTS header
+crackingking.com: could not connect to host
crackpfer.de: could not connect to host
craftbeerbarn.co.uk: could not connect to host
+craftcommerce.com: did not receive HSTS header
craftedge.xyz: could not connect to host
craftination.net: could not connect to host
craftmain.eu: could not connect to host
@@ -4142,12 +4353,12 @@ cranioschule.com: did not receive HSTS header
crashsec.com: did not receive HSTS header
crate.io: did not receive HSTS header
cravelyrics.com: could not connect to host
+crawcial.de: could not connect to host
crazifyngers.com: could not connect to host
crazy-crawler.de: did not receive HSTS header
crazycen.com: could not connect to host
crazycraftland.de: could not connect to host
-crazycraftland.net: did not receive HSTS header
-crazyfamily11.de: did not receive HSTS header
+crazyfamily11.de: could not connect to host
crazyhotseeds.com: did not receive HSTS header
crazyker.com: could not connect to host
crbug.com: did not receive HSTS header (error ignored - included regardless)
@@ -4157,28 +4368,30 @@ creamybuild.com: could not connect to host
create-ls.jp: could not connect to host
create-test-publish.co.uk: could not connect to host
create-together.nl: did not receive HSTS header
+createcos.com: could not connect to host
creations-edita.com: could not connect to host
creativeapple.ltd: did not receive HSTS header
creativeartifice.com: did not receive HSTS header
creativecommons.cl: did not receive HSTS header
creativecommonscatpictures.com: could not connect to host
+creativeground.com.au: did not receive HSTS header
creativephysics.ml: could not connect to host
creativeplayuk.com: did not receive HSTS header
creativlabor.ch: did not receive HSTS header
creato.top: could not connect to host
creators.co: could not connect to host
-crecips.com: could not connect to host
crecket.me: could not connect to host
credia.jp: did not receive HSTS header
creditclear.com.au: did not receive HSTS header
creditreporttips.net: could not connect to host
creepycraft.nl: could not connect to host
+crena.ch: could not connect to host
crendontech.com: did not receive HSTS header
creorin.com: did not receive HSTS header
+crescent.gr.jp: did not receive HSTS header
crestoncottage.com: could not connect to host
crewplanner.eu: did not receive HSTS header
-crge.eu: could not connect to host
-crgm.net: could not connect to host
+crge.eu: did not receive HSTS header
criadorespet.com.br: could not connect to host
crickey.eu: could not connect to host
crimewatch.net.za: could not connect to host
@@ -4189,7 +4402,6 @@ cristiandeluxe.com: did not receive HSTS header
cristianhares.com: could not connect to host
critcola.com: could not connect to host
criticalaim.com: could not connect to host
-crizk.com: could not connect to host
crl-autos.com: could not connect to host
crmdemo.website: could not connect to host
croceverdevb.it: did not receive HSTS header
@@ -4197,13 +4409,13 @@ crockett.io: did not receive HSTS header
croco.vision: did not receive HSTS header
croeder.net: could not connect to host
croisieres.discount: did not receive HSTS header
+cromosomax.com: could not connect to host
cronberg.ch: could not connect to host
croods-mt2.fr: did not receive HSTS header
croome.no-ip.org: could not connect to host
crop-alert.com: could not connect to host
croquette.net: did not receive HSTS header
crosbug.com: did not receive HSTS header (error ignored - included regardless)
-cross-x.com: could not connect to host
crosspeakoms.com: did not receive HSTS header
crosssec.com: did not receive HSTS header
crowdcurity.com: did not receive HSTS header
@@ -4217,13 +4429,14 @@ crt.sh: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAI
crtvmgmt.com: could not connect to host
crudysql.com: could not connect to host
crufad.org: did not receive HSTS header
-cruikshank.com.au: did not receive HSTS header
+cruikshank.com.au: could not connect to host
crushroom.com: max-age too low: 43200
cruzadobalcazarabogados.com: could not connect to host
cruzeiropedia.org: did not receive HSTS header
cruzr.xyz: could not connect to host
crypalert.com: did not receive HSTS header
crypt.guru: did not receive HSTS header
+crypticshell.co.uk: did not receive HSTS header
cryptify.eu: could not connect to host
crypto-navi.org: did not receive HSTS header
crypto.tube: max-age too low: 2592000
@@ -4232,13 +4445,10 @@ cryptobin.org: could not connect to host
cryptocaseproject.com: could not connect to host
cryptodash.net: could not connect to host
cryptodyno.ninja: could not connect to host
-cryptoegg.ca: could not connect to host
-cryptofrog.co: could not connect to host
cryptojar.io: could not connect to host
cryptolab.pro: could not connect to host
cryptolab.tk: could not connect to host
cryptolosophy.io: did not receive HSTS header
-cryptonom.org: could not connect to host
cryptoparty.dk: could not connect to host
cryptopartyatx.org: could not connect to host
cryptopartynewcastle.org: could not connect to host
@@ -4284,9 +4494,10 @@ ct-status.org: could not connect to host
ct-watches.dk: did not receive HSTS header
cthomas.work: could not connect to host
cthulhuden.com: could not connect to host
+ctknight.me: could not connect to host
ctyi.me: could not connect to host
cuanhua3s.com: could not connect to host
-cubecart.net: did not receive HSTS header
+cubecart.net: could not connect to host
cubecraftstore.com: could not connect to host
cubecraftstore.net: could not connect to host
cubela.tech: could not connect to host
@@ -4295,22 +4506,24 @@ cubewano.com: could not connect to host
cubix.host: could not connect to host
cucc.date: could not connect to host
cuecamania.com.br: could not connect to host
+cuisinezest.com: did not receive HSTS header
cujanovic.com: did not receive HSTS header
cujba.com: could not connect to host
culinae.nl: could not connect to host
cultureelbeleggen.nl: did not receive HSTS header
cultureroll.com: could not connect to host
-cumshots-video.ru: could not connect to host
+cumshots-video.ru: did not receive HSTS header
cunha.be: could not connect to host
cuni-cuni-club.com: did not receive HSTS header
cuni-rec.com: did not receive HSTS header
-cuntflaps.me: could not connect to host
cuongquach.com: did not receive HSTS header
cuongthach.com: did not receive HSTS header
cuonic.com: could not connect to host
cupcake.io: did not receive HSTS header
cupcake.is: did not receive HSTS header
+cupcakesandcrinoline.com: did not receive HSTS header
cupi.co: could not connect to host
+cupidosshop.com: could not connect to host
cupofarchitects.net: could not connect to host
curacao-license.com: could not connect to host
curarnosensalud.com: could not connect to host
@@ -4318,15 +4531,16 @@ curia.fi: could not connect to host
curiouscat.me: max-age too low: 2592000
curlyroots.com: did not receive HSTS header
current.com: did not receive HSTS header
+currentobserver.com: could not connect to host
curroapp.com: could not connect to host
cursosdnc.cl: did not receive HSTS header
cursosgratuitos.com.br: did not receive HSTS header
+curvesandwords.com: did not receive HSTS header
curveweb.co.uk: did not receive HSTS header
cusfit.com: did not receive HSTS header
custe.rs: could not connect to host
custerweb.com: did not receive HSTS header
customadesign.com: did not receive HSTS header
-custombikes.cl: could not connect to host
customd.com: did not receive HSTS header
customfilmworks.com: could not connect to host
customizeyourshower.com: could not connect to host
@@ -4345,8 +4559,9 @@ cvninja.pl: did not receive HSTS header
cvps.top: did not receive HSTS header
cvsoftub.com: did not receive HSTS header
cvtparking.co.uk: did not receive HSTS header
+cvursache.com: could not connect to host
cw-bw.de: could not connect to host
-cwage.com: could not connect to host
+cwage.com: did not receive HSTS header
cwbw.network: could not connect to host
cwilson.ga: could not connect to host
cy.technology: did not receive HSTS header
@@ -4357,9 +4572,9 @@ cyber-konzept.de: did not receive HSTS header
cyber-perikarp.eu: could not connect to host
cyber.cafe: could not connect to host
cybercecurity.com: did not receive HSTS header
-cybercymru.co.uk: did not receive HSTS header
+cybercloud.cc: did not receive HSTS header
cyberdos.de: could not connect to host
-cyberdyne-industries.net: did not receive HSTS header
+cyberdyne-industries.net: could not connect to host
cyberfrancais.ro: did not receive HSTS header
cyberlab.kiev.ua: could not connect to host
cyberlab.team: did not receive HSTS header
@@ -4367,11 +4582,13 @@ cyberpeace.nl: could not connect to host
cyberphaze.com: did not receive HSTS header
cyberprey.com: did not receive HSTS header
cyberpunk.ca: could not connect to host
+cybersantri.com: could not connect to host
cyberserver.org: could not connect to host
cybershambles.com: could not connect to host
cybersmart.co.uk: did not receive HSTS header
cyberspace.today: could not connect to host
-cyberxpert.nl: could not connect to host
+cybertorsk.org: could not connect to host
+cybrary.it: did not receive HSTS header
cyclehackluxembourgcity.lu: could not connect to host
cyclingjunkies.com: could not connect to host
cydia-search.io: could not connect to host
@@ -4380,10 +4597,12 @@ cygu.ch: did not receive HSTS header
cymtech.net: could not connect to host
cynoshair.com: could not connect to host
cyoda.com: did not receive HSTS header
-cypad.cn: did not receive HSTS header
+cypad.cn: could not connect to host
cype.dedyn.io: could not connect to host
+cypherpunk.com: did not receive HSTS header
cypherpunk.ws: could not connect to host
cyphertite.com: could not connect to host
+cyson.tech: could not connect to host
cytadel.fr: did not receive HSTS header
czaw.org: did not receive HSTS header
czechamlp.com: could not connect to host
@@ -4391,7 +4610,8 @@ czirnich.org: did not receive HSTS header
czlx.co: could not connect to host
d-academia.com: did not receive HSTS header
d-garnier-delaunay.fr: did not receive HSTS header
-d-macindustries.com: did not receive HSTS header
+d-msg.com: could not connect to host
+d-quantum.com: did not receive HSTS header
d-rickroll-e.pw: could not connect to host
d.rip: max-age too low: 900
d00r.de: did not receive HSTS header
@@ -4401,7 +4621,7 @@ d2s.uk: could not connect to host
d3njjcbhbojbot.cloudfront.net: did not receive HSTS header
d3x.pw: could not connect to host
d4rkdeagle.tk: could not connect to host
-d88688.com: did not receive HSTS header
+d4wson.com: could not connect to host
d88871.com: could not connect to host
d8studio.net: could not connect to host
da-ist-kunst.de: could not connect to host
@@ -4413,6 +4633,7 @@ dad256.tk: could not connect to host
dadtheimpaler.com: could not connect to host
daemon.xin: could not connect to host
daemonslayer.net: did not receive HSTS header
+dafnik.me: did not receive HSTS header
dah5.com: did not receive HSTS header
dahl-pind.dk: did not receive HSTS header
dai-rin.co.jp: could not connect to host
@@ -4433,12 +4654,12 @@ dalingk.co: could not connect to host
dallas.gov: could not connect to host
daltonedwards.me: could not connect to host
dam74.com.ar: could not connect to host
-damedrogy.cz: could not connect to host
damianuv-blog.cz: could not connect to host
damienpontifex.com: did not receive HSTS header
damjanovic.work: could not connect to host
+damongant.de: did not receive HSTS header
dan.org.nz: could not connect to host
-danbarrett.com.au: could not connect to host
+danbarrett.com.au: did not receive HSTS header
dancebuzz.co.uk: did not receive HSTS header
dancerdates.net: did not receive HSTS header
dandymrsb.com: could not connect to host
@@ -4455,26 +4676,26 @@ danieliancu.com: could not connect to host
danieljireh.com: did not receive HSTS header
danielkratz.com: max-age too low: 172800
danielt.co.uk: did not receive HSTS header
-danielthompson.info: could not connect to host
danielverlaan.nl: could not connect to host
danielworthy.com: did not receive HSTS header
danielzuzevich.com: could not connect to host
+danifabi.eu: could not connect to host
danijobs.com: could not connect to host
danishenanigans.com: could not connect to host
dankeblog.com: could not connect to host
dankredues.com: could not connect to host
danmark.guide: did not receive HSTS header
dannycrichton.com: did not receive HSTS header
-danonsecurity.com: did not receive HSTS header
danova.de: did not receive HSTS header
danoz.net: could not connect to host
danrl.de: could not connect to host
danskringsporta.be: did not receive HSTS header
danwillenberg.com: did not receive HSTS header
+dao.spb.su: could not connect to host
daolerp.xyz: could not connect to host
+daplie.com: could not connect to host
dargasia.is: could not connect to host
darinjohnson.ca: did not receive HSTS header
-darinkotter.com: could not connect to host
dario.im: did not receive HSTS header
dark-x.cf: could not connect to host
darkanzali.pl: max-age too low: 0
@@ -4486,16 +4707,18 @@ darkkeepers.dk: max-age too low: 172800
darknebula.space: could not connect to host
darknode.in: did not receive HSTS header
darkpony.ru: could not connect to host
+darkroomsaredead.com: could not connect to host
darksideof.it: could not connect to host
darkstance.org: could not connect to host
darktree.in: could not connect to host
darkwebkittens.xyz: could not connect to host
darlastudio66.com: did not receive HSTS header
-darlo.co.uk: could not connect to host
darrenellis.xyz: could not connect to host
darrenm.net: could not connect to host
dart-tanke.com: could not connect to host
dart-tanke.de: could not connect to host
+dartsdon.jp: did not receive HSTS header
+daryl.moe: could not connect to host
das-tyrol.at: did not receive HSTS header
dash-board.jp: did not receive HSTS header
dash.rocks: did not receive HSTS header
@@ -4508,20 +4731,18 @@ data-abundance.com: could not connect to host
data-detox.com: could not connect to host
data.haus: could not connect to host
data.qld.gov.au: did not receive HSTS header
-data.world: did not receive HSTS header
databeam.de: could not connect to host
datacave.is: could not connect to host
datacenternews.asia: did not receive HSTS header
datacenternews.co.nz: did not receive HSTS header
datacentrenews.eu: did not receive HSTS header
datacubed.com: did not receive HSTS header
-datadit.hu: could not connect to host
datahoarder.download: could not connect to host
+datahoarder.xyz: could not connect to host
datahoarderschool.club: could not connect to host
dataisme.com: did not receive HSTS header
datajapan.co.jp: did not receive HSTS header
datamatic.ru: could not connect to host
-datapun.ch: did not receive HSTS header
dataretention.solutions: could not connect to host
datascomemorativas.com.br: could not connect to host
datasharesystem.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -4555,9 +4776,10 @@ davidscherzer.at: could not connect to host
davimun.org: could not connect to host
davros.eu: could not connect to host
davros.ru: could not connect to host
+dawgs.ga: could not connect to host
dawnofeden.org: did not receive HSTS header
dawnson.is: could not connect to host
-dawnsonb.com: could not connect to host
+dawnsonb.com: did not receive HSTS header
day-peak.com: did not receive HSTS header
day.vip: could not connect to host
daylightcompany.com: did not receive HSTS header
@@ -4572,11 +4794,10 @@ dbpmedia.se: did not receive HSTS header
dbx.ovh: could not connect to host
dbyz.co.uk: max-age too low: 43200
dcaracing.nl: could not connect to host
-dcc.moe: could not connect to host
+dcc.cat: did not receive HSTS header
dccode.gov: could not connect to host
dccoffeeproducts.com: did not receive HSTS header
dccraft.net: could not connect to host
-dcl.re: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
dctxf.com: did not receive HSTS header
dcuofriends.net: could not connect to host
dd.art.pl: could not connect to host
@@ -4596,7 +4817,6 @@ deai-life.biz: could not connect to host
debank.tv: did not receive HSTS header
debatch.se: could not connect to host
debian-vhost.de: could not connect to host
-debigare.com: did not receive HSTS header
debiton.dk: could not connect to host
debitoutil.com: did not receive HSTS header
debitpaie.com: did not receive HSTS header
@@ -4619,19 +4839,20 @@ decoraid.com: did not receive HSTS header
decorincasa.com.br: could not connect to host
decorland.com.ua: could not connect to host
decormiernissanparts.com: could not connect to host
-decoyrouting.com: could not connect to host
+decoyrouting.com: did not receive HSTS header
decstasy.de: did not receive HSTS header
dede.ml: could not connect to host
-dedeo.tk: did not receive HSTS header
+dedeo.tk: could not connect to host
dedicatutiempo.es: could not connect to host
-dedietrich-asia.com: did not receive HSTS header
+dedietrich-asia.com: could not connect to host
deeonix.eu: could not connect to host
-deep.club: could not connect to host
-deep.social: could not connect to host
+deep.social: did not receive HSTS header
deepaero.com: could not connect to host
deepcovelabs.net: could not connect to host
deepcreampie.com: could not connect to host
deepearth.uk: could not connect to host
+deeperxh.com: did not receive HSTS header
+deeployr.io: could not connect to host
deeprecce.com: could not connect to host
deeprecce.link: could not connect to host
deeprecce.tech: could not connect to host
@@ -4642,17 +4863,20 @@ deer.team: could not connect to host
deetz.nl: did not receive HSTS header
deetzen.de: did not receive HSTS header
deezeno.com: could not connect to host
-defi-metier.com: could not connect to host
-defi-metier.fr: could not connect to host
+defi-metier.com: did not receive HSTS header
+defi-metier.fr: did not receive HSTS header
defi-metier.org: could not connect to host
-defi-metiers.com: could not connect to host
+defi-metiers.com: did not receive HSTS header
defi-metiers.fr: did not receive HSTS header
-defi-metiers.org: could not connect to host
+defi-metiers.org: did not receive HSTS header
defiler.tk: could not connect to host
defimetier.fr: could not connect to host
-defimetier.org: could not connect to host
-defimetiers.com: could not connect to host
-defimetiers.fr: could not connect to host
+defimetier.org: did not receive HSTS header
+defimetiers.com: did not receive HSTS header
+defimetiers.fr: did not receive HSTS header
+defrax.de: did not receive HSTS header
+degestamptepot.nl: did not receive HSTS header
+degosoft.nl: did not receive HSTS header
degroetenvanrosaline.nl: could not connect to host
dehydrated.de: did not receive HSTS header
deight.co: could not connect to host
@@ -4665,6 +4889,7 @@ deliberatedigital.com: [Exception... "Component returned failure code: 0x8000400
delitto.top: could not connect to host
deliver.moe: did not receive HSTS header
deliverance.co.uk: could not connect to host
+delivery.co.at: could not connect to host
deloittequant.com: could not connect to host
deltaconcepts.de: could not connect to host
deltasmart.ch: did not receive HSTS header
@@ -4675,10 +4900,14 @@ demdis.org: could not connect to host
demilitarized.ninja: could not connect to host
demo-server.us: could not connect to host
demo.sb: could not connect to host
+demo.swedbank.se: did not receive HSTS header
democracy.io: did not receive HSTS header
democraticdifference.com: could not connect to host
demotops.com: could not connect to host
+demuzere.com: could not connect to host
demuzere.eu: could not connect to host
+demuzere.net: could not connect to host
+demuzere.org: could not connect to host
dengchangdong.com: did not receive HSTS header
denh.am: did not receive HSTS header
denimio.com: did not receive HSTS header
@@ -4693,14 +4922,11 @@ denverphilharmonic.org: did not receive HSTS header
denverprophit.us: did not receive HSTS header
deped.blog: could not connect to host
depedshs.com: could not connect to host
-depedtayo.com: did not receive HSTS header
-depedtayo.ph: did not receive HSTS header
depijl-mz.nl: did not receive HSTS header
depixion.agency: could not connect to host
depo.space: could not connect to host
deprobe.pro: could not connect to host
dequehablamos.es: could not connect to host
-der-bank-blog.de: did not receive HSTS header
derbyshiredotnet.co.uk: did not receive HSTS header
derchris.me: could not connect to host
derevtsov.com: did not receive HSTS header
@@ -4709,12 +4935,14 @@ derive.cc: could not connect to host
dermacarecomplex.com: could not connect to host
derpumpkinfuhrer.com: could not connect to host
derrickemery.com: did not receive HSTS header
+dersix.com: could not connect to host
derwaldschrat.net: did not receive HSTS header
derwolfe.net: did not receive HSTS header
desiccantpackets.com: did not receive HSTS header
design-fu.com: did not receive HSTS header
designandmore.it: did not receive HSTS header
designanyware.com.br: could not connect to host
+designdevs.eu: did not receive HSTS header
designgears.com: could not connect to host
designgraphic.fr: did not receive HSTS header
designsbykerrialee.co.uk: could not connect to host
@@ -4724,10 +4952,11 @@ despachomartinyasociados.com: could not connect to host
despora.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
despotika.de: could not connect to host
desserteagleselvenar.tk: could not connect to host
+destileria.net.br: could not connect to host
destinationbijoux.fr: could not connect to host
destinopiriapolis.com: did not receive HSTS header
destom.be: could not connect to host
-desuperheroes.co: could not connect to host
+desuperheroes.co: did not receive HSTS header
desveja.com.br: could not connect to host
detechnologiecooperatie.nl: did not receive HSTS header
detecte-fuite.ch: could not connect to host
@@ -4753,7 +4982,6 @@ dev-bluep.pantheonsite.io: did not receive HSTS header
dev-talk.eu: could not connect to host
dev-talk.net: could not connect to host
devafterdark.com: could not connect to host
-devcu.net: could not connect to host
devdesco.com: could not connect to host
devdom.io: max-age too low: 172800
devdoodle.net: could not connect to host
@@ -4761,7 +4989,7 @@ develop.fitness: could not connect to host
developersclub.website: could not connect to host
devenney.io: did not receive HSTS header
devh.de: could not connect to host
-deviltracks.net: did not receive HSTS header
+deviltracks.net: could not connect to host
deviltraxxx.de: could not connect to host
devin-balimuhac.de: did not receive HSTS header
devincrow.me: could not connect to host
@@ -4778,20 +5006,24 @@ devopps.me: could not connect to host
devops.moe: could not connect to host
devopsconnected.com: could not connect to host
devpgsv.com: did not receive HSTS header
+devries.one: could not connect to host
+devstaff.gr: could not connect to host
devtestfan1.gov: could not connect to host
devtub.com: could not connect to host
devuan.org: did not receive HSTS header
+devyn.ca: could not connect to host
dewebwerf.nl: did not receive HSTS header
dewin.io: could not connect to host
dexonsoftware.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+dezintranet.com: max-age too low: 1
dfixit.com: could not connect to host
dfrance.com.br: did not receive HSTS header
dfviana.com.br: max-age too low: 2592000
dgby.org: did not receive HSTS header
dggwp.de: did not receive HSTS header
-dgx.io: could not connect to host
dharamkot.com: could not connect to host
dharma.ai: did not receive HSTS header
+dhbr.org: could not connect to host
dhl-smart.ch: could not connect to host
dhlcotizadorexpo-qa.azurewebsites.net: could not connect to host
dhpcs.com: did not receive HSTS header
@@ -4800,6 +5032,7 @@ dhub.xyz: could not connect to host
dhxxls.com: could not connect to host
diablotine.rocks: could not connect to host
diabolic.chat: could not connect to host
+diadorafitness.es: could not connect to host
diagnocentro.cl: could not connect to host
diagnosia.com: did not receive HSTS header
diagonale-deco.fr: did not receive HSTS header
@@ -4812,25 +5045,23 @@ dianlujitao.com: did not receive HSTS header
diannaobos.com: did not receive HSTS header
diasp.cz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
diavo.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-dicando.com: could not connect to host
+dicando.com: did not receive HSTS header
diceduels.com: could not connect to host
dicgaming.net: could not connect to host
dichgans-besserer.de: did not receive HSTS header
dichvudangkygiayphep.com: could not connect to host
dicio.com.br: did not receive HSTS header
dick.red: could not connect to host
-didierlaumen.be: did not receive HSTS header
+didierlaumen.be: could not connect to host
die-besten-weisheiten.de: could not connect to host
-die-gruenen-teufel.de: could not connect to host
dieb.photo: could not connect to host
diebestengutscheine.de: did not receive HSTS header
diejanssens.net: did not receive HSTS header
-diemogebhardt.com: did not receive HSTS header
+diemogebhardt.com: could not connect to host
dierencompleet.nl: did not receive HSTS header
dierenkruiden.nl: did not receive HSTS header
dieser.me: could not connect to host
dietagespresse.com: did not receive HSTS header
-dietergreven.de: did not receive HSTS header
diewebstube.de: could not connect to host
diezel.com: could not connect to host
diferenca.com: did not receive HSTS header
@@ -4840,6 +5071,7 @@ digihyp.ch: did not receive HSTS header
digikol.net: could not connect to host
digimomedia.co.uk: did not receive HSTS header
diginota.com: did not receive HSTS header
+digipitch.com: did not receive HSTS header
digired.ro: could not connect to host
digired.xyz: could not connect to host
digital1world.com: could not connect to host
@@ -4875,6 +5107,7 @@ dimitrisotiropoulosbooks.com: max-age too low: 7889238
din-tools.com: did not receive HSTS header
dinamoelektrik.com: could not connect to host
dingcc.com: could not connect to host
+dingcc.me: could not connect to host
dingcc.org: could not connect to host
dingcc.xyz: could not connect to host
dinge.xyz: did not receive HSTS header
@@ -4899,10 +5132,11 @@ direnv.net: did not receive HSTS header
direwolfsoftware.ca: could not connect to host
dirips.com: did not receive HSTS header
dirtycat.ru: could not connect to host
+dirtygeek.ovh: did not receive HSTS header
disadattamentolavorativo.it: could not connect to host
discha.net: did not receive HSTS header
-discipul.nl: did not receive HSTS header
-disclosure.io: did not receive HSTS header
+discipul.nl: could not connect to host
+disclosure.io: could not connect to host
disco-crazy-world.de: could not connect to host
discord-chan.net: could not connect to host
discountmania.eu: did not receive HSTS header
@@ -4928,7 +5162,6 @@ distiduffer.org: could not connect to host
distinctivephotography.com.au: could not connect to host
distinguishedwindows.co.uk: did not receive HSTS header
distractionco.de: did not receive HSTS header
-distribuidoraplus.com: did not receive HSTS header
distrilogservices.com: could not connect to host
distro.re: did not receive HSTS header
ditch.ch: could not connect to host
@@ -4937,7 +5170,9 @@ dittvertshus.no: could not connect to host
diva-ey.com: could not connect to host
divegearexpress.com.cn: did not receive HSTS header
divenwa.com: did not receive HSTS header
+divergenz.org: did not receive HSTS header
diversity-spielzeug.de: did not receive HSTS header
+divinemercyparishvlds.com: did not receive HSTS header
divvi.co.nz: did not receive HSTS header
divvymonkey.com: did not receive HSTS header
divvyradio.com: could not connect to host
@@ -4948,7 +5183,8 @@ diz.in.ua: could not connect to host
dizihocasi.com: could not connect to host
dizorg.net: could not connect to host
dj4et.de: could not connect to host
-djieno.com: could not connect to host
+djangogolf.com: could not connect to host
+djieno.com: did not receive HSTS header
djleon.net: did not receive HSTS header
djlive.pl: did not receive HSTS header
djsk.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -4958,6 +5194,7 @@ djxmmx.net: did not receive HSTS header
djz4music.com: did not receive HSTS header
dkn.go.id: could not connect to host
dkniss.de: could not connect to host
+dko-steiermark.ml: could not connect to host
dl.google.com: did not receive HSTS header (error ignored - included regardless)
dlbouncers.co.uk: could not connect to host
dlc.viasinc.com: could not connect to host
@@ -4973,12 +5210,10 @@ dmdre.com: did not receive HSTS header
dmeevalumate.com: did not receive HSTS header
dmenergy.ru: max-age too low: 0
dmfd.net: could not connect to host
-dmix.ca: could not connect to host
dmlogic.com: could not connect to host
dmtry.me: did not receive HSTS header
dmwall.cn: could not connect to host
dmz.ninja: could not connect to host
-dn42.eu: could not connect to host
dndesign.be: did not receive HSTS header
dnfc.rocks: could not connect to host
dnmaze.com: could not connect to host
@@ -4991,12 +5226,10 @@ dnsknowledge.com: did not receive HSTS header
dnsql.io: could not connect to host
dnzz123.com: did not receive HSTS header
do-do.tk: could not connect to host
-do-it.cz: could not connect to host
-do-prod.com: could not connect to host
+do-it.cz: did not receive HSTS header
doak.io: did not receive HSTS header
doanhnhanplus.vn: max-age too low: 0
dobet.in: could not connect to host
-dobrisan.ro: could not connect to host
doc-justice.com: did not receive HSTS header
docid.io: could not connect to host
dockerm.com: could not connect to host
@@ -5004,15 +5237,14 @@ dockerturkiye.com: could not connect to host
docket.news: could not connect to host
doclassworks.com: could not connect to host
doclot.io: could not connect to host
-docplexus.in: did not receive HSTS header
-docplexus.org: did not receive HSTS header
+docplexus.org: max-age too low: 0
docset.io: could not connect to host
-docsoc.org.uk: could not connect to host
docufiel.com: could not connect to host
doculus.io: could not connect to host
documentations-sociales.com: could not connect to host
docupet.com: did not receive HSTS header
docxtemplater.com: did not receive HSTS header
+dodomu.ddns.net: could not connect to host
doesmycodehavebugs.today: could not connect to host
doeswindowssuckforeveryoneorjustme.com: could not connect to host
dogbox.se: did not receive HSTS header
@@ -5028,21 +5260,21 @@ dohosting.ru: could not connect to host
dojifish.space: could not connect to host
dojin.nagoya: could not connect to host
dokan-e.com: did not receive HSTS header
-dokan.online: did not receive HSTS header
+dokan.online: could not connect to host
doked.io: could not connect to host
dokspot.cf: could not connect to host
dokspot.ga: could not connect to host
+doku-gilde.de: could not connect to host
dolarcanadense.com.br: could not connect to host
dolevik.com: could not connect to host
dollarstore24.com: could not connect to host
dollywiki.co.uk: could not connect to host
-dolphin-cloud.com: could not connect to host
-dolphin-hosting.com: could not connect to host
dolphincorp.co.uk: could not connect to host
dolphinswithlasers.com: could not connect to host
-dolt.xyz: did not receive HSTS header
+dolt.xyz: could not connect to host
domaine-aigoual-cevennes.com: did not receive HSTS header
domainelaremejeanne.com: did not receive HSTS header
+domainwatch.me: did not receive HSTS header
domaris.de: did not receive HSTS header
domasazu.pl: did not receive HSTS header
domen-reg.ru: could not connect to host
@@ -5062,7 +5294,6 @@ donlydental.ca: did not receive HSTS header
donmez.uk: could not connect to host
donmez.ws: could not connect to host
donna-bellini-business-fotografie-muenchen.de: did not receive HSTS header
-donotcall.gov: did not receive HSTS header
donotspampls.me: could not connect to host
donotspellitgav.in: did not receive HSTS header
donpaginasweb.com: did not receive HSTS header
@@ -5085,6 +5316,7 @@ doppenpost.nl: could not connect to host
doriginal.es: did not receive HSTS header
dorkfarm.com: did not receive HSTS header
dormebebe.com.br: could not connect to host
+dosenbierrepublik.com: could not connect to host
dosipe.com: could not connect to host
doska.kz: could not connect to host
dostavkakurierom.ru: could not connect to host
@@ -5112,7 +5344,6 @@ downsouthweddings.com.au: did not receive HSTS header
doxcelerate.com: could not connect to host
doyoulyft.com: could not connect to host
dpangerl.de: did not receive HSTS header
-dps.srl: could not connect to host
dpsart.it: could not connect to host
drabben.be: did not receive HSTS header
drabbin.com: could not connect to host
@@ -5121,7 +5352,6 @@ draghive.net: could not connect to host
draghive.org: could not connect to host
draghive.photos: did not receive HSTS header
dragon-aspect.com: could not connect to host
-dragoncave.me: could not connect to host
dragoncityhack.tips: could not connect to host
dragonisles.net: could not connect to host
dragons-of-highlands.cz: did not receive HSTS header
@@ -5135,7 +5365,7 @@ drakfot.se: could not connect to host
dralexjimenez.com: did not receive HSTS header
drastosasports.com.br: could not connect to host
drbarnabus.com: could not connect to host
-drbethanybarnes.com: could not connect to host
+drbethanybarnes.com: did not receive HSTS header
drdavidgilpin.com: did not receive HSTS header
drdevil.ru: could not connect to host
drdim.ru: could not connect to host
@@ -5145,15 +5375,21 @@ dreamaholic.club: could not connect to host
dreamcatcherblog.de: could not connect to host
dreamersgiftshopec.com: could not connect to host
dreaming.solutions: could not connect to host
+dreamithost.com.au: did not receive HSTS header
+dreamkitchenbath.com: did not receive HSTS header
dreamlighteyeserum.com: could not connect to host
dreamsforabetterworld.com.au: did not receive HSTS header
+dreamstream.network: could not connect to host
dreamtechie.com: did not receive HSTS header
dreatho.com: did not receive HSTS header
dreax.win: could not connect to host
dredgepress.com: did not receive HSTS header
dreischneidiger.de: could not connect to host
dreizwosechs.de: could not connect to host
+dresdner-christstollen-von-reimann.de: could not connect to host
drewgle.net: could not connect to host
+drgn.li: could not connect to host
+drgn.no: could not connect to host
drhopeson.com: did not receive HSTS header
drillnation.com.au: could not connect to host
drinknaturespower.com: could not connect to host
@@ -5162,20 +5398,21 @@ drinkvabeer.com: could not connect to host
dripdoctors.com: did not receive HSTS header
drishti.guru: could not connect to host
drive.xyz: could not connect to host
-drivercopilot.com: did not receive HSTS header
drivewithstatetransit.com.au: did not receive HSTS header
driving-lessons.co.uk: could not connect to host
drivingtestpro.com: did not receive HSTS header
drixn.info: could not connect to host
drixn.net: could not connect to host
-drlangsdon.com: max-age too low: 0
+drjacquesmalan.com: could not connect to host
+drkmtrx.xyz: could not connect to host
drlazarina.net: did not receive HSTS header
drnow.ru: did not receive HSTS header
drobniuch.pl: could not connect to host
drogoz.moe: could not connect to host
droidboss.com: did not receive HSTS header
+droidwiki.de: could not connect to host
droithxn.com: could not connect to host
-droncentrum.pl: could not connect to host
+droncentrum.pl: did not receive HSTS header
dronebotworkshop.com: did not receive HSTS header
dronexpertos.com: could not connect to host
droomhuis-in-brielle-kopen.nl: could not connect to host
@@ -5213,7 +5450,7 @@ drycreekapiary.com: could not connect to host
ds-christiansen.de: could not connect to host
dshiv.io: could not connect to host
dsmstainlessproducts.co.uk: did not receive HSTS header
-dsne.com.mx: could not connect to host
+dsne.com.mx: did not receive HSTS header
dsouzamusic.com: did not receive HSTS header
dsyunmall.com: could not connect to host
dtechstore.com.br: did not receive HSTS header
@@ -5222,14 +5459,14 @@ dualias.xyz: could not connect to host
duan.li: could not connect to host
dubaosheng.com: could not connect to host
dubik.su: did not receive HSTS header
-duch.cloud: could not connect to host
duchyoffeann.com: could not connect to host
+ducius.net: could not connect to host
duckasylum.com: did not receive HSTS header
duckyubuntu.tk: could not connect to host
ducohosting.com: did not receive HSTS header
duelsow.eu: could not connect to host
duelysthub.com: could not connect to host
-duerls.de: did not receive HSTS header
+duerls.de: could not connect to host
dugnet.tech: could not connect to host
dujsq.com: could not connect to host
dujsq.top: could not connect to host
@@ -5239,6 +5476,7 @@ duks.com.br: could not connect to host
dullsir.com: did not receive HSTS header
dum.moe: could not connect to host
dumbdemo.com: could not connect to host
+dumont.ovh: did not receive HSTS header
dunamiscommunity.com: could not connect to host
dunashoes.com: could not connect to host
dune.io: did not receive HSTS header
@@ -5248,29 +5486,40 @@ dung-massage.fr: did not receive HSTS header
duo.money: could not connect to host
duocircle.com: did not receive HSTS header
duole30.com: could not connect to host
-duonganhtuan.com: could not connect to host
duongpho.com: did not receive HSTS header
durangoenergyllc.com: could not connect to host
dushu.cat: could not connect to host
duskopy.top: could not connect to host
dusnan.com: could not connect to host
-dustycloth.com: could not connect to host
+dutchessuganda.com: did not receive HSTS header
dutchrank.com: did not receive HSTS header
dutyfreeonboard.com: did not receive HSTS header
duuu.ch: could not connect to host
duyao.de: max-age too low: 86400
dvotx.org: did not receive HSTS header
-dwellstudio.com: did not receive HSTS header
+dwbtoftshit.com: did not receive HSTS header
+dwellstudio.com: could not connect to host
dwhd.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
dwnld.me: could not connect to host
dycem-ns.com: did not receive HSTS header
+dycoa.com: could not connect to host
dycontrol.de: could not connect to host
-dylancl.cf: could not connect to host
dylanscott.com.au: did not receive HSTS header
dynamic-innovations.net: could not connect to host
dynamic-networks.be: could not connect to host
dynamize.solutions: did not receive HSTS header
-dynts.pro: could not connect to host
+dynastyarena.com: could not connect to host
+dynastycalculator.com: could not connect to host
+dynastycentral.com: could not connect to host
+dynastychalkboard.com: could not connect to host
+dynastyclubhouse.com: could not connect to host
+dynastycrate.com: could not connect to host
+dynastyduel.com: could not connect to host
+dynastyfan.com: could not connect to host
+dynastygoal.com: could not connect to host
+dynastylocker.com: could not connect to host
+dynastyredline.com: could not connect to host
+dyncdn.me: could not connect to host
dyz.pw: did not receive HSTS header
dziekonski.com: could not connect to host
dzimejl.sk: did not receive HSTS header
@@ -5282,10 +5531,11 @@ dzytdl.com: did not receive HSTS header
e-apack.com.br: could not connect to host
e-aut.net: could not connect to host
e-baraxolka.ru: could not connect to host
-e-colle.info: did not receive HSTS header
e-deca2.org: did not receive HSTS header
e-gemeinde.at: could not connect to host
+e-imzo.uz: could not connect to host
e-isfa.eu: did not receive HSTS header
+e-kontakti.fi: did not receive HSTS header
e-mak.eu: could not connect to host
e-migration.ch: could not connect to host
e-newshub.com: could not connect to host
@@ -5316,32 +5566,34 @@ eagle-yard.de: could not connect to host
eagleridgecampground.com: could not connect to host
eam-gmbh.com: did not receive HSTS header
eames-clayton.us: could not connect to host
+eapestudioweb.com: did not receive HSTS header
earga.sm: could not connect to host
earlybirdsnacks.com: could not connect to host
earth-people.org: could not connect to host
earthrise16.com: could not connect to host
+easew.com: could not connect to host
east-line.su: could not connect to host
eastcoastbubbleandbounce.co.uk: could not connect to host
eastcoastinflatables.co.uk: did not receive HSTS header
easthokkaido-5airport.jp: did not receive HSTS header
+eastman.space: did not receive HSTS header
eastmidlandsstargazers.org.uk: did not receive HSTS header
eastmontgroup.com: did not receive HSTS header
eastpeoria-il.gov: could not connect to host
easy-factures.fr: could not connect to host
easychiller.org: could not connect to host
easycontentplan.com: could not connect to host
+easycup.com: max-age too low: 7889238
easykonto.de: could not connect to host
easyplane.it: did not receive HSTS header
easyreal.ru: could not connect to host
easyschools.org: did not receive HSTS header
easysimplecrm.com: could not connect to host
-eat-mine.ml: could not connect to host
-eat-sleep-code.com: could not connect to host
eat-the-world.ch: could not connect to host
eat4happiness.com: did not receive HSTS header
eatfitoutlet.com.br: could not connect to host
eatlowcarb.de: did not receive HSTS header
-eatson.com: could not connect to host
+eats.soy: could not connect to host
eattherich.us: did not receive HSTS header
eatvisor.co.uk: could not connect to host
eauclairecommerce.com: could not connect to host
@@ -5368,9 +5620,12 @@ ecg.fr: could not connect to host
echipstore.com: did not receive HSTS header
echoactive.com: max-age too low: 7776000
echomanchester.net: did not receive HSTS header
-eckro.com: did not receive HSTS header
+echoteam.gq: could not connect to host
+echtes-hutzelbrot.de: could not connect to host
+eckro.com: could not connect to host
eco-wiki.com: could not connect to host
ecobrain.be: max-age too low: 0
+ecococon.fr: could not connect to host
ecole-en-danger.fr: could not connect to host
ecole-iaf.fr: could not connect to host
ecole-maternelle-saint-joseph.be: could not connect to host
@@ -5383,13 +5638,13 @@ ecompen.co.za: could not connect to host
econativa.pt: could not connect to host
economy.st: did not receive HSTS header
economycarrentalscyprus.com: could not connect to host
-econsumer.gov: did not receive HSTS header
ecorus.eu: did not receive HSTS header
ecos.srl: did not receive HSTS header
ecoskif.ru: could not connect to host
ecosoftconsult.com: could not connect to host
ecosystemmanager.azurewebsites.net: did not receive HSTS header
ecotruck-pooling.com: did not receive HSTS header
+ecp.ae: did not receive HSTS header
ecrimex.net: did not receive HSTS header
ectora.com: could not connect to host
ed-matters.org: did not receive HSTS header
@@ -5406,13 +5661,15 @@ edenmal.net: did not receive HSTS header
edenvaleplumber24-7.co.za: did not receive HSTS header
edenvalerubbleremovals.co.za: did not receive HSTS header
edgecustomersportal.com: could not connect to host
-edgereinvent.com: did not receive HSTS header
+edgedynasty.com: could not connect to host
+edgereinvent.com: could not connect to host
edh.email: did not receive HSTS header
edhrealtor.com: did not receive HSTS header
edisonchee.com: did not receive HSTS header
edissecurity.sk: did not receive HSTS header
edition-pommern.com: max-age too low: 86400
editoraacademiacrista.com.br: could not connect to host
+editoraimaculada.com.br: did not receive HSTS header
edix.ru: could not connect to host
edk.com.tr: did not receive HSTS header
edpubs.gov: could not connect to host
@@ -5428,6 +5685,7 @@ educatweb.de: did not receive HSTS header
educnum.fr: did not receive HSTS header
educourse.ga: could not connect to host
eduif.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+edusantorini.com: could not connect to host
eduvance.in: did not receive HSTS header
ee-terminals.com: could not connect to host
eeb98.com: could not connect to host
@@ -5450,15 +5708,19 @@ eenhoorn.ga: could not connect to host
eeqj.com: did not receive HSTS header
eesistumine2017.ee: could not connect to host
eez.ee: could not connect to host
-eff-bee-eye.de: could not connect to host
+efag.com: did not receive HSTS header
+eff-bee-eye.de: did not receive HSTS header
effectiveosgi.com: could not connect to host
effectivepapers.com: could not connect to host
efficienthealth.com: could not connect to host
effizienta.ch: did not receive HSTS header
efflam.net: could not connect to host
eftcorp.biz: did not receive HSTS header
+egamespw.com: could not connect to host
+egbert.net: could not connect to host
egfl.org.uk: did not receive HSTS header
egge.com: max-age too low: 0
+eggqvq.com: could not connect to host
egit.co: could not connect to host
eglek.com: did not receive HSTS header
ego-world.org: could not connect to host
@@ -5469,13 +5731,15 @@ ehito.ovh: could not connect to host
ehr.gov: could not connect to host
ehrenamt-skpfcw.de: could not connect to host
ehrlichesbier.de: could not connect to host
+ehseller.com: did not receive HSTS header
ehsellert.com: did not receive HSTS header
ehuber.info: could not connect to host
eicfood.com: could not connect to host
+eichornenterprises.com: could not connect to host
eidolonhost.com: did not receive HSTS header
+eifelindex.de: could not connect to host
eiga-movie.com: max-age too low: 0
eigenbubi.de: could not connect to host
-eightyfour.ca: could not connect to host
eigo.work: did not receive HSTS header
eimanavicius.lt: did not receive HSTS header
einfachmaldiefressehalten.de: could not connect to host
@@ -5484,7 +5748,7 @@ einmonolog.de: could not connect to host
einsatzstiefel.info: could not connect to host
einsit.com: could not connect to host
einsitapis.com: could not connect to host
-ejgconsultancy.co.uk: did not receive HSTS header
+ejgconsultancy.co.uk: could not connect to host
ejuicelab.co.uk: did not receive HSTS header
ejusu.com: could not connect to host
ek.network: did not receive HSTS header
@@ -5503,6 +5767,7 @@ elbaal.gov: did not receive HSTS header
elblein.de: did not receive HSTS header
elbohlyart.com: did not receive HSTS header
eldietista.es: could not connect to host
+eldisagjapi.com: did not receive HSTS header
eldisagjapi.de: could not connect to host
elearningpilot.com: did not receive HSTS header
eleaut.com.br: did not receive HSTS header
@@ -5512,9 +5777,7 @@ electricant.com: did not receive HSTS header
electricant.nl: did not receive HSTS header
electriccitysf.com: could not connect to host
electrician-umhlanga.co.za: did not receive HSTS header
-electrician-umhlangaridge.co.za: did not receive HSTS header
electricianforum.co.uk: did not receive HSTS header
-electricianlalucia.co.za: did not receive HSTS header
electricianumhlangarocks.co.za: did not receive HSTS header
electricoperaduo.com: did not receive HSTS header
electromc.com: could not connect to host
@@ -5528,6 +5791,7 @@ elemprendedor.com.ve: could not connect to host
elena-baykova.ru: could not connect to host
elenag.ga: could not connect to host
elenagherta.ga: could not connect to host
+elenatranslations.nl: could not connect to host
elenoon.ir: max-age too low: 1
elenorsmadness.org: could not connect to host
eleonorengland.com: did not receive HSTS header
@@ -5538,15 +5802,16 @@ elgacien.de: could not connect to host
elguillatun.cl: did not receive HSTS header
elhall.pro: did not receive HSTS header
elhall.ru: did not receive HSTS header
+elia.cloud: could not connect to host
eliasojala.me: did not receive HSTS header
-elielaloum.com: could not connect to host
+elielaloum.com: did not receive HSTS header
elimdengelen.com: did not receive HSTS header
eline168.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
eliolita.com: could not connect to host
eliott.be: could not connect to host
-elistor6100.xyz: did not receive HSTS header
elite-box.com: did not receive HSTS header
elite-box.org: did not receive HSTS header
+elite-porno.ru: could not connect to host
elitecovering.fr: did not receive HSTS header
elitefishtank.com: could not connect to host
elitehosting.de: did not receive HSTS header
@@ -5554,11 +5819,14 @@ elitesensual.com.br: did not receive HSTS header
elizeugomes.com.br: did not receive HSTS header
ellen-skye.de: max-age too low: 604800
elliff.net: did not receive HSTS header
-elliotgluck.com: did not receive HSTS header
+elliotgluck.com: could not connect to host
+elliquiy.com: could not connect to host
elmar-kraamzorg.nl: did not receive HSTS header
elna-service.com.ua: did not receive HSTS header
elnutricionista.es: could not connect to host
elo.fyi: could not connect to host
+elodieclerc.ch: could not connect to host
+elohellp.com: could not connect to host
elohna.ch: did not receive HSTS header
elonbase.com: could not connect to host
elonm.ru: could not connect to host
@@ -5573,6 +5841,7 @@ elsword.moe: could not connect to host
eltransportquevolem.org: could not connect to host
eltrox.me: could not connect to host
eluft.de: could not connect to host
+elvisripley.com: max-age too low: 0
elyisus.info: did not receive HSTS header
elytronsecurity.com: did not receive HSTS header
email.lookout.com: could not connect to host
@@ -5582,6 +5851,7 @@ emailcontrol.nl: did not receive HSTS header
emailing.alsace: could not connect to host
emanatepixels.com: could not connect to host
emanga.su: could not connect to host
+emasex.es: could not connect to host
emavok.eu: could not connect to host
embellir-aroma.com: could not connect to host
embellir-kyujin.com: could not connect to host
@@ -5594,6 +5864,10 @@ emergencymedicinefoundations.com: did not receive HSTS header
emergentvisiontec.com: did not receive HSTS header
emesolutions.net: did not receive HSTS header
emiele.com.br: could not connect to host
+emil-dein-baecker.com: could not connect to host
+emilreimann.de: could not connect to host
+emils-chemnitz.de: could not connect to host
+emils1910.de: could not connect to host
emilyhorsman.com: could not connect to host
emilyshepherd.me: did not receive HSTS header
eminhuseynov.com: could not connect to host
@@ -5601,7 +5875,7 @@ eminovic.me: could not connect to host
emjainteractive.com: did not receive HSTS header
emjimadhu.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
emma-o.com: could not connect to host
-emmable.com: could not connect to host
+emmable.com: did not receive HSTS header
emmaliddell.com: did not receive HSTS header
emmanuelle-et-julien.ch: could not connect to host
emmdy.com: could not connect to host
@@ -5619,7 +5893,6 @@ employeestore.org: did not receive HSTS header
emporiovinareal.com.br: could not connect to host
empty-r.com: could not connect to host
emptypath.com: did not receive HSTS header
-emtradingacademy.com: could not connect to host
emupedia.net: did not receive HSTS header
emyself.info: could not connect to host
emyself.org: did not receive HSTS header
@@ -5631,7 +5904,6 @@ encode.space: could not connect to host
encode.uk.com: did not receive HSTS header
encoder.pw: could not connect to host
encontrebarato.com.br: could not connect to host
-encore.io: could not connect to host
encrypted.google.com: did not receive HSTS header (error ignored - included regardless)
encryptedaudience.com: could not connect to host
encryptio.com: could not connect to host
@@ -5641,7 +5913,7 @@ ende-x.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR
endlessdark.net: max-age too low: 600
endlesshorizon.net: max-age too low: 0
endlesstone.com: did not receive HSTS header
-endofinternet.goip.de: could not connect to host
+endofinternet.goip.de: did not receive HSTS header
endofnet.org: could not connect to host
endofodo.goip.de: could not connect to host
endohaus.ca: could not connect to host
@@ -5649,19 +5921,21 @@ endohaus.com: could not connect to host
endohaus.eu: could not connect to host
endohaus.us: could not connect to host
endspamwith.us: could not connect to host
+eneamarcantoni.com: could not connect to host
enecoshop.nl: did not receive HSTS header
enefan.jp: could not connect to host
enelacto.com: could not connect to host
energethik-tulln.at: did not receive HSTS header
energisammenslutningen.dk: could not connect to host
+energy.eu: max-age too low: 0
energyradio.mk: max-age too low: 0
enersaveapp.org: could not connect to host
enersec.co.uk: could not connect to host
enfoqueseguro.com: did not receive HSTS header
-engg.ca: could not connect to host
+enfu.se: could not connect to host
engineowning.com: did not receive HSTS header
-enginx.cn: could not connect to host
-enginx.net: could not connect to host
+enginepit.com: could not connect to host
+enginx.cn: did not receive HSTS header
englerts.de: did not receive HSTS header
englishclub.com: did not receive HSTS header
englishdirectory.de: could not connect to host
@@ -5673,7 +5947,6 @@ enjoymayfield.com: max-age too low: 0
enjoystudio.ro: did not receive HSTS header
enlatte.com: could not connect to host
enlazaresbueno.cl: could not connect to host
-enlighten10x.ga: could not connect to host
enlightened.si: did not receive HSTS header
enoou.com: could not connect to host
enpalmademallorca.info: could not connect to host
@@ -5686,19 +5959,21 @@ enteente.com: could not connect to host
enteente.space: could not connect to host
enteente.xyz: could not connect to host
enterdev.co: did not receive HSTS header
-enterprisecarclub.co.uk: could not connect to host
+enterprisecarclub.co.uk: did not receive HSTS header
enterprisechannel.asia: did not receive HSTS header
enterprivacy.com: did not receive HSTS header
entersynapse.com: could not connect to host
entheorie.net: did not receive HSTS header
entourneebeetle.com: could not connect to host
entrepreneur.or.id: could not connect to host
+entreprise-toiture-clement.fr: could not connect to host
enum.eu.org: could not connect to host
enumify.com: could not connect to host
envelope.co.nz: did not receive HSTS header
enviam.de: did not receive HSTS header
enviapresentes.com.br: could not connect to host
environment.ai: could not connect to host
+environmentkirklees.org: did not receive HSTS header
envoutement-desenvoutement.com: did not receive HSTS header
envoyglobal.com: did not receive HSTS header
envoyworld.com: did not receive HSTS header
@@ -5718,7 +5993,7 @@ ephe.be: could not connect to host
ephry.com: could not connect to host
epicbouncycastlehirenorwich.co.uk: could not connect to host
epicmc.games: could not connect to host
-epicpages.com: could not connect to host
+epo32.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
eposcloud.net: could not connect to host
eposmidlands.co.uk: could not connect to host
eposnewport.co.uk: did not receive HSTS header
@@ -5728,7 +6003,7 @@ eposreview.co.uk: could not connect to host
epossurrey.co.uk: did not receive HSTS header
epossussex.co.uk: could not connect to host
eposwales.co.uk: could not connect to host
-epoxate.com: could not connect to host
+epoxate.com: did not receive HSTS header
eprofitacademy.com: did not receive HSTS header
epsorting.cz: did not receive HSTS header
epulsar.ru: could not connect to host
@@ -5772,16 +6047,19 @@ ernesto.at: could not connect to host
eroimatome.com: could not connect to host
eroma.com.au: did not receive HSTS header
eromixx.com: could not connect to host
+eromon.net: could not connect to host
+eroskines.com: did not receive HSTS header
erotalia.es: could not connect to host
erotic4me.ch: did not receive HSTS header
eroticforce.com: could not connect to host
erotische-aanbiedingen.nl: could not connect to host
-erotpo.cz: did not receive HSTS header
+erotpo.cz: could not connect to host
erpiv.com: could not connect to host
errolz.com: did not receive HSTS header
errors.zenpayroll.com: could not connect to host
erspro.net: could not connect to host
eruvalerts.com: did not receive HSTS header
+erwanlepape.com: did not receive HSTS header
erwinvanlonden.net: did not receive HSTS header
es888.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
es8888.net: could not connect to host
@@ -5901,7 +6179,6 @@ esbuilders.co.nz: did not receive HSTS header
escalate.eu: could not connect to host
escape2rooms.fr: did not receive HSTS header
escapees.com: did not receive HSTS header
-esclear.de: could not connect to host
escolaengenharia.com.br: did not receive HSTS header
escolibri.com: could not connect to host
escort-byuro.net: did not receive HSTS header
@@ -5910,12 +6187,13 @@ escortdisplay.com: could not connect to host
escortshotsexy.com: did not receive HSTS header
escotour.com: did not receive HSTS header
escueladewordpress.com: did not receive HSTS header
+escxtra.com: did not receive HSTS header
esec.rs: did not receive HSTS header
eseth.de: did not receive HSTS header
esh.ink: could not connect to host
eshepperd.com: did not receive HSTS header
-eshobe.com: did not receive HSTS header
eshtapay.com: could not connect to host
+esibun.net: could not connect to host
esipublications.com: did not receive HSTS header
esko.bar: could not connect to host
esln.org: did not receive HSTS header
@@ -5936,12 +6214,14 @@ espressivo.com.br: did not receive HSTS header
esprit-cloture.fr: did not receive HSTS header
esquonic.com: could not connect to host
esrs.gov: could not connect to host
+ess-cert.ru: did not receive HSTS header
essayforum.com: could not connect to host
essayhave.com: could not connect to host
essaylib.com: could not connect to host
essayscam.org: could not connect to host
essayshark.com: could not connect to host
essaywebsite.com: did not receive HSTS header
+essca.fr: max-age too low: 0
essenceofvitalitydetox.com: could not connect to host
essencesdeprana.org: did not receive HSTS header
essential12.com: could not connect to host
@@ -5953,6 +6233,7 @@ essexghosthunters.co.uk: did not receive HSTS header
essplusmed.org: could not connect to host
estaciona.guru: could not connect to host
estan.cn: did not receive HSTS header
+estateczech-eu.ru: could not connect to host
estebanborges.com: did not receive HSTS header
estespr.com: did not receive HSTS header
estetistarimini.it: did not receive HSTS header
@@ -5966,6 +6247,7 @@ et180.com: could not connect to host
etalent.net: did not receive HSTS header
etangs-magazine.com: could not connect to host
etaoinwu.tk: could not connect to host
+etath.com: could not connect to host
etdonline.co.uk: did not receive HSTS header
eteapparel.com: did not receive HSTS header
etenendrinken.nu: did not receive HSTS header
@@ -5974,7 +6256,6 @@ eternitylove.us: could not connect to host
eth9.net: could not connect to host
ethandelany.me: could not connect to host
ethanfaust.com: did not receive HSTS header
-ethanlew.is: could not connect to host
ethantskinner.com: did not receive HSTS header
ether.school: could not connect to host
etherderbies.com: could not connect to host
@@ -5984,6 +6265,7 @@ ethicalexploiting.com: could not connect to host
ethicall.org.uk: did not receive HSTS header
ethicaltek.com: could not connect to host
ethil-faer.fr: could not connect to host
+ethosinfo.com: could not connect to host
etidni.help: did not receive HSTS header
etincelle.ml: could not connect to host
etk2000.com: did not receive HSTS header
@@ -5991,7 +6273,6 @@ etmirror.top: could not connect to host
etmirror.xyz: could not connect to host
etoto.pl: did not receive HSTS header
etproxy.tech: could not connect to host
-etrker.com: could not connect to host
ets2mp.de: did not receive HSTS header
etsysecure.com: could not connect to host
ettebiz.com: max-age too low: 0
@@ -6014,6 +6295,7 @@ euph.eu: could not connect to host
eupho.me: could not connect to host
eupresidency2018.com: could not connect to host
euren.se: could not connect to host
+euro-servers.de: could not connect to host
eurocamping.se: could not connect to host
eurocomcompany.cz: could not connect to host
euroescortguide.com: could not connect to host
@@ -6022,19 +6304,22 @@ europapier.bg: did not receive HSTS header
europapier.com: did not receive HSTS header
europapier.cz: did not receive HSTS header
europapier.hr: did not receive HSTS header
+europapier.hu: did not receive HSTS header
europapier.rs: did not receive HSTS header
europapier.si: did not receive HSTS header
+europapier.sk: did not receive HSTS header
europapier.ua: did not receive HSTS header
europeanpreppers.com: could not connect to host
euroservice.com.gr: did not receive HSTS header
euroshop24.net: could not connect to host
eurospecautowerks.com: did not receive HSTS header
eurostrategy.vn.ua: could not connect to host
+eurotime.ua: could not connect to host
eutram.com: did not receive HSTS header
euvo.tk: could not connect to host
evades.io: did not receive HSTS header
evadifranco.com: did not receive HSTS header
-evamathil.de: did not receive HSTS header
+evafojtova.cz: did not receive HSTS header
evanhandgraaf.nl: did not receive HSTS header
evankurniawan.com: did not receive HSTS header
evanreev.es: could not connect to host
@@ -6042,11 +6327,9 @@ evansville-wy.gov: could not connect to host
evantage.org: could not connect to host
evasion-energie.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
evdenevenakliyatankara.pw: could not connect to host
-eve.ac: could not connect to host
evecalm.com: did not receive HSTS header
evedanjailbreak.com: could not connect to host
evegalaxy.net: could not connect to host
-evemodx.com: did not receive HSTS header
evenstar-gaming.com: could not connect to host
event64.ru: did not receive HSTS header
eventmake.es: could not connect to host
@@ -6060,7 +6343,6 @@ everygayporn.xyz: could not connect to host
everylab.org: could not connect to host
everymove.org: could not connect to host
everything.place: could not connect to host
-everythingstech.com: could not connect to host
everytruckjob.com: did not receive HSTS header
eveseat.net: could not connect to host
eveshaiwu.com: could not connect to host
@@ -6085,11 +6367,13 @@ evossd.tk: could not connect to host
evowl.com: could not connect to host
ewallet-optimizer.com: did not receive HSTS header
ewex.org: could not connect to host
+ewizmo.com: did not receive HSTS header
eworksmedia.com: could not connect to host
ewuchuan.com: could not connect to host
exampleessays.com: could not connect to host
examplesu.com: could not connect to host
excelgum.ca: did not receive HSTS header
+exceltobarcode.com: could not connect to host
exceptionalbits.com: could not connect to host
exceptionalservices.us: could not connect to host
exchangecoordinator.com: could not connect to host
@@ -6098,30 +6382,31 @@ exclusivedesignz.com: [Exception... "Component returned failure code: 0x80004005
exebouncycastles.co.uk: did not receive HSTS header
exembit.com: did not receive HSTS header
exfiles.cz: could not connect to host
+exgaywatch.com: could not connect to host
exgravitus.com: could not connect to host
exhaledayspa.com.au: did not receive HSTS header
exno.co: could not connect to host
-exnovin.co: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
exoplatform.com: did not receive HSTS header
+exoticads.com: could not connect to host
exousiakaidunamis.xyz: could not connect to host
expatads.com: could not connect to host
expatriate.pl: did not receive HSTS header
expecting.com.br: could not connect to host
experticon.com: did not receive HSTS header
expertmile.com: did not receive HSTS header
-expertohomestaging.com: max-age too low: 0
experts-en-gestion.fr: did not receive HSTS header
-explodingcamera.com: did not receive HSTS header
-exploflex.com.br: did not receive HSTS header
-exploration.ga: did not receive HSTS header
+exploflex.com.br: could not connect to host
+exploration.ga: could not connect to host
+exploravacations.in: could not connect to host
expo-designers.com: did not receive HSTS header
expokohler.com: did not receive HSTS header
+exponentialnews.net: could not connect to host
expoort.com.br: could not connect to host
exporo.de: did not receive HSTS header
expoundite.net: did not receive HSTS header
expowerhps.com: did not receive HSTS header
-expressemotion.net: could not connect to host
expressfinance.co.za: did not receive HSTS header
+extendwings.com: could not connect to host
exteriorservices.io: could not connect to host
extramoney.cash: could not connect to host
extrathemeshowcase.net: could not connect to host
@@ -6131,20 +6416,17 @@ extratorrent.red: could not connect to host
extratorrent.world: could not connect to host
extratorrentlive.xyz: could not connect to host
extratorrents.tech: could not connect to host
-extreme-players.com: could not connect to host
extremenetworking.net: could not connect to host
extremeservicesandrestoration.com: could not connect to host
exy.pw: could not connect to host
-eyasc.nl: could not connect to host
eyedarts.com: did not receive HSTS header
eyeglassuniverse.com: did not receive HSTS header
eyenote.gov: did not receive HSTS header
-eyes-of-universe.eu: could not connect to host
+eyes-of-universe.eu: did not receive HSTS header
eyesoccer-didikh.rhcloud.com: could not connect to host
eyesonly.cc: did not receive HSTS header
eytosh.net: could not connect to host
ez.fi: could not connect to host
-ezequiel-garzon.net: could not connect to host
ezgamble.com: did not receive HSTS header
ezimoeko.net: could not connect to host
ezmod.org: could not connect to host
@@ -6170,11 +6452,12 @@ fabianasantiago.com: could not connect to host
fabianfischer.de: did not receive HSTS header
fabianmunoz.com: did not receive HSTS header
fabienbaker.com: could not connect to host
-fabled.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+fabiocicerchia.it: could not connect to host
fabriko.fr: did not receive HSTS header
fabriziorocca.com: could not connect to host
fabulouslyyouthfulskin.com: could not connect to host
fabulouslyyouthfulskineyeserum.com: could not connect to host
+facebattle.com: could not connect to host
facebook.ax: could not connect to host
facebooktsukaikata.net: did not receive HSTS header
facepalmsecurity.com: could not connect to host
@@ -6226,14 +6509,17 @@ familie-zimmermann.at: could not connect to host
familiegrottendieck.de: max-age too low: 7776000
familletouret.fr: did not receive HSTS header
famio.cn: could not connect to host
-fancy-bridge.com: could not connect to host
+fander.it: could not connect to host
fanflow.com: could not connect to host
fansmade.art: could not connect to host
fant.dk: did not receive HSTS header
fantasticgardenersmelbourne.com.au: did not receive HSTS header
fantasticpestcontrolmelbourne.com.au: did not receive HSTS header
+fantasycdn.com: could not connect to host
+fantasydrop.com: could not connect to host
fantasyfootballpundit.com: did not receive HSTS header
fantasyprojections.com: could not connect to host
+fanvoice.com: could not connect to host
fanyl.cn: could not connect to host
fap.no: could not connect to host
faq.lookout.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -6249,8 +6535,6 @@ farmaciaformula.com.br: could not connect to host
farmaciamedicom.com.br: could not connect to host
farmmaximizer.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
farrel-f.id: could not connect to host
-farsil.eu: could not connect to host
-fascia.fit: could not connect to host
fashion.net: did not receive HSTS header
fashion4ever.pl: could not connect to host
fashioncare.cz: did not receive HSTS header
@@ -6263,7 +6547,7 @@ fasset.jp: could not connect to host
fastaim.de: could not connect to host
fastbackmbg.be: could not connect to host
fastbackmbm.be: could not connect to host
-fastcomcorp.net: did not receive HSTS header
+fastcomcorp.net: could not connect to host
fastconfirm.com: could not connect to host
fastcp.top: could not connect to host
fastograph.com: could not connect to host
@@ -6277,7 +6561,6 @@ fatox.de: could not connect to host
fattorino.it: did not receive HSTS header
fatwin.pw: could not connect to host
fatzebra.com.au: max-age too low: 0
-faultlines.org: could not connect to host
favorit.club: did not receive HSTS header
fawkex.me: did not receive HSTS header
faxite.com: did not receive HSTS header
@@ -6308,11 +6591,11 @@ feegg.com.br: could not connect to host
feeriedesign-event.com: could not connect to host
fefore.com: did not receive HSTS header
fegans.org.uk: did not receive HSTS header
+fehnladen.de: did not receive HSTS header
feirlane.org: could not connect to host
feist.io: could not connect to host
feitobrasilcosmeticos.com.br: did not receive HSTS header
feizhujianzhi.com: did not receive HSTS header
-fejes.house: could not connect to host
felger-times.fr: could not connect to host
felgitscher.xyz: max-age too low: 2592000
felisslovakia.sk: did not receive HSTS header
@@ -6321,7 +6604,9 @@ felixhefner.de: did not receive HSTS header
felixrr.pro: could not connect to host
femaledom.xyz: could not connect to host
femdombbw.com: could not connect to host
+feminism.lgbt: could not connect to host
feminists.co: could not connect to host
+femradio.es: did not receive HSTS header
feng-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
feng-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
fengyadi.com: could not connect to host
@@ -6339,21 +6624,24 @@ fernseher-kauf.de: could not connect to host
ferrolatino.com: could not connect to host
feschiyan.com: could not connect to host
festember.com: did not receive HSTS header
-festival.house: did not receive HSTS header
+festival.house: could not connect to host
festivalxdentro.com: did not receive HSTS header
festrip.com: could not connect to host
-fetch.co.uk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+festx.co.za: did not receive HSTS header
fetclips.se: could not connect to host
fetlife.com: could not connect to host
fettbrot.tk: did not receive HSTS header
feudaltactics.com: could not connect to host
feuerwehr-dachaufsetzer.de: could not connect to host
-fexmen.com: could not connect to host
+feuerwehr-oberkotzau.de: could not connect to host
+feuerwehrbadwurzach.de: did not receive HSTS header
+fexmen.com: did not receive HSTS header
ff-bg.xyz: could not connect to host
ffbans.org: did not receive HSTS header
ffl123.com: did not receive HSTS header
fgequipamentos.com.br: did not receive HSTS header
-fhg90.com: did not receive HSTS header
+fhbnutrition.com: did not receive HSTS header
+fhg90.com: could not connect to host
fhsseniormens.club: could not connect to host
fi-sanki.co.jp: could not connect to host
fialat.cz: could not connect to host
@@ -6362,6 +6650,7 @@ fics-twosigma.com: could not connect to host
fid.to: could not connect to host
fidel.uk: did not receive HSTS header
fideleslaici.com: did not receive HSTS header
+fidufinance.com: did not receive HSTS header
fieldclockapp.com: did not receive HSTS header
fieldtalk.co.uk: could not connect to host
fiendishmasterplan.com: did not receive HSTS header
@@ -6389,18 +6678,23 @@ filesense.com: could not connect to host
filewall.de: did not receive HSTS header
filey.co.uk: did not receive HSTS header
filhomes.ph: could not connect to host
+fili.org: could not connect to host
+filiosoft.cloud: did not receive HSTS header
fillitupchallenge.eu: did not receive HSTS header
fillmysuitca.se: did not receive HSTS header
film-storyboards.com: did not receive HSTS header
film.photography: did not receive HSTS header
film.photos: did not receive HSTS header
+filmatiporno.xxx: could not connect to host
filme-online.eu.com: did not receive HSTS header
filmesubtitrate2017.online: could not connect to host
filo.xyz: did not receive HSTS header
filoitoupediou.gr: did not receive HSTS header
-filterflasche-kaufen.de: did not receive HSTS header
+filterflasche-kaufen.de: could not connect to host
finalgear.com: could not connect to host
+finalprice.net: could not connect to host
finalvpn.com: did not receive HSTS header
+financewithcromulent.com: could not connect to host
financier.io: did not receive HSTS header
financieringsportaal.nl: did not receive HSTS header
finanzkontor.net: could not connect to host
@@ -6420,6 +6714,7 @@ finiteheap.com: did not receive HSTS header
finkenberger.org: did not receive HSTS header
finstererlebnis.de: could not connect to host
finsterlebnis.de: did not receive HSTS header
+fintechnics.com: could not connect to host
fiodental.com.br: did not receive HSTS header
fiork.com: did not receive HSTS header
fire-wolf.com: could not connect to host
@@ -6438,6 +6733,7 @@ fireworkcoaching.com: did not receive HSTS header
firexarxa.de: could not connect to host
firmale.com: could not connect to host
firmenverzeichnis.nu: could not connect to host
+firmware.science: did not receive HSTS header
first-time-offender.com: could not connect to host
firstchoicepool.com: did not receive HSTS header
firstdogonthemoon.com.au: did not receive HSTS header
@@ -6455,7 +6751,7 @@ fitnesswerk.de: could not connect to host
fitqbe.com: did not receive HSTS header
fitshop.com.br: could not connect to host
fitsw.com: did not receive HSTS header
-fiuxy.me: could not connect to host
+fiuxy.org: could not connect to host
five.vn: did not receive HSTS header
fiveboosts.xyz: could not connect to host
fivestarsitters.com: did not receive HSTS header
@@ -6464,7 +6760,7 @@ fivezerocreative.com: did not receive HSTS header
fiws.net: did not receive HSTS header
fix-the-timeline.com: could not connect to host
fix-the-timeline.org: could not connect to host
-fixate.ru: could not connect to host
+fixate.ru: max-age too low: 3153600
fixeaide.com: did not receive HSTS header
fixeaider.com: did not receive HSTS header
fixico-staging.nl: could not connect to host
@@ -6496,6 +6792,7 @@ flam.io: could not connect to host
flamewall.net: could not connect to host
flamingcow.tv: could not connect to host
flamingkeys.com.au: could not connect to host
+flamingogroup.vn: did not receive HSTS header
flareon.net: could not connect to host
flaretechnologies.io: could not connect to host
flashbaggie.com: could not connect to host
@@ -6517,6 +6814,7 @@ flightschoolusa.com: did not receive HSTS header
flikmsg.co: could not connect to host
fling.dating: could not connect to host
flipagram.com: did not receive HSTS header
+flipbell.com: did not receive HSTS header
flipkey.com: did not receive HSTS header
flirchi.com: did not receive HSTS header
flirtycourts.com: could not connect to host
@@ -6548,7 +6846,6 @@ floweslawncare.com: could not connect to host
flowlo.me: could not connect to host
flox.io: could not connect to host
floydm.com: did not receive HSTS header
-flucky.xyz: could not connect to host
flucto.com: did not receive HSTS header
flue-ducting.co.uk: did not receive HSTS header
flugplatz-edvc.de: could not connect to host
@@ -6559,12 +6856,15 @@ fluitbeurt.nl: could not connect to host
flukethoughts.com: did not receive HSTS header
flurrybridge.com: could not connect to host
flushstudios.com: did not receive HSTS header
+flux.by: did not receive HSTS header
flyaces.com: could not connect to host
+flyawayantennas.com: did not receive HSTS header
flybunnyfly.dk: did not receive HSTS header
flygpost.com: did not receive HSTS header
flyingdoggy.net: could not connect to host
flyingspaghettimonsterdonationsfund.nl: could not connect to host
flyingyoung.top: could not connect to host
+flyshe.co.uk: did not receive HSTS header
flyspace.ga: did not receive HSTS header
flyspace.ml: did not receive HSTS header
flyss.net: could not connect to host
@@ -6575,6 +6875,8 @@ fmapplication.com: could not connect to host
fmi.gov: did not receive HSTS header
fmovies.fyi: did not receive HSTS header
fmovies.life: could not connect to host
+fmstr.ml: could not connect to host
+fnb-griffinonline.com: did not receive HSTS header
fnfpt.co.uk: could not connect to host
fniephaus.com: did not receive HSTS header
fnncat.com: did not receive HSTS header
@@ -6599,6 +6901,7 @@ foo: could not connect to host
food4health.guide: could not connect to host
foodacademy.capetown: max-age too low: 43200
foodbuddy.ch: could not connect to host
+foodcare.ml: could not connect to host
foodcowgirls.com: could not connect to host
foodiebox.no: did not receive HSTS header
foodies.my: did not receive HSTS header
@@ -6631,7 +6934,6 @@ formadmin.com: did not receive HSTS header
formaliteo.com: did not receive HSTS header
formasdemaquillarse.com: did not receive HSTS header
formazioneopen.it: could not connect to host
-formersessalaries.com: did not receive HSTS header
formkiq.com: could not connect to host
formula.cf: could not connect to host
foro.io: could not connect to host
@@ -6639,8 +6941,9 @@ forpc.us: did not receive HSTS header
forplanetsake.com: could not connect to host
forplayers.pl: could not connect to host
forquilhinhanoticias.com.br: could not connect to host
-forschbach-janssen.de: could not connect to host
forsyththeatre.com: could not connect to host
+fort.eu: max-age too low: 0
+fortnitemagic.ga: could not connect to host
fortoglethorpega.gov: could not connect to host
fortricks.in: did not receive HSTS header
fortuna-loessnitz.de: could not connect to host
@@ -6656,7 +6959,7 @@ foshanshequ.com: could not connect to host
fossewayflowers.co.uk: could not connect to host
fossewayflowers.com: could not connect to host
fossewaygardencentre.co.uk: did not receive HSTS header
-fossgruppen.se: did not receive HSTS header
+fossgruppen.se: could not connect to host
fossguard.com: did not receive HSTS header
fotiu.com: could not connect to host
foto-pro.by: did not receive HSTS header
@@ -6665,10 +6968,11 @@ fotocerita.net: could not connect to host
fotogiraffe.ru: did not receive HSTS header
fotografosexpertos.com: did not receive HSTS header
fotopasja.info: could not connect to host
+fotostravestisbr.com: could not connect to host
fourchin.net: could not connect to host
fourwheelpartloanssimple.com: did not receive HSTS header
foxdev.io: could not connect to host
-foxelbox.com: could not connect to host
+foxelbox.com: did not receive HSTS header
foxes.no: could not connect to host
foxhound.com.br: could not connect to host
foxley-farm.co.uk: did not receive HSTS header
@@ -6683,20 +6987,23 @@ fpki.sh: could not connect to host
fq.mk: did not receive HSTS header
fr0zenbits.io: could not connect to host
fr33d0m.link: could not connect to host
+fr33tux.org: did not receive HSTS header
fragilesolar.cf: could not connect to host
-fragnic.com: did not receive HSTS header
+fragnic.com: could not connect to host
fralef.me: did not receive HSTS header
francesca-and-lucas.com: did not receive HSTS header
+francescoservida.ch: did not receive HSTS header
francevpn.xyz: could not connect to host
francois-vidit.com: did not receive HSTS header
-frangor.info: did not receive HSTS header
+francoise-paviot.com: could not connect to host
+frangor.info: could not connect to host
frankedier.com: did not receive HSTS header
frankfurt-am-start.de: did not receive HSTS header
+frankhaala.com: could not connect to host
franklinhua.com: could not connect to host
fransallen.com: did not receive HSTS header
franta.biz: did not receive HSTS header
franta.email: did not receive HSTS header
-franzt.de: could not connect to host
franzt.ovh: could not connect to host
frasesaniversarios.com.br: did not receive HSTS header
frasesdeamizade.pt: could not connect to host
@@ -6780,15 +7087,15 @@ freddythechick.uk: could not connect to host
frederickalcantara.com: could not connect to host
fredliang.cn: could not connect to host
fredriksslekt.se: could not connect to host
+fredtec.ru: could not connect to host
free-your-pc.com: could not connect to host
free8.xyz: could not connect to host
freeasinlliure.org: did not receive HSTS header
-freeassangenow.org: did not receive HSTS header
freeben666.fr: could not connect to host
freebies.id: could not connect to host
freeblog.me: could not connect to host
freebookmakerbets.com.au: did not receive HSTS header
-freecam2cam.site: could not connect to host
+freecycleusa.com: did not receive HSTS header
freedomrealtyoftexas.com: did not receive HSTS header
freedomvote.nl: could not connect to host
freeexampapers.com: could not connect to host
@@ -6802,6 +7109,7 @@ freelandinnovation.com: did not receive HSTS header
freelansir.com: could not connect to host
freemanning.de: could not connect to host
freematthale.net: could not connect to host
+freemomhugs.org: did not receive HSTS header
freepoints.us: could not connect to host
freeslots.guru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
freesoftwaredriver.com: could not connect to host
@@ -6810,13 +7118,10 @@ freesounding.ru: did not receive HSTS header
freethought.org.au: could not connect to host
freeutopia.org: did not receive HSTS header
freevps.us: did not receive HSTS header
-freitasul.com.br: could not connect to host
-freitasul.io: could not connect to host
frenzel.dk: could not connect to host
freqlabs.com: did not receive HSTS header
freshfind.xyz: could not connect to host
freshkiss.com.au: did not receive HSTS header
-freshmaza.com: could not connect to host
freshmaza.io: did not receive HSTS header
frettboard.com: did not receive HSTS header
frezbo.com: could not connect to host
@@ -6838,14 +7143,17 @@ fromix.de: could not connect to host
fromlemaytoz.com: could not connect to host
fromthesoutherncross.com: could not connect to host
front-end.dog: could not connect to host
+frontier.bet: could not connect to host
+frontierdiscount.com: did not receive HSTS header
frontisme.nl: did not receive HSTS header
-frontline.cloud: did not receive HSTS header
frontline6.com: did not receive HSTS header
frontmin.com: did not receive HSTS header
frost-ci.xyz: could not connect to host
frostbytes.net: could not connect to host
frosty-gaming.xyz: could not connect to host
frp-roleplay.de: could not connect to host
+frprn.com: could not connect to host
+frprn.xxx: could not connect to host
frsis2017.com: could not connect to host
frugal-millennial.com: did not receive HSTS header
fruitusers.com: could not connect to host
@@ -6854,6 +7162,7 @@ frusky.net: could not connect to host
fs-community.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
fs-fitness.eu: could not connect to host
fs-gamenet.de: did not receive HSTS header
+fsck.cz: could not connect to host
fsf.moe: could not connect to host
fsfi.is: could not connect to host
fsinf.at: did not receive HSTS header
@@ -6865,14 +7174,14 @@ fstatic.io: could not connect to host
fstfy.de: could not connect to host
fsvoboda.cz: could not connect to host
ftang.de: could not connect to host
-ftccomplaintassistant.gov: did not receive HSTS header
ftctele.com: could not connect to host
fteproxy.org: did not receive HSTS header
ftgho.com: could not connect to host
ftpi.ml: could not connect to host
+ftv.re: could not connect to host
fu-li88.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
fu-li88.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-fu639.top: did not receive HSTS header
+fu639.top: could not connect to host
fuchsy.com: could not connect to host
fuckbilibili.com: could not connect to host
fuckcf.cf: could not connect to host
@@ -6905,12 +7214,14 @@ fun99.cc: could not connect to host
funarena.com.ua: could not connect to host
fundacionfranciscofiasco.org: could not connect to host
fundacionhijosdelsol.org: could not connect to host
+fundayltd.com: could not connect to host
funderburg.me: did not receive HSTS header
funerariahogardecristo.cl: did not receive HSTS header
fungame.eu: did not receive HSTS header
-funi4u.com: could not connect to host
+funi4u.com: did not receive HSTS header
funideas.org: could not connect to host
funkes-ferien.de: did not receive HSTS header
+funkner.ru: could not connect to host
funkyweddingideas.com.au: could not connect to host
funnelweb.xyz: could not connect to host
funny-joke-pictures.com: did not receive HSTS header
@@ -6925,12 +7236,12 @@ furcity.me: could not connect to host
furgetmeknot.org: did not receive HSTS header
furi.ga: could not connect to host
furiffic.com: did not receive HSTS header
-furikake.xyz: could not connect to host
furnation.com: could not connect to host
furnitureconcept.co.uk: could not connect to host
furry.agency: could not connect to host
furry.be: did not receive HSTS header
furry.zone: did not receive HSTS header
+furrybot.me: could not connect to host
furtherfood.com: did not receive HSTS header
furtivelook.com: did not receive HSTS header
fusedrops.com: did not receive HSTS header
@@ -6948,9 +7259,11 @@ futurestarsusa.org: did not receive HSTS header
futuretechnologi.es: could not connect to host
futureyouhealth.com: did not receive HSTS header
futuristarchitecture.com: did not receive HSTS header
+fuvelis.com: could not connect to host
fuvpn.com: could not connect to host
fuxwerk.de: could not connect to host
fuzoku-sodan.com: could not connect to host
+fuzoku.jp: could not connect to host
fwei.tk: did not receive HSTS header
fws.gov: did not receive HSTS header
fwww7.com: could not connect to host
@@ -6960,10 +7273,10 @@ fxwebstudio.com.au: max-age too low: 0
fyodorpi.com: did not receive HSTS header
fyol.pw: could not connect to host
fysiohaenraets.nl: did not receive HSTS header
-fytcart.com: could not connect to host
+fzhyzamt.com: could not connect to host
fzn.io: did not receive HSTS header
fzslm.me: did not receive HSTS header
-g-i-s.vn: did not receive HSTS header
+g-i-s.vn: could not connect to host
g-marketing.ro: could not connect to host
g-o.pl: did not receive HSTS header
g-rickroll-o.pw: could not connect to host
@@ -6980,6 +7293,7 @@ g77.ca: could not connect to host
gaanbaksho.com.au: did not receive HSTS header
gaasuper6.com: could not connect to host
gabber.scot: could not connect to host
+gabemack.com: did not receive HSTS header
gabethebabetv.com: could not connect to host
gabi.com.es: could not connect to host
gabi.soy: did not receive HSTS header
@@ -6990,14 +7304,19 @@ gabrielsimonet.ch: could not connect to host
gaelleetarnaud.com: did not receive HSTS header
gafachi.com: could not connect to host
gagne-enterprises.com: did not receive HSTS header
+gaiavanderzeyp.com: could not connect to host
gaichanh.com: did not receive HSTS header
+gaichon.com: could not connect to host
gainesvillegoneaustin.org: did not receive HSTS header
-gaiserik.com: did not receive HSTS header
gaite.me: did not receive HSTS header
+gajas18.com: could not connect to host
+gakkainavi.jp: did not receive HSTS header
+gakkainavi.net: did not receive HSTS header
gakkainavi4.com: could not connect to host
gakkainavi4.jp: did not receive HSTS header
gakkainavi4.net: did not receive HSTS header
galardi.org: could not connect to host
+galecia.com: did not receive HSTS header
galena.io: could not connect to host
galenskap.eu: could not connect to host
galeriadobimba.com.br: could not connect to host
@@ -7007,12 +7326,15 @@ galgoafegao.com.br: could not connect to host
galgoingles.com.br: could not connect to host
galgopersa.com.br: could not connect to host
gali.review: did not receive HSTS header
+galilahiskye.com: did not receive HSTS header
galileomtz.com: did not receive HSTS header
gallery44.org: did not receive HSTS header
galoisvpn.xyz: could not connect to host
gam3rs.de: could not connect to host
gamajo.com: did not receive HSTS header
gambitcloud.net: could not connect to host
+gamblersgaming.eu: could not connect to host
+gamcore.com: could not connect to host
game-gentle.com: could not connect to host
game-topic.ru: did not receive HSTS header
game.yt: could not connect to host
@@ -7023,6 +7345,7 @@ gamecdn.com: could not connect to host
gamechasm.com: could not connect to host
gamefund.me: could not connect to host
gamehacks.me: could not connect to host
+gameharbor.eu: could not connect to host
gameink.net: did not receive HSTS header
gamek.es: could not connect to host
gamenected.com: could not connect to host
@@ -7045,20 +7368,24 @@ gameswitchers.uk: could not connect to host
gametilt.com: could not connect to host
gametium.com: could not connect to host
gametium.es: could not connect to host
+gametowndev.tk: could not connect to host
gamhealth.net: could not connect to host
gamingmedia.eu: could not connect to host
gamingreinvented.com: did not receive HSTS header
+gamingwithcromulent.com: could not connect to host
+gamishijabsyari.com: could not connect to host
gamismodelbaru.com: did not receive HSTS header
-gamismu.com: did not receive HSTS header
gamoice.com: did not receive HSTS header
gampenhof.de: could not connect to host
gan.wtf: could not connect to host
+gandc.co: could not connect to host
gangnam-club.com: could not connect to host
gangnam-karaoke.com: did not receive HSTS header
ganhonet.com.br: did not receive HSTS header
ganyouxuan.com: could not connect to host
ganzgraph.de: did not receive HSTS header
gaon.network: could not connect to host
+gaphag.ddns.net: could not connect to host
gaptek.id: did not receive HSTS header
gar-nich.net: could not connect to host
garage-abri-chalet.fr: did not receive HSTS header
@@ -7070,14 +7397,14 @@ garcinia--cambogia.com: could not connect to host
garciniacambogiareviewed.co: did not receive HSTS header
garden-life.org: could not connect to host
garden.trade: could not connect to host
-gardencarezone.com: did not receive HSTS header
-garfieldairlines.net: did not receive HSTS header
+gardencarezone.com: could not connect to host
+garfieldairlines.net: could not connect to host
garten-bau.ch: did not receive HSTS header
garten-diy.de: could not connect to host
-gartenhauszentrum.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+gartenhauszentrum.de: did not receive HSTS header
gasbarkenora.com: could not connect to host
gasnews.net: could not connect to host
-gasser-daniel.ch: could not connect to host
+gasser-daniel.ch: did not receive HSTS header
gassouthkenticoqa.azurewebsites.net: could not connect to host
gastritisolucion.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
gatapro.net: could not connect to host
@@ -7092,10 +7419,16 @@ gautham.pro: did not receive HSTS header
gavick.com: did not receive HSTS header
gavinsblog.com: did not receive HSTS header
gay-jays.com: could not connect to host
+gay-sissies.com: could not connect to host
gaya-sa.org: did not receive HSTS header
+gayauthors.org: could not connect to host
+gaycc.cc: could not connect to host
gayforgenji.com: could not connect to host
gaygeeks.de: could not connect to host
gayjays.com: could not connect to host
+gaysfisting.com: could not connect to host
+gaytorrent.ru: could not connect to host
+gayxsite.com: could not connect to host
gazee.net: did not receive HSTS header
gazflynn.com: did not receive HSTS header
gbit.xyz: could not connect to host
@@ -7106,19 +7439,17 @@ gchp.ie: did not receive HSTS header
gcodetools.com: could not connect to host
gdegem.org: did not receive HSTS header
gdevpenze.ru: could not connect to host
-gdhzcgs.com: could not connect to host
gdprhallofshame.com: did not receive HSTS header
gdutnic.com: could not connect to host
gdz-otvety.com: could not connect to host
gdz.tv: could not connect to host
gear-acquisition-syndrome.community: could not connect to host
gearseo.com.br: did not receive HSTS header
-geaskb.nl: could not connect to host
+geaskb.nl: did not receive HSTS header
geass.xyz: could not connect to host
geblitzt.de: did not receive HSTS header
gedankenbude.info: could not connect to host
gedankenworks.com: could not connect to host
-geek.ch: could not connect to host
geek1.de: did not receive HSTS header
geekbaba.com: could not connect to host
geekcast.co.uk: could not connect to host
@@ -7127,7 +7458,6 @@ geekdt.com: could not connect to host
geekmind.org: max-age too low: 172800
geeks.berlin: could not connect to host
geeks.lgbt: could not connect to host
-geeks.one: did not receive HSTS header
geektimes.com: did not receive HSTS header
geeky.software: could not connect to host
geekystudios.us: could not connect to host
@@ -7137,7 +7467,7 @@ geigr.de: could not connect to host
geiser.io: did not receive HSTS header
gekosoft.eu: could not connect to host
geldteveel.eu: could not connect to host
-geli-graphics.com: did not receive HSTS header
+geluk.io: could not connect to host
gemeentemolenwaard.nl: did not receive HSTS header
gemeinfreie-lieder.de: did not receive HSTS header
gemsoftheworld.org: could not connect to host
@@ -7150,13 +7480,13 @@ genesischangelog.com: did not receive HSTS header
geneve.guide: could not connect to host
genia-life.de: could not connect to host
genie-seiner-generation.de: did not receive HSTS header
-geniush.ovh: could not connect to host
genneve.com: did not receive HSTS header
genoog.com: could not connect to host
genossen.ru: could not connect to host
genshiken.org: could not connect to host
gensokyo.chat: could not connect to host
-genuu.com: did not receive HSTS header
+gentooblog.de: could not connect to host
+genuu.com: could not connect to host
genuxation.com: could not connect to host
genuxtsg.com: did not receive HSTS header
genxbeats.com: could not connect to host
@@ -7168,7 +7498,7 @@ geoffanderinmyers.com: did not receive HSTS header
geoffdev.com: could not connect to host
geoffmyers.com: did not receive HSTS header
geoffreyrichard.com: did not receive HSTS header
-geopals.net: did not receive HSTS header
+geopals.net: could not connect to host
georgehalachev.com: did not receive HSTS header
georgeperez.me: could not connect to host
georgesonarthurs.com.au: did not receive HSTS header
@@ -7179,13 +7509,15 @@ gereon.ch: could not connect to host
geri.be: could not connect to host
germancraft.net: could not connect to host
germansoldiers.net: could not connect to host
+germanticz.de: did not receive HSTS header
gers-authentique.com: could not connect to host
gerum.dynv6.net: did not receive HSTS header
-geschenkly.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+geschichtscheck.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
geschmackspiloten.de: did not receive HSTS header
gesiwista.net: did not receive HSTS header
gesunde-smoothies.de: did not receive HSTS header
gesundes-im-napf.de: did not receive HSTS header
+gesundheitszentrum-am-reischberg.de: did not receive HSTS header
get-asterisk.ru: could not connect to host
get-cctv.com: could not connect to host
get-link.info: could not connect to host
@@ -7196,6 +7528,7 @@ getcarefirst.com: could not connect to host
getcarina.com: could not connect to host
getcleartouch.com: did not receive HSTS header
getcolor.com: did not receive HSTS header
+getcolq.com: could not connect to host
getdigitized.net: could not connect to host
geteduroam.no: could not connect to host
getenergized2018.kpn: could not connect to host
@@ -7203,7 +7536,7 @@ getenv.io: could not connect to host
getfestify.com: did not receive HSTS header
getfirepress.com: could not connect to host
getfittedstore.com: did not receive HSTS header
-getfuturama.com: max-age too low: 0
+getfuturama.com: could not connect to host
getgeek.dk: could not connect to host
getgeek.ee: could not connect to host
getgeek.eu: could not connect to host
@@ -7236,6 +7569,7 @@ getshifter.io: did not receive HSTS header
getspeaker.com: did not receive HSTS header
getspire.com: could not connect to host
getsubs.net: could not connect to host
+getts.ro: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
getwarden.net: could not connect to host
getwashdaddy.com: could not connect to host
getweloop.io: did not receive HSTS header
@@ -7243,6 +7577,7 @@ getyou.onl: could not connect to host
getyourphix.tk: could not connect to host
gevaulug.fr: could not connect to host
gfbouncycastles.co.uk: did not receive HSTS header
+gfedating.com: could not connect to host
gfhgiro.nl: did not receive HSTS header
gflclan.ru: could not connect to host
gfm.tech: could not connect to host
@@ -7252,17 +7587,18 @@ gfw.moe: could not connect to host
gfwno.win: max-age too low: 15
gfwsb.ml: could not connect to host
gglks.com: could not connect to host
+ggobbo.com: could not connect to host
ggrks-asano.com: could not connect to host
ggss.cf: could not connect to host
ggss.ml: could not connect to host
gh16.com.ar: could not connect to host
ghaglund.se: could not connect to host
-ghcif.de: could not connect to host
+ghcif.de: did not receive HSTS header
gheorghe-sarcov.ga: could not connect to host
gheorghesarcov.ga: could not connect to host
gheorghesarcov.tk: could not connect to host
ghi.gov: could not connect to host
-ghibli.studio: could not connect to host
+ghibli.studio: did not receive HSTS header
ghid-pitesti.ro: did not receive HSTS header
ghkim.net: could not connect to host
gianlucapartengo.photography: did not receive HSTS header
@@ -7273,7 +7609,7 @@ gicl.dk: could not connect to host
giddyaunt.net: could not connect to host
gidea.nu: could not connect to host
giduv.com: did not receive HSTS header
-giegler.software: could not connect to host
+giegler.software: did not receive HSTS header
giftbg.org: did not receive HSTS header
giftgofers.com: max-age too low: 2592000
giftservices.nl: could not connect to host
@@ -7283,21 +7619,23 @@ gigantar.com: did not receive HSTS header
gigawattz.com: did not receive HSTS header
gigime.com: could not connect to host
gigiscloud.servebeer.com: could not connect to host
+gigolodavid.be: could not connect to host
gilcloud.com: could not connect to host
gilescountytn.gov: did not receive HSTS header
gilgaz.com: did not receive HSTS header
gilium.com: could not connect to host
gillet-cros.fr: could not connect to host
gilly.berlin: did not receive HSTS header
+gilmourluna.com: could not connect to host
gilpinmanagement.com: did not receive HSTS header
gilpinrealty.com: did not receive HSTS header
gilroywestwood.org: did not receive HSTS header
+ginacat.de: did not receive HSTS header
gincher.net: did not receive HSTS header
gingali.de: did not receive HSTS header
ginie.de: did not receive HSTS header
ginijony.com: did not receive HSTS header
ginkel.com: did not receive HSTS header
-ginnegappen.nl: could not connect to host
gintenreiter-photography.com: did not receive HSTS header
giochistem.it: could not connect to host
giogadesign.com: did not receive HSTS header
@@ -7316,6 +7654,7 @@ git.ac.cn: could not connect to host
git.co: could not connect to host
gitar.io: could not connect to host
github.party: did not receive HSTS header
+givastar.com: did not receive HSTS header
givemyanswer.com: could not connect to host
giverang.biz: could not connect to host
giverang.com: could not connect to host
@@ -7325,12 +7664,12 @@ gixtools.co.uk: could not connect to host
gixtools.uk: could not connect to host
gizmo.ovh: could not connect to host
gizzo.sk: could not connect to host
+gkimanyar.org: could not connect to host
glabiatoren-kst.de: could not connect to host
gladystudio.com: did not receive HSTS header
glaspe.com: could not connect to host
glass.google.com: did not receive HSTS header (error ignored - included regardless)
glasslikes.com: did not receive HSTS header
-glassrom.pw: could not connect to host
glbg.eu: did not receive HSTS header
gle: could not connect to host
glenavy.tk: could not connect to host
@@ -7361,8 +7700,8 @@ globalvisions-events.ch: could not connect to host
globalvisions-events.com: could not connect to host
globeinform.com: did not receive HSTS header
globuli-info.de: could not connect to host
-glofox.com: did not receive HSTS header
gloomyspark.com: could not connect to host
+glossopnorthendafc.co.uk: could not connect to host
glotter.com: did not receive HSTS header
gloucesterphotographer.com: did not receive HSTS header
glubbforum.de: did not receive HSTS header
@@ -7376,24 +7715,25 @@ gmat.ovh: could not connect to host
gmoes.at: did not receive HSTS header
gmplab.com: did not receive HSTS header
gnaptracker.tk: could not connect to host
+gnhub.org: could not connect to host
gnom.me: could not connect to host
gnosticjade.net: did not receive HSTS header
+gnuplus.me: could not connect to host
gnylf.com: could not connect to host
go.ax: did not receive HSTS header
go2sh.de: did not receive HSTS header
go4it.solutions: did not receive HSTS header
-goabonga.com: could not connect to host
-goalsetup.com: did not receive HSTS header
+goabonga.com: did not receive HSTS header
+goalsetup.com: could not connect to host
goaltree.ch: did not receive HSTS header
-goapunks.net: did not receive HSTS header
+goapunks.net: could not connect to host
goat.chat: did not receive HSTS header
goat.xyz: could not connect to host
goben.ch: could not connect to host
-goblins.net: did not receive HSTS header
+goblins.net: could not connect to host
goblinsatwork.com: could not connect to host
goblintears.com: could not connect to host
gocardless.com: did not receive HSTS header
-gocher.me: could not connect to host
god-esb.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
godbo9.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
godbo9.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -7405,22 +7745,23 @@ godrive.ga: could not connect to host
godruoyi.com: did not receive HSTS header
goedeke.ml: could not connect to host
goerner.me: did not receive HSTS header
-goesta-hallenbau.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-goettinger-biergarten.de: could not connect to host
+goesta-hallenbau.de: did not receive HSTS header
goge.site: could not connect to host
gogenenglish.com: could not connect to host
gogetssl.com: did not receive HSTS header
goggs.eu: could not connect to host
gogold-g.com: could not connect to host
+gogonano.com: did not receive HSTS header
goguel.org: did not receive HSTS header
goiaspropaganda.com.br: could not connect to host
gold24.in: could not connect to host
goldclubcasino.com: could not connect to host
goldendata.io: could not connect to host
+goldeneggs.club: did not receive HSTS header
goldfelt.com: could not connect to host
goldminer.ga: could not connect to host
goldpros.com: did not receive HSTS header
-goldsky.com.au: did not receive HSTS header
+goldsky.com.au: could not connect to host
goldwater.gov: could not connect to host
goldwaterfoundation.gov: could not connect to host
goldwaterscholarship.gov: could not connect to host
@@ -7441,6 +7782,7 @@ goodmengroup.de: did not receive HSTS header
goods-memo.net: did not receive HSTS header
goodsex4all.com.br: could not connect to host
goodtech.com.br: could not connect to host
+goodvibesblog.com: could not connect to host
goodwin43.ru: could not connect to host
goodyearsotn.co.uk: could not connect to host
google: could not connect to host (error ignored - included regardless)
@@ -7449,7 +7791,9 @@ googlehosts.org: could not connect to host
googlemail.com: did not receive HSTS header (error ignored - included regardless)
googleplex.com: did not receive HSTS header (error ignored - included regardless)
goolok.com: could not connect to host
+goontopia.com: could not connect to host
gootax.pro: did not receive HSTS header
+gootlijsten.nl: did not receive HSTS header
goozz.nl: did not receive HSTS header
gopay.cz: did not receive HSTS header
gopokego.cz: could not connect to host
@@ -7458,14 +7802,16 @@ gorgiaxx.com: could not connect to host
gorilla-gym.site: could not connect to host
gorillow.com: could not connect to host
gorognyelv.hu: could not connect to host
+gorschenin.com: could not connect to host
gosharewood.com: did not receive HSTS header
goshop.cz: did not receive HSTS header
+goshow.tv: could not connect to host
+gostargazing.co.uk: did not receive HSTS header
gostream.asia: could not connect to host
gotgenes.com: could not connect to host
goto.google.com: did not receive HSTS header (error ignored - included regardless)
gotobrno.cz: did not receive HSTS header
gotocloud.ru: could not connect to host
-gotowned.org: could not connect to host
gotspot.com: could not connect to host
gottfriedfeyen.com: did not receive HSTS header
goubi.me: could not connect to host
@@ -7475,7 +7821,7 @@ gourmettia.com: did not receive HSTS header
gouthro-goteborg.se: did not receive HSTS header
gouv.ovh: did not receive HSTS header
gov.ax: could not connect to host
-goverage.org: could not connect to host
+goverage.org: did not receive HSTS header
govillemo.ca: did not receive HSTS header
gowin9.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
gowin9.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -7503,6 +7849,7 @@ gradenotify.com: could not connect to host
grads360.org: could not connect to host
gradsm-ci.net: could not connect to host
grafitec.ru: did not receive HSTS header
+grafmurr.de: could not connect to host
graftworld.pw: could not connect to host
grahamofthewheels.com: did not receive HSTS header
grana.com: did not receive HSTS header
@@ -7536,10 +7883,6 @@ greatnet.de: did not receive HSTS header
greatsong.net: max-age too low: 2592000
greditsoft.com: did not receive HSTS header
greedbutt.com: max-age too low: 2592000
-green-light.cf: could not connect to host
-green-light.ga: could not connect to host
-green-light.gq: could not connect to host
-green-light.ml: could not connect to host
greenbaysecuritysolutions.com: did not receive HSTS header
greencardtalent.com: could not connect to host
greenconn.ca: could not connect to host
@@ -7548,8 +7891,9 @@ greenenergysolution.uk: did not receive HSTS header
greenesting.ch: could not connect to host
greenesting.com: could not connect to host
greenglam.biz: did not receive HSTS header
+greengoblindev.com: could not connect to host
greengov.gov: could not connect to host
-greenhillantiques.co.uk: did not receive HSTS header
+greenhillantiques.co.uk: could not connect to host
greenitpark.net: did not receive HSTS header
greensolid.biz: could not connect to host
greenville.ag: did not receive HSTS header
@@ -7558,11 +7902,14 @@ greenvpn.ltd: could not connect to host
greenvpn.pro: did not receive HSTS header
greggsfoundation.org.uk: could not connect to host
gregmartyn.com: could not connect to host
+gregmarziomedia-dev.com: did not receive HSTS header
+gregmarziomedia.co.za: could not connect to host
gregmarziomedia.com: did not receive HSTS header
gregmilton.org: could not connect to host
gregorytlee.me: could not connect to host
grekland.guide: could not connect to host
gremots.com: could not connect to host
+grengine.ch: could not connect to host
greplin.com: could not connect to host
gresb.com: did not receive HSTS header
gretchelizartistry.com: did not receive HSTS header
@@ -7570,6 +7917,7 @@ grettogeek.com: did not receive HSTS header
greuel.online: could not connect to host
greve.xyz: could not connect to host
grevesgarten.de: could not connect to host
+greyhash.se: could not connect to host
greyline.se: could not connect to host
grian-bam.at: did not receive HSTS header
gribani.com: could not connect to host
@@ -7582,6 +7930,7 @@ gripnijmegen.rip: could not connect to host
gripopgriep.net: could not connect to host
gritte.net: could not connect to host
griyo.online: could not connect to host
+grizzlys.com: could not connect to host
groben-itsolutions.de: could not connect to host
groenders.nl: did not receive HSTS header
groenewoud.run: could not connect to host
@@ -7616,7 +7965,8 @@ gsnort.com: did not receive HSTS header
gtalife.net: did not receive HSTS header
gtamodshop.org: could not connect to host
gtanda.tk: could not connect to host
-gtdgo.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+gtchipsi.org: did not receive HSTS header
+gtcprojects.com: could not connect to host
gtech.work: did not receive HSTS header
gtldna.com: could not connect to host
gtraxapp.com: could not connect to host
@@ -7625,6 +7975,7 @@ gts-schulsoftware.de: did not receive HSTS header
gtts.space: did not receive HSTS header
guarajubaimoveis.com.br: did not receive HSTS header
guava.studio: did not receive HSTS header
+guchengf.me: max-age too low: 0
gudangpangan.id: could not connect to host
gudrun.ml: could not connect to host
guelphhydropool.com: could not connect to host
@@ -7634,6 +7985,7 @@ gufen.ga: could not connect to host
guffrits.com: could not connect to host
gugaltika-ipb.org: could not connect to host
guge.gq: could not connect to host
+gugert.net: could not connect to host
gugga.dk: could not connect to host
guguke.net: did not receive HSTS header
guidechecking.com: could not connect to host
@@ -7662,6 +8014,7 @@ gunnarhafdal.com: did not receive HSTS header
gunnaro.com: did not receive HSTS header
guntbert.net: could not connect to host
guoqiang.info: did not receive HSTS header
+guphi.net: did not receive HSTS header
gurochan.ch: could not connect to host
gurom.lv: could not connect to host
gurubetng.com: did not receive HSTS header
@@ -7672,8 +8025,10 @@ guso.gq: could not connect to host
guso.ml: could not connect to host
guso.site: could not connect to host
guso.tech: could not connect to host
-gussi.is: did not receive HSTS header
+gussi.is: could not connect to host
+gustiaux.com: did not receive HSTS header
guthabenkarten-billiger.de: could not connect to host
+gutuia.blue: could not connect to host
guvernalternativa.ro: could not connect to host
guyot-tech.com: did not receive HSTS header
gvchannel.xyz: could not connect to host
@@ -7689,11 +8044,13 @@ gwijaya.com: could not connect to host
gwtest.us: could not connect to host
gxgx.org: could not connect to host
gxlrx.net: could not connect to host
+gyakori.com: could not connect to host
gyboche.com: could not connect to host
gyboche.science: could not connect to host
gycis.me: did not receive HSTS header
gylauto.fr: could not connect to host
-gypsycatdreams.com: could not connect to host
+gymnasium-farmsen.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+gypsycatdreams.com: did not receive HSTS header
gypthecat.com: did not receive HSTS header
gyz.io: did not receive HSTS header
gzitech.com: could not connect to host
@@ -7714,12 +8071,9 @@ habeo.si: could not connect to host
hablemosdetecnologia.com.ve: could not connect to host
habtium.com: could not connect to host
hac30.com: could not connect to host
-hack.club: could not connect to host
-hack.cz: could not connect to host
+hack.cz: did not receive HSTS header
hack.li: could not connect to host
hackbubble.me: could not connect to host
-hackdown.me: could not connect to host
-hacker.club: could not connect to host
hacker.deals: could not connect to host
hacker8.cn: could not connect to host
hackercat.ninja: max-age too low: 2592000
@@ -7736,13 +8090,13 @@ hackit.im: could not connect to host
hackmeplz.com: could not connect to host
hackroyale.xyz: could not connect to host
hacksnack.io: could not connect to host
+hacktic.info: could not connect to host
hackyourfaceoff.com: could not connect to host
hackzogtum-coburg.de: did not receive HSTS header
-hadaf.pro: did not receive HSTS header
+hadaf.pro: max-age too low: 300
hadret.com: did not receive HSTS header
hadret.sh: could not connect to host
hadzic.co: could not connect to host
-haeckdesign.com: did not receive HSTS header
haeckl.eu: did not receive HSTS header
haehnlein.at: could not connect to host
haemmerle.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -7762,22 +8116,28 @@ haktec.de: did not receive HSTS header
haku.moe: could not connect to host
hakugin.me: could not connect to host
hakugin.org: could not connect to host
+hakurei.moe: did not receive HSTS header
hal-9th.space: could not connect to host
+halbich.design: could not connect to host
halcyonsbastion.com: could not connect to host
half-logic.eu.org: could not connect to host
+halfco.de: could not connect to host
halfwaythere.eu: could not connect to host
halkyon.net: could not connect to host
halledesprix.fr: did not receive HSTS header
+halletienne.fr: could not connect to host
halloweenthings.website: could not connect to host
+hallumlaw.com: did not receive HSTS header
halo.red: could not connect to host
+halongbaybackpackertour.com: could not connect to host
halta.info: did not receive HSTS header
halyul.cc: could not connect to host
-halyul.com: did not receive HSTS header
haman.nl: could not connect to host
hamish.ca: did not receive HSTS header
hamking.tk: could not connect to host
hammamsayad.com: could not connect to host
hammer-corp.com: did not receive HSTS header
+hammer-schnaps.com: did not receive HSTS header
hamon.cc: did not receive HSTS header
hamu.blue: could not connect to host
hancatemc.com: did not receive HSTS header
@@ -7791,13 +8151,14 @@ handmadeshoes.pe: could not connect to host
handmadetutorials.ro: could not connect to host
handsandall.com: did not receive HSTS header
handyglas.com: could not connect to host
-handyticket.de: did not receive HSTS header
hanfu.la: did not receive HSTS header
+hanfverband-erfurt.de: could not connect to host
hang333.pw: could not connect to host
hangar18-modelismo.com.br: could not connect to host
hanimalis.fr: could not connect to host
hanksservice.com: could not connect to host
hannes-speelgoedencadeautjes.nl: did not receive HSTS header
+hanoibuffet.com: could not connect to host
hans-natur.de: did not receive HSTS header
hansch.ventures: could not connect to host
hanxv.pw: did not receive HSTS header
@@ -7812,7 +8173,9 @@ haobo5555.com: could not connect to host
haobo6666.com: could not connect to host
haobo7777.com: could not connect to host
haomwei.com: could not connect to host
+haotown.cn: did not receive HSTS header
haoyugao.com: could not connect to host
+haozijing.com: could not connect to host
hapissl.com: could not connect to host
hapivm.com: could not connect to host
happist.com: did not receive HSTS header
@@ -7836,15 +8199,13 @@ harlentimberproducts.co.uk: did not receive HSTS header
harmonycosmetic.com: max-age too low: 300
harrisonsdirect.co.uk: did not receive HSTS header
harristony.com: could not connect to host
-harry-baker.com: could not connect to host
harryharrison.co: did not receive HSTS header
harrypottereditor.com: could not connect to host
harrypottereditor.net: could not connect to host
-harschnitz.nl: did not receive HSTS header
hartlep.eu: could not connect to host
hartmancpa.com: did not receive HSTS header
harvestrenewal.org: did not receive HSTS header
-harveymilton.com: max-age too low: 0
+harveymilton.com: did not receive HSTS header
harz.cloud: could not connect to host
has.vision: could not connect to host
hasabig.wang: could not connect to host
@@ -7866,6 +8227,8 @@ haurumcraft.net: could not connect to host
hausarzt-stader-str.de: did not receive HSTS header
hauswarteam.com: could not connect to host
hav.com: could not connect to host
+havarijna-sluzba-bratislava.sk: did not receive HSTS header
+havasuhomepage.com: did not receive HSTS header
haveeruexaminer.com: could not connect to host
haven-staging.cloud: could not connect to host
haven.cloud: did not receive HSTS header
@@ -7876,12 +8239,14 @@ hawthornharpist.com: could not connect to host
haxoff.com: did not receive HSTS header
haxon.me: could not connect to host
haxx.hu: could not connect to host
+hayden.one: did not receive HSTS header
haydenhill.us: could not connect to host
+haydentomas.com: did not receive HSTS header
hayleishop.fr: did not receive HSTS header
hayzepvp.us: did not receive HSTS header
hazcod.com: could not connect to host
haze-productions.com: could not connect to host
-haze.network: did not receive HSTS header
+haze.network: could not connect to host
haze.sucks: could not connect to host
hazeltime.com: could not connect to host
hazeltime.se: could not connect to host
@@ -7905,7 +8270,7 @@ hcoe.fi: did not receive HSTS header
hcr.io: did not receive HSTS header
hcs-company.com: did not receive HSTS header
hcs-company.nl: could not connect to host
-hcstr.com: did not receive HSTS header
+hcstr.com: could not connect to host
hd1tj.org: did not receive HSTS header
hda.me: did not receive HSTS header
hdm.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -7913,24 +8278,29 @@ hdrboundless.com: could not connect to host
hdritalyphotos.com: did not receive HSTS header
hdserver.info: did not receive HSTS header
hdsmigrationtool.com: could not connect to host
+hdtwinks.com: could not connect to host
hduin.xyz: could not connect to host
+hdwallpapers.net: could not connect to host
hdy.nz: could not connect to host
head-shop.lt: could not connect to host
head-shop.lv: could not connect to host
headmates.xyz: could not connect to host
healey.io: max-age too low: 2592000
+health-and-beauty-news.net: could not connect to host
health-match.com.au: could not connect to host
healthcare6.com: did not receive HSTS header
+healthiercompany.com: did not receive HSTS header
healthjoy.com: did not receive HSTS header
healthlabs.com: did not receive HSTS header
healthmatchapp.com: could not connect to host
healthyandnaturalliving.com: could not connect to host
healthycod.in: could not connect to host
+healthyfitfood.com: could not connect to host
healtious.com: could not connect to host
hearingshofar.com: could not connect to host
heart.ge: could not connect to host
heartlandrentals.com: did not receive HSTS header
-hearttruth.gov: could not connect to host
+heartsucker.com: could not connect to host
hearty.cf: did not receive HSTS header
hearty.ink: could not connect to host
hearty.space: could not connect to host
@@ -7945,6 +8315,7 @@ heavenlysmokenc.com: could not connect to host
heavystresser.com: could not connect to host
heayao.com: could not connect to host
hebaus.com: could not connect to host
+hebergeurssd.com: could not connect to host
heberut.gov: did not receive HSTS header
hebriff.com: could not connect to host
hechamano.es: did not receive HSTS header
@@ -7960,14 +8331,14 @@ hele.cz: could not connect to host
helencrump.co.uk: did not receive HSTS header
helgakristoffer.com: could not connect to host
helgakristoffer.wedding: could not connect to host
+helgaschultz.de: could not connect to host
helicaldash.com: could not connect to host
helixflight.com: did not receive HSTS header
hellenicaward.com: did not receive HSTS header
hellerup.net: did not receive HSTS header
hello-nestor.com: did not receive HSTS header
-helloanselm.com: did not receive HSTS header
+helloanselm.com: max-age too low: 172800
hellofilters.com: could not connect to host
-hellomouse.cf: did not receive HSTS header
hellomouse.tk: could not connect to host
hellotandem.com: could not connect to host
hellothought.net: could not connect to host
@@ -7987,6 +8358,8 @@ helpium.de: did not receive HSTS header
helpmebuild.com: did not receive HSTS header
helpmij.cf: could not connect to host
helppresta.com: did not receive HSTS header
+helprocleaningservices.com: did not receive HSTS header
+helptasker.org: did not receive HSTS header
helpverif.com: did not receive HSTS header
helsingfors.guide: could not connect to host
helup.com: did not receive HSTS header
@@ -8001,6 +8374,8 @@ henriknoerr.com: could not connect to host
henrock.net: could not connect to host
hentai.design: did not receive HSTS header
hentaimaster.net: could not connect to host
+hentaiworld.cc: could not connect to host
+hentaiz.net: could not connect to host
hepteract.us: could not connect to host
heptner24.de: could not connect to host
heracles-hotel.eu: did not receive HSTS header
@@ -8017,7 +8392,6 @@ hermes.cat: could not connect to host
heroin.org.uk: could not connect to host
herpaderp.net: could not connect to host
herr-webdesign.de: could not connect to host
-herramientasbazarot.com: did not receive HSTS header
herrenfahrt.com: did not receive HSTS header
herrtxbias.org: could not connect to host
hervespanneut.com: did not receive HSTS header
@@ -8057,6 +8431,7 @@ hiddenprocess.com: did not receive HSTS header
hiddenrefuge.eu.org: could not connect to host
hidedd.com: could not connect to host
hideftv.deals: could not connect to host
+hideo54.com: could not connect to host
hideout.agency: could not connect to host
hidrofire.com: did not receive HSTS header
hiexmerida-mailing.com: could not connect to host
@@ -8088,6 +8463,7 @@ hillcity.org.nz: did not receive HSTS header
hillebrand.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
hilnu.tk: could not connect to host
hiltonhyland.com: did not receive HSTS header
+himens.com: did not receive HSTS header
hindmanfuneralhomes.com: did not receive HSTS header
hingle.me: could not connect to host
hinkel-sohn.de: did not receive HSTS header
@@ -8109,10 +8485,12 @@ hirevets.gov: did not receive HSTS header
hirokilog.com: did not receive HSTS header
hirte-digital.de: did not receive HSTS header
hisingenrunt.se: did not receive HSTS header
+histocamp.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
histoire-theatre.com: did not receive HSTS header
history.pe: could not connect to host
hitchunion.org: could not connect to host
hitoy.org: could not connect to host
+hitrek.ml: could not connect to host
hittipps.com: could not connect to host
hivatal-info.hu: could not connect to host
hj2999.com: did not receive HSTS header
@@ -8120,6 +8498,7 @@ hjes.com.ve: could not connect to host
hjf-immobilien.de: did not receive HSTS header
hjkhs.cn: did not receive HSTS header
hknet.at: did not receive HSTS header
+hl7999.com: did not receive HSTS header
hlacosedora.com: max-age too low: 7889238
hlpublicidad.com: could not connect to host
hlyue.com: did not receive HSTS header
@@ -8128,7 +8507,7 @@ hm1ch.ovh: could not connect to host
hmksq.ae: max-age too low: 7776000
hmm.nyc: could not connect to host
hnwebi.com: did not receive HSTS header
-hoast.xyz: could not connect to host
+hoast.xyz: did not receive HSTS header
hobaugh.social: could not connect to host
hobby-gamerz-community.de: did not receive HSTS header
hocassian.cn: did not receive HSTS header
@@ -8150,6 +8529,7 @@ hokieprivacy.org: did not receive HSTS header
hokify.at: did not receive HSTS header
hokify.ch: did not receive HSTS header
hokify.de: did not receive HSTS header
+holad.de: did not receive HSTS header
holgerlehner.com: could not connect to host
holidayincotswolds.co.uk: could not connect to host
holifestival-freyung.de: could not connect to host
@@ -8169,11 +8549,13 @@ home-insurance-quotes.tk: could not connect to host
home-v.ind.in: could not connect to host
home-work-jobs.com: could not connect to host
homeandyarddetailing.com: could not connect to host
-homecarpetcleaning.co.uk: could not connect to host
+homeautomated.com: could not connect to host
+homecarpetcleaning.co.uk: did not receive HSTS header
homeclouding.de: could not connect to host
homecoming.city: could not connect to host
homedna.com: did not receive HSTS header
homeexx.com: did not receive HSTS header
+homehuntertoronto.com: could not connect to host
homehunting.pt: did not receive HSTS header
homeoesp.org: did not receive HSTS header
homeownersassociationmanagementla.com: could not connect to host
@@ -8184,6 +8566,7 @@ homesfordinner.ca: did not receive HSTS header
homeyantra.com: did not receive HSTS header
homezhi.com.tw: could not connect to host
homoglyph.net: could not connect to host
+homyremedies.com: could not connect to host
honeybeard.co.uk: did not receive HSTS header
honeytracks.com: could not connect to host
hongyd.online: could not connect to host
@@ -8198,16 +8581,21 @@ hoodiecrow.com: could not connect to host
hoodoo.io: could not connect to host
hoodoo.tech: could not connect to host
hookandloom.com: did not receive HSTS header
+hoooc.com: did not receive HSTS header
hoopsacademyusa.com: could not connect to host
+hopemeet.info: could not connect to host
hopesb.org: did not receive HSTS header
hopewellproperties.co.uk: did not receive HSTS header
hopglass.eu: could not connect to host
hopglass.net: could not connect to host
horace.li: did not receive HSTS header
horisonttimedia.fi: did not receive HSTS header
+horizonlawncare.tk: could not connect to host
horizonmoto.fr: did not receive HSTS header
+horizonresourcesinc.com: could not connect to host
horkel.cf: could not connect to host
horning.co: did not receive HSTS header
+hornyforhanzo.com: could not connect to host
horosho.in: could not connect to host
horrorserv.com: could not connect to host
horseboners.xxx: could not connect to host
@@ -8216,7 +8604,7 @@ horvathtom.com: could not connect to host
horvatnyelvkonyv.hu: could not connect to host
host.black: could not connect to host
hostam.link: could not connect to host
-hostcoz.com: did not receive HSTS header
+hostcoz.com: could not connect to host
hosted-oswa.org: did not receive HSTS header
hostedbgp.net: did not receive HSTS header
hostedtalkgadget.google.com: did not receive HSTS header (error ignored - included regardless)
@@ -8227,6 +8615,7 @@ hostinaus.com.au: did not receive HSTS header
hostingfirst.nl: could not connect to host
hostingfj.com: could not connect to host
hostisan.com: could not connect to host
+hostma.ma: could not connect to host
hostserv.org: could not connect to host
hosyaku.gr.jp: did not receive HSTS header
hot-spa.ch: did not receive HSTS header
@@ -8234,7 +8623,6 @@ hotartup.com: could not connect to host
hotchillibox.co.za: could not connect to host
hotchoc.io: could not connect to host
hotel-huberhof.at: did not receive HSTS header
-hotel-tongruben.de: max-age too low: 0
hotelaustria-wien.at: did not receive HSTS header
hotello.io: could not connect to host
hotelmadhuwanvihar.com: could not connect to host
@@ -8243,6 +8631,7 @@ hotelvillahermosa-mailing.com: could not connect to host
hotelvue.nl: could not connect to host
hotesb.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
hotesb.net: could not connect to host
+hotjuice.com: could not connect to host
hotornot.com: could not connect to host
hotpoint-training.com: did not receive HSTS header
hottestwebcamgirls.org: could not connect to host
@@ -8270,6 +8659,8 @@ hppub.info: could not connect to host
hppub.org: could not connect to host
hppub.site: could not connect to host
hqhost.net: did not receive HSTS header
+hqq.tv: could not connect to host
+hqy.moe: did not receive HSTS header
hr-intranet.com: could not connect to host
hr-tech.store: could not connect to host
hr98.tk: could not connect to host
@@ -8281,7 +8672,6 @@ hrk.io: could not connect to host
hrtech.store: could not connect to host
hrtraining.com.au: did not receive HSTS header
hru.gov: could not connect to host
-hschen.top: could not connect to host
hserver.top: could not connect to host
hsex.tv: did not receive HSTS header
hsir.me: could not connect to host
@@ -8299,18 +8689,18 @@ http418.xyz: could not connect to host
httphacker.com: could not connect to host
https.ps: could not connect to host
https.ren: could not connect to host
-https4all.org: could not connect to host
httpstatuscode418.xyz: could not connect to host
httptest.net: could not connect to host
hua-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
hua-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
hua-li88.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
hua-li88.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+huang-haitao.com: did not receive HSTS header
huangguancq.com: could not connect to host
+huangliangbo.com: did not receive HSTS header
huangting.me: did not receive HSTS header
huangzenghao.com: could not connect to host
huarongdao.com: did not receive HSTS header
-huashan.co.uk: could not connect to host
huaxueba.com: could not connect to host
hubert.systems: did not receive HSTS header
hubertmoszka.pl: could not connect to host
@@ -8318,6 +8708,7 @@ hubrecht.at: could not connect to host
hubrick.com: could not connect to host
hudhaifahgoga.co.za: could not connect to host
hudingyuan.cn: could not connect to host
+hugizrecords.com: did not receive HSTS header
hugocollignon.fr: could not connect to host
hui-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
hui-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -8335,17 +8726,19 @@ humortuga.pt: did not receive HSTS header
hump.dk: could not connect to host
humpi.at: could not connect to host
humpteedumptee.in: did not receive HSTS header
-huniverse.co: did not receive HSTS header
+hunqz.com: could not connect to host
hunterjohnson.io: could not connect to host
huodongweb.com: could not connect to host
-huoduan.com: did not receive HSTS header
huongquynh.com: could not connect to host
hup.blue: did not receive HSTS header
+hupp.se: could not connect to host
+hurleyhomestead.com: could not connect to host
hurricanelabs.com: did not receive HSTS header
huskybutt.dog: could not connect to host
huskyduvercors.com: did not receive HSTS header
hustle.com: did not receive HSTS header
hustle.life: did not receive HSTS header
+huto.ml: could not connect to host
huwjones.me: could not connect to host
huzu.com: did not receive HSTS header
huzurmetal.net: could not connect to host
@@ -8360,12 +8753,12 @@ hybridklubben.fi: could not connect to host
hybridragon.net: could not connect to host
hybula.nl: could not connect to host
hydai.co: could not connect to host
-hydra.ws: could not connect to host
+hydra.ws: did not receive HSTS header
hydra.zone: could not connect to host
hydrabit.nl: did not receive HSTS header
hydrante.ch: could not connect to host
hydrocloud.net: could not connect to host
-hydrodipcenter.nl: could not connect to host
+hydrodipcenter.nl: did not receive HSTS header
hydronium.cf: could not connect to host
hydronium.ga: could not connect to host
hydronium.me: could not connect to host
@@ -8397,7 +8790,7 @@ i10z.com: could not connect to host
i28s.com: did not receive HSTS header
i496.eu: could not connect to host
i4m1k0su.com: could not connect to host
-i95.me: did not receive HSTS header
+i66.me: could not connect to host
i9multiequipamentos.com.br: could not connect to host
ia1000.com: could not connect to host
iadttaveras.com: could not connect to host
@@ -8413,12 +8806,12 @@ iamveto.com: did not receive HSTS header
ian.sh: did not receive HSTS header
ianvisits.co.uk: did not receive HSTS header
iapws.com: did not receive HSTS header
-iba.community: could not connect to host
iban.is: could not connect to host
ibarf.nl: did not receive HSTS header
ibase.com: did not receive HSTS header
ibenchu.com: did not receive HSTS header
ibestreview.com: did not receive HSTS header
+ibiu.xyz: did not receive HSTS header
ibizatopcharter.com: did not receive HSTS header
ibna.online: could not connect to host
ibnuwebhost.com: could not connect to host
@@ -8465,12 +8858,15 @@ icusignature.com: could not connect to host
icys2017.com: did not receive HSTS header
id-co.in: could not connect to host
id-conf.com: did not receive HSTS header
+idaeus.eu: could not connect to host
+idafauziyah.com: did not receive HSTS header
+idblab.tk: did not receive HSTS header
idc.yn.cn: could not connect to host
idcrane.com: could not connect to host
iddconnect.com: could not connect to host
iddconnect.org: could not connect to host
ideadozz.hu: could not connect to host
-ideal-envelopes.co.uk: did not receive HSTS header
+idealinflatablehire.co.uk: did not receive HSTS header
idealmoto.com: did not receive HSTS header
idealmykonos.com: did not receive HSTS header
idealvenir.com: did not receive HSTS header
@@ -8484,7 +8880,6 @@ idemo.in: could not connect to host
identity-hash.online: could not connect to host
identitylabs.uk: could not connect to host
identitysandbox.gov: could not connect to host
-identitytheft.gov: did not receive HSTS header
idgsupply.com: did not receive HSTS header
idinby.dk: did not receive HSTS header
idiopolis.org: did not receive HSTS header
@@ -8492,10 +8887,11 @@ idisplay.es: could not connect to host
idlekernel.com: could not connect to host
idol-bikes.ru: could not connect to host
idolshop.dk: could not connect to host
-idolshop.me: did not receive HSTS header
+idolshop.me: could not connect to host
idontexist.me: could not connect to host
idsafe.co.za: could not connect to host
idsoccer.com: did not receive HSTS header
+idyl.fr: did not receive HSTS header
iec.pe: could not connect to host
ieedes.com: did not receive HSTS header
iemas.azurewebsites.net: did not receive HSTS header
@@ -8511,13 +8907,13 @@ ifad.org: did not receive HSTS header
ifamily.top: did not receive HSTS header
ifan.ch: could not connect to host
ifastuniversity.com: did not receive HSTS header
+ifcfg.jp: could not connect to host
ifcfg.me: could not connect to host
ifconfig.co: did not receive HSTS header
ifengge.cn: did not receive HSTS header
ifengge.me: did not receive HSTS header
ifleurs.com: could not connect to host
ifly.pw: could not connect to host
-ifreetion.cn: did not receive HSTS header
ifroheweihnachten.net: did not receive HSTS header
ifx.ee: could not connect to host
ifxnet.com: could not connect to host
@@ -8527,13 +8923,14 @@ igaryhe.io: did not receive HSTS header
igd.chat: could not connect to host
igforums.com: did not receive HSTS header
igi.codes: could not connect to host
+igiftcards.de: did not receive HSTS header
igiftcards.nl: did not receive HSTS header
ignatisd.gr: did not receive HSTS header
igule.net: could not connect to host
iha6.com: could not connect to host
ihatethissh.it: could not connect to host
-ihc.im: did not receive HSTS header
ihcr.top: did not receive HSTS header
+iheartmary.org: max-age too low: 604800
ihls.xyz: could not connect to host
ihongzu.com: could not connect to host
ihrlotto.de: could not connect to host
@@ -8546,10 +8943,12 @@ iideaz.org: could not connect to host
iilin.com: did not receive HSTS header
iispeed.com: did not receive HSTS header
ijn-dd.nl: could not connect to host
-ijoda.com: could not connect to host
+ijoda.com: did not receive HSTS header
ijr.com: did not receive HSTS header
ike.io: did not receive HSTS header
ikenmeyer.com: could not connect to host
+ikenmeyer.eu: could not connect to host
+ikiler.com: could not connect to host
ikocik.sk: could not connect to host
ikon.name: could not connect to host
ikudo.top: could not connect to host
@@ -8560,6 +8959,7 @@ ilbuongiorno.it: did not receive HSTS header
ildomani.it: did not receive HSTS header
ileat.com: could not connect to host
ilgi.work: could not connect to host
+iliasdeli.nl: did not receive HSTS header
ilii.me: could not connect to host
ilikerainbows.co: did not receive HSTS header
ilikerainbows.co.uk: could not connect to host
@@ -8572,12 +8972,13 @@ iluvscotland.co.uk: did not receive HSTS header
im-design.com.ua: did not receive HSTS header
imadalin.ro: could not connect to host
image.tf: could not connect to host
+imagecurl.com: could not connect to host
+imagecurl.org: could not connect to host
imagenesdedibujosalapizfacilesdehacer.com: could not connect to host
imaginarymakings.me: could not connect to host
imakepoems.net: could not connect to host
imanhearts.com: max-age too low: 0
imanudin.net: did not receive HSTS header
-imaple.org: could not connect to host
imbrian.org: could not connect to host
imed.com.pt: did not receive HSTS header
imed.pt: did not receive HSTS header
@@ -8588,7 +8989,6 @@ imgencrypt.com: could not connect to host
imgul.net: could not connect to host
imguoguo.com: could not connect to host
imim.pw: could not connect to host
-iminshell.com: could not connect to host
imjiangtao.com: did not receive HSTS header
imlinan.cn: could not connect to host
imlinan.com: could not connect to host
@@ -8597,10 +8997,12 @@ imlinan.net: could not connect to host
imlonghao.com: did not receive HSTS header
immanuel60.hu: did not receive HSTS header
immaternity.com: could not connect to host
+immersionwealth.com: could not connect to host
immersivewebportal.com: could not connect to host
immo-vk.de: did not receive HSTS header
immobiliarecapitani.com: did not receive HSTS header
immobilien-wallat.de: could not connect to host
+immobilier-nice.fr: could not connect to host
immoprotect.ca: did not receive HSTS header
immortals-co.com: did not receive HSTS header
immoverkauf24.at: did not receive HSTS header
@@ -8619,7 +9021,7 @@ immunicity.top: could not connect to host
immunicity.win: could not connect to host
immunicity.works: could not connect to host
immunicity.world: could not connect to host
-imoe.ac.cn: did not receive HSTS header
+imoe.ac.cn: could not connect to host
imolug.org: did not receive HSTS header
imoner.com: could not connect to host
imoner.ga: could not connect to host
@@ -8636,31 +9038,33 @@ imrejonk.nl: could not connect to host
imu.li: did not receive HSTS header
imusic.dk: did not receive HSTS header
imy.life: did not receive HSTS header
-imydl.com: could not connect to host
-imydl.tech: could not connect to host
+imydl.com: max-age too low: 2592000
inandeyes.com: did not receive HSTS header
inb4.us: could not connect to host
inbox.li: did not receive HSTS header
inboxen.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
incendiary-arts.com: could not connect to host
inceptionradionetwork.com: could not connect to host
+incestporn.tv: could not connect to host
inchomatic.com: did not receive HSTS header
increasetestosteronelevels.org: could not connect to host
inderagamono.net: could not connect to host
indesit-training.com: did not receive HSTS header
index-games.com: could not connect to host
indexyz.me: could not connect to host
+indianapolislocksmithinc.com: did not receive HSTS header
indiawise.co.uk: could not connect to host
indiecert.net: did not receive HSTS header
indieethos.com: did not receive HSTS header
indiemods.com: did not receive HSTS header
indien.guide: could not connect to host
+indigitalagency.com: could not connect to host
indilens.com: did not receive HSTS header
indiraactive.com: could not connect to host
indiroyunu.com: did not receive HSTS header
-indogerman.de: did not receive HSTS header
+indogerman.de: could not connect to host
indogermantrade.de: could not connect to host
-indoorplantsexpert.com: could not connect to host
+indoorplantsexpert.com: did not receive HSTS header
indoorskiassen.nl: did not receive HSTS header
indostar303.com: did not receive HSTS header
indredouglas.me: could not connect to host
@@ -8670,13 +9074,13 @@ industreiler.com.br: could not connect to host
industriasrenova.com: could not connect to host
industrybazar.com: did not receive HSTS header
ineed.com.mt: could not connect to host
-inetpub.cn: could not connect to host
inevitavelbrasil.com.br: could not connect to host
inexlog.fr: could not connect to host
inexpensivecomputers.net: could not connect to host
infcof.com: did not receive HSTS header
infilock.com: could not connect to host
infinether.net: could not connect to host
+infinite.hosting: did not receive HSTS header
infinitiofmarinparts.com: could not connect to host
infinitude.me.uk: could not connect to host
infinitude.xyz: could not connect to host
@@ -8686,14 +9090,17 @@ infinity-freedom.com: could not connect to host
infinity-freedom.de: could not connect to host
infinity-lifestyle.de: could not connect to host
infinity.to: could not connect to host
+infinityengine.org: could not connect to host
inflate-a-bubbles.co.uk: did not receive HSTS header
inflation.ml: could not connect to host
influencerchampions.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
influxus.com: could not connect to host
+infmed.com: could not connect to host
info-bay.com: could not connect to host
info-sys.tk: could not connect to host
infoamin.com: did not receive HSTS header
-infocoin.es: did not receive HSTS header
+infobalkans.com: did not receive HSTS header
+infocity-tech.fr: could not connect to host
infopagina.es: did not receive HSTS header
inforaga.com: could not connect to host
inforichjapan.com: did not receive HSTS header
@@ -8703,26 +9110,28 @@ informatik.zone: could not connect to host
infos-generation.com: did not receive HSTS header
infosec.rip: could not connect to host
infosimmo.com: did not receive HSTS header
-infosoph.org: could not connect to host
+infosoph.org: did not receive HSTS header
infotics.es: did not receive HSTS header
-infovae-idf.com: could not connect to host
+infovae-idf.com: did not receive HSTS header
infoworm.org: could not connect to host
infr.red: did not receive HSTS header
+infra.press: could not connect to host
infradio.am: could not connect to host
infranix.eu: max-age too low: 7360000
infura.co.th: could not connect to host
+ing-buero-junk.de: did not receive HSTS header
ing89.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
ing89.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
ingalabs.hu: could not connect to host
ingalls.run: could not connect to host
-ingenium.si: could not connect to host
+ingenium.si: did not receive HSTS header
ingesol.fr: did not receive HSTS header
ingresscode.cn: did not receive HSTS header
inhelix.com: could not connect to host
inhive.group: did not receive HSTS header
+initrd.net: could not connect to host
injapan.nl: could not connect to host
injertoshorticolas.com: did not receive HSTS header
-injigo.com: did not receive HSTS header
injust.cf: could not connect to host
injust.eu.org: could not connect to host
injust.ga: could not connect to host
@@ -8730,6 +9139,7 @@ injust.gq: could not connect to host
injust.me: could not connect to host
injust.ml: could not connect to host
injust.tk: could not connect to host
+inkbunny.net: could not connect to host
inked-guy.de: could not connect to host
inkedguy.de: could not connect to host
inkstory.gr: did not receive HSTS header
@@ -8738,6 +9148,7 @@ inku.ovh: did not receive HSTS header
inkvisual.tk: could not connect to host
inleaked.com: could not connect to host
inme.ga: did not receive HSTS header
+inmoodforsex.com: could not connect to host
innerform.com: could not connect to host
innit.be: could not connect to host
innobatics.com: did not receive HSTS header
@@ -8748,21 +9159,19 @@ innovativeideaz.org: could not connect to host
innoventure.de: could not connect to host
inondation.ch: could not connect to host
inorder.website: could not connect to host
+inovat.ma: did not receive HSTS header
inovatec.com: did not receive HSTS header
-inox.io: could not connect to host
+inox.io: did not receive HSTS header
inoxio.com: did not receive HSTS header
inoxio.de: did not receive HSTS header
inplacers.ru: did not receive HSTS header
-inquisitive.io: did not receive HSTS header
+inquisitive.io: could not connect to host
insane-bullets.com: could not connect to host
insane.zone: could not connect to host
inschrijfformulier.com: could not connect to host
-inscript.pl: did not receive HSTS header
+inscript.pl: could not connect to host
insideofgaming.de: could not connect to host
-insighti.com: could not connect to host
-insighti.eu: could not connect to host
-insighti.org: could not connect to host
-insighti.sk: could not connect to host
+insightera.co.th: did not receive HSTS header
insite-feedback.com: could not connect to host
insouciant.org: could not connect to host
inspirationalquotesuk.co.uk: could not connect to host
@@ -8780,11 +9189,13 @@ instantluxe.co.uk: could not connect to host
instantluxe.com: could not connect to host
instantluxe.de: could not connect to host
instantluxe.it: could not connect to host
-instantsubs.de: did not receive HSTS header
+instantsubs.de: could not connect to host
instaquiz.ru: could not connect to host
instasex.ch: could not connect to host
instawi.com: could not connect to host
+instinctive.io: did not receive HSTS header
institutoflordelavida.com: could not connect to host
+institutolancaster.com: could not connect to host
institutulcultural.ro: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
instruktor.io: could not connect to host
insurance: could not connect to host
@@ -8797,14 +9208,13 @@ integrationinc.com: did not receive HSTS header
integraxor.com.tw: did not receive HSTS header
integrityingovernmentidaho.com: could not connect to host
intel.gov: did not receive HSTS header
-intel.li: could not connect to host
+intel.li: did not receive HSTS header
intelbet.es: did not receive HSTS header
intelbet.ro: did not receive HSTS header
intelhost.net: max-age too low: 0
intelldynamics.com: could not connect to host
intelliance.eu: did not receive HSTS header
interabbit.co: could not connect to host
-interabbit.com: could not connect to host
interboursegeneva.ch: did not receive HSTS header
interchanges.io: max-age too low: 0
interference.io: did not receive HSTS header
@@ -8814,9 +9224,11 @@ intergenx.co.uk: could not connect to host
intergenx.com: could not connect to host
intergenx.org: could not connect to host
intergenx.org.uk: could not connect to host
+interguard.net: could not connect to host
interhosts.co.za: could not connect to host
interim-cto.de: could not connect to host
interiorcheapo.com: could not connect to host
+interiordesignsconcept.com: could not connect to host
interiortradingco.com.au: could not connect to host
interleucina.org: did not receive HSTS header
interlocal.co.uk: did not receive HSTS header
@@ -8836,25 +9248,28 @@ internshipandwork.com: did not receive HSTS header
internshipandwork.ru: did not receive HSTS header
interociter-enterprises.com: could not connect to host
intersectraven.net: did not receive HSTS header
+interserved.com: max-age too low: 0
interspot.nl: could not connect to host
-interstellarhyperdrive.com: did not receive HSTS header
+interstellarhyperdrive.com: could not connect to host
interviewpipeline.co.uk: could not connect to host
-intervisteperstrada.com: did not receive HSTS header
+intervisteperstrada.com: could not connect to host
intexplore.org: could not connect to host
intim-uslugi-kazan.net: could not connect to host
intimastoreatacado.com.br: could not connect to host
intimateperrierjouet.com: could not connect to host
intimici.com.br: could not connect to host
intimtoy.com.ua: could not connect to host
-into.technology: could not connect to host
intracom.com: did not receive HSTS header
intranetsec.fr: could not connect to host
intreaba.xyz: could not connect to host
+intrigue3d.com: could not connect to host
introverted.ninja: did not receive HSTS header
introvertedtravel.space: max-age too low: 0
+intune.life: could not connect to host
invenio.software: could not connect to host
inventoryexpress.xyz: could not connect to host
inverselink.com: could not connect to host
+inversioneseconomicas.com: could not connect to host
investcountry.com: did not receive HSTS header
investingdiary.cn: could not connect to host
investingtrader.net: could not connect to host
@@ -8875,6 +9290,7 @@ ioiart.eu: could not connect to host
iolife.dk: could not connect to host
ionas-law.ro: did not receive HSTS header
ionc.ca: could not connect to host
+ionicisere.com: did not receive HSTS header
ionote.me: could not connect to host
iop.intuit.com: max-age too low: 86400
iora.fr: could not connect to host
@@ -8889,7 +9305,7 @@ ipawind.com: did not receive HSTS header
ipbill.org.uk: could not connect to host
ipcfg.me: could not connect to host
ipfp.pl: did not receive HSTS header
-iphonechina.net: could not connect to host
+iphonechina.net: did not receive HSTS header
iphoneportfolioapp.com: did not receive HSTS header
ipid.me: could not connect to host
iplabs.de: did not receive HSTS header
@@ -8911,7 +9327,7 @@ ipstoragesolutions.com: did not receive HSTS header
iptel.ro: could not connect to host
iptvmakedonija.mk: did not receive HSTS header
ipuservicedesign.com: could not connect to host
-ipv6.watch: did not receive HSTS header
+ipv6.watch: could not connect to host
ipv6cloud.club: could not connect to host
ipv6demo.de: could not connect to host
ipv6only.network: could not connect to host
@@ -8936,9 +9352,9 @@ irische-segenswuensche.info: could not connect to host
irisdina.de: could not connect to host
irishmusic.nu: did not receive HSTS header
irland.guide: could not connect to host
-irmtrudjurke.de: did not receive HSTS header
-irodorinet.com: max-age too low: 0
+irmtrudjurke.de: could not connect to host
iron-guard.net: did not receive HSTS header
+ironbelly.pro: could not connect to host
irondaleirregulars.com: did not receive HSTS header
irstaxforumsonline.com: did not receive HSTS header
irugs.ch: did not receive HSTS header
@@ -8948,19 +9364,18 @@ irukandjilabs.com: could not connect to host
irun-telecom.co.uk: could not connect to host
irvinepa.org: max-age too low: 10540800
is-a-furry.org: did not receive HSTS header
-isaac.world: could not connect to host
isaackabel.cf: could not connect to host
isaackabel.ga: could not connect to host
isaackabel.gq: could not connect to host
isaackabel.ml: could not connect to host
isaackabel.tk: could not connect to host
-isaacmorneau.com: could not connect to host
ischool.co.jp: did not receive HSTS header
isdecolaop.nl: could not connect to host
isdf.me: could not connect to host
isdown.cz: could not connect to host
isef-eg.com: did not receive HSTS header
-iserv.fr: did not receive HSTS header
+iserv.fr: could not connect to host
+iseulde.com: could not connect to host
isfff.com: could not connect to host
isfriday.com: could not connect to host
ishadowsocks.ltd: could not connect to host
@@ -8974,6 +9389,7 @@ isitnuclearwaryet.com: could not connect to host
iskai.net: did not receive HSTS header
iskkk.com: could not connect to host
iskkk.net: could not connect to host
+islamonline.net: did not receive HSTS header
islandinthenet.com: did not receive HSTS header
islandlakeil.gov: could not connect to host
islandoilsupply.com: max-age too low: 300
@@ -8981,10 +9397,10 @@ islandpumpandtank.com: did not receive HSTS header
islandzero.net: could not connect to host
islazia.fr: did not receive HSTS header
isntall.us: did not receive HSTS header
-isocom.eu: did not receive HSTS header
isoface33.fr: did not receive HSTS header
isogen5.com: could not connect to host
isogram.nl: did not receive HSTS header
+isondo.com: could not connect to host
isoroc-nidzica.pl: could not connect to host
ispringcloud.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
ispweb.es: did not receive HSTS header
@@ -8998,14 +9414,13 @@ istgame.com: did not receive HSTS header
isthefieldcontrolsystemdown.com: could not connect to host
istherrienstillcoach.com: could not connect to host
isthisus.org: could not connect to host
-isv.online: did not receive HSTS header
-iszy.me: did not receive HSTS header
+iszy.me: could not connect to host
it-cave.com: could not connect to host
it-enthusiasts.tech: could not connect to host
it-go.net: did not receive HSTS header
-it-kron.de: did not receive HSTS header
it-labor.info: did not receive HSTS header
it-schwerin.de: could not connect to host
+it-world.eu: could not connect to host
itad.top: could not connect to host
itblog.pp.ua: could not connect to host
itbrief.co.nz: did not receive HSTS header
@@ -9022,6 +9437,7 @@ iterasoft.de: did not receive HSTS header
itfaq.nl: did not receive HSTS header
itfensi.net: could not connect to host
itforcc.com: did not receive HSTS header
+itgirls.rs: could not connect to host
ithakama.com: could not connect to host
itinsight.hu: did not receive HSTS header
itiomassagem.com.br: did not receive HSTS header
@@ -9033,19 +9449,18 @@ itos.asia: did not receive HSTS header
itos.pl: did not receive HSTS header
itpol.dk: did not receive HSTS header
itpro-mg.de: could not connect to host
-itproject.guru: did not receive HSTS header
+itproject.guru: could not connect to host
itrack.in.th: could not connect to host
itriskltd.com: did not receive HSTS header
its-schindler.de: could not connect to host
its-v.de: could not connect to host
-its4living.com: could not connect to host
itsadog.co.uk: did not receive HSTS header
itsagadget.com: did not receive HSTS header
itsamurai.ru: max-age too low: 2592000
itsatrap.nl: could not connect to host
itsecurityassurance.pw: could not connect to host
itsg-faq.de: could not connect to host
-itshka.rv.ua: max-age too low: 604800
+itshka.rv.ua: could not connect to host
itshost.ru: could not connect to host
itskayla.com: did not receive HSTS header
itsmejohn.org: could not connect to host
@@ -9057,13 +9472,17 @@ ius.io: did not receive HSTS header
iuscommunity.org: did not receive HSTS header
ivanilla.org: could not connect to host
ivanpolchenko.com: could not connect to host
-ivi-co.com: could not connect to host
+ivi-co.com: max-age too low: 0
ivi-fertilite.fr: max-age too low: 0
ivi-fertility.com: max-age too low: 0
ivi-fruchtbarkeit.de: max-age too low: 0
-ivi.com.pa: could not connect to host
+ivi.com.ar: did not receive HSTS header
+ivi.com.pa: max-age too low: 0
+ivi.es: did not receive HSTS header
+ivi.mx: could not connect to host
ivi.net.br: max-age too low: 0
-ivi.pt: could not connect to host
+ivi.pt: max-age too low: 0
+ivinet.cl: did not receive HSTS header
ivitalia.it: max-age too low: 0
ivk.website: could not connect to host
ivklombard.ru: did not receive HSTS header
@@ -9080,6 +9499,8 @@ ix8.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAI
ixec2.tk: could not connect to host
ixh.me: did not receive HSTS header
ixio.cz: could not connect to host
+iyoumu.top: could not connect to host
+izaakbeekman.com: max-age too low: 2592000
izdiwho.com: could not connect to host
izolight.ch: could not connect to host
izonemart.com: did not receive HSTS header
@@ -9097,17 +9518,21 @@ j2ee.cz: could not connect to host
j8y.de: did not receive HSTS header
ja-publications.agency: did not receive HSTS header
ja-publications.com: did not receive HSTS header
+ja.md: did not receive HSTS header
jaan.su: could not connect to host
jaaxypro.com: could not connect to host
+jabba.homelinux.org: could not connect to host
+jabbas.eu: could not connect to host
jability.ovh: could not connect to host
+jack2celebrities.com: could not connect to host
jackalworks.com: could not connect to host
jackdoan.com: did not receive HSTS header
jackfahnestock.com: could not connect to host
jackops.com: could not connect to host
jackrusselterrier.com.br: could not connect to host
-jackyyf.com: could not connect to host
jaco.by: could not connect to host
jacobparry.ca: did not receive HSTS header
+jacobphono.com: could not connect to host
jacobsenarquitetura.com: max-age too low: 5184000
jadara.info: could not connect to host
jaepinformatica.com: did not receive HSTS header
@@ -9116,10 +9541,9 @@ jahliveradio.com: did not receive HSTS header
jaimechanaga.com: could not connect to host
jaion.ml: could not connect to host
jaion.tech: could not connect to host
+jak-na-les.cz: did not receive HSTS header
jakenbake.com: could not connect to host
jakeslab.tech: could not connect to host
-jaketremper.com: could not connect to host
-jakewalker.xyz: did not receive HSTS header
jakincode.army: could not connect to host
jaksel.id: could not connect to host
jaksi.io: could not connect to host
@@ -9149,37 +9573,40 @@ jameshale.me: did not receive HSTS header
jamesheald.com: could not connect to host
jamesl.ml: could not connect to host
jamesmaurer.com: did not receive HSTS header
-jamesmorrison.me: did not receive HSTS header
jamesrains.com: could not connect to host
jami.am: max-age too low: 0
jamiepeters.nl: did not receive HSTS header
+jamjestsimon.pl: could not connect to host
jamourtney.com: could not connect to host
jamyeprice.com: did not receive HSTS header
jan-cermak.cz: did not receive HSTS header
jan-daniels.de: did not receive HSTS header
jan27.org: did not receive HSTS header
janario.me: could not connect to host
+janduchene.ch: could not connect to host
janebondsurety.com: did not receive HSTS header
jangho.me: could not connect to host
janheidler.dynv6.net: could not connect to host
janking.de: could not connect to host
janmachynka.cz: could not connect to host
-janmg.com: could not connect to host
+janmg.com: did not receive HSTS header
janosh.com: did not receive HSTS header
janssen.fm: could not connect to host
-janssenwigman.nl: did not receive HSTS header
+janssenwigman.nl: could not connect to host
janus-engineering.de: did not receive HSTS header
janverlaan.nl: did not receive HSTS header
jap-nope.de: did not receive HSTS header
japan4you.org: could not connect to host
japanbaths.com: did not receive HSTS header
-japaneseemoticons.org: could not connect to host
+japaneseemoticons.org: did not receive HSTS header
japanesenames.biz: did not receive HSTS header
+japansm.com: could not connect to host
japanwide.net: did not receive HSTS header
japaripark.com: could not connect to host
jape.today: could not connect to host
japlex.com: could not connect to host
jaqen.ch: could not connect to host
+jardinderline.ch: could not connect to host
jardins-utopie.net: could not connect to host
jaredbates.net: did not receive HSTS header
jarivisual.com: could not connect to host
@@ -9187,7 +9614,6 @@ jarl.ninja: could not connect to host
jarnail.ca: could not connect to host
jaroslavc.eu: could not connect to host
jaroslavtrsek.cz: did not receive HSTS header
-jarrettgraham.com: could not connect to host
jarrodcastaing.com: did not receive HSTS header
jarrodcastaing.com.au: did not receive HSTS header
jarsater.com: could not connect to host
@@ -9201,6 +9627,7 @@ jasonrobinson.me: [Exception... "Component returned failure code: 0x80004005 (NS
jasonroe.me: did not receive HSTS header
jasonsansone.com: could not connect to host
jasonwindholz.com: could not connect to host
+jasperhammink.com: did not receive HSTS header
jastoria.pl: did not receive HSTS header
jastrow.me: did not receive HSTS header
jateng.press: could not connect to host
@@ -9210,6 +9637,7 @@ javachip.win: could not connect to host
javan.ga: did not receive HSTS header
javascriptlab.fr: could not connect to host
javelinsms.com: could not connect to host
+javfree.me: could not connect to host
javiermixdjs.com: did not receive HSTS header
javik.net: did not receive HSTS header
javilacat.info: could not connect to host
@@ -9219,10 +9647,11 @@ jaxageto.de: did not receive HSTS header
jayblock.com: did not receive HSTS header
jayharris.ca: could not connect to host
jaylen.com.ar: did not receive HSTS header
-jayna.design: did not receive HSTS header
+jayna.design: could not connect to host
jayschulman.com: did not receive HSTS header
jayscoaching.com: could not connect to host
jayshao.com: did not receive HSTS header
+jazzfeet.co.uk: could not connect to host
jazzinutrecht.info: could not connect to host
jballelectronics.com: did not receive HSTS header
jbelien.be: did not receive HSTS header
@@ -9249,19 +9678,21 @@ jdcdirectsales.com.ph: could not connect to host
jdfk.net: could not connect to host
jdgonzalez95.com: could not connect to host
jdh8.org: did not receive HSTS header
+jdieselmusic.com: did not receive HSTS header
jdsf.tk: could not connect to host
jean-remy.ch: could not connect to host
jebengotai.com: did not receive HSTS header
-jedayoshi.me: could not connect to host
+jedayoshi.me: did not receive HSTS header
jedayoshi.tk: could not connect to host
jeepmafia.com: did not receive HSTS header
jeff.is: could not connect to host
jeff393.com: could not connect to host
jeffanderson.me: did not receive HSTS header
+jeffcasavant.com: did not receive HSTS header
jeffersonregan.org: could not connect to host
jeffhuxley.com: could not connect to host
jeffreymagee.com: did not receive HSTS header
-jehovahsays.net: could not connect to host
+jefrydco.id: could not connect to host
jeil-makes.co.kr: could not connect to host
jelewa.de: did not receive HSTS header
jellow.nl: did not receive HSTS header
@@ -9271,6 +9702,7 @@ jenjoit.de: could not connect to host
jennedebleser.com: did not receive HSTS header
jenniferchan.id.au: could not connect to host
jennifercherniack.com: did not receive HSTS header
+jennifermason.eu: could not connect to host
jennybeaned.com: did not receive HSTS header
jens-prangenberg.de: did not receive HSTS header
jens.hk: could not connect to host
@@ -9278,8 +9710,7 @@ jensenbanden.no: could not connect to host
jenssen.org: did not receive HSTS header
jeparamedia.com: did not receive HSTS header
jeremye77.com: did not receive HSTS header
-jeremymade.com: did not receive HSTS header
-jeremyness.com: could not connect to host
+jeremymade.com: could not connect to host
jeremywagner.me: did not receive HSTS header
jermann.biz: did not receive HSTS header
jeroenensanne.wedding: could not connect to host
@@ -9299,11 +9730,13 @@ jetmirshatri.com: did not receive HSTS header
jeton.com: did not receive HSTS header
jetsetcharge.com: could not connect to host
jetsetpay.com: could not connect to host
+jettravel.com.mt: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
jettshome.org: could not connect to host
jetzt-elektromobil.de: could not connect to host
jevisite.ca: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
jewellerydesignstore.com: could not connect to host
jewellerymarvels.com: did not receive HSTS header
+jexler.net: could not connect to host
jez.nl: could not connect to host
jf-fotos.de: could not connect to host
jfmel.com: did not receive HSTS header
@@ -9359,16 +9792,24 @@ jka.io: did not receive HSTS header
jkb.pics: could not connect to host
jkbuster.com: could not connect to host
jkest.cc: could not connect to host
+jkirsche.com: max-age too low: 0
jkng.eu: could not connect to host
jko.works: could not connect to host
jkuvw.xyz: could not connect to host
jkyuan.tk: could not connect to host
+jl-dns.eu: could not connect to host
+jl-dns.nl: could not connect to host
+jl-exchange.nl: could not connect to host
+jl-mail.nl: could not connect to host
jldp.org: did not receive HSTS header
jlhmedia.com: did not receive HSTS header
jlot.org: did not receive HSTS header
+jlpn.eu: could not connect to host
+jlpn.nl: could not connect to host
jm06.com: did not receive HSTS header
jm22.com: could not connect to host
jmb.lc: could not connect to host
+jmoreau.ddns.net: could not connect to host
jmotion.co.uk: did not receive HSTS header
jmpmotorsport.co.uk: did not receive HSTS header
jmvbmx.ch: could not connect to host
@@ -9378,7 +9819,9 @@ jncde.de: did not receive HSTS header
jncie.de: did not receive HSTS header
jncie.eu: did not receive HSTS header
jncip.de: did not receive HSTS header
+joacimeldre.com: did not receive HSTS header
joakimalgroy.com: could not connect to host
+joaquimgoliveira.pt: did not receive HSTS header
job-offer.de: could not connect to host
jobers.ch: did not receive HSTS header
jobers.pt: did not receive HSTS header
@@ -9386,6 +9829,7 @@ jobflyapp.com: could not connect to host
jobmedic.com: could not connect to host
jobmob.co.il: did not receive HSTS header
jobshq.com: did not receive HSTS header
+jobsnet.eu: could not connect to host
jobss.co.uk: could not connect to host
jobtestprep.de: max-age too low: 0
jobtestprep.dk: max-age too low: 0
@@ -9401,7 +9845,9 @@ joecod.es: could not connect to host
joefixit.co.uk: could not connect to host
joelgonewild.com: did not receive HSTS header
joerg-wellpott.de: did not receive HSTS header
+joerosca.com: could not connect to host
joetyson.io: could not connect to host
+joeyfelix.com: could not connect to host
joeyvilaro.com: could not connect to host
johand.io: could not connect to host
johannaojanen.com: could not connect to host
@@ -9411,13 +9857,14 @@ johnbrownphotography.ch: did not receive HSTS header
johncardell.com: did not receive HSTS header
johners.me: could not connect to host
johngaltgroup.com: did not receive HSTS header
-johngo.tk: did not receive HSTS header
johnmorganpartnership.co.uk: did not receive HSTS header
johnrom.com: could not connect to host
+johnsanchez.io: could not connect to host
johntomasowa.com: could not connect to host
johnverkerk.com: could not connect to host
joinamericacorps.gov: could not connect to host
jointoweb.com: could not connect to host
+joker.menu: could not connect to host
jomp16.tk: did not receive HSTS header
jonarcher.info: did not receive HSTS header
jonas-keidel.de: did not receive HSTS header
@@ -9426,7 +9873,6 @@ jonathan-apps.com: could not connect to host
jonathan.ir: could not connect to host
jonathandowning.uk: did not receive HSTS header
jonathanmassacand.ch: could not connect to host
-jonathanreyes.com: did not receive HSTS header
jonathansanchez.pro: could not connect to host
jonesopolis.xyz: could not connect to host
jonferwerda.net: could not connect to host
@@ -9437,9 +9883,10 @@ jonnichols.info: could not connect to host
jonsno.ws: could not connect to host
joostbovee.nl: could not connect to host
jooto.com: did not receive HSTS header
-jopl.org: could not connect to host
+jopl.org: did not receive HSTS header
jordankirby.co.uk: could not connect to host
jordanp.engineer: could not connect to host
+jordanscorporatelaw.com: could not connect to host
jordanstrustcompany.cn: could not connect to host
jordanstrustcompany.ru: could not connect to host
jordikroon.nl: could not connect to host
@@ -9453,8 +9900,8 @@ jose.eti.br: did not receive HSTS header
joseaveleira.es: did not receive HSTS header
josecage.com: could not connect to host
josegerber.ch: did not receive HSTS header
-josemikkola.fi: could not connect to host
josericaurte.com: could not connect to host
+joshhoffer.com: could not connect to host
joshi.su: could not connect to host
joshplant.co.uk: could not connect to host
joshstroup.me: could not connect to host
@@ -9468,17 +9915,19 @@ joworld.net: could not connect to host
joyceclerkx.com: could not connect to host
joyceseamone.com: did not receive HSTS header
joyjohnston.ca: did not receive HSTS header
-joyqi.com: did not receive HSTS header
jpaglier.com: could not connect to host
jpbike.cz: could not connect to host
jpcrochetapparel.com: could not connect to host
jpeaches.xyz: could not connect to host
+jpgangbang.com: could not connect to host
jproxx.com: did not receive HSTS header
jptun.com: could not connect to host
-jrchaseify.xyz: could not connect to host
+jreinert.com: could not connect to host
jrgold.me: could not connect to host
+jrlopezoficial.com: could not connect to host
jrmd.io: could not connect to host
jrvar.com: could not connect to host
+js3311.com: could not connect to host
js88.sg: could not connect to host
js93029.com: could not connect to host
jsanders.us: did not receive HSTS header
@@ -9487,17 +9936,14 @@ jsbevents.nl: could not connect to host
jsblights.nl: could not connect to host
jsc7776.com: could not connect to host
jsdelivr.net: could not connect to host
-jsevilleja.org: could not connect to host
jsg-technologies.de: did not receive HSTS header
jsjyhzy.cc: could not connect to host
-jslidong.top: did not receive HSTS header
+jslidong.top: could not connect to host
json-viewer.com: did not receive HSTS header
+jss.moe: did not receive HSTS header
jstelecom.com.br: did not receive HSTS header
-jstore.ch: could not connect to host
jsuse.xyz: could not connect to host
-jsvr.tk: did not receive HSTS header
jsxc.ch: could not connect to host
-jtcjewelry.com: could not connect to host
ju1ro.de: could not connect to host
jualautoclave.com: did not receive HSTS header
jualssh.com: could not connect to host
@@ -9505,7 +9951,8 @@ juandesouza.com: did not receive HSTS header
juanhub.com: did not receive HSTS header
jubee.nl: did not receive HSTS header
juchheim-methode.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-jucktehkeinen.de: did not receive HSTS header
+judytka.cz: could not connect to host
+juelda.com: did not receive HSTS header
juiced.gs: did not receive HSTS header
juka.pp.ua: could not connect to host
juku-info.top: did not receive HSTS header
@@ -9520,17 +9967,17 @@ juliawebber.co.za: could not connect to host
julido.de: did not receive HSTS header
julio.jamil.nom.br: could not connect to host
juliohernandezgt.com: could not connect to host
-jullensgroningen.com: did not receive HSTS header
jumba.com.au: did not receive HSTS header
jumbopan.com: could not connect to host
jumbox.xyz: could not connect to host
jumbster.com: could not connect to host
jumparoundreading.co.uk: did not receive HSTS header
+jumperoos.co.uk: could not connect to host
jumping-duck.com: could not connect to host
jumpman-iphone-design.de: could not connect to host
junaos.com: did not receive HSTS header
junaos.xyz: did not receive HSTS header
-junctioncitywisconsin.gov: could not connect to host
+junctioncitywisconsin.gov: did not receive HSTS header
jundimax.com.br: could not connect to host
junge-selbsthilfe.info: could not connect to host
jungleculture.co.za: did not receive HSTS header
@@ -9538,7 +9985,6 @@ junglegoat.xyz: did not receive HSTS header
juniwalk.cz: could not connect to host
junjhome.com: could not connect to host
junjung.me: could not connect to host
-junoaroma.com: could not connect to host
junqtion.com: could not connect to host
jupp0r.de: did not receive HSTS header
juridiqueo.com: did not receive HSTS header
@@ -9546,6 +9992,7 @@ juristas.com.br: max-age too low: 0
juristeo.com: did not receive HSTS header
jurke.com: did not receive HSTS header
jurko.cz: could not connect to host
+just-a-clanpage.de: could not connect to host
just-english.online: did not receive HSTS header
just-pools.co.za: could not connect to host
just2trade.com: did not receive HSTS header
@@ -9556,12 +10003,12 @@ justinellingwood.com: could not connect to host
justinlemay.com: could not connect to host
justinrudio.com: did not receive HSTS header
justlikethat.hosting: did not receive HSTS header
-justmy.website: did not receive HSTS header
+justmy.website: could not connect to host
justnaw.co.uk: could not connect to host
+justtalk.site: could not connect to host
justudin.com: did not receive HSTS header
justwood.cz: did not receive HSTS header
justzz.xyz: could not connect to host
-jutella.de: did not receive HSTS header
juul.xyz: could not connect to host
juventusclublugano.ch: did not receive HSTS header
juventusmania1897.com: could not connect to host
@@ -9573,18 +10020,22 @@ jvoice.net: could not connect to host
jwallet.cc: did not receive HSTS header
jwilsson.me: could not connect to host
jwolt-lx.com: could not connect to host
+jwsoft.nl: could not connect to host
jysperm.me: did not receive HSTS header
jzachpearson.com: max-age too low: 0
jzcapital.co: could not connect to host
+jzgj088.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
jznet.org: could not connect to host
k-dev.de: could not connect to host
k-rickroll-g.pw: could not connect to host
+k-scr.me: could not connect to host
k-wallet.com: could not connect to host
k1cp.com: could not connect to host
k3508.com: could not connect to host
k38.cc: could not connect to host
ka-clan.com: could not connect to host
kaanduman.com: could not connect to host
+kaany.io: could not connect to host
kaasbijwijn.nl: did not receive HSTS header
kaashosting.nl: did not receive HSTS header
kabinapp.com: did not receive HSTS header
@@ -9616,6 +10067,7 @@ kaleidoskop-freiburg.de: did not receive HSTS header
kalender.goip.de: could not connect to host
kalilinux.tech: could not connect to host
kaloix.de: could not connect to host
+kalsbouncies.com: could not connect to host
kamalame.co: could not connect to host
kamatajisyaku.tokyo.jp: did not receive HSTS header
kambodja.guide: could not connect to host
@@ -9641,6 +10093,7 @@ kanr.in: could not connect to host
kanscooking.org: could not connect to host
kantorad.io: could not connect to host
kantv1.com: could not connect to host
+kanzlei-myca.de: did not receive HSTS header
kanzlei-wirtschaftsrecht.berlin: max-age too low: 600000
kanzshop.com: could not connect to host
kaohub.com: could not connect to host
@@ -9648,27 +10101,29 @@ kaomojis.net: did not receive HSTS header
kaotik4266.com: could not connect to host
kapiorr.duckdns.org: could not connect to host
kaplatz.is: could not connect to host
+kaplatzis.com: could not connect to host
kapo.info: did not receive HSTS header
kappit.dk: could not connect to host
kapucini.si: max-age too low: 0
kaputt.com: could not connect to host
kapverde.guide: could not connect to host
+kara-fabian.com: could not connect to host
+kara-fabian.de: could not connect to host
karaface.com: could not connect to host
karamna.com: could not connect to host
karanastic.com: did not receive HSTS header
karanlyons.com: could not connect to host
karaoketonight.com: could not connect to host
-karatekit.co.uk: could not connect to host
-karatorian.org: could not connect to host
+karatorian.org: did not receive HSTS header
karenledger.ca: did not receive HSTS header
karjala-ski.ru: could not connect to host
-karlis-kavacis.id.lv: could not connect to host
+karlis-kavacis.id.lv: did not receive HSTS header
karloskontana.tk: could not connect to host
karlproctor.co.uk: could not connect to host
karpanhellas.com: could not connect to host
-karting34.com: did not receive HSTS header
+kartatopia.com: could not connect to host
+karting34.com: could not connect to host
karuneshjohri.com: could not connect to host
-kasadara.com: did not receive HSTS header
kashdash.ca: could not connect to host
kashis.com.au: max-age too low: 0
kastemperaturen.ga: could not connect to host
@@ -9681,7 +10136,7 @@ katiaetdavid.fr: could not connect to host
katja-nikolic-design.de: could not connect to host
katoju.co.jp: could not connect to host
katproxy.al: did not receive HSTS header
-katproxy.online: could not connect to host
+katproxy.online: did not receive HSTS header
katproxy.site: could not connect to host
katproxy.tech: could not connect to host
katproxy.top: could not connect to host
@@ -9706,11 +10161,9 @@ kaydan.io: could not connect to host
kayipmurekkep.com: could not connect to host
kayleen.net: could not connect to host
kayon.cf: could not connect to host
-kaysis.gov.tr: did not receive HSTS header
kazamasion.com: could not connect to host
kazanasolutions.de: could not connect to host
kazenojiyu.fr: did not receive HSTS header
-kb88.com: could not connect to host
kbfl.org: could not connect to host
kcluster.io: could not connect to host
kcptun.com: could not connect to host
@@ -9722,6 +10175,8 @@ kearney.io: could not connect to host
kediri.win: could not connect to host
keditor.biz: could not connect to host
keechain.io: could not connect to host
+keeckee.ga: could not connect to host
+keeckee.ml: could not connect to host
keeley.gq: could not connect to host
keeley.ml: could not connect to host
keeleysam.me: could not connect to host
@@ -9739,6 +10194,7 @@ kein-fidget-spinner-werden.de: could not connect to host
kejar.id: did not receive HSTS header
kejibot.com: could not connect to host
kekehouse.net: could not connect to host
+kekgame.com: did not receive HSTS header
kellyandantony.com: could not connect to host
kelm.me: could not connect to host
kelmarsafety.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -9756,22 +10212,24 @@ kenman.dk: max-age too low: 2592000
kennedy.ie: could not connect to host
kensparkesphotography.com: did not receive HSTS header
kentacademiestrust.org.uk: did not receive HSTS header
+kenx5.eu.org: could not connect to host
kepler-seminar.de: did not receive HSTS header
kerangalam.com: did not receive HSTS header
-kerem.xyz: could not connect to host
+kerem.xyz: did not receive HSTS header
kerksanders.nl: could not connect to host
kermadec.blog: could not connect to host
kernelmode.io: did not receive HSTS header
kernl.us: did not receive HSTS header
kersbergen.nl: did not receive HSTS header
kersmexico.com: could not connect to host
-kescher.site: could not connect to host
keshausconsulting.com: could not connect to host
keskeces.com: did not receive HSTS header
kessel-runners.com: could not connect to host
kesteren.com: could not connect to host
+kevinbowers.me: could not connect to host
kevindekoninck.com: could not connect to host
kevinheslinphoto.com: did not receive HSTS header
+kevinhill.nl: could not connect to host
kevinmoreland.com: could not connect to host
kevinroebert.de: did not receive HSTS header
kevlar.pw: did not receive HSTS header
@@ -9786,6 +10244,7 @@ kgb.us: did not receive HSTS header
kgregorczyk.pl: could not connect to host
kgxtech.com: max-age too low: 2592000
khaganat.net: did not receive HSTS header
+khlee.net: did not receive HSTS header
khmath.com: did not receive HSTS header
khosla.uk: could not connect to host
ki-on.net: did not receive HSTS header
@@ -9801,21 +10260,21 @@ kiddies.academy: did not receive HSTS header
kiddieschristianacademy.co.za: did not receive HSTS header
kidkat.cn: could not connect to host
kiedys.net: could not connect to host
+kiel-kind.de: could not connect to host
kiel-media.de: did not receive HSTS header
kielderweather.org.uk: did not receive HSTS header
kielwi.gov: could not connect to host
kienlen.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-kieran.ie: could not connect to host
-kieranjones.uk: could not connect to host
kieranweightman.me: could not connect to host
kiesuwcursus.nl: did not receive HSTS header
kievradio.com: could not connect to host
+kiisu.club: could not connect to host
kikimilyatacado.com.br: could not connect to host
kikuzuki.org: could not connect to host
kiladera.be: did not receive HSTS header
kilerd.me: could not connect to host
kill-paff.com: did not receive HSTS header
-killerit.in: could not connect to host
+kimamass.com: could not connect to host
kimana.pe: could not connect to host
kimberg.co.uk: did not receive HSTS header
kimberlybeautysoapcompany.com: did not receive HSTS header
@@ -9841,13 +10300,13 @@ kingmanhall.org: could not connect to host
kingpincages.com: could not connect to host
kingqueen.org.uk: did not receive HSTS header
kinkdr.com: could not connect to host
-kinmunity.com: did not receive HSTS header
kinnettmemorial.org: did not receive HSTS header
+kinnikinnick.com: did not receive HSTS header
kinnon.enterprises: could not connect to host
kinow.com: did not receive HSTS header
kinsmenhomelottery.com: did not receive HSTS header
kintoandar.com: max-age too low: 0
-kintrip.com: could not connect to host
+kintrip.com: did not receive HSTS header
kintzingerfilm.de: did not receive HSTS header
kionetworks.com: did not receive HSTS header
kipin.fr: did not receive HSTS header
@@ -9856,17 +10315,19 @@ kipriakipita.gr: could not connect to host
kiraboshi.xyz: could not connect to host
kirainmoe.com: did not receive HSTS header
kirara.eu: could not connect to host
-kirillpokrovsky.de: could not connect to host
-kirito.kr: did not receive HSTS header
+kirche-dortmund-ost.de: max-age too low: 86400
+kirill.ws: could not connect to host
+kirito.kr: could not connect to host
kirkforsenate.com: could not connect to host
kirkpatrickdavis.com: could not connect to host
kis-toitoidixi.de: could not connect to host
kisa.io: could not connect to host
+kisalt.im: could not connect to host
kiss-register.org: could not connect to host
kissart.net: could not connect to host
kissesb.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
kissesb.net: could not connect to host
-kissoft.ro: could not connect to host
+kisskiss.ch: could not connect to host
kisstube.tv: could not connect to host
kisstyle.ru: did not receive HSTS header
kita.id: did not receive HSTS header
@@ -9882,7 +10343,6 @@ kitegarage.eu: did not receive HSTS header
kiteschoolamsterdam.nl: could not connect to host
kitestar.co.uk: did not receive HSTS header
kitk.at: could not connect to host
-kitsapsolutions.com: could not connect to host
kitsostech.com: could not connect to host
kitsta.com: could not connect to host
kiwi.global: could not connect to host
@@ -9891,7 +10351,6 @@ kiwiirc.com: max-age too low: 5256000
kiwipayment.com: could not connect to host
kiwipayments.com: could not connect to host
kiwiplace.com: could not connect to host
-kix.moe: did not receive HSTS header
kiyo.space: could not connect to host
kizil.net: could not connect to host
kj1391.com: did not receive HSTS header
@@ -9903,12 +10362,15 @@ kjg-ummeln.de: did not receive HSTS header
kjoglum.me: could not connect to host
kkaefer.com: did not receive HSTS header
kkomputer.net: did not receive HSTS header
+kkren.me: could not connect to host
kkull.tv: could not connect to host
kkws.co: could not connect to host
klantenadvies.nl: did not receive HSTS header
+klapib.ee: could not connect to host
klas.or.id: did not receive HSTS header
klatschreime.de: did not receive HSTS header
klausimas.lt: did not receive HSTS header
+klautshop.com: could not connect to host
klauwd.com: could not connect to host
klaxn.org: could not connect to host
klean-ritekc.com: did not receive HSTS header
@@ -9921,18 +10383,19 @@ kleinholding.com: could not connect to host
kleinserienproduktion.com: could not connect to host
klempnershop.eu: did not receive HSTS header
kletterkater.com: did not receive HSTS header
+klicke-gemeinsames.de: did not receive HSTS header
klicktojob.de: could not connect to host
klingeletest.de: could not connect to host
klingsundet.no: did not receive HSTS header
klinkerstreet.com.ua: did not receive HSTS header
kliqsd.com: did not receive HSTS header
-kloentrup.de: max-age too low: 604800
+kloentrup.de: max-age too low: 172800
klotz-labs.com: max-age too low: 7889238
klunkergarten.org: could not connect to host
klustekeningen.nl: did not receive HSTS header
klzwzhi.com: did not receive HSTS header
km-net.pl: did not receive HSTS header
-kmdev.me: did not receive HSTS header
+kmdev.me: could not connect to host
knapen.io: max-age too low: 604800
knccloud.com: could not connect to host
kneipi.de: did not receive HSTS header
@@ -9943,13 +10406,11 @@ knightsbridgegroup.org: could not connect to host
knightsweep.com: could not connect to host
kniwweler.com: could not connect to host
knowdebt.org: did not receive HSTS header
-knowledgehook.com: did not receive HSTS header
knowledgesnap.com: could not connect to host
knowledgesnapsites.com: could not connect to host
knownsec.cf: could not connect to host
knuckles.tk: could not connect to host
-knutur.is: could not connect to host
-kobezda.net: could not connect to host
+kobar.id: could not connect to host
kobieta.guru: could not connect to host
koboldcraft.ch: could not connect to host
koddsson.com: did not receive HSTS header
@@ -9965,6 +10426,8 @@ koerper-wie-seele.de: did not receive HSTS header
koerperimpuls.ch: did not receive HSTS header
koez-mangal.ch: could not connect to host
koezmangal.ch: could not connect to host
+kogcoder.com: could not connect to host
+koi-sama.net: did not receive HSTS header
koik.io: could not connect to host
koirala.net: could not connect to host
kokenmetaanbiedingen.nl: could not connect to host
@@ -9973,31 +10436,32 @@ kola-entertainments.de: did not receive HSTS header
kolania.com: could not connect to host
kolaykaydet.com: could not connect to host
kolbeck.tk: could not connect to host
+koldanews.com: did not receive HSTS header
kollawat.me: could not connect to host
+kolonie-am-stadtpark.de: could not connect to host
kolozsvaricsuhe.hu: could not connect to host
-kombidorango.com.br: did not receive HSTS header
+kombidorango.com.br: could not connect to host
komikito.com: could not connect to host
kompetenzwerft.de: did not receive HSTS header
konata.us: could not connect to host
kongbaofang.com: could not connect to host
konicaprinterdriver.com: could not connect to host
-konings.it: could not connect to host
konkai.store: could not connect to host
konkurs.ba: could not connect to host
kontakthuman.hu: did not receive HSTS header
kontaxis.network: could not connect to host
kontrolapovinnosti.cz: did not receive HSTS header
-konventseliten.se: could not connect to host
+konventseliten.se: did not receive HSTS header
koop-bremen.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
koopjesnel.nl: could not connect to host
koordinate.net: could not connect to host
kopio.jp: did not receive HSTS header
-koppelvlak.net: could not connect to host
kopular.com: could not connect to host
kori.ml: did not receive HSTS header
koriyoukai.net: did not receive HSTS header
kornersafe.com: did not receive HSTS header
korni22.org: could not connect to host
+korobi.io: could not connect to host
korsanparti.org: did not receive HSTS header
kostuumstore.nl: could not connect to host
kostya.net: did not receive HSTS header
@@ -10014,16 +10478,16 @@ kourpe.online: could not connect to host
kousaku.jp: could not connect to host
kovnsk.net: could not connect to host
kovuthehusky.com: did not receive HSTS header
+kowalmik.tk: could not connect to host
kozmik.co: could not connect to host
kpdyer.com: did not receive HSTS header
kpebetka.net: did not receive HSTS header
kpmgpublications.ie: did not receive HSTS header
kpn-dnssec.com: could not connect to host
-kpopsource.com: did not receive HSTS header
kprog.net: could not connect to host
kpvpn.com: could not connect to host
-kpx1.de: could not connect to host
kraigwalker.com: could not connect to host
+kraiwon.com: could not connect to host
krasavchik.by: could not connect to host
krasota.ru: did not receive HSTS header
krausen.ca: could not connect to host
@@ -10055,30 +10519,33 @@ kroodle.nl: did not receive HSTS header
krouzkyliduska.cz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
kruegerrand-wert.de: did not receive HSTS header
krunut.com: did not receive HSTS header
-kryha.io: did not receive HSTS header
-krypmonet.com: could not connect to host
+kruu.de: could not connect to host
krypteia.org: could not connect to host
kryptomodkingz.com: could not connect to host
+kscarlett.com: could not connect to host
ksfh-mail.de: could not connect to host
+ksham.net: could not connect to host
ksk-agentur.de: did not receive HSTS header
kstan.me: did not receive HSTS header
kswcosmetics.com: could not connect to host
kswriter.com: could not connect to host
-kteen.info: did not receive HSTS header
+kteen.info: could not connect to host
ktube.yt: could not connect to host
kuaitiyu.org: could not connect to host
kuba.guide: could not connect to host
-kubierecki.pl: could not connect to host
-kubiwa.net: did not receive HSTS header
+kubiwa.net: could not connect to host
kubusadvocaten.nl: could not connect to host
kuchenschock.de: did not receive HSTS header
kucheryavenkovn.ru: did not receive HSTS header
-kucom.it: did not receive HSTS header
+kucom.it: could not connect to host
+kueche-co.de: max-age too low: 10716219
kuechenplan.online: did not receive HSTS header
kuehndel.org: could not connect to host
kueulangtahunanak.net: could not connect to host
+kugelblitz.co: could not connect to host
kuko-crews.org: could not connect to host
kultmobil.se: did not receive HSTS header
+kum.com: could not connect to host
kummerlaender.eu: did not receive HSTS header
kundo.se: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
kunstfehler.at: did not receive HSTS header
@@ -10091,7 +10558,6 @@ kura.io: could not connect to host
kurashino-mall.com: could not connect to host
kurehun.org: could not connect to host
kuro346.moe: could not connect to host
-kuroisalva.xyz: did not receive HSTS header
kurrende.nrw: could not connect to host
kurrietv.nl: did not receive HSTS header
kursprogramisty.pl: could not connect to host
@@ -10101,6 +10567,7 @@ kurz.pw: could not connect to host
kurzonline.com.br: could not connect to host
kuwago.io: could not connect to host
kuzdrowiu24.pl: could not connect to host
+kvestmaster.ru: did not receive HSTS header
kvt.berlin: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
kwidz.fr: did not receive HSTS header
kwikmed.eu: could not connect to host
@@ -10116,12 +10583,14 @@ kykoonn.net: did not receive HSTS header
kylapps.com: did not receive HSTS header
kyle.place: could not connect to host
kylebaldw.in: did not receive HSTS header
+kylejohnson.io: could not connect to host
kylerwood.com: could not connect to host
kylescastles.co.uk: did not receive HSTS header
kyliehunt.com: did not receive HSTS header
kylling.io: could not connect to host
kymo.org: did not receive HSTS header
kynaston.org.uk: could not connect to host
+kyobostory-events.com: could not connect to host
kyochon.fr: could not connect to host
kyoko.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
kyonagashima.com: did not receive HSTS header
@@ -10132,19 +10601,22 @@ kzjnet.com: could not connect to host
l-rickroll-i.pw: could not connect to host
l.me.uk: could not connect to host
l18.io: could not connect to host
+l2guru.ru: could not connect to host
la-flora-negra.de: could not connect to host
la-grande-jaugue.fr: did not receive HSTS header
la-retraite-info.com: could not connect to host
la-serendipite.fr: did not receive HSTS header
-labaia.info: could not connect to host
+labaia.info: did not receive HSTS header
laballoons.com: max-age too low: 7889238
labella-umbrella.com: did not receive HSTS header
labelleza.com.br: could not connect to host
labfox.de: did not receive HSTS header
labiblioafronebrulepas.com: could not connect to host
labina.com.tr: did not receive HSTS header
+labms.com.au: did not receive HSTS header
laboiteanem.fr: could not connect to host
laboiteapc.fr: did not receive HSTS header
+laboitebio-logique.ca: could not connect to host
labordata.io: could not connect to host
laborie.io: could not connect to host
laboutiquemarocaineduconvoyeur.com: could not connect to host
@@ -10162,6 +10634,7 @@ lacentral.com: did not receive HSTS header
lacledeslan.ninja: could not connect to host
lacuevadechauvet.com: did not receive HSTS header
ladadate.com: could not connect to host
+ladislavbrezovnik.com: could not connect to host
ladybugjam.com: could not connect to host
ladylikeit.com: could not connect to host
ladylucks.co.uk: could not connect to host
@@ -10175,7 +10648,7 @@ lafosseobservatoire.be: did not receive HSTS header
lafr4nc3.xyz: could not connect to host
lag-gbr.gq: could not connect to host
lagalerievirtuelle.fr: did not receive HSTS header
-lagier.xyz: could not connect to host
+lagier.xyz: did not receive HSTS header
lagodny.eu: could not connect to host
lagoza.name: could not connect to host
laharilais.fr: did not receive HSTS header
@@ -10184,20 +10657,24 @@ laisashop.com.br: could not connect to host
lajijonencadebarbera.com: could not connect to host
lakatrop.com: could not connect to host
lakefrontlittleelm.com: did not receive HSTS header
+lakehavasucityhomebuyerscredit.com: did not receive HSTS header
+lakehavasuhomebuyercredit.com: did not receive HSTS header
+lakehavasuhomes.info: did not receive HSTS header
lakehavasuhouserentals.com: could not connect to host
+lakehavasuhouses.com: did not receive HSTS header
lakewoodcomputerservices.com: could not connect to host
+lakhesis.net: could not connect to host
lalajj.com: could not connect to host
laltroweb.it: did not receive HSTS header
lamafioso.com: could not connect to host
lamaisondelatransformationculturelle.com: did not receive HSTS header
-lamaland.ru: max-age too low: 0
lambda-complex.org: could not connect to host
lambdafive.co.uk: could not connect to host
lamiaposta.email: did not receive HSTS header
lamomebijou.paris: did not receive HSTS header
-lampl.info: could not connect to host
lamtv.com.mx: could not connect to host
lan2k.org: max-age too low: 86400
+lana.swedbank.se: did not receive HSTS header
lanauzedesigns.com: did not receive HSTS header
lanboll.com: could not connect to host
lanbyte.se: could not connect to host
@@ -10215,10 +10692,11 @@ langendorf-ernaehrung-training.de: did not receive HSTS header
langendries.eu: did not receive HSTS header
langguth.io: did not receive HSTS header
langhun.me: could not connect to host
-lanhhuyet510.tk: could not connect to host
+lanhhuyet510.tk: did not receive HSTS header
laniakean.com: did not receive HSTS header
lanonfire.com: could not connect to host
lansinoh.co.uk: did not receive HSTS header
+lanyang.tk: could not connect to host
lanzainc.xyz: could not connect to host
laobox.fr: could not connect to host
laohei.org: did not receive HSTS header
@@ -10227,24 +10705,24 @@ lapakus.com: could not connect to host
laperfumista.es: could not connect to host
laplaceduvillage.net: could not connect to host
laquack.com: could not connect to host
-laraigneedusoir.com: could not connect to host
lared.ovh: did not receive HSTS header
laredsemanario.com: could not connect to host
+larsbauer.xyz: could not connect to host
larsgujord.no: did not receive HSTS header
-larsmerke.de: did not receive HSTS header
+larsmerke.de: could not connect to host
lasepiataca.com: did not receive HSTS header
lasercloud.ml: could not connect to host
laserfuchs.de: did not receive HSTS header
lashstuff.com: did not receive HSTS header
lasnaves.com: did not receive HSTS header
-lasowy.com: could not connect to host
lasst-uns-beten.de: could not connect to host
latabaccheria.net: could not connect to host
latable-bowling-vire.fr: did not receive HSTS header
latabledebry.be: could not connect to host
-latamarissiere.eu: could not connect to host
+latamarissiere.eu: did not receive HSTS header
lateliercantaldeco.fr: could not connect to host
latelierdekathy.com: could not connect to host
+latestbuy.com.au: did not receive HSTS header
latetrain.cn: could not connect to host
latg.com: max-age too low: 300
lathamlabs.com: could not connect to host
@@ -10252,7 +10730,6 @@ lathamlabs.net: could not connect to host
lathamlabs.org: could not connect to host
lathen-wahn.de: did not receive HSTS header
latiendadelbebefeliz.com: did not receive HSTS header
-latinphone.com: could not connect to host
latinred.com: did not receive HSTS header
latitude42technology.com: did not receive HSTS header
latour-managedcare.ch: could not connect to host
@@ -10268,10 +10745,12 @@ laureltv.org: did not receive HSTS header
laurent-e-levy.com: did not receive HSTS header
lausitzer-widerstand.de: did not receive HSTS header
lavapot.com: did not receive HSTS header
+lavasing.eu.org: could not connect to host
laventainnhotel-mailing.com: could not connect to host
lavine.ch: did not receive HSTS header
lavito.cz: could not connect to host
lavval.com: could not connect to host
+lawformt.com: max-age too low: 2592000
lawly.org: could not connect to host
lawrence-institute.com: could not connect to host
laxatus.com: could not connect to host
@@ -10296,6 +10775,7 @@ lcy.cat: could not connect to host
lcybox.com: did not receive HSTS header
ldarby.me.uk: could not connect to host
ldcraft.pw: could not connect to host
+le-blog.ch: could not connect to host
le0.me: could not connect to host
le0yn.ml: could not connect to host
leadstart.org: did not receive HSTS header
@@ -10304,6 +10784,7 @@ leakreporter.net: did not receive HSTS header
leaks.directory: could not connect to host
leanclub.org: could not connect to host
leaodarodesia.com.br: could not connect to host
+leapandjump.co.uk: could not connect to host
leardev.de: did not receive HSTS header
learn-smart.uk: did not receive HSTS header
learnedhacker.com: could not connect to host
@@ -10312,6 +10793,7 @@ learnfrenchfluently.com: could not connect to host
learningorder.com: could not connect to host
learntale.com: could not connect to host
lebal.se: could not connect to host
+lebarbatruc.com: did not receive HSTS header
lebosse.me: could not connect to host
lebrun.org: could not connect to host
lecourtier.fr: did not receive HSTS header
@@ -10334,13 +10816,14 @@ leelou.wedding: could not connect to host
leen.io: could not connect to host
leerkotte.eu: could not connect to host
leetsaber.com: did not receive HSTS header
+legacy.bank: did not receive HSTS header
legal.farm: could not connect to host
legaleus.co.uk: could not connect to host
legalisepeacebloom.com: could not connect to host
legalrobot-uat.com: could not connect to host
legalsen.com: did not receive HSTS header
legaltip.eu: could not connect to host
-legarage.org: could not connect to host
+legarage.org: did not receive HSTS header
legatofmrc.fr: could not connect to host
legavenue.com.br: did not receive HSTS header
legendary.camera: did not receive HSTS header
@@ -10348,6 +10831,8 @@ legendarycamera.com: did not receive HSTS header
legitaxi.com: did not receive HSTS header
legumefederation.org: did not receive HSTS header
legymnase.eu: did not receive HSTS header
+lehrermarktplatz.de: did not receive HSTS header
+lehtinen.xyz: did not receive HSTS header
leigh.life: did not receive HSTS header
leighneithardt.com: could not connect to host
leiming.co: could not connect to host
@@ -10356,13 +10841,12 @@ leition.com: did not receive HSTS header
leitionusercontent.com: did not receive HSTS header
leitner.com.au: did not receive HSTS header
leiyun.me: could not connect to host
+lelambiental.com.br: did not receive HSTS header
lelehei.com: could not connect to host
lellyboi.ml: could not connect to host
lelongbank.com: did not receive HSTS header
lelubre.info: did not receive HSTS header
lemon.co: could not connect to host
-lemonthy.ca: could not connect to host
-lemonthy.com: could not connect to host
lemp.io: did not receive HSTS header
lenders.direct: could not connect to host
lenguajedeprogramacion.com: did not receive HSTS header
@@ -10372,7 +10856,6 @@ lenkunz.me: could not connect to host
lenn1.de: did not receive HSTS header
lennarth.com: could not connect to host
lennartheinrich.de: could not connect to host
-lennier.info: could not connect to host
lennyfaces.net: did not receive HSTS header
lenovogaming.com: could not connect to host
lentri.com: did not receive HSTS header
@@ -10383,7 +10866,9 @@ leodaniels.com: did not receive HSTS header
leon-jaekel.com: could not connect to host
leonardcamacho.me: could not connect to host
leonauto.de: could not connect to host
+leonhooijer.nl: could not connect to host
leopold.email: could not connect to host
+leopoldina.net: could not connect to host
leopotamgroup.com: could not connect to host
lepiquillo.fr: did not receive HSTS header
lepont.pl: could not connect to host
@@ -10393,23 +10878,21 @@ lerlivros.online: could not connect to host
lerner.moscow: could not connect to host
les-corsaires.net: could not connect to host
les-voitures-electriques.com: max-age too low: 2592000
+lesaffre.es: could not connect to host
lesbiansslaves.com: could not connect to host
+lesbofight.com: could not connect to host
lescomptoirsdepierrot.com: could not connect to host
-lesconteursavis.org: could not connect to host
lescourtiersbordelais.com: did not receive HSTS header
lesdouceursdeliyana.com: could not connect to host
lesecuadors.com: did not receive HSTS header
-lesfilmsavivre.com: could not connect to host
-lesformations.net: could not connect to host
+lesformations.net: did not receive HSTS header
lesh.eu: could not connect to host
lesharris.com: could not connect to host
lesliekearney.com: did not receive HSTS header
-lesnet.co.uk: could not connect to host
lesperlesdunet.fr: could not connect to host
lesquatredauphins.fr: did not receive HSTS header
lesscloud.com: could not connect to host
lessing.consulting: did not receive HSTS header
-lessis.moe: could not connect to host
letempsdunefleur.be: could not connect to host
leter.io: did not receive HSTS header
lethbridgecoffee.com: did not receive HSTS header
@@ -10420,16 +10903,17 @@ letreview.ph: could not connect to host
letsgetintouch.com: could not connect to host
letsmultiplayerplay.com: did not receive HSTS header
letsnet.org: could not connect to host
-letsorganise.uk: did not receive HSTS header
letstox.com: could not connect to host
lettland-firma.com: could not connect to host
letustravel.tk: could not connect to host
levatc.tk: could not connect to host
level-10.net: could not connect to host
+levelaccordingly.com: could not connect to host
levelum.com: did not receive HSTS header
levelupwear.com: max-age too low: 7889238
leveredge.net: could not connect to host
levert.ch: could not connect to host
+lewdgamer.com: could not connect to host
lewisjuggins.co.uk: did not receive HSTS header
lewisseals.com: could not connect to host
lexiphanic.co.uk: did not receive HSTS header
@@ -10439,6 +10923,8 @@ lez-cuties.com: could not connect to host
lezdomsm.com: could not connect to host
lfaz.org: could not connect to host
lfklzw.com: could not connect to host
+lfrconseil.com: could not connect to host
+lfullerdesign.com: did not receive HSTS header
lg21.co: could not connect to host
lgbtqventures.com: max-age too low: 86400
lgbtventures.com: did not receive HSTS header
@@ -10448,8 +10934,9 @@ lgsg.us: could not connect to host
lgts.se: could not connect to host
lhasaapso.com.br: could not connect to host
lheinrich.com: could not connect to host
-lheinrich.de: did not receive HSTS header
+lheinrich.de: could not connect to host
lheinrich.org: could not connect to host
+lhero.org: did not receive HSTS header
lhsj28.com: could not connect to host
lhsj68.com: could not connect to host
lhsj78.com: could not connect to host
@@ -10461,7 +10948,7 @@ lian-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERRO
lian-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
liang-li88.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
liang-li88.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-liangbp.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+liangbp.com: did not receive HSTS header
lianwen.kim: could not connect to host
lianye.in: could not connect to host
lianyexiuchang.in: could not connect to host
@@ -10478,20 +10965,20 @@ librairie-asie.com: did not receive HSTS header
library.linode.com: did not receive HSTS header
librechan.net: could not connect to host
libreduca.com: could not connect to host
+libremail.nl: could not connect to host
libricks.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-librisulibri.it: did not receive HSTS header
licence-registry.com: could not connect to host
liceo.cn: did not receive HSTS header
liceserv.com: could not connect to host
lichess4545.com: did not receive HSTS header
lichess4545.tv: did not receive HSTS header
+lickmypussy.us: could not connect to host
lidl-selection.at: did not receive HSTS header
liduan.com: could not connect to host
liebach.me: did not receive HSTS header
liebestarot.at: did not receive HSTS header
lieblingsholz.de: could not connect to host
lied8.eu: could not connect to host
-liehuojun.com: could not connect to host
lietaer.eu: did not receive HSTS header
life-time.nl: did not receive HSTS header
lifecoach.tw: did not receive HSTS header
@@ -10500,6 +10987,7 @@ lifeguard.aecom.com: did not receive HSTS header
lifeinitsownway.com: could not connect to host
lifeinsurances.pro: could not connect to host
lifeinsurances24.com: could not connect to host
+lifeisabug.com: could not connect to host
lifemarque.co.uk: did not receive HSTS header
lifenexto.com: could not connect to host
lifeng.us: could not connect to host
@@ -10508,7 +10996,6 @@ lifeskillsdirect.com: did not receive HSTS header
lifestyle7788.com: could not connect to host
lifestyler.me: could not connect to host
lifetimemoneymachine.com: did not receive HSTS header
-lifeventure.co.uk: did not receive HSTS header
lightarmory.com: could not connect to host
lightcloud.com: did not receive HSTS header
lightdark.xyz: could not connect to host
@@ -10517,7 +11004,6 @@ lightning-ashe.com: did not receive HSTS header
lightnovelsekai.com: could not connect to host
lightpaste.com: could not connect to host
lighttherapydevice.com: did not receive HSTS header
-lighttp.com: could not connect to host
lightworx.io: could not connect to host
lignemalin.com: could not connect to host
lignemax.com: did not receive HSTS header
@@ -10526,6 +11012,7 @@ lijero.co: could not connect to host
likc.me: did not receive HSTS header
like.lgbt: could not connect to host
likenosis.com: could not connect to host
+likui.me: could not connect to host
lila.pink: did not receive HSTS header
lilapmedia.com: could not connect to host
lilismartinis.com: could not connect to host
@@ -10537,8 +11024,6 @@ limalama.eu: max-age too low: 1
limeburst.net: did not receive HSTS header
limeyeti.com: could not connect to host
limiteddata.co.uk: could not connect to host
-limitededitioncomputers.com: could not connect to host
-limitededitionsolutions.com: could not connect to host
limitget.com: could not connect to host
limn.me: could not connect to host
limodo-shop.de: did not receive HSTS header
@@ -10548,25 +11033,27 @@ limunana.com: did not receive HSTS header
lincolncountytn.gov: could not connect to host
lincsbouncycastlehire.co.uk: did not receive HSTS header
lindberg.io: did not receive HSTS header
+lindholmen.club: did not receive HSTS header
lineauniformes.com.br: could not connect to host
linernotekids.com: could not connect to host
-linext.cn: did not receive HSTS header
+linext.cn: could not connect to host
lingerie.net.br: did not receive HSTS header
lingerielovers.com.br: did not receive HSTS header
-lingerieonline.com.br: did not receive HSTS header
+lingerieonline.com.br: could not connect to host
lingolia.com: did not receive HSTS header
lingros-test.tk: could not connect to host
lingting.vip: could not connect to host
linguaquote.com: did not receive HSTS header
linhaoyi.com: could not connect to host
-link.ba: could not connect to host
linkage.ph: did not receive HSTS header
linkages.org: could not connect to host
linkonaut.net: could not connect to host
linksanitizer.com: could not connect to host
linksextremist.at: could not connect to host
+linkstream.live: could not connect to host
+linkthis.ml: could not connect to host
linkthisstatus.ml: could not connect to host
-linkybos.com: did not receive HSTS header
+linkybos.com: could not connect to host
linley.de: could not connect to host
linmi.cc: did not receive HSTS header
linno.me: could not connect to host
@@ -10575,6 +11062,7 @@ linostassi.net: could not connect to host
linux-admin-california.com: could not connect to host
linux-mint.cz: could not connect to host
linux.army: could not connect to host
+linux.im: could not connect to host
linux.sb: could not connect to host
linuxandstuff.de: could not connect to host
linuxcode.net: could not connect to host
@@ -10585,13 +11073,14 @@ linuxgeek.ro: could not connect to host
linuxincluded.com: did not receive HSTS header
linuxmint.cz: could not connect to host
linuxmonitoring.net: could not connect to host
-linvx.org: did not receive HSTS header
-linx.li: did not receive HSTS header
+linvx.org: could not connect to host
linxmind.eu: could not connect to host
lionhosting.nl: could not connect to host
+lionlyrics.com: could not connect to host
lipo.lol: could not connect to host
-liquid.solutions: did not receive HSTS header
+liquid.solutions: could not connect to host
liquidcomm.net: could not connect to host
+liquidradio.pro: could not connect to host
liquidwarp.net: could not connect to host
liquimoly.market: did not receive HSTS header
liquorsanthe.in: could not connect to host
@@ -10599,34 +11088,38 @@ lisaco.de: could not connect to host
lisbongold.com: did not receive HSTS header
lisgade.dk: could not connect to host
lisieuxarquitetura.com.br: could not connect to host
+lisky.ru: did not receive HSTS header
lisowski-photography.com: could not connect to host
lissabon.guide: could not connect to host
listafirmelor.com: could not connect to host
listage.ovh: did not receive HSTS header
+listal.com: could not connect to host
lists.mayfirst.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
litcc.com: could not connect to host
litcomphonors.com: could not connect to host
+literaturpreis-bad-wurzach.de: did not receive HSTS header
litespeed.io: could not connect to host
litevault.net: did not receive HSTS header
little.pw: could not connect to host
+littlecrittersbrewery.com: did not receive HSTS header
littledisney.ro: did not receive HSTS header
littlefreelibrary.org: did not receive HSTS header
-littlelife.co.uk: did not receive HSTS header
+littleqiu.net: could not connect to host
littleservice.cn: could not connect to host
-litz.ca: could not connect to host
-litzenberger.ca: could not connect to host
liud.im: could not connect to host
+liufengyu.cn: did not receive HSTS header
liujunyang.com: did not receive HSTS header
liukang.tech: could not connect to host
-liul.in: could not connect to host
liushuyu.tk: did not receive HSTS header
-liv3d.stream: could not connect to host
liv3ly.com: did not receive HSTS header
livechatlady.info: did not receive HSTS header
livedemo.io: could not connect to host
livej.am: could not connect to host
+livejasmin.dk: could not connect to host
+livepath.ch: did not receive HSTS header
liverewrite.com: could not connect to host
livesearch-fukuoka.com: did not receive HSTS header
+livetube.tv: did not receive HSTS header
liviababynet.com.br: could not connect to host
livinghealthywithchocolate.com: did not receive HSTS header
livrariacoad.com.br: could not connect to host
@@ -10638,15 +11131,15 @@ lixiaojiang.ga: could not connect to host
lixingcong.com: could not connect to host
liyinjia.com: did not receive HSTS header
liyunbin.com: did not receive HSTS header
+lizhi123.net: could not connect to host
lizzythepooch.com: did not receive HSTS header
+ljc.ro: could not connect to host
lkiserver.com: max-age too low: 43200
lll.st: could not connect to host
-lloyd-day.me: could not connect to host
llvm.us: could not connect to host
lmrcouncil.gov: could not connect to host
ln.io: could not connect to host
lnbeauty.ru: max-age too low: 0
-lnmp.me: could not connect to host
lnoldan.com: could not connect to host
lnx.li: could not connect to host
loacg.com: did not receive HSTS header
@@ -10666,15 +11159,22 @@ locais.org: could not connect to host
localchum.com: could not connect to host
localdata.us: could not connect to host
localdrive.me: could not connect to host
-localea.com: could not connect to host
+localea.com: max-age too low: 2592000
localnetwork.nz: could not connect to host
+locationvoitureallemagne.com: could not connect to host
+locationvoitureangleterre.com: could not connect to host
+locationvoitureaustralie.com: could not connect to host
locationvoitureautriche.com: could not connect to host
+locationvoiturebelgique.com: could not connect to host
locationvoiturecorse.net: could not connect to host
+locationvoitureespagne.com: could not connect to host
locationvoiturefinlande.com: could not connect to host
locationvoitureirlande.com: did not receive HSTS header
locationvoitureislande.com: could not connect to host
+locationvoitureitalie.com: could not connect to host
locationvoiturenorvege.com: could not connect to host
locationvoiturepaysbas.com: could not connect to host
+locationvoitureportugal.com: could not connect to host
locationvoituresuede.com: could not connect to host
locchat.com: could not connect to host
locker3.com: could not connect to host
@@ -10686,6 +11186,7 @@ locksmithsbluff.com: could not connect to host
locksport.org.nz: could not connect to host
locktheirphone.com: could not connect to host
lockyourcomputer.pw: could not connect to host
+locomore.com: could not connect to host
locomotive.ca: did not receive HSTS header
locvis.ru: did not receive HSTS header
lode.li: could not connect to host
@@ -10695,7 +11196,7 @@ loftboard.eu: could not connect to host
log2n.uk: could not connect to host
logario.com.br: could not connect to host
logcat.info: could not connect to host
-logfro.de: max-age too low: 0
+logfro.de: did not receive HSTS header
logic8.ml: could not connect to host
logicaladvertising.com: could not connect to host
logicchen.com: could not connect to host
@@ -10703,43 +11204,52 @@ logicsale.com: did not receive HSTS header
logicsale.de: did not receive HSTS header
logicsale.fr: did not receive HSTS header
logicsale.it: did not receive HSTS header
+logicz.top: could not connect to host
logimagine.com: did not receive HSTS header
login.corp.google.com: max-age too low: 7776000 (error ignored - included regardless)
login.persona.org: could not connect to host
logingate.hu: could not connect to host
loginseite.com: could not connect to host
logistify.com.mx: did not receive HSTS header
+logitank.net: did not receive HSTS header
lognot.net: could not connect to host
logymedia.com: could not connect to host
lohl1kohl.de: did not receive HSTS header
loisircreatif.net: did not receive HSTS header
lojadocristaozinho.com.br: could not connect to host
+lojadoprazer.com.br: could not connect to host
lojahunamarcenaria.com.br: could not connect to host
lojamulticapmais.com.br: did not receive HSTS header
lojashowdecozinha.com.br: could not connect to host
lojasviavento.com.br: could not connect to host
lojatema.com.br: could not connect to host
lojavalcapelli.com.br: could not connect to host
+lojavirtualfc.com.br: did not receive HSTS header
lojavirtualfct.com.br: did not receive HSTS header
-loli.bz: could not connect to host
+lolcorp.pl: could not connect to host
+loli.bz: did not receive HSTS header
+loli.com: could not connect to host
+loli.ee: did not receive HSTS header
+lolico.moe: did not receive HSTS header
lolicon.info: could not connect to host
lolicore.ch: could not connect to host
lolidunno.com: could not connect to host
lolis.stream: could not connect to host
lollaconcept.com.br: could not connect to host
+lonal.com: could not connect to host
lonasdigital.com: did not receive HSTS header
lonbali.com: did not receive HSTS header
londoncalling.co: did not receive HSTS header
londonlanguageexchange.com: could not connect to host
londonseedcentre.co.uk: could not connect to host
lonerwolf.com: did not receive HSTS header
-long139.com: did not receive HSTS header
-long18.cc: did not receive HSTS header
-long688.com: did not receive HSTS header
longboarding-ulm.de: could not connect to host
longma.pw: could not connect to host
longtaitouwang.com: did not receive HSTS header
look-at-my.site: could not connect to host
+looka.ch: did not receive HSTS header
+looka.photo: could not connect to host
+lookart.ch: could not connect to host
looker.wang: could not connect to host
lookout.com: did not receive HSTS header
looktothestars.org: did not receive HSTS header
@@ -10759,8 +11269,6 @@ lostandcash.com: could not connect to host
lostarq.com: could not connect to host
lostg.com: did not receive HSTS header
lostinsecurity.com: could not connect to host
-lostinweb.eu: could not connect to host
-lostwithdan.com: could not connect to host
loteks.de: did not receive HSTS header
lothai.re: did not receive HSTS header
lothuytinhsi.com: could not connect to host
@@ -10775,12 +11283,12 @@ louisvillevmug.info: did not receive HSTS header
love-schna.jp: could not connect to host
love4taylor.eu.org: could not connect to host
loveable.de: could not connect to host
-loveai.org: could not connect to host
loveamber.me: could not connect to host
loveandloyalty.se: could not connect to host
lovebo9.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
lovebo9.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-lovelens.ch: max-age too low: 0
+lovelens.ch: could not connect to host
+lovelens.li: could not connect to host
lovelifelovelive.com: could not connect to host
lovelive-anime.tk: could not connect to host
lovelive-anime.tokyo: could not connect to host
@@ -10794,12 +11302,15 @@ lovemen.cc: did not receive HSTS header
lovemysafetynet.com: did not receive HSTS header
loveread-ec.appspot.com: did not receive HSTS header
loveto.at: could not connect to host
+lovetravel360.com: could not connect to host
+loveyounastya.com: could not connect to host
lovingpenguin.com: did not receive HSTS header
lowhangingfruitgrabber.com: could not connect to host
lowt.us: could not connect to host
lowtherpavilion.co.uk: did not receive HSTS header
loxal.org: could not connect to host
loxis.be: did not receive HSTS header
+loyaleco.it: could not connect to host
loyaltech.ch: could not connect to host
lpacademy.com.br: could not connect to host
lpak.nl: could not connect to host
@@ -10807,7 +11318,7 @@ lpcom.de: max-age too low: 172800
lpgram.ga: could not connect to host
lpm-uk.com: did not receive HSTS header
lprcommunity.co.za: did not receive HSTS header
-lqs.me: could not connect to host
+lqs.me: did not receive HSTS header
lrhsclubs.com: could not connect to host
lrhstsa.com: could not connect to host
ls-a.org: did not receive HSTS header
@@ -10827,6 +11338,7 @@ ltransferts.com: could not connect to host
ltu.social: could not connect to host
lubomirkazakov.com: did not receive HSTS header
lubot.net: could not connect to host
+luca.swiss: could not connect to host
lucakrebs.de: could not connect to host
lucas-garte.com: did not receive HSTS header
lucascantor.com: did not receive HSTS header
@@ -10838,23 +11350,27 @@ luckydog.pw: could not connect to host
luckystarfishing.com: did not receive HSTS header
luclu7.pw: could not connect to host
ludwig.click: could not connect to host
+ludwig.im: could not connect to host
lufthansaexperts.com: max-age too low: 2592000
lufu.io: could not connect to host
luganskservers.net: could not connect to host
-lugimax.com: could not connect to host
luginbuehl.eu: could not connect to host
luis-checa.com: could not connect to host
luisgf.es: did not receive HSTS header
luisv.me: could not connect to host
luk.photo: could not connect to host
+lukas-oppermann.de: max-age too low: 0
lukas-schauer.de: did not receive HSTS header
lukas.im: did not receive HSTS header
lukas2511.de: did not receive HSTS header
+lukasoppermann.com: max-age too low: 0
+lukasoppermann.de: max-age too low: 0
lukasschauer.de: did not receive HSTS header
lukasunger.cz: could not connect to host
lukasunger.net: could not connect to host
lukaszdolan.com: did not receive HSTS header
lukasztkacz.com: could not connect to host
+lukatz.de: did not receive HSTS header
lukem.eu: could not connect to host
lukeng.me: could not connect to host
lukonet.com: did not receive HSTS header
@@ -10869,11 +11385,12 @@ lunapatch.com: max-age too low: 7889238
lunarift.com: could not connect to host
lunarrift.net: could not connect to host
luneta.nearbuysystems.com: could not connect to host
+lungta.pro: could not connect to host
lunight.ml: could not connect to host
lunix.io: did not receive HSTS header
luno.io: could not connect to host
luoe.ml: could not connect to host
-luolikong.vip: did not receive HSTS header
+luolikong.vip: could not connect to host
luom.net: could not connect to host
luoxiao.im: could not connect to host
luoxingyu.ml: could not connect to host
@@ -10883,6 +11400,7 @@ lusis.net: could not connect to host
lustige-zitate.com: did not receive HSTS header
lustrumxi.nl: could not connect to host
luther.fi: could not connect to host
+luukuton.fi: did not receive HSTS header
luvplay.co.uk: could not connect to host
luxe-it.co.uk: could not connect to host
luxinmo.com: did not receive HSTS header
@@ -10892,6 +11410,8 @@ luxus-russen.de: could not connect to host
luzeshomologadas.com.br: could not connect to host
lv5.top: could not connect to host
lwhate.com: could not connect to host
+lychankiet.name.vn: could not connect to host
+lycly.me: could not connect to host
lycly.top: could not connect to host
lydia-und-simon.de: could not connect to host
lydiagorstein.com: did not receive HSTS header
@@ -10911,12 +11431,14 @@ lzqii.cn: could not connect to host
lzzr.me: could not connect to host
m-ali.xyz: did not receive HSTS header
m-edmondson.co.uk: did not receive HSTS header
+m-gaming.tk: could not connect to host
m-generator.com: could not connect to host
m-rickroll-v.pw: could not connect to host
m-warrior.tk: could not connect to host
m.gparent.org: could not connect to host
m.nu: did not receive HSTS header
m0wef.uk: could not connect to host
+m132.eu: did not receive HSTS header
m2tc.fr: could not connect to host
m3-gmbh.de: did not receive HSTS header
m4570.xyz: could not connect to host
@@ -10943,9 +11465,10 @@ mack.space: could not connect to host
macker.io: could not connect to host
mackey7.net: did not receive HSTS header
macleodnc.com: did not receive HSTS header
+macoun.de: max-age too low: 2592000
macsandcheesedreams.com: could not connect to host
macstore.pe: did not receive HSTS header
-macustar.eu: did not receive HSTS header
+macustar.eu: could not connect to host
madandpissedoff.com: did not receive HSTS header
madcatdesign.de: did not receive HSTS header
maddin.ga: could not connect to host
@@ -10953,6 +11476,7 @@ made-to-usb.com: did not receive HSTS header
madebyfalcon.co.uk: did not receive HSTS header
madebymagnitude.com: did not receive HSTS header
madeglobal.com: did not receive HSTS header
+madeinchezmoi.net: could not connect to host
madeinorder.com: could not connect to host
madeintucson.org: could not connect to host
mademoiselle-emma.be: could not connect to host
@@ -10962,25 +11486,30 @@ maderwin.com: did not receive HSTS header
madesoftware.com.br: could not connect to host
madnetwork.org: could not connect to host
madokami.net: could not connect to host
+madokami.pw: could not connect to host
madpeople.net: max-age too low: 2592000
madrants.net: could not connect to host
maerzpa.de: did not receive HSTS header
+maestrano.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
mafamane.com: could not connect to host
mafiareturns.com: max-age too low: 2592000
magazinedabeleza.net: could not connect to host
+magbt.net: could not connect to host
magebankin.com: did not receive HSTS header
magenx.com: did not receive HSTS header
+maggie-shaw.co.uk: did not receive HSTS header
magia360.com: did not receive HSTS header
-magickmoments.co.uk: did not receive HSTS header
+magicalshuttle.fr: did not receive HSTS header
+magickmoments.co.uk: could not connect to host
magieamour.com: did not receive HSTS header
magieblanche.fr: did not receive HSTS header
magnacumlaude.co: could not connect to host
+magnettracker.com: could not connect to host
magosmedellin.com: could not connect to host
magyarokegyhelyen.hu: did not receive HSTS header
mahamed91.pw: could not connect to host
mahansexcavating.com: did not receive HSTS header
-mahatmayoga.org: did not receive HSTS header
-mahfouzadedimeji.com: could not connect to host
+mahfouzadedimeji.com: did not receive HSTS header
mahraartisan.com: max-age too low: 7889238
maik-mahlow.de: could not connect to host
mail-settings.google.com: did not receive HSTS header (error ignored - included regardless)
@@ -10990,7 +11519,7 @@ mailchuck.com: could not connect to host
maildragon.com: did not receive HSTS header
mailgarant.nl: could not connect to host
mailhost.it: could not connect to host
-mailing-femprendedores.com: could not connect to host
+mailing-femprendedores.com: did not receive HSTS header
mailing-jbgg.com: could not connect to host
maillink.store: could not connect to host
mailon.ga: could not connect to host
@@ -11002,7 +11531,6 @@ maintainerheaven.ch: could not connect to host
maisalto.ind.br: could not connect to host
maitrechaton.fr: did not receive HSTS header
maitriser-son-stress.com: could not connect to host
-majahoidja.ee: could not connect to host
majesticcolorado.com: did not receive HSTS header
majncloud.tk: could not connect to host
make-pizza.info: could not connect to host
@@ -11012,10 +11540,10 @@ makeit-so.de: could not connect to host
makeitdynamic.com: could not connect to host
makemejob.com: could not connect to host
makemyvape.co.uk: max-age too low: 7889238
-makerstuff.net: could not connect to host
+makerstuff.net: did not receive HSTS header
makeshiftco.de: could not connect to host
makeuplove.nl: could not connect to host
-makeyourlaws.org: did not receive HSTS header
+makeyourlaws.org: could not connect to host
makino.games: could not connect to host
makkyon.com: could not connect to host
malamutedoalasca.com.br: could not connect to host
@@ -11030,25 +11558,27 @@ malgraph.net: could not connect to host
malibubeachrecoverycenter.com: could not connect to host
maljaars-media.nl: could not connect to host
malkaso.com.ua: could not connect to host
-mallhonda.com: could not connect to host
malmstroms-co.se: could not connect to host
malone.link: could not connect to host
-malte-kiefer.de: did not receive HSTS header
maltes.website: could not connect to host
malvy.kiev.ua: could not connect to host
+malwarekillers.com: could not connect to host
malwareverse.us: did not receive HSTS header
malwre.io: could not connect to host
maly.io: did not receive HSTS header
malya.fr: could not connect to host
+mamaasia.info: did not receive HSTS header
mamacobaby.com: did not receive HSTS header
mamaison.io: could not connect to host
mamastore.eu: could not connect to host
-mamaxi.org: did not receive HSTS header
+mambas.cn: could not connect to host
+mammooc.org: did not receive HSTS header
mammothmail.com: could not connect to host
mammothmail.net: could not connect to host
mammothmail.org: could not connect to host
mammut.space: could not connect to host
mamochka.org.ua: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+mamospienas.lt: did not receive HSTS header
mamout.xyz: could not connect to host
manaboutahor.se: could not connect to host
manage.zenpayroll.com: did not receive HSTS header
@@ -11067,7 +11597,7 @@ mandanudes.ae: could not connect to host
mandm.servebeer.com: could not connect to host
mandpress.com: did not receive HSTS header
mangapoi.com: could not connect to host
-mangazuki.co: did not receive HSTS header
+mangazuki.co: could not connect to host
maniadeprazer.com.br: could not connect to host
manifestbin.com: could not connect to host
manipulatedtme.com: could not connect to host
@@ -11096,24 +11626,22 @@ maomaofuli.vip: could not connect to host
maosi.xin: could not connect to host
maple5.com: did not receive HSTS header
maplenorth.co: could not connect to host
-mapresidentielle.fr: did not receive HSTS header
+maps.net: did not receive HSTS header
mapservices.nl: did not receive HSTS header
maquillage-permanent-tatoo.com: did not receive HSTS header
maquininhamercadopoint.com.br: could not connect to host
maranatha.pl: did not receive HSTS header
-marbinvest.com: did not receive HSTS header
+marbinvest.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
marcaudefroy.com: did not receive HSTS header
marcberman.co: did not receive HSTS header
+marcberndtgen.de: could not connect to host
marcbuehlmann.com: did not receive HSTS header
marcceleiro.cat: could not connect to host
-marcel-preuss.de: could not connect to host
marcelmarnitz.com: could not connect to host
marcelparra.com: could not connect to host
-marcelpreuss.de: could not connect to host
marchagen.nl: did not receive HSTS header
marche-nordic-jorat.ch: could not connect to host
marchwj.pl: did not receive HSTS header
-marcianoandtopazio.com: could not connect to host
marco-kretz.de: did not receive HSTS header
marco01809.net: could not connect to host
marcoececilia.it: did not receive HSTS header
@@ -11133,7 +11661,7 @@ margaretrosefashions.co.uk: could not connect to host
margo.ml: could not connect to host
mariacorzo.com: could not connect to host
mariacristinadoces.com.br: did not receive HSTS header
-marianelaisashi.com: did not receive HSTS header
+mariage-photo.ch: could not connect to host
mariannematthew.com: could not connect to host
marianwehlus.de: did not receive HSTS header
mariaolesen.dk: could not connect to host
@@ -11141,6 +11669,7 @@ marie-curie.fr: could not connect to host
marie-en-provence.com: could not connect to host
marie.club: could not connect to host
marienschule-sundern.de: did not receive HSTS header
+marinecadastre.gov: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
marioabela.com: did not receive HSTS header
mariusschulte.de: did not receive HSTS header
marix.ro: could not connect to host
@@ -11155,31 +11684,34 @@ marketingdesignu.cz: could not connect to host
marketingromania.ro: did not receive HSTS header
marketio.co: did not receive HSTS header
marketlinks.org: did not receive HSTS header
+markholden.guru: could not connect to host
markllego.com: could not connect to host
-marko-fenster24.de: did not receive HSTS header
+marko-fenster24.de: could not connect to host
markorszulak.com: did not receive HSTS header
markow.io: max-age too low: 7776000
markrego.com: could not connect to host
marksill.com: could not connect to host
marktboten.de: did not receive HSTS header
+marktplaatshelper.nl: did not receive HSTS header
markusabraham.com: did not receive HSTS header
markusgran.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
markusueberallassetmanagement.de: could not connect to host
markusueberallconsulting.de: could not connect to host
markusweimar.de: did not receive HSTS header
marlen.cz: did not receive HSTS header
-marleyresort.com: did not receive HSTS header
+marleyresort.com: could not connect to host
marlonschultz.de: did not receive HSTS header
+marocmail.ma: could not connect to host
+marotero.com: did not receive HSTS header
marqperso.ch: could not connect to host
marquepersonnelle.ch: could not connect to host
marriottvetcareers.com: could not connect to host
marsatapp.com: could not connect to host
marshallford.me: could not connect to host
marshut.net: could not connect to host
-marshyplay.live: could not connect to host
martialc.be: could not connect to host
martiert.com: could not connect to host
-martijnhielema.nl: did not receive HSTS header
+martiestrimsalon.nl: did not receive HSTS header
martijnvhoof.nl: could not connect to host
martin-arend.de: did not receive HSTS header
martin-mattel.com: could not connect to host
@@ -11190,14 +11722,17 @@ martingansler.de: did not receive HSTS header
martinkup.cz: did not receive HSTS header
martinp.no: could not connect to host
martinrogalla.com: did not receive HSTS header
-martins.im: could not connect to host
+martynhare.co.uk: could not connect to host
+martynhare.uk: could not connect to host
marumagic.com: could not connect to host
-marvinkeller.de: could not connect to host
+marvinkeller.de: did not receive HSTS header
marxist.party: could not connect to host
marykshoup.com: could not connect to host
+marzio.co.za: did not receive HSTS header
masa-hou.com: did not receive HSTS header
masa-yoga.com: did not receive HSTS header
masa.li: could not connect to host
+masaze-hanka.cz: could not connect to host
mascorazon.com: could not connect to host
mashek.net: could not connect to host
mashnew.com: could not connect to host
@@ -11208,6 +11743,7 @@ maskinkultur.com: [Exception... "Component returned failure code: 0x80004005 (NS
maskt.pw: could not connect to host
maslife365.com: did not receive HSTS header
massagelimaperu.com: did not receive HSTS header
+massagetherapyschoolsinformation.com: did not receive HSTS header
massivum.de: did not receive HSTS header
massot.eu: did not receive HSTS header
mastd.fr: could not connect to host
@@ -11242,10 +11778,11 @@ matchneedle.com: did not receive HSTS header
mateusmeyer.com.br: could not connect to host
mateuszpilszek.pl: could not connect to host
mathematris.com: could not connect to host
+mathembedded.com: did not receive HSTS header
mathers.ovh: did not receive HSTS header
matheusmacedo.ddns.net: could not connect to host
+mathias.is: could not connect to host
mathias.re: did not receive HSTS header
-mathieui.net: could not connect to host
mathijskingma.nl: could not connect to host
mathsource.ga: could not connect to host
mathsweek.nz: could not connect to host
@@ -11287,9 +11824,10 @@ mawe.red: could not connect to host
mawidabp.com: did not receive HSTS header
mawidaca.com: did not receive HSTS header
max-mad.com: could not connect to host
-maxbachmann.de: could not connect to host
+maxbachmann.de: did not receive HSTS header
maxdev72.freeboxos.fr: could not connect to host
-maxfox.me: could not connect to host
+maxfox.me: did not receive HSTS header
+maxhoechtl.at: could not connect to host
maxhorvath.com: could not connect to host
maxibanki.ovh: could not connect to host
maxicore.co.za: could not connect to host
@@ -11298,12 +11836,14 @@ maximelouet.me: did not receive HSTS header
maximov.space: did not receive HSTS header
maxkeller.io: did not receive HSTS header
maxmachine.ind.br: could not connect to host
+maxr1998.de: could not connect to host
maxserver.com: did not receive HSTS header
maya-ro.com: could not connect to host
maya.mg: could not connect to host
maybeul.com: could not connect to host
+maydex.info: could not connect to host
maynardnetworks.com: could not connect to host
-mayoimobiliare.ro: did not receive HSTS header
+mayoimobiliare.ro: could not connect to host
mayoristassexshop.com: did not receive HSTS header
mazternet.ru: could not connect to host
mazyun.com: did not receive HSTS header
@@ -11332,18 +11872,15 @@ mcjackk77.com: could not connect to host
mckenry.net: did not receive HSTS header
mckinley1.com: could not connect to host
mckinleytk.com: could not connect to host
-mcl.gg: did not receive HSTS header
mclab.su: max-age too low: 2592000
mclist.it: could not connect to host
mcnoobs.pro: could not connect to host
mcooperlaw.com: did not receive HSTS header
-mcpro.games: could not connect to host
mcqyy.com: could not connect to host
mcsa-usa.org: could not connect to host
mcsniper.co: could not connect to host
mcsnovatamabayan.com: could not connect to host
mctherealm.net: could not connect to host
-mcuexchange.com: did not receive HSTS header
mcuong.tk: could not connect to host
md-student.com: did not receive HSTS header
mdazo.net: could not connect to host
@@ -11365,6 +11902,7 @@ mecenat-cassous.com: did not receive HSTS header
mechok.ru: could not connect to host
medallia.io: could not connect to host
meddatix.com: could not connect to host
+mede-handover.azurewebsites.net: could not connect to host
medi-link.co.il: did not receive HSTS header
media-access.online: did not receive HSTS header
media-courses.com: could not connect to host
@@ -11374,7 +11912,6 @@ mediacru.sh: could not connect to host
mediadandy.com: could not connect to host
mediafinancelab.org: could not connect to host
mediamag.am: max-age too low: 0
-mediarithmics.io: could not connect to host
mediarocks.de: did not receive HSTS header
mediastorm.us: did not receive HSTS header
mediavault.tech: could not connect to host
@@ -11384,12 +11921,13 @@ medienservice-fritz.de: did not receive HSTS header
medifab.online: did not receive HSTS header
medirich.co: could not connect to host
meditek-dv.ru: did not receive HSTS header
+meditel.nl: did not receive HSTS header
mediter-simplement.com: did not receive HSTS header
mediterenopmaandag.nl: did not receive HSTS header
-mediumraw.org: did not receive HSTS header
+mediumraw.org: could not connect to host
mediweed.tk: could not connect to host
-medja.net: could not connect to host
medm-test.com: could not connect to host
+medmarkt24.com: did not receive HSTS header
medpot.net: did not receive HSTS header
medsindex.com: did not receive HSTS header
medstreaming.com: did not receive HSTS header
@@ -11398,8 +11936,10 @@ medy-me.com: could not connect to host
medzinenews.com: did not receive HSTS header
meedoenzaanstad.nl: did not receive HSTS header
meetfinch.com: could not connect to host
+meetmibaby.co.uk: could not connect to host
mega-aukcion.ru: could not connect to host
megadrol.com: could not connect to host
+megafilmesplay.net: did not receive HSTS header
megaflix.nl: could not connect to host
megakiste.de: could not connect to host
megam.host: could not connect to host
@@ -11408,6 +11948,7 @@ megaplonk.com: could not connect to host
megashur.se: could not connect to host
megasystem.cl: could not connect to host
meghudson.com: could not connect to host
+megustariasaber.com: did not receive HSTS header
meifrench.com: could not connect to host
meilleur.xyz: did not receive HSTS header
meimeistartup.com: could not connect to host
@@ -11420,6 +11961,7 @@ meizufans.eu: could not connect to host
melakaltenegger.at: did not receive HSTS header
melangebrasil.com: could not connect to host
melaniebilodeau.com: did not receive HSTS header
+melbyjuliapak.com: could not connect to host
melcher.it: did not receive HSTS header
melenchatsmelenchiens.fr: could not connect to host
melf.nl: could not connect to host
@@ -11441,7 +11983,6 @@ memberstweets.com: could not connect to host
memdoc.org: could not connect to host
memeblast.ninja: could not connect to host
memepasmal.org: could not connect to host
-memes.nz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
memetrash.co.uk: could not connect to host
memind.net: could not connect to host
memory-plus-180.com: could not connect to host
@@ -11451,8 +11992,9 @@ menaraannonces.com: could not connect to host
menchez.me: could not connect to host
menhera.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
menntagatt.is: did not receive HSTS header
-menotag.com: could not connect to host
+menotag.com: did not receive HSTS header
mensachterdepatient.nl: max-age too low: 2592000
+mensagensperfeitas.com.br: did not receive HSTS header
mensmaximus.de: did not receive HSTS header
mentalhealth.gov: did not receive HSTS header
mentax.net: did not receive HSTS header
@@ -11463,9 +12005,11 @@ menudrivetest.com: could not connect to host
menuiserie-berard.com: did not receive HSTS header
menzaijia.com: could not connect to host
menzel-motors.com: did not receive HSTS header
+meo.de: could not connect to host
meow.cloud: could not connect to host
meozcraft.com: could not connect to host
-meraseo.com: could not connect to host
+mercadobitcoin.com.br: did not receive HSTS header
+mercadobitcoin.net: did not receive HSTS header
mercanix.co.uk: could not connect to host
merccorp.de: max-age too low: 0
mercedes-benz-usedcars.be: could not connect to host
@@ -11473,11 +12017,15 @@ mercury-studio.com: did not receive HSTS header
mereckas.com: could not connect to host
meredithkm.info: did not receive HSTS header
mergozzo.com: did not receive HSTS header
+meridianstore.com.br: could not connect to host
merimatka.fi: could not connect to host
meritz.rocks: could not connect to host
merloat.club: could not connect to host
+merloat.com: could not connect to host
+mers.one: could not connect to host
mersinunivercity.com: could not connect to host
merson.me: could not connect to host
+merson.org: could not connect to host
mertak.cz: did not receive HSTS header
meshlab.co: could not connect to host
meshotes.com: max-age too low: 8640000
@@ -11485,6 +12033,7 @@ meskdeals.com: could not connect to host
mesmoque.com: could not connect to host
messagescelestes-archives.ca: did not receive HSTS header
messagescelestes.ca: did not receive HSTS header
+metadatawiki.com: did not receive HSTS header
metadistribution.com: did not receive HSTS header
metagrader.com: could not connect to host
metalsculpture.co.uk: max-age too low: 0
@@ -11501,16 +12050,18 @@ metrans-spedition.de: could not connect to host
metricaid.com: did not receive HSTS header
metrix-money-ptc.com: could not connect to host
metrix.design: could not connect to host
+metrobriefs.com: could not connect to host
metropolisil.gov: did not receive HSTS header
+metsasta.com: could not connect to host
metzgerei-birkenhof.de: could not connect to host
meu-smartphone.com: did not receive HSTS header
-meucosmetico.com.br: could not connect to host
+meucosmetico.com.br: did not receive HSTS header
meuemail.pro: could not connect to host
meupedido.online: did not receive HSTS header
meusigno.com: could not connect to host
mexbt.com: could not connect to host
mexicanbusinessweb.mx: did not receive HSTS header
-mexicansbook.ru: could not connect to host
+mexicansbook.ru: did not receive HSTS header
mexior.nl: could not connect to host
meyeraviation.com: could not connect to host
mfacko.cz: did not receive HSTS header
@@ -11523,10 +12074,12 @@ mfpccprod.com: could not connect to host
mfrsgb45.org: did not receive HSTS header
mft.global: could not connect to host
mfxer.com: could not connect to host
+mfxxx.cn: could not connect to host
mfz.mk: did not receive HSTS header
mgcraft.net: did not receive HSTS header
mgdigital.fr: did not receive HSTS header
mgiay.com: did not receive HSTS header
+mgknet.com: did not receive HSTS header
mgoessel.de: did not receive HSTS header
mh-bloemen.co.jp: could not connect to host
mhdsyarif.com: did not receive HSTS header
@@ -11544,6 +12097,7 @@ miboulot.com: could not connect to host
micaiahparker.com: did not receive HSTS header
micasamgmt.com: did not receive HSTS header
michaeldemuth.com: could not connect to host
+michaeleichorn.com: could not connect to host
michaelfitzpatrickruth.com: did not receive HSTS header
michaelizquierdo.com: max-age too low: 0
michaelklos.nl: did not receive HSTS header
@@ -11551,6 +12105,7 @@ michaelmorpurgo.com: did not receive HSTS header
michaeln.net: did not receive HSTS header
michaels-homepage-service.de: could not connect to host
michaelscrivo.com: did not receive HSTS header
+michaelsnoeren.nl: did not receive HSTS header
michaelsulzer.com: did not receive HSTS header
michaelsulzer.eu: did not receive HSTS header
michaelwaite.org: could not connect to host
@@ -11565,6 +12120,7 @@ michelledonelan.co.uk: did not receive HSTS header
michiganmetalartwork.com: max-age too low: 7889238
mico.world: could not connect to host
micomi.co: could not connect to host
+miconcinemas.com: could not connect to host
miconware.de: could not connect to host
micro-dv.ru: could not connect to host
micro-rain-systems.com: did not receive HSTS header
@@ -11576,15 +12132,17 @@ microtalk.org: could not connect to host
middletowndelcopa.gov: could not connect to host
midirs.org: did not receive HSTS header
midlgx.com: max-age too low: 0
+midnight-visions.de: could not connect to host
midonet.org: did not receive HSTS header
midriversmotorsllc.com: did not receive HSTS header
midterm.us: could not connect to host
midweststructuralrepair.com: could not connect to host
midwestwomenworkers.org: could not connect to host
-miegl.cz: could not connect to host
+miembarcacion.com: could not connect to host
miemie.jp: could not connect to host
mieterschutzkartei.de: could not connect to host
mieuxvivreadarvoy.fr: could not connect to host
+mifibra.cl: did not receive HSTS header
migeeks.de: did not receive HSTS header
mightydicks.io: could not connect to host
mightydicks.tech: could not connect to host
@@ -11595,6 +12153,7 @@ migrator.co: could not connect to host
miguelgfierro.com: did not receive HSTS header
miguksaram.com: could not connect to host
mijn-email.org: could not connect to host
+mijnavg.eu: max-age too low: 0
mijndiad.nl: did not receive HSTS header
mijnetickets.nl: did not receive HSTS header
mijnkredietpaspoort.nl: could not connect to host
@@ -11609,7 +12168,9 @@ mikek.work: did not receive HSTS header
mikeology.org: could not connect to host
mikepair.net: could not connect to host
mikes.tk: did not receive HSTS header
+mikewritesstuff.com: could not connect to host
mikeybot.com: could not connect to host
+mikhirev.ru: could not connect to host
mikii.club: could not connect to host
mikk.cz: could not connect to host
mikori.sk: did not receive HSTS header
@@ -11620,6 +12181,8 @@ miku.hatsune.my: did not receive HSTS header
miku.party: could not connect to host
mikumiku.stream: could not connect to host
mikusinec.com: could not connect to host
+mikywow.eu: did not receive HSTS header
+mil0.com: could not connect to host
milahendri.com: did not receive HSTS header
milang.xyz: could not connect to host
milatrans.pl: did not receive HSTS header
@@ -11628,19 +12191,20 @@ milesgeek.com: did not receive HSTS header
military-portal.cz: did not receive HSTS header
militarycarlot.com: did not receive HSTS header
militaryconsumer.gov: did not receive HSTS header
+milkingit.net: could not connect to host
millibitcoin.jp: could not connect to host
million5.com: did not receive HSTS header
million6.com: could not connect to host
million8.com: did not receive HSTS header
millionairessecrets.com: could not connect to host
-millions1.com: did not receive HSTS header
+millions1.com: could not connect to host
millions11.com: did not receive HSTS header
millions13.com: did not receive HSTS header
millions14.com: did not receive HSTS header
millions15.com: did not receive HSTS header
millions16.com: did not receive HSTS header
-millions17.com: did not receive HSTS header
-millions19.com: did not receive HSTS header
+millions17.com: could not connect to host
+millions19.com: could not connect to host
millions20.com: did not receive HSTS header
millions22.com: did not receive HSTS header
millions25.com: did not receive HSTS header
@@ -11655,15 +12219,15 @@ millions36.com: did not receive HSTS header
millions37.com: did not receive HSTS header
millions38.com: did not receive HSTS header
millions39.com: did not receive HSTS header
-millions40.com: did not receive HSTS header
-millions41.com: did not receive HSTS header
-millions42.com: did not receive HSTS header
+millions40.com: could not connect to host
+millions41.com: could not connect to host
+millions42.com: could not connect to host
millions43.com: did not receive HSTS header
millions5.com: did not receive HSTS header
millions50.com: did not receive HSTS header
-millions51.com: did not receive HSTS header
-millions52.com: did not receive HSTS header
-millions53.com: did not receive HSTS header
+millions51.com: could not connect to host
+millions52.com: could not connect to host
+millions53.com: could not connect to host
millions55.com: did not receive HSTS header
millions56.com: did not receive HSTS header
millions57.com: did not receive HSTS header
@@ -11679,11 +12243,11 @@ millions7.com: did not receive HSTS header
millions70.com: did not receive HSTS header
millions71.com: did not receive HSTS header
millions72.com: did not receive HSTS header
-millions77.com: did not receive HSTS header
-millions8.com: did not receive HSTS header
+millions77.com: could not connect to host
+millions8.com: could not connect to host
millions80.com: did not receive HSTS header
millions81.com: did not receive HSTS header
-millions82.com: did not receive HSTS header
+millions82.com: could not connect to host
millions88.com: did not receive HSTS header
millions9.com: did not receive HSTS header
millions99.com: did not receive HSTS header
@@ -11704,7 +12268,7 @@ mindbodytherapymn.com: did not receive HSTS header
mindcell.no: could not connect to host
mindcraft.ga: could not connect to host
mindwork.space: could not connect to host
-mine.world: did not receive HSTS header
+mine.world: could not connect to host
minecraft-forum.cf: could not connect to host
minecraft-forum.ga: could not connect to host
minecraft-forum.gq: could not connect to host
@@ -11720,8 +12284,8 @@ minecraftserverz.com: could not connect to host
minecraftvoter.com: could not connect to host
mineover.es: could not connect to host
minetude.com: could not connect to host
-mingming.info: did not receive HSTS header
-mingo.nl: could not connect to host
+mingkyaa.com: could not connect to host
+mingo.nl: max-age too low: 2592000
mingy.ddns.net: could not connect to host
mingyueli.com: could not connect to host
minhanossasenhora.com.br: could not connect to host
@@ -11731,24 +12295,27 @@ minimaliston.com: could not connect to host
minimoo.se: could not connect to host
minipainting.net: could not connect to host
miniskipper.at: did not receive HSTS header
-minisoft4u.ir: did not receive HSTS header
+minitruckin.net: could not connect to host
miniwallaby.com: could not connect to host
minkondom.nu: could not connect to host
minnesotadata.com: could not connect to host
-minor.news: did not receive HSTS header
+minnesotamathcorps.org: did not receive HSTS header
+minor.news: could not connect to host
minora.io: could not connect to host
minoris.se: did not receive HSTS header
mintea-noua.ro: could not connect to host
mipiaci.co.nz: did not receive HSTS header
mipiaci.com.au: did not receive HSTS header
-mipla.ch: could not connect to host
+mipla.ch: did not receive HSTS header
miragrow.com: could not connect to host
mireillewendling.com.br: could not connect to host
+mirete.info: did not receive HSTS header
mirgleich.dnshome.de: could not connect to host
mirindadomo.ru: did not receive HSTS header
mironized.com: did not receive HSTS header
+mirrorbot.ga: did not receive HSTS header
mirrorsedgearchive.ga: could not connect to host
-mirrorx.com: did not receive HSTS header
+mirrorx.com: could not connect to host
miruc.co: did not receive HSTS header
mirucon.com: did not receive HSTS header
misconfigured.io: could not connect to host
@@ -11761,7 +12328,7 @@ missrain.tw: could not connect to host
missycosmeticos.com.br: could not connect to host
mist.ink: could not connect to host
mister-cooks.fr: did not receive HSTS header
-mister.hosting: did not receive HSTS header
+mister.hosting: could not connect to host
misterl.net: did not receive HSTS header
mitarbeiter-pc.de: did not receive HSTS header
mitchellrenouf.ca: could not connect to host
@@ -11772,8 +12339,10 @@ mittenhacks.com: could not connect to host
mityinc.com: did not receive HSTS header
miukimodafeminina.com: could not connect to host
mivcon.net: could not connect to host
+mivestuariolaboral.com: did not receive HSTS header
mivzaklive.co.il: did not receive HSTS header
mixer.cash: could not connect to host
+mixnshake.com: did not receive HSTS header
miya.io: could not connect to host
miyako-kyoto.jp: could not connect to host
miyoshi-kikaku.co.jp: could not connect to host
@@ -11782,11 +12351,12 @@ mizd.at: could not connect to host
mizi.name: could not connect to host
mizumax.me: could not connect to host
mjcaffarattilaw.com: did not receive HSTS header
-mjhsc.nl: did not receive HSTS header
-mjmnagy.info: did not receive HSTS header
+mjhsc.nl: could not connect to host
+mjscustomcreations.com.au: did not receive HSTS header
mk-dizajn.com: could not connect to host
mkacg.com: could not connect to host
mkakh.xyz: could not connect to host
+mkasu.org: max-age too low: 7776000
mkfs.be: could not connect to host
mkfs.fr: could not connect to host
mkg-palais-hanau.de: did not receive HSTS header
@@ -11803,16 +12373,16 @@ mlpepilepsy.org: could not connect to host
mlpvc-rr.ml: did not receive HSTS header
mlrslateroofing.com.au: did not receive HSTS header
mlsrv.de: could not connect to host
+mm-wife.com: could not connect to host
mmaps.ddns.net: could not connect to host
+mmaps.org: could not connect to host
mmarnitz.de: could not connect to host
mmcc.pe: did not receive HSTS header
mmgazhomeloans.com: could not connect to host
mmilog.hu: could not connect to host
-mmin.us: could not connect to host
mmmaximaliselmeny.hu: could not connect to host
mmmm.com: could not connect to host
mmstick.tk: could not connect to host
-mna7e.com: did not receive HSTS header
mncr.nl: could not connect to host
mnec.io: could not connect to host
mnedc.org: could not connect to host
@@ -11820,14 +12390,13 @@ mneeb.de: could not connect to host
mnemotiv.com: could not connect to host
mnetworkingsolutions.co.uk: could not connect to host
mnmt.no: did not receive HSTS header
-mnt9.de: could not connect to host
mnwt.nl: could not connect to host
mo3.club: could not connect to host
moar.so: did not receive HSTS header
-moas.design: did not receive HSTS header
-moas.photos: did not receive HSTS header
mobaircon.com: did not receive HSTS header
mobi4.tk: could not connect to host
+mobidea.com: did not receive HSTS header
+mobil-bei-uns.de: did not receive HSTS header
mobile-gesundheit.org: could not connect to host
mobile.eti.br: could not connect to host
mobilebay.top: could not connect to host
@@ -11870,6 +12439,7 @@ modemagazines.co.uk: could not connect to host
moderatortv.de: did not receive HSTS header
modernibytovytextil.cz: could not connect to host
moderntld.net: could not connect to host
+modistryusercontent.com: could not connect to host
mododo.de: could not connect to host
modx.by: max-age too low: 31536
modx.io: could not connect to host
@@ -11888,8 +12458,9 @@ moelord.org: could not connect to host
moen.io: did not receive HSTS header
moevenpick-cafe.com: did not receive HSTS header
moeyoo.net: could not connect to host
-moeyun.net: max-age too low: 86400
-mogry.net: did not receive HSTS header
+moeyun.net: max-age too low: 2592000
+mogooin.com: did not receive HSTS header
+mogry.net: could not connect to host
mohio.co.nz: did not receive HSTS header
moho.kr: could not connect to host
mohs.es: could not connect to host
@@ -11897,10 +12468,9 @@ moitur.com: did not receive HSTS header
mojapraca.sk: did not receive HSTS header
mojefilmy.xyz: could not connect to host
mojizuri.jp: max-age too low: 86400
-mojnet.eu: could not connect to host
-mojnet.net: could not connect to host
mokadev.com: did not receive HSTS header
mokken-fabriek.nl: did not receive HSTS header
+mokum-organics.com: could not connect to host
mols.me: could not connect to host
momento.co.id: did not receive HSTS header
momfulfilled.com: could not connect to host
@@ -11917,7 +12487,7 @@ monasterialis.eu: could not connect to host
monautoneuve.fr: did not receive HSTS header
mondar.io: could not connect to host
mondedesnovels.com: did not receive HSTS header
-mondopoint.com: could not connect to host
+mondopoint.com: did not receive HSTS header
mondwandler.de: could not connect to host
moneoci.com.br: could not connect to host
moneromerchant.com: could not connect to host
@@ -11944,11 +12514,12 @@ monozukuri.cafe: did not receive HSTS header
montanacures.org: could not connect to host
montanana.com: did not receive HSTS header
montand.com: did not receive HSTS header
-montazer.net: could not connect to host
monteurzimmerfrei.de: could not connect to host
montonicms.com: could not connect to host
moo.pet: did not receive HSTS header
+moobo.co.jp: did not receive HSTS header
moobo.xyz: did not receive HSTS header
+moodforsex.com: could not connect to host
moodifiers.com: could not connect to host
moojp.co.jp: could not connect to host
moon.lc: could not connect to host
@@ -11961,6 +12532,7 @@ moonysbouncycastles.co.uk: could not connect to host
mooretownrancheria-nsn.gov: could not connect to host
moosemanstudios.com: could not connect to host
moov.is: could not connect to host
+mop321.com: did not receive HSTS header
moparcraft.com: could not connect to host
moparcraft.org: could not connect to host
moparisthebest.biz: could not connect to host
@@ -11978,6 +12550,7 @@ morethanadream.lv: could not connect to host
morfitronik.pl: could not connect to host
morganestes.com: max-age too low: 0
morganino.eu: could not connect to host
+morgansjewelerspv.com: did not receive HSTS header
morhys.com: could not connect to host
morningcalculation.com: could not connect to host
morninglory.com: did not receive HSTS header
@@ -11986,11 +12559,12 @@ morotech.com.br: did not receive HSTS header
morpheusx.at: could not connect to host
morpheusxaut.net: could not connect to host
morpork.xyz: could not connect to host
-morrodafumacanoticias.com.br: did not receive HSTS header
+morrodafumacanoticias.com.br: could not connect to host
morz.org: max-age too low: 0
mosaique-lachenaie.fr: could not connect to host
moskva.guide: could not connect to host
moso.io: did not receive HSTS header
+mosshi.be: could not connect to host
mostlikelyto.fail: did not receive HSTS header
mostlyharmless.at: could not connect to host
mostlyinfinite.com: did not receive HSTS header
@@ -11999,7 +12573,6 @@ motherbase.io: could not connect to host
motherboard.services: could not connect to host
motionfreight.com: could not connect to host
motionpicturesolutions.com: could not connect to host
-motocollection.pl: did not receive HSTS header
motocyklovedily.cz: did not receive HSTS header
motomorgen.com: could not connect to host
motorbiketourhanoi.com: could not connect to host
@@ -12017,26 +12590,31 @@ moumaobuchiyu.com: could not connect to host
mounp.me: max-age too low: 2592000
mountainadventureseminars.com: did not receive HSTS header
mountainmusicpromotions.com: did not receive HSTS header
+mountainroseherbs.com: did not receive HSTS header
mountairymd.gov: could not connect to host
+mountfarmer.de: did not receive HSTS header
mousemessages.com: did not receive HSTS header
movabletype.net: did not receive HSTS header
moveek.com: did not receive HSTS header
moveisfit.com.br: could not connect to host
movepin.com: could not connect to host
+movestub.com: did not receive HSTS header
movie4k.fyi: could not connect to host
movie4k.life: could not connect to host
-moviedollars.com: did not receive HSTS header
+movie4kto.site: could not connect to host
+moviedollars.com: could not connect to host
movienang.com: max-age too low: 0
-movienized.de: did not receive HSTS header
+movienized.de: could not connect to host
moviepilot.com: did not receive HSTS header
moviesabout.net: could not connect to host
moviespur.info: did not receive HSTS header
moving-pixtures.de: could not connect to host
movingoklahoma.org: could not connect to host
-movio.ga: did not receive HSTS header
+movio.ga: could not connect to host
mowalls.net: could not connect to host
moy-gorod.od.ua: did not receive HSTS header
moyoo.net: did not receive HSTS header
+moysovet.info: could not connect to host
moyu.host: did not receive HSTS header
mozart-game.cz: could not connect to host
mozartgame.cz: could not connect to host
@@ -12046,20 +12624,22 @@ mozoa.net: could not connect to host
mozzilla.cz: could not connect to host
mp3donusturucu.com: did not receive HSTS header
mp3donusturucu.net: did not receive HSTS header
+mp3gratuiti.com: could not connect to host
mp3juices.is: could not connect to host
mpe.org: did not receive HSTS header
mpg.ovh: could not connect to host
mphoto.at: did not receive HSTS header
+mphwinkel.nl: did not receive HSTS header
mpi-sa.fr: did not receive HSTS header
mpintaamalabanna.it: could not connect to host
mpkossen.com: did not receive HSTS header
mpn.poker: did not receive HSTS header
+mpnpokertour.com: did not receive HSTS header
mpodraza.pl: could not connect to host
mpreserver.com: could not connect to host
mpserver12.org: could not connect to host
mpu-giessen.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
mpy.ovh: could not connect to host
-mqas.net: could not connect to host
mr-coffee.net: could not connect to host
mr-hosting.com: could not connect to host
mr-labo.jp: could not connect to host
@@ -12074,7 +12654,7 @@ mredsanders.net: did not receive HSTS header
mrettich.org: did not receive HSTS header
mrizzio.com: could not connect to host
mrksk.com: could not connect to host
-mrleonardo.com: did not receive HSTS header
+mrleonardo.com: max-age too low: 7889238
mrliu.me: could not connect to host
mrmoregame.de: could not connect to host
mrnh.tk: could not connect to host
@@ -12087,7 +12667,7 @@ mruganiepodspacja.pl: could not connect to host
ms-alternativ.de: did not receive HSTS header
msc-seereisen.net: could not connect to host
msgallery.tk: could not connect to host
-msopopop.cn: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+msopopop.cn: could not connect to host
msp66.de: could not connect to host
mstd.tokyo: did not receive HSTS header
mstdn-tech.jp: could not connect to host
@@ -12104,19 +12684,26 @@ mtd.ovh: could not connect to host
mtdn.jp: could not connect to host
mtfgnettoyage.fr: could not connect to host
mtg-esport.de: did not receive HSTS header
+mtg-tutor.de: did not receive HSTS header
mtirc.co: could not connect to host
mtn.cc: could not connect to host
+mtnz.co.za: could not connect to host
mtr.md: could not connect to host
mu3on.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
muahahahaha.co.uk: could not connect to host
+muchohentai.com: could not connect to host
+mud-status.de: did not receive HSTS header
mudgezero.one: could not connect to host
+muel.io: could not connect to host
muenzubi.de: did not receive HSTS header
-muffet.pw: did not receive HSTS header
+muffet.pw: could not connect to host
muga.space: could not connect to host
muj-svet.cz: could not connect to host
mujadin.se: did not receive HSTS header
mulenvo.com: did not receive HSTS header
+mulheres18.com: could not connect to host
mullen.net.au: did not receive HSTS header
+multigamecard.com: did not receive HSTS header
multiplexcy.com: could not connect to host
multiterm.org: could not connect to host
multivpn.cn.com: could not connect to host
@@ -12129,8 +12716,6 @@ mumei.space: could not connect to host
mundoadulto.com.br: did not receive HSTS header
mundoalpha.com.br: did not receive HSTS header
mundodoscarbonos.com.br: could not connect to host
-munduch.cz: could not connect to host
-munduch.eu: could not connect to host
munecoscabezones.com: did not receive HSTS header
munich-rage.de: did not receive HSTS header
munkiepus.com: did not receive HSTS header
@@ -12151,6 +12736,7 @@ murrayrun.com: did not receive HSTS header
mursu.directory: could not connect to host
murz.tv: could not connect to host
musaccostore.com: did not receive HSTS header
+muscleangels.com: could not connect to host
musearchengine.com: could not connect to host
museminder2.com: did not receive HSTS header
museumstreak.com: could not connect to host
@@ -12164,6 +12750,7 @@ musikkfondene.no: did not receive HSTS header
musikzug-bookholzberg.de: did not receive HSTS header
musique2nuit.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
muslimbanter.co.za: could not connect to host
+mustafa.space: did not receive HSTS header
mustika.cf: did not receive HSTS header
mutamatic.com: could not connect to host
mutuelle-obligatoire-pme.fr: did not receive HSTS header
@@ -12174,10 +12761,11 @@ muzykaprzeszladoplay.pl: could not connect to host
mvanmarketing.nl: did not receive HSTS header
mvnet.com.br: did not receive HSTS header
mvsecurity.nl: could not connect to host
+mwalz.com: could not connect to host
mwohlfarth.de: did not receive HSTS header
mxawei.cn: could not connect to host
-mxlife.org: could not connect to host
mxp.tw: did not receive HSTS header
+my-cdn.de: could not connect to host
my-demo.co: could not connect to host
my-dick.ru: max-age too low: 0
my-owncloud.com: could not connect to host
@@ -12195,11 +12783,9 @@ myandroidtools.pro: could not connect to host
myappliancerepairhouston.com: did not receive HSTS header
myartsway.com: did not receive HSTS header
mybboard.pl: did not receive HSTS header
-mybreastcancerjourney.com: could not connect to host
mybudget.xyz: could not connect to host
mybuilderinlondon.co.uk: did not receive HSTS header
mybusiness.cm: did not receive HSTS header
-mycard.moe: could not connect to host
mychocolateweightloss.com: could not connect to host
myclientsplus.com: did not receive HSTS header
mycollab.net: could not connect to host
@@ -12208,6 +12794,7 @@ mycompanion.cz: could not connect to host
mycontrolmonitor.com: could not connect to host
mycoted.com: did not receive HSTS header
mycreativeartsconsulting.com: could not connect to host
+mycuco.it: did not receive HSTS header
mydarkstar.net: did not receive HSTS header
myday.eu.com: did not receive HSTS header
mydeos.com: could not connect to host
@@ -12215,8 +12802,9 @@ mydigipass.com: did not receive HSTS header
mydmdi.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
mydnaresults.com: could not connect to host
mydnatest.com: did not receive HSTS header
+mydreamlifelab.com: could not connect to host
mydriversedge.com: did not receive HSTS header
-mydrone.services: could not connect to host
+mydrone.services: did not receive HSTS header
mydroneservices.ca: did not receive HSTS header
mydroneservices.com: did not receive HSTS header
myeml.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -12226,10 +12814,10 @@ myessaygeek.com: could not connect to host
myfappening.org: could not connect to host
myfdic.gov: could not connect to host
myfishpalace.at: could not connect to host
-myfloridadeferredcomp.com: did not receive HSTS header
myfunworld.de: could not connect to host
-mygalgame.com: could not connect to host
+mygalgame.com: did not receive HSTS header
mygaysitges.com: could not connect to host
+mygedit.com: could not connect to host
mygivingcircle.org: did not receive HSTS header
mygooder.com: did not receive HSTS header
mygov.scot: did not receive HSTS header
@@ -12238,7 +12826,6 @@ mygreatjob.eu: could not connect to host
mygreenrecipes.com: could not connect to host
myhair.asia: did not receive HSTS header
myhloli.com: did not receive HSTS header
-myhostname.net: could not connect to host
myicare.org: did not receive HSTS header
myiocc.org: did not receive HSTS header
myip.tech: max-age too low: 2592000
@@ -12260,6 +12847,7 @@ myni.io: could not connect to host
mynigma.org: did not receive HSTS header
myon.info: did not receive HSTS header
myonlinedating.club: could not connect to host
+myonlinevehicleinsurance.com: could not connect to host
myownconference.de: did not receive HSTS header
myownconference.es: did not receive HSTS header
myownconference.fr: did not receive HSTS header
@@ -12276,9 +12864,12 @@ myparfumerie.at: did not receive HSTS header
mypension.ca: could not connect to host
myperfumecollection.com: did not receive HSTS header
myphonebox.de: could not connect to host
+myproxy.eu.org: could not connect to host
myptsite.com: could not connect to host
+mypup.nl: did not receive HSTS header
myqdu.cn: could not connect to host
myqdu.com: could not connect to host
+myranicol.com: did not receive HSTS header
myrig.com.ua: did not receive HSTS header
myrig.io: could not connect to host
myrig.ru: did not receive HSTS header
@@ -12289,11 +12880,11 @@ mysecretrewards.com: could not connect to host
myseo.ga: could not connect to host
myserv.one: could not connect to host
myseu.cn: did not receive HSTS header
-mysocialporn.com: could not connect to host
-mysongbird.xyz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+myshirtsize.com: did not receive HSTS header
+mysongbird.xyz: could not connect to host
myspa.asia: did not receive HSTS header
mystatus24.com: did not receive HSTS header
-mystery-science-theater-3000.de: did not receive HSTS header
+mystery-science-theater-3000.de: could not connect to host
mysteryblog.de: did not receive HSTS header
mystown.org: could not connect to host
mystudy.me: could not connect to host
@@ -12310,7 +12901,6 @@ mywebinar.io: could not connect to host
myxbox.gr: max-age too low: 0
myzone.com: max-age too low: 0
mzlog.win: could not connect to host
-mzorn.photography: could not connect to host
n-rickroll-e.pw: could not connect to host
n-x.info: could not connect to host
n0099.cf: did not receive HSTS header
@@ -12320,6 +12910,7 @@ n2host.eu: could not connect to host
n2x.in: could not connect to host
n3twork.net: could not connect to host
n4l.pw: could not connect to host
+n5118.com: could not connect to host
n64chan.me: could not connect to host
na.hn: could not connect to host
naano.org: could not connect to host
@@ -12330,8 +12921,10 @@ nacktwanderfreunde.de: did not receive HSTS header
nadia.pt: could not connect to host
nagajanroshiya.info: did not receive HSTS header
nagaragem.com.br: did not receive HSTS header
+nagb.org: could not connect to host
nagios.by: did not receive HSTS header
nagoya-kyuyo.com: could not connect to host
+nagrad.tk: did not receive HSTS header
naiaspa.fr: did not receive HSTS header
naiharngym.com: did not receive HSTS header
nailedithomebuilders.com: max-age too low: 300
@@ -12344,7 +12937,6 @@ nakitbonus2.com: could not connect to host
nakliyatsirketi.biz: could not connect to host
nakuro.de: could not connect to host
nalao-company.com: did not receive HSTS header
-nalexandru.xyz: could not connect to host
nalifornia.com: could not connect to host
nalinux.cz: could not connect to host
nallon.com.br: could not connect to host
@@ -12355,6 +12947,7 @@ named.ga: could not connect to host
nameme.xyz: could not connect to host
nametaken-cloud.duckdns.org: could not connect to host
namethatbone.com: could not connect to host
+namethatporn.com: could not connect to host
namethissymbol.com: could not connect to host
nami.exchange: did not receive HSTS header
namikawatetsuji.jp: could not connect to host
@@ -12372,14 +12965,12 @@ nanosingularity.com: could not connect to host
nanrenba.net: could not connect to host
nanto.eu: could not connect to host
naoar.com: could not connect to host
+naotone.com: did not receive HSTS header
naphex.rocks: could not connect to host
naphogar.com: did not receive HSTS header
napisynapomniky.cz: did not receive HSTS header
nappynko.com: did not receive HSTS header
narach.com: did not receive HSTS header
-narenderchopra.com: could not connect to host
-nargele.eu: did not receive HSTS header
-narindal.ch: did not receive HSTS header
narko.space: could not connect to host
narviz.com: did not receive HSTS header
nasarawanewsonline.com: could not connect to host
@@ -12394,16 +12985,17 @@ natalia.io: did not receive HSTS header
natalieandjoshua.com: could not connect to host
natalt.org: did not receive HSTS header
natalydanilova.com: max-age too low: 300
+natanaelys.com: could not connect to host
nataniel-perissier.fr: could not connect to host
natatorium.org: did not receive HSTS header
nate.sh: could not connect to host
-natecraun.net: did not receive HSTS header
natenom.com: max-age too low: 7200
natenom.de: max-age too low: 7200
natenom.name: max-age too low: 7200
+nathumarket.com.br: could not connect to host
nationalmall.gov: could not connect to host
+nationaltaxprep.com: could not connect to host
nationwidevehiclecontracts.co.uk: did not receive HSTS header
-natropie.pl: could not connect to host
natur-udvar.hu: could not connect to host
natural-progesterone.net: could not connect to host
naturalcommission.com: could not connect to host
@@ -12435,6 +13027,7 @@ nbg-ha.de: could not connect to host
nbis.gov: could not connect to host
nbl.org.tw: could not connect to host
nbp.com.pk: did not receive HSTS header
+nbrown.us: could not connect to host
nbtparse.org: could not connect to host
nc2c.com: could not connect to host
nca.ink: could not connect to host
@@ -12458,13 +13051,15 @@ nearbi.com.mx: could not connect to host
nearbiwa.com: did not receive HSTS header
nearon.nl: could not connect to host
neavision.de: did not receive HSTS header
+nebracy.com: could not connect to host
+nebras.ga: could not connect to host
nebulousenhanced.com: could not connect to host
necesitodinero.org: could not connect to host
necio.ca: could not connect to host
nedcf.org.uk: could not connect to host
nediyor.com: did not receive HSTS header
nedwave.com: could not connect to host
-nedys.top: did not receive HSTS header
+nedys.top: could not connect to host
needle.net.nz: could not connect to host
needle.nz: could not connect to host
neels.ch: did not receive HSTS header
@@ -12475,9 +13070,8 @@ neftebitum-kngk.ru: did not receive HSTS header
negativecurvature.net: could not connect to host
negativzinsen.info: did not receive HSTS header
negraelinda.com: did not receive HSTS header
-nehrp.gov: could not connect to host
neilgreen.net: did not receive HSTS header
-neio.uk: could not connect to host
+neilshealthymeals.com: did not receive HSTS header
nejkasy.cz: did not receive HSTS header
nejnamc.org: did not receive HSTS header
neko-life.com: did not receive HSTS header
@@ -12491,14 +13085,14 @@ nellacms.com: could not connect to host
nellacms.org: could not connect to host
nellafw.org: could not connect to host
nellen.it: did not receive HSTS header
-nemanja.top: did not receive HSTS header
+nemanja.top: could not connect to host
nemecl.eu: could not connect to host
nemno.de: could not connect to host
nemovement.org: could not connect to host
-neoani.me: did not receive HSTS header
-neocoding.com: did not receive HSTS header
+nemumu.com: could not connect to host
+neoani.me: could not connect to host
+neocoding.com: could not connect to host
neocyd.com: could not connect to host
-neodrive.ch: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
neoeliteconsulting.com: could not connect to host
neofelhz.space: could not connect to host
neojames.me: could not connect to host
@@ -12506,7 +13100,7 @@ neokobe.city: could not connect to host
neolink.dk: could not connect to host
neonisi.com: could not connect to host
neonnuke.tech: did not receive HSTS header
-neosolution.ca: did not receive HSTS header
+neosolution.ca: could not connect to host
neotist.com: did not receive HSTS header
neowa.tk: could not connect to host
nephos.xyz: could not connect to host
@@ -12518,10 +13112,9 @@ nerfroute.com: could not connect to host
neris.io: could not connect to host
neriumhcp.com: did not receive HSTS header
nesantuoka.lt: could not connect to host
-nesbase.com: could not connect to host
-nestedquotes.ca: could not connect to host
nesterov.pw: could not connect to host
nestone.ru: could not connect to host
+net-masters.pl: could not connect to host
net-navi.cc: did not receive HSTS header
net-rencontre.com: did not receive HSTS header
net2o.com: did not receive HSTS header
@@ -12531,6 +13124,7 @@ net4it.de: did not receive HSTS header
netba.net: could not connect to host
netbox.cc: could not connect to host
netbrief.ml: could not connect to host
+netd.at: max-age too low: 172800
netde.jp: did not receive HSTS header
netdego.jp: could not connect to host
netducks.space: could not connect to host
@@ -12548,17 +13142,21 @@ netscaler.expert: could not connect to host
netsight.org: could not connect to host
netsparkercloud.com: did not receive HSTS header
netsystems.pro: could not connect to host
+nettacompany.com.tr: did not receive HSTS header
nettefoundation.com: could not connect to host
nettopower.dk: did not receive HSTS header
nettoyage.email: could not connect to host
nettplusultra-rhone.fr: did not receive HSTS header
-networkmon.net: could not connect to host
+netulo.com: could not connect to host
+networking-groups.co.uk: could not connect to host
+networth.at: did not receive HSTS header
networx-online.de: could not connect to host
netzbit.de: could not connect to host
netzpolitik.org: max-age too low: 2592000
netztest.at: did not receive HSTS header
netzvieh.de: could not connect to host
-netzzwerg4u.de: could not connect to host
+netzzwerg4u.de: did not receive HSTS header
+neuber.uno: could not connect to host
neuch.info: did not receive HSTS header
neueonlinecasino2016.com: could not connect to host
neuhaus-city.de: could not connect to host
@@ -12572,20 +13170,19 @@ nevadafiber.net: could not connect to host
never-afk.de: did not receive HSTS header
neveta.com: could not connect to host
new: could not connect to host
-new.travel.pl: could not connect to host
newantiagingcreams.com: could not connect to host
newbasemedia.us: did not receive HSTS header
newbieboss.com: did not receive HSTS header
newbownerton.xyz: could not connect to host
newchance.store: could not connect to host
+newcitygas.ca: did not receive HSTS header
newcityinfo.info: could not connect to host
newcreamforface.com: could not connect to host
newdeveloper.download: could not connect to host
newedivideo.it: could not connect to host
newfacialbeautycream.com: could not connect to host
newgenerationplus.org: could not connect to host
-newhdmovies.io: could not connect to host
-newline.online: did not receive HSTS header
+newhdmovies.io: did not receive HSTS header
newlooknow.com: did not receive HSTS header
newparadigmventures.net: did not receive HSTS header
newpathintegratedtherapy.com: could not connect to host
@@ -12604,11 +13201,10 @@ newtonwarp.com: could not connect to host
nexgeneration-solutions.com: could not connect to host
nexlab.org: did not receive HSTS header
nexril.net: max-age too low: 7776000
-next-taxi.ru: could not connect to host
next47.com: did not receive HSTS header
-nextcloud.org: could not connect to host
+nextcloud.org: did not receive HSTS header
nextend.net: did not receive HSTS header
-nextend.org: did not receive HSTS header
+nextend.org: could not connect to host
nexth.de: could not connect to host
nexth.net: did not receive HSTS header
nexth.us: could not connect to host
@@ -12620,6 +13216,7 @@ nextshutter.com: did not receive HSTS header
nexus-vienna.at: could not connect to host
nexusbyte.de: could not connect to host
nexuscorporation.in: could not connect to host
+nezvestice.cz: did not receive HSTS header
nfhome.be: did not receive HSTS header
nfluence.org: could not connect to host
nfo.so: could not connect to host
@@ -12628,6 +13225,7 @@ ng-firewall.com: did not receive HSTS header
ng-security.com: could not connect to host
ngiemboon.net: could not connect to host
ngine.ch: did not receive HSTS header
+nginxconfig.com: could not connect to host
nginxnudes.com: could not connect to host
nginxyii.tk: could not connect to host
ngla.gov: could not connect to host
@@ -12658,19 +13256,25 @@ nidux.com: did not receive HSTS header
niduxcomercial.com: could not connect to host
niedersetz.de: could not connect to host
niedrigsterpreis.de: did not receive HSTS header
+nielshoogenhout.be: did not receive HSTS header
+nielshoogenhout.eu: did not receive HSTS header
+nielshoogenhout.nl: did not receive HSTS header
nien.chat: could not connect to host
nien.com.tw: could not connect to host
+nien.taipei: could not connect to host
nienfun.com: could not connect to host
nieuwsoverijssel.nl: did not receive HSTS header
niffler.software: could not connect to host
nifpnet.nl: could not connect to host
nifume.com: could not connect to host
+nigger.racing: could not connect to host
nightsnack.cf: could not connect to host
nightwinds.tk: could not connect to host
nigt.cf: did not receive HSTS header
niho.jp: did not receive HSTS header
nikcub.com: did not receive HSTS header
niki.ai: did not receive HSTS header
+nikklassen.ca: did not receive HSTS header
nikksno.io: could not connect to host
niklas.host: could not connect to host
niklasanderson.com: did not receive HSTS header
@@ -12680,6 +13284,7 @@ nikolaichik.photo: did not receive HSTS header
nikolasbradshaw.com: could not connect to host
nikz.in: did not receive HSTS header
nilianwo.com: could not connect to host
+nilrem.org: did not receive HSTS header
ninchisho-online.com: did not receive HSTS header
ninebytes.xyz: could not connect to host
ning.so: did not receive HSTS header
@@ -12700,6 +13305,7 @@ nishikino-maki.com: could not connect to host
nishisbma.com: could not connect to host
nitaonline.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
nitix.games: could not connect to host
+nitropanel.com: did not receive HSTS header
niva.synology.me: could not connect to host
niveldron.com: could not connect to host
nivi.ca: could not connect to host
@@ -12721,13 +13327,14 @@ nmgb.ga: could not connect to host
nmgb.ml: could not connect to host
nmsnj.com: did not receive HSTS header
nmueller.at: could not connect to host
-nn78.com: could not connect to host
+nn78.com: did not receive HSTS header
nnote.net: did not receive HSTS header
nnya.cat: could not connect to host
no17sifangjie.cc: could not connect to host
noc.wang: could not connect to host
nocallaghan.com: could not connect to host
noclegi-online.pl: did not receive HSTS header
+nocs.cn: could not connect to host
noctinus.tk: could not connect to host
nodalr.com: did not receive HSTS header
nodari.com.ar: did not receive HSTS header
@@ -12736,17 +13343,16 @@ node-core-app.com: could not connect to host
nodebrewery.com: could not connect to host
nodechate.xyz: could not connect to host
nodecompat.com: did not receive HSTS header
-nodefiles.com: could not connect to host
+nodefiles.com: did not receive HSTS header
nodefoo.com: could not connect to host
-nodelab-it.de: could not connect to host
nodepanel.net: did not receive HSTS header
nodepositcasinouk.com: did not receive HSTS header
nodeselect.com: could not connect to host
-nodesturut.cl: could not connect to host
+nodesturut.cl: did not receive HSTS header
nodetemple.com: could not connect to host
nodi.at: did not receive HSTS header
nodum.io: did not receive HSTS header
-noegoph.com: could not connect to host
+noegoph.com: did not receive HSTS header
noelblog.ga: could not connect to host
noelssanssoucipensacola.com: did not receive HSTS header
noesberts-weidmoos.de: did not receive HSTS header
@@ -12754,6 +13360,7 @@ noexpect.org: could not connect to host
noisebridge.social: could not connect to host
nojestorget.se: did not receive HSTS header
nojok.es: could not connect to host
+nokia.la: could not connect to host
nolag.host: could not connect to host
nolatepayments.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
nolberg.net: did not receive HSTS header
@@ -12764,10 +13371,10 @@ nomoondev.azurewebsites.net: [Exception... "Component returned failure code: 0x8
nomorebytes.de: could not connect to host
nonabytes.xyz: could not connect to host
nonemu.ninja: could not connect to host
+noobswhatelse.net: could not connect to host
noodlecrave.com: did not receive HSTS header
noodlesandwich.com: did not receive HSTS header
-noodleyum.com: did not receive HSTS header
-noop.ch: could not connect to host
+noodleyum.com: could not connect to host
nootropicpedia.com: could not connect to host
nootropicsource.com: did not receive HSTS header
nope.website: could not connect to host
@@ -12780,6 +13387,7 @@ nordic-survival.de: could not connect to host
nordiccasinocommunity.com: did not receive HSTS header
nordicess.dk: could not connect to host
nordlicht.photography: did not receive HSTS header
+nordwal.de: could not connect to host
noref.tk: could not connect to host
norge.guide: could not connect to host
normalady.com: could not connect to host
@@ -12796,6 +13404,7 @@ nosecretshop.com: could not connect to host
nosfermiers.com: could not connect to host
nosproduitsdequalite.fr: did not receive HSTS header
nossasenhoradaconceicao.com.br: could not connect to host
+nostosh.eu.org: could not connect to host
nostraspace.com: could not connect to host
nosx.tk: could not connect to host
not-a.link: could not connect to host
@@ -12812,16 +13421,14 @@ note7forever.com: could not connect to host
notenoughtime.de: could not connect to host
notesforpebble.com: could not connect to host
notevencode.com: could not connect to host
-nothing.net.nz: max-age too low: 7776000
nothing.org.uk: could not connect to host
noticia.do: did not receive HSTS header
notificami.com: could not connect to host
-notjustbitchy.com: did not receive HSTS header
+notjustbitchy.com: could not connect to host
notonprem.com: could not connect to host
notrecourrier.net: did not receive HSTS header
nottheonion.net: did not receive HSTS header
nottori.com: could not connect to host
-nottres.com: could not connect to host
notypiesni.sk: did not receive HSTS header
nou.si: did not receive HSTS header
nouma.fr: did not receive HSTS header
@@ -12839,8 +13446,7 @@ novelabs.de: could not connect to host
novelabs.eu: could not connect to host
novelrealm.com: did not receive HSTS header
novelshouse.com: could not connect to host
-novfishing.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-novinhabucetuda.com: did not receive HSTS header
+novinhabucetuda.com: could not connect to host
novtest.ru: did not receive HSTS header
nowcost.com: could not connect to host
noworrywp.com: could not connect to host
@@ -12852,13 +13458,11 @@ npm.li: did not receive HSTS header
npol.de: could not connect to host
npool.org: did not receive HSTS header
nq7.pl: could not connect to host
-nqeshreviewer.com: could not connect to host
nrc-gateway.gov: could not connect to host
nrechn.de: could not connect to host
nrizzio.me: could not connect to host
nrnjn.xyz: did not receive HSTS header
nrvnastudios.com: could not connect to host
-nsa.ovh: could not connect to host
nsa.wtf: could not connect to host
nsbfalconacademy.org: could not connect to host
nsdev.cn: could not connect to host
@@ -12870,7 +13474,6 @@ nstyleintl.ca: did not receive HSTS header
nsure.us: could not connect to host
nsweb.solutions: could not connect to host
ntbs.pro: could not connect to host
-nth.sh: did not receive HSTS header
ntse.xyz: could not connect to host
nu-pogodi.net: could not connect to host
nu3.at: did not receive HSTS header
@@ -12890,25 +13493,24 @@ nuclear-crimes.com: did not receive HSTS header
nuclearcrimes.com: did not receive HSTS header
nuclearcrimes1.com: did not receive HSTS header
nudel.ninja: could not connect to host
-nudestpics.com: did not receive HSTS header
+nudestpics.com: could not connect to host
nufla.de: could not connect to host
nugetdependencies.com: did not receive HSTS header
nuiguru.me: could not connect to host
nukenet.se: could not connect to host
nukute.com: did not receive HSTS header
-nulap.com: did not receive HSTS header
+nulap.com: could not connect to host
null-pointer.eu: did not receive HSTS header
null-sec.ru: could not connect to host
null.cat: did not receive HSTS header
null.tips: could not connect to host
nullpoint.at: did not receive HSTS header
nullpro.com: could not connect to host
-numberzero.org: could not connect to host
numericacu.com: did not receive HSTS header
numero-di-telefono.it: could not connect to host
-numis.tech: could not connect to host
numista.com: did not receive HSTS header
numm.fr: did not receive HSTS header
+nuos.org: could not connect to host
nuovamoda.al: could not connect to host
nup.pw: could not connect to host
nupef.org.br: did not receive HSTS header
@@ -12930,7 +13532,9 @@ nvlop.xyz: did not receive HSTS header
nwa.xyz: could not connect to host
nweb.co.nz: could not connect to host
nwork.media: did not receive HSTS header
-nxt.sh: did not receive HSTS header
+nwr-waffenbuch.de: did not receive HSTS header
+nwuss.okinawa: could not connect to host
+nxt.sh: could not connect to host
nyanco.space: could not connect to host
nyanpasu.tv: could not connect to host
nyatane.com: could not connect to host
@@ -12939,6 +13543,7 @@ nycroth.com: could not connect to host
nydnxs.com: did not receive HSTS header
nyesider.org: could not connect to host
nyffo.com: did not receive HSTS header
+nylonfeetporn.com: could not connect to host
nyored.com: did not receive HSTS header
nyphox.net: could not connect to host
nysepho.pw: could not connect to host
@@ -12947,6 +13552,7 @@ nystart.no: did not receive HSTS header
nystudio107.com: did not receive HSTS header
nyuusannkinn.com: did not receive HSTS header
nz.search.yahoo.com: max-age too low: 172800
+nzbr.de: did not receive HSTS header
nzbs.io: could not connect to host
nzdmo.govt.nz: did not receive HSTS header
nzmk.cz: could not connect to host
@@ -12954,6 +13560,8 @@ nzquakes.maori.nz: did not receive HSTS header
o-loska.cz: did not receive HSTS header
o-rickroll-y.pw: could not connect to host
o0o.one: did not receive HSTS header
+o5.cx: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+o8b.club: could not connect to host
oaksbloom.com: could not connect to host
oasis-conference.org.nz: could not connect to host
oasis.mobi: could not connect to host
@@ -12962,35 +13570,35 @@ oben.pl: did not receive HSTS header
oberam.de: could not connect to host
oberhof.co: could not connect to host
oberhofjuice.com: could not connect to host
-oberoi.de: did not receive HSTS header
+oberoi.de: max-age too low: 600000
obioncountytn.gov: could not connect to host
objectif-leger.com: did not receive HSTS header
oblikdom.pro: did not receive HSTS header
oblikdom.ru: did not receive HSTS header
oblondata.io: did not receive HSTS header
obrienlab.com: did not receive HSTS header
-obscur.us: could not connect to host
obscuredfiles.com: could not connect to host
observatory.se: could not connect to host
-obsessharness.com: could not connect to host
+obsidianirc.net: could not connect to host
obsydian.org: could not connect to host
oc-minecraft.com: could not connect to host
ocad.com.au: did not receive HSTS header
ocapic.com: could not connect to host
occasion-impro.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
occupymedia.org: could not connect to host
+ocelot.help: did not receive HSTS header
ochaken.cf: could not connect to host
ocloudhost.com: could not connect to host
ocmeulebeke.be: did not receive HSTS header
ocrami.us: did not receive HSTS header
-octal.es: could not connect to host
+octal.es: did not receive HSTS header
octanio.com: did not receive HSTS header
octo.im: could not connect to host
octocat.ninja: could not connect to host
octod.tk: could not connect to host
octohost.net: did not receive HSTS header
-octothorpe.ninja: could not connect to host
oddmouse.com: could not connect to host
+odifi.com: could not connect to host
odin.xxx: could not connect to host
odinkapital.no: did not receive HSTS header
odinoffice.no: did not receive HSTS header
@@ -12999,7 +13607,7 @@ odysseyandco.com: could not connect to host
odysseyconservationtrust.com: did not receive HSTS header
oe8.bet: could not connect to host
ofcourselanguages.com: could not connect to host
-ofcss.com: did not receive HSTS header
+ofcss.com: could not connect to host
ofer.site: could not connect to host
off-the-clock.us: could not connect to host
offenedialoge.de: max-age too low: 2592000
@@ -13009,13 +13617,12 @@ offgames.pro: could not connect to host
office-ruru.com: could not connect to host
officeclub.com.mx: did not receive HSTS header
officeprint.co.th: could not connect to host
-officium.tech: could not connect to host
offshore-firma.org: could not connect to host
offshore-unternehmen.com: could not connect to host
offshorefirma-gruenden.com: could not connect to host
offtherails.ie: could not connect to host
oficinadocelular.com.br: could not connect to host
-ofo2.com: could not connect to host
+ofo2.com: did not receive HSTS header
oganek.ie: could not connect to host
oganime.com: could not connect to host
oggw.us: could not connect to host
@@ -13024,6 +13631,7 @@ ogogoshop.com: could not connect to host
ogrodywstudniach.pl: did not receive HSTS header
ohayosoro.me: could not connect to host
ohhdeertrade.com: did not receive HSTS header
+ohling.org: could not connect to host
ohm2013.org: did not receive HSTS header
ohma.ga: did not receive HSTS header
ohnemusik.com: did not receive HSTS header
@@ -13032,6 +13640,7 @@ ohreally.de: could not connect to host
ohsocool.org: did not receive HSTS header
oiaio.cn: could not connect to host
oiepoie.nl: could not connect to host
+oil-ecn.ru: did not receive HSTS header
oilfieldinjury.attorney: could not connect to host
oinky.ddns.net: could not connect to host
oishioffice.com: did not receive HSTS header
@@ -13039,12 +13648,7 @@ ojanaho.com: did not receive HSTS header
ojbk.eu: could not connect to host
ojeremy.com: did not receive HSTS header
ojls.co: could not connect to host
-okad-center.de: did not receive HSTS header
-okad.de: did not receive HSTS header
-okad.eu: did not receive HSTS header
-okaidi.es: could not connect to host
okane.love: did not receive HSTS header
-okaz.de: did not receive HSTS header
oklahomamoversassociation.org: could not connect to host
oklahomanotepro.com: could not connect to host
okok-rent.com: could not connect to host
@@ -13053,10 +13657,10 @@ okonetwork.org.uk: could not connect to host
okutama.in.th: could not connect to host
olafnorge.de: did not receive HSTS header
olcso-vps-szerver.hu: could not connect to host
-oldandyounglesbians.us: did not receive HSTS header
+oldandyounglesbians.us: could not connect to host
oldbrookinflatables.co.uk: did not receive HSTS header
oldenglishsheepdog.com.br: could not connect to host
-oldschool-criminal.com: did not receive HSTS header
+oldonyosafaris.com: did not receive HSTS header
oldtimer-trifft-flugplatz.de: did not receive HSTS header
olightstore.com: did not receive HSTS header
oliode.tk: could not connect to host
@@ -13069,20 +13673,26 @@ olympe-transport.fr: did not receive HSTS header
omacostudio.com: could not connect to host
omar.yt: did not receive HSTS header
omarsuniagamusic.ga: did not receive HSTS header
+omdesign.cz: did not receive HSTS header
omeuanimal.com: did not receive HSTS header
omgaanmetidealen.com: could not connect to host
omifind.com: did not receive HSTS header
-ominto.com: could not connect to host
+ominto.com: max-age too low: 0
omise.co: did not receive HSTS header
+omlmetal.co.jp: max-age too low: 0
ommahpost.com: did not receive HSTS header
omnigon.network: could not connect to host
omnilab.tech: could not connect to host
omnisafira.com: did not receive HSTS header
-omniti.com: max-age too low: 1
+omniscimus.net: could not connect to host
+omniti.com: did not receive HSTS header
+omorashi.org: could not connect to host
omquote.gq: could not connect to host
omskit.ru: could not connect to host
omyogarishikesh.com: did not receive HSTS header
on-te.ch: did not receive HSTS header
+on.tax: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+onazikgu.com: could not connect to host
ondrejhoralek.cz: did not receive HSTS header
one-pe.com: did not receive HSTS header
onearth.one: did not receive HSTS header
@@ -13100,8 +13710,6 @@ oneminutefilm.tv: did not receive HSTS header
onemusou.com: could not connect to host
onepathnetwork.com: max-age too low: 7776000
onepluscamps.com: did not receive HSTS header
-onepointsafeband.ca: could not connect to host
-onepointsafeband.com: could not connect to host
onepopstore.com: could not connect to host
onespiritinc.com: did not receive HSTS header
onet.space: could not connect to host
@@ -13109,21 +13717,25 @@ onetly.com: could not connect to host
onewebdev.info: could not connect to host
oneworldbank.com: did not receive HSTS header
onewpst.com: could not connect to host
+ongea.io: could not connect to host
onguardonline.gov: did not receive HSTS header
oniichan.us: did not receive HSTS header
onionbot.ga: could not connect to host
onioncloud.org: could not connect to host
onionplay.live: could not connect to host
+onionplay.org: could not connect to host
onionsburg.com: could not connect to host
-onkfaktor.de: could not connect to host
online-casino.eu: did not receive HSTS header
online-horoskop.ch: did not receive HSTS header
online-results.dk: did not receive HSTS header
online-scene.com: did not receive HSTS header
online-wetten.de: could not connect to host
+online.net.gr: could not connect to host
+online.swedbank.se: did not receive HSTS header
onlinebiller.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
onlinebillingform.com: could not connect to host
onlinecasinobluebook.com: could not connect to host
+onlinecasinoselite.org: did not receive HSTS header
onlinecompliance.org: did not receive HSTS header
onlinecorners.com: did not receive HSTS header
onlinedemo.hu: could not connect to host
@@ -13131,8 +13743,10 @@ onlinedeposit.us: could not connect to host
onlineinfographic.com: could not connect to host
onlinekasino.de: did not receive HSTS header
onlinepollsph.com: could not connect to host
+onlineporno.tv: could not connect to host
onlineschadestaat.nl: did not receive HSTS header
onlinespielothek.com: could not connect to host
+onlinestoreninjas.com: did not receive HSTS header
onlineweblearning.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
onlinewetten.de: could not connect to host
only-roses.co.uk: did not receive HSTS header
@@ -13159,6 +13773,7 @@ ontheboard.com: did not receive HSTS header
onthecheap.store: could not connect to host
ontheten.org: did not receive HSTS header
ontimestamp.com: did not receive HSTS header
+onvirt.de: could not connect to host
onwie.com: could not connect to host
onwie.fr: could not connect to host
onyxwall.com: could not connect to host
@@ -13168,20 +13783,22 @@ oo.edu.rs: could not connect to host
ooeste.com: could not connect to host
ookjesprookje.nl: could not connect to host
ooooush.co.uk: could not connect to host
+oopsis.com: could not connect to host
oopsmycase.com: could not connect to host
oopsorup.com: could not connect to host
oosoo.org: could not connect to host
oost.io: could not connect to host
+op11.co.uk: could not connect to host
opadaily.com: could not connect to host
opatut.de: did not receive HSTS header
opcaobolsas.com.br: could not connect to host
-open-future.be: did not receive HSTS header
open-mx.de: could not connect to host
open-to-repair.fr: max-age too low: 86400
-openacademies.com: could not connect to host
+openacademies.com: did not receive HSTS header
openas.org: did not receive HSTS header
openbankproject.com: did not receive HSTS header
openbsd.id: could not connect to host
+openbsd.rocks: could not connect to host
openclub24.ru: could not connect to host
opencluster.at: could not connect to host
openconcept.no: did not receive HSTS header
@@ -13193,12 +13810,13 @@ openiocdb.com: could not connect to host
openmetals.com: could not connect to host
openmind-shop.de: did not receive HSTS header
openmirrors.cf: could not connect to host
+openpictures.ch: could not connect to host
openpresentes.com.br: could not connect to host
openpriv.pw: could not connect to host
openprovider.nl: did not receive HSTS header
openrainbow.org: could not connect to host
-openre.site: did not receive HSTS header
openrtv.com: did not receive HSTS header
+openruhr.de: did not receive HSTS header
openshift.redhat.com: did not receive HSTS header
opensourcedmind.eu: could not connect to host
opensourcehouse.net: could not connect to host
@@ -13214,11 +13832,10 @@ opinion8td.com: did not receive HSTS header
opinionicentrifuga.it: could not connect to host
opinionipannolini.it: could not connect to host
opioids.com: could not connect to host
-oportho.com.br: could not connect to host
+oportho.com.br: did not receive HSTS header
oportunidadesemfoco.com.br: could not connect to host
opp.ag: did not receive HSTS header
oppag.com.br: did not receive HSTS header
-oppaiti.me: could not connect to host
opperwall.net: could not connect to host
opposer.me: could not connect to host
opsafewinter.net: could not connect to host
@@ -13240,49 +13857,52 @@ optimizedlabs.co.uk: could not connect to host
optimizedlabs.info: could not connect to host
optimizedlabs.net: could not connect to host
optimizedlabs.uk: could not connect to host
-optisure.de: did not receive HSTS header
+optisure.de: could not connect to host
optometriepunt.nl: did not receive HSTS header
optumrxhealthstore.com: could not connect to host
opunch.org: did not receive HSTS header
-opure.ml: could not connect to host
-opure.ru: could not connect to host
+opure.ml: did not receive HSTS header
oracaodocredo.com.br: could not connect to host
orangekey.tk: could not connect to host
+orangenuts.in: could not connect to host
oranges.tokyo: did not receive HSTS header
-oranic.com: could not connect to host
+oranic.com: did not receive HSTS header
orbiosales.com: could not connect to host
orbitcom.de: did not receive HSTS header
orbitdefence.co.uk: could not connect to host
orbograph-hrcm.com: could not connect to host
orcahq.com: did not receive HSTS header
+ordekho.com: did not receive HSTS header
order.one: could not connect to host
ordereat.fr: could not connect to host
+orderessay.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
orderlounge.de: did not receive HSTS header
-oref-idf.com: could not connect to host
-oref-idf.net: could not connect to host
-oref-idf.org: could not connect to host
+oref-idf.com: did not receive HSTS header
+oref-idf.net: did not receive HSTS header
+oref-idf.org: did not receive HSTS header
oregonmu.org: did not receive HSTS header
oreka.online: could not connect to host
orelavtomaster.ru: could not connect to host
orfeo-engineering.ch: could not connect to host
organic-superfood.net: could not connect to host
organicae.com: did not receive HSTS header
+orians.eu: could not connect to host
oricejoc.com: could not connect to host
originalmockups.com: did not receive HSTS header
originalsport.com.br: could not connect to host
orioncustompcs.com: could not connect to host
+oriondynamic.be: did not receive HSTS header
orionfcu.com: did not receive HSTS header
+oriongames.eu: did not receive HSTS header
orionrebellion.com: did not receive HSTS header
orleika.ml: could not connect to host
-orlives.de: did not receive HSTS header
orovillelaw.com: could not connect to host
oroweatorganic.com: could not connect to host
ortho-graz.at: max-age too low: 86400
orthodoxy.lt: did not receive HSTS header
ortodonciaian.com: did not receive HSTS header
-orui.com.br: could not connect to host
+orui.com.br: did not receive HSTS header
orum.in: max-age too low: 0
-orz.uno: did not receive HSTS header
os-chrome.ru: did not receive HSTS header
osaiyuwu.com: could not connect to host
osaka-onakura.com: did not receive HSTS header
@@ -13297,7 +13917,9 @@ oscsdp.cz: could not connect to host
osdls.gov: did not receive HSTS header
osha-kimi.com: did not receive HSTS header
oshanko.de: could not connect to host
+oshershalom.com: did not receive HSTS header
oshinagaki.jp: did not receive HSTS header
+osirisrp.online: could not connect to host
oslfoundation.org: did not receive HSTS header
osmestres.com: did not receive HSTS header
osp.cx: could not connect to host
@@ -13308,6 +13930,7 @@ osteammate.com: could not connect to host
ostendorf.com: did not receive HSTS header
osticketawesome.com: did not receive HSTS header
oswaldmattgroup.com: did not receive HSTS header
+osxentwicklerforum.de: max-age too low: 2592000
otako.pl: did not receive HSTS header
otakucloud.net: did not receive HSTS header
otakuworld.de: could not connect to host
@@ -13320,19 +13943,22 @@ otherstuff.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ER
otichi.com: did not receive HSTS header
otinane.eu: could not connect to host
otmns.net: could not connect to host
-otmo7.com: could not connect to host
+otmo7.com: did not receive HSTS header
otoblok.com: did not receive HSTS header
-otokonna.com: could not connect to host
+otokonna.com: did not receive HSTS header
otrsdemo.hu: did not receive HSTS header
otsu.beer: could not connect to host
ottospora.nl: could not connect to host
ouimoove.com: could not connect to host
-ouowo.gq: could not connect to host
+oulunjujutsu.com: did not receive HSTS header
+ouowo.gq: did not receive HSTS header
ourbank.com: max-age too low: 2592000
ourchoice2016.com: could not connect to host
ouruglyfood.com: could not connect to host
outdooradventures.pro: could not connect to host
outdoorproducts.com: max-age too low: 7889238
+outerlimitsdigital.com: did not receive HSTS header
+outetc.com: could not connect to host
outreachbuddy.com: could not connect to host
outsider.im: could not connect to host
outurnate.com: did not receive HSTS header
@@ -13342,7 +13968,7 @@ ovenapp.io: did not receive HSTS header
over25tips.com: did not receive HSTS header
overceny.cz: did not receive HSTS header
override.io: could not connect to host
-overrustle.com: could not connect to host
+overrustle.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
oversight.io: could not connect to host
overstappen.nl: did not receive HSTS header
overture.london: did not receive HSTS header
@@ -13359,9 +13985,10 @@ owngeek.com: could not connect to host
ownmovies.fr: could not connect to host
ownspec.com: could not connect to host
owothisdiz.pw: could not connect to host
+oxanababy.com: could not connect to host
oxro.co: did not receive HSTS header
-oxro.io: could not connect to host
-oxygaming.com: could not connect to host
+oxro.io: did not receive HSTS header
+oxygaming.com: did not receive HSTS header
oxygenabsorbers.com: did not receive HSTS header
oxymc.com: did not receive HSTS header
oxynux.fr: could not connect to host
@@ -13371,6 +13998,7 @@ oyste.in: could not connect to host
ozoz.cc: could not connect to host
p-pc.de: could not connect to host
p-rickroll-o.pw: could not connect to host
+p.ki: could not connect to host
p.linode.com: could not connect to host
p1984.nl: could not connect to host
p1c.pw: could not connect to host
@@ -13379,10 +14007,13 @@ p2av.com: could not connect to host
p3.marketing: did not receive HSTS header
p3in.com: could not connect to host
p3ter.fr: did not receive HSTS header
+p5118.com: could not connect to host
p8r.de: could not connect to host
paavolastudio.com: did not receive HSTS header
pablocamino.tk: could not connect to host
pablorey-art.com: did not receive HSTS header
+paccolat.name: could not connect to host
+paceda.nl: could not connect to host
pachaiyappas.org: did not receive HSTS header
pacificpalisadeselectrician.com: could not connect to host
packair.com: did not receive HSTS header
@@ -13395,7 +14026,6 @@ pacnetwork.io: could not connect to host
pacoda.de: could not connect to host
pactf-flag-4boxdpa21ogonzkcrs9p.com: could not connect to host
pactocore.org: could not connect to host
-padeoe.com: did not receive HSTS header
pader-deko.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
paestbin.com: could not connect to host
page: could not connect to host
@@ -13408,9 +14038,11 @@ paginapolitica.ro: did not receive HSTS header
pagure.org: could not connect to host
pahnid.com: could not connect to host
paigeglass.com: did not receive HSTS header
+painlessproperty.co.uk: did not receive HSTS header
paino.cloud: could not connect to host
painosso.org: could not connect to host
paintingat.com: could not connect to host
+paintsealdirect.com: did not receive HSTS header
paio2-rec.com: could not connect to host
paio2.com: could not connect to host
paisaone.com: could not connect to host
@@ -13425,7 +14057,6 @@ paku.me: could not connect to host
palationtrade.com: could not connect to host
palawan.jp: could not connect to host
palazzotalamo.it: did not receive HSTS header
-paleolowcarb.de: did not receive HSTS header
paleosquawk.com: could not connect to host
pallet.io: could not connect to host
palmer.im: could not connect to host
@@ -13437,17 +14068,18 @@ panama-gbs.com: did not receive HSTS header
panamaequity.com: did not receive HSTS header
panamateakforestry.com: did not receive HSTS header
panascais.io: could not connect to host
+panasproducciones.com: could not connect to host
pandapsy.com: could not connect to host
panelomix.net: did not receive HSTS header
pangci.xyz: could not connect to host
panicparts.com: max-age too low: 10540800
-panjee.com: did not receive HSTS header
+panjee.com: max-age too low: 0
panjee.fr: did not receive HSTS header
panlex.org: did not receive HSTS header
panni.me: could not connect to host
panoma.de: did not receive HSTS header
panomizer.de: did not receive HSTS header
-panoranordic.net: could not connect to host
+panoranordic.net: did not receive HSTS header
panos.io: did not receive HSTS header
panoti.com: could not connect to host
panoxadrez.com.br: did not receive HSTS header
@@ -13455,12 +14087,12 @@ pansu.space: could not connect to host
pantsu.cat: did not receive HSTS header
paolo565.org: did not receive HSTS header
papalytics.com: could not connect to host
+papapa-members.club: could not connect to host
papatest24.de: could not connect to host
papeda.net: could not connect to host
papelariadante.com.br: could not connect to host
papercard.co.uk: did not receive HSTS header
papercrunch.io: could not connect to host
-paperhaven.com.au: max-age too low: 7889238
papermasters.com: could not connect to host
papersmart.net: could not connect to host
paperwallets.io: could not connect to host
@@ -13474,7 +14106,10 @@ paradiesgirls.ch: could not connect to host
paradigi.com.br: did not receive HSTS header
paradise-engineers.com: could not connect to host
paragon.edu: could not connect to host
+paragontasarim.com: did not receive HSTS header
parakranov.ru: did not receive HSTS header
+paranormalweirdo.com: max-age too low: 600000
+paranoxer.hu: could not connect to host
parav.xyz: did not receive HSTS header
pardnoy.com: could not connect to host
parent5446.us: could not connect to host
@@ -13484,7 +14119,6 @@ pariga.co.uk: could not connect to host
paris-cyber.fr: did not receive HSTS header
parisdimanche.com: did not receive HSTS header
parishome.jp: could not connect to host
-parisprovincedemenagements.fr: did not receive HSTS header
parisvox.info: did not receive HSTS header
parithy.net: could not connect to host
parkhillsbaptist.church: did not receive HSTS header
@@ -13496,19 +14130,22 @@ parkwithark.com: could not connect to host
parodesigns.com: did not receive HSTS header
parodybit.net: did not receive HSTS header
parpaing-paillette.net: could not connect to host
-parquet-lascazes.fr: did not receive HSTS header
-partage.ovh: could not connect to host
+parquet-lascazes.fr: max-age too low: 2592000
+parroquiasanrafaeldegramalote.com: did not receive HSTS header
participatorybudgeting.de: did not receive HSTS header
participatorybudgeting.info: did not receive HSTS header
particonpsplus.it: could not connect to host
+partijhandel.website: did not receive HSTS header
partijtjevoordevrijheid.nl: could not connect to host
partirkyoto.jp: did not receive HSTS header
partiwatch.com: did not receive HSTS header
partnerbeam.com: could not connect to host
partnerwerk.de: did not receive HSTS header
+party-kneipe-bar.com: did not receive HSTS header
partyhaus.ovh: could not connect to host
partyhireformby.co.uk: did not receive HSTS header
partyschnaps.com: could not connect to host
+partyshop.ge: did not receive HSTS header
partyspecialists.com: did not receive HSTS header
partyvan.eu: could not connect to host
partyvan.it: could not connect to host
@@ -13522,6 +14159,8 @@ pasportaservo.org: did not receive HSTS header
passendonderwijs.nl: did not receive HSTS header
passionebenessere.com: did not receive HSTS header
passpilot.co.uk: did not receive HSTS header
+passrhce.com: could not connect to host
+passrhcsa.com: could not connect to host
passwd.io: did not receive HSTS header
password.codes: could not connect to host
passwordbox.com: did not receive HSTS header
@@ -13535,6 +14174,7 @@ pastenib.com: could not connect to host
paster.li: did not receive HSTS header
pasteros.io: could not connect to host
pastie.se: could not connect to host
+pastoral-verbund.de: max-age too low: 86400
pastorbelgagroenendael.com.br: could not connect to host
pastorcanadense.com.br: could not connect to host
pastordocaucaso.com.br: could not connect to host
@@ -13545,7 +14185,7 @@ paternitydnatest.com: could not connect to host
patfs.com: did not receive HSTS header
pathwaytofaith.com: could not connect to host
patientinsight.net: could not connect to host
-patouille-et-gribouille.fr: did not receive HSTS header
+patouille-et-gribouille.fr: could not connect to host
patriaco.net: did not receive HSTS header
patrick.dark.name: could not connect to host
patrickbusch.net: could not connect to host
@@ -13557,6 +14197,7 @@ patterson.mp: could not connect to host
paul-kerebel.pro: could not connect to host
paul-schmidt.de: max-age too low: 0
paulbunyanmls.com: did not receive HSTS header
+paulchen.at: could not connect to host
paulewen.ca: could not connect to host
paulpetersen.dk: did not receive HSTS header
paulproell.at: did not receive HSTS header
@@ -13566,6 +14207,7 @@ paveljanda.com: [Exception... "Component returned failure code: 0x80004005 (NS_E
pavelkahouseforcisco.com: did not receive HSTS header
pavelstriz.cz: could not connect to host
pawfriends.org.za: did not receive HSTS header
+pawsru.org: could not connect to host
paxdei.com.br: could not connect to host
paxwinkel.nl: could not connect to host
pay.gigahost.dk: did not receive HSTS header
@@ -13583,7 +14225,6 @@ payroll.ch: could not connect to host
paytwopay.com: could not connect to host
payzwin.com: did not receive HSTS header
pb-design.ch: could not connect to host
-pb.ax: could not connect to host
pbapp.net: did not receive HSTS header
pbbr.com: did not receive HSTS header
pbcknd.ml: could not connect to host
@@ -13606,10 +14247,12 @@ pdamsidoarjo.co.id: could not connect to host
pdevio.com: could not connect to host
pdf.yt: could not connect to host
pdomo.me: did not receive HSTS header
+pdragt.com: could not connect to host
pe-bank.co.jp: max-age too low: 604800
pe-kyousai.jp: did not receive HSTS header
peaceandwool.com: did not receive HSTS header
peakapp.nl: could not connect to host
+pearbloom.com: could not connect to host
pebblesdemo.com: could not connect to host
pecot.fr: did not receive HSTS header
peekops.com: could not connect to host
@@ -13623,7 +14266,8 @@ peissen.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERRO
pekkapikkarainen.fi: did not receive HSTS header
pekkarik.ru: could not connect to host
peliculasaudiolatinoonline.com: could not connect to host
-peliseries24.com: could not connect to host
+peliculator.com: max-age too low: 0
+peliweb.com: did not receive HSTS header
pemagrid.org: could not connect to host
pemberton.at: did not receive HSTS header
penablog.com: did not receive HSTS header
@@ -13641,7 +14285,7 @@ pensiunealido.ro: could not connect to host
pentagram.me: max-age too low: 2592000
pentano.net: did not receive HSTS header
people-mozilla.org: could not connect to host
-peoplerange.com: could not connect to host
+peoplerange.com: did not receive HSTS header
peoplesbankal.com: did not receive HSTS header
peperiot.com: did not receive HSTS header
pepper.dog: could not connect to host
@@ -13686,6 +14330,7 @@ personcar.com.br: could not connect to host
personnedisparue.fr: could not connect to host
persson.im: could not connect to host
perthdevicelab.com: did not receive HSTS header
+peruvianphotography.com: did not receive HSTS header
pestalozzishop.com.br: could not connect to host
pesto.video: could not connect to host
pesyun.cn: max-age too low: 3600
@@ -13693,7 +14338,6 @@ pet-nsk.ru: could not connect to host
petangen.se: could not connect to host
petchart.net: could not connect to host
peteboc.com: max-age too low: 0
-peterboers.info: could not connect to host
peterfolta.net: could not connect to host
peterkshultz.com: could not connect to host
petermazur.com: did not receive HSTS header
@@ -13705,10 +14349,8 @@ pethub.com: did not receive HSTS header
petit.site: could not connect to host
petlife.od.ua: could not connect to host
petplum.com: did not receive HSTS header
-petravdbos.nl: could not connect to host
petrkrapek.cz: could not connect to host
petrovsky.pro: could not connect to host
-petruzz.net: did not receive HSTS header
petsittersservices.com: could not connect to host
pettsy.com: did not receive HSTS header
peuf.shop: could not connect to host
@@ -13718,31 +14360,31 @@ pewboards.com: could not connect to host
pexieapp.com: did not receive HSTS header
peykezamin.ir: did not receive HSTS header
peyote.org: could not connect to host
-peytonfarrar.com: could not connect to host
+peytonfarrar.com: did not receive HSTS header
+pfarchimedes-pensioen123.nl: could not connect to host
pferdeeinstreu-kaufen.com: did not receive HSTS header
pferdekauf.de: did not receive HSTS header
pfgshop.com.br: could not connect to host
pflegedienst-gratia.de: max-age too low: 300
pfo.io: could not connect to host
pfolta.net: could not connect to host
-pfrost.me: could not connect to host
pgcpbc.com: could not connect to host
+pglandscapingpaving.com: did not receive HSTS header
pgmsource.com: could not connect to host
pgpm.io: could not connect to host
pgtb.be: could not connect to host
phalconist.com: could not connect to host
phantasie.cc: could not connect to host
-pharmaboard.org: did not receive HSTS header
pharmgkb.org: could not connect to host
-pharynx.nl: could not connect to host
phasersec.com: did not receive HSTS header
-phcmembers.com: did not receive HSTS header
+phcmembers.com: could not connect to host
phdsupply.com: could not connect to host
phdwuda.com: could not connect to host
phenomeno-porto.com: did not receive HSTS header
phenomeno.nl: did not receive HSTS header
phenomenoporto.com: did not receive HSTS header
phenomenoporto.nl: did not receive HSTS header
+phialo.de: did not receive HSTS header
philadelphiacandies.com: did not receive HSTS header
philadelphiadancefoundation.org: could not connect to host
philipkohn.com: did not receive HSTS header
@@ -13756,11 +14398,12 @@ phillprice.com: did not receive HSTS header
philonas.net: did not receive HSTS header
philpropertygroup.com: could not connect to host
phippsreporting.com: did not receive HSTS header
-phishing.rs: did not receive HSTS header
+phishing.rs: could not connect to host
+phligence.com: could not connect to host
phoebe.co.nz: did not receive HSTS header
phoenicis.com.ua: did not receive HSTS header
-phoenics.de: did not receive HSTS header
phoenix.dj: did not receive HSTS header
+phoenixlogan.com: could not connect to host
phonenumberinfo.co.uk: could not connect to host
phongmay24h.com: could not connect to host
phood.be: did not receive HSTS header
@@ -13778,13 +14421,16 @@ php-bach.org: could not connect to host
phpdistribution.com: did not receive HSTS header
phperformances.fr: did not receive HSTS header
phpfashion.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+phpinfo.in.th: could not connect to host
phpkari.cz: could not connect to host
phr34kz.pw: did not receive HSTS header
phra.gs: could not connect to host
phrasing.me: could not connect to host
phrive.space: could not connect to host
+phryanjr.com: could not connect to host
phryneas.de: did not receive HSTS header
phumin.in.th: did not receive HSTS header
+phunehehe.net: did not receive HSTS header
phuong.faith: could not connect to host
physicaltherapist.com: did not receive HSTS header
physicpezeshki.com: did not receive HSTS header
@@ -13804,7 +14450,7 @@ picone.com.au: could not connect to host
picotronic.biz: could not connect to host
picotronic.de: did not receive HSTS header
picsandtours.com: did not receive HSTS header
-picscare.co.uk: did not receive HSTS header
+picscare.co.uk: could not connect to host
picshare.nz: could not connect to host
pidatacenters.com: did not receive HSTS header
pidomex.com: did not receive HSTS header
@@ -13813,10 +14459,11 @@ pieinsurance.com: did not receive HSTS header
piekacz.co.uk: could not connect to host
pieperhome.de: did not receive HSTS header
pierrejeansuau.fr: could not connect to host
+pierreprinetti.com: did not receive HSTS header
pieterjangeeroms.me: could not connect to host
piggott.me.uk: did not receive HSTS header
pigritia.de: could not connect to host
-piils.fr: did not receive HSTS header
+piils.fr: could not connect to host
pikalongwar.com: did not receive HSTS header
pikmy.com: could not connect to host
pilgermaske.org: did not receive HSTS header
@@ -13837,9 +14484,9 @@ pinkfis.ch: did not receive HSTS header
pinkhq.com: did not receive HSTS header
pinkinked.com: could not connect to host
pinnacles.com: max-age too low: 0
+pinner.io: could not connect to host
pinoylinux.org: did not receive HSTS header
pinscher.com.br: could not connect to host
-pintosbeeremovals.co.za: did not receive HSTS header
pintoselectrician.co.za: did not receive HSTS header
pioche.ovh: did not receive HSTS header
pippen.io: could not connect to host
@@ -13861,7 +14508,7 @@ pirateproxy.sx: did not receive HSTS header
pirateproxy.vip: could not connect to host
pirati.cz: max-age too low: 604800
piratte.net: did not receive HSTS header
-pirganj24.com: did not receive HSTS header
+pirganj24.com: could not connect to host
pirlitu.com: did not receive HSTS header
pisexy.me: did not receive HSTS header
pisidia.de: could not connect to host
@@ -13882,7 +14529,7 @@ pixelpoint.io: did not receive HSTS header
pixelrain.info: could not connect to host
pixi.chat: could not connect to host
pixi.me: did not receive HSTS header
-pixiv.rip: did not receive HSTS header
+pixiv.rip: could not connect to host
pixivimg.me: could not connect to host
pizala.de: could not connect to host
pizzabottle.com: did not receive HSTS header
@@ -13890,7 +14537,7 @@ pizzacook.ch: did not receive HSTS header
pizzadoc.ch: could not connect to host
pizzafunny.com.br: could not connect to host
pizzamc.eu: could not connect to host
-pj00100.com: did not receive HSTS header
+pj00100.com: could not connect to host
pj00200.com: did not receive HSTS header
pj00300.com: did not receive HSTS header
pj00400.com: did not receive HSTS header
@@ -13906,16 +14553,18 @@ pjbet.mg: could not connect to host
pjili.com: did not receive HSTS header
pjsec.tk: could not connect to host
pkautodesign.com: did not receive HSTS header
+pkbjateng.com: could not connect to host
pko.ch: did not receive HSTS header
pkschat.com: could not connect to host
plaasprodukte.com: could not connect to host
placassinal.com.br: did not receive HSTS header
+placebet.pro: could not connect to host
placefade.com: could not connect to host
placehold.co: did not receive HSTS header
placollection.org: could not connect to host
plaettliaktion.ch: did not receive HSTS header
plagiarismcheck.org: max-age too low: 604800
-plaintray.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+plaintray.com: could not connect to host
plakbak.nl: could not connect to host
planbox.info: could not connect to host
planeexplanation.com: could not connect to host
@@ -13924,10 +14573,8 @@ planete-secu.com: could not connect to host
planetromeo.com: could not connect to host
planformation.com: did not receive HSTS header
planktonholland.com: did not receive HSTS header
-planningexcellence.com.au: could not connect to host
planpharmacy.com: could not connect to host
plant.ml: could not connect to host
-plantroon.com: did not receive HSTS header
plass.hamburg: could not connect to host
plasti-pac.ch: did not receive HSTS header
plasticsurgeryartist.com: max-age too low: 300
@@ -13936,12 +14583,12 @@ plasvilledescartaveis.com.br: could not connect to host
platform.lookout.com: could not connect to host
platinumpeek.com: did not receive HSTS header
platomania.eu: did not receive HSTS header
-plattner.club: could not connect to host
+plattner.club: did not receive HSTS header
play: could not connect to host
play.google.com: did not receive HSTS header (error ignored - included regardless)
playdreamcraft.com.br: did not receive HSTS header
playerhunter.com: did not receive HSTS header
-playflick.com: could not connect to host
+playflick.com: did not receive HSTS header
playhappywheelsunblocked.com: could not connect to host
playkh.com: did not receive HSTS header
playkinder.com: did not receive HSTS header
@@ -13981,12 +14628,12 @@ plushev.com: did not receive HSTS header
plussizereviews.com: could not connect to host
plut.org: did not receive HSTS header
pluta.net: did not receive HSTS header
-pluth.org: did not receive HSTS header
+pluth.org: could not connect to host
plymouthglassgallery.com: did not receive HSTS header
plymouthsoftplay.co.uk: could not connect to host
pm13-media.cz: could not connect to host
pmac.pt: could not connect to host
-pmbremer.de: could not connect to host
+pmbremer.de: did not receive HSTS header
pmbtf.com: could not connect to host
pmctire.com: did not receive HSTS header
pmemanager.fr: did not receive HSTS header
@@ -13996,12 +14643,34 @@ pmnts.io: could not connect to host
pmponline.de: did not receive HSTS header
pneumonline.be: did not receive HSTS header
pneusgppremium.com.br: did not receive HSTS header
+pnoec.org.do: could not connect to host
pnukee.com: did not receive HSTS header
po.gl: could not connect to host
+poc060.com: did not receive HSTS header
+poc080.com: did not receive HSTS header
+poc100.com: did not receive HSTS header
+poc109.com: did not receive HSTS header
+poc11.com: did not receive HSTS header
+poc116.com: did not receive HSTS header
+poc118.com: did not receive HSTS header
+poc119.com: did not receive HSTS header
+poc120.com: did not receive HSTS header
+poc128.com: did not receive HSTS header
+poc13.com: did not receive HSTS header
+poc15.com: did not receive HSTS header
+poc16.com: did not receive HSTS header
+poc17.com: could not connect to host
+poc18.com: did not receive HSTS header
+poc19.com: did not receive HSTS header
+poc21.com: did not receive HSTS header
+poc211.com: did not receive HSTS header
+poc226.com: did not receive HSTS header
+poc228.com: did not receive HSTS header
pocakdrops.com: could not connect to host
pocakking.tk: could not connect to host
pocket-lint.com: did not receive HSTS header
pocketfullofapps.com: did not receive HSTS header
+pocketinsure.com: could not connect to host
pocketmemories.net: could not connect to host
pocketsix.com: could not connect to host
pocloud.homelinux.net: could not connect to host
@@ -14010,6 +14679,7 @@ podcast.style: could not connect to host
podemos.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
podiumsdiskussion.org: did not receive HSTS header
poed.com.au: could not connect to host
+poedgirl.com: could not connect to host
poeg.cz: did not receive HSTS header
pogoswine.com: could not connect to host
pogs.us: could not connect to host
@@ -14045,11 +14715,12 @@ polsport.live: did not receive HSTS header
polycoise.com: could not connect to host
polycrypt.us: could not connect to host
polyfill.io: did not receive HSTS header
-polymorph.rs: could not connect to host
polypho.nyc: could not connect to host
polysage.org: did not receive HSTS header
polytechecosystem.vc: could not connect to host
pomardaserra.com: could not connect to host
+pomelo-paradigm.com: did not receive HSTS header
+pomozmruczkom.pl: could not connect to host
pompefunebrilariviera.it: could not connect to host
pompompoes.com: did not receive HSTS header
pondof.fish: could not connect to host
@@ -14058,12 +14729,15 @@ ponteus.com: could not connect to host
pontodogame.com.br: could not connect to host
pontokay.com.br: could not connect to host
pontualcomp.com: could not connect to host
+ponxel.com: could not connect to host
pony.today: could not connect to host
ponythread.com: did not receive HSTS header
ponzi.life: could not connect to host
poolinstallers.co.za: could not connect to host
poolsandstuff.com: did not receive HSTS header
+poolspondsandwaterscapes.com: could not connect to host
poon.tech: could not connect to host
+popcultureshack.com: could not connect to host
popi.se: did not receive HSTS header
popkins.cf: could not connect to host
popkins.ga: could not connect to host
@@ -14073,28 +14747,47 @@ popkins.tk: could not connect to host
popupsoftplay.com: could not connect to host
poris.web.id: could not connect to host
pormat.cl: did not receive HSTS header
+porn77.info: could not connect to host
+pornalpha.com: could not connect to host
+pornbay.org: could not connect to host
pornblog.org: could not connect to host
porncandi.com: could not connect to host
-pornohub.su: did not receive HSTS header
+porncompanions.com: could not connect to host
+pornimg.net: could not connect to host
+pornless.biz: could not connect to host
+pornmax.net: could not connect to host
+porno-gif.ru: could not connect to host
+pornohub.su: could not connect to host
+pornolab-net.appspot.com: could not connect to host
+pornoserver.eu: could not connect to host
+pornport.org: could not connect to host
+pornsocket.com: could not connect to host
pornspider.to: could not connect to host
pornstars.me: did not receive HSTS header
+pornteddy.com: could not connect to host
+pornultra.net: could not connect to host
porschen.fr: could not connect to host
port.im: did not receive HSTS header
port.social: could not connect to host
+portablebuildingsales.co.uk: did not receive HSTS header
+portablespeakersfinder.com: could not connect to host
portalcarapicuiba.com: did not receive HSTS header
portale-randkowe.pl: did not receive HSTS header
portalhubnuti.cz: did not receive HSTS header
portalisapres.cl: could not connect to host
+portalkla.com.br: did not receive HSTS header
portalm.tk: could not connect to host
portalmundo.xyz: could not connect to host
portalplatform.net: could not connect to host
portaluniversalista.org: did not receive HSTS header
portalveneza.com.br: could not connect to host
portalzine.de: did not receive HSTS header
-portamiinpista.it: did not receive HSTS header
portefeuillesignalen.nl: could not connect to host
portraitsystem.biz: did not receive HSTS header
+portsmoutheic.com: could not connect to host
+poschtiliste.ch: could not connect to host
poshpak.com: max-age too low: 86400
+posijson.stream: could not connect to host
positivesobrietyinstitute.com: did not receive HSTS header
postback.io: did not receive HSTS header
postcardpayment.com: could not connect to host
@@ -14106,11 +14799,12 @@ potatoheads.net: could not connect to host
potbar.com: could not connect to host
potbox.com: could not connect to host
potenzmittelblog.info: could not connect to host
-potenzprobleme-info.net: max-age too low: 3600
+potenzprobleme-info.net: did not receive HSTS header
potlytics.com: could not connect to host
potomania.cz: could not connect to host
potpourrifestival.de: did not receive HSTS header
potsky.com: did not receive HSTS header
+pottreid.com: did not receive HSTS header
pouet.it: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
pouets.ovh: could not connect to host
poupatempo.org: did not receive HSTS header
@@ -14127,10 +14821,12 @@ power-of-interest.com: could not connect to host
power99press.com: could not connect to host
powerb.ch: did not receive HSTS header
powerdent.net.br: could not connect to host
+poweredbypurdy.com: did not receive HSTS header
powerentertainment.tv: could not connect to host
poweroff.win: could not connect to host
powerplannerapp.com: could not connect to host
powerplaywashers.com: did not receive HSTS header
+powersergdatasystems.tk: could not connect to host
powersergthisisthewebsitefuckyouchris.com: could not connect to host
powersergunited.com: could not connect to host
powersergunited.org: could not connect to host
@@ -14150,9 +14846,8 @@ ppoou.co.uk: could not connect to host
pppo.gov: could not connect to host
ppr-truby.ru: could not connect to host
ppsvcs2.com: did not receive HSTS header
-ppuu.org: did not receive HSTS header
+ppuu.org: could not connect to host
ppy3.com: did not receive HSTS header
-pr2studio.com: could not connect to host
practodev.com: could not connect to host
prajwalkoirala.com: could not connect to host
pratinav.xyz: could not connect to host
@@ -14160,6 +14855,7 @@ prattpokemon.com: could not connect to host
praxis-research.info: could not connect to host
prazeresdavida.com.br: could not connect to host
prazynka.pl: did not receive HSTS header
+prc-newmedia.com: max-age too low: 0
precedecaritas.com.br: could not connect to host
precisionaeroimaging.com: did not receive HSTS header
prediksisydney.com: could not connect to host
@@ -14168,28 +14864,30 @@ preezzie.com: could not connect to host
prefis.com: did not receive HSTS header
prefontaine.name: could not connect to host
prego-shop.de: could not connect to host
+pregono.com: did not receive HSTS header
preio.cn: could not connect to host
prekladysanca.cz: could not connect to host
prelist.org: did not receive HSTS header
-preload.link: could not connect to host
+premaritalsex.info: could not connect to host
premioambiente.it: did not receive HSTS header
+premiumweb.co.id: could not connect to host
premiumzweirad.de: max-age too low: 7776000
+prepaidgirl.com: could not connect to host
prepandgo-euro.com: could not connect to host
-preposted.com: did not receive HSTS header
-preppertactics.com: did not receive HSTS header
+preposted.com: could not connect to host
+preppertactics.com: could not connect to host
preprodfan.gov: could not connect to host
-prescriptionrex.com: did not receive HSTS header
+prescriptionrex.com: could not connect to host
presentesdegrife.com.br: could not connect to host
presidentials2016.com: could not connect to host
press-anime-nenkan.com: did not receive HSTS header
-press-presse.ca: max-age too low: 2592000
+press-presse.ca: max-age too low: 0
pressakey.de: did not receive HSTS header
pressenews.net: could not connect to host
pressfreedomfoundation.org: did not receive HSTS header
prestburyscouts.org.uk: did not receive HSTS header
prestigeeventshire.co.uk: could not connect to host
prestonapp.com: could not connect to host
-pretrialservices.gov: could not connect to host
prettygrouse.com: did not receive HSTS header
prettyphotoart.de: did not receive HSTS header
prettytunesapp.com: could not connect to host
@@ -14197,6 +14895,7 @@ pretzlaff.info: did not receive HSTS header
preworkout.me: could not connect to host
prgslab.net: could not connect to host
priceholic.com: could not connect to host
+prideindomination.com: could not connect to host
pridoc.se: did not receive HSTS header
prifo.se: could not connect to host
prijsvergelijken.ml: could not connect to host
@@ -14208,13 +14907,15 @@ primotiles.co.uk: could not connect to host
primotilesandbathrooms.co.uk: max-age too low: 2592000
prinbanat.ngo: did not receive HSTS header
princeagency.com: did not receive HSTS header
+princepessa.de: did not receive HSTS header
+princesparktouch.com: did not receive HSTS header
princessbackpack.de: could not connect to host
princessmargaretlotto.com: did not receive HSTS header
principalship.net: could not connect to host
principalstest.review: could not connect to host
prinesdoma.at: did not receive HSTS header
printerest.io: could not connect to host
-printersonline.be: did not receive HSTS header
+printersonline.be: could not connect to host
printery.be: could not connect to host
printexpress.cloud: could not connect to host
priolkar.com: could not connect to host
@@ -14225,14 +14926,13 @@ privacylabs.io: could not connect to host
privacymanatee.com: could not connect to host
privacyrup.net: could not connect to host
privategiant.com: could not connect to host
-privatepokertour.com: could not connect to host
-privatestatic.com: could not connect to host
privatstunden.express: could not connect to host
privcloud.cc: could not connect to host
privcloud.org: could not connect to host
privilegevisa.fr: could not connect to host
privu.me: could not connect to host
privytime.com: could not connect to host
+prknje.com: did not receive HSTS header
prmte.com: could not connect to host
prnt.li: did not receive HSTS header
pro-esb.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -14278,7 +14978,7 @@ projectascension.io: could not connect to host
projectasterk.com: could not connect to host
projectblackbook.us: did not receive HSTS header
projectcastle.tech: did not receive HSTS header
-projectdp.net: could not connect to host
+projectdp.net: did not receive HSTS header
projectgrimoire.com: did not receive HSTS header
projectherogames.xyz: could not connect to host
projectl1b1t1na.tk: could not connect to host
@@ -14288,7 +14988,6 @@ projectvault.ovh: did not receive HSTS header
projectx.top: could not connect to host
projekt-umbriel.de: could not connect to host
projektik.cz: did not receive HSTS header
-projet-fly.ch: could not connect to host
projetoresecia.com: could not connect to host
prok.pw: did not receive HSTS header
prokop.ovh: did not receive HSTS header
@@ -14309,7 +15008,6 @@ propagandism.org: did not receive HSTS header
propepper.net: did not receive HSTS header
properchels.com: did not receive HSTS header
propershave.com: could not connect to host
-prophiler.de: did not receive HSTS header
proplan.co.il: did not receive HSTS header
propmag.co: could not connect to host
prosenseit.com: did not receive HSTS header
@@ -14317,16 +15015,17 @@ prosharp.com.au: could not connect to host
proslimdiets.com: could not connect to host
prosocialmachines.com: could not connect to host
prosperident.com: did not receive HSTS header
-prostohobby.ru: could not connect to host
+prostoporno.net: could not connect to host
+prostoporno.sexy: could not connect to host
proteapower.co.za: could not connect to host
protecciondelconsumidor.gov: did not receive HSTS header
-proto-online.ru: could not connect to host
+proto-online.ru: did not receive HSTS header
protonmail.ch: did not receive HSTS header
providerlijst.ml: could not connect to host
provisionaldriving.com: did not receive HSTS header
provisionircd.tk: did not receive HSTS header
provitacare.com: did not receive HSTS header
-provokator.co.il: could not connect to host
+provokator.co.il: did not receive HSTS header
proweser.de: did not receive HSTS header
prowhisky.de: did not receive HSTS header
proxbox.net: did not receive HSTS header
@@ -14346,49 +15045,51 @@ proxyrox.com: could not connect to host
proxyweb.us: did not receive HSTS header
proyecto13.com: did not receive HSTS header
proymaganadera.com: did not receive HSTS header
-prpr.cloud: could not connect to host
-prpsss.com: could not connect to host
+prpsss.com: did not receive HSTS header
prstatic.com: could not connect to host
pruikshop.nl: could not connect to host
prxio.date: could not connect to host
prxio.site: could not connect to host
-ps-qa.com: could not connect to host
+ps-qa.com: did not receive HSTS header
+ps-w.ru: did not receive HSTS header
ps-x.ru: could not connect to host
-psa.gov: could not connect to host
pscleaningsolutions.co.uk: could not connect to host
pseudo.coffee: did not receive HSTS header
psicologia.co.ve: could not connect to host
psicologoforensebarcelona.com: did not receive HSTS header
+psicometricas.mx: did not receive HSTS header
psicosalud.online: could not connect to host
psncardplus.be: could not connect to host
psncardplus.com: could not connect to host
psncardplus.dk: could not connect to host
psncardplus.nl: could not connect to host
psncardplus.se: could not connect to host
+pson.ninja: could not connect to host
pstrozniak.com: could not connect to host
pstudio.me: max-age too low: 0
-psu.je: could not connect to host
psw.academy: could not connect to host
psw.consulting: could not connect to host
psxtr.com: could not connect to host
psychiatrie-betreuung.ch: could not connect to host
psychologie-hofner.at: could not connect to host
psynapse.net.au: could not connect to host
+pthsec.com: could not connect to host
ptn.moscow: could not connect to host
ptonet.com: could not connect to host
-ptrbrs.nl: could not connect to host
ptrujillo.com: did not receive HSTS header
pub-online.ro: could not connect to host
pubkey.is: could not connect to host
publications.qld.gov.au: did not receive HSTS header
publicidadnovagrass.com.mx: could not connect to host
publicinquiry.eu: did not receive HSTS header
-publick.net: could not connect to host
+publick.net: did not receive HSTS header
publicspeakingcamps.com: could not connect to host
publimepa.it: could not connect to host
publishingshack.com: did not receive HSTS header
puchunguis.com: did not receive HSTS header
puentes.info: did not receive HSTS header
+puestifiestas.mx: did not receive HSTS header
+puestosdeferia.mx: did not receive HSTS header
puetter.eu: could not connect to host
pugilares.com.pl: could not connect to host
pugliese.fr: could not connect to host
@@ -14405,24 +15106,25 @@ pumpgames.net: could not connect to host
punchkickinteractive.com: did not receive HSTS header
punchr-kamikazee.rhcloud.com: could not connect to host
punkdns.top: could not connect to host
+puntacanalink.com: could not connect to host
puppydns.com: did not receive HSTS header
purahealthyliving.com: did not receive HSTS header
purbd.com: did not receive HSTS header
pureessentialoil.biz: max-age too low: 300
pureholisticliving.me: could not connect to host
-purelunch.co.uk: could not connect to host
+pureluxemedical.com: did not receive HSTS header
purewebmasters.com: could not connect to host
purikore.com: could not connect to host
purplehippie.in: did not receive HSTS header
-purplez.pw: did not receive HSTS header
purpoz.com.br: could not connect to host
purpspc.com: could not connect to host
purrfectcams.com: could not connect to host
push.world: did not receive HSTS header
pushapp.org: did not receive HSTS header
+pushers.com.mx: could not connect to host
pushphp.com: could not connect to host
pushstar.com: max-age too low: 0
-pussr.com: did not receive HSTS header
+pusichatka.ddns.net: could not connect to host
puzz.gg: could not connect to host
pvagner.tk: did not receive HSTS header
pwd.ovh: could not connect to host
@@ -14430,23 +15132,26 @@ pwfrance.com: could not connect to host
pwi.agency: did not receive HSTS header
pwm.jp: could not connect to host
pwnsdx.pw: did not receive HSTS header
-pwntr.com: could not connect to host
+pwntr.com: did not receive HSTS header
pwt.pw: could not connect to host
pxio.de: did not receive HSTS header
pyjiaoyi.cf: could not connect to host
pyol.org: could not connect to host
pypi-mirrors.org: could not connect to host
pypi-status.org: could not connect to host
-pyplo.org: did not receive HSTS header
+pyplo.org: could not connect to host
pypt.lt: did not receive HSTS header
-pyrrhonism.org: could not connect to host
+pyrrhonism.org: did not receive HSTS header
pythia.nz: could not connect to host
pythonic.guru: could not connect to host
pythonic.training: could not connect to host
pzgreni.ch: did not receive HSTS header
pzme.me: could not connect to host
q-rickroll-u.pw: could not connect to host
+q-tr.com: did not receive HSTS header
+q123123.com: did not receive HSTS header
q2.si: did not receive HSTS header
+q5118.com: could not connect to host
q8mp3.me: did not receive HSTS header
qadmium.tk: could not connect to host
qamrulhaque.com: did not receive HSTS header
@@ -14469,13 +15174,12 @@ qingpat.com: could not connect to host
qingxuan.info: did not receive HSTS header
qinxi1992.com: could not connect to host
qionglu.pw: could not connect to host
-qipl.org: did not receive HSTS header
qipp.com: did not receive HSTS header
qirinus.com: did not receive HSTS header
qiu521119.host: did not receive HSTS header
qiuxian.ddns.net: could not connect to host
qixxit.de: did not receive HSTS header
-qkzy.net: could not connect to host
+qkzy.net: did not receive HSTS header
qldconservation.org: could not connect to host
qnatek.org: could not connect to host
qonqa.de: did not receive HSTS header
@@ -14483,6 +15187,7 @@ qoohoot.com: did not receive HSTS header
qop.io: did not receive HSTS header
qoqo.us: did not receive HSTS header
qorm.co.uk: could not connect to host
+qq52o.me: did not receive HSTS header
qqj.net: could not connect to host
qqq.gg: could not connect to host
qqvips.com: could not connect to host
@@ -14494,7 +15199,6 @@ qrlending.com: could not connect to host
qrlfinancial.com: could not connect to host
qswoo.org: could not connect to host
qto.org: could not connect to host
-quaedam.org: did not receive HSTS header
quail.solutions: could not connect to host
quakerlens.com: did not receive HSTS header
quality1.com.br: did not receive HSTS header
@@ -14503,7 +15207,6 @@ quanglepro.com: could not connect to host
quangngaimedia.com: did not receive HSTS header
quanjinlong.cn: could not connect to host
quantacloud.ch: could not connect to host
-quantaloupe.tech: could not connect to host
quantenteranik.eu: could not connect to host
quantor.dk: did not receive HSTS header
quantum-cloud.xyz: could not connect to host
@@ -14534,15 +15237,16 @@ quickpayservice.com: could not connect to host
quietus.gq: could not connect to host
quikrmovies.to: could not connect to host
quikstorhawaii.com: max-age too low: 300
-quilmo.com: could not connect to host
quimsertek.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
quizionic.com: could not connect to host
quizl.io: did not receive HSTS header
quizmemes.org: could not connect to host
quizstore.net: did not receive HSTS header
+quocdesign.ch: could not connect to host
quotehex.com: could not connect to host
quotemaster.co.za: could not connect to host
quranserver.net: could not connect to host
+qvq.cloud: did not receive HSTS header
qwallet.ca: could not connect to host
qwaser.fr: could not connect to host
qwertyatom100.me: could not connect to host
@@ -14553,15 +15257,15 @@ r-core.org: could not connect to host
r-core.ru: could not connect to host
r-cut.fr: could not connect to host
r-rickroll-u.pw: could not connect to host
+r0t.co: could not connect to host
r10n.com: did not receive HSTS header
r15.me: did not receive HSTS header
r18.moe: could not connect to host
raajheshkannaa.com: could not connect to host
-rabbitvcactus.eu: did not receive HSTS header
+rabbit.wales: could not connect to host
+rabbitvcactus.eu: could not connect to host
rabota-x.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
racasdecachorro.org: could not connect to host
-racdek.net: max-age too low: 2628000
-racdek.nl: max-age too low: 2628000
racesport.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
rachaelrussell.com: did not receive HSTS header
rackblue.com: could not connect to host
@@ -14575,28 +15279,30 @@ radicaleducation.net: could not connect to host
radioactivenetwork.xyz: could not connect to host
radioafibra.com.br: could not connect to host
radior9.it: could not connect to host
+radiumtree.com: could not connect to host
radom-pack.pl: could not connect to host
radtke.bayern: did not receive HSTS header
rafaelcz.de: could not connect to host
+rafsis.com: did not receive HSTS header
raft.pub: could not connect to host
-rage-overload.ch: could not connect to host
-rage.rip: could not connect to host
raghavdua.in: could not connect to host
ragnaroktop.com.br: could not connect to host
rahadiana.com: could not connect to host
rahamasin.eu: could not connect to host
-rai-co.net: did not receive HSTS header
+rai-co.net: could not connect to host
raiblockscommunity.net: could not connect to host
raidstone.com: could not connect to host
raidstone.rocks: could not connect to host
-raiffeisen-kosovo.com: could not connect to host
railjob.cn: could not connect to host
railyardurgentcare.com: did not receive HSTS header
raimixmotoparts.com.br: could not connect to host
rainbin.com: could not connect to host
rainbowbarracuda.com: could not connect to host
+raito.win: could not connect to host
raitza.de: could not connect to host
rakugaki.cn: could not connect to host
+ralph.bike: did not receive HSTS header
+ralphwoessner.com: did not receive HSTS header
ramatola.uk: did not receive HSTS header
rambii.de: could not connect to host
ramblingrf.tech: could not connect to host
@@ -14605,13 +15311,13 @@ ramitmittal.com: could not connect to host
ramon-c.nl: could not connect to host
ramonj.nl: could not connect to host
randomcage.com: did not receive HSTS header
-randomcloud.net: could not connect to host
+randomcloud.net: did not receive HSTS header
randomhero.cloud: could not connect to host
randomwinpicker.de: could not connect to host
randy.pw: could not connect to host
ranegroup.hosting: could not connect to host
rankthespot.com: could not connect to host
-rannseier.org: could not connect to host
+rannseier.org: did not receive HSTS header
rantanda.com: could not connect to host
rany.duckdns.org: could not connect to host
rany.io: did not receive HSTS header
@@ -14621,6 +15327,7 @@ rapdogg.com: could not connect to host
raphaelmoura.ddns.net: could not connect to host
rapidemobile.com: did not receive HSTS header
rapidflow.io: could not connect to host
+rapidhubs.com: could not connect to host
rapido.nu: could not connect to host
rapidresearch.me: could not connect to host
rapidthunder.io: could not connect to host
@@ -14634,6 +15341,7 @@ rastreador.com.es: did not receive HSTS header
rastreie.net: did not receive HSTS header
ratajczak.fr: could not connect to host
rate-esport.de: could not connect to host
+rathorian.fr: could not connect to host
rationem.nl: did not receive HSTS header
ratuseks.com: could not connect to host
ratuseks.net: could not connect to host
@@ -14655,15 +15363,20 @@ rawet.se: could not connect to host
rawoil.com: could not connect to host
rawr.sexy: could not connect to host
rawstorieslondon.com: could not connect to host
+ray-home.de: could not connect to host
+ray-works.de: could not connect to host
rayanitco.com: did not receive HSTS header
raycarruthersphotography.co.uk: could not connect to host
raydan.space: could not connect to host
raydobe.me: could not connect to host
+raymd.de: could not connect to host
+raymii.org: did not receive HSTS header
raymondelooff.nl: did not receive HSTS header
raytron.org: could not connect to host
raywin168.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
raywin168.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
raywin88.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+rayworks.de: could not connect to host
razlaw.name: did not receive HSTS header
razzolini.com.br: could not connect to host
rb-china.net: could not connect to host
@@ -14678,10 +15391,10 @@ rburchell.com: did not receive HSTS header
rbxcatalog.com: could not connect to host
rc4.io: could not connect to host
rc7.ch: could not connect to host
-rca.ink: could not connect to host
rcafox.com: could not connect to host
+rchavez.site: could not connect to host
rcoliveira.com: could not connect to host
-rcorporation.be: could not connect to host
+rcorporation.be: did not receive HSTS header
rcpcbd.com: could not connect to host
rcraigmurphy.net: could not connect to host
rcvd.io: did not receive HSTS header
@@ -14689,7 +15402,6 @@ rcx.io: could not connect to host
rdfz.tech: could not connect to host
rdns.im: did not receive HSTS header
rdplumbingsolutions.com.au: did not receive HSTS header
-rdwh.tech: could not connect to host
rdxsattamatka.mobi: could not connect to host
rdyrda.fr: could not connect to host
re-customer.net: could not connect to host
@@ -14698,6 +15410,7 @@ reachr.com: could not connect to host
reactdatepicker.com: did not receive HSTS header
reactor92.com: could not connect to host
reader.ga: could not connect to host
+readheadcopywriting.com: max-age too low: 0
readify.com.au: did not receive HSTS header
readingandmath.org: could not connect to host
readism.io: could not connect to host
@@ -14707,18 +15420,18 @@ readr.pw: could not connect to host
reads.wang: could not connect to host
readtldr.com: could not connect to host
readydok.com: did not receive HSTS header
-readytongue.com: could not connect to host
+readytowear.es: could not connect to host
reagir43.fr: did not receive HSTS header
-reaiaer.com: could not connect to host
reakyaweso.me: could not connect to host
real-bits.com: could not connect to host
real-compare.com: did not receive HSTS header
realcli.com: could not connect to host
+realfamilyincest.com: could not connect to host
realgarant-shop.de: did not receive HSTS header
realhost.name: could not connect to host
realincest.tv: could not connect to host
-really.io: did not receive HSTS header
-reallyreally.io: could not connect to host
+really.io: could not connect to host
+reallyreally.io: did not receive HSTS header
realmic.net: could not connect to host
realmofespionage.com: could not connect to host
realnewhomes.com: could not connect to host
@@ -14729,6 +15442,9 @@ reaper.rip: could not connect to host
reardenporn.com: could not connect to host
rebekaesgabor.online: could not connect to host
rebootmc.com: could not connect to host
+recapp.ch: could not connect to host
+recard.vn: did not receive HSTS header
+recebersms.com: did not receive HSTS header
receitas-de-bolos.pt: could not connect to host
receitasdebacalhau.pt: could not connect to host
receptionsbook.com: could not connect to host
@@ -14738,11 +15454,12 @@ rechenwerk.net: could not connect to host
recht-freundlich.de: did not receive HSTS header
rechtenliteratuurleiden.nl: could not connect to host
reclamebureau-ultrax.nl: did not receive HSTS header
-recreation.gov: did not receive HSTS header
recreoviral.com: did not receive HSTS header
recruitsecuritytraining.co.uk: could not connect to host
recruitsecuritytraining.com: could not connect to host
rectoraudiparts.com: could not connect to host
+recuerdafilms.com: did not receive HSTS header
+red2fred2.com: could not connect to host
redair.es: could not connect to host
redar.xyz: could not connect to host
redburn.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -14755,21 +15472,23 @@ redespaulista.com: did not receive HSTS header
redheeler.com.br: could not connect to host
redhorsemountainranch.com: did not receive HSTS header
redicabo.de: could not connect to host
-redigest.it: could not connect to host
+redigest.it: max-age too low: 0
redirectman.com: could not connect to host
redizoo.com: did not receive HSTS header
redlatam.org: did not receive HSTS header
redletter.link: could not connect to host
redmbk.com: did not receive HSTS header
-redneck-gaming.de: could not connect to host
+redneck-gaming.de: did not receive HSTS header
redner.cc: did not receive HSTS header
rednertv.de: did not receive HSTS header
rednoseday.com: did not receive HSTS header
redoakmedia.net: did not receive HSTS header
redperegrine.com: did not receive HSTS header
+redporno.cz: could not connect to host
redports.org: could not connect to host
redprice.by: could not connect to host
-redra.ws: did not receive HSTS header
+redra.ws: could not connect to host
+redshield.co: did not receive HSTS header
redsquirrelcampsite.co.uk: max-age too low: 5184000
redstarsurf.com: did not receive HSTS header
reducerin.ro: did not receive HSTS header
@@ -14782,12 +15501,14 @@ reeson.org: could not connect to host
reevoo.com: did not receive HSTS header
ref1oct.nl: could not connect to host
referenten.org: did not receive HSTS header
+refill-roboter.de: did not receive HSTS header
refitplanner.com: did not receive HSTS header
reflecton.io: could not connect to host
+reflectores.net: did not receive HSTS header
reformatreality.com: could not connect to host
refreshingserum.com: could not connect to host
reg.ru: did not receive HSTS header
-regaloaks.com: did not receive HSTS header
+regaloaks.com: could not connect to host
regalpaintingfdl.com: could not connect to host
regalpalms.com: did not receive HSTS header
regenbogenwald.de: did not receive HSTS header
@@ -14797,11 +15518,11 @@ reginagroffy.com: could not connect to host
regio-salland.nl: could not connect to host
regionalcoalition.org: did not receive HSTS header
regionale.org: did not receive HSTS header
-regiovertrieb.de: could not connect to host
register.gov.uk: did not receive HSTS header
registertovoteflorida.gov: did not receive HSTS header
regoul.com: did not receive HSTS header
regsec.com: could not connect to host
+rehabmail.com: did not receive HSTS header
rehabthailand.nl: could not connect to host
reher.pro: could not connect to host
rei.codes: did not receive HSTS header
@@ -14812,7 +15533,6 @@ reikiqueen.uk: could not connect to host
reinaertvandecruys.me: could not connect to host
reineberthe.ch: could not connect to host
reinoldus.ddns.net: could not connect to host
-reisenbauer.ee: could not connect to host
reismil.ch: could not connect to host
reisyukaku.org: did not receive HSTS header
reithguard-it.de: did not receive HSTS header
@@ -14838,12 +15558,14 @@ rememberthis.co.za: could not connect to host
remodela.com.ve: could not connect to host
remodelwithlegacy.com: did not receive HSTS header
remonttitekniikka.fi: could not connect to host
+remoteham.com: could not connect to host
remotestance.com: did not receive HSTS header
rencaijia.com: did not receive HSTS header
rencontres-erotiques.com: did not receive HSTS header
rene-guitton.fr: did not receive HSTS header
-reneclemens.nl: max-age too low: 2628000
-renedekoeijer.nl: max-age too low: 2628000
+reneclemens.nl: could not connect to host
+renesauerwein.com: did not receive HSTS header
+renesauerwein.de: did not receive HSTS header
renewed.technology: could not connect to host
rengarenkblog.com: could not connect to host
renideo.fr: could not connect to host
@@ -14860,7 +15582,6 @@ rentcarassist.com: could not connect to host
renteater.com: could not connect to host
rentex.com: did not receive HSTS header
reo.gov: could not connect to host
-repaik.com: did not receive HSTS header
reparo.pe: did not receive HSTS header
repex.co.il: could not connect to host
replaceits.me: could not connect to host
@@ -14883,7 +15604,7 @@ reptilauksjonen.no: could not connect to host
republicmo.gov: did not receive HSTS header
repustate.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
reqognize.com: could not connect to host
-reqrut.net: could not connect to host
+reqrut.net: did not receive HSTS header
request-trent.com: could not connect to host
res-rheingau.de: could not connect to host
res42.com: did not receive HSTS header
@@ -14894,10 +15615,8 @@ reserve-online.net: did not receive HSTS header
reservetonshift.com: could not connect to host
reservoirtp.fr: did not receive HSTS header
residentsinsurance.co.uk: did not receive HSTS header
-resistav.com: could not connect to host
resl20.servehttp.com: could not connect to host
resoundpro.ca: could not connect to host
-resourcesmanagementcorp.com: could not connect to host
respice.xyz: could not connect to host
ressos.com: did not receive HSTS header
restaurace-klokocka.cz: did not receive HSTS header
@@ -14959,7 +15678,7 @@ rhodesianridgeback.com.br: could not connect to host
rhodosdreef.nl: could not connect to host
ribopierre.fr: could not connect to host
ribs.com: did not receive HSTS header
-riceglue.com: did not receive HSTS header
+riceglue.com: could not connect to host
richamorindonesia.com: did not receive HSTS header
richardb.me: could not connect to host
richardcrosby.co.uk: did not receive HSTS header
@@ -14980,8 +15699,10 @@ rideaudiscount.com: did not receive HSTS header
rideforwade.com: could not connect to host
rideforwade.net: could not connect to host
rideforwade.org: could not connect to host
-rideworks.com: did not receive HSTS header
+rideworks.com: could not connect to host
ridingoklahoma.com: could not connect to host
+ridwan.co: could not connect to host
+riechsteiner.tech: could not connect to host
rienasemettre.fr: did not receive HSTS header
riesenmagnete.de: could not connect to host
riester.pl: did not receive HSTS header
@@ -14994,14 +15715,16 @@ rijndael.xyz: could not connect to host
rijnmondeg.nl: did not receive HSTS header
rika.me: could not connect to host
rimediogiusto.com: could not connect to host
-rincon-nsn.gov: could not connect to host
+rincon-nsn.gov: did not receive HSTS header
ring0.xyz: did not receive HSTS header
ringh.am: could not connect to host
rinj.se: did not receive HSTS header
rionewyork.com.br: could not connect to host
+rioxmarketing.pt: could not connect to host
ripa.io: did not receive HSTS header
ripple.com: did not receive HSTS header
rippleunion.com: could not connect to host
+ris-bad-wurzach.de: did not receive HSTS header
risi-china.com: could not connect to host
risingsun.red: could not connect to host
riskmgt.com.au: could not connect to host
@@ -15025,6 +15748,7 @@ rkmedia.no: could not connect to host
rmaqequipamentos.com.br: could not connect to host
rmdlingerie.com.br: did not receive HSTS header
rme.li: did not receive HSTS header
+rmf.io: could not connect to host
rmit.me: could not connect to host
rmk.si: could not connect to host
rms-digicert.ne.jp: did not receive HSTS header
@@ -15036,6 +15760,8 @@ roadfeast.com: could not connect to host
roan24.pl: did not receive HSTS header
roave.com: did not receive HSTS header
rob.uk.com: did not receive HSTS header
+robbertt.com: could not connect to host
+robert-foster.com: could not connect to host
robertabittle.com: could not connect to host
robertg.me: did not receive HSTS header
robertglastra.com: could not connect to host
@@ -15045,11 +15771,11 @@ robertocasares.no-ip.biz: could not connect to host
robi-net.it: could not connect to host
robin-novotny.com: could not connect to host
robinadr.com: did not receive HSTS header
-robodeidentidad.gov: did not receive HSTS header
+robinflikkema.nl: could not connect to host
+robinsonstrategy.com: could not connect to host
robomonkey.org: could not connect to host
roboth.am: could not connect to host
robotics.plus: did not receive HSTS header
-robtatemusic.com: could not connect to host
robteix.com: did not receive HSTS header
robtex.net: did not receive HSTS header
robtex.org: did not receive HSTS header
@@ -15078,7 +15804,7 @@ rofrank.space: could not connect to host
rogeiro.net: could not connect to host
roger101.com: did not receive HSTS header
rogerdat.ovh: could not connect to host
-roguesignal.net: could not connect to host
+rogue-e.xyz: could not connect to host
rohanbassett.com: could not connect to host
rohankrishnadev.in: could not connect to host
rohlik.cz: did not receive HSTS header
@@ -15101,7 +15827,7 @@ romeoferraris.com: did not receive HSTS header
romleg.cf: could not connect to host
roms.fun: could not connect to host
romulusapp.com: could not connect to host
-ron2k.za.net: could not connect to host
+ron2k.za.net: did not receive HSTS header
ronanrbr.com: did not receive HSTS header
rondoniatec.com.br: did not receive HSTS header
rondreis-planner.nl: could not connect to host
@@ -15114,7 +15840,7 @@ rool.me: did not receive HSTS header
roolevoi.ru: could not connect to host
room-checkin24.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
roomongo.com: did not receive HSTS header
-roosterpgplus.nl: did not receive HSTS header
+roosterpgplus.nl: could not connect to host
rootbsd.at: could not connect to host
rootforum.org: did not receive HSTS header
rootrelativity.com: could not connect to host
@@ -15128,7 +15854,7 @@ roseofyork.com: did not receive HSTS header
rosetiger.life: could not connect to host
rosewoodranch.com: did not receive HSTS header
roshiya.co.in: could not connect to host
-rosi-royal.com: could not connect to host
+rosi-royal.com: did not receive HSTS header
rospa100.com: did not receive HSTS header
rossclark.com: did not receive HSTS header
rossen.be: did not receive HSTS header
@@ -15136,17 +15862,15 @@ rossfrancis.co.uk: did not receive HSTS header
rossiworld.com: did not receive HSTS header
rosslug.org.uk: could not connect to host
rotex1840.de: did not receive HSTS header
-rotozen.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
rotter-dam.nl: did not receive HSTS header
rotterdamjazz.info: could not connect to host
rotzonline.com: could not connect to host
rough.nu: could not connect to host
roundaboutweb.info: did not receive HSTS header
-roundtheme.com: did not receive HSTS header
rous.se: could not connect to host
rouvray.org: could not connect to host
rove3d.com: could not connect to host
-rows.io: did not receive HSTS header
+rows.io: could not connect to host
royal-forest.org: max-age too low: 0
royal-mangal.ch: could not connect to host
royal806.com: did not receive HSTS header
@@ -15190,17 +15914,20 @@ royal886.com: did not receive HSTS header
royal887.com: did not receive HSTS header
royal888888.com: did not receive HSTS header
royal889.com: did not receive HSTS header
-royal890.com: did not receive HSTS header
+royal890.com: could not connect to host
royal891.com: did not receive HSTS header
-royal892.com: did not receive HSTS header
-royal893.com: did not receive HSTS header
-royal894.com: did not receive HSTS header
-royal895.com: did not receive HSTS header
+royal892.com: could not connect to host
+royal893.com: could not connect to host
+royal894.com: could not connect to host
+royal895.com: could not connect to host
royal896.com: did not receive HSTS header
royal898.com: did not receive HSTS header
royal899.com: did not receive HSTS header
+royalcitytaxi.com: could not connect to host
royalhop.co: could not connect to host
royalsignaturecruise.com: could not connect to host
+royaltube.net: could not connect to host
+royalty-market.com: could not connect to host
royalyule.com: did not receive HSTS header
roychan.org: max-age too low: 0
royzez.com: could not connect to host
@@ -15208,6 +15935,7 @@ rozalisbengal.ro: could not connect to host
rozeapp.nl: could not connect to host
rpasafrica.com: could not connect to host
rr.in.th: could not connect to host
+rr105.de: did not receive HSTS header
rring.me: could not connect to host
rritv.com: could not connect to host
rrke.cc: did not receive HSTS header
@@ -15216,6 +15944,7 @@ rrom.me: did not receive HSTS header
rs-devdemo.host: could not connect to host
rsajeey.info: could not connect to host
rsampaio.info: did not receive HSTS header
+rsauget.fr: could not connect to host
rsf.io: could not connect to host
rsi.im: could not connect to host
rskuipers.com: did not receive HSTS header
@@ -15223,11 +15952,10 @@ rsldb.com: could not connect to host
rsm-intern.de: could not connect to host
rsmaps.org: could not connect to host
rsmmail.com: did not receive HSTS header
-rsships.com: could not connect to host
+rsships.com: did not receive HSTS header
+rssr.ddns.net: could not connect to host
rstraining.co.uk: did not receive HSTS header
rstsecuritygroup.co.uk: could not connect to host
-rtate.ca: could not connect to host
-rtate.se: could not connect to host
rtc.fun: could not connect to host
rtd.uk.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
rtfpessoa.xyz: did not receive HSTS header
@@ -15236,7 +15964,8 @@ rths.tk: could not connect to host
rttss.com: could not connect to host
rtvi.com: did not receive HSTS header
ru-music.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-ruarua.ml: could not connect to host
+rua.cx: could not connect to host
+ruarua.ml: did not receive HSTS header
rubbereggs.ca: could not connect to host
rubbix.net: could not connect to host
rubecodeberg.com: could not connect to host
@@ -15244,14 +15973,12 @@ rubendv.be: did not receive HSTS header
rubenschulz.nl: did not receive HSTS header
rubi-ka.net: max-age too low: 0
ruborr.se: did not receive HSTS header
-rubyquincunx.com: could not connect to host
-rubyquincunx.org: could not connect to host
rubysecurity.org: did not receive HSTS header
rubyshop.nl: could not connect to host
+rudelune.fr: could not connect to host
rudeotter.com: did not receive HSTS header
ruderverein-gelsenkirchen.de: did not receive HSTS header
rue-de-la-vieille.fr: did not receive HSTS header
-rueg.eu: could not connect to host
ruflay.ru: could not connect to host
rugby.video: could not connect to host
rugirlfriend.com: could not connect to host
@@ -15265,24 +15992,22 @@ rukhaiyar.com: could not connect to host
rullzer.com: did not receive HSTS header
rummel-platz.de: could not connect to host
rumoterra.com.br: could not connect to host
+run-forrest.run: could not connect to host
runawebinar.nl: could not connect to host
runcarina.com: could not connect to host
rundumcolumn.xyz: could not connect to host
runementors.com: could not connect to host
-runhardt.eu: did not receive HSTS header
+runhardt.eu: could not connect to host
runtl.com: did not receive HSTS header
runtondev.com: did not receive HSTS header
ruobiyi.com: could not connect to host
ruqu.nl: could not connect to host
rusadmin.biz: did not receive HSTS header
-rushpoppershop.co.uk: could not connect to host
rusl.me: could not connect to host
rusl.net: did not receive HSTS header
russmarshall.com: could not connect to host
rustbyexample.com: did not receive HSTS header
rustfanatic.com: did not receive HSTS header
-rustralasia.net: max-age too low: 0
-ruurdboomsma.nl: could not connect to host
ruxit.com: did not receive HSTS header
rva.gov: could not connect to host
rvender.cz: did not receive HSTS header
@@ -15290,9 +16015,9 @@ rvg.zone: could not connect to host
rvoigt.eu: could not connect to host
rvolve.net: could not connect to host
rw-solutions.tech: could not connect to host
-rwanderlust.com: did not receive HSTS header
+rwanderlust.com: could not connect to host
rwgamernl.ml: could not connect to host
-rws-cc.com: did not receive HSTS header
+rx-contact.com: did not receive HSTS header
rxprep.com: did not receive HSTS header
rxt.social: could not connect to host
rxv.cc: could not connect to host
@@ -15303,40 +16028,38 @@ rybox.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR
ryejuice.sytes.net: could not connect to host
rylin.net: did not receive HSTS header
rylore.com: could not connect to host
-ryssl.com: did not receive HSTS header
+ryssl.com: could not connect to host
ryssland.guide: could not connect to host
ryyule.com: did not receive HSTS header
ryzex.de: could not connect to host
rzegroup.com: did not receive HSTS header
s-d-v.ch: could not connect to host
-s-mdb.com: max-age too low: 7776000
s-on.li: could not connect to host
s-rickroll-p.pw: could not connect to host
s.how: could not connect to host
s0923.com: could not connect to host
-s0laris.co.uk: could not connect to host
s1mplescripts.de: could not connect to host
s1ris.org: did not receive HSTS header
+s2p.moe: could not connect to host
s3cases.com: did not receive HSTS header
s3gfault.com: could not connect to host
s3n.se: could not connect to host
-saabwa.org: could not connect to host
+s5118.com: could not connect to host
+sa-blog.net: could not connect to host
+saabwa.org: did not receive HSTS header
sabatek.pl: did not receive HSTS header
-sabine-forschbach.de: could not connect to host
-sabineforschbach.de: could not connect to host
-sabrinajoiasprontaentrega.com.br: could not connect to host
-sabtunes.com: did not receive HSTS header
+sabtunes.com: could not connect to host
sac-shop.com: did not receive HSTS header
saccounty.gov: could not connect to host
sacharidovejednotky.eu: could not connect to host
-sachk.com: could not connect to host
+sachk.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
sackers.com: did not receive HSTS header
saco-ceso.com: could not connect to host
sadiejanehair.com: could not connect to host
-sadsu.com: did not receive HSTS header
saenforcement.agency: could not connect to host
safari-afrique.com: did not receive HSTS header
-safedevice.net: could not connect to host
+safe.space: could not connect to host
+safedevice.net: did not receive HSTS header
safelist.eu: did not receive HSTS header
safeme.ga: could not connect to host
safemovescheme.co.uk: could not connect to host
@@ -15353,7 +16076,6 @@ sagarhandicraft.com: could not connect to host
sagemontchurch.org: did not receive HSTS header
sageth.com: could not connect to host
sah3.net: could not connect to host
-saigonstar.de: could not connect to host
sail-nyc.com: did not receive HSTS header
saint-astier-triathlon.com: did not receive HSTS header
saintefoy-tarentaise.com: did not receive HSTS header
@@ -15361,7 +16083,7 @@ saintjohnlutheran.church: did not receive HSTS header
saintmichelqud.com: did not receive HSTS header
sairai.bid: could not connect to host
saiyasu-search.com: did not receive HSTS header
-sakaserver.com: could not connect to host
+sakaserver.com: did not receive HSTS header
sakib.ninja: did not receive HSTS header
sakurabuff.com: could not connect to host
salaervergleich.com: did not receive HSTS header
@@ -15370,8 +16092,11 @@ saleaks.org: could not connect to host
salearnership.co.za: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
saleslift.pl: could not connect to host
salishseawhalewatching.ca: did not receive HSTS header
+salixcode.com: did not receive HSTS header
sallysubs.com: could not connect to host
salmo23.com.br: could not connect to host
+salmos91.com: could not connect to host
+salon-claudia.ch: could not connect to host
salonestella.it: could not connect to host
salserocafe.com: did not receive HSTS header
salserototal.com: could not connect to host
@@ -15386,9 +16111,11 @@ samanthahumphreysstudio.com: did not receive HSTS header
samanthasicecream.com: could not connect to host
samaritan.tech: could not connect to host
samaritansnet.org: did not receive HSTS header
+samba.com.co: did not receive HSTS header
+sambaa.com.br: could not connect to host
sametovymesic.cz: could not connect to host
samin.tk: could not connect to host
-samip.fi: did not receive HSTS header
+samitechnic.com: did not receive HSTS header
saml2.com: could not connect to host
samlamac.com: could not connect to host
samm.com.au: did not receive HSTS header
@@ -15401,25 +16128,26 @@ samraskauskas.com: could not connect to host
samsen.club: could not connect to host
samsonova.de: could not connect to host
samsungxoa.com: could not connect to host
+samuel-dumont.be: did not receive HSTS header
samvanderkris.com: could not connect to host
samvanderkris.xyz: did not receive HSTS header
samyerkes.com: did not receive HSTS header
-san-mian-ka.ml: did not receive HSTS header
+san-mian-ka.ml: could not connect to host
+sanael.net: could not connect to host
sanalbayrak.com: could not connect to host
sanandreasstories.com: did not receive HSTS header
sanasalud.org: could not connect to host
sanatfilan.com: did not receive HSTS header
sanatrans.com: could not connect to host
sanchez.adv.br: could not connect to host
-sand-islets.de: did not receive HSTS header
-sandboxfp.com: could not connect to host
sanderknape.com: did not receive HSTS header
+sandobygg.se: could not connect to host
+sandogruppen.se: could not connect to host
sandtonvipcompanions.com: did not receive HSTS header
sandviks.com: did not receive HSTS header
sanguoxiu.com: could not connect to host
sanhei.ch: did not receive HSTS header
-sanik.my: did not receive HSTS header
-sanjotech.space: did not receive HSTS header
+sanik.my: could not connect to host
sannesfotklinikk.no: did not receive HSTS header
sanradon.by: did not receive HSTS header
sansage.com.br: did not receive HSTS header
@@ -15443,12 +16171,14 @@ sapporobeer.com: could not connect to host
sapuncheta.com: could not connect to host
saq.com: could not connect to host
sarah-beckett-harpist.com: did not receive HSTS header
+sarahcheyette.com: did not receive HSTS header
sarahdoyley.com: could not connect to host
sarahlouisesearle.com: could not connect to host
sarahsweetlife.com: could not connect to host
sarahsweger.com: could not connect to host
sarakas.com: did not receive HSTS header
sarangsemutbandung.com: could not connect to host
+sarbash.ee: could not connect to host
sarindia.com: could not connect to host
sarindia.de: could not connect to host
sarisonproductions.com: did not receive HSTS header
@@ -15456,6 +16186,7 @@ sarkarikhoj.com: could not connect to host
sarkarischeme.in: could not connect to host
sarkisozleri.us: could not connect to host
sarndipity.com: could not connect to host
+saronno5stelle.it: did not receive HSTS header
saruwebshop.co.za: could not connect to host
sasrobotics.xyz: could not connect to host
sat.rent: did not receive HSTS header
@@ -15468,7 +16199,6 @@ satrent.com: did not receive HSTS header
satrent.se: did not receive HSTS header
satriyowibowo.my.id: could not connect to host
satsang-uwe.de: did not receive HSTS header
-satsukii.moe: did not receive HSTS header
sattamatkadpboss.mobi: could not connect to host
saturne.tk: could not connect to host
saucyfox.net: did not receive HSTS header
@@ -15476,7 +16206,6 @@ saudeeconforto.com.br: did not receive HSTS header
sauenytt.no: could not connect to host
saumon.io: did not receive HSTS header
saumon.xyz: could not connect to host
-saunahats.eu: could not connect to host
saunasandstuff.ca: did not receive HSTS header
saunasandstuff.com: did not receive HSTS header
saurel.me: could not connect to host
@@ -15493,12 +16222,12 @@ savethedogfishfoundation.org: could not connect to host
saveyour.biz: could not connect to host
savingbytes.com: did not receive HSTS header
savinggoliath.com: could not connect to host
+savingsstoreonline.ca: did not receive HSTS header
savvysuit.com: did not receive HSTS header
saxol-group.com: could not connect to host
say-hanabi.com: could not connect to host
sayhanabi.com: could not connect to host
sazima.ru: did not receive HSTS header
-sb-sd.org: could not connect to host
sblum.de: did not receive HSTS header
sbm.cloud: could not connect to host
sbobetfun.com: did not receive HSTS header
@@ -15506,13 +16235,13 @@ sbox-archives.com: could not connect to host
sbsrv.ml: could not connect to host
sby.de: did not receive HSTS header
sc4le.com: could not connect to host
-scaarus.com: could not connect to host
scaffoldhireeastrand.co.za: did not receive HSTS header
scaffoldhirefourways.co.za: did not receive HSTS header
scaffoldhirerandburg.co.za: did not receive HSTS header
scaffoldhiresandton.co.za: did not receive HSTS header
scala.click: did not receive HSTS header
-scannabi.com: could not connect to host
+scannabi.com: did not receive HSTS header
+scentofwine.com: did not receive HSTS header
sceptique.eu: did not receive HSTS header
sch44r0n.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
schaafenstrasse.koeln: could not connect to host
@@ -15520,7 +16249,7 @@ schachburg.de: did not receive HSTS header
schadegarant.net: could not connect to host
schalkoortbv.nl: did not receive HSTS header
schaper-sport.com: did not receive HSTS header
-schatmeester.be: did not receive HSTS header
+schatmeester.be: could not connect to host
schau-rein.co.at: did not receive HSTS header
schauer.so: could not connect to host
schd.io: did not receive HSTS header
@@ -15528,7 +16257,6 @@ schermreparatierotterdam.nl: did not receive HSTS header
schil.li: could not connect to host
schippers-it.nl: did not receive HSTS header
schlabbi.com: did not receive HSTS header
-schlaf.guru: did not receive HSTS header
schmelzle.io: could not connect to host
schmidttulskie.de: could not connect to host
schmitt.ovh: could not connect to host
@@ -15551,17 +16279,20 @@ schreibnacht.de: did not receive HSTS header
schreinerei-wortmann.de: did not receive HSTS header
schrikdraad.net: did not receive HSTS header
schrodinger.io: could not connect to host
+schrodingersscat.com: could not connect to host
+schrodingersscat.org: could not connect to host
schroepfglas-versand.de: did not receive HSTS header
schroettle.com: did not receive HSTS header
schulterglatzen-altenwalde.de: could not connect to host
schum.world: could not connect to host
schummar.de: could not connect to host
schur-it.de: could not connect to host
+schwanke.in: max-age too low: 3600
schwarzkopfforyou.de: did not receive HSTS header
schwarzwaldcon.de: did not receive HSTS header
schwedenhaus.ag: did not receive HSTS header
schweiz.guide: could not connect to host
-schweizerbolzonello.net: could not connect to host
+schweizerbolzonello.net: did not receive HSTS header
schwerkraftlabor.de: did not receive HSTS header
schwetz.net: could not connect to host
sci-internet.tk: could not connect to host
@@ -15570,9 +16301,9 @@ scicasts.com: max-age too low: 7776000
science-anatomie.com: did not receive HSTS header
scienceathome.org: did not receive HSTS header
sciencemonster.co.uk: could not connect to host
-scientific.boston: could not connect to host
scionasset.com: did not receive HSTS header
sciototownship-oh.gov: did not receive HSTS header
+scis.com.ua: did not receive HSTS header
scitopia.me: could not connect to host
scivillage.com: did not receive HSTS header
sckc.stream: could not connect to host
@@ -15585,6 +16316,7 @@ scores4schools.com: could not connect to host
scorobudem.ru: could not connect to host
scorocode.ru: did not receive HSTS header
scotbirchfield.com: did not receive HSTS header
+scottah.com: did not receive HSTS header
scottainslie.me.uk: could not connect to host
scottdial.com: did not receive HSTS header
scottferguson.com.au: did not receive HSTS header
@@ -15592,7 +16324,8 @@ scottgruber.me: did not receive HSTS header
scotthel.me: did not receive HSTS header
scotthelme.com: did not receive HSTS header
scottnicol.co.uk: could not connect to host
-scottstorey.co.uk: did not receive HSTS header
+scottstorey.co.uk: could not connect to host
+scotttopperproductions.com: did not receive HSTS header
scottynordstrom.org: could not connect to host
scourt.info: max-age too low: 0
scourt.org.ua: could not connect to host
@@ -15633,7 +16366,7 @@ se7ensins.com: did not receive HSTS header
sea-godzilla.com: could not connect to host
seanationals.org: max-age too low: 1
seanchaidh.org: could not connect to host
-seans.cc: did not receive HSTS header
+seans.cc: could not connect to host
seanstrout.com: did not receive HSTS header
seansyardservice.com: did not receive HSTS header
searchgov.gov.il: did not receive HSTS header
@@ -15645,13 +16378,12 @@ sebastian-lutsch.de: could not connect to host
sebastian-schmidt.me: did not receive HSTS header
sebastianhampl.de: could not connect to host
sebastianpedersen.com: did not receive HSTS header
-sebastiensenechal.com: did not receive HSTS header
sebi.cf: could not connect to host
sebster.com: did not receive HSTS header
sec4share.me: did not receive HSTS header
secandtech.com: could not connect to host
secanje.nl: did not receive HSTS header
-secboom.com: did not receive HSTS header
+secboom.com: could not connect to host
seccomp.ru: did not receive HSTS header
seceye.cn: could not connect to host
secitem.at: could not connect to host
@@ -15666,14 +16398,15 @@ secondarysurvivorportal.com: could not connect to host
secondarysurvivorportal.help: could not connect to host
secondbike.co.uk: did not receive HSTS header
secondbyte.nl: could not connect to host
-secondpay.nl: did not receive HSTS header
+secondpay.nl: could not connect to host
secondspace.ca: could not connect to host
secpoc.online: could not connect to host
secretnation.net: did not receive HSTS header
secretofanah.com: could not connect to host
-secretum.tech: did not receive HSTS header
+secretpanties.com: could not connect to host
sectest.ml: could not connect to host
sectia22.ro: could not connect to host
+section508.gov: did not receive HSTS header
sectionw2s.org: did not receive HSTS header
secur3.us: did not receive HSTS header
secure-automotive-cloud.com: could not connect to host
@@ -15692,8 +16425,10 @@ securita.eu: did not receive HSTS header
security-carpet.com: could not connect to host
security-thoughts.org: could not connect to host
security.google.com: did not receive HSTS header (error ignored - included regardless)
+security.love: could not connect to host
security.xn--q9jyb4c: could not connect to host
securityarena.com: could not connect to host
+securityblues.co.uk: could not connect to host
securitybrief.asia: did not receive HSTS header
securitybrief.co.nz: did not receive HSTS header
securitybrief.com.au: did not receive HSTS header
@@ -15705,7 +16440,9 @@ securityglance.com: could not connect to host
securityinet.biz: did not receive HSTS header
securityinet.net: did not receive HSTS header
securityinet.org.il: could not connect to host
+securitysense.co.uk: could not connect to host
securitysoapbox.com: could not connect to host
+securitystreak.com: could not connect to host
securitytalk.pl: could not connect to host
securitytestfan.gov: could not connect to host
securitywatch.co.nz: did not receive HSTS header
@@ -15713,21 +16450,24 @@ securiviera.ch: did not receive HSTS header
securon.io: could not connect to host
securoswiss.ch: could not connect to host
secwise.nl: did not receive HSTS header
-sedeusquiser.net: could not connect to host
+sedeusquiser.net: did not receive HSTS header
sedoexpert.nl: could not connect to host
sedoexperts.nl: could not connect to host
sedrubal.de: could not connect to host
sedziapilkarski.pl: did not receive HSTS header
seedalpha.com: could not connect to host
seedboxers.net: could not connect to host
+seedsofangelica.net: did not receive HSTS header
seefirm.com: did not receive HSTS header
seefunk.net: did not receive HSTS header
seehimnaked.com: could not connect to host
seehimnude.com: could not connect to host
seehisnudes.com: could not connect to host
+seekthe.net: did not receive HSTS header
seele.ca: could not connect to host
seemeasaperson.com: did not receive HSTS header
seen.life: did not receive HSTS header
+seesuite.com: could not connect to host
sehenderson.com: did not receive HSTS header
seida.at: could not connect to host
seiko-dojo.com: could not connect to host
@@ -15739,11 +16479,10 @@ selecadm.name: could not connect to host
selectary.com: could not connect to host
selectcertifiedautos.com: did not receive HSTS header
selectruckscalltrackingreports.com: could not connect to host
-selent.me: could not connect to host
+selekzo.com: could not connect to host
selfdefenserx.com: did not receive HSTS header
selfhosters.com: could not connect to host
selfie-france.fr: could not connect to host
-selfmade4u.de: could not connect to host
selfoutlet.com: did not receive HSTS header
selfserverx.com: could not connect to host
selitysvideot.fi: did not receive HSTS header
@@ -15754,26 +16493,28 @@ seltendoof.de: could not connect to host
semantheme.fr: could not connect to host
semen3325.xyz: could not connect to host
semenkovich.com: did not receive HSTS header
-sementes.gratis: could not connect to host
semianalog.com: could not connect to host
semirben.de: max-age too low: 172800
semmlers.com: did not receive HSTS header
semps-servers.de: could not connect to host
sendash.com: did not receive HSTS header
-sendmeback.de: did not receive HSTS header
senedirect.com: could not connect to host
senemusique.com: did not receive HSTS header
+senorporno.com: could not connect to host
senseofnumber.co.uk: did not receive HSTS header
senseye.io: did not receive HSTS header
sensiblemn.org: could not connect to host
sensibus.com: did not receive HSTS header
-sensoft-int.com: could not connect to host
sensoft-int.net: could not connect to host
+sensound.ml: could not connect to host
+sensualism.com: could not connect to host
seo-lagniappe.com: did not receive HSTS header
seo.london: did not receive HSTS header
seoarchive.org: could not connect to host
seobot.com.au: could not connect to host
+seocomposer.com: did not receive HSTS header
seoenmexico.com.mx: did not receive HSTS header
+seoexperte.berlin: did not receive HSTS header
seohochschule.de: could not connect to host
seoium.com: did not receive HSTS header
seokay.com: did not receive HSTS header
@@ -15784,7 +16525,7 @@ seomen.biz: could not connect to host
seomobo.com: could not connect to host
seosanantonioinc.com: did not receive HSTS header
seoscribe.net: could not connect to host
-seosec.xyz: could not connect to host
+seostepbysteplab.com: could not connect to host
seotronix.net: did not receive HSTS header
seowarp.net: could not connect to host
sep23.ru: did not receive HSTS header
@@ -15799,8 +16540,10 @@ serathius.ovh: could not connect to host
serbien.guide: could not connect to host
serenitycreams.com: did not receive HSTS header
serfdom.io: did not receive HSTS header
+sergiojimenezequestrian.com: could not connect to host
serized.pw: could not connect to host
serkaneles.com: did not receive HSTS header
+seru.eu: could not connect to host
servdiscount.com: did not receive HSTS header
servecrypt.com: could not connect to host
servecrypt.net: could not connect to host
@@ -15808,11 +16551,13 @@ servecrypt.ru: could not connect to host
servemnaction.org: could not connect to host
server-bg.net: could not connect to host
server.pk: did not receive HSTS header
+server92.tk: could not connect to host
serverangels.co.uk: did not receive HSTS header
servercode.ca: did not receive HSTS header
serverdensity.io: did not receive HSTS header
servergno.me: did not receive HSTS header
serverlauget.no: could not connect to host
+serverlog.net: could not connect to host
servermonkey.nl: could not connect to host
servfefe.com: could not connect to host
service-wueste-vodafone.tk: could not connect to host
@@ -15825,29 +16570,37 @@ seryo.moe: could not connect to host
seryo.net: could not connect to host
seryovpn.com: could not connect to host
sesha.co.za: could not connect to host
+setfix.de: did not receive HSTS header
sethoedjo.com: could not connect to host
setkit.net: could not connect to host
-setphaserstostun.org: could not connect to host
setterirlandes.com.br: could not connect to host
setuid.de: could not connect to host
sevenet.pl: did not receive HSTS header
sevenhearts.online: could not connect to host
sevsopr.ru: could not connect to host
+sex-education.com: could not connect to host
+sexaki.com: did not receive HSTS header
+sexgarage.de: could not connect to host
+sexocomgravidas.com: could not connect to host
+sexoyrelax.com: could not connect to host
sexpay.net: could not connect to host
sexshopfacil.com.br: could not connect to host
-sexshopnet.com.br: could not connect to host
sexshopsgay.com: did not receive HSTS header
+sexwork.net: could not connect to host
+sexymassageoil.com: could not connect to host
seyahatsagliksigortalari.com: could not connect to host
+seydaozcan.com: could not connect to host
seyr.it: could not connect to host
sfashion.si: did not receive HSTS header
+sfaturiit.ro: could not connect to host
sfcomercio.com.br: could not connect to host
sfhobbies.com.br: could not connect to host
sfsltd.com: could not connect to host
sgovaard.nl: did not receive HSTS header
-sgroup-hitoduma.com: did not receive HSTS header
-sgroup-rec.com: did not receive HSTS header
+sgrmreproduccionapp.azurewebsites.net: could not connect to host
sgthotshot.com: could not connect to host
sgtsnookums.net: could not connect to host
+sh0rt.zone: did not receive HSTS header
sh11.pp.ua: did not receive HSTS header
sh4y.com: could not connect to host
sha2017.org: did not receive HSTS header
@@ -15890,6 +16643,7 @@ shanxiapark.com: could not connect to host
shanyhs.com: could not connect to host
shapesedinburgh.co.uk: did not receive HSTS header
shardsoft.com: could not connect to host
+share.works: max-age too low: 1209600
sharecc.co: could not connect to host
shareeri.com: could not connect to host
shareimg.xyz: could not connect to host
@@ -15899,7 +16653,6 @@ sharepass.pw: could not connect to host
sharepic.xyz: could not connect to host
sharesplitter.com: could not connect to host
shareworx.net: could not connect to host
-sharezen.de: could not connect to host
shariahlawcenter.com: could not connect to host
shariahlawcenter.org: could not connect to host
sharialawcenter.com: could not connect to host
@@ -15910,6 +16663,7 @@ sharpe-practice.co.uk: could not connect to host
shasso.com: did not receive HSTS header
shatorin.com: did not receive HSTS header
shauncrowley.co.uk: could not connect to host
+shaunharker.com: did not receive HSTS header
shaunwheelhou.se: could not connect to host
shavingks.com: could not connect to host
shawnbsmith.me: did not receive HSTS header
@@ -15920,6 +16674,7 @@ shazbots.org: could not connect to host
sheekdeveloper.com: could not connect to host
shellot.com: could not connect to host
shellsec.pw: did not receive HSTS header
+shemsconseils.ma: could not connect to host
shena.co.uk: could not connect to host
shengrenyu.com: could not connect to host
shentengtu.idv.tw: could not connect to host
@@ -15935,6 +16690,7 @@ shiatsu-institut.ch: could not connect to host
shibainu.com.br: could not connect to host
shibe.club: could not connect to host
shieldcomputer.com: could not connect to host
+shieldfe.com: did not receive HSTS header
shieldofachilles.in: could not connect to host
shift.ooo: did not receive HSTS header
shiftins.com: could not connect to host
@@ -15968,10 +16724,10 @@ sho-tanaka.jp: could not connect to host
shocksrv.com: did not receive HSTS header
shoemuse.com: did not receive HSTS header
sholtowu.com: could not connect to host
+shome.de: did not receive HSTS header
shooshosha.com: could not connect to host
shootpooloklahoma.com: could not connect to host
shop.fr: did not receive HSTS header
-shopcoupons.my: did not receive HSTS header
shopdopastor.com.br: could not connect to host
shopherbal.co.za: could not connect to host
shophisway.com: could not connect to host
@@ -15986,13 +16742,11 @@ shops.neonisi.com: could not connect to host
shortpath.com: could not connect to host
shortr.li: could not connect to host
shota.party: could not connect to host
-shota.vip: could not connect to host
shotpixonline.com.br: did not receive HSTS header
show-saratov.ru: did not receive HSTS header
show-stream.tv: could not connect to host
showdepiscinas.com.br: did not receive HSTS header
shower.im: did not receive HSTS header
-showf.om: could not connect to host
showkeeper.tv: did not receive HSTS header
showroom.de: did not receive HSTS header
showroom113.ru: could not connect to host
@@ -16005,18 +16759,19 @@ shu-kin.net: did not receive HSTS header
shukatsu-note.com: could not connect to host
shulker.store: could not connect to host
shurita.org: could not connect to host
-shuvo.rocks: did not receive HSTS header
+shuvo.rocks: could not connect to host
shuzicai.cn: could not connect to host
shv25.se: could not connect to host
shwongacc.com: could not connect to host
-shybynature.com: did not receive HSTS header
shymeck.pw: could not connect to host
shypp.it: could not connect to host
shyrydan.es: could not connect to host
+siamdevsquare.com: could not connect to host
siamega.com: could not connect to host
siammedia.co: could not connect to host
siamojo.com: could not connect to host
sianimacion.com: could not connect to host
+sianjhon.com: did not receive HSTS header
siao-mei.com: did not receive HSTS header
sichere-kartenakzeptanz.de: could not connect to host
siciliadigitale.pro: could not connect to host
@@ -16024,11 +16779,11 @@ sickfile.com: could not connect to host
sicklepod.com: could not connect to host
siconnect.us: did not receive HSTS header
sictame-tigf.org: did not receive HSTS header
-sideropolisnoticias.com.br: did not receive HSTS header
+sideropolisnoticias.com.br: could not connect to host
siduga.com: could not connect to host
siebens.net: could not connect to host
sieh.es: did not receive HSTS header
-siemencaes.tk: did not receive HSTS header
+siemencaes.tk: max-age too low: 2592000
sieulog.com: could not connect to host
sifls.com: could not connect to host
sifreuret.com: could not connect to host
@@ -16058,10 +16813,14 @@ silverartcollector.com: did not receive HSTS header
silverback.is: did not receive HSTS header
silvergoldbull.ba: could not connect to host
silvergoldbull.bg: could not connect to host
+silvergoldbull.co.tz: could not connect to host
silvergoldbull.com.gh: could not connect to host
+silvergoldbull.hr: could not connect to host
silvergoldbull.kg: could not connect to host
silvergoldbull.ky: could not connect to host
+silvergoldbull.lk: could not connect to host
silvergoldbull.md: could not connect to host
+silvergoldbull.mk: could not connect to host
silvergoldbull.ml: could not connect to host
silvergoldbull.ph: could not connect to host
silverhome.ninja: could not connect to host
@@ -16078,17 +16837,17 @@ simeon.us: max-age too low: 2592000
simfri.com: could not connect to host
simha.online: could not connect to host
simhaf.cf: could not connect to host
+simlau.net: could not connect to host
simnovo.net: did not receive HSTS header
simobilklub.si: could not connect to host
simod.org: could not connect to host
simon-pokorny.com: did not receive HSTS header
simon.butcher.name: max-age too low: 2629743
simon.lc: did not receive HSTS header
-simongong.net: did not receive HSTS header
+simongong.net: could not connect to host
simonkjellberg.se: did not receive HSTS header
simonsaxon.com: did not receive HSTS header
simonschmitt.ch: could not connect to host
-simonshine.dk: could not connect to host
simonsmh.cc: did not receive HSTS header
simotrescu.ro: could not connect to host
simpan.id: could not connect to host
@@ -16096,7 +16855,6 @@ simpeo.fr: did not receive HSTS header
simpeo.org: did not receive HSTS header
simpleai.net: max-age too low: 600
simpleclassiclife.com: could not connect to host
-simplecmsdemo.com: could not connect to host
simplelearner.com: could not connect to host
simplepractice.com: did not receive HSTS header
simplerses.com: could not connect to host
@@ -16105,7 +16863,6 @@ simplexsupport.com: did not receive HSTS header
simplixos.org: could not connect to host
simplyenak.com: did not receive HSTS header
simplyrara.com: did not receive HSTS header
-simpul.nl: did not receive HSTS header
sims4hub.ga: could not connect to host
simtin-net.de: could not connect to host
simumiehet.com: could not connect to host
@@ -16119,6 +16876,7 @@ sinefili.com: could not connect to host
sinful.pw: could not connect to host
singee.site: could not connect to host
singerwang.com: did not receive HSTS header
+singles-berlin.de: could not connect to host
singul4rity.com: could not connect to host
sinkip.com: could not connect to host
sinn.io: did not receive HSTS header
@@ -16132,18 +16890,19 @@ sinusbot.online: did not receive HSTS header
sion.moe: did not receive HSTS header
sipc.org: did not receive HSTS header
sipsik.net: did not receive HSTS header
+sipstix.co.za: did not receive HSTS header
siqi.wang: could not connect to host
-sirburton.com: could not connect to host
+sirburton.com: did not receive HSTS header
siriad.com: could not connect to host
sirius-lee.net: could not connect to host
siro.gq: did not receive HSTS header
siroop.ch: did not receive HSTS header
sisgopro.com: could not connect to host
+sisseastumine.ee: could not connect to host
sistemasespecializados.com: did not receive HSTS header
sistemlash.com: did not receive HSTS header
sistemos.net: could not connect to host
sistersurprise.de: did not receive HSTS header
-sisver.mx: did not receive HSTS header
siteage.net: did not receive HSTS header
sitecloudify.com: could not connect to host
sitecuatui.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -16157,17 +16916,16 @@ sitesforward.com: did not receive HSTS header
sitesource101.com: did not receive HSTS header
sitesten.com: could not connect to host
sitesuccessful.com: did not receive HSTS header
-sitsy.ru: could not connect to host
+sitsy.ru: did not receive HSTS header
sittinginoblivion.com: did not receive HSTS header
-sixcorners.info: could not connect to host
+siusto.com: did not receive HSTS header
+sixcorners.info: did not receive HSTS header
sixcorners.net: could not connect to host
+sixtwentyten.com: did not receive HSTS header
sizingservers.be: did not receive HSTS header
-sizzle.co.uk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
sja-se-training.com: could not connect to host
-sjatsh.com: could not connect to host
sjdtaxi.com: did not receive HSTS header
sjhyl11.com: could not connect to host
-sjis.me: could not connect to host
sjsc.fr: did not receive HSTS header
sjsmith.id.au: did not receive HSTS header
sjv4u.ch: did not receive HSTS header
@@ -16185,8 +16943,10 @@ skates.guru: did not receive HSTS header
skday.com: did not receive HSTS header
ski-insurance.com.au: did not receive HSTS header
skidstresser.com: could not connect to host
+skigebied.nl: could not connect to host
skiinstructor.services: did not receive HSTS header
skilldetector.com: could not connect to host
+skillout.org: could not connect to host
skillproxy.com: could not connect to host
skillproxy.net: could not connect to host
skillproxy.org: could not connect to host
@@ -16202,15 +16962,17 @@ skoda-nurdiebesten.de: did not receive HSTS header
skoda-service-team-cup.de: did not receive HSTS header
skolnieks.lv: could not connect to host
skomski.org: did not receive HSTS header
+skorepova.info: could not connect to host
skpdev.net: could not connect to host
skrimix.tk: could not connect to host
skrivande.co: could not connect to host
skullhouse.nyc: could not connect to host
+skutry.cz: could not connect to host
sky-aroma.com: could not connect to host
sky-universe.net: did not receive HSTS header
+skyanchor.com: did not receive HSTS header
skyasker.cn: could not connect to host
skyasker.com: could not connect to host
-skybloom.com: could not connect to host
skybloom.io: could not connect to host
skybound.link: did not receive HSTS header
skyflix.me: could not connect to host
@@ -16225,12 +16987,10 @@ skyris.co: did not receive HSTS header
skyrunners.ch: could not connect to host
skytec.host: did not receive HSTS header
skyvault.io: could not connect to host
-skyveo.ml: did not receive HSTS header
+skyveo.ml: could not connect to host
skyway.capital: did not receive HSTS header
skyworldserver.ddns.net: could not connect to host
-sl0.us: did not receive HSTS header
sl1pkn07.wtf: could not connect to host
-slapen17.nl: could not connect to host
slaps.be: could not connect to host
slash-dev.de: did not receive HSTS header
slash64.co.uk: could not connect to host
@@ -16244,6 +17004,7 @@ slatemc.fun: could not connect to host
slatko.io: could not connect to host
slattery.co: did not receive HSTS header
slauber.de: did not receive HSTS header
+slaughter.com: could not connect to host
sld08.com: did not receive HSTS header
sleeklounge.com: did not receive HSTS header
sleep10.com: could not connect to host
@@ -16259,7 +17020,6 @@ slimmerbouwen.be: did not receive HSTS header
slingo.com: did not receive HSTS header
slix.io: could not connect to host
sln.cloud: could not connect to host
-slo-net.net: could not connect to host
slope.haus: could not connect to host
slotboss.co.uk: did not receive HSTS header
slovakiana.sk: did not receive HSTS header
@@ -16272,10 +17032,13 @@ sluitkampzeist.nl: could not connect to host
sluplift.com: could not connect to host
slycurity.de: could not connect to host
slytech.ch: could not connect to host
+smadav.ml: could not connect to host
smallcdn.rocks: could not connect to host
smallchat.nl: could not connect to host
+smallcloudsolutions.co.za: could not connect to host
+smallpath.me: could not connect to host
smallplanet.ch: did not receive HSTS header
-smallshopit.com: could not connect to host
+smallshopit.com: did not receive HSTS header
smart-mirror.de: did not receive HSTS header
smart-ov.nl: could not connect to host
smartass.space: could not connect to host
@@ -16287,7 +17050,7 @@ smarterskies.gov: did not receive HSTS header
smartest-trading.com: could not connect to host
smarthomedna.com: did not receive HSTS header
smartietop.com: could not connect to host
-smartit.pro: did not receive HSTS header
+smartit.pro: could not connect to host
smartlend.se: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
smartmompicks.com: did not receive HSTS header
smartofficesandsmarthomes.com: did not receive HSTS header
@@ -16295,9 +17058,10 @@ smartofficeusa.com: [Exception... "Component returned failure code: 0x80004005 (
smartphone.continental.com: could not connect to host
smartrade.tech: did not receive HSTS header
smartrak.co.nz: did not receive HSTS header
+smartviewing.com: did not receive HSTS header
smartwelve.com: could not connect to host
smartwritingservice.com: could not connect to host
-smcbox.com: did not receive HSTS header
+smcbox.com: could not connect to host
smdev.fr: could not connect to host
smet.us: could not connect to host
smi-a.me: could not connect to host
@@ -16314,12 +17078,15 @@ sml.lc: could not connect to host
smmcab.ru: could not connect to host
smmcab.website: could not connect to host
smmlaba.io: could not connect to host
+smokinghunks.com: could not connect to host
smove.sg: did not receive HSTS header
smplix.com: could not connect to host
+smplr.uk: could not connect to host
smries.com: could not connect to host
sms1.ro: could not connect to host
smsben.cn: did not receive HSTS header
smsben.com: did not receive HSTS header
+smskeywords.co.uk: could not connect to host
smspodmena.ru: could not connect to host
smtp.bz: did not receive HSTS header
smtpdev.com: could not connect to host
@@ -16331,8 +17098,10 @@ snailing.org: could not connect to host
snake.dog: could not connect to host
snakehosting.dk: did not receive HSTS header
snapappts.com: could not connect to host
+snapnudes.co: could not connect to host
snapworks.net: did not receive HSTS header
snarf.in: could not connect to host
+snazel.co.uk: could not connect to host
sneaker.date: could not connect to host
sneed.company: could not connect to host
sneezry.com: did not receive HSTS header
@@ -16356,6 +17125,8 @@ so-healthy.co.uk: did not receive HSTS header
sobabox.ru: could not connect to host
sobinski.pl: did not receive HSTS header
soboleva-pr.com.ua: could not connect to host
+soc.net: could not connect to host
+socal-babes.com: could not connect to host
soccergif.com: could not connect to host
soci.ml: could not connect to host
social-journey.com: could not connect to host
@@ -16367,15 +17138,16 @@ socialfacecook.com: did not receive HSTS header
socialgrowing.cl: did not receive HSTS header
socialhead.io: could not connect to host
socialhub.com: did not receive HSTS header
+socializam.com: did not receive HSTS header
socialprize.com: did not receive HSTS header
socialspirit.com.br: did not receive HSTS header
+socialstrata.com: did not receive HSTS header
socialworkout.com: could not connect to host
socialworkout.net: could not connect to host
socialworkout.org: could not connect to host
socialworkout.tv: could not connect to host
socketize.com: did not receive HSTS header
sockeye.cc: could not connect to host
-socoastal.com: could not connect to host
socomponents.co.uk: could not connect to host
sodacore.com: could not connect to host
sodamakerclub.com: did not receive HSTS header
@@ -16386,15 +17158,14 @@ softplaynation.co.uk: did not receive HSTS header
software.rocks: could not connect to host
sogeek.me: could not connect to host
sogravatas.net.br: could not connect to host
-sohamroy.me: could not connect to host
sojingle.net: could not connect to host
soju.fi: did not receive HSTS header
sokolka.tv: did not receive HSTS header
sol-3.de: did not receive HSTS header
+sol.works: did not receive HSTS header
solarcom.com.br: could not connect to host
solartrackerapp.com: could not connect to host
soldbygold.net: did not receive HSTS header
-soldecom.com: could not connect to host
solentes.com.br: could not connect to host
solidfuelappliancespares.co.uk: did not receive HSTS header
solidimage.com.br: could not connect to host
@@ -16424,8 +17195,9 @@ somosnoticia.com.br: did not receive HSTS header
sonafe.info: could not connect to host
sonerezh.bzh: did not receive HSTS header
songluck.com: could not connect to host
+songsmp3.net: could not connect to host
sonialive.com: did not receive HSTS header
-sonic.network: did not receive HSTS header
+sonic.network: could not connect to host
sonicrainboom.rocks: could not connect to host
sonix.dk: could not connect to host
sonja-daniels.com: could not connect to host
@@ -16436,13 +17208,13 @@ soobi.org: did not receive HSTS header
soodwatthanaphon.net: did not receive HSTS header
soondy.com: could not connect to host
soothemobilemassage.com.au: did not receive HSTS header
+sopher.io: did not receive HSTS header
soply.com: could not connect to host
soporte.cc: could not connect to host
sorenam.com: did not receive HSTS header
sorensen-online.com: could not connect to host
sorever.online: did not receive HSTS header
sorex.photo: did not receive HSTS header
-sorincocorada.ro: could not connect to host
sorinmuntean.ro: did not receive HSTS header
sortaweird.net: could not connect to host
sortingwizard.com: could not connect to host
@@ -16461,8 +17233,10 @@ soucorneteiro.com.br: could not connect to host
soulcraft.bz: could not connect to host
soulema.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
soulfulglamour.uk: could not connect to host
+soulsteer.com: did not receive HSTS header
soundedj.com.br: could not connect to host
soundforsound.co.uk: did not receive HSTS header
+soundgasm.net: could not connect to host
soundsecurity.io: could not connect to host
souqtajmeel.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
sourcecode.love: could not connect to host
@@ -16486,6 +17260,7 @@ soved.eu: could not connect to host
sovereignshare.com: could not connect to host
sown.dyndns.org: could not connect to host
sowncloud.de: could not connect to host
+soz6.com: did not receive HSTS header
sp.rw: could not connect to host
spacecafe.org: did not receive HSTS header
spacedust.xyz: could not connect to host
@@ -16503,10 +17278,9 @@ spanien.guide: could not connect to host
sparelib.com: max-age too low: 3650
spark.team: could not connect to host
sparkbase.cn: could not connect to host
-sparklatvia.lv: could not connect to host
sparklingsparklers.com: did not receive HSTS header
sparkresearch.net: could not connect to host
-sparkreviewcenter.com: did not receive HSTS header
+sparkreviewcenter.com: could not connect to host
sparkwood.org: could not connect to host
sparmedo.de: did not receive HSTS header
sparsa.army: could not connect to host
@@ -16521,7 +17295,7 @@ spdysync.com: could not connect to host
specialedesigns.com: could not connect to host
specialistnow.com.au: did not receive HSTS header
spectreattack.com: did not receive HSTS header
-spectroom.space: did not receive HSTS header
+spectroom.space: could not connect to host
spectrosoftware.de: could not connect to host
speculor.net: could not connect to host
spedition-transport-umzug.de: could not connect to host
@@ -16530,6 +17304,7 @@ speed-mailer.com: could not connect to host
speedcounter.net: could not connect to host
speeds.vip: could not connect to host
speedway.com.pl: did not receive HSTS header
+speedychat.it: could not connect to host
speedyprep.com: did not receive HSTS header
speidel.com.tr: did not receive HSTS header
spencerbaer.com: could not connect to host
@@ -16537,6 +17312,8 @@ spendwise.com.au: could not connect to host
sperohub.com: could not connect to host
sperohub.io: could not connect to host
sperohub.lt: did not receive HSTS header
+spha.info: could not connect to host
+sphereblur.com: could not connect to host
sphinx.network: could not connect to host
spicydog.tk: could not connect to host
spicywombat.com: could not connect to host
@@ -16549,7 +17326,7 @@ spilsbury.io: could not connect to host
spineandscoliosis.com: did not receive HSTS header
spinner.dnshome.de: could not connect to host
spinor.im: could not connect to host
-spiralschneiderkaufen.de: did not receive HSTS header
+spiralschneiderkaufen.de: could not connect to host
spirit-dev.net: max-age too low: 0
spiritbionic.ro: could not connect to host
spiritfanfics.com: did not receive HSTS header
@@ -16557,10 +17334,12 @@ spisoggrin.dk: could not connect to host
spitefultowel.com: did not receive HSTS header
spitfireuav.com: could not connect to host
spititout.it: could not connect to host
+splendidspoon.com: max-age too low: 0
split.is: could not connect to host
-splunk.zone: did not receive HSTS header
+splunk.zone: could not connect to host
spoketwist.com: did not receive HSTS header
spokonline.com: could not connect to host
+spolwind.de: could not connect to host
spon.cz: did not receive HSTS header
sponsorowani.pl: did not receive HSTS header
sponsortobias.com: could not connect to host
@@ -16596,9 +17375,8 @@ sprueche-zur-geburt.info: could not connect to host
sprueche-zur-hochzeit.de: did not receive HSTS header
sprueche-zur-konfirmation.de: did not receive HSTS header
sprutech.de: could not connect to host
-spuffin.com: could not connect to host
+sputnik1net.org: could not connect to host
spykedigital.com: could not connect to host
-spyroszarzonis.com: could not connect to host
sqetsa.com: did not receive HSTS header
sqkaccountancy.co.uk: did not receive HSTS header
sqshq.de: did not receive HSTS header
@@ -16608,6 +17386,7 @@ square.gs: could not connect to host
squarelab.it: could not connect to host
squareonebgc.com.ph: could not connect to host
squatldf.org: could not connect to host
+squeakql.online: could not connect to host
squids.space: could not connect to host
squirtlesbians.net: could not connect to host
sqzryang.com: could not connect to host
@@ -16621,7 +17400,6 @@ srmaximo.com: could not connect to host
srna.sk: did not receive HSTS header
srpdb.com: did not receive HSTS header
srrr.ca: could not connect to host
-srun.in: did not receive HSTS header
srvonfire.com: could not connect to host
ss-free.net: could not connect to host
ss-x.ru: could not connect to host
@@ -16630,18 +17408,18 @@ ssc8689.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERRO
ssc8689.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
ssco.xyz: did not receive HSTS header
ssconn.com: could not connect to host
+ssdservers.co.uk: could not connect to host
ssh.nu: did not receive HSTS header
sshool.at: could not connect to host
ssl.panoramio.com: could not connect to host
ssl.rip: could not connect to host
+sslcertificateshop.com: did not receive HSTS header
sslzilla.de: did not receive HSTS header
ssn1.ru: did not receive HSTS header
sspanda.com: could not connect to host
ssrvpn.tech: could not connect to host
sss3s.com: could not connect to host
-sstewartgallus.com: could not connect to host
-ssuitesoft.com: did not receive HSTS header
-ssworld.ga: did not receive HSTS header
+ssworld.ga: could not connect to host
staack.com: could not connect to host
stabletoken.com: could not connect to host
staceyhankeinc.com: did not receive HSTS header
@@ -16654,25 +17432,26 @@ staffjoy.com: did not receive HSTS header
staffjoystaging.com: could not connect to host
stagingjobshq.com: could not connect to host
stahl.xyz: did not receive HSTS header
+stahlfors.com: could not connect to host
+stair.ch: could not connect to host
stakestrategy.com: could not connect to host
-stalder.work: could not connect to host
stalkerhispano.com: max-age too low: 0
stalkthe.net: could not connect to host
stall-zur-linde.de: did not receive HSTS header
stalschermer.nl: could not connect to host
stamboommuller.nl: did not receive HSTS header
stamboomvanderwal.nl: did not receive HSTS header
+stamonicatourandtravel.com: could not connect to host
+stampederadon.com: could not connect to host
stanandjerre.org: could not connect to host
-standards.gov: could not connect to host
standardssuck.org: did not receive HSTS header
standingmist.com: did not receive HSTS header
-standoutbooks.com: max-age too low: 0
standuppaddlesports.com.au: did not receive HSTS header
stang.moe: did not receive HSTS header
stannahtrapliften.nl: did not receive HSTS header
star-citizen.wiki: did not receive HSTS header
star-killer.net: could not connect to host
-star-stuff.de: could not connect to host
+star-stuff.de: did not receive HSTS header
star.do: did not receive HSTS header
starandshield.com: did not receive HSTS header
starapple.nl: did not receive HSTS header
@@ -16687,7 +17466,7 @@ starklane.com: max-age too low: 300
starlightentertainmentdevon.co.uk: did not receive HSTS header
starmusic.ga: could not connect to host
starplatinum.jp: could not connect to host
-starquake.nl: could not connect to host
+starquake.nl: did not receive HSTS header
starsbattle.net: could not connect to host
starskim.cn: could not connect to host
starteesforsale.co.za: did not receive HSTS header
@@ -16708,11 +17487,10 @@ static-692b8c32.de: could not connect to host
static-assets.io: could not connect to host
static.hosting: could not connect to host
static.or.at: did not receive HSTS header
-staticanime.net: could not connect to host
staticisnoise.com: could not connect to host
stationaryjourney.com: did not receive HSTS header
stationcharlie.com: could not connect to host
-stationnementdenuit.ca: did not receive HSTS header
+stationnementdenuit.ca: could not connect to host
status-sprueche.de: could not connect to host
status.coffee: could not connect to host
statusbot.io: could not connect to host
@@ -16754,6 +17532,8 @@ stevengoodpaster.com: could not connect to host
stevenkwan.me: could not connect to host
stevensheffey.me: could not connect to host
stevensononthe.net: did not receive HSTS header
+stevenz.net: did not receive HSTS header
+stevenz.xyz: did not receive HSTS header
stewartremodelingadvantage.com: could not connect to host
stewonet.nl: did not receive HSTS header
stge.uk: could not connect to host
@@ -16773,8 +17553,10 @@ stillblackhat.id: could not connect to host
stillnessproject.com: did not receive HSTS header
stillyarts.com: did not receive HSTS header
stinkytrashhound.com: could not connect to host
+stinsky.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
stirlingpoon.net: could not connect to host
stirlingpoon.xyz: could not connect to host
+stisaac.org: did not receive HSTS header
stitthappens.com: could not connect to host
stjohnmiami.org: did not receive HSTS header
stjohnsc.com: could not connect to host
@@ -16790,9 +17572,10 @@ stockseyeserum.com: could not connect to host
stocktrade.de: could not connect to host
stoffe-monster.de: did not receive HSTS header
stoffelen.nl: did not receive HSTS header
+stogiesandmash.com: max-age too low: 0
stoianlawfirm.com: could not connect to host
stoick.me: could not connect to host
-stoinov.com: could not connect to host
+stoinov.com: did not receive HSTS header
stolbart.com: could not connect to host
stole-my.bike: could not connect to host
stole-my.tv: could not connect to host
@@ -16817,11 +17600,11 @@ storiesofhealth.org: could not connect to host
stormhub.org: could not connect to host
stormwatcher.org: could not connect to host
stormyyd.com: max-age too low: 0
-storytea.top: did not receive HSTS header
stpatricksguild.com: did not receive HSTS header
stqry.com: did not receive HSTS header
str0.at: did not receive HSTS header
straightedgebarbers.ca: did not receive HSTS header
+strangemusicinc.com: did not receive HSTS header
strangeplace.net: did not receive HSTS header
strangescout.me: could not connect to host
strasweb.fr: did not receive HSTS header
@@ -16851,7 +17634,6 @@ strehl.tk: could not connect to host
streklhof.at: did not receive HSTS header
strelitzia02.com: could not connect to host
stressfreehousehold.com: could not connect to host
-stretchpc.com: could not connect to host
strictlynormal.com: could not connect to host
strictlysudo.com: could not connect to host
strife.tk: did not receive HSTS header
@@ -16860,9 +17642,9 @@ striptizer.tk: could not connect to host
strming.com: could not connect to host
stroeercrm.de: could not connect to host
strongest-privacy.com: could not connect to host
+strongtowerpc.com: could not connect to host
struxureon.com: did not receive HSTS header
stuartbaxter.co: could not connect to host
-stuarts.xyz: could not connect to host
stubbings.eu: could not connect to host
stucorweb.com: could not connect to host
student-scientist.org: did not receive HSTS header
@@ -16876,14 +17658,14 @@ studiemeter.nl: did not receive HSTS header
studienservice.de: did not receive HSTS header
studiereader.nl: did not receive HSTS header
studinf.xyz: could not connect to host
+studio-art.pro: did not receive HSTS header
studio-panic.com: could not connect to host
studio-webdigi.com: did not receive HSTS header
studiocn.cn: could not connect to host
studiodoprazer.com.br: could not connect to host
+studiopop.com.br: did not receive HSTS header
studiozelden.com: did not receive HSTS header
-studisys.net: could not connect to host
-studlan.no: could not connect to host
-studport.rv.ua: max-age too low: 604800
+studport.rv.ua: could not connect to host
studyabroadstation.com: could not connect to host
studybay.com: could not connect to host
studydrive.net: did not receive HSTS header
@@ -16892,7 +17674,6 @@ studying-neet.com: could not connect to host
studytale.com: could not connect to host
stuermer.me: did not receive HSTS header
stuff-fibre.co.nz: did not receive HSTS header
-stuffiwouldbuy.com: did not receive HSTS header
stugb.de: did not receive HSTS header
stumeta2018.de: could not connect to host
stupidstatetricks.com: could not connect to host
@@ -16904,7 +17685,6 @@ stutsmancounty.gov: could not connect to host
stuttgart-gablenberg.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
stuudium.cloud: could not connect to host
stuudium.life: could not connect to host
-stylaq.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
stylenda.com: could not connect to host
stylle.me: could not connect to host
stytt.com: could not connect to host
@@ -16918,6 +17698,7 @@ subjektzentrisch.de: could not connect to host
sublevel.net: did not receive HSTS header
subrain.com: did not receive HSTS header
subrosa.io: could not connect to host
+subsistence.wiki: could not connect to host
subsys.no: did not receive HSTS header
subterfuge.io: did not receive HSTS header
subtitle.rip: could not connect to host
@@ -16928,9 +17709,10 @@ succubus.network: could not connect to host
succubus.xxx: could not connect to host
suchprogrammer.net: did not receive HSTS header
sudo.im: could not connect to host
+sudo.org.au: did not receive HSTS header
sudosu.fr: could not connect to host
suempresa.cloud: could not connect to host
-suffts.de: did not receive HSTS header
+suffts.de: could not connect to host
sugarcitycon.com: could not connect to host
sugarsweetorsour.com: did not receive HSTS header
sugartownfarm.com: could not connect to host
@@ -16943,16 +17725,18 @@ summer.ga: could not connect to host
summermc.cc: could not connect to host
summitbankofkc.com: did not receive HSTS header
summitmasters.net: did not receive HSTS header
-sumoatm.com: did not receive HSTS header
sumoscout.de: did not receive HSTS header
+sumthing.com: could not connect to host
sun-leo.co.jp: did not receive HSTS header
-sun-wellness-online.com.vn: did not receive HSTS header
sun.re: did not receive HSTS header
+sunboxstore.jp: did not receive HSTS header
suncountrymarine.com: did not receive HSTS header
sundaycooks.com: max-age too low: 2592000
suneilpatel.com: could not connect to host
sunfeathers.net: could not connect to host
sunfireshop.com.br: could not connect to host
+sunfulong.blog: could not connect to host
+sunfulong.me: could not connect to host
sunlandsg.vn: did not receive HSTS header
sunnyfruit.ru: could not connect to host
sunriseafricarelief.com: did not receive HSTS header
@@ -16964,6 +17748,7 @@ sunyataherb.com: could not connect to host
suos.io: could not connect to host
supcro.com: could not connect to host
super-demarche.com: did not receive HSTS header
+super-erotica.ru: could not connect to host
super-garciniaslim.com: could not connect to host
super-o-blog.com: could not connect to host
super-radiant-skin.com: could not connect to host
@@ -16977,7 +17762,6 @@ supercastlessouthsydney.com.au: could not connect to host
supercreepsvideo.com: did not receive HSTS header
superiorfloridavacation.com: could not connect to host
superklima.ro: did not receive HSTS header
-superlandnetwork.de: did not receive HSTS header
superlentes.com.br: could not connect to host
supermil.ch: could not connect to host
supernovabrasil.com.br: did not receive HSTS header
@@ -16993,14 +17777,13 @@ superwally.org: could not connect to host
superway.es: did not receive HSTS header
supes.io: did not receive HSTS header
supperclub.es: could not connect to host
+supplementswatch.com: did not receive HSTS header
support4server.de: could not connect to host
supportfan.gov: could not connect to host
supportme123.com: did not receive HSTS header
+suppwatch.com: did not receive HSTS header
suprlink.net: could not connect to host
-supweb.ovh: did not receive HSTS header
-surasak.io: could not connect to host
-surasak.net: could not connect to host
-surasak.org: could not connect to host
+supweb.ovh: could not connect to host
surasak.xyz: could not connect to host
suraya.online: could not connect to host
surfeasy.com: did not receive HSTS header
@@ -17008,8 +17791,8 @@ surfone-leucate.com: did not receive HSTS header
surgiclinic.gr: did not receive HSTS header
surkatty.org: did not receive HSTS header
suruifu.tk: could not connect to host
+surveillance104.com: could not connect to host
survivalistplanet.com: could not connect to host
-survivebox.fr: did not receive HSTS header
susanvelez.com: did not receive HSTS header
susastudentenjobs.de: could not connect to host
susconam.org: could not connect to host
@@ -17021,17 +17804,15 @@ suspiciousdarknet.xyz: could not connect to host
sussexwebdesigns.com: could not connect to host
sussexwebsites.info: could not connect to host
sustainability.gov: did not receive HSTS header
-suts.co.uk: could not connect to host
suttonbouncycastles.co.uk: could not connect to host
suvidhaapay.com: could not connect to host
-suzukikazuki.com: did not receive HSTS header
+suzukikazuki.com: could not connect to host
suzukikenichi.com: did not receive HSTS header
svadobkajuvi.sk: did not receive HSTS header
svarovani.tk: could not connect to host
svatba-frantovi.cz: could not connect to host
sve-hosting.nl: could not connect to host
svenbacia.me: could not connect to host
-svendubbeld.nl: did not receive HSTS header
svenskacasino.com: could not connect to host
svenskaservern.se: could not connect to host
svetdrzaku.cz: did not receive HSTS header
@@ -17040,16 +17821,17 @@ svetzitrka.cz: did not receive HSTS header
sviz.pro: could not connect to host
svj-stochovska.cz: could not connect to host
svjvn.cz: could not connect to host
-svsb-live.azurewebsites.net: max-age too low: 0
swacp.com: could not connect to host
swaggerdile.com: could not connect to host
swaleacademiestrust.org.uk: max-age too low: 2592000
swallsoft.co.uk: could not connect to host
swallsoft.com: could not connect to host
swanseapartyhire.co.uk: could not connect to host
+swarfarm.com: did not receive HSTS header
swarmation.com: did not receive HSTS header
sway.com: did not receive HSTS header
swdatlantico.pt: could not connect to host
+sweak.net: could not connect to host
sweep.cards: did not receive HSTS header
sweetlegs.jp: could not connect to host
sweetstreats.ca: could not connect to host
@@ -17066,26 +17848,28 @@ swimmingpoolaccidentattorney.net: could not connect to host
swingular.com: could not connect to host
swisscannabis.club: could not connect to host
swissentreprises.ch: could not connect to host
-swissfreshaircan.com: could not connect to host
swisstechtalks.ch: did not receive HSTS header
swisstranslate.ch: did not receive HSTS header
swisstranslate.fr: did not receive HSTS header
swisswebhelp.ch: could not connect to host
swissxperts.ch: could not connect to host
swite.com: did not receive HSTS header
+switzerland-family-office.com: did not receive HSTS header
swmd5c.org: could not connect to host
swordfighting.net: could not connect to host
swu.party: could not connect to host
+swuosa.org: did not receive HSTS header
sx3.no: could not connect to host
sxbk.pw: could not connect to host
syam.cc: could not connect to host
+syamutodon.xyz: could not connect to host
syamuwatching.xyz: could not connect to host
sydgrabber.tk: could not connect to host
syhost.at: did not receive HSTS header
syhost.ch: did not receive HSTS header
syhost.de: did not receive HSTS header
sykl.us: could not connect to host
-sylvan.me: could not connect to host
+sylvaincombe.net: could not connect to host
sylvangarden.net: could not connect to host
sylvangarden.org: could not connect to host
sylvanorder.com: did not receive HSTS header
@@ -17095,6 +17879,8 @@ syncaddict.net: could not connect to host
syncappate.com: could not connect to host
syncclinicalstudy.com: could not connect to host
syncer.jp: did not receive HSTS header
+synchrocube.com: could not connect to host
+synchronicity.cz: could not connect to host
syncmylife.net: could not connect to host
syncserve.net: did not receive HSTS header
syneic.com: did not receive HSTS header
@@ -17126,10 +17912,13 @@ szagun.net: did not receive HSTS header
szaszm.tk: could not connect to host
szczot3k.pl: did not receive HSTS header
szerbnyelvkonyv.hu: could not connect to host
+szerelem.love: could not connect to host
+szetowah.org.hk: could not connect to host
szlovaknyelv.hu: could not connect to host
szlovennyelv.hu: could not connect to host
szongott.net: did not receive HSTS header
-szymczak.at: did not receive HSTS header
+szymczak.at: could not connect to host
+szzsivf.com: did not receive HSTS header
t-complex.space: could not connect to host
t-ken.xyz: could not connect to host
t-point.eu: did not receive HSTS header
@@ -17139,8 +17928,8 @@ t2000headphones.com: could not connect to host
t2000laserpointers.com: could not connect to host
t4c-rebirth.com: could not connect to host
t4x.org: could not connect to host
+t5118.com: could not connect to host
taabe.xyz: could not connect to host
-taartenfeesies.nl: did not receive HSTS header
tab.watch: did not receive HSTS header
taberu-fujitsubo.com: did not receive HSTS header
tabhui.com: did not receive HSTS header
@@ -17156,7 +17945,7 @@ tadigitalstore.com: could not connect to host
tafoma.com: did not receive HSTS header
tageau.com: could not connect to host
tagesmutter-in-bilm.de: did not receive HSTS header
-tagesmutter-zwitscherlinge.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+tagesmutter-zwitscherlinge.de: did not receive HSTS header
tahakomat.cz: could not connect to host
tahf.net: could not connect to host
tai-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -17179,9 +17968,11 @@ tales-of-interia.de: could not connect to host
talheim-records.ca: could not connect to host
talk.google.com: did not receive HSTS header (error ignored - included regardless)
talk.xyz: could not connect to host
+talkgadget.google.com: did not receive HSTS header (error ignored - included regardless)
talkitup.mx: could not connect to host
talkitup.online: could not connect to host
talklifestyle.nl: could not connect to host
+talktobot.com: could not connect to host
talktwincities.com: could not connect to host
tallr.se: could not connect to host
tallshoe.com: could not connect to host
@@ -17203,22 +17994,24 @@ tangzhao.net: could not connect to host
taniesianie.pl: did not receive HSTS header
tankfreunde.de: did not receive HSTS header
tante-bugil.net: could not connect to host
-tantetilli.de: did not receive HSTS header
tantotiempo.de: did not receive HSTS header
tanze-jetzt.de: could not connect to host
-taotuba.net: could not connect to host
+taotuba.net: did not receive HSTS header
taozj.org: did not receive HSTS header
tapakgram.com: did not receive HSTS header
tapestries.tk: could not connect to host
tapfinder.ca: could not connect to host
tapka.cz: did not receive HSTS header
tappublisher.com: did not receive HSTS header
+tapsnapp.co: did not receive HSTS header
taqun.club: could not connect to host
tarantul.org.ua: could not connect to host
taravancil.com: did not receive HSTS header
tarek.link: could not connect to host
targaryen.house: could not connect to host
tarhauskielto.fi: did not receive HSTS header
+taron.top: did not receive HSTS header
+tarot-cartas.com: max-age too low: 0
tarots-et-oracles.com: did not receive HSTS header
tarsashaz-biztositas.hu: did not receive HSTS header
tartaros.fi: could not connect to host
@@ -17226,7 +18019,7 @@ taskstats.com: did not receive HSTS header
tasmansecurity.com: could not connect to host
tassup.com: could not connect to host
tasta.ro: could not connect to host
-tasticfilm.com: could not connect to host
+tasticfilm.com: did not receive HSTS header
tastyyy.co: could not connect to host
tasyacherry-anal.com: could not connect to host
tatilbus.com: could not connect to host
@@ -17244,18 +18037,19 @@ taxiindenbosch.nl: did not receive HSTS header
taxmadras.com: could not connect to host
taxsnaps.co.nz: did not receive HSTS header
taxspeaker.com: did not receive HSTS header
+taylorreaume.com: did not receive HSTS header
tazemama.biz: could not connect to host
tazj.in: did not receive HSTS header
tazz.in: could not connect to host
tbarter.com: did not receive HSTS header
tbpixel.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
tbrss.com: did not receive HSTS header
-tbtech.cz: did not receive HSTS header
tbys.us: could not connect to host
tc-bonito.de: did not receive HSTS header
tcacademy.co.uk: could not connect to host
tcao.info: could not connect to host
tcby45.xyz: could not connect to host
+tcdww.cn: could not connect to host
tchaka.top: could not connect to host
tcl.ath.cx: did not receive HSTS header
tcp.expert: did not receive HSTS header
@@ -17273,6 +18067,8 @@ tdsbhack.ga: could not connect to host
tdsbhack.gq: could not connect to host
tdsbhack.ml: could not connect to host
tdsbhack.tk: could not connect to host
+tea.codes: did not receive HSTS header
+teabagdesign.co.uk: could not connect to host
teacherph.net: did not receive HSTS header
teachforcanada.ca: did not receive HSTS header
tealdrones.com: did not receive HSTS header
@@ -17290,10 +18086,10 @@ teampoint.cz: could not connect to host
teams.microsoft.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
teamsocial.co: did not receive HSTS header
teamtravel.co: did not receive HSTS header
-teamx-gaming.de: could not connect to host
teamzeus.cz: could not connect to host
teaparty.id: could not connect to host
tearoy.faith: could not connect to host
+teasenetwork.com: could not connect to host
tebieer.com: could not connect to host
tech-blog.fr: did not receive HSTS header
tech-finder.fr: could not connect to host
@@ -17327,6 +18123,7 @@ technosuport.com: did not receive HSTS header
technoswag.ca: could not connect to host
technotonic.co.uk: could not connect to host
technotonic.com.au: did not receive HSTS header
+techold.ru: could not connect to host
techpointed.com: could not connect to host
techpro.net.br: could not connect to host
techproud.com: did not receive HSTS header
@@ -17337,14 +18134,19 @@ techtraveller.com.au: did not receive HSTS header
techtuts.info: could not connect to host
techunit.org: could not connect to host
techvalue.gr: did not receive HSTS header
+techwithcromulent.com: could not connect to host
tecit.ch: could not connect to host
tecnimotos.com: did not receive HSTS header
tecnologino.com: could not connect to host
-tecture.de: could not connect to host
+tecture.de: did not receive HSTS header
tedovo.com: did not receive HSTS header
tedxkmitl.com: could not connect to host
+tedxodense.com: did not receive HSTS header
tee-idf.net: could not connect to host
+teebeedee.org: did not receive HSTS header
+teedb.de: could not connect to host
teehaus-shila.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+teenerotic.net: could not connect to host
teeplelaw.com: did not receive HSTS header
teesypeesy.com: max-age too low: 2592000
tefl.io: did not receive HSTS header
@@ -17372,16 +18174,17 @@ telecharger-winrar.com: could not connect to host
telefisk.org: did not receive HSTS header
telefonnummer.online: could not connect to host
telefonogratuito.com: did not receive HSTS header
-telefonsinyalguclendirici.com: max-age too low: 0
telefoonnummerinfo.nl: could not connect to host
telekollektiv.org: could not connect to host
telepons.com: could not connect to host
telescam.com: could not connect to host
-teleshop.be: did not receive HSTS header
+teleshop.be: could not connect to host
+telesto.online: could not connect to host
teletra.ru: could not connect to host
telfordwhitehouse.co.uk: did not receive HSTS header
teltonica.com: did not receive HSTS header
telugu4u.net: could not connect to host
+temasa.net: could not connect to host
temehu.com: did not receive HSTS header
tempcraft.net: could not connect to host
tempflix.com: could not connect to host
@@ -17397,6 +18200,7 @@ tenispopular.com: could not connect to host
tenma.pro: could not connect to host
tenni.xyz: could not connect to host
tennisadmin.com: could not connect to host
+tennisapp.org: did not receive HSTS header
tennispensacola.com: could not connect to host
tensei-slime.com: did not receive HSTS header
tensionup.com: could not connect to host
@@ -17406,10 +18210,13 @@ tentins.com: could not connect to host
teodio.cl: did not receive HSTS header
teos.online: could not connect to host
teoskanta.fi: could not connect to host
+tepid.org: could not connect to host
+terabyteharddrive.net: could not connect to host
teranga.ch: did not receive HSTS header
tercerapuertoaysen.cl: could not connect to host
termax.me: did not receive HSTS header
-terminalvelocity.co.nz: could not connect to host
+terpotiz.net: could not connect to host
+terra-x.net: could not connect to host
terra.by: did not receive HSTS header
terrace.co.jp: did not receive HSTS header
terrafinanz.de: did not receive HSTS header
@@ -17434,6 +18241,7 @@ testnode.xyz: could not connect to host
testosterone-complex.com: could not connect to host
testosteronedetective.com: could not connect to host
testovaci.ml: could not connect to host
+testpornsite.com: could not connect to host
tetrafinancial-commercial-business-equipment-financing.com: could not connect to host
tetrafinancial-energy-mining-equipment-financing.com: could not connect to host
tetrafinancial-healthcare-medical-equipment-financing.com: could not connect to host
@@ -17474,10 +18282,8 @@ thatpodcast.io: did not receive HSTS header
thatvizsla.life: could not connect to host
the-construct.com: could not connect to host
the-delta.net.eu.org: could not connect to host
-the-digitale.com: did not receive HSTS header
the-earth-yui.net: could not connect to host
the-finance-blog.com: could not connect to host
-the-gdn.net: could not connect to host
the-gist.io: could not connect to host
the-paddies.de: did not receive HSTS header
the-sky-of-valkyries.com: could not connect to host
@@ -17491,16 +18297,17 @@ theater.cf: could not connect to host
theavenuegallery.com: did not receive HSTS header
thebakingclass.com: max-age too low: 60
thebarneystyle.com: did not receive HSTS header
-thebarrens.nu: could not connect to host
thebasementguys.com: could not connect to host
thebeautifulmusic.net: did not receive HSTS header
thebeginningisnye.com: could not connect to host
theberkshirescompany.com: could not connect to host
+thebest.ch: could not connect to host
thebigfail.net: could not connect to host
thebreakhotel.com: did not receive HSTS header
thebrotherswarde.com: could not connect to host
thebte.com: could not connect to host
thebuffalotavern.com: could not connect to host
+thecandidforum.com: could not connect to host
thecapitalbank.com: did not receive HSTS header
thecharlestonwaldorf.com: did not receive HSTS header
theciderlink.com.au: could not connect to host
@@ -17513,15 +18320,18 @@ theclubjersey.com: did not receive HSTS header
thecodeninja.net: did not receive HSTS header
thecoffeehouse.xyz: could not connect to host
thecoffeepod.co.uk: did not receive HSTS header
+thecoffeesuperstore.com: max-age too low: 7889238
thecozycastle.com: did not receive HSTS header
thecrochetcottage.net: could not connect to host
-thecskr.in: did not receive HSTS header
thecsw.com: did not receive HSTS header
thecuriouscat.net: could not connect to host
+thedailyprosper.com: did not receive HSTS header
thedailyupvote.com: could not connect to host
thedarkartsandcrafts.com: could not connect to host
+thedebug.life: could not connect to host
thedevilwearswibra.nl: did not receive HSTS header
thediaryofadam.com: did not receive HSTS header
+thedoctorsorders.pub: did not receive HSTS header
thedominatorsclan.com: could not connect to host
thedrinks.co: did not receive HSTS header
thedrop.pw: did not receive HSTS header
@@ -17535,9 +18345,9 @@ theevergreen.me: could not connect to host
theexpatriate.de: could not connect to host
theeyeopener.com: did not receive HSTS header
thefarbeyond.com: could not connect to host
-thefasterweb.com: did not receive HSTS header
thefilmcolor.com: max-age too low: 0
thefootballanalyst.com: did not receive HSTS header
+thefourthmoira.com: did not receive HSTS header
thefox.co: did not receive HSTS header
thefox.com.fr: could not connect to host
thefreebirds.in: could not connect to host
@@ -17556,13 +18366,15 @@ thegym.org: did not receive HSTS header
thehiddenbay.cc: could not connect to host
thehiddenbay.eu: could not connect to host
thehiddenbay.fi: did not receive HSTS header
-thehiddenbay.info: did not receive HSTS header
+thehiddenbay.info: could not connect to host
thehiddenbay.me: could not connect to host
thehiddenbay.net: could not connect to host
-thehiddenbay.ws: did not receive HSTS header
+thehiddenbay.ws: could not connect to host
thehighersideclothing.com: did not receive HSTS header
thehistory.me: could not connect to host
thehoopsarchive.com: could not connect to host
+thehoryzon.com: did not receive HSTS header
+thehowtohome.com: did not receive HSTS header
theimagesalon.com: max-age too low: 43200
theinvisibletrailer.com: could not connect to host
thej0lt.com: did not receive HSTS header
@@ -17570,13 +18382,15 @@ thejobauction.com: did not receive HSTS header
thejserver.de: could not connect to host
thekrewserver.com: did not receive HSTS header
thelapine.ca: did not receive HSTS header
+thelastsurprise.com: could not connect to host
thelefthand.org: could not connect to host
thelinuxspace.com: could not connect to host
thelostyankee.com: could not connect to host
+themadlabengineer.co.uk: did not receive HSTS header
themadmechanic.net: could not connect to host
themanufacturingmarketingagency.com: could not connect to host
themarble.co: could not connect to host
-themaster.site: did not receive HSTS header
+themaster.site: could not connect to host
themathbehindthe.science: could not connect to host
themathematician.uk: could not connect to host
themeaudit.com: could not connect to host
@@ -17588,13 +18402,13 @@ themoderate.xyz: could not connect to host
thenanfang.com: could not connect to host
thenarcissisticlife.com: did not receive HSTS header
thenextstep.events: could not connect to host
-thenib.com: could not connect to host
thenichecast.com: could not connect to host
thenorthschool.org.uk: did not receive HSTS header
thenrdhrd.nl: could not connect to host
theodorejones.info: could not connect to host
theojones.name: could not connect to host
theokonst.tk: did not receive HSTS header
+theoldbrewhouse.info: could not connect to host
theosblog.de: did not receive HSTS header
theosophie-afrique.org: could not connect to host
theoverfly.co: could not connect to host
@@ -17604,6 +18418,7 @@ thepiabo.ovh: could not connect to host
thepiratebay.al: could not connect to host
thepiratebay.poker: could not connect to host
thepiratebay.tech: could not connect to host
+theplaidpoodle.com: did not receive HSTS header
theplaydaysbus.co.uk: could not connect to host
theposhfudgecompany.co.uk: could not connect to host
thepostoffice.ro: did not receive HSTS header
@@ -17615,19 +18430,22 @@ thequillmagazine.org: could not connect to host
therewill.be: could not connect to host
therise.ca: max-age too low: 300
thermique.ch: could not connect to host
+thermo-recetas.com: did not receive HSTS header
theroamingnotary.com: did not receive HSTS header
therockawaysny.com: did not receive HSTS header
thesassynut.com: did not receive HSTS header
+thesearchenginepros.com: did not receive HSTS header
thesearchnerds.co.uk: did not receive HSTS header
thesecurityteam.net: could not connect to host
thesehighsandlows.com: could not connect to host
theserver201.tk: could not connect to host
theshadestore.com: max-age too low: 10368000
+thesharepointfarm.com: did not receive HSTS header
thesled.net: could not connect to host
thesplit.is: could not connect to host
thestack.xyz: could not connect to host
thestagchorleywood.co.uk: did not receive HSTS header
-thestonegroup.de: did not receive HSTS header
+thestonegroup.de: could not connect to host
thestoritplace.com: max-age too low: 0
thestral.pro: could not connect to host
thestralbot.com: could not connect to host
@@ -17640,6 +18458,7 @@ theurbanyoga.com: did not receive HSTS header
theuucc.org: did not receive HSTS header
thevintagenews.com: did not receive HSTS header
thevoid.one: could not connect to host
+thevyra.com: did not receive HSTS header
thewallset.com: could not connect to host
thewaxhouse.shop: did not receive HSTS header
thewebdexter.com: could not connect to host
@@ -17648,6 +18467,7 @@ thewego.com: could not connect to host
theweilai.com: could not connect to host
thewhiterabbit.space: could not connect to host
thewindow.com: could not connect to host
+thewoolroom.com.au: did not receive HSTS header
theworkingeye.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
thewp.pro: max-age too low: 0
theyachtteam.com: could not connect to host
@@ -17673,9 +18493,11 @@ thirtyspot.com: could not connect to host
thisisacompletetest.ga: could not connect to host
thisisforager.com: could not connect to host
thismumdoesntknowbest.com: could not connect to host
+thisoldearth.com: did not receive HSTS header
thiswasalreadymyusername.tk: could not connect to host
thiswebhost.com: did not receive HSTS header
thkb.net: could not connect to host
+thomas-bertran.com: could not connect to host
thomas-ferney.fr: did not receive HSTS header
thomas-gibertie.fr: did not receive HSTS header
thomas-grobelny.de: could not connect to host
@@ -17683,11 +18505,12 @@ thomascloud.ddns.net: could not connect to host
thomasgriffin.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
thomasharvey.me: did not receive HSTS header
thomaskliszowski.fr: did not receive HSTS header
+thomasmeester.nl: could not connect to host
thomasnet.fr: could not connect to host
thomasscholz.com: max-age too low: 2592000
thomasschweizer.net: could not connect to host
thomasvt.xyz: max-age too low: 2592000
-thompsonfamily.cloud: could not connect to host
+thomspooren.nl: could not connect to host
thorbis.com: could not connect to host
thorbiswebsitedesign.com: could not connect to host
thorgames.nl: did not receive HSTS header
@@ -17701,21 +18524,21 @@ threebulls.be: did not receive HSTS header
thriveapproach.co.uk: did not receive HSTS header
thrivewellnesshub.co.za: did not receive HSTS header
throughthelookingglasslens.co.uk: could not connect to host
-thrx.net: did not receive HSTS header
thumbtack.com: did not receive HSTS header
thundercampaign.com: could not connect to host
-thundr.eu: could not connect to host
thuviensoft.net: could not connect to host
-thynx.io: could not connect to host
thyrex.fr: could not connect to host
+thzone.net: did not receive HSTS header
ti-js.com: could not connect to host
ti.blog.br: did not receive HSTS header
tiacollection.com: did not receive HSTS header
+tianshili.me: could not connect to host
tianxicaipiao.com: could not connect to host
tianxicaipiao.win: could not connect to host
tianxicp.com: could not connect to host
tianxing.pro: did not receive HSTS header
tianxingvpn.pro: could not connect to host
+tib1.com: could not connect to host
tibbitshall.ca: could not connect to host
tibovanheule.site: could not connect to host
ticfleet.com: could not connect to host
@@ -17728,10 +18551,10 @@ ticktock.today: could not connect to host
tictactux.de: could not connect to host
tidmore.us: could not connect to host
tie-online.org: could not connect to host
+tiendafetichista.com: could not connect to host
tiendavertigo.com: did not receive HSTS header
tiendschuurstraat.nl: could not connect to host
tiensnet.com: could not connect to host
-tierarztpraxis-illerwinkel.de: did not receive HSTS header
tiernanx.com: could not connect to host
tierrarp.com: could not connect to host
tiggi.pw: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -17770,7 +18593,7 @@ timmy.ws: could not connect to host
timotrans.de: could not connect to host
timotrans.eu: could not connect to host
timowi.net: could not connect to host
-timroes.de: could not connect to host
+timroes.de: did not receive HSTS header
timschubert.net: max-age too low: 172800
timvandekamp.nl: did not receive HSTS header
timwhite.io: did not receive HSTS header
@@ -17778,13 +18601,14 @@ timwittenberg.com: could not connect to host
tinchbear.xyz: could not connect to host
tindewen.net: could not connect to host
tink.network: could not connect to host
+tinker.career: could not connect to host
tinkerboard.org: could not connect to host
tinkerers-trunk.co.za: did not receive HSTS header
-tinkererstrunk.co.za: did not receive HSTS header
+tinkererstrunk.co.za: could not connect to host
tipiakers.club: could not connect to host
tipps-fuer-den-haushalt.de: could not connect to host
tippspiel.cc: could not connect to host
-tipsacademicos.com: could not connect to host
+tipsport.cz: could not connect to host
tipsyk.ru: could not connect to host
tiredofeating.com: could not connect to host
tiremoni.ch: did not receive HSTS header
@@ -17802,20 +18626,19 @@ tjc.wiki: could not connect to host
tjeckien.guide: could not connect to host
tjs.me: could not connect to host
tju.me: could not connect to host
-tkappertjedemetamorfose.nl: could not connect to host
+tkappertjedemetamorfose.nl: did not receive HSTS header
tkarstens.de: did not receive HSTS header
tkeycoin.com: did not receive HSTS header
tkhw.tk: could not connect to host
tkonstantopoulos.tk: could not connect to host
tkts.cl: could not connect to host
-tlach.cz: did not receive HSTS header
tlcdn.net: could not connect to host
tlo.hosting: could not connect to host
tlo.link: could not connect to host
tlo.network: could not connect to host
tls.builders: could not connect to host
tls.li: could not connect to host
-tls1914.org: did not receive HSTS header
+tls1914.org: could not connect to host
tlsbv.nl: did not receive HSTS header
tlshost.net: could not connect to host
tm-solutions.eu: could not connect to host
@@ -17839,6 +18662,7 @@ tobaby.com.br: could not connect to host
tobacco.gov: could not connect to host
tobaccore.eu: could not connect to host
tobaccore.sk: could not connect to host
+tobi-videos.goip.de: could not connect to host
tobias-bielefeld.de: did not receive HSTS header
tobiasbergius.se: could not connect to host
tobiasmathes.com: could not connect to host
@@ -17847,7 +18671,6 @@ tobiasofficial.at: could not connect to host
tobiassachs.cf: could not connect to host
tobiassachs.tk: could not connect to host
tobis-webservice.de: did not receive HSTS header
-tobyx.is: could not connect to host
toddmissiontx.gov: did not receive HSTS header
todesschaf.org: could not connect to host
todo.is: could not connect to host
@@ -17867,7 +18690,6 @@ tokage.me: could not connect to host
tokbijouxs.com.br: did not receive HSTS header
tokenloan.com: could not connect to host
tokintu.com: could not connect to host
-tokky.eu: could not connect to host
tokobungaasryflorist.com: did not receive HSTS header
tokobungadijambi.com: did not receive HSTS header
tokobungadilampung.com: could not connect to host
@@ -17877,7 +18699,7 @@ tokoone.com: did not receive HSTS header
tokotamz.net: could not connect to host
tokotimbangandigitalmurah.web.id: did not receive HSTS header
tokoyo.biz: could not connect to host
-toldositajuba.com: could not connect to host
+tokumei.co: could not connect to host
tollfreeproxy.com: could not connect to host
tollmanz.com: did not receive HSTS header
tollsjekk.no: could not connect to host
@@ -17886,15 +18708,12 @@ tom-maxwell.com: did not receive HSTS header
tom.run: did not receive HSTS header
tomandshirley.com: could not connect to host
tomaspialek.cz: did not receive HSTS header
-tomaz.eu: could not connect to host
-tomberek.info: did not receive HSTS header
tomcort.com: did not receive HSTS header
tomdudfield.com: did not receive HSTS header
tomeara.net: could not connect to host
tomevans.io: did not receive HSTS header
tomharling.co.uk: could not connect to host
tomiler.com: could not connect to host
-tomjonsson.se: max-age too low: 0
tomkwok.com: could not connect to host
tomlankhorst.nl: did not receive HSTS header
tomli.me: could not connect to host
@@ -17903,9 +18722,8 @@ tommsy.com: did not receive HSTS header
tommyads.com: could not connect to host
tommyweber.de: could not connect to host
tomoyaf.com: could not connect to host
-tomphill.co.uk: could not connect to host
+tomphill.co.uk: did not receive HSTS header
tomudding.com: did not receive HSTS header
-tomwiggers.nl: could not connect to host
tomy.icu: could not connect to host
tonburi.jp: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
tone.tw: could not connect to host
@@ -17934,8 +18752,10 @@ topnotchendings.com: could not connect to host
topnovini.com: did not receive HSTS header
toppik.com.br: could not connect to host
toppointrea.com: could not connect to host
+topsailtechnologies.com: could not connect to host
topservercccam.com: did not receive HSTS header
topshelfguild.com: could not connect to host
+topshoptools.com: could not connect to host
toptenthebest.com: did not receive HSTS header
toptranslation.com: did not receive HSTS header
topvertimai.lt: could not connect to host
@@ -17944,24 +18764,28 @@ topyx.com: did not receive HSTS header
tor2web.org: could not connect to host
torahanytime.com: did not receive HSTS header
torbay.ga: could not connect to host
+torbe.es: could not connect to host
torchl.it: could not connect to host
toretfaction.net: could not connect to host
+torfbahn.de: did not receive HSTS header
torlock.download: could not connect to host
torproject.org.uk: could not connect to host
torproject.ovh: could not connect to host
torrentdownloads.bid: could not connect to host
+torrentfunk.com: could not connect to host
torrentgamesps2.info: could not connect to host
torrenttop100.net: could not connect to host
torrentz.website: did not receive HSTS header
+torrentz2.al: could not connect to host
torrentz2.eu: did not receive HSTS header
tortocan.com: could not connect to host
tortugalife.de: could not connect to host
torv.rocks: did not receive HSTS header
tosainu.com.br: could not connect to host
-toscer.me: could not connect to host
tosecure.link: could not connect to host
toshnix.com: could not connect to host
toshub.com: could not connect to host
+toskana-appartement.de: did not receive HSTS header
totalbeauty.co.uk: could not connect to host
totaldragonshop.com.br: could not connect to host
totalle.com.br: could not connect to host
@@ -17973,7 +18797,7 @@ totch.de: could not connect to host
totem-eshop.cz: could not connect to host
totoro.pub: could not connect to host
totot.net: could not connect to host
-toucedo.de: could not connect to host
+toucedo.de: did not receive HSTS header
touch-up-net.com: could not connect to host
touchbasemail.com: did not receive HSTS header
touchinformatica.com: did not receive HSTS header
@@ -17986,18 +18810,17 @@ touray-enterprise.ch: could not connect to host
tourispo.com: could not connect to host
tourpeer.com: did not receive HSTS header
toursandtransfers.it: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-tousproducteurs.fr: did not receive HSTS header
-tout-art.ch: could not connect to host
-toutart.ch: could not connect to host
+tousproducteurs.fr: could not connect to host
towaway.ru: could not connect to host
-townofruthnc.gov: could not connect to host
+townhousedevelopments.com.au: did not receive HSTS header
+townofruthnc.gov: did not receive HSTS header
tox.im: did not receive HSTS header
toxicboot.com: could not connect to host
toxicip.com: could not connect to host
toxme.se: could not connect to host
toymania.de: could not connect to host
toyotamotala.se: could not connect to host
-toysale.by: could not connect to host
+tpansino.com: could not connect to host
tpbcdn.com: could not connect to host
tpblist.xyz: could not connect to host
tpbunblocked.org: could not connect to host
@@ -18007,11 +18830,13 @@ tppdebate.org: did not receive HSTS header
trabajarenperu.com: did not receive HSTS header
tracalada.cl: did not receive HSTS header
tracelight.io: did not receive HSTS header
+traces.ml: could not connect to host
tracetracker.com: did not receive HSTS header
tracewind.top: could not connect to host
trackdays4fun.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
tracker-gps.ch: could not connect to host
trackfeed.tokyo: could not connect to host
+trackingstream.com: could not connect to host
trackmeet.io: did not receive HSTS header
tracksa.com.ar: could not connect to host
tracktivity.com.au: did not receive HSTS header
@@ -18024,9 +18849,9 @@ tradingbhavishya.com: did not receive HSTS header
tradingcentre.com.au: did not receive HSTS header
tradinghope.com: could not connect to host
tradingrooms.com: did not receive HSTS header
-traditional-knowledge.tk: did not receive HSTS header
+traditional-knowledge.tk: could not connect to host
traeningsprojekt.dk: did not receive HSTS header
-trafficmgr.cn: did not receive HSTS header
+traffic.az: did not receive HSTS header
trafficquality.org: could not connect to host
traffictigers.com: did not receive HSTS header
traforet.win: could not connect to host
@@ -18042,7 +18867,10 @@ trainline.io: could not connect to host
trainline.se: could not connect to host
trainut.com: could not connect to host
trakfusion.com: could not connect to host
+trance-heal.me: could not connect to host
+tranceheal.me: could not connect to host
trancendances.fr: could not connect to host
+trangcongnghe.com: max-age too low: 5184000
tranos.de: did not receive HSTS header
transbike.es: did not receive HSTS header
transcendmotor.sg: could not connect to host
@@ -18058,7 +18886,7 @@ translate.googleapis.com: did not receive HSTS header (error ignored - included
translateblender.ru: could not connect to host
translatoruk.co.uk: did not receive HSTS header
transmithe.net: could not connect to host
-transparentcorp.com: did not receive HSTS header
+transport.eu: max-age too low: 0
transportal.sk: did not receive HSTS header
transsexualpantyhose.com: could not connect to host
tratamentoparacelulite.biz: could not connect to host
@@ -18075,17 +18903,19 @@ travelling.expert: could not connect to host
travellsell.com: did not receive HSTS header
travelmyth.ie: did not receive HSTS header
travelpricecheck.com: max-age too low: 0
-travisfranck.com: could not connect to host
travotion.com: could not connect to host
trazosdearte.com: did not receive HSTS header
treasuredinheritanceministry.com: did not receive HSTS header
treatment.org: could not connect to host
treatprostatewithhifu.com: could not connect to host
+tree0.xyz: could not connect to host
treeby.net: could not connect to host
treehousebydesign.com: did not receive HSTS header
treeremovaljohannesburg.co.za: could not connect to host
+treeworkbyjtec.com: could not connect to host
treino.blog.br: could not connect to host
treker.us: could not connect to host
+trekkinglife.de: did not receive HSTS header
trell.co.in: did not receive HSTS header
tremlor.com: max-age too low: 300
tremolosoftware.com: did not receive HSTS header
@@ -18097,7 +18927,7 @@ trendydips.com: could not connect to host
trentmaydew.com: could not connect to host
trenztec.ml: could not connect to host
tretkowski.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-trewe.eu: could not connect to host
+trewe.eu: did not receive HSTS header
triadwars.com: did not receive HSTS header
triageo.com.au: could not connect to host
trialmock.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -18111,11 +18941,13 @@ trigular.de: could not connect to host
trik.es: could not connect to host
trileg.net: could not connect to host
trilithsolutions.com: did not receive HSTS header
+trim21.cn: could not connect to host
trimarchimanuele.it: did not receive HSTS header
trinity.fr.eu.org: could not connect to host
trinityaffirmations.com: max-age too low: 0
trinitycore.org: max-age too low: 2592000
trinitytechdev.com: did not receive HSTS header
+trior.net: could not connect to host
tripcombi.com: did not receive HSTS header
tripdelta.com: did not receive HSTS header
tripinsider.club: did not receive HSTS header
@@ -18157,15 +18989,17 @@ tryfabulousdiet.com: could not connect to host
tryfm.net: did not receive HSTS header
trynowrinkleseyeserum.com: could not connect to host
tryoneday.co: did not receive HSTS header
+trypineapple.com: could not connect to host
tryti.me: could not connect to host
ts-publishers.com: could not connect to host
ts2.se: could not connect to host
ts3-dns.com: could not connect to host
ts3-dns.me: could not connect to host
ts3-dns.net: could not connect to host
+ts3-legenda.tech: could not connect to host
ts3.consulting: could not connect to host
tsaro.io: could not connect to host
-tscqmalawi.info: did not receive HSTS header
+tscqmalawi.info: could not connect to host
tsdom.net: could not connect to host
tsecy.com: could not connect to host
tsgbit.net: could not connect to host
@@ -18179,11 +19013,13 @@ tsumegumi.net: could not connect to host
tsumi.moe: could not connect to host
tsura.org: could not connect to host
tsurezurematome.ga: could not connect to host
+tsurimap.com: could not connect to host
ttackmedical.com.br: could not connect to host
tts.co.nz: did not receive HSTS header
ttspttsp.com: could not connect to host
tty.space: could not connect to host
ttz.im: could not connect to host
+tu6.pm: could not connect to host
tuamoronline.com: could not connect to host
tuang-tuang.com: could not connect to host
tubbutec.de: did not receive HSTS header
@@ -18195,19 +19031,18 @@ tucidi.net: could not connect to host
tucker.wales: could not connect to host
tucnak.eu: could not connect to host
tudorapido.com.br: did not receive HSTS header
+tudulinna.ee: max-age too low: 43200
tueche.com.ar: did not receive HSTS header
tufilo.com: could not connect to host
tugers.com: did not receive HSTS header
+tulenceria.es: could not connect to host
tulsameetingroom.com: could not connect to host
-tumagiri.net: did not receive HSTS header
tumutanzi.com: did not receive HSTS header
tunca.it: did not receive HSTS header
tunebitfm.de: could not connect to host
tungstenroyce.com: did not receive HSTS header
tunity.be: did not receive HSTS header
-tuou.xyz: could not connect to host
tupizm.com: could not connect to host
-turbobit.ch: did not receive HSTS header
turismo.cl: could not connect to host
turkiet.guide: could not connect to host
turn-sticks.com: could not connect to host
@@ -18217,27 +19052,28 @@ turnsticks.com: could not connect to host
turtle.ai: did not receive HSTS header
turtlementors.com: could not connect to host
turtles.ga: could not connect to host
-tusb.ml: could not connect to host
+tusb.ml: did not receive HSTS header
tussengelegenwoningverkopen.nl: could not connect to host
tuthowto.com: could not connect to host
-tutiendaroja.com: did not receive HSTS header
-tutiendarosa.com: did not receive HSTS header
+tutiendaroja.com: could not connect to host
+tutiendarosa.com: could not connect to host
tutorio.ga: could not connect to host
tutu.ro: could not connect to host
-tuturulianda.com: did not receive HSTS header
+tuturulianda.com: could not connect to host
tuvalie.com: did not receive HSTS header
tuxhound.org: could not connect to host
+tuxone.ch: did not receive HSTS header
tuxrtfm.com: could not connect to host
tv.search.yahoo.com: could not connect to host
tvc.red: could not connect to host
tverdohleb.com: could not connect to host
tvoru.com.ua: did not receive HSTS header
tvqc.com: did not receive HSTS header
-tvs-virtual.cz: did not receive HSTS header
tvtubeflix.com: did not receive HSTS header
tvz-materijali.com: could not connect to host
tw2-tools.ga: could not connect to host
twarog.cc: could not connect to host
+twatspot.com: could not connect to host
tweakersbadge.nl: could not connect to host
twee-onder-een-kap-woning-in-alphen-aan-den-rijn-kopen.nl: could not connect to host
twee-onder-een-kap-woning-in-brielle-kopen.nl: could not connect to host
@@ -18256,7 +19092,6 @@ tweetify.io: could not connect to host
twelve.rocks: could not connect to host
twelve.today: could not connect to host
twelverocks.com: could not connect to host
-twem.ddns.net: could not connect to host
twilightcookies.ca: could not connect to host
twillionmas.com: could not connect to host
twinkieman.com: could not connect to host
@@ -18279,8 +19114,6 @@ twolinepassbrewing.com: could not connect to host
twolivelife.com: could not connect to host
twoo.com: could not connect to host
twotube.ie: could not connect to host
-twtimmy.com: could not connect to host
-twtremind.com: could not connect to host
twun.io: could not connect to host
twuni.org: did not receive HSTS header
tx041cap.org: could not connect to host
@@ -18292,6 +19125,7 @@ txf.pw: could not connect to host
ty2u.com: did not receive HSTS header
tycjt.vip: could not connect to host
tyil.nl: did not receive HSTS header
+tyil.work: could not connect to host
tykoon.com: could not connect to host
tyl.io: did not receive HSTS header
tyler.coach: could not connect to host
@@ -18303,7 +19137,6 @@ tylian.net: max-age too low: 0
type1joe.com: could not connect to host
type1joe.net: could not connect to host
type1joe.org: could not connect to host
-typecodes.com: could not connect to host
typehub.net: could not connect to host
typeofweb.com: did not receive HSTS header
typeonejoe.net: could not connect to host
@@ -18319,14 +19152,15 @@ tzwe.com: could not connect to host
u-master.net: did not receive HSTS header
u-metals.com: did not receive HSTS header
u175.com: could not connect to host
+u5eu.com: did not receive HSTS header
uadp.pw: could not connect to host
uahs.org.uk: did not receive HSTS header
ubalert.com: could not connect to host
uber.com.au: did not receive HSTS header
+uberbkk.com: could not connect to host
ubercalculator.com: did not receive HSTS header
uberfunction.com: did not receive HSTS header
ubertt.org: could not connect to host
-uberwald.de: could not connect to host
ubicloud.de: did not receive HSTS header
ubicv.com: could not connect to host
ublox.com: did not receive HSTS header
@@ -18336,8 +19170,8 @@ ubuntuhot.com: did not receive HSTS header
uc.ac.id: did not receive HSTS header
uchiha.ml: could not connect to host
uclanmasterplan.co.uk: did not receive HSTS header
-ucppe.org: could not connect to host
-udbhav.me: could not connect to host
+uddi.ng: did not receive HSTS header
+uefeng.com: did not receive HSTS header
uega.net: did not receive HSTS header
uel-thompson-okanagan.ca: could not connect to host
uerdingen.info: did not receive HSTS header
@@ -18351,11 +19185,11 @@ ugcdn.com: could not connect to host
ugisgutless.com: could not connect to host
ugo.ninja: could not connect to host
ugosadventures.com: could not connect to host
-uhappy1.com: did not receive HSTS header
+uhappy1.com: could not connect to host
uhappy11.com: did not receive HSTS header
-uhappy2.com: did not receive HSTS header
+uhappy2.com: could not connect to host
uhappy21.com: did not receive HSTS header
-uhappy22.com: did not receive HSTS header
+uhappy22.com: could not connect to host
uhappy23.com: did not receive HSTS header
uhappy24.com: did not receive HSTS header
uhappy25.com: did not receive HSTS header
@@ -18367,13 +19201,13 @@ uhappy3.com: did not receive HSTS header
uhappy30.com: did not receive HSTS header
uhappy31.com: did not receive HSTS header
uhappy33.com: did not receive HSTS header
-uhappy50.com: did not receive HSTS header
+uhappy50.com: could not connect to host
uhappy55.com: did not receive HSTS header
uhappy56.com: did not receive HSTS header
uhappy57.com: could not connect to host
uhappy58.com: did not receive HSTS header
uhappy59.com: did not receive HSTS header
-uhappy6.com: did not receive HSTS header
+uhappy6.com: could not connect to host
uhappy60.com: did not receive HSTS header
uhappy61.com: did not receive HSTS header
uhappy62.com: did not receive HSTS header
@@ -18386,33 +19220,35 @@ uhappy72.com: did not receive HSTS header
uhappy73.com: did not receive HSTS header
uhappy74.com: did not receive HSTS header
uhappy75.com: did not receive HSTS header
-uhappy76.com: did not receive HSTS header
+uhappy76.com: could not connect to host
uhappy77.com: did not receive HSTS header
uhappy78.com: could not connect to host
uhappy79.com: did not receive HSTS header
-uhappy8.com: did not receive HSTS header
+uhappy8.com: could not connect to host
uhappy80.com: did not receive HSTS header
uhappy81.com: did not receive HSTS header
uhappy82.com: did not receive HSTS header
-uhappy83.com: did not receive HSTS header
-uhappy85.com: did not receive HSTS header
+uhappy83.com: could not connect to host
+uhappy85.com: could not connect to host
uhappy86.com: did not receive HSTS header
uhappy88.com: did not receive HSTS header
-uhappy9.com: did not receive HSTS header
+uhappy9.com: could not connect to host
uhappy90.com: did not receive HSTS header
uhappy99.com: did not receive HSTS header
uhasseltctf.ga: could not connect to host
uhasseltodin.be: did not receive HSTS header
uhm.io: did not receive HSTS header
-uhssl.com: did not receive HSTS header
+uhssl.com: could not connect to host
uhuru-market.com: did not receive HSTS header
uitslagensoftware.nl: did not receive HSTS header
ukas.com: could not connect to host
+ukbc.london: did not receive HSTS header
ukdropshipment.co.uk: did not receive HSTS header
ukdropshipment.com: did not receive HSTS header
ukk.dk: did not receive HSTS header
ukkeyholdingcompany.co.uk: could not connect to host
ukrgadget.com: could not connect to host
+ukunlocks.com: did not receive HSTS header
ulabox.cat: did not receive HSTS header
ulabox.es: did not receive HSTS header
ulalau.com: did not receive HSTS header
@@ -18424,11 +19260,15 @@ ultimate-garcinia-plus.com: could not connect to host
ultimate-glow-skin.com: could not connect to host
ultimate-memoryplus.com: could not connect to host
ultimate-neuroplus.com: could not connect to host
+ultramax.biz: could not connect to host
+ultraporn.biz: could not connect to host
+ultraseopro.com: could not connect to host
ultrasite.tk: could not connect to host
ultrasteam.net: could not connect to host
ultros.io: did not receive HSTS header
umaimise.info: did not receive HSTS header
umassfive.coop: did not receive HSTS header
+umbrellaye.online: could not connect to host
umbriel.fr: did not receive HSTS header
umgardi.ca: could not connect to host
umidev.com: could not connect to host
@@ -18437,6 +19277,7 @@ umkmjogja.com: did not receive HSTS header
ump45.moe: could not connect to host
umsolugar.com.br: could not connect to host
umwandeln-online.de: could not connect to host
+umzugsunternehmenberlin.eu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
unapolegetic.co: did not receive HSTS header
unart.info: could not connect to host
unbanthe.net: could not connect to host
@@ -18446,12 +19287,15 @@ unblocked.blue: did not receive HSTS header
unblocked.date: could not connect to host
unblocked.faith: could not connect to host
unblocked.host: could not connect to host
+unblocked.lat: could not connect to host
unblocked.party: could not connect to host
+unblocked.sh: could not connect to host
unblocked.st: could not connect to host
unblocked.today: could not connect to host
+unblocked.vc: could not connect to host
unblocked.win: could not connect to host
unblocked.works: could not connect to host
-unblocked.world: could not connect to host
+unblocked.world: did not receive HSTS header
unblockedall.site: could not connect to host
unblockedbay.info: could not connect to host
unblockerproxy.site: did not receive HSTS header
@@ -18460,17 +19304,16 @@ unblockmy.party: could not connect to host
unblockmy.tech: could not connect to host
unblockmy.xyz: could not connect to host
unblockmyproxy.site: did not receive HSTS header
-unblockthe.site: could not connect to host
+unblockthe.site: did not receive HSTS header
unblockthe.top: could not connect to host
unccdesign.club: could not connect to host
unclegen.xyz: could not connect to host
undecidable.de: could not connect to host
under30stravelinsurance.com.au: did not receive HSTS header
+undercovercondoms.com: could not connect to host
underkin.com: could not connect to host
-underskatten.tk: could not connect to host
undone.me: could not connect to host
unefuite.ch: could not connect to host
-unfc.nl: did not receive HSTS header
unfiltered.nyc: could not connect to host
unfuddle.cn: could not connect to host
ungeek.eu: did not receive HSTS header
@@ -18479,6 +19322,7 @@ unhu.fr: did not receive HSTS header
uni-games.com: could not connect to host
uni2share.com: could not connect to host
unicefcards.at: did not receive HSTS header
+unicefcards.gr: could not connect to host
unicefkaarten.be: did not receive HSTS header
unicefkort.dk: did not receive HSTS header
unicooo.com: could not connect to host
@@ -18496,21 +19340,24 @@ uninet.cf: could not connect to host
unioils.la: max-age too low: 7889238
uniojeda.ml: could not connect to host
unionstationapp.com: could not connect to host
+unionstreetskateboards.com: could not connect to host
unirenter.ru: did not receive HSTS header
unison.com: did not receive HSTS header
-unisyssecurity.com: did not receive HSTS header
+unisyssecurity.com: could not connect to host
unitedcyberdevelopment.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
unitedstreamers.de: did not receive HSTS header
unitlabs.net: could not connect to host
unitrade-425.co.za: did not receive HSTS header
univerpack.net: could not connect to host
university4industry.com: did not receive HSTS header
+universogay.com: could not connect to host
univstore.win: could not connect to host
univz.com: could not connect to host
unixapp.ml: could not connect to host
unixtime.pro: could not connect to host
unknownbreakup.com: max-age too low: 2592000
unknownphenomena.net: could not connect to host
+unleash.pw: could not connect to host
unlogis.ch: could not connect to host
unmanaged.space: did not receive HSTS header
unplugg3r.dk: could not connect to host
@@ -18523,8 +19370,7 @@ unstockd.org: could not connect to host
unsupervised.ca: did not receive HSTS header
unsystem.net: could not connect to host
unterkunft.guru: did not receive HSTS header
-untoldstory.eu: could not connect to host
-unveiledgnosis.com: did not receive HSTS header
+untoldstory.eu: did not receive HSTS header
unwiredbrain.com: could not connect to host
unwomen.is: did not receive HSTS header
unworthy.ml: could not connect to host
@@ -18535,6 +19381,7 @@ up1.ca: could not connect to host
upandclear.org: max-age too low: 0
upboard.jp: could not connect to host
updatehub.io: did not receive HSTS header
+upgauged.com: could not connect to host
upldr.pw: could not connect to host
uploadbro.com: could not connect to host
upmchealthsecurity.us: could not connect to host
@@ -18552,6 +19399,7 @@ ur-lauber.de: did not receive HSTS header
urban-garden.lt: could not connect to host
urban-garden.lv: could not connect to host
urban-karuizawa.co.jp: max-age too low: 0
+urbane-london.com: did not receive HSTS header
urbanfi.sh: did not receive HSTS header
urbanmic.com: could not connect to host
urbanstylestaging.com: could not connect to host
@@ -18561,7 +19409,6 @@ urgences-valais.ch: could not connect to host
url.cab: did not receive HSTS header
urlachershop.com.br: did not receive HSTS header
urlchomp.com: did not receive HSTS header
-urnes.org: did not receive HSTS header
urology.wiki: did not receive HSTS header
urphp.com: did not receive HSTS header
us-immigration.com: did not receive HSTS header
@@ -18583,7 +19430,6 @@ user-new.com: did not receive HSTS header
usercare.com: could not connect to host
useresponse.com: did not receive HSTS header
userify.com: did not receive HSTS header
-uskaria.com: could not connect to host
uslab.io: could not connect to host
usleep.net: could not connect to host
usparklodging.com: did not receive HSTS header
@@ -18612,11 +19458,13 @@ utvbloggen.se: [Exception... "Component returned failure code: 0x80004005 (NS_ER
uuid.cf: did not receive HSTS header
uvarov.pw: could not connect to host
uvolejniku.cz: did not receive HSTS header
+uw1008.com: could not connect to host
uwekoetter.com: did not receive HSTS header
uwesander.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
uwfreelanceopticien.nl: could not connect to host
-uwimonacs.org.jm: did not receive HSTS header
+uwimonacs.org.jm: could not connect to host
uwstartups.com: could not connect to host
+uxtechnologist.com: did not receive HSTS header
uxux.pl: could not connect to host
uygindir.ml: could not connect to host
uyym.com: could not connect to host
@@ -18627,7 +19475,6 @@ v-desk.ga: could not connect to host
v0rtex.xyz: could not connect to host
v0tti.com: did not receive HSTS header
v12.co.uk: did not receive HSTS header
-v1sit0r.ru: could not connect to host
v2.pw: did not receive HSTS header
v2ex.us: could not connect to host
v4s.ro: could not connect to host
@@ -18649,16 +19496,18 @@ vaddder.com: could not connect to host
vadennissanofhinesvilleparts.com: did not receive HSTS header
vadik.me: could not connect to host
vadodesign.nl: did not receive HSTS header
+vagrantbits.com: could not connect to host
vaibhavchatarkar.com: could not connect to host
val-sec.com: could not connect to host
valaeris.de: did not receive HSTS header
-valbonne-consulting.com: did not receive HSTS header
+valbonne-consulting.com: could not connect to host
valecnatechnika.cz: could not connect to host
valenhub.com: could not connect to host
valenhub.es: could not connect to host
valenscaelum.com: could not connect to host
valentin-dederer.de: could not connect to host
valentin-ochs.de: could not connect to host
+valentin.ml: could not connect to host
valesdev.com: max-age too low: 0
valethound.com: could not connect to host
valhallacostarica.com: could not connect to host
@@ -18672,6 +19521,7 @@ vallis.net: could not connect to host
valmagus.com: could not connect to host
valopv.be: could not connect to host
valshamar.is: could not connect to host
+valuechain.me: could not connect to host
vamoaeturismo.com.br: could not connect to host
vamosfalardesaude.pt: could not connect to host
vampirism.eu: could not connect to host
@@ -18686,7 +19536,7 @@ vangeluwedeberlaere.be: did not receive HSTS header
vanhaos.com: could not connect to host
vanitas.xyz: could not connect to host
vanitynailworkz.com: could not connect to host
-vanlaanen.com: did not receive HSTS header
+vanlent.net: could not connect to host
vanohaker.ru: could not connect to host
vansieleghem.com: could not connect to host
vantaio.com: did not receive HSTS header
@@ -18695,14 +19545,15 @@ vapecom-shop.com: could not connect to host
vapecraftinc.com: did not receive HSTS header
vapehour.com: could not connect to host
vapemania.eu: could not connect to host
-vapesense.co.uk: did not receive HSTS header
vapeshopsupply.com: max-age too low: 7889238
vaporpunk.space: did not receive HSTS header
varela-electricite.fr: could not connect to host
+varghese.de: could not connect to host
variablyconstant.com: could not connect to host
varta.io: could not connect to host
vasa-webstranka.sk: did not receive HSTS header
vasanth.org: could not connect to host
+vase-eroticke-povidky.cz: could not connect to host
vastgoedcultuurfonds.nl: did not receive HSTS header
vastkustenrunt.se: did not receive HSTS header
vatsalyagoel.com: did not receive HSTS header
@@ -18710,12 +19561,12 @@ vatsim-uk.co.uk: did not receive HSTS header
vatsim.uk: did not receive HSTS header
vavai.net: did not receive HSTS header
vavouchers.com: could not connect to host
-vawltstorage.com: did not receive HSTS header
+vawltstorage.com: could not connect to host
vayaport.com: could not connect to host
vb-oa.co.uk: did not receive HSTS header
vbest.net: could not connect to host
vbestreviews.com: did not receive HSTS header
-vbhelp.org: could not connect to host
+vbhelp.org: did not receive HSTS header
vbulletin-russia.com: could not connect to host
vbulletinrussia.com: could not connect to host
vcdn.xyz: could not connect to host
@@ -18723,8 +19574,11 @@ vcdove.com: could not connect to host
vconcept.ch: could not connect to host
vconcept.me: could not connect to host
vcr.re: could not connect to host
+vctor.net: did not receive HSTS header
vdhco.be: did not receive HSTS header
+vdownloader.com: could not connect to host
vdrpro.com: could not connect to host
+vea.re: max-age too low: 0
veblen.com: did not receive HSTS header
vechkasov.ru: could not connect to host
vectro.me: could not connect to host
@@ -18762,22 +19616,27 @@ venoom.eu: did not receive HSTS header
vensl.org: could not connect to host
venturedisplay.co.uk: did not receive HSTS header
venturepro.com: did not receive HSTS header
+ventzke.com: could not connect to host
venusbymariatash.com: did not receive HSTS header
venzocrm.com: did not receive HSTS header
ver-ooginoog.nl: max-age too low: 2592000
-veraandsteve.date: did not receive HSTS header
+veraandsteve.date: could not connect to host
verdeandco.co.uk: could not connect to host
+vereinscheck.de: could not connect to host
vergeaccessories.com: could not connect to host
vergessen.cn: could not connect to host
verificaprezzi.it: did not receive HSTS header
verifiedinvesting.com: could not connect to host
verifikatorindonesia.com: could not connect to host
+veriny.tf: did not receive HSTS header
veriomed.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
veristor.com: did not receive HSTS header
+verliefde-jongens.nl: could not connect to host
vermogeninkaart.nl: could not connect to host
vermontcareergateway.org: could not connect to host
vernonfishandgame.ca: did not receive HSTS header
vernonhouseofhope.com: did not receive HSTS header
+verry.org: could not connect to host
versbeton.nl: max-age too low: 864000
versfin.net: could not connect to host
versia.ru: did not receive HSTS header
@@ -18791,14 +19650,17 @@ veterinaire-cazeres-foucault.fr: could not connect to host
vethouse.com.ua: did not receive HSTS header
vetmgmt.com: could not connect to host
veto.fish: could not connect to host
+vexsoluciones.com: did not receive HSTS header
vforvendetta.science: did not receive HSTS header
vfree.org: could not connect to host
vgatest.nl: could not connect to host
vglimg.com: could not connect to host
vhost.co.id: could not connect to host
+vhs-bad-wurzach.de: did not receive HSTS header
viabemestar.com.br: could not connect to host
viadeux.com: did not receive HSTS header
viagraonlinebestellen.org: max-age too low: 3600
+vialibido.com.br: could not connect to host
viato.fr: could not connect to host
vibrashop.com.br: did not receive HSTS header
vicenage.com: could not connect to host
@@ -18822,6 +19684,7 @@ videobola.win: could not connect to host
videoload.co: could not connect to host
videomuz.com: could not connect to host
videorullen.se: did not receive HSTS header
+videosxgays.com: could not connect to host
videotogel.net: could not connect to host
videoueberwachung-set.de: did not receive HSTS header
vider.ga: could not connect to host
@@ -18834,12 +19697,15 @@ vidz.ga: could not connect to host
vieaw.com: could not connect to host
viennan.net: did not receive HSTS header
vietnam-lifer.com: could not connect to host
-vietnamchevrolet.net: did not receive HSTS header
-vietnamphotographytours.com: did not receive HSTS header
+vietnamchevrolet.net: could not connect to host
+vietnamphotographytours.com: could not connect to host
+vieux.pro: could not connect to host
+viewmyrecords.com: did not receive HSTS header
viewsea.com: max-age too low: 0
viga.me: could not connect to host
vigilo.cf: could not connect to host
vigilo.ga: could not connect to host
+vigour.us: could not connect to host
viikko.eu: could not connect to host
vijos.org: did not receive HSTS header
vikasbabyworld.de: could not connect to host
@@ -18867,9 +19733,10 @@ vinbet444.com: could not connect to host
vinbet555.com: could not connect to host
vinbet666.com: could not connect to host
vinbet888.com: could not connect to host
-vincentiliano.tk: did not receive HSTS header
+vincentiliano.tk: could not connect to host
vincentkooijman.at: did not receive HSTS header
vincentkooijman.nl: did not receive HSTS header
+vincentoshana.com: did not receive HSTS header
vineright.com: did not receive HSTS header
vinesauce.info: could not connect to host
vinetalk.net: could not connect to host
@@ -18881,25 +19748,27 @@ vinnie.gq: could not connect to host
vinogradovka.com: did not receive HSTS header
vintock.com: could not connect to host
vio.no: did not receive HSTS header
-violenceinterrupted.org: did not receive HSTS header
+violenceinterrupted.org: could not connect to host
violet-letter.delivery: could not connect to host
violetraven.co.uk: did not receive HSTS header
viosey.com: could not connect to host
vioye.com: could not connect to host
-vip-9649.com: did not receive HSTS header
+vip-9649.com: could not connect to host
vip4553.com: could not connect to host
-vip9649.com: did not receive HSTS header
+vip9649.com: could not connect to host
viperdns.com: could not connect to host
vipesball.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
vipesball.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
vipesball.me: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
vipesball.net: could not connect to host
viphospitality.se: could not connect to host
+vipi.es: could not connect to host
viplentes.com.br: did not receive HSTS header
vipmusic.ga: could not connect to host
vipnettikasinoklubi.com: did not receive HSTS header
viral8.jp: could not connect to host
viralboombox.xyz: could not connect to host
+viralsv.com: could not connect to host
virginiacrimeanalysisnetwork.org: did not receive HSTS header
virial.de: did not receive HSTS header
viris.si: max-age too low: 536000
@@ -18908,7 +19777,7 @@ virtualstrongbox.ca: could not connect to host
visa-shinsei.com: did not receive HSTS header
visanhigia.com: could not connect to host
viserproject.com: did not receive HSTS header
-visioflux-premium.com: did not receive HSTS header
+visioflux-premium.com: could not connect to host
vision-painting.com: did not receive HSTS header
visiondigitalsog.com: could not connect to host
visiongamestudios.com: could not connect to host
@@ -18921,19 +19790,19 @@ vispaleistexel.nl: did not receive HSTS header
vissanum.com: did not receive HSTS header
vissersgrootboek.nl: did not receive HSTS header
vistarait.com: could not connect to host
-visualideas.org: could not connect to host
visualvotes.co.uk: could not connect to host
vitagenda.nl: could not connect to host
-vital-tel.co.uk: did not receive HSTS header
vitalamin.at: could not connect to host
vitalamin.ch: could not connect to host
vitalamin.com: could not connect to host
vitalamin.de: did not receive HSTS header
vitalita.cz: did not receive HSTS header
+vitalium-therme.de: did not receive HSTS header
vitalorange.com: did not receive HSTS header
vitalthings.de: could not connect to host
vitamaxxi.com.br: could not connect to host
vitamineproteine.com: did not receive HSTS header
+vitapingu.de: could not connect to host
vitta.me: did not receive HSTS header
vitzro.kr: could not connect to host
viva-french.com: did not receive HSTS header
@@ -18945,11 +19814,10 @@ vivoregularizafacil.com.br: did not receive HSTS header
vivoseg.com: could not connect to host
vivremoinscher.fr: could not connect to host
viza.io: could not connect to host
-vizards.cc: did not receive HSTS header
+vizards.cc: could not connect to host
vizeat.com: did not receive HSTS header
-vk-k.com: could not connect to host
+vk4wip.org.au: did not receive HSTS header
vkulagin.ru: could not connect to host
-vladimiroff.org: did not receive HSTS header
vldkn.net: could not connect to host
vleij.family: could not connect to host
vlogge.com: did not receive HSTS header
@@ -18958,7 +19826,9 @@ vlzbazar.ru: could not connect to host
vmem.jp: did not receive HSTS header
vmrdev.com: could not connect to host
vmstan.com: did not receive HSTS header
-vnfs-team.com: could not connect to host
+vmzone.de: could not connect to host
+vndb.org: could not connect to host
+vnfs-team.com: did not receive HSTS header
vnpem.org: did not receive HSTS header
vocab.guru: could not connect to host
vocalik.com: could not connect to host
@@ -18983,7 +19853,6 @@ voipkb.com: did not receive HSTS header
voiro.club: could not connect to host
voirodaisuki.club: could not connect to host
vokalsystem.com: did not receive HSTS header
-vokurka.net: did not receive HSTS header
volatimer.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
volbyzive.cz: did not receive HSTS header
volcain.io: could not connect to host
@@ -18991,6 +19860,7 @@ volcrado.com: could not connect to host
volkden.com: could not connect to host
volkerwesselswave.nl: did not receive HSTS header
volkswurst.de: did not receive HSTS header
+vollmondstollen.de: could not connect to host
voltimax.com: did not receive HSTS header
voltotc.com: did not receive HSTS header
voluptueuse.com: did not receive HSTS header
@@ -19003,20 +19873,26 @@ vonavy-cukor.sk: could not connect to host
vonavycukor.sk: could not connect to host
vonedelmann.de: did not receive HSTS header
vongerlach.at: did not receive HSTS header
+vonterra.us: could not connect to host
vooreenveiligthuis.nl: did not receive HSTS header
vorangerie.com: could not connect to host
vorderklier.de: could not connect to host
vorkbaard.nl: did not receive HSTS header
+vorlif.org: did not receive HSTS header
vorte.ga: could not connect to host
vortexhobbies.com: did not receive HSTS header
+vos-fleurs.ch: could not connect to host
+vos-fleurs.com: could not connect to host
vosjesweb.nl: could not connect to host
votercircle.com: did not receive HSTS header
voterstartingpoint.uk: did not receive HSTS header
votewa.gov: could not connect to host
-votre-site-internet.ch: could not connect to host
+votre-site-internet.ch: did not receive HSTS header
votresiteweb.ch: could not connect to host
vow.vn: could not connect to host
+vowsy.club: could not connect to host
vox.vg: did not receive HSTS header
+vozami.com: could not connect to host
vpip.net: could not connect to host
vpl.me: did not receive HSTS header
vpn-byen.dk: did not receive HSTS header
@@ -19026,7 +19902,8 @@ vpnzoom.com: did not receive HSTS header
vps-szerver-berles.hu: could not connect to host
vpsmojo.com: could not connect to host
vpsvz.cloud: could not connect to host
-vranjske.co.rs: could not connect to host
+vqporn.com: could not connect to host
+vranjske.co.rs: did not receive HSTS header
vratny.space: could not connect to host
vriendenvoordeel.com: did not receive HSTS header
vrijstaandhuis-in-alphen-aan-den-rijn-kopen.nl: could not connect to host
@@ -19041,6 +19918,7 @@ vrijstaandhuis-in-zuid-holland-kopen.nl: could not connect to host
vrijstaandhuis-in-zuidplas-kopen.nl: could not connect to host
vrijstaandhuis-in-zwartewaterland-kopen.nl: could not connect to host
vrijstaandhuisverkopen.nl: could not connect to host
+vrlaid.com: could not connect to host
vrobert.fr: could not connect to host
vrsgames.com.mx: did not receive HSTS header
vrtouring.org: could not connect to host
@@ -19061,7 +19939,6 @@ vww-8522.com: could not connect to host
vxapps.com: could not connect to host
vxml.club: could not connect to host
vxst.org: max-age too low: 2592000
-vxz.me: could not connect to host
vykup-car.ru: did not receive HSTS header
vynedmusic.com: could not connect to host
vyshivanochka.in.ua: could not connect to host
@@ -19070,11 +19947,13 @@ vyvybean.cf: could not connect to host
vyvygen.com: did not receive HSTS header
vyzner.cz: could not connect to host
vzk.io: could not connect to host
+w-p-k.de: did not receive HSTS header
w10club.com: could not connect to host
w1221.com: could not connect to host
w2gshop.com.br: could not connect to host
w3n.org: could not connect to host
w4a.fr: could not connect to host
+w4b.in: could not connect to host
w4xzr.top: could not connect to host
w4xzr.xyz: could not connect to host
w84.it: could not connect to host
@@ -19082,15 +19961,18 @@ w9rld.com: did not receive HSTS header
wabifoggynuts.com: could not connect to host
wachter.biz: could not connect to host
wachtwoordencheck.nl: could not connect to host
-wadvisor.com: could not connect to host
+waelti.xxx: could not connect to host
wafa4hw.com: could not connect to host
wafairhaven.com.au: did not receive HSTS header
wafni.com: could not connect to host
+wahhoi.net: could not connect to host
+wahlen-bad-wurzach.de: did not receive HSTS header
wai-in.com: could not connect to host
wai-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
waidu.de: did not receive HSTS header
-wail.net: could not connect to host
+wains.be: did not receive HSTS header
wait.moe: could not connect to host
+waiterwheels.com: did not receive HSTS header
waixingrenfuli7.vip: could not connect to host
waka168.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
waka168.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -19109,6 +19991,7 @@ wallet.google.com: did not receive HSTS header (error ignored - included regardl
wallpapers.pub: could not connect to host
wallsblog.dk: could not connect to host
walnutgaming.co.uk: could not connect to host
+waltellis.com: could not connect to host
walterlynnmosley.com: did not receive HSTS header
wanashi.com: could not connect to host
wanban.io: could not connect to host
@@ -19120,14 +20003,12 @@ wanda97.com: could not connect to host
wanda98.com: could not connect to host
wandercue.com: did not receive HSTS header
wangjiatun.com.tw: could not connect to host
-wangjun.me: did not receive HSTS header
wangkezun.com: could not connect to host
wangler-internet.de: did not receive HSTS header
-wangqiliang.org: could not connect to host
wangqiliang.xn--fiqs8s: could not connect to host
wangql.cn: could not connect to host
-wanquanojbk.com: did not receive HSTS header
wantshow.com.br: did not receive HSTS header
+wanvi.net: could not connect to host
wanybug.cn: did not receive HSTS header
wapgu.cc: could not connect to host
wapjt.cn: could not connect to host
@@ -19145,9 +20026,6 @@ warlions.info: could not connect to host
warmestwishes.ca: could not connect to host
warmservers.com: could not connect to host
warnings.xyz: could not connect to host
-warp-radio.com: could not connect to host
-warp-radio.net: could not connect to host
-warp-radio.tv: could not connect to host
warped.com: did not receive HSTS header
warren.sh: could not connect to host
warrencreative.com: did not receive HSTS header
@@ -19160,6 +20038,7 @@ wassim.is: did not receive HSTS header
watashi.bid: could not connect to host
watchcom.org.za: did not receive HSTS header
watchium.com: did not receive HSTS header
+watchpci.com: did not receive HSTS header
watchtv-online.pw: could not connect to host
watchweasel.com: could not connect to host
waterfedpole.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -19168,6 +20047,7 @@ waterpoint.com.br: could not connect to host
watersportmarkt.net: did not receive HSTS header
watsonhall.uk: could not connect to host
wattechweb.com: did not receive HSTS header
+waukeect.com: could not connect to host
wave-ola.es: did not receive HSTS header
wavefloatrooms.com: did not receive HSTS header
wavefrontsystemstech.com: could not connect to host
@@ -19187,6 +20067,7 @@ wealthcentral.com.au: did not receive HSTS header
wealthformyhealth.com: did not receive HSTS header
wear2work.nl: could not connect to host
wearedisneyland.com: did not receive HSTS header
+wearehackerone.com: could not connect to host
weareincognito.org: could not connect to host
wearewithyou.org: could not connect to host
weather-and-climate.com: did not receive HSTS header
@@ -19201,25 +20082,30 @@ web-vision.de: did not receive HSTS header
web1n.com: did not receive HSTS header
web4all.fr: did not receive HSTS header
web4pro.fr: could not connect to host
+webambacht.nl: could not connect to host
webandwords.com.au: could not connect to host
webanker.sh: did not receive HSTS header
webapky.cz: could not connect to host
webapps.directory: could not connect to host
webart-factory.de: could not connect to host
webassadors.com: could not connect to host
-webauthority.co.uk: did not receive HSTS header
+webauthority.co.uk: could not connect to host
webbuzz.com.au: did not receive HSTS header
webbx.se: did not receive HSTS header
webchat.domains: did not receive HSTS header
webcreation.rocks: could not connect to host
webdeflect.com: did not receive HSTS header
webdesign-kronberg.de: did not receive HSTS header
+webdesigneauclaire.com: could not connect to host
webdesignssussex.co.uk: could not connect to host
webdev-quiz.de: did not receive HSTS header
webdev.mobi: could not connect to host
+webdevxp.com: could not connect to host
webdollarvpn.io: could not connect to host
webdosh.com: did not receive HSTS header
+webeau.com: could not connect to host
webeconomia.it: did not receive HSTS header
+webeditors.com: did not receive HSTS header
webelement.sk: did not receive HSTS header
weberjulia.com: could not connect to host
webfronten.dk: did not receive HSTS header
@@ -19237,7 +20123,7 @@ webm.to: could not connect to host
webmail.mayfirst.org: did not receive HSTS header
webmaniabr.com: did not receive HSTS header
webmarketingfestival.it: did not receive HSTS header
-webmax.com.tr: could not connect to host
+webmax.com.tr: did not receive HSTS header
webmel.com: did not receive HSTS header
webmixseo.com: did not receive HSTS header
webnetmail4u.com: could not connect to host
@@ -19273,6 +20159,7 @@ webthings.com.br: could not connect to host
webtiles.co.uk: could not connect to host
webuni.hu: did not receive HSTS header
webveloper.com: did not receive HSTS header
+webvisum.de: did not receive HSTS header
webwolf.co.za: could not connect to host
webwork.pw: did not receive HSTS header
webypass.xyz: could not connect to host
@@ -19282,7 +20169,6 @@ wecanfindit.co.za: could not connect to host
wecanvisit.com: could not connect to host
wedding-m.jp: did not receive HSTS header
weddingalbumsdesign.com: max-age too low: 2592000
-weddingenvelopes.co.uk: did not receive HSTS header
weddingfantasy.ru: could not connect to host
weddingibiza.nl: could not connect to host
wedotrains.club: could not connect to host
@@ -19290,6 +20176,8 @@ weebsr.us: could not connect to host
weed.ren: could not connect to host
weedcircles.com: did not receive HSTS header
weedlandia.org: could not connect to host
+weednews.co: did not receive HSTS header
+week.report: could not connect to host
weekly.fyi: could not connect to host
wegenaer.nl: could not connect to host
wegethitched.co.uk: could not connect to host
@@ -19297,17 +20185,18 @@ weggeweest.nl: could not connect to host
wegner.no: could not connect to host
weicn.org: did not receive HSTS header
weightreviews.com: could not connect to host
-weiji.ga: could not connect to host
+weiji.ga: did not receive HSTS header
weiler.xyz: could not connect to host
weimaraner.com.br: could not connect to host
weinhandel-preissler.de: could not connect to host
weirdserver.com: could not connect to host
-weixiaojun.org: did not receive HSTS header
+weixiaojun.org: could not connect to host
weizenke.im: could not connect to host
-wejumall.com: could not connect to host
+wejumall.com: did not receive HSTS header
wekibe.de: could not connect to host
welby.cat: did not receive HSTS header
welches-kinderfahrrad.de: could not connect to host
+welcome-tahiti.com: did not receive HSTS header
welcomehelp.de: could not connect to host
welkers.org: could not connect to host
wellastore.ru: could not connect to host
@@ -19337,22 +20226,23 @@ wenode.net: did not receive HSTS header
wenta-computerservice.net: could not connect to host
wentu.ml: could not connect to host
wenz.io: did not receive HSTS header
-wer.sh: could not connect to host
-werbeagentur.de: did not receive HSTS header
+wer.sh: did not receive HSTS header
werdeeintimo.de: could not connect to host
wereldplanner.nl: could not connect to host
werhatunsverraten.eu: could not connect to host
werken-bij-inwork.nl: could not connect to host
werkenbijkfc.nl: did not receive HSTS header
-werkplaatsoost.nl: did not receive HSTS header
+werkplaatsoost.nl: could not connect to host
werkruimtebottendaal.nl: could not connect to host
werkz.io: could not connect to host
-wes-dev.com: did not receive HSTS header
+werner-schaeffer.de: did not receive HSTS header
+wernerschaeffer.de: did not receive HSTS header
+wes-dev.com: could not connect to host
wesayyesprogram.com: could not connect to host
wesleyharris.ca: did not receive HSTS header
wespeakgeek.co.za: could not connect to host
westcoastaggregate.com: could not connect to host
-westendzone.com: max-age too low: 0
+westendzone.com: could not connect to host
westerhoud.nl: did not receive HSTS header
westhighlandwhiteterrier.com.br: could not connect to host
westlaketire.pt: did not receive HSTS header
@@ -19386,7 +20276,8 @@ whats.io: could not connect to host
whatsstalk.me: could not connect to host
whatsupdeco.com: did not receive HSTS header
whatsyouroffer.co.uk: did not receive HSTS header
-wheeler.kiwi.nz: could not connect to host
+wheatgra.in: could not connect to host
+wheelwide.co.uk: could not connect to host
wheelwright.org: did not receive HSTS header
when-release.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
when-release.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -19394,6 +20285,7 @@ whereisjason.com: could not connect to host
whereismyorigin.cf: could not connect to host
wherephoto.com: did not receive HSTS header
wheresben.today: could not connect to host
+whexit.nl: could not connect to host
whilsttraveling.com: could not connect to host
whimtrip.fr: could not connect to host
whisker.network: could not connect to host
@@ -19410,6 +20302,7 @@ whoisamitsingh.com: did not receive HSTS header
whoisapi.online: could not connect to host
whoiscuter.ml: could not connect to host
whoiscutest.ml: could not connect to host
+whoisdhh.com: could not connect to host
wholebites.com: max-age too low: 7889238
wholelotofbounce.co.uk: did not receive HSTS header
wholikes.us: did not receive HSTS header
@@ -19435,6 +20328,7 @@ wikisports.eu: did not receive HSTS header
wild-emotion-events.de: could not connect to host
wildbee.org: could not connect to host
wildbirds.dk: did not receive HSTS header
+wildboaratvparts.com: did not receive HSTS header
wildcard.hu: could not connect to host
wilddog.com: did not receive HSTS header
wilf1rst.com: could not connect to host
@@ -19443,20 +20337,20 @@ willcipriano.com: could not connect to host
willeminfo.ch: did not receive HSTS header
willemsjort.be: did not receive HSTS header
william.gg: did not receive HSTS header
-william.si: could not connect to host
+william.si: did not receive HSTS header
williamboundsltd.com: could not connect to host
-williamle.com: could not connect to host
williamsapiens.com: could not connect to host
williamsflintlocks.com: did not receive HSTS header
williamtm.design: could not connect to host
willkommen-fuerstenberg.de: did not receive HSTS header
willosagiede.com: did not receive HSTS header
+willywangstory.org: could not connect to host
wilsonovi.com: could not connect to host
wilsonvilleoregon.gov: could not connect to host
winaes.com: did not receive HSTS header
winclient.cn: could not connect to host
wind.moe: could not connect to host
-windholz.us: could not connect to host
+windholz.us: did not receive HSTS header
windows10insider.com: did not receive HSTS header
windowsforum.com: did not receive HSTS header
windowstech.it: did not receive HSTS header
@@ -19481,6 +20375,7 @@ winportal.cz: could not connect to host
winsec.nl: could not connect to host
winshiplending.com: could not connect to host
winsufi.biz: could not connect to host
+winter.engineering: could not connect to host
wintercircle.co: max-age too low: 60
wipc.net: did not receive HSTS header
wipply.com: could not connect to host
@@ -19511,8 +20406,7 @@ wittepapaver.nl: did not receive HSTS header
witting.co: could not connect to host
wittydonut.com: could not connect to host
witzemaschine.com: max-age too low: 0
-wixguide.co: did not receive HSTS header
-wiz.biz: could not connect to host
+wixguide.co: could not connect to host
wiz.farm: could not connect to host
wizardmeow.xin: could not connect to host
wizardspire.com: did not receive HSTS header
@@ -19521,7 +20415,7 @@ wk-cpm.com: could not connect to host
wk577.com: could not connect to host
wlzhiyin.cn: could not connect to host
wmawri.com: did not receive HSTS header
-wmcuk.net: did not receive HSTS header
+wmcuk.net: could not connect to host
wmfinanz.com: could not connect to host
wmoda.com.br: could not connect to host
wmustore.com: did not receive HSTS header
@@ -19531,7 +20425,6 @@ wnnc.co.uk: could not connect to host
woaiuhd.com: could not connect to host
wobblylang.org: could not connect to host
wochenentwicklung.com: did not receive HSTS header
-wochennummern.de: could not connect to host
wod-stavby.cz: could not connect to host
wodboss.com: could not connect to host
wodice.com: could not connect to host
@@ -19546,7 +20439,6 @@ wolfesden.com: could not connect to host
wolfram.io: could not connect to host
wolkenspeicher.org: could not connect to host
wollekorb.de: could not connect to host
-womb.city: could not connect to host
womf.org: did not receive HSTS header
womosale.de: could not connect to host
wonderbooks.club: could not connect to host
@@ -19554,19 +20446,19 @@ wonderfall.xyz: could not connect to host
wonderhost.info: could not connect to host
wondershift.biz: did not receive HSTS header
wondy.com: could not connect to host
+woodenson.com: did not receive HSTS header
woodlandschurch.net: max-age too low: 43200
woodmafia.com.au: could not connect to host
woodworkertip.com: could not connect to host
+woofsbakery.com: could not connect to host
woomai.net: could not connect to host
woomu.me: could not connect to host
-wooplagaming.com: could not connect to host
woording.com: could not connect to host
wootton95.com: could not connect to host
wooviet.com: could not connect to host
wopen.org: could not connect to host
wordbits.net: did not receive HSTS header
wordlessecho.com: did not receive HSTS header
-wordplay.one: could not connect to host
wordpress-test.site: could not connect to host
wordpresspro.cl: could not connect to host
wordsofamaster.com: could not connect to host
@@ -19586,7 +20478,6 @@ worldeventscalendars.com: could not connect to host
worldfree4.org: did not receive HSTS header
worldlist.org: could not connect to host
worldofterra.net: could not connect to host
-worldofvnc.net: could not connect to host
worldpovertysolutions.org: did not receive HSTS header
worldsbeststory.com: did not receive HSTS header
worldwhisperer.net: could not connect to host
@@ -19601,16 +20492,17 @@ wp-bullet.com: did not receive HSTS header
wp-fastsearch.de: could not connect to host
wp-rescue.com.au: could not connect to host
wp-stack.pro: could not connect to host
-wp6.pw: could not connect to host
+wp6.pw: did not receive HSTS header
wpblog.com.tw: could not connect to host
wpcarer.pro: could not connect to host
+wpcdn.bid: did not receive HSTS header
wpcheck.io: could not connect to host
wpcontrol.se: could not connect to host
wpdesigner.ir: did not receive HSTS header
wpdublin.com: could not connect to host
wpexplainer.com: did not receive HSTS header
wpfast.net: could not connect to host
-wpfortify.com: could not connect to host
+wpfortify.com: did not receive HSTS header
wpg-inc.com: did not receive HSTS header
wphelpwithhomework.tk: could not connect to host
wphome.org: could not connect to host
@@ -19620,6 +20512,7 @@ wplatin.com: could not connect to host
wpmetadatastandardsproject.org: could not connect to host
wprevs.com: did not receive HSTS header
wpruby.com: did not receive HSTS header
+wpsono.com: could not connect to host
wpspeed.nl: did not receive HSTS header
wpunpacked.com: could not connect to host
wpyecom.es: did not receive HSTS header
@@ -19629,7 +20522,7 @@ wrapit.hu: could not connect to host
wrapitup.co.uk: did not receive HSTS header
wrbunderwriting.com: did not receive HSTS header
wrfu.co.nz: did not receive HSTS header
-wriedts.de: could not connect to host
+wriedts.de: did not receive HSTS header
wrightdoumawedding.com: could not connect to host
writeapp.me: did not receive HSTS header
writemyessay.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
@@ -19668,6 +20561,7 @@ wurzelzwerg.net: could not connect to host
wusx.club: could not connect to host
wutianxian.com: could not connect to host
wvr-law.de: did not receive HSTS header
+wvv-8522.com: could not connect to host
wvw-8522.com: could not connect to host
wvw698.com: max-age too low: 2592000
wwbsb.xyz: could not connect to host
@@ -19681,7 +20575,7 @@ www-38978.com: could not connect to host
www-39988.com: did not receive HSTS header
www-507.net: could not connect to host
www-62755.com: could not connect to host
-www-66136.com: did not receive HSTS header
+www-66136.com: could not connect to host
www-746.com: could not connect to host
www-7570.com: did not receive HSTS header
www-771122.com: did not receive HSTS header
@@ -19719,38 +20613,59 @@ www3.info: could not connect to host
www68277.com: could not connect to host
wwww.is: could not connect to host
wwww.me.uk: could not connect to host
+wxkxsw.com: could not connect to host
wxrlab.com: could not connect to host
+wxster.com: did not receive HSTS header
wxukang.cn: could not connect to host
wxyz.buzz: could not connect to host
wy6.org: did not receive HSTS header
wybmabiity.com: could not connect to host
wygluszanie.eu: could not connect to host
-wylog.ph: could not connect to host
wyu.cc: could not connect to host
-wyzphoto.nl: did not receive HSTS header
wyzwaniemilosci.com: could not connect to host
wzfetish.com.br: could not connect to host
-x-iweb.ru: could not connect to host
x-pertservice.com: did not receive HSTS header
x-power-detox.com: could not connect to host
x-ripped-hd.com: could not connect to host
-x1be.win: did not receive HSTS header
+x1616.tk: could not connect to host
+x1be.win: could not connect to host
x23.eu: did not receive HSTS header
x2c0.net: did not receive HSTS header
x2w.io: could not connect to host
x3led.com: could not connect to host
x509.pub: could not connect to host
x509.pw: could not connect to host
+x69.biz: could not connect to host
+x69x.net: could not connect to host
xanderweaver.com: did not receive HSTS header
xandocs.com: could not connect to host
xat.re: did not receive HSTS header
xavier.is: could not connect to host
xavierbarroso.com: did not receive HSTS header
xawen.net: did not receive HSTS header
-xbc.nz: could not connect to host
+xb6638.com: max-age too low: 2592000
+xb6673.com: max-age too low: 2592000
+xb851.com: max-age too low: 2592000
+xb862.com: max-age too low: 2592000
+xb913.com: max-age too low: 2592000
+xb917.com: max-age too low: 2592000
+xb925.com: max-age too low: 2592000
+xb927.com: max-age too low: 2592000
+xb965.com: max-age too low: 2592000
+xb983.com: max-age too low: 2592000
xbertschy.com: did not receive HSTS header
xbind.io: could not connect to host
-xbpay88.com: could not connect to host
+xbyl15.com: did not receive HSTS header
+xbyl16.com: did not receive HSTS header
+xbyl21.com: did not receive HSTS header
+xbyl23.com: did not receive HSTS header
+xbyl26.com: did not receive HSTS header
+xbyl39.com: did not receive HSTS header
+xbyl63.com: did not receive HSTS header
+xbyl71.com: did not receive HSTS header
+xbyl78.com: did not receive HSTS header
+xbyl82.com: did not receive HSTS header
+xbyl91.com: did not receive HSTS header
xchangeinfo.com: could not connect to host
xchating.com: could not connect to host
xcler8.com: could not connect to host
@@ -19758,6 +20673,7 @@ xcompany.one: could not connect to host
xcoop.me: did not receive HSTS header
xd.fi: did not receive HSTS header
xd.gov: did not receive HSTS header
+xdawn.cn: could not connect to host
xdd.io: could not connect to host
xecure.zone: could not connect to host
xecureit.com: could not connect to host
@@ -19765,19 +20681,16 @@ xehoivn.vn: could not connect to host
xellos.ga: could not connect to host
xellos.ml: could not connect to host
xenesisziarovky.sk: could not connect to host
-xenolith.eu: could not connect to host
xenosphere.tk: could not connect to host
xeonlab.com: could not connect to host
xeonlab.de: could not connect to host
xett.com: did not receive HSTS header
xfive.de: could not connect to host
-xfrag-networks.com: did not receive HSTS header
xg3n1us.de: did not receive HSTS header
xgusto.com: did not receive HSTS header
xhadius.de: could not connect to host
-xiangqiushi.com: did not receive HSTS header
+xiangqiushi.com: could not connect to host
xianguocy.com: could not connect to host
-xiangweiqing.co.uk: could not connect to host
xiaody.me: could not connect to host
xiaofengsky.com: did not receive HSTS header
xiaolan.me: could not connect to host
@@ -19789,11 +20702,14 @@ xiaxuejin.cn: could not connect to host
xiazhanjian.com: did not receive HSTS header
xice.cf: could not connect to host
xilegames.com: could not connect to host
+xiliant.com: did not receive HSTS header
ximage.me: could not connect to host
ximens.me: could not connect to host
xin-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
xin-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
xinbiji.cn: could not connect to host
+xinbo270.com: max-age too low: 2592000
+xinbo676.com: did not receive HSTS header
xinex.cz: did not receive HSTS header
xing-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
xing.ml: could not connect to host
@@ -19801,27 +20717,30 @@ xinghuokeji.xin: could not connect to host
xingiahanvisa.net: did not receive HSTS header
xinnixwebshop.be: did not receive HSTS header
xinplay.net: max-age too low: 0
+xinsane.com: could not connect to host
xiongx.cn: did not receive HSTS header
xiqi.us: could not connect to host
xirion.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
xisa.it: could not connect to host
xivpn.com: could not connect to host
+xiwu.li: could not connect to host
xiyu.it: did not receive HSTS header
xiyu.moe: did not receive HSTS header
xj8876.com: max-age too low: 2592000
+xjoin.de: did not receive HSTS header
xlaff.com: did not receive HSTS header
xlboo.com: did not receive HSTS header
xlfblog.com: did not receive HSTS header
xlinar.com: could not connect to host
xlui.me: did not receive HSTS header
-xmerak.com: did not receive HSTS header
+xmerak.com: could not connect to host
+xmine128.tk: could not connect to host
xmiui.com: could not connect to host
xmlogin288.com: did not receive HSTS header
xmonk.org: did not receive HSTS header
xmr.my: could not connect to host
xn-----8kcgbo2bmdgkdacthvjf.xn--p1ai: could not connect to host
xn----7sbmucgqdbgwwc5e9b.xn--p1ai: could not connect to host
-xn--1yst51avkr.xn--6qq986b3xl: could not connect to host
xn--3lqp21gwna.cn: could not connect to host
xn--3lqp21gwna.xn--fiqs8s: could not connect to host
xn--3lqp21gwna.xn--fiqz9s: could not connect to host
@@ -19835,7 +20754,6 @@ xn--4dbjwf8c.ml: could not connect to host
xn--4dbjwf8c.tk: could not connect to host
xn--68jub.pw: could not connect to host
xn--6cv66l79sp0n0ibo7s9ne.xyz: did not receive HSTS header
-xn--6qq52xuogcjfw8pwqp.ga: could not connect to host
xn--7rvz7ku3ppnr.jp: could not connect to host
xn--7v8h.cf: could not connect to host
xn--80aaagmgvmvmcuoq7r.xn--p1ai: did not receive HSTS header
@@ -19844,17 +20762,17 @@ xn--80ablh1c.online: could not connect to host
xn--80ac0aqlt.xn--p1ai: could not connect to host
xn--80aocgsfei.xn--p1ai: could not connect to host
xn--88j2fy28hbxmnnf9zlw5buzd.com: did not receive HSTS header
-xn--8dry00a7se89ay98epsgxxq.com: did not receive HSTS header
+xn--8dry00a7se89ay98epsgxxq.com: could not connect to host
xn--8mr166hf6s.xn--fiqs8s: could not connect to host
xn--98jm6m.jp: could not connect to host
xn--9pr52k0p5a.com: did not receive HSTS header
+xn--baron-bonzenbru-elb.com: did not receive HSTS header
xn--bstlinser-v2a.com: could not connect to host
xn--c5w27q.ml: could not connect to host
xn--cckvb1cwa0c5br5e2d2711k.net: could not connect to host
xn--datenrettung-mnchen-jbc.com: did not receive HSTS header
xn--dckya4a0bya6x.com: could not connect to host
xn--dckya4a0bya6x.jp: could not connect to host
-xn--dej-3oa.lv: could not connect to host
xn--die-zahnrzte-ncb.de: did not receive HSTS header
xn--dk8haaa.ws: could not connect to host
xn--e--0g4aiy1b8rmfg3o.jp: could not connect to host
@@ -19879,16 +20797,17 @@ xn--lgb3a8bcpn.gq: could not connect to host
xn--lgb3a8bcpn.ml: could not connect to host
xn--lna-2000-9za.nu: could not connect to host
xn--lna-4000-9za.nu: could not connect to host
-xn--lnakuten-9za.com: max-age too low: 10368000
+xn--lnakuten-9za.com: did not receive HSTS header
xn--ls8hi7a.tk: could not connect to host
xn--maraa-rta.org: could not connect to host
xn--mensenges-o1a8c.gq: could not connect to host
-xn--mhringen-65a.de: did not receive HSTS header
xn--mhsv04avtt1xi.com: could not connect to host
xn--milchaufschumer-test-lzb.de: could not connect to host
xn--n8jubz39q0g0afpa985c.com: could not connect to host
xn--neb-tma3u8u.xyz: could not connect to host
+xn--nf1a578axkh.xn--fiqs8s: did not receive HSTS header
xn--o77hka.ga: could not connect to host
+xn--oiqt18e8e2a.eu.org: could not connect to host
xn--p8jskj.jp: could not connect to host
xn--pck4e3a2ex597b4ml.xyz: did not receive HSTS header
xn--pckqk6xk43lunk.net: could not connect to host
@@ -19897,10 +20816,11 @@ xn--qckyd1cu698a35zarib.xyz: could not connect to host
xn--qfun83b.ga: could not connect to host
xn--r77hya.ga: could not connect to host
xn--rt-cja.eu: could not connect to host
-xn--rtter-kva.eu: could not connect to host
xn--sdkwa9azd389v01ya.com: could not connect to host
+xn--seelenwchter-mcb.eu: did not receive HSTS header
xn--srenpind-54a.dk: could not connect to host
xn--t8j2a3042d.xyz: could not connect to host
+xn--t8j4aa4nyhxa7duezbl49aqg5546e264d.net: did not receive HSTS header
xn--tda.ml: could not connect to host
xn--thorme-6uaf.ca: could not connect to host
xn--trdler-xxa.xyz: could not connect to host
@@ -19921,6 +20841,7 @@ xn--y8j5gq14rbdd.net: did not receive HSTS header
xn--yj8h0m.ws: could not connect to host
xn--ykrp42k.com: could not connect to host
xn--yoamomisuasbcn-ynb.com: could not connect to host
+xn--yrvp1ac68c.xn--6qq986b3xl: could not connect to host
xn--zck9a4b352yuua.jp: did not receive HSTS header
xn--zr9h.cf: could not connect to host
xn--zr9h.ga: could not connect to host
@@ -19930,11 +20851,12 @@ xng.io: did not receive HSTS header
xnode.org: could not connect to host
xobox.me: could not connect to host
xoda.pw: could not connect to host
-xoffy.com: could not connect to host
+xoffy.com: did not receive HSTS header
xom.party: could not connect to host
xombra.com: could not connect to host
xoonth.net: did not receive HSTS header
xor-a.net: could not connect to host
+xotika.tv: could not connect to host
xpbytes.com: did not receive HSTS header
xpenology-fr.net: could not connect to host
xperiacodes.com: could not connect to host
@@ -19942,10 +20864,11 @@ xpi.fr: could not connect to host
xpj.bet: did not receive HSTS header
xpj.sx: could not connect to host
xpjcunkuan.com: could not connect to host
-xplore-dna.net: did not receive HSTS header
+xplore-dna.net: could not connect to host
+xposedornot.com: did not receive HSTS header
xpressprint.com.br: max-age too low: 90
-xps2pdf.co.uk: could not connect to host
-xps2pdf.info: could not connect to host
+xps2pdf.co.uk: did not receive HSTS header
+xps2pdf.info: did not receive HSTS header
xpwn.cz: did not receive HSTS header
xq55.com: did not receive HSTS header
xqin.net: could not connect to host
@@ -19968,14 +20891,18 @@ xtrim.ru: did not receive HSTS header
xtzone.be: could not connect to host
xuan-li88.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
xuan-li88.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-xuanmeishe.top: could not connect to host
+xuanmeishe.top: did not receive HSTS header
xuexb.com: did not receive HSTS header
+xujan.com: could not connect to host
xuntaosms.com: could not connect to host
xupeng.me: did not receive HSTS header
+xvii.pl: could not connect to host
xxbase.com: could not connect to host
xxx3dbdsm.com: could not connect to host
+xxxladyboysporn.com: could not connect to host
+xxxred.net: could not connect to host
xy1919.com: could not connect to host
-xyndrac.net: max-age too low: 2592000
+xy7171.com: could not connect to host
xynex.us: could not connect to host
xyngular-health.com: did not receive HSTS header
xynta.ch: could not connect to host
@@ -19996,11 +20923,12 @@ yalla.jp: did not receive HSTS header
yamamo10.com: could not connect to host
yameveo.com: did not receive HSTS header
yannikhenke.de: could not connect to host
+yannis.codes: did not receive HSTS header
yanwh.xyz: did not receive HSTS header
yao-in.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
yao-in.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
-yaoidreams.com: did not receive HSTS header
-yaporn.tv: did not receive HSTS header
+yaoidreams.com: could not connect to host
+yaporn.tv: could not connect to host
yarchives.jp: could not connect to host
yard-fu.com: could not connect to host
yardbird.us: could not connect to host
@@ -20011,13 +20939,16 @@ yasutomonodokoiko.com: did not receive HSTS header
yaucy.win: could not connect to host
yawen.tw: did not receive HSTS header
yawnbox.com: did not receive HSTS header
+yaxim.org: could not connect to host
yayart.club: could not connect to host
+yayoba.com: did not receive HSTS header
yazaral.com: did not receive HSTS header
ybscareers.co.uk: did not receive HSTS header
ybt520.com: could not connect to host
ycaaz.com: did not receive HSTS header
ycc.wtf: could not connect to host
ycm2.wtf: could not connect to host
+yd.io: could not connect to host
ydy.jp: could not connect to host
yello.website: could not connect to host
yellowcar.website: could not connect to host
@@ -20034,7 +20965,6 @@ yepbitcoin.com: could not connect to host
yesdevnull.net: did not receive HSTS header
yesfone.com.br: could not connect to host
yeshu.org: could not connect to host
-yesiammaisey.me: could not connect to host
yestees.com: did not receive HSTS header
yetcore.io: could not connect to host
yetishirt.com: could not connect to host
@@ -20042,6 +20972,12 @@ yffengshi.ml: could not connect to host
ygcdyf.com: did not receive HSTS header
yggdar.ga: could not connect to host
yh35.net: could not connect to host
+yh56787.com: could not connect to host
+yh64678.com: could not connect to host
+yh66656.com: could not connect to host
+yh66689.com: could not connect to host
+yh811.com: could not connect to host
+yh88890.com: could not connect to host
yhori.xyz: could not connect to host
yhwj.top: could not connect to host
yibaoweilong.top: could not connect to host
@@ -20059,51 +20995,54 @@ yingsuo.ltd: could not connect to host
yingyj.com: did not receive HSTS header
yinhe12.net: did not receive HSTS header
yipingguo.com: could not connect to host
-yippie.nl: could not connect to host
+yippie.nl: did not receive HSTS header
yizhu.com: could not connect to host
+yjsoft.me: could not connect to host
yjsw.sh.cn: could not connect to host
-ylde.de: could not connect to host
+ylilauta.org: could not connect to host
ylk.io: could not connect to host
-ylwz.cc: could not connect to host
+ylwz.cc: did not receive HSTS header
+ymblaw.com: did not receive HSTS header
ynnovasport.be: could not connect to host
ynode.co: did not receive HSTS header
ynsn.nl: could not connect to host
yntongji.com: could not connect to host
ynxfh.cn: did not receive HSTS header
yob.vn: could not connect to host
-yobai28.com: did not receive HSTS header
yobst.tk: could not connect to host
yocchan1513.net: did not receive HSTS header
yoga-prive.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
yoga.is-an-engineer.com: could not connect to host
+yogabhawnamission.com: could not connect to host
yogatrainingrishikesh.com: could not connect to host
yogoeasy.com: did not receive HSTS header
yohanesmario.com: did not receive HSTS header
yoiyado.info: did not receive HSTS header
yokeepo.com: could not connect to host
yolo-csgo.com: could not connect to host
-yolocelebs.com: did not receive HSTS header
+yolocelebs.com: could not connect to host
yoloprod.fr: could not connect to host
yoloseo.com: could not connect to host
yomena.in: could not connect to host
yomepre.com: could not connect to host
-yooooex.com: did not receive HSTS header
yopers.com: did not receive HSTS header
-yoramvandevelde.net: could not connect to host
yorkshireterrier.com.br: could not connect to host
yoru.me: could not connect to host
+yosemo.de: did not receive HSTS header
yosheenetwork.fr: could not connect to host
yotilab.com: could not connect to host
yotilabs.com: could not connect to host
-youcaitian.com: could not connect to host
+youcaitian.com: did not receive HSTS header
youcancraft.de: could not connect to host
youcontrol.ru: could not connect to host
youdowell.com: did not receive HSTS header
youfencun.com: did not receive HSTS header
youftp.tk: could not connect to host
yougot.pw: could not connect to host
+youhs.top: did not receive HSTS header
+youjizz.bz: could not connect to host
youlend.com: did not receive HSTS header
-youlog.net: could not connect to host
+youlog.net: did not receive HSTS header
youmonit.me: could not connect to host
youngandunited.nl: did not receive HSTS header
younl.net: could not connect to host
@@ -20128,13 +21067,13 @@ yousite.by: could not connect to host
youth2009.org: max-age too low: 2592000
youtube: could not connect to host
youtubeviews.ml: could not connect to host
-youwatchporn.com: did not receive HSTS header
-youyoulemon.com: could not connect to host
+youwatchporn.com: could not connect to host
ypcs.fi: did not receive HSTS header
ypiresia.fr: could not connect to host
yryz.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
yspeo.biz: did not receive HSTS header
yspeo.com: max-age too low: 2592000
+ysun.xyz: could not connect to host
ysx.me.uk: did not receive HSTS header
ytb.zone: did not receive HSTS header
ytbmp3.com: did not receive HSTS header
@@ -20150,9 +21089,11 @@ yudan.com.br: could not connect to host
yude.ml: could not connect to host
yuema.net.cn: could not connect to host
yufan.me: did not receive HSTS header
+yugasun.com: could not connect to host
yugege.cf: could not connect to host
yuhen.ru: did not receive HSTS header
yui.cat: did not receive HSTS header
+yuisyo.ml: did not receive HSTS header
yuka.one: could not connect to host
yuki-portfolio.com: did not receive HSTS header
yukijinji.moe: did not receive HSTS header
@@ -20178,21 +21119,25 @@ yuqi.me: could not connect to host
yurinet.org: could not connect to host
yuriykuzmin.com: did not receive HSTS header
yutabon.com: could not connect to host
-yutang.vn: could not connect to host
+yutang.vn: did not receive HSTS header
yutaron.tokyo: did not receive HSTS header
+yutuo.net: did not receive HSTS header
yuushou.com: could not connect to host
+yuuta.moe: did not receive HSTS header
yux.fr: could not connect to host
yux.io: did not receive HSTS header
yuxingxin.com: did not receive HSTS header
yuzu.tk: did not receive HSTS header
-yvesx.com: did not receive HSTS header
yvetteerasmus.com: max-age too low: 0
ywei.org: could not connect to host
ywyz.tech: could not connect to host
yya.bid: did not receive HSTS header
yya.men: could not connect to host
yyrss.com: could not connect to host
+yyy116.com: could not connect to host
+yyy608.com: could not connect to host
z-coder.com: could not connect to host
+z-konzept-nutrition.ru: could not connect to host
z-to-a.com: did not receive HSTS header
z0rro.net: could not connect to host
z33.ch: did not receive HSTS header
@@ -20208,20 +21153,16 @@ zachpeters.org: did not receive HSTS header
zadieheimlich.com: did not receive HSTS header
zadroweb.com: did not receive HSTS header
zaem.tv: could not connect to host
+zaffit.com: could not connect to host
zahnrechner-staging.azurewebsites.net: could not connect to host
zahyantechnologies.com: did not receive HSTS header
-zaidan.de: did not receive HSTS header
-zaidan.eu: did not receive HSTS header
-zaidanfood.com: did not receive HSTS header
-zaidanfood.eu: did not receive HSTS header
-zaidanlebensmittelhandel.de: did not receive HSTS header
-zakoncontrol.com: max-age too low: 5184000
zalan.do: could not connect to host
zalohovaniburian.cz: could not connect to host
-zamis.net: did not receive HSTS header
+zamis.net: could not connect to host
zamorano.edu: could not connect to host
zamos.ru: max-age too low: 0
zaneweb.org: could not connect to host
+zanzabar.it: could not connect to host
zao.fi: could not connect to host
zaoext.com: could not connect to host
zaoshanghao-dajia.rhcloud.com: could not connect to host
@@ -20231,6 +21172,7 @@ zappos.com: did not receive HSTS header
zaptan.net: could not connect to host
zaptan.org: could not connect to host
zaptan.us: could not connect to host
+zaratan.fr: did not receive HSTS header
zargaripour.com: did not receive HSTS header
zarooba.com: could not connect to host
zavca.com: did not receive HSTS header
@@ -20242,15 +21184,17 @@ zbigniewgalucki.eu: did not receive HSTS header
zbp.at: did not receive HSTS header
zdravesteny.cz: could not connect to host
zdravotnickasluzba.eu: could not connect to host
-zdrowiepaleo.pl: could not connect to host
+zdrowiepaleo.pl: did not receive HSTS header
zdx.ch: max-age too low: 0
zeb.fun: could not connect to host
+zebedeescastles.co.uk: could not connect to host
zebibyte.cn: did not receive HSTS header
zebrababy.cn: could not connect to host
zebry.nl: did not receive HSTS header
zecrypto.com: could not connect to host
zeedroom.be: did not receive HSTS header
zeelynk.com: could not connect to host
+zeeuw.nl: did not receive HSTS header
zefiris.org: did not receive HSTS header
zefu.ca: could not connect to host
zehdenick-bleibt-bunt.de: could not connect to host
@@ -20263,9 +21207,9 @@ zelfstandigemakelaars.net: could not connect to host
zellari.ru: did not receive HSTS header
zeloz.xyz: could not connect to host
zenfusion.fr: could not connect to host
-zengdong.ren: could not connect to host
zenhaiku.com: could not connect to host
zenics.co.uk: did not receive HSTS header
+zenithmedia.ca: could not connect to host
zenmate.com.tr: could not connect to host
zeno-system.com: did not receive HSTS header
zenpayroll.com: did not receive HSTS header
@@ -20282,14 +21226,15 @@ zepect.com: did not receive HSTS header
zera.com.au: could not connect to host
zerekin.net: max-age too low: 86400
zero-sum.xyz: could not connect to host
-zero-x-baadf00d.com: could not connect to host
+zero-x-baadf00d.com: did not receive HSTS header
zerocool.io: could not connect to host
zeroday.sk: did not receive HSTS header
zerofox.gq: could not connect to host
+zerolab.org: could not connect to host
zeroling.com: could not connect to host
zeroml.ml: could not connect to host
zerosource.net: could not connect to host
-zerowastesonoma.gov: could not connect to host
+zerowastesonoma.gov: did not receive HSTS header
zertif.info: could not connect to host
zerudi.com: did not receive HSTS header
zetadisseny.es: did not receive HSTS header
@@ -20301,19 +21246,20 @@ zewtie.com: could not connect to host
zeytin.pro: could not connect to host
zfo.gg: could not connect to host
zgan.ga: could not connect to host
+zh-yds.com: could not connect to host
zh1.li: could not connect to host
zhang.wtf: could not connect to host
zhangcheng.org: did not receive HSTS header
+zhangge.net: did not receive HSTS header
zhangruilin.com: did not receive HSTS header
zhangsir.net: could not connect to host
zhaochen.xyz: could not connect to host
zhaojin97.cn: could not connect to host
zhendingresources.com: did not receive HSTS header
-zhenmeish.com: could not connect to host
+zhenmeish.com: did not receive HSTS header
zhenyan.org: could not connect to host
zhh.in: could not connect to host
zhihua-lai.com: did not receive HSTS header
-zhiin.net: could not connect to host
zhikin.com: could not connect to host
zhimajk.com: could not connect to host
zhoujiashu.com: could not connect to host
@@ -20334,23 +21280,22 @@ zippy-download.de: could not connect to host
zirka24.net: could not connect to host
zirtue.io: could not connect to host
zitrone44.de: did not receive HSTS header
+zivagold.com: did not receive HSTS header
zivy-ruzenec.cz: could not connect to host
zixo.sk: could not connect to host
ziyuanabc.xyz: could not connect to host
-ziz.exchange: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+ziz.exchange: could not connect to host
zizoo.com: did not receive HSTS header
-zju.tv: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
+zju.tv: could not connect to host
zjubtv.com: could not connect to host
zjuqsc.com: could not connect to host
zjutv.com: could not connect to host
zjyifa.cn: could not connect to host
zkillboard.com: did not receive HSTS header
zking.ga: could not connect to host
-zl0iu.com: did not receive HSTS header
-zl8862.com: did not receive HSTS header
zlc1994.com: did not receive HSTS header
zlcp.com: could not connect to host
-zmala.com: did not receive HSTS header
+zmala.com: could not connect to host
zmsastro.co.za: could not connect to host
zmscable.com: did not receive HSTS header
zmy.im: could not connect to host
@@ -20358,14 +21303,13 @@ znacite.com: did not receive HSTS header
znd.jp: could not connect to host
zning.net.cn: could not connect to host
zny.pw: could not connect to host
-zobraz.cz: could not connect to host
zocken.com: did not receive HSTS header
zoe.vc: could not connect to host
zohar.link: could not connect to host
zohar.shop: could not connect to host
zoi.jp: could not connect to host
+zojadravai.com: could not connect to host
zokster.net: could not connect to host
-zollihood.ch: could not connect to host
zolokar.xyz: could not connect to host
zolotoy-standart.com.ua: did not receive HSTS header
zombiesecured.com: could not connect to host
@@ -20378,6 +21322,7 @@ zoo.city: could not connect to host
zoo24.de: did not receive HSTS header
zoofaeth.de: did not receive HSTS header
zoofit.com.au: did not receive HSTS header
+zoological-gardens.eu: could not connect to host
zoomingin.net: max-age too low: 5184000
zoommailing.com: did not receive HSTS header
zoomseoservices.com: max-age too low: 2592000
@@ -20393,7 +21338,9 @@ zq789.com: could not connect to host
zqhong.com: could not connect to host
zqjs.tk: could not connect to host
zqstudio.top: could not connect to host
+zrkr.de: could not connect to host
zrn.in: did not receive HSTS header
+zrt.io: did not receive HSTS header
ztan.tk: could not connect to host
ztcaoll222.cn: could not connect to host
ztytian.com: could not connect to host
@@ -20418,7 +21365,7 @@ zwalcz-cellulit.com: did not receive HSTS header
zwembadheeten.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /home/trava90/REPO/UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 131" data: no]
zx1168.com: could not connect to host
zx2268.com: could not connect to host
-zxavier.com: did not receive HSTS header
+zxavier.com: could not connect to host
zxity.co.uk: could not connect to host
zxity.ltd: could not connect to host
zxity.uk: could not connect to host
@@ -20429,6 +21376,7 @@ zymbit.com: did not receive HSTS header
zync.ca: did not receive HSTS header
zypgr.com: could not connect to host
zypr.pw: could not connect to host
+zyrillezuno.com: could not connect to host
zyso.org: could not connect to host
zz295.com: did not receive HSTS header
zzb510.com: could not connect to host
diff --git a/security/manager/ssl/nsSTSPreloadList.inc b/security/manager/ssl/nsSTSPreloadList.inc
index 6fe05d42f9..b81766c3fc 100644
--- a/security/manager/ssl/nsSTSPreloadList.inc
+++ b/security/manager/ssl/nsSTSPreloadList.inc
@@ -8,7 +8,7 @@
/*****************************************************************************/
#include <stdint.h>
-const PRTime gPreloadListExpirationTime = INT64_C(1557317989028000);
+const PRTime gPreloadListExpirationTime = INT64_C(1559822263960000);
class nsSTSPreload
{
@@ -18,7 +18,14 @@ class nsSTSPreload
};
static const nsSTSPreload kSTSPreloadList[] = {
+ { "000books.net", true },
+ { "003971.com", true },
+ { "008207.com", true },
+ { "008251.com", true },
+ { "008253.com", true },
+ { "008271.com", true },
{ "0086286.com", true },
+ { "009p.com", true },
{ "00dani.me", true },
{ "00f.net", true },
{ "0100dev.com", false },
@@ -27,6 +34,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "01110000011100110111001001100111.com", true },
{ "01electronica.com.ar", true },
{ "01seguridad.com.ar", true },
+ { "021002.com", true },
{ "022367.com", true },
{ "022379.com", true },
{ "022391.com", true },
@@ -45,16 +53,67 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "03170317.com", true },
{ "0391315.com", true },
{ "046569.com", true },
- { "04911701.cn", true },
{ "050.ca", true },
+ { "050869.com", true },
{ "050media.nl", true },
{ "0511315.net", true },
{ "0513c.com", true },
+ { "056657.com", true },
+ { "056675.com", true },
+ { "056679.com", true },
+ { "056687.com", true },
+ { "056690.com", true },
+ { "056697.com", true },
+ { "056867.com", true },
+ { "056869.com", true },
+ { "056875.com", true },
+ { "056879.com", true },
+ { "056950.com", true },
+ { "056976.com", true },
+ { "056985.com", true },
{ "0573wk.com", true },
+ { "057587.com", true },
+ { "057596.com", true },
+ { "058509.com", true },
+ { "058596.com", true },
+ { "058679.com", true },
+ { "059957.com", true },
+ { "060757.com", true },
+ { "060795.com", true },
+ { "060796.com", true },
+ { "060798.com", true },
+ { "0607p.com", true },
+ { "060870.com", true },
+ { "060875.com", true },
{ "06091994.xyz", true },
+ { "065679.com", true },
+ { "065706.com", true },
+ { "065790.com", true },
+ { "065970.com", true },
+ { "065976.com", true },
+ { "066570.com", true },
+ { "066579.com", true },
+ { "066590.com", true },
+ { "066705.com", true },
+ { "066709.com", true },
+ { "066790.com", true },
+ { "068697.com", true },
+ { "068756.com", true },
+ { "068957.com", true },
+ { "069657.com", true },
+ { "069676.com", true },
+ { "0708p.com", true },
+ { "070968.com", true },
+ { "070986.com", true },
+ { "0720p.com", true },
+ { "077768.net", true },
{ "0788yh.com", true },
{ "0792112.com", true },
+ { "079606.com", true },
+ { "079607.com", true },
+ { "0798rcw.com", true },
{ "0809yh.com", true },
+ { "081115.com", true },
{ "081752.com", true },
{ "081763.com", true },
{ "081769.com", true },
@@ -83,7 +142,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "083962.com", true },
{ "083965.com", true },
{ "083967.com", true },
- { "08detaxe.fr", true },
+ { "085806.com", true },
+ { "085905.com", true },
+ { "085950.com", true },
+ { "086807.com", true },
+ { "086907.com", true },
+ { "087059.com", true },
+ { "087065.com", true },
+ { "087540.com", true },
+ { "087569.com", true },
+ { "087580.com", true },
{ "0916app.com", true },
{ "09892.net", true },
{ "0au.de", true },
@@ -94,19 +162,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "0ik.de", true },
{ "0iz.net", true },
{ "0knowledge.de", false },
- { "0o0.edu.pl", true },
{ "0paste.com", true },
+ { "0vo.moe", true },
{ "0wx.cat", true },
{ "0wx.es", true },
{ "0wx.eu", true },
{ "0wx.org", true },
{ "0x.cx", true },
{ "0x.sk", true },
- { "0x0.cloud", true },
{ "0x0.li", true },
{ "0x00ff00ff.com", true },
{ "0x17.de", true },
{ "0x378.net", true },
+ { "0x41.us", true },
{ "0x48.pw", true },
{ "0x52.net", true },
{ "0x7d.com", true },
@@ -114,10 +182,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "0x90.io", true },
{ "0xabe.io", true },
{ "0xacab.org", true },
+ { "0xaf.tk", true },
{ "0xda.de", true },
{ "0xdc.io", false },
{ "0xdefaced.de", true },
{ "0xee.eu", true },
+ { "0xf00.ch", true },
{ "0xfc.de", true },
{ "0xn.de", true },
{ "0yen.org", true },
@@ -148,26 +218,29 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "10439.net", true },
{ "10453.net", true },
{ "10495.net", true },
+ { "1066.io", true },
{ "10774.net", true },
{ "10840.net", true },
{ "10gb.io", true },
{ "10hz.de", true },
{ "10og.de", true },
{ "10ppm.com", true },
+ { "110320.com", true },
+ { "110692.com", true },
+ { "1126p.com", true },
{ "112app.nl", true },
{ "112hz.com", true },
+ { "112it.ro", true },
+ { "1130p.com", true },
{ "114514ss.com", true },
{ "1177107.com", true },
{ "11dzon.com", true },
{ "11loc.de", true },
{ "11thstreetcoffee.com", true },
{ "11urss.com", true },
+ { "120323.com", true },
{ "1212873467.rsc.cdn77.org", true },
{ "1218641649.rsc.cdn77.org", true },
- { "123.gg", true },
- { "123110.com", true },
- { "1231212.com", true },
- { "123123q.com", true },
{ "123123qq.com", true },
{ "123apps.net", true },
{ "123bearing.co.uk", true },
@@ -176,24 +249,39 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "123comparer.fr", true },
{ "123djdrop.com", true },
{ "123midterm.com", true },
- { "123nutricion.es", true },
{ "123opstalverzekeringen.nl", true },
- { "123plons.nl", true },
{ "123roulement.be", true },
{ "123roulement.com", true },
{ "123writings.com", true },
{ "124133.com", true },
{ "124633.com", true },
{ "125m125.de", true },
- { "1288fc.com", true },
- { "12photos.eu", true },
+ { "126772.com", true },
+ { "127661.com", true },
+ { "127662.com", true },
+ { "127663.com", true },
+ { "127665.com", true },
+ { "12autoankauf-berlin.de", true },
{ "12thmanrising.com", true },
{ "12train.com", true },
{ "12vpn.net", true },
{ "130.ua", true },
+ { "130032.com", true },
+ { "130212.com", true },
+ { "130232.com", true },
+ { "131934.com", true },
+ { "131954.com", true },
+ { "132302.com", true },
{ "132kv.ch", true },
+ { "133294.com", true },
+ { "133492.com", true },
{ "1359826938.rsc.cdn77.org", true },
- { "13th-dover.uk", true },
+ { "136774.com", true },
+ { "136814.com", true },
+ { "136924.com", true },
+ { "137724.com", true },
+ { "138000.xyz", true },
+ { "141145.com", true },
{ "143533.com", true },
{ "143633.com", true },
{ "143733.com", true },
@@ -219,26 +307,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "154933.com", true },
{ "156433.com", true },
{ "1590284872.rsc.cdn77.org", true },
- { "159cp.com", true },
{ "1600esplanade.com", true },
{ "160887.com", true },
+ { "161263.com", true },
+ { "162361.com", true },
{ "162jonesrd.ca", true },
{ "1644091933.rsc.cdn77.org", true },
{ "1661237.com", true },
{ "1750studios.com", false },
{ "1768calc.com.au", true },
+ { "177603.com", true },
+ { "17xile.com", true },
{ "1811559.com", true },
{ "1844329061.rsc.cdn77.org", true },
{ "1876996.com", true },
+ { "18888msc.com", true },
+ { "1889p.com", true },
{ "188da.com", true },
{ "188dv.com", true },
- { "189fc.com", true },
- { "18celebration.com", true },
- { "18celebration.org", true },
+ { "1895media.com", true },
{ "18f.gov", true },
{ "18f.gsa.gov", false },
{ "1911trust.com", true },
- { "192.io", true },
{ "192433.com", true },
{ "1972969867.rsc.cdn77.org", true },
{ "1981612088.rsc.cdn77.org", true },
@@ -247,14 +337,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "1a-diamantscheiben.de", true },
{ "1a-werkstattgeraete.de", true },
{ "1ab-machinery.com", true },
+ { "1android.de", true },
{ "1c-power.ru", true },
{ "1cover.co.nz", true },
{ "1cover.com.au", true },
{ "1cswd.com", true },
{ "1e9.nl", true },
{ "1f123.net", true },
+ { "1f412.space", true },
{ "1fach-digital.de", true },
+ { "1gp.us", true },
{ "1hourproofreading.com", true },
+ { "1in9.net", true },
{ "1it.click", true },
{ "1js.de", true },
{ "1kando.com", false },
@@ -283,6 +377,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "1st-bounce.co.uk", true },
{ "1st-community.de", true },
{ "1stchoicefun.co.uk", true },
+ { "1stchoicelandscapingwa.com", true },
{ "1stclassbouncycastles.co.uk", true },
{ "1stforfun.co.uk", true },
{ "1stpeninsulabouncers.co.uk", true },
@@ -291,24 +386,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "1whw.co.uk", true },
{ "1wirelog.de", true },
{ "1wl.uk", true },
+ { "1zombie.team", true },
{ "2.wtf", true },
{ "200.network", true },
+ { "2001y.me", false },
{ "2012.ovh", true },
{ "20188088.com", true },
+ { "2083236893.com", true },
{ "20at.com", true },
{ "20denier.com", true },
{ "215dy.net", true },
{ "21sthammersmith.org.uk", true },
{ "21stnc.us", true },
{ "21x9.org", true },
+ { "2206p.com", true },
{ "222001.com", true },
{ "2222yh.com", true },
+ { "22delta.com", true },
{ "22vetter.st", true },
{ "230beats.com", true },
- { "23333.link", true },
+ { "232192.com", true },
{ "2333666.xyz", true },
{ "2333blog.com", true },
- { "233abc.com", false },
{ "233blog.com", true },
{ "233boy.com", true },
{ "233bwg.com", true },
@@ -318,12 +417,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "233vps.com", true },
{ "233yes.com", true },
{ "24-7.jp", true },
+ { "24.ie", true },
{ "245meadowvistaway.com", true },
{ "246060.ru", true },
{ "247exchange.com", true },
{ "247healthshop.com", true },
{ "247medplan.com", true },
{ "2495dentalimplants.com", true },
+ { "249722.com", true },
{ "24dian30.com", true },
{ "24hour-locksmithsanantonio.com", true },
{ "24hourcyclist.co.uk", true },
@@ -335,9 +436,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "24ip.com", true },
{ "24ip.de", true },
{ "24ip.fr", true },
+ { "24items.com", true },
{ "24timeravis.dk", true },
{ "24zpravy.cz", true },
{ "256pages.com", false },
+ { "2586p.com", true },
{ "25reinyan25.net", true },
{ "2600edinburgh.org", true },
{ "2600hq.com", true },
@@ -397,7 +500,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "2y.fi", true },
{ "3-dot-careapp1-146314.appspot.com", true },
{ "300m.com", false },
+ { "301.technology", true },
{ "302422.com", true },
+ { "303112.com", true },
{ "303422.com", true },
{ "304122.com", true },
{ "304322.com", true },
@@ -411,7 +516,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "314122.com", true },
{ "314322.com", true },
{ "314522.com", true },
- { "314553.com", true },
{ "314622.com", true },
{ "314633.com", true },
{ "314922.com", true },
@@ -440,6 +544,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "33445222.com", true },
{ "33445333.com", true },
{ "33445444.com", true },
+ { "3351p.com", true },
{ "33jiasu.com", true },
{ "340422.com", true },
{ "340622.com", true },
@@ -490,10 +595,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "354933.com", true },
{ "356433.com", true },
{ "357maelai.co", true },
+ { "360-staffing.com", true },
{ "360live.fr", true },
{ "360rail.nl", true },
{ "360vrs.com", true },
- { "364553.com", true },
{ "365365.com", true },
{ "365beautyworld.com", true },
{ "365daysreview.com", true },
@@ -506,9 +611,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "373422.com", true },
{ "374933.com", true },
{ "375422.com", true },
+ { "376208.com", true },
{ "379700.com", true },
{ "380422.com", true },
+ { "3880p.com", true },
{ "388da.com", true },
+ { "38sihu.com", false },
{ "390422.com", true },
{ "392422.com", true },
{ "393335.ml", true },
@@ -517,10 +625,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "394122.com", true },
{ "394322.com", true },
{ "394522.com", true },
- { "394553.com", true },
{ "394622.com", true },
{ "394922.com", true },
{ "396422.com", true },
+ { "398.info", true },
{ "3aandl.com", true },
{ "3ags.de", true },
{ "3amtoolbox.se", true },
@@ -560,12 +668,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "3niu8888.com", true },
{ "3niuurl.com", true },
{ "3os.ooo", true },
- { "3phase.pw", true },
{ "3plusdesign.gr", true },
{ "3prn.com", true },
{ "3queens.cz", true },
{ "3queens.io", true },
{ "3r.org.uk", true },
+ { "3rsee.com", true },
{ "3s-datasolution.de", true },
{ "3s-datasolutions.de", true },
{ "3s-ddns.de", true },
@@ -579,11 +687,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "3shosting.de", true },
{ "3smail.de", true },
{ "3timegear.com", true },
- { "3trees.tk", true },
{ "3tribes.co.uk", true },
{ "3typen.tv", true },
{ "3v4l.org", true },
{ "3vlnaeet.cz", true },
+ { "3xbit.com.br", true },
{ "4-1-where.com", true },
{ "4-it.de", true },
{ "4000milestare.com", false },
@@ -593,11 +701,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "4096bit.de", false },
{ "40acts.org.uk", true },
{ "41-where.com", true },
+ { "4111pk.com", true },
{ "411416.com", true },
{ "41199.com", true },
{ "411film.com", true },
{ "411movie.com", true },
- { "414553.com", true },
+ { "411quest.com", true },
+ { "4138hd.com", true },
{ "41studio.com", true },
{ "41where.com", true },
{ "420java.com", true },
@@ -607,31 +717,34 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "440887.com", true },
{ "440hz.radio", true },
{ "441jj.com", false },
+ { "441jz.com", false },
{ "442887.com", true },
+ { "442jz.com", false },
{ "443887.com", true },
+ { "443jz.com", false },
{ "4444yh.com", true },
{ "444887.com", true },
{ "445887.com", true },
{ "44sec.com", true },
{ "451.ooo", true },
- { "4553s.com", true },
+ { "46fa.com", true },
{ "4706666.com", true },
{ "4716666.com", true },
{ "4726666.com", true },
- { "4736666.com", true },
{ "4756666.com", true },
{ "4786666.com", true },
{ "491mhz.net", true },
+ { "494k.com", true },
{ "49889.com", true },
{ "49dollaridahoregisteredagent.com", true },
{ "4c-haircare.com", true },
- { "4everproxy.com", true },
{ "4eyes.ch", true },
{ "4fit.ro", true },
{ "4flex.info", true },
{ "4freepress.com", true },
{ "4g-server.eu", false },
{ "4garage.com.br", true },
+ { "4hmediaproductions.com", true },
{ "4host.ch", true },
{ "4kprojektory.cz", true },
{ "4lock.com.br", true },
@@ -651,32 +764,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "4xlabs.co", true },
{ "50.gd", true },
{ "50.pe", true },
- { "500a500.com", true },
- { "500b500.com", true },
- { "500c500.com", true },
- { "500d500.com", true },
- { "500e500.com", true },
- { "500f500.com", true },
- { "500g500.com", true },
- { "500h500.com", true },
- { "500i500.com", true },
- { "500j500.com", true },
+ { "5002888.com", true },
+ { "5007999.com", true },
{ "500k.nl", true },
- { "500k500.com", true },
- { "500l500.com", true },
- { "500m500.com", true },
- { "500n500.com", true },
- { "500o500.com", true },
{ "500p.xyz", true },
- { "500p500.com", true },
- { "500pingtai.com", true },
- { "500q500.com", true },
- { "500r500.com", true },
- { "500s500.com", true },
- { "500t500.com", true },
- { "500u500.com", true },
- { "500y500.com", true },
- { "500z500.com", true },
{ "504122.com", true },
{ "504322.com", true },
{ "504622.com", true },
@@ -694,18 +785,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "51877.net", true },
{ "519422.com", true },
{ "51acg.eu.org", true },
+ { "51aifuli.com", true },
+ { "51guaq.com", true },
{ "51tiaojiu.com", true },
{ "5219.ml", true },
{ "524022.com", true },
{ "524622.com", true },
{ "524922.com", true },
{ "525.info", true },
+ { "5287.com", true },
{ "52hentai.ml", true },
- { "52hentai.us", true },
{ "52kb365.com", true },
{ "52ncp.net", true },
{ "52sykb.com", true },
{ "531422.com", true },
+ { "532441.com", true },
+ { "532445.com", true },
{ "534122.com", true },
{ "534622.com", true },
{ "534922.com", true },
@@ -726,19 +821,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "5518k3.com", true },
{ "5533445.com", true },
{ "5555yh.com", true },
+ { "555wfcp.com", true },
{ "55639.com", true },
- { "558da.com", true },
{ "566380.com", true },
{ "575380.com", true },
{ "576422.com", true },
{ "578380.com", true },
{ "579422.com", true },
{ "57wilkie.net", true },
+ { "581018.com", true },
{ "583422.com", true },
{ "585380.com", true },
{ "585422.com", true },
{ "586422.com", true },
- { "588da.com", true },
+ { "588l.com", true },
+ { "58nav.com", true },
{ "591380.com", true },
{ "591422.com", true },
{ "592380.com", true },
@@ -752,9 +849,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "598380.com", true },
{ "5997891.com", true },
{ "5apps.com", true },
+ { "5beanskit.com", true },
{ "5c1fd0f31022cbc40af9f785847baaf9.space", true },
- { "5chat.it", true },
- { "5crowd.com", true },
{ "5dm.tv", true },
{ "5dwin.com", true },
{ "5dwin.net", true },
@@ -762,8 +858,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "5gb.space", true },
{ "5kraceforals.com", true },
{ "5percentperweek.com", true },
+ { "5stars.tv", true },
{ "5thchichesterscouts.org.uk", true },
{ "5y.fi", true },
+ { "5yeb.com", true },
{ "602422.com", true },
{ "604122.com", true },
{ "604322.com", true },
@@ -778,7 +876,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "614922.com", true },
{ "61730123.com", true },
{ "618media.com", true },
+ { "620881.com", true },
{ "621422.com", true },
+ { "62314.cc", true },
{ "624022.com", true },
{ "624122.com", true },
{ "624322.com", true },
@@ -844,17 +944,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "6547766.com", true },
{ "6548855.com", true },
{ "6548877.com", true },
+ { "6556hd.com", true },
+ { "6556pk.com", true },
{ "656088.com", true },
{ "659422.com", true },
+ { "65d88.com", true },
+ { "6602p.com", true },
+ { "6603p.com", true },
{ "66136.com", true },
+ { "662607.xyz", true },
{ "6633445.com", true },
{ "6652566.com", true },
{ "6660111.ru", true },
- { "6664553.com", true },
{ "666668722.com", true },
{ "6666yh.com", true },
- { "666omg.com", true },
- { "66b.com", true },
{ "670422.com", true },
{ "671422.com", true },
{ "672422.com", true },
@@ -872,21 +975,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "694622.com", true },
{ "694922.com", true },
{ "6969.us", true },
+ { "69759.com", true },
{ "698da.com", true },
{ "69928.com", true },
{ "6997896.com", true },
{ "69butterfly.com", true },
{ "69fps.gg", true },
{ "69wasted.net", true },
+ { "6bwcp.com", true },
{ "6ird.com", true },
{ "6lo.zgora.pl", true },
- { "6pm.com", true },
{ "700.az", true },
{ "704233.com", true },
- { "7045.com", true },
{ "704533.com", true },
{ "7045h.com", true },
{ "704633.com", true },
+ { "7080997.com", true },
{ "712433.com", true },
{ "713433.com", true },
{ "714133.com", true },
@@ -913,10 +1017,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "743833.com", true },
{ "74th.jp", true },
{ "755k3.com", true },
- { "758global.com", true },
{ "762.ch", true },
{ "7717a.com", true },
{ "7733445.com", true },
+ { "7770b.com", true },
+ { "7770t.com", true },
{ "7777yh.com", true },
{ "777coin.com", true },
{ "783lab.com", true },
@@ -924,13 +1029,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "7885765.com", true },
{ "7891553.com", true },
{ "7891997.com", true },
+ { "7898666.com", true },
{ "79ch.com", true },
{ "7careconnect.com", true },
{ "7delights.com", true },
{ "7delights.in", true },
+ { "7ferfer.com.br", true },
{ "7geese.com", true },
{ "7graus.pt", true },
{ "7kicks.com", true },
+ { "7plus.com.au", true },
{ "7proxies.com", true },
{ "7qly.com", true },
{ "7sons.de", true },
@@ -938,21 +1046,32 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "7trade8.com", true },
{ "7x24servis.com", true },
{ "804322.com", true },
+ { "8080883.com", true },
+ { "8080889.com", true },
{ "8086.cf", true },
+ { "80883.cc", true },
+ { "80887.cc", true },
{ "809422.com", true },
{ "80993.net", true },
{ "814022.com", true },
+ { "815jz.com", true },
+ { "816jz.com", true },
{ "81818app.com", true },
{ "8189196.com", true },
- { "818da.com", true },
+ { "8211p.com", true },
+ { "8212p.com", true },
+ { "8213p.com", true },
+ { "8214p.com", true },
+ { "8215p.com", true },
+ { "8216p.com", true },
{ "8349822.com", true },
+ { "848jz.com", true },
{ "8522.com", true },
{ "8522club.com", true },
{ "8522hk.com", true },
{ "8522ph.com", true },
{ "8522tw.com", true },
{ "8522usa.com", true },
- { "86286286.com", true },
{ "86499.com", true },
{ "86metro.ru", true },
{ "8722.am", true },
@@ -962,13 +1081,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "8722ph.com", true },
{ "8722tw.com", true },
{ "8722usa.com", true },
+ { "877027.com", true },
{ "88-line.com", true },
{ "88-line.net", true },
+ { "8802p.com", true },
{ "881-line.com", true },
{ "881-line.net", true },
{ "8818k3.com", true },
{ "8833445.com", true },
{ "88522am.com", true },
+ { "885287.com", true },
{ "887.ag", true },
{ "8876007.com", true },
{ "8876008.com", true },
@@ -1017,12 +1139,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "8880021.com", true },
{ "8880023.com", true },
{ "8880025.com", true },
- { "8880057.com", true },
{ "8880059.com", true },
{ "8880067.com", true },
{ "8880083.com", true },
{ "8880100.com", true },
- { "8884553.com", true },
+ { "88851333.com", true },
+ { "88851777.com", true },
+ { "888666pj.com", true },
{ "8886737.com", true },
{ "8886739.com", true },
{ "8886793.com", true },
@@ -1061,10 +1184,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "88yule9.com", true },
{ "8ack.de", true },
{ "8ackprotect.com", true },
- { "8da188.com", true },
{ "8da222.com", true },
- { "8da88.com", true },
- { "8da999.com", true },
{ "8dabet.com", true },
{ "8hrs.net", true },
{ "8maerz.at", true },
@@ -1072,11 +1192,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "8tech.com.hk", true },
{ "8thportsmouth.org.uk", true },
{ "8tuffbeers.com", true },
- { "8xxbet.net", true },
- { "8xxxxxxx.com", true },
+ { "8xx888.com", true },
+ { "8y.network", true },
+ { "8yun.cf", true },
{ "9-11commission.gov", true },
{ "903422.com", true },
{ "905422.com", true },
+ { "908.la", true },
+ { "9090819.com", true },
{ "90r.jp", true },
{ "910kj.com", true },
{ "9118.com", true },
@@ -1084,7 +1207,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "912422.com", true },
{ "913422.com", true },
{ "914122.com", true },
- { "918116.com", true },
{ "918gd.com", true },
{ "919422.com", true },
{ "91966.com", true },
@@ -1094,6 +1216,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "924322.com", true },
{ "924622.com", true },
{ "926422.com", true },
+ { "929349.com", true },
{ "92url.com", true },
{ "931422.com", true },
{ "932422.com", true },
@@ -1107,11 +1230,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "949622.com", true },
{ "949722.com", true },
{ "94cs.cn", false },
+ { "967606.com", true },
{ "9679693.com", true },
{ "9681909.com", true },
{ "972422.com", true },
{ "9788876.com", true },
- { "97bros.com", true },
{ "9822.am", true },
{ "9822.bz", true },
{ "9822am.com", true },
@@ -1120,20 +1243,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "9822ph.com", true },
{ "9822tw.com", true },
{ "9822usa.com", true },
- { "98laba.com", true },
- { "98laba.net", true },
+ { "9867666.com", true },
+ { "98laba.com", false },
+ { "98laba.net", false },
{ "9918883.com", true },
{ "9933445.com", true },
+ { "9950p.com", true },
{ "99599.fi", true },
- { "9994553.com", true },
+ { "9998722.com", true },
{ "99998522.com", true },
{ "99999822.com", true },
{ "999998722.com", true },
{ "99rst.org", true },
{ "99wxt.com", true },
+ { "9box.jp", true },
{ "9farm.com", true },
{ "9fvip.net", true },
+ { "9hosts.net", true },
+ { "9iwan.net", true },
{ "9jajuice.com", true },
+ { "9jatrust.com", true },
{ "9pkfz.com", true },
{ "9riddles.com", true },
{ "9uelle.jp", true },
@@ -1143,12 +1272,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "a-1basements.com", true },
{ "a-1indianawaterproofing.com", true },
{ "a-allard.be", true },
+ { "a-care.net", true },
{ "a-classinflatables.co.uk", true },
{ "a-invest.de", true },
{ "a-little-linux-box.at", true },
{ "a-msystems.com", true },
{ "a-oben.org", true },
{ "a-players.team", true },
+ { "a-pro-pos.info", true },
{ "a-wife.net", true },
{ "a-ztransmission.com", true },
{ "a0print.nl", true },
@@ -1160,7 +1291,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "a2a.me", true },
{ "a2a.net", true },
{ "a2nutrition.com.au", true },
- { "a2os.club", true },
{ "a4sound.com", true },
{ "a632079.me", true },
{ "a7la-chat.com", true },
@@ -1190,7 +1320,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aarkue.eu", true },
{ "aaron.cm", true },
{ "aaron.xin", true },
- { "aaronburt.co.uk", false },
{ "aaronhorler.com", true },
{ "aaronhorler.com.au", true },
{ "aaronkimmig.de", true },
@@ -1200,19 +1329,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aati.be", true },
{ "aati.info", true },
{ "aavienna.com", true },
+ { "ab-photography.nl", true },
{ "abaapplianceservice.com", true },
{ "abaaustin.com", true },
{ "ababyco.com.hr", true },
{ "abacusbouncycastle.co.uk", true },
{ "abacustech.co.jp", true },
{ "abandonedmines.gov", true },
+ { "abasalehngo.com", true },
{ "abateroad66.it", true },
{ "abbadabbabouncycastles.co.uk", true },
{ "abbas.ch", true },
{ "abborsjo.fi", true },
{ "abbotsparties.co.uk", true },
{ "abbottscastles.co.uk", true },
- { "abbradar.net", true },
{ "abbruch-star.de", true },
{ "abc-rz.de", true },
{ "abc.li", true },
@@ -1224,17 +1354,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "abcpartyhire.com", true },
{ "abcstudio.com.au", true },
{ "abdel.me", true },
- { "abdelsater.net", true },
{ "abdulwahaab.ca", true },
{ "abe-elektro.de", true },
{ "abe-medical.jp", true },
{ "abeestrada.com", false },
{ "abeilles-idapi.fr", true },
{ "abenteuer-ahnenforschung.de", true },
- { "abeontech.com", true },
{ "aberdeencastles.co.uk", true },
{ "aberdeenjudo.co.uk", true },
{ "abeus.com", true },
+ { "abg.ninja", true },
+ { "abhibhat.com", true },
{ "abhisharma.me", true },
{ "abi-2017.tk", true },
{ "abiapp.net", true },
@@ -1247,9 +1377,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "abilma.com", true },
{ "abilymp06.net", true },
{ "abimelec.com", true },
- { "abinferis.com", true },
{ "abinyah.com", true },
{ "abitidalavoro.roma.it", true },
+ { "abitidasposa.roma.it", true },
{ "abitur97ag.de", true },
{ "abiturma.de", true },
{ "ablak-nyilaszaro.info", true },
@@ -1262,6 +1392,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "abobuch.de", true },
{ "aboces.org", true },
{ "aboderenovation.co.uk", true },
+ { "abogadosescobarysanchez.es", true },
{ "abolicionistas.com", true },
{ "abolition.net", true },
{ "abolitionism.ca", true },
@@ -1284,6 +1415,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "abolitionniste.com", true },
{ "abolizionista.com", true },
{ "abonilla.com", true },
+ { "aborla.net", true },
{ "abos.eu", true },
{ "abouncycastleman.co.uk", true },
{ "abouthrm.nl", true },
@@ -1305,7 +1437,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "abrilect.com", true },
{ "abristolgeek.co.uk", true },
{ "abseits.org", true },
- { "absolem.cc", true },
+ { "absolem.cc", false },
{ "absolutcruceros.com", true },
{ "absoluteautobody.com", true },
{ "absolutedouble.co.uk", true },
@@ -1315,6 +1447,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "absoluterush.net", true },
{ "absolutewebdesigns.com", true },
{ "absolutviajes.com", true },
+ { "abstractbarista.net", true },
{ "abstraction21.com", true },
{ "absturztau.be", true },
{ "absturztaube.ch", true },
@@ -1332,6 +1465,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ac-admin.pl", true },
{ "ac-epmservices.com", true },
{ "ac-town.com", true },
+ { "ac.milan.it", true },
{ "ac0g.dyndns.org", true },
{ "aca-creative.co.uk", true },
{ "academiadebomberosonline.com", true },
@@ -1345,7 +1479,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "acaptureservices.com", true },
{ "acara-yoga.de", true },
{ "acareer.in", true },
- { "acat.io", true },
{ "acbrussels-used.be", true },
{ "accelaway.com", true },
{ "acceleratenetworks.com", true },
@@ -1356,11 +1489,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "accesloges.com", true },
{ "accessacab.co.uk", true },
{ "accessauto-occasions.be", true },
- { "accessibility.gov", true },
{ "accesskeycloning.com", true },
{ "accessmy.net", true },
{ "accessoirescheveuxchic.com", true },
{ "accessoripersmartphone.it", true },
+ { "acchicocchi.com", true },
+ { "acchikocchi.org", true },
{ "accme.co", true },
{ "accoladescreens.com.au", true },
{ "accord-application.com", true },
@@ -1376,11 +1510,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "accuritconsulting.com", true },
{ "accuritpresence.com", true },
{ "accutint.com", true },
+ { "ace-aegon.cloud", true },
{ "ace.media", true },
{ "ace.one", true },
{ "acealters.com", true },
{ "aceanswering.com", true },
- { "acecerts.co.uk", true },
{ "acecolleges.edu.au", true },
{ "acedog.co", true },
{ "aceinflatables.com", true },
@@ -1392,8 +1526,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "acendealuz.com.br", true },
{ "acerentalandsales.com", true },
{ "acerislaw.com", true },
+ { "acessoeducacao.com", true },
{ "acfo.org", true },
+ { "acfun.eu.org", true },
{ "acg.social", true },
+ { "acg1080.com", true },
{ "acgmoon.com", true },
{ "acgmoon.org", true },
{ "acgtalktw.com", true },
@@ -1415,6 +1552,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ackis.duckdns.org", false },
{ "acklandstainless.com.au", true },
{ "acl.gov", true },
+ { "acl.ink", true },
{ "aclu.org", false },
{ "acluva.org", false },
{ "acme.beer", true },
@@ -1424,6 +1562,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aconnor.xyz", true },
{ "acordes.online", true },
{ "acorncastles.co.uk", true },
+ { "acorncredentialing.com", true },
{ "acorntreecare.com", true },
{ "acoshift.com", true },
{ "acoshift.me", true },
@@ -1449,17 +1588,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "acroyoga-nuernberg.de", true },
{ "acrylbilder-acrylmalerei.de", true },
{ "acrylicwifi.com", true },
- { "acs-chantal.com", true },
{ "acsbbs.org", true },
{ "acsc.gov.au", true },
{ "acscbasket.com", true },
{ "acsemb.org", true },
{ "acsports.ca", true },
+ { "act-safety.nl", true },
{ "actc.org.uk", true },
{ "actgruppe.de", true },
{ "actheater.com", true },
{ "actiefgeld.nl", true },
{ "actioncleaningnd.com", true },
+ { "actioncoachignite.co.za", true },
{ "actionfinancialservices.net", true },
{ "actionlabs.net", true },
{ "actionmadagascar.ch", true },
@@ -1479,7 +1619,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "actom.cc", true },
{ "actonwoodworks.com", true },
{ "actors-cafe.net", true },
- { "actorsroom.com", true },
{ "actserv.co.ke", true },
{ "actualadmins.com", true },
{ "actualidadblog.com", true },
@@ -1519,7 +1658,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "adambalogh.net", true },
{ "adambryant.ca", false },
{ "adambyers.com", true },
- { "adamek.online", true },
+ { "adamdixon.co.uk", true },
+ { "adamek.online", false },
{ "adamfontenot.com", true },
{ "adamh.us", true },
{ "adamkaminski.com", true },
@@ -1536,6 +1676,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "adapt-elektronik.com", true },
{ "adapt.de", true },
{ "adaptablesecurity.org", true },
+ { "adaptergonomics.com", true },
{ "adapti.de", true },
{ "adaptivemechanics.edu.au", true },
{ "adarshthapa.in", true },
@@ -1545,12 +1686,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "adblockextreme.com", true },
{ "adblockextreme.net", true },
{ "adblockextreme.org", true },
+ { "adcnvs.com", true },
{ "addcrazy.com", true },
{ "addeekt.com", true },
{ "adderall.space", true },
{ "addicional.com", true },
{ "addictionresource.com", true },
{ "addictively.com", true },
+ { "addiko.net", true },
{ "addisoncrump.info", true },
{ "addnine.com", true },
{ "addon.watch", true },
@@ -1560,8 +1703,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "addvalue-renovations.co.uk", true },
{ "addydari.us", true },
{ "adelebeals.com", true },
- { "adelianz.com", true },
{ "adelightfulglow.com", true },
+ { "adeline.mobi", true },
{ "adentalsolution.com", true },
{ "adept.org.pl", true },
{ "adesa.co.uk", true },
@@ -1595,6 +1738,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "adminforge.de", true },
{ "administrator.de", true },
{ "administratorserwera.pl", true },
+ { "adminless.ovh", true },
{ "adminlinux.pl", true },
{ "admino.cz", true },
{ "admins.tech", true },
@@ -1606,10 +1750,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "admongo.gov", true },
{ "adnanoktar.com", true },
{ "adnanotoyedekparca.com", true },
+ { "adnmb1.com", true },
{ "adnolesh.com", true },
{ "adnot.am", true },
{ "adnseguros.es", true },
- { "adoniscabaret.co.uk", true },
+ { "adohanyzasjovoje.hu", true },
+ { "adomani-italia.com", true },
{ "adonizer.science", true },
{ "adonnante.com", true },
{ "adoptionlink.co.uk", true },
@@ -1640,9 +1786,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "adsbouncycastles.co.uk", true },
{ "adsbtc.org", true },
{ "adsl2meg.fr", true },
+ { "adtelligent.com", true },
{ "adtgroup.com", true },
{ "adurra.com", true },
{ "aduvi.de", true },
+ { "advaithbot.com", true },
{ "advance.hr", true },
{ "advanced-fleet-services.com", true },
{ "advanced-scribes.com", true },
@@ -1659,9 +1807,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "advancyte.com", true },
{ "advantagehomeexteriors.com", true },
{ "advara.com", true },
+ { "advenacs.com", true },
{ "advenacs.com.au", true },
{ "advenapay.com", true },
- { "adventaholdings.com", true },
{ "advento.bg", true },
{ "adventure-inn.com", true },
{ "adventureally.com", true },
@@ -1684,7 +1832,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "advokat-romanov.com", true },
{ "advtran.com", true },
{ "adware.pl", true },
- { "adwokatkosterka.pl", true },
{ "adwokatzdunek.pl", true },
{ "adws.io", true },
{ "adxperience.com", true },
@@ -1706,11 +1853,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ae-construction.co.uk", true },
{ "ae-dir.com", true },
{ "ae-dir.org", true },
+ { "ae8601.com", true },
{ "aebian.org", true },
{ "aecexpert.fr", true },
{ "aedollon.com", true },
{ "aefcleaning.com", true },
{ "aegee-utrecht.nl", true },
+ { "aegis.moe", true },
{ "aegisalarm.co.uk", true },
{ "aegisalarm.com", true },
{ "aegisalarms.co.uk", true },
@@ -1718,18 +1867,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aegrel.ee", true },
{ "aehe.us", true },
{ "aei.co.uk", true },
+ { "aelurus.com", true },
+ { "aenterprise.info", true },
{ "aeon.co", true },
- { "aep-digital.com", true },
+ { "aeonct.org", true },
{ "aeradesign.com", true },
{ "aerandir.fr", true },
- { "aerapass.io", true },
{ "aereco.com", true },
{ "aergia.eu", true },
{ "aerisnetwork.com", true },
{ "aero-pioneer.com", true },
- { "aerobasegroup.com", true },
{ "aerobotz.com", true },
{ "aeronautix.com", true },
+ { "aeronote.net", true },
{ "aeropole.de", true },
{ "aeropole.eu", true },
{ "aerosimexperience.com", true },
@@ -1747,6 +1897,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aextron.com", true },
{ "aextron.de", true },
{ "aextron.org", true },
+ { "af-tech.cz", true },
{ "afavre.io", true },
{ "afb24.de", true },
{ "afbeelding.im", true },
@@ -1754,6 +1905,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "afcmrs.org", true },
{ "afcompany.it", true },
{ "afcurgentcarelyndhurst.com", true },
+ { "aff.moe", true },
{ "affarsnatverk.nu", true },
{ "affichagepub3.com", true },
{ "affiliatefeatures.com", true },
@@ -1773,6 +1925,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "affordablekilimanjaro.com", true },
{ "affordablemudjacking.com", true },
{ "affordableracingparts.com.au", true },
+ { "affpass.com", true },
{ "affping.com", true },
{ "affvps.net", true },
{ "afghan.dating", true },
@@ -1781,6 +1934,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aficionados.com.br", true },
{ "afinadoronline.com.br", true },
{ "afinaudio.com", true },
+ { "aflam4you.tv", true },
{ "aflfreebets.com", true },
{ "aflowershop.ca", true },
{ "afmt.fr", true },
@@ -1789,6 +1943,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "afp548.com", true },
{ "afri.cc", true },
{ "africa.dating", true },
+ { "african-bay.de", true },
{ "africanexponent.com", true },
{ "africanimpact.com", true },
{ "africantourer.com", true },
@@ -1796,6 +1951,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "afrodigital.uk", true },
{ "afs-asso.org", true },
{ "afscheidsportret.nl", true },
+ { "aftab-alam.de", true },
{ "after.digital", true },
{ "afterdwi.info", true },
{ "afterhate.fr", true },
@@ -1809,23 +1965,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "agate.pw", true },
{ "age.hk", true },
{ "agechecker.net", true },
- { "ageg.ca", true },
{ "agemfis.com", true },
{ "agencewebstreet.com", true },
{ "agenciadeempregosdourados.com.br", true },
+ { "agenciafiscal.pe", true },
+ { "agenciamdg.com.br", true },
{ "agencyinmotion.com", true },
{ "agenda-loto.net", false },
{ "agenda21senden.de", true },
{ "agendatelefonica.com.br", true },
{ "agendazilei.com", true },
{ "agent-grow.com", true },
- { "agent6.com.au", true },
{ "agentprocessing.com", true },
{ "agenziaimmobiliarezeta.it", true },
{ "agfmedia.com", true },
- { "agglo-sion.ch", true },
{ "agia.ad", true },
{ "agiapelagia.com", true },
+ { "agibank.com.br", true },
{ "agic-geneve.ch", true },
{ "agilebits.com", true },
{ "agilecraft.com", true },
@@ -1859,8 +2015,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "agouralandscapelighting.com", true },
{ "agouralighting.com", true },
{ "agouraoutdoorlighting.com", true },
+ { "agowa338.de", true },
{ "agr.asia", true },
- { "agracan.com", true },
{ "agrajag.nl", true },
{ "agrarking.com", true },
{ "agrarking.de", true },
@@ -1888,7 +2044,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ahegao.ca", true },
{ "aheng.me", true },
{ "ahero4all.org", true },
- { "ahkubiak.ovh", true },
+ { "ahkubiak.ovh", false },
{ "ahlaejaba.com", true },
{ "ahlz.sk", true },
{ "ahmad.works", true },
@@ -1908,6 +2064,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ai.gov", true },
{ "ai.je", true },
{ "aia.de", true },
+ { "aianipid.ee", true },
{ "aiasesoriainmobiliaria.com", true },
{ "aibenzi.com", true },
{ "aibiying.com", true },
@@ -1919,12 +2076,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aidanmontare.net", true },
{ "aidanpr.com", true },
{ "aidanpr.net", true },
+ { "aidarikako.com", true },
{ "aiden.link", true },
{ "aidhan.net", true },
{ "aidi-ahmi.com", true },
{ "aids.gov", true },
{ "aie.de", true },
- { "aiforsocialmedia.com", true },
{ "aifriccampbell.com", true },
{ "aigcev.org", true },
{ "aigenpul.se", true },
@@ -1934,6 +2091,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aiho.stream", true },
{ "aiicy.org", true },
{ "aiida.se", true },
+ { "aiinsurance.io", true },
+ { "aiinsurance.xyz", true },
{ "aijsk.com", true },
{ "aikenpromotions.com", true },
{ "aiki.de", true },
@@ -1946,15 +2105,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ailitonia.com", true },
{ "ailitonia.xyz", true },
{ "aimax.com", true },
+ { "aimd.tech", true },
{ "aimeeandalec.com", true },
{ "aimgroup.co.tz", true },
{ "aimi-salon.com", true },
+ { "aimonline.nl", true },
{ "aimotive.com", true },
- { "aintevenmad.ch", true },
+ { "aimstoreglobal.com", true },
{ "ainutrition.co.uk", true },
{ "ainvest.de", true },
{ "aiois.com", true },
{ "aipbarcelona.com", true },
+ { "aipi.de", true },
{ "air-craftglass.com", true },
{ "air-shots.ch", true },
{ "air-techniques.fr", true },
@@ -2032,6 +2194,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "airbossofamerica.com", true },
{ "airclass.com", true },
{ "aircomms.com", true },
+ { "airconsboksburg.co.za", true },
{ "airductclean.com", false },
{ "airductcleaning-fresno.com", true },
{ "airductcleaninggrandprairie.com", true },
@@ -2052,6 +2215,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "airpbx.com", true },
{ "airplay-inflatable-hire.co.uk", true },
{ "airplayradio.nl", true },
+ { "airportlimototoronto.com", true },
{ "airpurifierproductsonline.com", true },
{ "airrestoration.ch", true },
{ "airsnore.com", true },
@@ -2079,6 +2243,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aivd.lol", true },
{ "aiwdirect.com", true },
{ "aixvox.com", false },
+ { "aizxxs.com", true },
{ "ajapaik.ee", true },
{ "ajarope.com", true },
{ "ajaxed.net", true },
@@ -2138,6 +2303,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aktiv-naturheilmittel.de", true },
{ "aktivace.eu", true },
{ "aktivierungscenter.de", true },
+ { "aktuelle-uhrzeit.at", true },
{ "akuislam.com", true },
{ "akukas.com", true },
{ "akustik.tech", true },
@@ -2160,14 +2326,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alainwolf.net", true },
{ "alair.cn", false },
{ "alamancetv.com", true },
- { "alamgir.works", true },
{ "alanberger.me.uk", true },
{ "alanhua.ng", true },
- { "alanhuang.name", true },
{ "alaninkenya.org", true },
{ "alaricfavier.eu", false },
{ "alarmcomplete.co.uk", true },
- { "alarna.de", true },
{ "alasdelalma.com.co", true },
{ "alaskafishinglodges.net", true },
{ "alaskajewelry.com", true },
@@ -2182,7 +2345,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "albertbogdanowicz.pl", true },
{ "albertcuyp-markt.amsterdam", true },
{ "albertinum-goettingen.de", true },
- { "albinma.com", true },
{ "albion2.org", true },
{ "alboweb.nl", true },
{ "albrocar.com", true },
@@ -2192,6 +2354,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alco-united.com", true },
{ "alcoholapi.com", true },
{ "alcolecapital.com", true },
+ { "alcouponest.com", true },
{ "aldiabcs.com", true },
{ "aldien.com.br", true },
{ "aldo-vandini.de", true },
@@ -2206,6 +2369,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aleksejjocic.tk", true },
{ "aleksib.fi", true },
{ "alela.fr", true },
+ { "aleph.land", true },
{ "alerbon.net", true },
{ "alertboxx.com", true },
{ "alertonline.nl", true },
@@ -2215,27 +2379,29 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alessandroonline.com.br", true },
{ "aletm.it", true },
{ "alex-ross.co.uk", true },
+ { "alex4386.us", true },
{ "alex97000.de", true },
+ { "alexander-beck.eu", true },
{ "alexanderb.info", true },
{ "alexandermuetzel.de", true },
{ "alexanderneng.de", true },
{ "alexanderschimpf.de", true },
{ "alexandra-schulze.de", true },
{ "alexandrastorm.com", true },
- { "alexandrastylist.com", false },
{ "alexandre-blond.fr", true },
+ { "alexandrefa.ovh", true },
{ "alexbaker.org", true },
{ "alexberts.ch", true },
{ "alexbogovich.com", true },
{ "alexbresnahan.com", true },
{ "alexcoman.com", true },
{ "alexdaniel.org", true },
- { "alexei.su", false },
{ "alexey-shamara.ru", true },
{ "alexeykopytko.com", true },
{ "alexfabian.myftp.org", true },
{ "alexgaynor.net", true },
{ "alexgebhard.com", true },
+ { "alexhalderman.com", true },
{ "alexhd.de", true },
{ "alexio.ml", true },
{ "alexisabarca.com", true },
@@ -2245,9 +2411,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alexmerkel.com", true },
{ "alexmerkel.me", true },
{ "alexmerkel.xyz", true },
- { "alexmroberts.net", true },
{ "alexn.org", true },
{ "alexpavel.com", true },
+ { "alexpnixon.com", true },
{ "alexpotter.net", true },
{ "alexs.de", true },
{ "alexschroeder.ch", true },
@@ -2264,7 +2430,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alexyang.me", true },
{ "alfa-tech.su", true },
{ "alfred-figge.de", true },
- { "alftrain.com", true },
{ "algbee.com", true },
{ "algeriepart.com", true },
{ "alghanimcatering.com", true },
@@ -2274,6 +2439,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "algolia.com", true },
{ "algorithmofsuccess.com", true },
{ "algoritmus-uspechu.cz", true },
+ { "alhost.ml", true },
{ "aliacraft.net", true },
{ "aliantsoft.pl", true },
{ "aliaswp.com", true },
@@ -2283,6 +2449,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alice.tw", true },
{ "alicemaywebdesign.com.au", true },
{ "alicestudio.it", true },
+ { "alicetone.net", true },
{ "alieke.design", true },
{ "alienation.biz", true },
{ "alienflight.com", true },
@@ -2315,6 +2482,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "allaboutthekink.org", true },
{ "allactioneventhire.co.uk", true },
{ "allamericanmuslim.com", true },
+ { "allamericanpaintingplus.com", true },
{ "allamericanprotection.net", true },
{ "allamericatrans.com", true },
{ "allangirvan.net", true },
@@ -2332,7 +2500,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "allcloud.com", true },
{ "allcovered.nl", true },
{ "alldewall.de", true },
- { "alldigitalsolutions.com", true },
{ "alle.bg", true },
{ "allemoz.com", true },
{ "allemoz.fr", true },
@@ -2345,7 +2512,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "allfundsconnect.com", true },
{ "allgaragefloors.com", true },
{ "allgreenturf.com.au", true },
- { "allhard.org", true },
{ "alliance-psychiatry.com", true },
{ "alliances-faq.de", true },
{ "alliances-globalsolutions.com", true },
@@ -2356,52 +2522,62 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "allis.studio", true },
{ "allius.de", true },
{ "alljamin.com", true },
- { "allladyboys.com", true },
{ "allmebel.ru", true },
{ "allmend-ru.de", true },
+ { "allmousepads.com", true },
{ "allns.fr", true },
{ "allo-credit.ch", true },
{ "allofthestops.com", true },
{ "allontanamentovolatili.it", true },
{ "allontanamentovolatili.milano.it", true },
+ { "alloutofgum.com", true },
{ "alloverthehill.com", true },
- { "alloydevil.nl", true },
- { "allplayer.tk", true },
{ "allpointsblog.com", true },
{ "allpointsheating.com", true },
{ "allproptonline.com", true },
+ { "allrad-buck.de", true },
+ { "allram.one", true },
{ "allroundpvp.net", true },
+ { "allroundtechnology.com", true },
+ { "allroundtechnology.nl", true },
{ "allsaints.church", true },
{ "allsearch.io", true },
{ "allstakesupply.com.au", true },
{ "allstarcashforcars.com", true },
{ "allstarquilts.com", true },
+ { "allsun.online", true },
{ "allsync.com", true },
{ "allsync.nl", true },
{ "allteach.co.uk", true },
{ "allterrainfence.com", true },
{ "allthecryptonews.com", true },
+ { "alltherooms.com", true },
{ "allthethings.co.nz", true },
{ "allthings.me", true },
{ "allthingssquared.com", true },
{ "allthingswild.co.uk", true },
+ { "alltubedownload.net", true },
{ "allurebikerental.com", true },
{ "allurescarves.com", true },
{ "alluvion.studio", true },
- { "allvips.ru", true },
{ "allweatherlandscaping.net", true },
{ "almaatlantica.com", true },
- { "almatinki.com", true },
+ { "almamet.com", true },
{ "almavios.com", false },
{ "almayadeen.education", true },
+ { "almenrausch-pirkhof.de", true },
{ "almorafestival.com", true },
{ "almut-zielonka.de", true },
{ "aloesoluciones.com.ar", true },
{ "alohapartyevents.co.uk", true },
+ { "alonas.ml", true },
+ { "alonas.ovh", true },
{ "alonetone.com", true },
{ "alp.od.ua", true },
{ "alpca.org", true },
+ { "alpencam.com", true },
{ "alpencams.com", true },
+ { "alpencams.net", true },
{ "alpengreis.ch", true },
{ "alpenjuice.com", true },
{ "alpertron.com.ar", true },
@@ -2441,9 +2617,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alpinestarmassage.com", true },
{ "alpinetrek.co.uk", true },
{ "alpiniste.fr", true },
- { "alqassam.net", true },
+ { "alpstarentaisetaxi.com", true },
+ { "alpstarentaisetaxi.fr", true },
{ "alquiaga.com", true },
- { "alquiladoramexico.com", true },
{ "alrait.com", true },
{ "alre-outillage.fr", true },
{ "alroniks.com", true },
@@ -2456,7 +2632,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "altair.fi", true },
{ "altapina.com", false },
{ "altaplana.be", true },
- { "altbinaries.com", true },
{ "altedirect.com", true },
{ "alter-news.fr", true },
{ "alterbaum.net", true },
@@ -2465,6 +2640,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alternative.hosting", true },
{ "alternativebit.fr", true },
{ "alternativedev.ca", true },
+ { "alternativehosting.ca", true },
+ { "alternativehosting.com", true },
{ "alternativeinternet.ca", true },
{ "alternativet.party", true },
{ "alternativetomeds.com", true },
@@ -2484,10 +2661,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alts.li", true },
{ "altstipendiaten.de", true },
{ "altunbas.info", true },
+ { "aluminium-giesserei.de", true },
{ "alumni-kusa.jp", true },
{ "alupferd.de", true },
{ "aluro.info", true },
- { "aluroof.eu", true },
{ "alvcs.com", true },
{ "alviano.com", true },
{ "alvicom.hu", true },
@@ -2495,8 +2672,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "alwaysdry.com.au", true },
{ "alwayslookingyourbest.com", true },
{ "alwaysmine.fi", true },
- { "alwaysonssl.com", true },
{ "alxpresentes.com.br", true },
+ { "alxu.ca", true },
{ "alyoung.com", true },
{ "alza.at", true },
{ "alza.co.uk", true },
@@ -2509,8 +2686,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "am-dd.com", true },
{ "am-executive-consulting.com", true },
{ "am2s.fr", true },
+ { "am3.se", true },
{ "ama.ne.jp", true },
- { "amadoraslindas.com", true },
{ "amadvice.com", true },
{ "amagdic.com", true },
{ "amagical.net", false },
@@ -2528,7 +2705,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "amardham.org", true },
{ "amaresq.com", true },
{ "amartinz.at", true },
- { "amateri.com", true },
{ "amateurchef.co.uk", true },
{ "amateurradionotes.com", true },
{ "amateurvoicetalent.com", true },
@@ -2549,7 +2725,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ambholding-usedcars.be", true },
{ "ambiente.one", true },
{ "ambiq.nl", true },
- { "ambouncyhire.com", true },
{ "amcangroup.com", true },
{ "amcchemical.com", true },
{ "amcfirst.com", true },
@@ -2564,24 +2739,27 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ameego.nl", true },
{ "ameego.org", true },
{ "amees.me", false },
- { "amelandadventure.nl", true },
{ "amello.de", true },
{ "amend-friseur-schwabing.de", true },
+ { "amendine.fr", true },
{ "america.gov", true },
{ "americafamilylawcenter.org", true },
{ "american-school-search.com", true },
{ "american.dating", true },
{ "americandetour.com", true },
{ "americanfoundationbr.com", true },
+ { "americanindiancoc.org", true },
{ "americanindiannursing.com", true },
{ "americanmediainstitute.com", true },
{ "americasbasementcontractor.com", true },
+ { "americasdirector.com", true },
{ "americkykongres.cz", true },
{ "amerigroup.com", true },
{ "ameriikanpoijat.org", true },
{ "amerika-forum.de", true },
{ "amerimarkdirect.com", true },
{ "amerimex.cc", true },
+ { "ames.gq", true },
{ "amesgen.de", true },
{ "amesvacuumrepair.com", true },
{ "amethystdevelopment.co.uk", true },
@@ -2591,9 +2769,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "amh-entertainments.co.uk", true },
{ "ami-de-bastanes.fr", true },
{ "amica-travel.com", true },
+ { "amica.it", true },
{ "amicalecanyon.ch", true },
{ "amiciidogrescue.org.uk", true },
{ "amicimar.it", true },
+ { "amiciperlatesta.it", true },
+ { "amielle.com", true },
{ "amielucha.com", true },
{ "amifoundation.net", true },
{ "amikootours.com", true },
@@ -2605,9 +2786,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "amirautos.com", false },
{ "amirmahdy.com", true },
{ "amisderodin.fr", true },
+ { "amiserver.de", true },
{ "amitabhsirkiclasses.org.in", true },
{ "amitpatra.com", true },
{ "amiu.org", true },
+ { "amj74-informatique.fr", true },
{ "ammanagingdirectors.com", true },
{ "amministratore.biz", true },
{ "amministratore.roma.it", true },
@@ -2615,6 +2798,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "amnesty-bf.org", true },
{ "amnesty.org.au", true },
{ "amnesy.fr", true },
+ { "amokinio.com", true },
{ "amoozesh98.com", true },
{ "amoozesh98.ir", true },
{ "amorgos-aegialis.com", true },
@@ -2629,15 +2813,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ampproject.org", true },
{ "amrcaustin.com", true },
{ "amrcla.com", true },
+ { "ams-web-qa.azurewebsites.net", true },
{ "ams.co.rs", true },
{ "amsportuk.com", true },
+ { "amstelland.com", true },
{ "amsterdamian.com", true },
{ "amuq.net", true },
{ "amuraimpianti.it", true },
{ "amyfoundhermann.com", true },
{ "amyharrisonline.com", true },
+ { "amyria.jp", true },
{ "amyrussellhair.com", true },
{ "amyyeung.com", true },
+ { "amzanalyzer.com", true },
{ "amzn.rocks", true },
{ "an-alles-gedacht.de", true },
{ "anabolic.co", false },
@@ -2645,12 +2833,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "anadiyogacentre.com", true },
{ "anaethelion.fr", true },
{ "anaiscoachpersonal.es", true },
- { "analangelsteen.com", true },
{ "analbleachingguide.com", true },
{ "analgesia.net", true },
- { "analisilaica.it", true },
{ "analogist.net", true },
- { "analteengirls.net", true },
{ "analytics-shop.com", true },
{ "analyticsinmotion.com", true },
{ "analyticum.at", true },
@@ -2664,13 +2849,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "anantshri.info", true },
{ "ananyoo.com", true },
{ "anarchistischegroepnijmegen.nl", false },
- { "anarchyrp.life", true },
{ "anastasia-shamara.ru", true },
+ { "anatoray.com", true },
{ "ance.lv", true },
+ { "ancel.io", true },
{ "ancestramil.fr", true },
{ "anchev.net", true },
{ "anchorit.gov", true },
{ "anchovy.nz", false },
+ { "anciennes-automobiles.fr", true },
{ "anciens.org", true },
{ "ancientnorth.com", true },
{ "ancientnorth.nl", true },
@@ -2713,7 +2900,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "andrejbenz.com", true },
{ "andrelauzier.com", true },
{ "andreoliveira.io", true },
- { "andrespaz.com", true },
{ "andreundnina.de", true },
{ "andrew.fi", true },
{ "andrew.london", true },
@@ -2723,6 +2909,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "andrewhowden.com", true },
{ "andrewimeson.com", true },
{ "andrewin.ru", true },
+ { "andrewletson.com", true },
{ "andrewmichaud.com", true },
{ "andrewmichaud.me", true },
{ "andrewpeng.net", true },
@@ -2731,9 +2918,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "andrewryno.com", true },
{ "andrewsun.com", true },
{ "andrewtchin.com", true },
+ { "andrewx.net", true },
{ "andrezadnik.com", true },
+ { "andrisilberschmidt.ch", true },
{ "andro2id.com", true },
{ "andro4all.com", true },
+ { "android-tv.3utilities.com", true },
{ "android.re", true },
{ "androide.com", true },
{ "androidhry.cz", true },
@@ -2744,8 +2934,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "androidtamer.com", true },
{ "androidtelefony.cz", true },
{ "androidzone.me", true },
+ { "andromeda.se", true },
{ "andromedacenter.com", true },
+ { "andronika.net", false },
{ "androticsdirect.com", true },
+ { "androzoom.com", true },
{ "andruvision.cz", true },
{ "andsat.org", true },
{ "andschwa.com", false },
@@ -2777,8 +2970,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "angeljmadrid.com", true },
{ "angeloryndon.com", true },
{ "angelremigene.com", true },
- { "angelsgirl.eu.org", true },
+ { "angiejones.com", true },
{ "anginf.de", true },
+ { "anglersconservation.net", true },
{ "anglesgirl.eu.org", true },
{ "anglesya.win", true },
{ "anglictina-sojcak.cz", true },
@@ -2786,6 +2980,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "anglingactive.co.uk", true },
{ "anglirl.eu.org", true },
{ "angrapa.ru", true },
+ { "angrido.com", true },
{ "angristan.fr", true },
{ "angristan.xyz", true },
{ "angrut.com", true },
@@ -2797,7 +2992,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "anhaffen.lu", true },
{ "ani-man.de", true },
{ "anicam.fr", true },
- { "aniforprez.net", true },
{ "animacurse.moe", true },
{ "animaemundi.be", true },
{ "animal-liberation.com", true },
@@ -2816,6 +3010,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "animeai.com", true },
{ "animefluxxx.com", true },
{ "animeinsights.net", true },
+ { "animeone.me", true },
{ "animesharp.com", true },
{ "animetriad.com", true },
{ "animojis.es", true },
@@ -2866,6 +3061,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "annuaire-jcb.com", true },
{ "annuaire-photographe.fr", false },
{ "annunciationbvmchurch.org", true },
+ { "anoboy.org", true },
+ { "anodas.lt", true },
{ "anohana.org", true },
{ "anojan.com", true },
{ "anon-next.de", true },
@@ -2873,7 +3070,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "anoncrypto.org", true },
{ "anoneko.com", true },
{ "anongoth.pl", true },
- { "anons.fr", true },
{ "anonym-surfen.de", true },
{ "anonyme-spieler.at", true },
{ "anopan.tk", true },
@@ -2883,7 +3079,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "anotherfatgeek.net", true },
{ "anothervps.com", true },
{ "anowicki.pl", false },
- { "anoxinon.de", false },
{ "ans-delft.nl", true },
{ "ans-ge.ch", true },
{ "ansas.eu", true },
@@ -2893,6 +3088,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ansgar-sonntag.de", true },
{ "ansgarsonntag.de", true },
{ "anshar.eu", true },
+ { "ansibeast.net", true },
{ "ansichtssache.at", true },
{ "ansogning-sg.dk", true },
{ "anstaskforce.gov", true },
@@ -2933,7 +3129,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "antikvariat.ru", true },
{ "antikvarius.ro", true },
{ "antilaserpriority.com", true },
- { "antiled.by", true },
{ "antimine.me", true },
{ "antipolygraph.org", true },
{ "antique-pedalcars.ch", true },
@@ -2950,6 +3145,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "antonin.one", true },
{ "antonio-gartenbau.de", true },
{ "antonjuulnaber.dk", true },
+ { "antonok.com", true },
{ "antonuotila.fi", true },
{ "antota.lt", true },
{ "antragsgruen.de", true },
@@ -2975,14 +3171,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aoa.gov", true },
{ "aoadatacommunity.us", true },
{ "aoaprograms.net", true },
+ { "aobeauty.com.au", true },
+ { "aod-tech.com", true },
{ "aoeuaoeu.com", true },
+ { "aofusa.net", true },
{ "aoil.gr", true },
- { "aoku3d.com", true },
{ "aopedeure.nl", true },
{ "aopsy.de", true },
+ { "aori.com", true },
{ "aos-llc.com", true },
{ "aosc.io", false },
- { "aosus.org", true },
+ { "aostacarnavals.it", true },
{ "aotearoa.maori.nz", true },
{ "aotearoaleaks.org", true },
{ "ap-swiss.ch", true },
@@ -3030,12 +3229,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "apiary.supply", true },
{ "apila.care", true },
{ "apila.us", true },
+ { "apimo.net", true },
{ "apimon.de", true },
{ "apination.com", true },
{ "apio.systems", true },
+ { "apiplus.fr", true },
{ "apis.google.com", true },
{ "apis.moe", true },
{ "apisyouwonthate.com", true },
+ { "apiu.me", true },
{ "apk.li", true },
{ "apk4fun.com", true },
{ "aplikaceproandroid.cz", true },
@@ -3048,6 +3250,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "apn-dz.org", true },
{ "apn-einstellungen.de", true },
{ "apobot.de", true },
+ { "apocalypsemud.org", true },
{ "apogeephoto.com", true },
{ "apoly.de", true },
{ "aponkral.net", true },
@@ -3055,7 +3258,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "aposke.com", true },
{ "aposke.net", true },
{ "aposke.org", true },
- { "apotheke-ch.org", true },
{ "apothes.is", true },
{ "app-at.work", true },
{ "app.lookout.com", true },
@@ -3083,7 +3285,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "applemon.com", true },
{ "appleoosa.com", true },
{ "appleranch.com", true },
- { "applesana.es", true },
{ "applesencia.com", true },
{ "applian.jp", true },
{ "applicationmanager.gov", true },
@@ -3092,6 +3293,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "appmobile.io", true },
{ "appninjas.com", true },
{ "apponic.com", true },
+ { "apponline.com", true },
{ "apprank.in", true },
{ "apprenticeship.gov", true },
{ "apprenticeships.gov", true },
@@ -3107,19 +3309,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "appseccalifornia.org", false },
{ "appsforlondon.com", true },
{ "appshuttle.com", true },
+ { "appspace.com", true },
{ "appt.ch", true },
{ "apptomics.com", true },
{ "appuals.com", true },
{ "appui-de-fenetre.fr", true },
{ "appveyor.com", true },
+ { "appxcrypto.com", true },
{ "appzoojoo.be", true },
+ { "apratimsaha.com", true },
{ "apretatuercas.es", true },
{ "aprikaner.de", true },
{ "aprogend.com.br", true },
{ "aproposcomputing.com", true },
{ "aprovpn.com", true },
{ "aprr.org", true },
- { "aprsdroid.org", true },
{ "aprz.de", true },
{ "apsa.paris", true },
{ "apstudynotes.org", true },
@@ -3128,6 +3332,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "apv-ollon.ch", true },
{ "aqdun.com", true },
{ "aqsiq.net", true },
+ { "aqua-bucht.de", true },
{ "aqua-fitness-nacht.de", true },
{ "aqua-fotowelt.de", true },
{ "aquabar.co.il", true },
@@ -3152,7 +3357,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ar-informatique.ch", true },
{ "arab.dating", true },
{ "arabicxz.com", true },
- { "arabsexi.info", true },
{ "arachina.com", true },
{ "arackiralama.name.tr", true },
{ "arados.de", true },
@@ -3174,25 +3378,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "arbejdsdag.dk", true },
{ "arbitrarion.com", true },
{ "arbitrary.ch", true },
- { "arboworks.com", true },
- { "arbu.eu", false },
{ "arcaea.net", true },
{ "arcaik.net", true },
{ "arcbouncycastles.co.uk", true },
{ "arcenergy.co.uk", true },
{ "archaeoadventures.com", true },
+ { "archeologicatoscana.it", true },
{ "archimedicx.com", true },
{ "archined.nl", true },
+ { "archit.in", true },
{ "architectryan.com", true },
{ "architecture-colleges.com", true },
{ "architectureandgovernance.com", true },
{ "archivero.es", true },
{ "archivesdelavieordinaire.ch", true },
{ "archivosstl.com", true },
+ { "archiweb.pl", false },
{ "archlinux.de", true },
{ "archlinux.org", true },
{ "arclandholdings.com.au", true },
- { "arcobalabs.ca", true },
+ { "arcobalabs.ca", false },
{ "arcridge.ca", true },
{ "arctic.gov", true },
{ "arcueil-cachan.fr", false },
@@ -3217,7 +3422,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "arethsu.se", true },
{ "arfad.ch", true },
{ "arg.zone", true },
- { "argama-nature.com", false },
+ { "argama-nature.com", true },
{ "arganaderm.ch", true },
{ "argb.de", true },
{ "argekultur.at", true },
@@ -3257,6 +3462,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "arletalibrary.com", true },
{ "arlingtonelectric.com", true },
{ "arm-host.com", true },
+ { "arm.gov", true },
{ "armadaquadrat.com", true },
{ "armandsdiscount.com", true },
{ "armanozak.com", true },
@@ -3281,7 +3487,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "arnaudb.net", true },
{ "arnaudfeld.de", true },
{ "arne.codes", true },
- { "arnevankauter.com", true },
{ "arniescastles.co.uk", true },
{ "arno-klein.de", true },
{ "arno-klein.eu", true },
@@ -3321,8 +3526,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "arrowfastener.com", true },
{ "arrowheadaddict.com", true },
{ "arrowheadflats.com", true },
+ { "arrowit.net", true },
{ "arrowwebprojects.nl", true },
{ "arschkrebs.org", true },
+ { "arslankaynakmetal.com", true },
{ "arsplus.ru", false },
{ "arswb.men", true },
{ "art-auction.jp", true },
@@ -3345,6 +3552,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "artecat.ch", true },
{ "artedellavetrina.it", true },
{ "artedona.com", true },
+ { "arteequipamientos.com.uy", true },
{ "artefeita.com.br", true },
{ "arteinstudio.it", true },
{ "artelt.com", true },
@@ -3370,6 +3578,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "artisan-cheminees-poeles-design.fr", true },
{ "artisans-libres.com", true },
{ "artisansoftaste.com", true },
+ { "artisavotins.com", true },
{ "artistagenda.com", true },
{ "artistrunwebsite.com", true },
{ "artlantis.nl", true },
@@ -3397,13 +3606,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "artworxbathrooms.com.au", true },
{ "arty.name", true },
{ "arubasunsetbeach.com", true },
+ { "arunjoshua.com", true },
{ "arveron.ch", true },
{ "arvid.io", true },
{ "arviksa.co.uk", true },
{ "arvindhariharan.com", true },
{ "arvindhariharan.me", true },
{ "arvutiladu.ee", true },
+ { "arweth.com", true },
{ "arxell.com", true },
+ { "aryabusines.com", true },
{ "aryalaroca.de", true },
{ "aryan-nation.com", true },
{ "aryasenna.net", true },
@@ -3443,6 +3655,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ashd1.goip.de", true },
{ "ashd2.goip.de", true },
{ "ashd3.goip.de", true },
+ { "ashessin.com", true },
{ "ashkan-rechtsanwalt-arbeitsrecht-paderborn.de", true },
{ "ashleyedisonuk.com", true },
{ "ashleythouret.com", true },
@@ -3455,7 +3668,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "asiaheavens.com", true },
{ "asialeonding.at", true },
{ "asian-industry.eu", true },
- { "asianodor.com", true },
{ "asianshops.net", true },
{ "asianspa.co.uk", true },
{ "asiba.com.au", true },
@@ -3463,6 +3675,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "asiinc-tex.com", true },
{ "asile-colis.fr", true },
{ "asinetasima.com", true },
+ { "asirigbakaute.com", true },
{ "asirviablog.com", true },
{ "asisee.photography", true },
{ "ask.fi", true },
@@ -3470,21 +3683,25 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ask1.org", true },
{ "askcaisse.com", true },
{ "askcascade.com", true },
+ { "askeustache.com", true },
{ "askizzy.org.au", true },
{ "askkaren.gov", true },
{ "askme24.de", true },
+ { "asksatya.com", true },
{ "askv6.net", true },
{ "askvg.com", true },
{ "askwhy.cz", true },
{ "askwhy.eu", true },
{ "asmbsurvey.com", true },
{ "asmdz.com", true },
+ { "asmeets.nl", true },
{ "asmood.net", true },
{ "asoul.tw", true },
{ "aspargesgaarden.no", true },
{ "aspatrimoine.com", true },
{ "aspcl.ch", true },
{ "aspectcontext.com", true },
+ { "aspectuw.com.au", true },
{ "asperti.com", true },
{ "aspformacion.com", true },
{ "asphyxia.su", true },
@@ -3506,7 +3723,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "assessoriati.com.br", true },
{ "assetvault.co.za", true },
{ "assguidesporrentruy.ch", true },
- { "assign-it.co.uk", true },
+ { "assign-it.co.uk", false },
{ "assistel.com", true },
{ "assistenzaferrodastiro.org", true },
{ "assistenzafrigorifero.org", true },
@@ -3516,22 +3733,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "asspinter.me", true },
{ "assumptionpj.org", true },
{ "astal.rs", true },
- { "astaninki.com", true },
{ "astarbouncycastles.co.uk", true },
{ "astarforu.com", true },
{ "astarmathsandphysics.com", true },
+ { "astaxanthin-sport.de", true },
+ { "astaxanthin.de", true },
{ "astec-informatica.com", true },
{ "astengox.com", true },
{ "astenotarili.online", true },
{ "astral-imperium.uk", true },
{ "astral.org.pl", true },
+ { "astroalloys.com.au", true },
{ "astrology42.com", true },
{ "astroscopy.ch", true },
{ "astrovandalistas.cc", true },
{ "astural.org", true },
{ "astutikhonda.com", true },
{ "asuclassfinder.com", true },
- { "asucrews.com", true },
{ "asuka.io", true },
{ "asun.co", true },
{ "asurbernardo.com", true },
@@ -3574,8 +3792,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "atelierssud.ch", true },
{ "atelierssud.swiss", true },
{ "atencionbimbo.com", false },
- { "atendimentodelta.com.br", true },
+ { "aterlectric.com", true },
{ "aterskapa-data.se", true },
+ { "atg.soy", true },
{ "atgoetschel.ch", true },
{ "atgroup.gr", true },
{ "atgseed.co.uk", true },
@@ -3583,8 +3802,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ath0.org", false },
{ "atheist-refugees.com", true },
{ "atheistfrontier.com", true },
+ { "athekiu.com", true },
{ "athena-bartholdi.com", true },
- { "athena-garage.co.uk", true },
{ "athenadynamics.com", true },
{ "athenaneuro.com", true },
{ "athlin.de", true },
@@ -3609,14 +3828,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "atlantishq.de", true },
{ "atlantiswaterproofing.com", true },
{ "atlas-heritage.com", true },
+ { "atlas-multimedia.de", true },
{ "atlasbrown.com", true },
{ "atlaschiropractic.org", true },
+ { "atlascoffeeclub.com", true },
{ "atlascultural.com", true },
{ "atlasdev.nl", true },
{ "atlasone.us", true },
{ "atlassian.io", true },
{ "atlassignsandplaques.com", true },
{ "atletika.hu", true },
+ { "atmalta.com", true },
{ "atmschambly.com", true },
{ "atnis.com", true },
{ "ato4sound.com", true },
@@ -3626,13 +3848,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "atom86.net", true },
{ "atombase.org", true },
{ "atomic-bounce.com", true },
- { "atomicbounce.co.uk", true },
{ "atomism.com", true },
{ "atorcidabrasileira.com.br", true },
{ "atplonline.co", true },
{ "atpnutrition.com", true },
{ "atraining.ru", true },
{ "atraverscugy.ch", true },
+ { "atrevillot.com", true },
{ "atrinik.org", true },
{ "atsoftware.de", true },
{ "atspeeds.com", true },
@@ -3648,7 +3870,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "attogtech.com", true },
{ "attorney.org.il", true },
{ "attwood.org", true },
- { "atulhost.com", true },
{ "atviras.lt", false },
{ "atvirtual.at", true },
{ "atvsafety.gov", true },
@@ -3661,12 +3882,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "atypicom.it", true },
{ "atypicom.pt", true },
{ "atzenchefin.de", true },
+ { "atzzz.com", true },
{ "au-be.net", true },
{ "au2pb.org", true },
{ "aubergegilly.ch", true },
{ "aubg.org", true },
{ "aubio.org", true },
{ "aubonmanger.fr", true },
+ { "aucarresainteloi.com", true },
{ "aucielrose.com", true },
{ "aucklandcastles.co.uk", true },
{ "aucubin.de", true },
@@ -3702,16 +3925,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "augmentable.de", false },
{ "augmented-portal.com", true },
{ "august-don.site", true },
- { "august.black", true },
{ "augustian-life.cz", true },
{ "augustiner-kantorei-erfurt.de", true },
{ "augustiner-kantorei.de", true },
{ "aukaraoke.su", true },
+ { "aulasvirtualesperu.com", true },
{ "aulo.in", false },
{ "aumilieudumonde.gf", true },
{ "aunali1.com", true },
{ "auntie-eileens.com.au", true },
- { "auntmia.com", true },
{ "aupasdecourses.com", true },
{ "auplidespages.fr", true },
{ "aurelieburn.fr", true },
@@ -3730,6 +3952,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ausmwoid.de", true },
{ "auspicacious.org", true },
{ "ausrecord.com", true },
+ { "ausschreibungen-suedtirol.it", true },
{ "aussiefunadvisor.com", true },
{ "aussieservicedown.com", true },
{ "aussiestoresonline.com", true },
@@ -3744,7 +3967,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "austinuniversityhouse.com", true },
{ "australian.dating", true },
{ "australianairbrushedtattoos.com.au", true },
- { "australianarmedforces.org", true },
{ "australianattractions.com.au", true },
{ "australianimmigrationadvisors.com.au", true },
{ "australiantemporarytattoos.com", true },
@@ -3755,6 +3977,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "auszeit-walsrode.de", true },
{ "auszeit.bio", true },
{ "auth.adult", true },
+ { "authenticationhub.io", true },
{ "authenticwoodcraft.com", true },
{ "authinity.com", true },
{ "authland.com", false },
@@ -3768,6 +3991,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "auto-plus.tn", true },
{ "auto-spurgo.com", true },
{ "auto.nl", true },
+ { "auto1.fi", true },
{ "autoauctionsohio.com", true },
{ "autoauctionsvirginia.com", true },
{ "autobahnco.com", true },
@@ -3787,10 +4011,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "autodidacticstudios.net", true },
{ "autodidacticstudios.org", true },
{ "autoentrepreneurinfo.com", true },
- { "autoepc.ro", true },
{ "autoeshop.eu", true },
+ { "autohaus-snater.de", true },
+ { "autoi.ch", true },
{ "autoinsurancehavasu.com", true },
{ "autokeyreplacementsanantonio.com", true },
+ { "autolawetawroclaw.pl", true },
{ "autoledky.sk", true },
{ "automaan.nl", true },
{ "automacity.com", true },
@@ -3811,6 +4037,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "autoprogconsortium.ga", true },
{ "autoproshouston.com", true },
{ "autorando.com", true },
+ { "autoreinigung-noack.de", true },
{ "autorijschoolrichardschut.nl", true },
{ "autos-mertens.com", true },
{ "autoschadeschreuder.nl", true },
@@ -3820,6 +4047,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "autoshopsolutions.com", true },
{ "autoshun.org", true },
{ "autoskola.hr", true },
+ { "autoskolaplzen.cz", true },
{ "autoskole.hr", true },
{ "autospurgo.it", true },
{ "autospurgo.milano.it", true },
@@ -3834,14 +4062,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "autozane.com", true },
{ "autres-talents.fr", true },
{ "autshir.com", true },
- { "auux.com", true },
{ "auvernet.org", true },
{ "aux-arts-de-la-table.com", true },
{ "auxiliame.com", true },
{ "auxille.com", true },
{ "auxquatrevents.ch", true },
{ "av-yummy.com", true },
- { "av01.tv", true },
{ "av0ndale.de", true },
{ "ava-creative.de", false },
{ "ava-software.at", true },
@@ -3888,9 +4114,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "avietech.com", true },
{ "aviv.nyc", true },
{ "avlhostel.com", true },
- { "avmoo.com", true },
+ { "avm-multimedia.com", true },
{ "avmrc.nl", true },
- { "avnet.ws", true },
+ { "avmup.com", true },
{ "avocatbeziau.com", true },
{ "avocode.com", true },
{ "avonture.be", true },
@@ -3899,6 +4125,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "avptp.org", true },
{ "avqueen.cn", true },
{ "avsox.com", true },
+ { "avtek.pl", true },
{ "avticket.ru", false },
{ "avtobania.pro", true },
{ "avtoforex.ru", true },
@@ -3906,7 +4133,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "avtomarket.ru", true },
{ "avtoveles.by", true },
{ "avtovokzaly.ru", true },
- { "avv.li", true },
{ "avvaterra.ch", true },
{ "avvcorda.com", true },
{ "avvocato.bologna.it", true },
@@ -3922,14 +4148,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "awecademy.org", true },
{ "awesome-coconut-software.fr", true },
{ "awesomebouncycastles.co.uk", true },
- { "awesomesit.es", true },
{ "awic.ca", true },
{ "awk.tw", true },
{ "awksolutions.com", true },
{ "awningcanopyus.com", true },
{ "awningsaboveus.com", true },
{ "awningsatlantaga.com", true },
- { "awomaninherprime.com", true },
+ { "awplasticsurgery.com", true },
+ { "awscloudrecipes.com", true },
{ "awsmdev.de", true },
{ "awsome-books.co.uk", true },
{ "awxg.com", true },
@@ -3945,6 +4171,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "axiomer.net", true },
{ "axiomer.org", true },
{ "axisfleetmanagement.co.uk", true },
+ { "axispara-bg.com", true },
{ "axolotlfarm.org", false },
{ "axon-toumpa.gr", true },
{ "axonholdingse.eu", true },
@@ -3955,9 +4182,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ayanomimi.com", true },
{ "aycomba.de", true },
{ "ayesh.me", true },
+ { "aying.love", true },
{ "ayj.solutions", true },
{ "aykutcevik.com", true },
{ "aylak.com", true },
+ { "aylavblog.com", true },
{ "aylesburycastlehire.co.uk", true },
{ "aymerick.fr", true },
{ "aymericlagier.com", true },
@@ -3975,7 +4204,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "azgfd.com", true },
{ "azimut.fr", true },
{ "azino777.ru", true },
- { "azizfirat.com", true },
{ "azizvicdan.com", false },
{ "azlk-team.ru", true },
{ "azmusica.biz", true },
@@ -3993,7 +4221,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "azurecrimson.com", true },
{ "azuriasky.com", true },
{ "azuriasky.net", true },
- { "azuxul.fr", true },
{ "azzorti.com", true },
{ "azzurrapelletterie.it", true },
{ "b-b-law.com", true },
@@ -4007,15 +4234,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "b0rk.com", true },
{ "b1788.net", false },
{ "b1c1l1.com", true },
- { "b1rd.tk", true },
{ "b2and.com", false },
{ "b2bmuzikbank.com", true },
+ { "b303.me", true },
{ "b4bouncycastles.co.uk", true },
{ "b4ckbone.de", true },
{ "b4z.eu", true },
{ "b64.club", true },
{ "b72.com", true },
{ "b72.net", true },
+ { "b767.net", true },
{ "baalsworld.de", true },
{ "baazee.de", true },
{ "babacasino.net", true },
@@ -4058,7 +4286,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bacoux.com", true },
{ "bacsituvansuckhoe.com", true },
{ "bacula.jp", true },
- { "bad-wurzach.de", true },
{ "bad.horse", true },
{ "bad.pet", true },
{ "badam.co", true },
@@ -4072,8 +4299,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "badges.fedoraproject.org", true },
{ "badges.stg.fedoraproject.org", true },
{ "badgesenpatches.nl", true },
- { "badgirlsbible.com", true },
{ "badhusky.com", true },
+ { "badkamermarkt.nl", true },
{ "badlink.org", true },
{ "badmania.fr", true },
{ "badmintonbible.com", true },
@@ -4095,8 +4322,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bageluncle.com", true },
{ "baggy.me.uk", true },
{ "bagheera.me.uk", true },
+ { "baglu.com", false },
+ { "bagni-chimici.roma.it", true },
{ "bagsofbounce.co.uk", true },
{ "bagspecialist.nl", true },
+ { "bagwrap.com", true },
{ "bah.im", false },
{ "bahaiprayers.io", true },
{ "bahnbonus-praemienwelt.de", true },
@@ -4112,22 +4342,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "baildonbouncycastles.co.uk", true },
{ "baileebee.com", true },
{ "bailonga.com", true },
- { "baitulongbaycruises.com", true },
+ { "baitaplamvan.com", true },
+ { "baitcon.com", true },
{ "baiyangliu.com", true },
{ "bajic.ch", true },
{ "baka-gamer.net", true },
{ "baka.network", true },
{ "baka.org.cn", true },
- { "baka.red", true },
{ "bakaproxy.moe", true },
{ "bakermen.com", true },
{ "bakersafari.co", true },
{ "bakeup.be", true },
{ "bakibal.com", true },
- { "bakim.li", true },
{ "bakingstone.com", true },
{ "bakkerinjebuurt.be", true },
- { "bakongcondo.com", true },
{ "balade-commune.ch", true },
{ "baladecommune.ch", true },
{ "balancascia.com.br", true },
@@ -4136,7 +4364,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "balancenaturalhealthclinic.ca", true },
{ "balboa.io", true },
{ "balcaonet.com.br", true },
- { "balcarek.pl", true },
{ "balconnr.com", true },
{ "balconsverdun.com", true },
{ "baldur.cc", true },
@@ -4151,7 +4378,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "balkonien.org", true },
{ "ball-bizarr.de", true },
{ "ball.holdings", true },
- { "ball3d.es", true },
{ "ballarin.cc", true },
{ "ballejaune.com", true },
{ "balletcenterofhouston.com", true },
@@ -4164,12 +4390,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ballroom.info", true },
{ "balmofgilead.org.uk", true },
{ "balslev.io", true },
+ { "balter.com", true },
{ "balticmed.pl", true },
{ "balticnetworks.com", true },
{ "bamahammer.com", true },
+ { "bambooforest.nl", true },
{ "bamboorelay.com", true },
{ "bamily.rocks", true },
{ "bananavapes.com", true },
+ { "bananice.moe", true },
{ "banburybid.com", true },
{ "bancacrs.it", true },
{ "bancaolhares.com.br", true },
@@ -4178,6 +4407,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bancor.network", true },
{ "bandagastrica.es", true },
{ "bandeira1.com.br", true },
+ { "banderasdelmundo.xyz", true },
{ "bandiga.it", true },
{ "bandito.re", true },
{ "banes.ch", true },
@@ -4191,8 +4421,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bangyu.wang", true },
{ "banham.co.uk", true },
{ "banham.com", true },
+ { "bani99.com", true },
{ "banjostringiz.com", true },
{ "bank.simple.com", false },
+ { "bankanswers.gov", true },
{ "bankbranchlocator.com", true },
{ "bankcardoffer.com", true },
{ "bankee.us", true },
@@ -4220,6 +4452,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "baopublishing.it", true },
{ "baptistedeleris.fr", true },
{ "bar-harcourt.com", true },
+ { "bara1.se", true },
{ "barabrume.fr", true },
{ "barans2239.com", true },
{ "baravalle.com", true },
@@ -4228,6 +4461,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "barbarafabbri.com", true },
{ "barbarafeldman.com", true },
{ "barbarians.com", false },
+ { "barbaros.info", true },
{ "barbate.fr", true },
{ "barberlegalcounsel.com", true },
{ "barbershop-harmony.org", true },
@@ -4239,7 +4473,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "barcel.com.mx", true },
{ "barclays.net", true },
{ "barcodeberlin.com", true },
- { "barcoderealty.com", true },
{ "bardes.org", true },
{ "bardiharborow.com", true },
{ "bardiharborow.tk", true },
@@ -4249,11 +4482,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "barisi.me", true },
{ "bariskaragoz.nl", true },
{ "baristador.com", true },
+ { "bariumoxide.com", true },
{ "barkerjr.xyz", true },
{ "barlex.pl", true },
{ "barlotta.net", true },
{ "barnabycolby.io", true },
{ "barnel.com", true },
+ { "barneveldcentrum.nl", true },
{ "barnfotografistockholm.se", true },
{ "barpodsosnami.pl", true },
{ "barracuda.com.tr", true },
@@ -4269,6 +4504,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bart-f.com", true },
{ "barta.me", true },
{ "bartbania.com", true },
+ { "bartel.ws", true },
{ "bartelt.name", true },
{ "barter4crypto.com", true },
{ "barthonia-showroom.de", true },
@@ -4278,6 +4514,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bartula.de", true },
{ "bartzutow.xyz", true },
{ "baruch.me", true },
+ { "barwave.com", true },
{ "bas.co.jp", true },
{ "base-autonome-durable.com", true },
{ "baseballrampage.com", true },
@@ -4287,7 +4524,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "basedonline.nl", true },
{ "baselang.com", true },
{ "baseline.ba", true },
- { "basementdoctor.com", true },
{ "basementdoctornorthwest.com", true },
{ "basementfinishingohio.com", true },
{ "basementwaterproofingdesmoines.com", true },
@@ -4296,8 +4532,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bashstreetband.co.uk", true },
{ "basicapparel.de", true },
{ "basicattentiontoken.org", true },
+ { "basics.net", true },
{ "basketball-brannenburg.de", true },
- { "basnoslovno.com.ua", false },
{ "basnoslovno.ru", true },
{ "basonlinemarketing.nl", true },
{ "bass-pro.ru", true },
@@ -4311,6 +4547,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bastiv.com", true },
{ "bastolino.de", true },
{ "basw.eu", true },
+ { "baswag.de", true },
{ "baswetter.photography", true },
{ "basyspro.net", true },
{ "batcave.tech", true },
@@ -4319,6 +4556,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "batiburrillo.net", true },
{ "batipresta.ch", true },
{ "batistareisfloresonline.com.br", true },
+ { "batkave.net", true },
{ "batlab.ch", true },
{ "batolis.com", true },
{ "batook.org", true },
@@ -4332,6 +4570,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "baugeldspezi.de", true },
{ "baugemeinschaftbernstein.de", true },
{ "baumannfabrice.com", true },
+ { "baumkuchen-aus-dresden.de", true },
{ "baur.de", true },
{ "bausep.de", true },
{ "baustils.com", true },
@@ -4340,6 +4579,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bauunternehmen-herr.de", true },
{ "bauwens.cloud", true },
{ "bavartec.de", true },
+ { "bawbby.com", true },
{ "bayareaenergyevents.com", true },
{ "baychimo.com", true },
{ "bayden.com", true },
@@ -4364,6 +4604,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "baytalebaa.com", true },
{ "baywatch.io", true },
{ "bayz.de", true },
+ { "baza-gai.com.ua", true },
{ "bazaarbhaav.com", true },
{ "bazaarcompass.com", true },
{ "bazdell.com", true },
@@ -4387,6 +4628,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bblsa.ch", true },
{ "bbnbb.de", true },
{ "bbnx.net", true },
+ { "bbs8080.net", true },
+ { "bbsec.xyz", true },
{ "bbuio.com", false },
{ "bbw.dating", true },
{ "bbwcs.co.uk", true },
@@ -4410,7 +4653,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bcmguide.com", true },
{ "bcmhire.co.uk", true },
{ "bcpc-ccgpfcheminots.com", true },
+ { "bcrook.com", true },
{ "bcswampcabins.com", true },
+ { "bcubic.net", true },
{ "bcvps.com", true },
{ "bcyw56.live", false },
{ "bd2positivo.com", true },
@@ -4461,12 +4706,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "beautyevent.fr", true },
{ "beautykat.ru", true },
{ "beaverdamautos.com", true },
+ { "beavertales.ca", true },
+ { "bebeautiful.business", true },
{ "bebef.de", true },
{ "bebefofuxo.com.br", true },
{ "bebes.uno", true },
{ "bebest.gov", false },
{ "bebetrotteur.com", true },
- { "bebout.domains", true },
{ "bebout.pw", true },
{ "beckenhamcastles.co.uk", true },
{ "beckerantiques.com", true },
@@ -4478,7 +4724,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bedandbreakfasthoekvanholland.com", true },
{ "bedels.nl", true },
{ "bedfordnissanparts.com", true },
- { "bednar.co", true },
{ "bedrijfsfotoreportages.nl", true },
{ "bedrijfshulpverleningfriesland.nl", true },
{ "bedrijfsportaal.nl", true },
@@ -4486,6 +4731,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bedste10.dk", true },
{ "bee-creative.nl", true },
{ "bee-line.org.uk", true },
+ { "bee-social.it", true },
{ "bee.clothing", true },
{ "bee.tools", true },
{ "beechwoodmetalworks.com", true },
@@ -4518,6 +4764,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "beerjet.sk", true },
{ "beerjetcz.cz", true },
{ "beerly.eu", true },
+ { "beermedlar.com", true },
{ "beerradar.no", true },
{ "beerradar.party", true },
{ "beersconf.com", true },
@@ -4533,7 +4780,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "beframed.ch", true },
{ "befreewifi.info", true },
{ "befundonline.de", true },
- { "begabungsfoerderung.info", true },
{ "begbie.com", true },
{ "beginatzero.com", true },
{ "beginner.nl", true },
@@ -4541,9 +4787,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "behamepresrdce.sk", true },
{ "behamzdarma.cz", true },
{ "behead.de", true },
+ { "beherit.pl", true },
{ "behindthethrills.com", true },
{ "behna24hodin.cz", true },
- { "behoerden-online-dienste.de", true },
{ "behoreal.cz", true },
{ "bei18.com", true },
{ "beichtgenerator.de", true },
@@ -4557,6 +4803,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "belacapa.com.br", true },
{ "belanglos.de", true },
{ "belani.eu", true },
+ { "belanja.express", true },
{ "belarto.be", true },
{ "belarto.de", true },
{ "belarto.es", true },
@@ -4592,10 +4839,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "belly-button-piercings.com", true },
{ "bellyandbrain.amsterdam", true },
{ "belmontgoessolar.org", true },
+ { "belos.at", true },
{ "belouga.org", true },
{ "belt.black", true },
+ { "beltar.nl", true },
{ "belvoirbouncycastles.co.uk", true },
{ "bely-mishka.by", true },
+ { "belyoung.com.br", true },
{ "bemcorp.de", true },
{ "bemindly.com", true },
{ "bemsoft.pl", true },
@@ -4606,6 +4856,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "benabrams.it", true },
{ "benandsarah.life", true },
{ "benary.org", true },
+ { "benbalter.com", true },
{ "benbozsa.ca", true },
{ "benburwell.com", true },
{ "benc.io", true },
@@ -4620,6 +4871,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bendyworks.com", true },
{ "beneathvt.com", true },
{ "benedict-balzer.de", true },
+ { "benefitshub.io", true },
+ { "benefitshub.xyz", true },
{ "benepiscinas.com.br", true },
{ "beneri.se", true },
{ "benevita.bio", true },
@@ -4633,13 +4886,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "benjamin.pe", true },
{ "benjaminbedard.com", true },
{ "benjaminblack.net", true },
- { "benjamindietrich.de", true },
{ "benjaminjurke.com", true },
{ "benjaminkopelke.com", true },
{ "benjaminpiquet.fr", true },
{ "benjamins.com", true },
{ "benjaminvasel.de", true },
{ "benjii.me", true },
+ { "benjijaldoner.nl", true },
{ "benleemd.com", true },
{ "benmatthews.com.au", true },
{ "benmillett.us", false },
@@ -4649,8 +4902,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bennierobinson.com", true },
{ "bennink.me", true },
{ "benno.frl", true },
+ { "benny003.de", true },
{ "bennygommers.nl", true },
- { "bennythink.com", true },
{ "benriya.shiga.jp", true },
{ "bensbouncycastles.co.uk", true },
{ "benschnarr.com", true },
@@ -4664,6 +4917,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bentongroup.co.uk", true },
{ "bentonweatherstone.co.uk", true },
{ "bentrask.com", true },
+ { "benvds.com", true },
{ "benz-hikaku.com", true },
{ "benzi.io", true },
{ "beoordelingen.be", true },
@@ -4673,7 +4927,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bequiia.com", true },
{ "beranovi.com", true },
{ "berasavocate.com", true },
+ { "beraten-entwickeln-steuern.de", true },
+ { "berati.tv", true },
{ "berdu.id", true },
+ { "berg-freunde.at", true },
+ { "berg-freunde.ch", true },
{ "bergenhave.nl", true },
{ "berger-chiro.com", true },
{ "bergevoet-fa.nl", true },
@@ -4703,7 +4961,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "berlin-flirt.de", true },
{ "berlin.dating", true },
{ "bermeitinger.eu", true },
- { "berna.fr", true },
+ { "bermos.net", true },
{ "bernadetteanderes.ch", true },
{ "bernardcontainers.be", true },
{ "bernarddickens.com", true },
@@ -4720,6 +4978,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bernhardkau.de", true },
{ "bernhardluginbuehl.ch", true },
{ "bernhardluginbuehl.com", true },
+ { "bernieware.de", true },
{ "berodes.be", true },
{ "berr.yt", true },
{ "berra.se", true },
@@ -4771,7 +5030,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "best-wallpaper.net", true },
{ "best10websitebuilders.com", true },
{ "best2pay.net", true },
- { "best66.me", true },
{ "bestattungen-kammerer.de", true },
{ "bestattungshaus-kammerer.de", true },
{ "bestautoinsurance.com", true },
@@ -4797,13 +5055,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bestinver.es", false },
{ "bestjumptrampolines.be", true },
{ "bestkenmoredentists.com", true },
- { "bestlashesandbrows.com", true },
+ { "bestlooperpedalsguide.com", true },
{ "bestmotherfucking.website", true },
{ "bestoffert.club", true },
{ "bestoliveoils.com", true },
{ "bestpal.eu", true },
{ "bestpartyhire.com", true },
- { "bestpig.fr", true },
+ { "bestperfumebrands.com", true },
{ "bestplumbing.com", true },
{ "bestpractice.domains", true },
{ "bestschools.io", true },
@@ -4821,6 +5079,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "betaworx.de", true },
{ "betaworx.eu", true },
{ "betecnet.de", true },
+ { "bethanyduke.com", true },
{ "bethpage.net", true },
{ "betobaccofree.gov", true },
{ "betonbit.com", true },
@@ -4843,6 +5102,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "betterjapanese.xyz", true },
{ "betterna.me", true },
{ "betterscience.org", true },
+ { "bettersecurity.co", true },
{ "bettertechinterviews.com", true },
{ "bettertest.it", true },
{ "bettertime.de", true },
@@ -4867,10 +5127,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bevinco2020.com", true },
{ "bevinsco.org", true },
{ "bevnut.com", true },
+ { "bewegigsruum.ch", true },
{ "bewegungsfluss.com", false },
{ "bewerbungsfibel.de", true },
{ "bewerbungsfoto-deinfoto.ch", true },
- { "bewertet.de", true },
{ "bewonderen.com", true },
{ "bexit.nl", true },
{ "bexleycastles.co.uk", true },
@@ -4887,15 +5147,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "beyonic.com", true },
{ "beyours.be", true },
{ "bezemkast.nl", true },
+ { "bezlampowe.pl", true },
{ "bezpecnostsiti.cf", true },
+ { "bezposrednio.net.pl", true },
{ "bezr.co.uk", true },
{ "bezzia.com", true },
{ "bf7088.com", true },
{ "bf7877.com", true },
{ "bfam.tv", true },
+ { "bfcgermania88.de", true },
{ "bfem.gov", true },
{ "bfgcdn.com", true },
{ "bflix.tv", true },
+ { "bfob.gg", true },
{ "bforb.sk", true },
{ "bfp-mail.de", true },
{ "bfpg.org", true },
@@ -4904,11 +5168,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bfw-online.de", true },
{ "bgbhsf.top", true },
{ "bgeo.io", true },
- { "bgfashion.net", true },
{ "bgfoto.info", true },
{ "bghost.xyz", true },
{ "bgkoleda.bg", true },
{ "bglsingles.de", true },
+ { "bgmn.me", true },
{ "bgp.space", true },
{ "bgr34.cz", true },
{ "bgs-game.com", true },
@@ -4928,10 +5192,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "biaggeo.com", true },
{ "biano-ai.com", true },
{ "biasmath.es", true },
+ { "biathloncup.ru", true },
{ "bibica.net", true },
{ "bible-maroc.com", true },
{ "bible.ru", true },
{ "bibleonline.ru", true },
+ { "bibles.com.tw", true },
{ "biblethoughts.blog", true },
{ "bibliaon.com", true },
{ "biblio.wiki", true },
@@ -4948,12 +5214,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bicranial.io", true },
{ "bicycle-events.com", true },
{ "bicycleframeiz.com", true },
+ { "bicycleuniverse.com", true },
{ "biddl.com", true },
{ "biddle.co", true },
{ "bidman.cz", true },
{ "bidman.eu", true },
{ "bidu.com.br", true },
{ "bie.edu", false },
+ { "bie08.com", true },
+ { "bie35.com", true },
+ { "bie79.com", true },
{ "biegal.ski", true },
{ "biegner-technik.de", true },
{ "biehl.tech", true },
@@ -4962,8 +5232,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bien-etre-sante.info", true },
{ "bienici.com", true },
{ "bienoubien.org", true },
- { "biensenvue.com", true },
- { "bienstar.tv", true },
{ "bierbaumer.net", true },
{ "biergaizi.info", true },
{ "bieser.ch", true },
@@ -4986,7 +5254,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bigideasnetwork.com", true },
{ "bigio.com.br", true },
{ "biglou.com", false },
- { "bignumworks.com", true },
{ "bigorbitgallery.org", true },
{ "bigserp.com", true },
{ "bigshopper.com", true },
@@ -5001,6 +5268,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bijoux.com.br", true },
{ "bijouxcherie.com", true },
{ "biju-neko.jp", true },
+ { "bijuteriicualint.ro", true },
{ "bike-discount.de", true },
{ "bike-kurse.ch", true },
{ "bike-shack.com", true },
@@ -5020,13 +5288,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bildkomponist.de", true },
{ "bildschirmflackern.de", true },
{ "biletyplus.by", true },
- { "biletyplus.com", true },
{ "biletyplus.ua", true },
{ "bilgo.com", true },
{ "bilibili.link", true },
+ { "bilibili.red", true },
{ "bilimoe.com", true },
{ "bilke.org", true },
{ "billaud.eu.org", true },
+ { "billfazz.com", true },
{ "billgoldstein.name", true },
{ "billhartzer.com", true },
{ "billiger-mietwagen.de", true },
@@ -5045,8 +5314,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "billyoh.com", true },
{ "billysbouncycastlehire.co.uk", true },
{ "billywig.stream", true },
- { "biloplysninger.dk", true },
- { "bilsho.com", true },
{ "biltullen.com", true },
{ "bimbo.com", false },
{ "bimbo.com.ar", false },
@@ -5060,7 +5327,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "binans.io", true },
{ "binans.net", true },
{ "binans.xyz", true },
- { "binarization.com", true },
{ "binaryapparatus.com", true },
{ "binaryappdev.com", true },
{ "binarycreations.scot", true },
@@ -5083,6 +5349,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bio-disinfestazione.it", true },
{ "bio-feed.org", true },
{ "bio24.si", true },
+ { "bioastin.de", true },
{ "bioatelier.it", true },
{ "biobuttons.ch", true },
{ "biocheminee.com", true },
@@ -5116,6 +5383,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "biometrics.es", true },
{ "biomin.co.uk", true },
{ "biomodra.cz", true },
+ { "biopronut.com", true },
{ "biopsychiatry.com", true },
{ "bioresonanz-ibiza.com", true },
{ "biosafe.ch", true },
@@ -5139,7 +5407,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "birgit-rydlewski.de", true },
{ "birgitandmerlin.com", true },
{ "birkenstab.de", true },
- { "birkhoff.me", true },
{ "birminghamcastlehire.co.uk", true },
{ "birminghamsunset.com", true },
{ "birthdaytip.com", true },
@@ -5175,7 +5442,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bitbucket.io", true },
{ "bitbucket.org", true },
{ "bitburner.de", true },
- { "bitcalt.eu.org", true },
+ { "bitcert.com", true },
{ "bitchigo.com", true },
{ "bitcoin-india.net", true },
{ "bitcoin-india.org", true },
@@ -5204,7 +5471,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bitfehler.net", true },
{ "bitfence.io", true },
{ "bitfinder.nl", true },
- { "bitfolio.org", true },
{ "bitfuse.net", true },
{ "bitgo.com", true },
{ "bitgrapes.com", true },
@@ -5229,16 +5495,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bitpoll.org", true },
{ "bitpumpe.net", true },
{ "bitref.com", true },
+ { "bitrefill.com", true },
{ "bitrush.nl", true },
{ "bits-hr.de", true },
{ "bitsafe.com.my", true },
- { "bitsburg.ru", true },
{ "bitski.com", true },
{ "bitskins.co", true },
{ "bitskrieg.net", true },
{ "bitso.com", true },
{ "bitsoffreedom.nl", true },
- { "bitstep.ca", true },
{ "bitstorm.nl", true },
{ "bitstorm.org", true },
{ "bitsum.com", true },
@@ -5250,8 +5515,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bitvest.io", true },
{ "bitwarden.com", true },
{ "bitwolk.nl", true },
+ { "bitxel.com.co", true },
{ "biupay.com.br", true },
{ "biurokarier.edu.pl", true },
+ { "bixbydevelopers.com", true },
{ "bixservice.com", true },
{ "biyou-homme.com", true },
{ "biz4x.com", true },
@@ -5265,6 +5532,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "biztera.com", true },
{ "biztok.eu", true },
{ "biztouch.work", true },
+ { "bizzdesign.cloud", true },
{ "bizzdesign.com", true },
{ "bjarnerest.de", true },
{ "bjmgeek.science", true },
@@ -5274,12 +5542,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bjornjohansen.no", true },
{ "bjs.gov", true },
{ "bjsbouncycastles.com", true },
- { "bk-wife.com", true },
{ "bkentertainments.co.uk", true },
+ { "bkhayes.com", true },
{ "bkhpilates.co.uk", true },
{ "bkkposn.com", true },
{ "bklaindia.com", true },
{ "bkositspartytime.co.uk", true },
+ { "bkt.to", true },
{ "bl00.se", true },
{ "bl4ckb0x.biz", true },
{ "bl4ckb0x.com", true },
@@ -5290,39 +5559,38 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bl4ckb0x.org", true },
{ "blaauwgeers.pro", true },
{ "blabber.im", true },
- { "blablacar.co.uk", true },
- { "blablacar.com", true },
- { "blablacar.com.tr", true },
- { "blablacar.com.ua", true },
- { "blablacar.de", true },
- { "blablacar.es", true },
- { "blablacar.fr", true },
- { "blablacar.hr", true },
- { "blablacar.hu", true },
- { "blablacar.in", true },
- { "blablacar.it", true },
- { "blablacar.mx", true },
- { "blablacar.nl", true },
- { "blablacar.pl", true },
- { "blablacar.pt", true },
- { "blablacar.ro", true },
- { "blablacar.rs", true },
- { "blablacar.ru", true },
- { "black-gay-porn.biz", true },
+ { "blablacar.co.uk", false },
+ { "blablacar.com", false },
+ { "blablacar.com.tr", false },
+ { "blablacar.com.ua", false },
+ { "blablacar.de", false },
+ { "blablacar.es", false },
+ { "blablacar.fr", false },
+ { "blablacar.hr", false },
+ { "blablacar.hu", false },
+ { "blablacar.in", false },
+ { "blablacar.it", false },
+ { "blablacar.mx", false },
+ { "blablacar.nl", false },
+ { "blablacar.pl", false },
+ { "blablacar.pt", false },
+ { "blablacar.ro", false },
+ { "blablacar.rs", false },
+ { "blablacar.ru", false },
{ "black-khat.com", true },
{ "black-mail.nl", true },
- { "black-pool.net", true },
{ "black-raven.fr", true },
{ "black.dating", true },
{ "black.host", true },
+ { "black1ce.com", true },
{ "blackandpony.de", true },
{ "blackbag.nl", true },
{ "blackbase.de", true },
{ "blackbird-whitebird.com", true },
+ { "blackbyte.it", true },
{ "blackcat.ca", true },
{ "blackcatinformatics.ca", true },
{ "blackcatinformatics.com", true },
- { "blackcicada.com", true },
{ "blackdotbrewery.com", true },
{ "blackdown.de", true },
{ "blackedbyte.com", true },
@@ -5338,6 +5606,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "blackjackballroomcasino.info", true },
{ "blackl.net", true },
{ "blacklightparty.be", true },
+ { "blackmagicshaman.com", true },
{ "blackmonday.gr", true },
{ "blacknetwork.eu", true },
{ "blacknova.io", true },
@@ -5352,18 +5621,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "blacktown.eu", true },
{ "blackyau.cc", true },
{ "blackys-chamber.de", true },
+ { "blaindalefarms.com", true },
{ "blaise.io", true },
{ "blakecoin.org", true },
{ "blakekhan.com", true },
{ "blakezone.com", true },
{ "blameomar.com", true },
{ "blancodent.com", true },
- { "blankersfamily.com", true },
{ "blanket.technology", true },
+ { "blantr.com", true },
{ "blasorchester-runkel.de", true },
{ "blastentertainment.com.au", true },
{ "blastersklan.com", true },
{ "blastzoneentertainments.co.uk", true },
+ { "blatnice.cf", true },
+ { "blatnice.ga", true },
+ { "blatnice.gq", true },
+ { "blatnice.ml", true },
+ { "blatnice.tk", true },
{ "blaudev.es", true },
{ "blauerhunger.de", true },
{ "blayne.me", true },
@@ -5375,6 +5650,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bleche-onlineshop.de", true },
{ "blechinger.io", true },
{ "blechschmidt.saarland", true },
+ { "blend.guru", true },
{ "blenderinsider.com", true },
{ "blenderrecipereviews.com", true },
{ "blending.kr", true },
@@ -5385,23 +5661,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "blenheimears.com", true },
{ "blenneros.net", false },
{ "blessedguy.com", true },
- { "blessedguy.net", false },
{ "blewebprojects.com", true },
{ "blichmann.eu", true },
+ { "blicy.net", true },
{ "blidz.com", true },
{ "blieque.co.uk", true },
{ "bliesekow.net", true },
{ "blikk.no", true },
- { "blikund.swedbank.se", true },
{ "blinder.com.co", true },
{ "blindpigandtheacorn.com", true },
{ "blinds-unlimited.com", true },
{ "blingsparkleshine.com", true },
+ { "blingwang.cn", true },
{ "blink-security.com", true },
{ "blinking.link", true },
{ "blinkspeed.eu", true },
{ "blio.tk", true },
{ "blip.website", true },
+ { "blissjoe.com", true },
{ "blissplan.com", true },
{ "blitzprog.org", true },
{ "blivawesome.dk", true },
@@ -5413,11 +5690,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "blm.gov", true },
{ "blo-melchiorshausen.de", true },
{ "blobfolio.com", true },
+ { "blocher.ch", true },
+ { "blochoestergaard.com", true },
{ "block-this.com", true },
{ "block65.com", true },
{ "blockchain.com", true },
{ "blockchain.info", true },
+ { "blockchainced.com", true },
{ "blockchaindaigakko.jp", true },
+ { "blockchainevents.nl", true },
{ "blockchainwhiz.com", true },
{ "blockcheck.network", true },
{ "blockedyourcar.com", true },
@@ -5434,10 +5715,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "blog.linode.com", false },
{ "blog.lookout.com", false },
{ "blogaid.net", true },
+ { "bloganchoi.com", true },
{ "blogarts.net", true },
{ "blogbooker.com", true },
{ "blogconcours.net", true },
{ "blogdelosjuguetes.com", true },
+ { "blogdieconomia.it", true },
+ { "blogdimoda.com", true },
{ "blogdimotori.it", true },
{ "blogexpert.ca", true },
{ "bloggermumofthreeboys.com", true },
@@ -5445,13 +5729,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bloggingwithchildren.com", true },
{ "bloggytalky.com", true },
{ "bloginbeeld.nl", true },
+ { "blogit.fi", true },
{ "bloglines.co.za", true },
{ "bloglogistics.com", true },
+ { "bloglyric.com", true },
{ "blogom.at", true },
{ "blogpentrusuflet.ro", true },
{ "blogreen.org", true },
{ "blogsdna.com", true },
{ "blogthedayaway.com", true },
+ { "blogtroterzy.pl", true },
{ "blok56.nl", true },
{ "blokmy.com", true },
{ "bloodhunt.pl", true },
@@ -5466,13 +5753,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bltc.org.uk", true },
{ "bltdirect.com", true },
{ "blubberladen.de", true },
+ { "blubop.fr", true },
{ "blue-gmbh-erfahrungen.de", true },
{ "blue-gmbh.de", true },
{ "blue-leaf81.net", true },
{ "blue42.net", true },
{ "bluebahari.gq", true },
{ "blueblou.com", true },
- { "bluecards.eu", true },
{ "bluechilli.com", true },
{ "bluecon.ninja", true },
{ "bluecrazii.nl", true },
@@ -5485,20 +5772,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bluekrypt.com", true },
{ "blueliquiddesigns.com.au", true },
{ "bluemeda.web.id", true },
- { "bluemoonroleplaying.com", true },
{ "bluemosh.com", true },
{ "bluemtnrentalmanagement.ca", true },
{ "bluenote9.com", true },
{ "blueoakart.com", true },
- { "blueoceantech.us", true },
{ "blueperil.de", true },
{ "bluepoint.one", true },
{ "bluepostbox.de", true },
+ { "bluepromocode.com", true },
{ "bluerootsmarketing.com", true },
{ "blueskycoverage.com", true },
{ "bluestardiabetes.com", true },
{ "bluesuncamping.com", true },
{ "bluesunhotels.com", true },
+ { "blueswandaily.com", true },
{ "bluetexservice.com", true },
{ "bluewavewebdesign.com", true },
{ "bluex.im", true },
@@ -5506,7 +5793,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bluex.net", true },
{ "bluex.org", true },
{ "blueyed.eu", true },
- { "blui.ml", true },
{ "bluiandaj.ml", true },
{ "bluimedia.com", true },
{ "blumenfeldart.com", true },
@@ -5524,6 +5810,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bmhglobal.com.au", true },
{ "bminton.is-a-geek.net", true },
{ "bmk-kramsach.at", true },
+ { "bmoattachments.org", true },
{ "bmone.net", true },
{ "bmriv.com", true },
{ "bmros.com.ar", true },
@@ -5547,7 +5834,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "boattrader.com.au", true },
{ "bobaly.es", true },
{ "bobancoamigo.com", true },
- { "bobaobei.net", true },
{ "bobazar.com", true },
{ "bobcopeland.com", true },
{ "bobkidbob.com", true },
@@ -5590,6 +5876,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "boiseonlinemall.com", true },
{ "boisewaldorf.org", true },
{ "bokadoktorn-test.net", true },
+ { "bokadoktorn.se", true },
{ "boke112.com", true },
{ "bokka.com", true },
{ "bokkeriders.com", true },
@@ -5597,6 +5884,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "boldmediagroup.com", true },
{ "boldt-metallbau.de", true },
{ "bolektro.de", true },
+ { "boleyn.su", true },
{ "bolgarnyelv.hu", true },
{ "bolivarfm.com.ve", true },
{ "bologna-disinfestazioni.it", true },
@@ -5615,7 +5903,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bonami.sk", true },
{ "bonawehouse.co.uk", true },
{ "bonbonmania.com", true },
- { "bondagefetishstore.com", true },
{ "bondank.com", true },
{ "bondarenko.dn.ua", true },
{ "bondingwithbaby.ca", true },
@@ -5626,7 +5913,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bonesserver.com", true },
{ "bonfi.net", true },
{ "bongo.cat", true },
- { "bonibuty.com", true },
{ "bonifacius.be", true },
{ "bonito.pl", true },
{ "bonnant-associes.ch", true },
@@ -5634,6 +5920,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bonnebouffe.fr", true },
{ "bonniecoloring.com", true },
{ "bonniedraw.com", true },
+ { "bonniekitchen.com", true },
{ "bonnieradvocaten.nl", true },
{ "bonnsustainabilityportal.de", true },
{ "bonnyprints.at", true },
@@ -5655,13 +5942,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bookingapp.nl", true },
{ "bookingready.com", true },
{ "bookingslog.com", true },
- { "bookingworldspeakers.com", false },
+ { "bookingworldspeakers.com", true },
{ "bookluk.com", true },
{ "bookmein.in", true },
{ "booksearch.jp", true },
{ "booksinthefridge.at", true },
{ "booksouthafrica.travel", true },
{ "booktracker-org.appspot.com", true },
+ { "bookzaga.com", true },
{ "bool.be", true },
{ "boombv.com", true },
{ "boomersurf.com", true },
@@ -5677,12 +5965,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "booox.pw", true },
{ "boop.gq", true },
{ "boop.pro", true },
+ { "booplab.com", true },
{ "booq.org", true },
{ "booquiz.com", true },
{ "boosinflatablegames.co.uk", true },
{ "boost.fyi", true },
{ "boost.ink", true },
+ { "boothlabs.me", true },
{ "bootjp.me", false },
+ { "bootsschule-weiss.de", true },
{ "bopiweb.com", true },
{ "bopp.org", true },
{ "borahan.net", true },
@@ -5690,7 +5981,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bordadoenpedreria.com", true },
{ "bordes.me", true },
{ "boredhackers.com", true },
+ { "boreo.si", true },
{ "borg.cloud", true },
+ { "borgodigatteraia.it", true },
{ "boringsmith.com", true },
{ "boris64.net", true },
{ "borisenko.by", true },
@@ -5708,6 +6001,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "boskeopolis-stories.com", true },
{ "boss.az", true },
{ "bostadsportal.se", true },
+ { "bostonadvisors.com", true },
{ "bosufitness.cz", true },
{ "bosun.io", true },
{ "bot-manager.pl", true },
@@ -5715,6 +6009,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "botguard.net", true },
{ "bothellwaygarage.net", true },
{ "botoes-primor.pt", true },
+ { "botox.bz", true },
+ { "botserver.de", true },
{ "bottaerisposta.net", true },
{ "bottineauneighborhood.org", true },
{ "bottke.berlin", true },
@@ -5780,6 +6076,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bouncingbuddiesleicester.co.uk", true },
{ "bouncinghigher.co.uk", true },
{ "bouncingscotland.com", true },
+ { "bouncourseplanner.net", true },
{ "bouncy-castles-surrey.co.uk", true },
{ "bouncy-tots.co.uk", true },
{ "bouncybaileys.co.uk", true },
@@ -5791,7 +6088,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bouncycastlehire-norwich.com", true },
{ "bouncycastlehire-sheffield.co.uk", true },
{ "bouncycastlehire.co.uk", true },
- { "bouncycastlehireauckland.co.nz", true },
{ "bouncycastlehirebarnstaple.co.uk", true },
{ "bouncycastlehirebexley.co.uk", true },
{ "bouncycastlehirechelmsford.org.uk", true },
@@ -5860,13 +6156,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bowntycdn.net", true },
{ "boxpeg.com", true },
{ "boxpirates.to", true },
+ { "boxspringbett-160x200.de", true },
{ "boxvergelijker.nl", true },
{ "boyerassoc.com", true },
{ "boyfriendcookbook.com", true },
{ "boyhost.cn", true },
{ "boyinglanguage.com", true },
{ "boyntonobserver.org", true },
- { "boypoint.de", true },
+ { "boysontech.com", true },
{ "boz.nl", false },
{ "bozdoz.com", true },
{ "bozit.com.au", true },
@@ -5875,6 +6172,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bpastudies.org", true },
{ "bpo.ovh", true },
{ "bpol-forum.de", true },
+ { "bps.vc", true },
{ "bqp.io", true },
{ "bqr.ch", true },
{ "br.search.yahoo.com", false },
@@ -5906,6 +6204,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "brainserve.ch", true },
{ "brainserve.com", true },
{ "brainserve.swiss", true },
+ { "brainsik.net", true },
{ "brainster.co", true },
{ "brainvation.de", true },
{ "brainvoyagermusic.com", true },
@@ -5935,11 +6234,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "brandonwalker.me", true },
{ "brandrocket.dk", true },
{ "brandstead.com", true },
+ { "brandtrapselfie.nl", true },
{ "brandweerfraneker.nl", true },
{ "brandweertrainingen.nl", true },
{ "brandweeruitgeest.nl", true },
{ "brank.as", true },
- { "branw.xyz", true },
+ { "branw.xyz", false },
{ "brasal.ma", true },
{ "brasalcosmetics.com", true },
{ "brashear.me", true },
@@ -5969,12 +6269,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "brazilian.dating", true },
{ "brazillens.com", true },
{ "brazoriabar.org", true },
+ { "brb.city", true },
{ "brck.nl", true },
{ "brd.ro", true },
{ "breadandlife.org", true },
{ "breadofgod.org", true },
{ "breakingtech.it", true },
{ "breakpoint.at", true },
+ { "breakwall.ml", true },
{ "breaky.de", true },
{ "breathedreamgo.com", true },
{ "breathingblanket.com", true },
@@ -5993,7 +6295,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "brefy.com", true },
{ "brege.org", true },
{ "breitband.bz.it", true },
- { "breitbild-beamer.de", true },
{ "brejoc.com", true },
{ "brelahotelberulia.com", true },
{ "bremen-restaurants.de", true },
@@ -6006,13 +6307,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bretcarmichael.com", true },
{ "brettabel.com", true },
{ "brettcornwall.com", true },
- { "brettelliff.com", true },
{ "brettlawyer.com", true },
{ "brettw.xyz", true },
{ "bretzner.fr", true },
{ "brevboxar.se", true },
{ "brewsouth.com", true },
- { "breznet.com", true },
+ { "brewspark.co", true },
+ { "brewvo.com", true },
{ "brgins.com", true },
{ "brian-gordon.name", true },
{ "brianalaway.com", true },
@@ -6033,7 +6334,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bricolajeux.ch", true },
{ "brid.gy", false },
{ "bridalshoes.com", true },
- { "brideandgroomdirect.ie", true },
{ "bridgedirectoutreach.com", true },
{ "bridgeglobalmarketing.com", true },
{ "bridgehomeloans.com", true },
@@ -6041,32 +6341,32 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bridgevest.com", true },
{ "bridgingdirectory.com", true },
{ "bridltaceng.com", true },
- { "bridzius.lt", true },
{ "brie.tech", true },
{ "briefassistant.com", true },
{ "briefhansa.de", true },
{ "briefvorlagen-papierformat.de", true },
{ "brier.me", true },
{ "briffoud.fr", true },
- { "briggsleroux.com", true },
{ "brighouse-leisure.co.uk", true },
{ "brightday.bz", true },
{ "brightendofleasecleaning.com.au", true },
- { "brightlifedirect.com", true },
{ "brightonbank.com", true },
{ "brightonbouncycastles.net", true },
{ "brightonchilli.org.uk", true },
{ "brightonzhang.com", true },
+ { "brightside.com", true },
{ "brightworkcreative.com", true },
{ "brigidaarie.com", true },
{ "brilliantbouncyfun.co.uk", true },
{ "brilliantproductions.co.nz", true },
{ "brimspark.systems", true },
{ "brio-shop.ch", true },
+ { "briograce.com.mx", true },
{ "brioukraine.store", true },
{ "brisbanelogistics.com.au", true },
{ "bristebein.com", true },
{ "bristolandwestonsuperbounce.com", true },
+ { "britanniacateringyeovil.co.uk", true },
{ "britanniapandi.com", true },
{ "britelocate.com", true },
{ "britishbeef.com", true },
@@ -6075,12 +6375,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "britishpearl.com", true },
{ "britishsciencefestival.org", true },
{ "britishscienceweek.org", true },
+ { "britishsfaward.org", true },
{ "britishsnoring.co.uk", true },
{ "britneyclause.com", true },
{ "brittanyferriesnewsroom.com", true },
{ "britton-photography.com", true },
{ "brk.st", true },
{ "brmsalescommunity.com", true },
+ { "brn.by", true },
{ "brnojebozi.cz", true },
{ "bro.hk", true },
{ "broadbandnd.com", true },
@@ -6094,22 +6396,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "broersma.com", true },
{ "broeselei.at", true },
{ "brokenhands.io", true },
+ { "brokernet.ie", false },
{ "brokervalues.com", true },
{ "brompton-cocktail.com", true },
{ "bronetb2b.com.br", true },
{ "bronevichok.ru", true },
{ "bronwynlewis.com", true },
{ "broodbesteld.nl", true },
- { "brooke-fan.com", true },
{ "brookehatton.com", false },
{ "brooklynrealestateblog.com", true },
{ "brookworth.com", true },
{ "brossmanit.com", true },
- { "brother-printsmart.nl", true },
{ "brouillard.ch", true },
{ "brouwerijdeblauweijsbeer.nl", true },
{ "brovelton.com", true },
- { "brown-devost.com", true },
{ "brownfieldstsc.org", true },
{ "brownihc.com", true },
{ "browntowncountryclub.com", true },
@@ -6119,9 +6419,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "brring.com", true },
{ "brrr.fr", true },
{ "bru6.de", true },
+ { "brubank.com", true },
{ "brubankv1-staging.azurewebsites.net", true },
{ "brucekovner.com", true },
{ "brucemartin.net", true },
+ { "brucemobile.de", false },
{ "bruck.me", true },
{ "bruckner.li", true },
{ "brudkista.nu", true },
@@ -6135,22 +6437,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "brunner.ninja", true },
{ "brunohenc.from.hr", true },
{ "brunoproduit.ch", true },
- { "brunoramos.com", true },
{ "brunosouza.org", true },
{ "brush.ninja", true },
- { "brutus2.ga", true },
+ { "brushcreekyachts.com", true },
{ "bruun.co", true },
{ "bry.do", true },
{ "bryankaplan.com", true },
{ "bryanquigley.com", true },
{ "bryansmith.net", true },
{ "bryansmith.tech", true },
+ { "bryantzheng.com", true },
+ { "bryantzheng.org", true },
{ "brycecanyon.net", true },
{ "brycecanyonnationalpark.com", true },
{ "bryggebladet.dk", true },
{ "brzy-svoji.cz", true },
{ "bs-network.net", true },
{ "bs-security.com", true },
+ { "bs.sb", true },
{ "bs.to", true },
{ "bs12v.ru", true },
{ "bsa157.org", true },
@@ -6161,7 +6465,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bsd-box.net", true },
{ "bsdes.net", true },
{ "bsdfreak.dk", true },
- { "bsdlab.com", true },
{ "bsdracing.ca", true },
{ "bsdunix.xyz", true },
{ "bsee.gov", true },
@@ -6173,10 +6476,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bsidessf.com", true },
{ "bsimerch.com", true },
{ "bslim-e-boutique.com", true },
+ { "bsmomo-api.com", true },
{ "bso-buitengewoon.nl", true },
{ "bsociabl.com", true },
{ "bsp-southpool.com", true },
- { "bsquared.org", true },
{ "bst.gg", true },
{ "bstoked.net", true },
{ "bsw-solution.de", true },
@@ -6191,10 +6494,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "btnissanparts.com", true },
{ "btorrent.xyz", true },
{ "btsapem.com", true },
+ { "btshe.net", true },
{ "btsoft.eu", true },
{ "btsow.com", false },
{ "bttc.co.uk", true },
- { "btth.live", true },
{ "btth.pl", true },
{ "btth.tv", true },
{ "bttorj45.com", true },
@@ -6204,13 +6507,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bubblin.io", true },
{ "bubblinghottubs.co.uk", true },
{ "bubblybouncers.co.uk", true },
- { "bubhub.io", true },
{ "bubulazi.com", false },
{ "bubulazy.com", false },
{ "bucek.cz", true },
{ "buch-angucken.de", true },
{ "buchhandlungkilgus.de", true },
{ "buchwegweiser.com", true },
+ { "buck-hydro.de", true },
{ "buckelewrealtygroup.com", true },
{ "bucketlist.co.ke", true },
{ "buckypaper.com", true },
@@ -6240,7 +6543,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "buettgens.net", true },
{ "buffaloautomation.com", true },
{ "buffaloturf.com.au", true },
- { "buffetbouc.com", true },
{ "bug.blue", true },
{ "bug.ee", true },
{ "bugcrowd.com", true },
@@ -6257,17 +6559,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "buildhoscaletraingi.com", true },
{ "buildingclouds.de", true },
{ "buildingcostestimators.co.uk", true },
+ { "builditfl.com", true },
{ "builditsolutions.net", true },
{ "buildkite.com", true },
{ "buildmorebuslanes.com", true },
{ "buildplease.com", true },
- { "buildrightbuildingservicesltd.co.uk", true },
{ "buileo.com", true },
{ "builtory.my", true },
{ "builtvisible.com", true },
{ "builtwith.com", true },
{ "buissonchardin.fr", true },
+ { "bukiskola.hu", true },
+ { "bukivallalkozasok.hu", true },
{ "bukkenfan.jp", true },
+ { "bukpcszerviz.hu", true },
{ "bul3seas.eu", true },
{ "bulario.com", true },
{ "bulario.net", true },
@@ -6279,8 +6584,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bulktrade.de", true },
{ "bulktshirtsjohannesburg.co.za", true },
{ "bulkwholesalesweets.co.uk", true },
- { "bull.id.au", true },
- { "bulldog-hosting.de", true },
+ { "bulldog-hosting.de", false },
{ "bulldoghire.co.uk", true },
{ "bulledair-savons.ch", true },
{ "bulletpoint.cz", true },
@@ -6288,21 +6592,29 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bullpendaily.com", true },
{ "bullshitmail.nl", true },
{ "bullterrier.nu", true },
+ { "bulwarkcrypto.com", true },
{ "bulwarkhost.com", true },
- { "bunbun.be", false },
{ "bund-von-theramore.de", true },
{ "bundespolizei-forum.de", true },
{ "bungee.pw", true },
{ "bungee.systems", true },
{ "bungeetaco.com", true },
+ { "bunix.de", true },
{ "bunkyo-life.com", true },
{ "bunny-rabbits.com", true },
{ "bunnycarenotes.com", true },
{ "bunnydiamond.de", true },
{ "bunnyvishal.com", true },
+ { "bunq.love", true },
{ "bunzy.ca", true },
{ "bupropion.com", true },
- { "bupu.ml", true },
+ { "buqi.cc", true },
+ { "buradangonder.com", true },
+ { "burakogun.com", true },
+ { "burakogun.com.tr", true },
+ { "burakogun.net", true },
+ { "burakogun.net.tr", true },
+ { "burakogun.org", true },
{ "burcevo.info", true },
{ "burfordbedandbreakfast.co.uk", true },
{ "burg-hohnstein.com", true },
@@ -6334,6 +6646,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "burzmali.com", true },
{ "burzmedia.com", true },
{ "burzstudios.com", true },
+ { "burzum.ch", true },
+ { "buscandolosmejores.com", true },
{ "bushbaby.com", true },
{ "busindre.com", true },
{ "business-garden.com", true },
@@ -6341,15 +6655,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "businesscentermarin.ch", true },
{ "businessesdirectory.eu", true },
{ "businessfactors.de", true },
- { "businessimmigration-eu.com", true },
- { "businessimmigration-eu.ru", true },
{ "businessloanconnection.org", false },
{ "businessmadeeasypodcast.com", true },
{ "businessmarketingblog.org", true },
{ "businessplanexperts.ca", true },
- { "businessradar.com.au", true },
{ "businesswebadmin.com", true },
{ "busit.be", true },
+ { "busiteyiengelle.com", true },
{ "busold.ws", true },
{ "bustadice.com", true },
{ "bustimes.org", true },
@@ -6363,11 +6675,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "butteramotors.com", true },
{ "buttonline.ch", true },
{ "buttonrun.com", true },
- { "buturyu.net", true },
+ { "butzies.ddnss.org", true },
{ "buurtgenotencollectief.nl", true },
{ "buurtpreventiefraneker.nl", true },
{ "buxum-communication.ch", true },
{ "buy-out.jp", true },
+ { "buy2dollars.com", true },
{ "buybike.shop", true },
{ "buycarpet.shop", true },
{ "buycbd.store", true },
@@ -6392,12 +6705,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "buzzcontent.com", true },
{ "buzzprint.it", true },
{ "bvalle.com", true },
+ { "bvisible.be", true },
{ "bvl.aero", true },
{ "bw.codes", true },
{ "bwcscorecard.org", true },
{ "bwe-seminare.de", true },
{ "bwfc.nl", true },
{ "bwh1.net", false },
+ { "bwilkinson.co.uk", true },
{ "bwin8601.com", true },
{ "bwin8602.com", true },
{ "bwin8603.com", true },
@@ -6408,7 +6723,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bws16.de", true },
{ "bwserhoscaletrainaz.com", true },
{ "bx-n.de", true },
- { "bxdev.me", true },
{ "bxp40.at", true },
{ "byange.pro", true },
{ "byatte.com", true },
@@ -6417,12 +6731,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bygningsregistrering.dk", true },
{ "byhe.me", true },
{ "byiu.info", false },
+ { "byjuschennai.com", true },
+ { "byken.cn", true },
{ "bymark.co", true },
{ "bymike.co", true },
{ "bynder.com", true },
{ "bynumlaw.net", true },
{ "bypass.sh", true },
+ { "bypetula.cz", true },
{ "byr.moe", true },
+ { "byrko.cz", true },
{ "byrko.sk", true },
{ "byronkg.us", true },
{ "byrtz.de", true },
@@ -6434,14 +6752,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "bytecode.no", true },
{ "bytecrafter.com", true },
{ "bytecrafter.net", true },
+ { "byteflies.com", true },
{ "bytejail.com", true },
{ "bytema.cz", true },
{ "bytema.eu", true },
{ "bytema.re", true },
{ "bytema.sk", true },
{ "bytemix.cloud", true },
- { "byteowls.com", false },
- { "bytepark.de", true },
{ "bytepen.com", true },
{ "bytes.co", true },
{ "bytes.fyi", true },
@@ -6471,6 +6788,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "c.cc", true },
{ "c0rporation.com", true },
{ "c2design.it", true },
+ { "c2lab.net", true },
{ "c2o-library.net", true },
{ "c3sign.de", false },
{ "c3vo.de", true },
@@ -6489,7 +6807,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "caarecord.org", true },
{ "caasd.org", true },
{ "cabaladada.org", true },
- { "cabarave.com", true },
+ { "cabanactf.com", true },
{ "cabforum.org", true },
{ "cabineritten.nl", true },
{ "cabinet-bedin.com", true },
@@ -6508,7 +6826,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cachetur.no", true },
{ "cackette.com", true },
{ "cad-noerdlingen.de", true },
- { "cadacoon.com", true },
{ "cadafamilia.de", true },
{ "cadams.io", true },
{ "cadcreations.co.ke", true },
@@ -6521,6 +6838,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cadre.com", true },
{ "cadsys.net", true },
{ "cadusilva.com", true },
+ { "caerus.ws", true },
{ "caesarkabalan.com", true },
{ "cafedupont.be", true },
{ "cafedupont.co.uk", true },
@@ -6530,13 +6848,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cafelandia.net", true },
{ "cafeobscura.nl", true },
{ "caferagazzi.de", true },
+ { "caferestor.com", true },
{ "cafericoy.com", true },
+ { "cafesdomundo.pt", true },
{ "cafeterasbaratas.net", true },
{ "caffeinatedcode.com", true },
{ "cafled.org", true },
{ "cagalogluyayinevi.com", false },
{ "caglarcakici.com", true },
{ "caibi.io", true },
+ { "caijunyi.net", false },
{ "cainhosting.com", false },
{ "caitcs.com", true },
{ "caiwenjian.xyz", true },
@@ -6594,7 +6915,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "call.me", true },
{ "callanan.nl", true },
{ "callantonia.com", true },
+ { "callawayracing.se", false },
{ "callear.org", true },
+ { "callfunc.com", true },
{ "callhub.io", true },
{ "callidus-vulpes.de", true },
{ "calltoar.ms", true },
@@ -6604,6 +6927,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "calluna.nl", true },
{ "calminteractive.fr", true },
{ "calmtech.com", true },
+ { "calomel.org", true },
{ "calotte-academy.com", true },
{ "calrotaract.org", true },
{ "calvin.my", true },
@@ -6626,6 +6950,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cambodian.dating", true },
{ "cambreaconsulting.com", true },
{ "cambridge-examen.nl", true },
+ { "cambridge-security.com", true },
{ "cambridgebouncers.co.uk", true },
{ "cambridgesecuritygroup.org", true },
{ "camcapital.com", true },
@@ -6655,6 +6980,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "campertrailerfinance.com.au", true },
{ "camperverzekerd.nl", true },
{ "campfiretails.org", true },
+ { "camping-le-pasquier.com", true },
{ "camping-seilershof.de", true },
{ "campinghuntingshooting.com", true },
{ "campingskyhooks.com", true },
@@ -6666,7 +6992,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "campuswire.com", true },
{ "campvana.com", true },
{ "campwabashi.org", true },
- { "camshowhub.com", true },
{ "camshowstorage.com", true },
{ "camshowverse.com", true },
{ "camsky.de", false },
@@ -6678,7 +7003,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "canadian.dating", true },
{ "canadianatheists.ca", true },
{ "canadianatheists.com", true },
- { "canadianchristianity.com", false },
{ "canadianoutdoorequipment.com", true },
{ "canadiantouristboard.com", true },
{ "canal-onanismo.org", true },
@@ -6686,6 +7010,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "canalsidehouse.com", true },
{ "canariculturacolor.com", true },
{ "canarymod.net", true },
+ { "canberraoutletcentre.com.au", true },
{ "cancerdata.nhs.uk", true },
{ "candaceplayforth.com", true },
{ "candelec.com", true },
@@ -6700,7 +7025,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "candyout.com", true },
{ "cangelloplasticsurgery.com", true },
{ "cangku.in", true },
- { "cangku.moe", false },
+ { "cangku.moe", true },
{ "canglong.net", true },
{ "canhazip.com", true },
{ "canicaprice.com", true },
@@ -6715,6 +7040,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cannoli.london", true },
{ "cannyfoxx.me", true },
{ "canoonic.se", true },
+ { "canopy.ninja", true },
{ "canopycleaningmelbourne.com.au", true },
{ "cant.at", true },
{ "cantatio.ch", true },
@@ -6788,8 +7114,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "carbono.uy", true },
{ "carbontv.com", true },
{ "carburetorcycleoi.com", true },
- { "carck.co.uk", true },
- { "carck.uk", true },
+ { "carcloud.ch", true },
{ "cardboard.cx", true },
{ "cardcaptorsakura.jp", true },
{ "carddreams.be", true },
@@ -6809,18 +7134,40 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cardxl.de", true },
{ "cardxl.fr", true },
{ "cardxl.nl", true },
+ { "care-spot.biz", true },
+ { "care-spot.com", true },
+ { "care-spot.info", true },
+ { "care-spot.mobi", true },
+ { "care-spot.net", true },
+ { "care-spot.org", true },
+ { "care-spot.us", true },
{ "care4all.com", true },
{ "careeapp.com", true },
+ { "career.support", true },
{ "careeroptionscoach.com", true },
{ "careerpower.co.in", true },
{ "careers.plus", true },
{ "carefour.nl", true },
{ "caremad.io", true },
{ "carepassport.com", true },
+ { "carespot.biz", true },
+ { "carespot.co", true },
+ { "carespot.mobi", true },
+ { "carespot.net", true },
+ { "carespot.org", true },
+ { "carespot.us", true },
+ { "carespotexpress.com", true },
+ { "carespotexpresshealthcare.com", true },
+ { "carespottravelmedicine.com", true },
+ { "carespottravelmedicine.mobi", true },
+ { "carespoturgentcare.com", true },
+ { "carespoturgentcare.info", true },
+ { "carespoturgentcare.net", true },
+ { "carespoturgentcare.org", true },
+ { "carespoturgentcare.us", true },
{ "caretta.co.uk", true },
{ "careyshop.cn", true },
{ "carezone.com", false },
- { "carfinancehelp.com", true },
{ "carfraemill.co.uk", true },
{ "cargobay.net", true },
{ "cargomaps.com", true },
@@ -6831,7 +7178,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "caribbeanexams.com", true },
{ "carigami.fr", true },
{ "caringladies.org", true },
- { "carinsurance.es", true },
{ "carinthia.eu", true },
{ "cariocacooking.com", true },
{ "carisenda.com", true },
@@ -6874,32 +7220,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "carpetcleaningtomball.com", true },
{ "carrando.com", true },
{ "carre-lutz.com", true },
+ { "carrentalsathens.com", true },
{ "carriedin.com", true },
{ "carrierplatform.com", true },
{ "carringtonrealtygroup.com", true },
{ "carroattrezzimilanodaluiso.it", true },
{ "carroceriascarluis.com", true },
- { "carrollservicecompany.com", true },
{ "carrouselcompany.fr", true },
{ "cars4salecy.com", true },
{ "carseatchecks.ca", true },
{ "carshippingcarriers.com", true },
{ "carson-aviation-adventures.com", true },
+ { "carson-matthews.co.uk", true },
{ "carsoug.com", true },
{ "carspneu.cz", true },
- { "cartadeviajes.cl", true },
- { "cartadeviajes.co", true },
- { "cartadeviajes.com", true },
- { "cartadeviajes.com.ar", true },
- { "cartadeviajes.com.ve", true },
- { "cartadeviajes.de", true },
- { "cartadeviajes.ec", true },
- { "cartadeviajes.es", true },
- { "cartadeviajes.fr", true },
- { "cartadeviajes.mx", true },
- { "cartadeviajes.pe", true },
- { "cartadeviajes.uk", true },
{ "carteirasedistintivos.com.br", true },
+ { "carterdan.net", true },
{ "carterstad.se", true },
{ "cartertonscouts.org.nz", true },
{ "cartesentreprises-unicef.fr", true },
@@ -6914,11 +7250,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cartwrightrealestate.com", true },
{ "carun.us", true },
{ "carusorealestate.com", true },
+ { "carwellness-hinkelmann.de", true },
{ "caryefurd.com", true },
{ "casa-app.de", true },
{ "casa-due-pur.com", true },
{ "casa-due-pur.de", true },
{ "casa-due.com", true },
+ { "casa-laguna.net", true },
{ "casa-lunch-break.de", true },
{ "casa-lunchbreak.de", true },
{ "casa-mea-inteligenta.ro", true },
@@ -6926,9 +7264,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "casaanastasia.ro", true },
{ "casabouquet.com", true },
{ "casacameo.com", false },
+ { "casacazoleiro.com", true },
{ "casacochecurro.com", true },
{ "casadasportasejanelas.com", true },
{ "casadoarbitro.com.br", true },
+ { "casadopulpo.com", true },
{ "casadowifi.com.br", true },
{ "casaessencias.com.br", true },
{ "casalborgo.it", true },
@@ -6939,7 +7279,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "casasuara.com", true },
{ "casbia.info", true },
{ "casbuijs.nl", true },
- { "casburggraaf.com", true },
+ { "casburggraaf.com", false },
{ "casc.cz", true },
{ "cascadesjobcorpscca.com", true },
{ "cascavelle.fr", true },
@@ -6947,14 +7287,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "case-vacanza-salento.com", true },
{ "casecoverkeygi.com", true },
{ "casecurity.org", true },
+ { "caseof.fr", true },
{ "caseplus-daem.de", true },
{ "caseycapitalpartners.com", true },
{ "cash-4x4.com", true },
{ "cashati.com", true },
+ { "cashbackcow.us", true },
{ "cashbook.co.tz", true },
{ "cashbot.cz", true },
{ "cashfazz.com", true },
- { "cashlink.de", true },
{ "cashlogic.ch", true },
{ "cashmaxtexas.com", true },
{ "cashplk.com", true },
@@ -6968,6 +7309,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "casinomucho.org", true },
{ "casinomucho.se", true },
{ "casinoonlinesicuri.com", true },
+ { "casinoportugal.pt", true },
{ "casinorewards.info", true },
{ "casinovergleich.com", true },
{ "casio-caisses-enregistreuses.fr", true },
@@ -6997,9 +7339,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "casualdesignsfurniture.com", true },
{ "casusgrillcaribbean.com", true },
{ "cat-blum.com", true },
- { "cat-box.de", true },
{ "cat.net", true },
{ "cat73.org", true },
+ { "cat93.com", true },
{ "catalog.beer", true },
{ "catalogobiblioteca.com", true },
{ "catalogoreina.com", true },
@@ -7011,9 +7353,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "catburton.co.uk", true },
{ "catchers.cc", true },
{ "catchersgear.com", true },
- { "catchfotografie.nl", true },
{ "catchhimandkeephim.com", true },
{ "catchief.com", true },
+ { "catchkol.com", true },
{ "catcoxx.de", true },
{ "catdecor.ru", true },
{ "catenacondos.com", true },
@@ -7024,7 +7366,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "catharisme.eu", true },
{ "catharisme.net", true },
{ "catherinejf.com", true },
- { "catherinescastles.co.uk", true },
{ "catholics.dating", true },
{ "cathosa.nl", true },
{ "cathy.guru", true },
@@ -7039,10 +7380,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "catl.st", true },
{ "catmoose.ca", true },
{ "catnet.dk", false },
+ { "catram.org", true },
{ "cattivo.nl", false },
{ "catuniverse.org", true },
{ "catveteran.com", true },
- { "caughtredhanded.co.nz", true },
+ { "caudo.net", true },
+ { "caudohay.com", true },
{ "caulfieldeastapartments.com.au", true },
{ "caulfieldracecourseapartments.com.au", true },
{ "caulong-ao.net", true },
@@ -7059,7 +7402,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cbcf.info", true },
{ "cbd.casa", true },
{ "cbd.supply", true },
- { "cbdcontact.pl", true },
+ { "cbdcontact.eu", true },
{ "cbdev.de", true },
{ "cbdmarket.space", true },
{ "cbdoilcures.co", true },
@@ -7078,11 +7421,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ccc-ch.ch", true },
{ "cccwien.at", true },
{ "ccgx.de", true },
+ { "cclasabana.com.co", true },
{ "ccoooss.com", true },
{ "ccprwebsite.org", true },
{ "ccsource.org", true },
{ "ccss-cces.com", true },
- { "ccsys.com", true },
{ "cctvcanada.net", true },
{ "cctvview.info", true },
{ "ccu.plus", true },
@@ -7100,10 +7443,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cdda.ch", true },
{ "cdepot.eu", true },
{ "cdkeykopen.com", true },
+ { "cdkeyworld.de", true },
{ "cdn.ampproject.org", true },
{ "cdn6.de", true },
{ "cdncompanies.com", true },
{ "cdnjs.com", true },
+ { "cdns.cloud", true },
{ "cdnsys.net", true },
{ "cdom.de", true },
{ "cdsdigital.de", true },
@@ -7111,6 +7456,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cdu-wilgersdorf.de", true },
{ "cduckett.net", true },
{ "cdvl.org", true },
+ { "ce-agentur.de", false },
{ "ce-pimkie.fr", true },
{ "ceanimalhealth.com", true },
{ "cebz.org", true },
@@ -7128,6 +7474,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "celcomhomefibre.com.my", true },
{ "cele.bi", true },
{ "celebmasta.com", true },
+ { "celebphotos.club", true },
{ "celebrityhealthcritic.com", true },
{ "celebrityscope.net", true },
{ "celectro-pro.com", true },
@@ -7155,13 +7502,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "centennialradon.com", true },
{ "centennialseptic.com", true },
{ "centerpereezd.ru", false },
+ { "centerperson.org", true },
+ { "centerpoint.ovh", true },
{ "centio.bg", true },
+ { "centision.com", true },
+ { "centos.cz", true },
{ "centos.tips", true },
{ "centralbank.ae", true },
{ "centralebigmat.eu", true },
{ "centralegedimat.eu", true },
{ "centralfor.me", true },
- { "centrallotus.com", true },
{ "centralmarket.com", true },
{ "centralmissourifoundationrepair.com", true },
{ "centralpoint.be", false },
@@ -7172,13 +7522,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "centreoeil.ch", true },
{ "centrobill.com", true },
{ "centrodoinstalador.com.br", true },
+ { "centroecuestrecastellar.com", true },
{ "centrojovencuenca.es", true },
+ { "centrolavoro.org", true },
{ "centromasterin.com", true },
{ "centroperugia.gr", true },
{ "centrosocialferrel.pt", true },
{ "centrumhodinek.cz", true },
{ "centruvechisv.ro", true },
- { "centrym.top", true },
+ { "centsi.io", true },
{ "centum.no", true },
{ "centura.de", true },
{ "centurialeonina.com", true },
@@ -7216,6 +7568,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "certificatedetails.com", true },
{ "certificatespending.com", true },
{ "certificatetools.com", true },
+ { "certificazioni-energetiche.it", true },
{ "certifiedfieldassociate.com", true },
{ "certifiednurses.org", true },
{ "certmonitor.com.au", true },
@@ -7233,17 +7586,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ceso-saco.com", true },
{ "cesobaly.cz", true },
{ "cestasedelicias.com.br", true },
- { "cestunmetier.ch", true },
{ "cetamol.com", true },
- { "cetangarana.com", true },
{ "ceu.edu", false },
{ "cevo.com.hr", true },
{ "ceyizlikelisleri.com", true },
{ "cf-ide.de", true },
- { "cf-tm.net", true },
+ { "cfan.space", true },
{ "cfda.gov", true },
{ "cfdcre5.org", true },
{ "cfh.com", true },
+ { "cfigura.com", true },
{ "cflsystems.com", true },
{ "cfno.org", true },
{ "cfo.gov", true },
@@ -7264,6 +7616,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cgbassurances.ch", true },
{ "cgbilling.com", true },
{ "cgcookiemarkets.com", true },
+ { "cgf-charcuterie.com", true },
+ { "cglib.xyz", true },
{ "cgminc.net", true },
{ "cgnparts.com", true },
{ "cgpe.com", true },
@@ -7281,8 +7635,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chadstoneapartments.com.au", true },
{ "chaffeyconstruction.com", true },
{ "chaifeng.com", true },
- { "chainedunion.info", true },
{ "chaip.org", true },
+ { "chairsgb.com", true },
{ "chaisystems.net", true },
{ "chaletdemontagne.org", true },
{ "chaletmanager.com", true },
@@ -7329,9 +7683,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chaospott.de", true },
{ "chaosriftgames.com", true },
{ "chaoswars.ddns.net", true },
+ { "chaotichive.com", true },
{ "chapelfordbouncers.co.uk", true },
{ "chapiteauxduleman.fr", true },
{ "chaplain.co", true },
+ { "chapstick.life", true },
{ "charbonnel.eu", true },
{ "charcoal-se.org", true },
{ "charcoalvenice.com", true },
@@ -7341,7 +7697,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "charisma.ai", true },
{ "charissadescande.com", true },
{ "charitylog.co.uk", true },
- { "charlenevondell.com", true },
{ "charles-darwin.com", true },
{ "charlesbwise.com", true },
{ "charlesmilette.net", true },
@@ -7349,6 +7704,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "charlesrogers.co.uk", true },
{ "charlesstover.com", true },
{ "charlestonfacialplastic.com", true },
+ { "charlie4change.com", true },
{ "charliedillon.com", true },
{ "charliegarrod.com", true },
{ "charliehr.com", true },
@@ -7359,8 +7715,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "charlottesvillegolfcommunities.com", true },
{ "charlottesvillehorsefarms.com", true },
{ "charlotteswimmingpoolbuilder.com", true },
+ { "charlylou.de", true },
{ "charmander.me", true },
- { "charmanterelefant.at", true },
{ "charmingsaul.com", true },
{ "charmyadesara.com", true },
{ "charr.xyz", true },
@@ -7373,10 +7729,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chartwellestate.com", true },
{ "charuru.moe", false },
{ "chascrazycreations.com", true },
- { "chaseandzoey.de", true },
{ "chasetrails.co.uk", true },
{ "chat-house-adell.com", true },
{ "chat-libera.org", true },
+ { "chat-porc.eu", true },
{ "chat-senza-registrazione.net", true },
{ "chat.cz", true },
{ "chat2.cf", true },
@@ -7417,7 +7773,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chbk.co", true },
{ "chbs.me", true },
{ "chch.it", true },
- { "chci-web.cz", true },
{ "chcoc.gov", true },
{ "chcsct.com", true },
{ "chd-expert.fr", true },
@@ -7442,6 +7797,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cheapticket.in", true },
{ "cheatengine.pro", true },
{ "check.torproject.org", false },
+ { "checkandreportlive.com", true },
+ { "checkblau.de", true },
{ "checkecert.nl", true },
{ "checkjelinkje.nl", true },
{ "checkmyessay.com", true },
@@ -7450,7 +7807,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "checkmypsoriasis.com", true },
{ "checkout.google.com", true },
{ "checkpoint-tshirt.com", true },
- { "checkras.tk", true },
{ "checkrente.nl", true },
{ "checkspf.net", true },
{ "checktype.com", true },
@@ -7458,6 +7814,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "checkyourmath.com", true },
{ "checkyourprivilege.org", true },
{ "checkyourreps.org", true },
+ { "checookies.com", true },
{ "checos.co.uk", true },
{ "cheddarpayments.com", true },
{ "cheekycharliessoftplay.co.uk", true },
@@ -7473,6 +7830,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cheltenhambounce.co.uk", true },
{ "cheltenhambouncycastles.co.uk", true },
{ "cheltik.ru", true },
+ { "chemco.mu", true },
{ "chemicalcrux.org", true },
{ "chemiphys.com", true },
{ "chemistry-schools.com", true },
@@ -7498,10 +7856,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chesapeakebaychristmas.com", true },
{ "chess.com", true },
{ "chessboardao.com", true },
- { "chesscoders.com", true },
{ "chesskid.com", true },
{ "chesspoint.ch", true },
+ { "chesterfieldplaceapartmentsstl.com", true },
{ "chesterlestreetasc.co.uk", false },
+ { "chestnut.cf", true },
{ "chetwood.se", true },
{ "chevy37.com", true },
{ "chevymotor-occasions.be", true },
@@ -7513,7 +7872,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chez.moe", true },
{ "chfr.search.yahoo.com", false },
{ "chhory.com", true },
- { "chiaraiuola.com", false },
+ { "chiangmaimontessori.com", true },
{ "chiaseeds24.com", true },
{ "chiboard.co", true },
{ "chibr.eu", true },
@@ -7523,6 +7882,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chicagostudentactivists.org", true },
{ "chicisimo.com", true },
{ "chicolawfirm.com", true },
+ { "chicurrichi.com", true },
{ "chiemgauflirt.de", true },
{ "chif16.at", true },
{ "chikazawa.info", true },
@@ -7553,6 +7913,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chinaspaceflight.com", true },
{ "chinatrademarkoffice.com", true },
{ "ching.tv", true },
+ { "chinookwebdesign.ca", true },
{ "chint.ai", true },
{ "chinwag.im", true },
{ "chinwag.org", true },
@@ -7561,7 +7922,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chippy.ch", false },
{ "chips-scheduler.de", true },
{ "chipset.no", true },
- { "chiralsoftware.com", true },
{ "chireiden.net", true },
{ "chiro-neuchatel.ch", true },
{ "chiropractic.gr", true },
@@ -7601,16 +7961,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "choootto.net", true },
{ "choosemypc.net", true },
{ "chopperdesign.com", true },
- { "chorkley.co.uk", true },
- { "chorkley.com", true },
- { "chorkley.uk", true },
{ "chorpinkpoemps.de", true },
- { "chotlo.com", true },
+ { "chosenplaintext.org", true },
{ "chourishi-shigoto.com", true },
{ "chovancova.sk", true },
{ "chowii.com", true },
{ "choyri.com", true },
- { "chr0me.sh", true },
{ "chris-edwards.net", true },
{ "chrisahrweileryoga.com", true },
{ "chrisaitch.com", true },
@@ -7632,15 +7988,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chrisnekarda.com", true },
{ "chrisplankhomes.com", true },
{ "chrispstreet.com", true },
+ { "chrisspencercreative.com", true },
{ "chrissx.ga", true },
{ "christadelphiananswers.org", true },
{ "christadelphians.eu", true },
- { "christchurchbouncycastles.co.uk", true },
{ "christec.net", true },
{ "christensenplace.us", true },
{ "christerwaren.fi", true },
{ "christiaanconover.com", true },
- { "christian-fischer.pictures", true },
{ "christian-folini.ch", true },
{ "christian-gredig.de", true },
{ "christian-host.com", true },
@@ -7662,6 +8017,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "christians.dating", true },
{ "christianscholz.de", false },
{ "christiehawkes.com", true },
+ { "christielepage.com", true },
{ "christiesantiques.com", true },
{ "christmascard.be", true },
{ "christmaspartyhire.co.uk", true },
@@ -7690,8 +8046,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chrome.google.com", true },
{ "chromebookchart.com", true },
{ "chromebooksforwork.com", true },
+ { "chromeworld.ru", true },
{ "chromiumbugs.appspot.com", true },
{ "chromiumcodereview.appspot.com", false },
+ { "chromopho.be", true },
{ "chroniclesofgeorge.com", true },
{ "chronology.no", true },
{ "chronoshop.cz", true },
@@ -7700,13 +8058,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "chrysanthos.net", true },
{ "chrystajewelry.com", true },
{ "chs.us", false },
+ { "chshealthcare.co.uk", true },
{ "chshouyu.com", true },
{ "chsterz.de", true },
+ { "chtsi.uk", true },
{ "chuchote-moi.fr", true },
{ "chuck.ovh", true },
{ "chuill.com", true },
{ "chun.pro", true },
{ "chunche.net", true },
+ { "chunk.science", true },
{ "chupadelfrasco.com", true },
{ "chuppa.com.au", true },
{ "churchofsaintrocco.org", true },
@@ -7730,24 +8091,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ciat.no", false },
{ "cibercactus.com", true },
{ "cica.es", true },
+ { "ciclista.roma.it", true },
{ "cidbot.com", true },
{ "cidersus.com.ec", true },
{ "cie-theatre-montfaucon.ch", true },
{ "ciel.pro", true },
{ "cielbleu.org", true },
{ "cielly.com", true },
+ { "cienciasempresariais.pt", true },
{ "cierreperimetral.com", true },
{ "cifop-numerique.fr", true },
{ "ciftlikesintisi.com", true },
{ "cig-dem.com", true },
{ "cigar-cartel.com", true },
+ { "cihar.com", true },
{ "cilloc.be", true },
{ "cima-idf.fr", true },
{ "cimbalino.org", true },
{ "cimballa.com", true },
{ "cimfax.com", true },
{ "cinafilm.com", true },
- { "cindydudley.com", true },
{ "cine-music.de", true },
{ "cine.to", true },
{ "cinefilzonen.se", true },
@@ -7756,6 +8119,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cinemasetfree.com", true },
{ "cinemysticism.com", true },
{ "cineplex.my", true },
+ { "cinkciarz.pl", true },
{ "cinnabon.com", true },
{ "cinq-elements.com", true },
{ "cinq-elements.fr", true },
@@ -7793,13 +8157,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cirurgicasalutar.com.br", true },
{ "cirurgicavirtual.com.br", true },
{ "cisa.gov", true },
- { "ciscodude.net", true },
+ { "ciscodude.net", false },
{ "cisoaid.com", true },
{ "cisofy.com", true },
{ "cispeo.org", true },
{ "ciss.ltd", true },
{ "cisum-cycling.com", true },
{ "cisy.me", true },
+ { "citadelnet.works", true },
+ { "citas-adultas.com", true },
{ "citcuit.in", true },
{ "citfin.cz", true },
{ "cities.cl", true },
@@ -7820,6 +8186,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "citya.com", true },
{ "citybeat.de", true },
{ "citycreek.studio", true },
+ { "citydance.ee", true },
{ "cityextra.com.au", true },
{ "cityfloorsupply.com", true },
{ "citylights.eu", true },
@@ -7827,8 +8194,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cityoftitans.com", true },
{ "cityoftitansmmo.com", true },
{ "citysportapp.com", true },
+ { "citywidealarms.com", true },
{ "cityworksonline.com", true },
{ "ciubotaru.tk", true },
+ { "civicamente.cl", true },
{ "civicforum.pl", true },
{ "civilbikes.com", true },
{ "civilg20.org", true },
@@ -7836,6 +8205,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "civiltoday.com", true },
{ "cj-espace-vert.fr", true },
{ "cj-jackson.com", true },
+ { "cjbeckert.com", true },
{ "cjdby.net", true },
{ "cjdpenterprises.com", true },
{ "cjdpenterprises.com.au", true },
@@ -7856,6 +8226,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ckliemann.com", true },
{ "ckliemann.net", true },
{ "ckostecki.de", true },
+ { "ckrubble.co.za", true },
{ "cktennis.com", true },
{ "cl.search.yahoo.com", false },
{ "cl0ud.space", true },
@@ -7868,8 +8239,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "clamofon.com", true },
{ "clan-ww.com", true },
{ "clanebouncycastles.com", true },
+ { "clangwarnings.com", false },
{ "clanrose.org.uk", true },
{ "clanwarz.com", true },
+ { "claraism.com", true },
{ "clarkeaward.com", true },
{ "clarkwinkelmann.com", true },
{ "clase3.tk", true },
@@ -7898,23 +8271,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "claytonstowing.com.au", true },
{ "clazzrooms.com", true },
{ "cldfile.com", true },
+ { "cldinc.com", true },
{ "cldly.com", true },
{ "cleanapproachnw.com", true },
{ "cleanbrowsing.org", true },
+ { "cleancode.club", true },
{ "cleandetroit.org", true },
{ "cleandogsnederland.nl", true },
{ "cleanfiles.us", true },
{ "cleanhouse2000.us", true },
{ "cleaningbyrosie.com", true },
{ "cleaningservicejulai.com", true },
+ { "cleanplanet.co.jp", true },
{ "cleansewellness.com", true },
{ "clearance365.co.uk", true },
{ "clearblueday.co.uk", true },
{ "clearbookscdn.uk", true },
{ "clearbreezesecuritydoors.com.au", true },
- { "clearer.cloud", true },
{ "clearip.com", true },
- { "clearkonjac.com", true },
{ "clearsettle-admin.com", true },
{ "clearvoice.com", true },
{ "clemenscompanies.com", true },
@@ -7932,7 +8306,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "clicecompre.com.br", true },
{ "clicheshishalounge.co.uk", true },
{ "click-licht.de", true },
+ { "click2order.co.uk", true },
{ "click4web.com", true },
+ { "clickclickphish.com", true },
{ "clickclock.cc", true },
{ "clickenergy.com.au", true },
{ "clickingmad.com", true },
@@ -7946,8 +8322,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "climaprecio.es", true },
{ "climateinteractive.org", true },
{ "climatestew.com", true },
+ { "climaticarus.ru", true },
{ "clindoeilmontagne.com", true },
- { "clingout.com", true },
{ "clinicalrehabilitation.info", true },
{ "clinicaltrials.gov", true },
{ "clinicasmedicas.com.br", true },
@@ -7961,11 +8337,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "clmde.de", true },
{ "clnc.to", true },
{ "clnnet.ch", true },
+ { "clo.me", true },
{ "cloaked.ch", true },
{ "clochix.net", true },
{ "clockcaster.com", true },
{ "clockworksms.com", true },
- { "clod-hacking.com", true },
{ "cloppenburg-autmobil.com", true },
{ "cloppenburg-automobil.com", true },
{ "clorophilla.net", true },
@@ -7978,8 +8354,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cloud.fail", true },
{ "cloud.google.com", true },
{ "cloud.gov", true },
+ { "cloud255.com", true },
{ "cloud42.ch", false },
{ "cloud9bouncycastlehire.com", true },
+ { "cloud9vets.co.uk", true },
{ "cloudapps.digital", true },
{ "cloudbolin.es", true },
{ "cloudbrothers.info", true },
@@ -8007,7 +8385,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cloudoptimus.com", true },
{ "cloudpipes.com", true },
{ "cloudse.co.uk", true },
+ { "cloudsec.tk", true },
+ { "cloudsecurityalliance-europe.org", true },
+ { "cloudsecurityalliance.com", true },
+ { "cloudsecurityalliance.net", true },
{ "cloudsecurityalliance.org", true },
+ { "cloudsecuritycongress.net", true },
+ { "cloudsecuritycongress.org", true },
{ "cloudservice.io", true },
{ "cloudservices.nz", true },
{ "cloudsign.jp", true },
@@ -8023,6 +8407,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cloveros.ga", true },
{ "clownindeklas.nl", true },
{ "cloxy.com", true },
+ { "cloze.com", true },
{ "clr3.com", true },
{ "clsfoundationrepairandwaterproofing.com", true },
{ "clsimage.com", true },
@@ -8032,7 +8417,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "club-climate.com", true },
{ "club-corsicana.de", true },
{ "club-creole.com", true },
- { "club-duomo.com", true },
+ { "club-dieta.ru", true },
{ "club-is.ru", true },
{ "club-premiere.com", true },
{ "club-reduc.com", true },
@@ -8077,6 +8462,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cmn-groupe.com", true },
{ "cmngroup.com", true },
{ "cmngroupe.com", true },
+ { "cmov-plongeurs.fr", true },
{ "cmplainpalais.ch", true },
{ "cms-weble.jp", true },
{ "cmskeyholding.co.uk", true },
@@ -8094,9 +8480,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cncado.net", true },
{ "cncbazar365.com", true },
{ "cncrans.ch", true },
+ { "cncs.gov.pt", true },
{ "cnet-hosting.com", true },
{ "cni-certing.it", true },
- { "cnnet.in", true },
+ { "cnitdog.com", false },
{ "cnre.eu", true },
{ "cnvt.fr", true },
{ "co-factor.ro", true },
@@ -8109,7 +8496,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "coaching-impulse.ch", true },
{ "coalitionministries.org", true },
{ "coalpointcottage.com", true },
- { "coam.co", true },
{ "coastline.net.au", true },
{ "coathangastrangla.com", true },
{ "coathangastrangler.com", true },
@@ -8120,6 +8506,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cobalt.io", true },
{ "cobaltgp.com", true },
{ "cobaltis.co.uk", true },
+ { "cobaltlp.com", true },
{ "cobracastles.co.uk", true },
{ "cocaine-import.agency", true },
{ "cocaine.ninja", true },
@@ -8127,6 +8514,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cocareonline.com", true },
{ "cocinoyo.com", true },
{ "cock.li", true },
+ { "cockfile.com", true },
{ "cocktail-shaken.nl", true },
{ "cockybot.com", true },
{ "coco-line.ch", true },
@@ -8153,6 +8541,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "code.taxi", true },
{ "code67.com", true },
{ "codeandpeace.com", true },
+ { "codeandsupply.co", true },
{ "codebrahma.com", false },
{ "codecommunity.io", true },
{ "codedelarouteenligne.fr", true },
@@ -8175,11 +8564,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "codepref.com", true },
{ "codepult.com", true },
{ "codera.co.uk", true },
- { "codercross.com", true },
{ "codereview.appspot.com", false },
{ "codereview.chromium.org", false },
- { "coderme.com", true },
- { "codersatlas.xyz", true },
{ "coderware.co.uk", true },
{ "codes.pk", true },
{ "codesport.io", true },
@@ -8191,6 +8577,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "codeux.com", false },
{ "codeux.info", false },
{ "codeux.net", false },
+ { "codevat.com", true },
{ "codeventure.de", true },
{ "codeversetech.com", true },
{ "codewild.de", true },
@@ -8211,6 +8598,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "codingrobots.com", true },
{ "codxg.org", true },
{ "codyevanscomputer.com", true },
+ { "codymoniz.com", true },
{ "codyqx4.com", true },
{ "codyscafesb.com", true },
{ "coens.me.uk", true },
@@ -8219,6 +8607,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "coffee-mamenoki.jp", true },
{ "coffeeandteabrothers.com", true },
{ "coffeetime.fun", true },
+ { "coffeetocode.me", false },
{ "cogala.eu", true },
{ "cogent.cc", true },
{ "cogilog.com", true },
@@ -8227,6 +8616,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cognitip.com", true },
{ "cognitivecomputingconsortium.com", true },
{ "cognitohq.com", true },
+ { "cognixia.us", true },
{ "cogsquad.house", true },
{ "coi-verify.com", true },
{ "coiffeurschnittstelle.ch", true },
@@ -8239,9 +8629,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "coinbit.trade", true },
{ "coincealed.com", true },
{ "coinchat.im", true },
+ { "coincircle.com", true },
{ "coincoin.eu.org", true },
{ "coincolors.co", true },
{ "coindeal.com", true },
+ { "coindesfilles.fr", true },
{ "coinf.it", true },
{ "coinflux.com", true },
{ "coingate.com", true },
@@ -8252,6 +8644,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "coinroom.com", true },
{ "coins2001.ru", true },
{ "coinx.pro", true },
+ { "coisabakana.com.br", true },
{ "coisasdemulher.org", true },
{ "cojam.ru", true },
{ "cojo.eu", true },
@@ -8259,19 +8652,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "col.la", true },
{ "colaborativa.tv", true },
{ "colapsys.net", true },
+ { "colasjourdain.fr", true },
+ { "colcomm.com", true },
{ "coldawn.com", false },
{ "coldcardwallet.com", true },
{ "coldfff.com", false },
{ "coldhak.ca", true },
+ { "coldiario.com", true },
{ "coldstreamcreekfarm.com", true },
{ "colectivointerconductual.com", true },
{ "colemak.com", true },
{ "colengo.com", true },
{ "colf.online", true },
{ "colibris.xyz", true },
+ { "colinchartier.com", true },
{ "colincogle.name", true },
{ "colinsnaith.co.uk", true },
{ "colinstark.ca", true },
+ { "collab.ddnss.org", true },
{ "collabora-office.com", true },
{ "collabora.ca", true },
{ "collabora.co.kr", true },
@@ -8284,26 +8682,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "collaboracloudsuite.com", true },
{ "collaboraoffice.co.uk", true },
{ "collaboraoffice.com", true },
+ { "collaborativehealthpsychology.com", true },
{ "collabornation.net", true },
{ "collaction.hk", true },
{ "collada.org", true },
+ { "collage.me", true },
{ "collectdocs.com", true },
{ "collectfood.com", true },
{ "collectiblebeans.com", true },
- { "collectivesupply.com", true },
{ "collectorknives.net", true },
{ "collectorsystems.com", true },
{ "collegeconnexxions.com.au", true },
{ "collegenavigator.gov", true },
{ "collegeprospectsofcentralindiana.com", true },
+ { "collegereligionandphilosophy.com", true },
{ "collegestationhomes.com", true },
{ "collinel-hossari.com", true },
{ "collinelhossari.com", true },
{ "collinklippel.com", true },
{ "collinmbarrett.com", true },
+ { "colo-tech.com", true },
{ "cololi.moe", true },
{ "colombian.dating", true },
- { "coloppe.com", true },
{ "coloraid.net", true },
{ "colorblindprogramming.com", true },
{ "colorbrush.ru", true },
@@ -8318,10 +8718,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "colotimes.com", true },
{ "colourfulcastles.co.uk", true },
{ "colpacpackaging.com", true },
- { "colpatriaws.azurewebsites.net", true },
{ "colson-occasions.be", true },
{ "coltellisurvival.com", true },
- { "coltonrb.com", true },
{ "columbuswines.com", true },
{ "colyakootees.com", true },
{ "com-in.de", true },
@@ -8336,11 +8734,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "combron.com", true },
{ "combron.nl", true },
{ "comcol.nl", true },
- { "comdotgame.com", true },
{ "comdurav.com", true },
{ "comeals.com", true },
+ { "comedyhuis.nl", true },
{ "comefollowme2016.com", true },
{ "comeoishii.com", true },
+ { "comercialdragon.com", true },
{ "comercialtpv.com", true },
{ "comerford.net", true },
{ "comestoarra.com", true },
@@ -8349,6 +8748,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "comevius.com", true },
{ "comevius.org", true },
{ "comevius.xyz", true },
+ { "comff.net", true },
{ "comfintouch.com", true },
{ "comflores.com.br", true },
{ "comfortmastersinsulation.com", true },
@@ -8364,8 +8764,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "commco.nl", true },
{ "commechezvous.ch", true },
{ "commerce.gov", true },
+ { "commercezen.com", true },
{ "commercial-academy.fr", true },
{ "commeunamour.com", true },
+ { "commissaris-vraagbaak.nl", true },
{ "commissionagenda.com", true },
{ "commitsandrebases.com", true },
{ "common.io", true },
@@ -8379,18 +8781,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "communitymanagertorrejon.com", true },
{ "communote.net", true },
{ "como-se-escribe.com", true },
+ { "comoaliviareldolor.de", true },
{ "comocurarlagastritis24.online", true },
{ "comocurarlagastritistratamientonatural.com", true },
{ "comodesinflamarlashemorroides.org", true },
{ "comodo.nl", true },
- { "comodormirmasrapido.com", true },
{ "comodosslstore.com", true },
{ "comogene.com", true },
{ "comohacerblog.net", true },
{ "comohacerelamoraunhombrenet.com", true },
{ "comohacerpara.com", true },
{ "comoimportar.net", true },
- { "comopuededejardefumar.net", true },
{ "comoquitarlacaspa24.com", true },
{ "comoquitarlasestriasrapidamente.com", true },
{ "comosecarabarriga.net", true },
@@ -8414,6 +8815,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "comphare.nl", true },
{ "compibus.fr", true },
{ "compilenix.org", true },
+ { "compitak.com", true },
{ "compleetondernemen.nl", true },
{ "completefloorcoverings.com", true },
{ "completesecurityessex.co.uk", true },
@@ -8424,10 +8826,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "compliance-systeme.de", true },
{ "compliancedictionary.com", true },
{ "compliancerisksoftware.co.uk", true },
+ { "componentshop.co.uk", true },
{ "compostatebien.com.ar", true },
{ "compoundingrxusa.com", true },
{ "compraneta.com", false },
{ "compraporinternet.online", true },
+ { "comprarefiereygana.com", true },
{ "comprarimpresoras-3d.com", true },
{ "comprasoffie.com.br", true },
{ "compreautomacao.com.br", true },
@@ -8453,10 +8857,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "computernetwerkwestland.nl", true },
{ "computerslotopschool.nl", true },
{ "computersystems.guru", false },
+ { "computerwerk.org", true },
{ "computop.com", true },
- { "comtily.com", true },
{ "comunidadmontepinar.es", true },
{ "comvos.de", true },
+ { "comw.cc", true },
{ "conalcorp.com", true },
{ "conatus.ai", true },
{ "conaudisa.com", false },
@@ -8469,6 +8874,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "concordsoftwareleasing.com", true },
{ "concretelevelingsystems.com", true },
{ "concreterepairatlanta.com", true },
+ { "concreterepairconcreteraising.com", true },
{ "concursopublico.com.br", true },
{ "concursos.com.br", true },
{ "concursosabertos.com.br", true },
@@ -8477,11 +8883,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "condepenalba.com", false },
{ "condesaelectronics.com", true },
{ "condolencemessages.net", true },
+ { "condominiosi.it", true },
{ "condominioweb.com", true },
{ "condosforcash.com", true },
{ "condroz-motors.be", true },
{ "conectadev.com", true },
- { "conectar.ru", true },
{ "conectumfinanse.pl", true },
{ "conejovalleyelectrical.com", true },
{ "conejovalleyelectrician.com", true },
@@ -8490,10 +8896,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "conejovalleylighting.com", true },
{ "conejovalleyoutdoorlighting.com", true },
{ "conexiontransporte.com", true },
+ { "conference.dnsfor.me", true },
{ "confiancefoundation.org", true },
{ "config.schokokeks.org", false },
{ "confiwall.de", true },
{ "conformax.com.br", true },
+ { "congafasdesol.com", true },
{ "congineer.com", true },
{ "congobunkering.com", true },
{ "conju.cat", true },
@@ -8520,12 +8928,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "connyduck.at", true },
{ "conociendosalama.com", true },
{ "conorboyd.info", true },
- { "conory.com", true },
+ { "conory.com", false },
+ { "conotoxia.com", true },
{ "conpath.net", true },
{ "conpins.nl", true },
{ "conrad-kostecki.de", true },
{ "conradkostecki.de", true },
{ "conradsautotransmissionrepair.com", true },
+ { "conraid.net", true },
{ "conrail.blue", true },
{ "consagracionamariasantisima.org", true },
{ "consciouschoices.net", true },
@@ -8537,6 +8947,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "conservados.com.br", true },
{ "conservatoriesincornwall.com", true },
{ "consideredgifts.com", true },
+ { "consideryourways.net", true },
{ "consilium-vitae.ch", true },
{ "consiliumvitae.ch", true },
{ "consill.com", true },
@@ -8548,7 +8959,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "constancechen.me", true },
{ "constant-rough.de", true },
{ "constares.de", true },
+ { "constituenttracker.com", true },
{ "constitution.website", true },
+ { "constructexpres.ro", true },
{ "constructieve.nl", true },
{ "construction-colleges.com", true },
{ "construction-student.co.uk", true },
@@ -8556,7 +8969,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "constructive.men", true },
{ "consul.io", true },
{ "consulenza.pro", true },
- { "consultanta-in-afaceri.ro", true },
{ "consultation.biz.tr", true },
{ "consultimator.com", true },
{ "consultimedia.de", true },
@@ -8566,8 +8978,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "consulvation.com", true },
{ "consumeractionlawgroup.com", true },
{ "consumerfiles.com", true },
+ { "consumersentinel.gov", true },
{ "consuwijzer.nl", true },
{ "contactsingapore.sg", true },
+ { "containerspace.com.au", true },
{ "contaquanto.com.br", true },
{ "contemplativeeducation.org", true },
{ "content-api-dev.azurewebsites.net", false },
@@ -8578,19 +8992,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "conti-profitlink.co.uk", true },
{ "continuum.memorial", true },
{ "contrabass.net", true },
+ { "contractdigital.co.uk", true },
{ "contractormountain.com", true },
{ "contractwriters.com", true },
{ "contraspin.co.nz", true },
{ "contratatupoliza.com", true },
{ "contributor.google.com", false },
- { "controlarlaansiedad.com", true },
{ "controlautocom.com.br", true },
{ "controlbooth.com", true },
{ "controle.net", true },
{ "controleer-maar-een-ander.nl", true },
{ "controltickets.com.br", true },
{ "conv2pdf.com", true },
- { "convergence.fi", true },
{ "convergencela.com", true },
{ "convergnce.com", true },
{ "conversiones.com", true },
@@ -8610,16 +9023,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cooking-sun.com", true },
{ "cookingcrusade.com", true },
{ "cookinglife.nl", false },
+ { "cookingperfected.com", true },
{ "cookingreporter.com", true },
{ "cookmedical.com", false },
{ "cooko.at", true },
- { "cooksbookscorks.com", true },
+ { "cooksecuritygroup.com", true },
+ { "cooksplanet.com", true },
{ "cookwithmanali.com", true },
{ "cool-parties.co.uk", true },
{ "cool-wallpapers.jp", true },
{ "cool.haus", true },
- { "cool110.tk", true },
- { "cool110.xyz", true },
{ "coolattractions.co.uk", true },
{ "coolbitx.com", true },
{ "coolcamping.com", true },
@@ -8628,10 +9041,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "coolerssr.space", true },
{ "coolgifs.de", true },
{ "coolprylar.se", true },
- { "coolwallet.io", true },
+ { "cooltang.ooo", true },
{ "coonawarrawines.com.au", true },
- { "coopens.com", true },
- { "coor.fun", true },
+ { "cooperativehandmade.com", true },
{ "coore.jp", true },
{ "coorpacademy.com", true },
{ "copdfoundation.org", true },
@@ -8642,10 +9054,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "copplaw.com", true },
{ "copta-imagefilme-und-drohnenvideos.de", true },
{ "coptkm.cz", true },
- { "copycaught.co", true },
+ { "copycaught.com", true },
{ "copycaught.net", true },
{ "copycaught.org", true },
- { "copycaught.xyz", true },
{ "copycrafter.net", true },
{ "copydz.com", true },
{ "copypoison.com", true },
@@ -8655,6 +9066,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cordejong.nl", true },
{ "cordep.biz", true },
{ "corder.tech", true },
+ { "cordeydesign.ch", true },
{ "cordis.io", true },
{ "cordis.tk", true },
{ "cordlessdog.com", true },
@@ -8664,7 +9076,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "core.org.pt", true },
{ "coreapm.org", true },
{ "corecodec.com", true },
- { "coredump.gr", true },
{ "coreless-stretchfilm.com", true },
{ "corelia.net", true },
{ "corepartners.com.ua", true },
@@ -8694,12 +9105,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "corpfin.net", true },
{ "corpio.nl", true },
{ "corpkitnw.com", true },
+ { "corpoepele.com.br", true },
{ "corpoflow.nl", true },
{ "corporacioninternacionallideres.org", true },
{ "corporateclash.net", true },
{ "corporatecomputingsolutions.com", true },
{ "corporateinfluencers.com", true },
- { "corporativoarval.info", true },
{ "corpulant.coffee", true },
{ "corpulantcoffee.com", true },
{ "corpulent.coffee", true },
@@ -8716,6 +9127,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "corscanplus.com", true },
{ "corsectra.com", true },
{ "corsihaccpsicurezzalavoro.it", true },
+ { "corso-antincendio.org", true },
{ "cortexitrecruitment.com", true },
{ "cortexx.nl", true },
{ "cortis-consulting.ch", true },
@@ -8727,9 +9139,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cosasque.com", true },
{ "cosciamoos.com", true },
{ "cosirex.com", true },
- { "coslinker.com", true },
{ "cosmechic.fr", true },
{ "cosmekaitori.jp", true },
+ { "cosmetic-surgery-prices.co.uk", true },
{ "cosmeticappraisal.com", true },
{ "cosmeticasimple.com", true },
{ "cosmeticos-naturales.com", true },
@@ -8746,6 +9158,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "costinstefan.eu", true },
{ "costreportdata.com", false },
{ "costulessdirect.com", true },
+ { "cote-chasse.com", true },
{ "coteries.com", true },
{ "cotoacc.com", true },
{ "cotonmusic.ch", true },
@@ -8767,6 +9180,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "countrybrewer.com.au", true },
{ "countryfrog.uk", true },
{ "countryhouseresort.com", true },
+ { "countryoutlaws.ca", true },
{ "countybankdel.com", true },
{ "countyjailinmatesearch.com", true },
{ "coupe-bordure.com", true },
@@ -8775,6 +9189,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cour4g3.me", true },
{ "couragefound.org", true },
{ "coursables.com", true },
+ { "courseconfidence.com", true },
{ "coursera.org", true },
{ "courtlistener.com", true },
{ "couscous.recipes", true },
@@ -8792,22 +9207,29 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cowbird.org", true },
{ "cowboyim.com", true },
{ "coweo.cz", true },
- { "cowo.group", true },
{ "coworking-luzern.ch", true },
{ "coxcapitalmanagement.com", true },
{ "coxxs.me", true },
- { "coxxs.moe", true },
+ { "coya.tw", true },
{ "cozo.me", true },
{ "cozyeggdesigns.com", true },
{ "cp-st-martin.be", true },
+ { "cpahunt.com", false },
{ "cpap.com", true },
{ "cpasperdu.com", true },
+ { "cpbanq.com", true },
{ "cpbapremiocaduceo.com.ar", true },
{ "cpcheats.co", true },
{ "cpd-education.co.uk", true },
{ "cpe-colleg.de", true },
+ { "cpe-registry.com", true },
+ { "cpe-registry.net", true },
+ { "cpe-registry.org", true },
+ { "cperegistry.com", true },
+ { "cperegistry.net", true },
+ { "cperegistry.org", true },
+ { "cpgarmor.com", true },
{ "cphpvb.net", true },
- { "cplala.com", true },
{ "cplus.me", true },
{ "cplusplus.se", true },
{ "cppan.org", true },
@@ -8817,7 +9239,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cprnearme.com", true },
{ "cpsc.gov", true },
{ "cpsq.fr", true },
- { "cptoon.com", true },
{ "cpu.biz.tr", true },
{ "cpvmatch.eu", true },
{ "cpy.pt", true },
@@ -8828,9 +9249,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cra-bank.com", true },
{ "cra-search.net", true },
{ "craazzyman21.at", true },
+ { "crabfactory.com.my", true },
{ "crackcat.de", true },
{ "cracker.in.th", true },
- { "crackers4cheese.com", true },
{ "crackle.io", true },
{ "crackorsquad.in", true },
{ "crackslut.eu", true },
@@ -8838,8 +9259,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cradlepointecm.com", true },
{ "craft-verlag.de", true },
{ "craftandbuild.de", true },
- { "craftcommerce.com", true },
- { "craftinghand.com", false },
+ { "craftinghand.com", true },
{ "craftinginredlipstick.com", true },
{ "craftist.de", true },
{ "craftsmandruggets.com", true },
@@ -8857,8 +9277,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cranforddental.com", true },
{ "cranshafengin.com", true },
{ "crapouill.es", true },
+ { "crashboy.ws", true },
{ "cratss.co.uk", true },
- { "crawcial.de", true },
{ "crawford.cloud", true },
{ "crawfordcountytcc.org", true },
{ "crawl.report", true },
@@ -8872,7 +9292,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "crazybulk.com", true },
{ "crazybulk.de", true },
{ "crazybulk.fr", true },
+ { "crazybulksteroids.com", true },
{ "crazycastles.ie", true },
+ { "crazycraftland.net", true },
{ "crazydomains.ae", true },
{ "crazydomains.co.nz", true },
{ "crazydomains.co.uk", true },
@@ -8892,12 +9314,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "crealogix-online.com", true },
{ "creamcastles.co.uk", true },
{ "creared.edu.co", true },
- { "createcos.com", true },
{ "createme.com.pl", true },
{ "createursdefilms.com", true },
+ { "creaticworld.net", true },
{ "creatieven.com", true },
{ "creation-contemporaine.com", true },
+ { "creativ-impuls-dekorateurin-muenchen.de", true },
{ "creative-wave.fr", true },
+ { "creativeangles.in", true },
{ "creativebites.de", true },
{ "creativecaptiv.es", true },
{ "creativecommons.gr", true },
@@ -8907,7 +9331,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "creativefolks.co.uk", true },
{ "creativefreedom.ca", true },
{ "creativeglassgifts.com.au", true },
- { "creativeground.com.au", true },
{ "creativeimagery.com.au", true },
{ "creativeink.de", true },
{ "creativekkids.com", true },
@@ -8922,7 +9345,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "creatixx-network.de", false },
{ "creators-design.com", true },
{ "creators.direct", true },
+ { "creatorswave.com", true },
{ "creatujoya.com", true },
+ { "crecips.com", true },
{ "credential.eu", true },
{ "credex.bg", true },
{ "credigo.se", true },
@@ -8944,10 +9369,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "crefelder.com", true },
{ "crem.in", false },
{ "cremepassion.de", true },
- { "crena.ch", true },
{ "crepa.ch", true },
{ "crepererum.net", true },
- { "crescent.gr.jp", true },
{ "crestasantos.com", true },
{ "cretdupuy.com", true },
{ "creteangle.com", true },
@@ -8955,7 +9378,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "creusalp.ch", true },
{ "crew505.org", true },
{ "crgalvin.com", true },
+ { "crgm.net", true },
{ "cribcore.com", true },
+ { "cricklewood.condos", true },
{ "criena.com", true },
{ "criena.net", true },
{ "crimefreeliving.com", true },
@@ -8968,6 +9393,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "criscitos.it", true },
{ "crisisactual.com", true },
{ "crisisnextdoor.gov", true },
+ { "crismatthews.com", true },
{ "crisp.chat", true },
{ "crisp.email", true },
{ "crisp.help", true },
@@ -8979,14 +9405,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "critical.today", false },
{ "criticalsurveys.co.uk", true },
{ "crizin.io", true },
+ { "crizk.com", true },
{ "crm.onlime.ch", false },
{ "crm114d.com", true },
{ "crochetnerd.com", true },
{ "croisedanslemetro.com", true },
{ "croixblanche-haguenau.fr", true },
{ "cromefire.myds.me", true },
- { "cromosomax.com", true },
{ "croncron.io", true },
+ { "cronenberg.cc", true },
{ "cronix.cc", true },
{ "cronologie.de", true },
{ "cronometer.com", true },
@@ -8997,6 +9424,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cross-led-sign.com", true },
{ "cross-link.ch", true },
{ "cross-view.com", true },
+ { "cross-x.com", true },
{ "cross.lol", true },
{ "crossborderreturns.com", true },
{ "crosscom.ch", true },
@@ -9007,6 +9435,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "crossorig.in", true },
{ "crossoverit.com", true },
{ "crosssellguide.com", true },
+ { "crossway.nl", true },
{ "crow.tw", true },
{ "crowd.supply", true },
{ "crowdbox.net", true },
@@ -9039,19 +9468,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cryoit.com", true },
{ "cryothanasia.com", true },
{ "cryp.no", true },
+ { "crypkit.com", true },
{ "crypt.is-by.us", true },
{ "cryptagio.com", true },
{ "cryptearth.de", true },
{ "crypted.chat", true },
{ "crypteianetworks.com", true },
- { "crypticshell.co.uk", true },
{ "crypto-armory.com", true },
{ "crypto.cat", false },
{ "crypto.graphics", true },
{ "crypto.is", false },
{ "cryptobin.co", true },
{ "cryptocon.org", true },
+ { "cryptoegg.ca", true },
{ "cryptofan.org", true },
+ { "cryptofrog.co", true },
{ "cryptography.ch", true },
{ "cryptography.io", true },
{ "cryptoguidemap.com", true },
@@ -9061,7 +9492,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cryptolinc.com", true },
{ "cryptology.ch", true },
{ "cryptolosophy.org", true },
+ { "cryptomail.nl", true },
{ "cryptomaniaks.com", true },
+ { "cryptonom.org", true },
{ "cryptonym.com", true },
{ "cryptoparty.at", true },
{ "cryptoparty.tv", true },
@@ -9083,8 +9516,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "crystone.me", true },
{ "cryz.ru", true },
{ "cs2016.ch", true },
+ { "csa-library.org", true },
+ { "csaapac.com", true },
+ { "csaapac.org", true },
{ "csabg.org", true },
+ { "csacongress.com", true },
{ "csacongress.org", true },
+ { "csacongress.us", true },
+ { "csadc.org", true },
+ { "csasummit.net", true },
+ { "csasummit.org", true },
{ "csbs.fr", true },
{ "csbuilder.io", true },
{ "csca.me", true },
@@ -9101,8 +9542,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "csi.lk", true },
{ "csinterstargeneve.ch", true },
{ "cskentertainment.co.uk", true },
+ { "cslaboralistas.pe", true },
{ "csmainframe.com", true },
{ "csokolade.hu", true },
+ { "csosa.gov", true },
{ "csovek-idomok.hu", true },
{ "csp.ch", true },
{ "cspeti.hu", true },
@@ -9144,6 +9587,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cube-cloud.com", true },
{ "cube.builders", true },
{ "cube.de", true },
+ { "cube.la", true },
{ "cubebot.io", true },
{ "cubebuilders.net", true },
{ "cubecart-demo.co.uk", true },
@@ -9167,10 +9611,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cuddlingyaks.com", true },
{ "cueca.com.br", true },
{ "cuecasonline.com.br", true },
+ { "cuegee.com", true },
{ "cuentasmutualamr.org.ar", true },
{ "cuetoems.com", true },
{ "cuibonobo.com", true },
- { "cuisinezest.com", true },
{ "cultiv.nl", true },
{ "cultivo.bio", true },
{ "cultofd50.org", true },
@@ -9183,11 +9627,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cumberlandrivertales.com", true },
{ "cumparama.com", true },
{ "cumplegenial.com", true },
+ { "cumtd.com", true },
+ { "cuntflaps.me", true },
{ "cuoc.org.uk", true },
{ "cup.al", true },
- { "cupcakesandcrinoline.com", true },
{ "cupcao.gov", true },
- { "cupidosshop.com", true },
+ { "cupoane-reducere.net", true },
{ "cupom.net", true },
{ "cuppycakes.fi", true },
{ "cur.by", true },
@@ -9200,17 +9645,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "curio-shiki.com", true },
{ "curiosity-driven.org", true },
{ "curiouspeddler.com", true },
+ { "curlify.com", true },
{ "curlybracket.co.uk", true },
{ "currency-strength.com", true },
{ "currentlystreaming.com", true },
{ "currentlyusa.com", true },
- { "currentobserver.com", true },
{ "currynissanmaparts.com", true },
{ "cursos-trabajadores.net", true },
{ "cursos.com", true },
{ "cursosforex.com", true },
{ "cursosingles.com", true },
{ "cursossena.co", true },
+ { "cursosypostgrados.com", true },
{ "cursuri-de-actorie.ro", true },
{ "curtacircuitos.com.br", false },
{ "curtis-smith.me.uk", true },
@@ -9224,10 +9670,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "curveprotect.cz", true },
{ "curveprotect.net", true },
{ "curveprotect.org", true },
- { "curvesandwords.com", true },
{ "curvissa.co.uk", true },
{ "curvylove.de", true },
{ "custodyxchange.com", true },
+ { "custombikes.cl", true },
{ "customdissertation.com", true },
{ "customerbox.ir", true },
{ "customfitbymj.net", true },
@@ -9261,12 +9707,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cvlibrary.co.uk", true },
{ "cvmu.jp", true },
{ "cvr.dk", true },
- { "cvursache.com", true },
+ { "cvtemplatemaster.com", true },
+ { "cvutdecin.cz", true },
{ "cvv.cn", true },
{ "cw.center", true },
{ "cwagner.me", true },
{ "cwarren.org", true },
{ "cwbrtrust.ca", true },
+ { "cwc.gov", true },
{ "cwgaming.co.uk", true },
{ "cwinfo.fi", true },
{ "cwmart.in", true },
@@ -9284,13 +9732,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cyanghost.com", true },
{ "cyber.je", true },
{ "cyberatlantis.com", true },
+ { "cyberbot.info", true },
{ "cybercareers.gov", true },
- { "cybercloud.cc", true },
{ "cybercocoon.com", true },
{ "cybercrew.cc", true },
{ "cybercrime-forschung.de", true },
{ "cybercrime.gov", true },
+ { "cybercymru.co.uk", false },
{ "cyberduck.io", true },
+ { "cyberdyne.llc", true },
{ "cyberexplained.info", true },
{ "cybergates.org", true },
{ "cybergrx.com", true },
@@ -9303,13 +9753,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cyberlightapp.com", true },
{ "cybermeldpunt.nl", true },
{ "cyberogism.com", true },
+ { "cyberonesol.com", true },
{ "cyberoptic.de", true },
{ "cyberpioneer.net", false },
{ "cyberpubonline.com", true },
{ "cyberregister.nl", true },
{ "cyberregister.org", true },
{ "cybersafesolutions.com", true },
- { "cybersantri.com", true },
{ "cyberscan.io", true },
{ "cybersecurity.nz", true },
{ "cybersecurity.run", true },
@@ -9322,16 +9772,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cyberspect.com", true },
{ "cyberspect.io", true },
{ "cyberstatus.de", true },
- { "cybertorsk.org", true },
{ "cybertu.be", true },
{ "cyberwars.dk", true },
{ "cyberwire.nl", true },
+ { "cyberxpert.nl", true },
{ "cybit.io", true },
{ "cybozu.cn", true },
{ "cybozu.com", true },
{ "cybozulive-dev.com", true },
{ "cybozulive.com", true },
- { "cybrary.it", true },
{ "cyclebeads.com", true },
{ "cycleluxembourg.lu", true },
{ "cyclinggoodso.com", true },
@@ -9358,7 +9807,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cyph.video", true },
{ "cyph.ws", true },
{ "cypherpunk.at", true },
- { "cypherpunk.com", true },
{ "cypherpunk.observer", true },
{ "cypressinheritancesaga.com", true },
{ "cypresslegacy.com", true },
@@ -9366,7 +9814,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "cyrating.com", true },
{ "cysec.biz", true },
{ "cysmo.de", true },
- { "cyson.tech", true },
{ "cytech.com.tr", true },
{ "cytegic-update-packages.com", true },
{ "cytotecforsale.com", true },
@@ -9384,11 +9831,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "d-20.fr", true },
{ "d-designerin.de", true },
{ "d-eisenbahn.com", true },
+ { "d-imitacion.top", true },
{ "d-loop.de", true },
- { "d-msg.com", true },
+ { "d-macindustries.com", true },
{ "d-parts.de", true },
{ "d-parts24.de", true },
- { "d-quantum.com", true },
{ "d-toys.com.ua", true },
{ "d-training.de", true },
{ "d.nf", true },
@@ -9399,16 +9846,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "d0xq.com", true },
{ "d2.gg", true },
{ "d2ph.com", true },
+ { "d2qa61rbluifiq.cloudfront.net", true },
{ "d3lab.net", true },
{ "d3xt3r01.tk", true },
{ "d3xx3r.de", true },
{ "d42.no", true },
{ "d4done.com", true },
- { "d4wson.com", true },
+ { "d4fx.de", true },
{ "d4x.de", true },
{ "d66.nl", true },
{ "d6c5yfulmsbv6.cloudfront.net", true },
+ { "d7211.com", true },
+ { "d7215.com", true },
+ { "d7216.com", true },
{ "d8.io", true },
+ { "d88688.com", true },
{ "d88988.com", true },
{ "da42foripad.com", true },
{ "daallexx.eu", true },
@@ -9421,6 +9873,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dachtechnik-windschuettl.de", true },
{ "daciaforum.nl", true },
{ "daciamodellen.nl", true },
+ { "dadadani.xyz", true },
+ { "daddybio.com", true },
{ "dado.fr", true },
{ "dado.me", true },
{ "dado.virtual.museum", true },
@@ -9431,15 +9885,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "daemen.org", true },
{ "daemwool.ch", true },
{ "daevel.fr", true },
- { "dafnik.me", true },
{ "dafont.com", true },
{ "dafricapress.com", true },
+ { "dafyddcrosby.com", true },
{ "dag-hebergement.fr", true },
{ "dag-konsult.com", true },
{ "dagensannonser.se", true },
{ "dagmar2018.cz", true },
{ "dahlberg.cologne", true },
{ "dai.top", true },
+ { "dai94.com", true },
{ "daigakujuken-plus.com", true },
{ "daikoz.com", true },
{ "dailybits.be", true },
@@ -9452,11 +9907,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dailyroverr.com", true },
{ "dailyxenang.com", true },
{ "daintymeal.com", true },
+ { "dair.se", true },
{ "dairyshrine.org", true },
{ "daisakuikeda.org", true },
{ "daisidaniels.co.uk", true },
{ "daisy-peanut.com", true },
{ "daisypeanut.com", true },
+ { "daitouryu-jujutsu.com", true },
{ "daiweihu.com", true },
{ "daiyuu.jp", true },
{ "dajiadu.net", true },
@@ -9476,6 +9933,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dalmatiersheusden.be", true },
{ "damaged.org", true },
{ "damasexpress.com", true },
+ { "damedrogy.cz", true },
{ "damejidlo.cz", true },
{ "dameocio.com", true },
{ "damghaem.ir", true },
@@ -9484,13 +9942,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "daminiphysio.ca", true },
{ "damip.net", true },
{ "damirsystems.com", true },
+ { "damjanovic.it", true },
{ "dammekens.be", true },
{ "damngoodpepper.com", false },
- { "damongant.de", true },
{ "damonline.dk", true },
{ "dampedia.com", true },
{ "dan-informacijske-varnosti.si", true },
{ "dan.me.uk", true },
+ { "danads.com", true },
{ "danaketh.com", true },
{ "danamica.dk", true },
{ "danandrum.com", true },
@@ -9503,6 +9962,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dancingshiva.at", false },
{ "dandenongroadapartments.com.au", true },
{ "daneandthepain.com", true },
+ { "danfromit.co.uk", true },
+ { "danfromit.com", true },
{ "dangmai.tk", true },
{ "dangr.zone", true },
{ "danhalliday.com", true },
@@ -9517,8 +9978,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "danielas.boutique", true },
{ "danielehniss.de", true },
{ "danielepestilli.com", true },
+ { "danielfeau.com", true },
{ "danielgorr.de", true },
{ "danielgray.email", true },
+ { "danielgray.me", true },
{ "danielheal.net", true },
{ "danielhinterlechner.eu", true },
{ "danielhochleitner.de", true },
@@ -9543,10 +10006,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "danielstach.cz", true },
{ "danielsteiner.net", true },
{ "danielstiner.me", true },
+ { "danielthompson.info", true },
{ "danieltollot.de", true },
{ "danielvoogsgerd.nl", true },
{ "danielwildhaber.ch", true },
- { "danifabi.eu", true },
{ "danilapisarev.com", true },
{ "danjesensky.com", true },
{ "dank.ninja", true },
@@ -9565,6 +10028,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dannycairns.com", true },
{ "dannyrohde.de", true },
{ "dannystevens.co.uk", true },
+ { "danonsecurity.com", true },
{ "danotage.tv", true },
{ "danpiel.net", true },
{ "dansa.com.co", true },
@@ -9577,6 +10041,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dansk-skole.de", true },
{ "dansk777.dk", true },
{ "danskoferie.dk", true },
+ { "danskoya.com", true },
{ "danslan.org", true },
{ "danstillman.com", true },
{ "dantelistan.com", true },
@@ -9586,13 +10051,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "danwolff.se", true },
{ "danyabanya.com", true },
{ "danzac.com", true },
- { "dao.spb.su", true },
{ "daoro.net", true },
{ "daphne.informatik.uni-freiburg.de", true },
+ { "dapianw.com", true },
{ "dapim.co.il", true },
- { "daplie.com", true },
{ "dapps.earth", true },
{ "dappworld.com", true },
+ { "dara-berlin.de", true },
{ "daracokorilo.com", true },
{ "daravk.ch", true },
{ "darbi.org", true },
@@ -9600,9 +10065,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "darc-mak.de", true },
{ "darchoods.net", false },
{ "darcymarshall.com", true },
+ { "dare.deals", true },
{ "daren.com.br", true },
{ "dareyou.be", true },
+ { "darf.nl", true },
{ "dariaburger.de", true },
+ { "darinkotter.com", true },
{ "darioackermann.ch", true },
{ "darioclip.com", true },
{ "dariosirangelo.me", true },
@@ -9625,7 +10093,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "darknetlive.com", true },
{ "darknight.blog", true },
{ "darkrisks.com", true },
- { "darkroomsaredead.com", true },
{ "darkserver.fedoraproject.org", true },
{ "darkserver.stg.fedoraproject.org", true },
{ "darkshop.nl", true },
@@ -9635,6 +10102,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "darkwater.info", true },
{ "darkwebnews.com", true },
{ "darkx.me", true },
+ { "darlo.co.uk", false },
{ "darmgesundheit.ch", true },
{ "darom.jp", true },
{ "darookee.net", false },
@@ -9643,11 +10111,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dartcode.org", true },
{ "dartetdemetiers.fr", true },
{ "darth-sonic.de", true },
- { "dartsdon.jp", true },
{ "dartshopmn.nl", true },
{ "darwinkel.net", true },
{ "darwinsearch.org", true },
- { "daryl.moe", true },
{ "darylcrouse.com", true },
{ "darylcumbo.net", true },
{ "das-forum24.de", true },
@@ -9665,6 +10131,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "data-wing.ga", true },
{ "data.gov", true },
{ "data.govt.nz", true },
+ { "data.world", true },
{ "data3w.nl", true },
{ "databionix.com", true },
{ "databutlr.com", true },
@@ -9672,6 +10139,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "datacalle.com", true },
{ "datacandy.com", true },
{ "datacool.tk", true },
+ { "datadit.hu", true },
{ "datadyne.technology", true },
{ "datafd.com", true },
{ "datafd.net", true },
@@ -9681,13 +10149,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dataharvest.at", true },
{ "datahive360.com", true },
{ "datahjalp.nu", true },
- { "datahoarder.xyz", true },
{ "datajobs.ai", true },
{ "datakick.org", true },
{ "datalife.gr", true },
{ "datalysis.ch", true },
{ "dataprivacysolution.com", true },
{ "dataprotectionadvisors.com", true },
+ { "datapun.ch", true },
{ "datapure.net", true },
{ "dataregister.info", true },
{ "datascience.cafe", true },
@@ -9706,6 +10174,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "datatruckers.eu", true },
{ "datatruckers.net", true },
{ "datatruckers.org", true },
+ { "datecougarslocal.com", true },
{ "datememe.com", true },
{ "datengrab.xyz", true },
{ "datenkeks.de", true },
@@ -9718,6 +10187,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "datenschutzzentrum.de", true },
{ "datenwerkstatt.net", true },
{ "datewon.net", false },
+ { "datingsite-vergelijken.website", true },
{ "datingticino.ch", true },
{ "datmancrm.com", true },
{ "dator-test.se", true },
@@ -9735,6 +10205,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "davecardwell.com", true },
{ "davelynes.com", true },
{ "daveoc64.co.uk", true },
+ { "daveops.net", true },
{ "davepage.me.uk", true },
{ "davepearce.com", true },
{ "davepermen.net", true },
@@ -9744,6 +10215,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "davetempleton.com", true },
{ "davevelopment.net", true },
{ "davewardle.com", true },
+ { "davewood.com.au", true },
{ "david-corry.com", true },
{ "david-hinschberger.me", true },
{ "david-jeffery.co.uk", true },
@@ -9753,6 +10225,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "david.kitchen", true },
{ "davidadrian.org", true },
{ "davidandersson.se", true },
+ { "davidandrewcoaching.com", true },
{ "davidbranco.me", true },
{ "davidbuckell.com", true },
{ "davidcrx.net", true },
@@ -9764,6 +10237,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "davidgouveia.net", true },
{ "davidgow.net", true },
{ "davidhanle.com", true },
+ { "davidkeane.com", true },
{ "davidkennardphotography.com", true },
{ "davidking.xyz", true },
{ "davidlamprea.com", true },
@@ -9790,20 +10264,27 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "davypropper.com", true },
{ "daw.nz", true },
{ "dawena.de", true },
- { "dawgs.ga", true },
{ "dawnbringer.eu", true },
{ "dawnbringer.net", true },
{ "dawnofeden.net", true },
{ "dawoud.org", true },
{ "dawson-floridavilla.co.uk", true },
+ { "dax.guide", true },
+ { "daxpatterns.com", true },
{ "daycontactlens.com", true },
{ "daydream.team", true },
{ "daylight-dream.ee", true },
{ "daylightpirates.org", true },
- { "dayman.net", true },
+ { "dayman.net", false },
{ "daymprove.life", true },
{ "dayofdays.be", true },
{ "daysoftheyear.com", true },
+ { "dazz.it", true },
+ { "dazzit.ca", true },
+ { "dazzit.com", true },
+ { "dazzit.net", true },
+ { "dazzit.org", true },
+ { "dazzit.xyz", true },
{ "db-works.nl", true },
{ "db.ci", true },
{ "dbapress.org", true },
@@ -9814,6 +10295,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dbentertainment.co.uk", true },
{ "dbgamestudio.com", true },
{ "dbjc.tk", true },
+ { "dbjl.fr", true },
{ "dblcastles.co.uk", true },
{ "dbldub.net", true },
{ "dbmiller.org", true },
@@ -9822,6 +10304,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dborcard.com", true },
{ "dbpkg.com", true },
{ "dbq.com", true },
+ { "dbrand.com", true },
{ "dbrgn.ch", true },
{ "dbtsai.com", true },
{ "dc-elektro.com", true },
@@ -9836,18 +10319,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dcards.in.th", true },
{ "dcautomacao.com.br", true },
{ "dcbouncycastles.co.uk", true },
- { "dcc.cat", true },
+ { "dcc.moe", true },
{ "dccommunity.de", true },
{ "dcepler.net", true },
{ "dchatelain.ch", true },
{ "dchest.org", true },
{ "dckd.nl", true },
+ { "dcl.re", true },
{ "dclaisse.fr", true },
{ "dcmediahosting.com", true },
{ "dcmt.co", true },
{ "dcpower.eu", true },
{ "dcrdev.com", true },
{ "dcw.io", true },
+ { "dd7211.com", true },
{ "ddatsh.com", true },
{ "ddays2008.org", true },
{ "ddel.de", true },
@@ -9867,7 +10352,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "de-rwa.de", true },
{ "de-spil.be", true },
{ "de.search.yahoo.com", false },
+ { "dead-letter.email", true },
{ "deadbeef.ninja", true },
+ { "deadbyhost.com", true },
{ "deadc0de.re", true },
{ "deadinsi.de", false },
{ "deadsoul.net", false },
@@ -9888,6 +10375,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dealerselectric.com", true },
{ "dealinflatables.co.uk", true },
{ "dealpass.no", true },
+ { "dealspotr.com", true },
+ { "dealszone.net", true },
{ "deamuseum.org", true },
{ "deanbank.com", true },
{ "deanisa.ninja", true },
@@ -9910,8 +10399,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "debarrasclichy.com", true },
{ "debarrascolombes.com", true },
{ "debarrasnanterre.com", true },
+ { "debatereport.com", true },
{ "debbyefurd.com", true },
{ "debie-usedcars.be", true },
+ { "debigare.com", true },
{ "debora-singkreis.de", true },
{ "debron-ot.nl", true },
{ "debrusoft.ch", true },
@@ -9926,6 +10417,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dechat.nl", true },
{ "decher.de", true },
{ "decidetreatment.org", true },
+ { "decimatechnologies.eu", true },
{ "decis.fr", true },
{ "decisivetactics.com", true },
{ "deckbuilderamerica.com", true },
@@ -9936,11 +10428,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "decompiled.de", true },
{ "decoora.com", true },
{ "decor-d.com", true },
+ { "decor-live.ru", true },
{ "decoratingadvice.co.uk", true },
{ "decoratore.roma.it", true },
{ "decoratrix.com", true },
{ "decorauvent.ca", true },
{ "decorestilo.com.br", true },
+ { "decorumcomics.com", true },
{ "decosoftware.com", true },
{ "decrousaz-ceramique.ch", true },
{ "decrypto.net", true },
@@ -9959,21 +10453,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "deejayevents.ro", true },
{ "deelmijnreis.nl", true },
{ "deep-chess.com", true },
+ { "deep-labs.com", true },
+ { "deep.club", true },
{ "deeparamaraj.com", true },
{ "deepbluecrafting.co.uk", true },
{ "deepblueemail.com", true },
{ "deepcode.io", true },
- { "deeperxh.com", true },
{ "deephill.com", true },
+ { "deepinnov.com", true },
{ "deepinsight.io", true },
- { "deeployr.io", true },
{ "deeps.me", true },
{ "deepserve.info", true },
{ "deepsouthsounds.com", true },
{ "deepspace.dedyn.io", true },
+ { "deepspace4.com", true },
{ "deepwealth.institute", true },
{ "deepz.pt", true },
{ "deepzz.com", true },
+ { "deerfieldapartmentsstl.com", true },
{ "def-pos.ru", true },
{ "defcon.org", true },
{ "defcongroups.org", true },
@@ -9994,7 +10491,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "defme.eu", true },
{ "defont.nl", true },
{ "defrax.com", true },
- { "defrax.de", true },
{ "defreitas.no", true },
{ "deftek.com", true },
{ "deftig-und-fein.de", true },
@@ -10005,13 +10501,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "degeberg.com", true },
{ "degeberg.dk", true },
{ "degen-elektrotechnik.de", true },
- { "degestamptepot.nl", true },
- { "degosoft.nl", true },
{ "degoulet.net", true },
{ "degracetechnologie.com", true },
+ { "degrasboom.nl", true },
{ "degressif.com", true },
+ { "degroupage.info", true },
{ "dehopre.com", true },
{ "deidee.nl", true },
+ { "dein-trueffel.de", true },
{ "deinballon.de", true },
{ "deinewebsite.de", true },
{ "deinfoto.ch", true },
@@ -10019,6 +10516,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "deitti.net", true },
{ "dejan.media", true },
{ "dejandayoff.com", true },
+ { "dejting-sidor.com", true },
{ "dejure.org", true },
{ "dejw.cz", true },
{ "dekasegi-kansai.com", true },
@@ -10031,13 +10529,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dekonix.ru", true },
{ "dekulk.nl", true },
{ "delahrzolder.nl", true },
+ { "delam.site", true },
{ "delandalucia.com", true },
{ "delbecqvo.be", true },
{ "delbrouck.ch", true },
+ { "deleenheir.be", true },
{ "deleidscheflesch.nl", true },
{ "delfic.org", true },
{ "delfino.cr", true },
{ "delhionlinegifts.com", true },
+ { "deli-tochigi.jp", true },
{ "deliacreates.com", true },
{ "deliandiver.org", true },
{ "deliciisanatoase.ro", true },
@@ -10045,7 +10546,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "deliciousmedia.net", true },
{ "delicioustable.com", true },
{ "delid.cz", true },
- { "delivery.co.at", true },
{ "deliveryiquique.cl", true },
{ "dellipaoli.com", true },
{ "delogo.nl", true },
@@ -10063,6 +10563,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "deltaservers.com.br", true },
{ "deltasigmachi.org", true },
{ "deltava.org", true },
+ { "deltawolf.tk", true },
{ "demarle.ch", true },
{ "dementiapraecox.de", true },
{ "demeyere-usedcars.be", true },
@@ -10071,7 +10572,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "demilletech.net", true },
{ "demiranda.com", true },
{ "demmer.one", true },
- { "demo.swedbank.se", true },
{ "demo9.ovh", true },
{ "democracychronicles.com", true },
{ "democracyineurope.eu", true },
@@ -10084,9 +10584,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "demotivatorbi.ru", true },
{ "dempsters.ca", false },
{ "demuzere.be", true },
- { "demuzere.com", true },
- { "demuzere.net", true },
- { "demuzere.org", true },
{ "denabot.pw", true },
{ "denaehula.com", true },
{ "denardbrewing.com", true },
@@ -10098,6 +10595,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "denistruffaut.fr", false },
{ "deniszczuk.pl", true },
{ "denizdesign.co.uk", true },
+ { "denkmalagentur.ch", true },
{ "denkubator.de", true },
{ "dennisang.com", true },
{ "dennisdoes.net", false },
@@ -10125,16 +10623,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "deparis.me", true },
{ "depeces.com", true },
{ "depechemode-live.com", true },
+ { "depedclub.ph", true },
{ "depedncr.com", true },
{ "depedtalks.com", true },
+ { "depedtambayan.net", true },
+ { "depedtayo.com", true },
+ { "depedtayo.ph", true },
{ "depicus.com", true },
+ { "deplorablesdaily.com", true },
{ "depone.net", true },
+ { "depositart.com", true },
{ "depot-leipzig.de", true },
{ "depotsquarekerrville.com", true },
{ "depotter-usedcars.be", true },
{ "deprecate.de", true },
{ "depth-co.jp", true },
{ "depthe.gr", true },
+ { "der-bank-blog.de", true },
{ "der-fliesenzauberer.de", true },
{ "der-gardinenmann.de", true },
{ "der-lan.de", true },
@@ -10153,6 +10658,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dereddingsklos.nl", true },
{ "dereferenced.net", true },
{ "derehamcastles.co.uk", true },
+ { "derekbooth.co.uk", true },
{ "derekheld.com", true },
{ "derekkent.com", true },
{ "derekseaman.com", true },
@@ -10174,20 +10680,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "derp.chat", true },
{ "derre.fr", true },
{ "derreichesack.com", true },
- { "dersix.com", true },
{ "dersoundhunter.de", true },
{ "derstulle.de", true },
{ "des-hommes-et-des-clous.com", true },
+ { "desafiomovilidadsustentable.com", true },
{ "desagaz.com", true },
{ "desarrollowp.com", true },
{ "descartes-finance.com", true },
{ "desec.io", true },
+ { "desenfans.com", true },
{ "desertmedaesthetics.com", true },
{ "desertsounds.org", true },
{ "desgenst.ch", true },
{ "design-in-bad.eu", true },
+ { "design-production.jp", true },
{ "design-tooning.de", true },
- { "designdevs.eu", true },
{ "designed-cybersecurity.com", true },
{ "designedbygeniuses.com", true },
{ "designedcybersecurity.com", true },
@@ -10199,8 +10706,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "designville.cz", true },
{ "designville.sk", true },
{ "desila.jp", true },
+ { "deskaservices.com", true },
{ "deskdesign.nl", true },
{ "deskeen.fr", true },
+ { "deskguide.info", true },
{ "desktopd.eu.org", true },
{ "desktopfx.net", false },
{ "deskture.com", true },
@@ -10212,7 +10721,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dessinemoilademocratie.ch", true },
{ "destech.nl", true },
{ "desterman.ru", true },
- { "destileria.net.br", true },
{ "destinationsofnewyorkstate.com", true },
{ "destinattorneyjohngreene.com", true },
{ "destinoytarot.com", true },
@@ -10255,6 +10763,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "deutschland-dsl.de", true },
{ "deuxmetrescubes.fr", true },
{ "dev-brandywineglobal.com", true },
+ { "dev-dot-naga-226708.appspot.com", true },
+ { "dev-greavesindia.pantheonsite.io", true },
{ "dev-gutools.co.uk", true },
{ "dev-pulse-mtn.pantheonsite.io", true },
{ "dev-sev-web.pantheonsite.io", true },
@@ -10263,11 +10773,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "devalps.eu", true },
{ "devb.nl", true },
{ "devcf.com", true },
+ { "devcoins.org", true },
{ "devct.cz", false },
{ "devcu.com", true },
+ { "devcu.net", true },
{ "devel.cz", true },
{ "develop.cool", true },
+ { "develope.cz", true },
{ "developer.android.com", true },
+ { "developer.moe", true },
{ "developer.mydigipass.com", false },
{ "developerdan.com", true },
{ "developerfair.com", true },
@@ -10283,6 +10797,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "devh.net", true },
{ "deviant.email", true },
{ "devillers-occasions.be", true },
+ { "devils-point.de", true },
{ "devilshakerz.com", true },
{ "devinfo.net", false },
{ "devirc.net", true },
@@ -10294,19 +10809,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "devlogr.com", true },
{ "devnull.zone", true },
{ "devonsawatzky.ca", true },
+ { "devonvintagechina.co.uk", true },
{ "devopers.com.br", true },
{ "devops-survey.com", true },
{ "devpsy.info", true },
{ "devragu.com", true },
{ "devrandom.net", true },
- { "devries.one", true },
{ "devsjournal.com", true },
{ "devsrvr.ru", true },
- { "devstaff.gr", true },
{ "devstroke.io", true },
{ "devswag.io", true },
{ "devtty.org", true },
- { "devyn.ca", false },
{ "devzero.io", true },
{ "dewaard.de", true },
{ "dewalch.net", true },
@@ -10320,9 +10833,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dez-online.de", true },
{ "dezeregio.nl", true },
{ "dezet-ev.de", true },
- { "dezintranet.com", true },
{ "dezmembrariromania.ro", true },
{ "dezshop24.de", true },
+ { "dezzoroofing.co.za", true },
{ "df1paw.de", true },
{ "dfctaiwan.org", true },
{ "dfekt.no", true },
@@ -10340,11 +10853,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dgportals.co.uk", true },
{ "dgpot.com", true },
{ "dgt-portal.de", true },
+ { "dgx.io", true },
{ "dharveydev.com", true },
{ "dhautefeuille.eu", true },
{ "dhauwer.nl", true },
{ "dhaynes.xyz", true },
- { "dhbr.org", true },
{ "dhconcept.ch", true },
{ "dheart.net", true },
{ "dhhs.gov", true },
@@ -10357,8 +10870,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dia-de.com", true },
{ "dia.com.br", true },
{ "diablovalleytech.com", true },
- { "diadorafitness.es", true },
+ { "diadiemdangsong.com", true },
{ "diadorafitness.it", true },
+ { "diag.com.ua", true },
{ "diagnostix.org", true },
{ "dialapicnic.co.za", true },
{ "dialoegue.com", true },
@@ -10395,12 +10909,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dicionarioetimologico.com.br", true },
{ "dicionariofinanceiro.com", true },
{ "dicionariopopular.com", true },
+ { "dicionarios.cc", true },
{ "dickieslife.com", true },
+ { "dickord.cloud", true },
{ "dickord.club", true },
{ "dickpics.ru", true },
{ "dicksakowicz.com", true },
{ "dicoding.com", true },
+ { "diconnex.com", true },
{ "dictionaryofnumbers.com", true },
+ { "dictionarypro.net", true },
{ "dictzone.com", true },
{ "didacte.com", true },
{ "didche.net", true },
@@ -10413,7 +10931,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "didikhari.web.id", true },
{ "die-bergfuehrer.de", true },
{ "die-blahuts.de", true },
+ { "die-bobbeloase.com", true },
{ "die-borts.ch", true },
+ { "die-gruenen-teufel.de", true },
{ "die-partei-reutlingen.de", true },
{ "die-pizzabaeckerei.de", true },
{ "die-seide.de", true },
@@ -10432,6 +10952,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "diem-project.org", true },
{ "diemattels.at", true },
{ "dienchaninstitute.com", true },
+ { "diendorfer.space", true },
{ "dienstplan.cc", true },
{ "dienstplan.one", true },
{ "dierabenmutti.de", true },
@@ -10445,7 +10966,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dietafeliz.com", true },
{ "dietbrand.eu", true },
{ "dieterglas.de", true },
+ { "dietergreven.de", false },
{ "dieterstinglhamber.me", false },
+ { "dietervandenbroeck.be", true },
{ "dieti.net", true },
{ "dietlin.com", true },
{ "dietrich.cx", true },
@@ -10472,17 +10995,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "digimagical.com", true },
{ "digimedia.cd", false },
{ "digioccumss.ddns.net", true },
- { "digipitch.com", true },
{ "digital-compounds.com", true },
{ "digital-eastside.de", true },
+ { "digital-insurance-engine.com", true },
+ { "digital-insurance-engine.de", true },
+ { "digital-insurance-platform.com", true },
+ { "digital-insurance-platform.de", true },
{ "digital-liberal.ch", true },
{ "digital-muscle.com.au", true },
+ { "digital-sculpture.org", true },
{ "digital.gov", false },
{ "digital.govt.nz", true },
{ "digital1st.co.uk", true },
{ "digital2web.com", false },
{ "digitalarchitecture.com", true },
{ "digitalbitbox.com", true },
+ { "digitalblood.eu", true },
{ "digitalcitizen.life", true },
{ "digitalcitizen.ro", true },
{ "digitalcraftmarketing.co.uk", true },
@@ -10531,6 +11059,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dillewijnzwapak.nl", true },
{ "dillonkorman.com", true },
{ "diluv.com", true },
+ { "dimanet.fr", true },
{ "dimanss47.net", true },
{ "dimdom.com.br", true },
{ "dime-staging.com", true },
@@ -10555,7 +11084,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dineachook.com.au", true },
{ "dinepont.fr", true },
{ "dinerroboticurology.com", true },
- { "dingcc.me", true },
{ "dingsbums.shop", true },
{ "dinheirolucrar.com", true },
{ "dinkommunikasjon.no", true },
@@ -10582,7 +11110,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "directelectricalltd.co.uk", true },
{ "directlinkfunding.co.uk", true },
{ "directnews.be", true },
+ { "directoriostelefonicos.com", true },
{ "directorioz.com", true },
+ { "directoryhub.io", true },
{ "directreal.sk", true },
{ "directspa.fr", true },
{ "direktvermarktung-schmitzberger.at", true },
@@ -10593,7 +11123,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dirko.net", true },
{ "dirkwolf.de", true },
{ "dirtcraft.ca", true },
- { "dirtygeek.ovh", true },
{ "dirtyincest.com", true },
{ "dirtyprettyartwear.com", true },
{ "disability.gov", true },
@@ -10607,6 +11136,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "discarica.roma.it", true },
{ "dischempharmacie.com", true },
{ "disciples.io", true },
+ { "disciplesmakingdisciples.ca", true },
{ "disciplina.io", true },
{ "discofitta.com", true },
{ "disconformity.net", true },
@@ -10626,6 +11156,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "discoveryottawa.ca", true },
{ "discreet-condooms.nl", true },
{ "discrypt.ca", true },
+ { "discus-communications.dk", true },
{ "disinclined.org", true },
{ "disinfesta.it", true },
{ "disinfestando.info", true },
@@ -10676,6 +11207,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "distillery.com", true },
{ "distinguishedprisoner.com", true },
{ "distribuidoracristal.com.br", true },
+ { "distribuidoraplus.com", true },
{ "distribuidorveterinario.es", true },
{ "distro.fr", true },
{ "ditelbat.com", true },
@@ -10691,18 +11223,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "divegearexpress.net", true },
{ "diveidc.com", true },
{ "diveplan.org", true },
- { "divergenz.org", true },
{ "diversifiedproduct.com", true },
{ "diversityflags.com", true },
{ "diversityflags.com.au", true },
{ "diversityflags.nz", true },
{ "divertiagua.com.br", true },
+ { "divewithfrank.com", true },
{ "divi-experte.de", true },
+ { "dividendz.net", true },
{ "divinasaiamodas.com.br", true },
{ "divinegames.studio", true },
+ { "divineglowinghealth.com", true },
{ "divinemercyparishvld.com", true },
- { "divinemercyparishvlds.com", true },
{ "diving.photo", true },
+ { "divisuite.com", true },
{ "divorcelawyersformen.com", true },
{ "divorciosmurcia.com", true },
{ "diwei.vip", true },
@@ -10714,12 +11248,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "diyosun.com", true },
{ "diytechguides.com", true },
{ "diyvideoeditor.com", true },
+ { "dizalty.tv", true },
{ "dizzythewizard.co.uk", true },
{ "dj-leszwolle.nl", true },
{ "dj-x.info", true },
{ "dj3dub.com", true },
{ "djangobirthday.com", true },
- { "djangogolf.com", true },
{ "djangoproject.com", true },
{ "djangosnippets.org", true },
{ "djbbouncycastles.co.uk", true },
@@ -10728,6 +11262,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "djcursuszwolle.nl", true },
{ "djdavid98.hu", true },
{ "djeung.org", true },
+ { "djiconsulting.com", true },
{ "djipanov.com", true },
{ "djlinux.cz", true },
{ "djlnetworks.co.uk", true },
@@ -10741,7 +11276,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dk.search.yahoo.com", false },
{ "dkcomputers.com.au", true },
{ "dkds.us", true },
- { "dko-steiermark.ml", true },
{ "dkstage.com", true },
{ "dkwedding.gr", true },
{ "dl.google.com", true },
@@ -10749,6 +11283,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dlaspania.pl", true },
{ "dlde.ru", true },
{ "dldl.fr", true },
+ { "dleger.space", true },
{ "dlfsymposium.nl", true },
{ "dlitz.net", true },
{ "dll4free.com", true },
@@ -10773,17 +11308,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dmess.ru", true },
{ "dmi.es", true },
{ "dmitry.sh", true },
- { "dmmkenya.co.ke", true },
+ { "dmix.ca", true },
+ { "dmk-realestate.com", true },
+ { "dmmkenya.co.ke", false },
{ "dmmultionderhoud.nl", true },
{ "dmparish.com", true },
{ "dmschilderwerken.nl", true },
{ "dmx.xyz", true },
{ "dmxledlights.com", true },
+ { "dmzlab.se", true },
{ "dn3s.me", true },
+ { "dn42.eu", false },
{ "dn42.us", true },
{ "dna.li", true },
{ "dnacloud.pl", true },
{ "dnakids.co.uk", true },
+ { "dnalounge.com", true },
+ { "dnapizza.com", true },
{ "dnc.org.nz", true },
{ "dndtools.net", true },
{ "dne.lu", true },
@@ -10807,6 +11348,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dnsman.se", true },
{ "dnspod.ml", true },
{ "dnstwister.report", true },
+ { "do-prod.com", true },
{ "do.gd", true },
{ "do.search.yahoo.com", false },
{ "do13.net", true },
@@ -10814,11 +11356,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "do67.net", true },
{ "dobraprace.cz", true },
{ "dobrev.family", true },
+ { "dobrisan.ro", true },
{ "dobsnet.net", true },
{ "doc.python.org", true },
{ "doc.to", false },
{ "doc8643.com", true },
{ "docabo.ch", true },
+ { "docassure.de", true },
{ "docbox.ch", true },
{ "doceamoraviverbem.com", true },
{ "docemeldoces.com", true },
@@ -10834,6 +11378,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "docs.python.org", true },
{ "docs.re", true },
{ "docs.tw", true },
+ { "docsoc.org.uk", true },
{ "doctabaila.com", true },
{ "doctafit.com", true },
{ "doctor-locks.co.uk", true },
@@ -10842,13 +11387,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "doctorfox.co.uk", true },
{ "doctorsonmaps.com", true },
{ "doctorwho.cz", true },
+ { "doctorxdentist.com", true },
{ "docubox.info", true },
{ "docucopies.com", true },
{ "docudanang.com.vn", true },
{ "documaniatv.com", true },
{ "docusearch.com", true },
{ "dodds.cc", true },
- { "dodomu.ddns.net", true },
{ "dodopri.com", true },
{ "doenjoylife.com", true },
{ "does.one", true },
@@ -10865,6 +11410,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "doggedbyirs.com", true },
{ "doggroomingcourse.com", true },
{ "dogmap.jp", true },
+ { "dogodki.today", true },
{ "dogoo.com", true },
{ "dogpawstudio.com", true },
{ "dogrescuegreece.nl", true },
@@ -10876,7 +11422,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dokelio-idf.fr", true },
{ "doki.space", true },
{ "dokipy.no", true },
- { "doku-gilde.de", true },
{ "dokuboard.com", true },
{ "dokuraum.de", true },
{ "dolci-delizie.de", true },
@@ -10885,9 +11430,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "doli.se", true },
{ "dolice.net", true },
{ "dolinathome.com", true },
+ { "dollarrp.pl", true },
{ "dollemore.com", true },
{ "dollhousetoyo.com", true },
{ "dolorism.com", true },
+ { "dolphin-cloud.com", true },
+ { "dolphin-hosting.com", true },
{ "dolphin-it.de", true },
{ "dom-medicina.ru", true },
{ "doma.in", true },
@@ -10909,7 +11457,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "domainsilk.com", true },
{ "domainspeicher.one", true },
{ "domainstaff.com", true },
- { "domainwatch.me", true },
{ "domakidis.com", true },
{ "domaxpoker.com", true },
{ "domeconseil.fr", true },
@@ -10921,11 +11468,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "domian.cz", true },
{ "dominationgame.co.uk", true },
{ "dominicself.co.uk", true },
+ { "dominik-bergmann.de", true },
{ "dominik-schlueter.de", true },
{ "dominikaner-vechta.de", true },
{ "dominikkulaga.pl", true },
{ "dominionregistries.domains", true },
- { "dominique-haas.fr", true },
+ { "dominique-haas.fr", false },
{ "dominoknihy.cz", true },
{ "dominomatrix.com", true },
{ "domix.fun", true },
@@ -10961,7 +11509,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "donateaday.net", true },
{ "donateway.com", true },
{ "donboscogroep.nl", true },
+ { "donetsk24.su", true },
{ "donfelino.tk", false },
+ { "dongthucvat.com", true },
{ "dongxuwang.com", true },
{ "donjusto.nl", true },
{ "donkennedyandsons.com", true },
@@ -10985,6 +11535,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "donner-reuschel.de", true },
{ "donnons.org", false },
{ "donnoval.ru", false },
+ { "donotcall.gov", true },
{ "donotlink.it", true },
{ "donovand.info", true },
{ "donovankraag.nl", true },
@@ -11039,7 +11590,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dorsetentertainments.co.uk", true },
{ "dorth.nl", true },
{ "dosdediez.com", true },
- { "dosenbierrepublik.com", true },
{ "dosenkiwi.at", true },
{ "doska.by", true },
{ "doska.ru", true },
@@ -11064,6 +11614,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dotbox.org", true },
{ "dotcircle.co", true },
{ "dotconnor.com", true },
+ { "dotesports.com", true },
{ "dotgov.gov", true },
{ "dothebangthingsalon.com", true },
{ "dothydesign.com", true },
@@ -11111,11 +11662,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "downloads.zdnet.com", true },
{ "downloadsoftwaregratisan.com", true },
{ "downrightcute.com", true },
+ { "downthe.pub", true },
{ "downtimerobot.com", true },
{ "downtimerobot.nl", true },
{ "downtownautospecialists.com", true },
{ "downtownvernon.com", true },
{ "dox-box.eu", true },
+ { "doxal.ro", true },
{ "doyoucheck.com", false },
{ "doyouedc.com", true },
{ "doyoutax.com", true },
@@ -11131,8 +11684,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dpi-design.de", true },
{ "dpisecuretests.com", true },
{ "dpm-ident.de", true },
+ { "dponetwork.nl", true },
{ "dprb.biz", true },
{ "dprd-wonogirikab.go.id", false },
+ { "dps.srl", true },
+ { "dpsg-hohenlinden.de", true },
{ "dpsg-roden.de", true },
{ "dpwsweeps.co.uk", true },
{ "dr-becarelli-philippe.chirurgiens-dentistes.fr", true },
@@ -11145,6 +11701,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dr-marlen-nystroem.de", true },
{ "dr-moldovan.de", true },
{ "dr-nystroem.de", true },
+ { "dr-peter-jahn.de", true },
{ "dr-schlamminger.de", true },
{ "dr-schmutzer.de", true },
{ "dr-schuessler.de", true },
@@ -11158,6 +11715,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "drachenleder.de", true },
{ "dracisvet.cz", true },
{ "dracon.es", true },
+ { "dracoon.cloud", true },
+ { "dracoon.com", true },
+ { "dracoon.de", true },
+ { "dracoon.team", true },
{ "dracox.com", true },
{ "draftguru.com.au", true },
{ "drafton.com", true },
@@ -11173,6 +11734,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dragon-chem.eu", true },
{ "dragon-hearts.co.uk", true },
{ "dragon.nu", true },
+ { "dragoncave.me", true },
{ "dragonclean.gr", true },
{ "dragonfly.co.uk", true },
{ "dragonheartsrpg.com", true },
@@ -11217,8 +11779,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dreamdivers.com", true },
{ "dreamhack.com", true },
{ "dreamhostremixer.com", true },
- { "dreamithost.com.au", true },
- { "dreamkitchenbath.com", true },
{ "dreamlandmagic.com", true },
{ "dreamlinehost.com", false },
{ "dreamlordpress.it", true },
@@ -11231,20 +11791,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dreamonkey.com", true },
{ "dreamrae.net", true },
{ "dreamstream.mobi", true },
- { "dreamstream.network", true },
{ "dreamstream.nl", true },
{ "dreamstream.tv", true },
{ "dreamstream.video", true },
{ "dreemurr.com", true },
{ "drei01.com", true },
{ "drei01.de", true },
+ { "drei01.technology", true },
{ "dreid.org", true },
{ "dreiweiden.de", true },
{ "dresden-kaffee-24.de", true },
{ "dresden-kaffeeroesterei.de", true },
{ "dresdener-mandelstollen.de", true },
{ "dresdens-pfefferkuchenprinzessin.de", true },
- { "dresdner-christstollen-von-reimann.de", true },
{ "dresdner-kaffeeroesterei.de", true },
{ "dresdner-mandelstollen.de", true },
{ "dresdner-stollen.shop", true },
@@ -11263,7 +11822,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "drfranciscofonseca.com.br", true },
{ "drfrey.ch", true },
{ "drgdrp.com", true },
- { "drgn.no", true },
+ { "drgrace.ca", true },
{ "drhathazi.hu", true },
{ "drheibel.com", true },
{ "drhoseyni.com", true },
@@ -11279,10 +11838,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "drinkcontrolapp.com", true },
{ "drinkgas-jihlava.cz", true },
{ "drive.google.com", false },
+ { "driveexport.com", true },
{ "driven2shine.eu", true },
{ "drivenes.net", true },
{ "driver.ru", true },
{ "driver61.com", true },
+ { "drivercopilot.com", true },
{ "driverless.id", true },
{ "driverprofiler.co.uk", true },
{ "driverscollection.com", true },
@@ -11292,14 +11853,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "drixn.cn", true },
{ "drixn.com", true },
{ "drizz.com.br", false },
- { "drjacquesmalan.com", true },
{ "drjenafernandez.com", true },
{ "drjoe.ca", true },
{ "drjuanitacollier.com", false },
{ "drjulianneil.com", true },
{ "drkhsh.at", false },
- { "drkmtrx.xyz", true },
{ "drlandis.com", true },
+ { "drlangsdon.com", true },
{ "drlinkcheck.com", true },
{ "drlutfi.com", true },
{ "drmayakato.com", true },
@@ -11314,9 +11874,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "droidhere.com", true },
{ "droidim.com", false },
{ "droidwave.com", true },
- { "droidwiki.de", true },
{ "drone-it.net", true },
{ "dronebl.org", true },
+ { "droneland.nl", true },
{ "dronepit.dk", true },
{ "droni.cz", true },
{ "dronnet.com", false },
@@ -11335,6 +11895,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "drpetervoigt.ddns.net", true },
{ "drpetervoigt.de", true },
{ "drpico.com.au", true },
+ { "drros.ru", true },
{ "drrr.chat", true },
{ "drrr.wiki", true },
{ "drsajjadian.com", true },
@@ -11372,7 +11933,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dsancomics.com", true },
{ "dsanraffleshangbai.xyz", true },
{ "dsayce.com", true },
+ { "dsble.de", true },
{ "dsbrowser.com", true },
+ { "dsbutler.de", true },
{ "dschwarzachtaler.de", true },
{ "dsdalismerkezi.com", true },
{ "dsebastien.net", true },
@@ -11396,6 +11959,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dstvinstallfourways.co.za", true },
{ "dstvinstallkemptonpark.co.za", true },
{ "dstvinstallrandburg.co.za", true },
+ { "dstvrandburg.co.za", true },
{ "dstvsandton.co.za", true },
{ "dstvsouthafrica.com", true },
{ "dsuinnovation.com", true },
@@ -11415,6 +11979,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dtpak.cz", true },
{ "dtuaarsfest.dk", true },
{ "dtx.sk", true },
+ { "du-alex.ru", true },
{ "dualascent.com", true },
{ "dub.cz", true },
{ "dubai-company.ae", true },
@@ -11425,11 +11990,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dubrovnik-dental.clinic", true },
{ "dubrovskiy.net", true },
{ "dubrovskiy.pro", true },
+ { "dubstep.fr", true },
{ "dubtrack.fm", true },
{ "ducalendars.com", true },
- { "ducius.net", true },
+ { "duch.cloud", true },
{ "duckbase.com", true },
{ "duckblade.com", true },
+ { "duckcorp.org", true },
{ "duckduck.horse", true },
{ "duckduckstart.com", true },
{ "duckeight.win", true },
@@ -11466,7 +12033,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dumbfunded.co.uk", true },
{ "dumbomove.com.au", true },
{ "dumino.bg", true },
- { "dumont.ovh", true },
{ "dumpsters.com", true },
{ "duncancmt.com", true },
{ "duncanfamilytrust.org", true },
@@ -11481,6 +12047,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dunmanelectric.com", true },
{ "duobus.nl", true },
{ "duoluodeyu.com", true },
+ { "duonganhtuan.com", true },
{ "duoquadragintien.fr", true },
{ "dupisces.com.tw", true },
{ "duploclique.pt", false },
@@ -11494,6 +12061,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dureuil.info", true },
{ "durexwinkel.nl", true },
{ "durfteparticiperen.nl", true },
+ { "durgatopos.it", true },
{ "duria.de", true },
{ "duriaux-dentiste.ch", true },
{ "duroterm.ro", true },
@@ -11501,11 +12069,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dusmomente.com", true },
{ "dustplanet.de", true },
{ "dustri.org", true },
+ { "dustycloth.com", true },
{ "dustygroove.com", true },
+ { "dustyro.se", true },
{ "dustyspokesbnb.ca", true },
+ { "dustywilson.com", true },
{ "dutch.desi", true },
{ "dutchdare.nl", true },
- { "dutchessuganda.com", true },
+ { "dutchfoodie.nl", true },
{ "dutchforkrunners.com", true },
{ "dutchrank.nl", true },
{ "dutchwanderers.nl", true },
@@ -11523,7 +12094,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dvwc.org", true },
{ "dvx.cloud", true },
{ "dw-loewe.de", true },
- { "dwbtoftshit.com", true },
{ "dwgf.xyz", true },
{ "dwi-sued.de", true },
{ "dwienzek.de", true },
@@ -11543,11 +12113,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dybuster.es", true },
{ "dybuster.it", true },
{ "dybuster.se", true },
- { "dycoa.com", true },
{ "dyeager.org", true },
{ "dyktig.as", true },
{ "dyktig.no", true },
{ "dylanboudro.com", true },
+ { "dylancl.cf", true },
+ { "dylangattey.com", false },
{ "dylankatz.com", true },
{ "dylanknoll.ca", true },
{ "dylanspcrepairs.com", true },
@@ -11578,23 +12149,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "dynamo.city", true },
{ "dynapptic.com", true },
{ "dynastic.co", true },
- { "dynastyarena.com", true },
{ "dynastybullpen.com", true },
- { "dynastycalculator.com", true },
- { "dynastycentral.com", true },
- { "dynastychalkboard.com", true },
- { "dynastyclubhouse.com", true },
- { "dynastycrate.com", true },
- { "dynastyduel.com", true },
- { "dynastyfan.com", true },
- { "dynastygoal.com", true },
- { "dynastylocker.com", true },
- { "dynastyredline.com", true },
{ "dynastyredzone.com", true },
- { "dyncdn.me", true },
{ "dynn.be", true },
+ { "dynocc.xyz", true },
{ "dynorphin.com", true },
{ "dynorphins.com", true },
+ { "dynts.pro", true },
{ "dynx.pl", true },
{ "dyrenesverden.no", true },
{ "dyrkar.com", true },
@@ -11619,12 +12180,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "e-biografias.net", true },
{ "e-borneoshop.com", true },
{ "e-briancon.com", true },
+ { "e-colle.info", true },
{ "e-cottage.com.br", true },
{ "e-enterprise.gov", false },
{ "e-hon.link", true },
{ "e-id.ee", true },
- { "e-imzo.uz", true },
- { "e-kontakti.fi", true },
{ "e-lambre.com", true },
{ "e-learningbs.com", true },
{ "e-lifetechnology.com", true },
@@ -11632,6 +12192,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "e-speak24.pl", true },
{ "e-standardstore.org", true },
{ "e-surveillant.nl", true },
+ { "e-sushi.net", true },
{ "e-sw.co.jp", true },
{ "e-teacher.pl", true },
{ "e-teachers.me", true },
@@ -11644,7 +12205,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "e-tresor.at", true },
{ "e-tune-mt.net", true },
{ "e-typ.eu", true },
- { "e-verify.gov", false },
+ { "e-verify.gov", true },
+ { "e-webos.com", true },
{ "e-worksmedia.com", true },
{ "e.mail.ru", true },
{ "e11even.nl", false },
@@ -11661,6 +12223,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "e965.ru", true },
{ "e9a.at", true },
{ "ea2drocks.com", true },
+ { "eac.gov", true },
{ "eacero.com", true },
{ "ead-italia.it", true },
{ "eagle.net", true },
@@ -11673,17 +12236,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eagleyecs.com", true },
{ "eaimty.com", true },
{ "ealev.de", true },
- { "eapestudioweb.com", true },
+ { "eallion.com", true },
{ "earl.org.uk", true },
{ "earlydocs.com", true },
{ "earlyyearshub.com", true },
{ "earmarks.gov", true },
{ "earn.com", true },
+ { "earn.wiki", true },
{ "earthsystemprediction.gov", true },
{ "earticleblog.com", true },
{ "earvinkayonga.com", false },
{ "easelforart.com", true },
- { "easew.com", true },
{ "easez.net", true },
{ "eashwar.com", true },
{ "eason-yang.com", true },
@@ -11691,7 +12254,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eastblue.org", true },
{ "easterncapebirding.co.za", true },
{ "eastlothianbouncycastles.co.uk", true },
- { "eastman.space", false },
{ "eastmanbusinessinstitute.com", true },
{ "eastnorschool.co.uk", true },
{ "eastplan.co.kr", true },
@@ -11703,7 +12265,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "easycoding.org", true },
{ "easyconstat.com", true },
{ "easycosmetic.ch", true },
- { "easycup.com", false },
{ "easydumpsterrental.com", true },
{ "easyeigo.com", true },
{ "easyfiles.ch", true },
@@ -11712,6 +12273,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "easyocm.hu", true },
{ "easyoutdoor.nl", true },
{ "easypay.bg", true },
+ { "easypayments.pro", true },
{ "easyproperty.com", true },
{ "easypv.ch", true },
{ "easyqr.codes", true },
@@ -11722,12 +12284,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "easytechguides.com", true },
{ "easytechsecurity.com", true },
{ "easyweenies.com", true },
+ { "eat-sleep-code.com", true },
{ "eatery.co.il", true },
{ "eatmebudapest.hu", true },
{ "eaton-works.com", true },
{ "eatry.io", true },
- { "eats.soy", true },
{ "eatsleeprepeat.net", true },
+ { "eatson.com", true },
{ "eatz-and-treatz.com", true },
{ "eatz.com", true },
{ "eaucube.com", true },
@@ -11753,6 +12316,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ebiografia.com", true },
{ "ebisi.be", true },
{ "ebizarts.com", true },
+ { "eblog.ink", true },
{ "eboek.info", true },
{ "ebonyriddle.com", true },
{ "ebooki.eu.org", true },
@@ -11774,6 +12338,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ecdn.cz", true },
{ "ecfnorte.com.br", true },
{ "ecfunstalls.com", true },
+ { "echarity.ae", true },
{ "echatta.net", true },
{ "echatta.org", true },
{ "echi.pw", true },
@@ -11792,11 +12357,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "echosim.io", true },
{ "echosixmonkey.com", true },
{ "echosystem.fr", true },
- { "echoteam.gq", true },
{ "echoteen.com", true },
{ "echoworld.ch", true },
{ "echternach-immobilien.de", true },
- { "echtes-hutzelbrot.de", true },
{ "echtgeld-casinos.de", true },
{ "ecir.pro", true },
{ "ecir.ru", true },
@@ -11814,7 +12377,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ecobin.nl", true },
{ "ecoccinelles.ch", true },
{ "ecoccinelles.com", true },
- { "ecococon.fr", true },
{ "ecocreativity.org", true },
{ "ecodedi.com", true },
{ "ecodesigns.nl", true },
@@ -11838,6 +12400,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "economics-colleges.com", true },
{ "economiefidu.ch", true },
{ "economies.ch", true },
+ { "econsorzio.com", true },
+ { "econsumer.gov", true },
{ "econverter.cloud", true },
{ "ecorp.cc", true },
{ "ecos-ev.de", true },
@@ -11875,7 +12439,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "edesseglabor.hu", true },
{ "edfinancial.com", true },
{ "edge-cloud.net", false },
- { "edgedynasty.com", true },
{ "edgefantasy.com", true },
{ "edgeservices.co.uk", true },
{ "edgetalk.net", true },
@@ -11901,7 +12464,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "edited.de", true },
{ "edition-bambou.com", true },
{ "edition-sonblom.de", true },
- { "editoraimaculada.com.br", true },
{ "edlinger.at", true },
{ "edlinger.mobi", true },
{ "edlinus.cn", true },
@@ -11923,7 +12485,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "edu6.cloud", true },
{ "eduard-dopler.de", true },
{ "edubras.com.br", true },
+ { "educacionvirtual.com.ar", true },
{ "educatek.es", true },
+ { "educateyourskin.com", true },
{ "educationevolving.org", true },
{ "educationfutures.com", true },
{ "educationmalaysia.co.uk", true },
@@ -11935,7 +12499,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eduroam.no", true },
{ "eduroam.uy", true },
{ "edusanjal.com", true },
- { "edusantorini.com", true },
{ "eduvpn.no", true },
{ "eduxpert.in", true },
{ "edv-bv.de", true },
@@ -11973,7 +12536,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ef.gy", true },
{ "efa-football.com", true },
{ "efaas.nl", true },
- { "efag.com", true },
{ "efcross.com", true },
{ "efeen.nl", true },
{ "eff.org", true },
@@ -12000,20 +12562,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eflorashop.net", true },
{ "eflorashop.us", true },
{ "efmcredentialing.org", true },
+ { "efreet.xyz", true },
{ "eft.boutique", true },
{ "eftelingcraft.net", true },
{ "egablo.black", true },
- { "egamespw.com", true },
{ "egami.ch", true },
{ "eganassociates.com.au", true },
{ "egarden.it", true },
{ "egb.at", false },
- { "egbert.net", true },
{ "egeozcan.com", true },
{ "egg-ortho.ch", true },
{ "eggblast.com", true },
{ "eggert.org", false },
{ "eggplant.today", true },
+ { "egicloud.com", true },
{ "egiftcards.be", true },
{ "egles.eu", true },
{ "eglisedenantes.fr", true },
@@ -12033,6 +12595,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ehazi.hu", true },
{ "ehbssl.com", true },
{ "ehcommerce.com", true },
+ { "ehdud8451.tk", true },
{ "eheliche-disziplin.schule", true },
{ "ehertz.uk", true },
{ "ehipaa.com", true },
@@ -12042,7 +12605,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ehne.de", true },
{ "ehomusicgear.com", true },
{ "ehrenburg.info", true },
- { "ehseller.com", true },
{ "ehub.cz", true },
{ "ehub.hu", true },
{ "ehub.pl", true },
@@ -12050,17 +12612,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eiao.me", true },
{ "eichel.eu", true },
{ "eichler.work", true },
- { "eichornenterprises.com", true },
{ "eickemeyer.nl", true },
{ "eickhof.co", true },
{ "eickhof.us", true },
{ "eickhofcolumbaria.com", true },
{ "eidolons.org", true },
{ "eifel.website", true },
- { "eifelindex.de", true },
{ "eigenpul.se", true },
{ "eigenpulse.com", true },
{ "eighty-aid.com", true },
+ { "eightyfour.ca", true },
{ "eigpropertyauctions.co.uk", true },
{ "eihaikyo.com", true },
{ "eika.as", true },
@@ -12080,7 +12641,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "einsteincapital.ca", true },
{ "eintageinzug.de", true },
{ "eintragsservice24.de", true },
- { "eioperator.com", true },
+ { "eioperator.com", false },
{ "eipione.com", true },
{ "eirastudios.co.uk", false },
{ "eirb.fr", true },
@@ -12097,6 +12658,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ejkwebdesign.nl", true },
{ "ek-networks.de", false },
{ "ekaigotenshoku.com", true },
+ { "ekaplast.com.pl", true },
{ "ekati.ru", true },
{ "ekawaiishop.com", true },
{ "ekb-avia.ru", true },
@@ -12110,8 +12672,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ekonbenefits.com", true },
{ "ekostecki.de", true },
{ "ekostrateg.com", true },
+ { "ekouniejow.pl", true },
{ "ekpyroticfrood.net", true },
{ "ekrana.info", true },
+ { "ekranos.me", true },
{ "eksisozluk.com", true },
{ "ekuatorial.com", true },
{ "ekyu.moe", true },
@@ -12122,6 +12686,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "el-hossari.com", true },
{ "el-news.de", true },
{ "eladgames.com", true },
+ { "eladlak-ingatlan.com", true },
{ "elagplus.com", true },
{ "elainerock.com", true },
{ "elaon.de", true },
@@ -12140,7 +12705,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eldertons.co.uk", true },
{ "eldevo.com", true },
{ "eldinhadzic.com", true },
- { "eldisagjapi.com", true },
{ "eldrid.ge", true },
{ "eldritchfiction.net", true },
{ "electionsbycounty.com", true },
@@ -12177,11 +12741,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "electricfencealberton.co.za", true },
{ "electricfencebenoni.co.za", true },
{ "electricfencingballito.co.za", true },
+ { "electricfencinggillitts.co.za", true },
+ { "electricfencinghillcrest.co.za", true },
+ { "electricfencingkloof.co.za", true },
+ { "electricfencingpinetown.co.za", true },
{ "electricgatemotorgermiston.co.za", true },
+ { "electricgatemotorglenvista.co.za", true },
{ "electricgatemotorrandburg.co.za", true },
{ "electricgatemotorskemptonpark.co.za", true },
{ "electricgatemotorsroodepoort.co.za", true },
{ "electrichiddenhills.com", true },
+ { "electrician-umhlangaridge.co.za", true },
{ "electricianagoura.com", true },
{ "electricianagourahills.com", true },
{ "electriciancalabasas.com", true },
@@ -12191,6 +12761,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "electricianhiddenhills.com", true },
{ "electriciankemptonpark24-7.co.za", true },
{ "electricianlakesherwood.com", true },
+ { "electricianlalucia.co.za", true },
{ "electricianmalibu.com", true },
{ "electricianmoorpark.com", true },
{ "electriciannewburypark.com", true },
@@ -12256,14 +12827,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "elementarywave.com", true },
{ "elements.guide", true },
{ "elementshop.co.uk", true },
- { "elenatranslations.nl", true },
{ "elephants.net", true },
{ "elephpant.cz", true },
{ "elepover.com", true },
- { "elerizoentintado.es", true },
+ { "elerizoentintado.es", false },
{ "eletesstilus.hu", true },
{ "eletor.com", true },
{ "eletor.pl", true },
+ { "eletrochape.com.br", true },
{ "elettricista-roma.it", true },
{ "elettricista-roma.org", true },
{ "eleusis-zur-verschwiegenheit.de", true },
@@ -12282,7 +12853,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "elhamadimi.com", true },
{ "elhorizontal.com", true },
{ "elhossari.com", true },
- { "elia.cloud", true },
{ "elian-art.de", true },
{ "elias-nicolas.com", true },
{ "eliaskordelakos.com", true },
@@ -12303,10 +12873,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "elisabethkostecki.de", true },
{ "elisabethrene.com", true },
{ "elisechristie.com", true },
- { "elite-porno.ru", true },
+ { "elistor6100.xyz", true },
{ "elite12.de", true },
{ "elitebouncingfun.com", true },
{ "elitegameservers.net", true },
+ { "elitel.nl", true },
{ "elitenutritionoficial.com", true },
{ "elixi.re", true },
{ "elixir.bzh", true },
@@ -12325,7 +12896,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ellevit.ch", true },
{ "elliesbouncers.co.uk", true },
{ "elliot.cat", true },
- { "elliquiy.com", true },
{ "elliriehl.at", true },
{ "ellisamusements.co.uk", true },
{ "ellisleisure.co.uk", true },
@@ -12334,8 +12904,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "elnan.do", true },
{ "elnoorandelmohanad.com", true },
{ "elo-forum.org", true },
- { "elodieclerc.ch", true },
- { "elohellp.com", false },
+ { "elodrias.de", true },
{ "elonaspitze.de", true },
{ "elosrah.com", true },
{ "elosuite.com", true },
@@ -12364,8 +12933,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "elvidence.com.au", true },
{ "elviraszabo.com", true },
{ "elvispresley.net", true },
- { "elvisripley.com", true },
- { "elvn.tokyo", true },
+ { "elvn.tokyo", false },
{ "elwave.org", true },
{ "elwix.com", true },
{ "elxsi.de", true },
@@ -12390,7 +12958,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "emanuelemazzotta.com", true },
{ "emarketingmatters.com", true },
{ "emasex.com", true },
- { "emasex.es", true },
{ "embassycargo.eu", true },
{ "emberlife.com", true },
{ "embox.net", true },
@@ -12406,24 +12973,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "emeraldcityswagger.com", true },
{ "emeraldcoastrideshare.com", true },
{ "emeraldonion.org", true },
+ { "emergencyshutoff.com", true },
{ "emergenzalavoro.com", true },
{ "emero.de", true },
{ "emex.ro", true },
{ "emi-air-comprime.com", true },
{ "emi.im", true },
{ "emielraaijmakers.nl", true },
- { "emil-dein-baecker.com", true },
{ "emil-dein-baecker.de", true },
{ "emil-reimann.com", true },
{ "emil.click", true },
+ { "emil.one", true },
{ "emilecourriel.com", true },
{ "emiliendevos.be", true },
{ "emilio.media", true },
{ "emilong.com", true },
- { "emilreimann.de", true },
{ "emils-1910.de", true },
- { "emils-chemnitz.de", true },
- { "emils1910.de", true },
+ { "emilstahl.com", true },
{ "emilstahl.dk", true },
{ "emilvarga.com", true },
{ "emily.moe", true },
@@ -12436,6 +13002,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "emkei.cz", true },
{ "emkrivoy.com", true },
{ "emma.ca", true },
+ { "emma.ly", true },
{ "emmababy420.com", true },
{ "emmagraystore.com", true },
{ "emobilityforum.org", true },
@@ -12468,6 +13035,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "emprunterlivre.ci", true },
{ "empyrean-advisors.com", true },
{ "emresaglam.com", true },
+ { "emtradingacademy.com", true },
{ "emultiagent.pl", true },
{ "emvoice.net", true },
{ "emvoiceapp.com", true },
@@ -12481,11 +13049,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "enalean.com", true },
{ "enamae.net", true },
{ "enbecom.net", true },
+ { "encens.boutique", true },
{ "encfs.win", true },
{ "encircleapp.com", true },
{ "encnet.de", true },
{ "encode.host", true },
+ { "encodecloud.net", true },
{ "encoderx.uk", true },
+ { "encore.io", false },
{ "encouragemarketing.com", true },
{ "encredible.de", false },
{ "encredible.org", false },
@@ -12518,7 +13089,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "energy-in-balance.eu", true },
{ "energy-infra.nl", true },
{ "energy-initiative.com", true },
- { "energy.eu", true },
{ "energyatlas.com", true },
{ "energyaupair.se", true },
{ "energycodes.gov", true },
@@ -12531,16 +13101,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "enfantsdelarue.ch", true },
{ "enfield-kitchens.co.uk", true },
{ "enflow.nl", true },
- { "enfu.se", true },
+ { "enganches.es", true },
{ "engarde.net", true },
{ "engaugetools.com", true },
{ "engelke-optik.de", true },
{ "engelundlicht.ch", true },
{ "engelwerbung.com", true },
+ { "engg.ca", true },
{ "engie-laadpalen.nl", true },
{ "engiedev.net", true },
- { "enginepit.com", true },
{ "enginsight.com", true },
+ { "enginx.net", true },
+ { "engl-server.de", true },
{ "engl-systems.de", true },
{ "englishbulgaria.net", true },
{ "englishcast.com.br", true },
@@ -12574,6 +13146,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "enorekcah.com", true },
{ "enot32.ru", true },
{ "enotecastore.it", true },
+ { "enotefile.com", true },
{ "enpasenerji.com.tr", true },
{ "enquos.com", true },
{ "enrich.email", true },
@@ -12600,32 +13173,36 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "entradaweb.cl", true },
{ "entrainr.com", true },
{ "entrecieletpierres.com", true },
- { "entreprise-toiture-clement.fr", true },
{ "entropia.de", false },
{ "entrusted.io", true },
{ "entryboss.cc", true },
{ "entrypoint.sh", true },
{ "entwickler.land", true },
{ "enuchi.jp", true },
+ { "enuygun.com", true },
{ "envant.co.uk", true },
{ "enveloppenopmaat.nl", true },
{ "envescent.com", true },
{ "enviatufoto.com", true },
{ "enviaya.com.mx", true },
+ { "envide.no", true },
+ { "enviro-umweltservice.de", true },
{ "environmental-colleges.com", true },
- { "environmentkirklees.org", true },
{ "enviroprobasements.com", true },
{ "envirotech.com.au", true },
{ "envoie.moi", true },
{ "envoyez.moi", true },
{ "eocservices.co.uk", true },
{ "eoitek.com", true },
+ { "eola.co", true },
{ "eonhive.com", true },
{ "eoonglobalresources.jp", true },
{ "eopugetsound.org", false },
{ "eosol.de", true },
{ "eosol.net", true },
+ { "eosolutions.co", true },
{ "epa.com.es", true },
+ { "epasar.my", false },
{ "epassafe.com", true },
{ "epay.bg", true },
{ "epdeveloperchallenge.com", true },
@@ -12642,6 +13219,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "epichouse.net", false },
{ "epicinflatables.co.uk", true },
{ "epickitty.co.uk", true },
+ { "epicpages.com", true },
{ "epicsecure.de", true },
{ "epicsoft.de", false },
{ "epicvistas.com", true },
@@ -12650,6 +13228,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "epidauros.be", true },
{ "epigrafes-led-farmakeia.gr", true },
{ "epilis.gr", true },
+ { "epinesdeparadis.com", true },
{ "epiphanyofourlordchurch.com", true },
{ "epiphyte.network", true },
{ "episkevh-plaketas.gr", true },
@@ -12660,7 +13239,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "epizentrum.work", true },
{ "epizentrum.works", true },
{ "epmcentroitalia.it", true },
- { "epo32.ru", true },
{ "epoch.com", true },
{ "epolitiker.com", true },
{ "epos-distributor.co.uk", true },
@@ -12748,11 +13326,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "erisrenee.com", true },
{ "erixschueler.de", true },
{ "erkaelderbarenaaben.dk", true },
+ { "erlebnisarchaeologie-bayern.de", true },
{ "ernest.ly", true },
+ { "ernsteisprung.ch", true },
{ "ero.ink", true },
- { "eromon.net", true },
+ { "eromond.com", true },
{ "eron.info", true },
- { "eroskines.com", true },
{ "erp-band.ru", true },
{ "erp.band", true },
{ "erpax.com", true },
@@ -12782,7 +13361,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "erudikum.cz", true },
{ "ervaarjapan.nl", true },
{ "erverydown.ml", true },
- { "erwanlepape.com", true },
{ "erwin.saarland", true },
{ "erwinpaal.nl", true },
{ "erwinschmaeh.ch", true },
@@ -12800,15 +13378,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "esc.chat", true },
{ "esc.gov", true },
{ "escael.org", true },
+ { "escalesensorielle.com", true },
{ "escapeplaza.de", true },
{ "escapetalk.nl", true },
{ "escargotbistro.com", true },
{ "escavador.com", true },
+ { "esclear.de", true },
{ "escontact.ch", true },
{ "escortmantra.com", true },
{ "escritoriodearte.com", false },
{ "escuelabiblica.com", true },
- { "escxtra.com", true },
{ "escyr.top", true },
{ "esdenera.com", true },
{ "esdiscuss.org", true },
@@ -12817,9 +13396,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "esgen.org", true },
{ "esgr.in", true },
{ "eshigami.com", true },
+ { "eshobe.com", true },
{ "eshop-prices.com", true },
{ "eshspotatoes.com", true },
- { "esibun.net", true },
{ "esigmbh.de", true },
{ "esite.ch", true },
{ "eskdale.net", true },
@@ -12832,10 +13411,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "esono.de", true },
{ "esote.net", true },
{ "esoterikerforum.de", true },
+ { "esovita.de", true },
{ "espace-caen.fr", true },
{ "espace-gestion.fr", true },
{ "espace.network", true },
{ "espacecuisine.ca", true },
+ { "espacelanguetokyo.fr", true },
{ "espacetemps.ch", true },
{ "espacetheosophie.fr", true },
{ "espacio-cultural.com", true },
@@ -12859,7 +13440,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "esquisse.fr", true },
{ "esrhd.com", true },
{ "esrinfo.com", true },
- { "ess-cert.ru", true },
{ "essayace.co.uk", true },
{ "essayads.com", true },
{ "essaybrand.com", true },
@@ -12871,7 +13451,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "essaypro.net", true },
{ "essaytalk.com", true },
{ "essaywriting.biz", true },
- { "essca.fr", true },
{ "essenalablog.de", true },
{ "essenciasparis.com.br", true },
{ "essex.cc", true },
@@ -12885,11 +13464,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "estafallando.mx", true },
{ "estaleiro.org", true },
{ "estate360.co.tz", true },
- { "estateczech-eu.ru", true },
{ "estcequejailaflemme.fr", false },
{ "estcequonmetenprodaujourdhui.info", true },
{ "esteam.se", true },
{ "estedafah.com", true },
+ { "estefan.dyndns.org", true },
+ { "esteladigital.com", true },
{ "esterilizacion-perros.es", true },
{ "esteticanorte.com.br", true },
{ "estetista.net", true },
@@ -12897,10 +13477,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "esthesoleil.jp", true },
{ "estilopack-loja.com.br", true },
{ "estoic.net", true },
+ { "estonia.net", true },
{ "estoniantrade.ee", true },
{ "estonoentraenelexamen.com", true },
{ "estoppels.com", true },
+ { "estraks.com", true },
{ "estudiarparaser.com", true },
+ { "estudiaryaprenderingles.com", true },
{ "estudiserradal.com", true },
{ "estufitas.com", true },
{ "esu.zone", true },
@@ -12918,7 +13501,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "etajerka-spb.ru", true },
{ "etaoinwu.win", true },
{ "etasigmaphi.org", true },
- { "etath.com", true },
{ "etax.com.au", true },
{ "etaxi.tn", true },
{ "etccooperative.org", true },
@@ -12933,6 +13515,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eternal-warriors.de", true },
{ "eternalabyss.int.eu.org", true },
{ "eternalflame.cn", true },
+ { "eternalflame.info", true },
{ "eternit.roma.it", true },
{ "etfacta.com", true },
{ "eth-faucet.net", true },
@@ -12941,10 +13524,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ethack.org", true },
{ "ethaligan.fr", true },
{ "ethan.pm", true },
+ { "ethanchin.com", true },
{ "ethanjones.me", true },
+ { "ethanlew.is", true },
{ "ethercalc.com", true },
{ "ethercalc.org", true },
- { "ethergeist.de", false },
+ { "ethergeist.de", true },
{ "etherium.org", true },
{ "etherpad.nl", true },
{ "ethers.news", true },
@@ -12956,7 +13541,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ethiopian.dating", true },
{ "ethiopiannews247.com", true },
{ "ethitter.com", true },
- { "ethosinfo.com", true },
{ "etienne.cc", true },
{ "etikus-hacker.hu", true },
{ "etiquetaunica.com.br", true },
@@ -12965,6 +13549,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "etre-vivant.fr", true },
{ "etrecosmeticderm.com", true },
{ "etresmant.es", true },
+ { "etrker.com", true },
{ "etrolleybizstore.com", true },
{ "etskinner.com", true },
{ "etskinner.net", true },
@@ -13008,7 +13593,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eurekaarchi.com", true },
{ "eurekaarchitecture.com", true },
{ "eurheilu.com", true },
- { "euro-servers.de", true },
{ "euroalter.com", true },
{ "eurocars2000.es", true },
{ "eurocenterobuda.hu", true },
@@ -13018,10 +13602,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "euroflora.mobi", true },
{ "eurofrank.eu", true },
{ "eurolocarno.es", true },
+ { "europalettenkaufen.de", true },
{ "europapier.at", false },
- { "europapier.hu", true },
{ "europapier.net", true },
- { "europapier.sk", true },
{ "europarts-sd.com", true },
{ "europastudien.de", true },
{ "european-agency.org", true },
@@ -13033,10 +13616,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "europetravelservice.co.uk", true },
{ "europop.com", true },
{ "eurora.de", true },
+ { "eurorecambios24.com", true },
{ "euroscot.de", true },
{ "euroshop.or.at", true },
{ "euroskano.nl", true },
- { "eurotime.ua", true },
{ "eurotramp.com", true },
{ "eurotravelstar.eu", true },
{ "eurousa.us", true },
@@ -13050,11 +13633,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "eva-select.com", true },
{ "eva.cz", true },
{ "evaartinger.de", true },
- { "evafojtova.cz", true },
{ "evailoil.ee", true },
{ "evailoil.eu", true },
{ "evalesc.com", true },
{ "evamachkova.cz", true },
+ { "evamathil.de", true },
{ "evamira.com", true },
{ "evanfiddes.com", true },
{ "evangelicalmagazine.com", true },
@@ -13066,14 +13649,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "evasioncreole.com", true },
{ "evasovova.cz", true },
{ "evavolfova.cz", true },
+ { "eve.ac", true },
{ "eve0s.com", true },
{ "eveadmin.azurewebsites.net", true },
{ "evelienzorgt.nl", true },
{ "evelyndayman.com", true },
{ "evemarketer.com", true },
+ { "evemodx.com", true },
{ "evenementenhoekvanholland.nl", true },
{ "evenstargames.com", true },
{ "event-blick.de", true },
+ { "event-fullyyours.com", true },
{ "event4fun.no", true },
{ "eventaro.com", true },
{ "eventide.space", true },
@@ -13091,10 +13677,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "evergladesrestoration.gov", true },
{ "evergreenmichigan.com", true },
{ "everhome.de", true },
+ { "everify.gov", true },
{ "everitoken.io", true },
{ "everling.lu", true },
{ "everlong.org", true },
{ "evermarkstudios.com", true },
+ { "evernaut.com", true },
{ "everpcpc.com", true },
{ "evertonarentwe.com", true },
{ "everwaking.com", false },
@@ -13108,6 +13696,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "everygayporn.com", false },
{ "everything-everywhere.com", true },
{ "everythingaccess.com", true },
+ { "everythingstech.com", false },
{ "everythinq.com", true },
{ "everytrycounts.gov", false },
{ "everywhere.cloud", true },
@@ -13156,7 +13745,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ewe2.ninja", true },
{ "ewhitehat.com", true },
{ "ewie.name", true },
- { "ewizmo.com", true },
{ "ewok.io", true },
{ "ewout.io", true },
{ "ewsfeed.com", true },
@@ -13166,6 +13754,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ex-deli.jp", true },
{ "exactlyinfinite.com", true },
{ "exactphilosophy.net", true },
+ { "exadime.net", true },
{ "exagoni.com.au", true },
{ "exagoni.com.my", true },
{ "examedge.com", true },
@@ -13175,6 +13764,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "exaplac.com", true },
{ "exarpy.com", true },
{ "exatmiseis.net", false },
+ { "excaliburtitle.com", true },
{ "exceed.global", true },
{ "exceedagency.com", true },
{ "excel-utbildning.nu", true },
@@ -13183,9 +13773,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "excella.me", true },
{ "exceltechdubai.com", true },
{ "exceltechoman.com", true },
- { "exceltobarcode.com", true },
{ "excentos.com", true },
{ "exceptionalservers.com", true },
+ { "excess-baggage.com", true },
{ "excessamerica.com", true },
{ "excesssecurity.com", true },
{ "exchaser.com", true },
@@ -13202,7 +13792,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "exerforge.net", true },
{ "exeria.de", true },
{ "exexcarriers.com", true },
- { "exgaywatch.com", true },
{ "exgen.io", true },
{ "exhalespa.com", true },
{ "exhibityour.com", true },
@@ -13211,13 +13800,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "exitooutdoor.com", true },
{ "exmart.ng", true },
{ "exmoe.com", true },
+ { "exnovin.co", true },
{ "exocen.com", true },
{ "exon.io", true },
{ "exordiumconcepts.com", true },
{ "exoscale.ch", true },
{ "exoscale.com", true },
{ "exoten-spezialist.de", true },
- { "exoticads.com", true },
{ "exousiakaidunamis.pw", true },
{ "exp.de", true },
{ "expancio.com", false },
@@ -13236,8 +13825,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "expertsverts.com", true },
{ "expertvagabond.com", true },
{ "expertviolinteacher.com", true },
+ { "expii.com", true },
{ "expiscor.solutions", true },
{ "explodie.org", true },
+ { "explodingcamera.com", true },
{ "exploit-db.com", true },
{ "exploit.cz", true },
{ "exploit.party", true },
@@ -13245,14 +13836,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "exploited.cz", true },
{ "exploitit.com.au", true },
{ "exploodo.rocks", true },
- { "exploravacations.in", true },
+ { "explorebigideas.com", true },
{ "exploremonero.com", true },
{ "exploringenderby.com", true },
+ { "expmind.co.in", true },
{ "expo-america.ru", true },
{ "expo-asia.ru", true },
{ "expo-europe.ru", true },
{ "expo-larionov.org", true },
- { "exponentialnews.net", true },
{ "expoort.co.uk", true },
{ "expoort.com", true },
{ "expoort.es", true },
@@ -13260,8 +13851,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "expoort.it", true },
{ "expopodium.com", true },
{ "exporta.cz", true },
+ { "exposurecompensation.co.uk", true },
{ "express-shina.ru", true },
{ "express-vpn.com", true },
+ { "express1040.com", true },
+ { "expressemotion.net", true },
{ "expresshosting.org", true },
{ "expressmarket.ru", true },
{ "expresstinte.de", true },
@@ -13272,7 +13866,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "exside.com", true },
{ "exsora.com", true },
{ "extasic.com", true },
- { "extendwings.com", true },
{ "extensia.it", true },
{ "extensibility.biz.tr", true },
{ "extensiblewebmanifesto.org", true },
@@ -13297,23 +13890,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "exteriorlightingwestlakevillage.com", true },
{ "extintormadrid.com", true },
{ "extradesktops.com", false },
+ { "extradiely.sk", true },
{ "extradivers-worldwide.com", true },
{ "extranetpuc.com.br", true },
{ "extrapagetab.com", true },
{ "extreemhost.nl", true },
{ "extreme-gaming.de", true },
{ "extreme-gaming.us", true },
+ { "extreme-players.com", true },
{ "extreme-players.de", true },
{ "extreme.co.th", true },
{ "exultcosmetics.co.uk", true },
{ "exxo.tk", true },
{ "exyplis.com", true },
+ { "eyasc.nl", true },
{ "eydesignguidelines.com", true },
{ "eye-encounters.com", true },
{ "eyeandfire.com", true },
{ "eyecandy.gr", true },
{ "eyeglasses.com", false },
+ { "eyejobs.com.au", true },
{ "eyelashconcept.com", true },
+ { "eyemagic.net", true },
{ "eyeonid.com", true },
{ "eyep.me", true },
{ "eyes-berg.ch", true },
@@ -13328,6 +13926,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ez3d.eu", true },
{ "ezakazivanje.rs", true },
{ "ezdog.press", true },
+ { "ezequiel-garzon.net", true },
{ "ezesec.com", true },
{ "ezgif.com", true },
{ "ezhik-din.ru", true },
@@ -13378,6 +13977,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fabienne-roux.org", true },
{ "fabiobier.com", true },
{ "fabjansisters.eu", true },
+ { "fabled.com", true },
{ "fableforge.nl", true },
{ "fabmart.com", true },
{ "fabrica360.com", true },
@@ -13386,13 +13986,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fabriziorocca.it", true },
{ "fabrysociety.org", true },
{ "fabse.net", true },
+ { "facai666.cc", true },
+ { "facai888.cc", true },
{ "facanabota.com", true },
{ "facanabota.com.br", true },
+ { "facarospauls.com", true },
{ "faccess.it", true },
{ "facciadastile.it", true },
+ { "face-fashion.de", true },
{ "face-mania.com", true },
{ "facealacrise.fr", true },
- { "facebattle.com", true },
{ "facebook-atom.appspot.com", true },
{ "facebook.com", true },
{ "facebydrh.com", true },
@@ -13402,6 +14005,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "facerepo.com", true },
{ "faceresources.org", true },
{ "fach-journalist.de", true },
+ { "fachmann-umzuege.de", true },
{ "fachschaftslisten.at", true },
{ "fachschaftslisten.org", true },
{ "facialexercising.com", true },
@@ -13410,6 +14014,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "facilities.fr", true },
{ "facilitiessurvey.org", true },
{ "facility-service-muenchen.de", true },
+ { "facingbipolar.com", true },
{ "fackovcova.cz", true },
{ "fackovcova.eu", true },
{ "fackovcova.sk", true },
@@ -13465,6 +14070,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "faithwatch.org", true },
{ "faixaazul.com", true },
{ "fakeapple.nl", true },
+ { "fakeduckpond.com", true },
+ { "fakeemergency.com", true },
{ "fakerli.com", true },
{ "fakti.bg", true },
{ "faktotum.tech", true },
@@ -13510,6 +14117,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "familie-remke.de", true },
{ "familieholme.de", true },
{ "familiekiekjes.nl", true },
+ { "familienportal.de", true },
+ { "familiereimann.com", true },
{ "familjenfrodlund.se", true },
{ "familjenm.se", true },
{ "familylawhotline.org", true },
@@ -13517,6 +14126,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "familyreal.ru", true },
{ "familytreehq.com", true },
{ "familyworld.gr", true },
+ { "famion.eu", true },
{ "famososnaweb.com", true },
{ "famousbirthdays.com", true },
{ "famoushostels.com", true },
@@ -13527,9 +14137,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fanatical.com", true },
{ "fanatik.io", true },
{ "fanboi.ch", true },
+ { "fancy-bridge.com", true },
{ "fancy.org.uk", true },
{ "fancygaming.dk", true },
- { "fander.it", true },
{ "fandler.cz", true },
{ "fandomservices.com", true },
{ "fanfareunion.ch", true },
@@ -13546,14 +14156,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fantasticservicesgroup.com.au", true },
{ "fantasy-judo.com", true },
{ "fantasycastles.co.uk", true },
- { "fantasycdn.com", true },
- { "fantasydrop.com", true },
{ "fantasyescortsbirmingham.co.uk", true },
{ "fantasymina.de", true },
{ "fantasypartyhire.com.au", true },
{ "fantasyspectrum.com", true },
+ { "fantasysportsnews.org", true },
{ "fantopia.club", true },
- { "fanvoice.com", true },
+ { "fantraxhq.com", true },
{ "fanyina.cn", true },
{ "fanyina.com", true },
{ "fanyue123.tk", true },
@@ -13564,6 +14173,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fara.gov", true },
{ "faradji.nu", true },
{ "faradome.ws", true },
+ { "faradrive.ir", true },
{ "faraslot8.com", true },
{ "farcecrew.de", true },
{ "farces.com", false },
@@ -13573,7 +14183,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "farhadexchange.com", true },
{ "farhood.org", true },
{ "farid.is", true },
+ { "farizizhan.com", true },
+ { "farleybrass.com.au", true },
+ { "farleymetals.com.au", true },
{ "farmacia-discreto.com", true },
+ { "farmaciacorvi.it", true },
{ "farmaciadejaime.es", true },
{ "farmacialaboratorio.it", true },
{ "farmer.dating", true },
@@ -13585,10 +14199,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "farrel-f.cf", true },
{ "farrel-f.tk", true },
{ "farrelf.blog", true },
+ { "farsil.eu", true },
{ "fart.wtf", true },
{ "farthing.xyz", true },
{ "farwat.ru", true },
{ "faschingmd.com", true },
+ { "fascia.fit", true },
{ "fashion-stoff.de", true },
{ "fashion24.de", true },
{ "fashionhijabers.com", true },
@@ -13624,6 +14240,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fastest-hosting.co.uk", true },
{ "fastforwardsociety.nl", true },
{ "fastforwardthemes.com", true },
+ { "fastinviter.com", true },
{ "fastlike.co", true },
{ "fastmail.com", false },
{ "fastonline.ro", true },
@@ -13645,11 +14262,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fatowltees.com", true },
{ "faucetbox.com", false },
{ "faui2k17.de", false },
+ { "faultlines.org", true },
{ "faulty.equipment", true },
{ "fauvettes.be", true },
{ "favirei.com", true },
{ "fawong.com", true },
{ "faxvorlagen-druckvorlagen.de", true },
+ { "fb-feed.net", true },
{ "fb.me", true },
{ "fbcdn.net", true },
{ "fbcopy.com", true },
@@ -13658,9 +14277,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fbiic.gov", true },
{ "fbijobs.gov", true },
{ "fbo.gov", true },
+ { "fbrief.org", true },
{ "fbsbx.com", true },
{ "fbtholdings.com", true },
{ "fburl.com", true },
+ { "fbwgynplus.com", true },
+ { "fbwgynplus.com.au", true },
{ "fc.media", true },
{ "fca-tools.com", true },
{ "fcburk.de", true },
@@ -13702,6 +14324,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "federalreserveconsumerhelp.gov", true },
{ "federatedbank.com", true },
{ "federicomigliavacca.it", true },
+ { "federicoparty.it", true },
{ "fedjobs.gov", true },
{ "fedorahosted.org", true },
{ "fedoramagazine.org", true },
@@ -13714,6 +14337,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fedux.com.ar", true },
{ "fedvan.com", true },
{ "feedbin.com", false },
+ { "feedermarket.net", true },
{ "feedfall.com", true },
{ "feedhq.org", true },
{ "feedkovacs.hu", true },
@@ -13737,7 +14361,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fegame.nl", true },
{ "fegli.gov", true },
{ "fehngarten.de", true },
- { "fehnladen.de", true },
{ "feigling.net", false },
{ "feildel.fr", true },
{ "feilen.de", true },
@@ -13745,6 +14368,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "feisim.com", true },
{ "feisim.org", true },
{ "feistyduck.com", true },
+ { "feixiang.eu.org", true },
+ { "fejes.house", true },
{ "feld.design", true },
{ "feld.saarland", true },
{ "feldhousen.com", true },
@@ -13754,6 +14379,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "felicifia.org", true },
{ "felinepc.com", true },
{ "felistirnavia.sk", true },
+ { "felix-hirner.de", true },
{ "felixaufreisen.de", true },
{ "felixbarta.de", true },
{ "felixcrux.com", true },
@@ -13768,13 +14394,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "femastudios.com", true },
{ "femiluna.com", true },
{ "feminina.pt", true },
- { "feminism.lgbt", true },
- { "femradio.es", true },
{ "femtomind.com", true },
{ "fence-stlouis.com", true },
{ "feng-hhcm.com", true },
{ "feng.si", true },
{ "fengyi.tel", true },
+ { "fenichelar.com", true },
{ "fenster-bank.at", true },
{ "fenster-bank.de", true },
{ "feragon.net", true },
@@ -13796,6 +14421,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fernandobarata.pt", true },
{ "fernandobarillas.com", true },
{ "fernandomiguel.net", true },
+ { "feross.net", true },
{ "feross.org", true },
{ "ferrariadvisor.it", true },
{ "ferret.zone", true },
@@ -13807,9 +14433,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ferticare.pt", true },
{ "fertila.de", true },
{ "festaprylar.se", true },
+ { "festicle.com", true },
{ "festival-tipps.com", true },
{ "festivaljapon.com", true },
- { "festx.co.za", true },
+ { "fetch.co.uk", true },
+ { "fetchease.com", true },
{ "fettlaus.de", true },
{ "feudalisten.de", true },
{ "feuerhuhn.de", true },
@@ -13820,10 +14448,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "feuerwehr-heiligenberg.de", true },
{ "feuerwehr-illmensee.de", true },
{ "feuerwehr-mehring.de", true },
- { "feuerwehr-oberkotzau.de", true },
{ "feuerwehr-offenbach-bieber.de", false },
{ "feuerwehr-vechta.de", true },
- { "feuerwehrbadwurzach.de", true },
{ "feuerwerksmanufaktur.de", true },
{ "feuetgloire.com", true },
{ "fewo-hafeninsel-stralsund.de", true },
@@ -13909,9 +14535,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fil-tec-rixen.com", true },
{ "fil.fi", true },
{ "filanthropystar.org", true },
+ { "filaretihairlove.gr", true },
{ "file-cloud.eu", true },
{ "file-pdf.it", true },
{ "filecopa.com", true },
+ { "filehash.de", true },
{ "files.from-me.org", true },
{ "fileservicios.com.ar", true },
{ "filestar.io", true },
@@ -13921,20 +14549,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "filezilla.cn", true },
{ "filhin.es", true },
{ "filhodohomem.com", true },
- { "fili.org", true },
+ { "fili.com", true },
{ "filidorwiese.nl", true },
{ "filiio.com", true },
{ "filingsmadeeasy.com", true },
- { "filiosoft.cloud", true },
{ "filip-prochazka.com", false },
{ "filippo.io", true },
{ "filipsebesta.com", true },
{ "filleritemsindia.com", true },
{ "fillo.sk", true },
{ "film-colleges.com", true },
+ { "film-op-tv.nl", true },
{ "film-storyboards.fr", true },
{ "film-tutorial.com", true },
- { "filmatiporno.xxx", true },
{ "filme-onlines.com", true },
{ "filmers.net", true },
{ "filmesonline.online", true },
@@ -13951,7 +14578,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fimsquad.com", true },
{ "finagosolo.com", true },
{ "final-expense-quotes.com", true },
- { "finalprice.net", true },
{ "finalrewind.org", true },
{ "finalx.nl", true },
{ "finance-colleges.com", true },
@@ -13967,8 +14593,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "find-mba.com", true },
{ "findapinball.com", true },
{ "findcarspecs.com", true },
+ { "findelahistoria.com", true },
{ "findhoustonseniorcare.com", true },
{ "findingkorea.com", true },
+ { "findingtheuniverse.com", true },
{ "finditez.com", true },
{ "findmynudes.com", true },
{ "findoon.de", true },
@@ -13982,6 +14610,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "finecocoin.io", false },
{ "finecraft.cc", true },
{ "finefriends.nl", true },
+ { "finefriends.social", true },
+ { "finefriendsapp.com", true },
{ "finelovedolls.com", true },
{ "finenet.com.tw", true },
{ "finesoon.net", true },
@@ -13993,13 +14623,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "finisron.in", true },
{ "finkelstein.fr", true },
{ "finkmartin.com", true },
+ { "finlandcook.online", true },
+ { "finlandcook.top", true },
{ "finn.io", true },
{ "finnclass.cz", true },
{ "finnwea.com", true },
{ "finpt.com", false },
{ "finsprings.org", true },
{ "fintandunleavy.com", false },
- { "fintechnics.com", false },
{ "fintry.ca", true },
{ "finvantage.com", true },
{ "finwe.info", true },
@@ -14020,6 +14651,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "firecore.com", true },
{ "firecry.org", true },
{ "firefart.at", true },
+ { "firefense.com", true },
{ "firefighters.dating", true },
{ "firefly-iii.org", true },
{ "firegoby.jp", true },
@@ -14044,7 +14676,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "firmapi.com", true },
{ "firmen-assekuranz.de", true },
{ "firmenwerbung-vermarktung.de", true },
- { "firmware.science", true },
{ "first-house.no", true },
{ "first.org", true },
{ "first4it.com", true },
@@ -14073,6 +14704,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fishermansbendtownhouses.com.au", true },
{ "fishexport.eu", true },
{ "fishgen.no", true },
+ { "fishlanestudios.com", true },
+ { "fishoilsafety.com", true },
{ "fishserver.net", true },
{ "fishtacos.blog", true },
{ "fisinfomanagerdr.com", true },
@@ -14082,7 +14715,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fit-4u.ch", true },
{ "fit-mit-nina.com", true },
{ "fit-mit-system.eu", true },
- { "fit365.jp", true },
+ { "fit365.jp", false },
{ "fitchannel.com", true },
{ "fitinclass.com", true },
{ "fitkram.cz", true },
@@ -14094,8 +14727,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fitzsim.org", true },
{ "fiuxy.bz", true },
{ "fiuxy.co", true },
- { "fiuxy.org", true },
+ { "fiuxy.me", true },
{ "fivethirtyeight.com", true },
+ { "fiveyearsahead.com", true },
{ "fixatom.com", true },
{ "fixed.supply", true },
{ "fixel.express", true },
@@ -14118,6 +14752,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fjzone.org", true },
{ "fkcdn.de", true },
{ "fkfev.de", true },
+ { "fkosquad.moe", true },
{ "fktpm.ru", true },
{ "flaemig42.de", false },
{ "flagburningworld.com", true },
@@ -14135,6 +14770,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "flangaapis.com", true },
{ "flapoverspeed.com", true },
{ "flare.cloud", true },
+ { "flasaki.gr", true },
{ "flashback.org", true },
{ "flashbeing.com", true },
{ "flashcomp.cz", true },
@@ -14168,12 +14804,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fleisch.club", true },
{ "flers-agglo.fr", true },
{ "flerstourisme.fr", true },
+ { "fletcherdigital.com", true },
{ "fletchto99.com", true },
{ "fletemaritimo.online", true },
{ "flets-ms.com", true },
{ "fleurenplume.fr", true },
{ "fleuryfleury.com", true },
{ "flexapplications.se", true },
+ { "flexbuildingsystems.com", true },
{ "flexfunding.com", true },
{ "fleximaal.com", true },
{ "fleximal.com", true },
@@ -14182,6 +14820,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "flexstart.me", true },
{ "flextrack.dk", true },
{ "fliacuello.com.ar", true },
+ { "flibusta.appspot.com", true },
{ "flickcritter.com", true },
{ "flieger-funk-runde.de", true },
{ "fliesen-waldschmidt.de", true },
@@ -14199,7 +14838,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fliio.com", true },
{ "flinch.io", true },
{ "flip.kim", true },
- { "flipbell.com", true },
{ "flipneus.net", true },
{ "fliptable.org", true },
{ "flirt-norden.de", true },
@@ -14257,9 +14895,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "flowair24.ru", true },
{ "flowcom.de", true },
{ "flowersbylegacy.com", true },
+ { "flowersquito.com", true },
{ "flowinvoice.com", true },
{ "flowreader.com", true },
{ "flra.gov", true },
+ { "flucky.xyz", true },
{ "fluffycloud.de", true },
{ "fluggesellschaft.de", true },
{ "fluhrers.de", true },
@@ -14271,7 +14911,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "flurp.de", false },
{ "flushlife.com", true },
{ "fluteandpianoteaching.co.uk", true },
- { "flux.by", true },
{ "flux.healthcare", true },
{ "fluxent.de", false },
{ "fluxfingers.net", true },
@@ -14281,7 +14920,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "flw365365.com", true },
{ "fly-en-drive.nl", true },
{ "fly.moe", true },
- { "flyawayantennas.com", true },
{ "flyboyfpv.com", true },
{ "flydrivesicilie.nl", true },
{ "flyer.tools", true },
@@ -14294,7 +14932,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "flyp.me", true },
{ "flypenge.dk", true },
{ "flyserver.co.il", true },
- { "flyshe.co.uk", true },
{ "flyswoop.com", true },
{ "flyt.online", true },
{ "flytoadventures.com", true },
@@ -14307,7 +14944,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fmodoux.biz", true },
{ "fmussatmd.com", true },
{ "fnanen.net", true },
- { "fnb-griffinonline.com", true },
{ "fnbnokomis.com", true },
{ "fnh-expert.net", true },
{ "fnkr.net", true },
@@ -14345,6 +14981,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "followerrocket.com", true },
{ "followersya.com", true },
{ "followings-live.com", true },
+ { "followmystaff.com", true },
{ "followthatpage.com", true },
{ "followthedog.co.uk", true },
{ "foluomeng.net", true },
@@ -14356,6 +14993,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fondy.eu", true },
{ "fondy.ua", true },
{ "fonga.ch", true },
+ { "fono.jp", true },
{ "fonolo.com", true },
{ "fonseguin.ca", true },
{ "font-converter.net", true },
@@ -14363,6 +15001,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fontein.de", true },
{ "fontlibrary.org", true },
{ "fonts4free.net", true },
+ { "fonzone.it", true },
{ "foo.fo", true },
{ "foo.hamburg", true },
{ "foodattitude.ch", true },
@@ -14385,6 +15024,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "footloose.co.uk", true },
{ "for.care", true },
{ "foray-jero.me", true },
+ { "forbidden-mods.de", true },
{ "forbusiness.ca", true },
{ "forcelink.eu", true },
{ "forcelinkamerica.com", true },
@@ -14392,7 +15032,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "forces.army", true },
{ "forcewave.com", true },
{ "ford-shop.by", true },
+ { "ford.com.au", true },
+ { "ford.com.br", true },
+ { "ford.com.cn", true },
+ { "ford.mx", true },
{ "fordlibrarymuseum.gov", true },
+ { "fordsync.com", true },
{ "foreachcode.com", true },
{ "forecastcity.com", true },
{ "foreclosureattorneyhouston.com", true },
@@ -14404,6 +15049,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "foresdon.jp", true },
{ "foresthillhomes.ca", true },
{ "forestraven.net", true },
+ { "foreverclean.com", true },
{ "foreverssl.com", true },
{ "foreversummertime.com", true },
{ "forewordreviews.com", true },
@@ -14411,7 +15057,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "forexchef.de", true },
{ "forexee.com", true },
{ "forextickler.com", true },
- { "forextimes.ru", false },
+ { "forextimes.ru", true },
{ "forfunssake.co.uk", true },
{ "forge-goerger.eu", true },
{ "forgotten-legends.org", true },
@@ -14424,6 +15070,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "formation-mac.ch", true },
{ "formationseeker.com", true },
{ "formbetter.com", true },
+ { "formersessalaries.com", true },
+ { "formforger.com", true },
{ "formini.dz", true },
{ "formsbyair.com", true },
{ "formula-ot.ru", true },
@@ -14441,14 +15089,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "forro.info", true },
{ "forsakringsarkivet.se", true },
{ "forsec.nl", true },
+ { "forself.me", true },
{ "forstbetrieb-hennecke.de", true },
{ "forstprodukte.de", true },
- { "fort.eu", true },
{ "forteggz.nl", true },
{ "fortesanshop.it", true },
{ "fortknox.cz", true },
{ "fortnine.ca", true },
- { "fortnitemagic.ga", true },
{ "fortran.io", true },
{ "fortress.no", true },
{ "fortress.sk", true },
@@ -14471,6 +15118,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fosdem.org", true },
{ "fossforward.com", true },
{ "fossilfreeyale.org", true },
+ { "fosterpark.ca", true },
{ "fotella.com", true },
{ "fotikpro.ru", true },
{ "foto-janvanaefst.nl", true },
@@ -14491,7 +15139,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fotoleitner.com", true },
{ "fotoleitner.de", true },
{ "fotonjan.com", true },
- { "fotostravestisbr.com", true },
{ "fotostudio-leitner.com", true },
{ "fotostudio-leitner.de", true },
{ "fotostudio-schweiz.ch", true },
@@ -14507,20 +15154,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fourashesgolfcentre.co.uk", true },
{ "fourashesgolfcentre.com", true },
{ "fourashesgolfcentre.uk", true },
- { "fourdesignstudio.com", true },
+ { "fourdesignstudio.com", false },
+ { "fournarisopenday.com", true },
{ "foutrelis.com", true },
{ "fowlervwparts.com", true },
{ "fowlsmurf.net", true },
{ "fox.my", false },
{ "foxbnc.co.uk", true },
- { "foxdev.co", true },
+ { "foxdev.co", false },
{ "foxesare.sexy", true },
{ "foxing.club", true },
{ "foxo.blue", true },
{ "foxontheinter.net", true },
{ "foxphotography.ch", true },
{ "foxquill.com", true },
- { "foxstreetcomms.co.za", true },
+ { "foxstreetcomms.co.za", false },
+ { "fozzie.space", true },
{ "fpaci.org", true },
{ "fpasca.com", true },
{ "fpc.gov", false },
@@ -14532,8 +15181,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fpvr.org", true },
{ "fpy.cz", true },
{ "fr.search.yahoo.com", false },
- { "fr33tux.org", true },
- { "frack.nl", true },
+ { "frack.nl", false },
{ "fracreazioni.it", true },
{ "fraesentest.de", true },
{ "fragmentspuren.de", true },
@@ -14547,10 +15195,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fran.cr", true },
{ "francescopalazzo.com", true },
{ "francescopandolfibalbi.it", true },
- { "francescoservida.ch", true },
{ "francetraceur.fr", true },
{ "franchini.email", true },
{ "franchini.engineer", true },
+ { "francinebelanger.network", true },
{ "francis.tokyo", true },
{ "francisli.net", false },
{ "franckgirard.net", true },
@@ -14559,7 +15207,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "francois-occasions.be", true },
{ "francoisbelangerboisclair.com", true },
{ "francoiscarrier.com", true },
- { "francoise-paviot.com", true },
{ "francoisharvey.ca", true },
{ "francoislepage.com", true },
{ "francoz.me", true },
@@ -14570,7 +15217,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "franken-lehrmittel.de", true },
{ "frankenhost.de", true },
{ "frankenlehrmittel.de", true },
- { "frankhaala.com", true },
{ "frankierfachmann.de", true },
{ "frankierprofi.de", true },
{ "frankierstar.de", true },
@@ -14589,7 +15235,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "franz.beer", true },
{ "franziska-pascal.de", true },
{ "franzknoll.de", true },
+ { "franzt.de", false },
{ "frappant.cc", true },
+ { "frasch-umzuege.de", true },
{ "fraselab.ru", true },
{ "frasesconemocion.com", true },
{ "frasesdodia.com", true },
@@ -14598,6 +15246,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "frasys.net", true },
{ "frattaroli.org", true },
{ "frau-inge.de", true },
+ { "frau-pusteblu.me", true },
{ "frau-sucht-bauer.de", true },
{ "fraudmarc.com", true },
{ "frauenarzt-niendorf.de", true },
@@ -14606,6 +15255,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fraurichter.net", true },
{ "fraye.net", true },
{ "frbracch.it", true },
+ { "frc.gov", true },
{ "frccsgo.tk", true },
{ "frdl.ch", true },
{ "freaksites.dk", true },
@@ -14633,11 +15283,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "frederikvig.com", true },
{ "fredloya.com", true },
{ "fredriksslaktforskning.se", true },
- { "fredtec.ru", true },
{ "fredvoyage.fr", true },
{ "free-ss.site", true },
{ "free.ac.cn", true },
{ "free.com.tw", true },
+ { "freeassangenow.org", true },
{ "freeasyshop.com", true },
{ "freebarrettbrown.org", true },
{ "freebcard.com", true },
@@ -14645,10 +15295,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freebookmakersbetsandbonuses.com.au", true },
{ "freeboson.org", true },
{ "freebus.org", true },
+ { "freecam2cam.site", true },
{ "freecloud.at", true },
{ "freecookies.nl", true },
- { "freecycleusa.com", true },
{ "freedev.cz", true },
+ { "freedgb.com", true },
{ "freedom.nl", true },
{ "freedom.press", true },
{ "freedom35.org", true },
@@ -14675,6 +15326,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freelanceessaywriters.com", true },
{ "freelancehunt.com", true },
{ "freelancejobs.org.uk", true },
+ { "freelanceunited.co.uk", true },
{ "freelauri.com", true },
{ "freelifer.jp", true },
{ "freelo.cz", true },
@@ -14683,7 +15335,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freemania.nl", true },
{ "freemanlogistics.com", true },
{ "freemans.com", true },
- { "freemomhugs.org", true },
+ { "freeministryresources.org", true },
{ "freemyipod.org", true },
{ "freend.me", false },
{ "freenetproject.org", true },
@@ -14691,6 +15343,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freepnglogos.com", true },
{ "freepublicprofile.com", true },
{ "freergform.org", true },
+ { "freertomorrow.com", true },
{ "freeshell.de", true },
{ "freeshkre.li", true },
{ "freesitemapgenerator.com", true },
@@ -14703,6 +15356,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freesquare.net", true },
{ "freessl.tech", true },
{ "freesslcertificate.me", true },
+ { "freetaxusa.com", true },
{ "freethetv.ie", true },
{ "freetsa.org", true },
{ "freeweibo.com", true },
@@ -14722,11 +15376,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freifunk-remscheid.de", true },
{ "freimeldungen.de", true },
{ "freims.cc", true },
+ { "freitasul.com.br", true },
+ { "freitasul.io", true },
{ "freiwurst.net", true },
{ "freizeitbad-riff.de", true },
{ "freizeitplaza.de", true },
{ "frejasdal.dk", true },
{ "frenchcreekcog.org", true },
+ { "frenchguy.ch", true },
{ "frenchmusic.fr", true },
{ "frequencebanane.ch", true },
{ "frequentflyerapp.com", true },
@@ -14738,6 +15395,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "freshempire.gov", true },
{ "freshislandfish.com", true },
{ "freshlymind.com", true },
+ { "freshmaza.com", true },
{ "freshmaza.net", true },
{ "freshpounds.com", true },
{ "fretscha.com", true },
@@ -14756,6 +15414,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "friederloch.de", true },
{ "friedrich-foto-art.de", true },
{ "friedsamphotography.com", true },
+ { "friedzombie.com", true },
{ "friendlysiberia.com", true },
{ "friendowment.us", true },
{ "friends-of-naz.com", true },
@@ -14774,6 +15433,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fringeintravel.com", true },
{ "frinkiac.com", true },
{ "frino.de", true },
+ { "friplay.host", true },
{ "frippz.se", true },
{ "friss.com", true },
{ "fritzrepair.com", true },
@@ -14792,9 +15452,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fromscratch.rocks", true },
{ "fronteers.nl", false },
{ "frontier-ad.co.jp", true },
- { "frontier.bet", true },
- { "frontierdiscount.com", true },
{ "frontiers.nl", true },
+ { "frontline.cloud", true },
{ "frontlinemessenger.com", true },
{ "fropky.com", true },
{ "frostprotection.co.uk", true },
@@ -14807,9 +15466,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "frozen-solid.net", true },
{ "frozenjam.com", true },
{ "frpg.gov", true },
- { "frprn.com", true },
{ "frprn.es", true },
- { "frprn.xxx", true },
+ { "frsnpwr.net", true },
{ "frtn.com", true },
{ "frtr.gov", true },
{ "frtrains.com", true },
@@ -14821,6 +15479,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "frugro.be", true },
{ "fruition.co.jp", true },
{ "fruitscale.com", true },
+ { "fruityfitness.com", true },
+ { "fruityten.co.uk", true },
{ "frusky.de", true },
{ "fruttini.de", true },
{ "frydrychit.cz", true },
@@ -14832,13 +15492,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fsbnh.bank", true },
{ "fsbpaintrock.com", true },
{ "fsbturton.com", true },
- { "fsck.cz", true },
{ "fsck.jp", true },
{ "fsckd.com", true },
{ "fscott.de", true },
{ "fsdress.com", true },
{ "fsfxpackages.com", true },
{ "fsg.one", true },
+ { "fsgeek.ca", true },
{ "fsk.fo", true },
{ "fsky.info", true },
{ "fsm2016.org", true },
@@ -14848,13 +15508,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fsvt.ch", true },
{ "ft.com", false },
{ "ftc.gov", false },
+ { "ftccomplaintassistant.gov", true },
{ "ftcefile.gov", true },
+ { "ftdev.in", true },
{ "ftf.agency", true },
{ "fthat.link", true },
{ "ftng.se", true },
{ "ftptest.net", true },
{ "ftrsecure.com", true },
- { "ftv.re", true },
{ "fu898.top", true },
{ "fuantaishenhaimuli.net", true },
{ "fuck-your-false-positive.de", true },
@@ -14892,6 +15553,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fullhost.com", true },
{ "fullhub.ru", true },
{ "fullmatch.net", true },
+ { "fullnitrous.com", true },
{ "fullstack.love", true },
{ "fullstacknotes.com", true },
{ "fumblers.ca", true },
@@ -14913,7 +15575,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "funchestra.at", false },
{ "functional.cc", true },
{ "functions-online.com", true },
- { "fundayltd.com", true },
{ "fundays.nl", true },
{ "fundchan.com", true },
{ "fundeego.com", true },
@@ -14928,7 +15589,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "funhouse-inflatables.co.uk", true },
{ "funinbeds.org.uk", true },
{ "funken-networks.de", true },
- { "funkner.ru", true },
{ "funktionel.co", true },
{ "funktionsverket.se", true },
{ "funkygamer1.de", true },
@@ -14947,6 +15607,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "furcdn.net", true },
{ "furgo.love", true },
{ "furigana.info", true },
+ { "furikake.xyz", true },
{ "furkancaliskan.com", true },
{ "furkot.com", true },
{ "furkot.de", true },
@@ -14958,9 +15619,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "furlog.it", true },
{ "furnfurs.com", true },
{ "furnishedproperty.com.au", true },
+ { "furries-united.de", true },
+ { "furry.bot", true },
{ "furry.cat", true },
{ "furry.dk", true },
- { "furrybot.me", true },
{ "furrytech.network", true },
{ "furrytf.club", true },
{ "furryyiff.site", true },
@@ -14972,6 +15634,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fusiongaming.de", true },
{ "fussball-xxl.de", true },
{ "fussell.io", true },
+ { "fuszara.pl", true },
{ "futa.moe", true },
{ "futaba-works.com", true },
{ "futagro.com", true },
@@ -14988,9 +15651,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "futuretimes.io", true },
{ "futurezone.at", true },
{ "futurope.com", true },
+ { "fuvelis.fr", true },
{ "fuwafuwa.moe", true },
{ "fuyu.moe", true },
- { "fuzoku.jp", true },
{ "fuzzing-project.org", true },
{ "fveevaete.com", true },
{ "fwdx.net", true },
@@ -15034,8 +15697,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "fysiotherapienieuwveen.nl", true },
{ "fysiovdberg.nl", true },
{ "fysuite.com", true },
+ { "fytcart.com", true },
{ "fzbrweb.cz", true },
- { "fzhyzamt.com", true },
{ "fzx750.ru", true },
{ "g-ds.de", true },
{ "g-m-w.eu", true },
@@ -15050,6 +15713,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "g2pla.net", true },
{ "g2ship.com", true },
{ "g2soft.net", true },
+ { "g3circuit.com", true },
{ "g3d.ro", true },
{ "g3dev.ch", true },
{ "g3rv4.com", true },
@@ -15060,16 +15724,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gabe565.com", true },
{ "gabeb1920.com", true },
{ "gabecook.com", true },
- { "gabemack.com", true },
{ "gabinetpsychoterapii.krakow.pl", true },
{ "gabiocs.com", true },
{ "gabriel.to", true },
{ "gabriele.tips", true },
+ { "gabrielkoo.com", true },
{ "gabrielsteens.nl", true },
{ "gachimuchi.ru", true },
{ "gachiyase.com", true },
{ "gachter.name", true },
{ "gadabit.pl", true },
+ { "gadget-tips.com", true },
+ { "gadgetadvisor.com", true },
{ "gadgethacks.com", true },
{ "gadse.games", true },
{ "gae123.com", true },
@@ -15086,20 +15752,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gagniard.org", true },
{ "gagor.pl", true },
{ "gagygnole.ch", true },
- { "gaiavanderzeyp.com", true },
- { "gaichon.com", true },
+ { "gailbartist.com", true },
{ "gailfellowsphotography.com", true },
{ "gaines-sodiamex.fr", true },
{ "gaio-automobiles.fr", true },
{ "gaireg.de", true },
+ { "gaiserik.com", false },
{ "gaitandmobility.com", true },
{ "gaitrehabilitation.com", true },
{ "gaitresearch.com", true },
- { "gajas18.com", true },
+ { "gakdigital.com", true },
{ "gakkainavi-epsilon.jp", true },
{ "gakkainavi-epsilon.net", true },
- { "gakkainavi.jp", true },
- { "gakkainavi.net", true },
+ { "gakki.photos", true },
{ "gaku-architect.com", true },
{ "gala.kiev.ua", false },
{ "galabau-maurmann.de", true },
@@ -15109,12 +15774,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "galanight.cz", true },
{ "galaxy.edu.pe", true },
{ "galaxymimi.com", true },
- { "galecia.com", true },
{ "galeria42.com", true },
{ "galerialottus.com.br", true },
{ "galeriarr.pl", true },
{ "galeries.photo", true },
- { "galilahiskye.com", true },
{ "galileanhome.org", true },
{ "galilel.cloud", true },
{ "galinas-blog.de", true },
@@ -15126,7 +15789,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gallicrooster.com", true },
{ "gallifreyapp.co.uk", true },
{ "gallifreypermaculture.com.au", true },
+ { "gallmeyer-consulting.com", true },
{ "gallun-shop.com", true },
+ { "galoserver.org", true },
{ "galpaoap.com.br", true },
{ "gamberorosso.menu", true },
{ "gambetti.fr", true },
@@ -15136,7 +15801,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gambitnash.com", true },
{ "gambitprint.com", true },
{ "gamblerhealing.com", true },
- { "gamblersgaming.eu", true },
+ { "game-club.me", true },
{ "game-files.net", false },
{ "game4less.com", true },
{ "game7.de", true },
@@ -15152,6 +15817,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gamedevelopers.pl", true },
{ "gamegix.com", true },
{ "gameguardian.net", true },
+ { "gameharbor.duckdns.org", true },
{ "gameindustry.de", true },
{ "gameisbest.jp", true },
{ "gamekaitori.jp", true },
@@ -15166,11 +15832,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gamercredo.com", true },
{ "gamereader.de", true },
{ "gamerezo.com", true },
+ { "gamerwares.com", true },
{ "gamerzdot.com", true },
{ "games4theworld.org", true },
{ "gamesaviour.com", true },
{ "gamesdepartment.co.uk", true },
{ "gameserver-sponsor.me", true },
+ { "gameshogun.xyz", true },
{ "gameshowchallenge.ie", true },
{ "gamesided.com", true },
{ "gamesplanet.com", true },
@@ -15182,11 +15850,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gamingexodus.com", true },
{ "gamingmedley.com", true },
{ "gamingrealms.net", true },
- { "gamingwithcromulent.com", true },
{ "gamingzoneservers.com", true },
{ "gamisalya.com", true },
{ "gamishou.fr", true },
{ "gamismodernshop.com", true },
+ { "gamismu.com", true },
{ "gamismurahonline.com", true },
{ "gamivo.com", true },
{ "gamoloco.com", true },
@@ -15196,27 +15864,32 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gancedo.com.es", true },
{ "gandalfservice.com", true },
{ "gandalfthefeline.com", true },
- { "gandc.co", false },
{ "gandgliquors.com", true },
{ "ganggalbichler.at", true },
+ { "gangnamavenue.com", true },
+ { "gangnamcool.com", true },
{ "gansleit.com", false },
{ "ganztagplus.de", true },
{ "gao.ci", true },
{ "gao.rocks", true },
+ { "gaodebo.com", true },
{ "gaojianli.me", true },
{ "gaojianli.tk", true },
{ "gaos.org", true },
{ "gapdirect.com", true },
{ "gapfa.org", true },
- { "gaphag.ddns.net", true },
{ "garage-leone.com", true },
{ "garage-meynard.com", true },
{ "garagedejan.ch", true },
+ { "garagedoorrepairingsanjose.com", true },
{ "garageenginuity.com", true },
+ { "garagefox.ch", true },
{ "garagegoossens.be", true },
+ { "garagelink.jp", true },
{ "garagemhermetica.org", true },
{ "garagevanhulle-used.be", true },
{ "garanteasy.com", true },
+ { "garbagedisposalguides.com", true },
{ "garbomuffin.com", true },
{ "garciagerman.com", true },
{ "garda-see.mobi", true },
@@ -15256,6 +15929,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gatekiller.co.uk", true },
{ "gatewaybridal.com", true },
{ "gatewaybronco.com", true },
+ { "gathu.co.ke", true },
{ "gauche.com", true },
{ "gaudeamus-folklor.cz", true },
{ "gaudere.co.jp", true },
@@ -15265,20 +15939,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gautvedt.no", true },
{ "gavin.sh", true },
{ "gavins.stream", true },
+ { "gaw.sh", true },
{ "gawrimanecuta.com", true },
- { "gay-sissies.com", true },
- { "gayauthors.org", true },
- { "gaycc.cc", true },
{ "gayhotti.es", true },
{ "gaymerconnect.net", true },
{ "gaymerx.com", true },
{ "gaymerx.net", true },
{ "gaymerx.org", true },
{ "gaysexpositions.guide", true },
- { "gaysfisting.com", true },
- { "gaytorrent.ru", true },
{ "gayukai.net", true },
- { "gayxsite.com", true },
{ "gazachallenge.org", true },
{ "gazellegames.net", false },
{ "gazete.org", true },
@@ -15299,9 +15968,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gcoded.de", true },
{ "gcs-ventures.com", true },
{ "gcsepod.com", true },
+ { "gd88.cc", true },
{ "gdax.com", true },
{ "gdb-tutorial.net", true },
{ "gdgrzeszow.pl", true },
+ { "gdhzcgs.com", true },
{ "gdiary.net", true },
{ "gdngs.de", true },
{ "gdoce.es", true },
@@ -15311,6 +15982,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ge3k.net", false },
{ "gear4you.shop", true },
{ "gearallnews.com", true },
+ { "gearbot.rocks", true },
{ "gearboxhero.com", true },
{ "gearev.net", true },
{ "gearfinder.nl", true },
@@ -15323,23 +15995,27 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gebruikershandleiding.com", true },
{ "gecem.org", true },
{ "gechr.io", true },
- { "geckler-ee.de", true },
+ { "geckler-ee.de", false },
{ "geder.at", true },
{ "gedlingcastlehire.co.uk", true },
{ "gedlingtherapy.co.uk", true },
{ "gee.is", true },
{ "geecrat.com", true },
{ "geek-hub.de", true },
+ { "geek.ch", true },
{ "geekabit.nl", true },
{ "geekandi.com", true },
{ "geekariom.com", true },
{ "geekclubbooks.com", true },
+ { "geekeffect.co.uk", true },
{ "geeklair.net", true },
{ "geeklan.co.uk", true },
{ "geekles.net", true },
{ "geeknik.com", true },
{ "geekpad.com", true },
+ { "geeks.one", false },
{ "geekshirts.cz", true },
+ { "geekthis.de", true },
{ "geektopia.es", true },
{ "geekwhack.org", true },
{ "geekwithabudget.com", true },
@@ -15359,6 +16035,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gehirn.jp", true },
{ "gehopft.de", true },
{ "gehreslaw.com", true },
+ { "gehrke.cloud", true },
{ "gehrke.in", true },
{ "gehsicht.de", true },
{ "geigenbauer.in", false },
@@ -15371,15 +16048,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "geldimblick.de", true },
{ "geleenbeekdal.nl", true },
{ "geleia-real.com", true },
+ { "geli-graphics.com", true },
{ "gelis.ch", true },
{ "gelodosul.com.br", true },
{ "gelog-software.de", false },
{ "gelonghui.com", true },
{ "geloofindemocratie.nl", false },
{ "geluidsstudio.com", true },
- { "geluk.io", true },
+ { "gelukkigehonden.nl", true },
{ "gem-indonesia.net", false },
{ "gem-info.fr", true },
+ { "gemails.eu", true },
{ "gemeinsam-ideen-verwirklichen.de", true },
{ "gemgroups.in", true },
{ "gemini.com", true },
@@ -15396,11 +16075,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "geneau.net", true },
{ "genehightower.com", true },
{ "genehome.com.au", true },
+ { "genemon.at", true },
{ "generace-id.org", true },
{ "generador-electrico.com", true },
{ "general-anaesthesia.com", true },
{ "general-anaesthetics.com", true },
{ "general-anesthesia.com", true },
+ { "general-plast.com", true },
{ "generali-worldwide.com", true },
{ "generalinsuranceservices.com", true },
{ "generationgoat.com", true },
@@ -15417,6 +16098,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "geneve-naturisme.ch", true },
{ "genevoise-entretien.ch", true },
{ "genfaerd.dk", true },
+ { "geniofinanciero.org", true },
+ { "geniush.ovh", true },
{ "geniushost.in", true },
{ "geniusteacher.in", true },
{ "geniuszone.biz", true },
@@ -15436,10 +16119,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gensonline.eu", true },
{ "gentianes.ch", true },
{ "gentoo-blog.de", true },
- { "gentooblog.de", true },
{ "genusshotel-riegersburg.at", true },
{ "geocar.com", true },
{ "geocompass.at", true },
+ { "geoffsec.org", true },
{ "geofox.org", true },
{ "geography-schools.com", true },
{ "geoinstinct.com", true },
@@ -15448,6 +16131,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "geojs.io", true },
{ "geology-schools.com", true },
{ "geometra.roma.it", true },
+ { "geometra24.it", true },
{ "geomex.be", true },
{ "geomonkeys.com", true },
{ "geoponika.gr", true },
@@ -15489,22 +16173,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gerbyte.uk", true },
{ "germandarknes.net", true },
{ "germanssky.de", true },
- { "germanticz.de", true },
{ "gernert-server.de", true },
{ "gero.io", true },
{ "gerritcodereview.com", true },
{ "gerwinvanderkamp.nl", true },
{ "ges-bo.de", true },
- { "geschichtscheck.de", true },
+ { "geschenkly.de", false },
{ "geschmacksache.online", true },
{ "geschwinder.net", true },
{ "gesica.cloud", true },
+ { "gesnex.com", true },
{ "gessettirotti.it", true },
{ "gestorehotel.com", true },
{ "gestormensajeria.com", true },
+ { "gestsal.com", true },
{ "gesundheitmassage.com", true },
{ "gesundheitswelt24.de", true },
- { "gesundheitszentrum-am-reischberg.de", true },
{ "get-erp.ru", true },
{ "get-it-live.com", true },
{ "get-it-live.de", true },
@@ -15521,7 +16205,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "getbrowink.com", true },
{ "getbutterfly.com", true },
{ "getcloak.com", false },
- { "getcolq.com", true },
{ "getcommande.com", true },
{ "getdash.io", true },
{ "getdeveloper.de", true },
@@ -15541,6 +16224,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "getinphase.com", true },
{ "getitlive.de", true },
{ "getitpeople.com", true },
+ { "getlawyered.com.au", true },
{ "getmango.com", true },
{ "getmdl.io", true },
{ "getmerch.eu", true },
@@ -15569,7 +16253,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "getticker.com", true },
{ "gettodoing.com", true },
{ "gettopquality.com", true },
- { "getts.ro", true },
{ "getupandbounce.co.uk", true },
{ "getvdownloader.com", true },
{ "getwemap.com", true },
@@ -15599,7 +16282,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ggl-luzern.ch", true },
{ "ggma.co.uk", true },
{ "ggmmontascale.it", true },
- { "ggobbo.com", true },
{ "ggp2.com", true },
{ "ggs-marschallstrasse.de", true },
{ "ggs.jp", true },
@@ -15610,6 +16292,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ghfip.com.au", true },
{ "ghini.com", true },
{ "ghislainphu.fr", true },
+ { "ghost-legion.com", true },
{ "ghostblog.info", false },
{ "ghostcir.com", true },
{ "ghou.me", true },
@@ -15633,6 +16316,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "giardiniere.bologna.it", true },
{ "giardiniere.milano.it", true },
{ "gichigamigames.com", true },
+ { "gidari.shop", true },
{ "giebel.it", true },
{ "gierds.de", true },
{ "giethoorn.com", true },
@@ -15641,6 +16325,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "giftcardgranny.com", true },
{ "giftedconsortium.com", true },
{ "giftking.nl", false },
+ { "giftlist.guru", true },
{ "giftmaniabrilhos.com.br", true },
{ "gifts.best", true },
{ "gifts365.co.uk", true },
@@ -15658,13 +16343,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gigis-pizzeria.de", true },
{ "gigis.cloud", true },
{ "giglink.club", true },
- { "gigolodavid.be", true },
{ "gigseekr.com", true },
{ "gigtroll.eu", true },
{ "gijsbertus.com", true },
{ "gijswesterman.nl", true },
{ "gikovatelojavirtual.com.br", true },
- { "gilangcp.com", true },
+ { "gilangcp.com", false },
{ "gileadpac.com", true },
{ "giliamor.com", true },
{ "gillesdesnoyers.com", true },
@@ -15672,16 +16356,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gillfamily.de", true },
{ "gillmanandsoame.co.uk", true },
{ "gillyscastles.co.uk", true },
+ { "gilme.net", true },
{ "gilmoreid.com.au", true },
- { "gilmourluna.com", true },
{ "gilnet.be", true },
{ "gimme.money", true },
{ "gina-architektur.design", true },
{ "ginabaum.com", true },
- { "ginacat.de", true },
{ "gingersutton.com", true },
{ "ginionusedcars.be", true },
{ "ginja.co.th", true },
+ { "ginnegappen.nl", true },
{ "ginniemae.gov", true },
{ "gino-gelati.de", true },
{ "ginza-luce.net", true },
@@ -15726,7 +16410,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "giulianosdeli.com", true },
{ "giunchi.net", true },
{ "giuseppemacario.men", true },
- { "givastar.com", true },
{ "give2charity.co", true },
{ "give2charityapp.com", true },
{ "giveattheoffice.org", false },
@@ -15735,13 +16418,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "given2.com", true },
{ "givesunlight.com", true },
{ "givingnexus.org", false },
+ { "givingtools.com", true },
{ "gixtools.com", true },
{ "gixtools.net", true },
{ "gj-bochum.de", true },
{ "gjcampbell.co.uk", true },
{ "gjengset.com", true },
{ "gjspunk.de", false },
- { "gkimanyar.org", true },
{ "gkoenig-innenausbau.de", true },
{ "gkralik.eu", true },
{ "gl.search.yahoo.com", false },
@@ -15760,10 +16443,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "glasfaser-im-hanseviertel.de", true },
{ "glasgestaltung.biz", true },
{ "glasner.photo", true },
+ { "glass-mag.eu", true },
{ "glass.google.com", true },
{ "glasschmuck-millefiori.de", true },
{ "glassexpertswa.com", true },
{ "glassrainbowtrust.org.je", true },
+ { "glassrom.pw", true },
{ "glasweld.com", true },
{ "glavsudexpertiza.ru", true },
{ "glazedmag.fr", true },
@@ -15780,6 +16465,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "glidingshop.de", true },
{ "glidingshop.eu", true },
{ "glitzerstuecke.de", true },
+ { "glixee.com", true },
{ "glloq.org", true },
{ "glob-coin.com", true },
{ "global-adult-webcams.com", true },
@@ -15796,6 +16482,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "globalisierung-fakten.de", true },
{ "globalitac.com", true },
{ "globalityinvestment.com", true },
+ { "globalno.me", true },
{ "globalonetechnology.com", true },
{ "globalprojetores.com.br", true },
{ "globalresearchcouncil.org", true },
@@ -15804,13 +16491,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "globcoin.io", true },
{ "globelink-group.com", true },
{ "glocalworks.jp", true },
+ { "glofox.com", true },
{ "glolighting.co.za", true },
{ "gloneta.com", false },
{ "gloning.name", true },
{ "glont.net", true },
{ "gloria.tv", true },
{ "glosiko.com", true },
- { "glossopnorthendafc.co.uk", true },
{ "glotech.co.uk", true },
{ "glotechkitchens.co.uk", true },
{ "glotechrepairs.co.uk", true },
@@ -15853,18 +16540,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gmx.fr", true },
{ "gmx.net", true },
{ "gn00.com", true },
+ { "gn00.ink", true },
{ "gnax.jp", false },
{ "gndh.net", true },
{ "gnetion.com", true },
{ "gnetwork.eu", true },
{ "gnfrazier.me", true },
- { "gnhub.org", true },
{ "gnilebein.de", true },
{ "gnk.io", true },
{ "gnuand.me", true },
{ "gnucashtoqif.us", true },
{ "gnunet.org", true },
- { "gnuplus.me", true },
{ "gnwp.eu", true },
{ "go-dutch.eu", true },
{ "go-embedded.de", true },
@@ -15873,6 +16559,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "go-zh.org", true },
{ "go.microsoft.com", true },
{ "go.xero.com", false },
+ { "go2archive.nl", true },
{ "go2ubl.nl", true },
{ "goa8.xyz", true },
{ "goalbookapp.com", true },
@@ -15886,9 +16573,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gobouncy.co.uk", true },
{ "gobouncy.com", true },
{ "gobranding.com.vn", true },
+ { "gocher.me", true },
{ "gochu.se", true },
{ "gocleanerslondon.co.uk", true },
{ "god-clan.hu", true },
+ { "godattributes.com", true },
{ "godaxen.tv", true },
{ "godclan.hu", true },
{ "godesigner.ru", true },
@@ -15906,6 +16595,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "goerres2014.de", true },
{ "goetemp.de", true },
{ "goetic.space", true },
+ { "goettinger-biergarten.de", true },
{ "goffrie.com", true },
{ "gofigure.fr", false },
{ "goflipr.com", true },
@@ -15913,7 +16603,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gofoiayourself.org", true },
{ "gogle-analytics.com", true },
{ "gogleapis.com", true },
- { "gogonano.com", true },
{ "gogoodyear.eu", true },
{ "gogroopie.com", true },
{ "gogroopie.ie", true },
@@ -15959,24 +16648,27 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "golser.info", true },
{ "gomasy.jp", true },
{ "gomel.chat", true },
+ { "gomel.city", true },
{ "gomelchat.com", true },
+ { "gomelphoto.com", true },
{ "gomena.io", true },
{ "gommista.roma.it", true },
{ "gondawa.com", true },
{ "gondelvaartdwarsgracht.nl", true },
{ "gongjianwei.com", true },
{ "gongjuhao.com", true },
- { "gonx.dk", true },
+ { "gonx.dk", false },
{ "goo.gl", true },
{ "gooby.co", false },
{ "good-tips.pro", true },
+ { "good588.com", true },
{ "gooday.life", true },
{ "goodhealthtv.com", true },
+ { "goodiesoftware.xyz", true },
{ "goodquote.gq", true },
{ "goodryb.top", true },
{ "goodshepherdmv.com", true },
{ "goodth.ink", true },
- { "goodvibesblog.com", true },
{ "google", true },
{ "google-analytics.com", true },
{ "googleandroid.cz", true },
@@ -15985,9 +16677,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "googlesource.com", true },
{ "goombi.fr", true },
{ "goonersworld.co.uk", true },
- { "goontopia.com", true },
{ "goooo.info", true },
- { "gootlijsten.nl", true },
{ "goover.de", true },
{ "goow.in", true },
{ "goozp.com", true },
@@ -16006,13 +16696,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gorgias.me", true },
{ "gorky.media", true },
{ "gorn.ch", true },
- { "gorschenin.com", true },
+ { "goru.travel", true },
{ "gosccs.com", true },
{ "gosciencegirls.com", true },
{ "gosforthdentalsurgery.co.uk", true },
{ "goshawkdb.io", true },
{ "goshin-group.co.jp", true },
- { "goshow.tv", true },
+ { "gosnipe.com", true },
{ "gosolockpicks.com", true },
{ "gospelfollower.com", true },
{ "gospelofmark.ch", true },
@@ -16027,17 +16717,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gothamlimo.com", true },
{ "gothic.dating", true },
{ "gotirupati.com", false },
- { "gotmalk.org", true },
+ { "gotmalk.org", false },
{ "goto.google.com", true },
{ "goto.msk.ru", true },
{ "goto.world", true },
{ "goto10.se", true },
{ "gotomi.info", true },
+ { "gotowned.org", false },
{ "gotoxy.at", true },
{ "gotrail.fr", true },
{ "gottcode.org", false },
{ "gottfridsberg.org", true },
{ "goudenharynck.be", true },
+ { "goufaan.com", true },
{ "gouforit.com", true },
{ "gouldcooksey.com", true },
{ "goup.co", true },
@@ -16053,6 +16745,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "govtjobs.blog", true },
{ "govtrack.us", true },
{ "govype.com", true },
+ { "gow220.ru", true },
{ "gowancommunications.com", true },
{ "gowe.wang", false },
{ "gowildrodeo.co.uk", true },
@@ -16069,9 +16762,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gpsvideocanada.com", true },
{ "gpureport.cz", true },
{ "gpws.ovh", true },
+ { "gpyy.net", true },
{ "gqmstore.com.br", true },
{ "gr.search.yahoo.com", false },
{ "gra2.com", true },
+ { "graandco.com", false },
{ "graasp.net", false },
{ "grabacabpa.com", true },
{ "grace-wan.com", true },
@@ -16080,7 +16775,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gracethrufaith.com", true },
{ "gracetini.com", true },
{ "graciousmay.com", true },
- { "gradecam.com", true },
+ { "gradecam.com", false },
{ "gradienthosting.co.uk", true },
{ "gradients.com", true },
{ "gradingcontractornc.com", true },
@@ -16093,7 +16788,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grafcaps.com", true },
{ "graffen.dk", true },
{ "grafmag.pl", true },
- { "grafmurr.de", true },
{ "grafoteka.pl", true },
{ "graft.community", true },
{ "graft.observer", true },
@@ -16139,11 +16833,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grapee.jp", true },
{ "grapeintentions.com", true },
{ "grapevine.is", true },
+ { "graph.org", true },
{ "graphcommons.com", true },
{ "graphene.software", true },
{ "graphic-schools.com", true },
{ "graphic-shot.com", true },
+ { "graphobyte.com", true },
{ "grapholio.net", true },
+ { "grasboomamersfoort.nl", true },
+ { "grasboombinnendoor.nl", true },
+ { "grasboomclophaemer.nl", true },
+ { "grasboomderoos.nl", true },
+ { "grasboomleusden.nl", true },
+ { "grasboommax.nl", true },
+ { "grasboommeerbalans.nl", true },
+ { "grasboomveenendaal.nl", true },
+ { "grasboomvondellaan.nl", true },
{ "grasmark.com", true },
{ "grassenberg.de", true },
{ "grasshoppervape.com", true },
@@ -16188,13 +16893,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "greekmusic.academy", true },
{ "green-attitude.be", true },
{ "green-care.nl", true },
+ { "green-light.cf", true },
{ "green-light.co.nz", true },
+ { "green-light.ga", true },
+ { "green-light.gq", true },
+ { "green-light.ml", true },
{ "greenaddress.it", true },
{ "greenapproach.ca", true },
{ "greencircleplantnursery.com.au", true },
{ "greencircleplantnursery.net.au", true },
{ "greener.pl", true },
- { "greengoblindev.com", true },
{ "greenhats.de", true },
{ "greenliquidsystem.com", true },
{ "greenliv.pl", true },
@@ -16218,8 +16926,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "greg.red", true },
{ "gregbrimble.com", true },
{ "greger.me", true },
- { "gregmarziomedia-dev.com", true },
- { "gregmarziomedia.co.za", true },
{ "gregmilton.com", true },
{ "gregmote.com", true },
{ "grego.pt", true },
@@ -16236,7 +16942,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grenadierkorps-kaarst.de", true },
{ "grenadierkorps.de", true },
{ "grendel.no", true },
- { "grengine.ch", true },
+ { "grenlandkiropraktor.no", true },
{ "grepmaste.rs", true },
{ "grepular.com", true },
{ "gresak.io", true },
@@ -16245,7 +16951,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grexx.nl", true },
{ "grey.house", true },
{ "greybeards.ca", true },
- { "greyhash.se", true },
{ "greymattertechs.com", true },
{ "greysky.me", true },
{ "greyskymedia.com", true },
@@ -16270,6 +16975,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "griegshipbrokers.no", true },
{ "griesser2.de", true },
{ "grillen-darf-nicht-gesund-sein.de", true },
+ { "grillhutsunderland.com", true },
{ "grillteller42.de", true },
{ "grimcalc.com", true },
{ "grimm-gastrobedarf.de", true },
@@ -16278,7 +16984,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grinnellplans.com", true },
{ "grippe-impftermin.de", true },
{ "gritte.ch", true },
- { "grizzlys.com", true },
{ "grmp.fr", true },
{ "grocerybuild.com", true },
{ "grocock.me.uk", true },
@@ -16308,6 +17013,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grothoff.org", true },
{ "grottenthaler.eu", true },
{ "groundlevelup.com", true },
+ { "groundmc.net", true },
+ { "groundthumpingmotors.com", true },
+ { "groundthumpingmotors.net", true },
+ { "groundthumpinmotors.com", true },
+ { "groundthumpinmotors.net", true },
{ "group4layers.net", true },
{ "groupe-neurologique-nord.lu", true },
{ "groupebaillargeon.com", true },
@@ -16336,6 +17046,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "grundlage.com.ua", true },
{ "grunwaldzki.center", true },
{ "grunwasser.fr", true },
+ { "grupodatco.com", true },
{ "grupomakben.com", true },
{ "grupomedlegal.com", true },
{ "grupoparco.com", true },
@@ -16361,12 +17072,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gt-network.de", true },
{ "gta-arabs.com", true },
{ "gtaforum.nl", true },
- { "gtchipsi.org", true },
- { "gtcprojects.com", true },
+ { "gtdgo.com", false },
{ "gtlaun.ch", true },
{ "gtlfsonlinepay.com", true },
{ "gtmasterclub.it", false },
{ "gtmetrix.com", true },
+ { "gtn-pravda.ru", true },
{ "gtoepfer.de", true },
{ "gtopala.com", true },
{ "gtopala.net", true },
@@ -16374,6 +17085,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gtravers-basketmaker.co.uk", true },
{ "gtxbbs.com", true },
{ "gtxmail.de", true },
+ { "guadagnare.info", true },
{ "guajars.cl", true },
{ "guannan.net.cn", true },
{ "guanyembadalona.org", true },
@@ -16398,7 +17110,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gueze-sas.fr", true },
{ "guffr.it", true },
{ "guge.ch", true },
- { "gugert.net", true },
{ "guhei.net", true },
{ "guhenry3.tk", true },
{ "guiacidade.com.br", true },
@@ -16411,6 +17122,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "guide-peche-cantal.com", true },
{ "guidebook.co.tz", true },
{ "guidedselling.net", true },
+ { "guidedsteps.com", true },
{ "guideline.gov", false },
{ "guidelines.gov", false },
{ "guideo.ch", true },
@@ -16445,17 +17157,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "guoliang.me", true },
{ "guozeyu.com", true },
{ "gupfen.ch", true },
- { "guphi.net", false },
{ "gurkan.in", true },
{ "gurmel.ru", true },
{ "gurpusmaximus.com", true },
{ "guru-naradi.cz", true },
{ "gurucomi.com", true },
{ "gurueffect.com", true },
+ { "gurunpa.com", true },
{ "gururi.com", true },
{ "gus.host", true },
{ "gustaff.de", true },
- { "gustiaux.com", true },
{ "gustom.io", true },
{ "gut8er.com.de", true },
{ "gutools.co.uk", true },
@@ -16463,7 +17174,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "guts.moe", true },
{ "gutschein-spezialist.de", true },
{ "gutscheingeiz.de", true },
- { "gutuia.blue", true },
{ "guus-thijssen.nl", true },
{ "guusvandewal.nl", true },
{ "guyeskens.be", true },
@@ -16487,6 +17197,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gwhois.org", true },
{ "gwrtech.com", true },
{ "gwsec.co.uk", true },
+ { "gx3.cn", true },
{ "gxmyqy.net", true },
{ "gyara.moe", true },
{ "gyas.nl", true },
@@ -16496,7 +17207,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gymjp.com", true },
{ "gymkirchenfeld.ch", true },
{ "gymnaserenens.ch", true },
- { "gymnasium-farmsen.de", true },
{ "gymnasium-hittfeld.de", true },
{ "gympap.de", true },
{ "gynaecology.co", true },
@@ -16506,31 +17216,36 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "gyrenens.ch", true },
{ "gyu-raku.jp", true },
{ "gyulakerezsi.ro", true },
+ { "gyume.ir", true },
{ "gz-architekten.de", true },
{ "gz-benz.com", true },
{ "gz-bmw.com", true },
{ "gza.jp", true },
{ "gzom.ru", true },
+ { "gzriedstadt.de", true },
{ "h-jo.net", true },
{ "h-suppo.com", true },
{ "h001.ru", true },
{ "h09.eu", true },
{ "h0r.st", true },
{ "h10l.com", true },
- { "h11.io", true },
+ { "h11.io", false },
{ "h11.moe", true },
{ "h1ctf.com", true },
{ "h1z1swap.com", true },
{ "h24.org", true },
{ "h2s-design.de", true },
{ "h2u.tv", true },
+ { "h33t.xyz", true },
{ "h3artbl33d.nl", true },
{ "h3b.nl", true },
+ { "h3x.net", true },
{ "h3z.jp", true },
{ "h404bi.com", true },
{ "ha-kunamatata.de", true },
{ "ha3.eu", true },
{ "ha6.ru", true },
+ { "haancommunity.cf", true },
{ "haarlemsesaxofoonschool.nl", true },
{ "haavard.me", true },
{ "haazen.xyz", true },
@@ -16548,14 +17263,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hacertest.com", true },
{ "hacettepeteknokent.com.tr", true },
{ "hachre.de", false },
+ { "hack.club", true },
{ "hackademix.net", true },
{ "hackanders.com", true },
{ "hackattack.com", true },
{ "hackbarth.guru", true },
{ "hackbeil.name", true },
{ "hackcraft.net", true },
+ { "hackdown.me", true },
{ "hackenkunjeleren.nl", true },
{ "hackenturet.dk", true },
+ { "hacker.club", true },
{ "hacker.holiday", true },
{ "hacker.im", true },
{ "hacker.one", true },
@@ -16569,6 +17287,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hackerone-ext-content.com", true },
{ "hackerone-user-content.com", true },
{ "hackerone.at", true },
+ { "hackerone.blog", true },
{ "hackerone.com", true },
{ "hackerone.net", true },
{ "hackerone.org", true },
@@ -16577,13 +17296,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hackgins.com", true },
{ "hackingand.coffee", false },
{ "hackingdh.com", true },
+ { "hackingondemand.com", true },
{ "hackmd.io", true },
{ "hackmeimfamo.us", true },
{ "hackreone.com", true },
{ "hacksecu.re", true },
{ "hacksoc.co.uk", true },
{ "hackthissite.org", true },
- { "hacktic.info", true },
{ "hacktivis.me", true },
{ "hackworx.com", false },
{ "hadaly.fr", true },
@@ -16591,6 +17310,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hadouk.in", true },
{ "hadrons.org", true },
{ "hady.fr", true },
+ { "haeckdesign.com", true },
{ "haefligermedia.ch", true },
{ "haemka.de", true },
{ "haens.li", true },
@@ -16604,6 +17324,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hagueaustralia.com.au", true },
{ "haha-raku.com", true },
{ "hahay.es", true },
+ { "haibara.top", true },
{ "haiboxu.com", true },
{ "hailer.com", true },
{ "hailstorm.nl", true },
@@ -16616,10 +17337,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hairtonic-lab.com", true },
{ "haixihui.cn", true },
{ "hajekdavid.cz", true },
+ { "hajekj.com", true },
{ "hajekj.cz", true },
{ "hajekj.net", true },
{ "hajnzic.at", true },
{ "hak5.org", true },
+ { "hakans.science", true },
{ "hakaru.org", true },
{ "hakase.io", true },
{ "hakase.pw", true },
@@ -16627,17 +17350,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hake.me", true },
{ "hakkasangroup.com", true },
{ "hakkasannightclub.com", true },
- { "hakurei.moe", false },
{ "halacs.hu", true },
- { "halbich.design", true },
{ "haleo.net", true },
{ "half.host", true },
- { "halfco.de", true },
{ "halfhosting.de", true },
{ "halitopuroprodutos.com.br", true },
{ "halkirkbouncycastles.co.uk", true },
{ "hallelujahsoftware.com", true },
- { "halletienne.fr", true },
{ "hallettxn.com", true },
{ "hallhuber.com", true },
{ "halliday.work", true },
@@ -16645,22 +17364,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hallmarkestates.ca", true },
{ "hallucinogen.com", true },
{ "hallucinogens.org", true },
- { "hallumlaw.com", true },
{ "halo.fr", true },
{ "halocredit.pl", true },
- { "halongbaybackpackertour.com", true },
{ "haloobaloo.com", true },
{ "haloria.com", true },
{ "haltegame.com", true },
+ { "halyul.com", true },
{ "hamacho-kyudo.com", true },
{ "hamali.bg", true },
+ { "hambassadors.org", true },
{ "hamburg40grad.de", true },
{ "hamburgerbesteld.nl", true },
{ "hamcocc.com", true },
{ "hamcram.io", true },
{ "hamiltonlinen.com", true },
{ "hamiltonmedical.nl", true },
- { "hammer-schnaps.com", true },
{ "hammer-sms.com", true },
{ "hampl.tv", true },
{ "hampshiretechservices.co.uk", true },
@@ -16679,11 +17397,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "handmade-workshop.de", true },
{ "handmadehechoamano.com", true },
{ "handy-center.net", true },
+ { "handy-reparatur-berlin.com", true },
{ "handymanlondonplease.co.uk", true },
+ { "handynummer-info.ch", true },
{ "handynummer.online", true },
{ "handysex.live", true },
+ { "handyticket.de", true },
{ "hanfox.co.uk", false },
- { "hanfverband-erfurt.de", true },
{ "hang333.moe", true },
{ "hangar.hosting", true },
{ "hangcapnach.com", true },
@@ -16696,10 +17416,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hannasecret.de", true },
{ "hannoluteijn.nl", true },
{ "hannover.de", true },
- { "hanoibuffet.com", true },
{ "hanpenblog.com", true },
{ "hansahome.ddns.net", true },
{ "hansashop.eu", true },
+ { "hansashop.fi", true },
{ "hansbijster.nl", true },
{ "hanschventures.com", true },
{ "hansen-kronshagen.de", true },
@@ -16712,22 +17432,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hantse.com", true },
{ "hanu.la", true },
{ "hanyibo.com", true },
+ { "hanying6.com", true },
{ "hanzubon.jp", true },
{ "hao-zhang.com", true },
{ "haocq3.com", true },
{ "haogoodair.ca", true },
{ "haoqi.men", true },
{ "haorenka.cc", true },
- { "haotown.cn", true },
{ "haozhang.org", true },
{ "haozhexie.com", true },
{ "haozi.me", true },
- { "haozijing.com", true },
{ "hapheemraadssingel.nl", true },
{ "hapijs.cn", true },
{ "happndin.com", true },
{ "happy-baby.info", true },
{ "happy-end-shukatsu.com", true },
+ { "happy-life-food.de", true },
{ "happyagain.de", true },
{ "happyagain.se", true },
{ "happyandrelaxeddogs.eu", true },
@@ -16761,11 +17481,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hardfalcon.net", true },
{ "hardforum.com", true },
{ "hardh.at", true },
+ { "hardhat.io", true },
{ "hardloopfysio.nl", true },
{ "hardrain980.com", true },
{ "hardtfrieden.de", true },
{ "hardwareschotte.de", true },
{ "harekaze.info", true },
+ { "harelmallac.com", true },
+ { "harelmallacglobal.com", true },
{ "haribilalic.com", true },
{ "harilova.fr", true },
{ "harion.fr", true },
@@ -16777,18 +17500,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "harmoney.com", true },
{ "harmoney.com.au", true },
{ "harmonyplace.com", true },
+ { "harnov.dk", true },
{ "haroldsharpe.com", true },
{ "harp.gov", true },
{ "harrcostl.com", true },
{ "harringtonca.com", true },
{ "harrisonswebsites.com", true },
{ "harrisonvillenaz.org", true },
+ { "harry-baker.com", true },
+ { "harrygerritstransport.nl", true },
{ "harrymclaren.co.uk", true },
{ "harryphoto.fr", true },
{ "harrysgardengamehire.co.uk", true },
{ "harrysmallbones.co.uk", true },
{ "harrysqnc.co.uk", true },
+ { "harschnitz.nl", false },
{ "hartie95.de", true },
+ { "hartkampforkids.nl", true },
{ "hartlep.email", true },
{ "hartlieb.me", true },
{ "hartzer.com", true },
@@ -16799,6 +17527,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "harvestapp.com", true },
{ "harvester.fr", true },
{ "harveyauzorst.com", true },
+ { "harveyplum.com", true },
{ "harveysautoservice.net", true },
{ "has-no-email-set.de", false },
{ "has.work", true },
@@ -16829,6 +17558,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hasselbach-dellwig.de", true },
{ "hatarisecurity.co.ke", true },
{ "hatpakha.com", true },
+ { "hatter.ink", true },
{ "hatul.info", true },
{ "haucke.xyz", true },
{ "hauntedhouserecords.co.uk", true },
@@ -16836,16 +17566,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "haus-henne.de", true },
{ "haus-zeitlos.de", true },
{ "hausarztpraxis-linn.de", true },
+ { "haushaltsaufloesunghannover.de", true },
{ "haushenne.de", true },
{ "hausjugo.de", true },
{ "haustechnik-breu.de", true },
+ { "haustechnik-schulte-sanitaer-heizung-klima.de", true },
{ "hausundhof.com", true },
{ "hausverbrauch.de", true },
{ "hautaka.com", true },
{ "hautarztzentrum.ch", true },
{ "hauteslatitudes.com", true },
- { "havarijna-sluzba-bratislava.sk", true },
- { "havasuhomepage.com", true },
{ "havasuinsurance.com", true },
{ "havasutacohacienda.com", true },
{ "have.jp", true },
@@ -16863,6 +17593,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "havetherelationshipyouwant.com", true },
{ "hawaar.com", true },
{ "hawaiianchoice.com", true },
+ { "hawawa.kr", true },
{ "hawaya.com", true },
{ "hawkeyeinsight.com", true },
{ "hawkinsonkiaparts.com", true },
@@ -16875,9 +17606,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "haxo.nl", false },
{ "hayai.space", true },
{ "hayashi-rin.net", true },
- { "hayden.one", false },
{ "haydenjames.io", true },
- { "haydentomas.com", true },
{ "hayfordoleary.com", true },
{ "haynes-davis.com", true },
{ "hayvid.com", true },
@@ -16899,6 +17628,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hd-offensive.at", false },
{ "hd-only.org", true },
{ "hd-outillage.com", true },
+ { "hd4138.com", true },
+ { "hd6556.com", true },
{ "hdc.cz", true },
{ "hdcamvids.com", true },
{ "hdcenter.cc", true },
@@ -16913,9 +17644,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hdrsource.com", true },
{ "hdrtranscon.com", true },
{ "hds-lan.de", true },
- { "hdtwinks.com", true },
{ "hdv.paris", true },
- { "hdwallpapers.net", true },
{ "heaaart.com", true },
{ "head.org", true },
{ "head.ru", true },
@@ -16923,8 +17652,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "headlinepublishing.be", true },
{ "headshopinternational.com", true },
{ "headshotharp.de", true },
- { "health-and-beauty-news.net", true },
- { "health-booster.com", false },
+ { "health-booster.com", true },
{ "health-plan-news.com", true },
{ "health.gov", true },
{ "health.graphics", true },
@@ -16939,7 +17667,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "healthfinder.gov", true },
{ "healthfoam.com", true },
{ "healthgames.co.uk", true },
- { "healthiercompany.com", true },
{ "healthiergenerations.co.uk", true },
{ "healthit.gov", true },
{ "healthplansamerica.org", true },
@@ -16948,8 +17675,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "healththoroughfare.com", true },
{ "healthy-map.com", true },
{ "healthybeterlife.click", true },
- { "healthyfitfood.com", true },
{ "healthypeople.gov", true },
+ { "healthyrecharge.com", true },
{ "healthyteame.com", true },
{ "heap.zone", true },
{ "heapkeeper.org", true },
@@ -16960,7 +17687,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "heartlandbiomed.com", true },
{ "heartmdinstitute.com", true },
{ "heartsintrueharmony.com", true },
- { "heartsucker.com", false },
+ { "hearttruth.gov", true },
{ "heartview.com.br", true },
{ "heartwoodart.com", true },
{ "hearty.blog", true },
@@ -16980,7 +17707,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "heavensinferno.net", true },
{ "heavyequipments.org", true },
{ "hebamme-cranio.ch", true },
- { "hebergeurssd.com", true },
{ "hebikhiv.nl", true },
{ "hebingying.cn", true },
{ "hebocon.nl", true },
@@ -17009,9 +17735,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "heiaheia.com", true },
{ "heid.ws", true },
{ "heidisheroes.org", true },
+ { "heighton.com.au", true },
{ "heijblok.com", true },
{ "heijdel.nl", true },
{ "heikegastmann.com", true },
+ { "heikohessenkemper.de", true },
{ "heikorichter.name", true },
{ "heiland.io", true },
{ "heiliger-gral.info", true },
@@ -17029,8 +17757,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "heisenberg.co", true },
{ "heissluft-fritteuse.com", true },
{ "heistheguy.com", true },
+ { "heitepriem.info", true },
{ "heitland-it.de", true },
- { "heiwa-valve.co.jp", true },
+ { "heiwa-valve.co.jp", false },
{ "hejahanif.se", true },
{ "hejianpeng.cn", true },
{ "heka.ai", true },
@@ -17045,8 +17774,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "helenelefauconnier.com", true },
{ "helenkellersimulator.org", true },
{ "helfordriversc.co.uk", true },
- { "helgaschultz.de", true },
{ "helichat.de", true },
+ { "helifreak.club", true },
{ "helikon.ro", true },
{ "helioanodyne.eu", true },
{ "helios4.com", true },
@@ -17059,15 +17788,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "helles-koepfchen.de", true },
{ "helloacm.com", true },
{ "hellobrian.me", true },
+ { "hellomookie.com", true },
+ { "hellomouse.cf", true },
{ "hellomouse.net", true },
+ { "hellovillam.com", true },
{ "helloworldhost.com", false },
+ { "helloyemek.com", true },
{ "hellsgamers.pw", true },
{ "hellsh.com", true },
{ "help.simpletax.ca", true },
{ "helpconnect.com.au", true },
{ "helpscoutdocs.com", true },
{ "helpstarloja.com.br", true },
+ { "helptasker.com", true },
+ { "helptasker.net", true },
+ { "helptasker.ru", true },
+ { "helpwithinsomnia.org", true },
{ "helpwithmybank.gov", true },
+ { "helserbrothers.com", true },
{ "helsinki.dating", true },
{ "helvella.de", true },
{ "hematoonkologia.pl", true },
@@ -17080,6 +17818,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hendersonrealestatepros.com", true },
{ "hendersonvalleyautomotive.co.nz", true },
{ "hendric.us", false },
+ { "hendrickx.be", true },
{ "hendrik.li", true },
{ "hendrinortier.nl", true },
{ "hengelsportdeal.com", true },
@@ -17096,14 +17835,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "henningkerstan.de", true },
{ "hennymerkel.com", true },
{ "henok.eu", true },
+ { "henrik-bondtofte.dk", true },
{ "henriksen.is", true },
{ "henrikwelk.de", true },
{ "henrilammers.nl", true },
{ "henry.gg", true },
{ "henryphan.com", false },
{ "henrysautodetail.com", true },
- { "hentaiworld.cc", true },
- { "hentaiz.net", true },
{ "hentschke-bau.de", true },
{ "hentschke-betonfertigteilwerk.de", true },
{ "hentschke-invest.de", true },
@@ -17113,6 +17851,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "her25.com", false },
{ "herberichfamily.com", true },
{ "herbert.io", true },
+ { "herbertjanvandinther.nl", true },
{ "herbhuang.com", true },
{ "herbweb.net", true },
{ "herbweb.org", true },
@@ -17122,6 +17861,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "herebedragons.io", true },
{ "herecsrymy.cz", true },
{ "heren.fashion", true },
+ { "heribro.com", true },
{ "heritagebaptistchurch.com.ph", true },
{ "herkam.pl", true },
{ "hermanbrouwer.nl", true },
@@ -17137,8 +17877,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "heroiclove.com", true },
{ "heroicpixel.com", true },
{ "heroku.com", true },
+ { "heroku.ga", true },
{ "heromuster.com", true },
{ "herpes-no.com", true },
+ { "herramientasbazarot.com", true },
{ "herranzramia.com", false },
{ "herrderzeit.de", true },
{ "herrenmuehle-wein.de", true },
@@ -17192,11 +17934,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hg.gg", true },
{ "hg.python.org", true },
{ "hgbet.com", true },
+ { "hgpowerglue.nl", true },
{ "hgvnet.de", true },
{ "hgw168.com", true },
{ "hh-medic.com", true },
{ "hh-wolke.dedyn.io", true },
{ "hhgdo.de", true },
+ { "hhh1080.com", true },
{ "hhhdb.com", true },
{ "hhidr.org", true },
{ "hhmmmm.de", true },
@@ -17249,15 +17993,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hilfreiche-server.tips", true },
{ "hilhorst-uitvaartverzorging.nl", true },
{ "hillcountryoralsurgery.com", true },
+ { "hillcrestswimclub.com", true },
{ "hillsboroccpa.org", true },
{ "hillstrak.com.au", true },
{ "hilltopcellar.com", true },
{ "hilnu.com", true },
{ "hiltonarubabeachservices.com", true },
+ { "himalaya-cross.com", true },
+ { "himalaya.video", true },
{ "himcy.ga", true },
{ "himecorazon.com", true },
{ "himekomi.com", true },
- { "himens.com", true },
{ "himiku.com", true },
{ "hin10.com", true },
{ "hinata-hidetoshi.com", true },
@@ -17286,6 +18032,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hireabouncycastle.net", true },
{ "hiresteve.ca", true },
{ "hirevo.eu", true },
+ { "hirevue.com", true },
{ "hirezzportal.com", true },
{ "hiring-process.com", true },
{ "hiromuogawa.com", true },
@@ -17297,24 +18044,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hisingensck.se", true },
{ "hisnet.de", true },
{ "hispanic.dating", true },
- { "histocamp.de", true },
{ "histoire-cite.ch", true },
{ "historia-arte.com", true },
{ "history-schools.com", true },
{ "history.google.com", false },
{ "history.gov", true },
{ "hitandhealth.nl", true },
+ { "hitchpin.com", true },
{ "hiteco.com", true },
{ "hiteshbrahmbhatt.com", true },
{ "hititgunesi-tr.com", true },
{ "hitmanstat.us", true },
{ "hitn.at", true },
- { "hitoapi.cc", true },
+ { "hitoapi.cc", false },
{ "hitocom.net.br", true },
{ "hitokoto-mania.com", true },
{ "hitokoto.cn", true },
{ "hitomecha.com", true },
- { "hitrek.ml", true },
{ "hitter-lauzon.com", true },
{ "hitter.family", true },
{ "hitterfamily.com", true },
@@ -17341,6 +18087,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hjw-kunstwerk.de", true },
{ "hjyl9898.com", true },
{ "hk.search.yahoo.com", false },
+ { "hkas.org.hk", true },
{ "hkbsurgery.com", true },
{ "hkdobrev.com", true },
{ "hkr.at", true },
@@ -17348,7 +18095,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hks.pw", true },
{ "hktkl.com", true },
{ "hkustmbajp.com", true },
- { "hl7999.com", true },
{ "hl8999.com", true },
{ "hlavacek.us", true },
{ "hlavi.hu", true },
@@ -17377,6 +18123,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hoaas.no", true },
{ "hoahau.org", true },
{ "hoarding.me", true },
+ { "hoathienthao.com", true },
+ { "hoathienthao.vn", true },
{ "hobby-drechselei.de", true },
{ "hobbyspeed.com", true },
{ "hochdorf-tennis.de", true },
@@ -17389,6 +18137,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hochzeitsplanerin-hamburg.de", true },
{ "hockeyapp.ch", true },
{ "hockeymotion.ch", true },
+ { "hoctap.net", true },
{ "hodgephotography.com", true },
{ "hodnos.com", true },
{ "hoe.re", true },
@@ -17414,14 +18163,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hohenleimbach.de", true },
{ "hoikuen-now.top", true },
{ "hoiquanadida.com", true },
- { "hoish.in", true },
+ { "hoish.in", false },
{ "hoken-wakaru.jp", true },
{ "hokioisecurity.com", true },
- { "holad.de", true },
+ { "hokung.xyz", true },
{ "holadinero.es", true },
{ "holadinero.mx", true },
{ "holboxwhalesharktours.com", true },
{ "holebedeljek.hu", true },
+ { "holidayacademy.co.uk", true },
{ "holidaysportugal.eu", true },
{ "holisticacupuncture.com.au", true },
{ "holistichealer.in", true },
@@ -17467,7 +18217,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "homatism.com", true },
{ "hombresconestilo.com", true },
{ "home-handymen.co.uk", true },
- { "homeautomated.com", true },
{ "homebasedsalons.com.au", true },
{ "homebodyalberta.com", true },
{ "homecareassociatespa.com", true },
@@ -17476,8 +18225,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "homegardeningforum.com", true },
{ "homegardenresort.nl", true },
{ "homegreenmark.com", true },
- { "homehuntertoronto.com", true },
{ "homeimagician.com.au", true },
+ { "homelabquotes.com", true },
{ "homem-viril.com", true },
{ "homeodynamics.com", true },
{ "homeofjones.net", true },
@@ -17500,7 +18249,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "homophoni.com", true },
{ "hompus.nl", false },
{ "homunyan.com", true },
- { "homyremedies.com", true },
{ "hon-matsuba.co.jp", true },
{ "honda-centrum.cz", true },
{ "hondart.cz", true },
@@ -17515,13 +18263,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hong.io", true },
{ "hongoi.com", true },
{ "honkion.net", true },
+ { "honoka-seitai.jp", true },
{ "honovere.de", true },
{ "hontoir.eu", true },
{ "hoodtrader.com", true },
{ "hoofddorp-centraal.nl", true },
{ "hookany.com", true },
{ "hookbin.com", true },
- { "hoooc.com", true },
+ { "hookupndate.com", true },
{ "hooowl.com", true },
{ "hoop.la", true },
{ "hoopertechnicalsolutions.com", true },
@@ -17535,7 +18284,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hopconseils.ch", true },
{ "hopconseils.com", true },
{ "hope-line-earth.jp", true },
- { "hopemeet.info", true },
+ { "hopecbd.com", true },
{ "hopemeet.me", true },
{ "hopesanddreams.org.uk", true },
{ "hopla.sg", true },
@@ -17554,17 +18303,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "horeco.com", true },
{ "horeizai.net", true },
{ "horizonhomes-samui.com", true },
- { "horizonlawncare.tk", true },
- { "horizonresourcesinc.com", true },
{ "horizonshypnosis.ca", true },
+ { "horizzon.cloud", true },
{ "horn.co", true },
{ "hornertranslations.com", true },
- { "hornyforhanzo.com", true },
{ "horodance.dk", true },
{ "horrell.ca", true },
{ "horrendous-servers.com", true },
{ "horror-forum.de", true },
{ "horrormovies.gr", true },
+ { "horsegateway.com", true },
{ "horsehunter.co.uk", true },
{ "horstmanshof.eu", true },
{ "horton-brasses.com", true },
@@ -17580,6 +18328,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hospitality-colleges.com", true },
{ "hostadvice.com", true },
{ "hostarea51.com", true },
+ { "hostco.nl", true },
{ "hosteasy.nl", false },
{ "hostedcomments.com", true },
{ "hostedtalkgadget.google.com", true },
@@ -17589,6 +18338,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hostinecpodlipou.cz", true },
{ "hosting-swiss.ch", true },
{ "hostingactive.it", true },
+ { "hostingalternative.com", true },
{ "hostinghelp.guru", true },
{ "hostinginnederland.nl", true },
{ "hostinglogin.net", true },
@@ -17597,7 +18347,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hostingsams.com", true },
{ "hostingsolutions.cz", true },
{ "hostix.de", true },
- { "hostma.ma", true },
{ "hostmark.pl", true },
{ "hostme.co.il", true },
{ "hostmijnpagina.nl", true },
@@ -17615,6 +18364,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hotel-le-vaisseau.ch", true },
{ "hotel-pension-sonnalp.eu", true },
{ "hotel-rosner.at", true },
+ { "hotel1926.com.mt", true },
{ "hotelamgarnmarkt.at", false },
{ "hotelarevalo.com", true },
{ "hotelbonacabol.com", true },
@@ -17640,7 +18390,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hotelvalena.com", true },
{ "hotelvillaluisa.de", true },
{ "hothbricks.com", true },
- { "hotjuice.com", true },
{ "hotnewhiphop.com", true },
{ "hoto.us", true },
{ "hoton.in", true },
@@ -17703,13 +18452,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hps.hu", true },
{ "hpsdigital.hu", true },
{ "hqhh.org", true },
- { "hqq.tv", true },
{ "hquest.pro.br", true },
{ "hqwebhosting.tk", false },
- { "hqy.moe", true },
{ "hr-tech.shop", true },
{ "hrabogados.com", true },
{ "hraesvelg.net", true },
+ { "hrafnkellbaldurs.com", true },
{ "hranicka.cz", true },
{ "hrbatypes.cz", true },
{ "hrbl.lc", true },
@@ -17731,7 +18479,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hs-group.net", true },
{ "hs-umformtechnik.de", true },
{ "hsappstatic.net", true },
+ { "hschen.top", false },
{ "hscorp.de", true },
+ { "hsg-kreuzberg.de", true },
{ "hsivonen.com", true },
{ "hsivonen.fi", true },
{ "hsivonen.iki.fi", true },
@@ -17745,6 +18495,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hstspreload.com", true },
{ "hstspreload.de", true },
{ "hstspreload.org", true },
+ { "hsuan.pw", true },
{ "hszemi.de", true },
{ "ht.mk", true },
{ "htaccessbook.com", true },
@@ -17765,6 +18516,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "https-rulesets.org", true },
{ "https.dk", true },
{ "https.jetzt", true },
+ { "https4all.org", true },
{ "httpsalarm.com", true },
{ "httpsecured.net", true },
{ "httpsecurityreport.com", true },
@@ -17782,10 +18534,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hu8777.com", true },
{ "hu8bet.com", true },
{ "hu8hu8.com", true },
+ { "huabianwa.com", true },
{ "huagati.com", true },
{ "huahinpropertylisting.com", true },
{ "hualao.co", true },
- { "huang-haitao.com", true },
{ "huang.nu", true },
{ "huangh.com", true },
{ "huangjia71.com", true },
@@ -17800,9 +18552,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "huangjia99.com", true },
{ "huangjiaint.com", true },
{ "huangjingjing.com", true },
- { "huangliangbo.com", true },
+ { "huangqifu.com", true },
{ "huangzenghao.cn", false },
{ "huaqian.art", true },
+ { "huashan.co.uk", true },
{ "hub.org.ua", true },
{ "hub385.com", true },
{ "hubapi.com", true },
@@ -17826,16 +18579,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "huffsinsurance.com", true },
{ "hughtodd.ink", true },
{ "hugi.is", true },
- { "hugizrecords.com", true },
{ "huglen.info", true },
{ "hugo.pro", true },
{ "hugo6.com", true },
{ "hugofs.com", true },
{ "hugolynx.fr", true },
+ { "hugonote.ml", true },
{ "huguesblanchard.paris", true },
{ "huguesditciles.com", true },
{ "huh.gdn", true },
- { "huh.today", true },
+ { "huh.today", false },
{ "huihui.moe", true },
{ "huininga.com", true },
{ "huininga.nl", true },
@@ -17902,7 +18655,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hundhausen.de", true },
{ "hundter.com", true },
{ "hunger.im", true },
- { "hunqz.com", true },
+ { "huniverse.co", true },
{ "hunstoncanoeclub.co.uk", true },
{ "hunter-read.com", true },
{ "hunter.io", true },
@@ -17913,12 +18666,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "huntshomeinspections.com", false },
{ "huntsmansecurity.com", true },
{ "huntsvillecottage.ca", true },
+ { "huoduan.com", true },
{ "huonit.com.au", true },
{ "hup.hu", true },
- { "hupp.se", true },
{ "hurd.is", true },
{ "huren.nl", true },
- { "hurleyhomestead.com", true },
{ "huroji.com", true },
{ "hurtigtinternet.dk", true },
{ "husakbau.at", true },
@@ -17929,7 +18681,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hussam.eu.org", true },
{ "hustlehope.com", true },
{ "hustunique.com", true },
- { "huto.ml", true },
{ "huurwoordenaar.nl", true },
{ "huutonauru.net", true },
{ "huwcbjones.co.uk", true },
@@ -17966,6 +18717,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hydro17.com", true },
{ "hydroagro.pl", true },
{ "hydrographicsocietybenelux.eu", true },
+ { "hydronicheatingaustralia.com.au", true },
{ "hydroturbine.info", true },
{ "hydrozone.fr", true },
{ "hyec.jp", true },
@@ -17983,6 +18735,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hyperalgesia.com", true },
{ "hyperautomotive.com.au", true },
{ "hyperbolic-mayonnaise-interceptor.ovh", true },
+ { "hyperd.sh", true },
{ "hyperion.io", true },
{ "hyperreal.biz", true },
{ "hypersomnia.com", true },
@@ -17997,11 +18750,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "hypothyroidmom.com", true },
{ "hyr.mn", true },
{ "hysh.jp", true },
+ { "hytale.com", true },
{ "hytzongxuan.com", true },
{ "hyundai.no", true },
{ "hyvanilmankampaamo.fi", true },
{ "hyvanolonterapia.fi", true },
{ "hyvinvointineuvoja.fi", true },
+ { "hyyen.com", true },
{ "hztgzz.com", true },
{ "i--b.com", true },
{ "i-0v0.in", true },
@@ -18023,8 +18778,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "i2gether.org.uk", true },
{ "i5y.co.uk", true },
{ "i5y.org", true },
- { "i66.me", true },
{ "i879.com", true },
+ { "i95.me", false },
{ "i9s.in", true },
{ "ia.cafe", true },
{ "ia.net", true },
@@ -18034,7 +18789,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iaeste.no", true },
{ "iaeste.or.jp", true },
{ "iaf.gov", true },
- { "iahemobile.net", false },
+ { "iahemobile.net", true },
{ "iainsimms.co.uk", true },
{ "iainsimms.com", true },
{ "iainsimms.me", true },
@@ -18067,6 +18822,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iassess.eu", true },
{ "iatfei.com", true },
{ "iavian.com", true },
+ { "iba.community", true },
{ "ibacktraced.it", true },
{ "ibaq.nl", true },
{ "ibauruapan.com.mx", true },
@@ -18078,13 +18834,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ibexcore.com", true },
{ "ibigawamizueco.com", true },
{ "ibin.co", true },
- { "ibiu.xyz", true },
{ "ibiz.mk", true },
{ "iblackfriday.ro", true },
{ "ibodyiq.com", true },
{ "ibps-recruitment.in", true },
{ "ibrainmedicine.org", true },
{ "ibrom.eu", true },
+ { "ibsociety.com", true },
{ "ibstyle.tk", true },
{ "ibuki.run", true },
{ "ibutikk.no", true },
@@ -18098,6 +18854,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "icarlos.net", true },
{ "icasture.top", true },
{ "iccpublisher.com", true },
+ { "icdp.org.ua", true },
{ "ice.xyz", true },
{ "iceberg.academy", true },
{ "icebook.co.uk", true },
@@ -18137,7 +18894,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ict-radar.nl", true },
{ "ictcareer.ch", true },
{ "ictl.eu", true },
+ { "ictoniolopisa.it", true },
{ "ictradar.com", true },
+ { "ictussistemas.com.br", true },
{ "icyapril.com", true },
{ "icymint.me", true },
{ "icynet.eu", true },
@@ -18148,25 +18907,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "id.search.yahoo.com", false },
{ "id0-rsa.pub", true },
{ "id7.fr", true },
- { "idaeus.eu", true },
- { "idafauziyah.com", true },
{ "idahoansforliberty.net", true },
{ "idarv.com", true },
{ "idaspis.com", true },
{ "idatha.de", true },
- { "idblab.tk", true },
{ "idc-business.be", true },
{ "idconsult.nl", true },
+ { "ideal-envelopes.co.uk", false },
+ { "idealcontabilidade.net", true },
{ "idealimplant.com", true },
- { "idealinflatablehire.co.uk", true },
{ "idealninajemce.cz", false },
- { "idealsegurancaeletronica.com.br", false },
+ { "idealsegurancaeletronica.com.br", true },
{ "idealtruss.com", true },
{ "idealtruss.com.tw", true },
{ "idealwhite.space", true },
{ "ideaman924.com", true },
{ "ideasenfoto.com", true },
{ "ideashop.com", true },
+ { "ideatarmac.com", true },
{ "ideaweb.de", true },
{ "idenamaislami.com", true },
{ "idensys.nl", true },
@@ -18175,6 +18933,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "identifyme.net", true },
{ "identigraf.center", true },
{ "identity.plus", true },
+ { "identitytheft.gov", true },
{ "idered.net", true },
{ "idesignstudio.de", true },
{ "idesoft.cloud", true },
@@ -18206,6 +18965,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "idraulico.roma.it", true },
{ "idrinktoomuch.coffee", true },
{ "idrissi.eu", true },
+ { "idroserviceweb.com", true },
{ "idrottsnaprapaten.se", true },
{ "idrycleaningi.com", true },
{ "idtheft.gov", true },
@@ -18220,15 +18980,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ieeesbe.nl", true },
{ "ieeespmb.org", true },
{ "ieffalot.me", true },
- { "ieji.de", true },
+ { "ieji.de", false },
{ "iemb.tk", true },
{ "ienakanote.com", false },
{ "ies-italia.it", true },
{ "iesonline.co.in", true },
{ "ieval.ro", true },
+ { "ifan.ws", true },
{ "ifangpei.cn", true },
{ "ifangpei.com.cn", true },
- { "ifcfg.jp", true },
{ "ifelse.io", true },
{ "ifgcdn.com", true },
{ "ifibe.com", true },
@@ -18240,6 +19000,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ifort.fr", true },
{ "ifosep.fr", true },
{ "ifoss.me", true },
+ { "ifreetion.cn", true },
+ { "ifreetion.com", true },
{ "ifsac.org", true },
{ "ifsclist.com", true },
{ "ifsr.de", true },
@@ -18251,12 +19013,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ig.com", true },
{ "iga-semi.jp", true },
{ "igcc.jp", true },
+ { "igdn.de", true },
{ "igeh-immo.at", true },
{ "igglabs.com", true },
{ "iggprivate.com", true },
{ "iggsoft.com", true },
{ "iggsoftware.com", true },
- { "igiftcards.de", true },
{ "igimusic.com", true },
{ "igk.nz", true },
{ "igm-be.ch", true },
@@ -18274,14 +19036,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "igorrealestate.com", true },
{ "igorw.org", true },
{ "igotoffer.com", false },
+ { "igrarium.com.ua", true },
{ "igrivi.com", true },
{ "igsmgmt.com", true },
{ "iguana.com.ec", false },
+ { "igva.or.kr", true },
{ "ih8sn0w.com", true },
- { "ihacklabs.com", true },
+ { "ihacklabs.com", false },
{ "ihakkitekin.com", true },
+ { "ihc.im", true },
{ "ihcprofile.com", true },
- { "iheartmary.org", true },
{ "ihkk.net", true },
{ "ihls.stream", true },
{ "ihls.world", true },
@@ -18297,13 +19061,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ii74.com", true },
{ "iiit.pl", true },
{ "iimarckus.org", true },
+ { "iinf.in", true },
{ "iiong.com", true },
{ "iirii.com", true },
{ "iix.se", true },
+ { "iiyama-bg.com", true },
{ "ijm.io", true },
{ "ijohan.nl", true },
{ "ijsbaanwitten.nl", true },
{ "ijsblokjesvormen.nl", true },
+ { "ijsclubdwarsgracht.nl", true },
{ "ijsclubtilburg.nl", true },
{ "ijsclubwanneperveen.nl", true },
{ "ijunohana.jp", true },
@@ -18315,19 +19082,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ikebuku.ro", true },
{ "ikebukuro-shame.com", true },
{ "ikedaquotes.org", true },
- { "ikenmeyer.eu", true },
{ "ikespta.com", true },
{ "ikeyless.com", true },
{ "ikigaiweb.com", true },
- { "ikiler.com", true },
{ "ikinokori-marketing.com", true },
{ "ikk.me", true },
+ { "ikkakujuku.work", true },
{ "ikkatsu-satei.jp", true },
{ "ikkbb.de", true },
{ "ikke-coach.nl", true },
{ "ikkev.de", true },
{ "ikkoku.de", true },
{ "iklive.org", false },
+ { "ikmx.net", true },
{ "ikraenglish.com", false },
{ "iktisatbank.com", true },
{ "ikulist.me", true },
@@ -18377,6 +19144,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "illusionunlimited.com", true },
{ "illustrate.biz", true },
{ "illuxat.com", true },
+ { "ilmainensanakirja.fi", true },
{ "ilmataat.ee", true },
{ "ilmiobusinessonline.it", true },
{ "ilmiogiardiniere.it", true },
@@ -18400,11 +19168,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "im4h.info", true },
{ "im66.net", true },
{ "ima-tourcoing.fr", true },
+ { "ima.re", true },
{ "imacs.org", true },
{ "image-drive.de", true },
{ "imagebin.ca", true },
- { "imagecurl.com", true },
- { "imagecurl.org", true },
{ "imagefu.com", true },
{ "imageination.co", true },
{ "imagerive.ch", true },
@@ -18420,11 +19187,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "imanesdeviaje.com", true },
{ "imanolbarba.net", true },
{ "imap2imap.de", true },
+ { "imaple.org", true },
{ "imarkethost.co.uk", true },
{ "imask.ml", true },
{ "imawhale.com", true },
{ "imbianchino.roma.it", true },
{ "imbushuo.net", true },
+ { "imcsi.cn", true },
{ "imcsx.co", true },
{ "imdemos.com", true },
{ "ime.moe", true },
@@ -18445,10 +19214,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "imguploaden.nl", true },
{ "imhua.com", true },
{ "imi-rhapsody.eu", true },
+ { "iminshell.com", false },
{ "imirhil.fr", true },
{ "imitza.com", true },
{ "imjad.cn", true },
{ "imjo.in", true },
+ { "imjustcreative.co.uk", true },
{ "imjustcreative.com", true },
{ "imkerei-freilinger.de", false },
{ "imkerverein-moenchswald.de", true },
@@ -18457,7 +19228,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "immatix.xyz", true },
{ "immersa.co.uk", true },
{ "immersion-pictures.com", true },
- { "immersionwealth.com", true },
{ "immigrantdad.com", true },
{ "immigrationdirect.com.au", true },
{ "immo-agentur.com", false },
@@ -18466,7 +19236,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "immobilien-in-istanbul.de", true },
{ "immobilien-zirm.de", true },
{ "immobiliengutachter-holland.de", true },
- { "immobilier-nice.fr", true },
{ "immobilier92.net", true },
{ "immobiza.com", false },
{ "immortal.run", true },
@@ -18484,6 +19253,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "impendulo.org", true },
{ "impera.at", true },
{ "imperial-legrand.com", true },
+ { "imperialinfosys.com", true },
{ "imperialmiami.com", true },
{ "imperiodigital.online", true },
{ "imperiumglass.com.au", true },
@@ -18509,6 +19279,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "improfestival.ee", true },
{ "improklinikken.dk", true },
{ "improved-madness.de", true },
+ { "improvision.eu", true },
{ "impulsionsa.com", true },
{ "impyus.com", true },
{ "imququ.com", true },
@@ -18518,8 +19289,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ims-sargans.ch", true },
{ "imscompany.com", true },
{ "imtikai.ml", true },
+ { "imtikaib.ml", true },
{ "imwalking.de", true },
{ "imwnk.cn", true },
+ { "imydl.tech", true },
{ "imyjy.cn", true },
{ "imyrs.cn", true },
{ "imyunya.com", true },
@@ -18539,11 +19312,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inbox-group.com", true },
{ "inbox.google.com", true },
{ "inbulgaria.info", true },
+ { "inc.wf", true },
{ "incarna.co", true },
{ "incco.ir", true },
{ "incert.cn", true },
{ "incertint.com", true },
- { "incestporn.tv", true },
{ "inchcape-fleet-autobid.co.uk", true },
{ "inche-ali.com", true },
{ "inchenaim.com", true },
@@ -18566,6 +19339,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "indecipherable.info", true },
{ "independencerecovery.com", true },
{ "independent-operators.com", true },
+ { "independenttravelcats.com", true },
{ "index-mp3.com", true },
{ "indiaflowermall.com", true },
{ "indian-elephant.com", true },
@@ -18573,8 +19347,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "indianaberry.com", true },
{ "indianafoundationpros.com", true },
{ "indianamoldrepairpros.com", true },
- { "indianapolislocksmithinc.com", true },
{ "indianawaterdamagerepairpros.com", true },
+ { "indiansmartpanel.com", true },
{ "indiatrademarkwatch.com", true },
{ "indiayogastudio.net", true },
{ "indicateurs-flash.fr", true },
@@ -18582,8 +19356,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "indiecongdr.it", true },
{ "indiegame.space", true },
{ "indievelopment.nl", true },
- { "indigitalagency.com", true },
{ "indigoinflatables.com", true },
+ { "indigolawnscape.net", true },
{ "indigosakura.com", true },
{ "indigotreeservice.com", true },
{ "indika.pe", true },
@@ -18609,6 +19383,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inesta.nl", true },
{ "inet.se", true },
{ "inethost.eu", true },
+ { "inetpub.cn", true },
{ "inetserver.eu", true },
{ "inetsoftware.de", true },
{ "inf-fusion.ca", true },
@@ -18618,7 +19393,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inffin-portal.de", true },
{ "inffin-tec.de", true },
{ "inficom.org", true },
- { "infinite.hosting", true },
{ "infinitegroup.info", true },
{ "infinitescript.com", true },
{ "infinitiofallentownparts.com", true },
@@ -18627,7 +19401,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "infinitomaisum.com", true },
{ "infinitybas.com", true },
{ "infinitybc.se", true },
- { "infinityengine.org", true },
{ "infinityepos.co.uk", true },
{ "infirmiere-canadienne.com", true },
{ "infirmieredevie.ch", true },
@@ -18635,10 +19408,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inflatablesny.com", true },
{ "inflatadays.co.uk", true },
{ "inflatamania.com", true },
+ { "inflated.cloud", true },
{ "inflationstation.net", true },
{ "inflexsys.com", true },
{ "influo.com", true },
- { "infmed.com", true },
{ "info-beamer.com", true },
{ "info-d-74.com", true },
{ "info-screen-usercontent.me", true },
@@ -18646,7 +19419,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "info-screw.com", true },
{ "infobae.com", true },
{ "infobrain.net", true },
- { "infocity-tech.fr", true },
+ { "infocoin.es", true },
{ "infocommsociety.com", true },
{ "infocon.org", true },
{ "infocusvr.net", true },
@@ -18672,6 +19445,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "infosec.pizza", true },
{ "infosec.wiki", true },
{ "infosectalks.com", true },
+ { "infosectekniques.com", true },
{ "infosenior.ch", true },
{ "infotainworld.com", true },
{ "infotolium.com", false },
@@ -18680,17 +19454,32 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "infovision-france.com", true },
{ "infoweb.ee", true },
{ "infra.land", true },
- { "infra.press", true },
+ { "infraball.com", true },
{ "infrabeep.com", true },
+ { "infrabeta.com", true },
+ { "infrabold.com", true },
+ { "infraboom.com", true },
{ "infraclass.com", true },
+ { "infraclip.com", true },
+ { "infracron.com", true },
+ { "infradart.com", true },
+ { "infradisk.com", true },
{ "infradrop.com", true },
{ "infrafire.com", true },
{ "infraflip.com", true },
{ "infraflux.com", true },
+ { "infrafuse.com", true },
{ "infrafusion.com", true },
+ { "infralira.com", true },
{ "infralist.com", true },
+ { "infraloon.com", true },
+ { "inframake.com", true },
+ { "inframeet.com", true },
+ { "inframenu.com", true },
{ "inframetro.com", true },
{ "inframint.com", true },
+ { "infraname.com", true },
+ { "infranest.com", true },
{ "infranium.com", true },
{ "infranium.eu", true },
{ "infranium.info", true },
@@ -18708,12 +19497,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "infrarank.net", true },
{ "infraspin.com", true },
{ "infratank.com", true },
+ { "infratask.com", true },
{ "infrathink.com", true },
+ { "infratrip.com", true },
+ { "infravibe.com", true },
{ "infravideo.com", true },
{ "infrazine.com", true },
{ "infruction.com", true },
{ "infuzeit.com.au", true },
- { "ing-buero-junk.de", true },
{ "ingatlanjogaszok.hu", true },
{ "ingatlanneked.hu", true },
{ "ingatlanrobot.hu", true },
@@ -18730,6 +19521,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ingolonde.pw", true },
{ "ingoschlueter.de", true },
{ "ingredientdaddy.ro", true },
+ { "ingridbai.me", true },
{ "inhaltsangabe.de", true },
{ "inheritestate.com", true },
{ "inhouseents.co.uk", true },
@@ -18739,11 +19531,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inishbofin.ie", true },
{ "initq.net", true },
{ "initramfs.io", true },
- { "initrd.net", true },
{ "inixal.com", true },
+ { "injigo.com", false },
+ { "injurylawyer.com", true },
{ "ink.horse", true },
{ "inkable.com.au", true },
- { "inkbunny.net", false },
{ "inkeliz.com", true },
{ "inkhor.se", true },
{ "inkontriamoci.com", true },
@@ -18757,7 +19549,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inmatefinancial.com", true },
{ "inmateintake.com", true },
{ "inmobillium.fr", true },
- { "inmoodforsex.com", true },
{ "inmusrv.de", true },
{ "innerfence.com", true },
{ "innerlightcrystals.co.uk", true },
@@ -18780,13 +19571,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "innovation-workshop.ro", true },
{ "innovation.gov", false },
{ "innover.se", true },
+ { "innovere.co.uk", true },
{ "innovum.cz", false },
{ "innsalzachsingles.de", true },
{ "innwan.com", true },
{ "inoa8.com", true },
{ "inobun.jp", true },
- { "inovat.ma", true },
{ "inovatecsystems.com", true },
+ { "inoxandco.com", true },
+ { "inoxdesign.fr", true },
+ { "inoxdesign.pro", true },
+ { "inoxmavang.net", true },
{ "inpas.co.uk", true },
{ "inputmag.com", true },
{ "inquant.de", true },
@@ -18809,7 +19604,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "insidebedroom.com", true },
{ "insidesolutions.nl", true },
{ "insidethefirewall.tk", true },
- { "insightera.co.th", true },
+ { "insighti.org", true },
+ { "insighti.sk", true },
{ "insignificant.space", true },
{ "insinuator.net", true },
{ "insistel.com", true },
@@ -18817,17 +19613,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "insolent.ch", true },
{ "insolved.com", true },
{ "insping.com", true },
+ { "inspiratienodig.nl", true },
{ "inspired-lua.org", true },
+ { "inspiredlife.fun", true },
{ "inspiredrealtyinc.com", true },
{ "insrt.uk", true },
{ "insside.net", true },
{ "instafind.nl", true },
+ { "instafuckfriend.com", true },
{ "instagram-atom.appspot.com", true },
{ "instagrammernews.com", true },
{ "instagramtweet.com", true },
+ { "instahub.net", true },
{ "installatietechniekgresnigt.nl", true },
{ "installgentoo.net", true },
{ "instamojo.com", true },
+ { "instant-clearance-sale.co.uk", true },
{ "instant-thinking.de", true },
{ "instant.io", true },
{ "instantkhabar.com", true },
@@ -18839,13 +19640,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "instela.com", true },
{ "instelikes.com.br", true },
{ "instics.com", true },
- { "instinctive.io", true },
{ "instinctiveads.com", true },
{ "institut-confucius-montpellier.org", true },
{ "institutmaupertuis.hopto.org", true },
{ "institutogiuseppe.com", true },
{ "institutogiuseppe.com.ar", true },
- { "institutolancaster.com", true },
+ { "institutomaritimocolombiano.com", true },
{ "instrumart.ru", false },
{ "insult.es", true },
{ "insurance321.com", true },
@@ -18859,6 +19659,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "intasky.sk", true },
{ "integralblue.com", true },
{ "integralkk.com", true },
+ { "integrata.de", true },
{ "integratedintegrations.xyz", true },
{ "integratedmedicalonline.com", true },
{ "integrateur-web-paris.com", true },
@@ -18888,21 +19689,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "intensifyrsvp.com.au", true },
{ "inter-corporate.com", true },
{ "inter-culinarium.com", true },
+ { "interabbit.com", true },
{ "interaffairs.com", true },
{ "interaktiva.fi", true },
{ "interasistmen.se", true },
{ "interchangedesign.com", true },
{ "intercom.com", true },
{ "intercom.io", true },
+ { "interessengemeinschaft-pregelstrasse.tk", true },
{ "interessiert-uns.net", true },
{ "interflores.com.br", true },
{ "interfug.de", true },
{ "intergozd.si", true },
- { "interguard.net", true },
{ "interiery-waters.cz", true },
{ "interimages.fr", true },
{ "interior-design-colleges.com", true },
- { "interiordesignsconcept.com", true },
{ "interiorprofesional.com.ar", true },
{ "interisaudit.com", true },
{ "interlijn.nl", true },
@@ -18917,6 +19718,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "international-nash-day.com", true },
{ "internationalfashionjobs.com", true },
{ "internationalschool.it", true },
+ { "internationalstudentassociation.com", true },
{ "internationaltalento.it", true },
{ "internect.co.za", true },
{ "internet-aukcion.info", true },
@@ -18928,6 +19730,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "internetbusiness-howto.com", true },
{ "internetcom.jp", true },
{ "internetfonden.se", true },
+ { "internetgardener.co.uk", true },
{ "internethealthreport.org", true },
{ "internethering.de", true },
{ "internetinhetbuitengebied.nl", true },
@@ -18943,7 +19746,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "interpol.gov", true },
{ "interracial.dating", true },
{ "interseller.io", true },
- { "interserved.com", false },
{ "interstateautomotiveinc.com", true },
{ "intertime.services", true },
{ "interview-suite.com", true },
@@ -18954,6 +19756,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "intita.com", true },
{ "intl-webs.com", true },
{ "intmissioncenter.org", true },
+ { "into.technology", true },
{ "intocities.de", false },
{ "inton.biz", true },
{ "intoparking.com", false },
@@ -18965,9 +19768,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "intraobes.com", true },
{ "intrasoft.com.au", true },
{ "intraxia.com", true },
- { "intrigue3d.com", true },
+ { "intropickup.ru", true },
{ "intrp.net", true },
- { "intune.life", true },
{ "intvonline.com", true },
{ "intxt.net", true },
{ "inumcoeli.com.br", true },
@@ -18987,10 +19789,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "inventtheworld.com.au", true },
{ "inventum.cloud", true },
{ "inverselink-user-content.com", true },
- { "inversioneseconomicas.com", true },
{ "investarholding.nl", true },
{ "investigatore.it", true },
{ "investigazionimoretti.it", true },
+ { "investinturkey.com.tr", true },
{ "investir.ch", true },
{ "investor-academy.jp", true },
{ "investor.gov", true },
@@ -19087,8 +19889,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iprcenter.gov", true },
{ "ipresent.com", true },
{ "iprim.ru", true },
+ { "ipripojeni.cz", true },
{ "iproducemusic.com", true },
{ "ipsec.pl", true },
+ { "ipso.paris", true },
{ "ipssl.li", true },
{ "ipstream.it", true },
{ "ipswitch.com.tw", true },
@@ -19132,14 +19936,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "irish.radio", true },
{ "irishradioplayer.radio", true },
{ "irisjieun.com", true },
+ { "irismq.fr", true },
{ "irkfap.com", true },
{ "irland-firma.com", true },
+ { "irlfp.com", true },
{ "irmag.ru", true },
{ "irmgard-woelfle.de", true },
{ "irmgardkoch.com", true },
{ "iro-iro.xyz", true },
+ { "irodorinet.com", true },
{ "iroise.ch", true },
- { "ironbelly.pro", true },
{ "ironcarnival.com", true },
{ "ironfistdesign.com", true },
{ "ironhide.de", true },
@@ -19150,9 +19956,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iruca.co", true },
{ "is-going-to-rickroll.me", true },
{ "is-sw.net", true },
- { "isaacdgoodman.com", true },
+ { "isaac.world", true },
+ { "isaacdgoodman.com", false },
{ "isaackhor.com", true },
{ "isaacman.tech", true },
+ { "isaacmorneau.com", true },
{ "isaacpartnership.co.uk", true },
{ "isaacpartnership.com", true },
{ "isaacphysics.org", true },
@@ -19165,6 +19973,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "isamiok.com", true },
{ "isara.com", true },
{ "isarklinikum.de", true },
+ { "isaropiping.fr", true },
{ "isastylish.com", true },
{ "isavings.com", true },
{ "isayoga.de", true },
@@ -19175,15 +19984,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iscert.org", true },
{ "isdn.jp", true },
{ "isecrets.se", true },
+ { "iservicio.com.mx", true },
{ "iservicio.mx", true },
- { "iseulde.com", true },
{ "isg-tech.com", true },
{ "isgp-studies.com", true },
{ "ishamf.com", true },
{ "ishangirdhar.com", true },
{ "ishiharaken.com", true },
+ { "ishland.com", true },
{ "ishome.org", true },
{ "ishtarfreya.com", true },
+ { "isif-ostewg.org", true },
{ "isil.fi", true },
{ "isimonbrown.co.uk", true },
{ "isincheck.com", true },
@@ -19193,6 +20004,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "isitchristmas.com", true },
{ "isitcoffeetime.com", true },
{ "isitdoneyet.gov", true },
+ { "isitef.com", true },
{ "isitpatchtuesday.com", true },
{ "isitrest.info", true },
{ "isitup.org", true },
@@ -19201,7 +20013,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iskaz.rs", true },
{ "iskogen.nu", true },
{ "islam.si", true },
- { "islamonline.net", true },
+ { "islamicmarkets.com", true },
{ "islandhosting.com", true },
{ "islavolcan.cl", true },
{ "isletech.net", true },
@@ -19216,6 +20028,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ismywebsitepenalized.com", true },
{ "isn.cz", true },
{ "iso27032.com", true },
+ { "isocom.eu", true },
{ "isognattori.com", true },
{ "isolta.com", true },
{ "isolta.de", true },
@@ -19223,7 +20036,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "isolta.fi", true },
{ "isolta.lv", true },
{ "isolta.se", true },
- { "isondo.com", true },
{ "isonet.fr", true },
{ "isopres.de", true },
{ "isotope.gov", true },
@@ -19266,6 +20078,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "istschonsolangeinrente.de", true },
{ "istsi.org", true },
{ "isuzupartscenter.com", true },
+ { "isv.online", true },
{ "isvbscriptdead.com", true },
{ "isvsecwatch.org", true },
{ "isyu.xyz", true },
@@ -19276,6 +20089,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "it-faul.de", true },
{ "it-fernau.com", true },
{ "it-jobbank.dk", true },
+ { "it-kron.de", true },
{ "it-maker.eu", true },
{ "it-rotter.de", true },
{ "it-schamans.de", true },
@@ -19295,7 +20109,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "it-tekniker.nu", true },
{ "it-ti.me", true },
{ "it-uws.com", true },
- { "it-world.eu", true },
{ "it.search.yahoo.com", false },
{ "it1b.com", true },
{ "itactiq.com", true },
@@ -19316,6 +20129,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "itbox.cl", true },
{ "itchy.nl", true },
{ "itcko.sk", true },
+ { "itcs.services", true },
{ "itdashboard.gov", true },
{ "itecor.net", true },
{ "iteecafe.hu", true },
@@ -19328,8 +20142,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "itesign.de", true },
{ "itfh.eu", true },
{ "itfix.cz", true },
+ { "itfly.xyz", true },
{ "itforge.nl", true },
- { "itgirls.rs", true },
{ "ithakama.cz", true },
{ "ithenrik.com", true },
{ "ithinc.net", true },
@@ -19361,6 +20175,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "itruth.tk", true },
{ "its-future.com", true },
{ "its-gutachten.de", true },
+ { "its420somewhere.com", true },
+ { "its4living.com", true },
{ "itsabouncything.com", true },
{ "itsanicedoor.co.uk", true },
{ "itsasaja.com", true },
@@ -19370,6 +20186,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "itsdcdn.com", true },
{ "itsecblog.de", true },
{ "itsecguy.com", true },
+ { "itseeze.com", true },
{ "itsense.fr", true },
{ "itsevident.com", true },
{ "itsgoingdown.org", true },
@@ -19399,17 +20216,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ivaoru.org", true },
{ "ivfausland.de", true },
{ "ivfmeds.com", true },
- { "ivi.com.ar", false },
- { "ivi.es", false },
- { "ivi.mx", false },
{ "ivig.com.br", true },
- { "ivinet.cl", false },
{ "ivo.co.za", true },
{ "ivopetkov.com", true },
{ "ivor.io", true },
{ "ivor.is", true },
{ "ivorvanhese.com", true },
{ "ivorvanhese.nl", true },
+ { "ivotemahdi.com", true },
{ "ivpn.net", true },
{ "ivre.rocks", true },
{ "ivsign.net", true },
@@ -19424,6 +20238,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "iwanttoliveinabunker.com", true },
{ "iwanttrack.com", true },
{ "iwascoding.com", true },
+ { "iwascoding.de", true },
{ "iwatchcops.com", true },
{ "iwatchcops.org", true },
{ "iwch.tk", true },
@@ -19445,10 +20260,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ixquick.nl", true },
{ "iyassu.com", true },
{ "iyinolaashafa.com", true },
+ { "iyn.me", true },
{ "iyouewo.com", true },
{ "iyuanbao.net", true },
{ "iz8mbw.net", true },
- { "izaakbeekman.com", true },
+ { "izanah.com", true },
{ "izevg.ru", true },
{ "izhaojie.com", true },
{ "izodiacsigns.com", true },
@@ -19457,23 +20273,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "izzys.casa", true },
{ "j-elliott.co.uk", true },
{ "j-navi.com", true },
+ { "j-robertson.com", true },
{ "j0bs.org", true },
+ { "j0e.com", true },
{ "j0m.de", true },
{ "j0s.at", true },
{ "j0s.eu", true },
{ "j15h.nu", true },
{ "j2h.de", true },
{ "j3e.de", true },
+ { "j5lx.de", true },
+ { "j5lx.eu", true },
+ { "j5lx.io", true },
{ "ja-dyck.de", true },
{ "ja-gps.com.au", true },
- { "ja.md", true },
{ "jaakkohannikainen.fi", true },
{ "jaalits.com", true },
{ "jaarvistech.com", true },
{ "jaba.hosting", true },
{ "jababu.cz", true },
{ "jabbari.io", true },
- { "jabbas.eu", true },
{ "jabber.at", true },
{ "jabberfr.org", true },
{ "jabbers.one", true },
@@ -19484,28 +20303,32 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jaccblog.com", true },
{ "jacekowski.org", true },
{ "jacik.cz", true },
- { "jack2celebrities.com", true },
{ "jackassofalltrades.org", true },
{ "jackdawphoto.co.uk", true },
{ "jackdelik.de", true },
{ "jackf.me", true },
+ { "jackgreenrealty.com", true },
{ "jackhoodtransportation.com", true },
{ "jackingramnissanparts.com", true },
{ "jackpothappy.com", true },
+ { "jacksanalytics.com", true },
{ "jackson-quon.com", true },
{ "jackson.jp", true },
{ "jacksonhu.com", true },
{ "jacksonvillestation.com", true },
{ "jacksorrell.com", true },
{ "jacksutton.info", true },
+ { "jackwozny.com", true },
+ { "jackyliao.me", true },
{ "jackyliao123.tk", true },
+ { "jackyyf.com", false },
{ "jacobamunch.com", true },
{ "jacobdevans.com", true },
{ "jacobhaug.com", false },
{ "jacobi-server.de", true },
{ "jacobian.org", true },
{ "jacobjangles.com", true },
- { "jacobphono.com", true },
+ { "jacobs-implantate.at", true },
{ "jacuzziprozone.com", true },
{ "jadchaar.me", true },
{ "jadopado.com", true },
@@ -19522,10 +20345,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jahofmann.de", false },
{ "jailbreakingisnotacrime.org", true },
{ "jaion.xyz", true },
- { "jaispirit.com", false },
+ { "jaispirit.com", true },
{ "jaitnetworking.com", false },
{ "jajsemjachym.cz", true },
- { "jak-na-les.cz", true },
{ "jakarta.dating", true },
{ "jakdelatseo.cz", true },
{ "jake.eu.org", true },
@@ -19535,6 +20357,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jakecurtis.de", true },
{ "jakereynolds.co", true },
{ "jakerullman.com", true },
+ { "jaketremper.com", true },
+ { "jakewalker.xyz", true },
{ "jakewestrip.com", true },
{ "jakob-server.tk", true },
{ "jakobejitblokaci.cz", true },
@@ -19563,6 +20387,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jameschorlton.co.uk", true },
{ "jamesclark.com", true },
{ "jamesdorf.com", true },
+ { "jamesedition.com", true },
{ "jamesgreenfield.com", true },
{ "jameshemmings.co.uk", true },
{ "jameshost.net", true },
@@ -19571,12 +20396,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jamesjboyer.com", true },
{ "jamesmarsh.net", true },
{ "jamesmilazzo.com", true },
+ { "jamesmorrison.me", true },
{ "jamesmurphy.com.au", false },
{ "jamesrobertson.io", true },
{ "jamesrobertson.net", true },
{ "jamesross.name", true },
{ "jamesrussellward.co.uk", true },
{ "jamessmith.me.uk", true },
+ { "jamestmartin.me", true },
{ "jamesturnerstickley.com", true },
{ "jameswarp.com", true },
{ "jamhost.org", true },
@@ -19589,7 +20416,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jamieweb.net", true },
{ "jamieweb.org", true },
{ "jamiewebb.net", true },
- { "jamjestsimon.pl", true },
{ "jammucake.com", true },
{ "jammysplodgers.co.uk", true },
{ "jamon.ca", true },
@@ -19606,7 +20432,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "janaundgeorgsagenja.eu", true },
{ "janbrodda.de", true },
{ "jandev.de", true },
- { "janduchene.ch", true },
{ "jane.com", true },
{ "janehamelgardendesign.co.uk", true },
{ "janelauhomes.com", true },
@@ -19638,12 +20463,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "japangids.nl", true },
{ "japaniac.de", false },
{ "japanphilosophy.com", false },
- { "japansm.com", true },
{ "japanwatches.xyz", true },
{ "japon-japan.com", true },
{ "jar.io", true },
{ "jardin-exotique-rennes.fr", true },
- { "jardinderline.ch", true },
{ "jardineriaon.com", true },
{ "jardiniersduminotaure.fr", true },
{ "jaredeberle.org", false },
@@ -19653,6 +20476,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jarniashop.se", true },
{ "jaroku.com", true },
{ "jarondl.net", true },
+ { "jarrah-alsilawi.com", true },
+ { "jarrettgraham.com", true },
{ "jarroba.com", true },
{ "jas-team.net", true },
{ "jashvaidya.com", true },
@@ -19665,21 +20490,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jasonmili.online", true },
{ "jasonsplecoscichlids.com", true },
{ "jasper.link", true },
- { "jasperhammink.com", true },
{ "jasperhuttenmedia.com", true },
{ "jasperpatterson.me", true },
{ "jaszbereny-vechta.eu", true },
{ "javalestari.com", true },
{ "javamilk.com", true },
- { "javfree.me", true },
+ { "javi.pro", true },
{ "javierburgos.net", true },
{ "javierlorente.es", true },
{ "jaxfstk.com", true },
{ "jaxxnet.co.uk", true },
{ "jaxxnet.org", true },
+ { "jaybrokers.com", true },
{ "jaycouture.com", true },
{ "jayf.de", true },
- { "jayfreestone.com", true },
+ { "jayfreestone.com", false },
{ "jaymecd.rocks", true },
{ "jaypandit.me", true },
{ "jayrl.com", true },
@@ -19691,7 +20516,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jazz-alliance.com", true },
{ "jazz-alliance.org", true },
{ "jazzanet.com", true },
- { "jazzfeet.co.uk", true },
{ "jazzncheese.com", true },
{ "jazzy-feet.com", true },
{ "jazzy.id.au", true },
@@ -19708,9 +20532,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jcb.com", true },
{ "jcbgolfandcountryclub.com", true },
{ "jci.cc", true },
+ { "jcit.xyz", true },
{ "jclynne.com", true },
{ "jcsesecuneta.com", true },
{ "jctf.team", true },
+ { "jcus.co", true },
{ "jcwodan.nl", true },
{ "jd-group.co.uk", true },
{ "jd1.de", true },
@@ -19723,6 +20549,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jdjohnsonmedia.com", true },
{ "jdjohnsonwaterproofing.com", true },
{ "jdm.elk.pl", true },
+ { "jdm.pl", true },
{ "jdncr.com", true },
{ "jdoi.pw", true },
{ "jdoiron.me", true },
@@ -19754,7 +20581,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jeeran.com", true },
{ "jeeranservices.com", true },
{ "jeff.forsale", true },
- { "jeffcasavant.com", false },
{ "jeffcloninger.net", true },
{ "jeffersonregan.co.uk", true },
{ "jeffersonregan.com", true },
@@ -19767,8 +20593,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jeffsanders.com", true },
{ "jefftickle.com", true },
{ "jeffwebb.com", true },
- { "jefrydco.id", true },
{ "jefsweden.eu", true },
+ { "jehovahsays.net", true },
{ "jej.cz", true },
{ "jej.sk", true },
{ "jekhar.com", true },
@@ -19793,9 +20619,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jemangeducheval.com", true },
{ "jembatankarir.com", true },
{ "jemefaisdesamis.com", true },
+ { "jemigjordy.nl", true },
+ { "jennethaarfotografie.nl", true },
{ "jennierobinson.com", true },
{ "jenniferengerwingaantrouwen.nl", true },
- { "jennifermason.eu", true },
{ "jennifersauer.nl", true },
{ "jennythebaker.com", true },
{ "jenolson.net", true },
@@ -19812,12 +20639,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jeremycantu.com", true },
{ "jeremycrews.com", true },
{ "jeremynally.com", true },
+ { "jeremyness.com", true },
{ "jeremypaul.me", true },
{ "jeremytcd.com", true },
{ "jericamacmillan.com", true },
{ "jering.tech", true },
{ "jeroendeneef.com", true },
{ "jerret.de", true },
+ { "jerrysretailstores.com", true },
{ "jerryweb.org", true },
{ "jerryyu.ca", true },
{ "jerseybikehire.co.uk", true },
@@ -19842,13 +20671,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jetsetboyz.net", true },
{ "jetsieswerda.nl", true },
{ "jettlarue.com", true },
- { "jettravel.com.mt", false },
{ "jetwhiz.com", true },
{ "jeuxetcodes.fr", true },
{ "jeweet.net", true },
{ "jewishboyscouts.com", true },
{ "jewishquotations.com", true },
- { "jexler.net", true },
{ "jfbst.net", true },
{ "jfr.im", true },
{ "jfreitag.de", true },
@@ -19868,11 +20695,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jhservicos.net.br", true },
{ "jhuang.me", true },
{ "jhwestover.com", true },
+ { "ji0vwl.net", true },
{ "jiahao.codes", true },
{ "jiangxu.site", true },
{ "jianji.de", true },
{ "jianny.me", true },
{ "jianshu.com", true },
+ { "jianwei.wang", true },
{ "jianyuan.pro", true },
{ "jiatingtrading.com", true },
{ "jicaivvip.com", true },
@@ -19882,6 +20711,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jimbraaten.com", true },
{ "jimbutlerkiaparts.com", true },
{ "jimdorf.com", true },
+ { "jime-hlavou.cz", true },
{ "jimfranke.com", true },
{ "jimfranke.nl", true },
{ "jimizhou.xyz", true },
@@ -19906,6 +20736,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jirosworld.com", true },
{ "jisai.net.cn", true },
{ "jisha.site", true },
+ { "jix.im", true },
{ "jixun.moe", true },
{ "jiyue.com", true },
{ "jiyue.moe", true },
@@ -19924,17 +20755,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jkchocolate.com", true },
{ "jki.io", true },
{ "jkinteriorspa.com", true },
- { "jkirsche.com", true },
{ "jkrippen.com", true },
- { "jl-dns.eu", true },
- { "jl-dns.nl", true },
- { "jl-exchange.nl", true },
- { "jl-mail.nl", true },
{ "jlink.nl", true },
{ "jlkhosting.com", true },
{ "jloh.codes", true },
- { "jlpn.eu", true },
- { "jlpn.nl", true },
{ "jlponsetto.com", true },
{ "jlr-luxembourg.com", true },
{ "jltctech.com", true },
@@ -19954,7 +20778,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jmfjltd.com", true },
{ "jmk.hu", true },
{ "jmorahan.net", true },
- { "jmoreau.ddns.net", true },
{ "jmpb.hu", true },
{ "jmsolodesigns.com", true },
{ "jmssg.jp", true },
@@ -19962,11 +20785,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jnm-art.com", true },
{ "jnordell.com", true },
{ "joa-ebert.com", true },
- { "joacimeldre.com", true },
{ "joanofarcmtcarmel.org", true },
{ "joaoaugusto.net", true },
{ "joaosampaio.com.br", true },
- { "joaquimgoliveira.pt", true },
{ "job-ofertas.info", true },
{ "job.biz.tr", true },
{ "jobatus.com.br", true },
@@ -19990,7 +20811,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jobs4sales.ch", true },
{ "jobseekeritalia.it", true },
{ "jobsisbrown.com", true },
- { "jobsnet.eu", true },
{ "jobsuchmaschine.ch", true },
{ "jobwinner.ch", true },
{ "jobzninja.com", true },
@@ -20025,14 +20845,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "joemotherfuckingjohnson.com", true },
{ "joepitt.co.uk", false },
{ "joergschneider.com", true },
- { "joerosca.com", true },
{ "joerss.at", true },
+ { "joeseago.com", true },
{ "joeskup.com", true },
+ { "joesniderman.com", true },
{ "joespaintingpgh.com", true },
- { "joestead.codes", true },
+ { "joestead.codes", false },
{ "joetsutj.com", true },
{ "joetyson.me", true },
- { "joeyfelix.com", true },
{ "joeygitalian.com", true },
{ "joeyhoer.com", true },
{ "joeysmith.com", true },
@@ -20060,7 +20880,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "johncook.ltd.uk", true },
{ "johndball.com", true },
{ "johnfulgenzi.com", true },
+ { "johngadenne.com.au", true },
{ "johngallias.com", true },
+ { "johngo.tk", false },
{ "johnguant.com", true },
{ "johnhgaunt.com", true },
{ "johnkastler.net", true },
@@ -20074,7 +20896,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "johnroach.io", true },
{ "johnroberts.me", true },
{ "johnrockefeller.net", true },
- { "johnsanchez.io", true },
{ "johnsegovia.com", true },
{ "johnsiu.com", true },
{ "johnsonho.net", true },
@@ -20086,7 +20907,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "joinus-outfits.nl", true },
{ "jojosplaycentreandcafeteria.co.uk", true },
{ "jokedalderup.nl", true },
- { "joker.menu", true },
{ "jokerice.co.uk", true },
{ "jokesbykids.com", true },
{ "jokewignand.nl", true },
@@ -20104,6 +20924,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jonandnoraswedding.com", true },
{ "jonas-thelemann.de", true },
{ "jonas-wenk.de", false },
+ { "jonas.me", true },
{ "jonaskjodt.com", true },
{ "jonasled.de", true },
{ "jonaswitmer.ch", true },
@@ -20112,6 +20933,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jonathanha.as", true },
{ "jonathanj.nl", true },
{ "jonathanlara.com", true },
+ { "jonathanreyes.com", false },
{ "jonathanschle.de", true },
{ "jonathanscott.me", true },
{ "jonathanselea.se", false },
@@ -20142,6 +20964,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jooksuratas.ee", true },
{ "joomlant.org", true },
{ "joompress.biz", true },
+ { "joona.pw", true },
{ "joonatoona.me", true },
{ "joostrijneveld.nl", true },
{ "joostvanderlaan.nl", true },
@@ -20153,13 +20976,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jordanhamilton.me", true },
{ "jordankmportal.com", true },
{ "jordans.co.uk", true },
- { "jordanscorporatelaw.com", true },
{ "jordanstrustcompany.com", true },
{ "jordhy.com", true },
+ { "jordiescudero.com", true },
{ "jorexenterprise.com", true },
{ "jorgerosales.org", true },
{ "jorisdalderup.nl", true },
{ "jornalalerta.com.br", true },
+ { "jorsev.com", true },
{ "josc.com.au", true },
{ "joscares.com", true },
{ "jose-alexand.re", true },
@@ -20169,6 +20993,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "josefjanosec.com", true },
{ "josefottosson.se", true },
{ "joseitoda.org", true },
+ { "josemikkola.fi", true },
{ "josepbel.com", true },
{ "josephbleroy.com", true },
{ "josephgeorge.com.au", true },
@@ -20202,14 +21027,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jovic.hamburg", true },
{ "joyful.house", true },
{ "joyfulexpressions.gallery", true },
+ { "joyfulhealthyeats.com", true },
{ "joynadvisors.com", true },
{ "joyofcookingandbaking.com", true },
+ { "joyqi.com", true },
{ "joysinventingblog.com", true },
{ "jpbe-network.de", true },
{ "jpbe.de", true },
{ "jpdeharenne.be", true },
{ "jpeg.io", true },
- { "jpgangbang.com", true },
{ "jphandjob.com", true },
{ "jplesbian.com", true },
{ "jpmelos.com", true },
@@ -20229,15 +21055,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jr5proxdoug.xyz", true },
{ "jrabasco.me", true },
{ "jrc9.ca", true },
+ { "jrchaseify.xyz", true },
{ "jreb.nl", true },
- { "jreinert.com", true },
{ "jrflorian.com", true },
- { "jrlopezoficial.com", true },
{ "jross.me", true },
{ "jrtapsell.co.uk", true },
{ "jrxpress.com", true },
{ "js-web.eu", true },
- { "js3311.com", true },
{ "js8855.com", true },
{ "jschoi.org", true },
{ "jschumacher.info", true },
@@ -20245,6 +21069,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jsdelivr.com", true },
{ "jselby.net", true },
{ "jsent.co.uk", true },
+ { "jsevilleja.org", true },
{ "jskier.com", false },
{ "jskoelliken.ch", true },
{ "jsmetallerie.fr", true },
@@ -20252,7 +21077,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jsnfwlr.io", true },
{ "jsonsinc.com", true },
{ "jsteward.moe", true },
+ { "jstore.ch", true },
+ { "jsvr.tk", false },
{ "jtcat.com", true },
+ { "jtcjewelry.com", true },
{ "jtconsultancy.sg", true },
{ "jthackery.com", false },
{ "jtl-software.com", true },
@@ -20272,17 +21100,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jucca-nautica.si", true },
{ "juch.cc", true },
{ "juchit.at", true },
+ { "jucktehkeinen.de", true },
{ "judc-ge.ch", true },
{ "judge2020.com", true },
{ "judge2020.me", true },
{ "judoprodeti.cz", true },
{ "judosaintdenis.fr", true },
- { "judytka.cz", true },
{ "juef.space", true },
{ "juegosycodigos.es", true },
{ "juegosycodigos.mx", true },
{ "juegosyolimpicos.com", true },
- { "juelda.com", true },
{ "juergen-elbert.de", true },
{ "juergen-roehrig.de", true },
{ "juergenhecht.de", true },
@@ -20299,6 +21126,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "juku-wing.jp", true },
{ "jule-spil.dk", true },
{ "julenlanda.com", false },
+ { "julestern.com", true },
{ "julian-uphoff.de", true },
{ "julian-weigle.de", true },
{ "juliangonggrijp.com", true },
@@ -20324,6 +21152,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "julienschmidt.com", true },
{ "julientartarin.com", true },
{ "julius-zoellner.de", true },
+ { "jullensgroningen.com", true },
+ { "julm.de", true },
{ "juls.cloud", true },
{ "jultube.de", true },
{ "jumbopan.net", true },
@@ -20337,7 +21167,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jumparoundbouncycastles.co.uk", true },
{ "jumparty.co.uk", true },
{ "jumpeasy.com.au", true },
- { "jumperoos.co.uk", true },
{ "jumpin-jax.co.uk", true },
{ "jumpinchat.com", true },
{ "jumpingbee.co.uk", true },
@@ -20364,6 +21193,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "junjun-web.net", true },
{ "junkdrome.org", true },
{ "juno.co.uk", true },
+ { "junoaroma.com", true },
{ "junodownload.com", true },
{ "jura-reiseschutz.de", true },
{ "jurassicbarkharrogate.co.uk", true },
@@ -20371,8 +21201,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "juridoc.com.br", true },
{ "jurijbuga.de", true },
{ "jurriaan.ninja", true },
- { "just-a-clanpage.de", true },
+ { "jusos-goettingen.de", true },
{ "just-vet-and-drive.fr", true },
+ { "just-webdesign-berlin.de", true },
{ "justanothercompany.name", true },
{ "justbelieverecoverypa.com", true },
{ "justbookexcursions.com", true },
@@ -20386,6 +21217,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "justice.gov", true },
{ "justice4assange.com", true },
{ "justin-tech.com", true },
+ { "justinfreid.com", true },
{ "justinharrison.ca", false },
{ "justinho.com", true },
{ "justinmuturifoundation.org", true },
@@ -20396,11 +21228,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "justpaste.it", true },
{ "justsmart.io", true },
{ "justsome.info", true },
- { "justtalk.site", true },
{ "justthinktwice.gov", false },
{ "justupdate.me", true },
{ "justyy.com", true },
{ "juszkiewicz.com.pl", true },
+ { "jutella.de", false },
{ "jutlander-netbank.dk", true },
{ "jutlander.dk", true },
{ "juttaheitland.com", true },
@@ -20417,21 +21249,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "jvwdev.nl", true },
{ "jwatt.org", true },
{ "jwe.nl", true },
+ { "jwhite.network", true },
{ "jwilsson.com", true },
{ "jwjwjw.com", true },
{ "jwmmarketing.com", true },
{ "jwnotifier.org", true },
{ "jwod.gov", true },
{ "jwplay.ml", true },
+ { "jwpoore.com", true },
{ "jwschuepfheim.ch", true },
- { "jwsoft.nl", true },
+ { "jwybk.ml", true },
+ { "jwz.org", true },
{ "jxir.de", true },
+ { "jxkangyifu.com", true },
{ "jxltom.com", true },
{ "jxm.in", true },
{ "jydemarked.dk", true },
{ "jyggen.com", true },
{ "jym.fit", true },
{ "jyoti-fairworks.org", true },
+ { "jz585.com", true },
{ "jzbk.org", true },
{ "k-bone.com", true },
{ "k-homes.net", true },
@@ -20439,10 +21276,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "k-pan.com", true },
{ "k-plant.com", true },
{ "k-pture.com", true },
- { "k-scr.me", true },
{ "k-system.de", true },
{ "k-tube.com", true },
{ "k1024.org", true },
+ { "k1yoshi.com", true },
{ "k258059.net", true },
{ "k2mts.org", true },
{ "k33k00.com", false },
@@ -20456,7 +21293,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "k9swx.com", true },
{ "kaamoscreations.com", true },
{ "kaangenc.me", true },
- { "kaany.io", true },
{ "kaasbesteld.nl", true },
{ "kaatha-kamrater.se", true },
{ "kab-s.de", true },
@@ -20487,6 +21323,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kaikei7.com", true },
{ "kaileymslusser.com", true },
{ "kairion.de", false },
+ { "kairostecnologia.com.br", true },
{ "kaisakura.net", true },
{ "kaisev.net", false },
{ "kaitol.click", true },
@@ -20503,6 +21340,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kakolightingmuseum.or.jp", true },
{ "kalakarclub.com", true },
{ "kalamos-psychiatrie.be", true },
+ { "kalashcards.com", true },
{ "kalastus.com", true },
{ "kaleidoscope.co.uk", true },
{ "kalender.com", true },
@@ -20516,14 +21354,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kalmar.com", true },
{ "kalolina.com", true },
{ "kalombo.ru", true },
- { "kalsbouncies.com", true },
{ "kaltenbrunner.it", true },
{ "kalterersee.ch", true },
+ { "kalugadeti.ru", true },
{ "kalwestelectric.com", true },
{ "kalyanmatka.guru", true },
{ "kam-serwis.pl", true },
{ "kamata-shinkyu-seikotsu.jp", true },
{ "kameari-za.space", true },
+ { "kamen-master.ru", true },
{ "kamikaichimaru.com", false },
{ "kamilki.me", true },
{ "kaminbau-laub.de", true },
@@ -20569,19 +21408,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kanzakiranko.jp", false },
{ "kanzashi.com", true },
{ "kanzlei-gaengler.de", true },
- { "kanzlei-myca.de", true },
{ "kanzlei-oehler.com", true },
{ "kanzlei-sixt.de", true },
{ "kap-genial.de", true },
{ "kap.pe", true },
{ "kapgy-moto.com", true },
- { "kaplatzis.com", true },
{ "kappenstein.org", false },
{ "kapseli.net", true },
{ "kaptadata.com", true },
{ "kaptamedia.com", true },
- { "kara-fabian.com", true },
- { "kara-fabian.de", true },
{ "karabas.com", true },
{ "karabijnhaken.nl", false },
{ "karachi.dating", true },
@@ -20591,6 +21426,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "karasik.by", true },
{ "karateka.org", true },
{ "karateka.ru", true },
+ { "karatekit.co.uk", true },
{ "kardize24.pl", true },
{ "kardolocksmith.com", true },
{ "karewan.ovh", true },
@@ -20620,12 +21456,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "karta-paliwowa.pl", true },
{ "kartacha.com", true },
{ "kartar.net", false },
- { "kartatopia.com", true },
{ "kartec.com", true },
{ "karten-verlag.de", true },
{ "kartonmodellbau.org", true },
{ "karula.org", true },
{ "karupp-did.net", true },
+ { "kasadara.com", true },
{ "kasei.im", true },
{ "kashinavi.com", true },
{ "kashmirobserver.net", true },
@@ -20661,7 +21497,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "katscastles.co.uk", true },
{ "kattelans.eu", true },
{ "katyl.info", false },
- { "katyusha.net", false },
+ { "katyusha.net", true },
{ "katzenbrunnen-test.de", true },
{ "katzensklave.me", true },
{ "katzrkool.xyz", true },
@@ -20674,7 +21510,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kawaiii.link", true },
{ "kaweus.de", true },
{ "kay.la", true },
+ { "kayo.digital", true },
{ "kayscs.com", true },
+ { "kaysis.gov.tr", false },
{ "kazakov.lt", true },
{ "kazancci.com", true },
{ "kazand.lt", true },
@@ -20687,6 +21525,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kazumi.ro", true },
{ "kazy111.info", true },
{ "kb3.net", true },
+ { "kb88.com", true },
{ "kba-online.de", true },
{ "kbb-ev.de", true },
{ "kbbouncycastlehire.co.uk", true },
@@ -20733,12 +21572,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "keepersecurity.com", true },
{ "keepingtheplot.co.uk", true },
{ "keepiteasy.eu", true },
+ { "keepitsecure24.com", true },
{ "keepsight.org.au", true },
{ "keevitaja.com", true },
{ "keeweb.info", true },
{ "keezin.ga", true },
{ "keganthorrez.com", true },
{ "kehlenbach.net", true },
+ { "keian.tk", true },
{ "keifel.de", true },
{ "kein-design.de", true },
{ "keinanung.nl", true },
@@ -20748,10 +21589,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "keithlomax.com", true },
{ "keithws.net", true },
{ "keke-shop.ch", true },
- { "kekgame.com", true },
{ "kekku.li", true },
{ "keksi.io", true },
{ "kela.jp", true },
+ { "kelantanmudah.com", false },
{ "keldan.fo", true },
{ "kelderwijnen.nl", true },
{ "kelgtermans-usedcars.be", true },
@@ -20776,6 +21617,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kengilmour.com", true },
{ "kenguntokku.jp", true },
{ "kenia-vakantie.nl", true },
+ { "kennedyinsurancesolutions.com", true },
{ "kenners.org", true },
{ "kennethaasan.no", true },
{ "kennethferguson.com", true },
@@ -20793,7 +21635,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kentec.net", true },
{ "kenterlis.gr", true },
{ "kenvix.com", true },
- { "kenx5.eu.org", true },
{ "kenyons.info", true },
{ "keops-spine.fr", true },
{ "keops-spine.us", true },
@@ -20829,13 +21670,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kevin-darmor.eu", true },
{ "kevin-ta.com", true },
{ "kevinapease.com", true },
- { "kevinbowers.me", true },
{ "kevinbusse.de", true },
{ "kevincox.ca", false },
+ { "kevindienst.blog", true },
{ "kevinfoley.cc", true },
{ "kevinfoley.org", true },
{ "kevingsky.com", true },
- { "kevinhill.nl", true },
{ "kevinhq.com", true },
{ "kevinkla.es", true },
{ "kevinlocke.name", true },
@@ -20884,8 +21724,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kheshtar.pl", true },
{ "khetzal.info", true },
{ "khipu.com", true },
- { "khlee.net", true },
- { "khmb.ru", false },
+ { "khmb.ru", true },
{ "khoury-dulla.ch", true },
{ "khs1994.com", true },
{ "khslaw.com", true },
@@ -20897,6 +21736,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kiapartscenter.net", true },
{ "kiapartsdepartment.com", true },
{ "kiapps.ovh", true },
+ { "kiarayoga.com", true },
+ { "kiasystems.com", true },
{ "kibea.net", true },
{ "kibibit.net", true },
{ "kibriscicek.net", true },
@@ -20928,25 +21769,29 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kiehls.pt", true },
{ "kiekin.org", true },
{ "kiekko.pro", true },
- { "kiel-kind.de", true },
+ { "kieran.de", true },
+ { "kieran.ie", true },
+ { "kieranjones.uk", true },
{ "kiesuwkerstkaart.nl", true },
{ "kiffmarks.com", true },
{ "kigmbh.com", true },
- { "kiisu.club", true },
+ { "kii91.com", true },
{ "kikbb.com", true },
{ "kiki-voice.jp", true },
+ { "kiknudes.co", true },
{ "kiku.pw", true },
+ { "kileahh.fr", true },
{ "kilianvalkhof.com", true },
{ "killaraapartments.com.au", true },
{ "killdeer.com", true },
{ "killedbynlp.com", true },
+ { "killerit.in", true },
{ "killerkink.net", true },
{ "killerrobots.com", true },
{ "killymoonbouncycastles.com", true },
{ "kilobyte22.de", true },
{ "kilogram.nl", true },
{ "kilometertje.nl", true },
- { "kimamass.com", true },
{ "kimbal.co.uk", true },
{ "kimdumaine.com", true },
{ "kimiris.com", true },
@@ -20961,6 +21806,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kin.life", true },
{ "kin.pet", true },
{ "kinautas.com", true },
+ { "kinderarzt-berlin-zia.de", true },
{ "kinderbasar-luhe.de", true },
{ "kinderchor-bayreuth.de", true },
{ "kinderjugendfreizeitverein.de", true },
@@ -20971,6 +21817,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kindfotografie.nl", true },
{ "kindlezs.com", true },
{ "kine-duthil.fr", true },
+ { "kinecle.com", true },
{ "kinepolis-studio.be", true },
{ "kinerd.me", true },
{ "kinesiomed-cryosauna.gr", true },
@@ -20994,7 +21841,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kini24.ru", true },
{ "kinkcafe.net", true },
{ "kinkenonline.com", true },
- { "kinnikinnick.com", true },
+ { "kinkyhookup.com", true },
+ { "kinmunity.com", true },
{ "kinniyaonlus.com", true },
{ "kinocheck.de", true },
{ "kinohled.cz", true },
@@ -21011,24 +21859,27 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kipa.at", true },
{ "kipiradio.com", true },
{ "kippenbart.gq", true },
+ { "kipsu.com", true },
{ "kiragameforum.net", true },
{ "kiraku.co", true },
{ "kirbear.com", true },
- { "kirche-dortmund-ost.de", true },
{ "kirchen-im-web.de", false },
{ "kirchengemeinde-markt-erlbach.de", true },
+ { "kirchhoff-getraenke.de", true },
{ "kircp.com", true },
{ "kirei.se", true },
{ "kirig.ph", true },
{ "kirikira.moe", true },
- { "kirill.ws", true },
{ "kirillaristov.com", true },
+ { "kirillpokrovsky.de", false },
{ "kirinas.com", true },
{ "kirinuki.jp", true },
{ "kirkforcongress.com", true },
{ "kirkforillinois.com", true },
{ "kirkify.com", true },
{ "kirkovsky.com", true },
+ { "kirkwoodfence.com", true },
+ { "kiropraktorvard.se", true },
{ "kirrie.pe.kr", true },
{ "kirsch-gestaltung.de", true },
{ "kirschbaum.me", true },
@@ -21037,15 +21888,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kirstin-peters.de", true },
{ "kirwandigital.com", true },
{ "kisallatorvos.hu", true },
- { "kisalt.im", true },
{ "kisel.org", true },
{ "kisiselveri.com", true },
{ "kiskeedeesailing.com", true },
{ "kisma.de", true },
{ "kissflow.com", true },
{ "kissgyms.com", true },
- { "kisskiss.ch", true },
{ "kissmycreative.com", true },
+ { "kissoft.ro", true },
{ "kisun.co.jp", false },
{ "kitabnamabayi.com", true },
{ "kitacoffee.com", true },
@@ -21062,6 +21912,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kiteschoolschellinkhout.nl", true },
{ "kiteschoolwijkaanzee.nl", true },
{ "kiteschoolzandvoort.nl", true },
+ { "kitsapsolutions.com", true },
{ "kittmedia.com", true },
{ "kittpress.com", true },
{ "kittyhacker101.tk", true },
@@ -21070,7 +21921,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kiwi.com", true },
{ "kiwi.digital", true },
{ "kiwi.wiki", true },
+ { "kiwihub.org", true },
+ { "kix.moe", true },
{ "kiyotatsu.com", true },
+ { "kizomba.info", true },
+ { "kizzycode.de", true },
{ "kj-prince.com", true },
{ "kjaer.io", true },
{ "kjarni.cc", true },
@@ -21079,16 +21934,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kjellner.com", true },
{ "kjelltitulaer.com", true },
{ "kjellvn.net", true },
+ { "kjnotes.com", true },
{ "kk-neudorf-duissern.de", false },
+ { "kk.in.th", true },
{ "kki.org", true },
{ "kkovacs.eu", true },
{ "kkr-bridal.net", true },
- { "kkren.me", true },
{ "kks-karlstadt.de", true },
{ "kksg.com", true },
{ "kkyy.me", true },
{ "kkzxak47.com", true },
{ "kl-diaetist.dk", true },
+ { "kl008888.com", true },
{ "klaasmeijerbodems.nl", true },
{ "klaim.us", true },
{ "klamathrestoration.gov", true },
@@ -21114,6 +21971,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kleine-strandburg-heringsdorf.de", true },
{ "kleine-strandburg.com", true },
{ "kleine-strolche-lich.de", true },
+ { "kleine-viecherei.de", true },
{ "kleineanfragen.de", true },
{ "kleinestrandburg-heringsdorf.de", true },
{ "kleinestrandburg-usedom.de", true },
@@ -21126,7 +21984,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "klemkow.org", true },
{ "kleppe.co", true },
{ "kleteckova.cz", true },
- { "klicke-gemeinsames.de", true },
{ "klickstdu.com", true },
{ "kliemann.me", true },
{ "klif1.nl", true },
@@ -21144,6 +22001,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "klocker-ausserlechner.com", true },
{ "klocksnack.se", true },
{ "kloia.com", true },
+ { "klop.info", true },
{ "klose.family", true },
{ "klosko.net", true },
{ "kloudboy.com", true },
@@ -21188,21 +22046,25 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "knmv.nl", true },
{ "knnet.ch", true },
{ "knockendarroch.co.uk", true },
+ { "knoji.com", true },
{ "knop.info", true },
{ "knot-store.com", true },
{ "knowarth.com", true },
{ "knowledgeforce.com", true },
+ { "knowledgehook.com", true },
{ "knowlevillagecc.co.uk", true },
{ "knowyourday.ai", true },
{ "knthost.com", true },
{ "knurps.de", true },
{ "knuthildebrandt.de", true },
+ { "knutur.is", true },
{ "knygos.lt", true },
{ "ko-sys.com", true },
{ "ko.si", true },
{ "koalapress.fr", true },
{ "koalas.org", true },
{ "kobejet.com", true },
+ { "kobezda.net", true },
{ "kobofarm.com", true },
{ "kobolya.hu", true },
{ "kocherev.org", true },
@@ -21219,6 +22081,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "koe.hn", true },
{ "koebbes.de", true },
{ "koecollege.com", true },
+ { "koeeusa.org", true },
{ "koelnmafia.de", true },
{ "koenigsbrunner-tafel.de", true },
{ "koenleemans.nl", true },
@@ -21232,7 +22095,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kofler.info", true },
{ "kogak.ninja", true },
{ "kogax.com", true },
- { "kogcoder.com", true },
{ "kogi.fr", true },
{ "kogro.de", true },
{ "kogudesi.com", true },
@@ -21241,24 +22103,25 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kohlistkool.tk", true },
{ "koho.fi", true },
{ "kohoutsautomotive.com", true },
+ { "kohparadise.com", true },
{ "kohsandra.com", true },
{ "kohu.nz", true },
{ "koi-lexikon.de", true },
- { "koi-sama.net", true },
{ "koicenter-thuine.de", true },
{ "koifish.org", true },
{ "koirala.email", true },
+ { "kojip.com", true },
{ "koka-shop.de", true },
{ "kokensupport.com", true },
{ "koketteriet.se", true },
{ "kokobaba.com", true },
{ "kokona.ch", true },
+ { "kokoushuvila.fi", true },
{ "kokumoto.com", true },
{ "kolania.de", true },
{ "kolania.net", true },
{ "kolbeinsson.se", true },
{ "kolcsey.eu", true },
- { "koldanews.com", true },
{ "kolin.org", true },
{ "kolizaskrap.bg", true },
{ "kolja-engelmann.de", true },
@@ -21268,7 +22131,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kollega.it", true },
{ "kolmann.at", true },
{ "kolmann.eu", true },
- { "kolonie-am-stadtpark.de", true },
{ "kolorbon.com", true },
{ "kolpingsfamilie-vechta-maria-frieden.de", true },
{ "koluke.co", true },
@@ -21287,17 +22149,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "komischkeszeug.de", true },
{ "kommaer.dk", true },
{ "kommune42.org", true },
+ { "komodolabs.com", true },
{ "komoju.com", true },
{ "komok.co.uk", true },
+ { "komp247.pl", true },
{ "kompetenzkurs.de", true },
{ "komplet.sk", true },
{ "kon-sil.de", true },
{ "kondi.net", true },
{ "kondou-butsudan.com", true },
{ "kongar.org", true },
+ { "kongress-hostessen.de", true },
{ "kongsecuritydata.com", true },
{ "koniecfica.sk", true },
{ "konijntjes.nl", true },
+ { "konings.it", false },
{ "koningskwartiertje.nl", true },
{ "koninkrijk.net", true },
{ "konklone.com", true },
@@ -21323,11 +22189,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kooliveeb.ee", true },
{ "kooponline.eu", true },
{ "koot.nl", true },
+ { "kooxdiving.com", true },
{ "koozal.de", true },
- { "kopfkrieg.org", true },
+ { "kopfkrieg.org", false },
{ "kopfundseele.de", true },
{ "kopjethee.nl", true },
{ "koplancpa.com", true },
+ { "kopplin.family", true },
{ "koptev.ru", true },
{ "kopteva.ru", true },
{ "korben.info", true },
@@ -21337,8 +22205,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "koretech.nl", true },
{ "korinar.com", true },
{ "kornrunner.net", true },
- { "korobi.io", true },
- { "korobkovsky.ru", true },
+ { "korobkovsky.ru", false },
{ "koroknaimedical.hu", true },
{ "korono.de", true },
{ "korosiprogram.hu", true },
@@ -21352,6 +22219,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "koscielniak-nieruchomosci.pl", true },
{ "kosherjava.com", true },
{ "kosho.org", true },
+ { "kosinc.org", true },
+ { "kosmos.org.tw", true },
{ "kosonaudioteca.com", true },
{ "kost-magazin.de", true },
{ "kostal.com", false },
@@ -21379,12 +22248,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kovals.sk", true },
{ "kovehitus.ee", true },
{ "kovspace.com", true },
- { "kowalmik.tk", true },
{ "kowalstwo.com.pl", true },
{ "kowarschick.de", true },
{ "kowshiksundararajan.com", true },
{ "koyaanis.com", true },
{ "koyo.kr", true },
+ { "kozawa.tokyo", true },
{ "kozuch.biz", true },
{ "kpfanworld.com", true },
{ "kpforme.org", true },
@@ -21393,6 +22262,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kplnet.net", true },
{ "kpop.re", true },
{ "kpumuk.info", true },
+ { "kpx1.de", true },
{ "kr.search.yahoo.com", false },
{ "kr0n.dk", true },
{ "krachtinverbinding.nl", true },
@@ -21404,7 +22274,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "krag.be", true },
{ "kraga.sk", true },
{ "kraiwan.com", true },
- { "kraiwon.com", true },
{ "kraken.io", true },
{ "kraken.site", true },
{ "kralik.io", true },
@@ -21417,7 +22286,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kramsj.uk", true },
{ "krang.org.uk", true },
{ "krankenpflege-haushaltshilfe.de", true },
- { "kranz.space", true },
+ { "krant.nl", true },
+ { "kranz.space", false },
{ "krasnodar-avia.ru", true },
{ "krasovsky.me", true },
{ "krautomat.com", true },
@@ -21462,12 +22332,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kristinbailey.com", false },
{ "kristofba.ch", true },
{ "kristofdv.be", true },
+ { "kritikawebu.cz", true },
{ "kritikos.io", true },
{ "krizevci.info", true },
{ "krmeni.cz", false },
+ { "kroell.net", true },
{ "krokedil.se", true },
{ "kromamoveis.com.br", true },
- { "kromonos.net", true },
+ { "kromonos.net", false },
{ "krony.de", true },
{ "kroon.email", true },
{ "kropkait.pl", true },
@@ -21484,11 +22356,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kruselegal.com.au", true },
{ "krusesec.com", true },
{ "krutka.cz", true },
- { "kruu.de", true },
{ "kruzhki-s-kartinkami.ru", true },
{ "kry.no", true },
{ "kry.se", true },
{ "kryglik.com", true },
+ { "krypmonet.com", true },
{ "krypsys.com", true },
{ "krypt.com", true },
{ "kryptera.se", true },
@@ -21502,12 +22374,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kselenia.ee", true },
{ "ksero.center", true },
{ "ksero.wroclaw.pl", true },
- { "ksham.net", true },
{ "kshlm.in", true },
{ "ksmmmo.org.tr", true },
+ { "ksopp.si", true },
{ "kspg.tv", true },
{ "kssk.de", true },
{ "ksukelife.com", true },
+ { "kt-events.de", true },
{ "kt-zoe.com", true },
{ "ktbnetbank.com", true },
{ "kthnxbai.xyz", true },
@@ -21523,9 +22396,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kualo.co.uk", true },
{ "kualo.com", true },
{ "kualo.in", true },
+ { "kuanta.net", true },
{ "kuaza.com", true },
{ "kub.hr", true },
{ "kubica.ch", true },
+ { "kubierecki.pl", true },
{ "kubik-rubik.de", false },
{ "kubkprf.ru", true },
{ "kublis.ch", true },
@@ -21535,14 +22410,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kucnibudzet.com", true },
{ "kucukayvaz.com", true },
{ "kudo.co.id", true },
- { "kueche-co.de", false },
{ "kuechenprofi-group.de", false },
+ { "kuechenserver.de", true },
+ { "kuechenserver.org", true },
{ "kuehnel-bs.de", true },
{ "kuehnel-online.eu", true },
{ "kuehnel.org", false },
{ "kuemmerlin.eu", true },
{ "kuemmling.eu", true },
- { "kugelblitz.co", true },
{ "kuhn-elektrotechnik.de", true },
{ "kuhne-electronic.de", true },
{ "kuhnelautorepair.com", true },
@@ -21553,12 +22428,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kulde.net", true },
{ "kulickovy-pojezd.cz", true },
{ "kulivps.com", true },
- { "kum.com", true },
{ "kuma.es", true },
{ "kumachan.biz", true },
{ "kumalog.com", true },
{ "kumasanda.jp", true },
{ "kumilasvegas.com", true },
+ { "kunaldesai.blog", true },
{ "kundenerreichen.com", true },
{ "kundenerreichen.de", true },
{ "kungerkueken.de", true },
@@ -21568,10 +22443,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kuoruan.com", true },
{ "kupaa.ink", true },
{ "kupferstichshop.com", true },
+ { "kupiclub.com", true },
{ "kupid.com", true },
{ "kupiec.eu.org", true },
{ "kupimlot.ru", true },
{ "kupinska.pl", true },
+ { "kupleno.com", true },
{ "kuponrazzi.com", true },
{ "kuponydoher.cz", true },
{ "kupschke.net", true },
@@ -21580,11 +22457,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kurofuku.me", true },
{ "kuroha.co.uk", true },
{ "kuroinu.jp", true },
+ { "kuroisalva.xyz", false },
{ "kurona.ga", true },
{ "kuronekogaro.com", true },
{ "kurschies.de", true },
{ "kurserne.dk", true },
{ "kurswahl-online.de", true },
+ { "kurszielnull.de", true },
{ "kurtschlatzer.com", true },
{ "kuruppa.xyz", true },
{ "kuschku.de", true },
@@ -21597,6 +22476,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kuttler.eu", true },
{ "kutukupret.com", true },
{ "kutus.ee", true },
+ { "kuunlamaailm.ee", true },
{ "kuzbass-pwl.ru", true },
{ "kvadratnimeter.si", true },
{ "kvalita-1a.cz", true },
@@ -21604,7 +22484,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kvalitnitesneni.cz", true },
{ "kvantel.no", true },
{ "kvcc.com.au", true },
- { "kvestmaster.ru", true },
{ "kvetinymilt.cz", true },
{ "kvhile.com", true },
{ "kvilt.dk", true },
@@ -21625,14 +22504,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "kxnrl.com", true },
{ "kxway.com", true },
{ "kybi.sk", true },
+ { "kybqp.com", true },
+ { "kybqp.net", true },
{ "kydara.com", true },
{ "kyledrake.net", true },
{ "kylegutschow.com", true },
- { "kylejohnson.io", true },
{ "kylelaker.com", true },
{ "kylinj.com", false },
{ "kynastonwedding.co.uk", true },
- { "kyobostory-events.com", true },
{ "kyosaku.org", true },
{ "kyoto-k9.com", false },
{ "kyoto-mic.com", true },
@@ -21650,7 +22529,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "l-lab.org", true },
{ "l0re.com", true },
{ "l17r.eu", true },
- { "l2guru.ru", true },
{ "l3.ee", true },
{ "l33te.net", true },
{ "l3j.net", true },
@@ -21679,9 +22557,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "labcenter.com", true },
{ "labcoat.jp", true },
{ "labeled.vn", true },
- { "labms.com.au", true },
{ "labobooks.com", true },
- { "laboitebio-logique.ca", true },
{ "labortogether.com", true },
{ "labouncycastlehire.co.uk", true },
{ "labourreedevergheas.fr", true },
@@ -21714,10 +22590,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lacocinadelila.com", true },
{ "lacoquette.gr", true },
{ "lacyc3.eu", true },
- { "ladbroke.net", true },
+ { "ladbroke.net", false },
{ "ladenzeile.at", true },
{ "ladenzeile.de", true },
- { "ladislavbrezovnik.com", true },
+ { "lado.ltd", true },
+ { "ladotech.cn", true },
+ { "ladotech.com", true },
{ "ladraiglaan.com", true },
{ "lady-2.jp", true },
{ "ladyanna.de", true },
@@ -21728,6 +22606,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lafayette-rushford.com", true },
{ "lafcheta.info", true },
{ "lafema.de", true },
+ { "lafermegourmande.fr", true },
{ "lafillepolyvalente.ca", true },
{ "lafillepolyvalente.com", true },
{ "lafka.org", true },
@@ -21740,9 +22619,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "laglab.org", false },
{ "lagout.org", true },
{ "lagriffeduservice.fr", true },
+ { "lagsoftware.com", true },
{ "laguiadelvaron.com", true },
{ "laguinguette.fr", true },
{ "lagunacoastrealestate.com", true },
+ { "lagunakitchenandbath.com", true },
{ "lahipotesisgaia.com", true },
{ "lahnau-akustik.de", true },
{ "lahora.com.ec", true },
@@ -21754,11 +22635,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lak-berlin.de", true },
{ "lakarwebb.se", true },
{ "lakedavid.com.au", true },
- { "lakehavasucityhomebuyerscredit.com", true },
{ "lakehavasucitynews.com", true },
- { "lakehavasuhomebuyercredit.com", true },
- { "lakehavasuhomes.info", true },
- { "lakehavasuhouses.com", true },
{ "lakehavasuwebsites.com", true },
{ "lakelandbank.com", true },
{ "lakeoswegotowncar.com", true },
@@ -21771,7 +22648,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lakesherwoodoutdoorlighting.com", true },
{ "lakeshowlife.com", true },
{ "lakewoodcityglass.com", true },
- { "lakhesis.net", true },
{ "lakkt.de", true },
{ "lakonia.com.br", true },
{ "lalalab.com", true },
@@ -21779,11 +22655,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "laled.ch", true },
{ "lalingua.ir", true },
{ "lalucioledigitale.com", true },
+ { "lalunaonlinebr.com", true },
{ "lalunecreative.com", true },
{ "lalyre-corcelles.ch", true },
{ "lamakat.de", true },
{ "lamapoll.de", true },
{ "lamarieealhonneur.com", false },
+ { "lambangcapgiare.com", true },
{ "lambauer.com", true },
{ "lambdaof.xyz", true },
{ "lambertshealthcare.co.uk", true },
@@ -21807,12 +22685,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lampenwelt.at", true },
{ "lampenwelt.ch", true },
{ "lampenwelt.de", true },
+ { "lampl.info", false },
{ "lampposthomeschool.com", true },
{ "lampsh.ml", true },
{ "lampy.pl", true },
{ "lamunyon.com", true },
{ "lan.biz.tr", true },
- { "lana.swedbank.se", true },
{ "lanahallen.com", true },
{ "lanbroa.eu", true },
{ "lancashirecca.org.uk", true },
@@ -21868,17 +22746,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "langzijn.nl", true },
{ "lanna.io", true },
{ "lannainnovation.com", true },
+ { "lannamontessori.com", true },
+ { "lannatefl.com", true },
{ "lanodan.eu", true },
{ "lanostrasalute.it", true },
{ "lanre.org", true },
{ "lanroamer.de", true },
{ "lansechensilu.com", true },
+ { "lansewu.com", true },
{ "lanternalauth.com", true },
{ "lanternhealth.org", true },
{ "lantian.pub", true },
{ "lanturtle.com", true },
{ "lanuovariviera.it", true },
- { "lanyang.tk", true },
{ "lanzamientovirtual.es", true },
{ "lanzarote-online.info", true },
{ "laos.dating", true },
@@ -21895,10 +22775,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lapotagere.ch", true },
{ "lapparente-aise.ch", true },
{ "lappari.com", true },
+ { "lapshore.com", true },
{ "lara.photography", true },
{ "larabergmann.de", true },
{ "laracode.eu", true },
{ "laraeph.com", true },
+ { "laraigneedusoir.com", true },
{ "laranara.se", true },
{ "laranjada.org", true },
{ "laraveldirectory.com", true },
@@ -21906,6 +22788,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "larbertbaptist.org", true },
{ "lareclame.fr", true },
{ "larepublicacultural.es", true },
+ { "lares.com", true },
{ "largescaleforums.com", true },
{ "largeviewer.com", true },
{ "lariposte.org", true },
@@ -21921,7 +22804,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lars-mense.de", true },
{ "lars.cloud", true },
{ "lars.moi", true },
- { "larsbauer.xyz", true },
{ "larsklene.nl", true },
{ "larsklint.com", true },
{ "laruga.co.uk", true },
@@ -21931,12 +22813,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lasavonnerieducroisic.fr", true },
{ "lascana.co.uk", true },
{ "lasereyess.net", true },
+ { "laserhealthsolutions.com", true },
{ "laserpc.net", true },
{ "laserplaza.de", true },
{ "laserplaza.net", true },
{ "lasertechsolutions.com", true },
{ "lask.in", true },
{ "laskas.pl", true },
+ { "lasowy.com", true },
{ "laspequenassemillas.com", true },
{ "lasrecetascocina.com", true },
{ "lasrecetasdeguada.com", true },
@@ -21963,12 +22847,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "latenitefilms.com", false },
{ "lateral.dog", true },
{ "lateralsecurity.com", true },
- { "latestbuy.com.au", true },
{ "latestdeals.co.uk", true },
{ "latiendauno.com", true },
{ "latiendawapa.com", true },
{ "latinmusicrecords.com", true },
{ "latino.dating", true },
+ { "latinphone.com", true },
{ "latintoy.com", true },
{ "latitudesign.com", true },
{ "latremebunda.com", true },
@@ -21983,6 +22867,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "laughinggrapepublishing.com", true },
{ "laukstein.com", true },
{ "launayflorian.net", true },
+ { "launcher-minecraft.com", true },
{ "launchkey.com", false },
{ "launchmylifend.com", true },
{ "launchpad-app2.com", true },
@@ -22009,7 +22894,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lavalite.de", true },
{ "lavamob.com", true },
{ "lavanderia.roma.it", true },
- { "lavasing.eu.org", true },
{ "lavaux.lv", true },
{ "lavenderx.org", true },
{ "laviedalex.ovh", true },
@@ -22018,15 +22902,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lavita.de", true },
{ "lavitaura.com", true },
{ "lavitrine-une-collection.be", true },
+ { "lavka-konditera.com", true },
{ "lavoieducoeur.be", true },
{ "lavoiepharmd.com", true },
{ "lavolte.net", true },
+ { "lavril.fr", true },
{ "law-colleges.com", true },
{ "law-peters.de", true },
{ "law.co.il", true },
{ "law22.com", true },
{ "lawbirduk.com", true },
- { "lawformt.com", true },
{ "lawn-seeds.com", true },
{ "lawnuk.com", true },
{ "lawrenceberg.nl", true },
@@ -22034,9 +22919,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lawrencewhiteside.com", true },
{ "lawyerdigital.co.bw", true },
{ "lawyerkf.com", true },
+ { "layazc.com", true },
{ "laylo.io", false },
{ "laylo.nl", false },
+ { "layordesign.co.uk", true },
{ "layoutsatzunddruck.de", true },
+ { "lazau.com", true },
{ "lazistance.com", true },
{ "lazowik.pl", true },
{ "lazyboston.com", true },
@@ -22053,6 +22941,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lbmblaasmuziek.nl", true },
{ "lbphacker.pw", true },
{ "lbs-logics.com", true },
+ { "lbsistemas.com.mx", true },
{ "lbux.org", true },
{ "lc-cs.com", false },
{ "lc-promiss.de", true },
@@ -22071,7 +22960,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ldjb.jp", true },
{ "ldsun.com", true },
{ "le-bar.org", true },
- { "le-blog.ch", true },
{ "le-controle-parental.fr", true },
{ "le-creux-du-van.ch", true },
{ "le-dev.de", false },
@@ -22098,13 +22986,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "leafandseed.co.uk", true },
{ "leafans.tk", false },
{ "leafinote.com", true },
+ { "leafland.co.nz", true },
{ "leakforums.net", true },
{ "leamsigc.com", true },
{ "leandre.cn", true },
{ "leankit.com", true },
{ "leanplando.com", true },
{ "leap-it.be", true },
- { "leapandjump.co.uk", true },
{ "learndev.info", true },
{ "learnflakes.net", true },
{ "learnforestry.com", true },
@@ -22115,6 +23003,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "learnlux.com", true },
{ "learnpianogreece.com", true },
{ "learnplayground.com", true },
+ { "learnthetruth.tk", true },
+ { "learntotradethemarket.com", true },
{ "learntube.cz", true },
{ "leaseit24.com", true },
{ "leaseit24.de", true },
@@ -22127,7 +23017,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "leatherwood.nl", true },
{ "leavesofchangeweekly.org", true },
{ "lebanesearmy.gov.lb", true },
- { "lebarbatruc.com", true },
{ "lebarmy.gov.lb", true },
{ "lebendige-heilkunst.de", true },
{ "lebens-fluss.at", true },
@@ -22168,34 +23057,38 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lefebvristes.fr", true },
{ "leflibustier.ru", true },
{ "lefonddeloeil.com", true },
+ { "left-baggage.co.uk", true },
{ "leftclick.cloud", true },
{ "leftclick.eu", true },
{ "lega-dental.com", true },
- { "legacy.bank", true },
+ { "legabot.fr", true },
{ "legadental.com", true },
{ "legaillart.fr", true },
{ "legalcontrol.info", true },
{ "legaldesk.com", true },
+ { "legalforms.ng", true },
{ "legalinmotion.es", true },
{ "legalrobot.com", true },
+ { "legendagroup.ch", true },
{ "legendesdechine.ch", true },
{ "legendofkrystal.com", true },
{ "legends-game.ru", false },
{ "legible.es", true },
{ "legilimens.de", true },
{ "legioniv.org", true },
+ { "legionminecraft.com", true },
{ "legiscontabilidade.com.br", true },
{ "legissa.ovh", true },
{ "legit.nz", true },
{ "legjobblogo.hu", true },
{ "legland.fr", true },
+ { "legnami24.it", true },
{ "legoutdesplantes.be", true },
{ "legrandvtc.fr", true },
{ "legumeinfo.org", true },
{ "lehighmathcircle.org", true },
{ "lehmitz-weinstuben.de", true },
{ "lehti-tarjous.net", true },
- { "lehtinen.xyz", false },
{ "leibniz-gymnasium-altdorf.de", true },
{ "leibniz-remscheid.de", false },
{ "leideninternationalreview.com", true },
@@ -22209,7 +23102,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lejardindesmesanges.fr", true },
{ "lektier.cf", true },
{ "lel.ovh", true },
- { "lelambiental.com.br", true },
{ "lemarcheelagrandeguerra.it", true },
{ "lemazol.fr", true },
{ "lemni.top", true },
@@ -22220,6 +23112,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lemonop.com", true },
{ "lemonparty.co", true },
{ "lemonrockbiketours.com", true },
+ { "lemonthy.ca", true },
+ { "lemonthy.com", true },
{ "lemouillour.fr", true },
{ "lemuslimpost.com", true },
{ "lenagroben.de", true },
@@ -22231,6 +23125,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lengzzz.com", true },
{ "lenidh.de", true },
{ "leninalbertop.com.ve", true },
+ { "lennier.info", true },
{ "lennyobez.be", true },
{ "lenou.nl", true },
{ "lenr-forum.com", true },
@@ -22252,11 +23147,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "leonax.net", true },
{ "leonbuitendam.nl", true },
{ "leondenard.com", true },
- { "leonhooijer.nl", false },
{ "leonklingele.de", true },
{ "leonmahler.consulting", true },
{ "leontiekoetter.de", true },
- { "leopoldina.net", true },
{ "leovanna.co.uk", true },
{ "leowkahman.com", true },
{ "lep.gov", true },
@@ -22265,6 +23158,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "leponton-lorient.fr", true },
{ "leppis-it.de", true },
{ "lepsos.com", true },
+ { "lequateur.fr", true },
{ "lequerceagriturismo.com", true },
{ "lequest.dk", true },
{ "lereporter.ma", true },
@@ -22280,30 +23174,35 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "les-ateliers-de-melineo.be", true },
{ "les-inoxydables.com", true },
{ "les-pingouins.com", true },
- { "lesaffre.es", true },
{ "lesancheslibres.fr", true },
{ "lesarts.com", true },
{ "lesberger.ch", true },
- { "lesbofight.com", true },
{ "lesbrillantsdaristide.com", true },
+ { "lesconteursavis.org", true },
{ "leseditionsbraquage.com", true },
+ { "lesfilmsavivre.com", true },
{ "lesgoodnews.fr", true },
{ "leshervelines.com", true },
{ "lesjardinsdemathieu.net", true },
{ "lesjardinsdubanchet.fr", true },
{ "lesmamy.ch", true },
{ "lesmontagne.net", true },
+ { "lesnet.co.uk", true },
{ "lespagesweb.ch", true },
{ "lespecialiste-pradelexcellence.com", true },
{ "lesplatanes.ch", true },
{ "lespret.nl", true },
{ "lesquerda.cat", false },
{ "lessets-graphiques.com", true },
+ { "lessis.moe", true },
{ "lesterchan.net", true },
{ "lesterrassesdusoleil.ch", true },
+ { "lesummeira.is", true },
{ "lesyndicat.info", true },
+ { "leszonderstress.nl", true },
{ "letemps.ch", true },
{ "letertrefleuri.com", true },
+ { "letkidsbekids.co.uk", true },
{ "leto12.xyz", true },
{ "letranif.net", true },
{ "lets-bounce.com", true },
@@ -22313,11 +23212,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lets.nu", true },
{ "letsbounceuk.com", true },
{ "letsdebug.net", true },
+ { "letsdocode.com", true },
{ "letsencrypt-for-cpanel.com", true },
{ "letsgame.nl", true },
{ "letsgetchecked.com", true },
{ "letsgowhilewereyoung.com", true },
{ "letskick.ru", true },
+ { "letson.me", true },
+ { "letsorganise.uk", true },
{ "letspartyrugby.co.uk", true },
{ "letssackcancer.org", true },
{ "letstalkcounseling.com", true },
@@ -22334,13 +23236,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "levans.fr", true },
{ "levanscatering.com", false },
{ "level-10.de", true },
- { "levelaccordingly.com", true },
+ { "level6.me", true },
{ "levelcheat.com", true },
{ "levelonetrainingandfitness.com", true },
{ "leveluplv.com", true },
{ "leveluprails.com", true },
{ "levendwater.org", true },
{ "levensbron.nl", true },
+ { "leventismotors.com.ng", true },
{ "leverj.io", true },
{ "levermann.eu", true },
{ "leviaan.nl", true },
@@ -22351,13 +23254,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "leviscop.de", true },
{ "lew.im", true },
{ "lewdawson.com", true },
- { "lewdgamer.com", true },
{ "lewis.li", true },
{ "lewiscollard.com", true },
{ "lewisdatasecurity.com", true },
{ "lewislaw.com", true },
{ "lewisllewellyn.me", true },
{ "lexdigital.pl", true },
+ { "lexic.co", true },
{ "lexico.pt", true },
{ "lexicography.online", true },
{ "lexpierce.social", true },
@@ -22366,14 +23269,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lezard-com.fr", true },
{ "lfashion.eu", true },
{ "lfgss.com", true },
- { "lfrconseil.com", true },
- { "lfullerdesign.com", true },
{ "lg-waps.go.jp", true },
{ "lg-waps.jp", true },
{ "lg0.site", true },
{ "lgbt-colleges.com", true },
{ "lgbt.io", true },
{ "lgbt.ventures", true },
+ { "lgbtq.cool", true },
{ "lghfinancialstrategy.ch", true },
{ "lgpecasoriginais.com.br", true },
{ "lhajn.cz", true },
@@ -22381,7 +23283,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lhalbert.xyz", true },
{ "lhamaths.online", true },
{ "lhconsult.tk", false },
- { "lhero.org", true },
{ "lhgavarain.com", true },
{ "lhost.su", true },
{ "li-ke.co.jp", true },
@@ -22390,6 +23291,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "liam-w.io", true },
{ "liamelliott.me", true },
{ "liamlin.me", true },
+ { "liangyichen.net", true },
{ "lianye1.cc", true },
{ "lianye2.cc", true },
{ "lianye3.cc", true },
@@ -22402,6 +23304,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "libble.eu", true },
{ "liberapay.com", true },
{ "liberation2020.com", true },
+ { "liberationschool.org", true },
{ "liberdademg.com.br", true },
{ "libgame.com", true },
{ "libmpq.org", true },
@@ -22418,11 +23321,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "libreboot.org", true },
{ "librebox.de", true },
{ "librelamp.com", true },
- { "libremail.nl", true },
{ "librends.org", true },
{ "libreoffice-from-collabora.com", true },
{ "libreofficefromcollabora.com", true },
{ "librervac.org", true },
+ { "librisulibri.it", true },
{ "librosdescargas.club", true },
{ "libscode.com", false },
{ "libskia.so", true },
@@ -22434,7 +23337,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lichtspot.de", true },
{ "lichttechnik-tumler.com", true },
{ "lichttraeumer.de", true },
- { "lickmypussy.us", true },
{ "lickthesalt.com", true },
{ "lidavidm.me", true },
{ "lidel.org", true },
@@ -22455,6 +23357,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lie.as", true },
{ "liebel.org", true },
{ "lieberwirth.biz", true },
+ { "liehuojun.com", true },
{ "liemen.net", true },
{ "lierrmm.space", true },
{ "lieuu.com", true },
@@ -22470,7 +23373,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lifegrip.com.au", true },
{ "lifeinhex.com", true },
{ "lifeinsurancepro.org", true },
- { "lifeisabug.com", true },
{ "lifekiss.ru", true },
{ "lifelenz.com", true },
{ "lifematenutrition.com", true },
@@ -22486,6 +23388,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lifi.is", true },
{ "lift-wise.com", true },
{ "liftie.info", true },
+ { "liftoff.rocks", true },
{ "ligadosgames.com", true },
{ "light-up.xyz", true },
{ "light.mail.ru", true },
@@ -22517,7 +23420,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lightsheep.no", false },
{ "lightspeed.com", false },
{ "lightspeedta.co", true },
+ { "lighttp.com", true },
{ "lightupcollective.co.uk", true },
+ { "lightweighthr.com", true },
+ { "ligmadrive.com", true },
{ "lignite.com", true },
{ "lignoma.com", true },
{ "ligonier.com", true },
@@ -22532,9 +23438,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "likehifi.de", true },
{ "likemovies.de", true },
{ "likenewhearing.com.au", true },
+ { "likeometer.co", true },
{ "likere.com", true },
{ "likesforinsta.com", true },
- { "likui.me", true },
{ "lilaccakeboutique.com", true },
{ "liliang13.com", true },
{ "liljohnsanitary.net", true },
@@ -22554,16 +23460,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "limelabs.io", true },
{ "limeres.com", true },
{ "limereslaw.com", true },
+ { "limitededitioncomputers.com", true },
+ { "limitededitionsolutions.com", true },
{ "limitxyz.com", true },
{ "limoairporttoronto.net", true },
{ "limousineservicezurich.com", true },
{ "limpid.nl", true },
{ "limules.ch", true },
+ { "limx.win", true },
{ "lin.fi", true },
+ { "linaklein.de", true },
{ "linan.blog", true },
+ { "linan.info", true },
+ { "linan.me", true },
+ { "linan.site", true },
+ { "linasjourney.com", true },
{ "lincdavis.com", true },
{ "linchpin-it.com", true },
{ "lincnaarzorg.nl", true },
+ { "lincoln.com.cn", true },
+ { "lincoln.mx", true },
{ "lincolnfinewines.com", true },
{ "lincolnpedsgroup.com", true },
{ "lincolnsfh.com", true },
@@ -22573,7 +23489,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lindemann.space", true },
{ "linden.me", true },
{ "lindeskar.se", true },
- { "lindholmen.club", true },
{ "lindnerhof-taktik.de", true },
{ "lindnerhof.info", true },
{ "lindo.ru", true },
@@ -22599,6 +23514,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "linherest.tk", true },
{ "linhua.org", true },
{ "link-sanitizer.com", true },
+ { "link.ba", true },
{ "link2serve.com", true },
{ "linkat4.cz", true },
{ "linkdr.uk", true },
@@ -22609,12 +23525,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "linkmaker.co.uk", true },
{ "linkmauve.fr", true },
{ "linkopia.com", true },
- { "linkstream.live", true },
+ { "linkst.co", true },
{ "linkthis.me", true },
- { "linkthis.ml", true },
{ "linktio.com", true },
{ "linky.tk", true },
{ "linkycat.com", true },
+ { "linkyou.top", true },
{ "linode.com", false },
{ "linost.com", true },
{ "linpx.com", true },
@@ -22630,11 +23546,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "linux.cn", true },
{ "linux.conf.au", true },
{ "linux.fi", true },
- { "linux.im", true },
{ "linux.pizza", true },
{ "linux3.org", true },
{ "linuxadictos.com", true },
{ "linuxbabe.com", true },
+ { "linuxbg.eu", true },
{ "linuxbierwanderung.com", true },
{ "linuxchick.se", true },
{ "linuxcommand.ru", true },
@@ -22649,32 +23565,34 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "linx.net", true },
{ "linzgau.de", true },
{ "linzyjx.com", true },
- { "lionlyrics.com", true },
{ "lionsdeal.com", true },
{ "lipartydepot.com", true },
{ "lipex.com", true },
+ { "lipighor.com", true },
+ { "lipighor.xyz", true },
{ "lipoabaltimore.org", true },
+ { "lippu1.fi", true },
{ "lipthink.com", true },
{ "liqd.net", true },
+ { "liqueur.wiki", true },
{ "liquid.cz", true },
{ "liquidhost.co", true },
{ "liquidinternet.co", true },
- { "liquidradio.pro", true },
{ "liquipedia.net", true },
{ "lirion.de", true },
{ "liris-beautywelt.de", true },
{ "lirlandais.ch", true },
{ "lirnberger.com", true },
+ { "lisahh-jayne.com", true },
{ "lisamccorrie.com", true },
{ "lisamortimore.com", true },
{ "lisanzauomo.com", true },
{ "lisburnhottubnbounce.co.uk", true },
{ "liskgdt.net", true },
- { "lisky.ru", true },
{ "lislan.org.uk", true },
{ "lisowski-development.com", false },
+ { "list-gymnasium.de", true },
{ "listahu.org", true },
- { "listal.com", true },
{ "listekdo.fr", true },
{ "listen.dk", true },
{ "lister-kirchweg.de", true },
@@ -22688,7 +23606,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "litemind.com", false },
{ "literarymachin.es", true },
{ "literature-schools.com", true },
- { "literaturpreis-bad-wurzach.de", true },
{ "litfin.name", true },
{ "lithan.com", true },
{ "lithesalar.se", true },
@@ -22696,31 +23613,39 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "litsovet.com", true },
{ "little-cake.com", true },
{ "littlebestfriend.de", true },
+ { "littleblackfish.se", true },
{ "littleboutiqueshop.co.uk", true },
{ "littleboutiqueshop.com", true },
{ "littleboutiqueshop.uk", true },
{ "littledev.nl", true },
+ { "littleduck.xyz", true },
{ "littlefairy.no", true },
{ "littlefamilyadventure.com", true },
{ "littlegreece.ae", true },
{ "littlejumpers.co.uk", true },
+ { "littlelife.co.uk", true },
{ "littlenina.nz", false },
{ "littlepigcreek.com.au", true },
{ "littlepincha.fr", true },
{ "littleprincessandmascotparties.co.uk", true },
- { "littleqiu.net", true },
{ "littleredpenguin.com", true },
{ "littleredsbakeshop.com", true },
- { "littlericket.me", false },
+ { "littlericket.me", true },
{ "littlescallywagsplay.co.uk", true },
{ "littleskin.cn", true },
{ "littleswitch.co.jp", true },
{ "littlewatcher.com", true },
{ "litvideoserver.de", true },
+ { "litz.ca", true },
+ { "litzenberger.ca", true },
+ { "liu0hy.cn", true },
{ "liuboznaiko.eu", true },
{ "liudon.org", true },
- { "liufengyu.cn", true },
+ { "liul.in", true },
{ "liupeicheng.top", true },
+ { "liuxiangling.com", true },
+ { "liv3d.stream", true },
+ { "livadm.ml", true },
{ "livaniaccesorios.com", true },
{ "live4k.media", false },
{ "livebandphotos.com", true },
@@ -22730,12 +23655,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "livecards.es", true },
{ "livecards.eu", true },
{ "livecards.it", true },
+ { "livecchi.cloud", true },
{ "livedesign.at", true },
{ "livedesign24.de", true },
{ "liveflightapp.com", true },
{ "liveforspeed.se", true },
{ "livehomecams.co.uk", true },
- { "livejasmin.dk", true },
{ "livekaarten.be", true },
{ "livekaarten.nl", true },
{ "livekarten.at", true },
@@ -22750,18 +23675,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "livelexi.com", true },
{ "livelifewithintent.com", true },
{ "livepaperhelp.com", true },
- { "livepath.ch", true },
{ "liveperformersmeeting.net", true },
{ "liveregistratie.nl", true },
{ "liverider.co.jp", true },
{ "livesheep.com", true },
{ "livesure.com", true },
{ "livetoride.co.za", true },
- { "livetube.tv", true },
{ "livi.co", true },
{ "livi.co.uk", true },
{ "livi.fr", true },
{ "living-space.co.nz", true },
+ { "living-with-outlook-2010.com", true },
{ "living.digital", true },
{ "living.video", true },
{ "living24.de", true },
@@ -22773,6 +23697,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "livingworduk.org", true },
{ "livnev.me", true },
{ "livnev.xyz", true },
+ { "livogeva.dk", true },
{ "livolett.de", true },
{ "lixiaoyu.live", true },
{ "lixtick.com", true },
@@ -22782,16 +23707,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lizardsystems.com", true },
{ "lizheng.de", true },
{ "lizhi.io", true },
- { "lizhi123.net", true },
+ { "lizhuogui.ga", true },
{ "lizmooredestinationweddings.com", true },
{ "lizzaran.io", true },
{ "lizzwood.com", true },
{ "ljason.cn", true },
- { "ljc.ro", true },
+ { "ljoonal.xyz", true },
{ "ljs.io", true },
{ "ljskool.com", true },
{ "ljusdalsnaprapatklinik.se", true },
+ { "ljw.me", true },
{ "lk-hardware.cz", true },
+ { "lkellar.org", true },
{ "lknw.de", true },
{ "lkp111138.me", true },
{ "llamacuba.com", true },
@@ -22800,6 +23727,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ller.xyz", true },
{ "llm-guide.com", true },
{ "llnl.gov", true },
+ { "lloyd-day.me", true },
{ "llslb.com", false },
{ "lm-pumpen.de", false },
{ "lmbyrne.co.uk", true },
@@ -22815,6 +23743,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lmtravis.com", true },
{ "lng-17.org", true },
{ "lnhequipmentltd.com", true },
+ { "lnmp.me", true },
{ "lntu.org", true },
{ "lnyltx.cn", true },
{ "load-ev.de", true },
@@ -22841,6 +23770,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "localblock.co.za", true },
{ "localbouncycastle.com", true },
{ "localdecor.com.br", true },
+ { "localegroup.com", true },
{ "localethereum.com", true },
{ "localhorst.duckdns.org", true },
{ "localhorst.xyz", true },
@@ -22850,15 +23780,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "localspot.pl", true },
{ "locapos.com", true },
{ "location-fichier-email.com", true },
- { "locationvoitureallemagne.com", true },
- { "locationvoitureangleterre.com", true },
- { "locationvoitureaustralie.com", true },
- { "locationvoiturebelgique.com", true },
- { "locationvoitureespagne.com", true },
- { "locationvoitureitalie.com", true },
- { "locationvoitureportugal.com", true },
{ "locatorplus.gov", true },
{ "locauxrama.fr", true },
+ { "lock23.ca", true },
+ { "lockaby.org", true },
{ "locker.email", true },
{ "locker.plus", true },
{ "locklock.com.br", true },
@@ -22872,20 +23797,25 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "locksmithbalchsprings.com", true },
{ "locksmithballito.com", true },
{ "locksmithbluff.co.za", true },
+ { "locksmithcarrolltontx.com", true },
{ "locksmithdearborn.com", true },
+ { "locksmithdrippingspringstx.com", true },
{ "locksmithedmonds.com", true },
{ "locksmithfriendswoodtexas.com", true },
{ "locksmithgarland-tx.com", true },
{ "locksmithgrapevinetx.com", true },
{ "locksmithhumbletx.com", true },
{ "locksmithindurban.co.za", true },
+ { "locksmithlakewaytx.com", true },
{ "locksmithlivoniami.com", true },
{ "locksmithmadisonheights.com", true },
+ { "locksmithmesquitetexas.com", true },
{ "locksmithmesquitetx.com", true },
{ "locksmithmissouricity.com", true },
{ "locksmithopen.com", true },
{ "locksmithsammamishwa.com", true },
{ "locksmithsanantoniotexas.com", true },
+ { "locksmithsbuda.com", true },
{ "locksmithscottsdaleaz.com", true },
{ "locksmithseattleco.com", true },
{ "locksmithservice-houston.com", true },
@@ -22893,11 +23823,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "locksmithspringtx.com", true },
{ "locksmithswestville.com", true },
{ "locksmiththewoodlands.com", true },
+ { "lockwoodchristmastreefarm.com", true },
{ "locomocosec.com", true },
- { "locomore.com", true },
{ "locomotionds.com", true },
{ "locomotive.net.br", true },
{ "locurimunca.co", true },
+ { "locus-dashboard.com", true },
+ { "locusmap.eu", true },
{ "lodash.com", false },
{ "loddeke.eu", true },
{ "lodewijkict.nl", true },
@@ -22922,7 +23854,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "logicio.net", false },
{ "logicne-hise.si", true },
{ "logicoma.com", true },
- { "logicz.top", true },
{ "login.corp.google.com", true },
{ "login.gov", false },
{ "login.launchpad.net", true },
@@ -22931,7 +23862,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "login.xero.com", false },
{ "login.yahoo.com", false },
{ "loginsentinel.eu", true },
- { "logitank.net", true },
{ "logitel.de", true },
{ "logoesun.com", true },
{ "logoglo.com", true },
@@ -22955,7 +23885,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lojadarenda.com.br", true },
{ "lojadewhisky.com.br", true },
{ "lojadoarcomprimido.com.br", true },
- { "lojadoprazer.com.br", true },
{ "lojadosomautomotivo.com.br", true },
{ "lojafazendoarte.com.br", true },
{ "lojafilipaper.com.br", true },
@@ -22966,19 +23895,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lojaprojetoagua.com.br", true },
{ "lojasceletro.com.br", true },
{ "lojaterrazul.com.br", true },
- { "lojavirtualfc.com.br", true },
{ "lojavisamed.com.br", true },
{ "lojix.com", true },
{ "lojj.pt", true },
{ "lok.space", true },
{ "lokaal.org", true },
+ { "lokal-speisen.de", true },
{ "loker.id", true },
{ "loket.nl", true },
- { "lolcorp.pl", true },
{ "lolcow.farm", true },
{ "lolhax.org", true },
- { "loli.com", true },
- { "loli.ee", true },
{ "loli.net", true },
{ "loli.pet", true },
{ "loli.ski", true },
@@ -22987,8 +23913,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "loli.world", true },
{ "lolibrary.org", true },
{ "lolic.xyz", true },
- { "lolico.moe", true },
{ "lolicon.eu", true },
+ { "lolitalechat.com", true },
{ "lolkot.ru", true },
{ "lolly.cc", true },
{ "lolnames.gg", true },
@@ -22999,7 +23925,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lommyfleet.com", true },
{ "lon-so.com", true },
{ "lona.io", true },
- { "lonal.com", true },
+ { "lonay.me", true },
{ "london-transfers.com", true },
{ "london.dating", true },
{ "londongallery.net", true },
@@ -23010,6 +23936,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lonesomecosmonaut.com", true },
{ "lonestarlandandcommercial.com", true },
{ "long-journey.com", true },
+ { "long139.com", true },
+ { "long18.cc", true },
+ { "long688.com", true },
{ "longboat.io", true },
{ "longhaircareforum.com", true },
{ "longhorn-imports.com", true },
@@ -23019,10 +23948,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lonniec.com", true },
{ "lonniemason.net", true },
{ "look.co.il", true },
- { "looka.ch", true },
- { "looka.photo", true },
{ "lookagain.co.uk", true },
- { "lookart.ch", true },
{ "lookasik.eu", true },
{ "lookastic.co.uk", true },
{ "lookastic.com", true },
@@ -23059,8 +23985,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "loss.no", true },
{ "lost.host", true },
{ "lost.report", true },
+ { "lostinweb.eu", true },
{ "lostkeys.co.uk", true },
+ { "lostsandal.com", true },
+ { "lostsandal.io", true },
{ "lostserver.com", true },
+ { "lostwithdan.com", true },
{ "loteamentomontereiitu.com.br", true },
{ "lothlorien.ca", false },
{ "lotl.ru", true },
@@ -23069,6 +23999,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lotnonline.com", true },
{ "lotnonline.nl", true },
{ "lotro-wiki.com", true },
+ { "lotsofbargains.com", true },
{ "lottospielen24.org", false },
{ "lotw.de", true },
{ "lotz.li", true },
@@ -23076,6 +24007,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "louange-reconvilier.ch", true },
{ "loucanfixit.com", true },
{ "louerunhacker.fr", true },
+ { "louisapolicefoundation.com", true },
+ { "louisapolicefoundation.org", true },
{ "louisemisellinteriors.co.uk", true },
{ "louisvillecarguys.com", true },
{ "loune.net", true },
@@ -23083,12 +24016,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "loungecafe.org", true },
{ "loungepapillon.com", true },
{ "love4taylor.me", true },
+ { "loveai.org", true },
{ "loveandadoreboutique.com", true },
{ "lovebigisland.com", true },
{ "lovecrystal.co.uk", true },
{ "loveislandgames.com", true },
{ "loveisourweapon.com", true },
- { "lovelens.li", false },
{ "lovelivewiki.com", true },
{ "lovelovenavi.jp", true },
{ "lovemanagementaccounts.co.uk", true },
@@ -23100,9 +24033,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "loverepublic.ru", true },
{ "lovesmagical.com", true },
{ "lovesupremefestival.com", true },
- { "lovetravel360.com", false },
{ "lovevape.co", true },
- { "loveyounastya.com", true },
{ "loveysa.ch", true },
{ "lovg.ren", true },
{ "lovingearth.co", true },
@@ -23117,7 +24048,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lowsidetna.com", true },
{ "lowson.ca", true },
{ "loxal.net", true },
- { "loyaleco.it", true },
{ "loyaltyondemand.club", true },
{ "loyaltyondemand.eu", true },
{ "lp-support.nl", true },
@@ -23127,10 +24057,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lriese.ch", true },
{ "lrssystems.com", true },
{ "ls-alarm.de", true },
+ { "ls-modcompany.com", true },
{ "lsal.me", true },
{ "lsc-dillingen.de", true },
{ "lsc.gov", true },
{ "lshiy.com", true },
+ { "lsmentor.com", true },
{ "lsmpx.com", true },
{ "lsquo.com", true },
{ "lsscreens.de", true },
@@ -23140,7 +24072,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ltaake.com", true },
{ "ltecode.com", true },
{ "ltib.com.au", true },
+ { "ltlec.cn", true },
+ { "ltlec.net", true },
+ { "ltlec.org", true },
{ "ltls.org", true },
+ { "ltmw.xyz", true },
{ "ltn-tom-morel.fr", true },
{ "lty.space", true },
{ "lu.search.yahoo.com", false },
@@ -23151,7 +24087,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lublin.toys", true },
{ "luc-oberson.ch", true },
{ "luca-steeb.com", true },
- { "luca.swiss", true },
{ "lucacastelnuovo.nl", false },
{ "lucafontana.net", true },
{ "lucafrancesca.me", true },
@@ -23174,6 +24109,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "luckycastles.co.uk", true },
{ "luckyfrog.hk", true },
{ "luckyxf.com", true },
+ { "luclu7.fr", true },
{ "lucy.science", true },
{ "lucyparsonslabs.com", true },
{ "lucysan.net", true },
@@ -23183,7 +24119,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ludogue.net", true },
{ "ludovic-muller.fr", true },
{ "ludum.pl", true },
- { "ludwig.im", true },
{ "ludwiggrill.de", true },
{ "ludwigjohnson.se", true },
{ "ludwigpro.net", true },
@@ -23196,6 +24131,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "luftbild-siegerland.de", true },
{ "luftreiniger.biz", true },
{ "lugbb.org", true },
+ { "lugimax.com", true },
{ "luginbuehl.be", true },
{ "lugui.in", true },
{ "lui.pink", true },
@@ -23206,16 +24142,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "luk.earth", true },
{ "lukas-gorr.de", true },
{ "lukas-meixner.com", true },
- { "lukas-oppermann.de", true },
{ "lukasberan.com", true },
{ "lukasberan.cz", true },
{ "lukasfunk.com", true },
- { "lukasoppermann.com", true },
- { "lukasoppermann.de", true },
{ "lukasschick.de", false },
{ "lukaszorn.de", true },
{ "lukaszwojcik.net", true },
- { "lukatz.de", true },
{ "luke.ch", true },
{ "luke6887.me", true },
{ "lukeistschuld.de", true },
@@ -23250,8 +24182,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lunastrail.com", true },
{ "lunazacharias.com", true },
{ "lunchbunch.me", true },
+ { "lundberghealthadvocates.com", true },
{ "lune-indigo.ch", true },
- { "lungta.pro", true },
{ "lunidea.ch", true },
{ "lunidea.com", true },
{ "lunis.net", true },
@@ -23285,7 +24217,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lutoma.org", true },
{ "luukdebruincv.nl", true },
{ "luukklene.nl", true },
- { "luukuton.fi", true },
{ "luuppi.fi", true },
{ "luvare.com", true },
{ "luvbridal.com.au", true },
@@ -23316,8 +24247,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "lxd.pm", true },
{ "lyam.fr", true },
{ "lycee-saintjoseph-mesnieres.fr", true },
- { "lychankiet.name.vn", false },
- { "lycly.me", true },
{ "lydudlejning.net", true },
{ "lyftrideestimate.com", true },
{ "lykai.ca", true },
@@ -23358,11 +24287,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "m.mail.ru", true },
{ "m.me", true },
{ "m0t0k1ch1.com", true },
- { "m132.eu", true },
+ { "m0v0.com", true },
{ "m134.eu", true },
{ "m2epro.com", true },
{ "m2il.co", true },
{ "m2os.com", true },
+ { "m2tm.fr", true },
{ "m4g.ru", true },
{ "m4rcus.de", true },
{ "ma-eir.nl", true },
@@ -23412,7 +24342,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maco.org.uk", true },
{ "maconnerie-dcs.ch", true },
{ "macosxfilerecovery.com", true },
- { "macoun.de", true },
{ "macros.co.jp", true },
{ "macsupportnacka.se", true },
{ "macsupportstockholm.se", true },
@@ -23431,7 +24360,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "made-in-earth.co.jp", true },
{ "madebydusk.com", true },
{ "madebyshore.com", true },
- { "madeinchezmoi.net", true },
{ "madeinstudio3.com", true },
{ "madeitwor.se", true },
{ "madeloc.com", true },
@@ -23444,13 +24372,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "madmar.ee", true },
{ "madmax-store.gr", true },
{ "madoka.nu", true },
- { "madokami.pw", true },
{ "madreacqua.org", true },
{ "madrecha.com", true },
{ "madreshoy.com", true },
{ "madridartcollection.com", true },
{ "madscientistwebdesign.com", true },
{ "madtec.de", true },
+ { "maduradas.info", true },
+ { "maduradas.net", true },
{ "madusecurity.com", true },
{ "mae-berlinistanbul.com", true },
{ "maedchenflohmarkt.at", true },
@@ -23459,7 +24388,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maelstrom-fury.eu", true },
{ "maelstrom.ninja", true },
{ "maeplasticsurgery.com", true },
- { "maestrano.com", true },
{ "maff.co.uk", true },
{ "maff.scot", false },
{ "mafia.network", true },
@@ -23489,13 +24417,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "magical-secrets.com", true },
{ "magical.rocks", true },
{ "magicalcircuslv.com", true },
- { "magicalshuttle.fr", true },
{ "magicamulet.me", true },
{ "magicball.co", true },
{ "magicbroccoli.de", true },
{ "magiccards.info", true },
{ "magicdaysomagh.co.uk", true },
{ "magicdlp.com", true },
+ { "magicjudges.org", true },
{ "magiclen.org", true },
{ "magicspaceninjapirates.de", true },
{ "magictable.com", true },
@@ -23508,7 +24436,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "magneticattraction.com.au", true },
{ "magnetpass.uk", true },
{ "magnets.jp", true },
- { "magnettracker.com", true },
{ "magnificatwellnesscenter.com", true },
{ "magnificentdata.com", true },
{ "magnoliadoulas.com", true },
@@ -23522,6 +24449,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "magwin.co.uk", true },
{ "mah-nig.ga", true },
{ "mahai.me", true },
+ { "mahatmayoga.org", true },
{ "mahefa.co.uk", true },
{ "mahjong-navi.com", true },
{ "mahjong.org", true },
@@ -23547,8 +24475,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mailer-dot.de", true },
{ "mailfence.com", true },
{ "mailflank.com", true },
+ { "mailhardener.com", true },
{ "mailinabox.email", true },
{ "mailjet.tech", true },
+ { "mailjunky.de", true },
{ "maillady-susume.com", true },
{ "mailmag.net", false },
{ "mailnara.co.kr", true },
@@ -23557,6 +24487,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mailum.org", false },
{ "mainechiro.com", true },
{ "mainframeserver.space", true },
+ { "mainhattan-handwerker.de", true },
{ "mainlined.org", true },
{ "maintenance-traceur-hp.fr", true },
{ "mainzelmaennchen.net", true },
@@ -23571,6 +24502,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maitemerino.net", true },
{ "maitheme.com", true },
{ "maitrise-orthopedique.com", true },
+ { "majahoidja.ee", true },
{ "majaweb.cz", true },
{ "majemedia.com", false },
{ "majesnix.org", true },
@@ -23600,6 +24532,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maki-chan.de", true },
{ "makinen.ru", true },
{ "makkusu.photo", true },
+ { "makogaming.com", true },
{ "makos.jp", true },
{ "makowitz.cz", true },
{ "maktoob.search.yahoo.com", false },
@@ -23618,6 +24551,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "malibu-electric.com", true },
{ "malibuelectrical.com", true },
{ "malibuexteriorlighting.com", true },
+ { "malibumodas.com.br", true },
{ "malik.holdings", true },
{ "malik.id", true },
{ "malikussa.id", true },
@@ -23632,34 +24566,34 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mall.pl", true },
{ "mall.sk", true },
{ "mallach.net", true },
+ { "mallhonda.com", true },
{ "mallonline.com.br", true },
{ "malmoesport.se", true },
{ "malnex.de", true },
{ "malscan.com", true },
{ "malscan.org", true },
{ "malta-firma.com", true },
+ { "malte-kiefer.de", true },
{ "malufs.com.br", true },
+ { "malvertise.xyz", true },
{ "malware.watch", true },
{ "malwareinvestigator.gov", true },
- { "malwarekillers.com", true },
{ "malwaretips.com", false },
{ "maly.cz", true },
{ "malyshata.com", true },
{ "malysvet.net", true },
- { "mamaasia.info", true },
+ { "mamabepo.com", true },
{ "mamadea.be", true },
{ "mamadoma.com.ua", true },
{ "mamafit.club", true },
{ "mamamoet.ru", true },
{ "mamanecesitaungintonic.com", true },
- { "mambas.cn", true },
+ { "mamaxi.org", true },
{ "mamiecouscous.com", true },
{ "mammals.net", true },
{ "mammaw.com", true },
{ "mammeitalianeavienna.com", true },
- { "mammooc.org", true },
{ "mammothlakesmls.net", true },
- { "mamospienas.lt", true },
{ "mamot.fr", false },
{ "mamuko.nl", true },
{ "man3s.jp", false },
@@ -23668,6 +24602,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "manage.cm", true },
{ "manage4all.de", true },
{ "manageathome.co.uk", true },
+ { "managedhosting.de", true },
{ "management-companie.ro", true },
{ "managementboek.nl", true },
{ "managementfeedback.com", true },
@@ -23676,6 +24611,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "manager-efficacement.com", true },
{ "manager.linode.com", false },
{ "managewp.org", true },
+ { "manantialdevida1450.com", true },
{ "manaonetrading.com", true },
{ "manatees.com.au", true },
{ "manatees.net", true },
@@ -23696,6 +24632,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "manhattanchoralensemble.org", true },
{ "manhole.club", true },
{ "manhuagui.com", true },
+ { "maniacoland.com", true },
{ "manicbouncycastles.co.uk", true },
{ "manicode.com", true },
{ "maniorpedi.com", true },
@@ -23704,6 +24641,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "manja-und-martin.de", true },
{ "manjaro.ru", true },
{ "mankans.com", true },
+ { "mankomarketing.com", true },
{ "manmeetgill.com", true },
{ "manneguiden.no", true },
{ "mannheimbloggt.tk", true },
@@ -23720,6 +24658,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "manti.by", true },
{ "mantor.org", false },
{ "mantra.pictures", true },
+ { "mantuo.com", true },
+ { "mantuo.xyz", true },
{ "manualidadeson.com", true },
{ "manuall.co.uk", true },
{ "manuall.de", true },
@@ -23741,6 +24681,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "manuscriptlink.com", true },
{ "manutd.org.np", true },
{ "manuth.life", true },
+ { "manwish.cn", true },
{ "manwithavan.co.uk", true },
{ "manyetikboya.com", true },
{ "manyiu.com", true },
@@ -23750,9 +24691,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maomihz.com", true },
{ "maone.net", true },
{ "maorseo.com", true },
+ { "maorx.cn", true },
{ "maosensanguentadasdejesus.net", true },
{ "maowtm.org", true },
{ "maozedong.red", true },
+ { "map-patho.com", true },
{ "map4erfurt.de", true },
{ "map4jena.de", true },
{ "mapasmundi.com.br", true },
@@ -23763,8 +24706,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maplegate.info", true },
{ "maplehome.tk", true },
{ "mapletime.com", true },
- { "maps.net", true },
+ { "mapresidentielle.fr", true },
{ "mapstack.org", true },
+ { "maquena.org", true },
{ "maquettage.com", true },
{ "maquinariaspesadas.org", true },
{ "maquinasdecoserplus.com", true },
@@ -23779,9 +24723,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marc-schlagenhauf.de", true },
{ "marcaixala.me", true },
{ "marcbeije.com", true },
- { "marcberndtgen.de", true },
{ "marcceleiro.com", true },
{ "marceau.ovh", true },
+ { "marcel-preuss.de", true },
{ "marcel-veronetzki.de", true },
{ "marcel-waldvogel.ch", true },
{ "marcelinofranchini.com", true },
@@ -23790,6 +24734,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marcelinofranchini.net", true },
{ "marcelinofranchini.org", true },
{ "marcelkooiman.com", true },
+ { "marcelpreuss.de", true },
{ "marcelsiegert.com", true },
{ "marcelwaldvogel.ch", true },
{ "marcelwiedemeier.com", true },
@@ -23799,13 +24744,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marchhappy.tech", false },
{ "marchukov.com", true },
{ "marciaimportados.com.br", true },
+ { "marcianoandtopazio.com", true },
{ "marclay.co.uk", true },
{ "marco-goltz.de", true },
{ "marco-hegenberg.net", true },
{ "marco-polo-reisen.com", true },
{ "marcocasoni.com", true },
{ "marcoherten.com", true },
- { "marcoklomp.nl", true },
+ { "marcoklomp.nl", false },
{ "marcoslater.com", true },
{ "marcusds.ca", true },
{ "marcuskoh.com", true },
@@ -23823,9 +24769,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "margots.life", true },
{ "margots.tech", true },
{ "marguerite-maison.fr", true },
- { "mariage-photo.ch", true },
{ "mariaheidemann.nl", true },
{ "marianatherapy.com", true },
+ { "marianelaisashi.com", true },
{ "marianhoenscheid.de", true },
{ "mariannenan.nl", true },
{ "mariannethijssen.nl", true },
@@ -23835,6 +24781,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mariehane.com", true },
{ "mariemiramont.fr", true },
{ "mariereichl.cz", true },
+ { "marietrap.ch", true },
{ "marijnfidder.nl", true },
{ "marikafranke.de", true },
{ "marilsnijders.nl", true },
@@ -23846,13 +24793,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marinazarza.es", true },
{ "marinbusinesscenter.ch", true },
{ "marine.gov", true },
- { "marinecadastre.gov", true },
{ "marinekaplama.com", true },
{ "marinela.com.mx", false },
{ "marinelausa.com", false },
{ "marines-shop.com", true },
{ "mario.party", false },
- { "mariogeckler.de", true },
+ { "mariogeckler.de", false },
{ "mariposah.ch", true },
{ "marisamorby.com", false },
{ "mariskavankasbergen.nl", true },
@@ -23885,7 +24831,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marketingconverts.com", true },
{ "marketingeinnovacion.com", true },
{ "marketingforfood.com", true },
- { "marketinggenerators.nl", true },
+ { "marketinggenerators.nl", false },
{ "marketingtrendnews.com", true },
{ "marketingvirtuales.com", true },
{ "marketizare.ro", true },
@@ -23893,8 +24839,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "markfordelegate.com", true },
{ "markhaehnel.de", true },
{ "markhenrick.site", true },
- { "markholden.guru", true },
{ "markhoodphoto.com", true },
+ { "markhoodwrites.com", true },
{ "markido.com", true },
{ "markitzeroday.com", true },
{ "markkirkforillinois.com", true },
@@ -23918,7 +24864,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "markt-heiligenstadt.de", false },
{ "marktcontact.com", true },
{ "marktissink.nl", true },
- { "marktplaatshelper.nl", true },
{ "markup-ua.com", true },
{ "markus-blog.de", true },
{ "markus-dev.com", true },
@@ -23939,13 +24884,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marmotte.love", true },
{ "maroc-bivouac.com", true },
{ "marocemploi.co", true },
- { "marocmail.ma", true },
- { "marotero.com", true },
+ { "maroismasso.com", true },
{ "marpa-wohnen.de", true },
{ "marqueswines.co.uk", true },
{ "marrai.de", true },
{ "marriage-shrine.jp", true },
{ "marrickvilleapartments.com.au", true },
+ { "marron-dietrecipe.com", true },
{ "marsanvet.com", true },
{ "marsble.com", true },
{ "marseillekiteclub.com", true },
@@ -23953,6 +24898,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "marshallwilson.com", true },
{ "marshmallow.co", true },
{ "marshmallow.com", true },
+ { "marshyplay.live", true },
{ "marsikelektro.cz", true },
{ "martasibaja.com", true },
{ "martel-innovate.com", true },
@@ -23962,9 +24908,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "martensson.io", true },
{ "marti201.ga", true },
{ "martialarts-wels.at", true },
+ { "martian.tk", true },
{ "martide.com", true },
- { "martiestrimsalon.nl", true },
{ "martijn.site", true },
+ { "martijnhielema.nl", true },
{ "martijnvanderzande.nl", true },
{ "martin-loewer.de", true },
{ "martin-smith.info", true },
@@ -23976,14 +24923,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "martinkus.eu", true },
{ "martinmuc.de", true },
{ "martinreed.net", true },
+ { "martins.im", true },
{ "martinvillalba.com", true },
{ "martinvillalba.com.ar", true },
{ "martinvillalba.info", true },
{ "martinvillalba.net", true },
{ "martinvillalba.org", true },
{ "martonmihaly.hu", true },
- { "martynhare.co.uk", true },
- { "martynhare.uk", true },
{ "maru-life.com", true },
{ "maruhoi.com", true },
{ "marustat.ru", true },
@@ -23997,12 +24943,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maryjruggles.com", true },
{ "marykatrinaphotography.com", true },
{ "marylandbasementandcrawlspacewaterproofing.com", true },
- { "marzio.co.za", true },
{ "masarik.sh", true },
{ "masatotaniguchi.jp", true },
{ "masautonomo.com", true },
{ "masayahost.com", true },
- { "masaze-hanka.cz", true },
{ "mascosolutions.com", true },
{ "masdillah.com", true },
{ "maservant.net", true },
@@ -24017,7 +24961,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "massage-vitalite.fr", true },
{ "massage4u.net", true },
{ "massagecupping.com", true },
+ { "massageishealthy.com", true },
{ "massagetainha-hanoi.com", true },
+ { "massar.family", true },
{ "massdrop.com", true },
{ "masse.org", true },
{ "massflix.com", true },
@@ -24040,9 +24986,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "masterhelenaroma.com", true },
{ "masterofallscience.com", true },
{ "masterofbytes.ch", true },
+ { "masterpassword.org", true },
{ "masterpc.co.uk", true },
{ "masterplc.com", true },
{ "masters.black", true },
+ { "mastersadistancia.com", true },
{ "masterstuff.de", true },
{ "mastodon.at", true },
{ "mastodon.host", true },
@@ -24058,8 +25006,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "matchatea24.com", true },
{ "matchboxdesigngroup.com", true },
{ "matdogs.com", true },
+ { "mateiko.by", true },
{ "matejgroma.com", true },
{ "matel.org", true },
+ { "matematyka.wiki", true },
{ "materassi.roma.it", true },
{ "materiaischiquinho.com.br", true },
{ "material-ui.com", true },
@@ -24069,19 +25019,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maternalsafety.org", true },
{ "maternum.com", true },
{ "mateuszchyla.pl", true },
+ { "math-coaching.com", true },
{ "math-colleges.com", true },
{ "math.hamburg", true },
{ "mathalexservice.info", true },
{ "mathematik.rocks", false },
- { "mathembedded.com", true },
{ "matheo-schefczyk.de", true },
{ "mathfinder.org", true },
{ "mathhire.org", true },
- { "mathias.is", true },
{ "mathiasbynens.be", true },
{ "mathiasgarbe.de", true },
{ "mathiaswagner.org", true },
{ "mathieuguimond.com", true },
+ { "mathieui.net", true },
{ "mathis.com.tr", true },
{ "maths.network", true },
{ "mathspace.co", true },
@@ -24090,6 +25040,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "matildajaneclothing.com", true },
{ "matjaz.it", true },
{ "matlss.com", true },
+ { "matocmedia.com", true },
{ "matok.me.uk", true },
{ "matome-surume.com", true },
{ "matomeathena.com", true },
@@ -24118,6 +25069,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mattconstruction.com", true },
{ "mattcorp.com", true },
{ "mattdbarton.com", true },
+ { "matteobrenci.com", true },
{ "matteomarescotti.it", true },
{ "mattessons.co.uk", true },
{ "mattferderer.com", true },
@@ -24135,6 +25087,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "matthewsetter.com", true },
{ "matthey.nl", true },
{ "matthi.coffee", true },
+ { "matthi3u.xyz", true },
{ "matthias-muenzner.de", true },
{ "matthiasbeck.com", true },
{ "matthiasheil.de", true },
@@ -24154,6 +25107,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "matway.com", true },
{ "matway.net", true },
{ "matze.co", true },
+ { "mauerwerk.online", true },
{ "mauerwerkstag.info", true },
{ "mauiticketsforless.com", true },
{ "mauldincookfence.com", true },
@@ -24184,7 +25138,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maxchan.info", true },
{ "maxh.me.uk", true },
{ "maxhamon.ovh", true },
- { "maxhoechtl.at", true },
{ "maximdeboiserie.be", true },
{ "maximdens.be", true },
{ "maximeferon.fr", true },
@@ -24202,9 +25155,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "maxmilton.com", true },
{ "maxmind.com", true },
{ "maxmobiles.ru", true },
+ { "maxmoda.eu", true },
{ "maxp.info", true },
{ "maxpl0it.com", true },
- { "maxr1998.de", true },
{ "maxrandolph.com", true },
{ "maxtruxa.com", true },
{ "maxundlara.at", true },
@@ -24215,10 +25168,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "may24.tw", true },
{ "mayaimplant.com", true },
{ "mayavi.co.in", true },
- { "maydex.info", true },
{ "mayerbrownllz.com", true },
{ "mayomarquees.com", true },
{ "mayopartyhire.com", true },
+ { "mayorcahill.com", true },
{ "maypolevilla.co.uk", true },
{ "mayrhofer.eu.org", false },
{ "mazda-mps.de", true },
@@ -24231,6 +25184,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mazurlabs.tk", true },
{ "mazzotta.me", true },
{ "mb-is.info", true },
+ { "mb-server.de", true },
{ "mbaasy.com", true },
{ "mbaestlein.de", true },
{ "mbainflatables.co.uk", true },
@@ -24252,6 +25206,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mbrooks.info", true },
{ "mbs-journey.com", true },
{ "mbsec.net", true },
+ { "mbsr-barmstedt.de", true },
{ "mburaks.com", true },
{ "mburns.duckdns.org", true },
{ "mbweir.com", true },
@@ -24261,6 +25216,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mc-venture.net", false },
{ "mc4free.cc", true },
{ "mcatnnlo.org", true },
+ { "mcconciergerie.com", true },
{ "mccoolesredlioninn.com", true },
{ "mccordsvillelocksmith.com", true },
{ "mccrackon.com", true },
@@ -24269,12 +25225,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mcdona1d.me", true },
{ "mcdonalds.be", true },
{ "mcdonalds.design", true },
+ { "mcdsg.net", true },
{ "mce.eu", true },
{ "mce.nyc", true },
{ "mce55.eu", true },
{ "mcea-hld.jp", true },
{ "mceconferencecentre.eu", true },
{ "mcfedries.com", true },
+ { "mcfi.mu", true },
{ "mcfipvt.com", true },
{ "mcfx.us", true },
{ "mcgaccountancy.co.uk", true },
@@ -24289,6 +25247,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mckernan.in", true },
{ "mckinley.school", true },
{ "mcl.de", false },
+ { "mcl.gg", true },
{ "mclinflatables.co.uk", true },
{ "mclmotors.co.uk", true },
{ "mclyr.com", true },
@@ -24300,12 +25259,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mcpaoffice.com", true },
{ "mcpart.land", true },
{ "mcplayman.de", true },
+ { "mcpro.games", true },
{ "mcprocdn.com", true },
{ "mcrn.jp", true },
{ "mcsinflatables.co.uk", true },
{ "mcsports.es", true },
{ "mcsrvstat.us", true },
{ "mctools.org", true },
+ { "mcuexchange.com", true },
{ "mcuuid.net", true },
{ "mcversions.net", true },
{ "mcynews.com", true },
@@ -24356,13 +25317,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mechmk1.me", true },
{ "med-colleges.com", true },
{ "med-otzyv.ru", true },
+ { "med-post.biz", true },
+ { "med-post.co", true },
+ { "med-post.com", true },
+ { "med-post.net", true },
+ { "med-post.org", true },
+ { "med-postclinic.com", true },
+ { "med-postdoctor.com", true },
+ { "med-postdoctors.com", true },
+ { "med-postemergency.com", true },
+ { "med-posthealth.com", true },
+ { "med-postmedical.com", true },
+ { "med-postphysicians.com", true },
+ { "med-postwellness.com", true },
+ { "med.tips", true },
{ "med360.at", true },
{ "medba.se", true },
{ "medcir.com.br", true },
{ "medcrowd.com", true },
{ "meddelare.com", true },
{ "meddigital.com", false },
- { "mede-handover.azurewebsites.net", true },
{ "medecine-esthetique-du-calaisis.fr", true },
{ "medeinos.lt", true },
{ "medellinapartamentos.com", true },
@@ -24379,6 +25353,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mediablaster.com", true },
{ "mediabogen.net", true },
{ "mediaburst.co.uk", true },
+ { "mediacloud.me", true },
{ "mediadex.be", true },
{ "mediaexpert.fr", true },
{ "mediafly.com", true },
@@ -24393,6 +25368,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mediapart.fr", true },
{ "mediapath.gr", true },
{ "mediarithmics.com", true },
+ { "mediarithmics.io", true },
{ "mediaselection.eu", true },
{ "mediathekview.de", true },
{ "mediationculturelleclp.ch", true },
@@ -24427,15 +25403,40 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "medinsider.li", true },
{ "medireport.fr", true },
{ "meditadvisors.com", true },
- { "meditel.nl", true },
{ "medium.com", true },
+ { "medja.net", true },
{ "medlineplus.gov", true },
- { "medmarkt24.com", true },
{ "medo64.com", true },
{ "medovea.ru", true },
{ "medpeer.co.jp", true },
{ "medpeer.jp", true },
{ "medpics.com", true },
+ { "medpost.biz", true },
+ { "medpost.co", true },
+ { "medpost.info", true },
+ { "medpost.me", true },
+ { "medpost.mobi", true },
+ { "medpost.tv", true },
+ { "medpost.us", true },
+ { "medpostcare.com", true },
+ { "medpostclinic.com", true },
+ { "medpostdoctor.com", true },
+ { "medpostdoctors.com", true },
+ { "medpostemergency.com", true },
+ { "medpostexpresscare.com", true },
+ { "medposthealth.com", true },
+ { "medposthealthcare.com", true },
+ { "medpostimmediatecare.com", true },
+ { "medpostmedical.com", true },
+ { "medpostphysicians.com", true },
+ { "medposturgentcare.biz", true },
+ { "medposturgentcare.co", true },
+ { "medposturgentcare.com", true },
+ { "medposturgentcare.info", true },
+ { "medposturgentcare.net", true },
+ { "medposturgentcare.org", true },
+ { "medpostwalkincare.com", true },
+ { "medpostwellness.com", true },
{ "medschat.com", true },
{ "medtalents.ch", true },
{ "medtehnika.ua", true },
@@ -24463,7 +25464,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "meetingmanage.nl", true },
{ "meetingmanager.ovh", true },
{ "meetings2.com", true },
- { "meetmibaby.co.uk", true },
{ "meetmygoods.com", true },
{ "meetscompany.jp", true },
{ "meeusen-usedcars.be", true },
@@ -24477,7 +25477,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "megabounce.co.uk", true },
{ "megabounceni.co.uk", true },
{ "megabouncingcastles.com", true },
- { "megafilmesplay.net", true },
{ "megaflowers.ru", true },
{ "megagifs.de", true },
{ "megainflatables.co.uk", true },
@@ -24496,7 +25495,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "meggidesign.com", true },
{ "mego.cloud", true },
{ "megumico.net", true },
- { "megustariasaber.com", true },
{ "megztosidejos.lt", true },
{ "meh.is", true },
{ "mehalick.com", true },
@@ -24541,6 +25539,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mekesh.ru", true },
{ "meklon.net", true },
{ "mekongeye.com", true },
+ { "mekongmontessori.com", true },
{ "melaniebernhardt.com", true },
{ "melaniegruber.de", true },
{ "melbourne.dating", true },
@@ -24560,6 +25559,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "melnessgroup.com", true },
{ "melnikov.ch", true },
{ "melodicprogressivehouse.com", true },
+ { "melodict.com", true },
{ "melodiouscode.co.uk", true },
{ "melodiouscode.com", true },
{ "melodiouscode.net", true },
@@ -24577,11 +25577,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "meme.institute", true },
{ "memememememememe.me", true },
{ "memepasmal.net", true },
+ { "memes.nz", true },
{ "memesbee.com", true },
{ "memfrob.org", true },
{ "memiux.com", true },
{ "memo-linux.com", true },
{ "memo.ee", true },
+ { "memo2ch.com", true },
{ "memoire-resistance-ariege.fr", true },
{ "memorycards.ie", true },
{ "memoryex.net", true },
@@ -24591,6 +25593,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mendipbouncycastles.co.uk", true },
{ "mendozagenevieve.com", true },
{ "mendy.jp", true },
+ { "menhadendefenders.org", true },
{ "menielias.com", true },
{ "menkyo-blog.com", true },
{ "mennace.com", true },
@@ -24601,11 +25604,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mensagemdaluz.com", true },
{ "mensagensaniversario.com.br", true },
{ "mensagensdeconforto.com.br", true },
- { "mensagensperfeitas.com.br", true },
{ "mensarena.gr", true },
{ "mensch-peter.me", true },
{ "mentalhealthmn.org", true },
{ "mentaltraining-fuer-musiker.ch", true },
+ { "mentecuriosa.net", true },
{ "mentiq.az", true },
{ "mentorithm.com", true },
{ "mentz.info", true },
@@ -24613,14 +25616,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "menuel.me", true },
{ "menuonlineordering.com", true },
{ "menzietti.it", true },
- { "meo.de", true },
{ "mephedrone.org", true },
{ "meps.net", true },
{ "mer.gd", true },
{ "merakilp.com", true },
{ "meransuedtirol.com", true },
- { "mercadobitcoin.com.br", true },
- { "mercadobitcoin.net", true },
+ { "meraseo.com", true },
{ "mercadoleal.com.br", true },
{ "mercadopago.com", true },
{ "mercamaris.es", true },
@@ -24637,7 +25638,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mercuryamericas.com", false },
{ "meremeti-online.gr", true },
{ "meremobil.dk", true },
- { "merenbach.com", true },
+ { "merenbach.com", false },
{ "merenita.com", true },
{ "merenita.eu", true },
{ "merenita.net", true },
@@ -24645,15 +25646,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "meric-graphisme.info", true },
{ "meridianfresno.com", true },
{ "meridianmetals.com", true },
- { "meridianstore.com.br", true },
{ "merkel.me", true },
{ "merlet.eu", true },
{ "merlinsoap.com", true },
- { "merloat.com", false },
{ "merojob.com", true },
{ "meronberry.jp", true },
- { "mers.one", true },
- { "merson.org", true },
{ "merson.tv", true },
{ "mertarauh.com", true },
{ "mertcangokgoz.com", true },
@@ -24686,9 +25683,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "metachris.com", true },
{ "metacoda.com", true },
{ "metacode.biz", true },
- { "metadatawiki.com", true },
{ "metaether.net", true },
{ "metafurquest.net", true },
+ { "metallomania.it", true },
{ "metallosajding.ru", true },
{ "metalu.ch", true },
{ "metanic.services", true },
@@ -24715,6 +25712,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "meteobox.sk", true },
{ "meteocat.net", true },
{ "meteorapp.space", true },
+ { "meteorites-for-sale.com", true },
{ "meteorologiaenred.com", true },
{ "meteosmit.it", true },
{ "meter.md", true },
@@ -24726,16 +25724,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "metro-lawn-care.com", true },
{ "metro-web.net", true },
{ "metroairvirtual.com", true },
- { "metrobriefs.com", true },
+ { "metrodetroitmommy.com", true },
{ "metrolush.com", true },
{ "metron-eging.com", true },
{ "metron-networks.com", true },
{ "metron-online.com", true },
{ "metronaut.de", true },
{ "metropop.ch", true },
- { "metsasta.com", true },
{ "mettekopp.dk", true },
{ "meu-solutions.com", true },
+ { "meubanco7.com.br", true },
+ { "meuble-house.fr", true },
{ "meujeitodigital.com.br", false },
{ "meupainel.me", true },
{ "meurisse.org", true },
@@ -24745,6 +25744,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mexican.dating", true },
{ "mexicanjokes.net", true },
{ "mexico.sh", true },
+ { "mexicodental.co", true },
{ "mexicom.org", true },
{ "meyash.co", true },
{ "mf-fischer.de", true },
@@ -24752,9 +25752,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mfits.co.uk", true },
{ "mflodin.se", true },
{ "mfxbe.de", true },
- { "mfxxx.cn", true },
{ "mgi.gov", true },
- { "mgknet.com", true },
+ { "mgiljum.com", true },
{ "mglink.be", true },
{ "mgrossklaus.de", true },
{ "mgrt.net", true },
@@ -24772,18 +25771,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mi-beratung.de", true },
{ "mi-so-ji.com", true },
{ "mi80.com", true },
+ { "mi92.ru", true },
{ "miadennees.com", true },
{ "miagexport.com", true },
{ "mialquilerdecoches.com", true },
+ { "miamaibaum.com", true },
{ "miaonagemi.com", true },
{ "miaoubox.com", true },
{ "miaowo.org", true },
{ "miasarafina.de", true },
{ "miavierra.org", true },
+ { "mibh.de", true },
{ "mibuiin.com", true },
{ "micado-software.com", true },
{ "micalodeal.ch", true },
{ "micbase.com", true },
+ { "micelius.com", true },
{ "michadenheijer.com", true },
{ "michael-schefczyk.de", true },
{ "michael-schilling.de", true },
@@ -24793,13 +25796,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "michaelband.co", true },
{ "michaelband.com", true },
{ "michaelcullen.name", true },
- { "michaeleichorn.com", true },
{ "michaelhrehor.com", true },
{ "michaeliscorp.com", true },
{ "michaelismold.com", true },
{ "michaeljdennis.com", true },
{ "michaelkuchta.me", true },
+ { "michaell.io", true },
+ { "michaell.xyz", true },
{ "michaelleibundgut.com", true },
+ { "michaelloveys.com", true },
{ "michaelpelletterie.it", true },
{ "michaelpfrommer.de", true },
{ "michaelpfrommer.pub", true },
@@ -24807,7 +25812,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "michaelschubert.com", true },
{ "michaelschule-rheine.de", true },
{ "michaelslatkine.com", true },
- { "michaelsnoeren.nl", true },
{ "michaelsweater.com", true },
{ "michaeltaboada.me", true },
{ "michaeltroger.com", true },
@@ -24828,10 +25832,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "michelskovbo.dk", true },
{ "michiganstateuniversityonline.com", true },
{ "michiganunionoptout.com", true },
+ { "michilaw.com", true },
{ "michmexguides.com.mx", true },
{ "michu.pl", true },
{ "mickelvaessen.com", true },
- { "miconcinemas.com", true },
{ "micopal.com", true },
{ "micr.io", true },
{ "micr0lab.org", true },
@@ -24844,11 +25848,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "microlog.org", true },
{ "micromata.de", true },
{ "micromind.io", true },
+ { "micromookie.com", true },
{ "microneedlingstudio.se", true },
{ "microsoftaffiliates.azurewebsites.net", true },
{ "microvb.com", true },
{ "microwesen.de", true },
{ "microzubr.com", true },
+ { "micsell.com", true },
{ "midair.io", true },
{ "midasjewellery.com.au", true },
{ "midcarolinaregionalairport.com", true },
@@ -24862,7 +25868,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "midlandroofingri.com", true },
{ "midlandsfundays.co.uk", true },
{ "midlandsphotobooths.co.uk", true },
- { "midnight-visions.de", true },
{ "midnightmango.co.uk", true },
{ "midnightmango.de", true },
{ "midnightmechanism.com", true },
@@ -24873,7 +25878,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "midwestbloggers.org", true },
{ "midwestplus.com", true },
{ "miegl.com", true },
- { "miembarcacion.com", true },
+ { "miegl.cz", true },
{ "miemus.eu", true },
{ "mietwohnungen-vermietung.com", true },
{ "mieuxgrandir.ch", true },
@@ -24889,17 +25894,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "miguelmenendez.pro", true },
{ "miguelmoura.com", true },
{ "miguia.tv", true },
+ { "mihgroup.eu.org", true },
+ { "mihgroup.net", true },
{ "mihnea.net", true },
{ "mijailovic.net", true },
{ "mijcorijneveld.nl", true },
{ "mijn-financien.be", true },
- { "mijnavg.eu", true },
{ "mijnetz.nl", true },
{ "mijnkerstkaarten.be", true },
{ "mijnkinderkleding.com", true },
{ "mijnpartijhandel.nl", true },
{ "mijnreisoverzicht.nl", true },
{ "mijnstembureau.nl", true },
+ { "mijntelefoonboek.com", true },
{ "mijntransacties.nl", true },
{ "mika.moe", true },
{ "mikadoe.nl", true },
@@ -24925,9 +25932,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mikewest.org", true },
{ "mikewillia.ms", true },
{ "mikewrites.online", true },
- { "mikewritesstuff.com", true },
{ "mikeybailey.org", true },
- { "mikhirev.ru", true },
{ "mikhlevich.ru", true },
{ "miki-boras.de", true },
{ "miki.it", true },
@@ -24942,9 +25947,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mikroskeem.eu", true },
{ "mikumaycry.com", true },
{ "mikupic.com", true },
- { "mikywow.eu", true },
+ { "mikusa.xyz", true },
{ "mil-spec.ch", true },
- { "mil0.com", true },
{ "milakirschner.de", true },
{ "milania.de", true },
{ "milanpala.cz", false },
@@ -24959,8 +25963,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "milkameglepetes.hu", true },
{ "milkandcookies.ca", true },
{ "milkingit.co.uk", true },
- { "milkingit.net", true },
{ "milktea.info", true },
+ { "milkypond.org", true },
{ "millanova.wedding", false },
{ "milldyke.com", true },
{ "milldyke.nl", true },
@@ -25000,11 +26004,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mindcoding.ro", true },
{ "mindercasso.nl", true },
{ "mindfactory.de", true },
+ { "mindhunter.info", true },
{ "mindleaking.org", true },
+ { "mindmax.fi", true },
{ "mindmeister.com", true },
{ "mindoktor.se", false },
{ "mindorbs.com", true },
{ "mindox.com.br", true },
+ { "mindsetatx.com", true },
{ "mindstretchers.co.uk", true },
{ "mine-craftlife.com", true },
{ "mine-pixl.de", true },
@@ -25032,12 +26039,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "minf3-games.de", true },
{ "minfin.gov.ua", true },
{ "mingky.net", true },
- { "mingkyaa.com", true },
+ { "mingming.info", true },
{ "mingram.net", true },
{ "mingtreerealty.com", true },
{ "mingwah.ch", true },
{ "minh.at", false },
{ "mini2.fi", true },
+ { "minican.net", true },
{ "minigames.com", true },
{ "miniglueck.net", true },
{ "minigolf-reisinger.com", true },
@@ -25051,13 +26059,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "minimbah.com.au", true },
{ "minimvc.com", true },
{ "miningtronics.com", true },
+ { "minisoft4u.ir", true },
{ "ministeriumfuerinternet.de", true },
- { "minitruckin.net", true },
{ "minitrucktalk.com", true },
{ "minivaro.de", true },
{ "minkymoon.jp", true },
{ "minnesotakinkyyouth.org", true },
- { "minnesotamathcorps.org", true },
{ "minnesotareadingcorps.org", true },
{ "minnit.chat", true },
{ "minobar.com", true },
@@ -25068,10 +26075,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mintosherbs.com", true },
{ "mintrak2.com", true },
{ "mintse.com", true },
+ { "minttang.cn", true },
{ "minu.link", true },
{ "minube.co.cr", true },
{ "minutashop.ru", true },
{ "minux.info", true },
+ { "mionerve.com", true },
+ { "mionerve.org", true },
{ "mipapo.de", true },
{ "miproximopaso.org", true },
{ "mipueblohoy.com", true },
@@ -25081,6 +26091,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "miraheze.org", true },
{ "miraidenshi.com", true },
{ "miraiex.com", true },
+ { "miraste.com.br", true },
+ { "mirazperu.com", true },
+ { "mircarfinder.ru", true },
{ "mirch.com", true },
{ "mirco-grams.de", true },
{ "mireiaseuba.com", true },
@@ -25091,12 +26104,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mirkofranz.de", true },
{ "mirodasilva.be", true },
{ "mironet.cz", true },
- { "mirrorbot.ga", true },
{ "mirrorsedgearchive.de", true },
{ "mirshak.com", true },
{ "mirtes.cz", true },
{ "mirtouf.fr", true },
{ "misakacloud.net", true },
+ { "misakatang.cn", true },
{ "misakiya.co.jp", true },
{ "misanci.cz", true },
{ "mischak.net", true },
@@ -25126,7 +26139,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "missualready.com", true },
{ "missyou.link", true },
{ "mistacms.com", true },
+ { "mistaken.pl", true },
{ "mister-matthew.de", true },
+ { "misterseguros.com.br", true },
{ "mistreaded.com", true },
{ "mistybox.com", true },
{ "misupport.dk", true },
@@ -25162,7 +26177,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mitylite.com", true },
{ "mitzpettel.com", true },
{ "miui-germany.de", true },
- { "mivestuariolaboral.com", true },
{ "mivzak.im", true },
{ "mivzakim.biz", true },
{ "mivzakim.info", true },
@@ -25173,14 +26187,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "miweb.cr", false },
{ "mixinglight.com", true },
{ "mixmister.com", true },
- { "mixnshake.com", true },
{ "mixposure.com", true },
{ "mixrepairs.co.uk", true },
{ "mixtafrica.com", true },
{ "mixtape.moe", true },
{ "mixx.com.hk", true },
{ "miyatore.com", true },
- { "miyoshi-kikaku.com", true },
+ { "miyoshi-kikaku.com", false },
{ "mizipack.com", true },
{ "mizque.ch", true },
{ "mizu.coffee", true },
@@ -25194,12 +26207,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mjec.net", true },
{ "mjlaurindo.pt", true },
{ "mjmedia.co.za", true },
- { "mjscustomcreations.com.au", true },
+ { "mjmnagy.info", true },
+ { "mjpak.com.au", true },
{ "mjt.me.uk", true },
{ "mk89.de", true },
{ "mkaciuba.com", true },
{ "mkakh.com", true },
- { "mkasu.org", false },
{ "mkbouncycastles.co.uk", true },
{ "mkbouncyhire.co.uk", true },
{ "mkcert.org", true },
@@ -25234,25 +26247,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mlundberg.se", true },
{ "mlvbphotography.com", true },
{ "mlytics.com", true },
- { "mm-wife.com", true },
{ "mm13.at", true },
{ "mm404.com", true },
{ "mma-acareporting.com", true },
{ "mmalisz.com", true },
- { "mmaps.org", true },
{ "mmbb.org", true },
+ { "mmgal.com", true },
+ { "mmin.us", false },
{ "mmmarco.com", true },
{ "mmogah.com", true },
{ "mmonit.com", true },
{ "mms.is", true },
{ "mmt.my", true },
{ "mmucha.de", true },
+ { "mna7e.com", true },
{ "mncloud.de", true },
+ { "mnconsulting.xyz", true },
{ "mnd.sc", true },
{ "mne.moe", true },
{ "mneerup.dk", true },
{ "mnemonic.ninja", true },
{ "mnguyen.io", true },
+ { "mnienamel.com", true },
{ "mnitro.com", true },
{ "mnium.de", true },
{ "mnml.art", true },
@@ -25260,6 +26276,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mnnknz.de", true },
{ "mnsure.org", true },
{ "mnt-tech.fr", true },
+ { "mnt9.de", true },
{ "mo-journal.com", true },
{ "mo.nl", true },
{ "mo2021.de", true },
@@ -25267,12 +26284,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moabpapier.de", true },
{ "moabygg.se", true },
{ "moahmo.com", true },
+ { "moas.design", true },
+ { "moas.photos", true },
{ "mobag.ru", false },
{ "mobal.com", true },
{ "mobi2go.com", true },
- { "mobidea.com", true },
{ "mobifinans.ru", true },
- { "mobil-bei-uns.de", true },
{ "mobila-chisinau.md", true },
{ "mobilcom-debitel-empfehlen.de", true },
{ "mobilcom-debitel.de", true },
@@ -25307,6 +26324,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mococo.co.uk", true },
{ "modaexecutiva.com.br", true },
{ "modafinil.com", true },
+ { "modafinil.net", true },
{ "modafinil.wiki", true },
{ "modafo.com", true },
{ "modalogi.com", true },
@@ -25333,10 +26351,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moderncommercialrealestate.com", true },
{ "modifiedmind.com", true },
{ "modistry.com", true },
- { "modistryusercontent.com", true },
{ "modmountain.com", true },
{ "modnitsa.info", true },
+ { "modonor.dk", true },
{ "modosaude.com.br", true },
+ { "mods-community.de", true },
+ { "mods-pic.de", true },
{ "modul21.com", true },
{ "modul21.eu", true },
{ "module.market", true },
@@ -25345,17 +26365,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moebel-vergleichen.com", true },
{ "moechel.com", true },
{ "moeclue.com", true },
+ { "moecraft.net", true },
{ "moefactory.com", true },
{ "moehrke.cc", true },
{ "moekes.amsterdam", true },
{ "moeking.me", true },
{ "moellers.systems", true },
{ "moenew.top", true },
+ { "moepass.com", true },
{ "moeqing.net", false },
{ "moetrack.com", true },
{ "mofidmed.com", true },
{ "mofohome.dyndns.org", true },
- { "mogooin.com", true },
{ "moha-swiss.com", true },
{ "mohanmekap.com", true },
{ "mohela.com", true },
@@ -25372,23 +26393,25 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mojefedora.cz", true },
{ "mojilitygroup.com", true },
{ "mojizuri.com", true },
+ { "mojnet.eu", true },
+ { "mojnet.net", true },
{ "mojoco.co.za", true },
{ "mojzis.com", true },
{ "mojzis.cz", true },
{ "mojzisova.com", true },
{ "mok.pw", true },
{ "mokeedev.review", true },
- { "mokhtarmial.com", true },
+ { "mokhtarmial.com", false },
{ "mokote.com", true },
- { "mokum-organics.com", false },
{ "molb.org", true },
{ "molecularbiosystems.org", true },
+ { "moleskinestudio.com", true },
{ "molinero.xyz", true },
{ "mollaretsmeningitis.org", true },
{ "mollie.com", true },
{ "molokai.org", true },
{ "molti.hu", true },
- { "molun.net", false },
+ { "molun.net", true },
{ "molunerfinn.com", true },
{ "molwick.com", true },
{ "momentsofimpact.info", true },
@@ -25416,7 +26439,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mondedie.fr", true },
{ "mondial-movers.nl", true },
{ "mondo-it.ch", true },
+ { "monelephantapois.com", true },
{ "moneni.com", true },
+ { "moneseglobal.com", true },
{ "moneybird.com", true },
{ "moneybird.nl", true },
{ "moneychangersoftware.com", true },
@@ -25455,6 +26480,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "monpermisvoiture.com", true },
{ "monpetitforfait.com", true },
{ "monpetitmobile.com", true },
+ { "monplay.host", true },
{ "monsieurbureau.com", true },
{ "monsieursavon.ch", true },
{ "monstermashentertainments.co.uk", true },
@@ -25466,6 +26492,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "montanwerk.de", true },
{ "montarfotoaki.com", true },
{ "montas.io", true },
+ { "montazer.net", true },
{ "montemanik.com", true },
{ "montenero.pl", true },
{ "montessori.edu.vn", true },
@@ -25479,9 +26506,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "monzo.com", true },
{ "monzo.me", true },
{ "moo.la", true },
- { "moobo.co.jp", true },
{ "moodfoods.com", true },
- { "moodforsex.com", true },
{ "moodzshop.com", true },
{ "moolah.rocks", true },
{ "moon.fish", true },
@@ -25510,7 +26535,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moosmann-moehrle.de", true },
{ "moot-info.co.za", true },
{ "moovablestorage.com", true },
- { "mop321.com", true },
{ "moparcraft.net", true },
{ "moparisthebest.com", true },
{ "moparisthebest.net", true },
@@ -25522,6 +26546,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moplx.com", true },
{ "moppeleinhorn.de", true },
{ "moppy.org", true },
+ { "mora.pl", true },
{ "morbatex.com", true },
{ "morbiceramicindustry.com", true },
{ "morbitzer.de", true },
@@ -25541,7 +26566,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "morethancode.be", true },
{ "morethandigital.info", true },
{ "morganino.it", true },
- { "morgansjewelerspv.com", true },
{ "morgansleisure.co.uk", true },
{ "morgner.com", true },
{ "moritz-baestlein.de", true },
@@ -25553,6 +26577,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "morningcurve.com", true },
{ "morningstar.moe", true },
{ "morphy2k.io", true },
+ { "morris.computer", true },
{ "morrisby.com", true },
{ "morteruelo.net", true },
{ "mortgagecalculator.biz", true },
@@ -25570,8 +26595,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mosos.de", true },
{ "mosquitojoe.com", true },
{ "mosscade.com", true },
- { "mosshi.be", true },
{ "mosstier.com", true },
+ { "mostcomfortableworkboots.net", true },
{ "mostholynameofjesus.org", true },
{ "mostlyoverhead.com", true },
{ "motd.ch", true },
@@ -25591,16 +26616,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "motionless.nl", true },
{ "motionvideos.uk", true },
{ "motiweb.fr", true },
+ { "motocollection.pl", true },
+ { "motogb.net", true },
{ "motohell.com", true },
{ "motojato.com.br", true },
{ "motonauticaibiza.com", true },
+ { "motor-forum.nl", true },
{ "motoreflex.com", true },
{ "motorpointarenacardiff.co.uk", true },
{ "motorring.ru", true },
{ "motorsplus.com", false },
{ "motoryachtclub-radolfzell.de", true },
{ "motosikletevi.com", true },
+ { "motospaya.com", true },
{ "motostorie.blog", false },
+ { "mototax.ch", true },
{ "motovated.co.nz", true },
{ "motowilliams.com", true },
{ "motransportinfo.com", true },
@@ -25608,10 +26638,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moulinaparoles.ca", true },
{ "mountain-rock.ru", true },
{ "mountainactivitysection.org.uk", true },
+ { "mountainbatchers.de", true },
{ "mountainchalet.blue", true },
- { "mountainroseherbs.com", true },
{ "mountainspringsrentals.ca", true },
- { "mountfarmer.de", true },
{ "mousepotato.uk", true },
{ "moutiezhaller.com", true },
{ "movacare.de", true },
@@ -25619,10 +26648,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moveltix.net", true },
{ "movember.com", false },
{ "movewellnesslab.com", true },
+ { "movfun.ga", true },
{ "movie-cross.net", true },
{ "movie-infos.net", true },
{ "movie1000.com", true },
- { "movie4kto.site", true },
{ "movie4kto.stream", true },
{ "movieboost.nl", true },
{ "moviedeposit.com", true },
@@ -25640,12 +26669,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "moy.cat", true },
{ "moyer.pub", true },
{ "moylen.eu", true },
- { "moysovet.info", false },
{ "mozartgroup.hu", true },
{ "mozektevidi.net", true },
{ "mozilla.cz", true },
{ "mozzez.de", true },
- { "mp3gratuiti.com", true },
{ "mpa-pro.fr", true },
{ "mpac.ca", false },
{ "mpc-hc.org", true },
@@ -25653,22 +26680,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mpetroff.net", true },
{ "mpg-universal.com", true },
{ "mpgaming.pro", true },
- { "mphwinkel.nl", true },
{ "mpkrachtig.nl", true },
{ "mpkshop.com.br", true },
{ "mplanetphl.fr", true },
{ "mplant.io", true },
{ "mplicka.cz", true },
{ "mplusm.eu", true },
- { "mpnpokertour.com", true },
{ "mprsco.eu", true },
{ "mpsgarage.com.au", true },
{ "mpsoundcraft.com", true },
{ "mpu-vorbereitung.com", true },
+ { "mqas.net", true },
{ "mr-anderson.org", true },
{ "mr-designer-oman.com", true },
{ "mr-nachhilfe.de", true },
{ "mr-wolf.nl", false },
+ { "mralonas.ml", true },
{ "mrbmafrica.com", true },
{ "mrbounce.com", true },
{ "mrbouncescrazycastles.co.uk", true },
@@ -25677,6 +26704,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mrca-sharp.com", true },
{ "mrcoolevents.com", true },
{ "mrd.ninja", true },
+ { "mrdatenschutz.de", true },
{ "mrdayman.com", true },
{ "mremallin.ca", true },
{ "mrevolution.eu", true },
@@ -25691,6 +26719,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mrketolocksmith.com", true },
{ "mrknee.gr", true },
{ "mrkrabat.de", true },
+ { "mrmad.com.tw", true },
{ "mrnh.de", true },
{ "mrprintables.com", true },
{ "mrs-labo.jp", true },
@@ -25699,6 +26728,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mrserge.lv", true },
{ "mrsk.me", true },
{ "mrstat.co.uk", true },
+ { "mrstuudio.ee", true },
{ "mrtunnel.club", true },
{ "mruczek.ga", true },
{ "mrv.li", true },
@@ -25731,6 +26761,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mstdn.fr", true },
{ "mstdn.io", true },
{ "mstdn.onl", false },
+ { "mstdn.vodka", true },
{ "msuna.net", true },
{ "msv-limpezas.pt", true },
{ "msx.org", true },
@@ -25746,8 +26777,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mtauburnassociates.com", true },
{ "mtb.wtf", true },
{ "mtd.org", true },
+ { "mte.sk", true },
{ "mteleport.net", true },
- { "mtg-tutor.de", true },
{ "mtgeni.us", true },
{ "mtgenius.com", true },
{ "mtgsuomi.fi", true },
@@ -25759,7 +26790,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mtiryaki.com", true },
{ "mtlconcerts.com", true },
{ "mtltransport.com", true },
- { "mtnz.co.za", true },
{ "mtouch.facebook.com", false },
{ "mtravelers.net", true },
{ "mtrip.com", true },
@@ -25770,33 +26800,33 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mu.search.yahoo.com", false },
{ "muabannhanh.com", false },
{ "mubiflex.nl", true },
- { "muchohentai.com", true },
{ "muckingabout.eu", true },
{ "muckrack.com", true },
{ "mucmail.de", true },
{ "muctool.de", true },
- { "mud-status.de", true },
{ "mudbenesov.cz", true },
{ "mudcrab.us", false },
+ { "mudit.xyz", true },
{ "muehlemann.net", true },
- { "muel.io", true },
{ "muelhau.pt", true },
{ "muell-weg.de", true },
{ "muellapp.com", true },
+ { "mueller-gaestehaus.de", true },
{ "muenchberger.com", true },
{ "mufibot.net", true },
{ "muguayuan.com", true },
{ "muh.io", true },
{ "mui.jp", true },
+ { "muilties.com", true },
{ "muitadica.com", true },
{ "mujerfutura.com", true },
{ "muk-kobetsu.com", true },
{ "mukilteodentalarts.com", true },
{ "mukilteoeuropeanautorepair.com", true },
+ { "mukyu.moe", true },
{ "mulaccosmetics.com", true },
{ "mulaisehat.com", true },
{ "mulej.net", true },
- { "mulheres18.com", true },
{ "muling.lu", true },
{ "mullens-usedcars.be", true },
{ "mullerimoveisrj.com.br", true },
@@ -25804,13 +26834,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "multibit.org", true },
{ "multibomasm.com.br", true },
{ "multicomhost.com", true },
- { "multigamecard.com", true },
{ "multigeist.de", true },
{ "multikalender.de", false },
{ "multimail.work", true },
{ "multimatte.com", false },
{ "multimed.krakow.pl", true },
{ "multimedia-pool.com", true },
+ { "multimediapc.de", true },
{ "multiplayernow.com", true },
{ "multipleservers.com", true },
{ "multirep.ch", true },
@@ -25840,10 +26870,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mundotortugas.com", true },
{ "mundschenk.at", true },
{ "mundtec.com.br", true },
+ { "munduch.cz", true },
+ { "munduch.eu", true },
{ "munirajiwa.com", true },
{ "munki.org", true },
{ "munkibuilds.org", true },
{ "munwr.com", true },
+ { "muoivancauhoivisao.com", true },
{ "muqu.co", true },
{ "mur-vegetal-interieur.fr", true },
{ "murakami-sah.com", true },
@@ -25852,14 +26885,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "murfy.nz", true },
{ "murmel.it", false },
{ "murof.com.br", true },
+ { "murphycraftbeerfest.com", true },
{ "murray.xyz", true },
{ "murraya.cn", true },
{ "murzik.space", true },
{ "musa.gallery", true },
{ "muscle-tg.com", true },
- { "muscleangels.com", true },
{ "musclecarresearch.com", true },
{ "muscolinomusic.com", true },
+ { "museclef.com", true },
{ "musehelix.com", true },
{ "muses-success.info", true },
{ "musettishop.com", true },
@@ -25887,6 +26921,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "musicstudio.pro", true },
{ "musicwear.cz", true },
{ "musicworkout.de", true },
+ { "musiikkiohjelmapalvelu.fi", true },
{ "musik-mentaltraining.ch", true },
{ "musikholics.com", true },
{ "musikverein-elten.de", true },
@@ -25897,7 +26932,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "muspla.com", true },
{ "muspla.com.br", true },
{ "musselsblog.com", true },
- { "mustafa.space", true },
{ "mustafaturhan.com", true },
{ "mustard.co.uk", true },
{ "mustardking.me", true },
@@ -25917,6 +26951,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "muurlingoogzorg.nl", true },
{ "muusikoiden.net", true },
{ "muwatenraqamy.org", true },
+ { "muy.ooo", true },
{ "muz2u.ru", true },
{ "muzeumkomiksu.eu", true },
{ "muzhijy.com", true },
@@ -25925,13 +26960,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mv-wohnen.de", true },
{ "mvandek.nl", true },
{ "mvbits.com", true },
+ { "mvbug.com", true },
{ "mvisioncorp.com", true },
{ "mvistatic.com", true },
{ "mvno.io", true },
{ "mvp-stars.com", true },
+ { "mvwoensel.com", true },
{ "mw.search.yahoo.com", false },
{ "mwainc.org", true },
- { "mwalz.com", true },
{ "mwamitours.com", true },
{ "mware-staging.azurewebsites.net", true },
{ "mwavuli.co.ke", true },
@@ -25950,7 +26986,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mxn8.com", true },
{ "my-aftershave-store.co.uk", true },
{ "my-best-wishes.com", true },
- { "my-cdn.de", true },
+ { "my-co.ir", true },
{ "my-contract.ch", true },
{ "my-contract.info", true },
{ "my-contract.net", true },
@@ -25985,6 +27021,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myapexcard.com", true },
{ "myaspenheights.com", true },
{ "mybagofcoffee.com", true },
+ { "mybakkupakku.com", true },
{ "mybasementdoctor.com", true },
{ "mybb.com", true },
{ "mybb.de", true },
@@ -25996,9 +27033,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mybon.at", false },
{ "mybonfire.com", true },
{ "myboothang.com", true },
+ { "mybreastcancerjourney.com", true },
{ "mybus.ro", true },
{ "mybusiness.wien", true },
{ "mycamda.com", true },
+ { "mycamshowhub.com", true },
+ { "mycard.moe", true },
{ "mycareersfuture.sg", true },
{ "mycarwashers.com", true },
{ "mycc.be", true },
@@ -26007,6 +27047,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mycircleworks.com", true },
{ "myclasscam.com", true },
{ "myclasscam.org", true },
+ { "myclgnotes.com", true },
{ "myclinicalstudybuddy.com", true },
{ "mycloud-system.com", true },
{ "mycofairtrade.com", true },
@@ -26018,10 +27059,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mycr.eu", true },
{ "mycreativenook.com", true },
{ "mycreditcardcenter.com", true },
+ { "mycreditunion.gov", true },
{ "mycrypnet.io", true },
{ "mycrypto.com", false },
{ "mycrystalgrove.com", true },
- { "mycuco.it", true },
{ "mycustomwriting.com", true },
{ "mydatadoneright.eu", true },
{ "mydaywebapp.com", true },
@@ -26035,7 +27076,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mydoc.fr", true },
{ "mydocserve.com", true },
{ "mydomaindesk.com", true },
- { "mydreamlifelab.com", true },
{ "mydreamshaadi.in", true },
{ "myduffyfamily.com", true },
{ "myeasybooking.de", true },
@@ -26048,6 +27088,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myfantasysportstalk.com", true },
{ "myfedloan.org", true },
{ "myfirenet.com", true },
+ { "myfloridadeferredcomp.com", true },
{ "myforfaitmobile.com", true },
{ "myfreemp3.click", true },
{ "myfrenchtattoo.fr", true },
@@ -26055,7 +27096,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mygadgetguardian.lookout.com", false },
{ "mygallery.homelinux.net", true },
{ "mygate.at", false },
- { "mygedit.com", true },
{ "mygeneral.org", true },
{ "mygeotrip.com", true },
{ "mygest.me", true },
@@ -26074,6 +27114,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myhollywoodnews.com", true },
{ "myhome-24.pl", true },
{ "myhuthwaite.com", true },
+ { "myibidder.com", true },
{ "myimds.com", true },
{ "myimmitracker.com", true },
{ "myinvite.nl", true },
@@ -26093,6 +27134,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mylittlechat.ru", true },
{ "myliveupdates.com", true },
{ "myloan.hk", true },
+ { "myloneworkers.com", true },
{ "mylookout.com", false },
{ "mylstrom.com", true },
{ "mylucknursinghome.com", true },
@@ -26105,6 +27147,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mymedz.nl", true },
{ "mymixtapez.com", true },
{ "mymommyworld.com", true },
+ { "mymonture.com", true },
{ "mymotor.nl", true },
{ "myms.eu", true },
{ "mymun.com", true },
@@ -26122,7 +27165,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mynortherngarden.com", true },
{ "myonline.hu", true },
{ "myonline.store", true },
- { "myonlinevehicleinsurance.com", true },
+ { "myopd.in", true },
{ "myoptumhealthcomplexmedical.com", true },
{ "myoptumhealthparentsteps.com", true },
{ "myotopie.de", true },
@@ -26131,6 +27174,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myownconference.cloud", true },
{ "myownconference.com", true },
{ "myownconference.com.ua", true },
+ { "myownconference.net", true },
{ "myownconference.pl", true },
{ "myownconference.ru", true },
{ "myowndisk.com", true },
@@ -26143,6 +27187,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mypcqq.cc", true },
{ "myperfecthome.ca", true },
{ "myperks.in", true },
+ { "myphamaplus.org", true },
{ "myphotoshopbrushes.com", true },
{ "mypillcard.com", true },
{ "mypizza-bremen.de", true },
@@ -26152,10 +27197,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myprintcard.de", true },
{ "myproblog.com", true },
{ "myprotime.eu", true },
- { "myproxy.eu.org", true },
- { "mypup.nl", true },
+ { "mypt3.com", true },
{ "myrandomtips.com", true },
- { "myranicol.com", true },
{ "myraytech.net", false },
{ "myrealestatemate.com.au", true },
{ "myrealestateschool.com", true },
@@ -26189,6 +27232,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myrepublic.mobi", true },
{ "myrepublic.my", true },
{ "myrepublic.net", true },
+ { "myrepublic.net.au", true },
{ "myrepublic.nz", true },
{ "myrepublic.ph", true },
{ "myrepublic.rocks", true },
@@ -26220,18 +27264,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myrotvorets.center", true },
{ "myrotvorets.news", true },
{ "myrp.co", true },
+ { "mysad.de", true },
{ "mysber.ru", true },
{ "myschoolphoto.org", true },
{ "myseatime.com", true },
{ "mysecretcase.com", false },
{ "mysectools.org", true },
{ "myself5.de", true },
+ { "myservice.store", false },
{ "myservicearl.com", true },
{ "mysexydate24.com", true },
- { "myshirtsize.com", true },
{ "mysignal.com", true },
{ "mysize-condooms.nl", true },
{ "mysmelly.com", true },
+ { "mysocialporn.com", true },
{ "mysockfactory.ch", true },
{ "mysockfactory.com", true },
{ "mysocrat.com", true },
@@ -26246,13 +27292,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "mystic-welten.de", true },
{ "mystickphysick.com", true },
{ "mysticplumes.com", true },
+ { "mysticrs.tk", true },
{ "mystorymonster.com", true },
{ "mystudycart.com", true },
{ "myswissmailaddress.com", true },
+ { "myte.ch", true },
{ "mytfg.de", true },
{ "mythemeshop.com", false },
{ "mythengay.ch", true },
{ "mythicdelirium.com", true },
+ { "mytime.gl", true },
{ "myting.net", true },
{ "mytraiteurs.com", true },
{ "mytripcar.co.uk", true },
@@ -26290,10 +27339,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "myzina.cz", false },
{ "mz-mz.net", true },
{ "mza.com", true },
+ { "mzcsgo.top", true },
{ "mzh.io", true },
{ "mziulu.me", false },
+ { "mzlive.eu", true },
{ "mzmtech.com", true },
{ "mznet.de", true },
+ { "mzorn.photography", true },
{ "mzstatic.cc", true },
{ "mzzj.de", true },
{ "n-a.date", true },
@@ -26310,7 +27362,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "n2diving.net", true },
{ "n2servers.com", true },
{ "n4v.eu", true },
- { "n5118.com", true },
{ "n6a.net", true },
{ "n7.education", true },
{ "n8ch.net", true },
@@ -26321,11 +27372,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "na-school.nl", true },
{ "naahgluck.de", true },
{ "naam.me", true },
+ { "naarakah.fr", true },
{ "nabaleka.com", true },
{ "nabankco.com", true },
+ { "nabbar.com", true },
{ "nabidkamajetku.cz", true },
{ "nabidkydnes.cz", true },
{ "nabytek-valmo.cz", true },
+ { "nac-6.fr", true },
{ "nacfit.com", true },
{ "nachsendeauftrag.net", true },
{ "nachsenden.info", true },
@@ -26343,10 +27397,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nadyaolcer.fr", true },
{ "nafod.net", true },
{ "naga-semi.com", true },
+ { "naganithin.me", true },
{ "nagashi.ma", false },
+ { "nagata.info", true },
{ "nagaya.biz", true },
{ "nagb.gov", true },
- { "nagb.org", true },
{ "nagel-dentaltechnik.de", true },
{ "nagelfam.com", true },
{ "naggie.net", true },
@@ -26354,12 +27409,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nah.re", true },
{ "nahura.com", true },
{ "nai-job.jp", true },
+ { "naijaxnet.com.ng", true },
{ "nailattitude.ch", true },
{ "nailchiodo.com", true },
{ "nailsalon-aztplus.com", true },
+ { "nailsart.roma.it", true },
{ "nailtodayminneapolis.com", true },
{ "nairobibusinessreview.com", true },
+ { "nais0ne.com", true },
{ "naive.network", true },
+ { "naivetube.com", true },
{ "najany.de", true },
{ "najany.dk", true },
{ "najany.fr", true },
@@ -26370,7 +27429,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nakalabo.jp", true },
{ "nakama.tv", true },
{ "nakandya.com", true },
+ { "nakayama.industries", true },
{ "nakayama.systems", true },
+ { "nakayamaresearch.com", true },
{ "nakedalarmclock.me", true },
{ "nakedtruthbeauty.com", true },
{ "nakene.com", true },
@@ -26380,6 +27441,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nako.no", true },
{ "nalepky-na-zed.cz", true },
{ "nalepte.cz", true },
+ { "nalexandru.xyz", true },
{ "namaanakperempuan.net", true },
{ "namaleaks.com", false },
{ "namazon.org", true },
@@ -26387,8 +27449,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "namegrep.com", true },
{ "nameid.org", true },
{ "namepros.com", true },
+ { "nameproscdn.com", true },
{ "namereel.com", true },
- { "namethatporn.com", true },
{ "nametiles.co", true },
{ "nami.bo", true },
{ "nami.trade", true },
@@ -26398,7 +27460,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "namu.live", true },
{ "namu.moe", true },
{ "namu.wiki", true },
+ { "namus.gov", true },
{ "nan.ci", true },
+ { "nan.ge", true },
{ "nanarose.ch", true },
{ "nanch.com", true },
{ "nancytelford.com", true },
@@ -26423,9 +27487,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nanubo.de", true },
{ "naomi.es", false },
{ "naomiheji.com", true },
- { "naotone.com", true },
{ "napcae.de", true },
{ "napisdata.us", true },
+ { "napkins-wholesale.co.za", true },
+ { "napkins-wholesale.com", true },
+ { "napkins-wholesale.in", true },
+ { "napkins-wholesale.nz", true },
+ { "napkins-wholesale.uk", true },
+ { "napkins-wholesale.us", true },
{ "napolinissanctparts.com", true },
{ "narada.com.ua", true },
{ "narakenkoland.net", true },
@@ -26433,9 +27502,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "narardetval.se", true },
{ "narazaka.net", true },
{ "narduin.xyz", true },
+ { "narenderchopra.com", true },
{ "narfation.org", true },
+ { "nargele.eu", true },
{ "nargileh.nl", true },
{ "naric.com", true },
+ { "narindal.ch", true },
{ "narmos.ch", true },
{ "naro.se", true },
{ "narodniki.com", true },
@@ -26449,31 +27521,34 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nasbi.pl", true },
{ "nasbnation.com", false },
{ "nascio.org", true },
+ { "naseehah.ga", true },
{ "nashdistribution.com", true },
{ "nashikmatka.com", true },
{ "nashira.cz", true },
{ "nashvillebasements.com", true },
{ "nashvillelidsurgery.com", true },
{ "nashzhou.me", true },
+ { "nasosvdom.com.ua", true },
+ { "nasr.mobi", true },
{ "nasrsolar.com", true },
{ "nastoletni.pl", true },
{ "nataldigital.com", true },
{ "nataliedawnhanson.com", true },
- { "natanaelys.com", false },
{ "natation-nsh.com", false },
{ "natchmatch.com", true },
+ { "natecraun.net", false },
{ "natgeofreshwater.com", true },
{ "nathaliebaron.ch", true },
{ "nathaliebaroncoaching.ch", true },
{ "nathaliedijkxhoorn.com", true },
{ "nathaliedijkxhoorn.nl", true },
{ "nathan.io", true },
+ { "nathan.ovh", true },
{ "nathanaeldawe.com", true },
{ "nathancheek.com", false },
{ "nathankonopinski.com", true },
{ "nathanmfarrugia.com", true },
{ "nathansmetana.com", true },
- { "nathumarket.com.br", true },
{ "nation-contracting.com.hk", true },
{ "nationalbank.gov", true },
{ "nationalbanknet.gov", true },
@@ -26484,13 +27559,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nationalmap.gov", true },
{ "nationalpassportservice.info", true },
{ "nationalpriorities.org", true },
- { "nationaltaxprep.com", true },
{ "nationaltrails.ru", true },
{ "nationwiderealtyinvestors.com", true },
{ "natives-team.ch", true },
{ "nativitynj.org", true },
{ "nativs.ch", true },
{ "natlec.com", true },
+ { "natropie.pl", true },
{ "natsumihoshino.com", true },
{ "natuerlichabnehmen.ch", true },
{ "natur.com", true },
@@ -26516,6 +27591,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "naude.co", true },
{ "naughty.audio", true },
{ "naughtytoy.co.uk", true },
+ { "nauris.fi", true },
{ "nausicaahotel.it", true },
{ "naut.ca", true },
{ "nautiljon.com", true },
@@ -26597,7 +27673,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nbrain.de", true },
{ "nbrii.com", true },
{ "nbriresearch.com", true },
- { "nbrown.us", true },
{ "nbur.co.uk", true },
{ "nc-beautypro.fr", true },
{ "nc-formation.fr", true },
@@ -26605,6 +27680,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nc99.co", true },
{ "ncamarquee.co.uk", true },
{ "ncands.net", true },
+ { "ncarmine.com", true },
{ "ncc-efm.com", true },
{ "ncc-efm.org", true },
{ "ncc-qualityandsafety.org", true },
@@ -26615,12 +27691,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nchangfong.com", true },
{ "nchponline.org", true },
{ "ncic.gg", true },
+ { "ncjrs.gov", true },
{ "ncloud.freeddns.org", true },
{ "ncm-malerbetrieb.de", true },
{ "ncsc.gov.uk", true },
{ "ncsccs.com", true },
{ "ncstep.org", true },
{ "nctx.co.uk", true },
+ { "ncua.gov", true },
{ "ndarville.com", true },
{ "ndbt.com", true },
{ "ndcpolipak.com", true },
@@ -26629,6 +27707,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ndfa.net", true },
{ "ndfirefighter.com", true },
{ "ndhlink.com", true },
+ { "ndime.com", true },
{ "ndpbrn-research.org", true },
{ "ndphp.org", true },
{ "ndpigskin.com", true },
@@ -26648,7 +27727,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nebelheim.de", true },
{ "nebenbeiblog.ch", true },
{ "nebra.io", true },
- { "nebracy.com", true },
{ "nebul.at", true },
{ "nebula.exchange", true },
{ "nebulae.co", true },
@@ -26680,6 +27758,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "neglecteddiseases.gov", true },
{ "neheim-huesten.de", true },
{ "nehoupat.cz", true },
+ { "nehrp.gov", true },
{ "neighborhoodelectricwa.com", true },
{ "neil-barrett.com", true },
{ "neil-barrett.uk", true },
@@ -26687,8 +27766,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "neilfarrington.com", true },
{ "neillans.co.uk", true },
{ "neillans.com", true },
- { "neilshealthymeals.com", true },
{ "neilwynne.com", true },
+ { "neio.uk", true },
{ "nejenpneu.cz", true },
{ "nejlevnejsi-parapety.cz", true },
{ "neko-nyan-nuko.com", true },
@@ -26709,7 +27788,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nemplex.com", true },
{ "nemplex.win", false },
{ "nems.no", true },
- { "nemumu.com", true },
{ "nemunai.re", true },
{ "nenkin-kikin.jp", true },
{ "neno.io", true },
@@ -26718,6 +27796,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "neocities.org", true },
{ "neoclick.io", true },
{ "neodigital.bg", true },
+ { "neodrive.ch", true },
{ "neoedresources.org", true },
{ "neohu.com", true },
{ "neojo.org", true },
@@ -26750,19 +27829,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nerdmind.de", true },
{ "nerdoutstudios.tv", true },
{ "nerdpol.ch", true },
+ { "nerdpol.org", true },
+ { "nerdrockshop.co.uk", true },
{ "nerds-gegen-stephan.de", true },
{ "nerdtime.de", true },
{ "nerdwallet.com", true },
{ "nerdydev.net", true },
+ { "nereustech.com", true },
{ "nerot.eu", true },
{ "nerpa-club.ru", true },
{ "nerull7.info", true },
{ "nerven.se", true },
+ { "nesbase.com", true },
{ "nesolabs.com", true },
{ "nesolabs.de", true },
+ { "nestedquotes.ca", false },
{ "nestor.nu", true },
{ "neswec.org.uk", true },
- { "net-masters.pl", true },
{ "net-safe.info", true },
{ "net-share.de", true },
{ "net4visions.at", true },
@@ -26778,17 +27861,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "netbrewventures.com", true },
{ "netbulls.io", true },
{ "netbuzz.ru", true },
+ { "netchameleon.com", true },
{ "netconnect.at", true },
{ "netcoolusers.org", true },
- { "netd.at", true },
{ "netdex.co", true },
{ "netera.se", true },
{ "neteraser.de", true },
{ "netfabb.com", true },
+ { "netfeeds.eu", true },
{ "netflixlife.com", true },
{ "netfog.de", true },
{ "netfuture.ch", true },
{ "netfxharmonics.com", true },
+ { "nethack.ninja", true },
{ "nethackwiki.com", true },
{ "nethask.ru", true },
{ "nethostingtalk.com", true },
@@ -26816,7 +27901,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "netsparker.com.tr", true },
{ "netspeedia.net", true },
{ "netsphere.cz", true },
- { "nettacompany.com.tr", true },
{ "nettamente.com", true },
{ "nette.org", true },
{ "nettegeschenke.de", true },
@@ -26825,7 +27909,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "netto-service.ch", true },
{ "nettools.link", true },
{ "nettx.co.uk", true },
- { "netulo.com", true },
+ { "netube.org", true },
{ "netvizura.co.uk", true },
{ "netvpn.ml", true },
{ "netwarc.eu", true },
@@ -26836,19 +27920,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "network-notes.com", true },
{ "network23.nl", true },
{ "networkersdiary.com", true },
- { "networking-groups.co.uk", true },
+ { "networkhane.com", true },
{ "networking4all.com", true },
{ "networkingnexus.net", true },
{ "networkingphoenix.com", true },
+ { "networkmas.com", true },
{ "networkmidlands.co.uk", true },
{ "networkmidlands.uk", true },
+ { "networkmon.net", true },
{ "networkposting.com", true },
- { "networth.at", true },
{ "netz-yokohama.co.jp", true },
{ "netzfabrik.com", true },
{ "netzfrauen.org", true },
+ { "netzona.org", true },
{ "netzwerkwerk.de", true },
- { "neuber.uno", true },
{ "neuflizeobc.net", true },
{ "neurabyte.com", true },
{ "neurexcellence.com", true },
@@ -26865,10 +27950,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "neutralox.com", true },
{ "neuwal.com", true },
{ "neva.li", true },
+ { "nevalogic.com", true },
{ "never.pet", true },
{ "nevergreen.io", true },
{ "nevermore.fi", true },
{ "neverwetturkey.com", true },
+ { "nevivur.net", true },
{ "nevntech.com", true },
{ "nevolution.me", true },
{ "nevoxo.com", true },
@@ -26879,10 +27966,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "new-process.com", true },
{ "new-process.de", true },
{ "new-process.eu", true },
+ { "new-vip.com", true },
{ "new-web-studio.com", true },
+ { "new.travel.pl", true },
{ "newaccess.ch", true },
+ { "newbernpost539.com", true },
{ "newbietech.cn", false },
{ "newborncryptocoin.com", true },
+ { "newbrunswick.today", true },
+ { "newbrunswicktoday.com", true },
{ "newburybouncycastles.co.uk", true },
{ "newburyparkelectric.com", true },
{ "newburyparkelectrical.com", true },
@@ -26891,7 +27983,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "newburyparklandscapelighting.com", true },
{ "newburyparkoutdoorlighting.com", true },
{ "newcab.de", true },
- { "newcitygas.ca", true },
{ "newcityinfo.ch", true },
{ "newcitystudio.ch", true },
{ "newcloudwhodis.com", true },
@@ -26899,14 +27990,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "newearth.press", true },
{ "newfangledscoop.com", true },
{ "newfiepedia.ca", true },
+ { "newfoundland-labradorflora.ca", true },
{ "newgrowbook.com", true },
{ "newguidance.ch", true },
+ { "newhoperailroad.com", true },
{ "newind.info", true },
{ "newizv.ru", true },
{ "newjianzhi.com", true },
{ "newkaliningrad.ru", true },
{ "newknd.com", true },
{ "newlifeband.de", true },
+ { "newline.online", true },
{ "newmarketbouncycastlehire.co.uk", true },
{ "newmed.com.br", true },
{ "newmediaone.net", true },
@@ -26929,6 +28023,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nex.sx", true },
{ "nexd.com", true },
{ "nexicafiles.com", true },
+ { "next-taxi.ru", false },
{ "next-web.ad.jp", true },
{ "next176.sk", true },
{ "next24.io", true },
@@ -26936,11 +28031,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nextbranders.com", true },
{ "nextcairn.com", true },
{ "nextcasino.com", true },
+ { "nextcloud-miyamoto.spdns.org", true },
{ "nextcloud.co.za", true },
{ "nextcloud.com", true },
{ "nextcloud.li", true },
{ "nextcloud.nerdpol.ovh", true },
{ "nextclouddarwinkel.nl", true },
+ { "nexter.cloud", true },
{ "nextevolution.co.uk", true },
{ "nextgen.sk", true },
{ "nextgencel.com", true },
@@ -26964,7 +28061,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "neyer-lorenz.de", true },
{ "nezrouge-est-vaudois.ch", true },
{ "nezrouge-geneve.ch", true },
- { "nezvestice.cz", true },
{ "nf4.net", true },
{ "nf9q.com", true },
{ "nfam.de", true },
@@ -26985,10 +28081,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ngc.gov", false },
{ "nghe.net", true },
{ "ngi.eu", true },
- { "nginxconfig.com", true },
{ "nginxconfig.io", true },
{ "ngndn.jp", true },
{ "ngt.gr", true },
+ { "nguyencucthanh.com", true },
{ "nguyenminhhung.com", true },
{ "ngvf.de", true },
{ "ngx.hk", true },
@@ -27015,6 +28111,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nic.soy", true },
{ "nic.xn--q9jyb4c", true },
{ "nice.ch", true },
+ { "nice.im", true },
{ "niceguyit.biz", true },
{ "nicesco.re", true },
{ "nicesleepo.com", true },
@@ -27035,6 +28132,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nicklord.com", true },
{ "nickmertin.ca", true },
{ "nickmorri.com", true },
+ { "nickmorris.name", true },
{ "nickplotnek.co.uk", true },
{ "nickrickard.co.uk", true },
{ "nicks-autos.com", true },
@@ -27049,6 +28147,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nicocourts.com", true },
{ "nicoknibbe.nl", true },
{ "nicoladixonrealestate.com", true },
+ { "nicolaiteglskov.dk", true },
{ "nicolajanedesigns.co.uk", true },
{ "nicolas-dumermuth.com", true },
{ "nicolas-hoffmann.net", true },
@@ -27070,9 +28169,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nidsuber.ch", true },
{ "niederohmig.de", true },
{ "niehage.name", true },
- { "nielshoogenhout.be", true },
- { "nielshoogenhout.eu", true },
- { "nielshoogenhout.nl", true },
{ "niemaler.de", true },
{ "nien.cf", true },
{ "nien.co", true },
@@ -27080,7 +28176,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nien.eu.org", true },
{ "nien.gq", true },
{ "nien.org", true },
- { "nien.taipei", true },
{ "nien.tk", true },
{ "nienkeslop.nl", true },
{ "nierenpraxis-dr-merkel.de", true },
@@ -27096,7 +28191,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nigelwakefield.com", true },
{ "nigensha.co.jp", true },
{ "niggemeier.cc", true },
- { "nigger.racing", true },
{ "niggo.eu", true },
{ "night2stay.cn", true },
{ "night2stay.com", true },
@@ -27109,6 +28203,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nightmoose.org", true },
{ "nightsi.de", true },
{ "nightstand.io", true },
+ { "nihilistan.tk", true },
{ "nihon-no-sake.net", true },
{ "nihtek.in", true },
{ "nii2.org", true },
@@ -27122,7 +28217,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nikimix.com", true },
{ "nikkasystems.com", true },
{ "nikkila.me", true },
- { "nikklassen.ca", true },
{ "niklas.pw", true },
{ "niklasbabel.com", true },
{ "nikolainevalainen.fi", true },
@@ -27132,12 +28226,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nikonnps.co.uk", true },
{ "nikonpromotions.co.uk", true },
{ "nikonschool.co.uk", true },
+ { "nikpool.com", true },
{ "niktok.com", true },
{ "nil.gs", true },
{ "nil.mx", true },
{ "niles.xyz", true },
+ { "nilgirispice.co.uk", true },
{ "niloxy.com", true },
- { "nilrem.org", true },
{ "nimeshjm.com", true },
{ "nimidam.com", true },
{ "nina-laaf.de", true },
@@ -27149,13 +28244,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ninepints.co", true },
{ "ninesix.cc", true },
{ "ninespec.com", true },
- { "ninetailed.ninja", true },
+ { "ninetailed.ninja", false },
{ "ninetaillabs.com", true },
{ "ninetaillabs.xyz", true },
{ "ninfora.com", true },
+ { "ningbo.co.uk", true },
{ "ninja-galerie.de", true },
{ "ninja-skillz.com", true },
{ "ninjan.co", true },
+ { "ninjasquad.fr", true },
{ "ninjaworld.co.uk", true },
{ "ninjio.com", true },
{ "ninov.de", true },
@@ -27179,7 +28276,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nitrix.me", true },
{ "nitrohorse.com", false },
{ "nitrokey.com", true },
- { "nitropanel.com", true },
{ "nitropur.com", true },
{ "nitropur.de", true },
{ "nitrous-networks.com", true },
@@ -27189,6 +28285,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nixx-gel.cz", true },
{ "niyawe.de", true },
{ "niyazpoyilan.com", false },
+ { "nizhaoheng.com", true },
{ "nja.id.au", true },
{ "njast.net", true },
{ "njguardtraining.com", true },
@@ -27225,6 +28322,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "noahmodas.com.br", true },
{ "noahsaso.com", true },
{ "noahwitt.me", true },
+ { "nob.ro", true },
{ "nobitakun.com", true },
{ "nobledust.com", true },
{ "nobleparkapartments.com.au", true },
@@ -27233,10 +28331,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nocit.dk", true },
{ "nocks.com", true },
{ "nocmd.com", true },
- { "nocs.cn", true },
{ "nodecdn.net", true },
{ "nodecraft.com", true },
{ "nodejs.de", true },
+ { "nodelab-it.de", true },
{ "nodelia.com", true },
{ "nodesec.cc", true },
{ "nodesonic.com", true },
@@ -27269,31 +28367,37 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "noisetrap.cz", true },
{ "noisky.cn", true },
{ "noisyfox.cn", true },
- { "nokia.la", true },
+ { "nojobook.com", true },
{ "nokono.com", true },
{ "nolaviz.org", true },
{ "noleggio-bagni-chimici.it", true },
+ { "noleggiolimousine.roma.it", true },
{ "noma-film.com", true },
{ "nomadproject.io", true },
{ "nomagic.software", true },
+ { "nomaster.cc", true },
{ "nomenclator.org", true },
{ "nomesbiblicos.com", true },
{ "nomial.co.uk", true },
{ "nomifensine.com", true },
+ { "nomik.xyz", true },
{ "nomsy.net", true },
{ "noname-ev.de", true },
{ "nonametheme.com", true },
{ "noncombatant.org", true },
+ { "nonx.pro", true },
{ "noob-box.net", true },
{ "noobow.me", true },
- { "noobswhatelse.net", true },
{ "noobunbox.net", true },
{ "noodles.net.nz", true },
{ "noodplan.co.za", true },
{ "noodweer.be", true },
{ "noofficewalls.com", true },
+ { "nook.my", true },
{ "noomist.com", true },
{ "noon-entertainments.com", true },
+ { "noonan.family", true },
+ { "noop.ch", true },
{ "nooranevalainen.fi", true },
{ "noordsee.de", true },
{ "noordwesthoekrit.nl", true },
@@ -27315,7 +28419,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nordmoregatebilklubb.com", true },
{ "nordnetz-hamburg.de", true },
{ "nordseeblicke.de", true },
- { "nordwal.de", true },
{ "nordwaldzendo.de", true },
{ "noreply.mx", true },
{ "norestfortheweekend.com", true },
@@ -27334,6 +28437,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "northatlantalaw.net", true },
{ "northbridgecre.com", true },
{ "northbrisbaneapartments.com.au", true },
+ { "northcoastlabs.com", true },
{ "northconsulting.fr", true },
{ "northcountykiaparts.com", true },
{ "northcreekresort.com", true },
@@ -27342,6 +28446,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "northdevonbouncycastles.co.uk", true },
{ "northeastcdc.org", true },
{ "northeastrodeo.co.uk", true },
+ { "northebridge.com", true },
{ "northern-lakes.com", true },
{ "northerngate.net", true },
{ "northernhamsterclub.com", true },
@@ -27366,8 +28471,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nosqlzoo.net", true },
{ "nossasenhora.net", true },
{ "nossasenhoradodesterro.com.br", true },
- { "nostosh.eu.org", true },
{ "nostraforma.com", false },
+ { "nosuch.blog", true },
+ { "nosuch.site", true },
+ { "nosuch.website", true },
{ "noswap.com", true },
{ "nosyu.pe.kr", true },
{ "nota.moe", true },
@@ -27383,7 +28490,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "notarvysocina.cz", true },
{ "notcompletelycorrect.com", true },
{ "notepad.nz", true },
+ { "noteshare.online", true },
{ "noteskeeper.ru", true },
+ { "nothing.net.nz", true },
{ "noticaballos.com", true },
{ "noticiasdehumor.com", true },
{ "notify.moe", true },
@@ -27399,7 +28508,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "notoriousdev.com", true },
{ "nototema.com", true },
{ "notsafefor.work", true },
+ { "nottres.com", true },
{ "noudjalink.nl", true },
+ { "nourishandnestle.com", true },
{ "noustique.com", true },
{ "nova-dess.ch", true },
{ "nova-it.pl", true },
@@ -27423,6 +28534,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "novelfeed.com", true },
{ "novelinglife.net", true },
{ "novelvyretraite.fr", true },
+ { "novengi.mu", true },
+ { "novfishing.ru", true },
{ "novgorod-avia.ru", true },
{ "novilaw.com", true },
{ "novilidery.com", true },
@@ -27435,14 +28548,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nowall.online", true },
{ "nowhere.dk", true },
{ "nowitzki.me", true },
+ { "nowitzki.network", true },
{ "nowlas.org", true },
{ "nowloading.co", true },
+ { "nowzuwan.org", false },
{ "noxlogic.nl", true },
+ { "noxx.global", true },
{ "noydeen.com", true },
{ "noyocenter.org", true },
{ "np-edv.at", true },
{ "np.search.yahoo.com", false },
{ "npath.de", true },
+ { "npbeta.com", true },
{ "npcrcss.org", true },
{ "nphrm.com", true },
{ "npmcdn.com", true },
@@ -27450,15 +28567,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "npsas.org", true },
{ "npw.net", true },
{ "nqesh.com", true },
+ { "nqeshreviewer.com", true },
{ "nrd.li", true },
{ "nrdstd.io", true },
{ "nrev.ch", true },
{ "nrkn.fr", true },
+ { "nrsmart.com", true },
{ "nrsweb.org", true },
{ "nrvn.cc", false },
{ "ns-frontier.com", true },
{ "ns2servers.pw", true },
{ "nsa.lol", true },
+ { "nsa.ovh", true },
{ "nsapwn.com", true },
{ "nsboston.org", true },
{ "nsboutique.com", true },
@@ -27482,12 +28602,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ntags.org", true },
{ "ntcoss.org.au", true },
{ "nte.email", true },
+ { "nth.sh", true },
{ "nti.de", true },
{ "ntia.gov", true },
{ "ntlabs.org", true },
{ "ntotten.com", true },
{ "ntppool.org", false },
{ "ntsb.gov", true },
+ { "ntut.net", true },
{ "ntwt.us", true },
{ "ntx360grad-fallakte.de", true },
{ "ntzwrk.org", true },
@@ -27519,18 +28641,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "numbercult.net", true },
{ "numbermunchers.net", true },
{ "numberoneshoes.co.nz", false },
+ { "numberzero.org", true },
{ "numerik-games.ch", true },
{ "numero-aleatorio.com", true },
{ "numero1.ch", true },
{ "numerologist.com", true },
{ "numerossanos.com.ar", true },
+ { "numis.tech", true },
{ "numismed-seniorcare.de", true },
{ "numwave.nl", true },
{ "nunesgh.com", true },
{ "nunnenmacher.net", true },
{ "nunnun.jp", true },
{ "nunomoura.com", true },
- { "nuos.org", true },
{ "nuovaelle.it", true },
{ "nuquery.com", true },
{ "nur.berlin", true },
@@ -27578,9 +28701,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nwitt.us", true },
{ "nwk1.com", true },
{ "nwperformanceandoffroad.com", true },
- { "nwr-waffenbuch.de", true },
{ "nwra.com", true },
- { "nwuss.okinawa", true },
+ { "nwshell.com", true },
{ "nwwc.dk", true },
{ "nwwnetwork.net", true },
{ "nxinfo.ch", true },
@@ -27603,28 +28725,29 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "nyip.edu", true },
{ "nylevemusic.com", true },
{ "nyloc.de", true },
- { "nylonfeetporn.com", true },
{ "nymphetomania.net", true },
{ "nynex.net", true },
+ { "nyoliveoil.com", true },
{ "nyoronfansubs.org", true },
{ "nyphox.ovh", true },
{ "nys-hk.com", false },
+ { "nysis.fr", true },
+ { "nysis.net", true },
{ "nysteak5.com", true },
{ "nytrafficticket.com", true },
{ "nyxi.eu", true },
{ "nyyu.tk", true },
{ "nzb.cat", false },
- { "nzbr.de", true },
{ "nzstudy.ac.nz", true },
{ "nzws.me", true },
{ "o-results.ch", true },
+ { "o-s.no", true },
{ "o-sp.com", true },
+ { "o0o.st", true },
{ "o2careers.co.uk", true },
{ "o3.wf", true },
{ "o3wallet.com", true },
- { "o5.cx", true },
{ "o6asan.com", true },
- { "o8b.club", true },
{ "oaic.gov.au", true },
{ "oakandresin.co", true },
{ "oakesfam.net", true },
@@ -27636,6 +28759,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oakparklighting.com", true },
{ "oakparkoutdoorlighting.com", true },
{ "oakslighting.co.uk", true },
+ { "oaktonhouseandgardens.com", true },
{ "oaktree-realtors.com", true },
{ "oanalista.com.br", true },
{ "oasisdabeleza.com.br", true },
@@ -27645,6 +28769,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oauth-dropins.appspot.com", false },
{ "obamalibrary.gov", true },
{ "obamawhitehouse.gov", true },
+ { "obec-krakovany.cz", true },
{ "oberhofdrinks.com", true },
{ "obermeiers.eu", true },
{ "obesidadlavega.com", true },
@@ -27661,8 +28786,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "obono.at", true },
{ "obrienswine.ie", true },
{ "obs.group", true },
+ { "obscur.us", true },
{ "observer.name", true },
- { "obsidianirc.net", true },
+ { "obsessharness.com", true },
{ "obsproject.com", true },
{ "obtima.org", true },
{ "obud.cz", true },
@@ -27685,7 +28811,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oceandns.nl", true },
{ "oceanlord.me", true },
{ "oceanvisuals.com", true },
- { "ocelot.help", true },
{ "ocenovani-inspekce.cz", true },
{ "ocf.io", true },
{ "ocg-card.com", true },
@@ -27702,6 +28827,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ocrn.nl", true },
{ "ocsigroup.fr", true },
{ "ocsr.nl", true },
+ { "octa.store", true },
{ "octagongroup.co", true },
{ "octarineparrot.com", true },
{ "octav.name", false },
@@ -27716,6 +28842,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "octosys.org", true },
{ "octosys.ru", true },
{ "octothorpe.club", true },
+ { "octothorpe.ninja", true },
{ "oculus.com", true },
{ "oddmuse.org", true },
{ "oddnumber.ca", true },
@@ -27725,7 +28852,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "odensc.me", true },
{ "odense3dprint.dk", true },
{ "odhosc.ca", true },
- { "odifi.com", true },
{ "odinseye.net", true },
{ "odisealinux.com", true },
{ "odoo.co.th", true },
@@ -27772,6 +28898,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "officeinteriors.co.nz", true },
{ "officemovepro.com", true },
{ "officiants.wedding", false },
+ { "officium.tech", true },
{ "offroadeq.com", true },
{ "offroadhoverboard.net", true },
{ "offshoot.ie", true },
@@ -27798,7 +28925,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oheila.com", true },
{ "ohhere.xyz", true },
{ "ohiohealthfortune100.com", true },
- { "ohling.org", true },
{ "ohmayonnaise.com", true },
{ "ohne-name.de", true },
{ "ohnonotme.com", true },
@@ -27806,7 +28932,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ohsohairy.co.uk", true },
{ "ohyooo.com", true },
{ "oi-wiki.org", true },
- { "oil-ecn.ru", true },
{ "oilpaintingsonly.com", true },
{ "oirealtor.com", true },
{ "oisd.nl", true },
@@ -27815,12 +28940,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ojdip.net", true },
{ "ojomovies.com", true },
{ "ojp.gov", true },
+ { "okad-center.de", true },
+ { "okad.de", true },
+ { "okad.eu", true },
+ { "okaidi.es", true },
{ "okaidi.fr", true },
{ "okakuro.org", true },
{ "okanaganrailtrail.ca", true },
{ "okashi.me", true },
{ "okay.cf", true },
{ "okay.coffee", true },
+ { "okaz.de", true },
{ "okburrito.com", true },
{ "okchicas.com", true },
{ "okchousebuyer.com", true },
@@ -27833,6 +28963,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "okmx.de", true },
{ "okna-tm.kz", true },
{ "okotoksbeach.ca", true },
+ { "okqubit.net", true },
{ "oksafe-t.org", true },
{ "oktime.cz", true },
{ "oktoberfeststore.nl", true },
@@ -27840,7 +28971,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "okukan.com.au", true },
{ "okurapictures.com", true },
{ "okusiassociates.com", true },
+ { "okviz.com", true },
{ "olanderflorist.com", true },
+ { "olandiz.com", true },
{ "olasouris.com", true },
{ "olastrafford.org", true },
{ "olback.net", true },
@@ -27857,6 +28990,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oldoakflorist.com", true },
{ "oldprop.com", true },
{ "oldroutetwo.com", true },
+ { "oldschool-criminal.com", true },
{ "oldsticker.com", true },
{ "oldstmary.com", true },
{ "oldtimerreifen-moeller.de", true },
@@ -27874,6 +29008,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "olhcparish.net", true },
{ "olifant.fr", true },
{ "olightstore.ro", true },
+ { "olivemultispecialist.com", true },
{ "oliveoil.bot", true },
{ "oliveoilschool.org", true },
{ "oliveoiltest.com", true },
@@ -27887,6 +29022,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oliverschmid.space", true },
{ "oliverspringer.eu", true },
{ "oliverst.com", true },
+ { "olivier-rochet.com", true },
{ "olivierberardphotographe.com", true },
{ "olivierlemoal.fr", true },
{ "olivierpieters.be", true },
@@ -27918,9 +29054,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "om1.com", true },
{ "omanko.porn", true },
{ "omarh.net", true },
- { "omdesign.cz", true },
{ "omegahosting.net", true },
+ { "omegarazer.ca", true },
{ "omegathermoproducts.nl", true },
+ { "omenprinting.com.au", true },
{ "omeopatiadinamica.it", true },
{ "omertabeyond.com", true },
{ "omertabeyond.net", true },
@@ -27931,31 +29068,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "omi-news.fr", true },
{ "omicron3069.com", true },
{ "omitech.co.uk", true },
- { "omlmetal.co.jp", true },
{ "omniaclubs.com", true },
{ "omniasig.ro", true },
{ "omniasl.com", true },
{ "omniatv.com", true },
{ "omnibot.tv", true },
- { "omniscimus.net", false },
{ "omnisiens.se", true },
{ "omnisky.dk", true },
{ "omnitrack.org", true },
{ "omniverse.ru", true },
{ "omoide-hitokoto.com", true },
- { "omorashi.org", true },
{ "omori.ch", true },
{ "omoteura.com", true },
{ "omranic.com", true },
{ "omronwellness.com", true },
{ "omsdieppe.fr", true },
{ "on-tech.co.uk", true },
- { "on.tax", true },
{ "ona.io", true },
{ "onaboat.se", true },
{ "onahonavi.com", true },
{ "onarto.com", true },
- { "onazikgu.com", true },
{ "onbuzzer.com", false },
{ "onceuponarainbow.co.uk", true },
{ "oncf.asso.fr", true },
@@ -27977,14 +29109,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oneclic.ch", true },
{ "onedegreehealth.com", true },
{ "onedot.nl", true },
- { "onedottwelve.co.jp", true },
- { "onedottwelve.com", true },
+ { "onedottwelve.co.jp", false },
+ { "onedottwelve.com", false },
{ "onedrive.com", true },
{ "onedrive.live.com", false },
{ "onee3.org", true },
{ "onefour.ga", false },
{ "onegoodthingbyjillee.com", true },
{ "oneheartbali.church", true },
+ { "onehost.blue", true },
{ "oneidentity.me", true },
{ "oneiroi.co.uk", true },
{ "onemid.net", true },
@@ -27992,8 +29125,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oneononeonone.de", true },
{ "oneononeonone.tv", true },
{ "onepercentrentals.com", true },
+ { "onepointsafeband.ca", true },
+ { "onepointsafeband.com", true },
{ "onepointzero.com", true },
{ "oneprediction.com", true },
+ { "onesearay.com", true },
{ "onesnzeroes.com", true },
{ "onesports.cz", true },
{ "onestepfootcare.com", true },
@@ -28009,7 +29145,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "onewaymail.com", true },
{ "oneweb.hu", true },
{ "onfarma.it", true },
- { "ongea.io", true },
{ "ongiaenegogoa.com", true },
{ "onhistory.co.uk", true },
{ "onhub1.com", true },
@@ -28017,15 +29152,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "onice.ch", true },
{ "onionbot.me", true },
{ "onionplay.net", true },
- { "onionplay.org", true },
{ "onionscan.org", true },
{ "onionyst.com", true },
{ "oniria.ch", true },
{ "onix.eu.com", true },
{ "onixcco.com.br", true },
{ "onkentessegertdij.hu", true },
+ { "onkfaktor.de", true },
{ "onlfait.ch", true },
{ "online-backup.se", true },
+ { "online-biblio.tk", true },
{ "online-bouwmaterialen.nl", true },
{ "online-calculator.com", true },
{ "online-consulting-corp.com", true },
@@ -28039,8 +29175,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "online-textil.cz", true },
{ "online-textil.sk", true },
{ "online.marketing", true },
- { "online.net.gr", true },
- { "online.swedbank.se", true },
{ "online24.pt", true },
{ "onlinebizdirect.com", false },
{ "onlinecasino.vlaanderen", true },
@@ -28055,11 +29189,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "onlinemarketingmuscle.com", true },
{ "onlinemarketingtraining.co.uk", true },
{ "onlinepokerspelen.be", true },
- { "onlineporno.tv", true },
{ "onlineporno.xyz", true },
{ "onlineprofecional.com", true },
{ "onlinerollout.de", true },
- { "onlinestoreninjas.com", true },
{ "onlinetextil.cz", true },
{ "onlineth.com", false },
{ "onlinexl.nl", true },
@@ -28083,7 +29215,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "onurer.net", true },
{ "onvey.io", true },
{ "onviga.de", true },
- { "onvirt.de", true },
{ "onvori.com", true },
{ "onvori.de", true },
{ "onvousment.fr", true },
@@ -28096,20 +29227,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oogami.name", true },
{ "oogartsennet.nl", true },
{ "ooharttemplates.com", true },
+ { "oolsa.net", true },
{ "ooonja.de", true },
- { "oopsis.com", true },
{ "ooyo.be", true },
- { "op11.co.uk", false },
{ "opalesurfcasting.net", true },
{ "oparl.org", true },
{ "opcenter.de", true },
+ { "opcionpublicitaria.pe", true },
{ "ope.ee", true },
{ "open-banking-access.uk", true },
{ "open-bs.com", true },
{ "open-bs.ru", true },
+ { "open-ctp.com", true },
+ { "open-ctp.net", true },
+ { "open-ctp.org", true },
{ "open-desk.org", true },
{ "open-domotics.info", true },
{ "open-freax.fr", true },
+ { "open-future.be", true },
{ "open-gaming.net", true },
{ "open-infrastructure.net", true },
{ "open-letters.de", true },
@@ -28122,9 +29257,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "openbeecloud.com", true },
{ "openblox.org", true },
{ "opencad.io", true },
+ { "opencaves.io", true },
{ "opencircuit.nl", true },
{ "openclima.com", true },
{ "opencrm.co.uk", true },
+ { "openctp.com", true },
+ { "openctp.net", true },
+ { "openctp.org", true },
{ "opendata.cz", true },
{ "opendataincubator.eu", true },
{ "opendecide.com", true },
@@ -28142,21 +29281,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "openmtbmap.org", true },
{ "opennippon.com", true },
{ "opennippon.ru", true },
- { "openpictures.ch", true },
{ "openquery.com.au", true },
{ "openrainbow.com", true },
{ "openrainbow.net", true },
+ { "openre.site", true },
{ "openrealestate.co", true },
{ "openresty.com", true },
{ "openreview.net", true },
{ "openroademail.com", true },
- { "openruhr.de", true },
{ "openscreen.lu", true },
+ { "openshippers.com", true },
{ "opensource-cms.nl", true },
{ "opensource-training.de", true },
{ "opensourcesurvey.org", true },
{ "openspa.webhop.info", true },
{ "openssl.org", true },
+ { "openstandia.jp", true },
{ "openstem.com.au", true },
{ "openstreetmap.is", true },
{ "openstreetmap.lu", true },
@@ -28190,9 +29330,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oposicionesertzaintza.com.es", true },
{ "oposicionesycursos.com", true },
{ "oppada.com", true },
+ { "oppaiti.me", true },
{ "oppejoud.ee", true },
{ "opportunis.me", true },
{ "opportunity.de", true },
+ { "opportunityliu.top", true },
{ "oppositionsecurity.com", true },
{ "oppwa.com", true },
{ "opq.pw", true },
@@ -28206,6 +29348,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "opticaltest.com", true },
{ "optik-trosdorff.de", true },
{ "optimalsetup.com", true },
+ { "optimaner.pl", true },
{ "optimisedlabs.co.uk", true },
{ "optimisedlabs.com", true },
{ "optimist.bg", true },
@@ -28216,6 +29359,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "optmos.at", true },
{ "optometryscotland.org.uk", true },
{ "optoutday.de", true },
+ { "opure.ru", true },
{ "opus-codium.fr", true },
{ "oraculum.cz", true },
{ "orang-utans.com", true },
@@ -28224,7 +29368,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "orangefinanse.com.pl", true },
{ "orangejetpack.com", true },
{ "orangenbaum.at", true },
- { "orangenuts.in", true },
+ { "orangesquash.org.uk", true },
{ "orangetravel.eu", true },
{ "orangutan-appeal.org.uk", true },
{ "oranjee.net", true },
@@ -28237,17 +29381,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "orchidsforum.com", true },
{ "orchidspaper.com", true },
{ "orcsnet.com", true },
- { "orderessay.net", true },
+ { "ordbokpro.se", true },
{ "ordernow.at", true },
{ "orderswift.com", true },
+ { "ordoh.com", true },
{ "ordoro.com", true },
{ "ordr.mobi", true },
+ { "ore.cool", true },
{ "oreshinya.xyz", true },
{ "oreskylaw.com", true },
{ "oreto.de", true },
{ "orf-digitalsatkarte.at", false },
{ "orf-kartentausch.at", false },
{ "organica.co.za", true },
+ { "organicskincare.com", true },
{ "organisatieteam.nl", true },
{ "organisationsberatung-jacobi.de", true },
{ "organix.ma", true },
@@ -28255,13 +29402,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "orgatech-gmbh.de", true },
{ "orgsyn.in", true },
{ "orhideous.name", true },
- { "orians.eu", true },
{ "oribia.net", true },
{ "orientalart.nl", true },
{ "orientravelmacas.com", true },
{ "oriflameszepsegkozpont.hu", true },
{ "origami.to", true },
{ "origamika.com", true },
+ { "origin8delicafes.com", true },
{ "original-christstollen.com", true },
{ "original-christstollen.de", true },
{ "originalniknihy.cz", true },
@@ -28273,9 +29420,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "orimex-mebel.ru", true },
{ "orion-universe.com", true },
{ "orioncokolada.cz", true },
- { "oriondynamic.be", true },
{ "orionfinancialservices.com", true },
- { "oriongames.eu", true },
{ "orkestar-krizevci.hr", true },
{ "orkiv.com", true },
{ "orlandobalbas.com", true },
@@ -28283,7 +29428,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "orleika.io", true },
{ "ormer.nl", true },
{ "orocojuco.com", true },
- { "orro.ro", true },
+ { "oroscopodelmese.it", true },
+ { "orro.ro", false },
{ "orrs.de", true },
{ "orthocop.cz", true },
{ "orthodontiste-geneve-docteur-rioux.com", true },
@@ -28293,6 +29439,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oruggt.is", true },
{ "orwell1984.today", true },
{ "oryva.com", true },
+ { "orz.uno", true },
{ "os-s.net", true },
{ "os-t.de", true },
{ "os24.cz", true },
@@ -28309,12 +29456,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oses.mobi", true },
{ "oshayr.com", true },
{ "oshell.me", true },
- { "oshershalom.com", true },
{ "oshrc.gov", true },
{ "osielnava.com", true },
- { "osirisrp.online", true },
{ "osirium.com", true },
{ "oskrba.net", true },
+ { "oskrba.online", true },
{ "oskuro.net", true },
{ "osla.org", true },
{ "oslinux.net", true },
@@ -28324,11 +29470,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "osmre.gov", true },
{ "osnova.cz", true },
{ "osobliwydom.pl", true },
+ { "osolutionscorp.com", true },
{ "osomjournal.org", true },
{ "ospf.sk", true },
{ "osprecos.com.br", true },
{ "osprecos.pt", true },
{ "ospree.me", true },
+ { "ostachstore.com", true },
{ "ostan-collections.net", true },
{ "osterkraenzchen.de", true },
{ "ostgotamusiken.se", true },
@@ -28342,7 +29490,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "oswbouncycastles.co.uk", true },
{ "osworx.net", true },
{ "osx86spain.com", true },
- { "osxentwicklerforum.de", true },
{ "oszri.hu", true },
{ "otakubox.de", true },
{ "otakurepublic.com", true },
@@ -28353,13 +29500,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "other98.com", true },
{ "oticasaopaulo.com.br", true },
{ "oticasvisao.net.br", true },
+ { "otisko.com", true },
{ "otokiralama.name.tr", true },
{ "otorrino.pt", true },
{ "otoy.com", true },
- { "otoya.space", true },
+ { "otoya.space", false },
{ "otpsmart.com.ua", true },
{ "otr.ie", true },
{ "otrm.de", true },
+ { "ots.gov", true },
{ "otsfreestyle.jp", true },
{ "ottoproject.io", false },
{ "ottoversand.at", true },
@@ -28371,7 +29520,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ouestsolutions.com", true },
{ "ouglor.com", true },
{ "ouin.land", true },
- { "oulunjujutsu.com", true },
{ "our-box.net", true },
{ "ourai.ws", true },
{ "ourcloud.at", true },
@@ -28386,7 +29534,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ourwedding.xyz", true },
{ "ourworldindata.org", true },
{ "out-of-scope.de", true },
+ { "outdoorchoose.com", true },
{ "outdoorfurniture.ie", true },
+ { "outdoorhole.com", true },
{ "outdoorimagingportal.com", true },
{ "outdoorlightingagoura.com", true },
{ "outdoorlightingagourahills.com", true },
@@ -28402,9 +29552,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "outdoorlightingsimivalley.com", true },
{ "outdoorlightingthousandoaks.com", true },
{ "outdoorlightingwestlakevillage.com", true },
- { "outerlimitsdigital.com", true },
- { "outetc.com", true },
+ { "outfit-weimar.eu", true },
{ "outgress.com", true },
+ { "outincanberra.com.au", true },
{ "outka.xyz", true },
{ "outline.ski", true },
{ "outlines.xyz", true },
@@ -28419,6 +29569,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "overclockers.ge", true },
{ "overdrive-usedcars.be", true },
{ "overkillshop.com", true },
+ { "overlandireland.ie", true },
{ "overseamusic.de", true },
{ "oversight.garden", true },
{ "oversight.gov", true },
@@ -28446,17 +29597,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "owlandrabbitgallery.com", true },
{ "owlishmedia.com", true },
{ "own3d.ch", true },
+ { "ownagepranks.com", true },
{ "ownc.at", true },
{ "owncloud.ch", true },
{ "ownmay.com", false },
- { "oxanababy.com", true },
{ "oxborrow.ca", true },
+ { "oxdl.cn", true },
{ "oxelie.com", true },
{ "oxia.me", true },
{ "oxiame.eu", true },
+ { "oximo.lviv.ua", true },
{ "oxo.cloud", true },
{ "oxygin.net", true },
{ "oxytocin.org", true },
+ { "oxz.me", true },
{ "oxzeth3sboard.com", true },
{ "oyashirosama.tokyo", true },
{ "oyosoft.fr", true },
@@ -28474,11 +29628,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "p-fent.ch", true },
{ "p-s-b.com", true },
{ "p-t.io", true },
- { "p.ki", true },
+ { "p0l.de", true },
{ "p1ratrulezzz.me", true },
{ "p22.co", true },
{ "p4chivtac.com", true },
- { "p5118.com", true },
+ { "p5on.net", true },
{ "p5r.uk", true },
{ "pa-w.de", true },
{ "pa.search.yahoo.com", false },
@@ -28511,9 +29665,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pacaom.com", true },
{ "pacatlantic.com", true },
{ "pacco.com.br", true },
- { "paccolat.name", true },
{ "pace.car", true },
- { "paceda.nl", true },
+ { "paced.me", true },
{ "pacelink.de", true },
{ "pacifco.com", true },
{ "pacificcashforcars.com.au", true },
@@ -28531,11 +29684,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "packaware.com", true },
{ "packetdigital.com", true },
{ "packetlinux.com", true },
+ { "packs-de-mujeres.com", true },
{ "pact2017.nl", true },
{ "pactf.com", true },
{ "padam-group.com", true },
{ "padberx-marketing-consultants.de", true },
{ "paddy.rocks", true },
+ { "padeoe.com", true },
{ "padianda.com", true },
{ "padkit.org", true },
{ "padovani.de", true },
@@ -28553,12 +29708,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pagalworld.la", true },
{ "pagalworld.me", true },
{ "pagalworld.org", true },
+ { "pagamentosonline.pt", true },
{ "page-builders.com", true },
{ "pageantsnews.com", false },
{ "pagedesignhub.com", true },
{ "pagedesignpro.com", true },
{ "pagedesignweb.com", true },
{ "pagefulloflies.io", true },
+ { "pagerduty.com", true },
{ "pagewizz.com", true },
{ "pagiamtzis.com", true },
{ "pagina.com.mx", true },
@@ -28568,17 +29725,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pahae.de", true },
{ "pahealthbilling.com", true },
{ "pahlawanpulsa.com", true },
+ { "pahub.io", true },
{ "paichai.space", false },
+ { "paigejulianne.com", true },
{ "paincareehr.com", true },
{ "paindata.dk", true },
{ "painefamily.co.uk", true },
- { "painlessproperty.co.uk", true },
{ "paint-it.pink", true },
{ "paintball-ljubljana.si", true },
{ "paintball-shop.sk", true },
{ "paintcolorsbysue.com", true },
{ "paintingindurban.co.za", true },
- { "paintsealdirect.com", true },
{ "paipuman.jp", true },
{ "pajadam.me", true },
{ "pajuvuo.fi", true },
@@ -28593,16 +29750,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pakroyalpress.com", true },
{ "paktolos.net", true },
{ "palabr.as", true },
+ { "palace-bayreuth.de", true },
{ "palapadev.com", true },
{ "palariviera.com", true },
{ "palary.work", true },
{ "palatin.at", true },
{ "palava.tv", true },
+ { "palavalbasket.it", true },
{ "palavatv.com", true },
{ "palazzo.link", true },
{ "palazzo.work", true },
+ { "paleolowcarb.de", true },
{ "paleoself.com", true },
{ "paleotraining.com", true },
+ { "palermopride.it", true },
{ "palestra.roma.it", true },
{ "palladium46.com", true },
{ "pallas.in", true },
@@ -28616,6 +29777,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pamatv.hk", true },
{ "pamsorel.co.za", true },
{ "pan.digital", true },
+ { "panamatrippin.com", true },
{ "panasca.is", true },
{ "panascais.co", true },
{ "panascais.com", true },
@@ -28628,7 +29790,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "panascais.site", true },
{ "panascais.tech", true },
{ "panascais.us", true },
- { "panasproducciones.com", true },
{ "panaxis.biz", true },
{ "panaxis.ch", true },
{ "panaxis.li", true },
@@ -28643,6 +29804,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "panhandlemenshealth.com", true },
{ "panic.tk", true },
{ "panier-legumes.bio", true },
+ { "paniodpolskiego.eu", true },
{ "paniyanovska.ua", true },
{ "panj.ws", true },
{ "panjiva.com", true },
@@ -28663,11 +29825,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "panzer72.ru", true },
{ "panzerscreen.dk", true },
{ "pao.ge", true },
+ { "paolotagliaferri.com", true },
{ "pap.la", false },
{ "papa-webzeit.de", true },
{ "papadopoulos.me", true },
{ "papakatsu-life.com", true },
- { "papapa-members.club", true },
{ "papaya.me.uk", true },
{ "papayame.com", true },
{ "papayapythons.com", true },
@@ -28702,8 +29864,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "paranoidcrypto.com", true },
{ "paranoidmode.com", true },
{ "paranoidpenguin.net", true },
- { "paranormalweirdo.com", true },
- { "paranoxer.hu", true },
{ "parasitologyclub.org", true },
{ "parasosto.fi", true },
{ "paratlan.hu", true },
@@ -28713,6 +29873,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "parckwart.de", true },
{ "parcon.it", true },
{ "parcoursup.fr", true },
+ { "pareachat.com", true },
{ "parentelement.com", true },
{ "parentheseardenne.be", true },
{ "parentinterview.com", true },
@@ -28726,6 +29887,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "parisfranceparking.de", true },
{ "parisfranceparking.fr", true },
{ "parisfranceparking.nl", true },
+ { "parisprovincedemenagements.fr", true },
{ "parkeren.in", true },
{ "parkfans.net", true },
{ "parkhost.eu", true },
@@ -28743,16 +29905,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "parolu.io", true },
{ "parquettista.milano.it", true },
{ "parquettista.roma.it", true },
- { "parroquiasanrafaeldegramalote.com", true },
{ "parry.org", true },
{ "parsemail.org", true },
{ "parser.nu", true },
{ "parsonsfamilyhomes.com", true },
+ { "partage.ovh", true },
{ "parteaga.com", true },
{ "parteaga.net", true },
{ "partecipa.tn.it", true },
{ "parthkolekar.me", true },
- { "partijhandel.website", true },
{ "partiono.com", true },
{ "partner.sh", true },
{ "partnercardservices.com", true },
@@ -28761,10 +29922,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "partridge.tech", true },
{ "parts4phone.com", true },
{ "partsestore.com", true },
+ { "parturi-manner.fi", true },
{ "partusedtyres.net", true },
{ "party-and-play.co.uk", true },
{ "party-calendar.net", true },
- { "party-kneipe-bar.com", true },
{ "party-time-inflatables-durham.co.uk", true },
{ "partybounceplay.co.uk", true },
{ "partycentrumdebinnenhof.nl", true },
@@ -28782,6 +29943,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "partyyy.io", true },
{ "partyzone.ie", true },
{ "parvaneh.fr", true },
+ { "parys.org", true },
{ "pasadenapooch.org", true },
{ "pasadenasandwichcompany.com", true },
{ "pasalt.com", true },
@@ -28821,8 +29983,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "passport.yandex.ru", true },
{ "passport.yandex.ua", true },
{ "passports.govt.nz", true },
- { "passrhce.com", true },
- { "passrhcsa.com", true },
{ "passthepopcorn.me", true },
{ "passumpsicbank.com", true },
{ "passvanille-reservation.fr", true },
@@ -28849,7 +30009,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pasteblin.com", true },
{ "pasternok.org", true },
{ "pasticcerialorenzetti.com", true },
- { "pastoral-verbund.de", true },
{ "pasztor.at", true },
{ "patapwn.com", true },
{ "patatbesteld.nl", true },
@@ -28881,6 +30040,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "patriksimek.cz", true },
{ "patriotstationatchalfont.com", true },
{ "patrocinio.com.br", true },
+ { "patrykwegrzynek.pl", true },
{ "patrz.eu", true },
{ "patsch-photography.de", true },
{ "patsyforyou.ch", true },
@@ -28898,12 +30058,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "paulbakaus.com", true },
{ "paulbdelaat.nl", true },
{ "paulbramhall.uk", true },
- { "paulchen.at", true },
{ "paulcooper.me.uk", true },
{ "pauldev.co", true },
{ "paulerhof.com", true },
{ "paulgerberrealtors.com", true },
{ "paulinewesterman.nl", true },
+ { "paullockaby.com", true },
{ "paulmeier.com", false },
{ "paulomonteiro.pt", true },
{ "paulov.com", true },
@@ -28918,11 +30078,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "paulsnar.lv", true },
{ "paulswartz.net", true },
{ "paulus-foto.pl", true },
+ { "paulw.io", true },
{ "paulward.net", true },
{ "paulwatabe.com", true },
{ "paulwendelboe.com", true },
{ "pauly-stahlhandel.com", true },
{ "pauly-stahlhandel.de", true },
+ { "pause-canap.com", true },
{ "pauspam.net", true },
{ "pautadiaria.com", true },
{ "pavamtio.cz", true },
@@ -28936,17 +30098,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pawelnazaruk.com", true },
{ "pawelurbanek.com", true },
{ "pawsomebox.co.uk", true },
+ { "pawspuppy.com", true },
{ "pawsr.us", true },
- { "pawsru.org", true },
+ { "paxchecker.com", true },
{ "paxerahealth.com", true },
{ "pay-online.in", true },
{ "pay.gov", true },
+ { "paya.cat", true },
{ "paybook.co.tz", true },
{ "payboy.biz", true },
{ "payboy.rocks", true },
{ "paybro.eu", true },
+ { "paydigital.pt", true },
{ "payexpresse.com", true },
{ "payfazz.com", true },
+ { "payjunction.com", true },
+ { "payjunctionlabs.com", true },
{ "paylike.io", true },
{ "payloc.io", true },
{ "payme.uz", true },
@@ -28972,11 +30139,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "paytonmoledor.com", true },
{ "payupay.ru", true },
{ "payzang.com", true },
+ { "pb.ax", false },
{ "pback.se", true },
{ "pbosquet.com", true },
{ "pbourhis.me", true },
{ "pbr.so", true },
{ "pbraunschdash.com", true },
+ { "pbren.com", true },
{ "pbrumby.com", true },
{ "pbz.im", true },
{ "pc-rescue.me", false },
@@ -29002,6 +30171,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pcnotdienst-oldenburg-rastede.de", true },
{ "pcreparatiehardenberg.nl", true },
{ "pcrypt.org", true },
+ { "pcs.org.au", true },
{ "pcs2.gr", true },
{ "pcsetting.com", true },
{ "pctonic.net", true },
@@ -29017,7 +30187,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pdfsearches.com", true },
{ "pdkrawczyk.com", true },
{ "pdox.net", true },
- { "pdragt.com", true },
{ "pdthings.net", true },
{ "pdxtowncar.net", true },
{ "pe.search.yahoo.com", false },
@@ -29030,13 +30199,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "peanutbase.org", true },
{ "peanutproductionsnyc.com", true },
{ "pear2pear.de", true },
- { "pearbloom.com", true },
{ "pearlcohen.com", true },
{ "pearlsenroses.nl", true },
+ { "pearlsonly.ca", true },
{ "pearlsonly.com", true },
+ { "pearlsonly.com.au", true },
+ { "pearlsonly.de", true },
+ { "peatsbeast.com", true },
{ "peaudorange.net", true },
{ "pebbleparents.com", true },
+ { "pebblepointapartmentsstl.com", true },
{ "pebbles.net.in", true },
+ { "peckcloths.com", true },
{ "pecker-johnson.com", true },
{ "peda.net", true },
{ "peddock.com", true },
@@ -29055,6 +30229,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "peeekaaabooo.com", true },
{ "peekier.com", true },
{ "peep.gq", true },
+ { "peepsfoundation.org", true },
{ "peercraft.at", true },
{ "peercraft.be", true },
{ "peercraft.biz", true },
@@ -29084,6 +30259,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "peerweb.com", true },
{ "peetah.com", true },
{ "peeters.io", true },
+ { "pefricea.com", true },
{ "peg.nu", true },
{ "pegas-studio.net", true },
{ "pehapkari.cz", true },
@@ -29092,11 +30268,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "peka.pw", true },
{ "pekarstvivetvrzi.cz", true },
{ "pekkapleppanen.fi", true },
- { "pekoe.se", true },
+ { "pekoe.se", false },
{ "pelanucto.cz", true },
{ "pelican.ie", true },
- { "peliculator.com", true },
- { "peliweb.com", false },
+ { "peliseries24.com", true },
{ "pellet.pordenone.it", true },
{ "pelletizermill.com", true },
{ "pelletsprice.com", true },
@@ -29107,6 +30282,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pems.gov.au", true },
{ "penaugustin.com", true },
{ "pencepay.com", true },
+ { "pencil2d.org", true },
{ "pencillab.cn", true },
{ "pendriveapps.com", true },
{ "penetrationstest.se", true },
@@ -29136,15 +30312,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pentofun.ch", true },
{ "pentoo.ch", true },
{ "penz.media", true },
+ { "penzionvzahrade.cz", true },
{ "peoplelikemeapp.com", true },
{ "peoplesdecade.org", true },
{ "peoplesguardian.org", true },
{ "pepeelektro.sk", true },
{ "pepemodelismo.com.br", true },
{ "peperstraat.online", true },
+ { "pepfar.gov", true },
{ "pepgrid.net", true },
{ "peplog.nl", true },
{ "pepme.net", true },
+ { "peppelmedi.fi", true },
{ "pepstaff.net", true },
{ "pepwaterproofing.com", true },
{ "pequenosfavoritos.com.br", false },
@@ -29158,6 +30337,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "percyflix.com", true },
{ "perd.re", true },
{ "perecraft.com", true },
+ { "perevedi.org", true },
{ "perezdecastro.org", true },
{ "perfect-carstyle.de", true },
{ "perfect.in.th", true },
@@ -29171,16 +30351,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "perfektesgewicht.com", true },
{ "perfektesgewicht.de", true },
{ "perfmatters.io", true },
+ { "performancegate.com", true },
{ "performancehealth.com", false },
{ "performing-art-schools.com", true },
{ "perfumeaz.com", true },
{ "perfumes.com.br", true },
+ { "perge.com.br", true },
{ "periodic-drinking.com", true },
{ "periscope.tv", true },
{ "perishablepress.com", true },
{ "perm-avia.ru", true },
{ "perm4.com", true },
{ "permajackofstlouis.com", true },
+ { "permaseal.net", true },
{ "permeance108.com", true },
{ "permistheorique.be", true },
{ "permistheoriqueenligne.be", true },
@@ -29190,6 +30373,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "perrau.lt", true },
{ "perroquet-passion.ch", true },
{ "persephone.gr", true },
+ { "persiart.shop", true },
{ "persocloud.org", true },
{ "personal-genome.com", true },
{ "personaltrainer-senti.de", true },
@@ -29219,7 +30403,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "peter.org.ua", true },
{ "peterandjoelle.co.uk", true },
{ "peterbarrett.ca", true },
+ { "peterboers.info", true },
{ "peterborgapps.com", true },
+ { "peterboweycomputerservices.com.au", true },
{ "peterbruceharvey.com", true },
{ "peterdavehello.org", true },
{ "peterfiorella.com", true },
@@ -29231,6 +30417,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "peterlew.is", true },
{ "petermaar.com", true },
{ "petersontoscano.com", true },
+ { "petervaldesii.com", true },
+ { "petervaldesii.io", true },
{ "petervanleeuwentweewielers.nl", true },
{ "petfa.ga", true },
{ "petit-archer.com", true },
@@ -29248,6 +30436,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "petr.as", true },
{ "petrachuk.ru", true },
{ "petrasestakova.cz", true },
+ { "petravdbos.nl", true },
{ "petresort.pt", true },
{ "petroleum-schools.com", true },
{ "petroscand.eu", true },
@@ -29255,9 +30444,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "petrotranz.com", true },
{ "petrpikora.com", true },
{ "petrucciresidential.com", true },
+ { "petruzz.net", true },
{ "pets4life.com.au", true },
{ "petschnighof.at", true },
{ "pettitcoat.com", true },
+ { "petto.com.co", true },
{ "petwall.info", true },
{ "pew.ninja", true },
{ "pewnews.org", true },
@@ -29267,7 +30458,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pfa.or.jp", true },
{ "pfadfinder-aurich.de", true },
{ "pfadfinder-grossauheim.de", true },
- { "pfarchimedes-pensioen123.nl", true },
{ "pfarre-kremsmuenster.at", true },
{ "pfcafeen.dk", true },
{ "pfd-nz.com", false },
@@ -29283,11 +30473,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pflug.email", true },
{ "pfmeasure.com", true },
{ "pfotentour-berlin.de", true },
+ { "pfrost.me", true },
{ "pfudor.tk", true },
{ "pg-forum.de", true },
{ "pg-mana.net", true },
{ "pgh-art.com", true },
- { "pglandscapingpaving.com", true },
+ { "pglaum.tk", true },
{ "pgmann.cf", true },
{ "pgnetwork.net", true },
{ "pgp.guru", true },
@@ -29301,17 +30492,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pharma-display.com", true },
{ "pharmaabsoluta.com.br", true },
{ "pharmaboard.de", true },
+ { "pharmaboard.org", true },
{ "pharmacie-fr.org", true },
{ "pharmacieplusfm.ch", true },
+ { "pharmacyglobalrx.net", true },
{ "pharmafoto.ch", true },
{ "pharmaphoto.ch", true },
{ "pharmapolitics.com", true },
+ { "pharmaquality.com", true },
{ "pharmasana.co.uk", true },
{ "pharmasana.de", true },
{ "pharmica.co.uk", true },
{ "pharmica.uk", true },
{ "pharside.dyndns.org", true },
{ "pharynks.com", true },
+ { "pharynx.nl", true },
{ "phasme-2016.com", true },
{ "phattea.tk", true },
{ "phaux.uno", true },
@@ -29327,7 +30522,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "phget.com", true },
{ "phhtc.ir", true },
{ "phi-works.com", true },
- { "phialo.de", true },
+ { "phibureza.com", true },
{ "phil-dirt.com", true },
{ "phil-phillies.com", true },
{ "phil.red", true },
@@ -29366,12 +30561,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "philux.ch", true },
{ "phishing-studie.org", true },
{ "phishingusertraining.com", true },
- { "phligence.com", true },
{ "phocean.net", true },
- { "phoenixlogan.com", true },
+ { "phoenics.de", false },
{ "phoenixurbanspaces.com", true },
{ "pholder.com", true },
{ "phone-service-center.de", true },
+ { "phonenumber-info.co.uk", true },
{ "phonix-company.fr", true },
{ "phormance.com", true },
{ "phosagro.biz", false },
@@ -29391,6 +30586,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "photography-workshops.net", true },
{ "photolium.net", false },
{ "photomodelcasting.com", true },
+ { "photosafari.com.my", true },
{ "phototravel.uk", true },
{ "phototrio.com", true },
{ "phoxden.net", true },
@@ -29402,7 +30598,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "phpartners.org", true },
{ "phpbbchinese.com", true },
{ "phpdorset.co.uk", true },
- { "phpinfo.in.th", true },
{ "phpliteadmin.org", true },
{ "phpmyadmin.net", true },
{ "phpower.com", true },
@@ -29410,10 +30605,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "phpsecure.info", true },
{ "phpstan.org", true },
{ "phpunit.de", true },
- { "phryanjr.com", false },
+ { "phrazor.com", true },
{ "phuket-idc.com", true },
{ "phuket-idc.de", true },
- { "phunehehe.net", true },
{ "phurl.de", true },
{ "phurl.io", true },
{ "phus.lu", true },
@@ -29431,6 +30625,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pianetaottica.it", true },
{ "pianetatatuaggi.it", true },
{ "pianomover.co.uk", true },
+ { "pianos.de", true },
{ "pianyigou.com", true },
{ "piatabrasil.com.br", true },
{ "piboubes.me", true },
@@ -29447,10 +30642,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pickmysoap.gr", true },
{ "pickormix.co.uk", true },
{ "picksin.club", true },
+ { "pickupenc.ru", true },
{ "piclect.com", true },
{ "picoauto.com", true },
{ "piconepress.com", true },
{ "picotech.com", true },
+ { "picr.ws", true },
{ "picster.at", true },
{ "picsto.re", true },
{ "pictorial.com.sg", true },
@@ -29479,7 +30676,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pierre-schmitz.com", true },
{ "pierreblake.com", true },
{ "pierrefv.com", true },
- { "pierreprinetti.com", true },
{ "pierrickdeniel.fr", true },
{ "pietechsf.com", true },
{ "pieterbos.nl", true },
@@ -29490,6 +30686,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pijuice.com", true },
{ "pijusmagnificus.com", true },
{ "pik.bzh", true },
+ { "pikafederation.ca", true },
{ "pikeitservices.com.au", true },
{ "pikimusic.moe", true },
{ "pilani.ch", true },
@@ -29509,6 +30706,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pimhaarsma.nl", true },
{ "pimhaarsmamedia.nl", true },
{ "pimpmyperf.fr", true },
+ { "pimusiccloud.hopto.org", true },
+ { "pimylifeup.com", true },
{ "pinceaux.org", true },
{ "pincha.com.tw", false },
{ "pincodeit.com", true },
@@ -29529,6 +30728,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pinkladyapples.co.uk", true },
{ "pinklecfest.org", true },
{ "pinklittlenotebook.com", true },
+ { "pinkmango.travel", true },
{ "pinkwalk.co.nz", true },
{ "pinkyf.com", false },
{ "pinkylam.me", true },
@@ -29536,7 +30736,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pinnacleallergy.net", true },
{ "pinnaclelife.co.nz", true },
{ "pinnaclelife.nz", true },
- { "pinner.io", true },
{ "pinot.it", true },
{ "pinoydailytvshow.net", true },
{ "pinoyonlinetv.com", true },
@@ -29553,6 +30752,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pinterest.info", true },
{ "pinterest.jp", true },
{ "pinterjann.is", true },
+ { "pintosbeeremovals.co.za", true },
+ { "pintoselectricfencing.co.za", true },
{ "pintosplumbing.co.za", true },
{ "pioneer-car.eu", true },
{ "pioneer-rus.ru", true },
@@ -29564,6 +30765,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "piraten-basel.ch", true },
{ "piraten-bv-nord.de", true },
{ "pirateparty.org.uk", true },
+ { "pirateproxy.bet", true },
{ "pirateproxy.cam", true },
{ "pirateproxy.cat", true },
{ "pirateproxy.cc", true },
@@ -29601,6 +30803,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pitfire.io", true },
{ "pitot-rs.org", true },
{ "pittmantraffic.co.uk", true },
+ { "piu.moe", true },
{ "piubip.com.br", true },
{ "pivniraj.com", true },
{ "pivotaltracker.com", true },
@@ -29620,10 +30823,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pixelurbia.com", true },
{ "pixelution.at", true },
{ "pixelz.cc", true },
+ { "pixeoapp.com", true },
{ "pixiv.cat", true },
{ "pixiv.moe", true },
{ "pixlfox.com", true },
{ "pixloc.fr", true },
+ { "pixshop.fr", true },
+ { "pixulutinho.com.br", true },
{ "pizza-show.fr", true },
{ "pizzabesteld.nl", true },
{ "pizzafest.ddns.net", true },
@@ -29637,9 +30843,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pjentertainments.co.uk", true },
{ "pjleisure.co.uk", true },
{ "pjo.no", true },
+ { "pjp.com.mt", true },
{ "pjuu.com", false },
{ "pk.search.yahoo.com", false },
- { "pkbjateng.com", true },
{ "pkbjateng.or.id", true },
{ "pkeus.de", true },
{ "pkgt.de", false },
@@ -29652,7 +30858,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pl-cours.ch", true },
{ "pl.search.yahoo.com", false },
{ "placasonline.com.br", true },
- { "placebet.pro", true },
{ "placedaffiliate.com", true },
{ "placedapps.com", true },
{ "placedsupport.com", true },
@@ -29693,27 +30898,33 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "planlos.net", true },
{ "planmemberpartners.com", true },
{ "plannedlink.com", true },
+ { "planningexcellence.com.au", true },
{ "planolowcarb.com", true },
{ "plant-gift.jp", true },
{ "plantarum.com.br", true },
{ "plantastique.ch", true },
{ "plantastique.com", true },
{ "planteforum.no", true },
- { "plantekno.com", true },
+ { "plantekno.com", false },
{ "plantes.ch", true },
{ "plantezcheznous.com", true },
+ { "plantron.gr", true },
+ { "plantroon.com", true },
{ "plantrustler.com", true },
{ "planujemywesele.pl", true },
{ "planup.fr", true },
{ "planview.com", true },
{ "plaque-funeraire.fr", true },
{ "plassmann.ws", true },
+ { "plastic-id.com", true },
{ "plasticsurgerynola.com", true },
{ "plasticsurgeryservices.com", true },
{ "plastovelehatko.cz", true },
{ "plateformecandidature.com", true },
{ "platformadmin.com", true },
+ { "platinapump.com", true },
{ "platinumexpress.com.ar", true },
+ { "platnicyvat.pl", true },
{ "platomania.nl", true },
{ "platschi.net", true },
{ "platten-nach-mass.de", true },
@@ -29782,6 +30993,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pluginsloaded.com", true },
{ "pluimveeplanner.nl", true },
{ "plumber-in-sandton.co.za", true },
+ { "plumbercincoranch.com", true },
{ "plumbermountedgecombe.co.za", true },
{ "plumberumhlangarocks.co.za", true },
{ "plumbingandheatingspecialistnw.com", true },
@@ -29800,11 +31012,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "plus.sandbox.google.com", true },
{ "pluscbdoil.com", true },
{ "pluslink.co.jp", true },
+ { "plusminus30.si", true },
{ "plusstreamfeed.appspot.com", true },
{ "plustech.id", true },
{ "plutiedev.com", true },
{ "pluto.life", true },
{ "plutokorea.com", true },
+ { "plutonx.com", true },
{ "plutopia.ch", true },
{ "plymouthbouncycastles.co.uk", true },
{ "plzdontpwn.me", true },
@@ -29845,34 +31059,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pneuhaus-lemp.ch", true },
{ "pnimmobilier.ch", true },
{ "pnmhomecheckup.com", true },
- { "pnoec.org.do", true },
{ "pnona.cz", true },
{ "pnsc.is", true },
{ "pnut.io", false },
{ "po.net", true },
{ "poba.fr", true },
{ "poc.xn--fiqs8s", true },
- { "poc060.com", true },
- { "poc080.com", true },
- { "poc100.com", true },
- { "poc109.com", true },
- { "poc11.com", true },
- { "poc116.com", true },
- { "poc118.com", true },
- { "poc119.com", true },
- { "poc120.com", true },
- { "poc128.com", true },
- { "poc13.com", true },
- { "poc15.com", true },
- { "poc16.com", true },
- { "poc17.com", true },
- { "poc18.com", true },
- { "poc19.com", true },
- { "poc21.com", true },
- { "poc211.com", true },
{ "poc22.com", true },
- { "poc226.com", true },
- { "poc228.com", true },
{ "poc23.com", true },
{ "poc25.com", true },
{ "poc26.com", true },
@@ -29933,17 +31126,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pochaneko.com", true },
{ "pocitacezababku.cz", true },
{ "pocketfruity.com", true },
- { "pocketinsure.com", true },
{ "pocpok.com", true },
{ "pocqipai.com", true },
{ "podia.com.gr", false },
+ { "podipod.com", true },
{ "podo-podo.com", true },
{ "podroof.com", true },
{ "podroof.com.au", true },
{ "podshrink.de", true },
{ "poe.digital", true },
{ "poed.net.au", true },
- { "poedgirl.com", true },
{ "poemlife.com", true },
{ "poezja.com.pl", true },
{ "poezjagala.pl", true },
@@ -29955,6 +31147,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pohlmann.io", true },
{ "poinsot.info", true },
{ "pointaction.com", true },
+ { "pointcab.vn", true },
{ "pointhost.de", true },
{ "pointsgame.net", true },
{ "pointsixtyfive.com", true },
@@ -29971,6 +31164,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pokemontabletopadventures.com", true },
{ "pokemori.jp", true },
{ "pokepon.center", true },
+ { "pokerslab.com", true },
{ "pokl.cz", true },
{ "pokrowcecardo.pl", true },
{ "polaire.org", true },
@@ -30025,6 +31219,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "polygraphi.ae", true },
{ "polymake.org", true },
{ "polymathematician.com", true },
+ { "polymorph.rs", true },
{ "polynomapp.com", true },
{ "polypane.rocks", true },
{ "polypet.com.sg", true },
@@ -30032,13 +31227,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "polytarian.com", true },
{ "polytekniskforening.dk", true },
{ "pomar.club", false },
- { "pomelo-paradigm.com", true },
{ "pomfe.co", true },
{ "pomfeed.fr", true },
{ "pommedepain.fr", true },
{ "pomockypredeti.sk", true },
{ "pomocniczy.eu.org", true },
- { "pomozmruczkom.pl", true },
{ "pompiers-martigny.ch", true },
{ "pomsinoz.com", true },
{ "poncho-bedrucken.de", true },
@@ -30046,6 +31239,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "poneypourtous.com", true },
{ "poneytelecom.org", true },
{ "ponga.se", true },
+ { "ponio.org", true },
{ "ponio.xyz", true },
{ "pony-cl.co.jp", true },
{ "pony.tf", true },
@@ -30053,12 +31247,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ponycyclepals.co.uk", true },
{ "ponydesignclub.nl", true },
{ "ponyfoo.com", true },
+ { "poochingaround.co.uk", true },
{ "poodleassassin.com", true },
{ "poodlefan.net", true },
{ "pookl.com", true },
{ "poolsafely.gov", true },
{ "poolsafety.gov", true },
- { "poolspondsandwaterscapes.com", true },
+ { "pooltechthailand.com", true },
{ "pooltools.net", true },
{ "poolvilla-margarita.net", false },
{ "poon.io", true },
@@ -30069,7 +31264,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pop3.jp", true },
{ "popcat.ru", true },
{ "popcornpalacefundraising.com", true },
- { "popcultureshack.com", true },
{ "popeyes.com", true },
{ "popinga.it", true },
{ "popmagz.com", true },
@@ -30084,35 +31278,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "porg.es", true },
{ "pork.org.uk", true },
{ "porkel.de", true },
- { "porn77.info", true },
{ "pornagent.de", true },
- { "pornalpha.com", true },
{ "pornbay.eu", true },
- { "pornbay.org", true },
{ "porndragon.net", true },
{ "pornfacefinder.com", false },
{ "pornflare.net", true },
{ "porngay.co", true },
{ "pornhubhd.biz", true },
- { "pornimg.net", true },
{ "porniwi.com", true },
- { "pornless.biz", true },
{ "pornloupe.com", true },
- { "pornmax.net", true },
{ "pornmega.net", true },
- { "porno-gif.ru", true },
+ { "pornofilme.top", true },
{ "pornofilmovi.us", true },
- { "pornolab-net.appspot.com", false },
{ "pornomens.be", true },
- { "pornoserver.eu", true },
{ "pornovk.xxx", true },
- { "pornport.org", true },
{ "pornshop.biz", true },
- { "pornsocket.com", true },
{ "pornstop.net", true },
{ "pornsuper.net", true },
- { "pornteddy.com", true },
- { "pornultra.net", true },
{ "porny.xyz", true },
{ "porpcr.com", true },
{ "pors-sw.cz", true },
@@ -30120,24 +31302,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "port443.se", true },
{ "port67.org", true },
{ "port80.hamburg", true },
- { "portablebuildingsales.co.uk", true },
- { "portablespeakersfinder.com", true },
{ "portailevangelique.ca", true },
{ "portal.tirol.gv.at", true },
{ "portalcarriers.com", true },
{ "portalcentric.net", true },
- { "portalkla.com.br", true },
+ { "portamiinpista.it", true },
{ "portatiles-baratos.net", true },
{ "porte.roma.it", true },
{ "portercup.com", true },
{ "porterranchelectrical.com", true },
+ { "portesmagistral.com", true },
{ "portofacil.com", true },
{ "portofala.pt", true },
{ "portofrotterdam.com", false },
{ "portosonline.pl", true },
{ "portsdebalears.gob.es", true },
{ "portsmouthbouncycastles.co.uk", true },
- { "portsmoutheic.com", true },
{ "portugal-a-programar.pt", true },
{ "portugalsko.net", true },
{ "portvincentcaravanpark.com.au", true },
@@ -30146,12 +31326,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "posalji.me", true },
{ "posaunenchor-senden.de", true },
{ "posbank.co.uk", true },
- { "poschtiliste.ch", true },
{ "poseidonwaterproofing.com", true },
{ "poshcastles.co.uk", true },
{ "poshlashes.se", true },
{ "poshsecurity.com", true },
- { "posijson.stream", true },
{ "positionus.io", true },
{ "positive.com.cy", true },
{ "positivenames.net", true },
@@ -30161,10 +31339,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "post-darwinism.com", true },
{ "post.com.ar", true },
{ "post.io", true },
- { "post.we.bs", true },
+ { "post.we.bs", false },
{ "post4me.at", true },
{ "postal.dk", true },
{ "postal3.es", true },
+ { "postandfly.com", true },
{ "postblue.info", true },
{ "postbox.life", true },
{ "postcode.nl", true },
@@ -30183,6 +31362,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "postura-corretta.it", true },
{ "posyperfume.com", true },
{ "potatiz.com", true },
+ { "potato.im", true },
{ "potatofrom.space", true },
{ "potatopro.com", true },
{ "potatron.tech", true },
@@ -30196,7 +31376,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "potrillionaires.com", true },
{ "potterscraftcider.com", true },
{ "pottersheartministry.org", true },
- { "pottreid.com", false },
{ "pottshome.co.uk", true },
{ "potworowski.de", true },
{ "potzwonen.nl", true },
@@ -30207,6 +31386,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "povareschka.ru", true },
{ "povertymind.com", true },
{ "povesham.tk", true },
+ { "povmacrostabiliteit.nl", true },
{ "pow-s.com", true },
{ "pow.jp", true },
{ "powdersnow.top", true },
@@ -30218,15 +31398,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "powerblanket.com", true },
{ "powercloud.technology", true },
{ "poweredbyiris.nl", true },
- { "poweredbypurdy.com", true },
{ "powerfortunes.com", true },
{ "powerinboxperformance.com", true },
{ "powermatic7.com", true },
{ "powermeter.at", true },
{ "powermint.de", true },
{ "powerpointschool.com", true },
+ { "powersaleskc.com", true },
{ "powerserg.org", true },
{ "powersergdatasystems.com", true },
+ { "powersergdynamic.com", true },
{ "powersergholdings.com", true },
{ "powersergthisisthetunnelfuckyouscott.com", true },
{ "powersergthisisthewebsitefuckyouscott.com", true },
@@ -30249,6 +31430,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ppy.sh", true },
{ "pr.search.yahoo.com", false },
{ "pr1sm.com", true },
+ { "pr2studio.com", true },
{ "prac.to", true },
{ "pracevjihlave.cz", true },
{ "pracowniatkanin.com", true },
@@ -30275,12 +31457,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "prateep.io", true },
{ "pratopronto.org", true },
{ "pratorotoli.it", true },
- { "praxino.de", true },
+ { "praxino.de", false },
{ "praxis-dingeldey.de", true },
{ "praxis-familienglueck.de", true },
{ "praxis-odermath.de", true },
{ "prayerrequest.com", true },
- { "prc-newmedia.com", true },
{ "prc.gov", true },
{ "pre-lean-consulting.de", true },
{ "precept.uk.com", true },
@@ -30296,7 +31477,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "predoiu.ro", true },
{ "preferredreverse.com", true },
{ "prefix.eu", true },
- { "pregono.com", true },
{ "pregunteleakaren.gov", true },
{ "preigu.de", true },
{ "preis-alarm.info", true },
@@ -30304,6 +31484,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "preisser-it.de", true },
{ "preisser.it", true },
{ "preissler.co.uk", true },
+ { "preload.link", true },
{ "preloaded-hsts.badssl.com", true },
{ "prelogica.com.br", true },
{ "preludes.org", true },
@@ -30315,9 +31496,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "prelved.nl", true },
{ "prelved.pl", true },
{ "prelved.se", true },
- { "premaritalsex.info", true },
{ "prematureacceleration.club", true },
{ "preme.name", true },
+ { "premieravenue.net", true },
{ "premierbouncycastles.co.uk", true },
{ "premieresloges.ca", false },
{ "premierevents.ie", true },
@@ -30325,14 +31506,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "premierjewelersjax.com", true },
{ "premiership-predictors.co.uk", true },
{ "premiumcredit.am", true },
- { "premiumweb.co.id", true },
{ "premiumwebdesign.it", true },
{ "premtech.nl", true },
{ "prenatalgeboortekaartjes.nl", true },
{ "prepadefi.fr", true },
{ "prepaid-cards.xyz", true },
{ "prepaid-voip.nl", true },
- { "prepaidgirl.com", true },
{ "prepaidkredietkaart.be", true },
{ "prepare-job-hunting.com", true },
{ "prepavesale.fr", true },
@@ -30369,6 +31548,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pretor.eu", true },
{ "pretor.pl", true },
{ "pretorcup.pl", true },
+ { "pretrialservices.gov", true },
{ "pretty.hu", true },
{ "prettygirlcheats.com", true },
{ "prettynode.com", false },
@@ -30379,7 +31559,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "preview-it-now.com", true },
{ "priceremoval.net", true },
{ "pricesniffer.co", true },
- { "prideindomination.com", true },
{ "pridetechdesign.com", false },
{ "prielwurmjaeger.de", true },
{ "prihatno.my.id", true },
@@ -30393,7 +31572,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "primoloyalty.com", true },
{ "primorus.lt", true },
{ "princeofwhales.com", true },
- { "princesparktouch.com", true },
{ "princessefoulard.com", true },
{ "principalsexam.com", true },
{ "principalstest.com", true },
@@ -30456,6 +31634,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "privacyweek.at", true },
{ "privacyweek.de", true },
{ "privacyweek.eu", true },
+ { "privacyweek.wien", true },
{ "privacyweekvienna.at", true },
{ "privaday.de", false },
{ "privasphere.com", true },
@@ -30464,7 +31643,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "privatecapsecurity.org", true },
{ "privateideas.de", true },
{ "privateimarketing.com", true },
+ { "privatepokertour.com", true },
{ "privatepropertymallorca.com", true },
+ { "privatestatic.com", false },
{ "privatevoid.net", true },
{ "privatewolke.com", true },
{ "privatfrei.de", true },
@@ -30476,7 +31657,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "privy.com", true },
{ "prjktruby.com", false },
{ "prknje.co", true },
- { "prknje.com", true },
{ "prlved.co.uk", true },
{ "prnav.com", true },
{ "pro-ben.sk", true },
@@ -30490,6 +31670,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "proactivestructuresolutions.com", true },
{ "proadvanced.com", true },
{ "proautorepairs.com.au", true },
+ { "probano.com", true },
{ "probase.ph", true },
{ "probely.com", true },
{ "probiv.biz", true },
@@ -30519,6 +31700,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "productboard.com", true },
{ "productdesignsoftware.com.au", true },
{ "production.vn", true },
+ { "productionscime.com", true },
{ "productlondon.com", true },
{ "productpeo.pl", true },
{ "products4more.at", true },
@@ -30572,6 +31754,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "projectborealisgitlab.site", true },
{ "projectforge.org", true },
{ "projectlinuseasttn.org", true },
+ { "projectmakeit.com", true },
{ "projectnom.com", true },
{ "projectsafechildhood.gov", true },
{ "projectsecretidentity.com", true },
@@ -30581,6 +31764,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "projektarbeit-projektplanung.de", true },
{ "projektzentrisch.de", true },
{ "projest.ch", true },
+ { "projet-fly.ch", true },
{ "prolan.pw", true },
{ "prolearningcentre.com", true },
{ "prolinos.de", true },
@@ -30594,6 +31778,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "promo-brille.de", true },
{ "promo-computers.nl", true },
{ "promo-matelas.com", true },
+ { "promobo.fr", true },
{ "promods.cn", true },
{ "promods.net", true },
{ "promohulp.nl", true },
@@ -30605,6 +31790,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "promoterms.com.au", true },
{ "promotioncentre.co.uk", true },
{ "promozione.info", true },
+ { "promuovi.tv", true },
{ "pronto-intervento.net", true },
{ "prontointerventoimmediato.it", true },
{ "prontossl.com", true },
@@ -30616,16 +31802,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "propermatches.com", true },
{ "properticons.com", true },
{ "property-catalogue.eu", true },
+ { "propertycrawl.com", true },
{ "propertygroup.pl", true },
{ "propertyinside.id", true },
{ "propertyone.mk", true },
{ "propertysales-almeria.com", true },
+ { "prophiler.de", true },
{ "propipesystem.com", true },
{ "proposalonline.com", true },
{ "propr.no", true },
{ "proprietairesmaisons.fr", true },
{ "propseller.com", true },
{ "proseandleprechauns.com", true },
+ { "proservices.vip", true },
{ "prospanek.cz", true },
{ "prospecto.com.au", true },
{ "prospecto.ee", true },
@@ -30634,8 +31823,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "prosperfit.com", true },
{ "prosperontheweb.com", true },
{ "prospo.co", true },
- { "prostoporno.net", true },
- { "prostoporno.sexy", true },
+ { "prostecheat.xyz", true },
+ { "prostohobby.ru", true },
{ "prostoporno.vip", true },
{ "prostye-recepty.com", true },
{ "prosurveillancegear.com", true },
@@ -30664,6 +31853,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "proust.ch", false },
{ "proust.media", false },
{ "proustmedia.de", false },
+ { "prove.no", true },
{ "provectus.de", true },
{ "proveits.me", false },
{ "provence-appartements.com", true },
@@ -30677,6 +31867,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "prowise.com", true },
{ "prowise.me", true },
{ "proximityradio.fr", true },
+ { "proximoconcurso.com.br", true },
+ { "proxirealtime.com", true },
{ "proxybay.bet", true },
{ "proxybay.bz", true },
{ "proxybay.co", true },
@@ -30688,6 +31880,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "proyectafengshui.com", true },
{ "prpferrara.it", true },
{ "prplz.io", true },
+ { "prpr.cloud", true },
{ "prt.in.th", true },
{ "prtimes.com", true },
{ "prtpe.com", true },
@@ -30704,8 +31897,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "przemas.pl", true },
{ "ps-provider.co.jp", true },
{ "ps-sale.ru", true },
- { "ps-w.ru", true },
{ "ps4all.nl", true },
+ { "psa.gov", true },
+ { "psabrowse.com", true },
+ { "psauxit.com", true },
{ "psb.cloud", true },
{ "psb1.org", true },
{ "psb1911.com", true },
@@ -30719,6 +31914,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "psdsfn.com", true },
{ "psdsuc.com", true },
{ "pself.net", true },
+ { "pseric.site", true },
{ "pseta.ru", true },
{ "psg-calw.de", true },
{ "psg.bg", true },
@@ -30732,12 +31928,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "psicologoforensemadrid.com", true },
{ "psm.org.ph", true },
{ "psochecker.com", true },
- { "pson.ninja", true },
{ "psono.pw", true },
{ "psoriasischecker.com", true },
{ "pssgcsim.org", true },
{ "pst.moe", true },
{ "pste.pw", true },
+ { "psu.je", true },
{ "psw-consulting.de", true },
{ "psw-group.de", true },
{ "psw.net", true },
@@ -30763,7 +31959,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "psytrance-pro.com", true },
{ "pt-d.ru", true },
{ "pt-server.de", true },
+ { "pt.im", true },
{ "ptal.eu", true },
+ { "ptasiepodroze.eu", true },
{ "ptbi.org.pl", true },
{ "ptbx.co", true },
{ "pterodactylus.cz", true },
@@ -30771,10 +31969,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ptfiber.ru", true },
{ "ptfiber.spb.ru", true },
{ "ptgoldensun.com", true },
- { "pthsec.com", true },
{ "ptm.ro", false },
{ "ptmarquees.ie", true },
{ "ptr.kr", true },
+ { "ptrbrs.nl", true },
{ "ptrl.ws", true },
{ "ptron.org", true },
{ "pty.gg", true },
@@ -30782,7 +31980,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pubclub.com", true },
{ "pubean.com", true },
{ "pubi.me", false },
+ { "pubkit.io", true },
{ "publanda.nl", true },
+ { "publi-all.be", true },
{ "public-g.de", true },
{ "public-projects.com", true },
{ "public-projects.de", true },
@@ -30799,8 +31999,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pucchi.net", true },
{ "pucssa.org", true },
{ "puddis.de", true },
- { "puestifiestas.mx", true },
- { "puestosdeferia.mx", true },
{ "puggan.se", true },
{ "pugovka72.ru", true },
{ "puissancemac.ch", true },
@@ -30817,6 +32015,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pumpandcash.com", true },
{ "pumperszene.com", true },
{ "punchlinetheatre.co.uk", true },
+ { "punchlinetheatre.com", true },
{ "punchunique.com", true },
{ "puneflowermall.com", true },
{ "punematka.com", true },
@@ -30824,10 +32023,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "punitsheth.com", true },
{ "punkapoule.fr", true },
{ "punknews.org", true },
- { "puntacanalink.com", true },
+ { "puntcunts.com", true },
{ "punte-juwelier.nl", true },
+ { "puntonium.hu", true },
{ "pupboss.com", true },
{ "puppet.pl", true },
+ { "puppo.space", true },
{ "puq.moe", true },
{ "puralps.ch", true },
{ "puravida-estate.com", true },
@@ -30836,9 +32037,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "purefkh.xyz", true },
{ "purefreefrom.co.uk", true },
{ "pureitsolutionsllp.com", true },
- { "pureluxemedical.com", true },
+ { "purejewels.com", true },
+ { "purelunch.co.uk", true },
{ "purenvi.ca", true },
{ "purevapeofficial.com", true },
+ { "purityclothing.co.uk", true },
{ "purplebooth.co.uk", false },
{ "purplebricks.co.uk", true },
{ "purplebricks.com", true },
@@ -30854,6 +32057,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "purplestar.com", true },
{ "purplestar.mobi", true },
{ "purplewindows.net", true },
+ { "purplez.pw", true },
{ "purrfect-box.co.uk", true },
{ "purrfectboudoir.com", true },
{ "purrfectmembersclub.com", true },
@@ -30861,10 +32065,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pursuedtirol.com", true },
{ "puryearlaw.com", true },
{ "pusatinkubatorbayi.com", true },
- { "pushers.com.mx", true },
{ "pushoflove.com", true },
{ "pushrax.com", true },
- { "pusichatka.ddns.net", true },
+ { "pussr.com", true },
{ "put.moe", true },
{ "put.re", true },
{ "putatara.net", true },
@@ -30891,11 +32094,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pvphs98.com", true },
{ "pvtschlag.com", true },
{ "pwaresume.com", true },
- { "pwdsafe.com", true },
+ { "pwdsafe.com", false },
{ "pwe.vision", true },
{ "pwnedpass.tk", true },
{ "pwnies.dk", true },
{ "pwolk.com", true },
+ { "pxetech.com", true },
{ "pxgamer.xyz", true },
{ "pxl-mailtracker.com", true },
{ "pxl.cl", true },
@@ -30906,13 +32110,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "pycrc.org", true },
{ "pycrypto.org", true },
{ "pycycle.info", true },
- { "pygarage.com", true },
+ { "pygarage.com", false },
{ "pyopenssl.org", true },
{ "pypa.io", true },
{ "pypi.io", true },
{ "pypi.org", true },
{ "pypi.python.org", true },
- { "pyramidsofchi.com", true },
+ { "pyramidsofchi.com", false },
{ "pyrenees.io", true },
{ "pyrios.pro", true },
{ "pyrotechnologie.de", true },
@@ -30927,9 +32131,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "q-inn.com", true },
{ "q-inn.nl", true },
{ "q-technologies.com.au", true },
- { "q123123.com", true },
{ "q1q2q3.tk", true },
- { "q5118.com", true },
{ "qa-brandywineglobal.com", true },
{ "qa-team.xyz", true },
{ "qa.fedoraproject.org", true },
@@ -30939,6 +32141,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qadmium.com", true },
{ "qambarraza.com", true },
{ "qani.me", true },
+ { "qaq.cloud", true },
{ "qaq.sh", true },
{ "qarea.com", true },
{ "qaz.cloud", true },
@@ -30975,8 +32178,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qicomidadeverdade.com.br", true },
{ "qifu.me", true },
{ "qiliang.wang", true },
+ { "qingly.me", true },
{ "qingpei.me", true },
{ "qionouu.cn", true },
+ { "qipl.org", true },
{ "qis.fr", true },
{ "qitarabutrans.com", true },
{ "qiukong.com", true },
@@ -30985,6 +32190,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qiwi.be", true },
{ "qixi.biz", true },
{ "qkka.org", true },
+ { "qklshequ.com", true },
{ "qkmortgage.com", true },
{ "qlcvea.com", true },
{ "qldconservation.org.au", true },
@@ -31002,17 +32208,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qpcna.org", true },
{ "qponverzum.hu", true },
{ "qq-navi.com", true },
- { "qq52o.me", true },
+ { "qq885.com", true },
{ "qqrss.com", true },
{ "qr-city.org", true },
{ "qr.cl", true },
{ "qrbird.com", true },
{ "qrcontagion.com", true },
+ { "qrpatrol.com", true },
{ "qrpth.eu", true },
{ "qruiser.com", true },
{ "qscloud.de", true },
{ "qtacairsoft.com", true },
- { "qtap.me", true },
+ { "qtap.me", false },
{ "qtl.me", true },
{ "qtmsheep.com", true },
{ "qtn.net", true },
@@ -31026,6 +32233,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qtxh.net", true },
{ "quackerswaterproofing.com", true },
{ "quadra.srl", true },
+ { "quaedam.org", true },
{ "quaggan.co", true },
{ "quai10.org", false },
{ "qualite-ecole-et-formation.ch", true },
@@ -31035,9 +32243,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qualityhvacservices.com", true },
{ "qualityofcourse.com", true },
{ "qualitypropertycare.co.uk", true },
+ { "quallo.com", true },
{ "qualpay.biz", true },
{ "qualtrics.com", true },
{ "quant-labs.de", true },
+ { "quantaloupe.tech", true },
{ "quanterra.ch", true },
{ "quantolytic.de", true },
{ "quantoras.com", true },
@@ -31093,6 +32303,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "quietboy.net", true },
{ "quikchange.net", true },
{ "quikpay.com.au", true },
+ { "quilmo.com", true },
{ "quimatic.com.br", true },
{ "quinnlabs.com", true },
{ "quinoa24.com", true },
@@ -31102,6 +32313,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "quiq-cdn.com", true },
{ "quiq.us", true },
{ "quire.io", true },
+ { "quirkytravelguy.com", true },
{ "quisido.com", true },
{ "quitarlasmanchasde.com", true },
{ "quitimes.com", true },
@@ -31109,7 +32321,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qul.link", true },
{ "quli.nl", false },
{ "qunzi.la", true },
- { "quocdesign.ch", true },
+ { "qunzi.org", true },
{ "quote.gq", true },
{ "quoteidiot.com", true },
{ "quotev.com", true },
@@ -31133,10 +32345,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "qx.fi", true },
{ "qx.se", true },
{ "qxy.ch", true },
+ { "qxzg.xyz", true },
+ { "qxzgssr.xyz", true },
{ "r-ay.cn", true },
{ "r-rwebdesign.com", true },
{ "r-t-b.fr", true },
- { "r0t.co", true },
{ "r0uzic.net", true },
{ "r1a.eu", true },
{ "r1ch.net", true },
@@ -31158,13 +32371,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ra.vc", true },
{ "ra4wvpn.com", true },
{ "raah.co", true },
- { "rabbit.wales", false },
{ "rabbitfinance.com", true },
{ "rabbitinternet.com", true },
{ "rabica.de", true },
{ "rabotaescort.com", true },
{ "rabynska.eu", true },
{ "raccoltarifiuti.com", true },
+ { "racdek.net", true },
+ { "racdek.nl", true },
{ "racermaster.xyz", true },
{ "raceviewcycles.com", true },
{ "raceviewequestrian.com", true },
@@ -31176,7 +32390,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rachida-dati.eu", true },
{ "rachurch.net", true },
{ "racius.com", true },
- { "rackerlab.com", false },
+ { "rackerlab.com", true },
{ "raclet.co.uk", true },
{ "raconconsulting.co.uk", true },
{ "racoo.net", true },
@@ -31203,17 +32417,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "radiofmimagen.net", true },
{ "radioheteroglossia.com", true },
{ "radioilusion.es", true },
+ { "radiolla.com", true },
{ "radiom.fr", true },
{ "radiomodem.dk", true },
{ "radiomontebianco.it", true },
{ "radionicabg.com", true },
+ { "radiopleer.net", true },
{ "radiopolarniki.spb.ru", true },
{ "radiormi.com", true },
{ "radiorsvp.com", false },
{ "radiosendungen.com", true },
{ "radis-adopt.com", true },
+ { "radiumcode.com", true },
{ "radiumone.io", true },
- { "radiumtree.com", true },
{ "radondetectionandcontrol.com", true },
{ "radreisetraumtreibstoff.de", true },
{ "radyabkhodro.net", true },
@@ -31222,22 +32438,31 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "raeven.nl", true },
{ "raevinnd.com", true },
{ "rafaelmagalhaesweb.com", true },
+ { "rafas.com.tr", true },
{ "rafey.xyz", true },
{ "raffaellaosti.com", true },
+ { "raffleshospital.co.id", false },
+ { "rafgrup.com", true },
{ "rafleatherdesign.com", true },
{ "rafting-japan.com", true },
{ "ragasto.nl", true },
+ { "rage-overload.ch", true },
+ { "rage.rip", true },
{ "rage4.com", true },
{ "ragingserenity.com", true },
{ "rahulpnath.com", true },
+ { "raid-runners.fr", true },
{ "raidensnakesden.co.uk", true },
{ "raidensnakesden.com", true },
{ "raidensnakesden.net", true },
{ "raidstone.net", true },
+ { "raiffeisen-kosovo.com", true },
+ { "raiffeisenzeitung.at", true },
{ "rail-o-rama.nl", true },
{ "rail24.nl", true },
{ "rail360.nl", true },
{ "railbird.nl", true },
+ { "railduction.eu", true },
{ "railgun.ac", true },
{ "railgun.com.cn", true },
{ "railorama.nl", true },
@@ -31247,6 +32472,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "railvideo.net", true },
{ "railvideo.nl", true },
{ "railwaytech.net", true },
+ { "raimondos.com", true },
{ "rain.bz", true },
{ "rainbowbay.org", true },
{ "rainbowinflatables.co.uk", true },
@@ -31258,12 +32484,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rainpaper.com", true },
{ "rainstormsinjuly.co", true },
{ "rainville.me", true },
+ { "rainway.com", true },
{ "rainway.io", true },
{ "raipet.no-ip.biz", true },
{ "raisecorp.com", true },
{ "raiseyourflag.com", true },
{ "raissarobles.com", true },
- { "raito.win", true },
+ { "raito.ooo", true },
{ "rajivshah.co.uk", true },
{ "rajkapoordas.com", true },
{ "rajyogarishikesh.com", true },
@@ -31281,8 +32508,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rallybase.cz", true },
{ "rallybase.eu", true },
{ "rallycycling.com", true },
- { "ralph.bike", true },
- { "ralphwoessner.com", true },
+ { "rallypodium.be", true },
{ "raltha.com", true },
{ "ram-it.nl", true },
{ "ram.nl", true },
@@ -31292,8 +32518,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ramrecha.com", false },
{ "ramsor-gaming.de", true },
{ "randc.org", true },
+ { "randewoo.ru", true },
{ "randolf.ca", true },
{ "random-samplings.org", true },
+ { "random.org", true },
{ "randomadversary.com", true },
{ "randombit.eu", false },
{ "randomcode.org", true },
@@ -31324,7 +32552,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "raphaelschmid.eu", true },
{ "raphrfg.com", true },
{ "rapidapp.io", true },
- { "rapidhubs.com", true },
{ "rapidoo.com.br", true },
{ "rapidshit.net", true },
{ "rapidstone.com", true },
@@ -31344,7 +32571,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ratelsec.com", true },
{ "rathbonesonline.com", true },
{ "rathgeb.org", true },
- { "rathorian.fr", true },
{ "ratinq.co", true },
{ "rationalcreation.com", true },
{ "rationalism.com", true },
@@ -31353,6 +32579,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "raulrivero.es", true },
{ "rault.io", true },
{ "rauros.net", true },
+ { "rauschenbach.de", true },
{ "rautelow.de", true },
{ "ravada-vdi.com", true },
{ "ravanalk.com", true },
@@ -31368,20 +32595,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rawsec.net", true },
{ "raxion.cf", true },
{ "raxion.tk", true },
- { "ray-home.de", true },
- { "ray-works.de", true },
{ "rayan-it.ir", true },
{ "rayiris.com", true },
{ "raykitchenware.com", true },
{ "raymcbride.com", true },
- { "raymd.de", true },
- { "raymii.org", true },
{ "raystark.com", true },
- { "rayworks.de", true },
{ "razberry.kr", true },
{ "razeen.me", true },
{ "razeencheng.com", true },
{ "raziskovalec-resnice.com", true },
+ { "razrsec.uk", true },
{ "razvanburz.net", true },
{ "rbensch.com", true },
{ "rbflote.lv", true },
@@ -31389,15 +32612,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rbmland.com", true },
{ "rbnet.xyz", true },
{ "rbran.com", true },
+ { "rbuddenhagen.com", true },
{ "rbx-talk.xyz", true },
+ { "rbx.com", true },
{ "rc-offi.net", true },
{ "rc-rp.com", true },
{ "rc-shop.ch", true },
{ "rca.fr", true },
+ { "rca.ink", true },
{ "rcd.cz", true },
{ "rcdocuments.com", true },
{ "rcgoncalves.pt", true },
- { "rchavez.site", true },
{ "rchrdsn.uk", true },
{ "rcifsgapinsurance.co.uk", true },
{ "rclsm.net", true },
@@ -31420,8 +32645,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rdns.cc", true },
{ "rdv-cni.fr", true },
{ "rdv-prefecture.com", true },
+ { "rdwh.tech", false },
{ "re-curi.com", true },
{ "re-engines.com", true },
+ { "reach-on.de", true },
{ "reachhead.com", true },
{ "reachonline.org", true },
{ "reachrss.com", true },
@@ -31433,10 +32660,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reactive-press.com", true },
{ "reactpwa.com", true },
{ "read.sc", true },
+ { "readabilitychecker.com", true },
{ "reades.co.uk", true },
{ "reades.uk", true },
- { "readheadcopywriting.com", true },
{ "readingrats.de", true },
+ { "readitify.com", true },
{ "readmusiccoleman.com", true },
{ "readonly.de", true },
{ "readouble.com", false },
@@ -31445,8 +32673,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "readyrowan.org", true },
{ "readysell.net", true },
{ "readytobattle.net", true },
- { "readytowear.es", true },
+ { "readytongue.com", true },
{ "reaganlibrary.gov", true },
+ { "reaiaer.com", true },
+ { "reaksi.id", true },
{ "real-digital.co.uk", true },
{ "real-it.nl", true },
{ "realcapoeira.ru", true },
@@ -31455,7 +32685,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "realestatemarketingblog.org", true },
{ "realestateonehowell.com", true },
{ "realestateradioshow.com", true },
- { "realfamilyincest.com", true },
{ "realfood.space", true },
{ "realfreedom.city", false },
{ "realhorsegirls.net", true },
@@ -31474,6 +32703,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "realmofespionage.xyz", true },
{ "realoteam.ddns.net", true },
{ "realpropertyprofile.gov", true },
+ { "realtoraidan.com", true },
{ "realtygroup-virginia.com", true },
{ "realtyink.net", true },
{ "realum.com", true },
@@ -31488,6 +32718,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reanimated.eu", true },
{ "reath.me", true },
{ "reath.xyz", true },
+ { "reavaninc.com", true },
{ "reaven.nl", true },
{ "rebane2001.com", true },
{ "rebeagle.com", true },
@@ -31499,17 +32730,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reboxetine.com", true },
{ "reboxonline.com", true },
{ "rebtoor.com", true },
+ { "reby.gq", true },
{ "recalls.gov", true },
{ "recantoshop.com", true },
{ "recantoshop.com.br", true },
- { "recapp.ch", true },
{ "recaptcha-demo.appspot.com", true },
- { "recard.vn", true },
{ "receiliart.com", true },
{ "receptionpoint.com", true },
{ "recepty.eu", true },
{ "recetasdecocinaideal.com", true },
{ "recetin.com", true },
+ { "recettecookeo.net", true },
{ "rechenknaecht.de", true },
{ "rechtsanwaeltin-vollmer.de", true },
{ "rechtsanwalt-koeppen-feucht.de", true },
@@ -31530,17 +32761,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "recordeuropa.com", false },
{ "recoveringspirit.com", true },
{ "recoveryonline.org", true },
+ { "recreation.gov", true },
{ "recruitmade.jp", true },
{ "rectecforum.com", true },
- { "recuerdafilms.com", true },
{ "recuperodatiraidfastec.it", true },
{ "recurly.com", true },
{ "recurrentmeningitis.org", true },
{ "recursosdeautoayuda.com", true },
{ "recyclingpromotions.us", true },
+ { "red-button.hu", true },
{ "red-t-shirt.ru", true },
{ "red-trigger.net", true },
- { "red2fred2.com", true },
{ "redable.hosting", true },
{ "redable.nl", true },
{ "redactieco.nl", true },
@@ -31552,6 +32783,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "redcone.net", true },
{ "redcorus.com", true },
{ "redd.it", true },
+ { "reddepsicologosdecr.com", true },
{ "reddingo.at", true },
{ "reddingo.be", true },
{ "reddingo.ch", true },
@@ -31566,11 +32798,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reddingo.nl", true },
{ "reddingo.nz", true },
{ "reddingsbrigade-zwolle.nl", true },
+ { "reddingsbrigadeveghel.nl", true },
{ "reddit2kindle.com", true },
{ "reddraggone9.com", true },
{ "reddyai.com", true },
{ "rede-reim.de", true },
{ "rede-t.com", true },
+ { "redecsirt.pt", true },
{ "redelectrical.co.uk", true },
{ "redessantaluzia.com.br", true },
{ "redflare.com.au", true },
@@ -31590,16 +32824,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "redleslie.com", true },
{ "redlinelap.com", true },
{ "redlink.de", true },
+ { "redmangallpsychologists.com.au", true },
{ "redmind.se", true },
{ "redmondtea.com", true },
{ "redmore.me", true },
{ "redneragenturen.org", true },
{ "rednsx.org", true },
{ "redpact.com", true },
- { "redporno.cz", true },
{ "redscan.com", true },
{ "redshell.pw", true },
- { "redshield.co", true },
{ "redshiftlabs.com.au", true },
{ "redshoeswalking.net", true },
{ "redsicom.com", true },
@@ -31624,12 +32857,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reevaappliances.co.uk", true },
{ "reezer.org", true },
{ "refactor.zone", false },
+ { "refer.codes", true },
{ "referdell.com", true },
{ "refficience.com", true },
- { "refill-roboter.de", true },
{ "refinansiering.no", true },
{ "reflectivity.io", true },
- { "reflectores.net", true },
{ "refletindosaude.com.br", true },
{ "reflets.info", true },
{ "reflexions.co", true },
@@ -31639,6 +32871,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reforesttheplanet.com", true },
{ "refresh-media.nl", true },
{ "refreshliving.us", true },
+ { "refrigeracionpeinado.com.mx", true },
{ "refu.net", true },
{ "refuelcollective.com", true },
{ "refuelcreative.com.au", true },
@@ -31655,6 +32888,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "regeneo.cz", true },
{ "regenerapoint.it", true },
{ "regenerescence.com", true },
+ { "regensburg-repariert.de", true },
{ "regily.com", true },
{ "regime-anticellulite.com", true },
{ "regime-maigrir-vite.com", true },
@@ -31665,6 +32899,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "regionalbasementandcrawlspacerepair.com", true },
{ "regionalgrowth.com", true },
{ "regiosalland.nl", true },
+ { "regiovertrieb.de", false },
{ "regis.tech", true },
{ "regisearch.co.uk", true },
{ "registerex.me", true },
@@ -31687,7 +32922,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reha-honpo.jp", true },
{ "rehabili-shigoto.com", true },
{ "rehabilitation.network", true },
- { "rehabmail.com", true },
{ "rehabphilippines.com", true },
{ "rehabreviews.com", true },
{ "rehabthailand.com", true },
@@ -31719,6 +32953,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reinouthoornweg.nl", true },
{ "reinventetoi.com", false },
{ "reisekosten-gorilla.com", true },
+ { "reisenbauer.ee", true },
{ "reiseversicherung-werner-hahn.de", true },
{ "reishunger.de", true },
{ "reisslittle.com", true },
@@ -31755,6 +32990,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "remedionaturales.com", true },
{ "remedioparaherpes.com", true },
{ "remedios-caserospara.com", true },
+ { "remembermidi.sytes.net", true },
{ "rememberthemilk.com", false },
{ "remi-saurel.com", true },
{ "remiafon.com", true },
@@ -31765,13 +33001,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "remitatm.com", false },
{ "remonti.info", true },
{ "remote.so", true },
- { "remoteham.com", true },
{ "remoteutilities.com", true },
{ "removalcellulite.com", true },
{ "removedrepo.com", true },
{ "remptmotors.com", true },
{ "remrol.ru", true },
{ "remszeitung.de", true },
+ { "rena.cloud", true },
{ "renaissanceplasticsurgery.net", true },
{ "renascentia.asia", true },
{ "renaultclubticino.ch", true },
@@ -31782,6 +33018,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rene-stolp.de", true },
{ "renearends.nl", true },
{ "renedekoeijer.com", true },
+ { "renedekoeijer.nl", true },
{ "renee.today", true },
{ "reneleu.ch", true },
{ "renem.net", false },
@@ -31814,6 +33051,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "renxinge.cn", false },
{ "reorz.com", true },
{ "reox.at", false },
+ { "repaik.com", false },
{ "repair.by", true },
{ "repaper.org", true },
{ "repaxan.com", true },
@@ -31843,6 +33081,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "res-kc.com", true },
{ "resama.eu", true },
{ "rescms-secure.com", true },
+ { "resdon.cn", true },
{ "research-panel.jp", true },
{ "research.facebook.com", false },
{ "researchgate.net", true },
@@ -31855,6 +33094,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "resine.roma.it", true },
{ "resinflooringcompany.com", true },
{ "resist.ca", true },
+ { "resistav.com", true },
{ "resnickandnash.com", true },
{ "resolvefa.co.uk", true },
{ "resolvefa.com", true },
@@ -31866,6 +33106,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "resourceconnect.com", true },
{ "resourceguruapp.com", true },
{ "resources.flowfinity.com", true },
+ { "resourcesmanagementcorp.com", true },
{ "respectmyprivacy.eu", true },
{ "respectmyprivacy.net", true },
{ "respectmyprivacy.nl", true },
@@ -31873,6 +33114,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "respiranto.de", true },
{ "respon.jp", true },
{ "responer.com", true },
+ { "respons.je", true },
+ { "respons.me", true },
+ { "respons.mobi", true },
+ { "respons.us", true },
+ { "respons.ws", true },
+ { "responscode.eu", true },
+ { "responscode.info", true },
+ { "responscode.mobi", true },
+ { "responscode.nl", true },
+ { "responsecode.info", true },
+ { "responsecode.mobi", true },
+ { "responsecode.nl", true },
{ "responsepartner.com", true },
{ "responsibledisclosure.nl", false },
{ "responsive-shop.com", true },
@@ -31893,6 +33146,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "restrito.org", true },
{ "resultsatretail.com", true },
{ "resursedigitale.ro", true },
+ { "retailcybersolutions.com", true },
{ "retcor.net", true },
{ "retefarmaciecostadamalfi.it", true },
{ "retetenoi.net", true },
@@ -31917,6 +33171,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "retrojar.top", true },
{ "retroride.cz", true },
{ "retroroundup.com", true },
+ { "retrotown.ws", true },
{ "retrotracks.net", true },
{ "retrovideospiele.com", true },
{ "returnonerror.com", true },
@@ -31937,6 +33192,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "reversecanada.com", true },
{ "reverseloansolutions.com", true },
{ "reversesouthafrica.com", true },
+ { "reviderm-skinmedics-rheinbach.de", true },
{ "review.jp", true },
{ "reviewninja.net", true },
{ "reviews.anime.my", false },
@@ -31947,10 +33203,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "revista-programar.info", true },
{ "revivalinhisword.com", true },
{ "revivalprayerfellowship.com", true },
+ { "revivalsstores.com", true },
{ "revivingtheredeemed.org", true },
{ "revlect.com", true },
{ "revolt.tv", true },
{ "revthefox.co.uk", true },
+ { "revuestarlight.me", true },
{ "rewardingexcellence.com", true },
{ "rewrite3.com", true },
{ "rewtherealtor.com", true },
@@ -31963,6 +33221,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rezosup.net", true },
{ "rezosup.org", true },
{ "rezultant.ru", true },
+ { "rfitness.dk", true },
{ "rftoon.com", true },
{ "rfxanalyst.com", true },
{ "rga.sh", true },
@@ -31984,6 +33243,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rhinoceroses.org", true },
{ "rhodenmanorcattery.co.uk", true },
{ "rhodri.io", true },
+ { "rhondanp.com", true },
{ "rhowell.io", true },
{ "rhumblineadvisers.com", true },
{ "rhymeswithmogul.com", true },
@@ -32022,6 +33282,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "richardson.tw", true },
{ "richardstonerealestate.com", true },
{ "richardwarrender.com", true },
+ { "richbutler.co.uk", true },
{ "richeyweb.com", true },
{ "richie.fi", true },
{ "ricketyspace.net", true },
@@ -32038,13 +33299,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ricoydesign.com", true },
{ "ricozienke.de", true },
{ "riddims.co", true },
+ { "riddler.com.ar", true },
{ "rideintaxi.com", true },
{ "rideways.com", true },
{ "rideyourdamn.bike", true },
{ "ridgelandchurch.org", true },
{ "ridhaan.co", true },
{ "ridingboutique.de", true },
- { "ridwan.co", false },
{ "riederle.com", true },
{ "riemer.ml", true },
{ "riesenweber.id.au", true },
@@ -32060,7 +33321,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rightbrain.training", true },
{ "rightmovecanada.com", true },
{ "rightnetworks.com", true },
- { "rightstuff.link", true },
+ { "rightstuff.link", false },
{ "righttobuy.gov.uk", true },
{ "rigolitch.fr", true },
{ "rigsalesaustralia.com", true },
@@ -32072,11 +33333,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "riku.pw", true },
{ "rile5.com", true },
{ "rileyevans.co.uk", true },
+ { "rileyskains.com", true },
{ "rimax.vn", true },
{ "rimcountrymuseum.org", true },
{ "rimeto.io", true },
{ "rimo.site", true },
{ "rimorrecherche.nl", true },
+ { "rincondenoticas.com", true },
{ "ring.com", true },
{ "ringingliberty.com", true },
{ "ringjewellery.co.uk", true },
@@ -32084,30 +33347,32 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rio-weimar.de", true },
{ "rioshop.com.br", true },
{ "rioxmarketing.com", true },
- { "rioxmarketing.pt", true },
{ "rip-sport.cz", true },
{ "ripaton.fr", true },
{ "ripcorddesign.com", true },
{ "ripcordsandbox.com", true },
{ "ripmixmake.org", true },
{ "riqy86.nl", true },
- { "ris-bad-wurzach.de", true },
{ "ris.fi", true },
{ "risada.nl", true },
{ "risaphuketproperty.com", true },
{ "riscascape.net", true },
{ "rischard.org", true },
{ "rise-technologies.com", true },
+ { "rise.global", true },
{ "riseup.net", true },
{ "rishikeshyoga.in", true },
{ "risiinfo.com", true },
{ "riskmitigation.ch", true },
{ "risparmiare.info", true },
{ "ristioja.ee", true },
+ { "ristisanat.fi", true },
{ "ristoarea.it", true },
{ "ristorantefattoamano.it", true },
+ { "ristorantelittleitaly.com", true },
{ "ristoviitanen.fi", true },
{ "ristrutturazioneappartamento.roma.it", true },
+ { "ristrutturazioniappartamentinapoli.it", true },
{ "rit.space", false },
{ "ritirocalcinacci.viterbo.it", true },
{ "rittau.biz", true },
@@ -32117,6 +33382,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rivalsa.cn", true },
{ "rivastation.de", true },
{ "riverbanktearooms.co.uk", true },
+ { "riverbendessentialoil.com", true },
{ "riverbendroofingnd.com", true },
{ "riverford.co.uk", true },
{ "rivermist.com.au", true },
@@ -32142,6 +33408,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rlalique.com", true },
{ "rld.org", true },
{ "rlds.ch", true },
+ { "rle.me", true },
{ "rleeden.servehttp.com", true },
{ "rleh.de", true },
{ "rlnunez.com", true },
@@ -32150,7 +33417,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rmb.li", true },
{ "rmcbs.de", true },
{ "rmeuropean.com", true },
- { "rmf.io", true },
{ "rmi.com.ar", true },
{ "rmm-i.com", true },
{ "rmmanfredi.com", true },
@@ -32169,7 +33435,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "roams.es", true },
{ "rob006.net", true },
{ "robandjanine.com", true },
- { "robbertt.com", false },
{ "robbiecrash.me", true },
{ "robdavidson.network", true },
{ "robert-flynn.de", true },
@@ -32179,6 +33444,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "robertayamashita.com.br", true },
{ "robertbln.com", true },
{ "roberthurlbut.com", true },
+ { "robertkotlermd.com", true },
{ "robertkrueger.de", true },
{ "robertlysik.com", true },
{ "robertnemec.com", true },
@@ -32187,24 +33453,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "robertopazeller.ch", true },
{ "robertreiser.photography", true },
{ "robertrijnders.nl", true },
+ { "robertses.org", true },
{ "robertsmits.be", false },
+ { "robgorman.ie", true },
{ "robhorstmanshof.nl", true },
{ "robicue.com", true },
{ "robigalia.org", false },
{ "robin.co.kr", true },
{ "robin.info", true },
{ "robinevandenbos.nl", true },
- { "robinflikkema.nl", true },
{ "robinfrancq.ml", true },
{ "robinhoodbingo.com", true },
{ "robinlinden.eu", true },
- { "robinsonstrategy.com", true },
{ "robinsonyu.com", true },
{ "robinvdmarkt.nl", true },
{ "robinwill.de", true },
{ "robinwinslow.uk", true },
{ "robjager-fotografie.nl", true },
{ "robocop.no", true },
+ { "robodeidentidad.gov", true },
+ { "roboex.net", true },
{ "robohash.org", true },
{ "robokits.co.in", true },
{ "robot.car", true },
@@ -32218,6 +33486,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "robpol86.com", true },
{ "robspc.repair", true },
{ "robspeed.rocks", true },
+ { "robsutter.com", true },
+ { "robtatemusic.com", true },
{ "robtex.com", true },
{ "robu.in", true },
{ "robud.info", true },
@@ -32229,6 +33499,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rockbankland.com.au", true },
{ "rockcanyonbank.com", true },
{ "rockenfuerlachenhelfen.de", true },
+ { "rockerchyc.com", true },
{ "rocket-wars.de", true },
{ "rocketevents.com.au", true },
{ "rocketr.net", true },
@@ -32277,11 +33548,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rogersvilleumc.org", true },
{ "rognhaugen.no", true },
{ "rogoff.xyz", true },
- { "rogue-e.xyz", true },
{ "roguefinancial.com", true },
{ "roguefortgame.com", true },
{ "roguenation.space", true },
{ "roguenetworks.me", true },
+ { "roguesignal.net", true },
{ "roguetechhub.org", true },
{ "rohedaten.de", true },
{ "rohitagr.com", true },
@@ -32289,6 +33560,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "roka9.de", true },
{ "rokass.nl", true },
{ "rokki.ch", true },
+ { "roko-foto.de", true },
{ "rokort.dk", true },
{ "rokudenashi.de", true },
{ "roland.io", true },
@@ -32297,6 +33569,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rolandlips.nl", true },
{ "rolandreed.cn", true },
{ "rolandszabo.com", true },
+ { "rolfsbuss.se", true },
{ "roligprylar.se", true },
{ "rollatorweb.nl", true },
{ "rolleyes.org", true },
@@ -32324,6 +33597,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "romatrip.it", true },
{ "rome.dating", true },
{ "rommelwood.de", true },
+ { "romtex.co.uk", true },
{ "romun.net", true },
{ "romy.tw", true },
{ "rondommen.nl", true },
@@ -32364,7 +33638,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rootcommand.com", true },
{ "rootear.com", true },
{ "rootedlifemontessori.com", true },
+ { "rootetsy.com", true },
{ "rootkea.me", true },
+ { "rootkit.es", true },
{ "rootlair.com", true },
{ "rootonline.de", true },
{ "rootpigeon.com", true },
@@ -32415,6 +33691,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rothwellgornthomes.com", true },
{ "rotkreuzshop.de", true },
{ "rotol.me", true },
+ { "rottipowah.com", true },
{ "rottweil-hilft.de", true },
{ "rotunneling.net", true },
{ "rougechocolat.fr", true },
@@ -32426,6 +33703,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "roundcube.mayfirst.org", false },
{ "roundrock-locksmith.com", true },
{ "roundtablekzn.co.za", true },
+ { "roundtheme.com", false },
{ "roundtoprealestate.com", true },
{ "roussos.cc", true },
{ "rout0r.org", true },
@@ -32434,6 +33712,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "routerclub.ru", true },
{ "routercncperu.com", true },
{ "routetracker.co", true },
+ { "rowancasting.com", true },
{ "rowancasting.ie", true },
{ "rowancounty911.com", true },
{ "rowancounty911.org", true },
@@ -32456,15 +33735,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "royalbeautyclinic.ir", true },
{ "royalbluewa3.cc", true },
{ "royalcitytaxi.ca", true },
- { "royalcitytaxi.com", true },
{ "royalfoxrealtor.com", true },
{ "royalmarinesassociation.org.uk", true },
{ "royalnissanparts.com", true },
{ "royalpalacenogent.fr", true },
{ "royalpub.net", false },
{ "royalrangers.fi", true },
- { "royaltube.net", true },
- { "royalty-market.com", true },
{ "royceandsteph.com", true },
{ "roycewilliams.net", true },
{ "roygerritse.nl", true },
@@ -32484,16 +33760,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rpus.co", true },
{ "rpy.xyz", true },
{ "rq-labo.jp", true },
- { "rr105.de", true },
{ "rraesthetics.com", true },
+ { "rrbts.com", true },
{ "rrdesignsuisse.com", true },
{ "rrg-partner.ch", true },
{ "rrudnik.com", true },
{ "rrwolfe.com", true },
+ { "rs-cloud.ddns.net", true },
{ "rs-maschinenverleih.de", true },
{ "rsanahuano.com", true },
{ "rsap.ca", true },
- { "rsauget.fr", true },
{ "rsblake.net", true },
{ "rsgcard.com", true },
{ "rsingermd.com", true },
@@ -32503,11 +33779,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rsp-blogs.de", true },
{ "rsridentassist.com", true },
{ "rss.sh", false },
- { "rssr.ddns.net", true },
{ "rssr.se", true },
{ "rsttraining.co.uk", true },
{ "rsync.eu", false },
{ "rt22.ch", true },
+ { "rtate.ca", true },
+ { "rtate.se", true },
{ "rtcx.net", true },
{ "rte.eu", true },
{ "rte.radio", true },
@@ -32527,13 +33804,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rthsoftware.net", true },
{ "rtrappman.com", true },
{ "rtrinflatables.co.uk", true },
+ { "rtsak.com", true },
{ "rtsr.ch", true },
{ "rttvvip.com", true },
{ "rtwcourse.com", true },
{ "rtzoeller.com", true },
{ "ru-sprachstudio.ch", true },
{ "ru.search.yahoo.com", false },
- { "rua.cx", true },
{ "ruaneattorneys.com", true },
{ "ruanmi.de", true },
{ "rubberfurs.org", true },
@@ -32544,10 +33821,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rubenbarbero.com", true },
{ "rubenkruisselbrink.nl", true },
{ "rubens.cloud", true },
+ { "rubixstudios.com.au", true },
{ "rublacklist.net", true },
{ "ruby-auf-schienen.de", true },
+ { "rubyist.im", true },
{ "rubyist.today", true },
{ "rubymartin.com.au", true },
+ { "rubyquincunx.com", true },
+ { "rubyquincunx.org", true },
{ "rubytune.com", true },
{ "rucksack-rauf-und-weg.de", true },
{ "ruckzuck-privatpatient.de", true },
@@ -32555,7 +33836,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ruconsole.com", true },
{ "rud.is", true },
{ "rudd-o.com", true },
- { "rudelune.fr", true },
+ { "rudel-wot.de", true },
{ "rudewiki.com", true },
{ "rudhaulidirectory.com", true },
{ "rudloff.pro", true },
@@ -32568,11 +33849,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ruedirrenggli.ch", true },
{ "rueduparticulier.tk", false },
{ "rueegger.me", true },
+ { "rueg.eu", true },
+ { "ruequincampoix.com", true },
{ "ruerte.net", true },
{ "rufabula-com.appspot.com", true },
{ "ruffbeatz.com", true },
{ "rugk.dedyn.io", true },
{ "ruh-veit.de", true },
+ { "ruha.co.in", true },
+ { "ruhnke.cloud", true },
{ "ruhrmobil-e.de", true },
{ "ruhrnalist.de", true },
{ "ruht.ro", true },
@@ -32592,11 +33877,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rumplesinflatables.co.uk", true },
{ "rumtaste.com", true },
{ "rumtaste.de", true },
- { "run-forrest.run", true },
{ "run-it-direct.co.uk", true },
{ "runagain.ch", true },
{ "runebet.com", true },
{ "runefake.com", true },
+ { "runfitcoaching.com", true },
{ "runklesecurity.com", true },
{ "runnergrapher.com", true },
{ "runreport.fr", true },
@@ -32612,6 +33897,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "rusempire.ru", true },
{ "rushball.net", true },
{ "rushiiworks.com", true },
+ { "rushpoppershop.co.uk", true },
{ "rushter.com", true },
{ "rushyo.com", true },
{ "rusi-ns.ca", true },
@@ -32634,27 +33920,33 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ruthmontenegro.com", false },
{ "rutiger.com", true },
{ "rutika.ru", true },
- { "rutten.me", true },
+ { "rutten.me", false },
{ "ruudkoot.nl", true },
+ { "ruurdboomsma.nl", true },
{ "ruwhof.net", true },
{ "ruya.com", true },
{ "ruyatabirleri.com", true },
+ { "ruzzll.com", true },
{ "rv-jpshop.com", true },
{ "rva-asbestgroep.nl", true },
+ { "rvc-france.com", true },
+ { "rvfit.dk", true },
{ "rvfu98.com", true },
{ "rvnoel.net", true },
{ "rvsa2bevestigingen.nl", true },
{ "rvsa4bevestigingen.nl", true },
{ "rvsbevestigingen.nl", true },
+ { "rvsuitlaatdelen.nl", true },
{ "rw.search.yahoo.com", false },
{ "rwky.net", true },
+ { "rws-cc.com", true },
{ "rws-vertriebsportal.de", true },
{ "rwx.ovh", true },
- { "rx-contact.com", false },
{ "rxbn.de", true },
{ "rxbusiness.com", true },
{ "rxcheck.com", true },
{ "rxgroup.io", true },
+ { "rxguide.nl", true },
{ "rxight.com", true },
{ "ryan-design.com", true },
{ "ryan-gehring.com", true },
@@ -32672,6 +33964,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ryois.me", true },
{ "rys.pw", true },
{ "ryu22e.org", true },
+ { "ryuanerin.kr", true },
{ "ryuu.es", true },
{ "ryzhov.me", true },
{ "rzentarzewski.net", true },
@@ -32685,11 +33978,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "s-pegasus.com", true },
{ "s-s-paint.com", true },
{ "s007.co", true },
+ { "s0laris.co.uk", true },
{ "s10y.eu", true },
{ "s13d.fr", true },
{ "s16e.no", true },
{ "s2member.com", true },
- { "s2p.moe", true },
{ "s2t.net", true },
{ "s3cur3.it", true },
{ "s3robertomarini.it", true },
@@ -32700,22 +33993,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "s4q.me", true },
{ "s4tips.com", true },
{ "s4ur0n.com", true },
- { "s5118.com", true },
{ "s64.cz", true },
{ "s8a.us", true },
{ "s95.de", true },
- { "sa-blog.net", true },
{ "sa-mp.ro", true },
{ "sa.net", true },
{ "saabpartsdistribution.com", true },
{ "saamhorigheidsfonds.nl", false },
{ "saas.de", true },
{ "saastopankki.fi", true },
+ { "saatchiart.com", true },
{ "saba-piserver.info", true },
{ "sabahattin-gucukoglu.com", true },
+ { "sabbottlabs.com", true },
{ "sabe.cz", true },
+ { "sabine-forschbach.de", true },
{ "sablyrics.com", true },
{ "sabrinajoias.com.br", true },
+ { "sabrinajoiasprontaentrega.com.br", true },
{ "sacaentradas.com", true },
{ "saccani.net", true },
{ "sackmesser.ch", true },
@@ -32734,6 +34029,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sadiejewellery.co.uk", true },
{ "sadmansh.com", true },
{ "sadou.kyoto.jp", true },
+ { "sadsu.com", true },
{ "saechsischer-christstollen.shop", true },
{ "saengsook.com", true },
{ "saengsuk.com", true },
@@ -32742,7 +34038,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "safaritenten.nl", true },
{ "safcstore.com", true },
{ "safe.moe", true },
- { "safe.space", true },
{ "safebaseflorida.com", true },
{ "safebasements.com", true },
{ "safebasementsnorthdakota.com", true },
@@ -32772,6 +34067,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "safetyworkkits.co.nz", true },
{ "safeui.com", true },
{ "safire.ac.za", true },
+ { "safungerar.se", true },
+ { "saga-umzuege.de", true },
+ { "sagaenterprizes.com", true },
{ "sagargandecha.com.au", true },
{ "sagedocumentmanager.com", true },
{ "sagerus.com", true },
@@ -32791,6 +34089,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "saier.me", true },
{ "saifoundation.in", true },
{ "saigonflowers.com", true },
+ { "saigonstar.de", true },
{ "saikarra.com", true },
{ "saikou.moe", true },
{ "saikouji.tokushima.jp", true },
@@ -32834,6 +34133,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "saitv.org", true },
{ "sajamstudija.info", true },
{ "sajdowski.de", true },
+ { "sajtoskal.hu", true },
{ "sakaki.anime.my", false },
{ "sakamichi.moe", true },
{ "sakerhetskopiering.nu", true },
@@ -32865,7 +34165,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "salesmachine.io", true },
{ "salexy.kz", true },
{ "salidaswap.com", true },
- { "salixcode.com", true },
{ "salland1.nl", true },
{ "salle-quali.fr", true },
{ "sallydowns.name", true },
@@ -32873,9 +34172,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "salmonella.co.uk", true },
{ "salmonrecovery.gov", true },
{ "salmonvision.com.tw", true },
- { "salmos91.com", true },
{ "salmotierra-salvatierra.com", true },
- { "salon-claudia.ch", true },
{ "salon-hinata.biz", true },
{ "salon-minipli.de", true },
{ "salon.io", false },
@@ -32893,6 +34190,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "saludmas.site", true },
{ "saludsis.mil.co", true },
{ "saludyvida.site", true },
+ { "saluels.servemp3.com", true },
{ "salutethefish.com", true },
{ "salutethegrains.com", true },
{ "salutethepig.com", true },
@@ -32903,14 +34201,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "samanthasgeckos.com", true },
{ "samappleton.com", true },
{ "samara-avia.ru", true },
+ { "samariafar.com", true },
{ "samaritainsmeyrin.ch", true },
{ "samatva-yogalaya.com", true },
- { "samba.com.co", true },
{ "samba.org", true },
- { "sambaa.com.br", true },
{ "sambaash.com", true },
{ "sambeso.net", true },
{ "samdev.io", true },
+ { "samdrewtakeson.com", false },
{ "samegoal.com", true },
{ "samegoal.org", true },
{ "samel.de", true },
@@ -32920,7 +34218,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "samgrayson.me", true },
{ "samhuri.net", true },
{ "samifar.in", true },
- { "samitechnic.com", true },
{ "samizdat.cz", true },
{ "samkelleher.com", true },
{ "saml-gateway.org", true },
@@ -32930,7 +34227,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sammyjohnson.com", true },
{ "sammyservers.com", true },
{ "sammyservers.net", true },
- { "samnya.cn", false },
+ { "samnya.cn", true },
+ { "samorazvitie.ru", true },
{ "samplefashion.nl", true },
{ "samri.pt", true },
{ "samrobertson.co.uk", true },
@@ -32938,7 +34236,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "samsungmobile.it", true },
{ "samsungphonegenerator.xyz", true },
{ "samtalen.nl", true },
- { "samuel-dumont.be", true },
{ "samuelkeeley.com", true },
{ "samuellaulhau.fr", true },
{ "samui-samui.de", false },
@@ -32950,7 +34247,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sana-store.com", true },
{ "sana-store.cz", true },
{ "sana-store.sk", true },
- { "sanael.net", true },
{ "sanantoniolocksmithinc.com", true },
{ "sanantoniolocksmithtx.com", true },
{ "sanasport.cz", true },
@@ -32958,9 +34254,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sanatorii-sverdlovskoy-oblasti.ru", true },
{ "sanatorionosti.com.ar", true },
{ "sanbornteam.com", true },
+ { "sand-islets.de", true },
{ "sandalj.com", true },
{ "sandbagexpress.com", true },
{ "sandbox.mydigipass.com", false },
+ { "sandboxfp.com", true },
{ "sandburner.net", true },
{ "sander.sh", true },
{ "sanderdorigo.nl", true },
@@ -32972,8 +34270,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sandiegotown.com", true },
{ "sandmanintel.com", true },
{ "sandmarc.cz", true },
- { "sandobygg.se", true },
- { "sandogruppen.se", true },
{ "sandor.wtf", true },
{ "sandrainden.nl", true },
{ "sandraindenfotografie.nl", true },
@@ -32990,6 +34286,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sanex.ca", false },
{ "sanglierhurlant.fr", true },
{ "sangwon.io", true },
+ { "sangyoui.health", true },
{ "sanilodge.com", true },
{ "sanipousse.com", true },
{ "sanissimo.com.mx", false },
@@ -32997,7 +34294,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sanitairwinkel.com", true },
{ "sanitairwinkel.nl", true },
{ "sanitrak.cz", true },
+ { "sanjotech.space", true },
{ "sanmuding.com", true },
+ { "sanovnik.at", true },
{ "sanpham-balea.org", true },
{ "sanskritiyoga.com", true },
{ "sansonehowell.com", true },
@@ -33011,12 +34310,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "santojuken.co.jp", true },
{ "santoshpandit.com", true },
{ "sanvitolocapobus.com", true },
+ { "sanych-msk.ru", true },
{ "saol.eu", true },
{ "saoneth.pl", true },
{ "saorsat.com", true },
{ "saorsat.ie", true },
{ "saorsat.tv", true },
{ "saorview.com", true },
+ { "saorview.net", true },
{ "saorviewconnect.ie", true },
{ "saorviewconnected.ie", true },
{ "sap-inc.co.jp", true },
@@ -33029,6 +34330,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sapphirepearl.com.sg", true },
{ "sapprendre.ch", true },
{ "saprima.de", true },
+ { "saputra.org", true },
{ "sarabara.com", true },
{ "sarahbeckettharpist.com", true },
{ "sarahboydrealty.com", true },
@@ -33038,6 +34340,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sarahplusdrei.de", true },
{ "sarahsecret.de", true },
{ "sarahvictor.co.uk", true },
+ { "sarahwellington.com", true },
{ "sarahwikeley.co.uk", true },
{ "saraleebread.com", false },
{ "sarariman.com", true },
@@ -33047,8 +34350,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sardegnatirocini.it", true },
{ "sarink.eu", true },
{ "sarkisianbuilders.com", true },
+ { "sarkoziadam.hu", true },
{ "saro.me", true },
- { "saronno5stelle.it", true },
{ "sarpsb.org", true },
{ "sarumtechnologies.com", true },
{ "sas-snowboarding.sk", true },
@@ -33079,6 +34382,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "satisperfectacollections.com", true },
{ "satmd.de", true },
{ "satoshinumbers.com", true },
+ { "satplay.host", true },
+ { "satsukii.moe", true },
+ { "sattamatka.market", true },
{ "sattamatkachart.in", true },
{ "sattamatkamobi.mobi", true },
{ "saturn.pl", true },
@@ -33098,11 +34404,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "saumon-france.com", true },
{ "saumondefrance.fr", true },
{ "saumonfrance.fr", true },
+ { "saunahats.eu", true },
{ "saunas.fr", true },
{ "saunatime.jp", true },
{ "sauvagebridge.nl", true },
{ "savaari.com", true },
{ "savageorgiev.com", true },
+ { "savbus.com", true },
+ { "savbus.net", true },
+ { "savbus.ws", true },
{ "save-me-aachen.de", true },
{ "savecrypto.org", true },
{ "savenet.org", true },
@@ -33116,7 +34426,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "savingrecipe.com", true },
{ "savingsoftheyear.com", true },
{ "savingsomegreen.com", true },
- { "savingsstoreonline.ca", true },
{ "savisasolutions.co.za", true },
{ "savvytime.com", true },
{ "sawyerroofing.com", true },
@@ -33135,6 +34444,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sazuz.cz", true },
{ "sb-group.dk", true },
{ "sb-mnn.com", true },
+ { "sb-sd.org", true },
{ "sb-tuning.ru", true },
{ "sb.im", true },
{ "sb.sb", true },
@@ -33161,6 +34471,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sbytes.info", true },
{ "sc-artworks.co.uk", true },
{ "sc5.jp", true },
+ { "scaarus.com", true },
{ "scaffalature.roma.it", true },
{ "scalacollege.nl", true },
{ "scalaire.com", true },
@@ -33187,8 +34498,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "scene.mx", true },
{ "scenester.tv", true },
{ "scenicbyways.info", true },
- { "scentofwine.com", true },
{ "scepticism.com", true },
+ { "scevity.com", true },
{ "schadevergoedingen.eu", true },
{ "schaefer-reifen.de", true },
{ "schaffensdrang.at", true },
@@ -33207,7 +34518,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "schelberts.de", true },
{ "schellevis.net", true },
{ "schemingmind.com", true },
- { "schenkes.de", true },
+ { "schenkes.de", false },
{ "scherfke.de", true },
{ "scheuchenstuel.at", true },
{ "schgroup.com", true },
@@ -33218,6 +34529,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "schippendale.de", true },
{ "schizoids.net", true },
{ "schlachter.ca", true },
+ { "schlaf.guru", true },
{ "schlafguru.com", true },
{ "schlagenhauf.info", true },
{ "schlagma.de", false },
@@ -33227,12 +34539,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "schlick.wedding", true },
{ "schlossereieder.at", true },
{ "schlossfuchs.de", true },
+ { "schluesseldienst-berlin.de", true },
+ { "schluesseldienst-hannover24.de", true },
{ "schlueter-software.de", true },
{ "schmaeh-coaching.ch", true },
+ { "schmatloch.cloud", true },
{ "schmelle.me", true },
{ "schmetterlingsapp.at", true },
{ "schmid.tv", true },
{ "schmidthomes.com", true },
+ { "schmidtlohwasser.de", true },
{ "schmidtplasticsurgery.com", true },
{ "schmitt-etienne.fr", true },
{ "schmitt-max.com", true },
@@ -33248,6 +34564,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "schnyder-werbung.ch", true },
{ "schoeck-elektro.de", true },
{ "schoeller.click", true },
+ { "schoenstatt.link", true },
{ "schoepski.de", true },
{ "schoknecht.net", true },
{ "schoknecht.one", true },
@@ -33267,6 +34584,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "scholierenvervoerzeeland.nl", true },
{ "scholledev.com", true },
{ "scholz-kallies.de", true },
+ { "schonstedt.com", true },
{ "schont.org", true },
{ "school-b.us", true },
{ "school-register.co.za", true },
@@ -33290,8 +34608,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "schreinerei-jahreis.de", true },
{ "schrenkinzl.at", true },
{ "schritt4fit.de", true },
- { "schrodingersscat.com", true },
- { "schrodingersscat.org", true },
{ "schroeder-immobilien-sundern.de", true },
{ "schroepfi.de", true },
{ "schrolm.de", true },
@@ -33320,11 +34636,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "schutzwerk.com", true },
{ "schwabenhaus-ka.de", true },
{ "schwalliers.com", true },
- { "schwanke.in", true },
{ "schwano-dent.at", true },
{ "schwarz-gelbe-fuechse.de", true },
{ "schwarzegar.de", true },
{ "schwarzer.it", true },
+ { "schwarzer.wang", true },
{ "schwarzes-muenchen.de", true },
{ "schwarzhenri.ch", true },
{ "schwarztrade.cz", true },
@@ -33337,6 +34653,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "science-network.ch", true },
{ "science-questions.org", true },
{ "science-texts.de", true },
+ { "science.gov", true },
{ "science360.gov", true },
{ "sciencebase.gov", true },
{ "scienceexploits.com", true },
@@ -33344,6 +34661,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "scienceminnesota.com", true },
{ "sciencesolutions.eu", true },
{ "sciencex.com", true },
+ { "scientific.boston", true },
{ "scifi.fyi", true },
{ "scigov.xyz", true },
{ "scijinks.gov", true },
@@ -33351,7 +34669,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "scimage.com", true },
{ "scintilla.nl", true },
{ "scintillating.stream", true },
- { "scis.com.ua", true },
{ "scistarter.com", true },
{ "scitopia.net", true },
{ "sclns.co", true },
@@ -33365,7 +34682,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "scorerealtygroup.com", true },
{ "scorp13.com", true },
{ "scorpowines.com", true },
- { "scottah.com", true },
{ "scottgalvin.com", true },
{ "scottgthomas.com", true },
{ "scotthelme.co.uk", true },
@@ -33373,8 +34689,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "scottishcu.org", true },
{ "scottishseniorsgolf.com", true },
{ "scottlanderkingman.com", true },
+ { "scottmay.id.au", true },
{ "scottseditaacting.com", true },
- { "scotttopperproductions.com", true },
{ "scoutingridderkerk.nl", true },
{ "scoutingtungelroy.nl", true },
{ "scoutnet.de", true },
@@ -33488,6 +34804,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "searchcandy.uk", true },
{ "searchdatalogy.com", true },
{ "searchfox.org", true },
+ { "searchpartners.dk", true },
{ "seareytraining.com", true },
{ "searsucker.com", true },
{ "searx.ru", true },
@@ -33518,6 +34835,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sebastianblade.com", true },
{ "sebastianboegl.de", true },
{ "sebastiaperis.com", true },
+ { "sebastiensenechal.com", true },
{ "sebasveeke.nl", true },
{ "sebepoznani.eu", true },
{ "sebi.org", true },
@@ -33547,27 +34865,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "secnews.gr", true },
{ "secomo.org", true },
{ "secondchancejobsforfelons.com", true },
+ { "secondnature.bio", true },
{ "seconfig.sytes.net", true },
{ "secpatrol.de", true },
{ "secretar.is", true },
{ "secretary-schools.com", true },
- { "secretpanties.com", true },
{ "secretpigeon.com", true },
{ "secretsanta.fr", true },
{ "secretsdujeu.com", true },
{ "secretserveronline.com", true },
+ { "secretum.tech", true },
{ "secteer.com", true },
{ "sectelligence.nl", true },
{ "sectio-aurea.org", true },
{ "section-31.org", true },
{ "section.io", true },
- { "section508.gov", true },
{ "section77.de", true },
{ "sector5.xyz", true },
{ "sectun.com", true },
{ "secumail.nl", true },
{ "secundity.nl", true },
{ "securai.de", true },
+ { "secure-computing.net", true },
{ "secure-graphic.de", true },
{ "secure-gw.de", true },
{ "secure-server-hosting.com", true },
@@ -33575,8 +34894,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "secure.co.hu", true },
{ "secure.facebook.com", false },
{ "securecomms.cz", true },
+ { "securedns.zone", true },
{ "securedrop.org", true },
{ "secureesolutions.com", true },
+ { "securefiletransfer.nl", true },
{ "secureheaders.com", true },
{ "secureideas.com", true },
{ "secureim.de", true },
@@ -33584,11 +34905,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "securelect-inspection.com", true },
{ "securemailbox.com", true },
{ "securemessage.nl", true },
+ { "securemy.website", true },
+ { "securenets.nl", true },
{ "secureobscure.com", true },
- { "secureonline.co", false },
+ { "secureonline.co", true },
{ "securethe.news", true },
{ "securetheorem.com", true },
{ "securetrustbank.com", true },
+ { "securevideo.com", true },
{ "securi-tay.co.uk", true },
{ "securify.nl", true },
{ "securipy.com", true },
@@ -33598,10 +34922,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "security-brokers.com", true },
{ "security.gives", true },
{ "security.google.com", true },
- { "security.love", true },
{ "security201.co.uk", true },
{ "security201.com", true },
- { "securityblues.co.uk", true },
{ "securitycamerascincinnati.com", true },
{ "securityescrownews.com", true },
{ "securityfest.com", true },
@@ -33616,10 +34938,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "securitypluspro.com", true },
{ "securityprimes.in", true },
{ "securitypuppy.com", true },
- { "securitysense.co.uk", true },
+ { "securityrussia.com", true },
{ "securitysnobs.com", false },
{ "securitystrata.com", true },
- { "securitystreak.com", true },
{ "securitytrails.com", true },
{ "securitywithnick.com", true },
{ "securitywithoutborders.org", true },
@@ -33641,13 +34962,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "seedcoworking.es", true },
{ "seedisclaimers.com", true },
{ "seednode.co", true },
- { "seedsofangelica.net", true },
{ "seekers.ch", true },
{ "seekfirstthekingdom.ca", true },
{ "seeks.ru", true },
- { "seekthe.net", true },
{ "seemeagain.com", true },
- { "seesuite.com", false },
+ { "seemomclick.com", true },
{ "seewhatididhere.com", true },
{ "seeworkdone.com", true },
{ "seezeitlodge-bostalsee.de", true },
@@ -33667,7 +34986,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "segurosdevidamiami.org", true },
{ "segurosocial.gov", false },
{ "seguroviagem.srv.br", false },
+ { "sehablazolano.com", true },
{ "sehnenweh.org", true },
+ { "seht.xyz", true },
{ "seibert.ninja", true },
{ "seibu-kikaku.co.jp", true },
{ "seifried.org", true },
@@ -33678,9 +34999,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "seitai-nabejun.jp", true },
{ "seitai-taiyou.com", true },
{ "seitenwaelzer.de", true },
+ { "sek.ai", true },
{ "sekikawa.biz", true },
{ "sekisonn.com", true },
{ "sekoya.org", true },
+ { "sektor.ro", true },
+ { "sektor.tech", true },
+ { "sektor41.com", true },
+ { "selber-coden.de", true },
{ "selbys.net.au", true },
{ "selcusters.nl", true },
{ "seldax.com", true },
@@ -33688,10 +35014,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "selected-properties.com", true },
{ "selectel.com", false },
{ "selectel.ru", true },
+ { "selectionengine.ca", true },
+ { "selectionengine.com", true },
+ { "selectionengine.net", true },
+ { "selectionengine.org", true },
{ "selectorders.com", true },
{ "selectsplat.com", true },
{ "selegiline.com", true },
- { "selekzo.com", true },
+ { "selent.me", true },
{ "seleondar.ru", true },
{ "self-evident.org", true },
{ "self-signed.com", true },
@@ -33703,6 +35033,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "selfici.cz", true },
{ "selfishness.com", true },
{ "selfloath.in", true },
+ { "selfmade4u.de", true },
{ "selkiemckatrick.com", true },
{ "sellajoch.com", true },
{ "selldorado.com", true },
@@ -33721,7 +35052,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "semaphore-studios.com", true },
{ "semdynamics.com", true },
{ "semenov.su", true },
+ { "sementes.gratis", true },
{ "seminariruum.ee", true },
+ { "seminariruumid.ee", true },
{ "semiocast.com", true },
{ "semiread.com", true },
{ "semjonov.de", true },
@@ -33734,12 +35067,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "semyonov.su", true },
{ "semyonov.us", true },
{ "senarius.de", true },
+ { "send4x.com", true },
{ "sendai-sisters.com", true },
{ "sendaiouji.com", true },
{ "sendbox.cz", true },
{ "sendc.at", true },
{ "sendcat.com", true },
+ { "sendingbee.com", true },
{ "sendinvoice.nl", true },
+ { "sendmeback.de", false },
{ "sendonce.io", true },
{ "sendthisfile.com", true },
{ "sendtrix.nl", true },
@@ -33761,12 +35097,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sense.hamburg", true },
{ "sensebridge.com", true },
{ "sensebridge.net", true },
+ { "senseict.com.au", true },
{ "sensepixel.com", true },
{ "senshudo.tv", true },
+ { "sensoft-int.com", true },
{ "sensoft-int.org", true },
- { "sensound.ml", true },
- { "sensualism.com", true },
{ "sentandsecure.com", true },
+ { "sentencing.net", true },
{ "sentic.info", true },
{ "sentidosdelatierra.org", true },
{ "sentiments.io", true },
@@ -33786,23 +35123,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "seoagentur2go.de", true },
{ "seoankara.name.tr", true },
{ "seobutler.com", true },
- { "seocomposer.com", true },
{ "seodayo.com", true },
- { "seoexperte.berlin", true },
{ "seogeek.nl", true },
{ "seohackers.fr", true },
{ "seohouston.com", true },
{ "seoinc.com", true },
{ "seojames.com", true },
+ { "seolotsen.de", true },
{ "seomarketing.bg", true },
+ { "seomik.dk", true },
{ "seon.me", true },
{ "seoprovider.nl", true },
{ "seoquake.com", true },
+ { "seosec.xyz", true },
{ "seosof.com", true },
- { "seostepbysteplab.com", false },
+ { "seotools.asia", true },
{ "seoul.dating", true },
{ "seouniversity.org", true },
{ "seovision.se", true },
+ { "seowebexpert.co.uk", true },
+ { "seowordpress.pl", true },
{ "sepalandseed.com", true },
{ "seppelec.com", true },
{ "seproco.com", true },
@@ -33826,22 +35166,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sergefonville.nl", true },
{ "sergeyreznikov.com", true },
{ "sergije-stanic.me", true },
- { "sergiojimenezequestrian.com", true },
{ "sergiosantoro.it", true },
{ "sergiozygmunt.com", true },
- { "sergivb01.me", true },
+ { "sergivb01.me", false },
{ "sergos.de", true },
{ "serialexperiments.co.uk", true },
{ "serienstream.to", true },
{ "serigraphs.co.uk", true },
{ "serinamusic.com", true },
+ { "seriousaboutsecurity.com", true },
{ "seriousclimbing.com", true },
{ "seriouss.am", true },
{ "sernate.com", true },
{ "serotiuk.com", false },
{ "serpenteq.com", true },
{ "serrano-chris.ch", true },
- { "seru.eu", true },
{ "serve-a.com.au", true },
{ "servea.com.au", true },
{ "serveatechnologies.com", true },
@@ -33852,16 +35191,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "server-essentials.com", false },
{ "server-eye.com", true },
{ "server-eye.de", true },
- { "server92.tk", true },
+ { "server92.eu", true },
{ "serveradium.com", true },
{ "serveradminz.com", true },
{ "serverco.com", true },
{ "serverd.de", true },
{ "serverexpose.com", true },
{ "serverfrog.de", true },
- { "serverlog.net", true },
{ "serveroffline.net", false },
{ "serverpedia.de", true },
+ { "serverping.io", true },
{ "servers4all.co.uk", true },
{ "serversfrom.space", true },
{ "serversftw.com", true },
@@ -33869,14 +35208,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "serversuit.com", true },
{ "servertastic.com", true },
{ "servethecity-karlsruhe.de", true },
+ { "servetten-groothandel.nl", true },
{ "servettorna.com", true },
{ "servgate.jp", true },
{ "service.gov.uk", true },
{ "servicebeaute.fr", true },
{ "serviceboss.de", true },
{ "servicemembers.gov", true },
+ { "servicerequesthub.io", true },
{ "servida.ch", true },
+ { "servidoresadmin.com", true },
+ { "servietten-grosshandel.at", true },
+ { "servietten-grosshandel.be", true },
+ { "servietten-grosshandel.ch", true },
+ { "servietten-grosshandel.de", true },
{ "serviettenhaus.de", true },
+ { "serviettes-et-plus.com", true },
+ { "servilletas-de-papel.es", true },
+ { "servilletas-de-papel.mx", true },
{ "servingbaby.com", true },
{ "servious.org", true },
{ "servitek.de", true },
@@ -33884,6 +35233,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "servo.org", true },
{ "servx.org", true },
{ "serw.org", true },
+ { "serwetki-papierowe.pl", true },
{ "serwis-wroclaw.pl", true },
{ "serwusik.pl", true },
{ "seryox.com", true },
@@ -33896,10 +35246,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sestra.in", true },
{ "setasgourmet.es", true },
{ "setenforce.one", true },
- { "setfix.de", true },
{ "sethcaplan.com", true },
{ "sethjust.com", true },
{ "sethvargo.com", true },
+ { "setphaserstostun.org", true },
{ "setsailanddive.com", true },
{ "settberg.de", true },
{ "settimanadellascienza.it", true },
@@ -33924,25 +35274,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sewafineseam.com", true },
{ "sewinginsight.com", true },
{ "sewoo.co.uk", true },
- { "sex-education.com", true },
- { "sexaki.com", true },
+ { "sexar.info", true },
+ { "sexara.co", true },
{ "sexdocka.nu", true },
{ "sexflare.net", true },
- { "sexgarage.de", true },
{ "sexmobil.de", true },
- { "sexocomgravidas.com", true },
- { "sexoyrelax.com", true },
{ "sexplicit.co.uk", true },
{ "sexservice.io", true },
- { "sexwork.net", true },
+ { "sexshopnet.com.br", true },
+ { "sextfriend.com", true },
{ "sexy-store.nl", true },
- { "sexymassageoil.com", true },
- { "seydaozcan.com", true },
{ "seyfarth.de", true },
{ "seyr.me", true },
{ "sfa.sk", true },
{ "sfaparish.org", true },
- { "sfaturiit.ro", false },
{ "sfdev.ovh", true },
{ "sfg-net.com", true },
{ "sfg-net.eu", true },
@@ -33962,7 +35307,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sgi.org", true },
{ "sgitc.de", true },
{ "sglibellen.de", true },
- { "sgrmreproduccionapp.azurewebsites.net", true },
+ { "sgroup-hitoduma.com", true },
+ { "sgroup-rec.com", true },
{ "sgs-systems.de", true },
{ "sgs.camera", true },
{ "sgs.systems", true },
@@ -33972,7 +35318,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sgutranscripts.org", true },
{ "sh-heppelmann.de", true },
{ "sh-network.de", true },
- { "sh0rt.zone", true },
{ "sh0shin.org", true },
{ "shaadithailand.com", true },
{ "shabiwangyou.com", true },
@@ -33999,6 +35344,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shadynook.net", true },
{ "shafou.com", true },
{ "shafou.net", true },
+ { "shahar.cc", true },
{ "shaharyaranjum.com", true },
{ "shaicoleman.com", true },
{ "shainessim.com", true },
@@ -34028,10 +35374,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shansing.net", true },
{ "shansing.space", true },
{ "shaobin.wang", true },
+ { "shapediver.com", true },
{ "sharanyamunsi.net", true },
- { "share.works", true },
{ "sharealo.org", true },
{ "sharedhost.de", true },
+ { "shareeri.xyz", true },
+ { "sharefox.eu", true },
+ { "sharefox.nl", true },
{ "sharejoy.cn", false },
{ "sharekey.com", false },
{ "sharelovenotsecrets.com", true },
@@ -34040,6 +35389,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sharescope.co.uk", false },
{ "shareselecttools.com", true },
{ "sharevari.com", true },
+ { "shareworks.com", true },
+ { "sharezen.de", true },
{ "sharing-kyoto.com", true },
{ "sharisharpe.com", true },
{ "shark.cat", true },
@@ -34054,22 +35405,25 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shaunandamyswedding.com", true },
{ "shaunc.com", true },
{ "shaundanielz.com", true },
- { "shaunharker.com", true },
{ "shav.it", true },
{ "shavegazette.com", true },
+ { "shavit.space", true },
{ "shawnalucey.com", true },
{ "shawnhogan.com", true },
{ "shawnow.com", true },
{ "shawnwilkerson.com", true },
{ "shazzlemd.com", true },
{ "shazzlepro.com", true },
+ { "shdsub.xyz", true },
{ "sheaf.site", true },
{ "shearcomfort.com", true },
{ "sheaspire.com.tw", true },
{ "shee.org", true },
{ "sheehyinfinitioftysonsparts.com", true },
{ "sheekmedia.com", true },
+ { "sheenveininstitutestl.com", true },
{ "sheepfriends.com", true },
+ { "sheerchain.com", true },
{ "sheet.host", true },
{ "shehaal.com", true },
{ "shehata.com", true },
@@ -34085,7 +35439,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shellshock.eu", true },
{ "shellvatore.us", true },
{ "shemissed.me", true },
- { "shemsconseils.ma", true },
{ "shengbao.org", true },
{ "shenghaiautoparts.com", true },
{ "shenghaiautoparts.net", true },
@@ -34104,7 +35457,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shichibukai.net", true },
{ "shico.org", true },
{ "shielder.it", true },
- { "shieldfe.com", true },
{ "shift-record.com", true },
{ "shift-to.co.jp", true },
{ "shiftdevices.com", true },
@@ -34130,11 +35482,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shinsyo.com", true },
{ "shintoism.com", true },
{ "shinuytodaati.co.il", true },
+ { "shiny.gift", true },
{ "shinyuu.net", true },
{ "shipard.com", true },
{ "shipard.cz", true },
{ "shipcloud.io", true },
{ "shippercenter.info", true },
+ { "shippinglabel.de", true },
{ "shiqi.ca", true },
{ "shiqi.lol", true },
{ "shiqi.one", true },
@@ -34151,7 +35505,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shishlik.net", true },
{ "shitagi-shop.com", true },
{ "shitbeast.institute", true },
- { "shitmybradsays.com", true },
+ { "shitmybradsays.com", false },
{ "shitposts.se", true },
{ "shitproductions.org", true },
{ "shitsta.in", true },
@@ -34167,7 +35521,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shoeracks.uk", true },
{ "shoestringeventing.co.uk", true },
{ "shokola.com", true },
- { "shome.de", true },
{ "shooter.dog", true },
{ "shootingstarmedium.com", true },
{ "shop-hellsheadbangers.com", true },
@@ -34188,10 +35541,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shopapi.cz", true },
{ "shopatkei.com", true },
{ "shopbakersnook.com", true },
+ { "shopcord.co.uk", true },
{ "shopcoupon.co.za", true },
{ "shopcoupons.co.id", true },
+ { "shopcoupons.my", true },
{ "shopcoupons.ph", true },
{ "shopcoupons.sg", true },
+ { "shopdongho.com", true },
+ { "shopfinale.com", true },
{ "shopific.co", true },
{ "shopific.com", true },
{ "shopify.com", true },
@@ -34199,6 +35556,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shopkini.com", true },
{ "shoplandia.co", true },
{ "shopperexperts.com", true },
+ { "shopperexpertss.com", true },
{ "shopping24.de", true },
{ "shoppr.dk", true },
{ "shopregional.com.br", true },
@@ -34215,13 +35573,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shorten.ninja", true },
{ "shoshin-aikido.de", true },
{ "shoshin.technology", true },
+ { "shota.vip", true },
{ "shotbow.net", true },
+ { "shotly.net", true },
{ "shotonwhat.com", true },
{ "shouldihookupwithmybarista.com", true },
{ "shouttag.com", true },
{ "shovonhasan.com", true },
{ "showbits.net", true },
{ "showersnet.com", true },
+ { "showf.om", true },
{ "showfom.sb", true },
{ "showmax.com", true },
{ "showmethemoney.ru", true },
@@ -34235,6 +35596,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shrimpcam.pw", true },
{ "shrinidhiclinic.in", true },
{ "shrinkhub.com", true },
+ { "shrt.tv", true },
{ "shrub.ca", true },
{ "shrug.ml", true },
{ "shtaketniki.kz", true },
@@ -34256,16 +35618,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "shuvodeep.de", true },
{ "shux.pro", true },
{ "shwrm.ch", true },
+ { "shybynature.com", true },
{ "shyuka.me", true },
{ "si-benelux.nl", true },
{ "si.to", true },
{ "si2b.fr", true },
{ "siaggiusta.com", true },
{ "siamdevsqua.re", true },
- { "siamdevsquare.com", true },
{ "siamsnus.com", true },
{ "sianbryn.co.uk", true },
- { "sianjhon.com", true },
{ "siava.ru", true },
{ "siberas.de", true },
{ "siberkulupler.com", true },
@@ -34277,6 +35638,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "siciliamconsulting.com", true },
{ "sicilianbalm.com", true },
{ "siciliapulizie.it", true },
+ { "sicilyalacarte.com", true },
{ "sicken.eu", true },
{ "sicurezzalavoro24.com", true },
{ "sicurled.com", false },
@@ -34299,6 +35661,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sientemendoza.com.ar", true },
{ "sierpinska.co", true },
{ "sierpinska.eu", true },
+ { "sietejefes.com.ar", true },
{ "siewert-kau.de", true },
{ "sift-tool.org", true },
{ "sig6.org", true },
@@ -34309,9 +35672,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sighup.nz", true },
{ "sigismonda.ch", true },
{ "sigma-signalisation.com", true },
+ { "sigma957.net", true },
{ "sigmalux.ltd", true },
{ "sigmalux.sarl", true },
{ "sigmapramuka.com", true },
+ { "sigmaweb.co.uk", true },
{ "sign.io", true },
{ "signage.red", true },
{ "signal.org", true },
@@ -34346,6 +35711,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "silerfamily.net", true },
{ "silica-project.com", true },
{ "silica-project.jp", true },
+ { "silicanetworks.com", true },
{ "silicon-north.com", true },
{ "silicon-vision.com", true },
{ "siliconchip.me", true },
@@ -34373,7 +35739,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "silvergoldbull.co.ao", true },
{ "silvergoldbull.co.il", true },
{ "silvergoldbull.co.no", true },
- { "silvergoldbull.co.tz", true },
{ "silvergoldbull.co.uk", true },
{ "silvergoldbull.com", true },
{ "silvergoldbull.com.ar", true },
@@ -34396,7 +35761,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "silvergoldbull.gt", true },
{ "silvergoldbull.hk", true },
{ "silvergoldbull.hn", true },
- { "silvergoldbull.hr", true },
{ "silvergoldbull.hu", true },
{ "silvergoldbull.id", true },
{ "silvergoldbull.in", true },
@@ -34404,11 +35768,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "silvergoldbull.it", true },
{ "silvergoldbull.kr", true },
{ "silvergoldbull.li", true },
- { "silvergoldbull.lk", true },
{ "silvergoldbull.lt", true },
{ "silvergoldbull.lv", true },
{ "silvergoldbull.ma", true },
- { "silvergoldbull.mk", true },
{ "silvergoldbull.mw", true },
{ "silvergoldbull.my", true },
{ "silvergoldbull.nz", true },
@@ -34432,9 +35794,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "silverkingalaska.com", true },
{ "silverlinkz.net", true },
{ "silverseen.com", true },
+ { "silvershadow.cc", true },
{ "silverswanrecruitment.com", true },
{ "silverwind.io", true },
{ "silvesrom.ro", true },
+ { "silvester-mitterschida.de", true },
{ "silvine.xyz", true },
{ "silvobeat.blog", true },
{ "silvobeat.com", true },
@@ -34455,7 +35819,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "simivalleylighting.com", true },
{ "simivalleyoutdoorlighting.com", true },
{ "simkova-reality.cz", true },
- { "simlau.net", true },
{ "simmis.fr", true },
{ "simoesgoulart.com.br", true },
{ "simon-agozzino.fr", true },
@@ -34473,7 +35836,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "simonlyabonnement.nl", true },
{ "simonmaddox.com", true },
{ "simonpaarlberg.com", true },
+ { "simonpayne.cz", true },
{ "simonreich.de", true },
+ { "simonshine.dk", true },
{ "simonspeich.ch", true },
{ "simonsreich.de", true },
{ "simontaite.com", true },
@@ -34485,11 +35850,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "simphony.cz", true },
{ "simpip.com", true },
{ "simple.com", false },
+ { "simplecmsdemo.com", true },
{ "simplecoding.click", true },
{ "simplecontacts.com", true },
{ "simplecrypt.io", true },
{ "simplednscrypt.org", true },
{ "simplefraud.com", true },
+ { "simplegoodhealth.com", true },
{ "simpleindianrecipes.com", true },
{ "simpleinout.com", true },
{ "simpleinvoices.io", true },
@@ -34515,9 +35882,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "simplystudio.com", true },
{ "simplytiles.com", true },
{ "simpte.com", true },
+ { "simpul.nl", true },
{ "simrail.nl", true },
{ "simsnieuws.nl", true },
{ "simukti.net", true },
+ { "simulping.com", true },
{ "sin-nombre-alleria.de", true },
{ "sin.swiss", true },
{ "sinaryuda.web.id", true },
@@ -34533,7 +35902,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "singel.ch", true },
{ "single-in-stuttgart.de", true },
{ "singles-aus-hamburg.de", true },
- { "singles-berlin.de", true },
{ "singleuse.link", true },
{ "singlu10.org", false },
{ "sinktank.de", true },
@@ -34544,6 +35912,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sinonimosonline.com.br", true },
{ "sinquin.eu", true },
{ "sinronet.com", true },
+ { "sinsastudio.com", true },
{ "sint-joris.nl", true },
{ "sintaxis.org", true },
{ "sinterama.biz", true },
@@ -34551,7 +35920,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sinusitis-bronchitis.ch", true },
{ "sioeckes.hu", true },
{ "sion.info", true },
- { "sipstix.co.za", true },
{ "siratalmustaqim.com", true },
{ "siraweb.org", true },
{ "sirbouncealotcastles.co.uk", true },
@@ -34561,12 +35929,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sirena.co.jp", true },
{ "sirencallofficial.com", true },
{ "sirenslove.com", true },
+ { "sirihouse.com", true },
{ "siriuspup.com", true },
{ "sirtaptap.com", true },
{ "sirtuins.com", true },
{ "sirvoy.com", true },
+ { "siseministeerium.ee", true },
{ "sisiengineers.gq", true },
- { "sisseastumine.ee", true },
{ "sistel.es", true },
{ "sistem-maklumat.com", true },
{ "sistem-maklumat.com.my", true },
@@ -34575,10 +35944,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sistov.it", true },
{ "sisv.eu", true },
{ "sisver.host", true },
+ { "sisver.mx", true },
{ "sit-brn.ru", true },
{ "sit.ec", true },
{ "sitc.sk", true },
{ "site-helper.com", true },
+ { "site.pictures", true },
{ "sitebuilderreport.com", true },
{ "sitedrive.fi", true },
{ "sitefactory.com.br", true },
@@ -34590,18 +35961,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sitevandaag.nl", true },
{ "sitischu.com", true },
{ "sitiweb.nl", true },
+ { "sitz.ch", true },
{ "sivale.mx", true },
{ "sivyerge.com", true },
{ "siw64.com", true },
{ "six-o-one.com", true },
+ { "sixnines.net", true },
{ "sixpackholubice.cz", true },
- { "sixtwentyten.com", true },
+ { "sizzle.co.uk", true },
{ "sj-leisure.com", true },
{ "sjaakgilsingfashion.nl", true },
+ { "sjatsh.com", true },
{ "sjbwoodstock.org", true },
- { "sjd.is", true },
+ { "sjd.is", false },
{ "sjdaws.com", true },
+ { "sjis.me", true },
{ "sjleisure.co.uk", true },
+ { "sjnp.org", true },
{ "sjoorm.com", true },
{ "sk-net.cz", true },
{ "skala.io", true },
@@ -34628,21 +36004,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "skhoop.cz", true },
{ "skia.org", false },
{ "skiblandford.com", true },
+ { "skid-berlin.de", true },
{ "skid.church", true },
{ "skiddle.com", true },
{ "skifairview.com", true },
{ "skifttiljutlanderbank.dk", true },
- { "skigebied.nl", true },
{ "skigebiete-test.de", true },
{ "skill.moe", true },
{ "skilletfood.com", true },
{ "skillled.com", true },
{ "skillmoe.at", true },
- { "skillout.org", true },
{ "skills2serve.org", true },
{ "skills2services.com", true },
{ "skillseo.com", true },
+ { "skillside.net", true },
{ "skin-cosmetic.eu", true },
+ { "skinandglamour.com", true },
{ "skincare-note.com", true },
{ "skincases.co", true },
{ "skincontracts.co", true },
@@ -34652,18 +36029,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "skinmodo.com", true },
{ "skinpwrd.com", true },
{ "skins.net", true },
+ { "skinwhiteningoptions.com", true },
{ "skipfault.com", true },
{ "skippy.dog", true },
{ "skischule-wildewiese.de", true },
{ "skizzen-zeichnungen.de", true },
{ "skk.moe", true },
{ "skks.cz", true },
+ { "sklep-majster.pl", true },
{ "sklepsamsung.pl", true },
{ "sklepwielobranzowymd.com", true },
{ "sklotechnik.cz", true },
{ "sknclinics.co.uk", true },
{ "skogsbruket.fi", true },
{ "skogskultur.fi", true },
+ { "skoilly.cn", true },
{ "skol.bzh", true },
{ "skolagatt.is", true },
{ "skolakrizik.cz", true },
@@ -34673,7 +36053,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "skontakt.cz", true },
{ "skontorp-enterprise.no", true },
{ "skoolergraph.azurewebsites.net", true },
- { "skorepova.info", true },
+ { "skorpil.cz", true },
{ "skortekaas.nl", false },
{ "skory.us", true },
{ "skou.dk", false },
@@ -34685,13 +36065,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "skulblaka.ch", true },
{ "skuldwyrm.no", true },
{ "skutry-levne.cz", true },
- { "skutry.cz", true },
{ "skwile-cafe.com", true },
{ "skwitko.com", true },
{ "sky-coach.com", true },
{ "sky-coach.nl", true },
- { "sky-live.fr", true },
- { "skyanchor.com", true },
+ { "sky-live.fr", false },
+ { "skyautorental.com", true },
+ { "skybloom.com", false },
{ "skycmd.net", true },
{ "skyderby.ru", true },
{ "skydragoness.com", true },
@@ -34700,6 +36080,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "skyem.co.uk", true },
{ "skyfone.cz", true },
{ "skyger.cz", true },
+ { "skyingo.net", true },
{ "skylgenet.nl", true },
{ "skylightcreative.com.au", true },
{ "skylinertech.com", true },
@@ -34721,6 +36102,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "skyzimba.com.br", true },
{ "sl-bildermacher.de", true },
{ "sl-informatique.ovh", true },
+ { "sl0.us", true },
{ "sl899.com", true },
{ "sl998.com", true },
{ "slab.com", false },
@@ -34733,11 +36115,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "slane.cn", false },
{ "slangbellor.com", true },
{ "slanterns.net", true },
+ { "slapen17.nl", true },
{ "slash32.co.uk", true },
{ "slashcrypto.org", true },
{ "slate.to", true },
{ "slatop.org", false },
- { "slaughter.com", true },
{ "slaughterhouse.fr", true },
{ "slavasveta.info", true },
{ "slaws.io", true },
@@ -34765,6 +36147,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "slink.hr", true },
{ "slip-gaming.tk", true },
{ "slneighbors.org", true },
+ { "slo-net.net", true },
{ "slo-tech.com", true },
{ "sloancom.com", true },
{ "slonep.net", true },
@@ -34777,14 +36160,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "slotlist.info", true },
{ "slow.zone", true },
{ "slowb.ro", true },
+ { "slowcookingperfected.com", true },
{ "slowgames.xyz", true },
{ "slpower.com", true },
{ "slrd-isperih.com", true },
{ "slt24.de", true },
{ "sluciaconstruccion.com", true },
+ { "sluhockey.com", true },
{ "sluimann.de", false },
{ "slunecnice.cz", true },
+ { "sluo.org", true },
{ "slusham.com", true },
+ { "slushpool.com", true },
{ "slvh.fr", true },
{ "slwilde.ca", true },
{ "slxh.eu", true },
@@ -34794,22 +36181,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sm.ms", true },
{ "sm2016.ch", true },
{ "sma-gift.com", true },
+ { "smaaker.com", true },
{ "smablo.com", true },
{ "smackhappy.com", true },
- { "smadav.ml", true },
{ "smakassen.no", true },
- { "smallcloudsolutions.co.za", true },
{ "smalldata.tech", true },
{ "smalldogbreeds.net", true },
{ "smalle-voet.de", true },
{ "smallhadroncollider.com", true },
- { "smallpath.me", true },
{ "smalltalkconsulting.com", true },
{ "smaltimento-rifiuti.org", true },
{ "smaltimento.caserta.it", true },
{ "smaltimento.milano.it", true },
{ "smaltimento.napoli.it", true },
{ "smaltimento.roma.it", true },
+ { "smaltimentoamianto.campania.it", true },
{ "smaltimentoamianto.frosinone.it", true },
{ "smaltimentoamianto.latina.it", true },
{ "smaltimentorifiuti.firenze.it", true },
@@ -34817,6 +36203,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smaltimentorifiuti.prato.it", true },
{ "smaltimentorifiuti.veneto.it", true },
{ "smares.de", true },
+ { "smarntrading.com", true },
{ "smart-cp.jp", true },
{ "smart-informatics.com", true },
{ "smart-media-gmbh.de", true },
@@ -34834,9 +36221,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smartedg.io", true },
{ "smartfit.cz", true },
{ "smartftp.com", true },
+ { "smartgridsecurity.com", true },
+ { "smartgridsecurity.org", true },
{ "smarthdd.com", true },
{ "smarthinking.nl", true },
{ "smarthouse.de", true },
+ { "smartime.com.ar", true },
{ "smartjoin.style", true },
{ "smartlocksmith.com", true },
{ "smartlogreturns.com", true },
@@ -34845,8 +36235,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smartmarketingcoaching.com", true },
{ "smartmeal.ru", true },
{ "smartmessages.net", true },
+ { "smartminibushire.co.uk", true },
{ "smartmomsmartideas.com", true },
{ "smartpass.government.ae", true },
+ { "smartphone-pliable.wtf", true },
{ "smartphonechecker.co.uk", true },
{ "smartphones-baratos.com", true },
{ "smartpolicingplatform.com", true },
@@ -34859,7 +36251,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smartsparrow.com", true },
{ "smartthursday.hu", true },
{ "smartvideo.io", true },
- { "smartviewing.com", true },
{ "smartwank.com", true },
{ "smartweb.ge", true },
{ "smartwoodczech.cz", true },
@@ -34886,18 +36277,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smipty.com", true },
{ "smit.com.ua", true },
{ "smit.ee", true },
- { "smith.co", true },
+ { "smith.co", false },
{ "smithandcanova.co.uk", false },
{ "smithchow.com", true },
{ "smithchung.eu", true },
- { "smithfieldbaptist.org", true },
+ { "smithfieldbaptist.org", false },
{ "smkw.com", false },
{ "smm.im", true },
{ "smokeandmirrors.agency", true },
{ "smokefree.gov", true },
{ "smokefreerowan.org", true },
{ "smokeus.dk", true },
- { "smokinghunks.com", true },
+ { "smokingblendoils.com", true },
{ "smol.cat", true },
{ "smoo.st", true },
{ "smoothcomp.com", true },
@@ -34911,7 +36302,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smorgasblog.ie", true },
{ "smow.com", true },
{ "smow.de", true },
- { "smplr.uk", true },
{ "sms.storage", true },
{ "smsappointment.com", true },
{ "smsben.net", true },
@@ -34920,7 +36310,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "smsinger.com", true },
{ "smsk.email", true },
{ "smsk.io", true },
- { "smskeywords.co.uk", true },
{ "smskmail.com", true },
{ "smsprivacy.org", true },
{ "smspujcka24.eu", true },
@@ -34947,12 +36336,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "snaptools.io", true },
{ "snargol.com", true },
{ "snatch.com.ua", true },
- { "snazel.co.uk", false },
{ "snazzie.nl", true },
{ "sncdn.com", true },
{ "sndbouncycastles.co.uk", true },
{ "sneak.berlin", true },
{ "sneakpod.de", true },
+ { "sneakycode.net", true },
{ "sneakynote.com", true },
{ "sneakypaw.com", true },
{ "sneberger.cz", false },
@@ -34970,6 +36359,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "snfdata.com", false },
{ "sngallery.co.uk", true },
{ "sngeo.com", true },
+ { "snh48live.org", true },
{ "sniderman.eu.org", true },
{ "sniderman.org", true },
{ "sniderman.us", true },
@@ -35011,6 +36401,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sntravel.co.uk", true },
{ "snuff.porn", true },
{ "snughealth.org.uk", true },
+ { "snus123.com", true },
+ { "snwsjz.com", true },
{ "sny.no", true },
{ "so-comm.fr", true },
{ "so.is-a-cpa.com", true },
@@ -35023,27 +36415,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sobersys.com", true },
{ "sobie.ch", true },
{ "sobieray.dyndns.org", true },
+ { "soblaznenie.ru", true },
+ { "soblaznenie2.ru", true },
{ "sobotkama.eu", true },
{ "sobreporcentagem.com", true },
- { "soc.net", true },
- { "socal-babes.com", true },
{ "soccorso-stradale.org", true },
{ "sochi-sochno.ru", true },
+ { "sochic.in", true },
{ "sociability.dk", true },
{ "social-events.net", false },
{ "social-media-strategies.it", true },
{ "social-work-colleges.com", true },
{ "socialhams.net", true },
- { "socializam.com", true },
{ "socialmarketingday.nl", true },
+ { "socialmedia-manager.gr", true },
{ "socialmedia.ro", true },
{ "socialnitro.com", true },
{ "socialnous.co", true },
{ "socialrank.com", true },
{ "socialsecurity.gov", false },
- { "socialstrata.com", true },
{ "socialtrends.pl", true },
{ "socialweblearning.com", true },
+ { "socialz.nl", true },
{ "societe-chablaisienne-de-revetements.com", true },
{ "societe-chablaisienne-de-revetements.fr", true },
{ "societyhilldance.com", true },
@@ -35053,6 +36446,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sociopathy.org", true },
{ "sockeye.io", true },
{ "sockscap64.com", true },
+ { "socoastal.com", true },
{ "sodadigital.com.au", true },
{ "sodafilm.de", true },
{ "sodexam.pro", true },
@@ -35074,6 +36468,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "softart.club", true },
{ "softballrampage.com", true },
{ "softblinds.co.uk", true },
+ { "softcreatr.com", true },
{ "softcreatr.de", false },
{ "softfay.com", true },
{ "softonic.com", true },
@@ -35086,6 +36481,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "softsecmatheodexelle.be", true },
{ "softtennis-zenei.com", true },
{ "softw.net", true },
+ { "software-search.com", true },
{ "softwarebetrieb.de", true },
{ "softwarebeveiligingtestdomein.be", true },
{ "softwaredesign.foundation", false },
@@ -35096,6 +36492,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sogola.com", true },
{ "sogravatas.com.br", true },
{ "sogutma.com.tr", true },
+ { "sohamroy.me", true },
{ "soia.ca", true },
{ "soinvett.com", true },
{ "sokaissues.info", true },
@@ -35105,7 +36502,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sokolkarvina.cz", true },
{ "sokouchousa.net", true },
{ "sol-computers.es", true },
- { "sol.works", true },
{ "sol24.net", true },
{ "solacyre.ch", true },
{ "solanum-games.com", true },
@@ -35115,6 +36511,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "solariilacheie.ro", true },
{ "solarplan-berlin.de", true },
{ "solarstrom.net", true },
+ { "soldecom.com", true },
{ "solden.be", true },
{ "soldesduck.be", true },
{ "soldesduck.ch", true },
@@ -35123,6 +36520,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sole-software.de", true },
{ "sole.gmbh", true },
{ "soledadpenades.com", true },
+ { "solemare-hotel.it", true },
{ "solentbasketball.co.uk", true },
{ "solentbubblesandbounce.co.uk", true },
{ "solepurposetest.com", true },
@@ -35174,6 +36572,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "somweyr.de", true },
{ "sona-gaming.com", true },
{ "sonacupalova.cz", true },
+ { "sonaraamat.com", true },
{ "sonarqube.com", false },
{ "sonavankova.cz", true },
{ "sondergaard.de", true },
@@ -35185,7 +36584,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "songsmp3.io", true },
{ "songsmp3.live", true },
{ "songsmp3.me", true },
- { "songsmp3.net", true },
{ "songsthatsavedyourlife.com", true },
{ "songtianyi.com", true },
{ "songzhuolun.com", true },
@@ -35204,7 +36602,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sooscreekdental.com", true },
{ "soph.jp", true },
{ "soph.us", true },
- { "sopher.io", true },
{ "sophiaandmatt.co.uk", true },
{ "sophiakligys.com", true },
{ "sophieandtrey.com", true },
@@ -35219,6 +36616,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sorellecollection.com.au", true },
{ "soren.xyz", true },
{ "sorenstudios.com", true },
+ { "sorincocorada.ro", true },
{ "sorrowfulunfounded.com", true },
{ "sortesim.com.br", true },
{ "soruly.com", true },
@@ -35237,6 +36635,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sotadb.info", true },
{ "sotai.tk", true },
{ "sotar.us", true },
+ { "sotayhoctap.com", true },
{ "sotoasobi.net", true },
{ "sotthewes.nl", true },
{ "sou-co.jp", true },
@@ -35252,7 +36651,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "soulmate.dating", true },
{ "soulmating.de", true },
{ "soulogic.com", true },
- { "soulsteer.com", false },
{ "souly.cc", true },
{ "soumikghosh.com", true },
{ "soumya92.me", true },
@@ -35260,7 +36658,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "soundbytemedia.com", true },
{ "soundeo.com", true },
{ "soundeo.net", true },
- { "soundgasm.net", true },
{ "soundhunter.xyz", false },
{ "soundonsound.com", true },
{ "soundprotectionllc.com", true },
@@ -35296,15 +36693,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "southside-tuning-day.de", true },
{ "southsidebargaincenter.com", true },
{ "southwaymotors.com", true },
+ { "southwesteventhire.co.uk", true },
{ "southwestrda.org.uk", true },
{ "souyidai.com", true },
{ "sovendus.com", true },
{ "sovendus.de", true },
+ { "sovereignpcs.com", true },
{ "sowlutions.com", true },
{ "soybase.org", true },
{ "soydemac.com", true },
- { "soz6.com", true },
{ "sozai-good.com", true },
+ { "sozialstation-ritterhude.de", true },
{ "sozialy.com", true },
{ "sozon.ca", true },
{ "sp-sites.com.au", true },
@@ -35319,6 +36718,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spacehighway.ms", true },
{ "spacehost.de", true },
{ "spacestation13.com", true },
+ { "spaceunique.de", true },
{ "spacinov.com", true },
{ "spacivox.com", true },
{ "spackova.cz", true },
@@ -35328,7 +36728,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spakhmer.com", true },
{ "spakurort.eu", true },
{ "spaldingwall.com", true },
+ { "spalnobelyo.com", true },
{ "spamdrain.com", true },
+ { "spanch.cf", true },
{ "spanda.io", true },
{ "spanjeflydrive.nl", true },
{ "spanner.works", true },
@@ -35338,6 +36740,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sparendirekt.at", true },
{ "sparkasse.de", true },
{ "sparkforautism.org", true },
+ { "sparklatvia.lv", true },
{ "sparklebastard.com", true },
{ "sparkz.no", true },
{ "sparprofi.at", true },
@@ -35345,6 +36748,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spartaconsulting.fi", true },
{ "spartacuslife.com", true },
{ "spartaermelo.nl", true },
+ { "sparumzuege.de", true },
{ "sparxsolutions.be", true },
{ "spasicilia.it", true },
{ "spatzenwerkstatt.de", true },
@@ -35360,7 +36764,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "speak-polish.com", true },
{ "speakingdiligence.com", true },
{ "spearfishingmx.com", true },
- { "speargames.net", true },
+ { "speargames.net", false },
{ "specdrones.us", true },
{ "specialized-hosting.eu", true },
{ "specialproperties.com", true },
@@ -35374,13 +36778,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "speechmore.ml", true },
{ "speechndraw.com", true },
{ "speeddate.it", false },
+ { "speeder.im", true },
{ "speedof.me", true },
{ "speedracer.ca", true },
{ "speedsportofhull.co.uk", true },
{ "speedtailors.com", true },
{ "speedtest-russia.com", true },
{ "speedwaybusinesspark.com", true },
- { "speedychat.it", true },
{ "speeltoneel.nl", true },
{ "speerpunt.info", true },
{ "speets.ca", true },
@@ -35397,11 +36801,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spero.solutions", true },
{ "sperrstun.de", true },
{ "spesys-services.fr", true },
- { "spha.info", true },
+ { "spewingmews.moe", true },
{ "sphere-realty.com", true },
- { "sphereblur.com", true },
{ "spherenix.org", true },
- { "sphido.org", true },
+ { "sphido.org", false },
{ "spicejungle.com", true },
{ "spicydog.org", true },
{ "spicymatch.com", true },
@@ -35409,6 +36812,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spidernet.tk", true },
{ "spideroak.com", true },
{ "spiders.org.ua", true },
+ { "spiegel21.de", true },
{ "spielezar.ch", true },
{ "spielland.ch", true },
{ "spiellawine.de", true },
@@ -35441,7 +36845,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spittank.info", true },
{ "spittersberger.recipes", true },
{ "splarty.net", true },
- { "splendidspoon.com", true },
{ "splendorservizi.it", true },
{ "splikity.com", true },
{ "splintermail.com", true },
@@ -35455,7 +36858,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spokaneexteriors.com", true },
{ "spokanepolebuildings.com", true },
{ "spoluck.ca", true },
- { "spolwind.de", true },
{ "spom.net", true },
{ "sponc.de", true },
{ "spongepowered.org", true },
@@ -35468,6 +36870,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spoorcam.nl", true },
{ "sporcard.com", true },
{ "spornkuller.de", true },
+ { "sport-decouverte.com", true },
{ "sport-in-sundern.de", true },
{ "sport-potreby.cz", true },
{ "sport-potreby.sk", true },
@@ -35476,6 +36879,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sportakrobatik.at", true },
{ "sportbetuwe.nl", true },
{ "sporter.com", true },
+ { "sportmundschutz-info.de", true },
{ "sportnesia.com", true },
{ "sportovnidum.cz", true },
{ "sportparks.com", true },
@@ -35493,10 +36897,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sportwetten-anbieter.de", true },
{ "sportxt.ru", true },
{ "spot-lumiere-led.com", true },
+ { "spotfake.news", true },
{ "spotrebitelskecentrum.sk", true },
{ "spotswoodvet.com", true },
{ "spottedpenguin.co.uk", true },
+ { "spotterpix.de", true },
{ "spotupload.com", true },
+ { "spotypal.com", true },
{ "sppin.fr", true },
{ "sprachfreudehoch3.de", true },
{ "sprax2013.de", true },
@@ -35510,6 +36917,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "springerundpartner.de", true },
{ "springfieldbricks.com", true },
{ "springhillmaine.com", true },
+ { "springtxcarpetcleaning.com", true },
{ "sprinklermanohio.com", true },
{ "spritmonitor.de", true },
{ "spritsail.io", true },
@@ -35525,17 +36933,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "spt.re", true },
{ "sptk.org", true },
{ "sptr.blog", true },
+ { "spuffin.com", true },
{ "spufpowered.com", true },
{ "spunkt.fr", true },
{ "spur.com.br", true },
- { "sputnik1net.org", true },
{ "spydar007.com", true },
{ "spydar007.net", true },
{ "spydersec.com", true },
{ "spyprofit.ru", true },
+ { "spyroszarzonis.com", true },
+ { "sqills.com", true },
{ "sql-und-xml.de", true },
+ { "sql.bi", true },
{ "sqlapius.net", true },
+ { "sqlbi.com", true },
{ "sqlfeatures.com", true },
+ { "sqprod.co", true },
{ "sqr-training.com", true },
{ "sqroot.eu", true },
{ "sqsd.xyz", true },
@@ -35544,7 +36957,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "square.com", false },
{ "squareup.com", false },
{ "squawk.cc", true },
- { "squeakql.online", true },
{ "squeezemetrics.com", true },
{ "squido.ch", true },
{ "squidparty.com", true },
@@ -35565,6 +36977,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "srolim.com", true },
{ "srrdb.com", true },
{ "srroddy.com", true },
+ { "srun.in", true },
{ "srv.so", true },
{ "srv.solutions", true },
{ "srvc.io", true },
@@ -35577,15 +36990,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ss64.org", true },
{ "ss88.uk", true },
{ "ssa.gov", false },
+ { "ssab.gov", true },
{ "ssbgportal.net", true },
{ "ssbkk.ru", true },
{ "ssbrm.ch", true },
{ "sscd.no", true },
{ "ssdax.com", true },
- { "ssdservers.co.uk", true },
{ "ssenberg.nl", true },
{ "ssh-keys.online", true },
{ "ssh-vault.com", true },
+ { "sshx.top", true },
{ "ssky.cn", true },
{ "ssl-zertifikate.de", true },
{ "ssl.do", true },
@@ -35600,7 +37014,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ssl888.com", true },
{ "sslbrain.com", true },
{ "sslcertificaten.nl", true },
- { "sslcertificateshop.com", true },
{ "sslcheck.nl", true },
{ "ssldecoder.org", true },
{ "ssldev.net", true },
@@ -35619,8 +37032,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ssrfq.com", true },
{ "sssppp.gq", true },
{ "sstaging.com", true },
+ { "sstewartgallus.com", true },
{ "ssuc.net", true },
{ "ssuiteoffice.com", true },
+ { "ssuitesoft.com", true },
{ "st-antonius-kuenzell.de", true },
{ "st-bede.org", true },
{ "st-innovationcup.com", true },
@@ -35628,6 +37043,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "st-news.de", true },
{ "st-shakyo.jp", true },
{ "st-steuern.de", true },
+ { "st-tir-pln.fr", true },
{ "staatschutz.at", true },
{ "staatsschutz.at", true },
{ "staatsschutzgesetz.at", true },
@@ -35656,16 +37072,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stageirites.com", true },
{ "stageirites.fr", true },
{ "stageirites.org", true },
- { "stahlfors.com", true },
+ { "stahlfeuer-ofenwerkstatt.de", true },
{ "stainedglass.net.au", true },
{ "stainternational.com", true },
- { "stair.ch", true },
{ "stairfallgames.com", true },
{ "stairlin.com", true },
{ "staklim-malang.info", true },
{ "stako.jp", true },
{ "staktrace.com", true },
{ "stal-rulon.ru", true },
+ { "stalder.work", true },
{ "staljedevledder.nl", true },
{ "stalker-shop.com", true },
{ "stalkerteam.pl", true },
@@ -35673,13 +37089,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stameystreet.com", true },
{ "stamkassa.nl", true },
{ "stammtisch.domains", true },
- { "stamonicatourandtravel.com", true },
{ "stamparmakarije.me", true },
- { "stampederadon.com", true },
{ "stampsbar.co.uk", true },
{ "standagainstspying.org", true },
{ "standard.co.uk", true },
{ "standardequipment.com", true },
+ { "standards.gov", true },
{ "stannri.org", true },
{ "stanron.com", true },
{ "stantabler.com", true },
@@ -35688,15 +37103,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stanthonymaryclaret.org", true },
{ "staparishgm.org", true },
{ "star-clean.it", true },
+ { "star.garden", true },
{ "star.watch", true },
{ "starcoachservices.ca", true },
{ "starcomproj.com", true },
{ "stardanceacademy.net", true },
+ { "starease.com", true },
{ "starease.net", true },
{ "stareplanymiast.pl", true },
{ "starflix.uk", true },
{ "starfm.de", true },
+ { "starfriend.ru", true },
{ "stargarder-jungs.de", true },
+ { "stargate365.com", true },
{ "stargatelrp.co.uk", true },
{ "stargazer.de", true },
{ "starina.ru", true },
@@ -35805,6 +37224,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stefanvanburen.xyz", true },
{ "stefanvd.net", true },
{ "stefany.eu", true },
+ { "steffenmeister.com", true },
{ "steffentreeservice.com", true },
{ "stefpastoor.nl", true },
{ "stegmaier-immobilien.de", true },
@@ -35890,16 +37310,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "steventress.com", true },
{ "steventruesdell.com", true },
{ "stevenwooding.com", true },
- { "stevenz.net", true },
{ "stevenz.science", true },
- { "stevenz.xyz", true },
{ "stevesdrivingschooltyneside.com", true },
+ { "stevezheng.cf", true },
+ { "stevezheng.tk", true },
{ "stewartswines.com", true },
{ "stewpolley.com", false },
{ "steyaert.be", false },
{ "stforex.com", false },
{ "stfrancisnaugatuck.org", true },
{ "stfw.info", true },
+ { "stgabrielavondalepa.org", true },
{ "stgabrielstowepa.org", true },
{ "stgeorgecomfortinn.com", true },
{ "stgeorgegolfing.com", true },
@@ -35914,10 +37335,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stickandpoketattookit.com", true },
{ "stickeramoi.com", true },
{ "stickergiant.com", true },
+ { "stickerparadise.me", true },
{ "stickertuningfetzt.de", true },
{ "stickies.io", true },
{ "stickmanventures.com", true },
{ "stickstueb.de", true },
+ { "stiebel.co.nz", true },
+ { "stiebel.com.au", true },
+ { "stiebelmedia.co.nz", true },
+ { "stiebelmedia.com.au", true },
+ { "stiebelservice.com.au", true },
+ { "stiebelstore.com.au", true },
{ "stift-kremsmuenster.at", true },
{ "stiftemaskinen.no", true },
{ "stigharder.com", true },
@@ -35932,13 +37360,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stimmgabel.lu", true },
{ "stin.hr", true },
{ "stinaspiegelberg.com", true },
- { "stinsky.com", true },
{ "stintup.com", true },
{ "stipsan.me", true },
{ "stirblaut.de", true },
{ "stirling.co", true },
{ "stirlingpoon.com", true },
- { "stisaac.org", true },
{ "stisidores.org", true },
{ "stitchfiddle.com", true },
{ "stitchinprogress.com", true },
@@ -35955,6 +37381,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stjustin.org", true },
{ "stkevin-stbenedict.org", true },
{ "stln.ml", true },
+ { "stlouisinsuranceco.com", true },
{ "stlu.de", true },
{ "stlukenh.org", true },
{ "stlukesbrandon.org", true },
@@ -35975,6 +37402,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stneotsbouncycastlehire.co.uk", true },
{ "stnevis.ru", true },
{ "stockpile.com", true },
+ { "stockportpyramid.co.uk", true },
{ "stockrow.com", true },
{ "stockstuck.com", true },
{ "stocktout.info", true },
@@ -35982,8 +37410,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stocp.org", true },
{ "stodieck.com", true },
{ "stoebermehl.at", true },
+ { "stoerevrouwensporten.nl", true },
{ "stoffelnet.de", true },
- { "stogiesandmash.com", true },
{ "stokvistrading.nl", true },
{ "stolin.info", true },
{ "stolina.de", false },
@@ -35996,6 +37424,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stonechatjewellers.ie", true },
{ "stonedworms.de", true },
{ "stoneedgeconcrete.com", true },
+ { "stonegateapartmentsstl.com", true },
{ "stonehammerhead.org", true },
{ "stonehurstcap.com", true },
{ "stonewuu.com", true },
@@ -36019,6 +37448,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "storycollective.nl", true },
{ "storyland.ie", true },
{ "storysift.news", true },
+ { "storytea.top", true },
{ "storytell.com", true },
{ "storytime.hu", true },
{ "stouter.nl", true },
@@ -36029,6 +37459,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stpatricks-pelham.com", true },
{ "stpaulcatholicchurcheastnorriton.net", true },
{ "str8hd.com", true },
+ { "str92.com", true },
{ "straatderzotten.nl", true },
{ "strafensau.de", true },
{ "strafvollzugsgesetze.de", true },
@@ -36039,9 +37470,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "strandom.ru", true },
{ "strandschnuppern.de", true },
{ "strangelane.com", true },
- { "strangemusicinc.com", true },
{ "strangemusicinc.net", true },
- { "strangeways.ca", true },
+ { "strangeways.ca", false },
{ "straphael-holyangels.com", true },
{ "strate.io", true },
{ "strategiccapital.com", true },
@@ -36070,13 +37500,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "streetview.wien", true },
{ "strefapi.com", true },
{ "stremio.com", true },
+ { "strengthinyoufitness.com", true },
{ "strengthroots.com", true },
+ { "stretchmarkdestroyer.com", true },
{ "stretchmyan.us", true },
+ { "stretchpc.com", true },
{ "striata.com", true },
{ "striatadev.com", true },
{ "stricted.net", true },
{ "strictlyguitar.de", true },
{ "strijkshop.be", true },
+ { "stringbeanstudio.com", true },
{ "stringtoolbox.com", true },
{ "stringvox.com", true },
{ "stripe.com", true },
@@ -36098,7 +37532,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "strongpassword.club", true },
{ "strongrandom.com", false },
{ "strongsalpinesucculents.com", true },
- { "strongtowerpc.com", true },
{ "stroomacties.nl", true },
{ "strosemausoleum.com", true },
{ "stroseoflima.com", true },
@@ -36121,6 +37554,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stuartmorris.me", true },
{ "stuartmorris.name", true },
{ "stuartmorris.tel", true },
+ { "stuarts.xyz", false },
{ "stuckateur-bruno.de", true },
{ "stuco.co", true },
{ "stucydee.nl", true },
@@ -36139,9 +37573,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "studienportal.eu", true },
{ "studio-637.com", true },
{ "studio-architetto.com", true },
- { "studio-art.pro", true },
{ "studio-fotografico.ru", true },
{ "studio-happyvalley.com", true },
+ { "studio-n.pl", true },
{ "studio44.fit", true },
{ "studioadevents.com", true },
{ "studioavvocato24.it", true },
@@ -36158,7 +37592,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "studiomarcella.com", true },
{ "studionowystyl.pl", true },
{ "studiopirrate.com", true },
- { "studiopop.com.br", true },
{ "studioproapp.com", true },
{ "studioriehl.com", true },
{ "studioscherp.nl", true },
@@ -36170,13 +37603,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "studiovaud.com", true },
{ "studipro-formation.fr", true },
{ "studipro-marketing.fr", true },
+ { "studisys.net", true },
{ "studium.cz", true },
+ { "studlan.no", true },
{ "studyin.jp", true },
{ "studyspy.ac.nz", true },
{ "studytactics.com", true },
{ "stuetzredli.ch", true },
{ "stuffi.fr", true },
{ "stuffie.org", false },
+ { "stuffiwouldbuy.com", false },
{ "stuka-art.de", true },
{ "stulda.cz", false },
{ "stumeta.de", true },
@@ -36195,6 +37631,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "stuvus.uni-stuttgart.de", true },
{ "stw-group.at", true },
{ "stygium.net", false },
+ { "stylaq.com", true },
{ "stylebajumuslim.com", true },
{ "styleci.io", true },
{ "stylecollective.us", true },
@@ -36219,8 +37656,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "subohm.com", true },
{ "suborbital.io", true },
{ "subrosr.com", true },
- { "subsistence.wiki", true },
{ "substitutealert.com", true },
+ { "subtitry.ru", true },
{ "suburban-landscape.net", true },
{ "suburbaninfinitioftroyparts.com", true },
{ "subversive-tech.com", true },
@@ -36229,15 +37666,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "succesprojekter.dk", true },
{ "successdeliv.com", true },
{ "suche.org", true },
+ { "suchem.com", true },
{ "suchmaschinen-werkstatt.de", true },
{ "suckmyan.us", false },
{ "sucretown.net", true },
{ "sud66.com", true },
+ { "sudanindependent.com", true },
{ "sudaraka.org", true },
{ "sudmotor-occasions.be", true },
{ "sudo-i.net", true },
{ "sudo.li", true },
- { "sudo.org.au", true },
{ "sudo.ws", true },
{ "sudokian.io", true },
{ "sudoschool.com", true },
@@ -36250,6 +37688,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sugarandcloth.com", true },
{ "sugarbrother.com", true },
{ "sugarfactory.cz", true },
+ { "sugarhillsfarm.com", true },
{ "sugarlandkarate.net", true },
{ "sugarmillmanagement.com", true },
{ "sugarshin.net", true },
@@ -36273,11 +37712,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "suluvir.com", true },
{ "sumguy.com", true },
{ "summa.eu", false },
+ { "summerbo.at", true },
{ "summercampthailand.com", true },
{ "summershomes.com", true },
- { "sumthing.com", true },
- { "sunboxstore.jp", true },
+ { "sun-wellness-online.com.vn", true },
{ "sunbritetv.com", true },
+ { "sunbury.xyz", true },
{ "sunchasercats.com", true },
{ "sundanceusa.com", true },
{ "sundayfundayjapan.com", true },
@@ -36286,9 +37726,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sunfiregold.com", true },
{ "sunflyer.cn", false },
{ "sunfox.cz", true },
- { "sunfulong.blog", true },
- { "sunfulong.me", true },
{ "sungreen.info", true },
+ { "sunhaoxiang.net", true },
{ "sunjaydhama.com", true },
{ "sunjiutuo.com", true },
{ "sunlit.cloud", true },
@@ -36297,6 +37736,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sunnylyx.com", true },
{ "sunnysidechurchofchrist.org", true },
{ "sunoikisis.org", true },
+ { "sunplay.host", true },
{ "sunred.info", true },
{ "sunred.org", true },
{ "sunsetwx.com", true },
@@ -36306,13 +37746,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sunstar.bg", true },
{ "sunwolf.studio", true },
{ "suool.net", true },
+ { "suourl.com", true },
{ "supa.sexy", true },
{ "supastuds.com", true },
{ "supcoronado.com", true },
{ "supedi.com", true },
{ "supedi.de", true },
{ "supedio.com", true },
- { "super-erotica.ru", true },
{ "superaficionados.com", true },
{ "superbart.nl", true },
{ "superbdistribute.com", true },
@@ -36328,10 +37768,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "superdaddy.club", true },
{ "superdroni.com", true },
{ "supereight.net", true },
+ { "superenduro.net", true },
{ "superguide.com.au", true },
{ "superhappiness.com", true },
{ "superhome.com.au", true },
{ "superidropulitrice.com", true },
+ { "superlandnetwork.de", true },
{ "supermae.pt", true },
{ "supermarx.nl", true },
{ "supermercadosdia.com.ar", false },
@@ -36368,6 +37810,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "supriville.com.br", true },
{ "sur-v.com", true },
{ "surao.cz", true },
+ { "surasak.io", true },
+ { "surasak.net", true },
+ { "surasak.org", true },
{ "surdam.casa", true },
{ "sure-it.de", true },
{ "surefit-oms.com", true },
@@ -36384,10 +37829,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "surreyheathyc.org.uk", true },
{ "suruifu.com", true },
{ "survature.com", true },
- { "surveillance104.com", true },
{ "surveyhealthcare.com", true },
{ "surveymill.co.uk", true },
{ "survivalmonkey.com", true },
+ { "survivebox.fr", true },
{ "susanbpilates.co", true },
{ "susanbpilates.com", true },
{ "susann-kerk.de", true },
@@ -36402,8 +37847,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sussexheart.com", true },
{ "sustainabilityknowledgegroup.com", true },
{ "sustainoss.org", true },
+ { "sustc.ac.cn", true },
{ "sustsol.com", true },
{ "sutas.market", true },
+ { "suts.co.uk", true },
{ "suttacentral.net", true },
{ "suurhelsinki.cf", true },
{ "suuria.de", true },
@@ -36414,6 +37861,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "suzukimarinepress.com", true },
{ "sv-1966-medenbach.de", false },
{ "sv-bachum-bergheim.de", true },
+ { "sv-schody.cz", true },
{ "sv-turm-hohenlimburg.de", true },
{ "sv.search.yahoo.com", false },
{ "svager.cz", true },
@@ -36430,12 +37878,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "svdb.co", false },
{ "svdreamcatcher.com", true },
{ "sveinerik.org", true },
+ { "svendubbeld.nl", true },
{ "sveneckelmann.de", true },
{ "svenjaundchristian.de", true },
{ "svenluijten.com", false },
{ "svenmuller.nl", true },
{ "svennd.be", true },
+ { "svenrath.de", true },
{ "svetandroida.cz", true },
+ { "svetila.com", true },
{ "svetlilo.com", true },
{ "svht.nl", true },
{ "svijet-medija.hr", true },
@@ -36444,6 +37895,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "svm-it.eu", true },
{ "svobodnyblog.cz", true },
{ "svorcikova.cz", true },
+ { "svsb-live.azurewebsites.net", false },
{ "sw-servers.net", true },
{ "sw33tp34.com", true },
{ "swagsocial.net", true },
@@ -36452,7 +37904,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "swap.gg", true },
{ "swapadoodle.com", true },
{ "swaptaxdata.com", true },
- { "swarfarm.com", true },
{ "swarlys-server.de", true },
{ "swarovski-lov.cz", true },
{ "swat4stats.com", true },
@@ -36461,24 +37912,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "swd.agency", true },
{ "swe77.com", true },
{ "swe777.com", true },
- { "sweak.net", true },
{ "swedishhost.com", true },
{ "swedishhost.se", true },
{ "sweep-me.net", true },
{ "sweepay.ch", true },
+ { "sweepy.pw", true },
{ "sweet-as.co.uk", true },
{ "sweet-orr.com", true },
{ "sweet-spatula.com", true },
{ "sweetair.com", true },
{ "sweetbridge.com", true },
+ { "sweetenedcondensed.com", true },
{ "sweetgood.de", true },
{ "sweethomesnohomishrenovations.com", true },
{ "sweets-mimatsu.com", true },
+ { "sweetydecor.ru", true },
{ "sweharris.org", true },
{ "swerve-media-testbed-03.co.uk", true },
{ "swetrust.com", true },
+ { "swey.net", true },
{ "swfmax.com", true },
{ "swiftcashforcars.com.au", true },
+ { "swifteh.net", true },
{ "swiftpcbassembly.com", true },
{ "swiftqueue.com", true },
{ "swilly.org", true },
@@ -36487,6 +37942,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "swimwear365.co.uk", true },
{ "swineson.me", true },
{ "swing-belleville.de", true },
+ { "swingerclub.in", true },
{ "swingmonkey.com", true },
{ "swipetv.ie", true },
{ "swiss-apartments.com", true },
@@ -36497,6 +37953,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "swissdojo.ch", true },
{ "swisselement365.com", true },
{ "swissfreshaircan.ch", true },
+ { "swissfreshaircan.com", true },
{ "swissid.ch", true },
{ "swisslinux.org", true },
{ "swisstechassociation.ch", true },
@@ -36506,14 +37963,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "switch.moe", true },
{ "switcheo.exchange", true },
{ "switcheo.rocks", true },
- { "switzerland-family-office.com", true },
{ "swivells.com", true },
{ "swkdevserver.tk", true },
{ "swktestserver.tk", true },
{ "swn-nec.de", true },
{ "swordfeng.xyz", true },
{ "swqa.hu", true },
- { "swuosa.org", false },
+ { "swrpgitems.com", true },
{ "swvaux.com", true },
{ "swxtd.com", true },
{ "swyn.net", true },
@@ -36521,9 +37977,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sxistolithos.gr", true },
{ "sy-anduril.de", true },
{ "sy24.ru", true },
- { "syajvo.if.ua", true },
+ { "syajvo.if.ua", false },
{ "syakonavi.com", true },
- { "syamutodon.xyz", true },
{ "sycamorememphis.org", true },
{ "sychov.pro", true },
{ "sydney-sehen.com", true },
@@ -36538,10 +37993,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "syleam.in", true },
{ "sylfie.net", true },
{ "syllogi.xyz", true },
- { "sylvaincombe.net", true },
{ "sylvaindurand.fr", true },
{ "sylvaindurand.org", true },
{ "sylvaloir.fr", true },
+ { "sylvan.me", true },
{ "sylve.ch", true },
{ "sym01.com", true },
{ "symb.ch", true },
@@ -36567,9 +38022,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sync-it.no", true },
{ "synccentre.com", true },
{ "syncflare.com", true },
- { "synchrocube.com", true },
{ "synchrolarity.com", true },
- { "synchronicity.cz", true },
{ "synchronyse.com", true },
{ "synchtu.be", false },
{ "syncrise.co.jp", true },
@@ -36595,6 +38048,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "sysctl.se", true },
{ "sysdb.io", true },
{ "sysdot.blog", true },
+ { "syskit.com", true },
{ "syslogic.io", true },
{ "sysmike.de", true },
{ "systea.fr", true },
@@ -36607,10 +38061,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "systemadmin.uk", true },
{ "systematic-momo.com", true },
{ "systematic-momo.dk", true },
+ { "systemctl.io", true },
{ "systemd.ch", true },
{ "systemd.eu.org", true },
{ "systemeprod.fr", true },
{ "systemintegra.ru", true },
+ { "systemisbusy.info", true },
{ "systemli.org", true },
{ "systemonthego.com", true },
{ "systemreboot.net", true },
@@ -36629,19 +38085,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "szafkirtv.pl", true },
{ "szaloneigly.com", true },
{ "szamitogepdepo.com", true },
+ { "szasz.me", true },
{ "szaydon.me", false },
{ "szc.me", true },
{ "szclsya.me", true },
{ "szechenyi2020.hu", true },
{ "szentistvanpt.sk", true },
{ "szepsegbennedrejlik.hu", true },
- { "szerelem.love", true },
+ { "szeptylasu.eu", true },
{ "szeretekvajpolni.hu", true },
- { "szetowah.org.hk", true },
{ "szunia.com", true },
{ "szybkiebieganie.pl", true },
{ "szyndler.ch", true },
- { "szzsivf.com", true },
{ "t-hawk.com", true },
{ "t-m.me", true },
{ "t-net.org.hu", true },
@@ -36656,7 +38111,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "t47.io", true },
{ "t4c.link", true },
{ "t4cc0.re", true },
- { "t5118.com", true },
{ "t7e.de", false },
{ "t9i.in", true },
{ "ta-65.com", true },
@@ -36665,6 +38119,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "taabe.net", true },
{ "taalcursusvolgen.nl", true },
{ "taartbesteld.nl", true },
+ { "taartenfeesies.nl", true },
{ "tabarnak.ga", true },
{ "tabernadovinho.com.br", true },
{ "tabi-news.com", true },
@@ -36684,6 +38139,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tacklinglife.com", true },
{ "tacklog.com", true },
{ "tacomafia.net", true },
+ { "tacticalavocado.com", true },
{ "tacticalsquare.com", true },
{ "taddiestales.com", true },
{ "tadeo.ca", true },
@@ -36699,11 +38155,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "taglioepiega.com", true },
{ "taglioepiega.eu", true },
{ "taglioepiega.it", true },
+ { "tagnull.de", true },
{ "tagpay.com", true },
{ "tagungsraum-usedom.de", true },
{ "tagungsraum-zinnowitz.de", true },
{ "tahavu.com", true },
{ "taherian.me", true },
+ { "tahmintr.com", true },
{ "tahosa.co", true },
{ "tahosalodge.org", true },
{ "tailpuff.net", false },
@@ -36731,6 +38189,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "takeshifujimoto.com", false },
{ "takk.pl", true },
{ "takkaaaaa.com", true },
+ { "tako-miyabi.xyz", true },
{ "takuhai12.com", true },
{ "takumi-s.net", true },
{ "takuto.de", true },
@@ -36742,6 +38201,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "talentos.pt", true },
{ "talentwall.io", true },
{ "taler.net", true },
+ { "talichi.com", true },
{ "talideon.com", false },
{ "talk.google.com", true },
{ "talkgadget.google.com", true },
@@ -36749,13 +38209,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "talkingmoose.net", true },
{ "talkreal.net", true },
{ "talktech.com", true },
- { "talktobot.com", true },
{ "talktodarcy.com", true },
{ "talkwithyourbaby.org", true },
{ "tallcraft.com", true },
{ "talldude.net", true },
{ "tallinnsec.ee", true },
{ "tallinnsex.ee", true },
+ { "tallship.cz", true },
{ "talltreeskv.com.au", true },
{ "tallyfy.com", true },
{ "talon.rip", true },
@@ -36763,9 +38223,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "talun.de", true },
{ "tam-moon.com", true },
{ "tam-safe.com", true },
+ { "tamada.expert", true },
{ "tamaraboutique.com", true },
+ { "tamarimolhem.com", true },
{ "tamashimx.net", true },
{ "tamasszabo.net", true },
+ { "tambayology.com", true },
{ "tambre.ee", true },
{ "tamchunho.com", true },
{ "tamersunion.org", true },
@@ -36776,13 +38239,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tamriel-rebuilt.org", true },
{ "tanacio.com", true },
{ "tanak3n.xyz", false },
+ { "tanchynski.com", true },
{ "tancredi.nl", true },
+ { "tandartszilverschoon.nl", true },
{ "tandem-trade.ru", false },
{ "tandemexhibits.com", true },
{ "tandempartnerships.com", true },
{ "tandzorg.link", true },
{ "tangel.me", true },
{ "tangemann.org", true },
+ { "tangledmeditations.com", true },
{ "tango-ouest.com", true },
{ "tangoalpha.co.uk", true },
{ "tanhit.com", true },
@@ -36799,7 +38265,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tansuya.jp", true },
{ "tantalos.nl", true },
{ "tantei100.net", true },
- { "tanto259.name", false },
+ { "tantetilli.de", false },
+ { "tanto259.name", true },
{ "tanyanama.com", true },
{ "tanz-kreativ.de", true },
{ "tanz.info", true },
@@ -36807,12 +38274,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tanzo.io", true },
{ "taoburee.com", true },
{ "taotuba.org", true },
+ { "taowa.ca", true },
{ "taoways.com", true },
{ "taplamvan.net", true },
{ "taplemon.at", true },
{ "taplemon.com", true },
{ "taprix.org", true },
- { "tapsnapp.co", true },
{ "taquilla.com", true },
{ "tar-mag.com", true },
{ "taranis.re", true },
@@ -36826,8 +38293,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tariff.cc", true },
{ "tarik.io", true },
{ "tarmexico.com", true },
- { "taron.top", true },
- { "tarot-cartas.com", true },
{ "tarsan.cz", true },
{ "tartaneagle.org.uk", true },
{ "tartanhamedshop.com.br", true },
@@ -36853,6 +38318,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tatara.ne.jp", true },
{ "tateesq.com", true },
{ "tatildukkani.com", true },
+ { "tatler.com", true },
{ "tatsidou.gr", true },
{ "tattoo.dating", true },
{ "tattvaayoga.com", true },
@@ -36864,6 +38330,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tax-guard.com", true },
{ "taxaroo.com", true },
{ "taxaudit.com", true },
+ { "taxhawk.com", true },
{ "taxi-chamonix.fr", true },
{ "taxi-collectif.ch", true },
{ "taxi-jihlava.cz", true },
@@ -36873,13 +38340,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "taxid-k.be", true },
{ "taxis-collectifs.ch", true },
{ "taxisafmatosinhos.pt", true },
+ { "taxisantapolagranalacant.com", true },
{ "taxiscollectifs.ch", true },
{ "taxlab.co.nz", true },
{ "taxo.fi", true },
{ "taxpackagesupport.com", true },
{ "taxsquirrel.com", true },
{ "taylorpearson.me", false },
- { "taylorreaume.com", true },
{ "taylors-castles.co.uk", true },
{ "taylorstauss.com", true },
{ "taysonvodao.fr", true },
@@ -36893,6 +38360,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tbrindus.ca", true },
{ "tbs-certificates.co.uk", true },
{ "tbspace.de", true },
+ { "tbtech.cz", true },
{ "tbuchloh.de", true },
{ "tc-st-leonard.ch", true },
{ "tc.nz", true },
@@ -36901,7 +38369,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tcb-b.org", true },
{ "tccmb.com", true },
{ "tcdw.net", true },
- { "tcdww.cn", true },
{ "tcf.org", true },
{ "tcgforum.pl", true },
{ "tcgrepublic.com", true },
@@ -36911,6 +38378,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tchnics.de", true },
{ "tchoukball.ch", true },
{ "tcit.fr", true },
+ { "tcl.sh", true },
{ "tcmwellnessclinic.com", true },
{ "tcnapplications.com", true },
{ "tcpweb.net", true },
@@ -36918,6 +38386,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tcvvip.com", true },
{ "tcwis.com", true },
{ "tdchrom.com", true },
+ { "tddos.pw", true },
{ "tdfbfoundation.org", true },
{ "tdrcartuchos.com.br", true },
{ "tdro.cf", true },
@@ -36925,9 +38394,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tdsf.io", true },
{ "tdsinflatables.co.uk", true },
{ "tdude.co", true },
- { "tea.codes", true },
{ "tea.in.th", true },
- { "teabagdesign.co.uk", true },
{ "teachbiz.net", true },
{ "teachercreatedmaterials.com", true },
{ "teacherph.com", true },
@@ -36949,6 +38416,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "teambeam.ch", true },
{ "teambeam.com", true },
{ "teambeam.de", true },
+ { "teambim.eu", true },
{ "teambition.com", true },
{ "teamcombat.com", true },
{ "teamliquidpro.com", true },
@@ -36969,7 +38437,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "teamupturn.org", true },
{ "teamusec.de", true },
{ "tearoomlints.be", true },
- { "teasenetwork.com", true },
+ { "tease.email", true },
{ "teaser-trailer.com", true },
{ "teatrarium.com", true },
{ "teb-akademia.pl", true },
@@ -37009,11 +38477,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "techinet.pl", true },
{ "techinsurance.com", true },
{ "techjoe.co", true },
+ { "techlr.de", true },
{ "techmagus.icu", true },
{ "techmajesty.com", true },
{ "techmasters.io", true },
{ "techmoviles.com", true },
{ "techmunchies.net", false },
+ { "techni-grav.com", true },
{ "technic3000.com", true },
{ "technicabv.nl", true },
{ "technicalbrothers.cf", true },
@@ -37032,10 +38502,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "technologyhound.org", true },
{ "technologysi.com", true },
{ "technoparcepsilon.fr", true },
+ { "technorely.com", true },
{ "technoscoots.com", true },
{ "technosorcery.net", true },
{ "technospeakco.com", true },
- { "techold.ru", true },
{ "techorbiter.com", true },
{ "techosmarcelo.com.ar", true },
{ "techpilipinas.com", true },
@@ -37050,10 +38520,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "techtalks.no", true },
{ "techtrader.ai", true },
{ "techtrader.io", true },
+ { "techusers.de", true },
{ "techview.link", true },
{ "techviewforum.com", true },
{ "techwayz.com", true },
- { "techwithcromulent.com", true },
{ "techwords.io", true },
{ "techzero.cn", true },
{ "teckids.org", true },
@@ -37068,6 +38538,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tecnogaming.com", true },
{ "tecnogazzetta.it", true },
{ "tecnologiasurbanas.com", true },
+ { "tecnosa.es", true },
{ "tecon.co.at", true },
{ "tecyt.com", true },
{ "ted.do", true },
@@ -37077,14 +38548,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "teddylu.info", true },
{ "teddyss.com", false },
{ "tedsdivingsystem.com", true },
- { "tedxodense.com", true },
- { "teebeedee.org", false },
- { "teedb.de", true },
+ { "tedxyalesecondaryschool.com", true },
+ { "teektalk.org", true },
{ "teemo.gg", true },
{ "teemperor.de", true },
{ "teemulintula.fi", true },
{ "teencounseling.com", true },
- { "teenerotic.net", true },
{ "teengirl.pub", true },
{ "teensexgo.com", true },
{ "teeworlds-friends.de", true },
@@ -37103,6 +38572,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tekno.de", true },
{ "teknoforums.com", true },
{ "teknolit.com", true },
+ { "teknoroit.com", true },
{ "tekstschrijvers.net", true },
{ "tekuteku.jp", true },
{ "telamon.eu", true },
@@ -37122,6 +38592,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "telefoon.nl", true },
{ "telefoonabonnement.nl", true },
{ "telegenisys.com", true },
+ { "telegra.ph", true },
{ "telegram.org", true },
{ "telegramdr.com", true },
{ "telehealthventures.com", false },
@@ -37129,7 +38600,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "teleogistic.net", true },
{ "telepass.me", true },
{ "telephonedirectories.us", true },
- { "telesto.online", true },
{ "teletechnology.in", false },
{ "teletexto.com", true },
{ "telework.gov", true },
@@ -37143,11 +38613,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tellyourtale.com", true },
{ "teloo.pl", true },
{ "telos-analytics.com", true },
+ { "telsu.fi", true },
{ "teltru.com", true },
{ "tem.li", true },
{ "temariopolicianacional.es", true },
{ "temariosdeoposiciones.es", true },
- { "temasa.net", true },
{ "tematicas.org", true },
{ "temdu.com", true },
{ "temizmama.com", true },
@@ -37162,6 +38632,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tenable.com.au", true },
{ "tenbos.ch", true },
{ "tendance-et-accessoires.com", true },
+ { "tende.roma.it", true },
{ "tendermaster.com.ua", true },
{ "tenderplan.ru", true },
{ "tenderstem.co.uk", true },
@@ -37171,7 +38642,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tenisservis.eu", true },
{ "tenkdigitalt.no", true },
{ "tenkofx.com", true },
- { "tennisapp.org", true },
{ "tennismindgame.com", true },
{ "tenno.tools", true },
{ "tenpo-iku.com", true },
@@ -37186,27 +38656,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tenzer.dk", true },
{ "teoleonie.com", true },
{ "tepautotuning.com", true },
- { "tepid.org", true },
{ "tepitus.de", true },
{ "teplofom.ru", true },
{ "teplomash24.ru", true },
{ "tequilazor.com", true },
{ "terabyte.services", true },
- { "terabyteharddrive.net", true },
{ "terabyteit.co.uk", true },
{ "teracloud.at", true },
{ "teranacreative.com", true },
{ "teriiphotography.com", true },
{ "teriyakisecret.com", true },
{ "terlindung.com", true },
+ { "terminalvelocity.co.nz", true },
{ "termino.eu", true },
{ "terminsrakning.se", true },
{ "termitemounds.org", true },
{ "termitinitus.org", true },
{ "termografiranje.si", true },
{ "termux.com", true },
- { "terpotiz.net", true },
- { "terra-x.net", true },
{ "terra.fitness", true },
{ "terrab.de", false },
{ "terracloud.de", false },
@@ -37237,21 +38704,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tesoro.pr", true },
{ "tessai.ga", true },
{ "tesseractinitiative.org", true },
+ { "test-greavesindia.pantheonsite.io", true },
{ "test-sev-web.pantheonsite.io", true },
{ "test-textbooks.com", true },
{ "test.de", true },
{ "test.support", true },
+ { "testeri.fi", true },
{ "testeveonline.com", true },
{ "testgeomed.ro", true },
+ { "testingbot.com", true },
{ "testomato.com", true },
{ "testoon.com", true },
- { "testpornsite.com", true },
{ "testsuite.org", true },
{ "testsvigilantesdeseguridad.es", true },
{ "testuje.net", true },
{ "tetedelacourse.ch", true },
{ "teto.nu", true },
{ "tetraetc.com", true },
+ { "tetragir.com", true },
{ "tetraktus.org", true },
{ "tetrarch.co", true },
{ "tetsugakunomichi.jp", true },
@@ -37308,6 +38778,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tgui.net", true },
{ "tgw.com", true },
{ "tgwork.com", true },
+ { "th-music-finder.com", true },
{ "th.search.yahoo.com", false },
{ "thablubb.de", true },
{ "thaedal.net", true },
@@ -37336,31 +38807,42 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thatquiz.org", true },
{ "thatsme.io", true },
{ "thca.ca", true },
+ { "thcdev.de", true },
{ "thcpbees.co.uk", true },
{ "the-arabs.com", true },
{ "the-bermanns.com", true },
{ "the-big-bang-theory.com", true },
{ "the-body-shop.hu", false },
+ { "the-digitale.com", false },
{ "the-fermenter.com", true },
+ { "the-gdn.net", true },
{ "the-hemingway-code.de", true },
+ { "the-jeuxflash.com", true },
{ "the-mystery.org", true },
{ "the-nash-education-program.com", true },
{ "the-pack.nl", true },
{ "the-pcca.org", true },
+ { "the-train.de", true },
{ "the-webmaster.com", true },
{ "the-woods.org.uk", true },
{ "the-zenti.de", true },
{ "the2f.de", true },
{ "the3musketeers.biz", true },
{ "the8rules.co.uk", true },
+ { "thea-team.net", true },
{ "theactuary.ninja", true },
{ "theadelaideshow.com.au", true },
{ "theadultswiki.com", true },
{ "theafleo.gq", true },
+ { "theagencywithoutaname.com", true },
{ "thealexandertechnique.co.uk", true },
{ "theallmanteam.com", true },
+ { "thealonas.ml", true },
{ "theanticellulitediet.com", true },
+ { "theappliancedepot.co.uk", true },
{ "theaps.net", true },
+ { "theasianshooter.com", true },
+ { "theasianshooters.com", true },
{ "theastrocoach.com", true },
{ "theatre-schools.com", true },
{ "theazoorsociety.org", true },
@@ -37368,12 +38850,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thebakery2go.de", true },
{ "thebannerstore.com", true },
{ "thebarbdemariateam.com", true },
+ { "thebarrens.nu", true },
{ "thebasebk.org", true },
{ "thebcm.co.uk", true },
{ "thebeachessportsphysio.com", true },
{ "thebeardedrapscallion.com", true },
{ "thebeginningviolinist.com", true },
- { "thebest.ch", true },
{ "thebestfun.co.uk", true },
{ "thebestofthesprings.com", true },
{ "thebestpersonin.ml", true },
@@ -37384,6 +38866,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thebikeinsurer.co.uk", true },
{ "thebimhub.com", true },
{ "thebinarys.com", true },
+ { "thebirchwoods.com", true },
{ "thebirthdaysite.co.uk", true },
{ "thebit.link", true },
{ "theblackknightsings.com", true },
@@ -37391,6 +38874,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "theblueroofcottage.ca", true },
{ "thebluub.com", true },
{ "theboatmancapital.com", true },
+ { "theboats.agency", true },
+ { "theboats.club", true },
+ { "theboats.com", true },
+ { "theboats.de", true },
+ { "theboats.online", true },
+ { "theboats.pro", true },
+ { "theboats.site", true },
{ "thebodyprinciple.com", true },
{ "thebonerking.com", true },
{ "thebouncedepartment.co.uk", true },
@@ -37403,15 +38893,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thebusinessofgoodfilm.com", true },
{ "thecamels.org", true },
{ "thecameradivision.com", true },
- { "thecandidforum.com", true },
+ { "thecandyjam.com", true },
{ "thecarolingconnection.com", true },
{ "thecellulitediet.com", true },
+ { "thechavs.xyz", true },
{ "thecherryship.ch", true },
{ "thechunk.net", true },
{ "thecitywarehouse.clothing", true },
{ "thecloudshelter.com", true },
{ "thecoffeecamp.com", true },
- { "thecoffeesuperstore.com", true },
{ "thecolumnist.net", true },
{ "thecompany.pl", true },
{ "theconcordbridge.azurewebsites.net", true },
@@ -37420,6 +38910,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thecrazytravel.com", true },
{ "thecrescentchildcarecenter.com", true },
{ "thecrew-exchange.com", true },
+ { "thecskr.in", true },
{ "thecstick.com", true },
{ "thecuppacakery.co.uk", true },
{ "thecuriousdev.com", true },
@@ -37427,8 +38918,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thecustomdroid.com", true },
{ "theda.co.za", true },
{ "thedark1337.com", true },
- { "thedebug.life", true },
{ "thederminstitute.com", true },
+ { "thedermreport.com", true },
{ "thedhs.com", true },
{ "thediamondcenter.com", true },
{ "thedisc.nl", true },
@@ -37453,6 +38944,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thefairieswantmedead.com", true },
{ "thefanimatrix.net", true },
{ "thefashionpolos.com", true },
+ { "thefasterweb.com", true },
{ "thefbstalker.com", true },
{ "thefengshuioffice.com", true },
{ "theferrarista.com", true },
@@ -37462,8 +38954,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "theflyingbear.net", true },
{ "thefnafarchive.org", true },
{ "theforkedspoon.com", true },
- { "thefourthmoira.com", true },
{ "thefreemail.com", true },
+ { "thefriedzombie.com", true },
{ "thefrk.pw", true },
{ "thefuckingtide.com", true },
{ "thefunfirm.co.uk", true },
@@ -37473,8 +38965,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thegatheringocala.com", true },
{ "thegeekdiary.com", true },
{ "thegerwingroup.com", true },
+ { "theghostlytavern.com", true },
+ { "thegioidulich.com.vn", true },
{ "thegioinano.com", true },
{ "thegrape.ro", true },
+ { "thegreatcommissionpodcast.com", true },
{ "thegreatpakistan.com", true },
{ "thegreatplains.com", true },
{ "thegreenfields.se", true },
@@ -37493,11 +38988,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thehomeicreate.com", true },
{ "thehonorguard.org", true },
{ "thehookup.be", true },
- { "thehoryzon.com", true },
{ "thehotfix.net", true },
{ "thehotness.tech", true },
{ "thehouseofgod.org.nz", true },
- { "thehowtohome.com", true },
{ "thehub.ai", true },
{ "theideaskitchen.com.au", true },
{ "theidiotboard.com", true },
@@ -37522,7 +39015,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thelaimlife.com", true },
{ "thelanscape.com", true },
{ "thelastbeach.top", true },
- { "thelastsurprise.com", true },
{ "thelatedcult.com", true },
{ "thelearningenterprise.co.uk", true },
{ "thelegionshirley.co.uk", true },
@@ -37533,8 +39025,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thelocals.ru", true },
{ "thelonelyones.co.uk", true },
{ "thelonious.nl", true },
+ { "thelounge.chat", true },
{ "themacoaching.nl", true },
- { "themadlabengineer.co.uk", true },
{ "themallards.info", true },
{ "themarshallproject.org", true },
{ "themecraft.studio", true },
@@ -37557,7 +39049,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "themusicinnoise.net", true },
{ "theneatgadgets.com", true },
{ "thenerdic.com", true },
+ { "thenetw.org", true },
{ "thenexwork.com", true },
+ { "thenib.com", true },
{ "theninenine.com", true },
{ "thenocman.com", true },
{ "thenovaclinic.com", true },
@@ -37571,7 +39065,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "theodorahome.com.br", true },
{ "theofleck.com", true },
{ "theokouzelis.com", true },
- { "theoldbrewhouse.info", true },
{ "theonethaimassage.de", true },
{ "theoriginalbit.com", true },
{ "theory-test-online.co.uk", true },
@@ -37592,7 +39085,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thephp.cc", true },
{ "thepieslicer.com", true },
{ "thepiratesociety.org", true },
- { "theplaidpoodle.com", true },
{ "theplasticsurgerycenterofnashville.com", true },
{ "theplayspot.co.uk", true },
{ "theploughharborne.co.uk", true },
@@ -37617,6 +39109,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "therevenge.me", true },
{ "therhetorical.ml", true },
{ "thermalbad-therme.de", true },
+ { "thermia.co.nz", true },
+ { "thermia.com.au", true },
{ "thermity.com", true },
{ "thermolamina.nl", true },
{ "thermorecetas.com", true },
@@ -37627,24 +39121,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "theruizes.com", true },
{ "theruleslawyer.net", true },
{ "therumfordcitizen.com", true },
+ { "thesage.cf", true },
{ "thesalonthing.com", false },
+ { "thesanta.biz", true },
{ "thesarogroup.com", true },
{ "thesaturdaypaper.com.au", true },
{ "thesaurus.net", true },
{ "theschool.jp", true },
{ "thescientists.nl", true },
- { "thesearchenginepros.com", true },
{ "thesecondsposts.com", false },
{ "theseed.io", true },
{ "theseedbox.xyz", true },
{ "theseletarmall.com", true },
{ "theseoframework.com", true },
+ { "theseoplatform.co.uk", true },
{ "theseosystem.com", true },
{ "theserviceyouneed.com", true },
{ "thesession.org", false },
+ { "thesetwohands864.com", true },
{ "thesharedbrain.ch", true },
{ "thesharedbrain.com", true },
- { "thesharepointfarm.com", true },
{ "theshield.in", true },
{ "theshine.pl", true },
{ "theshopally.com", false },
@@ -37674,6 +39170,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thesuppercircle.com", true },
{ "theswissbay.ch", true },
{ "theteacherscorner.net", true },
+ { "thetechbasket.com", true },
{ "thetechnical.me", true },
{ "thetenscrolls.com", true },
{ "thethreepercent.marketing", true },
@@ -37696,7 +39193,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thevgg.com", false },
{ "thevisasofoz.com", true },
{ "thevoya.ga", true },
- { "thevyra.com", true },
{ "thewagesroom.co.uk", true },
{ "thewarrencenter.org", true },
{ "thewaxhouse.academy", true },
@@ -37709,7 +39205,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thewhitneypaige.com", true },
{ "thewinstonatlyndhurst.com", true },
{ "thewoodkid.com.au", true },
- { "thewoolroom.com.au", true },
{ "theworld.tk", true },
{ "theworldbattle.com", true },
{ "theworldexchange.com", true },
@@ -37738,6 +39233,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thijsslop.nl", true },
{ "thijsvanderveen.net", true },
{ "thinegen.de", true },
+ { "thing.vn", true },
{ "thingies.site", true },
{ "thingsimplied.com", true },
{ "thingsof.org", true },
@@ -37764,11 +39260,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thisfreelife.gov", true },
{ "thisisgrey.com", true },
{ "thisishugo.com", true },
+ { "thisistechtoday.com", true },
{ "thisisthefinalact.com", true },
{ "thisistheserver.com", true },
{ "thisiswhywemom.com", true },
{ "thismatter.com", true },
- { "thisoldearth.com", true },
{ "thisserver.dontexist.net", true },
{ "thistleandleaves.com", true },
{ "thitruongsi.com", true },
@@ -37776,7 +39272,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thole.org", true },
{ "thom4s.info", true },
{ "thomalaudan.de", true },
- { "thomas-bertran.com", true },
{ "thomas-fahle.de", true },
{ "thomas-klubert.de", true },
{ "thomas-prior.com", true },
@@ -37795,7 +39290,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thomashunter.name", false },
{ "thomaskaviani.be", true },
{ "thomasmcfly.com", true },
- { "thomasmeester.nl", false },
{ "thomasmerritt.de", true },
{ "thomassen.sh", true },
{ "thomasstevensmusic.com", true },
@@ -37804,12 +39298,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thomasvochten.com", true },
{ "thomaswoo.com", true },
{ "thomien.de", true },
+ { "thompsonfamily.cloud", true },
{ "thomsonscleaning.co.uk", true },
- { "thomspooren.nl", true },
{ "thomwiggers.nl", true },
{ "thor.edu", true },
{ "thor.re", true },
{ "thoroughbreddiesel.com", true },
+ { "thorshammare.com", true },
+ { "thorshammare.org", true },
+ { "thorshammare.se", true },
{ "thorsten-schaefer.com", false },
{ "thorstenschaefer.name", true },
{ "thosci.com", true },
@@ -37824,6 +39321,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thousandoakslandscapelighting.com", true },
{ "thousandoakslighting.com", true },
{ "thousandoaksoutdoorlighting.com", true },
+ { "thoxyn.com", true },
{ "thpay.com", true },
{ "threatcon.io", true },
{ "threatmarket.com", true },
@@ -37832,7 +39330,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "threecrownsllp.com", true },
{ "threedpro.me", true },
{ "threefantasy.com", true },
- { "threefours.net", true },
+ { "threefours.net", false },
{ "threelions.ch", true },
{ "threema.ch", true },
{ "threexxx.ch", true },
@@ -37848,13 +39346,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "throwaway.link", true },
{ "throwpass.com", true },
{ "thrush.com", true },
+ { "thrx.net", true },
{ "thues.eu", true },
{ "thuisverpleging-meerdael.be", true },
{ "thullbery.com", true },
{ "thummer.net", true },
{ "thunderfield-boat.co.uk", true },
{ "thunderkeys.net", true },
+ { "thundr.eu", true },
{ "thunraz.com", true },
+ { "thurn.net", true },
{ "thusoy.com", true },
{ "thuthuatios.com", true },
{ "thuviensoft.com", true },
@@ -37862,14 +39363,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "thw-bernburg.de", true },
{ "thxandbye.de", true },
{ "thycotic.ru", true },
+ { "thymiaturtle.de", true },
{ "thyngster.com", true },
- { "thzone.net", true },
+ { "thynx.io", true },
{ "ti-pla.net", true },
{ "ti-planet.org", true },
{ "tiagonunes.pt", true },
{ "tiaki.org", true },
{ "tianeptine.com", true },
- { "tianshili.me", true },
{ "tiantangbt.com", true },
{ "tibicinagarricola.com", true },
{ "tibipg.com", true },
@@ -37894,11 +39395,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tidycustoms.net", true },
{ "tiekoetter.com", true },
{ "tielectric.ch", false },
- { "tiendafetichista.com", true },
{ "tiens-ib.cz", true },
{ "tier-1-entrepreneur.com", true },
{ "tierarztpraxis-bogenhausen.de", true },
+ { "tierarztpraxis-illerwinkel.de", true },
{ "tierarztpraxis-weinert.de", true },
+ { "tieronegraphics.com", true },
{ "tierraprohibida.net", true },
{ "ties.com", true },
{ "tiew.pl", true },
@@ -37909,6 +39411,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tigerdile.com", true },
{ "tigernode.com", true },
{ "tigernode.net", true },
+ { "tigerscu.org", true },
{ "tiggeriffic.com", true },
{ "tiglitub.com", true },
{ "tiihosen.fi", true },
@@ -37953,6 +39456,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "timeauction.hk", true },
{ "timebox.tk", true },
{ "timebutler.de", true },
+ { "timecd.cn", true },
{ "timeglass.de", true },
{ "timeless-photostudio.com", true },
{ "timelessskincare.co.uk", true },
@@ -37964,7 +39468,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "timfiedler.net", true },
{ "timi-matik.hu", true },
{ "timing.com.br", true },
- { "timjk.de", true },
+ { "timjk.de", false },
{ "timmersgems.com", true },
{ "timmyrs.de", true },
{ "timnash.co.uk", true },
@@ -37988,7 +39492,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tinf15b4.de", true },
{ "tinfoilsecurity.com", false },
{ "tinfoleak.com", true },
- { "tinker.career", true },
+ { "tinhchattrangda.vn", true },
{ "tinkerbeast.com", true },
{ "tinkertry.com", true },
{ "tinlc.org", true },
@@ -38007,6 +39511,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tinytownsoftplay.co.uk", true },
{ "tinyvpn.net", true },
{ "tinyvpn.org", true },
+ { "tio.run", true },
{ "tioat.net", true },
{ "tipaki.gr", true },
{ "tipbox.is", true },
@@ -38014,6 +39519,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tiplanet.org", true },
{ "tipoftheday.tips", true },
{ "tippytoad.com", true },
+ { "tipsacademicos.com", true },
{ "tipstersweb.com", true },
{ "tipulnagish.co.il", true },
{ "tir-mauperthuis.fr", true },
@@ -38040,6 +39546,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "titanwaterproofing.com.au", true },
{ "titelseite.ch", true },
{ "titiansgirlphotography.com", true },
+ { "titli.fr", true },
{ "titouan.co", false },
{ "tittelbach.at", true },
{ "titusetcompagnies.net", true },
@@ -38064,6 +39571,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tkusano.jp", true },
{ "tkw01536.de", false },
{ "tl.gg", true },
+ { "tlach.cz", true },
{ "tlca.org", true },
{ "tlcnet.info", true },
{ "tlehseasyads.com", true },
@@ -38077,6 +39585,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tlumaczenie.com", true },
{ "tlyphed.net", true },
{ "tlys.de", true },
+ { "tm-t.ca", true },
{ "tm80plus.com", true },
{ "tmakiguchi.org", true },
{ "tmas.dk", true },
@@ -38088,6 +39597,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tmc.com.mt", true },
{ "tmcpromotions.co.uk", true },
{ "tmcreationweb.com", true },
+ { "tmd.cool", true },
{ "tmdb.biz", true },
{ "tmdc.ddns.net", true },
{ "tmf.ru", true },
@@ -38107,6 +39617,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tnl.cloud", true },
{ "tntmobi.com", true },
{ "tny.link", true },
+ { "to-riktari.gr", true },
{ "toad.ga", true },
{ "toast.al", false },
{ "tob-rulez.de", true },
@@ -38115,7 +39626,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tober-cpag.de", true },
{ "tobi-mayer.de", true },
{ "tobi-server.goip.de", true },
- { "tobi-videos.goip.de", true },
+ { "tobiaalberti.com", true },
{ "tobias-bauer.de", true },
{ "tobias-haenel.de", true },
{ "tobias-kleinmann.de", true },
@@ -38145,6 +39656,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tobyx.com", true },
{ "tobyx.de", true },
{ "tobyx.eu", true },
+ { "tobyx.is", true },
{ "tobyx.net", true },
{ "tobyx.org", true },
{ "tocaro.im", true },
@@ -38157,6 +39669,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "todaymeow.com", true },
{ "toddfry.com", true },
{ "toddmath.com", true },
+ { "todo-anime.com", true },
{ "todoereaders.com", true },
{ "todoescine.com", true },
{ "todoist.com", true },
@@ -38191,9 +39704,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tokka.com", true },
{ "tokke.dk", true },
{ "tokkee.org", true },
+ { "tokky.eu", true },
+ { "tokoplugin.com", true },
{ "tokototech.com", true },
{ "tokugai.com", true },
- { "tokumei.co", true },
{ "tokyo-onkyo.jp", true },
{ "tokyo-powerstation.com", true },
{ "tokyo.dating", true },
@@ -38201,6 +39715,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tokyomakino.com", true },
{ "tokyovipper.com", true },
{ "tolboe.com", true },
+ { "toldositajuba.com", true },
{ "toleressea.fr", true },
{ "toles-sur-mesure.fr", true },
{ "tolle-wolke.de", true },
@@ -38223,7 +39738,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tomatenaufdenaugen.de", true },
{ "tomatis-nantes.com", true },
{ "tomaw.net", true },
+ { "tomaz.eu", true },
{ "tombaker.me", true },
+ { "tomberek.info", true },
{ "tombroker.org", true },
{ "tombrossman.com", true },
{ "tomd.ai", true },
@@ -38245,6 +39762,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tommy-bordas.fr", false },
{ "tomnatt.com", true },
{ "tomo.gr", false },
+ { "tomorrowmuseum.com", true },
{ "tomosm.net", true },
{ "tomravinmd.com", true },
{ "tomrei.com", true },
@@ -38283,6 +39801,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tonermonster.de", true },
{ "tonex.de", true },
{ "tonex.nl", true },
+ { "tongli.eu.org", true },
{ "tonifarres.net", true },
{ "tonigallagherinteriors.com", true },
{ "tonkayagran.com", true },
@@ -38329,6 +39848,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "top-opakowania.pl", true },
{ "top4shop.de", true },
{ "top5hosting.co.uk", true },
+ { "top6casinos.com", true },
{ "top9.fr", true },
{ "topaxi.ch", true },
{ "topaxi.codes", true },
@@ -38359,23 +39879,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "toponlinecasinosites.co.uk", true },
{ "toppercan.es", true },
{ "topprice.ua", true },
- { "topsailtechnologies.com", true },
{ "topservercccam.tv", true },
{ "topshelfcommercial.com", true },
- { "topshoptools.com", true },
{ "topsteaks-daun.de", true },
{ "toptec.net.br", true },
{ "toptexture.com", true },
{ "toptheto.com", true },
{ "topvision.se", true },
{ "topwindowcleaners.co.uk", true },
+ { "topwoodltd.co.uk", true },
{ "topworktops.co.uk", true },
+ { "topyachts.com.ua", true },
{ "toracon.org", true },
- { "torbe.es", true },
{ "torchantifa.org", true },
{ "toreni.us", true },
{ "toretame.jp", true },
- { "torfbahn.de", true },
{ "torg-room.ru", true },
{ "torkware.com", true },
{ "torlock.com", true },
@@ -38399,13 +39917,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "torrent.fedoraproject.org", true },
{ "torrent.is", true },
{ "torrent.tm", true },
- { "torrentfunk.com", true },
{ "torrentfunk.host", true },
{ "torrentfunk.icu", true },
{ "torrentfunk.pw", true },
{ "torrentfunk2.com", true },
{ "torrentpier.me", true },
- { "torrentz2.al", true },
{ "torresygutierrez.com", true },
{ "torretzalam.com", true },
{ "torservers.net", true },
@@ -38416,10 +39932,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tortoises-turtles.com", true },
{ "tortugan.com.br", true },
{ "tosamja.net", true },
+ { "toscer.me", false },
{ "toschool.com.br", true },
{ "toshen.com", true },
{ "toshkov.com", true },
- { "toskana-appartement.de", false },
{ "tosolini.info", true },
{ "tosostav.cz", true },
{ "tosteberg.se", true },
@@ -38456,6 +39972,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "touhou.fm", true },
{ "touhouwiki.net", true },
{ "toujours-actif.com", true },
+ { "toulineprestige.com", true },
{ "tounyou-raku.com", true },
{ "tourgest.net", true },
{ "tourify.me", true },
@@ -38470,6 +39987,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "toushi-return.xyz", true },
{ "toushi-shakkin.com", true },
{ "touslesdrivers.com", true },
+ { "tout-art.ch", true },
+ { "toutart.ch", true },
{ "toutelathailande.fr", true },
{ "toutenmusic.fr", true },
{ "toutmonexam.fr", true },
@@ -38482,13 +40001,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "toutvendre.pics", true },
{ "toutvendre.uk", true },
{ "toutvendre.us", true },
+ { "tovaglioli-di-carta.it", true },
{ "tovare.com", true },
{ "toverland-tickets.nl", true },
{ "tovp.org", true },
{ "towandalibrary.org", true },
{ "tower.land", true },
{ "townandcountryus.com", true },
- { "townhousedevelopments.com.au", true },
{ "townhouseregister.com.au", true },
{ "townofbridgewater.ca", true },
{ "towsonroofers.com", true },
@@ -38497,20 +40016,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "toycu.de", true },
{ "toymagazine.com.br", true },
{ "toyota-kinenkan.com", true },
+ { "toysale.by", false },
{ "toysperiod.com", true },
{ "tp-iryuubun.com", true },
{ "tp-kabushiki.com", true },
{ "tp-kyouyufudousan.com", true },
{ "tp-law.jp", true },
- { "tpansino.com", true },
{ "tpbproxy.co", true },
{ "tpci.biz", true },
{ "tpidg.us", true },
{ "tpolemis.com", true },
{ "tpp.chat", true },
{ "tppleague.me", false },
+ { "tpro.co.id", true },
{ "tpro.rocks", true },
{ "tqdev.com", true },
+ { "tql.plus", true },
{ "tr.search.yahoo.com", false },
{ "tr0n.net", true },
{ "traas.org", true },
@@ -38523,17 +40044,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "traceroute.guru", true },
{ "traceroute.link", true },
{ "traceroute.network", true },
- { "traces.ml", true },
{ "tracetracker.no", true },
{ "tracfinancialservices.com", true },
{ "tracinsurance.com", true },
{ "track.plus", true },
{ "trackchair.com", true },
{ "trackdomains.com", true },
+ { "tracker.com.ar", true },
{ "trackersimulator.org", true },
{ "trackeye.dk", true },
{ "tracking.best", true },
- { "trackingstream.com", true },
{ "trackrecordpro.co.uk", true },
{ "trackyourlogs.com", true },
{ "tractorfan.nl", true },
@@ -38549,20 +40069,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "traderjoe-cloud.de", true },
{ "tradernet.ru", true },
{ "tradeshowfreightservices.com", true },
+ { "tradexport.cn", true },
+ { "tradexport.com", true },
{ "tradik.com", true },
{ "tradinews.com", true },
{ "tradinews.fr", true },
+ { "tradingview.com", true },
{ "traditions.nl", true },
{ "traditionskapperscollege.nl", true },
{ "traditionsvivantesenimages.ch", true },
{ "tradiz.org", false },
{ "tradlost-natverk.se", true },
+ { "traducir.win", true },
{ "trafarm.ro", true },
{ "trafas.nl", true },
- { "traffic.az", true },
{ "trafficmanager.com", true },
{ "trafficmanager.ltd", true },
{ "trafficmanager.xxx", true },
+ { "trafficmgr.cn", true },
{ "trafficmgr.net", true },
{ "trafficologyblueprint.com", true },
{ "trafficpixel.tk", true },
@@ -38595,7 +40119,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "trainplaza.be", true },
{ "trainplaza.net", true },
{ "trainplaza.nl", true },
- { "trainsgoodplanesbad.com", true },
+ { "trainsgoodplanesbad.com", false },
{ "traintimes.be", true },
{ "traintimes.ch", true },
{ "traintimes.dk", true },
@@ -38615,11 +40139,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tran.pw", true },
{ "trance-heal.com", true },
{ "trance-heal.de", true },
- { "trance-heal.me", true },
{ "tranceheal.com", true },
{ "tranceheal.de", true },
- { "tranceheal.me", true },
- { "trangcongnghe.com", true },
{ "trangell.com", true },
{ "tranglenull.xyz", true },
{ "tranhsondau.net", false },
@@ -38629,6 +40150,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "transcend.org", true },
{ "transcontrol.com.ua", true },
{ "transfer.pw", true },
+ { "transferbags.com", true },
{ "transfers.do", true },
{ "transferserver.at", true },
{ "transfersummit.com", true },
@@ -38660,7 +40182,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "transnexus.com", true },
{ "transoil.co.uk", true },
{ "transpak-cn.com", true },
- { "transport.eu", true },
+ { "transparentcorp.com", true },
{ "transporta.it", true },
{ "transporterlock.com", true },
{ "transumption.com", true },
@@ -38698,19 +40220,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "travis.nl", true },
{ "travisf.net", true },
{ "travisforte.io", true },
+ { "travisfranck.com", true },
{ "travler.net", true },
{ "trbanka.com", true },
{ "trea98.org", true },
{ "treaslockbox.gov", true },
{ "trebarov.cz", true },
{ "trebek.club", true },
- { "tree0.xyz", true },
{ "treebaglia.xyz", true },
+ { "treehouse.pub", true },
{ "treehouseresort.nl", true },
{ "trees.chat", true },
{ "treeschat.com", true },
+ { "treestarmarketing.com", true },
{ "treetopsecurity.com", true },
- { "treeworkbyjtec.com", true },
{ "trefcon.cz", true },
{ "trefpuntdemeent.nl", true },
{ "treinaweb.com.br", false },
@@ -38719,13 +40242,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "treinonerd.com", true },
{ "trek-planet.ru", true },
{ "trekfriend.com", true },
- { "trekkinglife.de", true },
+ { "treml-sturm.com", true },
{ "trendkraft.de", true },
{ "trendreportdeals.com", true },
{ "trendsettersre.com", true },
{ "trendus.no", true },
{ "trendykids.cz", true },
{ "trenta.io", true },
+ { "trentonmakesnews.com", true },
{ "tresor.it", true },
{ "tresorit.com", true },
{ "tresorsecurity.com", true },
@@ -38758,7 +40282,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tributh.net", true },
{ "tributh.tk", true },
{ "tricefy4.com", true },
+ { "trichdanhay.com", true },
{ "triciaree.com", true },
+ { "trico-pigmentazione.it", true },
{ "trident-online.de", true },
{ "trietment.com", true },
{ "trigardon-rg.de", true },
@@ -38767,24 +40293,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "trilliumvacationrentals.ca", true },
{ "triluxds.com", true },
{ "trim-a-slab.com", true },
- { "trim21.cn", true },
{ "trimage.org", true },
{ "trinary.ca", true },
{ "trineco.com", true },
{ "trineco.fi", true },
{ "tringavillasyala.com", true },
+ { "trinitasgyor.hu", true },
+ { "trinitycorporateservices.com", true },
{ "trink-und-partyspiele.de", true },
{ "trinnes.net", true },
{ "trio.online", true },
{ "triop.se", true },
- { "trior.net", true },
{ "triplekeys.net", true },
{ "tripolistars.com", true },
{ "tripp.xyz", true },
{ "tripseats.com", true },
{ "tripsinc.com", true },
+ { "triri.org", true },
{ "trisect.eu", true },
{ "trish-mcevoy.ru", true },
+ { "tristanberger.io", true },
{ "trix360.com", true },
{ "trixati.org.ua", true },
{ "trixexpressweb.nl", true },
@@ -38810,6 +40338,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "trouble-free-employees.com", true },
{ "trouweninoverijssel.nl", true },
{ "trovaprezzi.it", true },
+ { "troxal.com", true },
{ "troyfawkes.com", true },
{ "troyhunt.com", true },
{ "troyhuntsucks.com", true },
@@ -38827,6 +40356,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "trueachievements.com", true },
{ "trueassignmenthelp.co.uk", true },
{ "trueblueessentials.com", true },
+ { "truecosmeticbeauty.com", true },
{ "trueduality.net", true },
{ "truehempculture.com.au", true },
{ "trueinstincts.ca", true },
@@ -38855,29 +40385,36 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "trustcase.com", true },
{ "trustedbody.com", true },
{ "trustednetworks.nl", true },
+ { "trustees.org", true },
{ "trustfield.ch", true },
{ "trustserv.de", true },
{ "truthmessages.pw", true },
+ { "truthsayer.tk", true },
{ "truvisory.com", true },
{ "truyenfull.vn", true },
{ "trw-reseller.com", true },
{ "try2admin.pw", true },
{ "try2services.cm", true },
+ { "try2services.vc", true },
{ "trybooking.com", true },
{ "tryfabulousskincream.com", true },
{ "tryfabulousskinserum.com", true },
{ "trygarciniaslimdiet.com", true },
{ "tryhard.cz", true },
+ { "tryhexadecimal.com", true },
+ { "tryitonline.net", true },
{ "trymegadrol.com", true },
{ "tryndraze.com", true },
{ "trynta.com", true },
{ "trynta.net", true },
- { "trypineapple.com", true },
+ { "tryplo.com", true },
+ { "tryplo.io", true },
+ { "tryplo.net", true },
+ { "tryplo.org", true },
{ "tryretool.com", true },
{ "tryupdates.com", true },
{ "trywesayyes.com", true },
{ "trzepak.pl", true },
- { "ts3-legenda.tech", true },
{ "tsa-sucks.com", true },
{ "tsab.moe", true },
{ "tsai.com.de", true },
@@ -38901,7 +40438,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tsundere.moe", true },
{ "tsung.co", true },
{ "tsurai.work", true },
- { "tsurimap.com", true },
{ "tsutsumi-kogyo.jp", true },
{ "tsuyuzakihiroyuki.com", true },
{ "tsv-1894.de", true },
@@ -38913,8 +40449,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ttchan.org", true },
{ "ttclub.fr", true },
{ "ttdsevaonline.com", true },
+ { "ttfin.ch", true },
+ { "ttlet.com", true },
{ "ttll.de", true },
{ "ttrade.ga", true },
+ { "tts-assessments.com", true },
{ "ttsoft.pl", true },
{ "ttsweb.org", true },
{ "ttt.tt", true },
@@ -38924,7 +40463,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tty1.net", true },
{ "ttyystudio.com", true },
{ "tu-immoprojekt.at", true },
- { "tu6.pm", true },
+ { "tuanhstore.com", true },
{ "tuasaude.com", true },
{ "tubanten.nl", true },
{ "tube.tools", true },
@@ -38939,7 +40478,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tucuxi.org", true },
{ "tudiennhakhoa.com", true },
{ "tudorproject.org", true },
- { "tudulinna.ee", true },
+ { "tueplay.host", true },
{ "tuev-hessen.de", true },
{ "tufashionista.com", true },
{ "tuffclassified.com", true },
@@ -38949,8 +40488,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tuingereedschappen.net", false },
{ "tuitle.com", true },
{ "tuja.hu", true },
- { "tulenceria.es", true },
+ { "tujunfang.com", true },
{ "tulumplayarealestate.com", true },
+ { "tumagiri.net", true },
{ "tumblenfun.com", true },
{ "tumedico.es", true },
{ "tumelum.de", true },
@@ -38967,12 +40507,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tunnelwatch.com", true },
{ "tuntitili.fi", true },
{ "tuotteet.org", true },
+ { "tuou.xyz", false },
{ "tupa-germania.ru", true },
{ "tupeuxpastest.ch", true },
{ "tuppenceworth.ie", true },
{ "turdnagel.com", true },
{ "turf-experts.com", true },
{ "turigum.com", true },
+ { "turingmind.com", true },
{ "turismodubrovnik.com", true },
{ "turkish.dating", true },
{ "turkiyen.com", true },
@@ -38991,6 +40533,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tuscanyleather.it", true },
{ "tusi.co", false },
{ "tusksol.com", true },
+ { "tusmedicamentos.com", true },
{ "tutanota.com", true },
{ "tuto-craft.com", true },
{ "tutoragency.org", true },
@@ -39010,7 +40553,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tuxgeo.com", false },
{ "tuxie.com", true },
{ "tuxlife.net", true },
- { "tuxone.ch", true },
{ "tuxpeliculas.com", true },
{ "tuxpi.com", true },
{ "tuxplace.nl", true },
@@ -39031,9 +40573,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tvlanguedoc.com", true },
{ "tvleaks.se", true },
{ "tvlplus.net", true },
+ { "tvs-virtual.cz", true },
{ "tvseries.info", true },
{ "tvsheerenhoek.nl", true },
- { "tvzr.com", true },
+ { "tvzr.com", false },
{ "tw.search.yahoo.com", false },
{ "twaka.com", true },
{ "twalter.de", true },
@@ -39048,6 +40591,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tweedehandslaptophardenberg.nl", true },
{ "tweetfinity.com", true },
{ "tweetfinityapp.com", true },
+ { "twem.ddns.net", true },
{ "twenty71.com", true },
{ "twentymilliseconds.com", true },
{ "twilleys.com", true },
@@ -39070,19 +40614,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "twodadsgames.com", true },
{ "twofactorauth.org", true },
{ "twohuo.com", true },
+ { "twoleftsticks.com", true },
{ "twopif.net", true },
{ "tworaz.net", true },
+ { "twtimmy.com", true },
+ { "twtremind.com", true },
{ "txcap.org", true },
{ "txdivorce.org", true },
{ "txi.su", true },
{ "txlrs.org", true },
{ "txm.pl", true },
+ { "txpi.nsupdate.info", true },
{ "txtecho.com", true },
{ "txurologist.com", true },
+ { "ty5998.com", true },
{ "tyche.io", true },
{ "tycho.org", true },
{ "tycom.cz", true },
- { "tyil.work", true },
{ "tykeplay.com", true },
{ "tyler.rs", true },
{ "tylerdavies.net", true },
@@ -39090,10 +40638,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tylerharcourt.ca", true },
{ "tylerharcourt.com", true },
{ "tylerharcourt.org", true },
+ { "tylermade.net", true },
{ "tyleromeara.com", true },
{ "tylerschmidtke.com", true },
{ "typcn.com", true },
{ "typeblog.net", true },
+ { "typecodes.com", true },
{ "typeof.pw", true },
{ "typeonejoe.com", true },
{ "typeria.net", true },
@@ -39113,8 +40663,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "tyuo-keibi.co.jp", true },
{ "tzermias.gr", true },
{ "tzifas.com", true },
+ { "tzsec.com", true },
+ { "u-chan.com", true },
{ "u-he.com", true },
{ "u-martfoods.com", true },
+ { "u-page.nl", true },
{ "u-tokyo.club", true },
{ "u.nu", true },
{ "u0010.com", true },
@@ -39127,13 +40680,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "u03.fr", true },
{ "u1100.com", true },
{ "u1144.com", true },
+ { "u29dc.com", true },
{ "u2fanlife.com", true },
{ "u2fsecuritykeys.com", true },
{ "u4mh-dev-accesscontroller.azurewebsites.net", true },
{ "u4mh-dev-portal.azurewebsites.net", true },
{ "u5.re", true },
{ "u5b.de", false },
- { "u5eu.com", true },
{ "u5r.nl", true },
{ "ua.search.yahoo.com", false },
{ "uaci.edu.mx", true },
@@ -39145,10 +40698,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ub3rk1tten.com", false },
{ "ubanquity.com", true },
{ "ubcani.com", true },
- { "uberbkk.com", true },
{ "uberboxen.net", true },
{ "uberestimator.com", true },
{ "ubermail.me", true },
+ { "uberpromocodes.us", true },
+ { "uberwald.de", true },
{ "uberwald.ws", true },
{ "ubezpieczeniepsa.com", true },
{ "ubi.gg", true },
@@ -39156,6 +40710,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ubis.company", true },
{ "ubis.group", true },
{ "ublaboo.org", true },
+ { "ubntleaks.com", true },
{ "uborcare.com", true },
{ "ubunlog.com", true },
{ "ubuntu18.com", true },
@@ -39167,10 +40722,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "uchargeapp.com", true },
{ "uclf.de", true },
{ "uclip.club", true },
+ { "ucppe.org", true },
{ "ucrdatatool.gov", true },
{ "uctarna.online", true },
{ "udancy.com", true },
- { "uddi.ng", true },
+ { "udbhav.me", true },
+ { "uddhabhaldar.com", true },
{ "udo-luetkemeier.de", true },
{ "udomain.net", true },
{ "udp.sh", false },
@@ -39181,17 +40738,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ueberdosis.io", true },
{ "ueberwachungspaket.at", true },
{ "uedaviolin.com", true },
- { "uefeng.com", true },
{ "ueni.com", true },
{ "uevan.com", true },
{ "uex.im", true },
{ "ufanisi.mx", true },
{ "ufindme.at", true },
+ { "ufo-blogger.com", true },
{ "ufocentre.com", true },
{ "ufplanets.com", true },
{ "ugb-verlag.de", true },
{ "uggedal.com", true },
{ "ugx-mods.com", true },
+ { "uhasseltctf.be", true },
{ "uhc.gg", true },
{ "uhlhosting.ch", true },
{ "uhrenlux.de", true },
@@ -39202,11 +40760,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "uiop.link", true },
{ "uiterwijk.org", true },
{ "uitgeverij-deviant.nl", true },
+ { "uitvaartvrouwenfriesland.nl", true },
{ "ujob.com.cn", true },
{ "ujvary.eu", true },
{ "uk.dating", true },
{ "uk.search.yahoo.com", false },
- { "ukbc.london", true },
{ "ukchemicalresearch.org", false },
{ "ukclimbing.com", true },
{ "ukdefencejournal.org.uk", true },
@@ -39219,10 +40777,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ukpirate.org", true },
{ "ukrainians.ch", true },
{ "ukrigging.net", true },
+ { "ukrn.io", true },
{ "ukrnet.co.uk", true },
{ "uktw.co.uk", true },
{ "ukulelejim.com", true },
- { "ukunlocks.com", true },
{ "ukwct.org.uk", true },
{ "ulabox.com", true },
{ "uldsh.de", true },
@@ -39239,19 +40797,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ultimate-uk.com", true },
{ "ultimateanu.com", true },
{ "ultimatemafia.net", true },
- { "ultramax.biz", true },
- { "ultraporn.biz", true },
- { "ultraseopro.com", true },
+ { "ultramookie.com", true },
{ "ultratech.software", true },
{ "ultratechlp.com", true },
{ "ultrautoparts.com.au", true },
+ { "uma.vn", true },
{ "umanityracing.com", true },
{ "umbertheprussianblue.com", true },
- { "umbrellaye.online", true },
{ "umbricht.li", true },
{ "umenlisam.com", true },
{ "umisonoda.com", true },
+ { "ummati.com", true },
{ "umsapi.com", true },
+ { "umzuege-berlin.com", true },
+ { "umzuege-hannover.net", true },
+ { "umzuege-wolfsburg.de", true },
+ { "umzug-berlin24.de", true },
+ { "umzug-braunschweig24.de", true },
{ "un-framed.co.za", true },
{ "un-zero-un.fr", true },
{ "un.fo", true },
@@ -39267,16 +40829,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unblocked.cam", true },
{ "unblocked.gdn", true },
{ "unblocked.ink", true },
- { "unblocked.lat", true },
{ "unblocked.live", true },
{ "unblocked.mx", true },
{ "unblocked.one", true },
{ "unblocked.pl", true },
{ "unblocked.pro", true },
{ "unblocked.pub", true },
- { "unblocked.sh", true },
{ "unblocked.uno", true },
- { "unblocked.vc", true },
{ "unblocked.vet", true },
{ "unblocked.vip", true },
{ "unblockweb.co", true },
@@ -39291,10 +40850,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "undef.in", false },
{ "underbridgeleisure.co.uk", true },
{ "undercovercondoms.co.uk", true },
- { "undercovercondoms.com", true },
{ "underfloorheating-uk.co.uk", true },
{ "underlined.fr", true },
{ "undernet.uy", false },
+ { "underskatten.tk", true },
{ "underwearoffer.com", true },
{ "undo.co.il", true },
{ "unece-deta.eu", true },
@@ -39303,6 +40862,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unerosesurlalune.fr", true },
{ "unexpected.nu", true },
{ "unfallrechtler.de", true },
+ { "unfc.nl", true },
{ "unfettered.net", false },
{ "unga.dk", true },
{ "ungaeuropeer.se", true },
@@ -39312,7 +40872,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unicef-karten.at", true },
{ "unicef.pl", true },
{ "unicefcards.cz", true },
- { "unicefcards.gr", true },
{ "unicefcards.it", true },
{ "unicefcards.nl", true },
{ "unicefcards.sk", true },
@@ -39322,6 +40881,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unicefkepeslapok.hu", true },
{ "unicefvoscilnice.si", true },
{ "unicioushop.com", true },
+ { "unicmotos.com", true },
{ "unicolabo.jp", true },
{ "unicorn-systems.net", true },
{ "unicorn.melbourne", true },
@@ -39337,12 +40897,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unifei.edu.br", true },
{ "uniform-agri.com", true },
{ "unijob.com.br", true },
+ { "unik.bg", true },
{ "unikoingold.com", true },
{ "unikrn.space", true },
{ "unila.edu.br", true },
{ "unimbalr.com", true },
{ "unionplat.ru", true },
- { "unionstreetskateboards.com", true },
{ "uniontestprep.com", true },
{ "unipig.de", true },
{ "uniprimebr.com.br", false },
@@ -39356,6 +40916,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unite-ka.de", true },
{ "uniteasia.org", true },
{ "united-coders.com", true },
+ { "united-german-commander.de", true },
{ "united-schools.net", true },
{ "united.com", false },
{ "unitedadmins.com", true },
@@ -39367,11 +40928,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "univeril.com", false },
{ "universal-happiness.com", true },
{ "universal.at", true },
+ { "universalcarpetinc.com", true },
{ "universalcarremote.com", true },
{ "universalpaymentgateway.com", true },
{ "universeinform.com", true },
{ "universidadvg.edu.mx", true },
- { "universogay.com", true },
+ { "universrumbacongolaise.com", true },
{ "univitale.fr", true },
{ "unix.se", true },
{ "unixadm.org", true },
@@ -39379,9 +40941,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unixforum.org", true },
{ "unixfox.eu", true },
{ "unixtime.date", true },
+ { "unkn0wncat.net", true },
{ "unkrn.com", true },
{ "unlax.com", true },
- { "unleash.pw", true },
{ "unli.xyz", true },
{ "unlocken.nl", true },
{ "unlocktalent.gov", true },
@@ -39394,6 +40956,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "unoccupyabq.org", true },
{ "unp.me", true },
{ "unpkg.com", true },
+ { "unpluggedjuice.dk", true },
{ "unpossible.xyz", true },
{ "unpr.dk", true },
{ "unquote.li", true },
@@ -39418,8 +40981,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "untethereddog.com", true },
{ "unun.fi", true },
{ "unusualhatclub.com", true },
+ { "unveiledgnosis.com", true },
{ "unx.dk", true },
{ "unxicdellum.cat", true },
+ { "uoone.com", true },
{ "uotomizu.com", true },
{ "upaknship.com", true },
{ "upakweship.com", true },
@@ -39429,12 +40994,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "upbeatrobot.com", true },
{ "upbeatrobot.eu", true },
{ "upcambio.com", true },
+ { "upcloud.cz", true },
{ "upd.jp", true },
{ "upengo.com", true },
{ "upgamerengine.com", true },
{ "upgamerengine.com.br", true },
{ "upgamerengine.net", true },
- { "upgauged.com", true },
{ "upholsterydesign.com.au", true },
{ "upitnik.rs", true },
{ "uplaqui.com.br", true },
@@ -39450,6 +41015,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "upplevelse.com", true },
{ "upr.com.ua", true },
{ "uprint.it", true },
+ { "upropay.com", true },
{ "uprospr.com", true },
{ "uprouteyou.com", true },
{ "upsettunnel.com", true },
@@ -39479,6 +41045,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "urbandance.club", true },
{ "urbanesecurity.com", true },
{ "urbanguerillas.de", true },
+ { "urbangymfirenze.com", true },
{ "urbanhotbed.eu", true },
{ "urbanietz-immobilien.de", true },
{ "urbanmelbourne.info", true },
@@ -39489,6 +41056,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "urbanwildlifealliance.org", false },
{ "urbanxdevelopment.com", true },
{ "urbexdk.nl", true },
+ { "urbexing.eu", true },
{ "urbizoroofing.com", true },
{ "urcentral.com", true },
{ "urcentral.net", true },
@@ -39511,6 +41079,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "urlscan.io", true },
{ "urltell.com", true },
{ "urltodomain.com", true },
+ { "urnes.org", true },
{ "urown.net", true },
{ "ursa-minor-beta.org", true },
{ "ursae.co", true },
@@ -39519,6 +41088,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "urth.org", true },
{ "uruguay-experience.com", true },
{ "urukproject.org", true },
+ { "usa-10.com", true },
{ "usa-greencard.eu", true },
{ "usaa.com", false },
{ "usabackground.com", true },
@@ -39539,6 +41109,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "usbcraft.com", true },
{ "usbevents.co.uk", true },
{ "usbr.gov", true },
+ { "uscis.gov", true },
{ "uscloud.nl", true },
{ "uscurrency.gov", true },
{ "usd.de", true },
@@ -39557,6 +41128,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "usimmigration.us", true },
{ "usipvd.ch", true },
{ "usitcolours.bg", true },
+ { "uskaria.com", true },
{ "usmint.gov", true },
{ "usninosnikrcni.eu", true },
{ "usnti.com", true },
@@ -39599,16 +41171,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "utonia.ch", true },
{ "utopicestudios.com", true },
{ "utox.io", true },
+ { "utrace.me", true },
{ "utterberry.io", true },
{ "utugnn.ru", true },
{ "utw.me", true },
{ "utwente.io", true },
{ "utzon.net", true },
+ { "uuid.fr", true },
{ "uuit.nl", true },
{ "uv.uy", true },
{ "uvenuse.cz", true },
{ "uvocorp.com", true },
- { "uw1008.com", true },
{ "uw2333.com", true },
{ "uwac.co.uk", false },
{ "uwat.cf", true },
@@ -39617,11 +41190,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "uwvloereruit.nl", true },
{ "uxp-it.nl", true },
{ "uxteam.com", true },
- { "uxtechnologist.com", true },
{ "uy.search.yahoo.com", false },
{ "uz.search.yahoo.com", false },
{ "uzayliyiz.biz", true },
{ "uzaymedya.com.tr", true },
+ { "uze-mobility.com", true },
{ "uziregister.nl", true },
{ "uzpirksana.lv", true },
{ "uzsvm.cz", true },
@@ -39630,6 +41203,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "v-spin.cz", true },
{ "v-tek.fi", true },
{ "v-u-z.ru", true },
+ { "v1sit0r.ru", true },
{ "v2bv.net", true },
{ "v2bv.win", true },
{ "v2cn.win", true },
@@ -39637,6 +41211,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "v2ray6.com", true },
{ "v2ray66.com", true },
{ "v2ray666.com", true },
+ { "v5ray.top", true },
{ "va-reitartikel.com", true },
{ "va.gov", true },
{ "va1der.ca", true },
@@ -39652,7 +41227,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vagaerg.net", true },
{ "vagmour.eu", true },
{ "vagpartsdb.com", true },
- { "vagrantbits.com", true },
{ "vagrantcloud.com", true },
{ "vagrantup.com", true },
{ "vaincreladyslexie.com", false },
@@ -39666,10 +41240,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "valcano.ru", true },
{ "valcansell.com", true },
{ "valcardiesel.com", true },
+ { "valdicass.com", true },
{ "valek.net", true },
{ "valenciadevops.me", true },
{ "valentin-sundermann.de", true },
- { "valentin.ml", true },
{ "valentinberclaz.com", true },
{ "valentineapparel.com", true },
{ "valentineforpresident.com", true },
@@ -39684,6 +41258,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "validator.nu", true },
{ "validbrands.com", true },
{ "valika.ee", true },
+ { "valimised.ee", true },
{ "valis.sx", true },
{ "valkohattu.fi", true },
{ "valkova.net", true },
@@ -39706,9 +41281,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "valtoaho.com", true },
{ "valtool.uk", true },
{ "valudo.st", true },
- { "valuechain.me", true },
+ { "valuehost.com.br", true },
{ "valuemyhome.co.uk", true },
{ "valuemyhome.uk", true },
+ { "valuemywebsite.net", true },
{ "valueng.com", true },
{ "valueofblog.com", true },
{ "valueseed.net", true },
@@ -39740,19 +41316,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vanhoudt-usedcars.be", true },
{ "vanhoutte.be", false },
{ "vanhove.biz", true },
- { "vanlent.net", true },
+ { "vanlaanen.com", false },
{ "vanmalland.com", true },
{ "vannaos.com", true },
{ "vannaos.net", true },
{ "vanouwerkerk.net", true },
{ "vantagepointpreneed.com", true },
- { "vante.me", true },
+ { "vante.me", false },
{ "vantien.com", true },
{ "vantru.is", true },
{ "vanwunnik.com", true },
{ "vapecrunch.com", true },
{ "vapensiero.co.uk", true },
{ "vaperolles.ch", true },
+ { "vapesense.co.uk", true },
{ "vapesupplies.com.au", true },
{ "vapex.pl", true },
{ "vaphone.co", true },
@@ -39765,7 +41342,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "varden.info", true },
{ "vareillefoundation.fr", true },
{ "vareillefoundation.org", true },
- { "varghese.de", true },
{ "variable.agency", false },
{ "variag-group.ru", true },
{ "variag-montazh.ru", true },
@@ -39784,8 +41360,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "varztupasaulis.eu", true },
{ "varztupasaulis.lt", true },
{ "varztupasaulis.net", true },
+ { "vasastansbygg.se", true },
{ "vascomm.co.id", true },
- { "vase-eroticke-povidky.cz", true },
{ "vasel.de", true },
{ "vasel.eu", true },
{ "vashel.us", true },
@@ -39833,7 +41409,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vcsjones.codes", true },
{ "vcsjones.com", true },
{ "vcti.cloud", true },
- { "vctor.net", true },
{ "vd42.net", true },
{ "vda.li", true },
{ "vdanker.net", true },
@@ -39844,11 +41419,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vdisk24.de", true },
{ "vdlp.nl", true },
{ "vdmeij.com", true },
- { "vdownloader.com", true },
+ { "vdzn.net", true },
{ "vdzwan.net", true },
{ "ve.search.yahoo.com", false },
{ "ve3oat.ca", true },
- { "vea.re", true },
{ "veblr.com", false },
{ "vec.ac.nz", true },
{ "vecerkaracing.cz", true },
@@ -39868,13 +41442,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vegetariantokyo.net", true },
{ "veggie-einhorn.de", true },
{ "veggie-treff.de", true },
+ { "veggiesecret.com", true },
{ "vegguide.org", true },
+ { "vegoresto.fr", true },
{ "veii.de", true },
{ "veil-framework.com", true },
+ { "veilofsecurity.com", true },
{ "veincenterbrintonlake.com", true },
{ "veit.zone", true },
{ "veke.fi", true },
+ { "velassoltas.pt", true },
{ "velen.io", true },
+ { "velocom.com.ar", true },
{ "veloroute.hamburg", true },
{ "venalytics.com", true },
{ "venclave.com", true },
@@ -39899,10 +41478,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "venturum.de", true },
{ "venturum.eu", true },
{ "venturum.net", true },
- { "ventzke.com", true },
{ "venuedriver.com", true },
{ "ver.ma", true },
{ "vera.bg", true },
+ { "veracix.ca", true },
{ "veramagazine.jp", true },
{ "verasani.ch", true },
{ "verberne.nu", true },
@@ -39914,7 +41493,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "verein-kiekin.de", true },
{ "verein-zur-pflege-der-geselligkeit.de", true },
{ "vereinlandwege.de", true },
- { "vereinscheck.de", true },
{ "verfassungsklage.at", true },
{ "verge.capital", true },
{ "vergelijksimonly.nl", true },
@@ -39925,7 +41503,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "verifiny.com", true },
{ "verifyos.com", true },
{ "verifyyourip.com", true },
- { "veriny.tf", true },
{ "verios.com.br", true },
{ "veritafineviolins.com", true },
{ "veritas-data.de", true },
@@ -39933,9 +41510,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "verizonconnect.com", false },
{ "verizonguidelines.com", true },
{ "verkeersschoolrichardschut.nl", true },
+ { "verkkopalvelin.fi", true },
{ "verliebt-in-bw.de", true },
{ "verliebt-in-niedersachsen.de", true },
- { "verliefde-jongens.nl", true },
{ "vermeerdealers.com", true },
{ "vermiliontaxiservice.com", true },
{ "vermuetje.nl", true },
@@ -39950,12 +41527,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "veronic.hu", true },
{ "veronique-schmitz.de", true },
{ "verrerie-mousseline.org", true },
- { "verry.org", true },
{ "vers.one", true },
{ "versagercloud.de", true },
{ "versalhost.com", true },
{ "versalhost.nl", true },
{ "versbesteld.nl", true },
+ { "verschoren.com", true },
{ "verschurendegroot.nl", true },
{ "verses.space", true },
{ "versicherungen-werner-hahn.de", true },
@@ -39965,11 +41542,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "verstraetenusedcars.be", true },
{ "vertebrates.com", true },
{ "verteilergetriebe.info", true },
+ { "verticesedge.com", true },
{ "verticrew.com", true },
+ { "vertigo.com.br", true },
{ "vertigo.name", false },
{ "vertner.net", true },
{ "vertrieb-strategie.de", true },
{ "verustracking.com", true },
+ { "vervewellness.co.nz", true },
{ "verwandlung.org", true },
{ "verwayen.com", true },
{ "very-kids.fr", true },
@@ -39987,6 +41567,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vestum.ru", true },
{ "vet-planet.com", true },
{ "vetbits.com", false },
+ { "veteransonline.us", true },
{ "vetergysurveys.com", true },
{ "veterinarian-hospital.com", true },
{ "veterinario.roma.it", true },
@@ -40008,12 +41589,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vgropp.de", true },
{ "vh.net", true },
{ "vhrca.com", true },
- { "vhs-bad-wurzach.de", true },
{ "vhummel.nl", true },
{ "vi.photo", true },
{ "via-shire-krug.ru", true },
{ "via.blog.br", true },
{ "viablog.com.br", true },
+ { "viacation.co", true },
{ "viacdn.org", true },
{ "viafinance.cz", false },
{ "viaggio-in-cina.it", true },
@@ -40021,7 +41602,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "viajandoporelmundo.com.ar", true },
{ "viajaramsterdam.com", true },
{ "viaje-a-china.com", true },
- { "vialibido.com.br", true },
{ "vialorran.com", true },
{ "viaprinto.de", true },
{ "viasinc.com", false },
@@ -40058,6 +41638,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "victory.radio", true },
{ "victoryalliance.us", true },
{ "victorzambrano.com", true },
+ { "vicugna.nl", true },
{ "vicyu.com", true },
{ "vid-immobilien.de", true },
{ "vida-it.com", true },
@@ -40075,7 +41656,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "videosparatodos.com", true },
{ "videospornogratis.pt", true },
{ "videosqr.com", true },
- { "videosxgays.com", true },
{ "videov.tk", true },
{ "vidister.de", true },
{ "vidracariaespelhosbh.com.br", true },
@@ -40096,18 +41676,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vietnamphotoblog.com", true },
{ "vietnamwomenveterans.org", true },
{ "vietplan.vn", true },
- { "vieux.pro", true },
{ "viewbook.com", true },
{ "viewey.com", true },
{ "viewing.nyc", true },
- { "viewmyrecords.com", true },
{ "vigenebio.com", true },
{ "vigilantnow.com", true },
{ "vigliano.ovh", true },
{ "vignoblesdeletat.ch", true },
{ "vigo-krankenversicherung.de", true },
{ "vigo-tarife.de", true },
- { "vigour.us", true },
{ "vigoxatelier.tech", true },
{ "vigrey.com", true },
{ "viikko.cf", true },
@@ -40132,6 +41709,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "villa-eden.cz", true },
{ "villa-gockel.de", true },
{ "villa-romantica-zillertal.at", true },
+ { "villaella.com", true },
{ "villafiore.com.br", true },
{ "villageunique.com.br", true },
{ "villagockel.de", true },
@@ -40155,12 +41733,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vinahost.vn", true },
{ "vinarstvimodryhrozen.cz", true },
{ "vincentcox.com", false },
- { "vincentoshana.com", true },
{ "vincentpancol.com", true },
{ "vincentswordpress.nl", true },
{ "vincible.space", true },
{ "vinciconps4.it", true },
{ "vincitraining.com", true },
+ { "vindipoker.dk", true },
{ "vinetech.co.nz", true },
{ "vingt.me", true },
{ "vinilosdecorativos.net", true },
@@ -40190,31 +41768,35 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vionicshoes.co.uk", true },
{ "vionicshoes.com", true },
{ "vip8522.com", true },
- { "vipi.es", true },
+ { "vipllcnj.com", true },
{ "viptamin.eu", true },
{ "viptamol.com", true },
{ "viqo.pl", true },
- { "vir-tec.eu", true },
+ { "vir-tec.eu", false },
{ "vir2.me", true },
{ "viral32111.com", true },
{ "viralpop.it", true },
{ "viralsouls.in", true },
- { "viralsv.com", true },
- { "virgopolymer.com", false },
+ { "virgopolymer.com", true },
{ "viridis-milites.cz", true },
{ "virtit.fr", true },
{ "virtual.hk", true },
{ "virtualcloud.ddns.net", true },
{ "virtualcommodities.org", true },
{ "virtuality4d.com", true },
+ { "virtualizy.de", true },
{ "virtuallifestyle.nl", true },
{ "virtualmt2.pl", true },
{ "virtualsanity.com", true },
{ "virtualspeech.com", true },
{ "virtualvaults.com", true },
{ "virtubox.net", true },
+ { "virtuebags.com", true },
+ { "virtus-group.com", true },
{ "virtusaero.com", true },
+ { "virus.pm", true },
{ "virvum.ch", true },
+ { "visadaifu.com", true },
{ "visaexpert.co.za", true },
{ "visalist.io", true },
{ "visalogy.com", true },
@@ -40235,12 +41817,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "visionexpresscareers.com", true },
{ "visionless.me", false },
{ "visionnissancanandaiguaparts.com", true },
+ { "visionviral.com", true },
{ "visit-montenegro.com", true },
{ "visitbeulah.com", true },
{ "visitcambridgeshirefens.org", true },
{ "visitkangaroovalley.com.au", true },
{ "visitmaine.com", true },
{ "visor.ph", true },
+ { "vista-research-group.com", true },
{ "vistaalmar.es", true },
{ "vistacampus.gov", true },
{ "vistastylebuilder.com", false },
@@ -40251,19 +41835,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "visual-concept.net", true },
{ "visualdrone.co", true },
{ "visualgrafix.com.mx", true },
+ { "visualideas.org", true },
{ "visualizing.info", true },
{ "visualmasters.nl", true },
{ "visudira.com", true },
{ "vitahook.pw", true },
+ { "vital-tel.co.uk", true },
+ { "vitalastin-sport.de", true },
{ "vitalia.cz", true },
{ "vitalismaatjes.nl", true },
{ "vitalityscience.com", true },
- { "vitalium-therme.de", true },
{ "vitalthrills.com", true },
{ "vitalware.com", true },
{ "vitalyzhukphoto.com", true },
+ { "vitamina.cl", true },
+ { "vitamina.com", true },
{ "vitaminler.com", true },
- { "vitapingu.de", true },
{ "vitastic.nl", true },
{ "vitavie.nl", true },
{ "viteoscrm.ch", true },
@@ -40281,12 +41868,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vivaldi.com", true },
{ "vivanosports.com.br", false },
{ "vivatv.com.tw", true },
+ { "vive.link", true },
{ "vivendi.de", true },
{ "viveport.com", true },
{ "vivianmaier.cn", true },
{ "vivid-academy.com", true },
{ "vividinflatables.co.uk", true },
{ "vividlumen.com", true },
+ { "viviendy.com", true },
{ "viviennevandenbos.nl", true },
{ "vivirenelmundo.com", true },
{ "vivo.sx", true },
@@ -40303,13 +41892,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vjhfoundation.org", true },
{ "vjirovsky.cz", false },
{ "vjpatel.me", true },
- { "vk4wip.org.au", true },
+ { "vk-k.com", true },
{ "vkb-remont.ru", true },
{ "vkennke.org", true },
{ "vkino.com", false },
{ "vkirichenko.name", true },
{ "vkox.com", true },
{ "vksportphoto.com", true },
+ { "vladimiroff.org", true },
{ "vladislavstoyanov.com", true },
{ "vlakem.net", true },
{ "vlakjebak.nl", true },
@@ -40335,11 +41925,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vmoagents.com", false },
{ "vmoe.info", true },
{ "vmug.pl", true },
- { "vmzone.de", true },
{ "vn.search.yahoo.com", false },
{ "vncg.org", true },
{ "vnd.cloud", true },
- { "vndb.org", true },
{ "vnpay.vn", true },
{ "vnvisa.center", true },
{ "vnvisa.ru", true },
@@ -40369,6 +41957,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vojtechpavelka.cz", true },
{ "vokativy.cz", true },
{ "vokeapp.com", true },
+ { "vokurka.net", true },
{ "volcanconcretos.com", true },
{ "volcano-kazan.ru", true },
{ "volcano-spb.ru", true },
@@ -40383,11 +41972,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "volkerwesselstransfer.nl", false },
{ "volksvorschlagpmar.ch", true },
{ "vollans.id.au", true },
- { "vollmondstollen.de", true },
{ "voloevents.com", true },
{ "volqanic.com", true },
{ "volta.io", true },
- { "voltahurt.pl", true },
+ { "voltahurt.pl", false },
{ "volto.io", true },
{ "volunteeringmatters.org.uk", true },
{ "vomitb.in", true },
@@ -40395,19 +41983,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vonborstelboerner.de", true },
{ "vonniehudson.com", true },
{ "vonski.pl", true },
- { "vonterra.us", true },
{ "voodoochile.at", true },
+ { "voolik.pw", true },
{ "voorjou.com", true },
{ "vop.li", true },
{ "vorlage-musterbriefe.de", true },
{ "vorlage-mustervertrag.de", true },
{ "vorlagen-geburtstagsgruesse.de", true },
{ "vorlicek.de", true },
- { "vorlif.org", true },
{ "vorm2.com", true },
{ "vorodevops.com", true },
- { "vos-fleurs.ch", true },
- { "vos-fleurs.com", true },
{ "vos-systems.com", true },
{ "vos-systems.es", true },
{ "vos-systems.eu", true },
@@ -40428,10 +42013,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "votoot.com", true },
{ "vouchinsurance.sg", true },
{ "vovladikavkaze.ru", true },
- { "vowsy.club", true },
{ "voxfilmeonline.net", true },
{ "voxml.com", true },
{ "voxographe.com", false },
+ { "voxpopuli.com", true },
{ "voya.ga", true },
{ "voyage-martinique.fr", true },
{ "voyageforum.com", true },
@@ -40439,7 +42024,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "voyagesaufildespages.be", true },
{ "voyageschine.com", true },
{ "voyagesdetective.fr", true },
- { "vozami.com", true },
{ "vpc-display.com", true },
{ "vpn.black", true },
{ "vpn.ht", true },
@@ -40449,11 +42033,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vpsao.org", true },
{ "vpsboard.com", true },
{ "vpsdream.dk", true },
- { "vpsou.com", true },
+ { "vpsou.com", false },
{ "vpsport.ch", true },
{ "vpsproj.dynu.net", true },
{ "vpsvz.net", true },
- { "vqporn.com", true },
+ { "vragenvanproust.nl", true },
{ "vrandopulo.ru", true },
{ "vrcholovka.cz", true },
{ "vrcprofile.com", true },
@@ -40465,7 +42049,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vrijgezellen-feest.com", true },
{ "vrijgezellenfeestzwolle.com", true },
{ "vrjetpackgame.com", true },
- { "vrlaid.com", false },
{ "vroedvrouwella.be", true },
{ "vroyaltours.com", true },
{ "vrsystem.com.br", true },
@@ -40488,6 +42071,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vtt-hautsdefrance.fr", true },
{ "vtuber.art", true },
{ "vuakhuyenmai.vn", true },
+ { "vuatruyen.com", true },
{ "vubey.yt", true },
{ "vuilelakens.be", true },
{ "vuljespaarpot.nl", true },
@@ -40522,25 +42106,26 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "vwsoft.de", true },
{ "vx.hn", true },
{ "vxstream-sandbox.com", true },
+ { "vxz.me", true },
{ "vybeministry.org", true },
{ "vyber-odhadce.cz", true },
{ "vyberodhadce.cz", true },
{ "vyplnto.cz", true },
{ "vysko.cz", true },
{ "vyskocil.eu", true },
+ { "vytea.com", true },
{ "vyvygen.org", true },
{ "vzce.cn", true },
{ "vzis.org", true },
{ "vztekloun.cz", true },
- { "w-p-k.de", true },
{ "w-spotlight.appspot.com", true },
{ "w-w-auto.de", true },
{ "w.wiki", true },
{ "w1n73r.de", true },
{ "w2n.me", true },
{ "w3ctag.org", true },
+ { "w3n14izy.ml", true },
{ "w4.no", true },
- { "w4b.in", true },
{ "w4eg.de", true },
{ "w4nvu.org", true },
{ "w50.co.uk", true },
@@ -40563,17 +42148,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wacky.one", true },
{ "wadidi.com", true },
{ "wadsworth.gallery", true },
+ { "wadvisor.com", true },
{ "waelisch.de", true },
- { "waelti.xxx", true },
{ "waf.ninja", true },
{ "waf.sexy", true },
{ "wafelland.be", true },
+ { "waffenversand-klausing.de", true },
{ "waffle.at", false },
{ "wafuton.com", true },
+ { "waggs.link", true },
{ "wagyu-bader.de", true },
- { "wahhoi.net", true },
{ "wahidhasan.com", true },
- { "wahlen-bad-wurzach.de", true },
{ "wahlman.org", true },
{ "wahrnehmungswelt.de", true },
{ "wahrnehmungswelten.de", true },
@@ -40582,9 +42167,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "waifu-technologies.moe", true },
{ "waigel.org", true },
{ "waikatowebdesigners.com", true },
- { "wains.be", false },
+ { "wail.net", true },
{ "wait.jp", true },
- { "waiterwheels.com", true },
{ "waits.io", true },
{ "wajtc.com", true },
{ "wak.io", true },
@@ -40629,11 +42213,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "walravensax.nl", true },
{ "walruses.org", true },
{ "walshbanks.com", true },
- { "waltellis.com", true },
{ "walter.lc", true },
{ "waltervictor.com", true },
{ "waltzmanplasticsurgery.com", true },
{ "walvi.nl", true },
+ { "wammu.eu", true },
{ "wan.pp.ua", false },
{ "wanda.ch", true },
{ "wandelreizen.eu", true },
@@ -40648,19 +42232,22 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wangbangyu.ml", true },
{ "wangbangyu.tk", true },
{ "wangejiba.com", true },
+ { "wangjun.me", true },
{ "wangqiliang.cn", true },
{ "wangqiliang.com", true },
+ { "wangqiliang.org", true },
{ "wangql.net", true },
{ "wangqr.tk", true },
{ "wangriwu.com", true },
{ "wangtanzhang.com", true },
+ { "wangwenbo.cn", false },
{ "wangwill.me", true },
{ "wangyubao.cn", true },
{ "wangyue.blog", true },
{ "wangzuan168.cc", true },
{ "wanlieyan.com", true },
{ "wannaridecostarica.com", true },
- { "wanvi.net", false },
+ { "wanquanojbk.com", false },
{ "wanybug.cf", true },
{ "wanybug.com", true },
{ "wanybug.ga", true },
@@ -40680,20 +42267,30 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "warekit.io", true },
{ "warenits.at", false },
{ "warenmedia.com", true },
+ { "warfield.org.uk", true },
{ "wargameexclusive.com", true },
{ "warhaggis.com", true },
+ { "warmtepomp.express", true },
{ "waroengkoe-shop.com", true },
{ "warofelements.de", true },
+ { "warp-radio.com", true },
+ { "warp-radio.net", true },
+ { "warp-radio.tv", true },
{ "warr.ath.cx", true },
{ "warringtonkidsbouncycastles.co.uk", true },
{ "warschild.org", true },
{ "warsh.moe", true },
{ "warsonco.com", true },
{ "wartorngalaxy.com", true },
+ { "wasabiwallet.co", true },
+ { "wasabiwallet.io", true },
+ { "waschmaschinen-dienst.de", true },
{ "waschpark-hantschel.de", true },
+ { "wasd.ms", true },
{ "wasema.com", true },
{ "wasfestes.de", true },
{ "wasfuereintheater.com", true },
+ { "wasgehtheute.in", true },
{ "washingtonregisteredagent.io", true },
{ "washingtonviews.com", true },
{ "wasi-net.de", true },
@@ -40710,7 +42307,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "watchinventory.com", true },
{ "watchonline.al", true },
{ "watchparts-and-tools-okayama.co.jp", true },
- { "watchpci.com", true },
{ "watchstyle.com", true },
{ "water-addict.com", true },
{ "waterbrook.com.au", true },
@@ -40728,8 +42324,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "watfordjc.uk", true },
{ "watoo.tech", true },
{ "watsonwork.me", true },
+ { "wattmaedchen.de", true },
{ "watvindtnederland.com", true },
- { "waukeect.com", true },
+ { "wav-productions.com", true },
{ "wave.is", true },
{ "wave.red", true },
{ "wavengine.com", true },
@@ -40761,8 +42358,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wbx.support", true },
{ "wby.gd", true },
{ "wby.tw", true },
+ { "wc1234.cn", true },
{ "wcbook.ru", false },
{ "wcn.life", false },
+ { "wcosmeticsurgery.com", true },
{ "wcrca.org", true },
{ "wcsi.com", true },
{ "wcwcg.net", true },
@@ -40777,6 +42376,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "we-run-linux.de", true },
{ "we-use-linux.de", true },
{ "weacceptbitcoin.gr", true },
+ { "wealthings.net", true },
{ "wealthprojector.com", true },
{ "wealthprojector.com.au", true },
{ "wealthreport.com.au", true },
@@ -40784,7 +42384,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "weare1inspirit.com", true },
{ "wearebfi.co.uk", true },
{ "wearegenki.com", true },
- { "wearehackerone.com", true },
{ "wearepapermill.co", true },
{ "wearesouthafricans.com", true },
{ "wearvr.com", true },
@@ -40796,6 +42395,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "web-art.cz", true },
{ "web-design.co.il", true },
{ "web-dl.cc", true },
+ { "web-fox23.ru", true },
{ "web-hotel.gr", true },
{ "web-jive.com", true },
{ "web-kouza.com", true },
@@ -40819,7 +42419,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "webaholic.co.in", true },
{ "webais.ru", true },
{ "webalert.cz", true },
- { "webambacht.nl", true },
{ "webandmore.de", true },
{ "webappky.cz", true },
{ "webartex.ru", true },
@@ -40837,19 +42436,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "webcurtaincall.com", true },
{ "webdemaestrias.com", true },
{ "webdesign-st.de", true },
- { "webdesigneauclaire.com", true },
{ "webdesignerinwarwickshire.co.uk", true },
{ "webdesignlabor.ch", true },
{ "webdesignplay.com", true },
{ "webdesignplayground.io", true },
{ "webdesignsandiego.com", true },
+ { "webdev-cw.me", true },
{ "webdevops.io", true },
- { "webdevxp.com", true },
{ "webdl.org", true },
{ "webduck.nl", false },
{ "webeast.eu", true },
- { "webeau.com", true },
- { "webeditors.com", true },
{ "webergrillrestaurant.com", true },
{ "webev.ru", true },
{ "webexample.win", true },
@@ -40869,12 +42465,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "webhost.guide", true },
{ "webhostingzzp.nl", false },
{ "webhostplan.info", true },
+ { "webhotelli.website", true },
+ { "webia.in.th", true },
{ "webies.ro", true },
{ "webinnovation.ie", true },
+ { "webionite.com", true },
{ "webjobposting.com", true },
{ "webkef.com", true },
{ "webkeks.org", true },
{ "weblagring.se", true },
+ { "weblate.com", true },
+ { "weblate.cz", true },
{ "weblate.org", true },
{ "webliberty.ru", true },
{ "webline.ch", true },
@@ -40885,6 +42486,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "webmail.schokokeks.org", false },
{ "webmail.xalqbank.az", true },
{ "webmandesign.eu", true },
+ { "webmediaprint.at", true },
{ "webmedpharmacy.co.uk", true },
{ "webmetering.at", true },
{ "webministeriet.net", true },
@@ -40894,8 +42496,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "webnetforce.net", true },
{ "webnexty.com", true },
{ "webogram.org", false },
+ { "webperformance.io", true },
{ "webpinoytambayan.net", true },
{ "webpinoytv.info", true },
+ { "webplatform.fi", true },
{ "webpostingmart.com", true },
{ "webpostingpro.com", true },
{ "webpostingreviews.com", true },
@@ -40944,7 +42548,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "webtropia.com", false },
{ "webukhost.com", true },
{ "webutils.io", true },
- { "webvisum.de", true },
{ "webwednesday.nl", true },
{ "webwelearn.com", true },
{ "webwinkelexploitatie.nl", true },
@@ -40958,20 +42561,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wecleanbins.com", true },
{ "wecobble.com", true },
{ "weddingdays.tv", true },
+ { "weddingenvelopes.co.uk", false },
{ "weddingofficiantwilmington.com", true },
{ "weddingsbynoon.co.uk", true },
{ "weddywood.ru", false },
+ { "wedestock.com", true },
{ "wedg.uk", true },
{ "wedos.com", true },
+ { "wedplay.host", true },
{ "weebl.me", true },
{ "weeblr.com", true },
{ "weeblrpress.com", true },
{ "weedlife.com", true },
- { "weednews.co", true },
{ "weedupdate.com", true },
{ "weedworthy.com", true },
{ "weedypedia.de", true },
- { "week.report", true },
{ "weekdone.com", true },
{ "weekendinitaly.com", true },
{ "weekly-residence.com", true },
@@ -40989,9 +42593,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wefinanceinc.com", true },
{ "wefitboilers.com", true },
{ "weforgood.org.tw", true },
+ { "wegerecht.org", true },
{ "wegonnagetsued.org", true },
{ "wegotcookies.com", true },
{ "wegrzynek.org", true },
+ { "wegrzynek.pl", true },
{ "wegvielfalt.de", true },
{ "wehostdnn.com", true },
{ "weibomiaopai.com", true },
@@ -41016,7 +42622,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "weiterbildung-vdz.de", true },
{ "weitergedacht.eu", true },
{ "weizenspr.eu", true },
- { "welcome-tahiti.com", true },
{ "welcome-werkstatt.com", true },
{ "welcome-werkstatt.de", true },
{ "welcome26.ch", true },
@@ -41066,6 +42671,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "werally.com", true },
{ "werbe-markt.de", true },
{ "werbe-sonnenbrillen.de", true },
+ { "werbeagentur.de", true },
{ "werbedesign-tauber.de", true },
{ "werbefotograf-leitner.de", true },
{ "werbefotografie-leitner.de", true },
@@ -41086,6 +42692,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "werkgroepderdewereld.nl", true },
{ "werkgroeppaleisparkhetloo.nl", true },
{ "werkinc.de", true },
+ { "werkinholland.com", true },
{ "werkkrew.xyz", true },
{ "werkslimreisslim.nl", true },
{ "werkstattkinder.de", true },
@@ -41093,8 +42700,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "werktor.net", true },
{ "wermeester.com", true },
{ "werner-ema.de", true },
- { "werner-schaeffer.de", true },
- { "wernerschaeffer.de", true },
{ "werpo.com.ar", true },
{ "wertheimer-burgrock.de", true },
{ "wertpapiertreuhand.de", true },
@@ -41118,6 +42723,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "westcoastcastles.com", true },
{ "westcoastmarineadvisor.com", true },
{ "westcode.de", true },
+ { "westcommunitycu.org", true },
{ "westcountrystalking.com", true },
{ "westendwifi.net", true },
{ "westernfrontierins.com", true },
@@ -41158,6 +42764,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wexfordbouncycastles.ie", true },
{ "wexilapp.com", true },
{ "weyland-yutani.org", true },
+ { "weymouthslowik.com", true },
{ "wezartt.com", true },
{ "wezl.net", true },
{ "wf-bigsky-master.appspot.com", true },
@@ -41170,9 +42777,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wf-training-hrd.appspot.com", true },
{ "wf-training-master.appspot.com", true },
{ "wf-trial-hrd.appspot.com", true },
+ { "wfcp1010.com", true },
{ "wfh.ovh", true },
{ "wfh.se", true },
{ "wforum.nl", true },
+ { "wfsystem.net", true },
{ "wft-portfolio.nl", true },
{ "wg-steubenstrasse.de", true },
{ "wg3k.us", false },
@@ -41181,6 +42790,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wgplatform.co.uk", true },
{ "wgraphics.ru", true },
{ "wgsi-friesland.nl", true },
+ { "wgtrm.com", true },
{ "wh-guide.de", true },
{ "what-wood.servehttp.com", true },
{ "whatagreatwebsite.net", true },
@@ -41211,16 +42821,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "whatwebcando.today", true },
{ "whatwg.org", true },
{ "whd-guide.de", true },
- { "wheatgra.in", true },
{ "wheatley.nl", true },
- { "wheelwide.co.uk", true },
+ { "wheeler.kiwi.nz", true },
{ "wheelwork.org", true },
{ "wheezie.be", true },
{ "when.fm", false },
{ "where2trip.com", true },
{ "whereiszakir.com", true },
{ "wheresbuzz.com.au", true },
- { "whexit.nl", true },
{ "whey-protein.ch", true },
{ "whiletrue.run", true },
{ "whing.org", true },
@@ -41277,9 +42885,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "whoami.io", true },
{ "whocalld.com", true },
{ "whocalled.us", true },
+ { "whocalledme.xyz", true },
{ "whocybered.me", true },
{ "whoimg.com", false },
- { "whoisdhh.com", true },
{ "whoisthenightking.com", true },
{ "whoiswp.com", true },
{ "wholesalecbd.com", true },
@@ -41308,6 +42916,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wichitafoundationpros.com", true },
{ "wick-machinery.com", true },
{ "wickelfischfrance.fr", true },
+ { "wickerliving.com", true },
{ "wickrath.net", true },
{ "wideboxmacau.com", false },
{ "widegab.com", true },
@@ -41340,6 +42949,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wiimotion.de", true },
{ "wijaya.net", true },
{ "wijnbesteld.nl", true },
+ { "wijnimportjanssen.nl", true },
{ "wijnservices.nl", false },
{ "wijzijnwolf.nl", true },
{ "wiki-play.ru", true },
@@ -41361,6 +42971,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wikihow.vn", true },
{ "wikileaks.com", true },
{ "wikileaks.org", true },
+ { "wikilivres.ca", true },
{ "wikimedia.org", true },
{ "wikimediafoundation.org", true },
{ "wikimilk.org", true },
@@ -41377,7 +42988,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wilane.org", true },
{ "wilcodeboer.me", true },
{ "wild-turtles.com", true },
- { "wildboaratvparts.com", true },
{ "wildcatdiesel.com.au", true },
{ "wilddogdesign.co.uk", true },
{ "wildercerron.com", true },
@@ -41404,6 +43014,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "williamboulton.co.uk", true },
{ "williamfeely.info", true },
{ "williamjohngauthier.net", true },
+ { "williamle.com", true },
{ "williampuckering.com", true },
{ "williamscomposer.com", true },
{ "williamsonshore.com", true },
@@ -41421,7 +43032,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "willvision.com", true },
{ "willywangstory.com", true },
{ "willywangstory.com.tw", true },
- { "willywangstory.org", true },
{ "wiloca.it", true },
{ "wilseyrealty.com", true },
{ "wimachtendienk.com", true },
@@ -41437,6 +43047,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "winddan.nz", true },
{ "windelnkaufen24.de", true },
{ "windforme.com", true },
+ { "windictus.net", true },
{ "windowcleaningexperts.net", true },
{ "windows-support.nu", true },
{ "windows-support.se", true },
@@ -41453,6 +43064,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wineparis.com", true },
{ "winepress.org", true },
{ "winfieldchen.me", true },
+ { "winfographics.com", true },
{ "winghill.com", true },
{ "wingify.com", true },
{ "wingmin.net", true },
@@ -41466,7 +43078,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wint.global", true },
{ "winter-auszeit.de", true },
{ "winter-elektro.de", true },
- { "winter.engineering", false },
{ "winterbergwebcams.com", true },
{ "wintercam.nl", true },
{ "winterfeldt.de", true },
@@ -41504,8 +43115,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wisv.ch", true },
{ "wisweb.no", true },
{ "wit.ai", true },
+ { "witch-spells.com", true },
{ "with-environment.com", true },
{ "with-planning.co.jp", true },
+ { "withdewhua.space", true },
{ "withextraveg.net", true },
{ "withgoogle.com", true },
{ "withinsecurity.com", true },
@@ -41517,6 +43130,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "witway.nl", false },
{ "wivoc.nl", true },
{ "wiz.at", true },
+ { "wiz.biz", true },
{ "wizardbouncycastles.co.uk", true },
{ "wizzair.com", true },
{ "wizzley.com", true },
@@ -41547,6 +43161,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wm-talk.net", true },
{ "wmaccess.com", true },
{ "wmaccess.de", true },
+ { "wmcns.net", true },
{ "wmfusercontent.org", true },
{ "wmkowa.de", true },
{ "wmnrj.com", true },
@@ -41557,11 +43172,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wobble.ninja", true },
{ "wobblywotnotz.co.uk", true },
{ "woblex.cz", true },
+ { "wochennummern.de", true },
{ "wodinaz.com", true },
{ "wodka-division.de", true },
{ "woelkchen.me", true },
{ "wofflesoft.com", true },
- { "wofford-ecs.org", true },
+ { "wofford-ecs.org", false },
{ "woffs.de", true },
{ "wogo.org", true },
{ "woheni.de", true },
@@ -41569,9 +43185,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wohlpa.de", true },
{ "wohnbegleitung.ch", true },
{ "wohnsitz-ausland.com", true },
+ { "wojak.xyz", true },
{ "wokinghammotorhomes.com", true },
{ "wolfachtal-alpaka.de", true },
{ "wolfarth.info", true },
+ { "wolfcrow.com", true },
+ { "wolfdev.fr", true },
{ "wolfermann.org", true },
{ "wolferstetterkeller.de", true },
{ "wolfgang-braun.info", true },
@@ -41593,6 +43212,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wollwerk.org", true },
{ "wolszon.me", true },
{ "woltlab-demo.com", true },
+ { "womb.city", true },
{ "wombatalla.com.au", true },
{ "wombatnet.com", true },
{ "wombats.net", true },
@@ -41618,22 +43238,24 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wood-crafted.uk", true },
{ "woodbury.io", true },
{ "woodcoin.org", true },
- { "woodenson.com", true },
{ "woodev.us", true },
{ "woodinvillesepticservice.net", true },
+ { "woodlandboys.com", true },
{ "woodlandhillselectrical.com", true },
{ "woodlandsmetro.church", false },
{ "woodlandsvale.uk", true },
{ "woodlandwindows.com", true },
{ "woodomat.com", true },
{ "woodsidepottery.ca", true },
+ { "woodsmillparkapartmentsstl.com", true },
{ "woodstocksupply.com", true },
{ "woof.gq", true },
- { "woofsbakery.com", true },
{ "woohooyeah.nl", true },
{ "woonboulevardvolendam.nl", true },
{ "woontegelwinkel.nl", true },
+ { "wooplagaming.com", true },
{ "wootware.co.za", true },
+ { "wopplan.de", true },
{ "wopr.network", true },
{ "worca.de", true },
{ "worcade.com", true },
@@ -41644,6 +43266,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "word-grabber.com", true },
{ "wordcounter.net", true },
{ "wordher.com", true },
+ { "wordnietvindbaar.nl", true },
+ { "wordplay.one", true },
{ "wordpress.com", false },
{ "wordsmart.it", true },
{ "wordspy.com", true },
@@ -41680,6 +43304,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "worldofarganoil.com", true },
{ "worldofbelia.de", true },
{ "worldofparties.co.uk", true },
+ { "worldofvnc.net", true },
{ "worldofwobble.co.uk", true },
{ "worldpeacetechnology.com", true },
{ "worldrecipes.eu", true },
@@ -41687,10 +43312,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "worldsinperil.it", true },
{ "worldsoccerclips.com", true },
{ "worldstone777.com", true },
+ { "worldsy.com", true },
{ "worldtalk.de", true },
{ "wormbytes.ca", true },
{ "worst.horse", false },
{ "wort-suchen.de", true },
+ { "woshiluo.com", true },
{ "woshiluo.site", true },
{ "wot-tudasbazis.hu", true },
{ "woti.dedyn.io", true },
@@ -41723,16 +43350,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wp-webagentur.de", true },
{ "wpac.de", true },
{ "wpandup.org", true },
+ { "wpbook-pacificmall.work", true },
+ { "wpboot.com", true },
{ "wpcanban.com", true },
{ "wpccu-cdn.org", true },
{ "wpccu.org", true },
- { "wpcdn.bid", true },
{ "wpcharged.nz", true },
+ { "wpcs.pro", true },
{ "wpdirecto.com", true },
{ "wpenhance.com", true },
{ "wpexplorer.com", true },
{ "wpformation.com", true },
{ "wpgoblin.com", true },
+ { "wpherc.com", true },
{ "wphostingblog.nl", true },
{ "wpinter.com", true },
{ "wpldn.uk", true },
@@ -41751,7 +43381,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wpsitemovers.com", true },
{ "wpsmackdown.com", true },
{ "wpsnelheid.nl", true },
- { "wpsono.com", true },
{ "wpthaiuser.com", true },
{ "wptomatic.de", true },
{ "wptorium.com", true },
@@ -41805,6 +43434,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wsgvet.com", true },
{ "wsl.sh", true },
{ "wsldp.com", true },
+ { "wsp-center.com", true },
{ "wsspalluto.de", true },
{ "wstudio.ch", true },
{ "wstx.com", true },
@@ -41821,9 +43451,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wtpmj.com", true },
{ "wtup.net", true },
{ "wtw.io", true },
+ { "wuav.net", true },
{ "wucke13.de", true },
{ "wuerfel.wf", true },
{ "wuerfelmail.de", true },
+ { "wug.fun", true },
{ "wug.jp", true },
{ "wug.news", true },
{ "wuifan.com", true },
@@ -41847,7 +43479,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wuyue.photo", true },
{ "wv-n.de", true },
{ "wvg.myds.me", true },
- { "wvv-8522.com", true },
+ { "ww-design.ch", true },
{ "ww0512.com", true },
{ "ww2onlineshop.com", true },
{ "wweforums.net", true },
@@ -41856,6 +43488,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wwv-8722.com", true },
{ "www-33445.com", true },
{ "www-49889.com", true },
+ { "www-5287.com", true },
{ "www-68277.com", true },
{ "www-8522.am", true },
{ "www-8522.com", true },
@@ -41941,9 +43574,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wxdisco.com", true },
{ "wxforums.com", true },
{ "wxh.jp", true },
- { "wxkxsw.com", true },
{ "wxlog.cn", true },
- { "wxster.com", true },
{ "wxzm.sx", true },
{ "wyam.io", true },
{ "wybar.uk", true },
@@ -41952,8 +43583,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wygibanki.pl", true },
{ "wygodnie.pl", true },
{ "wyhpartnership.co.uk", true },
+ { "wyldfiresignage.com", true },
+ { "wylog.ph", true },
{ "wynterhill.co.uk", true },
{ "wyo.cam", true },
+ { "wyomingexiles.com", true },
{ "wypemagazine.se", true },
{ "wyrickstaxidermy.com", true },
{ "wyrihaximus.net", true },
@@ -41963,22 +43597,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "wyydsb.com", true },
{ "wyydsb.xin", true },
{ "wyysoft.tk", true },
+ { "wyzphoto.nl", true },
{ "wzfou.com", true },
+ { "wzilverschoon.nl", true },
{ "wzrd.in", true },
{ "wzyboy.org", true },
+ { "x-iweb.ru", true },
{ "x-lan.be", true },
{ "x-one.co.jp", true },
{ "x.io", true },
{ "x.st", true },
{ "x0r.be", true },
{ "x13.com", true },
- { "x1616.tk", true },
{ "x2d2.de", false },
{ "x378.ch", true },
{ "x509.io", true },
{ "x64architecture.com", true },
- { "x69.biz", true },
- { "x69x.net", true },
+ { "x6r3p2yjg1g6x7iu.myfritz.net", true },
{ "x7plus.com", true },
{ "xa.search.yahoo.com", false },
{ "xa1.uk", true },
@@ -41988,24 +43623,19 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xanadu-taxi.cz", true },
{ "xanadu-trans.cz", true },
{ "xanax.pro", false },
+ { "xanderbron.tech", true },
{ "xants.de", true },
{ "xatr0z.org", false },
- { "xb6638.com", true },
- { "xb6673.com", true },
- { "xb851.com", true },
- { "xb862.com", true },
- { "xb913.com", true },
- { "xb917.com", true },
- { "xb925.com", true },
- { "xb927.com", true },
- { "xb965.com", true },
- { "xb983.com", true },
+ { "xavierdmello.com", true },
+ { "xb83studio.ch", true },
{ "xbb.hk", true },
{ "xbb.li", true },
+ { "xbc.nz", true },
{ "xblau.com", true },
{ "xboxdownloadthat.com", true },
{ "xboxlivegoldshop.nl", true },
{ "xboxonex.shop", true },
+ { "xbpay88.com", true },
{ "xbrl.online", true },
{ "xbrlsuccess.appspot.com", true },
{ "xbt.co", true },
@@ -42014,11 +43644,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xceedgaming.com", true },
{ "xcentricmold.com", true },
{ "xclirion-support.de", true },
+ { "xcmfu.com", true },
{ "xcorpsolutions.com", true },
{ "xcvb.xyz", true },
{ "xd.cm", true },
{ "xdavidhu.me", true },
- { "xdawn.cn", true },
{ "xdeftor.com", true },
{ "xdos.io", true },
{ "xdtag.com", true },
@@ -42029,13 +43659,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xeiropraktiki.gr", true },
{ "xelesante.jp", true },
{ "xendo.net", true },
+ { "xenolith.eu", true },
{ "xenomedia.nl", true },
{ "xenon.cloud", true },
{ "xenoncloud.net", true },
{ "xenophile.name", true },
{ "xenotropegames.com", true },
{ "xenoworld.de", true },
+ { "xentho.net", true },
{ "xentox.com", true },
+ { "xenum.ua", true },
{ "xerblade.com", true },
{ "xerhost.de", true },
{ "xerkus.pro", true },
@@ -42043,30 +43676,36 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xeryus.nl", true },
{ "xetown.com", true },
{ "xf-liam.com", true },
+ { "xf5888.com", true },
{ "xfce.space", true },
{ "xfcy.me", true },
{ "xfd3.de", true },
{ "xferion.com", true },
{ "xfix.pw", true },
+ { "xfrag-networks.com", true },
{ "xgame.com.tr", true },
{ "xgclan.com", true },
{ "xgn.es", true },
+ { "xgwap.com", true },
{ "xgzepto.cn", true },
{ "xhily.com", true },
{ "xhmikosr.io", true },
{ "xho.me", true },
{ "xhotlips.date", true },
+ { "xi.ht", true },
{ "xia.de", true },
{ "xia100.xyz", true },
{ "xiamenshipbuilding.com", true },
{ "xiamuzi.com", true },
{ "xiangblog.com", true },
{ "xiangfajia.cn", true },
+ { "xiangweiqing.co.uk", true },
{ "xiangwenquan.me", true },
{ "xianjianruishiyouyiyuan.com", true },
{ "xiaobude.cn", true },
- { "xiaocg.xyz", true },
+ { "xiaocg.xyz", false },
{ "xiaoguo.net", false },
+ { "xiaohui.love", true },
{ "xiaolanglang.net", true },
{ "xiaolong.link", true },
{ "xiaomao.tk", true },
@@ -42077,22 +43716,20 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xiashali.me", true },
{ "xichtsbuch.de", true },
{ "xicreative.net", true },
+ { "xie38.com", true },
+ { "xie91.com", true },
{ "xiecongan.org", true },
{ "xif.at", true },
{ "xight.org", true },
{ "xilef.org", true },
- { "xiliant.com", false },
{ "xilkoi.net", true },
{ "xilou.org", true },
{ "ximble.com", true },
{ "ximbo.net", true },
- { "xinbo270.com", true },
- { "xinbo676.com", true },
{ "xinboyule.com", true },
{ "xinj.com", true },
{ "xinlandm.com", true },
{ "xinnixdeuren-shop.be", true },
- { "xinsane.com", true },
{ "xinu.xyz", true },
{ "xinuspeed.com", true },
{ "xinuspeedtest.com", true },
@@ -42101,7 +43738,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xjf6.com", true },
{ "xjjeeps.com", true },
{ "xjoi.net", true },
- { "xjoin.de", true },
{ "xjpvictor.info", true },
{ "xkblog.xyz", true },
{ "xkcd.pw", true },
@@ -42117,7 +43753,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xmedius.eu", true },
{ "xmenrevolution.com", true },
{ "xmflyrk.com", true },
- { "xmine128.tk", true },
{ "xmlbeam.org", true },
{ "xmodule.org", true },
{ "xmpp.dk", true },
@@ -42126,6 +43761,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xmtpro.com", true },
{ "xmusic.live", true },
{ "xmv.cz", true },
+ { "xn-----6kcbjcgl1atjj7aadbkxfxfe7a9yia.xn--p1ai", true },
{ "xn----7sbfl2alf8a.xn--p1ai", true },
{ "xn----8hcdn2ankm1bfq.com", true },
{ "xn----8sbjfacqfqshbh7afyeg.xn--80asehdb", true },
@@ -42133,12 +43769,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn----zmcaltpp1mdh16i.com", true },
{ "xn--0iv967ab7w.xn--rhqv96g", true },
{ "xn--0kq33cz5c8wmwrqqw1d.com", true },
+ { "xn--12c3bpr6bsv7c.com", true },
+ { "xn--13-6kc0bufl.xn--p1ai", true },
{ "xn--158h.ml", true },
{ "xn--15tx89ctvm.xn--6qq986b3xl", true },
{ "xn--1yst51avkr.ga", true },
+ { "xn--1yst51avkr.xn--6qq986b3xl", true },
{ "xn--24-6kch4bfqee.xn--p1ai", true },
{ "xn--24-glcia8dc.xn--p1ai", true },
{ "xn--2sxs9ol7o.com", true },
+ { "xn--3st814ec8r.cn", true },
+ { "xn--3stv82k.hk", true },
+ { "xn--3stv82k.tw", true },
{ "xn--48jwg508p.net", true },
{ "xn--4dbfsnr.xn--9dbq2a", true },
{ "xn--4kro7fswi.xn--6qq986b3xl", true },
@@ -42147,6 +43789,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--5dbkjqb0d.com", true },
{ "xn--5dbkjqb0d.net", true },
{ "xn--6o8h.cf", true },
+ { "xn--6qq52xuogcjfw8pwqp.ga", true },
{ "xn--6qq62xsogfjfs8p1qp.ga", true },
{ "xn--6x6a.life", true },
{ "xn--79q87uvkclvgd56ahq5a.net", true },
@@ -42160,13 +43803,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--80azelb.xn--p1ai", true },
{ "xn--8bi.gq", true },
{ "xn--90accgba6bldkcbb7a.xn--p1acf", true },
+ { "xn--90aroj.xn--p1ai", true },
{ "xn--allgu-biker-o8a.de", true },
{ "xn--aviao-dra1a.pt", true },
{ "xn--b3c4f.xn--o3cw4h", true },
- { "xn--baron-bonzenbru-elb.com", true },
{ "xn--bckerei-trster-5hb11a.de", true },
{ "xn--ben-bank-8za.dk", true },
{ "xn--benbank-dxa.dk", true },
+ { "xn--bersetzung-8db.cc", true },
{ "xn--berwachungspaket-izb.at", true },
{ "xn--brneruhr-0za.ch", true },
{ "xn--cck4ax91r.com", true },
@@ -42178,12 +43822,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--circul-u3a.cc", true },
{ "xn--d1acj9c.xn--90ais", true },
{ "xn--dcko6fsa5b1a8gyicbc.biz", true },
+ { "xn--dej-3oa.lv", true },
{ "xn--detrkl13b9sbv53j.com", true },
{ "xn--detrkl13b9sbv53j.org", true },
{ "xn--dmonenjger-q5ag.net", true },
{ "xn--dmontaa-9za.com", true },
{ "xn--dragni-g1a.de", true },
{ "xn--dtursfest-72a.dk", true },
+ { "xn--durhre-yxa.de", true },
{ "xn--e1aoahhqgn.xn--p1ai", true },
{ "xn--ecki0cd0bu9a4nsjb.com", true },
{ "xn--ehqw04eq6e.jp", true },
@@ -42201,6 +43847,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--fs5ak3f.com", true },
{ "xn--gfrr-7qa.li", true },
{ "xn--gfrrli-yxa.ch", true },
+ { "xn--gi8hwa.tk", true },
{ "xn--heilendehnde-ocb.de", true },
{ "xn--hgbk4a00a.com", true },
{ "xn--hllrigl-90a.at", true },
@@ -42234,6 +43881,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--mgbmmp7eub.com", true },
{ "xn--mgbpkc7fz3awhe.com", true },
{ "xn--mgbuq0c.net", true },
+ { "xn--mgi-qla.life", true },
+ { "xn--mhringen-65a.de", true },
{ "xn--mllers-wxa.info", true },
{ "xn--mntsamling-0cb.dk", true },
{ "xn--myrepubic-wub.net", true },
@@ -42241,11 +43890,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--n8j7dygrbu0c31a5861bq8qb.com", true },
{ "xn--n8jp5083dnzs.net", true },
{ "xn--n8jtcugp92n4wc738f.net", true },
- { "xn--nf1a578axkh.xn--fiqs8s", true },
{ "xn--nrrdetval-v2ab.se", true },
{ "xn--o38h.tk", true },
{ "xn--obt757c.com", true },
- { "xn--oiqt18e8e2a.eu.org", true },
{ "xn--p8j9a0d9c9a.xn--q9jyb4c", true },
{ "xn--pbt947am3ab71g.com", true },
{ "xn--pe-bka.ee", true },
@@ -42255,22 +43902,23 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--qckss0j.tk", true },
{ "xn--r8jzaf7977b09e.com", true },
{ "xn--rdiger-kuhlmann-zvb.de", true },
+ { "xn--registriertesexualstraftter-ykc.de", true },
{ "xn--reisebro-herrsching-bbc.de", true },
{ "xn--rlcus7b3d.xn--xkc2dl3a5ee0h", true },
{ "xn--roselire-60a.ch", true },
{ "xn--roselire-60a.com", true },
{ "xn--rt-cja.ie", true },
+ { "xn--rtter-kva.eu", true },
{ "xn--ruanmller-u9a.com", true },
{ "xn--s-1gaa.fi", true },
{ "xn--schlerzeitung-ideenlos-ulc.de", true },
{ "xn--schpski-c1a.de", true },
{ "xn--schsischer-christstollen-qbc.shop", true },
- { "xn--seelenwchter-mcb.eu", true },
+ { "xn--solidaritt-am-ort-yqb.de", true },
{ "xn--spenijmazania-yhc.pl", true },
{ "xn--sz8h.ml", true },
{ "xn--t-oha.lv", true },
{ "xn--t8j4aa4nkg1h9bwcvud.com", true },
- { "xn--t8j4aa4nyhxa7duezbl49aqg5546e264d.net", true },
{ "xn--t8j4aa4nzg3a5euoxcwee.xyz", true },
{ "xn--tigreray-i1a.org", true },
{ "xn--u8jwd.ga", true },
@@ -42284,7 +43932,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xn--y-5ga.com", true },
{ "xn--y8j148r.xn--q9jyb4c", true },
{ "xn--y8jarb5hca.jp", true },
- { "xn--yrvp1ac68c.xn--6qq986b3xl", true },
{ "xn--z1tq4ldt4b.com", true },
{ "xn--zettlmeil-n1a.de", true },
{ "xn5.de", true },
@@ -42300,7 +43947,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xombitmusic.com", true },
{ "xone.cz", false },
{ "xonn.de", true },
- { "xotika.tv", true },
{ "xp-ochrona.pl", true },
{ "xp.nsupdate.info", true },
{ "xp2.de", true },
@@ -42309,7 +43955,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xperidia.com", true },
{ "xpletus.nl", true },
{ "xpoc.pro", true },
- { "xposedornot.com", true },
+ { "xpressable.com", true },
+ { "xpresswifi.network", true },
{ "xqk7.com", true },
{ "xr.cx", true },
{ "xr1s.me", true },
@@ -42329,7 +43976,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xss.ht", true },
{ "xss.name", true },
{ "xss.sk", true },
+ { "xssi.uk", true },
{ "xsteam.eu", true },
+ { "xstreamable.com", true },
{ "xsuper.net", true },
{ "xsz.jp", true },
{ "xtarget.ru", true },
@@ -42350,15 +43999,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xuanmeishe.net", true },
{ "xubo666.com", true },
{ "xuc.me", true },
+ { "xueanquan.com", true },
{ "xuedianshang.com", true },
{ "xuehao.net.cn", true },
{ "xuehuang666.cn", true },
- { "xujan.com", true },
{ "xuming.studio", true },
{ "xunn.io", true },
{ "xuntier.ch", true },
{ "xuyh0120.win", true },
- { "xvii.pl", true },
{ "xviimusic.com", true },
{ "xvt-blog.tk", true },
{ "xwalck.se", true },
@@ -42366,14 +44014,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "xx0r.eu", true },
{ "xxffo.com", true },
{ "xxiz.com", true },
- { "xxxladyboysporn.com", true },
{ "xxxlbox.com", true },
- { "xxxred.net", true },
{ "xxxsuper.net", true },
{ "xy6161.com", true },
{ "xy6262.com", true },
{ "xy6363.com", true },
- { "xy7171.com", true },
{ "xy7272.com", true },
{ "xy7373.com", true },
{ "xyenon.bid", true },
@@ -42386,6 +44031,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "y11n.net", true },
{ "yabuisha.jp", true },
{ "yachigoya.com", true },
+ { "yachtlettering.com", true },
{ "yacineboumaza.fr", true },
{ "yacobo.com", true },
{ "yado-furu.com", true },
@@ -42415,15 +44061,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yandere.moe", true },
{ "yangcs.net", true },
{ "yangjingwen.cn", true },
+ { "yangjingwen.com", true },
{ "yangmaodang.org", true },
{ "yangmi.blog", true },
+ { "yangshangzhen.com", true },
{ "yanngraf.ch", true },
{ "yanngraf.com", true },
{ "yannic.world", true },
{ "yannick.cloud", true },
{ "yannik-buerkle.de", true },
{ "yannikbloscheck.com", true },
- { "yannis.codes", true },
{ "yanovich.net", true },
{ "yanqiyu.info", true },
{ "yans.io", true },
@@ -42434,27 +44081,28 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yarravilletownhouses.com.au", true },
{ "yaru.one", true },
{ "yassine-ayari.com", true },
+ { "yateshomesales.com", true },
{ "yatesun.com", true },
{ "yatorie.net", true },
{ "yatstudios.com", true },
{ "yatsuenpoon.com", true },
{ "yaup.tk", true },
{ "yawen.me", true },
- { "yaxim.org", true },
{ "ybin.me", true },
{ "ybresson.com", true },
{ "ybsul.com", true },
{ "ybti.net", true },
{ "ybzhao.com", true },
+ { "ycbmdevelopment.com", true },
+ { "ycbmstaging.com", true },
{ "ych.art", true },
{ "ycherbonnel.fr", true },
{ "ychon.com", true },
{ "ychong.com", true },
{ "yclan.net", true },
{ "ycnrg.org", true },
- { "yd.io", true },
{ "yeapdata.com", true },
- { "yecl.net", false },
+ { "yecl.net", true },
{ "yeesker.com", true },
{ "yell.ml", true },
{ "yellotalk.co", true },
@@ -42499,7 +44147,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yenpape.com", true },
{ "yep-pro.ch", true },
{ "yephy.com", true },
+ { "yes35.ru", true },
+ { "yesiammaisey.me", true },
{ "yeskx.com", true },
+ { "yesornut.com", true },
{ "yeswecan.co.bw", true },
{ "yeswehack.com", true },
{ "yetanalytics.io", true },
@@ -42514,6 +44165,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ygrene.com", true },
{ "ygreneworks.com", true },
{ "yh599.cc", true },
+ { "yh98768.com", true },
{ "yhaupenthal.org", true },
{ "yhb.io", true },
{ "yhe.me", true },
@@ -42523,6 +44175,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yhndnzj.com", true },
{ "yhong.me", true },
{ "yhrd.org", true },
+ { "yiffed.me", true },
{ "yigujin.cn", true },
{ "yiheng.moe", true },
{ "yii2.cc", true },
@@ -42536,18 +44189,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yiyuanzhong.com", true },
{ "yiyueread.com", true },
{ "yiz96.com", true },
- { "yjsoft.me", true },
{ "ykhut.com", true },
{ "yksityisyydensuoja.fi", true },
- { "ylilauta.org", true },
+ { "ylde.de", true },
{ "ylinternal.com", true },
{ "ymarion.de", true },
- { "ymblaw.com", true },
{ "ymoah.nl", true },
{ "ymtsonline.org", true },
{ "yoa.st", true },
{ "yoast.com", true },
{ "yobai-grouprec.jp", true },
+ { "yobai28.com", true },
{ "yobbelwobbel.de", false },
{ "yobify.com", true },
{ "yoga-alliance-teacher-training.com", true },
@@ -42556,11 +44208,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yoga-school.xyz", true },
{ "yoga-sky.de", true },
{ "yoga-zentrum-narayani.de", true },
- { "yogabhawnamission.com", true },
{ "yogacentric.co.uk", true },
{ "yogahealsinc.org", true },
{ "yogamea.school", true },
{ "yogananda-roma.org", true },
+ { "yogaprague.com", true },
{ "yogaschoolrishikesh.com", true },
{ "yogeshbeniwal.com", false },
{ "yoibyoin.info", true },
@@ -42569,6 +44221,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yoitsu.moe", true },
{ "yokohama-legaloffice.jp", true },
{ "yokone3-kutikomi.com", true },
+ { "yolandgao.me", true },
{ "yolo.jetzt", true },
{ "yolobert.de", true },
{ "yoloboatrentals.com", true },
@@ -42576,17 +44229,21 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yombo.net", true },
{ "yon.co.il", true },
{ "yongbin.org", true },
+ { "yooguo123.com", true },
{ "yoonas.com", true },
+ { "yooomu.com", true },
+ { "yooooex.com", true },
{ "yoplate.com", true },
{ "yoppoy.com", true },
{ "yopuedo.co", true },
+ { "yoramvandevelde.net", true },
{ "yorcom.nl", false },
{ "yorcool.nl", true },
{ "yorkshiredalesinflatables.co.uk", true },
{ "yorkshireinflatables.co.uk", true },
{ "yorname.ml", false },
+ { "yosakoinight.com", true },
{ "yosbeda.com", true },
- { "yosemo.de", true },
{ "yoshibaworks.com", true },
{ "yoshitsugu.net", true },
{ "yosida-dental.com", true },
@@ -42607,7 +44264,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "youhacked.me", true },
{ "youhavewords.com", true },
{ "youhua.ru", true },
- { "youjizz.bz", true },
{ "youkaryote.com", true },
{ "youkaryote.org", true },
{ "youked.com", true },
@@ -42634,6 +44290,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yourbittorrent.icu", true },
{ "yourbittorrent.pw", true },
{ "yourbittorrent2.com", true },
+ { "yourbodyknows.dk", true },
+ { "yourbodyknows.is", true },
{ "yourbonus.click", true },
{ "yourciso.com", true },
{ "yourcomputer.expert", true },
@@ -42645,11 +44303,14 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yourlanguages.de", true },
{ "yourmemorykeeper.co.uk", true },
{ "yourneighborhub.com", true },
+ { "yourscotlandtour.co.uk", true },
{ "yourskin.nl", true },
{ "yourstake.org", true },
{ "yourticketbooking.com", true },
+ { "yourtime.tv", true },
{ "yourtrainer.com", true },
{ "yousei.ne.jp", true },
+ { "youshouldbealiberal.com", true },
{ "yout.com", true },
{ "youth.gov", true },
{ "youthovation.org", true },
@@ -42659,6 +44320,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "youtube.com", true },
{ "youtubedownloader.com", true },
{ "youtuberis.lt", true },
+ { "youyoulemon.com", true },
{ "yoxall.me.uk", true },
{ "yoyoost.duckdns.org", true },
{ "ypart.eu", true },
@@ -42673,7 +44335,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "ysicing.net", true },
{ "ysicorp.com", true },
{ "yslbeauty.com", true },
- { "ysun.xyz", true },
{ "ytec.ca", true },
{ "ytpak.pk", true },
{ "ytreza.fr", true },
@@ -42741,8 +44402,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yue.la", true },
{ "yue2.net", true },
{ "yuexiangzs.com", true },
- { "yugasun.com", true },
- { "yuisyo.ml", true },
+ { "yuhindo.com", true },
{ "yukari.cafe", true },
{ "yukari.cloud", true },
{ "yuki-nagato.com", true },
@@ -42751,8 +44411,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yukonlip.com", true },
{ "yukontec.com", true },
{ "yumeconcert.com", true },
+ { "yumikori.net", true },
{ "yunity.org", true },
{ "yunjishou.pro", true },
+ { "yunloc.com", true },
{ "yuntong.tw", true },
{ "yunzhu.li", true },
{ "yuricarlenzoli.it", true },
@@ -42764,30 +44426,31 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "yusu.org", true },
{ "yutakato.net", true },
{ "yutangyun.com", true },
- { "yutuo.net", true },
{ "yuuki0xff.jp", true },
- { "yuuta.moe", true },
{ "yuwei.org", true },
{ "yuweiyang.xyz", true },
{ "yuxuan.org", true },
+ { "yuyiyang.eu.org", true },
{ "yuyo.com", true },
{ "yuyu.io", true },
{ "yuzei.tk", true },
{ "yveshield.com", true },
{ "yveslegendre.fr", true },
+ { "yvesx.com", true },
{ "yvonnehaeusser.de", true },
{ "yvonnethomet.ch", true },
{ "yvonnewilhelmi.com", true },
{ "yxs.me", true },
{ "yxt521.com", true },
+ { "yxzero.xyz", true },
{ "yya.me", true },
{ "yyc.city", true },
+ { "yycbike.info", true },
{ "yyyy.xyz", true },
{ "yzal.io", true },
{ "yzcloud.me", true },
{ "yzer.club", true },
{ "yzimroni.net", true },
- { "z-konzept-nutrition.ru", true },
{ "z-latko.info", true },
{ "z-vector.com", true },
{ "z.ai", true },
@@ -42814,6 +44477,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zachgibbens.org", true },
{ "zachschneider.ca", true },
{ "zaclys.com", false },
+ { "zadania.wiki", true },
{ "zafirus.name", true },
{ "zaghyr.org", true },
{ "zagluszaczgps.pl", true },
@@ -42824,6 +44488,11 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zahnarzt-kramer.ch", true },
{ "zahnarzt-muenich.de", true },
{ "zahnmedizinzentrum.com", true },
+ { "zaidan.de", true },
+ { "zaidan.eu", true },
+ { "zaidanfood.com", true },
+ { "zaidanfood.eu", true },
+ { "zaidanlebensmittelhandel.de", true },
{ "zajazd.biz", true },
{ "zakariya.blog", true },
{ "zakcutner.uk", true },
@@ -42838,6 +44507,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zaloghaz.ro", true },
{ "zaltv.com", true },
{ "zalvus.com", true },
+ { "zalzalac.com", true },
{ "zamalektoday.com", true },
{ "zamocosmeticos.com.br", true },
{ "zamow.co", true },
@@ -42845,13 +44515,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zander.dk", true },
{ "zanellidesigns.co.uk", true },
{ "zanthra.com", true },
- { "zanzabar.it", true },
{ "zanzo.cz", true },
+ { "zap-mag.ru", true },
{ "zapier.com", true },
{ "zapmaster14.com", true },
{ "zappbuildapps.com", false },
{ "zarabiaj.com", true },
- { "zaratan.fr", true },
{ "zargescases.co.uk", true },
{ "zarmarket.org", true },
{ "zarpo.com.br", true },
@@ -42889,16 +44558,15 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zeal-interior.com", true },
{ "zealworks.jp", true },
{ "zebbra.ro", true },
- { "zebedeescastles.co.uk", true },
{ "zebulon.fr", true },
{ "zeds-official.com", true },
{ "zeebrieshoekvanholland.nl", true },
{ "zeel.com", true },
{ "zeestraten.nl", true },
{ "zeetoppers.nl", true },
- { "zeeuw.nl", true },
{ "zeguigui.com", true },
{ "zehkae.net", true },
+ { "zehrailkeakyildiz.com", true },
{ "zeibekiko-souvlaki.gr", true },
{ "zeidlertechnik.de", true },
{ "zeilenmethans.nl", true },
@@ -42913,16 +44581,18 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zena.cx", false },
{ "zenchain.com", true },
{ "zenevents.ro", true },
+ { "zengdong.ren", true },
{ "zenghx.tk", false },
- { "zenithmedia.ca", true },
{ "zenk-security.com", true },
{ "zenlogic.com", true },
{ "zenluxuryliving.com", true },
{ "zennzimie.be", true },
{ "zennzimie.com", true },
+ { "zeno-dev.com", true },
{ "zenofa.co.id", true },
{ "zentask.io", true },
{ "zenti.cloud", true },
+ { "zenus-biometrics.com", true },
{ "zenvideocloud.com", true },
{ "zenvite.com", true },
{ "zenycosta.com", true },
@@ -42935,7 +44605,6 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zerg.uk", true },
{ "zerobounce.net", true },
{ "zerofy.de", true },
- { "zerolab.org", true },
{ "zeronet.io", true },
{ "zeropoint.bg", true },
{ "zeropush.com", true },
@@ -42953,6 +44622,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zettaplan.ru", true },
{ "zettlmeissl.de", true },
{ "zevelev.net", true },
+ { "zeyi.fan", true },
+ { "zf1898.com", true },
{ "zfast.com.br", true },
{ "zfg.li", true },
{ "zfly.me", true },
@@ -42961,14 +44632,17 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zgrep.org", true },
{ "zh.search.yahoo.com", false },
{ "zhang-hao.com", true },
+ { "zhang.fm", true },
+ { "zhang.ge", true },
{ "zhang.nz", true },
{ "zhangfangzhou.com", true },
- { "zhangge.net", true },
{ "zhanghao.me", true },
+ { "zhanghao.org", true },
{ "zhangheda.cf", true },
{ "zhangshuqiao.org", true },
{ "zhangsidan.com", true },
{ "zhangwendao.com", true },
+ { "zhangxuhu.com", true },
{ "zhangyuhao.com", true },
{ "zhangzifan.com", false },
{ "zhaoeq.com", true },
@@ -42983,10 +44657,13 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zhenic.ir", true },
{ "zhi.ci", true },
{ "zhih.me", true },
+ { "zhiin.net", true },
{ "zhiku8.com", true },
{ "zhima.io", true },
+ { "zhina.wiki", true },
{ "zhitanska.com", true },
{ "zhiwei.me", true },
+ { "zhiyuan.cloud", true },
{ "zhl123.com", true },
{ "zhome.info", true },
{ "zhongzicili.ws", true },
@@ -42998,6 +44675,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zhthings.com", true },
{ "zhuihoude.com", true },
{ "zhuji.com", true },
+ { "zhy.us", true },
{ "zi.is", true },
{ "ziegler-heizung-frankfurt.de", true },
{ "zielonakarta.com", true },
@@ -43030,15 +44708,16 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zionnationalpark.net", true },
{ "zionsvillelocksmiths.com", true },
{ "zip.ch", true },
+ { "zipfworks.com", true },
{ "zipkey.de", true },
{ "zircode.com", true },
{ "ziroh.be", true },
{ "zirrka.de", true },
{ "zirtek.ie", true },
{ "zirtual.com", true },
+ { "zistemo.com", true },
{ "zitseng.com", true },
{ "zittingskalender.be", true },
- { "zivagold.com", false },
{ "zivava.ge", true },
{ "zivmergers.com", true },
{ "zivver.be", true },
@@ -43052,6 +44731,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zixiao.wang", true },
{ "zizcollections.com", true },
{ "zjateaucafe.be", true },
+ { "zjc3.com", true },
{ "zjv.me", true },
{ "zk.com.co", true },
{ "zk.gd", true },
@@ -43059,6 +44739,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zkontrolujsiauto.cz", true },
{ "zkrypt.cc", true },
{ "zkzone.net", true },
+ { "zl0iu.com", true },
+ { "zl8862.com", true },
{ "zlatakus.cz", true },
{ "zlatosnadno.cz", true },
{ "zlaty-tyden.cz", true },
@@ -43079,6 +44761,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "znation.nl", true },
{ "znhglobalresources.com", true },
{ "zoarcampsite.uk", true },
+ { "zobraz.cz", true },
{ "zobworks.com", true },
{ "zoccarato.ovh", true },
{ "zochowskiplasticsurgery.com", true },
@@ -43087,11 +44770,12 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zodiacohouses.com", true },
{ "zoeller.me", true },
{ "zofrex.com", true },
+ { "zohair.xyz", true },
{ "zohar.wang", true },
{ "zoigl.club", true },
{ "zoisfinefood.com", true },
- { "zojadravai.com", true },
{ "zoki.art", true },
+ { "zollihood.ch", true },
{ "zom.bi", true },
{ "zomerschoen.nl", true },
{ "zomiac.pp.ua", true },
@@ -43111,10 +44795,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zook.systems", true },
{ "zoola.io", true },
{ "zoolaboo.de", true },
- { "zoological-gardens.eu", true },
{ "zoom.earth", true },
{ "zoomcar.pro", true },
{ "zoomek.com", true },
+ { "zooneshop.com", true },
{ "zooom.azurewebsites.net", true },
{ "zooom2.azurewebsites.net", true },
{ "zoop.ml", true },
@@ -43140,10 +44824,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zr.is", true },
{ "zravypapir.cz", true },
{ "zrhdwz.cn", true },
- { "zrkr.de", true },
{ "zrniecka-pre-sny.sk", true },
{ "zrnieckapresny.sk", true },
- { "zrt.io", false },
{ "zry-blog.top", true },
{ "zs-ohradni.cz", true },
{ "zs-reporyje.cz", true },
@@ -43154,6 +44836,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zsoltsandor.me", true },
{ "zsq.im", true },
{ "zsrbcs.com", true },
+ { "zstu.eu", true },
{ "zten.org", true },
{ "ztjuh.tk", true },
{ "zubel.it", false },
@@ -43170,7 +44853,9 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zulu.ro", true },
{ "zum-baur.de", true },
{ "zumazar.ru", true },
+ { "zumub.com", true },
{ "zund-app.com", true },
+ { "zundapp.one", true },
{ "zundapp529.nl", true },
{ "zundappachterhoek.nl", true },
{ "zuolan.me", false },
@@ -43187,6 +44872,7 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zwartendijkstalling.nl", true },
{ "zwb3.de", true },
{ "zwerimex.com", true },
+ { "zwierslanguagetraining.nl", true },
{ "zwk.de", true },
{ "zwollemag.nl", true },
{ "zwollemagazine.nl", true },
@@ -43195,6 +44881,8 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zx7r.de", true },
{ "zxc.science", false },
{ "zxe.com.br", true },
+ { "zxssl.com", true },
+ { "zxxcq.com", true },
{ "zy.md", true },
{ "zybbo.com", true },
{ "zyciedlazwierzat.pl", true },
@@ -43206,10 +44894,10 @@ static const nsSTSPreload kSTSPreloadList[] = {
{ "zymmm.com", true },
{ "zypern-firma.com", true },
{ "zyria.de", true },
- { "zyrillezuno.com", true },
{ "zyul.ddns.net", true },
{ "zyzardx.com", true },
{ "zyzsdy.com", true },
+ { "zzbnet.cn", true },
{ "zzekj.net", true },
{ "zzpd.nl", false },
{ "zzsec.org", true },
diff --git a/security/manager/ssl/nsSiteSecurityService.cpp b/security/manager/ssl/nsSiteSecurityService.cpp
index fc38f4e643..cfee79d8d1 100644
--- a/security/manager/ssl/nsSiteSecurityService.cpp
+++ b/security/manager/ssl/nsSiteSecurityService.cpp
@@ -210,8 +210,8 @@ const uint64_t kSixtyDaysInSeconds = 60 * 24 * 60 * 60;
nsSiteSecurityService::nsSiteSecurityService()
: mMaxMaxAge(kSixtyDaysInSeconds)
, mUsePreloadList(true)
- , mPreloadListTimeOffset(0)
, mUseStsService(true)
+ , mPreloadListTimeOffset(0)
{
}
diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json
index 496f8e3cb4..7edded5dc3 100644
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -3944,6 +3944,16 @@
"url": "/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_9.html"
},
{
+ "path": "2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html",
+ "references": [
+ [
+ "/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1_ref.html",
+ "=="
+ ]
+ ],
+ "url": "/2dcontext/drawing-images-to-the-canvas/drawimage_svg_image_1.html"
+ },
+ {
"path": "2dcontext/line-styles/canvas_linestyles_linecap_001.htm",
"references": [
[
@@ -38443,8 +38453,23 @@
]
},
"local_changes": {
- "deleted": [],
- "deleted_reftests": {},
+ "deleted": [
+ "2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1.html"
+ ],
+ "deleted_reftests": {
+ "2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1.html": [
+ {
+ "path": "2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1.html",
+ "references": [
+ [
+ "/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1_ref.html",
+ "=="
+ ]
+ ],
+ "url": "/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_1.html"
+ }
+ ]
+ },
"items": {
"manual": {
"html/browsers/windows/noreferrer-cross-origin-close-manual.sub.html": [
@@ -38461,6 +38486,78 @@
]
},
"reftest": {
+ "html/form-elements/the-textarea-element/multiline-placeholder-cr.html": [
+ {
+ "path": "html/form-elements/the-textarea-element/multiline-placeholder-cr.html",
+ "references": [
+ [
+ "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/form-elements/the-textarea-element/multiline-placeholder-cr.html"
+ }
+ ],
+ "html/form-elements/the-textarea-element/multiline-placeholder-crlf.html": [
+ {
+ "path": "html/form-elements/the-textarea-element/multiline-placeholder-crlf.html",
+ "references": [
+ [
+ "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html"
+ }
+ ],
+ "html/form-elements/the-textarea-element/multiline-placeholder.html": [
+ {
+ "path": "html/form-elements/the-textarea-element/multiline-placeholder.html",
+ "references": [
+ [
+ "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/form-elements/the-textarea-element/multiline-placeholder.html"
+ }
+ ],
+ "html/input/the-placeholder-attribute/multiline-cr.html": [
+ {
+ "path": "html/input/the-placeholder-attribute/multiline-cr.html",
+ "references": [
+ [
+ "/html/input/the-placeholder-attribute/multiline-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/input/the-placeholder-attribute/multiline-cr.html"
+ }
+ ],
+ "html/input/the-placeholder-attribute/multiline-crlf.html": [
+ {
+ "path": "html/input/the-placeholder-attribute/multiline-crlf.html",
+ "references": [
+ [
+ "/html/input/the-placeholder-attribute/multiline-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/input/the-placeholder-attribute/multiline-crlf.html"
+ }
+ ],
+ "html/input/the-placeholder-attribute/multiline.html": [
+ {
+ "path": "html/input/the-placeholder-attribute/multiline.html",
+ "references": [
+ [
+ "/html/input/the-placeholder-attribute/multiline-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/input/the-placeholder-attribute/multiline.html"
+ }
+ ],
"html/semantics/grouping-content/the-ol-element/reversed-1e.html": [
{
"path": "html/semantics/grouping-content/the-ol-element/reversed-1e.html",
@@ -38797,6 +38894,78 @@
}
},
"reftest_nodes": {
+ "html/form-elements/the-textarea-element/multiline-placeholder-cr.html": [
+ {
+ "path": "html/form-elements/the-textarea-element/multiline-placeholder-cr.html",
+ "references": [
+ [
+ "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/form-elements/the-textarea-element/multiline-placeholder-cr.html"
+ }
+ ],
+ "html/form-elements/the-textarea-element/multiline-placeholder-crlf.html": [
+ {
+ "path": "html/form-elements/the-textarea-element/multiline-placeholder-crlf.html",
+ "references": [
+ [
+ "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html"
+ }
+ ],
+ "html/form-elements/the-textarea-element/multiline-placeholder.html": [
+ {
+ "path": "html/form-elements/the-textarea-element/multiline-placeholder.html",
+ "references": [
+ [
+ "/html/form-elements/the-textarea-element/multiline-placeholder-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/form-elements/the-textarea-element/multiline-placeholder.html"
+ }
+ ],
+ "html/input/the-placeholder-attribute/multiline-cr.html": [
+ {
+ "path": "html/input/the-placeholder-attribute/multiline-cr.html",
+ "references": [
+ [
+ "/html/input/the-placeholder-attribute/multiline-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/input/the-placeholder-attribute/multiline-cr.html"
+ }
+ ],
+ "html/input/the-placeholder-attribute/multiline-crlf.html": [
+ {
+ "path": "html/input/the-placeholder-attribute/multiline-crlf.html",
+ "references": [
+ [
+ "/html/input/the-placeholder-attribute/multiline-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/input/the-placeholder-attribute/multiline-crlf.html"
+ }
+ ],
+ "html/input/the-placeholder-attribute/multiline.html": [
+ {
+ "path": "html/input/the-placeholder-attribute/multiline.html",
+ "references": [
+ [
+ "/html/input/the-placeholder-attribute/multiline-ref.html",
+ "=="
+ ]
+ ],
+ "url": "/html/input/the-placeholder-attribute/multiline.html"
+ }
+ ],
"html/semantics/grouping-content/the-ol-element/reversed-1e.html": [
{
"path": "html/semantics/grouping-content/the-ol-element/reversed-1e.html",
diff --git a/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-cr.html b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-cr.html
new file mode 100644
index 0000000000..f4a5be35a1
--- /dev/null
+++ b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-cr.html
@@ -0,0 +1 @@
+<!doctype html> <html class="reftest-wait"> <meta charset="utf-8"> <title>textarea multiline placeholder (CR)</title> <link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-textarea-placeholder"> <meta name="assert" content="textarea element's placeholder preserves newlines (CR)"> <link rel="match" href="/html/form-elements/the-textarea-element/multiline-placeholder-ref.html"> <link rel="stylesheet" href="support/placeholder.css"> <textarea rows="5" placeholder="this is a multiline placeholder"></textarea> <textarea rows="5" placeholder="this is&#xd;a multiline&#xd;&#xd;placeholder"></textarea> <textarea rows="5" id="dynamic"></textarea> <script> document.querySelector("#dynamic") .setAttribute("placeholder", "this is\ra multiline\r\rplaceholder"); document.documentElement.classList.remove("reftest-wait"); </script> </html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html
new file mode 100644
index 0000000000..0fb434fc64
--- /dev/null
+++ b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-crlf.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>textarea multiline placeholder (CRLF)</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-textarea-placeholder">
+<meta name="assert" content="textarea element's placeholder preserves newlines (CRLF)">
+<link rel="match" href="/html/form-elements/the-textarea-element/multiline-placeholder-ref.html">
+<link rel="stylesheet" href="support/placeholder.css">
+<textarea rows="5" placeholder="this is
+a multiline
+
+placeholder"></textarea>
+<textarea rows="5" placeholder="this is&#xd;&#xa;a multiline&#xd;&#xa;&#xd;&#xa;placeholder"></textarea>
+<textarea rows="5" id="dynamic"></textarea>
+<script>
+ document.querySelector("#dynamic")
+ .setAttribute("placeholder", "this is\r\na multiline\r\n\r\nplaceholder");
+ document.documentElement.classList.remove("reftest-wait");
+</script>
+</html>
+
diff --git a/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-ref.html b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-ref.html
new file mode 100644
index 0000000000..0234ed64c9
--- /dev/null
+++ b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder-ref.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<meta charset="utf-8">
+<link rel="stylesheet" href="support/placeholder.css">
+<textarea rows="5" class="placeholder">this is
+a multiline
+
+placeholder</textarea>
+<textarea rows="5" class="placeholder">this is
+a multiline
+
+placeholder</textarea>
+<textarea rows="5" class="placeholder">this is
+a multiline
+
+placeholder</textarea>
diff --git a/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder.html b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder.html
new file mode 100644
index 0000000000..00bb9696d1
--- /dev/null
+++ b/testing/web-platform/tests/html/form-elements/the-textarea-element/multiline-placeholder.html
@@ -0,0 +1,22 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>textarea multiline placeholder</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/form-elements.html#attr-textarea-placeholder">
+<meta name="assert" content="textarea element's placeholder preserves newlines">
+<link rel="match" href="/html/form-elements/the-textarea-element/multiline-placeholder-ref.html">
+<link rel="stylesheet" href="support/placeholder.css">
+<textarea rows="5" placeholder="this is
+a multiline
+
+placeholder"></textarea>
+<textarea rows="5" placeholder="this is&#xa;a multiline&#xa;&#xa;placeholder"></textarea>
+<textarea rows="5" id="dynamic"></textarea>
+<script>
+ document.querySelector("#dynamic")
+ .setAttribute("placeholder", "this is\na multiline\n\nplaceholder");
+ document.documentElement.classList.remove("reftest-wait");
+</script>
+</html>
+
+
diff --git a/testing/web-platform/tests/html/form-elements/the-textarea-element/support/placeholder.css b/testing/web-platform/tests/html/form-elements/the-textarea-element/support/placeholder.css
new file mode 100644
index 0000000000..9aaed05c86
--- /dev/null
+++ b/testing/web-platform/tests/html/form-elements/the-textarea-element/support/placeholder.css
@@ -0,0 +1,6 @@
+textarea.placeholder,
+textarea::placeholder {
+ /* revert browser styling of the placeholder */
+ color: GrayText; /* blink/webkit use colour */
+ opacity: 1.0; /* gecko uses opacity */
+}
diff --git a/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-cr.html b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-cr.html
new file mode 100644
index 0000000000..f3150f25d6
--- /dev/null
+++ b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-cr.html
@@ -0,0 +1 @@
+<!doctype html> <html class="reftest-wait"> <meta charset="utf-8"> <title>input multiline placeholder (CRLF)</title> <link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#the-placeholder-attribute"> <meta name="assert" content="input element's placeholder strips newlines (CRLF)"> <link rel="match" href="/html/input/the-placeholder-attribute/multiline-ref.html"> <input placeholder="this is a multiline placeholder"> <input placeholder="this is&#xd;a multiline&#xd;&#xd;placeholder"> <input id="dynamic"> <script> document.querySelector("#dynamic") .setAttribute("placeholder", "this is\ra multiline\r\rplaceholder"); document.documentElement.classList.remove("reftest-wait"); </script> </html> \ No newline at end of file
diff --git a/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-crlf.html b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-crlf.html
new file mode 100644
index 0000000000..dd581629da
--- /dev/null
+++ b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-crlf.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>input multiline placeholder (CRLF)</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#the-placeholder-attribute">
+<meta name="assert" content="input element's placeholder strips newlines (CRLF)">
+<link rel="match" href="/html/input/the-placeholder-attribute/multiline-ref.html">
+<input placeholder="this is
+a multiline
+
+placeholder">
+<input placeholder="this is&#xd;&#xa;a multiline&#xd;&#xa;&#xd;&#xa;placeholder">
+<input id="dynamic">
+<script>
+ document.querySelector("#dynamic")
+ .setAttribute("placeholder", "this is\r\na multiline\r\n\r\nplaceholder");
+ document.documentElement.classList.remove("reftest-wait");
+</script>
+</html>
diff --git a/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-ref.html b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-ref.html
new file mode 100644
index 0000000000..2812f86e1e
--- /dev/null
+++ b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline-ref.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<meta charset=utf-8>
+<input placeholder="this isa multilineplaceholder">
+<input placeholder="this isa multilineplaceholder">
+<input placeholder="this isa multilineplaceholder">
diff --git a/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline.html b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline.html
new file mode 100644
index 0000000000..2d7102bd4a
--- /dev/null
+++ b/testing/web-platform/tests/html/input/the-placeholder-attribute/multiline.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>input multiline placeholder</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/input.html#the-placeholder-attribute">
+<meta name="assert" content="input element's placeholder strips newlines">
+<link rel="match" href="/html/input/the-placeholder-attribute/multiline-ref.html">
+<input placeholder="this is
+a multiline
+
+placeholder">
+<input placeholder="this is&#xa;a multiline&#xa;&#xa;placeholder">
+<input id="dynamic">
+<script>
+ document.querySelector("#dynamic")
+ .setAttribute("placeholder", "this is\na multiline\n\nplaceholder");
+ document.documentElement.classList.remove("reftest-wait");
+</script>
+</html>
diff --git a/testing/web-platform/tests/lint.whitelist b/testing/web-platform/tests/lint.whitelist
index 9b358b0db1..01832c3fee 100644
--- a/testing/web-platform/tests/lint.whitelist
+++ b/testing/web-platform/tests/lint.whitelist
@@ -85,6 +85,10 @@ PRINT STATEMENT:*/tools/*
CR AT EOL:WebIDL/valid/idl/documentation-dos.widl
CR AT EOL:cors/resources/cors-headers.asis
+CR AT EOL: html/form-elements/the-textarea-element/multiline-placefolder-cr.html
+CR AT EOL: html/form-elements/the-textarea-element/multiline-placefolder-crlf.html
+CR AT EOL: html/input/the-placeholder-attribute/multiline-cr.html
+CR AT EOL: html/input/the-placeholder-attribute/multiline-crlf.html
CR AT EOL:html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html
INDENT TABS:html/semantics/embedded-content/the-canvas-element/size.attributes.parse.whitespace.html
CR AT EOL:webvtt/webvtt-file-format-parsing/webvtt-file-parsing/support/newlines.vtt
diff --git a/toolkit/components/blocklist/blocklist.manifest b/toolkit/components/blocklist/blocklist.manifest
index c770b4e7dd..6b63d60729 100644
--- a/toolkit/components/blocklist/blocklist.manifest
+++ b/toolkit/components/blocklist/blocklist.manifest
@@ -1,7 +1,5 @@
component {66354bc9-7ed1-4692-ae1d-8da97d6b205e} nsBlocklistService.js process=main
contract @mozilla.org/extensions/blocklist;1 {66354bc9-7ed1-4692-ae1d-8da97d6b205e} process=main
category profile-after-change nsBlocklistService @mozilla.org/extensions/blocklist;1 process=main
-component {e0a106ed-6ad4-47a4-b6af-2f1c8aa4712d} nsBlocklistServiceContent.js process=content
-contract @mozilla.org/extensions/blocklist;1 {e0a106ed-6ad4-47a4-b6af-2f1c8aa4712d} process=content
category update-timer nsBlocklistService @mozilla.org/extensions/blocklist;1,getService,blocklist-background-update-timer,extensions.blocklist.interval,86400 \ No newline at end of file
diff --git a/toolkit/components/blocklist/moz.build b/toolkit/components/blocklist/moz.build
index 3dc3be5ba7..0016e74c2e 100644
--- a/toolkit/components/blocklist/moz.build
+++ b/toolkit/components/blocklist/moz.build
@@ -6,7 +6,6 @@
EXTRA_COMPONENTS += [
'blocklist.manifest',
- 'nsBlocklistServiceContent.js',
]
EXTRA_PP_COMPONENTS += [
diff --git a/toolkit/components/blocklist/nsBlocklistService.js b/toolkit/components/blocklist/nsBlocklistService.js
index 891346b720..49033fc8f6 100644
--- a/toolkit/components/blocklist/nsBlocklistService.js
+++ b/toolkit/components/blocklist/nsBlocklistService.js
@@ -24,13 +24,8 @@ try {
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
"resource://gre/modules/FileUtils.jsm");
-#ifdef MOZ_WEBEXTENSIONS
-XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
- "resource://gre/modules/UpdateUtils.jsm");
-#else
XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
"resource://gre/modules/UpdateChannel.jsm");
-#endif
XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ServiceRequest",
@@ -174,27 +169,6 @@ function LOG(string) {
}
/**
- * Gets a preference value, handling the case where there is no default.
- * @param func
- * The name of the preference function to call, on nsIPrefBranch
- * @param preference
- * The name of the preference
- * @param defaultValue
- * The default value to return in the event the preference has
- * no setting
- * @returns The value of the preference, or undefined if there was no
- * user or default value.
- */
-function getPref(func, preference, defaultValue) {
- try {
- return gPref[func](preference);
- }
- catch (e) {
- }
- return defaultValue;
-}
-
-/**
* Constructs a URI to a spec.
* @param spec
* The spec to construct a URI to
@@ -302,9 +276,9 @@ function parseRegExp(aStr) {
function Blocklist() {
Services.obs.addObserver(this, "xpcom-shutdown", false);
Services.obs.addObserver(this, "sessionstore-windows-restored", false);
- gLoggingEnabled = getPref("getBoolPref", PREF_EM_LOGGING_ENABLED, false);
- gBlocklistEnabled = getPref("getBoolPref", PREF_BLOCKLIST_ENABLED, true);
- gBlocklistLevel = Math.min(getPref("getIntPref", PREF_BLOCKLIST_LEVEL, DEFAULT_LEVEL),
+ gLoggingEnabled = Services.prefs.getBoolPref(PREF_EM_LOGGING_ENABLED, false);
+ gBlocklistEnabled = Services.prefs.getBoolPref(PREF_BLOCKLIST_ENABLED, true);
+ gBlocklistLevel = Math.min(Services.prefs.getIntPref(PREF_BLOCKLIST_LEVEL, DEFAULT_LEVEL),
MAX_BLOCK_LEVEL);
gPref.addObserver("extensions.blocklist.", this, false);
gPref.addObserver(PREF_EM_LOGGING_ENABLED, this, false);
@@ -350,15 +324,15 @@ Blocklist.prototype = {
case "nsPref:changed":
switch (aData) {
case PREF_EM_LOGGING_ENABLED:
- gLoggingEnabled = getPref("getBoolPref", PREF_EM_LOGGING_ENABLED, false);
+ gLoggingEnabled = Services.prefs.getBoolPref(PREF_EM_LOGGING_ENABLED, false);
break;
case PREF_BLOCKLIST_ENABLED:
- gBlocklistEnabled = getPref("getBoolPref", PREF_BLOCKLIST_ENABLED, true);
+ gBlocklistEnabled = Services.prefs.getBoolPref(PREF_BLOCKLIST_ENABLED, true);
this._loadBlocklist();
this._blocklistUpdated(null, null);
break;
case PREF_BLOCKLIST_LEVEL:
- gBlocklistLevel = Math.min(getPref("getIntPref", PREF_BLOCKLIST_LEVEL, DEFAULT_LEVEL),
+ gBlocklistLevel = Math.min(Services.prefs.getIntPref(PREF_BLOCKLIST_LEVEL, DEFAULT_LEVEL),
MAX_BLOCK_LEVEL);
this._blocklistUpdated(null, null);
break;
@@ -530,8 +504,8 @@ Blocklist.prototype = {
return;
}
- var pingCountVersion = getPref("getIntPref", PREF_BLOCKLIST_PINGCOUNTVERSION, 0);
- var pingCountTotal = getPref("getIntPref", PREF_BLOCKLIST_PINGCOUNTTOTAL, 1);
+ var pingCountVersion = Services.prefs.getIntPref(PREF_BLOCKLIST_PINGCOUNTVERSION, 0);
+ var pingCountTotal = Services.prefs.getIntPref(PREF_BLOCKLIST_PINGCOUNTTOTAL, 1);
var daysSinceLastPing = 0;
if (pingCountVersion == 0) {
daysSinceLastPing = "new";
@@ -540,7 +514,7 @@ Blocklist.prototype = {
// Seconds in one day is used because nsIUpdateTimerManager stores the
// last update time in seconds.
let secondsInDay = 60 * 60 * 24;
- let lastUpdateTime = getPref("getIntPref", PREF_BLOCKLIST_LASTUPDATETIME, 0);
+ let lastUpdateTime = Services.prefs.getIntPref(PREF_BLOCKLIST_LASTUPDATETIME, 0);
if (lastUpdateTime == 0) {
daysSinceLastPing = "invalid";
}
@@ -571,11 +545,7 @@ Blocklist.prototype = {
dsURI = dsURI.replace(/%BUILD_TARGET%/g, gApp.OS + "_" + gABI);
dsURI = dsURI.replace(/%OS_VERSION%/g, gOSVersion);
dsURI = dsURI.replace(/%LOCALE%/g, getLocale());
-#ifdef MOZ_WEBEXTENSIONS
- dsURI = dsURI.replace(/%CHANNEL%/g, UpdateUtils.UpdateChannel);
-#else
dsURI = dsURI.replace(/%CHANNEL%/g, UpdateChannel.get());
-#endif
dsURI = dsURI.replace(/%PLATFORM_VERSION%/g, gApp.platformVersion);
dsURI = dsURI.replace(/%DISTRIBUTION%/g,
getDistributionPrefValue(PREF_APP_DISTRIBUTION));
@@ -903,7 +873,7 @@ Blocklist.prototype = {
return;
}
- var populateCertBlocklist = getPref("getBoolPref", PREF_ONECRL_VIA_AMO, true);
+ var populateCertBlocklist = Services.prefs.getBoolPref(PREF_ONECRL_VIA_AMO, true);
var childNodes = doc.documentElement.childNodes;
for (let element of childNodes) {
@@ -1475,7 +1445,7 @@ Blocklist.prototype = {
Services.obs.addObserver(applyBlocklistChanges, "addon-blocklist-closed", false);
- if (getPref("getBoolPref", PREF_BLOCKLIST_SUPPRESSUI, false)) {
+ if (Services.prefs.getBoolPref(PREF_BLOCKLIST_SUPPRESSUI, false)) {
applyBlocklistChanges();
return;
}
diff --git a/toolkit/components/blocklist/nsBlocklistServiceContent.js b/toolkit/components/blocklist/nsBlocklistServiceContent.js
deleted file mode 100644
index 1752924b52..0000000000
--- a/toolkit/components/blocklist/nsBlocklistServiceContent.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const kMissingAPIMessage = "Unsupported blocklist call in the child process."
-
-/*
- * A lightweight blocklist proxy for the content process that traps plugin
- * related blocklist checks and forwards them to the parent. This interface is
- * primarily designed to insure overlays work.. it does not control plugin
- * or addon loading.
- */
-
-function Blocklist() {
- this.init();
-}
-
-Blocklist.prototype = {
- classID: Components.ID("{e0a106ed-6ad4-47a4-b6af-2f1c8aa4712d}"),
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
- Ci.nsIBlocklistService]),
-
- init: function() {
- Services.cpmm.addMessageListener("Blocklist:blocklistInvalidated", this);
- Services.obs.addObserver(this, "xpcom-shutdown", false);
- },
-
- uninit: function() {
- Services.cpmm.removeMessageListener("Blocklist:blocklistInvalidated", this);
- Services.obs.removeObserver(this, "xpcom-shutdown", false);
- },
-
- observe: function(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "xpcom-shutdown":
- this.uninit();
- break;
- }
- },
-
- // Message manager message handlers
- receiveMessage: function(aMsg) {
- switch (aMsg.name) {
- case "Blocklist:blocklistInvalidated":
- Services.obs.notifyObservers(null, "blocklist-updated", null);
- Services.cpmm.sendAsyncMessage("Blocklist:content-blocklist-updated");
- break;
- default:
- throw new Error("Unknown blocklist message received from content: " + aMsg.name);
- }
- },
-
- /*
- * A helper that queries key data from a plugin or addon object
- * and generates a simple data wrapper suitable for ipc. We hand
- * these directly to the nsBlockListService in the parent which
- * doesn't query for much.. allowing us to get away with this.
- */
- flattenObject: function(aTag) {
- // Based on debugging the nsBlocklistService, these are the props the
- // parent side will check on our objects.
- let props = ["name", "description", "filename", "version"];
- let dataWrapper = {};
- for (let prop of props) {
- dataWrapper[prop] = aTag[prop];
- }
- return dataWrapper;
- },
-
- // We support the addon methods here for completeness, but content currently
- // only calls getPluginBlocklistState.
-
- isAddonBlocklisted: function(aAddon, aAppVersion, aToolkitVersion) {
- return true;
- },
-
- getAddonBlocklistState: function(aAddon, aAppVersion, aToolkitVersion) {
- return Components.interfaces.nsIBlocklistService.STATE_BLOCKED;
- },
-
- // There are a few callers in layout that rely on this.
- getPluginBlocklistState: function(aPluginTag, aAppVersion, aToolkitVersion) {
- return Services.cpmm.sendSyncMessage("Blocklist:getPluginBlocklistState", {
- addonData: this.flattenObject(aPluginTag),
- appVersion: aAppVersion,
- toolkitVersion: aToolkitVersion
- })[0];
- },
-
- getAddonBlocklistURL: function(aAddon, aAppVersion, aToolkitVersion) {
- throw new Error(kMissingAPIMessage);
- },
-
- getPluginBlocklistURL: function(aPluginTag) {
- throw new Error(kMissingAPIMessage);
- },
-
- getPluginInfoURL: function(aPluginTag) {
- throw new Error(kMissingAPIMessage);
- }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Blocklist]);
diff --git a/toolkit/components/build/nsToolkitCompsModule.cpp b/toolkit/components/build/nsToolkitCompsModule.cpp
index 33c604c4eb..a4293c6f95 100644
--- a/toolkit/components/build/nsToolkitCompsModule.cpp
+++ b/toolkit/components/build/nsToolkitCompsModule.cpp
@@ -39,9 +39,6 @@
#include "nsBrowserStatusFilter.h"
#include "mozilla/FinalizationWitnessService.h"
#include "mozilla/NativeOSFileInternals.h"
-#ifdef MOZ_WEBEXTENSIONS
-#include "mozilla/AddonContentPolicy.h"
-#endif
#include "mozilla/AddonPathService.h"
#if defined(XP_WIN)
@@ -132,9 +129,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(FinalizationWitnessService, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(NativeOSFileInternalsService)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(NativeFileWatcherService, Init)
-#ifdef MOZ_WEBEXTENSIONS
-NS_GENERIC_FACTORY_CONSTRUCTOR(AddonContentPolicy)
-#endif
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AddonPathService, AddonPathService::GetInstance)
NS_DEFINE_NAMED_CID(NS_TOOLKIT_APPSTARTUP_CID);
@@ -171,9 +165,6 @@ NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
#endif
NS_DEFINE_NAMED_CID(FINALIZATIONWITNESSSERVICE_CID);
NS_DEFINE_NAMED_CID(NATIVE_OSFILE_INTERNALS_SERVICE_CID);
-#ifdef MOZ_WEBEXTENSIONS
-NS_DEFINE_NAMED_CID(NS_ADDONCONTENTPOLICY_CID);
-#endif
NS_DEFINE_NAMED_CID(NS_ADDON_PATH_SERVICE_CID);
NS_DEFINE_NAMED_CID(NATIVE_FILEWATCHER_SERVICE_CID);
@@ -211,9 +202,6 @@ static const Module::CIDEntry kToolkitCIDs[] = {
#endif
{ &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor },
{ &kNATIVE_OSFILE_INTERNALS_SERVICE_CID, false, nullptr, NativeOSFileInternalsServiceConstructor },
-#ifdef MOZ_WEBEXTENSIONS
- { &kNS_ADDONCONTENTPOLICY_CID, false, nullptr, AddonContentPolicyConstructor },
-#endif
{ &kNS_ADDON_PATH_SERVICE_CID, false, nullptr, AddonPathServiceConstructor },
{ &kNATIVE_FILEWATCHER_SERVICE_CID, false, nullptr, NativeFileWatcherServiceConstructor },
{ nullptr }
@@ -253,18 +241,12 @@ static const Module::ContractIDEntry kToolkitContracts[] = {
#endif
{ FINALIZATIONWITNESSSERVICE_CONTRACTID, &kFINALIZATIONWITNESSSERVICE_CID },
{ NATIVE_OSFILE_INTERNALS_SERVICE_CONTRACTID, &kNATIVE_OSFILE_INTERNALS_SERVICE_CID },
-#ifdef MOZ_WEBEXTENSIONS
- { NS_ADDONCONTENTPOLICY_CONTRACTID, &kNS_ADDONCONTENTPOLICY_CID },
-#endif
{ NS_ADDONPATHSERVICE_CONTRACTID, &kNS_ADDON_PATH_SERVICE_CID },
{ NATIVE_FILEWATCHER_SERVICE_CONTRACTID, &kNATIVE_FILEWATCHER_SERVICE_CID },
{ nullptr }
};
static const mozilla::Module::CategoryEntry kToolkitCategories[] = {
-#ifdef MOZ_WEBEXTENSIONS
- { "content-policy", NS_ADDONCONTENTPOLICY_CONTRACTID, NS_ADDONCONTENTPOLICY_CONTRACTID },
-#endif
{ nullptr }
};
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
index 20394a70d2..e611f40104 100644
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -53,9 +53,10 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'nsDownloadScanner.cpp',
]
-# XXX - Until Suite builds off XULRunner we can't guarantee our implementation
-# of nsIDownloadManagerUI overrides toolkit's.
-if not CONFIG['MOZ_SUITE']:
+# The Communicator Downloads Manager uses its own DownloadManagerUI
+# component and it can't be guaranteed that its implimentation will override
+# toolkit's so don't include toolkit's
+if not CONFIG['MOZ_SUITE'] and not CONFIG['BINOC_COMM_DLMGR']:
EXTRA_COMPONENTS += [
'nsDownloadManagerUI.js',
'nsDownloadManagerUI.manifest',
diff --git a/toolkit/components/maintenanceservice/Makefile.in b/toolkit/components/maintenanceservice/Makefile.in
deleted file mode 100644
index b07afbb0a9..0000000000
--- a/toolkit/components/maintenanceservice/Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ifndef MOZ_WINCONSOLE
-ifdef MOZ_DEBUG
-MOZ_WINCONSOLE = 1
-else
-MOZ_WINCONSOLE = 0
-endif
-endif
-
-include $(topsrcdir)/config/rules.mk
diff --git a/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi b/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi
deleted file mode 100644
index d4d21e3777..0000000000
--- a/toolkit/components/maintenanceservice/bootstrapinstaller/maintenanceservice_installer.nsi
+++ /dev/null
@@ -1,275 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-; Set verbosity to 3 (e.g. no script) to lessen the noise in the build logs
-!verbose 3
-
-; 7-Zip provides better compression than the lzma from NSIS so we add the files
-; uncompressed and use 7-Zip to create a SFX archive of it
-SetDatablockOptimize on
-SetCompress off
-CRCCheck on
-
-RequestExecutionLevel admin
-
-; The commands inside this ifdef require NSIS 3.0a2 or greater so the ifdef can
-; be removed after we require NSIS 3.0a2 or greater.
-!ifdef NSIS_PACKEDVERSION
- Unicode true
- ManifestSupportedOS all
- ManifestDPIAware true
-!endif
-
-!addplugindir ./
-
-; Variables
-Var TempMaintServiceName
-Var BrandFullNameDA
-Var BrandFullName
-
-; Other included files may depend upon these includes!
-; The following includes are provided by NSIS.
-!include FileFunc.nsh
-!include LogicLib.nsh
-!include MUI.nsh
-!include WinMessages.nsh
-!include WinVer.nsh
-!include WordFunc.nsh
-
-!insertmacro GetOptions
-!insertmacro GetParameters
-!insertmacro GetSize
-
-; The test slaves use this fallback key to run tests.
-; And anyone that wants to run tests themselves should already have
-; this installed.
-!define FallbackKey \
- "SOFTWARE\Mozilla\MaintenanceService\3932ecacee736d366d6436db0f55bce4"
-
-!define CompanyName "Mozilla Corporation"
-!define BrandFullNameInternal ""
-
-; The following includes are custom.
-!include defines.nsi
-; We keep defines.nsi defined so that we get other things like
-; the version number, but we redefine BrandFullName
-!define MaintFullName "Mozilla Maintenance Service"
-!undef BrandFullName
-!define BrandFullName "${MaintFullName}"
-
-!include common.nsh
-!include locales.nsi
-
-VIAddVersionKey "FileDescription" "${MaintFullName} Installer"
-VIAddVersionKey "OriginalFilename" "maintenanceservice_installer.exe"
-
-Name "${MaintFullName}"
-OutFile "maintenanceservice_installer.exe"
-
-; Get installation folder from registry if available
-InstallDirRegKey HKLM "Software\Mozilla\MaintenanceService" ""
-
-SetOverwrite on
-
-!define MaintUninstallKey \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\MozillaMaintenanceService"
-
-; Always install into the 32-bit location even if we have a 64-bit build.
-; This is because we use only 1 service for all Firefox channels.
-; Allow either x86 and x64 builds to exist at this location, depending on
-; what is the latest build.
-InstallDir "$PROGRAMFILES32\${MaintFullName}\"
-ShowUnInstDetails nevershow
-
-################################################################################
-# Modern User Interface - MUI
-
-!define MUI_ICON setup.ico
-!define MUI_UNICON setup.ico
-!define MUI_WELCOMEPAGE_TITLE_3LINES
-!define MUI_UNWELCOMEFINISHPAGE_BITMAP wizWatermark.bmp
-
-;Interface Settings
-!define MUI_ABORTWARNING
-
-; Uninstaller Pages
-!insertmacro MUI_UNPAGE_CONFIRM
-!insertmacro MUI_UNPAGE_INSTFILES
-
-################################################################################
-# Language
-
-!insertmacro MOZ_MUI_LANGUAGE 'baseLocale'
-!verbose push
-!verbose 3
-!include "overrideLocale.nsh"
-!include "customLocale.nsh"
-!verbose pop
-
-; Set this after the locale files to override it if it is in the locale
-; using " " for BrandingText will hide the "Nullsoft Install System..." branding
-BrandingText " "
-
-Function .onInit
- ; Remove the current exe directory from the search order.
- ; This only effects LoadLibrary calls and not implicitly loaded DLLs.
- System::Call 'kernel32::SetDllDirectoryW(w "")'
-
- SetSilent silent
- ${Unless} ${AtLeastWin7}
- Abort
- ${EndUnless}
-FunctionEnd
-
-Function un.onInit
- ; Remove the current exe directory from the search order.
- ; This only effects LoadLibrary calls and not implicitly loaded DLLs.
- System::Call 'kernel32::SetDllDirectoryW(w "")'
-
-; The commands inside this ifndef are needed prior to NSIS 3.0a2 and can be
-; removed after we require NSIS 3.0a2 or greater.
-!ifndef NSIS_PACKEDVERSION
- ${If} ${AtLeastWinVista}
- System::Call 'user32::SetProcessDPIAware()'
- ${EndIf}
-!endif
-
- StrCpy $BrandFullNameDA "${MaintFullName}"
- StrCpy $BrandFullName "${MaintFullName}"
-FunctionEnd
-
-Section "MaintenanceService"
- AllowSkipFiles off
-
- CreateDirectory $INSTDIR
- SetOutPath $INSTDIR
-
- ; If the service already exists, then it will be stopped when upgrading it
- ; via the maintenanceservice_tmp.exe command executed below.
- ; The maintenanceservice_tmp.exe command will rename the file to
- ; maintenanceservice.exe if maintenanceservice_tmp.exe is newer.
- ; If the service does not exist yet, we install it and drop the file on
- ; disk as maintenanceservice.exe directly.
- StrCpy $TempMaintServiceName "maintenanceservice.exe"
- IfFileExists "$INSTDIR\maintenanceservice.exe" 0 skipAlreadyExists
- StrCpy $TempMaintServiceName "maintenanceservice_tmp.exe"
- skipAlreadyExists:
-
- ; We always write out a copy and then decide whether to install it or
- ; not via calling its 'install' cmdline which works by version comparison.
- CopyFiles "$EXEDIR\maintenanceservice.exe" "$INSTDIR\$TempMaintServiceName"
-
- ; The updater.ini file is only used when performing an install or upgrade,
- ; and only if that install or upgrade is successful. If an old updater.ini
- ; happened to be copied into the maintenance service installation directory
- ; but the service was not newer, the updater.ini file would be unused.
- ; It is used to fill the description of the service on success.
- CopyFiles "$EXEDIR\updater.ini" "$INSTDIR\updater.ini"
-
- ; Install the application maintenance service.
- ; If a service already exists, the command line parameter will stop the
- ; service and only install itself if it is newer than the already installed
- ; service. If successful it will remove the old maintenanceservice.exe
- ; and replace it with maintenanceservice_tmp.exe.
- ClearErrors
- ;${GetParameters} $0
- ;${GetOptions} "$0" "/Upgrade" $0
- ;${If} ${Errors}
- ExecWait '"$INSTDIR\$TempMaintServiceName" forceinstall'
- ;${Else}
- ; The upgrade cmdline is the same as install except
- ; It will fail if the service isn't already installed.
- ; ExecWait '"$INSTDIR\$TempMaintServiceName" upgrade'
- ;${EndIf}
-
- WriteUninstaller "$INSTDIR\Uninstall.exe"
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayName" "${MaintFullName}"
- WriteRegStr HKLM "${MaintUninstallKey}" "UninstallString" \
- '"$INSTDIR\uninstall.exe"'
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayIcon" \
- "$INSTDIR\Uninstall.exe,0"
- WriteRegStr HKLM "${MaintUninstallKey}" "DisplayVersion" "${AppVersion}"
- WriteRegStr HKLM "${MaintUninstallKey}" "Publisher" "Mozilla"
- WriteRegStr HKLM "${MaintUninstallKey}" "Comments" "${BrandFullName}"
- WriteRegDWORD HKLM "${MaintUninstallKey}" "NoModify" 1
- ${GetSize} "$INSTDIR" "/S=0K" $R2 $R3 $R4
- WriteRegDWORD HKLM "${MaintUninstallKey}" "EstimatedSize" $R2
-
- ; Write out that a maintenance service was attempted.
- ; We do this because on upgrades we will check this value and we only
- ; want to install once on the first upgrade to maintenance service.
- ; Also write out that we are currently installed, preferences will check
- ; this value to determine if we should show the service update pref.
- ; Since the Maintenance service can be installed either x86 or x64,
- ; always use the 64-bit registry for checking if an attempt was made.
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Attempted" 1
- WriteRegDWORD HKLM "Software\Mozilla\MaintenanceService" "Installed" 1
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
-
- ; Included here for debug purposes only.
- ; These keys are used to bypass the installation dir is a valid installation
- ; check from the service so that tests can be run.
- WriteRegStr HKLM "${FallbackKey}\0" "name" "Mozilla Corporation"
- WriteRegStr HKLM "${FallbackKey}\0" "issuer" "DigiCert SHA2 Assured ID Code Signing CA"
- WriteRegStr HKLM "${FallbackKey}\1" "name" "Mozilla Fake SPC"
- WriteRegStr HKLM "${FallbackKey}\1" "issuer" "Mozilla Fake CA"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-SectionEnd
-
-; By renaming before deleting we improve things slightly in case
-; there is a file in use error. In this case a new install can happen.
-Function un.RenameDelete
- Pop $9
- ; If the .moz-delete file already exists previously, delete it
- ; If it doesn't exist, the call is ignored.
- ; We don't need to pass /REBOOTOK here since it was already marked that way
- ; if it exists.
- Delete "$9.moz-delete"
- Rename "$9" "$9.moz-delete"
- ${If} ${Errors}
- Delete /REBOOTOK "$9"
- ${Else}
- Delete /REBOOTOK "$9.moz-delete"
- ${EndIf}
- ClearErrors
-FunctionEnd
-
-Section "Uninstall"
- ; Delete the service so that no updates will be attempted
- ExecWait '"$INSTDIR\maintenanceservice.exe" uninstall'
-
- Push "$INSTDIR\updater.ini"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice.exe"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice_tmp.exe"
- Call un.RenameDelete
- Push "$INSTDIR\maintenanceservice.old"
- Call un.RenameDelete
- Push "$INSTDIR\Uninstall.exe"
- Call un.RenameDelete
- Push "$INSTDIR\update\updater.ini"
- Call un.RenameDelete
- Push "$INSTDIR\update\updater.exe"
- Call un.RenameDelete
- RMDir /REBOOTOK "$INSTDIR\update"
- RMDir /REBOOTOK "$INSTDIR"
- DeleteRegKey HKLM "${MaintUninstallKey}"
-
- ${If} ${RunningX64}
- SetRegView 64
- ${EndIf}
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "Installed"
- DeleteRegValue HKLM "Software\Mozilla\MaintenanceService" "FFPrefetchDisabled"
- DeleteRegKey HKLM "${FallbackKey}\"
- ${If} ${RunningX64}
- SetRegView lastused
- ${EndIf}
-SectionEnd
-
diff --git a/toolkit/components/maintenanceservice/maintenanceservice.cpp b/toolkit/components/maintenanceservice/maintenanceservice.cpp
deleted file mode 100644
index f1275b095f..0000000000
--- a/toolkit/components/maintenanceservice/maintenanceservice.cpp
+++ /dev/null
@@ -1,391 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <windows.h>
-#include <shlwapi.h>
-#include <stdio.h>
-#include <wchar.h>
-#include <shlobj.h>
-
-#include "serviceinstall.h"
-#include "maintenanceservice.h"
-#include "servicebase.h"
-#include "workmonitor.h"
-#include "uachelper.h"
-#include "updatehelper.h"
-#include "registrycertificates.h"
-
-// Link w/ subsystem window so we don't get a console when executing
-// this binary through the installer.
-#pragma comment(linker, "/SUBSYSTEM:windows")
-
-SERVICE_STATUS gSvcStatus = { 0 };
-SERVICE_STATUS_HANDLE gSvcStatusHandle = nullptr;
-HANDLE gWorkDoneEvent = nullptr;
-HANDLE gThread = nullptr;
-bool gServiceControlStopping = false;
-
-// logs are pretty small, about 20 lines, so 10 seems reasonable.
-#define LOGS_TO_KEEP 10
-
-BOOL GetLogDirectoryPath(WCHAR *path);
-
-int
-wmain(int argc, WCHAR **argv)
-{
- // If command-line parameter is "install", install the service
- // or upgrade if already installed
- // If command line parameter is "forceinstall", install the service
- // even if it is older than what is already installed.
- // If command-line parameter is "upgrade", upgrade the service
- // but do not install it if it is not already installed.
- // If command line parameter is "uninstall", uninstall the service.
- // Otherwise, the service is probably being started by the SCM.
- bool forceInstall = !lstrcmpi(argv[1], L"forceinstall");
- if (!lstrcmpi(argv[1], L"install") || forceInstall) {
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- LogInit(updatePath, L"maintenanceservice-install.log");
- }
-
- SvcInstallAction action = InstallSvc;
- if (forceInstall) {
- action = ForceInstallSvc;
- LOG(("Installing service with force specified..."));
- } else {
- LOG(("Installing service..."));
- }
-
- bool ret = SvcInstall(action);
- if (!ret) {
- LOG_WARN(("Could not install service. (%d)", GetLastError()));
- LogFinish();
- return 1;
- }
-
- LOG(("The service was installed successfully"));
- LogFinish();
- return 0;
- }
-
- if (!lstrcmpi(argv[1], L"upgrade")) {
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- LogInit(updatePath, L"maintenanceservice-install.log");
- }
-
- LOG(("Upgrading service if installed..."));
- if (!SvcInstall(UpgradeSvc)) {
- LOG_WARN(("Could not upgrade service. (%d)", GetLastError()));
- LogFinish();
- return 1;
- }
-
- LOG(("The service was upgraded successfully"));
- LogFinish();
- return 0;
- }
-
- if (!lstrcmpi(argv[1], L"uninstall")) {
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- LogInit(updatePath, L"maintenanceservice-uninstall.log");
- }
- LOG(("Uninstalling service..."));
- if (!SvcUninstall()) {
- LOG_WARN(("Could not uninstall service. (%d)", GetLastError()));
- LogFinish();
- return 1;
- }
- LOG(("The service was uninstalled successfully"));
- LogFinish();
- return 0;
- }
-
- if (!lstrcmpi(argv[1], L"check-cert") && argc > 2) {
- return DoesBinaryMatchAllowedCertificates(argv[2], argv[3], FALSE) ? 0 : 1;
- }
-
- SERVICE_TABLE_ENTRYW DispatchTable[] = {
- { SVC_NAME, (LPSERVICE_MAIN_FUNCTIONW) SvcMain },
- { nullptr, nullptr }
- };
-
- // This call returns when the service has stopped.
- // The process should simply terminate when the call returns.
- if (!StartServiceCtrlDispatcherW(DispatchTable)) {
- LOG_WARN(("StartServiceCtrlDispatcher failed. (%d)", GetLastError()));
- }
-
- return 0;
-}
-
-/**
- * Obtains the base path where logs should be stored
- *
- * @param path The out buffer for the backup log path of size MAX_PATH + 1
- * @return TRUE if successful.
- */
-BOOL
-GetLogDirectoryPath(WCHAR *path)
-{
- if (!GetModuleFileNameW(nullptr, path, MAX_PATH)) {
- return FALSE;
- }
-
- if (!PathRemoveFileSpecW(path)) {
- return FALSE;
- }
-
- if (!PathAppendSafe(path, L"logs")) {
- return FALSE;
- }
- CreateDirectoryW(path, nullptr);
- return TRUE;
-}
-
-/**
- * Calculated a backup path based on the log number.
- *
- * @param path The out buffer to store the log path of size MAX_PATH + 1
- * @param basePath The base directory where the calculated path should go
- * @param logNumber The log number, 0 == updater.log
- * @return TRUE if successful.
- */
-BOOL
-GetBackupLogPath(LPWSTR path, LPCWSTR basePath, int logNumber)
-{
- WCHAR logName[64] = { L'\0' };
- wcsncpy(path, basePath, sizeof(logName) / sizeof(logName[0]) - 1);
- if (logNumber <= 0) {
- swprintf(logName, sizeof(logName) / sizeof(logName[0]),
- L"maintenanceservice.log");
- } else {
- swprintf(logName, sizeof(logName) / sizeof(logName[0]),
- L"maintenanceservice-%d.log", logNumber);
- }
- return PathAppendSafe(path, logName);
-}
-
-/**
- * Moves the old log files out of the way before a new one is written.
- * If you for example keep 3 logs, then this function will do:
- * updater2.log -> updater3.log
- * updater1.log -> updater2.log
- * updater.log -> updater1.log
- * Which clears room for a new updater.log in the basePath directory
- *
- * @param basePath The base directory path where log files are stored
- * @param numLogsToKeep The number of logs to keep
- */
-void
-BackupOldLogs(LPCWSTR basePath, int numLogsToKeep)
-{
- WCHAR oldPath[MAX_PATH + 1];
- WCHAR newPath[MAX_PATH + 1];
- for (int i = numLogsToKeep; i >= 1; i--) {
- if (!GetBackupLogPath(oldPath, basePath, i -1)) {
- continue;
- }
-
- if (!GetBackupLogPath(newPath, basePath, i)) {
- continue;
- }
-
- if (!MoveFileExW(oldPath, newPath, MOVEFILE_REPLACE_EXISTING)) {
- continue;
- }
- }
-}
-
-/**
- * Ensures the service is shutdown once all work is complete.
- * There is an issue on XP SP2 and below where the service can hang
- * in a stop pending state even though the SCM is notified of a stopped
- * state. Control *should* be returned to StartServiceCtrlDispatcher from the
- * call to SetServiceStatus on a stopped state in the wmain thread.
- * Sometimes this is not the case though. This thread will terminate the process
- * if it has been 5 seconds after all work is done and the process is still not
- * terminated. This thread is only started once a stopped state was sent to the
- * SCM. The stop pending hang can be reproduced intermittently even if you set
- * a stopped state dirctly and never set a stop pending state. It is safe to
- * forcefully terminate the process ourselves since all work is done once we
- * start this thread.
-*/
-DWORD WINAPI
-EnsureProcessTerminatedThread(LPVOID)
-{
- Sleep(5000);
- exit(0);
- return 0;
-}
-
-void
-StartTerminationThread()
-{
- // If the process does not self terminate like it should, this thread
- // will terminate the process after 5 seconds.
- HANDLE thread = CreateThread(nullptr, 0, EnsureProcessTerminatedThread,
- nullptr, 0, nullptr);
- if (thread) {
- CloseHandle(thread);
- }
-}
-
-/**
- * Main entry point when running as a service.
- */
-void WINAPI
-SvcMain(DWORD argc, LPWSTR *argv)
-{
- // Setup logging, and backup the old logs
- WCHAR updatePath[MAX_PATH + 1];
- if (GetLogDirectoryPath(updatePath)) {
- BackupOldLogs(updatePath, LOGS_TO_KEEP);
- LogInit(updatePath, L"maintenanceservice.log");
- }
-
- // Disable every privilege we don't need. Processes started using
- // CreateProcess will use the same token as this process.
- UACHelper::DisablePrivileges(nullptr);
-
- // Register the handler function for the service
- gSvcStatusHandle = RegisterServiceCtrlHandlerW(SVC_NAME, SvcCtrlHandler);
- if (!gSvcStatusHandle) {
- LOG_WARN(("RegisterServiceCtrlHandler failed. (%d)", GetLastError()));
- ExecuteServiceCommand(argc, argv);
- LogFinish();
- exit(1);
- }
-
- // These values will be re-used later in calls involving gSvcStatus
- gSvcStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
- gSvcStatus.dwServiceSpecificExitCode = 0;
-
- // Report initial status to the SCM
- ReportSvcStatus(SERVICE_START_PENDING, NO_ERROR, 3000);
-
- // This event will be used to tell the SvcCtrlHandler when the work is
- // done for when a stop comamnd is manually issued.
- gWorkDoneEvent = CreateEvent(nullptr, TRUE, FALSE, nullptr);
- if (!gWorkDoneEvent) {
- ReportSvcStatus(SERVICE_STOPPED, 1, 0);
- StartTerminationThread();
- return;
- }
-
- // Initialization complete and we're about to start working on
- // the actual command. Report the service state as running to the SCM.
- ReportSvcStatus(SERVICE_RUNNING, NO_ERROR, 0);
-
- // The service command was executed, stop logging and set an event
- // to indicate the work is done in case someone is waiting on a
- // service stop operation.
- ExecuteServiceCommand(argc, argv);
- LogFinish();
-
- SetEvent(gWorkDoneEvent);
-
- // If we aren't already in a stopping state then tell the SCM we're stopped
- // now. If we are already in a stopping state then the SERVICE_STOPPED state
- // will be set by the SvcCtrlHandler.
- if (!gServiceControlStopping) {
- ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
- StartTerminationThread();
- }
-}
-
-/**
- * Sets the current service status and reports it to the SCM.
- *
- * @param currentState The current state (see SERVICE_STATUS)
- * @param exitCode The system error code
- * @param waitHint Estimated time for pending operation in milliseconds
- */
-void
-ReportSvcStatus(DWORD currentState,
- DWORD exitCode,
- DWORD waitHint)
-{
- static DWORD dwCheckPoint = 1;
-
- gSvcStatus.dwCurrentState = currentState;
- gSvcStatus.dwWin32ExitCode = exitCode;
- gSvcStatus.dwWaitHint = waitHint;
-
- if (SERVICE_START_PENDING == currentState ||
- SERVICE_STOP_PENDING == currentState) {
- gSvcStatus.dwControlsAccepted = 0;
- } else {
- gSvcStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP |
- SERVICE_ACCEPT_SHUTDOWN;
- }
-
- if ((SERVICE_RUNNING == currentState) ||
- (SERVICE_STOPPED == currentState)) {
- gSvcStatus.dwCheckPoint = 0;
- } else {
- gSvcStatus.dwCheckPoint = dwCheckPoint++;
- }
-
- // Report the status of the service to the SCM.
- SetServiceStatus(gSvcStatusHandle, &gSvcStatus);
-}
-
-/**
- * Since the SvcCtrlHandler should only spend at most 30 seconds before
- * returning, this function does the service stop work for the SvcCtrlHandler.
-*/
-DWORD WINAPI
-StopServiceAndWaitForCommandThread(LPVOID)
-{
- do {
- ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 1000);
- } while(WaitForSingleObject(gWorkDoneEvent, 100) == WAIT_TIMEOUT);
- CloseHandle(gWorkDoneEvent);
- gWorkDoneEvent = nullptr;
- ReportSvcStatus(SERVICE_STOPPED, NO_ERROR, 0);
- StartTerminationThread();
- return 0;
-}
-
-/**
- * Called by SCM whenever a control code is sent to the service
- * using the ControlService function.
- */
-void WINAPI
-SvcCtrlHandler(DWORD dwCtrl)
-{
- // After a SERVICE_CONTROL_STOP there should be no more commands sent to
- // the SvcCtrlHandler.
- if (gServiceControlStopping) {
- return;
- }
-
- // Handle the requested control code.
- switch(dwCtrl) {
- case SERVICE_CONTROL_SHUTDOWN:
- case SERVICE_CONTROL_STOP: {
- gServiceControlStopping = true;
- ReportSvcStatus(SERVICE_STOP_PENDING, NO_ERROR, 1000);
-
- // The SvcCtrlHandler thread should not spend more than 30 seconds in
- // shutdown so we spawn a new thread for stopping the service
- HANDLE thread = CreateThread(nullptr, 0,
- StopServiceAndWaitForCommandThread,
- nullptr, 0, nullptr);
- if (thread) {
- CloseHandle(thread);
- } else {
- // Couldn't start the thread so just call the stop ourselves.
- // If it happens to take longer than 30 seconds the caller will
- // get an error.
- StopServiceAndWaitForCommandThread(nullptr);
- }
- }
- break;
- default:
- break;
- }
-}
diff --git a/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest b/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest
deleted file mode 100644
index e6bfba8ca5..0000000000
--- a/toolkit/components/maintenanceservice/maintenanceservice.exe.manifest
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-<assemblyIdentity
- version="1.0.0.0"
- processorArchitecture="*"
- name="MaintenanceService"
- type="win32"
-/>
-<description>MaintenanceService</description>
-<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
- <ms_asmv3:security>
- <ms_asmv3:requestedPrivileges>
- <ms_asmv3:requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
- </ms_asmv3:requestedPrivileges>
- </ms_asmv3:security>
-</ms_asmv3:trustInfo>
- <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
- <application>
- <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
- <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
- <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
- <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
- </application>
- </compatibility>
-</assembly>
diff --git a/toolkit/components/maintenanceservice/maintenanceservice.h b/toolkit/components/maintenanceservice/maintenanceservice.h
deleted file mode 100644
index 9e02914a0e..0000000000
--- a/toolkit/components/maintenanceservice/maintenanceservice.h
+++ /dev/null
@@ -1,10 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-void WINAPI SvcMain(DWORD dwArgc, LPWSTR *lpszArgv);
-void SvcInit(DWORD dwArgc, LPWSTR *lpszArgv);
-void WINAPI SvcCtrlHandler(DWORD dwCtrl);
-void ReportSvcStatus(DWORD dwCurrentState,
- DWORD dwWin32ExitCode,
- DWORD dwWaitHint);
diff --git a/toolkit/components/maintenanceservice/maintenanceservice.rc b/toolkit/components/maintenanceservice/maintenanceservice.rc
deleted file mode 100644
index ddd3e942b8..0000000000
--- a/toolkit/components/maintenanceservice/maintenanceservice.rc
+++ /dev/null
@@ -1,86 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winresrc.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// RT_MANIFEST
-//
-
-1 RT_MANIFEST "maintenanceservice.exe.manifest"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""winresrc.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/toolkit/components/maintenanceservice/moz.build b/toolkit/components/maintenanceservice/moz.build
deleted file mode 100644
index 2c54c8c762..0000000000
--- a/toolkit/components/maintenanceservice/moz.build
+++ /dev/null
@@ -1,54 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Program('maintenanceservice')
-
-SOURCES += [
- 'maintenanceservice.cpp',
- 'servicebase.cpp',
- 'serviceinstall.cpp',
- 'workmonitor.cpp',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- USE_LIBS += [
- 'updatecommon-standalone',
- ]
-else:
- USE_LIBS += [
- 'updatecommon',
- ]
-
-# For debugging purposes only
-#DEFINES['DISABLE_UPDATER_AUTHENTICODE_CHECK'] = True
-
-DEFINES['UNICODE'] = True
-DEFINES['_UNICODE'] = True
-DEFINES['NS_NO_XPCOM'] = True
-
-# Pick up nsWindowsRestart.cpp
-LOCAL_INCLUDES += [
- '/toolkit/mozapps/update/common',
- '/toolkit/xre',
-]
-
-USE_STATIC_LIBS = True
-
-if CONFIG['_MSC_VER']:
- WIN32_EXE_LDFLAGS += ['-ENTRY:wmainCRTStartup']
-
-RCINCLUDE = 'maintenanceservice.rc'
-
-DISABLE_STL_WRAPPING = True
-
-OS_LIBS += [
- 'comctl32',
- 'ws2_32',
- 'shell32',
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Application Update')
diff --git a/toolkit/components/maintenanceservice/resource.h b/toolkit/components/maintenanceservice/resource.h
deleted file mode 100644
index 45619457c9..0000000000
--- a/toolkit/components/maintenanceservice/resource.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by updater.rc
-//
-#define IDI_DIALOG 1003
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 102
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1003
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/toolkit/components/maintenanceservice/servicebase.cpp b/toolkit/components/maintenanceservice/servicebase.cpp
deleted file mode 100644
index a858c4537e..0000000000
--- a/toolkit/components/maintenanceservice/servicebase.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "servicebase.h"
-#include "nsWindowsHelpers.h"
-
-// Shared code between applications and updater.exe
-#include "nsWindowsRestart.cpp"
-
-/**
- * Verifies if 2 files are byte for byte equivalent.
- *
- * @param file1Path The first file to verify.
- * @param file2Path The second file to verify.
- * @param sameContent Out parameter, TRUE if the files are equal
- * @return TRUE If there was no error checking the files.
- */
-BOOL
-VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent)
-{
- sameContent = FALSE;
- nsAutoHandle file1(CreateFileW(file1Path, GENERIC_READ, FILE_SHARE_READ,
- nullptr, OPEN_EXISTING, 0, nullptr));
- if (INVALID_HANDLE_VALUE == file1) {
- return FALSE;
- }
- nsAutoHandle file2(CreateFileW(file2Path, GENERIC_READ, FILE_SHARE_READ,
- nullptr, OPEN_EXISTING, 0, nullptr));
- if (INVALID_HANDLE_VALUE == file2) {
- return FALSE;
- }
-
- DWORD fileSize1 = GetFileSize(file1, nullptr);
- DWORD fileSize2 = GetFileSize(file2, nullptr);
- if (INVALID_FILE_SIZE == fileSize1 || INVALID_FILE_SIZE == fileSize2) {
- return FALSE;
- }
-
- if (fileSize1 != fileSize2) {
- // sameContent is already set to FALSE
- return TRUE;
- }
-
- char buf1[COMPARE_BLOCKSIZE];
- char buf2[COMPARE_BLOCKSIZE];
- DWORD numBlocks = fileSize1 / COMPARE_BLOCKSIZE;
- DWORD leftOver = fileSize1 % COMPARE_BLOCKSIZE;
- DWORD readAmount;
- for (DWORD i = 0; i < numBlocks; i++) {
- if (!ReadFile(file1, buf1, COMPARE_BLOCKSIZE, &readAmount, nullptr) ||
- readAmount != COMPARE_BLOCKSIZE) {
- return FALSE;
- }
-
- if (!ReadFile(file2, buf2, COMPARE_BLOCKSIZE, &readAmount, nullptr) ||
- readAmount != COMPARE_BLOCKSIZE) {
- return FALSE;
- }
-
- if (memcmp(buf1, buf2, COMPARE_BLOCKSIZE)) {
- // sameContent is already set to FALSE
- return TRUE;
- }
- }
-
- if (leftOver) {
- if (!ReadFile(file1, buf1, leftOver, &readAmount, nullptr) ||
- readAmount != leftOver) {
- return FALSE;
- }
-
- if (!ReadFile(file2, buf2, leftOver, &readAmount, nullptr) ||
- readAmount != leftOver) {
- return FALSE;
- }
-
- if (memcmp(buf1, buf2, leftOver)) {
- // sameContent is already set to FALSE
- return TRUE;
- }
- }
-
- sameContent = TRUE;
- return TRUE;
-}
diff --git a/toolkit/components/maintenanceservice/servicebase.h b/toolkit/components/maintenanceservice/servicebase.h
deleted file mode 100644
index 4479814895..0000000000
--- a/toolkit/components/maintenanceservice/servicebase.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <windows.h>
-#include "updatecommon.h"
-
-BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra);
-BOOL VerifySameFiles(LPCWSTR file1Path, LPCWSTR file2Path, BOOL &sameContent);
-
-// 32KiB for comparing files at a time seems reasonable.
-// The bigger the better for speed, but this will be used
-// on the stack so I don't want it to be too big.
-#define COMPARE_BLOCKSIZE 32768
-
-// The following string resource value is used to uniquely identify the signed
-// Mozilla application as an updater. Before the maintenance service will
-// execute the updater it must have this updater identity string in its string
-// table. No other signed Mozilla product will have this string table value.
-#define UPDATER_IDENTITY_STRING \
- "moz-updater.exe-4cdccec4-5ee0-4a06-9817-4cd899a9db49"
-#define IDS_UPDATER_IDENTITY 1006
diff --git a/toolkit/components/maintenanceservice/serviceinstall.cpp b/toolkit/components/maintenanceservice/serviceinstall.cpp
deleted file mode 100644
index 3b9522d47c..0000000000
--- a/toolkit/components/maintenanceservice/serviceinstall.cpp
+++ /dev/null
@@ -1,759 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <windows.h>
-#include <aclapi.h>
-#include <stdlib.h>
-#include <shlwapi.h>
-
-// Used for DNLEN and UNLEN
-#include <lm.h>
-
-#include <nsWindowsHelpers.h>
-#include "mozilla/UniquePtr.h"
-
-#include "serviceinstall.h"
-#include "servicebase.h"
-#include "updatehelper.h"
-#include "shellapi.h"
-#include "readstrings.h"
-#include "errors.h"
-
-#pragma comment(lib, "version.lib")
-
-// This uninstall key is defined originally in maintenanceservice_installer.nsi
-#define MAINT_UNINSTALL_KEY L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MozillaMaintenanceService"
-
-static BOOL
-UpdateUninstallerVersionString(LPWSTR versionString)
-{
- HKEY uninstallKey;
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- MAINT_UNINSTALL_KEY, 0,
- KEY_WRITE | KEY_WOW64_32KEY,
- &uninstallKey) != ERROR_SUCCESS) {
- return FALSE;
- }
-
- LONG rv = RegSetValueExW(uninstallKey, L"DisplayVersion", 0, REG_SZ,
- reinterpret_cast<const BYTE *>(versionString),
- (wcslen(versionString) + 1) * sizeof(WCHAR));
- RegCloseKey(uninstallKey);
- return rv == ERROR_SUCCESS;
-}
-
-/**
- * A wrapper function to read strings for the maintenance service.
- *
- * @param path The path of the ini file to read from
- * @param results The maintenance service strings that were read
- * @return OK on success
-*/
-static int
-ReadMaintenanceServiceStrings(LPCWSTR path,
- MaintenanceServiceStringTable *results)
-{
- // Read in the maintenance service description string if specified.
- const unsigned int kNumStrings = 1;
- const char *kServiceKeys = "MozillaMaintenanceDescription\0";
- char serviceStrings[kNumStrings][MAX_TEXT_LEN];
- int result = ReadStrings(path, kServiceKeys,
- kNumStrings, serviceStrings);
- if (result != OK) {
- serviceStrings[0][0] = '\0';
- }
- strncpy(results->serviceDescription,
- serviceStrings[0], MAX_TEXT_LEN - 1);
- results->serviceDescription[MAX_TEXT_LEN - 1] = '\0';
- return result;
-}
-
-/**
- * Obtains the version number from the specified PE file's version information
- * Version Format: A.B.C.D (Example 10.0.0.300)
- *
- * @param path The path of the file to check the version on
- * @param A The first part of the version number
- * @param B The second part of the version number
- * @param C The third part of the version number
- * @param D The fourth part of the version number
- * @return TRUE if successful
- */
-static BOOL
-GetVersionNumberFromPath(LPWSTR path, DWORD &A, DWORD &B,
- DWORD &C, DWORD &D)
-{
- DWORD fileVersionInfoSize = GetFileVersionInfoSizeW(path, 0);
- mozilla::UniquePtr<char[]> fileVersionInfo(new char[fileVersionInfoSize]);
- if (!GetFileVersionInfoW(path, 0, fileVersionInfoSize,
- fileVersionInfo.get())) {
- LOG_WARN(("Could not obtain file info of old service. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- VS_FIXEDFILEINFO *fixedFileInfo =
- reinterpret_cast<VS_FIXEDFILEINFO *>(fileVersionInfo.get());
- UINT size;
- if (!VerQueryValueW(fileVersionInfo.get(), L"\\",
- reinterpret_cast<LPVOID*>(&fixedFileInfo), &size)) {
- LOG_WARN(("Could not query file version info of old service. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- A = HIWORD(fixedFileInfo->dwFileVersionMS);
- B = LOWORD(fixedFileInfo->dwFileVersionMS);
- C = HIWORD(fixedFileInfo->dwFileVersionLS);
- D = LOWORD(fixedFileInfo->dwFileVersionLS);
- return TRUE;
-}
-
-/**
- * Updates the service description with what is stored in updater.ini
- * at the same path as the currently executing module binary.
- *
- * @param serviceHandle A handle to an opened service with
- * SERVICE_CHANGE_CONFIG access right
- * @param TRUE on succcess.
-*/
-BOOL
-UpdateServiceDescription(SC_HANDLE serviceHandle)
-{
- WCHAR updaterINIPath[MAX_PATH + 1];
- if (!GetModuleFileNameW(nullptr, updaterINIPath,
- sizeof(updaterINIPath) /
- sizeof(updaterINIPath[0]))) {
- LOG_WARN(("Could not obtain module filename when attempting to "
- "modify service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!PathRemoveFileSpecW(updaterINIPath)) {
- LOG_WARN(("Could not remove file spec when attempting to "
- "modify service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!PathAppendSafe(updaterINIPath, L"updater.ini")) {
- LOG_WARN(("Could not append updater.ini filename when attempting to "
- "modify service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (GetFileAttributesW(updaterINIPath) == INVALID_FILE_ATTRIBUTES) {
- LOG_WARN(("updater.ini file does not exist, will not modify "
- "service description. (%d)", GetLastError()));
- return FALSE;
- }
-
- MaintenanceServiceStringTable serviceStrings;
- int rv = ReadMaintenanceServiceStrings(updaterINIPath, &serviceStrings);
- if (rv != OK || !strlen(serviceStrings.serviceDescription)) {
- LOG_WARN(("updater.ini file does not contain a maintenance "
- "service description."));
- return FALSE;
- }
-
- WCHAR serviceDescription[MAX_TEXT_LEN];
- if (!MultiByteToWideChar(CP_UTF8, 0,
- serviceStrings.serviceDescription, -1,
- serviceDescription,
- sizeof(serviceDescription) /
- sizeof(serviceDescription[0]))) {
- LOG_WARN(("Could not convert description to wide string format. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- SERVICE_DESCRIPTIONW descriptionConfig;
- descriptionConfig.lpDescription = serviceDescription;
- if (!ChangeServiceConfig2W(serviceHandle,
- SERVICE_CONFIG_DESCRIPTION,
- &descriptionConfig)) {
- LOG_WARN(("Could not change service config. (%d)", GetLastError()));
- return FALSE;
- }
-
- LOG(("The service description was updated successfully."));
- return TRUE;
-}
-
-/**
- * Determines if the MozillaMaintenance service path needs to be updated
- * and fixes it if it is wrong.
- *
- * @param service A handle to the service to fix.
- * @param currentServicePath The current (possibly wrong) path that is used.
- * @param servicePathWasWrong Out parameter set to TRUE if a fix was needed.
- * @return TRUE if the service path is now correct.
-*/
-BOOL
-FixServicePath(SC_HANDLE service,
- LPCWSTR currentServicePath,
- BOOL &servicePathWasWrong)
-{
- // When we originally upgraded the MozillaMaintenance service we
- // would uninstall the service on each upgrade. This had an
- // intermittent error which could cause the service to use the file
- // maintenanceservice_tmp.exe as the install path. Only a small number
- // of Nightly users would be affected by this, but we check for this
- // state here and fix the user if they are affected.
- //
- // We also fix the path in the case of the path not being quoted.
- size_t currentServicePathLen = wcslen(currentServicePath);
- bool doesServiceHaveCorrectPath =
- currentServicePathLen > 2 &&
- !wcsstr(currentServicePath, L"maintenanceservice_tmp.exe") &&
- currentServicePath[0] == L'\"' &&
- currentServicePath[currentServicePathLen - 1] == L'\"';
-
- if (doesServiceHaveCorrectPath) {
- LOG(("The MozillaMaintenance service path is correct."));
- servicePathWasWrong = FALSE;
- return TRUE;
- }
- // This is a recoverable situation so not logging as a warning
- LOG(("The MozillaMaintenance path is NOT correct. It was: %ls",
- currentServicePath));
-
- servicePathWasWrong = TRUE;
- WCHAR fixedPath[MAX_PATH + 1] = { L'\0' };
- wcsncpy(fixedPath, currentServicePath, MAX_PATH);
- PathUnquoteSpacesW(fixedPath);
- if (!PathRemoveFileSpecW(fixedPath)) {
- LOG_WARN(("Couldn't remove file spec. (%d)", GetLastError()));
- return FALSE;
- }
- if (!PathAppendSafe(fixedPath, L"maintenanceservice.exe")) {
- LOG_WARN(("Couldn't append file spec. (%d)", GetLastError()));
- return FALSE;
- }
- PathQuoteSpacesW(fixedPath);
-
-
- if (!ChangeServiceConfigW(service, SERVICE_NO_CHANGE, SERVICE_NO_CHANGE,
- SERVICE_NO_CHANGE, fixedPath, nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr)) {
- LOG_WARN(("Could not fix service path. (%d)", GetLastError()));
- return FALSE;
- }
-
- LOG(("Fixed service path to: %ls.", fixedPath));
- return TRUE;
-}
-
-/**
- * Installs or upgrades the SVC_NAME service.
- * If an existing service is already installed, we replace it with the
- * currently running process.
- *
- * @param action The action to perform.
- * @return TRUE if the service was installed/upgraded
- */
-BOOL
-SvcInstall(SvcInstallAction action)
-{
- // Get a handle to the local computer SCM database with full access rights.
- nsAutoServiceHandle schSCManager(OpenSCManager(nullptr, nullptr,
- SC_MANAGER_ALL_ACCESS));
- if (!schSCManager) {
- LOG_WARN(("Could not open service manager. (%d)", GetLastError()));
- return FALSE;
- }
-
- WCHAR newServiceBinaryPath[MAX_PATH + 1];
- if (!GetModuleFileNameW(nullptr, newServiceBinaryPath,
- sizeof(newServiceBinaryPath) /
- sizeof(newServiceBinaryPath[0]))) {
- LOG_WARN(("Could not obtain module filename when attempting to "
- "install service. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- // Check if we already have the service installed.
- nsAutoServiceHandle schService(OpenServiceW(schSCManager,
- SVC_NAME,
- SERVICE_ALL_ACCESS));
- DWORD lastError = GetLastError();
- if (!schService && ERROR_SERVICE_DOES_NOT_EXIST != lastError) {
- // The service exists but we couldn't open it
- LOG_WARN(("Could not open service. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (schService) {
- // The service exists but it may not have the correct permissions.
- // This could happen if the permissions were not set correctly originally
- // or have been changed after the installation. This will reset the
- // permissions back to allow limited user accounts.
- if (!SetUserAccessServiceDACL(schService)) {
- LOG_WARN(("Could not reset security ACE on service handle. It might not be "
- "possible to start the service. This error should never "
- "happen. (%d)", GetLastError()));
- }
-
- // The service exists and we opened it
- DWORD bytesNeeded;
- if (!QueryServiceConfigW(schService, nullptr, 0, &bytesNeeded) &&
- GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- LOG_WARN(("Could not determine buffer size for query service config. (%d)",
- GetLastError()));
- return FALSE;
- }
-
- // Get the service config information, in particular we want the binary
- // path of the service.
- mozilla::UniquePtr<char[]> serviceConfigBuffer(new char[bytesNeeded]);
- if (!QueryServiceConfigW(schService,
- reinterpret_cast<QUERY_SERVICE_CONFIGW*>(serviceConfigBuffer.get()),
- bytesNeeded, &bytesNeeded)) {
- LOG_WARN(("Could open service but could not query service config. (%d)",
- GetLastError()));
- return FALSE;
- }
- QUERY_SERVICE_CONFIGW &serviceConfig =
- *reinterpret_cast<QUERY_SERVICE_CONFIGW*>(serviceConfigBuffer.get());
-
- // Check if we need to fix the service path
- BOOL servicePathWasWrong;
- static BOOL alreadyCheckedFixServicePath = FALSE;
- if (!alreadyCheckedFixServicePath) {
- if (!FixServicePath(schService, serviceConfig.lpBinaryPathName,
- servicePathWasWrong)) {
- LOG_WARN(("Could not fix service path. This should never happen. (%d)",
- GetLastError()));
- // True is returned because the service is pointing to
- // maintenanceservice_tmp.exe so it actually was upgraded to the
- // newest installed service.
- return TRUE;
- } else if (servicePathWasWrong) {
- // Now that the path is fixed we should re-attempt the install.
- // This current process' image path is maintenanceservice_tmp.exe.
- // The service used to point to maintenanceservice_tmp.exe.
- // The service was just fixed to point to maintenanceservice.exe.
- // Re-attempting an install from scratch will work as normal.
- alreadyCheckedFixServicePath = TRUE;
- LOG(("Restarting install action: %d", action));
- return SvcInstall(action);
- }
- }
-
- // Ensure the service path is not quoted. We own this memory and know it to
- // be large enough for the quoted path, so it is large enough for the
- // unquoted path. This function cannot fail.
- PathUnquoteSpacesW(serviceConfig.lpBinaryPathName);
-
- // Obtain the existing maintenanceservice file's version number and
- // the new file's version number. Versions are in the format of
- // A.B.C.D.
- DWORD existingA, existingB, existingC, existingD;
- DWORD newA, newB, newC, newD;
- BOOL obtainedExistingVersionInfo =
- GetVersionNumberFromPath(serviceConfig.lpBinaryPathName,
- existingA, existingB,
- existingC, existingD);
- if (!GetVersionNumberFromPath(newServiceBinaryPath, newA,
- newB, newC, newD)) {
- LOG_WARN(("Could not obtain version number from new path"));
- return FALSE;
- }
-
- // Check if we need to replace the old binary with the new one
- // If we couldn't get the old version info then we assume we should
- // replace it.
- if (ForceInstallSvc == action ||
- !obtainedExistingVersionInfo ||
- (existingA < newA) ||
- (existingA == newA && existingB < newB) ||
- (existingA == newA && existingB == newB &&
- existingC < newC) ||
- (existingA == newA && existingB == newB &&
- existingC == newC && existingD < newD)) {
-
- // We have a newer updater, so update the description from the INI file.
- UpdateServiceDescription(schService);
-
- schService.reset();
- if (!StopService()) {
- return FALSE;
- }
-
- if (!wcscmp(newServiceBinaryPath, serviceConfig.lpBinaryPathName)) {
- LOG(("File is already in the correct location, no action needed for "
- "upgrade. The path is: \"%ls\"", newServiceBinaryPath));
- return TRUE;
- }
-
- BOOL result = TRUE;
-
- // Attempt to copy the new binary over top the existing binary.
- // If there is an error we try to move it out of the way and then
- // copy it in. First try the safest / easiest way to overwrite the file.
- if (!CopyFileW(newServiceBinaryPath,
- serviceConfig.lpBinaryPathName, FALSE)) {
- LOG_WARN(("Could not overwrite old service binary file. "
- "This should never happen, but if it does the next "
- "upgrade will fix it, the service is not a critical "
- "component that needs to be installed for upgrades "
- "to work. (%d)", GetLastError()));
-
- // We rename the last 3 filename chars in an unsafe way. Manually
- // verify there are more than 3 chars for safe failure in MoveFileExW.
- const size_t len = wcslen(serviceConfig.lpBinaryPathName);
- if (len > 3) {
- // Calculate the temp file path that we're moving the file to. This
- // is the same as the proper service path but with a .old extension.
- LPWSTR oldServiceBinaryTempPath =
- new WCHAR[len + 1];
- memset(oldServiceBinaryTempPath, 0, (len + 1) * sizeof (WCHAR));
- wcsncpy(oldServiceBinaryTempPath, serviceConfig.lpBinaryPathName, len);
- // Rename the last 3 chars to 'old'
- wcsncpy(oldServiceBinaryTempPath + len - 3, L"old", 3);
-
- // Move the current (old) service file to the temp path.
- if (MoveFileExW(serviceConfig.lpBinaryPathName,
- oldServiceBinaryTempPath,
- MOVEFILE_REPLACE_EXISTING | MOVEFILE_WRITE_THROUGH)) {
- // The old binary is moved out of the way, copy in the new one.
- if (!CopyFileW(newServiceBinaryPath,
- serviceConfig.lpBinaryPathName, FALSE)) {
- // It is best to leave the old service binary in this condition.
- LOG_WARN(("The new service binary could not be copied in."
- " The service will not be upgraded."));
- result = FALSE;
- } else {
- LOG(("The new service binary was copied in by first moving the"
- " old one out of the way."));
- }
-
- // Attempt to get rid of the old service temp path.
- if (DeleteFileW(oldServiceBinaryTempPath)) {
- LOG(("The old temp service path was deleted: %ls.",
- oldServiceBinaryTempPath));
- } else {
- // The old temp path could not be removed. It will be removed
- // the next time the user can't copy the binary in or on uninstall.
- LOG_WARN(("The old temp service path was not deleted."));
- }
- } else {
- // It is best to leave the old service binary in this condition.
- LOG_WARN(("Could not move old service file out of the way from:"
- " \"%ls\" to \"%ls\". Service will not be upgraded. (%d)",
- serviceConfig.lpBinaryPathName,
- oldServiceBinaryTempPath, GetLastError()));
- result = FALSE;
- }
- delete[] oldServiceBinaryTempPath;
- } else {
- // It is best to leave the old service binary in this condition.
- LOG_WARN(("Service binary path was less than 3, service will"
- " not be updated. This should never happen."));
- result = FALSE;
- }
- } else {
- WCHAR versionStr[128] = { L'\0' };
- swprintf(versionStr, 128, L"%d.%d.%d.%d", newA, newB, newC, newD);
- if (!UpdateUninstallerVersionString(versionStr)) {
- LOG(("The uninstaller version string could not be updated."));
- }
- LOG(("The new service binary was copied in."));
- }
-
- // We made a copy of ourselves to the existing location.
- // The tmp file (the process of which we are executing right now) will be
- // left over. Attempt to delete the file on the next reboot.
- if (MoveFileExW(newServiceBinaryPath, nullptr,
- MOVEFILE_DELAY_UNTIL_REBOOT)) {
- LOG(("Deleting the old file path on the next reboot: %ls.",
- newServiceBinaryPath));
- } else {
- LOG_WARN(("Call to delete the old file path failed: %ls.",
- newServiceBinaryPath));
- }
-
- return result;
- }
-
- // We don't need to copy ourselves to the existing location.
- // The tmp file (the process of which we are executing right now) will be
- // left over. Attempt to delete the file on the next reboot.
- MoveFileExW(newServiceBinaryPath, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT);
-
- // nothing to do, we already have a newer service installed
- return TRUE;
- }
-
- // If the service does not exist and we are upgrading, don't install it.
- if (UpgradeSvc == action) {
- // The service does not exist and we are upgrading, so don't install it
- return TRUE;
- }
-
- // Quote the path only if it contains spaces.
- PathQuoteSpacesW(newServiceBinaryPath);
- // The service does not already exist so create the service as on demand
- schService.own(CreateServiceW(schSCManager, SVC_NAME, SVC_DISPLAY_NAME,
- SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
- SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL,
- newServiceBinaryPath, nullptr, nullptr,
- nullptr, nullptr, nullptr));
- if (!schService) {
- LOG_WARN(("Could not create Windows service. "
- "This error should never happen since a service install "
- "should only be called when elevated. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!SetUserAccessServiceDACL(schService)) {
- LOG_WARN(("Could not set security ACE on service handle, the service will not "
- "be able to be started from unelevated processes. "
- "This error should never happen. (%d)",
- GetLastError()));
- }
-
- UpdateServiceDescription(schService);
-
- return TRUE;
-}
-
-/**
- * Stops the Maintenance service.
- *
- * @return TRUE if successful.
- */
-BOOL
-StopService()
-{
- // Get a handle to the local computer SCM database with full access rights.
- nsAutoServiceHandle schSCManager(OpenSCManager(nullptr, nullptr,
- SC_MANAGER_ALL_ACCESS));
- if (!schSCManager) {
- LOG_WARN(("Could not open service manager. (%d)", GetLastError()));
- return FALSE;
- }
-
- // Open the service
- nsAutoServiceHandle schService(OpenServiceW(schSCManager, SVC_NAME,
- SERVICE_ALL_ACCESS));
- if (!schService) {
- LOG_WARN(("Could not open service. (%d)", GetLastError()));
- return FALSE;
- }
-
- LOG(("Sending stop request..."));
- SERVICE_STATUS status;
- SetLastError(ERROR_SUCCESS);
- if (!ControlService(schService, SERVICE_CONTROL_STOP, &status) &&
- GetLastError() != ERROR_SERVICE_NOT_ACTIVE) {
- LOG_WARN(("Error sending stop request. (%d)", GetLastError()));
- }
-
- schSCManager.reset();
- schService.reset();
-
- LOG(("Waiting for service stop..."));
- DWORD lastState = WaitForServiceStop(SVC_NAME, 30);
-
- // The service can be in a stopped state but the exe still in use
- // so make sure the process is really gone before proceeding
- WaitForProcessExit(L"maintenanceservice.exe", 30);
- LOG(("Done waiting for service stop, last service state: %d", lastState));
-
- return lastState == SERVICE_STOPPED;
-}
-
-/**
- * Uninstalls the Maintenance service.
- *
- * @return TRUE if successful.
- */
-BOOL
-SvcUninstall()
-{
- // Get a handle to the local computer SCM database with full access rights.
- nsAutoServiceHandle schSCManager(OpenSCManager(nullptr, nullptr,
- SC_MANAGER_ALL_ACCESS));
- if (!schSCManager) {
- LOG_WARN(("Could not open service manager. (%d)", GetLastError()));
- return FALSE;
- }
-
- // Open the service
- nsAutoServiceHandle schService(OpenServiceW(schSCManager, SVC_NAME,
- SERVICE_ALL_ACCESS));
- if (!schService) {
- LOG_WARN(("Could not open service. (%d)", GetLastError()));
- return FALSE;
- }
-
- //Stop the service so it deletes faster and so the uninstaller
- // can actually delete its EXE.
- DWORD totalWaitTime = 0;
- SERVICE_STATUS status;
- static const int maxWaitTime = 1000 * 60; // Never wait more than a minute
- if (ControlService(schService, SERVICE_CONTROL_STOP, &status)) {
- do {
- Sleep(status.dwWaitHint);
- totalWaitTime += (status.dwWaitHint + 10);
- if (status.dwCurrentState == SERVICE_STOPPED) {
- break;
- } else if (totalWaitTime > maxWaitTime) {
- break;
- }
- } while (QueryServiceStatus(schService, &status));
- }
-
- // Delete the service or mark it for deletion
- BOOL deleted = DeleteService(schService);
- if (!deleted) {
- deleted = (GetLastError() == ERROR_SERVICE_MARKED_FOR_DELETE);
- }
-
- return deleted;
-}
-
-/**
- * Sets the access control list for user access for the specified service.
- *
- * @param hService The service to set the access control list on
- * @return TRUE if successful
- */
-BOOL
-SetUserAccessServiceDACL(SC_HANDLE hService)
-{
- PACL pNewAcl = nullptr;
- PSECURITY_DESCRIPTOR psd = nullptr;
- DWORD lastError = SetUserAccessServiceDACL(hService, pNewAcl, psd);
- if (pNewAcl) {
- LocalFree((HLOCAL)pNewAcl);
- }
- if (psd) {
- LocalFree((LPVOID)psd);
- }
- return ERROR_SUCCESS == lastError;
-}
-
-/**
- * Sets the access control list for user access for the specified service.
- *
- * @param hService The service to set the access control list on
- * @param pNewAcl The out param ACL which should be freed by caller
- * @param psd out param security descriptor, should be freed by caller
- * @return ERROR_SUCCESS if successful
- */
-DWORD
-SetUserAccessServiceDACL(SC_HANDLE hService, PACL &pNewAcl,
- PSECURITY_DESCRIPTOR psd)
-{
- // Get the current security descriptor needed size
- DWORD needed = 0;
- if (!QueryServiceObjectSecurity(hService, DACL_SECURITY_INFORMATION,
- &psd, 0, &needed)) {
- if (GetLastError() != ERROR_INSUFFICIENT_BUFFER) {
- LOG_WARN(("Could not query service object security size. (%d)",
- GetLastError()));
- return GetLastError();
- }
-
- DWORD size = needed;
- psd = (PSECURITY_DESCRIPTOR)LocalAlloc(LPTR, size);
- if (!psd) {
- LOG_WARN(("Could not allocate security descriptor. (%d)",
- GetLastError()));
- return ERROR_INSUFFICIENT_BUFFER;
- }
-
- // Get the actual security descriptor now
- if (!QueryServiceObjectSecurity(hService, DACL_SECURITY_INFORMATION,
- psd, size, &needed)) {
- LOG_WARN(("Could not allocate security descriptor. (%d)",
- GetLastError()));
- return GetLastError();
- }
- }
-
- // Get the current DACL from the security descriptor.
- PACL pacl = nullptr;
- BOOL bDaclPresent = FALSE;
- BOOL bDaclDefaulted = FALSE;
- if ( !GetSecurityDescriptorDacl(psd, &bDaclPresent, &pacl,
- &bDaclDefaulted)) {
- LOG_WARN(("Could not obtain DACL. (%d)", GetLastError()));
- return GetLastError();
- }
-
- PSID sid;
- DWORD SIDSize = SECURITY_MAX_SID_SIZE;
- sid = LocalAlloc(LMEM_FIXED, SIDSize);
- if (!sid) {
- LOG_WARN(("Could not allocate SID memory. (%d)", GetLastError()));
- return GetLastError();
- }
-
- if (!CreateWellKnownSid(WinBuiltinUsersSid, nullptr, sid, &SIDSize)) {
- DWORD lastError = GetLastError();
- LOG_WARN(("Could not create well known SID. (%d)", lastError));
- LocalFree(sid);
- return lastError;
- }
-
- // Lookup the account name, the function fails if you don't pass in
- // a buffer for the domain name but it's not used since we're using
- // the built in account Sid.
- SID_NAME_USE accountType;
- WCHAR accountName[UNLEN + 1] = { L'\0' };
- WCHAR domainName[DNLEN + 1] = { L'\0' };
- DWORD accountNameSize = UNLEN + 1;
- DWORD domainNameSize = DNLEN + 1;
- if (!LookupAccountSidW(nullptr, sid, accountName,
- &accountNameSize,
- domainName, &domainNameSize, &accountType)) {
- LOG_WARN(("Could not lookup account Sid, will try Users. (%d)",
- GetLastError()));
- wcsncpy(accountName, L"Users", UNLEN);
- }
-
- // We already have the group name so we can get rid of the SID
- FreeSid(sid);
- sid = nullptr;
-
- // Build the ACE, BuildExplicitAccessWithName cannot fail so it is not logged.
- EXPLICIT_ACCESS ea;
- BuildExplicitAccessWithNameW(&ea, accountName,
- SERVICE_START | SERVICE_STOP | GENERIC_READ,
- SET_ACCESS, NO_INHERITANCE);
- DWORD lastError = SetEntriesInAclW(1, (PEXPLICIT_ACCESS)&ea, pacl, &pNewAcl);
- if (ERROR_SUCCESS != lastError) {
- LOG_WARN(("Could not set entries in ACL. (%d)", lastError));
- return lastError;
- }
-
- // Initialize a new security descriptor.
- SECURITY_DESCRIPTOR sd;
- if (!InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION)) {
- LOG_WARN(("Could not initialize security descriptor. (%d)",
- GetLastError()));
- return GetLastError();
- }
-
- // Set the new DACL in the security descriptor.
- if (!SetSecurityDescriptorDacl(&sd, TRUE, pNewAcl, FALSE)) {
- LOG_WARN(("Could not set security descriptor DACL. (%d)",
- GetLastError()));
- return GetLastError();
- }
-
- // Set the new security descriptor for the service object.
- if (!SetServiceObjectSecurity(hService, DACL_SECURITY_INFORMATION, &sd)) {
- LOG_WARN(("Could not set object security. (%d)",
- GetLastError()));
- return GetLastError();
- }
-
- // Woohoo, raise the roof
- LOG(("User access was set successfully on the service."));
- return ERROR_SUCCESS;
-}
diff --git a/toolkit/components/maintenanceservice/serviceinstall.h b/toolkit/components/maintenanceservice/serviceinstall.h
deleted file mode 100644
index d8532a968e..0000000000
--- a/toolkit/components/maintenanceservice/serviceinstall.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "readstrings.h"
-
-#define SVC_DISPLAY_NAME L"Mozilla Maintenance Service"
-
-enum SvcInstallAction { UpgradeSvc, InstallSvc, ForceInstallSvc };
-BOOL SvcInstall(SvcInstallAction action);
-BOOL SvcUninstall();
-BOOL StopService();
-BOOL SetUserAccessServiceDACL(SC_HANDLE hService);
-DWORD SetUserAccessServiceDACL(SC_HANDLE hService, PACL &pNewAcl,
- PSECURITY_DESCRIPTOR psd);
-
-struct MaintenanceServiceStringTable
-{
- char serviceDescription[MAX_TEXT_LEN];
-};
-
diff --git a/toolkit/components/maintenanceservice/workmonitor.cpp b/toolkit/components/maintenanceservice/workmonitor.cpp
deleted file mode 100644
index d06db3ca2b..0000000000
--- a/toolkit/components/maintenanceservice/workmonitor.cpp
+++ /dev/null
@@ -1,758 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <wtsapi32.h>
-#include <userenv.h>
-#include <shellapi.h>
-
-#pragma comment(lib, "wtsapi32.lib")
-#pragma comment(lib, "userenv.lib")
-#pragma comment(lib, "shlwapi.lib")
-#pragma comment(lib, "ole32.lib")
-#pragma comment(lib, "rpcrt4.lib")
-
-#include "nsWindowsHelpers.h"
-
-#include "workmonitor.h"
-#include "serviceinstall.h"
-#include "servicebase.h"
-#include "registrycertificates.h"
-#include "uachelper.h"
-#include "updatehelper.h"
-#include "pathhash.h"
-#include "errors.h"
-
-// Wait 15 minutes for an update operation to run at most.
-// Updates usually take less than a minute so this seems like a
-// significantly large and safe amount of time to wait.
-static const int TIME_TO_WAIT_ON_UPDATER = 15 * 60 * 1000;
-wchar_t* MakeCommandLine(int argc, wchar_t** argv);
-BOOL WriteStatusFailure(LPCWSTR updateDirPath, int errorCode);
-BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath,
- LPCWSTR newFileName);
-BOOL DoesFallbackKeyExist();
-
-/*
- * Read the update.status file and sets isApplying to true if
- * the status is set to applying.
- *
- * @param updateDirPath The directory where update.status is stored
- * @param isApplying Out parameter for specifying if the status
- * is set to applying or not.
- * @return TRUE if the information was filled.
-*/
-static BOOL
-IsStatusApplying(LPCWSTR updateDirPath, BOOL &isApplying)
-{
- isApplying = FALSE;
- WCHAR updateStatusFilePath[MAX_PATH + 1] = {L'\0'};
- wcsncpy(updateStatusFilePath, updateDirPath, MAX_PATH);
- if (!PathAppendSafe(updateStatusFilePath, L"update.status")) {
- LOG_WARN(("Could not append path for update.status file"));
- return FALSE;
- }
-
- nsAutoHandle statusFile(CreateFileW(updateStatusFilePath, GENERIC_READ,
- FILE_SHARE_READ |
- FILE_SHARE_WRITE |
- FILE_SHARE_DELETE,
- nullptr, OPEN_EXISTING, 0, nullptr));
-
- if (INVALID_HANDLE_VALUE == statusFile) {
- LOG_WARN(("Could not open update.status file"));
- return FALSE;
- }
-
- char buf[32] = { 0 };
- DWORD read;
- if (!ReadFile(statusFile, buf, sizeof(buf), &read, nullptr)) {
- LOG_WARN(("Could not read from update.status file"));
- return FALSE;
- }
-
- const char kApplying[] = "applying";
- isApplying = strncmp(buf, kApplying,
- sizeof(kApplying) - 1) == 0;
- return TRUE;
-}
-
-/**
- * Determines whether we're staging an update.
- *
- * @param argc The argc value normally sent to updater.exe
- * @param argv The argv value normally sent to updater.exe
- * @return boolean True if we're staging an update
- */
-static bool
-IsUpdateBeingStaged(int argc, LPWSTR *argv)
-{
- // PID will be set to -1 if we're supposed to stage an update.
- return argc == 4 && !wcscmp(argv[3], L"-1") ||
- argc == 5 && !wcscmp(argv[4], L"-1");
-}
-
-/**
- * Determines whether the param only contains digits.
- *
- * @param str The string to check
- * @param boolean True if the param only contains digits
- */
-static bool
-IsDigits(WCHAR *str)
-{
- while (*str) {
- if (!iswdigit(*str++)) {
- return FALSE;
- }
- }
- return TRUE;
-}
-
-/**
- * Determines whether the command line contains just the directory to apply the
- * update to (old command line) or if it contains the installation directory and
- * the directory to apply the update to.
- *
- * @param argc The argc value normally sent to updater.exe
- * @param argv The argv value normally sent to updater.exe
- * @param boolean True if the command line contains just the directory to apply
- * the update to
- */
-static bool
-IsOldCommandline(int argc, LPWSTR *argv)
-{
- return argc == 4 && !wcscmp(argv[3], L"-1") ||
- argc >= 4 && (wcsstr(argv[3], L"/replace") || IsDigits(argv[3]));
-}
-
-/**
- * Gets the installation directory from the arguments passed to updater.exe.
- *
- * @param argcTmp The argc value normally sent to updater.exe
- * @param argvTmp The argv value normally sent to updater.exe
- * @param aResultDir Buffer to hold the installation directory.
- */
-static BOOL
-GetInstallationDir(int argcTmp, LPWSTR *argvTmp, WCHAR aResultDir[MAX_PATH + 1])
-{
- int index = 3;
- if (IsOldCommandline(argcTmp, argvTmp)) {
- index = 2;
- }
-
- if (argcTmp < index) {
- return FALSE;
- }
-
- wcsncpy(aResultDir, argvTmp[2], MAX_PATH);
- WCHAR* backSlash = wcsrchr(aResultDir, L'\\');
- // Make sure that the path does not include trailing backslashes
- if (backSlash && (backSlash[1] == L'\0')) {
- *backSlash = L'\0';
- }
-
- // The new command line's argv[2] is always the installation directory.
- if (index == 2) {
- bool backgroundUpdate = IsUpdateBeingStaged(argcTmp, argvTmp);
- bool replaceRequest = (argcTmp >= 4 && wcsstr(argvTmp[3], L"/replace"));
- if (backgroundUpdate || replaceRequest) {
- return PathRemoveFileSpecW(aResultDir);
- }
- }
- return TRUE;
-}
-
-/**
- * Runs an update process as the service using the SYSTEM account.
- *
- * @param argc The number of arguments in argv
- * @param argv The arguments normally passed to updater.exe
- * argv[0] must be the path to updater.exe
- * @param processStarted Set to TRUE if the process was started.
- * @return TRUE if the update process was run had a return code of 0.
- */
-BOOL
-StartUpdateProcess(int argc,
- LPWSTR *argv,
- LPCWSTR installDir,
- BOOL &processStarted)
-{
- LOG(("Starting update process as the service in session 0."));
- STARTUPINFO si = {0};
- si.cb = sizeof(STARTUPINFO);
- si.lpDesktop = L"winsta0\\Default";
- PROCESS_INFORMATION pi = {0};
-
- // The updater command line is of the form:
- // updater.exe update-dir apply [wait-pid [callback-dir callback-path args]]
- LPWSTR cmdLine = MakeCommandLine(argc, argv);
-
- int index = 3;
- if (IsOldCommandline(argc, argv)) {
- index = 2;
- }
-
- // If we're about to start the update process from session 0,
- // then we should not show a GUI. This only really needs to be done
- // on Vista and higher, but it's better to keep everything consistent
- // across all OS if it's of no harm.
- if (argc >= index) {
- // Setting the desktop to blank will ensure no GUI is displayed
- si.lpDesktop = L"";
- si.dwFlags |= STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_HIDE;
- }
-
- // Add an env var for MOZ_USING_SERVICE so the updater.exe can
- // do anything special that it needs to do for service updates.
- // Search in updater.cpp for more info on MOZ_USING_SERVICE.
- putenv(const_cast<char*>("MOZ_USING_SERVICE=1"));
- LOG(("Starting service with cmdline: %ls", cmdLine));
- processStarted = CreateProcessW(argv[0], cmdLine,
- nullptr, nullptr, FALSE,
- CREATE_DEFAULT_ERROR_MODE,
- nullptr,
- nullptr, &si, &pi);
-
- BOOL updateWasSuccessful = FALSE;
- if (processStarted) {
- BOOL processTerminated = FALSE;
- BOOL noProcessExitCode = FALSE;
- // Wait for the updater process to finish
- LOG(("Process was started... waiting on result."));
- DWORD waitRes = WaitForSingleObject(pi.hProcess, TIME_TO_WAIT_ON_UPDATER);
- if (WAIT_TIMEOUT == waitRes) {
- // We waited a long period of time for updater.exe and it never finished
- // so kill it.
- TerminateProcess(pi.hProcess, 1);
- processTerminated = TRUE;
- } else {
- // Check the return code of updater.exe to make sure we get 0
- DWORD returnCode;
- if (GetExitCodeProcess(pi.hProcess, &returnCode)) {
- LOG(("Process finished with return code %d.", returnCode));
- // updater returns 0 if successful.
- updateWasSuccessful = (returnCode == 0);
- } else {
- LOG_WARN(("Process finished but could not obtain return code."));
- noProcessExitCode = TRUE;
- }
- }
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
-
- // Check just in case updater.exe didn't change the status from
- // applying. If this is the case we report an error.
- BOOL isApplying = FALSE;
- if (IsStatusApplying(argv[1], isApplying) && isApplying) {
- if (updateWasSuccessful) {
- LOG(("update.status is still applying even though update was "
- "successful."));
- if (!WriteStatusFailure(argv[1],
- SERVICE_STILL_APPLYING_ON_SUCCESS)) {
- LOG_WARN(("Could not write update.status still applying on "
- "success error."));
- }
- // Since we still had applying we know updater.exe didn't do its
- // job correctly.
- updateWasSuccessful = FALSE;
- } else {
- LOG_WARN(("update.status is still applying and update was not successful."));
- int failcode = SERVICE_STILL_APPLYING_ON_FAILURE;
- if (noProcessExitCode) {
- failcode = SERVICE_STILL_APPLYING_NO_EXIT_CODE;
- } else if (processTerminated) {
- failcode = SERVICE_STILL_APPLYING_TERMINATED;
- }
- if (!WriteStatusFailure(argv[1], failcode)) {
- LOG_WARN(("Could not write update.status still applying on "
- "failure error."));
- }
- }
- }
- } else {
- DWORD lastError = GetLastError();
- LOG_WARN(("Could not create process as current user, "
- "updaterPath: %ls; cmdLine: %ls. (%d)",
- argv[0], cmdLine, lastError));
- }
-
- // Empty value on putenv is how you remove an env variable in Windows
- putenv(const_cast<char*>("MOZ_USING_SERVICE="));
-
- free(cmdLine);
- return updateWasSuccessful;
-}
-
-/**
- * Validates a file as an official updater.
- *
- * @param updater Path to the updater to validate
- * @param installDir Path to the application installation
- * being updated
- * @param updateDir Update applyTo direcotry,
- * where logs will be written
- *
- * @return true if updater is the path to a valid updater
- */
-static bool
-UpdaterIsValid(LPWSTR updater, LPWSTR installDir, LPWSTR updateDir)
-{
- // Make sure the path to the updater to use for the update is local.
- // We do this check to make sure that file locking is available for
- // race condition security checks.
- BOOL isLocal = FALSE;
- if (!IsLocalFile(updater, isLocal) || !isLocal) {
- LOG_WARN(("Filesystem in path %ls is not supported (%d)",
- updater, GetLastError()));
- if (!WriteStatusFailure(updateDir, SERVICE_UPDATER_NOT_FIXED_DRIVE)) {
- LOG_WARN(("Could not write update.status service update failure. (%d)",
- GetLastError()));
- }
- return false;
- }
-
- nsAutoHandle noWriteLock(CreateFileW(updater, GENERIC_READ, FILE_SHARE_READ,
- nullptr, OPEN_EXISTING, 0, nullptr));
- if (INVALID_HANDLE_VALUE == noWriteLock) {
- LOG_WARN(("Could not set no write sharing access on file. (%d)",
- GetLastError()));
- if (!WriteStatusFailure(updateDir, SERVICE_COULD_NOT_LOCK_UPDATER)) {
- LOG_WARN(("Could not write update.status service update failure. (%d)",
- GetLastError()));
- }
- return false;
- }
-
- // Verify that the updater.exe that we are executing is the same
- // as the one in the installation directory which we are updating.
- // The installation dir that we are installing to is installDir.
- WCHAR installDirUpdater[MAX_PATH + 1] = { L'\0' };
- wcsncpy(installDirUpdater, installDir, MAX_PATH);
- if (!PathAppendSafe(installDirUpdater, L"updater.exe")) {
- LOG_WARN(("Install directory updater could not be determined."));
- return false;
- }
-
- BOOL updaterIsCorrect;
- if (!VerifySameFiles(updater, installDirUpdater, updaterIsCorrect)) {
- LOG_WARN(("Error checking if the updaters are the same.\n"
- "Path 1: %ls\nPath 2: %ls", updater, installDirUpdater));
- return false;
- }
-
- if (!updaterIsCorrect) {
- LOG_WARN(("The updaters do not match, updater will not run.\n"
- "Path 1: %ls\nPath 2: %ls", updater, installDirUpdater));
- if (!WriteStatusFailure(updateDir, SERVICE_UPDATER_COMPARE_ERROR)) {
- LOG_WARN(("Could not write update.status updater compare failure."));
- }
- return false;
- }
-
- LOG(("updater.exe was compared successfully to the installation directory"
- " updater.exe."));
-
- // Check to make sure the updater.exe module has the unique updater identity.
- // This is a security measure to make sure that the signed executable that
- // we will run is actually an updater.
- bool result = true;
- HMODULE updaterModule = LoadLibraryEx(updater, nullptr,
- LOAD_LIBRARY_AS_DATAFILE);
- if (!updaterModule) {
- LOG_WARN(("updater.exe module could not be loaded. (%d)", GetLastError()));
- result = false;
- } else {
- char updaterIdentity[64];
- if (!LoadStringA(updaterModule, IDS_UPDATER_IDENTITY,
- updaterIdentity, sizeof(updaterIdentity))) {
- LOG_WARN(("The updater.exe application does not contain the Mozilla"
- " updater identity."));
- result = false;
- }
-
- if (strcmp(updaterIdentity, UPDATER_IDENTITY_STRING)) {
- LOG_WARN(("The updater.exe identity string is not valid."));
- result = false;
- }
- FreeLibrary(updaterModule);
- }
-
- if (result) {
- LOG(("The updater.exe application contains the Mozilla"
- " updater identity."));
- } else {
- if (!WriteStatusFailure(updateDir, SERVICE_UPDATER_IDENTITY_ERROR)) {
- LOG_WARN(("Could not write update.status no updater identity."));
- }
- return false;
- }
-
-#ifndef DISABLE_UPDATER_AUTHENTICODE_CHECK
- return DoesBinaryMatchAllowedCertificates(installDir, updater);
-#else
- return true;
-#endif
-}
-
-/**
- * Processes a software update command
- *
- * @param argc The number of arguments in argv
- * @param argv The arguments normally passed to updater.exe
- * argv[0] must be the path to updater.exe
- * @return TRUE if the update was successful.
- */
-BOOL
-ProcessSoftwareUpdateCommand(DWORD argc, LPWSTR *argv)
-{
- BOOL result = TRUE;
- if (argc < 3) {
- LOG_WARN(("Not enough command line parameters specified. "
- "Updating update.status."));
-
- // We can only update update.status if argv[1] exists. argv[1] is
- // the directory where the update.status file exists.
- if (argc < 2 ||
- !WriteStatusFailure(argv[1], SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS)) {
- LOG_WARN(("Could not write update.status service update failure. (%d)",
- GetLastError()));
- }
- return FALSE;
- }
-
- WCHAR installDir[MAX_PATH + 1] = {L'\0'};
- if (!GetInstallationDir(argc, argv, installDir)) {
- LOG_WARN(("Could not get the installation directory"));
- if (!WriteStatusFailure(argv[1], SERVICE_INSTALLDIR_ERROR)) {
- LOG_WARN(("Could not write update.status for GetInstallationDir failure."));
- }
- return FALSE;
- }
-
- if (UpdaterIsValid(argv[0], installDir, argv[1])) {
- BOOL updateProcessWasStarted = FALSE;
- if (StartUpdateProcess(argc, argv, installDir,
- updateProcessWasStarted)) {
- LOG(("updater.exe was launched and run successfully!"));
- LogFlush();
-
- // Don't attempt to update the service when the update is being staged.
- if (!IsUpdateBeingStaged(argc, argv)) {
- // We might not execute code after StartServiceUpdate because
- // the service installer will stop the service if it is running.
- StartServiceUpdate(installDir);
- }
- } else {
- result = FALSE;
- LOG_WARN(("Error running update process. Updating update.status (%d)",
- GetLastError()));
- LogFlush();
-
- // If the update process was started, then updater.exe is responsible for
- // setting the failure code. If it could not be started then we do the
- // work. We set an error instead of directly setting status pending
- // so that the app.update.service.errors pref can be updated when
- // the callback app restarts.
- if (!updateProcessWasStarted) {
- if (!WriteStatusFailure(argv[1],
- SERVICE_UPDATER_COULD_NOT_BE_STARTED)) {
- LOG_WARN(("Could not write update.status service update failure. (%d)",
- GetLastError()));
- }
- }
- }
- } else {
- result = FALSE;
- LOG_WARN(("Could not start process due to certificate check error on "
- "updater.exe. Updating update.status. (%d)", GetLastError()));
-
- // When there is a certificate check error on the updater.exe application,
- // we want to write out the error.
- if (!WriteStatusFailure(argv[1],
- SERVICE_UPDATER_SIGN_ERROR)) {
- LOG_WARN(("Could not write pending state to update.status. (%d)",
- GetLastError()));
- }
- }
-
- return result;
-}
-
-/**
- * Obtains the updater path alongside a subdir of the service binary.
- * The purpose of this function is to return a path that is likely high
- * integrity and therefore more safe to execute code from.
- *
- * @param serviceUpdaterPath Out parameter for the path where the updater
- * should be copied to.
- * @return TRUE if a file path was obtained.
- */
-BOOL
-GetSecureUpdaterPath(WCHAR serviceUpdaterPath[MAX_PATH + 1])
-{
- if (!GetModuleFileNameW(nullptr, serviceUpdaterPath, MAX_PATH)) {
- LOG_WARN(("Could not obtain module filename when attempting to "
- "use a secure updater path. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!PathRemoveFileSpecW(serviceUpdaterPath)) {
- LOG_WARN(("Couldn't remove file spec when attempting to use a secure "
- "updater path. (%d)", GetLastError()));
- return FALSE;
- }
-
- if (!PathAppendSafe(serviceUpdaterPath, L"update")) {
- LOG_WARN(("Couldn't append file spec when attempting to use a secure "
- "updater path. (%d)", GetLastError()));
- return FALSE;
- }
-
- CreateDirectoryW(serviceUpdaterPath, nullptr);
-
- if (!PathAppendSafe(serviceUpdaterPath, L"updater.exe")) {
- LOG_WARN(("Couldn't append file spec when attempting to use a secure "
- "updater path. (%d)", GetLastError()));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/**
- * Deletes the passed in updater path and the associated updater.ini file.
- *
- * @param serviceUpdaterPath The path to delete.
- * @return TRUE if a file was deleted.
- */
-BOOL
-DeleteSecureUpdater(WCHAR serviceUpdaterPath[MAX_PATH + 1])
-{
- BOOL result = FALSE;
- if (serviceUpdaterPath[0]) {
- result = DeleteFileW(serviceUpdaterPath);
- if (!result && GetLastError() != ERROR_PATH_NOT_FOUND &&
- GetLastError() != ERROR_FILE_NOT_FOUND) {
- LOG_WARN(("Could not delete service updater path: '%ls'.",
- serviceUpdaterPath));
- }
-
- WCHAR updaterINIPath[MAX_PATH + 1] = { L'\0' };
- if (PathGetSiblingFilePath(updaterINIPath, serviceUpdaterPath,
- L"updater.ini")) {
- result = DeleteFileW(updaterINIPath);
- if (!result && GetLastError() != ERROR_PATH_NOT_FOUND &&
- GetLastError() != ERROR_FILE_NOT_FOUND) {
- LOG_WARN(("Could not delete service updater INI path: '%ls'.",
- updaterINIPath));
- }
- }
- }
- return result;
-}
-
-/**
- * Executes a service command.
- *
- * @param argc The number of arguments in argv
- * @param argv The service command line arguments, argv[0] and argv[1]
- * and automatically included by Windows. argv[2] is the
- * service command.
- *
- * @return FALSE if there was an error executing the service command.
- */
-BOOL
-ExecuteServiceCommand(int argc, LPWSTR *argv)
-{
- if (argc < 3) {
- LOG_WARN(("Not enough command line arguments to execute a service command"));
- return FALSE;
- }
-
- // The tests work by making sure the log has changed, so we put a
- // unique ID in the log.
- RPC_WSTR guidString = RPC_WSTR(L"");
- GUID guid;
- HRESULT hr = CoCreateGuid(&guid);
- if (SUCCEEDED(hr)) {
- UuidToString(&guid, &guidString);
- }
- LOG(("Executing service command %ls, ID: %ls",
- argv[2], reinterpret_cast<LPCWSTR>(guidString)));
- RpcStringFree(&guidString);
-
- BOOL result = FALSE;
- if (!lstrcmpi(argv[2], L"software-update")) {
- // This check is also performed in updater.cpp and is performed here
- // as well since the maintenance service can be called directly.
- if (argc < 4 || !IsValidFullPath(argv[4])) {
- // Since the status file is written to the patch directory and the patch
- // directory is invalid don't write the status file.
- LOG_WARN(("The patch directory path is not valid for this application."));
- return FALSE;
- }
-
- // This check is also performed in updater.cpp and is performed here
- // as well since the maintenance service can be called directly.
- if (argc < 5 || !IsValidFullPath(argv[5])) {
- LOG_WARN(("The install directory path is not valid for this application."));
- if (!WriteStatusFailure(argv[4], SERVICE_INVALID_INSTALL_DIR_PATH_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
-
- if (!IsOldCommandline(argc - 3, argv + 3)) {
- // This check is also performed in updater.cpp and is performed here
- // as well since the maintenance service can be called directly.
- if (argc < 6 || !IsValidFullPath(argv[6])) {
- LOG_WARN(("The working directory path is not valid for this application."));
- if (!WriteStatusFailure(argv[4], SERVICE_INVALID_WORKING_DIR_PATH_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
-
- // These checks are also performed in updater.cpp and is performed here
- // as well since the maintenance service can be called directly.
- if (_wcsnicmp(argv[6], argv[5], MAX_PATH) != 0) {
- if (wcscmp(argv[7], L"-1") != 0 && !wcsstr(argv[7], L"/replace")) {
- LOG_WARN(("Installation directory and working directory must be the "
- "same for non-staged updates. Exiting."));
- if (!WriteStatusFailure(argv[4], SERVICE_INVALID_APPLYTO_DIR_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
-
- NS_tchar workingDirParent[MAX_PATH];
- NS_tsnprintf(workingDirParent,
- sizeof(workingDirParent) / sizeof(workingDirParent[0]),
- NS_T("%s"), argv[6]);
- if (!PathRemoveFileSpecW(workingDirParent)) {
- LOG_WARN(("Couldn't remove file spec when attempting to verify the "
- "working directory path. (%d)", GetLastError()));
- if (!WriteStatusFailure(argv[4], REMOVE_FILE_SPEC_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
-
- if (_wcsnicmp(workingDirParent, argv[5], MAX_PATH) != 0) {
- LOG_WARN(("The apply-to directory must be the same as or "
- "a child of the installation directory! Exiting."));
- if (!WriteStatusFailure(argv[4], SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
- }
-
- }
-
- // Use the passed in command line arguments for the update, except for the
- // path to updater.exe. We always look for updater.exe in the installation
- // directory, then we copy updater.exe to a the directory of the
- // MozillaMaintenance service so that a low integrity process cannot
- // replace the updater.exe at any point and use that for the update.
- // It also makes DLL injection attacks harder.
- WCHAR installDir[MAX_PATH + 1] = { L'\0' };
- if (!GetInstallationDir(argc - 3, argv + 3, installDir)) {
- LOG_WARN(("Could not get the installation directory"));
- if (!WriteStatusFailure(argv[4], SERVICE_INSTALLDIR_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
-
- if (!DoesFallbackKeyExist()) {
- WCHAR maintenanceServiceKey[MAX_PATH + 1];
- if (CalculateRegistryPathFromFilePath(installDir, maintenanceServiceKey)) {
- LOG(("Checking for Maintenance Service registry. key: '%ls'",
- maintenanceServiceKey));
- HKEY baseKey = nullptr;
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- maintenanceServiceKey, 0,
- KEY_READ | KEY_WOW64_64KEY,
- &baseKey) != ERROR_SUCCESS) {
- LOG_WARN(("The maintenance service registry key does not exist."));
- if (!WriteStatusFailure(argv[4], SERVICE_INSTALL_DIR_REG_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
- RegCloseKey(baseKey);
- } else {
- if (!WriteStatusFailure(argv[4], SERVICE_CALC_REG_PATH_ERROR)) {
- LOG_WARN(("Could not write update.status for previous failure."));
- }
- return FALSE;
- }
- }
-
- WCHAR installDirUpdater[MAX_PATH + 1] = { L'\0' };
- wcsncpy(installDirUpdater, installDir, MAX_PATH);
- if (!PathAppendSafe(installDirUpdater, L"updater.exe")) {
- LOG_WARN(("Install directory updater could not be determined."));
- result = FALSE;
- }
-
- result = UpdaterIsValid(installDirUpdater, installDir, argv[4]);
-
- WCHAR secureUpdaterPath[MAX_PATH + 1] = { L'\0' };
- if (result) {
- result = GetSecureUpdaterPath(secureUpdaterPath); // Does its own logging
- }
- if (result) {
- LOG(("Passed in path: '%ls'; Using this path for updating: '%ls'.",
- installDirUpdater, secureUpdaterPath));
- DeleteSecureUpdater(secureUpdaterPath);
- result = CopyFileW(installDirUpdater, secureUpdaterPath, FALSE);
- }
-
- if (!result) {
- LOG_WARN(("Could not copy path to secure location. (%d)",
- GetLastError()));
- if (!WriteStatusFailure(argv[4], SERVICE_COULD_NOT_COPY_UPDATER)) {
- LOG_WARN(("Could not write update.status could not copy updater error"));
- }
- } else {
-
- // We obtained the path and copied it successfully, update the path to
- // use for the service update.
- argv[3] = secureUpdaterPath;
-
- WCHAR installDirUpdaterINIPath[MAX_PATH + 1] = { L'\0' };
- WCHAR secureUpdaterINIPath[MAX_PATH + 1] = { L'\0' };
- if (PathGetSiblingFilePath(secureUpdaterINIPath, secureUpdaterPath,
- L"updater.ini") &&
- PathGetSiblingFilePath(installDirUpdaterINIPath, installDirUpdater,
- L"updater.ini")) {
- // This is non fatal if it fails there is no real harm
- if (!CopyFileW(installDirUpdaterINIPath, secureUpdaterINIPath, FALSE)) {
- LOG_WARN(("Could not copy updater.ini from: '%ls' to '%ls'. (%d)",
- installDirUpdaterINIPath, secureUpdaterINIPath, GetLastError()));
- }
- }
-
- result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3);
- DeleteSecureUpdater(secureUpdaterPath);
- }
-
- // We might not reach here if the service install succeeded
- // because the service self updates itself and the service
- // installer will stop the service.
- LOG(("Service command %ls complete.", argv[2]));
- } else {
- LOG_WARN(("Service command not recognized: %ls.", argv[2]));
- // result is already set to FALSE
- }
-
- LOG(("service command %ls complete with result: %ls.",
- argv[1], (result ? L"Success" : L"Failure")));
- return TRUE;
-}
diff --git a/toolkit/components/maintenanceservice/workmonitor.h b/toolkit/components/maintenanceservice/workmonitor.h
deleted file mode 100644
index ac4cd679bf..0000000000
--- a/toolkit/components/maintenanceservice/workmonitor.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-BOOL ExecuteServiceCommand(int argc, LPWSTR *argv);
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build
index 953e6c6e30..7173ca4e79 100644
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -66,9 +66,6 @@ DIRS += [
'xulstore'
]
-if CONFIG['MOZ_WEBEXTENSIONS']:
- DIRS += ['webextensions']
-
DIRS += ['mozintl']
if not CONFIG['MOZ_FENNEC']:
diff --git a/toolkit/components/osfile/NativeOSFileInternals.cpp b/toolkit/components/osfile/NativeOSFileInternals.cpp
index e4725d390d..36517d9ec7 100644
--- a/toolkit/components/osfile/NativeOSFileInternals.cpp
+++ b/toolkit/components/osfile/NativeOSFileInternals.cpp
@@ -232,7 +232,6 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(AbstractResult)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(AbstractResult)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AbstractResult)
diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm
index a028dda7d5..bf5c66b8dc 100644
--- a/toolkit/components/osfile/modules/osfile_unix_back.jsm
+++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm
@@ -585,17 +585,10 @@
} else if (Const._STAT_VER != undefined) {
const ver = Const._STAT_VER;
let xstat_name, lxstat_name, fxstat_name;
- if (OS.Constants.Sys.Name == "SunOS") {
- // Solaris
- xstat_name = "_xstat";
- lxstat_name = "_lxstat";
- fxstat_name = "_fxstat";
- } else {
- // Linux, all widths
- xstat_name = "__xstat";
- lxstat_name = "__lxstat";
- fxstat_name = "__fxstat";
- }
+ // Linux, all widths
+ xstat_name = "__xstat";
+ lxstat_name = "__lxstat";
+ fxstat_name = "__fxstat";
let Stat = {};
libc.declareLazyFFI(Stat, "xstat",
diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
index 720e80446b..c4be39e318 100644
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -97,17 +97,25 @@ LoginManagerPromptFactory.prototype = {
return;
}
- // Allow only a limited number of authentication dialogs when they are all
- // canceled by the user.
- var cancelationCounter = (prompter._browser && prompter._browser.canceledAuthenticationPromptCounter) || { count: 0, id: 0 };
- if (prompt.channel) {
- var httpChannel = prompt.channel.QueryInterface(Ci.nsIHttpChannel);
- if (httpChannel) {
- var windowId = httpChannel.topLevelContentWindowId;
- if (windowId != cancelationCounter.id) {
- // window has been reloaded or navigated, reset the counter
- cancelationCounter = { count: 0, id: windowId };
- }
+ // Set up a counter for ensuring that the basic auth prompt can not
+ // be abused for DOS-style attacks. With this counter, each eTLD+1
+ // per browser will get a limited number of times a user can
+ // cancel the prompt until we stop showing it.
+ let browser = prompter._browser;
+ let baseDomain = null;
+ if (browser && browser.isAuthDOSProtected) {
+ try {
+ baseDomain = Services.eTLD.getBaseDomainFromHost(hostname);
+ } catch (e) {
+ baseDomain = hostname;
+ }
+
+ if (!browser.authPromptCounter) {
+ browser.authPromptCounter = {};
+ }
+
+ if (!browser.authPromptCounter[baseDomain]) {
+ browser.authPromptCounter[baseDomain] = 0;
}
}
@@ -137,13 +145,14 @@ LoginManagerPromptFactory.prototype = {
prompt.inProgress = false;
self._asyncPromptInProgress = false;
- if (ok) {
- cancelationCounter.count = 0;
- } else {
- cancelationCounter.count++;
- }
- if (prompter._browser) {
- prompter._browser.canceledAuthenticationPromptCounter = cancelationCounter;
+ if (browser && browser.isAuthDOSProtected) {
+ // Reset the counter state if the user replied to a prompt and actually
+ // tried to login (vs. simply clicking any button to get out).
+ if (ok && (prompt.authInfo.username || prompt.authInfo.password)) {
+ browser.authPromptCounter[baseDomain] = 0;
+ } else {
+ browser.authPromptCounter[baseDomain] += 1;
+ }
}
}
@@ -168,14 +177,27 @@ LoginManagerPromptFactory.prototype = {
var cancelDialogLimit = Services.prefs.getIntPref("prompts.authentication_dialog_abuse_limit");
- this.log("cancelationCounter =", cancelationCounter);
- if (cancelDialogLimit && cancelationCounter.count >= cancelDialogLimit) {
- this.log("Blocking auth dialog, due to exceeding dialog bloat limit");
- delete this._asyncPrompts[hashKey];
-
- // just make the runnable cancel all consumers
- runnable.cancel = true;
+ // Block the auth prompt if:
+ // - There is an attached browser element
+ // - The browser element has opted-in to DOS protection
+ // - The dialog cancellation limit is not 0 (= feature disabled)
+ // - The amount of cancellations >= the set abuse limit
+ if (browser && browser.isAuthDOSProtected) {
+ let cancelationCounter = browser.authPromptCounter[baseDomain];
+ this.log("cancelationCounter =", cancelationCounter);
+
+ if (cancelDialogLimit && cancelationCounter >= cancelDialogLimit) {
+ this.log("Blocking auth dialog, due to exceeding dialog bloat limit");
+ delete this._asyncPrompts[hashKey];
+
+ // just make the runnable cancel all consumers
+ runnable.cancel = true;
+ } else {
+ this._asyncPromptInProgress = true;
+ prompt.inProgress = true;
+ }
} else {
+ // No DOS protection: prompt
this._asyncPromptInProgress = true;
prompt.inProgress = true;
}
diff --git a/toolkit/components/places/UnifiedComplete.js b/toolkit/components/places/UnifiedComplete.js
index 2efae9cbea..ec5f911115 100644
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -124,9 +124,7 @@ function defaultQuery(conditions = "") {
h.visit_count, h.typed, h.id, t.open_count, h.frecency
FROM moz_places h
LEFT JOIN moz_favicons f ON f.id = h.favicon_id
- LEFT JOIN moz_openpages_temp t
- ON t.url = h.url
- AND t.userContextId = :userContextId
+ LEFT JOIN moz_openpages_temp t ON t.url = h.url
WHERE h.frecency <> 0
AND AUTOCOMPLETE_MATCH(:searchString, h.url,
CASE WHEN bookmarked THEN
@@ -150,7 +148,6 @@ const SQL_SWITCHTAB_QUERY =
FROM moz_openpages_temp t
LEFT JOIN moz_places h ON h.url_hash = hash(t.url) AND h.url = t.url
WHERE h.id IS NULL
- AND t.userContextId = :userContextId
AND AUTOCOMPLETE_MATCH(:searchString, t.url, t.url, NULL,
NULL, NULL, NULL, t.open_count,
:matchBehavior, :searchBehavior)
@@ -170,9 +167,7 @@ const SQL_ADAPTIVE_QUERY =
) AS i
JOIN moz_places h ON h.id = i.place_id
LEFT JOIN moz_favicons f ON f.id = h.favicon_id
- LEFT JOIN moz_openpages_temp t
- ON t.url = h.url
- AND t.userContextId = :userContextId
+ LEFT JOIN moz_openpages_temp t ON t.url = h.url
WHERE AUTOCOMPLETE_MATCH(NULL, h.url,
IFNULL(btitle, h.title), tags,
h.visit_count, h.typed, bookmarked,
@@ -301,17 +296,15 @@ XPCOMUtils.defineLazyServiceGetter(this, "textURIService",
XPCOMUtils.defineLazyGetter(this, "SwitchToTabStorage", () => Object.seal({
_conn: null,
// Temporary queue used while the database connection is not available.
- _queue: new Map(),
+ _queue: new Set(),
initDatabase: Task.async(function* (conn) {
// To reduce IO use an in-memory table for switch-to-tab tracking.
// Note: this should be kept up-to-date with the definition in
// nsPlacesTables.h.
yield conn.execute(
`CREATE TEMP TABLE moz_openpages_temp (
- url TEXT,
- userContextId INTEGER,
- open_count INTEGER,
- PRIMARY KEY (url, userContextId)
+ url TEXT PRIMARY KEY,
+ open_count INTEGER
)`);
// Note: this should be kept up-to-date with the definition in
@@ -322,64 +315,44 @@ XPCOMUtils.defineLazyGetter(this, "SwitchToTabStorage", () => Object.seal({
WHEN NEW.open_count = 0
BEGIN
DELETE FROM moz_openpages_temp
- WHERE url = NEW.url
- AND userContextId = NEW.userContextId;
+ WHERE url = NEW.url;
END`);
this._conn = conn;
// Populate the table with the current cache contents...
- for (let [userContextId, uris] of this._queue) {
- for (let uri of uris) {
- this.add(uri, userContextId);
- }
- }
+ this._queue.forEach(this.add, this);
// ...then clear it to avoid double additions.
this._queue.clear();
}),
- add(uri, userContextId) {
+ add: function (uri) {
if (!this._conn) {
- if (!this._queue.has(userContextId)) {
- this._queue.set(userContextId, new Set());
- }
- this._queue.get(userContextId).add(uri);
+ this._queue.add(uri);
return;
}
this._conn.executeCached(
- `INSERT OR REPLACE INTO moz_openpages_temp (url, userContextId, open_count)
- VALUES ( :url,
- :userContextId,
- IFNULL( ( SELECT open_count + 1
- FROM moz_openpages_temp
- WHERE url = :url
- AND userContextId = :userContextId ),
- 1
- )
+ `INSERT OR REPLACE INTO moz_openpages_temp (url, open_count)
+ VALUES ( :url, IFNULL( (SELECT open_count + 1
+ FROM moz_openpages_temp
+ WHERE url = :url),
+ 1
+ )
)`
- , { url: uri.spec, userContextId });
+ , { url: uri.spec });
},
- delete(uri, userContextId) {
+ delete: function (uri) {
if (!this._conn) {
- // This should not happen.
- if (!this._queue.has(userContextId)) {
- throw new Error("Unknown userContextId!");
- }
-
- this._queue.get(userContextId).delete(uri);
- if (this._queue.get(userContextId).size == 0) {
- this._queue.delete(userContextId);
- }
+ this._queue.delete(uri);
return;
}
this._conn.executeCached(
`UPDATE moz_openpages_temp
SET open_count = open_count - 1
- WHERE url = :url
- AND userContextId = :userContextId`
- , { url: uri.spec, userContextId });
+ WHERE url = :url`
+ , { url: uri.spec });
},
shutdown: function () {
@@ -1781,7 +1754,6 @@ Search.prototype = {
// We only want to search the tokens that we are left with - not the
// original search string.
searchString: this._searchTokens.join(" "),
- userContextId: this._userContextId,
// Limit the query to the the maximum number of desired results.
// This way we can avoid doing more work than needed.
maxResults: Prefs.maxRichResults
@@ -1805,7 +1777,6 @@ Search.prototype = {
// We only want to search the tokens that we are left with - not the
// original search string.
searchString: this._searchTokens.join(" "),
- userContextId: this._userContextId,
maxResults: Prefs.maxRichResults
}
];
@@ -1825,8 +1796,7 @@ Search.prototype = {
search_string: this._searchString,
query_type: QUERYTYPE_FILTERED,
matchBehavior: this._matchBehavior,
- searchBehavior: this._behavior,
- userContextId: this._userContextId,
+ searchBehavior: this._behavior
}
];
},
@@ -2010,12 +1980,12 @@ UnifiedComplete.prototype = {
// mozIPlacesAutoComplete
- registerOpenPage(uri, userContextId) {
- SwitchToTabStorage.add(uri, userContextId);
+ registerOpenPage: function PAC_registerOpenPage(uri) {
+ SwitchToTabStorage.add(uri);
},
- unregisterOpenPage(uri, userContextId) {
- SwitchToTabStorage.delete(uri, userContextId);
+ unregisterOpenPage: function PAC_unregisterOpenPage(uri) {
+ SwitchToTabStorage.delete(uri);
},
// nsIAutoCompleteSearch
diff --git a/toolkit/components/places/mozIPlacesAutoComplete.idl b/toolkit/components/places/mozIPlacesAutoComplete.idl
index 7f3247fdc3..6ff82e6674 100644
--- a/toolkit/components/places/mozIPlacesAutoComplete.idl
+++ b/toolkit/components/places/mozIPlacesAutoComplete.idl
@@ -116,10 +116,8 @@ interface mozIPlacesAutoComplete : nsISupports
*
* @param aURI
* The URI to register as an open page.
- * @param aUserContextId
- * The Container Id of the tab.
*/
- void registerOpenPage(in nsIURI aURI, in uint32_t aUserContextId);
+ void registerOpenPage(in nsIURI aURI);
/**
* Mark a page as no longer being open (either by closing the window or tab,
@@ -131,8 +129,6 @@ interface mozIPlacesAutoComplete : nsISupports
*
* @param aURI
* The URI to unregister as an open page.
- * @param aUserContextId
- * The Container Id of the tab.
*/
- void unregisterOpenPage(in nsIURI aURI, in uint32_t aUserContextId);
+ void unregisterOpenPage(in nsIURI aURI);
};
diff --git a/toolkit/components/places/nsPlacesTables.h b/toolkit/components/places/nsPlacesTables.h
index aca92735e9..0b6e414fbc 100644
--- a/toolkit/components/places/nsPlacesTables.h
+++ b/toolkit/components/places/nsPlacesTables.h
@@ -133,10 +133,8 @@
// nsPlacesAutoComplete.js.
#define CREATE_MOZ_OPENPAGES_TEMP NS_LITERAL_CSTRING( \
"CREATE TEMP TABLE moz_openpages_temp (" \
- " url TEXT" \
- ", userContextId INTEGER" \
+ " url TEXT PRIMARY KEY" \
", open_count INTEGER" \
- ", PRIMARY KEY (url, userContextId)" \
")" \
)
diff --git a/toolkit/components/places/nsPlacesTriggers.h b/toolkit/components/places/nsPlacesTriggers.h
index d5b45ff5ec..37871a3eb5 100644
--- a/toolkit/components/places/nsPlacesTriggers.h
+++ b/toolkit/components/places/nsPlacesTriggers.h
@@ -192,8 +192,7 @@
"WHEN NEW.open_count = 0 " \
"BEGIN " \
"DELETE FROM moz_openpages_temp " \
- "WHERE url = NEW.url " \
- "AND userContextId = NEW.userContextId;" \
+ "WHERE url = NEW.url;" \
"END" \
)
diff --git a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
index 11e917e187..bc252efe0b 100644
--- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
+++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
@@ -286,19 +286,19 @@ var addBookmark = Task.async(function* (aBookmarkObj) {
}
});
-function addOpenPages(aUri, aCount=1, aUserContextId=0) {
+function addOpenPages(aUri, aCount=1) {
let ac = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
.getService(Ci.mozIPlacesAutoComplete);
for (let i = 0; i < aCount; i++) {
- ac.registerOpenPage(aUri, aUserContextId);
+ ac.registerOpenPage(aUri);
}
}
-function removeOpenPages(aUri, aCount=1, aUserContextId=0) {
+function removeOpenPages(aUri, aCount=1) {
let ac = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
.getService(Ci.mozIPlacesAutoComplete);
for (let i = 0; i < aCount; i++) {
- ac.unregisterOpenPage(aUri, aUserContextId);
+ ac.unregisterOpenPage(aUri);
}
}
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js b/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js
index 740b8d8edd..646519c322 100644
--- a/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js
+++ b/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js
@@ -11,11 +11,9 @@ add_task(function* test_tab_matches() {
let uri2 = NetUtil.newURI("http://xyz.net/");
let uri3 = NetUtil.newURI("about:mozilla");
let uri4 = NetUtil.newURI("data:text/html,test");
- let uri5 = NetUtil.newURI("http://foobar.org");
yield PlacesTestUtils.addVisits([
{ uri: uri1, title: "ABC rocks" },
- { uri: uri2, title: "xyz.net - we're better than ABC" },
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ" }
+ { uri: uri2, title: "xyz.net - we're better than ABC" }
]);
addOpenPages(uri1, 1);
// Pages that cannot be registered in history.
@@ -37,8 +35,7 @@ add_task(function* test_tab_matches() {
searchParam: "enable-actions",
matches: [ makeSearchMatch("abc", { heuristic: true }),
makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] },
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
+ { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_print("three results, both normal results are tab matches");
@@ -48,39 +45,7 @@ add_task(function* test_tab_matches() {
searchParam: "enable-actions",
matches: [ makeSearchMatch("abc", { heuristic: true }),
makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }),
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
- });
-
- do_print("a container tab is not visible in 'switch to tab'");
- addOpenPages(uri5, 1, /* userContextId: */ 3);
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }),
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
- });
-
- do_print("a container tab should not see 'switch to tab' for other container tabs");
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions user-context-id:3",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- makeSwitchToTabMatch("http://foobar.org/", { title: "foobar.org - much better than ABC, definitely better than XYZ" }),
- { uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
- });
-
- do_print("a different container tab should not see any 'switch to tab'");
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions user-context-id:2",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- { uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] },
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
+ makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }) ]
});
do_print("three results, both normal results are tab matches, one has multiple tabs");
@@ -90,8 +55,7 @@ add_task(function* test_tab_matches() {
searchParam: "enable-actions",
matches: [ makeSearchMatch("abc", { heuristic: true }),
makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }),
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
+ makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }) ]
});
do_print("three results, no tab matches (disable-private-actions)");
@@ -100,8 +64,7 @@ add_task(function* test_tab_matches() {
searchParam: "enable-actions disable-private-actions",
matches: [ makeSearchMatch("abc", { heuristic: true }),
{ uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] },
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
+ { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_print("two results (actions disabled)");
@@ -109,8 +72,7 @@ add_task(function* test_tab_matches() {
search: "abc",
searchParam: "",
matches: [ { uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] },
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
+ { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_print("three results, no tab matches");
@@ -121,8 +83,7 @@ add_task(function* test_tab_matches() {
searchParam: "enable-actions",
matches: [ makeSearchMatch("abc", { heuristic: true }),
{ uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] },
- { uri: uri5, title: "foobar.org - much better than ABC, definitely better than XYZ", style: [ "favicon" ] } ]
+ { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
});
do_print("tab match search with restriction character");
diff --git a/toolkit/components/search/current/nsSearchService.js b/toolkit/components/search/current/nsSearchService.js
index 6e8f6da436..2a86010780 100644
--- a/toolkit/components/search/current/nsSearchService.js
+++ b/toolkit/components/search/current/nsSearchService.js
@@ -234,7 +234,7 @@ var LOG = function() {};
if (AppConstants.DEBUG) {
LOG = function (aText) {
- if (getBoolPref(BROWSER_SEARCH_PREF + "log", false)) {
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "log", false)) {
DO_LOG(aText);
}
};
@@ -908,18 +908,6 @@ function getLocalizedPref(aPrefName, aDefault) {
}
/**
- * Wrapper for nsIPrefBranch::getBoolPref.
- * @param aPrefName
- * The name of the pref to get.
- * @returns aDefault if the requested pref doesn't exist.
- */
-function getBoolPref(aName, aDefault) {
- if (Services.prefs.getPrefType(aName) != Ci.nsIPrefBranch.PREF_BOOL)
- return aDefault;
- return Services.prefs.getBoolPref(aName);
-}
-
-/**
* @return a sanitized name to be used as a filename, or a random name
* if a sanitized name cannot be obtained (if aName contains
* no valid characters).
@@ -1534,7 +1522,7 @@ Engine.prototype = {
stringBundle.formatStringFromName("addEngineConfirmation",
[this._name, this._uri.host], 2);
var checkboxMessage = null;
- if (!getBoolPref(BROWSER_SEARCH_PREF + "noCurrentEngine", false))
+ if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "noCurrentEngine", false))
checkboxMessage = stringBundle.GetStringFromName("addEngineAsCurrentText");
var addButtonLabel =
@@ -2658,7 +2646,7 @@ function checkForSyncCompletion(aPromise) {
// nsIBrowserSearchService
function SearchService() {
// Replace empty LOG function with the useful one if the log pref is set.
- if (getBoolPref(BROWSER_SEARCH_PREF + "log", false))
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "log", false))
LOG = DO_LOG;
this._initObservers = Promise.defer();
@@ -3770,7 +3758,7 @@ SearchService.prototype = {
// If the user has specified a custom engine order, read the order
// information from the metadata instead of the default prefs.
- if (getBoolPref(BROWSER_SEARCH_PREF + "useDBForOrder", false)) {
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "useDBForOrder", false)) {
LOG("_buildSortedEngineList: using db for order");
// Flag to keep track of whether or not we need to call _saveSortedEngineList.
@@ -4624,7 +4612,7 @@ SearchService.prototype = {
notify: function SRCH_SVC_notify(aTimer) {
LOG("_notify: checking for updates");
- if (!getBoolPref(BROWSER_SEARCH_PREF + "update", true))
+ if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update", true))
return;
// Our timer has expired, but unfortunately, we can't get any data from it.
@@ -4735,7 +4723,7 @@ const SEARCH_UPDATE_LOG_PREFIX = "*** Search update: ";
* logging pref (browser.search.update.log) is set to true.
*/
function ULOG(aText) {
- if (getBoolPref(BROWSER_SEARCH_PREF + "update.log", false)) {
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update.log", false)) {
dump(SEARCH_UPDATE_LOG_PREFIX + aText + "\n");
Services.console.logStringMessage(aText);
}
@@ -4751,7 +4739,7 @@ var engineUpdateService = {
update: function eus_Update(aEngine) {
let engine = aEngine.wrappedJSObject;
ULOG("update called for " + aEngine._name);
- if (!getBoolPref(BROWSER_SEARCH_PREF + "update", true) || !engine._hasUpdates)
+ if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update", true) || !engine._hasUpdates)
return;
let testEngine = null;
diff --git a/toolkit/components/search/orginal/nsSearchService.js b/toolkit/components/search/orginal/nsSearchService.js
index 6b23724a75..5b5ce7a577 100644
--- a/toolkit/components/search/orginal/nsSearchService.js
+++ b/toolkit/components/search/orginal/nsSearchService.js
@@ -248,7 +248,7 @@ function DO_LOG(aText) {
* to allow enabling/disabling without a restart.
*/
function PREF_LOG(aText) {
- if (getBoolPref(BROWSER_SEARCH_PREF + "log", false))
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "log", false))
DO_LOG(aText);
}
var LOG = PREF_LOG;
@@ -934,18 +934,6 @@ function setLocalizedPref(aPrefName, aValue) {
}
/**
- * Wrapper for nsIPrefBranch::getBoolPref.
- * @param aPrefName
- * The name of the pref to get.
- * @returns aDefault if the requested pref doesn't exist.
- */
-function getBoolPref(aName, aDefault) {
- if (Services.prefs.getPrefType(aName) != Ci.nsIPrefBranch.PREF_BOOL)
- return aDefault;
- return Services.prefs.getBoolPref(aName);
-}
-
-/**
* Get a unique nsIFile object with a sanitized name, based on the engine name.
* @param aName
* A name to "sanitize". Can be an empty string, in which case a random
@@ -1591,7 +1579,7 @@ Engine.prototype = {
stringBundle.formatStringFromName("addEngineConfirmation",
[this._name, this._uri.host], 2);
var checkboxMessage = null;
- if (!getBoolPref(BROWSER_SEARCH_PREF + "noCurrentEngine", false))
+ if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "noCurrentEngine", false))
checkboxMessage = stringBundle.GetStringFromName("addEngineAsCurrentText");
var addButtonLabel =
@@ -2889,7 +2877,7 @@ function checkForSyncCompletion(aPromise) {
// nsIBrowserSearchService
function SearchService() {
// Replace empty LOG function with the useful one if the log pref is set.
- if (getBoolPref(BROWSER_SEARCH_PREF + "log", false))
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "log", false))
LOG = DO_LOG;
this._initObservers = Promise.defer();
@@ -3814,7 +3802,7 @@ SearchService.prototype = {
// If the user has specified a custom engine order, read the order
// information from the engineMetadataService instead of the default
// prefs.
- if (getBoolPref(BROWSER_SEARCH_PREF + "useDBForOrder", false)) {
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "useDBForOrder", false)) {
LOG("_buildSortedEngineList: using db for order");
// Flag to keep track of whether or not we need to call _saveSortedEngineList.
@@ -4595,7 +4583,7 @@ SearchService.prototype = {
notify: function SRCH_SVC_notify(aTimer) {
LOG("_notify: checking for updates");
- if (!getBoolPref(BROWSER_SEARCH_PREF + "update", true))
+ if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update", true))
return;
// Our timer has expired, but unfortunately, we can't get any data from it.
@@ -4938,7 +4926,7 @@ const SEARCH_UPDATE_LOG_PREFIX = "*** Search update: ";
* logging pref (browser.search.update.log) is set to true.
*/
function ULOG(aText) {
- if (getBoolPref(BROWSER_SEARCH_PREF + "update.log", false)) {
+ if (Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update.log", false)) {
dump(SEARCH_UPDATE_LOG_PREFIX + aText + "\n");
Services.console.logStringMessage(aText);
}
@@ -4955,7 +4943,7 @@ var engineUpdateService = {
update: function eus_Update(aEngine) {
let engine = aEngine.wrappedJSObject;
ULOG("update called for " + aEngine._name);
- if (!getBoolPref(BROWSER_SEARCH_PREF + "update", true) || !engine._hasUpdates)
+ if (!Services.prefs.getBoolPref(BROWSER_SEARCH_PREF + "update", true) || !engine._hasUpdates)
return;
let testEngine = null;
diff --git a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
index 3eec9827d2..3ed32665de 100644
--- a/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
+++ b/toolkit/components/thumbnails/BackgroundPageThumbs.jsm
@@ -15,8 +15,6 @@ const TELEMETRY_HISTOGRAM_ID_PREFIX = "FX_THUMBNAILS_BG_";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
const HTML_NS = "http://www.w3.org/1999/xhtml";
-const ABOUT_NEWTAB_SEGREGATION_PREF = "privacy.usercontext.about_newtab_segregation.enabled";
-
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
@@ -37,10 +35,11 @@ XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_TIMEOUT", TEL_CAPTURE_DONE_TIM
XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_CRASHED", TEL_CAPTURE_DONE_CRASHED);
XPCOMUtils.defineConstant(this, "TEL_CAPTURE_DONE_BAD_URI", TEL_CAPTURE_DONE_BAD_URI);
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
const global = this;
+// contains base64 version of a placeholder thumbnail
+#include blankthumb.inc
+
const BackgroundPageThumbs = {
/**
@@ -136,14 +135,6 @@ const BackgroundPageThumbs = {
}),
/**
- * Tell the service that the thumbnail browser should be recreated at next
- * call of _ensureBrowser().
- */
- renewThumbnailBrowser: function() {
- this._renewThumbBrowser = true;
- },
-
- /**
* Ensures that initialization of the thumbnail browser's parent window has
* begun.
*
@@ -198,12 +189,9 @@ const BackgroundPageThumbs = {
* Creates the thumbnail browser if it doesn't already exist.
*/
_ensureBrowser: function () {
- if (this._thumbBrowser && !this._renewThumbBrowser)
+ if (this._thumbBrowser)
return;
- this._destroyBrowser();
- this._renewThumbBrowser = false;
-
let browser = this._parentWin.document.createElementNS(XUL_NS, "browser");
browser.setAttribute("type", "content");
browser.setAttribute("disableglobalhistory", "true");
@@ -213,13 +201,6 @@ const BackgroundPageThumbs = {
browser.setAttribute("remote", "true");
}
- if (Services.prefs.getBoolPref(ABOUT_NEWTAB_SEGREGATION_PREF)) {
- // Use the private container for thumbnails.
- let privateIdentity =
- ContextualIdentityService.getPrivateIdentity("userContextIdInternal.thumbnail");
- browser.setAttribute("usercontextid", privateIdentity.userContextId);
- }
-
// Size the browser. Make its aspect ratio the same as the canvases' that
// the thumbnails are drawn into; the canvases' aspect ratio is the same as
// the screen's, so use that. Aim for a size in the ballpark of 1024x768.
@@ -322,14 +303,6 @@ const BackgroundPageThumbs = {
_destroyBrowserTimeout: DESTROY_BROWSER_TIMEOUT,
};
-Services.prefs.addObserver(ABOUT_NEWTAB_SEGREGATION_PREF,
- function(aSubject, aTopic, aData) {
- if (aTopic == "nsPref:changed" && aData == ABOUT_NEWTAB_SEGREGATION_PREF) {
- BackgroundPageThumbs.renewThumbnailBrowser();
- }
- },
- false);
-
Object.defineProperty(this, "BackgroundPageThumbs", {
value: BackgroundPageThumbs,
enumerable: true,
@@ -464,14 +437,6 @@ Capture.prototype = {
Cu.reportError(err);
}
}
-
- if (Services.prefs.getBoolPref(ABOUT_NEWTAB_SEGREGATION_PREF)) {
- // Clear the data in the private container for thumbnails.
- let privateIdentity =
- ContextualIdentityService.getPrivateIdentity("userContextIdInternal.thumbnail");
- Services.obs.notifyObservers(null, "clear-origin-attributes-data",
- JSON.stringify({ userContextId: privateIdentity.userContextId }));
- }
};
if (!data) {
diff --git a/toolkit/components/thumbnails/PageThumbs.jsm b/toolkit/components/thumbnails/PageThumbs.jsm
index 5c7754b318..b0affee928 100644
--- a/toolkit/components/thumbnails/PageThumbs.jsm
+++ b/toolkit/components/thumbnails/PageThumbs.jsm
@@ -28,9 +28,6 @@ const MAX_THUMBNAIL_AGE_SECS = 172800; // 2 days == 60*60*24*2 == 172800 secs.
*/
const THUMBNAIL_DIRECTORY = "thumbnails";
-// contains base64 version of a placeholder thumbnail
-#include blankthumb.inc
-
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/PromiseWorker.jsm", this);
Cu.import("resource://gre/modules/Promise.jsm", this);
diff --git a/toolkit/components/thumbnails/moz.build b/toolkit/components/thumbnails/moz.build
index d4003c6355..e4a178998f 100644
--- a/toolkit/components/thumbnails/moz.build
+++ b/toolkit/components/thumbnails/moz.build
@@ -13,13 +13,13 @@ EXTRA_COMPONENTS += [
]
EXTRA_JS_MODULES += [
- 'BackgroundPageThumbs.jsm',
+ 'PageThumbs.jsm',
'PageThumbsWorker.js',
'PageThumbUtils.jsm',
]
EXTRA_PP_JS_MODULES += [
- 'PageThumbs.jsm',
+ 'BackgroundPageThumbs.jsm',
]
diff --git a/toolkit/components/timermanager/nsUpdateTimerManager.js b/toolkit/components/timermanager/nsUpdateTimerManager.js
index d7fc159602..3ba82f8c0f 100644
--- a/toolkit/components/timermanager/nsUpdateTimerManager.js
+++ b/toolkit/components/timermanager/nsUpdateTimerManager.js
@@ -16,30 +16,10 @@ const PREF_APP_UPDATE_LOG = "app.update.log";
const CATEGORY_UPDATE_TIMER = "update-timer";
XPCOMUtils.defineLazyGetter(this, "gLogEnabled", function tm_gLogEnabled() {
- return getPref("getBoolPref", PREF_APP_UPDATE_LOG, false);
+ return Services.prefs.getBoolPref(PREF_APP_UPDATE_LOG, false);
});
/**
- * Gets a preference value, handling the case where there is no default.
- * @param func
- * The name of the preference function to call, on nsIPrefBranch
- * @param preference
- * The name of the preference
- * @param defaultValue
- * The default value to return in the event the preference has
- * no setting
- * @returns The value of the preference, or undefined if there was no
- * user or default value.
- */
-function getPref(func, preference, defaultValue) {
- try {
- return Services.prefs[func](preference);
- } catch (e) {
- }
- return defaultValue;
-}
-
-/**
* Logs a string to the error console.
* @param string
* The string to write to the error console.
@@ -93,13 +73,13 @@ TimerManager.prototype = {
minInterval = 500;
minFirstInterval = 500;
case "profile-after-change":
- this._timerMinimumDelay = Math.max(1000 * getPref("getIntPref", PREF_APP_UPDATE_TIMERMINIMUMDELAY, 120),
+ this._timerMinimumDelay = Math.max(1000 * Services.prefs.getIntPref(PREF_APP_UPDATE_TIMERMINIMUMDELAY, 120),
minInterval);
// Prevent the timer delay between notifications to other consumers from
// being greater than 5 minutes which is 300000 milliseconds.
this._timerMinimumDelay = Math.min(this._timerMinimumDelay, 300000);
// Prevent the first interval from being less than the value of minFirstInterval
- let firstInterval = Math.max(getPref("getIntPref", PREF_APP_UPDATE_TIMERFIRSTINTERVAL,
+ let firstInterval = Math.max(Services.prefs.getIntPref(PREF_APP_UPDATE_TIMERFIRSTINTERVAL,
30000), minFirstInterval);
// Prevent the first interval from being greater than 2 minutes which is
// 120000 milliseconds.
@@ -189,7 +169,7 @@ TimerManager.prototype = {
continue;
}
- let interval = getPref("getIntPref", prefInterval, defaultInterval);
+ let interval = Services.prefs.getIntPref(prefInterval, defaultInterval);
// Allow the update-timer category to specify a maximum value to prevent
// values larger than desired.
maxInterval = parseInt(maxInterval);
@@ -200,7 +180,7 @@ TimerManager.prototype = {
timerID);
// Initialize the last update time to 0 when the preference isn't set so
// the timer will be notified soon after a new profile's first use.
- lastUpdateTime = getPref("getIntPref", prefLastUpdate, 0);
+ lastUpdateTime = Services.prefs.getIntPref(prefLastUpdate, 0);
// If the last update time is greater than the current time then reset
// it to 0 and the timer manager will correct the value when it fires
@@ -315,7 +295,7 @@ TimerManager.prototype = {
let prefLastUpdate = PREF_APP_UPDATE_LASTUPDATETIME_FMT.replace(/%ID%/, id);
// Initialize the last update time to 0 when the preference isn't set so
// the timer will be notified soon after a new profile's first use.
- let lastUpdateTime = getPref("getIntPref", prefLastUpdate, 0);
+ let lastUpdateTime = Services.prefs.getIntPref(prefLastUpdate, 0);
let now = Math.round(Date.now() / 1000);
if (lastUpdateTime > now) {
lastUpdateTime = 0;
diff --git a/toolkit/components/webextensions/.eslintrc.js b/toolkit/components/webextensions/.eslintrc.js
deleted file mode 100644
index 70f91ab6d2..0000000000
--- a/toolkit/components/webextensions/.eslintrc.js
+++ /dev/null
@@ -1,494 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": "../../.eslintrc.js",
-
- "parserOptions": {
- "ecmaVersion": 8,
- },
-
- "globals": {
- "Cc": true,
- "Ci": true,
- "Components": true,
- "Cr": true,
- "Cu": true,
- "dump": true,
- "TextDecoder": false,
- "TextEncoder": false,
- // Specific to WebExtensions:
- "Extension": true,
- "ExtensionManagement": true,
- "extensions": true,
- "global": true,
- "NetUtil": true,
- "openOptionsPage": true,
- "require": false,
- "runSafe": true,
- "runSafeSync": true,
- "runSafeSyncWithoutClone": true,
- "Services": true,
- "TabManager": true,
- "WindowListManager": true,
- "XPCOMUtils": true,
- },
-
- "rules": {
- // Rules from the mozilla plugin
- "mozilla/balanced-listeners": "error",
- "mozilla/no-aArgs": "error",
- "mozilla/no-cpows-in-tests": "warn",
- "mozilla/var-only-at-top-level": "warn",
-
- "valid-jsdoc": ["error", {
- "prefer": {
- "return": "returns",
- },
- "preferType": {
- "Boolean": "boolean",
- "Number": "number",
- "String": "string",
- "bool": "boolean",
- },
- "requireParamDescription": false,
- "requireReturn": false,
- "requireReturnDescription": false,
- }],
-
- // Braces only needed for multi-line arrow function blocks
- // "arrow-body-style": ["error", "as-needed"],
-
- // Require spacing around =>
- "arrow-spacing": "error",
-
- // Always require spacing around a single line block
- "block-spacing": "warn",
-
- // Forbid spaces inside the square brackets of array literals.
- "array-bracket-spacing": ["error", "never"],
-
- // Forbid spaces inside the curly brackets of object literals.
- "object-curly-spacing": ["error", "never"],
-
- // No space padding in parentheses
- "space-in-parens": ["error", "never"],
-
- // Enforce one true brace style (opening brace on the same line) and avoid
- // start and end braces on the same line.
- "brace-style": ["error", "1tbs", {"allowSingleLine": true}],
-
- // No space before always a space after a comma
- "comma-spacing": ["error", {"before": false, "after": true}],
-
- // Commas at the end of the line not the start
- "comma-style": "error",
-
- // Don't require spaces around computed properties
- "computed-property-spacing": ["error", "never"],
-
- // Functions are not required to consistently return something or nothing
- "consistent-return": "off",
-
- // Require braces around blocks that start a new line
- "curly": ["error", "all"],
-
- // Always require a trailing EOL
- "eol-last": "error",
-
- // Require function* name()
- "generator-star-spacing": ["error", {"before": false, "after": true}],
-
- // Two space indent
- "indent": ["error", 2, {"SwitchCase": 1}],
-
- // Space after colon not before in property declarations
- "key-spacing": ["error", {"beforeColon": false, "afterColon": true, "mode": "minimum"}],
-
- // Require spaces before and after finally, catch, etc.
- "keyword-spacing": "error",
-
- // Unix linebreaks
- "linebreak-style": ["error", "unix"],
-
- // Always require parenthesis for new calls
- "new-parens": "error",
-
- // Use [] instead of Array()
- "no-array-constructor": "error",
-
- // No duplicate arguments in function declarations
- "no-dupe-args": "error",
-
- // No duplicate keys in object declarations
- "no-dupe-keys": "error",
-
- // No duplicate cases in switch statements
- "no-duplicate-case": "error",
-
- // If an if block ends with a return no need for an else block
- // "no-else-return": "error",
-
- // Disallow empty statements. This will report an error for:
- // try { something(); } catch (e) {}
- // but will not report it for:
- // try { something(); } catch (e) { /* Silencing the error because ...*/ }
- // which is a valid use case.
- "no-empty": "error",
-
- // No empty character classes in regex
- "no-empty-character-class": "error",
-
- // Disallow empty destructuring
- "no-empty-pattern": "error",
-
- // No assiging to exception variable
- "no-ex-assign": "error",
-
- // No using !! where casting to boolean is already happening
- "no-extra-boolean-cast": "warn",
-
- // No double semicolon
- "no-extra-semi": "error",
-
- // No overwriting defined functions
- "no-func-assign": "error",
-
- // No invalid regular expresions
- "no-invalid-regexp": "error",
-
- // No odd whitespace characters
- "no-irregular-whitespace": "error",
-
- // No single if block inside an else block
- "no-lonely-if": "warn",
-
- // No mixing spaces and tabs in indent
- "no-mixed-spaces-and-tabs": ["error", "smart-tabs"],
-
- // Disallow use of multiple spaces (sometimes used to align const values,
- // array or object items, etc.). It's hard to maintain and doesn't add that
- // much benefit.
- "no-multi-spaces": "warn",
-
- // No reassigning native JS objects
- "no-native-reassign": "error",
-
- // Nested ternary statements are confusing
- "no-nested-ternary": "error",
-
- // Use {} instead of new Object()
- "no-new-object": "error",
-
- // No Math() or JSON()
- "no-obj-calls": "error",
-
- // No octal literals
- "no-octal": "error",
-
- // No redeclaring variables
- "no-redeclare": "error",
-
- // No unnecessary comparisons
- "no-self-compare": "error",
-
- // No spaces between function name and parentheses
- "no-spaced-func": "warn",
-
- // No trailing whitespace
- "no-trailing-spaces": "error",
-
- // Error on newline where a semicolon is needed
- "no-unexpected-multiline": "error",
-
- // No unreachable statements
- "no-unreachable": "error",
-
- // No expressions where a statement is expected
- "no-unused-expressions": "error",
-
- // No declaring variables that are never used
- "no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}],
-
- // No using variables before defined
- "no-use-before-define": "error",
-
- // No using with
- "no-with": "error",
-
- // Always require semicolon at end of statement
- "semi": ["error", "always"],
-
- // Require space before blocks
- "space-before-blocks": "error",
-
- // Never use spaces before function parentheses
- "space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
-
- // Require spaces around operators, except for a|0.
- "space-infix-ops": ["error", {"int32Hint": true}],
-
- // ++ and -- should not need spacing
- "space-unary-ops": ["warn", {"nonwords": false, "words": true, "overrides": {"typeof": false}}],
-
- // No comparisons to NaN
- "use-isnan": "error",
-
- // Only check typeof against valid results
- "valid-typeof": "error",
-
- // Disallow using variables outside the blocks they are defined (especially
- // since only let and const are used, see "no-var").
- "block-scoped-var": "error",
-
- // Allow trailing commas for easy list extension. Having them does not
- // impair readability, but also not required either.
- "comma-dangle": ["error", "always-multiline"],
-
- // Warn about cyclomatic complexity in functions.
- "complexity": "warn",
-
- // Don't warn for inconsistent naming when capturing this (not so important
- // with auto-binding fat arrow functions).
- // "consistent-this": ["error", "self"],
-
- // Don't require a default case in switch statements. Avoid being forced to
- // add a bogus default when you know all possible cases are handled.
- "default-case": "off",
-
- // Enforce dots on the next line with property name.
- "dot-location": ["error", "property"],
-
- // Encourage the use of dot notation whenever possible.
- "dot-notation": "error",
-
- // Allow using == instead of ===, in the interest of landing something since
- // the devtools codebase is split on convention here.
- "eqeqeq": "off",
-
- // Don't require function expressions to have a name.
- // This makes the code more verbose and hard to read. Our engine already
- // does a fantastic job assigning a name to the function, which includes
- // the enclosing function name, and worst case you have a line number that
- // you can just look up.
- "func-names": "off",
-
- // Allow use of function declarations and expressions.
- "func-style": "off",
-
- // Don't enforce the maximum depth that blocks can be nested. The complexity
- // rule is a better rule to check this.
- "max-depth": "off",
-
- // Maximum length of a line.
- // Disabled because we exceed this in too many places.
- "max-len": [0, 80],
-
- // Maximum depth callbacks can be nested.
- "max-nested-callbacks": ["error", 4],
-
- // Don't limit the number of parameters that can be used in a function.
- "max-params": "off",
-
- // Don't limit the maximum number of statement allowed in a function. We
- // already have the complexity rule that's a better measurement.
- "max-statements": "off",
-
- // Don't require a capital letter for constructors, only check if all new
- // operators are followed by a capital letter. Don't warn when capitalized
- // functions are used without the new operator.
- "new-cap": ["off", {"capIsNew": false}],
-
- // Allow use of bitwise operators.
- "no-bitwise": "off",
-
- // Disallow use of arguments.caller or arguments.callee.
- "no-caller": "error",
-
- // Disallow the catch clause parameter name being the same as a variable in
- // the outer scope, to avoid confusion.
- "no-catch-shadow": "off",
-
- // Disallow assignment in conditional expressions.
- "no-cond-assign": "error",
-
- // Disallow using the console API.
- "no-console": "error",
-
- // Allow using constant expressions in conditions like while (true)
- "no-constant-condition": "off",
-
- // Allow use of the continue statement.
- "no-continue": "off",
-
- // Disallow control characters in regular expressions.
- "no-control-regex": "error",
-
- // Disallow use of debugger.
- "no-debugger": "error",
-
- // Disallow deletion of variables (deleting properties is fine).
- "no-delete-var": "error",
-
- // Allow division operators explicitly at beginning of regular expression.
- "no-div-regex": "off",
-
- // Disallow use of eval(). We have other APIs to evaluate code in content.
- "no-eval": "error",
-
- // Disallow adding to native types
- "no-extend-native": "error",
-
- // Disallow unnecessary function binding.
- "no-extra-bind": "error",
-
- // Allow unnecessary parentheses, as they may make the code more readable.
- "no-extra-parens": "off",
-
- // Disallow fallthrough of case statements, except if there is a comment.
- "no-fallthrough": "error",
-
- // Allow the use of leading or trailing decimal points in numeric literals.
- "no-floating-decimal": "off",
-
- // Allow comments inline after code.
- "no-inline-comments": "off",
-
- // Disallow use of labels for anything other then loops and switches.
- "no-labels": ["error", {"allowLoop": true}],
-
- // Disallow use of multiline strings (use template strings instead).
- "no-multi-str": "warn",
-
- // Disallow multiple empty lines.
- "no-multiple-empty-lines": [1, {"max": 2}],
-
- // Allow reassignment of function parameters.
- "no-param-reassign": "off",
-
- // Allow string concatenation with __dirname and __filename (not a node env).
- "no-path-concat": "off",
-
- // Allow use of unary operators, ++ and --.
- "no-plusplus": "off",
-
- // Allow using process.env (not a node environment).
- "no-process-env": "off",
-
- // Allow using process.exit (not a node environment).
- "no-process-exit": "off",
-
- // Disallow usage of __proto__ property.
- "no-proto": "error",
-
- // Disallow multiple spaces in a regular expression literal.
- "no-regex-spaces": "error",
-
- // Allow reserved words being used as object literal keys.
- "no-reserved-keys": "off",
-
- // Don't restrict usage of specified node modules (not a node environment).
- "no-restricted-modules": "off",
-
- // Disallow use of assignment in return statement. It is preferable for a
- // single line of code to have only one easily predictable effect.
- "no-return-assign": "error",
-
- // Don't warn about declaration of variables already declared in the outer scope.
- "no-shadow": "off",
-
- // Disallow shadowing of names such as arguments.
- "no-shadow-restricted-names": "error",
-
- // Allow use of synchronous methods (not a node environment).
- "no-sync": "off",
-
- // Allow the use of ternary operators.
- "no-ternary": "off",
-
- // Disallow throwing literals (eg. throw "error" instead of
- // throw new Error("error")).
- "no-throw-literal": "error",
-
- // Disallow use of undeclared variables unless mentioned in a /* global */
- // block. Note that globals from head.js are automatically imported in tests
- // by the import-headjs-globals rule form the mozilla eslint plugin.
- "no-undef": "error",
-
- // Allow dangling underscores in identifiers (for privates).
- "no-underscore-dangle": "off",
-
- // Allow use of undefined variable.
- "no-undefined": "off",
-
- // Disallow the use of Boolean literals in conditional expressions.
- "no-unneeded-ternary": "error",
-
- // We use var-only-at-top-level instead of no-var as we allow top level
- // vars.
- "no-var": "off",
-
- // Allow using TODO/FIXME comments.
- "no-warning-comments": "off",
-
- // Don't require method and property shorthand syntax for object literals.
- // We use this in the code a lot, but not consistently, and this seems more
- // like something to check at code review time.
- "object-shorthand": "off",
-
- // Allow more than one variable declaration per function.
- "one-var": "off",
-
- // Disallow padding within blocks.
- "padded-blocks": ["warn", "never"],
-
- // Don't require quotes around object literal property names.
- "quote-props": "off",
-
- // Double quotes should be used.
- "quotes": ["warn", "double", {"avoidEscape": true, "allowTemplateLiterals": true}],
-
- // Require use of the second argument for parseInt().
- "radix": "error",
-
- // Enforce spacing after semicolons.
- "semi-spacing": ["error", {"before": false, "after": true}],
-
- // Don't require to sort variables within the same declaration block.
- // Anyway, one-var is disabled.
- "sort-vars": "off",
-
- // Require a space immediately following the // in a line comment.
- "spaced-comment": ["error", "always"],
-
- // Require "use strict" to be defined globally in the script.
- "strict": ["error", "global"],
-
- // Allow vars to be declared anywhere in the scope.
- "vars-on-top": "off",
-
- // Don't require immediate function invocation to be wrapped in parentheses.
- "wrap-iife": "off",
-
- // Don't require regex literals to be wrapped in parentheses (which
- // supposedly prevent them from being mistaken for division operators).
- "wrap-regex": "off",
-
- // Disallow Yoda conditions (where literal value comes first).
- "yoda": "error",
-
- // disallow use of eval()-like methods
- "no-implied-eval": "error",
-
- // Disallow function or variable declarations in nested blocks
- "no-inner-declarations": "error",
-
- // Disallow usage of __iterator__ property
- "no-iterator": "error",
-
- // Disallow labels that share a name with a variable
- "no-label-var": "error",
-
- // Disallow creating new instances of String, Number, and Boolean
- "no-new-wrappers": "error",
- },
-};
diff --git a/toolkit/components/webextensions/Extension.jsm b/toolkit/components/webextensions/Extension.jsm
deleted file mode 100644
index 3468f2594c..0000000000
--- a/toolkit/components/webextensions/Extension.jsm
+++ /dev/null
@@ -1,902 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["Extension", "ExtensionData"];
-
-/* globals Extension ExtensionData */
-
-/*
- * This file is the main entry point for extensions. When an extension
- * loads, its bootstrap.js file creates a Extension instance
- * and calls .startup() on it. It calls .shutdown() when the extension
- * unloads. Extension manages any extension-specific state in
- * the chrome process.
- */
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.importGlobalProperties(["TextEncoder"]);
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionAPIs",
- "resource://gre/modules/ExtensionAPI.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionStorage",
- "resource://gre/modules/ExtensionStorage.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionTestCommon",
- "resource://testing-common/ExtensionTestCommon.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Locale",
- "resource://gre/modules/Locale.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Log",
- "resource://gre/modules/Log.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MatchGlobs",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
- "resource://gre/modules/MessageChannel.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
- "resource://gre/modules/Preferences.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "require",
- "resource://devtools/shared/Loader.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-Cu.import("resource://gre/modules/ExtensionContent.jsm");
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/ExtensionParent.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "uuidGen",
- "@mozilla.org/uuid-generator;1",
- "nsIUUIDGenerator");
-
-var {
- GlobalManager,
- ParentAPIManager,
- apiManager: Management,
-} = ExtensionParent;
-
-const {
- EventEmitter,
- LocaleData,
- getUniqueId,
-} = ExtensionUtils;
-
-XPCOMUtils.defineLazyGetter(this, "console", ExtensionUtils.getConsole);
-
-const LOGGER_ID_BASE = "addons.webextension.";
-const UUID_MAP_PREF = "extensions.webextensions.uuids";
-const LEAVE_STORAGE_PREF = "extensions.webextensions.keepStorageOnUninstall";
-const LEAVE_UUID_PREF = "extensions.webextensions.keepUuidOnUninstall";
-
-const COMMENT_REGEXP = new RegExp(String.raw`
- ^
- (
- (?:
- [^"\n] |
- " (?:[^"\\\n] | \\.)* "
- )*?
- )
-
- //.*
- `.replace(/\s+/g, ""), "gm");
-
-// All moz-extension URIs use a machine-specific UUID rather than the
-// extension's own ID in the host component. This makes it more
-// difficult for web pages to detect whether a user has a given add-on
-// installed (by trying to load a moz-extension URI referring to a
-// web_accessible_resource from the extension). UUIDMap.get()
-// returns the UUID for a given add-on ID.
-var UUIDMap = {
- _read() {
- let pref = Preferences.get(UUID_MAP_PREF, "{}");
- try {
- return JSON.parse(pref);
- } catch (e) {
- Cu.reportError(`Error parsing ${UUID_MAP_PREF}.`);
- return {};
- }
- },
-
- _write(map) {
- Preferences.set(UUID_MAP_PREF, JSON.stringify(map));
- },
-
- get(id, create = true) {
- let map = this._read();
-
- if (id in map) {
- return map[id];
- }
-
- let uuid = null;
- if (create) {
- uuid = uuidGen.generateUUID().number;
- uuid = uuid.slice(1, -1); // Strip { and } off the UUID.
-
- map[id] = uuid;
- this._write(map);
- }
- return uuid;
- },
-
- remove(id) {
- let map = this._read();
- delete map[id];
- this._write(map);
- },
-};
-
-// This is the old interface that UUIDMap replaced, to be removed when
-// the references listed in bug 1291399 are updated.
-/* exported getExtensionUUID */
-function getExtensionUUID(id) {
- return UUIDMap.get(id, true);
-}
-
-// For extensions that have called setUninstallURL(), send an event
-// so the browser can display the URL.
-var UninstallObserver = {
- initialized: false,
-
- init() {
- if (!this.initialized) {
- AddonManager.addAddonListener(this);
- XPCOMUtils.defineLazyPreferenceGetter(this, "leaveStorage", LEAVE_STORAGE_PREF, false);
- XPCOMUtils.defineLazyPreferenceGetter(this, "leaveUuid", LEAVE_UUID_PREF, false);
- this.initialized = true;
- }
- },
-
- onUninstalling(addon) {
- let extension = GlobalManager.extensionMap.get(addon.id);
- if (extension) {
- // Let any other interested listeners respond
- // (e.g., display the uninstall URL)
- Management.emit("uninstall", extension);
- }
- },
-
- onUninstalled(addon) {
- let uuid = UUIDMap.get(addon.id, false);
- if (!uuid) {
- return;
- }
-
- if (!this.leaveStorage) {
- // Clear browser.local.storage
- ExtensionStorage.clear(addon.id);
-
- // Clear any IndexedDB storage created by the extension
- let baseURI = NetUtil.newURI(`moz-extension://${uuid}/`);
- let principal = Services.scriptSecurityManager.createCodebasePrincipal(
- baseURI, {addonId: addon.id}
- );
- Services.qms.clearStoragesForPrincipal(principal);
-
- // Clear localStorage created by the extension
- let attrs = JSON.stringify({addonId: addon.id});
- Services.obs.notifyObservers(null, "clear-origin-attributes-data", attrs);
- }
-
- if (!this.leaveUuid) {
- // Clear the entry in the UUID map
- UUIDMap.remove(addon.id);
- }
- },
-};
-
-UninstallObserver.init();
-
-// Represents the data contained in an extension, contained either
-// in a directory or a zip file, which may or may not be installed.
-// This class implements the functionality of the Extension class,
-// primarily related to manifest parsing and localization, which is
-// useful prior to extension installation or initialization.
-//
-// No functionality of this class is guaranteed to work before
-// |readManifest| has been called, and completed.
-this.ExtensionData = class {
- constructor(rootURI) {
- this.rootURI = rootURI;
-
- this.manifest = null;
- this.id = null;
- this.uuid = null;
- this.localeData = null;
- this._promiseLocales = null;
-
- this.apiNames = new Set();
- this.dependencies = new Set();
- this.permissions = new Set();
-
- this.errors = [];
- }
-
- get builtinMessages() {
- return null;
- }
-
- get logger() {
- let id = this.id || "<unknown>";
- return Log.repository.getLogger(LOGGER_ID_BASE + id);
- }
-
- // Report an error about the extension's manifest file.
- manifestError(message) {
- this.packagingError(`Reading manifest: ${message}`);
- }
-
- // Report an error about the extension's general packaging.
- packagingError(message) {
- this.errors.push(message);
- this.logger.error(`Loading extension '${this.id}': ${message}`);
- }
-
- /**
- * Returns the moz-extension: URL for the given path within this
- * extension.
- *
- * Must not be called unless either the `id` or `uuid` property has
- * already been set.
- *
- * @param {string} path The path portion of the URL.
- * @returns {string}
- */
- getURL(path = "") {
- if (!(this.id || this.uuid)) {
- throw new Error("getURL may not be called before an `id` or `uuid` has been set");
- }
- if (!this.uuid) {
- this.uuid = UUIDMap.get(this.id);
- }
- return `moz-extension://${this.uuid}/${path}`;
- }
-
- readDirectory(path) {
- return Task.spawn(function* () {
- if (this.rootURI instanceof Ci.nsIFileURL) {
- let uri = NetUtil.newURI(this.rootURI.resolve("./" + path));
- let fullPath = uri.QueryInterface(Ci.nsIFileURL).file.path;
-
- let iter = new OS.File.DirectoryIterator(fullPath);
- let results = [];
-
- try {
- yield iter.forEach(entry => {
- results.push(entry);
- });
- } catch (e) {
- // Always return a list, even if the directory does not exist (or is
- // not a directory) for symmetry with the ZipReader behavior.
- }
- iter.close();
-
- return results;
- }
-
- // FIXME: We need a way to do this without main thread IO.
-
- let uri = this.rootURI.QueryInterface(Ci.nsIJARURI);
-
- let file = uri.JARFile.QueryInterface(Ci.nsIFileURL).file;
- let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].createInstance(Ci.nsIZipReader);
- zipReader.open(file);
- try {
- let results = [];
-
- // Normalize the directory path.
- path = `${uri.JAREntry}/${path}`;
- path = path.replace(/\/\/+/g, "/").replace(/^\/|\/$/g, "") + "/";
-
- // Escape pattern metacharacters.
- let pattern = path.replace(/[[\]()?*~|$\\]/g, "\\$&");
-
- let enumerator = zipReader.findEntries(pattern + "*");
- while (enumerator.hasMore()) {
- let name = enumerator.getNext();
- if (!name.startsWith(path)) {
- throw new Error("Unexpected ZipReader entry");
- }
-
- // The enumerator returns the full path of all entries.
- // Trim off the leading path, and filter out entries from
- // subdirectories.
- name = name.slice(path.length);
- if (name && !/\/./.test(name)) {
- results.push({
- name: name.replace("/", ""),
- isDir: name.endsWith("/"),
- });
- }
- }
-
- return results;
- } finally {
- zipReader.close();
- }
- }.bind(this));
- }
-
- readJSON(path) {
- return new Promise((resolve, reject) => {
- let uri = this.rootURI.resolve(`./${path}`);
-
- NetUtil.asyncFetch({uri, loadUsingSystemPrincipal: true}, (inputStream, status) => {
- if (!Components.isSuccessCode(status)) {
- // Convert status code to a string
- let e = Components.Exception("", status);
- reject(new Error(`Error while loading '${uri}' (${e.name})`));
- return;
- }
- try {
- let text = NetUtil.readInputStreamToString(inputStream, inputStream.available(),
- {charset: "utf-8"});
-
- text = text.replace(COMMENT_REGEXP, "$1");
-
- resolve(JSON.parse(text));
- } catch (e) {
- reject(e);
- }
- });
- });
- }
-
- // Reads the extension's |manifest.json| file, and stores its
- // parsed contents in |this.manifest|.
- readManifest() {
- return Promise.all([
- this.readJSON("manifest.json"),
- Management.lazyInit(),
- ]).then(([manifest]) => {
- this.manifest = manifest;
- this.rawManifest = manifest;
-
- if (manifest && manifest.default_locale) {
- return this.initLocale();
- }
- }).then(() => {
- let context = {
- url: this.baseURI && this.baseURI.spec,
-
- principal: this.principal,
-
- logError: error => {
- this.logger.warn(`Loading extension '${this.id}': Reading manifest: ${error}`);
- },
-
- preprocessors: {},
- };
-
- if (this.localeData) {
- context.preprocessors.localize = (value, context) => this.localize(value);
- }
-
- let normalized = Schemas.normalize(this.manifest, "manifest.WebExtensionManifest", context);
- if (normalized.error) {
- this.manifestError(normalized.error);
- } else {
- this.manifest = normalized.value;
- }
-
- try {
- // Do not override the add-on id that has been already assigned.
- if (!this.id && this.manifest.applications.gecko.id) {
- this.id = this.manifest.applications.gecko.id;
- }
- } catch (e) {
- // Errors are handled by the type checks above.
- }
-
- let permissions = this.manifest.permissions || [];
-
- let whitelist = [];
- for (let perm of permissions) {
- this.permissions.add(perm);
-
- let match = /^(\w+)(?:\.(\w+)(?:\.\w+)*)?$/.exec(perm);
- if (!match) {
- whitelist.push(perm);
- } else if (match[1] == "experiments" && match[2]) {
- this.apiNames.add(match[2]);
- }
- }
- this.whiteListedHosts = new MatchPattern(whitelist);
-
- for (let api of this.apiNames) {
- this.dependencies.add(`${api}@experiments.addons.mozilla.org`);
- }
-
- return this.manifest;
- });
- }
-
- localizeMessage(...args) {
- return this.localeData.localizeMessage(...args);
- }
-
- localize(...args) {
- return this.localeData.localize(...args);
- }
-
- // If a "default_locale" is specified in that manifest, returns it
- // as a Gecko-compatible locale string. Otherwise, returns null.
- get defaultLocale() {
- if (this.manifest.default_locale != null) {
- return this.normalizeLocaleCode(this.manifest.default_locale);
- }
-
- return null;
- }
-
- // Normalizes a Chrome-compatible locale code to the appropriate
- // Gecko-compatible variant. Currently, this means simply
- // replacing underscores with hyphens.
- normalizeLocaleCode(locale) {
- return String.replace(locale, /_/g, "-");
- }
-
- // Reads the locale file for the given Gecko-compatible locale code, and
- // stores its parsed contents in |this.localeMessages.get(locale)|.
- readLocaleFile(locale) {
- return Task.spawn(function* () {
- let locales = yield this.promiseLocales();
- let dir = locales.get(locale) || locale;
- let file = `_locales/${dir}/messages.json`;
-
- try {
- let messages = yield this.readJSON(file);
- return this.localeData.addLocale(locale, messages, this);
- } catch (e) {
- this.packagingError(`Loading locale file ${file}: ${e}`);
- return new Map();
- }
- }.bind(this));
- }
-
- // Reads the list of locales available in the extension, and returns a
- // Promise which resolves to a Map upon completion.
- // Each map key is a Gecko-compatible locale code, and each value is the
- // "_locales" subdirectory containing that locale:
- //
- // Map(gecko-locale-code -> locale-directory-name)
- promiseLocales() {
- if (!this._promiseLocales) {
- this._promiseLocales = Task.spawn(function* () {
- let locales = new Map();
-
- let entries = yield this.readDirectory("_locales");
- for (let file of entries) {
- if (file.isDir) {
- let locale = this.normalizeLocaleCode(file.name);
- locales.set(locale, file.name);
- }
- }
-
- this.localeData = new LocaleData({
- defaultLocale: this.defaultLocale,
- locales,
- builtinMessages: this.builtinMessages,
- });
-
- return locales;
- }.bind(this));
- }
-
- return this._promiseLocales;
- }
-
- // Reads the locale messages for all locales, and returns a promise which
- // resolves to a Map of locale messages upon completion. Each key in the map
- // is a Gecko-compatible locale code, and each value is a locale data object
- // as returned by |readLocaleFile|.
- initAllLocales() {
- return Task.spawn(function* () {
- let locales = yield this.promiseLocales();
-
- yield Promise.all(Array.from(locales.keys(),
- locale => this.readLocaleFile(locale)));
-
- let defaultLocale = this.defaultLocale;
- if (defaultLocale) {
- if (!locales.has(defaultLocale)) {
- this.manifestError('Value for "default_locale" property must correspond to ' +
- 'a directory in "_locales/". Not found: ' +
- JSON.stringify(`_locales/${this.manifest.default_locale}/`));
- }
- } else if (locales.size) {
- this.manifestError('The "default_locale" property is required when a ' +
- '"_locales/" directory is present.');
- }
-
- return this.localeData.messages;
- }.bind(this));
- }
-
- // Reads the locale file for the given Gecko-compatible locale code, or the
- // default locale if no locale code is given, and sets it as the currently
- // selected locale on success.
- //
- // Pre-loads the default locale for fallback message processing, regardless
- // of the locale specified.
- //
- // If no locales are unavailable, resolves to |null|.
- initLocale(locale = this.defaultLocale) {
- return Task.spawn(function* () {
- if (locale == null) {
- return null;
- }
-
- let promises = [this.readLocaleFile(locale)];
-
- let {defaultLocale} = this;
- if (locale != defaultLocale && !this.localeData.has(defaultLocale)) {
- promises.push(this.readLocaleFile(defaultLocale));
- }
-
- let results = yield Promise.all(promises);
-
- this.localeData.selectedLocale = locale;
- return results[0];
- }.bind(this));
- }
-};
-
-let _browserUpdated = false;
-
-const PROXIED_EVENTS = new Set(["test-harness-message"]);
-
-// We create one instance of this class per extension. |addonData|
-// comes directly from bootstrap.js when initializing.
-this.Extension = class extends ExtensionData {
- constructor(addonData, startupReason) {
- super(addonData.resourceURI);
-
- this.uuid = UUIDMap.get(addonData.id);
- this.instanceId = getUniqueId();
-
- this.MESSAGE_EMIT_EVENT = `Extension:EmitEvent:${this.instanceId}`;
- Services.ppmm.addMessageListener(this.MESSAGE_EMIT_EVENT, this);
-
- if (addonData.cleanupFile) {
- Services.obs.addObserver(this, "xpcom-shutdown", false);
- this.cleanupFile = addonData.cleanupFile || null;
- delete addonData.cleanupFile;
- }
-
- this.addonData = addonData;
- this.startupReason = startupReason;
-
- this.id = addonData.id;
- this.baseURI = NetUtil.newURI(this.getURL("")).QueryInterface(Ci.nsIURL);
- this.principal = this.createPrincipal();
-
- this.onStartup = null;
-
- this.hasShutdown = false;
- this.onShutdown = new Set();
-
- this.uninstallURL = null;
-
- this.apis = [];
- this.whiteListedHosts = null;
- this.webAccessibleResources = null;
-
- this.emitter = new EventEmitter();
- }
-
- static set browserUpdated(updated) {
- _browserUpdated = updated;
- }
-
- static get browserUpdated() {
- return _browserUpdated;
- }
-
- static generateXPI(data) {
- return ExtensionTestCommon.generateXPI(data);
- }
-
- static generateZipFile(files, baseName = "generated-extension.xpi") {
- return ExtensionTestCommon.generateZipFile(files, baseName);
- }
-
- static generate(data) {
- return ExtensionTestCommon.generate(data);
- }
-
- on(hook, f) {
- return this.emitter.on(hook, f);
- }
-
- off(hook, f) {
- return this.emitter.off(hook, f);
- }
-
- emit(event, ...args) {
- if (PROXIED_EVENTS.has(event)) {
- Services.ppmm.broadcastAsyncMessage(this.MESSAGE_EMIT_EVENT, {event, args});
- }
-
- return this.emitter.emit(event, ...args);
- }
-
- receiveMessage({name, data}) {
- if (name === this.MESSAGE_EMIT_EVENT) {
- this.emitter.emit(data.event, ...data.args);
- }
- }
-
- testMessage(...args) {
- this.emit("test-harness-message", ...args);
- }
-
- createPrincipal(uri = this.baseURI) {
- return Services.scriptSecurityManager.createCodebasePrincipal(
- uri, {addonId: this.id});
- }
-
- // Checks that the given URL is a child of our baseURI.
- isExtensionURL(url) {
- let uri = Services.io.newURI(url, null, null);
-
- let common = this.baseURI.getCommonBaseSpec(uri);
- return common == this.baseURI.spec;
- }
-
- readManifest() {
- return super.readManifest().then(manifest => {
- if (AppConstants.RELEASE_OR_BETA) {
- return manifest;
- }
-
- // Load Experiments APIs that this extension depends on.
- return Promise.all(
- Array.from(this.apiNames, api => ExtensionAPIs.load(api))
- ).then(apis => {
- for (let API of apis) {
- this.apis.push(new API(this));
- }
-
- return manifest;
- });
- });
- }
-
- // Representation of the extension to send to content
- // processes. This should include anything the content process might
- // need.
- serialize() {
- return {
- id: this.id,
- uuid: this.uuid,
- instanceId: this.instanceId,
- manifest: this.manifest,
- resourceURL: this.addonData.resourceURI.spec,
- baseURL: this.baseURI.spec,
- content_scripts: this.manifest.content_scripts || [], // eslint-disable-line camelcase
- webAccessibleResources: this.webAccessibleResources.serialize(),
- whiteListedHosts: this.whiteListedHosts.serialize(),
- localeData: this.localeData.serialize(),
- permissions: this.permissions,
- principal: this.principal,
- };
- }
-
- broadcast(msg, data) {
- return new Promise(resolve => {
- let count = Services.ppmm.childCount;
- Services.ppmm.addMessageListener(msg + "Complete", function listener() {
- count--;
- if (count == 0) {
- Services.ppmm.removeMessageListener(msg + "Complete", listener);
- resolve();
- }
- });
- Services.ppmm.broadcastAsyncMessage(msg, data);
- });
- }
-
- runManifest(manifest) {
- // Strip leading slashes from web_accessible_resources.
- let strippedWebAccessibleResources = [];
- if (manifest.web_accessible_resources) {
- strippedWebAccessibleResources = manifest.web_accessible_resources.map(path => path.replace(/^\/+/, ""));
- }
-
- this.webAccessibleResources = new MatchGlobs(strippedWebAccessibleResources);
-
- let promises = [];
- for (let directive in manifest) {
- if (manifest[directive] !== null) {
- promises.push(Management.emit(`manifest_${directive}`, directive, this, manifest));
- }
- }
-
- let data = Services.ppmm.initialProcessData;
- if (!data["Extension:Extensions"]) {
- data["Extension:Extensions"] = [];
- }
- let serial = this.serialize();
- data["Extension:Extensions"].push(serial);
-
- return this.broadcast("Extension:Startup", serial).then(() => {
- return Promise.all(promises);
- });
- }
-
- callOnClose(obj) {
- this.onShutdown.add(obj);
- }
-
- forgetOnClose(obj) {
- this.onShutdown.delete(obj);
- }
-
- get builtinMessages() {
- return new Map([
- ["@@extension_id", this.uuid],
- ]);
- }
-
- // Reads the locale file for the given Gecko-compatible locale code, or if
- // no locale is given, the available locale closest to the UI locale.
- // Sets the currently selected locale on success.
- initLocale(locale = undefined) {
- // Ugh.
- let super_ = super.initLocale.bind(this);
-
- return Task.spawn(function* () {
- if (locale === undefined) {
- let locales = yield this.promiseLocales();
-
- let localeList = Array.from(locales.keys(), locale => {
- return {name: locale, locales: [locale]};
- });
-
- let match = Locale.findClosestLocale(localeList);
- locale = match ? match.name : this.defaultLocale;
- }
-
- return super_(locale);
- }.bind(this));
- }
-
- startup() {
- let started = false;
- return this.readManifest().then(() => {
- ExtensionManagement.startupExtension(this.uuid, this.addonData.resourceURI, this);
- started = true;
-
- if (!this.hasShutdown) {
- return this.initLocale();
- }
- }).then(() => {
- if (this.errors.length) {
- return Promise.reject({errors: this.errors});
- }
-
- if (this.hasShutdown) {
- return;
- }
-
- GlobalManager.init(this);
-
- // The "startup" Management event sent on the extension instance itself
- // is emitted just before the Management "startup" event,
- // and it is used to run code that needs to be executed before
- // any of the "startup" listeners.
- this.emit("startup", this);
- Management.emit("startup", this);
-
- return this.runManifest(this.manifest);
- }).then(() => {
- Management.emit("ready", this);
- }).catch(e => {
- dump(`Extension error: ${e.message} ${e.filename || e.fileName}:${e.lineNumber} :: ${e.stack || new Error().stack}\n`);
- Cu.reportError(e);
-
- if (started) {
- ExtensionManagement.shutdownExtension(this.uuid);
- }
-
- this.cleanupGeneratedFile();
-
- throw e;
- });
- }
-
- cleanupGeneratedFile() {
- if (!this.cleanupFile) {
- return;
- }
-
- let file = this.cleanupFile;
- this.cleanupFile = null;
-
- Services.obs.removeObserver(this, "xpcom-shutdown");
-
- this.broadcast("Extension:FlushJarCache", {path: file.path}).then(() => {
- // We can't delete this file until everyone using it has
- // closed it (because Windows is dumb). So we wait for all the
- // child processes (including the parent) to flush their JAR
- // caches. These caches may keep the file open.
- file.remove(false);
- });
- }
-
- shutdown() {
- this.hasShutdown = true;
-
- Services.ppmm.removeMessageListener(this.MESSAGE_EMIT_EVENT, this);
-
- if (!this.manifest) {
- ExtensionManagement.shutdownExtension(this.uuid);
-
- this.cleanupGeneratedFile();
- return;
- }
-
- GlobalManager.uninit(this);
-
- for (let obj of this.onShutdown) {
- obj.close();
- }
-
- for (let api of this.apis) {
- api.destroy();
- }
-
- ParentAPIManager.shutdownExtension(this.id);
-
- Management.emit("shutdown", this);
-
- Services.ppmm.broadcastAsyncMessage("Extension:Shutdown", {id: this.id});
-
- MessageChannel.abortResponses({extensionId: this.id});
-
- ExtensionManagement.shutdownExtension(this.uuid);
-
- this.cleanupGeneratedFile();
- }
-
- observe(subject, topic, data) {
- if (topic == "xpcom-shutdown") {
- this.cleanupGeneratedFile();
- }
- }
-
- hasPermission(perm) {
- let match = /^manifest:(.*)/.exec(perm);
- if (match) {
- return this.manifest[match[1]] != null;
- }
-
- return this.permissions.has(perm);
- }
-
- get name() {
- return this.manifest.name;
- }
-};
diff --git a/toolkit/components/webextensions/ExtensionAPI.jsm b/toolkit/components/webextensions/ExtensionAPI.jsm
deleted file mode 100644
index 54dab8e3b6..0000000000
--- a/toolkit/components/webextensions/ExtensionAPI.jsm
+++ /dev/null
@@ -1,81 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionAPI", "ExtensionAPIs"];
-
-/* exported ExtensionAPIs */
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
- "resource://devtools/shared/event-emitter.js");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-const global = this;
-
-class ExtensionAPI {
- constructor(extension) {
- this.extension = extension;
- }
-
- destroy() {
- }
-
- getAPI(context) {
- throw new Error("Not Implemented");
- }
-}
-
-var ExtensionAPIs = {
- apis: ExtensionManagement.APIs.apis,
-
- load(apiName) {
- let api = this.apis.get(apiName);
-
- if (api.loadPromise) {
- return api.loadPromise;
- }
-
- let {script, schema} = api;
-
- let addonId = `${apiName}@experiments.addons.mozilla.org`;
- api.sandbox = Cu.Sandbox(global, {
- wantXrays: false,
- sandboxName: script,
- addonId,
- metadata: {addonID: addonId},
- });
-
- api.sandbox.ExtensionAPI = ExtensionAPI;
-
- Services.scriptloader.loadSubScript(script, api.sandbox, "UTF-8");
-
- api.loadPromise = Schemas.load(schema).then(() => {
- return Cu.evalInSandbox("API", api.sandbox);
- });
-
- return api.loadPromise;
- },
-
- unload(apiName) {
- let api = this.apis.get(apiName);
-
- let {schema} = api;
-
- Schemas.unload(schema);
- Cu.nukeSandbox(api.sandbox);
-
- api.sandbox = null;
- api.loadPromise = null;
- },
-};
diff --git a/toolkit/components/webextensions/ExtensionChild.jsm b/toolkit/components/webextensions/ExtensionChild.jsm
deleted file mode 100644
index 5dc4e22779..0000000000
--- a/toolkit/components/webextensions/ExtensionChild.jsm
+++ /dev/null
@@ -1,1058 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionChild"];
-
-/*
- * This file handles addon logic that is independent of the chrome process.
- * When addons run out-of-process, this is the main entry point.
- * Its primary function is managing addon globals.
- *
- * Don't put contentscript logic here, use ExtensionContent.jsm instead.
- */
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
- "resource://gre/modules/MessageChannel.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NativeApp",
- "resource://gre/modules/NativeMessaging.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
- "resource://gre/modules/PromiseUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-
-const CATEGORY_EXTENSION_SCRIPTS_ADDON = "webextension-scripts-addon";
-
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-const {
- DefaultMap,
- EventManager,
- SingletonEventManager,
- SpreadArgs,
- defineLazyGetter,
- getInnerWindowID,
- getMessageManager,
- getUniqueId,
- injectAPI,
-} = ExtensionUtils;
-
-const {
- BaseContext,
- LocalAPIImplementation,
- SchemaAPIInterface,
- SchemaAPIManager,
-} = ExtensionCommon;
-
-var ExtensionChild;
-
-/**
- * Abstraction for a Port object in the extension API.
- *
- * @param {BaseContext} context The context that owns this port.
- * @param {nsIMessageSender} senderMM The message manager to send messages to.
- * @param {Array<nsIMessageListenerManager>} receiverMMs Message managers to
- * listen on.
- * @param {string} name Arbitrary port name as defined by the addon.
- * @param {string} id An ID that uniquely identifies this port's channel.
- * @param {object} sender The `port.sender` property.
- * @param {object} recipient The recipient of messages sent from this port.
- */
-class Port {
- constructor(context, senderMM, receiverMMs, name, id, sender, recipient) {
- this.context = context;
- this.senderMM = senderMM;
- this.receiverMMs = receiverMMs;
- this.name = name;
- this.id = id;
- this.sender = sender;
- this.recipient = recipient;
- this.disconnected = false;
- this.disconnectListeners = new Set();
- this.unregisterMessageFuncs = new Set();
-
- // Common options for onMessage and onDisconnect.
- this.handlerBase = {
- messageFilterStrict: {portId: id},
-
- filterMessage: (sender, recipient) => {
- return sender.contextId !== this.context.contextId;
- },
- };
-
- this.disconnectHandler = Object.assign({
- receiveMessage: ({data}) => this.disconnectByOtherEnd(data),
- }, this.handlerBase);
-
- MessageChannel.addListener(this.receiverMMs, "Extension:Port:Disconnect", this.disconnectHandler);
-
- this.context.callOnClose(this);
- }
-
- api() {
- let portObj = Cu.createObjectIn(this.context.cloneScope);
-
- let portError = null;
- let publicAPI = {
- name: this.name,
-
- disconnect: () => {
- this.disconnect();
- },
-
- postMessage: json => {
- this.postMessage(json);
- },
-
- onDisconnect: new EventManager(this.context, "Port.onDisconnect", fire => {
- return this.registerOnDisconnect(error => {
- portError = error && this.context.normalizeError(error);
- fire.withoutClone(portObj);
- });
- }).api(),
-
- onMessage: new EventManager(this.context, "Port.onMessage", fire => {
- return this.registerOnMessage(msg => {
- msg = Cu.cloneInto(msg, this.context.cloneScope);
- fire.withoutClone(msg, portObj);
- });
- }).api(),
-
- get error() {
- return portError;
- },
- };
-
- if (this.sender) {
- publicAPI.sender = this.sender;
- }
-
- injectAPI(publicAPI, portObj);
- return portObj;
- }
-
- postMessage(json) {
- if (this.disconnected) {
- throw new this.context.cloneScope.Error("Attempt to postMessage on disconnected port");
- }
-
- this._sendMessage("Extension:Port:PostMessage", json);
- }
-
- /**
- * Register a callback that is called when the port is disconnected by the
- * *other* end. The callback is automatically unregistered when the port or
- * context is closed.
- *
- * @param {function} callback Called when the other end disconnects the port.
- * If the disconnect is caused by an error, the first parameter is an
- * object with a "message" string property that describes the cause.
- * @returns {function} Function to unregister the listener.
- */
- registerOnDisconnect(callback) {
- let listener = error => {
- if (this.context.active && !this.disconnected) {
- callback(error);
- }
- };
- this.disconnectListeners.add(listener);
- return () => {
- this.disconnectListeners.delete(listener);
- };
- }
-
- /**
- * Register a callback that is called when a message is received. The callback
- * is automatically unregistered when the port or context is closed.
- *
- * @param {function} callback Called when a message is received.
- * @returns {function} Function to unregister the listener.
- */
- registerOnMessage(callback) {
- let handler = Object.assign({
- receiveMessage: ({data}) => {
- if (this.context.active && !this.disconnected) {
- callback(data);
- }
- },
- }, this.handlerBase);
-
- let unregister = () => {
- this.unregisterMessageFuncs.delete(unregister);
- MessageChannel.removeListener(this.receiverMMs, "Extension:Port:PostMessage", handler);
- };
- MessageChannel.addListener(this.receiverMMs, "Extension:Port:PostMessage", handler);
- this.unregisterMessageFuncs.add(unregister);
- return unregister;
- }
-
- _sendMessage(message, data) {
- let options = {
- recipient: Object.assign({}, this.recipient, {portId: this.id}),
- responseType: MessageChannel.RESPONSE_NONE,
- };
-
- return this.context.sendMessage(this.senderMM, message, data, options);
- }
-
- handleDisconnection() {
- MessageChannel.removeListener(this.receiverMMs, "Extension:Port:Disconnect", this.disconnectHandler);
- for (let unregister of this.unregisterMessageFuncs) {
- unregister();
- }
- this.context.forgetOnClose(this);
- this.disconnected = true;
- }
-
- /**
- * Disconnect the port from the other end (which may not even exist).
- *
- * @param {Error|{message: string}} [error] The reason for disconnecting,
- * if it is an abnormal disconnect.
- */
- disconnectByOtherEnd(error = null) {
- if (this.disconnected) {
- return;
- }
-
- for (let listener of this.disconnectListeners) {
- listener(error);
- }
-
- this.handleDisconnection();
- }
-
- /**
- * Disconnect the port from this end.
- *
- * @param {Error|{message: string}} [error] The reason for disconnecting,
- * if it is an abnormal disconnect.
- */
- disconnect(error = null) {
- if (this.disconnected) {
- // disconnect() may be called without side effects even after the port is
- // closed - https://developer.chrome.com/extensions/runtime#type-Port
- return;
- }
- this.handleDisconnection();
- if (error) {
- error = {message: this.context.normalizeError(error).message};
- }
- this._sendMessage("Extension:Port:Disconnect", error);
- }
-
- close() {
- this.disconnect();
- }
-}
-
-class NativePort extends Port {
- postMessage(data) {
- data = NativeApp.encodeMessage(this.context, data);
-
- return super.postMessage(data);
- }
-}
-
-/**
- * Each extension context gets its own Messenger object. It handles the
- * basics of sendMessage, onMessage, connect and onConnect.
- *
- * @param {BaseContext} context The context to which this Messenger is tied.
- * @param {Array<nsIMessageListenerManager>} messageManagers
- * The message managers used to receive messages (e.g. onMessage/onConnect
- * requests).
- * @param {object} sender Describes this sender to the recipient. This object
- * is extended further by BaseContext's sendMessage method and appears as
- * the `sender` object to `onConnect` and `onMessage`.
- * Do not set the `extensionId`, `contextId` or `tab` properties. The former
- * two are added by BaseContext's sendMessage, while `sender.tab` is set by
- * the ProxyMessenger in the main process.
- * @param {object} filter A recipient filter to apply to incoming messages from
- * the broker. Messages are only handled by this Messenger if all key-value
- * pairs match the `recipient` as specified by the sender of the message.
- * In other words, this filter defines the required fields of `recipient`.
- * @param {object} [optionalFilter] An additional filter to apply to incoming
- * messages. Unlike `filter`, the keys from `optionalFilter` are allowed to
- * be omitted from `recipient`. Only keys that are present in both
- * `optionalFilter` and `recipient` are applied to filter incoming messages.
- */
-class Messenger {
- constructor(context, messageManagers, sender, filter, optionalFilter) {
- this.context = context;
- this.messageManagers = messageManagers;
- this.sender = sender;
- this.filter = filter;
- this.optionalFilter = optionalFilter;
- }
-
- _sendMessage(messageManager, message, data, recipient) {
- let options = {
- recipient,
- sender: this.sender,
- responseType: MessageChannel.RESPONSE_FIRST,
- };
-
- return this.context.sendMessage(messageManager, message, data, options);
- }
-
- sendMessage(messageManager, msg, recipient, responseCallback) {
- let promise = this._sendMessage(messageManager, "Extension:Message", msg, recipient)
- .catch(error => {
- if (error.result == MessageChannel.RESULT_NO_HANDLER) {
- return Promise.reject({message: "Could not establish connection. Receiving end does not exist."});
- } else if (error.result != MessageChannel.RESULT_NO_RESPONSE) {
- return Promise.reject({message: error.message});
- }
- });
-
- return this.context.wrapPromise(promise, responseCallback);
- }
-
- sendNativeMessage(messageManager, msg, recipient, responseCallback) {
- msg = NativeApp.encodeMessage(this.context, msg);
- return this.sendMessage(messageManager, msg, recipient, responseCallback);
- }
-
- _onMessage(name, filter) {
- return new SingletonEventManager(this.context, name, callback => {
- let listener = {
- messageFilterPermissive: this.optionalFilter,
- messageFilterStrict: this.filter,
-
- filterMessage: (sender, recipient) => {
- // Ignore the message if it was sent by this Messenger.
- return (sender.contextId !== this.context.contextId &&
- filter(sender, recipient));
- },
-
- receiveMessage: ({target, data: message, sender, recipient}) => {
- if (!this.context.active) {
- return;
- }
-
- let sendResponse;
- let response = undefined;
- let promise = new Promise(resolve => {
- sendResponse = value => {
- resolve(value);
- response = promise;
- };
- });
-
- message = Cu.cloneInto(message, this.context.cloneScope);
- sender = Cu.cloneInto(sender, this.context.cloneScope);
- sendResponse = Cu.exportFunction(sendResponse, this.context.cloneScope);
-
- // Note: We intentionally do not use runSafe here so that any
- // errors are propagated to the message sender.
- let result = callback(message, sender, sendResponse);
- if (result instanceof this.context.cloneScope.Promise) {
- return result;
- } else if (result === true) {
- return promise;
- }
- return response;
- },
- };
-
- MessageChannel.addListener(this.messageManagers, "Extension:Message", listener);
- return () => {
- MessageChannel.removeListener(this.messageManagers, "Extension:Message", listener);
- };
- }).api();
- }
-
- onMessage(name) {
- return this._onMessage(name, sender => sender.id === this.sender.id);
- }
-
- onMessageExternal(name) {
- return this._onMessage(name, sender => sender.id !== this.sender.id);
- }
-
- _connect(messageManager, port, recipient) {
- let msg = {
- name: port.name,
- portId: port.id,
- };
-
- this._sendMessage(messageManager, "Extension:Connect", msg, recipient).catch(error => {
- if (error.result === MessageChannel.RESULT_NO_HANDLER) {
- error = {message: "Could not establish connection. Receiving end does not exist."};
- } else if (error.result === MessageChannel.RESULT_DISCONNECTED) {
- error = null;
- }
- port.disconnectByOtherEnd(error);
- });
-
- return port.api();
- }
-
- connect(messageManager, name, recipient) {
- let portId = getUniqueId();
-
- let port = new Port(this.context, messageManager, this.messageManagers, name, portId, null, recipient);
-
- return this._connect(messageManager, port, recipient);
- }
-
- connectNative(messageManager, name, recipient) {
- let portId = getUniqueId();
-
- let port = new NativePort(this.context, messageManager, this.messageManagers, name, portId, null, recipient);
-
- return this._connect(messageManager, port, recipient);
- }
-
- _onConnect(name, filter) {
- return new SingletonEventManager(this.context, name, callback => {
- let listener = {
- messageFilterPermissive: this.optionalFilter,
- messageFilterStrict: this.filter,
-
- filterMessage: (sender, recipient) => {
- // Ignore the port if it was created by this Messenger.
- return (sender.contextId !== this.context.contextId &&
- filter(sender, recipient));
- },
-
- receiveMessage: ({target, data: message, sender}) => {
- let {name, portId} = message;
- let mm = getMessageManager(target);
- let recipient = Object.assign({}, sender);
- if (recipient.tab) {
- recipient.tabId = recipient.tab.id;
- delete recipient.tab;
- }
- let port = new Port(this.context, mm, this.messageManagers, name, portId, sender, recipient);
- this.context.runSafeWithoutClone(callback, port.api());
- return true;
- },
- };
-
- MessageChannel.addListener(this.messageManagers, "Extension:Connect", listener);
- return () => {
- MessageChannel.removeListener(this.messageManagers, "Extension:Connect", listener);
- };
- }).api();
- }
-
- onConnect(name) {
- return this._onConnect(name, sender => sender.id === this.sender.id);
- }
-
- onConnectExternal(name) {
- return this._onConnect(name, sender => sender.id !== this.sender.id);
- }
-}
-
-var apiManager = new class extends SchemaAPIManager {
- constructor() {
- super("addon");
- this.initialized = false;
- }
-
- generateAPIs(...args) {
- if (!this.initialized) {
- this.initialized = true;
- for (let [/* name */, value] of XPCOMUtils.enumerateCategoryEntries(CATEGORY_EXTENSION_SCRIPTS_ADDON)) {
- this.loadScript(value);
- }
- }
- return super.generateAPIs(...args);
- }
-
- registerSchemaAPI(namespace, envType, getAPI) {
- if (envType == "addon_child") {
- super.registerSchemaAPI(namespace, envType, getAPI);
- }
- }
-}();
-
-/**
- * An object that runs an remote implementation of an API.
- */
-class ProxyAPIImplementation extends SchemaAPIInterface {
- /**
- * @param {string} namespace The full path to the namespace that contains the
- * `name` member. This may contain dots, e.g. "storage.local".
- * @param {string} name The name of the method or property.
- * @param {ChildAPIManager} childApiManager The owner of this implementation.
- */
- constructor(namespace, name, childApiManager) {
- super();
- this.path = `${namespace}.${name}`;
- this.childApiManager = childApiManager;
- }
-
- callFunctionNoReturn(args) {
- this.childApiManager.callParentFunctionNoReturn(this.path, args);
- }
-
- callAsyncFunction(args, callback) {
- return this.childApiManager.callParentAsyncFunction(this.path, args, callback);
- }
-
- addListener(listener, args) {
- let map = this.childApiManager.listeners.get(this.path);
-
- if (map.listeners.has(listener)) {
- // TODO: Called with different args?
- return;
- }
-
- let id = getUniqueId();
-
- map.ids.set(id, listener);
- map.listeners.set(listener, id);
-
- this.childApiManager.messageManager.sendAsyncMessage("API:AddListener", {
- childId: this.childApiManager.id,
- listenerId: id,
- path: this.path,
- args,
- });
- }
-
- removeListener(listener) {
- let map = this.childApiManager.listeners.get(this.path);
-
- if (!map.listeners.has(listener)) {
- return;
- }
-
- let id = map.listeners.get(listener);
- map.listeners.delete(listener);
- map.ids.delete(id);
-
- this.childApiManager.messageManager.sendAsyncMessage("API:RemoveListener", {
- childId: this.childApiManager.id,
- listenerId: id,
- path: this.path,
- });
- }
-
- hasListener(listener) {
- let map = this.childApiManager.listeners.get(this.path);
- return map.listeners.has(listener);
- }
-}
-
-// We create one instance of this class for every extension context that
-// needs to use remote APIs. It uses the message manager to communicate
-// with the ParentAPIManager singleton in ExtensionParent.jsm. It
-// handles asynchronous function calls as well as event listeners.
-class ChildAPIManager {
- constructor(context, messageManager, localApis, contextData) {
- this.context = context;
- this.messageManager = messageManager;
- this.url = contextData.url;
-
- // The root namespace of all locally implemented APIs. If an extension calls
- // an API that does not exist in this object, then the implementation is
- // delegated to the ParentAPIManager.
- this.localApis = localApis;
-
- this.id = `${context.extension.id}.${context.contextId}`;
-
- MessageChannel.addListener(messageManager, "API:RunListener", this);
- messageManager.addMessageListener("API:CallResult", this);
-
- this.messageFilterStrict = {childId: this.id};
-
- this.listeners = new DefaultMap(() => ({
- ids: new Map(),
- listeners: new Map(),
- }));
-
- // Map[callId -> Deferred]
- this.callPromises = new Map();
-
- let params = {
- childId: this.id,
- extensionId: context.extension.id,
- principal: context.principal,
- };
- Object.assign(params, contextData);
-
- this.messageManager.sendAsyncMessage("API:CreateProxyContext", params);
- }
-
- receiveMessage({name, messageName, data}) {
- if (data.childId != this.id) {
- return;
- }
-
- switch (name || messageName) {
- case "API:RunListener":
- let map = this.listeners.get(data.path);
- let listener = map.ids.get(data.listenerId);
-
- if (listener) {
- return this.context.runSafe(listener, ...data.args);
- }
-
- Cu.reportError(`Unknown listener at childId=${data.childId} path=${data.path} listenerId=${data.listenerId}\n`);
- break;
-
- case "API:CallResult":
- let deferred = this.callPromises.get(data.callId);
- if ("error" in data) {
- deferred.reject(data.error);
- } else {
- deferred.resolve(new SpreadArgs(data.result));
- }
- this.callPromises.delete(data.callId);
- break;
- }
- }
-
- /**
- * Call a function in the parent process and ignores its return value.
- *
- * @param {string} path The full name of the method, e.g. "tabs.create".
- * @param {Array} args The parameters for the function.
- */
- callParentFunctionNoReturn(path, args) {
- this.messageManager.sendAsyncMessage("API:Call", {
- childId: this.id,
- path,
- args,
- });
- }
-
- /**
- * Calls a function in the parent process and returns its result
- * asynchronously.
- *
- * @param {string} path The full name of the method, e.g. "tabs.create".
- * @param {Array} args The parameters for the function.
- * @param {function(*)} [callback] The callback to be called when the function
- * completes.
- * @returns {Promise|undefined} Must be void if `callback` is set, and a
- * promise otherwise. The promise is resolved when the function completes.
- */
- callParentAsyncFunction(path, args, callback) {
- let callId = getUniqueId();
- let deferred = PromiseUtils.defer();
- this.callPromises.set(callId, deferred);
-
- this.messageManager.sendAsyncMessage("API:Call", {
- childId: this.id,
- callId,
- path,
- args,
- });
-
- return this.context.wrapPromise(deferred.promise, callback);
- }
-
- /**
- * Create a proxy for an event in the parent process. The returned event
- * object shares its internal state with other instances. For instance, if
- * `removeListener` is used on a listener that was added on another object
- * through `addListener`, then the event is unregistered.
- *
- * @param {string} path The full name of the event, e.g. "tabs.onCreated".
- * @returns {object} An object with the addListener, removeListener and
- * hasListener methods. See SchemaAPIInterface for documentation.
- */
- getParentEvent(path) {
- path = path.split(".");
-
- let name = path.pop();
- let namespace = path.join(".");
-
- let impl = new ProxyAPIImplementation(namespace, name, this);
- return {
- addListener: (listener, ...args) => impl.addListener(listener, args),
- removeListener: (listener) => impl.removeListener(listener),
- hasListener: (listener) => impl.hasListener(listener),
- };
- }
-
- close() {
- this.messageManager.sendAsyncMessage("API:CloseProxyContext", {childId: this.id});
- }
-
- get cloneScope() {
- return this.context.cloneScope;
- }
-
- get principal() {
- return this.context.principal;
- }
-
- shouldInject(namespace, name, allowedContexts) {
- // Do not generate content script APIs, unless explicitly allowed.
- if (this.context.envType === "content_child" &&
- !allowedContexts.includes("content")) {
- return false;
- }
- if (allowedContexts.includes("addon_parent_only")) {
- return false;
- }
- return true;
- }
-
- getImplementation(namespace, name) {
- let obj = namespace.split(".").reduce(
- (object, prop) => object && object[prop],
- this.localApis);
-
- if (obj && name in obj) {
- return new LocalAPIImplementation(obj, name, this.context);
- }
-
- return this.getFallbackImplementation(namespace, name);
- }
-
- getFallbackImplementation(namespace, name) {
- // No local API found, defer implementation to the parent.
- return new ProxyAPIImplementation(namespace, name, this);
- }
-
- hasPermission(permission) {
- return this.context.extension.hasPermission(permission);
- }
-}
-
-class ExtensionPageContextChild extends BaseContext {
- /**
- * This ExtensionPageContextChild represents a privileged addon
- * execution environment that has full access to the WebExtensions
- * APIs (provided that the correct permissions have been requested).
- *
- * This is the child side of the ExtensionPageContextParent class
- * defined in ExtensionParent.jsm.
- *
- * @param {BrowserExtensionContent} extension This context's owner.
- * @param {object} params
- * @param {nsIDOMWindow} params.contentWindow The window where the addon runs.
- * @param {string} params.viewType One of "background", "popup" or "tab".
- * "background" and "tab" are used by `browser.extension.getViews`.
- * "popup" is only used internally to identify page action and browser
- * action popups and options_ui pages.
- * @param {number} [params.tabId] This tab's ID, used if viewType is "tab".
- */
- constructor(extension, params) {
- super("addon_child", extension);
- if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_DEFAULT) {
- // This check is temporary. It should be removed once the proxy creation
- // is asynchronous.
- throw new Error("ExtensionPageContextChild cannot be created in child processes");
- }
-
- let {viewType, uri, contentWindow, tabId} = params;
- this.viewType = viewType;
- this.uri = uri || extension.baseURI;
-
- this.setContentWindow(contentWindow);
-
- // This is the MessageSender property passed to extension.
- // It can be augmented by the "page-open" hook.
- let sender = {id: extension.id};
- if (viewType == "tab") {
- sender.tabId = tabId;
- this.tabId = tabId;
- }
- if (uri) {
- sender.url = uri.spec;
- }
- this.sender = sender;
-
- Schemas.exportLazyGetter(contentWindow, "browser", () => {
- let browserObj = Cu.createObjectIn(contentWindow);
- Schemas.inject(browserObj, this.childManager);
- return browserObj;
- });
-
- Schemas.exportLazyGetter(contentWindow, "chrome", () => {
- let chromeApiWrapper = Object.create(this.childManager);
- chromeApiWrapper.isChromeCompat = true;
-
- let chromeObj = Cu.createObjectIn(contentWindow);
- Schemas.inject(chromeObj, chromeApiWrapper);
- return chromeObj;
- });
-
- this.extension.views.add(this);
- }
-
- get cloneScope() {
- return this.contentWindow;
- }
-
- get principal() {
- return this.contentWindow.document.nodePrincipal;
- }
-
- get windowId() {
- if (this.viewType == "tab" || this.viewType == "popup") {
- let globalView = ExtensionChild.contentGlobals.get(this.messageManager);
- return globalView ? globalView.windowId : -1;
- }
- }
-
- // Called when the extension shuts down.
- shutdown() {
- this.unload();
- }
-
- // This method is called when an extension page navigates away or
- // its tab is closed.
- unload() {
- // Note that without this guard, we end up running unload code
- // multiple times for tab pages closed by the "page-unload" handlers
- // triggered below.
- if (this.unloaded) {
- return;
- }
-
- if (this.contentWindow) {
- this.contentWindow.close();
- }
-
- super.unload();
- this.extension.views.delete(this);
- }
-}
-
-defineLazyGetter(ExtensionPageContextChild.prototype, "messenger", function() {
- let filter = {extensionId: this.extension.id};
- let optionalFilter = {};
- // Addon-generated messages (not necessarily from the same process as the
- // addon itself) are sent to the main process, which forwards them via the
- // parent process message manager. Specific replies can be sent to the frame
- // message manager.
- return new Messenger(this, [Services.cpmm, this.messageManager], this.sender,
- filter, optionalFilter);
-});
-
-defineLazyGetter(ExtensionPageContextChild.prototype, "childManager", function() {
- let localApis = {};
- apiManager.generateAPIs(this, localApis);
-
- if (this.viewType == "background") {
- apiManager.global.initializeBackgroundPage(this.contentWindow);
- }
-
- let childManager = new ChildAPIManager(this, this.messageManager, localApis, {
- envType: "addon_parent",
- viewType: this.viewType,
- url: this.uri.spec,
- incognito: this.incognito,
- });
-
- this.callOnClose(childManager);
-
- return childManager;
-});
-
-// All subframes in a tab, background page, popup, etc. have the same view type.
-// This class keeps track of such global state.
-// Note that this is created even for non-extension tabs because at present we
-// do not have a way to distinguish regular tabs from extension tabs at the
-// initialization of a frame script.
-class ContentGlobal {
- /**
- * @param {nsIContentFrameMessageManager} global The frame script's global.
- */
- constructor(global) {
- this.global = global;
- // Unless specified otherwise assume that the extension page is in a tab,
- // because the majority of all class instances are going to be a tab. Any
- // special views (background page, extension popup) will immediately send an
- // Extension:InitExtensionView message to change the viewType.
- this.viewType = "tab";
- this.tabId = -1;
- this.windowId = -1;
- this.initialized = false;
- this.global.addMessageListener("Extension:InitExtensionView", this);
- this.global.addMessageListener("Extension:SetTabAndWindowId", this);
-
- this.initialDocuments = new WeakSet();
- }
-
- uninit() {
- this.global.removeMessageListener("Extension:InitExtensionView", this);
- this.global.removeMessageListener("Extension:SetTabAndWindowId", this);
- this.global.removeEventListener("DOMContentLoaded", this);
- }
-
- ensureInitialized() {
- if (!this.initialized) {
- // Request tab and window ID in case "Extension:InitExtensionView" is not
- // sent (e.g. when `viewType` is "tab").
- let reply = this.global.sendSyncMessage("Extension:GetTabAndWindowId");
- this.handleSetTabAndWindowId(reply[0] || {});
- }
- return this;
- }
-
- receiveMessage({name, data}) {
- switch (name) {
- case "Extension:InitExtensionView":
- // The view type is initialized once and then fixed.
- this.global.removeMessageListener("Extension:InitExtensionView", this);
- let {viewType, url} = data;
- this.viewType = viewType;
- this.global.addEventListener("DOMContentLoaded", this);
- if (url) {
- // TODO(robwu): Remove this check. It is only here because the popup
- // implementation does not always load a URL at the initialization,
- // and the logic is too complex to fix at once.
- let {document} = this.global.content;
- this.initialDocuments.add(document);
- document.location.replace(url);
- }
- /* Falls through to allow these properties to be initialized at once */
- case "Extension:SetTabAndWindowId":
- this.handleSetTabAndWindowId(data);
- break;
- }
- }
-
- handleSetTabAndWindowId(data) {
- let {tabId, windowId} = data;
- if (tabId) {
- // Tab IDs are not expected to change.
- if (this.tabId !== -1 && tabId !== this.tabId) {
- throw new Error("Attempted to change a tabId after it was set");
- }
- this.tabId = tabId;
- }
- if (windowId !== undefined) {
- // Window IDs may change if a tab is moved to a different location.
- // Note: This is the ID of the browser window for the extension API.
- // Do not confuse it with the innerWindowID of DOMWindows!
- this.windowId = windowId;
- }
- this.initialized = true;
- }
-
- // "DOMContentLoaded" event.
- handleEvent(event) {
- let {document} = this.global.content;
- if (event.target === document) {
- // If the document was still being loaded at the time of navigation, then
- // the DOMContentLoaded event is fired for the old document. Ignore it.
- if (this.initialDocuments.has(document)) {
- this.initialDocuments.delete(document);
- return;
- }
- this.global.removeEventListener("DOMContentLoaded", this);
- this.global.sendAsyncMessage("Extension:ExtensionViewLoaded");
- }
- }
-}
-
-ExtensionChild = {
- // Map<nsIContentFrameMessageManager, ContentGlobal>
- contentGlobals: new Map(),
-
- // Map<innerWindowId, ExtensionPageContextChild>
- extensionContexts: new Map(),
-
- initOnce() {
- // This initializes the default message handler for messages targeted at
- // an addon process, in case the addon process receives a message before
- // its Messenger has been instantiated. For example, if a content script
- // sends a message while there is no background page.
- MessageChannel.setupMessageManagers([Services.cpmm]);
- },
-
- init(global) {
- this.contentGlobals.set(global, new ContentGlobal(global));
- },
-
- uninit(global) {
- this.contentGlobals.get(global).uninit();
- this.contentGlobals.delete(global);
- },
-
- /**
- * Create a privileged context at document-element-inserted.
- *
- * @param {BrowserExtensionContent} extension
- * The extension for which the context should be created.
- * @param {nsIDOMWindow} contentWindow The global of the page.
- */
- createExtensionContext(extension, contentWindow) {
- let windowId = getInnerWindowID(contentWindow);
- let context = this.extensionContexts.get(windowId);
- if (context) {
- if (context.extension !== extension) {
- // Oops. This should never happen.
- Cu.reportError("A different extension context already exists in this frame!");
- } else {
- // This should not happen either.
- Cu.reportError("The extension context was already initialized in this frame.");
- }
- return;
- }
-
- let mm = contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIContentFrameMessageManager);
- let {viewType, tabId} = this.contentGlobals.get(mm).ensureInitialized();
-
- let uri = contentWindow.document.documentURIObject;
-
- context = new ExtensionPageContextChild(extension, {viewType, contentWindow, uri, tabId});
- this.extensionContexts.set(windowId, context);
- },
-
- /**
- * Close the ExtensionPageContextChild belonging to the given window, if any.
- *
- * @param {number} windowId The inner window ID of the destroyed context.
- */
- destroyExtensionContext(windowId) {
- let context = this.extensionContexts.get(windowId);
- if (context) {
- context.unload();
- this.extensionContexts.delete(windowId);
- }
- },
-
- shutdownExtension(extensionId) {
- for (let [windowId, context] of this.extensionContexts) {
- if (context.extension.id == extensionId) {
- context.shutdown();
- this.extensionContexts.delete(windowId);
- }
- }
- },
-};
-
-// TODO(robwu): Change this condition when addons move to a separate process.
-if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_DEFAULT) {
- Object.keys(ExtensionChild).forEach(function(key) {
- if (typeof ExtensionChild[key] == "function") {
- // :/
- ExtensionChild[key] = () => {};
- }
- });
-}
-
-Object.assign(ExtensionChild, {
- ChildAPIManager,
- Messenger,
- Port,
-});
-
diff --git a/toolkit/components/webextensions/ExtensionCommon.jsm b/toolkit/components/webextensions/ExtensionCommon.jsm
deleted file mode 100644
index 9ec84b5c76..0000000000
--- a/toolkit/components/webextensions/ExtensionCommon.jsm
+++ /dev/null
@@ -1,679 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-/**
- * This module contains utilities and base classes for logic which is
- * common between the parent and child process, and in particular
- * between ExtensionParent.jsm and ExtensionChild.jsm.
- */
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-/* exported ExtensionCommon */
-
-this.EXPORTED_SYMBOLS = ["ExtensionCommon"];
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
- "resource://gre/modules/MessageChannel.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-var {
- EventEmitter,
- ExtensionError,
- SpreadArgs,
- getConsole,
- getInnerWindowID,
- getUniqueId,
- runSafeSync,
- runSafeSyncWithoutClone,
- instanceOf,
-} = ExtensionUtils;
-
-XPCOMUtils.defineLazyGetter(this, "console", getConsole);
-
-class BaseContext {
- constructor(envType, extension) {
- this.envType = envType;
- this.onClose = new Set();
- this.checkedLastError = false;
- this._lastError = null;
- this.contextId = getUniqueId();
- this.unloaded = false;
- this.extension = extension;
- this.jsonSandbox = null;
- this.active = true;
- this.incognito = null;
- this.messageManager = null;
- this.docShell = null;
- this.contentWindow = null;
- this.innerWindowID = 0;
- }
-
- setContentWindow(contentWindow) {
- let {document} = contentWindow;
- let docShell = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell);
-
- this.innerWindowID = getInnerWindowID(contentWindow);
- this.messageManager = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIContentFrameMessageManager);
-
- if (this.incognito == null) {
- this.incognito = PrivateBrowsingUtils.isContentWindowPrivate(contentWindow);
- }
-
- MessageChannel.setupMessageManagers([this.messageManager]);
-
- let onPageShow = event => {
- if (!event || event.target === document) {
- this.docShell = docShell;
- this.contentWindow = contentWindow;
- this.active = true;
- }
- };
- let onPageHide = event => {
- if (!event || event.target === document) {
- // Put this off until the next tick.
- Promise.resolve().then(() => {
- this.docShell = null;
- this.contentWindow = null;
- this.active = false;
- });
- }
- };
-
- onPageShow();
- contentWindow.addEventListener("pagehide", onPageHide, true);
- contentWindow.addEventListener("pageshow", onPageShow, true);
- this.callOnClose({
- close: () => {
- onPageHide();
- if (this.active) {
- contentWindow.removeEventListener("pagehide", onPageHide, true);
- contentWindow.removeEventListener("pageshow", onPageShow, true);
- }
- },
- });
- }
-
- get cloneScope() {
- throw new Error("Not implemented");
- }
-
- get principal() {
- throw new Error("Not implemented");
- }
-
- runSafe(...args) {
- if (this.unloaded) {
- Cu.reportError("context.runSafe called after context unloaded");
- } else if (!this.active) {
- Cu.reportError("context.runSafe called while context is inactive");
- } else {
- return runSafeSync(this, ...args);
- }
- }
-
- runSafeWithoutClone(...args) {
- if (this.unloaded) {
- Cu.reportError("context.runSafeWithoutClone called after context unloaded");
- } else if (!this.active) {
- Cu.reportError("context.runSafeWithoutClone called while context is inactive");
- } else {
- return runSafeSyncWithoutClone(...args);
- }
- }
-
- checkLoadURL(url, options = {}) {
- let ssm = Services.scriptSecurityManager;
-
- let flags = ssm.STANDARD;
- if (!options.allowScript) {
- flags |= ssm.DISALLOW_SCRIPT;
- }
- if (!options.allowInheritsPrincipal) {
- flags |= ssm.DISALLOW_INHERIT_PRINCIPAL;
- }
- if (options.dontReportErrors) {
- flags |= ssm.DONT_REPORT_ERRORS;
- }
-
- try {
- ssm.checkLoadURIStrWithPrincipal(this.principal, url, flags);
- } catch (e) {
- return false;
- }
- return true;
- }
-
- /**
- * Safely call JSON.stringify() on an object that comes from an
- * extension.
- *
- * @param {array<any>} args Arguments for JSON.stringify()
- * @returns {string} The stringified representation of obj
- */
- jsonStringify(...args) {
- if (!this.jsonSandbox) {
- this.jsonSandbox = Cu.Sandbox(this.principal, {
- sameZoneAs: this.cloneScope,
- wantXrays: false,
- });
- }
-
- return Cu.waiveXrays(this.jsonSandbox.JSON).stringify(...args);
- }
-
- callOnClose(obj) {
- this.onClose.add(obj);
- }
-
- forgetOnClose(obj) {
- this.onClose.delete(obj);
- }
-
- /**
- * A wrapper around MessageChannel.sendMessage which adds the extension ID
- * to the recipient object, and ensures replies are not processed after the
- * context has been unloaded.
- *
- * @param {nsIMessageManager} target
- * @param {string} messageName
- * @param {object} data
- * @param {object} [options]
- * @param {object} [options.sender]
- * @param {object} [options.recipient]
- *
- * @returns {Promise}
- */
- sendMessage(target, messageName, data, options = {}) {
- options.recipient = Object.assign({extensionId: this.extension.id}, options.recipient);
- options.sender = options.sender || {};
-
- options.sender.extensionId = this.extension.id;
- options.sender.contextId = this.contextId;
-
- return MessageChannel.sendMessage(target, messageName, data, options);
- }
-
- get lastError() {
- this.checkedLastError = true;
- return this._lastError;
- }
-
- set lastError(val) {
- this.checkedLastError = false;
- this._lastError = val;
- }
-
- /**
- * Normalizes the given error object for use by the target scope. If
- * the target is an error object which belongs to that scope, it is
- * returned as-is. If it is an ordinary object with a `message`
- * property, it is converted into an error belonging to the target
- * scope. If it is an Error object which does *not* belong to the
- * clone scope, it is reported, and converted to an unexpected
- * exception error.
- *
- * @param {Error|object} error
- * @returns {Error}
- */
- normalizeError(error) {
- if (error instanceof this.cloneScope.Error) {
- return error;
- }
- let message;
- if (instanceOf(error, "Object") || error instanceof ExtensionError) {
- message = error.message;
- } else if (typeof error == "object" &&
- this.principal.subsumes(Cu.getObjectPrincipal(error))) {
- message = error.message;
- } else {
- Cu.reportError(error);
- }
- message = message || "An unexpected error occurred";
- return new this.cloneScope.Error(message);
- }
-
- /**
- * Sets the value of `.lastError` to `error`, calls the given
- * callback, and reports an error if the value has not been checked
- * when the callback returns.
- *
- * @param {object} error An object with a `message` property. May
- * optionally be an `Error` object belonging to the target scope.
- * @param {function} callback The callback to call.
- * @returns {*} The return value of callback.
- */
- withLastError(error, callback) {
- this.lastError = this.normalizeError(error);
- try {
- return callback();
- } finally {
- if (!this.checkedLastError) {
- Cu.reportError(`Unchecked lastError value: ${this.lastError}`);
- }
- this.lastError = null;
- }
- }
-
- /**
- * Wraps the given promise so it can be safely returned to extension
- * code in this context.
- *
- * If `callback` is provided, however, it is used as a completion
- * function for the promise, and no promise is returned. In this case,
- * the callback is called when the promise resolves or rejects. In the
- * latter case, `lastError` is set to the rejection value, and the
- * callback function must check `browser.runtime.lastError` or
- * `extension.runtime.lastError` in order to prevent it being reported
- * to the console.
- *
- * @param {Promise} promise The promise with which to wrap the
- * callback. May resolve to a `SpreadArgs` instance, in which case
- * each element will be used as a separate argument.
- *
- * Unless the promise object belongs to the cloneScope global, its
- * resolution value is cloned into cloneScope prior to calling the
- * `callback` function or resolving the wrapped promise.
- *
- * @param {function} [callback] The callback function to wrap
- *
- * @returns {Promise|undefined} If callback is null, a promise object
- * belonging to the target scope. Otherwise, undefined.
- */
- wrapPromise(promise, callback = null) {
- let runSafe = this.runSafe.bind(this);
- if (promise instanceof this.cloneScope.Promise) {
- runSafe = this.runSafeWithoutClone.bind(this);
- }
-
- if (callback) {
- promise.then(
- args => {
- if (this.unloaded) {
- dump(`Promise resolved after context unloaded\n`);
- } else if (!this.active) {
- dump(`Promise resolved while context is inactive\n`);
- } else if (args instanceof SpreadArgs) {
- runSafe(callback, ...args);
- } else {
- runSafe(callback, args);
- }
- },
- error => {
- this.withLastError(error, () => {
- if (this.unloaded) {
- dump(`Promise rejected after context unloaded\n`);
- } else if (!this.active) {
- dump(`Promise rejected while context is inactive\n`);
- } else {
- this.runSafeWithoutClone(callback);
- }
- });
- });
- } else {
- return new this.cloneScope.Promise((resolve, reject) => {
- promise.then(
- value => {
- if (this.unloaded) {
- dump(`Promise resolved after context unloaded\n`);
- } else if (!this.active) {
- dump(`Promise resolved while context is inactive\n`);
- } else if (value instanceof SpreadArgs) {
- runSafe(resolve, value.length == 1 ? value[0] : value);
- } else {
- runSafe(resolve, value);
- }
- },
- value => {
- if (this.unloaded) {
- dump(`Promise rejected after context unloaded: ${value && value.message}\n`);
- } else if (!this.active) {
- dump(`Promise rejected while context is inactive: ${value && value.message}\n`);
- } else {
- this.runSafeWithoutClone(reject, this.normalizeError(value));
- }
- });
- });
- }
- }
-
- unload() {
- this.unloaded = true;
-
- MessageChannel.abortResponses({
- extensionId: this.extension.id,
- contextId: this.contextId,
- });
-
- for (let obj of this.onClose) {
- obj.close();
- }
- }
-
- /**
- * A simple proxy for unload(), for use with callOnClose().
- */
- close() {
- this.unload();
- }
-}
-
-/**
- * An object that runs the implementation of a schema API. Instantiations of
- * this interfaces are used by Schemas.jsm.
- *
- * @interface
- */
-class SchemaAPIInterface {
- /**
- * Calls this as a function that returns its return value.
- *
- * @abstract
- * @param {Array} args The parameters for the function.
- * @returns {*} The return value of the invoked function.
- */
- callFunction(args) {
- throw new Error("Not implemented");
- }
-
- /**
- * Calls this as a function and ignores its return value.
- *
- * @abstract
- * @param {Array} args The parameters for the function.
- */
- callFunctionNoReturn(args) {
- throw new Error("Not implemented");
- }
-
- /**
- * Calls this as a function that completes asynchronously.
- *
- * @abstract
- * @param {Array} args The parameters for the function.
- * @param {function(*)} [callback] The callback to be called when the function
- * completes.
- * @returns {Promise|undefined} Must be void if `callback` is set, and a
- * promise otherwise. The promise is resolved when the function completes.
- */
- callAsyncFunction(args, callback) {
- throw new Error("Not implemented");
- }
-
- /**
- * Retrieves the value of this as a property.
- *
- * @abstract
- * @returns {*} The value of the property.
- */
- getProperty() {
- throw new Error("Not implemented");
- }
-
- /**
- * Assigns the value to this as property.
- *
- * @abstract
- * @param {string} value The new value of the property.
- */
- setProperty(value) {
- throw new Error("Not implemented");
- }
-
- /**
- * Registers a `listener` to this as an event.
- *
- * @abstract
- * @param {function} listener The callback to be called when the event fires.
- * @param {Array} args Extra parameters for EventManager.addListener.
- * @see EventManager.addListener
- */
- addListener(listener, args) {
- throw new Error("Not implemented");
- }
-
- /**
- * Checks whether `listener` is listening to this as an event.
- *
- * @abstract
- * @param {function} listener The event listener.
- * @returns {boolean} Whether `listener` is registered with this as an event.
- * @see EventManager.hasListener
- */
- hasListener(listener) {
- throw new Error("Not implemented");
- }
-
- /**
- * Unregisters `listener` from this as an event.
- *
- * @abstract
- * @param {function} listener The event listener.
- * @see EventManager.removeListener
- */
- removeListener(listener) {
- throw new Error("Not implemented");
- }
-}
-
-/**
- * An object that runs a locally implemented API.
- */
-class LocalAPIImplementation extends SchemaAPIInterface {
- /**
- * Constructs an implementation of the `name` method or property of `pathObj`.
- *
- * @param {object} pathObj The object containing the member with name `name`.
- * @param {string} name The name of the implemented member.
- * @param {BaseContext} context The context in which the schema is injected.
- */
- constructor(pathObj, name, context) {
- super();
- this.pathObj = pathObj;
- this.name = name;
- this.context = context;
- }
-
- callFunction(args) {
- return this.pathObj[this.name](...args);
- }
-
- callFunctionNoReturn(args) {
- this.pathObj[this.name](...args);
- }
-
- callAsyncFunction(args, callback) {
- let promise;
- try {
- promise = this.pathObj[this.name](...args) || Promise.resolve();
- } catch (e) {
- promise = Promise.reject(e);
- }
- return this.context.wrapPromise(promise, callback);
- }
-
- getProperty() {
- return this.pathObj[this.name];
- }
-
- setProperty(value) {
- this.pathObj[this.name] = value;
- }
-
- addListener(listener, args) {
- try {
- this.pathObj[this.name].addListener.call(null, listener, ...args);
- } catch (e) {
- throw this.context.normalizeError(e);
- }
- }
-
- hasListener(listener) {
- return this.pathObj[this.name].hasListener.call(null, listener);
- }
-
- removeListener(listener) {
- this.pathObj[this.name].removeListener.call(null, listener);
- }
-}
-
-/**
- * This object loads the ext-*.js scripts that define the extension API.
- *
- * This class instance is shared with the scripts that it loads, so that the
- * ext-*.js scripts and the instantiator can communicate with each other.
- */
-class SchemaAPIManager extends EventEmitter {
- /**
- * @param {string} processType
- * "main" - The main, one and only chrome browser process.
- * "addon" - An addon process.
- * "content" - A content process.
- */
- constructor(processType) {
- super();
- this.processType = processType;
- this.global = this._createExtGlobal();
- this._scriptScopes = [];
- this._schemaApis = {
- addon_parent: [],
- addon_child: [],
- content_parent: [],
- content_child: [],
- };
- }
-
- /**
- * Create a global object that is used as the shared global for all ext-*.js
- * scripts that are loaded via `loadScript`.
- *
- * @returns {object} A sandbox that is used as the global by `loadScript`.
- */
- _createExtGlobal() {
- let global = Cu.Sandbox(Services.scriptSecurityManager.getSystemPrincipal(), {
- wantXrays: false,
- sandboxName: `Namespace of ext-*.js scripts for ${this.processType}`,
- });
-
- Object.assign(global, {global, Cc, Ci, Cu, Cr, XPCOMUtils, extensions: this});
-
- XPCOMUtils.defineLazyGetter(global, "console", getConsole);
-
- XPCOMUtils.defineLazyModuleGetter(global, "require",
- "resource://devtools/shared/Loader.jsm");
-
- return global;
- }
-
- /**
- * Load an ext-*.js script. The script runs in its own scope, if it wishes to
- * share state with another script it can assign to the `global` variable. If
- * it wishes to communicate with this API manager, use `extensions`.
- *
- * @param {string} scriptUrl The URL of the ext-*.js script.
- */
- loadScript(scriptUrl) {
- // Create the object in the context of the sandbox so that the script runs
- // in the sandbox's context instead of here.
- let scope = Cu.createObjectIn(this.global);
-
- Services.scriptloader.loadSubScript(scriptUrl, scope, "UTF-8");
-
- // Save the scope to avoid it being garbage collected.
- this._scriptScopes.push(scope);
- }
-
- /**
- * Called by an ext-*.js script to register an API.
- *
- * @param {string} namespace The API namespace.
- * Intended to match the namespace of the generated API, but not used at
- * the moment - see bugzil.la/1295774.
- * @param {string} envType Restricts the API to contexts that run in the
- * given environment. Must be one of the following:
- * - "addon_parent" - addon APIs that runs in the main process.
- * - "addon_child" - addon APIs that runs in an addon process.
- * - "content_parent" - content script APIs that runs in the main process.
- * - "content_child" - content script APIs that runs in a content process.
- * @param {function(BaseContext)} getAPI A function that returns an object
- * that will be merged with |chrome| and |browser|. The next example adds
- * the create, update and remove methods to the tabs API.
- *
- * registerSchemaAPI("tabs", "addon_parent", (context) => ({
- * tabs: { create, update },
- * }));
- * registerSchemaAPI("tabs", "addon_parent", (context) => ({
- * tabs: { remove },
- * }));
- */
- registerSchemaAPI(namespace, envType, getAPI) {
- this._schemaApis[envType].push({namespace, getAPI});
- }
-
- /**
- * Exports all registered scripts to `obj`.
- *
- * @param {BaseContext} context The context for which the API bindings are
- * generated.
- * @param {object} obj The destination of the API.
- */
- generateAPIs(context, obj) {
- let apis = this._schemaApis[context.envType];
- if (!apis) {
- Cu.reportError(`No APIs have been registered for ${context.envType}`);
- return;
- }
- SchemaAPIManager.generateAPIs(context, apis, obj);
- }
-
- /**
- * Mash together all the APIs from `apis` into `obj`.
- *
- * @param {BaseContext} context The context for which the API bindings are
- * generated.
- * @param {Array} apis A list of objects, see `registerSchemaAPI`.
- * @param {object} obj The destination of the API.
- */
- static generateAPIs(context, apis, obj) {
- // Recursively copy properties from source to dest.
- function copy(dest, source) {
- for (let prop in source) {
- let desc = Object.getOwnPropertyDescriptor(source, prop);
- if (typeof(desc.value) == "object") {
- if (!(prop in dest)) {
- dest[prop] = {};
- }
- copy(dest[prop], source[prop]);
- } else {
- Object.defineProperty(dest, prop, desc);
- }
- }
- }
-
- for (let api of apis) {
- if (Schemas.checkPermissions(api.namespace, context.extension)) {
- api = api.getAPI(context);
- copy(obj, api);
- }
- }
- }
-}
-
-const ExtensionCommon = {
- BaseContext,
- LocalAPIImplementation,
- SchemaAPIInterface,
- SchemaAPIManager,
-};
diff --git a/toolkit/components/webextensions/ExtensionContent.jsm b/toolkit/components/webextensions/ExtensionContent.jsm
deleted file mode 100644
index 5f9b88f35c..0000000000
--- a/toolkit/components/webextensions/ExtensionContent.jsm
+++ /dev/null
@@ -1,1050 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionContent"];
-
-/* globals ExtensionContent */
-
-/*
- * This file handles the content process side of extensions. It mainly
- * takes care of content script injection, content script APIs, and
- * messaging.
- *
- * This file is also the initial entry point for addon processes.
- * ExtensionChild.jsm is responsible for functionality specific to addon
- * processes.
- */
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
- "resource://gre/modules/ExtensionManagement.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
- "resource:///modules/translation/LanguageDetector.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MatchGlobs",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
- "resource://gre/modules/MessageChannel.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
- "resource://gre/modules/PromiseUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "WebNavigationFrames",
- "resource://gre/modules/WebNavigationFrames.jsm");
-
-Cu.import("resource://gre/modules/ExtensionChild.jsm");
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-const {
- EventEmitter,
- LocaleData,
- defineLazyGetter,
- flushJarCache,
- getInnerWindowID,
- promiseDocumentReady,
- runSafeSyncWithoutClone,
-} = ExtensionUtils;
-
-const {
- BaseContext,
- SchemaAPIManager,
-} = ExtensionCommon;
-
-const {
- ChildAPIManager,
- Messenger,
-} = ExtensionChild;
-
-XPCOMUtils.defineLazyGetter(this, "console", ExtensionUtils.getConsole);
-
-const CATEGORY_EXTENSION_SCRIPTS_CONTENT = "webextension-scripts-content";
-
-function isWhenBeforeOrSame(when1, when2) {
- let table = {"document_start": 0,
- "document_end": 1,
- "document_idle": 2};
- return table[when1] <= table[when2];
-}
-
-var apiManager = new class extends SchemaAPIManager {
- constructor() {
- super("content");
- this.initialized = false;
- }
-
- generateAPIs(...args) {
- if (!this.initialized) {
- this.initialized = true;
- for (let [/* name */, value] of XPCOMUtils.enumerateCategoryEntries(CATEGORY_EXTENSION_SCRIPTS_CONTENT)) {
- this.loadScript(value);
- }
- }
- return super.generateAPIs(...args);
- }
-
- registerSchemaAPI(namespace, envType, getAPI) {
- if (envType == "content_child") {
- super.registerSchemaAPI(namespace, envType, getAPI);
- }
- }
-}();
-
-// Represents a content script.
-function Script(extension, options, deferred = PromiseUtils.defer()) {
- this.extension = extension;
- this.options = options;
- this.run_at = this.options.run_at;
- this.js = this.options.js || [];
- this.css = this.options.css || [];
- this.remove_css = this.options.remove_css;
- this.match_about_blank = this.options.match_about_blank;
-
- this.deferred = deferred;
-
- this.matches_ = new MatchPattern(this.options.matches);
- this.exclude_matches_ = new MatchPattern(this.options.exclude_matches || null);
- // TODO: MatchPattern should pre-mangle host-only patterns so that we
- // don't need to call a separate match function.
- this.matches_host_ = new MatchPattern(this.options.matchesHost || null);
- this.include_globs_ = new MatchGlobs(this.options.include_globs);
- this.exclude_globs_ = new MatchGlobs(this.options.exclude_globs);
-
- this.requiresCleanup = !this.remove_css && (this.css.length > 0 || options.cssCode);
-}
-
-Script.prototype = {
- get cssURLs() {
- // We can handle CSS urls (css) and CSS code (cssCode).
- let urls = [];
- for (let url of this.css) {
- urls.push(this.extension.baseURI.resolve(url));
- }
-
- if (this.options.cssCode) {
- let url = "data:text/css;charset=utf-8," + encodeURIComponent(this.options.cssCode);
- urls.push(url);
- }
-
- return urls;
- },
-
- matches(window) {
- let uri = window.document.documentURIObject;
- let principal = window.document.nodePrincipal;
-
- // If mozAddonManager is present on this page, don't allow
- // content scripts.
- if (window.navigator.mozAddonManager !== undefined) {
- return false;
- }
-
- if (this.match_about_blank && ["about:blank", "about:srcdoc"].includes(uri.spec)) {
- // When matching about:blank/srcdoc documents, the checks below
- // need to be performed against the "owner" document's URI.
- uri = principal.URI;
- }
-
- // Documents from data: URIs also inherit the principal.
- if (Services.netUtils.URIChainHasFlags(uri, Ci.nsIProtocolHandler.URI_INHERITS_SECURITY_CONTEXT)) {
- if (!this.match_about_blank) {
- return false;
- }
- uri = principal.URI;
- }
-
- if (!(this.matches_.matches(uri) || this.matches_host_.matchesIgnoringPath(uri))) {
- return false;
- }
-
- if (this.exclude_matches_.matches(uri)) {
- return false;
- }
-
- if (this.options.include_globs != null) {
- if (!this.include_globs_.matches(uri.spec)) {
- return false;
- }
- }
-
- if (this.exclude_globs_.matches(uri.spec)) {
- return false;
- }
-
- if (this.options.frame_id != null) {
- if (WebNavigationFrames.getFrameId(window) != this.options.frame_id) {
- return false;
- }
- } else if (!this.options.all_frames && window.top != window) {
- return false;
- }
-
- return true;
- },
-
- cleanup(window) {
- if (!this.remove_css) {
- let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
-
- for (let url of this.cssURLs) {
- runSafeSyncWithoutClone(winUtils.removeSheetUsingURIString, url, winUtils.AUTHOR_SHEET);
- }
- }
- },
-
- /**
- * Tries to inject this script into the given window and sandbox, if
- * there are pending operations for the window's current load state.
- *
- * @param {Window} window
- * The DOM Window to inject the scripts and CSS into.
- * @param {Sandbox} sandbox
- * A Sandbox inheriting from `window` in which to evaluate the
- * injected scripts.
- * @param {function} shouldRun
- * A function which, when passed the document load state that a
- * script is expected to run at, returns `true` if we should
- * currently be injecting scripts for that load state.
- *
- * For initial injection of a script, this function should
- * return true if the document is currently in or has already
- * passed through the given state. For injections triggered by
- * document state changes, it should only return true if the
- * given state exactly matches the state that triggered the
- * change.
- * @param {string} when
- * The document's current load state, or if triggered by a
- * document state change, the new document state that triggered
- * the injection.
- */
- tryInject(window, sandbox, shouldRun, when) {
- if (shouldRun("document_start")) {
- let {cssURLs} = this;
- if (cssURLs.length > 0) {
- let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
-
- let method = this.remove_css ? winUtils.removeSheetUsingURIString : winUtils.loadSheetUsingURIString;
- for (let url of cssURLs) {
- runSafeSyncWithoutClone(method, url, winUtils.AUTHOR_SHEET);
- }
-
- this.deferred.resolve();
- }
- }
-
- let result;
- let scheduled = this.run_at || "document_idle";
- if (shouldRun(scheduled)) {
- for (let [i, url] of this.js.entries()) {
- let options = {
- target: sandbox,
- charset: "UTF-8",
- // Inject the last script asynchronously unless we're expected to
- // inject before any page scripts have run, and we haven't already
- // missed that boat.
- async: (i === this.js.length - 1) &&
- (this.run_at !== "document_start" || when !== "document_start"),
- };
- try {
- result = Services.scriptloader.loadSubScriptWithOptions(url, options);
- } catch (e) {
- Cu.reportError(e);
- this.deferred.reject(e);
- }
- }
-
- if (this.options.jsCode) {
- try {
- result = Cu.evalInSandbox(this.options.jsCode, sandbox, "latest");
- } catch (e) {
- Cu.reportError(e);
- this.deferred.reject(e);
- }
- }
-
- this.deferred.resolve(result);
- }
- },
-};
-
-function getWindowMessageManager(contentWindow) {
- let ir = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIInterfaceRequestor);
- try {
- return ir.getInterface(Ci.nsIContentFrameMessageManager);
- } catch (e) {
- // Some windows don't support this interface (hidden window).
- return null;
- }
-}
-
-var DocumentManager;
-var ExtensionManager;
-
-/**
- * An execution context for semi-privileged extension content scripts.
- *
- * This is the child side of the ContentScriptContextParent class
- * defined in ExtensionParent.jsm.
- */
-class ContentScriptContextChild extends BaseContext {
- constructor(extension, contentWindow, contextOptions = {}) {
- super("content_child", extension);
-
- let {isExtensionPage} = contextOptions;
-
- this.isExtensionPage = isExtensionPage;
-
- this.setContentWindow(contentWindow);
-
- let frameId = WebNavigationFrames.getFrameId(contentWindow);
- this.frameId = frameId;
-
- this.scripts = [];
-
- let contentPrincipal = contentWindow.document.nodePrincipal;
- let ssm = Services.scriptSecurityManager;
-
- // copy origin attributes from the content window origin attributes to
- // preserve the user context id. overwrite the addonId.
- let attrs = contentPrincipal.originAttributes;
- attrs.addonId = this.extension.id;
- let extensionPrincipal = ssm.createCodebasePrincipal(this.extension.baseURI, attrs);
-
- let principal;
- if (ssm.isSystemPrincipal(contentPrincipal)) {
- // Make sure we don't hand out the system principal by accident.
- // also make sure that the null principal has the right origin attributes
- principal = ssm.createNullPrincipal(attrs);
- } else {
- principal = [contentPrincipal, extensionPrincipal];
- }
-
- if (isExtensionPage) {
- if (ExtensionManagement.getAddonIdForWindow(this.contentWindow) != this.extension.id) {
- throw new Error("Invalid target window for this extension context");
- }
- // This is an iframe with content script API enabled and its principal should be the
- // contentWindow itself. (we create a sandbox with the contentWindow as principal and with X-rays disabled
- // because it enables us to create the APIs object in this sandbox object and then copying it
- // into the iframe's window, see Bug 1214658 for rationale)
- this.sandbox = Cu.Sandbox(contentWindow, {
- sandboxName: `Web-Accessible Extension Page ${this.extension.id}`,
- sandboxPrototype: contentWindow,
- sameZoneAs: contentWindow,
- wantXrays: false,
- isWebExtensionContentScript: true,
- });
- } else {
- // This metadata is required by the Developer Tools, in order for
- // the content script to be associated with both the extension and
- // the tab holding the content page.
- let metadata = {
- "inner-window-id": this.innerWindowID,
- addonId: attrs.addonId,
- };
-
- this.sandbox = Cu.Sandbox(principal, {
- metadata,
- sandboxName: `Content Script ${this.extension.id}`,
- sandboxPrototype: contentWindow,
- sameZoneAs: contentWindow,
- wantXrays: true,
- isWebExtensionContentScript: true,
- wantExportHelpers: true,
- wantGlobalProperties: ["XMLHttpRequest", "fetch"],
- originAttributes: attrs,
- });
-
- Cu.evalInSandbox(`
- window.JSON = JSON;
- window.XMLHttpRequest = XMLHttpRequest;
- window.fetch = fetch;
- `, this.sandbox);
- }
-
- Object.defineProperty(this, "principal", {
- value: Cu.getObjectPrincipal(this.sandbox),
- enumerable: true,
- configurable: true,
- });
-
- this.url = contentWindow.location.href;
-
- defineLazyGetter(this, "chromeObj", () => {
- let chromeObj = Cu.createObjectIn(this.sandbox);
-
- Schemas.inject(chromeObj, this.childManager);
- return chromeObj;
- });
-
- Schemas.exportLazyGetter(this.sandbox, "browser", () => this.chromeObj);
- Schemas.exportLazyGetter(this.sandbox, "chrome", () => this.chromeObj);
-
- // This is an iframe with content script API enabled (bug 1214658)
- if (isExtensionPage) {
- Schemas.exportLazyGetter(this.contentWindow,
- "browser", () => this.chromeObj);
- Schemas.exportLazyGetter(this.contentWindow,
- "chrome", () => this.chromeObj);
- }
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-
- execute(script, shouldRun, when) {
- script.tryInject(this.contentWindow, this.sandbox, shouldRun, when);
- }
-
- addScript(script, when) {
- let state = DocumentManager.getWindowState(this.contentWindow);
- this.execute(script, scheduled => isWhenBeforeOrSame(scheduled, state), when);
-
- // Save the script in case it has pending operations in later load
- // states, but only if we're before document_idle, or require cleanup.
- if (state != "document_idle" || script.requiresCleanup) {
- this.scripts.push(script);
- }
- }
-
- triggerScripts(documentState) {
- for (let script of this.scripts) {
- this.execute(script, scheduled => scheduled == documentState, documentState);
- }
- if (documentState == "document_idle") {
- // Don't bother saving scripts after document_idle.
- this.scripts = this.scripts.filter(script => script.requiresCleanup);
- }
- }
-
- close() {
- super.unload();
-
- if (this.contentWindow) {
- for (let script of this.scripts) {
- if (script.requiresCleanup) {
- script.cleanup(this.contentWindow);
- }
- }
-
- // Overwrite the content script APIs with an empty object if the APIs objects are still
- // defined in the content window (bug 1214658).
- if (this.isExtensionPage) {
- Cu.createObjectIn(this.contentWindow, {defineAs: "browser"});
- Cu.createObjectIn(this.contentWindow, {defineAs: "chrome"});
- }
- }
- Cu.nukeSandbox(this.sandbox);
- this.sandbox = null;
- }
-}
-
-defineLazyGetter(ContentScriptContextChild.prototype, "messenger", function() {
- // The |sender| parameter is passed directly to the extension.
- let sender = {id: this.extension.id, frameId: this.frameId, url: this.url};
- let filter = {extensionId: this.extension.id};
- let optionalFilter = {frameId: this.frameId};
-
- return new Messenger(this, [this.messageManager], sender, filter, optionalFilter);
-});
-
-defineLazyGetter(ContentScriptContextChild.prototype, "childManager", function() {
- let localApis = {};
- apiManager.generateAPIs(this, localApis);
-
- let childManager = new ChildAPIManager(this, this.messageManager, localApis, {
- envType: "content_parent",
- url: this.url,
- });
-
- this.callOnClose(childManager);
-
- return childManager;
-});
-
-// Responsible for creating ExtensionContexts and injecting content
-// scripts into them when new documents are created.
-DocumentManager = {
- extensionCount: 0,
-
- // Map[windowId -> Map[extensionId -> ContentScriptContextChild]]
- contentScriptWindows: new Map(),
-
- // Map[windowId -> ContentScriptContextChild]
- extensionPageWindows: new Map(),
-
- init() {
- Services.obs.addObserver(this, "content-document-global-created", false);
- Services.obs.addObserver(this, "document-element-inserted", false);
- Services.obs.addObserver(this, "inner-window-destroyed", false);
- },
-
- uninit() {
- Services.obs.removeObserver(this, "content-document-global-created");
- Services.obs.removeObserver(this, "document-element-inserted");
- Services.obs.removeObserver(this, "inner-window-destroyed");
- },
-
- getWindowState(contentWindow) {
- let readyState = contentWindow.document.readyState;
- if (readyState == "complete") {
- return "document_idle";
- }
- if (readyState == "interactive") {
- return "document_end";
- }
- return "document_start";
- },
-
- loadInto(window) {
- // Enable the content script APIs should be available in subframes' window
- // if it is recognized as a valid addon id (see Bug 1214658 for rationale).
- const {
- NO_PRIVILEGES,
- CONTENTSCRIPT_PRIVILEGES,
- FULL_PRIVILEGES,
- } = ExtensionManagement.API_LEVELS;
- let extensionId = ExtensionManagement.getAddonIdForWindow(window);
- let apiLevel = ExtensionManagement.getAPILevelForWindow(window, extensionId);
-
- if (apiLevel != NO_PRIVILEGES) {
- let extension = ExtensionManager.get(extensionId);
- if (extension) {
- if (apiLevel == CONTENTSCRIPT_PRIVILEGES) {
- DocumentManager.getExtensionPageContext(extension, window);
- } else if (apiLevel == FULL_PRIVILEGES) {
- ExtensionChild.createExtensionContext(extension, window);
- }
- }
- }
- },
-
- observe: function(subject, topic, data) {
- // For some types of documents (about:blank), we only see the first
- // notification, for others (data: URIs) we only observe the second.
- if (topic == "content-document-global-created" || topic == "document-element-inserted") {
- let document = subject;
- let window = document && document.defaultView;
-
- if (topic == "content-document-global-created") {
- window = subject;
- document = window && window.document;
- }
-
- if (!document || !document.location || !window) {
- return;
- }
-
- // Make sure we only load into frames that ExtensionContent.init
- // was called on (i.e., not frames for social or sidebars).
- let mm = getWindowMessageManager(window);
- if (!mm || !ExtensionContent.globals.has(mm)) {
- return;
- }
-
- // Load on document-element-inserted, except for about:blank which doesn't
- // see it, and needs special late handling on DOMContentLoaded event.
- if (topic === "document-element-inserted") {
- this.loadInto(window);
- this.trigger("document_start", window);
- }
-
- /* eslint-disable mozilla/balanced-listeners */
- window.addEventListener("DOMContentLoaded", this, true);
- window.addEventListener("load", this, true);
- /* eslint-enable mozilla/balanced-listeners */
- } else if (topic == "inner-window-destroyed") {
- let windowId = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
-
- MessageChannel.abortResponses({innerWindowID: windowId});
-
- // Close any existent content-script context for the destroyed window.
- if (this.contentScriptWindows.has(windowId)) {
- let extensions = this.contentScriptWindows.get(windowId);
- for (let [, context] of extensions) {
- context.close();
- }
-
- this.contentScriptWindows.delete(windowId);
- }
-
- // Close any existent iframe extension page context for the destroyed window.
- if (this.extensionPageWindows.has(windowId)) {
- let context = this.extensionPageWindows.get(windowId);
- context.close();
- this.extensionPageWindows.delete(windowId);
- }
-
- ExtensionChild.destroyExtensionContext(windowId);
- }
- },
-
- handleEvent: function(event) {
- let window = event.currentTarget;
- if (event.target != window.document) {
- // We use capturing listeners so we have precedence over content script
- // listeners, but only care about events targeted to the element we're
- // listening on.
- return;
- }
- window.removeEventListener(event.type, this, true);
-
- // Need to check if we're still on the right page? Greasemonkey does this.
-
- if (event.type == "DOMContentLoaded") {
- // By this time, we can be sure if this is an explicit about:blank
- // document, and if it needs special late loading and fake trigger.
- if (window.location.href === "about:blank") {
- this.loadInto(window);
- this.trigger("document_start", window);
- }
- this.trigger("document_end", window);
- } else if (event.type == "load") {
- this.trigger("document_idle", window);
- }
- },
-
- // Used to executeScript, insertCSS and removeCSS.
- executeScript(global, extensionId, options) {
- let extension = ExtensionManager.get(extensionId);
-
- let executeInWin = (window) => {
- let deferred = PromiseUtils.defer();
- let script = new Script(extension, options, deferred);
-
- if (script.matches(window)) {
- let context = this.getContentScriptContext(extension, window);
- context.addScript(script);
- return deferred.promise;
- }
- return null;
- };
-
- let promises = Array.from(this.enumerateWindows(global.docShell), executeInWin)
- .filter(promise => promise);
-
- if (!promises.length) {
- let details = {};
- for (let key of ["all_frames", "frame_id", "matches_about_blank", "matchesHost"]) {
- if (key in options) {
- details[key] = options[key];
- }
- }
-
- return Promise.reject({message: `No window matching ${JSON.stringify(details)}`});
- }
- if (!options.all_frames && promises.length > 1) {
- return Promise.reject({message: `Internal error: Script matched multiple windows`});
- }
- return Promise.all(promises);
- },
-
- enumerateWindows: function* (docShell) {
- let window = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
- yield window;
-
- for (let i = 0; i < docShell.childCount; i++) {
- let child = docShell.getChildAt(i).QueryInterface(Ci.nsIDocShell);
- yield* this.enumerateWindows(child);
- }
- },
-
- getContentScriptGlobalsForWindow(window) {
- let winId = getInnerWindowID(window);
- let extensions = this.contentScriptWindows.get(winId);
-
- if (extensions) {
- return Array.from(extensions.values(), ctx => ctx.sandbox);
- }
-
- return [];
- },
-
- getContentScriptContext(extension, window) {
- let winId = getInnerWindowID(window);
- if (!this.contentScriptWindows.has(winId)) {
- this.contentScriptWindows.set(winId, new Map());
- }
-
- let extensions = this.contentScriptWindows.get(winId);
- if (!extensions.has(extension.id)) {
- let context = new ContentScriptContextChild(extension, window);
- extensions.set(extension.id, context);
- }
-
- return extensions.get(extension.id);
- },
-
- getExtensionPageContext(extension, window) {
- let winId = getInnerWindowID(window);
-
- let context = this.extensionPageWindows.get(winId);
- if (!context) {
- let context = new ContentScriptContextChild(extension, window, {isExtensionPage: true});
- this.extensionPageWindows.set(winId, context);
- }
-
- return context;
- },
-
- startupExtension(extensionId) {
- if (this.extensionCount == 0) {
- this.init();
- }
- this.extensionCount++;
-
- let extension = ExtensionManager.get(extensionId);
- for (let global of ExtensionContent.globals.keys()) {
- // Note that we miss windows in the bfcache here. In theory we
- // could execute content scripts on a pageshow event for that
- // window, but that seems extreme.
- for (let window of this.enumerateWindows(global.docShell)) {
- for (let script of extension.scripts) {
- if (script.matches(window)) {
- let context = this.getContentScriptContext(extension, window);
- context.addScript(script);
- }
- }
- }
- }
- },
-
- shutdownExtension(extensionId) {
- // Clean up content-script contexts on extension shutdown.
- for (let [, extensions] of this.contentScriptWindows) {
- let context = extensions.get(extensionId);
- if (context) {
- context.close();
- extensions.delete(extensionId);
- }
- }
-
- // Clean up iframe extension page contexts on extension shutdown.
- for (let [winId, context] of this.extensionPageWindows) {
- if (context.extension.id == extensionId) {
- context.close();
- this.extensionPageWindows.delete(winId);
- }
- }
-
- ExtensionChild.shutdownExtension(extensionId);
-
- MessageChannel.abortResponses({extensionId});
-
- this.extensionCount--;
- if (this.extensionCount == 0) {
- this.uninit();
- }
- },
-
- trigger(when, window) {
- if (when === "document_start") {
- for (let extension of ExtensionManager.extensions.values()) {
- for (let script of extension.scripts) {
- if (script.matches(window)) {
- let context = this.getContentScriptContext(extension, window);
- context.addScript(script, when);
- }
- }
- }
- } else {
- let contexts = this.contentScriptWindows.get(getInnerWindowID(window)) || new Map();
- for (let context of contexts.values()) {
- context.triggerScripts(when);
- }
- }
- },
-};
-
-// Represents a browser extension in the content process.
-class BrowserExtensionContent extends EventEmitter {
- constructor(data) {
- super();
-
- this.id = data.id;
- this.uuid = data.uuid;
- this.data = data;
- this.instanceId = data.instanceId;
-
- this.MESSAGE_EMIT_EVENT = `Extension:EmitEvent:${this.instanceId}`;
- Services.cpmm.addMessageListener(this.MESSAGE_EMIT_EVENT, this);
-
- this.scripts = data.content_scripts.map(scriptData => new Script(this, scriptData));
- this.webAccessibleResources = new MatchGlobs(data.webAccessibleResources);
- this.whiteListedHosts = new MatchPattern(data.whiteListedHosts);
- this.permissions = data.permissions;
- this.principal = data.principal;
-
- this.localeData = new LocaleData(data.localeData);
-
- this.manifest = data.manifest;
- this.baseURI = Services.io.newURI(data.baseURL, null, null);
-
- // Only used in addon processes.
- this.views = new Set();
-
- let uri = Services.io.newURI(data.resourceURL, null, null);
-
- if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
- // Extension.jsm takes care of this in the parent.
- ExtensionManagement.startupExtension(this.uuid, uri, this);
- }
- }
-
- shutdown() {
- Services.cpmm.removeMessageListener(this.MESSAGE_EMIT_EVENT, this);
-
- if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
- ExtensionManagement.shutdownExtension(this.uuid);
- }
- }
-
- emit(event, ...args) {
- Services.cpmm.sendAsyncMessage(this.MESSAGE_EMIT_EVENT, {event, args});
-
- super.emit(event, ...args);
- }
-
- receiveMessage({name, data}) {
- if (name === this.MESSAGE_EMIT_EVENT) {
- super.emit(data.event, ...data.args);
- }
- }
-
- localizeMessage(...args) {
- return this.localeData.localizeMessage(...args);
- }
-
- localize(...args) {
- return this.localeData.localize(...args);
- }
-
- hasPermission(perm) {
- let match = /^manifest:(.*)/.exec(perm);
- if (match) {
- return this.manifest[match[1]] != null;
- }
- return this.permissions.has(perm);
- }
-}
-
-ExtensionManager = {
- // Map[extensionId, BrowserExtensionContent]
- extensions: new Map(),
-
- init() {
- Schemas.init();
- ExtensionChild.initOnce();
-
- Services.cpmm.addMessageListener("Extension:Startup", this);
- Services.cpmm.addMessageListener("Extension:Shutdown", this);
- Services.cpmm.addMessageListener("Extension:FlushJarCache", this);
-
- if (Services.cpmm.initialProcessData && "Extension:Extensions" in Services.cpmm.initialProcessData) {
- let extensions = Services.cpmm.initialProcessData["Extension:Extensions"];
- for (let data of extensions) {
- this.extensions.set(data.id, new BrowserExtensionContent(data));
- DocumentManager.startupExtension(data.id);
- }
- }
- },
-
- get(extensionId) {
- return this.extensions.get(extensionId);
- },
-
- receiveMessage({name, data}) {
- let extension;
- switch (name) {
- case "Extension:Startup": {
- extension = new BrowserExtensionContent(data);
-
- this.extensions.set(data.id, extension);
-
- DocumentManager.startupExtension(data.id);
-
- Services.cpmm.sendAsyncMessage("Extension:StartupComplete");
- break;
- }
-
- case "Extension:Shutdown": {
- extension = this.extensions.get(data.id);
- extension.shutdown();
-
- DocumentManager.shutdownExtension(data.id);
-
- this.extensions.delete(data.id);
- break;
- }
-
- case "Extension:FlushJarCache": {
- let nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile",
- "initWithPath");
- let file = new nsIFile(data.path);
- flushJarCache(file);
- Services.cpmm.sendAsyncMessage("Extension:FlushJarCacheComplete");
- break;
- }
- }
- },
-};
-
-class ExtensionGlobal {
- constructor(global) {
- this.global = global;
-
- MessageChannel.addListener(global, "Extension:Capture", this);
- MessageChannel.addListener(global, "Extension:DetectLanguage", this);
- MessageChannel.addListener(global, "Extension:Execute", this);
- MessageChannel.addListener(global, "WebNavigation:GetFrame", this);
- MessageChannel.addListener(global, "WebNavigation:GetAllFrames", this);
-
- this.windowId = global.content
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .outerWindowID;
-
- global.sendAsyncMessage("Extension:TopWindowID", {windowId: this.windowId});
- }
-
- uninit() {
- this.global.sendAsyncMessage("Extension:RemoveTopWindowID", {windowId: this.windowId});
- }
-
- get messageFilterStrict() {
- return {
- innerWindowID: getInnerWindowID(this.global.content),
- };
- }
-
- receiveMessage({target, messageName, recipient, data}) {
- switch (messageName) {
- case "Extension:Capture":
- return this.handleExtensionCapture(data.width, data.height, data.options);
- case "Extension:DetectLanguage":
- return this.handleDetectLanguage(target);
- case "Extension:Execute":
- return this.handleExtensionExecute(target, recipient.extensionId, data.options);
- case "WebNavigation:GetFrame":
- return this.handleWebNavigationGetFrame(data.options);
- case "WebNavigation:GetAllFrames":
- return this.handleWebNavigationGetAllFrames();
- }
- }
-
- handleExtensionCapture(width, height, options) {
- let win = this.global.content;
-
- const XHTML_NS = "http://www.w3.org/1999/xhtml";
- let canvas = win.document.createElementNS(XHTML_NS, "canvas");
- canvas.width = width;
- canvas.height = height;
- canvas.mozOpaque = true;
-
- let ctx = canvas.getContext("2d");
-
- // We need to scale the image to the visible size of the browser,
- // in order for the result to appear as the user sees it when
- // settings like full zoom come into play.
- ctx.scale(canvas.width / win.innerWidth, canvas.height / win.innerHeight);
-
- ctx.drawWindow(win, win.scrollX, win.scrollY, win.innerWidth, win.innerHeight, "#fff");
-
- return canvas.toDataURL(`image/${options.format}`, options.quality / 100);
- }
-
- handleDetectLanguage(target) {
- let doc = target.content.document;
-
- return promiseDocumentReady(doc).then(() => {
- let elem = doc.documentElement;
-
- let language = (elem.getAttribute("xml:lang") || elem.getAttribute("lang") ||
- doc.contentLanguage || null);
-
- // We only want the last element of the TLD here.
- // Only country codes have any effect on the results, but other
- // values cause no harm.
- let tld = doc.location.hostname.match(/[a-z]*$/)[0];
-
- // The CLD2 library used by the language detector is capable of
- // analyzing raw HTML. Unfortunately, that takes much more memory,
- // and since it's hosted by emscripten, and therefore can't shrink
- // its heap after it's grown, it has a performance cost.
- // So we send plain text instead.
- let encoder = Cc["@mozilla.org/layout/documentEncoder;1?type=text/plain"].createInstance(Ci.nsIDocumentEncoder);
- encoder.init(doc, "text/plain", encoder.SkipInvisibleContent);
- let text = encoder.encodeToStringWithMaxLength(60 * 1024);
-
- let encoding = doc.characterSet;
-
- return LanguageDetector.detectLanguage({language, tld, text, encoding})
- .then(result => result.language === "un" ? "und" : result.language);
- });
- }
-
- // Used to executeScript, insertCSS and removeCSS.
- handleExtensionExecute(target, extensionId, options) {
- return DocumentManager.executeScript(target, extensionId, options).then(result => {
- try {
- // Make sure we can structured-clone the result value before
- // we try to send it back over the message manager.
- Cu.cloneInto(result, target);
- } catch (e) {
- return Promise.reject({message: "Script returned non-structured-clonable data"});
- }
- return result;
- });
- }
-
- handleWebNavigationGetFrame({frameId}) {
- return WebNavigationFrames.getFrame(this.global.docShell, frameId);
- }
-
- handleWebNavigationGetAllFrames() {
- return WebNavigationFrames.getAllFrames(this.global.docShell);
- }
-}
-
-this.ExtensionContent = {
- globals: new Map(),
-
- init(global) {
- this.globals.set(global, new ExtensionGlobal(global));
- ExtensionChild.init(global);
- },
-
- uninit(global) {
- ExtensionChild.uninit(global);
- this.globals.get(global).uninit();
- this.globals.delete(global);
- },
-
- // This helper is exported to be integrated in the devtools RDP actors,
- // that can use it to retrieve the existent WebExtensions ContentScripts
- // of a target window and be able to show the ContentScripts source in the
- // DevTools Debugger panel.
- getContentScriptGlobalsForWindow(window) {
- return DocumentManager.getContentScriptGlobalsForWindow(window);
- },
-};
-
-ExtensionManager.init();
diff --git a/toolkit/components/webextensions/ExtensionManagement.jsm b/toolkit/components/webextensions/ExtensionManagement.jsm
deleted file mode 100644
index 324c5b71b9..0000000000
--- a/toolkit/components/webextensions/ExtensionManagement.jsm
+++ /dev/null
@@ -1,321 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionManagement"];
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionUtils",
- "resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "console", () => ExtensionUtils.getConsole());
-
-XPCOMUtils.defineLazyGetter(this, "UUIDMap", () => {
- let {UUIDMap} = Cu.import("resource://gre/modules/Extension.jsm", {});
- return UUIDMap;
-});
-
-/*
- * This file should be kept short and simple since it's loaded even
- * when no extensions are running.
- */
-
-// Keep track of frame IDs for content windows. Mostly we can just use
-// the outer window ID as the frame ID. However, the API specifies
-// that top-level windows have a frame ID of 0. So we need to keep
-// track of which windows are top-level. This code listens to messages
-// from ExtensionContent to do that.
-var Frames = {
- // Window IDs of top-level content windows.
- topWindowIds: new Set(),
-
- init() {
- if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
- return;
- }
-
- Services.mm.addMessageListener("Extension:TopWindowID", this);
- Services.mm.addMessageListener("Extension:RemoveTopWindowID", this, true);
- },
-
- isTopWindowId(windowId) {
- return this.topWindowIds.has(windowId);
- },
-
- // Convert an outer window ID to a frame ID. An outer window ID of 0
- // is invalid.
- getId(windowId) {
- if (this.isTopWindowId(windowId)) {
- return 0;
- }
- if (windowId == 0) {
- return -1;
- }
- return windowId;
- },
-
- // Convert an outer window ID for a parent window to a frame
- // ID. Outer window IDs follow the same convention that
- // |window.top.parent === window.top|. The API works differently,
- // giving a frame ID of -1 for the the parent of a top-level
- // window. This function handles the conversion.
- getParentId(parentWindowId, windowId) {
- if (parentWindowId == windowId) {
- // We have a top-level window.
- return -1;
- }
-
- // Not a top-level window. Just return the ID as normal.
- return this.getId(parentWindowId);
- },
-
- receiveMessage({name, data}) {
- switch (name) {
- case "Extension:TopWindowID":
- // FIXME: Need to handle the case where the content process
- // crashes. Right now we leak its top window IDs.
- this.topWindowIds.add(data.windowId);
- break;
-
- case "Extension:RemoveTopWindowID":
- this.topWindowIds.delete(data.windowId);
- break;
- }
- },
-};
-Frames.init();
-
-var APIs = {
- apis: new Map(),
-
- register(namespace, schema, script) {
- if (this.apis.has(namespace)) {
- throw new Error(`API namespace already exists: ${namespace}`);
- }
-
- this.apis.set(namespace, {schema, script});
- },
-
- unregister(namespace) {
- if (!this.apis.has(namespace)) {
- throw new Error(`API namespace does not exist: ${namespace}`);
- }
-
- this.apis.delete(namespace);
- },
-};
-
-function getURLForExtension(id, path = "") {
- let uuid = UUIDMap.get(id, false);
- if (!uuid) {
- Cu.reportError(`Called getURLForExtension on unmapped extension ${id}`);
- return null;
- }
- return `moz-extension://${uuid}/${path}`;
-}
-
-// This object manages various platform-level issues related to
-// moz-extension:// URIs. It lives here so that it can be used in both
-// the parent and child processes.
-//
-// moz-extension URIs have the form moz-extension://uuid/path. Each
-// extension has its own UUID, unique to the machine it's installed
-// on. This is easier and more secure than using the extension ID,
-// since it makes it slightly harder to fingerprint for extensions if
-// each user uses different URIs for the extension.
-var Service = {
- initialized: false,
-
- // Map[uuid -> extension].
- // extension can be an Extension (parent process) or BrowserExtensionContent (child process).
- uuidMap: new Map(),
-
- init() {
- let aps = Cc["@mozilla.org/addons/policy-service;1"].getService(Ci.nsIAddonPolicyService);
- aps = aps.wrappedJSObject;
- this.aps = aps;
- aps.setExtensionURILoadCallback(this.extensionURILoadableByAnyone.bind(this));
- aps.setExtensionURIToAddonIdCallback(this.extensionURIToAddonID.bind(this));
- },
-
- // Called when a new extension is loaded.
- startupExtension(uuid, uri, extension) {
- if (!this.initialized) {
- this.initialized = true;
- this.init();
- }
-
- // Create the moz-extension://uuid mapping.
- let handler = Services.io.getProtocolHandler("moz-extension");
- handler.QueryInterface(Ci.nsISubstitutingProtocolHandler);
- handler.setSubstitution(uuid, uri);
-
- this.uuidMap.set(uuid, extension);
- this.aps.setAddonHasPermissionCallback(extension.id, extension.hasPermission.bind(extension));
- this.aps.setAddonLoadURICallback(extension.id, this.checkAddonMayLoad.bind(this, extension));
- this.aps.setAddonLocalizeCallback(extension.id, extension.localize.bind(extension));
- this.aps.setAddonCSP(extension.id, extension.manifest.content_security_policy);
- this.aps.setBackgroundPageUrlCallback(uuid, this.generateBackgroundPageUrl.bind(this, extension));
- },
-
- // Called when an extension is unloaded.
- shutdownExtension(uuid) {
- let extension = this.uuidMap.get(uuid);
- this.uuidMap.delete(uuid);
- this.aps.setAddonHasPermissionCallback(extension.id, null);
- this.aps.setAddonLoadURICallback(extension.id, null);
- this.aps.setAddonLocalizeCallback(extension.id, null);
- this.aps.setAddonCSP(extension.id, null);
- this.aps.setBackgroundPageUrlCallback(uuid, null);
-
- let handler = Services.io.getProtocolHandler("moz-extension");
- handler.QueryInterface(Ci.nsISubstitutingProtocolHandler);
- handler.setSubstitution(uuid, null);
- },
-
- // Return true if the given URI can be loaded from arbitrary web
- // content. The manifest.json |web_accessible_resources| directive
- // determines this.
- extensionURILoadableByAnyone(uri) {
- let uuid = uri.host;
- let extension = this.uuidMap.get(uuid);
- if (!extension || !extension.webAccessibleResources) {
- return false;
- }
-
- let path = uri.QueryInterface(Ci.nsIURL).filePath;
- if (path.length > 0 && path[0] == "/") {
- path = path.substr(1);
- }
- return extension.webAccessibleResources.matches(path);
- },
-
- // Checks whether a given extension can load this URI (typically via
- // an XML HTTP request). The manifest.json |permissions| directive
- // determines this.
- checkAddonMayLoad(extension, uri) {
- return extension.whiteListedHosts.matchesIgnoringPath(uri);
- },
-
- generateBackgroundPageUrl(extension) {
- let background_scripts = extension.manifest.background &&
- extension.manifest.background.scripts;
- if (!background_scripts) {
- return;
- }
- let html = "<!DOCTYPE html>\n<body>\n";
- for (let script of background_scripts) {
- script = script.replace(/"/g, "&quot;");
- html += `<script src="${script}"></script>\n`;
- }
- html += "</body>\n</html>\n";
- return "data:text/html;charset=utf-8," + encodeURIComponent(html);
- },
-
- // Finds the add-on ID associated with a given moz-extension:// URI.
- // This is used to set the addonId on the originAttributes for the
- // nsIPrincipal attached to the URI.
- extensionURIToAddonID(uri) {
- let uuid = uri.host;
- let extension = this.uuidMap.get(uuid);
- return extension ? extension.id : undefined;
- },
-};
-
-// API Levels Helpers
-
-// Find the add-on associated with this document via the
-// principal's originAttributes. This value is computed by
-// extensionURIToAddonID, which ensures that we don't inject our
-// API into webAccessibleResources or remote web pages.
-function getAddonIdForWindow(window) {
- return Cu.getObjectPrincipal(window).originAttributes.addonId;
-}
-
-const API_LEVELS = Object.freeze({
- NO_PRIVILEGES: 0,
- CONTENTSCRIPT_PRIVILEGES: 1,
- FULL_PRIVILEGES: 2,
-});
-
-// Finds the API Level ("FULL_PRIVILEGES", "CONTENTSCRIPT_PRIVILEGES", "NO_PRIVILEGES")
-// with a given a window object.
-function getAPILevelForWindow(window, addonId) {
- const {NO_PRIVILEGES, CONTENTSCRIPT_PRIVILEGES, FULL_PRIVILEGES} = API_LEVELS;
-
- // Non WebExtension URLs and WebExtension URLs from a different extension
- // has no access to APIs.
- if (!addonId || getAddonIdForWindow(window) != addonId) {
- return NO_PRIVILEGES;
- }
-
- // Extension pages running in the content process always defaults to
- // "content script API level privileges".
- if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
- return CONTENTSCRIPT_PRIVILEGES;
- }
-
- let docShell = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell);
-
- // Handling of ExtensionPages running inside sub-frames.
- if (docShell.sameTypeParent) {
- let parentWindow = docShell.sameTypeParent.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-
- // The option page iframe embedded in the about:addons tab should have
- // full API level privileges. (see Bug 1256282 for rationale)
- let parentDocument = parentWindow.document;
- let parentIsSystemPrincipal = Services.scriptSecurityManager
- .isSystemPrincipal(parentDocument.nodePrincipal);
- if (parentDocument.location.href == "about:addons" && parentIsSystemPrincipal) {
- return FULL_PRIVILEGES;
- }
-
- // The addon iframes embedded in a addon page from with the same addonId
- // should have the same privileges of the sameTypeParent.
- // (see Bug 1258347 for rationale)
- let parentSameAddonPrivileges = getAPILevelForWindow(parentWindow, addonId);
- if (parentSameAddonPrivileges > NO_PRIVILEGES) {
- return parentSameAddonPrivileges;
- }
-
- // In all the other cases, WebExtension URLs loaded into sub-frame UI
- // will have "content script API level privileges".
- // (see Bug 1214658 for rationale)
- return CONTENTSCRIPT_PRIVILEGES;
- }
-
- // WebExtension URLs loaded into top frames UI could have full API level privileges.
- return FULL_PRIVILEGES;
-}
-
-this.ExtensionManagement = {
- startupExtension: Service.startupExtension.bind(Service),
- shutdownExtension: Service.shutdownExtension.bind(Service),
-
- registerAPI: APIs.register.bind(APIs),
- unregisterAPI: APIs.unregister.bind(APIs),
-
- getFrameId: Frames.getId.bind(Frames),
- getParentFrameId: Frames.getParentId.bind(Frames),
-
- getURLForExtension,
-
- // exported API Level Helpers
- getAddonIdForWindow,
- getAPILevelForWindow,
- API_LEVELS,
-
- APIs,
-};
diff --git a/toolkit/components/webextensions/ExtensionParent.jsm b/toolkit/components/webextensions/ExtensionParent.jsm
deleted file mode 100644
index b88500d1e3..0000000000
--- a/toolkit/components/webextensions/ExtensionParent.jsm
+++ /dev/null
@@ -1,551 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-/**
- * This module contains code for managing APIs that need to run in the
- * parent process, and handles the parent side of operations that need
- * to be proxied from ExtensionChild.jsm.
- */
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-/* exported ExtensionParent */
-
-this.EXPORTED_SYMBOLS = ["ExtensionParent"];
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
- "resource://gre/modules/MessageChannel.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NativeApp",
- "resource://gre/modules/NativeMessaging.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-var {
- BaseContext,
- SchemaAPIManager,
-} = ExtensionCommon;
-
-var {
- MessageManagerProxy,
- SpreadArgs,
- defineLazyGetter,
- findPathInObject,
-} = ExtensionUtils;
-
-const BASE_SCHEMA = "chrome://extensions/content/schemas/manifest.json";
-const CATEGORY_EXTENSION_SCHEMAS = "webextension-schemas";
-const CATEGORY_EXTENSION_SCRIPTS = "webextension-scripts";
-
-let schemaURLs = new Set();
-
-if (!AppConstants.RELEASE_OR_BETA) {
- schemaURLs.add("chrome://extensions/content/schemas/experiments.json");
-}
-
-let GlobalManager;
-let ParentAPIManager;
-let ProxyMessenger;
-
-// This object loads the ext-*.js scripts that define the extension API.
-let apiManager = new class extends SchemaAPIManager {
- constructor() {
- super("main");
- this.initialized = null;
- }
-
- // Loads all the ext-*.js scripts currently registered.
- lazyInit() {
- if (this.initialized) {
- return this.initialized;
- }
-
- // Load order matters here. The base manifest defines types which are
- // extended by other schemas, so needs to be loaded first.
- let promise = Schemas.load(BASE_SCHEMA).then(() => {
- let promises = [];
- for (let [/* name */, url] of XPCOMUtils.enumerateCategoryEntries(CATEGORY_EXTENSION_SCHEMAS)) {
- promises.push(Schemas.load(url));
- }
- for (let url of schemaURLs) {
- promises.push(Schemas.load(url));
- }
- return Promise.all(promises);
- });
-
- for (let [/* name */, value] of XPCOMUtils.enumerateCategoryEntries(CATEGORY_EXTENSION_SCRIPTS)) {
- this.loadScript(value);
- }
-
- this.initialized = promise;
- return this.initialized;
- }
-
- registerSchemaAPI(namespace, envType, getAPI) {
- if (envType == "addon_parent" || envType == "content_parent") {
- super.registerSchemaAPI(namespace, envType, getAPI);
- }
- }
-}();
-
-// Subscribes to messages related to the extension messaging API and forwards it
-// to the relevant message manager. The "sender" field for the `onMessage` and
-// `onConnect` events are updated if needed.
-ProxyMessenger = {
- _initialized: false,
- init() {
- if (this._initialized) {
- return;
- }
- this._initialized = true;
-
- // TODO(robwu): When addons move to a separate process, we should use the
- // parent process manager(s) of the addon process(es) instead of the
- // in-process one.
- let pipmm = Services.ppmm.getChildAt(0);
- // Listen on the global frame message manager because content scripts send
- // and receive extension messages via their frame.
- // Listen on the parent process message manager because `runtime.connect`
- // and `runtime.sendMessage` requests must be delivered to all frames in an
- // addon process (by the API contract).
- // And legacy addons are not associated with a frame, so that is another
- // reason for having a parent process manager here.
- let messageManagers = [Services.mm, pipmm];
-
- MessageChannel.addListener(messageManagers, "Extension:Connect", this);
- MessageChannel.addListener(messageManagers, "Extension:Message", this);
- MessageChannel.addListener(messageManagers, "Extension:Port:Disconnect", this);
- MessageChannel.addListener(messageManagers, "Extension:Port:PostMessage", this);
- },
-
- receiveMessage({target, messageName, channelId, sender, recipient, data, responseType}) {
- if (recipient.toNativeApp) {
- let {childId, toNativeApp} = recipient;
- if (messageName == "Extension:Message") {
- let context = ParentAPIManager.getContextById(childId);
- return new NativeApp(context, toNativeApp).sendMessage(data);
- }
- if (messageName == "Extension:Connect") {
- let context = ParentAPIManager.getContextById(childId);
- NativeApp.onConnectNative(context, target.messageManager, data.portId, sender, toNativeApp);
- return true;
- }
- // "Extension:Port:Disconnect" and "Extension:Port:PostMessage" for
- // native messages are handled by NativeApp.
- return;
- }
- let extension = GlobalManager.extensionMap.get(sender.extensionId);
- let receiverMM = this._getMessageManagerForRecipient(recipient);
- if (!extension || !receiverMM) {
- return Promise.reject({
- result: MessageChannel.RESULT_NO_HANDLER,
- message: "No matching message handler for the given recipient.",
- });
- }
-
- if ((messageName == "Extension:Message" ||
- messageName == "Extension:Connect") &&
- apiManager.global.tabGetSender) {
- // From ext-tabs.js, undefined on Android.
- apiManager.global.tabGetSender(extension, target, sender);
- }
- return MessageChannel.sendMessage(receiverMM, messageName, data, {
- sender,
- recipient,
- responseType,
- });
- },
-
- /**
- * @param {object} recipient An object that was passed to
- * `MessageChannel.sendMessage`.
- * @returns {object|null} The message manager matching the recipient if found.
- */
- _getMessageManagerForRecipient(recipient) {
- let {extensionId, tabId} = recipient;
- // tabs.sendMessage / tabs.connect
- if (tabId) {
- // `tabId` being set implies that the tabs API is supported, so we don't
- // need to check whether `TabManager` exists.
- let tab = apiManager.global.TabManager.getTab(tabId, null, null);
- return tab && tab.linkedBrowser.messageManager;
- }
-
- // runtime.sendMessage / runtime.connect
- if (extensionId) {
- // TODO(robwu): map the extensionId to the addon parent process's message
- // manager when they run in a separate process.
- return Services.ppmm.getChildAt(0);
- }
-
- return null;
- },
-};
-
-// Responsible for loading extension APIs into the right globals.
-GlobalManager = {
- // Map[extension ID -> Extension]. Determines which extension is
- // responsible for content under a particular extension ID.
- extensionMap: new Map(),
- initialized: false,
-
- init(extension) {
- if (this.extensionMap.size == 0) {
- ProxyMessenger.init();
- apiManager.on("extension-browser-inserted", this._onExtensionBrowser);
- this.initialized = true;
- }
-
- this.extensionMap.set(extension.id, extension);
- },
-
- uninit(extension) {
- this.extensionMap.delete(extension.id);
-
- if (this.extensionMap.size == 0 && this.initialized) {
- apiManager.off("extension-browser-inserted", this._onExtensionBrowser);
- this.initialized = false;
- }
- },
-
- _onExtensionBrowser(type, browser) {
- browser.messageManager.loadFrameScript(`data:,
- Components.utils.import("resource://gre/modules/ExtensionContent.jsm");
- ExtensionContent.init(this);
- addEventListener("unload", function() {
- ExtensionContent.uninit(this);
- });
- `, false);
- },
-
- getExtension(extensionId) {
- return this.extensionMap.get(extensionId);
- },
-
- injectInObject(context, isChromeCompat, dest) {
- apiManager.generateAPIs(context, dest);
- SchemaAPIManager.generateAPIs(context, context.extension.apis, dest);
- },
-};
-
-/**
- * The proxied parent side of a context in ExtensionChild.jsm, for the
- * parent side of a proxied API.
- */
-class ProxyContextParent extends BaseContext {
- constructor(envType, extension, params, xulBrowser, principal) {
- super(envType, extension);
-
- this.uri = NetUtil.newURI(params.url);
-
- this.incognito = params.incognito;
-
- // This message manager is used by ParentAPIManager to send messages and to
- // close the ProxyContext if the underlying message manager closes. This
- // message manager object may change when `xulBrowser` swaps docshells, e.g.
- // when a tab is moved to a different window.
- this.messageManagerProxy = new MessageManagerProxy(xulBrowser);
-
- Object.defineProperty(this, "principal", {
- value: principal, enumerable: true, configurable: true,
- });
-
- this.listenerProxies = new Map();
-
- apiManager.emit("proxy-context-load", this);
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-
- get xulBrowser() {
- return this.messageManagerProxy.eventTarget;
- }
-
- get parentMessageManager() {
- return this.messageManagerProxy.messageManager;
- }
-
- shutdown() {
- this.unload();
- }
-
- unload() {
- if (this.unloaded) {
- return;
- }
- this.messageManagerProxy.dispose();
- super.unload();
- apiManager.emit("proxy-context-unload", this);
- }
-}
-
-defineLazyGetter(ProxyContextParent.prototype, "apiObj", function() {
- let obj = {};
- GlobalManager.injectInObject(this, false, obj);
- return obj;
-});
-
-defineLazyGetter(ProxyContextParent.prototype, "sandbox", function() {
- return Cu.Sandbox(this.principal);
-});
-
-/**
- * The parent side of proxied API context for extension content script
- * running in ExtensionContent.jsm.
- */
-class ContentScriptContextParent extends ProxyContextParent {
-}
-
-/**
- * The parent side of proxied API context for extension page, such as a
- * background script, a tab page, or a popup, running in
- * ExtensionChild.jsm.
- */
-class ExtensionPageContextParent extends ProxyContextParent {
- constructor(envType, extension, params, xulBrowser) {
- super(envType, extension, params, xulBrowser, extension.principal);
-
- this.viewType = params.viewType;
- }
-
- // The window that contains this context. This may change due to moving tabs.
- get xulWindow() {
- return this.xulBrowser.ownerGlobal;
- }
-
- get windowId() {
- if (!apiManager.global.WindowManager || this.viewType == "background") {
- return;
- }
- // viewType popup or tab:
- return apiManager.global.WindowManager.getId(this.xulWindow);
- }
-
- get tabId() {
- if (!apiManager.global.TabManager) {
- return; // Not yet supported on Android.
- }
- let {gBrowser} = this.xulBrowser.ownerGlobal;
- let tab = gBrowser && gBrowser.getTabForBrowser(this.xulBrowser);
- return tab && apiManager.global.TabManager.getId(tab);
- }
-
- onBrowserChange(browser) {
- super.onBrowserChange(browser);
- this.xulBrowser = browser;
- }
-
- shutdown() {
- apiManager.emit("page-shutdown", this);
- super.shutdown();
- }
-}
-
-ParentAPIManager = {
- proxyContexts: new Map(),
-
- init() {
- Services.obs.addObserver(this, "message-manager-close", false);
-
- Services.mm.addMessageListener("API:CreateProxyContext", this);
- Services.mm.addMessageListener("API:CloseProxyContext", this, true);
- Services.mm.addMessageListener("API:Call", this);
- Services.mm.addMessageListener("API:AddListener", this);
- Services.mm.addMessageListener("API:RemoveListener", this);
- },
-
- observe(subject, topic, data) {
- if (topic === "message-manager-close") {
- let mm = subject;
- for (let [childId, context] of this.proxyContexts) {
- if (context.parentMessageManager === mm) {
- this.closeProxyContext(childId);
- }
- }
- }
- },
-
- shutdownExtension(extensionId) {
- for (let [childId, context] of this.proxyContexts) {
- if (context.extension.id == extensionId) {
- context.shutdown();
- this.proxyContexts.delete(childId);
- }
- }
- },
-
- receiveMessage({name, data, target}) {
- switch (name) {
- case "API:CreateProxyContext":
- this.createProxyContext(data, target);
- break;
-
- case "API:CloseProxyContext":
- this.closeProxyContext(data.childId);
- break;
-
- case "API:Call":
- this.call(data, target);
- break;
-
- case "API:AddListener":
- this.addListener(data, target);
- break;
-
- case "API:RemoveListener":
- this.removeListener(data);
- break;
- }
- },
-
- createProxyContext(data, target) {
- let {envType, extensionId, childId, principal} = data;
- if (this.proxyContexts.has(childId)) {
- throw new Error("A WebExtension context with the given ID already exists!");
- }
-
- let extension = GlobalManager.getExtension(extensionId);
- if (!extension) {
- throw new Error(`No WebExtension found with ID ${extensionId}`);
- }
-
- let context;
- if (envType == "addon_parent") {
- // Privileged addon contexts can only be loaded in documents whose main
- // frame is also the same addon.
- if (principal.URI.prePath !== extension.baseURI.prePath ||
- !target.contentPrincipal.subsumes(principal)) {
- throw new Error(`Refused to create privileged WebExtension context for ${principal.URI.spec}`);
- }
- context = new ExtensionPageContextParent(envType, extension, data, target);
- } else if (envType == "content_parent") {
- context = new ContentScriptContextParent(envType, extension, data, target, principal);
- } else {
- throw new Error(`Invalid WebExtension context envType: ${envType}`);
- }
- this.proxyContexts.set(childId, context);
- },
-
- closeProxyContext(childId) {
- let context = this.proxyContexts.get(childId);
- if (context) {
- context.unload();
- this.proxyContexts.delete(childId);
- }
- },
-
- call(data, target) {
- let context = this.getContextById(data.childId);
- if (context.parentMessageManager !== target.messageManager) {
- throw new Error("Got message on unexpected message manager");
- }
-
- let reply = result => {
- if (!context.parentMessageManager) {
- Cu.reportError("Cannot send function call result: other side closed connection");
- return;
- }
-
- context.parentMessageManager.sendAsyncMessage(
- "API:CallResult",
- Object.assign({
- childId: data.childId,
- callId: data.callId,
- }, result));
- };
-
- try {
- let args = Cu.cloneInto(data.args, context.sandbox);
- let result = findPathInObject(context.apiObj, data.path)(...args);
-
- if (data.callId) {
- result = result || Promise.resolve();
-
- result.then(result => {
- result = result instanceof SpreadArgs ? [...result] : [result];
-
- reply({result});
- }, error => {
- error = context.normalizeError(error);
- reply({error: {message: error.message}});
- });
- }
- } catch (e) {
- if (data.callId) {
- let error = context.normalizeError(e);
- reply({error: {message: error.message}});
- } else {
- Cu.reportError(e);
- }
- }
- },
-
- addListener(data, target) {
- let context = this.getContextById(data.childId);
- if (context.parentMessageManager !== target.messageManager) {
- throw new Error("Got message on unexpected message manager");
- }
-
- let {childId} = data;
-
- function listener(...listenerArgs) {
- return context.sendMessage(
- context.parentMessageManager,
- "API:RunListener",
- {
- childId,
- listenerId: data.listenerId,
- path: data.path,
- args: listenerArgs,
- },
- {
- recipient: {childId},
- });
- }
-
- context.listenerProxies.set(data.listenerId, listener);
-
- let args = Cu.cloneInto(data.args, context.sandbox);
- findPathInObject(context.apiObj, data.path).addListener(listener, ...args);
- },
-
- removeListener(data) {
- let context = this.getContextById(data.childId);
- let listener = context.listenerProxies.get(data.listenerId);
- findPathInObject(context.apiObj, data.path).removeListener(listener);
- },
-
- getContextById(childId) {
- let context = this.proxyContexts.get(childId);
- if (!context) {
- let error = new Error("WebExtension context not found!");
- Cu.reportError(error);
- throw error;
- }
- return context;
- },
-};
-
-ParentAPIManager.init();
-
-
-const ExtensionParent = {
- GlobalManager,
- ParentAPIManager,
- apiManager,
-};
diff --git a/toolkit/components/webextensions/ExtensionStorage.jsm b/toolkit/components/webextensions/ExtensionStorage.jsm
deleted file mode 100644
index 0b0ffb0003..0000000000
--- a/toolkit/components/webextensions/ExtensionStorage.jsm
+++ /dev/null
@@ -1,241 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionStorage"];
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
- "resource://gre/modules/AsyncShutdown.jsm");
-
-function jsonReplacer(key, value) {
- switch (typeof(value)) {
- // Serialize primitive types as-is.
- case "string":
- case "number":
- case "boolean":
- return value;
-
- case "object":
- if (value === null) {
- return value;
- }
-
- switch (Cu.getClassName(value, true)) {
- // Serialize arrays and ordinary objects as-is.
- case "Array":
- case "Object":
- return value;
-
- // Serialize Date objects and regular expressions as their
- // string representations.
- case "Date":
- case "RegExp":
- return String(value);
- }
- break;
- }
-
- if (!key) {
- // If this is the root object, and we can't serialize it, serialize
- // the value to an empty object.
- return {};
- }
-
- // Everything else, omit entirely.
- return undefined;
-}
-
-this.ExtensionStorage = {
- cache: new Map(),
- listeners: new Map(),
-
- /**
- * Sanitizes the given value, and returns a JSON-compatible
- * representation of it, based on the privileges of the given global.
- *
- * @param {value} value
- * The value to sanitize.
- * @param {Context} context
- * The extension context in which to sanitize the value
- * @returns {value}
- * The sanitized value.
- */
- sanitize(value, context) {
- let json = context.jsonStringify(value, jsonReplacer);
- return JSON.parse(json);
- },
-
- getExtensionDir(extensionId) {
- return OS.Path.join(this.extensionDir, extensionId);
- },
-
- getStorageFile(extensionId) {
- return OS.Path.join(this.extensionDir, extensionId, "storage.js");
- },
-
- read(extensionId) {
- if (this.cache.has(extensionId)) {
- return this.cache.get(extensionId);
- }
-
- let path = this.getStorageFile(extensionId);
- let decoder = new TextDecoder();
- let promise = OS.File.read(path);
- promise = promise.then(array => {
- return JSON.parse(decoder.decode(array));
- }).catch((error) => {
- if (!error.becauseNoSuchFile) {
- Cu.reportError("Unable to parse JSON data for extension storage.");
- }
- return {};
- });
- this.cache.set(extensionId, promise);
- return promise;
- },
-
- write(extensionId) {
- let promise = this.read(extensionId).then(extData => {
- let encoder = new TextEncoder();
- let array = encoder.encode(JSON.stringify(extData));
- let path = this.getStorageFile(extensionId);
- OS.File.makeDir(this.getExtensionDir(extensionId), {
- ignoreExisting: true,
- from: OS.Constants.Path.profileDir,
- });
- let promise = OS.File.writeAtomic(path, array);
- return promise;
- }).catch(() => {
- // Make sure this promise is never rejected.
- Cu.reportError("Unable to write JSON data for extension storage.");
- });
-
- AsyncShutdown.profileBeforeChange.addBlocker(
- "ExtensionStorage: Finish writing extension data",
- promise);
-
- return promise.then(() => {
- AsyncShutdown.profileBeforeChange.removeBlocker(promise);
- });
- },
-
- set(extensionId, items, context) {
- return this.read(extensionId).then(extData => {
- let changes = {};
- for (let prop in items) {
- let item = this.sanitize(items[prop], context);
- changes[prop] = {oldValue: extData[prop], newValue: item};
- extData[prop] = item;
- }
-
- this.notifyListeners(extensionId, changes);
-
- return this.write(extensionId);
- });
- },
-
- remove(extensionId, items) {
- return this.read(extensionId).then(extData => {
- let changes = {};
- for (let prop of [].concat(items)) {
- changes[prop] = {oldValue: extData[prop]};
- delete extData[prop];
- }
-
- this.notifyListeners(extensionId, changes);
-
- return this.write(extensionId);
- });
- },
-
- clear(extensionId) {
- return this.read(extensionId).then(extData => {
- let changes = {};
- for (let prop of Object.keys(extData)) {
- changes[prop] = {oldValue: extData[prop]};
- delete extData[prop];
- }
-
- this.notifyListeners(extensionId, changes);
-
- return this.write(extensionId);
- });
- },
-
- get(extensionId, keys) {
- return this.read(extensionId).then(extData => {
- let result = {};
- if (keys === null) {
- Object.assign(result, extData);
- } else if (typeof(keys) == "object" && !Array.isArray(keys)) {
- for (let prop in keys) {
- if (prop in extData) {
- result[prop] = extData[prop];
- } else {
- result[prop] = keys[prop];
- }
- }
- } else {
- for (let prop of [].concat(keys)) {
- if (prop in extData) {
- result[prop] = extData[prop];
- }
- }
- }
-
- return result;
- });
- },
-
- addOnChangedListener(extensionId, listener) {
- let listeners = this.listeners.get(extensionId) || new Set();
- listeners.add(listener);
- this.listeners.set(extensionId, listeners);
- },
-
- removeOnChangedListener(extensionId, listener) {
- let listeners = this.listeners.get(extensionId);
- listeners.delete(listener);
- },
-
- notifyListeners(extensionId, changes) {
- let listeners = this.listeners.get(extensionId);
- if (listeners) {
- for (let listener of listeners) {
- listener(changes);
- }
- }
- },
-
- init() {
- if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_DEFAULT) {
- return;
- }
- Services.obs.addObserver(this, "extension-invalidate-storage-cache", false);
- Services.obs.addObserver(this, "xpcom-shutdown", false);
- },
-
- observe(subject, topic, data) {
- if (topic == "xpcom-shutdown") {
- Services.obs.removeObserver(this, "extension-invalidate-storage-cache");
- Services.obs.removeObserver(this, "xpcom-shutdown");
- } else if (topic == "extension-invalidate-storage-cache") {
- this.cache.clear();
- }
- },
-};
-
-XPCOMUtils.defineLazyGetter(ExtensionStorage, "extensionDir",
- () => OS.Path.join(OS.Constants.Path.profileDir, "browser-extension-data"));
-
-ExtensionStorage.init();
diff --git a/toolkit/components/webextensions/ExtensionTestCommon.jsm b/toolkit/components/webextensions/ExtensionTestCommon.jsm
deleted file mode 100644
index 02453ddfd4..0000000000
--- a/toolkit/components/webextensions/ExtensionTestCommon.jsm
+++ /dev/null
@@ -1,343 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-/**
- * This module contains extension testing helper logic which is common
- * between all test suites.
- */
-
-/* exported ExtensionTestCommon, MockExtension */
-
-this.EXPORTED_SYMBOLS = ["ExtensionTestCommon", "MockExtension"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.importGlobalProperties(["TextEncoder"]);
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Extension",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionParent",
- "resource://gre/modules/ExtensionParent.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "apiManager",
- () => ExtensionParent.apiManager);
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "uuidGen",
- "@mozilla.org/uuid-generator;1",
- "nsIUUIDGenerator");
-
-const {
- flushJarCache,
- instanceOf,
-} = ExtensionUtils;
-
-XPCOMUtils.defineLazyGetter(this, "console", ExtensionUtils.getConsole);
-
-
-/**
- * A skeleton Extension-like object, used for testing, which installs an
- * add-on via the add-on manager when startup() is called, and
- * uninstalles it on shutdown().
- *
- * @param {string} id
- * @param {nsIFile} file
- * @param {nsIURI} rootURI
- * @param {string} installType
- */
-class MockExtension {
- constructor(file, rootURI, installType) {
- this.id = null;
- this.file = file;
- this.rootURI = rootURI;
- this.installType = installType;
- this.addon = null;
-
- let promiseEvent = eventName => new Promise(resolve => {
- let onstartup = (msg, extension) => {
- if (this.addon && extension.id == this.addon.id) {
- apiManager.off(eventName, onstartup);
-
- this.id = extension.id;
- this._extension = extension;
- resolve(extension);
- }
- };
- apiManager.on(eventName, onstartup);
- });
-
- this._extension = null;
- this._extensionPromise = promiseEvent("startup");
- this._readyPromise = promiseEvent("ready");
- }
-
- testMessage(...args) {
- return this._extension.testMessage(...args);
- }
-
- on(...args) {
- this._extensionPromise.then(extension => {
- extension.on(...args);
- });
- }
-
- off(...args) {
- this._extensionPromise.then(extension => {
- extension.off(...args);
- });
- }
-
- startup() {
- if (this.installType == "temporary") {
- return AddonManager.installTemporaryAddon(this.file).then(addon => {
- this.addon = addon;
- return this._readyPromise;
- });
- } else if (this.installType == "permanent") {
- return new Promise((resolve, reject) => {
- AddonManager.getInstallForFile(this.file, install => {
- let listener = {
- onInstallFailed: reject,
- onInstallEnded: (install, newAddon) => {
- this.addon = newAddon;
- resolve(this._readyPromise);
- },
- };
-
- install.addListener(listener);
- install.install();
- });
- });
- }
- throw new Error("installType must be one of: temporary, permanent");
- }
-
- shutdown() {
- this.addon.uninstall();
- return this.cleanupGeneratedFile();
- }
-
- cleanupGeneratedFile() {
- flushJarCache(this.file);
- return OS.File.remove(this.file.path);
- }
-}
-
-class ExtensionTestCommon {
- /**
- * This code is designed to make it easy to test a WebExtension
- * without creating a bunch of files. Everything is contained in a
- * single JSON blob.
- *
- * Properties:
- * "background": "<JS code>"
- * A script to be loaded as the background script.
- * The "background" section of the "manifest" property is overwritten
- * if this is provided.
- * "manifest": {...}
- * Contents of manifest.json
- * "files": {"filename1": "contents1", ...}
- * Data to be included as files. Can be referenced from the manifest.
- * If a manifest file is provided here, it takes precedence over
- * a generated one. Always use "/" as a directory separator.
- * Directories should appear here only implicitly (as a prefix
- * to file names)
- *
- * To make things easier, the value of "background" and "files"[] can
- * be a function, which is converted to source that is run.
- *
- * The generated extension is stored in the system temporary directory,
- * and an nsIFile object pointing to it is returned.
- *
- * @param {object} data
- * @returns {nsIFile}
- */
- static generateXPI(data) {
- let manifest = data.manifest;
- if (!manifest) {
- manifest = {};
- }
-
- let files = data.files;
- if (!files) {
- files = {};
- }
-
- function provide(obj, keys, value, override = false) {
- if (keys.length == 1) {
- if (!(keys[0] in obj) || override) {
- obj[keys[0]] = value;
- }
- } else {
- if (!(keys[0] in obj)) {
- obj[keys[0]] = {};
- }
- provide(obj[keys[0]], keys.slice(1), value, override);
- }
- }
-
- provide(manifest, ["name"], "Generated extension");
- provide(manifest, ["manifest_version"], 2);
- provide(manifest, ["version"], "1.0");
-
- if (data.background) {
- let bgScript = uuidGen.generateUUID().number + ".js";
-
- provide(manifest, ["background", "scripts"], [bgScript], true);
- files[bgScript] = data.background;
- }
-
- provide(files, ["manifest.json"], manifest);
-
- if (data.embedded) {
- // Package this as a webextension embedded inside a legacy
- // extension.
-
- let xpiFiles = {
- "install.rdf": `<?xml version="1.0" encoding="UTF-8"?>
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest"
- em:id="${manifest.applications.gecko.id}"
- em:name="${manifest.name}"
- em:type="2"
- em:version="${manifest.version}"
- em:description=""
- em:hasEmbeddedWebExtension="true"
- em:bootstrap="true">
-
- <!-- Firefox -->
- <em:targetApplication>
- <Description
- em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
- em:minVersion="51.0a1"
- em:maxVersion="*"/>
- </em:targetApplication>
- </Description>
- </RDF>
- `,
-
- "bootstrap.js": `
- function install() {}
- function uninstall() {}
- function shutdown() {}
-
- function startup(data) {
- data.webExtension.startup();
- }
- `,
- };
-
- for (let [path, data] of Object.entries(files)) {
- xpiFiles[`webextension/${path}`] = data;
- }
-
- files = xpiFiles;
- }
-
- return this.generateZipFile(files);
- }
-
- static generateZipFile(files, baseName = "generated-extension.xpi") {
- let ZipWriter = Components.Constructor("@mozilla.org/zipwriter;1", "nsIZipWriter");
- let zipW = new ZipWriter();
-
- let file = FileUtils.getFile("TmpD", [baseName]);
- file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
-
- const MODE_WRONLY = 0x02;
- const MODE_TRUNCATE = 0x20;
- zipW.open(file, MODE_WRONLY | MODE_TRUNCATE);
-
- // Needs to be in microseconds for some reason.
- let time = Date.now() * 1000;
-
- function generateFile(filename) {
- let components = filename.split("/");
- let path = "";
- for (let component of components.slice(0, -1)) {
- path += component + "/";
- if (!zipW.hasEntry(path)) {
- zipW.addEntryDirectory(path, time, false);
- }
- }
- }
-
- for (let filename in files) {
- let script = files[filename];
- if (typeof(script) == "function") {
- script = "(" + script.toString() + ")()";
- } else if (instanceOf(script, "Object") || instanceOf(script, "Array")) {
- script = JSON.stringify(script);
- }
-
- if (!instanceOf(script, "ArrayBuffer")) {
- script = new TextEncoder("utf-8").encode(script).buffer;
- }
-
- let stream = Cc["@mozilla.org/io/arraybuffer-input-stream;1"].createInstance(Ci.nsIArrayBufferInputStream);
- stream.setData(script, 0, script.byteLength);
-
- generateFile(filename);
- zipW.addEntryStream(filename, time, 0, stream, false);
- }
-
- zipW.close();
-
- return file;
- }
-
- /**
- * Generates a new extension using |Extension.generateXPI|, and initializes a
- * new |Extension| instance which will execute it.
- *
- * @param {object} data
- * @returns {Extension}
- */
- static generate(data) {
- let file = this.generateXPI(data);
-
- flushJarCache(file);
- Services.ppmm.broadcastAsyncMessage("Extension:FlushJarCache", {path: file.path});
-
- let fileURI = Services.io.newFileURI(file);
- let jarURI = Services.io.newURI("jar:" + fileURI.spec + "!/", null, null);
-
- // This may be "temporary" or "permanent".
- if (data.useAddonManager) {
- return new MockExtension(file, jarURI, data.useAddonManager);
- }
-
- let id;
- if (data.manifest) {
- if (data.manifest.applications && data.manifest.applications.gecko) {
- id = data.manifest.applications.gecko.id;
- } else if (data.manifest.browser_specific_settings && data.manifest.browser_specific_settings.gecko) {
- id = data.manifest.browser_specific_settings.gecko.id;
- }
- }
- if (!id) {
- id = uuidGen.generateUUID().number;
- }
-
- return new Extension({
- id,
- resourceURI: jarURI,
- cleanupFile: file,
- });
- }
-}
diff --git a/toolkit/components/webextensions/ExtensionUtils.jsm b/toolkit/components/webextensions/ExtensionUtils.jsm
deleted file mode 100644
index 04e767cb5c..0000000000
--- a/toolkit/components/webextensions/ExtensionUtils.jsm
+++ /dev/null
@@ -1,1216 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionUtils"];
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-const INTEGER = /^[1-9]\d*$/;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ConsoleAPI",
- "resource://gre/modules/Console.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LanguageDetector",
- "resource:///modules/translation/LanguageDetector.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Locale",
- "resource://gre/modules/Locale.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MessageChannel",
- "resource://gre/modules/MessageChannel.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
- "resource://gre/modules/Preferences.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "styleSheetService",
- "@mozilla.org/content/style-sheet-service;1",
- "nsIStyleSheetService");
-
-function getConsole() {
- return new ConsoleAPI({
- maxLogLevelPref: "extensions.webextensions.log.level",
- prefix: "WebExtensions",
- });
-}
-
-XPCOMUtils.defineLazyGetter(this, "console", getConsole);
-
-let nextId = 0;
-const {uniqueProcessID} = Services.appinfo;
-
-function getUniqueId() {
- return `${nextId++}-${uniqueProcessID}`;
-}
-
-/**
- * An Error subclass for which complete error messages are always passed
- * to extensions, rather than being interpreted as an unknown error.
- */
-class ExtensionError extends Error {}
-
-function filterStack(error) {
- return String(error.stack).replace(/(^.*(Task\.jsm|Promise-backend\.js).*\n)+/gm, "<Promise Chain>\n");
-}
-
-// Run a function and report exceptions.
-function runSafeSyncWithoutClone(f, ...args) {
- try {
- return f(...args);
- } catch (e) {
- dump(`Extension error: ${e} ${e.fileName} ${e.lineNumber}\n[[Exception stack\n${filterStack(e)}Current stack\n${filterStack(Error())}]]\n`);
- Cu.reportError(e);
- }
-}
-
-// Run a function and report exceptions.
-function runSafeWithoutClone(f, ...args) {
- if (typeof(f) != "function") {
- dump(`Extension error: expected function\n${filterStack(Error())}`);
- return;
- }
-
- Promise.resolve().then(() => {
- runSafeSyncWithoutClone(f, ...args);
- });
-}
-
-// Run a function, cloning arguments into context.cloneScope, and
-// report exceptions. |f| is expected to be in context.cloneScope.
-function runSafeSync(context, f, ...args) {
- if (context.unloaded) {
- Cu.reportError("runSafeSync called after context unloaded");
- return;
- }
-
- try {
- args = Cu.cloneInto(args, context.cloneScope);
- } catch (e) {
- Cu.reportError(e);
- dump(`runSafe failure: cloning into ${context.cloneScope}: ${e}\n\n${filterStack(Error())}`);
- }
- return runSafeSyncWithoutClone(f, ...args);
-}
-
-// Run a function, cloning arguments into context.cloneScope, and
-// report exceptions. |f| is expected to be in context.cloneScope.
-function runSafe(context, f, ...args) {
- try {
- args = Cu.cloneInto(args, context.cloneScope);
- } catch (e) {
- Cu.reportError(e);
- dump(`runSafe failure: cloning into ${context.cloneScope}: ${e}\n\n${filterStack(Error())}`);
- }
- if (context.unloaded) {
- dump(`runSafe failure: context is already unloaded ${filterStack(new Error())}\n`);
- return undefined;
- }
- return runSafeWithoutClone(f, ...args);
-}
-
-function getInnerWindowID(window) {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .currentInnerWindowID;
-}
-
-// Return true if the given value is an instance of the given
-// native type.
-function instanceOf(value, type) {
- return {}.toString.call(value) == `[object ${type}]`;
-}
-
-// Extend the object |obj| with the property descriptors of each object in
-// |args|.
-function extend(obj, ...args) {
- for (let arg of args) {
- let props = [...Object.getOwnPropertyNames(arg),
- ...Object.getOwnPropertySymbols(arg)];
- for (let prop of props) {
- let descriptor = Object.getOwnPropertyDescriptor(arg, prop);
- Object.defineProperty(obj, prop, descriptor);
- }
- }
-
- return obj;
-}
-
-/**
- * Similar to a WeakMap, but creates a new key with the given
- * constructor if one is not present.
- */
-class DefaultWeakMap extends WeakMap {
- constructor(defaultConstructor, init) {
- super(init);
- this.defaultConstructor = defaultConstructor;
- }
-
- get(key) {
- if (!this.has(key)) {
- this.set(key, this.defaultConstructor(key));
- }
- return super.get(key);
- }
-}
-
-class DefaultMap extends Map {
- constructor(defaultConstructor, init) {
- super(init);
- this.defaultConstructor = defaultConstructor;
- }
-
- get(key) {
- if (!this.has(key)) {
- this.set(key, this.defaultConstructor(key));
- }
- return super.get(key);
- }
-}
-
-class SpreadArgs extends Array {
- constructor(args) {
- super();
- this.push(...args);
- }
-}
-
-// Manages icon details for toolbar buttons in the |pageAction| and
-// |browserAction| APIs.
-let IconDetails = {
- // Normalizes the various acceptable input formats into an object
- // with icon size as key and icon URL as value.
- //
- // If a context is specified (function is called from an extension):
- // Throws an error if an invalid icon size was provided or the
- // extension is not allowed to load the specified resources.
- //
- // If no context is specified, instead of throwing an error, this
- // function simply logs a warning message.
- normalize(details, extension, context = null) {
- let result = {};
-
- try {
- if (details.imageData) {
- let imageData = details.imageData;
-
- if (typeof imageData == "string") {
- imageData = {"19": imageData};
- }
-
- for (let size of Object.keys(imageData)) {
- if (!INTEGER.test(size)) {
- throw new ExtensionError(`Invalid icon size ${size}, must be an integer`);
- }
- result[size] = imageData[size];
- }
- }
-
- if (details.path) {
- let path = details.path;
- if (typeof path != "object") {
- path = {"19": path};
- }
-
- let baseURI = context ? context.uri : extension.baseURI;
-
- for (let size of Object.keys(path)) {
- if (!INTEGER.test(size)) {
- throw new ExtensionError(`Invalid icon size ${size}, must be an integer`);
- }
-
- let url = baseURI.resolve(path[size]);
-
- // The Chrome documentation specifies these parameters as
- // relative paths. We currently accept absolute URLs as well,
- // which means we need to check that the extension is allowed
- // to load them. This will throw an error if it's not allowed.
- try {
- Services.scriptSecurityManager.checkLoadURIStrWithPrincipal(
- extension.principal, url,
- Services.scriptSecurityManager.DISALLOW_SCRIPT);
- } catch (e) {
- throw new ExtensionError(`Illegal URL ${url}`);
- }
-
- result[size] = url;
- }
- }
- } catch (e) {
- // Function is called from extension code, delegate error.
- if (context) {
- throw e;
- }
- // If there's no context, it's because we're handling this
- // as a manifest directive. Log a warning rather than
- // raising an error.
- extension.manifestError(`Invalid icon data: ${e}`);
- }
-
- return result;
- },
-
- // Returns the appropriate icon URL for the given icons object and the
- // screen resolution of the given window.
- getPreferredIcon(icons, extension = null, size = 16) {
- const DEFAULT = "chrome://browser/content/extension.svg";
-
- let bestSize = null;
- if (icons[size]) {
- bestSize = size;
- } else if (icons[2 * size]) {
- bestSize = 2 * size;
- } else {
- let sizes = Object.keys(icons)
- .map(key => parseInt(key, 10))
- .sort((a, b) => a - b);
-
- bestSize = sizes.find(candidate => candidate > size) || sizes.pop();
- }
-
- if (bestSize) {
- return {size: bestSize, icon: icons[bestSize]};
- }
-
- return {size, icon: DEFAULT};
- },
-
- convertImageURLToDataURL(imageURL, contentWindow, browserWindow, size = 18) {
- return new Promise((resolve, reject) => {
- let image = new contentWindow.Image();
- image.onload = function() {
- let canvas = contentWindow.document.createElement("canvas");
- let ctx = canvas.getContext("2d");
- let dSize = size * browserWindow.devicePixelRatio;
-
- // Scales the image while maintaing width to height ratio.
- // If the width and height differ, the image is centered using the
- // smaller of the two dimensions.
- let dWidth, dHeight, dx, dy;
- if (this.width > this.height) {
- dWidth = dSize;
- dHeight = image.height * (dSize / image.width);
- dx = 0;
- dy = (dSize - dHeight) / 2;
- } else {
- dWidth = image.width * (dSize / image.height);
- dHeight = dSize;
- dx = (dSize - dWidth) / 2;
- dy = 0;
- }
-
- ctx.drawImage(this, 0, 0, this.width, this.height, dx, dy, dWidth, dHeight);
- resolve(canvas.toDataURL("image/png"));
- };
- image.onerror = reject;
- image.src = imageURL;
- });
- },
-};
-
-const LISTENERS = Symbol("listeners");
-
-class EventEmitter {
- constructor() {
- this[LISTENERS] = new Map();
- }
-
- /**
- * Adds the given function as a listener for the given event.
- *
- * The listener function may optionally return a Promise which
- * resolves when it has completed all operations which event
- * dispatchers may need to block on.
- *
- * @param {string} event
- * The name of the event to listen for.
- * @param {function(string, ...any)} listener
- * The listener to call when events are emitted.
- */
- on(event, listener) {
- if (!this[LISTENERS].has(event)) {
- this[LISTENERS].set(event, new Set());
- }
-
- this[LISTENERS].get(event).add(listener);
- }
-
- /**
- * Removes the given function as a listener for the given event.
- *
- * @param {string} event
- * The name of the event to stop listening for.
- * @param {function(string, ...any)} listener
- * The listener function to remove.
- */
- off(event, listener) {
- if (this[LISTENERS].has(event)) {
- let set = this[LISTENERS].get(event);
-
- set.delete(listener);
- if (!set.size) {
- this[LISTENERS].delete(event);
- }
- }
- }
-
- /**
- * Triggers all listeners for the given event, and returns a promise
- * which resolves when all listeners have been called, and any
- * promises they have returned have likewise resolved.
- *
- * @param {string} event
- * The name of the event to emit.
- * @param {any} args
- * Arbitrary arguments to pass to the listener functions, after
- * the event name.
- * @returns {Promise}
- */
- emit(event, ...args) {
- let listeners = this[LISTENERS].get(event) || new Set();
-
- let promises = Array.from(listeners, listener => {
- return runSafeSyncWithoutClone(listener, event, ...args);
- });
-
- return Promise.all(promises);
- }
-}
-
-function LocaleData(data) {
- this.defaultLocale = data.defaultLocale;
- this.selectedLocale = data.selectedLocale;
- this.locales = data.locales || new Map();
- this.warnedMissingKeys = new Set();
-
- // Map(locale-name -> Map(message-key -> localized-string))
- //
- // Contains a key for each loaded locale, each of which is a
- // Map of message keys to their localized strings.
- this.messages = data.messages || new Map();
-
- if (data.builtinMessages) {
- this.messages.set(this.BUILTIN, data.builtinMessages);
- }
-}
-
-
-LocaleData.prototype = {
- // Representation of the object to send to content processes. This
- // should include anything the content process might need.
- serialize() {
- return {
- defaultLocale: this.defaultLocale,
- selectedLocale: this.selectedLocale,
- messages: this.messages,
- locales: this.locales,
- };
- },
-
- BUILTIN: "@@BUILTIN_MESSAGES",
-
- has(locale) {
- return this.messages.has(locale);
- },
-
- // https://developer.chrome.com/extensions/i18n
- localizeMessage(message, substitutions = [], options = {}) {
- let defaultOptions = {
- locale: this.selectedLocale,
- defaultValue: "",
- cloneScope: null,
- };
-
- options = Object.assign(defaultOptions, options);
-
- let locales = new Set([this.BUILTIN, options.locale, this.defaultLocale]
- .filter(locale => this.messages.has(locale)));
-
- // Message names are case-insensitive, so normalize them to lower-case.
- message = message.toLowerCase();
- for (let locale of locales) {
- let messages = this.messages.get(locale);
- if (messages.has(message)) {
- let str = messages.get(message);
-
- if (!Array.isArray(substitutions)) {
- substitutions = [substitutions];
- }
-
- let replacer = (matched, index, dollarSigns) => {
- if (index) {
- // This is not quite Chrome-compatible. Chrome consumes any number
- // of digits following the $, but only accepts 9 substitutions. We
- // accept any number of substitutions.
- index = parseInt(index, 10) - 1;
- return index in substitutions ? substitutions[index] : "";
- }
- // For any series of contiguous `$`s, the first is dropped, and
- // the rest remain in the output string.
- return dollarSigns;
- };
- return str.replace(/\$(?:([1-9]\d*)|(\$+))/g, replacer);
- }
- }
-
- // Check for certain pre-defined messages.
- if (message == "@@ui_locale") {
- return this.uiLocale;
- } else if (message.startsWith("@@bidi_")) {
- let registry = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry);
- let rtl = registry.isLocaleRTL("global");
-
- if (message == "@@bidi_dir") {
- return rtl ? "rtl" : "ltr";
- } else if (message == "@@bidi_reversed_dir") {
- return rtl ? "ltr" : "rtl";
- } else if (message == "@@bidi_start_edge") {
- return rtl ? "right" : "left";
- } else if (message == "@@bidi_end_edge") {
- return rtl ? "left" : "right";
- }
- }
-
- if (!this.warnedMissingKeys.has(message)) {
- let error = `Unknown localization message ${message}`;
- if (options.cloneScope) {
- error = new options.cloneScope.Error(error);
- }
- Cu.reportError(error);
- this.warnedMissingKeys.add(message);
- }
- return options.defaultValue;
- },
-
- // Localize a string, replacing all |__MSG_(.*)__| tokens with the
- // matching string from the current locale, as determined by
- // |this.selectedLocale|.
- //
- // This may not be called before calling either |initLocale| or
- // |initAllLocales|.
- localize(str, locale = this.selectedLocale) {
- if (!str) {
- return str;
- }
-
- return str.replace(/__MSG_([A-Za-z0-9@_]+?)__/g, (matched, message) => {
- return this.localizeMessage(message, [], {locale, defaultValue: matched});
- });
- },
-
- // Validates the contents of a locale JSON file, normalizes the
- // messages into a Map of message key -> localized string pairs.
- addLocale(locale, messages, extension) {
- let result = new Map();
-
- // Chrome does not document the semantics of its localization
- // system very well. It handles replacements by pre-processing
- // messages, replacing |$[a-zA-Z0-9@_]+$| tokens with the value of their
- // replacements. Later, it processes the resulting string for
- // |$[0-9]| replacements.
- //
- // Again, it does not document this, but it accepts any number
- // of sequential |$|s, and replaces them with that number minus
- // 1. It also accepts |$| followed by any number of sequential
- // digits, but refuses to process a localized string which
- // provides more than 9 substitutions.
- if (!instanceOf(messages, "Object")) {
- extension.packagingError(`Invalid locale data for ${locale}`);
- return result;
- }
-
- for (let key of Object.keys(messages)) {
- let msg = messages[key];
-
- if (!instanceOf(msg, "Object") || typeof(msg.message) != "string") {
- extension.packagingError(`Invalid locale message data for ${locale}, message ${JSON.stringify(key)}`);
- continue;
- }
-
- // Substitutions are case-insensitive, so normalize all of their names
- // to lower-case.
- let placeholders = new Map();
- if (instanceOf(msg.placeholders, "Object")) {
- for (let key of Object.keys(msg.placeholders)) {
- placeholders.set(key.toLowerCase(), msg.placeholders[key]);
- }
- }
-
- let replacer = (match, name) => {
- let replacement = placeholders.get(name.toLowerCase());
- if (instanceOf(replacement, "Object") && "content" in replacement) {
- return replacement.content;
- }
- return "";
- };
-
- let value = msg.message.replace(/\$([A-Za-z0-9@_]+)\$/g, replacer);
-
- // Message names are also case-insensitive, so normalize them to lower-case.
- result.set(key.toLowerCase(), value);
- }
-
- this.messages.set(locale, result);
- return result;
- },
-
- get acceptLanguages() {
- let result = Preferences.get("intl.accept_languages", "", Ci.nsIPrefLocalizedString);
- return result.split(/\s*,\s*/g);
- },
-
-
- get uiLocale() {
- // Return the browser locale, but convert it to a Chrome-style
- // locale code.
- return Locale.getLocale().replace(/-/g, "_");
- },
-};
-
-// This is a generic class for managing event listeners. Example usage:
-//
-// new EventManager(context, "api.subAPI", fire => {
-// let listener = (...) => {
-// // Fire any listeners registered with addListener.
-// fire(arg1, arg2);
-// };
-// // Register the listener.
-// SomehowRegisterListener(listener);
-// return () => {
-// // Return a way to unregister the listener.
-// SomehowUnregisterListener(listener);
-// };
-// }).api()
-//
-// The result is an object with addListener, removeListener, and
-// hasListener methods. |context| is an add-on scope (either an
-// ExtensionContext in the chrome process or ExtensionContext in a
-// content process). |name| is for debugging. |register| is a function
-// to register the listener. |register| is only called once, even if
-// multiple listeners are registered. |register| should return an
-// unregister function that will unregister the listener.
-function EventManager(context, name, register) {
- this.context = context;
- this.name = name;
- this.register = register;
- this.unregister = null;
- this.callbacks = new Set();
-}
-
-EventManager.prototype = {
- addListener(callback) {
- if (typeof(callback) != "function") {
- dump(`Expected function\n${Error().stack}`);
- return;
- }
- if (this.context.unloaded) {
- dump(`Cannot add listener to ${this.name} after context unloaded`);
- return;
- }
-
- if (!this.callbacks.size) {
- this.context.callOnClose(this);
-
- let fireFunc = this.fire.bind(this);
- let fireWithoutClone = this.fireWithoutClone.bind(this);
- fireFunc.withoutClone = fireWithoutClone;
- this.unregister = this.register(fireFunc);
- }
- this.callbacks.add(callback);
- },
-
- removeListener(callback) {
- if (!this.callbacks.size) {
- return;
- }
-
- this.callbacks.delete(callback);
- if (this.callbacks.size == 0) {
- this.unregister();
- this.unregister = null;
-
- this.context.forgetOnClose(this);
- }
- },
-
- hasListener(callback) {
- return this.callbacks.has(callback);
- },
-
- fire(...args) {
- this._fireCommon("runSafe", args);
- },
-
- fireWithoutClone(...args) {
- this._fireCommon("runSafeWithoutClone", args);
- },
-
- _fireCommon(runSafeMethod, args) {
- for (let callback of this.callbacks) {
- Promise.resolve(callback).then(callback => {
- if (this.context.unloaded) {
- dump(`${this.name} event fired after context unloaded.\n`);
- } else if (!this.context.active) {
- dump(`${this.name} event fired while context is inactive.\n`);
- } else if (this.callbacks.has(callback)) {
- this.context[runSafeMethod](callback, ...args);
- }
- });
- }
- },
-
- close() {
- if (this.callbacks.size) {
- this.unregister();
- }
- this.callbacks.clear();
- this.register = null;
- this.unregister = null;
- },
-
- api() {
- return {
- addListener: callback => this.addListener(callback),
- removeListener: callback => this.removeListener(callback),
- hasListener: callback => this.hasListener(callback),
- };
- },
-};
-
-// Similar to EventManager, but it doesn't try to consolidate event
-// notifications. Each addListener call causes us to register once. It
-// allows extra arguments to be passed to addListener.
-function SingletonEventManager(context, name, register) {
- this.context = context;
- this.name = name;
- this.register = register;
- this.unregister = new Map();
-}
-
-SingletonEventManager.prototype = {
- addListener(callback, ...args) {
- let wrappedCallback = (...args) => {
- if (this.context.unloaded) {
- dump(`${this.name} event fired after context unloaded.\n`);
- } else if (this.unregister.has(callback)) {
- return callback(...args);
- }
- };
-
- let unregister = this.register(wrappedCallback, ...args);
- this.unregister.set(callback, unregister);
- this.context.callOnClose(this);
- },
-
- removeListener(callback) {
- if (!this.unregister.has(callback)) {
- return;
- }
-
- let unregister = this.unregister.get(callback);
- this.unregister.delete(callback);
- unregister();
- },
-
- hasListener(callback) {
- return this.unregister.has(callback);
- },
-
- close() {
- for (let unregister of this.unregister.values()) {
- unregister();
- }
- },
-
- api() {
- return {
- addListener: (...args) => this.addListener(...args),
- removeListener: (...args) => this.removeListener(...args),
- hasListener: (...args) => this.hasListener(...args),
- };
- },
-};
-
-// Simple API for event listeners where events never fire.
-function ignoreEvent(context, name) {
- return {
- addListener: function(callback) {
- let id = context.extension.id;
- let frame = Components.stack.caller;
- let msg = `In add-on ${id}, attempting to use listener "${name}", which is unimplemented.`;
- let scriptError = Cc["@mozilla.org/scripterror;1"]
- .createInstance(Ci.nsIScriptError);
- scriptError.init(msg, frame.filename, null, frame.lineNumber,
- frame.columnNumber, Ci.nsIScriptError.warningFlag,
- "content javascript");
- let consoleService = Cc["@mozilla.org/consoleservice;1"]
- .getService(Ci.nsIConsoleService);
- consoleService.logMessage(scriptError);
- },
- removeListener: function(callback) {},
- hasListener: function(callback) {},
- };
-}
-
-// Copy an API object from |source| into the scope |dest|.
-function injectAPI(source, dest) {
- for (let prop in source) {
- // Skip names prefixed with '_'.
- if (prop[0] == "_") {
- continue;
- }
-
- let desc = Object.getOwnPropertyDescriptor(source, prop);
- if (typeof(desc.value) == "function") {
- Cu.exportFunction(desc.value, dest, {defineAs: prop});
- } else if (typeof(desc.value) == "object") {
- let obj = Cu.createObjectIn(dest, {defineAs: prop});
- injectAPI(desc.value, obj);
- } else {
- Object.defineProperty(dest, prop, desc);
- }
- }
-}
-
-/**
- * Returns a Promise which resolves when the given document's DOM has
- * fully loaded.
- *
- * @param {Document} doc The document to await the load of.
- * @returns {Promise<Document>}
- */
-function promiseDocumentReady(doc) {
- if (doc.readyState == "interactive" || doc.readyState == "complete") {
- return Promise.resolve(doc);
- }
-
- return new Promise(resolve => {
- doc.addEventListener("DOMContentLoaded", function onReady(event) {
- if (event.target === event.currentTarget) {
- doc.removeEventListener("DOMContentLoaded", onReady, true);
- resolve(doc);
- }
- }, true);
- });
-}
-
-/**
- * Returns a Promise which resolves when the given document is fully
- * loaded.
- *
- * @param {Document} doc The document to await the load of.
- * @returns {Promise<Document>}
- */
-function promiseDocumentLoaded(doc) {
- if (doc.readyState == "complete") {
- return Promise.resolve(doc);
- }
-
- return new Promise(resolve => {
- doc.defaultView.addEventListener("load", function onReady(event) {
- doc.defaultView.removeEventListener("load", onReady);
- resolve(doc);
- });
- });
-}
-
-/**
- * Returns a Promise which resolves when the given event is dispatched to the
- * given element.
- *
- * @param {Element} element
- * The element on which to listen.
- * @param {string} eventName
- * The event to listen for.
- * @param {boolean} [useCapture = true]
- * If true, listen for the even in the capturing rather than
- * bubbling phase.
- * @param {Event} [test]
- * An optional test function which, when called with the
- * observer's subject and data, should return true if this is the
- * expected event, false otherwise.
- * @returns {Promise<Event>}
- */
-function promiseEvent(element, eventName, useCapture = true, test = event => true) {
- return new Promise(resolve => {
- function listener(event) {
- if (test(event)) {
- element.removeEventListener(eventName, listener, useCapture);
- resolve(event);
- }
- }
- element.addEventListener(eventName, listener, useCapture);
- });
-}
-
-/**
- * Returns a Promise which resolves the given observer topic has been
- * observed.
- *
- * @param {string} topic
- * The topic to observe.
- * @param {function(nsISupports, string)} [test]
- * An optional test function which, when called with the
- * observer's subject and data, should return true if this is the
- * expected notification, false otherwise.
- * @returns {Promise<object>}
- */
-function promiseObserved(topic, test = () => true) {
- return new Promise(resolve => {
- let observer = (subject, topic, data) => {
- if (test(subject, data)) {
- Services.obs.removeObserver(observer, topic);
- resolve({subject, data});
- }
- };
- Services.obs.addObserver(observer, topic, false);
- });
-}
-
-function getMessageManager(target) {
- if (target instanceof Ci.nsIFrameLoaderOwner) {
- return target.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager;
- }
- return target.QueryInterface(Ci.nsIMessageSender);
-}
-
-function flushJarCache(jarFile) {
- Services.obs.notifyObservers(jarFile, "flush-cache-entry", null);
-}
-
-const PlatformInfo = Object.freeze({
- os: (function() {
- let os = AppConstants.platform;
- if (os == "macosx") {
- os = "mac";
- }
- return os;
- })(),
- arch: (function() {
- let abi = Services.appinfo.XPCOMABI;
- let [arch] = abi.split("-");
- if (arch == "x86") {
- arch = "x86-32";
- } else if (arch == "x86_64") {
- arch = "x86-64";
- }
- return arch;
- })(),
-});
-
-function detectLanguage(text) {
- return LanguageDetector.detectLanguage(text).then(result => ({
- isReliable: result.confident,
- languages: result.languages.map(lang => {
- return {
- language: lang.languageCode,
- percentage: lang.percent,
- };
- }),
- }));
-}
-
-/**
- * Convert any of several different representations of a date/time to a Date object.
- * Accepts several formats:
- * a Date object, an ISO8601 string, or a number of milliseconds since the epoch as
- * either a number or a string.
- *
- * @param {Date|string|number} date
- * The date to convert.
- * @returns {Date}
- * A Date object
- */
-function normalizeTime(date) {
- // Of all the formats we accept the "number of milliseconds since the epoch as a string"
- // is an outlier, everything else can just be passed directly to the Date constructor.
- return new Date((typeof date == "string" && /^\d+$/.test(date))
- ? parseInt(date, 10) : date);
-}
-
-const stylesheetMap = new DefaultMap(url => {
- let uri = NetUtil.newURI(url);
- return styleSheetService.preloadSheet(uri, styleSheetService.AGENT_SHEET);
-});
-
-/**
- * Defines a lazy getter for the given property on the given object. The
- * first time the property is accessed, the return value of the getter
- * is defined on the current `this` object with the given property name.
- * Importantly, this means that a lazy getter defined on an object
- * prototype will be invoked separately for each object instance that
- * it's accessed on.
- *
- * @param {object} object
- * The prototype object on which to define the getter.
- * @param {string|Symbol} prop
- * The property name for which to define the getter.
- * @param {function} getter
- * The function to call in order to generate the final property
- * value.
- */
-function defineLazyGetter(object, prop, getter) {
- let redefine = (obj, value) => {
- Object.defineProperty(obj, prop, {
- enumerable: true,
- configurable: true,
- writable: true,
- value,
- });
- return value;
- };
-
- Object.defineProperty(object, prop, {
- enumerable: true,
- configurable: true,
-
- get() {
- return redefine(this, getter.call(this));
- },
-
- set(value) {
- redefine(this, value);
- },
- });
-}
-
-function findPathInObject(obj, path, printErrors = true) {
- let parent;
- for (let elt of path.split(".")) {
- if (!obj || !(elt in obj)) {
- if (printErrors) {
- let appname = Services.appinfo.name;
- Cu.reportError(`WebExtension API ${path} not found (it may be unimplemented by ${appname}).`);
- }
- return null;
- }
-
- parent = obj;
- obj = obj[elt];
- }
-
- if (typeof obj === "function") {
- return obj.bind(parent);
- }
- return obj;
-}
-
-/**
- * Acts as a proxy for a message manager or message manager owner, and
- * tracks docShell swaps so that messages are always sent to the same
- * receiver, even if it is moved to a different <browser>.
- *
- * @param {nsIMessageSender|Element} target
- * The target message manager on which to send messages, or the
- * <browser> element which owns it.
- */
-class MessageManagerProxy {
- constructor(target) {
- this.listeners = new DefaultMap(() => new Map());
-
- if (target instanceof Ci.nsIMessageSender) {
- Object.defineProperty(this, "messageManager", {
- value: target,
- configurable: true,
- writable: true,
- });
- } else {
- this.addListeners(target);
- }
- }
-
- /**
- * Disposes of the proxy object, removes event listeners, and drops
- * all references to the underlying message manager.
- *
- * Must be called before the last reference to the proxy is dropped,
- * unless the underlying message manager or <browser> is also being
- * destroyed.
- */
- dispose() {
- if (this.eventTarget) {
- this.removeListeners(this.eventTarget);
- this.eventTarget = null;
- } else {
- this.messageManager = null;
- }
- }
-
- /**
- * Returns true if the given target is the same as, or owns, the given
- * message manager.
- *
- * @param {nsIMessageSender|MessageManagerProxy|Element} target
- * The message manager, MessageManagerProxy, or <browser>
- * element agaisnt which to match.
- * @param {nsIMessageSender} messageManager
- * The message manager against which to match `target`.
- *
- * @returns {boolean}
- * True if `messageManager` is the same object as `target`, or
- * `target` is a MessageManagerProxy or <browser> element that
- * is tied to it.
- */
- static matches(target, messageManager) {
- return target === messageManager || target.messageManager === messageManager;
- }
-
- /**
- * @property {nsIMessageSender|null} messageManager
- * The message manager that is currently being proxied. This
- * may change during the life of the proxy object, so should
- * not be stored elsewhere.
- */
- get messageManager() {
- return this.eventTarget && this.eventTarget.messageManager;
- }
-
- /**
- * Sends a message on the proxied message manager.
- *
- * @param {array} args
- * Arguments to be passed verbatim to the underlying
- * sendAsyncMessage method.
- * @returns {undefined}
- */
- sendAsyncMessage(...args) {
- if (this.messageManager) {
- return this.messageManager.sendAsyncMessage(...args);
- }
- /* globals uneval */
- Cu.reportError(`Cannot send message: Other side disconnected: ${uneval(args)}`);
- }
-
- /**
- * Adds a message listener to the current message manager, and
- * transfers it to the new message manager after a docShell swap.
- *
- * @param {string} message
- * The name of the message to listen for.
- * @param {nsIMessageListener} listener
- * The listener to add.
- * @param {boolean} [listenWhenClosed = false]
- * If true, the listener will receive messages which were sent
- * after the remote side of the listener began closing.
- */
- addMessageListener(message, listener, listenWhenClosed = false) {
- this.messageManager.addMessageListener(message, listener, listenWhenClosed);
- this.listeners.get(message).set(listener, listenWhenClosed);
- }
-
- /**
- * Adds a message listener from the current message manager.
- *
- * @param {string} message
- * The name of the message to stop listening for.
- * @param {nsIMessageListener} listener
- * The listener to remove.
- */
- removeMessageListener(message, listener) {
- this.messageManager.removeMessageListener(message, listener);
-
- let listeners = this.listeners.get(message);
- listeners.delete(listener);
- if (!listeners.size) {
- this.listeners.delete(message);
- }
- }
-
- /**
- * @private
- * Iterates over all of the currently registered message listeners.
- */
- * iterListeners() {
- for (let [message, listeners] of this.listeners) {
- for (let [listener, listenWhenClosed] of listeners) {
- yield {message, listener, listenWhenClosed};
- }
- }
- }
-
- /**
- * @private
- * Adds docShell swap listeners to the message manager owner.
- *
- * @param {Element} target
- * The target element.
- */
- addListeners(target) {
- target.addEventListener("SwapDocShells", this);
-
- for (let {message, listener, listenWhenClosed} of this.iterListeners()) {
- target.addMessageListener(message, listener, listenWhenClosed);
- }
-
- this.eventTarget = target;
- }
-
- /**
- * @private
- * Removes docShell swap listeners to the message manager owner.
- *
- * @param {Element} target
- * The target element.
- */
- removeListeners(target) {
- target.removeEventListener("SwapDocShells", this);
-
- for (let {message, listener} of this.iterListeners()) {
- target.removeMessageListener(message, listener);
- }
- }
-
- handleEvent(event) {
- if (event.type == "SwapDocShells") {
- this.removeListeners(this.eventTarget);
- this.addListeners(event.detail);
- }
- }
-}
-
-this.ExtensionUtils = {
- defineLazyGetter,
- detectLanguage,
- extend,
- findPathInObject,
- flushJarCache,
- getConsole,
- getInnerWindowID,
- getMessageManager,
- getUniqueId,
- ignoreEvent,
- injectAPI,
- instanceOf,
- normalizeTime,
- promiseDocumentLoaded,
- promiseDocumentReady,
- promiseEvent,
- promiseObserved,
- runSafe,
- runSafeSync,
- runSafeSyncWithoutClone,
- runSafeWithoutClone,
- stylesheetMap,
- DefaultMap,
- DefaultWeakMap,
- EventEmitter,
- EventManager,
- ExtensionError,
- IconDetails,
- LocaleData,
- MessageManagerProxy,
- PlatformInfo,
- SingletonEventManager,
- SpreadArgs,
-};
diff --git a/toolkit/components/webextensions/ExtensionXPCShellUtils.jsm b/toolkit/components/webextensions/ExtensionXPCShellUtils.jsm
deleted file mode 100644
index 339709a19d..0000000000
--- a/toolkit/components/webextensions/ExtensionXPCShellUtils.jsm
+++ /dev/null
@@ -1,306 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ExtensionTestUtils"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Components.utils.import("resource://gre/modules/Task.jsm");
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Extension",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "Management", () => {
- const {Management} = Cu.import("resource://gre/modules/Extension.jsm", {});
- return Management;
-});
-
-/* exported ExtensionTestUtils */
-
-let BASE_MANIFEST = Object.freeze({
- "applications": Object.freeze({
- "gecko": Object.freeze({
- "id": "test@web.ext",
- }),
- }),
-
- "manifest_version": 2,
-
- "name": "name",
- "version": "0",
-});
-
-class ExtensionWrapper {
- constructor(extension, testScope) {
- this.extension = extension;
- this.testScope = testScope;
-
- this.state = "uninitialized";
-
- this.testResolve = null;
- this.testDone = new Promise(resolve => { this.testResolve = resolve; });
-
- this.messageHandler = new Map();
- this.messageAwaiter = new Map();
-
- this.messageQueue = new Set();
-
- this.attachListeners();
-
- this.testScope.do_register_cleanup(() => {
- if (this.messageQueue.size) {
- let names = Array.from(this.messageQueue, ([msg]) => msg);
- this.testScope.equal(JSON.stringify(names), "[]", "message queue is empty");
- }
- if (this.messageAwaiter.size) {
- let names = Array.from(this.messageAwaiter.keys());
- this.testScope.equal(JSON.stringify(names), "[]", "no tasks awaiting on messages");
- }
- });
-
- this.testScope.do_register_cleanup(() => {
- if (this.state == "pending" || this.state == "running") {
- this.testScope.equal(this.state, "unloaded", "Extension left running at test shutdown");
- return this.unload();
- } else if (extension.state == "unloading") {
- this.testScope.equal(this.state, "unloaded", "Extension not fully unloaded at test shutdown");
- }
- });
-
- this.testScope.do_print(`Extension loaded`);
- }
-
- attachListeners() {
- /* eslint-disable mozilla/balanced-listeners */
- this.extension.on("test-eq", (kind, pass, msg, expected, actual) => {
- this.testScope.ok(pass, `${msg} - Expected: ${expected}, Actual: ${actual}`);
- });
- this.extension.on("test-log", (kind, pass, msg) => {
- this.testScope.do_print(msg);
- });
- this.extension.on("test-result", (kind, pass, msg) => {
- this.testScope.ok(pass, msg);
- });
- this.extension.on("test-done", (kind, pass, msg, expected, actual) => {
- this.testScope.ok(pass, msg);
- this.testResolve(msg);
- });
-
- this.extension.on("test-message", (kind, msg, ...args) => {
- let handler = this.messageHandler.get(msg);
- if (handler) {
- handler(...args);
- } else {
- this.messageQueue.add([msg, ...args]);
- this.checkMessages();
- }
- });
- /* eslint-enable mozilla/balanced-listeners */
- }
-
- startup() {
- if (this.state != "uninitialized") {
- throw new Error("Extension already started");
- }
- this.state = "pending";
-
- return this.extension.startup().then(
- result => {
- this.state = "running";
-
- return result;
- },
- error => {
- this.state = "failed";
-
- return Promise.reject(error);
- });
- }
-
- unload() {
- if (this.state != "running") {
- throw new Error("Extension not running");
- }
- this.state = "unloading";
-
- this.extension.shutdown();
-
- this.state = "unloaded";
-
- return Promise.resolve();
- }
-
- /*
- * This method marks the extension unloading without actually calling
- * shutdown, since shutting down a MockExtension causes it to be uninstalled.
- *
- * Normally you shouldn't need to use this unless you need to test something
- * that requires a restart, such as updates.
- */
- markUnloaded() {
- if (this.state != "running") {
- throw new Error("Extension not running");
- }
- this.state = "unloaded";
-
- return Promise.resolve();
- }
-
- sendMessage(...args) {
- this.extension.testMessage(...args);
- }
-
- awaitFinish(msg) {
- return this.testDone.then(actual => {
- if (msg) {
- this.testScope.equal(actual, msg, "test result correct");
- }
- return actual;
- });
- }
-
- checkMessages() {
- for (let message of this.messageQueue) {
- let [msg, ...args] = message;
-
- let listener = this.messageAwaiter.get(msg);
- if (listener) {
- this.messageQueue.delete(message);
- this.messageAwaiter.delete(msg);
-
- listener.resolve(...args);
- return;
- }
- }
- }
-
- checkDuplicateListeners(msg) {
- if (this.messageHandler.has(msg) || this.messageAwaiter.has(msg)) {
- throw new Error("only one message handler allowed");
- }
- }
-
- awaitMessage(msg) {
- return new Promise(resolve => {
- this.checkDuplicateListeners(msg);
-
- this.messageAwaiter.set(msg, {resolve});
- this.checkMessages();
- });
- }
-
- onMessage(msg, callback) {
- this.checkDuplicateListeners(msg);
- this.messageHandler.set(msg, callback);
- }
-}
-
-var ExtensionTestUtils = {
- BASE_MANIFEST,
-
- normalizeManifest: Task.async(function* (manifest, baseManifest = BASE_MANIFEST) {
- yield Management.lazyInit();
-
- let errors = [];
- let context = {
- url: null,
-
- logError: error => {
- errors.push(error);
- },
-
- preprocessors: {},
- };
-
- manifest = Object.assign({}, baseManifest, manifest);
-
- let normalized = Schemas.normalize(manifest, "manifest.WebExtensionManifest", context);
- normalized.errors = errors;
-
- return normalized;
- }),
-
- currentScope: null,
-
- profileDir: null,
-
- init(scope) {
- this.currentScope = scope;
-
- this.profileDir = scope.do_get_profile();
-
- // We need to load at least one frame script into every message
- // manager to ensure that the scriptable wrapper for its global gets
- // created before we try to access it externally. If we don't, we
- // fail sanity checks on debug builds the first time we try to
- // create a wrapper, because we should never have a global without a
- // cached wrapper.
- Services.mm.loadFrameScript("data:text/javascript,//", true);
-
-
- let tmpD = this.profileDir.clone();
- tmpD.append("tmp");
- tmpD.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
- let dirProvider = {
- getFile(prop, persistent) {
- persistent.value = false;
- if (prop == "TmpD") {
- return tmpD.clone();
- }
- return null;
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider]),
- };
- Services.dirsvc.registerProvider(dirProvider);
-
-
- scope.do_register_cleanup(() => {
- tmpD.remove(true);
- Services.dirsvc.unregisterProvider(dirProvider);
-
- this.currentScope = null;
- });
- },
-
- addonManagerStarted: false,
-
- mockAppInfo() {
- const {updateAppInfo} = Cu.import("resource://testing-common/AppInfo.jsm", {});
- updateAppInfo({
- ID: "xpcshell@tests.mozilla.org",
- name: "XPCShell",
- version: "48",
- platformVersion: "48",
- });
- },
-
- startAddonManager() {
- if (this.addonManagerStarted) {
- return;
- }
- this.addonManagerStarted = true;
- this.mockAppInfo();
-
- let manager = Cc["@mozilla.org/addons/integration;1"].getService(Ci.nsIObserver)
- .QueryInterface(Ci.nsITimerCallback);
- manager.observe(null, "addons-startup", null);
- },
-
- loadExtension(data) {
- let extension = Extension.generate(data);
-
- return new ExtensionWrapper(extension, this.currentScope);
- },
-};
diff --git a/toolkit/components/webextensions/LegacyExtensionsUtils.jsm b/toolkit/components/webextensions/LegacyExtensionsUtils.jsm
deleted file mode 100644
index e8d276fe9c..0000000000
--- a/toolkit/components/webextensions/LegacyExtensionsUtils.jsm
+++ /dev/null
@@ -1,250 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["LegacyExtensionsUtils"];
-
-/* exported LegacyExtensionsUtils, LegacyExtensionContext */
-
-/**
- * This file exports helpers for Legacy Extensions that want to embed a webextensions
- * and exchange messages with the embedded WebExtension.
- */
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Extension",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-Cu.import("resource://gre/modules/ExtensionChild.jsm");
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-
-var {
- BaseContext,
-} = ExtensionCommon;
-
-var {
- Messenger,
-} = ExtensionChild;
-
-/**
- * Instances created from this class provide to a legacy extension
- * a simple API to exchange messages with a webextension.
- */
-var LegacyExtensionContext = class extends BaseContext {
- /**
- * Create a new LegacyExtensionContext given a target Extension instance.
- *
- * @param {Extension} targetExtension
- * The webextension instance associated with this context. This will be the
- * instance of the newly created embedded webextension when this class is
- * used through the EmbeddedWebExtensionsUtils.
- */
- constructor(targetExtension) {
- super("legacy_extension", targetExtension);
-
- // Legacy Extensions (xul overlays, bootstrap restartless and Addon SDK)
- // runs with a systemPrincipal.
- let addonPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
- Object.defineProperty(
- this, "principal",
- {value: addonPrincipal, enumerable: true, configurable: true}
- );
-
- let cloneScope = Cu.Sandbox(this.principal, {});
- Cu.setSandboxMetadata(cloneScope, {addonId: targetExtension.id});
- Object.defineProperty(
- this, "cloneScope",
- {value: cloneScope, enumerable: true, configurable: true, writable: true}
- );
-
- let sender = {id: targetExtension.id};
- let filter = {extensionId: targetExtension.id};
- // Legacy addons live in the main process. Messages from other addons are
- // Messages from WebExtensions are sent to the main process and forwarded via
- // the parent process manager to the legacy extension.
- this.messenger = new Messenger(this, [Services.cpmm], sender, filter);
-
- this.api = {
- browser: {
- runtime: {
- onConnect: this.messenger.onConnect("runtime.onConnect"),
- onMessage: this.messenger.onMessage("runtime.onMessage"),
- },
- },
- };
- }
-
- /**
- * This method is called when the extension shuts down or is unloaded,
- * and it nukes the cloneScope sandbox, if any.
- */
- unload() {
- if (this.unloaded) {
- throw new Error("Error trying to unload LegacyExtensionContext twice.");
- }
- super.unload();
- Cu.nukeSandbox(this.cloneScope);
- this.cloneScope = null;
- }
-};
-
-var EmbeddedExtensionManager;
-
-/**
- * Instances of this class are used internally by the exported EmbeddedWebExtensionsUtils
- * to manage the embedded webextension instance and the related LegacyExtensionContext
- * instance used to exchange messages with it.
- */
-class EmbeddedExtension {
- /**
- * Create a new EmbeddedExtension given the add-on id and the base resource URI of the
- * container add-on (the webextension resources will be loaded from the "webextension/"
- * subdir of the base resource URI for the legacy extension add-on).
- *
- * @param {Object} containerAddonParams
- * An object with the following properties:
- * @param {string} containerAddonParams.id
- * The Add-on id of the Legacy Extension which will contain the embedded webextension.
- * @param {nsIURI} containerAddonParams.resourceURI
- * The nsIURI of the Legacy Extension container add-on.
- */
- constructor({id, resourceURI}) {
- this.addonId = id;
- this.resourceURI = resourceURI;
-
- // Setup status flag.
- this.started = false;
- }
-
- /**
- * Start the embedded webextension.
- *
- * @returns {Promise<LegacyContextAPI>} A promise which resolve to the API exposed to the
- * legacy context.
- */
- startup() {
- if (this.started) {
- return Promise.reject(new Error("This embedded extension has already been started"));
- }
-
- // Setup the startup promise.
- this.startupPromise = new Promise((resolve, reject) => {
- let embeddedExtensionURI = Services.io.newURI("webextension/", null, this.resourceURI);
-
- // This is the instance of the WebExtension embedded in the hybrid add-on.
- this.extension = new Extension({
- id: this.addonId,
- resourceURI: embeddedExtensionURI,
- });
-
- // This callback is register to the "startup" event, emitted by the Extension instance
- // after the extension manifest.json has been loaded without any errors, but before
- // starting any of the defined contexts (which give the legacy part a chance to subscribe
- // runtime.onMessage/onConnect listener before the background page has been loaded).
- const onBeforeStarted = () => {
- this.extension.off("startup", onBeforeStarted);
-
- // Resolve the startup promise and reset the startupError.
- this.started = true;
- this.startupPromise = null;
-
- // Create the legacy extension context, the legacy container addon
- // needs to use it before the embedded webextension startup,
- // because it is supposed to be used during the legacy container startup
- // to subscribe its message listeners (which are supposed to be able to
- // receive any message that the embedded part can try to send to it
- // during its startup).
- this.context = new LegacyExtensionContext(this.extension);
-
- // Destroy the LegacyExtensionContext cloneScope when
- // the embedded webextensions is unloaded.
- this.extension.callOnClose({
- close: () => {
- this.context.unload();
- },
- });
-
- // resolve startupPromise to execute any pending shutdown that has been
- // chained to it.
- resolve(this.context.api);
- };
-
- this.extension.on("startup", onBeforeStarted);
-
- // Run ambedded extension startup and catch any error during embedded extension
- // startup.
- this.extension.startup().catch((err) => {
- this.started = false;
- this.startupPromise = null;
- this.extension.off("startup", onBeforeStarted);
-
- reject(err);
- });
- });
-
- return this.startupPromise;
- }
-
- /**
- * Shuts down the embedded webextension.
- *
- * @returns {Promise<void>} a promise that is resolved when the shutdown has been done
- */
- shutdown() {
- EmbeddedExtensionManager.untrackEmbeddedExtension(this);
-
- // If there is a pending startup, wait to be completed and then shutdown.
- if (this.startupPromise) {
- return this.startupPromise.then(() => {
- this.extension.shutdown();
- });
- }
-
- // Run shutdown now if the embedded webextension has been correctly started
- if (this.extension && this.started && !this.extension.hasShutdown) {
- this.extension.shutdown();
- }
-
- return Promise.resolve();
- }
-}
-
-// Keep track on the created EmbeddedExtension instances and destroy
-// them when their container addon is going to be disabled or uninstalled.
-EmbeddedExtensionManager = {
- // Map of the existent EmbeddedExtensions instances by addon id.
- embeddedExtensionsByAddonId: new Map(),
-
- untrackEmbeddedExtension(embeddedExtensionInstance) {
- // Remove this instance from the tracked embedded extensions
- let id = embeddedExtensionInstance.addonId;
- if (this.embeddedExtensionsByAddonId.get(id) == embeddedExtensionInstance) {
- this.embeddedExtensionsByAddonId.delete(id);
- }
- },
-
- getEmbeddedExtensionFor({id, resourceURI}) {
- let embeddedExtension = this.embeddedExtensionsByAddonId.get(id);
-
- if (!embeddedExtension) {
- embeddedExtension = new EmbeddedExtension({id, resourceURI});
- // Keep track of the embedded extension instance.
- this.embeddedExtensionsByAddonId.set(id, embeddedExtension);
- }
-
- return embeddedExtension;
- },
-};
-
-this.LegacyExtensionsUtils = {
- getEmbeddedExtensionFor: (addon) => {
- return EmbeddedExtensionManager.getEmbeddedExtensionFor(addon);
- },
-};
diff --git a/toolkit/components/webextensions/MessageChannel.jsm b/toolkit/components/webextensions/MessageChannel.jsm
deleted file mode 100644
index c5b326405d..0000000000
--- a/toolkit/components/webextensions/MessageChannel.jsm
+++ /dev/null
@@ -1,797 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/**
- * This module provides wrappers around standard message managers to
- * simplify bidirectional communication. It currently allows a caller to
- * send a message to a single listener, and receive a reply. If there
- * are no matching listeners, or the message manager disconnects before
- * a reply is received, the caller is returned an error.
- *
- * The listener end may specify filters for the messages it wishes to
- * receive, and the sender end likewise may specify recipient tags to
- * match the filters.
- *
- * The message handler on the listener side may return its response
- * value directly, or may return a promise, the resolution or rejection
- * of which will be returned instead. The sender end likewise receives a
- * promise which resolves or rejects to the listener's response.
- *
- *
- * A basic setup works something like this:
- *
- * A content script adds a message listener to its global
- * nsIContentFrameMessageManager, with an appropriate set of filters:
- *
- * {
- * init(messageManager, window, extensionID) {
- * this.window = window;
- *
- * MessageChannel.addListener(
- * messageManager, "ContentScript:TouchContent",
- * this);
- *
- * this.messageFilterStrict = {
- * innerWindowID: getInnerWindowID(window),
- * extensionID: extensionID,
- * };
- *
- * this.messageFilterPermissive = {
- * outerWindowID: getOuterWindowID(window),
- * };
- * },
- *
- * receiveMessage({ target, messageName, sender, recipient, data }) {
- * if (messageName == "ContentScript:TouchContent") {
- * return new Promise(resolve => {
- * this.touchWindow(data.touchWith, result => {
- * resolve({ touchResult: result });
- * });
- * });
- * }
- * },
- * };
- *
- * A script in the parent process sends a message to the content process
- * via a tab message manager, including recipient tags to match its
- * filter, and an optional sender tag to identify itself:
- *
- * let data = { touchWith: "pencil" };
- * let sender = { extensionID, contextID };
- * let recipient = { innerWindowID: tab.linkedBrowser.innerWindowID, extensionID };
- *
- * MessageChannel.sendMessage(
- * tab.linkedBrowser.messageManager, "ContentScript:TouchContent",
- * data, {recipient, sender}
- * ).then(result => {
- * alert(result.touchResult);
- * });
- *
- * Since the lifetimes of message senders and receivers may not always
- * match, either side of the message channel may cancel pending
- * responses which match its sender or recipient tags.
- *
- * For the above client, this might be done from an
- * inner-window-destroyed observer, when its target scope is destroyed:
- *
- * observe(subject, topic, data) {
- * if (topic == "inner-window-destroyed") {
- * let innerWindowID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
- *
- * MessageChannel.abortResponses({ innerWindowID });
- * }
- * },
- *
- * From the parent, it may be done when its context is being destroyed:
- *
- * onDestroy() {
- * MessageChannel.abortResponses({
- * extensionID: this.extensionID,
- * contextID: this.contextID,
- * });
- * },
- *
- */
-
-this.EXPORTED_SYMBOLS = ["MessageChannel"];
-
-/* globals MessageChannel */
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionUtils",
- "resource://gre/modules/ExtensionUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
- "resource://gre/modules/PromiseUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "MessageManagerProxy",
- () => ExtensionUtils.MessageManagerProxy);
-
-/**
- * Handles the mapping and dispatching of messages to their registered
- * handlers. There is one broker per message manager and class of
- * messages. Each class of messages is mapped to one native message
- * name, e.g., "MessageChannel:Message", and is dispatched to handlers
- * based on an internal message name, e.g., "Extension:ExecuteScript".
- */
-class FilteringMessageManager {
- /**
- * @param {string} messageName
- * The name of the native message this broker listens for.
- * @param {function} callback
- * A function which is called for each message after it has been
- * mapped to its handler. The function receives two arguments:
- *
- * result:
- * An object containing either a `handler` or an `error` property.
- * If no error occurs, `handler` will be a matching handler that
- * was registered by `addHandler`. Otherwise, the `error` property
- * will contain an object describing the error.
- *
- * data:
- * An object describing the message, as defined in
- * `MessageChannel.addListener`.
- * @param {nsIMessageListenerManager} messageManager
- */
- constructor(messageName, callback, messageManager) {
- this.messageName = messageName;
- this.callback = callback;
- this.messageManager = messageManager;
-
- this.messageManager.addMessageListener(this.messageName, this, true);
-
- this.handlers = new Map();
- }
-
- /**
- * Receives a message from our message manager, maps it to a handler, and
- * passes the result to our message callback.
- */
- receiveMessage({data, target}) {
- let handlers = Array.from(this.getHandlers(data.messageName, data.sender, data.recipient));
-
- data.target = target;
- this.callback(handlers, data);
- }
-
- /**
- * Iterates over all handlers for the given message name. If `recipient`
- * is provided, only iterates over handlers whose filters match it.
- *
- * @param {string|number} messageName
- * The message for which to return handlers.
- * @param {object} sender
- * The sender data on which to filter handlers.
- * @param {object} recipient
- * The recipient data on which to filter handlers.
- */
- * getHandlers(messageName, sender, recipient) {
- let handlers = this.handlers.get(messageName) || new Set();
- for (let handler of handlers) {
- if (MessageChannel.matchesFilter(handler.messageFilterStrict || {}, recipient) &&
- MessageChannel.matchesFilter(handler.messageFilterPermissive || {}, recipient, false) &&
- (!handler.filterMessage || handler.filterMessage(sender, recipient))) {
- yield handler;
- }
- }
- }
-
- /**
- * Registers a handler for the given message.
- *
- * @param {string} messageName
- * The internal message name for which to register the handler.
- * @param {object} handler
- * An opaque handler object. The object may have a
- * `messageFilterStrict` and/or a `messageFilterPermissive`
- * property and/or a `filterMessage` method on which to filter messages.
- *
- * Final dispatching is handled by the message callback passed to
- * the constructor.
- */
- addHandler(messageName, handler) {
- if (!this.handlers.has(messageName)) {
- this.handlers.set(messageName, new Set());
- }
-
- this.handlers.get(messageName).add(handler);
- }
-
- /**
- * Unregisters a handler for the given message.
- *
- * @param {string} messageName
- * The internal message name for which to unregister the handler.
- * @param {object} handler
- * The handler object to unregister.
- */
- removeHandler(messageName, handler) {
- this.handlers.get(messageName).delete(handler);
- }
-}
-
-/**
- * Manages mappings of message managers to their corresponding message
- * brokers. Brokers are lazily created for each message manager the
- * first time they are accessed. In the case of content frame message
- * managers, they are also automatically destroyed when the frame
- * unload event fires.
- */
-class FilteringMessageManagerMap extends Map {
- // Unfortunately, we can't use a WeakMap for this, because message
- // managers do not support preserved wrappers.
-
- /**
- * @param {string} messageName
- * The native message name passed to `FilteringMessageManager` constructors.
- * @param {function} callback
- * The message callback function passed to
- * `FilteringMessageManager` constructors.
- */
- constructor(messageName, callback) {
- super();
-
- this.messageName = messageName;
- this.callback = callback;
- }
-
- /**
- * Returns, and possibly creates, a message broker for the given
- * message manager.
- *
- * @param {nsIMessageListenerManager} target
- * The message manager for which to return a broker.
- *
- * @returns {FilteringMessageManager}
- */
- get(target) {
- if (this.has(target)) {
- return super.get(target);
- }
-
- let broker = new FilteringMessageManager(this.messageName, this.callback, target);
- this.set(target, broker);
-
- if (target instanceof Ci.nsIDOMEventTarget) {
- let onUnload = event => {
- target.removeEventListener("unload", onUnload);
- this.delete(target);
- };
- target.addEventListener("unload", onUnload);
- }
-
- return broker;
- }
-}
-
-const MESSAGE_MESSAGE = "MessageChannel:Message";
-const MESSAGE_RESPONSE = "MessageChannel:Response";
-
-this.MessageChannel = {
- init() {
- Services.obs.addObserver(this, "message-manager-close", false);
- Services.obs.addObserver(this, "message-manager-disconnect", false);
-
- this.messageManagers = new FilteringMessageManagerMap(
- MESSAGE_MESSAGE, this._handleMessage.bind(this));
-
- this.responseManagers = new FilteringMessageManagerMap(
- MESSAGE_RESPONSE, this._handleResponse.bind(this));
-
- /**
- * Contains a list of pending responses, either waiting to be
- * received or waiting to be sent. @see _addPendingResponse
- */
- this.pendingResponses = new Set();
- },
-
- RESULT_SUCCESS: 0,
- RESULT_DISCONNECTED: 1,
- RESULT_NO_HANDLER: 2,
- RESULT_MULTIPLE_HANDLERS: 3,
- RESULT_ERROR: 4,
- RESULT_NO_RESPONSE: 5,
-
- REASON_DISCONNECTED: {
- result: this.RESULT_DISCONNECTED,
- message: "Message manager disconnected",
- },
-
- /**
- * Specifies that only a single listener matching the specified
- * recipient tag may be listening for the given message, at the other
- * end of the target message manager.
- *
- * If no matching listeners exist, a RESULT_NO_HANDLER error will be
- * returned. If multiple matching listeners exist, a
- * RESULT_MULTIPLE_HANDLERS error will be returned.
- */
- RESPONSE_SINGLE: 0,
-
- /**
- * If multiple message managers matching the specified recipient tag
- * are listening for a message, all listeners are notified, but only
- * the first response or error is returned.
- *
- * Only handlers which return a value other than `undefined` are
- * considered to have responded. Returning a Promise which evaluates
- * to `undefined` is interpreted as an explicit response.
- *
- * If no matching listeners exist, a RESULT_NO_HANDLER error will be
- * returned. If no listeners return a response, a RESULT_NO_RESPONSE
- * error will be returned.
- */
- RESPONSE_FIRST: 1,
-
- /**
- * If multiple message managers matching the specified recipient tag
- * are listening for a message, all listeners are notified, and all
- * responses are returned as an array, once all listeners have
- * replied.
- */
- RESPONSE_ALL: 2,
-
- /**
- * Fire-and-forget: The sender of this message does not expect a reply.
- */
- RESPONSE_NONE: 3,
-
- /**
- * Initializes message handlers for the given message managers if needed.
- *
- * @param {Array<nsIMessageListenerManager>} messageManagers
- */
- setupMessageManagers(messageManagers) {
- for (let mm of messageManagers) {
- // This call initializes a FilteringMessageManager for |mm| if needed.
- // The FilteringMessageManager must be created to make sure that senders
- // of messages that expect a reply, such as MessageChannel:Message, do
- // actually receive a default reply even if there are no explicit message
- // handlers.
- this.messageManagers.get(mm);
- }
- },
-
- /**
- * Returns true if the properties of the `data` object match those in
- * the `filter` object. Matching is done on a strict equality basis,
- * and the behavior varies depending on the value of the `strict`
- * parameter.
- *
- * @param {object} filter
- * The filter object to match against.
- * @param {object} data
- * The data object being matched.
- * @param {boolean} [strict=false]
- * If true, all properties in the `filter` object have a
- * corresponding property in `data` with the same value. If
- * false, properties present in both objects must have the same
- * value.
- * @returns {boolean} True if the objects match.
- */
- matchesFilter(filter, data, strict = true) {
- if (strict) {
- return Object.keys(filter).every(key => {
- return key in data && data[key] === filter[key];
- });
- }
- return Object.keys(filter).every(key => {
- return !(key in data) || data[key] === filter[key];
- });
- },
-
- /**
- * Adds a message listener to the given message manager.
- *
- * @param {nsIMessageListenerManager|Array<nsIMessageListenerManager>} targets
- * The message managers on which to listen.
- * @param {string|number} messageName
- * The name of the message to listen for.
- * @param {MessageReceiver} handler
- * The handler to dispatch to. Must be an object with the following
- * properties:
- *
- * receiveMessage:
- * A method which is called for each message received by the
- * listener. The method takes one argument, an object, with the
- * following properties:
- *
- * messageName:
- * The internal message name, as passed to `sendMessage`.
- *
- * target:
- * The message manager which received this message.
- *
- * channelId:
- * The internal ID of the transaction, used to map responses to
- * the original sender.
- *
- * sender:
- * An object describing the sender, as passed to `sendMessage`.
- *
- * recipient:
- * An object describing the recipient, as passed to
- * `sendMessage`.
- *
- * data:
- * The contents of the message, as passed to `sendMessage`.
- *
- * The method may return any structured-clone-compatible
- * object, which will be returned as a response to the message
- * sender. It may also instead return a `Promise`, the
- * resolution or rejection value of which will likewise be
- * returned to the message sender.
- *
- * messageFilterStrict:
- * An object containing arbitrary properties on which to filter
- * received messages. Messages will only be dispatched to this
- * object if the `recipient` object passed to `sendMessage`
- * matches this filter, as determined by `matchesFilter` with
- * `strict=true`.
- *
- * messageFilterPermissive:
- * An object containing arbitrary properties on which to filter
- * received messages. Messages will only be dispatched to this
- * object if the `recipient` object passed to `sendMessage`
- * matches this filter, as determined by `matchesFilter` with
- * `strict=false`.
- *
- * filterMessage:
- * An optional function that prevents the handler from handling a
- * message by returning `false`. See `getHandlers` for the parameters.
- */
- addListener(targets, messageName, handler) {
- for (let target of [].concat(targets)) {
- this.messageManagers.get(target).addHandler(messageName, handler);
- }
- },
-
- /**
- * Removes a message listener from the given message manager.
- *
- * @param {nsIMessageListenerManager|Array<nsIMessageListenerManager>} targets
- * The message managers on which to stop listening.
- * @param {string|number} messageName
- * The name of the message to stop listening for.
- * @param {MessageReceiver} handler
- * The handler to stop dispatching to.
- */
- removeListener(targets, messageName, handler) {
- for (let target of [].concat(targets)) {
- if (this.messageManagers.has(target)) {
- this.messageManagers.get(target).removeHandler(messageName, handler);
- }
- }
- },
-
- /**
- * Sends a message via the given message manager. Returns a promise which
- * resolves or rejects with the return value of the message receiver.
- *
- * The promise also rejects if there is no matching listener, or the other
- * side of the message manager disconnects before the response is received.
- *
- * @param {nsIMessageSender} target
- * The message manager on which to send the message.
- * @param {string} messageName
- * The name of the message to send, as passed to `addListener`.
- * @param {object} data
- * A structured-clone-compatible object to send to the message
- * recipient.
- * @param {object} [options]
- * An object containing any of the following properties:
- * @param {object} [options.recipient]
- * A structured-clone-compatible object to identify the message
- * recipient. The object must match the `messageFilterStrict` and
- * `messageFilterPermissive` filters defined by recipients in order
- * for the message to be received.
- * @param {object} [options.sender]
- * A structured-clone-compatible object to identify the message
- * sender. This object may also be used to avoid delivering the
- * message to the sender, and as a filter to prematurely
- * abort responses when the sender is being destroyed.
- * @see `abortResponses`.
- * @param {integer} [options.responseType=RESPONSE_SINGLE]
- * Specifies the type of response expected. See the `RESPONSE_*`
- * contents for details.
- * @returns {Promise}
- */
- sendMessage(target, messageName, data, options = {}) {
- let sender = options.sender || {};
- let recipient = options.recipient || {};
- let responseType = options.responseType || this.RESPONSE_SINGLE;
-
- let channelId = ExtensionUtils.getUniqueId();
- let message = {messageName, channelId, sender, recipient, data, responseType};
-
- if (responseType == this.RESPONSE_NONE) {
- try {
- target.sendAsyncMessage(MESSAGE_MESSAGE, message);
- } catch (e) {
- // Caller is not expecting a reply, so dump the error to the console.
- Cu.reportError(e);
- return Promise.reject(e);
- }
- return Promise.resolve(); // Not expecting any reply.
- }
-
- let deferred = PromiseUtils.defer();
- deferred.sender = recipient;
- deferred.messageManager = target;
-
- this._addPendingResponse(deferred);
-
- // The channel ID is used as the message name when routing responses.
- // Add a message listener to the response broker, and remove it once
- // we've gotten (or canceled) a response.
- let broker = this.responseManagers.get(target);
- broker.addHandler(channelId, deferred);
-
- let cleanup = () => {
- broker.removeHandler(channelId, deferred);
- };
- deferred.promise.then(cleanup, cleanup);
-
- try {
- target.sendAsyncMessage(MESSAGE_MESSAGE, message);
- } catch (e) {
- deferred.reject(e);
- }
- return deferred.promise;
- },
-
- _callHandlers(handlers, data) {
- let responseType = data.responseType;
-
- // At least one handler is required for all response types but
- // RESPONSE_ALL.
- if (handlers.length == 0 && responseType != this.RESPONSE_ALL) {
- return Promise.reject({result: MessageChannel.RESULT_NO_HANDLER,
- message: "No matching message handler"});
- }
-
- if (responseType == this.RESPONSE_SINGLE) {
- if (handlers.length > 1) {
- return Promise.reject({result: MessageChannel.RESULT_MULTIPLE_HANDLERS,
- message: `Multiple matching handlers for ${data.messageName}`});
- }
-
- // Note: We use `new Promise` rather than `Promise.resolve` here
- // so that errors from the handler are trapped and converted into
- // rejected promises.
- return new Promise(resolve => {
- resolve(handlers[0].receiveMessage(data));
- });
- }
-
- let responses = handlers.map(handler => {
- try {
- return handler.receiveMessage(data);
- } catch (e) {
- return Promise.reject(e);
- }
- });
- responses = responses.filter(response => response !== undefined);
-
- switch (responseType) {
- case this.RESPONSE_FIRST:
- if (responses.length == 0) {
- return Promise.reject({result: MessageChannel.RESULT_NO_RESPONSE,
- message: "No handler returned a response"});
- }
-
- return Promise.race(responses);
-
- case this.RESPONSE_ALL:
- return Promise.all(responses);
- }
- return Promise.reject({message: "Invalid response type"});
- },
-
- /**
- * Handles dispatching message callbacks from the message brokers to their
- * appropriate `MessageReceivers`, and routing the responses back to the
- * original senders.
- *
- * Each handler object is a `MessageReceiver` object as passed to
- * `addListener`.
- *
- * @param {Array<MessageHandler>} handlers
- * @param {object} data
- * @param {nsIMessageSender|{messageManager:nsIMessageSender}} data.target
- */
- _handleMessage(handlers, data) {
- if (data.responseType == this.RESPONSE_NONE) {
- handlers.forEach(handler => {
- // The sender expects no reply, so dump any errors to the console.
- new Promise(resolve => {
- resolve(handler.receiveMessage(data));
- }).catch(e => {
- Cu.reportError(e.stack ? `${e}\n${e.stack}` : e.message || e);
- });
- });
- // Note: Unhandled messages are silently dropped.
- return;
- }
-
- let target = new MessageManagerProxy(data.target);
-
- let deferred = {
- sender: data.sender,
- messageManager: target,
- };
- deferred.promise = new Promise((resolve, reject) => {
- deferred.reject = reject;
-
- this._callHandlers(handlers, data).then(resolve, reject);
- }).then(
- value => {
- let response = {
- result: this.RESULT_SUCCESS,
- messageName: data.channelId,
- recipient: {},
- value,
- };
-
- target.sendAsyncMessage(MESSAGE_RESPONSE, response);
- },
- error => {
- let response = {
- result: this.RESULT_ERROR,
- messageName: data.channelId,
- recipient: {},
- error: {},
- };
-
- if (error && typeof(error) == "object") {
- if (error.result) {
- response.result = error.result;
- }
- // Error objects are not structured-clonable, so just copy
- // over the important properties.
- for (let key of ["fileName", "filename", "lineNumber",
- "columnNumber", "message", "stack", "result"]) {
- if (key in error) {
- response.error[key] = error[key];
- }
- }
- }
-
- target.sendAsyncMessage(MESSAGE_RESPONSE, response);
- }).catch(e => {
- Cu.reportError(e);
- }).then(() => {
- target.dispose();
- });
-
- this._addPendingResponse(deferred);
- },
-
- /**
- * Handles message callbacks from the response brokers.
- *
- * Each handler object is a deferred object created by `sendMessage`, and
- * should be resolved or rejected based on the contents of the response.
- *
- * @param {Array<MessageHandler>} handlers
- * @param {object} data
- * @param {nsIMessageSender|{messageManager:nsIMessageSender}} data.target
- */
- _handleResponse(handlers, data) {
- // If we have an error at this point, we have handler to report it to,
- // so just log it.
- if (handlers.length == 0) {
- Cu.reportError(`No matching message response handler for ${data.messageName}`);
- } else if (handlers.length > 1) {
- Cu.reportError(`Multiple matching response handlers for ${data.messageName}`);
- } else if (data.result === this.RESULT_SUCCESS) {
- handlers[0].resolve(data.value);
- } else {
- handlers[0].reject(data.error);
- }
- },
-
- /**
- * Adds a pending response to the the `pendingResponses` list.
- *
- * The response object must be a deferred promise with the following
- * properties:
- *
- * promise:
- * The promise object which resolves or rejects when the response
- * is no longer pending.
- *
- * reject:
- * A function which, when called, causes the `promise` object to be
- * rejected.
- *
- * sender:
- * A sender object, as passed to `sendMessage.
- *
- * messageManager:
- * The message manager the response will be sent or received on.
- *
- * When the promise resolves or rejects, it will be removed from the
- * list.
- *
- * These values are used to clear pending responses when execution
- * contexts are destroyed.
- *
- * @param {Deferred} deferred
- */
- _addPendingResponse(deferred) {
- let cleanup = () => {
- this.pendingResponses.delete(deferred);
- };
- this.pendingResponses.add(deferred);
- deferred.promise.then(cleanup, cleanup);
- },
-
- /**
- * Aborts any pending message responses to senders matching the given
- * filter.
- *
- * @param {object} sender
- * The object on which to filter senders, as determined by
- * `matchesFilter`.
- * @param {object} [reason]
- * An optional object describing the reason the response was aborted.
- * Will be passed to the promise rejection handler of all aborted
- * responses.
- */
- abortResponses(sender, reason = this.REASON_DISCONNECTED) {
- for (let response of this.pendingResponses) {
- if (this.matchesFilter(sender, response.sender)) {
- response.reject(reason);
- }
- }
- },
-
- /**
- * Aborts any pending message responses to the broker for the given
- * message manager.
- *
- * @param {nsIMessageListenerManager} target
- * The message manager for which to abort brokers.
- * @param {object} reason
- * An object describing the reason the responses were aborted.
- * Will be passed to the promise rejection handler of all aborted
- * responses.
- */
- abortMessageManager(target, reason) {
- for (let response of this.pendingResponses) {
- if (MessageManagerProxy.matches(response.messageManager, target)) {
- response.reject(reason);
- }
- }
- },
-
- observe(subject, topic, data) {
- switch (topic) {
- case "message-manager-close":
- case "message-manager-disconnect":
- try {
- if (this.responseManagers.has(subject)) {
- this.abortMessageManager(subject, this.REASON_DISCONNECTED);
- }
- } finally {
- this.responseManagers.delete(subject);
- this.messageManagers.delete(subject);
- }
- break;
- }
- },
-};
-
-MessageChannel.init();
diff --git a/toolkit/components/webextensions/NativeMessaging.jsm b/toolkit/components/webextensions/NativeMessaging.jsm
deleted file mode 100644
index 3d8658a3f4..0000000000
--- a/toolkit/components/webextensions/NativeMessaging.jsm
+++ /dev/null
@@ -1,443 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["HostManifestManager", "NativeApp"];
-/* globals NativeApp */
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
-
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
- "resource://gre/modules/AsyncShutdown.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionChild",
- "resource://gre/modules/ExtensionChild.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Subprocess",
- "resource://gre/modules/Subprocess.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
- "resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
- "resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
- "resource://gre/modules/WindowsRegistry.jsm");
-
-const HOST_MANIFEST_SCHEMA = "chrome://extensions/content/schemas/native_host_manifest.json";
-const VALID_APPLICATION = /^\w+(\.\w+)*$/;
-
-// For a graceful shutdown (i.e., when the extension is unloaded or when it
-// explicitly calls disconnect() on a native port), how long we give the native
-// application to exit before we start trying to kill it. (in milliseconds)
-const GRACEFUL_SHUTDOWN_TIME = 3000;
-
-// Hard limits on maximum message size that can be read/written
-// These are defined in the native messaging documentation, note that
-// the write limit is imposed by the "wire protocol" in which message
-// boundaries are defined by preceding each message with its length as
-// 4-byte unsigned integer so this is the largest value that can be
-// represented. Good luck generating a serialized message that large,
-// the practical write limit is likely to be dictated by available memory.
-const MAX_READ = 1024 * 1024;
-const MAX_WRITE = 0xffffffff;
-
-// Preferences that can lower the message size limits above,
-// used for testing the limits.
-const PREF_MAX_READ = "webextensions.native-messaging.max-input-message-bytes";
-const PREF_MAX_WRITE = "webextensions.native-messaging.max-output-message-bytes";
-
-const REGPATH = "Software\\Mozilla\\NativeMessagingHosts";
-
-this.HostManifestManager = {
- _initializePromise: null,
- _lookup: null,
-
- init() {
- if (!this._initializePromise) {
- let platform = AppConstants.platform;
- if (platform == "win") {
- this._lookup = this._winLookup;
- } else if (platform == "macosx" || platform == "linux") {
- let dirs = [
- Services.dirsvc.get("XREUserNativeMessaging", Ci.nsIFile).path,
- Services.dirsvc.get("XRESysNativeMessaging", Ci.nsIFile).path,
- ];
- this._lookup = (application, context) => this._tryPaths(application, dirs, context);
- } else {
- throw new Error(`Native messaging is not supported on ${AppConstants.platform}`);
- }
- this._initializePromise = Schemas.load(HOST_MANIFEST_SCHEMA);
- }
- return this._initializePromise;
- },
-
- _winLookup(application, context) {
- const REGISTRY = Ci.nsIWindowsRegKey;
- let regPath = `${REGPATH}\\${application}`;
- let path = WindowsRegistry.readRegKey(REGISTRY.ROOT_KEY_CURRENT_USER,
- regPath, "", REGISTRY.WOW64_64);
- if (!path) {
- path = WindowsRegistry.readRegKey(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
- regPath, "", REGISTRY.WOW64_64);
- }
- if (!path) {
- return null;
- }
- return this._tryPath(path, application, context)
- .then(manifest => manifest ? {path, manifest} : null);
- },
-
- _tryPath(path, application, context) {
- return Promise.resolve()
- .then(() => OS.File.read(path, {encoding: "utf-8"}))
- .then(data => {
- let manifest;
- try {
- manifest = JSON.parse(data);
- } catch (ex) {
- let msg = `Error parsing native host manifest ${path}: ${ex.message}`;
- Cu.reportError(msg);
- return null;
- }
-
- let normalized = Schemas.normalize(manifest, "manifest.NativeHostManifest", context);
- if (normalized.error) {
- Cu.reportError(normalized.error);
- return null;
- }
- manifest = normalized.value;
- if (manifest.name != application) {
- let msg = `Native host manifest ${path} has name property ${manifest.name} (expected ${application})`;
- Cu.reportError(msg);
- return null;
- }
- return normalized.value;
- }).catch(ex => {
- if (ex instanceof OS.File.Error && ex.becauseNoSuchFile) {
- return null;
- }
- throw ex;
- });
- },
-
- _tryPaths: Task.async(function* (application, dirs, context) {
- for (let dir of dirs) {
- let path = OS.Path.join(dir, `${application}.json`);
- let manifest = yield this._tryPath(path, application, context);
- if (manifest) {
- return {path, manifest};
- }
- }
- return null;
- }),
-
- /**
- * Search for a valid native host manifest for the given application name.
- * The directories searched and rules for manifest validation are all
- * detailed in the native messaging documentation.
- *
- * @param {string} application The name of the applciation to search for.
- * @param {object} context A context object as expected by Schemas.normalize.
- * @returns {object} The contents of the validated manifest, or null if
- * no valid manifest can be found for this application.
- */
- lookupApplication(application, context) {
- if (!VALID_APPLICATION.test(application)) {
- throw new Error(`Invalid application "${application}"`);
- }
- return this.init().then(() => this._lookup(application, context));
- },
-};
-
-this.NativeApp = class extends EventEmitter {
- /**
- * @param {BaseContext} context The context that initiated the native app.
- * @param {string} application The identifier of the native app.
- */
- constructor(context, application) {
- super();
-
- this.context = context;
- this.name = application;
-
- // We want a close() notification when the window is destroyed.
- this.context.callOnClose(this);
-
- this.proc = null;
- this.readPromise = null;
- this.sendQueue = [];
- this.writePromise = null;
- this.sentDisconnect = false;
-
- this.startupPromise = HostManifestManager.lookupApplication(application, context)
- .then(hostInfo => {
- // Put the two errors together to not leak information about whether a native
- // application is installed to addons that do not have the right permission.
- if (!hostInfo || !hostInfo.manifest.allowed_extensions.includes(context.extension.id)) {
- throw new context.cloneScope.Error(`This extension does not have permission to use native application ${application} (or the application is not installed)`);
- }
-
- let command = hostInfo.manifest.path;
- if (AppConstants.platform == "win") {
- // OS.Path.join() ignores anything before the last absolute path
- // it sees, so if command is already absolute, it remains unchanged
- // here. If it is relative, we get the proper absolute path here.
- command = OS.Path.join(OS.Path.dirname(hostInfo.path), command);
- }
-
- let subprocessOpts = {
- command: command,
- arguments: [hostInfo.path],
- workdir: OS.Path.dirname(command),
- stderr: "pipe",
- };
- return Subprocess.call(subprocessOpts);
- }).then(proc => {
- this.startupPromise = null;
- this.proc = proc;
- this._startRead();
- this._startWrite();
- this._startStderrRead();
- }).catch(err => {
- this.startupPromise = null;
- Cu.reportError(err instanceof Error ? err : err.message);
- this._cleanup(err);
- });
- }
-
- /**
- * Open a connection to a native messaging host.
- *
- * @param {BaseContext} context The context associated with the port.
- * @param {nsIMessageSender} messageManager The message manager used to send
- * and receive messages from the port's creator.
- * @param {string} portId A unique internal ID that identifies the port.
- * @param {object} sender The object describing the creator of the connection
- * request.
- * @param {string} application The name of the native messaging host.
- */
- static onConnectNative(context, messageManager, portId, sender, application) {
- let app = new NativeApp(context, application);
- let port = new ExtensionChild.Port(context, messageManager, [Services.mm], "", portId, sender, sender);
- app.once("disconnect", (what, err) => port.disconnect(err));
-
- /* eslint-disable mozilla/balanced-listeners */
- app.on("message", (what, msg) => port.postMessage(msg));
- /* eslint-enable mozilla/balanced-listeners */
-
- port.registerOnMessage(msg => app.send(msg));
- port.registerOnDisconnect(msg => app.close());
- }
-
- /**
- * @param {BaseContext} context The scope from where `message` originates.
- * @param {*} message A message from the extension, meant for a native app.
- * @returns {ArrayBuffer} An ArrayBuffer that can be sent to the native app.
- */
- static encodeMessage(context, message) {
- message = context.jsonStringify(message);
- let buffer = new TextEncoder().encode(message).buffer;
- if (buffer.byteLength > NativeApp.maxWrite) {
- throw new context.cloneScope.Error("Write too big");
- }
- return buffer;
- }
-
- // A port is definitely "alive" if this.proc is non-null. But we have
- // to provide a live port object immediately when connecting so we also
- // need to consider a port alive if proc is null but the startupPromise
- // is still pending.
- get _isDisconnected() {
- return (!this.proc && !this.startupPromise);
- }
-
- _startRead() {
- if (this.readPromise) {
- throw new Error("Entered _startRead() while readPromise is non-null");
- }
- this.readPromise = this.proc.stdout.readUint32()
- .then(len => {
- if (len > NativeApp.maxRead) {
- throw new this.context.cloneScope.Error(`Native application tried to send a message of ${len} bytes, which exceeds the limit of ${NativeApp.maxRead} bytes.`);
- }
- return this.proc.stdout.readJSON(len);
- }).then(msg => {
- this.emit("message", msg);
- this.readPromise = null;
- this._startRead();
- }).catch(err => {
- if (err.errorCode != Subprocess.ERROR_END_OF_FILE) {
- Cu.reportError(err instanceof Error ? err : err.message);
- }
- this._cleanup(err);
- });
- }
-
- _startWrite() {
- if (this.sendQueue.length == 0) {
- return;
- }
-
- if (this.writePromise) {
- throw new Error("Entered _startWrite() while writePromise is non-null");
- }
-
- let buffer = this.sendQueue.shift();
- let uintArray = Uint32Array.of(buffer.byteLength);
-
- this.writePromise = Promise.all([
- this.proc.stdin.write(uintArray.buffer),
- this.proc.stdin.write(buffer),
- ]).then(() => {
- this.writePromise = null;
- this._startWrite();
- }).catch(err => {
- Cu.reportError(err.message);
- this._cleanup(err);
- });
- }
-
- _startStderrRead() {
- let proc = this.proc;
- let app = this.name;
- Task.spawn(function* () {
- let partial = "";
- while (true) {
- let data = yield proc.stderr.readString();
- if (data.length == 0) {
- // We have hit EOF, just stop reading
- if (partial) {
- Services.console.logStringMessage(`stderr output from native app ${app}: ${partial}`);
- }
- break;
- }
-
- let lines = data.split(/\r?\n/);
- lines[0] = partial + lines[0];
- partial = lines.pop();
-
- for (let line of lines) {
- Services.console.logStringMessage(`stderr output from native app ${app}: ${line}`);
- }
- }
- });
- }
-
- send(msg) {
- if (this._isDisconnected) {
- throw new this.context.cloneScope.Error("Attempt to postMessage on disconnected port");
- }
- if (Cu.getClassName(msg, true) != "ArrayBuffer") {
- // This error cannot be triggered by extensions; it indicates an error in
- // our implementation.
- throw new Error("The message to the native messaging host is not an ArrayBuffer");
- }
-
- let buffer = msg;
-
- if (buffer.byteLength > NativeApp.maxWrite) {
- throw new this.context.cloneScope.Error("Write too big");
- }
-
- this.sendQueue.push(buffer);
- if (!this.startupPromise && !this.writePromise) {
- this._startWrite();
- }
- }
-
- // Shut down the native application and also signal to the extension
- // that the connect has been disconnected.
- _cleanup(err) {
- this.context.forgetOnClose(this);
-
- let doCleanup = () => {
- // Set a timer to kill the process gracefully after one timeout
- // interval and kill it forcefully after two intervals.
- let timer = setTimeout(() => {
- this.proc.kill(GRACEFUL_SHUTDOWN_TIME);
- }, GRACEFUL_SHUTDOWN_TIME);
-
- let promise = Promise.all([
- this.proc.stdin.close()
- .catch(err => {
- if (err.errorCode != Subprocess.ERROR_END_OF_FILE) {
- throw err;
- }
- }),
- this.proc.wait(),
- ]).then(() => {
- this.proc = null;
- clearTimeout(timer);
- });
-
- AsyncShutdown.profileBeforeChange.addBlocker(
- `Native Messaging: Wait for application ${this.name} to exit`,
- promise);
-
- promise.then(() => {
- AsyncShutdown.profileBeforeChange.removeBlocker(promise);
- });
-
- return promise;
- };
-
- if (this.proc) {
- doCleanup();
- } else if (this.startupPromise) {
- this.startupPromise.then(doCleanup);
- }
-
- if (!this.sentDisconnect) {
- this.sentDisconnect = true;
- if (err && err.errorCode == Subprocess.ERROR_END_OF_FILE) {
- err = null;
- }
- this.emit("disconnect", err);
- }
- }
-
- // Called from Context when the extension is shut down.
- close() {
- this._cleanup();
- }
-
- sendMessage(msg) {
- let responsePromise = new Promise((resolve, reject) => {
- this.once("message", (what, msg) => { resolve(msg); });
- this.once("disconnect", (what, err) => { reject(err); });
- });
-
- let result = this.startupPromise.then(() => {
- this.send(msg);
- return responsePromise;
- });
-
- result.then(() => {
- this._cleanup();
- }, () => {
- // Prevent the response promise from being reported as an
- // unchecked rejection if the startup promise fails.
- responsePromise.catch(() => {});
-
- this._cleanup();
- });
-
- return result;
- }
-};
-
-XPCOMUtils.defineLazyPreferenceGetter(NativeApp, "maxRead", PREF_MAX_READ, MAX_READ);
-XPCOMUtils.defineLazyPreferenceGetter(NativeApp, "maxWrite", PREF_MAX_WRITE, MAX_WRITE);
diff --git a/toolkit/components/webextensions/Schemas.jsm b/toolkit/components/webextensions/Schemas.jsm
deleted file mode 100644
index 159211c79e..0000000000
--- a/toolkit/components/webextensions/Schemas.jsm
+++ /dev/null
@@ -1,2143 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-const global = this;
-
-Cu.importGlobalProperties(["URL"]);
-
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- DefaultMap,
- instanceOf,
-} = ExtensionUtils;
-
-class DeepMap extends DefaultMap {
- constructor() {
- super(() => new DeepMap());
- }
-
- getPath(...keys) {
- return keys.reduce((map, prop) => map.get(prop), this);
- }
-}
-
-XPCOMUtils.defineLazyServiceGetter(this, "contentPolicyService",
- "@mozilla.org/addons/content-policy;1",
- "nsIAddonContentPolicy");
-
-this.EXPORTED_SYMBOLS = ["Schemas"];
-
-/* globals Schemas, URL */
-
-function readJSON(url) {
- return new Promise((resolve, reject) => {
- NetUtil.asyncFetch({uri: url, loadUsingSystemPrincipal: true}, (inputStream, status) => {
- if (!Components.isSuccessCode(status)) {
- // Convert status code to a string
- let e = Components.Exception("", status);
- reject(new Error(`Error while loading '${url}' (${e.name})`));
- return;
- }
- try {
- let text = NetUtil.readInputStreamToString(inputStream, inputStream.available());
-
- // Chrome JSON files include a license comment that we need to
- // strip off for this to be valid JSON. As a hack, we just
- // look for the first '[' character, which signals the start
- // of the JSON content.
- let index = text.indexOf("[");
- text = text.slice(index);
-
- resolve(JSON.parse(text));
- } catch (e) {
- reject(e);
- }
- });
- });
-}
-
-/**
- * Defines a lazy getter for the given property on the given object. Any
- * security wrappers are waived on the object before the property is
- * defined, and the getter and setter methods are wrapped for the target
- * scope.
- *
- * The given getter function is guaranteed to be called only once, even
- * if the target scope retrieves the wrapped getter from the property
- * descriptor and calls it directly.
- *
- * @param {object} object
- * The object on which to define the getter.
- * @param {string|Symbol} prop
- * The property name for which to define the getter.
- * @param {function} getter
- * The function to call in order to generate the final property
- * value.
- */
-function exportLazyGetter(object, prop, getter) {
- object = Cu.waiveXrays(object);
-
- let redefine = value => {
- if (value === undefined) {
- delete object[prop];
- } else {
- Object.defineProperty(object, prop, {
- enumerable: true,
- configurable: true,
- writable: true,
- value,
- });
- }
-
- getter = null;
-
- return value;
- };
-
- Object.defineProperty(object, prop, {
- enumerable: true,
- configurable: true,
-
- get: Cu.exportFunction(function() {
- return redefine(getter.call(this));
- }, object),
-
- set: Cu.exportFunction(value => {
- redefine(value);
- }, object),
- });
-}
-
-const POSTPROCESSORS = {
- convertImageDataToURL(imageData, context) {
- let document = context.cloneScope.document;
- let canvas = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
- canvas.width = imageData.width;
- canvas.height = imageData.height;
- canvas.getContext("2d").putImageData(imageData, 0, 0);
-
- return canvas.toDataURL("image/png");
- },
-};
-
-// Parses a regular expression, with support for the Python extended
-// syntax that allows setting flags by including the string (?im)
-function parsePattern(pattern) {
- let flags = "";
- let match = /^\(\?([im]*)\)(.*)/.exec(pattern);
- if (match) {
- [, flags, pattern] = match;
- }
- return new RegExp(pattern, flags);
-}
-
-function getValueBaseType(value) {
- let t = typeof(value);
- if (t == "object") {
- if (value === null) {
- return "null";
- } else if (Array.isArray(value)) {
- return "array";
- } else if (Object.prototype.toString.call(value) == "[object ArrayBuffer]") {
- return "binary";
- }
- } else if (t == "number") {
- if (value % 1 == 0) {
- return "integer";
- }
- }
- return t;
-}
-
-// Methods of Context that are used by Schemas.normalize. These methods can be
-// overridden at the construction of Context.
-const CONTEXT_FOR_VALIDATION = [
- "checkLoadURL",
- "hasPermission",
- "logError",
-];
-
-// Methods of Context that are used by Schemas.inject.
-// Callers of Schemas.inject should implement all of these methods.
-const CONTEXT_FOR_INJECTION = [
- ...CONTEXT_FOR_VALIDATION,
- "shouldInject",
- "getImplementation",
-];
-
-/**
- * A context for schema validation and error reporting. This class is only used
- * internally within Schemas.
- */
-class Context {
- /**
- * @param {object} params Provides the implementation of this class.
- * @param {Array<string>} overridableMethods
- */
- constructor(params, overridableMethods = CONTEXT_FOR_VALIDATION) {
- this.params = params;
-
- this.path = [];
- this.preprocessors = {
- localize(value, context) {
- return value;
- },
- };
- this.postprocessors = POSTPROCESSORS;
- this.isChromeCompat = false;
-
- this.currentChoices = new Set();
- this.choicePathIndex = 0;
-
- for (let method of overridableMethods) {
- if (method in params) {
- this[method] = params[method].bind(params);
- }
- }
-
- let props = ["preprocessors", "isChromeCompat"];
- for (let prop of props) {
- if (prop in params) {
- if (prop in this && typeof this[prop] == "object") {
- Object.assign(this[prop], params[prop]);
- } else {
- this[prop] = params[prop];
- }
- }
- }
- }
-
- get choicePath() {
- let path = this.path.slice(this.choicePathIndex);
- return path.join(".");
- }
-
- get cloneScope() {
- return this.params.cloneScope;
- }
-
- get url() {
- return this.params.url;
- }
-
- get principal() {
- return this.params.principal || Services.scriptSecurityManager.createNullPrincipal({});
- }
-
- /**
- * Checks whether `url` may be loaded by the extension in this context.
- *
- * @param {string} url The URL that the extension wished to load.
- * @returns {boolean} Whether the context may load `url`.
- */
- checkLoadURL(url) {
- let ssm = Services.scriptSecurityManager;
- try {
- ssm.checkLoadURIStrWithPrincipal(this.principal, url,
- ssm.DISALLOW_INHERIT_PRINCIPAL);
- } catch (e) {
- return false;
- }
- return true;
- }
-
- /**
- * Checks whether this context has the given permission.
- *
- * @param {string} permission
- * The name of the permission to check.
- *
- * @returns {boolean} True if the context has the given permission.
- */
- hasPermission(permission) {
- return false;
- }
-
- /**
- * Returns an error result object with the given message, for return
- * by Type normalization functions.
- *
- * If the context has a `currentTarget` value, this is prepended to
- * the message to indicate the location of the error.
- *
- * @param {string} errorMessage
- * The error message which will be displayed when this is the
- * only possible matching schema.
- * @param {string} choicesMessage
- * The message describing the valid what constitutes a valid
- * value for this schema, which will be displayed when multiple
- * schema choices are available and none match.
- *
- * A caller may pass `null` to prevent a choice from being
- * added, but this should *only* be done from code processing a
- * choices type.
- * @returns {object}
- */
- error(errorMessage, choicesMessage = undefined) {
- if (choicesMessage !== null) {
- let {choicePath} = this;
- if (choicePath) {
- choicesMessage = `.${choicePath} must ${choicesMessage}`;
- }
-
- this.currentChoices.add(choicesMessage);
- }
-
- if (this.currentTarget) {
- return {error: `Error processing ${this.currentTarget}: ${errorMessage}`};
- }
- return {error: errorMessage};
- }
-
- /**
- * Creates an `Error` object belonging to the current unprivileged
- * scope. If there is no unprivileged scope associated with this
- * context, the message is returned as a string.
- *
- * If the context has a `currentTarget` value, this is prepended to
- * the message, in the same way as for the `error` method.
- *
- * @param {string} message
- * @returns {Error}
- */
- makeError(message) {
- let {error} = this.error(message);
- if (this.cloneScope) {
- return new this.cloneScope.Error(error);
- }
- return error;
- }
-
- /**
- * Logs the given error to the console. May be overridden to enable
- * custom logging.
- *
- * @param {Error|string} error
- */
- logError(error) {
- Cu.reportError(error);
- }
-
- /**
- * Returns the name of the value currently being normalized. For a
- * nested object, this is usually approximately equivalent to the
- * JavaScript property accessor for that property. Given:
- *
- * { foo: { bar: [{ baz: x }] } }
- *
- * When processing the value for `x`, the currentTarget is
- * 'foo.bar.0.baz'
- */
- get currentTarget() {
- return this.path.join(".");
- }
-
- /**
- * Executes the given callback, and returns an array of choice strings
- * passed to {@see #error} during its execution.
- *
- * @param {function} callback
- * @returns {object}
- * An object with a `result` property containing the return
- * value of the callback, and a `choice` property containing
- * an array of choices.
- */
- withChoices(callback) {
- let {currentChoices, choicePathIndex} = this;
-
- let choices = new Set();
- this.currentChoices = choices;
- this.choicePathIndex = this.path.length;
-
- try {
- let result = callback();
-
- return {result, choices: Array.from(choices)};
- } finally {
- this.currentChoices = currentChoices;
- this.choicePathIndex = choicePathIndex;
-
- choices = Array.from(choices);
- if (choices.length == 1) {
- currentChoices.add(choices[0]);
- } else if (choices.length) {
- let n = choices.length - 1;
- choices[n] = `or ${choices[n]}`;
-
- this.error(null, `must either [${choices.join(", ")}]`);
- }
- }
- }
-
- /**
- * Appends the given component to the `currentTarget` path to indicate
- * that it is being processed, calls the given callback function, and
- * then restores the original path.
- *
- * This is used to identify the path of the property being processed
- * when reporting type errors.
- *
- * @param {string} component
- * @param {function} callback
- * @returns {*}
- */
- withPath(component, callback) {
- this.path.push(component);
- try {
- return callback();
- } finally {
- this.path.pop();
- }
- }
-}
-
-/**
- * Holds methods that run the actual implementation of the extension APIs. These
- * methods are only called if the extension API invocation matches the signature
- * as defined in the schema. Otherwise an error is reported to the context.
- */
-class InjectionContext extends Context {
- constructor(params) {
- super(params, CONTEXT_FOR_INJECTION);
- }
-
- /**
- * Check whether the API should be injected.
- *
- * @abstract
- * @param {string} namespace The namespace of the API. This may contain dots,
- * e.g. in the case of "devtools.inspectedWindow".
- * @param {string} [name] The name of the property in the namespace.
- * `null` if we are checking whether the namespace should be injected.
- * @param {Array<string>} allowedContexts A list of additional contexts in which
- * this API should be available. May include any of:
- * "main" - The main chrome browser process.
- * "addon" - An addon process.
- * "content" - A content process.
- * @returns {boolean} Whether the API should be injected.
- */
- shouldInject(namespace, name, allowedContexts) {
- throw new Error("Not implemented");
- }
-
- /**
- * Generate the implementation for `namespace`.`name`.
- *
- * @abstract
- * @param {string} namespace The full path to the namespace of the API, minus
- * the name of the method or property. E.g. "storage.local".
- * @param {string} name The name of the method, property or event.
- * @returns {SchemaAPIInterface} The implementation of the API.
- */
- getImplementation(namespace, name) {
- throw new Error("Not implemented");
- }
-}
-
-/**
- * The methods in this singleton represent the "format" specifier for
- * JSON Schema string types.
- *
- * Each method either returns a normalized version of the original
- * value, or throws an error if the value is not valid for the given
- * format.
- */
-const FORMATS = {
- url(string, context) {
- let url = new URL(string).href;
-
- if (!context.checkLoadURL(url)) {
- throw new Error(`Access denied for URL ${url}`);
- }
- return url;
- },
-
- relativeUrl(string, context) {
- if (!context.url) {
- // If there's no context URL, return relative URLs unresolved, and
- // skip security checks for them.
- try {
- new URL(string);
- } catch (e) {
- return string;
- }
- }
-
- let url = new URL(string, context.url).href;
-
- if (!context.checkLoadURL(url)) {
- throw new Error(`Access denied for URL ${url}`);
- }
- return url;
- },
-
- strictRelativeUrl(string, context) {
- // Do not accept a string which resolves as an absolute URL, or any
- // protocol-relative URL.
- if (!string.startsWith("//")) {
- try {
- new URL(string);
- } catch (e) {
- return FORMATS.relativeUrl(string, context);
- }
- }
-
- throw new SyntaxError(`String ${JSON.stringify(string)} must be a relative URL`);
- },
-
- contentSecurityPolicy(string, context) {
- let error = contentPolicyService.validateAddonCSP(string);
- if (error != null) {
- throw new SyntaxError(error);
- }
- return string;
- },
-
- date(string, context) {
- // A valid ISO 8601 timestamp.
- const PATTERN = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d{3})?(Z|([-+]\d{2}:?\d{2})))?$/;
- if (!PATTERN.test(string)) {
- throw new Error(`Invalid date string ${string}`);
- }
- // Our pattern just checks the format, we could still have invalid
- // values (e.g., month=99 or month=02 and day=31). Let the Date
- // constructor do the dirty work of validating.
- if (isNaN(new Date(string))) {
- throw new Error(`Invalid date string ${string}`);
- }
- return string;
- },
-};
-
-// Schema files contain namespaces, and each namespace contains types,
-// properties, functions, and events. An Entry is a base class for
-// types, properties, functions, and events.
-class Entry {
- constructor(schema = {}) {
- /**
- * If set to any value which evaluates as true, this entry is
- * deprecated, and any access to it will result in a deprecation
- * warning being logged to the browser console.
- *
- * If the value is a string, it will be appended to the deprecation
- * message. If it contains the substring "${value}", it will be
- * replaced with a string representation of the value being
- * processed.
- *
- * If the value is any other truthy value, a generic deprecation
- * message will be emitted.
- */
- this.deprecated = false;
- if ("deprecated" in schema) {
- this.deprecated = schema.deprecated;
- }
-
- /**
- * @property {string} [preprocessor]
- * If set to a string value, and a preprocessor of the same is
- * defined in the validation context, it will be applied to this
- * value prior to any normalization.
- */
- this.preprocessor = schema.preprocess || null;
-
- /**
- * @property {string} [postprocessor]
- * If set to a string value, and a postprocessor of the same is
- * defined in the validation context, it will be applied to this
- * value after any normalization.
- */
- this.postprocessor = schema.postprocess || null;
-
- /**
- * @property {Array<string>} allowedContexts A list of allowed contexts
- * to consider before generating the API.
- * These are not parsed by the schema, but passed to `shouldInject`.
- */
- this.allowedContexts = schema.allowedContexts || [];
- }
-
- /**
- * Preprocess the given value with the preprocessor declared in
- * `preprocessor`.
- *
- * @param {*} value
- * @param {Context} context
- * @returns {*}
- */
- preprocess(value, context) {
- if (this.preprocessor) {
- return context.preprocessors[this.preprocessor](value, context);
- }
- return value;
- }
-
- /**
- * Postprocess the given result with the postprocessor declared in
- * `postprocessor`.
- *
- * @param {object} result
- * @param {Context} context
- * @returns {object}
- */
- postprocess(result, context) {
- if (result.error || !this.postprocessor) {
- return result;
- }
-
- let value = context.postprocessors[this.postprocessor](result.value, context);
- return {value};
- }
-
- /**
- * Logs a deprecation warning for this entry, based on the value of
- * its `deprecated` property.
- *
- * @param {Context} context
- * @param {value} [value]
- */
- logDeprecation(context, value = null) {
- let message = "This property is deprecated";
- if (typeof(this.deprecated) == "string") {
- message = this.deprecated;
- if (message.includes("${value}")) {
- try {
- value = JSON.stringify(value);
- } catch (e) {
- value = String(value);
- }
- message = message.replace(/\$\{value\}/g, () => value);
- }
- }
-
- context.logError(context.makeError(message));
- }
-
- /**
- * Checks whether the entry is deprecated and, if so, logs a
- * deprecation message.
- *
- * @param {Context} context
- * @param {value} [value]
- */
- checkDeprecated(context, value = null) {
- if (this.deprecated) {
- this.logDeprecation(context, value);
- }
- }
-
- /**
- * Injects JS values for the entry into the extension API
- * namespace. The default implementation is to do nothing.
- * `context` is used to call the actual implementation
- * of a given function or event.
- *
- * @param {Array<string>} path The API path, e.g. `["storage", "local"]`.
- * @param {string} name The method name, e.g. "get".
- * @param {object} dest The object where `path`.`name` should be stored.
- * @param {InjectionContext} context
- */
- inject(path, name, dest, context) {
- }
-}
-
-// Corresponds either to a type declared in the "types" section of the
-// schema or else to any type object used throughout the schema.
-class Type extends Entry {
- /**
- * @property {Array<string>} EXTRA_PROPERTIES
- * An array of extra properties which may be present for
- * schemas of this type.
- */
- static get EXTRA_PROPERTIES() {
- return ["description", "deprecated", "preprocess", "postprocess", "allowedContexts"];
- }
-
- /**
- * Parses the given schema object and returns an instance of this
- * class which corresponds to its properties.
- *
- * @param {object} schema
- * A JSON schema object which corresponds to a definition of
- * this type.
- * @param {Array<string>} path
- * The path to this schema object from the root schema,
- * corresponding to the property names and array indices
- * traversed during parsing in order to arrive at this schema
- * object.
- * @param {Array<string>} [extraProperties]
- * An array of extra property names which are valid for this
- * schema in the current context.
- * @returns {Type}
- * An instance of this type which corresponds to the given
- * schema object.
- * @static
- */
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- return new this(schema);
- }
-
- /**
- * Checks that all of the properties present in the given schema
- * object are valid properties for this type, and throws if invalid.
- *
- * @param {object} schema
- * A JSON schema object.
- * @param {Array<string>} path
- * The path to this schema object from the root schema,
- * corresponding to the property names and array indices
- * traversed during parsing in order to arrive at this schema
- * object.
- * @param {Array<string>} [extra]
- * An array of extra property names which are valid for this
- * schema in the current context.
- * @throws {Error}
- * An error describing the first invalid property found in the
- * schema object.
- */
- static checkSchemaProperties(schema, path, extra = []) {
- let allowedSet = new Set([...this.EXTRA_PROPERTIES, ...extra]);
-
- for (let prop of Object.keys(schema)) {
- if (!allowedSet.has(prop)) {
- throw new Error(`Internal error: Namespace ${path.join(".")} has invalid type property "${prop}" in type "${schema.id || JSON.stringify(schema)}"`);
- }
- }
- }
-
- // Takes a value, checks that it has the correct type, and returns a
- // "normalized" version of the value. The normalized version will
- // include "nulls" in place of omitted optional properties. The
- // result of this function is either {error: "Some type error"} or
- // {value: <normalized-value>}.
- normalize(value, context) {
- return context.error("invalid type");
- }
-
- // Unlike normalize, this function does a shallow check to see if
- // |baseType| (one of the possible getValueBaseType results) is
- // valid for this type. It returns true or false. It's used to fill
- // in optional arguments to functions before actually type checking
-
- checkBaseType(baseType) {
- return false;
- }
-
- // Helper method that simply relies on checkBaseType to implement
- // normalize. Subclasses can choose to use it or not.
- normalizeBase(type, value, context) {
- if (this.checkBaseType(getValueBaseType(value))) {
- this.checkDeprecated(context, value);
- return {value: this.preprocess(value, context)};
- }
-
- let choice;
- if (/^[aeiou]/.test(type)) {
- choice = `be an ${type} value`;
- } else {
- choice = `be a ${type} value`;
- }
-
- return context.error(`Expected ${type} instead of ${JSON.stringify(value)}`,
- choice);
- }
-}
-
-// Type that allows any value.
-class AnyType extends Type {
- normalize(value, context) {
- this.checkDeprecated(context, value);
- return this.postprocess({value}, context);
- }
-
- checkBaseType(baseType) {
- return true;
- }
-}
-
-// An untagged union type.
-class ChoiceType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["choices", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- let choices = schema.choices.map(t => Schemas.parseSchema(t, path));
- return new this(schema, choices);
- }
-
- constructor(schema, choices) {
- super(schema);
- this.choices = choices;
- }
-
- extend(type) {
- this.choices.push(...type.choices);
-
- return this;
- }
-
- normalize(value, context) {
- this.checkDeprecated(context, value);
-
- let error;
- let {choices, result} = context.withChoices(() => {
- for (let choice of this.choices) {
- let r = choice.normalize(value, context);
- if (!r.error) {
- return r;
- }
-
- error = r;
- }
- });
-
- if (result) {
- return result;
- }
- if (choices.length <= 1) {
- return error;
- }
-
- let n = choices.length - 1;
- choices[n] = `or ${choices[n]}`;
-
- let message = `Value must either: ${choices.join(", ")}`;
-
- return context.error(message, null);
- }
-
- checkBaseType(baseType) {
- return this.choices.some(t => t.checkBaseType(baseType));
- }
-}
-
-// This is a reference to another type--essentially a typedef.
-class RefType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["$ref", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- let ref = schema.$ref;
- let ns = path[0];
- if (ref.includes(".")) {
- [ns, ref] = ref.split(".");
- }
- return new this(schema, ns, ref);
- }
-
- // For a reference to a type named T declared in namespace NS,
- // namespaceName will be NS and reference will be T.
- constructor(schema, namespaceName, reference) {
- super(schema);
- this.namespaceName = namespaceName;
- this.reference = reference;
- }
-
- get targetType() {
- let ns = Schemas.namespaces.get(this.namespaceName);
- let type = ns.get(this.reference);
- if (!type) {
- throw new Error(`Internal error: Type ${this.reference} not found`);
- }
- return type;
- }
-
- normalize(value, context) {
- this.checkDeprecated(context, value);
- return this.targetType.normalize(value, context);
- }
-
- checkBaseType(baseType) {
- return this.targetType.checkBaseType(baseType);
- }
-}
-
-class StringType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["enum", "minLength", "maxLength", "pattern", "format",
- ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- let enumeration = schema.enum || null;
- if (enumeration) {
- // The "enum" property is either a list of strings that are
- // valid values or else a list of {name, description} objects,
- // where the .name values are the valid values.
- enumeration = enumeration.map(e => {
- if (typeof(e) == "object") {
- return e.name;
- }
- return e;
- });
- }
-
- let pattern = null;
- if (schema.pattern) {
- try {
- pattern = parsePattern(schema.pattern);
- } catch (e) {
- throw new Error(`Internal error: Invalid pattern ${JSON.stringify(schema.pattern)}`);
- }
- }
-
- let format = null;
- if (schema.format) {
- if (!(schema.format in FORMATS)) {
- throw new Error(`Internal error: Invalid string format ${schema.format}`);
- }
- format = FORMATS[schema.format];
- }
- return new this(schema, enumeration,
- schema.minLength || 0,
- schema.maxLength || Infinity,
- pattern,
- format);
- }
-
- constructor(schema, enumeration, minLength, maxLength, pattern, format) {
- super(schema);
- this.enumeration = enumeration;
- this.minLength = minLength;
- this.maxLength = maxLength;
- this.pattern = pattern;
- this.format = format;
- }
-
- normalize(value, context) {
- let r = this.normalizeBase("string", value, context);
- if (r.error) {
- return r;
- }
- value = r.value;
-
- if (this.enumeration) {
- if (this.enumeration.includes(value)) {
- return this.postprocess({value}, context);
- }
-
- let choices = this.enumeration.map(JSON.stringify).join(", ");
-
- return context.error(`Invalid enumeration value ${JSON.stringify(value)}`,
- `be one of [${choices}]`);
- }
-
- if (value.length < this.minLength) {
- return context.error(`String ${JSON.stringify(value)} is too short (must be ${this.minLength})`,
- `be longer than ${this.minLength}`);
- }
- if (value.length > this.maxLength) {
- return context.error(`String ${JSON.stringify(value)} is too long (must be ${this.maxLength})`,
- `be shorter than ${this.maxLength}`);
- }
-
- if (this.pattern && !this.pattern.test(value)) {
- return context.error(`String ${JSON.stringify(value)} must match ${this.pattern}`,
- `match the pattern ${this.pattern.toSource()}`);
- }
-
- if (this.format) {
- try {
- r.value = this.format(r.value, context);
- } catch (e) {
- return context.error(String(e), `match the format "${this.format.name}"`);
- }
- }
-
- return r;
- }
-
- checkBaseType(baseType) {
- return baseType == "string";
- }
-
- inject(path, name, dest, context) {
- if (this.enumeration) {
- exportLazyGetter(dest, name, () => {
- let obj = Cu.createObjectIn(dest);
- for (let e of this.enumeration) {
- obj[e.toUpperCase()] = e;
- }
- return obj;
- });
- }
- }
-}
-
-let SubModuleType;
-class ObjectType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["properties", "patternProperties", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- if ("functions" in schema) {
- return SubModuleType.parseSchema(schema, path, extraProperties);
- }
-
- if (!("$extend" in schema)) {
- // Only allow extending "properties" and "patternProperties".
- extraProperties = ["additionalProperties", "isInstanceOf", ...extraProperties];
- }
- this.checkSchemaProperties(schema, path, extraProperties);
-
- let parseProperty = (schema, extraProps = []) => {
- return {
- type: Schemas.parseSchema(schema, path,
- ["unsupported", "onError", "permissions", ...extraProps]),
- optional: schema.optional || false,
- unsupported: schema.unsupported || false,
- onError: schema.onError || null,
- };
- };
-
- // Parse explicit "properties" object.
- let properties = Object.create(null);
- for (let propName of Object.keys(schema.properties || {})) {
- properties[propName] = parseProperty(schema.properties[propName], ["optional"]);
- }
-
- // Parse regexp properties from "patternProperties" object.
- let patternProperties = [];
- for (let propName of Object.keys(schema.patternProperties || {})) {
- let pattern;
- try {
- pattern = parsePattern(propName);
- } catch (e) {
- throw new Error(`Internal error: Invalid property pattern ${JSON.stringify(propName)}`);
- }
-
- patternProperties.push({
- pattern,
- type: parseProperty(schema.patternProperties[propName]),
- });
- }
-
- // Parse "additionalProperties" schema.
- let additionalProperties = null;
- if (schema.additionalProperties) {
- let type = schema.additionalProperties;
- if (type === true) {
- type = {"type": "any"};
- }
-
- additionalProperties = Schemas.parseSchema(type, path);
- }
-
- return new this(schema, properties, additionalProperties, patternProperties, schema.isInstanceOf || null);
- }
-
- constructor(schema, properties, additionalProperties, patternProperties, isInstanceOf) {
- super(schema);
- this.properties = properties;
- this.additionalProperties = additionalProperties;
- this.patternProperties = patternProperties;
- this.isInstanceOf = isInstanceOf;
- }
-
- extend(type) {
- for (let key of Object.keys(type.properties)) {
- if (key in this.properties) {
- throw new Error(`InternalError: Attempt to extend an object with conflicting property "${key}"`);
- }
- this.properties[key] = type.properties[key];
- }
-
- this.patternProperties.push(...type.patternProperties);
-
- return this;
- }
-
- checkBaseType(baseType) {
- return baseType == "object";
- }
-
- /**
- * Extracts the enumerable properties of the given object, including
- * function properties which would normally be omitted by X-ray
- * wrappers.
- *
- * @param {object} value
- * @param {Context} context
- * The current parse context.
- * @returns {object}
- * An object with an `error` or `value` property.
- */
- extractProperties(value, context) {
- // |value| should be a JS Xray wrapping an object in the
- // extension compartment. This works well except when we need to
- // access callable properties on |value| since JS Xrays don't
- // support those. To work around the problem, we verify that
- // |value| is a plain JS object (i.e., not anything scary like a
- // Proxy). Then we copy the properties out of it into a normal
- // object using a waiver wrapper.
-
- let klass = Cu.getClassName(value, true);
- if (klass != "Object") {
- throw context.error(`Expected a plain JavaScript object, got a ${klass}`,
- `be a plain JavaScript object`);
- }
-
- let properties = Object.create(null);
-
- let waived = Cu.waiveXrays(value);
- for (let prop of Object.getOwnPropertyNames(waived)) {
- let desc = Object.getOwnPropertyDescriptor(waived, prop);
- if (desc.get || desc.set) {
- throw context.error("Objects cannot have getters or setters on properties",
- "contain no getter or setter properties");
- }
- // Chrome ignores non-enumerable properties.
- if (desc.enumerable) {
- properties[prop] = Cu.unwaiveXrays(desc.value);
- }
- }
-
- return properties;
- }
-
- checkProperty(context, prop, propType, result, properties, remainingProps) {
- let {type, optional, unsupported, onError} = propType;
- let error = null;
-
- if (unsupported) {
- if (prop in properties) {
- error = context.error(`Property "${prop}" is unsupported by Firefox`,
- `not contain an unsupported "${prop}" property`);
- }
- } else if (prop in properties) {
- if (optional && (properties[prop] === null || properties[prop] === undefined)) {
- result[prop] = null;
- } else {
- let r = context.withPath(prop, () => type.normalize(properties[prop], context));
- if (r.error) {
- error = r;
- } else {
- result[prop] = r.value;
- properties[prop] = r.value;
- }
- }
- remainingProps.delete(prop);
- } else if (!optional) {
- error = context.error(`Property "${prop}" is required`,
- `contain the required "${prop}" property`);
- } else if (optional !== "omit-key-if-missing") {
- result[prop] = null;
- }
-
- if (error) {
- if (onError == "warn") {
- context.logError(error.error);
- } else if (onError != "ignore") {
- throw error;
- }
-
- result[prop] = null;
- }
- }
-
- normalize(value, context) {
- try {
- let v = this.normalizeBase("object", value, context);
- if (v.error) {
- return v;
- }
- value = v.value;
-
- if (this.isInstanceOf) {
- if (Object.keys(this.properties).length ||
- this.patternProperties.length ||
- !(this.additionalProperties instanceof AnyType)) {
- throw new Error("InternalError: isInstanceOf can only be used with objects that are otherwise unrestricted");
- }
-
- if (!instanceOf(value, this.isInstanceOf)) {
- return context.error(`Object must be an instance of ${this.isInstanceOf}`,
- `be an instance of ${this.isInstanceOf}`);
- }
-
- // This is kind of a hack, but we can't normalize things that
- // aren't JSON, so we just return them.
- return this.postprocess({value}, context);
- }
-
- let properties = this.extractProperties(value, context);
- let remainingProps = new Set(Object.keys(properties));
-
- let result = {};
- for (let prop of Object.keys(this.properties)) {
- this.checkProperty(context, prop, this.properties[prop], result,
- properties, remainingProps);
- }
-
- for (let prop of Object.keys(properties)) {
- for (let {pattern, type} of this.patternProperties) {
- if (pattern.test(prop)) {
- this.checkProperty(context, prop, type, result,
- properties, remainingProps);
- }
- }
- }
-
- if (this.additionalProperties) {
- for (let prop of remainingProps) {
- let type = this.additionalProperties;
- let r = context.withPath(prop, () => type.normalize(properties[prop], context));
- if (r.error) {
- return r;
- }
- result[prop] = r.value;
- }
- } else if (remainingProps.size == 1) {
- return context.error(`Unexpected property "${[...remainingProps]}"`,
- `not contain an unexpected "${[...remainingProps]}" property`);
- } else if (remainingProps.size) {
- let props = [...remainingProps].sort().join(", ");
- return context.error(`Unexpected properties: ${props}`,
- `not contain the unexpected properties [${props}]`);
- }
-
- return this.postprocess({value: result}, context);
- } catch (e) {
- if (e.error) {
- return e;
- }
- throw e;
- }
- }
-}
-
-// This type is just a placeholder to be referred to by
-// SubModuleProperty. No value is ever expected to have this type.
-SubModuleType = class SubModuleType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["functions", "events", "properties", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- // The path we pass in here is only used for error messages.
- path = [...path, schema.id];
- let functions = schema.functions.map(fun => Schemas.parseFunction(path, fun));
-
- return new this(functions);
- }
-
- constructor(functions) {
- super();
- this.functions = functions;
- }
-};
-
-class NumberType extends Type {
- normalize(value, context) {
- let r = this.normalizeBase("number", value, context);
- if (r.error) {
- return r;
- }
-
- if (isNaN(r.value) || !Number.isFinite(r.value)) {
- return context.error("NaN and infinity are not valid",
- "be a finite number");
- }
-
- return r;
- }
-
- checkBaseType(baseType) {
- return baseType == "number" || baseType == "integer";
- }
-}
-
-class IntegerType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["minimum", "maximum", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- return new this(schema, schema.minimum || -Infinity, schema.maximum || Infinity);
- }
-
- constructor(schema, minimum, maximum) {
- super(schema);
- this.minimum = minimum;
- this.maximum = maximum;
- }
-
- normalize(value, context) {
- let r = this.normalizeBase("integer", value, context);
- if (r.error) {
- return r;
- }
- value = r.value;
-
- // Ensure it's between -2**31 and 2**31-1
- if (!Number.isSafeInteger(value)) {
- return context.error("Integer is out of range",
- "be a valid 32 bit signed integer");
- }
-
- if (value < this.minimum) {
- return context.error(`Integer ${value} is too small (must be at least ${this.minimum})`,
- `be at least ${this.minimum}`);
- }
- if (value > this.maximum) {
- return context.error(`Integer ${value} is too big (must be at most ${this.maximum})`,
- `be no greater than ${this.maximum}`);
- }
-
- return this.postprocess(r, context);
- }
-
- checkBaseType(baseType) {
- return baseType == "integer";
- }
-}
-
-class BooleanType extends Type {
- normalize(value, context) {
- return this.normalizeBase("boolean", value, context);
- }
-
- checkBaseType(baseType) {
- return baseType == "boolean";
- }
-}
-
-class ArrayType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["items", "minItems", "maxItems", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- let items = Schemas.parseSchema(schema.items, path);
-
- return new this(schema, items, schema.minItems || 0, schema.maxItems || Infinity);
- }
-
- constructor(schema, itemType, minItems, maxItems) {
- super(schema);
- this.itemType = itemType;
- this.minItems = minItems;
- this.maxItems = maxItems;
- }
-
- normalize(value, context) {
- let v = this.normalizeBase("array", value, context);
- if (v.error) {
- return v;
- }
- value = v.value;
-
- let result = [];
- for (let [i, element] of value.entries()) {
- element = context.withPath(String(i), () => this.itemType.normalize(element, context));
- if (element.error) {
- return element;
- }
- result.push(element.value);
- }
-
- if (result.length < this.minItems) {
- return context.error(`Array requires at least ${this.minItems} items; you have ${result.length}`,
- `have at least ${this.minItems} items`);
- }
-
- if (result.length > this.maxItems) {
- return context.error(`Array requires at most ${this.maxItems} items; you have ${result.length}`,
- `have at most ${this.maxItems} items`);
- }
-
- return this.postprocess({value: result}, context);
- }
-
- checkBaseType(baseType) {
- return baseType == "array";
- }
-}
-
-class FunctionType extends Type {
- static get EXTRA_PROPERTIES() {
- return ["parameters", "async", "returns", ...super.EXTRA_PROPERTIES];
- }
-
- static parseSchema(schema, path, extraProperties = []) {
- this.checkSchemaProperties(schema, path, extraProperties);
-
- let isAsync = !!schema.async;
- let isExpectingCallback = typeof schema.async === "string";
- let parameters = null;
- if ("parameters" in schema) {
- parameters = [];
- for (let param of schema.parameters) {
- // Callbacks default to optional for now, because of promise
- // handling.
- let isCallback = isAsync && param.name == schema.async;
- if (isCallback) {
- isExpectingCallback = false;
- }
-
- parameters.push({
- type: Schemas.parseSchema(param, path, ["name", "optional", "default"]),
- name: param.name,
- optional: param.optional == null ? isCallback : param.optional,
- default: param.default == undefined ? null : param.default,
- });
- }
- }
- if (isExpectingCallback) {
- throw new Error(`Internal error: Expected a callback parameter with name ${schema.async}`);
- }
-
- let hasAsyncCallback = false;
- if (isAsync) {
- hasAsyncCallback = (parameters &&
- parameters.length &&
- parameters[parameters.length - 1].name == schema.async);
-
- if (schema.returns) {
- throw new Error("Internal error: Async functions must not have return values.");
- }
- if (schema.allowAmbiguousOptionalArguments && !hasAsyncCallback) {
- throw new Error("Internal error: Async functions with ambiguous arguments must declare the callback as the last parameter");
- }
- }
-
- return new this(schema, parameters, isAsync, hasAsyncCallback);
- }
-
- constructor(schema, parameters, isAsync, hasAsyncCallback) {
- super(schema);
- this.parameters = parameters;
- this.isAsync = isAsync;
- this.hasAsyncCallback = hasAsyncCallback;
- }
-
- normalize(value, context) {
- return this.normalizeBase("function", value, context);
- }
-
- checkBaseType(baseType) {
- return baseType == "function";
- }
-}
-
-// Represents a "property" defined in a schema namespace with a
-// particular value. Essentially this is a constant.
-class ValueProperty extends Entry {
- constructor(schema, name, value) {
- super(schema);
- this.name = name;
- this.value = value;
- }
-
- inject(path, name, dest, context) {
- dest[name] = this.value;
- }
-}
-
-// Represents a "property" defined in a schema namespace that is not a
-// constant.
-class TypeProperty extends Entry {
- constructor(schema, namespaceName, name, type, writable) {
- super(schema);
- this.namespaceName = namespaceName;
- this.name = name;
- this.type = type;
- this.writable = writable;
- }
-
- throwError(context, msg) {
- throw context.makeError(`${msg} for ${this.namespaceName}.${this.name}.`);
- }
-
- inject(path, name, dest, context) {
- if (this.unsupported) {
- return;
- }
-
- let apiImpl = context.getImplementation(path.join("."), name);
-
- let getStub = () => {
- this.checkDeprecated(context);
- return apiImpl.getProperty();
- };
-
- let desc = {
- configurable: false,
- enumerable: true,
-
- get: Cu.exportFunction(getStub, dest),
- };
-
- if (this.writable) {
- let setStub = (value) => {
- let normalized = this.type.normalize(value, context);
- if (normalized.error) {
- this.throwError(context, normalized.error);
- }
-
- apiImpl.setProperty(normalized.value);
- };
-
- desc.set = Cu.exportFunction(setStub, dest);
- }
-
- Object.defineProperty(dest, name, desc);
- }
-}
-
-class SubModuleProperty extends Entry {
- // A SubModuleProperty represents a tree of objects and properties
- // to expose to an extension. Currently we support only a limited
- // form of sub-module properties, where "$ref" points to a
- // SubModuleType containing a list of functions and "properties" is
- // a list of additional simple properties.
- //
- // name: Name of the property stuff is being added to.
- // namespaceName: Namespace in which the property lives.
- // reference: Name of the type defining the functions to add to the property.
- // properties: Additional properties to add to the module (unsupported).
- constructor(schema, name, namespaceName, reference, properties) {
- super(schema);
- this.name = name;
- this.namespaceName = namespaceName;
- this.reference = reference;
- this.properties = properties;
- }
-
- inject(path, name, dest, context) {
- exportLazyGetter(dest, name, () => {
- let obj = Cu.createObjectIn(dest);
-
- let ns = Schemas.namespaces.get(this.namespaceName);
- let type = ns.get(this.reference);
- if (!type && this.reference.includes(".")) {
- let [namespaceName, ref] = this.reference.split(".");
- ns = Schemas.namespaces.get(namespaceName);
- type = ns.get(ref);
- }
- if (!type || !(type instanceof SubModuleType)) {
- throw new Error(`Internal error: ${this.namespaceName}.${this.reference} is not a sub-module`);
- }
-
- let functions = type.functions;
- for (let fun of functions) {
- let subpath = path.concat(name);
- let namespace = subpath.join(".");
- let allowedContexts = fun.allowedContexts.length ? fun.allowedContexts : ns.defaultContexts;
- if (context.shouldInject(namespace, fun.name, allowedContexts)) {
- fun.inject(subpath, fun.name, obj, context);
- }
- }
-
- // TODO: Inject this.properties.
-
- return obj;
- });
- }
-}
-
-// This class is a base class for FunctionEntrys and Events. It takes
-// care of validating parameter lists (i.e., handling of optional
-// parameters and parameter type checking).
-class CallEntry extends Entry {
- constructor(schema, path, name, parameters, allowAmbiguousOptionalArguments) {
- super(schema);
- this.path = path;
- this.name = name;
- this.parameters = parameters;
- this.allowAmbiguousOptionalArguments = allowAmbiguousOptionalArguments;
- }
-
- throwError(context, msg) {
- throw context.makeError(`${msg} for ${this.path.join(".")}.${this.name}.`);
- }
-
- checkParameters(args, context) {
- let fixedArgs = [];
-
- // First we create a new array, fixedArgs, that is the same as
- // |args| but with default values in place of omitted optional parameters.
- let check = (parameterIndex, argIndex) => {
- if (parameterIndex == this.parameters.length) {
- if (argIndex == args.length) {
- return true;
- }
- return false;
- }
-
- let parameter = this.parameters[parameterIndex];
- if (parameter.optional) {
- // Try skipping it.
- fixedArgs[parameterIndex] = parameter.default;
- if (check(parameterIndex + 1, argIndex)) {
- return true;
- }
- }
-
- if (argIndex == args.length) {
- return false;
- }
-
- let arg = args[argIndex];
- if (!parameter.type.checkBaseType(getValueBaseType(arg))) {
- // For Chrome compatibility, use the default value if null or undefined
- // is explicitly passed but is not a valid argument in this position.
- if (parameter.optional && (arg === null || arg === undefined)) {
- fixedArgs[parameterIndex] = Cu.cloneInto(parameter.default, global);
- } else {
- return false;
- }
- } else {
- fixedArgs[parameterIndex] = arg;
- }
-
- return check(parameterIndex + 1, argIndex + 1);
- };
-
- if (this.allowAmbiguousOptionalArguments) {
- // When this option is set, it's up to the implementation to
- // parse arguments.
- // The last argument for asynchronous methods is either a function or null.
- // This is specifically done for runtime.sendMessage.
- if (this.hasAsyncCallback && typeof(args[args.length - 1]) != "function") {
- args.push(null);
- }
- return args;
- }
- let success = check(0, 0);
- if (!success) {
- this.throwError(context, "Incorrect argument types");
- }
-
- // Now we normalize (and fully type check) all non-omitted arguments.
- fixedArgs = fixedArgs.map((arg, parameterIndex) => {
- if (arg === null) {
- return null;
- }
- let parameter = this.parameters[parameterIndex];
- let r = parameter.type.normalize(arg, context);
- if (r.error) {
- this.throwError(context, `Type error for parameter ${parameter.name} (${r.error})`);
- }
- return r.value;
- });
-
- return fixedArgs;
- }
-}
-
-// Represents a "function" defined in a schema namespace.
-class FunctionEntry extends CallEntry {
- constructor(schema, path, name, type, unsupported, allowAmbiguousOptionalArguments, returns, permissions) {
- super(schema, path, name, type.parameters, allowAmbiguousOptionalArguments);
- this.unsupported = unsupported;
- this.returns = returns;
- this.permissions = permissions;
-
- this.isAsync = type.isAsync;
- this.hasAsyncCallback = type.hasAsyncCallback;
- }
-
- inject(path, name, dest, context) {
- if (this.unsupported) {
- return;
- }
-
- if (this.permissions && !this.permissions.some(perm => context.hasPermission(perm))) {
- return;
- }
-
- exportLazyGetter(dest, name, () => {
- let apiImpl = context.getImplementation(path.join("."), name);
-
- let stub;
- if (this.isAsync) {
- stub = (...args) => {
- this.checkDeprecated(context);
- let actuals = this.checkParameters(args, context);
- let callback = null;
- if (this.hasAsyncCallback) {
- callback = actuals.pop();
- }
- if (callback === null && context.isChromeCompat) {
- // We pass an empty stub function as a default callback for
- // the `chrome` API, so promise objects are not returned,
- // and lastError values are reported immediately.
- callback = () => {};
- }
- return apiImpl.callAsyncFunction(actuals, callback);
- };
- } else if (!this.returns) {
- stub = (...args) => {
- this.checkDeprecated(context);
- let actuals = this.checkParameters(args, context);
- return apiImpl.callFunctionNoReturn(actuals);
- };
- } else {
- stub = (...args) => {
- this.checkDeprecated(context);
- let actuals = this.checkParameters(args, context);
- return apiImpl.callFunction(actuals);
- };
- }
- return Cu.exportFunction(stub, dest);
- });
- }
-}
-
-// Represents an "event" defined in a schema namespace.
-class Event extends CallEntry {
- constructor(schema, path, name, type, extraParameters, unsupported, permissions) {
- super(schema, path, name, extraParameters);
- this.type = type;
- this.unsupported = unsupported;
- this.permissions = permissions;
- }
-
- checkListener(listener, context) {
- let r = this.type.normalize(listener, context);
- if (r.error) {
- this.throwError(context, "Invalid listener");
- }
- return r.value;
- }
-
- inject(path, name, dest, context) {
- if (this.unsupported) {
- return;
- }
-
- if (this.permissions && !this.permissions.some(perm => context.hasPermission(perm))) {
- return;
- }
-
- exportLazyGetter(dest, name, () => {
- let apiImpl = context.getImplementation(path.join("."), name);
-
- let addStub = (listener, ...args) => {
- listener = this.checkListener(listener, context);
- let actuals = this.checkParameters(args, context);
- apiImpl.addListener(listener, actuals);
- };
-
- let removeStub = (listener) => {
- listener = this.checkListener(listener, context);
- apiImpl.removeListener(listener);
- };
-
- let hasStub = (listener) => {
- listener = this.checkListener(listener, context);
- return apiImpl.hasListener(listener);
- };
-
- let obj = Cu.createObjectIn(dest);
-
- Cu.exportFunction(addStub, obj, {defineAs: "addListener"});
- Cu.exportFunction(removeStub, obj, {defineAs: "removeListener"});
- Cu.exportFunction(hasStub, obj, {defineAs: "hasListener"});
-
- return obj;
- });
- }
-}
-
-const TYPES = Object.freeze(Object.assign(Object.create(null), {
- any: AnyType,
- array: ArrayType,
- boolean: BooleanType,
- function: FunctionType,
- integer: IntegerType,
- number: NumberType,
- object: ObjectType,
- string: StringType,
-}));
-
-this.Schemas = {
- initialized: false,
-
- // Maps a schema URL to the JSON contained in that schema file. This
- // is useful for sending the JSON across processes.
- schemaJSON: new Map(),
-
- // Map[<schema-name> -> Map[<symbol-name> -> Entry]]
- // This keeps track of all the schemas that have been loaded so far.
- namespaces: new Map(),
-
- register(namespaceName, symbol, value) {
- let ns = this.namespaces.get(namespaceName);
- if (!ns) {
- ns = new Map();
- ns.name = namespaceName;
- ns.permissions = null;
- ns.allowedContexts = [];
- ns.defaultContexts = [];
- this.namespaces.set(namespaceName, ns);
- }
- ns.set(symbol, value);
- },
-
- parseSchema(schema, path, extraProperties = []) {
- let allowedProperties = new Set(extraProperties);
-
- if ("choices" in schema) {
- return ChoiceType.parseSchema(schema, path, allowedProperties);
- } else if ("$ref" in schema) {
- return RefType.parseSchema(schema, path, allowedProperties);
- }
-
- if (!("type" in schema)) {
- throw new Error(`Unexpected value for type: ${JSON.stringify(schema)}`);
- }
-
- allowedProperties.add("type");
-
- let type = TYPES[schema.type];
- if (!type) {
- throw new Error(`Unexpected type ${schema.type}`);
- }
- return type.parseSchema(schema, path, allowedProperties);
- },
-
- parseFunction(path, fun) {
- let f = new FunctionEntry(fun, path, fun.name,
- this.parseSchema(fun, path,
- ["name", "unsupported", "returns",
- "permissions",
- "allowAmbiguousOptionalArguments"]),
- fun.unsupported || false,
- fun.allowAmbiguousOptionalArguments || false,
- fun.returns || null,
- fun.permissions || null);
- return f;
- },
-
- loadType(namespaceName, type) {
- if ("$extend" in type) {
- this.extendType(namespaceName, type);
- } else {
- this.register(namespaceName, type.id, this.parseSchema(type, [namespaceName], ["id"]));
- }
- },
-
- extendType(namespaceName, type) {
- let ns = Schemas.namespaces.get(namespaceName);
- let targetType = ns && ns.get(type.$extend);
-
- // Only allow extending object and choices types for now.
- if (targetType instanceof ObjectType) {
- type.type = "object";
- } else if (!targetType) {
- throw new Error(`Internal error: Attempt to extend a nonexistant type ${type.$extend}`);
- } else if (!(targetType instanceof ChoiceType)) {
- throw new Error(`Internal error: Attempt to extend a non-extensible type ${type.$extend}`);
- }
-
- let parsed = this.parseSchema(type, [namespaceName], ["$extend"]);
- if (parsed.constructor !== targetType.constructor) {
- throw new Error(`Internal error: Bad attempt to extend ${type.$extend}`);
- }
-
- targetType.extend(parsed);
- },
-
- loadProperty(namespaceName, name, prop) {
- if ("$ref" in prop) {
- if (!prop.unsupported) {
- this.register(namespaceName, name, new SubModuleProperty(prop, name, namespaceName, prop.$ref,
- prop.properties || {}));
- }
- } else if ("value" in prop) {
- this.register(namespaceName, name, new ValueProperty(prop, name, prop.value));
- } else {
- // We ignore the "optional" attribute on properties since we
- // don't inject anything here anyway.
- let type = this.parseSchema(prop, [namespaceName], ["optional", "writable"]);
- this.register(namespaceName, name, new TypeProperty(prop, namespaceName, name, type, prop.writable || false));
- }
- },
-
- loadFunction(namespaceName, fun) {
- let f = this.parseFunction([namespaceName], fun);
- this.register(namespaceName, fun.name, f);
- },
-
- loadEvent(namespaceName, event) {
- let extras = event.extraParameters || [];
- extras = extras.map(param => {
- return {
- type: this.parseSchema(param, [namespaceName], ["name", "optional", "default"]),
- name: param.name,
- optional: param.optional || false,
- default: param.default == undefined ? null : param.default,
- };
- });
-
- // We ignore these properties for now.
- /* eslint-disable no-unused-vars */
- let returns = event.returns;
- let filters = event.filters;
- /* eslint-enable no-unused-vars */
-
- let type = this.parseSchema(event, [namespaceName],
- ["name", "unsupported", "permissions",
- "extraParameters", "returns", "filters"]);
-
- let e = new Event(event, [namespaceName], event.name, type, extras,
- event.unsupported || false,
- event.permissions || null);
- this.register(namespaceName, event.name, e);
- },
-
- init() {
- if (this.initialized) {
- return;
- }
- this.initialized = true;
-
- if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
- let data = Services.cpmm.initialProcessData;
- let schemas = data["Extension:Schemas"];
- if (schemas) {
- this.schemaJSON = schemas;
- }
- Services.cpmm.addMessageListener("Schema:Add", this);
- }
-
- this.flushSchemas();
- },
-
- receiveMessage(msg) {
- switch (msg.name) {
- case "Schema:Add":
- this.schemaJSON.set(msg.data.url, msg.data.schema);
- this.flushSchemas();
- break;
-
- case "Schema:Delete":
- this.schemaJSON.delete(msg.data.url);
- this.flushSchemas();
- break;
- }
- },
-
- flushSchemas() {
- XPCOMUtils.defineLazyGetter(this, "namespaces",
- () => this.parseSchemas());
- },
-
- parseSchemas() {
- Object.defineProperty(this, "namespaces", {
- enumerable: true,
- configurable: true,
- value: new Map(),
- });
-
- for (let json of this.schemaJSON.values()) {
- try {
- this.loadSchema(json);
- } catch (e) {
- Cu.reportError(e);
- }
- }
-
- return this.namespaces;
- },
-
- loadSchema(json) {
- for (let namespace of json) {
- let name = namespace.namespace;
-
- let types = namespace.types || [];
- for (let type of types) {
- this.loadType(name, type);
- }
-
- let properties = namespace.properties || {};
- for (let propertyName of Object.keys(properties)) {
- this.loadProperty(name, propertyName, properties[propertyName]);
- }
-
- let functions = namespace.functions || [];
- for (let fun of functions) {
- this.loadFunction(name, fun);
- }
-
- let events = namespace.events || [];
- for (let event of events) {
- this.loadEvent(name, event);
- }
-
- let ns = this.namespaces.get(name);
- ns.permissions = namespace.permissions || null;
- ns.allowedContexts = namespace.allowedContexts || [];
- ns.defaultContexts = namespace.defaultContexts || [];
- }
- },
-
- load(url) {
- if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_CONTENT) {
- return readJSON(url).then(json => {
- this.schemaJSON.set(url, json);
-
- let data = Services.ppmm.initialProcessData;
- data["Extension:Schemas"] = this.schemaJSON;
-
- Services.ppmm.broadcastAsyncMessage("Schema:Add", {url, schema: json});
-
- this.flushSchemas();
- });
- }
- },
-
- unload(url) {
- this.schemaJSON.delete(url);
-
- let data = Services.ppmm.initialProcessData;
- data["Extension:Schemas"] = this.schemaJSON;
-
- Services.ppmm.broadcastAsyncMessage("Schema:Delete", {url});
-
- this.flushSchemas();
- },
-
- /**
- * Checks whether a given object has the necessary permissions to
- * expose the given namespace.
- *
- * @param {string} namespace
- * The top-level namespace to check permissions for.
- * @param {object} wrapperFuncs
- * Wrapper functions for the given context.
- * @param {function} wrapperFuncs.hasPermission
- * A function which, when given a string argument, returns true
- * if the context has the given permission.
- * @returns {boolean}
- * True if the context has permission for the given namespace.
- */
- checkPermissions(namespace, wrapperFuncs) {
- let ns = this.namespaces.get(namespace);
- if (ns && ns.permissions) {
- return ns.permissions.some(perm => wrapperFuncs.hasPermission(perm));
- }
- return true;
- },
-
- exportLazyGetter,
-
- /**
- * Inject registered extension APIs into `dest`.
- *
- * @param {object} dest The root namespace for the APIs.
- * This object is usually exposed to extensions as "chrome" or "browser".
- * @param {object} wrapperFuncs An implementation of the InjectionContext
- * interface, which runs the actual functionality of the generated API.
- */
- inject(dest, wrapperFuncs) {
- let context = new InjectionContext(wrapperFuncs);
-
- let createNamespace = ns => {
- let obj = Cu.createObjectIn(dest);
-
- for (let [name, entry] of ns) {
- let allowedContexts = entry.allowedContexts;
- if (!allowedContexts.length) {
- allowedContexts = ns.defaultContexts;
- }
-
- if (context.shouldInject(ns.name, name, allowedContexts)) {
- entry.inject([ns.name], name, obj, context);
- }
- }
-
- // Remove the namespace object if it is empty
- if (Object.keys(obj).length) {
- return obj;
- }
- };
-
- let createNestedNamespaces = (parent, namespaces) => {
- for (let [prop, namespace] of namespaces) {
- if (namespace instanceof DeepMap) {
- exportLazyGetter(parent, prop, () => {
- let obj = Cu.createObjectIn(parent);
- createNestedNamespaces(obj, namespace);
- return obj;
- });
- } else {
- exportLazyGetter(parent, prop,
- () => createNamespace(namespace));
- }
- }
- };
-
- let nestedNamespaces = new DeepMap();
- for (let ns of this.namespaces.values()) {
- if (ns.permissions && !ns.permissions.some(perm => context.hasPermission(perm))) {
- continue;
- }
-
- if (!wrapperFuncs.shouldInject(ns.name, null, ns.allowedContexts)) {
- continue;
- }
-
- if (ns.name.includes(".")) {
- let path = ns.name.split(".");
- let leafName = path.pop();
-
- let parent = nestedNamespaces.getPath(...path);
-
- parent.set(leafName, ns);
- } else {
- exportLazyGetter(dest, ns.name,
- () => createNamespace(ns));
- }
- }
-
- createNestedNamespaces(dest, nestedNamespaces);
- },
-
- /**
- * Normalize `obj` according to the loaded schema for `typeName`.
- *
- * @param {object} obj The object to normalize against the schema.
- * @param {string} typeName The name in the format namespace.propertyname
- * @param {object} context An implementation of Context. Any validation errors
- * are reported to the given context.
- * @returns {object} The normalized object.
- */
- normalize(obj, typeName, context) {
- let [namespaceName, prop] = typeName.split(".");
- let ns = this.namespaces.get(namespaceName);
- let type = ns.get(prop);
-
- return type.normalize(obj, new Context(context));
- },
-};
diff --git a/toolkit/components/webextensions/ext-alarms.js b/toolkit/components/webextensions/ext-alarms.js
deleted file mode 100644
index 2171e7dba6..0000000000
--- a/toolkit/components/webextensions/ext-alarms.js
+++ /dev/null
@@ -1,155 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- EventManager,
-} = ExtensionUtils;
-
-// WeakMap[Extension -> Map[name -> Alarm]]
-var alarmsMap = new WeakMap();
-
-// WeakMap[Extension -> Set[callback]]
-var alarmCallbacksMap = new WeakMap();
-
-// Manages an alarm created by the extension (alarms API).
-function Alarm(extension, name, alarmInfo) {
- this.extension = extension;
- this.name = name;
- this.when = alarmInfo.when;
- this.delayInMinutes = alarmInfo.delayInMinutes;
- this.periodInMinutes = alarmInfo.periodInMinutes;
- this.canceled = false;
-
- let delay, scheduledTime;
- if (this.when) {
- scheduledTime = this.when;
- delay = this.when - Date.now();
- } else {
- if (!this.delayInMinutes) {
- this.delayInMinutes = this.periodInMinutes;
- }
- delay = this.delayInMinutes * 60 * 1000;
- scheduledTime = Date.now() + delay;
- }
-
- this.scheduledTime = scheduledTime;
-
- let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- timer.init(this, delay, Ci.nsITimer.TYPE_ONE_SHOT);
- this.timer = timer;
-}
-
-Alarm.prototype = {
- clear() {
- this.timer.cancel();
- alarmsMap.get(this.extension).delete(this.name);
- this.canceled = true;
- },
-
- observe(subject, topic, data) {
- if (this.canceled) {
- return;
- }
-
- for (let callback of alarmCallbacksMap.get(this.extension)) {
- callback(this);
- }
-
- if (!this.periodInMinutes) {
- this.clear();
- return;
- }
-
- let delay = this.periodInMinutes * 60 * 1000;
- this.scheduledTime = Date.now() + delay;
- this.timer.init(this, delay, Ci.nsITimer.TYPE_ONE_SHOT);
- },
-
- get data() {
- return {
- name: this.name,
- scheduledTime: this.scheduledTime,
- periodInMinutes: this.periodInMinutes,
- };
- },
-};
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("startup", (type, extension) => {
- alarmsMap.set(extension, new Map());
- alarmCallbacksMap.set(extension, new Set());
-});
-
-extensions.on("shutdown", (type, extension) => {
- if (alarmsMap.has(extension)) {
- for (let alarm of alarmsMap.get(extension).values()) {
- alarm.clear();
- }
- alarmsMap.delete(extension);
- alarmCallbacksMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-extensions.registerSchemaAPI("alarms", "addon_parent", context => {
- let {extension} = context;
- return {
- alarms: {
- create: function(name, alarmInfo) {
- name = name || "";
- let alarms = alarmsMap.get(extension);
- if (alarms.has(name)) {
- alarms.get(name).clear();
- }
- let alarm = new Alarm(extension, name, alarmInfo);
- alarms.set(alarm.name, alarm);
- },
-
- get: function(name) {
- name = name || "";
- let alarms = alarmsMap.get(extension);
- if (alarms.has(name)) {
- return Promise.resolve(alarms.get(name).data);
- }
- return Promise.resolve();
- },
-
- getAll: function() {
- let result = Array.from(alarmsMap.get(extension).values(), alarm => alarm.data);
- return Promise.resolve(result);
- },
-
- clear: function(name) {
- name = name || "";
- let alarms = alarmsMap.get(extension);
- if (alarms.has(name)) {
- alarms.get(name).clear();
- return Promise.resolve(true);
- }
- return Promise.resolve(false);
- },
-
- clearAll: function() {
- let cleared = false;
- for (let alarm of alarmsMap.get(extension).values()) {
- alarm.clear();
- cleared = true;
- }
- return Promise.resolve(cleared);
- },
-
- onAlarm: new EventManager(context, "alarms.onAlarm", fire => {
- let callback = alarm => {
- fire(alarm.data);
- };
-
- alarmCallbacksMap.get(extension).add(callback);
- return () => {
- alarmCallbacksMap.get(extension).delete(callback);
- };
- }).api(),
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-backgroundPage.js b/toolkit/components/webextensions/ext-backgroundPage.js
deleted file mode 100644
index fce6100ca1..0000000000
--- a/toolkit/components/webextensions/ext-backgroundPage.js
+++ /dev/null
@@ -1,147 +0,0 @@
-"use strict";
-
-var {interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-const {
- promiseDocumentLoaded,
- promiseObserved,
-} = ExtensionUtils;
-
-const XUL_URL = "data:application/vnd.mozilla.xul+xml;charset=utf-8," + encodeURI(
- `<?xml version="1.0"?>
- <window id="documentElement"/>`);
-
-// WeakMap[Extension -> BackgroundPage]
-var backgroundPagesMap = new WeakMap();
-
-// Responsible for the background_page section of the manifest.
-function BackgroundPage(options, extension) {
- this.extension = extension;
- this.page = options.page || null;
- this.isGenerated = !!options.scripts;
- this.windowlessBrowser = null;
- this.webNav = null;
-}
-
-BackgroundPage.prototype = {
- build: Task.async(function* () {
- let windowlessBrowser = Services.appShell.createWindowlessBrowser(true);
- this.windowlessBrowser = windowlessBrowser;
-
- let url;
- if (this.page) {
- url = this.extension.baseURI.resolve(this.page);
- } else if (this.isGenerated) {
- url = this.extension.baseURI.resolve("_generated_background_page.html");
- }
-
- if (!this.extension.isExtensionURL(url)) {
- this.extension.manifestError("Background page must be a file within the extension");
- url = this.extension.baseURI.resolve("_blank.html");
- }
-
- let system = Services.scriptSecurityManager.getSystemPrincipal();
-
- // The windowless browser is a thin wrapper around a docShell that keeps
- // its related resources alive. It implements nsIWebNavigation and
- // forwards its methods to the underlying docShell, but cannot act as a
- // docShell itself. Calling `getInterface(nsIDocShell)` gives us the
- // underlying docShell, and `QueryInterface(nsIWebNavigation)` gives us
- // access to the webNav methods that are already available on the
- // windowless browser, but contrary to appearances, they are not the same
- // object.
- let chromeShell = windowlessBrowser.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIWebNavigation);
-
- if (PrivateBrowsingUtils.permanentPrivateBrowsing) {
- let attrs = chromeShell.getOriginAttributes();
- attrs.privateBrowsingId = 1;
- chromeShell.setOriginAttributes(attrs);
- }
-
- chromeShell.useGlobalHistory = false;
- chromeShell.createAboutBlankContentViewer(system);
- chromeShell.loadURI(XUL_URL, 0, null, null, null);
-
-
- yield promiseObserved("chrome-document-global-created",
- win => win.document == chromeShell.document);
-
- let chromeDoc = yield promiseDocumentLoaded(chromeShell.document);
-
- let browser = chromeDoc.createElement("browser");
- browser.setAttribute("type", "content");
- browser.setAttribute("disableglobalhistory", "true");
- chromeDoc.documentElement.appendChild(browser);
-
- extensions.emit("extension-browser-inserted", browser);
- browser.messageManager.sendAsyncMessage("Extension:InitExtensionView", {
- viewType: "background",
- url,
- });
-
- yield new Promise(resolve => {
- browser.messageManager.addMessageListener("Extension:ExtensionViewLoaded", function onLoad() {
- browser.messageManager.removeMessageListener("Extension:ExtensionViewLoaded", onLoad);
- resolve();
- });
- });
-
- // TODO(robwu): This is not webext-oop compatible.
- this.webNav = browser.docShell.QueryInterface(Ci.nsIWebNavigation);
- let window = this.webNav.document.defaultView;
-
-
- // Set the add-on's main debugger global, for use in the debugger
- // console.
- if (this.extension.addonData.instanceID) {
- AddonManager.getAddonByInstanceID(this.extension.addonData.instanceID)
- .then(addon => addon.setDebugGlobal(window));
- }
-
- this.extension.emit("startup");
- }),
-
- shutdown() {
- if (this.extension.addonData.instanceID) {
- AddonManager.getAddonByInstanceID(this.extension.addonData.instanceID)
- .then(addon => addon.setDebugGlobal(null));
- }
-
- // Navigate away from the background page to invalidate any
- // setTimeouts or other callbacks.
- if (this.webNav) {
- this.webNav.loadURI("about:blank", 0, null, null, null);
- this.webNav = null;
- }
-
- this.windowlessBrowser.loadURI("about:blank", 0, null, null, null);
- this.windowlessBrowser.close();
- this.windowlessBrowser = null;
- },
-};
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("manifest_background", (type, directive, extension, manifest) => {
- let bgPage = new BackgroundPage(manifest.background, extension);
- backgroundPagesMap.set(extension, bgPage);
- return bgPage.build();
-});
-
-extensions.on("shutdown", (type, extension) => {
- if (backgroundPagesMap.has(extension)) {
- backgroundPagesMap.get(extension).shutdown();
- backgroundPagesMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
diff --git a/toolkit/components/webextensions/ext-browser-content.js b/toolkit/components/webextensions/ext-browser-content.js
deleted file mode 100644
index e14ca50d6a..0000000000
--- a/toolkit/components/webextensions/ext-browser-content.js
+++ /dev/null
@@ -1,217 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "clearTimeout",
- "resource://gre/modules/Timer.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "require",
- "resource://devtools/shared/Loader.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
- "resource://gre/modules/Timer.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "colorUtils", () => {
- return require("devtools/shared/css/color").colorUtils;
-});
-
-const {
- stylesheetMap,
-} = ExtensionUtils;
-
-/* globals addMessageListener, content, docShell, sendAsyncMessage */
-
-// Minimum time between two resizes.
-const RESIZE_TIMEOUT = 100;
-
-const BrowserListener = {
- init({allowScriptsToClose, fixedWidth, maxHeight, maxWidth, stylesheets}) {
- this.fixedWidth = fixedWidth;
- this.stylesheets = stylesheets || [];
-
- this.maxWidth = maxWidth;
- this.maxHeight = maxHeight;
-
- this.oldBackground = null;
-
- if (allowScriptsToClose) {
- content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .allowScriptsToClose();
- }
-
- addEventListener("DOMWindowCreated", this, true);
- addEventListener("load", this, true);
- addEventListener("DOMContentLoaded", this, true);
- addEventListener("DOMWindowClose", this, true);
- addEventListener("MozScrolledAreaChanged", this, true);
- },
-
- destroy() {
- removeEventListener("DOMWindowCreated", this, true);
- removeEventListener("load", this, true);
- removeEventListener("DOMContentLoaded", this, true);
- removeEventListener("DOMWindowClose", this, true);
- removeEventListener("MozScrolledAreaChanged", this, true);
- },
-
- receiveMessage({name, data}) {
- if (name === "Extension:InitBrowser") {
- this.init(data);
- }
- },
-
- handleEvent(event) {
- switch (event.type) {
- case "DOMWindowCreated":
- if (event.target === content.document) {
- let winUtils = content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
-
- for (let url of this.stylesheets) {
- winUtils.addSheet(stylesheetMap.get(url), winUtils.AGENT_SHEET);
- }
- }
- break;
-
- case "DOMWindowClose":
- if (event.target === content) {
- event.preventDefault();
-
- sendAsyncMessage("Extension:DOMWindowClose");
- }
- break;
-
- case "DOMContentLoaded":
- if (event.target === content.document) {
- sendAsyncMessage("Extension:BrowserContentLoaded", {url: content.location.href});
- this.handleDOMChange(true);
- }
- break;
-
- case "load":
- if (event.target.contentWindow === content) {
- // For about:addons inline <browsers>, we currently receive a load
- // event on the <browser> element, but no load or DOMContentLoaded
- // events from the content window.
- sendAsyncMessage("Extension:BrowserContentLoaded", {url: content.location.href});
- } else if (event.target !== content.document) {
- break;
- }
-
- // We use a capturing listener, so we get this event earlier than any
- // load listeners in the content page. Resizing after a timeout ensures
- // that we calculate the size after the entire event cycle has completed
- // (unless someone spins the event loop, anyway), and hopefully after
- // the content has made any modifications.
- Promise.resolve().then(() => {
- this.handleDOMChange(true);
- });
-
- // Mutation observer to make sure the panel shrinks when the content does.
- new content.MutationObserver(this.handleDOMChange.bind(this)).observe(
- content.document.documentElement, {
- attributes: true,
- characterData: true,
- childList: true,
- subtree: true,
- });
- break;
-
- case "MozScrolledAreaChanged":
- this.handleDOMChange();
- break;
- }
- },
-
- // Resizes the browser to match the preferred size of the content (debounced).
- handleDOMChange(ignoreThrottling = false) {
- if (ignoreThrottling && this.resizeTimeout) {
- clearTimeout(this.resizeTimeout);
- this.resizeTimeout = null;
- }
-
- if (this.resizeTimeout == null) {
- this.resizeTimeout = setTimeout(() => {
- try {
- if (content) {
- this._handleDOMChange("delayed");
- }
- } finally {
- this.resizeTimeout = null;
- }
- }, RESIZE_TIMEOUT);
-
- this._handleDOMChange();
- }
- },
-
- _handleDOMChange(detail) {
- let doc = content.document;
-
- let body = doc.body;
- if (!body || doc.compatMode === "BackCompat") {
- // In quirks mode, the root element is used as the scroll frame, and the
- // body lies about its scroll geometry, and returns the values for the
- // root instead.
- body = doc.documentElement;
- }
-
-
- let result;
- if (this.fixedWidth) {
- // If we're in a fixed-width area (namely a slide-in subview of the main
- // menu panel), we need to calculate the view height based on the
- // preferred height of the content document's root scrollable element at the
- // current width, rather than the complete preferred dimensions of the
- // content window.
-
- // Compensate for any offsets (margin, padding, ...) between the scroll
- // area of the body and the outer height of the document.
- let getHeight = elem => elem.getBoundingClientRect(elem).height;
- let bodyPadding = getHeight(doc.documentElement) - getHeight(body);
-
- let height = Math.ceil(body.scrollHeight + bodyPadding);
-
- result = {height, detail};
- } else {
- let background = doc.defaultView.getComputedStyle(body).backgroundColor;
- let bgColor = colorUtils.colorToRGBA(background);
- if (bgColor.a !== 1) {
- // Ignore non-opaque backgrounds.
- background = null;
- }
-
- if (background !== this.oldBackground) {
- sendAsyncMessage("Extension:BrowserBackgroundChanged", {background});
- }
- this.oldBackground = background;
-
-
- // Adjust the size of the browser based on its content's preferred size.
- let {contentViewer} = docShell;
- let ratio = content.devicePixelRatio;
-
- let w = {}, h = {};
- contentViewer.getContentSizeConstrained(this.maxWidth * ratio,
- this.maxHeight * ratio,
- w, h);
-
- let width = Math.ceil(w.value / ratio);
- let height = Math.ceil(h.value / ratio);
-
- result = {width, height, detail};
- }
-
- sendAsyncMessage("Extension:BrowserResized", result);
- },
-};
-
-addMessageListener("Extension:InitBrowser", BrowserListener);
diff --git a/toolkit/components/webextensions/ext-c-backgroundPage.js b/toolkit/components/webextensions/ext-c-backgroundPage.js
deleted file mode 100644
index ca446ce79b..0000000000
--- a/toolkit/components/webextensions/ext-c-backgroundPage.js
+++ /dev/null
@@ -1,45 +0,0 @@
-"use strict";
-
-global.initializeBackgroundPage = (contentWindow) => {
- // Override the `alert()` method inside background windows;
- // we alias it to console.log().
- // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1203394
- let alertDisplayedWarning = false;
- let alertOverwrite = text => {
- if (!alertDisplayedWarning) {
- require("devtools/client/framework/devtools-browser");
-
- let {HUDService} = require("devtools/client/webconsole/hudservice");
- HUDService.openBrowserConsoleOrFocus();
-
- contentWindow.console.warn("alert() is not supported in background windows; please use console.log instead.");
-
- alertDisplayedWarning = true;
- }
-
- contentWindow.console.log(text);
- };
- Cu.exportFunction(alertOverwrite, contentWindow, {defineAs: "alert"});
-};
-
-extensions.registerSchemaAPI("extension", "addon_child", context => {
- function getBackgroundPage() {
- for (let view of context.extension.views) {
- if (view.viewType == "background" && context.principal.subsumes(view.principal)) {
- return view.contentWindow;
- }
- }
- return null;
- }
- return {
- extension: {
- getBackgroundPage,
- },
-
- runtime: {
- getBackgroundPage() {
- return context.cloneScope.Promise.resolve(getBackgroundPage());
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-c-extension.js b/toolkit/components/webextensions/ext-c-extension.js
deleted file mode 100644
index 669309beab..0000000000
--- a/toolkit/components/webextensions/ext-c-extension.js
+++ /dev/null
@@ -1,57 +0,0 @@
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
- "resource://gre/modules/PrivateBrowsingUtils.jsm");
-
-function extensionApiFactory(context) {
- return {
- extension: {
- getURL(url) {
- return context.extension.baseURI.resolve(url);
- },
-
- get lastError() {
- return context.lastError;
- },
-
- get inIncognitoContext() {
- return context.incognito;
- },
- },
- };
-}
-
-extensions.registerSchemaAPI("extension", "addon_child", extensionApiFactory);
-extensions.registerSchemaAPI("extension", "content_child", extensionApiFactory);
-extensions.registerSchemaAPI("extension", "addon_child", context => {
- return {
- extension: {
- getViews: function(fetchProperties) {
- let result = Cu.cloneInto([], context.cloneScope);
-
- for (let view of context.extension.views) {
- if (!view.active) {
- continue;
- }
- if (!context.principal.subsumes(view.principal)) {
- continue;
- }
-
- if (fetchProperties !== null) {
- if (fetchProperties.type !== null && view.viewType != fetchProperties.type) {
- continue;
- }
-
- if (fetchProperties.windowId !== null && view.windowId != fetchProperties.windowId) {
- continue;
- }
- }
-
- result.push(view.contentWindow);
- }
-
- return result;
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-c-runtime.js b/toolkit/components/webextensions/ext-c-runtime.js
deleted file mode 100644
index 1dcac35da7..0000000000
--- a/toolkit/components/webextensions/ext-c-runtime.js
+++ /dev/null
@@ -1,96 +0,0 @@
-"use strict";
-
-function runtimeApiFactory(context) {
- let {extension} = context;
-
- return {
- runtime: {
- onConnect: context.messenger.onConnect("runtime.onConnect"),
-
- onMessage: context.messenger.onMessage("runtime.onMessage"),
-
- onConnectExternal: context.messenger.onConnectExternal("runtime.onConnectExternal"),
-
- onMessageExternal: context.messenger.onMessageExternal("runtime.onMessageExternal"),
-
- connect: function(extensionId, connectInfo) {
- let name = connectInfo !== null && connectInfo.name || "";
- extensionId = extensionId || extension.id;
- let recipient = {extensionId};
-
- return context.messenger.connect(context.messageManager, name, recipient);
- },
-
- sendMessage: function(...args) {
- let options; // eslint-disable-line no-unused-vars
- let extensionId, message, responseCallback;
- if (typeof args[args.length - 1] == "function") {
- responseCallback = args.pop();
- }
- if (!args.length) {
- return Promise.reject({message: "runtime.sendMessage's message argument is missing"});
- } else if (args.length == 1) {
- message = args[0];
- } else if (args.length == 2) {
- if (typeof args[0] == "string" && args[0]) {
- [extensionId, message] = args;
- } else {
- [message, options] = args;
- }
- } else if (args.length == 3) {
- [extensionId, message, options] = args;
- } else if (args.length == 4 && !responseCallback) {
- return Promise.reject({message: "runtime.sendMessage's last argument is not a function"});
- } else {
- return Promise.reject({message: "runtime.sendMessage received too many arguments"});
- }
-
- if (extensionId != null && typeof extensionId != "string") {
- return Promise.reject({message: "runtime.sendMessage's extensionId argument is invalid"});
- }
- if (options != null && typeof options != "object") {
- return Promise.reject({message: "runtime.sendMessage's options argument is invalid"});
- }
-
- extensionId = extensionId || extension.id;
- let recipient = {extensionId};
-
- return context.messenger.sendMessage(context.messageManager, message, recipient, responseCallback);
- },
-
- connectNative(application) {
- let recipient = {
- childId: context.childManager.id,
- toNativeApp: application,
- };
-
- return context.messenger.connectNative(context.messageManager, "", recipient);
- },
-
- sendNativeMessage(application, message) {
- let recipient = {
- childId: context.childManager.id,
- toNativeApp: application,
- };
- return context.messenger.sendNativeMessage(context.messageManager, message, recipient);
- },
-
- get lastError() {
- return context.lastError;
- },
-
- getManifest() {
- return Cu.cloneInto(extension.manifest, context.cloneScope);
- },
-
- id: extension.id,
-
- getURL: function(url) {
- return extension.baseURI.resolve(url);
- },
- },
- };
-}
-
-extensions.registerSchemaAPI("runtime", "addon_child", runtimeApiFactory);
-extensions.registerSchemaAPI("runtime", "content_child", runtimeApiFactory);
diff --git a/toolkit/components/webextensions/ext-c-storage.js b/toolkit/components/webextensions/ext-c-storage.js
deleted file mode 100644
index e8d53058f6..0000000000
--- a/toolkit/components/webextensions/ext-c-storage.js
+++ /dev/null
@@ -1,62 +0,0 @@
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionStorage",
- "resource://gre/modules/ExtensionStorage.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-function storageApiFactory(context) {
- function sanitize(items) {
- // The schema validator already takes care of arrays (which are only allowed
- // to contain strings). Strings and null are safe values.
- if (typeof items != "object" || items === null || Array.isArray(items)) {
- return items;
- }
- // If we got here, then `items` is an object generated by `ObjectType`'s
- // `normalize` method from Schemas.jsm. The object returned by `normalize`
- // lives in this compartment, while the values live in compartment of
- // `context.contentWindow`. The `sanitize` method runs with the principal
- // of `context`, so we cannot just use `ExtensionStorage.sanitize` because
- // it is not allowed to access properties of `items`.
- // So we enumerate all properties and sanitize each value individually.
- let sanitized = {};
- for (let [key, value] of Object.entries(items)) {
- sanitized[key] = ExtensionStorage.sanitize(value, context);
- }
- return sanitized;
- }
- return {
- storage: {
- local: {
- get: function(keys) {
- keys = sanitize(keys);
- return context.childManager.callParentAsyncFunction("storage.local.get", [
- keys,
- ]);
- },
- set: function(items) {
- items = sanitize(items);
- return context.childManager.callParentAsyncFunction("storage.local.set", [
- items,
- ]);
- },
- },
-
- sync: {
- get: function(keys) {
- keys = sanitize(keys);
- return context.childManager.callParentAsyncFunction("storage.sync.get", [
- keys,
- ]);
- },
- set: function(items) {
- items = sanitize(items);
- return context.childManager.callParentAsyncFunction("storage.sync.set", [
- items,
- ]);
- },
- },
- },
- };
-}
-extensions.registerSchemaAPI("storage", "addon_child", storageApiFactory);
-extensions.registerSchemaAPI("storage", "content_child", storageApiFactory);
diff --git a/toolkit/components/webextensions/ext-c-test.js b/toolkit/components/webextensions/ext-c-test.js
deleted file mode 100644
index b0c92f79f7..0000000000
--- a/toolkit/components/webextensions/ext-c-test.js
+++ /dev/null
@@ -1,188 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- SingletonEventManager,
-} = ExtensionUtils;
-
-/**
- * Checks whether the given error matches the given expectations.
- *
- * @param {*} error
- * The error to check.
- * @param {string|RegExp|function|null} expectedError
- * The expectation to check against. If this parameter is:
- *
- * - a string, the error message must exactly equal the string.
- * - a regular expression, it must match the error message.
- * - a function, it is called with the error object and its
- * return value is returned.
- * - null, the function always returns true.
- * @param {BaseContext} context
- *
- * @returns {boolean}
- * True if the error matches the expected error.
- */
-function errorMatches(error, expectedError, context) {
- if (expectedError === null) {
- return true;
- }
-
- if (typeof expectedError === "function") {
- return context.runSafeWithoutClone(expectedError, error);
- }
-
- if (typeof error !== "object" || error == null ||
- typeof error.message !== "string") {
- return false;
- }
-
- if (typeof expectedError === "string") {
- return error.message === expectedError;
- }
-
- try {
- return expectedError.test(error.message);
- } catch (e) {
- Cu.reportError(e);
- }
-
- return false;
-}
-
-/**
- * Calls .toSource() on the given value, but handles null, undefined,
- * and errors.
- *
- * @param {*} value
- * @returns {string}
- */
-function toSource(value) {
- if (value === null) {
- return "null";
- }
- if (value === undefined) {
- return "undefined";
- }
- if (typeof value === "string") {
- return JSON.stringify(value);
- }
-
- try {
- return String(value.toSource());
- } catch (e) {
- return "<unknown>";
- }
-}
-
-function makeTestAPI(context) {
- const {extension} = context;
-
- function getStack() {
- return new context.cloneScope.Error().stack.replace(/^/gm, " ");
- }
-
- function assertTrue(value, msg) {
- extension.emit("test-result", Boolean(value), String(msg), getStack());
- }
-
- return {
- test: {
- sendMessage(...args) {
- extension.emit("test-message", ...args);
- },
-
- notifyPass(msg) {
- extension.emit("test-done", true, msg, getStack());
- },
-
- notifyFail(msg) {
- extension.emit("test-done", false, msg, getStack());
- },
-
- log(msg) {
- extension.emit("test-log", true, msg, getStack());
- },
-
- fail(msg) {
- assertTrue(false, msg);
- },
-
- succeed(msg) {
- assertTrue(true, msg);
- },
-
- assertTrue(value, msg) {
- assertTrue(value, msg);
- },
-
- assertFalse(value, msg) {
- assertTrue(!value, msg);
- },
-
- assertEq(expected, actual, msg) {
- let equal = expected === actual;
-
- expected = String(expected);
- actual = String(actual);
-
- if (!equal && expected === actual) {
- actual += " (different)";
- }
- extension.emit("test-eq", equal, String(msg), expected, actual, getStack());
- },
-
- assertRejects(promise, expectedError, msg) {
- // Wrap in a native promise for consistency.
- promise = Promise.resolve(promise);
-
- if (msg) {
- msg = `: ${msg}`;
- }
-
- return promise.then(result => {
- assertTrue(false, `Promise resolved, expected rejection${msg}`);
- }, error => {
- let errorMessage = toSource(error && error.message);
-
- assertTrue(errorMatches(error, expectedError, context),
- `Promise rejected, expecting rejection to match ${toSource(expectedError)}, ` +
- `got ${errorMessage}${msg}`);
- });
- },
-
- assertThrows(func, expectedError, msg) {
- if (msg) {
- msg = `: ${msg}`;
- }
-
- try {
- func();
-
- assertTrue(false, `Function did not throw, expected error${msg}`);
- } catch (error) {
- let errorMessage = toSource(error && error.message);
-
- assertTrue(errorMatches(error, expectedError, context),
- `Function threw, expecting error to match ${toSource(expectedError)}` +
- `got ${errorMessage}${msg}`);
- }
- },
-
- onMessage: new SingletonEventManager(context, "test.onMessage", fire => {
- let handler = (event, ...args) => {
- context.runSafe(fire, ...args);
- };
-
- extension.on("test-harness-message", handler);
- return () => {
- extension.off("test-harness-message", handler);
- };
- }).api(),
- },
- };
-}
-
-extensions.registerSchemaAPI("test", "addon_child", makeTestAPI);
-extensions.registerSchemaAPI("test", "content_child", makeTestAPI);
-
diff --git a/toolkit/components/webextensions/ext-cookies.js b/toolkit/components/webextensions/ext-cookies.js
deleted file mode 100644
index d0a7034218..0000000000
--- a/toolkit/components/webextensions/ext-cookies.js
+++ /dev/null
@@ -1,484 +0,0 @@
-"use strict";
-
-const {interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService",
- "resource://gre/modules/ContextualIdentityService.jsm");
-
-var {
- EventManager,
-} = ExtensionUtils;
-
-var DEFAULT_STORE = "firefox-default";
-var PRIVATE_STORE = "firefox-private";
-var CONTAINER_STORE = "firefox-container-";
-
-global.getCookieStoreIdForTab = function(data, tab) {
- if (data.incognito) {
- return PRIVATE_STORE;
- }
-
- if (tab.userContextId) {
- return CONTAINER_STORE + tab.userContextId;
- }
-
- return DEFAULT_STORE;
-};
-
-global.isPrivateCookieStoreId = function(storeId) {
- return storeId == PRIVATE_STORE;
-};
-
-global.isDefaultCookieStoreId = function(storeId) {
- return storeId == DEFAULT_STORE;
-};
-
-global.isContainerCookieStoreId = function(storeId) {
- return storeId !== null && storeId.startsWith(CONTAINER_STORE);
-};
-
-global.getContainerForCookieStoreId = function(storeId) {
- if (!global.isContainerCookieStoreId(storeId)) {
- return null;
- }
-
- let containerId = storeId.substring(CONTAINER_STORE.length);
- if (ContextualIdentityService.getIdentityFromId(containerId)) {
- return parseInt(containerId, 10);
- }
-
- return null;
-};
-
-global.isValidCookieStoreId = function(storeId) {
- return global.isDefaultCookieStoreId(storeId) ||
- global.isPrivateCookieStoreId(storeId) ||
- global.isContainerCookieStoreId(storeId);
-};
-
-function convert({cookie, isPrivate}) {
- let result = {
- name: cookie.name,
- value: cookie.value,
- domain: cookie.host,
- hostOnly: !cookie.isDomain,
- path: cookie.path,
- secure: cookie.isSecure,
- httpOnly: cookie.isHttpOnly,
- session: cookie.isSession,
- };
-
- if (!cookie.isSession) {
- result.expirationDate = cookie.expiry;
- }
-
- if (cookie.originAttributes.userContextId) {
- result.storeId = CONTAINER_STORE + cookie.originAttributes.userContextId;
- } else if (cookie.originAttributes.privateBrowsingId || isPrivate) {
- result.storeId = PRIVATE_STORE;
- } else {
- result.storeId = DEFAULT_STORE;
- }
-
- return result;
-}
-
-function isSubdomain(otherDomain, baseDomain) {
- return otherDomain == baseDomain || otherDomain.endsWith("." + baseDomain);
-}
-
-// Checks that the given extension has permission to set the given cookie for
-// the given URI.
-function checkSetCookiePermissions(extension, uri, cookie) {
- // Permission checks:
- //
- // - If the extension does not have permissions for the specified
- // URL, it cannot set cookies for it.
- //
- // - If the specified URL could not set the given cookie, neither can
- // the extension.
- //
- // Ideally, we would just have the cookie service make the latter
- // determination, but that turns out to be quite complicated. At the
- // moment, it requires constructing a cookie string and creating a
- // dummy channel, both of which can be problematic. It also triggers
- // a whole set of additional permission and preference checks, which
- // may or may not be desirable.
- //
- // So instead, we do a similar set of checks here. Exactly what
- // cookies a given URL should be able to set is not well-documented,
- // and is not standardized in any standard that anyone actually
- // follows. So instead, we follow the rules used by the cookie
- // service.
- //
- // See source/netwerk/cookie/nsCookieService.cpp, in particular
- // CheckDomain() and SetCookieInternal().
-
- if (uri.scheme != "http" && uri.scheme != "https") {
- return false;
- }
-
- if (!extension.whiteListedHosts.matchesIgnoringPath(uri)) {
- return false;
- }
-
- if (!cookie.host) {
- // If no explicit host is specified, this becomes a host-only cookie.
- cookie.host = uri.host;
- return true;
- }
-
- // A leading "." is not expected, but is tolerated if it's not the only
- // character in the host. If there is one, start by stripping it off. We'll
- // add a new one on success.
- if (cookie.host.length > 1) {
- cookie.host = cookie.host.replace(/^\./, "");
- }
- cookie.host = cookie.host.toLowerCase();
-
- if (cookie.host != uri.host) {
- // Not an exact match, so check for a valid subdomain.
- let baseDomain;
- try {
- baseDomain = Services.eTLD.getBaseDomain(uri);
- } catch (e) {
- if (e.result == Cr.NS_ERROR_HOST_IS_IP_ADDRESS ||
- e.result == Cr.NS_ERROR_INSUFFICIENT_DOMAIN_LEVELS) {
- // The cookie service uses these to determine whether the domain
- // requires an exact match. We already know we don't have an exact
- // match, so return false. In all other cases, re-raise the error.
- return false;
- }
- throw e;
- }
-
- // The cookie domain must be a subdomain of the base domain. This prevents
- // us from setting cookies for domains like ".co.uk".
- // The domain of the requesting URL must likewise be a subdomain of the
- // cookie domain. This prevents us from setting cookies for entirely
- // unrelated domains.
- if (!isSubdomain(cookie.host, baseDomain) ||
- !isSubdomain(uri.host, cookie.host)) {
- return false;
- }
-
- // RFC2109 suggests that we may only add cookies for sub-domains 1-level
- // below us, but enforcing that would break the web, so we don't.
- }
-
- // An explicit domain was passed, so add a leading "." to make this a
- // domain cookie.
- cookie.host = "." + cookie.host;
-
- // We don't do any significant checking of path permissions. RFC2109
- // suggests we only allow sites to add cookies for sub-paths, similar to
- // same origin policy enforcement, but no-one implements this.
-
- return true;
-}
-
-function* query(detailsIn, props, context) {
- // Different callers want to filter on different properties. |props|
- // tells us which ones they're interested in.
- let details = {};
- props.forEach(property => {
- if (detailsIn[property] !== null) {
- details[property] = detailsIn[property];
- }
- });
-
- if ("domain" in details) {
- details.domain = details.domain.toLowerCase().replace(/^\./, "");
- }
-
- let userContextId = 0;
- let isPrivate = context.incognito;
- if (details.storeId) {
- if (!global.isValidCookieStoreId(details.storeId)) {
- return;
- }
-
- if (global.isDefaultCookieStoreId(details.storeId)) {
- isPrivate = false;
- } else if (global.isPrivateCookieStoreId(details.storeId)) {
- isPrivate = true;
- } else if (global.isContainerCookieStoreId(details.storeId)) {
- isPrivate = false;
- userContextId = global.getContainerForCookieStoreId(details.storeId);
- if (!userContextId) {
- return;
- }
- }
- }
-
- let storeId = DEFAULT_STORE;
- if (isPrivate) {
- storeId = PRIVATE_STORE;
- } else if ("storeId" in details) {
- storeId = details.storeId;
- }
-
- // We can use getCookiesFromHost for faster searching.
- let enumerator;
- let uri;
- if ("url" in details) {
- try {
- uri = NetUtil.newURI(details.url).QueryInterface(Ci.nsIURL);
- Services.cookies.usePrivateMode(isPrivate, () => {
- enumerator = Services.cookies.getCookiesFromHost(uri.host, {userContextId});
- });
- } catch (ex) {
- // This often happens for about: URLs
- return;
- }
- } else if ("domain" in details) {
- Services.cookies.usePrivateMode(isPrivate, () => {
- enumerator = Services.cookies.getCookiesFromHost(details.domain, {userContextId});
- });
- } else {
- Services.cookies.usePrivateMode(isPrivate, () => {
- enumerator = Services.cookies.enumerator;
- });
- }
-
- // Based on nsCookieService::GetCookieStringInternal
- function matches(cookie) {
- function domainMatches(host) {
- return cookie.rawHost == host || (cookie.isDomain && host.endsWith(cookie.host));
- }
-
- function pathMatches(path) {
- let cookiePath = cookie.path.replace(/\/$/, "");
-
- if (!path.startsWith(cookiePath)) {
- return false;
- }
-
- // path == cookiePath, but without the redundant string compare.
- if (path.length == cookiePath.length) {
- return true;
- }
-
- // URL path is a substring of the cookie path, so it matches if, and
- // only if, the next character is a path delimiter.
- let pathDelimiters = ["/", "?", "#", ";"];
- return pathDelimiters.includes(path[cookiePath.length]);
- }
-
- // "Restricts the retrieved cookies to those that would match the given URL."
- if (uri) {
- if (!domainMatches(uri.host)) {
- return false;
- }
-
- if (cookie.isSecure && uri.scheme != "https") {
- return false;
- }
-
- if (!pathMatches(uri.path)) {
- return false;
- }
- }
-
- if ("name" in details && details.name != cookie.name) {
- return false;
- }
-
- if (userContextId != cookie.originAttributes.userContextId) {
- return false;
- }
-
- // "Restricts the retrieved cookies to those whose domains match or are subdomains of this one."
- if ("domain" in details && !isSubdomain(cookie.rawHost, details.domain)) {
- return false;
- }
-
- // "Restricts the retrieved cookies to those whose path exactly matches this string.""
- if ("path" in details && details.path != cookie.path) {
- return false;
- }
-
- if ("secure" in details && details.secure != cookie.isSecure) {
- return false;
- }
-
- if ("session" in details && details.session != cookie.isSession) {
- return false;
- }
-
- // Check that the extension has permissions for this host.
- if (!context.extension.whiteListedHosts.matchesCookie(cookie)) {
- return false;
- }
-
- return true;
- }
-
- while (enumerator.hasMoreElements()) {
- let cookie = enumerator.getNext().QueryInterface(Ci.nsICookie2);
- if (matches(cookie)) {
- yield {cookie, isPrivate, storeId};
- }
- }
-}
-
-extensions.registerSchemaAPI("cookies", "addon_parent", context => {
- let {extension} = context;
- let self = {
- cookies: {
- get: function(details) {
- // FIXME: We don't sort by length of path and creation time.
- for (let cookie of query(details, ["url", "name", "storeId"], context)) {
- return Promise.resolve(convert(cookie));
- }
-
- // Found no match.
- return Promise.resolve(null);
- },
-
- getAll: function(details) {
- let allowed = ["url", "name", "domain", "path", "secure", "session", "storeId"];
- let result = Array.from(query(details, allowed, context), convert);
-
- return Promise.resolve(result);
- },
-
- set: function(details) {
- let uri = NetUtil.newURI(details.url).QueryInterface(Ci.nsIURL);
-
- let path;
- if (details.path !== null) {
- path = details.path;
- } else {
- // This interface essentially emulates the behavior of the
- // Set-Cookie header. In the case of an omitted path, the cookie
- // service uses the directory path of the requesting URL, ignoring
- // any filename or query parameters.
- path = uri.directory;
- }
-
- let name = details.name !== null ? details.name : "";
- let value = details.value !== null ? details.value : "";
- let secure = details.secure !== null ? details.secure : false;
- let httpOnly = details.httpOnly !== null ? details.httpOnly : false;
- let isSession = details.expirationDate === null;
- let expiry = isSession ? Number.MAX_SAFE_INTEGER : details.expirationDate;
- let isPrivate = context.incognito;
- let userContextId = 0;
- if (global.isDefaultCookieStoreId(details.storeId)) {
- isPrivate = false;
- } else if (global.isPrivateCookieStoreId(details.storeId)) {
- isPrivate = true;
- } else if (global.isContainerCookieStoreId(details.storeId)) {
- let containerId = global.getContainerForCookieStoreId(details.storeId);
- if (containerId === null) {
- return Promise.reject({message: `Illegal storeId: ${details.storeId}`});
- }
- isPrivate = false;
- userContextId = containerId;
- } else if (details.storeId !== null) {
- return Promise.reject({message: "Unknown storeId"});
- }
-
- let cookieAttrs = {host: details.domain, path: path, isSecure: secure};
- if (!checkSetCookiePermissions(extension, uri, cookieAttrs)) {
- return Promise.reject({message: `Permission denied to set cookie ${JSON.stringify(details)}`});
- }
-
- // The permission check may have modified the domain, so use
- // the new value instead.
- Services.cookies.usePrivateMode(isPrivate, () => {
- Services.cookies.add(cookieAttrs.host, path, name, value,
- secure, httpOnly, isSession, expiry, {userContextId});
- });
-
- return self.cookies.get(details);
- },
-
- remove: function(details) {
- for (let {cookie, isPrivate, storeId} of query(details, ["url", "name", "storeId"], context)) {
- Services.cookies.usePrivateMode(isPrivate, () => {
- Services.cookies.remove(cookie.host, cookie.name, cookie.path, false, cookie.originAttributes);
- });
-
- // Todo: could there be multiple per subdomain?
- return Promise.resolve({
- url: details.url,
- name: details.name,
- storeId,
- });
- }
-
- return Promise.resolve(null);
- },
-
- getAllCookieStores: function() {
- let data = {};
- for (let window of WindowListManager.browserWindows()) {
- let tabs = TabManager.for(extension).getTabs(window);
- for (let tab of tabs) {
- if (!(tab.cookieStoreId in data)) {
- data[tab.cookieStoreId] = [];
- }
- data[tab.cookieStoreId].push(tab);
- }
- }
-
- let result = [];
- for (let key in data) {
- result.push({id: key, tabIds: data[key], incognito: key == PRIVATE_STORE});
- }
- return Promise.resolve(result);
- },
-
- onChanged: new EventManager(context, "cookies.onChanged", fire => {
- let observer = (subject, topic, data) => {
- let notify = (removed, cookie, cause) => {
- cookie.QueryInterface(Ci.nsICookie2);
-
- if (extension.whiteListedHosts.matchesCookie(cookie)) {
- fire({removed, cookie: convert({cookie, isPrivate: topic == "private-cookie-changed"}), cause});
- }
- };
-
- // We do our best effort here to map the incompatible states.
- switch (data) {
- case "deleted":
- notify(true, subject, "explicit");
- break;
- case "added":
- notify(false, subject, "explicit");
- break;
- case "changed":
- notify(true, subject, "overwrite");
- notify(false, subject, "explicit");
- break;
- case "batch-deleted":
- subject.QueryInterface(Ci.nsIArray);
- for (let i = 0; i < subject.length; i++) {
- let cookie = subject.queryElementAt(i, Ci.nsICookie2);
- if (!cookie.isSession && cookie.expiry * 1000 <= Date.now()) {
- notify(true, cookie, "expired");
- } else {
- notify(true, cookie, "evicted");
- }
- }
- break;
- }
- };
-
- Services.obs.addObserver(observer, "cookie-changed", false);
- Services.obs.addObserver(observer, "private-cookie-changed", false);
- return () => {
- Services.obs.removeObserver(observer, "cookie-changed");
- Services.obs.removeObserver(observer, "private-cookie-changed");
- };
- }).api(),
- },
- };
-
- return self;
-});
diff --git a/toolkit/components/webextensions/ext-downloads.js b/toolkit/components/webextensions/ext-downloads.js
deleted file mode 100644
index 132814ae4b..0000000000
--- a/toolkit/components/webextensions/ext-downloads.js
+++ /dev/null
@@ -1,799 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
- "resource://gre/modules/Downloads.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
- "resource://gre/modules/DownloadPaths.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
- "resource://devtools/shared/event-emitter.js");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-const {
- ignoreEvent,
- normalizeTime,
- runSafeSync,
- SingletonEventManager,
- PlatformInfo,
-} = ExtensionUtils;
-
-const DOWNLOAD_ITEM_FIELDS = ["id", "url", "referrer", "filename", "incognito",
- "danger", "mime", "startTime", "endTime",
- "estimatedEndTime", "state",
- "paused", "canResume", "error",
- "bytesReceived", "totalBytes",
- "fileSize", "exists",
- "byExtensionId", "byExtensionName"];
-
-// Fields that we generate onChanged events for.
-const DOWNLOAD_ITEM_CHANGE_FIELDS = ["endTime", "state", "paused", "canResume",
- "error", "exists"];
-
-// From https://fetch.spec.whatwg.org/#forbidden-header-name
-const FORBIDDEN_HEADERS = ["ACCEPT-CHARSET", "ACCEPT-ENCODING",
- "ACCESS-CONTROL-REQUEST-HEADERS", "ACCESS-CONTROL-REQUEST-METHOD",
- "CONNECTION", "CONTENT-LENGTH", "COOKIE", "COOKIE2", "DATE", "DNT",
- "EXPECT", "HOST", "KEEP-ALIVE", "ORIGIN", "REFERER", "TE", "TRAILER",
- "TRANSFER-ENCODING", "UPGRADE", "VIA"];
-
-const FORBIDDEN_PREFIXES = /^PROXY-|^SEC-/i;
-
-class DownloadItem {
- constructor(id, download, extension) {
- this.id = id;
- this.download = download;
- this.extension = extension;
- this.prechange = {};
- }
-
- get url() { return this.download.source.url; }
- get referrer() { return this.download.source.referrer; }
- get filename() { return this.download.target.path; }
- get incognito() { return this.download.source.isPrivate; }
- get danger() { return "safe"; } // TODO
- get mime() { return this.download.contentType; }
- get startTime() { return this.download.startTime; }
- get endTime() { return null; } // TODO
- get estimatedEndTime() { return null; } // TODO
- get state() {
- if (this.download.succeeded) {
- return "complete";
- }
- if (this.download.canceled) {
- return "interrupted";
- }
- return "in_progress";
- }
- get paused() {
- return this.download.canceled && this.download.hasPartialData && !this.download.error;
- }
- get canResume() {
- return (this.download.stopped || this.download.canceled) &&
- this.download.hasPartialData && !this.download.error;
- }
- get error() {
- if (!this.download.stopped || this.download.succeeded) {
- return null;
- }
- // TODO store this instead of calculating it
-
- if (this.download.error) {
- if (this.download.error.becauseSourceFailed) {
- return "NETWORK_FAILED"; // TODO
- }
- if (this.download.error.becauseTargetFailed) {
- return "FILE_FAILED"; // TODO
- }
- return "CRASH";
- }
- return "USER_CANCELED";
- }
- get bytesReceived() {
- return this.download.currentBytes;
- }
- get totalBytes() {
- return this.download.hasProgress ? this.download.totalBytes : -1;
- }
- get fileSize() {
- // todo: this is supposed to be post-compression
- return this.download.succeeded ? this.download.target.size : -1;
- }
- get exists() { return this.download.target.exists; }
- get byExtensionId() { return this.extension ? this.extension.id : undefined; }
- get byExtensionName() { return this.extension ? this.extension.name : undefined; }
-
- /**
- * Create a cloneable version of this object by pulling all the
- * fields into simple properties (instead of getters).
- *
- * @returns {object} A DownloadItem with flat properties,
- * suitable for cloning.
- */
- serialize() {
- let obj = {};
- for (let field of DOWNLOAD_ITEM_FIELDS) {
- obj[field] = this[field];
- }
- if (obj.startTime) {
- obj.startTime = obj.startTime.toISOString();
- }
- return obj;
- }
-
- // When a change event fires, handlers can look at how an individual
- // field changed by comparing item.fieldname with item.prechange.fieldname.
- // After all handlers have been invoked, this gets called to store the
- // current values of all fields ahead of the next event.
- _change() {
- for (let field of DOWNLOAD_ITEM_CHANGE_FIELDS) {
- this.prechange[field] = this[field];
- }
- }
-}
-
-
-// DownloadMap maps back and forth betwen the numeric identifiers used in
-// the downloads WebExtension API and a Download object from the Downloads jsm.
-// todo: make id and extension info persistent (bug 1247794)
-const DownloadMap = {
- currentId: 0,
- loadPromise: null,
-
- // Maps numeric id -> DownloadItem
- byId: new Map(),
-
- // Maps Download object -> DownloadItem
- byDownload: new WeakMap(),
-
- lazyInit() {
- if (this.loadPromise == null) {
- EventEmitter.decorate(this);
- this.loadPromise = Downloads.getList(Downloads.ALL).then(list => {
- let self = this;
- return list.addView({
- onDownloadAdded(download) {
- const item = self.newFromDownload(download, null);
- self.emit("create", item);
- },
-
- onDownloadRemoved(download) {
- const item = self.byDownload.get(download);
- if (item != null) {
- self.emit("erase", item);
- self.byDownload.delete(download);
- self.byId.delete(item.id);
- }
- },
-
- onDownloadChanged(download) {
- const item = self.byDownload.get(download);
- if (item == null) {
- Cu.reportError("Got onDownloadChanged for unknown download object");
- } else {
- // We get the first one of these when the download is started.
- // In this case, don't emit anything, just initialize prechange.
- if (Object.keys(item.prechange).length > 0) {
- self.emit("change", item);
- }
- item._change();
- }
- },
- }).then(() => list.getAll())
- .then(downloads => {
- downloads.forEach(download => {
- this.newFromDownload(download, null);
- });
- })
- .then(() => list);
- });
- }
- return this.loadPromise;
- },
-
- getDownloadList() {
- return this.lazyInit();
- },
-
- getAll() {
- return this.lazyInit().then(() => this.byId.values());
- },
-
- fromId(id) {
- const download = this.byId.get(id);
- if (!download) {
- throw new Error(`Invalid download id ${id}`);
- }
- return download;
- },
-
- newFromDownload(download, extension) {
- if (this.byDownload.has(download)) {
- return this.byDownload.get(download);
- }
-
- const id = ++this.currentId;
- let item = new DownloadItem(id, download, extension);
- this.byId.set(id, item);
- this.byDownload.set(download, item);
- return item;
- },
-
- erase(item) {
- // This will need to get more complicated for bug 1255507 but for now we
- // only work with downloads in the DownloadList from getAll()
- return this.getDownloadList().then(list => {
- list.remove(item.download);
- });
- },
-};
-
-// Create a callable function that filters a DownloadItem based on a
-// query object of the type passed to search() or erase().
-function downloadQuery(query) {
- let queryTerms = [];
- let queryNegativeTerms = [];
- if (query.query != null) {
- for (let term of query.query) {
- if (term[0] == "-") {
- queryNegativeTerms.push(term.slice(1).toLowerCase());
- } else {
- queryTerms.push(term.toLowerCase());
- }
- }
- }
-
- function normalizeDownloadTime(arg, before) {
- if (arg == null) {
- return before ? Number.MAX_VALUE : 0;
- }
- return normalizeTime(arg).getTime();
- }
-
- const startedBefore = normalizeDownloadTime(query.startedBefore, true);
- const startedAfter = normalizeDownloadTime(query.startedAfter, false);
- // const endedBefore = normalizeDownloadTime(query.endedBefore, true);
- // const endedAfter = normalizeDownloadTime(query.endedAfter, false);
-
- const totalBytesGreater = query.totalBytesGreater || 0;
- const totalBytesLess = (query.totalBytesLess != null)
- ? query.totalBytesLess : Number.MAX_VALUE;
-
- // Handle options for which we can have a regular expression and/or
- // an explicit value to match.
- function makeMatch(regex, value, field) {
- if (value == null && regex == null) {
- return input => true;
- }
-
- let re;
- try {
- re = new RegExp(regex || "", "i");
- } catch (err) {
- throw new Error(`Invalid ${field}Regex: ${err.message}`);
- }
- if (value == null) {
- return input => re.test(input);
- }
-
- value = value.toLowerCase();
- if (re.test(value)) {
- return input => (value == input);
- }
- return input => false;
- }
-
- const matchFilename = makeMatch(query.filenameRegex, query.filename, "filename");
- const matchUrl = makeMatch(query.urlRegex, query.url, "url");
-
- return function(item) {
- const url = item.url.toLowerCase();
- const filename = item.filename.toLowerCase();
-
- if (!queryTerms.every(term => url.includes(term) || filename.includes(term))) {
- return false;
- }
-
- if (queryNegativeTerms.some(term => url.includes(term) || filename.includes(term))) {
- return false;
- }
-
- if (!matchFilename(filename) || !matchUrl(url)) {
- return false;
- }
-
- if (!item.startTime) {
- if (query.startedBefore != null || query.startedAfter != null) {
- return false;
- }
- } else if (item.startTime > startedBefore || item.startTime < startedAfter) {
- return false;
- }
-
- // todo endedBefore, endedAfter
-
- if (item.totalBytes == -1) {
- if (query.totalBytesGreater != null || query.totalBytesLess != null) {
- return false;
- }
- } else if (item.totalBytes <= totalBytesGreater || item.totalBytes >= totalBytesLess) {
- return false;
- }
-
- // todo: include danger
- const SIMPLE_ITEMS = ["id", "mime", "startTime", "endTime", "state",
- "paused", "error",
- "bytesReceived", "totalBytes", "fileSize", "exists"];
- for (let field of SIMPLE_ITEMS) {
- if (query[field] != null && item[field] != query[field]) {
- return false;
- }
- }
-
- return true;
- };
-}
-
-function queryHelper(query) {
- let matchFn;
- try {
- matchFn = downloadQuery(query);
- } catch (err) {
- return Promise.reject({message: err.message});
- }
-
- let compareFn;
- if (query.orderBy != null) {
- const fields = query.orderBy.map(field => field[0] == "-"
- ? {reverse: true, name: field.slice(1)}
- : {reverse: false, name: field});
-
- for (let field of fields) {
- if (!DOWNLOAD_ITEM_FIELDS.includes(field.name)) {
- return Promise.reject({message: `Invalid orderBy field ${field.name}`});
- }
- }
-
- compareFn = (dl1, dl2) => {
- for (let field of fields) {
- const val1 = dl1[field.name];
- const val2 = dl2[field.name];
-
- if (val1 < val2) {
- return field.reverse ? 1 : -1;
- } else if (val1 > val2) {
- return field.reverse ? -1 : 1;
- }
- }
- return 0;
- };
- }
-
- return DownloadMap.getAll().then(downloads => {
- if (compareFn) {
- downloads = Array.from(downloads);
- downloads.sort(compareFn);
- }
- let results = [];
- for (let download of downloads) {
- if (query.limit && results.length >= query.limit) {
- break;
- }
- if (matchFn(download)) {
- results.push(download);
- }
- }
- return results;
- });
-}
-
-extensions.registerSchemaAPI("downloads", "addon_parent", context => {
- let {extension} = context;
- return {
- downloads: {
- download(options) {
- let {filename} = options;
- if (filename && PlatformInfo.os === "win") {
- // cross platform javascript code uses "/"
- filename = filename.replace(/\//g, "\\");
- }
-
- if (filename != null) {
- if (filename.length == 0) {
- return Promise.reject({message: "filename must not be empty"});
- }
-
- let path = OS.Path.split(filename);
- if (path.absolute) {
- return Promise.reject({message: "filename must not be an absolute path"});
- }
-
- if (path.components.some(component => component == "..")) {
- return Promise.reject({message: "filename must not contain back-references (..)"});
- }
- }
-
- if (options.conflictAction == "prompt") {
- // TODO
- return Promise.reject({message: "conflictAction prompt not yet implemented"});
- }
-
- if (options.headers) {
- for (let {name} of options.headers) {
- if (FORBIDDEN_HEADERS.includes(name.toUpperCase()) || name.match(FORBIDDEN_PREFIXES)) {
- return Promise.reject({message: "Forbidden request header name"});
- }
- }
- }
-
- // Handle method, headers and body options.
- function adjustChannel(channel) {
- if (channel instanceof Ci.nsIHttpChannel) {
- const method = options.method || "GET";
- channel.requestMethod = method;
-
- if (options.headers) {
- for (let {name, value} of options.headers) {
- channel.setRequestHeader(name, value, false);
- }
- }
-
- if (options.body != null) {
- const stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(options.body, options.body.length);
-
- channel.QueryInterface(Ci.nsIUploadChannel2);
- channel.explicitSetUploadStream(stream, null, -1, method, false);
- }
- }
- return Promise.resolve();
- }
-
- function createTarget(downloadsDir) {
- let target;
- if (filename) {
- target = OS.Path.join(downloadsDir, filename);
- } else {
- let uri = NetUtil.newURI(options.url);
-
- let remote = "download";
- if (uri instanceof Ci.nsIURL) {
- remote = uri.fileName;
- }
- target = OS.Path.join(downloadsDir, remote);
- }
-
- // Create any needed subdirectories if required by filename.
- const dir = OS.Path.dirname(target);
- return OS.File.makeDir(dir, {from: downloadsDir}).then(() => {
- return OS.File.exists(target);
- }).then(exists => {
- // This has a race, something else could come along and create
- // the file between this test and them time the download code
- // creates the target file. But we can't easily fix it without
- // modifying DownloadCore so we live with it for now.
- if (exists) {
- switch (options.conflictAction) {
- case "uniquify":
- default:
- target = DownloadPaths.createNiceUniqueFile(new FileUtils.File(target)).path;
- break;
-
- case "overwrite":
- break;
- }
- }
- }).then(() => {
- if (!options.saveAs) {
- return Promise.resolve(target);
- }
-
- // Setup the file picker Save As dialog.
- const picker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
- const window = Services.wm.getMostRecentWindow("navigator:browser");
- picker.init(window, null, Ci.nsIFilePicker.modeSave);
- picker.displayDirectory = new FileUtils.File(dir);
- picker.appendFilters(Ci.nsIFilePicker.filterAll);
- picker.defaultString = OS.Path.basename(target);
-
- // Open the dialog and resolve/reject with the result.
- return new Promise((resolve, reject) => {
- picker.open(result => {
- if (result === Ci.nsIFilePicker.returnCancel) {
- reject({message: "Download canceled by the user"});
- } else {
- resolve(picker.file.path);
- }
- });
- });
- });
- }
-
- let download;
- return Downloads.getPreferredDownloadsDirectory()
- .then(downloadsDir => createTarget(downloadsDir))
- .then(target => {
- const source = {
- url: options.url,
- };
-
- if (options.method || options.headers || options.body) {
- source.adjustChannel = adjustChannel;
- }
-
- return Downloads.createDownload({
- source,
- target: {
- path: target,
- partFilePath: target + ".part",
- },
- });
- }).then(dl => {
- download = dl;
- return DownloadMap.getDownloadList();
- }).then(list => {
- list.add(download);
-
- // This is necessary to make pause/resume work.
- download.tryToKeepPartialData = true;
- download.start();
-
- const item = DownloadMap.newFromDownload(download, extension);
- return item.id;
- });
- },
-
- removeFile(id) {
- return DownloadMap.lazyInit().then(() => {
- let item;
- try {
- item = DownloadMap.fromId(id);
- } catch (err) {
- return Promise.reject({message: `Invalid download id ${id}`});
- }
- if (item.state !== "complete") {
- return Promise.reject({message: `Cannot remove incomplete download id ${id}`});
- }
- return OS.File.remove(item.filename, {ignoreAbsent: false}).catch((err) => {
- return Promise.reject({message: `Could not remove download id ${item.id} because the file doesn't exist`});
- });
- });
- },
-
- search(query) {
- return queryHelper(query)
- .then(items => items.map(item => item.serialize()));
- },
-
- pause(id) {
- return DownloadMap.lazyInit().then(() => {
- let item;
- try {
- item = DownloadMap.fromId(id);
- } catch (err) {
- return Promise.reject({message: `Invalid download id ${id}`});
- }
- if (item.state != "in_progress") {
- return Promise.reject({message: `Download ${id} cannot be paused since it is in state ${item.state}`});
- }
-
- return item.download.cancel();
- });
- },
-
- resume(id) {
- return DownloadMap.lazyInit().then(() => {
- let item;
- try {
- item = DownloadMap.fromId(id);
- } catch (err) {
- return Promise.reject({message: `Invalid download id ${id}`});
- }
- if (!item.canResume) {
- return Promise.reject({message: `Download ${id} cannot be resumed`});
- }
-
- return item.download.start();
- });
- },
-
- cancel(id) {
- return DownloadMap.lazyInit().then(() => {
- let item;
- try {
- item = DownloadMap.fromId(id);
- } catch (err) {
- return Promise.reject({message: `Invalid download id ${id}`});
- }
- if (item.download.succeeded) {
- return Promise.reject({message: `Download ${id} is already complete`});
- }
- return item.download.finalize(true);
- });
- },
-
- showDefaultFolder() {
- Downloads.getPreferredDownloadsDirectory().then(dir => {
- let dirobj = new FileUtils.File(dir);
- if (dirobj.isDirectory()) {
- dirobj.launch();
- } else {
- throw new Error(`Download directory ${dirobj.path} is not actually a directory`);
- }
- }).catch(Cu.reportError);
- },
-
- erase(query) {
- return queryHelper(query).then(items => {
- let results = [];
- let promises = [];
- for (let item of items) {
- promises.push(DownloadMap.erase(item));
- results.push(item.id);
- }
- return Promise.all(promises).then(() => results);
- });
- },
-
- open(downloadId) {
- return DownloadMap.lazyInit().then(() => {
- let download = DownloadMap.fromId(downloadId).download;
- if (download.succeeded) {
- return download.launch();
- }
- return Promise.reject({message: "Download has not completed."});
- }).catch((error) => {
- return Promise.reject({message: error.message});
- });
- },
-
- show(downloadId) {
- return DownloadMap.lazyInit().then(() => {
- let download = DownloadMap.fromId(downloadId);
- return download.download.showContainingDirectory();
- }).then(() => {
- return true;
- }).catch(error => {
- return Promise.reject({message: error.message});
- });
- },
-
- getFileIcon(downloadId, options) {
- return DownloadMap.lazyInit().then(() => {
- let size = options && options.size ? options.size : 32;
- let download = DownloadMap.fromId(downloadId).download;
- let pathPrefix = "";
- let path;
-
- if (download.succeeded) {
- let file = FileUtils.File(download.target.path);
- path = Services.io.newFileURI(file).spec;
- } else {
- path = OS.Path.basename(download.target.path);
- pathPrefix = "//";
- }
-
- return new Promise((resolve, reject) => {
- let chromeWebNav = Services.appShell.createWindowlessBrowser(true);
- chromeWebNav
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .createAboutBlankContentViewer(Services.scriptSecurityManager.getSystemPrincipal());
-
- let img = chromeWebNav.document.createElement("img");
- img.width = size;
- img.height = size;
-
- let handleLoad;
- let handleError;
- const cleanup = () => {
- img.removeEventListener("load", handleLoad);
- img.removeEventListener("error", handleError);
- chromeWebNav.close();
- chromeWebNav = null;
- };
-
- handleLoad = () => {
- let canvas = chromeWebNav.document.createElement("canvas");
- canvas.width = size;
- canvas.height = size;
- let context = canvas.getContext("2d");
- context.drawImage(img, 0, 0, size, size);
- let dataURL = canvas.toDataURL("image/png");
- cleanup();
- resolve(dataURL);
- };
-
- handleError = (error) => {
- Cu.reportError(error);
- cleanup();
- reject(new Error("An unexpected error occurred"));
- };
-
- img.addEventListener("load", handleLoad);
- img.addEventListener("error", handleError);
- img.src = `moz-icon:${pathPrefix}${path}?size=${size}`;
- });
- }).catch((error) => {
- return Promise.reject({message: error.message});
- });
- },
-
- // When we do setShelfEnabled(), check for additional "downloads.shelf" permission.
- // i.e.:
- // setShelfEnabled(enabled) {
- // if (!extension.hasPermission("downloads.shelf")) {
- // throw new context.cloneScope.Error("Permission denied because 'downloads.shelf' permission is missing.");
- // }
- // ...
- // }
-
- onChanged: new SingletonEventManager(context, "downloads.onChanged", fire => {
- const handler = (what, item) => {
- let changes = {};
- const noundef = val => (val === undefined) ? null : val;
- DOWNLOAD_ITEM_CHANGE_FIELDS.forEach(fld => {
- if (item[fld] != item.prechange[fld]) {
- changes[fld] = {
- previous: noundef(item.prechange[fld]),
- current: noundef(item[fld]),
- };
- }
- });
- if (Object.keys(changes).length > 0) {
- changes.id = item.id;
- runSafeSync(context, fire, changes);
- }
- };
-
- let registerPromise = DownloadMap.getDownloadList().then(() => {
- DownloadMap.on("change", handler);
- });
- return () => {
- registerPromise.then(() => {
- DownloadMap.off("change", handler);
- });
- };
- }).api(),
-
- onCreated: new SingletonEventManager(context, "downloads.onCreated", fire => {
- const handler = (what, item) => {
- runSafeSync(context, fire, item.serialize());
- };
- let registerPromise = DownloadMap.getDownloadList().then(() => {
- DownloadMap.on("create", handler);
- });
- return () => {
- registerPromise.then(() => {
- DownloadMap.off("create", handler);
- });
- };
- }).api(),
-
- onErased: new SingletonEventManager(context, "downloads.onErased", fire => {
- const handler = (what, item) => {
- runSafeSync(context, fire, item.id);
- };
- let registerPromise = DownloadMap.getDownloadList().then(() => {
- DownloadMap.on("erase", handler);
- });
- return () => {
- registerPromise.then(() => {
- DownloadMap.off("erase", handler);
- });
- };
- }).api(),
-
- onDeterminingFilename: ignoreEvent(context, "downloads.onDeterminingFilename"),
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-extension.js b/toolkit/components/webextensions/ext-extension.js
deleted file mode 100644
index c4bdc8b630..0000000000
--- a/toolkit/components/webextensions/ext-extension.js
+++ /dev/null
@@ -1,20 +0,0 @@
-"use strict";
-
-extensions.registerSchemaAPI("extension", "addon_parent", context => {
- return {
- extension: {
- get lastError() {
- return context.lastError;
- },
-
- isAllowedIncognitoAccess() {
- return Promise.resolve(true);
- },
-
- isAllowedFileSchemeAccess() {
- return Promise.resolve(false);
- },
- },
- };
-});
-
diff --git a/toolkit/components/webextensions/ext-i18n.js b/toolkit/components/webextensions/ext-i18n.js
deleted file mode 100644
index bb4bde4bd5..0000000000
--- a/toolkit/components/webextensions/ext-i18n.js
+++ /dev/null
@@ -1,34 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- detectLanguage,
-} = ExtensionUtils;
-
-function i18nApiFactory(context) {
- let {extension} = context;
- return {
- i18n: {
- getMessage: function(messageName, substitutions) {
- return extension.localizeMessage(messageName, substitutions, {cloneScope: context.cloneScope});
- },
-
- getAcceptLanguages: function() {
- let result = extension.localeData.acceptLanguages;
- return Promise.resolve(result);
- },
-
- getUILanguage: function() {
- return extension.localeData.uiLocale;
- },
-
- detectLanguage: function(text) {
- return detectLanguage(text);
- },
- },
- };
-}
-extensions.registerSchemaAPI("i18n", "addon_child", i18nApiFactory);
-extensions.registerSchemaAPI("i18n", "content_child", i18nApiFactory);
diff --git a/toolkit/components/webextensions/ext-idle.js b/toolkit/components/webextensions/ext-idle.js
deleted file mode 100644
index c5be4b600e..0000000000
--- a/toolkit/components/webextensions/ext-idle.js
+++ /dev/null
@@ -1,94 +0,0 @@
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
- "resource://devtools/shared/event-emitter.js");
-XPCOMUtils.defineLazyServiceGetter(this, "idleService",
- "@mozilla.org/widget/idleservice;1",
- "nsIIdleService");
-const {
- SingletonEventManager,
-} = ExtensionUtils;
-
-// WeakMap[Extension -> Object]
-var observersMap = new WeakMap();
-
-function getObserverInfo(extension, context) {
- let observerInfo = observersMap.get(extension);
- if (!observerInfo) {
- observerInfo = {
- observer: null,
- detectionInterval: 60,
- };
- observersMap.set(extension, observerInfo);
- context.callOnClose({
- close: () => {
- let {observer, detectionInterval} = observersMap.get(extension);
- if (observer) {
- idleService.removeIdleObserver(observer, detectionInterval);
- }
- observersMap.delete(extension);
- },
- });
- }
- return observerInfo;
-}
-
-function getObserver(extension, context) {
- let observerInfo = getObserverInfo(extension, context);
- let {observer, detectionInterval} = observerInfo;
- if (!observer) {
- observer = {
- observe: function(subject, topic, data) {
- if (topic == "idle" || topic == "active") {
- this.emit("stateChanged", topic);
- }
- },
- };
- EventEmitter.decorate(observer);
- idleService.addIdleObserver(observer, detectionInterval);
- observerInfo.observer = observer;
- observerInfo.detectionInterval = detectionInterval;
- }
- return observer;
-}
-
-function setDetectionInterval(extension, context, newInterval) {
- let observerInfo = getObserverInfo(extension, context);
- let {observer, detectionInterval} = observerInfo;
- if (observer) {
- idleService.removeIdleObserver(observer, detectionInterval);
- idleService.addIdleObserver(observer, newInterval);
- }
- observerInfo.detectionInterval = newInterval;
-}
-
-extensions.registerSchemaAPI("idle", "addon_parent", context => {
- let {extension} = context;
- return {
- idle: {
- queryState: function(detectionIntervalInSeconds) {
- if (idleService.idleTime < detectionIntervalInSeconds * 1000) {
- return Promise.resolve("active");
- }
- return Promise.resolve("idle");
- },
- setDetectionInterval: function(detectionIntervalInSeconds) {
- setDetectionInterval(extension, context, detectionIntervalInSeconds);
- },
- onStateChanged: new SingletonEventManager(context, "idle.onStateChanged", fire => {
- let listener = (event, data) => {
- context.runSafe(fire, data);
- };
-
- getObserver(extension, context).on("stateChanged", listener);
- return () => {
- getObserver(extension, context).off("stateChanged", listener);
- };
- }).api(),
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-management.js b/toolkit/components/webextensions/ext-management.js
deleted file mode 100644
index 59a7959d78..0000000000
--- a/toolkit/components/webextensions/ext-management.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-XPCOMUtils.defineLazyGetter(this, "strBundle", function() {
- const stringSvc = Cc["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService);
- return stringSvc.createBundle("chrome://global/locale/extensions.properties");
-});
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyServiceGetter(this, "promptService",
- "@mozilla.org/embedcomp/prompt-service;1",
- "nsIPromptService");
-
-function _(key, ...args) {
- if (args.length) {
- return strBundle.formatStringFromName(key, args, args.length);
- }
- return strBundle.GetStringFromName(key);
-}
-
-function installType(addon) {
- if (addon.temporarilyInstalled) {
- return "development";
- } else if (addon.foreignInstall) {
- return "sideload";
- } else if (addon.isSystem) {
- return "other";
- }
- return "normal";
-}
-
-extensions.registerSchemaAPI("management", "addon_parent", context => {
- let {extension} = context;
- return {
- management: {
- getSelf: function() {
- return new Promise((resolve, reject) => AddonManager.getAddonByID(extension.id, addon => {
- try {
- let m = extension.manifest;
- let extInfo = {
- id: extension.id,
- name: addon.name,
- shortName: m.short_name || "",
- description: addon.description || "",
- version: addon.version,
- mayDisable: !!(addon.permissions & AddonManager.PERM_CAN_DISABLE),
- enabled: addon.isActive,
- optionsUrl: addon.optionsURL || "",
- permissions: Array.from(extension.permissions).filter(perm => {
- return !extension.whiteListedHosts.pat.includes(perm);
- }),
- hostPermissions: extension.whiteListedHosts.pat,
- installType: installType(addon),
- };
- if (addon.homepageURL) {
- extInfo.homepageUrl = addon.homepageURL;
- }
- if (addon.updateURL) {
- extInfo.updateUrl = addon.updateURL;
- }
- if (m.icons) {
- extInfo.icons = Object.keys(m.icons).map(key => {
- return {size: Number(key), url: m.icons[key]};
- });
- }
-
- resolve(extInfo);
- } catch (err) {
- reject(err);
- }
- }));
- },
-
- uninstallSelf: function(options) {
- return new Promise((resolve, reject) => {
- if (options && options.showConfirmDialog) {
- let message = _("uninstall.confirmation.message", extension.name);
- if (options.dialogMessage) {
- message = `${options.dialogMessage}\n${message}`;
- }
- let title = _("uninstall.confirmation.title", extension.name);
- let buttonFlags = promptService.BUTTON_POS_0 * promptService.BUTTON_TITLE_IS_STRING +
- promptService.BUTTON_POS_1 * promptService.BUTTON_TITLE_IS_STRING;
- let button0Title = _("uninstall.confirmation.button-0.label");
- let button1Title = _("uninstall.confirmation.button-1.label");
- let response = promptService.confirmEx(null, title, message, buttonFlags, button0Title, button1Title, null, null, {value: 0});
- if (response == 1) {
- return reject({message: "User cancelled uninstall of extension"});
- }
- }
- AddonManager.getAddonByID(extension.id, addon => {
- let canUninstall = Boolean(addon.permissions & AddonManager.PERM_CAN_UNINSTALL);
- if (!canUninstall) {
- return reject({message: "The add-on cannot be uninstalled"});
- }
- try {
- addon.uninstall();
- } catch (err) {
- return reject(err);
- }
- });
- });
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-notifications.js b/toolkit/components/webextensions/ext-notifications.js
deleted file mode 100644
index 1df96a2ace..0000000000
--- a/toolkit/components/webextensions/ext-notifications.js
+++ /dev/null
@@ -1,161 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
- "resource://devtools/shared/event-emitter.js");
-
-var {
- EventManager,
- ignoreEvent,
-} = ExtensionUtils;
-
-// WeakMap[Extension -> Map[id -> Notification]]
-var notificationsMap = new WeakMap();
-
-// Manages a notification popup (notifications API) created by the extension.
-function Notification(extension, id, options) {
- this.extension = extension;
- this.id = id;
- this.options = options;
-
- let imageURL;
- if (options.iconUrl) {
- imageURL = this.extension.baseURI.resolve(options.iconUrl);
- }
-
- try {
- let svc = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
- svc.showAlertNotification(imageURL,
- options.title,
- options.message,
- true, // textClickable
- this.id,
- this,
- this.id);
- } catch (e) {
- // This will fail if alerts aren't available on the system.
- }
-}
-
-Notification.prototype = {
- clear() {
- try {
- let svc = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
- svc.closeAlert(this.id);
- } catch (e) {
- // This will fail if the OS doesn't support this function.
- }
- notificationsMap.get(this.extension).delete(this.id);
- },
-
- observe(subject, topic, data) {
- let notifications = notificationsMap.get(this.extension);
-
- let emitAndDelete = event => {
- notifications.emit(event, data);
- notifications.delete(this.id);
- };
-
- // Don't try to emit events if the extension has been unloaded
- if (!notifications) {
- return;
- }
-
- if (topic === "alertclickcallback") {
- emitAndDelete("clicked");
- }
- if (topic === "alertfinished") {
- emitAndDelete("closed");
- }
- },
-};
-
-/* eslint-disable mozilla/balanced-listeners */
-extensions.on("startup", (type, extension) => {
- let map = new Map();
- EventEmitter.decorate(map);
- notificationsMap.set(extension, map);
-});
-
-extensions.on("shutdown", (type, extension) => {
- if (notificationsMap.has(extension)) {
- for (let notification of notificationsMap.get(extension).values()) {
- notification.clear();
- }
- notificationsMap.delete(extension);
- }
-});
-/* eslint-enable mozilla/balanced-listeners */
-
-var nextId = 0;
-
-extensions.registerSchemaAPI("notifications", "addon_parent", context => {
- let {extension} = context;
- return {
- notifications: {
- create: function(notificationId, options) {
- if (!notificationId) {
- notificationId = String(nextId++);
- }
-
- let notifications = notificationsMap.get(extension);
- if (notifications.has(notificationId)) {
- notifications.get(notificationId).clear();
- }
-
- // FIXME: Lots of options still aren't supported, especially
- // buttons.
- let notification = new Notification(extension, notificationId, options);
- notificationsMap.get(extension).set(notificationId, notification);
-
- return Promise.resolve(notificationId);
- },
-
- clear: function(notificationId) {
- let notifications = notificationsMap.get(extension);
- if (notifications.has(notificationId)) {
- notifications.get(notificationId).clear();
- return Promise.resolve(true);
- }
- return Promise.resolve(false);
- },
-
- getAll: function() {
- let result = {};
- notificationsMap.get(extension).forEach((value, key) => {
- result[key] = value.options;
- });
- return Promise.resolve(result);
- },
-
- onClosed: new EventManager(context, "notifications.onClosed", fire => {
- let listener = (event, notificationId) => {
- // FIXME: Support the byUser argument.
- fire(notificationId, true);
- };
-
- notificationsMap.get(extension).on("closed", listener);
- return () => {
- notificationsMap.get(extension).off("closed", listener);
- };
- }).api(),
-
- onClicked: new EventManager(context, "notifications.onClicked", fire => {
- let listener = (event, notificationId) => {
- fire(notificationId, true);
- };
-
- notificationsMap.get(extension).on("clicked", listener);
- return () => {
- notificationsMap.get(extension).off("clicked", listener);
- };
- }).api(),
-
- // Intend to implement this later: https://bugzilla.mozilla.org/show_bug.cgi?id=1190681
- onButtonClicked: ignoreEvent(context, "notifications.onButtonClicked"),
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-runtime.js b/toolkit/components/webextensions/ext-runtime.js
deleted file mode 100644
index aed3ffd4b0..0000000000
--- a/toolkit/components/webextensions/ext-runtime.js
+++ /dev/null
@@ -1,134 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Extension",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
- "resource://gre/modules/ExtensionManagement.jsm");
-
-var {
- SingletonEventManager,
-} = ExtensionUtils;
-
-extensions.registerSchemaAPI("runtime", "addon_parent", context => {
- let {extension} = context;
- return {
- runtime: {
- onStartup: new SingletonEventManager(context, "runtime.onStartup", fire => {
- if (context.incognito) {
- // This event should not fire if we are operating in a private profile.
- return () => {};
- }
- let listener = () => {
- if (extension.startupReason === "APP_STARTUP") {
- fire();
- }
- };
- extension.on("startup", listener);
- return () => {
- extension.off("startup", listener);
- };
- }).api(),
-
- onInstalled: new SingletonEventManager(context, "runtime.onInstalled", fire => {
- let listener = () => {
- switch (extension.startupReason) {
- case "APP_STARTUP":
- if (Extension.browserUpdated) {
- fire({reason: "browser_update"});
- }
- break;
- case "ADDON_INSTALL":
- fire({reason: "install"});
- break;
- case "ADDON_UPGRADE":
- fire({reason: "update"});
- break;
- }
- };
- extension.on("startup", listener);
- return () => {
- extension.off("startup", listener);
- };
- }).api(),
-
- onUpdateAvailable: new SingletonEventManager(context, "runtime.onUpdateAvailable", fire => {
- let instanceID = extension.addonData.instanceID;
- AddonManager.addUpgradeListener(instanceID, upgrade => {
- extension.upgrade = upgrade;
- let details = {
- version: upgrade.version,
- };
- context.runSafe(fire, details);
- });
- return () => {
- AddonManager.removeUpgradeListener(instanceID);
- };
- }).api(),
-
- reload: () => {
- if (extension.upgrade) {
- // If there is a pending update, install it now.
- extension.upgrade.install();
- } else {
- // Otherwise, reload the current extension.
- AddonManager.getAddonByID(extension.id, addon => {
- addon.reload();
- });
- }
- },
-
- get lastError() {
- // TODO(robwu): Figure out how to make sure that errors in the parent
- // process are propagated to the child process.
- // lastError should not be accessed from the parent.
- return context.lastError;
- },
-
- getBrowserInfo: function() {
- const {name, vendor, version, appBuildID} = Services.appinfo;
- const info = {name, vendor, version, buildID: appBuildID};
- return Promise.resolve(info);
- },
-
- getPlatformInfo: function() {
- return Promise.resolve(ExtensionUtils.PlatformInfo);
- },
-
- openOptionsPage: function() {
- if (!extension.manifest.options_ui) {
- return Promise.reject({message: "No `options_ui` declared"});
- }
-
- return openOptionsPage(extension).then(() => {});
- },
-
- setUninstallURL: function(url) {
- if (url.length == 0) {
- return Promise.resolve();
- }
-
- let uri;
- try {
- uri = NetUtil.newURI(url);
- } catch (e) {
- return Promise.reject({message: `Invalid URL: ${JSON.stringify(url)}`});
- }
-
- if (uri.scheme != "http" && uri.scheme != "https") {
- return Promise.reject({message: "url must have the scheme http or https"});
- }
-
- extension.uninstallURL = url;
- return Promise.resolve();
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-storage.js b/toolkit/components/webextensions/ext-storage.js
deleted file mode 100644
index b1e22c46c0..0000000000
--- a/toolkit/components/webextensions/ext-storage.js
+++ /dev/null
@@ -1,46 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionStorage",
- "resource://gre/modules/ExtensionStorage.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- EventManager,
-} = ExtensionUtils;
-
-function storageApiFactory(context) {
- let {extension} = context;
- return {
- storage: {
- local: {
- get: function(spec) {
- return ExtensionStorage.get(extension.id, spec);
- },
- set: function(items) {
- return ExtensionStorage.set(extension.id, items, context);
- },
- remove: function(keys) {
- return ExtensionStorage.remove(extension.id, keys);
- },
- clear: function() {
- return ExtensionStorage.clear(extension.id);
- },
- },
-
- onChanged: new EventManager(context, "storage.onChanged", fire => {
- let listenerLocal = changes => {
- fire(changes, "local");
- };
-
- ExtensionStorage.addOnChangedListener(extension.id, listenerLocal);
- return () => {
- ExtensionStorage.removeOnChangedListener(extension.id, listenerLocal);
- };
- }).api(),
- },
- };
-}
-extensions.registerSchemaAPI("storage", "addon_parent", storageApiFactory);
-extensions.registerSchemaAPI("storage", "content_parent", storageApiFactory);
diff --git a/toolkit/components/webextensions/ext-topSites.js b/toolkit/components/webextensions/ext-topSites.js
deleted file mode 100644
index a66ac85d99..0000000000
--- a/toolkit/components/webextensions/ext-topSites.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "NewTabUtils",
- "resource://gre/modules/NewTabUtils.jsm");
-
-extensions.registerSchemaAPI("topSites", "addon_parent", context => {
- return {
- topSites: {
- get: function() {
- let urls = NewTabUtils.links.getLinks()
- .filter(link => !!link)
- .map(link => {
- return {
- url: link.url,
- title: link.title,
- };
- });
- return Promise.resolve(urls);
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-webNavigation.js b/toolkit/components/webextensions/ext-webNavigation.js
deleted file mode 100644
index 904f3a4a78..0000000000
--- a/toolkit/components/webextensions/ext-webNavigation.js
+++ /dev/null
@@ -1,192 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
- "resource://gre/modules/ExtensionManagement.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MatchURLFilters",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "WebNavigation",
- "resource://gre/modules/WebNavigation.jsm");
-
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- SingletonEventManager,
- ignoreEvent,
-} = ExtensionUtils;
-
-const defaultTransitionTypes = {
- topFrame: "link",
- subFrame: "auto_subframe",
-};
-
-const frameTransitions = {
- anyFrame: {
- qualifiers: ["server_redirect", "client_redirect", "forward_back"],
- },
- topFrame: {
- types: ["reload", "form_submit"],
- },
-};
-
-const tabTransitions = {
- topFrame: {
- qualifiers: ["from_address_bar"],
- types: ["auto_bookmark", "typed", "keyword", "generated", "link"],
- },
- subFrame: {
- types: ["manual_subframe"],
- },
-};
-
-function isTopLevelFrame({frameId, parentFrameId}) {
- return frameId == 0 && parentFrameId == -1;
-}
-
-function fillTransitionProperties(eventName, src, dst) {
- if (eventName == "onCommitted" || eventName == "onHistoryStateUpdated") {
- let frameTransitionData = src.frameTransitionData || {};
- let tabTransitionData = src.tabTransitionData || {};
-
- let transitionType, transitionQualifiers = [];
-
- // Fill transition properties for any frame.
- for (let qualifier of frameTransitions.anyFrame.qualifiers) {
- if (frameTransitionData[qualifier]) {
- transitionQualifiers.push(qualifier);
- }
- }
-
- if (isTopLevelFrame(dst)) {
- for (let type of frameTransitions.topFrame.types) {
- if (frameTransitionData[type]) {
- transitionType = type;
- }
- }
-
- for (let qualifier of tabTransitions.topFrame.qualifiers) {
- if (tabTransitionData[qualifier]) {
- transitionQualifiers.push(qualifier);
- }
- }
-
- for (let type of tabTransitions.topFrame.types) {
- if (tabTransitionData[type]) {
- transitionType = type;
- }
- }
-
- // If transitionType is not defined, defaults it to "link".
- if (!transitionType) {
- transitionType = defaultTransitionTypes.topFrame;
- }
- } else {
- // If it is sub-frame, transitionType defaults it to "auto_subframe",
- // "manual_subframe" is set only in case of a recent user interaction.
- transitionType = tabTransitionData.link ?
- "manual_subframe" : defaultTransitionTypes.subFrame;
- }
-
- // Fill the transition properties in the webNavigation event object.
- dst.transitionType = transitionType;
- dst.transitionQualifiers = transitionQualifiers;
- }
-}
-
-// Similar to WebRequestEventManager but for WebNavigation.
-function WebNavigationEventManager(context, eventName) {
- let name = `webNavigation.${eventName}`;
- let register = (callback, urlFilters) => {
- // Don't create a MatchURLFilters instance if the listener does not include any filter.
- let filters = urlFilters ?
- new MatchURLFilters(urlFilters.url) : null;
-
- let listener = data => {
- if (!data.browser) {
- return;
- }
-
- let data2 = {
- url: data.url,
- timeStamp: Date.now(),
- frameId: ExtensionManagement.getFrameId(data.windowId),
- parentFrameId: ExtensionManagement.getParentFrameId(data.parentWindowId, data.windowId),
- };
-
- if (eventName == "onErrorOccurred") {
- data2.error = data.error;
- }
-
- // Fills in tabId typically.
- extensions.emit("fill-browser-data", data.browser, data2);
- if (data2.tabId < 0) {
- return;
- }
-
- fillTransitionProperties(eventName, data, data2);
-
- context.runSafe(callback, data2);
- };
-
- WebNavigation[eventName].addListener(listener, filters);
- return () => {
- WebNavigation[eventName].removeListener(listener);
- };
- };
-
- return SingletonEventManager.call(this, context, name, register);
-}
-
-WebNavigationEventManager.prototype = Object.create(SingletonEventManager.prototype);
-
-function convertGetFrameResult(tabId, data) {
- return {
- errorOccurred: data.errorOccurred,
- url: data.url,
- tabId,
- frameId: ExtensionManagement.getFrameId(data.windowId),
- parentFrameId: ExtensionManagement.getParentFrameId(data.parentWindowId, data.windowId),
- };
-}
-
-extensions.registerSchemaAPI("webNavigation", "addon_parent", context => {
- return {
- webNavigation: {
- onTabReplaced: ignoreEvent(context, "webNavigation.onTabReplaced"),
- onBeforeNavigate: new WebNavigationEventManager(context, "onBeforeNavigate").api(),
- onCommitted: new WebNavigationEventManager(context, "onCommitted").api(),
- onDOMContentLoaded: new WebNavigationEventManager(context, "onDOMContentLoaded").api(),
- onCompleted: new WebNavigationEventManager(context, "onCompleted").api(),
- onErrorOccurred: new WebNavigationEventManager(context, "onErrorOccurred").api(),
- onReferenceFragmentUpdated: new WebNavigationEventManager(context, "onReferenceFragmentUpdated").api(),
- onHistoryStateUpdated: new WebNavigationEventManager(context, "onHistoryStateUpdated").api(),
- onCreatedNavigationTarget: ignoreEvent(context, "webNavigation.onCreatedNavigationTarget"),
- getAllFrames(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- let {innerWindowID, messageManager} = tab.linkedBrowser;
- let recipient = {innerWindowID};
-
- return context.sendMessage(messageManager, "WebNavigation:GetAllFrames", {}, {recipient})
- .then((results) => results.map(convertGetFrameResult.bind(null, details.tabId)));
- },
- getFrame(details) {
- let tab = TabManager.getTab(details.tabId, context);
-
- let recipient = {
- innerWindowID: tab.linkedBrowser.innerWindowID,
- };
-
- let mm = tab.linkedBrowser.messageManager;
- return context.sendMessage(mm, "WebNavigation:GetFrame", {options: details}, {recipient})
- .then((result) => {
- return result ?
- convertGetFrameResult(details.tabId, result) :
- Promise.reject({message: `No frame found with frameId: ${details.frameId}`});
- });
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/ext-webRequest.js b/toolkit/components/webextensions/ext-webRequest.js
deleted file mode 100644
index f92330131d..0000000000
--- a/toolkit/components/webextensions/ext-webRequest.js
+++ /dev/null
@@ -1,115 +0,0 @@
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "MatchPattern",
- "resource://gre/modules/MatchPattern.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "WebRequest",
- "resource://gre/modules/WebRequest.jsm");
-
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-var {
- SingletonEventManager,
-} = ExtensionUtils;
-
-// EventManager-like class specifically for WebRequest. Inherits from
-// SingletonEventManager. Takes care of converting |details| parameter
-// when invoking listeners.
-function WebRequestEventManager(context, eventName) {
- let name = `webRequest.${eventName}`;
- let register = (callback, filter, info) => {
- let listener = data => {
- // Prevent listening in on requests originating from system principal to
- // prevent tinkering with OCSP, app and addon updates, etc.
- if (data.isSystemPrincipal) {
- return;
- }
-
- let data2 = {
- requestId: data.requestId,
- url: data.url,
- originUrl: data.originUrl,
- method: data.method,
- type: data.type,
- timeStamp: Date.now(),
- frameId: data.type == "main_frame" ? 0 : ExtensionManagement.getFrameId(data.windowId),
- parentFrameId: ExtensionManagement.getParentFrameId(data.parentWindowId, data.windowId),
- };
-
- const maybeCached = ["onResponseStarted", "onBeforeRedirect", "onCompleted", "onErrorOccurred"];
- if (maybeCached.includes(eventName)) {
- data2.fromCache = !!data.fromCache;
- }
-
- if ("ip" in data) {
- data2.ip = data.ip;
- }
-
- extensions.emit("fill-browser-data", data.browser, data2);
-
- let optional = ["requestHeaders", "responseHeaders", "statusCode", "statusLine", "error", "redirectUrl",
- "requestBody"];
- for (let opt of optional) {
- if (opt in data) {
- data2[opt] = data[opt];
- }
- }
-
- return context.runSafe(callback, data2);
- };
-
- let filter2 = {};
- filter2.urls = new MatchPattern(filter.urls);
- if (filter.types) {
- filter2.types = filter.types;
- }
- if (filter.tabId) {
- filter2.tabId = filter.tabId;
- }
- if (filter.windowId) {
- filter2.windowId = filter.windowId;
- }
-
- let info2 = [];
- if (info) {
- for (let desc of info) {
- if (desc == "blocking" && !context.extension.hasPermission("webRequestBlocking")) {
- Cu.reportError("Using webRequest.addListener with the blocking option " +
- "requires the 'webRequestBlocking' permission.");
- } else {
- info2.push(desc);
- }
- }
- }
-
- WebRequest[eventName].addListener(listener, filter2, info2);
- return () => {
- WebRequest[eventName].removeListener(listener);
- };
- };
-
- return SingletonEventManager.call(this, context, name, register);
-}
-
-WebRequestEventManager.prototype = Object.create(SingletonEventManager.prototype);
-
-extensions.registerSchemaAPI("webRequest", "addon_parent", context => {
- return {
- webRequest: {
- onBeforeRequest: new WebRequestEventManager(context, "onBeforeRequest").api(),
- onBeforeSendHeaders: new WebRequestEventManager(context, "onBeforeSendHeaders").api(),
- onSendHeaders: new WebRequestEventManager(context, "onSendHeaders").api(),
- onHeadersReceived: new WebRequestEventManager(context, "onHeadersReceived").api(),
- onBeforeRedirect: new WebRequestEventManager(context, "onBeforeRedirect").api(),
- onResponseStarted: new WebRequestEventManager(context, "onResponseStarted").api(),
- onErrorOccurred: new WebRequestEventManager(context, "onErrorOccurred").api(),
- onCompleted: new WebRequestEventManager(context, "onCompleted").api(),
- handlerBehaviorChanged: function() {
- // TODO: Flush all caches.
- },
- },
- };
-});
diff --git a/toolkit/components/webextensions/extensions-toolkit.manifest b/toolkit/components/webextensions/extensions-toolkit.manifest
deleted file mode 100644
index 4ec65a9844..0000000000
--- a/toolkit/components/webextensions/extensions-toolkit.manifest
+++ /dev/null
@@ -1,49 +0,0 @@
-# scripts
-category webextension-scripts alarms chrome://extensions/content/ext-alarms.js
-category webextension-scripts backgroundPage chrome://extensions/content/ext-backgroundPage.js
-category webextension-scripts cookies chrome://extensions/content/ext-cookies.js
-category webextension-scripts downloads chrome://extensions/content/ext-downloads.js
-category webextension-scripts management chrome://extensions/content/ext-management.js
-category webextension-scripts notifications chrome://extensions/content/ext-notifications.js
-category webextension-scripts i18n chrome://extensions/content/ext-i18n.js
-category webextension-scripts idle chrome://extensions/content/ext-idle.js
-category webextension-scripts webRequest chrome://extensions/content/ext-webRequest.js
-category webextension-scripts webNavigation chrome://extensions/content/ext-webNavigation.js
-category webextension-scripts runtime chrome://extensions/content/ext-runtime.js
-category webextension-scripts extension chrome://extensions/content/ext-extension.js
-category webextension-scripts storage chrome://extensions/content/ext-storage.js
-category webextension-scripts topSites chrome://extensions/content/ext-topSites.js
-
-# scripts specific for content process.
-category webextension-scripts-content extension chrome://extensions/content/ext-c-extension.js
-category webextension-scripts-content i18n chrome://extensions/content/ext-i18n.js
-category webextension-scripts-content runtime chrome://extensions/content/ext-c-runtime.js
-category webextension-scripts-content test chrome://extensions/content/ext-c-test.js
-category webextension-scripts-content storage chrome://extensions/content/ext-c-storage.js
-
-# scripts that must run in the same process as addon code.
-category webextension-scripts-addon backgroundPage chrome://extensions/content/ext-c-backgroundPage.js
-category webextension-scripts-addon extension chrome://extensions/content/ext-c-extension.js
-category webextension-scripts-addon i18n chrome://extensions/content/ext-i18n.js
-category webextension-scripts-addon runtime chrome://extensions/content/ext-c-runtime.js
-category webextension-scripts-addon test chrome://extensions/content/ext-c-test.js
-category webextension-scripts-addon storage chrome://extensions/content/ext-c-storage.js
-
-# schemas
-category webextension-schemas alarms chrome://extensions/content/schemas/alarms.json
-category webextension-schemas cookies chrome://extensions/content/schemas/cookies.json
-category webextension-schemas downloads chrome://extensions/content/schemas/downloads.json
-category webextension-schemas events chrome://extensions/content/schemas/events.json
-category webextension-schemas extension chrome://extensions/content/schemas/extension.json
-category webextension-schemas extension_types chrome://extensions/content/schemas/extension_types.json
-category webextension-schemas i18n chrome://extensions/content/schemas/i18n.json
-category webextension-schemas idle chrome://extensions/content/schemas/idle.json
-category webextension-schemas management chrome://extensions/content/schemas/management.json
-category webextension-schemas native_host_manifest chrome://extensions/content/schemas/native_host_manifest.json
-category webextension-schemas notifications chrome://extensions/content/schemas/notifications.json
-category webextension-schemas runtime chrome://extensions/content/schemas/runtime.json
-category webextension-schemas storage chrome://extensions/content/schemas/storage.json
-category webextension-schemas test chrome://extensions/content/schemas/test.json
-category webextension-schemas top_sites chrome://extensions/content/schemas/top_sites.json
-category webextension-schemas web_navigation chrome://extensions/content/schemas/web_navigation.json
-category webextension-schemas web_request chrome://extensions/content/schemas/web_request.json
diff --git a/toolkit/components/webextensions/jar.mn b/toolkit/components/webextensions/jar.mn
deleted file mode 100644
index 6d343e1b74..0000000000
--- a/toolkit/components/webextensions/jar.mn
+++ /dev/null
@@ -1,26 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-toolkit.jar:
-% content extensions %content/extensions/
- content/extensions/ext-alarms.js
- content/extensions/ext-backgroundPage.js
- content/extensions/ext-browser-content.js
- content/extensions/ext-cookies.js
- content/extensions/ext-downloads.js
- content/extensions/ext-management.js
- content/extensions/ext-notifications.js
- content/extensions/ext-i18n.js
- content/extensions/ext-idle.js
- content/extensions/ext-webRequest.js
- content/extensions/ext-webNavigation.js
- content/extensions/ext-runtime.js
- content/extensions/ext-extension.js
- content/extensions/ext-storage.js
- content/extensions/ext-topSites.js
- content/extensions/ext-c-backgroundPage.js
- content/extensions/ext-c-extension.js
- content/extensions/ext-c-runtime.js
- content/extensions/ext-c-storage.js
- content/extensions/ext-c-test.js
diff --git a/toolkit/components/webextensions/moz.build b/toolkit/components/webextensions/moz.build
deleted file mode 100644
index f32f526f96..0000000000
--- a/toolkit/components/webextensions/moz.build
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXTRA_JS_MODULES += [
- 'Extension.jsm',
- 'ExtensionAPI.jsm',
- 'ExtensionChild.jsm',
- 'ExtensionCommon.jsm',
- 'ExtensionContent.jsm',
- 'ExtensionManagement.jsm',
- 'ExtensionParent.jsm',
- 'ExtensionStorage.jsm',
- 'ExtensionUtils.jsm',
- 'LegacyExtensionsUtils.jsm',
- 'MessageChannel.jsm',
- 'NativeMessaging.jsm',
- 'Schemas.jsm',
-]
-
-EXTRA_COMPONENTS += [
- 'extensions-toolkit.manifest',
-]
-
-TESTING_JS_MODULES += [
- 'ExtensionTestCommon.jsm',
- 'ExtensionXPCShellUtils.jsm',
-]
-
-DIRS += ['schemas']
-
-JAR_MANIFESTS += ['jar.mn']
-
-MOCHITEST_MANIFESTS += ['test/mochitest/mochitest.ini']
-MOCHITEST_CHROME_MANIFESTS += ['test/mochitest/chrome.ini']
-XPCSHELL_TESTS_MANIFESTS += [
- 'test/xpcshell/native_messaging.ini',
- 'test/xpcshell/xpcshell.ini',
-]
diff --git a/toolkit/components/webextensions/schemas/LICENSE b/toolkit/components/webextensions/schemas/LICENSE
deleted file mode 100644
index 9314092fdc..0000000000
--- a/toolkit/components/webextensions/schemas/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/toolkit/components/webextensions/schemas/alarms.json b/toolkit/components/webextensions/schemas/alarms.json
deleted file mode 100644
index 2a72a28425..0000000000
--- a/toolkit/components/webextensions/schemas/alarms.json
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "alarms",
- "permissions": ["alarms"],
- "types": [
- {
- "id": "Alarm",
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of this alarm."
- },
- "scheduledTime": {
- "type": "number",
- "description": "Time when the alarm is scheduled to fire, in milliseconds past the epoch."
- },
- "periodInMinutes": {
- "type": "number",
- "optional": true,
- "description": "When present, signals that the alarm triggers periodically after so many minutes."
- }
- }
- }
- ],
- "functions": [
- {
- "name": "create",
- "type": "function",
- "description": "Creates an alarm. After the delay is expired, the onAlarm event is fired. If there is another alarm with the same name (or no name if none is specified), it will be cancelled and replaced by this alarm.",
- "parameters": [
- {
- "type": "string",
- "name": "name",
- "optional": true,
- "description": "Optional name to identify this alarm. Defaults to the empty string."
- },
- {
- "type": "object",
- "name": "alarmInfo",
- "description": "Details about the alarm. The alarm first fires either at 'when' milliseconds past the epoch (if 'when' is provided), after 'delayInMinutes' minutes from the current time (if 'delayInMinutes' is provided instead), or after 'periodInMinutes' minutes from the current time (if only 'periodInMinutes' is provided). Users should never provide both 'when' and 'delayInMinutes'. If 'periodInMinutes' is provided, then the alarm recurs repeatedly after that many minutes.",
- "properties": {
- "when": {"type": "number", "optional": true,
- "description": "Time when the alarm is scheduled to first fire, in milliseconds past the epoch."},
- "delayInMinutes": {"type": "number", "optional": true,
- "description": "Number of minutes from the current time after which the alarm should first fire."},
- "periodInMinutes": {"type": "number", "optional": true,
- "description": "Number of minutes after which the alarm should recur repeatedly."}
- }
- }
- ]
- },
- {
- "name": "get",
- "type": "function",
- "description": "Retrieves details about the specified alarm.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "name",
- "optional": true,
- "description": "The name of the alarm to get. Defaults to the empty string."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- { "name": "alarm", "$ref": "Alarm" }
- ]
- }
- ]
- },
- {
- "name": "getAll",
- "type": "function",
- "description": "Gets an array of all the alarms.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- { "name": "alarms", "type": "array", "items": { "$ref": "Alarm" } }
- ]
- }
- ]
- },
- {
- "name": "clear",
- "type": "function",
- "description": "Clears the alarm with the given name.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "name",
- "optional": true,
- "description": "The name of the alarm to clear. Defaults to the empty string."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- { "name": "wasCleared", "type": "boolean", "description": "Whether an alarm of the given name was found to clear." }
- ]
- }
- ]
- },
- {
- "name": "clearAll",
- "type": "function",
- "description": "Clears all alarms.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- { "name": "wasCleared", "type": "boolean", "description": "Whether any alarm was found to clear." }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onAlarm",
- "type": "function",
- "description": "Fired when an alarm has expired. Useful for transient background pages.",
- "parameters": [
- {
- "name": "name",
- "$ref": "Alarm",
- "description": "The alarm that has expired."
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/cookies.json b/toolkit/components/webextensions/schemas/cookies.json
deleted file mode 100644
index a7de6eb426..0000000000
--- a/toolkit/components/webextensions/schemas/cookies.json
+++ /dev/null
@@ -1,224 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "cookies"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "cookies",
- "description": "Use the <code>browser.cookies</code> API to query and modify cookies, and to be notified when they change.",
- "permissions": ["cookies"],
- "types": [
- {
- "id": "Cookie",
- "type": "object",
- "description": "Represents information about an HTTP cookie.",
- "properties": {
- "name": {"type": "string", "description": "The name of the cookie."},
- "value": {"type": "string", "description": "The value of the cookie."},
- "domain": {"type": "string", "description": "The domain of the cookie (e.g. \"www.google.com\", \"example.com\")."},
- "hostOnly": {"type": "boolean", "description": "True if the cookie is a host-only cookie (i.e. a request's host must exactly match the domain of the cookie)."},
- "path": {"type": "string", "description": "The path of the cookie."},
- "secure": {"type": "boolean", "description": "True if the cookie is marked as Secure (i.e. its scope is limited to secure channels, typically HTTPS)."},
- "httpOnly": {"type": "boolean", "description": "True if the cookie is marked as HttpOnly (i.e. the cookie is inaccessible to client-side scripts)."},
- "session": {"type": "boolean", "description": "True if the cookie is a session cookie, as opposed to a persistent cookie with an expiration date."},
- "expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies."},
- "storeId": {"type": "string", "description": "The ID of the cookie store containing this cookie, as provided in getAllCookieStores()."}
- }
- },
- {
- "id": "CookieStore",
- "type": "object",
- "description": "Represents a cookie store in the browser. An incognito mode window, for instance, uses a separate cookie store from a non-incognito window.",
- "properties": {
- "id": {"type": "string", "description": "The unique identifier for the cookie store."},
- "tabIds": {"type": "array", "items": {"type": "integer"}, "description": "Identifiers of all the browser tabs that share this cookie store."}
- }
- },
- {
- "id": "OnChangedCause",
- "type": "string",
- "enum": ["evicted", "expired", "explicit", "expired_overwrite", "overwrite"],
- "description": "The underlying reason behind the cookie's change. If a cookie was inserted, or removed via an explicit call to $(ref:cookies.remove), \"cause\" will be \"explicit\". If a cookie was automatically removed due to expiry, \"cause\" will be \"expired\". If a cookie was removed due to being overwritten with an already-expired expiration date, \"cause\" will be set to \"expired_overwrite\". If a cookie was automatically removed due to garbage collection, \"cause\" will be \"evicted\". If a cookie was automatically removed due to a \"set\" call that overwrote it, \"cause\" will be \"overwrite\". Plan your response accordingly."
- }
- ],
- "functions": [
- {
- "name": "get",
- "type": "function",
- "description": "Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "description": "Details to identify the cookie being retrieved.",
- "properties": {
- "url": {"type": "string", "description": "The URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is simply ignored. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
- "name": {"type": "string", "description": "The name of the cookie to retrieve."},
- "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to look for the cookie. By default, the current execution context's cookie store will be used."}
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie. This parameter is null if no such cookie was found."
- }
- ]
- }
- ]
- },
- {
- "name": "getAll",
- "type": "function",
- "description": "Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "description": "Information to filter the cookies being retrieved.",
- "properties": {
- "url": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those that would match the given URL."},
- "name": {"type": "string", "optional": true, "description": "Filters the cookies by name."},
- "domain": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose domains match or are subdomains of this one."},
- "path": {"type": "string", "optional": true, "description": "Restricts the retrieved cookies to those whose path exactly matches this string."},
- "secure": {"type": "boolean", "optional": true, "description": "Filters the cookies by their Secure property."},
- "session": {"type": "boolean", "optional": true, "description": "Filters out session vs. persistent cookies."},
- "storeId": {"type": "string", "optional": true, "description": "The cookie store to retrieve cookies from. If omitted, the current execution context's cookie store will be used."}
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "cookies", "type": "array", "items": {"$ref": "Cookie"}, "description": "All the existing, unexpired cookies that match the given cookie info."
- }
- ]
- }
- ]
- },
- {
- "name": "set",
- "type": "function",
- "description": "Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "description": "Details about the cookie being set.",
- "properties": {
- "url": {"type": "string", "description": "The request-URI to associate with the setting of the cookie. This value can affect the default domain and path values of the created cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
- "name": {"type": "string", "optional": true, "description": "The name of the cookie. Empty by default if omitted."},
- "value": {"type": "string", "optional": true, "description": "The value of the cookie. Empty by default if omitted."},
- "domain": {"type": "string", "optional": true, "description": "The domain of the cookie. If omitted, the cookie becomes a host-only cookie."},
- "path": {"type": "string", "optional": true, "description": "The path of the cookie. Defaults to the path portion of the url parameter."},
- "secure": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as Secure. Defaults to false."},
- "httpOnly": {"type": "boolean", "optional": true, "description": "Whether the cookie should be marked as HttpOnly. Defaults to false."},
- "expirationDate": {"type": "number", "optional": true, "description": "The expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie."},
- "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store in which to set the cookie. By default, the cookie is set in the current execution context's cookie store."}
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "cookie", "$ref": "Cookie", "optional": true, "description": "Contains details about the cookie that's been set. If setting failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set."
- }
- ]
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Deletes a cookie by name.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "description": "Information to identify the cookie to remove.",
- "properties": {
- "url": {"type": "string", "description": "The URL associated with the cookie. If host permissions for this URL are not specified in the manifest file, the API call will fail."},
- "name": {"type": "string", "description": "The name of the cookie to remove."},
- "storeId": {"type": "string", "optional": true, "description": "The ID of the cookie store to look in for the cookie. If unspecified, the cookie is looked for by default in the current execution context's cookie store."}
- }
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "details",
- "type": "object",
- "description": "Contains details about the cookie that's been removed. If removal failed for any reason, this will be \"null\", and $(ref:runtime.lastError) will be set.",
- "optional": true,
- "properties": {
- "url": {"type": "string", "description": "The URL associated with the cookie that's been removed."},
- "name": {"type": "string", "description": "The name of the cookie that's been removed."},
- "storeId": {"type": "string", "description": "The ID of the cookie store from which the cookie was removed."}
- }
- }
- ]
- }
- ]
- },
- {
- "name": "getAllCookieStores",
- "type": "function",
- "description": "Lists all existing cookie stores.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "cookieStores", "type": "array", "items": {"$ref": "CookieStore"}, "description": "All the existing cookie stores."
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onChanged",
- "type": "function",
- "description": "Fired when a cookie is set or removed. As a special case, note that updating a cookie's properties is implemented as a two step process: the cookie to be updated is first removed entirely, generating a notification with \"cause\" of \"overwrite\" . Afterwards, a new cookie is written with the updated values, generating a second notification with \"cause\" \"explicit\".",
- "parameters": [
- {
- "type": "object",
- "name": "changeInfo",
- "properties": {
- "removed": {"type": "boolean", "description": "True if a cookie was removed."},
- "cookie": {"$ref": "Cookie", "description": "Information about the cookie that was set or removed."},
- "cause": {"$ref": "OnChangedCause", "description": "The underlying reason behind the cookie's change."}
- }
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/downloads.json b/toolkit/components/webextensions/schemas/downloads.json
deleted file mode 100644
index dcd43e4e15..0000000000
--- a/toolkit/components/webextensions/schemas/downloads.json
+++ /dev/null
@@ -1,793 +0,0 @@
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "downloads",
- "downloads.open",
- "downloads.shelf"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "downloads",
- "permissions": ["downloads"],
- "types": [
- {
- "id": "FilenameConflictAction",
- "type": "string",
- "enum": [
- "uniquify",
- "overwrite",
- "prompt"
- ]
- },
- {
- "id": "InterruptReason",
- "type": "string",
- "enum": [
- "FILE_FAILED",
- "FILE_ACCESS_DENIED",
- "FILE_NO_SPACE",
- "FILE_NAME_TOO_LONG",
- "FILE_TOO_LARGE",
- "FILE_VIRUS_INFECTED",
- "FILE_TRANSIENT_ERROR",
- "FILE_BLOCKED",
- "FILE_SECURITY_CHECK_FAILED",
- "FILE_TOO_SHORT",
- "NETWORK_FAILED",
- "NETWORK_TIMEOUT",
- "NETWORK_DISCONNECTED",
- "NETWORK_SERVER_DOWN",
- "NETWORK_INVALID_REQUEST",
- "SERVER_FAILED",
- "SERVER_NO_RANGE",
- "SERVER_BAD_CONTENT",
- "SERVER_UNAUTHORIZED",
- "SERVER_CERT_PROBLEM",
- "SERVER_FORBIDDEN",
- "USER_CANCELED",
- "USER_SHUTDOWN",
- "CRASH"
- ]
- },
- {
- "id": "DangerType",
- "type": "string",
- "enum": [
- "file",
- "url",
- "content",
- "uncommon",
- "host",
- "unwanted",
- "safe",
- "accepted"
- ],
- "description": "<dl><dt>file</dt><dd>The download's filename is suspicious.</dd><dt>url</dt><dd>The download's URL is known to be malicious.</dd><dt>content</dt><dd>The downloaded file is known to be malicious.</dd><dt>uncommon</dt><dd>The download's URL is not commonly downloaded and could be dangerous.</dd><dt>safe</dt><dd>The download presents no known danger to the user's computer.</dd></dl>These string constants will never change, however the set of DangerTypes may change."
- },
- {
- "id": "State",
- "type": "string",
- "enum": [
- "in_progress",
- "interrupted",
- "complete"
- ],
- "description": "<dl><dt>in_progress</dt><dd>The download is currently receiving data from the server.</dd><dt>interrupted</dt><dd>An error broke the connection with the file host.</dd><dt>complete</dt><dd>The download completed successfully.</dd></dl>These string constants will never change, however the set of States may change."
- },
- {
- "id": "DownloadItem",
- "type": "object",
- "properties": {
- "id": {
- "description": "An identifier that is persistent across browser sessions.",
- "type": "integer"
- },
- "url": {
- "description": "Absolute URL.",
- "type": "string"
- },
- "referrer": {
- "type": "string"
- },
- "filename": {
- "description": "Absolute local path.",
- "type": "string"
- },
- "incognito": {
- "description": "False if this download is recorded in the history, true if it is not recorded.",
- "type": "boolean"
- },
- "danger": {
- "$ref": "DangerType",
- "description": "Indication of whether this download is thought to be safe or known to be suspicious."
- },
- "mime": {
- "description": "The file's MIME type.",
- "type": "string"
- },
- "startTime": {
- "description": "Number of milliseconds between the unix epoch and when this download began.",
- "type": "string"
- },
- "endTime": {
- "description": "Number of milliseconds between the unix epoch and when this download ended.",
- "optional": true,
- "type": "string"
- },
- "estimatedEndTime": {
- "type": "string",
- "optional": true
- },
- "state": {
- "$ref": "State",
- "description": "Indicates whether the download is progressing, interrupted, or complete."
- },
- "paused": {
- "description": "True if the download has stopped reading data from the host, but kept the connection open.",
- "type": "boolean"
- },
- "canResume": {
- "type": "boolean"
- },
- "error": {
- "description": "Number indicating why a download was interrupted.",
- "optional": true,
- "$ref": "InterruptReason"
- },
- "bytesReceived": {
- "description": "Number of bytes received so far from the host, without considering file compression.",
- "type": "number"
- },
- "totalBytes": {
- "description": "Number of bytes in the whole file, without considering file compression, or -1 if unknown.",
- "type": "number"
- },
- "fileSize": {
- "description": "Number of bytes in the whole file post-decompression, or -1 if unknown.",
- "type": "number"
- },
- "exists": {
- "type": "boolean"
- },
- "byExtensionId": {
- "type": "string",
- "optional": true
- },
- "byExtensionName": {
- "type": "string",
- "optional": true
- }
- }
- },
- {
- "id": "StringDelta",
- "type": "object",
- "properties": {
- "current": {
- "optional": true,
- "type": "string"
- },
- "previous": {
- "optional": true,
- "type": "string"
- }
- }
- },
- {
- "id": "DoubleDelta",
- "type": "object",
- "properties": {
- "current": {
- "optional": true,
- "type": "number"
- },
- "previous": {
- "optional": true,
- "type": "number"
- }
- }
- },
- {
- "id": "BooleanDelta",
- "type": "object",
- "properties": {
- "current": {
- "optional": true,
- "type": "boolean"
- },
- "previous": {
- "optional": true,
- "type": "boolean"
- }
- }
- },
- {
- "id": "DownloadTime",
- "description": "A time specified as a Date object, a number or string representing milliseconds since the epoch, or an ISO 8601 string",
- "choices": [
- {
- "type": "string",
- "pattern": "^[1-9]\\d*$"
- },
- {
- "$ref": "extensionTypes.Date"
- }
- ]
- },
- {
- "id": "DownloadQuery",
- "description": "Parameters that combine to specify a predicate that can be used to select a set of downloads. Used for example in search() and erase()",
- "type": "object",
- "properties": {
- "query": {
- "description": "This array of search terms limits results to <a href='#type-DownloadItem'>DownloadItems</a> whose <code>filename</code> or <code>url</code> contain all of the search terms that do not begin with a dash '-' and none of the search terms that do begin with a dash.",
- "optional": true,
- "type": "array",
- "items": { "type": "string" }
- },
- "startedBefore": {
- "description": "Limits results to downloads that started before the given ms since the epoch.",
- "optional": true,
- "$ref": "DownloadTime"
- },
- "startedAfter": {
- "description": "Limits results to downloads that started after the given ms since the epoch.",
- "optional": true,
- "$ref": "DownloadTime"
- },
- "endedBefore": {
- "description": "Limits results to downloads that ended before the given ms since the epoch.",
- "optional": true,
- "$ref": "DownloadTime"
- },
- "endedAfter": {
- "description": "Limits results to downloads that ended after the given ms since the epoch.",
- "optional": true,
- "$ref": "DownloadTime"
- },
- "totalBytesGreater": {
- "description": "Limits results to downloads whose totalBytes is greater than the given integer.",
- "optional": true,
- "type": "number"
- },
- "totalBytesLess": {
- "description": "Limits results to downloads whose totalBytes is less than the given integer.",
- "optional": true,
- "type": "number"
- },
- "filenameRegex": {
- "description": "Limits results to <a href='#type-DownloadItem'>DownloadItems</a> whose <code>filename</code> matches the given regular expression.",
- "optional": true,
- "type": "string"
- },
- "urlRegex": {
- "description": "Limits results to <a href='#type-DownloadItem'>DownloadItems</a> whose <code>url</code> matches the given regular expression.",
- "optional": true,
- "type": "string"
- },
- "limit": {
- "description": "Setting this integer limits the number of results. Otherwise, all matching <a href='#type-DownloadItem'>DownloadItems</a> will be returned.",
- "optional": true,
- "type": "integer"
- },
- "orderBy": {
- "description": "Setting elements of this array to <a href='#type-DownloadItem'>DownloadItem</a> properties in order to sort the search results. For example, setting <code>orderBy='startTime'</code> sorts the <a href='#type-DownloadItem'>DownloadItems</a> by their start time in ascending order. To specify descending order, prefix <code>orderBy</code> with a hyphen: '-startTime'.",
- "optional": true,
- "type": "array",
- "items": { "type": "string" }
- },
- "id": {
- "type": "integer",
- "optional": true
- },
- "url": {
- "description": "Absolute URL.",
- "optional": true,
- "type": "string"
- },
- "filename": {
- "description": "Absolute local path.",
- "optional": true,
- "type": "string"
- },
- "danger": {
- "$ref": "DangerType",
- "description": "Indication of whether this download is thought to be safe or known to be suspicious.",
- "optional": true
- },
- "mime": {
- "description": "The file's MIME type.",
- "optional": true,
- "type": "string"
- },
- "startTime": {
- "optional": true,
- "type": "string"
- },
- "endTime": {
- "optional": true,
- "type": "string"
- },
- "state": {
- "$ref": "State",
- "description": "Indicates whether the download is progressing, interrupted, or complete.",
- "optional": true
- },
- "paused": {
- "description": "True if the download has stopped reading data from the host, but kept the connection open.",
- "optional": true,
- "type": "boolean"
- },
- "error": {
- "description": "Why a download was interrupted.",
- "optional": true,
- "$ref": "InterruptReason"
- },
- "bytesReceived": {
- "description": "Number of bytes received so far from the host, without considering file compression.",
- "optional": true,
- "type": "number"
- },
- "totalBytes": {
- "description": "Number of bytes in the whole file, without considering file compression, or -1 if unknown.",
- "optional": true,
- "type": "number"
- },
- "fileSize": {
- "description": "Number of bytes in the whole file post-decompression, or -1 if unknown.",
- "optional": true,
- "type": "number"
- },
- "exists": {
- "type": "boolean",
- "optional": true
- }
- }
- }
- ],
- "functions": [
- {
- "name": "download",
- "type": "function",
- "async": "callback",
- "description": "Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both <code>filename</code> and <code>saveAs</code> are specified, then the Save As dialog will be displayed, pre-populated with the specified <code>filename</code>. If the download started successfully, <code>callback</code> will be called with the new <a href='#type-DownloadItem'>DownloadItem</a>'s <code>downloadId</code>. If there was an error starting the download, then <code>callback</code> will be called with <code>downloadId=undefined</code> and <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. You must not parse it.",
- "parameters": [
- {
- "description": "What to download and how.",
- "name": "options",
- "type": "object",
- "properties": {
- "url": {
- "description": "The URL to download.",
- "type": "string",
- "format": "url"
- },
- "filename": {
- "description": "A file path relative to the Downloads directory to contain the downloaded file.",
- "optional": true,
- "type": "string"
- },
- "conflictAction": {
- "$ref": "FilenameConflictAction",
- "optional": true
- },
- "saveAs": {
- "description": "Use a file-chooser to allow the user to select a filename.",
- "optional": true,
- "type": "boolean"
- },
- "method": {
- "description": "The HTTP method to use if the URL uses the HTTP[S] protocol.",
- "enum": [
- "GET",
- "POST"
- ],
- "optional": true,
- "type": "string"
- },
- "headers": {
- "optional": true,
- "type": "array",
- "description": "Extra HTTP headers to send with the request if the URL uses the HTTP[s] protocol. Each header is represented as a dictionary containing the keys <code>name</code> and either <code>value</code> or <code>binaryValue</code>, restricted to those allowed by XMLHttpRequest.",
- "items": {
- "type": "object",
- "properties": {
- "name": {
- "description": "Name of the HTTP header.",
- "type": "string"
- },
- "value": {
- "description": "Value of the HTTP header.",
- "type": "string"
- }
- }
- }
- },
- "body": {
- "description": "Post body.",
- "optional": true,
- "type": "string"
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "downloadId",
- "type": "integer"
- }
- ]
- }
- ]
- },
- {
- "name": "search",
- "type": "function",
- "async": "callback",
- "description": "Find <a href='#type-DownloadItem'>DownloadItems</a>. Set <code>query</code> to the empty object to get all <a href='#type-DownloadItem'>DownloadItems</a>. To get a specific <a href='#type-DownloadItem'>DownloadItem</a>, set only the <code>id</code> field.",
- "parameters": [
- {
- "name": "query",
- "$ref": "DownloadQuery"
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "items": {
- "$ref": "DownloadItem"
- },
- "name": "results",
- "type": "array"
- }
- ]
- }
- ]
- },
- {
- "name": "pause",
- "type": "function",
- "async": "callback",
- "description": "Pause the download. If the request was successful the download is in a paused state. Otherwise <a href='extension.html#property-lastError'>chrome.extension.lastError</a> contains an error message. The request will fail if the download is not active.",
- "parameters": [
- {
- "description": "The id of the download to pause.",
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "optional": true,
- "parameters": [],
- "type": "function"
- }
- ]
- },
- {
- "name": "resume",
- "type": "function",
- "async": "callback",
- "description": "Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise <a href='extension.html#property-lastError'>chrome.extension.lastError</a> contains an error message. The request will fail if the download is not active.",
- "parameters": [
- {
- "description": "The id of the download to resume.",
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "optional": true,
- "parameters": [],
- "type": "function"
- }
- ]
- },
- {
- "name": "cancel",
- "type": "function",
- "async": "callback",
- "description": "Cancel a download. When <code>callback</code> is run, the download is cancelled, completed, interrupted or doesn't exist anymore.",
- "parameters": [
- {
- "description": "The id of the download to cancel.",
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "optional": true,
- "parameters": [],
- "type": "function"
- }
- ]
- },
- {
- "name": "getFileIcon",
- "type": "function",
- "async": "callback",
- "description": "Retrieve an icon for the specified download. For new downloads, file icons are available after the <a href='#event-onCreated'>onCreated</a> event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, <a href='extension.html#property-lastError'>chrome.extension.lastError</a> will contain an error message.",
- "parameters": [
- {
- "description": "The identifier for the download.",
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "options",
- "optional": true,
- "properties": {
- "size": {
- "description": "The size of the icon. The returned icon will be square with dimensions size * size pixels. The default size for the icon is 32x32 pixels.",
- "optional": true,
- "minimum": 1,
- "maximum": 127,
- "type": "integer"
- }
- },
- "type": "object"
- },
- {
- "name": "callback",
- "parameters": [
- {
- "name": "iconURL",
- "optional": true,
- "type": "string"
- }
- ],
- "type": "function"
- }
- ]
- },
- {
- "name": "open",
- "type": "function",
- "async": "callback",
- "description": "Open the downloaded file.",
- "permissions": ["downloads.open"],
- "parameters": [
- {
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
- }
- ]
- },
- {
- "name": "show",
- "type": "function",
- "description": "Show the downloaded file in its folder in a file manager.",
- "async": "callback",
- "parameters": [
- {
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "success",
- "type": "boolean"
- }
- ]
- }
- ]
- },
- {
- "name": "showDefaultFolder",
- "type": "function",
- "parameters": []
- },
- {
- "name": "erase",
- "type": "function",
- "async": "callback",
- "description": "Erase matching <a href='#type-DownloadItem'>DownloadItems</a> from history",
- "parameters": [
- {
- "name": "query",
- "$ref": "DownloadQuery"
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "items": {
- "type": "integer"
- },
- "name": "erasedIds",
- "type": "array"
- }
- ]
- }
- ]
- },
- {
- "name": "removeFile",
- "async": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [ ]
- }
- ]
- },
- {
- "description": "Prompt the user to either accept or cancel a dangerous download. <code>acceptDanger()</code> does not automatically accept dangerous downloads.",
- "name": "acceptDanger",
- "unsupported": true,
- "parameters": [
- {
- "name": "downloadId",
- "type": "integer"
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [ ]
- }
- ],
- "type": "function"
- },
- {
- "description": "Initiate dragging the file to another application.",
- "name": "drag",
- "unsupported": true,
- "parameters": [
- {
- "name": "downloadId",
- "type": "integer"
- }
- ],
- "type": "function"
- },
- {
- "name": "setShelfEnabled",
- "type": "function",
- "unsupported": true,
- "parameters": [
- {
- "name": "enabled",
- "type": "boolean"
- }
- ]
- }
- ],
- "events": [
- {
- "description": "This event fires with the <a href='#type-DownloadItem'>DownloadItem</a> object when a download begins.",
- "name": "onCreated",
- "parameters": [
- {
- "$ref": "DownloadItem",
- "name": "downloadItem"
- }
- ],
- "type": "function"
- },
- {
- "description": "Fires with the <code>downloadId</code> when a download is erased from history.",
- "name": "onErased",
- "parameters": [
- {
- "name": "downloadId",
- "description": "The <code>id</code> of the <a href='#type-DownloadItem'>DownloadItem</a> that was erased.",
- "type": "integer"
- }
- ],
- "type": "function"
- },
- {
- "name": "onChanged",
- "description": "When any of a <a href='#type-DownloadItem'>DownloadItem</a>'s properties except <code>bytesReceived</code> changes, this event fires with the <code>downloadId</code> and an object containing the properties that changed.",
- "parameters": [
- {
- "name": "downloadDelta",
- "type": "object",
- "properties": {
- "id": {
- "description": "The <code>id</code> of the <a href='#type-DownloadItem'>DownloadItem</a> that changed.",
- "type": "integer"
- },
- "url": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>url</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "filename": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>filename</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "danger": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>danger</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "mime": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>mime</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "startTime": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>startTime</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "endTime": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>endTime</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "state": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>state</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "canResume": {
- "optional": true,
- "$ref": "BooleanDelta"
- },
- "paused": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>paused</code>.",
- "optional": true,
- "$ref": "BooleanDelta"
- },
- "error": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>error</code>.",
- "optional": true,
- "$ref": "StringDelta"
- },
- "totalBytes": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>totalBytes</code>.",
- "optional": true,
- "$ref": "DoubleDelta"
- },
- "fileSize": {
- "description": "Describes a change in a <a href='#type-DownloadItem'>DownloadItem</a>'s <code>fileSize</code>.",
- "optional": true,
- "$ref": "DoubleDelta"
- },
- "exists": {
- "optional": true,
- "$ref": "BooleanDelta"
- }
- }
- }
- ],
- "type": "function"
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/events.json b/toolkit/components/webextensions/schemas/events.json
deleted file mode 100644
index ea3cbb5d29..0000000000
--- a/toolkit/components/webextensions/schemas/events.json
+++ /dev/null
@@ -1,322 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "events",
- "description": "The <code>chrome.events</code> namespace contains common types used by APIs dispatching events to notify you when something interesting happens.",
- "types": [
- {
- "id": "Rule",
- "type": "object",
- "description": "Description of a declarative rule for handling events.",
- "properties": {
- "id": {
- "type": "string",
- "optional": true,
- "description": "Optional identifier that allows referencing this rule."
- },
- "tags": {
- "type": "array",
- "items": {"type": "string"},
- "optional": true,
- "description": "Tags can be used to annotate rules and perform operations on sets of rules."
- },
- "conditions": {
- "type": "array",
- "items": {"type": "any"},
- "description": "List of conditions that can trigger the actions."
- },
- "actions": {
- "type": "array",
- "items": {"type": "any"},
- "description": "List of actions that are triggered if one of the condtions is fulfilled."
- },
- "priority": {
- "type": "integer",
- "optional": true,
- "description": "Optional priority of this rule. Defaults to 100."
- }
- }
- },
- {
- "id": "Event",
- "type": "object",
- "description": "An object which allows the addition and removal of listeners for a Chrome event.",
- "functions": [
- {
- "name": "addListener",
- "type": "function",
- "description": "Registers an event listener <em>callback</em> to an event.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "description": "Called when an event occurs. The parameters of this function depend on the type of event."
- }
- ]
- },
- {
- "name": "removeListener",
- "type": "function",
- "description": "Deregisters an event listener <em>callback</em> from an event.",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "description": "Listener that shall be unregistered."
- }
- ]
- },
- {
- "name": "hasListener",
- "type": "function",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "description": "Listener whose registration status shall be tested."
- }
- ],
- "returns": {
- "type": "boolean",
- "description": "True if <em>callback</em> is registered to the event."
- }
- },
- {
- "name": "hasListeners",
- "type": "function",
- "parameters": [],
- "returns": {
- "type": "boolean",
- "description": "True if any event listeners are registered to the event."
- }
- },
- {
- "name": "addRules",
- "unsupported": true,
- "type": "function",
- "description": "Registers rules to handle events.",
- "parameters": [
- {
- "name": "eventName",
- "type": "string",
- "description": "Name of the event this function affects."
- },
- {
- "name": "webViewInstanceId",
- "type": "integer",
- "description": "If provided, this is an integer that uniquely identfies the <webview> associated with this function call."
- },
- {
- "name": "rules",
- "type": "array",
- "items": {"$ref": "Rule"},
- "description": "Rules to be registered. These do not replace previously registered rules."
- },
- {
- "name": "callback",
- "optional": true,
- "type": "function",
- "parameters": [
- {
- "name": "rules",
- "type": "array",
- "items": {"$ref": "Rule"},
- "description": "Rules that were registered, the optional parameters are filled with values."
- }
- ],
- "description": "Called with registered rules."
- }
- ]
- },
- {
- "name": "getRules",
- "unsupported": true,
- "type": "function",
- "description": "Returns currently registered rules.",
- "parameters": [
- {
- "name": "eventName",
- "type": "string",
- "description": "Name of the event this function affects."
- },
- {
- "name": "webViewInstanceId",
- "type": "integer",
- "description": "If provided, this is an integer that uniquely identfies the <webview> associated with this function call."
- },
- {
- "name": "ruleIdentifiers",
- "optional": true,
- "type": "array",
- "items": {"type": "string"},
- "description": "If an array is passed, only rules with identifiers contained in this array are returned."
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "rules",
- "type": "array",
- "items": {"$ref": "Rule"},
- "description": "Rules that were registered, the optional parameters are filled with values."
- }
- ],
- "description": "Called with registered rules."
- }
- ]
- },
- {
- "name": "removeRules",
- "unsupported": true,
- "type": "function",
- "description": "Unregisters currently registered rules.",
- "parameters": [
- {
- "name": "eventName",
- "type": "string",
- "description": "Name of the event this function affects."
- },
- {
- "name": "webViewInstanceId",
- "type": "integer",
- "description": "If provided, this is an integer that uniquely identfies the <webview> associated with this function call."
- },
- {
- "name": "ruleIdentifiers",
- "optional": true,
- "type": "array",
- "items": {"type": "string"},
- "description": "If an array is passed, only rules with identifiers contained in this array are unregistered."
- },
- {
- "name": "callback",
- "optional": true,
- "type": "function",
- "parameters": [],
- "description": "Called when rules were unregistered."
- }
- ]
- }
- ]
- },
- {
- "id": "UrlFilter",
- "type": "object",
- "description": "Filters URLs for various criteria. See <a href='events#filtered'>event filtering</a>. All criteria are case sensitive.",
- "properties": {
- "hostContains": {
- "type": "string",
- "description": "Matches if the host name of the URL contains a specified string. To test whether a host name component has a prefix 'foo', use hostContains: '.foo'. This matches 'www.foobar.com' and 'foo.com', because an implicit dot is added at the beginning of the host name. Similarly, hostContains can be used to match against component suffix ('foo.') and to exactly match against components ('.foo.'). Suffix- and exact-matching for the last components need to be done separately using hostSuffix, because no implicit dot is added at the end of the host name.",
- "optional": true
- },
- "hostEquals": {
- "type": "string",
- "description": "Matches if the host name of the URL is equal to a specified string.",
- "optional": true
- },
- "hostPrefix": {
- "type": "string",
- "description": "Matches if the host name of the URL starts with a specified string.",
- "optional": true
- },
- "hostSuffix": {
- "type": "string",
- "description": "Matches if the host name of the URL ends with a specified string.",
- "optional": true
- },
- "pathContains": {
- "type": "string",
- "description": "Matches if the path segment of the URL contains a specified string.",
- "optional": true
- },
- "pathEquals": {
- "type": "string",
- "description": "Matches if the path segment of the URL is equal to a specified string.",
- "optional": true
- },
- "pathPrefix": {
- "type": "string",
- "description": "Matches if the path segment of the URL starts with a specified string.",
- "optional": true
- },
- "pathSuffix": {
- "type": "string",
- "description": "Matches if the path segment of the URL ends with a specified string.",
- "optional": true
- },
- "queryContains": {
- "type": "string",
- "description": "Matches if the query segment of the URL contains a specified string.",
- "optional": true
- },
- "queryEquals": {
- "type": "string",
- "description": "Matches if the query segment of the URL is equal to a specified string.",
- "optional": true
- },
- "queryPrefix": {
- "type": "string",
- "description": "Matches if the query segment of the URL starts with a specified string.",
- "optional": true
- },
- "querySuffix": {
- "type": "string",
- "description": "Matches if the query segment of the URL ends with a specified string.",
- "optional": true
- },
- "urlContains": {
- "type": "string",
- "description": "Matches if the URL (without fragment identifier) contains a specified string. Port numbers are stripped from the URL if they match the default port number.",
- "optional": true
- },
- "urlEquals": {
- "type": "string",
- "description": "Matches if the URL (without fragment identifier) is equal to a specified string. Port numbers are stripped from the URL if they match the default port number.",
- "optional": true
- },
- "urlMatches": {
- "type": "string",
- "description": "Matches if the URL (without fragment identifier) matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the <a href=\"https://github.com/google/re2/blob/master/doc/syntax.txt\">RE2 syntax</a>.",
- "optional": true
- },
- "originAndPathMatches": {
- "type": "string",
- "description": "Matches if the URL without query segment and fragment identifier matches a specified regular expression. Port numbers are stripped from the URL if they match the default port number. The regular expressions use the <a href=\"https://github.com/google/re2/blob/master/doc/syntax.txt\">RE2 syntax</a>.",
- "optional": true
- },
- "urlPrefix": {
- "type": "string",
- "description": "Matches if the URL (without fragment identifier) starts with a specified string. Port numbers are stripped from the URL if they match the default port number.",
- "optional": true
- },
- "urlSuffix": {
- "type": "string",
- "description": "Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number.",
- "optional": true
- },
- "schemes": {
- "type": "array",
- "description": "Matches if the scheme of the URL is equal to any of the schemes specified in the array.",
- "optional": true,
- "items": { "type": "string" }
- },
- "ports": {
- "type": "array",
- "description": "Matches if the port of the URL is contained in any of the specified port lists. For example <code>[80, 443, [1000, 1200]]</code> matches all requests on port 80, 443 and in the range 1000-1200.",
- "optional": true,
- "items": {
- "choices": [
- {"type": "integer", "description": "A specific port."},
- {"type": "array", "minItems": 2, "maxItems": 2, "items": {"type": "integer"}, "description": "A pair of integers identiying the start and end (both inclusive) of a port range."}
- ]
- }
- }
- }
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/experiments.json b/toolkit/components/webextensions/schemas/experiments.json
deleted file mode 100644
index c687173a94..0000000000
--- a/toolkit/components/webextensions/schemas/experiments.json
+++ /dev/null
@@ -1,16 +0,0 @@
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [
- {
- "type": "string",
- "pattern": "^experiments(\\.\\w+)+$"
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/extension.json b/toolkit/components/webextensions/schemas/extension.json
deleted file mode 100644
index 5a1b6c9357..0000000000
--- a/toolkit/components/webextensions/schemas/extension.json
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "extension",
- "allowedContexts": ["content"],
- "description": "The <code>browser.extension</code> API has utilities that can be used by any extension page. It includes support for exchanging messages between an extension and its content scripts or between extensions, as described in detail in $(topic:messaging)[Message Passing].",
- "properties": {
- "lastError": {
- "type": "object",
- "optional": true,
- "allowedContexts": ["content"],
- "description": "Set for the lifetime of a callback if an ansychronous extension api has resulted in an error. If no error has occured lastError will be <var>undefined</var>.",
- "properties": {
- "message": { "type": "string", "description": "Description of the error that has taken place." }
- },
- "additionalProperties": {
- "type": "any"
- }
- },
- "inIncognitoContext": {
- "type": "boolean",
- "optional": true,
- "allowedContexts": ["content"],
- "description": "True for content scripts running inside incognito tabs, and for extension pages running inside an incognito process. The latter only applies to extensions with 'split' incognito_behavior."
- }
- },
- "types": [
- {
- "id": "ViewType",
- "type": "string",
- "enum": ["tab", "notification", "popup"],
- "description": "The type of extension view."
- }
- ],
- "functions": [
- {
- "name": "getURL",
- "type": "function",
- "allowedContexts": ["content"],
- "description": "Converts a relative path within an extension install directory to a fully-qualified URL.",
- "parameters": [
- {
- "type": "string",
- "name": "path",
- "description": "A path to a resource within an extension expressed relative to its install directory."
- }
- ],
- "returns": {
- "type": "string",
- "description": "The fully-qualified URL to the resource."
- }
- },
- {
- "name": "getViews",
- "type": "function",
- "description": "Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension.",
- "parameters": [
- {
- "type": "object",
- "name": "fetchProperties",
- "optional": true,
- "properties": {
- "type": {
- "$ref": "ViewType",
- "optional": true,
- "description": "The type of view to get. If omitted, returns all views (including background pages and tabs). Valid values: 'tab', 'notification', 'popup'."
- },
- "windowId": {
- "type": "integer",
- "optional": true,
- "description": "The window to restrict the search to. If omitted, returns all views."
- }
- }
- }
- ],
- "returns": {
- "type": "array",
- "description": "Array of global objects",
- "items": {
- "name": "viewGlobals",
- "type": "object",
- "isInstanceOf": "Window",
- "additionalProperties": { "type": "any" }
- }
- }
- },
- {
- "name": "getBackgroundPage",
- "type": "function",
- "description": "Returns the JavaScript 'window' object for the background page running inside the current extension. Returns null if the extension has no background page.",
- "parameters": [],
- "returns": {
- "type": "object",
- "optional": true,
- "name": "backgroundPageGlobal",
- "isInstanceOf": "Window",
- "additionalProperties": { "type": "any" }
- }
- },
- {
- "name": "isAllowedIncognitoAccess",
- "type": "function",
- "description": "Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "isAllowedAccess",
- "type": "boolean",
- "description": "True if the extension has access to Incognito mode, false otherwise."
- }
- ]
- }
- ]
- },
- {
- "name": "isAllowedFileSchemeAccess",
- "type": "function",
- "description": "Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "isAllowedAccess",
- "type": "boolean",
- "description": "True if the extension can access the 'file://' scheme, false otherwise."
- }
- ]
- }
- ]
- },
- {
- "name": "setUpdateUrlData",
- "unsupported": true,
- "type": "function",
- "description": "Sets the value of the ap CGI parameter used in the extension's update URL. This value is ignored for extensions that are hosted in the browser vendor's store.",
- "parameters": [
- {"type": "string", "name": "data", "maxLength": 1024}
- ]
- }
- ],
- "events": [
- {
- "name": "onRequest",
- "unsupported": true,
- "deprecated": "Please use $(ref:runtime.onMessage).",
- "type": "function",
- "description": "Fired when a request is sent from either an extension process or a content script.",
- "parameters": [
- {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."},
- {"name": "sender", "$ref": "runtime.MessageSender" },
- {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response. If you have more than one <code>onRequest</code> listener in the same document, then only one may send a response." }
- ]
- },
- {
- "name": "onRequestExternal",
- "unsupported": true,
- "deprecated": "Please use $(ref:runtime.onMessageExternal).",
- "type": "function",
- "description": "Fired when a request is sent from another extension.",
- "parameters": [
- {"name": "request", "type": "any", "optional": true, "description": "The request sent by the calling script."},
- {"name": "sender", "$ref": "runtime.MessageSender" },
- {"name": "sendResponse", "type": "function", "description": "Function to call when you have a response. The argument should be any JSON-ifiable object, or undefined if there is no response." }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/extension_types.json b/toolkit/components/webextensions/schemas/extension_types.json
deleted file mode 100644
index 1a88e4e608..0000000000
--- a/toolkit/components/webextensions/schemas/extension_types.json
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "extensionTypes",
- "description": "The <code>browser.extensionTypes</code> API contains type declarations for WebExtensions.",
- "types": [
- {
- "id": "ImageFormat",
- "type": "string",
- "enum": ["jpeg", "png"],
- "description": "The format of an image."
- },
- {
- "id": "ImageDetails",
- "type": "object",
- "description": "Details about the format and quality of an image.",
- "properties": {
- "format": {
- "$ref": "ImageFormat",
- "optional": true,
- "description": "The format of the resulting image. Default is <code>\"jpeg\"</code>."
- },
- "quality": {
- "type": "integer",
- "optional": true,
- "minimum": 0,
- "maximum": 100,
- "description": "When format is <code>\"jpeg\"</code>, controls the quality of the resulting image. This value is ignored for PNG images. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease."
- }
- }
- },
- {
- "id": "RunAt",
- "type": "string",
- "enum": ["document_start", "document_end", "document_idle"],
- "description": "The soonest that the JavaScript or CSS will be injected into the tab."
- },
- {
- "id": "InjectDetails",
- "type": "object",
- "description": "Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.",
- "properties": {
- "code": {"type": "string", "optional": true, "description": "JavaScript or CSS code to inject.<br><br><b>Warning:</b><br>Be careful using the <code>code</code> parameter. Incorrect use of it may open your extension to <a href=\"https://en.wikipedia.org/wiki/Cross-site_scripting\">cross site scripting</a> attacks."},
- "file": {"type": "string", "optional": true, "description": "JavaScript or CSS file to inject."},
- "allFrames": {"type": "boolean", "optional": true, "description": "If allFrames is <code>true</code>, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame."},
- "matchAboutBlank": {"type": "boolean", "optional": true, "description": "If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is <code>false</code>."},
- "frameId": {
- "type": "integer",
- "minimum": 0,
- "optional": true,
- "description": "The ID of the frame to inject the script into. This may not be used in combination with <code>allFrames</code>."
- },
- "runAt": {
- "$ref": "RunAt",
- "optional": true,
- "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
- }
- }
- },
- {
- "id": "Date",
- "choices": [
- {
- "type": "string",
- "format": "date"
- },
- {
- "type": "integer",
- "minimum": 0
- },
- {
- "type": "object",
- "isInstanceOf": "Date",
- "additionalProperties": { "type": "any" }
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/i18n.json b/toolkit/components/webextensions/schemas/i18n.json
deleted file mode 100644
index 12dc45dfc8..0000000000
--- a/toolkit/components/webextensions/schemas/i18n.json
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "WebExtensionManifest",
- "properties": {
- "default_locale": {
- "type": "string",
- "optional": "true"
- }
- }
- }
- ]
- },
- {
- "namespace": "i18n",
- "allowedContexts": ["content"],
- "defaultContexts": ["content"],
- "description": "Use the <code>browser.i18n</code> infrastructure to implement internationalization across your whole app or extension.",
- "types": [
- {
- "id": "LanguageCode",
- "type": "string",
- "description": "An ISO language code such as <code>en</code> or <code>fr</code>. For a complete list of languages supported by this method, see <a href='http://src.chromium.org/viewvc/chrome/trunk/src/third_party/cld/languages/internal/languages.cc'>kLanguageInfoTable</a>. For an unknown language, <code>und</code> will be returned, which means that [percentage] of the text is unknown to CLD"
- }
- ],
- "functions": [
- {
- "name": "getAcceptLanguages",
- "type": "function",
- "description": "Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use $(ref:i18n.getUILanguage).",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {"name": "languages", "type": "array", "items": {"$ref": "LanguageCode"}, "description": "Array of LanguageCode"}
- ]
- }
- ]
- },
- {
- "name": "getMessage",
- "type": "function",
- "description": "Gets the localized string for the specified message. If the message is missing, this method returns an empty string (''). If the format of the <code>getMessage()</code> call is wrong &mdash; for example, <em>messageName</em> is not a string or the <em>substitutions</em> array has more than 9 elements &mdash; this method returns <code>undefined</code>.",
- "parameters": [
- {
- "type": "string",
- "name": "messageName",
- "description": "The name of the message, as specified in the <code>$(topic:i18n-messages)[messages.json]</code> file."
- },
- {
- "type": "any",
- "name": "substitutions",
- "optional": true,
- "description": "Substitution strings, if the message requires any."
- }
- ],
- "returns": {
- "type": "string",
- "description": "Message localized for current locale."
- }
- },
- {
- "name": "getUILanguage",
- "type": "function",
- "description": "Gets the browser UI language of the browser. This is different from $(ref:i18n.getAcceptLanguages) which returns the preferred user languages.",
- "parameters": [],
- "returns": {
- "type": "string",
- "description": "The browser UI language code such as en-US or fr-FR."
- }
- },
- {
- "name": "detectLanguage",
- "type": "function",
- "description": "Detects the language of the provided text using CLD.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "text",
- "description": "User input string to be translated."
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "result",
- "description": "LanguageDetectionResult object that holds detected langugae reliability and array of DetectedLanguage",
- "properties": {
- "isReliable": { "type": "boolean", "description": "CLD detected language reliability" },
- "languages":
- {
- "type": "array",
- "description": "array of detectedLanguage",
- "items":
- {
- "type": "object",
- "description": "DetectedLanguage object that holds detected ISO language code and its percentage in the input string",
- "properties":
- {
- "language":
- {
- "$ref": "LanguageCode"
- },
- "percentage":
- {
- "type": "integer",
- "description": "The percentage of the detected language"
- }
- }
- }
- }
- }
- }
- ]
- }
- ]
- }
- ],
- "events": []
- }
-]
diff --git a/toolkit/components/webextensions/schemas/idle.json b/toolkit/components/webextensions/schemas/idle.json
deleted file mode 100644
index e0b3b951ee..0000000000
--- a/toolkit/components/webextensions/schemas/idle.json
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "idle",
- "description": "Use the <code>browser.idle</code> API to detect when the machine's idle state changes.",
- "permissions": ["idle"],
- "types": [
- {
- "id": "IdleState",
- "type": "string",
- "enum": ["active", "idle"]
- }
- ],
- "functions": [
- {
- "name": "queryState",
- "type": "function",
- "description": "Returns \"idle\" if the user has not generated any input for a specified number of seconds, or \"active\" otherwise.",
- "async": "callback",
- "parameters": [
- {
- "name": "detectionIntervalInSeconds",
- "type": "integer",
- "minimum": 15,
- "description": "The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected."
- },
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "newState",
- "$ref": "IdleState"
- }
- ]
- }
- ]
- },
- {
- "name": "setDetectionInterval",
- "type": "function",
- "description": "Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds.",
- "parameters": [
- {
- "name": "intervalInSeconds",
- "type": "integer",
- "minimum": 15,
- "description": "Threshold, in seconds, used to determine when the system is in an idle state."
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onStateChanged",
- "type": "function",
- "description": "Fired when the system changes to an active or idle state. The event fires with \"idle\" if the the user has not generated any input for a specified number of seconds, and \"active\" when the user generates input on an idle system.",
- "parameters": [
- {
- "name": "newState",
- "$ref": "IdleState"
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/jar.mn b/toolkit/components/webextensions/schemas/jar.mn
deleted file mode 100644
index 0bdf35b0df..0000000000
--- a/toolkit/components/webextensions/schemas/jar.mn
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-toolkit.jar:
-% content extensions %content/extensions/
- content/extensions/schemas/alarms.json
- content/extensions/schemas/cookies.json
- content/extensions/schemas/downloads.json
- content/extensions/schemas/events.json
- content/extensions/schemas/experiments.json
- content/extensions/schemas/extension.json
- content/extensions/schemas/extension_types.json
- content/extensions/schemas/i18n.json
- content/extensions/schemas/idle.json
- content/extensions/schemas/management.json
- content/extensions/schemas/manifest.json
- content/extensions/schemas/native_host_manifest.json
- content/extensions/schemas/notifications.json
- content/extensions/schemas/runtime.json
- content/extensions/schemas/storage.json
- content/extensions/schemas/test.json
- content/extensions/schemas/top_sites.json
- content/extensions/schemas/web_navigation.json
- content/extensions/schemas/web_request.json
diff --git a/toolkit/components/webextensions/schemas/management.json b/toolkit/components/webextensions/schemas/management.json
deleted file mode 100644
index 413ff1d0d9..0000000000
--- a/toolkit/components/webextensions/schemas/management.json
+++ /dev/null
@@ -1,250 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "management"
- ]
- }]
- }
- ]
- },
- {
- "namespace":"management",
- "description": "The <code>browser.management</code> API provides ways to manage the list of extensions that are installed and running.",
- "types": [
- {
- "id": "IconInfo",
- "description": "Information about an icon belonging to an extension.",
- "type": "object",
- "properties": {
- "size": {
- "type": "integer",
- "description": "A number representing the width and height of the icon. Likely values include (but are not limited to) 128, 48, 24, and 16."
- },
- "url": {
- "type": "string",
- "description": "The URL for this icon image. To display a grayscale version of the icon (to indicate that an extension is disabled, for example), append <code>?grayscale=true</code> to the URL."
- }
- }
- },
- {
- "id": "ExtensionDisabledReason",
- "description": "A reason the item is disabled.",
- "type": "string",
- "enum": ["unknown", "permissions_increase"]
- },
- {
- "id": "ExtensionType",
- "description": "The type of this extension. Will always be 'extension'.",
- "type": "string",
- "enum": ["extension"]
- },
- {
- "id": "ExtensionInstallType",
- "description": "How the extension was installed. One of<br><var>development</var>: The extension was loaded unpacked in developer mode,<br><var>normal</var>: The extension was installed normally via an .xpi file,<br><var>sideload</var>: The extension was installed by other software on the machine,<br><var>other</var>: The extension was installed by other means.",
- "type": "string",
- "enum": ["development", "normal", "sideload", "other"]
- },
- {
- "id": "ExtensionInfo",
- "description": "Information about an installed extension.",
- "type": "object",
- "properties": {
- "id": {
- "description": "The extension's unique identifier.",
- "type": "string"
- },
- "name": {
- "description": "The name of this extension.",
- "type": "string"
- },
- "shortName": {
- "description": "A short version of the name of this extension.",
- "type": "string"
- },
- "description": {
- "description": "The description of this extension.",
- "type": "string"
- },
- "version": {
- "description": "The <a href='manifest/version'>version</a> of this extension.",
- "type": "string"
- },
- "versionName": {
- "description": "The <a href='manifest/version#version_name'>version name</a> of this extension if the manifest specified one.",
- "type": "string",
- "optional": true
- },
- "mayDisable": {
- "description": "Whether this extension can be disabled or uninstalled by the user.",
- "type": "boolean"
- },
- "enabled": {
- "description": "Whether it is currently enabled or disabled.",
- "type": "boolean"
- },
- "disabledReason": {
- "description": "A reason the item is disabled.",
- "$ref": "ExtensionDisabledReason",
- "optional": true
- },
- "type": {
- "description": "The type of this extension. Will always return 'extension'.",
- "$ref": "ExtensionType"
- },
- "homepageUrl": {
- "description": "The URL of the homepage of this extension.",
- "type": "string",
- "optional": true
- },
- "updateUrl": {
- "description": "The update URL of this extension.",
- "type": "string",
- "optional": true
- },
- "optionsUrl": {
- "description": "The url for the item's options page, if it has one.",
- "type": "string"
- },
- "icons": {
- "description": "A list of icon information. Note that this just reflects what was declared in the manifest, and the actual image at that url may be larger or smaller than what was declared, so you might consider using explicit width and height attributes on img tags referencing these images. See the <a href='manifest/icons'>manifest documentation on icons</a> for more details.",
- "type": "array",
- "optional": true,
- "items": {
- "$ref": "IconInfo"
- }
- },
- "permissions": {
- "description": "Returns a list of API based permissions.",
- "type": "array",
- "items" : {
- "type": "string"
- }
- },
- "hostPermissions": {
- "description": "Returns a list of host based permissions.",
- "type": "array",
- "items" : {
- "type": "string"
- }
- },
- "installType": {
- "description": "How the extension was installed.",
- "$ref": "ExtensionInstallType"
- }
- }
- }
- ],
- "functions": [
- {
- "name": "getAll",
- "type": "function",
- "permissions": ["management"],
- "unsupported": true,
- "description": "Returns a list of information about installed extensions.",
- "async": "callback",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "type": "array",
- "name": "result",
- "items": {
- "$ref": "ExtensionInfo"
- }
- }
- ]
- }
- ]
- },
- {
- "name": "get",
- "type": "function",
- "permissions": ["management"],
- "unsupported": true,
- "description": "Returns information about the installed extension that has the given ID.",
- "async": "callback",
- "parameters": [
- {
- "name": "id",
- "$ref": "manifest.ExtensionID",
- "description": "The ID from an item of $(ref:management.ExtensionInfo)."
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "ExtensionInfo"
- }
- ]
- }
- ]
- },
- {
- "name": "getSelf",
- "type": "function",
- "description": "Returns information about the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": [
- {
- "name": "result",
- "$ref": "ExtensionInfo"
- }
- ]
- }
- ]
- },
- {
- "name": "uninstallSelf",
- "type": "function",
- "description": "Uninstalls the calling extension. Note: This function can be used without requesting the 'management' permission in the manifest.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "options",
- "optional": true,
- "properties": {
- "showConfirmDialog": {
- "type": "boolean",
- "optional": true,
- "description": "Whether or not a confirm-uninstall dialog should prompt the user. Defaults to false."
- },
- "dialogMessage": {
- "type": "string",
- "optional": true,
- "description": "The message to display to a user when being asked to confirm removal of the extension."
- }
- }
- },
- {
- "name": "callback",
- "type": "function",
- "optional": true,
- "parameters": []
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/manifest.json b/toolkit/components/webextensions/schemas/manifest.json
deleted file mode 100644
index 09e6b56fba..0000000000
--- a/toolkit/components/webextensions/schemas/manifest.json
+++ /dev/null
@@ -1,377 +0,0 @@
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "id": "WebExtensionManifest",
- "type": "object",
- "description": "Represents a WebExtension manifest.json file",
- "properties": {
- "manifest_version": {
- "type": "integer",
- "minimum": 2,
- "maximum": 2
- },
-
- "minimum_chrome_version":{
- "type": "string",
- "optional": true
- },
-
- "applications": {
- "type": "object",
- "optional": true,
- "properties": {
- "gecko": {
- "$ref": "FirefoxSpecificProperties",
- "optional": true
- }
- }
- },
-
- "browser_specific_settings": {
- "type": "object",
- "optional": true,
- "properties": {
- "gecko": {
- "$ref": "FirefoxSpecificProperties",
- "optional": true
- }
- }
- },
-
- "name": {
- "type": "string",
- "optional": false,
- "preprocess": "localize"
- },
-
- "short_name": {
- "type": "string",
- "optional": true,
- "preprocess": "localize"
- },
-
- "description": {
- "type": "string",
- "optional": true,
- "preprocess": "localize"
- },
-
- "author": {
- "type": "string",
- "optional": true,
- "preprocess": "localize",
- "onError": "warn"
- },
-
- "version": {
- "type": "string",
- "optional": false
- },
-
- "homepage_url": {
- "type": "string",
- "format": "url",
- "optional": true,
- "preprocess": "localize"
- },
-
- "icons": {
- "type": "object",
- "optional": true,
- "patternProperties": {
- "^[1-9]\\d*$": { "type": "string" }
- }
- },
-
- "incognito": {
- "type": "string",
- "enum": ["spanning"],
- "optional": true,
- "onError": "warn"
- },
-
- "background": {
- "choices": [
- {
- "type": "object",
- "properties": {
- "page": { "$ref": "ExtensionURL" },
- "persistent": {
- "optional": true,
- "$ref": "PersistentBackgroundProperty"
- }
- },
- "additionalProperties": { "$ref": "UnrecognizedProperty" }
- },
- {
- "type": "object",
- "properties": {
- "scripts": {
- "type": "array",
- "items": { "$ref": "ExtensionURL" }
- },
- "persistent": {
- "optional": true,
- "$ref": "PersistentBackgroundProperty"
- }
- },
- "additionalProperties": { "$ref": "UnrecognizedProperty" }
- }
- ],
- "optional": true
- },
-
- "options_ui": {
- "type": "object",
-
- "optional": true,
-
- "properties": {
- "page": { "$ref": "ExtensionURL" },
- "browser_style": {
- "type": "boolean",
- "optional": true
- },
- "chrome_style": {
- "type": "boolean",
- "optional": true
- },
- "open_in_tab": {
- "type": "boolean",
- "optional": true
- }
- },
-
- "additionalProperties": {
- "type": "any",
- "deprecated": "An unexpected property was found in the WebExtension manifest"
- }
- },
-
- "content_scripts": {
- "type": "array",
- "optional": true,
- "items": { "$ref": "ContentScript" }
- },
-
- "content_security_policy": {
- "type": "string",
- "optional": true,
- "format": "contentSecurityPolicy",
- "onError": "warn"
- },
-
- "permissions": {
- "type": "array",
- "items": {
- "choices": [
- { "$ref": "Permission" },
- {
- "type": "string",
- "deprecated": "Unknown permission ${value}"
- }
- ]
- },
- "optional": true
- },
-
- "web_accessible_resources": {
- "type": "array",
- "items": { "type": "string" },
- "optional": true
- },
-
- "developer": {
- "type": "object",
- "optional": true,
- "properties": {
- "name": {
- "type": "string",
- "optional": true,
- "preprocess": "localize"
- },
- "url": {
- "type": "string",
- "optional": true,
- "preprocess": "localize"
- }
- }
- }
-
- },
-
- "additionalProperties": { "$ref": "UnrecognizedProperty" }
- },
- {
- "id": "Permission",
- "choices": [
- {
- "type": "string",
- "enum": [
- "alarms",
- "clipboardWrite",
- "idle",
- "notifications",
- "storage"
- ]
- },
- { "$ref": "MatchPattern" }
- ]
- },
- {
- "id": "ExtensionURL",
- "type": "string",
- "format": "strictRelativeUrl"
- },
- {
- "id": "ExtensionID",
- "choices": [
- {
- "type": "string",
- "pattern": "(?i)^\\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\}$"
- },
- {
- "type": "string",
- "pattern": "(?i)^[a-z0-9-._]*@[a-z0-9-._]+$"
- }
- ]
- },
- {
- "id": "FirefoxSpecificProperties",
- "type": "object",
- "properties": {
- "id": {
- "$ref": "ExtensionID",
- "optional": true
- },
-
- "update_url": {
- "type": "string",
- "format": "url",
- "optional": true
- },
-
- "strict_min_version": {
- "type": "string",
- "optional": true
- },
-
- "strict_max_version": {
- "type": "string",
- "optional": true
- }
- }
- },
- {
- "id": "MatchPattern",
- "choices": [
- {
- "type": "string",
- "enum": ["<all_urls>"]
- },
- {
- "type": "string",
- "pattern": "^(https?|file|ftp|\\*)://(\\*|\\*\\.[^*/]+|[^*/]+)/.*$"
- },
- {
- "type": "string",
- "pattern": "^file:///.*$"
- }
- ]
- },
- {
- "id": "ContentScript",
- "type": "object",
- "description": "Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time. Based on InjectDetails, but using underscore rather than camel case naming conventions.",
- "additionalProperties": { "$ref": "UnrecognizedProperty" },
- "properties": {
- "matches": {
- "type": "array",
- "optional": false,
- "minItems": 1,
- "items": { "$ref": "MatchPattern" }
- },
- "exclude_matches": {
- "type": "array",
- "optional": true,
- "minItems": 1,
- "items": { "$ref": "MatchPattern" }
- },
- "include_globs": {
- "type": "array",
- "optional": true,
- "items": { "type": "string" }
- },
- "exclude_globs": {
- "type": "array",
- "optional": true,
- "items": { "type": "string" }
- },
- "css": {
- "type": "array",
- "optional": true,
- "description": "The list of CSS files to inject",
- "items": { "$ref": "ExtensionURL" }
- },
- "js": {
- "type": "array",
- "optional": true,
- "description": "The list of CSS files to inject",
- "items": { "$ref": "ExtensionURL" }
- },
- "all_frames": {"type": "boolean", "optional": true, "description": "If allFrames is <code>true</code>, implies that the JavaScript or CSS should be injected into all frames of current page. By default, it's <code>false</code> and is only injected into the top frame."},
- "match_about_blank": {"type": "boolean", "optional": true, "description": "If matchAboutBlank is true, then the code is also injected in about:blank and about:srcdoc frames if your extension has access to its parent document. Code cannot be inserted in top-level about:-frames. By default it is <code>false</code>."},
- "run_at": {
- "$ref": "extensionTypes.RunAt",
- "optional": true,
- "description": "The soonest that the JavaScript or CSS will be injected into the tab. Defaults to \"document_idle\"."
- }
- }
- },
- {
- "id": "IconPath",
- "choices": [
- {
- "type": "object",
- "patternProperties": {
- "^[1-9]\\d*$": { "$ref": "ExtensionURL" }
- },
- "additionalProperties": false
- },
- { "$ref": "ExtensionURL" }
- ]
- },
- {
- "id": "IconImageData",
- "choices": [
- {
- "type": "object",
- "patternProperties": {
- "^[1-9]\\d*$": { "$ref": "ImageData" }
- },
- "additionalProperties": false
- },
- { "$ref": "ImageData" }
- ]
- },
- {
- "id": "ImageData",
- "type": "object",
- "isInstanceOf": "ImageData",
- "postprocess": "convertImageDataToURL"
- },
- {
- "id": "UnrecognizedProperty",
- "type": "any",
- "deprecated": "An unexpected property was found in the WebExtension manifest."
- },
- {
- "id": "PersistentBackgroundProperty",
- "type": "boolean",
- "deprecated": "Event pages are not currently supported. This will run as a persistent background page."
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/moz.build b/toolkit/components/webextensions/schemas/moz.build
deleted file mode 100644
index aac3a838c4..0000000000
--- a/toolkit/components/webextensions/schemas/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-JAR_MANIFESTS += ['jar.mn']
diff --git a/toolkit/components/webextensions/schemas/native_host_manifest.json b/toolkit/components/webextensions/schemas/native_host_manifest.json
deleted file mode 100644
index 4ad2ea7f16..0000000000
--- a/toolkit/components/webextensions/schemas/native_host_manifest.json
+++ /dev/null
@@ -1,37 +0,0 @@
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "id": "NativeHostManifest",
- "type": "object",
- "description": "Represents a native host manifest file",
- "properties": {
- "name": {
- "type": "string",
- "pattern": "^\\w+(\\.\\w+)*$"
- },
- "description": {
- "type": "string"
- },
- "path": {
- "type": "string"
- },
- "type": {
- "type": "string",
- "enum": [
- "stdio"
- ]
- },
- "allowed_extensions": {
- "type": "array",
- "minItems": 1,
- "items": {
- "$ref": "manifest.ExtensionID"
- }
- }
- }
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/notifications.json b/toolkit/components/webextensions/schemas/notifications.json
deleted file mode 100644
index 12878e8c8e..0000000000
--- a/toolkit/components/webextensions/schemas/notifications.json
+++ /dev/null
@@ -1,416 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "notifications",
- "permissions": ["notifications"],
- "types": [
- {
- "id": "TemplateType",
- "type": "string",
- "enum": [
- "basic",
- "image",
- "list",
- "progress"
- ]
- },
- {
- "id": "PermissionLevel",
- "type": "string",
- "enum": [
- "granted",
- "denied"
- ]
- },
- {
- "id": "NotificationItem",
- "type": "object",
- "properties": {
- "title": {
- "description": "Title of one item of a list notification.",
- "type": "string"
- },
- "message": {
- "description": "Additional details about this item.",
- "type": "string"
- }
- }
- },
- {
- "id": "CreateNotificationOptions",
- "type": "object",
- "properties": {
- "type": {
- "description": "Which type of notification to display.",
- "$ref": "TemplateType"
- },
- "iconUrl": {
- "optional": true,
- "description": "A URL to the sender's avatar, app icon, or a thumbnail for image notifications.",
- "type": "string"
- },
- "appIconMaskUrl": {
- "optional": true,
- "description": "A URL to the app icon mask.",
- "type": "string"
- },
- "title": {
- "description": "Title of the notification (e.g. sender name for email).",
- "type": "string"
- },
- "message": {
- "description": "Main notification content.",
- "type": "string"
- },
- "contextMessage": {
- "optional": true,
- "description": "Alternate notification content with a lower-weight font.",
- "type": "string"
- },
- "priority": {
- "optional": true,
- "description": "Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default.",
- "type": "integer",
- "minimum": -2,
- "maximum": 2
- },
- "eventTime": {
- "optional": true,
- "description": "A timestamp associated with the notification, in milliseconds past the epoch.",
- "type": "number"
- },
- "buttons": {
- "unsupported": true,
- "optional": true,
- "description": "Text and icons for up to two notification action buttons.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "title": {
- "type": "string"
- },
- "iconUrl": {
- "optional": true,
- "type": "string"
- }
- }
- }
- },
- "imageUrl": {
- "optional": true,
- "description": "A URL to the image thumbnail for image-type notifications.",
- "type": "string"
- },
- "items": {
- "optional": true,
- "description": "Items for multi-item notifications.",
- "type": "array",
- "items": { "$ref": "NotificationItem" }
- },
- "progress": {
- "optional": true,
- "description": "Current progress ranges from 0 to 100.",
- "type": "integer",
- "minimum": 0,
- "maximum": 100
- },
- "isClickable": {
- "optional": true,
- "description": "Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.",
- "type": "boolean"
- }
- }
- },
- {
- "id": "UpdateNotificationOptions",
- "type": "object",
- "properties": {
- "type": {
- "optional": true,
- "description": "Which type of notification to display.",
- "$ref": "TemplateType"
- },
- "iconUrl": {
- "optional": true,
- "description": "A URL to the sender's avatar, app icon, or a thumbnail for image notifications.",
- "type": "string"
- },
- "appIconMaskUrl": {
- "optional": true,
- "description": "A URL to the app icon mask.",
- "type": "string"
- },
- "title": {
- "optional": true,
- "description": "Title of the notification (e.g. sender name for email).",
- "type": "string"
- },
- "message": {
- "optional": true,
- "description": "Main notification content.",
- "type": "string"
- },
- "contextMessage": {
- "optional": true,
- "description": "Alternate notification content with a lower-weight font.",
- "type": "string"
- },
- "priority": {
- "optional": true,
- "description": "Priority ranges from -2 to 2. -2 is lowest priority. 2 is highest. Zero is default.",
- "type": "integer",
- "minimum": -2,
- "maximum": 2
- },
- "eventTime": {
- "optional": true,
- "description": "A timestamp associated with the notification, in milliseconds past the epoch.",
- "type": "number"
- },
- "buttons": {
- "unsupported": true,
- "optional": true,
- "description": "Text and icons for up to two notification action buttons.",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "title": {
- "type": "string"
- },
- "iconUrl": {
- "optional": true,
- "type": "string"
- }
- }
- }
- },
- "imageUrl": {
- "optional": true,
- "description": "A URL to the image thumbnail for image-type notifications.",
- "type": "string"
- },
- "items": {
- "optional": true,
- "description": "Items for multi-item notifications.",
- "type": "array",
- "items": { "$ref": "NotificationItem" }
- },
- "progress": {
- "optional": true,
- "description": "Current progress ranges from 0 to 100.",
- "type": "integer",
- "minimum": 0,
- "maximum": 100
- },
- "isClickable": {
- "optional": true,
- "description": "Whether to show UI indicating that the app will visibly respond to clicks on the body of a notification.",
- "type": "boolean"
- }
- }
- }
- ],
- "functions": [
- {
- "name": "create",
- "type": "function",
- "description": "Creates and displays a notification.",
- "async": "callback",
- "parameters": [
- {
- "optional": true,
- "type": "string",
- "name": "notificationId",
- "description": "Identifier of the notification. If it is empty, this method generates an id. If it matches an existing notification, this method first clears that notification before proceeding with the create operation."
- },
- {
- "$ref": "CreateNotificationOptions",
- "name": "options",
- "description": "Contents of the notification."
- },
- {
- "optional": true,
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "notificationId",
- "type": "string",
- "description": "The notification id (either supplied or generated) that represents the created notification."
- }
- ]
- }
- ]
- },
- {
- "name": "update",
- "unsupported": true,
- "type": "function",
- "description": "Updates an existing notification.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "notificationId",
- "description": "The id of the notification to be updated."
- },
- {
- "$ref": "UpdateNotificationOptions",
- "name": "options",
- "description": "Contents of the notification to update to."
- },
- {
- "optional": true,
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "wasUpdated",
- "type": "boolean",
- "description": "Indicates whether a matching notification existed."
- }
- ]
- }
- ]
- },
- {
- "name": "clear",
- "type": "function",
- "description": "Clears an existing notification.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "notificationId",
- "description": "The id of the notification to be updated."
- },
- {
- "optional": true,
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "wasCleared",
- "type": "boolean",
- "description": "Indicates whether a matching notification existed."
- }
- ]
- }
- ]
- },
- {
- "name": "getAll",
- "type": "function",
- "description": "Retrieves all the notifications.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "notifications",
- "type": "object",
- "description": "The set of notifications currently in the system."
- }
- ]
- }
- ]
- },
- {
- "name": "getPermissionLevel",
- "unsupported": true,
- "type": "function",
- "description": "Retrieves whether the user has enabled notifications from this app or extension.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "level",
- "$ref": "PermissionLevel",
- "description": "The current permission level."
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onClosed",
- "type": "function",
- "description": "Fired when the notification closed, either by the system or by user action.",
- "parameters": [
- {
- "type": "string",
- "name": "notificationId",
- "description": "The notificationId of the closed notification."
- },
- {
- "type": "boolean",
- "name": "byUser",
- "description": "True if the notification was closed by the user."
- }
- ]
- },
- {
- "name": "onClicked",
- "type": "function",
- "description": "Fired when the user clicked in a non-button area of the notification.",
- "parameters": [
- {
- "type": "string",
- "name": "notificationId",
- "description": "The notificationId of the clicked notification."
- }
- ]
- },
- {
- "name": "onButtonClicked",
- "type": "function",
- "description": "Fired when the user pressed a button in the notification.",
- "parameters": [
- {
- "type": "string",
- "name": "notificationId",
- "description": "The notificationId of the clicked notification."
- },
- {
- "type": "number",
- "name": "buttonIndex",
- "description": "The index of the button clicked by the user."
- }
- ]
- },
- {
- "name": "onPermissionLevelChanged",
- "unsupported": true,
- "type": "function",
- "description": "Fired when the user changes the permission level.",
- "parameters": [
- {
- "$ref": "PermissionLevel",
- "name": "level",
- "description": "The new permission level."
- }
- ]
- },
- {
- "name": "onShowSettings",
- "unsupported": true,
- "type": "function",
- "description": "Fired when the user clicked on a link for the app's notification settings.",
- "parameters": [
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/runtime.json b/toolkit/components/webextensions/schemas/runtime.json
deleted file mode 100644
index 575df7d278..0000000000
--- a/toolkit/components/webextensions/schemas/runtime.json
+++ /dev/null
@@ -1,590 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "nativeMessaging"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "runtime",
- "allowedContexts": ["content"],
- "description": "Use the <code>browser.runtime</code> API to retrieve the background page, return details about the manifest, and listen for and respond to events in the app or extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs.",
- "types": [
- {
- "id": "Port",
- "type": "object",
- "allowedContexts": ["content"],
- "description": "An object which allows two way communication with other pages.",
- "properties": {
- "name": {"type": "string"},
- "disconnect": { "type": "function" },
- "onDisconnect": { "$ref": "events.Event" },
- "onMessage": { "$ref": "events.Event" },
- "postMessage": {"type": "function"},
- "sender": {
- "$ref": "MessageSender",
- "optional": true,
- "description": "This property will <b>only</b> be present on ports passed to onConnect/onConnectExternal listeners."
- }
- },
- "additionalProperties": { "type": "any"}
- },
- {
- "id": "MessageSender",
- "type": "object",
- "allowedContexts": ["content"],
- "description": "An object containing information about the script context that sent a message or request.",
- "properties": {
- "tab": {"$ref": "tabs.Tab", "optional": true, "description": "The $(ref:tabs.Tab) which opened the connection, if any. This property will <strong>only</strong> be present when the connection was opened from a tab (including content scripts), and <strong>only</strong> if the receiver is an extension, not an app."},
- "frameId": {"type": "integer", "optional": true, "description": "The $(topic:frame_ids)[frame] that opened the connection. 0 for top-level frames, positive for child frames. This will only be set when <code>tab</code> is set."},
- "id": {"type": "string", "optional": true, "description": "The ID of the extension or app that opened the connection, if any."},
- "url": {"type": "string", "optional": true, "description": "The URL of the page or frame that opened the connection. If the sender is in an iframe, it will be iframe's URL not the URL of the page which hosts it."},
- "tlsChannelId": {"unsupported": true, "type": "string", "optional": true, "description": "The TLS channel ID of the page or frame that opened the connection, if requested by the extension or app, and if available."}
- }
- },
- {
- "id": "PlatformOs",
- "type": "string",
- "allowedContexts": ["content"],
- "description": "The operating system the browser is running on.",
- "enum": ["mac", "win", "android", "cros", "linux", "openbsd"]
- },
- {
- "id": "PlatformArch",
- "type": "string",
- "enum": ["arm", "x86-32", "x86-64"],
- "allowedContexts": ["content"],
- "description": "The machine's processor architecture."
- },
- {
- "id": "PlatformInfo",
- "type": "object",
- "allowedContexts": ["content"],
- "description": "An object containing information about the current platform.",
- "properties": {
- "os": {
- "$ref": "PlatformOs",
- "description": "The operating system the browser is running on."
- },
- "arch": {
- "$ref": "PlatformArch",
- "description": "The machine's processor architecture."
- },
- "nacl_arch" : {
- "unsupported": true,
- "description": "The native client architecture. This may be different from arch on some platforms.",
- "$ref": "PlatformNaclArch"
- }
- }
- },
- {
- "id": "BrowserInfo",
- "type": "object",
- "description": "An object containing information about the current browser.",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the browser, for example 'Firefox'."
- },
- "vendor": {
- "type": "string",
- "description": "The name of the browser vendor, for example 'Mozilla'."
- },
- "version": {
- "type": "string",
- "description": "The browser's version, for example '42.0.0' or '0.8.1pre'."
- },
- "buildID": {
- "type": "string",
- "description": "The browser's build ID/date, for example '20160101'."
- }
- }
- },
- {
- "id": "RequestUpdateCheckStatus",
- "type": "string",
- "enum": ["throttled", "no_update", "update_available"],
- "allowedContexts": ["content"],
- "description": "Result of the update check."
- },
- {
- "id": "OnInstalledReason",
- "type": "string",
- "enum": ["install", "update", "browser_update"],
- "allowedContexts": ["content"],
- "description": "The reason that this event is being dispatched."
- },
- {
- "id": "OnRestartRequiredReason",
- "type": "string",
- "allowedContexts": ["content"],
- "description": "The reason that the event is being dispatched. 'app_update' is used when the restart is needed because the application is updated to a newer version. 'os_update' is used when the restart is needed because the browser/OS is updated to a newer version. 'periodic' is used when the system runs for more than the permitted uptime set in the enterprise policy.",
- "enum": ["app_update", "os_update", "periodic"]
- }
- ],
- "properties": {
- "lastError": {
- "type": "object",
- "optional": true,
- "allowedContexts": ["content"],
- "description": "This will be defined during an API method callback if there was an error",
- "properties": {
- "message": {
- "optional": true,
- "type": "string",
- "description": "Details about the error which occurred."
- }
- },
- "additionalProperties": {
- "type": "any"
- }
- },
- "id": {
- "type": "string",
- "allowedContexts": ["content"],
- "description": "The ID of the extension/app."
- }
- },
- "functions": [
- {
- "name": "getBackgroundPage",
- "type": "function",
- "description": "Retrieves the JavaScript 'window' object for the background page running inside the current extension/app. If the background page is an event page, the system will ensure it is loaded before calling the callback. If there is no background page, an error is set.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "backgroundPage",
- "optional": true,
- "type": "object",
- "isInstanceOf": "Window",
- "additionalProperties": { "type": "any" },
- "description": "The JavaScript 'window' object for the background page."
- }
- ]
- }
- ]
- },
- {
- "name": "openOptionsPage",
- "type": "function",
- "description": "<p>Open your Extension's options page, if possible.</p><p>The precise behavior may depend on your manifest's <code>$(topic:optionsV2)[options_ui]</code> or <code>$(topic:options)[options_page]</code> key, or what the browser happens to support at the time.</p><p>If your Extension does not declare an options page, or the browser failed to create one for some other reason, the callback will set $(ref:lastError).</p>",
- "async": "callback",
- "parameters": [{
- "type": "function",
- "name": "callback",
- "parameters": [],
- "optional": true
- }]
- },
- {
- "name": "getManifest",
- "allowedContexts": ["content"],
- "description": "Returns details about the app or extension from the manifest. The object returned is a serialization of the full $(topic:manifest)[manifest file].",
- "type": "function",
- "parameters": [],
- "returns": {
- "type": "object",
- "properties": {},
- "additionalProperties": { "type": "any" },
- "description": "The manifest details."
- }
- },
- {
- "name": "getURL",
- "type": "function",
- "allowedContexts": ["content"],
- "description": "Converts a relative path within an app/extension install directory to a fully-qualified URL.",
- "parameters": [
- {
- "type": "string",
- "name": "path",
- "description": "A path to a resource within an app/extension expressed relative to its install directory."
- }
- ],
- "returns": {
- "type": "string",
- "description": "The fully-qualified URL to the resource."
- }
- },
- {
- "name": "setUninstallURL",
- "type": "function",
- "description": "Sets the URL to be visited upon uninstallation. This may be used to clean up server-side data, do analytics, and implement surveys. Maximum 255 characters.",
- "async": "callback",
- "parameters": [
- {
- "type": "string",
- "name": "url",
- "maxLength": 255,
- "description": "URL to be opened after the extension is uninstalled. This URL must have an http: or https: scheme. Set an empty string to not open a new tab upon uninstallation."
- },
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "description": "Called when the uninstall URL is set. If the given URL is invalid, $(ref:runtime.lastError) will be set.",
- "parameters": []
- }
- ]
- },
- {
- "name": "reload",
- "description": "Reloads the app or extension.",
- "type": "function",
- "parameters": []
- },
- {
- "name": "requestUpdateCheck",
- "unsupported": true,
- "type": "function",
- "description": "Requests an update check for this app/extension.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "status",
- "$ref": "RequestUpdateCheckStatus",
- "description": "Result of the update check."
- },
- {
- "name": "details",
- "type": "object",
- "optional": true,
- "properties": {
- "version": {
- "type": "string",
- "description": "The version of the available update."
- }
- },
- "description": "If an update is available, this contains more information about the available update."
- }
- ]
- }
- ]
- },
- {
- "name": "restart",
- "unsupported": true,
- "description": "Restart the device when the app runs in kiosk mode. Otherwise, it's no-op.",
- "type": "function",
- "parameters": []
- },
- {
- "name": "connect",
- "type": "function",
- "allowedContexts": ["content"],
- "description": "Attempts to connect to connect listeners within an extension/app (such as the background page), or other extensions/apps. This is useful for content scripts connecting to their extension processes, inter-app/extension communication, and $(topic:manifest/externally_connectable)[web messaging]. Note that this does not connect to any listeners in a content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect).",
- "parameters": [
- {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension or app to connect to. If omitted, a connection will be attempted with your own extension. Required if sending messages from a web page for $(topic:manifest/externally_connectable)[web messaging]."},
- {
- "type": "object",
- "name": "connectInfo",
- "properties": {
- "name": { "type": "string", "optional": true, "description": "Will be passed into onConnect for processes that are listening for the connection event." },
- "includeTlsChannelId": { "type": "boolean", "optional": true, "description": "Whether the TLS channel ID will be passed into onConnectExternal for processes that are listening for the connection event." }
- },
- "optional": true
- }
- ],
- "returns": {
- "$ref": "Port",
- "description": "Port through which messages can be sent and received. The port's $(ref:runtime.Port onDisconnect) event is fired if the extension/app does not exist. "
- }
- },
- {
- "name": "connectNative",
- "type": "function",
- "description": "Connects to a native application in the host machine.",
- "permissions": ["nativeMessaging"],
- "parameters": [
- {
- "type": "string",
- "name": "application",
- "description": "The name of the registered application to connect to."
- }
- ],
- "returns": {
- "$ref": "Port",
- "description": "Port through which messages can be sent and received with the application"
- }
- },
- {
- "name": "sendMessage",
- "type": "function",
- "allowAmbiguousOptionalArguments": true,
- "allowedContexts": ["content"],
- "description": "Sends a single message to event listeners within your extension/app or a different extension/app. Similar to $(ref:runtime.connect) but only sends a single message, with an optional response. If sending to your extension, the $(ref:runtime.onMessage) event will be fired in each page, or $(ref:runtime.onMessageExternal), if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use $(ref:tabs.sendMessage).",
- "async": "responseCallback",
- "parameters": [
- {"type": "string", "name": "extensionId", "optional": true, "description": "The ID of the extension/app to send the message to. If omitted, the message will be sent to your own extension/app. Required if sending messages from a web page for $(topic:manifest/externally_connectable)[web messaging]."},
- { "type": "any", "name": "message" },
- {
- "type": "object",
- "name": "options",
- "properties": {
- "includeTlsChannelId": { "type": "boolean", "optional": true, "description": "Whether the TLS channel ID will be passed into onMessageExternal for processes that are listening for the connection event." }
- },
- "optional": true
- },
- {
- "type": "function",
- "name": "responseCallback",
- "optional": true,
- "parameters": [
- {
- "name": "response",
- "type": "any",
- "description": "The JSON response object sent by the handler of the message. If an error occurs while connecting to the extension, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
- }
- ]
- }
- ]
- },
- {
- "name": "sendNativeMessage",
- "type": "function",
- "description": "Send a single message to a native application.",
- "permissions": ["nativeMessaging"],
- "async": "responseCallback",
- "parameters": [
- {
- "name": "application",
- "description": "The name of the native messaging host.",
- "type": "string"
- },
- {
- "name": "message",
- "description": "The message that will be passed to the native messaging host.",
- "type": "any"
- },
- {
- "type": "function",
- "name": "responseCallback",
- "optional": true,
- "parameters": [
- {
- "name": "response",
- "type": "any",
- "description": "The response message sent by the native messaging host. If an error occurs while connecting to the native messaging host, the callback will be called with no arguments and $(ref:runtime.lastError) will be set to the error message."
- }
- ]
- }
- ]
- },
- {
- "name": "getBrowserInfo",
- "type": "function",
- "description": "Returns information about the current browser.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "description": "Called with results",
- "parameters": [
- {
- "name": "browserInfo",
- "$ref": "BrowserInfo"
- }
- ]
- }
- ]
- },
- {
- "name": "getPlatformInfo",
- "type": "function",
- "description": "Returns information about the current platform.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "description": "Called with results",
- "parameters": [
- {
- "name": "platformInfo",
- "$ref": "PlatformInfo"
- }
- ]
- }
- ]
- },
- {
- "name": "getPackageDirectoryEntry",
- "unsupported": true,
- "type": "function",
- "description": "Returns a DirectoryEntry for the package directory.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "directoryEntry",
- "type": "object",
- "additionalProperties": { "type": "any" },
- "isInstanceOf": "DirectoryEntry"
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onStartup",
- "type": "function",
- "description": "Fired when a profile that has this extension installed first starts up. This event is not fired for incognito profiles."
- },
- {
- "name": "onInstalled",
- "type": "function",
- "description": "Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "reason": {
- "$ref": "OnInstalledReason",
- "description": "The reason that this event is being dispatched."
- },
- "previousVersion": {
- "type": "string",
- "optional": true,
- "unsupported": true,
- "description": "Indicates the previous version of the extension, which has just been updated. This is present only if 'reason' is 'update'."
- },
- "id": {
- "type": "string",
- "optional": true,
- "unsupported": true,
- "description": "Indicates the ID of the imported shared module extension which updated. This is present only if 'reason' is 'shared_module_update'."
- }
- }
- }
- ]
- },
- {
- "name": "onSuspend",
- "unsupported": true,
- "type": "function",
- "description": "Sent to the event page just before it is unloaded. This gives the extension opportunity to do some clean up. Note that since the page is unloading, any asynchronous operations started while handling this event are not guaranteed to complete. If more activity for the event page occurs before it gets unloaded the onSuspendCanceled event will be sent and the page won't be unloaded. "
- },
- {
- "name": "onSuspendCanceled",
- "unsupported": true,
- "type": "function",
- "description": "Sent after onSuspend to indicate that the app won't be unloaded after all."
- },
- {
- "name": "onUpdateAvailable",
- "type": "function",
- "description": "Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call $(ref:runtime.reload). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call $(ref:runtime.reload) manually in response to this event the update will not get installed until the next time the browser itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if $(ref:runtime.reload) is called in response to this event.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "version": {
- "type": "string",
- "description": "The version number of the available update."
- }
- },
- "additionalProperties": { "type": "any" },
- "description": "The manifest details of the available update."
- }
- ]
- },
- {
- "name": "onBrowserUpdateAvailable",
- "unsupported": true,
- "type": "function",
- "description": "Fired when an update for the browser is available, but isn't installed immediately because a browser restart is required.",
- "deprecated": "Please use $(ref:runtime.onRestartRequired).",
- "parameters": []
- },
- {
- "name": "onConnect",
- "type": "function",
- "allowedContexts": ["content"],
- "description": "Fired when a connection is made from either an extension process or a content script.",
- "parameters": [
- {"$ref": "Port", "name": "port"}
- ]
- },
- {
- "name": "onConnectExternal",
- "type": "function",
- "description": "Fired when a connection is made from another extension.",
- "parameters": [
- {"$ref": "Port", "name": "port"}
- ]
- },
- {
- "name": "onMessage",
- "type": "function",
- "allowedContexts": ["content"],
- "description": "Fired when a message is sent from either an extension process or a content script.",
- "parameters": [
- {"name": "message", "type": "any", "optional": true, "description": "The message sent by the calling script."},
- {"name": "sender", "$ref": "MessageSender" },
- {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one <code>onMessage</code> listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)." }
- ],
- "returns": {
- "type": "boolean",
- "optional": true,
- "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
- }
- },
- {
- "name": "onMessageExternal",
- "type": "function",
- "description": "Fired when a message is sent from another extension/app. Cannot be used in a content script.",
- "parameters": [
- {"name": "message", "type": "any", "optional": true, "description": "The message sent by the calling script."},
- {"name": "sender", "$ref": "MessageSender" },
- {"name": "sendResponse", "type": "function", "description": "Function to call (at most once) when you have a response. The argument should be any JSON-ifiable object. If you have more than one <code>onMessage</code> listener in the same document, then only one may send a response. This function becomes invalid when the event listener returns, unless you return true from the event listener to indicate you wish to send a response asynchronously (this will keep the message channel open to the other end until <code>sendResponse</code> is called)." }
- ],
- "returns": {
- "type": "boolean",
- "optional": true,
- "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
- }
- },
- {
- "name": "onRestartRequired",
- "unsupported": true,
- "type": "function",
- "description": "Fired when an app or the device that it runs on needs to be restarted. The app should close all its windows at its earliest convenient time to let the restart to happen. If the app does nothing, a restart will be enforced after a 24-hour grace period has passed. Currently, this event is only fired for Chrome OS kiosk apps.",
- "parameters": [
- {
- "$ref": "OnRestartRequiredReason",
- "name": "reason",
- "description": "The reason that the event is being dispatched."
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/storage.json b/toolkit/components/webextensions/schemas/storage.json
deleted file mode 100644
index a54a209424..0000000000
--- a/toolkit/components/webextensions/schemas/storage.json
+++ /dev/null
@@ -1,229 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "storage",
- "allowedContexts": ["content"],
- "defaultContexts": ["content"],
- "description": "Use the <code>browser.storage</code> API to store, retrieve, and track changes to user data.",
- "permissions": ["storage"],
- "types": [
- {
- "id": "StorageChange",
- "type": "object",
- "properties": {
- "oldValue": {
- "type": "any",
- "description": "The old value of the item, if there was an old value.",
- "optional": true
- },
- "newValue": {
- "type": "any",
- "description": "The new value of the item, if there is a new value.",
- "optional": true
- }
- }
- },
- {
- "id": "StorageArea",
- "type": "object",
- "functions": [
- {
- "name": "get",
- "type": "function",
- "description": "Gets one or more items from storage.",
- "async": "callback",
- "parameters": [
- {
- "name": "keys",
- "choices": [
- { "type": "string" },
- { "type": "array", "items": { "type": "string" } },
- {
- "type": "object",
- "description": "Storage items to return in the callback, where the values are replaced with those from storage if they exist.",
- "additionalProperties": { "type": "any" }
- }
- ],
- "description": "A single key to get, list of keys to get, or a dictionary specifying default values (see description of the object). An empty list or object will return an empty result object. Pass in <code>null</code> to get the entire contents of storage.",
- "optional": true
- },
- {
- "name": "callback",
- "type": "function",
- "description": "Callback with storage items, or on failure (in which case $(ref:runtime.lastError) will be set).",
- "parameters": [
- {
- "name": "items",
- "type": "object",
- "additionalProperties": { "type": "any" },
- "description": "Object with items in their key-value mappings."
- }
- ]
- }
- ]
- },
- {
- "name": "getBytesInUse",
- "unsupported": true,
- "type": "function",
- "description": "Gets the amount of space (in bytes) being used by one or more items.",
- "async": "callback",
- "parameters": [
- {
- "name": "keys",
- "choices": [
- { "type": "string" },
- { "type": "array", "items": { "type": "string" } }
- ],
- "description": "A single key or list of keys to get the total usage for. An empty list will return 0. Pass in <code>null</code> to get the total usage of all of storage.",
- "optional": true
- },
- {
- "name": "callback",
- "type": "function",
- "description": "Callback with the amount of space being used by storage, or on failure (in which case $(ref:runtime.lastError) will be set).",
- "parameters": [
- {
- "name": "bytesInUse",
- "type": "integer",
- "description": "Amount of space being used in storage, in bytes."
- }
- ]
- }
- ]
- },
- {
- "name": "set",
- "type": "function",
- "description": "Sets multiple items.",
- "async": "callback",
- "parameters": [
- {
- "name": "items",
- "type": "object",
- "additionalProperties": { "type": "any" },
- "description": "<p>An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.</p><p>Primitive values such as numbers will serialize as expected. Values with a <code>typeof</code> <code>\"object\"</code> and <code>\"function\"</code> will typically serialize to <code>{}</code>, with the exception of <code>Array</code> (serializes as expected), <code>Date</code>, and <code>Regex</code> (serialize using their <code>String</code> representation).</p>"
- },
- {
- "name": "callback",
- "type": "function",
- "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
- "parameters": [],
- "optional": true
- }
- ]
- },
- {
- "name": "remove",
- "type": "function",
- "description": "Removes one or more items from storage.",
- "async": "callback",
- "parameters": [
- {
- "name": "keys",
- "choices": [
- {"type": "string"},
- {"type": "array", "items": {"type": "string"}}
- ],
- "description": "A single key or a list of keys for items to remove."
- },
- {
- "name": "callback",
- "type": "function",
- "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
- "parameters": [],
- "optional": true
- }
- ]
- },
- {
- "name": "clear",
- "type": "function",
- "description": "Removes all items from storage.",
- "async": "callback",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "description": "Callback on success, or on failure (in which case $(ref:runtime.lastError) will be set).",
- "parameters": [],
- "optional": true
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onChanged",
- "type": "function",
- "description": "Fired when one or more items change.",
- "parameters": [
- {
- "name": "changes",
- "type": "object",
- "additionalProperties": { "$ref": "StorageChange" },
- "description": "Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item."
- },
- {
- "name": "areaName",
- "type": "string",
- "description": "The name of the storage area (<code>\"sync\"</code>, <code>\"local\"</code> or <code>\"managed\"</code>) the changes are for."
- }
- ]
- }
- ],
- "properties": {
- "sync": {
- "$ref": "StorageArea",
- "description": "Items in the <code>sync</code> storage area are synced by the browser.",
- "properties": {
- "QUOTA_BYTES": {
- "value": 102400,
- "description": "The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError)."
- },
- "QUOTA_BYTES_PER_ITEM": {
- "value": 8192,
- "description": "The maximum size (in bytes) of each individual item in sync storage, as measured by the JSON stringification of its value plus its key length. Updates containing items larger than this limit will fail immediately and set $(ref:runtime.lastError)."
- },
- "MAX_ITEMS": {
- "value": 512,
- "description": "The maximum number of items that can be stored in sync storage. Updates that would cause this limit to be exceeded will fail immediately and set $(ref:runtime.lastError)."
- },
- "MAX_WRITE_OPERATIONS_PER_HOUR": {
- "value": 1800,
- "description": "<p>The maximum number of <code>set</code>, <code>remove</code>, or <code>clear</code> operations that can be performed each hour. This is 1 every 2 seconds, a lower ceiling than the short term higher writes-per-minute limit.</p><p>Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError).</p>"
- },
- "MAX_WRITE_OPERATIONS_PER_MINUTE": {
- "value": 120,
- "description": "<p>The maximum number of <code>set</code>, <code>remove</code>, or <code>clear</code> operations that can be performed each minute. This is 2 per second, providing higher throughput than writes-per-hour over a shorter period of time.</p><p>Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError).</p>"
- },
- "MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE": {
- "value": 1000000,
- "deprecated": "The storage.sync API no longer has a sustained write operation quota.",
- "description": ""
- }
- }
- },
- "local": {
- "$ref": "StorageArea",
- "description": "Items in the <code>local</code> storage area are local to each machine.",
- "properties": {
- "QUOTA_BYTES": {
- "value": 5242880,
- "description": "The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the <code>unlimitedStorage</code> permission. Updates that would cause this limit to be exceeded fail immediately and set $(ref:runtime.lastError)."
- }
- }
- },
- "managed": {
- "unsupported": true,
- "$ref": "StorageArea",
- "description": "Items in the <code>managed</code> storage area are set by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error."
- }
- }
- }
-]
diff --git a/toolkit/components/webextensions/schemas/test.json b/toolkit/components/webextensions/schemas/test.json
deleted file mode 100644
index 25a62a96bd..0000000000
--- a/toolkit/components/webextensions/schemas/test.json
+++ /dev/null
@@ -1,215 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "test",
- "allowedContexts": ["content"],
- "defaultContexts": ["content"],
- "description": "none",
- "functions": [
- {
- "name": "notifyFail",
- "type": "function",
- "description": "Notifies the browser process that test code running in the extension failed. This is only used for internal unit testing.",
- "parameters": [
- {"type": "string", "name": "message"}
- ]
- },
- {
- "name": "notifyPass",
- "type": "function",
- "description": "Notifies the browser process that test code running in the extension passed. This is only used for internal unit testing.",
- "parameters": [
- {"type": "string", "name": "message", "optional": true}
- ]
- },
- {
- "name": "log",
- "type": "function",
- "description": "Logs a message during internal unit testing.",
- "parameters": [
- {"type": "string", "name": "message"}
- ]
- },
- {
- "name": "sendMessage",
- "type": "function",
- "description": "Sends a string message to the browser process, generating a Notification that C++ test code can wait for.",
- "allowAmbiguousOptionalArguments": true,
- "parameters": [
- {"type": "any", "name": "arg1", "optional": true},
- {"type": "any", "name": "arg2", "optional": true}
- ]
- },
- {
- "name": "fail",
- "type": "function",
- "parameters": [
- {"type": "any", "name": "message", "optional": true}
- ]
- },
- {
- "name": "succeed",
- "type": "function",
- "parameters": [
- {"type": "any", "name": "message", "optional": true}
- ]
- },
- {
- "name": "assertTrue",
- "type": "function",
- "allowAmbiguousOptionalArguments": true,
- "parameters": [
- {"name": "test", "type": "any", "optional": true},
- {"type": "string", "name": "message", "optional": true}
- ]
- },
- {
- "name": "assertFalse",
- "type": "function",
- "allowAmbiguousOptionalArguments": true,
- "parameters": [
- {"name": "test", "type": "any", "optional": true},
- {"type": "string", "name": "message", "optional": true}
- ]
- },
- {
- "name": "assertBool",
- "type": "function",
- "unsupported": true,
- "parameters": [
- {
- "name": "test",
- "choices": [
- {"type": "string"},
- {"type": "boolean"}
- ]
- },
- {"type": "boolean", "name": "expected"},
- {"type": "string", "name": "message", "optional": true}
- ]
- },
- {
- "name": "checkDeepEq",
- "type": "function",
- "unsupported": true,
- "allowAmbiguousOptionalArguments": true,
- "parameters": [
- {"type": "any", "name": "expected"},
- {"type": "any", "name": "actual"}
- ]
- },
- {
- "name": "assertEq",
- "type": "function",
- "allowAmbiguousOptionalArguments": true,
- "parameters": [
- {"type": "any", "name": "expected", "optional": true},
- {"type": "any", "name": "actual", "optional": true},
- {"type": "string", "name": "message", "optional": true}
- ]
- },
- {
- "name": "assertNoLastError",
- "type": "function",
- "unsupported": true,
- "parameters": []
- },
- {
- "name": "assertLastError",
- "type": "function",
- "unsupported": true,
- "parameters": [
- {"type": "string", "name": "expectedError"}
- ]
- },
- {
- "name": "assertRejects",
- "type": "function",
- "async": true,
- "parameters": [
- {
- "name": "promise",
- "$ref": "Promise"
- },
- {
- "name": "expectedError",
- "$ref": "ExpectedError",
- "optional": true
- },
- {
- "name": "message",
- "type": "string",
- "optional": true
- }
- ]
- },
- {
- "name": "assertThrows",
- "type": "function",
- "parameters": [
- {
- "name": "func",
- "type": "function"
- },
- {
- "name": "expectedError",
- "$ref": "ExpectedError",
- "optional": true
- },
- {
- "name": "message",
- "type": "string",
- "optional": true
- }
- ]
- }
- ],
- "types": [
- {
- "id": "ExpectedError",
- "choices": [
- {"type": "string"},
- {"type": "object", "isInstanceOf": "RegExp", "additionalProperties": true},
- {"type": "function"}
- ]
- },
- {
- "id": "Promise",
- "choices": [
- {
- "type": "object",
- "properties": {
- "then": {"type": "function"}
- },
- "additionalProperties": true
- },
- {
- "type": "object",
- "isInstanceOf": "Promise",
- "additionalProperties": true
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onMessage",
- "type": "function",
- "description": "Used to test sending messages to extensions.",
- "parameters": [
- {
- "type": "string",
- "name": "message"
- },
- {
- "type": "any",
- "name": "argument"
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/top_sites.json b/toolkit/components/webextensions/schemas/top_sites.json
deleted file mode 100644
index fbfbc4b624..0000000000
--- a/toolkit/components/webextensions/schemas/top_sites.json
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "topSites"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "topSites",
- "description": "Use the chrome.topSites API to access the top sites that are displayed on the new tab page. ",
- "permissions": ["topSites"],
- "types": [
- {
- "id": "MostVisitedURL",
- "type": "object",
- "description": "An object encapsulating a most visited URL, such as the URLs on the new tab page.",
- "properties": {
- "url": {
- "type": "string",
- "description": "The most visited URL."
- },
- "title": {
- "type": "string",
- "optional": true,
- "description": "The title of the page."
- }
- }
- }
- ],
- "functions": [
- {
- "name": "get",
- "type": "function",
- "description": "Gets a list of top sites.",
- "async": "callback",
- "parameters": [
- {
- "name": "callback",
- "type": "function",
- "parameters": [
- {
- "name": "results",
- "type": "array",
- "items": {
- "$ref": "MostVisitedURL"
- }
- }
- ]
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/web_navigation.json b/toolkit/components/webextensions/schemas/web_navigation.json
deleted file mode 100644
index 1e13b181ac..0000000000
--- a/toolkit/components/webextensions/schemas/web_navigation.json
+++ /dev/null
@@ -1,387 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "webNavigation"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "webNavigation",
- "description": "Use the <code>browser.webNavigation</code> API to receive notifications about the status of navigation requests in-flight.",
- "permissions": ["webNavigation"],
- "types": [
- {
- "id": "TransitionType",
- "type": "string",
- "enum": ["link", "typed", "auto_bookmark", "auto_subframe", "manual_subframe", "generated", "start_page", "form_submit", "reload", "keyword", "keyword_generated"],
- "description": "Cause of the navigation. The same transition types as defined in the history API are used. These are the same transition types as defined in the $(topic:transition_types)[history API] except with <code>\"start_page\"</code> in place of <code>\"auto_toplevel\"</code> (for backwards compatibility)."
- },
- {
- "id": "TransitionQualifier",
- "type": "string",
- "enum": ["client_redirect", "server_redirect", "forward_back", "from_address_bar"]
- },
- {
- "id": "EventUrlFilters",
- "type": "object",
- "properties": {
- "url": {
- "type": "array",
- "minItems": 1,
- "items": { "$ref": "events.UrlFilter" }
- }
- }
- }
- ],
- "functions": [
- {
- "name": "getFrame",
- "type": "function",
- "description": "Retrieves information about the given frame. A frame refers to an &lt;iframe&gt; or a &lt;frame&gt; of a web page and is identified by a tab ID and a frame ID.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "description": "Information about the frame to retrieve information about.",
- "properties": {
- "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab in which the frame is." },
- "processId": {"optional": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": { "type": "integer", "minimum": 0, "description": "The ID of the frame in the given tab." }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "optional": true,
- "description": "Information about the requested frame, null if the specified frame ID and/or tab ID are invalid.",
- "properties": {
- "errorOccurred": {
- "unsupported": true,
- "type": "boolean",
- "description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
- },
- "url": {
- "type": "string",
- "description": "The URL currently associated with this frame, if the frame identified by the frameId existed at one point in the given tab. The fact that an URL is associated with a given frameId does not imply that the corresponding frame still exists."
- },
- "parentFrameId": {
- "type": "integer",
- "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
- }
- }
- }
- ]
- }
- ]
- },
- {
- "name": "getAllFrames",
- "type": "function",
- "description": "Retrieves information about all frames of a given tab.",
- "async": "callback",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "description": "Information about the tab to retrieve all frames from.",
- "properties": {
- "tabId": { "type": "integer", "minimum": 0, "description": "The ID of the tab." }
- }
- },
- {
- "type": "function",
- "name": "callback",
- "parameters": [
- {
- "name": "details",
- "type": "array",
- "description": "A list of frames in the given tab, null if the specified tab ID is invalid.",
- "optional": true,
- "items": {
- "type": "object",
- "properties": {
- "errorOccurred": {
- "unsupported": true,
- "type": "boolean",
- "description": "True if the last navigation in this frame was interrupted by an error, i.e. the onErrorOccurred event fired."
- },
- "processId": {
- "unsupported": true,
- "type": "integer",
- "description": "The ID of the process runs the renderer for this tab."
- },
- "frameId": {
- "type": "integer",
- "description": "The ID of the frame. 0 indicates that this is the main frame; a positive value indicates the ID of a subframe."
- },
- "parentFrameId": {
- "type": "integer",
- "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."
- },
- "url": {
- "type": "string",
- "description": "The URL currently associated with this frame."
- }
- }
- }
- }
- ]
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onBeforeNavigate",
- "type": "function",
- "description": "Fired when a navigation is about to occur.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation is about to occur."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique for a given tab and process."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame. Set to -1 of no parent frame exists."},
- "timeStamp": {"type": "number", "description": "The time when the browser was about to start the navigation, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onCommitted",
- "type": "function",
- "description": "Fired when a navigation is committed. The document (and the resources it refers to, such as images and subframes) might still be downloading, but at least part of the document has been received from the server and the browser has decided to switch to the new document.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
- "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
- "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
- "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onDOMContentLoaded",
- "type": "function",
- "description": "Fired when the page's DOM is fully constructed, but the referenced resources may not finish loading.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
- "timeStamp": {"type": "number", "description": "The time when the page's DOM was fully constructed, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onCompleted",
- "type": "function",
- "description": "Fired when a document, including the resources it refers to, is completely loaded and initialized.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
- "timeStamp": {"type": "number", "description": "The time when the document finished loading, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onErrorOccurred",
- "type": "function",
- "description": "Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
- "error": {"unsupported": true, "type": "string", "description": "The error description."},
- "timeStamp": {"type": "number", "description": "The time when the error occurred, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onCreatedNavigationTarget",
- "unsupported": true,
- "type": "function",
- "description": "Fired when a new window, or a new tab in an existing window, is created to host a navigation.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "sourceTabId": {"type": "integer", "description": "The ID of the tab in which the navigation is triggered."},
- "sourceProcessId": {"type": "integer", "description": "The ID of the process runs the renderer for the source tab."},
- "sourceFrameId": {"type": "integer", "description": "The ID of the frame with sourceTabId in which the navigation is triggered. 0 indicates the main frame."},
- "url": {"type": "string", "description": "The URL to be opened in the new window."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the url is opened"},
- "timeStamp": {"type": "number", "description": "The time when the browser was about to create a new view, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onReferenceFragmentUpdated",
- "type": "function",
- "description": "Fired when the reference fragment of a frame was updated. All future events for that frame will use the updated URL.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
- "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
- "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
- "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- },
- {
- "name": "onTabReplaced",
- "type": "function",
- "description": "Fired when the contents of the tab is replaced by a different (usually previously pre-rendered) tab.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "replacedTabId": {"type": "integer", "description": "The ID of the tab that was replaced."},
- "tabId": {"type": "integer", "description": "The ID of the tab that replaced the old tab."},
- "timeStamp": {"type": "number", "description": "The time when the replacement happened, in milliseconds since the epoch."}
- }
- }
- ]
- },
- {
- "name": "onHistoryStateUpdated",
- "type": "function",
- "description": "Fired when the frame's history was updated to a new URL. All future events for that frame will use the updated URL.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "tabId": {"type": "integer", "description": "The ID of the tab in which the navigation occurs."},
- "url": {"type": "string"},
- "processId": {"unsupported": true, "type": "integer", "description": "The ID of the process runs the renderer for this tab."},
- "frameId": {"type": "integer", "description": "0 indicates the navigation happens in the tab content window; a positive value indicates navigation in a subframe. Frame IDs are unique within a tab."},
- "transitionType": {"unsupported": true, "$ref": "TransitionType", "description": "Cause of the navigation."},
- "transitionQualifiers": {"unsupported": true, "type": "array", "description": "A list of transition qualifiers.", "items": {"$ref": "TransitionQualifier"}},
- "timeStamp": {"type": "number", "description": "The time when the navigation was committed, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "name": "filters",
- "optional": true,
- "$ref": "EventUrlFilters",
- "description": "Conditions that the URL being navigated to must satisfy. The 'schemes' and 'ports' fields of UrlFilter are ignored for this event."
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/schemas/web_request.json b/toolkit/components/webextensions/schemas/web_request.json
deleted file mode 100644
index 4035aea6e7..0000000000
--- a/toolkit/components/webextensions/schemas/web_request.json
+++ /dev/null
@@ -1,616 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-[
- {
- "namespace": "manifest",
- "types": [
- {
- "$extend": "Permission",
- "choices": [{
- "type": "string",
- "enum": [
- "webRequest",
- "webRequestBlocking"
- ]
- }]
- }
- ]
- },
- {
- "namespace": "webRequest",
- "description": "Use the <code>browser.webRequest</code> API to observe and analyze traffic and to intercept, block, or modify requests in-flight.",
- "permissions": ["webRequest"],
- "properties": {
- "MAX_HANDLER_BEHAVIOR_CHANGED_CALLS_PER_10_MINUTES": {
- "value": 20,
- "description": "The maximum number of times that <code>handlerBehaviorChanged</code> can be called per 10 minute sustained interval. <code>handlerBehaviorChanged</code> is an expensive function call that shouldn't be called often."
- }
- },
- "types": [
- {
- "id": "ResourceType",
- "type": "string",
- "enum": [
- "main_frame",
- "sub_frame",
- "stylesheet",
- "script",
- "image",
- "object",
- "xmlhttprequest",
- "xbl",
- "xslt",
- "ping",
- "beacon",
- "xml_dtd",
- "font",
- "media",
- "websocket",
- "csp_report",
- "imageset",
- "web_manifest",
- "other"
- ]
- },
- {
- "id": "OnBeforeRequestOptions",
- "type": "string",
- "enum": ["blocking", "requestBody"]
- },
- {
- "id": "OnBeforeSendHeadersOptions",
- "type": "string",
- "enum": ["requestHeaders", "blocking"]
- },
- {
- "id": "OnSendHeadersOptions",
- "type": "string",
- "enum": ["requestHeaders"]
- },
- {
- "id": "OnHeadersReceivedOptions",
- "type": "string",
- "enum": ["blocking", "responseHeaders"]
- },
- {
- "id": "OnAuthRequiredOptions",
- "type": "string",
- "enum": ["responseHeaders", "blocking", "asyncBlocking"]
- },
- {
- "id": "OnResponseStartedOptions",
- "type": "string",
- "enum": ["responseHeaders"]
- },
- {
- "id": "OnBeforeRedirectOptions",
- "type": "string",
- "enum": ["responseHeaders"]
- },
- {
- "id": "OnCompletedOptions",
- "type": "string",
- "enum": ["responseHeaders"]
- },
- {
- "id": "RequestFilter",
- "type": "object",
- "description": "An object describing filters to apply to webRequest events.",
- "properties": {
- "urls": {
- "type": "array",
- "description": "A list of URLs or URL patterns. Requests that cannot match any of the URLs will be filtered out.",
- "items": { "type": "string" }
- },
- "types": {
- "type": "array",
- "optional": true,
- "description": "A list of request types. Requests that cannot match any of the types will be filtered out.",
- "items": { "$ref": "ResourceType" }
- },
- "tabId": { "type": "integer", "optional": true },
- "windowId": { "type": "integer", "optional": true }
- }
- },
- {
- "id": "HttpHeaders",
- "type": "array",
- "description": "An array of HTTP headers. Each header is represented as a dictionary containing the keys <code>name</code> and either <code>value</code> or <code>binaryValue</code>.",
- "items": {
- "type": "object",
- "properties": {
- "name": {"type": "string", "description": "Name of the HTTP header."},
- "value": {"type": "string", "optional": true, "description": "Value of the HTTP header if it can be represented by UTF-8."},
- "binaryValue": {
- "type": "array",
- "optional": true,
- "description": "Value of the HTTP header if it cannot be represented by UTF-8, stored as individual byte values (0..255).",
- "items": {"type": "integer"}
- }
- }
- }
- },
- {
- "id": "BlockingResponse",
- "type": "object",
- "description": "Returns value for event handlers that have the 'blocking' extraInfoSpec applied. Allows the event handler to modify network requests.",
- "properties": {
- "cancel": {
- "type": "boolean",
- "optional": true,
- "description": "If true, the request is cancelled. Used in onBeforeRequest, this prevents the request from being sent."
- },
- "redirectUrl": {
- "type": "string",
- "optional": true,
- "description": "Only used as a response to the onBeforeRequest and onHeadersReceived events. If set, the original request is prevented from being sent/completed and is instead redirected to the given URL. Redirections to non-HTTP schemes such as data: are allowed. Redirects initiated by a redirect action use the original request method for the redirect, with one exception: If the redirect is initiated at the onHeadersReceived stage, then the redirect will be issued using the GET method."
- },
- "requestHeaders": {
- "$ref": "HttpHeaders",
- "optional": true,
- "description": "Only used as a response to the onBeforeSendHeaders event. If set, the request is made with these request headers instead."
- },
- "responseHeaders": {
- "$ref": "HttpHeaders",
- "optional": true,
- "description": "Only used as a response to the onHeadersReceived event. If set, the server is assumed to have responded with these response headers instead. Only return <code>responseHeaders</code> if you really want to modify the headers in order to limit the number of conflicts (only one extension may modify <code>responseHeaders</code> for each request)."
- },
- "authCredentials": {
- "type": "object",
- "description": "Only used as a response to the onAuthRequired event. If set, the request is made using the supplied credentials.",
- "optional": true,
- "properties": {
- "username": {"type": "string"},
- "password": {"type": "string"}
- }
- }
- }
- },
- {
- "id": "UploadData",
- "type": "object",
- "properties": {
- "bytes": {
- "type": "any",
- "optional": true,
- "description": "An ArrayBuffer with a copy of the data."
- },
- "file": {
- "type": "string",
- "optional": true,
- "description": "A string with the file's path and name."
- }
- },
- "description": "Contains data uploaded in a URL request."
- }
- ],
- "functions": [
- {
- "name": "handlerBehaviorChanged",
- "type": "function",
- "description": "Needs to be called when the behavior of the webRequest handlers has changed to prevent incorrect handling due to caching. This function call is expensive. Don't call it often.",
- "async": "callback",
- "parameters": [
- {
- "type": "function",
- "name": "callback",
- "optional": true,
- "parameters": []
- }
- ]
- }
- ],
- "events": [
- {
- "name": "onBeforeRequest",
- "type": "function",
- "description": "Fired when a request is about to occur.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "requestBody": {
- "type": "object",
- "optional": true,
- "description": "Contains the HTTP request body data. Only provided if extraInfoSpec contains 'requestBody'.",
- "properties": {
- "error": {"type": "string", "optional": true, "description": "Errors when obtaining request body data."},
- "formData": {
- "type": "object",
- "optional": true,
- "description": "If the request method is POST and the body is a sequence of key-value pairs encoded in UTF8, encoded as either multipart/form-data, or application/x-www-form-urlencoded, this dictionary is present and for each key contains the list of all values for that key. If the data is of another media type, or if it is malformed, the dictionary is not present. An example value of this dictionary is {'key': ['value1', 'value2']}.",
- "properties": {},
- "additionalProperties": {
- "type": "array",
- "items": { "type": "string" }
- }
- },
- "raw" : {
- "type": "array",
- "optional": true,
- "items": {"$ref": "UploadData"},
- "description": "If the request method is PUT or POST, and the body is not already parsed in formData, then the unparsed request body elements are contained in this array."
- }
- }
- },
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnBeforeRequestOptions"
- }
- }
- ],
- "returns": {
- "$ref": "BlockingResponse",
- "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
- "optional": true
- }
- },
- {
- "name": "onBeforeSendHeaders",
- "type": "function",
- "description": "Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. ",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "requestHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP request headers that are going to be sent out with this request."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnBeforeSendHeadersOptions"
- }
- }
- ],
- "returns": {
- "$ref": "BlockingResponse",
- "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
- "optional": true
- }
- },
- {
- "name": "onSendHeaders",
- "type": "function",
- "description": "Fired just before a request is going to be sent to the server (modifications of previous onBeforeSendHeaders callbacks are visible by the time onSendHeaders is fired).",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "requestHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP request headers that have been sent out with this request."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnSendHeadersOptions"
- }
- }
- ]
- },
- {
- "name": "onHeadersReceived",
- "type": "function",
- "description": "Fired when HTTP response headers of a request have been received.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line)."},
- "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that have been received with this response."},
- "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnHeadersReceivedOptions"
- }
- }
- ],
- "returns": {
- "$ref": "BlockingResponse",
- "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
- "optional": true
- }
- },
- {
- "name": "onAuthRequired",
- "unsupported": true,
- "type": "function",
- "description": "Fired when an authentication failure is received. The listener has three options: it can provide authentication credentials, it can cancel the request and display the error page, or it can take no action on the challenge. If bad user credentials are provided, this may be called multiple times for the same request.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "scheme": {"type": "string", "description": "The authentication scheme, e.g. Basic or Digest."},
- "realm": {"type": "string", "description": "The authentication realm provided by the server, if there is one.", "optional": true},
- "challenger": {"type": "object", "description": "The server requesting authentication.", "properties": {"host": {"type": "string"}, "port": {"type": "integer"}}},
- "isProxy": {"type": "boolean", "description": "True for Proxy-Authenticate, false for WWW-Authenticate."},
- "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},
- "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."},
- "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."}
- }
- },
- {
- "type": "function",
- "optional": true,
- "name": "callback",
- "parameters": [
- {"name": "response", "$ref": "BlockingResponse"}
- ]
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnAuthRequiredOptions"
- }
- }
- ],
- "returns": {
- "$ref": "BlockingResponse",
- "description": "If \"blocking\" is specified in the \"extraInfoSpec\" parameter, the event listener should return an object of this type.",
- "optional": true
- }
- },
- {
- "name": "onResponseStarted",
- "type": "function",
- "description": "Fired when the first byte of the response body is received. For HTTP requests, this means that the status line and response headers are available.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
- "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
- "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
- "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},
- "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnResponseStartedOptions"
- }
- }
- ]
- },
- {
- "name": "onBeforeRedirect",
- "type": "function",
- "description": "Fired when a server-initiated redirect is about to occur.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
- "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
- "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
- "redirectUrl": {"type": "string", "description": "The new URL."},
- "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this redirect."},
- "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnBeforeRedirectOptions"
- }
- }
- ]
- },
- {
- "name": "onCompleted",
- "type": "function",
- "description": "Fired when a request is completed.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
- "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
- "statusCode": {"type": "integer", "description": "Standard HTTP status code returned by the server."},
- "responseHeaders": {"$ref": "HttpHeaders", "optional": true, "description": "The HTTP response headers that were received along with this response."},
- "statusLine": {"type": "string", "description": "HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- },
- {
- "type": "array",
- "optional": true,
- "name": "extraInfoSpec",
- "description": "Array of extra information that should be passed to the listener function.",
- "items": {
- "$ref": "OnCompletedOptions"
- }
- }
- ]
- },
- {
- "name": "onErrorOccurred",
- "type": "function",
- "description": "Fired when an error occurs.",
- "parameters": [
- {
- "type": "object",
- "name": "details",
- "properties": {
- "requestId": {"type": "string", "description": "The ID of the request. Request IDs are unique within a browser session. As a result, they could be used to relate different events of the same request."},
- "url": {"type": "string"},
- "method": {"type": "string", "description": "Standard HTTP method."},
- "frameId": {"type": "integer", "description": "The value 0 indicates that the request happens in the main frame; a positive value indicates the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (<code>type</code> is <code>main_frame</code> or <code>sub_frame</code>), <code>frameId</code> indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab."},
- "parentFrameId": {"type": "integer", "description": "ID of frame that wraps the frame which sent the request. Set to -1 if no parent frame exists."},
- "tabId": {"type": "integer", "description": "The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab."},
- "type": {"$ref": "ResourceType", "description": "How the requested resource will be used."},
- "timeStamp": {"type": "number", "description": "The time when this signal is triggered, in milliseconds since the epoch."},
- "ip": {"type": "string", "optional": true, "description": "The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address."},
- "fromCache": {"type": "boolean", "description": "Indicates if this response was fetched from disk cache."},
- "error": {"type": "string", "description": "The error description. This string is <em>not</em> guaranteed to remain backwards compatible between releases. You must not parse and act based upon its content."}
- }
- }
- ],
- "extraParameters": [
- {
- "$ref": "RequestFilter",
- "name": "filter",
- "description": "A set of filters that restricts the events that will be sent to this listener."
- }
- ]
- }
- ]
- }
-]
diff --git a/toolkit/components/webextensions/test/mochitest/.eslintrc.js b/toolkit/components/webextensions/test/mochitest/.eslintrc.js
deleted file mode 100644
index 53938410b7..0000000000
--- a/toolkit/components/webextensions/test/mochitest/.eslintrc.js
+++ /dev/null
@@ -1,35 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": "../../../../../testing/mochitest/mochitest.eslintrc.js",
-
- "env": {
- "webextensions": true,
- },
-
- "globals": {
- "ChromeWorker": false,
- "onmessage": true,
- "sendAsyncMessage": false,
-
- "waitForLoad": true,
- "promiseConsoleOutput": true,
-
- "ExtensionTestUtils": false,
- "NetUtil": true,
- "webrequest_test": false,
- "XPCOMUtils": true,
-
- // head_webrequest.js symbols
- "addStylesheet": true,
- "addLink": true,
- "addImage": true,
- "addScript": true,
- "addFrame": true,
- "makeExtension": false,
- },
-
- "rules": {
- "no-shadow": 0,
- },
-};
diff --git a/toolkit/components/webextensions/test/mochitest/chrome.ini b/toolkit/components/webextensions/test/mochitest/chrome.ini
deleted file mode 100644
index 26585cad7a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/chrome.ini
+++ /dev/null
@@ -1,35 +0,0 @@
-[DEFAULT]
-support-files =
- chrome_head.js
- head.js
- head_cookies.js
- file_sample.html
- webrequest_chromeworker.js
- webrequest_test.jsm
-tags = webextensions
-
-[test_chrome_ext_background_debug_global.html]
-skip-if = (os == 'android') # android doesn't have devtools
-[test_chrome_ext_background_page.html]
-skip-if = (toolkit == 'android') # android doesn't have devtools
-[test_chrome_ext_eventpage_warning.html]
-[test_chrome_ext_contentscript_unrecognizedprop_warning.html]
-skip-if = (os == 'android') # browser.tabs is undefined. Bug 1258975 on android.
-[test_chrome_ext_hybrid_addons.html]
-[test_chrome_ext_trustworthy_origin.html]
-[test_chrome_ext_webnavigation_resolved_urls.html]
-skip-if = (os == 'android') # browser.tabs is undefined. Bug 1258975 on android.
-[test_chrome_ext_shutdown_cleanup.html]
-[test_chrome_native_messaging_paths.html]
-skip-if = os != "mac" && os != "linux"
-[test_ext_cookies_expiry.html]
-[test_ext_cookies_permissions_bad.html]
-[test_ext_cookies_permissions_good.html]
-[test_ext_cookies_containers.html]
-[test_ext_jsversion.html]
-[test_ext_schema.html]
-[test_chrome_ext_storage_cleanup.html]
-[test_chrome_ext_idle.html]
-[test_chrome_ext_downloads_saveAs.html]
-[test_chrome_ext_webrequest_background_events.html]
-skip-if = os == 'android' # webrequest api unsupported (bug 1258975).
diff --git a/toolkit/components/webextensions/test/mochitest/chrome_head.js b/toolkit/components/webextensions/test/mochitest/chrome_head.js
deleted file mode 100644
index da2f53a02b..0000000000
--- a/toolkit/components/webextensions/test/mochitest/chrome_head.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-const {
- classes: Cc,
- interfaces: Ci,
- utils: Cu,
- results: Cr,
-} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
diff --git a/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page1.html b/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page1.html
deleted file mode 100644
index 663ebc6112..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page1.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<iframe src="file_WebNavigation_page2.html" width="200" height="200"></iframe>
-
-<form>
-</form>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page2.html b/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page2.html
deleted file mode 100644
index cc1acc83d6..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page2.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page3.html b/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page3.html
deleted file mode 100644
index a0a26a2e9d..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_WebNavigation_page3.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<a id="elt" href="file_WebNavigation_page3.html#ref">click me</a>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_WebRequest_page3.html b/toolkit/components/webextensions/test/mochitest/file_WebRequest_page3.html
deleted file mode 100644
index 5807dd439f..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_WebRequest_page3.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-<script>
-"use strict";
-window.close();
-</script>
-</head>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_csp.html b/toolkit/components/webextensions/test/mochitest/file_csp.html
deleted file mode 100644
index 206e443904..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_csp.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-
-<div id="test">Sample text</div>
-<img id="bad-image" src="http://example.org/tests/toolkit/components/extensions/test/mochitest/file_image_bad.png" />
-<script id="bad-script" type="text/javascript" src="http://example.org/tests/toolkit/components/extensions/test/mochitest/file_script_bad.js"></script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_csp.html^headers^ b/toolkit/components/webextensions/test/mochitest/file_csp.html^headers^
deleted file mode 100644
index 4c6fa3c26a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_csp.html^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Content-Security-Policy: default-src 'self'
diff --git a/toolkit/components/webextensions/test/mochitest/file_ext_test_api_injection.js b/toolkit/components/webextensions/test/mochitest/file_ext_test_api_injection.js
deleted file mode 100644
index 06dfae65ec..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_ext_test_api_injection.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-
-var {interfaces: Ci} = Components;
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-Services.console.registerListener(function listener(message) {
- if (/WebExt Privilege Escalation/.test(message.message)) {
- Services.console.unregisterListener(listener);
- sendAsyncMessage("console-message", {message: message.message});
- }
-});
diff --git a/toolkit/components/webextensions/test/mochitest/file_image_bad.png b/toolkit/components/webextensions/test/mochitest/file_image_bad.png
deleted file mode 100644
index 4c3be50847..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_image_bad.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/webextensions/test/mochitest/file_image_good.png b/toolkit/components/webextensions/test/mochitest/file_image_good.png
deleted file mode 100644
index 769c636340..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_image_good.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/webextensions/test/mochitest/file_image_redirect.png b/toolkit/components/webextensions/test/mochitest/file_image_redirect.png
deleted file mode 100644
index 4c3be50847..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_image_redirect.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/webextensions/test/mochitest/file_mixed.html b/toolkit/components/webextensions/test/mochitest/file_mixed.html
deleted file mode 100644
index f3c7dda580..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_mixed.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-
-<div id="test">Sample text</div>
-<img id="bad-image" src="http://example.com/tests/toolkit/components/extensions/test/mochitest/file_image_bad.png" />
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_permission_xhr.html b/toolkit/components/webextensions/test/mochitest/file_permission_xhr.html
deleted file mode 100644
index 22a55f90d2..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_permission_xhr.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-
-<script>
-"use strict";
-
-/* globals privilegedFetch, privilegedXHR */
-/* eslint-disable mozilla/balanced-listeners */
-
-addEventListener("message", function rcv(event) {
- removeEventListener("message", rcv, false);
-
- function assertTrue(condition, description) {
- postMessage({msg: "assertTrue", condition, description}, "*");
- }
-
- function passListener() {
- assertTrue(true, "Content XHR has no elevated privileges");
- postMessage({"msg": "finish"}, "*");
- }
-
- function failListener() {
- assertTrue(false, "Content XHR has no elevated privileges");
- postMessage({"msg": "finish"}, "*");
- }
-
- try {
- new privilegedXHR();
- assertTrue(false, "Content should not have access to privileged XHR constructor");
- } catch (e) {
- assertTrue(/Permission denied to access object/.test(e), "Content should not have access to privileged XHR constructor");
- }
-
- try {
- new privilegedFetch();
- assertTrue(false, "Content should not have access to privileged fetch() constructor");
- } catch (e) {
- assertTrue(/Permission denied to access object/.test(e), "Content should not have access to privileged fetch() constructor");
- }
-
- let req = new XMLHttpRequest();
- req.addEventListener("load", failListener);
- req.addEventListener("error", passListener);
- req.open("GET", "http://example.org/example.txt");
- req.send();
-}, false);
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_privilege_escalation.html b/toolkit/components/webextensions/test/mochitest/file_privilege_escalation.html
deleted file mode 100644
index 258f7058d9..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_privilege_escalation.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
- <script type="text/javascript">
- "use strict";
- throw new Error(`WebExt Privilege Escalation: typeof(browser) = ${typeof(browser)}`);
- </script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_sample.html b/toolkit/components/webextensions/test/mochitest/file_sample.html
deleted file mode 100644
index a20e49a1f0..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_sample.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-
-<div id="test">Sample text</div>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_script_bad.js b/toolkit/components/webextensions/test/mochitest/file_script_bad.js
deleted file mode 100644
index c425122c71..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_script_bad.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-window.failure = true;
diff --git a/toolkit/components/webextensions/test/mochitest/file_script_good.js b/toolkit/components/webextensions/test/mochitest/file_script_good.js
deleted file mode 100644
index 1848edf686..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_script_good.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-window.success = window.success ? window.success + 1 : 1;
diff --git a/toolkit/components/webextensions/test/mochitest/file_script_redirect.js b/toolkit/components/webextensions/test/mochitest/file_script_redirect.js
deleted file mode 100644
index c89a196c2a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_script_redirect.js
+++ /dev/null
@@ -1,4 +0,0 @@
-"use strict";
-
-window.failure = true;
-
diff --git a/toolkit/components/webextensions/test/mochitest/file_script_xhr.js b/toolkit/components/webextensions/test/mochitest/file_script_xhr.js
deleted file mode 100644
index 07f80eb2ea..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_script_xhr.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-var request = new XMLHttpRequest();
-request.open("get", "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest/xhr_resource", false);
-request.send();
diff --git a/toolkit/components/webextensions/test/mochitest/file_style_bad.css b/toolkit/components/webextensions/test/mochitest/file_style_bad.css
deleted file mode 100644
index 8dbc8dc7a4..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_style_bad.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#test {
- color: green !important;
-}
diff --git a/toolkit/components/webextensions/test/mochitest/file_style_good.css b/toolkit/components/webextensions/test/mochitest/file_style_good.css
deleted file mode 100644
index 46f9774b5f..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_style_good.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#test {
- color: red;
-}
diff --git a/toolkit/components/webextensions/test/mochitest/file_style_redirect.css b/toolkit/components/webextensions/test/mochitest/file_style_redirect.css
deleted file mode 100644
index 8dbc8dc7a4..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_style_redirect.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#test {
- color: green !important;
-}
diff --git a/toolkit/components/webextensions/test/mochitest/file_teardown_test.js b/toolkit/components/webextensions/test/mochitest/file_teardown_test.js
deleted file mode 100644
index 7246012add..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_teardown_test.js
+++ /dev/null
@@ -1,24 +0,0 @@
-"use strict";
-
-/* globals addMessageListener */
-let {Management} = Components.utils.import("resource://gre/modules/Extension.jsm", {});
-let events = [];
-function record(type, extensionContext) {
- let eventType = type == "proxy-context-load" ? "load" : "unload";
- let url = extensionContext.uri.spec;
- let extensionId = extensionContext.extension.id;
- events.push({eventType, url, extensionId});
-}
-
-Management.on("proxy-context-load", record);
-Management.on("proxy-context-unload", record);
-addMessageListener("cleanup", () => {
- Management.off("proxy-context-load", record);
- Management.off("proxy-context-unload", record);
-});
-
-addMessageListener("get-context-events", extensionId => {
- sendAsyncMessage("context-events", events);
- events = [];
-});
-sendAsyncMessage("chromescript-startup");
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect.html
deleted file mode 100644
index cba3043f71..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
- <head>
- <meta http-equiv="refresh" content="1;dummy_page.html">
- </head>
- <body>
- </body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html
deleted file mode 100644
index c5b436979f..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
- <head>
- </head>
- <body>
- </body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html^headers^ b/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html^headers^
deleted file mode 100644
index 574a392a15..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_clientRedirect_httpHeaders.html^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Refresh: 1;url=dummy_page.html
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_frameClientRedirect.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_frameClientRedirect.html
deleted file mode 100644
index d360bcbb13..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_frameClientRedirect.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<iframe src="file_webNavigation_clientRedirect.html" width="200" height="200"></iframe>
-
-<form>
-</form>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_frameRedirect.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_frameRedirect.html
deleted file mode 100644
index 06dbd43741..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_frameRedirect.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<iframe src="redirection.sjs" width="200" height="200"></iframe>
-
-<form>
-</form>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe.html
deleted file mode 100644
index 307990714b..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<iframe src="file_webNavigation_manualSubframe_page1.html" width="200" height="200"></iframe>
-
-<form>
-</form>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page1.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page1.html
deleted file mode 100644
index 55bb7aa6ae..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page1.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-
-<html>
- <body>
- <h1>page1</h1>
- <a href="file_webNavigation_manualSubframe_page2.html">page2</a>
- </body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page2.html b/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page2.html
deleted file mode 100644
index 8f589f8bbd..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_webNavigation_manualSubframe_page2.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-
-<html>
- <body>
- <h1>page2</h1>
- </body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/file_with_about_blank.html b/toolkit/components/webextensions/test/mochitest/file_with_about_blank.html
deleted file mode 100644
index af51c2e52a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/file_with_about_blank.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <meta charset="utf-8">
-</head>
-<body>
- <iframe id="a_b" src="about:blank"></iframe>
- <iframe srcdoc="galactica actual" src="adama"></iframe>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/head.js b/toolkit/components/webextensions/test/mochitest/head.js
deleted file mode 100644
index 1b1a294726..0000000000
--- a/toolkit/components/webextensions/test/mochitest/head.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-/* exported waitForLoad */
-
-function waitForLoad(win) {
- return new Promise(resolve => {
- win.addEventListener("load", function listener() {
- win.removeEventListener("load", listener, true);
- resolve();
- }, true);
- });
-}
-
diff --git a/toolkit/components/webextensions/test/mochitest/head_cookies.js b/toolkit/components/webextensions/test/mochitest/head_cookies.js
deleted file mode 100644
index 9f69665511..0000000000
--- a/toolkit/components/webextensions/test/mochitest/head_cookies.js
+++ /dev/null
@@ -1,167 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* exported testCookies */
-
-function* testCookies(options) {
- // Changing the options object is a bit of a hack, but it allows us to easily
- // pass an expiration date to the background script.
- options.expiry = Date.now() / 1000 + 3600;
-
- async function background(backgroundOptions) {
- // Ask the parent scope to change some cookies we may or may not have
- // permission for.
- let awaitChanges = new Promise(resolve => {
- browser.test.onMessage.addListener(msg => {
- browser.test.assertEq("cookies-changed", msg, "browser.test.onMessage");
- resolve();
- });
- });
-
- let changed = [];
- browser.cookies.onChanged.addListener(event => {
- changed.push(`${event.cookie.name}:${event.cause}`);
- });
- browser.test.sendMessage("change-cookies");
-
-
- // Try to access some cookies in various ways.
- let {url, domain, secure} = backgroundOptions;
-
- let failures = 0;
- let tallyFailure = error => {
- failures++;
- };
-
- try {
- await awaitChanges;
-
- let cookie = await browser.cookies.get({url, name: "foo"});
- browser.test.assertEq(backgroundOptions.shouldPass, cookie != null, "should pass == get cookie");
-
- let cookies = await browser.cookies.getAll({domain});
- if (backgroundOptions.shouldPass) {
- browser.test.assertEq(2, cookies.length, "expected number of cookies");
- } else {
- browser.test.assertEq(0, cookies.length, "expected number of cookies");
- }
-
- await Promise.all([
- browser.cookies.set({url, domain, secure, name: "foo", "value": "baz", expirationDate: backgroundOptions.expiry}).catch(tallyFailure),
- browser.cookies.set({url, domain, secure, name: "bar", "value": "quux", expirationDate: backgroundOptions.expiry}).catch(tallyFailure),
- browser.cookies.remove({url, name: "deleted"}),
- ]);
-
- if (backgroundOptions.shouldPass) {
- // The order of eviction events isn't guaranteed, so just check that
- // it's there somewhere.
- let evicted = changed.indexOf("evicted:evicted");
- if (evicted < 0) {
- browser.test.fail("got no eviction event");
- } else {
- browser.test.succeed("got eviction event");
- changed.splice(evicted, 1);
- }
-
- browser.test.assertEq("x:explicit,x:overwrite,x:explicit,x:explicit,foo:overwrite,foo:explicit,bar:explicit,deleted:explicit",
- changed.join(","), "expected changes");
- } else {
- browser.test.assertEq("", changed.join(","), "expected no changes");
- }
-
- if (!(backgroundOptions.shouldPass || backgroundOptions.shouldWrite)) {
- browser.test.assertEq(2, failures, "Expected failures");
- } else {
- browser.test.assertEq(0, failures, "Expected no failures");
- }
-
- browser.test.notifyPass("cookie-permissions");
- } catch (error) {
- browser.test.fail(`Error: ${error} :: ${error.stack}`);
- browser.test.notifyFail("cookie-permissions");
- }
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "permissions": options.permissions,
- },
-
- background: `(${background})(${JSON.stringify(options)})`,
- });
-
-
- let cookieSvc = SpecialPowers.Services.cookies;
-
- let domain = options.domain.replace(/^\.?/, ".");
-
- // This will be evicted after we add a fourth cookie.
- cookieSvc.add(domain, "/", "evicted", "bar", options.secure, false, false, options.expiry);
- // This will be modified by the background script.
- cookieSvc.add(domain, "/", "foo", "bar", options.secure, false, false, options.expiry);
- // This will be deleted by the background script.
- cookieSvc.add(domain, "/", "deleted", "bar", options.secure, false, false, options.expiry);
-
-
- yield extension.startup();
-
- yield extension.awaitMessage("change-cookies");
- cookieSvc.add(domain, "/", "x", "y", options.secure, false, false, options.expiry);
- cookieSvc.add(domain, "/", "x", "z", options.secure, false, false, options.expiry);
- cookieSvc.remove(domain, "x", "/", false, {});
- extension.sendMessage("cookies-changed");
-
- yield extension.awaitFinish("cookie-permissions");
- yield extension.unload();
-
-
- function getCookies(host) {
- let cookies = [];
- let enum_ = cookieSvc.getCookiesFromHost(host, {});
- while (enum_.hasMoreElements()) {
- cookies.push(enum_.getNext().QueryInterface(SpecialPowers.Ci.nsICookie2));
- }
- return cookies.sort((a, b) => String.localeCompare(a.name, b.name));
- }
-
- let cookies = getCookies(options.domain);
- info(`Cookies: ${cookies.map(c => `${c.name}=${c.value}`)}`);
-
- if (options.shouldPass) {
- is(cookies.length, 2, "expected two cookies for host");
-
- is(cookies[0].name, "bar", "correct cookie name");
- is(cookies[0].value, "quux", "correct cookie value");
-
- is(cookies[1].name, "foo", "correct cookie name");
- is(cookies[1].value, "baz", "correct cookie value");
- } else if (options.shouldWrite) {
- // Note: |shouldWrite| applies only when |shouldPass| is false.
- // This is necessary because, unfortunately, websites (and therefore web
- // extensions) are allowed to write some cookies which they're not allowed
- // to read.
- is(cookies.length, 3, "expected three cookies for host");
-
- is(cookies[0].name, "bar", "correct cookie name");
- is(cookies[0].value, "quux", "correct cookie value");
-
- is(cookies[1].name, "deleted", "correct cookie name");
-
- is(cookies[2].name, "foo", "correct cookie name");
- is(cookies[2].value, "baz", "correct cookie value");
- } else {
- is(cookies.length, 2, "expected two cookies for host");
-
- is(cookies[0].name, "deleted", "correct second cookie name");
-
- is(cookies[1].name, "foo", "correct cookie name");
- is(cookies[1].value, "bar", "correct cookie value");
- }
-
- for (let cookie of cookies) {
- cookieSvc.remove(cookie.host, cookie.name, "/", false, {});
- }
- // Make sure we don't silently poison subsequent tests if something goes wrong.
- is(getCookies(options.domain).length, 0, "cookies cleared");
-}
diff --git a/toolkit/components/webextensions/test/mochitest/head_webrequest.js b/toolkit/components/webextensions/test/mochitest/head_webrequest.js
deleted file mode 100644
index 96924e505c..0000000000
--- a/toolkit/components/webextensions/test/mochitest/head_webrequest.js
+++ /dev/null
@@ -1,331 +0,0 @@
-"use strict";
-
-let commonEvents = {
- "onBeforeRequest": [{urls: ["<all_urls>"]}, ["blocking"]],
- "onBeforeSendHeaders": [{urls: ["<all_urls>"]}, ["blocking", "requestHeaders"]],
- "onSendHeaders": [{urls: ["<all_urls>"]}, ["requestHeaders"]],
- "onBeforeRedirect": [{urls: ["<all_urls>"]}],
- "onHeadersReceived": [{urls: ["<all_urls>"]}, ["blocking", "responseHeaders"]],
- "onResponseStarted": [{urls: ["<all_urls>"]}],
- "onCompleted": [{urls: ["<all_urls>"]}, ["responseHeaders"]],
- "onErrorOccurred": [{urls: ["<all_urls>"]}],
-};
-
-function background(events) {
- let expect;
- let ignore;
- let defaultOrigin;
-
- browser.test.onMessage.addListener((msg, expected) => {
- if (msg !== "set-expected") {
- return;
- }
- expect = expected.expect;
- defaultOrigin = expected.origin;
- ignore = expected.ignore;
- let promises = [];
- // Initialize some stuff we'll need in the tests.
- for (let entry of Object.values(expect)) {
- // a place for the test infrastructure to store some state.
- entry.test = {};
- // Each entry in expected gets a Promise that will be resolved in the
- // last event for that entry. This will either be onCompleted, or the
- // last entry if an events list was provided.
- promises.push(new Promise(resolve => { entry.test.resolve = resolve; }));
- // If events was left undefined, we're expecting all normal events we're
- // listening for, exclude onBeforeRedirect and onErrorOccurred
- if (entry.events === undefined) {
- entry.events = Object.keys(events).filter(name => name != "onErrorOccurred" && name != "onBeforeRedirect");
- }
- if (entry.optional_events === undefined) {
- entry.optional_events = [];
- }
- }
- // When every expected entry has finished our test is done.
- Promise.all(promises).then(() => {
- browser.test.sendMessage("done");
- });
- browser.test.sendMessage("continue");
- });
-
- // Retrieve the per-file/test expected values.
- function getExpected(details) {
- let url = new URL(details.url);
- let filename;
- if (url.protocol == "data:") {
- // pathname is everything after protocol.
- filename = url.pathname;
- } else {
- filename = url.pathname.split("/").pop();
- }
- if (ignore && ignore.includes(filename)) {
- return;
- }
- let expected = expect[filename];
- if (!expected) {
- browser.test.fail(`unexpected request ${filename}`);
- return;
- }
- // Save filename for redirect verification.
- expected.test.filename = filename;
- return expected;
- }
-
- // Process any test header modifications that can happen in request or response phases.
- // If a test includes headers, it needs a complete header object, no undefined
- // objects even if empty:
- // request: {
- // add: {"HeaderName": "value",},
- // modify: {"HeaderName": "value",},
- // remove: ["HeaderName",],
- // },
- // response: {
- // add: {"HeaderName": "value",},
- // modify: {"HeaderName": "value",},
- // remove: ["HeaderName",],
- // },
- function processHeaders(phase, expected, details) {
- // This should only happen once per phase [request|response].
- browser.test.assertFalse(!!expected.test[phase], `First processing of headers for ${phase}`);
- expected.test[phase] = true;
-
- let headers = details[`${phase}Headers`];
- browser.test.assertTrue(Array.isArray(headers), `${phase}Headers array present`);
-
- let {add, modify, remove} = expected.headers[phase];
-
- for (let name in add) {
- browser.test.assertTrue(!headers.find(h => h.name === name), `header ${name} to be added not present yet in ${phase}Headers`);
- let header = {name: name};
- if (name.endsWith("-binary")) {
- header.binaryValue = Array.from(add[name], c => c.charCodeAt(0));
- } else {
- header.value = add[name];
- }
- headers.push(header);
- }
-
- let modifiedAny = false;
- for (let header of headers) {
- if (header.name.toLowerCase() in modify) {
- header.value = modify[header.name.toLowerCase()];
- modifiedAny = true;
- }
- }
- browser.test.assertTrue(modifiedAny, `at least one ${phase}Headers element to modify`);
-
- let deletedAny = false;
- for (let j = headers.length; j-- > 0;) {
- if (remove.includes(headers[j].name.toLowerCase())) {
- headers.splice(j, 1);
- deletedAny = true;
- }
- }
- browser.test.assertTrue(deletedAny, `at least one ${phase}Headers element to delete`);
-
- return headers;
- }
-
- // phase is request or response.
- function checkHeaders(phase, expected, details) {
- if (!/^https?:/.test(details.url)) {
- return;
- }
-
- let headers = details[`${phase}Headers`];
- browser.test.assertTrue(Array.isArray(headers), `valid ${phase}Headers array`);
-
- let {add, modify, remove} = expected.headers[phase];
- for (let name in add) {
- let value = headers.find(h => h.name.toLowerCase() === name.toLowerCase()).value;
- browser.test.assertEq(value, add[name], `header ${name} correctly injected in ${phase}Headers`);
- }
-
- for (let name in modify) {
- let value = headers.find(h => h.name.toLowerCase() === name.toLowerCase()).value;
- browser.test.assertEq(value, modify[name], `header ${name} matches modified value`);
- }
-
- for (let name of remove) {
- let found = headers.find(h => h.name.toLowerCase() === name.toLowerCase());
- browser.test.assertFalse(!!found, `deleted header ${name} still found in ${phase}Headers`);
- }
- }
-
- function getListener(name) {
- return details => {
- let result = {};
- browser.test.log(`${name} ${details.requestId} ${details.url}`);
- let expected = getExpected(details);
- if (!expected) {
- return result;
- }
- let expectedEvent = expected.events[0] == name;
- if (expectedEvent) {
- expected.events.shift();
- } else {
- expectedEvent = expected.optional_events[0] == name;
- if (expectedEvent) {
- expected.optional_events.shift();
- }
- }
- browser.test.assertTrue(expectedEvent, `received ${name}`);
- browser.test.assertEq(expected.type, details.type, "resource type is correct");
- browser.test.assertEq(expected.origin || defaultOrigin, details.originUrl, "origin is correct");
-
- if (name == "onBeforeRequest") {
- // Save some values to test request consistency in later events.
- browser.test.assertTrue(details.tabId !== undefined, `tabId ${details.tabId}`);
- browser.test.assertTrue(details.requestId !== undefined, `requestId ${details.requestId}`);
- // Validate requestId if it's already set, this happens with redirects.
- if (expected.test.requestId !== undefined) {
- browser.test.assertEq("string", typeof expected.test.requestId, `requestid ${expected.test.requestId} is string`);
- browser.test.assertEq("string", typeof details.requestId, `requestid ${details.requestId} is string`);
- browser.test.assertEq("number", typeof parseInt(details.requestId, 10), "parsed requestid is number");
- browser.test.assertNotEq(expected.test.requestId, details.requestId,
- `last requestId ${expected.test.requestId} different from this one ${details.requestId}`);
- } else {
- // Save any values we want to validate in later events.
- expected.test.requestId = details.requestId;
- expected.test.tabId = details.tabId;
- }
- // Tests we don't need to do every event.
- browser.test.assertTrue(details.type.toUpperCase() in browser.webRequest.ResourceType, `valid resource type ${details.type}`);
- if (details.type == "main_frame") {
- browser.test.assertEq(0, details.frameId, "frameId is zero when type is main_frame bug 1329299");
- }
- } else {
- // On events after onBeforeRequest, check the previous values.
- browser.test.assertEq(expected.test.requestId, details.requestId, "correct requestId");
- browser.test.assertEq(expected.test.tabId, details.tabId, "correct tabId");
- }
- if (name == "onBeforeSendHeaders") {
- if (expected.headers && expected.headers.request) {
- result.requestHeaders = processHeaders("request", expected, details);
- }
- if (expected.redirect) {
- browser.test.log(`${name} redirect request`);
- result.redirectUrl = details.url.replace(expected.test.filename, expected.redirect);
- }
- }
- if (name == "onSendHeaders") {
- if (expected.headers && expected.headers.request) {
- checkHeaders("request", expected, details);
- }
- }
- if (name == "onHeadersReceived") {
- browser.test.assertEq(expected.status || 200, details.statusCode,
- `expected HTTP status received for ${details.url}`);
- if (expected.headers && expected.headers.response) {
- result.responseHeaders = processHeaders("response", expected, details);
- }
- }
- if (name == "onCompleted") {
- // If we have already completed a GET request for this url,
- // and it was found, we expect for the response to come fromCache.
- // expected.cached may be undefined, force boolean.
- let expectCached = !!expected.cached && details.method === "GET" && details.statusCode != 404;
- browser.test.assertEq(expectCached, details.fromCache, "fromCache is correct");
- // We can only tell IPs for non-cached HTTP requests.
- if (!details.fromCache && /^https?:/.test(details.url)) {
- browser.test.assertEq("127.0.0.1", details.ip, `correct ip for ${details.url}`);
- }
- if (expected.headers && expected.headers.response) {
- checkHeaders("response", expected, details);
- }
- }
-
- if (expected.cancel && expected.cancel == name) {
- browser.test.log(`${name} cancel request`);
- browser.test.sendMessage("cancelled");
- result.cancel = true;
- }
- // If we've used up all the events for this test, resolve the promise.
- // If something wrong happens and more events come through, there will be
- // failures.
- if (expected.events.length <= 0) {
- expected.test.resolve();
- }
- return result;
- };
- }
-
- for (let [name, args] of Object.entries(events)) {
- browser.test.log(`adding listener for ${name}`);
- try {
- browser.webRequest[name].addListener(getListener(name), ...args);
- } catch (e) {
- browser.test.assertTrue(/\brequestBody\b/.test(e.message),
- "Request body is unsupported");
-
- // RequestBody is disabled in release builds.
- if (!/\brequestBody\b/.test(e.message)) {
- throw e;
- }
-
- args.splice(args.indexOf("requestBody"), 1);
- browser.webRequest[name].addListener(getListener(name), ...args);
- }
- }
-}
-
-/* exported makeExtension */
-
-function makeExtension(events = commonEvents) {
- return ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "webRequestBlocking",
- "<all_urls>",
- ],
- },
- background: `(${background})(${JSON.stringify(events)})`,
- });
-}
-
-/* exported addStylesheet */
-
-function addStylesheet(file) {
- let link = document.createElement("link");
- link.setAttribute("rel", "stylesheet");
- link.setAttribute("href", file);
- document.body.appendChild(link);
-}
-
-/* exported addLink */
-
-function addLink(file) {
- let a = document.createElement("a");
- a.setAttribute("href", file);
- a.setAttribute("target", "_blank");
- document.body.appendChild(a);
- return a;
-}
-
-/* exported addImage */
-
-function addImage(file) {
- let img = document.createElement("img");
- img.setAttribute("src", file);
- document.body.appendChild(img);
-}
-
-/* exported addScript */
-
-function addScript(file) {
- let script = document.createElement("script");
- script.setAttribute("type", "text/javascript");
- script.setAttribute("src", file);
- document.getElementsByTagName("head").item(0).appendChild(script);
-}
-
-/* exported addFrame */
-
-function addFrame(file) {
- let frame = document.createElement("iframe");
- frame.setAttribute("width", "200");
- frame.setAttribute("height", "200");
- frame.setAttribute("src", file);
- document.body.appendChild(frame);
-}
diff --git a/toolkit/components/webextensions/test/mochitest/mochitest.ini b/toolkit/components/webextensions/test/mochitest/mochitest.ini
deleted file mode 100644
index 1f61060add..0000000000
--- a/toolkit/components/webextensions/test/mochitest/mochitest.ini
+++ /dev/null
@@ -1,115 +0,0 @@
-[DEFAULT]
-support-files =
- head.js
- file_mixed.html
- head_webrequest.js
- file_csp.html
- file_csp.html^headers^
- file_WebRequest_page3.html
- file_webNavigation_clientRedirect.html
- file_webNavigation_clientRedirect_httpHeaders.html
- file_webNavigation_clientRedirect_httpHeaders.html^headers^
- file_webNavigation_frameClientRedirect.html
- file_webNavigation_frameRedirect.html
- file_webNavigation_manualSubframe.html
- file_webNavigation_manualSubframe_page1.html
- file_webNavigation_manualSubframe_page2.html
- file_WebNavigation_page1.html
- file_WebNavigation_page2.html
- file_WebNavigation_page3.html
- file_with_about_blank.html
- file_image_good.png
- file_image_bad.png
- file_image_redirect.png
- file_style_good.css
- file_style_bad.css
- file_style_redirect.css
- file_script_good.js
- file_script_bad.js
- file_script_redirect.js
- file_script_xhr.js
- file_sample.html
- redirection.sjs
- file_privilege_escalation.html
- file_ext_test_api_injection.js
- file_permission_xhr.html
- file_teardown_test.js
- return_headers.sjs
- webrequest_worker.js
-tags = webextensions
-
-[test_clipboard.html]
-# skip-if = # disabled test case with_permission_allow_copy, see inline comment.
-[test_ext_inIncognitoContext_window.html]
-skip-if = os == 'android' # Android does not currently support windows.
-[test_ext_geturl.html]
-[test_ext_background_canvas.html]
-[test_ext_content_security_policy.html]
-[test_ext_contentscript.html]
-[test_ext_contentscript_api_injection.html]
-[test_ext_contentscript_async_loading.html]
-[test_ext_contentscript_context.html]
-[test_ext_contentscript_create_iframe.html]
-[test_ext_contentscript_devtools_metadata.html]
-[test_ext_contentscript_exporthelpers.html]
-[test_ext_contentscript_css.html]
-[test_ext_contentscript_about_blank.html]
-[test_ext_contentscript_permission.html]
-skip-if = os == 'android' # Android does not support tabs API. Bug 1260250
-[test_ext_contentscript_teardown.html]
-skip-if = (os == 'android') # Android does not support tabs API. Bug 1260250
-[test_ext_exclude_include_globs.html]
-[test_ext_external_messaging.html]
-[test_ext_i18n_css.html]
-[test_ext_generate.html]
-[test_ext_notifications.html]
-[test_ext_permission_xhr.html]
-[test_ext_runtime_connect.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_runtime_connect_twoway.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_runtime_connect2.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_runtime_disconnect.html]
-[test_ext_runtime_id.html]
-[test_ext_sandbox_var.html]
-[test_ext_sendmessage_reply.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_sendmessage_reply2.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_sendmessage_doublereply.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_sendmessage_no_receiver.html]
-[test_ext_storage_content.html]
-[test_ext_storage_tab.html]
-skip-if = os == 'android' # Android does not currently support tabs.
-[test_ext_test.html]
-[test_ext_cookies.html]
-skip-if = os == 'android' # Bug 1258975 on android.
-[test_ext_background_api_injection.html]
-[test_ext_background_generated_url.html]
-[test_ext_background_teardown.html]
-[test_ext_tab_teardown.html]
-skip-if = (os == 'android') # Android does not support tabs API. Bug 1260250
-[test_ext_unload_frame.html]
-[test_ext_i18n.html]
-skip-if = (os == 'android') # Bug 1258975 on android.
-[test_ext_listener_proxies.html]
-[test_ext_web_accessible_resources.html]
-skip-if = (os == 'android') # Bug 1258975 on android.
-[test_ext_webrequest_background_events.html]
-skip-if = os == 'android' # webrequest api unsupported (bug 1258975).
-[test_ext_webrequest_basic.html]
-skip-if = os == 'android' # webrequest api unsupported (bug 1258975).
-[test_ext_webrequest_suspend.html]
-skip-if = os == 'android' # webrequest api unsupported (bug 1258975).
-[test_ext_webrequest_upload.html]
-skip-if = release_or_beta || os == 'android' # webrequest api unsupported (bug 1258975).
-[test_ext_webnavigation.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_webnavigation_filters.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_window_postMessage.html]
-[test_ext_subframes_privileges.html]
-skip-if = os == 'android' # port.sender.tab is undefined on Android (bug 1258975).
-[test_ext_xhr_capabilities.html]
diff --git a/toolkit/components/webextensions/test/mochitest/redirection.sjs b/toolkit/components/webextensions/test/mochitest/redirection.sjs
deleted file mode 100644
index 370ecd213f..0000000000
--- a/toolkit/components/webextensions/test/mochitest/redirection.sjs
+++ /dev/null
@@ -1,4 +0,0 @@
-function handleRequest(aRequest, aResponse) {
- aResponse.setStatusLine(aRequest.httpVersion, 302);
- aResponse.setHeader("Location", "./dummy_page.html");
-}
diff --git a/toolkit/components/webextensions/test/mochitest/return_headers.sjs b/toolkit/components/webextensions/test/mochitest/return_headers.sjs
deleted file mode 100644
index 54e2e5fb4d..0000000000
--- a/toolkit/components/webextensions/test/mochitest/return_headers.sjs
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ft=javascript sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* exported handleRequest */
-
-function handleRequest(request, response) {
- response.setHeader("Content-Type", "text/plain", false);
-
- let headers = {};
- // Why on earth is this a nsISimpleEnumerator...
- let enumerator = request.headers;
- while (enumerator.hasMoreElements()) {
- let header = enumerator.getNext().data;
- headers[header.toLowerCase()] = request.getHeader(header);
- }
-
- response.write(JSON.stringify(headers));
-}
-
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_debug_global.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_debug_global.html
deleted file mode 100644
index 0edf5ea86a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_debug_global.html
+++ /dev/null
@@ -1,166 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-
-const {
- XPIProvider,
-} = Components.utils.import("resource://gre/modules/addons/XPIProvider.jsm");
-
-/**
- * This test is asserting that ext-backgroundPage.js successfully sets its
- * debug global in the AddonWrapper provided by XPIProvider.jsm
- *
- * It does _not_ test any functionality in devtools and does not guarantee
- * debugging is actually working correctly end-to-end.
- */
-
-function background() {
- window.testThing = "test!";
- browser.test.notifyPass("background script ran");
-}
-
-const ID = "debug@tests.mozilla.org";
-let extensionData = {
- useAddonManager: "temporary",
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- },
-};
-
-add_task(function* () {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitFinish("background script ran");
-
- yield new Promise(function(resolve) {
- window.BrowserToolboxProcess.emit("connectionchange", "opened", {
- setAddonOptions(id, options) {
- if (id === ID) {
- let context = Cu.waiveXrays(options.global);
- ok(context.chrome, "global context has a chrome object");
- ok(context.browser, "global context has a browser object");
- is("test!", context.testThing, "global context is the background script context");
- resolve();
- }
- },
- });
- });
-
- let addon = yield new Promise((resolve, reject) => {
- AddonManager.getAddonByID(ID, addon => addon ? resolve(addon) : reject());
- });
-
- ok(addon, `Got the addon wrapper for ${addon.id}`);
-
- function waitForDebugGlobalChanges(times, initialAddonInstanceID) {
- return new Promise((resolve) => {
- AddonManager.addAddonListener({
- count: 0,
- notNullGlobalsCount: 0,
- undefinedPrivateWrappersCount: 0,
- lastAddonInstanceID: initialAddonInstanceID,
- onPropertyChanged(newAddon, changedPropNames) {
- if (newAddon.id != addon.id ||
- !changedPropNames.includes("debugGlobal")) {
- return;
- }
-
- ok(!(newAddon.setDebugGlobal) && !(newAddon.getDebugGlobal),
- "The addon wrapper should not be a PrivateWrapper");
-
- let activeAddon = XPIProvider.activeAddons.get(addon.id);
-
- let addonInstanceID;
-
- if (!activeAddon) {
- // The addon has been disable, the preferred global should be null
- addonInstanceID = this.lastAddonInstanceID;
- delete this.lastAddonInstanceID;
- } else {
- addonInstanceID = activeAddon.instanceID;
- this.lastAddonInstanceID = addonInstanceID;
- }
-
- ok(addonInstanceID, `Got the addon instanceID for ${addon.id}`);
-
- AddonManager.getAddonByInstanceID(addonInstanceID).then((privateWrapper) => {
- this.count += 1;
-
- if (!privateWrapper) {
- // The addon has been uninstalled
- this.undefinedPrivateWrappersCount += 1;
- } else {
- ok((privateWrapper.getDebugGlobal), "Got the addon PrivateWrapper");
-
- if (privateWrapper.getDebugGlobal()) {
- this.notNullGlobalsCount += 1;
- }
- }
-
- if (this.count == times) {
- AddonManager.removeAddonListener(this);
- resolve({
- counters: {
- count: this.count,
- notNullGlobalsCount: this.notNullGlobalsCount,
- undefinedPrivateWrappersCount: this.undefinedPrivateWrappersCount,
- },
- lastAddonInstanceID: this.lastAddonInstanceID,
- });
- }
- });
- },
- });
- });
- }
-
- // two calls expected, one for the shutdown and one for the startup
- // of the background page.
- let waitForDebugGlobalChangesOnReload = waitForDebugGlobalChanges(2);
-
- info("Addon reload...");
- yield addon.reload();
-
- info("Addon completed startup after reload");
-
- let {
- counters: reloadCounters,
- lastAddonInstanceID,
- } = yield waitForDebugGlobalChangesOnReload;
-
- isDeeply(reloadCounters, {count: 2, notNullGlobalsCount: 1, undefinedPrivateWrappersCount: 0},
- "Got the expected number of onPropertyChanged calls on reload");
-
- // one more call expected for the shutdown.
- let waitForDebugGlobalChangesOnShutdown = waitForDebugGlobalChanges(1, lastAddonInstanceID);
-
- info("extension unloading...");
- yield extension.unload();
- info("extension unloaded");
-
- let {counters: unloadCounters} = yield waitForDebugGlobalChangesOnShutdown;
-
- isDeeply(unloadCounters, {count: 1, notNullGlobalsCount: 0, undefinedPrivateWrappersCount: 1},
- "Got the expected number of onPropertyChanged calls on shutdown");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_page.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_page.html
deleted file mode 100644
index 471c5339df..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_background_page.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-Cu.import("resource://testing-common/TestUtils.jsm");
-
-/* eslint-disable mozilla/balanced-listeners */
-
-add_task(function* testAlertNotShownInBackgroundWindow() {
- ok(!Services.wm.getEnumerator("alert:alert").hasMoreElements(),
- "Alerts should not be present at the start of the test.");
-
- let consoleOpened = TestUtils.topicObserved("web-console-created");
-
-
- let extension = ExtensionTestUtils.loadExtension({
- background: function() {
- browser.test.log("background script executed");
-
- alert("I am an alert in the background.");
-
- browser.test.notifyPass("alertCalled");
- },
- });
-
- yield extension.startup();
-
- info("startup complete loaded");
-
- yield extension.awaitFinish("alertCalled");
-
-
- let alertWindows = Services.wm.getEnumerator("alert:alert");
- ok(!alertWindows.hasMoreElements(), "Should not show alert");
-
-
- // Make sure the message we output to the console is seen.
- // This message is in ext-backgroundPage.js
- let events = Cc["@mozilla.org/consoleAPI-storage;1"]
- .getService(Ci.nsIConsoleAPIStorage).getEvents();
-
- // This is the warning that is output after the first `alert()` call is made.
- let alertWarningEvent = events[events.length - 2];
- is(alertWarningEvent.arguments[0], "alert() is not supported in background windows; please use console.log instead.");
-
- // This is the actual alert text that should be present in the console
- // instead of as an `alert`.
- let alertEvent = events[events.length - 1];
- is(alertEvent.arguments[0], "I am an alert in the background.");
-
-
- // Wait for the browser console window to open.
- yield consoleOpened;
-
- let {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
- require("devtools/client/framework/devtools-browser");
- let {HUDService} = require("devtools/client/webconsole/hudservice");
-
- // And then double check that we have an actual browser console.
- let haveConsole = !!HUDService.getBrowserConsole();
- ok(haveConsole, "Expected browser console to be open");
-
- if (haveConsole) {
- yield HUDService.toggleBrowserConsole();
- }
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_contentscript_unrecognizedprop_warning.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_contentscript_unrecognizedprop_warning.html
deleted file mode 100644
index e08121a8fb..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_contentscript_unrecognizedprop_warning.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script unrecognized property on manifest</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-const BASE = "http://mochi.test:8888/chrome/toolkit/components/extensions/test/mochitest";
-
-add_task(function* test_contentscript() {
- function background() {
- browser.runtime.onMessage.addListener(async (msg) => {
- if (msg == "loaded") {
- // NOTE: we're removing the tab from here because doing a win.close()
- // from the chrome test code is raising a "TypeError: can't access
- // dead object" exception.
- let tabs = await browser.tabs.query({active: true, currentWindow: true});
- await browser.tabs.remove(tabs[0].id);
-
- browser.test.notifyPass("content-script-loaded");
- }
- });
- }
-
- function contentScript() {
- chrome.runtime.sendMessage("loaded");
- }
-
- let extensionData = {
- manifest: {
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- "unrecognized_property": "with-a-random-value",
- },
- ],
- },
- background,
-
- files: {
- "content_script.js": contentScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- SimpleTest.waitForExplicitFinish();
- let waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, [{
- message: /Reading manifest: Error processing content_scripts.*.unrecognized_property: An unexpected property was found/,
- }]);
- });
-
- yield extension.startup();
-
- window.open(`${BASE}/file_sample.html`);
-
- yield Promise.all([extension.awaitFinish("content-script-loaded")]);
- info("test page loaded");
-
- yield extension.unload();
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_downloads_saveAs.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_downloads_saveAs.html
deleted file mode 100644
index c1aaae0359..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_downloads_saveAs.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <title>Test downloads.download() saveAs option</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_downloads_saveAs() {
- function background() {
- const url = URL.createObjectURL(new Blob(["file content"]));
- browser.test.onMessage.addListener(async () => {
- try {
- let id = await browser.downloads.download({url, saveAs: true});
- browser.downloads.onChanged.addListener(delta => {
- if (delta.state.current === "complete") {
- browser.test.sendMessage("done", {ok: true, id});
- }
- });
- } catch ({message}) {
- browser.test.sendMessage("done", {ok: false, message});
- }
- });
- browser.test.sendMessage("ready");
- }
-
- const {MockFilePicker} = SpecialPowers;
- const manifest = {background, manifest: {permissions: ["downloads"]}};
- const extension = ExtensionTestUtils.loadExtension(manifest);
-
- MockFilePicker.init(window);
- MockFilePicker.useAnyFile();
- const [file] = MockFilePicker.returnFiles;
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- extension.sendMessage("download");
- let result = yield extension.awaitMessage("done");
-
- ok(result.ok, "downloads.download() works with saveAs");
- is(file.fileSize, 12, "downloaded file is the correct size");
- file.remove(false);
-
- // Test the user canceling the save dialog.
- MockFilePicker.returnValue = MockFilePicker.returnCancel;
-
- extension.sendMessage("download");
- result = yield extension.awaitMessage("done");
-
- ok(!result.ok, "download rejected if the user cancels the dialog");
- is(result.message, "Download canceled by the user", "with the correct message");
- ok(!file.exists(), "file was not downloaded");
-
- yield extension.unload();
- MockFilePicker.cleanup();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html
deleted file mode 100644
index ecea8237ef..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_eventpage_warning.html
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for WebExtension EventPage Warning</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function createEventPageExtension(eventPage) {
- function eventPageScript() {
- browser.test.log("running event page as background script");
- browser.test.sendMessage("running", 1);
- }
-
- return ExtensionTestUtils.loadExtension({
- manifest: {
- "background": eventPage,
- },
- files: {
- "event-page-script.js": eventPageScript,
- "event-page.html": `<html><head>
- <meta charset="utf-8">
- <script src="event-page-script.js"><\/script>
- </head></html>`,
- },
- });
-}
-
-add_task(function* test_eventpages() {
- // Used in other tests to prevent the monitorConsole to grip.
- SimpleTest.waitForExplicitFinish();
-
- let testCases = [
- {
- message: "testing event page running as a background page",
- eventPage: {
- "page": "event-page.html",
- "persistent": false,
- },
- },
- {
- message: "testing event page scripts running as a background page",
- eventPage: {
- "scripts": ["event-page-script.js"],
- "persistent": false,
- },
- },
- ];
-
- for (let {message, eventPage} of testCases) {
- info(message);
-
- // Wait for the expected logged warnings from the manifest validation.
- let waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, [{message: /Event pages are not currently supported./}]);
- });
-
- let extension = createEventPageExtension(eventPage);
-
- info("load complete");
- let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- is(x, 1, "got correct value from extension");
- info("test complete");
- yield extension.unload();
- info("extension unloaded successfully");
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
-
- waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, [{
- message: /Reading manifest: Error processing background.nonExistentProp: An unexpected property was found/,
- }]);
- });
-
- info("testing additional unrecognized properties on background page");
-
- extension = createEventPageExtension({
- "scripts": ["event-page-script.js"],
- "nonExistentProp": true,
- });
-
- info("load complete");
- [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- is(x, 1, "got correct value from extension");
- info("test complete");
- yield extension.unload();
- info("extension unloaded successfully");
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
- }
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_hybrid_addons.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_hybrid_addons.html
deleted file mode 100644
index a74c551f08..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_hybrid_addons.html
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for hybrid addons: SDK or bootstrap.js + embedded WebExtension</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/**
- * This test contains additional tests that ensure that an SDK hybrid addon
- * which is using the new module loader can embed a webextension correctly:
- *
- * while the other tests related to the "Embedded WebExtension" are focused
- * on unit testing a specific component, these tests are testing that a complete
- * hybrid SDK addon works as expected.
- *
- * NOTE: this tests are also the only ones which tests an SDK hybrid addon that
- * uses the new module loader (the one actually used in production by real world
- * addons these days), while the Addon SDK "embedded-webextension" test addon
- * uses the old deprecated module loader (as all the other Addon SDK test addons).
- */
-
-function generateClassicExtensionFiles({id, files}) {
- // The addon install.rdf file, as it would be generated by jpm from the addon
- // package.json metadata.
- files["install.rdf"] = `<?xml version="1.0" encoding="utf-8"?>
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:id>${id}</em:id>
- <em:type>2</em:type>
- <em:bootstrap>true</em:bootstrap>
- <em:hasEmbeddedWebExtension>true</em:hasEmbeddedWebExtension>
- <em:unpack>false</em:unpack>
- <em:version>0.1.0</em:version>
- <em:name>Fake Hybrid Addon</em:name>
- <em:description>A fake hybrid addon</em:description>
-
- <!-- Firefox -->
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>51.0a1</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Fennec -->
- <em:targetApplication>
- <Description>
- <em:id>{aa3c5121-dab2-40e2-81ca-7ea25febc110}</em:id>
- <em:minVersion>51.0a1</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
- </RDF>`;
-
- // The addon package.json file.
- files["package.json"] = `{
- "id": "${id}",
- "name": "hybrid-addon",
- "version": "0.1.0",
- "description": "A fake hybrid addon",
- "main": "index.js",
- "engines": {
- "firefox": ">= 51.0a1",
- "fennec": ">= 51.0a1"
- },
- "license": "MPL-2.0",
- "hasEmbeddedWebExtension": true
- }`;
-
- // The bootstrap file that jpm bundle in any SDK addon built with it.
- files["bootstrap.js"] = `
- const { utils: Cu } = Components;
- const rootURI = __SCRIPT_URI_SPEC__.replace("bootstrap.js", "");
- const COMMONJS_URI = "resource://gre/modules/commonjs";
- const { require } = Cu.import(COMMONJS_URI + "/toolkit/require.js", {});
- const { Bootstrap } = require(COMMONJS_URI + "/sdk/addon/bootstrap.js");
- var { startup, shutdown, install, uninstall } = new Bootstrap(rootURI);
- `;
-
- return files;
-}
-
-add_task(function* test_sdk_hybrid_addon_with_jpm_module_loader() {
- function backgroundScript() {
- browser.runtime.sendMessage("background message", (reply) => {
- browser.test.assertEq("sdk received message: background message", reply,
- "Got the expected reply from the SDK context");
- browser.test.notifyPass("sdk.webext-api.onmessage");
- });
- }
-
- async function sdkMainScript() {
- /* globals require */
- const webext = require("sdk/webextension");
- let {browser} = await webext.startup();
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- sendReply(`sdk received message: ${msg}`);
- });
- }
-
- let id = "fake@sdk.hybrid.addon";
- let extension = ExtensionTestUtils.loadExtension({
- useAddonManager: "temporary",
- files: generateClassicExtensionFiles({
- id,
- files: {
- "index.js": sdkMainScript,
- "webextension/manifest.json": {
- name: "embedded webextension name",
- manifest_version: 2,
- version: "0.1.0",
- background: {
- scripts: ["bg.js"],
- },
- },
- "webextension/bg.js": backgroundScript,
- },
- }),
- }, id);
-
- extension.startup();
-
- yield extension.awaitFinish("sdk.webext-api.onmessage");
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_idle.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_idle.html
deleted file mode 100644
index 3c3063e67b..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_idle.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-const idleService = Cc["@mozilla.org/widget/idleservice;1"].getService(Ci.nsIIdleService);
-
-add_task(function* testWithRealIdleService() {
- function background() {
- browser.test.onMessage.addListener((msg, ...args) => {
- let detectionInterval = args[0];
- if (msg == "addListener") {
- browser.idle.queryState(detectionInterval).then(status => {
- browser.test.assertEq("active", status, "Idle status is active");
- });
- browser.idle.setDetectionInterval(detectionInterval);
- browser.idle.onStateChanged.addListener(newState => {
- browser.test.assertEq("idle", newState, "listener fired with the expected state");
- browser.test.sendMessage("listenerFired");
- });
- } else if (msg == "checkState") {
- browser.idle.queryState(detectionInterval).then(status => {
- browser.test.assertEq("idle", status, "Idle status is idle");
- browser.test.notifyPass("idle");
- });
- }
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- yield extension.startup();
- let idleTime = idleService.idleTime;
- let detectionInterval = Math.max(Math.ceil(idleTime / 1000) + 2, 15);
- info(`idleTime: ${idleTime}, detectionInterval: ${detectionInterval}`);
- extension.sendMessage("addListener", detectionInterval);
- info("Listener added");
- yield extension.awaitMessage("listenerFired");
- info("Listener fired");
- extension.sendMessage("checkState", detectionInterval);
- yield extension.awaitFinish("idle");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_shutdown_cleanup.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_shutdown_cleanup.html
deleted file mode 100644
index e3098e6b1e..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_shutdown_cleanup.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/TestUtils.jsm");
-
-const {GlobalManager} = Cu.import("resource://gre/modules/Extension.jsm");
-
-/* eslint-disable mozilla/balanced-listeners */
-
-add_task(function* testShutdownCleanup() {
- is(GlobalManager.initialized, false,
- "GlobalManager start as not initialized");
-
- let extension = ExtensionTestUtils.loadExtension({
- background: function() {
- browser.test.notifyPass("background page loaded");
- },
- });
-
- yield extension.startup();
-
- yield extension.awaitFinish("background page loaded");
-
- is(GlobalManager.initialized, true,
- "GlobalManager has been initialized once an extension is started");
-
- yield extension.unload();
-
- is(GlobalManager.initialized, false,
- "GlobalManager has been uninitialized once all the webextensions have been stopped");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_storage_cleanup.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_storage_cleanup.html
deleted file mode 100644
index 010769500a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_storage_cleanup.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-// Test that storage used by a webextension (through localStorage,
-// indexedDB, and browser.storage.local) gets cleaned up when the
-// extension is uninstalled.
-add_task(function* test_uninstall() {
- function writeData() {
- localStorage.setItem("hello", "world");
-
- let idbPromise = new Promise((resolve, reject) => {
- let req = indexedDB.open("test");
- req.onerror = e => {
- reject(new Error(`indexedDB open failed with ${e.errorCode}`));
- };
-
- req.onupgradeneeded = e => {
- let db = e.target.result;
- db.createObjectStore("store", {keyPath: "name"});
- };
-
- req.onsuccess = e => {
- let db = e.target.result;
- let transaction = db.transaction("store", "readwrite");
- let addreq = transaction.objectStore("store")
- .add({name: "hello", value: "world"});
- addreq.onerror = addreqError => {
- reject(new Error(`add to indexedDB failed with ${addreqError.errorCode}`));
- };
- addreq.onsuccess = () => {
- resolve();
- };
- };
- });
-
- let browserStoragePromise = browser.storage.local.set({hello: "world"});
-
- Promise.all([idbPromise, browserStoragePromise]).then(() => {
- browser.test.sendMessage("finished");
- });
- }
-
- function readData() {
- let matchLocalStorage = (localStorage.getItem("hello") == "world");
-
- let idbPromise = new Promise((resolve, reject) => {
- let req = indexedDB.open("test");
- req.onerror = e => {
- reject(new Error(`indexedDB open failed with ${e.errorCode}`));
- };
-
- req.onupgradeneeded = e => {
- // no database, data is not present
- resolve(false);
- };
-
- req.onsuccess = e => {
- let db = e.target.result;
- let transaction = db.transaction("store", "readwrite");
- let addreq = transaction.objectStore("store").get("hello");
- addreq.onerror = addreqError => {
- reject(new Error(`read from indexedDB failed with ${addreqError.errorCode}`));
- };
- addreq.onsuccess = () => {
- let match = (addreq.result.value == "world");
- resolve(match);
- };
- };
- });
-
- let browserStoragePromise = browser.storage.local.get("hello").then(result => {
- return (Object.keys(result).length == 1 && result.hello == "world");
- });
-
- Promise.all([idbPromise, browserStoragePromise])
- .then(([matchIDB, matchBrowserStorage]) => {
- let result = {matchLocalStorage, matchIDB, matchBrowserStorage};
- browser.test.sendMessage("results", result);
- });
- }
-
- const ID = "storage.cleanup@tests.mozilla.org";
-
- // Use a test-only pref to leave the addonid->uuid mapping around after
- // uninstall so that we can re-attach to the same storage. Also set
- // the pref to prevent cleaning up storage on uninstall so we can test
- // that the "keep uuid" logic works correctly. Do the storage flag in
- // a separate prefEnv so we can pop it below, leaving the uuid flag set.
- yield SpecialPowers.pushPrefEnv({
- set: [["extensions.webextensions.keepUuidOnUninstall", true]],
- });
- yield SpecialPowers.pushPrefEnv({
- set: [["extensions.webextensions.keepStorageOnUninstall", true]],
- });
-
- let extension = ExtensionTestUtils.loadExtension({
- background: writeData,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["storage"],
- },
- useAddonManager: "temporary",
- });
-
- yield extension.startup();
- yield extension.awaitMessage("finished");
- yield extension.unload();
-
- // Check that we can still see data we wrote to storage but clear the
- // "leave storage" flag so our storaged gets cleared on uninstall.
- // This effectively tests the keepUuidOnUninstall logic, which ensures
- // that when we read storage again and check that it is cleared, that
- // it is actually a meaningful test!
- yield SpecialPowers.popPrefEnv();
- extension = ExtensionTestUtils.loadExtension({
- background: readData,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["storage"],
- },
- useAddonManager: "temporary",
- });
-
- yield extension.startup();
- let results = yield extension.awaitMessage("results");
- is(results.matchLocalStorage, true, "localStorage data is still present");
- is(results.matchIDB, true, "indexedDB data is still present");
- is(results.matchBrowserStorage, true, "browser.storage.local data is still present");
-
- yield extension.unload();
-
- // Read again. This time, our data should be gone.
- extension = ExtensionTestUtils.loadExtension({
- background: readData,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["storage"],
- },
- useAddonManager: "temporary",
- });
-
- yield extension.startup();
- results = yield extension.awaitMessage("results");
- is(results.matchLocalStorage, false, "localStorage data was cleared");
- is(results.matchIDB, false, "indexedDB data was cleared");
- is(results.matchBrowserStorage, false, "browser.storage.local data was cleared");
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_trustworthy_origin.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_trustworthy_origin.html
deleted file mode 100644
index 573c088065..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_trustworthy_origin.html
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/**
- * This test is asserting that moz-extension: URLs are recognized as trustworthy local origins
- */
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "gContentSecurityManager",
- "@mozilla.org/contentsecuritymanager;1",
- "nsIContentSecurityManager");
-
-add_task(function* () {
- function background() {
- browser.test.sendMessage("ready", browser.runtime.getURL("/test.html"));
- }
-
- let extensionData = {
- background,
- files: {
- "test.html": `<html><head></head><body></body></html>`,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let url = yield extension.awaitMessage("ready");
-
- let uri = NetUtil.newURI(url);
- let principal = Services.scriptSecurityManager.getCodebasePrincipal(uri);
- is(gContentSecurityManager.isOriginPotentiallyTrustworthy(principal), true);
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html
deleted file mode 100644
index 768eb31fd2..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_webnavigation_resolved_urls.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* webnav_unresolved_uri_on_expected_URI_scheme() {
- function background() {
- let checkURLs;
-
- browser.webNavigation.onCompleted.addListener(async msg => {
- if (checkURLs.length > 0) {
- let expectedURL = checkURLs.shift();
- browser.test.assertEq(expectedURL, msg.url, "Got the expected URL");
- await browser.tabs.remove(msg.tabId);
- browser.test.sendMessage("next");
- }
- });
-
- browser.test.onMessage.addListener((name, urls) => {
- if (name == "checkURLs") {
- checkURLs = urls;
- }
- });
-
- browser.test.sendMessage("ready", browser.runtime.getURL("/tab.html"));
- }
-
- let extensionData = {
- manifest: {
- permissions: [
- "webNavigation",
- ],
- },
- background,
- files: {
- "tab.html": `<!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- </head>
- </html>
- `,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- let checkURLs = [
- "resource://gre/modules/Services.jsm",
- "chrome://mochikit/content/tests/SimpleTest/SimpleTest.js",
- "about:mozilla",
- ];
-
- let tabURL = yield extension.awaitMessage("ready");
- checkURLs.push(tabURL);
-
- extension.sendMessage("checkURLs", checkURLs);
-
- for (let url of checkURLs) {
- window.open(url);
- yield extension.awaitMessage("next");
- }
-
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_webrequest_background_events.html b/toolkit/components/webextensions/test/mochitest/test_chrome_ext_webrequest_background_events.html
deleted file mode 100644
index a13c4d4754..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_ext_webrequest_background_events.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-Cu.import(SimpleTest.getTestFileURL("webrequest_test.jsm"));
-let {testFetch, testXHR} = webrequest_test;
-
-// Here we test that any requests originating from a system principal are not
-// accessible through WebRequest. text_ext_webrequest_background_events tests
-// non-system principal requests.
-
-let testExtension = {
- manifest: {
- permissions: [
- "webRequest",
- "<all_urls>",
- ],
- },
- background() {
- let eventNames = [
- "onBeforeRequest",
- "onBeforeSendHeaders",
- "onSendHeaders",
- "onHeadersReceived",
- "onResponseStarted",
- "onCompleted",
- ];
-
- function listener(name, details) {
- // If we get anything, we failed. Removing the system principal check
- // in ext-webrequest triggers this failure.
- browser.test.fail(`recieved ${name}`);
- }
-
- for (let name of eventNames) {
- browser.webRequest[name].addListener(
- listener.bind(null, name),
- {urls: ["https://example.com/*"]}
- );
- }
- },
-};
-
-add_task(function* test_webRequest_chromeworker_events() {
- let extension = ExtensionTestUtils.loadExtension(testExtension);
- yield extension.startup();
- yield new Promise(resolve => {
- let worker = new ChromeWorker("webrequest_chromeworker.js");
- worker.onmessage = event => {
- ok("chrome worker fetch finished");
- resolve();
- };
- worker.postMessage("go");
- });
- yield extension.unload();
-});
-
-add_task(function* test_webRequest_chromepage_events() {
- let extension = ExtensionTestUtils.loadExtension(testExtension);
- yield extension.startup();
- yield new Promise(resolve => {
- fetch("https://example.com/example.txt").then(() => {
- ok("test page loaded");
- resolve();
- });
- });
- yield extension.unload();
-});
-
-add_task(function* test_webRequest_jsm_events() {
- let extension = ExtensionTestUtils.loadExtension(testExtension);
- yield extension.startup();
- yield testFetch("https://example.com/example.txt").then(() => {
- ok("fetch page loaded");
- });
- yield testXHR("https://example.com/example.txt").then(() => {
- ok("xhr page loaded");
- });
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_chrome_native_messaging_paths.html b/toolkit/components/webextensions/test/mochitest/test_chrome_native_messaging_paths.html
deleted file mode 100644
index 29a148063e..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_chrome_native_messaging_paths.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" href="chrome://mochikit/contents/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/* global OS */
-
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-// Test that the default paths searched for native host manifests
-// are the ones we expect.
-add_task(function* test_default_paths() {
- let expectUser, expectGlobal;
- switch (AppConstants.platform) {
- case "macosx": {
- expectUser = OS.Path.join(OS.Constants.Path.homeDir,
- "Library/Application Support/Mozilla/NativeMessagingHosts");
- expectGlobal = "/Library/Application Support/Mozilla/NativeMessagingHosts";
-
- break;
- }
-
- case "linux": {
- expectUser = OS.Path.join(OS.Constants.Path.homeDir, ".mozilla/native-messaging-hosts");
-
- const libdir = AppConstants.HAVE_USR_LIB64_DIR ? "lib64" : "lib";
- expectGlobal = OS.Path.join("/usr", libdir, "mozilla/native-messaging-hosts");
- break;
- }
-
- default:
- // Fixed filesystem paths are only defined for MacOS and Linux,
- // there's nothing to test on other platforms.
- ok(false, `This test does not apply on ${AppConstants.platform}`);
- break;
- }
-
- let userDir = Services.dirsvc.get("XREUserNativeMessaging", Ci.nsIFile).path;
- is(userDir, expectUser, "user-specific native messaging directory is correct");
-
- let globalDir = Services.dirsvc.get("XRESysNativeMessaging", Ci.nsIFile).path;
- is(globalDir, expectGlobal, "system-wide native messaing directory is correct");
-});
-
-</script>
-
-</body>
-</html>
-
diff --git a/toolkit/components/webextensions/test/mochitest/test_clipboard.html b/toolkit/components/webextensions/test/mochitest/test_clipboard.html
deleted file mode 100644
index 900ee5f108..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_clipboard.html
+++ /dev/null
@@ -1,140 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>clipboard permission test</title>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script src="head.js"></script>
- <link rel="stylesheet" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-function doCopy(txt) {
- let field = document.createElement("textarea");
- document.body.appendChild(field);
- field.value = txt;
- field.select();
- return document.execCommand("copy");
-}
-
-add_task(function* no_permission_deny_copy() {
- function backgroundScript() {
- browser.test.assertEq(false, doCopy("whatever"),
- "copy should be denied without permission");
- browser.test.sendMessage("ready");
- }
- let extensionData = {
- background: `${doCopy};(${backgroundScript})();`,
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitMessage("ready");
-
- yield extension.unload();
-});
-
-/** Selecting text in a bg page is not possible, skip test until it's fixed.
-add_task(function* with_permission_allow_copy() {
- function backgroundScript() {
- browser.test.onMessage.addListener(txt => {
- browser.test.assertEq(true, doCopy(txt),
- "copy should be allowed with permission");
- });
- browser.test.sendMessage("ready");
- }
- let extensionData = {
- background: `${doCopy};(${backgroundScript})();`,
- manifest: {
- permissions: [
- "clipboardWrite",
- ],
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- const DUMMY_STR = "dummy string to copy";
- yield new Promise(resolve => {
- SimpleTest.waitForClipboard(DUMMY_STR, () => {
- extension.sendMessage(DUMMY_STR);
- }, resolve, resolve);
- });
-
- yield extension.unload();
-}); */
-
-add_task(function* content_script_no_permission_deny_copy() {
- function contentScript() {
- browser.test.assertEq(false, doCopy("whatever"),
- "copy should be denied without permission");
- browser.test.sendMessage("ready");
- }
- let extensionData = {
- manifest: {
- content_scripts: [{
- js: ["contentscript.js"],
- matches: ["http://mochi.test/*/file_sample.html"],
- }],
- },
- files: {
- "contentscript.js": `${doCopy};(${contentScript})();`,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield extension.awaitMessage("ready");
- win.close();
-
- yield extension.unload();
-});
-
-add_task(function* content_script_with_permission_allow_copy() {
- function contentScript() {
- browser.test.onMessage.addListener(txt => {
- browser.test.assertEq(true, doCopy(txt),
- "copy should be allowed with permission");
- });
- browser.test.sendMessage("ready");
- }
- let extensionData = {
- manifest: {
- content_scripts: [{
- js: ["contentscript.js"],
- matches: ["http://mochi.test/*/file_sample.html"],
- }],
- permissions: [
- "clipboardWrite",
- ],
- },
- files: {
- "contentscript.js": `${doCopy};(${contentScript})();`,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield extension.awaitMessage("ready");
-
- const DUMMY_STR = "dummy string to copy in content script";
- yield new Promise(resolve => {
- SimpleTest.waitForClipboard(DUMMY_STR, () => {
- extension.sendMessage(DUMMY_STR);
- }, resolve, resolve);
- });
-
- win.close();
-
- yield extension.unload();
-});
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_all_apis.js b/toolkit/components/webextensions/test/mochitest/test_ext_all_apis.js
deleted file mode 100644
index 25d04b36b6..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_all_apis.js
+++ /dev/null
@@ -1,160 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-// Tests whether not too many APIs are visible by default.
-// This file is used by test_ext_all_apis.html in browser/ and mobile/android/,
-// which may modify the following variables to add or remove expected APIs.
-/* globals expectedContentApisTargetSpecific */
-/* globals expectedBackgroundApisTargetSpecific */
-
-// Generates a list of expectations.
-function generateExpectations(list) {
- return list.reduce((allApis, path) => {
- return allApis.concat(`browser.${path}`, `chrome.${path}`);
- }, []).sort();
-}
-
-let expectedCommonApis = [
- "extension.getURL",
- "extension.inIncognitoContext",
- "extension.lastError",
- "i18n.detectLanguage",
- "i18n.getAcceptLanguages",
- "i18n.getMessage",
- "i18n.getUILanguage",
- "runtime.OnInstalledReason",
- "runtime.OnRestartRequiredReason",
- "runtime.PlatformArch",
- "runtime.PlatformOs",
- "runtime.RequestUpdateCheckStatus",
- "runtime.getManifest",
- "runtime.connect",
- "runtime.getURL",
- "runtime.id",
- "runtime.lastError",
- "runtime.onConnect",
- "runtime.onMessage",
- "runtime.sendMessage",
- // If you want to add a new powerful test API, please see bug 1287233.
- "test.assertEq",
- "test.assertFalse",
- "test.assertRejects",
- "test.assertThrows",
- "test.assertTrue",
- "test.fail",
- "test.log",
- "test.notifyFail",
- "test.notifyPass",
- "test.onMessage",
- "test.sendMessage",
- "test.succeed",
-];
-
-let expectedContentApis = [
- ...expectedCommonApis,
- ...expectedContentApisTargetSpecific,
-];
-
-let expectedBackgroundApis = [
- ...expectedCommonApis,
- ...expectedBackgroundApisTargetSpecific,
- "extension.ViewType",
- "extension.getBackgroundPage",
- "extension.getViews",
- "extension.isAllowedFileSchemeAccess",
- "extension.isAllowedIncognitoAccess",
- // Note: extensionTypes is not visible in Chrome.
- "extensionTypes.ImageFormat",
- "extensionTypes.RunAt",
- "management.ExtensionDisabledReason",
- "management.ExtensionInstallType",
- "management.ExtensionType",
- "management.getSelf",
- "management.uninstallSelf",
- "runtime.getBackgroundPage",
- "runtime.getBrowserInfo",
- "runtime.getPlatformInfo",
- "runtime.onConnectExternal",
- "runtime.onInstalled",
- "runtime.onMessageExternal",
- "runtime.onStartup",
- "runtime.onUpdateAvailable",
- "runtime.openOptionsPage",
- "runtime.reload",
- "runtime.setUninstallURL",
-];
-
-function sendAllApis() {
- function isEvent(key, val) {
- if (!/^on[A-Z]/.test(key)) {
- return false;
- }
- let eventKeys = [];
- for (let prop in val) {
- eventKeys.push(prop);
- }
- eventKeys = eventKeys.sort().join();
- return eventKeys === "addListener,hasListener,removeListener";
- }
- function mayRecurse(key, val) {
- if (Object.keys(val).filter(k => !/^[A-Z\-0-9_]+$/.test(k)).length === 0) {
- // Don't recurse on constants and empty objects.
- return false;
- }
- return !isEvent(key, val);
- }
-
- let results = [];
- function diveDeeper(path, obj) {
- for (let key in obj) {
- let val = obj[key];
- if (typeof val == "object" && val !== null && mayRecurse(key, val)) {
- diveDeeper(`${path}.${key}`, val);
- } else if (val !== undefined) {
- results.push(`${path}.${key}`);
- }
- }
- }
- diveDeeper("browser", browser);
- diveDeeper("chrome", chrome);
- browser.test.sendMessage("allApis", results.sort());
-}
-
-add_task(function* test_enumerate_content_script_apis() {
- let extensionData = {
- manifest: {
- content_scripts: [{
- matches: ["http://mochi.test/*/file_sample.html"],
- js: ["contentscript.js"],
- run_at: "document_start",
- }],
- },
- files: {
- "contentscript.js": sendAllApis,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- let actualApis = yield extension.awaitMessage("allApis");
- win.close();
- let expectedApis = generateExpectations(expectedContentApis);
- isDeeply(actualApis, expectedApis, "content script APIs");
-
- yield extension.unload();
-});
-
-add_task(function* test_enumerate_background_script_apis() {
- let extensionData = {
- background: sendAllApis,
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- let actualApis = yield extension.awaitMessage("allApis");
- let expectedApis = generateExpectations(expectedBackgroundApis);
- isDeeply(actualApis, expectedApis, "background script APIs");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_background_api_injection.html b/toolkit/components/webextensions/test/mochitest/test_ext_background_api_injection.html
deleted file mode 100644
index f43a59f816..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_background_api_injection.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for privilege escalation into content pages</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* testBackgroundWindow() {
- let extension = ExtensionTestUtils.loadExtension({
- background: function() {
- const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
-
- browser.test.log("background script executed");
- window.location = `${BASE}/file_privilege_escalation.html`;
- },
- });
-
- let awaitConsole = new Promise(resolve => {
- let chromeScript = SpecialPowers.loadChromeScript(
- SimpleTest.getTestFileURL("file_ext_test_api_injection.js"));
-
- chromeScript.addMessageListener("console-message", resolve);
- });
-
- yield extension.startup();
-
- let message = yield awaitConsole;
-
- ok(message.message.includes("WebExt Privilege Escalation: typeof(browser) = undefined"),
- "Document does not have `browser` APIs.");
-
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_background_canvas.html b/toolkit/components/webextensions/test/mochitest/test_ext_background_canvas.html
deleted file mode 100644
index bff7190cb2..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_background_canvas.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for background page canvas rendering</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_background_canvas() {
- function background() {
- try {
- let canvas = document.createElement("canvas");
-
- let context = canvas.getContext("2d");
-
- // This ensures that we have a working PresShell, and can successfully
- // calculate font metrics.
- context.font = "8pt fixed";
-
- browser.test.notifyPass("background-canvas");
- } catch (e) {
- browser.test.fail(`Error: ${e} :: ${e.stack}`);
- browser.test.notifyFail("background-canvas");
- }
- }
-
- let extensionData = {
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
- yield extension.awaitFinish("background-canvas");
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_background_generated_url.html b/toolkit/components/webextensions/test/mochitest/test_ext_background_generated_url.html
deleted file mode 100644
index f4fcf3d341..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_background_generated_url.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test _generated_background_page.html</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-add_task(function* test_url_of_generated_background_page() {
- function backgroundScript() {
- const EXPECTED_URL = browser.runtime.getURL("/_generated_background_page.html");
- browser.test.assertEq(EXPECTED_URL, location.href);
- browser.test.sendMessage("script done", EXPECTED_URL);
- }
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- background: {
- scripts: ["bg.js"],
- },
- web_accessible_resources: ["_generated_background_page.html"],
- },
- files: {
- "bg.js": backgroundScript,
- },
- });
-
- yield extension.startup();
- const EXPECTED_URL = yield extension.awaitMessage("script done");
-
- let win = window.open(EXPECTED_URL);
- ok(win, "Should open new tab at URL: " + EXPECTED_URL);
- yield extension.awaitMessage("script done");
- win.close();
-
- yield extension.unload();
-});
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_background_teardown.html b/toolkit/components/webextensions/test/mochitest/test_ext_background_teardown.html
deleted file mode 100644
index bb6b2e9709..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_background_teardown.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for background script teardown</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-add_task(function* test_background_reload_and_unload() {
- function background() {
- browser.test.onMessage.addListener(msg => {
- browser.test.assertEq("reload-background", msg);
- location.reload();
- });
- browser.test.sendMessage("background-url", location.href);
- }
-
- let chromeScript = SpecialPowers.loadChromeScript(
- SimpleTest.getTestFileURL("file_teardown_test.js"));
- yield chromeScript.promiseOneMessage("chromescript-startup");
-
- let extensionData = {
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- function* getContextEvents() {
- chromeScript.sendAsyncMessage("get-context-events");
- let contextEvents = yield chromeScript.promiseOneMessage("context-events");
- return contextEvents.filter(event => event.extensionId == extension.id);
- }
- yield extension.startup();
- let backgroundUrl = yield extension.awaitMessage("background-url");
-
- let contextEvents = yield* getContextEvents();
- is(contextEvents.length, 1,
- "ExtensionContext state change after loading an extension");
- is(contextEvents[0].eventType, "load");
- is(contextEvents[0].url, backgroundUrl,
- "The ExtensionContext should be the background page");
-
- extension.sendMessage("reload-background");
- yield extension.awaitMessage("background-url");
-
- contextEvents = yield* getContextEvents();
- is(contextEvents.length, 2,
- "ExtensionContext state changes after reloading the background page");
- is(contextEvents[0].eventType, "unload",
- "Unload ExtensionContext of background page");
- is(contextEvents[0].url, backgroundUrl, "ExtensionContext URL = background");
- is(contextEvents[1].eventType, "load",
- "Create new ExtensionContext for background page");
- is(contextEvents[1].url, backgroundUrl, "ExtensionContext URL = background");
- yield extension.unload();
-
- contextEvents = yield* getContextEvents();
- is(contextEvents.length, 1,
- "ExtensionContext state change after unloading the extension");
- is(contextEvents[0].eventType, "unload",
- "Unload ExtensionContext for background page after extension unloads");
- is(contextEvents[0].url, backgroundUrl, "ExtensionContext URL = background");
-
- chromeScript.sendAsyncMessage("cleanup");
- chromeScript.destroy();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_content_security_policy.html b/toolkit/components/webextensions/test/mochitest/test_ext_content_security_policy.html
deleted file mode 100644
index a36f295631..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_content_security_policy.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension CSP test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/**
- * Tests that content security policies for an add-on are actually applied to *
- * documents that belong to it. This tests both the base policies and add-on
- * specific policies, and ensures that the parsed policies applied to the
- * document's principal match what was specified in the policy string.
- *
- * @param {object} [customCSP]
- */
-function* testPolicy(customCSP = null) {
- let baseURL;
-
- let baseCSP = {
- "object-src": ["blob:", "filesystem:", "https://*", "moz-extension:", "'self'"],
- "script-src": ["'unsafe-eval'", "'unsafe-inline'", "blob:", "filesystem:", "https://*", "moz-extension:", "'self'"],
- };
-
- let addonCSP = {
- "object-src": ["'self'"],
- "script-src": ["'self'"],
- };
-
- let content_security_policy = null;
-
- if (customCSP) {
- for (let key of Object.keys(customCSP)) {
- addonCSP[key] = customCSP[key].split(/\s+/);
- }
-
- content_security_policy = Object.keys(customCSP)
- .map(key => `${key} ${customCSP[key]}`)
- .join("; ");
- }
-
-
- function filterSelf(sources) {
- return sources.map(src => src == "'self'" ? baseURL : src);
- }
-
- function checkSource(name, policy, expected) {
- is(JSON.stringify(policy[name].sort()),
- JSON.stringify(filterSelf(expected[name]).sort()),
- `Expected value for ${name}`);
- }
-
- function checkCSP(csp, location) {
- let policies = csp["csp-policies"];
-
- info(`Base policy for ${location}`);
-
- is(policies[0]["report-only"], false, "Policy is not report-only");
- checkSource("object-src", policies[0], baseCSP);
- checkSource("script-src", policies[0], baseCSP);
-
- info(`Add-on policy for ${location}`);
-
- is(policies[1]["report-only"], false, "Policy is not report-only");
- checkSource("object-src", policies[1], addonCSP);
- checkSource("script-src", policies[1], addonCSP);
- }
-
-
- function getCSP(window) {
- let {cspJSON} = SpecialPowers.Cu.getObjectPrincipal(window);
- return JSON.parse(cspJSON);
- }
-
- function background(getCSPFn) {
- browser.test.sendMessage("base-url", browser.extension.getURL("").replace(/\/$/, ""));
-
- browser.test.sendMessage("background-csp", getCSPFn(window));
- }
-
- function tabScript(getCSPFn) {
- browser.test.sendMessage("tab-csp", getCSPFn(window));
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${background})(${getCSP})`,
-
- files: {
- "tab.html": `<html><head><meta charset="utf-8">
- <script src="tab.js"></${"script"}></head></html>`,
-
- "tab.js": `(${tabScript})(${getCSP})`,
-
- "content.html": `<html><head><meta charset="utf-8"></head></html>`,
- },
-
- manifest: {
- content_security_policy,
-
- web_accessible_resources: ["content.html", "tab.html"],
- },
- });
-
-
- info(`Testing CSP for policy: ${content_security_policy}`);
-
- yield extension.startup();
-
- baseURL = yield extension.awaitMessage("base-url");
-
-
- let win1 = window.open(`${baseURL}/tab.html`);
-
- let frame = document.createElement("iframe");
- frame.src = `${baseURL}/content.html`;
- document.body.appendChild(frame);
-
- yield new Promise(resolve => {
- frame.onload = resolve;
- });
-
-
- let backgroundCSP = yield extension.awaitMessage("background-csp");
- checkCSP(backgroundCSP, "background page");
-
- let tabCSP = yield extension.awaitMessage("tab-csp");
- checkCSP(tabCSP, "tab page");
-
- let contentCSP = getCSP(frame.contentWindow);
- checkCSP(contentCSP, "content frame");
-
-
- win1.close();
- frame.remove();
-
- yield extension.unload();
-}
-
-add_task(function* testCSP() {
- yield testPolicy(null);
-
- let hash = "'sha256-NjZhMDQ1YjQ1MjEwMmM1OWQ4NDBlYzA5N2Q1OWQ5NDY3ZTEzYTNmMzRmNjQ5NGU1MzlmZmQzMmMxYmIzNWYxOCAgLQo='";
-
- yield testPolicy({
- "object-src": "'self' https://*.example.com",
- "script-src": `'self' https://*.example.com 'unsafe-eval' ${hash}`,
- });
-
- yield testPolicy({
- "object-src": "'none'",
- "script-src": `'self'`,
- });
-});
-</script>
-</body>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript.html
deleted file mode 100644
index 39f1bfabd0..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript() {
- function background() {
- browser.runtime.onMessage.addListener(([msg, expectedStates, readyState], sender) => {
- if (msg == "chrome-namespace-ok") {
- browser.test.sendMessage(msg);
- return;
- }
-
- browser.test.assertEq("script-run", msg, "message type is correct");
- browser.test.assertTrue(expectedStates.includes(readyState),
- `readyState "${readyState}" is one of [${expectedStates}]`);
- browser.test.sendMessage("script-run-" + expectedStates[0]);
- });
- }
-
- function contentScriptStart() {
- browser.runtime.sendMessage(["script-run", ["loading"], document.readyState]);
- }
- function contentScriptEnd() {
- browser.runtime.sendMessage(["script-run", ["interactive", "complete"], document.readyState]);
- }
- function contentScriptIdle() {
- browser.runtime.sendMessage(["script-run", ["complete"], document.readyState]);
- }
-
- function contentScript() {
- let manifest = browser.runtime.getManifest();
- void manifest.applications.gecko.id;
- chrome.runtime.sendMessage(["chrome-namespace-ok"]);
- }
-
- let extensionData = {
- manifest: {
- applications: {gecko: {id: "contentscript@tests.mozilla.org"}},
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script_start.js"],
- "run_at": "document_start",
- },
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script_end.js"],
- "run_at": "document_end",
- },
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script_idle.js"],
- "run_at": "document_idle",
- },
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- },
- ],
- },
- background,
-
- files: {
- "content_script_start.js": contentScriptStart,
- "content_script_end.js": contentScriptEnd,
- "content_script_idle.js": contentScriptIdle,
- "content_script.js": contentScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- let loadingCount = 0;
- let interactiveCount = 0;
- let completeCount = 0;
- extension.onMessage("script-run-loading", () => { loadingCount++; });
- extension.onMessage("script-run-interactive", () => { interactiveCount++; });
-
- let completePromise = new Promise(resolve => {
- extension.onMessage("script-run-complete", () => { completeCount++; resolve(); });
- });
-
- let chromeNamespacePromise = extension.awaitMessage("chrome-namespace-ok");
-
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), completePromise, chromeNamespacePromise]);
- info("test page loaded");
-
- win.close();
-
- is(loadingCount, 1, "document_start script ran exactly once");
- is(interactiveCount, 1, "document_end script ran exactly once");
- is(completeCount, 1, "document_idle script ran exactly once");
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_about_blank.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_about_blank.html
deleted file mode 100644
index 3766678e71..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_about_blank.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <title>Test content script match_about_blank option</title>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript_about_blank() {
- const manifest = {
- content_scripts: [
- {
- match_about_blank: true,
- matches: ["http://mochi.test/*/file_with_about_blank.html", "http://example.com/*"],
- all_frames: true,
- css: ["all.css"],
- js: ["all.js"],
- }, {
- matches: ["http://mochi.test/*/file_with_about_blank.html"],
- css: ["mochi_without.css"],
- js: ["mochi_without.js"],
- all_frames: true,
- }, {
- match_about_blank: true,
- matches: ["http://mochi.test/*/file_with_about_blank.html"],
- css: ["mochi_with.css"],
- js: ["mochi_with.js"],
- all_frames: true,
- },
- ],
- };
-
- const files = {
- "all.js": function() {
- browser.runtime.sendMessage("all");
- },
- "all.css": `
- body { color: red; }
- `,
- "mochi_without.js": function() {
- browser.runtime.sendMessage("mochi_without");
- },
- "mochi_without.css": `
- body { background: yellow; }
- `,
- "mochi_with.js": function() {
- browser.runtime.sendMessage("mochi_with");
- },
- "mochi_with.css": `
- body { text-align: right; }
- `,
- };
-
- function background() {
- browser.runtime.onMessage.addListener((script, {url}) => {
- const kind = url.startsWith("about:") ? url : "top";
- browser.test.sendMessage("script", [script, kind, url]);
- browser.test.sendMessage(`${script}:${kind}`);
- });
- }
-
- const PATH = "tests/toolkit/components/extensions/test/mochitest/file_with_about_blank.html";
- const extension = ExtensionTestUtils.loadExtension({manifest, files, background});
- yield extension.startup();
-
- let count = 0;
- extension.onMessage("script", script => {
- info(`script ran: ${script}`);
- count++;
- });
-
- let win = window.open("http://example.com/" + PATH);
- yield Promise.all([
- extension.awaitMessage("all:top"),
- extension.awaitMessage("all:about:blank"),
- extension.awaitMessage("all:about:srcdoc"),
- ]);
- is(count, 3, "exactly 3 scripts ran");
- win.close();
-
- win = window.open("http://mochi.test:8888/" + PATH);
- yield Promise.all([
- extension.awaitMessage("all:top"),
- extension.awaitMessage("all:about:blank"),
- extension.awaitMessage("all:about:srcdoc"),
- extension.awaitMessage("mochi_without:top"),
- extension.awaitMessage("mochi_with:top"),
- extension.awaitMessage("mochi_with:about:blank"),
- extension.awaitMessage("mochi_with:about:srcdoc"),
- ]);
-
- let style = win.getComputedStyle(win.document.body);
- is(style.color, "rgb(255, 0, 0)", "top window text color is red");
- is(style.backgroundColor, "rgb(255, 255, 0)", "top window background is yellow");
- is(style.textAlign, "right", "top window text is right-aligned");
-
- let a_b = win.document.getElementById("a_b");
- style = a_b.contentWindow.getComputedStyle(a_b.contentDocument.body);
- is(style.color, "rgb(255, 0, 0)", "about:blank iframe text color is red");
- is(style.backgroundColor, "transparent", "about:blank iframe background is transparent");
- is(style.textAlign, "right", "about:blank text is right-aligned");
-
- is(count, 10, "exactly 7 more scripts ran");
- win.close();
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_api_injection.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_api_injection.html
deleted file mode 100644
index abf3d349fb..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_api_injection.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for privilege escalation into iframe with content script APIs</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<!-- WORKAROUND: this textarea hack is used to contain the html page source without escaping it -->
-<textarea id="test-asset">
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <script type="text/javascript" src="./content_script_iframe.js">
- </script>
- </head>
- </html>
-</textarea>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript_api_injection() {
- function contentScript() {
- let iframe = document.createElement("iframe");
- iframe.setAttribute("src", browser.runtime.getURL("content_script_iframe.html"));
- document.body.appendChild(iframe);
- }
-
- function contentScriptIframe() {
- const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
- window.location = `${BASE}/file_privilege_escalation.html`;
- }
-
- let extensionData = {
- manifest: {
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- },
- ],
- "web_accessible_resources": [
- "content_script_iframe.html",
- ],
- },
-
- files: {
- "content_script.js": contentScript,
- "content_script_iframe.js": contentScriptIframe,
- "content_script_iframe.html": document.querySelector("#test-asset").textContent,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- let awaitConsole = new Promise(resolve => {
- let chromeScript = SpecialPowers.loadChromeScript(
- SimpleTest.getTestFileURL("file_ext_test_api_injection.js"));
-
- chromeScript.addMessageListener("console-message", resolve);
- });
-
- yield extension.startup();
- info("extension loaded");
-
- let win = window.open("file_sample.html");
-
- let message = yield awaitConsole;
-
- ok(message.message.includes("WebExt Privilege Escalation: typeof(browser) = undefined"),
- "Document does not have `browser` APIs.");
-
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_async_loading.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_async_loading.html
deleted file mode 100644
index d78f7ce02c..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_async_loading.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!doctype html>
-<html>
-<head>
- <title>Test content script async loading</title>
- <script src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<script>
-"use strict";
-
-add_task(function* test_async_loading() {
- const adder = `(function add(a = 1) { this.count += a; })();\n`;
- const extension = ExtensionTestUtils.loadExtension({
- manifest: {
- content_scripts: [{
- matches: ["https://example.org/"],
- js: ["first.js", "second.js"],
- }],
- },
- files: {
- "first.js": `
- this.count = 0;
- ${adder.repeat(50000)}; // 2Mb
- browser.test.assertEq(this.count, 50000, "A 50k line script");
-
- this.order = (this.order || 0) + 1;
- browser.test.sendMessage("first", this.order);
- `,
- "second.js": `
- this.order = (this.order || 0) + 1;
- browser.test.sendMessage("second", this.order);
- `,
- },
- });
-
- yield extension.startup();
- const win = window.open("https://example.org/");
-
- const [first, second] = yield Promise.all([
- extension.awaitMessage("first"),
- extension.awaitMessage("second"),
- ]);
-
- is(first, 1, "first.js finished execution first.");
- is(second, 2, "second.js finished execution second.");
-
- yield extension.unload();
- win.close();
-});
-
-</script>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_context.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_context.html
deleted file mode 100644
index 97b1645dd2..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_context.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script contexts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/* eslint-disable mozilla/balanced-listeners */
-
-add_task(function* test_contentscript_context() {
- function contentScript() {
- browser.test.sendMessage("content-script-ready");
-
- window.addEventListener("pagehide", () => {
- browser.test.sendMessage("content-script-hide");
- }, true);
- window.addEventListener("pageshow", () => {
- browser.test.sendMessage("content-script-show");
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- content_scripts: [{
- "matches": ["http://example.com/"],
- "js": ["content_script.js"],
- "run_at": "document_start",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
- });
-
- yield extension.startup();
-
- let win = window.open("http://example.com/");
- yield extension.awaitMessage("content-script-ready");
- yield extension.awaitMessage("content-script-show");
-
- // Get the content script context and check that it points to the correct window.
-
- let {DocumentManager} = SpecialPowers.Cu.import("resource://gre/modules/ExtensionContent.jsm", {});
- let context = DocumentManager.getContentScriptContext(extension, win);
- ok(context != null, "Got content script context");
-
- is(SpecialPowers.unwrap(context.contentWindow), win, "Context's contentWindow property is correct");
-
- // Navigate so that the content page is hidden in the bfcache.
-
- win.location = "http://example.org/";
- yield extension.awaitMessage("content-script-hide");
-
- is(context.contentWindow, null, "Context's contentWindow property is null");
-
- // Navigate back so the content page is resurrected from the bfcache.
-
- SpecialPowers.wrap(win).history.back();
- yield extension.awaitMessage("content-script-show");
-
- is(SpecialPowers.unwrap(context.contentWindow), win, "Context's contentWindow property is correct");
-
- win.close();
-
- yield extension.awaitMessage("content-script-hide");
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_create_iframe.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_create_iframe.html
deleted file mode 100644
index 8aac3e213c..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_create_iframe.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<!-- WORKAROUND: this textarea hack is used to contain the html page source without escaping it -->
-<textarea id="test-asset">
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="utf-8">
- <script type="text/javascript" src="content_script_iframe.js"></script>
- </head>
- </html>
-</textarea>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript_create_iframe() {
- function background() {
- browser.runtime.onMessage.addListener((msg, sender) => {
- let {name, availableAPIs, manifest, testGetManifest} = msg;
- let hasExtTabsAPI = availableAPIs.indexOf("tabs") > 0;
- let hasExtWindowsAPI = availableAPIs.indexOf("windows") > 0;
-
- browser.test.assertFalse(hasExtTabsAPI, "the created iframe should not be able to use privileged APIs (tabs)");
- browser.test.assertFalse(hasExtWindowsAPI, "the created iframe should not be able to use privileged APIs (windows)");
-
- let {applications: {gecko: {id: expectedManifestGeckoId}}} = chrome.runtime.getManifest();
- let {applications: {gecko: {id: actualManifestGeckoId}}} = manifest;
-
- browser.test.assertEq(actualManifestGeckoId, expectedManifestGeckoId,
- "the add-on manifest should be accessible from the created iframe"
- );
-
- let {applications: {gecko: {id: testGetManifestGeckoId}}} = testGetManifest;
-
- browser.test.assertEq(testGetManifestGeckoId, expectedManifestGeckoId,
- "GET_MANIFEST() returns manifest data before extension unload"
- );
-
- browser.test.sendMessage(name);
- });
- }
-
- function contentScript() {
- let iframe = document.createElement("iframe");
- iframe.setAttribute("src", browser.runtime.getURL("content_script_iframe.html"));
- document.body.appendChild(iframe);
- }
-
- function contentScriptIframe() {
- window.GET_MANIFEST = browser.runtime.getManifest.bind(null);
-
- window.testGetManifestException = () => {
- try {
- window.GET_MANIFEST();
- } catch (exception) {
- return String(exception);
- }
- };
-
- let testGetManifest = window.GET_MANIFEST();
-
- let manifest = browser.runtime.getManifest();
- let availableAPIs = Object.keys(browser);
-
- browser.runtime.sendMessage({
- name: "content-script-iframe-loaded",
- availableAPIs,
- manifest,
- testGetManifest,
- });
- }
-
- const ID = "contentscript@tests.mozilla.org";
- let extensionData = {
- manifest: {
- applications: {gecko: {id: ID}},
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- },
- ],
- web_accessible_resources: [
- "content_script_iframe.html",
- ],
- },
-
- background,
-
- files: {
- "content_script.js": contentScript,
- "content_script_iframe.html": document.querySelector("#test-asset").textContent,
- "content_script_iframe.js": contentScriptIframe,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- let contentScriptIframeCreatedPromise = new Promise(resolve => {
- extension.onMessage("content-script-iframe-loaded", () => { resolve(); });
- });
-
- yield extension.startup();
- info("extension loaded");
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), contentScriptIframeCreatedPromise]);
- info("content script privileged iframe loaded and executed");
-
- info("testing APIs availability once the extension is unloaded...");
-
- let iframeWindow = SpecialPowers.wrap(win)[0];
-
- ok(iframeWindow, "content script enabled iframe found");
- ok(/content_script_iframe\.html$/.test(iframeWindow.location), "the found iframe has the expected URL");
-
- yield extension.unload();
- info("extension unloaded");
-
- info("test content script APIs not accessible from the frame once the extension is unloaded");
-
- let ww = SpecialPowers.Cu.waiveXrays(iframeWindow);
- let isDeadWrapper = SpecialPowers.Cu.isDeadWrapper(ww.browser);
- ok(!isDeadWrapper, "the API object should not be a dead object");
-
- let manifest;
- let manifestException;
-
- try {
- manifest = ww.browser.runtime.getManifest();
- } catch (e) {
- manifestException = e;
- }
-
- ok(!manifest, "manifest should be undefined");
-
- is(String(manifestException), "TypeError: ww.browser.runtime is undefined",
- "expected exception received");
-
- let getManifestException = ww.testGetManifestException();
-
- is(getManifestException, "TypeError: can't access dead object",
- "expected exception received");
-
- win.close();
-
- info("done");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_css.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_css.html
deleted file mode 100644
index 5630a1d680..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_css.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_content_script_css() {
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "css": ["content.css"],
- }],
- },
-
- files: {
- "content.css": "body { max-width: 42px; }",
- },
- });
-
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield waitForLoad(win);
-
- let style = win.getComputedStyle(win.document.body);
- is(style.maxWidth, "42px", "Stylesheet correctly applied");
-
- yield extension.unload();
-
- style = win.getComputedStyle(win.document.body);
- is(style.maxWidth, "none", "Stylesheet correctly removed");
-
- win.close();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_devtools_metadata.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_devtools_metadata.html
deleted file mode 100644
index 137a3cda48..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_devtools_metadata.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Sandbox metadata on WebExtensions ContentScripts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript_devtools_sandbox_metadata() {
- function contentScript() {
- browser.runtime.sendMessage("contentScript.executed");
- }
-
- function background() {
- browser.runtime.onMessage.addListener((msg) => {
- if (msg == "contentScript.executed") {
- browser.test.notifyPass("contentScript.executed");
- }
- });
- }
-
- let extensionData = {
- manifest: {
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- },
- ],
- },
-
- background,
- files: {
- "content_script.js": contentScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- let innerWindowID = SpecialPowers.wrap(win)
- .QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
- .getInterface(SpecialPowers.Ci.nsIDOMWindowUtils)
- .currentInnerWindowID;
-
- yield extension.awaitFinish("contentScript.executed");
-
- const {ExtensionContent} = SpecialPowers.Cu.import(
- "resource://gre/modules/ExtensionContent.jsm", {}
- );
-
- let res = ExtensionContent.getContentScriptGlobalsForWindow(win);
- is(res.length, 1, "Got the expected array of globals");
- let metadata = SpecialPowers.Cu.getSandboxMetadata(res[0]) || {};
-
- is(metadata.addonId, extension.id, "Got the expected addonId");
- is(metadata["inner-window-id"], innerWindowID, "Got the expected inner-window-id");
-
- yield extension.unload();
- info("extension unloaded");
-
- res = ExtensionContent.getContentScriptGlobalsForWindow(win);
- is(res.length, 0, "No content scripts globals found once the extension is unloaded");
-
- win.close();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_exporthelpers.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_exporthelpers.html
deleted file mode 100644
index f3414901d6..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_exporthelpers.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-add_task(function* test_contentscript_exportHelpers() {
- function contentScript() {
- browser.test.assertTrue(typeof cloneInto === "function");
- browser.test.assertTrue(typeof createObjectIn === "function");
- browser.test.assertTrue(typeof exportFunction === "function");
-
- /* globals exportFunction, precisePi, reportPi */
- let value = 3.14;
- exportFunction(() => value, window, {defineAs: "precisePi"});
-
- browser.test.assertEq("undefined", typeof precisePi,
- "exportFunction should export to the page's scope only");
-
- browser.test.assertEq("undefined", typeof window.precisePi,
- "exportFunction should export to the page's scope only");
-
- let results = [];
- exportFunction(pi => results.push(pi), window, {defineAs: "reportPi"});
-
- let s = document.createElement("script");
- s.textContent = `(${function() {
- let result1 = "unknown 1";
- let result2 = "unknown 2";
- try {
- result1 = precisePi();
- } catch (e) {
- result1 = "err:" + e;
- }
- try {
- result2 = window.precisePi();
- } catch (e) {
- result2 = "err:" + e;
- }
- reportPi(result1);
- reportPi(result2);
- }})();`;
-
- document.documentElement.appendChild(s);
- // Inline script ought to run synchronously.
-
- browser.test.assertEq(3.14, results[0],
- "exportFunction on window should define a global function");
- browser.test.assertEq(3.14, results[1],
- "exportFunction on window should export a property to window.");
-
- browser.test.assertEq(2, results.length,
- "Expecting the number of results to match the number of method calls");
-
- browser.test.notifyPass("export helper test completed");
- }
-
- let extensionData = {
- manifest: {
- content_scripts: [{
- js: ["contentscript.js"],
- matches: ["http://mochi.test/*/file_sample.html"],
- run_at: "document_start",
- }],
- },
-
- files: {
- "contentscript.js": contentScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield extension.awaitFinish("export helper test completed");
- win.close();
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_incognito.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_incognito.html
deleted file mode 100644
index a2f38dce65..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_incognito.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script private browsing ID</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript_incognito() {
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- },
- ],
- },
-
- background() {
- let windowId;
-
- browser.test.onMessage.addListener(([msg, url]) => {
- if (msg === "open-window") {
- browser.windows.create({url, incognito: true}).then(window => {
- windowId = window.id;
- });
- } else if (msg === "close-window") {
- browser.windows.remove(windowId).then(() => {
- browser.test.sendMessage("done");
- });
- }
- });
- },
-
- files: {
- "content_script.js": async () => {
- const COOKIE = "foo=florgheralzps";
- document.cookie = COOKIE;
-
- let url = new URL("return_headers.sjs", location.href);
-
- let responses = [
- new Promise(resolve => {
- let xhr = new XMLHttpRequest();
- xhr.open("GET", url);
- xhr.onload = () => resolve(JSON.parse(xhr.responseText));
- xhr.send();
- }),
-
- fetch(url, {credentials: "include"}).then(body => body.json()),
- ];
-
- try {
- for (let response of await Promise.all(responses)) {
- browser.test.assertEq(COOKIE, response.cookie, "Got expected cookie header");
- }
- browser.test.notifyPass("cookies");
- } catch (e) {
- browser.test.fail(`Error: ${e}`);
- browser.test.notifyFail("cookies");
- }
- },
- },
- });
-
- yield extension.startup();
-
- extension.sendMessage(["open-window", SimpleTest.getTestFileURL("file_sample.html")]);
-
- yield extension.awaitFinish("cookies");
-
- extension.sendMessage(["close-window"]);
- yield extension.awaitMessage("done");
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
-
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_permission.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_permission.html
deleted file mode 100644
index eaf8150926..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_permission.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript() {
- function background() {
- browser.test.onMessage.addListener(url => {
- browser.tabs.create({url}).then(tab => {
- return browser.tabs.executeScript(tab.id, {code: "true;"})
- .then(() => {
- browser.test.sendMessage("executed", true);
- browser.tabs.remove([tab.id]);
- }, err => {
- browser.test.sendMessage("executed", false);
- browser.tabs.remove([tab.id]);
- });
- });
- });
- }
-
- let extensionData = {
- manifest: {
- permissions: ["<all_urls>"],
- },
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- extension.sendMessage("https://example.com");
- let result = yield extension.awaitMessage("executed");
- is(result, true, "Content script can be run in a page without mozAddonManager");
-
- yield SpecialPowers.pushPrefEnv({
- set: [["extensions.webapi.testing", true]],
- });
-
- extension.sendMessage("https://example.com");
- result = yield extension.awaitMessage("executed");
- is(result, false, "Content script cannot be run in a page with mozAddonManager");
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_teardown.html b/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_teardown.html
deleted file mode 100644
index 33a8c4ccc6..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_contentscript_teardown.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script teardown</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-add_task(function* test_contentscript_reload_and_unload() {
- function contentScript() {
- browser.test.sendMessage("contentscript-run");
- }
- function background() {
- let removedTabs = 0;
- browser.tabs.onRemoved.addListener(() => {
- browser.test.assertEq(1, ++removedTabs,
- "Expected only one tab to be removed during the test");
- browser.test.sendMessage("tab-closed");
- });
- }
-
- let extensionData = {
- background,
- manifest: {
- content_scripts: [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["contentscript.js"],
- }],
- },
-
- files: {
- "contentscript.js": contentScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let chromeScript = SpecialPowers.loadChromeScript(
- SimpleTest.getTestFileURL("file_teardown_test.js"));
- yield chromeScript.promiseOneMessage("chromescript-startup");
- function* getContextEvents() {
- chromeScript.sendAsyncMessage("get-context-events");
- let contextEvents = yield chromeScript.promiseOneMessage("context-events");
- return contextEvents.filter(event => event.extensionId == extension.id);
- }
-
- let win = window.open("file_sample.html");
- yield extension.awaitMessage("contentscript-run");
- let tabUrl = win.location.href;
-
- let contextEvents = yield* getContextEvents();
- is(contextEvents.length, 1,
- "ExtensionContext state change after loading a content script");
- is(contextEvents[0].eventType, "load",
- "Create ExtensionContext for content script");
- is(contextEvents[0].url, tabUrl, "ExtensionContext URL = page");
-
- let promiseReload = extension.awaitMessage("contentscript-run");
- win.location.reload();
- yield promiseReload;
- contextEvents = yield* getContextEvents();
- is(contextEvents.length, 2,
- "ExtensionContext state changes after reloading a content script");
- is(contextEvents[0].eventType, "unload", "Unload old ExtensionContext");
- is(contextEvents[0].url, tabUrl, "ExtensionContext URL = page");
- is(contextEvents[1].eventType, "load",
- "Create new ExtensionContext for content script");
- is(contextEvents[1].url, tabUrl, "ExtensionContext URL = page");
-
- let tabClosePromise = extension.awaitMessage("tab-closed");
- win.close();
- yield tabClosePromise;
-
- contextEvents = yield* getContextEvents();
- is(contextEvents.length, 1,
- "ExtensionContext state change after unloading a content script");
- is(contextEvents[0].eventType, "unload",
- "Unload ExtensionContext after closing the tab with the content script");
- is(contextEvents[0].url, tabUrl, "ExtensionContext URL = page");
-
- chromeScript.sendAsyncMessage("cleanup");
- chromeScript.destroy();
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_cookies.html b/toolkit/components/webextensions/test/mochitest/test_ext_cookies.html
deleted file mode 100644
index d414a4e46e..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_cookies.html
+++ /dev/null
@@ -1,234 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_cookies() {
- async function background() {
- function assertExpected(expected, cookie) {
- for (let key of Object.keys(cookie)) {
- browser.test.assertTrue(key in expected, `found property ${key}`);
- browser.test.assertEq(expected[key], cookie[key], `property value for ${key} is correct`);
- }
- browser.test.assertEq(Object.keys(expected).length, Object.keys(cookie).length, "all expected properties found");
- }
-
- const TEST_URL = "http://example.org/";
- const TEST_SECURE_URL = "https://example.org/";
- const THE_FUTURE = Date.now() + 5 * 60;
- const TEST_PATH = "set_path";
- const TEST_URL_WITH_PATH = TEST_URL + TEST_PATH;
- const TEST_COOKIE_PATH = `/${TEST_PATH}`;
- const STORE_ID = "firefox-default";
- const PRIVATE_STORE_ID = "firefox-private";
-
- let expected = {
- name: "name1",
- value: "value1",
- domain: "example.org",
- hostOnly: true,
- path: "/",
- secure: false,
- httpOnly: false,
- session: false,
- expirationDate: THE_FUTURE,
- storeId: STORE_ID,
- };
-
- let cookie = await browser.cookies.set({url: TEST_URL, name: "name1", value: "value1", expirationDate: THE_FUTURE});
- assertExpected(expected, cookie);
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1"});
- assertExpected(expected, cookie);
-
- let cookies = await browser.cookies.getAll({name: "name1"});
- browser.test.assertEq(cookies.length, 1, "one cookie found for matching name");
- assertExpected(expected, cookies[0]);
-
- cookies = await browser.cookies.getAll({domain: "example.org"});
- browser.test.assertEq(cookies.length, 1, "one cookie found for matching domain");
- assertExpected(expected, cookies[0]);
-
- cookies = await browser.cookies.getAll({domain: "example.net"});
- browser.test.assertEq(cookies.length, 0, "no cookies found for non-matching domain");
-
- cookies = await browser.cookies.getAll({secure: false});
- browser.test.assertEq(cookies.length, 1, "one non-secure cookie found");
- assertExpected(expected, cookies[0]);
-
- cookies = await browser.cookies.getAll({secure: true});
- browser.test.assertEq(cookies.length, 0, "no secure cookies found");
-
- cookies = await browser.cookies.getAll({storeId: STORE_ID});
- browser.test.assertEq(cookies.length, 1, "one cookie found for valid storeId");
- assertExpected(expected, cookies[0]);
-
- cookies = await browser.cookies.getAll({storeId: "invalid_id"});
- browser.test.assertEq(cookies.length, 0, "no cookies found for invalid storeId");
-
- let details = await browser.cookies.remove({url: TEST_URL, name: "name1"});
- assertExpected({url: TEST_URL, name: "name1", storeId: STORE_ID}, details);
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1"});
- browser.test.assertEq(null, cookie, "removed cookie not found");
-
- let stores = await browser.cookies.getAllCookieStores();
- browser.test.assertEq(1, stores.length, "expected number of stores returned");
- browser.test.assertEq(STORE_ID, stores[0].id, "expected store id returned");
- browser.test.assertEq(1, stores[0].tabIds.length, "one tab returned for store");
-
- {
- let privateWindow = await browser.windows.create({incognito: true});
- let stores = await browser.cookies.getAllCookieStores();
-
- browser.test.assertEq(2, stores.length, "expected number of stores returned");
- browser.test.assertEq(STORE_ID, stores[0].id, "expected store id returned");
- browser.test.assertEq(1, stores[0].tabIds.length, "one tab returned for store");
- browser.test.assertEq(PRIVATE_STORE_ID, stores[1].id, "expected private store id returned");
- browser.test.assertEq(1, stores[0].tabIds.length, "one tab returned for private store");
-
- await browser.windows.remove(privateWindow.id);
- }
-
- cookie = await browser.cookies.set({url: TEST_URL, name: "name2", domain: ".example.org", expirationDate: THE_FUTURE});
- browser.test.assertEq(false, cookie.hostOnly, "cookie is not a hostOnly cookie");
-
- details = await browser.cookies.remove({url: TEST_URL, name: "name2"});
- assertExpected({url: TEST_URL, name: "name2", storeId: STORE_ID}, details);
-
- // Create a session cookie.
- cookie = await browser.cookies.set({url: TEST_URL, name: "name1", value: "value1"});
- browser.test.assertEq(true, cookie.session, "session cookie set");
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1"});
- browser.test.assertEq(true, cookie.session, "got session cookie");
-
- cookies = await browser.cookies.getAll({session: true});
- browser.test.assertEq(cookies.length, 1, "one session cookie found");
- browser.test.assertEq(true, cookies[0].session, "found session cookie");
-
- cookies = await browser.cookies.getAll({session: false});
- browser.test.assertEq(cookies.length, 0, "no non-session cookies found");
-
- details = await browser.cookies.remove({url: TEST_URL, name: "name1"});
- assertExpected({url: TEST_URL, name: "name1", storeId: STORE_ID}, details);
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1"});
- browser.test.assertEq(null, cookie, "removed cookie not found");
-
- cookie = await browser.cookies.set({url: TEST_SECURE_URL, name: "name1", value: "value1", secure: true});
- browser.test.assertEq(true, cookie.secure, "secure cookie set");
-
- cookie = await browser.cookies.get({url: TEST_SECURE_URL, name: "name1"});
- browser.test.assertEq(true, cookie.session, "got secure cookie");
-
- cookies = await browser.cookies.getAll({secure: true});
- browser.test.assertEq(cookies.length, 1, "one secure cookie found");
- browser.test.assertEq(true, cookies[0].secure, "found secure cookie");
-
- cookies = await browser.cookies.getAll({secure: false});
- browser.test.assertEq(cookies.length, 0, "no non-secure cookies found");
-
- details = await browser.cookies.remove({url: TEST_SECURE_URL, name: "name1"});
- assertExpected({url: TEST_SECURE_URL, name: "name1", storeId: STORE_ID}, details);
-
- cookie = await browser.cookies.get({url: TEST_SECURE_URL, name: "name1"});
- browser.test.assertEq(null, cookie, "removed cookie not found");
-
- cookie = await browser.cookies.set({url: TEST_URL_WITH_PATH, path: TEST_COOKIE_PATH, name: "name1", value: "value1", expirationDate: THE_FUTURE});
- browser.test.assertEq(TEST_COOKIE_PATH, cookie.path, "created cookie with path");
-
- cookie = await browser.cookies.get({url: TEST_URL_WITH_PATH, name: "name1"});
- browser.test.assertEq(TEST_COOKIE_PATH, cookie.path, "got cookie with path");
-
- cookies = await browser.cookies.getAll({path: TEST_COOKIE_PATH});
- browser.test.assertEq(cookies.length, 1, "one cookie with path found");
- browser.test.assertEq(TEST_COOKIE_PATH, cookies[0].path, "found cookie with path");
-
- cookie = await browser.cookies.get({url: TEST_URL + "invalid_path", name: "name1"});
- browser.test.assertEq(null, cookie, "get with invalid path returns null");
-
- cookies = await browser.cookies.getAll({path: "/invalid_path"});
- browser.test.assertEq(cookies.length, 0, "getAll with invalid path returns 0 cookies");
-
- details = await browser.cookies.remove({url: TEST_URL_WITH_PATH, name: "name1"});
- assertExpected({url: TEST_URL_WITH_PATH, name: "name1", storeId: STORE_ID}, details);
-
- cookie = await browser.cookies.set({url: TEST_URL, name: "name1", value: "value1", httpOnly: true});
- browser.test.assertEq(true, cookie.httpOnly, "httpOnly cookie set");
-
- cookie = await browser.cookies.set({url: TEST_URL, name: "name1", value: "value1", httpOnly: false});
- browser.test.assertEq(false, cookie.httpOnly, "non-httpOnly cookie set");
-
- details = await browser.cookies.remove({url: TEST_URL, name: "name1"});
- assertExpected({url: TEST_URL, name: "name1", storeId: STORE_ID}, details);
-
- cookie = await browser.cookies.set({url: TEST_URL});
- browser.test.assertEq("", cookie.name, "default name set");
- browser.test.assertEq("", cookie.value, "default value set");
- browser.test.assertEq(true, cookie.session, "no expiry date created session cookie");
-
- {
- let privateWindow = await browser.windows.create({incognito: true});
-
- // Hacky work-around for bugzil.la/1309637
- await new Promise(resolve => setTimeout(resolve, 700));
-
- let cookie = await browser.cookies.set({url: TEST_URL, name: "store", value: "private", expirationDate: THE_FUTURE, storeId: PRIVATE_STORE_ID});
- browser.test.assertEq("private", cookie.value, "set the private cookie");
-
- cookie = await browser.cookies.set({url: TEST_URL, name: "store", value: "default", expirationDate: THE_FUTURE, storeId: STORE_ID});
- browser.test.assertEq("default", cookie.value, "set the default cookie");
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "store", storeId: PRIVATE_STORE_ID});
- browser.test.assertEq("private", cookie.value, "get the private cookie");
- browser.test.assertEq(PRIVATE_STORE_ID, cookie.storeId, "get the private cookie storeId");
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "store", storeId: STORE_ID});
- browser.test.assertEq("default", cookie.value, "get the default cookie");
- browser.test.assertEq(STORE_ID, cookie.storeId, "get the default cookie storeId");
-
- let details = await browser.cookies.remove({url: TEST_URL, name: "store", storeId: STORE_ID});
- assertExpected({url: TEST_URL, name: "store", storeId: STORE_ID}, details);
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "store", storeId: STORE_ID});
- browser.test.assertEq(null, cookie, "deleted the default cookie");
-
- details = await browser.cookies.remove({url: TEST_URL, name: "store", storeId: PRIVATE_STORE_ID});
- assertExpected({url: TEST_URL, name: "store", storeId: PRIVATE_STORE_ID}, details);
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "store", storeId: PRIVATE_STORE_ID});
- browser.test.assertEq(null, cookie, "deleted the private cookie");
-
- await browser.windows.remove(privateWindow.id);
- }
-
- browser.test.notifyPass("cookies");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["cookies", "*://example.org/"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("cookies");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_containers.html b/toolkit/components/webextensions/test/mochitest/test_ext_cookies_containers.html
deleted file mode 100644
index bc4994eec7..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_containers.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* setup() {
- // make sure userContext is enabled.
- return SpecialPowers.pushPrefEnv({"set": [
- ["privacy.userContext.enabled", true],
- ]});
-});
-
-add_task(function* test_cookie_containers() {
- async function background() {
- function assertExpected(expected, cookie) {
- for (let key of Object.keys(cookie)) {
- browser.test.assertTrue(key in expected, `found property ${key}`);
- browser.test.assertEq(expected[key], cookie[key], `property value for ${key} is correct`);
- }
- browser.test.assertEq(Object.keys(expected).length, Object.keys(cookie).length, "all expected properties found");
- }
-
- const TEST_URL = "http://example.org/";
- const THE_FUTURE = Date.now() + 5 * 60;
-
- let expected = {
- name: "name1",
- value: "value1",
- domain: "example.org",
- hostOnly: true,
- path: "/",
- secure: false,
- httpOnly: false,
- session: false,
- expirationDate: THE_FUTURE,
- storeId: "firefox-container-1",
- };
-
- let cookie = await browser.cookies.set({
- url: TEST_URL, name: "name1", value: "value1",
- expirationDate: THE_FUTURE, storeId: "firefox-container-1",
- });
- browser.test.assertEq("firefox-container-1", cookie.storeId, "the cookie has the correct storeId");
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1"});
- browser.test.assertEq(null, cookie, "get() without storeId returns null");
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1", storeId: "firefox-container-1"});
- assertExpected(expected, cookie);
-
- let cookies = await browser.cookies.getAll({storeId: "firefox-default"});
- browser.test.assertEq(0, cookies.length, "getAll() with default storeId returns an empty array");
-
- cookies = await browser.cookies.getAll({storeId: "firefox-container-1"});
- browser.test.assertEq(1, cookies.length, "one cookie found for matching domain");
- assertExpected(expected, cookies[0]);
-
- let details = await browser.cookies.remove({url: TEST_URL, name: "name1", storeId: "firefox-container-1"});
- assertExpected({url: TEST_URL, name: "name1", storeId: "firefox-container-1"}, details);
-
- cookie = await browser.cookies.get({url: TEST_URL, name: "name1", storeId: "firefox-container-1"});
- browser.test.assertEq(null, cookie, "removed cookie not found");
-
- browser.test.notifyPass("cookies");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["cookies", "*://example.org/"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("cookies");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_expiry.html b/toolkit/components/webextensions/test/mochitest/test_ext_cookies_expiry.html
deleted file mode 100644
index 3927d9e94f..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_expiry.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_cookies_expiry() {
- function background() {
- let expectedEvents = [];
-
- browser.cookies.onChanged.addListener(event => {
- expectedEvents.push(`${event.removed}:${event.cause}`);
- if (expectedEvents.length === 1) {
- browser.test.assertEq("true:expired", expectedEvents[0], "expired cookie removed");
- browser.test.assertEq("first", event.cookie.name, "expired cookie has the expected name");
- browser.test.assertEq("one", event.cookie.value, "expired cookie has the expected value");
- } else {
- browser.test.assertEq("false:explicit", expectedEvents[1], "new cookie added");
- browser.test.assertEq("first", event.cookie.name, "new cookie has the expected name");
- browser.test.assertEq("one-again", event.cookie.value, "new cookie has the expected value");
- browser.test.notifyPass("cookie-expiry");
- }
- });
-
- setTimeout(() => {
- browser.test.sendMessage("change-cookies");
- }, 1000);
- }
-
- let domain = ".example.com";
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "permissions": ["http://example.com/", "cookies"],
- },
- background,
- });
-
- let cookieSvc = SpecialPowers.Services.cookies;
-
- let cookie = {
- host: domain,
- name: "first",
- path: "/",
- };
-
- do {
- cookieSvc.add(cookie.host, cookie.path, cookie.name, "one", false, false, false, Date.now() / 1000 + 1);
- } while (!cookieSvc.cookieExists(cookie));
-
- yield extension.startup();
- yield extension.awaitMessage("change-cookies");
-
- cookieSvc.add(cookie.host, cookie.path, cookie.name, "one-again", false, false, false, Date.now() / 1000 + 10);
-
- yield extension.awaitFinish("cookie-expiry");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_bad.html b/toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_bad.html
deleted file mode 100644
index 15a62855ad..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_bad.html
+++ /dev/null
@@ -1,112 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <script type="text/javascript" src="head_cookies.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* init() {
- // We need to trigger a cookie eviction in order to test our batch delete
- // observer.
- SpecialPowers.setIntPref("network.cookie.maxPerHost", 3);
- SimpleTest.registerCleanupFunction(() => {
- SpecialPowers.clearUserPref("network.cookie.maxPerHost");
- });
-});
-
-add_task(function* test_bad_cookie_permissions() {
- info("Test non-matching, non-secure domain with non-secure cookie");
- yield testCookies({
- permissions: ["http://example.com/", "cookies"],
- url: "http://example.net/",
- domain: "example.net",
- secure: false,
- shouldPass: false,
- shouldWrite: false,
- });
-
- info("Test non-matching, secure domain with non-secure cookie");
- yield testCookies({
- permissions: ["https://example.com/", "cookies"],
- url: "https://example.net/",
- domain: "example.net",
- secure: false,
- shouldPass: false,
- shouldWrite: false,
- });
-
- info("Test non-matching, secure domain with secure cookie");
- yield testCookies({
- permissions: ["https://example.com/", "cookies"],
- url: "https://example.net/",
- domain: "example.net",
- secure: false,
- shouldPass: false,
- shouldWrite: false,
- });
-
- info("Test matching subdomain with superdomain privileges, secure cookie (http)");
- yield testCookies({
- permissions: ["http://foo.bar.example.com/", "cookies"],
- url: "http://foo.bar.example.com/",
- domain: ".example.com",
- secure: true,
- shouldPass: false,
- shouldWrite: true,
- });
-
- info("Test matching, non-secure domain with secure cookie");
- yield testCookies({
- permissions: ["http://example.com/", "cookies"],
- url: "http://example.com/",
- domain: "example.com",
- secure: true,
- shouldPass: false,
- shouldWrite: true,
- });
-
- info("Test matching, non-secure host, secure URL");
- yield testCookies({
- permissions: ["http://example.com/", "cookies"],
- url: "https://example.com/",
- domain: "example.com",
- secure: true,
- shouldPass: false,
- shouldWrite: false,
- });
-
- info("Test non-matching domain");
- yield testCookies({
- permissions: ["http://example.com/", "cookies"],
- url: "http://example.com/",
- domain: "example.net",
- secure: false,
- shouldPass: false,
- shouldWrite: false,
- });
-
- info("Test invalid scheme");
- yield testCookies({
- permissions: ["ftp://example.com/", "cookies"],
- url: "ftp://example.com/",
- domain: "example.com",
- secure: false,
- shouldPass: false,
- shouldWrite: false,
- });
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_good.html b/toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_good.html
deleted file mode 100644
index 31e83188c6..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_cookies_permissions_good.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <script type="text/javascript" src="head_cookies.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* init() {
- // We need to trigger a cookie eviction in order to test our batch delete
- // observer.
- SpecialPowers.setIntPref("network.cookie.maxPerHost", 3);
- SimpleTest.registerCleanupFunction(() => {
- SpecialPowers.clearUserPref("network.cookie.maxPerHost");
- });
-});
-
-add_task(function* test_good_cookie_permissions() {
- info("Test matching, non-secure domain with non-secure cookie");
- yield testCookies({
- permissions: ["http://example.com/", "cookies"],
- url: "http://example.com/",
- domain: "example.com",
- secure: false,
- shouldPass: true,
- });
-
- info("Test matching, secure domain with non-secure cookie");
- yield testCookies({
- permissions: ["https://example.com/", "cookies"],
- url: "https://example.com/",
- domain: "example.com",
- secure: false,
- shouldPass: true,
- });
-
- info("Test matching, secure domain with secure cookie");
- yield testCookies({
- permissions: ["https://example.com/", "cookies"],
- url: "https://example.com/",
- domain: "example.com",
- secure: true,
- shouldPass: true,
- });
-
- info("Test matching subdomain with superdomain privileges, secure cookie (https)");
- yield testCookies({
- permissions: ["https://foo.bar.example.com/", "cookies"],
- url: "https://foo.bar.example.com/",
- domain: ".example.com",
- secure: true,
- shouldPass: true,
- });
-
- info("Test matching subdomain with superdomain privileges, non-secure cookie (https)");
- yield testCookies({
- permissions: ["https://foo.bar.example.com/", "cookies"],
- url: "https://foo.bar.example.com/",
- domain: ".example.com",
- secure: false,
- shouldPass: true,
- });
-
- info("Test matching subdomain with superdomain privileges, non-secure cookie (http)");
- yield testCookies({
- permissions: ["http://foo.bar.example.com/", "cookies"],
- url: "http://foo.bar.example.com/",
- domain: ".example.com",
- secure: false,
- shouldPass: true,
- });
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_exclude_include_globs.html b/toolkit/components/webextensions/test/mochitest/test_ext_exclude_include_globs.html
deleted file mode 100644
index 640522b40a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_exclude_include_globs.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_contentscript() {
- function background() {
- browser.runtime.onMessage.addListener(([script], sender) => {
- browser.test.sendMessage("run", {script});
- browser.test.sendMessage("run-" + script);
- });
- browser.test.sendMessage("running");
- }
-
- function contentScriptAll() {
- browser.runtime.sendMessage(["all"]);
- }
- function contentScriptIncludesTest1() {
- browser.runtime.sendMessage(["includes-test1"]);
- }
- function contentScriptExcludesTest1() {
- browser.runtime.sendMessage(["excludes-test1"]);
- }
-
- let extensionData = {
- manifest: {
- content_scripts: [
- {
- "matches": ["http://example.org/", "http://*.example.org/"],
- "exclude_globs": [],
- "include_globs": ["*"],
- "js": ["content_script_all.js"],
- },
- {
- "matches": ["http://example.org/", "http://*.example.org/"],
- "include_globs": ["*test1*"],
- "js": ["content_script_includes_test1.js"],
- },
- {
- "matches": ["http://example.org/", "http://*.example.org/"],
- "exclude_globs": ["*test1*"],
- "js": ["content_script_excludes_test1.js"],
- },
- ],
- },
- background,
-
- files: {
- "content_script_all.js": contentScriptAll,
- "content_script_includes_test1.js": contentScriptIncludesTest1,
- "content_script_excludes_test1.js": contentScriptExcludesTest1,
- },
-
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- let ran = 0;
- extension.onMessage("run", ({script}) => {
- ran++;
- });
-
- yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- info("extension loaded");
-
- let win = window.open("http://example.org/");
- yield Promise.all([extension.awaitMessage("run-all"), extension.awaitMessage("run-excludes-test1")]);
- win.close();
- is(ran, 2);
-
- win = window.open("http://test1.example.org/");
- yield Promise.all([extension.awaitMessage("run-all"), extension.awaitMessage("run-includes-test1")]);
- win.close();
- is(ran, 4);
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_external_messaging.html b/toolkit/components/webextensions/test/mochitest/test_ext_external_messaging.html
deleted file mode 100644
index dfc1f9427a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_external_messaging.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension external messaging</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function backgroundScript(id, otherId) {
- browser.runtime.onMessage.addListener((msg, sender) => {
- browser.test.fail(`Got unexpected message: ${uneval(msg)} ${uneval(sender)}`);
- });
-
- browser.runtime.onConnect.addListener(port => {
- browser.test.fail(`Got unexpected connection: ${uneval(port.sender)}`);
- });
-
- browser.runtime.onMessageExternal.addListener((msg, sender) => {
- browser.test.assertEq(otherId, sender.id, `${id}: Got expected external sender ID`);
- browser.test.assertEq(`helo-${id}`, msg, "Got expected message");
-
- browser.test.sendMessage("onMessage-done");
-
- return Promise.resolve(`ehlo-${otherId}`);
- });
-
- browser.runtime.onConnectExternal.addListener(port => {
- browser.test.assertEq(otherId, port.sender.id, `${id}: Got expected external connecter ID`);
-
- port.onMessage.addListener(msg => {
- browser.test.assertEq(`helo-${id}`, msg, "Got expected port message");
-
- port.postMessage(`ehlo-${otherId}`);
-
- browser.test.sendMessage("onConnect-done");
- });
- });
-
- browser.test.onMessage.addListener(msg => {
- if (msg === "go") {
- browser.runtime.sendMessage(otherId, `helo-${otherId}`).then(result => {
- browser.test.assertEq(`ehlo-${id}`, result, "Got expected reply");
- browser.test.sendMessage("sendMessage-done");
- });
-
- let port = browser.runtime.connect(otherId);
- port.postMessage(`helo-${otherId}`);
-
- port.onMessage.addListener(msg => {
- port.disconnect();
-
- browser.test.assertEq(msg, `ehlo-${id}`, "Got expected port reply");
- browser.test.sendMessage("connect-done");
- });
- }
- });
-}
-
-function makeExtension(id, otherId) {
- let args = `${JSON.stringify(id)}, ${JSON.stringify(otherId)}`;
-
- let extensionData = {
- background: `(${backgroundScript})(${args})`,
- manifest: {
- "applications": {"gecko": {id}},
- },
- };
-
- return ExtensionTestUtils.loadExtension(extensionData);
-}
-
-add_task(function* test_contentscript() {
- const ID1 = "foo-message@mochitest.mozilla.org";
- const ID2 = "bar-message@mochitest.mozilla.org";
-
- let extension1 = makeExtension(ID1, ID2);
- let extension2 = makeExtension(ID2, ID1);
-
- yield Promise.all([extension1.startup(), extension2.startup()]);
-
- extension1.sendMessage("go");
- extension2.sendMessage("go");
-
- yield Promise.all([
- extension1.awaitMessage("sendMessage-done"),
- extension2.awaitMessage("sendMessage-done"),
-
- extension1.awaitMessage("onMessage-done"),
- extension2.awaitMessage("onMessage-done"),
-
- extension1.awaitMessage("connect-done"),
- extension2.awaitMessage("connect-done"),
-
- extension1.awaitMessage("onConnect-done"),
- extension2.awaitMessage("onConnect-done"),
- ]);
-
- yield extension1.unload();
- yield extension2.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_generate.html b/toolkit/components/webextensions/test/mochitest/test_ext_generate.html
deleted file mode 100644
index cfafcbad98..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_generate.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for generating WebExtensions</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- browser.test.log("running background script");
-
- browser.test.onMessage.addListener((x, y) => {
- browser.test.assertEq(x, 10, "x is 10");
- browser.test.assertEq(y, 20, "y is 20");
-
- browser.test.notifyPass("background test passed");
- });
-
- browser.test.sendMessage("running", 1);
-}
-
-let extensionData = {
- background,
-};
-
-add_task(function* test_background() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- info("load complete");
- let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- is(x, 1, "got correct value from extension");
- info("startup complete");
- extension.sendMessage(10, 20);
- yield extension.awaitFinish();
- info("test complete");
- yield extension.unload();
- info("extension unloaded successfully");
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_geturl.html b/toolkit/components/webextensions/test/mochitest/test_ext_geturl.html
deleted file mode 100644
index 6e39c2f5d1..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_geturl.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- browser.runtime.onMessage.addListener(([url1, url2]) => {
- let url3 = browser.runtime.getURL("test_file.html");
- let url4 = browser.extension.getURL("test_file.html");
-
- browser.test.assertTrue(url1 !== undefined, "url1 defined");
-
- browser.test.assertTrue(url1.startsWith("moz-extension://"), "url1 has correct scheme");
- browser.test.assertTrue(url1.endsWith("test_file.html"), "url1 has correct leaf name");
-
- browser.test.assertEq(url1, url2, "url2 matches");
- browser.test.assertEq(url1, url3, "url3 matches");
- browser.test.assertEq(url1, url4, "url4 matches");
-
- browser.test.notifyPass("geturl");
- });
-}
-
-function contentScript() {
- let url1 = browser.runtime.getURL("test_file.html");
- let url2 = browser.extension.getURL("test_file.html");
- browser.runtime.sendMessage([url1, url2]);
-}
-
-let extensionData = {
- background,
- manifest: {
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), extension.awaitFinish("geturl")]);
-
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_i18n.html b/toolkit/components/webextensions/test/mochitest/test_ext_i18n.html
deleted file mode 100644
index 1f7330bbb1..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_i18n.html
+++ /dev/null
@@ -1,432 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for WebExtension localization APIs</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-SimpleTest.registerCleanupFunction(() => { SpecialPowers.clearUserPref("intl.accept_languages"); });
-SimpleTest.registerCleanupFunction(() => { SpecialPowers.clearUserPref("general.useragent.locale"); });
-
-add_task(function* test_i18n() {
- function runTests(assertEq) {
- let _ = browser.i18n.getMessage.bind(browser.i18n);
-
- let url = browser.runtime.getURL("/");
- assertEq(url, `moz-extension://${_("@@extension_id")}/`, "@@extension_id builtin message");
-
- assertEq("Foo.", _("Foo"), "Simple message in selected locale.");
-
- assertEq("(bar)", _("bar"), "Simple message fallback in default locale.");
-
- assertEq("", _("some-unknown-locale-string"), "Unknown locale string.");
-
- assertEq("", _("@@unknown_builtin_string"), "Unknown built-in string.");
- assertEq("", _("@@bidi_unknown_builtin_string"), "Unknown built-in bidi string.");
-
- assertEq("Føo.", _("Föo"), "Multi-byte message in selected locale.");
-
- let substitutions = [];
- substitutions[4] = "5";
- substitutions[13] = "14";
-
- assertEq("'$0' '14' '' '5' '$$$$' '$'.", _("basic_substitutions", substitutions),
- "Basic numeric substitutions");
-
- assertEq("'$0' '' 'just a string' '' '$$$$' '$'.", _("basic_substitutions", "just a string"),
- "Basic numeric substitutions, with non-array value");
-
- let values = _("named_placeholder_substitutions", ["(subst $1 $2)", "(2 $1 $2)"]).split("\n");
-
- assertEq("_foo_ (subst $1 $2) _bar_", values[0], "Named and numeric substitution");
-
- assertEq("(2 $1 $2)", values[1], "Numeric substitution amid named placeholders");
-
- assertEq("$bad name$", values[2], "Named placeholder with invalid key");
-
- assertEq("", values[3], "Named placeholder with an invalid value");
-
- assertEq("Accepted, but shouldn't break.", values[4], "Named placeholder with a strange content value");
-
- assertEq("$foo", values[5], "Non-placeholder token that should be ignored");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "default_locale": "jp",
-
- content_scripts: [
- {"matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content.js"]},
- ],
- },
-
-
- files: {
- "_locales/en_US/messages.json": {
- "foo": {
- "message": "Foo.",
- "description": "foo",
- },
-
- "föo": {
- "message": "Føo.",
- "description": "foo",
- },
-
- "basic_substitutions": {
- "message": "'$0' '$14' '$1' '$5' '$$$$$' '$$'.",
- "description": "foo",
- },
-
- "Named_placeholder_substitutions": {
- "message": "$Foo$\n$2\n$bad name$\n$bad_value$\n$bad_content_value$\n$foo",
- "description": "foo",
- "placeholders": {
- "foO": {
- "content": "_foo_ $1 _bar_",
- "description": "foo",
- },
-
- "bad name": {
- "content": "Nope.",
- "description": "bad name",
- },
-
- "bad_value": "Nope.",
-
- "bad_content_value": {
- "content": ["Accepted, but shouldn't break."],
- "description": "bad value",
- },
- },
- },
-
- "broken_placeholders": {
- "message": "$broken$",
- "description": "broken placeholders",
- "placeholders": "foo.",
- },
- },
-
- "_locales/jp/messages.json": {
- "foo": {
- "message": "(foo)",
- "description": "foo",
- },
-
- "bar": {
- "message": "(bar)",
- "description": "bar",
- },
- },
-
- "content.js": "new " + function(runTestsFn) {
- runTestsFn((...args) => {
- browser.runtime.sendMessage(["assertEq", ...args]);
- });
-
- browser.runtime.sendMessage(["content-script-finished"]);
- } + `(${runTests})`,
- },
-
- background: "new " + function(runTestsFn) {
- browser.runtime.onMessage.addListener(([msg, ...args]) => {
- if (msg == "assertEq") {
- browser.test.assertEq(...args);
- } else {
- browser.test.sendMessage(msg, ...args);
- }
- });
-
- runTestsFn(browser.test.assertEq.bind(browser.test));
- } + `(${runTests})`,
- });
-
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield extension.awaitMessage("content-script-finished");
- win.close();
-
- yield extension.unload();
-});
-
-add_task(function* test_get_accept_languages() {
- function background() {
- function checkResults(source, results, expected) {
- browser.test.assertEq(
- expected.length,
- results.length,
- `got expected number of languages in ${source}`);
- results.forEach((lang, index) => {
- browser.test.assertEq(
- expected[index],
- lang,
- `got expected language in ${source}`);
- });
- }
-
- let tabId;
-
- browser.tabs.query({currentWindow: true, active: true}, tabs => {
- tabId = tabs[0].id;
- browser.test.sendMessage("ready");
- });
-
- browser.test.onMessage.addListener(async ([msg, expected]) => {
- let contentResults = await browser.tabs.sendMessage(tabId, "get-results");
- let backgroundResults = await browser.i18n.getAcceptLanguages();
-
- checkResults("contentScript", contentResults, expected);
- checkResults("background", backgroundResults, expected);
-
- browser.test.sendMessage("done");
- });
- }
-
- function content() {
- browser.runtime.onMessage.addListener((msg, sender, respond) => {
- browser.i18n.getAcceptLanguages(respond);
- return true;
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "run_at": "document_start",
- "js": ["content_script.js"],
- }],
- },
-
- background,
-
- files: {
- "content_script.js": content,
- },
- });
-
- let win = window.open("file_sample.html");
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- let expectedLangs = ["en-US", "en"];
- extension.sendMessage(["expect-results", expectedLangs]);
- yield extension.awaitMessage("done");
-
- expectedLangs = ["en-US", "en", "fr-CA", "fr"];
- SpecialPowers.setCharPref("intl.accept_languages", expectedLangs.toString());
- extension.sendMessage(["expect-results", expectedLangs]);
- yield extension.awaitMessage("done");
- SpecialPowers.clearUserPref("intl.accept_languages");
-
- win.close();
-
- yield extension.unload();
-});
-
-add_task(function* test_get_ui_language() {
- function getResults() {
- return {
- getUILanguage: browser.i18n.getUILanguage(),
- getMessage: browser.i18n.getMessage("@@ui_locale"),
- };
- }
-
- function background(getResultsFn) {
- function checkResults(source, results, expected) {
- browser.test.assertEq(
- expected,
- results.getUILanguage,
- `Got expected getUILanguage result in ${source}`
- );
- browser.test.assertEq(
- expected,
- results.getMessage,
- `Got expected getMessage result in ${source}`
- );
- }
-
- let tabId;
-
- browser.test.onMessage.addListener(([msg, expected]) => {
- browser.tabs.sendMessage(tabId, "get-results", result => {
- checkResults("contentScript", result, expected);
- checkResults("background", getResultsFn(), expected);
-
- browser.test.sendMessage("done");
- });
- });
-
- browser.tabs.query({currentWindow: true, active: true}, tabs => {
- tabId = tabs[0].id;
- browser.test.sendMessage("ready");
- });
- }
-
- function content(getResultsFn) {
- browser.runtime.onMessage.addListener((msg, sender, respond) => {
- respond(getResultsFn());
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "run_at": "document_start",
- "js": ["content_script.js"],
- }],
- },
-
- background: `(${background})(${getResults})`,
-
- files: {
- "content_script.js": `(${content})(${getResults})`,
- },
- });
-
- let win = window.open("file_sample.html");
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- extension.sendMessage(["expect-results", "en_US"]);
- yield extension.awaitMessage("done");
-
- SpecialPowers.setCharPref("general.useragent.locale", "he");
-
- extension.sendMessage(["expect-results", "he"]);
- yield extension.awaitMessage("done");
-
- win.close();
-
- yield extension.unload();
-});
-
-
-add_task(function* test_detect_language() {
- const af_string = " aam skukuza die naam beteken hy wat skoonvee of hy wat alles onderstebo keer wysig " +
- "bosveldkampe boskampe is kleiner afgeleë ruskampe wat oor min fasiliteite beskik daar is geen restaurante " +
- "of winkels nie en slegs oornagbesoekers word toegelaat bateleur";
- // String with intermixed French/English text
- const fr_en_string = "France is the largest country in Western Europe and the third-largest in Europe as a whole. " +
- "A accès aux chiens et aux frontaux qui lui ont été il peut consulter et modifier ses collections et exporter " +
- "Cet article concerne le pays européen aujourd’hui appelé République française. Pour d’autres usages du nom France, " +
- "Pour une aide rapide et effective, veuiller trouver votre aide dans le menu ci-dessus." +
- "Motoring events began soon after the construction of the first successful gasoline-fueled automobiles. The quick brown fox jumped over the lazy dog";
-
- function background() {
- function checkResult(source, result, expected) {
- browser.test.assertEq(expected.isReliable, result.isReliable, "result.confident is true");
- browser.test.assertEq(
- expected.languages.length,
- result.languages.length,
- `result.languages contains the expected number of languages in ${source}`);
- expected.languages.forEach((lang, index) => {
- browser.test.assertEq(
- lang.percentage,
- result.languages[index].percentage,
- `element ${index} of result.languages array has the expected percentage in ${source}`);
- browser.test.assertEq(
- lang.language,
- result.languages[index].language,
- `element ${index} of result.languages array has the expected language in ${source}`);
- });
- }
-
- let tabId;
-
- browser.tabs.query({currentWindow: true, active: true}, tabs => {
- tabId = tabs[0].id;
- browser.test.sendMessage("ready");
- });
-
- browser.test.onMessage.addListener(async ([msg, expected]) => {
- let backgroundResults = await browser.i18n.detectLanguage(msg);
- let contentResults = await browser.tabs.sendMessage(tabId, msg);
-
- checkResult("background", backgroundResults, expected);
- checkResult("contentScript", contentResults, expected);
-
- browser.test.sendMessage("done");
- });
- }
-
- function content() {
- browser.runtime.onMessage.addListener((msg, sender, respond) => {
- browser.i18n.detectLanguage(msg, respond);
- return true;
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "run_at": "document_start",
- "js": ["content_script.js"],
- }],
- },
-
- background,
-
- files: {
- "content_script.js": content,
- },
- });
-
- let win = window.open("file_sample.html");
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- let expected = {
- isReliable: true,
- languages: [
- {
- language: "fr",
- percentage: 67,
- },
- {
- language: "en",
- percentage: 32,
- },
- ],
- };
- extension.sendMessage([fr_en_string, expected]);
- yield extension.awaitMessage("done");
-
- expected = {
- isReliable: true,
- languages: [
- {
- language: "af",
- percentage: 99,
- },
- ],
- };
- extension.sendMessage([af_string, expected]);
- yield extension.awaitMessage("done");
-
- win.close();
-
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_i18n_css.html b/toolkit/components/webextensions/test/mochitest/test_ext_i18n_css.html
deleted file mode 100644
index 7c6a8eeaaa..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_i18n_css.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_i18n_css() {
- let extension = ExtensionTestUtils.loadExtension({
- background: function() {
- function backgroundFetch(url) {
- return new Promise((resolve, reject) => {
- let xhr = new XMLHttpRequest();
- xhr.open("GET", url);
- xhr.onload = () => { resolve(xhr.responseText); };
- xhr.onerror = reject;
- xhr.send();
- });
- }
-
- Promise.all([backgroundFetch("foo.css"), backgroundFetch("bar.CsS?x#y"), backgroundFetch("foo.txt")]).then(results => {
- browser.test.assertEq("body { max-width: 42px; }", results[0], "CSS file localized");
- browser.test.assertEq("body { max-width: 42px; }", results[1], "CSS file localized");
-
- browser.test.assertEq("body { __MSG_foo__; }", results[2], "Text file not localized");
-
- browser.test.notifyPass("i18n-css");
- });
-
- browser.test.sendMessage("ready", browser.runtime.getURL("foo.css"));
- },
-
- manifest: {
- "web_accessible_resources": ["foo.css", "foo.txt", "locale.css"],
-
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "css": ["foo.css"],
- }],
-
- "default_locale": "en",
- },
-
- files: {
- "_locales/en/messages.json": JSON.stringify({
- "foo": {
- "message": "max-width: 42px",
- "description": "foo",
- },
- }),
-
- "foo.css": "body { __MSG_foo__; }",
- "bar.CsS": "body { __MSG_foo__; }",
- "foo.txt": "body { __MSG_foo__; }",
- "locale.css": '* { content: "__MSG_@@ui_locale__ __MSG_@@bidi_dir__ __MSG_@@bidi_reversed_dir__ __MSG_@@bidi_start_edge__ __MSG_@@bidi_end_edge__" }',
- },
- });
-
- yield extension.startup();
- let cssURL = yield extension.awaitMessage("ready");
-
- function fetch(url) {
- return new Promise((resolve, reject) => {
- let xhr = new XMLHttpRequest();
- xhr.open("GET", url);
- xhr.onload = () => { resolve(xhr.responseText); };
- xhr.onerror = reject;
- xhr.send();
- });
- }
-
- let css = yield fetch(cssURL);
-
- is(css, "body { max-width: 42px; }", "CSS file localized in mochitest scope");
-
- let win = window.open("file_sample.html");
- yield waitForLoad(win);
-
- let style = win.getComputedStyle(win.document.body);
- is(style.maxWidth, "42px", "stylesheet correctly applied");
- win.close();
-
- cssURL = cssURL.replace(/foo.css$/, "locale.css");
-
- css = yield fetch(cssURL);
- is(css, '* { content: "en_US ltr rtl left right" }', "CSS file localized in mochitest scope");
-
- const LOCALE = "general.useragent.locale";
- const DIR = "intl.uidirection.en";
-
- // We don't wind up actually switching the chrome registry locale, since we
- // don't have a chrome package for Hebrew. So just override it.
- SpecialPowers.setCharPref(LOCALE, "he");
- SpecialPowers.setCharPref(DIR, "rtl");
-
- css = yield fetch(cssURL);
- is(css, '* { content: "he rtl ltr right left" }', "CSS file localized in mochitest scope");
-
- SpecialPowers.clearUserPref(LOCALE);
- SpecialPowers.clearUserPref(DIR);
-
- yield extension.awaitFinish("i18n-css");
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_inIncognitoContext_window.html b/toolkit/components/webextensions/test/mochitest/test_ext_inIncognitoContext_window.html
deleted file mode 100644
index 675cbb2988..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_inIncognitoContext_window.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_in_incognito_context_true() {
- function background() {
- browser.runtime.onMessage.addListener(msg => {
- browser.test.assertEq(true, msg, "inIncognitoContext is true");
- browser.test.notifyPass("inIncognitoContext");
- });
-
- browser.windows.create({url: browser.runtime.getURL("/tab.html"), incognito: true});
- }
-
- function tabScript() {
- browser.runtime.sendMessage(browser.extension.inIncognitoContext);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- files: {
- "tab.js": tabScript,
- "tab.html": `<!DOCTYPE html><html><head>
- <meta charset="utf-8">
- <script src="tab.js"><\/script>
- </head></html>`,
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("inIncognitoContext");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_jsversion.html b/toolkit/components/webextensions/test/mochitest/test_ext_jsversion.html
deleted file mode 100644
index da0c355e0b..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_jsversion.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <meta charset="utf-8">
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_versioned_js() {
- // We need to deal with escaping the close script tags.
- // May as well consolidate it into one place.
- let script = attrs => `<script ${attrs}><\/script>`;
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "background": {"page": "background.html"},
- },
-
- files: {
- "background.html": `
- <meta charset="utf-8">
- ${script('src="background.js" type="application/javascript"')}
- ${script('src="background-1.js" type="application/javascript;version=1.8"')}
- ${script('src="background-2.js" type="application/javascript;version=latest"')}
- ${script('src="background-3.js" type="application/javascript"')}
- `,
-
- "background.js": function() {
- window.reportResult = msg => {
- browser.test.assertEq(
- msg, "background-script-3",
- "Expected a message only from the unversioned background script.");
-
- browser.test.sendMessage("finished");
- };
- },
-
- "background-1.js": function() {
- window.reportResult("background-script-1");
- },
- "background-2.js": function() {
- window.reportResult("background-script-2");
- },
- "background-3.js": function() {
- window.reportResult("background-script-3");
- },
- },
- });
-
- let messages = [/Versioned JavaScript.*not supported in WebExtension.*developer\.mozilla\.org/,
- /Versioned JavaScript.*not supported in WebExtension.*developer\.mozilla\.org/];
-
- let waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, messages);
- });
-
- info("loading extension");
-
- yield Promise.all([extension.startup(),
- extension.awaitMessage("finished")]);
-
- info("waiting for console");
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
-
- info("unloading extension");
-
- yield extension.unload();
-
- info("test complete");
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_listener_proxies.html b/toolkit/components/webextensions/test/mochitest/test_ext_listener_proxies.html
deleted file mode 100644
index ca8db873e4..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_listener_proxies.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_listener_proxies() {
- let extension = ExtensionTestUtils.loadExtension({
- useAddonManager: "temporary",
-
- manifest: {
- "permissions": ["storage"],
- },
-
- async background() {
- // Test that adding multiple listeners for the same event works as
- // expected.
-
- let awaitChanged = () => new Promise(resolve => {
- browser.storage.onChanged.addListener(function listener() {
- browser.storage.onChanged.removeListener(listener);
- resolve();
- });
- });
-
- let promises = [
- awaitChanged(),
- awaitChanged(),
- ];
-
- function removedListener() {}
- browser.storage.onChanged.addListener(removedListener);
- browser.storage.onChanged.removeListener(removedListener);
-
- promises.push(awaitChanged(), awaitChanged());
-
- browser.storage.local.set({foo: "bar"});
-
- await Promise.all(promises);
-
- browser.test.notifyPass("onchanged-listeners");
- },
- });
-
- yield extension.startup();
-
- yield extension.awaitFinish("onchanged-listeners");
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_notifications.html b/toolkit/components/webextensions/test/mochitest/test_ext_notifications.html
deleted file mode 100644
index d1b798cf96..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_notifications.html
+++ /dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for notifications</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-// A 1x1 PNG image.
-// Source: https://commons.wikimedia.org/wiki/File:1x1.png (Public Domain)
-let image = atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAA" +
- "ACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=");
-const IMAGE_ARRAYBUFFER = Uint8Array.from(image, byte => byte.charCodeAt(0)).buffer;
-
-add_task(function* test_notification() {
- async function background() {
- let opts = {
- type: "basic",
- title: "Testing Notification",
- message: "Carry on",
- };
-
- let id = await browser.notifications.create(opts);
-
- browser.test.sendMessage("running", id);
- browser.test.notifyPass("background test passed");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["notifications"],
- },
- background,
- });
- yield extension.startup();
- let x = yield extension.awaitMessage("running");
- is(x, "0", "got correct id from notifications.create");
- yield extension.awaitFinish();
- yield extension.unload();
-});
-
-add_task(function* test_notification_events() {
- async function background() {
- let opts = {
- type: "basic",
- title: "Testing Notification",
- message: "Carry on",
- };
-
- // Test an ignored listener.
- browser.notifications.onButtonClicked.addListener(function() {});
-
- // We cannot test onClicked listener without a mock
- // but we can attempt to add a listener.
- browser.notifications.onClicked.addListener(function() {});
-
- // Test onClosed listener.
- browser.notifications.onClosed.addListener(id => {
- browser.test.sendMessage("closed", id);
- browser.test.notifyPass("background test passed");
- });
-
- await browser.notifications.create("5", opts);
- let id = await browser.notifications.create("5", opts);
- browser.test.sendMessage("running", id);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["notifications"],
- },
- background,
- });
- yield extension.startup();
- let x = yield extension.awaitMessage("closed");
- is(x, "5", "got correct id from onClosed listener");
- x = yield extension.awaitMessage("running");
- is(x, "5", "got correct id from notifications.create");
- yield extension.awaitFinish();
- yield extension.unload();
-});
-
-add_task(function* test_notification_clear() {
- async function background() {
- let opts = {
- type: "basic",
- title: "Testing Notification",
- message: "Carry on",
- };
-
- browser.notifications.onClosed.addListener(id => {
- browser.test.sendMessage("closed", id);
- });
-
- let id = await browser.notifications.create("99", opts);
-
- let wasCleared = await browser.notifications.clear(id);
- browser.test.sendMessage("cleared", wasCleared);
-
- browser.test.notifyPass("background test passed");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["notifications"],
- },
- background,
- });
- yield extension.startup();
- let x = yield extension.awaitMessage("closed");
- is(x, "99", "got correct id from onClosed listener");
- x = yield extension.awaitMessage("cleared");
- is(x, true, "got correct boolean from notifications.clear");
- yield extension.awaitFinish();
- yield extension.unload();
-});
-
-add_task(function* test_notifications_empty_getAll() {
- async function background() {
- let notifications = await browser.notifications.getAll();
-
- browser.test.assertEq("object", typeof notifications, "getAll() returned an object");
- browser.test.assertEq(0, Object.keys(notifications).length, "the object has no properties");
- browser.test.notifyPass("getAll empty");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["notifications"],
- },
- background,
- });
- yield extension.startup();
- yield extension.awaitFinish("getAll empty");
- yield extension.unload();
-});
-
-add_task(function* test_notifications_populated_getAll() {
- async function background() {
- let opts = {
- type: "basic",
- iconUrl: "a.png",
- title: "Testing Notification",
- message: "Carry on",
- };
-
- await browser.notifications.create("p1", opts);
- await browser.notifications.create("p2", opts);
- let notifications = await browser.notifications.getAll();
-
- browser.test.assertEq("object", typeof notifications, "getAll() returned an object");
- browser.test.assertEq(2, Object.keys(notifications).length, "the object has 2 properties");
-
- for (let notificationId of ["p1", "p2"]) {
- for (let key of Object.keys(opts)) {
- browser.test.assertEq(
- opts[key],
- notifications[notificationId][key],
- `the notification has the expected value for option: ${key}`
- );
- }
- }
-
- browser.test.notifyPass("getAll populated");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["notifications"],
- },
- background,
- files: {
- "a.png": IMAGE_ARRAYBUFFER,
- },
- });
- yield extension.startup();
- yield extension.awaitFinish("getAll populated");
- yield extension.unload();
-});
-
-add_task(function* test_buttons_unsupported() {
- function background() {
- let opts = {
- type: "basic",
- title: "Testing Notification",
- message: "Carry on",
- buttons: [{title: "Button title"}],
- };
-
- let exception = {};
- try {
- browser.notifications.create(opts);
- } catch (e) {
- exception = e;
- }
-
- browser.test.assertTrue(
- String(exception).includes('Property "buttons" is unsupported by Firefox'),
- "notifications.create with buttons option threw an expected exception"
- );
- browser.test.notifyPass("buttons-unsupported");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["notifications"],
- },
- background,
- });
- yield extension.startup();
- yield extension.awaitFinish("buttons-unsupported");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_permission_xhr.html b/toolkit/components/webextensions/test/mochitest/test_ext_permission_xhr.html
deleted file mode 100644
index 07967d5d0e..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_permission_xhr.html
+++ /dev/null
@@ -1,119 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension Test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/* eslint-disable mozilla/balanced-listeners */
-
-add_task(function* test_simple() {
- async function runTests(cx) {
- function xhr(XMLHttpRequest) {
- return (url) => {
- return new Promise((resolve, reject) => {
- let req = new XMLHttpRequest();
- req.open("GET", url);
- req.addEventListener("load", resolve);
- req.addEventListener("error", reject);
- req.send();
- });
- };
- }
-
- function run(shouldFail, fetch) {
- function passListener() {
- browser.test.succeed(`${cx}.${fetch.name} pass listener`);
- }
-
- function failListener() {
- browser.test.fail(`${cx}.${fetch.name} fail listener`);
- }
-
- /* eslint-disable no-else-return */
- if (shouldFail) {
- return fetch("http://example.org/example.txt").then(failListener, passListener);
- } else {
- return fetch("http://example.com/example.txt").then(passListener, failListener);
- }
- /* eslint-enable no-else-return */
- }
-
- try {
- await run(true, xhr(XMLHttpRequest));
- await run(false, xhr(XMLHttpRequest));
- await run(true, xhr(window.XMLHttpRequest));
- await run(false, xhr(window.XMLHttpRequest));
- await run(true, fetch);
- await run(false, fetch);
- await run(true, window.fetch);
- await run(false, window.fetch);
- } catch (err) {
- browser.test.fail(`Error: ${err} :: ${err.stack}`);
- browser.test.notifyFail("permission_xhr");
- }
- }
-
- async function background(runTestsFn) {
- await runTestsFn("bg");
- browser.test.notifyPass("permission_xhr");
- }
-
- let extensionData = {
- background: `(${background})(${runTests})`,
- manifest: {
- permissions: ["http://example.com/"],
- content_scripts: [{
- "matches": ["http://mochi.test/*/file_permission_xhr.html"],
- "js": ["content.js"],
- }],
- },
- files: {
- "content.js": `(${async runTestsFn => {
- await runTestsFn("content");
-
- window.wrappedJSObject.privilegedFetch = fetch;
- window.wrappedJSObject.privilegedXHR = XMLHttpRequest;
-
- window.addEventListener("message", function rcv({data}) {
- switch (data.msg) {
- case "test":
- break;
-
- case "assertTrue":
- browser.test.assertTrue(data.condition, data.description);
- break;
-
- case "finish":
- window.removeEventListener("message", rcv, false);
- browser.test.sendMessage("content-script-finished");
- break;
- }
- }, false);
- window.postMessage("test", "*");
- }})(${runTests})`,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_permission_xhr.html");
- yield extension.awaitMessage("content-script-finished");
- win.close();
-
- yield extension.awaitFinish("permission_xhr");
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect.html b/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect.html
deleted file mode 100644
index 60351eaee4..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- browser.runtime.onConnect.addListener(port => {
- browser.test.assertEq(port.name, "ernie", "port name correct");
- browser.test.assertTrue(port.sender.url.endsWith("file_sample.html"), "URL correct");
- browser.test.assertTrue(port.sender.tab.url.endsWith("file_sample.html"), "tab URL correct");
-
- let expected = "message 1";
- port.onMessage.addListener(msg => {
- browser.test.assertEq(msg, expected, "message is expected");
- if (expected == "message 1") {
- port.postMessage("message 2");
- expected = "message 3";
- } else if (expected == "message 3") {
- expected = "disconnect";
- browser.test.notifyPass("runtime.connect");
- }
- });
- port.onDisconnect.addListener(() => {
- browser.test.assertEq(null, port.error, "No error because port is closed by disconnect() at other end");
- browser.test.assertEq(expected, "disconnect", "got disconnection at right time");
- });
- });
-}
-
-function contentScript() {
- let port = browser.runtime.connect({name: "ernie"});
- port.postMessage("message 1");
- port.onMessage.addListener(msg => {
- if (msg == "message 2") {
- port.postMessage("message 3");
- port.disconnect();
- }
- });
-}
-
-let extensionData = {
- background,
- manifest: {
- "permissions": ["tabs"],
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_start",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), extension.awaitFinish("runtime.connect")]);
-
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect2.html b/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect2.html
deleted file mode 100644
index dce12b21be..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect2.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function backgroundScript(token) {
- browser.runtime.onMessage.addListener(msg => {
- browser.test.assertEq(msg, "done");
- browser.test.notifyPass("sendmessage_reply");
- });
-
- browser.runtime.onConnect.addListener(port => {
- browser.test.assertTrue(port.sender.url.endsWith("file_sample.html"), "sender url correct");
- browser.test.assertTrue(port.sender.tab.url.endsWith("file_sample.html"), "sender url correct");
-
- let tabId = port.sender.tab.id;
- browser.tabs.connect(tabId, {name: token});
-
- browser.test.assertEq(port.name, token, "token matches");
- port.postMessage(token + "-done");
- });
-
- browser.test.sendMessage("background-ready");
-}
-
-function contentScript(token) {
- let gotTabMessage = false;
- let badTabMessage = false;
- browser.runtime.onConnect.addListener(port => {
- if (port.name == token) {
- gotTabMessage = true;
- } else {
- badTabMessage = true;
- }
- port.disconnect();
- });
-
- let port = browser.runtime.connect(null, {name: token});
- port.onMessage.addListener(function(msg) {
- if (msg != token + "-done" || !gotTabMessage || badTabMessage) {
- return; // test failed
- }
-
- // FIXME: Removing this line causes the test to fail:
- // resource://gre/modules/ExtensionUtils.jsm, line 651: NS_ERROR_NOT_INITIALIZED
- port.disconnect();
- browser.runtime.sendMessage("done");
- });
-}
-
-function makeExtension() {
- let token = Math.random();
- let extensionData = {
- background: `(${backgroundScript})("${token}")`,
- manifest: {
- "permissions": ["tabs"],
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- }],
- },
-
- files: {
- "content_script.js": `(${contentScript})("${token}")`,
- },
- };
- return extensionData;
-}
-
-add_task(function* test_contentscript() {
- let extension1 = ExtensionTestUtils.loadExtension(makeExtension());
- let extension2 = ExtensionTestUtils.loadExtension(makeExtension());
- yield Promise.all([extension1.startup(), extension2.startup()]);
-
- yield extension1.awaitMessage("background-ready");
- yield extension2.awaitMessage("background-ready");
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win),
- extension1.awaitFinish("sendmessage_reply"),
- extension2.awaitFinish("sendmessage_reply")]);
-
- win.close();
-
- yield extension1.unload();
- yield extension2.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect_twoway.html b/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect_twoway.html
deleted file mode 100644
index e84134eff8..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_connect_twoway.html
+++ /dev/null
@@ -1,127 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-add_task(function* test_connect_bidirectionally_and_postMessage() {
- function background() {
- let onConnectCount = 0;
- browser.runtime.onConnect.addListener(port => {
- // 3. onConnect by connect() from CS.
- browser.test.assertEq("from-cs", port.name);
- browser.test.assertEq(1, ++onConnectCount,
- "BG onConnect should be called once");
-
- let tabId = port.sender.tab.id;
- browser.test.assertTrue(tabId, "content script must have a tab ID");
-
- let port2;
- let postMessageCount1 = 0;
- port.onMessage.addListener(msg => {
- // 11. port.onMessage by port.postMessage in CS.
- browser.test.assertEq("from CS to port", msg);
- browser.test.assertEq(1, ++postMessageCount1,
- "BG port.onMessage should be called once");
-
- // 12. should trigger port2.onMessage in CS.
- port2.postMessage("from BG to port2");
- });
-
- // 4. Should trigger onConnect in CS.
- port2 = browser.tabs.connect(tabId, {name: "from-bg"});
- let postMessageCount2 = 0;
- port2.onMessage.addListener(msg => {
- // 7. onMessage by port2.postMessage in CS.
- browser.test.assertEq("from CS to port2", msg);
- browser.test.assertEq(1, ++postMessageCount2,
- "BG port2.onMessage should be called once");
-
- // 8. Should trigger port.onMessage in CS.
- port.postMessage("from BG to port");
- });
- });
-
- // 1. Notify test runner to create a new tab.
- browser.test.sendMessage("ready");
- }
-
- function contentScript() {
- let onConnectCount = 0;
- let port;
- browser.runtime.onConnect.addListener(port2 => {
- // 5. onConnect by connect() from BG.
- browser.test.assertEq("from-bg", port2.name);
- browser.test.assertEq(1, ++onConnectCount,
- "CS onConnect should be called once");
-
- let postMessageCount2 = 0;
- port2.onMessage.addListener(msg => {
- // 12. port2.onMessage by port2.postMessage in BG.
- browser.test.assertEq("from BG to port2", msg);
- browser.test.assertEq(1, ++postMessageCount2,
- "CS port2.onMessage should be called once");
-
- // TODO(robwu): Do not explicitly disconnect, it should not be a problem
- // if we keep the ports open. However, not closing the ports causes the
- // test to fail with NS_ERROR_NOT_INITIALIZED in ExtensionUtils.jsm, in
- // Port.prototype.disconnect (nsIMessageSender.sendAsyncMessage).
- port.disconnect();
- port2.disconnect();
- browser.test.notifyPass("ping pong done");
- });
- // 6. should trigger port2.onMessage in BG.
- port2.postMessage("from CS to port2");
- });
-
- // 2. should trigger onConnect in BG.
- port = browser.runtime.connect({name: "from-cs"});
- let postMessageCount1 = 0;
- port.onMessage.addListener(msg => {
- // 9. onMessage by port.postMessage in BG.
- browser.test.assertEq("from BG to port", msg);
- browser.test.assertEq(1, ++postMessageCount1,
- "CS port.onMessage should be called once");
-
- // 10. should trigger port.onMessage in BG.
- port.postMessage("from CS to port");
- });
- }
-
- let extensionData = {
- background,
- manifest: {
- content_scripts: [{
- js: ["contentscript.js"],
- matches: ["http://mochi.test/*/file_sample.html"],
- }],
- },
- files: {
- "contentscript.js": contentScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- info("extension loaded");
-
- yield extension.awaitMessage("ready");
-
- let win = window.open("file_sample.html");
- yield extension.awaitFinish("ping pong done");
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-</body>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_disconnect.html b/toolkit/components/webextensions/test/mochitest/test_ext_runtime_disconnect.html
deleted file mode 100644
index 5764d0a3c2..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_disconnect.html
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- browser.runtime.onConnect.addListener(port => {
- browser.test.assertEq(port.name, "ernie", "port name correct");
- port.onDisconnect.addListener(() => {
- browser.test.assertEq(null, port.error, "The port is implicitly closed without errors when the other context unloads");
- // Closing an already-disconnected port is a no-op.
- port.disconnect();
- port.disconnect();
- browser.test.sendMessage("disconnected");
- });
- browser.test.sendMessage("connected");
- });
-}
-
-function contentScript() {
- browser.runtime.connect({name: "ernie"});
-}
-
-let extensionData = {
- background,
- manifest: {
- "permissions": ["tabs"],
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield Promise.all([waitForLoad(win), extension.awaitMessage("connected")]);
- win.close();
- yield extension.awaitMessage("disconnected");
-
- info("win.close() succeeded");
-
- win = window.open("file_sample.html");
- yield Promise.all([waitForLoad(win), extension.awaitMessage("connected")]);
-
- // Add an "unload" listener so that we don't put the window in the
- // bfcache. This way it gets destroyed immediately upon navigation.
- win.addEventListener("unload", function() {}); // eslint-disable-line mozilla/balanced-listeners
-
- win.location = "http://example.com";
- yield extension.awaitMessage("disconnected");
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_id.html b/toolkit/components/webextensions/test/mochitest/test_ext_runtime_id.html
deleted file mode 100644
index 4cdefda410..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_runtime_id.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for browser.runtime.id</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_runtime_id() {
- function background() {
- browser.test.sendMessage("background-id", browser.runtime.id);
- }
-
- function content() {
- browser.test.sendMessage("content-id", browser.runtime.id);
- }
-
- let uuidGenerator = SpecialPowers.Cc["@mozilla.org/uuid-generator;1"].getService(SpecialPowers.Ci.nsIUUIDGenerator);
- let id = uuidGenerator.generateUUID().number;
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- applications: {gecko: {id}},
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "run_at": "document_start",
- "js": ["content_script.js"],
- }],
- },
-
- background,
-
- files: {
- "content_script.js": content,
- },
- });
-
- yield extension.startup();
-
- let backgroundId = yield extension.awaitMessage("background-id");
- is(backgroundId, id, "runtime.id from background script is correct");
- let win = window.open("file_sample.html");
- let contentId = yield extension.awaitMessage("content-id");
- is(contentId, id, "runtime.id from content script is correct");
-
- win.close();
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_sandbox_var.html b/toolkit/components/webextensions/test/mochitest/test_ext_sandbox_var.html
deleted file mode 100644
index 426a71ac6a..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_sandbox_var.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- browser.runtime.onMessage.addListener(result => {
- browser.test.assertEq(result, 12, "x is 12");
- browser.test.notifyPass("background test passed");
- });
-}
-
-function contentScript() {
- window.x = 12;
- browser.runtime.onMessage.addListener(function() {});
- browser.runtime.sendMessage(window.x);
-}
-
-let extensionData = {
- background,
- manifest: {
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), extension.awaitFinish()]);
-
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_schema.html b/toolkit/components/webextensions/test/mochitest/test_ext_schema.html
deleted file mode 100644
index 8a0e11c56c..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_schema.html
+++ /dev/null
@@ -1,73 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for schema API creation</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="chrome_head.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* testEmptySchema() {
- function background() {
- browser.test.assertEq(undefined, browser.manifest, "browser.manifest is not defined");
- browser.test.assertTrue("storage" in browser, "browser.storage should be defined");
- browser.test.assertEq(undefined, browser.contextMenus, "browser.contextMenus should not be defined");
- browser.test.notifyPass("schema");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["storage"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("schema");
- yield extension.unload();
-});
-
-add_task(function* testUnknownProperties() {
- function background() {
- browser.test.notifyPass("loaded");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["unknownPermission"],
-
- unknown_property: {},
- },
-
- background,
- });
-
- let messages = [
- {message: /processing permissions\.0: Unknown permission "unknownPermission"/},
- {message: /processing unknown_property: An unexpected property was found in the WebExtension manifest/},
- ];
-
- let waitForConsole = new Promise(resolve => {
- SimpleTest.monitorConsole(resolve, messages);
- });
-
- yield extension.startup();
-
- yield extension.awaitFinish("loaded");
-
- yield extension.unload();
-
- SimpleTest.endMonitorConsole();
- yield waitForConsole;
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_doublereply.html b/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_doublereply.html
deleted file mode 100644
index a3ef37cadf..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_doublereply.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- // Add two listeners that both send replies. We're supposed to ignore all but one
- // of them. Which one is chosen is non-deterministic.
-
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"), "sender url correct");
-
- if (msg == "getreply") {
- sendReply("reply1");
- }
- });
-
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"), "sender url correct");
-
- if (msg == "getreply") {
- sendReply("reply2");
- }
- });
-
- function sleep(callback, n = 10) {
- if (n == 0) {
- callback();
- } else {
- setTimeout(function() { sleep(callback, n - 1); }, 0);
- }
- }
-
- let done_count = 0;
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"), "sender url correct");
-
- if (msg == "done") {
- done_count++;
- browser.test.assertEq(done_count, 1, "got exactly one reply");
-
- // Go through the event loop a few times to make sure we don't get multiple replies.
- sleep(function() {
- browser.test.notifyPass("sendmessage_doublereply");
- });
- }
- });
-}
-
-function contentScript() {
- browser.runtime.sendMessage("getreply", function(resp) {
- if (resp != "reply1" && resp != "reply2") {
- return; // test failed
- }
- browser.runtime.sendMessage("done");
- });
-}
-
-let extensionData = {
- background,
- manifest: {
- "permissions": ["tabs"],
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_start",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), extension.awaitFinish("sendmessage_doublereply")]);
-
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_no_receiver.html b/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_no_receiver.html
deleted file mode 100644
index 96af6558e1..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_no_receiver.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>WebExtension test</title>
- <meta charset="utf-8">
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-<script>
-"use strict";
-
-function loadContentScriptExtension(contentScript) {
- let extensionData = {
- manifest: {
- "content_scripts": [{
- "js": ["contentscript.js"],
- "matches": ["http://mochi.test/*/file_sample.html"],
- }],
- },
- files: {
- "contentscript.js": contentScript,
- },
- };
- return ExtensionTestUtils.loadExtension(extensionData);
-}
-
-add_task(function* test_content_script_sendMessage_without_listener() {
- async function contentScript() {
- await browser.test.assertRejects(
- browser.runtime.sendMessage("msg"),
- "Could not establish connection. Receiving end does not exist.");
-
- browser.test.notifyPass("sendMessage callback was invoked");
- }
-
- let extension = loadContentScriptExtension(contentScript);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield extension.awaitFinish("sendMessage callback was invoked");
- win.close();
-
- yield extension.unload();
-});
-
-add_task(function* test_content_script_chrome_sendMessage_without_listener() {
- function contentScript() {
- /* globals chrome */
- browser.test.assertEq(null, chrome.runtime.lastError, "no lastError before call");
- let retval = chrome.runtime.sendMessage("msg");
- browser.test.assertEq(null, chrome.runtime.lastError, "no lastError after call");
- // TODO(robwu): Fix the implementation and uncomment the next expectation.
- // When content script APIs are schema-based (bugzil.la/1287007) this bug will be fixed for free.
- // browser.test.assertEq(undefined, retval, "return value of chrome.runtime.sendMessage without callback");
- browser.test.assertTrue(retval instanceof Promise, "TODO: chrome.runtime.sendMessage should return undefined, not a promise");
-
- let isAsyncCall = false;
- retval = chrome.runtime.sendMessage("msg", reply => {
- browser.test.assertEq(undefined, reply, "no reply");
- browser.test.assertTrue(isAsyncCall, "chrome.runtime.sendMessage's callback must be called asynchronously");
- browser.test.assertEq(undefined, retval, "return value of chrome.runtime.sendMessage with callback");
- browser.test.assertEq("Could not establish connection. Receiving end does not exist.", chrome.runtime.lastError.message);
- browser.test.notifyPass("finished chrome.runtime.sendMessage");
- });
- isAsyncCall = true;
- }
-
- let extension = loadContentScriptExtension(contentScript);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
- yield extension.awaitFinish("finished chrome.runtime.sendMessage");
- win.close();
-
- yield extension.unload();
-});
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply.html b/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply.html
deleted file mode 100644
index a4ac708b28..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function background() {
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"), "sender url correct");
-
- if (msg == 0) {
- sendReply("reply1");
- } else if (msg == 1) {
- window.setTimeout(function() {
- sendReply("reply2");
- }, 0);
- return true;
- } else if (msg == 2) {
- browser.test.notifyPass("sendmessage_reply");
- }
- });
-}
-
-function contentScript() {
- browser.runtime.sendMessage(0, function(resp1) {
- if (resp1 != "reply1") {
- return; // test failed
- }
- browser.runtime.sendMessage(1, function(resp2) {
- if (resp2 != "reply2") {
- return; // test failed
- }
- browser.runtime.sendMessage(2);
- });
- });
-}
-
-let extensionData = {
- background,
- manifest: {
- "permissions": ["tabs"],
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- }],
- },
-
- files: {
- "content_script.js": contentScript,
- },
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let win = window.open("file_sample.html");
-
- yield Promise.all([waitForLoad(win), extension.awaitFinish("sendmessage_reply")]);
-
- win.close();
-
- yield extension.unload();
- info("extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply2.html b/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply2.html
deleted file mode 100644
index 5c350be2fe..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_sendmessage_reply2.html
+++ /dev/null
@@ -1,181 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-function backgroundScript(token, id, otherId) {
- browser.tabs.create({url: "tab.html"});
-
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertEq(id, sender.id, `${id}: Got expected sender ID`);
-
- if (msg === `content-${token}`) {
- browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"),
- `${id}: sender url correct`);
-
- let tabId = sender.tab.id;
- browser.tabs.sendMessage(tabId, `${token}-contentMessage`);
-
- sendReply(`${token}-done`);
- } else if (msg === `tab-${token}`) {
- browser.runtime.sendMessage(otherId, `${otherId}-tabMessage`);
- browser.runtime.sendMessage(`${token}-tabMessage`);
-
- sendReply(`${token}-done`);
- } else {
- browser.test.fail(`${id}: Unexpected runtime message received: ${msg} ${uneval(sender)}`);
- }
- });
-
- browser.runtime.onMessageExternal.addListener((msg, sender, sendReply) => {
- browser.test.assertEq(otherId, sender.id, `${id}: Got expected external sender ID`);
-
- if (msg === `content-${id}`) {
- browser.test.assertTrue(sender.tab.url.endsWith("file_sample.html"),
- `${id}: external sender url correct`);
-
- sendReply(`${otherId}-done`);
- } else if (msg === `tab-${id}`) {
- sendReply(`${otherId}-done`);
- } else if (msg !== `${id}-tabMessage`) {
- browser.test.fail(`${id}: Unexpected runtime external message received: ${msg} ${uneval(sender)}`);
- }
- });
-}
-
-function contentScript(token, id, otherId) {
- let gotContentMessage = false;
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertEq(id, sender.id, `${id}: Got expected sender ID`);
-
- browser.test.assertEq(`${token}-contentMessage`, msg,
- `${id}: Correct content script message`);
- if (msg === `${token}-contentMessage`) {
- gotContentMessage = true;
- }
- });
-
- Promise.all([
- browser.runtime.sendMessage(otherId, `content-${otherId}`).then(resp => {
- browser.test.assertEq(`${id}-done`, resp, `${id}: Correct content script external response token`);
- }),
-
- browser.runtime.sendMessage(`content-${token}`).then(resp => {
- browser.test.assertEq(`${token}-done`, resp, `${id}: Correct content script response token`);
- }),
- ]).then(() => {
- browser.test.assertTrue(gotContentMessage, `${id}: Got content script message`);
-
- browser.test.sendMessage("content-script-done");
- });
-}
-
-function tabScript(token, id, otherId) {
- let gotTabMessage = false;
- browser.runtime.onMessage.addListener((msg, sender, sendReply) => {
- browser.test.assertEq(id, sender.id, `${id}: Got expected sender ID`);
-
- if (String(msg).startsWith("content-")) {
- return;
- }
-
- browser.test.assertEq(`${token}-tabMessage`, msg,
- `${id}: Correct tab script message`);
- if (msg === `${token}-tabMessage`) {
- gotTabMessage = true;
- }
- });
-
- Promise.all([
- browser.runtime.sendMessage(otherId, `tab-${otherId}`).then(resp => {
- browser.test.assertEq(`${id}-done`, resp, `${id}: Correct tab script external response token`);
- }),
-
- browser.runtime.sendMessage(`tab-${token}`).then(resp => {
- browser.test.assertEq(`${token}-done`, resp, `${id}: Correct tab script response token`);
- }),
- ]).then(() => {
- browser.test.assertTrue(gotTabMessage, `${id}: Got tab script message`);
-
- window.close();
-
- browser.test.sendMessage("tab-script-done");
- });
-}
-
-function makeExtension(id, otherId) {
- let token = Math.random();
-
- let args = `${token}, ${JSON.stringify(id)}, ${JSON.stringify(otherId)}`;
-
- let extensionData = {
- background: `(${backgroundScript})(${args})`,
- manifest: {
- "applications": {"gecko": {id}},
-
- "permissions": ["tabs"],
-
-
- "content_scripts": [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_start",
- }],
- },
-
- files: {
- "tab.html": `<!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <script src="tab.js"><\/script>
- </head>
- </html>`,
-
- "tab.js": `(${tabScript})(${args})`,
-
- "content_script.js": `(${contentScript})(${args})`,
- },
- };
- return extensionData;
-}
-
-add_task(function* test_contentscript() {
- const ID1 = "sendmessage1@mochitest.mozilla.org";
- const ID2 = "sendmessage2@mochitest.mozilla.org";
-
- let extension1 = ExtensionTestUtils.loadExtension(makeExtension(ID1, ID2));
- let extension2 = ExtensionTestUtils.loadExtension(makeExtension(ID2, ID1));
-
- yield Promise.all([extension1.startup(), extension2.startup()]);
-
- let win = window.open("file_sample.html");
-
- yield waitForLoad(win);
-
- yield Promise.all([
- extension1.awaitMessage("content-script-done"),
- extension2.awaitMessage("content-script-done"),
- extension1.awaitMessage("tab-script-done"),
- extension2.awaitMessage("tab-script-done"),
- ]);
-
- win.close();
-
- yield extension1.unload();
- yield extension2.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_storage_content.html b/toolkit/components/webextensions/test/mochitest/test_ext_storage_content.html
deleted file mode 100644
index 09a33814a8..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_storage_content.html
+++ /dev/null
@@ -1,330 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="application/javascript">
-"use strict";
-
-// Copied from toolkit/components/extensions/test/xpcshell/test_ext_storage.js.
-// The storage API in content scripts should behave identical to the storage API
-// in background pages.
-const STORAGE_SYNC_PREF = "webextensions.storage.sync.enabled";
-/**
- * Utility function to ensure that all supported APIs for getting are
- * tested.
- *
- * @param {string} areaName
- * either "local" or "sync" according to what we want to test
- * @param {string} prop
- * "key" to look up using the storage API
- * @param {Object} value
- * "value" to compare against
- */
-async function checkGetImpl(areaName, prop, value) {
- let storage = browser.storage[areaName];
-
- let data = await storage.get(null);
- browser.test.assertEq(value, data[prop], `null getter worked for ${prop} in ${areaName}`);
-
- data = await storage.get(prop);
- browser.test.assertEq(value, data[prop], `string getter worked for ${prop} in ${areaName}`);
-
- data = await storage.get([prop]);
- browser.test.assertEq(value, data[prop], `array getter worked for ${prop} in ${areaName}`);
-
- data = await storage.get({[prop]: undefined});
- browser.test.assertEq(value, data[prop], `object getter worked for ${prop} in ${areaName}`);
-}
-
-async function contentScript(checkGet) {
- let globalChanges, gResolve;
- function clearGlobalChanges() {
- globalChanges = new Promise(resolve => { gResolve = resolve; });
- }
- clearGlobalChanges();
- let expectedAreaName;
-
- browser.storage.onChanged.addListener((changes, areaName) => {
- browser.test.assertEq(expectedAreaName, areaName,
- "Expected area name received by listener");
- gResolve(changes);
- });
-
- async function checkChanges(areaName, changes, message) {
- function checkSub(obj1, obj2) {
- for (let prop in obj1) {
- browser.test.assertTrue(obj1[prop] !== undefined,
- `checkChanges ${areaName} ${prop} is missing (${message})`);
- browser.test.assertTrue(obj2[prop] !== undefined,
- `checkChanges ${areaName} ${prop} is missing (${message})`);
- browser.test.assertEq(obj1[prop].oldValue, obj2[prop].oldValue,
- `checkChanges ${areaName} ${prop} old (${message})`);
- browser.test.assertEq(obj1[prop].newValue, obj2[prop].newValue,
- `checkChanges ${areaName} ${prop} new (${message})`);
- }
- }
-
- const recentChanges = await globalChanges;
- checkSub(changes, recentChanges);
- checkSub(recentChanges, changes);
- clearGlobalChanges();
- }
-
- /* eslint-disable dot-notation */
- async function runTests(areaName) {
- expectedAreaName = areaName;
- let storage = browser.storage[areaName];
- // Set some data and then test getters.
- try {
- await storage.set({"test-prop1": "value1", "test-prop2": "value2"});
- await checkChanges(areaName,
- {"test-prop1": {newValue: "value1"}, "test-prop2": {newValue: "value2"}},
- "set (a)");
-
- await checkGet(areaName, "test-prop1", "value1");
- await checkGet(areaName, "test-prop2", "value2");
-
- let data = await storage.get({"test-prop1": undefined, "test-prop2": undefined, "other": "default"});
- browser.test.assertEq("value1", data["test-prop1"], "prop1 correct (a)");
- browser.test.assertEq("value2", data["test-prop2"], "prop2 correct (a)");
- browser.test.assertEq("default", data["other"], "other correct");
-
- data = await storage.get(["test-prop1", "test-prop2", "other"]);
- browser.test.assertEq("value1", data["test-prop1"], "prop1 correct (b)");
- browser.test.assertEq("value2", data["test-prop2"], "prop2 correct (b)");
- browser.test.assertFalse("other" in data, "other correct");
-
- // Remove data in various ways.
- await storage.remove("test-prop1");
- await checkChanges(areaName, {"test-prop1": {oldValue: "value1"}}, "remove string");
-
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertFalse("test-prop1" in data, "prop1 absent (remove string)");
- browser.test.assertTrue("test-prop2" in data, "prop2 present (remove string)");
-
- await storage.set({"test-prop1": "value1"});
- await checkChanges(areaName, {"test-prop1": {newValue: "value1"}}, "set (c)");
-
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertEq(data["test-prop1"], "value1", "prop1 correct (c)");
- browser.test.assertEq(data["test-prop2"], "value2", "prop2 correct (c)");
-
- await storage.remove(["test-prop1", "test-prop2"]);
- await checkChanges(areaName,
- {"test-prop1": {oldValue: "value1"}, "test-prop2": {oldValue: "value2"}},
- "remove array");
-
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertFalse("test-prop1" in data, "prop1 absent (remove array)");
- browser.test.assertFalse("test-prop2" in data, "prop2 absent (remove array)");
-
- // test storage.clear
- await storage.set({"test-prop1": "value1", "test-prop2": "value2"});
- // Make sure that set() handler happened before we clear the
- // promise again.
- await globalChanges;
-
- clearGlobalChanges();
- await storage.clear();
-
- await checkChanges(areaName,
- {"test-prop1": {oldValue: "value1"}, "test-prop2": {oldValue: "value2"}},
- "clear");
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertFalse("test-prop1" in data, "prop1 absent (clear)");
- browser.test.assertFalse("test-prop2" in data, "prop2 absent (clear)");
-
- // Make sure we can store complex JSON data.
- // known previous values
- await storage.set({"test-prop1": "value1", "test-prop2": "value2"});
-
- // Make sure the set() handler landed.
- await globalChanges;
-
- clearGlobalChanges();
- await storage.set({
- "test-prop1": {
- str: "hello",
- bool: true,
- null: null,
- undef: undefined,
- obj: {},
- arr: [1, 2],
- date: new Date(0),
- regexp: /regexp/,
- func: function func() {},
- window,
- },
- });
-
- await storage.set({"test-prop2": function func() {}});
- const recentChanges = await globalChanges;
-
- browser.test.assertEq("value1", recentChanges["test-prop1"].oldValue, "oldValue correct");
- browser.test.assertEq("object", typeof(recentChanges["test-prop1"].newValue), "newValue is obj");
- clearGlobalChanges();
-
- data = await storage.get({"test-prop1": undefined, "test-prop2": undefined});
- let obj = data["test-prop1"];
-
- browser.test.assertEq("hello", obj.str, "string part correct");
- browser.test.assertEq(true, obj.bool, "bool part correct");
- browser.test.assertEq(null, obj.null, "null part correct");
- browser.test.assertEq(undefined, obj.undef, "undefined part correct");
- browser.test.assertEq(undefined, obj.func, "function part correct");
- browser.test.assertEq(undefined, obj.window, "window part correct");
- browser.test.assertEq("1970-01-01T00:00:00.000Z", obj.date, "date part correct");
- browser.test.assertEq("/regexp/", obj.regexp, "regexp part correct");
- browser.test.assertEq("object", typeof(obj.obj), "object part correct");
- browser.test.assertTrue(Array.isArray(obj.arr), "array part present");
- browser.test.assertEq(1, obj.arr[0], "arr[0] part correct");
- browser.test.assertEq(2, obj.arr[1], "arr[1] part correct");
- browser.test.assertEq(2, obj.arr.length, "arr.length part correct");
-
- obj = data["test-prop2"];
-
- browser.test.assertEq("[object Object]", {}.toString.call(obj), "function serialized as a plain object");
- browser.test.assertEq(0, Object.keys(obj).length, "function serialized as an empty object");
- } catch (e) {
- browser.test.fail(`Error: ${e} :: ${e.stack}`);
- browser.test.notifyFail("storage");
- }
- }
-
- browser.test.onMessage.addListener(msg => {
- let promise;
- if (msg === "test-local") {
- promise = runTests("local");
- } else if (msg === "test-sync") {
- promise = runTests("sync");
- }
- promise.then(() => browser.test.sendMessage("test-finished"));
- });
-
- browser.test.sendMessage("ready");
-}
-
-let extensionData = {
- manifest: {
- content_scripts: [{
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- }],
-
- permissions: ["storage"],
- },
-
- files: {
- "content_script.js": `(${contentScript})(${checkGetImpl})`,
- },
-};
-
-add_task(function* test_contentscript() {
- let win = window.open("file_sample.html");
- yield waitForLoad(win);
-
- yield SpecialPowers.pushPrefEnv({
- set: [[STORAGE_SYNC_PREF, true]],
- });
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield Promise.all([extension.startup(), extension.awaitMessage("ready")]);
- extension.sendMessage("test-local");
- yield extension.awaitMessage("test-finished");
-
- extension.sendMessage("test-sync");
- yield extension.awaitMessage("test-finished");
-
- yield SpecialPowers.popPrefEnv();
- yield extension.unload();
-
- win.close();
-});
-
-add_task(function* test_local_cache_invalidation() {
- let win = window.open("file_sample.html");
-
- function background(checkGet) {
- browser.test.onMessage.addListener(async msg => {
- if (msg === "set-initial") {
- await browser.storage.local.set({"test-prop1": "value1", "test-prop2": "value2"});
- browser.test.sendMessage("set-initial-done");
- } else if (msg === "check") {
- await checkGet("local", "test-prop1", "value1");
- await checkGet("local", "test-prop2", "value2");
- browser.test.sendMessage("check-done");
- }
- });
-
- browser.test.sendMessage("ready");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["storage"],
- },
- background: `(${background})(${checkGetImpl})`,
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- extension.sendMessage("set-initial");
- yield extension.awaitMessage("set-initial-done");
-
- SpecialPowers.invalidateExtensionStorageCache();
-
- extension.sendMessage("check");
- yield extension.awaitMessage("check-done");
-
- yield extension.unload();
- win.close();
-});
-
-add_task(function* test_config_flag_needed() {
- let win = window.open("file_sample.html");
- yield waitForLoad(win);
-
- function background() {
- let promises = [];
- let apiTests = [
- {method: "get", args: ["foo"]},
- {method: "set", args: [{foo: "bar"}]},
- {method: "remove", args: ["foo"]},
- {method: "clear", args: []},
- ];
- apiTests.forEach(testDef => {
- promises.push(browser.test.assertRejects(
- browser.storage.sync[testDef.method](...testDef.args),
- "Please set webextensions.storage.sync.enabled to true in about:config",
- `storage.sync.${testDef.method} is behind a flag`));
- });
-
- Promise.all(promises).then(() => browser.test.notifyPass("flag needed"));
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["storage"],
- },
- background: `(${background})(${checkGetImpl})`,
- });
-
- yield extension.startup();
- yield extension.awaitFinish("flag needed");
- yield extension.unload();
- win.close();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_storage_tab.html b/toolkit/components/webextensions/test/mochitest/test_ext_storage_tab.html
deleted file mode 100644
index 32d8e6af0e..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_storage_tab.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_multiple_pages() {
- async function background() {
- let tabReady = new Promise(resolve => {
- browser.runtime.onMessage.addListener(function listener(msg) {
- browser.test.log("onMessage " + msg);
- if (msg == "tab-ready") {
- browser.runtime.onMessage.removeListener(listener);
- resolve();
- }
- });
- });
-
- let tabId;
- let tabRemoved = new Promise(resolve => {
- browser.tabs.onRemoved.addListener(function listener(removedId) {
- if (removedId == tabId) {
- browser.tabs.onRemoved.removeListener(listener);
-
- // Delay long enough to be sure the inner window has been nuked.
- setTimeout(resolve, 0);
- }
- });
- });
-
- try {
- let storage = browser.storage.local;
-
- browser.test.log("create");
- let tab = await browser.tabs.create({url: "tab.html"});
- tabId = tab.id;
-
- await tabReady;
-
- let result = await storage.get("key");
- browser.test.assertEq(undefined, result.key, "Key should be undefined");
-
- await browser.runtime.sendMessage("tab-set-key");
-
- result = await storage.get("key");
- browser.test.assertEq(JSON.stringify({foo: {bar: "baz"}}),
- JSON.stringify(result.key),
- "Key should be set to the value from the tab");
-
- browser.test.log("Remove tab");
-
- await Promise.all([
- browser.tabs.remove(tabId),
- tabRemoved,
- ]);
-
- result = await storage.get("key");
- browser.test.assertEq(JSON.stringify({foo: {bar: "baz"}}),
- JSON.stringify(result.key),
- "Key should still be set to the value from the tab");
-
- browser.test.notifyPass("storage-multiple");
- } catch (e) {
- browser.test.fail(`Error: ${e} :: ${e.stack}`);
- browser.test.notifyFail("storage-multiple");
- }
- }
-
- function tab() {
- browser.test.log("tab");
- browser.runtime.onMessage.addListener(msg => {
- if (msg == "tab-set-key") {
- return browser.storage.local.set({key: {foo: {bar: "baz"}}});
- }
- });
-
- browser.runtime.sendMessage("tab-ready");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
-
- files: {
- "tab.html": `<!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <script src="tab.js"><\/script>
- </head>
- </html>`,
-
- "tab.js": tab,
- },
-
- manifest: {
- permissions: ["storage"],
- },
- });
-
- yield extension.startup();
-
- yield extension.awaitFinish("storage-multiple");
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_subframes_privileges.html b/toolkit/components/webextensions/test/mochitest/test_ext_subframes_privileges.html
deleted file mode 100644
index 1f3a9a3c9f..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_subframes_privileges.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtension test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_webext_tab_subframe_privileges() {
- function background() {
- browser.runtime.onMessage.addListener(async ({msg, success, tabId, error}) => {
- if (msg == "webext-tab-subframe-privileges") {
- if (success) {
- await browser.tabs.remove(tabId);
-
- browser.test.notifyPass(msg);
- } else {
- browser.test.log(`Got an unexpected error: ${error}`);
-
- let tabs = await browser.tabs.query({active: true});
- await browser.tabs.remove(tabs[0].id);
-
- browser.test.notifyFail(msg);
- }
- }
- });
- browser.tabs.create({url: browser.runtime.getURL("/tab.html")});
- }
-
- async function tabSubframeScript() {
- browser.test.assertTrue(browser.tabs != undefined,
- "Subframe of a privileged page has access to privileged APIs");
- if (browser.tabs) {
- try {
- let tab = await browser.tabs.getCurrent();
- browser.runtime.sendMessage({
- msg: "webext-tab-subframe-privileges",
- success: true,
- tabId: tab.id,
- });
- } catch (e) {
- browser.runtime.sendMessage({msg: "webext-tab-subframe-privileges", success: false, error: `${e}`});
- }
- } else {
- browser.runtime.sendMessage({
- msg: "webext-tab-subframe-privileges",
- success: false,
- error: `Privileged APIs missing in WebExtension tab sub-frame`,
- });
- }
- }
-
- let extensionData = {
- background,
- files: {
- "tab.html": `<!DOCTYPE>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <iframe src="tab-subframe.html"></iframe>
- </body>
- </html>`,
- "tab-subframe.html": `<!DOCTYPE>
- <head>
- <meta charset="utf-8">
- <script src="tab-subframe.js"><\/script>
- </head>
- </html>`,
- "tab-subframe.js": tabSubframeScript,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- yield extension.awaitFinish("webext-tab-subframe-privileges");
- yield extension.unload();
-});
-
-add_task(function* test_webext_background_subframe_privileges() {
- function backgroundSubframeScript() {
- browser.test.assertTrue(browser.tabs != undefined,
- "Subframe of a background page has access to privileged APIs");
- browser.test.notifyPass("webext-background-subframe-privileges");
- }
-
- let extensionData = {
- manifest: {
- background: {
- page: "background.html",
- },
- },
- files: {
- "background.html": `<!DOCTYPE>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <iframe src="background-subframe.html"></iframe>
- </body>
- </html>`,
- "background-subframe.html": `<!DOCTYPE>
- <head>
- <meta charset="utf-8">
- <script src="background-subframe.js"><\/script>
- </head>
- </html>`,
- "background-subframe.js": backgroundSubframeScript,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- yield extension.awaitFinish("webext-background-subframe-privileges");
- yield extension.unload();
-});
-
-add_task(function* test_webext_contentscript_iframe_subframe_privileges() {
- function background() {
- browser.runtime.onMessage.addListener(({name, hasTabsAPI, hasStorageAPI}) => {
- if (name == "contentscript-iframe-loaded") {
- browser.test.assertFalse(hasTabsAPI,
- "Subframe of a content script privileged iframes has no access to privileged APIs");
- browser.test.assertTrue(hasStorageAPI,
- "Subframe of a content script privileged iframes has access to content script APIs");
-
- browser.test.notifyPass("webext-contentscript-subframe-privileges");
- }
- });
- }
-
- function subframeScript() {
- browser.runtime.sendMessage({
- name: "contentscript-iframe-loaded",
- hasTabsAPI: browser.tabs != undefined,
- hasStorageAPI: browser.storage != undefined,
- });
- }
-
- function contentScript() {
- let iframe = document.createElement("iframe");
- iframe.setAttribute("src", browser.runtime.getURL("/contentscript-iframe.html"));
- document.body.appendChild(iframe);
- }
-
- let extensionData = {
- background,
- manifest: {
- "permissions": ["storage"],
- "content_scripts": [{
- "matches": ["http://example.com/*"],
- "js": ["contentscript.js"],
- }],
- web_accessible_resources: [
- "contentscript-iframe.html",
- ],
- },
- files: {
- "contentscript.js": contentScript,
- "contentscript-iframe.html": `<!DOCTYPE>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- <iframe src="contentscript-iframe-subframe.html"></iframe>
- </body>
- </html>`,
- "contentscript-iframe-subframe.html": `<!DOCTYPE>
- <head>
- <meta charset="utf-8">
- <script src="contentscript-iframe-subframe.js"><\/script>
- </head>
- </html>`,
- "contentscript-iframe-subframe.js": subframeScript,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- let win = window.open("http://example.com");
-
- yield extension.awaitFinish("webext-contentscript-subframe-privileges");
-
- win.close();
-
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_tab_teardown.html b/toolkit/components/webextensions/test/mochitest/test_ext_tab_teardown.html
deleted file mode 100644
index dc351e48a1..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_tab_teardown.html
+++ /dev/null
@@ -1,150 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for extension tab teardown</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-// Test for tabs opened using tabs.create and window.open
-function* runTabReloadAndCloseTest(extension) {
- let chromeScript = SpecialPowers.loadChromeScript(
- SimpleTest.getTestFileURL("file_teardown_test.js"));
- yield chromeScript.promiseOneMessage("chromescript-startup");
- function* getContextEvents() {
- chromeScript.sendAsyncMessage("get-context-events");
- let contextEvents = yield chromeScript.promiseOneMessage("context-events");
- dump(JSON.stringify(contextEvents));
- return contextEvents.filter(event => event.extensionId == extension.id);
- }
-
- extension.sendMessage("open extension page");
- let extensionPageUrl = yield extension.awaitMessage("extension page loaded");
-
- let contextEvents = yield* getContextEvents();
- is(contextEvents.length, 1, "ExtensionContext change for opening a tab");
- is(contextEvents[0].eventType, "load", "create ExtensionContext for tab");
- is(contextEvents[0].url, extensionPageUrl,
- "ExtensionContext URL after tab creation should be tab URL");
-
- extension.sendMessage("reload extension page");
- let extensionPageUrl2 = yield extension.awaitMessage("extension page loaded");
-
- is(extensionPageUrl, extensionPageUrl2,
- "The tab's URL is expected to not change after a page reload");
-
- contextEvents = yield* getContextEvents();
- is(contextEvents.length, 2, "ExtensionContext change after tab reload");
- is(contextEvents[0].eventType, "unload", "unload old ExtensionContext");
- is(contextEvents[0].url, extensionPageUrl,
- "ExtensionContext URL before reload should be tab URL");
- is(contextEvents[1].eventType, "load", "create new ExtensionContext for tab");
- is(contextEvents[1].url, extensionPageUrl2,
- "ExtensionContext URL after reload should be tab URL");
-
- extension.sendMessage("close extension page");
- yield extension.awaitMessage("closed extension page");
-
- contextEvents = yield* getContextEvents();
- is(contextEvents.length, 1, "ExtensionContext after closing tab");
- is(contextEvents[0].eventType, "unload", "unload tab's ExtensionContext");
- is(contextEvents[0].url, extensionPageUrl2,
- "ExtensionContext URL at closing tab should be tab URL");
-
- chromeScript.sendAsyncMessage("cleanup");
- chromeScript.destroy();
- yield extension.unload();
-}
-
-add_task(function* test_extension_page_tabs_create_reload_and_close() {
- function background() {
- let tabId;
- browser.test.onMessage.addListener(msg => {
- if (msg === "open extension page") {
- chrome.tabs.create({url: "page.html"}, tab => {
- tabId = tab.id;
- });
- } else if (msg === "reload extension page") {
- chrome.tabs.reload(tabId);
- } else if (msg === "close extension page") {
- chrome.tabs.remove(tabId, () => {
- browser.test.sendMessage("closed extension page");
- });
- }
- });
- }
-
- function pageScript() {
- browser.test.sendMessage("extension page loaded", document.URL);
- }
-
- let extensionData = {
- background,
- files: {
- "page.html": `<!DOCTYPE html><meta charset="utf-8"><script src="page.js"><\/script>`,
- "page.js": pageScript,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield* runTabReloadAndCloseTest(extension);
-});
-
-add_task(function* test_extension_page_window_open_reload_and_close() {
- // This tests whether a context that is opened via window.open is properly
- // disposed when the tab closes.
- // The background page cannot use window.open (bugzil.la/1282021), so we open
- // another extension page that manages the window.open-tab for testing.
- function background() {
- chrome.tabs.create({url: "window.open.html"});
- }
-
- function windowOpenScript() {
- let win;
- browser.test.onMessage.addListener(msg => {
- if (msg === "open extension page") {
- win = window.open("page.html");
- } else if (msg === "reload extension page") {
- win.location.reload();
- } else if (msg === "close extension page") {
- browser.tabs.onRemoved.addListener(function listener() {
- browser.tabs.onRemoved.removeListener(listener);
- browser.test.sendMessage("closed extension page");
- });
- win.close();
- }
- });
- browser.test.sendMessage("setup-intermediate-tab");
- }
-
- function pageScript() {
- browser.test.sendMessage("extension page loaded", document.URL);
- }
-
- let extensionData = {
- background,
- files: {
- "page.html": `<!DOCTYPE html><meta charset="utf-8"><script src="page.js"><\/script>`,
- "page.js": pageScript,
- "window.open.html": `<!DOCTYPE html><meta charset="utf-8"><script src="window.open.js"><\/script>`,
- "window.open.js": windowOpenScript,
- },
- };
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitMessage("setup-intermediate-tab");
- yield* runTabReloadAndCloseTest(extension);
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_test.html b/toolkit/components/webextensions/test/mochitest/test_ext_test.html
deleted file mode 100644
index fef31e0e21..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_test.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Testing test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-function loadExtensionAndInterceptTest(extensionData) {
- let results = [];
- let testResolve;
- let testDone = new Promise(resolve => { testResolve = resolve; });
- let handler = {
- testResult(...result) {
- result.pop();
- results.push(result);
- SimpleTest.info(`Received test result: ${JSON.stringify(result)}`);
- },
-
- testMessage(msg, ...args) {
- results.push(["test-message", msg, ...args]);
- SimpleTest.info(`Received message: ${msg} ${JSON.stringify(args)}`);
- if (msg === "This is the last browser.test call") {
- testResolve();
- }
- },
- };
- let extension = SpecialPowers.loadExtension(extensionData, handler);
- SimpleTest.registerCleanupFunction(() => {
- if (extension.state == "pending" || extension.state == "running") {
- SimpleTest.ok(false, "Extension left running at test shutdown");
- return extension.unload();
- } else if (extension.state == "unloading") {
- SimpleTest.ok(false, "Extension not fully unloaded at test shutdown");
- }
- });
- extension.awaitResults = () => testDone.then(() => results);
- return extension;
-}
-
-function testScript() {
- // Note: The result of these browser.test calls are intercepted by the test.
- // See verifyTestResults for the expectations of each browser.test call.
- browser.test.notifyPass("dot notifyPass");
- browser.test.notifyFail("dot notifyFail");
- browser.test.log("dot log");
- browser.test.fail("dot fail");
- browser.test.succeed("dot succeed");
- browser.test.assertTrue(true);
- browser.test.assertFalse(false);
- browser.test.assertEq("", "");
-
- let obj = {};
- let arr = [];
- let dom = document.createElement("body");
- browser.test.assertTrue(obj, "Object truthy");
- browser.test.assertTrue(arr, "Array truthy");
- browser.test.assertTrue(dom, "Element truthy");
- browser.test.assertTrue(true, "True truthy");
- browser.test.assertTrue(false, "False truthy");
- browser.test.assertTrue(null, "Null truthy");
- browser.test.assertTrue(undefined, "Void truthy");
- browser.test.assertTrue(false, document.createElement("html"));
-
- browser.test.assertFalse(obj, "Object falsey");
- browser.test.assertFalse(arr, "Array falsey");
- browser.test.assertFalse(dom, "Element falsey");
- browser.test.assertFalse(true, "True falsey");
- browser.test.assertFalse(false, "False falsey");
- browser.test.assertFalse(null, "Null falsey");
- browser.test.assertFalse(undefined, "Void falsey");
- browser.test.assertFalse(true, document.createElement("head"));
-
- browser.test.assertEq(obj, obj, "Object equality");
- browser.test.assertEq(arr, arr, "Array equality");
- browser.test.assertEq(dom, dom, "Element equality");
- browser.test.assertEq(null, null, "Null equality");
- browser.test.assertEq(undefined, undefined, "Void equality");
-
- browser.test.assertEq({}, {}, "Object reference ineqality");
- browser.test.assertEq([], [], "Array reference ineqality");
- browser.test.assertEq(dom, document.createElement("body"), "Element ineqality");
- browser.test.assertEq(null, undefined, "Null and void ineqality");
- browser.test.assertEq(true, false, document.createElement("div"));
-
- obj = {
- toString() {
- return "Dynamic toString forbidden";
- },
- };
- browser.test.assertEq(obj, obj, "obj with dynamic toString()");
- browser.test.sendMessage("Ran test at", location.protocol);
- browser.test.sendMessage("This is the last browser.test call");
-}
-
-function verifyTestResults(results, shortName, expectedProtocol) {
- let expectations = [
- ["test-done", true, "dot notifyPass"],
- ["test-done", false, "dot notifyFail"],
- ["test-log", true, "dot log"],
- ["test-result", false, "dot fail"],
- ["test-result", true, "dot succeed"],
- ["test-result", true, "undefined"],
- ["test-result", true, "undefined"],
- ["test-eq", true, "undefined", "", ""],
-
- ["test-result", true, "Object truthy"],
- ["test-result", true, "Array truthy"],
- ["test-result", true, "Element truthy"],
- ["test-result", true, "True truthy"],
- ["test-result", false, "False truthy"],
- ["test-result", false, "Null truthy"],
- ["test-result", false, "Void truthy"],
- ["test-result", false, "[object HTMLHtmlElement]"],
-
- ["test-result", false, "Object falsey"],
- ["test-result", false, "Array falsey"],
- ["test-result", false, "Element falsey"],
- ["test-result", false, "True falsey"],
- ["test-result", true, "False falsey"],
- ["test-result", true, "Null falsey"],
- ["test-result", true, "Void falsey"],
- ["test-result", false, "[object HTMLHeadElement]"],
-
- ["test-eq", true, "Object equality", "[object Object]", "[object Object]"],
- ["test-eq", true, "Array equality", "", ""],
- ["test-eq", true, "Element equality", "[object HTMLBodyElement]", "[object HTMLBodyElement]"],
- ["test-eq", true, "Null equality", "null", "null"],
- ["test-eq", true, "Void equality", "undefined", "undefined"],
-
- ["test-eq", false, "Object reference ineqality", "[object Object]", "[object Object] (different)"],
- ["test-eq", false, "Array reference ineqality", "", " (different)"],
- ["test-eq", false, "Element ineqality", "[object HTMLBodyElement]", "[object HTMLBodyElement] (different)"],
- ["test-eq", false, "Null and void ineqality", "null", "undefined"],
- ["test-eq", false, "[object HTMLDivElement]", "true", "false"],
-
- ["test-eq", true, "obj with dynamic toString()", "[object Object]", "[object Object]"],
-
- ["test-message", "Ran test at", expectedProtocol],
- ["test-message", "This is the last browser.test call"],
- ];
-
- expectations.forEach((expectation, i) => {
- let msg = expectation.slice(2).join(" - ");
- isDeeply(results[i], expectation, `${shortName} (${msg})`);
- });
- is(results[expectations.length], undefined, "No more results");
-}
-
-add_task(function* test_test_in_background() {
- let extensionData = {
- background: `(${testScript})()`,
- };
-
- let extension = loadExtensionAndInterceptTest(extensionData);
- yield extension.startup();
- let results = yield extension.awaitResults();
- verifyTestResults(results, "background page", "moz-extension:");
- yield extension.unload();
-});
-
-add_task(function* test_test_in_content_script() {
- let extensionData = {
- manifest: {
- content_scripts: [{
- matches: ["http://mochi.test/*/file_sample.html"],
- js: ["contentscript.js"],
- }],
- },
- files: {
- "contentscript.js": `(${testScript})()`,
- },
- };
-
- let extension = loadExtensionAndInterceptTest(extensionData);
- yield extension.startup();
- let win = window.open("file_sample.html");
- let results = yield extension.awaitResults();
- win.close();
- verifyTestResults(results, "content script", "http:");
- yield extension.unload();
-});
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_unload_frame.html b/toolkit/components/webextensions/test/mochitest/test_ext_unload_frame.html
deleted file mode 100644
index 5572de2810..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_unload_frame.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>WebExtensions test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-</head>
-<body>
-
-<script>
-"use strict";
-
-/* globals delayedNotifyPass */ // Available in the background page of the test extensions.
-
-// Background and content script for testSendMessage_*
-function sendMessage_background() {
- browser.runtime.onMessage.addListener((msg, sender, sendResponse) => {
- browser.test.assertEq("from frame", msg, "Expected message from frame");
- sendResponse("msg from back"); // Should not throw or anything like that.
- delayedNotifyPass("Received sendMessage from closing frame");
- });
-}
-function sendMessage_contentScript(testType) {
- browser.runtime.sendMessage("from frame", reply => {
- // The frame has been removed, so we should not get this callback!
- browser.test.fail(`Unexpected reply: ${reply}`);
- });
- if (testType == "frame") {
- frameElement.remove();
- } else {
- window.close();
- }
-}
-
-// Background and content script for testConnect_*
-function connect_background() {
- browser.runtime.onConnect.addListener(port => {
- browser.test.assertEq("port from frame", port.name);
-
- let disconnected = false;
- let hasMessage = false;
- port.onDisconnect.addListener(() => {
- browser.test.assertFalse(disconnected, "onDisconnect should fire once");
- disconnected = true;
- browser.test.assertTrue(hasMessage, "Expected onMessage before onDisconnect");
- browser.test.assertEq(null, port.error, "The port is implicitly closed without errors when the other context unloads");
- delayedNotifyPass("Received onDisconnect from closing frame");
- });
- port.onMessage.addListener(msg => {
- browser.test.assertFalse(hasMessage, "onMessage should fire once");
- hasMessage = true;
- browser.test.assertFalse(disconnected, "Should get message before disconnect");
- browser.test.assertEq("from frame", msg, "Expected message from frame");
- });
-
- port.postMessage("reply to closing frame");
- });
-}
-function connect_contentScript(testType) {
- let isUnloading = false;
- addEventListener("pagehide", () => { isUnloading = true; }, {once: true});
-
- let port = browser.runtime.connect({name: "port from frame"});
- port.onMessage.addListener(msg => {
- // The background page sends a reply as soon as we call runtime.connect().
- // It is possible that the reply reaches this frame before the
- // window.close() request has been processed.
- if (!isUnloading) {
- browser.test.log(`Ignorting unexpected reply ("${msg}") because the page is not being unloaded.`);
- return;
- }
-
- // The frame has been removed, so we should not get a reply.
- browser.test.fail(`Unexpected reply: ${msg}`);
- });
- port.postMessage("from frame");
-
- // Removing the frame or window should disconnect the port.
- if (testType == "frame") {
- frameElement.remove();
- } else {
- window.close();
- }
-}
-
-// `testType` is "window" or "frame".
-function createTestExtension(testType, backgroundScript, contentScript) {
- // Make a roundtrip between the background page and the test runner (which is
- // in the same process as the content script) to make sure that we record a
- // failure in case the content script's sendMessage or onMessage handlers are
- // called even after the frame or window was removed.
- function delayedNotifyPass(msg) {
- browser.test.onMessage.addListener((type, echoMsg) => {
- if (type == "pong") {
- browser.test.assertEq(msg, echoMsg, "Echoed reply should be the same");
- browser.test.notifyPass(msg);
- }
- });
- browser.test.log("Starting ping-pong to flush messages...");
- browser.test.sendMessage("ping", msg);
- }
- let extension = ExtensionTestUtils.loadExtension({
- background: `${delayedNotifyPass};(${backgroundScript})();`,
- manifest: {
- content_scripts: [{
- js: ["contentscript.js"],
- all_frames: testType == "frame",
- matches: ["http://mochi.test/*/file_sample.html"],
- }],
- },
- files: {
- "contentscript.js": `(${contentScript})("${testType}");`,
- },
- });
- extension.awaitMessage("ping").then(msg => {
- extension.sendMessage("pong", msg);
- });
- return extension;
-}
-
-add_task(function* testSendMessage_and_remove_frame() {
- let extension = createTestExtension("frame", sendMessage_background, sendMessage_contentScript);
- yield extension.startup();
-
- let frame = document.createElement("iframe");
- frame.src = "file_sample.html";
- document.body.appendChild(frame);
-
- yield extension.awaitFinish("Received sendMessage from closing frame");
- yield extension.unload();
-});
-
-add_task(function* testConnect_and_remove_frame() {
- let extension = createTestExtension("frame", connect_background, connect_contentScript);
- yield extension.startup();
-
- let frame = document.createElement("iframe");
- frame.src = "file_sample.html";
- document.body.appendChild(frame);
-
- yield extension.awaitFinish("Received onDisconnect from closing frame");
- yield extension.unload();
-});
-
-add_task(function* testSendMessage_and_remove_window() {
- let extension = createTestExtension("window", sendMessage_background, sendMessage_contentScript);
- yield extension.startup();
-
- window.open("file_sample.html");
-
- yield extension.awaitFinish("Received sendMessage from closing frame");
- yield extension.unload();
-});
-
-add_task(function* testConnect_and_remove_window() {
- let extension = createTestExtension("window", connect_background, connect_contentScript);
- yield extension.startup();
-
- window.open("file_sample.html");
-
- yield extension.awaitFinish("Received onDisconnect from closing frame");
- yield extension.unload();
-});
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_web_accessible_resources.html b/toolkit/components/webextensions/test/mochitest/test_ext_web_accessible_resources.html
deleted file mode 100644
index fa32287394..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_web_accessible_resources.html
+++ /dev/null
@@ -1,353 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test the web_accessible_resources manifest directive</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/* eslint-disable mozilla/balanced-listeners */
-
-SimpleTest.registerCleanupFunction(() => {
- SpecialPowers.clearUserPref("security.mixed_content.block_display_content");
-});
-
-let image = atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAA" +
- "ACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=");
-const IMAGE_ARRAYBUFFER = Uint8Array.from(image, byte => byte.charCodeAt(0)).buffer;
-
-async function testImageLoading(src, expectedAction) {
- let imageLoadingPromise = new Promise((resolve, reject) => {
- let cleanupListeners;
- let testImage = document.createElement("img");
- testImage.setAttribute("src", src);
-
- let loadListener = () => {
- cleanupListeners();
- resolve(expectedAction === "loaded");
- };
-
- let errorListener = () => {
- cleanupListeners();
- resolve(expectedAction === "blocked");
- };
-
- cleanupListeners = () => {
- testImage.removeEventListener("load", loadListener);
- testImage.removeEventListener("error", errorListener);
- };
-
- testImage.addEventListener("load", loadListener);
- testImage.addEventListener("error", errorListener);
-
- document.body.appendChild(testImage);
- });
-
- let success = await imageLoadingPromise;
- browser.runtime.sendMessage({name: "image-loading", expectedAction, success});
-}
-
-add_task(function* test_web_accessible_resources() {
- function background() {
- let gotURL;
- let tabId;
-
- function loadFrame(url) {
- return new Promise(resolve => {
- browser.tabs.sendMessage(tabId, ["load-iframe", url], reply => {
- resolve(reply);
- });
- });
- }
-
- let urls = [
- [browser.extension.getURL("accessible.html"), true],
- [browser.extension.getURL("accessible.html") + "?foo=bar", true],
- [browser.extension.getURL("accessible.html") + "#!foo=bar", true],
- [browser.extension.getURL("forbidden.html"), false],
- [browser.extension.getURL("wild1.html"), true],
- [browser.extension.getURL("wild2.htm"), false],
- ];
-
- async function runTests() {
- for (let [url, shouldLoad] of urls) {
- let success = await loadFrame(url);
-
- browser.test.assertEq(shouldLoad, success, "Load was successful");
- if (shouldLoad) {
- browser.test.assertEq(url, gotURL, "Got expected url");
- } else {
- browser.test.assertEq(undefined, gotURL, "Got no url");
- }
- gotURL = undefined;
- }
-
- browser.test.notifyPass("web-accessible-resources");
- }
-
- browser.runtime.onMessage.addListener(([msg, url], sender) => {
- if (msg == "content-script-ready") {
- tabId = sender.tab.id;
- runTests();
- } else if (msg == "page-script") {
- browser.test.assertEq(undefined, gotURL, "Should have gotten only one message");
- browser.test.assertEq("string", typeof(url), "URL should be a string");
- gotURL = url;
- }
- });
-
- browser.test.sendMessage("ready");
- }
-
- function contentScript() {
- browser.runtime.onMessage.addListener(([msg, url], sender, respond) => {
- if (msg == "load-iframe") {
- let iframe = document.createElement("iframe");
- iframe.setAttribute("src", url);
- iframe.addEventListener("load", () => { respond(true); });
- iframe.addEventListener("error", () => { respond(false); });
- document.body.appendChild(iframe);
- return true;
- }
- });
- browser.runtime.sendMessage(["content-script-ready"]);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- content_scripts: [
- {
- "matches": ["http://example.com/"],
- "js": ["content_script.js"],
- "run_at": "document_idle",
- },
- ],
-
- "web_accessible_resources": [
- "/accessible.html",
- "wild*.html",
- ],
- },
-
- background,
-
- files: {
- "content_script.js": contentScript,
-
- "accessible.html": `<html><head>
- <meta charset="utf-8">
- <script src="accessible.js"><\/script>
- </head></html>`,
-
- "accessible.js": 'browser.runtime.sendMessage(["page-script", location.href]);',
-
- "inaccessible.html": `<html><head>
- <meta charset="utf-8">
- <script src="inaccessible.js"><\/script>
- </head></html>`,
-
- "inaccessible.js": 'browser.runtime.sendMessage(["page-script", location.href]);',
-
- "wild1.html": `<html><head>
- <meta charset="utf-8">
- <script src="wild.js"><\/script>
- </head></html>`,
-
- "wild2.htm": `<html><head>
- <meta charset="utf-8">
- <script src="wild.js"><\/script>
- </head></html>`,
-
- "wild.js": 'browser.runtime.sendMessage(["page-script", location.href]);',
- },
- });
-
- yield extension.startup();
-
- yield extension.awaitMessage("ready");
-
- let win = window.open("http://example.com/");
-
- yield extension.awaitFinish("web-accessible-resources");
-
- win.close();
-
- yield extension.unload();
-});
-
-add_task(function* test_web_accessible_resources_csp() {
- function background() {
- browser.runtime.onMessage.addListener((msg, sender) => {
- if (msg.name === "image-loading") {
- browser.test.assertTrue(msg.success, `Image was ${msg.expectedAction}`);
- browser.test.sendMessage(`image-${msg.expectedAction}`);
- } else {
- browser.test.sendMessage(msg);
- }
- });
-
- browser.test.sendMessage("background-ready");
- }
-
- function content() {
- window.addEventListener("message", function rcv(event) {
- browser.runtime.sendMessage("script-ran");
- window.removeEventListener("message", rcv, false);
- }, false);
-
- testImageLoading(browser.extension.getURL("image.png"), "loaded");
-
- let testScriptElement = document.createElement("script");
- testScriptElement.setAttribute("src", browser.extension.getURL("test_script.js"));
- document.head.appendChild(testScriptElement);
- browser.runtime.sendMessage("script-loaded");
- }
-
- function testScript() {
- window.postMessage("test-script-loaded", "*");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "content_scripts": [{
- "matches": ["http://example.com/*/file_csp.html"],
- "run_at": "document_start",
- "js": ["content_script_helper.js", "content_script.js"],
- }],
- "web_accessible_resources": [
- "image.png",
- "test_script.js",
- ],
- },
- background,
- files: {
- "content_script_helper.js": `${testImageLoading}`,
- "content_script.js": content,
- "test_script.js": testScript,
- "image.png": IMAGE_ARRAYBUFFER,
- },
- });
-
- // This is used to watch the blocked data bounce off CSP.
- function examiner() {
- SpecialPowers.addObserver(this, "csp-on-violate-policy", false);
- }
-
- let cspEventCount = 0;
-
- examiner.prototype = {
- observe: function(subject, topic, data) {
- cspEventCount++;
- let spec = SpecialPowers.wrap(subject).QueryInterface(SpecialPowers.Ci.nsIURI).spec;
- ok(spec.includes("file_image_bad.png") || spec.includes("file_script_bad.js"),
- `Expected file: ${spec} rejected by CSP`);
- },
-
- // We must eventually call this to remove the listener,
- // or mochitests might get borked.
- remove: function() {
- SpecialPowers.removeObserver(this, "csp-on-violate-policy");
- },
- };
-
- let observer = new examiner();
-
- yield Promise.all([extension.startup(), extension.awaitMessage("background-ready")]);
-
- let win = window.open("http://example.com/tests/toolkit/components/extensions/test/mochitest/file_csp.html");
-
- yield Promise.all([
- extension.awaitMessage("image-loaded"),
- extension.awaitMessage("script-loaded"),
- extension.awaitMessage("script-ran"),
- ]);
- is(cspEventCount, 2, "Two items were rejected by CSP");
- win.close();
-
- observer.remove();
- yield extension.unload();
-});
-
-add_task(function* test_web_accessible_resources_mixed_content() {
- function background() {
- browser.runtime.onMessage.addListener(msg => {
- if (msg.name === "image-loading") {
- browser.test.assertTrue(msg.success, `Image was ${msg.expectedAction}`);
- browser.test.sendMessage(`image-${msg.expectedAction}`);
- } else {
- browser.test.sendMessage(msg);
- if (msg === "accessible-script-loaded") {
- browser.test.notifyPass("mixed-test");
- }
- }
- });
-
- browser.test.sendMessage("background-ready");
- }
-
- function content() {
- testImageLoading("http://example.com/tests/toolkit/components/extensions/test/mochitest/file_image_bad.png", "blocked");
- testImageLoading(browser.extension.getURL("image.png"), "loaded");
-
- let testScriptElement = document.createElement("script");
- testScriptElement.setAttribute("src", browser.extension.getURL("test_script.js"));
- document.head.appendChild(testScriptElement);
-
- window.addEventListener("message", event => {
- browser.runtime.sendMessage(event.data);
- });
- }
-
- function testScript() {
- window.postMessage("accessible-script-loaded", "*");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "content_scripts": [{
- "matches": ["https://example.com/*/file_mixed.html"],
- "run_at": "document_start",
- "js": ["content_script_helper.js", "content_script.js"],
- }],
- "web_accessible_resources": [
- "image.png",
- "test_script.js",
- ],
- },
- background,
- files: {
- "content_script_helper.js": `${testImageLoading}`,
- "content_script.js": content,
- "test_script.js": testScript,
- "image.png": IMAGE_ARRAYBUFFER,
- },
- });
-
- SpecialPowers.setBoolPref("security.mixed_content.block_display_content", true);
-
- yield Promise.all([extension.startup(), extension.awaitMessage("background-ready")]);
-
- let win = window.open("https://example.com/tests/toolkit/components/extensions/test/mochitest/file_mixed.html");
-
- yield Promise.all([
- extension.awaitMessage("image-blocked"),
- extension.awaitMessage("image-loaded"),
- extension.awaitMessage("accessible-script-loaded"),
- ]);
- yield extension.awaitFinish("mixed-test");
- win.close();
-
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_webnavigation.html b/toolkit/components/webextensions/test/mochitest/test_ext_webnavigation.html
deleted file mode 100644
index 2287fd9b15..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_webnavigation.html
+++ /dev/null
@@ -1,559 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/* globals sendMouseEvent */
-
-function backgroundScript() {
- const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
- const URL = BASE + "/file_WebNavigation_page1.html";
-
- const EVENTS = [
- "onTabReplaced",
- "onBeforeNavigate",
- "onCommitted",
- "onDOMContentLoaded",
- "onCompleted",
- "onErrorOccurred",
- "onReferenceFragmentUpdated",
- "onHistoryStateUpdated",
- ];
-
- let expectedTabId = -1;
-
- function gotEvent(event, details) {
- if (!details.url.startsWith(BASE)) {
- return;
- }
- browser.test.log(`Got ${event} ${details.url} ${details.frameId} ${details.parentFrameId}`);
-
- if (expectedTabId == -1) {
- browser.test.assertTrue(details.tabId !== undefined, "tab ID defined");
- expectedTabId = details.tabId;
- }
-
- browser.test.assertEq(details.tabId, expectedTabId, "correct tab");
-
- browser.test.sendMessage("received", {url: details.url, event});
-
- if (details.url == URL) {
- browser.test.assertEq(details.frameId, 0, "root frame ID correct");
- browser.test.assertEq(details.parentFrameId, -1, "root parent frame ID correct");
- } else {
- browser.test.assertEq(details.parentFrameId, 0, "parent frame ID correct");
- browser.test.assertTrue(details.frameId != 0, "frame ID probably okay");
- }
-
- browser.test.assertTrue(details.frameId !== undefined);
- browser.test.assertTrue(details.parentFrameId !== undefined);
- }
-
- let listeners = {};
- for (let event of EVENTS) {
- listeners[event] = gotEvent.bind(null, event);
- browser.webNavigation[event].addListener(listeners[event]);
- }
-
- browser.test.sendMessage("ready");
-}
-
-const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
-const URL = BASE + "/file_WebNavigation_page1.html";
-const FRAME = BASE + "/file_WebNavigation_page2.html";
-const FRAME2 = BASE + "/file_WebNavigation_page3.html";
-const FRAME_PUSHSTATE = BASE + "/file_WebNavigation_page3_pushState.html";
-const REDIRECT = BASE + "/redirection.sjs";
-const REDIRECTED = BASE + "/dummy_page.html";
-const CLIENT_REDIRECT = BASE + "/file_webNavigation_clientRedirect.html";
-const CLIENT_REDIRECT_HTTPHEADER = BASE + "/file_webNavigation_clientRedirect_httpHeaders.html";
-const FRAME_CLIENT_REDIRECT = BASE + "/file_webNavigation_frameClientRedirect.html";
-const FRAME_REDIRECT = BASE + "/file_webNavigation_frameRedirect.html";
-const FRAME_MANUAL = BASE + "/file_webNavigation_manualSubframe.html";
-const FRAME_MANUAL_PAGE1 = BASE + "/file_webNavigation_manualSubframe_page1.html";
-const FRAME_MANUAL_PAGE2 = BASE + "/file_webNavigation_manualSubframe_page2.html";
-const INVALID_PAGE = "https://invalid.localhost/";
-
-const REQUIRED = [
- "onBeforeNavigate",
- "onCommitted",
- "onDOMContentLoaded",
- "onCompleted",
-];
-
-var received = [];
-var completedResolve;
-var waitingURL, waitingEvent;
-
-function loadAndWait(win, event, url, script) {
- received = [];
- waitingEvent = event;
- waitingURL = url;
- dump(`RUN ${script}\n`);
- script();
- return new Promise(resolve => { completedResolve = resolve; });
-}
-
-add_task(function* webnav_transitions_props() {
- function backgroundScriptTransitions() {
- const EVENTS = [
- "onCommitted",
- "onCompleted",
- ];
-
- function gotEvent(event, details) {
- browser.test.log(`Got ${event} ${details.url} ${details.transitionType} ${details.transitionQualifiers && JSON.stringify(details.transitionQualifiers)}`);
-
- browser.test.sendMessage("received", {url: details.url, details, event});
- }
-
- let listeners = {};
- for (let event of EVENTS) {
- listeners[event] = gotEvent.bind(null, event);
- browser.webNavigation[event].addListener(listeners[event]);
- }
-
- browser.test.sendMessage("ready");
- }
-
- let extensionData = {
- manifest: {
- permissions: [
- "webNavigation",
- ],
- },
- background: backgroundScriptTransitions,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- extension.onMessage("received", ({url, event, details}) => {
- received.push({url, event, details});
-
- if (event == waitingEvent && url == waitingURL) {
- completedResolve();
- }
- });
-
- yield Promise.all([extension.startup(), extension.awaitMessage("ready")]);
- info("webnavigation extension loaded");
-
- let win = window.open();
-
- yield loadAndWait(win, "onCompleted", URL, () => { win.location = URL; });
-
- // transitionType: reload
- received = [];
- yield loadAndWait(win, "onCompleted", URL, () => { win.location.reload(); });
-
- let found = received.find((data) => (data.event == "onCommitted" && data.url == URL));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "reload",
- "Got the expected 'reload' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers),
- "transitionQualifiers found in the OnCommitted events");
- }
-
- // transitionType: auto_subframe
- found = received.find((data) => (data.event == "onCommitted" && data.url == FRAME));
-
- ok(found, "Got the sub-frame onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "auto_subframe",
- "Got the expected 'auto_subframe' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers),
- "transitionQualifiers found in the OnCommitted events");
- }
-
- // transitionType: form_submit
- received = [];
- yield loadAndWait(win, "onCompleted", URL, () => {
- win.document.querySelector("form").submit();
- });
-
- found = received.find((data) => (data.event == "onCommitted" && data.url == URL));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "form_submit",
- "Got the expected 'form_submit' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers),
- "transitionQualifiers found in the OnCommitted events");
- }
-
- // transitionQualifier: server_redirect
- received = [];
- yield loadAndWait(win, "onCompleted", REDIRECTED, () => { win.location = REDIRECT; });
-
- found = received.find((data) => (data.event == "onCommitted" && data.url == REDIRECTED));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "link",
- "Got the expected 'link' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers) &&
- found.details.transitionQualifiers.find((q) => q == "server_redirect"),
- "Got the expected 'server_redirect' transitionQualifiers in the OnCommitted events");
- }
-
- // transitionQualifier: forward_back
- received = [];
- yield loadAndWait(win, "onCompleted", URL, () => { win.history.back(); });
-
- found = received.find((data) => (data.event == "onCommitted" && data.url == URL));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "link",
- "Got the expected 'link' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers) &&
- found.details.transitionQualifiers.find((q) => q == "forward_back"),
- "Got the expected 'forward_back' transitionQualifiers in the OnCommitted events");
- }
-
- // transitionQualifier: client_redirect
- // (from meta http-equiv tag)
- received = [];
- yield loadAndWait(win, "onCompleted", REDIRECTED, () => {
- win.location = CLIENT_REDIRECT;
- });
-
- found = received.find((data) => (data.event == "onCommitted" && data.url == REDIRECTED));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "link",
- "Got the expected 'link' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers) &&
- found.details.transitionQualifiers.find((q) => q == "client_redirect"),
- "Got the expected 'client_redirect' transitionQualifiers in the OnCommitted events");
- }
-
- // transitionQualifier: client_redirect
- // (from http headers)
- received = [];
- yield loadAndWait(win, "onCompleted", REDIRECTED, () => {
- win.location = CLIENT_REDIRECT_HTTPHEADER;
- });
-
- found = received.find((data) => (data.event == "onCommitted" &&
- data.url == CLIENT_REDIRECT_HTTPHEADER));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "link",
- "Got the expected 'link' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers) &&
- found.details.transitionQualifiers.find((q) => q == "client_redirect"),
- "Got the expected 'client_redirect' transitionQualifiers in the OnCommitted events");
- }
-
- // transitionQualifier: client_redirect (sub-frame)
- // (from meta http-equiv tag)
- received = [];
- yield loadAndWait(win, "onCompleted", REDIRECTED, () => {
- win.location = FRAME_CLIENT_REDIRECT;
- });
-
- found = received.find((data) => (data.event == "onCommitted" && data.url == REDIRECTED));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "auto_subframe",
- "Got the expected 'auto_subframe' transitionType in the OnCommitted event");
- ok(Array.isArray(found.details.transitionQualifiers) &&
- found.details.transitionQualifiers.find((q) => q == "client_redirect"),
- "Got the expected 'client_redirect' transitionQualifiers in the OnCommitted events");
- }
-
- // transitionQualifier: server_redirect (sub-frame)
- received = [];
- yield loadAndWait(win, "onCompleted", REDIRECTED, () => { win.location = FRAME_REDIRECT; });
-
- found = received.find((data) => (data.event == "onCommitted" && data.url == REDIRECT));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "auto_subframe",
- "Got the expected 'auto_subframe' transitionType in the OnCommitted event");
- // BUG 1264936: currently the server_redirect is not detected in sub-frames
- // once we fix it we can test it here:
- //
- // ok(Array.isArray(found.details.transitionQualifiers) &&
- // found.details.transitionQualifiers.find((q) => q == "server_redirect"),
- // "Got the expected 'server_redirect' transitionQualifiers in the OnCommitted events");
- }
-
- // transitionType: manual_subframe
- received = [];
- yield loadAndWait(win, "onCompleted", FRAME_MANUAL, () => { win.location = FRAME_MANUAL; });
- found = received.find((data) => (data.event == "onCommitted" &&
- data.url == FRAME_MANUAL_PAGE1));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "auto_subframe",
- "Got the expected 'auto_subframe' transitionType in the OnCommitted event");
- }
-
- received = [];
- yield loadAndWait(win, "onCompleted", FRAME_MANUAL_PAGE2, () => {
- let el = win.document.querySelector("iframe")
- .contentDocument.querySelector("a");
- sendMouseEvent({type: "click"}, el, win);
- });
-
- found = received.find((data) => (data.event == "onCommitted" &&
- data.url == FRAME_MANUAL_PAGE2));
-
- ok(found, "Got the onCommitted event");
-
- if (found) {
- is(found.details.transitionType, "manual_subframe",
- "Got the expected 'manual_subframe' transitionType in the OnCommitted event");
- }
-
- // cleanup phase
- win.close();
-
- yield extension.unload();
- info("webnavigation extension unloaded");
-});
-
-add_task(function* webnav_ordering() {
- let extensionData = {
- manifest: {
- permissions: [
- "webNavigation",
- ],
- },
- background: backgroundScript,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- extension.onMessage("received", ({url, event}) => {
- received.push({url, event});
-
- if (event == waitingEvent && url == waitingURL) {
- completedResolve();
- }
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
- info("webnavigation extension loaded");
-
- let win = window.open();
-
- yield loadAndWait(win, "onCompleted", URL, () => { win.location = URL; });
-
- function checkRequired(url) {
- for (let event of REQUIRED) {
- let found = false;
- for (let r of received) {
- if (r.url == url && r.event == event) {
- found = true;
- }
- }
- ok(found, `Received event ${event} from ${url}`);
- }
- }
-
- checkRequired(URL);
- checkRequired(FRAME);
-
- function checkBefore(action1, action2) {
- function find(action) {
- for (let i = 0; i < received.length; i++) {
- if (received[i].url == action.url && received[i].event == action.event) {
- return i;
- }
- }
- return -1;
- }
-
- let index1 = find(action1);
- let index2 = find(action2);
- ok(index1 != -1, `Action ${JSON.stringify(action1)} happened`);
- ok(index2 != -1, `Action ${JSON.stringify(action2)} happened`);
- ok(index1 < index2, `Action ${JSON.stringify(action1)} happened before ${JSON.stringify(action2)}`);
- }
-
- // As required in the webNavigation API documentation:
- // If a navigating frame contains subframes, its onCommitted is fired before any
- // of its children's onBeforeNavigate; while onCompleted is fired after
- // all of its children's onCompleted.
- checkBefore({url: URL, event: "onCommitted"}, {url: FRAME, event: "onBeforeNavigate"});
- checkBefore({url: FRAME, event: "onCompleted"}, {url: URL, event: "onCompleted"});
-
- // As required in the webNAvigation API documentation, check the event sequence:
- // onBeforeNavigate -> onCommitted -> onDOMContentLoaded -> onCompleted
- let expectedEventSequence = [
- "onBeforeNavigate", "onCommitted", "onDOMContentLoaded", "onCompleted",
- ];
-
- for (let i = 1; i < expectedEventSequence.length; i++) {
- let after = expectedEventSequence[i];
- let before = expectedEventSequence[i - 1];
- checkBefore({url: URL, event: before}, {url: URL, event: after});
- checkBefore({url: FRAME, event: before}, {url: FRAME, event: after});
- }
-
- yield loadAndWait(win, "onCompleted", FRAME2, () => { win.frames[0].location = FRAME2; });
-
- checkRequired(FRAME2);
-
- let navigationSequence = [
- {
- action: () => { win.frames[0].document.getElementById("elt").click(); },
- waitURL: `${FRAME2}#ref`,
- expectedEvent: "onReferenceFragmentUpdated",
- description: "clicked an anchor link",
- },
- {
- action: () => { win.frames[0].history.pushState({}, "History PushState", `${FRAME2}#ref2`); },
- waitURL: `${FRAME2}#ref2`,
- expectedEvent: "onReferenceFragmentUpdated",
- description: "history.pushState, same pathname, different hash",
- },
- {
- action: () => { win.frames[0].history.pushState({}, "History PushState", `${FRAME2}#ref2`); },
- waitURL: `${FRAME2}#ref2`,
- expectedEvent: "onHistoryStateUpdated",
- description: "history.pushState, same pathname, same hash",
- },
- {
- action: () => {
- win.frames[0].history.pushState({}, "History PushState", `${FRAME2}?query_param1=value#ref2`);
- },
- waitURL: `${FRAME2}?query_param1=value#ref2`,
- expectedEvent: "onHistoryStateUpdated",
- description: "history.pushState, same pathname, same hash, different query params",
- },
- {
- action: () => {
- win.frames[0].history.pushState({}, "History PushState", `${FRAME2}?query_param2=value#ref3`);
- },
- waitURL: `${FRAME2}?query_param2=value#ref3`,
- expectedEvent: "onHistoryStateUpdated",
- description: "history.pushState, same pathname, different hash, different query params",
- },
- {
- action: () => { win.frames[0].history.pushState(null, "History PushState", FRAME_PUSHSTATE); },
- waitURL: FRAME_PUSHSTATE,
- expectedEvent: "onHistoryStateUpdated",
- description: "history.pushState, different pathname",
- },
- ];
-
- for (let navigation of navigationSequence) {
- let {expectedEvent, waitURL, action, description} = navigation;
- info(`Waiting ${expectedEvent} from ${waitURL} - ${description}`);
- yield loadAndWait(win, expectedEvent, waitURL, action);
- info(`Received ${expectedEvent} from ${waitURL} - ${description}`);
- }
-
- for (let i = navigationSequence.length - 1; i > 0; i--) {
- let {waitURL: fromURL, expectedEvent} = navigationSequence[i];
- let {waitURL} = navigationSequence[i - 1];
- info(`Waiting ${expectedEvent} from ${waitURL} - history.back() from ${fromURL} to ${waitURL}`);
- yield loadAndWait(win, expectedEvent, waitURL, () => { win.frames[0].history.back(); });
- info(`Received ${expectedEvent} from ${waitURL} - history.back() from ${fromURL} to ${waitURL}`);
- }
-
- for (let i = 0; i < navigationSequence.length - 1; i++) {
- let {waitURL: fromURL} = navigationSequence[i];
- let {waitURL, expectedEvent} = navigationSequence[i + 1];
- info(`Waiting ${expectedEvent} from ${waitURL} - history.forward() from ${fromURL} to ${waitURL}`);
- yield loadAndWait(win, expectedEvent, waitURL, () => { win.frames[0].history.forward(); });
- info(`Received ${expectedEvent} from ${waitURL} - history.forward() from ${fromURL} to ${waitURL}`);
- }
-
- win.close();
-
- yield extension.unload();
- info("webnavigation extension unloaded");
-});
-
-add_task(function* webnav_error_event() {
- function backgroundScriptErrorEvent() {
- browser.webNavigation.onErrorOccurred.addListener((details) => {
- browser.test.log(`Got onErrorOccurred ${details.url} ${details.error}`);
-
- browser.test.sendMessage("received", {url: details.url, details, event: "onErrorOccurred"});
- });
-
- browser.test.sendMessage("ready");
- }
-
- let extensionData = {
- manifest: {
- permissions: [
- "webNavigation",
- ],
- },
- background: backgroundScriptErrorEvent,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- extension.onMessage("received", ({url, event, details}) => {
- received.push({url, event, details});
-
- if (event == waitingEvent && url == waitingURL) {
- completedResolve();
- }
- });
-
- yield Promise.all([extension.startup(), extension.awaitMessage("ready")]);
- info("webnavigation extension loaded");
-
- let win = window.open();
-
- received = [];
- yield loadAndWait(win, "onErrorOccurred", INVALID_PAGE, () => { win.location = INVALID_PAGE; });
-
- let found = received.find((data) => (data.event == "onErrorOccurred" &&
- data.url == INVALID_PAGE));
-
- ok(found, "Got the onErrorOccurred event");
-
- if (found) {
- ok(found.details.error.match(/Error code [0-9]+/),
- "Got the expected error string in the onErrorOccurred event");
- }
-
- // cleanup phase
- win.close();
-
- yield extension.unload();
- info("webnavigation extension unloaded");
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_webnavigation_filters.html b/toolkit/components/webextensions/test/mochitest/test_ext_webnavigation_filters.html
deleted file mode 100644
index a0de5e9e5d..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_webnavigation_filters.html
+++ /dev/null
@@ -1,308 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_webnav_unresolved_uri_on_expected_URI_scheme() {
- function background() {
- let lastTest;
-
- function cleanupTestListeners() {
- if (lastTest) {
- let {event, okListener, failListener} = lastTest;
- lastTest = null;
- browser.test.log(`Cleanup previous test event listeners`);
- browser.webNavigation[event].removeListener(okListener);
- browser.webNavigation[event].removeListener(failListener);
- }
- }
-
- function createTestListener(event, fail, urlFilter) {
- function listener(details) {
- let log = JSON.stringify({url: details.url, urlFilter});
- if (fail) {
- browser.test.fail(`Got an unexpected ${event} on the failure listener: ${log}`);
- } else {
- browser.test.succeed(`Got the expected ${event} on the success listener: ${log}`);
- }
-
- cleanupTestListeners();
- browser.test.sendMessage("test-filter-next");
- }
-
- browser.webNavigation[event].addListener(listener, urlFilter);
-
- return listener;
- }
-
- browser.test.onMessage.addListener((msg, event, okFilter, failFilter) => {
- if (msg !== "test-filter") {
- return;
- }
-
- lastTest = {
- event,
- // Register the failListener first, which should not be called
- // and if it is called the test scenario is marked as a failure.
- failListener: createTestListener(event, true, failFilter),
- okListener: createTestListener(event, false, okFilter),
- };
-
- browser.test.sendMessage("test-filter-ready");
- });
-
- browser.test.sendMessage("ready");
- }
-
- let extensionData = {
- manifest: {
- permissions: [
- "webNavigation",
- ],
- },
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- yield extension.awaitMessage("ready");
-
- let win = window.open();
-
- let testFilterScenarios = [
- {
- url: "http://example.net/browser",
- filters: [
- // schemes
- {
- okFilter: [{schemes: ["http"]}],
- failFilter: [{schemes: ["https"]}],
- },
- // ports
- {
- okFilter: [{ports: [80, 22, 443]}],
- failFilter: [{ports: [81, 82, 83]}],
- },
- {
- okFilter: [{ports: [22, 443, [10, 80]]}],
- failFilter: [{ports: [22, 23, [81, 100]]}],
- },
- ],
- },
- {
- url: "http://example.net/browser?param=1#ref",
- filters: [
- // host: Equals, Contains, Prefix, Suffix
- {
- okFilter: [{hostEquals: "example.net"}],
- failFilter: [{hostEquals: "example.com"}],
- },
- {
- okFilter: [{hostContains: ".example"}],
- failFilter: [{hostContains: ".www"}],
- },
- {
- okFilter: [{hostPrefix: "example"}],
- failFilter: [{hostPrefix: "www"}],
- },
- {
- okFilter: [{hostSuffix: "net"}],
- failFilter: [{hostSuffix: "com"}],
- },
- // path: Equals, Contains, Prefix, Suffix
- {
- okFilter: [{pathEquals: "/browser"}],
- failFilter: [{pathEquals: "/"}],
- },
- {
- okFilter: [{pathContains: "brow"}],
- failFilter: [{pathContains: "tool"}],
- },
- {
- okFilter: [{pathPrefix: "/bro"}],
- failFilter: [{pathPrefix: "/tool"}],
- },
- {
- okFilter: [{pathSuffix: "wser"}],
- failFilter: [{pathSuffix: "kit"}],
- },
- // query: Equals, Contains, Prefix, Suffix
- {
- okFilter: [{queryEquals: "param=1"}],
- failFilter: [{queryEquals: "wrongparam=2"}],
- },
- {
- okFilter: [{queryContains: "param"}],
- failFilter: [{queryContains: "wrongparam"}],
- },
- {
- okFilter: [{queryPrefix: "param="}],
- failFilter: [{queryPrefix: "wrong"}],
- },
- {
- okFilter: [{querySuffix: "=1"}],
- failFilter: [{querySuffix: "=2"}],
- },
- // urlMatches, originAndPathMatches
- {
- okFilter: [{urlMatches: "example.net/.*\?param=1"}],
- failFilter: [{urlMatches: "example.net/.*\?wrongparam=2"}],
- },
- {
- okFilter: [{originAndPathMatches: "example.net\/browser"}],
- failFilter: [{originAndPathMatches: "example.net/.*\?param=1"}],
- },
- ],
- },
- {
- url: "http://example.net/browser",
- filters: [
- // multiple criteria in a single filter:
- // if one of the critera is not verified, the event should not be received.
- {
- okFilter: [{schemes: ["http"], ports: [80, 22, 443]}],
- failFilter: [{schemes: ["http"], ports: [81, 82, 83]}],
- },
- // multiple urlFilters on the same listener
- // if at least one of the critera is verified, the event should be received.
- {
- okFilter: [{schemes: ["https"]}, {ports: [80, 22, 443]}],
- failFilter: [{schemes: ["https"]}, {ports: [81, 82, 83]}],
- },
- ],
- },
- ];
-
- function* runTestScenario(event, {url, filters}) {
- for (let testFilters of filters) {
- let {okFilter, failFilter} = testFilters;
-
- info(`Prepare the new test scenario: ${event} ${url} ${JSON.stringify(testFilters)}`);
- win.location = "about:blank";
-
- extension.sendMessage("test-filter", event, {url: okFilter}, {url: failFilter});
- yield extension.awaitMessage("test-filter-ready");
-
- info(`Loading the test url: ${url}`);
- win.location = url;
-
- yield extension.awaitMessage("test-filter-next");
-
- info("Test scenario completed. Moving to the next test scenario.");
- }
- }
-
- const BASE_WEBNAV_EVENTS = [
- "onBeforeNavigate",
- "onCommitted",
- "onDOMContentLoaded",
- "onCompleted",
- ];
-
- info("WebNavigation event filters test scenarios starting...");
-
- for (let filterScenario of testFilterScenarios) {
- for (let event of BASE_WEBNAV_EVENTS) {
- yield runTestScenario(event, filterScenario);
- }
- }
-
- info("WebNavigation event filters test onReferenceFragmentUpdated scenario starting...");
-
- const BASE = "http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest";
- let url = BASE + "/file_WebNavigation_page3.html";
-
- let okFilter = [{urlContains: "_page3.html"}];
- let failFilter = [{ports: [444]}];
- let event = "onCompleted";
-
- info(`Loading the initial test url: ${url}`);
- extension.sendMessage("test-filter", event, {url: okFilter}, {url: failFilter});
-
- yield extension.awaitMessage("test-filter-ready");
- win.location = url;
- yield extension.awaitMessage("test-filter-next");
-
- event = "onReferenceFragmentUpdated";
- extension.sendMessage("test-filter", event, {url: okFilter}, {url: failFilter});
-
- yield extension.awaitMessage("test-filter-ready");
- win.location = url + "#ref1";
- yield extension.awaitMessage("test-filter-next");
-
- info("WebNavigation event filters test onHistoryStateUpdated scenario starting...");
-
- event = "onHistoryStateUpdated";
- extension.sendMessage("test-filter", event, {url: okFilter}, {url: failFilter});
- yield extension.awaitMessage("test-filter-ready");
-
- win.history.pushState({}, "", BASE + "/pushState_page3.html");
- yield extension.awaitMessage("test-filter-next");
-
- // TODO: add additional specific tests for the other webNavigation events:
- // onErrorOccurred (and onCreatedNavigationTarget on supported)
-
- info("WebNavigation event filters test scenarios completed.");
-
- yield extension.unload();
-
- win.close();
-});
-
-add_task(function* test_webnav_empty_filter_validation_error() {
- function background() {
- let catchedException;
-
- try {
- browser.webNavigation.onCompleted.addListener(
- // Empty callback (not really used)
- () => {},
- // Empty filter (which should raise a validation error exception).
- {url: []}
- );
- } catch (e) {
- catchedException = e;
- browser.test.log(`Got an exception`);
- }
-
- if (catchedException &&
- catchedException.message.includes("Type error for parameter filters") &&
- catchedException.message.includes("Array requires at least 1 items; you have 0")) {
- browser.test.notifyPass("webNav.emptyFilterValidationError");
- } else {
- browser.test.notifyFail("webNav.emptyFilterValidationError");
- }
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webNavigation",
- ],
- },
- background,
- });
-
- yield extension.startup();
-
- yield extension.awaitFinish("webNav.emptyFilterValidationError");
-
- yield extension.unload();
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_background_events.html b/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_background_events.html
deleted file mode 100644
index 78efeab350..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_background_events.html
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_webRequest_serviceworker_events() {
- yield SpecialPowers.pushPrefEnv({
- set: [["dom.serviceWorkers.testing.enabled", true],
- ["dom.serviceWorkers.enabled", true],
- ["dom.serviceWorkers.openWindow.enabled", true],
- ],
- });
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "<all_urls>",
- ],
- },
- background() {
- let eventNames = new Set([
- "onBeforeRequest",
- "onBeforeSendHeaders",
- "onSendHeaders",
- "onHeadersReceived",
- "onResponseStarted",
- "onCompleted",
- ]);
-
- function listener(name, details) {
- browser.test.assertTrue(eventNames.has(name), `recieved ${name}`);
- eventNames.delete(name);
- if (eventNames.size == 0) {
- browser.test.sendMessage("done");
- }
- }
-
- for (let name of eventNames) {
- browser.webRequest[name].addListener(
- listener.bind(null, name),
- {urls: ["https://example.com/*"]}
- );
- }
- },
- });
-
- yield extension.startup();
- let registration = yield navigator.serviceWorker.register("webrequest_worker.js", {scope: "."});
- yield extension.awaitMessage("done");
- yield registration.unregister();
- yield extension.unload();
-});
-
-add_task(function* test_webRequest_background_events() {
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "<all_urls>",
- ],
- },
- background() {
- let eventNames = new Set([
- "onBeforeRequest",
- "onBeforeSendHeaders",
- "onSendHeaders",
- "onHeadersReceived",
- "onResponseStarted",
- "onCompleted",
- ]);
-
- function listener(name, details) {
- browser.test.assertTrue(eventNames.has(name), `recieved ${name}`);
- eventNames.delete(name);
-
- if (eventNames.size === 0) {
- browser.test.assertEq(0, eventNames.size, "messages recieved");
- browser.test.sendMessage("done");
- }
- }
-
- for (let name of eventNames) {
- browser.webRequest[name].addListener(
- listener.bind(null, name),
- {urls: ["https://example.com/*"]}
- );
- }
-
- fetch("https://example.com/example.txt").then(() => {
- browser.test.pass("Fetch succeeded.");
- }, () => {
- browser.test.fail("fetch recieved");
- browser.test.sendMessage("done");
- });
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("done");
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_basic.html b/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_basic.html
deleted file mode 100644
index ef77fee3be..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_basic.html
+++ /dev/null
@@ -1,327 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <script type="text/javascript" src="head_webrequest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-<script>
-"use strict";
-
-let extension;
-add_task(function* setup() {
- // SelfSupport has a tendency to fire when running this test alone, without
- // a good way to turn it off we just set the url to ""
- yield SpecialPowers.pushPrefEnv({
- set: [["browser.selfsupport.url", ""]],
- });
-
- // Clear the image cache, since it gets in the way otherwise.
- let imgTools = SpecialPowers.Cc["@mozilla.org/image/tools;1"].getService(SpecialPowers.Ci.imgITools);
- let cache = imgTools.getImgCacheForDocument(document);
- cache.clearCache(false);
-
- extension = makeExtension();
- yield extension.startup();
-});
-
-// expect is a set of test values used by the background script.
-//
-// type: type of request action
-// events: optional, If defined only the events listed are expected for the
-// request. If undefined, all events except onErrorOccurred
-// and onBeforeRedirect are expected. Must be in order received.
-// redirect: url to redirect to during onBeforeSendHeaders
-// status: number expected status during onHeadersReceived, 200 default
-// cancel: event in which we return cancel=true. cancelled message is sent.
-// cached: expected fromCache value, default is false, checked in onCompletion
-// headers: request or response headers to modify
-
-add_task(function* test_webRequest_links() {
- let expect = {
- "file_style_bad.css": {
- type: "stylesheet",
- events: ["onBeforeRequest", "onErrorOccurred"],
- cancel: "onBeforeRequest",
- },
- "file_style_redirect.css": {
- type: "stylesheet",
- events: ["onBeforeRequest", "onBeforeSendHeaders", "onBeforeRedirect"],
- optional_events: ["onHeadersReceived"],
- redirect: "file_style_good.css",
- },
- "file_style_good.css": {
- type: "stylesheet",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addStylesheet("file_style_bad.css");
- yield extension.awaitMessage("cancelled");
- // we redirect to style_good which completes the test
- addStylesheet("file_style_redirect.css");
- yield extension.awaitMessage("done");
-
- let style = window.getComputedStyle(document.getElementById("test"), null);
- is(style.getPropertyValue("color"), "rgb(255, 0, 0)", "Good CSS loaded");
-});
-
-add_task(function* test_webRequest_images() {
- let expect = {
- "file_image_bad.png": {
- type: "image",
- events: ["onBeforeRequest", "onErrorOccurred"],
- cancel: "onBeforeRequest",
- },
- "file_image_redirect.png": {
- type: "image",
- events: ["onBeforeRequest", "onBeforeSendHeaders", "onBeforeRedirect"],
- optional_events: ["onHeadersReceived"],
- redirect: "file_image_good.png",
- },
- "file_image_good.png": {
- type: "image",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addImage("file_image_bad.png");
- yield extension.awaitMessage("cancelled");
- // we redirect to image_good which completes the test
- addImage("file_image_redirect.png");
- yield extension.awaitMessage("done");
-});
-
-add_task(function* test_webRequest_scripts() {
- let expect = {
- "file_script_bad.js": {
- type: "script",
- events: ["onBeforeRequest", "onErrorOccurred"],
- cancel: "onBeforeRequest",
- },
- "file_script_redirect.js": {
- type: "script",
- events: ["onBeforeRequest", "onBeforeSendHeaders", "onBeforeRedirect"],
- optional_events: ["onHeadersReceived"],
- redirect: "file_script_good.js",
- },
- "file_script_good.js": {
- type: "script",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addScript("file_script_bad.js");
- yield extension.awaitMessage("cancelled");
- // we redirect to script_good which completes the test
- addScript("file_script_redirect.js");
- yield extension.awaitMessage("done");
-
- is(window.success, 1, "Good script ran");
- is(window.failure, undefined, "Failure script didn't run");
-});
-
-add_task(function* test_webRequest_xhr_get() {
- let expect = {
- "file_script_xhr.js": {
- type: "script",
- },
- "xhr_resource": {
- status: 404,
- type: "xmlhttprequest",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addScript("file_script_xhr.js");
- yield extension.awaitMessage("done");
-});
-
-add_task(function* test_webRequest_nonexistent() {
- let expect = {
- "nonexistent_script_url.js": {
- status: 404,
- type: "script",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addScript("nonexistent_script_url.js");
- yield extension.awaitMessage("done");
-});
-
-add_task(function* test_webRequest_checkCached() {
- let expect = {
- "file_image_good.png": {
- type: "image",
- cached: true,
- },
- "file_script_good.js": {
- type: "script",
- cached: true,
- },
- "file_style_good.css": {
- type: "stylesheet",
- cached: true,
- },
- "nonexistent_script_url.js": {
- status: 404,
- type: "script",
- cached: false,
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addImage("file_image_good.png");
- addScript("file_script_good.js");
- addStylesheet("file_style_good.css");
- addScript("nonexistent_script_url.js");
- yield extension.awaitMessage("done");
-
- is(window.success, 2, "Good script ran");
- is(window.failure, undefined, "Failure script didn't run");
-});
-
-add_task(function* test_webRequest_headers() {
- let expect = {
- "file_script_nonexistent.js": {
- type: "script",
- status: 404,
- headers: {
- request: {
- add: {
- "X-WebRequest-request": "text",
- "X-WebRequest-request-binary": "binary",
- },
- modify: {
- "user-agent": "WebRequest",
- },
- remove: [
- "referer",
- ],
- },
- response: {
- add: {
- "X-WebRequest-response": "text",
- "X-WebRequest-response-binary": "binary",
- },
- modify: {
- "server": "WebRequest",
- "content-type": "text/html; charset=utf-8",
- },
- remove: [
- "connection",
- ],
- },
- },
- completion: "onCompleted",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addScript("file_script_nonexistent.js");
- yield extension.awaitMessage("done");
-});
-
-add_task(function* test_webRequest_tabId() {
- let expect = {
- "file_WebRequest_page3.html": {
- type: "main_frame",
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- let a = addLink("file_WebRequest_page3.html?trigger=a");
- a.click();
- yield extension.awaitMessage("done");
-});
-
-add_task(function* test_webRequest_tabId_browser() {
- async function background(url) {
- let tabId;
- browser.test.onMessage.addListener(async (msg, expected) => {
- await browser.tabs.remove(tabId);
- browser.test.sendMessage("done");
- });
-
- let tab = await browser.tabs.create({url});
- tabId = tab.id;
- }
-
- let tabExt = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "tabs",
- ],
- },
- background: `(${background})('${SimpleTest.getTestFileURL("file_sample.html")}?nocache=${Math.random()}')`,
- });
-
- let expect = {
- "file_sample.html": {
- type: "main_frame",
- },
- };
- // expecting origin == undefined
- extension.sendMessage("set-expected", {expect});
- yield extension.awaitMessage("continue");
-
- // open a tab from a system principal
- yield tabExt.startup();
-
- yield extension.awaitMessage("done");
- tabExt.sendMessage("done");
- yield tabExt.awaitMessage("done");
- yield tabExt.unload();
-});
-
-add_task(function* test_webRequest_frames() {
- let expect = {
- "text/plain,webRequestTest": {
- type: "sub_frame",
- events: ["onBeforeRequest", "onCompleted"],
- },
- "text/plain,webRequestTest_bad": {
- type: "sub_frame",
- events: ["onBeforeRequest", "onCompleted"],
- cancel: "onBeforeRequest",
- },
- "redirection.sjs": {
- status: 302,
- type: "sub_frame",
- events: ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", "onHeadersReceived", "onBeforeRedirect"],
- },
- "dummy_page.html": {
- type: "sub_frame",
- status: 404,
- },
- "badrobot": {
- type: "sub_frame",
- status: 404,
- events: ["onBeforeRequest", "onBeforeSendHeaders", "onSendHeaders", "onErrorOccurred"],
- },
- };
- extension.sendMessage("set-expected", {expect, origin: location.href});
- yield extension.awaitMessage("continue");
- addFrame("data:text/plain,webRequestTest");
- addFrame("data:text/plain,webRequestTest_bad");
- yield extension.awaitMessage("cancelled");
- addFrame("redirection.sjs");
- addFrame("https://invalid.localhost/badrobot");
- yield extension.awaitMessage("done");
-});
-
-add_task(function* teardown() {
- yield extension.unload();
-});
-</script>
-</head>
-<body>
-<div id="test">Sample text</div>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_suspend.html b/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_suspend.html
deleted file mode 100644
index c8423ec7cd..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_suspend.html
+++ /dev/null
@@ -1,216 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for simple WebExtension</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_suspend() {
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "webRequestBlocking",
- ],
- },
-
- background() {
- browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
- // Make sure that returning undefined or a promise that resolves to
- // undefined does not break later handlers.
- },
- {urls: ["<all_urls>"]},
- ["blocking", "requestHeaders"]);
-
- browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
- return Promise.resolve();
- },
- {urls: ["<all_urls>"]},
- ["blocking", "requestHeaders"]);
-
- browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
- let requestHeaders = details.requestHeaders.concat({name: "Foo", value: "Bar"});
-
- return new Promise(resolve => {
- setTimeout(resolve, 500);
- }).then(() => {
- return {requestHeaders};
- });
- },
- {urls: ["<all_urls>"]},
- ["blocking", "requestHeaders"]);
- },
- });
-
- yield extension.startup();
-
- let result = yield fetch(SimpleTest.getTestFileURL("return_headers.sjs"));
-
- let headers = JSON.parse(yield result.text());
-
- is(headers.foo, "Bar", "Request header was correctly set on suspended request");
-
- yield extension.unload();
-});
-
-
-// Test that requests that were canceled while suspended for a blocking
-// listener are correctly resumed.
-add_task(function* test_error_resume() {
- let chromeScript = SpecialPowers.loadChromeScript(() => {
- const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- let observer = channel => {
- if (channel instanceof Ci.nsIHttpChannel && channel.URI.spec === "http://example.com/") {
- Services.obs.removeObserver(observer, "http-on-modify-request");
-
- // Wait until the next tick to make sure this runs after WebRequest observers.
- Promise.resolve().then(() => {
- channel.cancel(Cr.NS_BINDING_ABORTED);
- });
- }
- };
-
- Services.obs.addObserver(observer, "http-on-modify-request", false);
- });
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "webRequestBlocking",
- ],
- },
-
- background() {
- browser.webRequest.onBeforeSendHeaders.addListener(
- details => {
- browser.test.log(`onBeforeSendHeaders({url: ${details.url}})`);
-
- if (details.url === "http://example.com/") {
- browser.test.sendMessage("got-before-send-headers");
- }
- },
- {urls: ["<all_urls>"]},
- ["blocking"]);
-
- browser.webRequest.onErrorOccurred.addListener(
- details => {
- browser.test.log(`onErrorOccurred({url: ${details.url}})`);
-
- if (details.url === "http://example.com/") {
- browser.test.sendMessage("got-error-occurred");
- }
- },
- {urls: ["<all_urls>"]});
- },
- });
-
- yield extension.startup();
-
- try {
- yield fetch("http://example.com/");
- ok(false, "Fetch should have failed.");
- } catch (e) {
- ok(true, "Got expected error.");
- }
-
- yield extension.awaitMessage("got-before-send-headers");
- yield extension.awaitMessage("got-error-occurred");
-
- yield extension.unload();
- chromeScript.destroy();
-});
-
-
-// Test that response header modifications take effect before onStartRequest fires.
-add_task(function* test_set_responseHeaders() {
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "webRequestBlocking",
- "http://example.com/",
- ],
- },
-
- background() {
- browser.webRequest.onHeadersReceived.addListener(
- details => {
- browser.test.log(`onHeadersReceived({url: ${details.url}})`);
-
- details.responseHeaders.push({name: "foo", value: "bar"});
-
- return {responseHeaders: details.responseHeaders};
- },
- {urls: ["http://example.com/?modify_headers"]},
- ["blocking", "responseHeaders"]);
- },
- });
-
- yield extension.startup();
-
- yield new Promise(resolve => setTimeout(resolve, 0));
-
- let chromeScript = SpecialPowers.loadChromeScript(() => {
- const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
- Cu.import("resource://gre/modules/NetUtil.jsm");
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
- let ssm = Services.scriptSecurityManager;
-
- let channel = NetUtil.newChannel({
- uri: "http://example.com/?modify_headers",
- loadingPrincipal: ssm.createCodebasePrincipalFromOrigin("http://example.com"),
- contentPolicyType: Ci.nsIContentPolicy.TYPE_XMLHTTPREQUEST,
- securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- });
-
- channel.asyncOpen2({
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamListener]),
-
- onStartRequest(request, context) {
- request.QueryInterface(Ci.nsIHttpChannel);
-
- try {
- sendAsyncMessage("response-header-foo", request.getResponseHeader("foo"));
- } catch (e) {
- sendAsyncMessage("response-header-foo", null);
- }
- request.cancel(Cr.NS_BINDING_ABORTED);
- },
-
- onStopRequest() {
- },
-
- onDataAvailable() {
- throw new Components.Exception("", Cr.NS_ERROR_FAILURE);
- },
- });
- });
-
- let headerValue = yield chromeScript.promiseOneMessage("response-header-foo");
- is(headerValue, "bar", "Expected Foo header value");
-
- yield extension.unload();
- chromeScript.destroy();
-});
-
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_upload.html b/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_upload.html
deleted file mode 100644
index 998ab98003..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_webrequest_upload.html
+++ /dev/null
@@ -1,199 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<form method="post"
- action="file_WebRequest_page3.html?trigger=form"
- target="_blank"
- enctype="multipart/form-data"
- >
-<input type="text" name="&quot;special&quot; chˆrs" value="spÛcial">
-<input type="file" name="testFile">
-<input type="file" name="emptyFile">
-<input type="text" name="textInput1" value="value1">
-</form>
-
-<form method="post"
- action="file_WebRequest_page3.html?trigger=form"
- target="_blank"
- enctype="multipart/form-data"
- >
-<input type="text" name="textInput2" value="value2">
-<input type="file" name="testFile">
-<input type="file" name="emptyFile">
-</form>
-
-</form>
-<form method="post"
- action="file_WebRequest_page3.html?trigger=form"
- target="_blank"
- >
-<input type="text" name="textInput" value="value1">
-<input type="text" name="textInput" value="value2">
-</form>
-<script>
-"use strict";
-
-let files, testFile, blob, file, uploads;
-add_task(function* test_setup() {
- files = yield new Promise(resolve => {
- SpecialPowers.createFiles([{name: "testFile.pdf", data: "Not really a PDF file :)", "type": "application/x-pdf"}], (result) => {
- resolve(result);
- });
- });
- testFile = files[0];
- blob = {
- name: "blobAsFile",
- content: new Blob(["A blob sent as a file"], {type: "text/csv"}),
- fileName: "blobAsFile.csv",
- };
- file = {
- name: "testFile",
- fileName: testFile.name,
- };
- uploads = {
- [blob.name]: blob,
- [file.name]: file,
- };
-});
-
-function background() {
- const FILTERS = {urls: ["<all_urls>"]};
-
- let requestBodySupported = true;
-
- function onUpload(details) {
- let url = new URL(details.url);
- let upload = url.searchParams.get("upload");
- if (!upload || !requestBodySupported) {
- return;
- }
- let requestBody = details.requestBody;
- browser.test.log(`onBeforeRequest upload: ${details.url} ${JSON.stringify(details.requestBody)}`);
- browser.test.assertTrue(!!requestBody, `Intercepted upload ${details.url} #${details.requestId} ${upload} have a requestBody`);
- if (!requestBody) {
- return;
- }
- let byteLength = parseInt(upload, 10);
- if (byteLength) {
- browser.test.assertTrue(!!requestBody.raw, `Binary upload ${details.url} #${details.requestId} ${upload} have a raw attribute`);
- browser.test.assertEq(byteLength, requestBody.raw && requestBody.raw.map(r => r.bytes && r.bytes.byteLength || 0).reduce((a, b) => a + b), `Binary upload size matches`);
- return;
- }
- if ("raw" in requestBody) {
- browser.test.assertEq(upload, JSON.stringify(requestBody.raw).replace(/(\bfile: ")[^"]+/, "$1<file>"), `Upload ${details.url} #${details.requestId} matches raw data`);
- } else {
- browser.test.assertEq(upload, JSON.stringify(requestBody.formData), `Upload ${details.url} #${details.requestId} matches form data.`);
- }
- }
-
- browser.webRequest.onCompleted.addListener(
- details => {
- browser.test.log(`onCompleted ${details.requestId} ${details.url}`);
-
- browser.test.sendMessage("done");
- },
- FILTERS);
-
- let onBeforeRequest = details => {
- browser.test.log(`${name} ${details.requestId} ${details.url}`);
-
- onUpload(details);
- };
-
- try {
- browser.webRequest.onBeforeRequest.addListener(
- onBeforeRequest, FILTERS, ["requestBody"]);
- } catch (e) {
- browser.test.assertTrue(/\brequestBody\b/.test(e.message),
- "Request body is unsupported");
-
- // requestBody is disabled in release builds
- if (!/\brequestBody\b/.test(e.message)) {
- throw e;
- }
-
- browser.webRequest.onBeforeRequest.addListener(
- onBeforeRequest, FILTERS);
- }
-}
-
-add_task(function* test_xhr_forms() {
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: [
- "webRequest",
- "webRequestBlocking",
- "<all_urls>",
- ],
- },
- background,
- });
-
- yield extension.startup();
-
- for (let form of document.forms) {
- if (file.name in form.elements) {
- SpecialPowers.wrap(form.elements[file.name]).mozSetFileArray(files);
- }
- let action = new URL(form.action);
- let formData = new FormData(form);
- let webRequestFD = {};
-
- let updateActionURL = () => {
- for (let name of formData.keys()) {
- webRequestFD[name] = name in uploads ? [uploads[name].fileName] : formData.getAll(name);
- }
- action.searchParams.set("upload", JSON.stringify(webRequestFD));
- action.searchParams.set("enctype", form.enctype);
- };
-
- updateActionURL();
-
- form.action = action;
- form.submit();
- yield extension.awaitMessage("done");
-
- if (form.enctype !== "multipart/form-data") {
- continue;
- }
-
- let post = (data) => {
- let xhr = new XMLHttpRequest();
- action.searchParams.set("xhr", "1");
- xhr.open("POST", action.href);
- xhr.send(data);
- action.searchParams.delete("xhr");
- return extension.awaitMessage("done");
- };
-
- formData.append(blob.name, blob.content, blob.fileName);
- formData.append("formDataField", "some value");
- updateActionURL();
- yield post(formData);
-
- action.searchParams.set("upload", JSON.stringify([{file: "<file>"}]));
- yield post(testFile);
-
- action.searchParams.set("upload", `${blob.content.size} bytes`);
- yield post(blob.content);
-
- let byteLength = 16;
- action.searchParams.set("upload", `${byteLength} bytes`);
- yield post(new ArrayBuffer(byteLength));
- }
-
- yield extension.unload();
-});
-</script>
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_window_postMessage.html b/toolkit/components/webextensions/test/mochitest/test_ext_window_postMessage.html
deleted file mode 100644
index 7d49d55baa..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_window_postMessage.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for content script</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-/* eslint-disable mozilla/balanced-listeners */
-
-add_task(function* test_postMessage() {
- let extensionData = {
- manifest: {
- content_scripts: [
- {
- "matches": ["http://mochi.test/*/file_sample.html"],
- "js": ["content_script.js"],
- "run_at": "document_start",
- "all_frames": true,
- },
- ],
-
- web_accessible_resources: ["iframe.html"],
- },
-
- background() {
- browser.test.sendMessage("iframe-url", browser.runtime.getURL("iframe.html"));
- },
-
- files: {
- "content_script.js": function() {
- window.addEventListener("message", event => {
- if (event.data == "ping") {
- event.source.postMessage({pong: location.href},
- event.origin);
- }
- });
- },
-
- "iframe.html": `<!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <script src="content_script.js"><\/script>
- </head>
- </html>`,
- },
- };
-
- let createIframe = url => {
- let iframe = document.createElement("iframe");
- return new Promise(resolve => {
- iframe.src = url;
- iframe.onload = resolve;
- document.body.appendChild(iframe);
- }).then(() => {
- return iframe;
- });
- };
-
- let awaitMessage = () => {
- return new Promise(resolve => {
- let listener = event => {
- if (event.data.pong) {
- window.removeEventListener("message", listener);
- resolve(event.data);
- }
- };
- window.addEventListener("message", listener);
- });
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- let iframeURL = yield extension.awaitMessage("iframe-url");
- let testURL = SimpleTest.getTestFileURL("file_sample.html");
-
- for (let url of [iframeURL, testURL]) {
- info(`Testing URL ${url}`);
-
- let iframe = yield createIframe(url);
-
- iframe.contentWindow.postMessage(
- "ping", url);
-
- let pong = yield awaitMessage();
- is(pong.pong, url, "Got expected pong");
-
- iframe.remove();
- }
-
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/test_ext_xhr_capabilities.html b/toolkit/components/webextensions/test/mochitest/test_ext_xhr_capabilities.html
deleted file mode 100644
index 1afdadb9fc..0000000000
--- a/toolkit/components/webextensions/test/mochitest/test_ext_xhr_capabilities.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test XHR capabilities</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/ExtensionTestUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
-<script type="text/javascript">
-"use strict";
-
-add_task(function* test_xhr_capabilities() {
- function backgroundScript() {
- let xhr = new XMLHttpRequest();
- xhr.open("GET", browser.extension.getURL("bad.xml"));
-
- browser.test.sendMessage("result",
- {name: "Background script XHRs should not be privileged",
- result: xhr.channel === undefined});
-
- xhr.onload = () => {
- browser.test.sendMessage("result",
- {name: "Background script XHRs should not yield <parsererrors>",
- result: xhr.responseXML === null});
- };
- xhr.send();
- }
-
- function contentScript() {
- let xhr = new XMLHttpRequest();
- xhr.open("GET", browser.extension.getURL("bad.xml"));
-
- browser.test.sendMessage("result",
- {name: "Content script XHRs should not be privileged",
- result: xhr.channel === undefined});
-
- xhr.onload = () => {
- browser.test.sendMessage("result",
- {name: "Content script XHRs should not yield <parsererrors>",
- result: xhr.responseXML === null});
- };
- xhr.send();
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- background: {
- "scripts": ["background.js"],
- },
- content_scripts: [{
- "matches": ["http://example.com/"],
- "js": ["content_script.js"],
- }],
- web_accessible_resources: [
- "bad.xml",
- ],
- },
-
- files: {
- "bad.xml": "<xml",
- "background.js": `(${backgroundScript})()`,
- "content_script.js": `(${contentScript})()`,
- },
- });
-
- yield extension.startup();
-
- let win = window.open("http://example.com/");
-
- // We expect four test results from the content/background scripts.
- for (let i = 0; i < 4; ++i) {
- let result = yield extension.awaitMessage("result");
- ok(result.result, result.name);
- }
-
- win.close();
- yield extension.unload();
-});
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/mochitest/webrequest_chromeworker.js b/toolkit/components/webextensions/test/mochitest/webrequest_chromeworker.js
deleted file mode 100644
index ccfb2ac1fc..0000000000
--- a/toolkit/components/webextensions/test/mochitest/webrequest_chromeworker.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-onmessage = function(event) {
- fetch("https://example.com/example.txt").then(() => {
- postMessage("Done!");
- });
-};
-
diff --git a/toolkit/components/webextensions/test/mochitest/webrequest_test.jsm b/toolkit/components/webextensions/test/mochitest/webrequest_test.jsm
deleted file mode 100644
index bfb1483018..0000000000
--- a/toolkit/components/webextensions/test/mochitest/webrequest_test.jsm
+++ /dev/null
@@ -1,22 +0,0 @@
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["webrequest_test"];
-
-Components.utils.importGlobalProperties(["fetch", "XMLHttpRequest"]);
-
-this.webrequest_test = {
- testFetch(url) {
- return fetch(url);
- },
-
- testXHR(url) {
- return new Promise(resolve => {
- let xhr = new XMLHttpRequest();
- xhr.open("HEAD", url);
- xhr.onload = () => {
- resolve();
- };
- xhr.send();
- });
- },
-};
diff --git a/toolkit/components/webextensions/test/mochitest/webrequest_worker.js b/toolkit/components/webextensions/test/mochitest/webrequest_worker.js
deleted file mode 100644
index dcffd08578..0000000000
--- a/toolkit/components/webextensions/test/mochitest/webrequest_worker.js
+++ /dev/null
@@ -1,3 +0,0 @@
-"use strict";
-
-fetch("https://example.com/example.txt");
diff --git a/toolkit/components/webextensions/test/xpcshell/.eslintrc.js b/toolkit/components/webextensions/test/xpcshell/.eslintrc.js
deleted file mode 100644
index 3758537ef4..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": "../../../../../testing/xpcshell/xpcshell.eslintrc.js",
-
- "globals": {
- "browser": false,
- },
-};
diff --git a/toolkit/components/webextensions/test/xpcshell/data/file_download.html b/toolkit/components/webextensions/test/xpcshell/data/file_download.html
deleted file mode 100644
index d970c63259..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/data/file_download.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-</head>
-<body>
-
-<div>Download HTML File</div>
-
-</body>
-</html>
diff --git a/toolkit/components/webextensions/test/xpcshell/data/file_download.txt b/toolkit/components/webextensions/test/xpcshell/data/file_download.txt
deleted file mode 100644
index 6293c7af79..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/data/file_download.txt
+++ /dev/null
@@ -1 +0,0 @@
-This is a sample file used in download tests.
diff --git a/toolkit/components/webextensions/test/xpcshell/head.js b/toolkit/components/webextensions/test/xpcshell/head.js
deleted file mode 100644
index 9e22be6da7..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/head.js
+++ /dev/null
@@ -1,111 +0,0 @@
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-/* exported createHttpServer, promiseConsoleOutput, cleanupDir */
-
-Components.utils.import("resource://gre/modules/Task.jsm");
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Timer.jsm");
-Components.utils.import("resource://testing-common/AddonTestUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Extension",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionData",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
- "resource://gre/modules/ExtensionManagement.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionTestUtils",
- "resource://testing-common/ExtensionXPCShellUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "HttpServer",
- "resource://testing-common/httpd.js");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Schemas",
- "resource://gre/modules/Schemas.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-ExtensionTestUtils.init(this);
-
-/**
- * Creates a new HttpServer for testing, and begins listening on the
- * specified port. Automatically shuts down the server when the test
- * unit ends.
- *
- * @param {integer} [port]
- * The port to listen on. If omitted, listen on a random
- * port. The latter is the preferred behavior.
- *
- * @returns {HttpServer}
- */
-function createHttpServer(port = -1) {
- let server = new HttpServer();
- server.start(port);
-
- do_register_cleanup(() => {
- return new Promise(resolve => {
- server.stop(resolve);
- });
- });
-
- return server;
-}
-
-var promiseConsoleOutput = Task.async(function* (task) {
- const DONE = `=== console listener ${Math.random()} done ===`;
-
- let listener;
- let messages = [];
- let awaitListener = new Promise(resolve => {
- listener = msg => {
- if (msg == DONE) {
- resolve();
- } else {
- void (msg instanceof Ci.nsIConsoleMessage);
- messages.push(msg);
- }
- };
- });
-
- Services.console.registerListener(listener);
- try {
- let result = yield task();
-
- Services.console.logStringMessage(DONE);
- yield awaitListener;
-
- return {messages, result};
- } finally {
- Services.console.unregisterListener(listener);
- }
-});
-
-// Attempt to remove a directory. If the Windows OS is still using the
-// file sometimes remove() will fail. So try repeatedly until we can
-// remove it or we give up.
-function cleanupDir(dir) {
- let count = 0;
- return new Promise((resolve, reject) => {
- function tryToRemoveDir() {
- count += 1;
- try {
- dir.remove(true);
- } catch (e) {
- // ignore
- }
- if (!dir.exists()) {
- return resolve();
- }
- if (count >= 25) {
- return reject(`Failed to cleanup directory: ${dir}`);
- }
- setTimeout(tryToRemoveDir, 100);
- }
- tryToRemoveDir();
- });
-}
diff --git a/toolkit/components/webextensions/test/xpcshell/head_native_messaging.js b/toolkit/components/webextensions/test/xpcshell/head_native_messaging.js
deleted file mode 100644
index f7c619b76a..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/head_native_messaging.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* globals AppConstants, FileUtils */
-/* exported getSubprocessCount, setupHosts, waitForSubprocessExit */
-
-XPCOMUtils.defineLazyModuleGetter(this, "MockRegistry",
- "resource://testing-common/MockRegistry.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "setTimeout",
- "resource://gre/modules/Timer.jsm");
-
-let {Subprocess, SubprocessImpl} = Cu.import("resource://gre/modules/Subprocess.jsm");
-
-
-// It's important that we use a space in this directory name to make sure we
-// correctly handle executing batch files with spaces in their path.
-let tmpDir = FileUtils.getDir("TmpD", ["Native Messaging"]);
-tmpDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
-do_register_cleanup(() => {
- tmpDir.remove(true);
-});
-
-function getPath(filename) {
- return OS.Path.join(tmpDir.path, filename);
-}
-
-const ID = "native@tests.mozilla.org";
-
-
-function* setupHosts(scripts) {
- const PERMS = {unixMode: 0o755};
-
- const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
- const pythonPath = yield Subprocess.pathSearch(env.get("PYTHON"));
-
- function* writeManifest(script, scriptPath, path) {
- let body = `#!${pythonPath} -u\n${script.script}`;
-
- yield OS.File.writeAtomic(scriptPath, body);
- yield OS.File.setPermissions(scriptPath, PERMS);
-
- let manifest = {
- name: script.name,
- description: script.description,
- path,
- type: "stdio",
- allowed_extensions: [ID],
- };
-
- let manifestPath = getPath(`${script.name}.json`);
- yield OS.File.writeAtomic(manifestPath, JSON.stringify(manifest));
-
- return manifestPath;
- }
-
- switch (AppConstants.platform) {
- case "macosx":
- case "linux":
- let dirProvider = {
- getFile(property) {
- if (property == "XREUserNativeMessaging") {
- return tmpDir.clone();
- } else if (property == "XRESysNativeMessaging") {
- return tmpDir.clone();
- }
- return null;
- },
- };
-
- Services.dirsvc.registerProvider(dirProvider);
- do_register_cleanup(() => {
- Services.dirsvc.unregisterProvider(dirProvider);
- });
-
- for (let script of scripts) {
- let path = getPath(`${script.name}.py`);
-
- yield writeManifest(script, path, path);
- }
- break;
-
- case "win":
- const REGKEY = String.raw`Software\Mozilla\NativeMessagingHosts`;
-
- let registry = new MockRegistry();
- do_register_cleanup(() => {
- registry.shutdown();
- });
-
- for (let script of scripts) {
- // It's important that we use a space in this filename. See directory
- // name comment above.
- let batPath = getPath(`batch ${script.name}.bat`);
- let scriptPath = getPath(`${script.name}.py`);
-
- let batBody = `@ECHO OFF\n${pythonPath} -u "${scriptPath}" %*\n`;
- yield OS.File.writeAtomic(batPath, batBody);
-
- // Create absolute and relative path versions of the entry.
- for (let [name, path] of [[script.name, batPath],
- [`relative.${script.name}`, OS.Path.basename(batPath)]]) {
- script.name = name;
- let manifestPath = yield writeManifest(script, scriptPath, path);
-
- registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- `${REGKEY}\\${script.name}`, "", manifestPath);
- }
- }
- break;
-
- default:
- ok(false, `Native messaging is not supported on ${AppConstants.platform}`);
- }
-}
-
-
-function getSubprocessCount() {
- return SubprocessImpl.Process.getWorker().call("getProcesses", [])
- .then(result => result.size);
-}
-function waitForSubprocessExit() {
- return SubprocessImpl.Process.getWorker().call("waitForNoProcesses", []).then(() => {
- // Return to the main event loop to give IO handlers enough time to consume
- // their remaining buffered input.
- return new Promise(resolve => setTimeout(resolve, 0));
- });
-}
diff --git a/toolkit/components/webextensions/test/xpcshell/head_sync.js b/toolkit/components/webextensions/test/xpcshell/head_sync.js
deleted file mode 100644
index 9b66b78e75..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/head_sync.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/* exported withSyncContext */
-
-Components.utils.import("resource://gre/modules/Services.jsm", this);
-Components.utils.import("resource://gre/modules/ExtensionCommon.jsm", this);
-
-var {
- BaseContext,
-} = ExtensionCommon;
-
-class Context extends BaseContext {
- constructor(principal) {
- super();
- Object.defineProperty(this, "principal", {
- value: principal,
- configurable: true,
- });
- this.sandbox = Components.utils.Sandbox(principal, {wantXrays: false});
- this.extension = {id: "test@web.extension"};
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-}
-
-/**
- * Call the given function with a newly-constructed context.
- * Unload the context on the way out.
- *
- * @param {function} f the function to call
- */
-function* withContext(f) {
- const ssm = Services.scriptSecurityManager;
- const PRINCIPAL1 = ssm.createCodebasePrincipalFromOrigin("http://www.example.org");
- const context = new Context(PRINCIPAL1);
- try {
- yield* f(context);
- } finally {
- yield context.unload();
- }
-}
-
-/**
- * Like withContext(), but also turn on the "storage.sync" pref for
- * the duration of the function.
- * Calls to this function can be replaced with calls to withContext
- * once the pref becomes on by default.
- *
- * @param {function} f the function to call
- */
-function* withSyncContext(f) {
- const STORAGE_SYNC_PREF = "webextensions.storage.sync.enabled";
- let prefs = Services.prefs;
-
- try {
- prefs.setBoolPref(STORAGE_SYNC_PREF, true);
- yield* withContext(f);
- } finally {
- prefs.clearUserPref(STORAGE_SYNC_PREF);
- }
-}
diff --git a/toolkit/components/webextensions/test/xpcshell/native_messaging.ini b/toolkit/components/webextensions/test/xpcshell/native_messaging.ini
deleted file mode 100644
index d0e1da163d..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/native_messaging.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[DEFAULT]
-head = head.js head_native_messaging.js
-tail =
-firefox-appdir = browser
-skip-if = appname == "thunderbird" || os == "android"
-subprocess = true
-support-files =
- data/**
-tags = webextensions
-
-[test_ext_native_messaging.js]
-[test_ext_native_messaging_perf.js]
-[test_ext_native_messaging_unresponsive.js]
diff --git a/toolkit/components/webextensions/test/xpcshell/test_csp_custom_policies.js b/toolkit/components/webextensions/test/xpcshell/test_csp_custom_policies.js
deleted file mode 100644
index b6213baacb..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_csp_custom_policies.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-const ADDON_ID = "test@web.extension";
-
-const aps = Cc["@mozilla.org/addons/policy-service;1"]
- .getService(Ci.nsIAddonPolicyService).wrappedJSObject;
-
-do_register_cleanup(() => {
- aps.setAddonCSP(ADDON_ID, null);
-});
-
-add_task(function* test_addon_csp() {
- equal(aps.baseCSP, Preferences.get("extensions.webextensions.base-content-security-policy"),
- "Expected base CSP value");
-
- equal(aps.defaultCSP, Preferences.get("extensions.webextensions.default-content-security-policy"),
- "Expected default CSP value");
-
- equal(aps.getAddonCSP(ADDON_ID), aps.defaultCSP,
- "CSP for unknown add-on ID should be the default CSP");
-
-
- const CUSTOM_POLICY = "script-src: 'self' https://xpcshell.test.custom.csp; object-src: 'none'";
-
- aps.setAddonCSP(ADDON_ID, CUSTOM_POLICY);
-
- equal(aps.getAddonCSP(ADDON_ID), CUSTOM_POLICY, "CSP should point to add-on's custom policy");
-
-
- aps.setAddonCSP(ADDON_ID, null);
-
- equal(aps.getAddonCSP(ADDON_ID), aps.defaultCSP,
- "CSP should revert to default when set to null");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_csp_validator.js b/toolkit/components/webextensions/test/xpcshell/test_csp_validator.js
deleted file mode 100644
index 59a7322bc3..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_csp_validator.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-const cps = Cc["@mozilla.org/addons/content-policy;1"].getService(Ci.nsIAddonContentPolicy);
-
-add_task(function* test_csp_validator() {
- let checkPolicy = (policy, expectedResult, message = null) => {
- do_print(`Checking policy: ${policy}`);
-
- let result = cps.validateAddonCSP(policy);
- equal(result, expectedResult);
- };
-
- checkPolicy("script-src 'self'; object-src 'self';",
- null);
-
- let hash = "'sha256-NjZhMDQ1YjQ1MjEwMmM1OWQ4NDBlYzA5N2Q1OWQ5NDY3ZTEzYTNmMzRmNjQ5NGU1MzlmZmQzMmMxYmIzNWYxOCAgLQo='";
-
- checkPolicy(`script-src 'self' https://com https://*.example.com moz-extension://09abcdef blob: filesystem: ${hash} 'unsafe-eval'; ` +
- `object-src 'self' https://com https://*.example.com moz-extension://09abcdef blob: filesystem: ${hash}`,
- null);
-
- checkPolicy("",
- "Policy is missing a required \u2018script-src\u2019 directive");
-
- checkPolicy("object-src 'none';",
- "Policy is missing a required \u2018script-src\u2019 directive");
-
-
- checkPolicy("default-src 'self'", null,
- "A valid default-src should count as a valid script-src or object-src");
-
- checkPolicy("default-src 'self'; script-src 'self'", null,
- "A valid default-src should count as a valid script-src or object-src");
-
- checkPolicy("default-src 'self'; object-src 'self'", null,
- "A valid default-src should count as a valid script-src or object-src");
-
-
- checkPolicy("default-src 'self'; script-src http://example.com",
- "\u2018script-src\u2019 directive contains a forbidden http: protocol source",
- "A valid default-src should not allow an invalid script-src directive");
-
- checkPolicy("default-src 'self'; object-src http://example.com",
- "\u2018object-src\u2019 directive contains a forbidden http: protocol source",
- "A valid default-src should not allow an invalid object-src directive");
-
-
- checkPolicy("script-src 'self';",
- "Policy is missing a required \u2018object-src\u2019 directive");
-
- checkPolicy("script-src 'none'; object-src 'none'",
- "\u2018script-src\u2019 must include the source 'self'");
-
- checkPolicy("script-src 'self'; object-src 'none';",
- null);
-
- checkPolicy("script-src 'self' 'unsafe-inline'; object-src 'self';",
- "\u2018script-src\u2019 directive contains a forbidden 'unsafe-inline' keyword");
-
-
- let directives = ["script-src", "object-src"];
-
- for (let [directive, other] of [directives, directives.slice().reverse()]) {
- for (let src of ["https://*", "https://*.blogspot.com", "https://*"]) {
- checkPolicy(`${directive} 'self' ${src}; ${other} 'self';`,
- `https: wildcard sources in \u2018${directive}\u2019 directives must include at least one non-generic sub-domain (e.g., *.example.com rather than *.com)`);
- }
-
- checkPolicy(`${directive} 'self' https:; ${other} 'self';`,
- `https: protocol requires a host in \u2018${directive}\u2019 directives`);
-
- checkPolicy(`${directive} 'self' http://example.com; ${other} 'self';`,
- `\u2018${directive}\u2019 directive contains a forbidden http: protocol source`);
-
- for (let protocol of ["http", "ftp", "meh"]) {
- checkPolicy(`${directive} 'self' ${protocol}:; ${other} 'self';`,
- `\u2018${directive}\u2019 directive contains a forbidden ${protocol}: protocol source`);
- }
-
- checkPolicy(`${directive} 'self' 'nonce-01234'; ${other} 'self';`,
- `\u2018${directive}\u2019 directive contains a forbidden 'nonce-*' keyword`);
- }
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms.js b/toolkit/components/webextensions/test/xpcshell/test_ext_alarms.js
deleted file mode 100644
index 936c984c62..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_alarm_without_permissions() {
- function backgroundScript() {
- browser.test.assertTrue(!browser.alarms,
- "alarm API is not available when the alarm permission is not required");
- browser.test.notifyPass("alarms_permission");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: [],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarms_permission");
- yield extension.unload();
-});
-
-
-add_task(function* test_alarm_fires() {
- function backgroundScript() {
- let ALARM_NAME = "test_ext_alarms";
- let timer;
-
- browser.alarms.onAlarm.addListener(alarm => {
- browser.test.assertEq(ALARM_NAME, alarm.name, "alarm has the correct name");
- clearTimeout(timer);
- browser.test.notifyPass("alarm-fires");
- });
-
- browser.alarms.create(ALARM_NAME, {delayInMinutes: 0.02});
-
- timer = setTimeout(async () => {
- browser.test.fail("alarm fired within expected time");
- let wasCleared = await browser.alarms.clear(ALARM_NAME);
- browser.test.assertTrue(wasCleared, "alarm was cleared");
- browser.test.notifyFail("alarm-fires");
- }, 10000);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-fires");
- yield extension.unload();
-});
-
-
-add_task(function* test_alarm_fires_with_when() {
- function backgroundScript() {
- let ALARM_NAME = "test_ext_alarms";
- let timer;
-
- browser.alarms.onAlarm.addListener(alarm => {
- browser.test.assertEq(ALARM_NAME, alarm.name, "alarm has the expected name");
- clearTimeout(timer);
- browser.test.notifyPass("alarm-when");
- });
-
- browser.alarms.create(ALARM_NAME, {when: Date.now() + 1000});
-
- timer = setTimeout(async () => {
- browser.test.fail("alarm fired within expected time");
- let wasCleared = await browser.alarms.clear(ALARM_NAME);
- browser.test.assertTrue(wasCleared, "alarm was cleared");
- browser.test.notifyFail("alarm-when");
- }, 10000);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-when");
- yield extension.unload();
-});
-
-
-add_task(function* test_alarm_clear_non_matching_name() {
- async function backgroundScript() {
- let ALARM_NAME = "test_ext_alarms";
-
- browser.alarms.create(ALARM_NAME, {when: Date.now() + 2000});
-
- let wasCleared = await browser.alarms.clear(ALARM_NAME + "1");
- browser.test.assertFalse(wasCleared, "alarm was not cleared");
-
- let alarms = await browser.alarms.getAll();
- browser.test.assertEq(1, alarms.length, "alarm was not removed");
- browser.test.notifyPass("alarm-clear");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-clear");
- yield extension.unload();
-});
-
-
-add_task(function* test_alarm_get_and_clear_single_argument() {
- async function backgroundScript() {
- browser.alarms.create({when: Date.now() + 2000});
-
- let alarm = await browser.alarms.get();
- browser.test.assertEq("", alarm.name, "expected alarm returned");
-
- let wasCleared = await browser.alarms.clear();
- browser.test.assertTrue(wasCleared, "alarm was cleared");
-
- let alarms = await browser.alarms.getAll();
- browser.test.assertEq(0, alarms.length, "alarm was removed");
-
- browser.test.notifyPass("alarm-single-arg");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-single-arg");
- yield extension.unload();
-});
-
-
-add_task(function* test_get_get_all_clear_all_alarms() {
- async function backgroundScript() {
- const ALARM_NAME = "test_alarm";
-
- let suffixes = [0, 1, 2];
-
- for (let suffix of suffixes) {
- browser.alarms.create(ALARM_NAME + suffix, {when: Date.now() + (suffix + 1) * 10000});
- }
-
- let alarms = await browser.alarms.getAll();
- browser.test.assertEq(suffixes.length, alarms.length, "expected number of alarms were found");
- alarms.forEach((alarm, index) => {
- browser.test.assertEq(ALARM_NAME + index, alarm.name, "alarm has the expected name");
- });
-
-
- for (let suffix of suffixes) {
- let alarm = await browser.alarms.get(ALARM_NAME + suffix);
- browser.test.assertEq(ALARM_NAME + suffix, alarm.name, "alarm has the expected name");
- browser.test.sendMessage(`get-${suffix}`);
- }
-
- let wasCleared = await browser.alarms.clear(ALARM_NAME + suffixes[0]);
- browser.test.assertTrue(wasCleared, "alarm was cleared");
-
- alarms = await browser.alarms.getAll();
- browser.test.assertEq(2, alarms.length, "alarm was removed");
-
- let alarm = await browser.alarms.get(ALARM_NAME + suffixes[0]);
- browser.test.assertEq(undefined, alarm, "non-existent alarm is undefined");
- browser.test.sendMessage(`get-invalid`);
-
- wasCleared = await browser.alarms.clearAll();
- browser.test.assertTrue(wasCleared, "alarms were cleared");
-
- alarms = await browser.alarms.getAll();
- browser.test.assertEq(0, alarms.length, "no alarms exist");
- browser.test.sendMessage("clearAll");
- browser.test.sendMessage("clear");
- browser.test.sendMessage("getAll");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield Promise.all([
- extension.startup(),
- extension.awaitMessage("getAll"),
- extension.awaitMessage("get-0"),
- extension.awaitMessage("get-1"),
- extension.awaitMessage("get-2"),
- extension.awaitMessage("clear"),
- extension.awaitMessage("get-invalid"),
- extension.awaitMessage("clearAll"),
- ]);
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_does_not_fire.js b/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_does_not_fire.js
deleted file mode 100644
index 11407b108a..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_does_not_fire.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_cleared_alarm_does_not_fire() {
- async function backgroundScript() {
- let ALARM_NAME = "test_ext_alarms";
-
- browser.alarms.onAlarm.addListener(alarm => {
- browser.test.fail("cleared alarm does not fire");
- browser.test.notifyFail("alarm-cleared");
- });
- browser.alarms.create(ALARM_NAME, {when: Date.now() + 1000});
-
- let wasCleared = await browser.alarms.clear(ALARM_NAME);
- browser.test.assertTrue(wasCleared, "alarm was cleared");
-
- await new Promise(resolve => setTimeout(resolve, 2000));
-
- browser.test.notifyPass("alarm-cleared");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-cleared");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_periodic.js b/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_periodic.js
deleted file mode 100644
index 6bcdf4e33a..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_periodic.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_periodic_alarm_fires() {
- function backgroundScript() {
- const ALARM_NAME = "test_ext_alarms";
- let count = 0;
- let timer;
-
- browser.alarms.onAlarm.addListener(async alarm => {
- browser.test.assertEq(alarm.name, ALARM_NAME, "alarm has the expected name");
- if (count++ === 3) {
- clearTimeout(timer);
- let wasCleared = await browser.alarms.clear(ALARM_NAME);
- browser.test.assertTrue(wasCleared, "alarm was cleared");
-
- browser.test.notifyPass("alarm-periodic");
- }
- });
-
- browser.alarms.create(ALARM_NAME, {periodInMinutes: 0.02});
-
- timer = setTimeout(async () => {
- browser.test.fail("alarm fired expected number of times");
-
- let wasCleared = await browser.alarms.clear(ALARM_NAME);
- browser.test.assertTrue(wasCleared, "alarm was cleared");
-
- browser.test.notifyFail("alarm-periodic");
- }, 30000);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-periodic");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_replaces.js b/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_replaces.js
deleted file mode 100644
index 96f61acb57..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_alarms_replaces.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-
-add_task(function* test_duplicate_alarm_name_replaces_alarm() {
- function backgroundScript() {
- let count = 0;
-
- browser.alarms.onAlarm.addListener(async alarm => {
- if (alarm.name === "master alarm") {
- browser.alarms.create("child alarm", {delayInMinutes: 0.05});
- let results = await browser.alarms.getAll();
-
- browser.test.assertEq(2, results.length, "exactly two alarms exist");
- browser.test.assertEq("master alarm", results[0].name, "first alarm has the expected name");
- browser.test.assertEq("child alarm", results[1].name, "second alarm has the expected name");
-
- if (count++ === 3) {
- await browser.alarms.clear("master alarm");
- await browser.alarms.clear("child alarm");
-
- browser.test.notifyPass("alarm-duplicate");
- }
- } else {
- browser.test.fail("duplicate named alarm replaced existing alarm");
- browser.test.notifyFail("alarm-duplicate");
- }
- });
-
- browser.alarms.create("master alarm", {delayInMinutes: 0.025, periodInMinutes: 0.025});
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["alarms"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("alarm-duplicate");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_api_permissions.js b/toolkit/components/webextensions/test/xpcshell/test_ext_api_permissions.js
deleted file mode 100644
index d653d0e7aa..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_api_permissions.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-let {Management} = Cu.import("resource://gre/modules/Extension.jsm", {});
-function getNextContext() {
- return new Promise(resolve => {
- Management.on("proxy-context-load", function listener(type, context) {
- Management.off("proxy-context-load", listener);
- resolve(context);
- });
- });
-}
-
-add_task(function* test_storage_api_without_permissions() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- // Force API initialization.
- void browser.storage;
- },
-
- manifest: {
- permissions: [],
- },
- });
-
- let contextPromise = getNextContext();
- yield extension.startup();
-
- let context = yield contextPromise;
-
- // Force API initialization.
- void context.apiObj;
-
- ok(!("storage" in context.apiObj),
- "The storage API should not be initialized");
-
- yield extension.unload();
-});
-
-add_task(function* test_storage_api_with_permissions() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- void browser.storage;
- },
-
- manifest: {
- permissions: ["storage"],
- },
- });
-
- let contextPromise = getNextContext();
- yield extension.startup();
-
- let context = yield contextPromise;
-
- // Force API initialization.
- void context.apiObj;
-
- equal(typeof context.apiObj.storage, "object",
- "The storage API should be initialized");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_apimanager.js b/toolkit/components/webextensions/test/xpcshell/test_ext_apimanager.js
deleted file mode 100644
index 3f6672a11c..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_apimanager.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-
-const {
- SchemaAPIManager,
-} = ExtensionCommon;
-
-this.unknownvar = "Some module-global var";
-
-var gUniqueId = 0;
-
-// SchemaAPIManager's loadScript uses loadSubScript to load a script. This
-// requires a local (resource://) URL. So create such a temporary URL for
-// testing.
-function toLocalURI(code) {
- let dataUrl = `data:charset=utf-8,${encodeURIComponent(code)}`;
- let uniqueResPart = `need-a-local-uri-for-subscript-loading-${++gUniqueId}`;
- Services.io.getProtocolHandler("resource")
- .QueryInterface(Ci.nsIResProtocolHandler)
- .setSubstitution(uniqueResPart, Services.io.newURI(dataUrl, null, null));
- return `resource://${uniqueResPart}`;
-}
-
-add_task(function* test_global_isolation() {
- let manA = new SchemaAPIManager("procA");
- let manB = new SchemaAPIManager("procB");
-
- // The "global" variable should be persistent and shared.
- manA.loadScript(toLocalURI`global.globalVar = 1;`);
- do_check_eq(manA.global.globalVar, 1);
- do_check_eq(manA.global.unknownvar, undefined);
- manA.loadScript(toLocalURI`global.canSeeGlobal = global.globalVar;`);
- do_check_eq(manA.global.canSeeGlobal, 1);
-
- // Each loadScript call should have their own scope, and global is shared.
- manA.loadScript(toLocalURI`this.aVar = 1; global.thisScopeVar = aVar`);
- do_check_eq(manA.global.aVar, undefined);
- do_check_eq(manA.global.thisScopeVar, 1);
- manA.loadScript(toLocalURI`global.differentScopeVar = this.aVar;`);
- do_check_eq(manA.global.differentScopeVar, undefined);
- manA.loadScript(toLocalURI`global.cantSeeOtherScope = typeof aVar;`);
- do_check_eq(manA.global.cantSeeOtherScope, "undefined");
-
- manB.loadScript(toLocalURI`global.tryReadOtherGlobal = global.tryagain;`);
- do_check_eq(manA.global.tryReadOtherGlobal, undefined);
-
- // Cu.import without second argument exports to the caller's global. Let's
- // verify that it does not leak to the SchemaAPIManager's global.
- do_check_eq(typeof ExtensionUtils, "undefined"); // Sanity check #1.
- manA.loadScript(toLocalURI`global.hasExtUtils = typeof ExtensionUtils;`);
- do_check_eq(manA.global.hasExtUtils, "undefined"); // Sanity check #2
-
- Cu.import("resource://gre/modules/ExtensionUtils.jsm");
- do_check_eq(typeof ExtensionUtils, "object"); // Sanity check #3.
-
- manA.loadScript(toLocalURI`global.hasExtUtils = typeof ExtensionUtils;`);
- do_check_eq(manA.global.hasExtUtils, "undefined");
- manB.loadScript(toLocalURI`global.hasExtUtils = typeof ExtensionUtils;`);
- do_check_eq(manB.global.hasExtUtils, "undefined");
-
- // Confirm that Cu.import does not leak between SchemaAPIManager globals.
- manA.loadScript(toLocalURI`
- Cu.import("resource://gre/modules/ExtensionUtils.jsm");
- global.hasExtUtils = typeof ExtensionUtils;
- `);
- do_check_eq(manA.global.hasExtUtils, "object"); // Sanity check.
- manB.loadScript(toLocalURI`global.hasExtUtils = typeof ExtensionUtils;`);
- do_check_eq(manB.global.hasExtUtils, "undefined");
-
- // Prototype modifications should be isolated.
- manA.loadScript(toLocalURI`
- Object.prototype.modifiedByA = "Prrft";
- global.fromA = {};
- `);
- manA.loadScript(toLocalURI`
- global.fromAagain = {};
- `);
- manB.loadScript(toLocalURI`
- global.fromB = {};
- `);
- do_check_eq(manA.global.modifiedByA, "Prrft");
- do_check_eq(manA.global.fromA.modifiedByA, "Prrft");
- do_check_eq(manA.global.fromAagain.modifiedByA, "Prrft");
- do_check_eq(manB.global.modifiedByA, undefined);
- do_check_eq(manB.global.fromB.modifiedByA, undefined);
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_load_events.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_load_events.js
deleted file mode 100644
index 26282fcb9a..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_load_events.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* eslint-disable mozilla/balanced-listeners */
-
-add_task(function* test_DOMContentLoaded_in_generated_background_page() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- function reportListener(event) {
- browser.test.sendMessage("eventname", event.type);
- }
- document.addEventListener("DOMContentLoaded", reportListener);
- window.addEventListener("load", reportListener);
- },
- });
-
- yield extension.startup();
- equal("DOMContentLoaded", yield extension.awaitMessage("eventname"));
- equal("load", yield extension.awaitMessage("eventname"));
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_reload.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_reload.js
deleted file mode 100644
index 4bf59b7989..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_generated_reload.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_reload_generated_background_page() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- if (location.hash !== "#firstrun") {
- browser.test.sendMessage("first run");
- location.hash = "#firstrun";
- browser.test.assertEq("#firstrun", location.hash);
- location.reload();
- } else {
- browser.test.notifyPass("second run");
- }
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("first run");
- yield extension.awaitFinish("second run");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_global_history.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_global_history.js
deleted file mode 100644
index 092a9f5b39..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_global_history.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://testing-common/PlacesTestUtils.jsm");
-
-add_task(function* test_global_history() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- browser.test.sendMessage("background-loaded", location.href);
- },
- });
-
- yield extension.startup();
-
- let backgroundURL = yield extension.awaitMessage("background-loaded");
-
- yield extension.unload();
-
- let exists = yield PlacesTestUtils.isPageInDB(backgroundURL);
- ok(!exists, "Background URL should not be in history database");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js
deleted file mode 100644
index 8e8b5e0b08..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_private_browsing.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-function* testBackgroundPage(expected) {
- let extension = ExtensionTestUtils.loadExtension({
- async background() {
- browser.test.assertEq(window, browser.extension.getBackgroundPage(),
- "Caller should be able to access itself as a background page");
- browser.test.assertEq(window, await browser.runtime.getBackgroundPage(),
- "Caller should be able to access itself as a background page");
-
- browser.test.sendMessage("incognito", browser.extension.inIncognitoContext);
- },
- });
-
- yield extension.startup();
-
- let incognito = yield extension.awaitMessage("incognito");
- equal(incognito, expected.incognito, "Expected incognito value");
-
- yield extension.unload();
-}
-
-add_task(function* test_background_incognito() {
- do_print("Test background page incognito value with permanent private browsing disabled");
-
- yield testBackgroundPage({incognito: false});
-
- do_print("Test background page incognito value with permanent private browsing enabled");
-
- Preferences.set("browser.privatebrowsing.autostart", true);
- do_register_cleanup(() => {
- Preferences.reset("browser.privatebrowsing.autostart");
- });
-
- yield testBackgroundPage({incognito: true});
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_runtime_connect_params.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_runtime_connect_params.js
deleted file mode 100644
index 426833edd4..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_runtime_connect_params.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
- let received_ports_number = 0;
-
- const expected_received_ports_number = 1;
-
- function countReceivedPorts(port) {
- received_ports_number++;
-
- if (port.name == "check-results") {
- browser.runtime.onConnect.removeListener(countReceivedPorts);
-
- browser.test.assertEq(expected_received_ports_number, received_ports_number, "invalid connect should not create a port");
-
- browser.test.notifyPass("runtime.connect invalid params");
- }
- }
-
- browser.runtime.onConnect.addListener(countReceivedPorts);
-
- let childFrame = document.createElement("iframe");
- childFrame.src = "extensionpage.html";
- document.body.appendChild(childFrame);
-}
-
-function senderScript() {
- let detected_invalid_connect_params = 0;
-
- const invalid_connect_params = [
- // too many params
- ["fake-extensions-id", {name: "fake-conn-name"}, "unexpected third params"],
- // invalid params format
- [{}, {}],
- ["fake-extensions-id", "invalid-connect-info-format"],
- ];
- const expected_detected_invalid_connect_params = invalid_connect_params.length;
-
- function assertInvalidConnectParamsException(params) {
- try {
- browser.runtime.connect(...params);
- } catch (e) {
- detected_invalid_connect_params++;
- browser.test.assertTrue(e.toString().indexOf("Incorrect argument types for runtime.connect.") >= 0, "exception message is correct");
- }
- }
- for (let params of invalid_connect_params) {
- assertInvalidConnectParamsException(params);
- }
- browser.test.assertEq(expected_detected_invalid_connect_params, detected_invalid_connect_params, "all invalid runtime.connect params detected");
-
- browser.runtime.connect(browser.runtime.id, {name: "check-results"});
-}
-
-let extensionData = {
- background: backgroundScript,
- files: {
- "senderScript.js": senderScript,
- "extensionpage.html": `<!DOCTYPE html><meta charset="utf-8"><script src="senderScript.js"></script>`,
- },
-};
-
-add_task(function* test_backgroundRuntimeConnectParams() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitFinish("runtime.connect invalid params");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_sub_windows.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_sub_windows.js
deleted file mode 100644
index c5f2f1332c..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_sub_windows.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* testBackgroundWindow() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- browser.test.log("background script executed");
-
- browser.test.sendMessage("background-script-load");
-
- let img = document.createElement("img");
- img.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
- document.body.appendChild(img);
-
- img.onload = () => {
- browser.test.log("image loaded");
-
- let iframe = document.createElement("iframe");
- iframe.src = "about:blank?1";
-
- iframe.onload = () => {
- browser.test.log("iframe loaded");
- setTimeout(() => {
- browser.test.notifyPass("background sub-window test done");
- }, 0);
- };
- document.body.appendChild(iframe);
- };
- },
- });
-
- let loadCount = 0;
- extension.onMessage("background-script-load", () => {
- loadCount++;
- });
-
- yield extension.startup();
-
- yield extension.awaitFinish("background sub-window test done");
-
- equal(loadCount, 1, "background script loaded only once");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_background_window_properties.js b/toolkit/components/webextensions/test/xpcshell/test_ext_background_window_properties.js
deleted file mode 100644
index 948e2913ea..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_background_window_properties.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* testBackgroundWindowProperties() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- let expectedValues = {
- screenX: 0,
- screenY: 0,
- outerWidth: 0,
- outerHeight: 0,
- };
-
- for (let k in window) {
- try {
- if (k in expectedValues) {
- browser.test.assertEq(expectedValues[k], window[k],
- `should return the expected value for window property: ${k}`);
- } else {
- void window[k];
- }
- } catch (e) {
- browser.test.assertEq(null, e, `unexpected exception accessing window property: ${k}`);
- }
- }
-
- browser.test.notifyPass("background.testWindowProperties.done");
- },
- });
- yield extension.startup();
- yield extension.awaitFinish("background.testWindowProperties.done");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_contexts.js b/toolkit/components/webextensions/test/xpcshell/test_ext_contexts.js
deleted file mode 100644
index 56a14e1898..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_contexts.js
+++ /dev/null
@@ -1,190 +0,0 @@
-"use strict";
-
-const global = this;
-
-Cu.import("resource://gre/modules/Timer.jsm");
-
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
-
-var {
- BaseContext,
-} = ExtensionCommon;
-
-var {
- EventManager,
- SingletonEventManager,
-} = ExtensionUtils;
-
-class StubContext extends BaseContext {
- constructor() {
- let fakeExtension = {id: "test@web.extension"};
- super("testEnv", fakeExtension);
- this.sandbox = Cu.Sandbox(global);
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-}
-
-
-add_task(function* test_post_unload_promises() {
- let context = new StubContext();
-
- let fail = result => {
- ok(false, `Unexpected callback: ${result}`);
- };
-
- // Make sure promises resolve normally prior to unload.
- let promises = [
- context.wrapPromise(Promise.resolve()),
- context.wrapPromise(Promise.reject({message: ""})).catch(() => {}),
- ];
-
- yield Promise.all(promises);
-
- // Make sure promises that resolve after unload do not trigger
- // resolution handlers.
-
- context.wrapPromise(Promise.resolve("resolved"))
- .then(fail);
-
- context.wrapPromise(Promise.reject({message: "rejected"}))
- .then(fail, fail);
-
- context.unload();
-
- // The `setTimeout` ensures that we return to the event loop after
- // promise resolution, which means we're guaranteed to return after
- // any micro-tasks that get enqueued by the resolution handlers above.
- yield new Promise(resolve => setTimeout(resolve, 0));
-});
-
-
-add_task(function* test_post_unload_listeners() {
- let context = new StubContext();
-
- let fireEvent;
- let onEvent = new EventManager(context, "onEvent", fire => {
- fireEvent = fire;
- return () => {};
- });
-
- let fireSingleton;
- let onSingleton = new SingletonEventManager(context, "onSingleton", callback => {
- fireSingleton = () => {
- Promise.resolve().then(callback);
- };
- return () => {};
- });
-
- let fail = event => {
- ok(false, `Unexpected event: ${event}`);
- };
-
- // Check that event listeners aren't called after they've been removed.
- onEvent.addListener(fail);
- onSingleton.addListener(fail);
-
- let promises = [
- new Promise(resolve => onEvent.addListener(resolve)),
- new Promise(resolve => onSingleton.addListener(resolve)),
- ];
-
- fireEvent("onEvent");
- fireSingleton("onSingleton");
-
- // Both `fireEvent` calls are dispatched asynchronously, so they won't
- // have fired by this point. The `fail` listeners that we remove now
- // should not be called, even though the events have already been
- // enqueued.
- onEvent.removeListener(fail);
- onSingleton.removeListener(fail);
-
- // Wait for the remaining listeners to be called, which should always
- // happen after the `fail` listeners would normally be called.
- yield Promise.all(promises);
-
- // Check that event listeners aren't called after the context has
- // unloaded.
- onEvent.addListener(fail);
- onSingleton.addListener(fail);
-
- // The EventManager `fire` callback always dispatches events
- // asynchronously, so we need to test that any pending event callbacks
- // aren't fired after the context unloads. We also need to test that
- // any `fire` calls that happen *after* the context is unloaded also
- // do not trigger callbacks.
- fireEvent("onEvent");
- Promise.resolve("onEvent").then(fireEvent);
-
- fireSingleton("onSingleton");
- Promise.resolve("onSingleton").then(fireSingleton);
-
- context.unload();
-
- // The `setTimeout` ensures that we return to the event loop after
- // promise resolution, which means we're guaranteed to return after
- // any micro-tasks that get enqueued by the resolution handlers above.
- yield new Promise(resolve => setTimeout(resolve, 0));
-});
-
-class Context extends BaseContext {
- constructor(principal) {
- let fakeExtension = {id: "test@web.extension"};
- super("testEnv", fakeExtension);
- Object.defineProperty(this, "principal", {
- value: principal,
- configurable: true,
- });
- this.sandbox = Cu.Sandbox(principal, {wantXrays: false});
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-}
-
-let ssm = Services.scriptSecurityManager;
-const PRINCIPAL1 = ssm.createCodebasePrincipalFromOrigin("http://www.example.org");
-const PRINCIPAL2 = ssm.createCodebasePrincipalFromOrigin("http://www.somethingelse.org");
-
-// Test that toJSON() works in the json sandbox
-add_task(function* test_stringify_toJSON() {
- let context = new Context(PRINCIPAL1);
- let obj = Cu.evalInSandbox("({hidden: true, toJSON() { return {visible: true}; } })", context.sandbox);
-
- let stringified = context.jsonStringify(obj);
- let expected = JSON.stringify({visible: true});
- equal(stringified, expected, "Stringified object with toJSON() method is as expected");
-});
-
-// Test that stringifying in inaccessible property throws
-add_task(function* test_stringify_inaccessible() {
- let context = new Context(PRINCIPAL1);
- let sandbox = context.sandbox;
- let sandbox2 = Cu.Sandbox(PRINCIPAL2);
-
- Cu.waiveXrays(sandbox).subobj = Cu.evalInSandbox("({ subobject: true })", sandbox2);
- let obj = Cu.evalInSandbox("({ local: true, nested: subobj })", sandbox);
- Assert.throws(() => {
- context.jsonStringify(obj);
- });
-});
-
-add_task(function* test_stringify_accessible() {
- // Test that an accessible property from another global is included
- let principal = Cu.getObjectPrincipal(Cu.Sandbox([PRINCIPAL1, PRINCIPAL2]));
- let context = new Context(principal);
- let sandbox = context.sandbox;
- let sandbox2 = Cu.Sandbox(PRINCIPAL2);
-
- Cu.waiveXrays(sandbox).subobj = Cu.evalInSandbox("({ subobject: true })", sandbox2);
- let obj = Cu.evalInSandbox("({ local: true, nested: subobj })", sandbox);
- let stringified = context.jsonStringify(obj);
-
- let expected = JSON.stringify({local: true, nested: {subobject: true}});
- equal(stringified, expected, "Stringified object with accessible property is as expected");
-});
-
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads.js b/toolkit/components/webextensions/test/xpcshell/test_ext_downloads.js
deleted file mode 100644
index 058b9b18cc..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_downloads_api_namespace_and_permissions() {
- function backgroundScript() {
- browser.test.assertTrue(!!browser.downloads, "`downloads` API is present.");
- browser.test.assertTrue(!!browser.downloads.FilenameConflictAction,
- "`downloads.FilenameConflictAction` enum is present.");
- browser.test.assertTrue(!!browser.downloads.InterruptReason,
- "`downloads.InterruptReason` enum is present.");
- browser.test.assertTrue(!!browser.downloads.DangerType,
- "`downloads.DangerType` enum is present.");
- browser.test.assertTrue(!!browser.downloads.State,
- "`downloads.State` enum is present.");
- browser.test.notifyPass("downloads tests");
- }
-
- let extensionData = {
- background: backgroundScript,
- manifest: {
- permissions: ["downloads", "downloads.open", "downloads.shelf"],
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitFinish("downloads tests");
- yield extension.unload();
-});
-
-add_task(function* test_downloads_open_permission() {
- function backgroundScript() {
- browser.test.assertFalse("open" in browser.downloads,
- "`downloads.open` permission is required.");
- browser.test.notifyPass("downloads tests");
- }
-
- let extensionData = {
- background: backgroundScript,
- manifest: {
- permissions: ["downloads"],
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitFinish("downloads tests");
- yield extension.unload();
-});
-
-add_task(function* test_downloads_open() {
- async function backgroundScript() {
- await browser.test.assertRejects(
- browser.downloads.open(10),
- "Invalid download id 10",
- "The error is informative.");
-
- browser.test.notifyPass("downloads tests");
-
- // TODO: Once downloads.{pause,cancel,resume} lands (bug 1245602) test that this gives a good
- // error when called with an incompleted download.
- }
-
- let extensionData = {
- background: backgroundScript,
- manifest: {
- permissions: ["downloads", "downloads.open"],
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitFinish("downloads tests");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_download.js b/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_download.js
deleted file mode 100644
index 37ddd4d7c1..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_download.js
+++ /dev/null
@@ -1,354 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* global OS */
-
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Downloads.jsm");
-
-const gServer = createHttpServer();
-gServer.registerDirectory("/data/", do_get_file("data"));
-
-const WINDOWS = AppConstants.platform == "win";
-
-const BASE = `http://localhost:${gServer.identity.primaryPort}/data`;
-const FILE_NAME = "file_download.txt";
-const FILE_URL = BASE + "/" + FILE_NAME;
-const FILE_NAME_UNIQUE = "file_download(1).txt";
-const FILE_LEN = 46;
-
-let downloadDir;
-
-function setup() {
- downloadDir = FileUtils.getDir("TmpD", ["downloads"]);
- downloadDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- do_print(`Using download directory ${downloadDir.path}`);
-
- Services.prefs.setIntPref("browser.download.folderList", 2);
- Services.prefs.setComplexValue("browser.download.dir", Ci.nsIFile, downloadDir);
-
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("browser.download.folderList");
- Services.prefs.clearUserPref("browser.download.dir");
-
- let entries = downloadDir.directoryEntries;
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsIFile);
- ok(false, `Leftover file ${entry.path} in download directory`);
- entry.remove(false);
- }
-
- downloadDir.remove(false);
- });
-}
-
-function backgroundScript() {
- let blobUrl;
- browser.test.onMessage.addListener(async (msg, ...args) => {
- if (msg == "download.request") {
- let options = args[0];
-
- if (options.blobme) {
- let blob = new Blob(options.blobme);
- delete options.blobme;
- blobUrl = options.url = window.URL.createObjectURL(blob);
- }
-
- try {
- let id = await browser.downloads.download(options);
- browser.test.sendMessage("download.done", {status: "success", id});
- } catch (error) {
- browser.test.sendMessage("download.done", {status: "error", errmsg: error.message});
- }
- } else if (msg == "killTheBlob") {
- window.URL.revokeObjectURL(blobUrl);
- blobUrl = null;
- }
- });
-
- browser.test.sendMessage("ready");
-}
-
-// This function is a bit of a sledgehammer, it looks at every download
-// the browser knows about and waits for all active downloads to complete.
-// But we only start one at a time and only do a handful in total, so
-// this lets us test download() without depending on anything else.
-async function waitForDownloads() {
- let list = await Downloads.getList(Downloads.ALL);
- let downloads = await list.getAll();
-
- let inprogress = downloads.filter(dl => !dl.stopped);
- return Promise.all(inprogress.map(dl => dl.whenSucceeded()));
-}
-
-// Create a file in the downloads directory.
-function touch(filename) {
- let file = downloadDir.clone();
- file.append(filename);
- file.create(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
-}
-
-// Remove a file in the downloads directory.
-function remove(filename, recursive = false) {
- let file = downloadDir.clone();
- file.append(filename);
- file.remove(recursive);
-}
-
-add_task(function* test_downloads() {
- setup();
-
- let extension = ExtensionTestUtils.loadExtension({
- background: `(${backgroundScript})()`,
- manifest: {
- permissions: ["downloads"],
- },
- });
-
- function download(options) {
- extension.sendMessage("download.request", options);
- return extension.awaitMessage("download.done");
- }
-
- async function testDownload(options, localFile, expectedSize, description) {
- let msg = await download(options);
- equal(msg.status, "success", `downloads.download() works with ${description}`);
-
- await waitForDownloads();
-
- let localPath = downloadDir.clone();
- let parts = Array.isArray(localFile) ? localFile : [localFile];
-
- parts.map(p => localPath.append(p));
- equal(localPath.fileSize, expectedSize, "Downloaded file has expected size");
- localPath.remove(false);
- }
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
- do_print("extension started");
-
- // Call download() with just the url property.
- yield testDownload({url: FILE_URL}, FILE_NAME, FILE_LEN, "just source");
-
- // Call download() with a filename property.
- yield testDownload({
- url: FILE_URL,
- filename: "newpath.txt",
- }, "newpath.txt", FILE_LEN, "source and filename");
-
- // Call download() with a filename with subdirs.
- yield testDownload({
- url: FILE_URL,
- filename: "sub/dir/file",
- }, ["sub", "dir", "file"], FILE_LEN, "source and filename with subdirs");
-
- // Call download() with a filename with existing subdirs.
- yield testDownload({
- url: FILE_URL,
- filename: "sub/dir/file2",
- }, ["sub", "dir", "file2"], FILE_LEN, "source and filename with existing subdirs");
-
- // Only run Windows path separator test on Windows.
- if (WINDOWS) {
- // Call download() with a filename with Windows path separator.
- yield testDownload({
- url: FILE_URL,
- filename: "sub\\dir\\file3",
- }, ["sub", "dir", "file3"], FILE_LEN, "filename with Windows path separator");
- }
- remove("sub", true);
-
- // Call download(), filename with subdir, skipping parts.
- yield testDownload({
- url: FILE_URL,
- filename: "skip//part",
- }, ["skip", "part"], FILE_LEN, "source, filename, with subdir, skipping parts");
- remove("skip", true);
-
- // Check conflictAction of "uniquify".
- touch(FILE_NAME);
- yield testDownload({
- url: FILE_URL,
- conflictAction: "uniquify",
- }, FILE_NAME_UNIQUE, FILE_LEN, "conflictAction=uniquify");
- // todo check that preexisting file was not modified?
- remove(FILE_NAME);
-
- // Check conflictAction of "overwrite".
- touch(FILE_NAME);
- yield testDownload({
- url: FILE_URL,
- conflictAction: "overwrite",
- }, FILE_NAME, FILE_LEN, "conflictAction=overwrite");
-
- // Try to download in invalid url
- yield download({url: "this is not a valid URL"}).then(msg => {
- equal(msg.status, "error", "downloads.download() fails with invalid url");
- ok(/not a valid URL/.test(msg.errmsg), "error message for invalid url is correct");
- });
-
- // Try to download to an empty path.
- yield download({
- url: FILE_URL,
- filename: "",
- }).then(msg => {
- equal(msg.status, "error", "downloads.download() fails with empty filename");
- equal(msg.errmsg, "filename must not be empty", "error message for empty filename is correct");
- });
-
- // Try to download to an absolute path.
- const absolutePath = OS.Path.join(WINDOWS ? "\\tmp" : "/tmp", "file_download.txt");
- yield download({
- url: FILE_URL,
- filename: absolutePath,
- }).then(msg => {
- equal(msg.status, "error", "downloads.download() fails with absolute filename");
- equal(msg.errmsg, "filename must not be an absolute path", `error message for absolute path (${absolutePath}) is correct`);
- });
-
- if (WINDOWS) {
- yield download({
- url: FILE_URL,
- filename: "C:\\file_download.txt",
- }).then(msg => {
- equal(msg.status, "error", "downloads.download() fails with absolute filename");
- equal(msg.errmsg, "filename must not be an absolute path", "error message for absolute path with drive letter is correct");
- });
- }
-
- // Try to download to a relative path containing ..
- yield download({
- url: FILE_URL,
- filename: OS.Path.join("..", "file_download.txt"),
- }).then(msg => {
- equal(msg.status, "error", "downloads.download() fails with back-references");
- equal(msg.errmsg, "filename must not contain back-references (..)", "error message for back-references is correct");
- });
-
- // Try to download to a long relative path containing ..
- yield download({
- url: FILE_URL,
- filename: OS.Path.join("foo", "..", "..", "file_download.txt"),
- }).then(msg => {
- equal(msg.status, "error", "downloads.download() fails with back-references");
- equal(msg.errmsg, "filename must not contain back-references (..)", "error message for back-references is correct");
- });
-
- // Try to download a blob url
- const BLOB_STRING = "Hello, world";
- yield testDownload({
- blobme: [BLOB_STRING],
- filename: FILE_NAME,
- }, FILE_NAME, BLOB_STRING.length, "blob url");
- extension.sendMessage("killTheBlob");
-
- // Try to download a blob url without a given filename
- yield testDownload({
- blobme: [BLOB_STRING],
- }, "download", BLOB_STRING.length, "blob url with no filename");
- extension.sendMessage("killTheBlob");
-
- yield extension.unload();
-});
-
-add_task(function* test_download_post() {
- const server = createHttpServer();
- const url = `http://localhost:${server.identity.primaryPort}/post-log`;
-
- let received;
- server.registerPathHandler("/post-log", request => {
- received = request;
- });
-
- // Confirm received vs. expected values.
- function confirm(method, headers = {}, body) {
- equal(received.method, method, "method is correct");
-
- for (let name in headers) {
- ok(received.hasHeader(name), `header ${name} received`);
- equal(received.getHeader(name), headers[name], `header ${name} is correct`);
- }
-
- if (body) {
- const str = NetUtil.readInputStreamToString(received.bodyInputStream,
- received.bodyInputStream.available());
- equal(str, body, "body is correct");
- }
- }
-
- function background() {
- browser.test.onMessage.addListener(async options => {
- try {
- await browser.downloads.download(options);
- } catch (err) {
- browser.test.sendMessage("done", {err: err.message});
- }
- });
- browser.downloads.onChanged.addListener(({state}) => {
- if (state && state.current === "complete") {
- browser.test.sendMessage("done", {ok: true});
- }
- });
- }
-
- const manifest = {permissions: ["downloads"]};
- const extension = ExtensionTestUtils.loadExtension({background, manifest});
- yield extension.startup();
-
- function download(options) {
- options.url = url;
- options.conflictAction = "overwrite";
-
- extension.sendMessage(options);
- return extension.awaitMessage("done");
- }
-
- // Test method option.
- let result = yield download({});
- ok(result.ok, "download works without the method option, defaults to GET");
- confirm("GET");
-
- result = yield download({method: "PUT"});
- ok(!result.ok, "download rejected with PUT method");
- ok(/method: Invalid enumeration/.test(result.err), "descriptive error message");
-
- result = yield download({method: "POST"});
- ok(result.ok, "download works with POST method");
- confirm("POST");
-
- // Test body option values.
- result = yield download({body: []});
- ok(!result.ok, "download rejected because of non-string body");
- ok(/body: Expected string/.test(result.err), "descriptive error message");
-
- result = yield download({method: "POST", body: "of work"});
- ok(result.ok, "download works with POST method and body");
- confirm("POST", {"Content-Length": 7}, "of work");
-
- // Test custom headers.
- result = yield download({headers: [{name: "X-Custom"}]});
- ok(!result.ok, "download rejected because of missing header value");
- ok(/"value" is required/.test(result.err), "descriptive error message");
-
- result = yield download({headers: [{name: "X-Custom", value: "13"}]});
- ok(result.ok, "download works with a custom header");
- confirm("GET", {"X-Custom": "13"});
-
- // Test forbidden headers.
- result = yield download({headers: [{name: "DNT", value: "1"}]});
- ok(!result.ok, "download rejected because of forbidden header name DNT");
- ok(/Forbidden request header/.test(result.err), "descriptive error message");
-
- result = yield download({headers: [{name: "Proxy-Connection", value: "keep"}]});
- ok(!result.ok, "download rejected because of forbidden header name prefix Proxy-");
- ok(/Forbidden request header/.test(result.err), "descriptive error message");
-
- result = yield download({headers: [{name: "Sec-ret", value: "13"}]});
- ok(!result.ok, "download rejected because of forbidden header name prefix Sec-");
- ok(/Forbidden request header/.test(result.err), "descriptive error message");
-
- remove("post-log");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_misc.js b/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_misc.js
deleted file mode 100644
index d08aab6665..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_misc.js
+++ /dev/null
@@ -1,862 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/Downloads.jsm");
-
-const server = createHttpServer();
-server.registerDirectory("/data/", do_get_file("data"));
-
-const ROOT = `http://localhost:${server.identity.primaryPort}`;
-const BASE = `${ROOT}/data`;
-const TXT_FILE = "file_download.txt";
-const TXT_URL = BASE + "/" + TXT_FILE;
-
-// Keep these in sync with code in interruptible.sjs
-const INT_PARTIAL_LEN = 15;
-const INT_TOTAL_LEN = 31;
-
-const TEST_DATA = "This is 31 bytes of sample data";
-const TOTAL_LEN = TEST_DATA.length;
-const PARTIAL_LEN = 15;
-
-// A handler to let us systematically test pausing/resuming/canceling
-// of downloads. This target represents a small text file but a simple
-// GET will stall after sending part of the data, to give the test code
-// a chance to pause or do other operations on an in-progress download.
-// A resumed download (ie, a GET with a Range: header) will allow the
-// download to complete.
-function handleRequest(request, response) {
- response.setHeader("Content-Type", "text/plain", false);
-
- if (request.hasHeader("Range")) {
- let start, end;
- let matches = request.getHeader("Range")
- .match(/^\s*bytes=(\d+)?-(\d+)?\s*$/);
- if (matches != null) {
- start = matches[1] ? parseInt(matches[1], 10) : 0;
- end = matches[2] ? parseInt(matches[2], 10) : (TOTAL_LEN - 1);
- }
-
- if (end == undefined || end >= TOTAL_LEN) {
- response.setStatusLine(request.httpVersion, 416, "Requested Range Not Satisfiable");
- response.setHeader("Content-Range", `*/${TOTAL_LEN}`, false);
- response.finish();
- return;
- }
-
- response.setStatusLine(request.httpVersion, 206, "Partial Content");
- response.setHeader("Content-Range", `${start}-${end}/${TOTAL_LEN}`, false);
- response.write(TEST_DATA.slice(start, end + 1));
- } else {
- response.processAsync();
- response.setHeader("Content-Length", `${TOTAL_LEN}`, false);
- response.write(TEST_DATA.slice(0, PARTIAL_LEN));
- }
-
- do_register_cleanup(() => {
- try {
- response.finish();
- } catch (e) {
- // This will throw, but we don't care at this point.
- }
- });
-}
-
-server.registerPathHandler("/interruptible.html", handleRequest);
-
-let interruptibleCount = 0;
-function getInterruptibleUrl() {
- let n = interruptibleCount++;
- return `${ROOT}/interruptible.html?count=${n}`;
-}
-
-function backgroundScript() {
- let events = new Set();
- let eventWaiter = null;
-
- browser.downloads.onCreated.addListener(data => {
- events.add({type: "onCreated", data});
- if (eventWaiter) {
- eventWaiter();
- }
- });
-
- browser.downloads.onChanged.addListener(data => {
- events.add({type: "onChanged", data});
- if (eventWaiter) {
- eventWaiter();
- }
- });
-
- browser.downloads.onErased.addListener(data => {
- events.add({type: "onErased", data});
- if (eventWaiter) {
- eventWaiter();
- }
- });
-
- // Returns a promise that will resolve when the given list of expected
- // events have all been seen. By default, succeeds only if the exact list
- // of expected events is seen in the given order. options.exact can be
- // set to false to allow other events and options.inorder can be set to
- // false to allow the events to arrive in any order.
- function waitForEvents(expected, options = {}) {
- function compare(a, b) {
- if (typeof b == "object" && b != null) {
- if (typeof a != "object") {
- return false;
- }
- return Object.keys(b).every(fld => compare(a[fld], b[fld]));
- }
- return (a == b);
- }
-
- const exact = ("exact" in options) ? options.exact : true;
- const inorder = ("inorder" in options) ? options.inorder : true;
- return new Promise((resolve, reject) => {
- function check() {
- function fail(msg) {
- browser.test.fail(msg);
- reject(new Error(msg));
- }
- if (events.size < expected.length) {
- return;
- }
- if (exact && expected.length < events.size) {
- fail(`Got ${events.size} events but only expected ${expected.length}`);
- return;
- }
-
- let remaining = new Set(events);
- if (inorder) {
- for (let event of events) {
- if (compare(event, expected[0])) {
- expected.shift();
- remaining.delete(event);
- }
- }
- } else {
- expected = expected.filter(val => {
- for (let remainingEvent of remaining) {
- if (compare(remainingEvent, val)) {
- remaining.delete(remainingEvent);
- return false;
- }
- }
- return true;
- });
- }
-
- // Events that did occur have been removed from expected so if
- // expected is empty, we're done. If we didn't see all the
- // expected events and we're not looking for an exact match,
- // then we just may not have seen the event yet, so return without
- // failing and check() will be called again when a new event arrives.
- if (expected.length == 0) {
- events = remaining;
- eventWaiter = null;
- resolve();
- } else if (exact) {
- fail(`Mismatched event: expecting ${JSON.stringify(expected[0])} but got ${JSON.stringify(Array.from(remaining)[0])}`);
- }
- }
- eventWaiter = check;
- check();
- });
- }
-
- browser.test.onMessage.addListener(async (msg, ...args) => {
- let match = msg.match(/(\w+).request$/);
- if (!match) {
- return;
- }
-
- let what = match[1];
- if (what == "waitForEvents") {
- try {
- await waitForEvents(...args);
- browser.test.sendMessage("waitForEvents.done", {status: "success"});
- } catch (error) {
- browser.test.sendMessage("waitForEvents.done", {status: "error", errmsg: error.message});
- }
- } else if (what == "clearEvents") {
- events = new Set();
- browser.test.sendMessage("clearEvents.done", {status: "success"});
- } else {
- try {
- let result = await browser.downloads[what](...args);
- browser.test.sendMessage(`${what}.done`, {status: "success", result});
- } catch (error) {
- browser.test.sendMessage(`${what}.done`, {status: "error", errmsg: error.message});
- }
- }
- });
-
- browser.test.sendMessage("ready");
-}
-
-let downloadDir;
-let extension;
-
-async function clearDownloads(callback) {
- let list = await Downloads.getList(Downloads.ALL);
- let downloads = await list.getAll();
-
- await Promise.all(downloads.map(download => list.remove(download)));
-
- return downloads;
-}
-
-function runInExtension(what, ...args) {
- extension.sendMessage(`${what}.request`, ...args);
- return extension.awaitMessage(`${what}.done`);
-}
-
-// This is pretty simplistic, it looks for a progress update for a
-// download of the given url in which the total bytes are exactly equal
-// to the given value. Unless you know exactly how data will arrive from
-// the server (eg see interruptible.sjs), it probably isn't very useful.
-async function waitForProgress(url, bytes) {
- let list = await Downloads.getList(Downloads.ALL);
-
- return new Promise(resolve => {
- const view = {
- onDownloadChanged(download) {
- if (download.source.url == url && download.currentBytes == bytes) {
- list.removeView(view);
- resolve();
- }
- },
- };
- list.addView(view);
- });
-}
-
-add_task(function* setup() {
- const nsIFile = Ci.nsIFile;
- downloadDir = FileUtils.getDir("TmpD", ["downloads"]);
- downloadDir.createUnique(nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- do_print(`downloadDir ${downloadDir.path}`);
-
- Services.prefs.setIntPref("browser.download.folderList", 2);
- Services.prefs.setComplexValue("browser.download.dir", nsIFile, downloadDir);
-
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("browser.download.folderList");
- Services.prefs.clearUserPref("browser.download.dir");
- downloadDir.remove(true);
-
- return clearDownloads();
- });
-
- yield clearDownloads().then(downloads => {
- do_print(`removed ${downloads.length} pre-existing downloads from history`);
- });
-
- extension = ExtensionTestUtils.loadExtension({
- background: backgroundScript,
- manifest: {
- permissions: ["downloads"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-});
-
-add_task(function* test_events() {
- let msg = yield runInExtension("download", {url: TXT_URL});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id, url: TXT_URL}},
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "complete",
- },
- },
- },
- ]);
- equal(msg.status, "success", "got onCreated and onChanged events");
-});
-
-add_task(function* test_cancel() {
- let url = getInterruptibleUrl();
- do_print(url);
- let msg = yield runInExtension("download", {url});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- let progressPromise = waitForProgress(url, INT_PARTIAL_LEN);
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id}},
- ]);
- equal(msg.status, "success", "got created and changed events");
-
- yield progressPromise;
- do_print(`download reached ${INT_PARTIAL_LEN} bytes`);
-
- msg = yield runInExtension("cancel", id);
- equal(msg.status, "success", "cancel() succeeded");
-
- // This sequence of events is bogus (bug 1256243)
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- state: {
- previous: "in_progress",
- current: "interrupted",
- },
- paused: {
- previous: false,
- current: true,
- },
- },
- }, {
- type: "onChanged",
- data: {
- id,
- error: {
- previous: null,
- current: "USER_CANCELED",
- },
- },
- }, {
- type: "onChanged",
- data: {
- id,
- paused: {
- previous: true,
- current: false,
- },
- },
- },
- ]);
- equal(msg.status, "success", "got onChanged events corresponding to cancel()");
-
- msg = yield runInExtension("search", {error: "USER_CANCELED"});
- equal(msg.status, "success", "search() succeeded");
- equal(msg.result.length, 1, "search() found 1 download");
- equal(msg.result[0].id, id, "download.id is correct");
- equal(msg.result[0].state, "interrupted", "download.state is correct");
- equal(msg.result[0].paused, false, "download.paused is correct");
- equal(msg.result[0].canResume, false, "download.canResume is correct");
- equal(msg.result[0].error, "USER_CANCELED", "download.error is correct");
- equal(msg.result[0].totalBytes, INT_TOTAL_LEN, "download.totalBytes is correct");
- equal(msg.result[0].exists, false, "download.exists is correct");
-
- msg = yield runInExtension("pause", id);
- equal(msg.status, "error", "cannot pause a canceled download");
-
- msg = yield runInExtension("resume", id);
- equal(msg.status, "error", "cannot resume a canceled download");
-});
-
-add_task(function* test_pauseresume() {
- let url = getInterruptibleUrl();
- let msg = yield runInExtension("download", {url});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- let progressPromise = waitForProgress(url, INT_PARTIAL_LEN);
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id}},
- ]);
- equal(msg.status, "success", "got created and changed events");
-
- yield progressPromise;
- do_print(`download reached ${INT_PARTIAL_LEN} bytes`);
-
- msg = yield runInExtension("pause", id);
- equal(msg.status, "success", "pause() succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "interrupted",
- },
- paused: {
- previous: false,
- current: true,
- },
- canResume: {
- previous: false,
- current: true,
- },
- },
- }, {
- type: "onChanged",
- data: {
- id,
- error: {
- previous: null,
- current: "USER_CANCELED",
- },
- },
- }]);
- equal(msg.status, "success", "got onChanged event corresponding to pause");
-
- msg = yield runInExtension("search", {paused: true});
- equal(msg.status, "success", "search() succeeded");
- equal(msg.result.length, 1, "search() found 1 download");
- equal(msg.result[0].id, id, "download.id is correct");
- equal(msg.result[0].state, "interrupted", "download.state is correct");
- equal(msg.result[0].paused, true, "download.paused is correct");
- equal(msg.result[0].canResume, true, "download.canResume is correct");
- equal(msg.result[0].error, "USER_CANCELED", "download.error is correct");
- equal(msg.result[0].bytesReceived, INT_PARTIAL_LEN, "download.bytesReceived is correct");
- equal(msg.result[0].totalBytes, INT_TOTAL_LEN, "download.totalBytes is correct");
- equal(msg.result[0].exists, false, "download.exists is correct");
-
- msg = yield runInExtension("search", {error: "USER_CANCELED"});
- equal(msg.status, "success", "search() succeeded");
- let found = msg.result.filter(item => item.id == id);
- equal(found.length, 1, "search() by error found the paused download");
-
- msg = yield runInExtension("pause", id);
- equal(msg.status, "error", "cannot pause an already paused download");
-
- msg = yield runInExtension("resume", id);
- equal(msg.status, "success", "resume() succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "interrupted",
- current: "in_progress",
- },
- paused: {
- previous: true,
- current: false,
- },
- canResume: {
- previous: true,
- current: false,
- },
- error: {
- previous: "USER_CANCELED",
- current: null,
- },
- },
- },
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "complete",
- },
- },
- },
- ]);
- equal(msg.status, "success", "got onChanged events for resume and complete");
-
- msg = yield runInExtension("search", {id});
- equal(msg.status, "success", "search() succeeded");
- equal(msg.result.length, 1, "search() found 1 download");
- equal(msg.result[0].state, "complete", "download.state is correct");
- equal(msg.result[0].paused, false, "download.paused is correct");
- equal(msg.result[0].canResume, false, "download.canResume is correct");
- equal(msg.result[0].error, null, "download.error is correct");
- equal(msg.result[0].bytesReceived, INT_TOTAL_LEN, "download.bytesReceived is correct");
- equal(msg.result[0].totalBytes, INT_TOTAL_LEN, "download.totalBytes is correct");
- equal(msg.result[0].exists, true, "download.exists is correct");
-
- msg = yield runInExtension("pause", id);
- equal(msg.status, "error", "cannot pause a completed download");
-
- msg = yield runInExtension("resume", id);
- equal(msg.status, "error", "cannot resume a completed download");
-});
-
-add_task(function* test_pausecancel() {
- let url = getInterruptibleUrl();
- let msg = yield runInExtension("download", {url});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- let progressPromise = waitForProgress(url, INT_PARTIAL_LEN);
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id}},
- ]);
- equal(msg.status, "success", "got created and changed events");
-
- yield progressPromise;
- do_print(`download reached ${INT_PARTIAL_LEN} bytes`);
-
- msg = yield runInExtension("pause", id);
- equal(msg.status, "success", "pause() succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "interrupted",
- },
- paused: {
- previous: false,
- current: true,
- },
- canResume: {
- previous: false,
- current: true,
- },
- },
- }, {
- type: "onChanged",
- data: {
- id,
- error: {
- previous: null,
- current: "USER_CANCELED",
- },
- },
- }]);
- equal(msg.status, "success", "got onChanged event corresponding to pause");
-
- msg = yield runInExtension("search", {paused: true});
- equal(msg.status, "success", "search() succeeded");
- equal(msg.result.length, 1, "search() found 1 download");
- equal(msg.result[0].id, id, "download.id is correct");
- equal(msg.result[0].state, "interrupted", "download.state is correct");
- equal(msg.result[0].paused, true, "download.paused is correct");
- equal(msg.result[0].canResume, true, "download.canResume is correct");
- equal(msg.result[0].error, "USER_CANCELED", "download.error is correct");
- equal(msg.result[0].bytesReceived, INT_PARTIAL_LEN, "download.bytesReceived is correct");
- equal(msg.result[0].totalBytes, INT_TOTAL_LEN, "download.totalBytes is correct");
- equal(msg.result[0].exists, false, "download.exists is correct");
-
- msg = yield runInExtension("search", {error: "USER_CANCELED"});
- equal(msg.status, "success", "search() succeeded");
- let found = msg.result.filter(item => item.id == id);
- equal(found.length, 1, "search() by error found the paused download");
-
- msg = yield runInExtension("cancel", id);
- equal(msg.status, "success", "cancel() succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- id,
- paused: {
- previous: true,
- current: false,
- },
- canResume: {
- previous: true,
- current: false,
- },
- },
- },
- ]);
- equal(msg.status, "success", "got onChanged event for cancel");
-
- msg = yield runInExtension("search", {id});
- equal(msg.status, "success", "search() succeeded");
- equal(msg.result.length, 1, "search() found 1 download");
- equal(msg.result[0].state, "interrupted", "download.state is correct");
- equal(msg.result[0].paused, false, "download.paused is correct");
- equal(msg.result[0].canResume, false, "download.canResume is correct");
- equal(msg.result[0].error, "USER_CANCELED", "download.error is correct");
- equal(msg.result[0].totalBytes, INT_TOTAL_LEN, "download.totalBytes is correct");
- equal(msg.result[0].exists, false, "download.exists is correct");
-});
-
-add_task(function* test_pause_resume_cancel_badargs() {
- let BAD_ID = 1000;
-
- let msg = yield runInExtension("pause", BAD_ID);
- equal(msg.status, "error", "pause() failed with a bad download id");
- ok(/Invalid download id/.test(msg.errmsg), "error message is descriptive");
-
- msg = yield runInExtension("resume", BAD_ID);
- equal(msg.status, "error", "resume() failed with a bad download id");
- ok(/Invalid download id/.test(msg.errmsg), "error message is descriptive");
-
- msg = yield runInExtension("cancel", BAD_ID);
- equal(msg.status, "error", "cancel() failed with a bad download id");
- ok(/Invalid download id/.test(msg.errmsg), "error message is descriptive");
-});
-
-add_task(function* test_file_removal() {
- let msg = yield runInExtension("download", {url: TXT_URL});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id, url: TXT_URL}},
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "complete",
- },
- },
- },
- ]);
-
- equal(msg.status, "success", "got onCreated and onChanged events");
-
- msg = yield runInExtension("removeFile", id);
- equal(msg.status, "success", "removeFile() succeeded");
-
- msg = yield runInExtension("removeFile", id);
- equal(msg.status, "error", "removeFile() fails since the file was already removed.");
- ok(/file doesn't exist/.test(msg.errmsg), "removeFile() failed on removed file.");
-
- msg = yield runInExtension("removeFile", 1000);
- ok(/Invalid download id/.test(msg.errmsg), "removeFile() failed due to non-existent id");
-});
-
-add_task(function* test_removal_of_incomplete_download() {
- let url = getInterruptibleUrl();
- let msg = yield runInExtension("download", {url});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- let progressPromise = waitForProgress(url, INT_PARTIAL_LEN);
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id}},
- ]);
- equal(msg.status, "success", "got created and changed events");
-
- yield progressPromise;
- do_print(`download reached ${INT_PARTIAL_LEN} bytes`);
-
- msg = yield runInExtension("pause", id);
- equal(msg.status, "success", "pause() succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "interrupted",
- },
- paused: {
- previous: false,
- current: true,
- },
- canResume: {
- previous: false,
- current: true,
- },
- },
- }, {
- type: "onChanged",
- data: {
- id,
- error: {
- previous: null,
- current: "USER_CANCELED",
- },
- },
- }]);
- equal(msg.status, "success", "got onChanged event corresponding to pause");
-
- msg = yield runInExtension("removeFile", id);
- equal(msg.status, "error", "removeFile() on paused download failed");
-
- ok(/Cannot remove incomplete download/.test(msg.errmsg), "removeFile() failed due to download being incomplete");
-
- msg = yield runInExtension("resume", id);
- equal(msg.status, "success", "resume() succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "interrupted",
- current: "in_progress",
- },
- paused: {
- previous: true,
- current: false,
- },
- canResume: {
- previous: true,
- current: false,
- },
- error: {
- previous: "USER_CANCELED",
- current: null,
- },
- },
- },
- {
- type: "onChanged",
- data: {
- id,
- state: {
- previous: "in_progress",
- current: "complete",
- },
- },
- },
- ]);
- equal(msg.status, "success", "got onChanged events for resume and complete");
-
- msg = yield runInExtension("removeFile", id);
- equal(msg.status, "success", "removeFile() succeeded following completion of resumed download.");
-});
-
-// Test erase(). We don't do elaborate testing of the query handling
-// since it uses the exact same engine as search() which is tested
-// more thoroughly in test_chrome_ext_downloads_search.html
-add_task(function* test_erase() {
- yield clearDownloads();
-
- yield runInExtension("clearEvents");
-
- function* download() {
- let msg = yield runInExtension("download", {url: TXT_URL});
- equal(msg.status, "success", "download succeeded");
- let id = msg.result;
-
- msg = yield runInExtension("waitForEvents", [{
- type: "onChanged", data: {id, state: {current: "complete"}},
- }], {exact: false});
- equal(msg.status, "success", "download finished");
-
- return id;
- }
-
- let ids = {};
- ids.dl1 = yield download();
- ids.dl2 = yield download();
- ids.dl3 = yield download();
-
- let msg = yield runInExtension("search", {});
- equal(msg.status, "success", "search succeded");
- equal(msg.result.length, 3, "search found 3 downloads");
-
- msg = yield runInExtension("clearEvents");
-
- msg = yield runInExtension("erase", {id: ids.dl1});
- equal(msg.status, "success", "erase by id succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onErased", data: ids.dl1},
- ]);
- equal(msg.status, "success", "received onErased event");
-
- msg = yield runInExtension("search", {});
- equal(msg.status, "success", "search succeded");
- equal(msg.result.length, 2, "search found 2 downloads");
-
- msg = yield runInExtension("erase", {});
- equal(msg.status, "success", "erase everything succeeded");
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onErased", data: ids.dl2},
- {type: "onErased", data: ids.dl3},
- ], {inorder: false});
- equal(msg.status, "success", "received 2 onErased events");
-
- msg = yield runInExtension("search", {});
- equal(msg.status, "success", "search succeded");
- equal(msg.result.length, 0, "search found 0 downloads");
-});
-
-function loadImage(img, data) {
- return new Promise((resolve) => {
- img.src = data;
- img.onload = resolve;
- });
-}
-
-add_task(function* test_getFileIcon() {
- let webNav = Services.appShell.createWindowlessBrowser(false);
- let docShell = webNav.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell);
-
- let system = Services.scriptSecurityManager.getSystemPrincipal();
- docShell.createAboutBlankContentViewer(system);
-
- let img = webNav.document.createElement("img");
-
- let msg = yield runInExtension("download", {url: TXT_URL});
- equal(msg.status, "success", "download() succeeded");
- const id = msg.result;
-
- msg = yield runInExtension("getFileIcon", id);
- equal(msg.status, "success", "getFileIcon() succeeded");
- yield loadImage(img, msg.result);
- equal(img.height, 32, "returns an icon with the right height");
- equal(img.width, 32, "returns an icon with the right width");
-
- msg = yield runInExtension("waitForEvents", [
- {type: "onCreated", data: {id, url: TXT_URL}},
- {type: "onChanged"},
- ]);
- equal(msg.status, "success", "got events");
-
- msg = yield runInExtension("getFileIcon", id);
- equal(msg.status, "success", "getFileIcon() succeeded");
- yield loadImage(img, msg.result);
- equal(img.height, 32, "returns an icon with the right height after download");
- equal(img.width, 32, "returns an icon with the right width after download");
-
- msg = yield runInExtension("getFileIcon", id + 100);
- equal(msg.status, "error", "getFileIcon() failed");
- ok(msg.errmsg.includes("Invalid download id"), "download id is invalid");
-
- msg = yield runInExtension("getFileIcon", id, {size: 127});
- equal(msg.status, "success", "getFileIcon() succeeded");
- yield loadImage(img, msg.result);
- equal(img.height, 127, "returns an icon with the right custom height");
- equal(img.width, 127, "returns an icon with the right custom width");
-
- msg = yield runInExtension("getFileIcon", id, {size: 1});
- equal(msg.status, "success", "getFileIcon() succeeded");
- yield loadImage(img, msg.result);
- equal(img.height, 1, "returns an icon with the right custom height");
- equal(img.width, 1, "returns an icon with the right custom width");
-
- msg = yield runInExtension("getFileIcon", id, {size: "foo"});
- equal(msg.status, "error", "getFileIcon() fails");
- ok(msg.errmsg.includes("Error processing size"), "size is not a number");
-
- msg = yield runInExtension("getFileIcon", id, {size: 0});
- equal(msg.status, "error", "getFileIcon() fails");
- ok(msg.errmsg.includes("Error processing size"), "size is too small");
-
- msg = yield runInExtension("getFileIcon", id, {size: 128});
- equal(msg.status, "error", "getFileIcon() fails");
- ok(msg.errmsg.includes("Error processing size"), "size is too big");
-
- webNav.close();
-});
-
-add_task(function* cleanup() {
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_search.js b/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_search.js
deleted file mode 100644
index 4caa82456f..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_downloads_search.js
+++ /dev/null
@@ -1,402 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/Downloads.jsm");
-
-const server = createHttpServer();
-server.registerDirectory("/data/", do_get_file("data"));
-
-const BASE = `http://localhost:${server.identity.primaryPort}/data`;
-const TXT_FILE = "file_download.txt";
-const TXT_URL = BASE + "/" + TXT_FILE;
-const TXT_LEN = 46;
-const HTML_FILE = "file_download.html";
-const HTML_URL = BASE + "/" + HTML_FILE;
-const HTML_LEN = 117;
-const BIG_LEN = 1000; // something bigger both TXT_LEN and HTML_LEN
-
-function backgroundScript() {
- let complete = new Map();
-
- function waitForComplete(id) {
- if (complete.has(id)) {
- return complete.get(id).promise;
- }
-
- let promise = new Promise(resolve => {
- complete.set(id, {resolve});
- });
- complete.get(id).promise = promise;
- return promise;
- }
-
- browser.downloads.onChanged.addListener(change => {
- if (change.state && change.state.current == "complete") {
- // Make sure we have a promise.
- waitForComplete(change.id);
- complete.get(change.id).resolve();
- }
- });
-
- browser.test.onMessage.addListener(async (msg, ...args) => {
- if (msg == "download.request") {
- try {
- let id = await browser.downloads.download(args[0]);
- browser.test.sendMessage("download.done", {status: "success", id});
- } catch (error) {
- browser.test.sendMessage("download.done", {status: "error", errmsg: error.message});
- }
- } else if (msg == "search.request") {
- try {
- let downloads = await browser.downloads.search(args[0]);
- browser.test.sendMessage("search.done", {status: "success", downloads});
- } catch (error) {
- browser.test.sendMessage("search.done", {status: "error", errmsg: error.message});
- }
- } else if (msg == "waitForComplete.request") {
- await waitForComplete(args[0]);
- browser.test.sendMessage("waitForComplete.done");
- }
- });
-
- browser.test.sendMessage("ready");
-}
-
-async function clearDownloads(callback) {
- let list = await Downloads.getList(Downloads.ALL);
- let downloads = await list.getAll();
-
- await Promise.all(downloads.map(download => list.remove(download)));
-
- return downloads;
-}
-
-add_task(function* test_search() {
- const nsIFile = Ci.nsIFile;
- let downloadDir = FileUtils.getDir("TmpD", ["downloads"]);
- downloadDir.createUnique(nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- do_print(`downloadDir ${downloadDir.path}`);
-
- function downloadPath(filename) {
- let path = downloadDir.clone();
- path.append(filename);
- return path.path;
- }
-
- Services.prefs.setIntPref("browser.download.folderList", 2);
- Services.prefs.setComplexValue("browser.download.dir", nsIFile, downloadDir);
-
- do_register_cleanup(async () => {
- Services.prefs.clearUserPref("browser.download.folderList");
- Services.prefs.clearUserPref("browser.download.dir");
- await cleanupDir(downloadDir);
- await clearDownloads();
- });
-
- yield clearDownloads().then(downloads => {
- do_print(`removed ${downloads.length} pre-existing downloads from history`);
- });
-
- let extension = ExtensionTestUtils.loadExtension({
- background: backgroundScript,
- manifest: {
- permissions: ["downloads"],
- },
- });
-
- async function download(options) {
- extension.sendMessage("download.request", options);
- let result = await extension.awaitMessage("download.done");
-
- if (result.status == "success") {
- do_print(`wait for onChanged event to indicate ${result.id} is complete`);
- extension.sendMessage("waitForComplete.request", result.id);
-
- await extension.awaitMessage("waitForComplete.done");
- }
-
- return result;
- }
-
- function search(query) {
- extension.sendMessage("search.request", query);
- return extension.awaitMessage("search.done");
- }
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- // Do some downloads...
- const time1 = new Date();
-
- let downloadIds = {};
- let msg = yield download({url: TXT_URL});
- equal(msg.status, "success", "download() succeeded");
- downloadIds.txt1 = msg.id;
-
- const TXT_FILE2 = "NewFile.txt";
- msg = yield download({url: TXT_URL, filename: TXT_FILE2});
- equal(msg.status, "success", "download() succeeded");
- downloadIds.txt2 = msg.id;
-
- const time2 = new Date();
-
- msg = yield download({url: HTML_URL});
- equal(msg.status, "success", "download() succeeded");
- downloadIds.html1 = msg.id;
-
- const HTML_FILE2 = "renamed.html";
- msg = yield download({url: HTML_URL, filename: HTML_FILE2});
- equal(msg.status, "success", "download() succeeded");
- downloadIds.html2 = msg.id;
-
- const time3 = new Date();
-
- // Search for each individual download and check
- // the corresponding DownloadItem.
- function* checkDownloadItem(id, expect) {
- let item = yield search({id});
- equal(item.status, "success", "search() succeeded");
- equal(item.downloads.length, 1, "search() found exactly 1 download");
-
- Object.keys(expect).forEach(function(field) {
- equal(item.downloads[0][field], expect[field], `DownloadItem.${field} is correct"`);
- });
- }
- yield checkDownloadItem(downloadIds.txt1, {
- url: TXT_URL,
- filename: downloadPath(TXT_FILE),
- mime: "text/plain",
- state: "complete",
- bytesReceived: TXT_LEN,
- totalBytes: TXT_LEN,
- fileSize: TXT_LEN,
- exists: true,
- });
-
- yield checkDownloadItem(downloadIds.txt2, {
- url: TXT_URL,
- filename: downloadPath(TXT_FILE2),
- mime: "text/plain",
- state: "complete",
- bytesReceived: TXT_LEN,
- totalBytes: TXT_LEN,
- fileSize: TXT_LEN,
- exists: true,
- });
-
- yield checkDownloadItem(downloadIds.html1, {
- url: HTML_URL,
- filename: downloadPath(HTML_FILE),
- mime: "text/html",
- state: "complete",
- bytesReceived: HTML_LEN,
- totalBytes: HTML_LEN,
- fileSize: HTML_LEN,
- exists: true,
- });
-
- yield checkDownloadItem(downloadIds.html2, {
- url: HTML_URL,
- filename: downloadPath(HTML_FILE2),
- mime: "text/html",
- state: "complete",
- bytesReceived: HTML_LEN,
- totalBytes: HTML_LEN,
- fileSize: HTML_LEN,
- exists: true,
- });
-
- function* checkSearch(query, expected, description, exact) {
- let item = yield search(query);
- equal(item.status, "success", "search() succeeded");
- equal(item.downloads.length, expected.length, `search() for ${description} found exactly ${expected.length} downloads`);
-
- let receivedIds = item.downloads.map(i => i.id);
- if (exact) {
- receivedIds.forEach((id, idx) => {
- equal(id, downloadIds[expected[idx]], `search() for ${description} returned ${expected[idx]} in position ${idx}`);
- });
- } else {
- Object.keys(downloadIds).forEach(key => {
- const id = downloadIds[key];
- const thisExpected = expected.includes(key);
- equal(receivedIds.includes(id), thisExpected,
- `search() for ${description} ${thisExpected ? "includes" : "does not include"} ${key}`);
- });
- }
- }
-
- // Check that search with an invalid id returns nothing.
- // NB: for now ids are not persistent and we start numbering them at 1
- // so a sufficiently large number will be unused.
- const INVALID_ID = 1000;
- yield checkSearch({id: INVALID_ID}, [], "invalid id");
-
- // Check that search on url works.
- yield checkSearch({url: TXT_URL}, ["txt1", "txt2"], "url");
-
- // Check that regexp on url works.
- const HTML_REGEX = "[downlad]{8}\.html+$";
- yield checkSearch({urlRegex: HTML_REGEX}, ["html1", "html2"], "url regexp");
-
- // Check that compatible url+regexp works
- yield checkSearch({url: HTML_URL, urlRegex: HTML_REGEX}, ["html1", "html2"], "compatible url+urlRegex");
-
- // Check that incompatible url+regexp works
- yield checkSearch({url: TXT_URL, urlRegex: HTML_REGEX}, [], "incompatible url+urlRegex");
-
- // Check that search on filename works.
- yield checkSearch({filename: downloadPath(TXT_FILE)}, ["txt1"], "filename");
-
- // Check that regexp on filename works.
- yield checkSearch({filenameRegex: HTML_REGEX}, ["html1"], "filename regex");
-
- // Check that compatible filename+regexp works
- yield checkSearch({filename: downloadPath(HTML_FILE), filenameRegex: HTML_REGEX}, ["html1"], "compatible filename+filename regex");
-
- // Check that incompatible filename+regexp works
- yield checkSearch({filename: downloadPath(TXT_FILE), filenameRegex: HTML_REGEX}, [], "incompatible filename+filename regex");
-
- // Check that simple positive search terms work.
- yield checkSearch({query: ["file_download"]}, ["txt1", "txt2", "html1", "html2"],
- "term file_download");
- yield checkSearch({query: ["NewFile"]}, ["txt2"], "term NewFile");
-
- // Check that positive search terms work case-insensitive.
- yield checkSearch({query: ["nEwfILe"]}, ["txt2"], "term nEwfiLe");
-
- // Check that negative search terms work.
- yield checkSearch({query: ["-txt"]}, ["html1", "html2"], "term -txt");
-
- // Check that positive and negative search terms together work.
- yield checkSearch({query: ["html", "-renamed"]}, ["html1"], "postive and negative terms");
-
- function* checkSearchWithDate(query, expected, description) {
- const fields = Object.keys(query);
- if (fields.length != 1 || !(query[fields[0]] instanceof Date)) {
- throw new Error("checkSearchWithDate expects exactly one Date field");
- }
- const field = fields[0];
- const date = query[field];
-
- let newquery = {};
-
- // Check as a Date
- newquery[field] = date;
- yield checkSearch(newquery, expected, `${description} as Date`);
-
- // Check as numeric milliseconds
- newquery[field] = date.valueOf();
- yield checkSearch(newquery, expected, `${description} as numeric ms`);
-
- // Check as stringified milliseconds
- newquery[field] = date.valueOf().toString();
- yield checkSearch(newquery, expected, `${description} as string ms`);
-
- // Check as ISO string
- newquery[field] = date.toISOString();
- yield checkSearch(newquery, expected, `${description} as iso string`);
- }
-
- // Check startedBefore
- yield checkSearchWithDate({startedBefore: time1}, [], "before time1");
- yield checkSearchWithDate({startedBefore: time2}, ["txt1", "txt2"], "before time2");
- yield checkSearchWithDate({startedBefore: time3}, ["txt1", "txt2", "html1", "html2"], "before time3");
-
- // Check startedAfter
- yield checkSearchWithDate({startedAfter: time1}, ["txt1", "txt2", "html1", "html2"], "after time1");
- yield checkSearchWithDate({startedAfter: time2}, ["html1", "html2"], "after time2");
- yield checkSearchWithDate({startedAfter: time3}, [], "after time3");
-
- // Check simple search on totalBytes
- yield checkSearch({totalBytes: TXT_LEN}, ["txt1", "txt2"], "totalBytes");
- yield checkSearch({totalBytes: HTML_LEN}, ["html1", "html2"], "totalBytes");
-
- // Check simple test on totalBytes{Greater,Less}
- // (NB: TXT_LEN < HTML_LEN < BIG_LEN)
- yield checkSearch({totalBytesGreater: 0}, ["txt1", "txt2", "html1", "html2"], "totalBytesGreater than 0");
- yield checkSearch({totalBytesGreater: TXT_LEN}, ["html1", "html2"], `totalBytesGreater than ${TXT_LEN}`);
- yield checkSearch({totalBytesGreater: HTML_LEN}, [], `totalBytesGreater than ${HTML_LEN}`);
- yield checkSearch({totalBytesLess: TXT_LEN}, [], `totalBytesLess than ${TXT_LEN}`);
- yield checkSearch({totalBytesLess: HTML_LEN}, ["txt1", "txt2"], `totalBytesLess than ${HTML_LEN}`);
- yield checkSearch({totalBytesLess: BIG_LEN}, ["txt1", "txt2", "html1", "html2"], `totalBytesLess than ${BIG_LEN}`);
-
- // Check good combinations of totalBytes*.
- yield checkSearch({totalBytes: HTML_LEN, totalBytesGreater: TXT_LEN}, ["html1", "html2"], "totalBytes and totalBytesGreater");
- yield checkSearch({totalBytes: TXT_LEN, totalBytesLess: HTML_LEN}, ["txt1", "txt2"], "totalBytes and totalBytesGreater");
- yield checkSearch({totalBytes: HTML_LEN, totalBytesLess: BIG_LEN, totalBytesGreater: 0}, ["html1", "html2"], "totalBytes and totalBytesLess and totalBytesGreater");
-
- // Check bad combination of totalBytes*.
- yield checkSearch({totalBytesLess: TXT_LEN, totalBytesGreater: HTML_LEN}, [], "bad totalBytesLess, totalBytesGreater combination");
- yield checkSearch({totalBytes: TXT_LEN, totalBytesGreater: HTML_LEN}, [], "bad totalBytes, totalBytesGreater combination");
- yield checkSearch({totalBytes: HTML_LEN, totalBytesLess: TXT_LEN}, [], "bad totalBytes, totalBytesLess combination");
-
- // Check mime.
- yield checkSearch({mime: "text/plain"}, ["txt1", "txt2"], "mime text/plain");
- yield checkSearch({mime: "text/html"}, ["html1", "html2"], "mime text/htmlplain");
- yield checkSearch({mime: "video/webm"}, [], "mime video/webm");
-
- // Check fileSize.
- yield checkSearch({fileSize: TXT_LEN}, ["txt1", "txt2"], "fileSize");
- yield checkSearch({fileSize: HTML_LEN}, ["html1", "html2"], "fileSize");
-
- // Fields like bytesReceived, paused, state, exists are meaningful
- // for downloads that are in progress but have not yet completed.
- // todo: add tests for these when we have better support for in-progress
- // downloads (e.g., after pause(), resume() and cancel() are implemented)
-
- // Check multiple query properties.
- // We could make this testing arbitrarily complicated...
- // We already tested combining fields with obvious interactions above
- // (e.g., filename and filenameRegex or startTime and startedBefore/After)
- // so now just throw as many fields as we can at a single search and
- // make sure a simple case still works.
- yield checkSearch({
- url: TXT_URL,
- urlRegex: "download",
- filename: downloadPath(TXT_FILE),
- filenameRegex: "download",
- query: ["download"],
- startedAfter: time1.valueOf().toString(),
- startedBefore: time2.valueOf().toString(),
- totalBytes: TXT_LEN,
- totalBytesGreater: 0,
- totalBytesLess: BIG_LEN,
- mime: "text/plain",
- fileSize: TXT_LEN,
- }, ["txt1"], "many properties");
-
- // Check simple orderBy (forward and backward).
- yield checkSearch({orderBy: ["startTime"]}, ["txt1", "txt2", "html1", "html2"], "orderBy startTime", true);
- yield checkSearch({orderBy: ["-startTime"]}, ["html2", "html1", "txt2", "txt1"], "orderBy -startTime", true);
-
- // Check orderBy with multiple fields.
- // NB: TXT_URL and HTML_URL differ only in extension and .html precedes .txt
- yield checkSearch({orderBy: ["url", "-startTime"]}, ["html2", "html1", "txt2", "txt1"], "orderBy with multiple fields", true);
-
- // Check orderBy with limit.
- yield checkSearch({orderBy: ["url"], limit: 1}, ["html1"], "orderBy with limit", true);
-
- // Check bad arguments.
- function* checkBadSearch(query, pattern, description) {
- let item = yield search(query);
- equal(item.status, "error", "search() failed");
- ok(pattern.test(item.errmsg), `error message for ${description} was correct (${item.errmsg}).`);
- }
-
- yield checkBadSearch("myquery", /Incorrect argument type/, "query is not an object");
- yield checkBadSearch({bogus: "boo"}, /Unexpected property/, "query contains an unknown field");
- yield checkBadSearch({query: "query string"}, /Expected array/, "query.query is a string");
- yield checkBadSearch({startedBefore: "i am not a time"}, /Type error/, "query.startedBefore is not a valid time");
- yield checkBadSearch({startedAfter: "i am not a time"}, /Type error/, "query.startedAfter is not a valid time");
- yield checkBadSearch({endedBefore: "i am not a time"}, /Type error/, "query.endedBefore is not a valid time");
- yield checkBadSearch({endedAfter: "i am not a time"}, /Type error/, "query.endedAfter is not a valid time");
- yield checkBadSearch({urlRegex: "["}, /Invalid urlRegex/, "query.urlRegexp is not a valid regular expression");
- yield checkBadSearch({filenameRegex: "["}, /Invalid filenameRegex/, "query.filenameRegexp is not a valid regular expression");
- yield checkBadSearch({orderBy: "startTime"}, /Expected array/, "query.orderBy is not an array");
- yield checkBadSearch({orderBy: ["bogus"]}, /Invalid orderBy field/, "query.orderBy references a non-existent field");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_experiments.js b/toolkit/components/webextensions/test/xpcshell/test_ext_experiments.js
deleted file mode 100644
index bc6bfcd68b..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_experiments.js
+++ /dev/null
@@ -1,175 +0,0 @@
-"use strict";
-
-/* globals browser */
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-
-function promiseAddonStartup() {
- const {Management} = Cu.import("resource://gre/modules/Extension.jsm");
-
- return new Promise(resolve => {
- let listener = (evt, extension) => {
- Management.off("startup", listener);
- resolve(extension);
- };
-
- Management.on("startup", listener);
- });
-}
-
-add_task(function* setup() {
- yield ExtensionTestUtils.startAddonManager();
-});
-
-add_task(function* test_experiments_api() {
- let apiAddonFile = Extension.generateZipFile({
- "install.rdf": `<?xml version="1.0" encoding="UTF-8"?>
- <RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest"
- em:id="meh@experiments.addons.mozilla.org"
- em:name="Meh Experiment"
- em:type="256"
- em:version="0.1"
- em:description="Meh experiment"
- em:creator="Mozilla">
-
- <em:targetApplication>
- <Description
- em:id="xpcshell@tests.mozilla.org"
- em:minVersion="48"
- em:maxVersion="*"/>
- </em:targetApplication>
- </Description>
- </RDF>
- `,
-
- "api.js": String.raw`
- Components.utils.import("resource://gre/modules/Services.jsm");
-
- Services.obs.notifyObservers(null, "webext-api-loaded", "");
-
- class API extends ExtensionAPI {
- getAPI(context) {
- return {
- meh: {
- hello(text) {
- Services.obs.notifyObservers(null, "webext-api-hello", text);
- }
- }
- }
- }
- }
- `,
-
- "schema.json": [
- {
- "namespace": "meh",
- "description": "All full of meh.",
- "permissions": ["experiments.meh"],
- "functions": [
- {
- "name": "hello",
- "type": "function",
- "description": "Hates you. This is all.",
- "parameters": [
- {"type": "string", "name": "text"},
- ],
- },
- ],
- },
- ],
- });
-
- let addonFile = Extension.generateXPI({
- manifest: {
- applications: {gecko: {id: "meh@web.extension"}},
- permissions: ["experiments.meh"],
- },
-
- background() {
- // The test code below checks that hello() is called at the right
- // time with the string "Here I am". Verify that the api schema is
- // being correctly interpreted by calling hello() with bad arguments
- // and only calling hello() with the magic string if the call with
- // bad arguments throws.
- try {
- browser.meh.hello("I should not see this", "since two arguments are bad");
- } catch (err) {
- browser.meh.hello("Here I am");
- }
- },
- });
-
- let boringAddonFile = Extension.generateXPI({
- manifest: {
- applications: {gecko: {id: "boring@web.extension"}},
- },
- background() {
- if (browser.meh) {
- browser.meh.hello("Here I should not be");
- }
- },
- });
-
- do_register_cleanup(() => {
- for (let file of [apiAddonFile, addonFile, boringAddonFile]) {
- Services.obs.notifyObservers(file, "flush-cache-entry", null);
- file.remove(false);
- }
- });
-
-
- let resolveHello;
- let observer = (subject, topic, data) => {
- if (topic == "webext-api-loaded") {
- ok(!!resolveHello, "Should not see API loaded until dependent extension loads");
- } else if (topic == "webext-api-hello") {
- resolveHello(data);
- }
- };
-
- Services.obs.addObserver(observer, "webext-api-loaded", false);
- Services.obs.addObserver(observer, "webext-api-hello", false);
- do_register_cleanup(() => {
- Services.obs.removeObserver(observer, "webext-api-loaded");
- Services.obs.removeObserver(observer, "webext-api-hello");
- });
-
-
- // Install API add-on.
- let apiAddon = yield AddonManager.installTemporaryAddon(apiAddonFile);
-
- let {APIs} = Cu.import("resource://gre/modules/ExtensionManagement.jsm", {});
- ok(APIs.apis.has("meh"), "Should have meh API.");
-
-
- // Install boring WebExtension add-on.
- let boringAddon = yield AddonManager.installTemporaryAddon(boringAddonFile);
- yield promiseAddonStartup();
-
-
- // Install interesting WebExtension add-on.
- let promise = new Promise(resolve => {
- resolveHello = resolve;
- });
-
- let addon = yield AddonManager.installTemporaryAddon(addonFile);
- yield promiseAddonStartup();
-
- let hello = yield promise;
- equal(hello, "Here I am", "Should get hello from add-on");
-
- // Cleanup.
- apiAddon.uninstall();
-
- boringAddon.userDisabled = true;
- yield new Promise(do_execute_soon);
-
- equal(addon.appDisabled, true, "Add-on should be app-disabled after its dependency is removed.");
-
- addon.uninstall();
- boringAddon.uninstall();
-});
-
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_extension.js b/toolkit/components/webextensions/test/xpcshell/test_ext_extension.js
deleted file mode 100644
index f18845f6a4..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_extension.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_is_allowed_incognito_access() {
- async function background() {
- let allowed = await browser.extension.isAllowedIncognitoAccess();
-
- browser.test.assertEq(true, allowed, "isAllowedIncognitoAccess is true");
- browser.test.notifyPass("isAllowedIncognitoAccess");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {},
- });
-
- yield extension.startup();
- yield extension.awaitFinish("isAllowedIncognitoAccess");
- yield extension.unload();
-});
-
-add_task(function* test_in_incognito_context_false() {
- function background() {
- browser.test.assertEq(false, browser.extension.inIncognitoContext, "inIncognitoContext returned false");
- browser.test.notifyPass("inIncognitoContext");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {},
- });
-
- yield extension.startup();
- yield extension.awaitFinish("inIncognitoContext");
- yield extension.unload();
-});
-
-add_task(function* test_is_allowed_file_scheme_access() {
- async function background() {
- let allowed = await browser.extension.isAllowedFileSchemeAccess();
-
- browser.test.assertEq(false, allowed, "isAllowedFileSchemeAccess is false");
- browser.test.notifyPass("isAllowedFileSchemeAccess");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {},
- });
-
- yield extension.startup();
- yield extension.awaitFinish("isAllowedFileSchemeAccess");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_idle.js b/toolkit/components/webextensions/test/xpcshell/test_ext_idle.js
deleted file mode 100644
index 89bcac2172..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_idle.js
+++ /dev/null
@@ -1,202 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://testing-common/MockRegistrar.jsm");
-
-let idleService = {
- _observers: new Set(),
- _activity: {
- addCalls: [],
- removeCalls: [],
- observerFires: [],
- },
- _reset: function() {
- this._observers.clear();
- this._activity.addCalls = [];
- this._activity.removeCalls = [];
- this._activity.observerFires = [];
- },
- _fireObservers: function(state) {
- for (let observer of this._observers.values()) {
- observer.observe(observer, state, null);
- this._activity.observerFires.push(state);
- }
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIIdleService]),
- idleTime: 19999,
- addIdleObserver: function(observer, time) {
- this._observers.add(observer);
- this._activity.addCalls.push(time);
- },
- removeIdleObserver: function(observer, time) {
- this._observers.delete(observer);
- this._activity.removeCalls.push(time);
- },
-};
-
-function checkActivity(expectedActivity) {
- let {expectedAdd, expectedRemove, expectedFires} = expectedActivity;
- let {addCalls, removeCalls, observerFires} = idleService._activity;
- equal(expectedAdd.length, addCalls.length, "idleService.addIdleObserver was called the expected number of times");
- equal(expectedRemove.length, removeCalls.length, "idleService.removeIdleObserver was called the expected number of times");
- equal(expectedFires.length, observerFires.length, "idle observer was fired the expected number of times");
- deepEqual(addCalls, expectedAdd, "expected interval passed to idleService.addIdleObserver");
- deepEqual(removeCalls, expectedRemove, "expected interval passed to idleService.removeIdleObserver");
- deepEqual(observerFires, expectedFires, "expected topic passed to idle observer");
-}
-
-add_task(function* setup() {
- let fakeIdleService = MockRegistrar.register("@mozilla.org/widget/idleservice;1", idleService);
- do_register_cleanup(() => {
- MockRegistrar.unregister(fakeIdleService);
- });
-});
-
-add_task(function* testQueryStateActive() {
- function background() {
- browser.idle.queryState(20).then(status => {
- browser.test.assertEq("active", status, "Idle status is active");
- browser.test.notifyPass("idle");
- },
- err => {
- browser.test.fail(`Error: ${err} :: ${err.stack}`);
- browser.test.notifyFail("idle");
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("idle");
- yield extension.unload();
-});
-
-add_task(function* testQueryStateIdle() {
- function background() {
- browser.idle.queryState(15).then(status => {
- browser.test.assertEq("idle", status, "Idle status is idle");
- browser.test.notifyPass("idle");
- },
- err => {
- browser.test.fail(`Error: ${err} :: ${err.stack}`);
- browser.test.notifyFail("idle");
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("idle");
- yield extension.unload();
-});
-
-add_task(function* testOnlySetDetectionInterval() {
- function background() {
- browser.idle.setDetectionInterval(99);
- browser.test.sendMessage("detectionIntervalSet");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- idleService._reset();
- yield extension.startup();
- yield extension.awaitMessage("detectionIntervalSet");
- idleService._fireObservers("idle");
- checkActivity({expectedAdd: [], expectedRemove: [], expectedFires: []});
- yield extension.unload();
-});
-
-add_task(function* testSetDetectionIntervalBeforeAddingListener() {
- function background() {
- browser.idle.setDetectionInterval(99);
- browser.idle.onStateChanged.addListener(newState => {
- browser.test.assertEq("idle", newState, "listener fired with the expected state");
- browser.test.sendMessage("listenerFired");
- });
- browser.test.sendMessage("listenerAdded");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- idleService._reset();
- yield extension.startup();
- yield extension.awaitMessage("listenerAdded");
- idleService._fireObservers("idle");
- yield extension.awaitMessage("listenerFired");
- checkActivity({expectedAdd: [99], expectedRemove: [], expectedFires: ["idle"]});
- yield extension.unload();
-});
-
-add_task(function* testSetDetectionIntervalAfterAddingListener() {
- function background() {
- browser.idle.onStateChanged.addListener(newState => {
- browser.test.assertEq("idle", newState, "listener fired with the expected state");
- browser.test.sendMessage("listenerFired");
- });
- browser.idle.setDetectionInterval(99);
- browser.test.sendMessage("detectionIntervalSet");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- idleService._reset();
- yield extension.startup();
- yield extension.awaitMessage("detectionIntervalSet");
- idleService._fireObservers("idle");
- yield extension.awaitMessage("listenerFired");
- checkActivity({expectedAdd: [60, 99], expectedRemove: [60], expectedFires: ["idle"]});
- yield extension.unload();
-});
-
-add_task(function* testOnlyAddingListener() {
- function background() {
- browser.idle.onStateChanged.addListener(newState => {
- browser.test.assertEq("active", newState, "listener fired with the expected state");
- browser.test.sendMessage("listenerFired");
- });
- browser.test.sendMessage("listenerAdded");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["idle"],
- },
- });
-
- idleService._reset();
- yield extension.startup();
- yield extension.awaitMessage("listenerAdded");
- idleService._fireObservers("active");
- yield extension.awaitMessage("listenerFired");
- // check that "idle-daily" topic does not cause a listener to fire
- idleService._fireObservers("idle-daily");
- checkActivity({expectedAdd: [60], expectedRemove: [], expectedFires: ["active", "idle-daily"]});
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_json_parser.js b/toolkit/components/webextensions/test/xpcshell/test_ext_json_parser.js
deleted file mode 100644
index 652f413156..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_json_parser.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_json_parser() {
- const ID = "json@test.web.extension";
-
- let xpi = Extension.generateXPI({
- files: {
- "manifest.json": String.raw`{
- // This is a manifest.
- "applications": {"gecko": {"id": "${ID}"}},
- "name": "This \" is // not a comment",
- "version": "0.1\\" // , "description": "This is not a description"
- }`,
- },
- });
-
- let expectedManifest = {
- "applications": {"gecko": {"id": ID}},
- "name": "This \" is // not a comment",
- "version": "0.1\\",
- };
-
- let fileURI = Services.io.newFileURI(xpi);
- let uri = NetUtil.newURI(`jar:${fileURI.spec}!/`);
-
- let extension = new ExtensionData(uri);
-
- yield extension.readManifest();
-
- Assert.deepEqual(extension.rawManifest, expectedManifest,
- "Manifest with correctly-filtered comments");
-
- Services.obs.notifyObservers(xpi, "flush-cache-entry", null);
- xpi.remove(false);
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_context.js b/toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_context.js
deleted file mode 100644
index 7708514724..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_context.js
+++ /dev/null
@@ -1,168 +0,0 @@
-"use strict";
-
-/* globals browser */
-
-Cu.import("resource://gre/modules/Extension.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const {LegacyExtensionContext} = Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm");
-
-/**
- * This test case ensures that LegacyExtensionContext instances:
- * - expose the expected API object and can join the messaging
- * of a webextension given its addon id
- * - the exposed API object can receive a port related to a `runtime.connect`
- * Port created in the webextension's background page
- * - the received Port instance can exchange messages with the background page
- * - the received Port receive a disconnect event when the webextension is
- * shutting down
- */
-add_task(function* test_legacy_extension_context() {
- function background() {
- let bgURL = window.location.href;
-
- let extensionInfo = {
- bgURL,
- // Extract the assigned uuid from the background page url.
- uuid: window.location.hostname,
- };
-
- browser.test.sendMessage("webextension-ready", extensionInfo);
-
- let port;
-
- browser.test.onMessage.addListener(async msg => {
- if (msg == "do-send-message") {
- let reply = await browser.runtime.sendMessage("webextension -> legacy_extension message");
-
- browser.test.assertEq("legacy_extension -> webextension reply", reply,
- "Got the expected message from the LegacyExtensionContext");
- browser.test.sendMessage("got-reply-message");
- } else if (msg == "do-connect") {
- port = browser.runtime.connect();
-
- port.onMessage.addListener(portMsg => {
- browser.test.assertEq("legacy_extension -> webextension port message", portMsg,
- "Got the expected message from the LegacyExtensionContext");
- port.postMessage("webextension -> legacy_extension port message");
- });
- } else if (msg == "do-disconnect") {
- port.disconnect();
- }
- });
- }
-
- let extensionData = {
- background,
- };
-
- let extension = Extension.generate(extensionData);
-
- let waitForExtensionInfo = new Promise((resolve, reject) => {
- extension.on("test-message", function testMessageListener(kind, msg, ...args) {
- if (msg != "webextension-ready") {
- reject(new Error(`Got an unexpected test-message: ${msg}`));
- } else {
- extension.off("test-message", testMessageListener);
- resolve(args[0]);
- }
- });
- });
-
- // Connect to the target extension as an external context
- // using the given custom sender info.
- let legacyContext;
-
- extension.on("startup", function onStartup() {
- extension.off("startup", onStartup);
- legacyContext = new LegacyExtensionContext(extension);
- extension.callOnClose({
- close: () => legacyContext.unload(),
- });
- });
-
- yield extension.startup();
-
- let extensionInfo = yield waitForExtensionInfo;
-
- equal(legacyContext.envType, "legacy_extension",
- "LegacyExtensionContext instance has the expected type");
-
- ok(legacyContext.api, "Got the expected API object");
- ok(legacyContext.api.browser, "Got the expected browser property");
-
- let waitMessage = new Promise(resolve => {
- const {browser} = legacyContext.api;
- browser.runtime.onMessage.addListener((singleMsg, msgSender) => {
- resolve({singleMsg, msgSender});
-
- // Send a reply to the sender.
- return Promise.resolve("legacy_extension -> webextension reply");
- });
- });
-
- extension.testMessage("do-send-message");
-
- let {singleMsg, msgSender} = yield waitMessage;
- equal(singleMsg, "webextension -> legacy_extension message",
- "Got the expected message");
- ok(msgSender, "Got a message sender object");
-
- equal(msgSender.id, extension.id, "The sender has the expected id property");
- equal(msgSender.url, extensionInfo.bgURL, "The sender has the expected url property");
-
- // Wait confirmation that the reply has been received.
- yield new Promise((resolve, reject) => {
- extension.on("test-message", function testMessageListener(kind, msg, ...args) {
- if (msg != "got-reply-message") {
- reject(new Error(`Got an unexpected test-message: ${msg}`));
- } else {
- extension.off("test-message", testMessageListener);
- resolve();
- }
- });
- });
-
- let waitConnectPort = new Promise(resolve => {
- let {browser} = legacyContext.api;
- browser.runtime.onConnect.addListener(port => {
- resolve(port);
- });
- });
-
- extension.testMessage("do-connect");
-
- let port = yield waitConnectPort;
-
- ok(port, "Got the Port API object");
- ok(port.sender, "The port has a sender property");
- equal(port.sender.id, extension.id,
- "The port sender has the expected id property");
- equal(port.sender.url, extensionInfo.bgURL,
- "The port sender has the expected url property");
-
- let waitPortMessage = new Promise(resolve => {
- port.onMessage.addListener((msg) => {
- resolve(msg);
- });
- });
-
- port.postMessage("legacy_extension -> webextension port message");
-
- let msg = yield waitPortMessage;
-
- equal(msg, "webextension -> legacy_extension port message",
- "LegacyExtensionContext received the expected message from the webextension");
-
- let waitForDisconnect = new Promise(resolve => {
- port.onDisconnect.addListener(resolve);
- });
-
- extension.testMessage("do-disconnect");
-
- yield waitForDisconnect;
-
- do_print("Got the disconnect event on unload");
-
- yield extension.shutdown();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_embedding.js b/toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_embedding.js
deleted file mode 100644
index ea5d785240..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_legacy_extension_embedding.js
+++ /dev/null
@@ -1,188 +0,0 @@
-"use strict";
-
-/* globals browser */
-
-Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm");
-
-// Import EmbeddedExtensionManager to be able to check that the
-// tacked instances are cleared after the embedded extension shutdown.
-const {
- EmbeddedExtensionManager,
-} = Cu.import("resource://gre/modules/LegacyExtensionsUtils.jsm", {});
-
-/**
- * This test case ensures that the LegacyExtensionsUtils.EmbeddedExtension:
- * - load the embedded webextension resources from a "/webextension/" dir
- * inside the XPI.
- * - EmbeddedExtension.prototype.api returns an API object which exposes
- * a working `runtime.onConnect` event object (e.g. the API can receive a port
- * when the embedded webextension is started and it can exchange messages
- * with the background page).
- * - EmbeddedExtension.prototype.startup/shutdown methods manage the embedded
- * webextension lifecycle as expected.
- */
-add_task(function* test_embedded_webextension_utils() {
- function backgroundScript() {
- let port = browser.runtime.connect();
-
- port.onMessage.addListener((msg) => {
- if (msg == "legacy_extension -> webextension") {
- port.postMessage("webextension -> legacy_extension");
- port.disconnect();
- }
- });
- }
-
- const id = "@test.embedded.web.extension";
-
- // Extensions.generateXPI is used here (and in the other hybrid addons tests in this same
- // test dir) to be able to generate an xpi with the directory layout that we expect from
- // an hybrid legacy+webextension addon (where all the embedded webextension resources are
- // loaded from a 'webextension/' directory).
- let fakeHybridAddonFile = Extension.generateZipFile({
- "webextension/manifest.json": {
- applications: {gecko: {id}},
- name: "embedded webextension name",
- manifest_version: 2,
- version: "1.0",
- background: {
- scripts: ["bg.js"],
- },
- },
- "webextension/bg.js": `new ${backgroundScript}`,
- });
-
- // Remove the generated xpi file and flush the its jar cache
- // on cleanup.
- do_register_cleanup(() => {
- Services.obs.notifyObservers(fakeHybridAddonFile, "flush-cache-entry", null);
- fakeHybridAddonFile.remove(false);
- });
-
- let fileURI = Services.io.newFileURI(fakeHybridAddonFile);
- let resourceURI = Services.io.newURI(`jar:${fileURI.spec}!/`, null, null);
-
- let embeddedExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor({
- id, resourceURI,
- });
-
- ok(embeddedExtension, "Got the embeddedExtension object");
-
- equal(EmbeddedExtensionManager.embeddedExtensionsByAddonId.size, 1,
- "Got the expected number of tracked embedded extension instances");
-
- do_print("waiting embeddedExtension.startup");
- let embeddedExtensionAPI = yield embeddedExtension.startup();
- ok(embeddedExtensionAPI, "Got the embeddedExtensionAPI object");
-
- let waitConnectPort = new Promise(resolve => {
- let {browser} = embeddedExtensionAPI;
- browser.runtime.onConnect.addListener(port => {
- resolve(port);
- });
- });
-
- let port = yield waitConnectPort;
-
- ok(port, "Got the Port API object");
-
- let waitPortMessage = new Promise(resolve => {
- port.onMessage.addListener((msg) => {
- resolve(msg);
- });
- });
-
- port.postMessage("legacy_extension -> webextension");
-
- let msg = yield waitPortMessage;
-
- equal(msg, "webextension -> legacy_extension",
- "LegacyExtensionContext received the expected message from the webextension");
-
- let waitForDisconnect = new Promise(resolve => {
- port.onDisconnect.addListener(resolve);
- });
-
- do_print("Wait for the disconnect port event");
- yield waitForDisconnect;
- do_print("Got the disconnect port event");
-
- yield embeddedExtension.shutdown();
-
- equal(EmbeddedExtensionManager.embeddedExtensionsByAddonId.size, 0,
- "EmbeddedExtension instances has been untracked from the EmbeddedExtensionManager");
-});
-
-function* createManifestErrorTestCase(id, xpi, expectedError) {
- // Remove the generated xpi file and flush the its jar cache
- // on cleanup.
- do_register_cleanup(() => {
- Services.obs.notifyObservers(xpi, "flush-cache-entry", null);
- xpi.remove(false);
- });
-
- let fileURI = Services.io.newFileURI(xpi);
- let resourceURI = Services.io.newURI(`jar:${fileURI.spec}!/`, null, null);
-
- let embeddedExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor({
- id, resourceURI,
- });
-
- yield Assert.rejects(embeddedExtension.startup(), expectedError,
- "embedded extension startup rejected");
-
- // Shutdown a "never-started" addon with an embedded webextension should not
- // raise any exception, and if it does this test will fail.
- yield embeddedExtension.shutdown();
-}
-
-add_task(function* test_startup_error_empty_manifest() {
- const id = "empty-manifest@test.embedded.web.extension";
- const files = {
- "webextension/manifest.json": ``,
- };
- const expectedError = "(NS_BASE_STREAM_CLOSED)";
-
- let fakeHybridAddonFile = Extension.generateZipFile(files);
-
- yield createManifestErrorTestCase(id, fakeHybridAddonFile, expectedError);
-});
-
-add_task(function* test_startup_error_invalid_json_manifest() {
- const id = "invalid-json-manifest@test.embedded.web.extension";
- const files = {
- "webextension/manifest.json": `{ "name": }`,
- };
- const expectedError = "JSON.parse:";
-
- let fakeHybridAddonFile = Extension.generateZipFile(files);
-
- yield createManifestErrorTestCase(id, fakeHybridAddonFile, expectedError);
-});
-
-add_task(function* test_startup_error_blocking_validation_errors() {
- const id = "blocking-manifest-validation-error@test.embedded.web.extension";
- const files = {
- "webextension/manifest.json": {
- name: "embedded webextension name",
- manifest_version: 2,
- version: "1.0",
- background: {
- scripts: {},
- },
- },
- };
-
- function expectedError(actual) {
- if (actual.errors && actual.errors.length == 1 &&
- actual.errors[0].startsWith("Reading manifest:")) {
- return true;
- }
-
- return false;
- }
-
- let fakeHybridAddonFile = Extension.generateZipFile(files);
-
- yield createManifestErrorTestCase(id, fakeHybridAddonFile, expectedError);
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_localStorage.js b/toolkit/components/webextensions/test/xpcshell/test_ext_localStorage.js
deleted file mode 100644
index 0f0b410854..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_localStorage.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
- let hasRun = localStorage.getItem("has-run");
- let result;
- if (!hasRun) {
- localStorage.setItem("has-run", "yup");
- localStorage.setItem("test-item", "item1");
- result = "item1";
- } else {
- let data = localStorage.getItem("test-item");
- if (data == "item1") {
- localStorage.setItem("test-item", "item2");
- result = "item2";
- } else if (data == "item2") {
- localStorage.removeItem("test-item");
- result = "deleted";
- } else if (!data) {
- localStorage.clear();
- result = "cleared";
- }
- }
- browser.test.sendMessage("result", result);
- browser.test.notifyPass("localStorage");
-}
-
-const ID = "test-webextension@mozilla.com";
-let extensionData = {
- manifest: {applications: {gecko: {id: ID}}},
- background: backgroundScript,
-};
-
-add_task(function* test_localStorage() {
- const RESULTS = ["item1", "item2", "deleted", "cleared", "item1"];
-
- for (let expected of RESULTS) {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
-
- let actual = yield extension.awaitMessage("result");
-
- yield extension.awaitFinish("localStorage");
- yield extension.unload();
-
- equal(actual, expected, "got expected localStorage data");
- }
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_management.js b/toolkit/components/webextensions/test/xpcshell/test_ext_management.js
deleted file mode 100644
index b19554a57e..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_management.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_management_schema() {
- function background() {
- browser.test.assertTrue(browser.management, "browser.management API exists");
- browser.test.notifyPass("management-schema");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["management"],
- },
- background: `(${background})()`,
- });
- yield extension.startup();
- yield extension.awaitFinish("management-schema");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_management_uninstall_self.js b/toolkit/components/webextensions/test/xpcshell/test_ext_management_uninstall_self.js
deleted file mode 100644
index 7d80a9c239..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_management_uninstall_self.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://testing-common/AddonTestUtils.jsm");
-Cu.import("resource://testing-common/MockRegistrar.jsm");
-
-const {promiseAddonByID} = AddonTestUtils;
-const id = "uninstall_self_test@tests.mozilla.com";
-
-const manifest = {
- applications: {
- gecko: {
- id,
- },
- },
- name: "test extension name",
- version: "1.0",
-};
-
-const waitForUninstalled = () => new Promise(resolve => {
- const listener = {
- onUninstalled: (addon) => {
- equal(addon.id, id, "The expected add-on has been uninstalled");
- AddonManager.getAddonByID(addon.id, checkedAddon => {
- equal(checkedAddon, null, "Add-on no longer exists");
- AddonManager.removeAddonListener(listener);
- resolve();
- });
- },
- };
- AddonManager.addAddonListener(listener);
-});
-
-let promptService = {
- _response: null,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPromptService]),
- confirmEx: function(...args) {
- this._confirmExArgs = args;
- return this._response;
- },
-};
-
-add_task(function* setup() {
- let fakePromptService = MockRegistrar.register("@mozilla.org/embedcomp/prompt-service;1", promptService);
- do_register_cleanup(() => {
- MockRegistrar.unregister(fakePromptService);
- });
- yield ExtensionTestUtils.startAddonManager();
-});
-
-add_task(function* test_management_uninstall_no_prompt() {
- function background() {
- browser.test.onMessage.addListener(msg => {
- browser.management.uninstallSelf();
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest,
- background,
- useAddonManager: "temporary",
- });
-
- yield extension.startup();
- let addon = yield promiseAddonByID(id);
- notEqual(addon, null, "Add-on is installed");
- extension.sendMessage("uninstall");
- yield waitForUninstalled();
- yield extension.markUnloaded();
- Services.obs.notifyObservers(extension.extension.file, "flush-cache-entry", null);
-});
-
-add_task(function* test_management_uninstall_prompt_uninstall() {
- promptService._response = 0;
-
- function background() {
- browser.test.onMessage.addListener(msg => {
- browser.management.uninstallSelf({showConfirmDialog: true});
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest,
- background,
- useAddonManager: "temporary",
- });
-
- yield extension.startup();
- let addon = yield promiseAddonByID(id);
- notEqual(addon, null, "Add-on is installed");
- extension.sendMessage("uninstall");
- yield waitForUninstalled();
- yield extension.markUnloaded();
-
- // Test localization strings
- equal(promptService._confirmExArgs[1], `Uninstall ${manifest.name}`);
- equal(promptService._confirmExArgs[2],
- `The extension “${manifest.name}†is requesting to be uninstalled. What would you like to do?`);
- equal(promptService._confirmExArgs[4], "Uninstall");
- equal(promptService._confirmExArgs[5], "Keep Installed");
- Services.obs.notifyObservers(extension.extension.file, "flush-cache-entry", null);
-});
-
-add_task(function* test_management_uninstall_prompt_keep() {
- promptService._response = 1;
-
- function background() {
- browser.test.onMessage.addListener(async msg => {
- await browser.test.assertRejects(
- browser.management.uninstallSelf({showConfirmDialog: true}),
- "User cancelled uninstall of extension",
- "Expected rejection when user declines uninstall");
-
- browser.test.sendMessage("uninstall-rejected");
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest,
- background,
- useAddonManager: "temporary",
- });
-
- yield extension.startup();
- let addon = yield promiseAddonByID(id);
- notEqual(addon, null, "Add-on is installed");
- extension.sendMessage("uninstall");
- yield extension.awaitMessage("uninstall-rejected");
- addon = yield promiseAddonByID(id);
- notEqual(addon, null, "Add-on remains installed");
- yield extension.unload();
- Services.obs.notifyObservers(extension.extension.file, "flush-cache-entry", null);
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_content_security_policy.js b/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_content_security_policy.js
deleted file mode 100644
index 2b0084980c..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_content_security_policy.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-
-add_task(function* test_manifest_csp() {
- let normalized = yield ExtensionTestUtils.normalizeManifest({
- "content_security_policy": "script-src 'self'; object-src 'none'",
- });
-
- equal(normalized.error, undefined, "Should not have an error");
- equal(normalized.errors.length, 0, "Should not have warnings");
- equal(normalized.value.content_security_policy,
- "script-src 'self'; object-src 'none'",
- "Should have the expected poilcy string");
-
-
- normalized = yield ExtensionTestUtils.normalizeManifest({
- "content_security_policy": "object-src 'none'",
- });
-
- equal(normalized.error, undefined, "Should not have an error");
-
- Assert.deepEqual(normalized.errors,
- ["Error processing content_security_policy: SyntaxError: Policy is missing a required \u2018script-src\u2019 directive"],
- "Should have the expected warning");
-
- equal(normalized.value.content_security_policy, null,
- "Invalid policy string should be omitted");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_incognito.js b/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_incognito.js
deleted file mode 100644
index 94649692e9..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_incognito.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-
-add_task(function* test_manifest_incognito() {
- let normalized = yield ExtensionTestUtils.normalizeManifest({
- "incognito": "spanning",
- });
-
- equal(normalized.error, undefined, "Should not have an error");
- equal(normalized.errors.length, 0, "Should not have warnings");
- equal(normalized.value.incognito,
- "spanning",
- "Should have the expected incognito string");
-
- normalized = yield ExtensionTestUtils.normalizeManifest({
- "incognito": "split",
- });
-
- equal(normalized.error, undefined, "Should not have an error");
- Assert.deepEqual(normalized.errors,
- ['Error processing incognito: Invalid enumeration value "split"'],
- "Should have the expected warning");
- equal(normalized.value.incognito, null,
- "Invalid incognito string should be omitted");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_minimum_chrome_version.js b/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_minimum_chrome_version.js
deleted file mode 100644
index fad5661bba..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_manifest_minimum_chrome_version.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-
-add_task(function* test_manifest_minimum_chrome_version() {
- let normalized = yield ExtensionTestUtils.normalizeManifest({
- "minimum_chrome_version": "42",
- });
-
- equal(normalized.error, undefined, "Should not have an error");
- equal(normalized.errors.length, 0, "Should not have warnings");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging.js b/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging.js
deleted file mode 100644
index 5a6b628f5c..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging.js
+++ /dev/null
@@ -1,514 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-/* globals chrome */
-
-const PREF_MAX_READ = "webextensions.native-messaging.max-input-message-bytes";
-const PREF_MAX_WRITE = "webextensions.native-messaging.max-output-message-bytes";
-
-const ECHO_BODY = String.raw`
- import struct
- import sys
-
- while True:
- rawlen = sys.stdin.read(4)
- if len(rawlen) == 0:
- sys.exit(0)
- msglen = struct.unpack('@I', rawlen)[0]
- msg = sys.stdin.read(msglen)
-
- sys.stdout.write(struct.pack('@I', msglen))
- sys.stdout.write(msg)
-`;
-
-const INFO_BODY = String.raw`
- import json
- import os
- import struct
- import sys
-
- msg = json.dumps({"args": sys.argv, "cwd": os.getcwd()})
- sys.stdout.write(struct.pack('@I', len(msg)))
- sys.stdout.write(msg)
- sys.exit(0)
-`;
-
-const STDERR_LINES = ["hello stderr", "this should be a separate line"];
-let STDERR_MSG = STDERR_LINES.join("\\n");
-
-const STDERR_BODY = String.raw`
- import sys
- sys.stderr.write("${STDERR_MSG}")
-`;
-
-const SCRIPTS = [
- {
- name: "echo",
- description: "a native app that echoes back messages it receives",
- script: ECHO_BODY.replace(/^ {2}/gm, ""),
- },
- {
- name: "info",
- description: "a native app that gives some info about how it was started",
- script: INFO_BODY.replace(/^ {2}/gm, ""),
- },
- {
- name: "stderr",
- description: "a native app that writes to stderr and then exits",
- script: STDERR_BODY.replace(/^ {2}/gm, ""),
- },
-];
-
-add_task(function* setup() {
- yield setupHosts(SCRIPTS);
-});
-
-// Test the basic operation of native messaging with a simple
-// script that echoes back whatever message is sent to it.
-add_task(function* test_happy_path() {
- function background() {
- let port = browser.runtime.connectNative("echo");
- port.onMessage.addListener(msg => {
- browser.test.sendMessage("message", msg);
- });
- browser.test.onMessage.addListener((what, payload) => {
- if (what == "send") {
- if (payload._json) {
- let json = payload._json;
- payload.toJSON = () => json;
- delete payload._json;
- }
- port.postMessage(payload);
- }
- });
- browser.test.sendMessage("ready");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
- const tests = [
- {
- data: "this is a string",
- what: "simple string",
- },
- {
- data: "Это юникода",
- what: "unicode string",
- },
- {
- data: {test: "hello"},
- what: "simple object",
- },
- {
- data: {
- what: "An object with a few properties",
- number: 123,
- bool: true,
- nested: {what: "another object"},
- },
- what: "object with several properties",
- },
-
- {
- data: {
- ignoreme: true,
- _json: {data: "i have a tojson method"},
- },
- expected: {data: "i have a tojson method"},
- what: "object with toJSON() method",
- },
- ];
- for (let test of tests) {
- extension.sendMessage("send", test.data);
- let response = yield extension.awaitMessage("message");
- let expected = test.expected || test.data;
- deepEqual(response, expected, `Echoed a message of type ${test.what}`);
- }
-
- let procCount = yield getSubprocessCount();
- equal(procCount, 1, "subprocess is still running");
- let exitPromise = waitForSubprocessExit();
- yield extension.unload();
- yield exitPromise;
-});
-
-if (AppConstants.platform == "win") {
- // "relative.echo" has a relative path in the host manifest.
- add_task(function* test_relative_path() {
- function background() {
- let port = browser.runtime.connectNative("relative.echo");
- let MSG = "test relative echo path";
- port.onMessage.addListener(msg => {
- browser.test.assertEq(MSG, msg, "Got expected message back");
- browser.test.sendMessage("done");
- });
- port.postMessage(MSG);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("done");
-
- let procCount = yield getSubprocessCount();
- equal(procCount, 1, "subprocess is still running");
- let exitPromise = waitForSubprocessExit();
- yield extension.unload();
- yield exitPromise;
- });
-}
-
-// Test sendNativeMessage()
-add_task(function* test_sendNativeMessage() {
- async function background() {
- let MSG = {test: "hello world"};
-
- // Check error handling
- await browser.test.assertRejects(
- browser.runtime.sendNativeMessage("nonexistent", MSG),
- /Attempt to postMessage on disconnected port/,
- "sendNativeMessage() to a nonexistent app failed");
-
- // Check regular message exchange
- let reply = await browser.runtime.sendNativeMessage("echo", MSG);
-
- let expected = JSON.stringify(MSG);
- let received = JSON.stringify(reply);
- browser.test.assertEq(expected, received, "Received echoed native message");
-
- browser.test.sendMessage("finished");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("finished");
-
- // With sendNativeMessage(), the subprocess should be disconnected
- // after exchanging a single message.
- yield waitForSubprocessExit();
-
- yield extension.unload();
-});
-
-// Test calling Port.disconnect()
-add_task(function* test_disconnect() {
- function background() {
- let port = browser.runtime.connectNative("echo");
- port.onMessage.addListener((msg, msgPort) => {
- browser.test.assertEq(port, msgPort, "onMessage handler should receive the port as the second argument");
- browser.test.sendMessage("message", msg);
- });
- port.onDisconnect.addListener(msgPort => {
- browser.test.fail("onDisconnect should not be called for disconnect()");
- });
- browser.test.onMessage.addListener((what, payload) => {
- if (what == "send") {
- if (payload._json) {
- let json = payload._json;
- payload.toJSON = () => json;
- delete payload._json;
- }
- port.postMessage(payload);
- } else if (what == "disconnect") {
- try {
- port.disconnect();
- browser.test.sendMessage("disconnect-result", {success: true});
- } catch (err) {
- browser.test.sendMessage("disconnect-result", {
- success: false,
- errmsg: err.message,
- });
- }
- }
- });
- browser.test.sendMessage("ready");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- extension.sendMessage("send", "test");
- let response = yield extension.awaitMessage("message");
- equal(response, "test", "Echoed a string");
-
- let procCount = yield getSubprocessCount();
- equal(procCount, 1, "subprocess is running");
-
- extension.sendMessage("disconnect");
- response = yield extension.awaitMessage("disconnect-result");
- equal(response.success, true, "disconnect succeeded");
-
- do_print("waiting for subprocess to exit");
- yield waitForSubprocessExit();
- procCount = yield getSubprocessCount();
- equal(procCount, 0, "subprocess is no longer running");
-
- extension.sendMessage("disconnect");
- response = yield extension.awaitMessage("disconnect-result");
- equal(response.success, true, "second call to disconnect silently ignored");
-
- yield extension.unload();
-});
-
-// Test the limit on message size for writing
-add_task(function* test_write_limit() {
- Services.prefs.setIntPref(PREF_MAX_WRITE, 10);
- function clearPref() {
- Services.prefs.clearUserPref(PREF_MAX_WRITE);
- }
- do_register_cleanup(clearPref);
-
- function background() {
- const PAYLOAD = "0123456789A";
- let port = browser.runtime.connectNative("echo");
- try {
- port.postMessage(PAYLOAD);
- browser.test.sendMessage("result", null);
- } catch (ex) {
- browser.test.sendMessage("result", ex.message);
- }
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
-
- let errmsg = yield extension.awaitMessage("result");
- notEqual(errmsg, null, "native postMessage() failed for overly large message");
-
- yield extension.unload();
- yield waitForSubprocessExit();
-
- clearPref();
-});
-
-// Test the limit on message size for reading
-add_task(function* test_read_limit() {
- Services.prefs.setIntPref(PREF_MAX_READ, 10);
- function clearPref() {
- Services.prefs.clearUserPref(PREF_MAX_READ);
- }
- do_register_cleanup(clearPref);
-
- function background() {
- const PAYLOAD = "0123456789A";
- let port = browser.runtime.connectNative("echo");
- port.onDisconnect.addListener(msgPort => {
- browser.test.assertEq(port, msgPort, "onDisconnect handler should receive the port as the first argument");
- browser.test.assertEq("Native application tried to send a message of 13 bytes, which exceeds the limit of 10 bytes.", port.error && port.error.message);
- browser.test.sendMessage("result", "disconnected");
- });
- port.onMessage.addListener(msg => {
- browser.test.sendMessage("result", "message");
- });
- port.postMessage(PAYLOAD);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
-
- let result = yield extension.awaitMessage("result");
- equal(result, "disconnected", "native port disconnected on receiving large message");
-
- yield extension.unload();
- yield waitForSubprocessExit();
-
- clearPref();
-});
-
-// Test that an extension without the nativeMessaging permission cannot
-// use native messaging.
-add_task(function* test_ext_permission() {
- function background() {
- browser.test.assertFalse("connectNative" in chrome.runtime, "chrome.runtime.connectNative does not exist without nativeMessaging permission");
- browser.test.assertFalse("connectNative" in browser.runtime, "browser.runtime.connectNative does not exist without nativeMessaging permission");
- browser.test.assertFalse("sendNativeMessage" in chrome.runtime, "chrome.runtime.sendNativeMessage does not exist without nativeMessaging permission");
- browser.test.assertFalse("sendNativeMessage" in browser.runtime, "browser.runtime.sendNativeMessage does not exist without nativeMessaging permission");
- browser.test.sendMessage("finished");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {},
- });
-
- yield extension.startup();
- yield extension.awaitMessage("finished");
- yield extension.unload();
-});
-
-// Test that an extension that is not listed in allowed_extensions for
-// a native application cannot use that application.
-add_task(function* test_app_permission() {
- function background() {
- let port = browser.runtime.connectNative("echo");
- port.onDisconnect.addListener(msgPort => {
- browser.test.assertEq(port, msgPort, "onDisconnect handler should receive the port as the first argument");
- browser.test.assertEq("This extension does not have permission to use native application echo (or the application is not installed)", port.error && port.error.message);
- browser.test.sendMessage("result", "disconnected");
- });
- port.onMessage.addListener(msg => {
- browser.test.sendMessage("result", "message");
- });
- port.postMessage({test: "test"});
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- permissions: ["nativeMessaging"],
- },
- }, "somethingelse@tests.mozilla.org");
-
- yield extension.startup();
-
- let result = yield extension.awaitMessage("result");
- equal(result, "disconnected", "connectNative() failed without native app permission");
-
- yield extension.unload();
-
- let procCount = yield getSubprocessCount();
- equal(procCount, 0, "No child process was started");
-});
-
-// Test that the command-line arguments and working directory for the
-// native application are as expected.
-add_task(function* test_child_process() {
- function background() {
- let port = browser.runtime.connectNative("info");
- port.onMessage.addListener(msg => {
- browser.test.sendMessage("result", msg);
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
-
- let msg = yield extension.awaitMessage("result");
- equal(msg.args.length, 2, "Received one command line argument");
- equal(msg.args[1], getPath("info.json"), "Command line argument is the path to the native host manifest");
- equal(msg.cwd.replace(/^\/private\//, "/"), tmpDir.path,
- "Working directory is the directory containing the native appliation");
-
- let exitPromise = waitForSubprocessExit();
- yield extension.unload();
- yield exitPromise;
-});
-
-add_task(function* test_stderr() {
- function background() {
- let port = browser.runtime.connectNative("stderr");
- port.onDisconnect.addListener(msgPort => {
- browser.test.assertEq(port, msgPort, "onDisconnect handler should receive the port as the first argument");
- browser.test.assertEq(null, port.error, "Normal application exit is not an error");
- browser.test.sendMessage("finished");
- });
- }
-
- let {messages} = yield promiseConsoleOutput(function* () {
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("finished");
- yield extension.unload();
-
- yield waitForSubprocessExit();
- });
-
- let lines = STDERR_LINES.map(line => messages.findIndex(msg => msg.message.includes(line)));
- notEqual(lines[0], -1, "Saw first line of stderr output on the console");
- notEqual(lines[1], -1, "Saw second line of stderr output on the console");
- notEqual(lines[0], lines[1], "Stderr output lines are separated in the console");
-});
-
-// Test that calling connectNative() multiple times works
-// (bug 1313980 was a previous regression in this area)
-add_task(function* test_multiple_connects() {
- async function background() {
- function once() {
- return new Promise(resolve => {
- let MSG = "hello";
- let port = browser.runtime.connectNative("echo");
-
- port.onMessage.addListener(msg => {
- browser.test.assertEq(MSG, msg, "Got expected message back");
- port.disconnect();
- resolve();
- });
- port.postMessage(MSG);
- });
- }
-
- await once();
- await once();
- browser.test.notifyPass("multiple-connect");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("multiple-connect");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_perf.js b/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_perf.js
deleted file mode 100644
index 693f67ddeb..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_perf.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "MockRegistry",
- "resource://testing-common/MockRegistry.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-Cu.import("resource://gre/modules/Subprocess.jsm");
-
-const MAX_ROUND_TRIP_TIME_MS = AppConstants.DEBUG || AppConstants.ASAN ? 36 : 18;
-const MAX_RETRIES = 5;
-
-
-const ECHO_BODY = String.raw`
- import struct
- import sys
-
- while True:
- rawlen = sys.stdin.read(4)
- if len(rawlen) == 0:
- sys.exit(0)
-
- msglen = struct.unpack('@I', rawlen)[0]
- msg = sys.stdin.read(msglen)
-
- sys.stdout.write(struct.pack('@I', msglen))
- sys.stdout.write(msg)
-`;
-
-const SCRIPTS = [
- {
- name: "echo",
- description: "A native app that echoes back messages it receives",
- script: ECHO_BODY.replace(/^ {2}/gm, ""),
- },
-];
-
-add_task(function* setup() {
- yield setupHosts(SCRIPTS);
-});
-
-add_task(function* test_round_trip_perf() {
- let extension = ExtensionTestUtils.loadExtension({
- background() {
- browser.test.onMessage.addListener(msg => {
- if (msg != "run-tests") {
- return;
- }
-
- let port = browser.runtime.connectNative("echo");
-
- function next() {
- port.postMessage({
- "Lorem": {
- "ipsum": {
- "dolor": [
- "sit amet",
- "consectetur adipiscing elit",
- "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
- ],
- "Ut enim": [
- "ad minim veniam",
- "quis nostrud exercitation ullamco",
- "laboris nisi ut aliquip ex ea commodo consequat.",
- ],
- "Duis": [
- "aute irure dolor in reprehenderit in",
- "voluptate velit esse cillum dolore eu",
- "fugiat nulla pariatur.",
- ],
- "Excepteur": [
- "sint occaecat cupidatat non proident",
- "sunt in culpa qui officia deserunt",
- "mollit anim id est laborum.",
- ],
- },
- },
- });
- }
-
- const COUNT = 1000;
- let now;
- function finish() {
- let roundTripTime = (Date.now() - now) / COUNT;
-
- port.disconnect();
- browser.test.sendMessage("result", roundTripTime);
- }
-
- let count = 0;
- port.onMessage.addListener(() => {
- if (count == 0) {
- // Skip the first round, since it includes the time it takes
- // the app to start up.
- now = Date.now();
- }
-
- if (count++ <= COUNT) {
- next();
- } else {
- finish();
- }
- });
-
- next();
- });
- },
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
-
- let roundTripTime = Infinity;
- for (let i = 0; i < MAX_RETRIES && roundTripTime > MAX_ROUND_TRIP_TIME_MS; i++) {
- extension.sendMessage("run-tests");
- roundTripTime = yield extension.awaitMessage("result");
- }
-
- yield extension.unload();
-
- ok(roundTripTime <= MAX_ROUND_TRIP_TIME_MS,
- `Expected round trip time (${roundTripTime}ms) to be less than ${MAX_ROUND_TRIP_TIME_MS}ms`);
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_unresponsive.js b/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_unresponsive.js
deleted file mode 100644
index a75a1d49d1..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_native_messaging_unresponsive.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-const WONTDIE_BODY = String.raw`
- import signal
- import struct
- import sys
- import time
-
- signal.signal(signal.SIGTERM, signal.SIG_IGN)
-
- def spin():
- while True:
- try:
- signal.pause()
- except AttributeError:
- time.sleep(5)
-
- while True:
- rawlen = sys.stdin.read(4)
- if len(rawlen) == 0:
- spin()
-
- msglen = struct.unpack('@I', rawlen)[0]
- msg = sys.stdin.read(msglen)
-
- sys.stdout.write(struct.pack('@I', msglen))
- sys.stdout.write(msg)
-`;
-
-const SCRIPTS = [
- {
- name: "wontdie",
- description: "a native app that does not exit when stdin closes or on SIGTERM",
- script: WONTDIE_BODY.replace(/^ {2}/gm, ""),
- },
-];
-
-add_task(function* setup() {
- yield setupHosts(SCRIPTS);
-});
-
-
-// Test that an unresponsive native application still gets killed eventually
-add_task(function* test_unresponsive_native_app() {
- // XXX expose GRACEFUL_SHUTDOWN_TIME as a pref and reduce it
- // just for this test?
-
- function background() {
- let port = browser.runtime.connectNative("wontdie");
-
- const MSG = "echo me";
- // bounce a message to make sure the process actually starts
- port.onMessage.addListener(msg => {
- browser.test.assertEq(msg, MSG, "Received echoed message");
- browser.test.sendMessage("ready");
- });
- port.postMessage(MSG);
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- manifest: {
- applications: {gecko: {id: ID}},
- permissions: ["nativeMessaging"],
- },
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- let procCount = yield getSubprocessCount();
- equal(procCount, 1, "subprocess is running");
-
- let exitPromise = waitForSubprocessExit();
- yield extension.unload();
- yield exitPromise;
-
- procCount = yield getSubprocessCount();
- equal(procCount, 0, "subprocess was succesfully killed");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_onmessage_removelistener.js b/toolkit/components/webextensions/test/xpcshell/test_ext_onmessage_removelistener.js
deleted file mode 100644
index 6f8b553fc6..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_onmessage_removelistener.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
- function listener() {
- browser.test.notifyFail("listener should not be invoked");
- }
-
- browser.runtime.onMessage.addListener(listener);
- browser.runtime.onMessage.removeListener(listener);
- browser.runtime.sendMessage("hello");
-
- // Make sure that, if we somehow fail to remove the listener, then we'll run
- // the listener before the test is marked as passing.
- setTimeout(function() {
- browser.test.notifyPass("onmessage_removelistener");
- }, 0);
-}
-
-let extensionData = {
- background: backgroundScript,
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitFinish("onmessage_removelistener");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js
deleted file mode 100644
index 2a1342cde8..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_connect_no_receiver.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_connect_without_listener() {
- function background() {
- let port = browser.runtime.connect();
- port.onDisconnect.addListener(() => {
- browser.test.assertEq("Could not establish connection. Receiving end does not exist.", port.error && port.error.message);
- browser.test.notifyPass("port.onDisconnect was called");
- });
- }
- let extensionData = {
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitFinish("port.onDisconnect was called");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getBrowserInfo.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getBrowserInfo.js
deleted file mode 100644
index a280206fa4..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getBrowserInfo.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-add_task(function* setup() {
- ExtensionTestUtils.mockAppInfo();
-});
-
-add_task(function* test_getBrowserInfo() {
- async function background() {
- let info = await browser.runtime.getBrowserInfo();
-
- browser.test.assertEq(info.name, "XPCShell", "name is valid");
- browser.test.assertEq(info.vendor, "Mozilla", "vendor is Mozilla");
- browser.test.assertEq(info.version, "48", "version is correct");
- browser.test.assertEq(info.buildID, "20160315", "buildID is correct");
-
- browser.test.notifyPass("runtime.getBrowserInfo");
- }
-
- const extension = ExtensionTestUtils.loadExtension({background});
- yield extension.startup();
- yield extension.awaitFinish("runtime.getBrowserInfo");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js
deleted file mode 100644
index 29bad0c108..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_getPlatformInfo.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-function backgroundScript() {
- browser.runtime.getPlatformInfo(info => {
- let validOSs = ["mac", "win", "android", "cros", "linux", "openbsd"];
- let validArchs = ["arm", "x86-32", "x86-64"];
-
- browser.test.assertTrue(validOSs.indexOf(info.os) != -1, "OS is valid");
- browser.test.assertTrue(validArchs.indexOf(info.arch) != -1, "Architecture is valid");
- browser.test.notifyPass("runtime.getPlatformInfo");
- });
-}
-
-let extensionData = {
- background: backgroundScript,
-};
-
-add_task(function* test_contentscript() {
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitFinish("runtime.getPlatformInfo");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js
deleted file mode 100644
index fa6461412b..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js
+++ /dev/null
@@ -1,337 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-XPCOMUtils.defineLazyGetter(this, "Management", () => {
- const {Management} = Cu.import("resource://gre/modules/Extension.jsm", {});
- return Management;
-});
-
-const {
- createAppInfo,
- createTempWebExtensionFile,
- promiseAddonByID,
- promiseAddonEvent,
- promiseCompleteAllInstalls,
- promiseFindAddonUpdates,
- promiseRestartManager,
- promiseShutdownManager,
- promiseStartupManager,
-} = AddonTestUtils;
-
-AddonTestUtils.init(this);
-
-// Allow for unsigned addons.
-AddonTestUtils.overrideCertDB();
-
-createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "42");
-
-function awaitEvent(eventName) {
- return new Promise(resolve => {
- let listener = (_eventName, ...args) => {
- if (_eventName === eventName) {
- Management.off(eventName, listener);
- resolve(...args);
- }
- };
-
- Management.on(eventName, listener);
- });
-}
-
-function background() {
- let onInstalledDetails = null;
- let onStartupFired = false;
-
- browser.runtime.onInstalled.addListener(details => {
- onInstalledDetails = details;
- });
-
- browser.runtime.onStartup.addListener(() => {
- onStartupFired = true;
- });
-
- browser.test.onMessage.addListener(message => {
- if (message === "get-on-installed-details") {
- onInstalledDetails = onInstalledDetails || {fired: false};
- browser.test.sendMessage("on-installed-details", onInstalledDetails);
- } else if (message === "did-on-startup-fire") {
- browser.test.sendMessage("on-startup-fired", onStartupFired);
- } else if (message === "reload-extension") {
- browser.runtime.reload();
- }
- });
-
- browser.runtime.onUpdateAvailable.addListener(details => {
- browser.test.sendMessage("reloading");
- browser.runtime.reload();
- });
-}
-
-function* expectEvents(extension, {onStartupFired, onInstalledFired, onInstalledReason}) {
- extension.sendMessage("get-on-installed-details");
- let details = yield extension.awaitMessage("on-installed-details");
- if (onInstalledFired) {
- equal(details.reason, onInstalledReason, "runtime.onInstalled fired with the correct reason");
- } else {
- equal(details.fired, onInstalledFired, "runtime.onInstalled should not have fired");
- }
-
- extension.sendMessage("did-on-startup-fire");
- let fired = yield extension.awaitMessage("on-startup-fired");
- equal(fired, onStartupFired, `Expected runtime.onStartup to ${onStartupFired ? "" : "not "} fire`);
-}
-
-add_task(function* test_should_fire_on_addon_update() {
- const EXTENSION_ID = "test_runtime_on_installed_addon_update@tests.mozilla.org";
-
- const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
-
- // The test extension uses an insecure update url.
- Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, false);
-
- const testServer = createHttpServer();
- const port = testServer.identity.primaryPort;
-
- let extension = ExtensionTestUtils.loadExtension({
- useAddonManager: "permanent",
- manifest: {
- "version": "1.0",
- "applications": {
- "gecko": {
- "id": EXTENSION_ID,
- "update_url": `http://localhost:${port}/test_update.json`,
- },
- },
- },
- background,
- });
-
- testServer.registerPathHandler("/test_update.json", (request, response) => {
- response.write(`{
- "addons": {
- "${EXTENSION_ID}": {
- "updates": [
- {
- "version": "2.0",
- "update_link": "http://localhost:${port}/addons/test_runtime_on_installed-2.0.xpi"
- }
- ]
- }
- }
- }`);
- });
-
- let webExtensionFile = createTempWebExtensionFile({
- manifest: {
- version: "2.0",
- applications: {
- gecko: {
- id: EXTENSION_ID,
- },
- },
- },
- background,
- });
-
- testServer.registerFile("/addons/test_runtime_on_installed-2.0.xpi", webExtensionFile);
-
- yield promiseStartupManager();
-
- yield extension.startup();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: true,
- onInstalledReason: "install",
- });
-
- let addon = yield promiseAddonByID(EXTENSION_ID);
- equal(addon.version, "1.0", "The installed addon has the correct version");
-
- let update = yield promiseFindAddonUpdates(addon);
- let install = update.updateAvailable;
-
- let promiseInstalled = promiseAddonEvent("onInstalled");
- yield promiseCompleteAllInstalls([install]);
-
- yield extension.awaitMessage("reloading");
-
- let startupPromise = awaitEvent("ready");
-
- let [updated_addon] = yield promiseInstalled;
- equal(updated_addon.version, "2.0", "The updated addon has the correct version");
-
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: true,
- onInstalledReason: "update",
- });
-
- yield extension.unload();
-
- yield updated_addon.uninstall();
- yield promiseShutdownManager();
-});
-
-add_task(function* test_should_fire_on_browser_update() {
- const EXTENSION_ID = "test_runtime_on_installed_browser_update@tests.mozilla.org";
-
- yield promiseStartupManager();
-
- let extension = ExtensionTestUtils.loadExtension({
- useAddonManager: "permanent",
- manifest: {
- "version": "1.0",
- "applications": {
- "gecko": {
- "id": EXTENSION_ID,
- },
- },
- },
- background,
- });
-
- yield extension.startup();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: true,
- onInstalledReason: "install",
- });
-
- let startupPromise = awaitEvent("ready");
- yield promiseRestartManager("1");
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: true,
- onInstalledFired: false,
- });
-
- // Update the browser.
- startupPromise = awaitEvent("ready");
- yield promiseRestartManager("2");
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: true,
- onInstalledFired: true,
- onInstalledReason: "browser_update",
- });
-
- // Restart the browser.
- startupPromise = awaitEvent("ready");
- yield promiseRestartManager("2");
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: true,
- onInstalledFired: false,
- });
-
- // Update the browser again.
- startupPromise = awaitEvent("ready");
- yield promiseRestartManager("3");
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: true,
- onInstalledFired: true,
- onInstalledReason: "browser_update",
- });
-
- yield extension.unload();
-
- yield promiseShutdownManager();
-});
-
-add_task(function* test_should_not_fire_on_reload() {
- const EXTENSION_ID = "test_runtime_on_installed_reload@tests.mozilla.org";
-
- yield promiseStartupManager();
-
- let extension = ExtensionTestUtils.loadExtension({
- useAddonManager: "permanent",
- manifest: {
- "version": "1.0",
- "applications": {
- "gecko": {
- "id": EXTENSION_ID,
- },
- },
- },
- background,
- });
-
- yield extension.startup();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: true,
- onInstalledReason: "install",
- });
-
- let startupPromise = awaitEvent("ready");
- extension.sendMessage("reload-extension");
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: false,
- });
-
- yield extension.unload();
- yield promiseShutdownManager();
-});
-
-add_task(function* test_should_not_fire_on_restart() {
- const EXTENSION_ID = "test_runtime_on_installed_restart@tests.mozilla.org";
-
- yield promiseStartupManager();
-
- let extension = ExtensionTestUtils.loadExtension({
- useAddonManager: "permanent",
- manifest: {
- "version": "1.0",
- "applications": {
- "gecko": {
- "id": EXTENSION_ID,
- },
- },
- },
- background,
- });
-
- yield extension.startup();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: true,
- onInstalledReason: "install",
- });
-
- let addon = yield promiseAddonByID(EXTENSION_ID);
- addon.userDisabled = true;
-
- let startupPromise = awaitEvent("ready");
- addon.userDisabled = false;
- extension.extension = yield startupPromise;
- extension.attachListeners();
-
- yield expectEvents(extension, {
- onStartupFired: false,
- onInstalledFired: false,
- });
-
- yield extension.markUnloaded();
- yield promiseShutdownManager();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage.js
deleted file mode 100644
index fec8e13dd6..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* tabsSendMessageReply() {
- function background() {
- browser.runtime.onMessage.addListener((msg, sender, respond) => {
- if (msg == "respond-now") {
- respond(msg);
- } else if (msg == "respond-soon") {
- setTimeout(() => { respond(msg); }, 0);
- return true;
- } else if (msg == "respond-promise") {
- return Promise.resolve(msg);
- } else if (msg == "respond-never") {
- return;
- } else if (msg == "respond-error") {
- return Promise.reject(new Error(msg));
- } else if (msg == "throw-error") {
- throw new Error(msg);
- }
- });
-
- browser.runtime.onMessage.addListener((msg, sender, respond) => {
- if (msg == "respond-now") {
- respond("hello");
- } else if (msg == "respond-now-2") {
- respond(msg);
- }
- });
-
- let childFrame = document.createElement("iframe");
- childFrame.src = "extensionpage.html";
- document.body.appendChild(childFrame);
- }
-
- function senderScript() {
- Promise.all([
- browser.runtime.sendMessage("respond-now"),
- browser.runtime.sendMessage("respond-now-2"),
- new Promise(resolve => browser.runtime.sendMessage("respond-soon", resolve)),
- browser.runtime.sendMessage("respond-promise"),
- browser.runtime.sendMessage("respond-never"),
- new Promise(resolve => {
- browser.runtime.sendMessage("respond-never", response => { resolve(response); });
- }),
-
- browser.runtime.sendMessage("respond-error").catch(error => Promise.resolve({error})),
- browser.runtime.sendMessage("throw-error").catch(error => Promise.resolve({error})),
- ]).then(([respondNow, respondNow2, respondSoon, respondPromise, respondNever, respondNever2, respondError, throwError]) => {
- browser.test.assertEq("respond-now", respondNow, "Got the expected immediate response");
- browser.test.assertEq("respond-now-2", respondNow2, "Got the expected immediate response from the second listener");
- browser.test.assertEq("respond-soon", respondSoon, "Got the expected delayed response");
- browser.test.assertEq("respond-promise", respondPromise, "Got the expected promise response");
- browser.test.assertEq(undefined, respondNever, "Got the expected no-response resolution");
- browser.test.assertEq(undefined, respondNever2, "Got the expected no-response resolution");
-
- browser.test.assertEq("respond-error", respondError.error.message, "Got the expected error response");
- browser.test.assertEq("throw-error", throwError.error.message, "Got the expected thrown error response");
-
- browser.test.notifyPass("sendMessage");
- }).catch(e => {
- browser.test.fail(`Error: ${e} :: ${e.stack}`);
- browser.test.notifyFail("sendMessage");
- });
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- background,
- files: {
- "senderScript.js": senderScript,
- "extensionpage.html": `<!DOCTYPE html><meta charset="utf-8"><script src="senderScript.js"></script>`,
- },
- });
-
- yield extension.startup();
- yield extension.awaitFinish("sendMessage");
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_errors.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_errors.js
deleted file mode 100644
index f1a8d5a368..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_errors.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_sendMessage_error() {
- async function background() {
- let circ = {};
- circ.circ = circ;
- let testCases = [
- // [arguments, expected error string],
- [[], "runtime.sendMessage's message argument is missing"],
- [[null, null, null, null], "runtime.sendMessage's last argument is not a function"],
- [[null, null, 1], "runtime.sendMessage's options argument is invalid"],
- [[1, null, null], "runtime.sendMessage's extensionId argument is invalid"],
- [[null, null, null, null, null], "runtime.sendMessage received too many arguments"],
-
- // Even when the parameters are accepted, we still expect an error
- // because there is no onMessage listener.
- [[null, null, null], "Could not establish connection. Receiving end does not exist."],
-
- // Structural cloning doesn't work with DOM but we fall back
- // JSON serialization, so we don't expect another error.
- [[null, location, null], "Could not establish connection. Receiving end does not exist."],
-
- // Structured cloning supports cyclic self-references.
- [[null, [circ, location], null], "cyclic object value"],
- // JSON serialization does not support cyclic references.
- [[null, circ, null], "Could not establish connection. Receiving end does not exist."],
- // (the last two tests shows whether sendMessage is implemented as structured cloning).
- ];
-
- // Repeat all tests with the undefined value instead of null.
- for (let [args, expectedError] of testCases.slice()) {
- args = args.map(arg => arg === null ? undefined : arg);
- testCases.push([args, expectedError]);
- }
-
- for (let [args, expectedError] of testCases) {
- let description = `runtime.sendMessage(${args.map(String).join(", ")})`;
-
- await browser.test.assertRejects(
- browser.runtime.sendMessage(...args),
- expectedError,
- `expected error message for ${description}`);
- }
-
- browser.test.notifyPass("sendMessage parameter validation");
- }
- let extensionData = {
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitFinish("sendMessage parameter validation");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js
deleted file mode 100644
index f906333d21..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_no_receiver.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_sendMessage_without_listener() {
- async function background() {
- await browser.test.assertRejects(
- browser.runtime.sendMessage("msg"),
- "Could not establish connection. Receiving end does not exist.",
- "sendMessage callback was invoked");
-
- browser.test.notifyPass("sendMessage callback was invoked");
- }
- let extensionData = {
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitFinish("sendMessage callback was invoked");
-
- yield extension.unload();
-});
-
-add_task(function* test_chrome_sendMessage_without_listener() {
- function background() {
- /* globals chrome */
- browser.test.assertEq(null, chrome.runtime.lastError, "no lastError before call");
- let retval = chrome.runtime.sendMessage("msg");
- browser.test.assertEq(null, chrome.runtime.lastError, "no lastError after call");
- browser.test.assertEq(undefined, retval, "return value of chrome.runtime.sendMessage without callback");
-
- let isAsyncCall = false;
- retval = chrome.runtime.sendMessage("msg", reply => {
- browser.test.assertEq(undefined, reply, "no reply");
- browser.test.assertTrue(isAsyncCall, "chrome.runtime.sendMessage's callback must be called asynchronously");
- browser.test.assertEq(undefined, retval, "return value of chrome.runtime.sendMessage with callback");
- browser.test.assertEq("Could not establish connection. Receiving end does not exist.", chrome.runtime.lastError.message);
- browser.test.notifyPass("finished chrome.runtime.sendMessage");
- });
- isAsyncCall = true;
- }
- let extensionData = {
- background,
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitFinish("finished chrome.runtime.sendMessage");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_self.js b/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_self.js
deleted file mode 100644
index e4f5e951f6..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_runtime_sendMessage_self.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-
-"use strict";
-
-add_task(function* test_sendMessage_to_self_should_not_trigger_onMessage() {
- async function background() {
- browser.runtime.onMessage.addListener(msg => {
- browser.test.assertEq("msg from child", msg);
- browser.test.notifyPass("sendMessage did not call same-frame onMessage");
- });
-
- browser.test.onMessage.addListener(msg => {
- browser.test.assertEq("sendMessage with a listener in another frame", msg);
- browser.runtime.sendMessage("should only reach another frame");
- });
-
- await browser.test.assertRejects(
- browser.runtime.sendMessage("should not trigger same-frame onMessage"),
- "Could not establish connection. Receiving end does not exist.");
-
- let anotherFrame = document.createElement("iframe");
- anotherFrame.src = browser.extension.getURL("extensionpage.html");
- document.body.appendChild(anotherFrame);
- }
-
- function lastScript() {
- browser.runtime.onMessage.addListener(msg => {
- browser.test.assertEq("should only reach another frame", msg);
- browser.runtime.sendMessage("msg from child");
- });
- browser.test.sendMessage("sendMessage callback called");
- }
-
- let extensionData = {
- background,
- files: {
- "lastScript.js": lastScript,
- "extensionpage.html": `<!DOCTYPE html><meta charset="utf-8"><script src="lastScript.js"></script>`,
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
-
- yield extension.awaitMessage("sendMessage callback called");
- extension.sendMessage("sendMessage with a listener in another frame");
- yield extension.awaitFinish("sendMessage did not call same-frame onMessage");
-
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas.js b/toolkit/components/webextensions/test/xpcshell/test_ext_schemas.js
deleted file mode 100644
index d838be5b51..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas.js
+++ /dev/null
@@ -1,1427 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/Schemas.jsm");
-Components.utils.import("resource://gre/modules/BrowserUtils.jsm");
-Components.utils.import("resource://gre/modules/ExtensionCommon.jsm");
-
-let {LocalAPIImplementation, SchemaAPIInterface} = ExtensionCommon;
-
-let json = [
- {namespace: "testing",
-
- properties: {
- PROP1: {value: 20},
- prop2: {type: "string"},
- prop3: {
- $ref: "submodule",
- },
- prop4: {
- $ref: "submodule",
- unsupported: true,
- },
- },
-
- types: [
- {
- id: "type1",
- type: "string",
- "enum": ["value1", "value2", "value3"],
- },
-
- {
- id: "type2",
- type: "object",
- properties: {
- prop1: {type: "integer"},
- prop2: {type: "array", items: {"$ref": "type1"}},
- },
- },
-
- {
- id: "basetype1",
- type: "object",
- properties: {
- prop1: {type: "string"},
- },
- },
-
- {
- id: "basetype2",
- choices: [
- {type: "integer"},
- ],
- },
-
- {
- $extend: "basetype1",
- properties: {
- prop2: {type: "string"},
- },
- },
-
- {
- $extend: "basetype2",
- choices: [
- {type: "string"},
- ],
- },
-
- {
- id: "submodule",
- type: "object",
- functions: [
- {
- name: "sub_foo",
- type: "function",
- parameters: [],
- returns: "integer",
- },
- ],
- },
- ],
-
- functions: [
- {
- name: "foo",
- type: "function",
- parameters: [
- {name: "arg1", type: "integer", optional: true, default: 99},
- {name: "arg2", type: "boolean", optional: true},
- ],
- },
-
- {
- name: "bar",
- type: "function",
- parameters: [
- {name: "arg1", type: "integer", optional: true},
- {name: "arg2", type: "boolean"},
- ],
- },
-
- {
- name: "baz",
- type: "function",
- parameters: [
- {name: "arg1", type: "object", properties: {
- prop1: {type: "string"},
- prop2: {type: "integer", optional: true},
- prop3: {type: "integer", unsupported: true},
- }},
- ],
- },
-
- {
- name: "qux",
- type: "function",
- parameters: [
- {name: "arg1", "$ref": "type1"},
- ],
- },
-
- {
- name: "quack",
- type: "function",
- parameters: [
- {name: "arg1", "$ref": "type2"},
- ],
- },
-
- {
- name: "quora",
- type: "function",
- parameters: [
- {name: "arg1", type: "function"},
- ],
- },
-
- {
- name: "quileute",
- type: "function",
- parameters: [
- {name: "arg1", type: "integer", optional: true},
- {name: "arg2", type: "integer"},
- ],
- },
-
- {
- name: "queets",
- type: "function",
- unsupported: true,
- parameters: [],
- },
-
- {
- name: "quintuplets",
- type: "function",
- parameters: [
- {name: "obj", type: "object", properties: [], additionalProperties: {type: "integer"}},
- ],
- },
-
- {
- name: "quasar",
- type: "function",
- parameters: [
- {name: "abc", type: "object", properties: {
- func: {type: "function", parameters: [
- {name: "x", type: "integer"},
- ]},
- }},
- ],
- },
-
- {
- name: "quosimodo",
- type: "function",
- parameters: [
- {name: "xyz", type: "object", additionalProperties: {type: "any"}},
- ],
- },
-
- {
- name: "patternprop",
- type: "function",
- parameters: [
- {
- name: "obj",
- type: "object",
- properties: {"prop1": {type: "string", pattern: "^\\d+$"}},
- patternProperties: {
- "(?i)^prop\\d+$": {type: "string"},
- "^foo\\d+$": {type: "string"},
- },
- },
- ],
- },
-
- {
- name: "pattern",
- type: "function",
- parameters: [
- {name: "arg", type: "string", pattern: "(?i)^[0-9a-f]+$"},
- ],
- },
-
- {
- name: "format",
- type: "function",
- parameters: [
- {
- name: "arg",
- type: "object",
- properties: {
- url: {type: "string", "format": "url", "optional": true},
- relativeUrl: {type: "string", "format": "relativeUrl", "optional": true},
- strictRelativeUrl: {type: "string", "format": "strictRelativeUrl", "optional": true},
- },
- },
- ],
- },
-
- {
- name: "formatDate",
- type: "function",
- parameters: [
- {
- name: "arg",
- type: "object",
- properties: {
- date: {type: "string", format: "date", optional: true},
- },
- },
- ],
- },
-
- {
- name: "deep",
- type: "function",
- parameters: [
- {
- name: "arg",
- type: "object",
- properties: {
- foo: {
- type: "object",
- properties: {
- bar: {
- type: "array",
- items: {
- type: "object",
- properties: {
- baz: {
- type: "object",
- properties: {
- required: {type: "integer"},
- optional: {type: "string", optional: true},
- },
- },
- },
- },
- },
- },
- },
- },
- },
- ],
- },
-
- {
- name: "errors",
- type: "function",
- parameters: [
- {
- name: "arg",
- type: "object",
- properties: {
- warn: {
- type: "string",
- pattern: "^\\d+$",
- optional: true,
- onError: "warn",
- },
- ignore: {
- type: "string",
- pattern: "^\\d+$",
- optional: true,
- onError: "ignore",
- },
- default: {
- type: "string",
- pattern: "^\\d+$",
- optional: true,
- },
- },
- },
- ],
- },
-
- {
- name: "localize",
- type: "function",
- parameters: [
- {
- name: "arg",
- type: "object",
- properties: {
- foo: {type: "string", "preprocess": "localize", "optional": true},
- bar: {type: "string", "optional": true},
- url: {type: "string", "preprocess": "localize", "format": "url", "optional": true},
- },
- },
- ],
- },
-
- {
- name: "extended1",
- type: "function",
- parameters: [
- {name: "val", $ref: "basetype1"},
- ],
- },
-
- {
- name: "extended2",
- type: "function",
- parameters: [
- {name: "val", $ref: "basetype2"},
- ],
- },
- ],
-
- events: [
- {
- name: "onFoo",
- type: "function",
- },
-
- {
- name: "onBar",
- type: "function",
- extraParameters: [{
- name: "filter",
- type: "integer",
- optional: true,
- default: 1,
- }],
- },
- ],
- },
- {
- namespace: "foreign",
- properties: {
- foreignRef: {$ref: "testing.submodule"},
- },
- },
- {
- namespace: "inject",
- properties: {
- PROP1: {value: "should inject"},
- },
- },
- {
- namespace: "do-not-inject",
- properties: {
- PROP1: {value: "should not inject"},
- },
- },
-];
-
-let tallied = null;
-
-function tally(kind, ns, name, args) {
- tallied = [kind, ns, name, args];
-}
-
-function verify(...args) {
- do_check_eq(JSON.stringify(tallied), JSON.stringify(args));
- tallied = null;
-}
-
-let talliedErrors = [];
-
-function checkErrors(errors) {
- do_check_eq(talliedErrors.length, errors.length, "Got expected number of errors");
- for (let [i, error] of errors.entries()) {
- do_check_true(i in talliedErrors && talliedErrors[i].includes(error),
- `${JSON.stringify(error)} is a substring of error ${JSON.stringify(talliedErrors[i])}`);
- }
-
- talliedErrors.length = 0;
-}
-
-let permissions = new Set();
-
-class TallyingAPIImplementation extends SchemaAPIInterface {
- constructor(namespace, name) {
- super();
- this.namespace = namespace;
- this.name = name;
- }
-
- callFunction(args) {
- tally("call", this.namespace, this.name, args);
- }
-
- callFunctionNoReturn(args) {
- tally("call", this.namespace, this.name, args);
- }
-
- getProperty() {
- tally("get", this.namespace, this.name);
- }
-
- setProperty(value) {
- tally("set", this.namespace, this.name, value);
- }
-
- addListener(listener, args) {
- tally("addListener", this.namespace, this.name, [listener, args]);
- }
-
- removeListener(listener) {
- tally("removeListener", this.namespace, this.name, [listener]);
- }
-
- hasListener(listener) {
- tally("hasListener", this.namespace, this.name, [listener]);
- }
-}
-
-let wrapper = {
- url: "moz-extension://b66e3509-cdb3-44f6-8eb8-c8b39b3a1d27/",
-
- checkLoadURL(url) {
- return !url.startsWith("chrome:");
- },
-
- preprocessors: {
- localize(value, context) {
- return value.replace(/__MSG_(.*?)__/g, (m0, m1) => `${m1.toUpperCase()}`);
- },
- },
-
- logError(message) {
- talliedErrors.push(message);
- },
-
- hasPermission(permission) {
- return permissions.has(permission);
- },
-
- shouldInject(ns) {
- return ns != "do-not-inject";
- },
-
- getImplementation(namespace, name) {
- return new TallyingAPIImplementation(namespace, name);
- },
-};
-
-add_task(function* () {
- let url = "data:," + JSON.stringify(json);
- yield Schemas.load(url);
-
- let root = {};
- tallied = null;
- Schemas.inject(root, wrapper);
- do_check_eq(tallied, null);
-
- do_check_eq(root.testing.PROP1, 20, "simple value property");
- do_check_eq(root.testing.type1.VALUE1, "value1", "enum type");
- do_check_eq(root.testing.type1.VALUE2, "value2", "enum type");
-
- do_check_eq("inject" in root, true, "namespace 'inject' should be injected");
- do_check_eq("do-not-inject" in root, false, "namespace 'do-not-inject' should not be injected");
-
- root.testing.foo(11, true);
- verify("call", "testing", "foo", [11, true]);
-
- root.testing.foo(true);
- verify("call", "testing", "foo", [99, true]);
-
- root.testing.foo(null, true);
- verify("call", "testing", "foo", [99, true]);
-
- root.testing.foo(undefined, true);
- verify("call", "testing", "foo", [99, true]);
-
- root.testing.foo(11);
- verify("call", "testing", "foo", [11, null]);
-
- Assert.throws(() => root.testing.bar(11),
- /Incorrect argument types/,
- "should throw without required arg");
-
- Assert.throws(() => root.testing.bar(11, true, 10),
- /Incorrect argument types/,
- "should throw with too many arguments");
-
- root.testing.bar(true);
- verify("call", "testing", "bar", [null, true]);
-
- root.testing.baz({prop1: "hello", prop2: 22});
- verify("call", "testing", "baz", [{prop1: "hello", prop2: 22}]);
-
- root.testing.baz({prop1: "hello"});
- verify("call", "testing", "baz", [{prop1: "hello", prop2: null}]);
-
- root.testing.baz({prop1: "hello", prop2: null});
- verify("call", "testing", "baz", [{prop1: "hello", prop2: null}]);
-
- Assert.throws(() => root.testing.baz({prop2: 12}),
- /Property "prop1" is required/,
- "should throw without required property");
-
- Assert.throws(() => root.testing.baz({prop1: "hi", prop3: 12}),
- /Property "prop3" is unsupported by Firefox/,
- "should throw with unsupported property");
-
- Assert.throws(() => root.testing.baz({prop1: "hi", prop4: 12}),
- /Unexpected property "prop4"/,
- "should throw with unexpected property");
-
- Assert.throws(() => root.testing.baz({prop1: 12}),
- /Expected string instead of 12/,
- "should throw with wrong type");
-
- root.testing.qux("value2");
- verify("call", "testing", "qux", ["value2"]);
-
- Assert.throws(() => root.testing.qux("value4"),
- /Invalid enumeration value "value4"/,
- "should throw for invalid enum value");
-
- root.testing.quack({prop1: 12, prop2: ["value1", "value3"]});
- verify("call", "testing", "quack", [{prop1: 12, prop2: ["value1", "value3"]}]);
-
- Assert.throws(() => root.testing.quack({prop1: 12, prop2: ["value1", "value3", "value4"]}),
- /Invalid enumeration value "value4"/,
- "should throw for invalid array type");
-
- function f() {}
- root.testing.quora(f);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["call", "testing", "quora"]));
- do_check_eq(tallied[3][0], f);
- tallied = null;
-
- let g = () => 0;
- root.testing.quora(g);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["call", "testing", "quora"]));
- do_check_eq(tallied[3][0], g);
- tallied = null;
-
- root.testing.quileute(10);
- verify("call", "testing", "quileute", [null, 10]);
-
- Assert.throws(() => root.testing.queets(),
- /queets is not a function/,
- "should throw for unsupported functions");
-
- root.testing.quintuplets({a: 10, b: 20, c: 30});
- verify("call", "testing", "quintuplets", [{a: 10, b: 20, c: 30}]);
-
- Assert.throws(() => root.testing.quintuplets({a: 10, b: 20, c: 30, d: "hi"}),
- /Expected integer instead of "hi"/,
- "should throw for wrong additionalProperties type");
-
- root.testing.quasar({func: f});
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["call", "testing", "quasar"]));
- do_check_eq(tallied[3][0].func, f);
- tallied = null;
-
- root.testing.quosimodo({a: 10, b: 20, c: 30});
- verify("call", "testing", "quosimodo", [{a: 10, b: 20, c: 30}]);
- tallied = null;
-
- Assert.throws(() => root.testing.quosimodo(10),
- /Incorrect argument types/,
- "should throw for wrong type");
-
- root.testing.patternprop({prop1: "12", prop2: "42", Prop3: "43", foo1: "x"});
- verify("call", "testing", "patternprop", [{prop1: "12", prop2: "42", Prop3: "43", foo1: "x"}]);
- tallied = null;
-
- root.testing.patternprop({prop1: "12"});
- verify("call", "testing", "patternprop", [{prop1: "12"}]);
- tallied = null;
-
- Assert.throws(() => root.testing.patternprop({prop1: "12", foo1: null}),
- /Expected string instead of null/,
- "should throw for wrong property type");
-
- Assert.throws(() => root.testing.patternprop({prop1: "xx", prop2: "yy"}),
- /String "xx" must match \/\^\\d\+\$\//,
- "should throw for wrong property type");
-
- Assert.throws(() => root.testing.patternprop({prop1: "12", prop2: 42}),
- /Expected string instead of 42/,
- "should throw for wrong property type");
-
- Assert.throws(() => root.testing.patternprop({prop1: "12", prop2: null}),
- /Expected string instead of null/,
- "should throw for wrong property type");
-
- Assert.throws(() => root.testing.patternprop({prop1: "12", propx: "42"}),
- /Unexpected property "propx"/,
- "should throw for unexpected property");
-
- Assert.throws(() => root.testing.patternprop({prop1: "12", Foo1: "x"}),
- /Unexpected property "Foo1"/,
- "should throw for unexpected property");
-
- root.testing.pattern("DEADbeef");
- verify("call", "testing", "pattern", ["DEADbeef"]);
- tallied = null;
-
- Assert.throws(() => root.testing.pattern("DEADcow"),
- /String "DEADcow" must match \/\^\[0-9a-f\]\+\$\/i/,
- "should throw for non-match");
-
- root.testing.format({url: "http://foo/bar",
- relativeUrl: "http://foo/bar"});
- verify("call", "testing", "format", [{url: "http://foo/bar",
- relativeUrl: "http://foo/bar",
- strictRelativeUrl: null}]);
- tallied = null;
-
- root.testing.format({relativeUrl: "foo.html", strictRelativeUrl: "foo.html"});
- verify("call", "testing", "format", [{url: null,
- relativeUrl: `${wrapper.url}foo.html`,
- strictRelativeUrl: `${wrapper.url}foo.html`}]);
- tallied = null;
-
- for (let format of ["url", "relativeUrl"]) {
- Assert.throws(() => root.testing.format({[format]: "chrome://foo/content/"}),
- /Access denied/,
- "should throw for access denied");
- }
-
- for (let urlString of ["//foo.html", "http://foo/bar.html"]) {
- Assert.throws(() => root.testing.format({strictRelativeUrl: urlString}),
- /must be a relative URL/,
- "should throw for non-relative URL");
- }
-
- const dates = [
- "2016-03-04",
- "2016-03-04T08:00:00Z",
- "2016-03-04T08:00:00.000Z",
- "2016-03-04T08:00:00-08:00",
- "2016-03-04T08:00:00.000-08:00",
- "2016-03-04T08:00:00+08:00",
- "2016-03-04T08:00:00.000+08:00",
- "2016-03-04T08:00:00+0800",
- "2016-03-04T08:00:00-0800",
- ];
- dates.forEach(str => {
- root.testing.formatDate({date: str});
- verify("call", "testing", "formatDate", [{date: str}]);
- });
-
- // Make sure that a trivial change to a valid date invalidates it.
- dates.forEach(str => {
- Assert.throws(() => root.testing.formatDate({date: "0" + str}),
- /Invalid date string/,
- "should throw for invalid iso date string");
- Assert.throws(() => root.testing.formatDate({date: str + "0"}),
- /Invalid date string/,
- "should throw for invalid iso date string");
- });
-
- const badDates = [
- "I do not look anything like a date string",
- "2016-99-99",
- "2016-03-04T25:00:00Z",
- ];
- badDates.forEach(str => {
- Assert.throws(() => root.testing.formatDate({date: str}),
- /Invalid date string/,
- "should throw for invalid iso date string");
- });
-
- root.testing.deep({foo: {bar: [{baz: {required: 12, optional: "42"}}]}});
- verify("call", "testing", "deep", [{foo: {bar: [{baz: {required: 12, optional: "42"}}]}}]);
- tallied = null;
-
- Assert.throws(() => root.testing.deep({foo: {bar: [{baz: {optional: "42"}}]}}),
- /Type error for parameter arg \(Error processing foo\.bar\.0\.baz: Property "required" is required\) for testing\.deep/,
- "should throw with the correct object path");
-
- Assert.throws(() => root.testing.deep({foo: {bar: [{baz: {required: 12, optional: 42}}]}}),
- /Type error for parameter arg \(Error processing foo\.bar\.0\.baz\.optional: Expected string instead of 42\) for testing\.deep/,
- "should throw with the correct object path");
-
-
- talliedErrors.length = 0;
-
- root.testing.errors({warn: "0123", ignore: "0123", default: "0123"});
- verify("call", "testing", "errors", [{warn: "0123", ignore: "0123", default: "0123"}]);
- checkErrors([]);
-
- root.testing.errors({warn: "0123", ignore: "x123", default: "0123"});
- verify("call", "testing", "errors", [{warn: "0123", ignore: null, default: "0123"}]);
- checkErrors([]);
-
- root.testing.errors({warn: "x123", ignore: "0123", default: "0123"});
- verify("call", "testing", "errors", [{warn: null, ignore: "0123", default: "0123"}]);
- checkErrors([
- 'String "x123" must match /^\\d+$/',
- ]);
-
-
- root.testing.onFoo.addListener(f);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["addListener", "testing", "onFoo"]));
- do_check_eq(tallied[3][0], f);
- do_check_eq(JSON.stringify(tallied[3][1]), JSON.stringify([]));
- tallied = null;
-
- root.testing.onFoo.removeListener(f);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["removeListener", "testing", "onFoo"]));
- do_check_eq(tallied[3][0], f);
- tallied = null;
-
- root.testing.onFoo.hasListener(f);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["hasListener", "testing", "onFoo"]));
- do_check_eq(tallied[3][0], f);
- tallied = null;
-
- Assert.throws(() => root.testing.onFoo.addListener(10),
- /Invalid listener/,
- "addListener with non-function should throw");
-
- root.testing.onBar.addListener(f, 10);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["addListener", "testing", "onBar"]));
- do_check_eq(tallied[3][0], f);
- do_check_eq(JSON.stringify(tallied[3][1]), JSON.stringify([10]));
- tallied = null;
-
- root.testing.onBar.addListener(f);
- do_check_eq(JSON.stringify(tallied.slice(0, -1)), JSON.stringify(["addListener", "testing", "onBar"]));
- do_check_eq(tallied[3][0], f);
- do_check_eq(JSON.stringify(tallied[3][1]), JSON.stringify([1]));
- tallied = null;
-
- Assert.throws(() => root.testing.onBar.addListener(f, "hi"),
- /Incorrect argument types/,
- "addListener with wrong extra parameter should throw");
-
- let target = {prop1: 12, prop2: ["value1", "value3"]};
- let proxy = new Proxy(target, {});
- Assert.throws(() => root.testing.quack(proxy),
- /Expected a plain JavaScript object, got a Proxy/,
- "should throw when passing a Proxy");
-
- if (Symbol.toStringTag) {
- let stringTarget = {prop1: 12, prop2: ["value1", "value3"]};
- stringTarget[Symbol.toStringTag] = () => "[object Object]";
- let stringProxy = new Proxy(stringTarget, {});
- Assert.throws(() => root.testing.quack(stringProxy),
- /Expected a plain JavaScript object, got a Proxy/,
- "should throw when passing a Proxy");
- }
-
-
- root.testing.localize({foo: "__MSG_foo__", bar: "__MSG_foo__", url: "__MSG_http://example.com/__"});
- verify("call", "testing", "localize", [{foo: "FOO", bar: "__MSG_foo__", url: "http://example.com/"}]);
- tallied = null;
-
-
- Assert.throws(() => root.testing.localize({url: "__MSG_/foo/bar__"}),
- /\/FOO\/BAR is not a valid URL\./,
- "should throw for invalid URL");
-
-
- root.testing.extended1({prop1: "foo", prop2: "bar"});
- verify("call", "testing", "extended1", [{prop1: "foo", prop2: "bar"}]);
- tallied = null;
-
- Assert.throws(() => root.testing.extended1({prop1: "foo", prop2: 12}),
- /Expected string instead of 12/,
- "should throw for wrong property type");
-
- Assert.throws(() => root.testing.extended1({prop1: "foo"}),
- /Property "prop2" is required/,
- "should throw for missing property");
-
- Assert.throws(() => root.testing.extended1({prop1: "foo", prop2: "bar", prop3: "xxx"}),
- /Unexpected property "prop3"/,
- "should throw for extra property");
-
-
- root.testing.extended2("foo");
- verify("call", "testing", "extended2", ["foo"]);
- tallied = null;
-
- root.testing.extended2(12);
- verify("call", "testing", "extended2", [12]);
- tallied = null;
-
- Assert.throws(() => root.testing.extended2(true),
- /Incorrect argument types/,
- "should throw for wrong argument type");
-
- root.testing.prop3.sub_foo();
- verify("call", "testing.prop3", "sub_foo", []);
- tallied = null;
-
- Assert.throws(() => root.testing.prop4.sub_foo(),
- /root.testing.prop4 is undefined/,
- "should throw for unsupported submodule");
-
- root.foreign.foreignRef.sub_foo();
- verify("call", "foreign.foreignRef", "sub_foo", []);
- tallied = null;
-});
-
-let deprecatedJson = [
- {namespace: "deprecated",
-
- properties: {
- accessor: {
- type: "string",
- writable: true,
- deprecated: "This is not the property you are looking for",
- },
- },
-
- types: [
- {
- "id": "Type",
- "type": "string",
- },
- ],
-
- functions: [
- {
- name: "property",
- type: "function",
- parameters: [
- {
- name: "arg",
- type: "object",
- properties: {
- foo: {
- type: "string",
- },
- },
- additionalProperties: {
- type: "any",
- deprecated: "Unknown property",
- },
- },
- ],
- },
-
- {
- name: "value",
- type: "function",
- parameters: [
- {
- name: "arg",
- choices: [
- {
- type: "integer",
- },
- {
- type: "string",
- deprecated: "Please use an integer, not ${value}",
- },
- ],
- },
- ],
- },
-
- {
- name: "choices",
- type: "function",
- parameters: [
- {
- name: "arg",
- deprecated: "You have no choices",
- choices: [
- {
- type: "integer",
- },
- ],
- },
- ],
- },
-
- {
- name: "ref",
- type: "function",
- parameters: [
- {
- name: "arg",
- choices: [
- {
- $ref: "Type",
- deprecated: "Deprecated alias",
- },
- ],
- },
- ],
- },
-
- {
- name: "method",
- type: "function",
- deprecated: "Do not call this method",
- parameters: [
- ],
- },
- ],
-
- events: [
- {
- name: "onDeprecated",
- type: "function",
- deprecated: "This event does not work",
- },
- ],
- },
-];
-
-add_task(function* testDeprecation() {
- let url = "data:," + JSON.stringify(deprecatedJson);
- yield Schemas.load(url);
-
- let root = {};
- Schemas.inject(root, wrapper);
-
- talliedErrors.length = 0;
-
-
- root.deprecated.property({foo: "bar", xxx: "any", yyy: "property"});
- verify("call", "deprecated", "property", [{foo: "bar", xxx: "any", yyy: "property"}]);
- checkErrors([
- "Error processing xxx: Unknown property",
- "Error processing yyy: Unknown property",
- ]);
-
- root.deprecated.value(12);
- verify("call", "deprecated", "value", [12]);
- checkErrors([]);
-
- root.deprecated.value("12");
- verify("call", "deprecated", "value", ["12"]);
- checkErrors(["Please use an integer, not \"12\""]);
-
- root.deprecated.choices(12);
- verify("call", "deprecated", "choices", [12]);
- checkErrors(["You have no choices"]);
-
- root.deprecated.ref("12");
- verify("call", "deprecated", "ref", ["12"]);
- checkErrors(["Deprecated alias"]);
-
- root.deprecated.method();
- verify("call", "deprecated", "method", []);
- checkErrors(["Do not call this method"]);
-
-
- void root.deprecated.accessor;
- verify("get", "deprecated", "accessor", null);
- checkErrors(["This is not the property you are looking for"]);
-
- root.deprecated.accessor = "x";
- verify("set", "deprecated", "accessor", "x");
- checkErrors(["This is not the property you are looking for"]);
-
-
- root.deprecated.onDeprecated.addListener(() => {});
- checkErrors(["This event does not work"]);
-
- root.deprecated.onDeprecated.removeListener(() => {});
- checkErrors(["This event does not work"]);
-
- root.deprecated.onDeprecated.hasListener(() => {});
- checkErrors(["This event does not work"]);
-});
-
-
-let choicesJson = [
- {namespace: "choices",
-
- types: [
- ],
-
- functions: [
- {
- name: "meh",
- type: "function",
- parameters: [
- {
- name: "arg",
- choices: [
- {
- type: "string",
- enum: ["foo", "bar", "baz"],
- },
- {
- type: "string",
- pattern: "florg.*meh",
- },
- {
- type: "integer",
- minimum: 12,
- maximum: 42,
- },
- ],
- },
- ],
- },
-
- {
- name: "foo",
- type: "function",
- parameters: [
- {
- name: "arg",
- choices: [
- {
- type: "object",
- properties: {
- blurg: {
- type: "string",
- unsupported: true,
- optional: true,
- },
- },
- additionalProperties: {
- type: "string",
- },
- },
- {
- type: "string",
- },
- {
- type: "array",
- minItems: 2,
- maxItems: 3,
- items: {
- type: "integer",
- },
- },
- ],
- },
- ],
- },
-
- {
- name: "bar",
- type: "function",
- parameters: [
- {
- name: "arg",
- choices: [
- {
- type: "object",
- properties: {
- baz: {
- type: "string",
- },
- },
- },
- {
- type: "array",
- items: {
- type: "integer",
- },
- },
- ],
- },
- ],
- },
- ]},
-];
-
-add_task(function* testChoices() {
- let url = "data:," + JSON.stringify(choicesJson);
- yield Schemas.load(url);
-
- let root = {};
- Schemas.inject(root, wrapper);
-
- talliedErrors.length = 0;
-
- Assert.throws(() => root.choices.meh("frog"),
- /Value must either: be one of \["foo", "bar", "baz"\], match the pattern \/florg\.\*meh\/, or be an integer value/);
-
- Assert.throws(() => root.choices.meh(4),
- /be a string value, or be at least 12/);
-
- Assert.throws(() => root.choices.meh(43),
- /be a string value, or be no greater than 42/);
-
-
- Assert.throws(() => root.choices.foo([]),
- /be an object value, be a string value, or have at least 2 items/);
-
- Assert.throws(() => root.choices.foo([1, 2, 3, 4]),
- /be an object value, be a string value, or have at most 3 items/);
-
- Assert.throws(() => root.choices.foo({foo: 12}),
- /.foo must be a string value, be a string value, or be an array value/);
-
- Assert.throws(() => root.choices.foo({blurg: "foo"}),
- /not contain an unsupported "blurg" property, be a string value, or be an array value/);
-
-
- Assert.throws(() => root.choices.bar({}),
- /contain the required "baz" property, or be an array value/);
-
- Assert.throws(() => root.choices.bar({baz: "x", quux: "y"}),
- /not contain an unexpected "quux" property, or be an array value/);
-
- Assert.throws(() => root.choices.bar({baz: "x", quux: "y", foo: "z"}),
- /not contain the unexpected properties \[foo, quux\], or be an array value/);
-});
-
-
-let permissionsJson = [
- {namespace: "noPerms",
-
- types: [],
-
- functions: [
- {
- name: "noPerms",
- type: "function",
- parameters: [],
- },
-
- {
- name: "fooPerm",
- type: "function",
- permissions: ["foo"],
- parameters: [],
- },
- ]},
-
- {namespace: "fooPerm",
-
- permissions: ["foo"],
-
- types: [],
-
- functions: [
- {
- name: "noPerms",
- type: "function",
- parameters: [],
- },
-
- {
- name: "fooBarPerm",
- type: "function",
- permissions: ["foo.bar"],
- parameters: [],
- },
- ]},
-];
-
-add_task(function* testPermissions() {
- let url = "data:," + JSON.stringify(permissionsJson);
- yield Schemas.load(url);
-
- let root = {};
- Schemas.inject(root, wrapper);
-
- equal(typeof root.noPerms, "object", "noPerms namespace should exist");
- equal(typeof root.noPerms.noPerms, "function", "noPerms.noPerms method should exist");
-
- ok(!("fooPerm" in root.noPerms), "noPerms.fooPerm should not method exist");
-
- ok(!("fooPerm" in root), "fooPerm namespace should not exist");
-
-
- do_print('Add "foo" permission');
- permissions.add("foo");
-
- root = {};
- Schemas.inject(root, wrapper);
-
- equal(typeof root.noPerms, "object", "noPerms namespace should exist");
- equal(typeof root.noPerms.noPerms, "function", "noPerms.noPerms method should exist");
- equal(typeof root.noPerms.fooPerm, "function", "noPerms.fooPerm method should exist");
-
- equal(typeof root.fooPerm, "object", "fooPerm namespace should exist");
- equal(typeof root.fooPerm.noPerms, "function", "noPerms.noPerms method should exist");
-
- ok(!("fooBarPerm" in root.fooPerm), "fooPerm.fooBarPerm method should not exist");
-
-
- do_print('Add "foo.bar" permission');
- permissions.add("foo.bar");
-
- root = {};
- Schemas.inject(root, wrapper);
-
- equal(typeof root.noPerms, "object", "noPerms namespace should exist");
- equal(typeof root.noPerms.noPerms, "function", "noPerms.noPerms method should exist");
- equal(typeof root.noPerms.fooPerm, "function", "noPerms.fooPerm method should exist");
-
- equal(typeof root.fooPerm, "object", "fooPerm namespace should exist");
- equal(typeof root.fooPerm.noPerms, "function", "noPerms.noPerms method should exist");
- equal(typeof root.fooPerm.fooBarPerm, "function", "noPerms.fooBarPerm method should exist");
-});
-
-let nestedNamespaceJson = [
- {
- "namespace": "nested.namespace",
- "types": [
- {
- "id": "CustomType",
- "type": "object",
- "events": [
- {
- "name": "onEvent",
- },
- ],
- "properties": {
- "url": {
- "type": "string",
- },
- },
- "functions": [
- {
- "name": "functionOnCustomType",
- "type": "function",
- "parameters": [
- {
- "name": "title",
- "type": "string",
- },
- ],
- },
- ],
- },
- ],
- "properties": {
- "instanceOfCustomType": {
- "$ref": "CustomType",
- },
- },
- "functions": [
- {
- "name": "create",
- "type": "function",
- "parameters": [
- {
- "name": "title",
- "type": "string",
- },
- ],
- },
- ],
- },
-];
-
-add_task(function* testNestedNamespace() {
- let url = "data:," + JSON.stringify(nestedNamespaceJson);
-
- yield Schemas.load(url);
-
- let root = {};
- Schemas.inject(root, wrapper);
-
- talliedErrors.length = 0;
-
- ok(root.nested, "The root object contains the first namespace level");
- ok(root.nested.namespace, "The first level object contains the second namespace level");
-
- ok(root.nested.namespace.create, "Got the expected function in the nested namespace");
- do_check_eq(typeof root.nested.namespace.create, "function",
- "The property is a function as expected");
-
- let {instanceOfCustomType} = root.nested.namespace;
-
- ok(instanceOfCustomType,
- "Got the expected instance of the CustomType defined in the schema");
- ok(instanceOfCustomType.functionOnCustomType,
- "Got the expected method in the CustomType instance");
-
- // TODO: test support events and properties in a SubModuleType defined in the schema,
- // once implemented, e.g.:
- //
- // ok(instanceOfCustomType.url,
- // "Got the expected property defined in the CustomType instance)
- //
- // ok(instanceOfCustomType.onEvent &&
- // instanceOfCustomType.onEvent.addListener &&
- // typeof instanceOfCustomType.onEvent.addListener == "function",
- // "Got the expected event defined in the CustomType instance");
-});
-
-add_task(function* testLocalAPIImplementation() {
- let countGet2 = 0;
- let countProp3 = 0;
- let countProp3SubFoo = 0;
-
- let testingApiObj = {
- get PROP1() {
- // PROP1 is a schema-defined constant.
- throw new Error("Unexpected get PROP1");
- },
- get prop2() {
- ++countGet2;
- return "prop2 val";
- },
- get prop3() {
- throw new Error("Unexpected get prop3");
- },
- set prop3(v) {
- // prop3 is a submodule, defined as a function, so the API should not pass
- // through assignment to prop3.
- throw new Error("Unexpected set prop3");
- },
- };
- let submoduleApiObj = {
- get sub_foo() {
- ++countProp3;
- return () => {
- return ++countProp3SubFoo;
- };
- },
- };
-
- let localWrapper = {
- shouldInject(ns) {
- return ns == "testing" || ns == "testing.prop3";
- },
- getImplementation(ns, name) {
- do_check_true(ns == "testing" || ns == "testing.prop3");
- if (ns == "testing.prop3" && name == "sub_foo") {
- // It is fine to use `null` here because we don't call async functions.
- return new LocalAPIImplementation(submoduleApiObj, name, null);
- }
- // It is fine to use `null` here because we don't call async functions.
- return new LocalAPIImplementation(testingApiObj, name, null);
- },
- };
-
- let root = {};
- Schemas.inject(root, localWrapper);
- do_check_eq(countGet2, 0);
- do_check_eq(countProp3, 0);
- do_check_eq(countProp3SubFoo, 0);
-
- do_check_eq(root.testing.PROP1, 20);
-
- do_check_eq(root.testing.prop2, "prop2 val");
- do_check_eq(countGet2, 1);
-
- do_check_eq(root.testing.prop2, "prop2 val");
- do_check_eq(countGet2, 2);
-
- do_print(JSON.stringify(root.testing));
- do_check_eq(root.testing.prop3.sub_foo(), 1);
- do_check_eq(countProp3, 1);
- do_check_eq(countProp3SubFoo, 1);
-
- do_check_eq(root.testing.prop3.sub_foo(), 2);
- do_check_eq(countProp3, 2);
- do_check_eq(countProp3SubFoo, 2);
-
- root.testing.prop3.sub_foo = () => { return "overwritten"; };
- do_check_eq(root.testing.prop3.sub_foo(), "overwritten");
-
- root.testing.prop3 = {sub_foo() { return "overwritten again"; }};
- do_check_eq(root.testing.prop3.sub_foo(), "overwritten again");
- do_check_eq(countProp3SubFoo, 2);
-});
-
-
-let defaultsJson = [
- {namespace: "defaultsJson",
-
- types: [],
-
- functions: [
- {
- name: "defaultFoo",
- type: "function",
- parameters: [
- {name: "arg", type: "object", optional: true, properties: {
- prop1: {type: "integer", optional: true},
- }, default: {prop1: 1}},
- ],
- returns: {
- type: "object",
- },
- },
- ]},
-];
-
-add_task(function* testDefaults() {
- let url = "data:," + JSON.stringify(defaultsJson);
- yield Schemas.load(url);
-
- let testingApiObj = {
- defaultFoo: function(arg) {
- if (Object.keys(arg) != "prop1") {
- throw new Error(`Received the expected default object, default: ${JSON.stringify(arg)}`);
- }
- arg.newProp = 1;
- return arg;
- },
- };
-
- let localWrapper = {
- shouldInject(ns) {
- return true;
- },
- getImplementation(ns, name) {
- return new LocalAPIImplementation(testingApiObj, name, null);
- },
- };
-
- let root = {};
- Schemas.inject(root, localWrapper);
-
- deepEqual(root.defaultsJson.defaultFoo(), {prop1: 1, newProp: 1});
- deepEqual(root.defaultsJson.defaultFoo({prop1: 2}), {prop1: 2, newProp: 1});
- deepEqual(root.defaultsJson.defaultFoo(), {prop1: 1, newProp: 1});
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_allowed_contexts.js b/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_allowed_contexts.js
deleted file mode 100644
index 606459764c..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_allowed_contexts.js
+++ /dev/null
@@ -1,147 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/Schemas.jsm");
-
-let schemaJson = [
- {
- namespace: "noAllowedContexts",
- properties: {
- prop1: {type: "object"},
- prop2: {type: "object", allowedContexts: ["test_zero", "test_one"]},
- prop3: {type: "number", value: 1},
- prop4: {type: "number", value: 1, allowedContexts: ["numeric_one"]},
- },
- },
- {
- namespace: "defaultContexts",
- defaultContexts: ["test_two"],
- properties: {
- prop1: {type: "object"},
- prop2: {type: "object", allowedContexts: ["test_three"]},
- prop3: {type: "number", value: 1},
- prop4: {type: "number", value: 1, allowedContexts: ["numeric_two"]},
- },
- },
- {
- namespace: "withAllowedContexts",
- allowedContexts: ["test_four"],
- properties: {
- prop1: {type: "object"},
- prop2: {type: "object", allowedContexts: ["test_five"]},
- prop3: {type: "number", value: 1},
- prop4: {type: "number", value: 1, allowedContexts: ["numeric_three"]},
- },
- },
- {
- namespace: "withAllowedContextsAndDefault",
- allowedContexts: ["test_six"],
- defaultContexts: ["test_seven"],
- properties: {
- prop1: {type: "object"},
- prop2: {type: "object", allowedContexts: ["test_eight"]},
- prop3: {type: "number", value: 1},
- prop4: {type: "number", value: 1, allowedContexts: ["numeric_four"]},
- },
- },
- {
- namespace: "with_submodule",
- defaultContexts: ["test_nine"],
- types: [{
- id: "subtype",
- type: "object",
- functions: [{
- name: "noAllowedContexts",
- type: "function",
- parameters: [],
- }, {
- name: "allowedContexts",
- allowedContexts: ["test_ten"],
- type: "function",
- parameters: [],
- }],
- }],
- properties: {
- prop1: {$ref: "subtype"},
- prop2: {$ref: "subtype", allowedContexts: ["test_eleven"]},
- },
- },
-];
-add_task(function* testRestrictions() {
- let url = "data:," + JSON.stringify(schemaJson);
- yield Schemas.load(url);
- let results = {};
- let localWrapper = {
- shouldInject(ns, name, allowedContexts) {
- name = name === null ? ns : ns + "." + name;
- results[name] = allowedContexts.join(",");
- return true;
- },
- getImplementation() {
- // The actual implementation is not significant for this test.
- // Let's take this opportunity to see if schema generation is free of
- // exceptions even when somehow getImplementation does not return an
- // implementation.
- },
- };
-
- let root = {};
- Schemas.inject(root, localWrapper);
-
- function verify(path, expected) {
- let obj = root;
- for (let thing of path.split(".")) {
- try {
- obj = obj[thing];
- } catch (e) {
- // Blech.
- }
- }
-
- let result = results[path];
- equal(result, expected);
- }
-
- verify("noAllowedContexts", "");
- verify("noAllowedContexts.prop1", "");
- verify("noAllowedContexts.prop2", "test_zero,test_one");
- verify("noAllowedContexts.prop3", "");
- verify("noAllowedContexts.prop4", "numeric_one");
-
- verify("defaultContexts", "");
- verify("defaultContexts.prop1", "test_two");
- verify("defaultContexts.prop2", "test_three");
- verify("defaultContexts.prop3", "test_two");
- verify("defaultContexts.prop4", "numeric_two");
-
- verify("withAllowedContexts", "test_four");
- verify("withAllowedContexts.prop1", "");
- verify("withAllowedContexts.prop2", "test_five");
- verify("withAllowedContexts.prop3", "");
- verify("withAllowedContexts.prop4", "numeric_three");
-
- verify("withAllowedContextsAndDefault", "test_six");
- verify("withAllowedContextsAndDefault.prop1", "test_seven");
- verify("withAllowedContextsAndDefault.prop2", "test_eight");
- verify("withAllowedContextsAndDefault.prop3", "test_seven");
- verify("withAllowedContextsAndDefault.prop4", "numeric_four");
-
- verify("with_submodule", "");
- verify("with_submodule.prop1", "test_nine");
- verify("with_submodule.prop1.noAllowedContexts", "test_nine");
- verify("with_submodule.prop1.allowedContexts", "test_ten");
- verify("with_submodule.prop2", "test_eleven");
- // Note: test_nine inherits allowed contexts from the namespace, not from
- // submodule. There is no "defaultContexts" for submodule types to not
- // complicate things.
- verify("with_submodule.prop1.noAllowedContexts", "test_nine");
- verify("with_submodule.prop1.allowedContexts", "test_ten");
-
- // This is a constant, so it does not matter that getImplementation does not
- // return an implementation since the API injector should take care of it.
- equal(root.noAllowedContexts.prop3, 1);
-
- Assert.throws(() => root.noAllowedContexts.prop1,
- /undefined/,
- "Should throw when the implementation is absent.");
-});
-
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_api_injection.js b/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_api_injection.js
deleted file mode 100644
index 36d88d7222..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_api_injection.js
+++ /dev/null
@@ -1,102 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/ExtensionCommon.jsm");
-Components.utils.import("resource://gre/modules/Schemas.jsm");
-
-let {
- BaseContext,
- SchemaAPIManager,
-} = ExtensionCommon;
-
-let nestedNamespaceJson = [
- {
- "namespace": "backgroundAPI.testnamespace",
- "functions": [
- {
- "name": "create",
- "type": "function",
- "parameters": [
- {
- "name": "title",
- "type": "string",
- },
- ],
- "returns": {
- "type": "string",
- },
- },
- ],
- },
- {
- "namespace": "noBackgroundAPI.testnamespace",
- "functions": [
- {
- "name": "create",
- "type": "function",
- "parameters": [
- {
- "name": "title",
- "type": "string",
- },
- ],
- },
- ],
- },
-];
-
-let global = this;
-class StubContext extends BaseContext {
- constructor() {
- let fakeExtension = {id: "test@web.extension"};
- super("addon_child", fakeExtension);
- this.sandbox = Cu.Sandbox(global);
- this.viewType = "background";
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-}
-
-add_task(function* testSchemaAPIInjection() {
- let url = "data:," + JSON.stringify(nestedNamespaceJson);
-
- // Load the schema of the fake APIs.
- yield Schemas.load(url);
-
- let apiManager = new SchemaAPIManager("addon");
-
- // Register an API that will skip the background page.
- apiManager.registerSchemaAPI("noBackgroundAPI.testnamespace", "addon_child", context => {
- // This API should not be available in this context, return null so that
- // the schema wrapper is removed as well.
- return null;
- });
-
- // Register an API that will skip any but the background page.
- apiManager.registerSchemaAPI("backgroundAPI.testnamespace", "addon_child", context => {
- if (context.viewType === "background") {
- return {
- backgroundAPI: {
- testnamespace: {
- create(title) {
- return title;
- },
- },
- },
- };
- }
-
- // This API should not be available in this context, return null so that
- // the schema wrapper is removed as well.
- return null;
- });
-
- let context = new StubContext();
- let browserObj = {};
- apiManager.generateAPIs(context, browserObj);
-
- do_check_eq(browserObj.noBackgroundAPI, undefined);
- const res = browserObj.backgroundAPI.testnamespace.create("param-value");
- do_check_eq(res, "param-value");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_async.js b/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_async.js
deleted file mode 100644
index 6397d1f96a..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_schemas_async.js
+++ /dev/null
@@ -1,232 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/ExtensionCommon.jsm");
-Components.utils.import("resource://gre/modules/Schemas.jsm");
-
-let {BaseContext, LocalAPIImplementation} = ExtensionCommon;
-
-let schemaJson = [
- {
- namespace: "testnamespace",
- functions: [{
- name: "one_required",
- type: "function",
- parameters: [{
- name: "first",
- type: "function",
- parameters: [],
- }],
- }, {
- name: "one_optional",
- type: "function",
- parameters: [{
- name: "first",
- type: "function",
- parameters: [],
- optional: true,
- }],
- }, {
- name: "async_required",
- type: "function",
- async: "first",
- parameters: [{
- name: "first",
- type: "function",
- parameters: [],
- }],
- }, {
- name: "async_optional",
- type: "function",
- async: "first",
- parameters: [{
- name: "first",
- type: "function",
- parameters: [],
- optional: true,
- }],
- }],
- },
-];
-
-const global = this;
-class StubContext extends BaseContext {
- constructor() {
- let fakeExtension = {id: "test@web.extension"};
- super("testEnv", fakeExtension);
- this.sandbox = Cu.Sandbox(global);
- }
-
- get cloneScope() {
- return this.sandbox;
- }
-
- get principal() {
- return Cu.getObjectPrincipal(this.sandbox);
- }
-}
-
-let context;
-
-function generateAPIs(extraWrapper, apiObj) {
- context = new StubContext();
- let localWrapper = {
- shouldInject() {
- return true;
- },
- getImplementation(namespace, name) {
- return new LocalAPIImplementation(apiObj, name, context);
- },
- };
- Object.assign(localWrapper, extraWrapper);
-
- let root = {};
- Schemas.inject(root, localWrapper);
- return root.testnamespace;
-}
-
-add_task(function* testParameterValidation() {
- yield Schemas.load("data:," + JSON.stringify(schemaJson));
-
- let testnamespace;
- function assertThrows(name, ...args) {
- Assert.throws(() => testnamespace[name](...args),
- /Incorrect argument types/,
- `Expected testnamespace.${name}(${args.map(String).join(", ")}) to throw.`);
- }
- function assertNoThrows(name, ...args) {
- try {
- testnamespace[name](...args);
- } catch (e) {
- do_print(`testnamespace.${name}(${args.map(String).join(", ")}) unexpectedly threw.`);
- throw new Error(e);
- }
- }
- let cb = () => {};
-
- for (let isChromeCompat of [true, false]) {
- do_print(`Testing API validation with isChromeCompat=${isChromeCompat}`);
- testnamespace = generateAPIs({
- isChromeCompat,
- }, {
- one_required() {},
- one_optional() {},
- async_required() {},
- async_optional() {},
- });
-
- assertThrows("one_required");
- assertThrows("one_required", null);
- assertNoThrows("one_required", cb);
- assertThrows("one_required", cb, null);
- assertThrows("one_required", cb, cb);
-
- assertNoThrows("one_optional");
- assertNoThrows("one_optional", null);
- assertNoThrows("one_optional", cb);
- assertThrows("one_optional", cb, null);
- assertThrows("one_optional", cb, cb);
-
- // Schema-based validation happens before an async method is called, so
- // errors should be thrown synchronously.
-
- // The parameter was declared as required, but there was also an "async"
- // attribute with the same value as the parameter name, so the callback
- // parameter is actually optional.
- assertNoThrows("async_required");
- assertNoThrows("async_required", null);
- assertNoThrows("async_required", cb);
- assertThrows("async_required", cb, null);
- assertThrows("async_required", cb, cb);
-
- assertNoThrows("async_optional");
- assertNoThrows("async_optional", null);
- assertNoThrows("async_optional", cb);
- assertThrows("async_optional", cb, null);
- assertThrows("async_optional", cb, cb);
- }
-});
-
-add_task(function* testAsyncResults() {
- yield Schemas.load("data:," + JSON.stringify(schemaJson));
- function* runWithCallback(func) {
- do_print(`Calling testnamespace.${func.name}, expecting callback with result`);
- return yield new Promise(resolve => {
- let result = "uninitialized value";
- let returnValue = func(reply => {
- result = reply;
- resolve(result);
- });
- // When a callback is given, the return value must be missing.
- do_check_eq(returnValue, undefined);
- // Callback must be called asynchronously.
- do_check_eq(result, "uninitialized value");
- });
- }
-
- function* runFailCallback(func) {
- do_print(`Calling testnamespace.${func.name}, expecting callback with error`);
- return yield new Promise(resolve => {
- func(reply => {
- do_check_eq(reply, undefined);
- resolve(context.lastError.message); // eslint-disable-line no-undef
- });
- });
- }
-
- for (let isChromeCompat of [true, false]) {
- do_print(`Testing API invocation with isChromeCompat=${isChromeCompat}`);
- let testnamespace = generateAPIs({
- isChromeCompat,
- }, {
- async_required(cb) {
- do_check_eq(cb, undefined);
- return Promise.resolve(1);
- },
- async_optional(cb) {
- do_check_eq(cb, undefined);
- return Promise.resolve(2);
- },
- });
- if (!isChromeCompat) { // No promises for chrome.
- do_print("testnamespace.async_required should be a Promise");
- let promise = testnamespace.async_required();
- do_check_true(promise instanceof context.cloneScope.Promise);
- do_check_eq(yield promise, 1);
-
- do_print("testnamespace.async_optional should be a Promise");
- promise = testnamespace.async_optional();
- do_check_true(promise instanceof context.cloneScope.Promise);
- do_check_eq(yield promise, 2);
- }
-
- do_check_eq(yield* runWithCallback(testnamespace.async_required), 1);
- do_check_eq(yield* runWithCallback(testnamespace.async_optional), 2);
-
- let otherSandbox = Cu.Sandbox(null, {});
- let errorFactories = [
- msg => { throw new context.cloneScope.Error(msg); },
- msg => context.cloneScope.Promise.reject({message: msg}),
- msg => Cu.evalInSandbox(`throw new Error("${msg}")`, otherSandbox),
- msg => Cu.evalInSandbox(`Promise.reject({message: "${msg}"})`, otherSandbox),
- ];
- for (let makeError of errorFactories) {
- do_print(`Testing callback/promise with error caused by: ${makeError}`);
- testnamespace = generateAPIs({
- isChromeCompat,
- }, {
- async_required() { return makeError("ONE"); },
- async_optional() { return makeError("TWO"); },
- });
-
- if (!isChromeCompat) { // No promises for chrome.
- yield Assert.rejects(testnamespace.async_required(), /ONE/,
- "should reject testnamespace.async_required()").catch(() => {});
- yield Assert.rejects(testnamespace.async_optional(), /TWO/,
- "should reject testnamespace.async_optional()").catch(() => {});
- }
-
- do_check_eq(yield* runFailCallback(testnamespace.async_required), "ONE");
- do_check_eq(yield* runFailCallback(testnamespace.async_optional), "TWO");
- }
- }
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_simple.js b/toolkit/components/webextensions/test/xpcshell/test_ext_simple.js
deleted file mode 100644
index 91b10354c6..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_simple.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-add_task(function* test_simple() {
- let extensionData = {
- manifest: {
- "name": "Simple extension test",
- "version": "1.0",
- "manifest_version": 2,
- "description": "",
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.unload();
-});
-
-add_task(function* test_background() {
- function background() {
- browser.test.log("running background script");
-
- browser.test.onMessage.addListener((x, y) => {
- browser.test.assertEq(x, 10, "x is 10");
- browser.test.assertEq(y, 20, "y is 20");
-
- browser.test.notifyPass("background test passed");
- });
-
- browser.test.sendMessage("running", 1);
- }
-
- let extensionData = {
- background,
- manifest: {
- "name": "Simple extension test",
- "version": "1.0",
- "manifest_version": 2,
- "description": "",
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
- equal(x, 1, "got correct value from extension");
-
- extension.sendMessage(10, 20);
- yield extension.awaitFinish();
- yield extension.unload();
-});
-
-add_task(function* test_extensionTypes() {
- let extensionData = {
- background: function() {
- browser.test.assertEq(typeof browser.extensionTypes, "object", "browser.extensionTypes exists");
- browser.test.assertEq(typeof browser.extensionTypes.RunAt, "object", "browser.extensionTypes.RunAt exists");
- browser.test.notifyPass("extentionTypes test passed");
- },
- };
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
-
- yield extension.startup();
- yield extension.awaitFinish();
- yield extension.unload();
-});
-
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_storage.js b/toolkit/components/webextensions/test/xpcshell/test_ext_storage.js
deleted file mode 100644
index df46dfb632..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_storage.js
+++ /dev/null
@@ -1,334 +0,0 @@
-/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set sts=2 sw=2 et tw=80: */
-"use strict";
-
-const STORAGE_SYNC_PREF = "webextensions.storage.sync.enabled";
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-/**
- * Utility function to ensure that all supported APIs for getting are
- * tested.
- *
- * @param {string} areaName
- * either "local" or "sync" according to what we want to test
- * @param {string} prop
- * "key" to look up using the storage API
- * @param {Object} value
- * "value" to compare against
- */
-async function checkGetImpl(areaName, prop, value) {
- let storage = browser.storage[areaName];
-
- let data = await storage.get(null);
- browser.test.assertEq(value, data[prop], `null getter worked for ${prop} in ${areaName}`);
-
- data = await storage.get(prop);
- browser.test.assertEq(value, data[prop], `string getter worked for ${prop} in ${areaName}`);
-
- data = await storage.get([prop]);
- browser.test.assertEq(value, data[prop], `array getter worked for ${prop} in ${areaName}`);
-
- data = await storage.get({[prop]: undefined});
- browser.test.assertEq(value, data[prop], `object getter worked for ${prop} in ${areaName}`);
-}
-
-add_task(function* test_local_cache_invalidation() {
- function background(checkGet) {
- browser.test.onMessage.addListener(async msg => {
- if (msg === "set-initial") {
- await browser.storage.local.set({"test-prop1": "value1", "test-prop2": "value2"});
- browser.test.sendMessage("set-initial-done");
- } else if (msg === "check") {
- await checkGet("local", "test-prop1", "value1");
- await checkGet("local", "test-prop2", "value2");
- browser.test.sendMessage("check-done");
- }
- });
-
- browser.test.sendMessage("ready");
- }
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["storage"],
- },
- background: `(${background})(${checkGetImpl})`,
- });
-
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- extension.sendMessage("set-initial");
- yield extension.awaitMessage("set-initial-done");
-
- Services.obs.notifyObservers(null, "extension-invalidate-storage-cache", "");
-
- extension.sendMessage("check");
- yield extension.awaitMessage("check-done");
-
- yield extension.unload();
-});
-
-add_task(function* test_config_flag_needed() {
- function background() {
- let promises = [];
- let apiTests = [
- {method: "get", args: ["foo"]},
- {method: "set", args: [{foo: "bar"}]},
- {method: "remove", args: ["foo"]},
- {method: "clear", args: []},
- ];
- apiTests.forEach(testDef => {
- promises.push(browser.test.assertRejects(
- browser.storage.sync[testDef.method](...testDef.args),
- "Please set webextensions.storage.sync.enabled to true in about:config",
- `storage.sync.${testDef.method} is behind a flag`));
- });
-
- Promise.all(promises).then(() => browser.test.notifyPass("flag needed"));
- }
-
- ok(!Preferences.get(STORAGE_SYNC_PREF));
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["storage"],
- },
- background: `(${background})(${checkGetImpl})`,
- });
-
- yield extension.startup();
- yield extension.awaitFinish("flag needed");
- yield extension.unload();
-});
-
-add_task(function* test_reloading_extensions_works() {
- // Just some random extension ID that we can re-use
- const extensionId = "my-extension-id@1";
-
- function loadExtension() {
- function background() {
- browser.storage.sync.set({"a": "b"}).then(() => {
- browser.test.notifyPass("set-works");
- });
- }
-
- return ExtensionTestUtils.loadExtension({
- manifest: {
- permissions: ["storage"],
- },
- background: `(${background})()`,
- }, extensionId);
- }
-
- Preferences.set(STORAGE_SYNC_PREF, true);
-
- let extension1 = loadExtension();
-
- yield extension1.startup();
- yield extension1.awaitFinish("set-works");
- yield extension1.unload();
-
- let extension2 = loadExtension();
-
- yield extension2.startup();
- yield extension2.awaitFinish("set-works");
- yield extension2.unload();
-
- Preferences.reset(STORAGE_SYNC_PREF);
-});
-
-do_register_cleanup(() => {
- Preferences.reset(STORAGE_SYNC_PREF);
-});
-
-add_task(function* test_backgroundScript() {
- async function backgroundScript(checkGet) {
- let globalChanges, gResolve;
- function clearGlobalChanges() {
- globalChanges = new Promise(resolve => { gResolve = resolve; });
- }
- clearGlobalChanges();
- let expectedAreaName;
-
- browser.storage.onChanged.addListener((changes, areaName) => {
- browser.test.assertEq(expectedAreaName, areaName,
- "Expected area name received by listener");
- gResolve(changes);
- });
-
- async function checkChanges(areaName, changes, message) {
- function checkSub(obj1, obj2) {
- for (let prop in obj1) {
- browser.test.assertTrue(obj1[prop] !== undefined,
- `checkChanges ${areaName} ${prop} is missing (${message})`);
- browser.test.assertTrue(obj2[prop] !== undefined,
- `checkChanges ${areaName} ${prop} is missing (${message})`);
- browser.test.assertEq(obj1[prop].oldValue, obj2[prop].oldValue,
- `checkChanges ${areaName} ${prop} old (${message})`);
- browser.test.assertEq(obj1[prop].newValue, obj2[prop].newValue,
- `checkChanges ${areaName} ${prop} new (${message})`);
- }
- }
-
- const recentChanges = await globalChanges;
- checkSub(changes, recentChanges);
- checkSub(recentChanges, changes);
- clearGlobalChanges();
- }
-
- /* eslint-disable dot-notation */
- async function runTests(areaName) {
- expectedAreaName = areaName;
- let storage = browser.storage[areaName];
- // Set some data and then test getters.
- try {
- await storage.set({"test-prop1": "value1", "test-prop2": "value2"});
- await checkChanges(areaName,
- {"test-prop1": {newValue: "value1"}, "test-prop2": {newValue: "value2"}},
- "set (a)");
-
- await checkGet(areaName, "test-prop1", "value1");
- await checkGet(areaName, "test-prop2", "value2");
-
- let data = await storage.get({"test-prop1": undefined, "test-prop2": undefined, "other": "default"});
- browser.test.assertEq("value1", data["test-prop1"], "prop1 correct (a)");
- browser.test.assertEq("value2", data["test-prop2"], "prop2 correct (a)");
- browser.test.assertEq("default", data["other"], "other correct");
-
- data = await storage.get(["test-prop1", "test-prop2", "other"]);
- browser.test.assertEq("value1", data["test-prop1"], "prop1 correct (b)");
- browser.test.assertEq("value2", data["test-prop2"], "prop2 correct (b)");
- browser.test.assertFalse("other" in data, "other correct");
-
- // Remove data in various ways.
- await storage.remove("test-prop1");
- await checkChanges(areaName, {"test-prop1": {oldValue: "value1"}}, "remove string");
-
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertFalse("test-prop1" in data, "prop1 absent (remove string)");
- browser.test.assertTrue("test-prop2" in data, "prop2 present (remove string)");
-
- await storage.set({"test-prop1": "value1"});
- await checkChanges(areaName, {"test-prop1": {newValue: "value1"}}, "set (c)");
-
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertEq(data["test-prop1"], "value1", "prop1 correct (c)");
- browser.test.assertEq(data["test-prop2"], "value2", "prop2 correct (c)");
-
- await storage.remove(["test-prop1", "test-prop2"]);
- await checkChanges(areaName,
- {"test-prop1": {oldValue: "value1"}, "test-prop2": {oldValue: "value2"}},
- "remove array");
-
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertFalse("test-prop1" in data, "prop1 absent (remove array)");
- browser.test.assertFalse("test-prop2" in data, "prop2 absent (remove array)");
-
- // test storage.clear
- await storage.set({"test-prop1": "value1", "test-prop2": "value2"});
- // Make sure that set() handler happened before we clear the
- // promise again.
- await globalChanges;
-
- clearGlobalChanges();
- await storage.clear();
-
- await checkChanges(areaName,
- {"test-prop1": {oldValue: "value1"}, "test-prop2": {oldValue: "value2"}},
- "clear");
- data = await storage.get(["test-prop1", "test-prop2"]);
- browser.test.assertFalse("test-prop1" in data, "prop1 absent (clear)");
- browser.test.assertFalse("test-prop2" in data, "prop2 absent (clear)");
-
- // Make sure we can store complex JSON data.
- // known previous values
- await storage.set({"test-prop1": "value1", "test-prop2": "value2"});
-
- // Make sure the set() handler landed.
- await globalChanges;
-
- clearGlobalChanges();
- await storage.set({
- "test-prop1": {
- str: "hello",
- bool: true,
- null: null,
- undef: undefined,
- obj: {},
- arr: [1, 2],
- date: new Date(0),
- regexp: /regexp/,
- func: function func() {},
- window,
- },
- });
-
- await storage.set({"test-prop2": function func() {}});
- const recentChanges = await globalChanges;
-
- browser.test.assertEq("value1", recentChanges["test-prop1"].oldValue, "oldValue correct");
- browser.test.assertEq("object", typeof(recentChanges["test-prop1"].newValue), "newValue is obj");
- clearGlobalChanges();
-
- data = await storage.get({"test-prop1": undefined, "test-prop2": undefined});
- let obj = data["test-prop1"];
-
- browser.test.assertEq("hello", obj.str, "string part correct");
- browser.test.assertEq(true, obj.bool, "bool part correct");
- browser.test.assertEq(null, obj.null, "null part correct");
- browser.test.assertEq(undefined, obj.undef, "undefined part correct");
- browser.test.assertEq(undefined, obj.func, "function part correct");
- browser.test.assertEq(undefined, obj.window, "window part correct");
- browser.test.assertEq("1970-01-01T00:00:00.000Z", obj.date, "date part correct");
- browser.test.assertEq("/regexp/", obj.regexp, "regexp part correct");
- browser.test.assertEq("object", typeof(obj.obj), "object part correct");
- browser.test.assertTrue(Array.isArray(obj.arr), "array part present");
- browser.test.assertEq(1, obj.arr[0], "arr[0] part correct");
- browser.test.assertEq(2, obj.arr[1], "arr[1] part correct");
- browser.test.assertEq(2, obj.arr.length, "arr.length part correct");
-
- obj = data["test-prop2"];
-
- browser.test.assertEq("[object Object]", {}.toString.call(obj), "function serialized as a plain object");
- browser.test.assertEq(0, Object.keys(obj).length, "function serialized as an empty object");
- } catch (e) {
- browser.test.fail(`Error: ${e} :: ${e.stack}`);
- browser.test.notifyFail("storage");
- }
- }
-
- browser.test.onMessage.addListener(msg => {
- let promise;
- if (msg === "test-local") {
- promise = runTests("local");
- } else if (msg === "test-sync") {
- promise = runTests("sync");
- }
- promise.then(() => browser.test.sendMessage("test-finished"));
- });
-
- browser.test.sendMessage("ready");
- }
-
- let extensionData = {
- background: `(${backgroundScript})(${checkGetImpl})`,
- manifest: {
- permissions: ["storage"],
- },
- };
-
- Preferences.set(STORAGE_SYNC_PREF, true);
-
- let extension = ExtensionTestUtils.loadExtension(extensionData);
- yield extension.startup();
- yield extension.awaitMessage("ready");
-
- extension.sendMessage("test-local");
- yield extension.awaitMessage("test-finished");
-
- extension.sendMessage("test-sync");
- yield extension.awaitMessage("test-finished");
-
- Preferences.reset(STORAGE_SYNC_PREF);
- yield extension.unload();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_ext_topSites.js b/toolkit/components/webextensions/test/xpcshell/test_ext_topSites.js
deleted file mode 100644
index eb3f552ed5..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_ext_topSites.js
+++ /dev/null
@@ -1,85 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/NewTabUtils.jsm");
-
-
-function TestProvider(getLinksFn) {
- this.getLinks = getLinksFn;
- this._observers = new Set();
-}
-
-TestProvider.prototype = {
- addObserver: function(observer) {
- this._observers.add(observer);
- },
- notifyLinkChanged: function(link, index = -1, deleted = false) {
- this._notifyObservers("onLinkChanged", link, index, deleted);
- },
- notifyManyLinksChanged: function() {
- this._notifyObservers("onManyLinksChanged");
- },
- _notifyObservers: function(observerMethodName, ...args) {
- args.unshift(this);
- for (let obs of this._observers) {
- if (obs[observerMethodName]) {
- obs[observerMethodName].apply(NewTabUtils.links, args);
- }
- }
- },
-};
-
-function makeLinks(links) {
- // Important: To avoid test failures due to clock jitter on Windows XP, call
- // Date.now() once here, not each time through the loop.
- let frecency = 0;
- let now = Date.now() * 1000;
- let places = [];
- links.map((link, i) => {
- places.push({
- url: link.url,
- title: link.title,
- lastVisitDate: now - i,
- frecency: frecency++,
- });
- });
- return places;
-}
-
-add_task(function* test_topSites() {
- let expect = [{url: "http://example.com/", title: "site#-1"},
- {url: "http://example0.com/", title: "site#0"},
- {url: "http://example1.com/", title: "site#1"},
- {url: "http://example2.com/", title: "site#2"},
- {url: "http://example3.com/", title: "site#3"}];
-
- let extension = ExtensionTestUtils.loadExtension({
- manifest: {
- "permissions": [
- "topSites",
- ],
- },
- background() {
- browser.topSites.get(result => {
- browser.test.sendMessage("done", result);
- });
- },
- });
-
-
- let expectedLinks = makeLinks(expect);
- let provider = new TestProvider(done => done(expectedLinks));
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
-
- yield NewTabUtils.links.populateCache();
-
- yield extension.startup();
-
- let result = yield extension.awaitMessage("done");
- Assert.deepEqual(expect, result, "got topSites");
-
- yield extension.unload();
-
- NewTabUtils.links.removeProvider(provider);
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_getAPILevelForWindow.js b/toolkit/components/webextensions/test/xpcshell/test_getAPILevelForWindow.js
deleted file mode 100644
index 68741a6cca..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_getAPILevelForWindow.js
+++ /dev/null
@@ -1,55 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/ExtensionManagement.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-function createWindowWithAddonId(addonId) {
- let baseURI = Services.io.newURI("about:blank", null, null);
- let originAttributes = {addonId};
- let principal = Services.scriptSecurityManager
- .createCodebasePrincipal(baseURI, originAttributes);
- let chromeNav = Services.appShell.createWindowlessBrowser(true);
- let interfaceRequestor = chromeNav.QueryInterface(Ci.nsIInterfaceRequestor);
- let docShell = interfaceRequestor.getInterface(Ci.nsIDocShell);
- docShell.createAboutBlankContentViewer(principal);
-
- return {chromeNav, window: docShell.contentViewer.DOMDocument.defaultView};
-}
-
-add_task(function* test_eventpages() {
- const {getAPILevelForWindow, getAddonIdForWindow} = ExtensionManagement;
- const {NO_PRIVILEGES, FULL_PRIVILEGES} = ExtensionManagement.API_LEVELS;
- const FAKE_ADDON_ID = "fakeAddonId";
- const OTHER_ADDON_ID = "otherFakeAddonId";
- const EMPTY_ADDON_ID = "";
-
- let fakeAddonId = createWindowWithAddonId(FAKE_ADDON_ID);
- equal(getAddonIdForWindow(fakeAddonId.window), FAKE_ADDON_ID,
- "the window has the expected addonId");
-
- let apiLevel = getAPILevelForWindow(fakeAddonId.window, FAKE_ADDON_ID);
- equal(apiLevel, FULL_PRIVILEGES,
- "apiLevel for the window with the right addonId should be FULL_PRIVILEGES");
-
- apiLevel = getAPILevelForWindow(fakeAddonId.window, OTHER_ADDON_ID);
- equal(apiLevel, NO_PRIVILEGES,
- "apiLevel for the window with a different addonId should be NO_PRIVILEGES");
-
- fakeAddonId.chromeNav.close();
-
- // NOTE: check that window with an empty addon Id (which are window that are
- // not Extensions pages) always get no WebExtensions APIs.
- let emptyAddonId = createWindowWithAddonId(EMPTY_ADDON_ID);
- equal(getAddonIdForWindow(emptyAddonId.window), EMPTY_ADDON_ID,
- "the window has the expected addonId");
-
- apiLevel = getAPILevelForWindow(emptyAddonId.window, EMPTY_ADDON_ID);
- equal(apiLevel, NO_PRIVILEGES,
- "apiLevel for empty addonId should be NO_PRIVILEGES");
-
- apiLevel = getAPILevelForWindow(emptyAddonId.window, OTHER_ADDON_ID);
- equal(apiLevel, NO_PRIVILEGES,
- "apiLevel for an 'empty addonId' window should be always NO_PRIVILEGES");
-
- emptyAddonId.chromeNav.close();
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_locale_converter.js b/toolkit/components/webextensions/test/xpcshell/test_locale_converter.js
deleted file mode 100644
index c8b1ee92ba..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_locale_converter.js
+++ /dev/null
@@ -1,133 +0,0 @@
-"use strict";
-
-const convService = Cc["@mozilla.org/streamConverters;1"]
- .getService(Ci.nsIStreamConverterService);
-
-const UUID = "72b61ee3-aceb-476c-be1b-0822b036c9f1";
-const ADDON_ID = "test@web.extension";
-const URI = NetUtil.newURI(`moz-extension://${UUID}/file.css`);
-
-const FROM_TYPE = "application/vnd.mozilla.webext.unlocalized";
-const TO_TYPE = "text/css";
-
-
-function StringStream(string) {
- let stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
-
- stream.data = string;
- return stream;
-}
-
-
-// Initialize the policy service with a stub localizer for our
-// add-on ID.
-add_task(function* init() {
- const aps = Cc["@mozilla.org/addons/policy-service;1"]
- .getService(Ci.nsIAddonPolicyService).wrappedJSObject;
-
- let oldCallback = aps.setExtensionURIToAddonIdCallback(uri => {
- if (uri.host == UUID) {
- return ADDON_ID;
- }
- });
-
- aps.setAddonLocalizeCallback(ADDON_ID, string => {
- return string.replace(/__MSG_(.*?)__/g, "<localized-$1>");
- });
-
- do_register_cleanup(() => {
- aps.setExtensionURIToAddonIdCallback(oldCallback);
- aps.setAddonLocalizeCallback(ADDON_ID, null);
- });
-});
-
-
-// Test that the synchronous converter works as expected with a
-// simple string.
-add_task(function* testSynchronousConvert() {
- let stream = StringStream("Foo __MSG_xxx__ bar __MSG_yyy__ baz");
-
- let resultStream = convService.convert(stream, FROM_TYPE, TO_TYPE, URI);
-
- let result = NetUtil.readInputStreamToString(resultStream, resultStream.available());
-
- equal(result, "Foo <localized-xxx> bar <localized-yyy> baz");
-});
-
-
-// Test that the asynchronous converter works as expected with input
-// split into multiple chunks, and a boundary in the middle of a
-// replacement token.
-add_task(function* testAsyncConvert() {
- let listener;
- let awaitResult = new Promise((resolve, reject) => {
- listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamListener]),
-
- onDataAvailable(request, context, inputStream, offset, count) {
- this.resultParts.push(NetUtil.readInputStreamToString(inputStream, count));
- },
-
- onStartRequest() {
- ok(!("resultParts" in this));
- this.resultParts = [];
- },
-
- onStopRequest(request, context, statusCode) {
- if (!Components.isSuccessCode(statusCode)) {
- reject(new Error(statusCode));
- }
-
- resolve(this.resultParts.join("\n"));
- },
- };
- });
-
- let parts = ["Foo __MSG_x", "xx__ bar __MSG_yyy__ baz"];
-
- let converter = convService.asyncConvertData(FROM_TYPE, TO_TYPE, listener, URI);
- converter.onStartRequest(null, null);
-
- for (let part of parts) {
- converter.onDataAvailable(null, null, StringStream(part), 0, part.length);
- }
-
- converter.onStopRequest(null, null, Cr.NS_OK);
-
-
- let result = yield awaitResult;
- equal(result, "Foo <localized-xxx> bar <localized-yyy> baz");
-});
-
-
-// Test that attempting to initialize a converter with the URI of a
-// nonexistent WebExtension fails.
-add_task(function* testInvalidUUID() {
- let uri = NetUtil.newURI("moz-extension://eb4f3be8-41c9-4970-aa6d-b84d1ecc02b2/file.css");
- let stream = StringStream("Foo __MSG_xxx__ bar __MSG_yyy__ baz");
-
- // Assert.throws raise a TypeError exception when the expected param
- // is an arrow function. (See Bug 1237961 for rationale)
- let expectInvalidContextException = function(e) {
- return e.result === Cr.NS_ERROR_INVALID_ARG && /Invalid context/.test(e);
- };
-
- Assert.throws(() => {
- convService.convert(stream, FROM_TYPE, TO_TYPE, uri);
- }, expectInvalidContextException);
-
- Assert.throws(() => {
- let listener = {QueryInterface: XPCOMUtils.generateQI([Ci.nsIStreamListener])};
-
- convService.asyncConvertData(FROM_TYPE, TO_TYPE, listener, uri);
- }, expectInvalidContextException);
-});
-
-
-// Test that an empty stream does not throw an NS_ERROR_ILLEGAL_VALUE.
-add_task(function* testEmptyStream() {
- let stream = StringStream("");
- let resultStream = convService.convert(stream, FROM_TYPE, TO_TYPE, URI);
- equal(resultStream.data, "");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_locale_data.js b/toolkit/components/webextensions/test/xpcshell/test_locale_data.js
deleted file mode 100644
index c3cd44e577..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_locale_data.js
+++ /dev/null
@@ -1,130 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/Extension.jsm");
-
-/* globals ExtensionData */
-
-const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
-
-function* generateAddon(data) {
- let id = uuidGenerator.generateUUID().number;
-
- data = Object.assign({embedded: true}, data);
- data.manifest = Object.assign({applications: {gecko: {id}}}, data.manifest);
-
- let xpi = Extension.generateXPI(data);
- do_register_cleanup(() => {
- Services.obs.notifyObservers(xpi, "flush-cache-entry", null);
- xpi.remove(false);
- });
-
- let fileURI = Services.io.newFileURI(xpi);
- let jarURI = NetUtil.newURI(`jar:${fileURI.spec}!/webextension/`);
-
- let extension = new ExtensionData(jarURI);
- yield extension.readManifest();
-
- return extension;
-}
-
-add_task(function* testMissingDefaultLocale() {
- let extension = yield generateAddon({
- "files": {
- "_locales/en_US/messages.json": {},
- },
- });
-
- equal(extension.errors.length, 0, "No errors reported");
-
- yield extension.initAllLocales();
-
- equal(extension.errors.length, 1, "One error reported");
-
- do_print(`Got error: ${extension.errors[0]}`);
-
- ok(extension.errors[0].includes('"default_locale" property is required'),
- "Got missing default_locale error");
-});
-
-
-add_task(function* testInvalidDefaultLocale() {
- let extension = yield generateAddon({
- "manifest": {
- "default_locale": "en",
- },
-
- "files": {
- "_locales/en_US/messages.json": {},
- },
- });
-
- equal(extension.errors.length, 1, "One error reported");
-
- do_print(`Got error: ${extension.errors[0]}`);
-
- ok(extension.errors[0].includes("Loading locale file _locales/en/messages.json"),
- "Got invalid default_locale error");
-
- yield extension.initAllLocales();
-
- equal(extension.errors.length, 2, "Two errors reported");
-
- do_print(`Got error: ${extension.errors[1]}`);
-
- ok(extension.errors[1].includes('"default_locale" property must correspond'),
- "Got invalid default_locale error");
-});
-
-
-add_task(function* testUnexpectedDefaultLocale() {
- let extension = yield generateAddon({
- "manifest": {
- "default_locale": "en_US",
- },
- });
-
- equal(extension.errors.length, 1, "One error reported");
-
- do_print(`Got error: ${extension.errors[0]}`);
-
- ok(extension.errors[0].includes("Loading locale file _locales/en-US/messages.json"),
- "Got invalid default_locale error");
-
- yield extension.initAllLocales();
-
- equal(extension.errors.length, 2, "One error reported");
-
- do_print(`Got error: ${extension.errors[1]}`);
-
- ok(extension.errors[1].includes('"default_locale" property must correspond'),
- "Got unexpected default_locale error");
-});
-
-
-add_task(function* testInvalidSyntax() {
- let extension = yield generateAddon({
- "manifest": {
- "default_locale": "en_US",
- },
-
- "files": {
- "_locales/en_US/messages.json": '{foo: {message: "bar", description: "baz"}}',
- },
- });
-
- equal(extension.errors.length, 1, "No errors reported");
-
- do_print(`Got error: ${extension.errors[0]}`);
-
- ok(extension.errors[0].includes("Loading locale file _locales\/en_US\/messages\.json: SyntaxError"),
- "Got syntax error");
-
- yield extension.initAllLocales();
-
- equal(extension.errors.length, 2, "One error reported");
-
- do_print(`Got error: ${extension.errors[1]}`);
-
- ok(extension.errors[1].includes("Loading locale file _locales\/en_US\/messages\.json: SyntaxError"),
- "Got syntax error");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/test_native_messaging.js b/toolkit/components/webextensions/test/xpcshell/test_native_messaging.js
deleted file mode 100644
index 1fcb7799ed..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/test_native_messaging.js
+++ /dev/null
@@ -1,302 +0,0 @@
-"use strict";
-
-/* global OS, HostManifestManager, NativeApp */
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-Cu.import("resource://gre/modules/ExtensionCommon.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Schemas.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-const {Subprocess, SubprocessImpl} = Cu.import("resource://gre/modules/Subprocess.jsm");
-Cu.import("resource://gre/modules/NativeMessaging.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-let registry = null;
-if (AppConstants.platform == "win") {
- Cu.import("resource://testing-common/MockRegistry.jsm");
- registry = new MockRegistry();
- do_register_cleanup(() => {
- registry.shutdown();
- });
-}
-
-const REGPATH = "Software\\Mozilla\\NativeMessagingHosts";
-
-const BASE_SCHEMA = "chrome://extensions/content/schemas/manifest.json";
-
-let dir = FileUtils.getDir("TmpD", ["NativeMessaging"]);
-dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
-let userDir = dir.clone();
-userDir.append("user");
-userDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
-let globalDir = dir.clone();
-globalDir.append("global");
-globalDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
-let dirProvider = {
- getFile(property) {
- if (property == "XREUserNativeMessaging") {
- return userDir.clone();
- } else if (property == "XRESysNativeMessaging") {
- return globalDir.clone();
- }
- return null;
- },
-};
-
-Services.dirsvc.registerProvider(dirProvider);
-
-do_register_cleanup(() => {
- Services.dirsvc.unregisterProvider(dirProvider);
- dir.remove(true);
-});
-
-function writeManifest(path, manifest) {
- if (typeof manifest != "string") {
- manifest = JSON.stringify(manifest);
- }
- return OS.File.writeAtomic(path, manifest);
-}
-
-let PYTHON;
-add_task(function* setup() {
- yield Schemas.load(BASE_SCHEMA);
-
- PYTHON = yield Subprocess.pathSearch("python2.7");
- if (PYTHON == null) {
- PYTHON = yield Subprocess.pathSearch("python");
- }
- notEqual(PYTHON, null, "Found a suitable python interpreter");
-});
-
-let global = this;
-
-// Test of HostManifestManager.lookupApplication() begin here...
-let context = {
- url: null,
- jsonStringify(...args) { return JSON.stringify(...args); },
- cloneScope: global,
- logError() {},
- preprocessors: {},
- callOnClose: () => {},
- forgetOnClose: () => {},
-};
-
-class MockContext extends ExtensionCommon.BaseContext {
- constructor(extensionId) {
- let fakeExtension = {id: extensionId};
- super("testEnv", fakeExtension);
- this.sandbox = Cu.Sandbox(global);
- }
-
- get cloneScope() {
- return global;
- }
-
- get principal() {
- return Cu.getObjectPrincipal(this.sandbox);
- }
-}
-
-let templateManifest = {
- name: "test",
- description: "this is only a test",
- path: "/bin/cat",
- type: "stdio",
- allowed_extensions: ["extension@tests.mozilla.org"],
-};
-
-add_task(function* test_nonexistent_manifest() {
- let result = yield HostManifestManager.lookupApplication("test", context);
- equal(result, null, "lookupApplication returns null for non-existent application");
-});
-
-const USER_TEST_JSON = OS.Path.join(userDir.path, "test.json");
-
-add_task(function* test_good_manifest() {
- yield writeManifest(USER_TEST_JSON, templateManifest);
- if (registry) {
- registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- `${REGPATH}\\test`, "", USER_TEST_JSON);
- }
-
- let result = yield HostManifestManager.lookupApplication("test", context);
- notEqual(result, null, "lookupApplication finds a good manifest");
- equal(result.path, USER_TEST_JSON, "lookupApplication returns the correct path");
- deepEqual(result.manifest, templateManifest, "lookupApplication returns the manifest contents");
-});
-
-add_task(function* test_invalid_json() {
- yield writeManifest(USER_TEST_JSON, "this is not valid json");
- let result = yield HostManifestManager.lookupApplication("test", context);
- equal(result, null, "lookupApplication ignores bad json");
-});
-
-add_task(function* test_invalid_name() {
- let manifest = Object.assign({}, templateManifest);
- manifest.name = "../test";
- yield writeManifest(USER_TEST_JSON, manifest);
- let result = yield HostManifestManager.lookupApplication("test", context);
- equal(result, null, "lookupApplication ignores an invalid name");
-});
-
-add_task(function* test_name_mismatch() {
- let manifest = Object.assign({}, templateManifest);
- manifest.name = "not test";
- yield writeManifest(USER_TEST_JSON, manifest);
- let result = yield HostManifestManager.lookupApplication("test", context);
- let what = (AppConstants.platform == "win") ? "registry key" : "json filename";
- equal(result, null, `lookupApplication ignores mistmatch between ${what} and name property`);
-});
-
-add_task(function* test_missing_props() {
- const PROPS = [
- "name",
- "description",
- "path",
- "type",
- "allowed_extensions",
- ];
- for (let prop of PROPS) {
- let manifest = Object.assign({}, templateManifest);
- delete manifest[prop];
-
- yield writeManifest(USER_TEST_JSON, manifest);
- let result = yield HostManifestManager.lookupApplication("test", context);
- equal(result, null, `lookupApplication ignores missing ${prop}`);
- }
-});
-
-add_task(function* test_invalid_type() {
- let manifest = Object.assign({}, templateManifest);
- manifest.type = "bogus";
- yield writeManifest(USER_TEST_JSON, manifest);
- let result = yield HostManifestManager.lookupApplication("test", context);
- equal(result, null, "lookupApplication ignores invalid type");
-});
-
-add_task(function* test_no_allowed_extensions() {
- let manifest = Object.assign({}, templateManifest);
- manifest.allowed_extensions = [];
- yield writeManifest(USER_TEST_JSON, manifest);
- let result = yield HostManifestManager.lookupApplication("test", context);
- equal(result, null, "lookupApplication ignores manifest with no allowed_extensions");
-});
-
-const GLOBAL_TEST_JSON = OS.Path.join(globalDir.path, "test.json");
-let globalManifest = Object.assign({}, templateManifest);
-globalManifest.description = "This manifest is from the systemwide directory";
-
-add_task(function* good_manifest_system_dir() {
- yield OS.File.remove(USER_TEST_JSON);
- yield writeManifest(GLOBAL_TEST_JSON, globalManifest);
- if (registry) {
- registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- `${REGPATH}\\test`, "", null);
- registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
- `${REGPATH}\\test`, "", GLOBAL_TEST_JSON);
- }
-
- let where = (AppConstants.platform == "win") ? "registry location" : "directory";
- let result = yield HostManifestManager.lookupApplication("test", context);
- notEqual(result, null, `lookupApplication finds a manifest in the system-wide ${where}`);
- equal(result.path, GLOBAL_TEST_JSON, `lookupApplication returns path in the system-wide ${where}`);
- deepEqual(result.manifest, globalManifest, `lookupApplication returns manifest contents from the system-wide ${where}`);
-});
-
-add_task(function* test_user_dir_precedence() {
- yield writeManifest(USER_TEST_JSON, templateManifest);
- if (registry) {
- registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- `${REGPATH}\\test`, "", USER_TEST_JSON);
- }
- // global test.json and LOCAL_MACHINE registry key on windows are
- // still present from the previous test
-
- let result = yield HostManifestManager.lookupApplication("test", context);
- notEqual(result, null, "lookupApplication finds a manifest when entries exist in both user-specific and system-wide locations");
- equal(result.path, USER_TEST_JSON, "lookupApplication returns the user-specific path when user-specific and system-wide entries both exist");
- deepEqual(result.manifest, templateManifest, "lookupApplication returns user-specific manifest contents with user-specific and system-wide entries both exist");
-});
-
-// Test shutdown handling in NativeApp
-add_task(function* test_native_app_shutdown() {
- const SCRIPT = String.raw`
-import signal
-import struct
-import sys
-
-signal.signal(signal.SIGTERM, signal.SIG_IGN)
-
-while True:
- rawlen = sys.stdin.read(4)
- if len(rawlen) == 0:
- signal.pause()
- msglen = struct.unpack('@I', rawlen)[0]
- msg = sys.stdin.read(msglen)
-
- sys.stdout.write(struct.pack('@I', msglen))
- sys.stdout.write(msg)
- `;
-
- let scriptPath = OS.Path.join(userDir.path, "wontdie.py");
- let manifestPath = OS.Path.join(userDir.path, "wontdie.json");
-
- const ID = "native@tests.mozilla.org";
- let manifest = {
- name: "wontdie",
- description: "test async shutdown of native apps",
- type: "stdio",
- allowed_extensions: [ID],
- };
-
- if (AppConstants.platform == "win") {
- yield OS.File.writeAtomic(scriptPath, SCRIPT);
-
- let batPath = OS.Path.join(userDir.path, "wontdie.bat");
- let batBody = `@ECHO OFF\n${PYTHON} -u "${scriptPath}" %*\n`;
- yield OS.File.writeAtomic(batPath, batBody);
- yield OS.File.setPermissions(batPath, {unixMode: 0o755});
-
- manifest.path = batPath;
- yield writeManifest(manifestPath, manifest);
-
- registry.setValue(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- `${REGPATH}\\wontdie`, "", manifestPath);
- } else {
- yield OS.File.writeAtomic(scriptPath, `#!${PYTHON} -u\n${SCRIPT}`);
- yield OS.File.setPermissions(scriptPath, {unixMode: 0o755});
- manifest.path = scriptPath;
- yield writeManifest(manifestPath, manifest);
- }
-
- let mockContext = new MockContext(ID);
- let app = new NativeApp(mockContext, "wontdie");
-
- // send a message and wait for the reply to make sure the app is running
- let MSG = "test";
- let recvPromise = new Promise(resolve => {
- let listener = (what, msg) => {
- equal(msg, MSG, "Received test message");
- app.off("message", listener);
- resolve();
- };
- app.on("message", listener);
- });
-
- let buffer = NativeApp.encodeMessage(mockContext, MSG);
- app.send(buffer);
- yield recvPromise;
-
- app._cleanup();
-
- do_print("waiting for async shutdown");
- Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
- AsyncShutdown.profileBeforeChange._trigger();
- Services.prefs.clearUserPref("toolkit.asyncshutdown.testing");
-
- let procs = yield SubprocessImpl.Process.getWorker().call("getProcesses", []);
- equal(procs.size, 0, "native process exited");
-});
diff --git a/toolkit/components/webextensions/test/xpcshell/xpcshell.ini b/toolkit/components/webextensions/test/xpcshell/xpcshell.ini
deleted file mode 100644
index d2c6fd5d07..0000000000
--- a/toolkit/components/webextensions/test/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,69 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-firefox-appdir = browser
-skip-if = appname == "thunderbird"
-support-files =
- data/** head_sync.js
-tags = webextensions
-
-[test_csp_custom_policies.js]
-[test_csp_validator.js]
-[test_ext_alarms.js]
-[test_ext_alarms_does_not_fire.js]
-[test_ext_alarms_periodic.js]
-[test_ext_alarms_replaces.js]
-[test_ext_apimanager.js]
-[test_ext_api_permissions.js]
-[test_ext_background_generated_load_events.js]
-[test_ext_background_generated_reload.js]
-[test_ext_background_global_history.js]
-skip-if = os == "android" # Android does not use Places for history.
-[test_ext_background_private_browsing.js]
-[test_ext_background_runtime_connect_params.js]
-[test_ext_background_sub_windows.js]
-[test_ext_background_window_properties.js]
-skip-if = os == "android"
-[test_ext_contexts.js]
-[test_ext_downloads.js]
-[test_ext_downloads_download.js]
-skip-if = os == "android"
-[test_ext_downloads_misc.js]
-skip-if = os == "android"
-[test_ext_downloads_search.js]
-skip-if = os == "android"
-[test_ext_experiments.js]
-skip-if = release_or_beta
-[test_ext_extension.js]
-[test_ext_idle.js]
-[test_ext_json_parser.js]
-[test_ext_localStorage.js]
-[test_ext_management.js]
-[test_ext_management_uninstall_self.js]
-[test_ext_manifest_content_security_policy.js]
-[test_ext_manifest_incognito.js]
-[test_ext_manifest_minimum_chrome_version.js]
-[test_ext_onmessage_removelistener.js]
-[test_ext_runtime_connect_no_receiver.js]
-[test_ext_runtime_getBrowserInfo.js]
-[test_ext_runtime_getPlatformInfo.js]
-[test_ext_runtime_onInstalled_and_onStartup.js]
-[test_ext_runtime_sendMessage.js]
-[test_ext_runtime_sendMessage_errors.js]
-[test_ext_runtime_sendMessage_no_receiver.js]
-[test_ext_runtime_sendMessage_self.js]
-[test_ext_schemas.js]
-[test_ext_schemas_api_injection.js]
-[test_ext_schemas_async.js]
-[test_ext_schemas_allowed_contexts.js]
-[test_ext_simple.js]
-[test_ext_storage.js]
-[test_ext_topSites.js]
-skip-if = os == "android"
-[test_getAPILevelForWindow.js]
-[test_ext_legacy_extension_context.js]
-[test_ext_legacy_extension_embedding.js]
-[test_locale_converter.js]
-[test_locale_data.js]
-[test_native_messaging.js]
-skip-if = os == "android"
diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml
index a30ff1c43c..9c72e86d88 100644
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -43,15 +43,11 @@
<parameter name="fn"/>
<body>
<![CDATA[
- if (!this.isRemoteBrowser) {
- this.inLoadURI = true;
- try {
- fn();
- } finally {
- this.inLoadURI = false;
- }
- } else {
+ this.inLoadURI = true;
+ try {
fn();
+ } finally {
+ this.inLoadURI = false;
}
]]>
</body>
@@ -307,7 +303,7 @@
<method name="preserveLayers">
<parameter name="preserve"/>
<body>
- // Only useful for remote browsers.
+ <!-- Only useful for remote browsers. -->
</body>
</method>
@@ -338,8 +334,9 @@
</getter>
</property>
+ <!-- stubbed to false until all callers are removed -->
<property name="isRemoteBrowser"
- onget="return (this.getAttribute('remote') == 'true');"
+ onget="return false;"
readonly="true"/>
<property name="messageManager"
@@ -899,6 +896,10 @@
<field name="mIconURL">null</field>
+ <property name="isAuthDOSProtected"
+ onget="return (this.getAttribute('authdosprotected') == 'true');"
+ readonly="true"/>
+
<!-- This is managed by the tabbrowser -->
<field name="lastURI">null</field>
@@ -916,7 +917,7 @@
os.addObserver(this, "browser:purge-session-history", true);
// enable global history if we weren't told otherwise
- if (!this.hasAttribute("disableglobalhistory") && !this.isRemoteBrowser) {
+ if (!this.hasAttribute("disableglobalhistory")) {
try {
this.docShell.useGlobalHistory = true;
} catch (ex) {
@@ -945,9 +946,7 @@
this.relatedBrowser = relatedBrowser;
}
- if (!this.isRemoteBrowser) {
- this.addEventListener("pagehide", this.onPageHide, true);
- }
+ this.addEventListener("pagehide", this.onPageHide, true);
if (this.messageManager) {
this.messageManager.addMessageListener("PopupBlocking:UpdateBlockedPopups", this);
@@ -996,9 +995,7 @@
this.lastURI = null;
- if (!this.isRemoteBrowser) {
- this.removeEventListener("pagehide", this.onPageHide, true);
- }
+ this.removeEventListener("pagehide", this.onPageHide, true);
if (this._autoScrollNeedsCleanup) {
// we polluted the global scope, so clean it up
@@ -1284,9 +1281,6 @@
<parameter name="aOtherBrowser"/>
<body>
<![CDATA[
- if (this.isRemoteBrowser != aOtherBrowser.isRemoteBrowser)
- throw new Error("Can only swap docshells between browsers in the same process.");
-
// Give others a chance to swap state.
// IMPORTANT: Since a swapDocShells call does not swap the messageManager
// instances attached to a browser to aOtherBrowser, others
@@ -1320,28 +1314,6 @@
"_webNavigation"
];
- if (this.isRemoteBrowser) {
- fieldsToSwap.push(...[
- "_remoteWebNavigation",
- "_remoteWebNavigationImpl",
- "_remoteWebProgressManager",
- "_remoteWebProgress",
- "_remoteFinder",
- "_securityUI",
- "_documentURI",
- "_documentContentType",
- "_contentTitle",
- "_characterSet",
- "_contentPrincipal",
- "_imageDocument",
- "_fullZoom",
- "_textZoom",
- "_isSyntheticDocument",
- "_innerWindowID",
- "_manifestURI",
- ]);
- }
-
var ourFieldValues = {};
var otherFieldValues = {};
for (let field of fieldsToSwap) {
@@ -1364,27 +1336,10 @@
aOtherBrowser[field] = ourFieldValues[field];
}
- if (!this.isRemoteBrowser) {
- // Null the current nsITypeAheadFind instances so that they're
- // lazily re-created on access. We need to do this because they
- // might have attached the wrong docShell.
- this._fastFind = aOtherBrowser._fastFind = null;
- }
- else {
- // Rewire the remote listeners
- this._remoteWebNavigationImpl.swapBrowser(this);
- aOtherBrowser._remoteWebNavigationImpl.swapBrowser(aOtherBrowser);
-
- if (this._remoteWebProgressManager && aOtherBrowser._remoteWebProgressManager) {
- this._remoteWebProgressManager.swapBrowser(this);
- aOtherBrowser._remoteWebProgressManager.swapBrowser(aOtherBrowser);
- }
-
- if (this._remoteFinder)
- this._remoteFinder.swapBrowser(this);
- if (aOtherBrowser._remoteFinder)
- aOtherBrowser._remoteFinder.swapBrowser(aOtherBrowser);
- }
+ // Null the current nsITypeAheadFind instances so that they're
+ // lazily re-created on access. We need to do this because they
+ // might have attached the wrong docShell.
+ this._fastFind = aOtherBrowser._fastFind = null;
event = new CustomEvent("EndSwapDocShells", {"detail": aOtherBrowser});
this.dispatchEvent(event);
@@ -1536,11 +1491,6 @@
event.preventDefault();
}
- // No need to handle "dragover" in e10s, since nsDocShellTreeOwner.cpp in the child process
- // handles that case using "@mozilla.org/content/dropped-link-handler;1" service.
- if (this.isRemoteBrowser)
- return;
-
let linkHandler = Components.classes["@mozilla.org/content/dropped-link-handler;1"].
getService(Components.interfaces.nsIDroppedLinkHandler);
if (linkHandler.canDropLink(event, false))
@@ -1549,9 +1499,7 @@
</handler>
<handler event="drop" group="system">
<![CDATA[
- // No need to handle "drop" in e10s, since nsDocShellTreeOwner.cpp in the child process
- // handles that case using "@mozilla.org/content/dropped-link-handler;1" service.
- if (!this.droppedLinkHandler || event.defaultPrevented || this.isRemoteBrowser)
+ if (!this.droppedLinkHandler || event.defaultPrevented)
return;
let name = { };
diff --git a/toolkit/crashreporter/CrashReports.jsm b/toolkit/crashreporter/CrashReports.jsm
deleted file mode 100644
index d34d6795e8..0000000000
--- a/toolkit/crashreporter/CrashReports.jsm
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-this.EXPORTED_SYMBOLS = [
- "CrashReports"
-];
-
-this.CrashReports = {
- pendingDir: null,
- reportsDir: null,
- submittedDir: null,
- getReports: function CrashReports_getReports()
- {
- let reports = [];
-
- try {
- // Ignore any non http/https urls
- if (!/^https?:/i.test(Services.prefs.getCharPref("breakpad.reportURL")))
- return reports;
- }
- catch (e) { }
-
- if (this.submittedDir.exists() && this.submittedDir.isDirectory()) {
- let entries = this.submittedDir.directoryEntries;
- while (entries.hasMoreElements()) {
- let file = entries.getNext().QueryInterface(Components.interfaces.nsIFile);
- let leaf = file.leafName;
- if (leaf.startsWith("bp-") &&
- leaf.endsWith(".txt")) {
- let entry = {
- id: leaf.slice(0, -4),
- date: file.lastModifiedTime,
- pending: false
- };
- reports.push(entry);
- }
- }
- }
-
- if (this.pendingDir.exists() && this.pendingDir.isDirectory()) {
- let uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
- let entries = this.pendingDir.directoryEntries;
- while (entries.hasMoreElements()) {
- let file = entries.getNext().QueryInterface(Components.interfaces.nsIFile);
- let leaf = file.leafName;
- let id = leaf.slice(0, -4);
- if (leaf.endsWith(".dmp") && uuidRegex.test(id)) {
- let entry = {
- id: id,
- date: file.lastModifiedTime,
- pending: true
- };
- reports.push(entry);
- }
- }
- }
-
- // Sort reports descending by date
- return reports.sort( (a, b) => b.date - a.date);
- }
-}
-
-function CrashReports_pendingDir()
-{
- let pendingDir = Services.dirsvc.get("UAppData", Components.interfaces.nsIFile);
- pendingDir.append("Crash Reports");
- pendingDir.append("pending");
- return pendingDir;
-}
-
-function CrashReports_reportsDir()
-{
- let reportsDir = Services.dirsvc.get("UAppData", Components.interfaces.nsIFile);
- reportsDir.append("Crash Reports");
- return reportsDir;
-}
-
-function CrashReports_submittedDir()
-{
- let submittedDir = Services.dirsvc.get("UAppData", Components.interfaces.nsIFile);
- submittedDir.append("Crash Reports");
- submittedDir.append("submitted");
- return submittedDir;
-}
-
-this.CrashReports.pendingDir = CrashReports_pendingDir();
-this.CrashReports.reportsDir = CrashReports_reportsDir();
-this.CrashReports.submittedDir = CrashReports_submittedDir();
diff --git a/toolkit/crashreporter/CrashSubmit.jsm b/toolkit/crashreporter/CrashSubmit.jsm
deleted file mode 100644
index 76eafbdad1..0000000000
--- a/toolkit/crashreporter/CrashSubmit.jsm
+++ /dev/null
@@ -1,570 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/KeyValueParser.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.importGlobalProperties(['File']);
-
-XPCOMUtils.defineLazyModuleGetter(this, "PromiseUtils",
- "resource://gre/modules/PromiseUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-this.EXPORTED_SYMBOLS = [
- "CrashSubmit"
-];
-
-const STATE_START = Ci.nsIWebProgressListener.STATE_START;
-const STATE_STOP = Ci.nsIWebProgressListener.STATE_STOP;
-
-const SUCCESS = "success";
-const FAILED = "failed";
-const SUBMITTING = "submitting";
-
-const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
-
-function parseINIStrings(file) {
- var factory = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
- getService(Ci.nsIINIParserFactory);
- var parser = factory.createINIParser(file);
- var obj = {};
- var en = parser.getKeys("Strings");
- while (en.hasMore()) {
- var key = en.getNext();
- obj[key] = parser.getString("Strings", key);
- }
- return obj;
-}
-
-// Since we're basically re-implementing part of the crashreporter
-// client here, we'll just steal the strings we need from crashreporter.ini
-function getL10nStrings() {
- let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
- let path = dirSvc.get("GreD", Ci.nsIFile);
- path.append("crashreporter.ini");
- if (!path.exists()) {
- // see if we're on a mac
- path = path.parent;
- path = path.parent;
- path.append("MacOS");
- path.append("crashreporter.app");
- path.append("Contents");
- path.append("Resources");
- path.append("crashreporter.ini");
- if (!path.exists()) {
- // very bad, but I don't know how to recover
- return null;
- }
- }
- let crstrings = parseINIStrings(path);
- let strings = {
- 'crashid': crstrings.CrashID,
- 'reporturl': crstrings.CrashDetailsURL
- };
-
- path = dirSvc.get("XCurProcD", Ci.nsIFile);
- path.append("crashreporter-override.ini");
- if (path.exists()) {
- crstrings = parseINIStrings(path);
- if ('CrashID' in crstrings)
- strings['crashid'] = crstrings.CrashID;
- if ('CrashDetailsURL' in crstrings)
- strings['reporturl'] = crstrings.CrashDetailsURL;
- }
- return strings;
-}
-
-XPCOMUtils.defineLazyGetter(this, "strings", getL10nStrings);
-
-function getDir(name) {
- let directoryService = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
- let dir = directoryService.get("UAppData", Ci.nsIFile);
- dir.append("Crash Reports");
- dir.append(name);
- return dir;
-}
-
-function writeFile(dirName, fileName, data) {
- let path = getDir(dirName);
- if (!path.exists())
- path.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt('0700', 8));
- path.append(fileName);
- var fs = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- // open, write, truncate
- fs.init(path, -1, -1, 0);
- var os = Cc["@mozilla.org/intl/converter-output-stream;1"].
- createInstance(Ci.nsIConverterOutputStream);
- os.init(fs, "UTF-8", 0, 0x0000);
- os.writeString(data);
- os.close();
- fs.close();
-}
-
-function getPendingMinidump(id) {
- let pendingDir = getDir("pending");
- let dump = pendingDir.clone();
- let extra = pendingDir.clone();
- let memory = pendingDir.clone();
- dump.append(id + ".dmp");
- extra.append(id + ".extra");
- memory.append(id + ".memory.json.gz");
- return [dump, extra, memory];
-}
-
-function getAllPendingMinidumpsIDs() {
- let minidumps = [];
- let pendingDir = getDir("pending");
-
- if (!(pendingDir.exists() && pendingDir.isDirectory()))
- return [];
- let entries = pendingDir.directoryEntries;
-
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsIFile);
- if (entry.isFile()) {
- let matches = entry.leafName.match(/(.+)\.extra$/);
- if (matches)
- minidumps.push(matches[1]);
- }
- }
-
- return minidumps;
-}
-
-function pruneSavedDumps() {
- const KEEP = 10;
-
- let pendingDir = getDir("pending");
- if (!(pendingDir.exists() && pendingDir.isDirectory()))
- return;
- let entries = pendingDir.directoryEntries;
- let entriesArray = [];
-
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsIFile);
- if (entry.isFile()) {
- let matches = entry.leafName.match(/(.+)\.extra$/);
- if (matches)
- entriesArray.push(entry);
- }
- }
-
- entriesArray.sort(function(a, b) {
- let dateA = a.lastModifiedTime;
- let dateB = b.lastModifiedTime;
- if (dateA < dateB)
- return -1;
- if (dateB < dateA)
- return 1;
- return 0;
- });
-
- if (entriesArray.length > KEEP) {
- for (let i = 0; i < entriesArray.length - KEEP; ++i) {
- let extra = entriesArray[i];
- let matches = extra.leafName.match(/(.+)\.extra$/);
- if (matches) {
- let dump = extra.clone();
- dump.leafName = matches[1] + '.dmp';
- dump.remove(false);
-
- let memory = extra.clone();
- memory.leafName = matches[1] + '.memory.json.gz';
- if (memory.exists()) {
- memory.remove(false);
- }
-
- extra.remove(false);
- }
- }
- }
-}
-
-function addFormEntry(doc, form, name, value) {
- var input = doc.createElement("input");
- input.type = "hidden";
- input.name = name;
- input.value = value;
- form.appendChild(input);
-}
-
-function writeSubmittedReport(crashID, viewURL) {
- var data = strings.crashid.replace("%s", crashID);
- if (viewURL)
- data += "\n" + strings.reporturl.replace("%s", viewURL);
-
- writeFile("submitted", crashID + ".txt", data);
-}
-
-// the Submitter class represents an individual submission.
-function Submitter(id, recordSubmission, noThrottle, extraExtraKeyVals) {
- this.id = id;
- this.recordSubmission = recordSubmission;
- this.noThrottle = noThrottle;
- this.additionalDumps = [];
- this.extraKeyVals = extraExtraKeyVals || {};
- this.deferredSubmit = PromiseUtils.defer();
-}
-
-Submitter.prototype = {
- submitSuccess: function Submitter_submitSuccess(ret)
- {
- // Write out the details file to submitted/
- writeSubmittedReport(ret.CrashID, ret.ViewURL);
-
- // Delete from pending dir
- try {
- this.dump.remove(false);
- this.extra.remove(false);
-
- if (this.memory) {
- this.memory.remove(false);
- }
-
- for (let i of this.additionalDumps) {
- i.dump.remove(false);
- }
- }
- catch (ex) {
- // report an error? not much the user can do here.
- }
-
- this.notifyStatus(SUCCESS, ret);
- this.cleanup();
- },
-
- cleanup: function Submitter_cleanup() {
- // drop some references just to be nice
- this.iframe = null;
- this.dump = null;
- this.extra = null;
- this.memory = null;
- this.additionalDumps = null;
- // remove this object from the list of active submissions
- let idx = CrashSubmit._activeSubmissions.indexOf(this);
- if (idx != -1)
- CrashSubmit._activeSubmissions.splice(idx, 1);
- },
-
- submitForm: function Submitter_submitForm()
- {
- if (!('ServerURL' in this.extraKeyVals)) {
- return false;
- }
- let serverURL = this.extraKeyVals.ServerURL;
-
- // Override the submission URL from the environment
-
- var envOverride = Cc['@mozilla.org/process/environment;1'].
- getService(Ci.nsIEnvironment).get("MOZ_CRASHREPORTER_URL");
- if (envOverride != '') {
- serverURL = envOverride;
- }
-
- let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open("POST", serverURL, true);
-
- let formData = Cc["@mozilla.org/files/formdata;1"]
- .createInstance(Ci.nsIDOMFormData);
- // add the data
- for (let [name, value] of Object.entries(this.extraKeyVals)) {
- if (name != "ServerURL") {
- formData.append(name, value);
- }
- }
- if (this.noThrottle) {
- // tell the server not to throttle this, since it was manually submitted
- formData.append("Throttleable", "0");
- }
- // add the minidumps
- formData.append("upload_file_minidump", File.createFromFileName(this.dump.path));
- if (this.memory) {
- formData.append("memory_report", File.createFromFileName(this.memory.path));
- }
- if (this.additionalDumps.length > 0) {
- let names = [];
- for (let i of this.additionalDumps) {
- names.push(i.name);
- formData.append("upload_file_minidump_"+i.name,
- File.createFromFileName(i.dump.path));
- }
- }
-
- let manager = Services.crashmanager;
- let submissionID = manager.generateSubmissionID();
-
- xhr.addEventListener("readystatechange", (evt) => {
- if (xhr.readyState == 4) {
- let ret =
- xhr.status == 200 ? parseKeyValuePairs(xhr.responseText) : {};
- let submitted = !!ret.CrashID;
-
- if (this.recordSubmission) {
- let result = submitted ? manager.SUBMISSION_RESULT_OK :
- manager.SUBMISSION_RESULT_FAILED;
- manager.addSubmissionResult(this.id, submissionID, new Date(),
- result);
- if (submitted) {
- manager.setRemoteCrashID(this.id, ret.CrashID);
- }
- }
-
- if (submitted) {
- this.submitSuccess(ret);
- }
- else {
- this.notifyStatus(FAILED);
- this.cleanup();
- }
- }
- }, false);
-
- if (this.recordSubmission) {
- manager.addSubmissionAttempt(this.id, submissionID, new Date());
- }
- xhr.send(formData);
- return true;
- },
-
- notifyStatus: function Submitter_notify(status, ret)
- {
- let propBag = Cc["@mozilla.org/hash-property-bag;1"].
- createInstance(Ci.nsIWritablePropertyBag2);
- propBag.setPropertyAsAString("minidumpID", this.id);
- if (status == SUCCESS) {
- propBag.setPropertyAsAString("serverCrashID", ret.CrashID);
- }
-
- let extraKeyValsBag = Cc["@mozilla.org/hash-property-bag;1"].
- createInstance(Ci.nsIWritablePropertyBag2);
- for (let key in this.extraKeyVals) {
- extraKeyValsBag.setPropertyAsAString(key, this.extraKeyVals[key]);
- }
- propBag.setPropertyAsInterface("extra", extraKeyValsBag);
-
- Services.obs.notifyObservers(propBag, "crash-report-status", status);
-
- switch (status) {
- case SUCCESS:
- this.deferredSubmit.resolve(ret.CrashID);
- break;
- case FAILED:
- this.deferredSubmit.reject();
- break;
- default:
- // no callbacks invoked.
- }
- },
-
- submit: function Submitter_submit()
- {
- let [dump, extra, memory] = getPendingMinidump(this.id);
-
- if (!dump.exists() || !extra.exists()) {
- this.notifyStatus(FAILED);
- this.cleanup();
- return this.deferredSubmit.promise;
- }
- this.dump = dump;
- this.extra = extra;
-
- // The memory file may or may not exist
- if (memory.exists()) {
- this.memory = memory;
- }
-
- let extraKeyVals = parseKeyValuePairsFromFile(extra);
- for (let key in extraKeyVals) {
- if (!(key in this.extraKeyVals)) {
- this.extraKeyVals[key] = extraKeyVals[key];
- }
- }
-
- let additionalDumps = [];
- if ("additional_minidumps" in this.extraKeyVals) {
- let names = this.extraKeyVals.additional_minidumps.split(',');
- for (let name of names) {
- let [dump, extra, memory] = getPendingMinidump(this.id + "-" + name);
- if (!dump.exists()) {
- this.notifyStatus(FAILED);
- this.cleanup();
- return this.deferredSubmit.promise;
- }
- additionalDumps.push({'name': name, 'dump': dump});
- }
- }
-
- this.notifyStatus(SUBMITTING);
-
- this.additionalDumps = additionalDumps;
-
- if (!this.submitForm()) {
- this.notifyStatus(FAILED);
- this.cleanup();
- }
- return this.deferredSubmit.promise;
- }
-};
-
-// ===================================
-// External API goes here
-this.CrashSubmit = {
- /**
- * Submit the crash report named id.dmp from the "pending" directory.
- *
- * @param id
- * Filename (minus .dmp extension) of the minidump to submit.
- * @param params
- * An object containing any of the following optional parameters:
- * - recordSubmission
- * If true, a submission event is recorded in CrashManager.
- * - noThrottle
- * If true, this crash report should be submitted with
- * an extra parameter of "Throttleable=0" indicating that
- * it should be processed right away. This should be set
- * when the report is being submitted and the user expects
- * to see the results immediately. Defaults to false.
- * - extraExtraKeyVals
- * An object whose key-value pairs will be merged with the data from
- * the ".extra" file submitted with the report. The properties of
- * this object will override properties of the same name in the
- * .extra file.
- *
- * @return a Promise that is fulfilled with the server crash ID when the
- * submission succeeds and rejected otherwise.
- */
- submit: function CrashSubmit_submit(id, params)
- {
- params = params || {};
- let recordSubmission = false;
- let submitSuccess = null;
- let submitError = null;
- let noThrottle = false;
- let extraExtraKeyVals = null;
-
- if ('recordSubmission' in params)
- recordSubmission = params.recordSubmission;
- if ('noThrottle' in params)
- noThrottle = params.noThrottle;
- if ('extraExtraKeyVals' in params)
- extraExtraKeyVals = params.extraExtraKeyVals;
-
- let submitter = new Submitter(id, recordSubmission,
- noThrottle, extraExtraKeyVals);
- CrashSubmit._activeSubmissions.push(submitter);
- return submitter.submit();
- },
-
- /**
- * Delete the minidup from the "pending" directory.
- *
- * @param id
- * Filename (minus .dmp extension) of the minidump to delete.
- */
- delete: function CrashSubmit_delete(id) {
- let [dump, extra, memory] = getPendingMinidump(id);
- dump.remove(false);
- extra.remove(false);
- if (memory.exists()) {
- memory.remove(false);
- }
- },
-
- /**
- * Add a .dmg.ignore file along side the .dmp file to indicate that the user
- * shouldn't be prompted to submit this crash report again.
- *
- * @param id
- * Filename (minus .dmp extension) of the report to ignore
- */
-
- ignore: function CrashSubmit_ignore(id) {
- let [dump, extra, mem] = getPendingMinidump(id);
- return OS.File.open(dump.path + ".ignore", {create: true},
- {unixFlags: OS.Constants.libc.O_CREAT})
- .then((file) => { file.close(); });
- },
-
- /**
- * Get the list of pending crash IDs.
- *
- * @return an array of string, each being an ID as
- * expected to be passed to submit()
- */
- pendingIDs: function CrashSubmit_pendingIDs() {
- return getAllPendingMinidumpsIDs();
- },
-
- /**
- * Get the list of pending crash IDs, excluding those marked to be ignored
- * @param maxFileDate
- * A Date object. Any files last modified before that date will be ignored
- *
- * @return a Promise that is fulfilled with an array of string, each
- * being an ID as expected to be passed to submit() or ignore()
- */
- pendingIDsAsync: Task.async(function* CrashSubmit_pendingIDsAsync(maxFileDate) {
- let ids = [];
- let info = null;
- try {
- info = yield OS.File.stat(getDir("pending").path)
- } catch (ex) {
- /* pending dir doesn't exist, ignore */
- return ids;
- }
-
- if (info.isDir) {
- let iterator = new OS.File.DirectoryIterator(getDir("pending").path);
- try {
- yield iterator.forEach(
- function onEntry(file) {
- if (file.name.endsWith(".dmp")) {
- return OS.File.exists(file.path + ".ignore")
- .then(ignoreExists => {
- if (!ignoreExists) {
- let id = file.name.slice(0, -4);
- if (UUID_REGEX.test(id)) {
- return OS.File.stat(file.path)
- .then(info => {
- if (info.lastAccessDate.valueOf() >
- maxFileDate.valueOf()) {
- ids.push(id);
- }
- });
- }
- }
- return null;
- });
- }
- return null;
- }
- );
- } catch (ex) {
- Cu.reportError(ex);
- } finally {
- iterator.close();
- }
- }
- return ids;
- }),
-
- /**
- * Prune the saved dumps.
- */
- pruneSavedDumps: function CrashSubmit_pruneSavedDumps() {
- pruneSavedDumps();
- },
-
- // List of currently active submit objects
- _activeSubmissions: []
-};
diff --git a/toolkit/crashreporter/InjectCrashReporter.cpp b/toolkit/crashreporter/InjectCrashReporter.cpp
deleted file mode 100644
index 1b79f2cd13..0000000000
--- a/toolkit/crashreporter/InjectCrashReporter.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "InjectCrashReporter.h"
-#include "nsDirectoryServiceUtils.h"
-#include "nsDirectoryServiceDefs.h"
-#include "client/windows/crash_generation/crash_generation_client.h"
-#include "nsExceptionHandler.h"
-#include "LoadLibraryRemote.h"
-#include "nsWindowsHelpers.h"
-
-using google_breakpad::CrashGenerationClient;
-using CrashReporter::GetChildNotificationPipe;
-
-namespace mozilla {
-
-InjectCrashRunnable::InjectCrashRunnable(DWORD pid)
- : mPID(pid)
-{
- nsCOMPtr<nsIFile> dll;
- nsresult rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(dll));
- if (NS_SUCCEEDED(rv)) {
- dll->Append(NS_LITERAL_STRING("breakpadinjector.dll"));
- dll->GetPath(mInjectorPath);
- }
-}
-
-NS_IMETHODIMP
-InjectCrashRunnable::Run()
-{
- if (mInjectorPath.IsEmpty())
- return NS_OK;
-
- nsAutoHandle hProcess(
- OpenProcess(PROCESS_CREATE_THREAD |
- PROCESS_QUERY_INFORMATION |
- PROCESS_DUP_HANDLE |
- PROCESS_VM_OPERATION |
- PROCESS_VM_WRITE |
- PROCESS_VM_READ, FALSE, mPID));
- if (!hProcess) {
- NS_WARNING("Unable to open remote process handle for crashreporter injection.");
- return NS_OK;
- }
-
- void* proc = LoadRemoteLibraryAndGetAddress(hProcess, mInjectorPath.get(),
- "Start");
- if (!proc) {
- NS_WARNING("Unable to inject crashreporter DLL.");
- return NS_OK;
- }
-
- HANDLE hRemotePipe =
- CrashGenerationClient::DuplicatePipeToClientProcess(
- NS_ConvertASCIItoUTF16(GetChildNotificationPipe()).get(),
- hProcess);
- if (INVALID_HANDLE_VALUE == hRemotePipe) {
- NS_WARNING("Unable to duplicate crash reporter pipe to process.");
- return NS_OK;
- }
-
- nsAutoHandle hThread(CreateRemoteThread(hProcess, nullptr, 0,
- (LPTHREAD_START_ROUTINE) proc,
- (void*) hRemotePipe, 0, nullptr));
- if (!hThread) {
- NS_WARNING("Unable to CreateRemoteThread");
-
- // We have to close the remote pipe or else our crash generation client
- // will be stuck unable to accept other remote requests.
- HANDLE toClose = INVALID_HANDLE_VALUE;
- if (DuplicateHandle(hProcess, hRemotePipe, ::GetCurrentProcess(),
- &toClose, 0, FALSE,
- DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
- CloseHandle(toClose);
- return NS_OK;
- }
- }
-
- return NS_OK;
-}
-
-} // namespace mozilla
diff --git a/toolkit/crashreporter/InjectCrashReporter.h b/toolkit/crashreporter/InjectCrashReporter.h
deleted file mode 100644
index 5b40b49e32..0000000000
--- a/toolkit/crashreporter/InjectCrashReporter.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef InjectCrashReporter_h
-#define InjectCrashReporter_h
-
-#include "nsThreadUtils.h"
-#include <windows.h>
-
-namespace mozilla {
-
-class InjectCrashRunnable : public Runnable
-{
-public:
- InjectCrashRunnable(DWORD pid);
-
- NS_IMETHOD Run();
-
-private:
- DWORD mPID;
- nsString mInjectorPath;
-};
-
-} // Namespace mozilla
-
-#endif
diff --git a/toolkit/crashreporter/KeyValueParser.jsm b/toolkit/crashreporter/KeyValueParser.jsm
deleted file mode 100644
index ec45354f3e..0000000000
--- a/toolkit/crashreporter/KeyValueParser.jsm
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-this.EXPORTED_SYMBOLS = [
- "parseKeyValuePairsFromLines",
- "parseKeyValuePairs",
- "parseKeyValuePairsFromFile"
-];
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-this.parseKeyValuePairsFromLines = function(lines) {
- let data = {};
- for (let line of lines) {
- if (line == '')
- continue;
-
- // can't just .split() because the value might contain = characters
- let eq = line.indexOf('=');
- if (eq != -1) {
- let [key, value] = [line.substring(0, eq),
- line.substring(eq + 1)];
- if (key && value)
- data[key] = value.replace(/\\n/g, "\n").replace(/\\\\/g, "\\");
- }
- }
- return data;
-}
-
-this.parseKeyValuePairs = function parseKeyValuePairs(text) {
- let lines = text.split('\n');
- return parseKeyValuePairsFromLines(lines);
-};
-
-this.parseKeyValuePairsFromFile = function parseKeyValuePairsFromFile(file) {
- let fstream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fstream.init(file, -1, 0, 0);
- let is = Cc["@mozilla.org/intl/converter-input-stream;1"].
- createInstance(Ci.nsIConverterInputStream);
- is.init(fstream, "UTF-8", 1024, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER);
- let str = {};
- let contents = '';
- while (is.readString(4096, str) != 0) {
- contents += str.value;
- }
- is.close();
- fstream.close();
- return parseKeyValuePairs(contents);
-}
diff --git a/toolkit/crashreporter/LoadLibraryRemote.cpp b/toolkit/crashreporter/LoadLibraryRemote.cpp
deleted file mode 100644
index f22a6220fa..0000000000
--- a/toolkit/crashreporter/LoadLibraryRemote.cpp
+++ /dev/null
@@ -1,454 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __GNUC__
-// disable warnings about pointer <-> DWORD conversions
-#pragma warning( disable : 4311 4312 )
-#endif
-
-#ifdef _WIN64
-#define POINTER_TYPE ULONGLONG
-#else
-#define POINTER_TYPE DWORD
-#endif
-
-#include <windows.h>
-#include <winnt.h>
-#include <stdlib.h>
-#ifdef DEBUG_OUTPUT
-#include <stdio.h>
-#endif
-
-#include "nsWindowsHelpers.h"
-
-typedef const unsigned char* FileView;
-
-template<>
-class nsAutoRefTraits<FileView>
-{
-public:
- typedef FileView RawRef;
- static FileView Void()
- {
- return nullptr;
- }
-
- static void Release(RawRef aView)
- {
- if (nullptr != aView)
- UnmapViewOfFile(aView);
- }
-};
-
-#ifndef IMAGE_SIZEOF_BASE_RELOCATION
-// Vista SDKs no longer define IMAGE_SIZEOF_BASE_RELOCATION!?
-#define IMAGE_SIZEOF_BASE_RELOCATION (sizeof(IMAGE_BASE_RELOCATION))
-#endif
-
-#include "LoadLibraryRemote.h"
-
-typedef struct {
- PIMAGE_NT_HEADERS headers;
- unsigned char *localCodeBase;
- unsigned char *remoteCodeBase;
- HMODULE *modules;
- int numModules;
-} MEMORYMODULE, *PMEMORYMODULE;
-
-typedef BOOL (WINAPI *DllEntryProc)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
-
-#define GET_HEADER_DICTIONARY(module, idx) &(module)->headers->OptionalHeader.DataDirectory[idx]
-
-#ifdef DEBUG_OUTPUT
-static void
-OutputLastError(const char *msg)
-{
- char* tmp;
- char *tmpmsg;
- FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
- nullptr, GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPSTR) &tmp, 0, nullptr);
- tmpmsg = (char *)LocalAlloc(LPTR, strlen(msg) + strlen(tmp) + 3);
- sprintf(tmpmsg, "%s: %s", msg, tmp);
- OutputDebugStringA(tmpmsg);
- LocalFree(tmpmsg);
- LocalFree(tmp);
-}
-#endif
-
-static void
-CopySections(const unsigned char *data, PIMAGE_NT_HEADERS old_headers, PMEMORYMODULE module)
-{
- int i;
- unsigned char *codeBase = module->localCodeBase;
- unsigned char *dest;
- PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(module->headers);
- for (i=0; i<module->headers->FileHeader.NumberOfSections; i++, section++) {
- dest = codeBase + section->VirtualAddress;
- memset(dest, 0, section->Misc.VirtualSize);
- if (section->SizeOfRawData) {
- memcpy(dest, data + section->PointerToRawData, section->SizeOfRawData);
- }
- // section->Misc.PhysicalAddress = (POINTER_TYPE) module->remoteCodeBase + section->VirtualAddress;
- }
-}
-
-static bool
-CopyRegion(HANDLE hRemoteProcess, void* remoteAddress, void* localAddress, DWORD size, DWORD protect)
-{
- if (size > 0) {
- // Copy the data from local->remote and set the memory protection
- if (!VirtualAllocEx(hRemoteProcess, remoteAddress, size, MEM_COMMIT, PAGE_READWRITE))
- return false;
-
- if (!WriteProcessMemory(hRemoteProcess,
- remoteAddress,
- localAddress,
- size,
- nullptr)) {
-#ifdef DEBUG_OUTPUT
- OutputLastError("Error writing remote memory.\n");
-#endif
- return false;
- }
-
- DWORD oldProtect;
- if (VirtualProtectEx(hRemoteProcess, remoteAddress, size, protect, &oldProtect) == 0) {
-#ifdef DEBUG_OUTPUT
- OutputLastError("Error protecting memory page");
-#endif
- return false;
- }
- }
- return true;
-}
-// Protection flags for memory pages (Executable, Readable, Writeable)
-static int ProtectionFlags[2][2][2] = {
- {
- // not executable
- {PAGE_NOACCESS, PAGE_WRITECOPY},
- {PAGE_READONLY, PAGE_READWRITE},
- }, {
- // executable
- {PAGE_EXECUTE, PAGE_EXECUTE_WRITECOPY},
- {PAGE_EXECUTE_READ, PAGE_EXECUTE_READWRITE},
- },
-};
-
-static bool
-FinalizeSections(PMEMORYMODULE module, HANDLE hRemoteProcess)
-{
-#ifdef DEBUG_OUTPUT
- fprintf(stderr, "Finalizing sections: local base %p, remote base %p\n",
- module->localCodeBase, module->remoteCodeBase);
-#endif
-
- int i;
- int numSections = module->headers->FileHeader.NumberOfSections;
-
- if (numSections < 1)
- return false;
-
- PIMAGE_SECTION_HEADER section = IMAGE_FIRST_SECTION(module->headers);
-
- // Copy any data before the first section (i.e. the image header)
- if (!CopyRegion(hRemoteProcess, module->remoteCodeBase, module->localCodeBase, section->VirtualAddress, PAGE_READONLY))
- return false;
-
- // loop through all sections and change access flags
- for (i=0; i<numSections; i++, section++) {
- DWORD protect, size;
- int executable = (section->Characteristics & IMAGE_SCN_MEM_EXECUTE) != 0;
- int readable = (section->Characteristics & IMAGE_SCN_MEM_READ) != 0;
- int writeable = (section->Characteristics & IMAGE_SCN_MEM_WRITE) != 0;
-
- // determine protection flags based on characteristics
- protect = ProtectionFlags[executable][readable][writeable];
- if (section->Characteristics & IMAGE_SCN_MEM_NOT_CACHED) {
- protect |= PAGE_NOCACHE;
- }
-
- void* remoteAddress = module->remoteCodeBase + section->VirtualAddress;
- void* localAddress = module->localCodeBase + section->VirtualAddress;
-
- // determine size of region
- size = section->Misc.VirtualSize;
-#ifdef DEBUG_OUTPUT
- fprintf(stderr, "Copying section %s to %p, size %x, executable %i readable %i writeable %i\n",
- section->Name, remoteAddress, size, executable, readable, writeable);
-#endif
- if (!CopyRegion(hRemoteProcess, remoteAddress, localAddress, size, protect))
- return false;
- }
- return true;
-}
-
-static void
-PerformBaseRelocation(PMEMORYMODULE module, SIZE_T delta)
-{
- DWORD i;
- unsigned char *codeBase = module->localCodeBase;
-
- PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_BASERELOC);
- if (directory->Size > 0) {
- PIMAGE_BASE_RELOCATION relocation = (PIMAGE_BASE_RELOCATION) (codeBase + directory->VirtualAddress);
- for (; relocation->VirtualAddress > 0; ) {
- unsigned char *dest = codeBase + relocation->VirtualAddress;
- unsigned short *relInfo = (unsigned short *)((unsigned char *)relocation + IMAGE_SIZEOF_BASE_RELOCATION);
- for (i=0; i<((relocation->SizeOfBlock-IMAGE_SIZEOF_BASE_RELOCATION) / 2); i++, relInfo++) {
- DWORD *patchAddrHL;
-#ifdef _WIN64
- ULONGLONG *patchAddr64;
-#endif
- int type, offset;
-
- // the upper 4 bits define the type of relocation
- type = *relInfo >> 12;
- // the lower 12 bits define the offset
- offset = *relInfo & 0xfff;
-
- switch (type)
- {
- case IMAGE_REL_BASED_ABSOLUTE:
- // skip relocation
- break;
-
- case IMAGE_REL_BASED_HIGHLOW:
- // change complete 32 bit address
- patchAddrHL = (DWORD *) (dest + offset);
- *patchAddrHL += delta;
- break;
-
-#ifdef _WIN64
- case IMAGE_REL_BASED_DIR64:
- patchAddr64 = (ULONGLONG *) (dest + offset);
- *patchAddr64 += delta;
- break;
-#endif
-
- default:
- //printf("Unknown relocation: %d\n", type);
- break;
- }
- }
-
- // advance to next relocation block
- relocation = (PIMAGE_BASE_RELOCATION) (((char *) relocation) + relocation->SizeOfBlock);
- }
- }
-}
-
-static int
-BuildImportTable(PMEMORYMODULE module)
-{
- int result=1;
- unsigned char *codeBase = module->localCodeBase;
-
- PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_IMPORT);
- if (directory->Size > 0) {
- PIMAGE_IMPORT_DESCRIPTOR importDesc = (PIMAGE_IMPORT_DESCRIPTOR) (codeBase + directory->VirtualAddress);
- PIMAGE_IMPORT_DESCRIPTOR importEnd = (PIMAGE_IMPORT_DESCRIPTOR) (codeBase + directory->VirtualAddress + directory->Size);
-
- for (; importDesc < importEnd && importDesc->Name; importDesc++) {
- POINTER_TYPE *thunkRef;
- FARPROC *funcRef;
- HMODULE handle = GetModuleHandleA((LPCSTR) (codeBase + importDesc->Name));
- if (handle == nullptr) {
-#if DEBUG_OUTPUT
- OutputLastError("Can't load library");
-#endif
- result = 0;
- break;
- }
-
- module->modules = (HMODULE *)realloc(module->modules, (module->numModules+1)*(sizeof(HMODULE)));
- if (module->modules == nullptr) {
- result = 0;
- break;
- }
-
- module->modules[module->numModules++] = handle;
- if (importDesc->OriginalFirstThunk) {
- thunkRef = (POINTER_TYPE *) (codeBase + importDesc->OriginalFirstThunk);
- funcRef = (FARPROC *) (codeBase + importDesc->FirstThunk);
- } else {
- // no hint table
- thunkRef = (POINTER_TYPE *) (codeBase + importDesc->FirstThunk);
- funcRef = (FARPROC *) (codeBase + importDesc->FirstThunk);
- }
- for (; *thunkRef; thunkRef++, funcRef++) {
- if (IMAGE_SNAP_BY_ORDINAL(*thunkRef)) {
- *funcRef = (FARPROC)GetProcAddress(handle, (LPCSTR)IMAGE_ORDINAL(*thunkRef));
- } else {
- PIMAGE_IMPORT_BY_NAME thunkData = (PIMAGE_IMPORT_BY_NAME) (codeBase + (*thunkRef));
- *funcRef = (FARPROC)GetProcAddress(handle, (LPCSTR)&thunkData->Name);
- }
- if (*funcRef == 0) {
- result = 0;
- break;
- }
- }
-
- if (!result) {
- break;
- }
- }
- }
-
- return result;
-}
-
-static void* MemoryGetProcAddress(PMEMORYMODULE module, const char *name);
-
-void* LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess,
- const WCHAR* library,
- const char* symbol)
-{
- // Map the DLL into memory
- nsAutoHandle hLibrary(
- CreateFile(library, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING,
- FILE_ATTRIBUTE_NORMAL, nullptr));
- if (INVALID_HANDLE_VALUE == hLibrary) {
-#if DEBUG_OUTPUT
- OutputLastError("Couldn't CreateFile the library.\n");
-#endif
- return nullptr;
- }
-
- nsAutoHandle hMapping(
- CreateFileMapping(hLibrary, nullptr, PAGE_READONLY, 0, 0, nullptr));
- if (!hMapping) {
-#if DEBUG_OUTPUT
- OutputLastError("Couldn't CreateFileMapping.\n");
-#endif
- return nullptr;
- }
-
- nsAutoRef<FileView> data(
- (const unsigned char*) MapViewOfFile(hMapping, FILE_MAP_READ, 0, 0, 0));
- if (!data) {
-#if DEBUG_OUTPUT
- OutputLastError("Couldn't MapViewOfFile.\n");
-#endif
- return nullptr;
- }
-
- SIZE_T locationDelta;
-
- PIMAGE_DOS_HEADER dos_header = (PIMAGE_DOS_HEADER)data.get();
- if (dos_header->e_magic != IMAGE_DOS_SIGNATURE) {
-#if DEBUG_OUTPUT
- OutputDebugStringA("Not a valid executable file.\n");
-#endif
- return nullptr;
- }
-
- PIMAGE_NT_HEADERS old_header = (PIMAGE_NT_HEADERS)(data + dos_header->e_lfanew);
- if (old_header->Signature != IMAGE_NT_SIGNATURE) {
-#if DEBUG_OUTPUT
- OutputDebugStringA("No PE header found.\n");
-#endif
- return nullptr;
- }
-
- // reserve memory for image of library in this process and the target process
- unsigned char* localCode = (unsigned char*) VirtualAlloc(nullptr,
- old_header->OptionalHeader.SizeOfImage,
- MEM_RESERVE | MEM_COMMIT,
- PAGE_READWRITE);
- if (!localCode) {
-#if DEBUG_OUTPUT
- OutputLastError("Can't reserve local memory.");
-#endif
- }
-
- unsigned char* remoteCode = (unsigned char*) VirtualAllocEx(hRemoteProcess, nullptr,
- old_header->OptionalHeader.SizeOfImage,
- MEM_RESERVE,
- PAGE_EXECUTE_READ);
- if (!remoteCode) {
-#if DEBUG_OUTPUT
- OutputLastError("Can't reserve remote memory.");
-#endif
- }
-
- MEMORYMODULE result;
- result.localCodeBase = localCode;
- result.remoteCodeBase = remoteCode;
- result.numModules = 0;
- result.modules = nullptr;
-
- // copy PE header to code
- memcpy(localCode, dos_header, dos_header->e_lfanew + old_header->OptionalHeader.SizeOfHeaders);
- result.headers = reinterpret_cast<PIMAGE_NT_HEADERS>(localCode + dos_header->e_lfanew);
-
- // update position
- result.headers->OptionalHeader.ImageBase = (POINTER_TYPE)remoteCode;
-
- // copy sections from DLL file block to new memory location
- CopySections(data, old_header, &result);
-
- // adjust base address of imported data
- locationDelta = (SIZE_T)(remoteCode - old_header->OptionalHeader.ImageBase);
- if (locationDelta != 0) {
- PerformBaseRelocation(&result, locationDelta);
- }
-
- // load required dlls and adjust function table of imports
- if (!BuildImportTable(&result)) {
- return nullptr;
- }
-
- // mark memory pages depending on section headers and release
- // sections that are marked as "discardable"
- if (!FinalizeSections(&result, hRemoteProcess)) {
- return nullptr;
- }
-
- return MemoryGetProcAddress(&result, symbol);
-}
-
-static void* MemoryGetProcAddress(PMEMORYMODULE module, const char *name)
-{
- unsigned char *localCodeBase = module->localCodeBase;
- int idx=-1;
- DWORD i, *nameRef;
- WORD *ordinal;
- PIMAGE_EXPORT_DIRECTORY exports;
- PIMAGE_DATA_DIRECTORY directory = GET_HEADER_DICTIONARY(module, IMAGE_DIRECTORY_ENTRY_EXPORT);
- if (directory->Size == 0) {
- // no export table found
- return nullptr;
- }
-
- exports = (PIMAGE_EXPORT_DIRECTORY) (localCodeBase + directory->VirtualAddress);
- if (exports->NumberOfNames == 0 || exports->NumberOfFunctions == 0) {
- // DLL doesn't export anything
- return nullptr;
- }
-
- // search function name in list of exported names
- nameRef = (DWORD *) (localCodeBase + exports->AddressOfNames);
- ordinal = (WORD *) (localCodeBase + exports->AddressOfNameOrdinals);
- for (i=0; i<exports->NumberOfNames; i++, nameRef++, ordinal++) {
- if (stricmp(name, (const char *) (localCodeBase + (*nameRef))) == 0) {
- idx = *ordinal;
- break;
- }
- }
-
- if (idx == -1) {
- // exported symbol not found
- return nullptr;
- }
-
- if ((DWORD)idx > exports->NumberOfFunctions) {
- // name <-> ordinal number don't match
- return nullptr;
- }
-
- // AddressOfFunctions contains the RVAs to the "real" functions
- return module->remoteCodeBase + (*(DWORD *) (localCodeBase + exports->AddressOfFunctions + (idx*4)));
-}
diff --git a/toolkit/crashreporter/LoadLibraryRemote.h b/toolkit/crashreporter/LoadLibraryRemote.h
deleted file mode 100644
index 7beeaf4a53..0000000000
--- a/toolkit/crashreporter/LoadLibraryRemote.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef LoadLibraryRemote_h
-#define LoadLibraryRemote_h
-
-#include <windows.h>
-
-/**
- * Inject a library into a remote process. This injection has the following
- * restrictions:
- *
- * - The DLL being injected must only depend on kernel32 and user32.
- * - The entry point of the DLL is not run. If the DLL uses the CRT, it is
- * the responsibility of the caller to make sure that _CRT_INIT is called.
- * - There is no support for unloading a library once it has been loaded.
- * - The symbol must be a named symbol and not an ordinal.
- */
-void* LoadRemoteLibraryAndGetAddress(HANDLE hRemoteProcess,
- const WCHAR* library,
- const char* symbol);
-
-#endif // LoadLibraryRemote_h
diff --git a/toolkit/crashreporter/breakpad-patches/00-arm-exidx-rollup.patch b/toolkit/crashreporter/breakpad-patches/00-arm-exidx-rollup.patch
deleted file mode 100644
index 3ca5815d1d..0000000000
--- a/toolkit/crashreporter/breakpad-patches/00-arm-exidx-rollup.patch
+++ /dev/null
@@ -1,1347 +0,0 @@
-diff --git a/Makefile.am b/Makefile.am
-index 42386be..e8f7402 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -524,6 +524,8 @@ src_tools_linux_dump_syms_dump_syms_SOURCES = \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
-+ src/common/arm_ex_reader.cc \
-+ src/common/arm_ex_to_module.cc \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/elf_symbols_to_module.cc \
-@@ -573,6 +575,8 @@ src_tools_mac_dump_syms_dump_syms_CXXFLAGS= \
- -DHAVE_MACH_O_NLIST_H
-
- src_common_dumper_unittest_SOURCES = \
-+ src/common/arm_ex_reader.cc \
-+ src/common/arm_ex_to_module.cc \
- src/common/byte_cursor_unittest.cc \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cfi_to_module_unittest.cc \
-@@ -1336,6 +1340,10 @@ EXTRA_DIST = \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols.h \
-+ src/common/arm_ex_reader.cc \
-+ src/common/arm_ex_reader.h \
-+ src/common/arm_ex_to_module.cc \
-+ src/common/arm_ex_to_module.h \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module.h \
- src/common/linux/elfutils.cc \
-diff --git a/src/common/arm_ex_reader.cc b/src/common/arm_ex_reader.cc
-new file mode 100644
-index 0000000..2d1ed98
---- /dev/null
-+++ b/src/common/arm_ex_reader.cc
-@@ -0,0 +1,487 @@
-+
-+/* libunwind - a platform-independent unwind library
-+ Copyright 2011 Linaro Limited
-+
-+This file is part of libunwind.
-+
-+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. */
-+
-+// Copyright (c) 2010 Google Inc.
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions are
-+// met:
-+//
-+// * Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// * Redistributions in binary form must reproduce the above
-+// copyright notice, this list of conditions and the following disclaimer
-+// in the documentation and/or other materials provided with the
-+// distribution.
-+// * Neither the name of Google Inc. nor the names of its
-+// contributors may be used to endorse or promote products derived from
-+// this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+// Derived from libunwind, with extensive modifications.
-+
-+
-+#include "common/arm_ex_reader.h"
-+
-+#include <assert.h>
-+#include <stdio.h>
-+
-+// This file, in conjunction with arm_ex_to_module.cc, translates
-+// EXIDX unwind information into the same format that Breakpad uses
-+// for CFI information. Hence Breakpad's CFI unwinding abilities
-+// also become usable for EXIDX.
-+//
-+// See: "Exception Handling ABI for the ARM Architecture", ARM IHI 0038A
-+// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
-+
-+// EXIDX data is presented in two parts:
-+//
-+// * an index table. This contains two words per routine,
-+// the first of which identifies the routine, and the second
-+// of which is a reference to the unwind bytecode. If the
-+// bytecode is very compact -- 3 bytes or less -- it can be
-+// stored directly in the second word.
-+//
-+// * an area containing the unwind bytecodes.
-+
-+// General flow is: ExceptionTableInfo::Start iterates over all
-+// of the index table entries (pairs). For each entry, it:
-+//
-+// * calls ExceptionTableInfo::ExtabEntryExtract to copy the bytecode
-+// out into an intermediate buffer.
-+
-+// * uses ExceptionTableInfo::ExtabEntryDecode to parse the intermediate
-+// buffer. Each bytecode instruction is bundled into a
-+// arm_ex_to_module::extab_data structure, and handed to ..
-+//
-+// * .. ARMExToModule::ImproveStackFrame, which in turn hands it to
-+// ARMExToModule::TranslateCmd, and that generates the pseudo-CFI
-+// records that Breakpad stores.
-+
-+#define ARM_EXIDX_CANT_UNWIND 0x00000001
-+#define ARM_EXIDX_COMPACT 0x80000000
-+#define ARM_EXTBL_OP_FINISH 0xb0
-+#define ARM_EXIDX_TABLE_LIMIT (255*4)
-+
-+namespace arm_ex_reader {
-+
-+using arm_ex_to_module::ARM_EXIDX_CMD_FINISH;
-+using arm_ex_to_module::ARM_EXIDX_CMD_SUB_FROM_VSP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_ADD_TO_VSP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_REG_POP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_REG_TO_SP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_VFP_POP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_WREG_POP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_WCGR_POP;
-+using arm_ex_to_module::ARM_EXIDX_CMD_RESERVED;
-+using arm_ex_to_module::ARM_EXIDX_CMD_REFUSED;
-+using arm_ex_to_module::exidx_entry;
-+using arm_ex_to_module::ARM_EXIDX_VFP_SHIFT_16;
-+using arm_ex_to_module::ARM_EXIDX_VFP_FSTMD;
-+using google_breakpad::MemoryRange;
-+
-+
-+static void* Prel31ToAddr(const void* addr) {
-+ uint32_t offset32 = *reinterpret_cast<const uint32_t*>(addr);
-+ // sign extend offset32[30:0] to 64 bits -- copy bit 30 to positions
-+ // 63:31 inclusive.
-+ uint64_t offset64 = offset32;
-+ if (offset64 & (1ULL << 30))
-+ offset64 |= 0xFFFFFFFF80000000ULL;
-+ else
-+ offset64 &= 0x000000007FFFFFFFULL;
-+ return ((char*)addr) + (uintptr_t)offset64;
-+}
-+
-+
-+// Extract unwind bytecode for the function denoted by |entry| into |buf|,
-+// and return the number of bytes of |buf| written, along with a code
-+// indicating the outcome.
-+
-+ExceptionTableInfo::ExExtractResult ExceptionTableInfo::ExtabEntryExtract(
-+ const struct exidx_entry* entry,
-+ uint8_t* buf, size_t buf_size,
-+ size_t* buf_used) {
-+ MemoryRange mr_out(buf, buf_size);
-+
-+ *buf_used = 0;
-+
-+# define PUT_BUF_U8(_byte) \
-+ do { if (!mr_out.Covers(*buf_used, 1)) return ExOutBufOverflow; \
-+ buf[(*buf_used)++] = (_byte); } while (0)
-+
-+# define GET_EX_U32(_lval, _addr, _sec_mr) \
-+ do { if (!(_sec_mr).Covers(reinterpret_cast<const uint8_t*>(_addr) \
-+ - (_sec_mr).data(), 4)) \
-+ return ExInBufOverflow; \
-+ (_lval) = *(reinterpret_cast<const uint32_t*>(_addr)); } while (0)
-+
-+# define GET_EXIDX_U32(_lval, _addr) \
-+ GET_EX_U32(_lval, _addr, mr_exidx_)
-+# define GET_EXTAB_U32(_lval, _addr) \
-+ GET_EX_U32(_lval, _addr, mr_extab_)
-+
-+ uint32_t data;
-+ GET_EXIDX_U32(data, &entry->data);
-+
-+ // A function can be marked CANT_UNWIND if (eg) it is known to be
-+ // at the bottom of the stack.
-+ if (data == ARM_EXIDX_CANT_UNWIND)
-+ return ExCantUnwind;
-+
-+ uint32_t pers; // personality number
-+ uint32_t extra; // number of extra data words required
-+ uint32_t extra_allowed; // number of extra data words allowed
-+ uint32_t* extbl_data; // the handler entry, if not inlined
-+
-+ if (data & ARM_EXIDX_COMPACT) {
-+ // The handler table entry has been inlined into the index table entry.
-+ // In this case it can only be an ARM-defined compact model, since
-+ // bit 31 is 1. Only personalities 0, 1 and 2 are defined for the
-+ // ARM compact model, but 1 and 2 are "Long format" and may require
-+ // extra data words. Hence the allowable personalities here are:
-+ // personality 0, in which case 'extra' has no meaning
-+ // personality 1, with zero extra words
-+ // personality 2, with zero extra words
-+ extbl_data = NULL;
-+ pers = (data >> 24) & 0x0F;
-+ extra = (data >> 16) & 0xFF;
-+ extra_allowed = 0;
-+ }
-+ else {
-+ // The index table entry is a pointer to the handler entry. Note
-+ // that Prel31ToAddr will read the given address, but we already
-+ // range-checked above.
-+ extbl_data = reinterpret_cast<uint32_t*>(Prel31ToAddr(&entry->data));
-+ GET_EXTAB_U32(data, extbl_data);
-+ if (!(data & ARM_EXIDX_COMPACT)) {
-+ // This denotes a "generic model" handler. That will involve
-+ // executing arbitary machine code, which is something we
-+ // can't represent here; hence reject it.
-+ return ExCantRepresent;
-+ }
-+ // So we have a compact model representation. Again, 3 possible
-+ // personalities, but this time up to 255 allowable extra words.
-+ pers = (data >> 24) & 0x0F;
-+ extra = (data >> 16) & 0xFF;
-+ extra_allowed = 255;
-+ extbl_data++;
-+ }
-+
-+ // Now look at the the handler table entry. The first word is
-+ // |data| and subsequent words start at |*extbl_data|. The number
-+ // of extra words to use is |extra|, provided that the personality
-+ // allows extra words. Even if it does, none may be available --
-+ // extra_allowed is the maximum number of extra words allowed. */
-+ if (pers == 0) {
-+ // "Su16" in the documentation -- 3 unwinding insn bytes
-+ // |extra| has no meaning here; instead that byte is an unwind-info byte
-+ PUT_BUF_U8(data >> 16);
-+ PUT_BUF_U8(data >> 8);
-+ PUT_BUF_U8(data);
-+ }
-+ else if ((pers == 1 || pers == 2) && extra <= extra_allowed) {
-+ // "Lu16" or "Lu32" respectively -- 2 unwinding insn bytes,
-+ // and up to 255 extra words.
-+ PUT_BUF_U8(data >> 8);
-+ PUT_BUF_U8(data);
-+ for (uint32_t j = 0; j < extra; j++) {
-+ GET_EXTAB_U32(data, extbl_data);
-+ extbl_data++;
-+ PUT_BUF_U8(data >> 24);
-+ PUT_BUF_U8(data >> 16);
-+ PUT_BUF_U8(data >> 8);
-+ PUT_BUF_U8(data >> 0);
-+ }
-+ }
-+ else {
-+ // The entry is invalid.
-+ return ExInvalid;
-+ }
-+
-+ // Make sure the entry is terminated with "FINISH"
-+ if (*buf_used > 0 && buf[(*buf_used) - 1] != ARM_EXTBL_OP_FINISH)
-+ PUT_BUF_U8(ARM_EXTBL_OP_FINISH);
-+
-+ return ExSuccess;
-+
-+# undef GET_EXTAB_U32
-+# undef GET_EXIDX_U32
-+# undef GET_U32
-+# undef PUT_BUF_U8
-+}
-+
-+
-+// Take the unwind information extracted by ExtabEntryExtract
-+// and parse it into frame-unwind instructions. These are as
-+// specified in "Table 4, ARM-defined frame-unwinding instructions"
-+// in the specification document detailed in comments at the top
-+// of this file.
-+//
-+// This reads from |buf[0, +data_size)|. It checks for overruns of
-+// the input buffer and returns a negative value if that happens, or
-+// for any other failure cases. It returns zero in case of success.
-+int ExceptionTableInfo::ExtabEntryDecode(const uint8_t* buf, size_t buf_size) {
-+ if (buf == NULL || buf_size == 0)
-+ return -1;
-+
-+ MemoryRange mr_in(buf, buf_size);
-+ const uint8_t* buf_initially = buf;
-+
-+# define GET_BUF_U8(_lval) \
-+ do { if (!mr_in.Covers(buf - buf_initially, 1)) return -1; \
-+ (_lval) = *(buf++); } while (0)
-+
-+ const uint8_t* end = buf + buf_size;
-+
-+ while (buf < end) {
-+ struct arm_ex_to_module::extab_data edata;
-+ memset(&edata, 0, sizeof(edata));
-+
-+ uint8_t op;
-+ GET_BUF_U8(op);
-+ if ((op & 0xc0) == 0x00) {
-+ // vsp = vsp + (xxxxxx << 2) + 4
-+ edata.cmd = ARM_EXIDX_CMD_ADD_TO_VSP;
-+ edata.data = (((int)op & 0x3f) << 2) + 4;
-+ } else if ((op & 0xc0) == 0x40) {
-+ // vsp = vsp - (xxxxxx << 2) - 4
-+ edata.cmd = ARM_EXIDX_CMD_SUB_FROM_VSP;
-+ edata.data = (((int)op & 0x3f) << 2) + 4;
-+ } else if ((op & 0xf0) == 0x80) {
-+ uint8_t op2;
-+ GET_BUF_U8(op2);
-+ if (op == 0x80 && op2 == 0x00) {
-+ // Refuse to unwind
-+ edata.cmd = ARM_EXIDX_CMD_REFUSED;
-+ } else {
-+ // Pop up to 12 integer registers under masks {r15-r12},{r11-r4}
-+ edata.cmd = ARM_EXIDX_CMD_REG_POP;
-+ edata.data = ((op & 0xf) << 8) | op2;
-+ edata.data = edata.data << 4;
-+ }
-+ } else if ((op & 0xf0) == 0x90) {
-+ if (op == 0x9d || op == 0x9f) {
-+ // 9d: Reserved as prefix for ARM register to register moves
-+ // 9f: Reserved as perfix for Intel Wireless MMX reg to reg moves
-+ edata.cmd = ARM_EXIDX_CMD_RESERVED;
-+ } else {
-+ // Set vsp = r[nnnn]
-+ edata.cmd = ARM_EXIDX_CMD_REG_TO_SP;
-+ edata.data = op & 0x0f;
-+ }
-+ } else if ((op & 0xf0) == 0xa0) {
-+ // Pop r4 to r[4+nnn], or
-+ // Pop r4 to r[4+nnn] and r14 or
-+ unsigned end = (op & 0x07);
-+ edata.data = (1 << (end + 1)) - 1;
-+ edata.data = edata.data << 4;
-+ if (op & 0x08) edata.data |= 1 << 14;
-+ edata.cmd = ARM_EXIDX_CMD_REG_POP;
-+ } else if (op == ARM_EXTBL_OP_FINISH) {
-+ // Finish
-+ edata.cmd = ARM_EXIDX_CMD_FINISH;
-+ buf = end;
-+ } else if (op == 0xb1) {
-+ uint8_t op2;
-+ GET_BUF_U8(op2);
-+ if (op2 == 0 || (op2 & 0xf0)) {
-+ // Spare
-+ edata.cmd = ARM_EXIDX_CMD_RESERVED;
-+ } else {
-+ // Pop integer registers under mask {r3,r2,r1,r0}
-+ edata.cmd = ARM_EXIDX_CMD_REG_POP;
-+ edata.data = op2 & 0x0f;
-+ }
-+ } else if (op == 0xb2) {
-+ // vsp = vsp + 0x204 + (uleb128 << 2)
-+ uint64_t offset = 0;
-+ uint8_t byte, shift = 0;
-+ do {
-+ GET_BUF_U8(byte);
-+ offset |= (byte & 0x7f) << shift;
-+ shift += 7;
-+ } while ((byte & 0x80) && buf < end);
-+ edata.data = offset * 4 + 0x204;
-+ edata.cmd = ARM_EXIDX_CMD_ADD_TO_VSP;
-+ } else if (op == 0xb3 || op == 0xc8 || op == 0xc9) {
-+ // b3: Pop VFP regs D[ssss] to D[ssss+cccc], FSTMFDX-ishly
-+ // c8: Pop VFP regs D[16+ssss] to D[16+ssss+cccc], FSTMFDD-ishly
-+ // c9: Pop VFP regs D[ssss] to D[ssss+cccc], FSTMFDD-ishly
-+ edata.cmd = ARM_EXIDX_CMD_VFP_POP;
-+ GET_BUF_U8(edata.data);
-+ if (op == 0xc8) edata.data |= ARM_EXIDX_VFP_SHIFT_16;
-+ if (op != 0xb3) edata.data |= ARM_EXIDX_VFP_FSTMD;
-+ } else if ((op & 0xf8) == 0xb8 || (op & 0xf8) == 0xd0) {
-+ // b8: Pop VFP regs D[8] to D[8+nnn], FSTMFDX-ishly
-+ // d0: Pop VFP regs D[8] to D[8+nnn], FSTMFDD-ishly
-+ edata.cmd = ARM_EXIDX_CMD_VFP_POP;
-+ edata.data = 0x80 | (op & 0x07);
-+ if ((op & 0xf8) == 0xd0) edata.data |= ARM_EXIDX_VFP_FSTMD;
-+ } else if (op >= 0xc0 && op <= 0xc5) {
-+ // Intel Wireless MMX pop wR[10]-wr[10+nnn], nnn != 6,7
-+ edata.cmd = ARM_EXIDX_CMD_WREG_POP;
-+ edata.data = 0xa0 | (op & 0x07);
-+ } else if (op == 0xc6) {
-+ // Intel Wireless MMX pop wR[ssss] to wR[ssss+cccc]
-+ edata.cmd = ARM_EXIDX_CMD_WREG_POP;
-+ GET_BUF_U8(edata.data);
-+ } else if (op == 0xc7) {
-+ uint8_t op2;
-+ GET_BUF_U8(op2);
-+ if (op2 == 0 || (op2 & 0xf0)) {
-+ // Spare
-+ edata.cmd = ARM_EXIDX_CMD_RESERVED;
-+ } else {
-+ // Intel Wireless MMX pop wCGR registers under mask {wCGR3,2,1,0}
-+ edata.cmd = ARM_EXIDX_CMD_WCGR_POP;
-+ edata.data = op2 & 0x0f;
-+ }
-+ } else {
-+ // Spare
-+ edata.cmd = ARM_EXIDX_CMD_RESERVED;
-+ }
-+
-+ int ret = handler_->ImproveStackFrame(&edata);
-+ if (ret < 0)
-+ return ret;
-+ }
-+ return 0;
-+
-+# undef GET_BUF_U8
-+}
-+
-+void ExceptionTableInfo::Start() {
-+ const struct exidx_entry* start
-+ = reinterpret_cast<const struct exidx_entry*>(mr_exidx_.data());
-+ const struct exidx_entry* end
-+ = reinterpret_cast<const struct exidx_entry*>(mr_exidx_.data()
-+ + mr_exidx_.length());
-+
-+ // Iterate over each of the EXIDX entries (pairs of 32-bit words).
-+ // These occupy the entire .exidx section.
-+ for (const struct exidx_entry* entry = start; entry < end; ++entry) {
-+ // Figure out the code address range that this table entry is
-+ // associated with.
-+ uint32_t addr = (reinterpret_cast<char*>(Prel31ToAddr(&entry->addr))
-+ - mapping_addr_ + loading_addr_) & 0x7fffffff;
-+ uint32_t next_addr;
-+ if (entry < end - 1) {
-+ next_addr = (reinterpret_cast<char*>(Prel31ToAddr(&((entry + 1)->addr)))
-+ - mapping_addr_ + loading_addr_) & 0x7fffffff;
-+ } else {
-+ // This is the last EXIDX entry in the sequence, so we don't
-+ // have an address for the start of the next function, to limit
-+ // this one. Instead use the address of the last byte of the
-+ // text section associated with this .exidx section, that we
-+ // have been given. So as to avoid junking up the CFI unwind
-+ // tables with absurdly large address ranges in the case where
-+ // text_last_svma_ is wrong, only use the value if it is nonzero
-+ // and within one page of |addr|. Otherwise assume a length of 1.
-+ //
-+ // In some cases, gcc has been observed to finish the exidx
-+ // section with an entry of length 1 marked CANT_UNWIND,
-+ // presumably exactly for the purpose of giving a definite
-+ // length for the last real entry, without having to look at
-+ // text segment boundaries.
-+ bool plausible = false;
-+ next_addr = addr + 1;
-+ if (text_last_svma_ != 0) {
-+ uint32_t maybe_next_addr = text_last_svma_ + 1;
-+ if (maybe_next_addr > addr && maybe_next_addr - addr <= 4096) {
-+ next_addr = maybe_next_addr;
-+ plausible = true;
-+ }
-+ }
-+ if (!plausible) {
-+ fprintf(stderr, "ExceptionTableInfo: implausible EXIDX last entry size "
-+ "%d, using 1 instead.", (int32_t)(text_last_svma_ - addr));
-+ }
-+ }
-+
-+ // Extract the unwind info into |buf|. This might fail for
-+ // various reasons. It involves reading both the .exidx and
-+ // .extab sections. All accesses to those sections are
-+ // bounds-checked.
-+ uint8_t buf[ARM_EXIDX_TABLE_LIMIT];
-+ size_t buf_used = 0;
-+ ExExtractResult res = ExtabEntryExtract(entry, buf, sizeof(buf), &buf_used);
-+ if (res != ExSuccess) {
-+ // Couldn't extract the unwind info, for some reason. Move on.
-+ switch (res) {
-+ case ExInBufOverflow:
-+ fprintf(stderr, "ExtabEntryExtract: .exidx/.extab section overrun");
-+ break;
-+ case ExOutBufOverflow:
-+ fprintf(stderr, "ExtabEntryExtract: bytecode buffer overflow");
-+ break;
-+ case ExCantUnwind:
-+ fprintf(stderr, "ExtabEntryExtract: function is marked CANT_UNWIND");
-+ break;
-+ case ExCantRepresent:
-+ fprintf(stderr, "ExtabEntryExtract: bytecode can't be represented");
-+ break;
-+ case ExInvalid:
-+ fprintf(stderr, "ExtabEntryExtract: index table entry is invalid");
-+ break;
-+ default:
-+ fprintf(stderr, "ExtabEntryExtract: unknown error: %d", (int)res);
-+ break;
-+ }
-+ continue;
-+ }
-+
-+ // Finally, work through the unwind instructions in |buf| and
-+ // create CFI entries that Breakpad can use. This can also fail.
-+ // First, add a new stack frame entry, into which ExtabEntryDecode
-+ // will write the CFI entries.
-+ if (!handler_->HasStackFrame(addr, next_addr - addr)) {
-+ handler_->AddStackFrame(addr, next_addr - addr);
-+ int ret = ExtabEntryDecode(buf, buf_used);
-+ if (ret < 0) {
-+ handler_->DeleteStackFrame();
-+ fprintf(stderr, "ExtabEntryDecode: failed with error code: %d", ret);
-+ continue;
-+ }
-+ handler_->SubmitStackFrame();
-+ }
-+
-+ } /* iterating over .exidx */
-+}
-+
-+} // namespace arm_ex_reader
-diff --git a/src/common/arm_ex_reader.h b/src/common/arm_ex_reader.h
-new file mode 100644
-index 0000000..9b54e8a
---- /dev/null
-+++ b/src/common/arm_ex_reader.h
-@@ -0,0 +1,114 @@
-+/* libunwind - a platform-independent unwind library
-+ Copyright 2011 Linaro Limited
-+
-+This file is part of libunwind.
-+
-+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. */
-+
-+// Copyright (c) 2010 Google Inc.
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions are
-+// met:
-+//
-+// * Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// * Redistributions in binary form must reproduce the above
-+// copyright notice, this list of conditions and the following disclaimer
-+// in the documentation and/or other materials provided with the
-+// distribution.
-+// * Neither the name of Google Inc. nor the names of its
-+// contributors may be used to endorse or promote products derived from
-+// this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+// Derived from libunwind, with extensive modifications.
-+
-+#ifndef COMMON_ARM_EX_READER_H__
-+#define COMMON_ARM_EX_READER_H__
-+
-+#include "common/arm_ex_to_module.h"
-+#include "common/memory_range.h"
-+
-+namespace arm_ex_reader {
-+
-+// This class is a reader for ARM unwind information
-+// from .ARM.exidx and .ARM.extab sections.
-+class ExceptionTableInfo {
-+ public:
-+ ExceptionTableInfo(const char* exidx, size_t exidx_size,
-+ const char* extab, size_t extab_size,
-+ uint32_t text_last_svma,
-+ arm_ex_to_module::ARMExToModule* handler,
-+ const char* mapping_addr,
-+ uint32_t loading_addr)
-+ : mr_exidx_(google_breakpad::MemoryRange(exidx, exidx_size)),
-+ mr_extab_(google_breakpad::MemoryRange(extab, extab_size)),
-+ text_last_svma_(text_last_svma),
-+ handler_(handler), mapping_addr_(mapping_addr),
-+ loading_addr_(loading_addr) { }
-+
-+ ~ExceptionTableInfo() { }
-+
-+ // Parses the entries in .ARM.exidx and possibly
-+ // in .ARM.extab tables, reports what we find to
-+ // arm_ex_to_module::ARMExToModule.
-+ void Start();
-+
-+ private:
-+ google_breakpad::MemoryRange mr_exidx_;
-+ google_breakpad::MemoryRange mr_extab_;
-+ uint32_t text_last_svma_;
-+ arm_ex_to_module::ARMExToModule* handler_;
-+ const char* mapping_addr_;
-+ uint32_t loading_addr_;
-+
-+ enum ExExtractResult {
-+ ExSuccess, // success
-+ ExInBufOverflow, // out-of-range while reading .exidx
-+ ExOutBufOverflow, // output buffer is too small
-+ ExCantUnwind, // this function is marked CANT_UNWIND
-+ ExCantRepresent, // entry valid, but we can't represent it
-+ ExInvalid // entry is invalid
-+ };
-+ ExExtractResult
-+ ExtabEntryExtract(const struct arm_ex_to_module::exidx_entry* entry,
-+ uint8_t* buf, size_t buf_size,
-+ size_t* buf_used);
-+
-+ int ExtabEntryDecode(const uint8_t* buf, size_t buf_size);
-+};
-+
-+} // namespace arm_ex_reader
-+
-+#endif // COMMON_ARM_EX_READER_H__
-diff --git a/src/common/arm_ex_to_module.cc b/src/common/arm_ex_to_module.cc
-new file mode 100644
-index 0000000..c326744
---- /dev/null
-+++ b/src/common/arm_ex_to_module.cc
-@@ -0,0 +1,209 @@
-+
-+/* libunwind - a platform-independent unwind library
-+ Copyright 2011 Linaro Limited
-+
-+This file is part of libunwind.
-+
-+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. */
-+
-+// Copyright (c) 2010 Google Inc.
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions are
-+// met:
-+//
-+// * Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// * Redistributions in binary form must reproduce the above
-+// copyright notice, this list of conditions and the following disclaimer
-+// in the documentation and/or other materials provided with the
-+// distribution.
-+// * Neither the name of Google Inc. nor the names of its
-+// contributors may be used to endorse or promote products derived from
-+// this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+// Derived from libunwind, with extensive modifications.
-+
-+#include "common/arm_ex_to_module.h"
-+
-+#include <stdio.h>
-+#include <assert.h>
-+
-+// For big-picture comments on how the EXIDX reader works,
-+// see arm_ex_reader.cc.
-+
-+#define ARM_EXBUF_START(x) (((x) >> 4) & 0x0f)
-+#define ARM_EXBUF_COUNT(x) ((x) & 0x0f)
-+#define ARM_EXBUF_END(x) (ARM_EXBUF_START(x) + ARM_EXBUF_COUNT(x))
-+
-+using google_breakpad::Module;
-+
-+namespace arm_ex_to_module {
-+
-+static const char* const regnames[] = {
-+ "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
-+ "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc",
-+ "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
-+ "fps", "cpsr"
-+};
-+
-+// Translate command from extab_data to command for Module.
-+int ARMExToModule::TranslateCmd(const struct extab_data* edata,
-+ Module::StackFrameEntry* entry, string& vsp) {
-+ int ret = 0;
-+ switch (edata->cmd) {
-+ case ARM_EXIDX_CMD_FINISH:
-+ /* Copy LR to PC if there isn't currently a rule for PC in force. */
-+ if (entry->initial_rules.find("pc")
-+ == entry->initial_rules.end()) {
-+ if (entry->initial_rules.find("lr")
-+ == entry->initial_rules.end()) {
-+ entry->initial_rules["pc"] = "lr";
-+ } else {
-+ entry->initial_rules["pc"] = entry->initial_rules["lr"];
-+ }
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_SUB_FROM_VSP:
-+ {
-+ char c[16];
-+ sprintf(c, " %d -", edata->data);
-+ vsp += c;
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_ADD_TO_VSP:
-+ {
-+ char c[16];
-+ sprintf(c, " %d +", edata->data);
-+ vsp += c;
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_REG_POP:
-+ for (unsigned int i = 0; i < 16; i++) {
-+ if (edata->data & (1 << i)) {
-+ entry->initial_rules[regnames[i]]
-+ = vsp + " ^";
-+ vsp += " 4 +";
-+ }
-+ }
-+ /* Set cfa in case the SP got popped. */
-+ if (edata->data & (1 << 13)) {
-+ vsp = entry->initial_rules["sp"];
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_REG_TO_SP: {
-+ assert (edata->data < 16);
-+ const char* const regname = regnames[edata->data];
-+ if (entry->initial_rules.find(regname) == entry->initial_rules.end()) {
-+ entry->initial_rules["sp"] = regname;
-+ } else {
-+ entry->initial_rules["sp"] = entry->initial_rules[regname];
-+ }
-+ vsp = entry->initial_rules["sp"];
-+ break;
-+ }
-+ case ARM_EXIDX_CMD_VFP_POP:
-+ /* Don't recover VFP registers, but be sure to adjust the stack
-+ pointer. */
-+ for (unsigned int i = ARM_EXBUF_START(edata->data);
-+ i <= ARM_EXBUF_END(edata->data); i++) {
-+ vsp += " 8 +";
-+ }
-+ if (!(edata->data & ARM_EXIDX_VFP_FSTMD)) {
-+ vsp += " 4 +";
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_WREG_POP:
-+ for (unsigned int i = ARM_EXBUF_START(edata->data);
-+ i <= ARM_EXBUF_END(edata->data); i++) {
-+ vsp += " 8 +";
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_WCGR_POP:
-+ // Pop wCGR registers under mask {wCGR3,2,1,0}, hence "i < 4"
-+ for (unsigned int i = 0; i < 4; i++) {
-+ if (edata->data & (1 << i)) {
-+ vsp += " 4 +";
-+ }
-+ }
-+ break;
-+ case ARM_EXIDX_CMD_REFUSED:
-+ case ARM_EXIDX_CMD_RESERVED:
-+ ret = -1;
-+ break;
-+ }
-+ return ret;
-+}
-+
-+bool ARMExToModule::HasStackFrame(uintptr_t addr, size_t size) {
-+ // Invariant: the range [addr,covered) is covered by existing stack
-+ // frame entries.
-+ uintptr_t covered = addr;
-+ while (covered < addr + size) {
-+ const Module::StackFrameEntry *old_entry =
-+ module_->FindStackFrameEntryByAddress(covered);
-+ if (!old_entry) {
-+ return false;
-+ }
-+ covered = old_entry->address + old_entry->size;
-+ }
-+ return true;
-+}
-+
-+void ARMExToModule::AddStackFrame(uintptr_t addr, size_t size) {
-+ stack_frame_entry_ = new Module::StackFrameEntry;
-+ stack_frame_entry_->address = addr;
-+ stack_frame_entry_->size = size;
-+ stack_frame_entry_->initial_rules[".cfa"] = "sp";
-+ vsp_ = "sp";
-+}
-+
-+int ARMExToModule::ImproveStackFrame(const struct extab_data* edata) {
-+ return TranslateCmd(edata, stack_frame_entry_, vsp_) ;
-+}
-+
-+void ARMExToModule::DeleteStackFrame() {
-+ delete stack_frame_entry_;
-+}
-+
-+void ARMExToModule::SubmitStackFrame() {
-+ // return address always winds up in pc
-+ stack_frame_entry_->initial_rules[".ra"]
-+ = stack_frame_entry_->initial_rules["pc"];
-+ // the final value of vsp is the new value of sp
-+ stack_frame_entry_->initial_rules["sp"] = vsp_;
-+ module_->AddStackFrameEntry(stack_frame_entry_);
-+}
-+
-+} // namespace arm_ex_to_module
-diff --git a/src/common/arm_ex_to_module.h b/src/common/arm_ex_to_module.h
-new file mode 100644
-index 0000000..f413a16
---- /dev/null
-+++ b/src/common/arm_ex_to_module.h
-@@ -0,0 +1,119 @@
-+/* libunwind - a platform-independent unwind library
-+ Copyright 2011 Linaro Limited
-+
-+This file is part of libunwind.
-+
-+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. */
-+
-+// Copyright (c) 2010 Google Inc.
-+// All rights reserved.
-+//
-+// Redistribution and use in source and binary forms, with or without
-+// modification, are permitted provided that the following conditions are
-+// met:
-+//
-+// * Redistributions of source code must retain the above copyright
-+// notice, this list of conditions and the following disclaimer.
-+// * Redistributions in binary form must reproduce the above
-+// copyright notice, this list of conditions and the following disclaimer
-+// in the documentation and/or other materials provided with the
-+// distribution.
-+// * Neither the name of Google Inc. nor the names of its
-+// contributors may be used to endorse or promote products derived from
-+// this software without specific prior written permission.
-+//
-+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-+
-+
-+// Derived from libunwind, with extensive modifications.
-+
-+#ifndef COMMON_ARM_EX_TO_MODULE__
-+#define COMMON_ARM_EX_TO_MODULE__
-+
-+#include "common/module.h"
-+
-+#include <string.h>
-+
-+namespace arm_ex_to_module {
-+
-+using google_breakpad::Module;
-+
-+typedef enum extab_cmd {
-+ ARM_EXIDX_CMD_FINISH,
-+ ARM_EXIDX_CMD_SUB_FROM_VSP,
-+ ARM_EXIDX_CMD_ADD_TO_VSP,
-+ ARM_EXIDX_CMD_REG_POP,
-+ ARM_EXIDX_CMD_REG_TO_SP,
-+ ARM_EXIDX_CMD_VFP_POP,
-+ ARM_EXIDX_CMD_WREG_POP,
-+ ARM_EXIDX_CMD_WCGR_POP,
-+ ARM_EXIDX_CMD_RESERVED,
-+ ARM_EXIDX_CMD_REFUSED,
-+} extab_cmd_t;
-+
-+struct exidx_entry {
-+ uint32_t addr;
-+ uint32_t data;
-+};
-+
-+struct extab_data {
-+ extab_cmd_t cmd;
-+ uint32_t data;
-+};
-+
-+enum extab_cmd_flags {
-+ ARM_EXIDX_VFP_SHIFT_16 = 1 << 16,
-+ ARM_EXIDX_VFP_FSTMD = 1 << 17, // distinguishes FSTMxxD from FSTMxxX
-+};
-+
-+// Receives information from arm_ex_reader::ExceptionTableInfo
-+// and adds it to the Module object
-+class ARMExToModule {
-+ public:
-+ ARMExToModule(Module* module)
-+ : module_(module) { }
-+ ~ARMExToModule() { }
-+ bool HasStackFrame(uintptr_t addr, size_t size);
-+ void AddStackFrame(uintptr_t addr, size_t size);
-+ int ImproveStackFrame(const struct extab_data* edata);
-+ void DeleteStackFrame();
-+ void SubmitStackFrame();
-+ private:
-+ Module* module_;
-+ Module::StackFrameEntry* stack_frame_entry_;
-+ string vsp_;
-+ int TranslateCmd(const struct extab_data* edata,
-+ Module::StackFrameEntry* entry,
-+ string& vsp);
-+};
-+
-+} // namespace arm_ex_to_module
-+
-+#endif // COMMON_ARM_EX_TO_MODULE__
-diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc
-index 1e96ca6..4222ce3 100644
---- a/src/common/linux/dump_symbols.cc
-+++ b/src/common/linux/dump_symbols.cc
-@@ -52,6 +52,7 @@
- #include <utility>
- #include <vector>
-
-+#include "common/arm_ex_reader.h"
- #include "common/dwarf/bytereader-inl.h"
- #include "common/dwarf/dwarf2diehandler.h"
- #include "common/dwarf_cfi_to_module.h"
-@@ -71,6 +72,11 @@
- #endif
- #include "common/using_std_string.h"
-
-+#ifndef SHT_ARM_EXIDX
-+// bionic and older glibc don't define this
-+# define SHT_ARM_EXIDX (SHT_LOPROC + 1)
-+#endif
-+
- // This namespace contains helper functions.
- namespace {
-
-@@ -373,6 +379,52 @@ bool LoadDwarfCFI(const string& dwarf_filename,
- return true;
- }
-
-+template<typename ElfClass>
-+bool LoadARMexidx(const typename ElfClass::Ehdr* elf_header,
-+ const typename ElfClass::Shdr* exidx_section,
-+ const typename ElfClass::Shdr* extab_section,
-+ uint32_t loading_addr,
-+ Module* module) {
-+ // To do this properly we need to know:
-+ // * the bounds of the .ARM.exidx section in the mapped image
-+ // * the bounds of the .ARM.extab section in the mapped image
-+ // * the vma of the last byte in the text section associated with the .exidx
-+ // The first two are easy. The third is a bit tricky. If we can't
-+ // figure out what it is, just pass in zero.
-+ const char *exidx_img
-+ = GetOffset<ElfClass, char>(elf_header, exidx_section->sh_offset);
-+ size_t exidx_size = exidx_section->sh_size;
-+ const char *extab_img
-+ = GetOffset<ElfClass, char>(elf_header, extab_section->sh_offset);
-+ size_t extab_size = extab_section->sh_size;
-+
-+ // The sh_link field of the exidx section gives the section number
-+ // for the associated text section.
-+ uint32_t exidx_text_last_svma = 0;
-+ int exidx_text_sno = exidx_section->sh_link;
-+ typedef typename ElfClass::Shdr Shdr;
-+ // |sections| points to the section header table
-+ const Shdr* sections
-+ = GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
-+ const int num_sections = elf_header->e_shnum;
-+ if (exidx_text_sno >= 0 && exidx_text_sno < num_sections) {
-+ const Shdr* exidx_text_shdr = &sections[exidx_text_sno];
-+ if (exidx_text_shdr->sh_size > 0) {
-+ exidx_text_last_svma
-+ = exidx_text_shdr->sh_addr + exidx_text_shdr->sh_size - 1;
-+ }
-+ }
-+
-+ arm_ex_to_module::ARMExToModule handler(module);
-+ arm_ex_reader::ExceptionTableInfo
-+ parser(exidx_img, exidx_size, extab_img, extab_size, exidx_text_last_svma,
-+ &handler,
-+ reinterpret_cast<const char*>(elf_header),
-+ loading_addr);
-+ parser.Start();
-+ return true;
-+}
-+
- bool LoadELF(const string& obj_file, MmapWrapper* map_wrapper,
- void** elf_header) {
- int obj_fd = open(obj_file.c_str(), O_RDONLY);
-@@ -756,6 +808,29 @@ bool LoadSymbols(const string& obj_file,
- }
- }
-
-+ // ARM has special unwind tables that can be used.
-+ const Shdr* arm_exidx_section =
-+ FindElfSectionByName<ElfClass>(".ARM.exidx", SHT_ARM_EXIDX,
-+ sections, names, names_end,
-+ elf_header->e_shnum);
-+ const Shdr* arm_extab_section =
-+ FindElfSectionByName<ElfClass>(".ARM.extab", SHT_PROGBITS,
-+ sections, names, names_end,
-+ elf_header->e_shnum);
-+ // Load information from these sections even if there is
-+ // .debug_info, because some functions (e.g., hand-written or
-+ // script-generated assembly) could have exidx entries but no DWARF.
-+ // (For functions with both, the DWARF info that has already been
-+ // parsed will take precedence.)
-+ if (arm_exidx_section && arm_extab_section && options.symbol_data != NO_CFI) {
-+ info->LoadedSection(".ARM.exidx");
-+ info->LoadedSection(".ARM.extab");
-+ bool result = LoadARMexidx<ElfClass>(elf_header,
-+ arm_exidx_section, arm_extab_section,
-+ loading_addr, module);
-+ found_usable_info = found_usable_info || result;
-+ }
-+
- if (!found_debug_info_section) {
- fprintf(stderr, "%s: file contains no debugging information"
- " (no \".stab\" or \".debug_info\" sections)\n",
-diff --git a/src/common/module.cc b/src/common/module.cc
-index fa798f4..ca52f9f 100644
---- a/src/common/module.cc
-+++ b/src/common/module.cc
-@@ -63,7 +63,7 @@ Module::~Module() {
- it != functions_.end(); ++it) {
- delete *it;
- }
-- for (vector<StackFrameEntry *>::iterator it = stack_frame_entries_.begin();
-+ for (StackFrameEntrySet::iterator it = stack_frame_entries_.begin();
- it != stack_frame_entries_.end(); ++it) {
- delete *it;
- }
-@@ -119,8 +119,14 @@ void Module::AddFunctions(vector<Function *>::iterator begin,
- AddFunction(*it);
- }
-
--void Module::AddStackFrameEntry(StackFrameEntry *stack_frame_entry) {
-- stack_frame_entries_.push_back(stack_frame_entry);
-+void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) {
-+ std::pair<StackFrameEntrySet::iterator,bool> ret =
-+ stack_frame_entries_.insert(stack_frame_entry);
-+ if (!ret.second) {
-+ // Free the duplicate that was not inserted because this Module
-+ // now owns it.
-+ delete stack_frame_entry;
-+ }
- }
-
- void Module::AddExtern(Extern *ext) {
-@@ -180,8 +186,25 @@ void Module::GetFiles(vector<File *> *vec) {
- vec->push_back(it->second);
- }
-
--void Module::GetStackFrameEntries(vector<StackFrameEntry *> *vec) const {
-- *vec = stack_frame_entries_;
-+void Module::GetStackFrameEntries(vector<StackFrameEntry*>* vec) const {
-+ vec->clear();
-+ vec->insert(vec->begin(), stack_frame_entries_.begin(),
-+ stack_frame_entries_.end());
-+}
-+
-+Module::StackFrameEntry* Module::FindStackFrameEntryByAddress(Address address) {
-+ StackFrameEntry search;
-+ search.address = address;
-+ StackFrameEntrySet::iterator it = stack_frame_entries_.upper_bound(&search);
-+
-+ if (it == stack_frame_entries_.begin())
-+ return NULL;
-+
-+ it--;
-+ if ((*it)->address <= address && address < (*it)->address + (*it)->size)
-+ return *it;
-+
-+ return NULL;
- }
-
- void Module::AssignSourceIds() {
-@@ -286,7 +309,7 @@ bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
-
- if (symbol_data != NO_CFI) {
- // Write out 'STACK CFI INIT' and 'STACK CFI' records.
-- vector<StackFrameEntry *>::const_iterator frame_it;
-+ StackFrameEntrySet::const_iterator frame_it;
- for (frame_it = stack_frame_entries_.begin();
- frame_it != stack_frame_entries_.end(); ++frame_it) {
- StackFrameEntry *entry = *frame_it;
-diff --git a/src/common/module.h b/src/common/module.h
-index 65b5595..299bc38 100644
---- a/src/common/module.h
-+++ b/src/common/module.h
-@@ -176,6 +176,13 @@ class Module {
- }
- };
-
-+ struct StackFrameEntryCompare {
-+ bool operator() (const StackFrameEntry* lhs,
-+ const StackFrameEntry* rhs) const {
-+ return lhs->address < rhs->address;
-+ }
-+ };
-+
- // Create a new module with the given name, operating system,
- // architecture, and ID string.
- Module(const string &name, const string &os, const string &architecture,
-@@ -256,6 +263,10 @@ class Module {
- // a more appropriate interface.)
- void GetStackFrameEntries(vector<StackFrameEntry *> *vec) const;
-
-+ // If this module has a StackFrameEntry whose address range covers
-+ // ADDRESS, return it. Otherwise return NULL.
-+ StackFrameEntry* FindStackFrameEntryByAddress(Address address);
-+
- // Find those files in this module that are actually referred to by
- // functions' line number data, and assign them source id numbers.
- // Set the source id numbers for all other files --- unused by the
-@@ -316,6 +327,9 @@ class Module {
- // A set containing Extern structures, sorted by address.
- typedef set<Extern *, ExternCompare> ExternSet;
-
-+ // A set containing StackFrameEntry structures, sorted by address.
-+ typedef set<StackFrameEntry*, StackFrameEntryCompare> StackFrameEntrySet;
-+
- // The module owns all the files and functions that have been added
- // to it; destroying the module frees the Files and Functions these
- // point to.
-@@ -324,7 +338,7 @@ class Module {
-
- // The module owns all the call frame info entries that have been
- // added to it.
-- vector<StackFrameEntry *> stack_frame_entries_;
-+ StackFrameEntrySet stack_frame_entries_;
-
- // The module owns all the externs that have been added to it;
- // destroying the module frees the Externs these point to.
-diff --git a/src/common/module_unittest.cc b/src/common/module_unittest.cc
-index 0b64327..bf72736 100644
---- a/src/common/module_unittest.cc
-+++ b/src/common/module_unittest.cc
-@@ -326,11 +326,6 @@ TEST(Construct, AddFrames) {
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
-- "STACK CFI INIT ddb5f41285aa7757 1486493370dc5073 \n"
-- "STACK CFI INIT 8064f3af5e067e38 de2a5ee55509407"
-- " .cfa: I think that I shall never see"
-- " cannoli: a tree whose hungry mouth is prest"
-- " stromboli: a poem lovely as a tree\n"
- "STACK CFI INIT 5e8d0db0a7075c6c 1c7edb12a7aea229"
- " .cfa: Whose woods are these\n"
- "STACK CFI 36682fad3763ffff"
-@@ -338,7 +333,12 @@ TEST(Construct, AddFrames) {
- " stromboli: his house is in\n"
- "STACK CFI 47ceb0f63c269d7f"
- " calzone: the village though"
-- " cannoli: he will not see me stopping here\n",
-+ " cannoli: he will not see me stopping here\n"
-+ "STACK CFI INIT 8064f3af5e067e38 de2a5ee55509407"
-+ " .cfa: I think that I shall never see"
-+ " cannoli: a tree whose hungry mouth is prest"
-+ " stromboli: a poem lovely as a tree\n"
-+ "STACK CFI INIT ddb5f41285aa7757 1486493370dc5073 \n",
- contents.c_str());
-
- // Check that GetStackFrameEntries works.
-@@ -346,10 +346,18 @@ TEST(Construct, AddFrames) {
- m.GetStackFrameEntries(&entries);
- ASSERT_EQ(3U, entries.size());
- // Check first entry.
-- EXPECT_EQ(0xddb5f41285aa7757ULL, entries[0]->address);
-- EXPECT_EQ(0x1486493370dc5073ULL, entries[0]->size);
-- ASSERT_EQ(0U, entries[0]->initial_rules.size());
-- ASSERT_EQ(0U, entries[0]->rule_changes.size());
-+ EXPECT_EQ(0x5e8d0db0a7075c6cULL, entries[0]->address);
-+ EXPECT_EQ(0x1c7edb12a7aea229ULL, entries[0]->size);
-+ Module::RuleMap entry1_initial;
-+ entry1_initial[".cfa"] = "Whose woods are these";
-+ EXPECT_THAT(entries[0]->initial_rules, ContainerEq(entry1_initial));
-+ Module::RuleChangeMap entry1_changes;
-+ entry1_changes[0x36682fad3763ffffULL][".cfa"] = "I think I know";
-+ entry1_changes[0x36682fad3763ffffULL]["stromboli"] = "his house is in";
-+ entry1_changes[0x47ceb0f63c269d7fULL]["calzone"] = "the village though";
-+ entry1_changes[0x47ceb0f63c269d7fULL]["cannoli"] =
-+ "he will not see me stopping here";
-+ EXPECT_THAT(entries[0]->rule_changes, ContainerEq(entry1_changes));
- // Check second entry.
- EXPECT_EQ(0x8064f3af5e067e38ULL, entries[1]->address);
- EXPECT_EQ(0x0de2a5ee55509407ULL, entries[1]->size);
-@@ -361,18 +369,10 @@ TEST(Construct, AddFrames) {
- EXPECT_THAT(entries[1]->initial_rules, ContainerEq(entry2_initial));
- ASSERT_EQ(0U, entries[1]->rule_changes.size());
- // Check third entry.
-- EXPECT_EQ(0x5e8d0db0a7075c6cULL, entries[2]->address);
-- EXPECT_EQ(0x1c7edb12a7aea229ULL, entries[2]->size);
-- Module::RuleMap entry3_initial;
-- entry3_initial[".cfa"] = "Whose woods are these";
-- EXPECT_THAT(entries[2]->initial_rules, ContainerEq(entry3_initial));
-- Module::RuleChangeMap entry3_changes;
-- entry3_changes[0x36682fad3763ffffULL][".cfa"] = "I think I know";
-- entry3_changes[0x36682fad3763ffffULL]["stromboli"] = "his house is in";
-- entry3_changes[0x47ceb0f63c269d7fULL]["calzone"] = "the village though";
-- entry3_changes[0x47ceb0f63c269d7fULL]["cannoli"] =
-- "he will not see me stopping here";
-- EXPECT_THAT(entries[2]->rule_changes, ContainerEq(entry3_changes));
-+ EXPECT_EQ(0xddb5f41285aa7757ULL, entries[2]->address);
-+ EXPECT_EQ(0x1486493370dc5073ULL, entries[2]->size);
-+ ASSERT_EQ(0U, entries[2]->initial_rules.size());
-+ ASSERT_EQ(0U, entries[2]->rule_changes.size());
- }
-
- TEST(Construct, UniqueFiles) {
-@@ -544,3 +544,62 @@ TEST(Construct, FunctionsAndThumbExternsWithSameAddress) {
- "PUBLIC cc00 0 arm_func\n",
- contents.c_str());
- }
-+
-+TEST(Lookup, StackFrameEntries) {
-+ Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-+
-+ // First STACK CFI entry, with no initial rules or deltas.
-+ Module::StackFrameEntry *entry1 = new Module::StackFrameEntry();
-+ entry1->address = 0x2000;
-+ entry1->size = 0x900;
-+ m.AddStackFrameEntry(entry1);
-+
-+ // Second STACK CFI entry, with initial rules but no deltas.
-+ Module::StackFrameEntry *entry2 = new Module::StackFrameEntry();
-+ entry2->address = 0x3000;
-+ entry2->size = 0x900;
-+ entry2->initial_rules[".cfa"] = "I think that I shall never see";
-+ entry2->initial_rules["stromboli"] = "a poem lovely as a tree";
-+ entry2->initial_rules["cannoli"] = "a tree whose hungry mouth is prest";
-+ m.AddStackFrameEntry(entry2);
-+
-+ // Third STACK CFI entry, with initial rules and deltas.
-+ Module::StackFrameEntry *entry3 = new Module::StackFrameEntry();
-+ entry3->address = 0x1000;
-+ entry3->size = 0x900;
-+ entry3->initial_rules[".cfa"] = "Whose woods are these";
-+ entry3->rule_changes[0x47ceb0f63c269d7fULL]["calzone"] =
-+ "the village though";
-+ entry3->rule_changes[0x47ceb0f63c269d7fULL]["cannoli"] =
-+ "he will not see me stopping here";
-+ entry3->rule_changes[0x36682fad3763ffffULL]["stromboli"] =
-+ "his house is in";
-+ entry3->rule_changes[0x36682fad3763ffffULL][".cfa"] =
-+ "I think I know";
-+ m.AddStackFrameEntry(entry3);
-+
-+ Module::StackFrameEntry* s = m.FindStackFrameEntryByAddress(0x1000);
-+ EXPECT_EQ(entry3, s);
-+ s = m.FindStackFrameEntryByAddress(0x18FF);
-+ EXPECT_EQ(entry3, s);
-+
-+ s = m.FindStackFrameEntryByAddress(0x1900);
-+ EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
-+ s = m.FindStackFrameEntryByAddress(0x1A00);
-+ EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
-+
-+ s = m.FindStackFrameEntryByAddress(0x2000);
-+ EXPECT_EQ(entry1, s);
-+ s = m.FindStackFrameEntryByAddress(0x28FF);
-+ EXPECT_EQ(entry1, s);
-+
-+ s = m.FindStackFrameEntryByAddress(0x3000);
-+ EXPECT_EQ(entry2, s);
-+ s = m.FindStackFrameEntryByAddress(0x38FF);
-+ EXPECT_EQ(entry2, s);
-+
-+ s = m.FindStackFrameEntryByAddress(0x3900);
-+ EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
-+ s = m.FindStackFrameEntryByAddress(0x3A00);
-+ EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
-+}
diff --git a/toolkit/crashreporter/breakpad-patches/README b/toolkit/crashreporter/breakpad-patches/README
deleted file mode 100644
index b3f23b255f..0000000000
--- a/toolkit/crashreporter/breakpad-patches/README
+++ /dev/null
@@ -1,4 +0,0 @@
-Do not land local patches to Breakpad without the approval of
-Ted Mielczarek <ted@mielczarek.org>
-
-All local patches must be in the process of being upstreamed. \ No newline at end of file
diff --git a/toolkit/crashreporter/breakpad-windows-libxul/moz.build b/toolkit/crashreporter/breakpad-windows-libxul/moz.build
deleted file mode 100644
index 347ad36aee..0000000000
--- a/toolkit/crashreporter/breakpad-windows-libxul/moz.build
+++ /dev/null
@@ -1,32 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- '../google-breakpad/src/common/windows/http_upload.cc',
-]
-
-Library('google_breakpad_libxul_s')
-
-FINAL_LIBRARY = 'xul'
-
-for var in ('UNICODE', 'UNICODE_', 'BREAKPAD_NO_TERMINATE_THREAD'):
- DEFINES[var] = True
-
-LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src',
-]
-
-include('/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild')
-include('/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild')
-include('/toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mozbuild')
-include('/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild')
-
-SOURCES += objs_common
-SOURCES += objs_crash_generation
-SOURCES += objs_handler
-SOURCES += objs_sender
-
-DISABLE_STL_WRAPPING = True
diff --git a/toolkit/crashreporter/breakpad-windows-standalone/moz.build b/toolkit/crashreporter/breakpad-windows-standalone/moz.build
deleted file mode 100644
index a732ff99fa..0000000000
--- a/toolkit/crashreporter/breakpad-windows-standalone/moz.build
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-FINAL_LIBRARY = 'breakpadinjector'
-
-for var in ('UNICODE', 'UNICODE_', 'BREAKPAD_NO_TERMINATE_THREAD'):
- DEFINES[var] = True
-
-LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src',
-]
-
-include('/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild')
-include('/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild')
-include('/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild')
-
-SOURCES += objs_common
-SOURCES += objs_crash_generation
-SOURCES += objs_handler
-
-USE_STATIC_LIBS = True
-
-DISABLE_STL_WRAPPING = True
diff --git a/toolkit/crashreporter/client/Makefile.in b/toolkit/crashreporter/client/Makefile.in
deleted file mode 100644
index 88be52dff3..0000000000
--- a/toolkit/crashreporter/client/Makefile.in
+++ /dev/null
@@ -1,20 +0,0 @@
-# vim:set ts=8 sw=8 sts=8 noet:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-ifeq ($(OS_ARCH),WINNT)
-MOZ_WINCONSOLE = 0
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-ifeq ($(OS_ARCH),Darwin)
-libs::
- $(NSINSTALL) -D $(DIST)/bin/crashreporter.app
- rsync -a -C --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/bin/crashreporter.app
- sed -e 's/%APP_NAME%/$(MOZ_APP_DISPLAYNAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | \
- iconv -f UTF-8 -t UTF-16 > $(DIST)/bin/crashreporter.app/Contents/Resources/English.lproj/InfoPlist.strings
- $(NSINSTALL) -D $(DIST)/bin/crashreporter.app/Contents/MacOS
- $(NSINSTALL) $(DIST)/bin/crashreporter $(DIST)/bin/crashreporter.app/Contents/MacOS
-endif
diff --git a/toolkit/crashreporter/client/Throbber-small.avi b/toolkit/crashreporter/client/Throbber-small.avi
deleted file mode 100644
index 640ea62c0e..0000000000
--- a/toolkit/crashreporter/client/Throbber-small.avi
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/client/crashreporter.cpp b/toolkit/crashreporter/client/crashreporter.cpp
deleted file mode 100644
index 10aa65dd24..0000000000
--- a/toolkit/crashreporter/client/crashreporter.cpp
+++ /dev/null
@@ -1,759 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "crashreporter.h"
-
-#ifdef _MSC_VER
-// Disable exception handler warnings.
-# pragma warning( disable : 4530 )
-#endif
-
-#include <fstream>
-#include <sstream>
-#include <memory>
-#include <time.h>
-#include <stdlib.h>
-#include <string.h>
-
-using std::string;
-using std::istream;
-using std::ifstream;
-using std::istringstream;
-using std::ostringstream;
-using std::ostream;
-using std::ofstream;
-using std::vector;
-using std::auto_ptr;
-
-namespace CrashReporter {
-
-StringTable gStrings;
-string gSettingsPath;
-string gEventsPath;
-int gArgc;
-char** gArgv;
-
-enum SubmissionResult {Succeeded, Failed};
-
-static auto_ptr<ofstream> gLogStream(nullptr);
-static string gReporterDumpFile;
-static string gExtraFile;
-static string gMemoryFile;
-
-static const char kExtraDataExtension[] = ".extra";
-static const char kMemoryReportExtension[] = ".memory.json.gz";
-
-void UIError(const string& message)
-{
- string errorMessage;
- if (!gStrings[ST_CRASHREPORTERERROR].empty()) {
- char buf[2048];
- UI_SNPRINTF(buf, 2048,
- gStrings[ST_CRASHREPORTERERROR].c_str(),
- message.c_str());
- errorMessage = buf;
- } else {
- errorMessage = message;
- }
-
- UIError_impl(errorMessage);
-}
-
-static string Unescape(const string& str)
-{
- string ret;
- for (string::const_iterator iter = str.begin();
- iter != str.end();
- iter++) {
- if (*iter == '\\') {
- iter++;
- if (*iter == '\\'){
- ret.push_back('\\');
- } else if (*iter == 'n') {
- ret.push_back('\n');
- } else if (*iter == 't') {
- ret.push_back('\t');
- }
- } else {
- ret.push_back(*iter);
- }
- }
-
- return ret;
-}
-
-static string Escape(const string& str)
-{
- string ret;
- for (string::const_iterator iter = str.begin();
- iter != str.end();
- iter++) {
- if (*iter == '\\') {
- ret += "\\\\";
- } else if (*iter == '\n') {
- ret += "\\n";
- } else if (*iter == '\t') {
- ret += "\\t";
- } else {
- ret.push_back(*iter);
- }
- }
-
- return ret;
-}
-
-bool ReadStrings(istream& in, StringTable& strings, bool unescape)
-{
- string currentSection;
- while (!in.eof()) {
- string line;
- std::getline(in, line);
- int sep = line.find('=');
- if (sep >= 0) {
- string key, value;
- key = line.substr(0, sep);
- value = line.substr(sep + 1);
- if (unescape)
- value = Unescape(value);
- strings[key] = value;
- }
- }
-
- return true;
-}
-
-bool ReadStringsFromFile(const string& path,
- StringTable& strings,
- bool unescape)
-{
- ifstream* f = UIOpenRead(path);
- bool success = false;
- if (f->is_open()) {
- success = ReadStrings(*f, strings, unescape);
- f->close();
- }
-
- delete f;
- return success;
-}
-
-bool WriteStrings(ostream& out,
- const string& header,
- StringTable& strings,
- bool escape)
-{
- out << "[" << header << "]" << std::endl;
- for (StringTable::iterator iter = strings.begin();
- iter != strings.end();
- iter++) {
- out << iter->first << "=";
- if (escape)
- out << Escape(iter->second);
- else
- out << iter->second;
-
- out << std::endl;
- }
-
- return true;
-}
-
-bool WriteStringsToFile(const string& path,
- const string& header,
- StringTable& strings,
- bool escape)
-{
- ofstream* f = UIOpenWrite(path.c_str());
- bool success = false;
- if (f->is_open()) {
- success = WriteStrings(*f, header, strings, escape);
- f->close();
- }
-
- delete f;
- return success;
-}
-
-static string Basename(const string& file)
-{
- string::size_type slashIndex = file.rfind(UI_DIR_SEPARATOR);
- if (slashIndex != string::npos)
- return file.substr(slashIndex + 1);
- else
- return file;
-}
-
-static string GetDumpLocalID()
-{
- string localId = Basename(gReporterDumpFile);
- string::size_type dot = localId.rfind('.');
-
- if (dot == string::npos)
- return "";
-
- return localId.substr(0, dot);
-}
-
-// This appends the StackTraces entry generated by the minidump analyzer to the
-// main crash event so that it can be picked up by Firefox once it restarts
-static void AppendStackTracesToEventFile(const string& aStackTraces)
-{
- if (gEventsPath.empty()) {
- // If there is no path for finding the crash event, skip this step.
- return;
- }
-
- string localId = GetDumpLocalID();
- string path = gEventsPath + UI_DIR_SEPARATOR + localId;
- ofstream* f = UIOpenWrite(path.c_str(), true);
-
- if (f->is_open()) {
- *f << "StackTraces=" << aStackTraces;
- f->close();
- }
-
- delete f;
-}
-
-static void WriteSubmissionEvent(SubmissionResult result,
- const string& remoteId)
-{
- if (gEventsPath.empty()) {
- // If there is no path for writing the submission event, skip it.
- return;
- }
-
- string localId = GetDumpLocalID();
- string fpath = gEventsPath + UI_DIR_SEPARATOR + localId + "-submission";
- ofstream* f = UIOpenWrite(fpath.c_str(), false, true);
- time_t tm;
- time(&tm);
-
- if (f->is_open()) {
- *f << "crash.submission.1\n";
- *f << tm << "\n";
- *f << localId << "\n";
- *f << (result == Succeeded ? "true" : "false") << "\n";
- *f << remoteId;
-
- f->close();
- }
-
- delete f;
-}
-
-void LogMessage(const std::string& message)
-{
- if (gLogStream.get()) {
- char date[64];
- time_t tm;
- time(&tm);
- if (strftime(date, sizeof(date) - 1, "%c", localtime(&tm)) == 0)
- date[0] = '\0';
- (*gLogStream) << "[" << date << "] " << message << std::endl;
- }
-}
-
-static void OpenLogFile()
-{
- string logPath = gSettingsPath + UI_DIR_SEPARATOR + "submit.log";
- gLogStream.reset(UIOpenWrite(logPath.c_str(), true));
-}
-
-static bool ReadConfig()
-{
- string iniPath;
- if (!UIGetIniPath(iniPath))
- return false;
-
- if (!ReadStringsFromFile(iniPath, gStrings, true))
- return false;
-
- // See if we have a string override file, if so process it
- char* overrideEnv = getenv("MOZ_CRASHREPORTER_STRINGS_OVERRIDE");
- if (overrideEnv && *overrideEnv && UIFileExists(overrideEnv))
- ReadStringsFromFile(overrideEnv, gStrings, true);
-
- return true;
-}
-
-static string
-GetAdditionalFilename(const string& dumpfile, const char* extension)
-{
- string filename(dumpfile);
- int dot = filename.rfind('.');
- if (dot < 0)
- return "";
-
- filename.replace(dot, filename.length() - dot, extension);
- return filename;
-}
-
-static bool MoveCrashData(const string& toDir,
- string& dumpfile,
- string& extrafile,
- string& memoryfile)
-{
- if (!UIEnsurePathExists(toDir)) {
- UIError(gStrings[ST_ERROR_CREATEDUMPDIR]);
- return false;
- }
-
- string newDump = toDir + UI_DIR_SEPARATOR + Basename(dumpfile);
- string newExtra = toDir + UI_DIR_SEPARATOR + Basename(extrafile);
- string newMemory = toDir + UI_DIR_SEPARATOR + Basename(memoryfile);
-
- if (!UIMoveFile(dumpfile, newDump)) {
- UIError(gStrings[ST_ERROR_DUMPFILEMOVE]);
- return false;
- }
-
- if (!UIMoveFile(extrafile, newExtra)) {
- UIError(gStrings[ST_ERROR_EXTRAFILEMOVE]);
- return false;
- }
-
- if (!memoryfile.empty()) {
- // Ignore errors from moving the memory file
- if (!UIMoveFile(memoryfile, newMemory)) {
- UIDeleteFile(memoryfile);
- newMemory.erase();
- }
- memoryfile = newMemory;
- }
-
- dumpfile = newDump;
- extrafile = newExtra;
-
- return true;
-}
-
-static bool AddSubmittedReport(const string& serverResponse)
-{
- StringTable responseItems;
- istringstream in(serverResponse);
- ReadStrings(in, responseItems, false);
-
- if (responseItems.find("StopSendingReportsFor") != responseItems.end()) {
- // server wants to tell us to stop sending reports for a certain version
- string reportPath =
- gSettingsPath + UI_DIR_SEPARATOR + "EndOfLife" +
- responseItems["StopSendingReportsFor"];
-
- ofstream* reportFile = UIOpenWrite(reportPath);
- if (reportFile->is_open()) {
- // don't really care about the contents
- *reportFile << 1 << "\n";
- reportFile->close();
- }
- delete reportFile;
- }
-
- if (responseItems.find("Discarded") != responseItems.end()) {
- // server discarded this report... save it so the user can resubmit it
- // manually
- return false;
- }
-
- if (responseItems.find("CrashID") == responseItems.end())
- return false;
-
- string submittedDir =
- gSettingsPath + UI_DIR_SEPARATOR + "submitted";
- if (!UIEnsurePathExists(submittedDir)) {
- return false;
- }
-
- string path = submittedDir + UI_DIR_SEPARATOR +
- responseItems["CrashID"] + ".txt";
-
- ofstream* file = UIOpenWrite(path);
- if (!file->is_open()) {
- delete file;
- return false;
- }
-
- char buf[1024];
- UI_SNPRINTF(buf, 1024,
- gStrings["CrashID"].c_str(),
- responseItems["CrashID"].c_str());
- *file << buf << "\n";
-
- if (responseItems.find("ViewURL") != responseItems.end()) {
- UI_SNPRINTF(buf, 1024,
- gStrings["CrashDetailsURL"].c_str(),
- responseItems["ViewURL"].c_str());
- *file << buf << "\n";
- }
-
- file->close();
- delete file;
-
- WriteSubmissionEvent(Succeeded, responseItems["CrashID"]);
- return true;
-}
-
-void DeleteDump()
-{
- const char* noDelete = getenv("MOZ_CRASHREPORTER_NO_DELETE_DUMP");
- if (!noDelete || *noDelete == '\0') {
- if (!gReporterDumpFile.empty())
- UIDeleteFile(gReporterDumpFile);
- if (!gExtraFile.empty())
- UIDeleteFile(gExtraFile);
- if (!gMemoryFile.empty())
- UIDeleteFile(gMemoryFile);
- }
-}
-
-void SendCompleted(bool success, const string& serverResponse)
-{
- if (success) {
- if (AddSubmittedReport(serverResponse)) {
- DeleteDump();
- }
- else {
- string directory = gReporterDumpFile;
- int slashpos = directory.find_last_of("/\\");
- if (slashpos < 2)
- return;
- directory.resize(slashpos);
- UIPruneSavedDumps(directory);
- WriteSubmissionEvent(Failed, "");
- }
- } else {
- WriteSubmissionEvent(Failed, "");
- }
-}
-
-bool ShouldEnableSending()
-{
- srand(time(0));
- return ((rand() % 100) < MOZ_CRASHREPORTER_ENABLE_PERCENT);
-}
-
-} // namespace CrashReporter
-
-using namespace CrashReporter;
-
-void RewriteStrings(StringTable& queryParameters)
-{
- // rewrite some UI strings with the values from the query parameters
- string product = queryParameters["ProductName"];
- string vendor = queryParameters["Vendor"];
- if (vendor.empty()) {
- // Assume Mozilla if no vendor is specified
- vendor = "Mozilla";
- }
-
- char buf[4096];
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_CRASHREPORTERVENDORTITLE].c_str(),
- vendor.c_str());
- gStrings[ST_CRASHREPORTERTITLE] = buf;
-
-
- string str = gStrings[ST_CRASHREPORTERPRODUCTERROR];
- // Only do the replacement here if the string has two
- // format specifiers to start. Otherwise
- // we assume it has the product name hardcoded.
- string::size_type pos = str.find("%s");
- if (pos != string::npos)
- pos = str.find("%s", pos+2);
- if (pos != string::npos) {
- // Leave a format specifier for UIError to fill in
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_CRASHREPORTERPRODUCTERROR].c_str(),
- product.c_str(),
- "%s");
- gStrings[ST_CRASHREPORTERERROR] = buf;
- }
- else {
- // product name is hardcoded
- gStrings[ST_CRASHREPORTERERROR] = str;
- }
-
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_CRASHREPORTERDESCRIPTION].c_str(),
- product.c_str());
- gStrings[ST_CRASHREPORTERDESCRIPTION] = buf;
-
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_CHECKSUBMIT].c_str(),
- vendor.c_str());
- gStrings[ST_CHECKSUBMIT] = buf;
-
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_CHECKEMAIL].c_str(),
- vendor.c_str());
- gStrings[ST_CHECKEMAIL] = buf;
-
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_RESTART].c_str(),
- product.c_str());
- gStrings[ST_RESTART] = buf;
-
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_QUIT].c_str(),
- product.c_str());
- gStrings[ST_QUIT] = buf;
-
- UI_SNPRINTF(buf, sizeof(buf),
- gStrings[ST_ERROR_ENDOFLIFE].c_str(),
- product.c_str());
- gStrings[ST_ERROR_ENDOFLIFE] = buf;
-}
-
-bool CheckEndOfLifed(string version)
-{
- string reportPath =
- gSettingsPath + UI_DIR_SEPARATOR + "EndOfLife" + version;
- return UIFileExists(reportPath);
-}
-
-#ifndef RELEASE_OR_BETA
-
-static string
-GetMinidumpAnalyzerPath()
-{
- string path = gArgv[0];
- size_t pos = path.rfind(UI_CRASH_REPORTER_FILENAME BIN_SUFFIX);
- path.erase(pos);
- path.append(UI_MINIDUMP_ANALYZER_FILENAME BIN_SUFFIX);
-
- return path;
-}
-
-#endif
-
-int main(int argc, char** argv)
-{
- gArgc = argc;
- gArgv = argv;
-
- if (!ReadConfig()) {
- UIError("Couldn't read configuration.");
- return 0;
- }
-
- if (!UIInit())
- return 0;
-
- if (argc > 1) {
- gReporterDumpFile = argv[1];
- }
-
- if (gReporterDumpFile.empty()) {
- // no dump file specified, run the default UI
- UIShowDefaultUI();
- } else {
-#ifndef RELEASE_OR_BETA
- // start by running minidump analyzer, this is currently enabled only in
- // nightly and aurora
- UIRunMinidumpAnalyzer(GetMinidumpAnalyzerPath(), gReporterDumpFile);
-#endif
-
- // go ahead with the crash reporter
- gExtraFile = GetAdditionalFilename(gReporterDumpFile, kExtraDataExtension);
- if (gExtraFile.empty()) {
- UIError(gStrings[ST_ERROR_BADARGUMENTS]);
- return 0;
- }
-
- if (!UIFileExists(gExtraFile)) {
- UIError(gStrings[ST_ERROR_EXTRAFILEEXISTS]);
- return 0;
- }
-
- gMemoryFile = GetAdditionalFilename(gReporterDumpFile,
- kMemoryReportExtension);
- if (!UIFileExists(gMemoryFile)) {
- gMemoryFile.erase();
- }
-
- StringTable queryParameters;
- if (!ReadStringsFromFile(gExtraFile, queryParameters, true)) {
- UIError(gStrings[ST_ERROR_EXTRAFILEREAD]);
- return 0;
- }
-
- if (queryParameters.find("ProductName") == queryParameters.end()) {
- UIError(gStrings[ST_ERROR_NOPRODUCTNAME]);
- return 0;
- }
-
- // There is enough information in the extra file to rewrite strings
- // to be product specific
- RewriteStrings(queryParameters);
-
- if (queryParameters.find("ServerURL") == queryParameters.end()) {
- UIError(gStrings[ST_ERROR_NOSERVERURL]);
- return 0;
- }
-
- // Hopefully the settings path exists in the environment. Try that before
- // asking the platform-specific code to guess.
-#ifdef XP_WIN32
- static const wchar_t kDataDirKey[] = L"MOZ_CRASHREPORTER_DATA_DIRECTORY";
- const wchar_t *settingsPath = _wgetenv(kDataDirKey);
- if (settingsPath && *settingsPath) {
- gSettingsPath = WideToUTF8(settingsPath);
- }
-#else
- static const char kDataDirKey[] = "MOZ_CRASHREPORTER_DATA_DIRECTORY";
- const char *settingsPath = getenv(kDataDirKey);
- if (settingsPath && *settingsPath) {
- gSettingsPath = settingsPath;
- }
-#endif
- else {
- string product = queryParameters["ProductName"];
- string vendor = queryParameters["Vendor"];
- if (!UIGetSettingsPath(vendor, product, gSettingsPath)) {
- gSettingsPath.clear();
- }
- }
-
- if (gSettingsPath.empty() || !UIEnsurePathExists(gSettingsPath)) {
- UIError(gStrings[ST_ERROR_NOSETTINGSPATH]);
- return 0;
- }
-
- OpenLogFile();
-
-#ifdef XP_WIN32
- static const wchar_t kEventsDirKey[] = L"MOZ_CRASHREPORTER_EVENTS_DIRECTORY";
- const wchar_t *eventsPath = _wgetenv(kEventsDirKey);
- if (eventsPath && *eventsPath) {
- gEventsPath = WideToUTF8(eventsPath);
- }
-#else
- static const char kEventsDirKey[] = "MOZ_CRASHREPORTER_EVENTS_DIRECTORY";
- const char *eventsPath = getenv(kEventsDirKey);
- if (eventsPath && *eventsPath) {
- gEventsPath = eventsPath;
- }
-#endif
- else {
- gEventsPath.clear();
- }
-
- // Update the crash event with stacks if they are present
- auto stackTracesItr = queryParameters.find("StackTraces");
- if (stackTracesItr != queryParameters.end()) {
- AppendStackTracesToEventFile(stackTracesItr->second);
- }
-
- if (!UIFileExists(gReporterDumpFile)) {
- UIError(gStrings[ST_ERROR_DUMPFILEEXISTS]);
- return 0;
- }
-
- string pendingDir = gSettingsPath + UI_DIR_SEPARATOR + "pending";
- if (!MoveCrashData(pendingDir, gReporterDumpFile, gExtraFile,
- gMemoryFile)) {
- return 0;
- }
-
- string sendURL = queryParameters["ServerURL"];
- // we don't need to actually send this
- queryParameters.erase("ServerURL");
-
- queryParameters["Throttleable"] = "1";
-
- // re-set XUL_APP_FILE for xulrunner wrapped apps
- const char *appfile = getenv("MOZ_CRASHREPORTER_RESTART_XUL_APP_FILE");
- if (appfile && *appfile) {
- const char prefix[] = "XUL_APP_FILE=";
- char *env = (char*) malloc(strlen(appfile) + strlen(prefix) + 1);
- if (!env) {
- UIError("Out of memory");
- return 0;
- }
- strcpy(env, prefix);
- strcat(env, appfile);
- putenv(env);
- free(env);
- }
-
- vector<string> restartArgs;
-
- ostringstream paramName;
- int i = 0;
- paramName << "MOZ_CRASHREPORTER_RESTART_ARG_" << i++;
- const char *param = getenv(paramName.str().c_str());
- while (param && *param) {
- restartArgs.push_back(param);
-
- paramName.str("");
- paramName << "MOZ_CRASHREPORTER_RESTART_ARG_" << i++;
- param = getenv(paramName.str().c_str());
- }
-
- // allow override of the server url via environment variable
- //XXX: remove this in the far future when our robot
- // masters force everyone to use XULRunner
- char* urlEnv = getenv("MOZ_CRASHREPORTER_URL");
- if (urlEnv && *urlEnv) {
- sendURL = urlEnv;
- }
-
- // see if this version has been end-of-lifed
- if (queryParameters.find("Version") != queryParameters.end() &&
- CheckEndOfLifed(queryParameters["Version"])) {
- UIError(gStrings[ST_ERROR_ENDOFLIFE]);
- DeleteDump();
- return 0;
- }
-
- StringTable files;
- files["upload_file_minidump"] = gReporterDumpFile;
- if (!gMemoryFile.empty()) {
- files["memory_report"] = gMemoryFile;
- }
-
- if (!UIShowCrashUI(files, queryParameters, sendURL, restartArgs))
- DeleteDump();
- }
-
- UIShutdown();
-
- return 0;
-}
-
-#if defined(XP_WIN) && !defined(__GNUC__)
-#include <windows.h>
-
-// We need WinMain in order to not be a console app. This function is unused
-// if we are a console application.
-int WINAPI wWinMain( HINSTANCE, HINSTANCE, LPWSTR args, int )
-{
- // Remove everything except close window from the context menu
- {
- HKEY hkApp;
- RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\Classes\\Applications", 0,
- nullptr, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, nullptr,
- &hkApp, nullptr);
- RegCloseKey(hkApp);
- if (RegCreateKeyExW(HKEY_CURRENT_USER,
- L"Software\\Classes\\Applications\\crashreporter.exe",
- 0, nullptr, REG_OPTION_VOLATILE, KEY_SET_VALUE,
- nullptr, &hkApp, nullptr) == ERROR_SUCCESS) {
- RegSetValueExW(hkApp, L"IsHostApp", 0, REG_NONE, 0, 0);
- RegSetValueExW(hkApp, L"NoOpenWith", 0, REG_NONE, 0, 0);
- RegSetValueExW(hkApp, L"NoStartPage", 0, REG_NONE, 0, 0);
- RegCloseKey(hkApp);
- }
- }
-
- char** argv = static_cast<char**>(malloc(__argc * sizeof(char*)));
- for (int i = 0; i < __argc; i++) {
- argv[i] = strdup(WideToUTF8(__wargv[i]).c_str());
- }
-
- // Do the real work.
- return main(__argc, argv);
-}
-#endif
diff --git a/toolkit/crashreporter/client/crashreporter.exe.manifest b/toolkit/crashreporter/client/crashreporter.exe.manifest
deleted file mode 100644
index e6b2ceefbc..0000000000
--- a/toolkit/crashreporter/client/crashreporter.exe.manifest
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
-<assemblyIdentity
- version="1.0.0.0"
- processorArchitecture="*"
- name="CrashReporter"
- type="win32"
-/>
-<description>Crash Reporter</description>
-<dependency>
- <dependentAssembly>
- <assemblyIdentity
- type="win32"
- name="Microsoft.Windows.Common-Controls"
- version="6.0.0.0"
- processorArchitecture="*"
- publicKeyToken="6595b64144ccf1df"
- language="*"
- />
- </dependentAssembly>
-</dependency>
-<ms_asmv3:trustInfo xmlns:ms_asmv3="urn:schemas-microsoft-com:asm.v3">
- <ms_asmv3:security>
- <ms_asmv3:requestedPrivileges>
- <ms_asmv3:requestedExecutionLevel level="asInvoker" uiAccess="false" />
- </ms_asmv3:requestedPrivileges>
- </ms_asmv3:security>
-</ms_asmv3:trustInfo>
- <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
- <application>
- <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
- <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
- <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
- <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
- </application>
- </compatibility>
-</assembly>
diff --git a/toolkit/crashreporter/client/crashreporter.h b/toolkit/crashreporter/client/crashreporter.h
deleted file mode 100644
index 8c5ca3613d..0000000000
--- a/toolkit/crashreporter/client/crashreporter.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef CRASHREPORTER_H__
-#define CRASHREPORTER_H__
-
-#ifdef _MSC_VER
-# pragma warning( push )
-// Disable exception handler warnings.
-# pragma warning( disable : 4530 )
-#endif
-
-#include <string>
-#include <map>
-#include <vector>
-#include <stdlib.h>
-#include <stdio.h>
-#include <iostream>
-#include <fstream>
-
-#define MAX_COMMENT_LENGTH 500
-
-#if defined(XP_WIN32)
-
-#include <windows.h>
-
-#define UI_SNPRINTF _snprintf
-#define UI_DIR_SEPARATOR "\\"
-
-std::string WideToUTF8(const std::wstring& wide, bool* success = 0);
-
-#else
-
-#define UI_SNPRINTF snprintf
-#define UI_DIR_SEPARATOR "/"
-
-#endif
-
-#define UI_CRASH_REPORTER_FILENAME "crashreporter"
-#define UI_MINIDUMP_ANALYZER_FILENAME "minidump-analyzer"
-
-typedef std::map<std::string, std::string> StringTable;
-
-#define ST_CRASHREPORTERTITLE "CrashReporterTitle"
-#define ST_CRASHREPORTERVENDORTITLE "CrashReporterVendorTitle"
-#define ST_CRASHREPORTERERROR "CrashReporterErrorText"
-#define ST_CRASHREPORTERPRODUCTERROR "CrashReporterProductErrorText2"
-#define ST_CRASHREPORTERHEADER "CrashReporterSorry"
-#define ST_CRASHREPORTERDESCRIPTION "CrashReporterDescriptionText2"
-#define ST_CRASHREPORTERDEFAULT "CrashReporterDefault"
-#define ST_VIEWREPORT "Details"
-#define ST_VIEWREPORTTITLE "ViewReportTitle"
-#define ST_COMMENTGRAYTEXT "CommentGrayText"
-#define ST_EXTRAREPORTINFO "ExtraReportInfo"
-#define ST_CHECKSUBMIT "CheckSendReport"
-#define ST_CHECKURL "CheckIncludeURL"
-#define ST_CHECKEMAIL "CheckAllowEmail"
-#define ST_EMAILGRAYTEXT "EmailGrayText"
-#define ST_REPORTPRESUBMIT "ReportPreSubmit2"
-#define ST_REPORTDURINGSUBMIT "ReportDuringSubmit2"
-#define ST_REPORTSUBMITSUCCESS "ReportSubmitSuccess"
-#define ST_SUBMITFAILED "ReportSubmitFailed"
-#define ST_QUIT "Quit2"
-#define ST_RESTART "Restart"
-#define ST_OK "Ok"
-#define ST_CLOSE "Close"
-
-#define ST_ERROR_BADARGUMENTS "ErrorBadArguments"
-#define ST_ERROR_EXTRAFILEEXISTS "ErrorExtraFileExists"
-#define ST_ERROR_EXTRAFILEREAD "ErrorExtraFileRead"
-#define ST_ERROR_EXTRAFILEMOVE "ErrorExtraFileMove"
-#define ST_ERROR_DUMPFILEEXISTS "ErrorDumpFileExists"
-#define ST_ERROR_DUMPFILEMOVE "ErrorDumpFileMove"
-#define ST_ERROR_NOPRODUCTNAME "ErrorNoProductName"
-#define ST_ERROR_NOSERVERURL "ErrorNoServerURL"
-#define ST_ERROR_NOSETTINGSPATH "ErrorNoSettingsPath"
-#define ST_ERROR_CREATEDUMPDIR "ErrorCreateDumpDir"
-#define ST_ERROR_ENDOFLIFE "ErrorEndOfLife"
-
-//=============================================================================
-// implemented in crashreporter.cpp
-//=============================================================================
-
-namespace CrashReporter {
- extern StringTable gStrings;
- extern std::string gSettingsPath;
- extern std::string gEventsPath;
- extern int gArgc;
- extern char** gArgv;
-
- void UIError(const std::string& message);
-
- // The UI finished sending the report
- void SendCompleted(bool success, const std::string& serverResponse);
-
- bool ReadStrings(std::istream& in,
- StringTable& strings,
- bool unescape);
- bool ReadStringsFromFile(const std::string& path,
- StringTable& strings,
- bool unescape);
- bool WriteStrings(std::ostream& out,
- const std::string& header,
- StringTable& strings,
- bool escape);
- bool WriteStringsToFile(const std::string& path,
- const std::string& header,
- StringTable& strings,
- bool escape);
- void LogMessage(const std::string& message);
- void DeleteDump();
- bool ShouldEnableSending();
-
- static const unsigned int kSaveCount = 10;
-}
-
-//=============================================================================
-// implemented in the platform-specific files
-//=============================================================================
-
-bool UIInit();
-void UIShutdown();
-
-// Run the UI for when the app was launched without a dump file
-void UIShowDefaultUI();
-
-// Run the UI for when the app was launched with a dump file
-// Return true if the user sent (or tried to send) the crash report,
-// false if they chose not to, and it should be deleted.
-bool UIShowCrashUI(const StringTable& files,
- const StringTable& queryParameters,
- const std::string& sendURL,
- const std::vector<std::string>& restartArgs);
-
-void UIError_impl(const std::string& message);
-
-bool UIGetIniPath(std::string& path);
-bool UIGetSettingsPath(const std::string& vendor,
- const std::string& product,
- std::string& settingsPath);
-bool UIEnsurePathExists(const std::string& path);
-bool UIFileExists(const std::string& path);
-bool UIMoveFile(const std::string& oldfile, const std::string& newfile);
-bool UIDeleteFile(const std::string& oldfile);
-std::ifstream* UIOpenRead(const std::string& filename);
-std::ofstream* UIOpenWrite(const std::string& filename,
- bool append=false,
- bool binary=false);
-void UIPruneSavedDumps(const std::string& directory);
-void UIRunMinidumpAnalyzer(const std::string& exename,
- const std::string& filename);
-
-#ifdef _MSC_VER
-# pragma warning( pop )
-#endif
-
-#endif
diff --git a/toolkit/crashreporter/client/crashreporter.ico b/toolkit/crashreporter/client/crashreporter.ico
deleted file mode 100644
index 29ac3c6189..0000000000
--- a/toolkit/crashreporter/client/crashreporter.ico
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/client/crashreporter.rc b/toolkit/crashreporter/client/crashreporter.rc
deleted file mode 100755
index 0ccd0757f8..0000000000
--- a/toolkit/crashreporter/client/crashreporter.rc
+++ /dev/null
@@ -1,148 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "winresrc.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include ""winresrc.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-1 24 "crashreporter.exe.manifest"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_MAINICON ICON "crashreporter.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// AVI
-//
-
-IDR_THROBBER AVI "Throbber-small.avi"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_SENDDIALOG DIALOGEX 0, 0, 241, 187
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_APPWINDOW
-CAPTION "Sending Crash Report..."
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- CONTROL "",IDC_DESCRIPTIONTEXT,"RICHEDIT50W",ES_MULTILINE | ES_READONLY,8,7,226,12,WS_EX_TRANSPARENT
- CONTROL "tell mozilla about this crash so they can fix it",IDC_SUBMITREPORTCHECK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,25,222,10
- CHECKBOX "details...",IDC_VIEWREPORTBUTTON,24,40,54,14,BS_PUSHLIKE
- EDITTEXT IDC_COMMENTTEXT,24,59,210,43,ES_MULTILINE | ES_WANTRETURN | WS_VSCROLL
- CONTROL "include the address of the page i was on",IDC_INCLUDEURLCHECK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,107,210,10
- CONTROL "tell mozilla to email me with more information",IDC_EMAILMECHECK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,120,210,10
- EDITTEXT IDC_EMAILTEXT,36,133,198,14,ES_AUTOHSCROLL
- CONTROL "",IDC_THROBBER,"SysAnimate32",ACS_TRANSPARENT | NOT WS_VISIBLE | WS_TABSTOP,4,152,16,16
- LTEXT "your crash report will be submitted when you restart",IDC_PROGRESSTEXT,24,152,210,10,SS_NOPREFIX
- DEFPUSHBUTTON "restart firefox",IDC_RESTARTBUTTON,84,166,68,14
- PUSHBUTTON "quit without sending",IDC_CLOSEBUTTON,157,166,77,14
-END
-
-IDD_VIEWREPORTDIALOG DIALOGEX 0, 0, 208, 126
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION
-CAPTION "view report"
-FONT 8, "MS Shell Dlg", 400, 0, 0x1
-BEGIN
- CONTROL "",IDC_VIEWREPORTTEXT,"RICHEDIT50W",ES_MULTILINE | ES_READONLY | WS_BORDER | WS_VSCROLL | WS_TABSTOP,7,7,194,92
- DEFPUSHBUTTON "OK",IDOK,151,105,50,14
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO
-BEGIN
- IDD_SENDDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 8
- RIGHTMARGIN, 234
- TOPMARGIN, 7
- BOTTOMMARGIN, 180
- END
-
- IDD_VIEWREPORTDIALOG, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 201
- TOPMARGIN, 7
- BOTTOMMARGIN, 119
- END
-END
-#endif // APSTUDIO_INVOKED
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp b/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
deleted file mode 100644
index 395a339bfd..0000000000
--- a/toolkit/crashreporter/client/crashreporter_gtk_common.cpp
+++ /dev/null
@@ -1,453 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "crashreporter.h"
-
-#include <unistd.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <gdk/gdkkeysyms.h>
-
-#include <algorithm>
-#include <string>
-#include <vector>
-
-#include "common/linux/http_upload.h"
-#include "crashreporter.h"
-#include "crashreporter_gtk_common.h"
-
-#ifndef GDK_KEY_Escape
-#define GDK_KEY_Escape GDK_Escape
-#endif
-
-using std::string;
-using std::vector;
-
-using namespace CrashReporter;
-
-GtkWidget* gWindow = 0;
-GtkWidget* gSubmitReportCheck = 0;
-GtkWidget* gIncludeURLCheck = 0;
-GtkWidget* gThrobber = 0;
-GtkWidget* gProgressLabel = 0;
-GtkWidget* gCloseButton = 0;
-GtkWidget* gRestartButton = 0;
-
-bool gInitialized = false;
-bool gDidTrySend = false;
-StringTable gFiles;
-StringTable gQueryParameters;
-string gHttpProxy;
-string gAuth;
-string gCACertificateFile;
-string gSendURL;
-string gURLParameter;
-vector<string> gRestartArgs;
-GThread* gSendThreadID;
-
-// From crashreporter_linux.cpp
-void SaveSettings();
-void SendReport();
-void TryInitGnome();
-void UpdateSubmit();
-
-static bool RestartApplication()
-{
- char** argv = reinterpret_cast<char**>(
- malloc(sizeof(char*) * (gRestartArgs.size() + 1)));
-
- if (!argv) return false;
-
- unsigned int i;
- for (i = 0; i < gRestartArgs.size(); i++) {
- argv[i] = (char*)gRestartArgs[i].c_str();
- }
- argv[i] = 0;
-
- pid_t pid = fork();
- if (pid == -1)
- return false;
- else if (pid == 0) {
- (void)execv(argv[0], argv);
- _exit(1);
- }
-
- free(argv);
-
- return true;
-}
-
-// Quit the app, used as a timeout callback
-static gboolean CloseApp(gpointer data)
-{
- gtk_main_quit();
- g_thread_join(gSendThreadID);
- return FALSE;
-}
-
-static gboolean ReportCompleted(gpointer success)
-{
- gtk_widget_hide(gThrobber);
- string str = success ? gStrings[ST_REPORTSUBMITSUCCESS]
- : gStrings[ST_SUBMITFAILED];
- gtk_label_set_text(GTK_LABEL(gProgressLabel), str.c_str());
- g_timeout_add(5000, CloseApp, 0);
- return FALSE;
-}
-
-#ifdef MOZ_ENABLE_GCONF
-#define HTTP_PROXY_DIR "/system/http_proxy"
-
-void LoadProxyinfo()
-{
- class GConfClient;
- typedef GConfClient * (*_gconf_default_fn)();
- typedef gboolean (*_gconf_bool_fn)(GConfClient *, const gchar *, GError **);
- typedef gint (*_gconf_int_fn)(GConfClient *, const gchar *, GError **);
- typedef gchar * (*_gconf_string_fn)(GConfClient *, const gchar *, GError **);
-
- if (getenv ("http_proxy"))
- return; // libcurl can use the value from the environment
-
- static void* gconfLib = dlopen("libgconf-2.so.4", RTLD_LAZY);
- if (!gconfLib)
- return;
-
- _gconf_default_fn gconf_client_get_default =
- (_gconf_default_fn)dlsym(gconfLib, "gconf_client_get_default");
- _gconf_bool_fn gconf_client_get_bool =
- (_gconf_bool_fn)dlsym(gconfLib, "gconf_client_get_bool");
- _gconf_int_fn gconf_client_get_int =
- (_gconf_int_fn)dlsym(gconfLib, "gconf_client_get_int");
- _gconf_string_fn gconf_client_get_string =
- (_gconf_string_fn)dlsym(gconfLib, "gconf_client_get_string");
-
- if(!(gconf_client_get_default &&
- gconf_client_get_bool &&
- gconf_client_get_int &&
- gconf_client_get_string)) {
- dlclose(gconfLib);
- return;
- }
-
- GConfClient *conf = gconf_client_get_default();
-
- if (gconf_client_get_bool(conf, HTTP_PROXY_DIR "/use_http_proxy", nullptr)) {
- gint port;
- gchar *host = nullptr, *httpproxy = nullptr;
-
- host = gconf_client_get_string(conf, HTTP_PROXY_DIR "/host", nullptr);
- port = gconf_client_get_int(conf, HTTP_PROXY_DIR "/port", nullptr);
-
- if (port && host && *host != '\0') {
- httpproxy = g_strdup_printf("http://%s:%d/", host, port);
- gHttpProxy = httpproxy;
- }
-
- g_free(host);
- g_free(httpproxy);
-
- if (gconf_client_get_bool(conf, HTTP_PROXY_DIR "/use_authentication",
- nullptr)) {
- gchar *user, *password, *auth = nullptr;
-
- user = gconf_client_get_string(conf,
- HTTP_PROXY_DIR "/authentication_user",
- nullptr);
- password = gconf_client_get_string(conf,
- HTTP_PROXY_DIR
- "/authentication_password",
- nullptr);
-
- if (user && password) {
- auth = g_strdup_printf("%s:%s", user, password);
- gAuth = auth;
- }
-
- g_free(user);
- g_free(password);
- g_free(auth);
- }
- }
-
- g_object_unref(conf);
-
- // Don't dlclose gconfLib as libORBit-2 uses atexit().
-}
-#endif
-
-gpointer SendThread(gpointer args)
-{
- string response, error;
- long response_code;
-
- bool success = google_breakpad::HTTPUpload::SendRequest
- (gSendURL,
- gQueryParameters,
- gFiles,
- gHttpProxy, gAuth,
- gCACertificateFile,
- &response,
- &response_code,
- &error);
- if (success) {
- LogMessage("Crash report submitted successfully");
- }
- else {
- LogMessage("Crash report submission failed: " + error);
- }
-
- SendCompleted(success, response);
- // Apparently glib is threadsafe, and will schedule this
- // on the main thread, see:
- // http://library.gnome.org/devel/gtk-faq/stable/x499.html
- g_idle_add(ReportCompleted, (gpointer)success);
-
- return nullptr;
-}
-
-gboolean WindowDeleted(GtkWidget* window,
- GdkEvent* event,
- gpointer userData)
-{
- SaveSettings();
- gtk_main_quit();
- return TRUE;
-}
-
-gboolean check_escape(GtkWidget* window,
- GdkEventKey* event,
- gpointer userData)
-{
- if (event->keyval == GDK_KEY_Escape) {
- gtk_main_quit();
- return TRUE;
- }
- return FALSE;
-}
-
-static void MaybeSubmitReport()
-{
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))) {
- gDidTrySend = true;
- SendReport();
- } else {
- gtk_main_quit();
- }
-}
-
-void CloseClicked(GtkButton* button,
- gpointer userData)
-{
- SaveSettings();
- MaybeSubmitReport();
-}
-
-void RestartClicked(GtkButton* button,
- gpointer userData)
-{
- SaveSettings();
- RestartApplication();
- MaybeSubmitReport();
-}
-
-static void UpdateURL()
-{
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck))) {
- gQueryParameters["URL"] = gURLParameter;
- } else {
- gQueryParameters.erase("URL");
- }
-}
-
-void SubmitReportChecked(GtkButton* sender, gpointer userData)
-{
- UpdateSubmit();
-}
-
-void IncludeURLClicked(GtkButton* sender, gpointer userData)
-{
- UpdateURL();
-}
-
-/* === Crashreporter UI Functions === */
-
-bool UIInit()
-{
- // breakpad probably left us with blocked signals, unblock them here
- sigset_t signals, old;
- sigfillset(&signals);
- sigprocmask(SIG_UNBLOCK, &signals, &old);
-
- // tell glib we're going to use threads
- g_thread_init(nullptr);
-
- if (gtk_init_check(&gArgc, &gArgv)) {
- gInitialized = true;
-
- if (gStrings.find("isRTL") != gStrings.end() &&
- gStrings["isRTL"] == "yes")
- gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
-
- return true;
- }
-
- return false;
-}
-
-void UIShowDefaultUI()
-{
- GtkWidget* errorDialog =
- gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s", gStrings[ST_CRASHREPORTERDEFAULT].c_str());
-
- gtk_window_set_title(GTK_WINDOW(errorDialog),
- gStrings[ST_CRASHREPORTERTITLE].c_str());
- gtk_dialog_run(GTK_DIALOG(errorDialog));
-}
-
-void UIError_impl(const string& message)
-{
- if (!gInitialized) {
- // Didn't initialize, this is the best we can do
- printf("Error: %s\n", message.c_str());
- return;
- }
-
- GtkWidget* errorDialog =
- gtk_message_dialog_new(nullptr, GTK_DIALOG_MODAL,
- GTK_MESSAGE_ERROR,
- GTK_BUTTONS_CLOSE,
- "%s", message.c_str());
-
- gtk_window_set_title(GTK_WINDOW(errorDialog),
- gStrings[ST_CRASHREPORTERTITLE].c_str());
- gtk_dialog_run(GTK_DIALOG(errorDialog));
-}
-
-bool UIGetIniPath(string& path)
-{
- path = gArgv[0];
- path.append(".ini");
-
- return true;
-}
-
-/*
- * Settings are stored in ~/.vendor/product, or
- * ~/.product if vendor is empty.
- */
-bool UIGetSettingsPath(const string& vendor,
- const string& product,
- string& settingsPath)
-{
- char* home = getenv("HOME");
-
- if (!home)
- return false;
-
- settingsPath = home;
- settingsPath += "/.";
- if (!vendor.empty()) {
- string lc_vendor;
- std::transform(vendor.begin(), vendor.end(), back_inserter(lc_vendor),
- (int(*)(int)) std::tolower);
- settingsPath += lc_vendor + "/";
- }
- string lc_product;
- std::transform(product.begin(), product.end(), back_inserter(lc_product),
- (int(*)(int)) std::tolower);
- settingsPath += lc_product + "/Crash Reports";
- return true;
-}
-
-bool UIEnsurePathExists(const string& path)
-{
- int ret = mkdir(path.c_str(), S_IRWXU);
- int e = errno;
- if (ret == -1 && e != EEXIST)
- return false;
-
- return true;
-}
-
-bool UIFileExists(const string& path)
-{
- struct stat sb;
- int ret = stat(path.c_str(), &sb);
- if (ret == -1 || !(sb.st_mode & S_IFREG))
- return false;
-
- return true;
-}
-
-bool UIMoveFile(const string& file, const string& newfile)
-{
- if (!rename(file.c_str(), newfile.c_str()))
- return true;
- if (errno != EXDEV)
- return false;
-
- // use system /bin/mv instead, time to fork
- pid_t pID = vfork();
- if (pID < 0) {
- // Failed to fork
- return false;
- }
- if (pID == 0) {
- char* const args[4] = {
- const_cast<char*>("mv"),
- strdup(file.c_str()),
- strdup(newfile.c_str()),
- 0
- };
- if (args[1] && args[2])
- execve("/bin/mv", args, 0);
- free(args[1]);
- free(args[2]);
- exit(-1);
- }
- int status;
- waitpid(pID, &status, 0);
- return UIFileExists(newfile);
-}
-
-bool UIDeleteFile(const string& file)
-{
- return (unlink(file.c_str()) != -1);
-}
-
-std::ifstream* UIOpenRead(const string& filename)
-{
- return new std::ifstream(filename.c_str(), std::ios::in);
-}
-
-std::ofstream* UIOpenWrite(const string& filename,
- bool append, // append=false
- bool binary) // binary=false
-{
- std::ios_base::openmode mode = std::ios::out;
-
- if (append) {
- mode = mode | std::ios::app;
- }
-
- if (binary) {
- mode = mode | std::ios::binary;
- }
-
- return new std::ofstream(filename.c_str(), mode);
-}
diff --git a/toolkit/crashreporter/client/crashreporter_gtk_common.h b/toolkit/crashreporter/client/crashreporter_gtk_common.h
deleted file mode 100644
index 3a6350c5b1..0000000000
--- a/toolkit/crashreporter/client/crashreporter_gtk_common.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef CRASHREPORTER_GTK_COMMON_H__
-#define CRASHREPORTER_GTK_COMMON_H__
-
-#include <glib.h>
-#include <gtk/gtk.h>
-
-#include <string>
-#include <vector>
-
-const char kIniFile[] = "crashreporter.ini";
-
-extern GtkWidget* gWindow;
-extern GtkWidget* gSubmitReportCheck;
-extern GtkWidget* gIncludeURLCheck;
-extern GtkWidget* gThrobber;
-extern GtkWidget* gProgressLabel;
-extern GtkWidget* gCloseButton;
-extern GtkWidget* gRestartButton;
-
-extern std::vector<std::string> gRestartArgs;
-extern GThread* gSendThreadID;
-
-extern bool gInitialized;
-extern bool gDidTrySend;
-extern StringTable gFiles;
-extern StringTable gQueryParameters;
-extern std::string gHttpProxy;
-extern std::string gAuth;
-extern std::string gCACertificateFile;
-extern std::string gSendURL;
-extern std::string gURLParameter;
-
-void LoadProxyinfo();
-gpointer SendThread(gpointer args);
-gboolean WindowDeleted(GtkWidget* window,
- GdkEvent* event,
- gpointer userData);
-gboolean check_escape(GtkWidget* window, GdkEventKey* event, gpointer data);
-void SubmitReportChecked(GtkButton* sender, gpointer userData);
-void IncludeURLClicked(GtkButton* sender, gpointer userData);
-void CloseClicked(GtkButton* button,
- gpointer userData);
-void RestartClicked(GtkButton* button,
- gpointer userData);
-
-#endif // CRASHREPORTER_GTK_COMMON_H__
diff --git a/toolkit/crashreporter/client/crashreporter_linux.cpp b/toolkit/crashreporter/client/crashreporter_linux.cpp
deleted file mode 100644
index 6e7ccce401..0000000000
--- a/toolkit/crashreporter/client/crashreporter_linux.cpp
+++ /dev/null
@@ -1,576 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <dlfcn.h>
-#include <fcntl.h>
-#include <glib.h>
-#include <gtk/gtk.h>
-#include <string.h>
-
-#include <cctype>
-
-#include "crashreporter.h"
-#include "crashreporter_gtk_common.h"
-
-#define LABEL_MAX_CHAR_WIDTH 48
-
-using std::string;
-using std::vector;
-
-using namespace CrashReporter;
-
-static GtkWidget* gViewReportButton = 0;
-static GtkWidget* gCommentTextLabel = 0;
-static GtkWidget* gCommentText = 0;
-static GtkWidget* gEmailMeCheck = 0;
-static GtkWidget* gEmailEntryLabel = 0;
-static GtkWidget* gEmailEntry = 0;
-
-static bool gEmailFieldHint = true;
-static bool gCommentFieldHint = true;
-
-// handle from dlopen'ing libgnome
-static void* gnomeLib = nullptr;
-// handle from dlopen'ing libgnomeui
-static void* gnomeuiLib = nullptr;
-
-static void LoadSettings()
-{
- /*
- * NOTE! This code needs to stay in sync with the preference checking
- * code in in nsExceptionHandler.cpp.
- */
-
- StringTable settings;
- if (ReadStringsFromFile(gSettingsPath + "/" + kIniFile, settings, true)) {
- if (settings.find("Email") != settings.end()) {
- gtk_entry_set_text(GTK_ENTRY(gEmailEntry), settings["Email"].c_str());
- gEmailFieldHint = false;
- }
- if (settings.find("EmailMe") != settings.end()) {
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gEmailMeCheck),
- settings["EmailMe"][0] != '0');
- }
- if (settings.find("IncludeURL") != settings.end() &&
- gIncludeURLCheck != 0) {
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck),
- settings["IncludeURL"][0] != '0');
- }
- bool enabled;
- if (settings.find("SubmitReport") != settings.end())
- enabled = settings["SubmitReport"][0] != '0';
- else
- enabled = ShouldEnableSending();
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck),
- enabled);
- }
-}
-
-void SaveSettings()
-{
- /*
- * NOTE! This code needs to stay in sync with the preference setting
- * code in in nsExceptionHandler.cpp.
- */
-
- StringTable settings;
-
- ReadStringsFromFile(gSettingsPath + "/" + kIniFile, settings, true);
- if (!gEmailFieldHint)
- settings["Email"] = gtk_entry_get_text(GTK_ENTRY(gEmailEntry));
- else
- settings.erase("Email");
-
- settings["EmailMe"] =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gEmailMeCheck)) ? "1" : "0";
- if (gIncludeURLCheck != 0)
- settings["IncludeURL"] =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck))
- ? "1" : "0";
- settings["SubmitReport"] =
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))
- ? "1" : "0";
-
- WriteStringsToFile(gSettingsPath + "/" + kIniFile,
- "Crash Reporter", settings, true);
-}
-
-void SendReport()
-{
- // disable all our gui controls, show the throbber + change the progress text
- gtk_widget_set_sensitive(gSubmitReportCheck, FALSE);
- gtk_widget_set_sensitive(gViewReportButton, FALSE);
- gtk_widget_set_sensitive(gCommentText, FALSE);
- if (gIncludeURLCheck)
- gtk_widget_set_sensitive(gIncludeURLCheck, FALSE);
- gtk_widget_set_sensitive(gEmailMeCheck, FALSE);
- gtk_widget_set_sensitive(gEmailEntry, FALSE);
- gtk_widget_set_sensitive(gCloseButton, FALSE);
- if (gRestartButton)
- gtk_widget_set_sensitive(gRestartButton, FALSE);
- gtk_widget_show_all(gThrobber);
- gtk_label_set_text(GTK_LABEL(gProgressLabel),
- gStrings[ST_REPORTDURINGSUBMIT].c_str());
-
-#ifdef MOZ_ENABLE_GCONF
- LoadProxyinfo();
-#endif
-
- // and spawn a thread to do the sending
- GError* err;
- gSendThreadID = g_thread_create(SendThread, nullptr, TRUE, &err);
-}
-
-static void ShowReportInfo(GtkTextView* viewReportTextView)
-{
- GtkTextBuffer* buffer =
- gtk_text_view_get_buffer(viewReportTextView);
-
- GtkTextIter start, end;
- gtk_text_buffer_get_start_iter(buffer, &start);
- gtk_text_buffer_get_end_iter(buffer, &end);
-
- gtk_text_buffer_delete(buffer, &start, &end);
-
- for (StringTable::iterator iter = gQueryParameters.begin();
- iter != gQueryParameters.end();
- iter++) {
- gtk_text_buffer_insert(buffer, &end, iter->first.c_str(), -1);
- gtk_text_buffer_insert(buffer, &end, ": ", -1);
- gtk_text_buffer_insert(buffer, &end, iter->second.c_str(), -1);
- gtk_text_buffer_insert(buffer, &end, "\n", -1);
- }
-
- gtk_text_buffer_insert(buffer, &end, "\n", -1);
- gtk_text_buffer_insert(buffer, &end,
- gStrings[ST_EXTRAREPORTINFO].c_str(), -1);
-}
-
-void UpdateSubmit()
-{
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gSubmitReportCheck))) {
- gtk_widget_set_sensitive(gViewReportButton, TRUE);
- gtk_widget_set_sensitive(gCommentText, TRUE);
- if (gIncludeURLCheck)
- gtk_widget_set_sensitive(gIncludeURLCheck, TRUE);
- gtk_widget_set_sensitive(gEmailMeCheck, TRUE);
- gtk_widget_set_sensitive(gEmailEntry,
- gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gEmailMeCheck)));
- gtk_label_set_text(GTK_LABEL(gProgressLabel),
- gStrings[ST_REPORTPRESUBMIT].c_str());
- } else {
- gtk_widget_set_sensitive(gViewReportButton, FALSE);
- gtk_widget_set_sensitive(gCommentText, FALSE);
- if (gIncludeURLCheck)
- gtk_widget_set_sensitive(gIncludeURLCheck, FALSE);
- gtk_widget_set_sensitive(gEmailMeCheck, FALSE);
- gtk_widget_set_sensitive(gEmailEntry, FALSE);
- gtk_label_set_text(GTK_LABEL(gProgressLabel), "");
- }
-}
-
-static void ViewReportClicked(GtkButton* button,
- gpointer userData)
-{
- GtkDialog* dialog =
- GTK_DIALOG(gtk_dialog_new_with_buttons(gStrings[ST_VIEWREPORTTITLE].c_str(),
- GTK_WINDOW(gWindow),
- GTK_DIALOG_MODAL,
- GTK_STOCK_OK,
- GTK_RESPONSE_OK,
- nullptr));
-
- GtkWidget* scrolled = gtk_scrolled_window_new(0, 0);
- gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(dialog)), scrolled);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled),
- GTK_SHADOW_IN);
-#if (MOZ_WIDGET_GTK >= 3)
- gtk_widget_set_vexpand(scrolled, TRUE);
-#endif
-
- GtkWidget* viewReportTextView = gtk_text_view_new();
- gtk_container_add(GTK_CONTAINER(scrolled), viewReportTextView);
- gtk_text_view_set_editable(GTK_TEXT_VIEW(viewReportTextView), FALSE);
- gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(viewReportTextView),
- GTK_WRAP_WORD);
- gtk_widget_set_size_request(GTK_WIDGET(viewReportTextView), -1, 100);
-
- ShowReportInfo(GTK_TEXT_VIEW(viewReportTextView));
-
- gtk_dialog_set_default_response(dialog, GTK_RESPONSE_OK);
- gtk_widget_set_size_request(GTK_WIDGET(dialog), 400, 200);
- gtk_widget_show_all(GTK_WIDGET(dialog));
- gtk_dialog_run(dialog);
- gtk_widget_destroy(GTK_WIDGET(dialog));
-}
-
-static void CommentChanged(GtkTextBuffer* buffer, gpointer userData)
-{
- GtkTextIter start, end;
- gtk_text_buffer_get_start_iter(buffer, &start);
- gtk_text_buffer_get_end_iter(buffer, &end);
- const char* comment = gtk_text_buffer_get_text(buffer, &start, &end, TRUE);
- if (comment[0] == '\0' || gCommentFieldHint)
- gQueryParameters.erase("Comments");
- else
- gQueryParameters["Comments"] = comment;
-}
-
-static void CommentInsert(GtkTextBuffer* buffer,
- GtkTextIter* location,
- gchar* text,
- gint len,
- gpointer userData)
-{
- GtkTextIter start, end;
- gtk_text_buffer_get_start_iter(buffer, &start);
- gtk_text_buffer_get_end_iter(buffer, &end);
- const char* comment = gtk_text_buffer_get_text(buffer, &start, &end, TRUE);
-
- // limit to 500 bytes in utf-8
- if (strlen(comment) + len > MAX_COMMENT_LENGTH) {
- g_signal_stop_emission_by_name(buffer, "insert-text");
- }
-}
-
-static void UpdateHintText(GtkWidget* widget, gboolean gainedFocus,
- bool* hintShowing, const char* hintText)
-{
- GtkTextBuffer* buffer = nullptr;
- if (GTK_IS_TEXT_VIEW(widget))
- buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(widget));
-
- if (gainedFocus) {
- if (*hintShowing) {
- if (buffer == nullptr) { // sort of cheating
- gtk_entry_set_text(GTK_ENTRY(widget), "");
- }
- else { // GtkTextView
- gtk_text_buffer_set_text(buffer, "", 0);
- }
- gtk_widget_modify_text(widget, GTK_STATE_NORMAL, nullptr);
- *hintShowing = false;
- }
- }
- else {
- // lost focus
- const char* text = nullptr;
- if (buffer == nullptr) {
- text = gtk_entry_get_text(GTK_ENTRY(widget));
- }
- else {
- GtkTextIter start, end;
- gtk_text_buffer_get_start_iter(buffer, &start);
- gtk_text_buffer_get_end_iter(buffer, &end);
- text = gtk_text_buffer_get_text(buffer, &start, &end, TRUE);
- }
-
- if (text == nullptr || text[0] == '\0') {
- *hintShowing = true;
-
- if (buffer == nullptr) {
- gtk_entry_set_text(GTK_ENTRY(widget), hintText);
- }
- else {
- gtk_text_buffer_set_text(buffer, hintText, -1);
- }
-
- gtk_widget_modify_text(widget, GTK_STATE_NORMAL,
- &gtk_widget_get_style(widget)->text[GTK_STATE_INSENSITIVE]);
- }
- }
-}
-
-static gboolean CommentFocusChange(GtkWidget* widget, GdkEventFocus* event,
- gpointer userData)
-{
- UpdateHintText(widget, event->in, &gCommentFieldHint,
- gStrings[ST_COMMENTGRAYTEXT].c_str());
-
- return FALSE;
-}
-
-static void UpdateEmail()
-{
- const char* email = gtk_entry_get_text(GTK_ENTRY(gEmailEntry));
- if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gEmailMeCheck))) {
- gtk_widget_set_sensitive(gEmailEntry, TRUE);
- } else {
- email = "";
- gtk_widget_set_sensitive(gEmailEntry, FALSE);
- }
- if (email[0] == '\0' || gEmailFieldHint)
- gQueryParameters.erase("Email");
- else
- gQueryParameters["Email"] = email;
-}
-
-static void EmailMeClicked(GtkButton* sender, gpointer userData)
-{
- UpdateEmail();
-}
-
-static void EmailChanged(GtkEditable* editable, gpointer userData)
-{
- UpdateEmail();
-}
-
-static gboolean EmailFocusChange(GtkWidget* widget, GdkEventFocus* event,
- gpointer userData)
-{
- UpdateHintText(widget, event->in, &gEmailFieldHint,
- gStrings[ST_EMAILGRAYTEXT].c_str());
-
- return FALSE;
-}
-
-typedef struct _GnomeProgram GnomeProgram;
-typedef struct _GnomeModuleInfo GnomeModuleInfo;
-typedef GnomeProgram * (*_gnome_program_init_fn)(const char *, const char *,
- const GnomeModuleInfo *, int,
- char **, const char *, ...);
-typedef const GnomeModuleInfo * (*_libgnomeui_module_info_get_fn)();
-
-void TryInitGnome()
-{
- gnomeLib = dlopen("libgnome-2.so.0", RTLD_LAZY);
- if (!gnomeLib)
- return;
-
- gnomeuiLib = dlopen("libgnomeui-2.so.0", RTLD_LAZY);
- if (!gnomeuiLib)
- return;
-
- _gnome_program_init_fn gnome_program_init =
- (_gnome_program_init_fn)(dlsym(gnomeLib, "gnome_program_init"));
- _libgnomeui_module_info_get_fn libgnomeui_module_info_get =
- (_libgnomeui_module_info_get_fn)(dlsym(gnomeuiLib, "libgnomeui_module_info_get"));
-
- if (gnome_program_init && libgnomeui_module_info_get) {
- gnome_program_init("crashreporter", "1.0", libgnomeui_module_info_get(),
- gArgc, gArgv, nullptr);
- }
-
-}
-
-/* === Crashreporter UI Functions === */
-
-/*
- * Anything not listed here is in crashreporter_gtk_common.cpp:
- * UIInit
- * UIShowDefaultUI
- * UIError_impl
- * UIGetIniPath
- * UIGetSettingsPath
- * UIEnsurePathExists
- * UIFileExists
- * UIMoveFile
- * UIDeleteFile
- * UIOpenRead
- * UIOpenWrite
- */
-
-void UIShutdown()
-{
- if (gnomeuiLib)
- dlclose(gnomeuiLib);
- // Don't dlclose gnomeLib as libgnomevfs and libORBit-2 use atexit().
-}
-
-bool UIShowCrashUI(const StringTable& files,
- const StringTable& queryParameters,
- const string& sendURL,
- const vector<string>& restartArgs)
-{
- gFiles = files;
- gQueryParameters = queryParameters;
- gSendURL = sendURL;
- gRestartArgs = restartArgs;
- if (gQueryParameters.find("URL") != gQueryParameters.end())
- gURLParameter = gQueryParameters["URL"];
-
- gWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title(GTK_WINDOW(gWindow),
- gStrings[ST_CRASHREPORTERTITLE].c_str());
- gtk_window_set_resizable(GTK_WINDOW(gWindow), FALSE);
- gtk_window_set_position(GTK_WINDOW(gWindow), GTK_WIN_POS_CENTER);
- gtk_container_set_border_width(GTK_CONTAINER(gWindow), 12);
- g_signal_connect(gWindow, "delete-event", G_CALLBACK(WindowDeleted), 0);
- g_signal_connect(gWindow, "key_press_event", G_CALLBACK(check_escape), nullptr);
-
- GtkWidget* vbox = gtk_vbox_new(FALSE, 6);
- gtk_container_add(GTK_CONTAINER(gWindow), vbox);
-
- GtkWidget* titleLabel = gtk_label_new("");
- gtk_box_pack_start(GTK_BOX(vbox), titleLabel, FALSE, FALSE, 0);
- gtk_misc_set_alignment(GTK_MISC(titleLabel), 0, 0.5);
- char* markup = g_strdup_printf("<b>%s</b>",
- gStrings[ST_CRASHREPORTERHEADER].c_str());
- gtk_label_set_markup(GTK_LABEL(titleLabel), markup);
- g_free(markup);
-
- GtkWidget* descriptionLabel =
- gtk_label_new(gStrings[ST_CRASHREPORTERDESCRIPTION].c_str());
- gtk_box_pack_start(GTK_BOX(vbox), descriptionLabel, TRUE, TRUE, 0);
- // force the label to line wrap
-#if (MOZ_WIDGET_GTK == 2)
- gtk_widget_set_size_request(descriptionLabel, 400, -1);
-#else
- gtk_label_set_max_width_chars(GTK_LABEL(descriptionLabel), LABEL_MAX_CHAR_WIDTH);
-#endif
- gtk_label_set_line_wrap(GTK_LABEL(descriptionLabel), TRUE);
- gtk_label_set_selectable(GTK_LABEL(descriptionLabel), TRUE);
- gtk_misc_set_alignment(GTK_MISC(descriptionLabel), 0, 0.5);
-
- // this is honestly how they suggest you indent a section
- GtkWidget* indentBox = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(vbox), indentBox, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(indentBox), gtk_label_new(""), FALSE, FALSE, 6);
-
- GtkWidget* innerVBox1 = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(indentBox), innerVBox1, TRUE, TRUE, 0);
-
- gSubmitReportCheck =
- gtk_check_button_new_with_label(gStrings[ST_CHECKSUBMIT].c_str());
- gtk_box_pack_start(GTK_BOX(innerVBox1), gSubmitReportCheck, FALSE, FALSE, 0);
- g_signal_connect(gSubmitReportCheck, "clicked",
- G_CALLBACK(SubmitReportChecked), 0);
-
- // indent again, below the "submit report" checkbox
- GtkWidget* indentBox2 = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(innerVBox1), indentBox2, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(indentBox2), gtk_label_new(""), FALSE, FALSE, 6);
-
- GtkWidget* innerVBox = gtk_vbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(indentBox2), innerVBox, TRUE, TRUE, 0);
- gtk_box_set_spacing(GTK_BOX(innerVBox), 6);
-
- GtkWidget* viewReportButtonBox = gtk_hbutton_box_new();
- gtk_box_pack_start(GTK_BOX(innerVBox), viewReportButtonBox, FALSE, FALSE, 0);
- gtk_box_set_spacing(GTK_BOX(viewReportButtonBox), 6);
- gtk_button_box_set_layout(GTK_BUTTON_BOX(viewReportButtonBox), GTK_BUTTONBOX_START);
-
- gViewReportButton =
- gtk_button_new_with_label(gStrings[ST_VIEWREPORT].c_str());
- gtk_box_pack_start(GTK_BOX(viewReportButtonBox), gViewReportButton, FALSE, FALSE, 0);
- g_signal_connect(gViewReportButton, "clicked", G_CALLBACK(ViewReportClicked), 0);
-
- GtkWidget* scrolled = gtk_scrolled_window_new(0, 0);
- gtk_container_add(GTK_CONTAINER(innerVBox), scrolled);
- gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled),
- GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
- gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled),
- GTK_SHADOW_IN);
-#if (MOZ_WIDGET_GTK >= 3)
- gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(scrolled), 100);
-#endif
-
- gCommentTextLabel = gtk_label_new(gStrings[ST_COMMENTGRAYTEXT].c_str());
- gCommentText = gtk_text_view_new();
- gtk_label_set_mnemonic_widget(GTK_LABEL(gCommentTextLabel), gCommentText);
- gtk_text_view_set_accepts_tab(GTK_TEXT_VIEW(gCommentText), FALSE);
- g_signal_connect(gCommentText, "focus-in-event", G_CALLBACK(CommentFocusChange), 0);
- g_signal_connect(gCommentText, "focus-out-event", G_CALLBACK(CommentFocusChange), 0);
-
- GtkTextBuffer* commentBuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(gCommentText));
- g_signal_connect(commentBuffer, "changed", G_CALLBACK(CommentChanged), 0);
- g_signal_connect(commentBuffer, "insert-text", G_CALLBACK(CommentInsert), 0);
-
- gtk_container_add(GTK_CONTAINER(scrolled), gCommentText);
- gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(gCommentText),
- GTK_WRAP_WORD);
- gtk_widget_set_size_request(GTK_WIDGET(gCommentText), -1, 100);
-
- if (gQueryParameters.find("URL") != gQueryParameters.end()) {
- gIncludeURLCheck =
- gtk_check_button_new_with_label(gStrings[ST_CHECKURL].c_str());
- gtk_box_pack_start(GTK_BOX(innerVBox), gIncludeURLCheck, FALSE, FALSE, 0);
- g_signal_connect(gIncludeURLCheck, "clicked", G_CALLBACK(IncludeURLClicked), 0);
- // on by default
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gIncludeURLCheck), TRUE);
- }
-
- gEmailMeCheck =
- gtk_check_button_new_with_label(gStrings[ST_CHECKEMAIL].c_str());
- gtk_box_pack_start(GTK_BOX(innerVBox), gEmailMeCheck, FALSE, FALSE, 0);
- g_signal_connect(gEmailMeCheck, "clicked", G_CALLBACK(EmailMeClicked), 0);
-
- GtkWidget* emailIndentBox = gtk_hbox_new(FALSE, 0);
- gtk_box_pack_start(GTK_BOX(innerVBox), emailIndentBox, FALSE, FALSE, 0);
- gtk_box_pack_start(GTK_BOX(emailIndentBox), gtk_label_new(""),
- FALSE, FALSE, 9);
-
- gEmailEntryLabel = gtk_label_new(gStrings[ST_EMAILGRAYTEXT].c_str());
- gEmailEntry = gtk_entry_new();
- gtk_label_set_mnemonic_widget(GTK_LABEL(gEmailEntryLabel), gEmailEntry);
- gtk_box_pack_start(GTK_BOX(emailIndentBox), gEmailEntry, TRUE, TRUE, 0);
- g_signal_connect(gEmailEntry, "changed", G_CALLBACK(EmailChanged), 0);
- g_signal_connect(gEmailEntry, "focus-in-event", G_CALLBACK(EmailFocusChange), 0);
- g_signal_connect(gEmailEntry, "focus-out-event", G_CALLBACK(EmailFocusChange), 0);
-
- GtkWidget* progressBox = gtk_hbox_new(FALSE, 6);
- gtk_box_pack_start(GTK_BOX(vbox), progressBox, TRUE, TRUE, 0);
-
- // Get the throbber image from alongside the executable
- char* dir = g_path_get_dirname(gArgv[0]);
- char* path = g_build_filename(dir, "Throbber-small.gif", nullptr);
- g_free(dir);
- gThrobber = gtk_image_new_from_file(path);
- gtk_box_pack_start(GTK_BOX(progressBox), gThrobber, FALSE, FALSE, 0);
-
- gProgressLabel =
- gtk_label_new(gStrings[ST_REPORTPRESUBMIT].c_str());
- gtk_box_pack_start(GTK_BOX(progressBox), gProgressLabel, TRUE, TRUE, 0);
- // force the label to line wrap
-#if (MOZ_WIDGET_GTK == 2)
- gtk_widget_set_size_request(gProgressLabel, 400, -1);
-#else
- gtk_label_set_max_width_chars(GTK_LABEL(gProgressLabel), LABEL_MAX_CHAR_WIDTH);
-#endif
- gtk_label_set_line_wrap(GTK_LABEL(gProgressLabel), TRUE);
-
- GtkWidget* buttonBox = gtk_hbutton_box_new();
- gtk_box_pack_end(GTK_BOX(vbox), buttonBox, FALSE, FALSE, 0);
- gtk_box_set_spacing(GTK_BOX(buttonBox), 6);
- gtk_button_box_set_layout(GTK_BUTTON_BOX(buttonBox), GTK_BUTTONBOX_END);
-
- gCloseButton =
- gtk_button_new_with_label(gStrings[ST_QUIT].c_str());
- gtk_box_pack_start(GTK_BOX(buttonBox), gCloseButton, FALSE, FALSE, 0);
- gtk_widget_set_can_default(gCloseButton, TRUE);
- g_signal_connect(gCloseButton, "clicked", G_CALLBACK(CloseClicked), 0);
-
- gRestartButton = 0;
- if (restartArgs.size() > 0) {
- gRestartButton = gtk_button_new_with_label(gStrings[ST_RESTART].c_str());
- gtk_box_pack_start(GTK_BOX(buttonBox), gRestartButton, FALSE, FALSE, 0);
- gtk_widget_set_can_default(gRestartButton, TRUE);
- g_signal_connect(gRestartButton, "clicked", G_CALLBACK(RestartClicked), 0);
- }
-
- gtk_widget_grab_focus(gSubmitReportCheck);
-
- gtk_widget_grab_default(gRestartButton ? gRestartButton : gCloseButton);
-
- LoadSettings();
-
- UpdateEmail();
- UpdateSubmit();
-
- UpdateHintText(gCommentText, FALSE, &gCommentFieldHint,
- gStrings[ST_COMMENTGRAYTEXT].c_str());
- UpdateHintText(gEmailEntry, FALSE, &gEmailFieldHint,
- gStrings[ST_EMAILGRAYTEXT].c_str());
-
- gtk_widget_show_all(gWindow);
- // stick this here to avoid the show_all above...
- gtk_widget_hide(gThrobber);
-
- gtk_main();
-
- return gDidTrySend;
-}
diff --git a/toolkit/crashreporter/client/crashreporter_osx.h b/toolkit/crashreporter/client/crashreporter_osx.h
deleted file mode 100644
index e274de0de6..0000000000
--- a/toolkit/crashreporter/client/crashreporter_osx.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef CRASHREPORTER_OSX_H__
-#define CRASHREPORTER_OSX_H__
-
-#include <Cocoa/Cocoa.h>
-#include "HTTPMultipartUpload.h"
-#include "crashreporter.h"
-
-// Defined below
-@class TextViewWithPlaceHolder;
-
-@interface CrashReporterUI : NSObject
-{
- IBOutlet NSWindow* mWindow;
-
- /* Crash reporter view */
- IBOutlet NSTextField* mHeaderLabel;
- IBOutlet NSTextField* mDescriptionLabel;
- IBOutlet NSButton* mViewReportButton;
- IBOutlet NSScrollView* mCommentScrollView;
- IBOutlet TextViewWithPlaceHolder* mCommentText;
- IBOutlet NSButton* mSubmitReportButton;
- IBOutlet NSButton* mIncludeURLButton;
- IBOutlet NSButton* mEmailMeButton;
- IBOutlet NSTextField* mEmailText;
- IBOutlet NSButton* mCloseButton;
- IBOutlet NSButton* mRestartButton;
- IBOutlet NSProgressIndicator* mProgressIndicator;
- IBOutlet NSTextField* mProgressText;
-
- /* Error view */
- IBOutlet NSView* mErrorView;
- IBOutlet NSTextField* mErrorHeaderLabel;
- IBOutlet NSTextField* mErrorLabel;
- IBOutlet NSButton* mErrorCloseButton;
-
- /* For "show info" alert */
- IBOutlet NSWindow* mViewReportWindow;
- IBOutlet NSTextView* mViewReportTextView;
- IBOutlet NSButton* mViewReportOkButton;
-
- HTTPMultipartUpload* mPost;
-}
-
-- (void)showCrashUI:(const StringTable&)files
- queryParameters:(const StringTable&)queryParameters
- sendURL:(const std::string&)sendURL;
-- (void)showErrorUI:(const std::string&)message;
-- (void)showReportInfo;
-- (void)maybeSubmitReport;
-- (void)closeMeDown:(id)unused;
-
-- (IBAction)submitReportClicked:(id)sender;
-- (IBAction)viewReportClicked:(id)sender;
-- (IBAction)viewReportOkClicked:(id)sender;
-- (IBAction)closeClicked:(id)sender;
-- (IBAction)restartClicked:(id)sender;
-- (IBAction)includeURLClicked:(id)sender;
-- (IBAction)emailMeClicked:(id)sender;
-
-- (void)controlTextDidChange:(NSNotification *)note;
-- (void)textDidChange:(NSNotification *)aNotification;
-- (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString;
-
-- (void)doInitialResizing;
-- (float)setStringFitVertically:(NSControl*)control
- string:(NSString*)str
- resizeWindow:(BOOL)resizeWindow;
-- (void)setView:(NSView*)v animate: (BOOL) animate;
-- (void)enableControls:(BOOL)enabled;
-- (void)updateSubmit;
-- (void)updateURL;
-- (void)updateEmail;
-- (void)sendReport;
-- (bool)setupPost;
-- (void)uploadThread:(HTTPMultipartUpload*)post;
-- (void)uploadComplete:(NSData*)data;
-
--(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication;
--(void)applicationWillTerminate:(NSNotification *)aNotification;
-
-@end
-
-/*
- * Subclass NSTextView to provide a text view with placeholder text.
- * Also provide a setEnabled implementation.
- */
-@interface TextViewWithPlaceHolder : NSTextView {
- NSMutableAttributedString *mPlaceHolderString;
-}
-
-- (BOOL)becomeFirstResponder;
-- (void)drawRect:(NSRect)rect;
-- (BOOL)resignFirstResponder;
-- (void)setPlaceholder:(NSString*)placeholder;
-- (void)insertTab:(id)sender;
-- (void)insertBacktab:(id)sender;
-- (void)setEnabled:(BOOL)enabled;
-- (void)dealloc;
-
-@end
-
-#endif
diff --git a/toolkit/crashreporter/client/crashreporter_osx.mm b/toolkit/crashreporter/client/crashreporter_osx.mm
deleted file mode 100644
index 0768d6da31..0000000000
--- a/toolkit/crashreporter/client/crashreporter_osx.mm
+++ /dev/null
@@ -1,922 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#import <Cocoa/Cocoa.h>
-#import <CoreFoundation/CoreFoundation.h>
-#include "crashreporter.h"
-#include "crashreporter_osx.h"
-#include <crt_externs.h>
-#include <spawn.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <sstream>
-
-using std::string;
-using std::vector;
-using std::ostringstream;
-
-using namespace CrashReporter;
-
-static NSAutoreleasePool* gMainPool;
-static CrashReporterUI* gUI = 0;
-static StringTable gFiles;
-static StringTable gQueryParameters;
-static string gURLParameter;
-static string gSendURL;
-static vector<string> gRestartArgs;
-static bool gDidTrySend = false;
-static bool gRTLlayout = false;
-
-static cpu_type_t pref_cpu_types[2] = {
-#if defined(__i386__)
- CPU_TYPE_X86,
-#elif defined(__x86_64__)
- CPU_TYPE_X86_64,
-#elif defined(__ppc__)
- CPU_TYPE_POWERPC,
-#endif
- CPU_TYPE_ANY };
-
-#define NSSTR(s) [NSString stringWithUTF8String:(s).c_str()]
-
-static NSString* Str(const char* aName)
-{
- string str = gStrings[aName];
- if (str.empty()) str = "?";
- return NSSTR(str);
-}
-
-static bool RestartApplication()
-{
- vector<char*> argv(gRestartArgs.size() + 1);
-
- posix_spawnattr_t spawnattr;
- if (posix_spawnattr_init(&spawnattr) != 0) {
- return false;
- }
-
- // Set spawn attributes.
- size_t attr_count = sizeof(pref_cpu_types) / sizeof(pref_cpu_types[0]);
- size_t attr_ocount = 0;
- if (posix_spawnattr_setbinpref_np(&spawnattr,
- attr_count,
- pref_cpu_types,
- &attr_ocount) != 0 ||
- attr_ocount != attr_count) {
- posix_spawnattr_destroy(&spawnattr);
- return false;
- }
-
- unsigned int i;
- for (i = 0; i < gRestartArgs.size(); i++) {
- argv[i] = (char*)gRestartArgs[i].c_str();
- }
- argv[i] = 0;
-
- char **env = NULL;
- char ***nsEnv = _NSGetEnviron();
- if (nsEnv)
- env = *nsEnv;
- int result = posix_spawnp(NULL,
- argv[0],
- NULL,
- &spawnattr,
- &argv[0],
- env);
-
- posix_spawnattr_destroy(&spawnattr);
-
- return result == 0;
-}
-
-@implementation CrashReporterUI
-
--(void)awakeFromNib
-{
- gUI = self;
- [mWindow center];
-
- [mWindow setTitle:[[NSBundle mainBundle]
- objectForInfoDictionaryKey:@"CFBundleName"]];
-}
-
--(void)showCrashUI:(const StringTable&)files
- queryParameters:(const StringTable&)queryParameters
- sendURL:(const string&)sendURL
-{
- gFiles = files;
- gQueryParameters = queryParameters;
- gSendURL = sendURL;
-
- [mWindow setTitle:Str(ST_CRASHREPORTERTITLE)];
- [mHeaderLabel setStringValue:Str(ST_CRASHREPORTERHEADER)];
-
- NSRect viewReportFrame = [mViewReportButton frame];
- [mViewReportButton setTitle:Str(ST_VIEWREPORT)];
- [mViewReportButton sizeToFit];
- if (gRTLlayout) {
- // sizeToFit will keep the left side fixed, so realign
- float oldWidth = viewReportFrame.size.width;
- viewReportFrame = [mViewReportButton frame];
- viewReportFrame.origin.x += oldWidth - viewReportFrame.size.width;
- [mViewReportButton setFrame: viewReportFrame];
- }
-
- [mSubmitReportButton setTitle:Str(ST_CHECKSUBMIT)];
- [mIncludeURLButton setTitle:Str(ST_CHECKURL)];
- [mEmailMeButton setTitle:Str(ST_CHECKEMAIL)];
- [mViewReportOkButton setTitle:Str(ST_OK)];
-
- [mCommentText setPlaceholder:Str(ST_COMMENTGRAYTEXT)];
- if (gRTLlayout)
- [mCommentText toggleBaseWritingDirection:self];
- [[mEmailText cell] setPlaceholderString:Str(ST_EMAILGRAYTEXT)];
-
- if (gQueryParameters.find("URL") != gQueryParameters.end()) {
- // save the URL value in case the checkbox gets unchecked
- gURLParameter = gQueryParameters["URL"];
- }
- else {
- // no URL specified, hide checkbox
- [mIncludeURLButton removeFromSuperview];
- // shrink window to fit
- NSRect frame = [mWindow frame];
- NSRect includeURLFrame = [mIncludeURLButton frame];
- NSRect emailFrame = [mEmailMeButton frame];
- int buttonMask = [mViewReportButton autoresizingMask];
- int checkMask = [mSubmitReportButton autoresizingMask];
- int commentScrollMask = [mCommentScrollView autoresizingMask];
-
- [mViewReportButton setAutoresizingMask:NSViewMinYMargin];
- [mSubmitReportButton setAutoresizingMask:NSViewMinYMargin];
- [mCommentScrollView setAutoresizingMask:NSViewMinYMargin];
-
- // remove all the space in between
- frame.size.height -= includeURLFrame.origin.y - emailFrame.origin.y;
- [mWindow setFrame:frame display: true animate:NO];
-
- [mViewReportButton setAutoresizingMask:buttonMask];
- [mSubmitReportButton setAutoresizingMask:checkMask];
- [mCommentScrollView setAutoresizingMask:commentScrollMask];
- }
-
- // resize some buttons horizontally and possibly some controls vertically
- [self doInitialResizing];
-
- // load default state of submit checkbox
- // we don't just do this via IB because we want the default to be
- // off a certain percentage of the time
- BOOL submitChecked = NO;
- NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
- if (nil != [userDefaults objectForKey:@"submitReport"]) {
- submitChecked = [userDefaults boolForKey:@"submitReport"];
- }
- else {
- // use compile-time specified enable percentage
- submitChecked = ShouldEnableSending();
- [userDefaults setBool:submitChecked forKey:@"submitReport"];
- }
- [mSubmitReportButton setState:(submitChecked ? NSOnState : NSOffState)];
-
- [self updateSubmit];
- [self updateURL];
- [self updateEmail];
-
- [mWindow makeKeyAndOrderFront:nil];
-}
-
--(void)showErrorUI:(const string&)message
-{
- [self setView: mErrorView animate: NO];
-
- [mErrorHeaderLabel setStringValue:Str(ST_CRASHREPORTERHEADER)];
- [self setStringFitVertically:mErrorLabel
- string:NSSTR(message)
- resizeWindow:YES];
- [mErrorCloseButton setTitle:Str(ST_OK)];
-
- [mErrorCloseButton setKeyEquivalent:@"\r"];
- [mWindow makeFirstResponder:mErrorCloseButton];
- [mWindow makeKeyAndOrderFront:nil];
-}
-
--(void)showReportInfo
-{
- NSDictionary* boldAttr = [NSDictionary
- dictionaryWithObject:
- [NSFont boldSystemFontOfSize:
- [NSFont smallSystemFontSize]]
- forKey:NSFontAttributeName];
- NSDictionary* normalAttr = [NSDictionary
- dictionaryWithObject:
- [NSFont systemFontOfSize:
- [NSFont smallSystemFontSize]]
- forKey:NSFontAttributeName];
-
- [mViewReportTextView setString:@""];
- for (StringTable::iterator iter = gQueryParameters.begin();
- iter != gQueryParameters.end();
- iter++) {
- NSAttributedString* key = [[NSAttributedString alloc]
- initWithString:NSSTR(iter->first + ": ")
- attributes:boldAttr];
- NSAttributedString* value = [[NSAttributedString alloc]
- initWithString:NSSTR(iter->second + "\n")
- attributes:normalAttr];
- [[mViewReportTextView textStorage] appendAttributedString: key];
- [[mViewReportTextView textStorage] appendAttributedString: value];
- [key release];
- [value release];
- }
-
- NSAttributedString* extra = [[NSAttributedString alloc]
- initWithString:NSSTR("\n" + gStrings[ST_EXTRAREPORTINFO])
- attributes:normalAttr];
- [[mViewReportTextView textStorage] appendAttributedString: extra];
- [extra release];
-}
-
-- (void)maybeSubmitReport
-{
- if ([mSubmitReportButton state] == NSOnState) {
- [self setStringFitVertically:mProgressText
- string:Str(ST_REPORTDURINGSUBMIT)
- resizeWindow:YES];
- // disable all the controls
- [self enableControls:NO];
- [mSubmitReportButton setEnabled:NO];
- [mRestartButton setEnabled:NO];
- [mCloseButton setEnabled:NO];
- [mProgressIndicator startAnimation:self];
- gDidTrySend = true;
- [self sendReport];
- } else {
- [NSApp terminate:self];
- }
-}
-
-- (void)closeMeDown:(id)unused
-{
- [NSApp terminate:self];
-}
-
--(IBAction)submitReportClicked:(id)sender
-{
- [self updateSubmit];
- NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
- [userDefaults setBool:([mSubmitReportButton state] == NSOnState)
- forKey:@"submitReport"];
- [userDefaults synchronize];
-}
-
--(IBAction)viewReportClicked:(id)sender
-{
- [self showReportInfo];
- [NSApp beginSheet:mViewReportWindow modalForWindow:mWindow
- modalDelegate:nil didEndSelector:nil contextInfo:nil];
-}
-
-- (IBAction)viewReportOkClicked:(id)sender
-{
- [mViewReportWindow orderOut:nil];
- [NSApp endSheet:mViewReportWindow];
-}
-
--(IBAction)closeClicked:(id)sender
-{
- [self maybeSubmitReport];
-}
-
--(IBAction)restartClicked:(id)sender
-{
- RestartApplication();
- [self maybeSubmitReport];
-}
-
-- (IBAction)includeURLClicked:(id)sender
-{
- [self updateURL];
-}
-
--(IBAction)emailMeClicked:(id)sender
-{
- [self updateEmail];
-}
-
--(void)controlTextDidChange:(NSNotification *)note
-{
- [self updateEmail];
-}
-
-- (void)textDidChange:(NSNotification *)aNotification
-{
- // update comment parameter
- if ([[[mCommentText textStorage] mutableString] length] > 0)
- gQueryParameters["Comments"] = [[[mCommentText textStorage] mutableString]
- UTF8String];
- else
- gQueryParameters.erase("Comments");
-}
-
-// Limit the comment field to 500 bytes in UTF-8
-- (BOOL)textView:(NSTextView *)aTextView shouldChangeTextInRange:(NSRange)affectedCharRange replacementString:(NSString *)replacementString
-{
- // current string length + replacement text length - replaced range length
- if (([[aTextView string]
- lengthOfBytesUsingEncoding:NSUTF8StringEncoding]
- + [replacementString lengthOfBytesUsingEncoding:NSUTF8StringEncoding]
- - [[[aTextView string] substringWithRange:affectedCharRange]
- lengthOfBytesUsingEncoding:NSUTF8StringEncoding])
- > MAX_COMMENT_LENGTH) {
- return NO;
- }
- return YES;
-}
-
-- (void)doInitialResizing
-{
- NSRect windowFrame = [mWindow frame];
- NSRect restartFrame = [mRestartButton frame];
- NSRect closeFrame = [mCloseButton frame];
- // resize close button to fit text
- float oldCloseWidth = closeFrame.size.width;
- [mCloseButton setTitle:Str(ST_QUIT)];
- [mCloseButton sizeToFit];
- closeFrame = [mCloseButton frame];
- // move close button left if it grew
- if (!gRTLlayout) {
- closeFrame.origin.x -= closeFrame.size.width - oldCloseWidth;
- }
-
- if (gRestartArgs.size() == 0) {
- [mRestartButton removeFromSuperview];
- if (!gRTLlayout) {
- closeFrame.origin.x = restartFrame.origin.x +
- (restartFrame.size.width - closeFrame.size.width);
- }
- else {
- closeFrame.origin.x = restartFrame.origin.x;
- }
- [mCloseButton setFrame: closeFrame];
- [mCloseButton setKeyEquivalent:@"\r"];
- } else {
- [mRestartButton setTitle:Str(ST_RESTART)];
- // resize "restart" button
- float oldRestartWidth = restartFrame.size.width;
- [mRestartButton sizeToFit];
- restartFrame = [mRestartButton frame];
- if (!gRTLlayout) {
- // move left by the amount that the button grew
- restartFrame.origin.x -= restartFrame.size.width - oldRestartWidth;
- closeFrame.origin.x -= restartFrame.size.width - oldRestartWidth;
- }
- else {
- // shift the close button right in RTL
- closeFrame.origin.x += restartFrame.size.width - oldRestartWidth;
- }
- [mRestartButton setFrame: restartFrame];
- [mCloseButton setFrame: closeFrame];
- // possibly resize window if both buttons no longer fit
- // leave 20 px from either side of the window, and 12 px
- // between the buttons
- float neededWidth = closeFrame.size.width + restartFrame.size.width +
- 2*20 + 12;
-
- if (neededWidth > windowFrame.size.width) {
- windowFrame.size.width = neededWidth;
- [mWindow setFrame:windowFrame display: true animate: NO];
- }
- [mRestartButton setKeyEquivalent:@"\r"];
- }
-
- NSButton *checkboxes[] = {
- mSubmitReportButton,
- mIncludeURLButton,
- mEmailMeButton
- };
-
- for (int i=0; i<3; i++) {
- NSRect frame = [checkboxes[i] frame];
- [checkboxes[i] sizeToFit];
- if (gRTLlayout) {
- // sizeToFit will keep the left side fixed, so realign
- float oldWidth = frame.size.width;
- frame = [checkboxes[i] frame];
- frame.origin.x += oldWidth - frame.size.width;
- [checkboxes[i] setFrame: frame];
- }
- // keep existing spacing on left side, + 20 px spare on right
- float neededWidth = frame.origin.x + frame.size.width + 20;
- if (neededWidth > windowFrame.size.width) {
- windowFrame.size.width = neededWidth;
- [mWindow setFrame:windowFrame display: true animate: NO];
- }
- }
-
- // do this down here because we may have made the window wider
- // up above
- [self setStringFitVertically:mDescriptionLabel
- string:Str(ST_CRASHREPORTERDESCRIPTION)
- resizeWindow:YES];
-
- // now pin all the controls (except quit/submit) in place,
- // if we lengthen the window after this, it's just to lengthen
- // the progress text, so nothing above that text should move.
- NSView* views[] = {
- mSubmitReportButton,
- mViewReportButton,
- mCommentScrollView,
- mIncludeURLButton,
- mEmailMeButton,
- mEmailText,
- mProgressIndicator,
- mProgressText
- };
- for (unsigned int i=0; i<sizeof(views)/sizeof(views[0]); i++) {
- [views[i] setAutoresizingMask:NSViewMinYMargin];
- }
-}
-
--(float)setStringFitVertically:(NSControl*)control
- string:(NSString*)str
- resizeWindow:(BOOL)resizeWindow
-{
- // hack to make the text field grow vertically
- NSRect frame = [control frame];
- float oldHeight = frame.size.height;
-
- frame.size.height = 10000;
- NSSize oldCellSize = [[control cell] cellSizeForBounds: frame];
- [control setStringValue: str];
- NSSize newCellSize = [[control cell] cellSizeForBounds: frame];
-
- float delta = newCellSize.height - oldCellSize.height;
- frame.origin.y -= delta;
- frame.size.height = oldHeight + delta;
- [control setFrame: frame];
-
- if (resizeWindow) {
- NSRect frame = [mWindow frame];
- frame.origin.y -= delta;
- frame.size.height += delta;
- [mWindow setFrame:frame display: true animate: NO];
- }
-
- return delta;
-}
-
--(void)setView: (NSView*)v animate: (BOOL)animate
-{
- NSRect frame = [mWindow frame];
-
- NSRect oldViewFrame = [[mWindow contentView] frame];
- NSRect newViewFrame = [v frame];
-
- frame.origin.y += oldViewFrame.size.height - newViewFrame.size.height;
- frame.size.height -= oldViewFrame.size.height - newViewFrame.size.height;
-
- frame.origin.x += oldViewFrame.size.width - newViewFrame.size.width;
- frame.size.width -= oldViewFrame.size.width - newViewFrame.size.width;
-
- [mWindow setContentView:v];
- [mWindow setFrame:frame display:true animate:animate];
-}
-
-- (void)enableControls:(BOOL)enabled
-{
- [mViewReportButton setEnabled:enabled];
- [mIncludeURLButton setEnabled:enabled];
- [mEmailMeButton setEnabled:enabled];
- [mCommentText setEnabled:enabled];
- [mCommentScrollView setHasVerticalScroller:enabled];
- [self updateEmail];
-}
-
--(void)updateSubmit
-{
- if ([mSubmitReportButton state] == NSOnState) {
- [self setStringFitVertically:mProgressText
- string:Str(ST_REPORTPRESUBMIT)
- resizeWindow:YES];
- [mProgressText setHidden:NO];
- // enable all the controls
- [self enableControls:YES];
- }
- else {
- // not submitting, disable all the controls under
- // the submit checkbox, and hide the status text
- [mProgressText setHidden:YES];
- [self enableControls:NO];
- }
-}
-
--(void)updateURL
-{
- if ([mIncludeURLButton state] == NSOnState && !gURLParameter.empty()) {
- gQueryParameters["URL"] = gURLParameter;
- } else {
- gQueryParameters.erase("URL");
- }
-}
-
--(void)updateEmail
-{
- if ([mEmailMeButton state] == NSOnState &&
- [mSubmitReportButton state] == NSOnState) {
- NSString* email = [mEmailText stringValue];
- gQueryParameters["Email"] = [email UTF8String];
- [mEmailText setEnabled:YES];
- } else {
- gQueryParameters.erase("Email");
- [mEmailText setEnabled:NO];
- }
-}
-
--(void)sendReport
-{
- if (![self setupPost]) {
- LogMessage("Crash report submission failed: could not set up POST data");
- [self setStringFitVertically:mProgressText
- string:Str(ST_SUBMITFAILED)
- resizeWindow:YES];
- // quit after 5 seconds
- [self performSelector:@selector(closeMeDown:) withObject:nil
- afterDelay:5.0];
- }
-
- [NSThread detachNewThreadSelector:@selector(uploadThread:)
- toTarget:self
- withObject:mPost];
-}
-
--(bool)setupPost
-{
- NSURL* url = [NSURL URLWithString:[NSSTR(gSendURL) stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
- if (!url) return false;
-
- mPost = [[HTTPMultipartUpload alloc] initWithURL: url];
- if (!mPost) return false;
-
- NSMutableDictionary* parameters =
- [[NSMutableDictionary alloc] initWithCapacity: gQueryParameters.size()];
- if (!parameters) return false;
-
- StringTable::const_iterator end = gQueryParameters.end();
- for (StringTable::const_iterator i = gQueryParameters.begin();
- i != end;
- i++) {
- NSString* key = NSSTR(i->first);
- NSString* value = NSSTR(i->second);
- if (key && value) {
- [parameters setObject: value forKey: key];
- } else {
- ostringstream message;
- message << "Warning: skipping annotation '" << i->first
- << "' due to malformed UTF-8 encoding";
- LogMessage(message.str());
- }
- }
-
- for (StringTable::const_iterator i = gFiles.begin();
- i != gFiles.end();
- i++) {
- [mPost addFileAtPath: NSSTR(i->second) name: NSSTR(i->first)];
- }
-
- [mPost setParameters: parameters];
- [parameters release];
-
- return true;
-}
-
--(void)uploadComplete:(NSData*)data
-{
- NSHTTPURLResponse* response = [mPost response];
- [mPost release];
-
- bool success;
- string reply;
- if (!data || !response || [response statusCode] != 200) {
- success = false;
- reply = "";
-
- // if data is nil, we probably logged an error in uploadThread
- if (data != nil && response != nil) {
- ostringstream message;
- message << "Crash report submission failed: server returned status "
- << [response statusCode];
- LogMessage(message.str());
- }
- } else {
- success = true;
- LogMessage("Crash report submitted successfully");
-
- NSString* encodingName = [response textEncodingName];
- NSStringEncoding encoding;
- if (encodingName) {
- encoding = CFStringConvertEncodingToNSStringEncoding(
- CFStringConvertIANACharSetNameToEncoding((CFStringRef)encodingName));
- } else {
- encoding = NSISOLatin1StringEncoding;
- }
- NSString* r = [[NSString alloc] initWithData: data encoding: encoding];
- reply = [r UTF8String];
- [r release];
- }
-
- SendCompleted(success, reply);
-
- [mProgressIndicator stopAnimation:self];
- if (success) {
- [self setStringFitVertically:mProgressText
- string:Str(ST_REPORTSUBMITSUCCESS)
- resizeWindow:YES];
- } else {
- [self setStringFitVertically:mProgressText
- string:Str(ST_SUBMITFAILED)
- resizeWindow:YES];
- }
- // quit after 5 seconds
- [self performSelector:@selector(closeMeDown:) withObject:nil
- afterDelay:5.0];
-}
-
--(void)uploadThread:(HTTPMultipartUpload*)post
-{
- NSAutoreleasePool* autoreleasepool = [[NSAutoreleasePool alloc] init];
- NSError* error = nil;
- NSData* data = [post send: &error];
- if (error) {
- data = nil;
- NSString* errorDesc = [error localizedDescription];
- string message = [errorDesc UTF8String];
- LogMessage("Crash report submission failed: " + message);
- }
-
- [self performSelectorOnMainThread: @selector(uploadComplete:)
- withObject: data
- waitUntilDone: YES];
-
- [autoreleasepool release];
-}
-
-// to get auto-quit when we close the window
--(BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)theApplication
-{
- return YES;
-}
-
--(void)applicationWillTerminate:(NSNotification *)aNotification
-{
- // since we use [NSApp terminate:] we never return to main,
- // so do our cleanup here
- if (!gDidTrySend)
- DeleteDump();
-}
-
-@end
-
-@implementation TextViewWithPlaceHolder
-
-- (BOOL)becomeFirstResponder
-{
- [self setNeedsDisplay:YES];
- return [super becomeFirstResponder];
-}
-
-- (void)drawRect:(NSRect)rect
-{
- [super drawRect:rect];
- if (mPlaceHolderString && [[self string] isEqualToString:@""] &&
- self != [[self window] firstResponder])
- [mPlaceHolderString drawInRect:[self frame]];
-}
-
-- (BOOL)resignFirstResponder
-{
- [self setNeedsDisplay:YES];
- return [super resignFirstResponder];
-}
-
-- (void)setPlaceholder:(NSString*)placeholder
-{
- NSColor* txtColor = [NSColor disabledControlTextColor];
- NSDictionary* txtDict = [NSDictionary
- dictionaryWithObjectsAndKeys:txtColor,
- NSForegroundColorAttributeName, nil];
- mPlaceHolderString = [[NSMutableAttributedString alloc]
- initWithString:placeholder attributes:txtDict];
- if (gRTLlayout)
- [mPlaceHolderString setAlignment:NSRightTextAlignment
- range:NSMakeRange(0, [placeholder length])];
-
-}
-
-- (void)insertTab:(id)sender
-{
- // don't actually want to insert tabs, just tab to next control
- [[self window] selectNextKeyView:sender];
-}
-
-- (void)insertBacktab:(id)sender
-{
- [[self window] selectPreviousKeyView:sender];
-}
-
-- (void)setEnabled:(BOOL)enabled
-{
- [self setSelectable:enabled];
- [self setEditable:enabled];
- if (![[self string] isEqualToString:@""]) {
- NSAttributedString* colorString;
- NSColor* txtColor;
- if (enabled)
- txtColor = [NSColor textColor];
- else
- txtColor = [NSColor disabledControlTextColor];
- NSDictionary *txtDict = [NSDictionary
- dictionaryWithObjectsAndKeys:txtColor,
- NSForegroundColorAttributeName, nil];
- colorString = [[NSAttributedString alloc]
- initWithString:[self string]
- attributes:txtDict];
- [[self textStorage] setAttributedString: colorString];
- [self setInsertionPointColor:txtColor];
- [colorString release];
- }
-}
-
-- (void)dealloc
-{
- [mPlaceHolderString release];
- [super dealloc];
-}
-
-@end
-
-/* === Crashreporter UI Functions === */
-
-bool UIInit()
-{
- gMainPool = [[NSAutoreleasePool alloc] init];
- [NSApplication sharedApplication];
-
- if (gStrings.find("isRTL") != gStrings.end() &&
- gStrings["isRTL"] == "yes")
- gRTLlayout = true;
-
- [NSBundle loadNibNamed:(gRTLlayout ? @"MainMenuRTL" : @"MainMenu")
- owner:NSApp];
-
- return true;
-}
-
-void UIShutdown()
-{
- [gMainPool release];
-}
-
-void UIShowDefaultUI()
-{
- [gUI showErrorUI: gStrings[ST_CRASHREPORTERDEFAULT]];
- [NSApp run];
-}
-
-bool UIShowCrashUI(const StringTable& files,
- const StringTable& queryParameters,
- const string& sendURL,
- const vector<string>& restartArgs)
-{
- gRestartArgs = restartArgs;
-
- [gUI showCrashUI: files
- queryParameters: queryParameters
- sendURL: sendURL];
- [NSApp run];
-
- return gDidTrySend;
-}
-
-void UIError_impl(const string& message)
-{
- if (!gUI) {
- // UI failed to initialize, printing is the best we can do
- printf("Error: %s\n", message.c_str());
- return;
- }
-
- [gUI showErrorUI: message];
- [NSApp run];
-}
-
-bool UIGetIniPath(string& path)
-{
- NSString* tmpPath = [NSString stringWithUTF8String:gArgv[0]];
- NSString* iniName = [tmpPath lastPathComponent];
- iniName = [iniName stringByAppendingPathExtension:@"ini"];
- tmpPath = [tmpPath stringByDeletingLastPathComponent];
- tmpPath = [tmpPath stringByDeletingLastPathComponent];
- tmpPath = [tmpPath stringByAppendingPathComponent:@"Resources"];
- tmpPath = [tmpPath stringByAppendingPathComponent:iniName];
- path = [tmpPath UTF8String];
- return true;
-}
-
-bool UIGetSettingsPath(const string& vendor,
- const string& product,
- string& settingsPath)
-{
- FSRef foundRef;
- OSErr err = FSFindFolder(kUserDomain, kApplicationSupportFolderType,
- kCreateFolder, &foundRef);
- if (err != noErr)
- return false;
-
- unsigned char path[PATH_MAX];
- FSRefMakePath(&foundRef, path, sizeof(path));
- NSString* destPath = [NSString stringWithUTF8String:reinterpret_cast<char*>(path)];
-
- // Note that MacOS ignores the vendor when creating the profile hierarchy -
- // all application preferences directories live alongside one another in
- // ~/Library/Application Support/
- destPath = [destPath stringByAppendingPathComponent: NSSTR(product)];
- // Thunderbird stores its profile in ~/Library/Thunderbird,
- // but we're going to put stuff in ~/Library/Application Support/Thunderbird
- // anyway, so we have to ensure that path exists.
- string tempPath = [destPath UTF8String];
- if (!UIEnsurePathExists(tempPath))
- return false;
-
- destPath = [destPath stringByAppendingPathComponent: @"Crash Reports"];
-
- settingsPath = [destPath UTF8String];
-
- return true;
-}
-
-bool UIEnsurePathExists(const string& path)
-{
- int ret = mkdir(path.c_str(), S_IRWXU);
- int e = errno;
- if (ret == -1 && e != EEXIST)
- return false;
-
- return true;
-}
-
-bool UIFileExists(const string& path)
-{
- struct stat sb;
- int ret = stat(path.c_str(), &sb);
- if (ret == -1 || !(sb.st_mode & S_IFREG))
- return false;
-
- return true;
-}
-
-bool UIMoveFile(const string& file, const string& newfile)
-{
- if (!rename(file.c_str(), newfile.c_str()))
- return true;
- if (errno != EXDEV)
- return false;
-
- NSFileManager *fileManager = [NSFileManager defaultManager];
- NSString *source = [fileManager stringWithFileSystemRepresentation:file.c_str() length:file.length()];
- NSString *dest = [fileManager stringWithFileSystemRepresentation:newfile.c_str() length:newfile.length()];
- if (!source || !dest)
- return false;
-
- [fileManager moveItemAtPath:source toPath:dest error:NULL];
- return UIFileExists(newfile);
-}
-
-bool UIDeleteFile(const string& file)
-{
- return (unlink(file.c_str()) != -1);
-}
-
-std::ifstream* UIOpenRead(const string& filename)
-{
- return new std::ifstream(filename.c_str(), std::ios::in);
-}
-
-std::ofstream* UIOpenWrite(const string& filename,
- bool append, // append=false
- bool binary) // binary=false
-{
- std::ios_base::openmode mode = std::ios::out;
-
- if (append) {
- mode = mode | std::ios::app;
- }
-
- if (binary) {
- mode = mode | std::ios::binary;
- }
-
- return new std::ofstream(filename.c_str(), mode);
-}
diff --git a/toolkit/crashreporter/client/crashreporter_unix_common.cpp b/toolkit/crashreporter/client/crashreporter_unix_common.cpp
deleted file mode 100644
index f42a35616a..0000000000
--- a/toolkit/crashreporter/client/crashreporter_unix_common.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "crashreporter.h"
-
-#include <algorithm>
-
-#include <dirent.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-using namespace CrashReporter;
-using std::string;
-using std::vector;
-using std::sort;
-
-struct FileData
-{
- time_t timestamp;
- string path;
-};
-
-static bool CompareFDTime(const FileData& fd1, const FileData& fd2)
-{
- return fd1.timestamp > fd2.timestamp;
-}
-
-void UIPruneSavedDumps(const std::string& directory)
-{
- DIR *dirfd = opendir(directory.c_str());
- if (!dirfd)
- return;
-
- vector<FileData> dumpfiles;
-
- while (dirent *dir = readdir(dirfd)) {
- FileData fd;
- fd.path = directory + '/' + dir->d_name;
- if (fd.path.size() < 5)
- continue;
-
- if (fd.path.compare(fd.path.size() - 4, 4, ".dmp") != 0)
- continue;
-
- struct stat st;
- if (stat(fd.path.c_str(), &st)) {
- closedir(dirfd);
- return;
- }
-
- fd.timestamp = st.st_mtime;
-
- dumpfiles.push_back(fd);
- }
-
- sort(dumpfiles.begin(), dumpfiles.end(), CompareFDTime);
-
- while (dumpfiles.size() > kSaveCount) {
- // get the path of the oldest file
- string path = dumpfiles[dumpfiles.size() - 1].path;
- UIDeleteFile(path.c_str());
-
- // s/.dmp/.extra/
- path.replace(path.size() - 4, 4, ".extra");
- UIDeleteFile(path.c_str());
-
- dumpfiles.pop_back();
- }
-}
-
-void UIRunMinidumpAnalyzer(const string& exename, const string& filename)
-{
- // Run the minidump analyzer and wait for it to finish
- pid_t pid = fork();
-
- if (pid == -1) {
- return; // Nothing to do upon failure
- } else if (pid == 0) {
- execl(exename.c_str(), exename.c_str(), filename.c_str(), nullptr);
- } else {
- waitpid(pid, nullptr, 0);
- }
-}
diff --git a/toolkit/crashreporter/client/crashreporter_win.cpp b/toolkit/crashreporter/client/crashreporter_win.cpp
deleted file mode 100644
index 57ca495bad..0000000000
--- a/toolkit/crashreporter/client/crashreporter_win.cpp
+++ /dev/null
@@ -1,1568 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifdef WIN32_LEAN_AND_MEAN
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
-#include "crashreporter.h"
-
-#include <windows.h>
-#include <versionhelpers.h>
-#include <commctrl.h>
-#include <richedit.h>
-#include <shellapi.h>
-#include <shlobj.h>
-#include <shlwapi.h>
-#include <math.h>
-#include <set>
-#include <algorithm>
-#include "resource.h"
-#include "client/windows/sender/crash_report_sender.h"
-#include "common/windows/string_utils-inl.h"
-
-#define CRASH_REPORTER_VALUE L"Enabled"
-#define SUBMIT_REPORT_VALUE L"SubmitCrashReport"
-#define SUBMIT_REPORT_OLD L"SubmitReport"
-#define INCLUDE_URL_VALUE L"IncludeURL"
-#define EMAIL_ME_VALUE L"EmailMe"
-#define EMAIL_VALUE L"Email"
-#define MAX_EMAIL_LENGTH 1024
-
-#define SENDURL_ORIGINAL L"https://crash-reports.mozilla.com/submit"
-#define SENDURL_XPSP2 L"https://crash-reports-xpsp2.mozilla.com/submit"
-
-#define WM_UPLOADCOMPLETE WM_APP
-
-// Thanks, Windows.h :(
-#undef min
-#undef max
-
-using std::string;
-using std::wstring;
-using std::map;
-using std::vector;
-using std::set;
-using std::ios;
-using std::ifstream;
-using std::ofstream;
-
-using namespace CrashReporter;
-
-typedef struct {
- HWND hDlg;
- map<wstring,wstring> queryParameters;
- map<wstring,wstring> files;
- wstring sendURL;
-
- wstring serverResponse;
-} SendThreadData;
-
-/*
- * Per http://msdn2.microsoft.com/en-us/library/ms645398(VS.85).aspx
- * "The DLGTEMPLATEEX structure is not defined in any standard header file.
- * The structure definition is provided here to explain the format of an
- * extended template for a dialog box.
-*/
-typedef struct {
- WORD dlgVer;
- WORD signature;
- DWORD helpID;
- DWORD exStyle;
- // There's more to this struct, but it has weird variable-length
- // members, and I only actually need to touch exStyle on an existing
- // instance, so I've omitted the rest.
-} DLGTEMPLATEEX;
-
-static HANDLE gThreadHandle;
-static SendThreadData gSendData = { 0, };
-static vector<string> gRestartArgs;
-static map<wstring,wstring> gQueryParameters;
-static wstring gCrashReporterKey(L"Software\\Mozilla\\Crash Reporter");
-static wstring gURLParameter;
-static int gCheckboxPadding = 6;
-static bool gRTLlayout = false;
-
-// When vertically resizing the dialog, these items should move down
-static set<UINT> gAttachedBottom;
-
-// Default set of items for gAttachedBottom
-static const UINT kDefaultAttachedBottom[] = {
- IDC_SUBMITREPORTCHECK,
- IDC_VIEWREPORTBUTTON,
- IDC_COMMENTTEXT,
- IDC_INCLUDEURLCHECK,
- IDC_EMAILMECHECK,
- IDC_EMAILTEXT,
- IDC_PROGRESSTEXT,
- IDC_THROBBER,
- IDC_CLOSEBUTTON,
- IDC_RESTARTBUTTON,
-};
-
-static wstring UTF8ToWide(const string& utf8, bool *success = 0);
-static DWORD WINAPI SendThreadProc(LPVOID param);
-
-static wstring Str(const char* key)
-{
- return UTF8ToWide(gStrings[key]);
-}
-
-/* === win32 helper functions === */
-
-static void DoInitCommonControls()
-{
- INITCOMMONCONTROLSEX ic;
- ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
- ic.dwICC = ICC_PROGRESS_CLASS;
- InitCommonControlsEx(&ic);
- // also get the rich edit control
- LoadLibrary(L"Msftedit.dll");
-}
-
-static bool GetBoolValue(HKEY hRegKey, LPCTSTR valueName, DWORD* value)
-{
- DWORD type, dataSize;
- dataSize = sizeof(DWORD);
- if (RegQueryValueEx(hRegKey, valueName, nullptr,
- &type, (LPBYTE)value, &dataSize) == ERROR_SUCCESS &&
- type == REG_DWORD)
- return true;
-
- return false;
-}
-
-// Removes a value from HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER, if it exists.
-static void RemoveUnusedValues(const wchar_t* key, LPCTSTR valueName)
-{
- HKEY hRegKey;
-
- if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, KEY_SET_VALUE, &hRegKey)
- == ERROR_SUCCESS) {
- RegDeleteValue(hRegKey, valueName);
- RegCloseKey(hRegKey);
- }
-
- if (RegOpenKeyEx(HKEY_CURRENT_USER, key, 0, KEY_SET_VALUE, &hRegKey)
- == ERROR_SUCCESS) {
- RegDeleteValue(hRegKey, valueName);
- RegCloseKey(hRegKey);
- }
-}
-
-static bool CheckBoolKey(const wchar_t* key,
- const wchar_t* valueName,
- bool* enabled)
-{
- /*
- * NOTE! This code needs to stay in sync with the preference checking
- * code in in nsExceptionHandler.cpp.
- */
- *enabled = false;
- bool found = false;
- HKEY hRegKey;
- DWORD val;
- // see if our reg key is set globally
- if (RegOpenKey(HKEY_LOCAL_MACHINE, key, &hRegKey) == ERROR_SUCCESS) {
- if (GetBoolValue(hRegKey, valueName, &val)) {
- *enabled = (val == 1);
- found = true;
- }
- RegCloseKey(hRegKey);
- } else {
- // look for it in user settings
- if (RegOpenKey(HKEY_CURRENT_USER, key, &hRegKey) == ERROR_SUCCESS) {
- if (GetBoolValue(hRegKey, valueName, &val)) {
- *enabled = (val == 1);
- found = true;
- }
- RegCloseKey(hRegKey);
- }
- }
-
- return found;
-}
-
-static void SetBoolKey(const wchar_t* key, const wchar_t* value, bool enabled)
-{
- /*
- * NOTE! This code needs to stay in sync with the preference setting
- * code in in nsExceptionHandler.cpp.
- */
- HKEY hRegKey;
-
- // remove the old value from the registry if it exists
- RemoveUnusedValues(key, SUBMIT_REPORT_OLD);
-
- if (RegCreateKey(HKEY_CURRENT_USER, key, &hRegKey) == ERROR_SUCCESS) {
- DWORD data = (enabled ? 1 : 0);
- RegSetValueEx(hRegKey, value, 0, REG_DWORD, (LPBYTE)&data, sizeof(data));
- RegCloseKey(hRegKey);
- }
-}
-
-static bool GetStringValue(HKEY hRegKey, LPCTSTR valueName, wstring& value)
-{
- DWORD type, dataSize;
- wchar_t buf[2048];
- dataSize = sizeof(buf);
- if (RegQueryValueEx(hRegKey, valueName, nullptr,
- &type, (LPBYTE)buf, &dataSize) == ERROR_SUCCESS &&
- type == REG_SZ) {
- value = buf;
- return true;
- }
-
- return false;
-}
-
-static bool GetStringKey(const wchar_t* key,
- const wchar_t* valueName,
- wstring& value)
-{
- value = L"";
- bool found = false;
- HKEY hRegKey;
- // see if our reg key is set globally
- if (RegOpenKey(HKEY_LOCAL_MACHINE, key, &hRegKey) == ERROR_SUCCESS) {
- if (GetStringValue(hRegKey, valueName, value)) {
- found = true;
- }
- RegCloseKey(hRegKey);
- } else {
- // look for it in user settings
- if (RegOpenKey(HKEY_CURRENT_USER, key, &hRegKey) == ERROR_SUCCESS) {
- if (GetStringValue(hRegKey, valueName, value)) {
- found = true;
- }
- RegCloseKey(hRegKey);
- }
- }
-
- return found;
-}
-
-static void SetStringKey(const wchar_t* key,
- const wchar_t* valueName,
- const wstring& value)
-{
- HKEY hRegKey;
- if (RegCreateKey(HKEY_CURRENT_USER, key, &hRegKey) == ERROR_SUCCESS) {
- RegSetValueEx(hRegKey, valueName, 0, REG_SZ,
- (LPBYTE)value.c_str(),
- (value.length() + 1) * sizeof(wchar_t));
- RegCloseKey(hRegKey);
- }
-}
-
-static string FormatLastError()
-{
- DWORD err = GetLastError();
- LPWSTR s;
- string message = "Crash report submission failed: ";
- // odds are it's a WinInet error
- HANDLE hInetModule = GetModuleHandle(L"WinInet.dll");
- if(FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_FROM_HMODULE,
- hInetModule,
- err,
- 0,
- (LPWSTR)&s,
- 0,
- nullptr) != 0) {
- message += WideToUTF8(s, nullptr);
- LocalFree(s);
- // strip off any trailing newlines
- string::size_type n = message.find_last_not_of("\r\n");
- if (n < message.size() - 1) {
- message.erase(n+1);
- }
- }
- else {
- char buf[64];
- sprintf(buf, "Unknown error, error code: 0x%08x", err);
- message += buf;
- }
- return message;
-}
-
-#define TS_DRAW 2
-#define BP_CHECKBOX 3
-
-typedef HANDLE (WINAPI*OpenThemeDataPtr)(HWND hwnd, LPCWSTR pszClassList);
-typedef HRESULT (WINAPI*CloseThemeDataPtr)(HANDLE hTheme);
-typedef HRESULT (WINAPI*GetThemePartSizePtr)(HANDLE hTheme, HDC hdc, int iPartId,
- int iStateId, RECT* prc, int ts,
- SIZE* psz);
-typedef HRESULT (WINAPI*GetThemeContentRectPtr)(HANDLE hTheme, HDC hdc, int iPartId,
- int iStateId, const RECT* pRect,
- RECT* pContentRect);
-
-
-static void GetThemeSizes(HWND hwnd)
-{
- HMODULE themeDLL = LoadLibrary(L"uxtheme.dll");
-
- if (!themeDLL)
- return;
-
- OpenThemeDataPtr openTheme =
- (OpenThemeDataPtr)GetProcAddress(themeDLL, "OpenThemeData");
- CloseThemeDataPtr closeTheme =
- (CloseThemeDataPtr)GetProcAddress(themeDLL, "CloseThemeData");
- GetThemePartSizePtr getThemePartSize =
- (GetThemePartSizePtr)GetProcAddress(themeDLL, "GetThemePartSize");
-
- if (!openTheme || !closeTheme || !getThemePartSize) {
- FreeLibrary(themeDLL);
- return;
- }
-
- HANDLE buttonTheme = openTheme(hwnd, L"Button");
- if (!buttonTheme) {
- FreeLibrary(themeDLL);
- return;
- }
- HDC hdc = GetDC(hwnd);
- SIZE s;
- getThemePartSize(buttonTheme, hdc, BP_CHECKBOX, 0, nullptr, TS_DRAW, &s);
- gCheckboxPadding = s.cx;
- closeTheme(buttonTheme);
- FreeLibrary(themeDLL);
-}
-
-// Gets the position of a window relative to another window's client area
-static void GetRelativeRect(HWND hwnd, HWND hwndParent, RECT* r)
-{
- GetWindowRect(hwnd, r);
- MapWindowPoints(nullptr, hwndParent, (POINT*)r, 2);
-}
-
-static void SetDlgItemVisible(HWND hwndDlg, UINT item, bool visible)
-{
- HWND hwnd = GetDlgItem(hwndDlg, item);
-
- ShowWindow(hwnd, visible ? SW_SHOW : SW_HIDE);
-}
-
-static void SetDlgItemDisabled(HWND hwndDlg, UINT item, bool disabled)
-{
- HWND hwnd = GetDlgItem(hwndDlg, item);
- LONG style = GetWindowLong(hwnd, GWL_STYLE);
- if (!disabled)
- style |= WS_DISABLED;
- else
- style &= ~WS_DISABLED;
-
- SetWindowLong(hwnd, GWL_STYLE, style);
-}
-
-/* === Crash Reporting Dialog === */
-
-static void StretchDialog(HWND hwndDlg, int ydiff)
-{
- RECT r;
- GetWindowRect(hwndDlg, &r);
- r.bottom += ydiff;
- MoveWindow(hwndDlg, r.left, r.top,
- r.right - r.left, r.bottom - r.top, TRUE);
-}
-
-static void ReflowDialog(HWND hwndDlg, int ydiff)
-{
- // Move items attached to the bottom down/up by as much as
- // the window resize
- for (set<UINT>::const_iterator item = gAttachedBottom.begin();
- item != gAttachedBottom.end();
- item++) {
- RECT r;
- HWND hwnd = GetDlgItem(hwndDlg, *item);
- GetRelativeRect(hwnd, hwndDlg, &r);
- r.top += ydiff;
- r.bottom += ydiff;
- MoveWindow(hwnd, r.left, r.top,
- r.right - r.left, r.bottom - r.top, TRUE);
- }
-}
-
-static DWORD WINAPI SendThreadProc(LPVOID param)
-{
- bool finishedOk;
- SendThreadData* td = (SendThreadData*)param;
-
- if (td->sendURL.empty()) {
- finishedOk = false;
- LogMessage("No server URL, not sending report");
- } else {
- google_breakpad::CrashReportSender sender(L"");
- finishedOk = (sender.SendCrashReport(td->sendURL,
- td->queryParameters,
- td->files,
- &td->serverResponse)
- == google_breakpad::RESULT_SUCCEEDED);
- if (finishedOk) {
- LogMessage("Crash report submitted successfully");
- }
- else {
- // get an error string and print it to the log
- //XXX: would be nice to get the HTTP status code here, filed:
- // http://code.google.com/p/google-breakpad/issues/detail?id=220
- LogMessage(FormatLastError());
- }
- }
-
- PostMessage(td->hDlg, WM_UPLOADCOMPLETE, finishedOk ? 1 : 0, 0);
-
- return 0;
-}
-
-static void EndCrashReporterDialog(HWND hwndDlg, int code)
-{
- // Save the current values to the registry
- wchar_t email[MAX_EMAIL_LENGTH];
- GetDlgItemTextW(hwndDlg, IDC_EMAILTEXT, email,
- sizeof(email) / sizeof(email[0]));
- SetStringKey(gCrashReporterKey.c_str(), EMAIL_VALUE, email);
-
- SetBoolKey(gCrashReporterKey.c_str(), INCLUDE_URL_VALUE,
- IsDlgButtonChecked(hwndDlg, IDC_INCLUDEURLCHECK) != 0);
- SetBoolKey(gCrashReporterKey.c_str(), EMAIL_ME_VALUE,
- IsDlgButtonChecked(hwndDlg, IDC_EMAILMECHECK) != 0);
- SetBoolKey(gCrashReporterKey.c_str(), SUBMIT_REPORT_VALUE,
- IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK) != 0);
-
- EndDialog(hwndDlg, code);
-}
-
-static void MaybeResizeProgressText(HWND hwndDlg)
-{
- HWND hwndProgress = GetDlgItem(hwndDlg, IDC_PROGRESSTEXT);
- HDC hdc = GetDC(hwndProgress);
- HFONT hfont = (HFONT)SendMessage(hwndProgress, WM_GETFONT, 0, 0);
- if (hfont)
- SelectObject(hdc, hfont);
- SIZE size;
- RECT rect;
- GetRelativeRect(hwndProgress, hwndDlg, &rect);
-
- wchar_t text[1024];
- GetWindowText(hwndProgress, text, 1024);
-
- if (!GetTextExtentPoint32(hdc, text, wcslen(text), &size))
- return;
-
- if (size.cx < (rect.right - rect.left))
- return;
-
- // Figure out how much we need to resize things vertically
- // This is sort of a fudge, but it should be good enough.
- int wantedHeight = size.cy *
- (int)ceil((float)size.cx / (float)(rect.right - rect.left));
- int diff = wantedHeight - (rect.bottom - rect.top);
- if (diff <= 0)
- return;
-
- MoveWindow(hwndProgress, rect.left, rect.top,
- rect.right - rect.left,
- wantedHeight,
- TRUE);
-
- gAttachedBottom.clear();
- gAttachedBottom.insert(IDC_CLOSEBUTTON);
- gAttachedBottom.insert(IDC_RESTARTBUTTON);
-
- StretchDialog(hwndDlg, diff);
-
- for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) {
- gAttachedBottom.insert(kDefaultAttachedBottom[i]);
- }
-}
-
-static void MaybeSendReport(HWND hwndDlg)
-{
- if (!IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK)) {
- EndCrashReporterDialog(hwndDlg, 0);
- return;
- }
-
- // disable all the form controls
- EnableWindow(GetDlgItem(hwndDlg, IDC_SUBMITREPORTCHECK), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_VIEWREPORTBUTTON), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COMMENTTEXT), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INCLUDEURLCHECK), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILMECHECK), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILTEXT), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CLOSEBUTTON), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_RESTARTBUTTON), false);
-
- SetDlgItemText(hwndDlg, IDC_PROGRESSTEXT, Str(ST_REPORTDURINGSUBMIT).c_str());
- MaybeResizeProgressText(hwndDlg);
- // start throbber
- // play entire AVI, and loop
- Animate_Play(GetDlgItem(hwndDlg, IDC_THROBBER), 0, -1, -1);
- SetDlgItemVisible(hwndDlg, IDC_THROBBER, true);
- gThreadHandle = nullptr;
- gSendData.hDlg = hwndDlg;
- gSendData.queryParameters = gQueryParameters;
-
- gThreadHandle = CreateThread(nullptr, 0, SendThreadProc, &gSendData, 0,
- nullptr);
-}
-
-static void RestartApplication()
-{
- wstring cmdLine;
-
- for (unsigned int i = 0; i < gRestartArgs.size(); i++) {
- cmdLine += L"\"" + UTF8ToWide(gRestartArgs[i]) + L"\" ";
- }
-
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
-
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_SHOWNORMAL;
- ZeroMemory(&pi, sizeof(pi));
-
- if (CreateProcess(nullptr, (LPWSTR)cmdLine.c_str(), nullptr, nullptr, FALSE,
- 0, nullptr, nullptr, &si, &pi)) {
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- }
-}
-
-static void ShowReportInfo(HWND hwndDlg)
-{
- wstring description;
-
- for (map<wstring,wstring>::const_iterator i = gQueryParameters.begin();
- i != gQueryParameters.end();
- i++) {
- description += i->first;
- description += L": ";
- description += i->second;
- description += L"\n";
- }
-
- description += L"\n";
- description += Str(ST_EXTRAREPORTINFO);
-
- SetDlgItemText(hwndDlg, IDC_VIEWREPORTTEXT, description.c_str());
-}
-
-static void UpdateURL(HWND hwndDlg)
-{
- if (IsDlgButtonChecked(hwndDlg, IDC_INCLUDEURLCHECK)) {
- gQueryParameters[L"URL"] = gURLParameter;
- } else {
- gQueryParameters.erase(L"URL");
- }
-}
-
-static void UpdateEmail(HWND hwndDlg)
-{
- if (IsDlgButtonChecked(hwndDlg, IDC_EMAILMECHECK)) {
- wchar_t email[MAX_EMAIL_LENGTH];
- GetDlgItemTextW(hwndDlg, IDC_EMAILTEXT, email,
- sizeof(email) / sizeof(email[0]));
- gQueryParameters[L"Email"] = email;
- if (IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK))
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILTEXT), true);
- } else {
- gQueryParameters.erase(L"Email");
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILTEXT), false);
- }
-}
-
-static void UpdateComment(HWND hwndDlg)
-{
- wchar_t comment[MAX_COMMENT_LENGTH + 1];
- GetDlgItemTextW(hwndDlg, IDC_COMMENTTEXT, comment,
- sizeof(comment) / sizeof(comment[0]));
- if (wcslen(comment) > 0)
- gQueryParameters[L"Comments"] = comment;
- else
- gQueryParameters.erase(L"Comments");
-}
-
-/*
- * Dialog procedure for the "view report" dialog.
- */
-static BOOL CALLBACK ViewReportDialogProc(HWND hwndDlg, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- switch (message) {
- case WM_INITDIALOG: {
- SetWindowText(hwndDlg, Str(ST_VIEWREPORTTITLE).c_str());
- SetDlgItemText(hwndDlg, IDOK, Str(ST_OK).c_str());
- SendDlgItemMessage(hwndDlg, IDC_VIEWREPORTTEXT,
- EM_SETTARGETDEVICE, (WPARAM)nullptr, 0);
- ShowReportInfo(hwndDlg);
- SetFocus(GetDlgItem(hwndDlg, IDOK));
- return FALSE;
- }
-
- case WM_COMMAND: {
- if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDOK)
- EndDialog(hwndDlg, 0);
- return FALSE;
- }
- }
- return FALSE;
-}
-
-// Return the number of bytes this string will take encoded
-// in UTF-8
-static inline int BytesInUTF8(wchar_t* str)
-{
- // Just count size of buffer for UTF-8, minus one
- // (we don't need to count the null terminator)
- return WideCharToMultiByte(CP_UTF8, 0, str, -1,
- nullptr, 0, nullptr, nullptr) - 1;
-}
-
-// Calculate the length of the text in this edit control (in bytes,
-// in the UTF-8 encoding) after replacing the current selection
-// with |insert|.
-static int NewTextLength(HWND hwndEdit, wchar_t* insert)
-{
- wchar_t current[MAX_COMMENT_LENGTH + 1];
-
- GetWindowText(hwndEdit, current, MAX_COMMENT_LENGTH + 1);
- DWORD selStart, selEnd;
- SendMessage(hwndEdit, EM_GETSEL, (WPARAM)&selStart, (LPARAM)&selEnd);
-
- int selectionLength = 0;
- if (selEnd - selStart > 0) {
- wchar_t selection[MAX_COMMENT_LENGTH + 1];
- google_breakpad::WindowsStringUtils::safe_wcsncpy(selection,
- MAX_COMMENT_LENGTH + 1,
- current + selStart,
- selEnd - selStart);
- selection[selEnd - selStart] = '\0';
- selectionLength = BytesInUTF8(selection);
- }
-
- // current string length + replacement text length
- // - replaced selection length
- return BytesInUTF8(current) + BytesInUTF8(insert) - selectionLength;
-}
-
-// Window procedure for subclassing edit controls
-static LRESULT CALLBACK EditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
- LPARAM lParam)
-{
- static WNDPROC super = nullptr;
-
- if (super == nullptr)
- super = (WNDPROC)GetWindowLongPtr(hwnd, GWLP_USERDATA);
-
- switch (uMsg) {
- case WM_PAINT: {
- HDC hdc;
- PAINTSTRUCT ps;
- RECT r;
- wchar_t windowText[1024];
-
- GetWindowText(hwnd, windowText, 1024);
- // if the control contains text or is focused, draw it normally
- if (GetFocus() == hwnd || windowText[0] != '\0')
- return CallWindowProc(super, hwnd, uMsg, wParam, lParam);
-
- GetClientRect(hwnd, &r);
- hdc = BeginPaint(hwnd, &ps);
- FillRect(hdc, &r, GetSysColorBrush(IsWindowEnabled(hwnd)
- ? COLOR_WINDOW : COLOR_BTNFACE));
- SetTextColor(hdc, GetSysColor(COLOR_GRAYTEXT));
- SelectObject(hdc, (HFONT)GetStockObject(DEFAULT_GUI_FONT));
- SetBkMode(hdc, TRANSPARENT);
- wchar_t* txt = (wchar_t*)GetProp(hwnd, L"PROP_GRAYTEXT");
- // Get the actual edit control rect
- CallWindowProc(super, hwnd, EM_GETRECT, 0, (LPARAM)&r);
- UINT format = DT_EDITCONTROL | DT_NOPREFIX | DT_WORDBREAK | DT_INTERNAL;
- if (gRTLlayout)
- format |= DT_RIGHT;
- if (txt)
- DrawText(hdc, txt, wcslen(txt), &r, format);
- EndPaint(hwnd, &ps);
- return 0;
- }
-
- // We handle WM_CHAR and WM_PASTE to limit the comment box to 500
- // bytes in UTF-8.
- case WM_CHAR: {
- // Leave accelerator keys and non-printing chars (except LF) alone
- if (wParam & (1<<24) || wParam & (1<<29) ||
- (wParam < ' ' && wParam != '\n'))
- break;
-
- wchar_t ch[2] = { (wchar_t)wParam, 0 };
- if (NewTextLength(hwnd, ch) > MAX_COMMENT_LENGTH)
- return 0;
-
- break;
- }
-
- case WM_PASTE: {
- if (IsClipboardFormatAvailable(CF_UNICODETEXT) &&
- OpenClipboard(hwnd)) {
- HGLOBAL hg = GetClipboardData(CF_UNICODETEXT);
- wchar_t* pastedText = (wchar_t*)GlobalLock(hg);
- int newSize = 0;
-
- if (pastedText)
- newSize = NewTextLength(hwnd, pastedText);
-
- GlobalUnlock(hg);
- CloseClipboard();
-
- if (newSize > MAX_COMMENT_LENGTH)
- return 0;
- }
- break;
- }
-
- case WM_SETFOCUS:
- case WM_KILLFOCUS: {
- RECT r;
- GetClientRect(hwnd, &r);
- InvalidateRect(hwnd, &r, TRUE);
- break;
- }
-
- case WM_DESTROY: {
- // cleanup our property
- HGLOBAL hData = RemoveProp(hwnd, L"PROP_GRAYTEXT");
- if (hData)
- GlobalFree(hData);
- }
- }
-
- return CallWindowProc(super, hwnd, uMsg, wParam, lParam);
-}
-
-// Resize a control to fit this text
-static int ResizeControl(HWND hwndButton, RECT& rect, wstring text,
- bool shiftLeft, int userDefinedPadding)
-{
- HDC hdc = GetDC(hwndButton);
- HFONT hfont = (HFONT)SendMessage(hwndButton, WM_GETFONT, 0, 0);
- if (hfont)
- SelectObject(hdc, hfont);
- SIZE size, oldSize;
- int sizeDiff = 0;
-
- wchar_t oldText[1024];
- GetWindowText(hwndButton, oldText, 1024);
-
- if (GetTextExtentPoint32(hdc, text.c_str(), text.length(), &size)
- // default text on the button
- && GetTextExtentPoint32(hdc, oldText, wcslen(oldText), &oldSize)) {
- /*
- Expand control widths to accomidate wider text strings. For most
- controls (including buttons) the text padding is defined by the
- dialog's rc file. Some controls (such as checkboxes) have padding
- that extends to the end of the dialog, in which case we ignore the
- rc padding and rely on a user defined value passed in through
- userDefinedPadding.
- */
- int textIncrease = size.cx - oldSize.cx;
- if (textIncrease < 0)
- return 0;
- int existingTextPadding;
- if (userDefinedPadding == 0)
- existingTextPadding = (rect.right - rect.left) - oldSize.cx;
- else
- existingTextPadding = userDefinedPadding;
- sizeDiff = textIncrease + existingTextPadding;
-
- if (shiftLeft) {
- // shift left by the amount the button should grow
- rect.left -= sizeDiff;
- }
- else {
- // grow right instead
- rect.right += sizeDiff;
- }
- MoveWindow(hwndButton, rect.left, rect.top,
- rect.right - rect.left,
- rect.bottom - rect.top,
- TRUE);
- }
- return sizeDiff;
-}
-
-// The window was resized horizontally, so widen some of our
-// controls to make use of the space
-static void StretchControlsToFit(HWND hwndDlg)
-{
- int controls[] = {
- IDC_DESCRIPTIONTEXT,
- IDC_SUBMITREPORTCHECK,
- IDC_COMMENTTEXT,
- IDC_INCLUDEURLCHECK,
- IDC_EMAILMECHECK,
- IDC_EMAILTEXT,
- IDC_PROGRESSTEXT
- };
-
- RECT dlgRect;
- GetClientRect(hwndDlg, &dlgRect);
-
- for (int i=0; i<sizeof(controls)/sizeof(controls[0]); i++) {
- RECT r;
- HWND hwndControl = GetDlgItem(hwndDlg, controls[i]);
- GetRelativeRect(hwndControl, hwndDlg, &r);
- // 6 pixel spacing on the right
- if (r.right + 6 != dlgRect.right) {
- r.right = dlgRect.right - 6;
- MoveWindow(hwndControl, r.left, r.top,
- r.right - r.left,
- r.bottom - r.top,
- TRUE);
- }
- }
-}
-
-static void SubmitReportChecked(HWND hwndDlg)
-{
- bool enabled = (IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK) != 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_VIEWREPORTBUTTON), enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COMMENTTEXT), enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_INCLUDEURLCHECK), enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILMECHECK), enabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EMAILTEXT),
- enabled && (IsDlgButtonChecked(hwndDlg, IDC_EMAILMECHECK)
- != 0));
- SetDlgItemVisible(hwndDlg, IDC_PROGRESSTEXT, enabled);
-}
-
-static INT_PTR DialogBoxParamMaybeRTL(UINT idd, HWND hwndParent,
- DLGPROC dlgProc, LPARAM param)
-{
- INT_PTR rv = 0;
- if (gRTLlayout) {
- // We need to toggle the WS_EX_LAYOUTRTL style flag on the dialog
- // template.
- HRSRC hDialogRC = FindResource(nullptr, MAKEINTRESOURCE(idd),
- RT_DIALOG);
- HGLOBAL hDlgTemplate = LoadResource(nullptr, hDialogRC);
- DLGTEMPLATEEX* pDlgTemplate = (DLGTEMPLATEEX*)LockResource(hDlgTemplate);
- unsigned long sizeDlg = SizeofResource(nullptr, hDialogRC);
- HGLOBAL hMyDlgTemplate = GlobalAlloc(GPTR, sizeDlg);
- DLGTEMPLATEEX* pMyDlgTemplate =
- (DLGTEMPLATEEX*)GlobalLock(hMyDlgTemplate);
- memcpy(pMyDlgTemplate, pDlgTemplate, sizeDlg);
-
- pMyDlgTemplate->exStyle |= WS_EX_LAYOUTRTL;
-
- rv = DialogBoxIndirectParam(nullptr, (LPCDLGTEMPLATE)pMyDlgTemplate,
- hwndParent, dlgProc, param);
- GlobalUnlock(hMyDlgTemplate);
- GlobalFree(hMyDlgTemplate);
- }
- else {
- rv = DialogBoxParam(nullptr, MAKEINTRESOURCE(idd), hwndParent,
- dlgProc, param);
- }
-
- return rv;
-}
-
-
-static BOOL CALLBACK CrashReporterDialogProc(HWND hwndDlg, UINT message,
- WPARAM wParam, LPARAM lParam)
-{
- static int sHeight = 0;
-
- bool success;
- bool enabled;
-
- switch (message) {
- case WM_INITDIALOG: {
- GetThemeSizes(hwndDlg);
- RECT r;
- GetClientRect(hwndDlg, &r);
- sHeight = r.bottom - r.top;
-
- SetWindowText(hwndDlg, Str(ST_CRASHREPORTERTITLE).c_str());
- HICON hIcon = LoadIcon(GetModuleHandle(nullptr),
- MAKEINTRESOURCE(IDI_MAINICON));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
-
- // resize the "View Report" button based on the string length
- RECT rect;
- HWND hwnd = GetDlgItem(hwndDlg, IDC_VIEWREPORTBUTTON);
- GetRelativeRect(hwnd, hwndDlg, &rect);
- ResizeControl(hwnd, rect, Str(ST_VIEWREPORT), false, 0);
- SetDlgItemText(hwndDlg, IDC_VIEWREPORTBUTTON, Str(ST_VIEWREPORT).c_str());
-
- hwnd = GetDlgItem(hwndDlg, IDC_SUBMITREPORTCHECK);
- GetRelativeRect(hwnd, hwndDlg, &rect);
- long maxdiff = ResizeControl(hwnd, rect, Str(ST_CHECKSUBMIT), false,
- gCheckboxPadding);
- SetDlgItemText(hwndDlg, IDC_SUBMITREPORTCHECK,
- Str(ST_CHECKSUBMIT).c_str());
-
- if (!CheckBoolKey(gCrashReporterKey.c_str(),
- SUBMIT_REPORT_VALUE, &enabled))
- enabled = ShouldEnableSending();
-
- CheckDlgButton(hwndDlg, IDC_SUBMITREPORTCHECK, enabled ? BST_CHECKED
- : BST_UNCHECKED);
- SubmitReportChecked(hwndDlg);
-
- HWND hwndComment = GetDlgItem(hwndDlg, IDC_COMMENTTEXT);
- WNDPROC OldWndProc = (WNDPROC)SetWindowLongPtr(hwndComment,
- GWLP_WNDPROC,
- (LONG_PTR)EditSubclassProc);
-
- // Subclass comment edit control to get placeholder text
- SetWindowLongPtr(hwndComment, GWLP_USERDATA, (LONG_PTR)OldWndProc);
- wstring commentGrayText = Str(ST_COMMENTGRAYTEXT);
- wchar_t* hMem = (wchar_t*)GlobalAlloc(GPTR, (commentGrayText.length() + 1)*sizeof(wchar_t));
- wcscpy(hMem, commentGrayText.c_str());
- SetProp(hwndComment, L"PROP_GRAYTEXT", hMem);
-
- hwnd = GetDlgItem(hwndDlg, IDC_INCLUDEURLCHECK);
- GetRelativeRect(hwnd, hwndDlg, &rect);
- long diff = ResizeControl(hwnd, rect, Str(ST_CHECKURL), false,
- gCheckboxPadding);
- maxdiff = std::max(diff, maxdiff);
- SetDlgItemText(hwndDlg, IDC_INCLUDEURLCHECK, Str(ST_CHECKURL).c_str());
-
- // want this on by default
- if (CheckBoolKey(gCrashReporterKey.c_str(), INCLUDE_URL_VALUE, &enabled) &&
- !enabled) {
- CheckDlgButton(hwndDlg, IDC_INCLUDEURLCHECK, BST_UNCHECKED);
- } else {
- CheckDlgButton(hwndDlg, IDC_INCLUDEURLCHECK, BST_CHECKED);
- }
-
- hwnd = GetDlgItem(hwndDlg, IDC_EMAILMECHECK);
- GetRelativeRect(hwnd, hwndDlg, &rect);
- diff = ResizeControl(hwnd, rect, Str(ST_CHECKEMAIL), false,
- gCheckboxPadding);
- maxdiff = std::max(diff, maxdiff);
- SetDlgItemText(hwndDlg, IDC_EMAILMECHECK, Str(ST_CHECKEMAIL).c_str());
-
- if (CheckBoolKey(gCrashReporterKey.c_str(), EMAIL_ME_VALUE, &enabled) &&
- enabled) {
- CheckDlgButton(hwndDlg, IDC_EMAILMECHECK, BST_CHECKED);
- } else {
- CheckDlgButton(hwndDlg, IDC_EMAILMECHECK, BST_UNCHECKED);
- }
-
- wstring email;
- if (GetStringKey(gCrashReporterKey.c_str(), EMAIL_VALUE, email)) {
- SetDlgItemText(hwndDlg, IDC_EMAILTEXT, email.c_str());
- }
-
- // Subclass email edit control to get placeholder text
- HWND hwndEmail = GetDlgItem(hwndDlg, IDC_EMAILTEXT);
- OldWndProc = (WNDPROC)SetWindowLongPtr(hwndEmail,
- GWLP_WNDPROC,
- (LONG_PTR)EditSubclassProc);
- SetWindowLongPtr(hwndEmail, GWLP_USERDATA, (LONG_PTR)OldWndProc);
- wstring emailGrayText = Str(ST_EMAILGRAYTEXT);
- hMem = (wchar_t*)GlobalAlloc(GPTR, (emailGrayText.length() + 1)*sizeof(wchar_t));
- wcscpy(hMem, emailGrayText.c_str());
- SetProp(hwndEmail, L"PROP_GRAYTEXT", hMem);
-
- SetDlgItemText(hwndDlg, IDC_PROGRESSTEXT, Str(ST_REPORTPRESUBMIT).c_str());
-
- RECT closeRect;
- HWND hwndClose = GetDlgItem(hwndDlg, IDC_CLOSEBUTTON);
- GetRelativeRect(hwndClose, hwndDlg, &closeRect);
-
- RECT restartRect;
- HWND hwndRestart = GetDlgItem(hwndDlg, IDC_RESTARTBUTTON);
- GetRelativeRect(hwndRestart, hwndDlg, &restartRect);
-
- // set the close button text and shift the buttons around
- // since the size may need to change
- int sizeDiff = ResizeControl(hwndClose, closeRect, Str(ST_QUIT),
- true, 0);
- restartRect.left -= sizeDiff;
- restartRect.right -= sizeDiff;
- SetDlgItemText(hwndDlg, IDC_CLOSEBUTTON, Str(ST_QUIT).c_str());
-
- if (gRestartArgs.size() > 0) {
- // Resize restart button to fit text
- ResizeControl(hwndRestart, restartRect, Str(ST_RESTART), true, 0);
- SetDlgItemText(hwndDlg, IDC_RESTARTBUTTON, Str(ST_RESTART).c_str());
- } else {
- // No restart arguments, so just hide the restart button
- SetDlgItemVisible(hwndDlg, IDC_RESTARTBUTTON, false);
- }
- // See if we need to widen the window
- // Leave 6 pixels on either side + 6 pixels between the buttons
- int neededSize = closeRect.right - closeRect.left +
- restartRect.right - restartRect.left + 6 * 3;
- GetClientRect(hwndDlg, &r);
- // We may already have resized one of the checkboxes above
- maxdiff = std::max(maxdiff, neededSize - (r.right - r.left));
-
- if (maxdiff > 0) {
- // widen window
- GetWindowRect(hwndDlg, &r);
- r.right += maxdiff;
- MoveWindow(hwndDlg, r.left, r.top,
- r.right - r.left, r.bottom - r.top, TRUE);
- // shift both buttons right
- if (restartRect.left + maxdiff < 6)
- maxdiff += 6;
- closeRect.left += maxdiff;
- closeRect.right += maxdiff;
- restartRect.left += maxdiff;
- restartRect.right += maxdiff;
- MoveWindow(hwndClose, closeRect.left, closeRect.top,
- closeRect.right - closeRect.left,
- closeRect.bottom - closeRect.top,
- TRUE);
- StretchControlsToFit(hwndDlg);
- }
- // need to move the restart button regardless
- MoveWindow(hwndRestart, restartRect.left, restartRect.top,
- restartRect.right - restartRect.left,
- restartRect.bottom - restartRect.top,
- TRUE);
-
- // Resize the description text last, in case the window was resized
- // before this.
- SendDlgItemMessage(hwndDlg, IDC_DESCRIPTIONTEXT,
- EM_SETEVENTMASK, (WPARAM)nullptr,
- ENM_REQUESTRESIZE);
-
- wstring description = Str(ST_CRASHREPORTERHEADER);
- description += L"\n\n";
- description += Str(ST_CRASHREPORTERDESCRIPTION);
- SetDlgItemText(hwndDlg, IDC_DESCRIPTIONTEXT, description.c_str());
-
-
- // Make the title bold.
- CHARFORMAT fmt = { 0, };
- fmt.cbSize = sizeof(fmt);
- fmt.dwMask = CFM_BOLD;
- fmt.dwEffects = CFE_BOLD;
- SendDlgItemMessage(hwndDlg, IDC_DESCRIPTIONTEXT, EM_SETSEL,
- 0, Str(ST_CRASHREPORTERHEADER).length());
- SendDlgItemMessage(hwndDlg, IDC_DESCRIPTIONTEXT, EM_SETCHARFORMAT,
- SCF_SELECTION, (LPARAM)&fmt);
- SendDlgItemMessage(hwndDlg, IDC_DESCRIPTIONTEXT, EM_SETSEL, 0, 0);
- // Force redraw.
- SendDlgItemMessage(hwndDlg, IDC_DESCRIPTIONTEXT,
- EM_SETTARGETDEVICE, (WPARAM)nullptr, 0);
- // Force resize.
- SendDlgItemMessage(hwndDlg, IDC_DESCRIPTIONTEXT,
- EM_REQUESTRESIZE, 0, 0);
-
- // if no URL was given, hide the URL checkbox
- if (gQueryParameters.find(L"URL") == gQueryParameters.end()) {
- RECT urlCheckRect, emailCheckRect;
- GetWindowRect(GetDlgItem(hwndDlg, IDC_INCLUDEURLCHECK), &urlCheckRect);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_EMAILMECHECK), &emailCheckRect);
-
- SetDlgItemVisible(hwndDlg, IDC_INCLUDEURLCHECK, false);
-
- gAttachedBottom.erase(IDC_VIEWREPORTBUTTON);
- gAttachedBottom.erase(IDC_SUBMITREPORTCHECK);
- gAttachedBottom.erase(IDC_COMMENTTEXT);
-
- StretchDialog(hwndDlg, urlCheckRect.top - emailCheckRect.top);
-
- gAttachedBottom.insert(IDC_VIEWREPORTBUTTON);
- gAttachedBottom.insert(IDC_SUBMITREPORTCHECK);
- gAttachedBottom.insert(IDC_COMMENTTEXT);
- }
-
- MaybeResizeProgressText(hwndDlg);
-
- // Open the AVI resource for the throbber
- Animate_Open(GetDlgItem(hwndDlg, IDC_THROBBER),
- MAKEINTRESOURCE(IDR_THROBBER));
-
- UpdateURL(hwndDlg);
- UpdateEmail(hwndDlg);
-
- SetFocus(GetDlgItem(hwndDlg, IDC_SUBMITREPORTCHECK));
- return FALSE;
- }
- case WM_SIZE: {
- ReflowDialog(hwndDlg, HIWORD(lParam) - sHeight);
- sHeight = HIWORD(lParam);
- InvalidateRect(hwndDlg, nullptr, TRUE);
- return FALSE;
- }
- case WM_NOTIFY: {
- NMHDR* notification = reinterpret_cast<NMHDR*>(lParam);
- if (notification->code == EN_REQUESTRESIZE) {
- // Resizing the rich edit control to fit the description text.
- REQRESIZE* reqresize = reinterpret_cast<REQRESIZE*>(lParam);
- RECT newSize = reqresize->rc;
- RECT oldSize;
- GetRelativeRect(notification->hwndFrom, hwndDlg, &oldSize);
-
- // resize the text box as requested
- MoveWindow(notification->hwndFrom, newSize.left, newSize.top,
- newSize.right - newSize.left, newSize.bottom - newSize.top,
- TRUE);
-
- // Resize the dialog to fit (the WM_SIZE handler will move the controls)
- StretchDialog(hwndDlg, newSize.bottom - oldSize.bottom);
- }
- return FALSE;
- }
- case WM_COMMAND: {
- if (HIWORD(wParam) == BN_CLICKED) {
- switch(LOWORD(wParam)) {
- case IDC_VIEWREPORTBUTTON:
- DialogBoxParamMaybeRTL(IDD_VIEWREPORTDIALOG, hwndDlg,
- (DLGPROC)ViewReportDialogProc, 0);
- break;
- case IDC_SUBMITREPORTCHECK:
- SubmitReportChecked(hwndDlg);
- break;
- case IDC_INCLUDEURLCHECK:
- UpdateURL(hwndDlg);
- break;
- case IDC_EMAILMECHECK:
- UpdateEmail(hwndDlg);
- break;
- case IDC_CLOSEBUTTON:
- MaybeSendReport(hwndDlg);
- break;
- case IDC_RESTARTBUTTON:
- RestartApplication();
- MaybeSendReport(hwndDlg);
- break;
- }
- } else if (HIWORD(wParam) == EN_CHANGE) {
- switch(LOWORD(wParam)) {
- case IDC_EMAILTEXT:
- UpdateEmail(hwndDlg);
- break;
- case IDC_COMMENTTEXT:
- UpdateComment(hwndDlg);
- }
- }
-
- return FALSE;
- }
- case WM_UPLOADCOMPLETE: {
- WaitForSingleObject(gThreadHandle, INFINITE);
- success = (wParam == 1);
- SendCompleted(success, WideToUTF8(gSendData.serverResponse));
- // hide throbber
- Animate_Stop(GetDlgItem(hwndDlg, IDC_THROBBER));
- SetDlgItemVisible(hwndDlg, IDC_THROBBER, false);
-
- SetDlgItemText(hwndDlg, IDC_PROGRESSTEXT,
- success ?
- Str(ST_REPORTSUBMITSUCCESS).c_str() :
- Str(ST_SUBMITFAILED).c_str());
- MaybeResizeProgressText(hwndDlg);
- // close dialog after 5 seconds
- SetTimer(hwndDlg, 0, 5000, nullptr);
- //
- return TRUE;
- }
-
- case WM_LBUTTONDOWN: {
- HWND hwndEmail = GetDlgItem(hwndDlg, IDC_EMAILTEXT);
- POINT p = { LOWORD(lParam), HIWORD(lParam) };
- // if the email edit control is clicked, enable it,
- // check the email checkbox, and focus the email edit control
- if (ChildWindowFromPoint(hwndDlg, p) == hwndEmail &&
- IsWindowEnabled(GetDlgItem(hwndDlg, IDC_RESTARTBUTTON)) &&
- !IsWindowEnabled(hwndEmail) &&
- IsDlgButtonChecked(hwndDlg, IDC_SUBMITREPORTCHECK) != 0) {
- CheckDlgButton(hwndDlg, IDC_EMAILMECHECK, BST_CHECKED);
- UpdateEmail(hwndDlg);
- SetFocus(hwndEmail);
- }
- break;
- }
-
- case WM_TIMER: {
- // The "1" gets used down in UIShowCrashUI to indicate that we at least
- // tried to send the report.
- EndCrashReporterDialog(hwndDlg, 1);
- return FALSE;
- }
-
- case WM_CLOSE: {
- EndCrashReporterDialog(hwndDlg, 0);
- return FALSE;
- }
- }
- return FALSE;
-}
-
-static wstring UTF8ToWide(const string& utf8, bool *success)
-{
- wchar_t* buffer = nullptr;
- int buffer_size = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(),
- -1, nullptr, 0);
- if(buffer_size == 0) {
- if (success)
- *success = false;
- return L"";
- }
-
- buffer = new wchar_t[buffer_size];
- if(buffer == nullptr) {
- if (success)
- *success = false;
- return L"";
- }
-
- MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(),
- -1, buffer, buffer_size);
- wstring str = buffer;
- delete [] buffer;
-
- if (success)
- *success = true;
-
- return str;
-}
-
-static string WideToMBCP(const wstring& wide,
- unsigned int cp,
- bool* success = nullptr)
-{
- char* buffer = nullptr;
- int buffer_size = WideCharToMultiByte(cp, 0, wide.c_str(),
- -1, nullptr, 0, nullptr, nullptr);
- if(buffer_size == 0) {
- if (success)
- *success = false;
- return "";
- }
-
- buffer = new char[buffer_size];
- if(buffer == nullptr) {
- if (success)
- *success = false;
- return "";
- }
-
- WideCharToMultiByte(cp, 0, wide.c_str(),
- -1, buffer, buffer_size, nullptr, nullptr);
- string mb = buffer;
- delete [] buffer;
-
- if (success)
- *success = true;
-
- return mb;
-}
-
-string WideToUTF8(const wstring& wide, bool* success)
-{
- return WideToMBCP(wide, CP_UTF8, success);
-}
-
-/* === Crashreporter UI Functions === */
-
-bool UIInit()
-{
- for (int i = 0; i < sizeof(kDefaultAttachedBottom) / sizeof(UINT); i++) {
- gAttachedBottom.insert(kDefaultAttachedBottom[i]);
- }
-
- DoInitCommonControls();
-
- return true;
-}
-
-void UIShutdown()
-{
-}
-
-void UIShowDefaultUI()
-{
- MessageBox(nullptr, Str(ST_CRASHREPORTERDEFAULT).c_str(),
- L"Crash Reporter",
- MB_OK | MB_ICONSTOP);
-}
-
-static bool CanUseMainCrashReportServer()
-{
- // Any NT from 6.0 and above is fine.
- if (IsWindowsVersionOrGreater(6, 0, 0)) {
- return true;
- }
-
- // On NT 5 servers, we need Server 2003 SP2.
- if (IsWindowsServer()) {
- return IsWindowsVersionOrGreater(5, 2, 2);
- }
-
- // Otherwise we have an NT 5 client.
- // We need exactly XP SP3 (version 5.1 SP3 but not version 5.2).
- return (IsWindowsVersionOrGreater(5, 1, 3) &&
- !IsWindowsVersionOrGreater(5, 2, 0));
-}
-
-bool UIShowCrashUI(const StringTable& files,
- const StringTable& queryParameters,
- const string& sendURL,
- const vector<string>& restartArgs)
-{
- gSendData.hDlg = nullptr;
- gSendData.sendURL = UTF8ToWide(sendURL);
-
- // Older Windows don't support the crash report server's crypto.
- // This is a hack to use an alternate server.
- if (!CanUseMainCrashReportServer() &&
- gSendData.sendURL.find(SENDURL_ORIGINAL) == 0) {
- gSendData.sendURL.replace(0, ARRAYSIZE(SENDURL_ORIGINAL) - 1,
- SENDURL_XPSP2);
- }
-
- for (StringTable::const_iterator i = files.begin();
- i != files.end();
- i++) {
- gSendData.files[UTF8ToWide(i->first)] = UTF8ToWide(i->second);
- }
-
- for (StringTable::const_iterator i = queryParameters.begin();
- i != queryParameters.end();
- i++) {
- gQueryParameters[UTF8ToWide(i->first)] = UTF8ToWide(i->second);
- }
-
- if (gQueryParameters.find(L"Vendor") != gQueryParameters.end()) {
- gCrashReporterKey = L"Software\\";
- if (!gQueryParameters[L"Vendor"].empty()) {
- gCrashReporterKey += gQueryParameters[L"Vendor"] + L"\\";
- }
- gCrashReporterKey += gQueryParameters[L"ProductName"] + L"\\Crash Reporter";
- }
-
- if (gQueryParameters.find(L"URL") != gQueryParameters.end())
- gURLParameter = gQueryParameters[L"URL"];
-
- gRestartArgs = restartArgs;
-
- if (gStrings.find("isRTL") != gStrings.end() &&
- gStrings["isRTL"] == "yes")
- gRTLlayout = true;
-
- return 1 == DialogBoxParamMaybeRTL(IDD_SENDDIALOG, nullptr,
- (DLGPROC)CrashReporterDialogProc, 0);
-}
-
-void UIError_impl(const string& message)
-{
- wstring title = Str(ST_CRASHREPORTERTITLE);
- if (title.empty())
- title = L"Crash Reporter Error";
-
- MessageBox(nullptr, UTF8ToWide(message).c_str(), title.c_str(),
- MB_OK | MB_ICONSTOP);
-}
-
-bool UIGetIniPath(string& path)
-{
- wchar_t fileName[MAX_PATH];
- if (GetModuleFileName(nullptr, fileName, MAX_PATH)) {
- // get crashreporter ini
- wchar_t* s = wcsrchr(fileName, '.');
- if (s) {
- wcscpy(s, L".ini");
- path = WideToUTF8(fileName);
- return true;
- }
- }
-
- return false;
-}
-
-bool UIGetSettingsPath(const string& vendor,
- const string& product,
- string& settings_path)
-{
- wchar_t path[MAX_PATH];
- HRESULT hRes = SHGetFolderPath(nullptr,
- CSIDL_APPDATA,
- nullptr,
- 0,
- path);
- if (FAILED(hRes)) {
- // This provides a fallback for getting the path to APPDATA by querying the
- // registry when the call to SHGetFolderPath is unable to provide this path
- // (Bug 513958).
- HKEY key;
- DWORD type, size, dwRes;
- dwRes = ::RegOpenKeyExW(HKEY_CURRENT_USER,
- L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders",
- 0,
- KEY_READ,
- &key);
- if (dwRes != ERROR_SUCCESS)
- return false;
-
- dwRes = RegQueryValueExW(key,
- L"AppData",
- nullptr,
- &type,
- (LPBYTE)&path,
- &size);
- ::RegCloseKey(key);
- // The call to RegQueryValueExW must succeed, the type must be REG_SZ, the
- // buffer size must not equal 0, and the buffer size be a multiple of 2.
- if (dwRes != ERROR_SUCCESS || type != REG_SZ || size == 0 || size % 2 != 0)
- return false;
- }
-
- if (!vendor.empty()) {
- PathAppend(path, UTF8ToWide(vendor).c_str());
- }
- PathAppend(path, UTF8ToWide(product).c_str());
- PathAppend(path, L"Crash Reports");
- settings_path = WideToUTF8(path);
- return true;
-}
-
-bool UIEnsurePathExists(const string& path)
-{
- if (CreateDirectory(UTF8ToWide(path).c_str(), nullptr) == 0) {
- if (GetLastError() != ERROR_ALREADY_EXISTS)
- return false;
- }
-
- return true;
-}
-
-bool UIFileExists(const string& path)
-{
- DWORD attrs = GetFileAttributes(UTF8ToWide(path).c_str());
- return (attrs != INVALID_FILE_ATTRIBUTES);
-}
-
-bool UIMoveFile(const string& oldfile, const string& newfile)
-{
- if (oldfile == newfile)
- return true;
-
- return MoveFile(UTF8ToWide(oldfile).c_str(), UTF8ToWide(newfile).c_str())
- == TRUE;
-}
-
-bool UIDeleteFile(const string& oldfile)
-{
- return DeleteFile(UTF8ToWide(oldfile).c_str()) == TRUE;
-}
-
-ifstream* UIOpenRead(const string& filename)
-{
- // adapted from breakpad's src/common/windows/http_upload.cc
-
-#if defined(_MSC_VER)
- ifstream* file = new ifstream();
- file->open(UTF8ToWide(filename).c_str(), ios::in);
-#else // GCC
- ifstream* file = new ifstream(WideToMBCP(UTF8ToWide(filename), CP_ACP).c_str(),
- ios::in);
-#endif // _MSC_VER
-
- return file;
-}
-
-ofstream* UIOpenWrite(const string& filename,
- bool append, // append=false
- bool binary) // binary=false
-{
- // adapted from breakpad's src/common/windows/http_upload.cc
- std::ios_base::openmode mode = ios::out;
- if (append) {
- mode = mode | ios::app;
- }
- if (binary) {
- mode = mode | ios::binary;
- }
-
-#if defined(_MSC_VER)
- ofstream* file = new ofstream();
- file->open(UTF8ToWide(filename).c_str(), mode);
-#else // GCC
- ofstream* file = new ofstream(WideToMBCP(UTF8ToWide(filename), CP_ACP).c_str(),
- mode);
-#endif // _MSC_VER
-
- return file;
-}
-
-struct FileData
-{
- FILETIME timestamp;
- wstring path;
-};
-
-static bool CompareFDTime(const FileData& fd1, const FileData& fd2)
-{
- return CompareFileTime(&fd1.timestamp, &fd2.timestamp) > 0;
-}
-
-void UIPruneSavedDumps(const std::string& directory)
-{
- wstring wdirectory = UTF8ToWide(directory);
-
- WIN32_FIND_DATA fdata;
- wstring findpath = wdirectory + L"\\*.dmp";
- HANDLE dirlist = FindFirstFile(findpath.c_str(), &fdata);
- if (dirlist == INVALID_HANDLE_VALUE)
- return;
-
- vector<FileData> dumpfiles;
-
- for (BOOL ok = true; ok; ok = FindNextFile(dirlist, &fdata)) {
- FileData fd = {fdata.ftLastWriteTime, wdirectory + L"\\" + fdata.cFileName};
- dumpfiles.push_back(fd);
- }
-
- sort(dumpfiles.begin(), dumpfiles.end(), CompareFDTime);
-
- while (dumpfiles.size() > kSaveCount) {
- // get the path of the oldest file
- wstring path = (--dumpfiles.end())->path;
- DeleteFile(path.c_str());
-
- // s/.dmp/.extra/
- path.replace(path.size() - 4, 4, L".extra");
- DeleteFile(path.c_str());
-
- dumpfiles.pop_back();
- }
-}
-
-void UIRunMinidumpAnalyzer(const string& exename, const string& filename)
-{
- wstring cmdLine;
-
- cmdLine += L"\"" + UTF8ToWide(exename) + L"\" ";
- cmdLine += L"\"" + UTF8ToWide(filename) + L"\" ";
-
- STARTUPINFO si = {};
- PROCESS_INFORMATION pi = {};
-
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_SHOWNORMAL;
-
- if (CreateProcess(nullptr, (LPWSTR)cmdLine.c_str(), nullptr, nullptr, FALSE,
- 0, nullptr, nullptr, &si, &pi)) {
- WaitForSingleObject(pi.hProcess, INFINITE);
- CloseHandle(pi.hProcess);
- CloseHandle(pi.hThread);
- }
-}
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Info.plist b/toolkit/crashreporter/client/macbuild/Contents/Info.plist
deleted file mode 100644
index 299581f52d..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Info.plist
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDisplayName</key>
- <string>crashreporter</string>
- <key>CFBundleExecutable</key>
- <string>crashreporter</string>
- <key>CFBundleIconFile</key>
- <string>crashreporter.icns</string>
- <key>CFBundleIdentifier</key>
- <string>org.mozilla.crashreporter</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>crashreporter</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>LSHasLocalizedDisplayName</key>
- <true/>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/client/macbuild/Contents/PkgInfo b/toolkit/crashreporter/client/macbuild/Contents/PkgInfo
deleted file mode 100644
index cae6d0a58f..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/PkgInfo
+++ /dev/null
@@ -1,2 +0,0 @@
-APPL????
-
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
deleted file mode 100644
index 6fe086e353..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in
+++ /dev/null
@@ -1,8 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Localized versions of Info.plist keys */
-
-CFBundleName = "Crash Reporter";
-CFBundleDisplayName = "Crash Reporter";
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
deleted file mode 100644
index e31ff0bfb2..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/classes.nib
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBClasses</key>
- <array>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>closeClicked</key>
- <string>id</string>
- <key>emailMeClicked</key>
- <string>id</string>
- <key>includeURLClicked</key>
- <string>id</string>
- <key>restartClicked</key>
- <string>id</string>
- <key>submitReportClicked</key>
- <string>id</string>
- <key>viewReportClicked</key>
- <string>id</string>
- <key>viewReportOkClicked</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>CrashReporterUI</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>OUTLETS</key>
- <dict>
- <key>mCloseButton</key>
- <string>NSButton</string>
- <key>mCommentScrollView</key>
- <string>NSScrollView</string>
- <key>mCommentText</key>
- <string>TextViewWithPlaceHolder</string>
- <key>mDescriptionLabel</key>
- <string>NSTextField</string>
- <key>mEmailMeButton</key>
- <string>NSButton</string>
- <key>mEmailText</key>
- <string>NSTextField</string>
- <key>mErrorCloseButton</key>
- <string>NSButton</string>
- <key>mErrorHeaderLabel</key>
- <string>NSTextField</string>
- <key>mErrorLabel</key>
- <string>NSTextField</string>
- <key>mErrorView</key>
- <string>NSView</string>
- <key>mHeaderLabel</key>
- <string>NSTextField</string>
- <key>mIncludeURLButton</key>
- <string>NSButton</string>
- <key>mProgressIndicator</key>
- <string>NSProgressIndicator</string>
- <key>mProgressText</key>
- <string>NSTextField</string>
- <key>mRestartButton</key>
- <string>NSButton</string>
- <key>mSubmitReportButton</key>
- <string>NSButton</string>
- <key>mViewReportButton</key>
- <string>NSButton</string>
- <key>mViewReportOkButton</key>
- <string>NSButton</string>
- <key>mViewReportTextView</key>
- <string>NSTextView</string>
- <key>mViewReportWindow</key>
- <string>NSWindow</string>
- <key>mWindow</key>
- <string>NSWindow</string>
- </dict>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>insertTab</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>TextViewWithPlaceHolder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSTextView</string>
- </dict>
- <dict>
- <key>CLASS</key>
- <string>FirstResponder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib
deleted file mode 100644
index 517349ffce..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/info.nib
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBFramework Version</key>
- <string>629</string>
- <key>IBOldestOS</key>
- <integer>5</integer>
- <key>IBOpenObjects</key>
- <array>
- <integer>2</integer>
- </array>
- <key>IBSystem Version</key>
- <string>9C7010</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
deleted file mode 100644
index bfdcccb74c..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenu.nib/keyedobjects.nib
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/classes.nib b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/classes.nib
deleted file mode 100644
index e31ff0bfb2..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/classes.nib
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBClasses</key>
- <array>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>closeClicked</key>
- <string>id</string>
- <key>emailMeClicked</key>
- <string>id</string>
- <key>includeURLClicked</key>
- <string>id</string>
- <key>restartClicked</key>
- <string>id</string>
- <key>submitReportClicked</key>
- <string>id</string>
- <key>viewReportClicked</key>
- <string>id</string>
- <key>viewReportOkClicked</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>CrashReporterUI</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>OUTLETS</key>
- <dict>
- <key>mCloseButton</key>
- <string>NSButton</string>
- <key>mCommentScrollView</key>
- <string>NSScrollView</string>
- <key>mCommentText</key>
- <string>TextViewWithPlaceHolder</string>
- <key>mDescriptionLabel</key>
- <string>NSTextField</string>
- <key>mEmailMeButton</key>
- <string>NSButton</string>
- <key>mEmailText</key>
- <string>NSTextField</string>
- <key>mErrorCloseButton</key>
- <string>NSButton</string>
- <key>mErrorHeaderLabel</key>
- <string>NSTextField</string>
- <key>mErrorLabel</key>
- <string>NSTextField</string>
- <key>mErrorView</key>
- <string>NSView</string>
- <key>mHeaderLabel</key>
- <string>NSTextField</string>
- <key>mIncludeURLButton</key>
- <string>NSButton</string>
- <key>mProgressIndicator</key>
- <string>NSProgressIndicator</string>
- <key>mProgressText</key>
- <string>NSTextField</string>
- <key>mRestartButton</key>
- <string>NSButton</string>
- <key>mSubmitReportButton</key>
- <string>NSButton</string>
- <key>mViewReportButton</key>
- <string>NSButton</string>
- <key>mViewReportOkButton</key>
- <string>NSButton</string>
- <key>mViewReportTextView</key>
- <string>NSTextView</string>
- <key>mViewReportWindow</key>
- <string>NSWindow</string>
- <key>mWindow</key>
- <string>NSWindow</string>
- </dict>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- <dict>
- <key>ACTIONS</key>
- <dict>
- <key>insertTab</key>
- <string>id</string>
- </dict>
- <key>CLASS</key>
- <string>TextViewWithPlaceHolder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSTextView</string>
- </dict>
- <dict>
- <key>CLASS</key>
- <string>FirstResponder</string>
- <key>LANGUAGE</key>
- <string>ObjC</string>
- <key>SUPERCLASS</key>
- <string>NSObject</string>
- </dict>
- </array>
- <key>IBVersion</key>
- <string>1</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/info.nib b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/info.nib
deleted file mode 100644
index 4a2251aaf5..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/info.nib
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>IBFramework Version</key>
- <string>629</string>
- <key>IBOldestOS</key>
- <integer>5</integer>
- <key>IBOpenObjects</key>
- <array>
- <integer>2</integer>
- </array>
- <key>IBSystem Version</key>
- <string>9D34</string>
- <key>targetFramework</key>
- <string>IBCocoaFramework</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/keyedobjects.nib b/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/keyedobjects.nib
deleted file mode 100644
index 6c93849b94..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/English.lproj/MainMenuRTL.nib/keyedobjects.nib
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/client/macbuild/Contents/Resources/crashreporter.icns b/toolkit/crashreporter/client/macbuild/Contents/Resources/crashreporter.icns
deleted file mode 100644
index 341cd05a4d..0000000000
--- a/toolkit/crashreporter/client/macbuild/Contents/Resources/crashreporter.icns
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/client/moz.build b/toolkit/crashreporter/client/moz.build
deleted file mode 100644
index 456c794af3..0000000000
--- a/toolkit/crashreporter/client/moz.build
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if CONFIG['OS_TARGET'] != 'Android':
- Program('crashreporter')
-
- UNIFIED_SOURCES += [
- 'crashreporter.cpp',
- ]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- UNIFIED_SOURCES += [
- 'crashreporter_win.cpp',
- ]
- DEFINES['UNICODE'] = True
- DEFINES['_UNICODE'] = True
- USE_LIBS += [
- 'google_breakpad_libxul_s',
- ]
- OS_LIBS += [
- 'comctl32',
- 'shell32',
- 'wininet',
- 'shlwapi',
- ]
-elif CONFIG['OS_ARCH'] == 'Darwin':
- UNIFIED_SOURCES += [
- 'crashreporter_osx.mm',
- 'crashreporter_unix_common.cpp',
- ]
- LOCAL_INCLUDES += [
- '../google-breakpad/src/common/mac',
- ]
- OS_LIBS += ['-framework Cocoa']
- USE_LIBS += [
- 'breakpad_common_s',
- 'breakpad_mac_common_s',
- ]
-elif CONFIG['OS_ARCH'] == 'SunOS':
- SOURCES += [
- 'crashreporter_linux.cpp',
- 'crashreporter_unix.cpp',
- ]
- USE_LIBS += [
- 'breakpad_solaris_common_s',
- ]
-
-if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
- UNIFIED_SOURCES += [
- 'crashreporter_gtk_common.cpp',
- 'crashreporter_linux.cpp',
- 'crashreporter_unix_common.cpp'
- ]
- USE_LIBS += [
- 'breakpad_linux_common_s',
- ]
- OS_LIBS += CONFIG['TK_LIBS']
- OS_LIBS += CONFIG['MOZ_GTHREAD_LIBS']
- CXXFLAGS += CONFIG['TK_CFLAGS']
- CXXFLAGS += CONFIG['MOZ_GTHREAD_CFLAGS']
-
-if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'SunOS':
- FINAL_TARGET_FILES += [
- '/toolkit/themes/windows/global/throbber/Throbber-small.gif',
- ]
-
-DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
-
-RCINCLUDE = 'crashreporter.rc'
-
-# Don't use the STL wrappers in the crashreporter clients; they don't
-# link with -lmozalloc, and it really doesn't matter here anyway.
-DISABLE_STL_WRAPPING = True
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/client/resource.h b/toolkit/crashreporter/client/resource.h
deleted file mode 100644
index d736b03674..0000000000
--- a/toolkit/crashreporter/client/resource.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by crashreporter.rc
-//
-#define IDD_SENDDIALOG 102
-#define IDR_THROBBER 103
-#define IDD_VIEWREPORTDIALOG 104
-#define IDI_MAINICON 105
-#define IDC_PROGRESS 1003
-#define IDC_DESCRIPTIONTEXT 1004
-#define IDC_CLOSEBUTTON 1005
-#define IDC_VIEWREPORTBUTTON 1006
-#define IDC_SUBMITREPORTCHECK 1007
-#define IDC_EMAILMECHECK 1008
-#define IDC_EMAILTEXT 1009
-#define IDC_INCLUDEURLCHECK 1010
-#define IDC_COMMENTTEXT 1011
-#define IDC_RESTARTBUTTON 1012
-#define IDC_DESCRIPTIONLABEL 1013
-#define IDC_PROGRESSTEXT 1014
-#define IDC_THROBBER 1015
-#define IDC_VIEWREPORTTEXT 1016
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 106
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1017
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/toolkit/crashreporter/content/crashes.js b/toolkit/crashreporter/content/crashes.js
deleted file mode 100644
index f1d3f39d9b..0000000000
--- a/toolkit/crashreporter/content/crashes.js
+++ /dev/null
@@ -1,179 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var { classes: Cc, utils: Cu, interfaces: Ci } = Components;
-
-var reportURL;
-
-Cu.import("resource://gre/modules/CrashReports.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "CrashSubmit",
- "resource://gre/modules/CrashSubmit.jsm");
-
-const buildID = Services.appinfo.appBuildID;
-
-function submitPendingReport(event) {
- let link = event.target;
- let id = link.firstChild.textContent;
- link.className = "submitting";
- CrashSubmit.submit(id, { noThrottle: true }).then(
- (remoteCrashID) => {
- link.className = "";
- // Reset the link to point at our new crash report. This way, if the
- // user clicks "Back", the link will be correct.
- link.firstChild.textContent = remoteCrashID;
- link.setAttribute("id", remoteCrashID);
- link.removeEventListener("click", submitPendingReport, true);
-
- if (reportURL) {
- link.setAttribute("href", reportURL + remoteCrashID);
- // redirect the user to their brand new crash report
- window.location.href = reportURL + remoteCrashID;
- }
- },
- () => {
- // XXX: do something more useful here
- link.className = "";
-
- // Dispatch an event, useful for testing
- let event = document.createEvent("Events");
- event.initEvent("CrashSubmitFailed", true, false);
- document.dispatchEvent(event);
- });
- event.preventDefault();
- return false;
-}
-
-function populateReportList() {
-
- Services.telemetry.getHistogramById("ABOUTCRASHES_OPENED_COUNT").add(1);
-
- var prefService = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
- try {
- reportURL = prefService.getCharPref("breakpad.reportURL");
- // Ignore any non http/https urls
- if (!/^https?:/i.test(reportURL))
- reportURL = null;
- }
- catch (e) { }
- if (!reportURL) {
- document.getElementById("clear-reports").style.display = "none";
- document.getElementById("reportList").style.display = "none";
- document.getElementById("noConfig").style.display = "block";
- return;
- }
- let reports = CrashReports.getReports();
-
- if (reports.length == 0) {
- document.getElementById("clear-reports").style.display = "none";
- document.getElementById("reportList").style.display = "none";
- document.getElementById("noReports").style.display = "block";
- return;
- }
-
- const locale = Cc["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Ci.nsIXULChromeRegistry)
- .getSelectedLocale("global", true);
- var dateFormatter = new Intl.DateTimeFormat(locale, { year: '2-digit',
- month: 'numeric',
- day: 'numeric' });
- var timeFormatter = new Intl.DateTimeFormat(locale, { hour: 'numeric',
- minute: 'numeric' });
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var reportURI = ios.newURI(reportURL, null, null);
- // resolving this URI relative to /report/index
- var aboutThrottling = ios.newURI("../../about/throttling", null, reportURI);
-
- for (var i = 0; i < reports.length; i++) {
- var row = document.createElement("tr");
- var cell = document.createElement("td");
- row.appendChild(cell);
- var link = document.createElement("a");
- if (reports[i].pending) {
- link.setAttribute("href", aboutThrottling.spec);
- link.addEventListener("click", submitPendingReport, true);
- }
- else {
- link.setAttribute("href", reportURL + reports[i].id);
- }
- link.setAttribute("id", reports[i].id);
- link.classList.add("crashReport");
- link.appendChild(document.createTextNode(reports[i].id));
- cell.appendChild(link);
-
- var date = new Date(reports[i].date);
- cell = document.createElement("td");
- cell.appendChild(document.createTextNode(dateFormatter.format(date)));
- row.appendChild(cell);
- cell = document.createElement("td");
- cell.appendChild(document.createTextNode(timeFormatter.format(date)));
- row.appendChild(cell);
- if (reports[i].pending) {
- document.getElementById("unsubmitted").appendChild(row);
- } else {
- document.getElementById("submitted").appendChild(row);
- }
- }
-}
-
-var clearReports = Task.async(function*() {
- let bundle = Services.strings.createBundle("chrome://global/locale/crashes.properties");
-
- if (!Services.
- prompt.confirm(window,
- bundle.GetStringFromName("deleteconfirm.title"),
- bundle.GetStringFromName("deleteconfirm.description"))) {
- return;
- }
-
- let cleanupFolder = Task.async(function*(path, filter) {
- let iterator = new OS.File.DirectoryIterator(path);
- try {
- yield iterator.forEach(Task.async(function*(aEntry) {
- if (!filter || (yield filter(aEntry))) {
- yield OS.File.remove(aEntry.path);
- }
- }));
- } catch (e) {
- if (!(e instanceof OS.File.Error) || !e.becauseNoSuchFile) {
- throw e;
- }
- } finally {
- iterator.close();
- }
- });
-
- yield cleanupFolder(CrashReports.submittedDir.path, function*(aEntry) {
- return aEntry.name.startsWith("bp-") && aEntry.name.endsWith(".txt");
- });
-
- let oneYearAgo = Date.now() - 31586000000;
- yield cleanupFolder(CrashReports.reportsDir.path, function*(aEntry) {
- if (!aEntry.name.startsWith("InstallTime") ||
- aEntry.name == "InstallTime" + buildID) {
- return false;
- }
-
- let date = aEntry.winLastWriteDate;
- if (!date) {
- let stat = yield OS.File.stat(aEntry.path);
- date = stat.lastModificationDate;
- }
-
- return (date < oneYearAgo);
- });
-
- yield cleanupFolder(CrashReports.pendingDir.path);
-
- document.getElementById("clear-reports").style.display = "none";
- document.getElementById("reportList").style.display = "none";
- document.getElementById("noReports").style.display = "block";
-});
diff --git a/toolkit/crashreporter/content/crashes.xhtml b/toolkit/crashreporter/content/crashes.xhtml
deleted file mode 100644
index 6953203569..0000000000
--- a/toolkit/crashreporter/content/crashes.xhtml
+++ /dev/null
@@ -1,123 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
- "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
-[
- <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
- <!ENTITY % crashesDTD SYSTEM "chrome://global/locale/crashes.dtd">
- %globalDTD;
- %crashesDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<style type="text/css">
-:root {
- font-family: sans-serif;
- margin: 40px auto;
- min-width: 30em;
- max-width: 60em;
-}
-table {
- clear: both;
- width: 90%;
- margin: 0 auto;
- padding-bottom: 2em;
-}
-th {
- font-size: 130%;
- text-align: left;
- white-space: nowrap;
-}
-th[chromedir="rtl"] {
- text-align: right;
-}
-/* name */
-th:first-child {
- padding-inline-end: 2em;
-}
-/* submitted */
-th:last-child {
- text-align: center;
-}
-:link, :visited {
- display: block;
- min-height: 17px;
-}
-/* date */
-td:first-child + td {
- width: 0;
- padding-inline-start: 1em;
- padding-inline-end: .5em;
- white-space: nowrap;
-}
-/* time */
-td:last-child {
- width: 0;
- padding-inline-start: .5em;
- white-space: nowrap;
-}
-
-#clear-reports {
- float: right;
-}
-#clear-reports[chromedir="rtl"] {
- float: left;
-}
-
-.submitting {
- background-image: url(chrome://global/skin/icons/loading.png);
- background-repeat: no-repeat;
- background-position: right;
- background-size: 16px;
-}
-
-@media (min-resolution: 1.1dppx) {
- .submitting {
- background-image: url(chrome://global/skin/icons/loading@2x.png);
- }
-}
-</style>
-<link rel="stylesheet" media="screen, projection" type="text/css"
- href="chrome://global/skin/in-content/common.css"/>
-<script type="application/javascript;version=1.8" src="chrome://global/content/crashes.js"/>
-
-<title>&crashReports.title;</title>
-</head><body onload="populateReportList()" dir="&locale.dir;">
-<button chromedir="&locale.dir;" id="clear-reports"
- onclick="clearReports().then(null, Cu.reportError)">&clearAllReports.label;</button>
-<div id="reportList">
- <div id="reportListUnsubmitted">
- <h1>&crashesUnsubmitted.label;</h1>
- <table>
- <thead>
- <tr>
- <th chromedir="&locale.dir;">&id.heading;</th>
- <th chromedir="&locale.dir;" colspan="2">&dateCrashed.heading;</th>
- </tr>
- </thead>
- <tbody id="unsubmitted">
- </tbody>
- </table>
- </div>
- <div id="reportListSubmitted">
- <h1>&crashesSubmitted.label;</h1>
- <table>
- <thead>
- <tr>
- <th chromedir="&locale.dir;">&id.heading;</th>
- <th chromedir="&locale.dir;" colspan="2">&dateSubmitted.heading;</th>
- </tr>
- </thead>
- <tbody id="submitted">
- </tbody>
- </table>
- </div>
-</div>
-<p id="noReports" style="display: none">&noReports.label;</p>
-<p id="noConfig" style="display: none">&noConfig.label;</p>
-</body>
-</html>
diff --git a/toolkit/crashreporter/crashreporter.mozbuild b/toolkit/crashreporter/crashreporter.mozbuild
deleted file mode 100644
index a9824517c6..0000000000
--- a/toolkit/crashreporter/crashreporter.mozbuild
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src',
-]
-
-# Suppress warnings in third-party code.
-if CONFIG['_MSC_VER']:
- CXXFLAGS += [
- '-wd4005', # macro redefinition
- ]
-elif CONFIG['GNU_CXX']:
- CXXFLAGS += [
- '-Wno-unused-local-typedefs',
- '-Wno-shadow',
- ]
- if CONFIG['CLANG_CXX']:
- CXXFLAGS += ['-Wno-implicit-fallthrough']
-
-DEFINES['NO_STABS_SUPPORT'] = True
diff --git a/toolkit/crashreporter/docs/index.rst b/toolkit/crashreporter/docs/index.rst
deleted file mode 100644
index 76ab156930..0000000000
--- a/toolkit/crashreporter/docs/index.rst
+++ /dev/null
@@ -1,195 +0,0 @@
-==============
-Crash Reporter
-==============
-
-Overview
-========
-
-The **crash reporter** is a subsystem to record and manage application
-crash data.
-
-While the subsystem is known as *crash reporter*, it helps to think of
-it more as a *process dump manager*. This is because the heart of this
-subsystem is really managing process dump files and these files are
-created not only from process crashes but also from hangs and other
-exceptional events.
-
-The crash reporter subsystem is composed of a number of pieces working
-together.
-
-Breakpad
- Breakpad is a library and set of tools to make collecting process
- information (notably dumps from crashes) easy. Breakpad is a 3rd
- party project (originaly developed by Google) that is imported into
- the tree.
-
-Dump files
- Breakpad produces files called *dump files* that hold process data
- (stacks, heap data, etc).
-
-Crash Reporter Client
- The crash reporter client is a standalone executable that is launched
- to handle dump files. This application optionally submits crashes to
- Mozilla (or the configured server).
-
-Minidump Analyzer
- The minidump analyzer is a standalone executable that is launched by the
- crash reporter client or by the browser itself to extract stack traces from
- the dump files generated during a crash. It appends the stack traces to the
- .extra file associated with the crash dump.
-
-How Main-Process Crash Handling Works
-=====================================
-
-The crash handler is hooked up very early in the Gecko process lifetime.
-It all starts in ``XREMain::XRE_mainInit()`` from ``nsAppRunner.cpp``.
-Assuming crash reporting is enabled, this startup function registers an
-exception handler for the process and tells the crash reporter subsystem
-about basic metadata such as the application name and version.
-
-The registration of the crash reporter exception handler doubles as
-initialization of the crash reporter itself. This happens in
-``CrashReporter::SetExceptionHandler()`` from ``nsExceptionHandler.cpp``.
-The crash reporter figures out what application to use for reporting
-dumped crashes and where to store these dump files on disk. The Breakpad
-exception handler (really just a mechanism for dumping process state) is
-initialized as part of this function. The Breakpad exception handler is
-a ``google_breakpad::ExceptionHandler`` instance and it's stored as
-``gExceptionHandler``.
-
-As the application runs, various other systems may write *annotations*
-or *notes* to the crash reporter to indicate state of the application,
-help with possible reasons for a current or future crash, etc. These are
-performed via ``CrashReporter::AnnotateCrashReport()`` and
-``CrashReporter::AppendAppNotesToCrashReport()`` from
-``nsExceptionHandler.h``.
-
-For well running applications, this is all that happens. However, if a
-crash or similar exceptional event occurs (such as a hang), we need to
-write a crash report.
-
-When an event worthy of writing a dump occurs, the Breakpad exception
-handler is invoked and Breakpad does its thing. When Breakpad has
-finished, it calls back into ``CrashReporter::MinidumpCallback()`` from
-``nsExceptionHandler.cpp`` to tell the crash reporter about what was
-written.
-
-``MinidumpCallback()`` performs a number of actions once a dump has been
-written. It writes a file with the time of the crash so other systems can
-easily determine the time of the last crash. It supplements the dump
-file with an *extra* file containing Mozilla-specific metadata. This data
-includes the annotations set via ``CrashReporter::AnnotateCrashReport()``
-as well as time since last crash, whether garbage collection was active at
-the time of the crash, memory statistics, etc.
-
-If the *crash reporter client* is enabled, ``MinidumpCallback()`` invokes
-it. It simply tries to create a new *crash reporter client* process (e.g.
-*crashreporter.exe*) with the path to the written minidump file as an
-argument.
-
-The *crash reporter client* performs a number of roles. There's a lot going
-on, so you may want to look at ``main()`` in ``crashreporter.cpp``. First,
-stack traces are extracted from the dump via the *minidump analyzer* tool.
-The resulting traces are appended to the .extra file of the crash. Then, the
-*crash reporter client* verifies that the dump data is sane. If it isn't
-(e.g. required metadata is missing), the dump data is ignored. If dump data
-looks sane, the dump data
-is moved into the *pending* directory for the configured data directory
-(defined via the ``MOZ_CRASHREPORTER_DATA_DIRECTORY`` environment variable
-or from the UI). Once this is done, the main crash reporter UI is displayed
-via ``UIShowCrashUI()``. The crash reporter UI is platform specific: there
-are separate versions for Windows, OS X, and various \*NIX presentation
-flavors (such as GTK). The basic gist is a dialog is displayed to the user
-and the user has the opportunity to submit this dump data to a remote
-server.
-
-If a dump is submitted via the crash reporter, the raw dump files are
-removed from the *pending* directory and a file containing the
-crash ID from the remote server for the submitted dump is created in the
-*submitted* directory.
-
-If the user chooses not to submit a dump in the crash reporter UI, the dump
-files are deleted.
-
-And that's pretty much what happens when a crash/dump is written!
-
-Plugin and Child Process Crashes
-================================
-
-Crashes in plugin and child processes are also managed by the crash
-reporting subsystem.
-
-Child process crashes are handled by the ``mozilla::dom::CrashReporterParent``
-class defined in ``dom/ipc``. When a child process crashes, the toplevel IPDL
-actor should check for it by calling TakeMinidump in its ``ActorDestroy``
-Method: see ``mozilla::plugins::PluginModuleParent::ActorDestroy`` and
-``mozilla::plugins::PluginModuleParent::ProcessFirstMinidump``. That method
-is responsible for calling
-``mozilla::dom::CrashReporterParent::GenerateCrashReportForMinidump`` with
-appropriate crash annotations specific to the crash. All child-process
-crashes are annotated with a ``ProcessType`` annotation, such as "content" or
-"plugin".
-
-Submission of child process crashes is handled by application code. This
-code prompts the user to submit crashes in context-appropriate UI and then
-submits the crashes using ``CrashSubmit.jsm``.
-
-Memory Reports
-==============
-
-When a process detects that it is running low on memory, a memory report is
-saved. If the process crashes, the memory report will be included with the crash
-report. ``nsThread::SaveMemoryReportNearOOM()`` checks to see if the process is
-low on memory every 30 seconds at most and saves a report every 3 minutes at
-most. Since a child process cannot actually save to the hard drive, it instead
-notifies its parent process, which saves the report for it. If a crash does
-occur, the memory report is moved to the *pending* directory with the other dump
-data and an annotation is added to indicate the presence of the report. This
-happens in ``nsExceptionHandler.cpp``, but occurs in different functions
-depending on what process crashed. When the main process crashes, this happens
-in ``MinidumpCallback()``. When a child process crashes, it happens in
-``OnChildProcessDumpRequested()``, with the annotation being added in
-``WriteExtraData()``.
-
-Flash Process Crashes
-=====================
-
-On Windows Vista+, the Adobe Flash plugin creates two extra processes in its
-Firefox plugin to implement OS-level sandboxing. In order to catch crashes in
-these processes, Firefox injects a crash report handler into the process using the code at ``InjectCrashReporter.cpp``. When these crashes occur, the
-ProcessType=plugin annotation is present, and an additional annotation
-FlashProcessDump has the value "Sandbox" or "Broker".
-
-Plugin Hangs
-============
-
-Plugin hangs are handled as crash reports. If a plugin doesn't respond to an
-IPC message after 60 seconds, the plugin IPC code will take minidumps of all
-of the processes involved and then kill the plugin.
-
-In this case, there will be only one .ini file with the crash report metadata,
-but there will be multiple dump files: at least one for the browser process and
-one for the plugin process, and perhaps also additional dumps for the Flash
-sandbox and broker processes. All of these files are submitted together as a
-unit. Before submission, the filenames of the files are linked:
-
-- **uuid.ini** - *annotations, includes an additional_minidumps field*
-- **uuid.dmp** - *plugin process dump file*
-- **uuid-<other>.dmp** - *other process dump file as listed in additional_minidumps*
-
-Browser Hangs
-=============
-
-There is a feature of Firefox that will crash Firefox if it stops processing
-messages after a certain period of time. This feature doesn't work well and is
-disabled by default. See ``xpcom/threads/HangMonitor.cpp``. Hang crashes
-are annotated with ``Hang=1``.
-
-about:crashes
-=============
-
-If the crash reporter subsystem is enabled, the *about:crashes*
-page will be registered with the application. This page provides
-information about previous and submitted crashes.
-
-It is also possible to submit crashes from *about:crashes*.
diff --git a/toolkit/crashreporter/google-breakpad/.gitignore b/toolkit/crashreporter/google-breakpad/.gitignore
deleted file mode 100644
index 9c6f831b2c..0000000000
--- a/toolkit/crashreporter/google-breakpad/.gitignore
+++ /dev/null
@@ -1,82 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Ignore other VCSs.
-.svn/
-
-# Ignore common compiled artifacts.
-*~
-*.dwo
-*.o
-lib*.a
-/breakpad.pc
-/breakpad-client.pc
-/src/client/linux/linux_client_unittest_shlib
-/src/client/linux/linux_dumper_unittest_helper
-/src/processor/microdump_stackwalk
-/src/processor/minidump_dump
-/src/processor/minidump_stackwalk
-/src/tools/linux/core2md/core2md
-/src/tools/linux/dump_syms/dump_syms
-/src/tools/linux/md2core/minidump-2-core
-/src/tools/linux/symupload/minidump_upload
-/src/tools/linux/symupload/sym_upload
-/src/tools/mac/dump_syms/dump_syms
-
-# Ignore autotools generated artifacts.
-.deps
-.dirstamp
-autom4te.cache/
-/config.cache
-config.h
-/config.log
-/config.status
-/Makefile
-stamp-h1
-
-# Ignore GYP generated Visual Studio artifacts.
-*.filters
-*.sdf
-*.sln
-*.suo
-*.vcproj
-*.vcxproj
-
-# Ignore GYP generated Makefiles
-src/Makefile
-*.Makefile
-*.target.mk
-
-# Ignore compiled Python files.
-*.pyc
-
-# Ignore directories gclient syncs.
-src/testing
-src/third_party/glog
-src/third_party/protobuf
-src/tools/gyp
diff --git a/toolkit/crashreporter/google-breakpad/AUTHORS b/toolkit/crashreporter/google-breakpad/AUTHORS
deleted file mode 100644
index 4858b377c7..0000000000
--- a/toolkit/crashreporter/google-breakpad/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-opensource@google.com
diff --git a/toolkit/crashreporter/google-breakpad/ChangeLog b/toolkit/crashreporter/google-breakpad/ChangeLog
deleted file mode 100644
index e69de29bb2..0000000000
--- a/toolkit/crashreporter/google-breakpad/ChangeLog
+++ /dev/null
diff --git a/toolkit/crashreporter/google-breakpad/DEPS b/toolkit/crashreporter/google-breakpad/DEPS
deleted file mode 100644
index 2de510a5ed..0000000000
--- a/toolkit/crashreporter/google-breakpad/DEPS
+++ /dev/null
@@ -1,75 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# This is used to mimic the svn:externals mechanism for gclient (both Git and
-# SVN) based checkouts of Breakpad. As such, its use is entirely optional. If
-# using a manually managed SVN checkout as opposed to a gclient managed checkout
-# you can still use the hooks mechanism for generating project files by calling
-# 'gclient runhooks' rather than 'gclient sync'.
-
-deps = {
- # Logging code.
- "src/src/third_party/glog":
- "https://github.com/google/glog.git" +
- "@v0.3.4",
-
- # Testing libraries and utilities.
- "src/src/testing":
- "https://github.com/google/googlemock.git" +
- "@release-1.7.0",
- "src/src/testing/gtest":
- "https://github.com/google/googletest.git" +
- "@release-1.7.0",
-
- # Protobuf.
- "src/src/third_party/protobuf/protobuf":
- "https://github.com/google/protobuf.git" +
- "@cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac",
-
- # GYP project generator.
- "src/src/tools/gyp":
- "https://chromium.googlesource.com/external/gyp/" +
- "@e8ab0833a42691cd2184bd4c45d779e43821d3e0",
-
- # Linux syscall support.
- "src/src/third_party/lss":
- "https://chromium.googlesource.com/linux-syscall-support/" +
- "@3f6478ac95edf86cd3da300c2c0d34a438f5dbeb",
-}
-
-hooks = [
- {
- # TODO(chrisha): Fix the GYP files so that they work without
- # --no-circular-check.
- "pattern": ".",
- "action": ["python",
- "src/src/tools/gyp/gyp_main.py",
- "--no-circular-check",
- "src/src/client/windows/breakpad_client.gyp"],
- },
-]
diff --git a/toolkit/crashreporter/google-breakpad/GIT-INFO b/toolkit/crashreporter/google-breakpad/GIT-INFO
deleted file mode 100644
index fe3520a2c6..0000000000
--- a/toolkit/crashreporter/google-breakpad/GIT-INFO
+++ /dev/null
@@ -1 +0,0 @@
-704f41ec901c419f8c321742114b415e6f5ceacc
diff --git a/toolkit/crashreporter/google-breakpad/INSTALL b/toolkit/crashreporter/google-breakpad/INSTALL
deleted file mode 100644
index 007e9396d0..0000000000
--- a/toolkit/crashreporter/google-breakpad/INSTALL
+++ /dev/null
@@ -1,370 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation,
-Inc.
-
- Copying and distribution of this file, with or without modification,
-are permitted in any medium without royalty provided the copyright
-notice and this notice are preserved. This file is offered as-is,
-without warranty of any kind.
-
-Basic Installation
-==================
-
- Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package. Some packages provide this
-`INSTALL' file but do not implement all of the features documented
-below. The lack of an optional feature in a given package is not
-necessarily a bug. More recommendations for GNU packages can be found
-in *note Makefile Conventions: (standards)Makefile Conventions.
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
- It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
- The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
-
- The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
-
- Running `configure' might take a while. While running, it prints
- some messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package, generally using the just-built uninstalled binaries.
-
- 4. Type `make install' to install the programs and any data files and
- documentation. When installing into a prefix owned by root, it is
- recommended that the package be configured and built as a regular
- user, and only the `make install' phase executed with root
- privileges.
-
- 5. Optionally, type `make installcheck' to repeat any self-tests, but
- this time using the binaries in their final installed location.
- This target does not install anything. Running this target as a
- regular user, particularly if the prior `make install' required
- root privileges, verifies that the installation completed
- correctly.
-
- 6. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
- 7. Often, you can also type `make uninstall' to remove the installed
- files again. In practice, not all packages have tested that
- uninstallation works correctly, even though it is required by the
- GNU Coding Standards.
-
- 8. Some packages, particularly those that use Automake, provide `make
- distcheck', which can by used by developers to test that all other
- targets like `make install' and `make uninstall' work correctly.
- This target is generally not run by end users.
-
-Compilers and Options
-=====================
-
- Some systems require unusual options for compilation or linking that
-the `configure' script does not know about. Run `./configure --help'
-for details on some of the pertinent environment variables.
-
- You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment. Here
-is an example:
-
- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
-
- *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
- You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you can use GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'. This
-is known as a "VPATH" build.
-
- With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory. After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
-
- On MacOS X 10.5 and later systems, you can create libraries and
-executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor. Like
-this:
-
- ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
- CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
- CPP="gcc -E" CXXCPP="g++ -E"
-
- This is not guaranteed to produce working output in all cases, you
-may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
-
-Installation Names
-==================
-
- By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc. You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX', where PREFIX must be an
-absolute file name.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them. In general, the
-default for these options is expressed in terms of `${prefix}', so that
-specifying just `--prefix' will affect all of the other directory
-specifications that were not explicitly provided.
-
- The most portable way to affect installation locations is to pass the
-correct locations to `configure'; however, many packages provide one or
-both of the following shortcuts of passing variable assignments to the
-`make install' command line to change installation locations without
-having to reconfigure or recompile.
-
- The first method involves providing an override variable for each
-affected directory. For example, `make install
-prefix=/alternate/directory' will choose an alternate location for all
-directory configuration variables that were expressed in terms of
-`${prefix}'. Any directories that were specified during `configure',
-but not in terms of `${prefix}', must each be overridden at install
-time for the entire installation to be relocated. The approach of
-makefile variable overrides for each directory variable is required by
-the GNU Coding Standards, and ideally causes no recompilation.
-However, some platforms have known limitations with the semantics of
-shared libraries that end up requiring recompilation when using this
-method, particularly noticeable in packages that use GNU Libtool.
-
- The second method involves providing the `DESTDIR' variable. For
-example, `make install DESTDIR=/alternate/directory' will prepend
-`/alternate/directory' before all installation names. The approach of
-`DESTDIR' overrides is not required by the GNU Coding Standards, and
-does not work on platforms that have drive letters. On the other hand,
-it does better at avoiding recompilation issues, and works well even
-when some directory options were not specified in terms of `${prefix}'
-at `configure' time.
-
-Optional Features
-=================
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
- Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
- Some packages offer the ability to configure how verbose the
-execution of `make' will be. For these packages, running `./configure
---enable-silent-rules' sets the default to minimal output, which can be
-overridden with `make V=1'; while running `./configure
---disable-silent-rules' sets the default to verbose, which can be
-overridden with `make V=0'.
-
-Particular systems
-==================
-
- On HP-UX, the default C compiler is not ANSI C compatible. If GNU
-CC is not installed, it is recommended to use the following options in
-order to use an ANSI C compiler:
-
- ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
-
-and if that doesn't work, install pre-built binaries of GCC for HP-UX.
-
- HP-UX `make' updates targets which have the same time stamps as
-their prerequisites, which makes it generally unusable when shipped
-generated files such as `configure' are involved. Use GNU `make'
-instead.
-
- On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `<wchar.h>' header file. The option `-nodtk' can be used as
-a workaround. If GNU CC is not installed, it is therefore recommended
-to try
-
- ./configure CC="cc"
-
-and if that doesn't work, try
-
- ./configure CC="cc -nodtk"
-
- On Solaris, don't put `/usr/ucb' early in your `PATH'. This
-directory contains several dysfunctional programs; working variants of
-these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
-in your `PATH', put it _after_ `/usr/bin'.
-
- On Haiku, software installed for all users goes in `/boot/common',
-not `/usr/local'. It is recommended to use the following options:
-
- ./configure --prefix=/boot/common
-
-Specifying the System Type
-==========================
-
- There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on. Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
-`--build=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
- CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
- OS
- KERNEL-OS
-
- See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
- If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
- If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
- If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
- Variables not defined in a site shell script can be set in the
-environment passed to `configure'. However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost. In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'. For example:
-
- ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf limitation. Until the limitation is lifted, you can use
-this workaround:
-
- CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-`configure' Invocation
-======================
-
- `configure' recognizes the following options to control how it
-operates.
-
-`--help'
-`-h'
- Print a summary of all of the options to `configure', and exit.
-
-`--help=short'
-`--help=recursive'
- Print a summary of the options unique to this package's
- `configure', and exit. The `short' variant lists options used
- only in the top level, while the `recursive' variant lists options
- also present in any nested packages.
-
-`--version'
-`-V'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--cache-file=FILE'
- Enable the cache: use and save the results of the tests in FILE,
- traditionally `config.cache'. FILE defaults to `/dev/null' to
- disable caching.
-
-`--config-cache'
-`-C'
- Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`--prefix=DIR'
- Use DIR as the installation prefix. *note Installation Names::
- for more details, including other options available for fine-tuning
- the installation locations.
-
-`--no-create'
-`-n'
- Run the configure checks, but stop before creating any output
- files.
-
-`configure' also accepts some other, not widely useful, options. Run
-`configure --help' for more details.
diff --git a/toolkit/crashreporter/google-breakpad/LICENSE b/toolkit/crashreporter/google-breakpad/LICENSE
deleted file mode 100644
index 95207bdf6f..0000000000
--- a/toolkit/crashreporter/google-breakpad/LICENSE
+++ /dev/null
@@ -1,50 +0,0 @@
-Copyright (c) 2006, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
---------------------------------------------------------------------
-
-Copyright 2001-2004 Unicode, Inc.
-
-Disclaimer
-
-This source code is provided as is by Unicode, Inc. No claims are
-made as to fitness for any particular purpose. No warranties of any
-kind are expressed or implied. The recipient agrees to determine
-applicability of information provided. If this file has been
-purchased on magnetic or optical media from Unicode, Inc., the
-sole remedy for any claim will be exchange of defective media
-within 90 days of receipt.
-
-Limitations on Rights to Redistribute This Code
-
-Unicode, Inc. hereby grants the right to freely use the information
-supplied in this file in the creation of products supporting the
-Unicode Standard, and to make copies of this file in any form
-for internal or external distribution as long as this notice
-remains attached.
diff --git a/toolkit/crashreporter/google-breakpad/Makefile.am b/toolkit/crashreporter/google-breakpad/Makefile.am
deleted file mode 100644
index 5a67dc9a95..0000000000
--- a/toolkit/crashreporter/google-breakpad/Makefile.am
+++ /dev/null
@@ -1,1510 +0,0 @@
-## Process this file with automake to produce Makefile.in
-
-# Copyright (c) 2011, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-# This allows #includes to be relative to src/
-AM_CPPFLAGS = -I$(top_srcdir)/src
-AM_CFLAGS =
-AM_CXXFLAGS =
-
-if ANDROID_HOST
-# This allows using fixed NDK headers when building for Android.
-AM_CXXFLAGS += -I$(top_srcdir)/src/common/android/include
-# This is only necessary for building the unit tests until GTest is upgraded
-# to a future version.
-AM_CXXFLAGS += -I$(top_srcdir)/src/common/android/testing/include
-endif
-
-if GCC
-# These are good warnings to be treated as errors
-AM_CXXFLAGS += \
- -Werror=missing-braces \
- -Werror=non-virtual-dtor \
- -Werror=overloaded-virtual \
- -Werror=reorder \
- -Werror=sign-compare \
- -Werror=unused-variable \
- -Werror=vla
-endif
-
-if LINUX_HOST
-# Build as PIC on Linux, for linux_client_unittest_shlib
-AM_CFLAGS += -fPIC
-AM_CXXFLAGS += -fPIC
-endif
-
-# Specify include paths for ac macros
-ACLOCAL_AMFLAGS = -I m4
-
-# License file is called LICENSE not COPYING
-AUTOMAKE_OPTIONS = foreign
-
-## Documentation
-docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
-
-dist_doc_DATA = \
- AUTHORS \
- ChangeLog \
- INSTALL \
- LICENSE \
- NEWS \
- README.md
-
-## Headers
-if LINUX_HOST
-includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler
-includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h
-
-includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common
-includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h
-
-includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer
-includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h
-
-includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation
-includeclc_HEADERS = $(top_srcdir)/src/client/linux/crash_generation/*.h
-
-includelssdir = $(includedir)/$(PACKAGE)/third_party/lss
-includelss_HEADERS = $(top_srcdir)/src/third_party/lss/*.h
-
-includecldir = $(includedir)/$(PACKAGE)/common/linux
-includecl_HEADERS = $(top_srcdir)/src/common/linux/*.h
-endif
-
-includegbcdir = $(includedir)/$(PACKAGE)/google_breakpad/common
-includegbc_HEADERS = $(top_srcdir)/src/google_breakpad/common/*.h
-
-includecdir = $(includedir)/$(PACKAGE)/common
-includec_HEADERS = $(top_srcdir)/src/common/*.h
-
-includepdir = $(includedir)/$(PACKAGE)/processor
-includep_HEADERS = $(top_srcdir)/src/processor/*.h
-
-## pkgconfig files
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA =
-
-## Common test logic
-if SYSTEM_TEST_LIBS
-TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS)
-TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS)
-TEST_DEPS =
-else
-TEST_CFLAGS = \
- -I$(top_srcdir)/src/testing/include \
- -I$(top_srcdir)/src/testing/gtest/include \
- -I$(top_srcdir)/src/testing/gtest \
- -I$(top_srcdir)/src/testing
-TEST_LIBS = src/testing/libtesting.a
-TEST_DEPS = $(TEST_LIBS)
-endif
-
-## Libraries
-check_LIBRARIES =
-noinst_LIBRARIES =
-lib_LIBRARIES =
-bin_PROGRAMS =
-check_PROGRAMS =
-EXTRA_PROGRAMS =
-CLEANFILES =
-
-check_LIBRARIES += src/testing/libtesting.a
-
-if !SYSTEM_TEST_LIBS
-src_testing_libtesting_a_SOURCES = \
- src/breakpad_googletest_includes.h \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
-src_testing_libtesting_a_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-endif
-
-if !DISABLE_PROCESSOR
-lib_LIBRARIES += src/libbreakpad.a
-pkgconfig_DATA += breakpad.pc
-noinst_LIBRARIES += src/third_party/libdisasm/libdisasm.a
-endif
-
-if LINUX_HOST
-lib_LIBRARIES += src/client/linux/libbreakpad_client.a
-pkgconfig_DATA += breakpad-client.pc
-
-src_client_linux_libbreakpad_client_a_SOURCES = \
- src/client/linux/crash_generation/crash_generation_client.cc \
- src/client/linux/crash_generation/crash_generation_server.cc \
- src/client/linux/dump_writer_common/thread_info.cc \
- src/client/linux/dump_writer_common/ucontext_reader.cc \
- src/client/linux/handler/exception_handler.cc \
- src/client/linux/handler/exception_handler.h \
- src/client/linux/handler/minidump_descriptor.cc \
- src/client/linux/handler/minidump_descriptor.h \
- src/client/linux/log/log.cc \
- src/client/linux/log/log.h \
- src/client/linux/microdump_writer/microdump_writer.cc \
- src/client/linux/microdump_writer/microdump_writer.h \
- src/client/linux/minidump_writer/linux_core_dumper.cc \
- src/client/linux/minidump_writer/linux_dumper.cc \
- src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
- src/client/linux/minidump_writer/minidump_writer.cc \
- src/client/minidump_file_writer-inl.h \
- src/client/minidump_file_writer.cc \
- src/client/minidump_file_writer.h \
- src/common/convert_UTF.c \
- src/common/convert_UTF.h \
- src/common/md5.cc \
- src/common/md5.h \
- src/common/string_conversion.cc \
- src/common/string_conversion.h \
- src/common/linux/elf_core_dump.cc \
- src/common/linux/elfutils.cc \
- src/common/linux/elfutils.h \
- src/common/linux/file_id.cc \
- src/common/linux/file_id.h \
- src/common/linux/guid_creator.cc \
- src/common/linux/guid_creator.h \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/safe_readlink.cc
-if ANDROID_HOST
-src_client_linux_libbreakpad_client_a_SOURCES += \
- src/common/android/breakpad_getcontext.S
-endif
-endif LINUX_HOST
-
-if !DISABLE_PROCESSOR
-src_libbreakpad_a_SOURCES = \
- src/google_breakpad/common/breakpad_types.h \
- src/google_breakpad/common/minidump_format.h \
- src/google_breakpad/common/minidump_size.h \
- src/google_breakpad/processor/basic_source_line_resolver.h \
- src/google_breakpad/processor/call_stack.h \
- src/google_breakpad/processor/code_module.h \
- src/google_breakpad/processor/code_modules.h \
- src/google_breakpad/processor/dump_context.h \
- src/google_breakpad/processor/dump_object.h \
- src/google_breakpad/processor/exploitability.h \
- src/google_breakpad/processor/fast_source_line_resolver.h \
- src/google_breakpad/processor/memory_region.h \
- src/google_breakpad/processor/microdump.h \
- src/google_breakpad/processor/microdump_processor.h \
- src/google_breakpad/processor/minidump.h \
- src/google_breakpad/processor/minidump_processor.h \
- src/google_breakpad/processor/process_result.h \
- src/google_breakpad/processor/process_state.h \
- src/google_breakpad/processor/proc_maps_linux.h \
- src/google_breakpad/processor/source_line_resolver_base.h \
- src/google_breakpad/processor/source_line_resolver_interface.h \
- src/google_breakpad/processor/stack_frame.h \
- src/google_breakpad/processor/stack_frame_cpu.h \
- src/google_breakpad/processor/stack_frame_symbolizer.h \
- src/google_breakpad/processor/stackwalker.h \
- src/google_breakpad/processor/symbol_supplier.h \
- src/google_breakpad/processor/system_info.h \
- src/processor/address_map-inl.h \
- src/processor/address_map.h \
- src/processor/basic_code_module.h \
- src/processor/basic_code_modules.cc \
- src/processor/basic_code_modules.h \
- src/processor/basic_source_line_resolver_types.h \
- src/processor/basic_source_line_resolver.cc \
- src/processor/call_stack.cc \
- src/processor/cfi_frame_info.cc \
- src/processor/cfi_frame_info.h \
- src/processor/contained_range_map-inl.h \
- src/processor/contained_range_map.h \
- src/processor/disassembler_x86.h \
- src/processor/disassembler_x86.cc \
- src/processor/dump_context.cc \
- src/processor/dump_object.cc \
- src/processor/exploitability.cc \
- src/processor/exploitability_linux.h \
- src/processor/exploitability_linux.cc \
- src/processor/exploitability_win.h \
- src/processor/exploitability_win.cc \
- src/processor/fast_source_line_resolver_types.h \
- src/processor/fast_source_line_resolver.cc \
- src/processor/linked_ptr.h \
- src/processor/logging.h \
- src/processor/logging.cc \
- src/processor/map_serializers-inl.h \
- src/processor/map_serializers.h \
- src/processor/microdump.cc \
- src/processor/microdump_processor.cc \
- src/processor/minidump.cc \
- src/processor/minidump_processor.cc \
- src/processor/module_comparer.cc \
- src/processor/module_comparer.h \
- src/processor/module_factory.h \
- src/processor/module_serializer.cc \
- src/processor/module_serializer.h \
- src/processor/pathname_stripper.cc \
- src/processor/pathname_stripper.h \
- src/processor/postfix_evaluator-inl.h \
- src/processor/postfix_evaluator.h \
- src/processor/process_state.cc \
- src/processor/proc_maps_linux.cc \
- src/processor/range_map-inl.h \
- src/processor/range_map.h \
- src/processor/simple_serializer-inl.h \
- src/processor/simple_serializer.h \
- src/processor/simple_symbol_supplier.cc \
- src/processor/simple_symbol_supplier.h \
- src/processor/windows_frame_info.h \
- src/processor/source_line_resolver_base_types.h \
- src/processor/source_line_resolver_base.cc \
- src/processor/stack_frame_cpu.cc \
- src/processor/stack_frame_symbolizer.cc \
- src/processor/stackwalker.cc \
- src/processor/stackwalker_amd64.cc \
- src/processor/stackwalker_amd64.h \
- src/processor/stackwalker_arm.cc \
- src/processor/stackwalker_arm.h \
- src/processor/stackwalker_arm64.cc \
- src/processor/stackwalker_arm64.h \
- src/processor/stackwalker_address_list.cc \
- src/processor/stackwalker_address_list.h \
- src/processor/stackwalker_mips.cc \
- src/processor/stackwalker_mips.h \
- src/processor/stackwalker_ppc.cc \
- src/processor/stackwalker_ppc.h \
- src/processor/stackwalker_ppc64.cc \
- src/processor/stackwalker_ppc64.h \
- src/processor/stackwalker_sparc.cc \
- src/processor/stackwalker_sparc.h \
- src/processor/stackwalker_x86.cc \
- src/processor/stackwalker_x86.h \
- src/processor/static_address_map-inl.h \
- src/processor/static_address_map.h \
- src/processor/static_contained_range_map-inl.h \
- src/processor/static_contained_range_map.h \
- src/processor/static_map_iterator-inl.h \
- src/processor/static_map_iterator.h \
- src/processor/static_map-inl.h \
- src/processor/static_map.h \
- src/processor/static_range_map-inl.h \
- src/processor/static_range_map.h \
- src/processor/symbolic_constants_win.cc \
- src/processor/symbolic_constants_win.h \
- src/processor/tokenize.cc \
- src/processor/tokenize.h
-
-src_third_party_libdisasm_libdisasm_a_SOURCES = \
- src/third_party/libdisasm/ia32_implicit.c \
- src/third_party/libdisasm/ia32_implicit.h \
- src/third_party/libdisasm/ia32_insn.c \
- src/third_party/libdisasm/ia32_insn.h \
- src/third_party/libdisasm/ia32_invariant.c \
- src/third_party/libdisasm/ia32_invariant.h \
- src/third_party/libdisasm/ia32_modrm.c \
- src/third_party/libdisasm/ia32_modrm.h \
- src/third_party/libdisasm/ia32_opcode_tables.c \
- src/third_party/libdisasm/ia32_opcode_tables.h \
- src/third_party/libdisasm/ia32_operand.c \
- src/third_party/libdisasm/ia32_operand.h \
- src/third_party/libdisasm/ia32_reg.c \
- src/third_party/libdisasm/ia32_reg.h \
- src/third_party/libdisasm/ia32_settings.c \
- src/third_party/libdisasm/ia32_settings.h \
- src/third_party/libdisasm/libdis.h \
- src/third_party/libdisasm/qword.h \
- src/third_party/libdisasm/x86_disasm.c \
- src/third_party/libdisasm/x86_format.c \
- src/third_party/libdisasm/x86_imm.c \
- src/third_party/libdisasm/x86_imm.h \
- src/third_party/libdisasm/x86_insn.c \
- src/third_party/libdisasm/x86_misc.c \
- src/third_party/libdisasm/x86_operand_list.c \
- src/third_party/libdisasm/x86_operand_list.h
-
-## Programs
-bin_PROGRAMS += \
- src/processor/microdump_stackwalk \
- src/processor/minidump_dump \
- src/processor/minidump_stackwalk
-endif !DISABLE_PROCESSOR
-
-if LINUX_HOST
-EXTRA_PROGRAMS += \
- src/client/linux/linux_dumper_unittest_helper
-CLEANFILES += \
- src/client/linux/linux_dumper_unittest_helper
-
-if !DISABLE_TOOLS
-bin_PROGRAMS += \
- src/tools/linux/core2md/core2md \
- src/tools/linux/dump_syms/dump_syms \
- src/tools/linux/md2core/minidump-2-core \
- src/tools/linux/symupload/minidump_upload \
- src/tools/linux/symupload/sym_upload
-if X86_HOST
-bin_PROGRAMS += \
- src/tools/mac/dump_syms/dump_syms_mac
-endif
-endif
-endif LINUX_HOST
-
-
-## Tests
-if !DISABLE_PROCESSOR
-check_PROGRAMS += \
- src/common/test_assembler_unittest \
- src/processor/address_map_unittest \
- src/processor/basic_source_line_resolver_unittest \
- src/processor/cfi_frame_info_unittest \
- src/processor/contained_range_map_unittest \
- src/processor/disassembler_x86_unittest \
- src/processor/exploitability_unittest \
- src/processor/fast_source_line_resolver_unittest \
- src/processor/map_serializers_unittest \
- src/processor/microdump_processor_unittest \
- src/processor/minidump_processor_unittest \
- src/processor/minidump_unittest \
- src/processor/static_address_map_unittest \
- src/processor/static_contained_range_map_unittest \
- src/processor/static_map_unittest \
- src/processor/static_range_map_unittest \
- src/processor/pathname_stripper_unittest \
- src/processor/postfix_evaluator_unittest \
- src/processor/proc_maps_linux_unittest \
- src/processor/range_map_shrink_down_unittest \
- src/processor/range_map_unittest \
- src/processor/stackwalker_amd64_unittest \
- src/processor/stackwalker_arm_unittest \
- src/processor/stackwalker_arm64_unittest \
- src/processor/stackwalker_address_list_unittest \
- src/processor/stackwalker_mips_unittest \
- src/processor/stackwalker_mips64_unittest \
- src/processor/stackwalker_x86_unittest \
- src/processor/synth_minidump_unittest
-endif
-
-if LINUX_HOST
-EXTRA_PROGRAMS += \
- src/client/linux/linux_client_unittest_shlib
-CLEANFILES += \
- src/client/linux/linux_client_unittest_shlib
-
-check_PROGRAMS += \
- src/client/linux/linux_client_unittest
-
-if !DISABLE_TOOLS
-check_PROGRAMS += \
- src/common/dumper_unittest \
- src/tools/linux/md2core/minidump_2_core_unittest
-if X86_HOST
-check_PROGRAMS += \
- src/common/mac/macho_reader_unittest
-endif
-endif
-endif LINUX_HOST
-
-if !DISABLE_PROCESSOR
-if SELFTEST
-check_PROGRAMS += \
- src/processor/stackwalker_selftest
-endif SELFTEST
-endif !DISABLE_PROCESSOR
-
-if !DISABLE_PROCESSOR
-check_SCRIPTS = \
- src/processor/microdump_stackwalk_test \
- src/processor/microdump_stackwalk_machine_readable_test \
- src/processor/minidump_dump_test \
- src/processor/minidump_stackwalk_test \
- src/processor/minidump_stackwalk_machine_readable_test
-endif
-
-TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
-
-if ANDROID_HOST
-# Since Autotools 1.2, tests are run through a special "test driver" script.
-# Unfortunately, it's not possible anymore to specify an alternative shell to
-# run them on connected devices, so use a slightly modified version of the
-# driver for Android.
-LOG_DRIVER = $(top_srcdir)/android/test-driver
-else
-# The default Autotools test driver script.
-LOG_DRIVER = $(top_srcdir)/autotools/test-driver
-endif
-
-if LINUX_HOST
-src_client_linux_linux_dumper_unittest_helper_SOURCES = \
- src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-src_client_linux_linux_dumper_unittest_helper_LDFLAGS=$(PTHREAD_CFLAGS)
-src_client_linux_linux_dumper_unittest_helper_CC=$(PTHREAD_CC)
-if ANDROID_HOST
-# On Android PTHREAD_CFLAGS is empty, and adding src/common/android/include
-# to the include path is necessary to build this program.
-src_client_linux_linux_dumper_unittest_helper_CXXFLAGS=$(AM_CXXFLAGS)
-else
-src_client_linux_linux_dumper_unittest_helper_CXXFLAGS=$(PTHREAD_CFLAGS)
-endif
-
-src_client_linux_linux_client_unittest_shlib_SOURCES = \
- $(src_testing_libtesting_a_SOURCES) \
- src/client/linux/handler/exception_handler_unittest.cc \
- src/client/linux/minidump_writer/directory_reader_unittest.cc \
- src/client/linux/minidump_writer/cpu_set_unittest.cc \
- src/client/linux/minidump_writer/line_reader_unittest.cc \
- src/client/linux/minidump_writer/linux_core_dumper.cc \
- src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \
- src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \
- src/client/linux/minidump_writer/minidump_writer_unittest.cc \
- src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \
- src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
- src/common/linux/elf_core_dump.cc \
- src/common/linux/linux_libc_support_unittest.cc \
- src/common/linux/tests/auto_testfile.h \
- src/common/linux/tests/crash_generator.cc \
- src/common/memory_unittest.cc \
- src/common/tests/auto_tempdir.h \
- src/common/tests/file_utils.cc \
- src/common/tests/file_utils.h \
- src/processor/basic_code_modules.cc \
- src/processor/dump_context.cc \
- src/processor/dump_object.cc \
- src/processor/logging.cc \
- src/processor/minidump.cc \
- src/processor/pathname_stripper.cc \
- src/processor/proc_maps_linux.cc
-if ANDROID_HOST
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/common/android/breakpad_getcontext.S
-endif
-if LINUX_HOST
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/client/linux/microdump_writer/microdump_writer_unittest.cc
-endif
-
-src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_client_linux_linux_client_unittest_shlib_LDFLAGS = \
- -shared \
- -Wl,-h,linux_client_unittest_shlib
-src_client_linux_linux_client_unittest_shlib_LDADD = \
- src/client/linux/crash_generation/crash_generation_client.o \
- src/client/linux/dump_writer_common/thread_info.o \
- src/client/linux/dump_writer_common/ucontext_reader.o \
- src/client/linux/handler/exception_handler.o \
- src/client/linux/handler/minidump_descriptor.o \
- src/client/linux/log/log.o \
- src/client/linux/microdump_writer/microdump_writer.o \
- src/client/linux/minidump_writer/linux_dumper.o \
- src/client/linux/minidump_writer/linux_ptrace_dumper.o \
- src/client/linux/minidump_writer/minidump_writer.o \
- src/client/minidump_file_writer.o \
- src/common/convert_UTF.o \
- src/common/md5.o \
- src/common/linux/elfutils.o \
- src/common/linux/file_id.o \
- src/common/linux/guid_creator.o \
- src/common/linux/linux_libc_support.o \
- src/common/linux/memory_mapped_file.o \
- src/common/linux/safe_readlink.o \
- src/common/string_conversion.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-if ANDROID_HOST
-src_client_linux_linux_client_unittest_shlib_SOURCES += \
- src/common/android/breakpad_getcontext_unittest.cc
-src_client_linux_linux_client_unittest_shlib_LDFLAGS += \
- -llog -lm
-endif
-
-src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
- src/client/linux/linux_dumper_unittest_helper \
- src/client/linux/libbreakpad_client.a \
- $(TEST_DEPS) \
- src/libbreakpad.a
-
-src_client_linux_linux_client_unittest_SOURCES =
-# The extra-long build id is for a test in minidump_writer_unittest.cc.
-src_client_linux_linux_client_unittest_LDFLAGS = \
- -Wl,-rpath,'$$ORIGIN' \
- -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
-if ANDROID_HOST
-src_client_linux_linux_client_unittest_LDFLAGS += \
- -llog
-endif
-
-src_client_linux_linux_client_unittest_LDADD = \
- src/client/linux/linux_client_unittest_shlib \
- $(TEST_LIBS)
-
-src_client_linux_linux_client_unittest_DEPENDENCIES = \
- src/client/linux/linux_client_unittest_shlib
-
-if !DISABLE_TOOLS
-src_tools_linux_core2md_core2md_SOURCES = \
- src/tools/linux/core2md/core2md.cc
-
-src_tools_linux_core2md_core2md_LDADD = \
- src/client/linux/libbreakpad_client.a
-
-src_tools_linux_dump_syms_dump_syms_SOURCES = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc \
- src/common/language.cc \
- src/common/module.cc \
- src/common/stabs_reader.cc \
- src/common/stabs_to_module.cc \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols.h \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module.h \
- src/common/linux/elfutils.cc \
- src/common/linux/file_id.cc \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/safe_readlink.cc \
- src/tools/linux/dump_syms/dump_syms.cc
-
-src_tools_linux_md2core_minidump_2_core_SOURCES = \
- src/common/linux/memory_mapped_file.cc \
- src/tools/linux/md2core/minidump-2-core.cc \
- src/tools/linux/md2core/minidump_memory_range.h
-
-src_tools_linux_symupload_minidump_upload_SOURCES = \
- src/common/linux/http_upload.cc \
- src/tools/linux/symupload/minidump_upload.cc
-src_tools_linux_symupload_minidump_upload_LDADD = -ldl
-
-src_tools_linux_symupload_sym_upload_SOURCES = \
- src/common/linux/http_upload.cc \
- src/common/linux/http_upload.h \
- src/common/linux/symbol_upload.cc \
- src/common/linux/symbol_upload.h \
- src/tools/linux/symupload/sym_upload.cc
-src_tools_linux_symupload_sym_upload_LDADD = -ldl
-
-src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc \
- src/common/language.cc \
- src/common/md5.cc \
- src/common/module.cc \
- src/common/stabs_reader.cc \
- src/common/stabs_to_module.cc \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc \
- src/common/mac/arch_utilities.cc \
- src/common/mac/dump_syms.cc \
- src/common/mac/dump_syms.h \
- src/common/mac/file_id.cc \
- src/common/mac/file_id.h \
- src/common/mac/macho_id.cc \
- src/common/mac/macho_id.h \
- src/common/mac/macho_reader.cc \
- src/common/mac/macho_reader.h \
- src/common/mac/macho_utilities.cc \
- src/common/mac/macho_utilities.h \
- src/common/mac/macho_walker.cc \
- src/common/mac/macho_walker.h \
- src/tools/mac/dump_syms/dump_syms_tool.cc
-src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS= \
- -I$(top_srcdir)/src/third_party/mac_headers \
- -DHAVE_MACH_O_NLIST_H
-
-src_common_dumper_unittest_SOURCES = \
- src/common/byte_cursor_unittest.cc \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cfi_to_module_unittest.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_cu_to_module_unittest.cc \
- src/common/dwarf_line_to_module.cc \
- src/common/dwarf_line_to_module_unittest.cc \
- src/common/language.cc \
- src/common/memory_range_unittest.cc \
- src/common/module.cc \
- src/common/module_unittest.cc \
- src/common/stabs_reader.cc \
- src/common/stabs_reader_unittest.cc \
- src/common/stabs_to_module.cc \
- src/common/stabs_to_module_unittest.cc \
- src/common/test_assembler.cc \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/bytereader.h \
- src/common/dwarf/bytereader-inl.h \
- src/common/dwarf/bytereader_unittest.cc \
- src/common/dwarf/cfi_assembler.cc \
- src/common/dwarf/cfi_assembler.h \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2diehandler_unittest.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/dwarf2reader.h \
- src/common/dwarf/elf_reader.cc \
- src/common/dwarf/elf_reader.h \
- src/common/dwarf/dwarf2reader_cfi_unittest.cc \
- src/common/dwarf/dwarf2reader_die_unittest.cc \
- src/common/dwarf/dwarf2reader_test_common.h \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols_unittest.cc \
- src/common/linux/elf_core_dump.cc \
- src/common/linux/elf_core_dump_unittest.cc \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module_unittest.cc \
- src/common/linux/elfutils.cc \
- src/common/linux/file_id.cc \
- src/common/linux/file_id_unittest.cc \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/memory_mapped_file_unittest.cc \
- src/common/linux/safe_readlink.cc \
- src/common/linux/safe_readlink_unittest.cc \
- src/common/linux/synth_elf.cc \
- src/common/linux/synth_elf_unittest.cc \
- src/common/linux/tests/crash_generator.cc \
- src/common/linux/tests/crash_generator.h \
- src/common/testdata/func-line-pairing.h \
- src/common/tests/file_utils.cc
-src_common_dumper_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS) \
- $(PTHREAD_CFLAGS)
-src_common_dumper_unittest_LDADD = \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_common_mac_macho_reader_unittest_SOURCES = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc \
- src/common/language.cc \
- src/common/md5.cc \
- src/common/module.cc \
- src/common/stabs_reader.cc \
- src/common/stabs_to_module.cc \
- src/common/test_assembler.cc \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/cfi_assembler.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc \
- src/common/mac/arch_utilities.cc \
- src/common/mac/file_id.cc \
- src/common/mac/macho_id.cc \
- src/common/mac/macho_reader.cc \
- src/common/mac/macho_reader_unittest.cc \
- src/common/mac/macho_utilities.cc \
- src/common/mac/macho_walker.cc \
- src/common/tests/file_utils.cc
-src_common_mac_macho_reader_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS) \
- -I$(top_srcdir)/src/third_party/mac_headers \
- -DHAVE_MACH_O_NLIST_H \
- $(PTHREAD_CFLAGS)
-src_common_mac_macho_reader_unittest_LDADD = \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-endif
-
-src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \
- src/tools/linux/md2core/minidump_memory_range_unittest.cc
-src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-endif LINUX_HOST
-
-if !DISABLE_PROCESSOR
-src_processor_address_map_unittest_SOURCES = \
- src/processor/address_map_unittest.cc
-src_processor_address_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o
-
-src_processor_basic_source_line_resolver_unittest_SOURCES = \
- src/processor/basic_source_line_resolver_unittest.cc
-src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_basic_source_line_resolver_unittest_LDADD = \
- src/processor/basic_source_line_resolver.o \
- src/processor/cfi_frame_info.o \
- src/processor/pathname_stripper.o \
- src/processor/logging.o \
- src/processor/source_line_resolver_base.o \
- src/processor/tokenize.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_cfi_frame_info_unittest_SOURCES = \
- src/processor/cfi_frame_info_unittest.cc
-src_processor_cfi_frame_info_unittest_LDADD = \
- src/processor/cfi_frame_info.o \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_cfi_frame_info_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_contained_range_map_unittest_SOURCES = \
- src/processor/contained_range_map_unittest.cc
-src_processor_contained_range_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o
-
-src_processor_exploitability_unittest_SOURCES = \
- src/processor/exploitability_unittest.cc
-src_processor_exploitability_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_exploitability_unittest_LDADD = \
- src/processor/minidump_processor.o \
- src/processor/process_state.o \
- src/processor/disassembler_x86.o \
- src/processor/exploitability.o \
- src/processor/exploitability_linux.o \
- src/processor/exploitability_win.o \
- src/processor/basic_code_modules.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/call_stack.o \
- src/processor/cfi_frame_info.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/logging.o \
- src/processor/minidump.o \
- src/processor/pathname_stripper.o \
- src/processor/proc_maps_linux.o \
- src/processor/simple_symbol_supplier.o \
- src/processor/source_line_resolver_base.o \
- src/processor/stack_frame_cpu.o \
- src/processor/stack_frame_symbolizer.o \
- src/processor/stackwalker.o \
- src/processor/stackwalker_address_list.o \
- src/processor/stackwalker_amd64.o \
- src/processor/stackwalker_arm.o \
- src/processor/stackwalker_arm64.o \
- src/processor/stackwalker_mips.o \
- src/processor/stackwalker_ppc.o \
- src/processor/stackwalker_ppc64.o \
- src/processor/stackwalker_sparc.o \
- src/processor/stackwalker_x86.o \
- src/processor/symbolic_constants_win.o \
- src/processor/tokenize.o \
- src/third_party/libdisasm/libdisasm.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_disassembler_x86_unittest_SOURCES = \
- src/processor/disassembler_x86_unittest.cc
-src_processor_disassembler_x86_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_disassembler_x86_unittest_LDADD = \
- src/processor/disassembler_x86.o \
- src/third_party/libdisasm/libdisasm.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_fast_source_line_resolver_unittest_SOURCES = \
- src/processor/fast_source_line_resolver_unittest.cc
-src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_fast_source_line_resolver_unittest_LDADD = \
- src/processor/fast_source_line_resolver.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/cfi_frame_info.o \
- src/processor/module_comparer.o \
- src/processor/module_serializer.o \
- src/processor/pathname_stripper.o \
- src/processor/logging.o \
- src/processor/source_line_resolver_base.o \
- src/processor/tokenize.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_map_serializers_unittest_SOURCES = \
- src/processor/map_serializers_unittest.cc
-src_processor_map_serializers_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_map_serializers_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_microdump_processor_unittest_SOURCES = \
- src/processor/microdump_processor_unittest.cc
-src_processor_microdump_processor_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_microdump_processor_unittest_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/call_stack.o \
- src/processor/cfi_frame_info.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/logging.o \
- src/processor/microdump.o \
- src/processor/microdump_processor.o \
- src/processor/pathname_stripper.o \
- src/processor/process_state.o \
- src/processor/simple_symbol_supplier.o \
- src/processor/source_line_resolver_base.o \
- src/processor/stack_frame_symbolizer.o \
- src/processor/stackwalker.o \
- src/processor/stackwalker_address_list.o \
- src/processor/stackwalker_amd64.o \
- src/processor/stackwalker_arm.o \
- src/processor/stackwalker_arm64.o \
- src/processor/stackwalker_mips.o \
- src/processor/stackwalker_ppc.o \
- src/processor/stackwalker_ppc64.o \
- src/processor/stackwalker_sparc.o \
- src/processor/stackwalker_x86.o \
- src/processor/tokenize.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_minidump_processor_unittest_SOURCES = \
- src/processor/minidump_processor_unittest.cc
-src_processor_minidump_processor_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_minidump_processor_unittest_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/call_stack.o \
- src/processor/cfi_frame_info.o \
- src/processor/disassembler_x86.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/exploitability.o \
- src/processor/exploitability_linux.o \
- src/processor/exploitability_win.o \
- src/processor/logging.o \
- src/processor/minidump_processor.o \
- src/processor/minidump.o \
- src/processor/pathname_stripper.o \
- src/processor/process_state.o \
- src/processor/proc_maps_linux.o \
- src/processor/source_line_resolver_base.o \
- src/processor/stack_frame_cpu.o \
- src/processor/stack_frame_symbolizer.o \
- src/processor/stackwalker.o \
- src/processor/stackwalker_address_list.o \
- src/processor/stackwalker_amd64.o \
- src/processor/stackwalker_arm.o \
- src/processor/stackwalker_arm64.o \
- src/processor/stackwalker_mips.o \
- src/processor/stackwalker_ppc.o \
- src/processor/stackwalker_ppc64.o \
- src/processor/stackwalker_sparc.o \
- src/processor/stackwalker_x86.o \
- src/processor/symbolic_constants_win.o \
- src/processor/tokenize.o \
- src/third_party/libdisasm/libdisasm.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_minidump_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/minidump_unittest.cc \
- src/processor/synth_minidump.cc
-src_processor_minidump_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_minidump_unittest_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/logging.o \
- src/processor/minidump.o \
- src/processor/pathname_stripper.o \
- src/processor/proc_maps_linux.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_proc_maps_linux_unittest_SOURCES = \
- src/processor/proc_maps_linux.cc \
- src/processor/proc_maps_linux_unittest.cc
-src_processor_proc_maps_linux_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_proc_maps_linux_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- src/third_party/libdisasm/libdisasm.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_static_address_map_unittest_SOURCES = \
- src/processor/static_address_map_unittest.cc
-src_processor_static_address_map_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_static_address_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_static_contained_range_map_unittest_SOURCES = \
- src/processor/static_contained_range_map_unittest.cc
-src_processor_static_contained_range_map_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_static_contained_range_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_static_map_unittest_SOURCES = \
- src/processor/static_map_unittest.cc
-src_processor_static_map_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_static_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_static_range_map_unittest_SOURCES = \
- src/processor/static_range_map_unittest.cc
-src_processor_static_range_map_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_static_range_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_pathname_stripper_unittest_SOURCES = \
- src/processor/pathname_stripper_unittest.cc
-src_processor_pathname_stripper_unittest_LDADD = \
- src/processor/pathname_stripper.o \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_postfix_evaluator_unittest_SOURCES = \
- src/processor/postfix_evaluator_unittest.cc
-src_processor_postfix_evaluator_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_range_map_shrink_down_unittest_SOURCES = \
- src/processor/range_map_shrink_down_unittest.cc
-src_processor_range_map_shrink_down_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_range_map_shrink_down_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_range_map_unittest_SOURCES = \
- src/processor/range_map_unittest.cc
-src_processor_range_map_unittest_LDADD = \
- src/processor/logging.o \
- src/processor/pathname_stripper.o \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_stackwalker_selftest_SOURCES = \
- src/processor/stackwalker_selftest.cc
-src_processor_stackwalker_selftest_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/call_stack.o \
- src/processor/disassembler_x86.o \
- src/processor/exploitability.o \
- src/processor/exploitability_linux.o \
- src/processor/exploitability_win.o \
- src/processor/logging.o \
- src/processor/minidump.o \
- src/processor/pathname_stripper.o \
- src/processor/proc_maps_linux.o \
- src/processor/source_line_resolver_base.o \
- src/processor/stack_frame_cpu.o \
- src/processor/stack_frame_symbolizer.o \
- src/processor/stackwalker.o \
- src/processor/stackwalker_address_list.o \
- src/processor/stackwalker_amd64.o \
- src/processor/stackwalker_arm.o \
- src/processor/stackwalker_arm64.o \
- src/processor/stackwalker_mips.o \
- src/processor/stackwalker_ppc.o \
- src/processor/stackwalker_ppc64.o \
- src/processor/stackwalker_sparc.o \
- src/processor/stackwalker_x86.o \
- src/processor/tokenize.o \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_processor_stackwalker_amd64_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_amd64_unittest.cc
-src_processor_stackwalker_amd64_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_amd64_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_stackwalker_arm_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_arm_unittest.cc
-src_processor_stackwalker_arm_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_arm_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_stackwalker_arm64_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_arm64_unittest.cc
-src_processor_stackwalker_arm64_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_arm64_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_stackwalker_address_list_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_address_list_unittest.cc
-src_processor_stackwalker_address_list_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_address_list_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_stackwalker_mips_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_mips_unittest.cc
-src_processor_stackwalker_mips_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_mips_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_stackwalker_mips64_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_mips64_unittest.cc
-src_processor_stackwalker_mips64_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_mips64_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_stackwalker_x86_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_x86_unittest.cc
-src_processor_stackwalker_x86_unittest_LDADD = \
- src/libbreakpad.a \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-src_processor_stackwalker_x86_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-src_processor_synth_minidump_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/common/test_assembler.h \
- src/processor/synth_minidump_unittest.cc \
- src/processor/synth_minidump.cc \
- src/processor/synth_minidump.h
-src_processor_synth_minidump_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_processor_synth_minidump_unittest_LDADD = \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-src_common_test_assembler_unittest_SOURCES = \
- src/common/test_assembler.cc \
- src/common/test_assembler.h \
- src/common/test_assembler_unittest.cc
-src_common_test_assembler_unittest_CPPFLAGS = \
- $(AM_CPPFLAGS) $(TEST_CFLAGS)
-src_common_test_assembler_unittest_LDADD = \
- $(TEST_LIBS) \
- $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-## Non-installables
-noinst_PROGRAMS =
-noinst_SCRIPTS = $(check_SCRIPTS)
-
-src_processor_minidump_dump_SOURCES = \
- src/processor/minidump_dump.cc
-src_processor_minidump_dump_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/logging.o \
- src/processor/minidump.o \
- src/processor/pathname_stripper.o \
- src/processor/proc_maps_linux.o
-
-src_processor_microdump_stackwalk_SOURCES = \
- src/processor/microdump_stackwalk.cc
-src_processor_microdump_stackwalk_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/call_stack.o \
- src/processor/cfi_frame_info.o \
- src/processor/disassembler_x86.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/logging.o \
- src/processor/microdump.o \
- src/processor/microdump_processor.o \
- src/processor/pathname_stripper.o \
- src/processor/process_state.o \
- src/processor/simple_symbol_supplier.o \
- src/processor/source_line_resolver_base.o \
- src/processor/stack_frame_cpu.o \
- src/processor/stack_frame_symbolizer.o \
- src/processor/stackwalk_common.o \
- src/processor/stackwalker.o \
- src/processor/stackwalker_address_list.o \
- src/processor/stackwalker_amd64.o \
- src/processor/stackwalker_arm.o \
- src/processor/stackwalker_arm64.o \
- src/processor/stackwalker_mips.o \
- src/processor/stackwalker_ppc.o \
- src/processor/stackwalker_ppc64.o \
- src/processor/stackwalker_sparc.o \
- src/processor/stackwalker_x86.o \
- src/processor/tokenize.o \
- src/third_party/libdisasm/libdisasm.a
-
-src_processor_minidump_stackwalk_SOURCES = \
- src/processor/minidump_stackwalk.cc
-src_processor_minidump_stackwalk_LDADD = \
- src/processor/basic_code_modules.o \
- src/processor/basic_source_line_resolver.o \
- src/processor/call_stack.o \
- src/processor/cfi_frame_info.o \
- src/processor/disassembler_x86.o \
- src/processor/dump_context.o \
- src/processor/dump_object.o \
- src/processor/exploitability.o \
- src/processor/exploitability_linux.o \
- src/processor/exploitability_win.o \
- src/processor/logging.o \
- src/processor/minidump.o \
- src/processor/minidump_processor.o \
- src/processor/pathname_stripper.o \
- src/processor/process_state.o \
- src/processor/proc_maps_linux.o \
- src/processor/simple_symbol_supplier.o \
- src/processor/source_line_resolver_base.o \
- src/processor/stack_frame_cpu.o \
- src/processor/stack_frame_symbolizer.o \
- src/processor/stackwalk_common.o \
- src/processor/stackwalker.o \
- src/processor/stackwalker_address_list.o \
- src/processor/stackwalker_amd64.o \
- src/processor/stackwalker_arm.o \
- src/processor/stackwalker_arm64.o \
- src/processor/stackwalker_mips.o \
- src/processor/stackwalker_ppc.o \
- src/processor/stackwalker_ppc64.o \
- src/processor/stackwalker_sparc.o \
- src/processor/stackwalker_x86.o \
- src/processor/symbolic_constants_win.o \
- src/processor/tokenize.o \
- src/third_party/libdisasm/libdisasm.a
-
-endif !DISABLE_PROCESSOR
-
-## Additional files to be included in a source distribution
-##
-## find src/client src/common src/processor/testdata src/tools \
-## -type f \! -path '*/.svn/*' -print | sort | \
-## sed -e s/'^\(.*\)$'/'\t\1 \\'/
-EXTRA_DIST = \
- $(SCRIPTS) \
- src/client/linux/data/linux-gate-amd.sym \
- src/client/linux/data/linux-gate-intel.sym \
- src/client/mac/handler/breakpad_nlist_64.cc \
- src/client/mac/handler/breakpad_nlist_64.h \
- src/client/mac/handler/dynamic_images.cc \
- src/client/mac/handler/dynamic_images.h \
- src/client/mac/handler/exception_handler.cc \
- src/client/mac/handler/exception_handler.h \
- src/client/mac/handler/mach_vm_compat.h \
- src/client/mac/handler/minidump_generator.cc \
- src/client/mac/handler/minidump_generator.h \
- src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj \
- src/client/mac/handler/minidump_tests32-Info.plist \
- src/client/mac/handler/minidump_tests64-Info.plist \
- src/client/mac/handler/obj-cTestCases-Info.plist \
- src/client/mac/handler/protected_memory_allocator.cc \
- src/client/mac/handler/protected_memory_allocator.h \
- src/client/mac/handler/ucontext_compat.h \
- src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym \
- src/client/mac/tests/BreakpadFramework_Test.mm \
- src/client/mac/tests/crash_generation_server_test.cc \
- src/client/mac/tests/exception_handler_test.cc \
- src/client/mac/tests/minidump_generator_test.cc \
- src/client/mac/tests/minidump_generator_test_helper.cc \
- src/client/mac/tests/spawn_child_process.h \
- src/client/mac/tests/testlogging.h \
- src/client/minidump_file_writer_unittest.cc \
- src/client/solaris/handler/Makefile \
- src/client/solaris/handler/exception_handler.cc \
- src/client/solaris/handler/exception_handler.h \
- src/client/solaris/handler/exception_handler_test.cc \
- src/client/solaris/handler/minidump_generator.cc \
- src/client/solaris/handler/minidump_generator.h \
- src/client/solaris/handler/minidump_test.cc \
- src/client/solaris/handler/solaris_lwp.cc \
- src/client/solaris/handler/solaris_lwp.h \
- src/client/windows/breakpad_client.gyp \
- src/client/windows/handler/exception_handler.cc \
- src/client/windows/handler/exception_handler.h \
- src/client/windows/handler/exception_handler.gyp \
- src/client/windows/sender/crash_report_sender.cc \
- src/client/windows/sender/crash_report_sender.h \
- src/client/windows/sender/crash_report_sender.gyp \
- src/common/dwarf/dwarf2diehandler.h \
- src/common/dwarf/dwarf2enums.h \
- src/common/dwarf/line_state_machine.h \
- src/common/dwarf/types.h \
- src/common/mac/arch_utilities.h \
- src/common/mac/byteswap.h \
- src/common/mac/HTTPMultipartUpload.h \
- src/common/mac/HTTPMultipartUpload.m \
- src/common/mac/string_utilities.cc \
- src/common/mac/string_utilities.h \
- src/common/mac/super_fat_arch.h \
- src/common/scoped_ptr.h \
- src/common/solaris/dump_symbols.cc \
- src/common/solaris/dump_symbols.h \
- src/common/solaris/file_id.cc \
- src/common/solaris/file_id.h \
- src/common/solaris/guid_creator.cc \
- src/common/solaris/guid_creator.h \
- src/common/solaris/message_output.h \
- src/common/windows/guid_string.cc \
- src/common/windows/guid_string.h \
- src/common/windows/http_upload.cc \
- src/common/windows/http_upload.h \
- src/common/windows/pdb_source_line_writer.cc \
- src/common/windows/pdb_source_line_writer.h \
- src/common/windows/string_utils-inl.h \
- src/common/windows/string_utils.cc \
- src/processor/stackwalk_common.cc \
- src/processor/stackwalk_common.h \
- src/processor/stackwalker_selftest_sol.s \
- src/processor/testdata/ascii_read_av_block_write.dmp \
- src/processor/testdata/ascii_read_av_clobber_write.dmp \
- src/processor/testdata/ascii_read_av_conditional.dmp \
- src/processor/testdata/ascii_read_av.dmp \
- src/processor/testdata/ascii_read_av_then_jmp.dmp \
- src/processor/testdata/ascii_read_av_xchg_write.dmp \
- src/processor/testdata/ascii_write_av_arg_to_call.dmp \
- src/processor/testdata/ascii_write_av.dmp \
- src/processor/testdata/exec_av_on_stack.dmp \
- src/processor/testdata/linux_divide_by_zero.dmp \
- src/processor/testdata/linux_executable_heap.dmp \
- src/processor/testdata/linux_executable_stack.dmp \
- src/processor/testdata/linux_inside_module_exe_region1.dmp \
- src/processor/testdata/linux_inside_module_exe_region2.dmp \
- src/processor/testdata/linux_jmp_to_0.dmp \
- src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp \
- src/processor/testdata/linux_null_dereference.dmp \
- src/processor/testdata/linux_null_read_av.dmp \
- src/processor/testdata/linux_outside_module.dmp \
- src/processor/testdata/linux_overflow.dmp \
- src/processor/testdata/linux_raise_sigabrt.dmp \
- src/processor/testdata/linux_stack_pointer_in_module.dmp \
- src/processor/testdata/linux_stack_pointer_in_stack.dmp \
- src/processor/testdata/linux_stacksmash.dmp \
- src/processor/testdata/linux_write_to_nonwritable_module.dmp \
- src/processor/testdata/linux_write_to_nonwritable_region_math.dmp \
- src/processor/testdata/linux_write_to_outside_module.dmp \
- src/processor/testdata/linux_write_to_outside_module_via_math.dmp \
- src/processor/testdata/linux_write_to_under_4k.dmp \
- src/processor/testdata/microdump-arm64.dmp \
- src/processor/testdata/microdump-arm.dmp \
- src/processor/testdata/microdump-mips32.dmp \
- src/processor/testdata/microdump-mips64.dmp \
- src/processor/testdata/microdump-multiple.dmp \
- src/processor/testdata/microdump.stackwalk-arm64.out \
- src/processor/testdata/microdump.stackwalk-arm.out \
- src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out \
- src/processor/testdata/microdump.stackwalk.machine_readable-arm.out \
- src/processor/testdata/microdump-x86.dmp \
- src/processor/testdata/minidump2.dmp \
- src/processor/testdata/minidump2.dump.out \
- src/processor/testdata/minidump2.stackwalk.machine_readable.out \
- src/processor/testdata/minidump2.stackwalk.out \
- src/processor/testdata/module0.out \
- src/processor/testdata/module1.out \
- src/processor/testdata/module2.out \
- src/processor/testdata/module3_bad.out \
- src/processor/testdata/module4_bad.out \
- src/processor/testdata/null_read_av.dmp \
- src/processor/testdata/null_write_av.dmp \
- src/processor/testdata/read_av_clobber_write.dmp \
- src/processor/testdata/read_av_conditional.dmp \
- src/processor/testdata/read_av_non_null.dmp \
- src/processor/testdata/stack_exhaustion.dmp \
- src/processor/testdata/write_av_non_null.dmp \
- src/processor/testdata/symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542/kernel32.sym \
- src/processor/testdata/symbols/ld-2.13.so/C32AD7E235EA6112E02A5B9D6219C4850/ld-2.13.so.sym \
- src/processor/testdata/symbols/libc-2.13.so/F4F8DFCD5A5FB5A7CE64717E9E6AE3890/libc-2.13.so.sym \
- src/processor/testdata/symbols/libgcc_s.so.1/18B180F90887D8F8B5C35D185444AF4C0/libgcc_s.so.1.sym \
- src/processor/testdata/symbols/microdump/breakpad_unittests/D6D1FEC9A15DE7F38A236898871A2E770/breakpad_unittests.sym \
- src/processor/testdata/symbols/microdump/breakpad_unittests/DA7778FB66018A4E9B4110ED06E730D00/breakpad_unittests.sym \
- src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym \
- src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym \
- src/processor/testdata/symbols/null_read_av/7B7D1968FF0D47AE4366E9C3A7E1B6750/null_read_av.sym \
- src/processor/testdata/symbols/overflow/B0E1FC01EF48E39CAF5C881D2DF0C3840/overflow.sym \
- src/processor/testdata/symbols/test_app.pdb/5A9832E5287241C1838ED98914E9B7FF1/test_app.sym \
- src/processor/testdata/test_app.cc \
- src/testing/gtest/include/gtest/gtest.h \
- src/testing/gtest/include/gtest/gtest-death-test.h \
- src/testing/gtest/include/gtest/gtest-message.h \
- src/testing/gtest/include/gtest/gtest-param-test.h \
- src/testing/gtest/include/gtest/gtest-printers.h \
- src/testing/gtest/include/gtest/gtest-spi.h \
- src/testing/gtest/include/gtest/gtest-test-part.h \
- src/testing/gtest/include/gtest/gtest-typed-test.h \
- src/testing/gtest/include/gtest/gtest_pred_impl.h \
- src/testing/gtest/include/gtest/gtest_prod.h \
- src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h \
- src/testing/gtest/include/gtest/internal/gtest-filepath.h \
- src/testing/gtest/include/gtest/internal/gtest-internal.h \
- src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h \
- src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h \
- src/testing/gtest/include/gtest/internal/gtest-param-util.h \
- src/testing/gtest/include/gtest/internal/gtest-port.h \
- src/testing/gtest/include/gtest/internal/gtest-string.h \
- src/testing/gtest/include/gtest/internal/gtest-tuple.h \
- src/testing/gtest/include/gtest/internal/gtest-type-util.h \
- src/testing/gtest/src/gtest.cc \
- src/testing/gtest/src/gtest-death-test.cc \
- src/testing/gtest/src/gtest-filepath.cc \
- src/testing/gtest/src/gtest-internal-inl.h \
- src/testing/gtest/src/gtest-port.cc \
- src/testing/gtest/src/gtest-printers.cc \
- src/testing/gtest/src/gtest-test-part.cc \
- src/testing/gtest/src/gtest-typed-test.cc \
- src/testing/include/gmock/gmock.h \
- src/testing/include/gmock/gmock-actions.h \
- src/testing/include/gmock/gmock-cardinalities.h \
- src/testing/include/gmock/gmock-generated-actions.h \
- src/testing/include/gmock/gmock-generated-function-mockers.h \
- src/testing/include/gmock/gmock-generated-matchers.h \
- src/testing/include/gmock/gmock-generated-nice-strict.h \
- src/testing/include/gmock/gmock-matchers.h \
- src/testing/include/gmock/gmock-more-actions.h \
- src/testing/include/gmock/gmock-more-matchers.h \
- src/testing/include/gmock/gmock-spec-builders.h \
- src/testing/include/gmock/internal/gmock-generated-internal-utils.h \
- src/testing/include/gmock/internal/gmock-internal-utils.h \
- src/testing/include/gmock/internal/gmock-port.h \
- src/testing/src/gmock.cc \
- src/testing/src/gmock-cardinalities.cc \
- src/testing/src/gmock-internal-utils.cc \
- src/testing/src/gmock-matchers.cc \
- src/testing/src/gmock-spec-builders.cc \
- src/testing/src/gmock_main.cc \
- src/third_party/curl/COPYING \
- src/third_party/curl/curlbuild.h \
- src/third_party/curl/curl.h \
- src/third_party/curl/curlrules.h \
- src/third_party/curl/curlver.h \
- src/third_party/curl/easy.h \
- src/third_party/curl/mprintf.h \
- src/third_party/curl/multi.h \
- src/third_party/curl/stdcheaders.h \
- src/third_party/curl/typecheck-gcc.h \
- src/third_party/curl/types.h \
- src/third_party/mac_headers/architecture/byte_order.h \
- src/third_party/mac_headers/i386/_types.h \
- src/third_party/mac_headers/mach/boolean.h \
- src/third_party/mac_headers/mach/i386/boolean.h \
- src/third_party/mac_headers/mach/i386/vm_param.h \
- src/third_party/mac_headers/mach/i386/vm_types.h \
- src/third_party/mac_headers/mach/machine/boolean.h \
- src/third_party/mac_headers/mach/machine.h \
- src/third_party/mac_headers/mach/machine/thread_state.h \
- src/third_party/mac_headers/mach/machine/thread_status.h \
- src/third_party/mac_headers/mach/machine/vm_types.h \
- src/third_party/mac_headers/mach-o/arch.h \
- src/third_party/mac_headers/mach-o/fat.h \
- src/third_party/mac_headers/mach-o/loader.h \
- src/third_party/mac_headers/mach-o/nlist.h \
- src/third_party/mac_headers/mach/thread_status.h \
- src/third_party/mac_headers/mach/vm_prot.h \
- src/third_party/mac_headers/README \
- src/third_party/musl/README \
- src/third_party/musl/COPYRIGHT \
- src/third_party/musl/README.breakpad \
- src/third_party/musl/VERSION \
- src/third_party/musl/include/elf.h \
- src/tools/mac/crash_report/crash_report.mm \
- src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj \
- src/tools/mac/crash_report/on_demand_symbol_supplier.h \
- src/tools/mac/crash_report/on_demand_symbol_supplier.mm \
- src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj \
- src/tools/mac/dump_syms/dump_syms_tool.cc \
- src/tools/mac/symupload/minidump_upload.m \
- src/tools/mac/symupload/symupload.m \
- src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj \
- src/tools/solaris/dump_syms/Makefile \
- src/tools/solaris/dump_syms/dump_syms.cc \
- src/tools/solaris/dump_syms/run_regtest.sh \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.o \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \
- src/tools/windows/converter/ms_symbol_server_converter.cc \
- src/tools/windows/converter/ms_symbol_server_converter.h \
- src/tools/windows/converter/ms_symbol_server_converter.gyp \
- src/tools/windows/dump_syms/dump_syms.cc \
- src/tools/windows/dump_syms/dump_syms.gyp \
- src/tools/windows/dump_syms/run_regtest.sh \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym \
- src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym \
- src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \
- src/tools/windows/dump_syms/testdata/omap_stretched.sym \
- src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \
- src/tools/windows/symupload/symupload.cc \
- src/tools/windows/symupload/symupload.gyp
-
-mostlyclean-local:
- -find src -name '*.dwo' -exec rm -f {} +
diff --git a/toolkit/crashreporter/google-breakpad/Makefile.in b/toolkit/crashreporter/google-breakpad/Makefile.in
deleted file mode 100644
index 06a112d50f..0000000000
--- a/toolkit/crashreporter/google-breakpad/Makefile.in
+++ /dev/null
@@ -1,8221 +0,0 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
-
-# This Makefile.in 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# Copyright (c) 2011, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-
-
-VPATH = @srcdir@
-am__is_gnu_make = { \
- if test -z '$(MAKELEVEL)'; then \
- false; \
- elif test -n '$(MAKE_HOST)'; then \
- true; \
- elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
- true; \
- else \
- false; \
- fi; \
-}
-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 \
- *\\[\ \ ]*) \
- bs=\\; \
- sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
- | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
- esac; \
- 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@
-pkglibexecdir = $(libexecdir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-
-# This allows using fixed NDK headers when building for Android.
-# This is only necessary for building the unit tests until GTest is upgraded
-# to a future version.
-@ANDROID_HOST_TRUE@am__append_1 = \
-@ANDROID_HOST_TRUE@ -I$(top_srcdir)/src/common/android/include \
-@ANDROID_HOST_TRUE@ -I$(top_srcdir)/src/common/android/testing/include
-
-# These are good warnings to be treated as errors
-@GCC_TRUE@am__append_2 = \
-@GCC_TRUE@ -Werror=missing-braces \
-@GCC_TRUE@ -Werror=non-virtual-dtor \
-@GCC_TRUE@ -Werror=overloaded-virtual \
-@GCC_TRUE@ -Werror=reorder \
-@GCC_TRUE@ -Werror=sign-compare \
-@GCC_TRUE@ -Werror=unused-variable \
-@GCC_TRUE@ -Werror=vla
-
-
-# Build as PIC on Linux, for linux_client_unittest_shlib
-@LINUX_HOST_TRUE@am__append_3 = -fPIC
-@LINUX_HOST_TRUE@am__append_4 = -fPIC
-bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) $(am__EXEEXT_4)
-check_PROGRAMS = $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) \
- $(am__EXEEXT_8) $(am__EXEEXT_9)
-EXTRA_PROGRAMS = $(am__EXEEXT_1)
-@DISABLE_PROCESSOR_FALSE@am__append_5 = src/libbreakpad.a
-@DISABLE_PROCESSOR_FALSE@am__append_6 = breakpad.pc
-@DISABLE_PROCESSOR_FALSE@am__append_7 = src/third_party/libdisasm/libdisasm.a
-@LINUX_HOST_TRUE@am__append_8 = src/client/linux/libbreakpad_client.a
-@LINUX_HOST_TRUE@am__append_9 = breakpad-client.pc
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_10 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext.S
-
-@DISABLE_PROCESSOR_FALSE@am__append_11 = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk
-
-@LINUX_HOST_TRUE@am__append_12 = src/client/linux/linux_dumper_unittest_helper \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
-@LINUX_HOST_TRUE@am__append_13 = src/client/linux/linux_dumper_unittest_helper \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_14 = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_15 = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_mac
-
-@DISABLE_PROCESSOR_FALSE@am__append_16 = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_shrink_down_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest
-
-@LINUX_HOST_TRUE@am__append_17 = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__append_18 = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dumper_unittest \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__append_19 = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@ src/common/mac/macho_reader_unittest
-
-@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__append_20 = \
-@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@ src/processor/stackwalker_selftest
-
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_21 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext.S
-
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_22 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ src/common/android/breakpad_getcontext_unittest.cc
-
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_23 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog -lm
-
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__append_24 = \
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@ -llog
-
-noinst_PROGRAMS =
-subdir = .
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/ax_pthread.m4 \
- $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \
- $(top_srcdir)/configure.ac
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
- $(am__configure_deps) $(dist_doc_DATA) $(includec_HEADERS) \
- $(am__includecl_HEADERS_DIST) $(am__includeclc_HEADERS_DIST) \
- $(am__includecldwc_HEADERS_DIST) \
- $(am__includeclh_HEADERS_DIST) $(am__includeclm_HEADERS_DIST) \
- $(includegbc_HEADERS) $(am__includelss_HEADERS_DIST) \
- $(includep_HEADERS) $(am__DIST_COMMON)
-am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno config.status.lineno
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/src/config.h
-CONFIG_CLEAN_FILES = breakpad.pc breakpad-client.pc
-CONFIG_CLEAN_VPATH_FILES =
-am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
-am__vpath_adj = case $$p in \
- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
- *) f=$$p;; \
- esac;
-am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
-am__install_max = 40
-am__nobase_strip_setup = \
- srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
-am__nobase_strip = \
- for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
-am__nobase_list = $(am__nobase_strip_setup); \
- for p in $$list; do echo "$$p $$p"; done | \
- sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
- $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
- if (++n[$$2] == $(am__install_max)) \
- { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
- END { for (dir in files) print dir, files[dir] }'
-am__base_list = \
- sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
- sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__uninstall_files_from_dir = { \
- test -z "$$files" \
- || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
- || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
- $(am__cd) "$$dir" && rm -f $$files; }; \
- }
-am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" \
- "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \
- "$(DESTDIR)$(includecdir)" "$(DESTDIR)$(includecldir)" \
- "$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includecldwcdir)" \
- "$(DESTDIR)$(includeclhdir)" "$(DESTDIR)$(includeclmdir)" \
- "$(DESTDIR)$(includegbcdir)" "$(DESTDIR)$(includelssdir)" \
- "$(DESTDIR)$(includepdir)"
-LIBRARIES = $(lib_LIBRARIES) $(noinst_LIBRARIES)
-ARFLAGS = cru
-AM_V_AR = $(am__v_AR_@AM_V@)
-am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
-am__v_AR_0 = @echo " AR " $@;
-am__v_AR_1 =
-src_client_linux_libbreakpad_client_a_AR = $(AR) $(ARFLAGS)
-src_client_linux_libbreakpad_client_a_LIBADD =
-am__src_client_linux_libbreakpad_client_a_SOURCES_DIST = \
- src/client/linux/crash_generation/crash_generation_client.cc \
- src/client/linux/crash_generation/crash_generation_server.cc \
- src/client/linux/dump_writer_common/thread_info.cc \
- src/client/linux/dump_writer_common/ucontext_reader.cc \
- src/client/linux/handler/exception_handler.cc \
- src/client/linux/handler/exception_handler.h \
- src/client/linux/handler/minidump_descriptor.cc \
- src/client/linux/handler/minidump_descriptor.h \
- src/client/linux/log/log.cc src/client/linux/log/log.h \
- src/client/linux/microdump_writer/microdump_writer.cc \
- src/client/linux/microdump_writer/microdump_writer.h \
- src/client/linux/minidump_writer/linux_core_dumper.cc \
- src/client/linux/minidump_writer/linux_dumper.cc \
- src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
- src/client/linux/minidump_writer/minidump_writer.cc \
- src/client/minidump_file_writer-inl.h \
- src/client/minidump_file_writer.cc \
- src/client/minidump_file_writer.h src/common/convert_UTF.c \
- src/common/convert_UTF.h src/common/md5.cc src/common/md5.h \
- src/common/string_conversion.cc src/common/string_conversion.h \
- src/common/linux/elf_core_dump.cc src/common/linux/elfutils.cc \
- src/common/linux/elfutils.h src/common/linux/file_id.cc \
- src/common/linux/file_id.h src/common/linux/guid_creator.cc \
- src/common/linux/guid_creator.h \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/safe_readlink.cc \
- src/common/android/breakpad_getcontext.S
-am__dirstamp = $(am__leading_dot)dirstamp
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_1 = src/common/android/breakpad_getcontext.$(OBJEXT)
-@LINUX_HOST_TRUE@am_src_client_linux_libbreakpad_client_a_OBJECTS = src/client/linux/crash_generation/crash_generation_client.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_server.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/log/log.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/minidump_file_writer.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/convert_UTF.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/md5.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/string_conversion.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/elfutils.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/file_id.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/guid_creator.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.$(OBJEXT) \
-@LINUX_HOST_TRUE@ $(am__objects_1)
-src_client_linux_libbreakpad_client_a_OBJECTS = \
- $(am_src_client_linux_libbreakpad_client_a_OBJECTS)
-src_libbreakpad_a_AR = $(AR) $(ARFLAGS)
-src_libbreakpad_a_LIBADD =
-am__src_libbreakpad_a_SOURCES_DIST = \
- src/google_breakpad/common/breakpad_types.h \
- src/google_breakpad/common/minidump_format.h \
- src/google_breakpad/common/minidump_size.h \
- src/google_breakpad/processor/basic_source_line_resolver.h \
- src/google_breakpad/processor/call_stack.h \
- src/google_breakpad/processor/code_module.h \
- src/google_breakpad/processor/code_modules.h \
- src/google_breakpad/processor/dump_context.h \
- src/google_breakpad/processor/dump_object.h \
- src/google_breakpad/processor/exploitability.h \
- src/google_breakpad/processor/fast_source_line_resolver.h \
- src/google_breakpad/processor/memory_region.h \
- src/google_breakpad/processor/microdump.h \
- src/google_breakpad/processor/microdump_processor.h \
- src/google_breakpad/processor/minidump.h \
- src/google_breakpad/processor/minidump_processor.h \
- src/google_breakpad/processor/process_result.h \
- src/google_breakpad/processor/process_state.h \
- src/google_breakpad/processor/proc_maps_linux.h \
- src/google_breakpad/processor/source_line_resolver_base.h \
- src/google_breakpad/processor/source_line_resolver_interface.h \
- src/google_breakpad/processor/stack_frame.h \
- src/google_breakpad/processor/stack_frame_cpu.h \
- src/google_breakpad/processor/stack_frame_symbolizer.h \
- src/google_breakpad/processor/stackwalker.h \
- src/google_breakpad/processor/symbol_supplier.h \
- src/google_breakpad/processor/system_info.h \
- src/processor/address_map-inl.h src/processor/address_map.h \
- src/processor/basic_code_module.h \
- src/processor/basic_code_modules.cc \
- src/processor/basic_code_modules.h \
- src/processor/basic_source_line_resolver_types.h \
- src/processor/basic_source_line_resolver.cc \
- src/processor/call_stack.cc src/processor/cfi_frame_info.cc \
- src/processor/cfi_frame_info.h \
- src/processor/contained_range_map-inl.h \
- src/processor/contained_range_map.h \
- src/processor/disassembler_x86.h \
- src/processor/disassembler_x86.cc \
- src/processor/dump_context.cc src/processor/dump_object.cc \
- src/processor/exploitability.cc \
- src/processor/exploitability_linux.h \
- src/processor/exploitability_linux.cc \
- src/processor/exploitability_win.h \
- src/processor/exploitability_win.cc \
- src/processor/fast_source_line_resolver_types.h \
- src/processor/fast_source_line_resolver.cc \
- src/processor/linked_ptr.h src/processor/logging.h \
- src/processor/logging.cc src/processor/map_serializers-inl.h \
- src/processor/map_serializers.h src/processor/microdump.cc \
- src/processor/microdump_processor.cc src/processor/minidump.cc \
- src/processor/minidump_processor.cc \
- src/processor/module_comparer.cc \
- src/processor/module_comparer.h src/processor/module_factory.h \
- src/processor/module_serializer.cc \
- src/processor/module_serializer.h \
- src/processor/pathname_stripper.cc \
- src/processor/pathname_stripper.h \
- src/processor/postfix_evaluator-inl.h \
- src/processor/postfix_evaluator.h \
- src/processor/process_state.cc \
- src/processor/proc_maps_linux.cc src/processor/range_map-inl.h \
- src/processor/range_map.h \
- src/processor/simple_serializer-inl.h \
- src/processor/simple_serializer.h \
- src/processor/simple_symbol_supplier.cc \
- src/processor/simple_symbol_supplier.h \
- src/processor/windows_frame_info.h \
- src/processor/source_line_resolver_base_types.h \
- src/processor/source_line_resolver_base.cc \
- src/processor/stack_frame_cpu.cc \
- src/processor/stack_frame_symbolizer.cc \
- src/processor/stackwalker.cc \
- src/processor/stackwalker_amd64.cc \
- src/processor/stackwalker_amd64.h \
- src/processor/stackwalker_arm.cc \
- src/processor/stackwalker_arm.h \
- src/processor/stackwalker_arm64.cc \
- src/processor/stackwalker_arm64.h \
- src/processor/stackwalker_address_list.cc \
- src/processor/stackwalker_address_list.h \
- src/processor/stackwalker_mips.cc \
- src/processor/stackwalker_mips.h \
- src/processor/stackwalker_ppc.cc \
- src/processor/stackwalker_ppc.h \
- src/processor/stackwalker_ppc64.cc \
- src/processor/stackwalker_ppc64.h \
- src/processor/stackwalker_sparc.cc \
- src/processor/stackwalker_sparc.h \
- src/processor/stackwalker_x86.cc \
- src/processor/stackwalker_x86.h \
- src/processor/static_address_map-inl.h \
- src/processor/static_address_map.h \
- src/processor/static_contained_range_map-inl.h \
- src/processor/static_contained_range_map.h \
- src/processor/static_map_iterator-inl.h \
- src/processor/static_map_iterator.h \
- src/processor/static_map-inl.h src/processor/static_map.h \
- src/processor/static_range_map-inl.h \
- src/processor/static_range_map.h \
- src/processor/symbolic_constants_win.cc \
- src/processor/symbolic_constants_win.h \
- src/processor/tokenize.cc src/processor/tokenize.h
-@DISABLE_PROCESSOR_FALSE@am_src_libbreakpad_a_OBJECTS = src/processor/basic_code_modules.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.$(OBJEXT)
-src_libbreakpad_a_OBJECTS = $(am_src_libbreakpad_a_OBJECTS)
-src_testing_libtesting_a_AR = $(AR) $(ARFLAGS)
-src_testing_libtesting_a_LIBADD =
-am__src_testing_libtesting_a_SOURCES_DIST = \
- src/breakpad_googletest_includes.h \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc
-@SYSTEM_TEST_LIBS_FALSE@am_src_testing_libtesting_a_OBJECTS = src/testing/gtest/src/src_testing_libtesting_a-gtest-all.$(OBJEXT) \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/gtest/src/src_testing_libtesting_a-gtest_main.$(OBJEXT) \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/src/src_testing_libtesting_a-gmock-all.$(OBJEXT)
-src_testing_libtesting_a_OBJECTS = \
- $(am_src_testing_libtesting_a_OBJECTS)
-src_third_party_libdisasm_libdisasm_a_AR = $(AR) $(ARFLAGS)
-src_third_party_libdisasm_libdisasm_a_LIBADD =
-am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST = \
- src/third_party/libdisasm/ia32_implicit.c \
- src/third_party/libdisasm/ia32_implicit.h \
- src/third_party/libdisasm/ia32_insn.c \
- src/third_party/libdisasm/ia32_insn.h \
- src/third_party/libdisasm/ia32_invariant.c \
- src/third_party/libdisasm/ia32_invariant.h \
- src/third_party/libdisasm/ia32_modrm.c \
- src/third_party/libdisasm/ia32_modrm.h \
- src/third_party/libdisasm/ia32_opcode_tables.c \
- src/third_party/libdisasm/ia32_opcode_tables.h \
- src/third_party/libdisasm/ia32_operand.c \
- src/third_party/libdisasm/ia32_operand.h \
- src/third_party/libdisasm/ia32_reg.c \
- src/third_party/libdisasm/ia32_reg.h \
- src/third_party/libdisasm/ia32_settings.c \
- src/third_party/libdisasm/ia32_settings.h \
- src/third_party/libdisasm/libdis.h \
- src/third_party/libdisasm/qword.h \
- src/third_party/libdisasm/x86_disasm.c \
- src/third_party/libdisasm/x86_format.c \
- src/third_party/libdisasm/x86_imm.c \
- src/third_party/libdisasm/x86_imm.h \
- src/third_party/libdisasm/x86_insn.c \
- src/third_party/libdisasm/x86_misc.c \
- src/third_party/libdisasm/x86_operand_list.c \
- src/third_party/libdisasm/x86_operand_list.h
-@DISABLE_PROCESSOR_FALSE@am_src_third_party_libdisasm_libdisasm_a_OBJECTS = src/third_party/libdisasm/ia32_implicit.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_insn.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_invariant.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_modrm.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_opcode_tables.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_operand.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_reg.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_settings.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_disasm.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_format.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_imm.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_insn.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_misc.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.$(OBJEXT)
-src_third_party_libdisasm_libdisasm_a_OBJECTS = \
- $(am_src_third_party_libdisasm_libdisasm_a_OBJECTS)
-@LINUX_HOST_TRUE@am__EXEEXT_1 = src/client/linux/linux_dumper_unittest_helper$(EXEEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib$(EXEEXT)
-@DISABLE_PROCESSOR_FALSE@am__EXEEXT_2 = src/processor/microdump_stackwalk$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk$(EXEEXT)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_3 = src/tools/linux/core2md/core2md$(EXEEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms$(EXEEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core$(EXEEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload$(EXEEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload$(EXEEXT)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_4 = src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
-@DISABLE_PROCESSOR_FALSE@am__EXEEXT_5 = src/common/test_assembler_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_shrink_down_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest$(EXEEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest$(EXEEXT)
-@LINUX_HOST_TRUE@am__EXEEXT_6 = src/client/linux/linux_client_unittest$(EXEEXT)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am__EXEEXT_7 = src/common/dumper_unittest$(EXEEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@@X86_HOST_TRUE@am__EXEEXT_8 = src/common/mac/macho_reader_unittest$(EXEEXT)
-@DISABLE_PROCESSOR_FALSE@@SELFTEST_TRUE@am__EXEEXT_9 = src/processor/stackwalker_selftest$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-am_src_client_linux_linux_client_unittest_OBJECTS =
-src_client_linux_linux_client_unittest_OBJECTS = \
- $(am_src_client_linux_linux_client_unittest_OBJECTS)
-am__DEPENDENCIES_1 =
-@SYSTEM_TEST_LIBS_FALSE@am__DEPENDENCIES_2 = src/testing/libtesting.a
-@SYSTEM_TEST_LIBS_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \
-@SYSTEM_TEST_LIBS_TRUE@ $(am__DEPENDENCIES_1)
-src_client_linux_linux_client_unittest_LINK = $(CCLD) $(AM_CFLAGS) \
- $(CFLAGS) $(src_client_linux_linux_client_unittest_LDFLAGS) \
- $(LDFLAGS) -o $@
-am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST = \
- src/breakpad_googletest_includes.h \
- src/testing/gtest/src/gtest-all.cc \
- src/testing/gtest/src/gtest_main.cc \
- src/testing/src/gmock-all.cc \
- src/client/linux/handler/exception_handler_unittest.cc \
- src/client/linux/minidump_writer/directory_reader_unittest.cc \
- src/client/linux/minidump_writer/cpu_set_unittest.cc \
- src/client/linux/minidump_writer/line_reader_unittest.cc \
- src/client/linux/minidump_writer/linux_core_dumper.cc \
- src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \
- src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \
- src/client/linux/minidump_writer/minidump_writer_unittest.cc \
- src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \
- src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
- src/common/linux/elf_core_dump.cc \
- src/common/linux/linux_libc_support_unittest.cc \
- src/common/linux/tests/auto_testfile.h \
- src/common/linux/tests/crash_generator.cc \
- src/common/memory_unittest.cc src/common/tests/auto_tempdir.h \
- src/common/tests/file_utils.cc src/common/tests/file_utils.h \
- src/processor/basic_code_modules.cc \
- src/processor/dump_context.cc src/processor/dump_object.cc \
- src/processor/logging.cc src/processor/minidump.cc \
- src/processor/pathname_stripper.cc \
- src/processor/proc_maps_linux.cc \
- src/common/android/breakpad_getcontext.S \
- src/client/linux/microdump_writer/microdump_writer_unittest.cc \
- src/common/android/breakpad_getcontext_unittest.cc
-@SYSTEM_TEST_LIBS_FALSE@am__objects_2 = src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT) \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT) \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT)
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_3 = src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT)
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@am__objects_4 = src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT)
-@LINUX_HOST_TRUE@am_src_client_linux_linux_client_unittest_shlib_OBJECTS = \
-@LINUX_HOST_TRUE@ $(am__objects_2) \
-@LINUX_HOST_TRUE@ src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-logging.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT) \
-@LINUX_HOST_TRUE@ src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT) \
-@LINUX_HOST_TRUE@ $(am__objects_3) \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT) \
-@LINUX_HOST_TRUE@ $(am__objects_4)
-src_client_linux_linux_client_unittest_shlib_OBJECTS = \
- $(am_src_client_linux_linux_client_unittest_shlib_OBJECTS)
-src_client_linux_linux_client_unittest_shlib_LINK = $(CXXLD) \
- $(AM_CXXFLAGS) $(CXXFLAGS) \
- $(src_client_linux_linux_client_unittest_shlib_LDFLAGS) \
- $(LDFLAGS) -o $@
-am__src_client_linux_linux_dumper_unittest_helper_SOURCES_DIST = src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@LINUX_HOST_TRUE@am_src_client_linux_linux_dumper_unittest_helper_OBJECTS = src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.$(OBJEXT)
-src_client_linux_linux_dumper_unittest_helper_OBJECTS = \
- $(am_src_client_linux_linux_dumper_unittest_helper_OBJECTS)
-src_client_linux_linux_dumper_unittest_helper_LDADD = $(LDADD)
-src_client_linux_linux_dumper_unittest_helper_LINK = $(CXXLD) \
- $(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) \
- $(CXXFLAGS) \
- $(src_client_linux_linux_dumper_unittest_helper_LDFLAGS) \
- $(LDFLAGS) -o $@
-am__src_common_dumper_unittest_SOURCES_DIST = \
- src/common/byte_cursor_unittest.cc \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cfi_to_module_unittest.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_cu_to_module_unittest.cc \
- src/common/dwarf_line_to_module.cc \
- src/common/dwarf_line_to_module_unittest.cc \
- src/common/language.cc src/common/memory_range_unittest.cc \
- src/common/module.cc src/common/module_unittest.cc \
- src/common/stabs_reader.cc src/common/stabs_reader_unittest.cc \
- src/common/stabs_to_module.cc \
- src/common/stabs_to_module_unittest.cc \
- src/common/test_assembler.cc src/common/dwarf/bytereader.cc \
- src/common/dwarf/bytereader.h \
- src/common/dwarf/bytereader-inl.h \
- src/common/dwarf/bytereader_unittest.cc \
- src/common/dwarf/cfi_assembler.cc \
- src/common/dwarf/cfi_assembler.h \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2diehandler_unittest.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/dwarf2reader.h src/common/dwarf/elf_reader.cc \
- src/common/dwarf/elf_reader.h \
- src/common/dwarf/dwarf2reader_cfi_unittest.cc \
- src/common/dwarf/dwarf2reader_die_unittest.cc \
- src/common/dwarf/dwarf2reader_test_common.h \
- src/common/linux/crc32.cc src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols_unittest.cc \
- src/common/linux/elf_core_dump.cc \
- src/common/linux/elf_core_dump_unittest.cc \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module_unittest.cc \
- src/common/linux/elfutils.cc src/common/linux/file_id.cc \
- src/common/linux/file_id_unittest.cc \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/memory_mapped_file_unittest.cc \
- src/common/linux/safe_readlink.cc \
- src/common/linux/safe_readlink_unittest.cc \
- src/common/linux/synth_elf.cc \
- src/common/linux/synth_elf_unittest.cc \
- src/common/linux/tests/crash_generator.cc \
- src/common/linux/tests/crash_generator.h \
- src/common/testdata/func-line-pairing.h \
- src/common/tests/file_utils.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_dumper_unittest_OBJECTS = src/common/src_common_dumper_unittest-byte_cursor_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cfi_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cu_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_line_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-language.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-memory_range_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-module_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_reader_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-stabs_to_module_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_dumper_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-bytereader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-cfi_assembler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-elf_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-crc32.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-dump_symbols.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-elf_core_dump.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-elfutils.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-file_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-file_id_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-linux_libc_support.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-memory_mapped_file.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-safe_readlink.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-synth_elf.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/src_common_dumper_unittest-synth_elf_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/src_common_dumper_unittest-crash_generator.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/src_common_dumper_unittest-file_utils.$(OBJEXT)
-src_common_dumper_unittest_OBJECTS = \
- $(am_src_common_dumper_unittest_OBJECTS)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_DEPENDENCIES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
-am__src_common_mac_macho_reader_unittest_SOURCES_DIST = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc src/common/language.cc \
- src/common/md5.cc src/common/module.cc \
- src/common/stabs_reader.cc src/common/stabs_to_module.cc \
- src/common/test_assembler.cc src/common/dwarf/bytereader.cc \
- src/common/dwarf/cfi_assembler.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc \
- src/common/mac/arch_utilities.cc src/common/mac/file_id.cc \
- src/common/mac/macho_id.cc src/common/mac/macho_reader.cc \
- src/common/mac/macho_reader_unittest.cc \
- src/common/mac/macho_utilities.cc \
- src/common/mac/macho_walker.cc src/common/tests/file_utils.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_common_mac_macho_reader_unittest_OBJECTS = src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-language.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-md5.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-stabs_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-stabs_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_common_mac_macho_reader_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-file_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/src_common_mac_macho_reader_unittest-file_utils.$(OBJEXT)
-src_common_mac_macho_reader_unittest_OBJECTS = \
- $(am_src_common_mac_macho_reader_unittest_OBJECTS)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_DEPENDENCIES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
-am__src_common_test_assembler_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc src/common/test_assembler.h \
- src/common/test_assembler_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_common_test_assembler_unittest_OBJECTS = src/common/src_common_test_assembler_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/common/src_common_test_assembler_unittest-test_assembler_unittest.$(OBJEXT)
-src_common_test_assembler_unittest_OBJECTS = \
- $(am_src_common_test_assembler_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_address_map_unittest_SOURCES_DIST = \
- src/processor/address_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_address_map_unittest_OBJECTS = src/processor/address_map_unittest.$(OBJEXT)
-src_processor_address_map_unittest_OBJECTS = \
- $(am_src_processor_address_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
-am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST = \
- src/processor/basic_source_line_resolver_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_basic_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT)
-src_processor_basic_source_line_resolver_unittest_OBJECTS = $(am_src_processor_basic_source_line_resolver_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_DEPENDENCIES = src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_cfi_frame_info_unittest_SOURCES_DIST = \
- src/processor/cfi_frame_info_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_cfi_frame_info_unittest_OBJECTS = src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT)
-src_processor_cfi_frame_info_unittest_OBJECTS = \
- $(am_src_processor_cfi_frame_info_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_contained_range_map_unittest_SOURCES_DIST = \
- src/processor/contained_range_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_contained_range_map_unittest_OBJECTS = src/processor/contained_range_map_unittest.$(OBJEXT)
-src_processor_contained_range_map_unittest_OBJECTS = \
- $(am_src_processor_contained_range_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
-am__src_processor_disassembler_x86_unittest_SOURCES_DIST = \
- src/processor/disassembler_x86_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_disassembler_x86_unittest_OBJECTS = src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT)
-src_processor_disassembler_x86_unittest_OBJECTS = \
- $(am_src_processor_disassembler_x86_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_exploitability_unittest_SOURCES_DIST = \
- src/processor/exploitability_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_exploitability_unittest_OBJECTS = src/processor/src_processor_exploitability_unittest-exploitability_unittest.$(OBJEXT)
-src_processor_exploitability_unittest_OBJECTS = \
- $(am_src_processor_exploitability_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST = \
- src/processor/fast_source_line_resolver_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_fast_source_line_resolver_unittest_OBJECTS = src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT)
-src_processor_fast_source_line_resolver_unittest_OBJECTS = $(am_src_processor_fast_source_line_resolver_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_DEPENDENCIES = src/processor/fast_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_map_serializers_unittest_SOURCES_DIST = \
- src/processor/map_serializers_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_map_serializers_unittest_OBJECTS = src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.$(OBJEXT)
-src_processor_map_serializers_unittest_OBJECTS = \
- $(am_src_processor_map_serializers_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_microdump_processor_unittest_SOURCES_DIST = \
- src/processor/microdump_processor_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_processor_unittest_OBJECTS = src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT)
-src_processor_microdump_processor_unittest_OBJECTS = \
- $(am_src_processor_microdump_processor_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_microdump_stackwalk_SOURCES_DIST = \
- src/processor/microdump_stackwalk.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_microdump_stackwalk_OBJECTS = src/processor/microdump_stackwalk.$(OBJEXT)
-src_processor_microdump_stackwalk_OBJECTS = \
- $(am_src_processor_microdump_stackwalk_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a
-am__src_processor_minidump_dump_SOURCES_DIST = \
- src/processor/minidump_dump.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_dump_OBJECTS = src/processor/minidump_dump.$(OBJEXT)
-src_processor_minidump_dump_OBJECTS = \
- $(am_src_processor_minidump_dump_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o
-am__src_processor_minidump_processor_unittest_SOURCES_DIST = \
- src/processor/minidump_processor_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_processor_unittest_OBJECTS = src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT)
-src_processor_minidump_processor_unittest_OBJECTS = \
- $(am_src_processor_minidump_processor_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_minidump_stackwalk_SOURCES_DIST = \
- src/processor/minidump_stackwalk.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_stackwalk_OBJECTS = src/processor/minidump_stackwalk.$(OBJEXT)
-src_processor_minidump_stackwalk_OBJECTS = \
- $(am_src_processor_minidump_stackwalk_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a
-am__src_processor_minidump_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/minidump_unittest.cc \
- src/processor/synth_minidump.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_minidump_unittest_OBJECTS = src/common/src_processor_minidump_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_minidump_unittest-minidump_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_minidump_unittest-synth_minidump.$(OBJEXT)
-src_processor_minidump_unittest_OBJECTS = \
- $(am_src_processor_minidump_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_pathname_stripper_unittest_SOURCES_DIST = \
- src/processor/pathname_stripper_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_pathname_stripper_unittest_OBJECTS = src/processor/pathname_stripper_unittest.$(OBJEXT)
-src_processor_pathname_stripper_unittest_OBJECTS = \
- $(am_src_processor_pathname_stripper_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_postfix_evaluator_unittest_SOURCES_DIST = \
- src/processor/postfix_evaluator_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_postfix_evaluator_unittest_OBJECTS = src/processor/postfix_evaluator_unittest.$(OBJEXT)
-src_processor_postfix_evaluator_unittest_OBJECTS = \
- $(am_src_processor_postfix_evaluator_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_postfix_evaluator_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_proc_maps_linux_unittest_SOURCES_DIST = \
- src/processor/proc_maps_linux.cc \
- src/processor/proc_maps_linux_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_proc_maps_linux_unittest_OBJECTS = src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.$(OBJEXT)
-src_processor_proc_maps_linux_unittest_OBJECTS = \
- $(am_src_processor_proc_maps_linux_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_range_map_shrink_down_unittest_SOURCES_DIST = \
- src/processor/range_map_shrink_down_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_shrink_down_unittest_OBJECTS = src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.$(OBJEXT)
-src_processor_range_map_shrink_down_unittest_OBJECTS = \
- $(am_src_processor_range_map_shrink_down_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_shrink_down_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_range_map_unittest_SOURCES_DIST = \
- src/processor/range_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_range_map_unittest_OBJECTS = src/processor/range_map_unittest.$(OBJEXT)
-src_processor_range_map_unittest_OBJECTS = \
- $(am_src_processor_range_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_address_list_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_address_list_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_address_list_unittest_OBJECTS = src/common/src_processor_stackwalker_address_list_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT)
-src_processor_stackwalker_address_list_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_address_list_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_amd64_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_amd64_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_amd64_unittest_OBJECTS = src/common/src_processor_stackwalker_amd64_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT)
-src_processor_stackwalker_amd64_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_amd64_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_arm64_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_arm64_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_arm64_unittest_OBJECTS = src/common/src_processor_stackwalker_arm64_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT)
-src_processor_stackwalker_arm64_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_arm64_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_arm_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_arm_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_arm_unittest_OBJECTS = src/common/src_processor_stackwalker_arm_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT)
-src_processor_stackwalker_arm_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_arm_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_mips64_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_mips64_unittest_OBJECTS = src/common/src_processor_stackwalker_mips64_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.$(OBJEXT)
-src_processor_stackwalker_mips64_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_mips64_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_mips_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_mips_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_mips_unittest_OBJECTS = src/common/src_processor_stackwalker_mips_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT)
-src_processor_stackwalker_mips_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_mips_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_selftest_SOURCES_DIST = \
- src/processor/stackwalker_selftest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_selftest_OBJECTS = src/processor/stackwalker_selftest.$(OBJEXT)
-src_processor_stackwalker_selftest_OBJECTS = \
- $(am_src_processor_stackwalker_selftest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_selftest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_stackwalker_x86_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc \
- src/processor/stackwalker_x86_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_stackwalker_x86_unittest_OBJECTS = src/common/src_processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT)
-src_processor_stackwalker_x86_unittest_OBJECTS = \
- $(am_src_processor_stackwalker_x86_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_static_address_map_unittest_SOURCES_DIST = \
- src/processor/static_address_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_address_map_unittest_OBJECTS = src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.$(OBJEXT)
-src_processor_static_address_map_unittest_OBJECTS = \
- $(am_src_processor_static_address_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_static_contained_range_map_unittest_SOURCES_DIST = \
- src/processor/static_contained_range_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_contained_range_map_unittest_OBJECTS = src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT)
-src_processor_static_contained_range_map_unittest_OBJECTS = $(am_src_processor_static_contained_range_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_static_map_unittest_SOURCES_DIST = \
- src/processor/static_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_map_unittest_OBJECTS = src/processor/src_processor_static_map_unittest-static_map_unittest.$(OBJEXT)
-src_processor_static_map_unittest_OBJECTS = \
- $(am_src_processor_static_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_static_range_map_unittest_SOURCES_DIST = \
- src/processor/static_range_map_unittest.cc
-@DISABLE_PROCESSOR_FALSE@am_src_processor_static_range_map_unittest_OBJECTS = src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.$(OBJEXT)
-src_processor_static_range_map_unittest_OBJECTS = \
- $(am_src_processor_static_range_map_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_processor_synth_minidump_unittest_SOURCES_DIST = \
- src/common/test_assembler.cc src/common/test_assembler.h \
- src/processor/synth_minidump_unittest.cc \
- src/processor/synth_minidump.cc src/processor/synth_minidump.h
-@DISABLE_PROCESSOR_FALSE@am_src_processor_synth_minidump_unittest_OBJECTS = src/common/src_processor_synth_minidump_unittest-test_assembler.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.$(OBJEXT) \
-@DISABLE_PROCESSOR_FALSE@ src/processor/src_processor_synth_minidump_unittest-synth_minidump.$(OBJEXT)
-src_processor_synth_minidump_unittest_OBJECTS = \
- $(am_src_processor_synth_minidump_unittest_OBJECTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_DEPENDENCIES = \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_2) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1) \
-@DISABLE_PROCESSOR_FALSE@ $(am__DEPENDENCIES_1)
-am__src_tools_linux_core2md_core2md_SOURCES_DIST = \
- src/tools/linux/core2md/core2md.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_core2md_core2md_OBJECTS = src/tools/linux/core2md/core2md.$(OBJEXT)
-src_tools_linux_core2md_core2md_OBJECTS = \
- $(am_src_tools_linux_core2md_core2md_OBJECTS)
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_DEPENDENCIES = src/client/linux/libbreakpad_client.a
-am__src_tools_linux_dump_syms_dump_syms_SOURCES_DIST = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc src/common/language.cc \
- src/common/module.cc src/common/stabs_reader.cc \
- src/common/stabs_to_module.cc src/common/dwarf/bytereader.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols.h \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module.h \
- src/common/linux/elfutils.cc src/common/linux/file_id.cc \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/safe_readlink.cc \
- src/tools/linux/dump_syms/dump_syms.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_dump_syms_dump_syms_OBJECTS = src/common/dwarf_cfi_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms.$(OBJEXT)
-src_tools_linux_dump_syms_dump_syms_OBJECTS = \
- $(am_src_tools_linux_dump_syms_dump_syms_OBJECTS)
-src_tools_linux_dump_syms_dump_syms_LDADD = $(LDADD)
-am__src_tools_linux_md2core_minidump_2_core_SOURCES_DIST = \
- src/common/linux/memory_mapped_file.cc \
- src/tools/linux/md2core/minidump-2-core.cc \
- src/tools/linux/md2core/minidump_memory_range.h
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_OBJECTS = src/common/linux/memory_mapped_file.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.$(OBJEXT)
-src_tools_linux_md2core_minidump_2_core_OBJECTS = \
- $(am_src_tools_linux_md2core_minidump_2_core_OBJECTS)
-src_tools_linux_md2core_minidump_2_core_LDADD = $(LDADD)
-am__src_tools_linux_md2core_minidump_2_core_unittest_SOURCES_DIST = \
- src/tools/linux/md2core/minidump_memory_range_unittest.cc
-@LINUX_HOST_TRUE@am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT)
-src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS = $(am_src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS)
-@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_DEPENDENCIES = \
-@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
-@LINUX_HOST_TRUE@ $(am__DEPENDENCIES_1)
-am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST = \
- src/common/linux/http_upload.cc \
- src/tools/linux/symupload/minidump_upload.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_minidump_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload.$(OBJEXT)
-src_tools_linux_symupload_minidump_upload_OBJECTS = \
- $(am_src_tools_linux_symupload_minidump_upload_OBJECTS)
-src_tools_linux_symupload_minidump_upload_DEPENDENCIES =
-am__src_tools_linux_symupload_sym_upload_SOURCES_DIST = \
- src/common/linux/http_upload.cc src/common/linux/http_upload.h \
- src/common/linux/symbol_upload.cc \
- src/common/linux/symbol_upload.h \
- src/tools/linux/symupload/sym_upload.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_linux_symupload_sym_upload_OBJECTS = src/common/linux/http_upload.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.$(OBJEXT)
-src_tools_linux_symupload_sym_upload_OBJECTS = \
- $(am_src_tools_linux_symupload_sym_upload_OBJECTS)
-src_tools_linux_symupload_sym_upload_DEPENDENCIES =
-am__src_tools_mac_dump_syms_dump_syms_mac_SOURCES_DIST = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc src/common/language.cc \
- src/common/md5.cc src/common/module.cc \
- src/common/stabs_reader.cc src/common/stabs_to_module.cc \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc \
- src/common/mac/arch_utilities.cc src/common/mac/dump_syms.cc \
- src/common/mac/dump_syms.h src/common/mac/file_id.cc \
- src/common/mac/file_id.h src/common/mac/macho_id.cc \
- src/common/mac/macho_id.h src/common/mac/macho_reader.cc \
- src/common/mac/macho_reader.h \
- src/common/mac/macho_utilities.cc \
- src/common/mac/macho_utilities.h \
- src/common/mac/macho_walker.cc src/common/mac/macho_walker.h \
- src/tools/mac/dump_syms/dump_syms_tool.cc
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-language.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.$(OBJEXT) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.$(OBJEXT)
-src_tools_mac_dump_syms_dump_syms_mac_OBJECTS = \
- $(am_src_tools_mac_dump_syms_dump_syms_mac_OBJECTS)
-src_tools_mac_dump_syms_dump_syms_mac_LDADD = $(LDADD)
-src_tools_mac_dump_syms_dump_syms_mac_LINK = $(CXXLD) \
- $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SCRIPTS = $(noinst_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 =
-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
-depcomp = $(SHELL) $(top_srcdir)/autotools/depcomp
-am__depfiles_maybe = depfiles
-am__mv = mv -f
-AM_V_lt = $(am__v_lt_@AM_V@)
-am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
-am__v_lt_0 = --silent
-am__v_lt_1 =
-CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS)
-AM_V_CPPAS = $(am__v_CPPAS_@AM_V@)
-am__v_CPPAS_ = $(am__v_CPPAS_@AM_DEFAULT_V@)
-am__v_CPPAS_0 = @echo " CPPAS " $@;
-am__v_CPPAS_1 =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-AM_V_CC = $(am__v_CC_@AM_V@)
-am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
-am__v_CC_0 = @echo " CC " $@;
-am__v_CC_1 =
-CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
-AM_V_CCLD = $(am__v_CCLD_@AM_V@)
-am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
-am__v_CCLD_0 = @echo " CCLD " $@;
-am__v_CCLD_1 =
-CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
-AM_V_CXX = $(am__v_CXX_@AM_V@)
-am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
-am__v_CXX_0 = @echo " CXX " $@;
-am__v_CXX_1 =
-CXXLD = $(CXX)
-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \
- -o $@
-AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
-am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
-am__v_CXXLD_0 = @echo " CXXLD " $@;
-am__v_CXXLD_1 =
-SOURCES = $(src_client_linux_libbreakpad_client_a_SOURCES) \
- $(src_libbreakpad_a_SOURCES) \
- $(src_testing_libtesting_a_SOURCES) \
- $(src_third_party_libdisasm_libdisasm_a_SOURCES) \
- $(src_client_linux_linux_client_unittest_SOURCES) \
- $(src_client_linux_linux_client_unittest_shlib_SOURCES) \
- $(src_client_linux_linux_dumper_unittest_helper_SOURCES) \
- $(src_common_dumper_unittest_SOURCES) \
- $(src_common_mac_macho_reader_unittest_SOURCES) \
- $(src_common_test_assembler_unittest_SOURCES) \
- $(src_processor_address_map_unittest_SOURCES) \
- $(src_processor_basic_source_line_resolver_unittest_SOURCES) \
- $(src_processor_cfi_frame_info_unittest_SOURCES) \
- $(src_processor_contained_range_map_unittest_SOURCES) \
- $(src_processor_disassembler_x86_unittest_SOURCES) \
- $(src_processor_exploitability_unittest_SOURCES) \
- $(src_processor_fast_source_line_resolver_unittest_SOURCES) \
- $(src_processor_map_serializers_unittest_SOURCES) \
- $(src_processor_microdump_processor_unittest_SOURCES) \
- $(src_processor_microdump_stackwalk_SOURCES) \
- $(src_processor_minidump_dump_SOURCES) \
- $(src_processor_minidump_processor_unittest_SOURCES) \
- $(src_processor_minidump_stackwalk_SOURCES) \
- $(src_processor_minidump_unittest_SOURCES) \
- $(src_processor_pathname_stripper_unittest_SOURCES) \
- $(src_processor_postfix_evaluator_unittest_SOURCES) \
- $(src_processor_proc_maps_linux_unittest_SOURCES) \
- $(src_processor_range_map_shrink_down_unittest_SOURCES) \
- $(src_processor_range_map_unittest_SOURCES) \
- $(src_processor_stackwalker_address_list_unittest_SOURCES) \
- $(src_processor_stackwalker_amd64_unittest_SOURCES) \
- $(src_processor_stackwalker_arm64_unittest_SOURCES) \
- $(src_processor_stackwalker_arm_unittest_SOURCES) \
- $(src_processor_stackwalker_mips64_unittest_SOURCES) \
- $(src_processor_stackwalker_mips_unittest_SOURCES) \
- $(src_processor_stackwalker_selftest_SOURCES) \
- $(src_processor_stackwalker_x86_unittest_SOURCES) \
- $(src_processor_static_address_map_unittest_SOURCES) \
- $(src_processor_static_contained_range_map_unittest_SOURCES) \
- $(src_processor_static_map_unittest_SOURCES) \
- $(src_processor_static_range_map_unittest_SOURCES) \
- $(src_processor_synth_minidump_unittest_SOURCES) \
- $(src_tools_linux_core2md_core2md_SOURCES) \
- $(src_tools_linux_dump_syms_dump_syms_SOURCES) \
- $(src_tools_linux_md2core_minidump_2_core_SOURCES) \
- $(src_tools_linux_md2core_minidump_2_core_unittest_SOURCES) \
- $(src_tools_linux_symupload_minidump_upload_SOURCES) \
- $(src_tools_linux_symupload_sym_upload_SOURCES) \
- $(src_tools_mac_dump_syms_dump_syms_mac_SOURCES)
-DIST_SOURCES = \
- $(am__src_client_linux_libbreakpad_client_a_SOURCES_DIST) \
- $(am__src_libbreakpad_a_SOURCES_DIST) \
- $(am__src_testing_libtesting_a_SOURCES_DIST) \
- $(am__src_third_party_libdisasm_libdisasm_a_SOURCES_DIST) \
- $(src_client_linux_linux_client_unittest_SOURCES) \
- $(am__src_client_linux_linux_client_unittest_shlib_SOURCES_DIST) \
- $(am__src_client_linux_linux_dumper_unittest_helper_SOURCES_DIST) \
- $(am__src_common_dumper_unittest_SOURCES_DIST) \
- $(am__src_common_mac_macho_reader_unittest_SOURCES_DIST) \
- $(am__src_common_test_assembler_unittest_SOURCES_DIST) \
- $(am__src_processor_address_map_unittest_SOURCES_DIST) \
- $(am__src_processor_basic_source_line_resolver_unittest_SOURCES_DIST) \
- $(am__src_processor_cfi_frame_info_unittest_SOURCES_DIST) \
- $(am__src_processor_contained_range_map_unittest_SOURCES_DIST) \
- $(am__src_processor_disassembler_x86_unittest_SOURCES_DIST) \
- $(am__src_processor_exploitability_unittest_SOURCES_DIST) \
- $(am__src_processor_fast_source_line_resolver_unittest_SOURCES_DIST) \
- $(am__src_processor_map_serializers_unittest_SOURCES_DIST) \
- $(am__src_processor_microdump_processor_unittest_SOURCES_DIST) \
- $(am__src_processor_microdump_stackwalk_SOURCES_DIST) \
- $(am__src_processor_minidump_dump_SOURCES_DIST) \
- $(am__src_processor_minidump_processor_unittest_SOURCES_DIST) \
- $(am__src_processor_minidump_stackwalk_SOURCES_DIST) \
- $(am__src_processor_minidump_unittest_SOURCES_DIST) \
- $(am__src_processor_pathname_stripper_unittest_SOURCES_DIST) \
- $(am__src_processor_postfix_evaluator_unittest_SOURCES_DIST) \
- $(am__src_processor_proc_maps_linux_unittest_SOURCES_DIST) \
- $(am__src_processor_range_map_shrink_down_unittest_SOURCES_DIST) \
- $(am__src_processor_range_map_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_address_list_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_amd64_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_arm64_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_arm_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_mips64_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_mips_unittest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_selftest_SOURCES_DIST) \
- $(am__src_processor_stackwalker_x86_unittest_SOURCES_DIST) \
- $(am__src_processor_static_address_map_unittest_SOURCES_DIST) \
- $(am__src_processor_static_contained_range_map_unittest_SOURCES_DIST) \
- $(am__src_processor_static_map_unittest_SOURCES_DIST) \
- $(am__src_processor_static_range_map_unittest_SOURCES_DIST) \
- $(am__src_processor_synth_minidump_unittest_SOURCES_DIST) \
- $(am__src_tools_linux_core2md_core2md_SOURCES_DIST) \
- $(am__src_tools_linux_dump_syms_dump_syms_SOURCES_DIST) \
- $(am__src_tools_linux_md2core_minidump_2_core_SOURCES_DIST) \
- $(am__src_tools_linux_md2core_minidump_2_core_unittest_SOURCES_DIST) \
- $(am__src_tools_linux_symupload_minidump_upload_SOURCES_DIST) \
- $(am__src_tools_linux_symupload_sym_upload_SOURCES_DIST) \
- $(am__src_tools_mac_dump_syms_dump_syms_mac_SOURCES_DIST)
-am__can_run_installinfo = \
- case $$AM_UPDATE_INFO_DIR in \
- n|no|NO) false;; \
- *) (install-info --version) >/dev/null 2>&1;; \
- esac
-DATA = $(dist_doc_DATA) $(pkgconfig_DATA)
-am__includecl_HEADERS_DIST = $(top_srcdir)/src/common/linux/*.h
-am__includeclc_HEADERS_DIST = \
- $(top_srcdir)/src/client/linux/crash_generation/*.h
-am__includecldwc_HEADERS_DIST = \
- $(top_srcdir)/src/client/linux/dump_writer_common/*.h
-am__includeclh_HEADERS_DIST = \
- $(top_srcdir)/src/client/linux/handler/*.h
-am__includeclm_HEADERS_DIST = \
- $(top_srcdir)/src/client/linux/minidump_writer/*.h
-am__includelss_HEADERS_DIST = $(top_srcdir)/src/third_party/lss/*.h
-HEADERS = $(includec_HEADERS) $(includecl_HEADERS) \
- $(includeclc_HEADERS) $(includecldwc_HEADERS) \
- $(includeclh_HEADERS) $(includeclm_HEADERS) \
- $(includegbc_HEADERS) $(includelss_HEADERS) \
- $(includep_HEADERS)
-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
-AM_RECURSIVE_TARGETS = cscope check recheck
-am__tty_colors_dummy = \
- mgn= red= grn= lgn= blu= brg= std=; \
- am__color_tests=no
-am__tty_colors = { \
- $(am__tty_colors_dummy); \
- if test "X$(AM_COLOR_TESTS)" = Xno; then \
- am__color_tests=no; \
- elif test "X$(AM_COLOR_TESTS)" = Xalways; then \
- am__color_tests=yes; \
- elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \
- am__color_tests=yes; \
- fi; \
- if test $$am__color_tests = yes; then \
- red=''; \
- grn=''; \
- lgn=''; \
- blu=''; \
- mgn=''; \
- brg=''; \
- std=''; \
- fi; \
-}
-am__recheck_rx = ^[ ]*:recheck:[ ]*
-am__global_test_result_rx = ^[ ]*:global-test-result:[ ]*
-am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]*
-# A command that, given a newline-separated list of test names on the
-# standard input, print the name of the tests that are to be re-run
-# upon "make recheck".
-am__list_recheck_tests = $(AWK) '{ \
- recheck = 1; \
- while ((rc = (getline line < ($$0 ".trs"))) != 0) \
- { \
- if (rc < 0) \
- { \
- if ((getline line2 < ($$0 ".log")) < 0) \
- recheck = 0; \
- break; \
- } \
- else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
- { \
- recheck = 0; \
- break; \
- } \
- else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
- { \
- break; \
- } \
- }; \
- if (recheck) \
- print $$0; \
- close ($$0 ".trs"); \
- close ($$0 ".log"); \
-}'
-# A command that, given a newline-separated list of test names on the
-# standard input, create the global log from their .trs and .log files.
-am__create_global_log = $(AWK) ' \
-function fatal(msg) \
-{ \
- print "fatal: making $@: " msg | "cat >&2"; \
- exit 1; \
-} \
-function rst_section(header) \
-{ \
- print header; \
- len = length(header); \
- for (i = 1; i <= len; i = i + 1) \
- printf "="; \
- printf "\n\n"; \
-} \
-{ \
- copy_in_global_log = 1; \
- global_test_result = "RUN"; \
- while ((rc = (getline line < ($$0 ".trs"))) != 0) \
- { \
- if (rc < 0) \
- fatal("failed to read from " $$0 ".trs"); \
- if (line ~ /$(am__global_test_result_rx)/) \
- { \
- sub("$(am__global_test_result_rx)", "", line); \
- sub("[ ]*$$", "", line); \
- global_test_result = line; \
- } \
- else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
- copy_in_global_log = 0; \
- }; \
- if (copy_in_global_log) \
- { \
- rst_section(global_test_result ": " $$0); \
- while ((rc = (getline line < ($$0 ".log"))) != 0) \
- { \
- if (rc < 0) \
- fatal("failed to read from " $$0 ".log"); \
- print line; \
- }; \
- printf "\n"; \
- }; \
- close ($$0 ".trs"); \
- close ($$0 ".log"); \
-}'
-# Restructured Text title.
-am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
-# Solaris 10 'make', and several other traditional 'make' implementations,
-# pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it
-# by disabling -e (using the XSI extension "set +e") if it's set.
-am__sh_e_setup = case $$- in *e*) set +e;; esac
-# Default flags passed to test drivers.
-am__common_driver_flags = \
- --color-tests "$$am__color_tests" \
- --enable-hard-errors "$$am__enable_hard_errors" \
- --expect-failure "$$am__expect_failure"
-# To be inserted before the command running the test. Creates the
-# directory for the log if needed. Stores in $dir the directory
-# containing $f, in $tst the test, in $log the log. Executes the
-# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
-# passes TESTS_ENVIRONMENT. Set up options for the wrapper that
-# will run the test scripts (or their associated LOG_COMPILER, if
-# thy have one).
-am__check_pre = \
-$(am__sh_e_setup); \
-$(am__vpath_adj_setup) $(am__vpath_adj) \
-$(am__tty_colors); \
-srcdir=$(srcdir); export srcdir; \
-case "$@" in \
- */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \
- *) am__odir=.;; \
-esac; \
-test "x$$am__odir" = x"." || test -d "$$am__odir" \
- || $(MKDIR_P) "$$am__odir" || exit $$?; \
-if test -f "./$$f"; then dir=./; \
-elif test -f "$$f"; then dir=; \
-else dir="$(srcdir)/"; fi; \
-tst=$$dir$$f; log='$@'; \
-if test -n '$(DISABLE_HARD_ERRORS)'; then \
- am__enable_hard_errors=no; \
-else \
- am__enable_hard_errors=yes; \
-fi; \
-case " $(XFAIL_TESTS) " in \
- *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \
- am__expect_failure=yes;; \
- *) \
- am__expect_failure=no;; \
-esac; \
-$(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)
-# A shell command to get the names of the tests scripts with any registered
-# extension removed (i.e., equivalently, the names of the test logs, with
-# the '.log' extension removed). The result is saved in the shell variable
-# '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly,
-# we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)",
-# since that might cause problem with VPATH rewrites for suffix-less tests.
-# See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'.
-am__set_TESTS_bases = \
- bases='$(TEST_LOGS)'; \
- bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
- bases=`echo $$bases`
-RECHECK_LOGS = $(TEST_LOGS)
-TEST_SUITE_LOG = test-suite.log
-TEST_EXTENSIONS = @EXEEXT@ .test
-LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)
-am__set_b = \
- case '$@' in \
- */*) \
- case '$*' in \
- */*) b='$*';; \
- *) b=`echo '$@' | sed 's/\.log$$//'`; \
- esac;; \
- *) \
- b='$*';; \
- esac
-am__test_logs1 = $(TESTS:=.log)
-am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log)
-TEST_LOGS = $(am__test_logs2:.test.log=.log)
-TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/autotools/test-driver
-TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
- $(TEST_LOG_FLAGS)
-am__DIST_COMMON = $(srcdir)/Makefile.in \
- $(srcdir)/breakpad-client.pc.in $(srcdir)/breakpad.pc.in \
- $(top_srcdir)/autotools/ar-lib $(top_srcdir)/autotools/compile \
- $(top_srcdir)/autotools/config.guess \
- $(top_srcdir)/autotools/config.sub \
- $(top_srcdir)/autotools/depcomp \
- $(top_srcdir)/autotools/install-sh \
- $(top_srcdir)/autotools/missing \
- $(top_srcdir)/autotools/test-driver \
- $(top_srcdir)/src/config.h.in AUTHORS ChangeLog INSTALL NEWS \
- autotools/ar-lib autotools/compile autotools/config.guess \
- autotools/config.sub autotools/depcomp autotools/install-sh \
- autotools/ltmain.sh autotools/missing
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
-am__remove_distdir = \
- if test -d "$(distdir)"; then \
- find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -rf "$(distdir)" \
- || { sleep 5 && rm -rf "$(distdir)"; }; \
- else :; fi
-am__post_remove_distdir = $(am__remove_distdir)
-DIST_ARCHIVES = $(distdir).tar.gz
-GZIP_ENV = --best
-DIST_TARGETS = dist-gzip
-distuninstallcheck_listfiles = find . -type f -print
-am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
- | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
-distcleancheck_listfiles = find . -type f -print
-ACLOCAL = @ACLOCAL@
-AMTAR = @AMTAR@
-AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASDEPMODE = @CCASDEPMODE@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXDEPMODE = @CXXDEPMODE@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-GMOCK_CFLAGS = @GMOCK_CFLAGS@
-GMOCK_CONFIG = @GMOCK_CONFIG@
-GMOCK_LIBS = @GMOCK_LIBS@
-GREP = @GREP@
-GTEST_CFLAGS = @GTEST_CFLAGS@
-GTEST_CONFIG = @GTEST_CONFIG@
-GTEST_LIBS = @GTEST_LIBS@
-HAVE_CXX11 = @HAVE_CXX11@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_URL = @PACKAGE_URL@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PTHREAD_CC = @PTHREAD_CC@
-PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
-PTHREAD_LIBS = @PTHREAD_LIBS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-ax_pthread_config = @ax_pthread_config@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = $(prefix)/share/doc/$(PACKAGE)-$(VERSION)
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_build_prefix = @top_build_prefix@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-
-# This allows #includes to be relative to src/
-AM_CPPFLAGS = -I$(top_srcdir)/src
-AM_CFLAGS = $(am__append_3)
-AM_CXXFLAGS = $(am__append_1) $(am__append_2) $(am__append_4)
-
-# Specify include paths for ac macros
-ACLOCAL_AMFLAGS = -I m4
-
-# License file is called LICENSE not COPYING
-AUTOMAKE_OPTIONS = foreign
-dist_doc_DATA = \
- AUTHORS \
- ChangeLog \
- INSTALL \
- LICENSE \
- NEWS \
- README.md
-
-@LINUX_HOST_TRUE@includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler
-@LINUX_HOST_TRUE@includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h
-@LINUX_HOST_TRUE@includecldwcdir = $(includedir)/$(PACKAGE)/client/linux/dump_writer_common
-@LINUX_HOST_TRUE@includecldwc_HEADERS = $(top_srcdir)/src/client/linux/dump_writer_common/*.h
-@LINUX_HOST_TRUE@includeclmdir = $(includedir)/$(PACKAGE)/client/linux/minidump_writer
-@LINUX_HOST_TRUE@includeclm_HEADERS = $(top_srcdir)/src/client/linux/minidump_writer/*.h
-@LINUX_HOST_TRUE@includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation
-@LINUX_HOST_TRUE@includeclc_HEADERS = $(top_srcdir)/src/client/linux/crash_generation/*.h
-@LINUX_HOST_TRUE@includelssdir = $(includedir)/$(PACKAGE)/third_party/lss
-@LINUX_HOST_TRUE@includelss_HEADERS = $(top_srcdir)/src/third_party/lss/*.h
-@LINUX_HOST_TRUE@includecldir = $(includedir)/$(PACKAGE)/common/linux
-@LINUX_HOST_TRUE@includecl_HEADERS = $(top_srcdir)/src/common/linux/*.h
-includegbcdir = $(includedir)/$(PACKAGE)/google_breakpad/common
-includegbc_HEADERS = $(top_srcdir)/src/google_breakpad/common/*.h
-includecdir = $(includedir)/$(PACKAGE)/common
-includec_HEADERS = $(top_srcdir)/src/common/*.h
-includepdir = $(includedir)/$(PACKAGE)/processor
-includep_HEADERS = $(top_srcdir)/src/processor/*.h
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = $(am__append_6) $(am__append_9)
-@SYSTEM_TEST_LIBS_FALSE@TEST_CFLAGS = \
-@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/include \
-@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/gtest/include \
-@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing/gtest \
-@SYSTEM_TEST_LIBS_FALSE@ -I$(top_srcdir)/src/testing
-
-@SYSTEM_TEST_LIBS_TRUE@TEST_CFLAGS = $(GTEST_CFLAGS) $(GMOCK_CFLAGS)
-@SYSTEM_TEST_LIBS_FALSE@TEST_LIBS = src/testing/libtesting.a
-@SYSTEM_TEST_LIBS_TRUE@TEST_LIBS = $(GTEST_LIBS) -lgtest_main $(GMOCK_LIBS)
-@SYSTEM_TEST_LIBS_FALSE@TEST_DEPS = $(TEST_LIBS)
-@SYSTEM_TEST_LIBS_TRUE@TEST_DEPS =
-check_LIBRARIES = src/testing/libtesting.a
-noinst_LIBRARIES = $(am__append_7)
-lib_LIBRARIES = $(am__append_5) $(am__append_8)
-CLEANFILES = $(am__append_13)
-@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_SOURCES = \
-@SYSTEM_TEST_LIBS_FALSE@ src/breakpad_googletest_includes.h \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/gtest/src/gtest-all.cc \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/gtest/src/gtest_main.cc \
-@SYSTEM_TEST_LIBS_FALSE@ src/testing/src/gmock-all.cc
-
-@SYSTEM_TEST_LIBS_FALSE@src_testing_libtesting_a_CPPFLAGS = \
-@SYSTEM_TEST_LIBS_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@LINUX_HOST_TRUE@src_client_linux_libbreakpad_client_a_SOURCES = src/client/linux/crash_generation/crash_generation_client.cc \
-@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_server.cc \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.cc \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.cc \
-@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.cc \
-@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.h \
-@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.cc \
-@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.h \
-@LINUX_HOST_TRUE@ src/client/linux/log/log.cc \
-@LINUX_HOST_TRUE@ src/client/linux/log/log.h \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.cc \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.h \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.cc \
-@LINUX_HOST_TRUE@ src/client/minidump_file_writer-inl.h \
-@LINUX_HOST_TRUE@ src/client/minidump_file_writer.cc \
-@LINUX_HOST_TRUE@ src/client/minidump_file_writer.h \
-@LINUX_HOST_TRUE@ src/common/convert_UTF.c \
-@LINUX_HOST_TRUE@ src/common/convert_UTF.h src/common/md5.cc \
-@LINUX_HOST_TRUE@ src/common/md5.h \
-@LINUX_HOST_TRUE@ src/common/string_conversion.cc \
-@LINUX_HOST_TRUE@ src/common/string_conversion.h \
-@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \
-@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \
-@LINUX_HOST_TRUE@ src/common/linux/elfutils.h \
-@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \
-@LINUX_HOST_TRUE@ src/common/linux/file_id.h \
-@LINUX_HOST_TRUE@ src/common/linux/guid_creator.cc \
-@LINUX_HOST_TRUE@ src/common/linux/guid_creator.h \
-@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \
-@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \
-@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \
-@LINUX_HOST_TRUE@ $(am__append_10)
-@DISABLE_PROCESSOR_FALSE@src_libbreakpad_a_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/breakpad_types.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/minidump_format.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/common/minidump_size.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/basic_source_line_resolver.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/call_stack.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/code_module.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/code_modules.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/dump_context.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/dump_object.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/exploitability.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/fast_source_line_resolver.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/memory_region.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/microdump.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/microdump_processor.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/minidump.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/minidump_processor.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/process_result.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/process_state.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/proc_maps_linux.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/source_line_resolver_base.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/source_line_resolver_interface.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame_cpu.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stack_frame_symbolizer.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/stackwalker.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/symbol_supplier.h \
-@DISABLE_PROCESSOR_FALSE@ src/google_breakpad/processor/system_info.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/address_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/address_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_module.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_types.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_types.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/linked_ptr.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_factory.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_serializer-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_serializer.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/windows_frame_info.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base_types.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_iterator-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_iterator.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map-inl.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.h
-
-@DISABLE_PROCESSOR_FALSE@src_third_party_libdisasm_libdisasm_a_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_implicit.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_implicit.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_insn.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_insn.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_invariant.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_invariant.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_modrm.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_modrm.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_opcode_tables.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_opcode_tables.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_operand.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_operand.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_reg.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_reg.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_settings.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/ia32_settings.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdis.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/qword.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_disasm.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_format.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_imm.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_imm.h \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_insn.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_misc.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.c \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/x86_operand_list.h
-
-@DISABLE_PROCESSOR_FALSE@check_SCRIPTS = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_test \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk_machine_readable_test \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump_test \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_test \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk_machine_readable_test
-
-TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
-# The default Autotools test driver script.
-@ANDROID_HOST_FALSE@LOG_DRIVER = $(top_srcdir)/autotools/test-driver
-
-# Since Autotools 1.2, tests are run through a special "test driver" script.
-# Unfortunately, it's not possible anymore to specify an alternative shell to
-# run them on connected devices, so use a slightly modified version of the
-# driver for Android.
-@ANDROID_HOST_TRUE@LOG_DRIVER = $(top_srcdir)/android/test-driver
-@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_SOURCES = \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-
-@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_LDFLAGS = $(PTHREAD_CFLAGS)
-@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CC = $(PTHREAD_CC)
-@ANDROID_HOST_FALSE@@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(PTHREAD_CFLAGS)
-# On Android PTHREAD_CFLAGS is empty, and adding src/common/android/include
-# to the include path is necessary to build this program.
-@ANDROID_HOST_TRUE@@LINUX_HOST_TRUE@src_client_linux_linux_dumper_unittest_helper_CXXFLAGS = $(AM_CXXFLAGS)
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_SOURCES = \
-@LINUX_HOST_TRUE@ $(src_testing_libtesting_a_SOURCES) \
-@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/directory_reader_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/cpu_set_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/line_reader_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_core_dumper_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc \
-@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \
-@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support_unittest.cc \
-@LINUX_HOST_TRUE@ src/common/linux/tests/auto_testfile.h \
-@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.cc \
-@LINUX_HOST_TRUE@ src/common/memory_unittest.cc \
-@LINUX_HOST_TRUE@ src/common/tests/auto_tempdir.h \
-@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc \
-@LINUX_HOST_TRUE@ src/common/tests/file_utils.h \
-@LINUX_HOST_TRUE@ src/processor/basic_code_modules.cc \
-@LINUX_HOST_TRUE@ src/processor/dump_context.cc \
-@LINUX_HOST_TRUE@ src/processor/dump_object.cc \
-@LINUX_HOST_TRUE@ src/processor/logging.cc \
-@LINUX_HOST_TRUE@ src/processor/minidump.cc \
-@LINUX_HOST_TRUE@ src/processor/pathname_stripper.cc \
-@LINUX_HOST_TRUE@ src/processor/proc_maps_linux.cc \
-@LINUX_HOST_TRUE@ $(am__append_21) \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer_unittest.cc \
-@LINUX_HOST_TRUE@ $(am__append_22)
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_CPPFLAGS = \
-@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDFLAGS = \
-@LINUX_HOST_TRUE@ -shared -Wl,-h,linux_client_unittest_shlib \
-@LINUX_HOST_TRUE@ $(am__append_23)
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_LDADD = \
-@LINUX_HOST_TRUE@ src/client/linux/crash_generation/crash_generation_client.o \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/thread_info.o \
-@LINUX_HOST_TRUE@ src/client/linux/dump_writer_common/ucontext_reader.o \
-@LINUX_HOST_TRUE@ src/client/linux/handler/exception_handler.o \
-@LINUX_HOST_TRUE@ src/client/linux/handler/minidump_descriptor.o \
-@LINUX_HOST_TRUE@ src/client/linux/log/log.o \
-@LINUX_HOST_TRUE@ src/client/linux/microdump_writer/microdump_writer.o \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_dumper.o \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/linux_ptrace_dumper.o \
-@LINUX_HOST_TRUE@ src/client/linux/minidump_writer/minidump_writer.o \
-@LINUX_HOST_TRUE@ src/client/minidump_file_writer.o \
-@LINUX_HOST_TRUE@ src/common/convert_UTF.o \
-@LINUX_HOST_TRUE@ src/common/md5.o \
-@LINUX_HOST_TRUE@ src/common/linux/elfutils.o \
-@LINUX_HOST_TRUE@ src/common/linux/file_id.o \
-@LINUX_HOST_TRUE@ src/common/linux/guid_creator.o \
-@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.o \
-@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.o \
-@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.o \
-@LINUX_HOST_TRUE@ src/common/string_conversion.o \
-@LINUX_HOST_TRUE@ $(TEST_LIBS) \
-@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_shlib_DEPENDENCIES = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_dumper_unittest_helper \
-@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a \
-@LINUX_HOST_TRUE@ $(TEST_DEPS) \
-@LINUX_HOST_TRUE@ src/libbreakpad.a
-
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_SOURCES =
-# The extra-long build id is for a test in minidump_writer_unittest.cc.
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDFLAGS = \
-@LINUX_HOST_TRUE@ -Wl,-rpath,'$$ORIGIN' \
-@LINUX_HOST_TRUE@ -Wl,--build-id=0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f \
-@LINUX_HOST_TRUE@ $(am__append_24)
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_LDADD = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib \
-@LINUX_HOST_TRUE@ $(TEST_LIBS)
-
-@LINUX_HOST_TRUE@src_client_linux_linux_client_unittest_DEPENDENCIES = \
-@LINUX_HOST_TRUE@ src/client/linux/linux_client_unittest_shlib
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/core2md/core2md.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_core2md_core2md_LDADD = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/client/linux/libbreakpad_client.a
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_dump_syms_dump_syms_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/dump_syms/dump_syms.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump-2-core.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_memory_range.h
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/minidump_upload.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_minidump_upload_LDADD = -ldl
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/http_upload.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/symbol_upload.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/linux/symupload/sym_upload.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_linux_symupload_sym_upload_LDADD = -ldl
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/md5.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/arch_utilities.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/dump_syms.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/dump_syms.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/tools/mac/dump_syms/dump_syms_tool.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/byte_cursor_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/memory_range_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/test_assembler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader-inl.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_cfi_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_die_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader_test_common.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/crc32.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/dump_symbols_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_core_dump_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elf_symbols_to_module_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/elfutils.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/file_id_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/linux_libc_support.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/memory_mapped_file_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/safe_readlink_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/synth_elf.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/synth_elf_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/linux/tests/crash_generator.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/testdata/func-line-pairing.h \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_CPPFLAGS = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS)
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_dumper_unittest_LDADD = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_SOURCES = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cfi_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_cu_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf_line_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/language.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/md5.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/stabs_to_module.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/test_assembler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/bytereader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/cfi_assembler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2diehandler.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/dwarf2reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/dwarf/elf_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/arch_utilities.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/file_id.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_id.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_reader_unittest.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_utilities.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/mac/macho_walker.cc \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ src/common/tests/file_utils.cc
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_CPPFLAGS = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -I$(top_srcdir)/src/third_party/mac_headers \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ -DHAVE_MACH_O_NLIST_H \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS)
-
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@src_common_mac_macho_reader_unittest_LDADD = \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(TEST_LIBS) \
-@DISABLE_TOOLS_FALSE@@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_SOURCES = \
-@LINUX_HOST_TRUE@ src/tools/linux/md2core/minidump_memory_range_unittest.cc
-
-@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS = \
-@LINUX_HOST_TRUE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@LINUX_HOST_TRUE@src_tools_linux_md2core_minidump_2_core_unittest_LDADD = \
-@LINUX_HOST_TRUE@ $(TEST_LIBS) \
-@LINUX_HOST_TRUE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/address_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_address_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
-
-@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_basic_source_line_resolver_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_cfi_frame_info_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/contained_range_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_contained_range_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o
-
-@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_exploitability_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_disassembler_x86_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_fast_source_line_resolver_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/fast_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_comparer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/module_serializer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/map_serializers_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_map_serializers_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_processor_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_processor_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_proc_maps_linux_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_address_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_address_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_contained_range_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_contained_range_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/static_range_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_static_range_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_pathname_stripper_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_postfix_evaluator_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/postfix_evaluator_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_postfix_evaluator_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_shrink_down_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_shrink_down_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_shrink_down_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_shrink_down_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/range_map_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_range_map_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_selftest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_selftest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_selftest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_amd64_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_arm64_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_address_list_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips64_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_mips64_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/libbreakpad.a \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_stackwalker_x86_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.h \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump_unittest.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.cc \
-@DISABLE_PROCESSOR_FALSE@ src/processor/synth_minidump.h
-
-@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_processor_synth_minidump_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.cc \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler.h \
-@DISABLE_PROCESSOR_FALSE@ src/common/test_assembler_unittest.cc
-
-@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_CPPFLAGS = \
-@DISABLE_PROCESSOR_FALSE@ $(AM_CPPFLAGS) $(TEST_CFLAGS)
-
-@DISABLE_PROCESSOR_FALSE@src_common_test_assembler_unittest_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ $(TEST_LIBS) \
-@DISABLE_PROCESSOR_FALSE@ $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
-
-@DISABLE_PROCESSOR_FALSE@noinst_SCRIPTS = $(check_SCRIPTS)
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_dump.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_dump_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o
-
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_stackwalk.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_microdump_stackwalk_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/microdump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_SOURCES = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_stackwalk.cc
-
-@DISABLE_PROCESSOR_FALSE@src_processor_minidump_stackwalk_LDADD = \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_code_modules.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/basic_source_line_resolver.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/call_stack.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/cfi_frame_info.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/disassembler_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_context.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/dump_object.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/exploitability_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/logging.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/minidump_processor.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/pathname_stripper.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/process_state.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/proc_maps_linux.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/simple_symbol_supplier.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/source_line_resolver_base.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_cpu.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stack_frame_symbolizer.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalk_common.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_address_list.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_amd64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_arm64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_mips.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_ppc64.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_sparc.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/stackwalker_x86.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/symbolic_constants_win.o \
-@DISABLE_PROCESSOR_FALSE@ src/processor/tokenize.o \
-@DISABLE_PROCESSOR_FALSE@ src/third_party/libdisasm/libdisasm.a
-
-EXTRA_DIST = \
- $(SCRIPTS) \
- src/client/linux/data/linux-gate-amd.sym \
- src/client/linux/data/linux-gate-intel.sym \
- src/client/mac/handler/breakpad_nlist_64.cc \
- src/client/mac/handler/breakpad_nlist_64.h \
- src/client/mac/handler/dynamic_images.cc \
- src/client/mac/handler/dynamic_images.h \
- src/client/mac/handler/exception_handler.cc \
- src/client/mac/handler/exception_handler.h \
- src/client/mac/handler/mach_vm_compat.h \
- src/client/mac/handler/minidump_generator.cc \
- src/client/mac/handler/minidump_generator.h \
- src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj \
- src/client/mac/handler/minidump_tests32-Info.plist \
- src/client/mac/handler/minidump_tests64-Info.plist \
- src/client/mac/handler/obj-cTestCases-Info.plist \
- src/client/mac/handler/protected_memory_allocator.cc \
- src/client/mac/handler/protected_memory_allocator.h \
- src/client/mac/handler/ucontext_compat.h \
- src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym \
- src/client/mac/tests/BreakpadFramework_Test.mm \
- src/client/mac/tests/crash_generation_server_test.cc \
- src/client/mac/tests/exception_handler_test.cc \
- src/client/mac/tests/minidump_generator_test.cc \
- src/client/mac/tests/minidump_generator_test_helper.cc \
- src/client/mac/tests/spawn_child_process.h \
- src/client/mac/tests/testlogging.h \
- src/client/minidump_file_writer_unittest.cc \
- src/client/solaris/handler/Makefile \
- src/client/solaris/handler/exception_handler.cc \
- src/client/solaris/handler/exception_handler.h \
- src/client/solaris/handler/exception_handler_test.cc \
- src/client/solaris/handler/minidump_generator.cc \
- src/client/solaris/handler/minidump_generator.h \
- src/client/solaris/handler/minidump_test.cc \
- src/client/solaris/handler/solaris_lwp.cc \
- src/client/solaris/handler/solaris_lwp.h \
- src/client/windows/breakpad_client.gyp \
- src/client/windows/handler/exception_handler.cc \
- src/client/windows/handler/exception_handler.h \
- src/client/windows/handler/exception_handler.gyp \
- src/client/windows/sender/crash_report_sender.cc \
- src/client/windows/sender/crash_report_sender.h \
- src/client/windows/sender/crash_report_sender.gyp \
- src/common/dwarf/dwarf2diehandler.h \
- src/common/dwarf/dwarf2enums.h \
- src/common/dwarf/line_state_machine.h \
- src/common/dwarf/types.h \
- src/common/mac/arch_utilities.h \
- src/common/mac/byteswap.h \
- src/common/mac/HTTPMultipartUpload.h \
- src/common/mac/HTTPMultipartUpload.m \
- src/common/mac/string_utilities.cc \
- src/common/mac/string_utilities.h \
- src/common/mac/super_fat_arch.h \
- src/common/scoped_ptr.h \
- src/common/solaris/dump_symbols.cc \
- src/common/solaris/dump_symbols.h \
- src/common/solaris/file_id.cc \
- src/common/solaris/file_id.h \
- src/common/solaris/guid_creator.cc \
- src/common/solaris/guid_creator.h \
- src/common/solaris/message_output.h \
- src/common/windows/guid_string.cc \
- src/common/windows/guid_string.h \
- src/common/windows/http_upload.cc \
- src/common/windows/http_upload.h \
- src/common/windows/pdb_source_line_writer.cc \
- src/common/windows/pdb_source_line_writer.h \
- src/common/windows/string_utils-inl.h \
- src/common/windows/string_utils.cc \
- src/processor/stackwalk_common.cc \
- src/processor/stackwalk_common.h \
- src/processor/stackwalker_selftest_sol.s \
- src/processor/testdata/ascii_read_av_block_write.dmp \
- src/processor/testdata/ascii_read_av_clobber_write.dmp \
- src/processor/testdata/ascii_read_av_conditional.dmp \
- src/processor/testdata/ascii_read_av.dmp \
- src/processor/testdata/ascii_read_av_then_jmp.dmp \
- src/processor/testdata/ascii_read_av_xchg_write.dmp \
- src/processor/testdata/ascii_write_av_arg_to_call.dmp \
- src/processor/testdata/ascii_write_av.dmp \
- src/processor/testdata/exec_av_on_stack.dmp \
- src/processor/testdata/linux_divide_by_zero.dmp \
- src/processor/testdata/linux_executable_heap.dmp \
- src/processor/testdata/linux_executable_stack.dmp \
- src/processor/testdata/linux_inside_module_exe_region1.dmp \
- src/processor/testdata/linux_inside_module_exe_region2.dmp \
- src/processor/testdata/linux_jmp_to_0.dmp \
- src/processor/testdata/linux_jmp_to_module_not_exe_region.dmp \
- src/processor/testdata/linux_null_dereference.dmp \
- src/processor/testdata/linux_null_read_av.dmp \
- src/processor/testdata/linux_outside_module.dmp \
- src/processor/testdata/linux_overflow.dmp \
- src/processor/testdata/linux_raise_sigabrt.dmp \
- src/processor/testdata/linux_stack_pointer_in_module.dmp \
- src/processor/testdata/linux_stack_pointer_in_stack.dmp \
- src/processor/testdata/linux_stacksmash.dmp \
- src/processor/testdata/linux_write_to_nonwritable_module.dmp \
- src/processor/testdata/linux_write_to_nonwritable_region_math.dmp \
- src/processor/testdata/linux_write_to_outside_module.dmp \
- src/processor/testdata/linux_write_to_outside_module_via_math.dmp \
- src/processor/testdata/linux_write_to_under_4k.dmp \
- src/processor/testdata/microdump-arm64.dmp \
- src/processor/testdata/microdump-arm.dmp \
- src/processor/testdata/microdump-mips32.dmp \
- src/processor/testdata/microdump-mips64.dmp \
- src/processor/testdata/microdump-multiple.dmp \
- src/processor/testdata/microdump.stackwalk-arm64.out \
- src/processor/testdata/microdump.stackwalk-arm.out \
- src/processor/testdata/microdump.stackwalk.machine_readable-arm64.out \
- src/processor/testdata/microdump.stackwalk.machine_readable-arm.out \
- src/processor/testdata/microdump-x86.dmp \
- src/processor/testdata/minidump2.dmp \
- src/processor/testdata/minidump2.dump.out \
- src/processor/testdata/minidump2.stackwalk.machine_readable.out \
- src/processor/testdata/minidump2.stackwalk.out \
- src/processor/testdata/module0.out \
- src/processor/testdata/module1.out \
- src/processor/testdata/module2.out \
- src/processor/testdata/module3_bad.out \
- src/processor/testdata/module4_bad.out \
- src/processor/testdata/null_read_av.dmp \
- src/processor/testdata/null_write_av.dmp \
- src/processor/testdata/read_av_clobber_write.dmp \
- src/processor/testdata/read_av_conditional.dmp \
- src/processor/testdata/read_av_non_null.dmp \
- src/processor/testdata/stack_exhaustion.dmp \
- src/processor/testdata/write_av_non_null.dmp \
- src/processor/testdata/symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542/kernel32.sym \
- src/processor/testdata/symbols/ld-2.13.so/C32AD7E235EA6112E02A5B9D6219C4850/ld-2.13.so.sym \
- src/processor/testdata/symbols/libc-2.13.so/F4F8DFCD5A5FB5A7CE64717E9E6AE3890/libc-2.13.so.sym \
- src/processor/testdata/symbols/libgcc_s.so.1/18B180F90887D8F8B5C35D185444AF4C0/libgcc_s.so.1.sym \
- src/processor/testdata/symbols/microdump/breakpad_unittests/D6D1FEC9A15DE7F38A236898871A2E770/breakpad_unittests.sym \
- src/processor/testdata/symbols/microdump/breakpad_unittests/DA7778FB66018A4E9B4110ED06E730D00/breakpad_unittests.sym \
- src/processor/testdata/symbols/microdump/crash_example/6E72E2F1A5F59AB3D51356FDFE394D490/crash_example.sym \
- src/processor/testdata/symbols/microdump/crash_example/8F36148CC4647A8116CAF2A25F591F570/crash_example.sym \
- src/processor/testdata/symbols/null_read_av/7B7D1968FF0D47AE4366E9C3A7E1B6750/null_read_av.sym \
- src/processor/testdata/symbols/overflow/B0E1FC01EF48E39CAF5C881D2DF0C3840/overflow.sym \
- src/processor/testdata/symbols/test_app.pdb/5A9832E5287241C1838ED98914E9B7FF1/test_app.sym \
- src/processor/testdata/test_app.cc \
- src/testing/gtest/include/gtest/gtest.h \
- src/testing/gtest/include/gtest/gtest-death-test.h \
- src/testing/gtest/include/gtest/gtest-message.h \
- src/testing/gtest/include/gtest/gtest-param-test.h \
- src/testing/gtest/include/gtest/gtest-printers.h \
- src/testing/gtest/include/gtest/gtest-spi.h \
- src/testing/gtest/include/gtest/gtest-test-part.h \
- src/testing/gtest/include/gtest/gtest-typed-test.h \
- src/testing/gtest/include/gtest/gtest_pred_impl.h \
- src/testing/gtest/include/gtest/gtest_prod.h \
- src/testing/gtest/include/gtest/internal/gtest-death-test-internal.h \
- src/testing/gtest/include/gtest/internal/gtest-filepath.h \
- src/testing/gtest/include/gtest/internal/gtest-internal.h \
- src/testing/gtest/include/gtest/internal/gtest-linked_ptr.h \
- src/testing/gtest/include/gtest/internal/gtest-param-util-generated.h \
- src/testing/gtest/include/gtest/internal/gtest-param-util.h \
- src/testing/gtest/include/gtest/internal/gtest-port.h \
- src/testing/gtest/include/gtest/internal/gtest-string.h \
- src/testing/gtest/include/gtest/internal/gtest-tuple.h \
- src/testing/gtest/include/gtest/internal/gtest-type-util.h \
- src/testing/gtest/src/gtest.cc \
- src/testing/gtest/src/gtest-death-test.cc \
- src/testing/gtest/src/gtest-filepath.cc \
- src/testing/gtest/src/gtest-internal-inl.h \
- src/testing/gtest/src/gtest-port.cc \
- src/testing/gtest/src/gtest-printers.cc \
- src/testing/gtest/src/gtest-test-part.cc \
- src/testing/gtest/src/gtest-typed-test.cc \
- src/testing/include/gmock/gmock.h \
- src/testing/include/gmock/gmock-actions.h \
- src/testing/include/gmock/gmock-cardinalities.h \
- src/testing/include/gmock/gmock-generated-actions.h \
- src/testing/include/gmock/gmock-generated-function-mockers.h \
- src/testing/include/gmock/gmock-generated-matchers.h \
- src/testing/include/gmock/gmock-generated-nice-strict.h \
- src/testing/include/gmock/gmock-matchers.h \
- src/testing/include/gmock/gmock-more-actions.h \
- src/testing/include/gmock/gmock-more-matchers.h \
- src/testing/include/gmock/gmock-spec-builders.h \
- src/testing/include/gmock/internal/gmock-generated-internal-utils.h \
- src/testing/include/gmock/internal/gmock-internal-utils.h \
- src/testing/include/gmock/internal/gmock-port.h \
- src/testing/src/gmock.cc \
- src/testing/src/gmock-cardinalities.cc \
- src/testing/src/gmock-internal-utils.cc \
- src/testing/src/gmock-matchers.cc \
- src/testing/src/gmock-spec-builders.cc \
- src/testing/src/gmock_main.cc \
- src/third_party/curl/COPYING \
- src/third_party/curl/curlbuild.h \
- src/third_party/curl/curl.h \
- src/third_party/curl/curlrules.h \
- src/third_party/curl/curlver.h \
- src/third_party/curl/easy.h \
- src/third_party/curl/mprintf.h \
- src/third_party/curl/multi.h \
- src/third_party/curl/stdcheaders.h \
- src/third_party/curl/typecheck-gcc.h \
- src/third_party/curl/types.h \
- src/third_party/mac_headers/architecture/byte_order.h \
- src/third_party/mac_headers/i386/_types.h \
- src/third_party/mac_headers/mach/boolean.h \
- src/third_party/mac_headers/mach/i386/boolean.h \
- src/third_party/mac_headers/mach/i386/vm_param.h \
- src/third_party/mac_headers/mach/i386/vm_types.h \
- src/third_party/mac_headers/mach/machine/boolean.h \
- src/third_party/mac_headers/mach/machine.h \
- src/third_party/mac_headers/mach/machine/thread_state.h \
- src/third_party/mac_headers/mach/machine/thread_status.h \
- src/third_party/mac_headers/mach/machine/vm_types.h \
- src/third_party/mac_headers/mach-o/arch.h \
- src/third_party/mac_headers/mach-o/fat.h \
- src/third_party/mac_headers/mach-o/loader.h \
- src/third_party/mac_headers/mach-o/nlist.h \
- src/third_party/mac_headers/mach/thread_status.h \
- src/third_party/mac_headers/mach/vm_prot.h \
- src/third_party/mac_headers/README \
- src/third_party/musl/README \
- src/third_party/musl/COPYRIGHT \
- src/third_party/musl/README.breakpad \
- src/third_party/musl/VERSION \
- src/third_party/musl/include/elf.h \
- src/tools/mac/crash_report/crash_report.mm \
- src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj \
- src/tools/mac/crash_report/on_demand_symbol_supplier.h \
- src/tools/mac/crash_report/on_demand_symbol_supplier.mm \
- src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj \
- src/tools/mac/dump_syms/dump_syms_tool.cc \
- src/tools/mac/symupload/minidump_upload.m \
- src/tools/mac/symupload/symupload.m \
- src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj \
- src/tools/solaris/dump_syms/Makefile \
- src/tools/solaris/dump_syms/dump_syms.cc \
- src/tools/solaris/dump_syms/run_regtest.sh \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.o \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs \
- src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym \
- src/tools/windows/converter/ms_symbol_server_converter.cc \
- src/tools/windows/converter/ms_symbol_server_converter.h \
- src/tools/windows/converter/ms_symbol_server_converter.gyp \
- src/tools/windows/dump_syms/dump_syms.cc \
- src/tools/windows/dump_syms/dump_syms.gyp \
- src/tools/windows/dump_syms/run_regtest.sh \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest.cc \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest.pdb \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest.sym \
- src/tools/windows/dump_syms/testdata/dump_syms_regtest64.sym \
- src/tools/windows/dump_syms/testdata/omap_reorder_bbs.sym \
- src/tools/windows/dump_syms/testdata/omap_reorder_funcs.sym \
- src/tools/windows/dump_syms/testdata/omap_stretched.sym \
- src/tools/windows/dump_syms/testdata/omap_stretched_filled.sym \
- src/tools/windows/symupload/symupload.cc \
- src/tools/windows/symupload/symupload.gyp
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .S .c .cc .log .o .obj .test .test$(EXEEXT) .trs
-am--refresh: Makefile
- @:
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
- $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
- $(am__cd) $(top_srcdir) && \
- $(AUTOMAKE) --foreign Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- echo ' $(SHELL) ./config.status'; \
- $(SHELL) ./config.status;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- $(SHELL) ./config.status --recheck
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- $(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-$(am__aclocal_m4_deps):
-
-src/config.h: src/stamp-h1
- @test -f $@ || rm -f src/stamp-h1
- @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/stamp-h1
-
-src/stamp-h1: $(top_srcdir)/src/config.h.in $(top_builddir)/config.status
- @rm -f src/stamp-h1
- cd $(top_builddir) && $(SHELL) ./config.status src/config.h
-$(top_srcdir)/src/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
- rm -f src/stamp-h1
- touch $@
-
-distclean-hdr:
- -rm -f src/config.h src/stamp-h1
-breakpad.pc: $(top_builddir)/config.status $(srcdir)/breakpad.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-breakpad-client.pc: $(top_builddir)/config.status $(srcdir)/breakpad-client.pc.in
- cd $(top_builddir) && $(SHELL) ./config.status $@
-
-clean-checkLIBRARIES:
- -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES)
-install-libLIBRARIES: $(lib_LIBRARIES)
- @$(NORMAL_INSTALL)
- @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
- list2=; for p in $$list; do \
- if test -f $$p; then \
- list2="$$list2 $$p"; \
- else :; fi; \
- done; \
- test -z "$$list2" || { \
- echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
- echo " $(INSTALL_DATA) $$list2 '$(DESTDIR)$(libdir)'"; \
- $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
- @$(POST_INSTALL)
- @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
- for p in $$list; do \
- if test -f $$p; then \
- $(am__strip_dir) \
- echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
- ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
- else :; fi; \
- done
-
-uninstall-libLIBRARIES:
- @$(NORMAL_UNINSTALL)
- @list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(libdir)'; $(am__uninstall_files_from_dir)
-
-clean-libLIBRARIES:
- -test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-src/client/linux/crash_generation/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/crash_generation
- @: > src/client/linux/crash_generation/$(am__dirstamp)
-src/client/linux/crash_generation/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/crash_generation/$(DEPDIR)
- @: > src/client/linux/crash_generation/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/crash_generation/crash_generation_client.$(OBJEXT): \
- src/client/linux/crash_generation/$(am__dirstamp) \
- src/client/linux/crash_generation/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/crash_generation/crash_generation_server.$(OBJEXT): \
- src/client/linux/crash_generation/$(am__dirstamp) \
- src/client/linux/crash_generation/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/dump_writer_common/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/dump_writer_common
- @: > src/client/linux/dump_writer_common/$(am__dirstamp)
-src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/dump_writer_common/$(DEPDIR)
- @: > src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/dump_writer_common/thread_info.$(OBJEXT): \
- src/client/linux/dump_writer_common/$(am__dirstamp) \
- src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/dump_writer_common/ucontext_reader.$(OBJEXT): \
- src/client/linux/dump_writer_common/$(am__dirstamp) \
- src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/handler/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/handler
- @: > src/client/linux/handler/$(am__dirstamp)
-src/client/linux/handler/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/handler/$(DEPDIR)
- @: > src/client/linux/handler/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/handler/exception_handler.$(OBJEXT): \
- src/client/linux/handler/$(am__dirstamp) \
- src/client/linux/handler/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/handler/minidump_descriptor.$(OBJEXT): \
- src/client/linux/handler/$(am__dirstamp) \
- src/client/linux/handler/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/log/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/log
- @: > src/client/linux/log/$(am__dirstamp)
-src/client/linux/log/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/log/$(DEPDIR)
- @: > src/client/linux/log/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/log/log.$(OBJEXT): \
- src/client/linux/log/$(am__dirstamp) \
- src/client/linux/log/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/microdump_writer/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/microdump_writer
- @: > src/client/linux/microdump_writer/$(am__dirstamp)
-src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/microdump_writer/$(DEPDIR)
- @: > src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/microdump_writer/microdump_writer.$(OBJEXT): \
- src/client/linux/microdump_writer/$(am__dirstamp) \
- src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/minidump_writer
- @: > src/client/linux/minidump_writer/$(am__dirstamp)
-src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux/minidump_writer/$(DEPDIR)
- @: > src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/linux_core_dumper.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/linux_dumper.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/linux_ptrace_dumper.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/minidump_writer.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/$(am__dirstamp):
- @$(MKDIR_P) src/client
- @: > src/client/$(am__dirstamp)
-src/client/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/client/$(DEPDIR)
- @: > src/client/$(DEPDIR)/$(am__dirstamp)
-src/client/minidump_file_writer.$(OBJEXT): src/client/$(am__dirstamp) \
- src/client/$(DEPDIR)/$(am__dirstamp)
-src/common/$(am__dirstamp):
- @$(MKDIR_P) src/common
- @: > src/common/$(am__dirstamp)
-src/common/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/$(DEPDIR)
- @: > src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/convert_UTF.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/md5.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/string_conversion.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/$(am__dirstamp):
- @$(MKDIR_P) src/common/linux
- @: > src/common/linux/$(am__dirstamp)
-src/common/linux/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/linux/$(DEPDIR)
- @: > src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/elf_core_dump.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/elfutils.$(OBJEXT): src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/file_id.$(OBJEXT): src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/guid_creator.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/linux_libc_support.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/memory_mapped_file.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/safe_readlink.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/android/$(am__dirstamp):
- @$(MKDIR_P) src/common/android
- @: > src/common/android/$(am__dirstamp)
-src/common/android/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/android/$(DEPDIR)
- @: > src/common/android/$(DEPDIR)/$(am__dirstamp)
-src/common/android/breakpad_getcontext.$(OBJEXT): \
- src/common/android/$(am__dirstamp) \
- src/common/android/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/$(am__dirstamp):
- @$(MKDIR_P) src/client/linux
- @: > src/client/linux/$(am__dirstamp)
-
-src/client/linux/libbreakpad_client.a: $(src_client_linux_libbreakpad_client_a_OBJECTS) $(src_client_linux_libbreakpad_client_a_DEPENDENCIES) $(EXTRA_src_client_linux_libbreakpad_client_a_DEPENDENCIES) src/client/linux/$(am__dirstamp)
- $(AM_V_at)-rm -f src/client/linux/libbreakpad_client.a
- $(AM_V_AR)$(src_client_linux_libbreakpad_client_a_AR) src/client/linux/libbreakpad_client.a $(src_client_linux_libbreakpad_client_a_OBJECTS) $(src_client_linux_libbreakpad_client_a_LIBADD)
- $(AM_V_at)$(RANLIB) src/client/linux/libbreakpad_client.a
-src/processor/$(am__dirstamp):
- @$(MKDIR_P) src/processor
- @: > src/processor/$(am__dirstamp)
-src/processor/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/processor/$(DEPDIR)
- @: > src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/basic_code_modules.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/basic_source_line_resolver.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/call_stack.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/cfi_frame_info.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/disassembler_x86.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/dump_context.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/dump_object.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/exploitability.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/exploitability_linux.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/exploitability_win.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/fast_source_line_resolver.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/logging.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/microdump.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/microdump_processor.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/minidump.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/minidump_processor.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/module_comparer.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/module_serializer.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/pathname_stripper.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/process_state.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/proc_maps_linux.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/simple_symbol_supplier.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/source_line_resolver_base.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stack_frame_cpu.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stack_frame_symbolizer.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_amd64.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_arm.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_arm64.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_address_list.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_mips.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_ppc.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_ppc64.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_sparc.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/stackwalker_x86.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/symbolic_constants_win.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/tokenize.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/$(am__dirstamp):
- @$(MKDIR_P) src
- @: > src/$(am__dirstamp)
-
-src/libbreakpad.a: $(src_libbreakpad_a_OBJECTS) $(src_libbreakpad_a_DEPENDENCIES) $(EXTRA_src_libbreakpad_a_DEPENDENCIES) src/$(am__dirstamp)
- $(AM_V_at)-rm -f src/libbreakpad.a
- $(AM_V_AR)$(src_libbreakpad_a_AR) src/libbreakpad.a $(src_libbreakpad_a_OBJECTS) $(src_libbreakpad_a_LIBADD)
- $(AM_V_at)$(RANLIB) src/libbreakpad.a
-src/testing/gtest/src/$(am__dirstamp):
- @$(MKDIR_P) src/testing/gtest/src
- @: > src/testing/gtest/src/$(am__dirstamp)
-src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/testing/gtest/src/$(DEPDIR)
- @: > src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_testing_libtesting_a-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_testing_libtesting_a-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/$(am__dirstamp):
- @$(MKDIR_P) src/testing/src
- @: > src/testing/src/$(am__dirstamp)
-src/testing/src/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/testing/src/$(DEPDIR)
- @: > src/testing/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_testing_libtesting_a-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/$(am__dirstamp):
- @$(MKDIR_P) src/testing
- @: > src/testing/$(am__dirstamp)
-
-src/testing/libtesting.a: $(src_testing_libtesting_a_OBJECTS) $(src_testing_libtesting_a_DEPENDENCIES) $(EXTRA_src_testing_libtesting_a_DEPENDENCIES) src/testing/$(am__dirstamp)
- $(AM_V_at)-rm -f src/testing/libtesting.a
- $(AM_V_AR)$(src_testing_libtesting_a_AR) src/testing/libtesting.a $(src_testing_libtesting_a_OBJECTS) $(src_testing_libtesting_a_LIBADD)
- $(AM_V_at)$(RANLIB) src/testing/libtesting.a
-src/third_party/libdisasm/$(am__dirstamp):
- @$(MKDIR_P) src/third_party/libdisasm
- @: > src/third_party/libdisasm/$(am__dirstamp)
-src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/third_party/libdisasm/$(DEPDIR)
- @: > src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_implicit.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_insn.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_invariant.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_modrm.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_opcode_tables.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_operand.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_reg.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/ia32_settings.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/x86_disasm.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/x86_format.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/x86_imm.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/x86_insn.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/x86_misc.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-src/third_party/libdisasm/x86_operand_list.$(OBJEXT): \
- src/third_party/libdisasm/$(am__dirstamp) \
- src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
-
-src/third_party/libdisasm/libdisasm.a: $(src_third_party_libdisasm_libdisasm_a_OBJECTS) $(src_third_party_libdisasm_libdisasm_a_DEPENDENCIES) $(EXTRA_src_third_party_libdisasm_libdisasm_a_DEPENDENCIES) src/third_party/libdisasm/$(am__dirstamp)
- $(AM_V_at)-rm -f src/third_party/libdisasm/libdisasm.a
- $(AM_V_AR)$(src_third_party_libdisasm_libdisasm_a_AR) src/third_party/libdisasm/libdisasm.a $(src_third_party_libdisasm_libdisasm_a_OBJECTS) $(src_third_party_libdisasm_libdisasm_a_LIBADD)
- $(AM_V_at)$(RANLIB) src/third_party/libdisasm/libdisasm.a
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
- fi; \
- for p in $$list; do echo "$$p $$p"; done | \
- sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p \
- ; then echo "$$p"; echo "$$p"; else :; fi; \
- done | \
- sed -e 'p;s,.*/,,;n;h' \
- -e 's|.*|.|' \
- -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
- sed 'N;N;N;s,\n, ,g' | \
- $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
- { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
- if ($$2 == $$4) files[d] = files[d] " " $$1; \
- else { print "f", $$3 "/" $$4, $$1; } } \
- END { for (d in files) print "f", d, files[d] }' | \
- while read type dir files; do \
- if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
- test -z "$$files" || { \
- echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
- } \
- ; done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
- files=`for p in $$list; do echo "$$p"; done | \
- sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' \
- `; \
- test -n "$$list" || exit 0; \
- echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(bindir)" && rm -f $$files
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-clean-checkPROGRAMS:
- -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
-
-clean-noinstPROGRAMS:
- -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
-
-src/client/linux/linux_client_unittest$(EXEEXT): $(src_client_linux_linux_client_unittest_OBJECTS) $(src_client_linux_linux_client_unittest_DEPENDENCIES) $(EXTRA_src_client_linux_linux_client_unittest_DEPENDENCIES) src/client/linux/$(am__dirstamp)
- @rm -f src/client/linux/linux_client_unittest$(EXEEXT)
- $(AM_V_CCLD)$(src_client_linux_linux_client_unittest_LINK) $(src_client_linux_linux_client_unittest_OBJECTS) $(src_client_linux_linux_client_unittest_LDADD) $(LIBS)
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.$(OBJEXT): \
- src/testing/gtest/src/$(am__dirstamp) \
- src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
-src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.$(OBJEXT): \
- src/testing/src/$(am__dirstamp) \
- src/testing/src/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.$(OBJEXT): \
- src/client/linux/handler/$(am__dirstamp) \
- src/client/linux/handler/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/tests/$(am__dirstamp):
- @$(MKDIR_P) src/common/linux/tests
- @: > src/common/linux/tests/$(am__dirstamp)
-src/common/linux/tests/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/linux/tests/$(DEPDIR)
- @: > src/common/linux/tests/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.$(OBJEXT): \
- src/common/linux/tests/$(am__dirstamp) \
- src/common/linux/tests/$(DEPDIR)/$(am__dirstamp)
-src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/tests/$(am__dirstamp):
- @$(MKDIR_P) src/common/tests
- @: > src/common/tests/$(am__dirstamp)
-src/common/tests/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/tests/$(DEPDIR)
- @: > src/common/tests/$(DEPDIR)/$(am__dirstamp)
-src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.$(OBJEXT): \
- src/common/tests/$(am__dirstamp) \
- src/common/tests/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-logging.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-minidump.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.$(OBJEXT): \
- src/common/android/$(am__dirstamp) \
- src/common/android/$(DEPDIR)/$(am__dirstamp)
-src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.$(OBJEXT): \
- src/client/linux/microdump_writer/$(am__dirstamp) \
- src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp)
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.$(OBJEXT): \
- src/common/android/$(am__dirstamp) \
- src/common/android/$(DEPDIR)/$(am__dirstamp)
-
-src/client/linux/linux_client_unittest_shlib$(EXEEXT): $(src_client_linux_linux_client_unittest_shlib_OBJECTS) $(src_client_linux_linux_client_unittest_shlib_DEPENDENCIES) $(EXTRA_src_client_linux_linux_client_unittest_shlib_DEPENDENCIES) src/client/linux/$(am__dirstamp)
- @rm -f src/client/linux/linux_client_unittest_shlib$(EXEEXT)
- $(AM_V_CXXLD)$(src_client_linux_linux_client_unittest_shlib_LINK) $(src_client_linux_linux_client_unittest_shlib_OBJECTS) $(src_client_linux_linux_client_unittest_shlib_LDADD) $(LIBS)
-src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.$(OBJEXT): \
- src/client/linux/minidump_writer/$(am__dirstamp) \
- src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
-
-src/client/linux/linux_dumper_unittest_helper$(EXEEXT): $(src_client_linux_linux_dumper_unittest_helper_OBJECTS) $(src_client_linux_linux_dumper_unittest_helper_DEPENDENCIES) $(EXTRA_src_client_linux_linux_dumper_unittest_helper_DEPENDENCIES) src/client/linux/$(am__dirstamp)
- @rm -f src/client/linux/linux_dumper_unittest_helper$(EXEEXT)
- $(AM_V_CXXLD)$(src_client_linux_linux_dumper_unittest_helper_LINK) $(src_client_linux_linux_dumper_unittest_helper_OBJECTS) $(src_client_linux_linux_dumper_unittest_helper_LDADD) $(LIBS)
-src/common/src_common_dumper_unittest-byte_cursor_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-dwarf_cfi_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-dwarf_cu_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-dwarf_line_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-language.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-memory_range_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-module_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-stabs_reader.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-stabs_reader_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-stabs_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-stabs_to_module_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_dumper_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/$(am__dirstamp):
- @$(MKDIR_P) src/common/dwarf
- @: > src/common/dwarf/$(am__dirstamp)
-src/common/dwarf/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/dwarf/$(DEPDIR)
- @: > src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-bytereader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-cfi_assembler.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-elf_reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-crc32.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-dump_symbols.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-elf_core_dump.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-elfutils.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-file_id.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-file_id_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-linux_libc_support.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-memory_mapped_file.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-safe_readlink.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-synth_elf.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/src_common_dumper_unittest-synth_elf_unittest.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/tests/src_common_dumper_unittest-crash_generator.$(OBJEXT): \
- src/common/linux/tests/$(am__dirstamp) \
- src/common/linux/tests/$(DEPDIR)/$(am__dirstamp)
-src/common/tests/src_common_dumper_unittest-file_utils.$(OBJEXT): \
- src/common/tests/$(am__dirstamp) \
- src/common/tests/$(DEPDIR)/$(am__dirstamp)
-
-src/common/dumper_unittest$(EXEEXT): $(src_common_dumper_unittest_OBJECTS) $(src_common_dumper_unittest_DEPENDENCIES) $(EXTRA_src_common_dumper_unittest_DEPENDENCIES) src/common/$(am__dirstamp)
- @rm -f src/common/dumper_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_common_dumper_unittest_OBJECTS) $(src_common_dumper_unittest_LDADD) $(LIBS)
-src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-language.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-md5.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-stabs_reader.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-stabs_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_mac_macho_reader_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/$(am__dirstamp):
- @$(MKDIR_P) src/common/mac
- @: > src/common/mac/$(am__dirstamp)
-src/common/mac/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/common/mac/$(DEPDIR)
- @: > src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-file_id.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-macho_id.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/tests/src_common_mac_macho_reader_unittest-file_utils.$(OBJEXT): \
- src/common/tests/$(am__dirstamp) \
- src/common/tests/$(DEPDIR)/$(am__dirstamp)
-
-src/common/mac/macho_reader_unittest$(EXEEXT): $(src_common_mac_macho_reader_unittest_OBJECTS) $(src_common_mac_macho_reader_unittest_DEPENDENCIES) $(EXTRA_src_common_mac_macho_reader_unittest_DEPENDENCIES) src/common/mac/$(am__dirstamp)
- @rm -f src/common/mac/macho_reader_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_common_mac_macho_reader_unittest_OBJECTS) $(src_common_mac_macho_reader_unittest_LDADD) $(LIBS)
-src/common/src_common_test_assembler_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_common_test_assembler_unittest-test_assembler_unittest.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-
-src/common/test_assembler_unittest$(EXEEXT): $(src_common_test_assembler_unittest_OBJECTS) $(src_common_test_assembler_unittest_DEPENDENCIES) $(EXTRA_src_common_test_assembler_unittest_DEPENDENCIES) src/common/$(am__dirstamp)
- @rm -f src/common/test_assembler_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_common_test_assembler_unittest_OBJECTS) $(src_common_test_assembler_unittest_LDADD) $(LIBS)
-src/processor/address_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/address_map_unittest$(EXEEXT): $(src_processor_address_map_unittest_OBJECTS) $(src_processor_address_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_address_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/address_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_address_map_unittest_OBJECTS) $(src_processor_address_map_unittest_LDADD) $(LIBS)
-src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/basic_source_line_resolver_unittest$(EXEEXT): $(src_processor_basic_source_line_resolver_unittest_OBJECTS) $(src_processor_basic_source_line_resolver_unittest_DEPENDENCIES) $(EXTRA_src_processor_basic_source_line_resolver_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/basic_source_line_resolver_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_basic_source_line_resolver_unittest_OBJECTS) $(src_processor_basic_source_line_resolver_unittest_LDADD) $(LIBS)
-src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/cfi_frame_info_unittest$(EXEEXT): $(src_processor_cfi_frame_info_unittest_OBJECTS) $(src_processor_cfi_frame_info_unittest_DEPENDENCIES) $(EXTRA_src_processor_cfi_frame_info_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/cfi_frame_info_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_cfi_frame_info_unittest_OBJECTS) $(src_processor_cfi_frame_info_unittest_LDADD) $(LIBS)
-src/processor/contained_range_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/contained_range_map_unittest$(EXEEXT): $(src_processor_contained_range_map_unittest_OBJECTS) $(src_processor_contained_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_contained_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/contained_range_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_contained_range_map_unittest_OBJECTS) $(src_processor_contained_range_map_unittest_LDADD) $(LIBS)
-src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/disassembler_x86_unittest$(EXEEXT): $(src_processor_disassembler_x86_unittest_OBJECTS) $(src_processor_disassembler_x86_unittest_DEPENDENCIES) $(EXTRA_src_processor_disassembler_x86_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/disassembler_x86_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_disassembler_x86_unittest_OBJECTS) $(src_processor_disassembler_x86_unittest_LDADD) $(LIBS)
-src/processor/src_processor_exploitability_unittest-exploitability_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/exploitability_unittest$(EXEEXT): $(src_processor_exploitability_unittest_OBJECTS) $(src_processor_exploitability_unittest_DEPENDENCIES) $(EXTRA_src_processor_exploitability_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/exploitability_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_exploitability_unittest_OBJECTS) $(src_processor_exploitability_unittest_LDADD) $(LIBS)
-src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/fast_source_line_resolver_unittest$(EXEEXT): $(src_processor_fast_source_line_resolver_unittest_OBJECTS) $(src_processor_fast_source_line_resolver_unittest_DEPENDENCIES) $(EXTRA_src_processor_fast_source_line_resolver_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/fast_source_line_resolver_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_fast_source_line_resolver_unittest_OBJECTS) $(src_processor_fast_source_line_resolver_unittest_LDADD) $(LIBS)
-src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/map_serializers_unittest$(EXEEXT): $(src_processor_map_serializers_unittest_OBJECTS) $(src_processor_map_serializers_unittest_DEPENDENCIES) $(EXTRA_src_processor_map_serializers_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/map_serializers_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_map_serializers_unittest_OBJECTS) $(src_processor_map_serializers_unittest_LDADD) $(LIBS)
-src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/microdump_processor_unittest$(EXEEXT): $(src_processor_microdump_processor_unittest_OBJECTS) $(src_processor_microdump_processor_unittest_DEPENDENCIES) $(EXTRA_src_processor_microdump_processor_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/microdump_processor_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_microdump_processor_unittest_OBJECTS) $(src_processor_microdump_processor_unittest_LDADD) $(LIBS)
-src/processor/microdump_stackwalk.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/microdump_stackwalk$(EXEEXT): $(src_processor_microdump_stackwalk_OBJECTS) $(src_processor_microdump_stackwalk_DEPENDENCIES) $(EXTRA_src_processor_microdump_stackwalk_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/microdump_stackwalk$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_microdump_stackwalk_OBJECTS) $(src_processor_microdump_stackwalk_LDADD) $(LIBS)
-src/processor/minidump_dump.$(OBJEXT): src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/minidump_dump$(EXEEXT): $(src_processor_minidump_dump_OBJECTS) $(src_processor_minidump_dump_DEPENDENCIES) $(EXTRA_src_processor_minidump_dump_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/minidump_dump$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_minidump_dump_OBJECTS) $(src_processor_minidump_dump_LDADD) $(LIBS)
-src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/minidump_processor_unittest$(EXEEXT): $(src_processor_minidump_processor_unittest_OBJECTS) $(src_processor_minidump_processor_unittest_DEPENDENCIES) $(EXTRA_src_processor_minidump_processor_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/minidump_processor_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_minidump_processor_unittest_OBJECTS) $(src_processor_minidump_processor_unittest_LDADD) $(LIBS)
-src/processor/minidump_stackwalk.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/minidump_stackwalk$(EXEEXT): $(src_processor_minidump_stackwalk_OBJECTS) $(src_processor_minidump_stackwalk_DEPENDENCIES) $(EXTRA_src_processor_minidump_stackwalk_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/minidump_stackwalk$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_minidump_stackwalk_OBJECTS) $(src_processor_minidump_stackwalk_LDADD) $(LIBS)
-src/common/src_processor_minidump_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_minidump_unittest-minidump_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_minidump_unittest-synth_minidump.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/minidump_unittest$(EXEEXT): $(src_processor_minidump_unittest_OBJECTS) $(src_processor_minidump_unittest_DEPENDENCIES) $(EXTRA_src_processor_minidump_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/minidump_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_minidump_unittest_OBJECTS) $(src_processor_minidump_unittest_LDADD) $(LIBS)
-src/processor/pathname_stripper_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/pathname_stripper_unittest$(EXEEXT): $(src_processor_pathname_stripper_unittest_OBJECTS) $(src_processor_pathname_stripper_unittest_DEPENDENCIES) $(EXTRA_src_processor_pathname_stripper_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/pathname_stripper_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_pathname_stripper_unittest_OBJECTS) $(src_processor_pathname_stripper_unittest_LDADD) $(LIBS)
-src/processor/postfix_evaluator_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/postfix_evaluator_unittest$(EXEEXT): $(src_processor_postfix_evaluator_unittest_OBJECTS) $(src_processor_postfix_evaluator_unittest_DEPENDENCIES) $(EXTRA_src_processor_postfix_evaluator_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/postfix_evaluator_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_postfix_evaluator_unittest_OBJECTS) $(src_processor_postfix_evaluator_unittest_LDADD) $(LIBS)
-src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/proc_maps_linux_unittest$(EXEEXT): $(src_processor_proc_maps_linux_unittest_OBJECTS) $(src_processor_proc_maps_linux_unittest_DEPENDENCIES) $(EXTRA_src_processor_proc_maps_linux_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/proc_maps_linux_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_proc_maps_linux_unittest_OBJECTS) $(src_processor_proc_maps_linux_unittest_LDADD) $(LIBS)
-src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/range_map_shrink_down_unittest$(EXEEXT): $(src_processor_range_map_shrink_down_unittest_OBJECTS) $(src_processor_range_map_shrink_down_unittest_DEPENDENCIES) $(EXTRA_src_processor_range_map_shrink_down_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/range_map_shrink_down_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_range_map_shrink_down_unittest_OBJECTS) $(src_processor_range_map_shrink_down_unittest_LDADD) $(LIBS)
-src/processor/range_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/range_map_unittest$(EXEEXT): $(src_processor_range_map_unittest_OBJECTS) $(src_processor_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/range_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_range_map_unittest_OBJECTS) $(src_processor_range_map_unittest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_address_list_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_address_list_unittest$(EXEEXT): $(src_processor_stackwalker_address_list_unittest_OBJECTS) $(src_processor_stackwalker_address_list_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_address_list_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_address_list_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_address_list_unittest_OBJECTS) $(src_processor_stackwalker_address_list_unittest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_amd64_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_amd64_unittest$(EXEEXT): $(src_processor_stackwalker_amd64_unittest_OBJECTS) $(src_processor_stackwalker_amd64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_amd64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_amd64_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_amd64_unittest_OBJECTS) $(src_processor_stackwalker_amd64_unittest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_arm64_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_arm64_unittest$(EXEEXT): $(src_processor_stackwalker_arm64_unittest_OBJECTS) $(src_processor_stackwalker_arm64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_arm64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_arm64_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_arm64_unittest_OBJECTS) $(src_processor_stackwalker_arm64_unittest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_arm_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_arm_unittest$(EXEEXT): $(src_processor_stackwalker_arm_unittest_OBJECTS) $(src_processor_stackwalker_arm_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_arm_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_arm_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_arm_unittest_OBJECTS) $(src_processor_stackwalker_arm_unittest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_mips64_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_mips64_unittest$(EXEEXT): $(src_processor_stackwalker_mips64_unittest_OBJECTS) $(src_processor_stackwalker_mips64_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_mips64_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_mips64_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_mips64_unittest_OBJECTS) $(src_processor_stackwalker_mips64_unittest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_mips_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_mips_unittest$(EXEEXT): $(src_processor_stackwalker_mips_unittest_OBJECTS) $(src_processor_stackwalker_mips_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_mips_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_mips_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_mips_unittest_OBJECTS) $(src_processor_stackwalker_mips_unittest_LDADD) $(LIBS)
-src/processor/stackwalker_selftest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_selftest$(EXEEXT): $(src_processor_stackwalker_selftest_OBJECTS) $(src_processor_stackwalker_selftest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_selftest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_selftest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_selftest_OBJECTS) $(src_processor_stackwalker_selftest_LDADD) $(LIBS)
-src/common/src_processor_stackwalker_x86_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/stackwalker_x86_unittest$(EXEEXT): $(src_processor_stackwalker_x86_unittest_OBJECTS) $(src_processor_stackwalker_x86_unittest_DEPENDENCIES) $(EXTRA_src_processor_stackwalker_x86_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/stackwalker_x86_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_stackwalker_x86_unittest_OBJECTS) $(src_processor_stackwalker_x86_unittest_LDADD) $(LIBS)
-src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/static_address_map_unittest$(EXEEXT): $(src_processor_static_address_map_unittest_OBJECTS) $(src_processor_static_address_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_address_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/static_address_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_static_address_map_unittest_OBJECTS) $(src_processor_static_address_map_unittest_LDADD) $(LIBS)
-src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/static_contained_range_map_unittest$(EXEEXT): $(src_processor_static_contained_range_map_unittest_OBJECTS) $(src_processor_static_contained_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_contained_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/static_contained_range_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_static_contained_range_map_unittest_OBJECTS) $(src_processor_static_contained_range_map_unittest_LDADD) $(LIBS)
-src/processor/src_processor_static_map_unittest-static_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/static_map_unittest$(EXEEXT): $(src_processor_static_map_unittest_OBJECTS) $(src_processor_static_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/static_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_static_map_unittest_OBJECTS) $(src_processor_static_map_unittest_LDADD) $(LIBS)
-src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/static_range_map_unittest$(EXEEXT): $(src_processor_static_range_map_unittest_OBJECTS) $(src_processor_static_range_map_unittest_DEPENDENCIES) $(EXTRA_src_processor_static_range_map_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/static_range_map_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_static_range_map_unittest_OBJECTS) $(src_processor_static_range_map_unittest_LDADD) $(LIBS)
-src/common/src_processor_synth_minidump_unittest-test_assembler.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-src/processor/src_processor_synth_minidump_unittest-synth_minidump.$(OBJEXT): \
- src/processor/$(am__dirstamp) \
- src/processor/$(DEPDIR)/$(am__dirstamp)
-
-src/processor/synth_minidump_unittest$(EXEEXT): $(src_processor_synth_minidump_unittest_OBJECTS) $(src_processor_synth_minidump_unittest_DEPENDENCIES) $(EXTRA_src_processor_synth_minidump_unittest_DEPENDENCIES) src/processor/$(am__dirstamp)
- @rm -f src/processor/synth_minidump_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_processor_synth_minidump_unittest_OBJECTS) $(src_processor_synth_minidump_unittest_LDADD) $(LIBS)
-src/tools/linux/core2md/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/core2md
- @: > src/tools/linux/core2md/$(am__dirstamp)
-src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/core2md/$(DEPDIR)
- @: > src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/core2md/core2md.$(OBJEXT): \
- src/tools/linux/core2md/$(am__dirstamp) \
- src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/linux/core2md/core2md$(EXEEXT): $(src_tools_linux_core2md_core2md_OBJECTS) $(src_tools_linux_core2md_core2md_DEPENDENCIES) $(EXTRA_src_tools_linux_core2md_core2md_DEPENDENCIES) src/tools/linux/core2md/$(am__dirstamp)
- @rm -f src/tools/linux/core2md/core2md$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_core2md_core2md_OBJECTS) $(src_tools_linux_core2md_core2md_LDADD) $(LIBS)
-src/common/dwarf_cfi_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf_cu_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf_line_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/language.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/module.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/stabs_reader.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/stabs_to_module.$(OBJEXT): src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/bytereader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/dwarf2diehandler.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/dwarf2reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/elf_reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/crc32.$(OBJEXT): src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/dump_symbols.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/common/linux/elf_symbols_to_module.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/dump_syms/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/dump_syms
- @: > src/tools/linux/dump_syms/$(am__dirstamp)
-src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/dump_syms/$(DEPDIR)
- @: > src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/dump_syms/dump_syms.$(OBJEXT): \
- src/tools/linux/dump_syms/$(am__dirstamp) \
- src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/linux/dump_syms/dump_syms$(EXEEXT): $(src_tools_linux_dump_syms_dump_syms_OBJECTS) $(src_tools_linux_dump_syms_dump_syms_DEPENDENCIES) $(EXTRA_src_tools_linux_dump_syms_dump_syms_DEPENDENCIES) src/tools/linux/dump_syms/$(am__dirstamp)
- @rm -f src/tools/linux/dump_syms/dump_syms$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_dump_syms_dump_syms_OBJECTS) $(src_tools_linux_dump_syms_dump_syms_LDADD) $(LIBS)
-src/tools/linux/md2core/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/md2core
- @: > src/tools/linux/md2core/$(am__dirstamp)
-src/tools/linux/md2core/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/md2core/$(DEPDIR)
- @: > src/tools/linux/md2core/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/md2core/minidump-2-core.$(OBJEXT): \
- src/tools/linux/md2core/$(am__dirstamp) \
- src/tools/linux/md2core/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/linux/md2core/minidump-2-core$(EXEEXT): $(src_tools_linux_md2core_minidump_2_core_OBJECTS) $(src_tools_linux_md2core_minidump_2_core_DEPENDENCIES) $(EXTRA_src_tools_linux_md2core_minidump_2_core_DEPENDENCIES) src/tools/linux/md2core/$(am__dirstamp)
- @rm -f src/tools/linux/md2core/minidump-2-core$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_md2core_minidump_2_core_OBJECTS) $(src_tools_linux_md2core_minidump_2_core_LDADD) $(LIBS)
-src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.$(OBJEXT): \
- src/tools/linux/md2core/$(am__dirstamp) \
- src/tools/linux/md2core/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT): $(src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS) $(src_tools_linux_md2core_minidump_2_core_unittest_DEPENDENCIES) $(EXTRA_src_tools_linux_md2core_minidump_2_core_unittest_DEPENDENCIES) src/tools/linux/md2core/$(am__dirstamp)
- @rm -f src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_md2core_minidump_2_core_unittest_OBJECTS) $(src_tools_linux_md2core_minidump_2_core_unittest_LDADD) $(LIBS)
-src/common/linux/http_upload.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/symupload/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/symupload
- @: > src/tools/linux/symupload/$(am__dirstamp)
-src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/tools/linux/symupload/$(DEPDIR)
- @: > src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/symupload/minidump_upload.$(OBJEXT): \
- src/tools/linux/symupload/$(am__dirstamp) \
- src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/linux/symupload/minidump_upload$(EXEEXT): $(src_tools_linux_symupload_minidump_upload_OBJECTS) $(src_tools_linux_symupload_minidump_upload_DEPENDENCIES) $(EXTRA_src_tools_linux_symupload_minidump_upload_DEPENDENCIES) src/tools/linux/symupload/$(am__dirstamp)
- @rm -f src/tools/linux/symupload/minidump_upload$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_symupload_minidump_upload_OBJECTS) $(src_tools_linux_symupload_minidump_upload_LDADD) $(LIBS)
-src/common/linux/symbol_upload.$(OBJEXT): \
- src/common/linux/$(am__dirstamp) \
- src/common/linux/$(DEPDIR)/$(am__dirstamp)
-src/tools/linux/symupload/sym_upload.$(OBJEXT): \
- src/tools/linux/symupload/$(am__dirstamp) \
- src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/linux/symupload/sym_upload$(EXEEXT): $(src_tools_linux_symupload_sym_upload_OBJECTS) $(src_tools_linux_symupload_sym_upload_DEPENDENCIES) $(EXTRA_src_tools_linux_symupload_sym_upload_DEPENDENCIES) src/tools/linux/symupload/$(am__dirstamp)
- @rm -f src/tools/linux/symupload/sym_upload$(EXEEXT)
- $(AM_V_CXXLD)$(CXXLINK) $(src_tools_linux_symupload_sym_upload_OBJECTS) $(src_tools_linux_symupload_sym_upload_LDADD) $(LIBS)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-language.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.$(OBJEXT): \
- src/common/$(am__dirstamp) \
- src/common/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.$(OBJEXT): \
- src/common/dwarf/$(am__dirstamp) \
- src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.$(OBJEXT): \
- src/common/mac/$(am__dirstamp) \
- src/common/mac/$(DEPDIR)/$(am__dirstamp)
-src/tools/mac/dump_syms/$(am__dirstamp):
- @$(MKDIR_P) src/tools/mac/dump_syms
- @: > src/tools/mac/dump_syms/$(am__dirstamp)
-src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp):
- @$(MKDIR_P) src/tools/mac/dump_syms/$(DEPDIR)
- @: > src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp)
-src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.$(OBJEXT): \
- src/tools/mac/dump_syms/$(am__dirstamp) \
- src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp)
-
-src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT): $(src_tools_mac_dump_syms_dump_syms_mac_OBJECTS) $(src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES) $(EXTRA_src_tools_mac_dump_syms_dump_syms_mac_DEPENDENCIES) src/tools/mac/dump_syms/$(am__dirstamp)
- @rm -f src/tools/mac/dump_syms/dump_syms_mac$(EXEEXT)
- $(AM_V_CXXLD)$(src_tools_mac_dump_syms_dump_syms_mac_LINK) $(src_tools_mac_dump_syms_dump_syms_mac_OBJECTS) $(src_tools_mac_dump_syms_dump_syms_mac_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
- -rm -f src/client/*.$(OBJEXT)
- -rm -f src/client/linux/crash_generation/*.$(OBJEXT)
- -rm -f src/client/linux/dump_writer_common/*.$(OBJEXT)
- -rm -f src/client/linux/handler/*.$(OBJEXT)
- -rm -f src/client/linux/log/*.$(OBJEXT)
- -rm -f src/client/linux/microdump_writer/*.$(OBJEXT)
- -rm -f src/client/linux/minidump_writer/*.$(OBJEXT)
- -rm -f src/common/*.$(OBJEXT)
- -rm -f src/common/android/*.$(OBJEXT)
- -rm -f src/common/dwarf/*.$(OBJEXT)
- -rm -f src/common/linux/*.$(OBJEXT)
- -rm -f src/common/linux/tests/*.$(OBJEXT)
- -rm -f src/common/mac/*.$(OBJEXT)
- -rm -f src/common/tests/*.$(OBJEXT)
- -rm -f src/processor/*.$(OBJEXT)
- -rm -f src/testing/gtest/src/*.$(OBJEXT)
- -rm -f src/testing/src/*.$(OBJEXT)
- -rm -f src/third_party/libdisasm/*.$(OBJEXT)
- -rm -f src/tools/linux/core2md/*.$(OBJEXT)
- -rm -f src/tools/linux/dump_syms/*.$(OBJEXT)
- -rm -f src/tools/linux/md2core/*.$(OBJEXT)
- -rm -f src/tools/linux/symupload/*.$(OBJEXT)
- -rm -f src/tools/mac/dump_syms/*.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/$(DEPDIR)/minidump_file_writer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/crash_generation/$(DEPDIR)/crash_generation_client.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/crash_generation/$(DEPDIR)/crash_generation_server.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/dump_writer_common/$(DEPDIR)/thread_info.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/dump_writer_common/$(DEPDIR)/ucontext_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/handler/$(DEPDIR)/exception_handler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/handler/$(DEPDIR)/minidump_descriptor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/log/$(DEPDIR)/log.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/microdump_writer/$(DEPDIR)/microdump_writer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_core_dumper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_dumper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/linux_ptrace_dumper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/minidump_writer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/convert_UTF.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dwarf_cfi_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dwarf_cu_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/dwarf_line_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/language.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/md5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-language.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/stabs_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/stabs_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/$(DEPDIR)/string_conversion.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/android/$(DEPDIR)/breakpad_getcontext.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/bytereader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/dwarf2diehandler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/dwarf2reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/elf_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/crc32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/dump_symbols.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/elf_core_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/elf_symbols_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/elfutils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/file_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/guid_creator.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/http_upload.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/linux_libc_support.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/memory_mapped_file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/safe_readlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/$(DEPDIR)/symbol_upload.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/address_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/basic_code_modules.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/basic_source_line_resolver.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/call_stack.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/cfi_frame_info.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/contained_range_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/disassembler_x86.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/dump_context.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/dump_object.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/exploitability.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/exploitability_linux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/exploitability_win.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/fast_source_line_resolver.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/logging.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/microdump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/microdump_processor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/microdump_stackwalk.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/minidump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/minidump_dump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/minidump_processor.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/minidump_stackwalk.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/module_comparer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/module_serializer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/pathname_stripper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/pathname_stripper_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/postfix_evaluator_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/proc_maps_linux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/process_state.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/range_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/simple_symbol_supplier.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/source_line_resolver_base.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stack_frame_cpu.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stack_frame_symbolizer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_address_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_amd64.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_arm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_arm64.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_mips.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_ppc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_ppc64.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_selftest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_sparc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/stackwalker_x86.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/symbolic_constants_win.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/processor/$(DEPDIR)/tokenize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_implicit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_insn.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_invariant.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_modrm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_opcode_tables.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_operand.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_reg.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/ia32_settings.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_disasm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_format.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_imm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_insn.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_misc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/third_party/libdisasm/$(DEPDIR)/x86_operand_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/core2md/$(DEPDIR)/core2md.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/dump_syms/$(DEPDIR)/dump_syms.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/md2core/$(DEPDIR)/minidump-2-core.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/symupload/$(DEPDIR)/minidump_upload.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/linux/symupload/$(DEPDIR)/sym_upload.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Po@am__quote@
-
-.S.o:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ $<
-
-.S.obj:
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCCAS_TRUE@ $(CPPASCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCCAS_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CPPASCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o: src/common/android/breakpad_getcontext.S
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o `test -f 'src/common/android/breakpad_getcontext.S' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext.S
-@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='src/common/android/breakpad_getcontext.S' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.o `test -f 'src/common/android/breakpad_getcontext.S' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext.S
-
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj: src/common/android/breakpad_getcontext.S
-@am__fastdepCCAS_TRUE@ $(AM_V_CPPAS)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj `if test -f 'src/common/android/breakpad_getcontext.S'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext.S'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext.S'; fi`
-@am__fastdepCCAS_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.Po
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS)source='src/common/android/breakpad_getcontext.S' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCCAS_FALSE@ DEPDIR=$(DEPDIR) $(CCASDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCCAS_FALSE@ $(AM_V_CPPAS@am__nodep@)$(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) $(CCASFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext.obj `if test -f 'src/common/android/breakpad_getcontext.S'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext.S'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext.S'; fi`
-
-.c.o:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
-
-.c.obj:
-@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-.cc.o:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
-@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
-@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
-
-.cc.obj:
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
-@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
-@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
-
-src/testing/gtest/src/src_testing_libtesting_a-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_testing_libtesting_a-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_testing_libtesting_a-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_testing_libtesting_a-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_testing_libtesting_a-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_testing_libtesting_a-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_testing_libtesting_a-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_testing_libtesting_a-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_testing_libtesting_a-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_testing_libtesting_a-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_testing_libtesting_a-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_testing_libtesting_a-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_testing_libtesting_a-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_testing_libtesting_a-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_testing_libtesting_a-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_testing_libtesting_a-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo -c -o src/testing/src/src_testing_libtesting_a-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_testing_libtesting_a-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_testing_libtesting_a-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_testing_libtesting_a-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_testing_libtesting_a-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo -c -o src/testing/src/src_testing_libtesting_a-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_testing_libtesting_a-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_testing_libtesting_a-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_testing_libtesting_a_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_testing_libtesting_a-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.o `test -f 'src/testing/gtest/src/gtest-all.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest-all.cc
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj: src/testing/gtest/src/gtest-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest-all.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest-all.obj `if test -f 'src/testing/gtest/src/gtest-all.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest-all.cc'; fi`
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.o `test -f 'src/testing/gtest/src/gtest_main.cc' || echo '$(srcdir)/'`src/testing/gtest/src/gtest_main.cc
-
-src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj: src/testing/gtest/src/gtest_main.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj -MD -MP -MF src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Tpo src/testing/gtest/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gtest_main.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/gtest/src/gtest_main.cc' object='src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/gtest/src/src_client_linux_linux_client_unittest_shlib-gtest_main.obj `if test -f 'src/testing/gtest/src/gtest_main.cc'; then $(CYGPATH_W) 'src/testing/gtest/src/gtest_main.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/gtest/src/gtest_main.cc'; fi`
-
-src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o -MD -MP -MF src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.o `test -f 'src/testing/src/gmock-all.cc' || echo '$(srcdir)/'`src/testing/src/gmock-all.cc
-
-src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj: src/testing/src/gmock-all.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj -MD -MP -MF src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Tpo src/testing/src/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-gmock-all.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/testing/src/gmock-all.cc' object='src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/testing/src/src_client_linux_linux_client_unittest_shlib-gmock-all.obj `if test -f 'src/testing/src/gmock-all.cc'; then $(CYGPATH_W) 'src/testing/src/gmock-all.cc'; else $(CYGPATH_W) '$(srcdir)/src/testing/src/gmock-all.cc'; fi`
-
-src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o: src/client/linux/handler/exception_handler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o -MD -MP -MF src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Tpo -c -o src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o `test -f 'src/client/linux/handler/exception_handler_unittest.cc' || echo '$(srcdir)/'`src/client/linux/handler/exception_handler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Tpo src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/handler/exception_handler_unittest.cc' object='src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.o `test -f 'src/client/linux/handler/exception_handler_unittest.cc' || echo '$(srcdir)/'`src/client/linux/handler/exception_handler_unittest.cc
-
-src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.obj: src/client/linux/handler/exception_handler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.obj -MD -MP -MF src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Tpo -c -o src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.obj `if test -f 'src/client/linux/handler/exception_handler_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/handler/exception_handler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/handler/exception_handler_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Tpo src/client/linux/handler/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/handler/exception_handler_unittest.cc' object='src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/handler/src_client_linux_linux_client_unittest_shlib-exception_handler_unittest.obj `if test -f 'src/client/linux/handler/exception_handler_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/handler/exception_handler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/handler/exception_handler_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o: src/client/linux/minidump_writer/directory_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o `test -f 'src/client/linux/minidump_writer/directory_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/directory_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/directory_reader_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.o `test -f 'src/client/linux/minidump_writer/directory_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/directory_reader_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.obj: src/client/linux/minidump_writer/directory_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.obj `if test -f 'src/client/linux/minidump_writer/directory_reader_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/directory_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/directory_reader_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/directory_reader_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-directory_reader_unittest.obj `if test -f 'src/client/linux/minidump_writer/directory_reader_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/directory_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/directory_reader_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.o: src/client/linux/minidump_writer/cpu_set_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.o `test -f 'src/client/linux/minidump_writer/cpu_set_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/cpu_set_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/cpu_set_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.o `test -f 'src/client/linux/minidump_writer/cpu_set_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/cpu_set_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.obj: src/client/linux/minidump_writer/cpu_set_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.obj `if test -f 'src/client/linux/minidump_writer/cpu_set_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/cpu_set_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/cpu_set_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/cpu_set_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-cpu_set_unittest.obj `if test -f 'src/client/linux/minidump_writer/cpu_set_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/cpu_set_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/cpu_set_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.o: src/client/linux/minidump_writer/line_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.o `test -f 'src/client/linux/minidump_writer/line_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/line_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/line_reader_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.o `test -f 'src/client/linux/minidump_writer/line_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/line_reader_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.obj: src/client/linux/minidump_writer/line_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.obj `if test -f 'src/client/linux/minidump_writer/line_reader_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/line_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/line_reader_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/line_reader_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-line_reader_unittest.obj `if test -f 'src/client/linux/minidump_writer/line_reader_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/line_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/line_reader_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.o: src/client/linux/minidump_writer/linux_core_dumper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.o `test -f 'src/client/linux/minidump_writer/linux_core_dumper.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_core_dumper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_core_dumper.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.o `test -f 'src/client/linux/minidump_writer/linux_core_dumper.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_core_dumper.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.obj: src/client/linux/minidump_writer/linux_core_dumper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.obj `if test -f 'src/client/linux/minidump_writer/linux_core_dumper.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_core_dumper.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_core_dumper.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_core_dumper.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper.obj `if test -f 'src/client/linux/minidump_writer/linux_core_dumper.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_core_dumper.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_core_dumper.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.o: src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.o `test -f 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_core_dumper_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.o `test -f 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.obj: src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.obj `if test -f 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_core_dumper_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_core_dumper_unittest.obj `if test -f 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_core_dumper_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.o: src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.o `test -f 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.o `test -f 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.obj: src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.obj `if test -f 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-linux_ptrace_dumper_unittest.obj `if test -f 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.o: src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.o `test -f 'src/client/linux/minidump_writer/minidump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/minidump_writer_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.o `test -f 'src/client/linux/minidump_writer/minidump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/minidump_writer_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.obj: src/client/linux/minidump_writer/minidump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/minidump_writer_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.o: src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.o `test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.o `test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.obj: src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-minidump_writer_unittest_utils.obj `if test -f 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o: src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o `test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.o `test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.obj: src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.obj `if test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_client_unittest_shlib-proc_cpuinfo_reader_unittest.obj `if test -f 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc'; fi`
-
-src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.o: src/common/linux/elf_core_dump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.o `test -f 'src/common/linux/elf_core_dump.cc' || echo '$(srcdir)/'`src/common/linux/elf_core_dump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_core_dump.cc' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.o `test -f 'src/common/linux/elf_core_dump.cc' || echo '$(srcdir)/'`src/common/linux/elf_core_dump.cc
-
-src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.obj: src/common/linux/elf_core_dump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.obj `if test -f 'src/common/linux/elf_core_dump.cc'; then $(CYGPATH_W) 'src/common/linux/elf_core_dump.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_core_dump.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-elf_core_dump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_core_dump.cc' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-elf_core_dump.obj `if test -f 'src/common/linux/elf_core_dump.cc'; then $(CYGPATH_W) 'src/common/linux/elf_core_dump.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_core_dump.cc'; fi`
-
-src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.o: src/common/linux/linux_libc_support_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.o `test -f 'src/common/linux/linux_libc_support_unittest.cc' || echo '$(srcdir)/'`src/common/linux/linux_libc_support_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/linux_libc_support_unittest.cc' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.o `test -f 'src/common/linux/linux_libc_support_unittest.cc' || echo '$(srcdir)/'`src/common/linux/linux_libc_support_unittest.cc
-
-src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj: src/common/linux/linux_libc_support_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Tpo -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj `if test -f 'src/common/linux/linux_libc_support_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Tpo src/common/linux/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/linux_libc_support_unittest.cc' object='src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_client_linux_linux_client_unittest_shlib-linux_libc_support_unittest.obj `if test -f 'src/common/linux/linux_libc_support_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support_unittest.cc'; fi`
-
-src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.o: src/common/linux/tests/crash_generator.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.o -MD -MP -MF src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Tpo -c -o src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.o `test -f 'src/common/linux/tests/crash_generator.cc' || echo '$(srcdir)/'`src/common/linux/tests/crash_generator.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Tpo src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/tests/crash_generator.cc' object='src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.o `test -f 'src/common/linux/tests/crash_generator.cc' || echo '$(srcdir)/'`src/common/linux/tests/crash_generator.cc
-
-src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.obj: src/common/linux/tests/crash_generator.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.obj -MD -MP -MF src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Tpo -c -o src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.obj `if test -f 'src/common/linux/tests/crash_generator.cc'; then $(CYGPATH_W) 'src/common/linux/tests/crash_generator.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/tests/crash_generator.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Tpo src/common/linux/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-crash_generator.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/tests/crash_generator.cc' object='src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/tests/src_client_linux_linux_client_unittest_shlib-crash_generator.obj `if test -f 'src/common/linux/tests/crash_generator.cc'; then $(CYGPATH_W) 'src/common/linux/tests/crash_generator.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/tests/crash_generator.cc'; fi`
-
-src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o: src/common/memory_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o `test -f 'src/common/memory_unittest.cc' || echo '$(srcdir)/'`src/common/memory_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_unittest.cc' object='src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.o `test -f 'src/common/memory_unittest.cc' || echo '$(srcdir)/'`src/common/memory_unittest.cc
-
-src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj: src/common/memory_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj `if test -f 'src/common/memory_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Tpo src/common/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-memory_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_unittest.cc' object='src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_client_linux_linux_client_unittest_shlib-memory_unittest.obj `if test -f 'src/common/memory_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_unittest.cc'; fi`
-
-src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o: src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o -MD -MP -MF src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Tpo -c -o src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Tpo src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
-
-src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj: src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj -MD -MP -MF src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Tpo -c -o src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Tpo src/common/tests/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-file_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_client_linux_linux_client_unittest_shlib-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o: src/processor/basic_code_modules.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o `test -f 'src/processor/basic_code_modules.cc' || echo '$(srcdir)/'`src/processor/basic_code_modules.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_code_modules.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.o `test -f 'src/processor/basic_code_modules.cc' || echo '$(srcdir)/'`src/processor/basic_code_modules.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.obj: src/processor/basic_code_modules.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.obj `if test -f 'src/processor/basic_code_modules.cc'; then $(CYGPATH_W) 'src/processor/basic_code_modules.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_code_modules.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-basic_code_modules.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_code_modules.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-basic_code_modules.obj `if test -f 'src/processor/basic_code_modules.cc'; then $(CYGPATH_W) 'src/processor/basic_code_modules.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_code_modules.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o: src/processor/dump_context.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o `test -f 'src/processor/dump_context.cc' || echo '$(srcdir)/'`src/processor/dump_context.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/dump_context.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.o `test -f 'src/processor/dump_context.cc' || echo '$(srcdir)/'`src/processor/dump_context.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.obj: src/processor/dump_context.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.obj `if test -f 'src/processor/dump_context.cc'; then $(CYGPATH_W) 'src/processor/dump_context.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/dump_context.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_context.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/dump_context.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_context.obj `if test -f 'src/processor/dump_context.cc'; then $(CYGPATH_W) 'src/processor/dump_context.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/dump_context.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.o: src/processor/dump_object.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.o `test -f 'src/processor/dump_object.cc' || echo '$(srcdir)/'`src/processor/dump_object.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/dump_object.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.o `test -f 'src/processor/dump_object.cc' || echo '$(srcdir)/'`src/processor/dump_object.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.obj: src/processor/dump_object.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.obj `if test -f 'src/processor/dump_object.cc'; then $(CYGPATH_W) 'src/processor/dump_object.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/dump_object.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-dump_object.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/dump_object.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-dump_object.obj `if test -f 'src/processor/dump_object.cc'; then $(CYGPATH_W) 'src/processor/dump_object.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/dump_object.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-logging.o: src/processor/logging.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-logging.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-logging.o `test -f 'src/processor/logging.cc' || echo '$(srcdir)/'`src/processor/logging.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/logging.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-logging.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-logging.o `test -f 'src/processor/logging.cc' || echo '$(srcdir)/'`src/processor/logging.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-logging.obj: src/processor/logging.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-logging.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-logging.obj `if test -f 'src/processor/logging.cc'; then $(CYGPATH_W) 'src/processor/logging.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/logging.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-logging.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/logging.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-logging.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-logging.obj `if test -f 'src/processor/logging.cc'; then $(CYGPATH_W) 'src/processor/logging.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/logging.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-minidump.o: src/processor/minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-minidump.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-minidump.o `test -f 'src/processor/minidump.cc' || echo '$(srcdir)/'`src/processor/minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/minidump.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-minidump.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-minidump.o `test -f 'src/processor/minidump.cc' || echo '$(srcdir)/'`src/processor/minidump.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-minidump.obj: src/processor/minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-minidump.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-minidump.obj `if test -f 'src/processor/minidump.cc'; then $(CYGPATH_W) 'src/processor/minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/minidump.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-minidump.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-minidump.obj `if test -f 'src/processor/minidump.cc'; then $(CYGPATH_W) 'src/processor/minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.o: src/processor/pathname_stripper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.o `test -f 'src/processor/pathname_stripper.cc' || echo '$(srcdir)/'`src/processor/pathname_stripper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/pathname_stripper.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.o `test -f 'src/processor/pathname_stripper.cc' || echo '$(srcdir)/'`src/processor/pathname_stripper.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj: src/processor/pathname_stripper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj `if test -f 'src/processor/pathname_stripper.cc'; then $(CYGPATH_W) 'src/processor/pathname_stripper.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/pathname_stripper.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-pathname_stripper.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/pathname_stripper.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-pathname_stripper.obj `if test -f 'src/processor/pathname_stripper.cc'; then $(CYGPATH_W) 'src/processor/pathname_stripper.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/pathname_stripper.cc'; fi`
-
-src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o: src/processor/proc_maps_linux.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
-
-src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj: src/processor/proc_maps_linux.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj -MD -MP -MF src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_client_linux_linux_client_unittest_shlib-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
-
-src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o: src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o -MD -MP -MF src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o `test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/microdump_writer/microdump_writer_unittest.cc' object='src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.o `test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc' || echo '$(srcdir)/'`src/client/linux/microdump_writer/microdump_writer_unittest.cc
-
-src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj: src/client/linux/microdump_writer/microdump_writer_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj -MD -MP -MF src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj `if test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/microdump_writer/microdump_writer_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Tpo src/client/linux/microdump_writer/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/microdump_writer/microdump_writer_unittest.cc' object='src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/microdump_writer/src_client_linux_linux_client_unittest_shlib-microdump_writer_unittest.obj `if test -f 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; then $(CYGPATH_W) 'src/client/linux/microdump_writer/microdump_writer_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/microdump_writer/microdump_writer_unittest.cc'; fi`
-
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o: src/common/android/breakpad_getcontext_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o `test -f 'src/common/android/breakpad_getcontext_unittest.cc' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/android/breakpad_getcontext_unittest.cc' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.o `test -f 'src/common/android/breakpad_getcontext_unittest.cc' || echo '$(srcdir)/'`src/common/android/breakpad_getcontext_unittest.cc
-
-src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj: src/common/android/breakpad_getcontext_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj -MD -MP -MF src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj `if test -f 'src/common/android/breakpad_getcontext_unittest.cc'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Tpo src/common/android/$(DEPDIR)/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/android/breakpad_getcontext_unittest.cc' object='src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_client_linux_linux_client_unittest_shlib_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/android/src_client_linux_linux_client_unittest_shlib-breakpad_getcontext_unittest.obj `if test -f 'src/common/android/breakpad_getcontext_unittest.cc'; then $(CYGPATH_W) 'src/common/android/breakpad_getcontext_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/android/breakpad_getcontext_unittest.cc'; fi`
-
-src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o: src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o `test -f 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.o `test -f 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc' || echo '$(srcdir)/'`src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-
-src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.obj: src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) $(CXXFLAGS) -MT src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.obj -MD -MP -MF src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Tpo -c -o src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.obj `if test -f 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Tpo src/client/linux/minidump_writer/$(DEPDIR)/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc' object='src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_client_linux_linux_dumper_unittest_helper_CXXFLAGS) $(CXXFLAGS) -c -o src/client/linux/minidump_writer/src_client_linux_linux_dumper_unittest_helper-linux_dumper_unittest_helper.obj `if test -f 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc'; then $(CYGPATH_W) 'src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc'; else $(CYGPATH_W) '$(srcdir)/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc'; fi`
-
-src/common/src_common_dumper_unittest-byte_cursor_unittest.o: src/common/byte_cursor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-byte_cursor_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Tpo -c -o src/common/src_common_dumper_unittest-byte_cursor_unittest.o `test -f 'src/common/byte_cursor_unittest.cc' || echo '$(srcdir)/'`src/common/byte_cursor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/byte_cursor_unittest.cc' object='src/common/src_common_dumper_unittest-byte_cursor_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-byte_cursor_unittest.o `test -f 'src/common/byte_cursor_unittest.cc' || echo '$(srcdir)/'`src/common/byte_cursor_unittest.cc
-
-src/common/src_common_dumper_unittest-byte_cursor_unittest.obj: src/common/byte_cursor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-byte_cursor_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Tpo -c -o src/common/src_common_dumper_unittest-byte_cursor_unittest.obj `if test -f 'src/common/byte_cursor_unittest.cc'; then $(CYGPATH_W) 'src/common/byte_cursor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/byte_cursor_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-byte_cursor_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/byte_cursor_unittest.cc' object='src/common/src_common_dumper_unittest-byte_cursor_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-byte_cursor_unittest.obj `if test -f 'src/common/byte_cursor_unittest.cc'; then $(CYGPATH_W) 'src/common/byte_cursor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/byte_cursor_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-
-src/common/src_common_dumper_unittest-dwarf_cfi_to_module.obj: src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cfi_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_common_dumper_unittest-dwarf_cfi_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-
-src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.o: src/common/dwarf_cfi_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.o `test -f 'src/common/dwarf_cfi_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.o `test -f 'src/common/dwarf_cfi_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module_unittest.cc
-
-src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.obj: src/common/dwarf_cfi_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.obj `if test -f 'src/common/dwarf_cfi_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cfi_to_module_unittest.obj `if test -f 'src/common/dwarf_cfi_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-dwarf_cu_to_module.o: src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cu_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_common_dumper_unittest-dwarf_cu_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-
-src/common/src_common_dumper_unittest-dwarf_cu_to_module.obj: src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cu_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_common_dumper_unittest-dwarf_cu_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-
-src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.o: src/common/dwarf_cu_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.o `test -f 'src/common/dwarf_cu_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.o `test -f 'src/common/dwarf_cu_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module_unittest.cc
-
-src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.obj: src/common/dwarf_cu_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.obj `if test -f 'src/common/dwarf_cu_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_cu_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_cu_to_module_unittest.obj `if test -f 'src/common/dwarf_cu_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-dwarf_line_to_module.o: src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_line_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_common_dumper_unittest-dwarf_line_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-
-src/common/src_common_dumper_unittest-dwarf_line_to_module.obj: src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_line_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_common_dumper_unittest-dwarf_line_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-
-src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.o: src/common/dwarf_line_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.o `test -f 'src/common/dwarf_line_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.o `test -f 'src/common/dwarf_line_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module_unittest.cc
-
-src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj: src/common/dwarf_line_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj `if test -f 'src/common/dwarf_line_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-dwarf_line_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-dwarf_line_to_module_unittest.obj `if test -f 'src/common/dwarf_line_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-language.o: src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-language.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-language.Tpo -c -o src/common/src_common_dumper_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-language.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-language.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_common_dumper_unittest-language.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-
-src/common/src_common_dumper_unittest-language.obj: src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-language.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-language.Tpo -c -o src/common/src_common_dumper_unittest-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-language.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-language.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_common_dumper_unittest-language.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-
-src/common/src_common_dumper_unittest-memory_range_unittest.o: src/common/memory_range_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-memory_range_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Tpo -c -o src/common/src_common_dumper_unittest-memory_range_unittest.o `test -f 'src/common/memory_range_unittest.cc' || echo '$(srcdir)/'`src/common/memory_range_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_range_unittest.cc' object='src/common/src_common_dumper_unittest-memory_range_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-memory_range_unittest.o `test -f 'src/common/memory_range_unittest.cc' || echo '$(srcdir)/'`src/common/memory_range_unittest.cc
-
-src/common/src_common_dumper_unittest-memory_range_unittest.obj: src/common/memory_range_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-memory_range_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Tpo -c -o src/common/src_common_dumper_unittest-memory_range_unittest.obj `if test -f 'src/common/memory_range_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_range_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_range_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-memory_range_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/memory_range_unittest.cc' object='src/common/src_common_dumper_unittest-memory_range_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-memory_range_unittest.obj `if test -f 'src/common/memory_range_unittest.cc'; then $(CYGPATH_W) 'src/common/memory_range_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/memory_range_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-module.o: src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-module.Tpo -c -o src/common/src_common_dumper_unittest-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_common_dumper_unittest-module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-
-src/common/src_common_dumper_unittest-module.obj: src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-module.Tpo -c -o src/common/src_common_dumper_unittest-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_common_dumper_unittest-module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-
-src/common/src_common_dumper_unittest-module_unittest.o: src/common/module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-module_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-module_unittest.o `test -f 'src/common/module_unittest.cc' || echo '$(srcdir)/'`src/common/module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module_unittest.cc' object='src/common/src_common_dumper_unittest-module_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-module_unittest.o `test -f 'src/common/module_unittest.cc' || echo '$(srcdir)/'`src/common/module_unittest.cc
-
-src/common/src_common_dumper_unittest-module_unittest.obj: src/common/module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-module_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-module_unittest.obj `if test -f 'src/common/module_unittest.cc'; then $(CYGPATH_W) 'src/common/module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module_unittest.cc' object='src/common/src_common_dumper_unittest-module_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-module_unittest.obj `if test -f 'src/common/module_unittest.cc'; then $(CYGPATH_W) 'src/common/module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-stabs_reader.o: src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Tpo -c -o src/common/src_common_dumper_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_common_dumper_unittest-stabs_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-
-src/common/src_common_dumper_unittest-stabs_reader.obj: src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_reader.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Tpo -c -o src/common/src_common_dumper_unittest-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_common_dumper_unittest-stabs_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-
-src/common/src_common_dumper_unittest-stabs_reader_unittest.o: src/common/stabs_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_reader_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Tpo -c -o src/common/src_common_dumper_unittest-stabs_reader_unittest.o `test -f 'src/common/stabs_reader_unittest.cc' || echo '$(srcdir)/'`src/common/stabs_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader_unittest.cc' object='src/common/src_common_dumper_unittest-stabs_reader_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_reader_unittest.o `test -f 'src/common/stabs_reader_unittest.cc' || echo '$(srcdir)/'`src/common/stabs_reader_unittest.cc
-
-src/common/src_common_dumper_unittest-stabs_reader_unittest.obj: src/common/stabs_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_reader_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Tpo -c -o src/common/src_common_dumper_unittest-stabs_reader_unittest.obj `if test -f 'src/common/stabs_reader_unittest.cc'; then $(CYGPATH_W) 'src/common/stabs_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader_unittest.cc' object='src/common/src_common_dumper_unittest-stabs_reader_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_reader_unittest.obj `if test -f 'src/common/stabs_reader_unittest.cc'; then $(CYGPATH_W) 'src/common/stabs_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-stabs_to_module.o: src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Tpo -c -o src/common/src_common_dumper_unittest-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_common_dumper_unittest-stabs_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-
-src/common/src_common_dumper_unittest-stabs_to_module.obj: src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Tpo -c -o src/common/src_common_dumper_unittest-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_common_dumper_unittest-stabs_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-
-src/common/src_common_dumper_unittest-stabs_to_module_unittest.o: src/common/stabs_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_to_module_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-stabs_to_module_unittest.o `test -f 'src/common/stabs_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/stabs_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-stabs_to_module_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_to_module_unittest.o `test -f 'src/common/stabs_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/stabs_to_module_unittest.cc
-
-src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj: src/common/stabs_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Tpo -c -o src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj `if test -f 'src/common/stabs_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-stabs_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module_unittest.cc' object='src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-stabs_to_module_unittest.obj `if test -f 'src/common/stabs_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module_unittest.cc'; fi`
-
-src/common/src_common_dumper_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Tpo -c -o src/common/src_common_dumper_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_dumper_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_common_dumper_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_dumper_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Tpo -c -o src/common/src_common_dumper_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_dumper_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_dumper_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_dumper_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-bytereader.o: src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-bytereader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_common_dumper_unittest-bytereader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-
-src/common/dwarf/src_common_dumper_unittest-bytereader.obj: src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-bytereader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_common_dumper_unittest-bytereader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.o: src/common/dwarf/bytereader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.o `test -f 'src/common/dwarf/bytereader_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.o `test -f 'src/common/dwarf/bytereader_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader_unittest.cc
-
-src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.obj: src/common/dwarf/bytereader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.obj `if test -f 'src/common/dwarf/bytereader_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-bytereader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-bytereader_unittest.obj `if test -f 'src/common/dwarf/bytereader_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader_unittest.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-cfi_assembler.o: src/common/dwarf/cfi_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-cfi_assembler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-cfi_assembler.o `test -f 'src/common/dwarf/cfi_assembler.cc' || echo '$(srcdir)/'`src/common/dwarf/cfi_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/cfi_assembler.cc' object='src/common/dwarf/src_common_dumper_unittest-cfi_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-cfi_assembler.o `test -f 'src/common/dwarf/cfi_assembler.cc' || echo '$(srcdir)/'`src/common/dwarf/cfi_assembler.cc
-
-src/common/dwarf/src_common_dumper_unittest-cfi_assembler.obj: src/common/dwarf/cfi_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-cfi_assembler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-cfi_assembler.obj `if test -f 'src/common/dwarf/cfi_assembler.cc'; then $(CYGPATH_W) 'src/common/dwarf/cfi_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/cfi_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-cfi_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/cfi_assembler.cc' object='src/common/dwarf/src_common_dumper_unittest-cfi_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-cfi_assembler.obj `if test -f 'src/common/dwarf/cfi_assembler.cc'; then $(CYGPATH_W) 'src/common/dwarf/cfi_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/cfi_assembler.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.o: src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.obj: src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.o: src/common/dwarf/dwarf2diehandler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.o `test -f 'src/common/dwarf/dwarf2diehandler_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.o `test -f 'src/common/dwarf/dwarf2diehandler_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler_unittest.cc
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.obj: src/common/dwarf/dwarf2diehandler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.obj `if test -f 'src/common/dwarf/dwarf2diehandler_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2diehandler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2diehandler_unittest.obj `if test -f 'src/common/dwarf/dwarf2diehandler_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler_unittest.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader.o: src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj: src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-elf_reader.o: src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_dumper_unittest-elf_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-
-src/common/dwarf/src_common_dumper_unittest-elf_reader.obj: src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-elf_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_dumper_unittest-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o: src/common/dwarf/dwarf2reader_cfi_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o `test -f 'src/common/dwarf/dwarf2reader_cfi_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader_cfi_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader_cfi_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.o `test -f 'src/common/dwarf/dwarf2reader_cfi_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader_cfi_unittest.cc
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.obj: src/common/dwarf/dwarf2reader_cfi_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.obj `if test -f 'src/common/dwarf/dwarf2reader_cfi_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader_cfi_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader_cfi_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_cfi_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader_cfi_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_cfi_unittest.obj `if test -f 'src/common/dwarf/dwarf2reader_cfi_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader_cfi_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader_cfi_unittest.cc'; fi`
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.o: src/common/dwarf/dwarf2reader_die_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.o `test -f 'src/common/dwarf/dwarf2reader_die_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader_die_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader_die_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.o `test -f 'src/common/dwarf/dwarf2reader_die_unittest.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader_die_unittest.cc
-
-src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.obj: src/common/dwarf/dwarf2reader_die_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Tpo -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.obj `if test -f 'src/common/dwarf/dwarf2reader_die_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader_die_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader_die_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Tpo src/common/dwarf/$(DEPDIR)/src_common_dumper_unittest-dwarf2reader_die_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader_die_unittest.cc' object='src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_dumper_unittest-dwarf2reader_die_unittest.obj `if test -f 'src/common/dwarf/dwarf2reader_die_unittest.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader_die_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader_die_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-crc32.o: src/common/linux/crc32.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-crc32.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Tpo -c -o src/common/linux/src_common_dumper_unittest-crc32.o `test -f 'src/common/linux/crc32.cc' || echo '$(srcdir)/'`src/common/linux/crc32.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/crc32.cc' object='src/common/linux/src_common_dumper_unittest-crc32.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-crc32.o `test -f 'src/common/linux/crc32.cc' || echo '$(srcdir)/'`src/common/linux/crc32.cc
-
-src/common/linux/src_common_dumper_unittest-crc32.obj: src/common/linux/crc32.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-crc32.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Tpo -c -o src/common/linux/src_common_dumper_unittest-crc32.obj `if test -f 'src/common/linux/crc32.cc'; then $(CYGPATH_W) 'src/common/linux/crc32.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/crc32.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-crc32.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/crc32.cc' object='src/common/linux/src_common_dumper_unittest-crc32.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-crc32.obj `if test -f 'src/common/linux/crc32.cc'; then $(CYGPATH_W) 'src/common/linux/crc32.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/crc32.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-dump_symbols.o: src/common/linux/dump_symbols.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-dump_symbols.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Tpo -c -o src/common/linux/src_common_dumper_unittest-dump_symbols.o `test -f 'src/common/linux/dump_symbols.cc' || echo '$(srcdir)/'`src/common/linux/dump_symbols.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/dump_symbols.cc' object='src/common/linux/src_common_dumper_unittest-dump_symbols.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-dump_symbols.o `test -f 'src/common/linux/dump_symbols.cc' || echo '$(srcdir)/'`src/common/linux/dump_symbols.cc
-
-src/common/linux/src_common_dumper_unittest-dump_symbols.obj: src/common/linux/dump_symbols.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-dump_symbols.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Tpo -c -o src/common/linux/src_common_dumper_unittest-dump_symbols.obj `if test -f 'src/common/linux/dump_symbols.cc'; then $(CYGPATH_W) 'src/common/linux/dump_symbols.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/dump_symbols.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/dump_symbols.cc' object='src/common/linux/src_common_dumper_unittest-dump_symbols.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-dump_symbols.obj `if test -f 'src/common/linux/dump_symbols.cc'; then $(CYGPATH_W) 'src/common/linux/dump_symbols.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/dump_symbols.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.o: src/common/linux/dump_symbols_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.o `test -f 'src/common/linux/dump_symbols_unittest.cc' || echo '$(srcdir)/'`src/common/linux/dump_symbols_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/dump_symbols_unittest.cc' object='src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.o `test -f 'src/common/linux/dump_symbols_unittest.cc' || echo '$(srcdir)/'`src/common/linux/dump_symbols_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.obj: src/common/linux/dump_symbols_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.obj `if test -f 'src/common/linux/dump_symbols_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/dump_symbols_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/dump_symbols_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-dump_symbols_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/dump_symbols_unittest.cc' object='src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-dump_symbols_unittest.obj `if test -f 'src/common/linux/dump_symbols_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/dump_symbols_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/dump_symbols_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-elf_core_dump.o: src/common/linux/elf_core_dump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_core_dump.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump.o `test -f 'src/common/linux/elf_core_dump.cc' || echo '$(srcdir)/'`src/common/linux/elf_core_dump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_core_dump.cc' object='src/common/linux/src_common_dumper_unittest-elf_core_dump.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump.o `test -f 'src/common/linux/elf_core_dump.cc' || echo '$(srcdir)/'`src/common/linux/elf_core_dump.cc
-
-src/common/linux/src_common_dumper_unittest-elf_core_dump.obj: src/common/linux/elf_core_dump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_core_dump.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump.obj `if test -f 'src/common/linux/elf_core_dump.cc'; then $(CYGPATH_W) 'src/common/linux/elf_core_dump.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_core_dump.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_core_dump.cc' object='src/common/linux/src_common_dumper_unittest-elf_core_dump.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump.obj `if test -f 'src/common/linux/elf_core_dump.cc'; then $(CYGPATH_W) 'src/common/linux/elf_core_dump.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_core_dump.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.o: src/common/linux/elf_core_dump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.o `test -f 'src/common/linux/elf_core_dump_unittest.cc' || echo '$(srcdir)/'`src/common/linux/elf_core_dump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_core_dump_unittest.cc' object='src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.o `test -f 'src/common/linux/elf_core_dump_unittest.cc' || echo '$(srcdir)/'`src/common/linux/elf_core_dump_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.obj: src/common/linux/elf_core_dump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.obj `if test -f 'src/common/linux/elf_core_dump_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/elf_core_dump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_core_dump_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_core_dump_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_core_dump_unittest.cc' object='src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_core_dump_unittest.obj `if test -f 'src/common/linux/elf_core_dump_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/elf_core_dump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_core_dump_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.o: src/common/linux/elf_symbols_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.o `test -f 'src/common/linux/elf_symbols_to_module.cc' || echo '$(srcdir)/'`src/common/linux/elf_symbols_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_symbols_to_module.cc' object='src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.o `test -f 'src/common/linux/elf_symbols_to_module.cc' || echo '$(srcdir)/'`src/common/linux/elf_symbols_to_module.cc
-
-src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.obj: src/common/linux/elf_symbols_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.obj `if test -f 'src/common/linux/elf_symbols_to_module.cc'; then $(CYGPATH_W) 'src/common/linux/elf_symbols_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_symbols_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_symbols_to_module.cc' object='src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module.obj `if test -f 'src/common/linux/elf_symbols_to_module.cc'; then $(CYGPATH_W) 'src/common/linux/elf_symbols_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_symbols_to_module.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.o: src/common/linux/elf_symbols_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.o `test -f 'src/common/linux/elf_symbols_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/linux/elf_symbols_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_symbols_to_module_unittest.cc' object='src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.o `test -f 'src/common/linux/elf_symbols_to_module_unittest.cc' || echo '$(srcdir)/'`src/common/linux/elf_symbols_to_module_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.obj: src/common/linux/elf_symbols_to_module_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.obj `if test -f 'src/common/linux/elf_symbols_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/elf_symbols_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_symbols_to_module_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elf_symbols_to_module_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elf_symbols_to_module_unittest.cc' object='src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elf_symbols_to_module_unittest.obj `if test -f 'src/common/linux/elf_symbols_to_module_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/elf_symbols_to_module_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elf_symbols_to_module_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-elfutils.o: src/common/linux/elfutils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elfutils.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Tpo -c -o src/common/linux/src_common_dumper_unittest-elfutils.o `test -f 'src/common/linux/elfutils.cc' || echo '$(srcdir)/'`src/common/linux/elfutils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elfutils.cc' object='src/common/linux/src_common_dumper_unittest-elfutils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elfutils.o `test -f 'src/common/linux/elfutils.cc' || echo '$(srcdir)/'`src/common/linux/elfutils.cc
-
-src/common/linux/src_common_dumper_unittest-elfutils.obj: src/common/linux/elfutils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-elfutils.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Tpo -c -o src/common/linux/src_common_dumper_unittest-elfutils.obj `if test -f 'src/common/linux/elfutils.cc'; then $(CYGPATH_W) 'src/common/linux/elfutils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elfutils.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-elfutils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/elfutils.cc' object='src/common/linux/src_common_dumper_unittest-elfutils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-elfutils.obj `if test -f 'src/common/linux/elfutils.cc'; then $(CYGPATH_W) 'src/common/linux/elfutils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/elfutils.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-file_id.o: src/common/linux/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-file_id.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Tpo -c -o src/common/linux/src_common_dumper_unittest-file_id.o `test -f 'src/common/linux/file_id.cc' || echo '$(srcdir)/'`src/common/linux/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/file_id.cc' object='src/common/linux/src_common_dumper_unittest-file_id.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-file_id.o `test -f 'src/common/linux/file_id.cc' || echo '$(srcdir)/'`src/common/linux/file_id.cc
-
-src/common/linux/src_common_dumper_unittest-file_id.obj: src/common/linux/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-file_id.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Tpo -c -o src/common/linux/src_common_dumper_unittest-file_id.obj `if test -f 'src/common/linux/file_id.cc'; then $(CYGPATH_W) 'src/common/linux/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/file_id.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/file_id.cc' object='src/common/linux/src_common_dumper_unittest-file_id.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-file_id.obj `if test -f 'src/common/linux/file_id.cc'; then $(CYGPATH_W) 'src/common/linux/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/file_id.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-file_id_unittest.o: src/common/linux/file_id_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-file_id_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-file_id_unittest.o `test -f 'src/common/linux/file_id_unittest.cc' || echo '$(srcdir)/'`src/common/linux/file_id_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/file_id_unittest.cc' object='src/common/linux/src_common_dumper_unittest-file_id_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-file_id_unittest.o `test -f 'src/common/linux/file_id_unittest.cc' || echo '$(srcdir)/'`src/common/linux/file_id_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-file_id_unittest.obj: src/common/linux/file_id_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-file_id_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-file_id_unittest.obj `if test -f 'src/common/linux/file_id_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/file_id_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/file_id_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-file_id_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/file_id_unittest.cc' object='src/common/linux/src_common_dumper_unittest-file_id_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-file_id_unittest.obj `if test -f 'src/common/linux/file_id_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/file_id_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/file_id_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-linux_libc_support.o: src/common/linux/linux_libc_support.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-linux_libc_support.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Tpo -c -o src/common/linux/src_common_dumper_unittest-linux_libc_support.o `test -f 'src/common/linux/linux_libc_support.cc' || echo '$(srcdir)/'`src/common/linux/linux_libc_support.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/linux_libc_support.cc' object='src/common/linux/src_common_dumper_unittest-linux_libc_support.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-linux_libc_support.o `test -f 'src/common/linux/linux_libc_support.cc' || echo '$(srcdir)/'`src/common/linux/linux_libc_support.cc
-
-src/common/linux/src_common_dumper_unittest-linux_libc_support.obj: src/common/linux/linux_libc_support.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-linux_libc_support.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Tpo -c -o src/common/linux/src_common_dumper_unittest-linux_libc_support.obj `if test -f 'src/common/linux/linux_libc_support.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-linux_libc_support.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/linux_libc_support.cc' object='src/common/linux/src_common_dumper_unittest-linux_libc_support.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-linux_libc_support.obj `if test -f 'src/common/linux/linux_libc_support.cc'; then $(CYGPATH_W) 'src/common/linux/linux_libc_support.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/linux_libc_support.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-memory_mapped_file.o: src/common/linux/memory_mapped_file.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-memory_mapped_file.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Tpo -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file.o `test -f 'src/common/linux/memory_mapped_file.cc' || echo '$(srcdir)/'`src/common/linux/memory_mapped_file.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/memory_mapped_file.cc' object='src/common/linux/src_common_dumper_unittest-memory_mapped_file.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file.o `test -f 'src/common/linux/memory_mapped_file.cc' || echo '$(srcdir)/'`src/common/linux/memory_mapped_file.cc
-
-src/common/linux/src_common_dumper_unittest-memory_mapped_file.obj: src/common/linux/memory_mapped_file.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-memory_mapped_file.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Tpo -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file.obj `if test -f 'src/common/linux/memory_mapped_file.cc'; then $(CYGPATH_W) 'src/common/linux/memory_mapped_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/memory_mapped_file.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/memory_mapped_file.cc' object='src/common/linux/src_common_dumper_unittest-memory_mapped_file.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file.obj `if test -f 'src/common/linux/memory_mapped_file.cc'; then $(CYGPATH_W) 'src/common/linux/memory_mapped_file.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/memory_mapped_file.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.o: src/common/linux/memory_mapped_file_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.o `test -f 'src/common/linux/memory_mapped_file_unittest.cc' || echo '$(srcdir)/'`src/common/linux/memory_mapped_file_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/memory_mapped_file_unittest.cc' object='src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.o `test -f 'src/common/linux/memory_mapped_file_unittest.cc' || echo '$(srcdir)/'`src/common/linux/memory_mapped_file_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.obj: src/common/linux/memory_mapped_file_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.obj `if test -f 'src/common/linux/memory_mapped_file_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/memory_mapped_file_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/memory_mapped_file_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-memory_mapped_file_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/memory_mapped_file_unittest.cc' object='src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-memory_mapped_file_unittest.obj `if test -f 'src/common/linux/memory_mapped_file_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/memory_mapped_file_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/memory_mapped_file_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-safe_readlink.o: src/common/linux/safe_readlink.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-safe_readlink.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Tpo -c -o src/common/linux/src_common_dumper_unittest-safe_readlink.o `test -f 'src/common/linux/safe_readlink.cc' || echo '$(srcdir)/'`src/common/linux/safe_readlink.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/safe_readlink.cc' object='src/common/linux/src_common_dumper_unittest-safe_readlink.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-safe_readlink.o `test -f 'src/common/linux/safe_readlink.cc' || echo '$(srcdir)/'`src/common/linux/safe_readlink.cc
-
-src/common/linux/src_common_dumper_unittest-safe_readlink.obj: src/common/linux/safe_readlink.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-safe_readlink.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Tpo -c -o src/common/linux/src_common_dumper_unittest-safe_readlink.obj `if test -f 'src/common/linux/safe_readlink.cc'; then $(CYGPATH_W) 'src/common/linux/safe_readlink.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/safe_readlink.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/safe_readlink.cc' object='src/common/linux/src_common_dumper_unittest-safe_readlink.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-safe_readlink.obj `if test -f 'src/common/linux/safe_readlink.cc'; then $(CYGPATH_W) 'src/common/linux/safe_readlink.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/safe_readlink.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.o: src/common/linux/safe_readlink_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.o `test -f 'src/common/linux/safe_readlink_unittest.cc' || echo '$(srcdir)/'`src/common/linux/safe_readlink_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/safe_readlink_unittest.cc' object='src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.o `test -f 'src/common/linux/safe_readlink_unittest.cc' || echo '$(srcdir)/'`src/common/linux/safe_readlink_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.obj: src/common/linux/safe_readlink_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.obj `if test -f 'src/common/linux/safe_readlink_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/safe_readlink_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/safe_readlink_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-safe_readlink_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/safe_readlink_unittest.cc' object='src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-safe_readlink_unittest.obj `if test -f 'src/common/linux/safe_readlink_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/safe_readlink_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/safe_readlink_unittest.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-synth_elf.o: src/common/linux/synth_elf.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-synth_elf.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Tpo -c -o src/common/linux/src_common_dumper_unittest-synth_elf.o `test -f 'src/common/linux/synth_elf.cc' || echo '$(srcdir)/'`src/common/linux/synth_elf.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/synth_elf.cc' object='src/common/linux/src_common_dumper_unittest-synth_elf.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-synth_elf.o `test -f 'src/common/linux/synth_elf.cc' || echo '$(srcdir)/'`src/common/linux/synth_elf.cc
-
-src/common/linux/src_common_dumper_unittest-synth_elf.obj: src/common/linux/synth_elf.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-synth_elf.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Tpo -c -o src/common/linux/src_common_dumper_unittest-synth_elf.obj `if test -f 'src/common/linux/synth_elf.cc'; then $(CYGPATH_W) 'src/common/linux/synth_elf.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/synth_elf.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/synth_elf.cc' object='src/common/linux/src_common_dumper_unittest-synth_elf.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-synth_elf.obj `if test -f 'src/common/linux/synth_elf.cc'; then $(CYGPATH_W) 'src/common/linux/synth_elf.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/synth_elf.cc'; fi`
-
-src/common/linux/src_common_dumper_unittest-synth_elf_unittest.o: src/common/linux/synth_elf_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-synth_elf_unittest.o -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-synth_elf_unittest.o `test -f 'src/common/linux/synth_elf_unittest.cc' || echo '$(srcdir)/'`src/common/linux/synth_elf_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/synth_elf_unittest.cc' object='src/common/linux/src_common_dumper_unittest-synth_elf_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-synth_elf_unittest.o `test -f 'src/common/linux/synth_elf_unittest.cc' || echo '$(srcdir)/'`src/common/linux/synth_elf_unittest.cc
-
-src/common/linux/src_common_dumper_unittest-synth_elf_unittest.obj: src/common/linux/synth_elf_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/src_common_dumper_unittest-synth_elf_unittest.obj -MD -MP -MF src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Tpo -c -o src/common/linux/src_common_dumper_unittest-synth_elf_unittest.obj `if test -f 'src/common/linux/synth_elf_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/synth_elf_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/synth_elf_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Tpo src/common/linux/$(DEPDIR)/src_common_dumper_unittest-synth_elf_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/synth_elf_unittest.cc' object='src/common/linux/src_common_dumper_unittest-synth_elf_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/src_common_dumper_unittest-synth_elf_unittest.obj `if test -f 'src/common/linux/synth_elf_unittest.cc'; then $(CYGPATH_W) 'src/common/linux/synth_elf_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/synth_elf_unittest.cc'; fi`
-
-src/common/linux/tests/src_common_dumper_unittest-crash_generator.o: src/common/linux/tests/crash_generator.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/tests/src_common_dumper_unittest-crash_generator.o -MD -MP -MF src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Tpo -c -o src/common/linux/tests/src_common_dumper_unittest-crash_generator.o `test -f 'src/common/linux/tests/crash_generator.cc' || echo '$(srcdir)/'`src/common/linux/tests/crash_generator.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Tpo src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/tests/crash_generator.cc' object='src/common/linux/tests/src_common_dumper_unittest-crash_generator.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/tests/src_common_dumper_unittest-crash_generator.o `test -f 'src/common/linux/tests/crash_generator.cc' || echo '$(srcdir)/'`src/common/linux/tests/crash_generator.cc
-
-src/common/linux/tests/src_common_dumper_unittest-crash_generator.obj: src/common/linux/tests/crash_generator.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/linux/tests/src_common_dumper_unittest-crash_generator.obj -MD -MP -MF src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Tpo -c -o src/common/linux/tests/src_common_dumper_unittest-crash_generator.obj `if test -f 'src/common/linux/tests/crash_generator.cc'; then $(CYGPATH_W) 'src/common/linux/tests/crash_generator.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/tests/crash_generator.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Tpo src/common/linux/tests/$(DEPDIR)/src_common_dumper_unittest-crash_generator.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/linux/tests/crash_generator.cc' object='src/common/linux/tests/src_common_dumper_unittest-crash_generator.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/linux/tests/src_common_dumper_unittest-crash_generator.obj `if test -f 'src/common/linux/tests/crash_generator.cc'; then $(CYGPATH_W) 'src/common/linux/tests/crash_generator.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/linux/tests/crash_generator.cc'; fi`
-
-src/common/tests/src_common_dumper_unittest-file_utils.o: src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_common_dumper_unittest-file_utils.o -MD -MP -MF src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Tpo -c -o src/common/tests/src_common_dumper_unittest-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Tpo src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_common_dumper_unittest-file_utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_dumper_unittest-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
-
-src/common/tests/src_common_dumper_unittest-file_utils.obj: src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_common_dumper_unittest-file_utils.obj -MD -MP -MF src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Tpo -c -o src/common/tests/src_common_dumper_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Tpo src/common/tests/$(DEPDIR)/src_common_dumper_unittest-file_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_common_dumper_unittest-file_utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_dumper_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_dumper_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-
-src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj: src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o: src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-
-src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj: src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o: src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-
-src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj: src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf_line_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-language.o: src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-language.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_common_mac_macho_reader_unittest-language.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-
-src/common/src_common_mac_macho_reader_unittest-language.obj: src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-language.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-language.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_common_mac_macho_reader_unittest-language.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-md5.o: src/common/md5.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-md5.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_common_mac_macho_reader_unittest-md5.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
-
-src/common/src_common_mac_macho_reader_unittest-md5.obj: src/common/md5.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-md5.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-md5.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_common_mac_macho_reader_unittest-md5.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-module.o: src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_common_mac_macho_reader_unittest-module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-
-src/common/src_common_mac_macho_reader_unittest-module.obj: src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_common_mac_macho_reader_unittest-module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-stabs_reader.o: src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-
-src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj: src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o: src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-
-src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj: src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-stabs_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-
-src/common/src_common_mac_macho_reader_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_mac_macho_reader_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_common_mac_macho_reader_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_mac_macho_reader_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_mac_macho_reader_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_mac_macho_reader_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_mac_macho_reader_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o: src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj: src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-bytereader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o: src/common/dwarf/cfi_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o `test -f 'src/common/dwarf/cfi_assembler.cc' || echo '$(srcdir)/'`src/common/dwarf/cfi_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/cfi_assembler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.o `test -f 'src/common/dwarf/cfi_assembler.cc' || echo '$(srcdir)/'`src/common/dwarf/cfi_assembler.cc
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj: src/common/dwarf/cfi_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj `if test -f 'src/common/dwarf/cfi_assembler.cc'; then $(CYGPATH_W) 'src/common/dwarf/cfi_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/cfi_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-cfi_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/cfi_assembler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-cfi_assembler.obj `if test -f 'src/common/dwarf/cfi_assembler.cc'; then $(CYGPATH_W) 'src/common/dwarf/cfi_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/cfi_assembler.cc'; fi`
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o: src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj: src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2diehandler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o: src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj: src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-dwarf2reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o: src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-
-src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj: src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_common_mac_macho_reader_unittest-elf_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_common_mac_macho_reader_unittest-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o: src/common/mac/arch_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj: src/common/mac/arch_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-arch_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-file_id.o: src/common/mac/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-file_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-file_id.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj: src/common/mac/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o: src/common/mac/macho_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj: src/common/mac/macho_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o: src/common/mac/macho_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj: src/common/mac/macho_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o: src/common/mac/macho_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o `test -f 'src/common/mac/macho_reader_unittest.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader_unittest.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.o `test -f 'src/common/mac/macho_reader_unittest.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader_unittest.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj: src/common/mac/macho_reader_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj `if test -f 'src/common/mac/macho_reader_unittest.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_reader_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader_unittest.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_reader_unittest.obj `if test -f 'src/common/mac/macho_reader_unittest.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader_unittest.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o: src/common/mac/macho_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj: src/common/mac/macho_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o: src/common/mac/macho_walker.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
-
-src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj: src/common/mac/macho_walker.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_common_mac_macho_reader_unittest-macho_walker.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_common_mac_macho_reader_unittest-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
-
-src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o: src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o -MD -MP -MF src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.o `test -f 'src/common/tests/file_utils.cc' || echo '$(srcdir)/'`src/common/tests/file_utils.cc
-
-src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj: src/common/tests/file_utils.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj -MD -MP -MF src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Tpo src/common/tests/$(DEPDIR)/src_common_mac_macho_reader_unittest-file_utils.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/tests/file_utils.cc' object='src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_mac_macho_reader_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/tests/src_common_mac_macho_reader_unittest-file_utils.obj `if test -f 'src/common/tests/file_utils.cc'; then $(CYGPATH_W) 'src/common/tests/file_utils.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/tests/file_utils.cc'; fi`
-
-src/common/src_common_test_assembler_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_test_assembler_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_common_test_assembler_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_common_test_assembler_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/common/src_common_test_assembler_unittest-test_assembler_unittest.o: src/common/test_assembler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler_unittest.o -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.o `test -f 'src/common/test_assembler_unittest.cc' || echo '$(srcdir)/'`src/common/test_assembler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler_unittest.cc' object='src/common/src_common_test_assembler_unittest-test_assembler_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.o `test -f 'src/common/test_assembler_unittest.cc' || echo '$(srcdir)/'`src/common/test_assembler_unittest.cc
-
-src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj: src/common/test_assembler_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj -MD -MP -MF src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj `if test -f 'src/common/test_assembler_unittest.cc'; then $(CYGPATH_W) 'src/common/test_assembler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Tpo src/common/$(DEPDIR)/src_common_test_assembler_unittest-test_assembler_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler_unittest.cc' object='src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_common_test_assembler_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_common_test_assembler_unittest-test_assembler_unittest.obj `if test -f 'src/common/test_assembler_unittest.cc'; then $(CYGPATH_W) 'src/common/test_assembler_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler_unittest.cc'; fi`
-
-src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o: src/processor/basic_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o `test -f 'src/processor/basic_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/basic_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_source_line_resolver_unittest.cc' object='src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.o `test -f 'src/processor/basic_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/basic_source_line_resolver_unittest.cc
-
-src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj: src/processor/basic_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj `if test -f 'src/processor/basic_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/basic_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_source_line_resolver_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/basic_source_line_resolver_unittest.cc' object='src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_basic_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_basic_source_line_resolver_unittest-basic_source_line_resolver_unittest.obj `if test -f 'src/processor/basic_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/basic_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/basic_source_line_resolver_unittest.cc'; fi`
-
-src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o: src/processor/cfi_frame_info_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o `test -f 'src/processor/cfi_frame_info_unittest.cc' || echo '$(srcdir)/'`src/processor/cfi_frame_info_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/cfi_frame_info_unittest.cc' object='src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.o `test -f 'src/processor/cfi_frame_info_unittest.cc' || echo '$(srcdir)/'`src/processor/cfi_frame_info_unittest.cc
-
-src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj: src/processor/cfi_frame_info_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Tpo src/processor/$(DEPDIR)/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/cfi_frame_info_unittest.cc' object='src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_cfi_frame_info_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_cfi_frame_info_unittest-cfi_frame_info_unittest.obj `if test -f 'src/processor/cfi_frame_info_unittest.cc'; then $(CYGPATH_W) 'src/processor/cfi_frame_info_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/cfi_frame_info_unittest.cc'; fi`
-
-src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o: src/processor/disassembler_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_x86_unittest.cc' object='src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.o `test -f 'src/processor/disassembler_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/disassembler_x86_unittest.cc
-
-src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj: src/processor/disassembler_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj `if test -f 'src/processor/disassembler_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_x86_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/disassembler_x86_unittest.cc' object='src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_disassembler_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_disassembler_x86_unittest-disassembler_x86_unittest.obj `if test -f 'src/processor/disassembler_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/disassembler_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/disassembler_x86_unittest.cc'; fi`
-
-src/processor/src_processor_exploitability_unittest-exploitability_unittest.o: src/processor/exploitability_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_exploitability_unittest-exploitability_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.o `test -f 'src/processor/exploitability_unittest.cc' || echo '$(srcdir)/'`src/processor/exploitability_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/exploitability_unittest.cc' object='src/processor/src_processor_exploitability_unittest-exploitability_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.o `test -f 'src/processor/exploitability_unittest.cc' || echo '$(srcdir)/'`src/processor/exploitability_unittest.cc
-
-src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj: src/processor/exploitability_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj `if test -f 'src/processor/exploitability_unittest.cc'; then $(CYGPATH_W) 'src/processor/exploitability_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/exploitability_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Tpo src/processor/$(DEPDIR)/src_processor_exploitability_unittest-exploitability_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/exploitability_unittest.cc' object='src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_exploitability_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_exploitability_unittest-exploitability_unittest.obj `if test -f 'src/processor/exploitability_unittest.cc'; then $(CYGPATH_W) 'src/processor/exploitability_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/exploitability_unittest.cc'; fi`
-
-src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o: src/processor/fast_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o `test -f 'src/processor/fast_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/fast_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/fast_source_line_resolver_unittest.cc' object='src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.o `test -f 'src/processor/fast_source_line_resolver_unittest.cc' || echo '$(srcdir)/'`src/processor/fast_source_line_resolver_unittest.cc
-
-src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.obj: src/processor/fast_source_line_resolver_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Tpo -c -o src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.obj `if test -f 'src/processor/fast_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/fast_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/fast_source_line_resolver_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Tpo src/processor/$(DEPDIR)/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/fast_source_line_resolver_unittest.cc' object='src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_fast_source_line_resolver_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_fast_source_line_resolver_unittest-fast_source_line_resolver_unittest.obj `if test -f 'src/processor/fast_source_line_resolver_unittest.cc'; then $(CYGPATH_W) 'src/processor/fast_source_line_resolver_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/fast_source_line_resolver_unittest.cc'; fi`
-
-src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o: src/processor/map_serializers_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Tpo -c -o src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o `test -f 'src/processor/map_serializers_unittest.cc' || echo '$(srcdir)/'`src/processor/map_serializers_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Tpo src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/map_serializers_unittest.cc' object='src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.o `test -f 'src/processor/map_serializers_unittest.cc' || echo '$(srcdir)/'`src/processor/map_serializers_unittest.cc
-
-src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.obj: src/processor/map_serializers_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Tpo -c -o src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.obj `if test -f 'src/processor/map_serializers_unittest.cc'; then $(CYGPATH_W) 'src/processor/map_serializers_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/map_serializers_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Tpo src/processor/$(DEPDIR)/src_processor_map_serializers_unittest-map_serializers_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/map_serializers_unittest.cc' object='src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_map_serializers_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_map_serializers_unittest-map_serializers_unittest.obj `if test -f 'src/processor/map_serializers_unittest.cc'; then $(CYGPATH_W) 'src/processor/map_serializers_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/map_serializers_unittest.cc'; fi`
-
-src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o: src/processor/microdump_processor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Tpo -c -o src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o `test -f 'src/processor/microdump_processor_unittest.cc' || echo '$(srcdir)/'`src/processor/microdump_processor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Tpo src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/microdump_processor_unittest.cc' object='src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.o `test -f 'src/processor/microdump_processor_unittest.cc' || echo '$(srcdir)/'`src/processor/microdump_processor_unittest.cc
-
-src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.obj: src/processor/microdump_processor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Tpo -c -o src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.obj `if test -f 'src/processor/microdump_processor_unittest.cc'; then $(CYGPATH_W) 'src/processor/microdump_processor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/microdump_processor_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Tpo src/processor/$(DEPDIR)/src_processor_microdump_processor_unittest-microdump_processor_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/microdump_processor_unittest.cc' object='src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_microdump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_microdump_processor_unittest-microdump_processor_unittest.obj `if test -f 'src/processor/microdump_processor_unittest.cc'; then $(CYGPATH_W) 'src/processor/microdump_processor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/microdump_processor_unittest.cc'; fi`
-
-src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o: src/processor/minidump_processor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Tpo -c -o src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o `test -f 'src/processor/minidump_processor_unittest.cc' || echo '$(srcdir)/'`src/processor/minidump_processor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Tpo src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/minidump_processor_unittest.cc' object='src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.o `test -f 'src/processor/minidump_processor_unittest.cc' || echo '$(srcdir)/'`src/processor/minidump_processor_unittest.cc
-
-src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.obj: src/processor/minidump_processor_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Tpo -c -o src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.obj `if test -f 'src/processor/minidump_processor_unittest.cc'; then $(CYGPATH_W) 'src/processor/minidump_processor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump_processor_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Tpo src/processor/$(DEPDIR)/src_processor_minidump_processor_unittest-minidump_processor_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/minidump_processor_unittest.cc' object='src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_processor_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_processor_unittest-minidump_processor_unittest.obj `if test -f 'src/processor/minidump_processor_unittest.cc'; then $(CYGPATH_W) 'src/processor/minidump_processor_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump_processor_unittest.cc'; fi`
-
-src/common/src_processor_minidump_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_minidump_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Tpo -c -o src/common/src_processor_minidump_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_minidump_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_minidump_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_minidump_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_minidump_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Tpo -c -o src/common/src_processor_minidump_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_minidump_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_minidump_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_minidump_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_minidump_unittest-minidump_unittest.o: src/processor/minidump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_unittest-minidump_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Tpo -c -o src/processor/src_processor_minidump_unittest-minidump_unittest.o `test -f 'src/processor/minidump_unittest.cc' || echo '$(srcdir)/'`src/processor/minidump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Tpo src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/minidump_unittest.cc' object='src/processor/src_processor_minidump_unittest-minidump_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_unittest-minidump_unittest.o `test -f 'src/processor/minidump_unittest.cc' || echo '$(srcdir)/'`src/processor/minidump_unittest.cc
-
-src/processor/src_processor_minidump_unittest-minidump_unittest.obj: src/processor/minidump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_unittest-minidump_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Tpo -c -o src/processor/src_processor_minidump_unittest-minidump_unittest.obj `if test -f 'src/processor/minidump_unittest.cc'; then $(CYGPATH_W) 'src/processor/minidump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Tpo src/processor/$(DEPDIR)/src_processor_minidump_unittest-minidump_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/minidump_unittest.cc' object='src/processor/src_processor_minidump_unittest-minidump_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_unittest-minidump_unittest.obj `if test -f 'src/processor/minidump_unittest.cc'; then $(CYGPATH_W) 'src/processor/minidump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/minidump_unittest.cc'; fi`
-
-src/processor/src_processor_minidump_unittest-synth_minidump.o: src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_unittest-synth_minidump.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_minidump_unittest-synth_minidump.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
-
-src/processor/src_processor_minidump_unittest-synth_minidump.obj: src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_minidump_unittest-synth_minidump.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_minidump_unittest-synth_minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_minidump_unittest-synth_minidump.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-
-src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o: src/processor/proc_maps_linux.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.o `test -f 'src/processor/proc_maps_linux.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux.cc
-
-src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj: src/processor/proc_maps_linux.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux.obj `if test -f 'src/processor/proc_maps_linux.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux.cc'; fi`
-
-src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o: src/processor/proc_maps_linux_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o `test -f 'src/processor/proc_maps_linux_unittest.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux_unittest.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.o `test -f 'src/processor/proc_maps_linux_unittest.cc' || echo '$(srcdir)/'`src/processor/proc_maps_linux_unittest.cc
-
-src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj: src/processor/proc_maps_linux_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj `if test -f 'src/processor/proc_maps_linux_unittest.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Tpo src/processor/$(DEPDIR)/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/proc_maps_linux_unittest.cc' object='src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_proc_maps_linux_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_proc_maps_linux_unittest-proc_maps_linux_unittest.obj `if test -f 'src/processor/proc_maps_linux_unittest.cc'; then $(CYGPATH_W) 'src/processor/proc_maps_linux_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/proc_maps_linux_unittest.cc'; fi`
-
-src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.o: src/processor/range_map_shrink_down_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_shrink_down_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Tpo -c -o src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.o `test -f 'src/processor/range_map_shrink_down_unittest.cc' || echo '$(srcdir)/'`src/processor/range_map_shrink_down_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Tpo src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/range_map_shrink_down_unittest.cc' object='src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_shrink_down_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.o `test -f 'src/processor/range_map_shrink_down_unittest.cc' || echo '$(srcdir)/'`src/processor/range_map_shrink_down_unittest.cc
-
-src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.obj: src/processor/range_map_shrink_down_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_shrink_down_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Tpo -c -o src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.obj `if test -f 'src/processor/range_map_shrink_down_unittest.cc'; then $(CYGPATH_W) 'src/processor/range_map_shrink_down_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/range_map_shrink_down_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Tpo src/processor/$(DEPDIR)/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/range_map_shrink_down_unittest.cc' object='src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_range_map_shrink_down_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_range_map_shrink_down_unittest-range_map_shrink_down_unittest.obj `if test -f 'src/processor/range_map_shrink_down_unittest.cc'; then $(CYGPATH_W) 'src/processor/range_map_shrink_down_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/range_map_shrink_down_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_address_list_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_address_list_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_address_list_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_address_list_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_address_list_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_address_list_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.o: src/processor/stackwalker_address_list_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Tpo -c -o src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.o `test -f 'src/processor/stackwalker_address_list_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_address_list_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_address_list_unittest.cc' object='src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.o `test -f 'src/processor/stackwalker_address_list_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_address_list_unittest.cc
-
-src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.obj: src/processor/stackwalker_address_list_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Tpo -c -o src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.obj `if test -f 'src/processor/stackwalker_address_list_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_address_list_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_address_list_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_address_list_unittest.cc' object='src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_address_list_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_address_list_unittest-stackwalker_address_list_unittest.obj `if test -f 'src/processor/stackwalker_address_list_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_address_list_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_address_list_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_amd64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_amd64_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_amd64_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_amd64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_amd64_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_amd64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.o: src/processor/stackwalker_amd64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.o `test -f 'src/processor/stackwalker_amd64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_amd64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_amd64_unittest.cc' object='src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.o `test -f 'src/processor/stackwalker_amd64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_amd64_unittest.cc
-
-src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.obj: src/processor/stackwalker_amd64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.obj `if test -f 'src/processor/stackwalker_amd64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_amd64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_amd64_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_amd64_unittest.cc' object='src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_amd64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_amd64_unittest-stackwalker_amd64_unittest.obj `if test -f 'src/processor/stackwalker_amd64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_amd64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_amd64_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_arm64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_arm64_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_arm64_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_arm64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_arm64_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_arm64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.o: src/processor/stackwalker_arm64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.o `test -f 'src/processor/stackwalker_arm64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_arm64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_arm64_unittest.cc' object='src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.o `test -f 'src/processor/stackwalker_arm64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_arm64_unittest.cc
-
-src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.obj: src/processor/stackwalker_arm64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.obj `if test -f 'src/processor/stackwalker_arm64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_arm64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_arm64_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_arm64_unittest.cc' object='src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_arm64_unittest-stackwalker_arm64_unittest.obj `if test -f 'src/processor/stackwalker_arm64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_arm64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_arm64_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_arm_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_arm_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_arm_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_arm_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_arm_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_arm_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_arm_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_arm_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_arm_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_arm_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_arm_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.o: src/processor/stackwalker_arm_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Tpo -c -o src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.o `test -f 'src/processor/stackwalker_arm_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_arm_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_arm_unittest.cc' object='src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.o `test -f 'src/processor/stackwalker_arm_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_arm_unittest.cc
-
-src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.obj: src/processor/stackwalker_arm_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Tpo -c -o src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.obj `if test -f 'src/processor/stackwalker_arm_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_arm_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_arm_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_arm_unittest.cc' object='src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_arm_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_arm_unittest-stackwalker_arm_unittest.obj `if test -f 'src/processor/stackwalker_arm_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_arm_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_arm_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_mips64_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o: src/processor/stackwalker_mips64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o `test -f 'src/processor/stackwalker_mips64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_mips64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_mips64_unittest.cc' object='src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.o `test -f 'src/processor/stackwalker_mips64_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_mips64_unittest.cc
-
-src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj: src/processor/stackwalker_mips64_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj `if test -f 'src/processor/stackwalker_mips64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips64_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_mips64_unittest.cc' object='src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips64_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips64_unittest-stackwalker_mips64_unittest.obj `if test -f 'src/processor/stackwalker_mips64_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips64_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips64_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_mips_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_mips_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_mips_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_mips_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_mips_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_mips_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_mips_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_mips_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_mips_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.o: src/processor/stackwalker_mips_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Tpo -c -o src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.o `test -f 'src/processor/stackwalker_mips_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_mips_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_mips_unittest.cc' object='src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.o `test -f 'src/processor/stackwalker_mips_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_mips_unittest.cc
-
-src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.obj: src/processor/stackwalker_mips_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Tpo -c -o src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.obj `if test -f 'src/processor/stackwalker_mips_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_mips_unittest.cc' object='src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_mips_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_mips_unittest-stackwalker_mips_unittest.obj `if test -f 'src/processor/stackwalker_mips_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_mips_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_mips_unittest.cc'; fi`
-
-src/common/src_processor_stackwalker_x86_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_x86_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_x86_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_x86_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_x86_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_stackwalker_x86_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_stackwalker_x86_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Tpo -c -o src/common/src_processor_stackwalker_x86_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_stackwalker_x86_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_stackwalker_x86_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_stackwalker_x86_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.o: src/processor/stackwalker_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Tpo -c -o src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.o `test -f 'src/processor/stackwalker_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_x86_unittest.cc' object='src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.o `test -f 'src/processor/stackwalker_x86_unittest.cc' || echo '$(srcdir)/'`src/processor/stackwalker_x86_unittest.cc
-
-src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.obj: src/processor/stackwalker_x86_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Tpo -c -o src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.obj `if test -f 'src/processor/stackwalker_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_x86_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Tpo src/processor/$(DEPDIR)/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/stackwalker_x86_unittest.cc' object='src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_stackwalker_x86_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_stackwalker_x86_unittest-stackwalker_x86_unittest.obj `if test -f 'src/processor/stackwalker_x86_unittest.cc'; then $(CYGPATH_W) 'src/processor/stackwalker_x86_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/stackwalker_x86_unittest.cc'; fi`
-
-src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o: src/processor/static_address_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Tpo -c -o src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o `test -f 'src/processor/static_address_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_address_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_address_map_unittest.cc' object='src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.o `test -f 'src/processor/static_address_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_address_map_unittest.cc
-
-src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.obj: src/processor/static_address_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Tpo -c -o src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.obj `if test -f 'src/processor/static_address_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_address_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_address_map_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_address_map_unittest-static_address_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_address_map_unittest.cc' object='src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_address_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_address_map_unittest-static_address_map_unittest.obj `if test -f 'src/processor/static_address_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_address_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_address_map_unittest.cc'; fi`
-
-src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o: src/processor/static_contained_range_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Tpo -c -o src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o `test -f 'src/processor/static_contained_range_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_contained_range_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_contained_range_map_unittest.cc' object='src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.o `test -f 'src/processor/static_contained_range_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_contained_range_map_unittest.cc
-
-src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.obj: src/processor/static_contained_range_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Tpo -c -o src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.obj `if test -f 'src/processor/static_contained_range_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_contained_range_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_contained_range_map_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_contained_range_map_unittest.cc' object='src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_contained_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_contained_range_map_unittest-static_contained_range_map_unittest.obj `if test -f 'src/processor/static_contained_range_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_contained_range_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_contained_range_map_unittest.cc'; fi`
-
-src/processor/src_processor_static_map_unittest-static_map_unittest.o: src/processor/static_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_map_unittest-static_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Tpo -c -o src/processor/src_processor_static_map_unittest-static_map_unittest.o `test -f 'src/processor/static_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_map_unittest.cc' object='src/processor/src_processor_static_map_unittest-static_map_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_map_unittest-static_map_unittest.o `test -f 'src/processor/static_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_map_unittest.cc
-
-src/processor/src_processor_static_map_unittest-static_map_unittest.obj: src/processor/static_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_map_unittest-static_map_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Tpo -c -o src/processor/src_processor_static_map_unittest-static_map_unittest.obj `if test -f 'src/processor/static_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_map_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_map_unittest-static_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_map_unittest.cc' object='src/processor/src_processor_static_map_unittest-static_map_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_map_unittest-static_map_unittest.obj `if test -f 'src/processor/static_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_map_unittest.cc'; fi`
-
-src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o: src/processor/static_range_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Tpo -c -o src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o `test -f 'src/processor/static_range_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_range_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_range_map_unittest.cc' object='src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.o `test -f 'src/processor/static_range_map_unittest.cc' || echo '$(srcdir)/'`src/processor/static_range_map_unittest.cc
-
-src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.obj: src/processor/static_range_map_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Tpo -c -o src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.obj `if test -f 'src/processor/static_range_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_range_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_range_map_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Tpo src/processor/$(DEPDIR)/src_processor_static_range_map_unittest-static_range_map_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/static_range_map_unittest.cc' object='src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_static_range_map_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_static_range_map_unittest-static_range_map_unittest.obj `if test -f 'src/processor/static_range_map_unittest.cc'; then $(CYGPATH_W) 'src/processor/static_range_map_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/static_range_map_unittest.cc'; fi`
-
-src/common/src_processor_synth_minidump_unittest-test_assembler.o: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_synth_minidump_unittest-test_assembler.o -MD -MP -MF src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Tpo -c -o src/common/src_processor_synth_minidump_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_synth_minidump_unittest-test_assembler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_synth_minidump_unittest-test_assembler.o `test -f 'src/common/test_assembler.cc' || echo '$(srcdir)/'`src/common/test_assembler.cc
-
-src/common/src_processor_synth_minidump_unittest-test_assembler.obj: src/common/test_assembler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_processor_synth_minidump_unittest-test_assembler.obj -MD -MP -MF src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Tpo -c -o src/common/src_processor_synth_minidump_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Tpo src/common/$(DEPDIR)/src_processor_synth_minidump_unittest-test_assembler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/test_assembler.cc' object='src/common/src_processor_synth_minidump_unittest-test_assembler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_processor_synth_minidump_unittest-test_assembler.obj `if test -f 'src/common/test_assembler.cc'; then $(CYGPATH_W) 'src/common/test_assembler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/test_assembler.cc'; fi`
-
-src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.o: src/processor/synth_minidump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.o `test -f 'src/processor/synth_minidump_unittest.cc' || echo '$(srcdir)/'`src/processor/synth_minidump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump_unittest.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.o `test -f 'src/processor/synth_minidump_unittest.cc' || echo '$(srcdir)/'`src/processor/synth_minidump_unittest.cc
-
-src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj: src/processor/synth_minidump_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj `if test -f 'src/processor/synth_minidump_unittest.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump_unittest.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump_unittest.obj `if test -f 'src/processor/synth_minidump_unittest.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump_unittest.cc'; fi`
-
-src/processor/src_processor_synth_minidump_unittest-synth_minidump.o: src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump.o -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.o `test -f 'src/processor/synth_minidump.cc' || echo '$(srcdir)/'`src/processor/synth_minidump.cc
-
-src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj: src/processor/synth_minidump.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj -MD -MP -MF src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Tpo src/processor/$(DEPDIR)/src_processor_synth_minidump_unittest-synth_minidump.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/processor/synth_minidump.cc' object='src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_processor_synth_minidump_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/processor/src_processor_synth_minidump_unittest-synth_minidump.obj `if test -f 'src/processor/synth_minidump.cc'; then $(CYGPATH_W) 'src/processor/synth_minidump.cc'; else $(CYGPATH_W) '$(srcdir)/src/processor/synth_minidump.cc'; fi`
-
-src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o: src/tools/linux/md2core/minidump_memory_range_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o -MD -MP -MF src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Tpo -c -o src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o `test -f 'src/tools/linux/md2core/minidump_memory_range_unittest.cc' || echo '$(srcdir)/'`src/tools/linux/md2core/minidump_memory_range_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Tpo src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/linux/md2core/minidump_memory_range_unittest.cc' object='src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.o `test -f 'src/tools/linux/md2core/minidump_memory_range_unittest.cc' || echo '$(srcdir)/'`src/tools/linux/md2core/minidump_memory_range_unittest.cc
-
-src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj: src/tools/linux/md2core/minidump_memory_range_unittest.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj -MD -MP -MF src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Tpo -c -o src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj `if test -f 'src/tools/linux/md2core/minidump_memory_range_unittest.cc'; then $(CYGPATH_W) 'src/tools/linux/md2core/minidump_memory_range_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/linux/md2core/minidump_memory_range_unittest.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Tpo src/tools/linux/md2core/$(DEPDIR)/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/linux/md2core/minidump_memory_range_unittest.cc' object='src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(src_tools_linux_md2core_minidump_2_core_unittest_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/linux/md2core/src_tools_linux_md2core_minidump_2_core_unittest-minidump_memory_range_unittest.obj `if test -f 'src/tools/linux/md2core/minidump_memory_range_unittest.cc'; then $(CYGPATH_W) 'src/tools/linux/md2core/minidump_memory_range_unittest.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/linux/md2core/minidump_memory_range_unittest.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o: src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.o `test -f 'src/common/dwarf_cfi_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cfi_to_module.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj: src/common/dwarf_cfi_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cfi_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cfi_to_module.obj `if test -f 'src/common/dwarf_cfi_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cfi_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cfi_to_module.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o: src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.o `test -f 'src/common/dwarf_cu_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_cu_to_module.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj: src/common/dwarf_cu_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_cu_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_cu_to_module.obj `if test -f 'src/common/dwarf_cu_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_cu_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_cu_to_module.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o: src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.o `test -f 'src/common/dwarf_line_to_module.cc' || echo '$(srcdir)/'`src/common/dwarf_line_to_module.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj: src/common/dwarf_line_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf_line_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-dwarf_line_to_module.obj `if test -f 'src/common/dwarf_line_to_module.cc'; then $(CYGPATH_W) 'src/common/dwarf_line_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf_line_to_module.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o: src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.o `test -f 'src/common/language.cc' || echo '$(srcdir)/'`src/common/language.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj: src/common/language.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-language.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/language.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-language.obj `if test -f 'src/common/language.cc'; then $(CYGPATH_W) 'src/common/language.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/language.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o: src/common/md5.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.o `test -f 'src/common/md5.cc' || echo '$(srcdir)/'`src/common/md5.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj: src/common/md5.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-md5.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/md5.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-md5.obj `if test -f 'src/common/md5.cc'; then $(CYGPATH_W) 'src/common/md5.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/md5.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o: src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.o `test -f 'src/common/module.cc' || echo '$(srcdir)/'`src/common/module.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj: src/common/module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-module.obj `if test -f 'src/common/module.cc'; then $(CYGPATH_W) 'src/common/module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/module.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o: src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.o `test -f 'src/common/stabs_reader.cc' || echo '$(srcdir)/'`src/common/stabs_reader.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj: src/common/stabs_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_reader.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_reader.obj `if test -f 'src/common/stabs_reader.cc'; then $(CYGPATH_W) 'src/common/stabs_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_reader.cc'; fi`
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o: src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.o `test -f 'src/common/stabs_to_module.cc' || echo '$(srcdir)/'`src/common/stabs_to_module.cc
-
-src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj: src/common/stabs_to_module.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj -MD -MP -MF src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Tpo src/common/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/stabs_to_module.cc' object='src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/src_tools_mac_dump_syms_dump_syms_mac-stabs_to_module.obj `if test -f 'src/common/stabs_to_module.cc'; then $(CYGPATH_W) 'src/common/stabs_to_module.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/stabs_to_module.cc'; fi`
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o: src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.o `test -f 'src/common/dwarf/bytereader.cc' || echo '$(srcdir)/'`src/common/dwarf/bytereader.cc
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj: src/common/dwarf/bytereader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-bytereader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/bytereader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-bytereader.obj `if test -f 'src/common/dwarf/bytereader.cc'; then $(CYGPATH_W) 'src/common/dwarf/bytereader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/bytereader.cc'; fi`
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o: src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.o `test -f 'src/common/dwarf/dwarf2diehandler.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2diehandler.cc
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj: src/common/dwarf/dwarf2diehandler.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2diehandler.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2diehandler.obj `if test -f 'src/common/dwarf/dwarf2diehandler.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2diehandler.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2diehandler.cc'; fi`
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o: src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.o `test -f 'src/common/dwarf/dwarf2reader.cc' || echo '$(srcdir)/'`src/common/dwarf/dwarf2reader.cc
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj: src/common/dwarf/dwarf2reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/dwarf2reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-dwarf2reader.obj `if test -f 'src/common/dwarf/dwarf2reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/dwarf2reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/dwarf2reader.cc'; fi`
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o: src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.o `test -f 'src/common/dwarf/elf_reader.cc' || echo '$(srcdir)/'`src/common/dwarf/elf_reader.cc
-
-src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj: src/common/dwarf/elf_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj -MD -MP -MF src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Tpo src/common/dwarf/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/dwarf/elf_reader.cc' object='src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/dwarf/src_tools_mac_dump_syms_dump_syms_mac-elf_reader.obj `if test -f 'src/common/dwarf/elf_reader.cc'; then $(CYGPATH_W) 'src/common/dwarf/elf_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/dwarf/elf_reader.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o: src/common/mac/arch_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.o `test -f 'src/common/mac/arch_utilities.cc' || echo '$(srcdir)/'`src/common/mac/arch_utilities.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj: src/common/mac/arch_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/arch_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-arch_utilities.obj `if test -f 'src/common/mac/arch_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/arch_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/arch_utilities.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o: src/common/mac/dump_syms.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o `test -f 'src/common/mac/dump_syms.cc' || echo '$(srcdir)/'`src/common/mac/dump_syms.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/dump_syms.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.o `test -f 'src/common/mac/dump_syms.cc' || echo '$(srcdir)/'`src/common/mac/dump_syms.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj: src/common/mac/dump_syms.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj `if test -f 'src/common/mac/dump_syms.cc'; then $(CYGPATH_W) 'src/common/mac/dump_syms.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/dump_syms.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/dump_syms.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-dump_syms.obj `if test -f 'src/common/mac/dump_syms.cc'; then $(CYGPATH_W) 'src/common/mac/dump_syms.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/dump_syms.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o: src/common/mac/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.o `test -f 'src/common/mac/file_id.cc' || echo '$(srcdir)/'`src/common/mac/file_id.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj: src/common/mac/file_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-file_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/file_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-file_id.obj `if test -f 'src/common/mac/file_id.cc'; then $(CYGPATH_W) 'src/common/mac/file_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/file_id.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o: src/common/mac/macho_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.o `test -f 'src/common/mac/macho_id.cc' || echo '$(srcdir)/'`src/common/mac/macho_id.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj: src/common/mac/macho_id.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_id.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_id.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_id.obj `if test -f 'src/common/mac/macho_id.cc'; then $(CYGPATH_W) 'src/common/mac/macho_id.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_id.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o: src/common/mac/macho_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.o `test -f 'src/common/mac/macho_reader.cc' || echo '$(srcdir)/'`src/common/mac/macho_reader.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj: src/common/mac/macho_reader.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_reader.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_reader.obj `if test -f 'src/common/mac/macho_reader.cc'; then $(CYGPATH_W) 'src/common/mac/macho_reader.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_reader.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o: src/common/mac/macho_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.o `test -f 'src/common/mac/macho_utilities.cc' || echo '$(srcdir)/'`src/common/mac/macho_utilities.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj: src/common/mac/macho_utilities.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_utilities.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_utilities.obj `if test -f 'src/common/mac/macho_utilities.cc'; then $(CYGPATH_W) 'src/common/mac/macho_utilities.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_utilities.cc'; fi`
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o: src/common/mac/macho_walker.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.o `test -f 'src/common/mac/macho_walker.cc' || echo '$(srcdir)/'`src/common/mac/macho_walker.cc
-
-src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj: src/common/mac/macho_walker.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj -MD -MP -MF src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Tpo src/common/mac/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/common/mac/macho_walker.cc' object='src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/common/mac/src_tools_mac_dump_syms_dump_syms_mac-macho_walker.obj `if test -f 'src/common/mac/macho_walker.cc'; then $(CYGPATH_W) 'src/common/mac/macho_walker.cc'; else $(CYGPATH_W) '$(srcdir)/src/common/mac/macho_walker.cc'; fi`
-
-src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o: src/tools/mac/dump_syms/dump_syms_tool.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o -MD -MP -MF src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o `test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc' || echo '$(srcdir)/'`src/tools/mac/dump_syms/dump_syms_tool.cc
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/mac/dump_syms/dump_syms_tool.cc' object='src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.o `test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc' || echo '$(srcdir)/'`src/tools/mac/dump_syms/dump_syms_tool.cc
-
-src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj: src/tools/mac/dump_syms/dump_syms_tool.cc
-@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -MT src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj -MD -MP -MF src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj `if test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc'; then $(CYGPATH_W) 'src/tools/mac/dump_syms/dump_syms_tool.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/mac/dump_syms/dump_syms_tool.cc'; fi`
-@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Tpo src/tools/mac/dump_syms/$(DEPDIR)/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.Po
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='src/tools/mac/dump_syms/dump_syms_tool.cc' object='src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(src_tools_mac_dump_syms_dump_syms_mac_CXXFLAGS) $(CXXFLAGS) -c -o src/tools/mac/dump_syms/src_tools_mac_dump_syms_dump_syms_mac-dump_syms_tool.obj `if test -f 'src/tools/mac/dump_syms/dump_syms_tool.cc'; then $(CYGPATH_W) 'src/tools/mac/dump_syms/dump_syms_tool.cc'; else $(CYGPATH_W) '$(srcdir)/src/tools/mac/dump_syms/dump_syms_tool.cc'; fi`
-install-dist_docDATA: $(dist_doc_DATA)
- @$(NORMAL_INSTALL)
- @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
- done
-
-uninstall-dist_docDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(dist_doc_DATA)'; test -n "$(docdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
-install-pkgconfigDATA: $(pkgconfig_DATA)
- @$(NORMAL_INSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \
- done
-
-uninstall-pkgconfigDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir)
-install-includecHEADERS: $(includec_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includec_HEADERS)'; test -n "$(includecdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includecdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includecdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includecdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includecdir)" || exit $$?; \
- done
-
-uninstall-includecHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includec_HEADERS)'; test -n "$(includecdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includecdir)'; $(am__uninstall_files_from_dir)
-install-includeclHEADERS: $(includecl_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includecl_HEADERS)'; test -n "$(includecldir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includecldir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includecldir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includecldir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includecldir)" || exit $$?; \
- done
-
-uninstall-includeclHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includecl_HEADERS)'; test -n "$(includecldir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includecldir)'; $(am__uninstall_files_from_dir)
-install-includeclcHEADERS: $(includeclc_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includeclc_HEADERS)'; test -n "$(includeclcdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includeclcdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includeclcdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includeclcdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includeclcdir)" || exit $$?; \
- done
-
-uninstall-includeclcHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includeclc_HEADERS)'; test -n "$(includeclcdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includeclcdir)'; $(am__uninstall_files_from_dir)
-install-includecldwcHEADERS: $(includecldwc_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includecldwc_HEADERS)'; test -n "$(includecldwcdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includecldwcdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includecldwcdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includecldwcdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includecldwcdir)" || exit $$?; \
- done
-
-uninstall-includecldwcHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includecldwc_HEADERS)'; test -n "$(includecldwcdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includecldwcdir)'; $(am__uninstall_files_from_dir)
-install-includeclhHEADERS: $(includeclh_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includeclh_HEADERS)'; test -n "$(includeclhdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includeclhdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includeclhdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includeclhdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includeclhdir)" || exit $$?; \
- done
-
-uninstall-includeclhHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includeclh_HEADERS)'; test -n "$(includeclhdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includeclhdir)'; $(am__uninstall_files_from_dir)
-install-includeclmHEADERS: $(includeclm_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includeclm_HEADERS)'; test -n "$(includeclmdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includeclmdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includeclmdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includeclmdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includeclmdir)" || exit $$?; \
- done
-
-uninstall-includeclmHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includeclm_HEADERS)'; test -n "$(includeclmdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includeclmdir)'; $(am__uninstall_files_from_dir)
-install-includegbcHEADERS: $(includegbc_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includegbc_HEADERS)'; test -n "$(includegbcdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includegbcdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includegbcdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includegbcdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includegbcdir)" || exit $$?; \
- done
-
-uninstall-includegbcHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includegbc_HEADERS)'; test -n "$(includegbcdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includegbcdir)'; $(am__uninstall_files_from_dir)
-install-includelssHEADERS: $(includelss_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includelss_HEADERS)'; test -n "$(includelssdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includelssdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includelssdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includelssdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includelssdir)" || exit $$?; \
- done
-
-uninstall-includelssHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includelss_HEADERS)'; test -n "$(includelssdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includelssdir)'; $(am__uninstall_files_from_dir)
-install-includepHEADERS: $(includep_HEADERS)
- @$(NORMAL_INSTALL)
- @list='$(includep_HEADERS)'; test -n "$(includepdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(includepdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(includepdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includepdir)'"; \
- $(INSTALL_HEADER) $$files "$(DESTDIR)$(includepdir)" || exit $$?; \
- done
-
-uninstall-includepHEADERS:
- @$(NORMAL_UNINSTALL)
- @list='$(includep_HEADERS)'; test -n "$(includepdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(includepdir)'; $(am__uninstall_files_from_dir)
-
-ID: $(am__tagged_files)
- $(am__define_uniq_tagged_files); mkid -fID $$unique
-tags: tags-am
-TAGS: tags
-
-tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
- set x; \
- here=`pwd`; \
- $(am__define_uniq_tagged_files); \
- shift; \
- if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- if test $$# -gt 0; then \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- "$$@" $$unique; \
- else \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$unique; \
- fi; \
- fi
-ctags: ctags-am
-
-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
-
-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-am
-
-cscopelist-am: $(am__tagged_files)
- list='$(am__tagged_files)'; \
- case "$(srcdir)" in \
- [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
- *) sdir=$(subdir)/$(srcdir) ;; \
- esac; \
- for i in $$list; do \
- if test -f "$$i"; then \
- echo "$(subdir)/$$i"; \
- else \
- echo "$$sdir/$$i"; \
- fi; \
- done >> $(top_builddir)/cscope.files
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
- -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-
-# Recover from deleted '.trs' file; this should ensure that
-# "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create
-# both 'foo.log' and 'foo.trs'. Break the recipe in two subshells
-# to avoid problems with "make -n".
-.log.trs:
- rm -f $< $@
- $(MAKE) $(AM_MAKEFLAGS) $<
-
-# Leading 'am--fnord' is there to ensure the list of targets does not
-# expand to empty, as could happen e.g. with make check TESTS=''.
-am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck)
-am--force-recheck:
- @:
-
-$(TEST_SUITE_LOG): $(TEST_LOGS)
- @$(am__set_TESTS_bases); \
- am__f_ok () { test -f "$$1" && test -r "$$1"; }; \
- redo_bases=`for i in $$bases; do \
- am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \
- done`; \
- if test -n "$$redo_bases"; then \
- redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \
- redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \
- if $(am__make_dryrun); then :; else \
- rm -f $$redo_logs && rm -f $$redo_results || exit 1; \
- fi; \
- fi; \
- if test -n "$$am__remaking_logs"; then \
- echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
- "recursion detected" >&2; \
- elif test -n "$$redo_logs"; then \
- am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
- fi; \
- if $(am__make_dryrun); then :; else \
- st=0; \
- errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \
- for i in $$redo_bases; do \
- test -f $$i.trs && test -r $$i.trs \
- || { echo "$$errmsg $$i.trs" >&2; st=1; }; \
- test -f $$i.log && test -r $$i.log \
- || { echo "$$errmsg $$i.log" >&2; st=1; }; \
- done; \
- test $$st -eq 0 || exit 1; \
- fi
- @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \
- ws='[ ]'; \
- results=`for b in $$bases; do echo $$b.trs; done`; \
- test -n "$$results" || results=/dev/null; \
- all=` grep "^$$ws*:test-result:" $$results | wc -l`; \
- pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \
- fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \
- skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \
- xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \
- xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \
- error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \
- if test `expr $$fail + $$xpass + $$error` -eq 0; then \
- success=true; \
- else \
- success=false; \
- fi; \
- br='==================='; br=$$br$$br$$br$$br; \
- result_count () \
- { \
- if test x"$$1" = x"--maybe-color"; then \
- maybe_colorize=yes; \
- elif test x"$$1" = x"--no-color"; then \
- maybe_colorize=no; \
- else \
- echo "$@: invalid 'result_count' usage" >&2; exit 4; \
- fi; \
- shift; \
- desc=$$1 count=$$2; \
- if test $$maybe_colorize = yes && test $$count -gt 0; then \
- color_start=$$3 color_end=$$std; \
- else \
- color_start= color_end=; \
- fi; \
- echo "$${color_start}# $$desc $$count$${color_end}"; \
- }; \
- create_testsuite_report () \
- { \
- result_count $$1 "TOTAL:" $$all "$$brg"; \
- result_count $$1 "PASS: " $$pass "$$grn"; \
- result_count $$1 "SKIP: " $$skip "$$blu"; \
- result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
- result_count $$1 "FAIL: " $$fail "$$red"; \
- result_count $$1 "XPASS:" $$xpass "$$red"; \
- result_count $$1 "ERROR:" $$error "$$mgn"; \
- }; \
- { \
- echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \
- $(am__rst_title); \
- create_testsuite_report --no-color; \
- echo; \
- echo ".. contents:: :depth: 2"; \
- echo; \
- for b in $$bases; do echo $$b; done \
- | $(am__create_global_log); \
- } >$(TEST_SUITE_LOG).tmp || exit 1; \
- mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \
- if $$success; then \
- col="$$grn"; \
- else \
- col="$$red"; \
- test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
- fi; \
- echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
- echo "$${col}$$br$${std}"; \
- create_testsuite_report --maybe-color; \
- echo "$$col$$br$$std"; \
- if $$success; then :; else \
- echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \
- if test -n "$(PACKAGE_BUGREPORT)"; then \
- echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
- fi; \
- echo "$$col$$br$$std"; \
- fi; \
- $$success || exit 1
-
-check-TESTS:
- @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
- @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
- @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
- @set +e; $(am__set_TESTS_bases); \
- log_list=`for i in $$bases; do echo $$i.log; done`; \
- trs_list=`for i in $$bases; do echo $$i.trs; done`; \
- log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
- $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
- exit $$?;
-recheck: all $(check_LIBRARIES) $(check_PROGRAMS) $(check_SCRIPTS)
- @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
- @set +e; $(am__set_TESTS_bases); \
- bases=`for i in $$bases; do echo $$i; done \
- | $(am__list_recheck_tests)` || exit 1; \
- log_list=`for i in $$bases; do echo $$i.log; done`; \
- log_list=`echo $$log_list`; \
- $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \
- am__force_recheck=am--force-recheck \
- TEST_LOGS="$$log_list"; \
- exit $$?
-src/common/test_assembler_unittest.log: src/common/test_assembler_unittest$(EXEEXT)
- @p='src/common/test_assembler_unittest$(EXEEXT)'; \
- b='src/common/test_assembler_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/address_map_unittest.log: src/processor/address_map_unittest$(EXEEXT)
- @p='src/processor/address_map_unittest$(EXEEXT)'; \
- b='src/processor/address_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/basic_source_line_resolver_unittest.log: src/processor/basic_source_line_resolver_unittest$(EXEEXT)
- @p='src/processor/basic_source_line_resolver_unittest$(EXEEXT)'; \
- b='src/processor/basic_source_line_resolver_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/cfi_frame_info_unittest.log: src/processor/cfi_frame_info_unittest$(EXEEXT)
- @p='src/processor/cfi_frame_info_unittest$(EXEEXT)'; \
- b='src/processor/cfi_frame_info_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/contained_range_map_unittest.log: src/processor/contained_range_map_unittest$(EXEEXT)
- @p='src/processor/contained_range_map_unittest$(EXEEXT)'; \
- b='src/processor/contained_range_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/disassembler_x86_unittest.log: src/processor/disassembler_x86_unittest$(EXEEXT)
- @p='src/processor/disassembler_x86_unittest$(EXEEXT)'; \
- b='src/processor/disassembler_x86_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/exploitability_unittest.log: src/processor/exploitability_unittest$(EXEEXT)
- @p='src/processor/exploitability_unittest$(EXEEXT)'; \
- b='src/processor/exploitability_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/fast_source_line_resolver_unittest.log: src/processor/fast_source_line_resolver_unittest$(EXEEXT)
- @p='src/processor/fast_source_line_resolver_unittest$(EXEEXT)'; \
- b='src/processor/fast_source_line_resolver_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/map_serializers_unittest.log: src/processor/map_serializers_unittest$(EXEEXT)
- @p='src/processor/map_serializers_unittest$(EXEEXT)'; \
- b='src/processor/map_serializers_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/microdump_processor_unittest.log: src/processor/microdump_processor_unittest$(EXEEXT)
- @p='src/processor/microdump_processor_unittest$(EXEEXT)'; \
- b='src/processor/microdump_processor_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/minidump_processor_unittest.log: src/processor/minidump_processor_unittest$(EXEEXT)
- @p='src/processor/minidump_processor_unittest$(EXEEXT)'; \
- b='src/processor/minidump_processor_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/minidump_unittest.log: src/processor/minidump_unittest$(EXEEXT)
- @p='src/processor/minidump_unittest$(EXEEXT)'; \
- b='src/processor/minidump_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/static_address_map_unittest.log: src/processor/static_address_map_unittest$(EXEEXT)
- @p='src/processor/static_address_map_unittest$(EXEEXT)'; \
- b='src/processor/static_address_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/static_contained_range_map_unittest.log: src/processor/static_contained_range_map_unittest$(EXEEXT)
- @p='src/processor/static_contained_range_map_unittest$(EXEEXT)'; \
- b='src/processor/static_contained_range_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/static_map_unittest.log: src/processor/static_map_unittest$(EXEEXT)
- @p='src/processor/static_map_unittest$(EXEEXT)'; \
- b='src/processor/static_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/static_range_map_unittest.log: src/processor/static_range_map_unittest$(EXEEXT)
- @p='src/processor/static_range_map_unittest$(EXEEXT)'; \
- b='src/processor/static_range_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/pathname_stripper_unittest.log: src/processor/pathname_stripper_unittest$(EXEEXT)
- @p='src/processor/pathname_stripper_unittest$(EXEEXT)'; \
- b='src/processor/pathname_stripper_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/postfix_evaluator_unittest.log: src/processor/postfix_evaluator_unittest$(EXEEXT)
- @p='src/processor/postfix_evaluator_unittest$(EXEEXT)'; \
- b='src/processor/postfix_evaluator_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/proc_maps_linux_unittest.log: src/processor/proc_maps_linux_unittest$(EXEEXT)
- @p='src/processor/proc_maps_linux_unittest$(EXEEXT)'; \
- b='src/processor/proc_maps_linux_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/range_map_shrink_down_unittest.log: src/processor/range_map_shrink_down_unittest$(EXEEXT)
- @p='src/processor/range_map_shrink_down_unittest$(EXEEXT)'; \
- b='src/processor/range_map_shrink_down_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/range_map_unittest.log: src/processor/range_map_unittest$(EXEEXT)
- @p='src/processor/range_map_unittest$(EXEEXT)'; \
- b='src/processor/range_map_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_amd64_unittest.log: src/processor/stackwalker_amd64_unittest$(EXEEXT)
- @p='src/processor/stackwalker_amd64_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_amd64_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_arm_unittest.log: src/processor/stackwalker_arm_unittest$(EXEEXT)
- @p='src/processor/stackwalker_arm_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_arm_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_arm64_unittest.log: src/processor/stackwalker_arm64_unittest$(EXEEXT)
- @p='src/processor/stackwalker_arm64_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_arm64_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_address_list_unittest.log: src/processor/stackwalker_address_list_unittest$(EXEEXT)
- @p='src/processor/stackwalker_address_list_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_address_list_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_mips_unittest.log: src/processor/stackwalker_mips_unittest$(EXEEXT)
- @p='src/processor/stackwalker_mips_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_mips_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_mips64_unittest.log: src/processor/stackwalker_mips64_unittest$(EXEEXT)
- @p='src/processor/stackwalker_mips64_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_mips64_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_x86_unittest.log: src/processor/stackwalker_x86_unittest$(EXEEXT)
- @p='src/processor/stackwalker_x86_unittest$(EXEEXT)'; \
- b='src/processor/stackwalker_x86_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/synth_minidump_unittest.log: src/processor/synth_minidump_unittest$(EXEEXT)
- @p='src/processor/synth_minidump_unittest$(EXEEXT)'; \
- b='src/processor/synth_minidump_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/client/linux/linux_client_unittest.log: src/client/linux/linux_client_unittest$(EXEEXT)
- @p='src/client/linux/linux_client_unittest$(EXEEXT)'; \
- b='src/client/linux/linux_client_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/common/dumper_unittest.log: src/common/dumper_unittest$(EXEEXT)
- @p='src/common/dumper_unittest$(EXEEXT)'; \
- b='src/common/dumper_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/tools/linux/md2core/minidump_2_core_unittest.log: src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)
- @p='src/tools/linux/md2core/minidump_2_core_unittest$(EXEEXT)'; \
- b='src/tools/linux/md2core/minidump_2_core_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/common/mac/macho_reader_unittest.log: src/common/mac/macho_reader_unittest$(EXEEXT)
- @p='src/common/mac/macho_reader_unittest$(EXEEXT)'; \
- b='src/common/mac/macho_reader_unittest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/stackwalker_selftest.log: src/processor/stackwalker_selftest$(EXEEXT)
- @p='src/processor/stackwalker_selftest$(EXEEXT)'; \
- b='src/processor/stackwalker_selftest'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/microdump_stackwalk_test.log: src/processor/microdump_stackwalk_test
- @p='src/processor/microdump_stackwalk_test'; \
- b='src/processor/microdump_stackwalk_test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/microdump_stackwalk_machine_readable_test.log: src/processor/microdump_stackwalk_machine_readable_test
- @p='src/processor/microdump_stackwalk_machine_readable_test'; \
- b='src/processor/microdump_stackwalk_machine_readable_test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/minidump_dump_test.log: src/processor/minidump_dump_test
- @p='src/processor/minidump_dump_test'; \
- b='src/processor/minidump_dump_test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/minidump_stackwalk_test.log: src/processor/minidump_stackwalk_test
- @p='src/processor/minidump_stackwalk_test'; \
- b='src/processor/minidump_stackwalk_test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-src/processor/minidump_stackwalk_machine_readable_test.log: src/processor/minidump_stackwalk_machine_readable_test
- @p='src/processor/minidump_stackwalk_machine_readable_test'; \
- b='src/processor/minidump_stackwalk_machine_readable_test'; \
- $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-.test.log:
- @p='$<'; \
- $(am__set_b); \
- $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
- --log-file $$b.log --trs-file $$b.trs \
- $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
- "$$tst" $(AM_TESTS_FD_REDIRECT)
-@am__EXEEXT_TRUE@.test$(EXEEXT).log:
-@am__EXEEXT_TRUE@ @p='$<'; \
-@am__EXEEXT_TRUE@ $(am__set_b); \
-@am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \
-@am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \
-@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
-@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-
-distdir: $(DISTFILES)
- $(am__remove_distdir)
- test -d "$(distdir)" || mkdir "$(distdir)"
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test -d "$(distdir)/$$file"; then \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
- find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
- fi; \
- cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
- else \
- test -f "$(distdir)/$$file" \
- || cp -p $$d/$$file "$(distdir)/$$file" \
- || exit 1; \
- fi; \
- done
- -test -n "$(am__skip_mode_fix)" \
- || find "$(distdir)" -type d ! -perm -755 \
- -exec chmod u+rwx,go+rx {} \; -o \
- ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
- || chmod -R a+r "$(distdir)"
-dist-gzip: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__post_remove_distdir)
-
-dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
- $(am__post_remove_distdir)
-
-dist-lzip: distdir
- tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
- $(am__post_remove_distdir)
-
-dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
- $(am__post_remove_distdir)
-
-dist-tarZ: 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
- tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__post_remove_distdir)
-
-dist-shar: distdir
- @echo WARNING: "Support for shar distribution archives 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)
-
-dist-zip: distdir
- -rm -f $(distdir).zip
- zip -rq $(distdir).zip $(distdir)
- $(am__post_remove_distdir)
-
-dist dist-all:
- $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
- $(am__post_remove_distdir)
-
-# This target untars the dist file and tries a VPATH configuration. Then
-# it guarantees that the distribution is self-contained by making another
-# tarfile.
-distcheck: dist
- case '$(DIST_ARCHIVES)' in \
- *.tar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
- *.tar.bz2*) \
- bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lz*) \
- lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
- *.tar.xz*) \
- xz -dc $(distdir).tar.xz | $(am__untar) ;;\
- *.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
- *.shar.gz*) \
- GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
- *.zip*) \
- unzip $(distdir).zip ;;\
- esac
- chmod -R a-w $(distdir)
- chmod u+w $(distdir)
- mkdir $(distdir)/_build $(distdir)/_build/sub $(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/sub \
- && ../../configure \
- $(AM_DISTCHECK_CONFIGURE_FLAGS) \
- $(DISTCHECK_CONFIGURE_FLAGS) \
- --srcdir=../.. --prefix="$$dc_install_base" \
- && $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
- && $(MAKE) $(AM_MAKEFLAGS) check \
- && $(MAKE) $(AM_MAKEFLAGS) install \
- && $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(MAKE) $(AM_MAKEFLAGS) uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
- distuninstallcheck \
- && chmod -R a-w "$$dc_install_base" \
- && ({ \
- (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
- && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
- distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
- } || { rm -rf "$$dc_destdir"; exit 1; }) \
- && rm -rf "$$dc_destdir" \
- && $(MAKE) $(AM_MAKEFLAGS) dist \
- && rm -rf $(DIST_ARCHIVES) \
- && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
- && cd "$$am__cwd" \
- || exit 1
- $(am__post_remove_distdir)
- @(echo "$(distdir) archives ready for distribution: "; \
- list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
-distuninstallcheck:
- @test -n '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: trying to run $@ with an empty' \
- '$$(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- $(am__cd) '$(distuninstallcheck_dir)' || { \
- echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
- exit 1; \
- }; \
- test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left after uninstall:" ; \
- if test -n "$(DESTDIR)"; then \
- echo " (check DESTDIR support)"; \
- fi ; \
- $(distuninstallcheck_listfiles) ; \
- exit 1; } >&2
-distcleancheck: distclean
- @if test '$(srcdir)' = . ; then \
- echo "ERROR: distcleancheck can only run from a VPATH build" ; \
- exit 1 ; \
- fi
- @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
- || { echo "ERROR: files left in build directory after distclean:" ; \
- $(distcleancheck_listfiles) ; \
- exit 1; } >&2
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) \
- $(check_SCRIPTS)
- $(MAKE) $(AM_MAKEFLAGS) check-TESTS
-check: check-am
-all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
- $(HEADERS)
-installdirs:
- for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includecdir)" "$(DESTDIR)$(includecldir)" "$(DESTDIR)$(includeclcdir)" "$(DESTDIR)$(includecldwcdir)" "$(DESTDIR)$(includeclhdir)" "$(DESTDIR)$(includeclmdir)" "$(DESTDIR)$(includegbcdir)" "$(DESTDIR)$(includelssdir)" "$(DESTDIR)$(includepdir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- if test -z '$(STRIP)'; then \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- install; \
- else \
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
- fi
-mostlyclean-generic:
- -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS)
- -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs)
- -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
- -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
- -rm -f src/$(am__dirstamp)
- -rm -f src/client/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/$(am__dirstamp)
- -rm -f src/client/linux/$(am__dirstamp)
- -rm -f src/client/linux/crash_generation/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/linux/crash_generation/$(am__dirstamp)
- -rm -f src/client/linux/dump_writer_common/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/linux/dump_writer_common/$(am__dirstamp)
- -rm -f src/client/linux/handler/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/linux/handler/$(am__dirstamp)
- -rm -f src/client/linux/log/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/linux/log/$(am__dirstamp)
- -rm -f src/client/linux/microdump_writer/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/linux/microdump_writer/$(am__dirstamp)
- -rm -f src/client/linux/minidump_writer/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/client/linux/minidump_writer/$(am__dirstamp)
- -rm -f src/common/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/$(am__dirstamp)
- -rm -f src/common/android/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/android/$(am__dirstamp)
- -rm -f src/common/dwarf/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/dwarf/$(am__dirstamp)
- -rm -f src/common/linux/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/linux/$(am__dirstamp)
- -rm -f src/common/linux/tests/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/linux/tests/$(am__dirstamp)
- -rm -f src/common/mac/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/mac/$(am__dirstamp)
- -rm -f src/common/tests/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/common/tests/$(am__dirstamp)
- -rm -f src/processor/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/processor/$(am__dirstamp)
- -rm -f src/testing/$(am__dirstamp)
- -rm -f src/testing/gtest/src/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/testing/gtest/src/$(am__dirstamp)
- -rm -f src/testing/src/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/testing/src/$(am__dirstamp)
- -rm -f src/third_party/libdisasm/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/third_party/libdisasm/$(am__dirstamp)
- -rm -f src/tools/linux/core2md/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/tools/linux/core2md/$(am__dirstamp)
- -rm -f src/tools/linux/dump_syms/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/tools/linux/dump_syms/$(am__dirstamp)
- -rm -f src/tools/linux/md2core/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/tools/linux/md2core/$(am__dirstamp)
- -rm -f src/tools/linux/symupload/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/tools/linux/symupload/$(am__dirstamp)
- -rm -f src/tools/mac/dump_syms/$(DEPDIR)/$(am__dirstamp)
- -rm -f src/tools/mac/dump_syms/$(am__dirstamp)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-binPROGRAMS clean-checkLIBRARIES clean-checkPROGRAMS \
- clean-generic clean-libLIBRARIES clean-noinstLIBRARIES \
- clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf src/client/$(DEPDIR) src/client/linux/crash_generation/$(DEPDIR) src/client/linux/dump_writer_common/$(DEPDIR) src/client/linux/handler/$(DEPDIR) src/client/linux/log/$(DEPDIR) src/client/linux/microdump_writer/$(DEPDIR) src/client/linux/minidump_writer/$(DEPDIR) src/common/$(DEPDIR) src/common/android/$(DEPDIR) src/common/dwarf/$(DEPDIR) src/common/linux/$(DEPDIR) src/common/linux/tests/$(DEPDIR) src/common/mac/$(DEPDIR) src/common/tests/$(DEPDIR) src/processor/$(DEPDIR) src/testing/gtest/src/$(DEPDIR) src/testing/src/$(DEPDIR) src/third_party/libdisasm/$(DEPDIR) src/tools/linux/core2md/$(DEPDIR) src/tools/linux/dump_syms/$(DEPDIR) src/tools/linux/md2core/$(DEPDIR) src/tools/linux/symupload/$(DEPDIR) src/tools/mac/dump_syms/$(DEPDIR)
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-hdr distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-html-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-dist_docDATA install-includecHEADERS \
- install-includeclHEADERS install-includeclcHEADERS \
- install-includecldwcHEADERS install-includeclhHEADERS \
- install-includeclmHEADERS install-includegbcHEADERS \
- install-includelssHEADERS install-includepHEADERS \
- install-pkgconfigDATA
-
-install-dvi: install-dvi-am
-
-install-dvi-am:
-
-install-exec-am: install-binPROGRAMS install-libLIBRARIES
-
-install-html: install-html-am
-
-install-html-am:
-
-install-info: install-info-am
-
-install-info-am:
-
-install-man:
-
-install-pdf: install-pdf-am
-
-install-pdf-am:
-
-install-ps: install-ps-am
-
-install-ps-am:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf src/client/$(DEPDIR) src/client/linux/crash_generation/$(DEPDIR) src/client/linux/dump_writer_common/$(DEPDIR) src/client/linux/handler/$(DEPDIR) src/client/linux/log/$(DEPDIR) src/client/linux/microdump_writer/$(DEPDIR) src/client/linux/minidump_writer/$(DEPDIR) src/common/$(DEPDIR) src/common/android/$(DEPDIR) src/common/dwarf/$(DEPDIR) src/common/linux/$(DEPDIR) src/common/linux/tests/$(DEPDIR) src/common/mac/$(DEPDIR) src/common/tests/$(DEPDIR) src/processor/$(DEPDIR) src/testing/gtest/src/$(DEPDIR) src/testing/src/$(DEPDIR) src/third_party/libdisasm/$(DEPDIR) src/tools/linux/core2md/$(DEPDIR) src/tools/linux/dump_syms/$(DEPDIR) src/tools/linux/md2core/$(DEPDIR) src/tools/linux/symupload/$(DEPDIR) src/tools/mac/dump_syms/$(DEPDIR)
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-local
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \
- uninstall-includecHEADERS uninstall-includeclHEADERS \
- uninstall-includeclcHEADERS uninstall-includecldwcHEADERS \
- uninstall-includeclhHEADERS uninstall-includeclmHEADERS \
- uninstall-includegbcHEADERS uninstall-includelssHEADERS \
- uninstall-includepHEADERS uninstall-libLIBRARIES \
- uninstall-pkgconfigDATA
-
-.MAKE: check-am install-am install-strip
-
-.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-TESTS \
- check-am clean clean-binPROGRAMS clean-checkLIBRARIES \
- clean-checkPROGRAMS clean-cscope clean-generic \
- clean-libLIBRARIES clean-noinstLIBRARIES clean-noinstPROGRAMS \
- 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-compile distclean-generic \
- distclean-hdr distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-binPROGRAMS install-data \
- install-data-am install-dist_docDATA install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-includecHEADERS \
- install-includeclHEADERS install-includeclcHEADERS \
- install-includecldwcHEADERS install-includeclhHEADERS \
- install-includeclmHEADERS install-includegbcHEADERS \
- install-includelssHEADERS install-includepHEADERS install-info \
- install-info-am install-libLIBRARIES install-man install-pdf \
- install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \
- pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-dist_docDATA \
- uninstall-includecHEADERS uninstall-includeclHEADERS \
- uninstall-includeclcHEADERS uninstall-includecldwcHEADERS \
- uninstall-includeclhHEADERS uninstall-includeclmHEADERS \
- uninstall-includegbcHEADERS uninstall-includelssHEADERS \
- uninstall-includepHEADERS uninstall-libLIBRARIES \
- uninstall-pkgconfigDATA
-
-.PRECIOUS: Makefile
-
-
-mostlyclean-local:
- -find src -name '*.dwo' -exec rm -f {} +
-
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/toolkit/crashreporter/google-breakpad/NEWS b/toolkit/crashreporter/google-breakpad/NEWS
deleted file mode 100644
index e69de29bb2..0000000000
--- a/toolkit/crashreporter/google-breakpad/NEWS
+++ /dev/null
diff --git a/toolkit/crashreporter/google-breakpad/README.ANDROID b/toolkit/crashreporter/google-breakpad/README.ANDROID
deleted file mode 100644
index 30959ed3a2..0000000000
--- a/toolkit/crashreporter/google-breakpad/README.ANDROID
+++ /dev/null
@@ -1,139 +0,0 @@
-Google Breakpad for Android
-===========================
-
-This document explains how to use the Google Breakpad client library
-on Android, and later generate valid stack traces from the minidumps
-it generates.
-
-This release supports ARM, x86 and MIPS based Android systems.
-This release requires NDK release r11c or higher.
-
-I. Building the client library:
-===============================
-
-The Android client is built as a static library that you can
-link into your own Android native code. There are two ways to
-build it:
-
-I.1. Building with ndk-build:
------------------------------
-
-If you're using the ndk-build build system, you can follow
-these simple steps:
-
- 1/ Include android/google_breakpad/Android.mk from your own
- project's Android.mk
-
- This can be done either directly, or using ndk-build's
- import-module feature.
-
- 2/ Link the library to one of your modules by using:
-
- LOCAL_STATIC_LIBRARIES += breakpad_client
-
-NOTE: The client library requires a C++ STL implementation,
- which you can select with APP_STL in your Application.mk
-
- It has been tested succesfully with both STLport and GNU libstdc++
-
-
-I.2. Building with a standalone Android toolchain:
---------------------------------------------------
-
-All you need to do is configure your build with the right 'host'
-value, and disable the processor and tools, as in:
-
- $GOOGLE_BREAKPAD_PATH/configure --host=arm-linux-androideabi \
- --disable-processor \
- --disable-tools
- make -j4
-
-The library will be under src/client/linux/libbreakpad_client.a
-
-You can also use 'make check' to run the test suite on a connected
-Android device. This requires the Android 'adb' tool to be in your
-path.
-
-II. Using the client library in Android:
-========================================
-
-The usage instructions are very similar to the Linux ones that are
-found at https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/linux_starter_guide.md
-
-1/ You need to include "client/linux/handler/exception_handler.h" from a C++
- source file.
-
-2/ If you're not using ndk-build, you also need to:
-
- - add the following to your compiler include search paths:
- $GOOGLE_BREAKPAD_PATH/src
- $GOOGLE_BREAKPAD_PATH/src/common/android/include
-
- - add -llog to your linker flags
-
- Note that ndk-build does that for your automatically.
-
-3/ Keep in mind that there is no /tmp directory on Android.
-
- If you use the library from a regular Android applications, specify a
- path under your app-specific storage directory. An alternative is to
- store them on the SDCard, but this requires a specific permission.
-
-For a concrete example, see the sample test application under
-android/sample_app. See its README for more information.
-
-
-III. Getting a stack trace on the host:
-=======================================
-
-This process is similar to other platforms, but here's a quick example:
-
-1/ Retrieve the minidumps on your development machine.
-
-2/ Dump the symbols for your native libraries with the 'dump_syms' tool.
- This first requires building the host version of Google Breakpad, then
- calling:
-
- dump_syms $PROJECT_PATH/obj/local/$ABI/libfoo.so > libfoo.so.sym
-
-3/ Create the symbol directory hierarchy.
-
- The first line of the generated libfoo.so.sym will have a "MODULE"
- entry that carries a hexadecimal version number, e.g.:
-
- MODULE Linux arm D51B4A5504974FA6ECC1869CAEE3603B0 test_google_breakpad
-
- Note: The second field could be either 'Linux' or 'Android'.
-
- Extract the version number, and a 'symbol' directory, for example:
-
- $PROJECT_PATH/symbols/libfoo.so/$VERSION/
-
- Copy/Move your libfoo.sym file there.
-
-4/ Invoke minidump_stackwalk to create the stack trace:
-
- minidump_stackwalk $MINIDUMP_FILE $PROJECT_PATH/symbols
-
-Note that various helper scripts can be found on the web to automate these
-steps.
-
-IV. Verifying the Android build library:
-========================================
-
-If you modify Google Breakpad and want to check that it still works correctly
-on Android, please run the android/run-checks.sh script which will do all
-necessary verifications for you. This includes:
-
- - Rebuilding the full host binaries.
- - Rebuilding the full Android binaries with configure/make.
- - Rebuilding the client library unit tests, and running them on a device.
- - Rebuilding the client library with ndk-build.
- - Building, installing and running a test crasher program on a device.
- - Extracting the corresponding minidump, dumping the test program symbols
- and generating a stack trace.
- - Checking the generated stack trace for valid source locations.
-
-For more details, please run:
-
- android/run-checks.sh --help-all
diff --git a/toolkit/crashreporter/google-breakpad/README.md b/toolkit/crashreporter/google-breakpad/README.md
deleted file mode 100644
index e7f3e1726e..0000000000
--- a/toolkit/crashreporter/google-breakpad/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-# Breakpad
-
-Breakpad is a set of client and server components which implement a
-crash-reporting system.
-
-* [Homepage](https://chromium.googlesource.com/breakpad/breakpad/)
-* [Documentation](https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/)
-* [Bugs](https://bugs.chromium.org/p/google-breakpad/)
-* Discussion/Questions: [google-breakpad-discuss@googlegroups.com](https://groups.google.com/d/forum/google-breakpad-discuss)
-* Developer/Reviews: [google-breakpad-dev@googlegroups.com](https://groups.google.com/d/forum/google-breakpad-dev)
-* Tests: [![Build Status](https://travis-ci.org/google/breakpad.svg?branch=master)](https://travis-ci.org/google/breakpad)
-* Coverage [![Coverity Status](https://scan.coverity.com/projects/9215/badge.svg)](https://scan.coverity.com/projects/google-breakpad)
-
-## Getting started (from master)
-
-1. First, [download depot_tools](http://dev.chromium.org/developers/how-tos/install-depot-tools)
- and ensure that they’re in your `PATH`.
-
-2. Create a new directory for checking out the source code (it must be named
- breakpad).
-
- ```sh
- mkdir breakpad && cd breakpad
- ```
-
-3. Run the `fetch` tool from depot_tools to download all the source repos.
-
- ```sh
- fetch breakpad
- cd src
- ```
-
-4. Build the source.
-
- ```sh
- ./configure && make
- ```
-
- You can also cd to another directory and run configure from there to build
- outside the source tree.
-
- This will build the processor tools (`src/processor/minidump_stackwalk`,
- `src/processor/minidump_dump`, etc), and when building on Linux it will
- also build the client libraries and some tools
- (`src/tools/linux/dump_syms/dump_syms`,
- `src/tools/linux/md2core/minidump-2-core`, etc).
-
-5. Optionally, run tests.
-
- ```sh
- make check
- ```
-
-6. Optionally, install the built libraries
-
- ```sh
- make install
- ```
-
-If you need to reconfigure your build be sure to run `make distclean` first.
-
-To update an existing checkout to a newer revision, you can
-`git pull` as usual, but then you should run `gclient sync` to ensure that the
-dependent repos are up-to-date.
-
-## To request change review
-
-1. Follow the steps above to get the source and build it.
-
-2. Make changes. Build and test your changes.
- For core code like processor use methods above.
- For linux/mac/windows, there are test targets in each project file.
-
-3. Commit your changes to your local repo and upload them to the server.
- http://dev.chromium.org/developers/contributing-code
- e.g. `git commit ... && git cl upload ...`
- You will be prompted for credential and a description.
-
-4. At https://chromium-review.googlesource.com/ you'll find your issue listed;
- click on it, then “Add reviewerâ€, and enter in the code reviewer. Depending
- on your settings, you may not see an email, but the reviewer has been
- notified with google-breakpad-dev@googlegroups.com always CC’d.
diff --git a/toolkit/crashreporter/google-breakpad/aclocal.m4 b/toolkit/crashreporter/google-breakpad/aclocal.m4
deleted file mode 100644
index 10010c2293..0000000000
--- a/toolkit/crashreporter/google-breakpad/aclocal.m4
+++ /dev/null
@@ -1,1297 +0,0 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
-
-# Copyright (C) 1996-2014 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.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# 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],,
-[m4_warning([this file was generated for autoconf 2.69.
-You have another version of autoconf. It may work, but is not guaranteed to.
-If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-
-# Copyright (C) 2002-2014 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_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.15'
-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.15], [],
- [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
-])
-
-# _AM_AUTOCONF_VERSION(VERSION)
-# -----------------------------
-# aclocal traces this macro to find the Autoconf version.
-# This is a private macro too. Using m4_define simplifies
-# the logic in aclocal, which can simply ignore this definition.
-m4_define([_AM_AUTOCONF_VERSION], [])
-
-# AM_SET_CURRENT_AUTOMAKE_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.15])dnl
-m4_ifndef([AC_AUTOCONF_VERSION],
- [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
-
-# Copyright (C) 2011-2014 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_AR([ACT-IF-FAIL])
-# -------------------------
-# Try to determine the archiver interface, and trigger the ar-lib wrapper
-# if it is needed. If the detection of archiver interface fails, run
-# ACT-IF-FAIL (default is to abort configure with a proper error message).
-AC_DEFUN([AM_PROG_AR],
-[AC_BEFORE([$0], [LT_INIT])dnl
-AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([ar-lib])dnl
-AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
-: ${AR=ar}
-
-AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
- [AC_LANG_PUSH([C])
- am_cv_ar_interface=ar
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
- [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
- AC_TRY_EVAL([am_ar_try])
- if test "$ac_status" -eq 0; then
- am_cv_ar_interface=ar
- else
- am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
- AC_TRY_EVAL([am_ar_try])
- if test "$ac_status" -eq 0; then
- am_cv_ar_interface=lib
- else
- am_cv_ar_interface=unknown
- fi
- fi
- rm -f conftest.lib libconftest.a
- ])
- AC_LANG_POP([C])])
-
-case $am_cv_ar_interface in
-ar)
- ;;
-lib)
- # Microsoft lib, so override with the ar-lib wrapper script.
- # FIXME: It is wrong to rewrite AR.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__AR in this case,
- # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
- # similar.
- AR="$am_aux_dir/ar-lib $AR"
- ;;
-unknown)
- m4_default([$1],
- [AC_MSG_ERROR([could not determine $AR interface])])
- ;;
-esac
-AC_SUBST([AR])dnl
-])
-
-# Figure out how to run the assembler. -*- Autoconf -*-
-
-# Copyright (C) 2001-2014 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_AS
-# ----------
-AC_DEFUN([AM_PROG_AS],
-[# By default we simply use the C compiler to build assembly code.
-AC_REQUIRE([AC_PROG_CC])
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)])
-AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
-_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
-])
-
-# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-
-# Copyright (C) 2001-2014 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.
-
-# 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/../..'.
-#
-# Of course, Automake must honor this variable whenever it calls a
-# tool from the auxiliary directory. The problem is that $srcdir (and
-# therefore $ac_aux_dir as well) can be either absolute or relative,
-# depending on how configure is run. This is pretty annoying, since
-# it makes $ac_aux_dir quite unusable in subdirectories: in the top
-# source directory, any form will work fine, but in subdirectories a
-# relative path needs to be adjusted first.
-#
-# $ac_aux_dir/missing
-# fails when called from a subdirectory if $ac_aux_dir is relative
-# $top_srcdir/$ac_aux_dir/missing
-# fails if $ac_aux_dir is absolute,
-# fails when called from a subdirectory in a VPATH build with
-# a relative $ac_aux_dir
-#
-# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
-# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is '.', but things will broke when you
-# start a VPATH build or use an absolute $srcdir.
-#
-# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
-# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
-# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
-# and then we would define $MISSING as
-# MISSING="\${SHELL} $am_aux_dir/missing"
-# This will work as long as MISSING is not called from configure, because
-# unfortunately $(top_srcdir) has no meaning in configure.
-# However there are other variables, like CC, which are often used in
-# configure, and could therefore not use this "fixed" $ac_aux_dir.
-#
-# Another solution, used here, is to always expand $ac_aux_dir to an
-# absolute PATH. The drawback is that using absolute paths prevent a
-# configured tree to be moved without reconfiguration.
-
-AC_DEFUN([AM_AUX_DIR_EXPAND],
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-])
-
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997-2014 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_CONDITIONAL(NAME, SHELL-CONDITION)
-# -------------------------------------
-# Define a conditional.
-AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ([2.52])dnl
- m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])dnl
-AC_SUBST([$1_FALSE])dnl
-_AM_SUBST_NOTMAKE([$1_TRUE])dnl
-_AM_SUBST_NOTMAKE([$1_FALSE])dnl
-m4_define([_AM_COND_VALUE_$1], [$2])dnl
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi
-AC_CONFIG_COMMANDS_PRE(
-[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([[conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.]])
-fi])])
-
-# Copyright (C) 1999-2014 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.
-
-
-# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
-# written in clear, in which case automake, when reading aclocal.m4,
-# will think it sees a *use*, and therefore will trigger all it's
-# C support machinery. Also note that it means that autoscan, seeing
-# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
-
-# _AM_DEPENDENCIES(NAME)
-# ----------------------
-# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
-# We try a few techniques and use that to set a single cache variable.
-#
-# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
-# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
-# dependency, and given that the user is not expected to run this macro,
-# just rely on AC_PROG_CC.
-AC_DEFUN([_AM_DEPENDENCIES],
-[AC_REQUIRE([AM_SET_DEPDIR])dnl
-AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
-AC_REQUIRE([AM_MAKE_INCLUDE])dnl
-AC_REQUIRE([AM_DEP_TRACK])dnl
-
-m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
- [$1], [CXX], [depcc="$CXX" am_compiler_list=],
- [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
- [$1], [UPC], [depcc="$UPC" am_compiler_list=],
- [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
-
-AC_CACHE_CHECK([dependency style of $depcc],
- [am_cv_$1_dependencies_compiler_type],
-[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_$1_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
- fi
- am__universal=false
- m4_case([$1], [CC],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac],
- [CXX],
- [case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac])
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_$1_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_$1_dependencies_compiler_type=none
-fi
-])
-AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
-AM_CONDITIONAL([am__fastdep$1], [
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
-])
-
-
-# AM_SET_DEPDIR
-# -------------
-# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
-AC_DEFUN([AM_SET_DEPDIR],
-[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
-])
-
-
-# AM_DEP_TRACK
-# ------------
-AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE([dependency-tracking], [dnl
-AS_HELP_STRING(
- [--enable-dependency-tracking],
- [do not reject slow dependency extractors])
-AS_HELP_STRING(
- [--disable-dependency-tracking],
- [speeds up one-time build])])
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
-AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])dnl
-_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
-AC_SUBST([am__nodep])dnl
-_AM_SUBST_NOTMAKE([am__nodep])dnl
-])
-
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999-2014 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_OUTPUT_DEPENDENCY_COMMANDS
-# ------------------------------
-AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
-[{
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
-])# _AM_OUTPUT_DEPENDENCY_COMMANDS
-
-
-# AM_OUTPUT_DEPENDENCY_COMMANDS
-# -----------------------------
-# This macro should only be invoked once -- use via AC_REQUIRE.
-#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
-AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
-[AC_CONFIG_COMMANDS([depfiles],
- [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
-
-# Do all the work for Automake. -*- Autoconf -*-
-
-# Copyright (C) 1996-2014 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.
-
-# 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])
-# -----------------------------------------------
-# The call with PACKAGE and VERSION arguments is the old style
-# call (pre autoconf-2.50), which is being phased out. PACKAGE
-# and VERSION should now be passed to AC_INIT and removed from
-# the call to AM_INIT_AUTOMAKE.
-# We support both call styles for the transition. After
-# the next Automake release, Autoconf can make the AC_INIT
-# 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.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
-AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
-AC_REQUIRE([AC_PROG_INSTALL])dnl
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
- # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
- # is not polluted with repeated "-I."
- AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-AC_SUBST([CYGPATH_W])
-
-# Define the identity of the package.
-dnl Distinguish between old-style and new-style calls.
-m4_ifval([$2],
-[AC_DIAGNOSE([obsolete],
- [$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])],
-[_AM_SET_OPTIONS([$1])dnl
-dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(
- m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
- [ok:ok],,
- [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
-
-_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
- AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
-
-# Some tools Automake needs.
-AC_REQUIRE([AM_SANITY_CHECK])dnl
-AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
-AM_MISSING_PROG([AUTOCONF], [autoconf])
-AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
-AM_MISSING_PROG([AUTOHEADER], [autoheader])
-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
-# 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 (and possibly the TAP driver). The
-# system "awk" is bad on some platforms.
-AC_REQUIRE([AC_PROG_AWK])dnl
-AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
- [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
- [_AM_PROG_TAR([v7])])])
-_AM_IF_OPTION([no-dependencies],,
-[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES([CC])],
- [m4_define([AC_PROG_CC],
- m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES([CXX])],
- [m4_define([AC_PROG_CXX],
- m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES([OBJC])],
- [m4_define([AC_PROG_OBJC],
- m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
-AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
- [_AM_DEPENDENCIES([OBJCXX])],
- [m4_define([AC_PROG_OBJCXX],
- m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
-])
-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 The trailing newline in this macro's definition is deliberate, for
-dnl backward compatibility and to allow trailing 'dnl'-style comments
-dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
-])
-
-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
-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.
-
-# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
-# loop where config.status creates the headers, so we can generate
-# our stamp files there.
-AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
-[# Compute $1's index in $config_headers.
-_am_arg=$1
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-
-# Copyright (C) 2001-2014 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_SH
-# ------------------
-# Define $install_sh.
-AC_DEFUN([AM_PROG_INSTALL_SH],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-AC_SUBST([install_sh])])
-
-# Copyright (C) 2003-2014 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.
-
-# Check whether the underlying file-system supports filenames
-# with a leading dot. For instance MS-DOS doesn't.
-AC_DEFUN([AM_SET_LEADING_DOT],
-[rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-fi
-rmdir .tst 2>/dev/null
-AC_SUBST([am__leading_dot])])
-
-# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
-# From Jim Meyering
-
-# Copyright (C) 1996-2014 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_MAINTAINER_MODE([DEFAULT-MODE])
-# ----------------------------------
-# Control maintainer-specific portions of Makefiles.
-# Default is to disable them, unless 'enable' is passed literally.
-# For symmetry, 'disable' may be passed as well. Anyway, the user
-# can override the default with the --enable/--disable switch.
-AC_DEFUN([AM_MAINTAINER_MODE],
-[m4_case(m4_default([$1], [disable]),
- [enable], [m4_define([am_maintainer_other], [disable])],
- [disable], [m4_define([am_maintainer_other], [enable])],
- [m4_define([am_maintainer_other], [enable])
- m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
-AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
- dnl maintainer-mode's default is 'disable' unless 'enable' is passed
- AC_ARG_ENABLE([maintainer-mode],
- [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
- am_maintainer_other[ make rules and dependencies not useful
- (and sometimes confusing) to the casual installer])],
- [USE_MAINTAINER_MODE=$enableval],
- [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
- AC_MSG_RESULT([$USE_MAINTAINER_MODE])
- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
- MAINT=$MAINTAINER_MODE_TRUE
- AC_SUBST([MAINT])dnl
-]
-)
-
-# Check to see how 'make' treats includes. -*- Autoconf -*-
-
-# Copyright (C) 2001-2014 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_MAKE_INCLUDE()
-# -----------------
-# Check to see how make treats includes.
-AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
-
-# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-
-# Copyright (C) 1997-2014 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_MISSING_PROG(NAME, PROGRAM)
-# ------------------------------
-AC_DEFUN([AM_MISSING_PROG],
-[AC_REQUIRE([AM_MISSING_HAS_RUN])
-$1=${$1-"${am_missing_run}$2"}
-AC_SUBST($1)])
-
-# AM_MISSING_HAS_RUN
-# ------------------
-# 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
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
- am_missing_run="$MISSING "
-else
- am_missing_run=
- AC_MSG_WARN(['missing' script is too old or missing])
-fi
-])
-
-# -*- Autoconf -*-
-# Obsolete and "removed" macros, that must however still report explicit
-# error messages when used, to smooth transition.
-#
-# Copyright (C) 1996-2014 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.
-
-AC_DEFUN([AM_CONFIG_HEADER],
-[AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl
-AC_CONFIG_HEADERS($@)])
-
-AC_DEFUN([AM_PROG_CC_STDC],
-[AC_PROG_CC
-am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc
-AC_DIAGNOSE([obsolete],
-['$0': this macro is obsolete.
-You should simply use the 'AC][_PROG_CC' macro instead.
-Also, your code should no longer depend upon 'am_cv_prog_cc_stdc',
-but upon 'ac_cv_prog_cc_stdc'.])])
-
-AC_DEFUN([AM_C_PROTOTYPES],
- [AC_FATAL([automatic de-ANSI-fication support has been removed])])
-AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001-2014 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_MANGLE_OPTION(NAME)
-# -----------------------
-AC_DEFUN([_AM_MANGLE_OPTION],
-[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
-
-# _AM_SET_OPTION(NAME)
-# --------------------
-# Set option NAME. Presently that only means defining a flag for this option.
-AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
-
-# _AM_SET_OPTIONS(OPTIONS)
-# ------------------------
-# OPTIONS is a space-separated list of Automake options.
-AC_DEFUN([_AM_SET_OPTIONS],
-[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
-
-# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
-# -------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-AC_DEFUN([_AM_IF_OPTION],
-[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Copyright (C) 1999-2014 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_CC_C_O
-# ---------------
-# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
-# to automatically call this.
-AC_DEFUN([_AM_PROG_CC_C_O],
-[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-AC_LANG_PUSH([C])dnl
-AC_CACHE_CHECK(
- [whether $CC understands -c and -o together],
- [am_cv_prog_cc_c_o],
- [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
- # Make sure it works both with $CC and with simple cc.
- # Following AC_PROG_CC_C_O, we do the test twice because some
- # compilers refuse to overwrite an existing .o file with -o,
- # though they will create one.
- am_cv_prog_cc_c_o=yes
- for am_i in 1 2; do
- if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
- && test -f conftest2.$ac_objext; then
- : OK
- else
- am_cv_prog_cc_c_o=no
- break
- fi
- done
- rm -f core conftest*
- unset am_i])
-if test "$am_cv_prog_cc_c_o" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-AC_LANG_POP([C])])
-
-# For backward compatibility.
-AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-
-# Copyright (C) 2001-2014 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_RUN_LOG(COMMAND)
-# -------------------
-# Run COMMAND, save the exit status in ac_status, and log it.
-# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
-AC_DEFUN([AM_RUN_LOG],
-[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
- ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- (exit $ac_status); }])
-
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
-
-# Copyright (C) 1996-2014 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_SANITY_CHECK
-# ---------------
-AC_DEFUN([AM_SANITY_CHECK],
-[AC_MSG_CHECKING([whether build environment is sane])
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[[\\\"\#\$\&\'\`$am_lf]]*)
- AC_MSG_ERROR([unsafe absolute working directory name]);;
-esac
-case $srcdir in
- *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
- alias in your environment])
- fi
- if test "$[2]" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$[2]" = conftest.file
- )
-then
- # Ok.
- :
-else
- AC_MSG_ERROR([newly created file is older than distributed files!
-Check your system clock])
-fi
-AC_MSG_RESULT([yes])
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-AC_CONFIG_COMMANDS_PRE(
- [AC_MSG_CHECKING([that generated files are newer than configure])
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- AC_MSG_RESULT([done])])
-rm -f conftest.file
-])
-
-# Copyright (C) 2009-2014 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_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-2014 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
-# ---------------------
-# One issue with vendor 'install' (even GNU) is that you can't
-# specify the program used to strip binaries. This is especially
-# annoying in cross-compiling environments, where the build's strip
-# is unlikely to handle the host's binaries.
-# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in "make install-strip", and initialize
-# STRIPPROG with the value of the STRIP variable (set by the user).
-AC_DEFUN([AM_PROG_INSTALL_STRIP],
-[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
-if test "$cross_compiling" != no; then
- AC_CHECK_TOOL([STRIP], [strip], :)
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-AC_SUBST([INSTALL_STRIP_PROGRAM])])
-
-# Copyright (C) 2006-2014 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_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
-# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
-# This macro is traced by Automake.
-AC_DEFUN([_AM_SUBST_NOTMAKE])
-
-# AM_SUBST_NOTMAKE(VARIABLE)
-# --------------------------
-# Public sister of _AM_SUBST_NOTMAKE.
-AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
-
-# Check how to create a tarball. -*- Autoconf -*-
-
-# Copyright (C) 2004-2014 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_TAR(FORMAT)
-# --------------------
-# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of 'v7', 'ustar', or 'pax'.
-#
-# Substitute a variable $(am__tar) that is a command
-# writing to stdout a FORMAT-tarball containing the directory
-# $tardir.
-# tardir=directory && $(am__tar) > result.tar
-#
-# 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}'])
-
-# 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'
-
-m4_if([$1], [v7],
- [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
-
- [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
-
- 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
-
diff --git a/toolkit/crashreporter/google-breakpad/android/common-functions.sh b/toolkit/crashreporter/google-breakpad/android/common-functions.sh
deleted file mode 100755
index c00e34f997..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/common-functions.sh
+++ /dev/null
@@ -1,372 +0,0 @@
-# Copyright (c) 2012 Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Collection of common shell functions for 'run-checks.sh' et 'test-shell.sh'
-
-# All internal variables and functions use an underscore as a prefix
-# (e.g. _VERBOSE, _ALL_CLEANUPS, etc..).
-
-# Sanitize the environment
-export LANG=C
-export LC_ALL=C
-
-if [ "$BASH_VERSION" ]; then
- set -o posix
-fi
-
-# Utility functions
-
-_ALL_CLEANUPS=
-
-# Register a function to be called when the script exits, even in case of
-# Ctrl-C, logout, etc.
-# $1: function name.
-atexit () {
- if [ -z "$_ALL_CLEANUPS" ]; then
- _ALL_CLEANUPS=$1
- # Ensure a clean exit when the script is:
- # - Exiting normally (EXIT)
- # - Interrupted by Ctrl-C (INT)
- # - Interrupted by log out (HUP)
- # - Being asked to quit nicely (TERM)
- # - Being asked to quit and dump core (QUIT)
- trap "_exit_cleanups \$?" EXIT INT HUP QUIT TERM
- else
- _ALL_CLEANUPS="$_ALL_CLEANUPS $1"
- fi
-}
-
-# Called on exit if at least one function was registered with atexit
-# $1: final exit status code
-_exit_cleanups () {
- local CLEANUP CLEANUPS
- # Ignore calls to atexit during cleanups
- CLEANUPS=$_ALL_CLEANUPS
- _ALL_CLEANUPS=
- for CLEANUP in $CLEANUPS; do
- ($CLEANUP)
- done
- exit "$@"
-}
-
-
-
-
-# Dump a panic message then exit.
-# $1+: message
-panic () {
- echo "ERROR: $@" >&2
- exit 1
-}
-
-# If the previous command failed, dump a panic message then exit.
-# $1+: message.
-fail_panic () {
- if [ $? != 0 ]; then
- panic "$@"
- fi;
-}
-
-_VERBOSE=0
-
-# Increase verbosity for dump/log/run/run2 functions
-increase_verbosity () {
- _VERBOSE=$(( $_VERBOSE + 1 ))
-}
-
-# Decrease verbosity
-decrease_verbosity () {
- _VERBOSE=$(( $_VERBOSE - 1 ))
-}
-
-# Returns success iff verbosity level is higher than a specific value
-# $1: verbosity level
-verbosity_is_higher_than () {
- [ "$_VERBOSE" -gt "$1" ]
-}
-
-# Returns success iff verbosity level is lower than a specific value
-# $1: verbosity level
-verbosity_is_lower_than () {
- [ "$_VERBOSE" -le "$1" ]
-}
-
-# Dump message to stdout, unless verbosity is < 0, i.e. --quiet was called
-# $1+: message
-dump () {
- if [ "$_VERBOSE" -ge 0 ]; then
- printf "%s\n" "$*"
- fi
-}
-
-# If --verbose was used, dump a message to stdout.
-# $1+: message
-log () {
- if [ "$_VERBOSE" -ge 1 ]; then
- printf "%s\n" "$*"
- fi
-}
-
-_RUN_LOG=
-
-# Set a run log file that can be used to collect the output of commands that
-# are not displayed.
-set_run_log () {
- _RUN_LOG=$1
-}
-
-# Run a command. Output depends on $_VERBOSE:
-# $_VERBOSE <= 0: Run command, store output into the run log
-# $_VERBOSE >= 1: Dump command, run it, output goest to stdout
-# Note: Ideally, the command's output would go to the run log for $_VERBOSE >= 1
-# but the 'tee' tool doesn't preserve the status code of its input pipe
-# in case of error.
-run () {
- local LOGILE
- if [ "$_RUN_LOG" ]; then
- LOGFILE=$_RUN_LOG
- else
- LOGFILE=/dev/null
- fi
-
- if [ "$_VERBOSE" -ge 1 ]; then
- echo "COMMAND: $@"
- "$@"
- else
- "$@" >>$LOGFILE 2>&1
- fi
-}
-
-# Same as run(), but only dump command output for $_VERBOSE >= 2
-run2 () {
- local LOGILE
- if [ "$_RUN_LOG" ]; then
- LOGFILE=$_RUN_LOG
- else
- LOGFILE=/dev/null
- fi
-
- if [ "$_VERBOSE" -ge 1 ]; then
- echo "COMMAND: $@"
- fi
- if [ "$_VERBOSE" -ge 2 ]; then
- "$@"
- else
- "$@" >>$LOGFILE 2>&1
- fi
-}
-
-# Extract number of cores to speed up the builds
-# Out: number of CPU cores
-get_core_count () {
- case $(uname -s) in
- Linux)
- grep -c -e '^processor' /proc/cpuinfo
- ;;
- Darwin)
- sysctl -n hw.ncpu
- ;;
- CYGWIN*|*_NT-*)
- echo $NUMBER_OF_PROCESSORS
- ;;
- *)
- echo 1
- ;;
- esac
-}
-
-
-# Check for the Android ADB program.
-#
-# On success, return nothing, but updates internal variables so later calls to
-# adb_shell, adb_push, etc.. will work. You can get the path to the ADB program
-# with adb_get_program if needed.
-#
-# On failure, returns 1, and updates the internal adb error message, which can
-# be retrieved with adb_get_error.
-#
-# $1: optional ADB program path.
-# Return: success or failure.
-_ADB=
-_ADB_STATUS=
-_ADB_ERROR=
-
-adb_check () {
- # First, try to find the executable in the path, or the SDK install dir.
- _ADB=$1
- if [ -z "$_ADB" ]; then
- _ADB=$(which adb 2>/dev/null)
- if [ -z "$_ADB" -a "$ANDROID_SDK_ROOT" ]; then
- _ADB=$ANDROID_SDK_ROOT/platform-tools/adb
- if [ ! -f "$_ADB" ]; then
- _ADB=
- fi
- fi
- if [ -z "$_ADB" ]; then
- _ADB_STATUS=1
- _ADB_ERROR="The Android 'adb' tool is not in your path."
- return 1
- fi
- fi
-
- log "Found ADB program: $_ADB"
-
- # Check that it works correctly
- local ADB_VERSION
- ADB_VERSION=$("$_ADB" version 2>/dev/null)
- case $ADB_VERSION in
- "Android Debug Bridge "*) # Pass
- log "Found ADB version: $ADB_VERSION"
- ;;
- *) # Fail
- _ADB_ERROR="Your ADB binary reports a bad version ($ADB_VERSION): $_ADB"
- _ADB_STATUS=1
- return 1
- esac
-
- _ADB_STATUS=0
- return 0
-}
-
-
-# Return the path to the Android ADB program, if correctly detected.
-# On failure, return the empty string.
-# Out: ADB program path (or empty on failure)
-# Return: success or failure.
-adb_get_program () {
- # Return cached value as soon as possible.
- if [ -z "$_ADB_STATUS" ]; then
- adb_check $1
- fi
- echo "$_ADB"
- return $_ADB_STATUS
-}
-
-# Return the error corresponding to the last ADB function failure.
-adb_get_error () {
- echo "$_ADB_ERROR"
-}
-
-# Check that there is one device connected through ADB.
-# In case of failure, use adb_get_error to know why this failed.
-# $1: Optional adb program path
-# Return: success or failure.
-_ADB_DEVICE=
-_ADB_DEVICE_STATUS=
-adb_check_device () {
- if [ "$_ADB_DEVICE_STATUS" ]; then
- return $_ADB_DEVICE_STATUS
- fi
-
- # Check for ADB.
- if ! adb_check $1; then
- _ADB_DEVICE_STATUS=$_ADB_STATUS
- return 1
- fi
-
- local ADB_DEVICES NUM_DEVICES FINGERPRINT
-
- # Count the number of connected devices.
- ADB_DEVICES=$("$_ADB" devices 2>/dev/null | awk '$2 == "device" { print $1; }')
- NUM_DEVICES=$(echo "$ADB_DEVICES" | wc -l)
- case $NUM_DEVICES in
- 0)
- _ADB_ERROR="No Android device connected. Please connect one to your machine."
- _ADB_DEVICE_STATUS=1
- return 1
- ;;
- 1) # Pass
- # Ensure the same device will be called in later adb_shell calls.
- export ANDROID_SERIAL=$ADB_DEVICES
- ;;
- *) # 2 or more devices.
- if [ "$ANDROID_SERIAL" ]; then
- ADB_DEVICES=$ANDROID_SERIAL
- NUM_DEVICES=1
- else
- _ADB_ERROR="More than one Android device connected. \
-Please define ANDROID_SERIAL in your environment"
- _ADB_DEVICE_STATUS=1
- return 1
- fi
- ;;
- esac
-
- _ADB_DEVICE_STATUS=0
- _ADB_DEVICE=$ADB_DEVICES
-
- FINGERPRINT=$(adb_shell getprop ro.build.fingerprint)
- log "Using ADB device: $ANDROID_SERIAL ($FINGERPRINT)"
- return 0
-}
-
-# The 'adb shell' command is pretty hopeless, try to make sense of it by:
-# 1/ Removing trailing \r from line endings.
-# 2/ Ensuring the function returns the command's status code.
-#
-# $1+: Command
-# Out: command output (stdout + stderr combined)
-# Return: command exit status
-adb_shell () {
- local RET ADB_LOG
- # Check for ADB device.
- adb_check_device || return 1
- ADB_LOG=$(mktemp "${TMPDIR:-/tmp}/adb-XXXXXXXX")
- "$_ADB" shell "$@" ";" echo \$? > "$ADB_LOG" 2>&1
- sed -i -e 's![[:cntrl:]]!!g' "$ADB_LOG" # Remove \r.
- RET=$(sed -e '$!d' "$ADB_LOG") # Last line contains status code.
- sed -e '$d' "$ADB_LOG" # Print everything except last line.
- rm -f "$ADB_LOG"
- return $RET
-}
-
-# Push a file to a device.
-# $1: source file path
-# $2: device target file path
-# Return: success or failure.
-adb_push () {
- adb_check_device || return 1
- run "$_ADB" push "$1" "$2"
-}
-
-# Pull a file from a device
-# $1: device file path
-# $2: target host file path
-# Return: success or failure.
-adb_pull () {
- adb_check_device || return 1
- run "$_ADB" pull "$1" "$2"
-}
-
-# Same as adb_push, but will panic if the operations didn't succeed.
-adb_install () {
- adb_push "$@"
- fail_panic "Failed to install $1 to the Android device at $2"
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/android/google_breakpad/Android.mk b/toolkit/crashreporter/google-breakpad/android/google_breakpad/Android.mk
deleted file mode 100644
index 74625eb550..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/google_breakpad/Android.mk
+++ /dev/null
@@ -1,103 +0,0 @@
-# Copyright (c) 2012, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# ndk-build module definition for the Google Breakpad client library
-#
-# To use this file, do the following:
-#
-# 1/ Include this file from your own Android.mk, either directly
-# or with through the NDK's import-module function.
-#
-# 2/ Use the client static library in your project with:
-#
-# LOCAL_STATIC_LIBRARIES += breakpad_client
-#
-# 3/ In your source code, include "src/client/linux/exception_handler.h"
-# and use the Linux instructions to use it.
-#
-# This module works with either the STLport or GNU libstdc++, but you need
-# to select one in your Application.mk
-#
-
-# The top Google Breakpad directory.
-# We assume this Android.mk to be under 'android/google_breakpad'
-
-LOCAL_PATH := $(call my-dir)/../..
-
-# Defube the client library module, as a simple static library that
-# exports the right include path / linker flags to its users.
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := breakpad_client
-
-LOCAL_CPP_EXTENSION := .cc
-
-# Breakpad uses inline ARM assembly that requires the library
-# to be built in ARM mode. Otherwise, the build will fail with
-# cryptic assembler messages like:
-# Compile++ thumb : google_breakpad_client <= crash_generation_client.cc
-# /tmp/cc8aMSoD.s: Assembler messages:
-# /tmp/cc8aMSoD.s:132: Error: invalid immediate: 288 is out of range
-# /tmp/cc8aMSoD.s:244: Error: invalid immediate: 296 is out of range
-LOCAL_ARM_MODE := arm
-
-# List of client source files, directly taken from Makefile.am
-LOCAL_SRC_FILES := \
- src/client/linux/crash_generation/crash_generation_client.cc \
- src/client/linux/dump_writer_common/thread_info.cc \
- src/client/linux/dump_writer_common/ucontext_reader.cc \
- src/client/linux/handler/exception_handler.cc \
- src/client/linux/handler/minidump_descriptor.cc \
- src/client/linux/log/log.cc \
- src/client/linux/microdump_writer/microdump_writer.cc \
- src/client/linux/minidump_writer/linux_dumper.cc \
- src/client/linux/minidump_writer/linux_ptrace_dumper.cc \
- src/client/linux/minidump_writer/minidump_writer.cc \
- src/client/minidump_file_writer.cc \
- src/common/android/breakpad_getcontext.S \
- src/common/convert_UTF.c \
- src/common/md5.cc \
- src/common/string_conversion.cc \
- src/common/linux/elfutils.cc \
- src/common/linux/file_id.cc \
- src/common/linux/guid_creator.cc \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/safe_readlink.cc
-
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common/android/include \
- $(LOCAL_PATH)/src
-
-LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
-LOCAL_EXPORT_LDLIBS := -llog
-
-include $(BUILD_STATIC_LIBRARY)
-
-# Done. \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/android/run-checks.sh b/toolkit/crashreporter/google-breakpad/android/run-checks.sh
deleted file mode 100755
index 51d2d50231..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/run-checks.sh
+++ /dev/null
@@ -1,555 +0,0 @@
-#!/bin/sh
-# Copyright (c) 2012 Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Sanitize the environment
-export LANG=C
-export LC_ALL=C
-
-if [ "$BASH_VERSION" ]; then
- set -o posix
-fi
-
-PROGDIR=$(dirname "$0")
-PROGDIR=$(cd "$PROGDIR" && pwd)
-PROGNAME=$(basename "$0")
-
-. $PROGDIR/common-functions.sh
-
-DEFAULT_ABI="armeabi"
-VALID_ABIS="armeabi armeabi-v7a x86 mips"
-
-ABI=
-ADB=
-ALL_TESTS=
-ENABLE_M32=
-HELP=
-HELP_ALL=
-NDK_DIR=
-NO_CLEANUP=
-NO_DEVICE=
-NUM_JOBS=$(get_core_count)
-TMPDIR=
-
-for opt do
- # The following extracts the value if the option is like --name=<value>.
- optarg=$(expr -- $opt : '^--[^=]*=\(.*\)$')
- case $opt in
- --abi=*) ABI=$optarg;;
- --adb=*) ADB=$optarg;;
- --all-tests) ALL_TESTS=true;;
- --enable-m32) ENABLE_M32=true;;
- --help|-h|-?) HELP=TRUE;;
- --help-all) HELP_ALL=true;;
- --jobs=*) NUM_JOBS=$optarg;;
- --ndk-dir=*) NDK_DIR=$optarg;;
- --tmp-dir=*) TMPDIR=$optarg;;
- --no-cleanup) NO_CLEANUP=true;;
- --no-device) NO_DEVICE=true;;
- --quiet) decrease_verbosity;;
- --verbose) increase_verbosity;;
- -*) panic "Invalid option '$opt', see --help for details.";;
- *) panic "This script doesn't take any parameters. See --help for details."
- ;;
- esac
-done
-
-if [ "$HELP" -o "$HELP_ALL" ]; then
- echo "\
- Usage: $PROGNAME [options]
-
- This script is used to check that your Google Breakpad source tree can
- be properly built for Android, and that the client library and host tools
- work properly together.
-"
- if [ "$HELP_ALL" ]; then
- echo "\
- In more details, this script will:
-
- - Rebuild the host version of Google Breakpad in a temporary
- directory (with the Auto-tools based build system).
-
- - Rebuild the Android client library with the Google Breakpad build
- system (using autotools/configure). This requires that you define
- ANDROID_NDK_ROOT in your environment to point to a valid Android NDK
- installation directory, or use the --ndk-dir=<path> option.
-
- - Rebuild the Android client library and a test crashing program with the
- Android NDK build system (ndk-build).
-
- - Require an Android device connected to your machine, and the 'adb'
- tool in your path. They are used to:
-
- - Install and run a test crashing program.
- - Extract the corresponding minidump from the device.
- - Dump the symbols from the test program on the host with 'dump_syms'
- - Generate a stack trace with 'minidump_stackwalk'
- - Check the stack trace content for valid source file locations.
-
- You can however skip this requirement and only test the builds by using
- the --no-device flag.
-
- By default, all generated files will be created in a temporary directory
- that is removed when the script completion. If you want to inspect the
- files, use the --no-cleanup option.
-
- Finally, use --verbose to increase the verbosity level, this will help
- you see which exact commands are being issues and their result. Use the
- flag twice for even more output. Use --quiet to decrease verbosity
- instead and run the script silently.
-
- If you have a device connected, the script will probe it to determine
- its primary CPU ABI, and build the test program for it. You can however
- use the --abi=<name> option to override this (this can be useful to check
- the secondary ABI, e.g. using --abi=armeabi to check that such a program
- works correctly on an ARMv7-A device).
-
- If you don't have a device connected, the test program will be built (but
- not run) with the default '$DEFAULT_ABI' ABI. Again, you can use
- --abi=<name> to override this. Valid ABI names are:
-
- $VALID_ABIS
-
- The script will only run the client library unit test on the device
- by default. You can use --all-tests to also build and run the unit
- tests for the Breakpad tools and processor, but be warned that this
- adds several minutes of testing time. --all-tests will also run the
- host unit tests suite.
-"
-
- fi # HELP_ALL
-
- echo "\
- Valid options:
-
- --help|-h|-? Display this message.
- --help-all Display extended help.
- --enable-m32 Build 32-bit version of host tools.
- --abi=<name> Specify target CPU ABI [auto-detected].
- --jobs=<count> Run <count> build tasks in parallel [$NUM_JOBS].
- --ndk-dir=<path> Specify NDK installation directory.
- --tmp-dir=<path> Specify temporary directory (will be wiped-out).
- --adb=<path> Specify adb program path.
- --no-cleanup Don't remove temporary directory after completion.
- --no-device Do not try to detect devices, nor run crash test.
- --all-tests Run all unit tests (i.e. tools and processor ones too).
- --verbose Increase verbosity.
- --quiet Decrease verbosity."
-
- exit 0
-fi
-
-TESTAPP_DIR=$PROGDIR/sample_app
-
-# Select NDK install directory.
-if [ -z "$NDK_DIR" ]; then
- if [ -z "$ANDROID_NDK_ROOT" ]; then
- panic "Please define ANDROID_NDK_ROOT in your environment, or use \
---ndk-dir=<path>."
- fi
- NDK_DIR="$ANDROID_NDK_ROOT"
- log "Found NDK directory: $NDK_DIR"
-else
- log "Using NDK directory: $NDK_DIR"
-fi
-# Small sanity check.
-NDK_BUILD="$NDK_DIR/ndk-build"
-if [ ! -f "$NDK_BUILD" ]; then
- panic "Your NDK directory is not valid (missing ndk-build): $NDK_DIR"
-fi
-
-# Ensure the temporary directory is deleted on exit, except if the --no-cleanup
-# option is used.
-
-clean_tmpdir () {
- if [ "$TMPDIR" ]; then
- if [ -z "$NO_CLEANUP" ]; then
- log "Cleaning up: $TMPDIR"
- rm -rf "$TMPDIR"
- else
- dump "Temporary directory contents preserved: $TMPDIR"
- fi
- fi
- exit "$@"
-}
-
-atexit clean_tmpdir
-
-# If --tmp-dir=<path> is not used, create a temporary directory.
-# Otherwise, start by cleaning up the user-provided path.
-if [ -z "$TMPDIR" ]; then
- TMPDIR=$(mktemp -d /tmp/$PROGNAME.XXXXXXXX)
- fail_panic "Can't create temporary directory!"
- log "Using temporary directory: $TMPDIR"
-else
- if [ ! -d "$TMPDIR" ]; then
- mkdir -p "$TMPDIR"
- fail_panic "Can't create temporary directory: $TMPDIR"
- else
- log "Cleaning up temporary directory: $TMPDIR"
- rm -rf "$TMPDIR"/*
- fail_panic "Cannot cleanup temporary directory!"
- fi
-fi
-
-if [ -z "$NO_DEVICE" ]; then
- if ! adb_check_device $ADB; then
- echo "$(adb_get_error)"
- echo "Use --no-device to build the code without running any tests."
- exit 1
- fi
-fi
-
-BUILD_LOG="$TMPDIR/build.log"
-RUN_LOG="$TMPDIR/run.log"
-CRASH_LOG="$TMPDIR/crash.log"
-
-set_run_log "$RUN_LOG"
-
-TMPHOST="$TMPDIR/host-local"
-
-cd "$TMPDIR"
-
-# Build host version of the tools
-dump "Building host binaries."
-CONFIGURE_FLAGS=
-if [ "$ENABLE_M32" ]; then
- CONFIGURE_FLAGS="$CONFIGURE_FLAGS --enable-m32"
-fi
-(
- run mkdir "$TMPDIR/build-host" &&
- run cd "$TMPDIR/build-host" &&
- run2 "$PROGDIR/../configure" --prefix="$TMPHOST" $CONFIGURE_FLAGS &&
- run2 make -j$NUM_JOBS install
-)
-fail_panic "Can't build host binaries!"
-
-if [ "$ALL_TESTS" ]; then
- dump "Running host unit tests."
- (
- run cd "$TMPDIR/build-host" &&
- run2 make -j$NUM_JOBS check
- )
- fail_panic "Host unit tests failed!!"
-fi
-
-TMPBIN=$TMPHOST/bin
-
-# Generate a stand-alone NDK toolchain
-
-# Extract CPU ABI and architecture from device, if any.
-if adb_check_device; then
- DEVICE_ABI=$(adb_shell getprop ro.product.cpu.abi)
- DEVICE_ABI2=$(adb_shell getprop ro.product.cpu.abi2)
- if [ -z "$DEVICE_ABI" ]; then
- panic "Can't extract ABI from connected device!"
- fi
- if [ "$DEVICE_ABI2" ]; then
- dump "Found device ABIs: $DEVICE_ABI $DEVICE_ABI2"
- else
- dump "Found device ABI: $DEVICE_ABI"
- DEVICE_ABI2=$DEVICE_ABI
- fi
-
- # If --abi=<name> is used, check that the device supports it.
- if [ "$ABI" -a "$DEVICE_ABI" != "$ABI" -a "$DEVICE_ABI2" != "$ABI" ]; then
- dump "ERROR: Device ABI(s) do not match --abi command-line value ($ABI)!"
- panic "Please use --no-device to skip device tests."
- fi
-
- if [ -z "$ABI" ]; then
- ABI=$DEVICE_ABI
- dump "Using CPU ABI: $ABI (device)"
- else
- dump "Using CPU ABI: $ABI (command-line)"
- fi
-else
- if [ -z "$ABI" ]; then
- # No device connected, choose default ABI
- ABI=$DEFAULT_ABI
- dump "Using CPU ABI: $ABI (default)"
- else
- dump "Using CPU ABI: $ABI (command-line)"
- fi
-fi
-
-# Check the ABI value
-VALID=
-for VALID_ABI in $VALID_ABIS; do
- if [ "$ABI" = "$VALID_ABI" ]; then
- VALID=true
- break
- fi
-done
-
-if [ -z "$VALID" ]; then
- panic "Unknown CPU ABI '$ABI'. Valid values are: $VALID_ABIS"
-fi
-
-# Extract architecture name from ABI
-case $ABI in
- armeabi*) ARCH=arm;;
- *) ARCH=$ABI;;
-esac
-
-# Extract GNU configuration name
-case $ARCH in
- arm)
- GNU_CONFIG=arm-linux-androideabi
- ;;
- x86)
- GNU_CONFIG=i686-linux-android
- ;;
- mips)
- GNU_CONFIG=mipsel-linux-android
- ;;
- *)
- GNU_CONFIG="$ARCH-linux-android"
- ;;
-esac
-
-# Generate standalone NDK toolchain installation
-NDK_STANDALONE="$TMPDIR/ndk-$ARCH-toolchain"
-echo "Generating NDK standalone toolchain installation"
-mkdir -p "$NDK_STANDALONE"
-# NOTE: The --platform=android-9 is required to provide <regex.h> for GTest.
-run "$NDK_DIR/build/tools/make-standalone-toolchain.sh" \
- --arch="$ARCH" \
- --platform=android-9 \
- --install-dir="$NDK_STANDALONE"
-fail_panic "Can't generate standalone NDK toolchain installation!"
-
-# Rebuild the client library, processor and tools with the auto-tools based
-# build system. Even though it's not going to be used, this checks that this
-# still works correctly.
-echo "Building full Android binaries with configure/make"
-TMPTARGET="$TMPDIR/target-local"
-(
- PATH="$NDK_STANDALONE/bin:$PATH"
- run mkdir "$TMPTARGET" &&
- run mkdir "$TMPDIR"/build-target &&
- run cd "$TMPDIR"/build-target &&
- run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
- --host="$GNU_CONFIG" &&
- run2 make -j$NUM_JOBS install
-)
-fail_panic "Could not rebuild Android binaries!"
-
-# Build and/or run unit test suite.
-# If --no-device is used, only rebuild it, otherwise, run in on the
-# connected device.
-if [ "$NO_DEVICE" ]; then
- ACTION="Building"
- # This is a trick to force the Makefile to ignore running the scripts.
- TESTS_ENVIRONMENT="TESTS_ENVIRONMENT=true"
-else
- ACTION="Running"
- TESTS_ENVIRONMENT=
-fi
-
-(
- PATH="$NDK_STANDALONE/bin:$PATH"
- run cd "$TMPDIR"/build-target &&
- # Reconfigure to only run the client unit test suite.
- # This one should _never_ fail.
- dump "$ACTION Android client library unit tests."
- run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
- --host="$GNU_CONFIG" \
- --disable-tools \
- --disable-processor &&
- run make -j$NUM_JOBS check $TESTS_ENVIRONMENT || exit $?
-
- if [ "$ALL_TESTS" ]; then
- dump "$ACTION Tools and processor unit tests."
- # Reconfigure to run the processor and tools tests.
- # Most of these fail for now, so do not worry about it.
- run2 "$PROGDIR"/../configure --prefix="$TMPTARGET" \
- --host="$GNU_CONFIG" &&
- run make -j$NUM_JOBS check $TESTS_ENVIRONMENT
- if [ $? != 0 ]; then
- dump "Tools and processor unit tests failed as expected. \
-Use --verbose for results."
- fi
- fi
-)
-fail_panic "Client library unit test suite failed!"
-
-# Copy sources to temporary directory
-PROJECT_DIR=$TMPDIR/project
-dump "Copying test program sources to: $PROJECT_DIR"
-run cp -r "$TESTAPP_DIR" "$PROJECT_DIR" &&
-run rm -rf "$PROJECT_DIR/obj" &&
-run rm -rf "$PROJECT_DIR/libs"
-fail_panic "Could not copy test program sources to: $PROJECT_DIR"
-
-# Build the test program with ndk-build.
-dump "Building test program with ndk-build"
-export NDK_MODULE_PATH="$PROGDIR"
-NDK_BUILD_FLAGS="-j$NUM_JOBS"
-if verbosity_is_higher_than 1; then
- NDK_BUILD_FLAGS="$NDK_BUILD_FLAGS NDK_LOG=1 V=1"
-fi
-run "$NDK_DIR/ndk-build" -C "$PROJECT_DIR" $NDK_BUILD_FLAGS APP_ABI=$ABI
-fail_panic "Can't build test program!"
-
-# Unless --no-device was used, stop right here if ADB isn't in the path,
-# or there is no connected device.
-if [ "$NO_DEVICE" ]; then
- dump "Done. Please connect a device to run all tests!"
- clean_exit 0
-fi
-
-# Push the program to the device.
-TESTAPP=test_google_breakpad
-TESTAPP_FILE="$PROJECT_DIR/libs/$ABI/test_google_breakpad"
-if [ ! -f "$TESTAPP_FILE" ]; then
- panic "Device requires '$ABI' binaries. None found!"
-fi
-
-# Run the program there
-dump "Installing test program on device"
-DEVICE_TMP=/data/local/tmp
-adb_push "$TESTAPP_FILE" "$DEVICE_TMP/"
-fail_panic "Cannot push test program to device!"
-
-dump "Running test program on device"
-adb_shell cd "$DEVICE_TMP" "&&" ./$TESTAPP > "$CRASH_LOG" 2>/dev/null
-if [ $? = 0 ]; then
- panic "Test program did *not* crash as expected!"
-fi
-if verbosity_is_higher_than 0; then
- echo -n "Crash log: "
- cat "$CRASH_LOG"
-fi
-
-# Extract minidump from device
-MINIDUMP_NAME=$(awk '$1 == "Dump" && $2 == "path:" { print $3; }' "$CRASH_LOG")
-MINIDUMP_NAME=$(basename "$MINIDUMP_NAME")
-if [ -z "$MINIDUMP_NAME" ]; then
- panic "Test program didn't write minidump properly!"
-fi
-
-dump "Extracting minidump: $MINIDUMP_NAME"
-adb_pull "$DEVICE_TMP/$MINIDUMP_NAME" .
-fail_panic "Can't extract minidump!"
-
-dump "Parsing test program symbols"
-if verbosity_is_higher_than 1; then
- log "COMMAND: $TMPBIN/dump_syms \
- $PROJECT_DIR/obj/local/$ABI/$TESTAPP >$TESTAPP.sym"
-fi
-"$TMPBIN/dump_syms" "$PROJECT_DIR/obj/local/$ABI/$TESTAPP" > $TESTAPP.sym
-fail_panic "dump_syms doesn't work!"
-
-VERSION=$(awk '$1 == "MODULE" { print $4; }' $TESTAPP.sym)
-dump "Found module version: $VERSION"
-if [ -z "$VERSION" ]; then
- echo "ERROR: Can't find proper module version from symbol dump!"
- head -n5 $TESTAPP.sym
- clean_exit 1
-fi
-
-run mkdir -p "$TMPDIR/symbols/$TESTAPP/$VERSION"
-run mv $TESTAPP.sym "$TMPDIR/symbols/$TESTAPP/$VERSION/"
-
-dump "Generating stack trace"
-# Don't use 'run' to be able to send stdout and stderr to two different files.
-log "COMMAND: $TMPBIN/minidump_stackwalk $MINIDUMP_NAME symbols"
-"$TMPBIN/minidump_stackwalk" $MINIDUMP_NAME \
- "$TMPDIR/symbols" \
- > "$BUILD_LOG" 2>>"$RUN_LOG"
-fail_panic "minidump_stackwalk doesn't work!"
-
-dump "Checking stack trace content"
-
-if verbosity_is_higher_than 1; then
- cat "$BUILD_LOG"
-fi
-
-# The generated stack trace should look like the following:
-#
-# Thread 0 (crashed)
-# 0 test_google_breakpad!crash [test_breakpad.cpp : 17 + 0x4]
-# r4 = 0x00015530 r5 = 0xbea2cbe4 r6 = 0xffffff38 r7 = 0xbea2cb5c
-# r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000000 fp = 0x00000000
-# sp = 0xbea2cb50 lr = 0x00009025 pc = 0x00008f84
-# Found by: given as instruction pointer in context
-# 1 test_google_breakpad!main [test_breakpad.cpp : 25 + 0x3]
-# r4 = 0x00015530 r5 = 0xbea2cbe4 r6 = 0xffffff38 r7 = 0xbea2cb5c
-# r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000000 fp = 0x00000000
-# sp = 0xbea2cb50 pc = 0x00009025
-# Found by: call frame info
-# 2 libc.so + 0x164e5
-# r4 = 0x00008f64 r5 = 0xbea2cc34 r6 = 0x00000001 r7 = 0xbea2cc3c
-# r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000000 fp = 0x00000000
-# sp = 0xbea2cc18 pc = 0x400c34e7
-# Found by: call frame info
-# ...
-#
-# The most important part for us is ensuring that the source location could
-# be extracted, so look at the 'test_breakpad.cpp' references here.
-#
-# First, extract all the lines with test_google_breakpad! in them, and
-# dump the corresponding crash location.
-#
-# Note that if the source location can't be extracted, the second field
-# will only be 'test_google_breakpad' without the exclamation mark.
-#
-LOCATIONS=$(awk '$2 ~ "^test_google_breakpad!.*" { print $3; }' "$BUILD_LOG")
-
-if [ -z "$LOCATIONS" ]; then
- if verbosity_is_lower_than 1; then
- cat "$BUILD_LOG"
- fi
- panic "No source location found in stack trace!"
-fi
-
-# Now check that they all match "[<source file>"
-BAD_LOCATIONS=
-for LOCATION in $LOCATIONS; do
- case $LOCATION in
- # Escape the opening bracket, or some shells like Dash will not
- # match them properly.
- \[*.cpp|\[*.cc|\[*.h) # These are valid source locations in our executable
- ;;
- *) # Everything else is not!
- BAD_LOCATIONS="$BAD_LOCATIONS $LOCATION"
- ;;
- esac
-done
-
-if [ "$BAD_LOCATIONS" ]; then
- dump "ERROR: Generated stack trace doesn't contain valid source locations:"
- cat "$BUILD_LOG"
- echo "Bad locations are: $BAD_LOCATIONS"
- exit 1
-fi
-
-echo "All clear! Congratulations."
-
diff --git a/toolkit/crashreporter/google-breakpad/android/sample_app/README b/toolkit/crashreporter/google-breakpad/android/sample_app/README
deleted file mode 100644
index aa19dbb447..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/sample_app/README
+++ /dev/null
@@ -1,32 +0,0 @@
-This is a sample Android executable that can be used to test the
-Google Breakpad client library on Android.
-
-Its purpose is simply to crash and generate a minidump under /data/local/tmp.
-
-Build instructions:
-
- cd android/sample_app
- $NDK/ndk-build
-
- Where $NDK points to a valid Android NDK installation.
-
-Usage instructions:
-
- After buildind the test program, send it to a device, then run it as
- the shell UID:
-
- adb push libs/armeabi/test_google_breakpad /data/local/tmp
- adb shell /data/local/tmp/test_google_breakpad
-
- This will simply crash after dumping the name of the generated minidump
- file.
-
- See jni/test_breakpad.cpp for details.
-
- Use 'armeabi-v7a' instead of 'armeabi' above to test the ARMv7-A version
- of the binary.
-
-Note:
- If you plan to use the library in a regular Android application, store
- the minidump files either to your app-specific directory, or to the SDCard
- (the latter requiring a specific permission).
diff --git a/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Android.mk b/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Android.mk
deleted file mode 100644
index 61487b52c1..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Android.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright (c) 2012, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := test_google_breakpad
-LOCAL_SRC_FILES := test_breakpad.cpp
-LOCAL_STATIC_LIBRARIES += breakpad_client
-include $(BUILD_EXECUTABLE)
-
-# If NDK_MODULE_PATH is defined, import the module, otherwise do a direct
-# includes. This allows us to build in all scenarios easily.
-ifneq ($(NDK_MODULE_PATH),)
- $(call import-module,google_breakpad)
-else
- include $(LOCAL_PATH)/../../google_breakpad/Android.mk
-endif
diff --git a/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Application.mk b/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Application.mk
deleted file mode 100644
index 9728017d3f..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/sample_app/jni/Application.mk
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (c) 2012, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-APP_STL := stlport_static
-APP_ABI := all
-APP_CXXFLAGS := -std=c++11 -D__STDC_LIMIT_MACROS
diff --git a/toolkit/crashreporter/google-breakpad/android/sample_app/jni/test_breakpad.cpp b/toolkit/crashreporter/google-breakpad/android/sample_app/jni/test_breakpad.cpp
deleted file mode 100644
index 9c4ebbb148..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/sample_app/jni/test_breakpad.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdio.h>
-
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/handler/minidump_descriptor.h"
-
-namespace {
-
-bool DumpCallback(const google_breakpad::MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded) {
- printf("Dump path: %s\n", descriptor.path());
- return succeeded;
-}
-
-void Crash() {
- volatile int* a = reinterpret_cast<volatile int*>(NULL);
- *a = 1;
-}
-
-} // namespace
-
-int main(int argc, char* argv[]) {
- google_breakpad::MinidumpDescriptor descriptor(".");
- google_breakpad::ExceptionHandler eh(descriptor, NULL, DumpCallback,
- NULL, true, -1);
- Crash();
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/android/test-driver b/toolkit/crashreporter/google-breakpad/android/test-driver
deleted file mode 100755
index eaaac6b295..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/test-driver
+++ /dev/null
@@ -1,131 +0,0 @@
-#! /bin/sh
-# test-driver - basic testsuite driver script.
-
-# Slightly modified for Android, see ANDROID comment below.
-
-scriptversion=2012-06-27.10; # UTC
-
-# Copyright (C) 2011-2013 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-# Make unconditional expansion of undefined variables an error. This
-# helps a lot in preventing typo-related bugs.
-set -u
-
-usage_error ()
-{
- echo "$0: $*" >&2
- print_usage >&2
- exit 2
-}
-
-print_usage ()
-{
- cat <<END
-Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT
-The '--test-name', '--log-file' and '--trs-file' options are mandatory.
-END
-}
-
-# TODO: better error handling in option parsing (in particular, ensure
-# TODO: $log_file, $trs_file and $test_name are defined).
-test_name= # Used for reporting.
-log_file= # Where to save the output of the test script.
-trs_file= # Where to save the metadata of the test run.
-expect_failure=no
-color_tests=no
-enable_hard_errors=yes
-while test $# -gt 0; do
- case $1 in
- --help) print_usage; exit $?;;
- --version) echo "test-driver $scriptversion"; exit $?;;
- --test-name) test_name=$2; shift;;
- --log-file) log_file=$2; shift;;
- --trs-file) trs_file=$2; shift;;
- --color-tests) color_tests=$2; shift;;
- --expect-failure) expect_failure=$2; shift;;
- --enable-hard-errors) enable_hard_errors=$2; shift;;
- --) shift; break;;
- -*) usage_error "invalid option: '$1'";;
- esac
- shift
-done
-
-if test $color_tests = yes; then
- # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
- red='' # Red.
- grn='' # Green.
- lgn='' # Light green.
- blu='' # Blue.
- mgn='' # Magenta.
- std='' # No color.
-else
- red= grn= lgn= blu= mgn= std=
-fi
-
-do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
-trap "st=129; $do_exit" 1
-trap "st=130; $do_exit" 2
-trap "st=141; $do_exit" 13
-trap "st=143; $do_exit" 15
-
-# Test script is run here.
-# ANDROID: old line was: "$@" > $log_file 2>&1
-progdir=$(dirname "$0")
-"$progdir/test-shell.sh" "$@" > $log_file 2>&1
-estatus=$?
-if test $enable_hard_errors = no && test $estatus -eq 99; then
- estatus=1
-fi
-
-case $estatus:$expect_failure in
- 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
- 0:*) col=$grn res=PASS recheck=no gcopy=no;;
- 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
- 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
- *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
- *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
-esac
-
-# Report outcome to console.
-echo "${col}${res}${std}: $test_name"
-
-# Register the test result, and other relevant metadata.
-echo ":test-result: $res" > $trs_file
-echo ":global-test-result: $res" >> $trs_file
-echo ":recheck: $recheck" >> $trs_file
-echo ":copy-in-global-log: $gcopy" >> $trs_file
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/android/test-shell.sh b/toolkit/crashreporter/google-breakpad/android/test-shell.sh
deleted file mode 100755
index 3677d8755a..0000000000
--- a/toolkit/crashreporter/google-breakpad/android/test-shell.sh
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/sh
-#
-# Copyright (c) 2012 Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# A special shell wrapper that can be used to run the Google Breakpad unit
-# tests on a connected Android device.
-#
-# This is designed to be called from the Makefile during 'make check'
-#
-
-PROGDIR=$(dirname "$0")
-PROGNAME=$(basename "$0")
-. $PROGDIR/common-functions.sh
-
-# Extract test program name first.
-TEST_PROGRAM=$1
-shift
-
-if [ -z "$TEST_PROGRAM" ]; then
- panic "No test program/script name on the command-line!"
-fi
-
-if [ ! -f "$TEST_PROGRAM" ]; then
- panic "Can't find test program/script: $TEST_PROGRAM"
-fi
-
-# Create test directory on the device
-TEST_DIR=/data/local/tmp/test-google-breakpad-$$
-adb_shell mkdir "$TEST_DIR" ||
- panic "Can't create test directory on device: $TEST_DIR"
-
-# Ensure that it is always removed when the script exits.
-clean_test_dir () {
- # Don't care about success/failure, use '$ADB shell' directly.
- adb_shell rm -r "$TEST_DIR"
-}
-
-atexit clean_test_dir
-
-TEST_PROGRAM_NAME=$(basename "$TEST_PROGRAM")
-TEST_PROGRAM_DIR=$(dirname "$TEST_PROGRAM")
-
-# Handle special case(s) here.
-DATA_FILES=
-case $TEST_PROGRAM_NAME in
- linux_client_unittest)
- # linux_client_unittest will call another executable at runtime, ensure
- # it is installed too.
- adb_install "$TEST_PROGRAM_DIR/linux_dumper_unittest_helper" "$TEST_DIR"
- # linux_client_unittest loads a shared library at runtime, ensure it is
- # installed too.
- adb_install "$TEST_PROGRAM_DIR/linux_client_unittest_shlib" "$TEST_DIR"
- ;;
- basic_source_line_resolver_unittest)
- DATA_FILES="module1.out \
- module2.out \
- module3_bad.out \
- module4_bad.out"
- ;;
- exploitability_unittest)
- DATA_FILES="scii_read_av.dmp \
- ascii_read_av_block_write.dmp \
- ascii_read_av_clobber_write.dmp \
- ascii_read_av_conditional.dmp \
- ascii_read_av_non_null.dmp \
- ascii_read_av_then_jmp.dmp \
- ascii_read_av_xchg_write.dmp \
- ascii_write_av.dmp \
- ascii_write_av_arg_to_call.dmp \
- exec_av_on_stack.dmp \
- null_read_av.dmp \
- null_write_av.dmp \
- read_av.dmp \
- null_read_av.dmp \
- write_av_non_null.dmp"
- ;;
- fast_source_line_resolver_unittest)
- DATA_FILES="module0.out \
- module1.out \
- module2.out \
- module3_bad.out \
- module4_bad.out"
- ;;
- minidump_processor_unittest|minidump_unittest)
- DATA_FILES="src/processor/testdata/minidump2.dmp"
- ;;
-esac
-
-# Install the data files, their path is relative to the environment
-# variable 'srcdir'
-for FILE in $DATA_FILES; do
- FILEDIR=src/processor/testdata/$(dirname "$FILE")
- adb_shell mkdir -p "$TEST_DIR/$FILEDIR"
- adb_install "${srcdir:-.}/$FILE" "$TEST_DIR"/"$FILE"
-done
-
-# Copy test program to device
-adb_install "$TEST_PROGRAM" "$TEST_DIR"
-
-# Run it
-adb_shell "cd $TEST_DIR && LD_LIBRARY_PATH=. ./$TEST_PROGRAM_NAME $@"
-
-# Note: exiting here will call cleanup_exit which will remove the temporary
-# files from the device.
diff --git a/toolkit/crashreporter/google-breakpad/autotools/compile b/toolkit/crashreporter/google-breakpad/autotools/compile
deleted file mode 100755
index a85b723c7e..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/compile
+++ /dev/null
@@ -1,347 +0,0 @@
-#! /bin/sh
-# Wrapper for compilers which do not understand '-c -o'.
-
-scriptversion=2012-10-14.11; # UTC
-
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
-# Written by Tom Tromey <tromey@cygnus.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-nl='
-'
-
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent tools from complaining about whitespace usage.
-IFS=" "" $nl"
-
-file_conv=
-
-# func_file_conv build_file lazy
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts. If the determined conversion
-# type is listed in (the comma separated) LAZY, no conversion will
-# take place.
-func_file_conv ()
-{
- file=$1
- case $file in
- / | /[!/]*) # absolute file, and not a UNC file
- if test -z "$file_conv"; then
- # lazily determine how to convert abs files
- case `uname -s` in
- MINGW*)
- file_conv=mingw
- ;;
- CYGWIN*)
- file_conv=cygwin
- ;;
- *)
- file_conv=wine
- ;;
- esac
- fi
- case $file_conv/,$2, in
- *,$file_conv,*)
- ;;
- mingw/*)
- file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
- ;;
- cygwin/*)
- file=`cygpath -m "$file" || echo "$file"`
- ;;
- wine/*)
- file=`winepath -w "$file" || echo "$file"`
- ;;
- esac
- ;;
- esac
-}
-
-# func_cl_dashL linkdir
-# Make cl look for libraries in LINKDIR
-func_cl_dashL ()
-{
- func_file_conv "$1"
- if test -z "$lib_path"; then
- lib_path=$file
- else
- lib_path="$lib_path;$file"
- fi
- linker_opts="$linker_opts -LIBPATH:$file"
-}
-
-# func_cl_dashl library
-# Do a library search-path lookup for cl
-func_cl_dashl ()
-{
- lib=$1
- found=no
- save_IFS=$IFS
- IFS=';'
- for dir in $lib_path $LIB
- do
- IFS=$save_IFS
- if $shared && test -f "$dir/$lib.dll.lib"; then
- found=yes
- lib=$dir/$lib.dll.lib
- break
- fi
- if test -f "$dir/$lib.lib"; then
- found=yes
- lib=$dir/$lib.lib
- break
- fi
- if test -f "$dir/lib$lib.a"; then
- found=yes
- lib=$dir/lib$lib.a
- break
- fi
- done
- IFS=$save_IFS
-
- if test "$found" != yes; then
- lib=$lib.lib
- fi
-}
-
-# func_cl_wrapper cl arg...
-# Adjust compile command to suit cl
-func_cl_wrapper ()
-{
- # Assume a capable shell
- lib_path=
- shared=:
- linker_opts=
- for arg
- do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- eat=1
- case $2 in
- *.o | *.[oO][bB][jJ])
- func_file_conv "$2"
- set x "$@" -Fo"$file"
- shift
- ;;
- *)
- func_file_conv "$2"
- set x "$@" -Fe"$file"
- shift
- ;;
- esac
- ;;
- -I)
- eat=1
- func_file_conv "$2" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -I*)
- func_file_conv "${1#-I}" mingw
- set x "$@" -I"$file"
- shift
- ;;
- -l)
- eat=1
- func_cl_dashl "$2"
- set x "$@" "$lib"
- shift
- ;;
- -l*)
- func_cl_dashl "${1#-l}"
- set x "$@" "$lib"
- shift
- ;;
- -L)
- eat=1
- func_cl_dashL "$2"
- ;;
- -L*)
- func_cl_dashL "${1#-L}"
- ;;
- -static)
- shared=false
- ;;
- -Wl,*)
- arg=${1#-Wl,}
- save_ifs="$IFS"; IFS=','
- for flag in $arg; do
- IFS="$save_ifs"
- linker_opts="$linker_opts $flag"
- done
- IFS="$save_ifs"
- ;;
- -Xlinker)
- eat=1
- linker_opts="$linker_opts $2"
- ;;
- -*)
- set x "$@" "$1"
- shift
- ;;
- *.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
- func_file_conv "$1"
- set x "$@" -Tp"$file"
- shift
- ;;
- *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
- func_file_conv "$1" mingw
- set x "$@" "$file"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
- done
- if test -n "$linker_opts"; then
- linker_opts="-link$linker_opts"
- fi
- exec "$@" $linker_opts
- exit 1
-}
-
-eat=
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: compile [--help] [--version] PROGRAM [ARGS]
-
-Wrapper for compilers which do not understand '-c -o'.
-Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
-arguments, and rename the output as expected.
-
-If you are trying to build a whole package this is not the
-right script to run: please start by reading the file 'INSTALL'.
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "compile $scriptversion"
- exit $?
- ;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
- func_cl_wrapper "$@" # Doesn't return...
- ;;
-esac
-
-ofile=
-cfile=
-
-for arg
-do
- if test -n "$eat"; then
- eat=
- else
- case $1 in
- -o)
- # configure might choose to run compile as 'compile cc -o foo foo.c'.
- # So we strip '-o arg' only if arg is an object.
- eat=1
- case $2 in
- *.o | *.obj)
- ofile=$2
- ;;
- *)
- set x "$@" -o "$2"
- shift
- ;;
- esac
- ;;
- *.c)
- cfile=$1
- set x "$@" "$1"
- shift
- ;;
- *)
- set x "$@" "$1"
- shift
- ;;
- esac
- fi
- shift
-done
-
-if test -z "$ofile" || test -z "$cfile"; then
- # If no '-o' option was seen then we might have been invoked from a
- # pattern rule where we don't need one. That is ok -- this is a
- # normal compilation that the losing compiler can handle. If no
- # '.c' file was seen then we are probably linking. That is also
- # ok.
- exec "$@"
-fi
-
-# Name of file we expect compiler to create.
-cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
-
-# Create the lock directory.
-# Note: use '[/\\:.-]' here to ensure that we don't use the same name
-# that we are using for the .o file. Also, base the name on the expected
-# object file name, since that is what matters with a parallel build.
-lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
-while true; do
- if mkdir "$lockdir" >/dev/null 2>&1; then
- break
- fi
- sleep 1
-done
-# FIXME: race condition here if user kills between mkdir and trap.
-trap "rmdir '$lockdir'; exit 1" 1 2 15
-
-# Run the compile.
-"$@"
-ret=$?
-
-if test -f "$cofile"; then
- test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
-elif test -f "${cofile}bj"; then
- test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
-fi
-
-rmdir "$lockdir"
-exit $ret
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/autotools/config.guess b/toolkit/crashreporter/google-breakpad/autotools/config.guess
deleted file mode 100755
index dcd5149681..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/config.guess
+++ /dev/null
@@ -1,1447 +0,0 @@
-#! /bin/sh
-# Attempt to guess a canonical system name.
-# Copyright 1992-2016 Free Software Foundation, Inc.
-
-timestamp='2016-01-01'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-#
-# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
-#
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
-#
-# Please send patches to <config-patches@gnu.org>.
-
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION]
-
-Output the configuration name of the system \`$me' is run on.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.guess ($timestamp)
-
-Originally written by Per Bothner.
-Copyright 1992-2016 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help" >&2
- exit 1 ;;
- * )
- break ;;
- esac
-done
-
-if test $# != 0; then
- echo "$me: too many arguments$help" >&2
- exit 1
-fi
-
-trap 'exit 1' 1 2 15
-
-# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
-# compiler to aid in system detection is discouraged as it requires
-# temporary files to be created and, as you can see below, it is a
-# headache to deal with in a portable fashion.
-
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
-
-# Portable tmp directory creation inspired by the Autoconf team.
-
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
-
-# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
-# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
- PATH=$PATH:/.attbin ; export PATH
-fi
-
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-
-case "${UNAME_SYSTEM}" in
-Linux|GNU|GNU/*)
- # If the system lacks a compiler, then just pick glibc.
- # We could probably try harder.
- LIBC=gnu
-
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
- #include <features.h>
- #if defined(__UCLIBC__)
- LIBC=uclibc
- #elif defined(__dietlibc__)
- LIBC=dietlibc
- #else
- LIBC=gnu
- #endif
- EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
- ;;
-esac
-
-# Note: order is significant - the case branches are not exclusive.
-
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
- *:NetBSD:*:*)
- # NetBSD (nbsd) targets should (where applicable) match one or
- # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
- # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
- # switched to ELF, *-*-netbsd* would select the old
- # object file format. This provides both forward
- # compatibility and a consistent mechanism for selecting the
- # object file format.
- #
- # Note: NetBSD doesn't particularly care about the vendor
- # portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
- /sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || \
- echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
- armeb) machine=armeb-unknown ;;
- arm*) machine=arm-unknown ;;
- sh3el) machine=shl-unknown ;;
- sh3eb) machine=sh-unknown ;;
- sh5el) machine=sh5le-unknown ;;
- earmv*)
- arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
- endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
- machine=${arch}${endian}-unknown
- ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
- esac
- # The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
- arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
- if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ELF__
- then
- # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
- # Return netbsd for either. FIX?
- os=netbsd
- else
- os=netbsdelf
- fi
- ;;
- *)
- os=netbsd
- ;;
- esac
- # Determine ABI tags.
- case "${UNAME_MACHINE_ARCH}" in
- earm*)
- expr='s/^earmv[0-9]/-eabi/;s/eb$//'
- abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
- ;;
- esac
- # The OS release
- # Debian GNU/NetBSD machines have a different userland, and
- # thus, need a distinct triplet. However, they do not need
- # kernel version information, so it can be replaced with a
- # suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
- Debian*)
- release='-gnu'
- ;;
- *)
- release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
- ;;
- esac
- # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
- # contains redundant information, the shorter form:
- # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}${abi}"
- exit ;;
- *:Bitrig:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
- exit ;;
- *:OpenBSD:*:*)
- UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
- *:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
- *:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
- macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
- *:Sortix:*:*)
- echo ${UNAME_MACHINE}-unknown-sortix
- exit ;;
- alpha:OSF1:*:*)
- case $UNAME_RELEASE in
- *4.0)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- ;;
- *5.*)
- UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
- ;;
- esac
- # According to Compaq, /usr/sbin/psrinfo has been available on
- # OSF/1 and Tru64 systems produced since 1995. I hope that
- # covers most systems running today. This code pipes the CPU
- # types through head -n 1, so we only detect the type of CPU 0.
- ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
- "EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
- "EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
- "LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
- "EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
- "EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
- "EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
- "EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
- "EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
- "EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
- "EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
- "EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
- "EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
- "EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
- esac
- # A Pn.n version is a patched version.
- # A Vn.n version is a released version.
- # A Tn.n version is a released field test version.
- # A Xn.n version is an unreleased experimental baselevel.
- # 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
- Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
- *:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
- *:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
- *:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
- *:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
- *:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
- arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm*:riscos:*:*|arm*:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
- SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
- Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
- # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
- NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
- DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
- DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
- case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
- s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
- i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- SUN_ARCH="x86_64"
- fi
- fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:6*:*)
- # According to config.sub, this is the proper way to canonicalize
- # SunOS6. Hard to guess exactly what SunOS6 will be like, but
- # it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
- Series*|S4*)
- UNAME_RELEASE=`uname -v`
- ;;
- esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
- sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
- sun*:*:4.2BSD:*)
- UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
- sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
- ;;
- sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
- ;;
- esac
- exit ;;
- aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
- # The situation for MiNT is a little confusing. The machine name
- # can be virtually everything (everything which is not
- # "atarist" or "atariste" at least should have a processor
- # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
- # to the lowercase version "mint" (or "freemint"). Finally
- # the system name "TOS" denotes a system which is actually not
- # MiNT. But MiNT is downward compatible to TOS, so this should
- # be no problem.
- atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
- milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
- hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
- *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
- m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
- powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
- RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
- RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
- VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
- 2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
- mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-#ifdef __cplusplus
-#include <stdio.h> /* for printf() prototype */
- int main (int argc, char *argv[]) {
-#else
- int main (argc, argv) int argc; char *argv[]; {
-#endif
- #if defined (host_mips) && defined (MIPSEB)
- #if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
- #endif
- #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
- #endif
- #endif
- exit (-1);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
- Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
- Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
- Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
- m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
- m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
- m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
- AViiON:dgux:*:*)
- # DG/UX returns AViiON for all architectures
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
- then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
- then
- echo m88k-dg-dgux${UNAME_RELEASE}
- else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
- fi
- else
- echo i586-dg-dgux${UNAME_RELEASE}
- fi
- exit ;;
- M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
- M88*:*:R3*:*)
- # Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
- XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
- Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
- *:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
- ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
- i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
- ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:2:3)
- if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <sys/systemcfg.h>
-
- main()
- {
- if (!__power_pc())
- exit(1);
- puts("powerpc-ibm-aix3.2.5");
- exit(0);
- }
-EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
- then
- echo "$SYSTEM_NAME"
- else
- echo rs6000-ibm-aix3.2.5
- fi
- elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
- else
- echo rs6000-ibm-aix3.2
- fi
- exit ;;
- *:AIX:*:[4567])
- IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
- IBM_ARCH=rs6000
- else
- IBM_ARCH=powerpc
- fi
- if [ -x /usr/bin/lslpp ] ; then
- IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
- awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
- else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
- fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
- *:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
- ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
- *:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
- DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
- 9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
- hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
- 9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
- 9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
- sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
- sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
- 532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
- esac ;;
- esac
- fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
-
- #define _HPUX_SOURCE
- #include <stdlib.h>
- #include <unistd.h>
-
- int main ()
- {
- #if defined(_SC_KERNEL_BITS)
- long bits = sysconf(_SC_KERNEL_BITS);
- #endif
- long cpu = sysconf (_SC_CPU_VERSION);
-
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
- case CPU_PA_RISC2_0:
- #if defined(_SC_KERNEL_BITS)
- switch (bits)
- {
- case 64: puts ("hppa2.0w"); break;
- case 32: puts ("hppa2.0n"); break;
- default: puts ("hppa2.0"); break;
- } break;
- #else /* !defined(_SC_KERNEL_BITS) */
- puts ("hppa2.0"); break;
- #endif
- default: puts ("hppa1.0"); break;
- }
- exit (0);
- }
-EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
- test -z "$HP_ARCH" && HP_ARCH=hppa
- fi ;;
- esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
- then
- eval $set_cc_for_build
-
- # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
- # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
- # generating 64-bit code. GNU and HP use different nomenclature:
- #
- # $ CC_FOR_BUILD=cc ./config.guess
- # => hppa2.0w-hp-hpux11.23
- # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
- # => hppa64-hp-hpux11.23
-
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
- grep -q __LP64__
- then
- HP_ARCH="hppa2.0w"
- else
- HP_ARCH="hppa64"
- fi
- fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
- ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
- 3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <unistd.h>
- int
- main ()
- {
- long cpu = sysconf (_SC_CPU_VERSION);
- /* The order matters, because CPU_IS_HP_MC68K erroneously returns
- true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
- results, however. */
- if (CPU_IS_PA_RISC (cpu))
- {
- switch (cpu)
- {
- case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
- case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
- default: puts ("hppa-hitachi-hiuxwe2"); break;
- }
- }
- else if (CPU_IS_HP_MC68K (cpu))
- puts ("m68k-hitachi-hiuxwe2");
- else puts ("unknown-hitachi-hiuxwe2");
- exit (0);
- }
-EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
- { echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
- 9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
- *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
- hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
- i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
- else
- echo ${UNAME_MACHINE}-unknown-osf1
- fi
- exit ;;
- parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
- C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
- C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
- if getsysinfo -f scalar_acc
- then echo c32-convex-bsd
- else echo c2-convex-bsd
- fi
- exit ;;
- C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
- C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
- C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
- CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
- | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
- -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
- -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- *:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
- F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- 5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
- i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
- sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
- *:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
- amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- esac
- exit ;;
- i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
- *:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
- exit ;;
- *:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- *:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
- i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
- *:Interix*:*)
- case ${UNAME_MACHINE} in
- x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
- authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
- IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
- esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
- i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
- amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
- prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
- *:GNU:*:*)
- # the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
- *:GNU/*:*:*)
- # other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
- aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- aarch64_be:Linux:*:*)
- UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
- EV5) UNAME_MACHINE=alphaev5 ;;
- EV56) UNAME_MACHINE=alphaev56 ;;
- PCA56) UNAME_MACHINE=alphapca56 ;;
- PCA57) UNAME_MACHINE=alphapca56 ;;
- EV6) UNAME_MACHINE=alphaev6 ;;
- EV67) UNAME_MACHINE=alphaev67 ;;
- EV68*) UNAME_MACHINE=alphaev68 ;;
- esac
- objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- arm*:Linux:*:*)
- eval $set_cc_for_build
- if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_EABI__
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- else
- if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
- | grep -q __ARM_PCS_VFP
- then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
- else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
- fi
- fi
- exit ;;
- avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
- exit ;;
- e2k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- k1om:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
- #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
- #else
- #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
- #else
- CPU=
- #endif
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
- ;;
- openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
- exit ;;
- or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
- exit ;;
- parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
- exit ;;
- parisc:Linux:*:* | hppa:Linux:*:*)
- # Look for CPU level
- case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
- esac
- exit ;;
- ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
- exit ;;
- ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
- exit ;;
- ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
- exit ;;
- s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
- exit ;;
- sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
- exit ;;
- x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
- exit ;;
- xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
- exit ;;
- i*86:DYNIX/ptx:4*:*)
- # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
- # earlier versions are messed up and put the nodename in both
- # sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
- i*86:UNIX_SV:4.2MP:2.*)
- # Unixware is an offshoot of SVR4, but it has its own version
- # number series starting with 2...
- # I am not positive that other SVR4 systems won't match this,
- # I just have to hope. -- rms.
- # Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
- i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
- # is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
- i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
- i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
- i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
- i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
- if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
- else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
- fi
- exit ;;
- i*86:*:5:[678]*)
- # UnixWare 7.x, OpenUNIX and OpenServer 6.
- case `/bin/uname -X | grep "^Machine"` in
- *486*) UNAME_MACHINE=i486 ;;
- *Pentium) UNAME_MACHINE=i586 ;;
- *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
- esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
- i*86:*:3.2:*)
- if test -f /usr/options/cb.name; then
- UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
- elif /bin/uname -X 2>/dev/null >/dev/null ; then
- UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
- (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
- (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
- && UNAME_MACHINE=i586
- (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
- && UNAME_MACHINE=i686
- (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
- && UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
- else
- echo ${UNAME_MACHINE}-pc-sysv32
- fi
- exit ;;
- pc:*:*:*)
- # Left here for compatibility:
- # uname -m prints for DJGPP always 'pc', but it prints nothing about
- # the processor, so we play safe by assuming i586.
- # Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configure will decide that
- # this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
- Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
- paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
- i860:*:4.*:*) # i860-SVR4
- if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
- else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
- fi
- exit ;;
- mini*:CTIX:SYS*5:*)
- # "miniframe"
- echo m68010-convergent-sysv
- exit ;;
- mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
- M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
- M68*:*:R3V[5678]*:*)
- test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
- 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
- OS_REL=''
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4; exit; } ;;
- NCR*:*:4.2:* | MPRAS*:*:4.2:*)
- OS_REL='.3'
- test -r /etc/.relid \
- && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
- /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
- /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
- m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
- TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
- SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
- RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
- *:SINIX-*:*:*)
- if uname -p 2>/dev/null >/dev/null ; then
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
- else
- echo ns32k-sni-sysv
- fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
- # says <Richard.M.Bartel@ccMail.Census.GOV>
- echo i586-unisys-sysv4
- exit ;;
- *:UNIX_System_V:4*:FTX*)
- # From Gerald Hewes <hewes@openmarket.com>.
- # How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
- *:*:*:FTX*)
- # From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
- i*86:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
- *:VOS:*:*)
- # From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
- mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
- news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
- R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
- else
- echo mips-unknown-sysv${UNAME_RELEASE}
- fi
- exit ;;
- BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
- BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
- BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
- BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
- x86_64:Haiku:*:*)
- echo x86_64-unknown-haiku
- exit ;;
- SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
- SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
- Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
- *:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
- if test "$UNAME_PROCESSOR" = unknown ; then
- UNAME_PROCESSOR=powerpc
- fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- case $UNAME_PROCESSOR in
- i386) UNAME_PROCESSOR=x86_64 ;;
- powerpc) UNAME_PROCESSOR=powerpc64 ;;
- esac
- fi
- fi
- elif test "$UNAME_PROCESSOR" = i386 ; then
- # Avoid executing cc on OS X 10.9, as it ships with a stub
- # that puts up a graphical alert prompting to install
- # developer tools. Any system running Mac OS X 10.7 or
- # later (Darwin 11 and later) is required to have a 64-bit
- # processor. This is not true of the ARM version of Darwin
- # that Apple uses in portable devices.
- UNAME_PROCESSOR=x86_64
- fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
- *:procnto*:*:* | *:QNX:[0123456789]*:*)
- UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
- UNAME_PROCESSOR=i386
- UNAME_MACHINE=pc
- fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
- *:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
- *:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
- BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
- DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
- *:Plan9:*:*)
- # "uname -m" is not consistent, so use $cputype instead. 386
- # is converted to i386 for consistency with other x86
- # operating systems.
- if test "$cputype" = "386"; then
- UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
- fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
- *:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
- *:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
- KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
- XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
- *:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
- *:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
- SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
- *:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
- *:*VMS:*:*)
- UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
- esac ;;
- *:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
- i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
- i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
- x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
- amd64:Isilon\ OneFS:*:*)
- echo x86_64-unknown-onefs
- exit ;;
-esac
-
-cat >&2 <<EOF
-$0: unable to guess system type
-
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
-
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
-and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
-
-config.guess timestamp = $timestamp
-
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
-
-hostinfo = `(hostinfo) 2>/dev/null`
-/bin/universe = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
-EOF
-
-exit 1
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/autotools/config.sub b/toolkit/crashreporter/google-breakpad/autotools/config.sub
deleted file mode 100755
index da6d1b6826..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/config.sub
+++ /dev/null
@@ -1,1813 +0,0 @@
-#! /bin/sh
-# Configuration validation subroutine script.
-# Copyright 1992-2016 Free Software Foundation, Inc.
-
-timestamp='2016-01-01'
-
-# This file is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that
-# program. This Exception is an additional permission under section 7
-# of the GNU General Public License, version 3 ("GPLv3").
-
-
-# Please send patches to <config-patches@gnu.org>.
-#
-# Configuration subroutine to validate and canonicalize a configuration type.
-# Supply the specified configuration type as an argument.
-# If it is invalid, we print an error message on stderr and exit with code 1.
-# Otherwise, we print the canonical config type on stdout and succeed.
-
-# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-
-# This file is supposed to be the same for all GNU packages
-# and recognize all the CPU types, system types and aliases
-# that are meaningful with *any* GNU software.
-# Each package is responsible for reporting which valid configurations
-# it does not support. The user should be able to distinguish
-# a failure to support a valid configuration from a meaningless
-# configuration.
-
-# The goal of this file is to map all the various variations of a given
-# machine specification into a single specification in the form:
-# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or in some cases, the newer four-part form:
-# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-# It is wrong to echo any other type of specification.
-
-me=`echo "$0" | sed -e 's,.*/,,'`
-
-usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
-
-Canonicalize a configuration name.
-
-Operation modes:
- -h, --help print this help, then exit
- -t, --time-stamp print date of last modification, then exit
- -v, --version print version number, then exit
-
-Report bugs and patches to <config-patches@gnu.org>."
-
-version="\
-GNU config.sub ($timestamp)
-
-Copyright 1992-2016 Free Software Foundation, Inc.
-
-This is free software; see the source for copying conditions. There is NO
-warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
-
-help="
-Try \`$me --help' for more information."
-
-# Parse command line
-while test $# -gt 0 ; do
- case $1 in
- --time-stamp | --time* | -t )
- echo "$timestamp" ; exit ;;
- --version | -v )
- echo "$version" ; exit ;;
- --help | --h* | -h )
- echo "$usage"; exit ;;
- -- ) # Stop option processing
- shift; break ;;
- - ) # Use stdin as input.
- break ;;
- -* )
- echo "$me: invalid option $1$help"
- exit 1 ;;
-
- *local*)
- # First pass through any local machine types.
- echo $1
- exit ;;
-
- * )
- break ;;
- esac
-done
-
-case $# in
- 0) echo "$me: missing argument$help" >&2
- exit 1;;
- 1) ;;
- *) echo "$me: too many arguments$help" >&2
- exit 1;;
-esac
-
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
-
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work. We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
- -sun*os*)
- # Prevent following clause from handling this invalid input.
- ;;
- -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
- -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
- -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
- -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
- -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze*)
- os=
- basic_machine=$1
- ;;
- -bluegene*)
- os=-cnk
- ;;
- -sim | -cisco | -oki | -wec | -winbond)
- os=
- basic_machine=$1
- ;;
- -scout)
- ;;
- -wrs)
- os=-vxworks
- basic_machine=$1
- ;;
- -chorusos*)
- os=-chorusos
- basic_machine=$1
- ;;
- -chorusrdb)
- os=-chorusrdb
- basic_machine=$1
- ;;
- -hiux*)
- os=-hiuxwe2
- ;;
- -sco6)
- os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5)
- os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco4)
- os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco3.2v[4-9]*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -sco*)
- os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -isc)
- os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -clix*)
- basic_machine=clipper-intergraph
- ;;
- -isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
- ;;
- -lynx*178)
- os=-lynxos178
- ;;
- -lynx*5)
- os=-lynxos5
- ;;
- -lynx*)
- os=-lynxos
- ;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
- ;;
- -psos*)
- os=-psos
- ;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
-esac
-
-# Decode aliases for certain CPU-COMPANY combinations.
-case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arceb \
- | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
- | avr | avr32 \
- | ba \
- | be32 | be64 \
- | bfin \
- | c4x | c8051 | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | e2k | epiphany \
- | fido | fr30 | frv | ft32 \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | k1om \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 | nios2eb | nios2el \
- | ns16k | ns32k \
- | open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | riscv32 | riscv64 \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | visium \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- leon|leon[3-9])
- basic_machine=sparc-$basic_machine
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
- ;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
- ;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- xscaleeb)
- basic_machine=armeb-unknown
- ;;
-
- xscaleel)
- basic_machine=armel-unknown
- ;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | ba-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | c8051-* | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | e2k-* | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | k1om-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
- | microblaze-* | microblazeel-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa32r6-* | mipsisa32r6el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64r6-* | mipsisa64r6el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipsr5900-* | mipsr5900el-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* | nios2eb-* | nios2el-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | or1k*-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | riscv32-* | riscv64-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | visium-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
- ;;
- # Recognize the various machine names and aliases which stand
- # for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
- 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
- ;;
- 3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- asmjs)
- basic_machine=asmjs-unknown
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
- ;;
- decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
- ;;
- decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
- ;;
- delta | 3300 | motorola-3300 | motorola-delta \
- | 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
- ;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
- ;;
- encore | umax | mmax)
- basic_machine=ns32k-encore
- ;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
- ;;
- fx2800)
- basic_machine=i860-alliant
- ;;
- genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
- ;;
- h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
- ;;
- hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
- ;;
- hp9k3[2-9][0-9])
- basic_machine=m68k-hp
- ;;
- hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
- ;;
- hp9k78[0-9] | hp78[0-9])
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
- # FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
- ;;
- hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
- ;;
- i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
- ;;
- i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
- ;;
- i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
- ;;
- i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
- ;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
- ;;
- iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
- ;;
- *)
- os=-irix4
- ;;
- esac
- ;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze*)
- basic_machine=microblaze-xilinx
- ;;
- mingw64)
- basic_machine=x86_64-pc
- os=-mingw64
- ;;
- mingw32)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
- miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- moxiebox)
- basic_machine=moxie-unknown
- os=-moxiebox
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i686-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
- ;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
- ;;
- news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
- ;;
- -ns2*)
- os=-nextstep2
- ;;
- *)
- os=-nextstep3
- ;;
- esac
- ;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
- np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
- ;;
- op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
- ;;
- pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- pbd)
- basic_machine=sparc-tti
- ;;
- pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
- ;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos | rdos64)
- basic_machine=x86_64-pc
- os=-rdos
- ;;
- rdos32)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- rm[46]00)
- basic_machine=mips-siemens
- ;;
- rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
- ;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
- ;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
- ;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
- ;;
- sei)
- basic_machine=mips-sei
- os=-seiux
- ;;
- sequent)
- basic_machine=i386-sequent
- ;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
- sh5el)
- basic_machine=sh5le-unknown
- ;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
- ;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
- ;;
- spur)
- basic_machine=spur-unknown
- ;;
- st2000)
- basic_machine=m68k-tandem
- ;;
- stratus)
- basic_machine=i860-stratus
- os=-sysv4
- ;;
- strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- sun2)
- basic_machine=m68000-sun
- ;;
- sun2os3)
- basic_machine=m68000-sun
- os=-sunos3
- ;;
- sun2os4)
- basic_machine=m68000-sun
- os=-sunos4
- ;;
- sun3os3)
- basic_machine=m68k-sun
- os=-sunos3
- ;;
- sun3os4)
- basic_machine=m68k-sun
- os=-sunos4
- ;;
- sun4os3)
- basic_machine=sparc-sun
- os=-sunos3
- ;;
- sun4os4)
- basic_machine=sparc-sun
- os=-sunos4
- ;;
- sun4sol2)
- basic_machine=sparc-sun
- os=-solaris2
- ;;
- sun3 | sun3-*)
- basic_machine=m68k-sun
- ;;
- sun4)
- basic_machine=sparc-sun
- ;;
- sun386 | sun386i | roadrunner)
- basic_machine=i386-sun
- ;;
- sv1)
- basic_machine=sv1-cray
- os=-unicos
- ;;
- symmetry)
- basic_machine=i386-sequent
- os=-dynix
- ;;
- t3e)
- basic_machine=alphaev5-cray
- os=-unicos
- ;;
- t90)
- basic_machine=t90-cray
- os=-unicos
- ;;
- tile*)
- basic_machine=$basic_machine-unknown
- os=-linux-gnu
- ;;
- tx39)
- basic_machine=mipstx39-unknown
- ;;
- tx39el)
- basic_machine=mipstx39el-unknown
- ;;
- toad1)
- basic_machine=pdp10-xkl
- os=-tops20
- ;;
- tower | tower-32)
- basic_machine=m68k-ncr
- ;;
- tpf)
- basic_machine=s390x-ibm
- os=-tpf
- ;;
- udi29k)
- basic_machine=a29k-amd
- os=-udi
- ;;
- ultra3)
- basic_machine=a29k-nyu
- os=-sym1
- ;;
- v810 | necv810)
- basic_machine=v810-nec
- os=-none
- ;;
- vaxv)
- basic_machine=vax-dec
- os=-sysv
- ;;
- vms)
- basic_machine=vax-dec
- os=-vms
- ;;
- vpp*|vx|vx-*)
- basic_machine=f301-fujitsu
- ;;
- vxworks960)
- basic_machine=i960-wrs
- os=-vxworks
- ;;
- vxworks68)
- basic_machine=m68k-wrs
- os=-vxworks
- ;;
- vxworks29k)
- basic_machine=a29k-wrs
- os=-vxworks
- ;;
- w65*)
- basic_machine=w65-wdc
- os=-none
- ;;
- w89k-*)
- basic_machine=hppa1.1-winbond
- os=-proelf
- ;;
- xbox)
- basic_machine=i686-pc
- os=-mingw32
- ;;
- xps | xps100)
- basic_machine=xps100-honeywell
- ;;
- xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
- ;;
- ymp)
- basic_machine=ymp-cray
- os=-unicos
- ;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
- none)
- basic_machine=none-none
- os=-none
- ;;
-
-# Here we handle the default manufacturer of certain CPU types. It is in
-# some cases the only manufacturer, in others, it is the most popular.
- w89k)
- basic_machine=hppa1.1-winbond
- ;;
- op50n)
- basic_machine=hppa1.1-oki
- ;;
- op60c)
- basic_machine=hppa1.1-oki
- ;;
- romp)
- basic_machine=romp-ibm
- ;;
- mmix)
- basic_machine=mmix-knuth
- ;;
- rs6000)
- basic_machine=rs6000-ibm
- ;;
- vax)
- basic_machine=vax-dec
- ;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
- pdp11)
- basic_machine=pdp11-dec
- ;;
- we32k)
- basic_machine=we32k-att
- ;;
- sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
- basic_machine=sh-unknown
- ;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
- cydra)
- basic_machine=cydra-cydrome
- ;;
- orion)
- basic_machine=orion-highlevel
- ;;
- orion105)
- basic_machine=clipper-highlevel
- ;;
- mac | mpw | mac-mpw)
- basic_machine=m68k-apple
- ;;
- pmac | pmac-mpw)
- basic_machine=powerpc-apple
- ;;
- *-unknown)
- # Make sure to match an already-canonicalized machine name.
- ;;
- *)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
- ;;
-esac
-
-# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
- ;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
- ;;
- *)
- ;;
-esac
-
-# Decode manufacturer-specific aliases for certain operating systems.
-
-if [ x"$os" != x"" ]
-then
-case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
- # -solaris* is a basic system type, with this one exception.
- -auroraux)
- os=-auroraux
- ;;
- -solaris1 | -solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
- ;;
- -solaris)
- os=-solaris2
- ;;
- -svr4*)
- os=-sysv4
- ;;
- -unixware*)
- os=-sysv4.2uw
- ;;
- -gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
- # First accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
- # -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
- | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
- | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* | -plan9* \
- | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* | -cloudabi* | -sortix* \
- | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
- | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
- | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
- | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
- | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
- | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
- | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
- | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
- | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos*)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
- -qnx*)
- case $basic_machine in
- x86-* | i*86-*)
- ;;
- *)
- os=-nto$os
- ;;
- esac
- ;;
- -nto-qnx*)
- ;;
- -nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
- | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
- ;;
- -mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
- ;;
- -linux-dietlibc)
- os=-linux-dietlibc
- ;;
- -linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
- -sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
- ;;
- -sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
- ;;
- -opened*)
- os=-openedition
- ;;
- -os400*)
- os=-os400
- ;;
- -wince*)
- os=-wince
- ;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
- -utek*)
- os=-bsd
- ;;
- -dynix*)
- os=-bsd
- ;;
- -acis*)
- os=-aos
- ;;
- -atheos*)
- os=-atheos
- ;;
- -syllable*)
- os=-syllable
- ;;
- -386bsd)
- os=-bsd
- ;;
- -ctix* | -uts*)
- os=-sysv
- ;;
- -nova*)
- os=-rtmk-nova
- ;;
- -ns2 )
- os=-nextstep2
- ;;
- -nsk*)
- os=-nsk
- ;;
- # Preserve the version number of sinix5.
- -sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
- ;;
- -sinix*)
- os=-sysv4
- ;;
- -tpf*)
- os=-tpf
- ;;
- -triton*)
- os=-sysv3
- ;;
- -oss*)
- os=-sysv3
- ;;
- -svr4)
- os=-sysv4
- ;;
- -svr3)
- os=-sysv3
- ;;
- -sysvr4)
- os=-sysv4
- ;;
- # This must come after -sysvr4.
- -sysv*)
- ;;
- -ose*)
- os=-ose
- ;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- os=-mint
- ;;
- -aros*)
- os=-aros
- ;;
- -zvmoe)
- os=-zvmoe
- ;;
- -dicos*)
- os=-dicos
- ;;
- -nacl*)
- ;;
- -none)
- ;;
- *)
- # Get rid of the `-' at the beginning of $os.
- os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
- exit 1
- ;;
-esac
-else
-
-# Here we handle the default operating systems that come with various machines.
-# The value should be what the vendor currently ships out the door with their
-# machine or put another way, the most popular os provided with the machine.
-
-# Note that if you're going to try to match "-MANUFACTURER" here (say,
-# "-sun"), then you have to tell the case statement up towards the top
-# that MANUFACTURER isn't an operating system. Otherwise, code above
-# will signal an error saying that MANUFACTURER isn't an operating
-# system, and we'll never get to this point.
-
-case $basic_machine in
- score-*)
- os=-elf
- ;;
- spu-*)
- os=-elf
- ;;
- *-acorn)
- os=-riscix1.2
- ;;
- arm*-rebel)
- os=-linux
- ;;
- arm*-semi)
- os=-aout
- ;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
- c8051-*)
- os=-elf
- ;;
- hexagon-*)
- os=-elf
- ;;
- tic54x-*)
- os=-coff
- ;;
- tic55x-*)
- os=-coff
- ;;
- tic6x-*)
- os=-coff
- ;;
- # This must come before the *-dec entry.
- pdp10-*)
- os=-tops20
- ;;
- pdp11-*)
- os=-none
- ;;
- *-dec | vax-*)
- os=-ultrix4.2
- ;;
- m68*-apollo)
- os=-domain
- ;;
- i386-sun)
- os=-sunos4.0.2
- ;;
- m68000-sun)
- os=-sunos3
- ;;
- m68*-cisco)
- os=-aout
- ;;
- mep-*)
- os=-elf
- ;;
- mips*-cisco)
- os=-elf
- ;;
- mips*-*)
- os=-elf
- ;;
- or32-*)
- os=-coff
- ;;
- *-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
- ;;
- sparc-* | *-sun)
- os=-sunos4.1.1
- ;;
- *-be)
- os=-beos
- ;;
- *-haiku)
- os=-haiku
- ;;
- *-ibm)
- os=-aix
- ;;
- *-knuth)
- os=-mmixware
- ;;
- *-wec)
- os=-proelf
- ;;
- *-winbond)
- os=-proelf
- ;;
- *-oki)
- os=-proelf
- ;;
- *-hp)
- os=-hpux
- ;;
- *-hitachi)
- os=-hiux
- ;;
- i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
- ;;
- *-cbm)
- os=-amigaos
- ;;
- *-dg)
- os=-dgux
- ;;
- *-dolphin)
- os=-sysv3
- ;;
- m68k-ccur)
- os=-rtu
- ;;
- m88k-omron*)
- os=-luna
- ;;
- *-next )
- os=-nextstep
- ;;
- *-sequent)
- os=-ptx
- ;;
- *-crds)
- os=-unos
- ;;
- *-ns)
- os=-genix
- ;;
- i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
- ;;
- *-gould)
- os=-sysv
- ;;
- *-highlevel)
- os=-bsd
- ;;
- *-encore)
- os=-bsd
- ;;
- *-sgi)
- os=-irix
- ;;
- *-siemens)
- os=-sysv4
- ;;
- *-masscomp)
- os=-rtu
- ;;
- f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
- ;;
- *-rom68k)
- os=-coff
- ;;
- *-*bug)
- os=-coff
- ;;
- *-apple)
- os=-macos
- ;;
- *-atari*)
- os=-mint
- ;;
- *)
- os=-none
- ;;
-esac
-fi
-
-# Here we handle the case where we know the os, and the CPU type, but not the
-# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
- vendor=acorn
- ;;
- -sunos*)
- vendor=sun
- ;;
- -cnk*|-aix*)
- vendor=ibm
- ;;
- -beos*)
- vendor=be
- ;;
- -hpux*)
- vendor=hp
- ;;
- -mpeix*)
- vendor=hp
- ;;
- -hiux*)
- vendor=hitachi
- ;;
- -unos*)
- vendor=crds
- ;;
- -dgux*)
- vendor=dg
- ;;
- -luna*)
- vendor=omron
- ;;
- -genix*)
- vendor=ns
- ;;
- -mvs* | -opened*)
- vendor=ibm
- ;;
- -os400*)
- vendor=ibm
- ;;
- -ptx*)
- vendor=sequent
- ;;
- -tpf*)
- vendor=ibm
- ;;
- -vxsim* | -vxworks* | -windiss*)
- vendor=wrs
- ;;
- -aux*)
- vendor=apple
- ;;
- -hms*)
- vendor=hitachi
- ;;
- -mpw* | -macos*)
- vendor=apple
- ;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
- vendor=atari
- ;;
- -vos*)
- vendor=stratus
- ;;
- esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
- ;;
-esac
-
-echo $basic_machine$os
-exit
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "timestamp='"
-# time-stamp-format: "%:y-%02m-%02d"
-# time-stamp-end: "'"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/autotools/depcomp b/toolkit/crashreporter/google-breakpad/autotools/depcomp
deleted file mode 100755
index fc98710e2a..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/depcomp
+++ /dev/null
@@ -1,791 +0,0 @@
-#! /bin/sh
-# depcomp - compile a program generating dependencies as side-effects
-
-scriptversion=2013-05-30.07; # UTC
-
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
-
-case $1 in
- '')
- echo "$0: No command. Try '$0 --help' for more information." 1>&2
- exit 1;
- ;;
- -h | --h*)
- cat <<\EOF
-Usage: depcomp [--help] [--version] PROGRAM [ARGS]
-
-Run PROGRAMS ARGS to compile a file, generating dependencies
-as side-effects.
-
-Environment variables:
- depmode Dependency tracking mode.
- source Source file read by 'PROGRAMS ARGS'.
- object Object file output by 'PROGRAMS ARGS'.
- DEPDIR directory where to store dependencies.
- depfile Dependency file to output.
- tmpdepfile Temporary file to use when outputting dependencies.
- libtool Whether libtool is used (yes/no).
-
-Report bugs to <bug-automake@gnu.org>.
-EOF
- exit $?
- ;;
- -v | --v*)
- echo "depcomp $scriptversion"
- exit $?
- ;;
-esac
-
-# Get the directory component of the given path, and save it in the
-# global variables '$dir'. Note that this directory component will
-# be either empty or ending with a '/' character. This is deliberate.
-set_dir_from ()
-{
- case $1 in
- */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
- *) dir=;;
- esac
-}
-
-# Get the suffix-stripped basename of the given path, and save it the
-# global variable '$base'.
-set_base_from ()
-{
- base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
-}
-
-# If no dependency file was actually created by the compiler invocation,
-# we still have to create a dummy depfile, to avoid errors with the
-# Makefile "include basename.Plo" scheme.
-make_dummy_depfile ()
-{
- echo "#dummy" > "$depfile"
-}
-
-# Factor out some common post-processing of the generated depfile.
-# Requires the auxiliary global variable '$tmpdepfile' to be set.
-aix_post_process_depfile ()
-{
- # If the compiler actually managed to produce a dependency file,
- # post-process it.
- if test -f "$tmpdepfile"; then
- # Each line is of the form 'foo.o: dependency.h'.
- # Do two passes, one to just change these to
- # $object: dependency.h
- # and one to simply output
- # dependency.h:
- # which is needed to avoid the deleted-header problem.
- { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
- sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
- } > "$depfile"
- rm -f "$tmpdepfile"
- else
- make_dummy_depfile
- fi
-}
-
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-# Character ranges might be problematic outside the C locale.
-# These definitions help.
-upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
-lower=abcdefghijklmnopqrstuvwxyz
-digits=0123456789
-alpha=${upper}${lower}
-
-if test -z "$depmode" || test -z "$source" || test -z "$object"; then
- echo "depcomp: Variables source, object and depmode must be set" 1>&2
- exit 1
-fi
-
-# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
-depfile=${depfile-`echo "$object" |
- sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
-tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
-
-rm -f "$tmpdepfile"
-
-# Avoid interferences from the environment.
-gccflag= dashmflag=
-
-# Some modes work just like other modes, but use different flags. We
-# parameterize here, but still list the modes in the big case below,
-# to make depend.m4 easier to write. Note that we *cannot* use a case
-# here, because this file can only contain one case statement.
-if test "$depmode" = hp; then
- # HP compiler uses -M and no extra arg.
- gccflag=-M
- depmode=gcc
-fi
-
-if test "$depmode" = dashXmstdout; then
- # This is just like dashmstdout with a different argument.
- dashmflag=-xM
- depmode=dashmstdout
-fi
-
-cygpath_u="cygpath -u -f -"
-if test "$depmode" = msvcmsys; then
- # This is just like msvisualcpp but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvisualcpp
-fi
-
-if test "$depmode" = msvc7msys; then
- # This is just like msvc7 but w/o cygpath translation.
- # Just convert the backslash-escaped backslashes to single forward
- # slashes to satisfy depend.m4
- cygpath_u='sed s,\\\\,/,g'
- depmode=msvc7
-fi
-
-if test "$depmode" = xlc; then
- # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
- gccflag=-qmakedep=gcc,-MF
- depmode=gcc
-fi
-
-case "$depmode" in
-gcc3)
-## gcc 3 implements dependency tracking that does exactly what
-## we want. Yay! Note: for some reason libtool 1.4 doesn't like
-## it if -MD -MP comes after the -MF stuff. Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am. Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
- for arg
- do
- case $arg in
- -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
- *) set fnord "$@" "$arg" ;;
- esac
- shift # fnord
- shift # $arg
- done
- "$@"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- mv "$tmpdepfile" "$depfile"
- ;;
-
-gcc)
-## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
-## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
-## (see the conditional assignment to $gccflag above).
-## There are various ways to get dependency output from gcc. Here's
-## why we pick this rather obscure method:
-## - Don't want to use -MD because we'd like the dependencies to end
-## up in a subdir. Having to rename by hand is ugly.
-## (We might end up doing this anyway to support other compilers.)
-## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
-## -MM, not -M (despite what the docs say). Also, it might not be
-## supported by the other compilers which use the 'gcc' depmode.
-## - Using -M directly means running the compiler twice (even worse
-## than renaming).
- if test -z "$gccflag"; then
- gccflag=-MD,
- fi
- "$@" -Wp,"$gccflag$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The second -e expression handles DOS-style file names with drive
- # letters.
- sed -e 's/^[^:]*: / /' \
- -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
-## This next piece of magic avoids the "deleted header file" problem.
-## The problem is that when a header file which appears in a .P file
-## is deleted, the dependency causes make to die (because there is
-## typically no way to rebuild the header). We avoid this by adding
-## dummy dependencies for each header file. Too bad gcc doesn't do
-## this for us directly.
-## Some versions of gcc put a space before the ':'. On the theory
-## that the space means something, we add a space to the output as
-## well. hp depmode also adds that space, but also prefixes the VPATH
-## to the object. Take care to not repeat it in the output.
-## Some versions of the HPUX 10.20 sed can't process this invocation
-## correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-sgi)
- if test "$libtool" = yes; then
- "$@" "-Wp,-MDupdate,$tmpdepfile"
- else
- "$@" -MDupdate "$tmpdepfile"
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
-
- if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
- echo "$object : \\" > "$depfile"
- # Clip off the initial element (the dependent). Don't try to be
- # clever and replace this with sed code, as IRIX sed won't handle
- # lines with more than a fixed number of characters (4096 in
- # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
- # the IRIX cc adds comments like '#:fec' to the end of the
- # dependency line.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
- | tr "$nl" ' ' >> "$depfile"
- echo >> "$depfile"
- # The second pass generates a dummy entry for each header file.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
- >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile"
- ;;
-
-xlc)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-aix)
- # The C for AIX Compiler uses -M and outputs the dependencies
- # in a .u file. In older versions, this file always lives in the
- # current directory. Also, the AIX compiler puts '$object:' at the
- # start of each line; $object doesn't have directory information.
- # Version 6 uses the directory in both cases.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$base.u
- tmpdepfile3=$dir.libs/$base.u
- "$@" -Wc,-M
- else
- tmpdepfile1=$dir$base.u
- tmpdepfile2=$dir$base.u
- tmpdepfile3=$dir$base.u
- "$@" -M
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- aix_post_process_depfile
- ;;
-
-tcc)
- # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
- # FIXME: That version still under development at the moment of writing.
- # Make that this statement remains true also for stable, released
- # versions.
- # It will wrap lines (doesn't matter whether long or short) with a
- # trailing '\', as in:
- #
- # foo.o : \
- # foo.c \
- # foo.h \
- #
- # It will put a trailing '\' even on the last line, and will use leading
- # spaces rather than leading tabs (at least since its commit 0394caf7
- # "Emit spaces for -MD").
- "$@" -MD -MF "$tmpdepfile"
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
- # We have to change lines of the first kind to '$object: \'.
- sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
- # And for each line of the second kind, we have to emit a 'dep.h:'
- # dummy dependency, to avoid the deleted-header problem.
- sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-## The order of this option in the case statement is important, since the
-## shell code in configure will try each of these formats in the order
-## listed in this file. A plain '-MD' option would be understood by many
-## compilers, so we must ensure this comes after the gcc and icc options.
-pgcc)
- # Portland's C compiler understands '-MD'.
- # Will always output deps to 'file.d' where file is the root name of the
- # source file under compilation, even if file resides in a subdirectory.
- # The object file name does not affect the name of the '.d' file.
- # pgcc 10.2 will output
- # foo.o: sub/foo.c sub/foo.h
- # and will wrap long lines using '\' :
- # foo.o: sub/foo.c ... \
- # sub/foo.h ... \
- # ...
- set_dir_from "$object"
- # Use the source, not the object, to determine the base name, since
- # that's sadly what pgcc will do too.
- set_base_from "$source"
- tmpdepfile=$base.d
-
- # For projects that build the same source file twice into different object
- # files, the pgcc approach of using the *source* file root name can cause
- # problems in parallel builds. Use a locking strategy to avoid stomping on
- # the same $tmpdepfile.
- lockdir=$base.d-lock
- trap "
- echo '$0: caught signal, cleaning up...' >&2
- rmdir '$lockdir'
- exit 1
- " 1 2 13 15
- numtries=100
- i=$numtries
- while test $i -gt 0; do
- # mkdir is a portable test-and-set.
- if mkdir "$lockdir" 2>/dev/null; then
- # This process acquired the lock.
- "$@" -MD
- stat=$?
- # Release the lock.
- rmdir "$lockdir"
- break
- else
- # If the lock is being held by a different process, wait
- # until the winning process is done or we timeout.
- while test -d "$lockdir" && test $i -gt 0; do
- sleep 1
- i=`expr $i - 1`
- done
- fi
- i=`expr $i - 1`
- done
- trap - 1 2 13 15
- if test $i -le 0; then
- echo "$0: failed to acquire lock after $numtries attempts" >&2
- echo "$0: check lockdir '$lockdir'" >&2
- exit 1
- fi
-
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- # Each line is of the form `foo.o: dependent.h',
- # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
- # Do two passes, one to just change these to
- # `$object: dependent.h' and one to simply `dependent.h:'.
- sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-hp2)
- # The "hp" stanza above does not work with aCC (C++) and HP's ia64
- # compilers, which have integrated preprocessors. The correct option
- # to use with these is +Maked; it writes dependencies to a file named
- # 'foo.d', which lands next to the object file, wherever that
- # happens to be.
- # Much of this is similar to the tru64 case; see comments there.
- set_dir_from "$object"
- set_base_from "$object"
- if test "$libtool" = yes; then
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir.libs/$base.d
- "$@" -Wc,+Maked
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- "$@" +Maked
- fi
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
- do
- test -f "$tmpdepfile" && break
- done
- if test -f "$tmpdepfile"; then
- sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
- # Add 'dependent.h:' lines.
- sed -ne '2,${
- s/^ *//
- s/ \\*$//
- s/$/:/
- p
- }' "$tmpdepfile" >> "$depfile"
- else
- make_dummy_depfile
- fi
- rm -f "$tmpdepfile" "$tmpdepfile2"
- ;;
-
-tru64)
- # The Tru64 compiler uses -MD to generate dependencies as a side
- # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
- # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
- # dependencies in 'foo.d' instead, so we check for that too.
- # Subdirectories are respected.
- set_dir_from "$object"
- set_base_from "$object"
-
- if test "$libtool" = yes; then
- # Libtool generates 2 separate objects for the 2 libraries. These
- # two compilations output dependencies in $dir.libs/$base.o.d and
- # in $dir$base.o.d. We have to check for both files, because
- # one of the two compilations can be disabled. We should prefer
- # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
- # automatically cleaned when .libs/ is deleted, while ignoring
- # the former would cause a distcleancheck panic.
- tmpdepfile1=$dir$base.o.d # libtool 1.5
- tmpdepfile2=$dir.libs/$base.o.d # Likewise.
- tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
- "$@" -Wc,-MD
- else
- tmpdepfile1=$dir$base.d
- tmpdepfile2=$dir$base.d
- tmpdepfile3=$dir$base.d
- "$@" -MD
- fi
-
- stat=$?
- if test $stat -ne 0; then
- rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- exit $stat
- fi
-
- for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
- do
- test -f "$tmpdepfile" && break
- done
- # Same post-processing that is required for AIX mode.
- aix_post_process_depfile
- ;;
-
-msvc7)
- if test "$libtool" = yes; then
- showIncludes=-Wc,-showIncludes
- else
- showIncludes=-showIncludes
- fi
- "$@" $showIncludes > "$tmpdepfile"
- stat=$?
- grep -v '^Note: including file: ' "$tmpdepfile"
- if test $stat -ne 0; then
- rm -f "$tmpdepfile"
- exit $stat
- fi
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- # The first sed program below extracts the file names and escapes
- # backslashes for cygpath. The second sed program outputs the file
- # name when reading, but also accumulates all include files in the
- # hold buffer in order to output them again at the end. This only
- # works with sed implementations that can handle large buffers.
- sed < "$tmpdepfile" -n '
-/^Note: including file: *\(.*\)/ {
- s//\1/
- s/\\/\\\\/g
- p
-}' | $cygpath_u | sort -u | sed -n '
-s/ /\\ /g
-s/\(.*\)/'"$tab"'\1 \\/p
-s/.\(.*\) \\/\1:/
-H
-$ {
- s/.*/'"$tab"'/
- G
- p
-}' >> "$depfile"
- echo >> "$depfile" # make sure the fragment doesn't end with a backslash
- rm -f "$tmpdepfile"
- ;;
-
-msvc7msys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-#nosideeffect)
- # This comment above is used by automake to tell side-effect
- # dependency tracking mechanisms from slower ones.
-
-dashmstdout)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout, regardless of -o.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- test -z "$dashmflag" && dashmflag=-M
- # Require at least two characters before searching for ':'
- # in the target name. This is to cope with DOS-style filenames:
- # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
- "$@" $dashmflag |
- sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
- rm -f "$depfile"
- cat < "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process this sed invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- tr ' ' "$nl" < "$tmpdepfile" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-dashXmstdout)
- # This case only exists to satisfy depend.m4. It is never actually
- # run, as this mode is specially recognized in the preamble.
- exit 1
- ;;
-
-makedepend)
- "$@" || exit $?
- # Remove any Libtool call
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
- # X makedepend
- shift
- cleared=no eat=no
- for arg
- do
- case $cleared in
- no)
- set ""; shift
- cleared=yes ;;
- esac
- if test $eat = yes; then
- eat=no
- continue
- fi
- case "$arg" in
- -D*|-I*)
- set fnord "$@" "$arg"; shift ;;
- # Strip any option that makedepend may not understand. Remove
- # the object too, otherwise makedepend will parse it as a source file.
- -arch)
- eat=yes ;;
- -*|$object)
- ;;
- *)
- set fnord "$@" "$arg"; shift ;;
- esac
- done
- obj_suffix=`echo "$object" | sed 's/^.*\././'`
- touch "$tmpdepfile"
- ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
- rm -f "$depfile"
- # makedepend may prepend the VPATH from the source file name to the object.
- # No need to regex-escape $object, excess matching of '.' is harmless.
- sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
- # Some versions of the HPUX 10.20 sed can't process the last invocation
- # correctly. Breaking it into two sed invocations is a workaround.
- sed '1,2d' "$tmpdepfile" \
- | tr ' ' "$nl" \
- | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
- | sed -e 's/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile" "$tmpdepfile".bak
- ;;
-
-cpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- # Remove '-o $object'.
- IFS=" "
- for arg
- do
- case $arg in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift # fnord
- shift # $arg
- ;;
- esac
- done
-
- "$@" -E \
- | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
- | sed '$ s: \\$::' > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- cat < "$tmpdepfile" >> "$depfile"
- sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvisualcpp)
- # Important note: in order to support this mode, a compiler *must*
- # always write the preprocessed file to stdout.
- "$@" || exit $?
-
- # Remove the call to Libtool.
- if test "$libtool" = yes; then
- while test "X$1" != 'X--mode=compile'; do
- shift
- done
- shift
- fi
-
- IFS=" "
- for arg
- do
- case "$arg" in
- -o)
- shift
- ;;
- $object)
- shift
- ;;
- "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
- set fnord "$@"
- shift
- shift
- ;;
- *)
- set fnord "$@" "$arg"
- shift
- shift
- ;;
- esac
- done
- "$@" -E 2>/dev/null |
- sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
- rm -f "$depfile"
- echo "$object : \\" > "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
- echo "$tab" >> "$depfile"
- sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
- rm -f "$tmpdepfile"
- ;;
-
-msvcmsys)
- # This case exists only to let depend.m4 do its work. It works by
- # looking at the text of this script. This case will never be run,
- # since it is checked for above.
- exit 1
- ;;
-
-none)
- exec "$@"
- ;;
-
-*)
- echo "Unknown depmode $depmode" 1>&2
- exit 1
- ;;
-esac
-
-exit 0
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/autotools/install-sh b/toolkit/crashreporter/google-breakpad/autotools/install-sh
deleted file mode 100755
index 0b0fdcbba6..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/install-sh
+++ /dev/null
@@ -1,501 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2013-12-25.23; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# 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
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# 'make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-tab=' '
-nl='
-'
-IFS=" $tab$nl"
-
-# Set DOITPROG to "echo" to test this script.
-
-doit=${DOITPROG-}
-doit_exec=${doit:-exec}
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-is_target_a_directory=possibly
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
- or: $0 [OPTION]... SRCFILES... DIRECTORY
- or: $0 [OPTION]... -t DIRECTORY SRCFILES...
- or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
- --help display this help and exit.
- --version display version info and exit.
-
- -c (ignored)
- -C install only if different (preserve the last data modification time)
- -d create directories instead of installing files.
- -g GROUP $chgrpprog installed files to GROUP.
- -m MODE $chmodprog installed files to MODE.
- -o USER $chownprog installed files to USER.
- -s $stripprog installed files.
- -t DIRECTORY install into DIRECTORY.
- -T report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
- CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
- RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
- case $1 in
- -c) ;;
-
- -C) copy_on_change=true;;
-
- -d) dir_arg=true;;
-
- -g) chgrpcmd="$chgrpprog $2"
- shift;;
-
- --help) echo "$usage"; exit $?;;
-
- -m) mode=$2
- case $mode in
- *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
-
- -o) chowncmd="$chownprog $2"
- shift;;
-
- -s) stripcmd=$stripprog;;
-
- -t)
- is_target_a_directory=always
- dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
-
- -T) is_target_a_directory=never;;
-
- --version) echo "$0 $scriptversion"; exit $?;;
-
- --) shift
- break;;
-
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
-
- *) break;;
- esac
- shift
-done
-
-# We allow the use of options -d and -T together, by making -d
-# take the precedence; this is for compatibility with GNU install.
-
-if test -n "$dir_arg"; then
- if test -n "$dst_arg"; then
- echo "$0: target directory not allowed when installing a directory." >&2
- exit 1
- fi
-fi
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
- # When -d is used, all remaining arguments are directories to create.
- # When -t is used, the destination is already specified.
- # Otherwise, the last argument is the destination. Remove it from $@.
- for arg
- do
- if test -n "$dst_arg"; then
- # $@ is not empty: it contains at least $arg.
- set fnord "$@" "$dst_arg"
- shift # fnord
- fi
- shift # arg
- dst_arg=$arg
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- done
-fi
-
-if test $# -eq 0; then
- if test -z "$dir_arg"; then
- echo "$0: no input file specified." >&2
- exit 1
- fi
- # It's OK to call 'install-sh -d' without argument.
- # This can happen when creating conditional directories.
- exit 0
-fi
-
-if test -z "$dir_arg"; then
- if test $# -gt 1 || test "$is_target_a_directory" = always; then
- if test ! -d "$dst_arg"; then
- echo "$0: $dst_arg: Is not a directory." >&2
- exit 1
- fi
- fi
-fi
-
-if test -z "$dir_arg"; then
- do_exit='(exit $ret); exit $ret'
- trap "ret=129; $do_exit" 1
- trap "ret=130; $do_exit" 2
- trap "ret=141; $do_exit" 13
- trap "ret=143; $do_exit" 15
-
- # Set umask so as not to create temps with too-generous modes.
- # However, 'strip' requires both read and write access to temps.
- case $mode in
- # Optimize common cases.
- *644) cp_umask=133;;
- *755) cp_umask=22;;
-
- *[0-7])
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw='% 200'
- fi
- cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
- *)
- if test -z "$stripcmd"; then
- u_plus_rw=
- else
- u_plus_rw=,u+rw
- fi
- cp_umask=$mode$u_plus_rw;;
- esac
-fi
-
-for src
-do
- # Protect names problematic for 'test' and other utilities.
- case $src in
- -* | [=\(\)!]) src=./$src;;
- esac
-
- if test -n "$dir_arg"; then
- dst=$src
- dstdir=$dst
- test -d "$dstdir"
- dstdir_status=$?
- else
-
- # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
-
- if test -z "$dst_arg"; then
- echo "$0: no destination specified." >&2
- exit 1
- fi
- dst=$dst_arg
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- if test "$is_target_a_directory" = never; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
- fi
- dstdir=$dst
- dst=$dstdir/`basename "$src"`
- dstdir_status=0
- else
- dstdir=`dirname "$dst"`
- test -d "$dstdir"
- dstdir_status=$?
- fi
- fi
-
- obsolete_mkdir_used=false
-
- if test $dstdir_status != 0; then
- case $posix_mkdir in
- '')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
- else
- mkdir_mode=
- fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
- esac
-
- if
- $posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
- )
- then :
- else
-
- # The umask is ridiculous, or mkdir does not conform to POSIX,
- # or it failed possibly due to a race condition. Create the
- # directory the slow way, step by step, checking for races as we go.
-
- case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
- esac
-
- oIFS=$IFS
- IFS=/
- set -f
- set fnord $dstdir
- shift
- set +f
- IFS=$oIFS
-
- prefixes=
-
- for d
- do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
- done
-
- if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
- fi
- fi
- fi
-
- if test -n "$dir_arg"; then
- { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
- { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
- test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
- else
-
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
-
- # Trap to clean up those temp files at exit.
- trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
- # Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $cpprog $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
- { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
- { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
- { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
- # If -C, don't bother to copy if it wouldn't change the file.
- if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
- set -f &&
- set X $old && old=:$2:$4:$5:$6 &&
- set X $new && new=:$2:$4:$5:$6 &&
- set +f &&
- test "$old" = "$new" &&
- $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
- then
- rm -f "$dsttmp"
- else
- # Rename the file to the real destination.
- $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
- # The rename failed, perhaps because mv can't rename something else
- # to itself, or perhaps because mv is so ancient that it does not
- # support -f.
- {
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
- }
- fi || exit 1
-
- trap '' 0
- fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/autotools/ltmain.sh b/toolkit/crashreporter/google-breakpad/autotools/ltmain.sh
deleted file mode 100755
index a72f2fd78b..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/ltmain.sh
+++ /dev/null
@@ -1,8406 +0,0 @@
-# Generated from ltmain.m4sh.
-
-# ltmain.sh (GNU libtool) 2.2.6b
-# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions. There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# GNU Libtool is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print informational messages (default)
-# --version print version information
-# -h, --help print short or long help message
-#
-# MODE must be one of the following:
-#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.2.6b
-# automake: $automake_version
-# autoconf: $autoconf_version
-#
-# Report bugs to <bug-libtool@gnu.org>.
-
-PROGRAM=ltmain.sh
-PACKAGE=libtool
-VERSION=2.2.6b
-TIMESTAMP=""
-package_revision=1.3017
-
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# NLS nuisances: We save the old values to restore during execute mode.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
- fi"
-done
-
-$lt_unset CDPATH
-
-
-
-
-
-: ${CP="cp -f"}
-: ${ECHO="echo"}
-: ${EGREP="/bin/grep -E"}
-: ${FGREP="/bin/grep -F"}
-: ${GREP="/bin/grep"}
-: ${LN_S="ln -s"}
-: ${MAKE="make"}
-: ${MKDIR="mkdir"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-: ${SED="/bin/sed"}
-: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-
-exit_status=$EXIT_SUCCESS
-
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
-
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-# Generated shell functions inserted here.
-
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
-
-# The name of this program:
-# In the unlikely event $progname began with a '-', it would play havoc with
-# func_echo (imagine progname=-n), so we prepend ./ in that case:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-case $progname in
- -*) progname=./$progname ;;
-esac
-
-# Make sure we have an absolute path for reexecution:
-case $progpath in
- [\\/]*|[A-Za-z]:\\*) ;;
- *[\\/]*)
- progdir=$func_dirname_result
- progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
- ;;
- *)
- save_IFS="$IFS"
- IFS=:
- for progdir in $PATH; do
- IFS="$save_IFS"
- test -x "$progdir/$progname" && break
- done
- IFS="$save_IFS"
- test -n "$progdir" || progdir=`pwd`
- progpath="$progdir/$progname"
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
-
-# Standard options:
-opt_dry_run=false
-opt_help=false
-opt_quiet=false
-opt_verbose=false
-opt_warning=:
-
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
-{
- $ECHO "$progname${mode+: }$mode: $*"
-}
-
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
-{
- $opt_verbose && func_echo ${1+"$@"}
-
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
-}
-
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
-{
- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
-}
-
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
-{
- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
-
- # bash bug again:
- :
-}
-
-# func_fatal_error arg...
-# Echo program name prefixed message to standard error, and exit.
-func_fatal_error ()
-{
- func_error ${1+"$@"}
- exit $EXIT_FAILURE
-}
-
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information." ## default
-
-
-# func_grep expression filename
-# Check whether EXPRESSION matches any line of FILENAME, without output.
-func_grep ()
-{
- $GREP "$1" "$2" >/dev/null 2>&1
-}
-
-
-# func_mkdir_p directory-path
-# Make sure the entire path to DIRECTORY-PATH is available.
-func_mkdir_p ()
-{
- my_directory_path="$1"
- my_dir_list=
-
- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
-
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path="./$my_directory_path" ;;
- esac
-
- # While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
- # ...make a list in topmost first order. Use a colon delimited
- # list incase some portion of path contains whitespace.
- my_dir_list="$my_directory_path:$my_dir_list"
-
- # If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
-
- # ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"`
- done
- my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'`
-
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- IFS="$save_mkdir_p_IFS"
- # mkdir can fail with a `File exist' error if two processes
- # try to create one of the directories concurrently. Don't
- # stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
- done
- IFS="$save_mkdir_p_IFS"
-
- # Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
- fi
-}
-
-
-# func_mktempdir [string]
-# Make a temporary directory that won't clash with other running
-# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
-func_mktempdir ()
-{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
-
- if test "$opt_dry_run" = ":"; then
- # Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
- else
-
- # If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
-
- if test ! -d "$my_tmpdir"; then
- # Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
-
- save_mktempdir_umask=`umask`
- umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
- fi
-
- # If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
- fi
-
- $ECHO "X$my_tmpdir" | $Xsed
-}
-
-
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
-{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
-
- case $func_quote_for_eval_unquoted_result in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and and variable
- # expansion for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
- ;;
- *)
- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
- esac
-}
-
-
-# func_quote_for_expand arg
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
- case $1 in
- *[\\\`\"]*)
- my_arg=`$ECHO "X$1" | $Xsed \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
- *)
- my_arg="$1" ;;
- esac
-
- case $my_arg in
- # Double-quote args containing shell metacharacters to delay
- # word splitting and command substitution for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
- ;;
- esac
-
- func_quote_for_expand_result="$my_arg"
-}
-
-
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it.
-func_show_eval ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
-# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
-# is given, then evaluate it. Use the saved locale for evaluation.
-func_show_eval_locale ()
-{
- my_cmd="$1"
- my_fail_exp="${2-:}"
-
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
-
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
- fi
- fi
-}
-
-
-
-
-
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
-{
- $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
-}
-
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
-{
- $SED -n '/^# Usage:/,/# -h/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- $ECHO
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
-}
-
-# func_help
-# Echo long help message to standard output and exit.
-func_help ()
-{
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
- p
- }' < "$progpath"
- exit $?
-}
-
-# func_missing_arg argname
-# Echo program name prefixed message to standard error and set global
-# exit_cmd.
-func_missing_arg ()
-{
- func_error "missing argument for $1"
- exit_cmd=exit
-}
-
-exit_cmd=:
-
-
-
-
-
-# Check that we have a working $ECHO.
-if test "X$1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X$1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
- # Yippee, $ECHO works!
- :
-else
- # Restart under the correct shell, and then maybe $ECHO will work.
- exec $SHELL "$progpath" --no-reexec ${1+"$@"}
-fi
-
-if test "X$1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit $EXIT_SUCCESS
-fi
-
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
-
-# Global variables.
-# $mode is unset
-nonopt=
-execute_dlfiles=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
-
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
-
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-
-# func_fatal_configuration arg...
-# Echo program name prefixed message to standard error, followed by
-# a configuration failure hint, and exit.
-func_fatal_configuration ()
-{
- func_error ${1+"$@"}
- func_error "See the $PACKAGE documentation for more information."
- func_fatal_error "Fatal configuration error."
-}
-
-
-# func_config
-# Display the configuration for all the tags in this script.
-func_config ()
-{
- re_begincf='^# ### BEGIN LIBTOOL'
- re_endcf='^# ### END LIBTOOL'
-
- # Default configuration.
- $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
-
- # Now print the configurations for the tags.
- for tagname in $taglist; do
- $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
- done
-
- exit $?
-}
-
-# func_features
-# Display the features supported by this script.
-func_features ()
-{
- $ECHO "host: $host"
- if test "$build_libtool_libs" = yes; then
- $ECHO "enable shared libraries"
- else
- $ECHO "disable shared libraries"
- fi
- if test "$build_old_libs" = yes; then
- $ECHO "enable static libraries"
- else
- $ECHO "disable static libraries"
- fi
-
- exit $?
-}
-
-# func_enable_tag tagname
-# Verify that TAGNAME is valid, and either flag an error and exit, or
-# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
-# variable here.
-func_enable_tag ()
-{
- # Global variable:
- tagname="$1"
-
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf="/$re_begincf/,/$re_endcf/p"
-
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
-
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
- *)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
-
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
-}
-
-# Parse options once, thoroughly. This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
-{
-
- # Shorthand for --mode=foo, only valid as the first argument
- case $1 in
- clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
- compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
- execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
- finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
- install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
- link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
- esac
-
- # Parse non-mode specific arguments:
- while test "$#" -gt 0; do
- opt="$1"
- shift
-
- case $opt in
- --config) func_config ;;
-
- --debug) preserve_args="$preserve_args $opt"
- func_echo "enabling shell trace mode"
- opt_debug='set -x'
- $opt_debug
- ;;
-
- -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
- execute_dlfiles="$execute_dlfiles $1"
- shift
- ;;
-
- --dry-run | -n) opt_dry_run=: ;;
- --features) func_features ;;
- --finish) mode="finish" ;;
-
- --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
- case $1 in
- # Valid mode arguments:
- clean) ;;
- compile) ;;
- execute) ;;
- finish) ;;
- install) ;;
- link) ;;
- relink) ;;
- uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
- esac
-
- mode="$1"
- shift
- ;;
-
- --preserve-dup-deps)
- opt_duplicate_deps=: ;;
-
- --quiet|--silent) preserve_args="$preserve_args $opt"
- opt_silent=:
- ;;
-
- --verbose| -v) preserve_args="$preserve_args $opt"
- opt_silent=false
- ;;
-
- --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
- preserve_args="$preserve_args $opt $1"
- func_enable_tag "$1" # tagname is set here
- shift
- ;;
-
- # Separate optargs to long options:
- -dlopen=*|--mode=*|--tag=*)
- func_opt_split "$opt"
- set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
- shift
- ;;
-
- -\?|-h) func_usage ;;
- --help) opt_help=: ;;
- --version) func_version ;;
-
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
-
- *) nonopt="$opt"
- break
- ;;
- esac
- done
-
-
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
- ;;
- esac
-
- # Having warned about all mis-specified options, bail out if
- # anything was wrong.
- $exit_cmd $EXIT_FAILURE
-}
-
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
- fi
-
- exit $EXIT_MISMATCH
- fi
-}
-
-
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-$opt_help || {
- # Sanity checks first:
- func_check_version_match
-
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
-
- test -z "$mode" && func_fatal_error "error: you must specify a MODE."
-
-
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
-
-
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
-
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$mode' for more information."
-}
-
-
-# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_lalib_p ()
-{
- test -f "$1" &&
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
-}
-
-# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
-# This function implements the same check as func_lalib_p without
-# resorting to external programs. To this end, it redirects stdin and
-# closes it afterwards, without saving the original file descriptor.
-# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if `file' does not exist.
-func_lalib_unsafe_p ()
-{
- lalib_p=no
- if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
- for lalib_p_l in 1 2 3 4
- do
- read lalib_p_line
- case "$lalib_p_line" in
- \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
- esac
- done
- exec 0<&5 5<&-
- fi
- test "$lalib_p" = yes
-}
-
-# func_ltwrapper_script_p file
-# True iff FILE is a libtool wrapper script
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_script_p ()
-{
- func_lalib_p "$1"
-}
-
-# func_ltwrapper_executable_p file
-# True iff FILE is a libtool wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_executable_p ()
-{
- func_ltwrapper_exec_suffix=
- case $1 in
- *.exe) ;;
- *) func_ltwrapper_exec_suffix=.exe ;;
- esac
- $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
-}
-
-# func_ltwrapper_scriptname file
-# Assumes file is an ltwrapper_executable
-# uses $file to determine the appropriate filename for a
-# temporary ltwrapper_script.
-func_ltwrapper_scriptname ()
-{
- func_ltwrapper_scriptname_result=""
- if func_ltwrapper_executable_p "$1"; then
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- fi
-}
-
-# func_ltwrapper_p file
-# True iff FILE is a libtool wrapper script or wrapper executable
-# This function is only a basic sanity check; it will hardly flush out
-# determined imposters.
-func_ltwrapper_p ()
-{
- func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
-}
-
-
-# func_execute_cmds commands fail_cmd
-# Execute tilde-delimited COMMANDS.
-# If FAIL_CMD is given, eval that upon failure.
-# FAIL_CMD may read-access the current command in variable CMD!
-func_execute_cmds ()
-{
- $opt_debug
- save_ifs=$IFS; IFS='~'
- for cmd in $1; do
- IFS=$save_ifs
- eval cmd=\"$cmd\"
- func_show_eval "$cmd" "${2-:}"
- done
- IFS=$save_ifs
-}
-
-
-# func_source file
-# Source FILE, adding directory component if necessary.
-# Note that it is not necessary on cygwin/mingw to append a dot to
-# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
-# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
-func_source ()
-{
- $opt_debug
- case $1 in
- */* | *\\*) . "$1" ;;
- *) . "./$1" ;;
- esac
-}
-
-
-# func_infer_tag arg
-# Infer tagged configuration to use if any are available and
-# if one wasn't chosen via the "--tag" command line option.
-# Only attempt this if the compiler in the base compile
-# command doesn't match the default compiler.
-# arg is usually of the form 'gcc ...'
-func_infer_tag ()
-{
- $opt_debug
- if test -n "$available_tags" && test -z "$tagname"; then
- CC_quoted=
- for arg in $CC; do
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
- done
- case $@ in
- # Blanks in the command may have been stripped by the calling shell,
- # but not from the CC environment variable when configure was run.
- " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;;
- # Blanks at the start of $base_compile will cause this to fail
- # if we don't check for them as well.
- *)
- for z in $available_tags; do
- if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
- # Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
- CC_quoted=
- for arg in $CC; do
- # Double-quote args containing other shell metacharacters.
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
- done
- case "$@ " in
- " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*)
- # The compiler in the base compile command matches
- # the one in the tagged configuration.
- # Assume this is the tagged configuration we want.
- tagname=$z
- break
- ;;
- esac
- fi
- done
- # If $tagname still isn't set, then no tagged configuration
- # was found and let the user know that the "--tag" command
- # line option must be used.
- if test -z "$tagname"; then
- func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
-# else
-# func_verbose "using $tagname tagged configuration"
- fi
- ;;
- esac
- fi
-}
-
-
-
-# func_write_libtool_object output_name pic_name nonpic_name
-# Create a libtool object file (analogous to a ".la" file),
-# but don't create it if we're doing a dry run.
-func_write_libtool_object ()
-{
- write_libobj=${1}
- if test "$build_libtool_libs" = yes; then
- write_lobj=\'${2}\'
- else
- write_lobj=none
- fi
-
- if test "$build_old_libs" = yes; then
- write_oldobj=\'${3}\'
- else
- write_oldobj=none
- fi
-
- $opt_dry_run || {
- cat >${write_libobj}T <<EOF
-# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Name of the PIC object.
-pic_object=$write_lobj
-
-# Name of the non-PIC object
-non_pic_object=$write_oldobj
-
-EOF
- $MV "${write_libobj}T" "${write_libobj}"
- }
-}
-
-# func_mode_compile arg...
-func_mode_compile ()
-{
- $opt_debug
- # Get the compilation command and the source file.
- base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
- suppress_opt=yes
- suppress_output=
- arg_mode=normal
- libobj=
- later=
- pie_flag=
-
- for arg
- do
- case $arg_mode in
- arg )
- # do not "continue". Instead, add this to base_compile
- lastarg="$arg"
- arg_mode=normal
- ;;
-
- target )
- libobj="$arg"
- arg_mode=normal
- continue
- ;;
-
- normal )
- # Accept any command-line options.
- case $arg in
- -o)
- test -n "$libobj" && \
- func_fatal_error "you cannot specify \`-o' more than once"
- arg_mode=target
- continue
- ;;
-
- -pie | -fpie | -fPIE)
- pie_flag="$pie_flag $arg"
- continue
- ;;
-
- -shared | -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
- continue
- ;;
-
- -no-suppress)
- suppress_opt=no
- continue
- ;;
-
- -Xcompiler)
- arg_mode=arg # the next one goes into the "base_compile" arg list
- continue # The current "srcfile" will either be retained or
- ;; # replaced later. I would guess that would be a bug.
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- lastarg=
- save_ifs="$IFS"; IFS=','
- for arg in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$arg"
- lastarg="$lastarg $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$lastarg"
- lastarg=$func_stripname_result
-
- # Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
- continue
- ;;
-
- *)
- # Accept the current argument as the source file.
- # The previous "srcfile" becomes the current argument.
- #
- lastarg="$srcfile"
- srcfile="$arg"
- ;;
- esac # case $arg
- ;;
- esac # case $arg_mode
-
- # Aesthetically quote the previous argument.
- func_quote_for_eval "$lastarg"
- base_compile="$base_compile $func_quote_for_eval_result"
- done # for arg
-
- case $arg_mode in
- arg)
- func_fatal_error "you must specify an argument for -Xcompile"
- ;;
- target)
- func_fatal_error "you must specify a target with \`-o'"
- ;;
- *)
- # Get the name of the library object.
- test -z "$libobj" && {
- func_basename "$srcfile"
- libobj="$func_basename_result"
- }
- ;;
- esac
-
- # Recognize several different file suffixes.
- # If the user specifies -o file.o, it is replaced with file.lo
- case $libobj in
- *.[cCFSifmso] | \
- *.ada | *.adb | *.ads | *.asm | \
- *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.obj | *.sx)
- func_xform "$libobj"
- libobj=$func_xform_result
- ;;
- esac
-
- case $libobj in
- *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
- *)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
- ;;
- esac
-
- func_infer_tag $base_compile
-
- for arg in $later; do
- case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- continue
- ;;
-
- -static)
- build_libtool_libs=no
- build_old_libs=yes
- continue
- ;;
-
- -prefer-pic)
- pic_mode=yes
- continue
- ;;
-
- -prefer-non-pic)
- pic_mode=no
- continue
- ;;
- esac
- done
-
- func_quote_for_eval "$libobj"
- test "X$libobj" != "X$func_quote_for_eval_result" \
- && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name \`$libobj' may not contain shell special characters."
- func_dirname_and_basename "$obj" "/" ""
- objname="$func_basename_result"
- xdir="$func_dirname_result"
- lobj=${xdir}$objdir/$objname
-
- test -z "$base_compile" && \
- func_fatal_help "you must specify a compilation command"
-
- # Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
- removelist="$obj $lobj $libobj ${libobj}T"
- else
- removelist="$lobj $libobj ${libobj}T"
- fi
-
- # On Cygwin there's no "real" PIC flag so we must build both object types
- case $host_os in
- cygwin* | mingw* | pw32* | os2* | cegcc*)
- pic_mode=default
- ;;
- esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
- # non-PIC code in shared libraries is not supported
- pic_mode=default
- fi
-
- # Calculate the filename of the output object if compiler does
- # not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
- else
- output_obj=
- need_locks=no
- lockfile=
- fi
-
- # Lock this critical section if it is needed
- # We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
- until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
- func_echo "Waiting for $lockfile to be removed"
- sleep 2
- done
- elif test "$need_locks" = warn; then
- if test -f "$lockfile"; then
- $ECHO "\
-*** ERROR, $lockfile exists and contains:
-`cat $lockfile 2>/dev/null`
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
- removelist="$removelist $output_obj"
- $ECHO "$srcfile" > "$lockfile"
- fi
-
- $opt_dry_run || $RM $removelist
- removelist="$removelist $lockfile"
- trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
-
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
- func_quote_for_eval "$srcfile"
- qsrcfile=$func_quote_for_eval_result
-
- # Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
- # Without this assignment, base_compile gets emptied.
- fbsd_hideous_sh_bug=$base_compile
-
- if test "$pic_mode" != no; then
- command="$base_compile $qsrcfile $pic_flag"
- else
- # Don't build PIC code
- command="$base_compile $qsrcfile"
- fi
-
- func_mkdir_p "$xdir$objdir"
-
- if test -z "$output_obj"; then
- # Place PIC objects in $objdir
- command="$command -o $lobj"
- fi
-
- func_show_eval_locale "$command" \
- 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed, then go on to compile the next one
- if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
- func_show_eval '$MV "$output_obj" "$lobj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
-
- # Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
- suppress_output=' >/dev/null 2>&1'
- fi
- fi
-
- # Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
- # Don't build PIC code
- command="$base_compile $qsrcfile$pie_flag"
- else
- command="$base_compile $qsrcfile $pic_flag"
- fi
- if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
- fi
-
- # Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
- func_show_eval_locale "$command" \
- '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
-
- if test "$need_locks" = warn &&
- test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
- $ECHO "\
-*** ERROR, $lockfile contains:
-`cat $lockfile 2>/dev/null`
-
-but it should contain:
-$srcfile
-
-This indicates that another process is trying to use the same
-temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
-repeat this compilation, it may succeed, by chance, but you had better
-avoid parallel builds (make -j) in this platform, or get a better
-compiler."
-
- $opt_dry_run || $RM $removelist
- exit $EXIT_FAILURE
- fi
-
- # Just move the object if needed
- if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
- func_show_eval '$MV "$output_obj" "$obj"' \
- 'error=$?; $opt_dry_run || $RM $removelist; exit $error'
- fi
- fi
-
- $opt_dry_run || {
- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then
- removelist=$lockfile
- $RM "$lockfile"
- fi
- }
-
- exit $EXIT_SUCCESS
-}
-
-$opt_help || {
-test "$mode" = compile && func_mode_compile ${1+"$@"}
-}
-
-func_mode_help ()
-{
- # We need to display help for each of the modes.
- case $mode in
- "")
- # Generic help is extracted from the usage comments
- # at the start of this file.
- func_help
- ;;
-
- clean)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
-
-Remove files from the build directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, object or program, all the files associated
-with it are deleted. Otherwise, only FILE itself is deleted using RM."
- ;;
-
- compile)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
-
-Compile a source file into a libtool library object.
-
-This mode accepts the following additional options:
-
- -o OUTPUT-FILE set the output file name to OUTPUT-FILE
- -no-suppress do not suppress compiler output for multiple passes
- -prefer-pic try to building PIC objects only
- -prefer-non-pic try to building non-PIC objects only
- -shared do not build a \`.o' file suitable for static linking
- -static only build a \`.o' file suitable for static linking
-
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
-from the given SOURCEFILE.
-
-The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
- ;;
-
- execute)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
-
-Automatically set library path, then run a program.
-
-This mode accepts the following additional options:
-
- -dlopen FILE add the directory containing FILE to the library path
-
-This mode sets the library path environment variable according to \`-dlopen'
-flags.
-
-If any of the ARGS are libtool executable wrappers, then they are translated
-into their corresponding uninstalled binary, and any of their required library
-directories are added to the library path.
-
-Then, COMMAND is executed, with ARGS as arguments."
- ;;
-
- finish)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
-
-Complete the installation of libtool libraries.
-
-Each LIBDIR is a directory that contains libtool libraries.
-
-The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
- ;;
-
- install)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
-
-Install executables or libraries.
-
-INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
-
-The following components of INSTALL-COMMAND are treated specially:
-
- -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation
-
-The rest of the components are interpreted as arguments to that command (only
-BSD-compatible install options are recognized)."
- ;;
-
- link)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
-
-Link object files or libraries together to form another library, or to
-create an executable program.
-
-LINK-COMMAND is a command using the C compiler that you would use to create
-a program from several object files.
-
-The following components of LINK-COMMAND are treated specially:
-
- -all-static do not do any dynamic linking at all
- -avoid-version do not add a version suffix if possible
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
- -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
- -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
- -export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
- -export-symbols-regex REGEX
- try to export only the symbols matching REGEX
- -LLIBDIR search LIBDIR for required installed libraries
- -lNAME OUTPUT-FILE requires the installed library libNAME
- -module build a library that can dlopened
- -no-fast-install disable the fast-install mode
- -no-install link a not-installable executable
- -no-undefined declare that a library does not refer to external symbols
- -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
- -precious-files-regex REGEX
- don't remove output files matching REGEX
- -release RELEASE specify package release information
- -rpath LIBDIR the created library will eventually be installed in LIBDIR
- -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -shared only do dynamic linking of libtool libraries
- -shrext SUFFIX override the standard shared library file extension
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
- -version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
- -weak LIBNAME declare that the target provides the LIBNAME interface
-
-All other options (arguments beginning with \`-') are ignored.
-
-Every other argument is treated as a filename. Files ending in \`.la' are
-treated as uninstalled libtool libraries, other files are standard or library
-object files.
-
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
-required, except when creating a convenience library.
-
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
-
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
-is created, otherwise an executable program is created."
- ;;
-
- uninstall)
- $ECHO \
-"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
-
-Remove libraries from an installation directory.
-
-RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
-to RM.
-
-If FILE is a libtool library, all the files associated with it are deleted.
-Otherwise, only FILE itself is deleted using RM."
- ;;
-
- *)
- func_fatal_help "invalid operation mode \`$mode'"
- ;;
- esac
-
- $ECHO
- $ECHO "Try \`$progname --help' for more information about other modes."
-
- exit $?
-}
-
- # Now that we've collected a possible --mode arg, show help if necessary
- $opt_help && func_mode_help
-
-
-# func_mode_execute arg...
-func_mode_execute ()
-{
- $opt_debug
- # The first argument is the command name.
- cmd="$nonopt"
- test -z "$cmd" && \
- func_fatal_help "you must specify a COMMAND"
-
- # Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
- test -f "$file" \
- || func_fatal_help "\`$file' is not a file"
-
- dir=
- case $file in
- *.la)
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$lib' is not a valid libtool archive"
-
- # Read the libtool library.
- dlname=
- library_names=
- func_source "$file"
-
- # Skip this library if it cannot be dlopened.
- if test -z "$dlname"; then
- # Warn if it was a shared library.
- test -n "$library_names" && \
- func_warning "\`$file' was not linked with \`-export-dynamic'"
- continue
- fi
-
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
-
- if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
- else
- if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
- fi
- fi
- ;;
-
- *.lo)
- # Just add the directory containing the .lo file.
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- ;;
-
- *)
- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
- continue
- ;;
- esac
-
- # Get the absolute pathname.
- absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
-
- # Now add the directory to shlibpath_var.
- if eval "test -z \"\$$shlibpath_var\""; then
- eval "$shlibpath_var=\"\$dir\""
- else
- eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
- fi
- done
-
- # This variable tells wrapper scripts just to set shlibpath_var
- # rather than running their programs.
- libtool_execute_magic="$magic"
-
- # Check if any of the arguments is a wrapper script.
- args=
- for file
- do
- case $file in
- -*) ;;
- *)
- # Do a test to see if this is really a libtool program.
- if func_ltwrapper_script_p "$file"; then
- func_source "$file"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- elif func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- func_source "$func_ltwrapper_scriptname_result"
- # Transform arg to wrapped name.
- file="$progdir/$program"
- fi
- ;;
- esac
- # Quote arguments (to preserve shell metacharacters).
- func_quote_for_eval "$file"
- args="$args $func_quote_for_eval_result"
- done
-
- if test "X$opt_dry_run" = Xfalse; then
- if test -n "$shlibpath_var"; then
- # Export the shlibpath_var.
- eval "export $shlibpath_var"
- fi
-
- # Restore saved environment variables
- for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- else
- $lt_unset $lt_var
- fi"
- done
-
- # Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- $ECHO "export $shlibpath_var"
- fi
- $ECHO "$cmd$args"
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$mode" = execute && func_mode_execute ${1+"$@"}
-
-
-# func_mode_finish arg...
-func_mode_finish ()
-{
- $opt_debug
- libdirs="$nonopt"
- admincmds=
-
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
-
- for libdir in $libdirs; do
- if test -n "$finish_cmds"; then
- # Do each command in the finish commands.
- func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
-'"$cmd"'"'
- fi
- if test -n "$finish_eval"; then
- # Do the single finish_eval.
- eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || admincmds="$admincmds
- $cmds"
- fi
- done
- fi
-
- # Exit here if they wanted silent mode.
- $opt_silent && exit $EXIT_SUCCESS
-
- $ECHO "X----------------------------------------------------------------------" | $Xsed
- $ECHO "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- $ECHO
- $ECHO "If you ever happen to want to link against installed libraries"
- $ECHO "in a given directory, LIBDIR, you must either use libtool, and"
- $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'"
- $ECHO "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable"
- $ECHO " during execution"
- fi
- if test -n "$runpath_var"; then
- $ECHO " - add LIBDIR to the \`$runpath_var' environment variable"
- $ECHO " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
-
- $ECHO " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- $ECHO
-
- $ECHO "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- $ECHO "pages."
- ;;
- *)
- $ECHO "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- $ECHO "X----------------------------------------------------------------------" | $Xsed
- exit $EXIT_SUCCESS
-}
-
-test "$mode" = finish && func_mode_finish ${1+"$@"}
-
-
-# func_mode_install arg...
-func_mode_install ()
-{
- $opt_debug
- # There may be an optional sh(1) argument at the beginning of
- # install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
- # Allow the use of GNU shtool's install command.
- $ECHO "X$nonopt" | $GREP shtool >/dev/null; then
- # Aesthetically quote it.
- func_quote_for_eval "$nonopt"
- install_prog="$func_quote_for_eval_result "
- arg=$1
- shift
- else
- install_prog=
- arg=$nonopt
- fi
-
- # The real first argument should be the name of the installation program.
- # Aesthetically quote it.
- func_quote_for_eval "$arg"
- install_prog="$install_prog$func_quote_for_eval_result"
-
- # We need to accept at least all the BSD install flags.
- dest=
- files=
- opts=
- prev=
- install_type=
- isdir=no
- stripme=
- for arg
- do
- if test -n "$dest"; then
- files="$files $dest"
- dest=$arg
- continue
- fi
-
- case $arg in
- -d) isdir=yes ;;
- -f)
- case " $install_prog " in
- *[\\\ /]cp\ *) ;;
- *) prev=$arg ;;
- esac
- ;;
- -g | -m | -o)
- prev=$arg
- ;;
- -s)
- stripme=" -s"
- continue
- ;;
- -*)
- ;;
- *)
- # If the previous option needed an argument, then skip it.
- if test -n "$prev"; then
- prev=
- else
- dest=$arg
- continue
- fi
- ;;
- esac
-
- # Aesthetically quote the argument.
- func_quote_for_eval "$arg"
- install_prog="$install_prog $func_quote_for_eval_result"
- done
-
- test -z "$install_prog" && \
- func_fatal_help "you must specify an install program"
-
- test -n "$prev" && \
- func_fatal_help "the \`$prev' option requires an argument"
-
- if test -z "$files"; then
- if test -z "$dest"; then
- func_fatal_help "no file or destination specified"
- else
- func_fatal_help "you must specify a destination"
- fi
- fi
-
- # Strip any trailing slash from the destination.
- func_stripname '' '/' "$dest"
- dest=$func_stripname_result
-
- # Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
- destname=
- else
- func_dirname_and_basename "$dest" "" "."
- destdir="$func_dirname_result"
- destname="$func_basename_result"
-
- # Not a directory, so check to see that there is only one file specified.
- set dummy $files; shift
- test "$#" -gt 1 && \
- func_fatal_help "\`$dest' is not a directory"
- fi
- case $destdir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- for file in $files; do
- case $file in
- *.lo) ;;
- *)
- func_fatal_help "\`$destdir' must be an absolute directory name"
- ;;
- esac
- done
- ;;
- esac
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- staticlibs=
- future_libdirs=
- current_libdirs=
- for file in $files; do
-
- # Do each installation.
- case $file in
- *.$libext)
- # Do the static libraries later.
- staticlibs="$staticlibs $file"
- ;;
-
- *.la)
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$file' is not a valid libtool archive"
-
- library_names=
- old_library=
- relink_command=
- func_source "$file"
-
- # Add the libdir to current_libdirs if it is the destination.
- if test "X$destdir" = "X$libdir"; then
- case "$current_libdirs " in
- *" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
- esac
- else
- # Note the libdir as a future libdir.
- case "$future_libdirs " in
- *" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
- esac
- fi
-
- func_dirname "$file" "/" ""
- dir="$func_dirname_result"
- dir="$dir$objdir"
-
- if test -n "$relink_command"; then
- # Determine the prefix the user has applied to our future dir.
- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
-
- # Don't allow the user to place us outside of our expected
- # location b/c this prevents finding dependent libraries that
- # are installed to the same prefix.
- # At present, this check doesn't affect windows .dll's that
- # are installed into $libdir/../bin (currently, that works fine)
- # but it's something to keep an eye on.
- test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
-
- if test -n "$inst_prefix_dir"; then
- # Stick the inst_prefix_dir data into the link command.
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
- else
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"`
- fi
-
- func_warning "relinking \`$file'"
- func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
- fi
-
- # See the names of the shared library.
- set dummy $library_names; shift
- if test -n "$1"; then
- realname="$1"
- shift
-
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
-
- # Install the shared library and build the symlinks.
- func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \
- 'exit $?'
- tstripme="$stripme"
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- case $realname in
- *.dll.a)
- tstripme=""
- ;;
- esac
- ;;
- esac
- if test -n "$tstripme" && test -n "$striplib"; then
- func_show_eval "$striplib $destdir/$realname" 'exit $?'
- fi
-
- if test "$#" -gt 0; then
- # Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
- # the symlink we replace! Solaris /bin/ln does not understand -f,
- # so we also need to try rm && ln -s.
- for linkname
- do
- test "$linkname" != "$realname" \
- && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
- done
- fi
-
- # Do each command in the postinstall commands.
- lib="$destdir/$realname"
- func_execute_cmds "$postinstall_cmds" 'exit $?'
- fi
-
- # Install the pseudo-library for information purposes.
- func_basename "$file"
- name="$func_basename_result"
- instname="$dir/$name"i
- func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
-
- # Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
- ;;
-
- *.lo)
- # Install (i.e. copy) a libtool object.
-
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # Deduce the name of the destination old-style object file.
- case $destfile in
- *.lo)
- func_lo2o "$destfile"
- staticdest=$func_lo2o_result
- ;;
- *.$objext)
- staticdest="$destfile"
- destfile=
- ;;
- *)
- func_fatal_help "cannot copy a libtool object to \`$destfile'"
- ;;
- esac
-
- # Install the libtool object if requested.
- test -n "$destfile" && \
- func_show_eval "$install_prog $file $destfile" 'exit $?'
-
- # Install the old object if enabled.
- if test "$build_old_libs" = yes; then
- # Deduce the name of the old-style object file.
- func_lo2o "$file"
- staticobj=$func_lo2o_result
- func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
- fi
- exit $EXIT_SUCCESS
- ;;
-
- *)
- # Figure out destination file name, if it wasn't already specified.
- if test -n "$destname"; then
- destfile="$destdir/$destname"
- else
- func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
- fi
-
- # If the file is missing, and there is a .exe on the end, strip it
- # because it is most likely a libtool script we actually want to
- # install
- stripped_ext=""
- case $file in
- *.exe)
- if test ! -f "$file"; then
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- stripped_ext=".exe"
- fi
- ;;
- esac
-
- # Do a test to see if this is really a libtool program.
- case $host in
- *cygwin* | *mingw*)
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- wrapper=$func_ltwrapper_scriptname_result
- else
- func_stripname '' '.exe' "$file"
- wrapper=$func_stripname_result
- fi
- ;;
- *)
- wrapper=$file
- ;;
- esac
- if func_ltwrapper_script_p "$wrapper"; then
- notinst_deplibs=
- relink_command=
-
- func_source "$wrapper"
-
- # Check the variables that should have been set.
- test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
-
- finalize=yes
- for lib in $notinst_deplibs; do
- # Check to see that each library is installed.
- libdir=
- if test -f "$lib"; then
- func_source "$lib"
- fi
- libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
- if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "\`$lib' has not been installed in \`$libdir'"
- finalize=no
- fi
- done
-
- relink_command=
- func_source "$wrapper"
-
- outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
- $opt_dry_run || {
- if test "$finalize" = yes; then
- tmpdir=`func_mktempdir`
- func_basename "$file$stripped_ext"
- file="$func_basename_result"
- outputname="$tmpdir/$file"
- # Replace the output file specification.
- relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
-
- $opt_silent || {
- func_quote_for_expand "$relink_command"
- eval "func_echo $func_quote_for_expand_result"
- }
- if eval "$relink_command"; then :
- else
- func_error "error: relink \`$file' with the above command before installing it"
- $opt_dry_run || ${RM}r "$tmpdir"
- continue
- fi
- file="$outputname"
- else
- func_warning "cannot relink \`$file'"
- fi
- }
- else
- # Install the binary that we compiled earlier.
- file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
- fi
- fi
-
- # remove .exe since cygwin /usr/bin/install will append another
- # one anyway
- case $install_prog,$host in
- */usr/bin/install*,*cygwin*)
- case $file:$destfile in
- *.exe:*.exe)
- # this is ok
- ;;
- *.exe:*)
- destfile=$destfile.exe
- ;;
- *:*.exe)
- func_stripname '' '.exe' "$destfile"
- destfile=$func_stripname_result
- ;;
- esac
- ;;
- esac
- func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
- $opt_dry_run || if test -n "$outputname"; then
- ${RM}r "$tmpdir"
- fi
- ;;
- esac
- done
-
- for file in $staticlibs; do
- func_basename "$file"
- name="$func_basename_result"
-
- # Set up the ranlib parameters.
- oldlib="$destdir/$name"
-
- func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
-
- if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $oldlib" 'exit $?'
- fi
-
- # Do each command in the postinstall commands.
- func_execute_cmds "$old_postinstall_cmds" 'exit $?'
- done
-
- test -n "$future_libdirs" && \
- func_warning "remember to run \`$progname --finish$future_libdirs'"
-
- if test -n "$current_libdirs"; then
- # Maybe just do a dry run.
- $opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
- else
- exit $EXIT_SUCCESS
- fi
-}
-
-test "$mode" = install && func_mode_install ${1+"$@"}
-
-
-# func_generate_dlsyms outputname originator pic_p
-# Extract symbols from dlprefiles and create ${outputname}S.o with
-# a dlpreopen symbol table.
-func_generate_dlsyms ()
-{
- $opt_debug
- my_outputname="$1"
- my_originator="$2"
- my_pic_p="${3-no}"
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
- my_dlsyms=
-
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms="${my_outputname}S.c"
- else
- func_error "not configured to extract global symbols from dlpreopened files"
- fi
- fi
-
- if test -n "$my_dlsyms"; then
- case $my_dlsyms in
- "") ;;
- *.c)
- # Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${my_outputname}.nm"
-
- func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
-
- # Parse the name list into a source file.
- func_verbose "creating $output_objdir/$my_dlsyms"
-
- $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
-
-#ifdef __cplusplus
-extern \"C\" {
-#endif
-
-/* External symbol declarations for the compiler. */\
-"
-
- if test "$dlself" = yes; then
- func_verbose "generating symbol list for \`$output'"
-
- $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
-
- # Add our own program objects to the symbol list.
- progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- for progfile in $progfiles; do
- func_verbose "extracting global C symbols from \`$progfile'"
- $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
- done
-
- if test -n "$exclude_expsyms"; then
- $opt_dry_run || {
- eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- if test -n "$export_symbols_regex"; then
- $opt_dry_run || {
- eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- }
- fi
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
- $opt_dry_run || {
- $RM $export_symbols
- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- else
- $opt_dry_run || {
- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
- eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
- eval '$MV "$nlist"T "$nlist"'
- case $host in
- *cygwin | *mingw* | *cegcc* )
- eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
- eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
- ;;
- esac
- }
- fi
- fi
-
- for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from \`$dlprefile'"
- func_basename "$dlprefile"
- name="$func_basename_result"
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
- done
-
- $opt_dry_run || {
- # Make sure we have at least an empty file.
- test -f "$nlist" || : > "$nlist"
-
- if test -n "$exclude_expsyms"; then
- $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
- $MV "$nlist"T "$nlist"
- fi
-
- # Try sorting and uniquifying the output.
- if $GREP -v "^: " < "$nlist" |
- if sort -k 3 </dev/null >/dev/null 2>&1; then
- sort -k 3
- else
- sort +2
- fi |
- uniq > "$nlist"S; then
- :
- else
- $GREP -v "^: " < "$nlist" > "$nlist"S
- fi
-
- if test -f "$nlist"S; then
- eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
- else
- $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms"
- fi
-
- $ECHO >> "$output_objdir/$my_dlsyms" "\
-
-/* The mapping between symbol names and symbols. */
-typedef struct {
- const char *name;
- void *address;
-} lt_dlsymlist;
-"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- $ECHO >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs. */"
- lt_dlsym_const= ;;
- *osf5*)
- echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
- lt_dlsym_const= ;;
- *)
- lt_dlsym_const=const ;;
- esac
-
- $ECHO >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
- { \"$my_originator\", (void *) 0 },"
-
- case $need_lib_prefix in
- no)
- eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- *)
- eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
- ;;
- esac
- $ECHO >> "$output_objdir/$my_dlsyms" "\
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt_${my_prefix}_LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif\
-"
- } # !$opt_dry_run
-
- pic_flag_for_symtable=
- case "$compile_command " in
- *" -static "*) ;;
- *)
- case $host in
- # compiling the symbol table file with pic_flag works around
- # a FreeBSD bug that causes programs to crash when -lm is
- # linked before any other PIC object. But we must not use
- # pic_flag when linking with -static. The problem exists in
- # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
- pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
- *-*-hpux*)
- pic_flag_for_symtable=" $pic_flag" ;;
- *)
- if test "X$my_pic_p" != Xno; then
- pic_flag_for_symtable=" $pic_flag"
- fi
- ;;
- esac
- ;;
- esac
- symtab_cflags=
- for arg in $LTCFLAGS; do
- case $arg in
- -pie | -fpie | -fPIE) ;;
- *) symtab_cflags="$symtab_cflags $arg" ;;
- esac
- done
-
- # Now compile the dynamic symbol file.
- func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
-
- # Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
-
- # Transform the symbol file into the correct name.
- symfileobj="$output_objdir/${my_outputname}S.$objext"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- if test -f "$output_objdir/$my_outputname.def"; then
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
- else
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- fi
- ;;
- *)
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- ;;
- esac
- ;;
- *)
- func_fatal_error "unknown suffix for \`$my_dlsyms'"
- ;;
- esac
- else
- # We keep going just in case the user didn't refer to
- # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
- # really was required.
-
- # Nullify the symbol file.
- compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
- finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
- fi
-}
-
-# func_win32_libid arg
-# return the library type of file 'arg'
-#
-# Need a lot of goo to handle *both* DLLs and import libs
-# Has to be a shell function in order to 'eat' the argument
-# that is supplied when $file_magic_command is called.
-func_win32_libid ()
-{
- $opt_debug
- win32_libid_type="unknown"
- win32_fileres=`file -L $1 2>/dev/null`
- case $win32_fileres in
- *ar\ archive\ import\ library*) # definitely import
- win32_libid_type="x86 archive import"
- ;;
- *ar\ archive*) # could be an import, or static
- if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
- $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
- win32_nmres=`eval $NM -f posix -A $1 |
- $SED -n -e '
- 1,100{
- / I /{
- s,.*,import,
- p
- q
- }
- }'`
- case $win32_nmres in
- import*) win32_libid_type="x86 archive import";;
- *) win32_libid_type="x86 archive static";;
- esac
- fi
- ;;
- *DLL*)
- win32_libid_type="x86 DLL"
- ;;
- *executable*) # but shell scripts are "executable" too...
- case $win32_fileres in
- *MS\ Windows\ PE\ Intel*)
- win32_libid_type="x86 DLL"
- ;;
- esac
- ;;
- esac
- $ECHO "$win32_libid_type"
-}
-
-
-
-# func_extract_an_archive dir oldlib
-func_extract_an_archive ()
-{
- $opt_debug
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
- func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?'
- if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
- fi
-}
-
-
-# func_extract_archives gentop oldlib ...
-func_extract_archives ()
-{
- $opt_debug
- my_gentop="$1"; shift
- my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
-
- for my_xlib in $my_oldlibs; do
- # Extract the objects.
- case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
- *) my_xabs=`pwd`"/$my_xlib" ;;
- esac
- func_basename "$my_xlib"
- my_xlib="$func_basename_result"
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- func_arith $extracted_serial + 1
- extracted_serial=$func_arith_result
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
-
- func_mkdir_p "$my_xdir"
-
- case $host in
- *-darwin*)
- func_verbose "Extracting $my_xabs"
- # Do not bother doing anything if just a dry run
- $opt_dry_run || {
- darwin_orig_dir=`pwd`
- cd $my_xdir || exit $?
- darwin_archive=$my_xabs
- darwin_curdir=`pwd`
- darwin_base_archive=`basename "$darwin_archive"`
- darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
- if test -n "$darwin_arches"; then
- darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
- darwin_arch=
- func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
- cd "$darwin_curdir"
- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
- done # $darwin_arches
- ## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
- darwin_file=
- darwin_files=
- for darwin_file in $darwin_filelist; do
- darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
- $LIPO -create -output "$darwin_file" $darwin_files
- done # $darwin_filelist
- $RM -rf unfat-$$
- cd "$darwin_orig_dir"
- else
- cd $darwin_orig_dir
- func_extract_an_archive "$my_xdir" "$my_xabs"
- fi # $darwin_arches
- } # !$opt_dry_run
- ;;
- *)
- func_extract_an_archive "$my_xdir" "$my_xabs"
- ;;
- esac
- my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
- done
-
- func_extract_archives_result="$my_oldobjs"
-}
-
-
-
-# func_emit_wrapper_part1 [arg=no]
-#
-# Emit the first part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part1 ()
-{
- func_emit_wrapper_part1_arg1=no
- if test -n "$1" ; then
- func_emit_wrapper_part1_arg1=$1
- fi
-
- $ECHO "\
-#! $SHELL
-
-# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# The $output program cannot be directly executed until all the libtool
-# libraries that it depends on are installed.
-#
-# This wrapper script should never be moved out of the build directory.
-# If it is, it will not operate correctly.
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='${SED} -e 1s/^X//'
-sed_quote_subst='$sed_quote_subst'
-
-# Be Bourne compatible
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-relink_command=\"$relink_command\"
-
-# This environment variable determines our operation mode.
-if test \"\$libtool_install_magic\" = \"$magic\"; then
- # install mode needs the following variables:
- generated_by_libtool_version='$macro_version'
- notinst_deplibs='$notinst_deplibs'
-else
- # When we are sourced in execute mode, \$file and \$ECHO are already set.
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- ECHO=\"$qecho\"
- file=\"\$0\"
- # Make sure echo works.
- if test \"X\$1\" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
- elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then
- # Yippee, \$ECHO works!
- :
- else
- # Restart under the correct shell, and then maybe \$ECHO will work.
- exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
- fi
- fi\
-"
- $ECHO "\
-
- # Find the directory that this script lives in.
- thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
- test \"x\$thisdir\" = \"x\$file\" && thisdir=.
-
- # Follow symbolic links until we get to the real thisdir.
- file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
- while test -n \"\$file\"; do
- destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
-
- # If there was a directory component, then change thisdir.
- if test \"x\$destdir\" != \"x\$file\"; then
- case \"\$destdir\" in
- [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
- *) thisdir=\"\$thisdir/\$destdir\" ;;
- esac
- fi
-
- file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
- file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
- done
-"
-}
-# end: func_emit_wrapper_part1
-
-# func_emit_wrapper_part2 [arg=no]
-#
-# Emit the second part of a libtool wrapper script on stdout.
-# For more information, see the description associated with
-# func_emit_wrapper(), below.
-func_emit_wrapper_part2 ()
-{
- func_emit_wrapper_part2_arg1=no
- if test -n "$1" ; then
- func_emit_wrapper_part2_arg1=$1
- fi
-
- $ECHO "\
-
- # Usually 'no', except on cygwin/mingw when embedded into
- # the cwrapper.
- WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1
- if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
- # special case for '.'
- if test \"\$thisdir\" = \".\"; then
- thisdir=\`pwd\`
- fi
- # remove .libs from thisdir
- case \"\$thisdir\" in
- *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;;
- $objdir ) thisdir=. ;;
- esac
- fi
-
- # Try to get the absolute directory name.
- absdir=\`cd \"\$thisdir\" && pwd\`
- test -n \"\$absdir\" && thisdir=\"\$absdir\"
-"
-
- if test "$fast_install" = yes; then
- $ECHO "\
- program=lt-'$outputname'$exeext
- progdir=\"\$thisdir/$objdir\"
-
- if test ! -f \"\$progdir/\$program\" ||
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
- test \"X\$file\" != \"X\$progdir/\$program\"; }; then
-
- file=\"\$\$-\$program\"
-
- if test ! -d \"\$progdir\"; then
- $MKDIR \"\$progdir\"
- else
- $RM \"\$progdir/\$file\"
- fi"
-
- $ECHO "\
-
- # relink executable if necessary
- if test -n \"\$relink_command\"; then
- if relink_command_output=\`eval \$relink_command 2>&1\`; then :
- else
- $ECHO \"\$relink_command_output\" >&2
- $RM \"\$progdir/\$file\"
- exit 1
- fi
- fi
-
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
- { $RM \"\$progdir/\$program\";
- $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
- $RM \"\$progdir/\$file\"
- fi"
- else
- $ECHO "\
- program='$outputname'
- progdir=\"\$thisdir/$objdir\"
-"
- fi
-
- $ECHO "\
-
- if test -f \"\$progdir/\$program\"; then"
-
- # Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- $ECHO "\
- # Add our own library path to $shlibpath_var
- $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
-
- # Some systems cannot cope with colon-terminated $shlibpath_var
- # The second colon is a workaround for a bug in BeOS R4 sed
- $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
-
- export $shlibpath_var
-"
- fi
-
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
- $ECHO "\
- if test \"\$libtool_execute_magic\" != \"$magic\"; then
- # Run the actual program with our arguments.
-"
- case $host in
- # Backslashes separate directories on plain windows
- *-*-mingw | *-*-os2* | *-cegcc*)
- $ECHO "\
- exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
-"
- ;;
-
- *)
- $ECHO "\
- exec \"\$progdir/\$program\" \${1+\"\$@\"}
-"
- ;;
- esac
- $ECHO "\
- \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
- exit 1
- fi
- else
- # The program doesn't exist.
- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
- \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
- $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
- exit 1
- fi
-fi\
-"
-}
-# end: func_emit_wrapper_part2
-
-
-# func_emit_wrapper [arg=no]
-#
-# Emit a libtool wrapper script on stdout.
-# Don't directly open a file because we may want to
-# incorporate the script contents within a cygwin/mingw
-# wrapper executable. Must ONLY be called from within
-# func_mode_link because it depends on a number of variables
-# set therein.
-#
-# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
-# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
-# the $objdir directory. This is a cygwin/mingw-specific
-# behavior.
-func_emit_wrapper ()
-{
- func_emit_wrapper_arg1=no
- if test -n "$1" ; then
- func_emit_wrapper_arg1=$1
- fi
-
- # split this up so that func_emit_cwrapperexe_src
- # can call each part independently.
- func_emit_wrapper_part1 "${func_emit_wrapper_arg1}"
- func_emit_wrapper_part2 "${func_emit_wrapper_arg1}"
-}
-
-
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin. Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
- func_to_host_path_result="$1"
- if test -n "$1" ; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- case $build in
- *mingw* ) # actually, msys
- # awkward: cmd appends spaces to result
- lt_sed_strip_trailing_spaces="s/[ ]*\$//"
- func_to_host_path_tmp1=`( cmd //c echo "$1" |\
- $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
- func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_path_tmp1=`cygpath -w "$1"`
- func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # Unfortunately, winepath does not exit with a non-zero
- # error code, so we are forced to check the contents of
- # stdout. On the other hand, if the command is not
- # found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both
- # error code of zero AND non-empty stdout, which explains
- # the odd construction:
- func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
- func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\
- $SED -e "$lt_sed_naive_backslashify"`
- else
- # Allow warning below.
- func_to_host_path_result=""
- fi
- ;;
- esac
- if test -z "$func_to_host_path_result" ; then
- func_error "Could not determine host path corresponding to"
- func_error " '$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_path_result="$1"
- fi
- ;;
- esac
- fi
-}
-# end: func_to_host_path
-
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
- func_to_host_pathlist_result="$1"
- if test -n "$1" ; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_to_host_pathlist_tmp2="$1"
- # Once set for this call, this variable should not be
- # reassigned. It is used in tha fallback case.
- func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\
- $SED -e 's|^:*||' -e 's|:*$||'`
- case $build in
- *mingw* ) # Actually, msys.
- # Awkward: cmd appends spaces to result.
- lt_sed_strip_trailing_spaces="s/[ ]*\$//"
- func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\
- $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""`
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"`
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # unfortunately, winepath doesn't convert pathlists
- func_to_host_pathlist_result=""
- func_to_host_pathlist_oldIFS=$IFS
- IFS=:
- for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
- IFS=$func_to_host_pathlist_oldIFS
- if test -n "$func_to_host_pathlist_f" ; then
- func_to_host_path "$func_to_host_pathlist_f"
- if test -n "$func_to_host_path_result" ; then
- if test -z "$func_to_host_pathlist_result" ; then
- func_to_host_pathlist_result="$func_to_host_path_result"
- else
- func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result"
- fi
- fi
- fi
- IFS=:
- done
- IFS=$func_to_host_pathlist_oldIFS
- ;;
- esac
- if test -z "$func_to_host_pathlist_result" ; then
- func_error "Could not determine the host path(s) corresponding to"
- func_error " '$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This may break if $1 contains DOS-style drive
- # specifications. The fix is not to complicate the expression
- # below, but for the user to provide a working wine installation
- # with winepath so that path translation in the cross-to-mingw
- # case works properly.
- lt_replace_pathsep_nix_to_dos="s|:|;|g"
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
- $SED -e "$lt_replace_pathsep_nix_to_dos"`
- fi
- # Now, add the leading and trailing path separators back
- case "$1" in
- :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
- ;;
- esac
- case "$1" in
- *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;"
- ;;
- esac
- ;;
- esac
- fi
-}
-# end: func_to_host_pathlist
-
-# func_emit_cwrapperexe_src
-# emit the source code for a wrapper executable on stdout
-# Must ONLY be called from within func_mode_link because
-# it depends on a number of variable set therein.
-func_emit_cwrapperexe_src ()
-{
- cat <<EOF
-
-/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-
- The $output program cannot be directly executed until all the libtool
- libraries that it depends on are installed.
-
- This wrapper executable should never be moved out of the build directory.
- If it is, it will not operate correctly.
-
- Currently, it simply execs the wrapper *script* "$SHELL $output",
- but could eventually absorb all of the scripts functionality and
- exec $objdir/$outputname directly.
-*/
-EOF
- cat <<"EOF"
-#include <stdio.h>
-#include <stdlib.h>
-#ifdef _MSC_VER
-# include <direct.h>
-# include <process.h>
-# include <io.h>
-# define setmode _setmode
-#else
-# include <unistd.h>
-# include <stdint.h>
-# ifdef __CYGWIN__
-# include <io.h>
-# define HAVE_SETENV
-# ifdef __STRICT_ANSI__
-char *realpath (const char *, char *);
-int putenv (char *);
-int setenv (const char *, const char *, int);
-# endif
-# endif
-#endif
-#include <malloc.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <string.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-
-#if defined(PATH_MAX)
-# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
-# define LT_PATHMAX MAXPATHLEN
-#else
-# define LT_PATHMAX 1024
-#endif
-
-#ifndef S_IXOTH
-# define S_IXOTH 0
-#endif
-#ifndef S_IXGRP
-# define S_IXGRP 0
-#endif
-
-#ifdef _MSC_VER
-# define S_IXUSR _S_IEXEC
-# define stat _stat
-# ifndef _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR
-# define DIR_SEPARATOR '/'
-# define PATH_SEPARATOR ':'
-#endif
-
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
-# define HAVE_DOS_BASED_FILE_SYSTEM
-# define FOPEN_WB "wb"
-# ifndef DIR_SEPARATOR_2
-# define DIR_SEPARATOR_2 '\\'
-# endif
-# ifndef PATH_SEPARATOR_2
-# define PATH_SEPARATOR_2 ';'
-# endif
-#endif
-
-#ifndef DIR_SEPARATOR_2
-# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
-#else /* DIR_SEPARATOR_2 */
-# define IS_DIR_SEPARATOR(ch) \
- (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
-#endif /* DIR_SEPARATOR_2 */
-
-#ifndef PATH_SEPARATOR_2
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
-#else /* PATH_SEPARATOR_2 */
-# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
-#endif /* PATH_SEPARATOR_2 */
-
-#ifdef __CYGWIN__
-# define FOPEN_WB "wb"
-#endif
-
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef _O_BINARY
-# define _O_BINARY 0
-#endif
-
-#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
-#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
-} while (0)
-
-#undef LTWRAPPER_DEBUGPRINTF
-#if defined DEBUGWRAPPER
-# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args
-static void
-ltwrapper_debugprintf (const char *fmt, ...)
-{
- va_list args;
- va_start (args, fmt);
- (void) vfprintf (stderr, fmt, args);
- va_end (args);
-}
-#else
-# define LTWRAPPER_DEBUGPRINTF(args)
-#endif
-
-const char *program_name = NULL;
-
-void *xmalloc (size_t num);
-char *xstrdup (const char *string);
-const char *base_name (const char *name);
-char *find_executable (const char *wrapper);
-char *chase_symlinks (const char *pathspec);
-int make_executable (const char *path);
-int check_executable (const char *path);
-char *strendzap (char *str, const char *pat);
-void lt_fatal (const char *message, ...);
-void lt_setenv (const char *name, const char *value);
-char *lt_extend_str (const char *orig_value, const char *add, int to_end);
-void lt_opt_process_env_set (const char *arg);
-void lt_opt_process_env_prepend (const char *arg);
-void lt_opt_process_env_append (const char *arg);
-int lt_split_name_value (const char *arg, char** name, char** value);
-void lt_update_exe_path (const char *name, const char *value);
-void lt_update_lib_path (const char *name, const char *value);
-
-static const char *script_text_part1 =
-EOF
-
- func_emit_wrapper_part1 yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ "/' -e 's/$/\\n"/'
- echo ";"
- cat <<EOF
-
-static const char *script_text_part2 =
-EOF
- func_emit_wrapper_part2 yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ "/' -e 's/$/\\n"/'
- echo ";"
-
- cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
-const char * LIB_PATH_VARNAME = "$shlibpath_var";
-EOF
-
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_pathlist "$temp_rpath"
- cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
-EOF
- else
- cat <<"EOF"
-const char * LIB_PATH_VALUE = "";
-EOF
- fi
-
- if test -n "$dllsearchpath"; then
- func_to_host_pathlist "$dllsearchpath:"
- cat <<EOF
-const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
-EOF
- else
- cat <<"EOF"
-const char * EXE_PATH_VARNAME = "";
-const char * EXE_PATH_VALUE = "";
-EOF
- fi
-
- if test "$fast_install" = yes; then
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
-EOF
- else
- cat <<EOF
-const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
-EOF
- fi
-
-
- cat <<"EOF"
-
-#define LTWRAPPER_OPTION_PREFIX "--lt-"
-#define LTWRAPPER_OPTION_PREFIX_LENGTH 5
-
-static const size_t opt_prefix_len = LTWRAPPER_OPTION_PREFIX_LENGTH;
-static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
-
-static const char *dumpscript_opt = LTWRAPPER_OPTION_PREFIX "dump-script";
-
-static const size_t env_set_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 7;
-static const char *env_set_opt = LTWRAPPER_OPTION_PREFIX "env-set";
- /* argument is putenv-style "foo=bar", value of foo is set to bar */
-
-static const size_t env_prepend_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 11;
-static const char *env_prepend_opt = LTWRAPPER_OPTION_PREFIX "env-prepend";
- /* argument is putenv-style "foo=bar", new value of foo is bar${foo} */
-
-static const size_t env_append_opt_len = LTWRAPPER_OPTION_PREFIX_LENGTH + 10;
-static const char *env_append_opt = LTWRAPPER_OPTION_PREFIX "env-append";
- /* argument is putenv-style "foo=bar", new value of foo is ${foo}bar */
-
-int
-main (int argc, char *argv[])
-{
- char **newargz;
- int newargc;
- char *tmp_pathspec;
- char *actual_cwrapper_path;
- char *actual_cwrapper_name;
- char *target_name;
- char *lt_argv_zero;
- intptr_t rval = 127;
-
- int i;
-
- program_name = (char *) xstrdup (base_name (argv[0]));
- LTWRAPPER_DEBUGPRINTF (("(main) argv[0] : %s\n", argv[0]));
- LTWRAPPER_DEBUGPRINTF (("(main) program_name : %s\n", program_name));
-
- /* very simple arg parsing; don't want to rely on getopt */
- for (i = 1; i < argc; i++)
- {
- if (strcmp (argv[i], dumpscript_opt) == 0)
- {
-EOF
- case "$host" in
- *mingw* | *cygwin* )
- # make stdout use "unix" line endings
- echo " setmode(1,_O_BINARY);"
- ;;
- esac
-
- cat <<"EOF"
- printf ("%s", script_text_part1);
- printf ("%s", script_text_part2);
- return 0;
- }
- }
-
- newargz = XMALLOC (char *, argc + 1);
- tmp_pathspec = find_executable (argv[0]);
- if (tmp_pathspec == NULL)
- lt_fatal ("Couldn't find %s", argv[0]);
- LTWRAPPER_DEBUGPRINTF (("(main) found exe (before symlink chase) at : %s\n",
- tmp_pathspec));
-
- actual_cwrapper_path = chase_symlinks (tmp_pathspec);
- LTWRAPPER_DEBUGPRINTF (("(main) found exe (after symlink chase) at : %s\n",
- actual_cwrapper_path));
- XFREE (tmp_pathspec);
-
- actual_cwrapper_name = xstrdup( base_name (actual_cwrapper_path));
- strendzap (actual_cwrapper_path, actual_cwrapper_name);
-
- /* wrapper name transforms */
- strendzap (actual_cwrapper_name, ".exe");
- tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
- XFREE (actual_cwrapper_name);
- actual_cwrapper_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- /* target_name transforms -- use actual target program name; might have lt- prefix */
- target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
- strendzap (target_name, ".exe");
- tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
- XFREE (target_name);
- target_name = tmp_pathspec;
- tmp_pathspec = 0;
-
- LTWRAPPER_DEBUGPRINTF (("(main) libtool target name: %s\n",
- target_name));
-EOF
-
- cat <<EOF
- newargz[0] =
- XMALLOC (char, (strlen (actual_cwrapper_path) +
- strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
- strcpy (newargz[0], actual_cwrapper_path);
- strcat (newargz[0], "$objdir");
- strcat (newargz[0], "/");
-EOF
-
- cat <<"EOF"
- /* stop here, and copy so we don't have to do this twice */
- tmp_pathspec = xstrdup (newargz[0]);
-
- /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
- strcat (newargz[0], actual_cwrapper_name);
-
- /* DO want the lt- prefix here if it exists, so use target_name */
- lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
- XFREE (tmp_pathspec);
- tmp_pathspec = NULL;
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- {
- char* p;
- while ((p = strchr (newargz[0], '\\')) != NULL)
- {
- *p = '/';
- }
- while ((p = strchr (lt_argv_zero, '\\')) != NULL)
- {
- *p = '/';
- }
- }
-EOF
- ;;
- esac
-
- cat <<"EOF"
- XFREE (target_name);
- XFREE (actual_cwrapper_path);
- XFREE (actual_cwrapper_name);
-
- lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
- lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
- lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
-
- newargc=0;
- for (i = 1; i < argc; i++)
- {
- if (strncmp (argv[i], env_set_opt, env_set_opt_len) == 0)
- {
- if (argv[i][env_set_opt_len] == '=')
- {
- const char *p = argv[i] + env_set_opt_len + 1;
- lt_opt_process_env_set (p);
- }
- else if (argv[i][env_set_opt_len] == '\0' && i + 1 < argc)
- {
- lt_opt_process_env_set (argv[++i]); /* don't copy */
- }
- else
- lt_fatal ("%s missing required argument", env_set_opt);
- continue;
- }
- if (strncmp (argv[i], env_prepend_opt, env_prepend_opt_len) == 0)
- {
- if (argv[i][env_prepend_opt_len] == '=')
- {
- const char *p = argv[i] + env_prepend_opt_len + 1;
- lt_opt_process_env_prepend (p);
- }
- else if (argv[i][env_prepend_opt_len] == '\0' && i + 1 < argc)
- {
- lt_opt_process_env_prepend (argv[++i]); /* don't copy */
- }
- else
- lt_fatal ("%s missing required argument", env_prepend_opt);
- continue;
- }
- if (strncmp (argv[i], env_append_opt, env_append_opt_len) == 0)
- {
- if (argv[i][env_append_opt_len] == '=')
- {
- const char *p = argv[i] + env_append_opt_len + 1;
- lt_opt_process_env_append (p);
- }
- else if (argv[i][env_append_opt_len] == '\0' && i + 1 < argc)
- {
- lt_opt_process_env_append (argv[++i]); /* don't copy */
- }
- else
- lt_fatal ("%s missing required argument", env_append_opt);
- continue;
- }
- if (strncmp (argv[i], ltwrapper_option_prefix, opt_prefix_len) == 0)
- {
- /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
- namespace, but it is not one of the ones we know about and
- have already dealt with, above (inluding dump-script), then
- report an error. Otherwise, targets might begin to believe
- they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
- namespace. The first time any user complains about this, we'll
- need to make LTWRAPPER_OPTION_PREFIX a configure-time option
- or a configure.ac-settable value.
- */
- lt_fatal ("Unrecognized option in %s namespace: '%s'",
- ltwrapper_option_prefix, argv[i]);
- }
- /* otherwise ... */
- newargz[++newargc] = xstrdup (argv[i]);
- }
- newargz[++newargc] = NULL;
-
- LTWRAPPER_DEBUGPRINTF (("(main) lt_argv_zero : %s\n", (lt_argv_zero ? lt_argv_zero : "<NULL>")));
- for (i = 0; i < newargc; i++)
- {
- LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : "<NULL>")));
- }
-
-EOF
-
- case $host_os in
- mingw*)
- cat <<"EOF"
- /* execv doesn't actually work on mingw as expected on unix */
- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
- if (rval == -1)
- {
- /* failed to start process */
- LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno));
- return 127;
- }
- return rval;
-EOF
- ;;
- *)
- cat <<"EOF"
- execv (lt_argv_zero, newargz);
- return rval; /* =127, but avoids unused variable warning */
-EOF
- ;;
- esac
-
- cat <<"EOF"
-}
-
-void *
-xmalloc (size_t num)
-{
- void *p = (void *) malloc (num);
- if (!p)
- lt_fatal ("Memory exhausted");
-
- return p;
-}
-
-char *
-xstrdup (const char *string)
-{
- return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
- string) : NULL;
-}
-
-const char *
-base_name (const char *name)
-{
- const char *base;
-
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- /* Skip over the disk name in MSDOS pathnames. */
- if (isalpha ((unsigned char) name[0]) && name[1] == ':')
- name += 2;
-#endif
-
- for (base = name; *name; name++)
- if (IS_DIR_SEPARATOR (*name))
- base = name + 1;
- return base;
-}
-
-int
-check_executable (const char *path)
-{
- struct stat st;
-
- LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n",
- path ? (*path ? path : "EMPTY!") : "NULL!"));
- if ((!path) || (!*path))
- return 0;
-
- if ((stat (path, &st) >= 0)
- && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
- return 1;
- else
- return 0;
-}
-
-int
-make_executable (const char *path)
-{
- int rval = 0;
- struct stat st;
-
- LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n",
- path ? (*path ? path : "EMPTY!") : "NULL!"));
- if ((!path) || (!*path))
- return 0;
-
- if (stat (path, &st) >= 0)
- {
- rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
- }
- return rval;
-}
-
-/* Searches for the full path of the wrapper. Returns
- newly allocated full path name if found, NULL otherwise
- Does not chase symlinks, even on platforms that support them.
-*/
-char *
-find_executable (const char *wrapper)
-{
- int has_slash = 0;
- const char *p;
- const char *p_next;
- /* static buffer for getcwd */
- char tmp[LT_PATHMAX + 1];
- int tmp_len;
- char *concat_name;
-
- LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n",
- wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"));
-
- if ((wrapper == NULL) || (*wrapper == '\0'))
- return NULL;
-
- /* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- else
- {
-#endif
- if (IS_DIR_SEPARATOR (wrapper[0]))
- {
- concat_name = xstrdup (wrapper);
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
- }
-#endif
-
- for (p = wrapper; *p; p++)
- if (*p == '/')
- {
- has_slash = 1;
- break;
- }
- if (!has_slash)
- {
- /* no slashes; search PATH */
- const char *path = getenv ("PATH");
- if (path != NULL)
- {
- for (p = path; *p; p = p_next)
- {
- const char *q;
- size_t p_len;
- for (q = p; *q; q++)
- if (IS_PATH_SEPARATOR (*q))
- break;
- p_len = q - p;
- p_next = (*q == '\0' ? q : q + 1);
- if (p_len == 0)
- {
- /* empty path: current directory */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen (tmp);
- concat_name =
- XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
- }
- else
- {
- concat_name =
- XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, p, p_len);
- concat_name[p_len] = '/';
- strcpy (concat_name + p_len + 1, wrapper);
- }
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- }
- }
- /* not found in PATH; assume curdir */
- }
- /* Relative path | not found in path: prepend cwd */
- if (getcwd (tmp, LT_PATHMAX) == NULL)
- lt_fatal ("getcwd failed");
- tmp_len = strlen (tmp);
- concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
- memcpy (concat_name, tmp, tmp_len);
- concat_name[tmp_len] = '/';
- strcpy (concat_name + tmp_len + 1, wrapper);
-
- if (check_executable (concat_name))
- return concat_name;
- XFREE (concat_name);
- return NULL;
-}
-
-char *
-chase_symlinks (const char *pathspec)
-{
-#ifndef S_ISLNK
- return xstrdup (pathspec);
-#else
- char buf[LT_PATHMAX];
- struct stat s;
- char *tmp_pathspec = xstrdup (pathspec);
- char *p;
- int has_symlinks = 0;
- while (strlen (tmp_pathspec) && !has_symlinks)
- {
- LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n",
- tmp_pathspec));
- if (lstat (tmp_pathspec, &s) == 0)
- {
- if (S_ISLNK (s.st_mode) != 0)
- {
- has_symlinks = 1;
- break;
- }
-
- /* search backwards for last DIR_SEPARATOR */
- p = tmp_pathspec + strlen (tmp_pathspec) - 1;
- while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- p--;
- if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
- {
- /* no more DIR_SEPARATORS left */
- break;
- }
- *p = '\0';
- }
- else
- {
- char *errstr = strerror (errno);
- lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr);
- }
- }
- XFREE (tmp_pathspec);
-
- if (!has_symlinks)
- {
- return xstrdup (pathspec);
- }
-
- tmp_pathspec = realpath (pathspec, buf);
- if (tmp_pathspec == 0)
- {
- lt_fatal ("Could not follow symlinks for %s", pathspec);
- }
- return xstrdup (tmp_pathspec);
-#endif
-}
-
-char *
-strendzap (char *str, const char *pat)
-{
- size_t len, patlen;
-
- assert (str != NULL);
- assert (pat != NULL);
-
- len = strlen (str);
- patlen = strlen (pat);
-
- if (patlen <= len)
- {
- str += len - patlen;
- if (strcmp (str, pat) == 0)
- *str = '\0';
- }
- return str;
-}
-
-static void
-lt_error_core (int exit_status, const char *mode,
- const char *message, va_list ap)
-{
- fprintf (stderr, "%s: %s: ", program_name, mode);
- vfprintf (stderr, message, ap);
- fprintf (stderr, ".\n");
-
- if (exit_status >= 0)
- exit (exit_status);
-}
-
-void
-lt_fatal (const char *message, ...)
-{
- va_list ap;
- va_start (ap, message);
- lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
- va_end (ap);
-}
-
-void
-lt_setenv (const char *name, const char *value)
-{
- LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n",
- (name ? name : "<NULL>"),
- (value ? value : "<NULL>")));
- {
-#ifdef HAVE_SETENV
- /* always make a copy, for consistency with !HAVE_SETENV */
- char *str = xstrdup (value);
- setenv (name, str, 1);
-#else
- int len = strlen (name) + 1 + strlen (value) + 1;
- char *str = XMALLOC (char, len);
- sprintf (str, "%s=%s", name, value);
- if (putenv (str) != EXIT_SUCCESS)
- {
- XFREE (str);
- }
-#endif
- }
-}
-
-char *
-lt_extend_str (const char *orig_value, const char *add, int to_end)
-{
- char *new_value;
- if (orig_value && *orig_value)
- {
- int orig_value_len = strlen (orig_value);
- int add_len = strlen (add);
- new_value = XMALLOC (char, add_len + orig_value_len + 1);
- if (to_end)
- {
- strcpy (new_value, orig_value);
- strcpy (new_value + orig_value_len, add);
- }
- else
- {
- strcpy (new_value, add);
- strcpy (new_value + add_len, orig_value);
- }
- }
- else
- {
- new_value = xstrdup (add);
- }
- return new_value;
-}
-
-int
-lt_split_name_value (const char *arg, char** name, char** value)
-{
- const char *p;
- int len;
- if (!arg || !*arg)
- return 1;
-
- p = strchr (arg, (int)'=');
-
- if (!p)
- return 1;
-
- *value = xstrdup (++p);
-
- len = strlen (arg) - strlen (*value);
- *name = XMALLOC (char, len);
- strncpy (*name, arg, len-1);
- (*name)[len - 1] = '\0';
-
- return 0;
-}
-
-void
-lt_opt_process_env_set (const char *arg)
-{
- char *name = NULL;
- char *value = NULL;
-
- if (lt_split_name_value (arg, &name, &value) != 0)
- {
- XFREE (name);
- XFREE (value);
- lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg);
- }
-
- lt_setenv (name, value);
- XFREE (name);
- XFREE (value);
-}
-
-void
-lt_opt_process_env_prepend (const char *arg)
-{
- char *name = NULL;
- char *value = NULL;
- char *new_value = NULL;
-
- if (lt_split_name_value (arg, &name, &value) != 0)
- {
- XFREE (name);
- XFREE (value);
- lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg);
- }
-
- new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- XFREE (name);
- XFREE (value);
-}
-
-void
-lt_opt_process_env_append (const char *arg)
-{
- char *name = NULL;
- char *value = NULL;
- char *new_value = NULL;
-
- if (lt_split_name_value (arg, &name, &value) != 0)
- {
- XFREE (name);
- XFREE (value);
- lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg);
- }
-
- new_value = lt_extend_str (getenv (name), value, 1);
- lt_setenv (name, new_value);
- XFREE (new_value);
- XFREE (name);
- XFREE (value);
-}
-
-void
-lt_update_exe_path (const char *name, const char *value)
-{
- LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
- (name ? name : "<NULL>"),
- (value ? value : "<NULL>")));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- /* some systems can't cope with a ':'-terminated path #' */
- int len = strlen (new_value);
- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
- {
- new_value[len-1] = '\0';
- }
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-void
-lt_update_lib_path (const char *name, const char *value)
-{
- LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
- (name ? name : "<NULL>"),
- (value ? value : "<NULL>")));
-
- if (name && *name && value && *value)
- {
- char *new_value = lt_extend_str (getenv (name), value, 0);
- lt_setenv (name, new_value);
- XFREE (new_value);
- }
-}
-
-
-EOF
-}
-# end: func_emit_cwrapperexe_src
-
-# func_mode_link arg...
-func_mode_link ()
-{
- $opt_debug
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- # It is impossible to link a dll without this setting, and
- # we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
- # flag for every libtool invocation.
- # allow_undefined=no
-
- # FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
- # even a static library is built. For now, we need to specify
- # -no-undefined on the libtool link line when we can be certain
- # that all symbols are satisfied, otherwise we get a static library.
- allow_undefined=yes
- ;;
- *)
- allow_undefined=yes
- ;;
- esac
- libtool_args=$nonopt
- base_compile="$nonopt $@"
- compile_command=$nonopt
- finalize_command=$nonopt
-
- compile_rpath=
- finalize_rpath=
- compile_shlibpath=
- finalize_shlibpath=
- convenience=
- old_convenience=
- deplibs=
- old_deplibs=
- compiler_flags=
- linker_flags=
- dllsearchpath=
- lib_search_path=`pwd`
- inst_prefix_dir=
- new_inherited_linker_flags=
-
- avoid_version=no
- dlfiles=
- dlprefiles=
- dlself=no
- export_dynamic=no
- export_symbols=
- export_symbols_regex=
- generated=
- libobjs=
- ltlibs=
- module=no
- no_install=no
- objs=
- non_pic_objects=
- precious_files_regex=
- prefer_static_libs=no
- preload=no
- prev=
- prevarg=
- release=
- rpath=
- xrpath=
- perm_rpath=
- temp_rpath=
- thread_safe=no
- vinfo=
- vinfo_number=no
- weak_libs=
- single_module="${wl}-single_module"
- func_infer_tag $base_compile
-
- # We need to know -static, to get the right output filenames.
- for arg
- do
- case $arg in
- -shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
- build_old_libs=no
- break
- ;;
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
- func_warning "complete static linking is impossible in this configuration"
- fi
- if test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- -static)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=built
- ;;
- -static-libtool-libs)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- esac
- build_libtool_libs=no
- build_old_libs=yes
- break
- ;;
- esac
- done
-
- # See if our shared archives depend on static archives.
- test -n "$old_archive_from_new_cmds" && build_old_libs=yes
-
- # Go through the arguments, transforming them on the way.
- while test "$#" -gt 0; do
- arg="$1"
- shift
- func_quote_for_eval "$arg"
- qarg=$func_quote_for_eval_unquoted_result
- func_append libtool_args " $func_quote_for_eval_result"
-
- # If the previous option needs an argument, assign it.
- if test -n "$prev"; then
- case $prev in
- output)
- func_append compile_command " @OUTPUT@"
- func_append finalize_command " @OUTPUT@"
- ;;
- esac
-
- case $prev in
- dlfiles|dlprefiles)
- if test "$preload" = no; then
- # Add the symbol object into the linking commands.
- func_append compile_command " @SYMFILE@"
- func_append finalize_command " @SYMFILE@"
- preload=yes
- fi
- case $arg in
- *.la | *.lo) ;; # We handle these cases below.
- force)
- if test "$dlself" = no; then
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- self)
- if test "$prev" = dlprefiles; then
- dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
- dlself=yes
- else
- dlself=needless
- export_dynamic=yes
- fi
- prev=
- continue
- ;;
- *)
- if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
- else
- dlprefiles="$dlprefiles $arg"
- fi
- prev=
- continue
- ;;
- esac
- ;;
- expsyms)
- export_symbols="$arg"
- test -f "$arg" \
- || func_fatal_error "symbol file \`$arg' does not exist"
- prev=
- continue
- ;;
- expsyms_regex)
- export_symbols_regex="$arg"
- prev=
- continue
- ;;
- framework)
- case $host in
- *-*-darwin*)
- case "$deplibs " in
- *" $qarg.ltframework "*) ;;
- *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
- ;;
- esac
- ;;
- esac
- prev=
- continue
- ;;
- inst_prefix)
- inst_prefix_dir="$arg"
- prev=
- continue
- ;;
- objectlist)
- if test -f "$arg"; then
- save_arg=$arg
- moreargs=
- for fil in `cat "$save_arg"`
- do
-# moreargs="$moreargs $fil"
- arg=$fil
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
- fi
- fi
- done
- else
- func_fatal_error "link input file \`$arg' does not exist"
- fi
- arg=$save_arg
- prev=
- continue
- ;;
- precious_regex)
- precious_files_regex="$arg"
- prev=
- continue
- ;;
- release)
- release="-$arg"
- prev=
- continue
- ;;
- rpath | xrpath)
- # We need an absolute path.
- case $arg in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- if test "$prev" = rpath; then
- case "$rpath " in
- *" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
- esac
- else
- case "$xrpath " in
- *" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
- esac
- fi
- prev=
- continue
- ;;
- shrext)
- shrext_cmds="$arg"
- prev=
- continue
- ;;
- weak)
- weak_libs="$weak_libs $arg"
- prev=
- continue
- ;;
- xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xcompiler)
- compiler_flags="$compiler_flags $qarg"
- prev=
- func_append compile_command " $qarg"
- func_append finalize_command " $qarg"
- continue
- ;;
- xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
- prev=
- func_append compile_command " $wl$qarg"
- func_append finalize_command " $wl$qarg"
- continue
- ;;
- *)
- eval "$prev=\"\$arg\""
- prev=
- continue
- ;;
- esac
- fi # test -n "$prev"
-
- prevarg="$arg"
-
- case $arg in
- -all-static)
- if test -n "$link_static_flag"; then
- # See comment for -static flag below, for more details.
- func_append compile_command " $link_static_flag"
- func_append finalize_command " $link_static_flag"
- fi
- continue
- ;;
-
- -allow-undefined)
- # FIXME: remove this flag sometime in the future.
- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
- ;;
-
- -avoid-version)
- avoid_version=yes
- continue
- ;;
-
- -dlopen)
- prev=dlfiles
- continue
- ;;
-
- -dlpreopen)
- prev=dlprefiles
- continue
- ;;
-
- -export-dynamic)
- export_dynamic=yes
- continue
- ;;
-
- -export-symbols | -export-symbols-regex)
- if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
- func_fatal_error "more than one -exported-symbols argument is not allowed"
- fi
- if test "X$arg" = "X-export-symbols"; then
- prev=expsyms
- else
- prev=expsyms_regex
- fi
- continue
- ;;
-
- -framework)
- prev=framework
- continue
- ;;
-
- -inst-prefix-dir)
- prev=inst_prefix
- continue
- ;;
-
- # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
- # so, if we see these flags be careful not to treat them like -L
- -L[A-Z][A-Z]*:*)
- case $with_gcc/$host in
- no/*-*-irix* | /*-*-irix*)
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- ;;
- esac
- continue
- ;;
-
- -L*)
- func_stripname '-L' '' "$arg"
- dir=$func_stripname_result
- if test -z "$dir"; then
- if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
- else
- func_fatal_error "need path for \`-L' option"
- fi
- fi
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- absdir=`cd "$dir" && pwd`
- test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of \`$dir'"
- dir="$absdir"
- ;;
- esac
- case "$deplibs " in
- *" -L$dir "*) ;;
- *)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
- ;;
- esac
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$dir:"*) ;;
- ::) dllsearchpath=$dir;;
- *) dllsearchpath="$dllsearchpath:$dir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- continue
- ;;
-
- -l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*)
- # These systems don't actually have a C or math library (as such)
- continue
- ;;
- *-*-os2*)
- # These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs System.ltframework"
- continue
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
- ;;
- esac
- elif test "X$arg" = "X-lc_r"; then
- case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc_r directly, use -pthread flag.
- continue
- ;;
- esac
- fi
- deplibs="$deplibs $arg"
- continue
- ;;
-
- -module)
- module=yes
- continue
- ;;
-
- # Tru64 UNIX uses -model [arg] to determine the layout of C++
- # classes, name mangling, and exception handling.
- # Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot)
- compiler_flags="$compiler_flags $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- prev=xcompiler
- continue
- ;;
-
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- compiler_flags="$compiler_flags $arg"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- case "$new_inherited_linker_flags " in
- *" $arg "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
- esac
- continue
- ;;
-
- -multi_module)
- single_module="${wl}-multi_module"
- continue
- ;;
-
- -no-fast-install)
- fast_install=no
- continue
- ;;
-
- -no-install)
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
- # The PATH hackery in wrapper scripts is required on Windows
- # and Darwin in order for the loader to find any dlls it needs.
- func_warning "\`-no-install' is ignored for $host"
- func_warning "assuming \`-no-fast-install' instead"
- fast_install=no
- ;;
- *) no_install=yes ;;
- esac
- continue
- ;;
-
- -no-undefined)
- allow_undefined=no
- continue
- ;;
-
- -objectlist)
- prev=objectlist
- continue
- ;;
-
- -o) prev=output ;;
-
- -precious-files-regex)
- prev=precious_regex
- continue
- ;;
-
- -release)
- prev=release
- continue
- ;;
-
- -rpath)
- prev=rpath
- continue
- ;;
-
- -R)
- prev=xrpath
- continue
- ;;
-
- -R*)
- func_stripname '-R' '' "$arg"
- dir=$func_stripname_result
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) ;;
- *)
- func_fatal_error "only absolute run-paths are allowed"
- ;;
- esac
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- continue
- ;;
-
- -shared)
- # The effects of -shared are defined in a previous loop.
- continue
- ;;
-
- -shrext)
- prev=shrext
- continue
- ;;
-
- -static | -static-libtool-libs)
- # The effects of -static are defined in a previous loop.
- # We used to do the same as -all-static on platforms that
- # didn't have a PIC flag, but the assumption that the effects
- # would be equivalent was wrong. It would break on at least
- # Digital Unix and AIX.
- continue
- ;;
-
- -thread-safe)
- thread_safe=yes
- continue
- ;;
-
- -version-info)
- prev=vinfo
- continue
- ;;
-
- -version-number)
- prev=vinfo
- vinfo_number=yes
- continue
- ;;
-
- -weak)
- prev=weak
- continue
- ;;
-
- -Wc,*)
- func_stripname '-Wc,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$flag"
- arg="$arg $wl$func_quote_for_eval_result"
- compiler_flags="$compiler_flags $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Wl,*)
- func_stripname '-Wl,' '' "$arg"
- args=$func_stripname_result
- arg=
- save_ifs="$IFS"; IFS=','
- for flag in $args; do
- IFS="$save_ifs"
- func_quote_for_eval "$flag"
- arg="$arg $wl$func_quote_for_eval_result"
- compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
- linker_flags="$linker_flags $func_quote_for_eval_result"
- done
- IFS="$save_ifs"
- func_stripname ' ' '' "$arg"
- arg=$func_stripname_result
- ;;
-
- -Xcompiler)
- prev=xcompiler
- continue
- ;;
-
- -Xlinker)
- prev=xlinker
- continue
- ;;
-
- -XCClinker)
- prev=xcclinker
- continue
- ;;
-
- # -msg_* for osf cc
- -msg_*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
- # -r[0-9][0-9]* specifies the processor on the SGI compiler
- # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
- # +DA*, +DD* enable 64-bit mode on the HP compiler
- # -q* pass through compiler args for the IBM compiler
- # -m*, -t[45]*, -txscale* pass through architecture-specific
- # compiler args for GCC
- # -F/path gives path to uninstalled frameworks, gcc on darwin
- # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
- # @file GCC response files
- -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- compiler_flags="$compiler_flags $arg"
- continue
- ;;
-
- # Some other compiler flag.
- -* | +*)
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
-
- *.$objext)
- # A standard object.
- objs="$objs $arg"
- ;;
-
- *.lo)
- # A libtool-controlled object.
-
- # Check to see that this really is a libtool object.
- if func_lalib_unsafe_p "$arg"; then
- pic_object=
- non_pic_object=
-
- # Read the .lo file
- func_source "$arg"
-
- if test -z "$pic_object" ||
- test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
- fi
-
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- if test "$pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
-
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
- prev=
- continue
- else
- # If libtool objects are unsupported, then we need to preload.
- prev=dlprefiles
- fi
- fi
-
- # CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
- # Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
- prev=
- fi
-
- # A PIC object.
- func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
-
- # Non-PIC object.
- if test "$non_pic_object" != none; then
- # Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
-
- # A standard non-PIC object
- func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
- fi
- else
- # If the PIC object exists, use it instead.
- # $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
- func_append non_pic_objects " $non_pic_object"
- fi
- else
- # Only an error if not doing a dry-run.
- if $opt_dry_run; then
- # Extract subdirectory from the argument.
- func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
-
- func_lo2o "$arg"
- pic_object=$xdir$objdir/$func_lo2o_result
- non_pic_object=$xdir$func_lo2o_result
- func_append libobjs " $pic_object"
- func_append non_pic_objects " $non_pic_object"
- else
- func_fatal_error "\`$arg' is not a valid libtool object"
- fi
- fi
- ;;
-
- *.$libext)
- # An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
- continue
- ;;
-
- *.la)
- # A libtool-controlled library.
-
- if test "$prev" = dlfiles; then
- # This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
- prev=
- elif test "$prev" = dlprefiles; then
- # The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
- prev=
- else
- deplibs="$deplibs $arg"
- fi
- continue
- ;;
-
- # Some other compiler argument.
- *)
- # Unknown arguments in both finalize_command and compile_command need
- # to be aesthetically quoted because they are evaled later.
- func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
- ;;
- esac # arg
-
- # Now actually substitute the argument into the commands.
- if test -n "$arg"; then
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
- done # argument parsing loop
-
- test -n "$prev" && \
- func_fatal_help "the \`$prevarg' option requires an argument"
-
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- func_append compile_command " $arg"
- func_append finalize_command " $arg"
- fi
-
- oldlibs=
- # calculate the name of the file, without its directory
- func_basename "$output"
- outputname="$func_basename_result"
- libobjs_save="$libobjs"
-
- if test -n "$shlibpath_var"; then
- # get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
- else
- shlib_search_path=
- fi
- eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
- eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
-
- func_dirname "$output" "/" ""
- output_objdir="$func_dirname_result$objdir"
- # Create the object directory.
- func_mkdir_p "$output_objdir"
-
- # Determine the type of output
- case $output in
- "")
- func_fatal_help "you must specify an output file"
- ;;
- *.$libext) linkmode=oldlib ;;
- *.lo | *.$objext) linkmode=obj ;;
- *.la) linkmode=lib ;;
- *) linkmode=prog ;; # Anything else should be a program.
- esac
-
- specialdeplibs=
-
- libs=
- # Find all interdependent deplibs by searching for libraries
- # that are linked more than once (e.g. -la -lb -la)
- for deplib in $deplibs; do
- if $opt_duplicate_deps ; then
- case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- libs="$libs $deplib"
- done
-
- if test "$linkmode" = lib; then
- libs="$predeps $libs $compiler_lib_search_path $postdeps"
-
- # Compute libraries that are listed more than once in $predeps
- # $postdeps and mark them as special (i.e., whose duplicates are
- # not to be eliminated).
- pre_post_deps=
- if $opt_duplicate_compiler_generated_deps; then
- for pre_post_dep in $predeps $postdeps; do
- case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
- esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
- done
- fi
- pre_post_deps=
- fi
-
- deplibs=
- newdependency_libs=
- newlib_search_path=
- need_relink=no # whether we're linking any uninstalled libtool libraries
- notinst_deplibs= # not-installed libtool libraries
- notinst_path= # paths that contain not-installed libtool libraries
-
- case $linkmode in
- lib)
- passes="conv dlpreopen link"
- for file in $dlfiles $dlprefiles; do
- case $file in
- *.la) ;;
- *)
- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
- ;;
- esac
- done
- ;;
- prog)
- compile_deplibs=
- finalize_deplibs=
- alldeplibs=no
- newdlfiles=
- newdlprefiles=
- passes="conv scan dlopen dlpreopen link"
- ;;
- *) passes="conv"
- ;;
- esac
-
- for pass in $passes; do
- # The preopen pass in lib mode reverses $deplibs; put it back here
- # so that -L comes before libs that need it for instance...
- if test "$linkmode,$pass" = "lib,link"; then
- ## FIXME: Find the place where the list is rebuilt in the wrong
- ## order, and fix it there properly
- tmp_deplibs=
- for deplib in $deplibs; do
- tmp_deplibs="$deplib $tmp_deplibs"
- done
- deplibs="$tmp_deplibs"
- fi
-
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
- deplibs=
- fi
- if test "$linkmode" = prog; then
- case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
- link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
- esac
- fi
- if test "$linkmode,$pass" = "lib,dlpreopen"; then
- # Collect and forward deplibs of preopened libtool libs
- for lib in $dlprefiles; do
- # Ignore non-libtool-libs
- dependency_libs=
- case $lib in
- *.la) func_source "$lib" ;;
- esac
-
- # Collect preopened libtool deplibs, except any this library
- # has declared as weak libs
- for deplib in $dependency_libs; do
- deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"`
- case " $weak_libs " in
- *" $deplib_base "*) ;;
- *) deplibs="$deplibs $deplib" ;;
- esac
- done
- done
- libs="$dlprefiles"
- fi
- if test "$pass" = dlopen; then
- # Collect dlpreopened libraries
- save_deplibs="$deplibs"
- deplibs=
- fi
-
- for deplib in $libs; do
- lib=
- found=no
- case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- compiler_flags="$compiler_flags $deplib"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- func_warning "\`-l' is ignored for archives/objects"
- continue
- fi
- func_stripname '-l' '' "$deplib"
- name=$func_stripname_result
- if test "$linkmode" = lib; then
- searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
- else
- searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
- fi
- for searchdir in $searchdirs; do
- for search_ext in .la $std_shrext .so .a; do
- # Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
- if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
- else
- found=no
- fi
- break 2
- fi
- done
- done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
- # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
- # We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $deplib "*)
- if func_lalib_p "$lib"; then
- library_names=
- old_library=
- func_source "$lib"
- for l in $old_library $library_names; do
- ll="$l"
- done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
- lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- fi
- fi
- ;;
- *) ;;
- esac
- fi
- fi
- ;; # -l
- *.ltframework)
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- if test "$linkmode" = lib ; then
- case "$new_inherited_linker_flags " in
- *" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
- esac
- fi
- fi
- continue
- ;;
- -L*)
- case $linkmode in
- lib)
- deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
- newdependency_libs="$deplib $newdependency_libs"
- func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
- ;;
- prog)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- if test "$pass" = scan; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
- ;;
- *)
- func_warning "\`-L' is ignored for archives/objects"
- ;;
- esac # linkmode
- continue
- ;; # -L
- -R*)
- if test "$pass" = link; then
- func_stripname '-R' '' "$deplib"
- dir=$func_stripname_result
- # Make sure the xrpath contains only unique directories.
- case "$xrpath " in
- *" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
- esac
- fi
- deplibs="$deplib $deplibs"
- continue
- ;;
- *.la) lib="$deplib" ;;
- *.$libext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- continue
- fi
- case $linkmode in
- lib)
- # Linking convenience modules into shared libraries is allowed,
- # but linking other static libraries is non-portable.
- case " $dlpreconveniencelibs " in
- *" $deplib "*) ;;
- *)
- valid_a_lib=no
- case $deplibs_check_method in
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \
- | $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
- fi
- ;;
- pass_all)
- valid_a_lib=yes
- ;;
- esac
- if test "$valid_a_lib" != yes; then
- $ECHO
- $ECHO "*** Warning: Trying to link with static lib archive $deplib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because the file extensions .$libext of this argument makes me believe"
- $ECHO "*** that it is just a static archive that I should not use here."
- else
- $ECHO
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
- fi
- ;;
- esac
- continue
- ;;
- prog)
- if test "$pass" != link; then
- deplibs="$deplib $deplibs"
- else
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- fi
- continue
- ;;
- esac # linkmode
- ;; # *.$libext
- *.lo | *.$objext)
- if test "$pass" = conv; then
- deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
- # If there is no dlopen support or we're linking statically,
- # we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- newdlfiles="$newdlfiles $deplib"
- fi
- fi
- continue
- ;;
- %DEPLIBS%)
- alldeplibs=yes
- continue
- ;;
- esac # case $deplib
-
- if test "$found" = yes || test -f "$lib"; then :
- else
- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- fi
-
- # Check to see that this really is a libtool archive.
- func_lalib_unsafe_p "$lib" \
- || func_fatal_error "\`$lib' is not a valid libtool archive"
-
- func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
-
- dlname=
- dlopen=
- dlpreopen=
- libdir=
- library_names=
- old_library=
- inherited_linker_flags=
- # If the library was installed with an old release of libtool,
- # it will not redefine variables installed, or shouldnotlink
- installed=yes
- shouldnotlink=no
- avoidtemprpath=
-
-
- # Read the .la file
- func_source "$lib"
-
- # Convert "-framework foo" to "foo.ltframework"
- if test -n "$inherited_linker_flags"; then
- tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'`
- for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
- case " $new_inherited_linker_flags " in
- *" $tmp_inherited_linker_flag "*) ;;
- *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
- esac
- done
- fi
- dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
- fi
-
- if test "$pass" = conv; then
- # Only check for convenience libraries
- deplibs="$lib $deplibs"
- if test -z "$libdir"; then
- if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
- fi
- # It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
- fi
- tmp_libs=
- for deplib in $dependency_libs; do
- deplibs="$deplib $deplibs"
- if $opt_duplicate_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
- continue
- fi # $pass = conv
-
-
- # Get the name of the library we link against.
- linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
- if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
- fi
-
- # This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- fi
- if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
- # If there is no dlname, no dlopen support or we're linking
- # statically, we need to preload. We also need to preload any
- # dependent libraries so libltdl's deplib preloader doesn't
- # bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
- else
- newdlfiles="$newdlfiles $lib"
- fi
- continue
- fi # $pass = dlopen
-
- # We need an absolute path.
- case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
- *)
- abs_ladir=`cd "$ladir" && pwd`
- if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of \`$ladir'"
- func_warning "passing it literally to the linker, although it might fail"
- abs_ladir="$ladir"
- fi
- ;;
- esac
- func_basename "$lib"
- laname="$func_basename_result"
-
- # Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- func_warning "library \`$lib' was moved."
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
- else
- dir="$libdir"
- absdir="$libdir"
- fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
- else
- if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
- # Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
- fi
- fi # $installed = yes
- func_stripname 'lib' '.la' "$laname"
- name=$func_stripname_result
-
- # This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir" && test "$linkmode" = prog; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
- fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
- fi # $pass = dlpreopen
-
- if test -z "$libdir"; then
- # Link the convenience library
- if test "$linkmode" = lib; then
- deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$dir/$old_library $compile_deplibs"
- finalize_deplibs="$dir/$old_library $finalize_deplibs"
- else
- deplibs="$lib $deplibs" # used for prog,scan pass
- fi
- continue
- fi
-
-
- if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
- deplibs="$lib $deplibs"
-
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
- fi
-
- tmp_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
- ;;
- esac
- # Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
- deplibs="$deplib $deplibs"
- else
- # Need to hardcode shared library paths
- # or/and link against static libraries
- newdependency_libs="$deplib $newdependency_libs"
- fi
- if $opt_duplicate_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done # for deplib
- continue
- fi # $linkmode = prog...
-
- if test "$linkmode,$pass" = "prog,link"; then
- if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
- test -z "$old_library"; }; then
- # We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
- # Make sure the rpath contains only unique directories.
- case "$temp_rpath:" in
- *"$absdir:"*) ;;
- *) temp_rpath="$temp_rpath$absdir:" ;;
- esac
- fi
-
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi # $linkmode,$pass = prog,link...
-
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
- test -n "$library_names"; }; }; then
- # We only need to search for static libraries
- continue
- fi
- fi
-
- link_static=no # Whether the deplib will be linked statically
- use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes; then
- use_static_libs=no
- fi
- if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
- case $host in
- *cygwin* | *mingw* | *cegcc*)
- # No point in relinking DLLs because paths are not encoded
- notinst_deplibs="$notinst_deplibs $lib"
- need_relink=no
- ;;
- *)
- if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
- need_relink=yes
- fi
- ;;
- esac
- # This is a shared library
-
- # Warn about portability, can't link against -module's on some
- # systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=""
- for dlpremoduletest in $dlprefiles; do
- if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule="$dlpremoduletest"
- break
- fi
- done
- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
- $ECHO
- if test "$linkmode" = prog; then
- $ECHO "*** Warning: Linking the executable $output against the loadable module"
- else
- $ECHO "*** Warning: Linking the shared library $output against the loadable module"
- fi
- $ECHO "*** $linklib is not portable!"
- fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
- # Hardcode the library path.
- # Skip directories that are in the system default run-time
- # search path.
- case " $sys_lib_dlsearch_path " in
- *" $absdir "*) ;;
- *)
- case "$compile_rpath " in
- *" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
- esac
- ;;
- esac
- case " $sys_lib_dlsearch_path " in
- *" $libdir "*) ;;
- *)
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
- esac
- ;;
- esac
- fi
-
- if test -n "$old_archive_from_expsyms_cmds"; then
- # figure out the soname
- set dummy $library_names
- shift
- realname="$1"
- shift
- libname=`eval "\\$ECHO \"$libname_spec\""`
- # use dlname if we got it. it's perfectly good, no?
- if test -n "$dlname"; then
- soname="$dlname"
- elif test -n "$soname_spec"; then
- # bleh windows
- case $host in
- *cygwin* | mingw* | *cegcc*)
- func_arith $current - $age
- major=$func_arith_result
- versuffix="-$major"
- ;;
- esac
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
-
- # Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
- func_basename "$soroot"
- soname="$func_basename_result"
- func_stripname 'lib' '.dll' "$soname"
- newlib=libimp-$func_stripname_result.a
-
- # If the library has no export list, then create one now
- if test -f "$output_objdir/$soname-def"; then :
- else
- func_verbose "extracting exported symbol list from \`$soname'"
- func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
- fi
-
- # Create $newlib
- if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for \`$soname'"
- func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
- fi
- # make sure the library variables are pointing to the new library
- dir=$output_objdir
- linklib=$newlib
- fi # test -n "$old_archive_from_expsyms_cmds"
-
- if test "$linkmode" = prog || test "$mode" != relink; then
- add_shlibpath=
- add_dir=
- add=
- lib_linked=yes
- case $hardcode_action in
- immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
- case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
- *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
- *-*-darwin* )
- # if the lib is a (non-dlopened) module then we can not
- # link against it, someone is ignoring the earlier warnings
- if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null ; then
- if test "X$dlopenmodule" != "X$lib"; then
- $ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
- $ECHO
- $ECHO "*** And there doesn't seem to be a static archive available"
- $ECHO "*** The link will probably fail, sorry"
- else
- add="$dir/$old_library"
- fi
- elif test -n "$old_library"; then
- add="$dir/$old_library"
- fi
- fi
- esac
- elif test "$hardcode_minus_L" = no; then
- case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
- esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- relink)
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
- else
- lib_linked=no
- fi
- ;;
- *) lib_linked=no ;;
- esac
-
- if test "$lib_linked" != yes; then
- func_fatal_configuration "unsupported hardcode properties"
- fi
-
- if test -n "$add_shlibpath"; then
- case :$compile_shlibpath: in
- *":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
- esac
- fi
- if test "$linkmode" = prog; then
- test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
- test -n "$add" && compile_deplibs="$add $compile_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes &&
- test "$hardcode_minus_L" != yes &&
- test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- fi
- fi
- fi
-
- if test "$linkmode" = prog || test "$mode" = relink; then
- add_shlibpath=
- add_dir=
- add=
- # Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- case :$finalize_shlibpath: in
- *":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
- esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
- if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
- else
- add="$libdir/$linklib"
- fi
- else
- # We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
- # Try looking first in the location we're being installed to.
- if test -n "$inst_prefix_dir"; then
- case $libdir in
- [\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
- ;;
- esac
- fi
- add="-l$name"
- fi
-
- if test "$linkmode" = prog; then
- test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
- test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
- else
- test -n "$add_dir" && deplibs="$add_dir $deplibs"
- test -n "$add" && deplibs="$add $deplibs"
- fi
- fi
- elif test "$linkmode" = prog; then
- # Here we assume that one of hardcode_direct or hardcode_minus_L
- # is not unsupported. This is valid on all known static and
- # shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
- compile_deplibs="$dir/$linklib $compile_deplibs"
- finalize_deplibs="$dir/$linklib $finalize_deplibs"
- else
- compile_deplibs="-l$name -L$dir $compile_deplibs"
- finalize_deplibs="-l$name -L$dir $finalize_deplibs"
- fi
- elif test "$build_libtool_libs" = yes; then
- # Not a shared library
- if test "$deplibs_check_method" != pass_all; then
- # We're trying link a shared library against a static one
- # but the system doesn't support it.
-
- # Just print a warning and add the library to dependency_libs so
- # that the program can be linked against the static library.
- $ECHO
- $ECHO "*** Warning: This system can not link to static lib archive $lib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
- $ECHO "*** But as you try to build a module library, libtool will still create "
- $ECHO "*** a static module, that should work as long as the dlopening application"
- $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime."
- if test -z "$global_symbol_pipe"; then
- $ECHO
- $ECHO "*** However, this would only work if libtool was able to extract symbol"
- $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $ECHO "*** not find such a program. So, this module is probably useless."
- $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- else
- deplibs="$dir/$old_library $deplibs"
- link_static=yes
- fi
- fi # link shared/static library?
-
- if test "$linkmode" = lib; then
- if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
- # Extract -R from dependency_libs
- temp_deplibs=
- for libdir in $dependency_libs; do
- case $libdir in
- -R*) func_stripname '-R' '' "$libdir"
- temp_xrpath=$func_stripname_result
- case " $xrpath " in
- *" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
- esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
- esac
- done
- dependency_libs="$temp_deplibs"
- fi
-
- newlib_search_path="$newlib_search_path $absdir"
- # Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
- # ... and its dependency_libs
- tmp_libs=
- for deplib in $dependency_libs; do
- newdependency_libs="$deplib $newdependency_libs"
- if $opt_duplicate_deps ; then
- case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
- esac
- fi
- tmp_libs="$tmp_libs $deplib"
- done
-
- if test "$link_all_deplibs" != no; then
- # Add the search paths of all dependency libraries
- for deplib in $dependency_libs; do
- case $deplib in
- -L*) path="$deplib" ;;
- *.la)
- func_dirname "$deplib" "" "."
- dir="$func_dirname_result"
- # We need an absolute path.
- case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
- *)
- absdir=`cd "$dir" && pwd`
- if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of \`$dir'"
- absdir="$dir"
- fi
- ;;
- esac
- if $GREP "^installed=no" $deplib > /dev/null; then
- case $host in
- *-*-darwin*)
- depdepl=
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
- depdepl=$tmp
- done
- if test -f "$absdir/$objdir/$depdepl" ; then
- depdepl="$absdir/$objdir/$depdepl"
- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- if test -z "$darwin_install_name"; then
- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
- fi
- compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
- path=
- fi
- fi
- ;;
- *)
- path="-L$absdir/$objdir"
- ;;
- esac
- else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- test "$absdir" != "$libdir" && \
- func_warning "\`$deplib' seems to be moved"
-
- path="-L$absdir"
- fi
- ;;
- esac
- case " $deplibs " in
- *" $path "*) ;;
- *) deplibs="$path $deplibs" ;;
- esac
- done
- fi # link_all_deplibs != no
- fi # linkmode = lib
- done # for deplib in $libs
- if test "$pass" = link; then
- if test "$linkmode" = "prog"; then
- compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
- finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
- else
- compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- fi
- fi
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
- # Link the dlpreopened libraries before other libraries
- for deplib in $save_deplibs; do
- deplibs="$deplib $deplibs"
- done
- fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
- # Make sure lib_search_path contains only unique directories.
- lib_search_path=
- for dir in $newlib_search_path; do
- case "$lib_search_path " in
- *" $dir "*) ;;
- *) lib_search_path="$lib_search_path $dir" ;;
- esac
- done
- newlib_search_path=
- fi
-
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
- else
- vars="compile_deplibs finalize_deplibs"
- fi
- for var in $vars dependency_libs; do
- # Add libraries to $var in reverse order
- eval tmp_libs=\"\$$var\"
- new_libs=
- for deplib in $tmp_libs; do
- # FIXME: Pedantically, this is the right thing to do, so
- # that some nasty dependency loop isn't accidentally
- # broken:
- #new_libs="$deplib $new_libs"
- # Pragmatically, this seems to cause very few problems in
- # practice:
- case $deplib in
- -L*) new_libs="$deplib $new_libs" ;;
- -R*) ;;
- *)
- # And here is the reason: when a library appears more
- # than once as an explicit dependence of a library, or
- # is implicitly linked in more than once by the
- # compiler, it is considered special, and multiple
- # occurrences thereof are not removed. Compare this
- # with having the same library being listed as a
- # dependency of multiple other libraries: in this case,
- # we know (pedantically, we assume) the library does not
- # need to be listed more than once, so we keep only the
- # last copy. This is not always right, but it is rare
- # enough that we require users that really mean to play
- # such unportable linking tricks to link the library
- # using -Wl,-lname, so that libtool does not consider it
- # for duplicate removal.
- case " $specialdeplibs " in
- *" $deplib "*) new_libs="$deplib $new_libs" ;;
- *)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$deplib $new_libs" ;;
- esac
- ;;
- esac
- ;;
- esac
- done
- tmp_libs=
- for deplib in $new_libs; do
- case $deplib in
- -L*)
- case " $tmp_libs " in
- *" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
- esac
- done
- eval $var=\"$tmp_libs\"
- done # for var
- fi
- # Last step: remove runtime libs from dependency_libs
- # (they stay in deplibs)
- tmp_libs=
- for i in $dependency_libs ; do
- case " $predeps $postdeps $compiler_lib_search_path " in
- *" $i "*)
- i=""
- ;;
- esac
- if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
- fi
- done
- dependency_libs=$tmp_libs
- done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
- fi
- if test "$linkmode" = prog || test "$linkmode" = lib; then
- dlprefiles="$newdlprefiles"
- fi
-
- case $linkmode in
- oldlib)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for archives"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for archives" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for archives"
-
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for archives"
-
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for archives"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for archives"
-
- test -n "$export_symbols$export_symbols_regex" && \
- func_warning "\`-export-symbols' is ignored for archives"
-
- # Now set the variables for building old libraries.
- build_libtool_libs=no
- oldlibs="$output"
- objs="$objs$old_deplibs"
- ;;
-
- lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
- case $outputname in
- lib*)
- func_stripname 'lib' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- ;;
- *)
- test "$module" = no && \
- func_fatal_help "libtool library \`$output' must begin with \`lib'"
-
- if test "$need_lib_prefix" != no; then
- # Add the "lib" prefix for modules if required
- func_stripname '' '.la' "$outputname"
- name=$func_stripname_result
- eval shared_ext=\"$shrext_cmds\"
- eval libname=\"$libname_spec\"
- else
- func_stripname '' '.la' "$outputname"
- libname=$func_stripname_result
- fi
- ;;
- esac
-
- if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
- else
- $ECHO
- $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
- $ECHO "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
- fi
- fi
-
- test "$dlself" != no && \
- func_warning "\`-dlopen self' is ignored for libtool libraries"
-
- set dummy $rpath
- shift
- test "$#" -gt 1 && \
- func_warning "ignoring multiple \`-rpath's for a libtool library"
-
- install_libdir="$1"
-
- oldlibs=
- if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
- # Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
- # convenience libraries should have the same extension an
- # archive normally would.
- oldlibs="$output_objdir/$libname.$libext $oldlibs"
- build_libtool_libs=convenience
- build_old_libs=yes
- fi
-
- test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for convenience libraries"
- else
-
- # Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
- set dummy $vinfo 0 0 0
- shift
- IFS="$save_ifs"
-
- test -n "$7" && \
- func_fatal_help "too many parameters to \`-version-info'"
-
- # convert absolute version numbers to libtool ages
- # this retains compatibility with .la files and attempts
- # to make the code below a bit more comprehensible
-
- case $vinfo_number in
- yes)
- number_major="$1"
- number_minor="$2"
- number_revision="$3"
- #
- # There are really only two kinds -- those that
- # use the current revision as the major version
- # and those that subtract age and use age as
- # a minor version. But, then there is irix
- # which has an extra 1 added just for fun
- #
- case $version_type in
- darwin|linux|osf|windows|none)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age="$number_minor"
- revision="$number_revision"
- ;;
- freebsd-aout|freebsd-elf|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
- ;;
- irix|nonstopux)
- func_arith $number_major + $number_minor
- current=$func_arith_result
- age="$number_minor"
- revision="$number_minor"
- lt_irix_increment=no
- ;;
- esac
- ;;
- no)
- current="$1"
- revision="$2"
- age="$3"
- ;;
- esac
-
- # Check that each of the things are valid numbers.
- case $current in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "CURRENT \`$current' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- case $revision in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "REVISION \`$revision' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- case $age in
- 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
- *)
- func_error "AGE \`$age' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
- ;;
- esac
-
- if test "$age" -gt "$current"; then
- func_error "AGE \`$age' is greater than the current interface number \`$current'"
- func_fatal_error "\`$vinfo' is not valid version information"
- fi
-
- # Calculate the version variables.
- major=
- versuffix=
- verstring=
- case $version_type in
- none) ;;
-
- darwin)
- # Like Linux, but with the current version available in
- # verstring for coding it into the library header
- func_arith $current - $age
- major=.$func_arith_result
- versuffix="$major.$age.$revision"
- # Darwin ld doesn't like 0 for these options...
- func_arith $current + 1
- minor_current=$func_arith_result
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
- verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
- ;;
-
- freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
- ;;
-
- freebsd-elf)
- major=".$current"
- versuffix=".$current"
- ;;
-
- irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
- func_arith $current - $age
- else
- func_arith $current - $age + 1
- fi
- major=$func_arith_result
-
- case $version_type in
- nonstopux) verstring_prefix=nonstopux ;;
- *) verstring_prefix=sgi ;;
- esac
- verstring="$verstring_prefix$major.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$revision
- while test "$loop" -ne 0; do
- func_arith $revision - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring="$verstring_prefix$major.$iface:$verstring"
- done
-
- # Before this point, $major must not contain `.'.
- major=.$major
- versuffix="$major.$revision"
- ;;
-
- linux)
- func_arith $current - $age
- major=.$func_arith_result
- versuffix="$major.$age.$revision"
- ;;
-
- osf)
- func_arith $current - $age
- major=.$func_arith_result
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
-
- # Add in all the interfaces that we are compatible with.
- loop=$age
- while test "$loop" -ne 0; do
- func_arith $current - $loop
- iface=$func_arith_result
- func_arith $loop - 1
- loop=$func_arith_result
- verstring="$verstring:${iface}.0"
- done
-
- # Make executables depend on our current version.
- verstring="$verstring:${current}.0"
- ;;
-
- qnx)
- major=".$current"
- versuffix=".$current"
- ;;
-
- sunos)
- major=".$current"
- versuffix=".$current.$revision"
- ;;
-
- windows)
- # Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
- func_arith $current - $age
- major=$func_arith_result
- versuffix="-$major"
- ;;
-
- *)
- func_fatal_configuration "unknown library version type \`$version_type'"
- ;;
- esac
-
- # Clear the version info if we defaulted, and they specified a release.
- if test -z "$vinfo" && test -n "$release"; then
- major=
- case $version_type in
- darwin)
- # we can't check for "0.0" in archive_cmds due to quoting
- # problems, so we reset it completely
- verstring=
- ;;
- *)
- verstring="0.0"
- ;;
- esac
- if test "$need_version" = no; then
- versuffix=
- else
- versuffix=".0.0"
- fi
- fi
-
- # Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
- major=
- versuffix=
- verstring=""
- fi
-
- # Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- func_warning "undefined symbols not allowed in $host shared libraries"
- build_libtool_libs=no
- build_old_libs=yes
- fi
- else
- # Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
- fi
-
- fi
-
- func_generate_dlsyms "$libname" "$libname" "yes"
- libobjs="$libobjs $symfileobj"
- test "X$libobjs" = "X " && libobjs=
-
- if test "$mode" != relink; then
- # Remove our outputs, but don't remove object files since they
- # may have been created when compiling PIC objects.
- removelist=
- tempremovelist=`$ECHO "$output_objdir/*"`
- for p in $tempremovelist; do
- case $p in
- *.$objext | *.gcno)
- ;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
- if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
- then
- continue
- fi
- fi
- removelist="$removelist $p"
- ;;
- *) ;;
- esac
- done
- test -n "$removelist" && \
- func_show_eval "${RM}r \$removelist"
- fi
-
- # Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- oldlibs="$oldlibs $output_objdir/$libname.$libext"
-
- # Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
- fi
-
- # Eliminate all temporary directories.
- #for path in $notinst_path; do
- # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"`
- # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"`
- # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"`
- #done
-
- if test -n "$xrpath"; then
- # If the user specified any rpath flags, then add them.
- temp_xrpath=
- for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
- dependency_libs="$temp_xrpath $dependency_libs"
- fi
- fi
-
- # Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
- dlfiles=
- for lib in $old_dlfiles; do
- case " $dlprefiles $dlfiles " in
- *" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
- esac
- done
-
- # Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
- dlprefiles=
- for lib in $old_dlprefiles; do
- case "$dlprefiles " in
- *" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
- esac
- done
-
- if test "$build_libtool_libs" = yes; then
- if test -n "$rpath"; then
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*)
- # these systems don't actually have a c library (as such)!
- ;;
- *-*-rhapsody* | *-*-darwin1.[012])
- # Rhapsody C library is in the System framework
- deplibs="$deplibs System.ltframework"
- ;;
- *-*-netbsd*)
- # Don't link with libc until the a.out ld.so is fixed.
- ;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
- # Do not include libc due to us having libc/libc_r.
- ;;
- *-*-sco3.2v5* | *-*-sco5v6*)
- # Causes problems with __ctype
- ;;
- *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
- # Compiler inserts libc in the correct place for threads to work
- ;;
- *)
- # Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
- fi
- ;;
- esac
- fi
-
- # Transform deplibs into only deplibs that can be linked in shared.
- name_save=$name
- libname_save=$libname
- release_save=$release
- versuffix_save=$versuffix
- major_save=$major
- # I'm not sure if I'm treating the release correctly. I think
- # release should show up in the -l (ie -lgmp5) so we don't want to
- # add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
- newdeplibs=
- droppeddeps=no
- case $deplibs_check_method in
- pass_all)
- # Don't check for shared/static. Everything works.
- # This might be a little naive. We might want to check
- # whether the library exists or not. But this is on
- # osf3 & osf4 and I'm not really sure... Just
- # implementing what was already the behavior.
- newdeplibs=$deplibs
- ;;
- test_compile)
- # This code stresses the "libraries are programs" paradigm to its
- # limits. Maybe even breaks it. We compile a program, linking it
- # against the deplibs as a proxy for the library. Then we can check
- # whether they linked in statically or dynamically with ldd.
- $opt_dry_run || $RM conftest.c
- cat > conftest.c <<EOF
- int main() { return 0; }
-EOF
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
- ldd_output=`ldd conftest`
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $ECHO
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which I believe you do not have"
- $ECHO "*** because a test_compile did reveal that the linker did not use it for"
- $ECHO "*** its dynamic dependency list that programs get resolved with at runtime."
- fi
- fi
- ;;
- *)
- newdeplibs="$newdeplibs $i"
- ;;
- esac
- done
- else
- # Error occurred in the first compile. Let's try to salvage
- # the situation: Compile a separate program for each library.
- for i in $deplibs; do
- case $i in
- -l*)
- func_stripname -l '' "$i"
- name=$func_stripname_result
- $opt_dry_run || $RM conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
- ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $i "*)
- newdeplibs="$newdeplibs $i"
- i=""
- ;;
- esac
- fi
- if test -n "$i" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
- set dummy $deplib_matches; shift
- deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
- else
- droppeddeps=yes
- $ECHO
- $ECHO "*** Warning: dynamic linker does not accept needed library $i."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because a test_compile did reveal that the linker did not use this one"
- $ECHO "*** as a dynamic dependency that programs can get resolved with at runtime."
- fi
- fi
- else
- droppeddeps=yes
- $ECHO
- $ECHO "*** Warning! Library $i is needed by this library but I was not able to"
- $ECHO "*** make it link in! You will probably need to install it or some"
- $ECHO "*** library that it depends on before this library will be fully"
- $ECHO "*** functional. Installing it before continuing would be even better."
- fi
- ;;
- *)
- newdeplibs="$newdeplibs $i"
- ;;
- esac
- done
- fi
- ;;
- file_magic*)
- set dummy $deplibs_check_method; shift
- file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- # Follow soft links.
- if ls -lLd "$potent_lib" 2>/dev/null |
- $GREP " -> " >/dev/null; then
- continue
- fi
- # The statement above tries to avoid entering an
- # endless loop below, in case of cyclic links.
- # We might still enter an endless loop, since a link
- # loop can be closed while we follow links,
- # but so what?
- potlib="$potent_lib"
- while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
- case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
- esac
- done
- if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
- $SED -e 10q |
- $EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $ECHO
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a file magic. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- match_pattern*)
- set dummy $deplibs_check_method; shift
- match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
- for a_deplib in $deplibs; do
- case $a_deplib in
- -l*)
- func_stripname -l '' "$a_deplib"
- name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- case " $predeps $postdeps " in
- *" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- ;;
- esac
- fi
- if test -n "$a_deplib" ; then
- libname=`eval "\\$ECHO \"$libname_spec\""`
- for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
- for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
- if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \
- $EGREP "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
- a_deplib=""
- break 2
- fi
- done
- done
- fi
- if test -n "$a_deplib" ; then
- droppeddeps=yes
- $ECHO
- $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
- $ECHO "*** I have the capability to make that library automatically link in when"
- $ECHO "*** you link to this library. But I can only do this if you have a"
- $ECHO "*** shared version of the library, which you do not appear to have"
- $ECHO "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
- $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
- else
- $ECHO "*** with $libname and none of the candidates passed a file format test"
- $ECHO "*** using a regex pattern. Last file checked: $potlib"
- fi
- fi
- ;;
- *)
- # Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
- ;;
- esac
- done # Gone through all deplibs.
- ;;
- none | unknown | *)
- newdeplibs=""
- tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \
- -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
- # can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"`
- done
- fi
- if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' |
- $GREP . >/dev/null; then
- $ECHO
- if test "X$deplibs_check_method" = "Xnone"; then
- $ECHO "*** Warning: inter-library dependencies are not supported in this platform."
- else
- $ECHO "*** Warning: inter-library dependencies are not known to be supported."
- fi
- $ECHO "*** All declared inter-library dependencies are being dropped."
- droppeddeps=yes
- fi
- ;;
- esac
- versuffix=$versuffix_save
- major=$major_save
- release=$release_save
- libname=$libname_save
- name=$name_save
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library with the System framework
- newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
- $ECHO
- $ECHO "*** Warning: libtool could not satisfy all declared inter-library"
- $ECHO "*** dependencies of module $libname. Therefore, libtool will create"
- $ECHO "*** a static module, that should work as long as the dlopening"
- $ECHO "*** application is linked with the -dlopen flag."
- if test -z "$global_symbol_pipe"; then
- $ECHO
- $ECHO "*** However, this would only work if libtool was able to extract symbol"
- $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could"
- $ECHO "*** not find such a program. So, this module is probably useless."
- $ECHO "*** \`nm' from GNU binutils and a full rebuild may help."
- fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- else
- $ECHO "*** The inter-library dependencies that have been dropped here will be"
- $ECHO "*** automatically added whenever a program is linked with this library"
- $ECHO "*** or is declared to -dlopen it."
-
- if test "$allow_undefined" = no; then
- $ECHO
- $ECHO "*** Since this library must not contain undefined symbols,"
- $ECHO "*** because either the platform does not support them or"
- $ECHO "*** it was explicitly requested with -no-undefined,"
- $ECHO "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
- build_libtool_libs=module
- build_old_libs=yes
- else
- build_libtool_libs=no
- fi
- fi
- fi
- fi
- # Done checking deplibs!
- deplibs=$newdeplibs
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- case $host in
- *-*-darwin*)
- newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- deplibs="$new_libs"
-
- # All the library-specific variables (install_libdir is set above).
- library_names=
- old_library=
- dlname=
-
- # Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- if test "$hardcode_into_libs" = yes; then
- # Hardcode the library paths
- hardcode_libdirs=
- dep_rpath=
- rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
- for libdir in $rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
- fi
- if test -n "$runpath_var" && test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
- fi
- test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
- fi
-
- shlibpath="$finalize_shlibpath"
- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
- if test -n "$shlibpath"; then
- eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
- fi
-
- # Get the real and link names of the library.
- eval shared_ext=\"$shrext_cmds\"
- eval library_names=\"$library_names_spec\"
- set dummy $library_names
- shift
- realname="$1"
- shift
-
- if test -n "$soname_spec"; then
- eval soname=\"$soname_spec\"
- else
- soname="$realname"
- fi
- if test -z "$dlname"; then
- dlname=$soname
- fi
-
- lib="$output_objdir/$realname"
- linknames=
- for link
- do
- linknames="$linknames $link"
- done
-
- # Use standard objects if they are pic
- test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- test "X$libobjs" = "X " && libobjs=
-
- delfiles=
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols="$output_objdir/$libname.uexp"
- delfiles="$delfiles $export_symbols"
- fi
-
- orig_export_symbols=
- case $host_os in
- cygwin* | mingw* | cegcc*)
- if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
- # exporting using user supplied symfile
- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
- # and it's NOT already a .def file. Must figure out
- # which of the given symbols are data symbols and tag
- # them as such. So, trigger use of export_symbols_cmds.
- # export_symbols gets reassigned inside the "prepare
- # the list of exported symbols" if statement, so the
- # include_expsyms logic still works.
- orig_export_symbols="$export_symbols"
- export_symbols=
- always_export_symbols=yes
- fi
- fi
- ;;
- esac
-
- # Prepare the list of exported symbols
- if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- func_len " $cmd"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- func_show_eval "$cmd" 'exit $?'
- skipped_export=false
- else
- # The command line is too long to execute in one step.
- func_verbose "using reloadable object file for export list..."
- skipped_export=:
- # Break out early, otherwise skipped_export may be
- # set to false by a later but shorter cmd.
- break
- fi
- done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
- fi
-
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
-
- tmp_deplibs=
- for test_deplib in $deplibs; do
- case " $convenience " in
- *" $test_deplib "*) ;;
- *)
- tmp_deplibs="$tmp_deplibs $test_deplib"
- ;;
- esac
- done
- deplibs="$tmp_deplibs"
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec" &&
- test "$compiler_needs_object" = yes &&
- test -z "$libobjs"; then
- # extract the archives, so we have objects to list.
- # TODO: could optimize this to just extract one archive.
- whole_archive_flag_spec=
- fi
- if test -n "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- else
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
- fi
-
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
- eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
- fi
-
- # Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
- fi
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- eval test_cmds=\"$module_expsym_cmds\"
- cmds=$module_expsym_cmds
- else
- eval test_cmds=\"$module_cmds\"
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- eval test_cmds=\"$archive_expsym_cmds\"
- cmds=$archive_expsym_cmds
- else
- eval test_cmds=\"$archive_cmds\"
- cmds=$archive_cmds
- fi
- fi
-
- if test "X$skipped_export" != "X:" &&
- func_len " $test_cmds" &&
- len=$func_len_result &&
- test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- :
- else
- # The command line is too long to link in one step, link piecewise
- # or, if using GNU ld and skipped_export is not :, use a linker
- # script.
-
- # Save the value of $output and $libobjs because we want to
- # use them later. If we have whole_archive_flag_spec, we
- # want to use save_libobjs as it was before
- # whole_archive_flag_spec was expanded, because we can't
- # assume the linker understands whole_archive_flag_spec.
- # This may have to be revisited, in case too many
- # convenience libraries get linked in and end up exceeding
- # the spec.
- if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
- save_libobjs=$libobjs
- fi
- save_output=$output
- output_la=`$ECHO "X$output" | $Xsed -e "$basename"`
-
- # Clear the reloadable object creation command queue and
- # initialize k to one.
- test_cmds=
- concat_cmds=
- objlist=
- last_robj=
- k=1
-
- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- output=${output_objdir}/${output_la}.lnkscript
- func_verbose "creating GNU ld script: $output"
- $ECHO 'INPUT (' > $output
- for obj in $save_libobjs
- do
- $ECHO "$obj" >> $output
- done
- $ECHO ')' >> $output
- delfiles="$delfiles $output"
- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- output=${output_objdir}/${output_la}.lnk
- func_verbose "creating linker input file list: $output"
- : > $output
- set x $save_libobjs
- shift
- firstobj=
- if test "$compiler_needs_object" = yes; then
- firstobj="$1 "
- shift
- fi
- for obj
- do
- $ECHO "$obj" >> $output
- done
- delfiles="$delfiles $output"
- output=$firstobj\"$file_list_spec$output\"
- else
- if test -n "$save_libobjs"; then
- func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-${k}.$objext
- eval test_cmds=\"$reload_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
-
- # Loop over the list of objects to be linked.
- for obj in $save_libobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- if test "X$objlist" = X ||
- test "$len" -lt "$max_cmd_len"; then
- func_append objlist " $obj"
- else
- # The command $test_cmds is almost too long, add a
- # command to the queue.
- if test "$k" -eq 1 ; then
- # The first file doesn't have a previous command to add.
- eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
- else
- # All subsequent reloadable object files will link in
- # the last one created.
- eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\"
- fi
- last_robj=$output_objdir/$output_la-${k}.$objext
- func_arith $k + 1
- k=$func_arith_result
- output=$output_objdir/$output_la-${k}.$objext
- objlist=$obj
- func_len " $last_robj"
- func_arith $len0 + $func_len_result
- len=$func_arith_result
- fi
- done
- # Handle the remaining objects by creating one last
- # reloadable object file. All subsequent reloadable object
- # files will link in the last one created.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
- fi
- delfiles="$delfiles $output"
-
- else
- output=
- fi
-
- if ${skipped_export-false}; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
- $opt_dry_run || $RM $export_symbols
- libobjs=$output
- # Append the command to create the export file.
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
- if test -n "$last_robj"; then
- eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
- fi
- fi
-
- test -n "$save_libobjs" &&
- func_verbose "creating a temporary reloadable object file: $output"
-
- # Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
- for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- if test -n "$export_symbols_regex" && ${skipped_export-false}; then
- func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
- func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
- fi
- fi
-
- if ${skipped_export-false}; then
- if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
- $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"'
- fi
-
- if test -n "$orig_export_symbols"; then
- # The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
- # FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
- # though. Also, the filter scales superlinearly with the number of
- # global variables. join(1) would be nice here, but unfortunately
- # isn't a blessed tool.
- $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
- export_symbols=$output_objdir/$libname.def
- $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
- fi
- fi
-
- libobjs=$output
- # Restore the value of output.
- output=$save_output
-
- if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
- eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
- test "X$libobjs" = "X " && libobjs=
- fi
- # Expand the library linking commands again to reset the
- # value of $libobjs for piecewise linking.
-
- # Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
- if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
- cmds=$module_expsym_cmds
- else
- cmds=$module_cmds
- fi
- else
- if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
- cmds=$archive_expsym_cmds
- else
- cmds=$archive_cmds
- fi
- fi
- fi
-
- if test -n "$delfiles"; then
- # Append the command to remove temporary files to $cmds.
- eval cmds=\"\$cmds~\$RM $delfiles\"
- fi
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $dlprefiles
- libobjs="$libobjs $func_extract_archives_result"
- test "X$libobjs" = "X " && libobjs=
- fi
-
- save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
- IFS="$save_ifs"
- eval cmd=\"$cmd\"
- $opt_silent || {
- func_quote_for_expand "$cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
- $opt_dry_run || eval "$cmd" || {
- lt_exit=$?
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- ( cd "$output_objdir" && \
- $RM "${realname}T" && \
- $MV "${realname}U" "$realname" )
- fi
-
- exit $lt_exit
- }
- done
- IFS="$save_ifs"
-
- # Restore the uninstalled library and exit
- if test "$mode" = relink; then
- $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
-
- if test -n "$convenience"; then
- if test -z "$whole_archive_flag_spec"; then
- func_show_eval '${RM}r "$gentop"'
- fi
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- # Create links to the real library.
- for linkname in $linknames; do
- if test "$realname" != "$linkname"; then
- func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
- fi
- done
-
- # If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
- # On all known operating systems, these are identical.
- dlname="$soname"
- fi
- fi
- ;;
-
- obj)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for objects"
- fi
-
- case " $deplibs" in
- *\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for objects" ;;
- esac
-
- test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for objects"
-
- test -n "$xrpath" && \
- func_warning "\`-R' is ignored for objects"
-
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for objects"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for objects"
-
- case $output in
- *.lo)
- test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object \`$output' from non-libtool objects"
-
- libobj=$output
- func_lo2o "$libobj"
- obj=$func_lo2o_result
- ;;
- *)
- libobj=
- obj="$output"
- ;;
- esac
-
- # Delete the old objects.
- $opt_dry_run || $RM $obj $libobj
-
- # Objects from convenience libraries. This assumes
- # single-version convenience libraries. Whenever we create
- # different ones for PIC/non-PIC, this we'll have to duplicate
- # the extraction.
- reload_conv_objs=
- gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
- wl=
-
- if test -n "$convenience"; then
- if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
- else
- gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $convenience
- reload_conv_objs="$reload_objs $func_extract_archives_result"
- fi
- fi
-
- # Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
-
- output="$obj"
- func_execute_cmds "$reload_cmds" 'exit $?'
-
- # Exit if we aren't doing a library object file.
- if test -z "$libobj"; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- fi
-
- if test "$build_libtool_libs" != yes; then
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- # Create an invalid libtool object if no PIC, so that we don't
- # accidentally link it into a program.
- # $show "echo timestamp > $libobj"
- # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
- exit $EXIT_SUCCESS
- fi
-
- if test -n "$pic_flag" || test "$pic_mode" != default; then
- # Only do commands if we really have different PIC objects.
- reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
- func_execute_cmds "$reload_cmds" 'exit $?'
- fi
-
- if test -n "$gentop"; then
- func_show_eval '${RM}r "$gentop"'
- fi
-
- exit $EXIT_SUCCESS
- ;;
-
- prog)
- case $host in
- *cygwin*) func_stripname '' '.exe' "$output"
- output=$func_stripname_result.exe;;
- esac
- test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for programs"
-
- test -n "$release" && \
- func_warning "\`-release' is ignored for programs"
-
- test "$preload" = yes \
- && test "$dlopen_support" = unknown \
- && test "$dlopen_self" = unknown \
- && test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
-
- case $host in
- *-*-rhapsody* | *-*-darwin1.[012])
- # On Rhapsody replace the C library is the System framework
- compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'`
- ;;
- esac
-
- case $host in
- *-*-darwin*)
- # Don't allow lazy linking, it breaks C++ global constructors
- # But is supposedly fixed on 10.4 or later (yay!).
- if test "$tagname" = CXX ; then
- case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
- 10.[0123])
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
- ;;
- esac
- fi
- # Time to change all our "foo.ltframework" stuff back to "-framework foo"
- compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'`
- ;;
- esac
-
-
- # move library search paths that coincide with paths to not yet
- # installed libraries to the beginning of the library search list
- new_libs=
- for path in $notinst_path; do
- case " $new_libs " in
- *" -L$path/$objdir "*) ;;
- *)
- case " $compile_deplibs " in
- *" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
- esac
- ;;
- esac
- done
- for deplib in $compile_deplibs; do
- case $deplib in
- -L*)
- case " $new_libs " in
- *" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- ;;
- *) new_libs="$new_libs $deplib" ;;
- esac
- done
- compile_deplibs="$new_libs"
-
-
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
-
- if test -n "$rpath$xrpath"; then
- # If the user specified any rpath flags, then add them.
- for libdir in $rpath $xrpath; do
- # This is the magic to use -rpath.
- case "$finalize_rpath " in
- *" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
- esac
- done
- fi
-
- # Now hardcode the library paths
- rpath=
- hardcode_libdirs=
- for libdir in $compile_rpath $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$perm_rpath " in
- *" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
- esac
- fi
- case $host in
- *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
- case :$dllsearchpath: in
- *":$libdir:"*) ;;
- ::) dllsearchpath=$libdir;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
- esac
- case :$dllsearchpath: in
- *":$testbindir:"*) ;;
- ::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
- esac
- ;;
- esac
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- compile_rpath="$rpath"
-
- rpath=
- hardcode_libdirs=
- for libdir in $finalize_rpath; do
- if test -n "$hardcode_libdir_flag_spec"; then
- if test -n "$hardcode_libdir_separator"; then
- if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
- else
- # Just accumulate the unique libdirs.
- case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
- *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
- ;;
- *)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
- ;;
- esac
- fi
- else
- eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
- fi
- elif test -n "$runpath_var"; then
- case "$finalize_perm_rpath " in
- *" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
- esac
- fi
- done
- # Substitute the hardcoded libdirs into the rpath.
- if test -n "$hardcode_libdir_separator" &&
- test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
- eval rpath=\" $hardcode_libdir_flag_spec\"
- fi
- finalize_rpath="$rpath"
-
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
- # Transform all the library objects into standard objects.
- compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
- fi
-
- func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
-
- # template prelinking step
- if test -n "$prelink_cmds"; then
- func_execute_cmds "$prelink_cmds" 'exit $?'
- fi
-
- wrappers_required=yes
- case $host in
- *cygwin* | *mingw* )
- if test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- *cegcc)
- # Disable wrappers for cegcc, we are cross compiling anyway.
- wrappers_required=no
- ;;
- *)
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
- ;;
- esac
- if test "$wrappers_required" = no; then
- # Replace the output file specification.
- compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
-
- # We have no uninstalled library dependencies, so finalize right now.
- exit_status=0
- func_show_eval "$link_command" 'exit_status=$?'
-
- # Delete the generated files.
- if test -f "$output_objdir/${outputname}S.${objext}"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
- fi
-
- exit $exit_status
- fi
-
- if test -n "$compile_shlibpath$finalize_shlibpath"; then
- compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
- fi
- if test -n "$finalize_shlibpath"; then
- finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
- fi
-
- compile_var=
- finalize_var=
- if test -n "$runpath_var"; then
- if test -n "$perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $perm_rpath; do
- rpath="$rpath$dir:"
- done
- compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- if test -n "$finalize_perm_rpath"; then
- # We should set the runpath_var.
- rpath=
- for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
- done
- finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
- fi
- fi
-
- if test "$no_install" = yes; then
- # We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
- # Replace the output file specification.
- link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
- # Delete the old output file.
- $opt_dry_run || $RM $output
- # Link the executable and exit
- func_show_eval "$link_command" 'exit $?'
- exit $EXIT_SUCCESS
- fi
-
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
-
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "\`$output' will be relinked during installation"
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
-
- # Replace the output file specification.
- link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
-
- # Delete the old output files.
- $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
-
- func_show_eval "$link_command" 'exit $?'
-
- # Now create the wrapper script.
- func_verbose "creating $output"
-
- # Quote the relink command for shipping.
- if test -n "$relink_command"; then
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Quote $ECHO for shipping.
- if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then
- case $progpath in
- [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
- *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
- esac
- qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"`
- else
- qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"`
- fi
-
- # Only actually do things if not in dry run mode.
- $opt_dry_run || {
- # win32 will think the script is a binary if it has
- # a .exe suffix, so we strip it off here.
- case $output in
- *.exe) func_stripname '' '.exe' "$output"
- output=$func_stripname_result ;;
- esac
- # test for cygwin because mv fails w/o .exe extensions
- case $host in
- *cygwin*)
- exeext=.exe
- func_stripname '' '.exe' "$outputname"
- outputname=$func_stripname_result ;;
- *) exeext= ;;
- esac
- case $host in
- *cygwin* | *mingw* )
- func_dirname_and_basename "$output" "" "."
- output_name=$func_basename_result
- output_path=$func_dirname_result
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
- $RM $cwrappersource $cwrapper
- trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_cwrapperexe_src > $cwrappersource
-
- # The wrapper executable is built using the $host compiler,
- # because it contains $host paths and files. If cross-
- # compiling, it, like the target executable, must be
- # executed on the $host or under an emulation environment.
- $opt_dry_run || {
- $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
- $STRIP $cwrapper
- }
-
- # Now, create the wrapper script for func_source use:
- func_ltwrapper_scriptname $cwrapper
- $RM $func_ltwrapper_scriptname_result
- trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
- $opt_dry_run || {
- # note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host" ; then
- $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
- else
- func_emit_wrapper no > $func_ltwrapper_scriptname_result
- fi
- }
- ;;
- * )
- $RM $output
- trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
-
- func_emit_wrapper no > $output
- chmod +x $output
- ;;
- esac
- }
- exit $EXIT_SUCCESS
- ;;
- esac
-
- # See if we need to build an old-fashioned archive.
- for oldlib in $oldlibs; do
-
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save $symfileobj"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
- build_libtool_libs=no
- else
- oldobjs="$old_deplibs $non_pic_objects"
- if test "$preload" = yes && test -f "$symfileobj"; then
- oldobjs="$oldobjs $symfileobj"
- fi
- fi
- addlibs="$old_convenience"
- fi
-
- if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
- fi
-
- # Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
- cmds=$old_archive_from_new_cmds
- else
-
- # Add any objects from preloaded convenience libraries
- if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
-
- func_extract_archives $gentop $dlprefiles
- oldobjs="$oldobjs $func_extract_archives_result"
- fi
-
- # POSIX demands no paths to be encoded in archives. We have
- # to avoid creating archives with duplicate basenames if we
- # might have to extract them afterwards, e.g., when creating a
- # static archive out of a convenience library, or when linking
- # the entirety of a libtool archive into another (currently
- # not supported by libtool).
- if (for obj in $oldobjs
- do
- func_basename "$obj"
- $ECHO "$func_basename_result"
- done | sort | sort -uc >/dev/null 2>&1); then
- :
- else
- $ECHO "copying selected object files to avoid basename conflicts..."
- gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
- func_mkdir_p "$gentop"
- save_oldobjs=$oldobjs
- oldobjs=
- counter=1
- for obj in $save_oldobjs
- do
- func_basename "$obj"
- objbase="$func_basename_result"
- case " $oldobjs " in
- " ") oldobjs=$obj ;;
- *[\ /]"$objbase "*)
- while :; do
- # Make sure we don't pick an alternate name that also
- # overlaps.
- newobj=lt$counter-$objbase
- func_arith $counter + 1
- counter=$func_arith_result
- case " $oldobjs " in
- *[\ /]"$newobj "*) ;;
- *) if test ! -f "$gentop/$newobj"; then break; fi ;;
- esac
- done
- func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
- ;;
- *) oldobjs="$oldobjs $obj" ;;
- esac
- done
- fi
- eval cmds=\"$old_archive_cmds\"
-
- func_len " $cmds"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
- cmds=$old_archive_cmds
- else
- # the command line is too long to link in one step, link in parts
- func_verbose "using piecewise archive linking..."
- save_RANLIB=$RANLIB
- RANLIB=:
- objlist=
- concat_cmds=
- save_oldobjs=$oldobjs
- oldobjs=
- # Is there a better way of finding the last object in the list?
- for obj in $save_oldobjs
- do
- last_oldobj=$obj
- done
- eval test_cmds=\"$old_archive_cmds\"
- func_len " $test_cmds"
- len0=$func_len_result
- len=$len0
- for obj in $save_oldobjs
- do
- func_len " $obj"
- func_arith $len + $func_len_result
- len=$func_arith_result
- func_append objlist " $obj"
- if test "$len" -lt "$max_cmd_len"; then
- :
- else
- # the above command should be used before it gets too long
- oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
- RANLIB=$save_RANLIB
- fi
- test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
- objlist=
- len=$len0
- fi
- done
- RANLIB=$save_RANLIB
- oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
- eval cmds=\"\$concat_cmds\"
- else
- eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
- fi
- fi
- fi
- func_execute_cmds "$cmds" 'exit $?'
- done
-
- test -n "$generated" && \
- func_show_eval "${RM}r$generated"
-
- # Now create the libtool archive.
- case $output in
- *.la)
- old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
- func_verbose "creating $output"
-
- # Preserve any variables that may affect compiler behavior
- for var in $variables_saved_for_relink; do
- if eval test -z \"\${$var+set}\"; then
- relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
- elif eval var_value=\$$var; test -z "$var_value"; then
- relink_command="$var=; export $var; $relink_command"
- else
- func_quote_for_eval "$var_value"
- relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
- fi
- done
- # Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
- relink_command=
- fi
-
- # Only create the output if not a dry run.
- $opt_dry_run || {
- for installed in no yes; do
- if test "$installed" = yes; then
- if test -z "$install_libdir"; then
- break
- fi
- output="$output_objdir/$outputname"i
- # Replace all uninstalled libtool libraries with the installed ones
- newdependency_libs=
- for deplib in $dependency_libs; do
- case $deplib in
- *.la)
- func_basename "$deplib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
- test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
- newdependency_libs="$newdependency_libs $libdir/$name"
- ;;
- *) newdependency_libs="$newdependency_libs $deplib" ;;
- esac
- done
- dependency_libs="$newdependency_libs"
- newdlfiles=
-
- for lib in $dlfiles; do
- case $lib in
- *.la)
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlfiles="$newdlfiles $libdir/$name"
- ;;
- *) newdlfiles="$newdlfiles $lib" ;;
- esac
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- *.la)
- # Only pass preopened files to the pseudo-archive (for
- # eventual linking with the app. that links it) if we
- # didn't already link the preopened objects directly into
- # the library:
- func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
- test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlprefiles="$newdlprefiles $libdir/$name"
- ;;
- esac
- done
- dlprefiles="$newdlprefiles"
- else
- newdlfiles=
- for lib in $dlfiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlfiles="$newdlfiles $abs"
- done
- dlfiles="$newdlfiles"
- newdlprefiles=
- for lib in $dlprefiles; do
- case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
- *) abs=`pwd`"/$lib" ;;
- esac
- newdlprefiles="$newdlprefiles $abs"
- done
- dlprefiles="$newdlprefiles"
- fi
- $RM $output
- # place dlname in correct position for cygwin
- tdlname=$dlname
- case $host,$output,$installed,$module,$dlname in
- *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
- esac
- $ECHO > $output "\
-# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='$tdlname'
-
-# Names of this library.
-library_names='$library_names'
-
-# The name of the static archive.
-old_library='$old_library'
-
-# Linker flags that can not go in dependency_libs.
-inherited_linker_flags='$new_inherited_linker_flags'
-
-# Libraries that this one depends upon.
-dependency_libs='$dependency_libs'
-
-# Names of additional weak libraries provided by this library
-weak_library_names='$weak_libs'
-
-# Version information for $libname.
-current=$current
-age=$age
-revision=$revision
-
-# Is this an already installed library?
-installed=$installed
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=$module
-
-# Files to dlopen/dlpreopen
-dlopen='$dlfiles'
-dlpreopen='$dlprefiles'
-
-# Directory that this library needs to be installed in:
-libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
- $ECHO >> $output "\
-relink_command=\"$relink_command\""
- fi
- done
- }
-
- # Do a symbolic link so that the libtool archive can be found in
- # LD_LIBRARY_PATH before the program is installed.
- func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
- ;;
- esac
- exit $EXIT_SUCCESS
-}
-
-{ test "$mode" = link || test "$mode" = relink; } &&
- func_mode_link ${1+"$@"}
-
-
-# func_mode_uninstall arg...
-func_mode_uninstall ()
-{
- $opt_debug
- RM="$nonopt"
- files=
- rmforce=
- exit_status=0
-
- # This variable tells wrapper scripts just to set variables rather
- # than running their programs.
- libtool_install_magic="$magic"
-
- for arg
- do
- case $arg in
- -f) RM="$RM $arg"; rmforce=yes ;;
- -*) RM="$RM $arg" ;;
- *) files="$files $arg" ;;
- esac
- done
-
- test -z "$RM" && \
- func_fatal_help "you must specify an RM program"
-
- rmdirs=
-
- origobjdir="$objdir"
- for file in $files; do
- func_dirname "$file" "" "."
- dir="$func_dirname_result"
- if test "X$dir" = X.; then
- objdir="$origobjdir"
- else
- objdir="$dir/$origobjdir"
- fi
- func_basename "$file"
- name="$func_basename_result"
- test "$mode" = uninstall && objdir="$dir"
-
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
- case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
- esac
- fi
-
- # Don't error if the file doesn't exist and rm -f was used.
- if { test -L "$file"; } >/dev/null 2>&1 ||
- { test -h "$file"; } >/dev/null 2>&1 ||
- test -f "$file"; then
- :
- elif test -d "$file"; then
- exit_status=1
- continue
- elif test "$rmforce" = yes; then
- continue
- fi
-
- rmfiles="$file"
-
- case $name in
- *.la)
- # Possibly a libtool archive, so verify it.
- if func_lalib_p "$file"; then
- func_source $dir/$name
-
- # Delete the libtool libraries and symlinks.
- for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
- done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
-
- case "$mode" in
- clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
- *" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
- esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
- ;;
- uninstall)
- if test -n "$library_names"; then
- # Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
- fi
-
- if test -n "$old_library"; then
- # Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
- fi
- # FIXME: should reinstall the best remaining shared library.
- ;;
- esac
- fi
- ;;
-
- *.lo)
- # Possibly a libtool object, so verify it.
- if func_lalib_p "$file"; then
-
- # Read the .lo file
- func_source $dir/$name
-
- # Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
- fi
-
- # Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" &&
- test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
- fi
- fi
- ;;
-
- *)
- if test "$mode" = clean ; then
- noexename=$name
- case $file in
- *.exe)
- func_stripname '' '.exe' "$file"
- file=$func_stripname_result
- func_stripname '' '.exe' "$name"
- noexename=$func_stripname_result
- # $file with .exe has already been added to rmfiles,
- # add $file without .exe
- rmfiles="$rmfiles $file"
- ;;
- esac
- # Do a test to see if this is a libtool program.
- if func_ltwrapper_p "$file"; then
- if func_ltwrapper_executable_p "$file"; then
- func_ltwrapper_scriptname "$file"
- relink_command=
- func_source $func_ltwrapper_scriptname_result
- rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
- else
- relink_command=
- func_source $dir/$noexename
- fi
-
- # note $name still contains .exe if it was in $file originally
- # as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
- fi
- if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
- fi
- fi
- fi
- ;;
- esac
- func_show_eval "$RM $rmfiles" 'exit_status=1'
- done
- objdir="$origobjdir"
-
- # Try to remove the ${objdir}s in the directories where we deleted files
- for dir in $rmdirs; do
- if test -d "$dir"; then
- func_show_eval "rmdir $dir >/dev/null 2>&1"
- fi
- done
-
- exit $exit_status
-}
-
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
- func_mode_uninstall ${1+"$@"}
-
-test -z "$mode" && {
- help="$generic_help"
- func_fatal_help "you must specify a MODE"
-}
-
-test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$mode'"
-
-if test -n "$exec_cmd"; then
- eval exec "$exec_cmd"
- exit $EXIT_FAILURE
-fi
-
-exit $exit_status
-
-
-# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
-# choices, we go for a static library, that is the most portable,
-# since we can't tell whether shared libraries were disabled because
-# the user asked for that or because the platform doesn't support
-# them. This is particularly important on AIX, because we don't
-# support having both static and shared libraries enabled at the same
-# time on that platform, so we default to a shared-only configuration.
-# If a disable-shared tag is given, we'll fallback to a static-only
-# configuration. But we'll never go from static-only to shared-only.
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
-# ### END LIBTOOL TAG CONFIG: disable-shared
-
-# ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
-# ### END LIBTOOL TAG CONFIG: disable-static
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
-# vi:sw=2
-
diff --git a/toolkit/crashreporter/google-breakpad/autotools/missing b/toolkit/crashreporter/google-breakpad/autotools/missing
deleted file mode 100755
index f62bbae306..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/missing
+++ /dev/null
@@ -1,215 +0,0 @@
-#! /bin/sh
-# Common wrapper for a few potentially missing GNU programs.
-
-scriptversion=2013-10-28.13; # UTC
-
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
-# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-if test $# -eq 0; then
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
-fi
-
-case $1 in
-
- --is-lightweight)
- # Used by our autoconf macros to check whether the available missing
- # script is modern enough.
- exit 0
- ;;
-
- --run)
- # Back-compat with the calling convention used by older automake.
- shift
- ;;
-
- -h|--h|--he|--hel|--help)
- echo "\
-$0 [OPTION]... PROGRAM [ARGUMENT]...
-
-Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
-to PROGRAM being missing or too old.
-
-Options:
- -h, --help display this help and exit
- -v, --version output version information and exit
-
-Supported PROGRAM values:
- aclocal autoconf autoheader autom4te automake makeinfo
- bison yacc flex lex help2man
-
-Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
-'g' are ignored when checking the name.
-
-Send bug reports to <bug-automake@gnu.org>."
- exit $?
- ;;
-
- -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing $scriptversion (GNU Automake)"
- exit $?
- ;;
-
- -*)
- echo 1>&2 "$0: unknown '$1' option"
- echo 1>&2 "Try '$0 --help' for more information"
- exit 1
- ;;
-
-esac
-
-# Run the given program, remember its exit status.
-"$@"; st=$?
-
-# If it succeeded, we are done.
-test $st -eq 0 && exit 0
-
-# Also exit now if we it failed (or wasn't found), and '--version' was
-# passed; such an option is passed most likely to detect whether the
-# program is present and works.
-case $2 in --version|--help) exit $st;; esac
-
-# Exit code 63 means version mismatch. This often happens when the user
-# tries to use an ancient version of a tool on a file that requires a
-# minimum version.
-if test $st -eq 63; then
- msg="probably too old"
-elif test $st -eq 127; then
- # Program was missing.
- msg="missing on your system"
-else
- # Program was found and executed, but failed. Give up.
- exit $st
-fi
-
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
-
-program_details ()
-{
- case $1 in
- aclocal|automake)
- echo "The '$1' program is part of the GNU Automake package:"
- echo "<$gnu_software_URL/automake>"
- echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/autoconf>"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- autoconf|autom4te|autoheader)
- echo "The '$1' program is part of the GNU Autoconf package:"
- echo "<$gnu_software_URL/autoconf/>"
- echo "It also requires GNU m4 and Perl in order to run:"
- echo "<$gnu_software_URL/m4/>"
- echo "<$perl_URL>"
- ;;
- esac
-}
-
-give_advice ()
-{
- # Normalize program name to check for.
- normalized_program=`echo "$1" | sed '
- s/^gnu-//; t
- s/^gnu//; t
- s/^g//; t'`
-
- printf '%s\n' "'$1' is $msg."
-
- configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
- case $normalized_program in
- autoconf*)
- echo "You should only need it if you modified 'configure.ac',"
- echo "or m4 files included by it."
- program_details 'autoconf'
- ;;
- autoheader*)
- echo "You should only need it if you modified 'acconfig.h' or"
- echo "$configure_deps."
- program_details 'autoheader'
- ;;
- automake*)
- echo "You should only need it if you modified 'Makefile.am' or"
- echo "$configure_deps."
- program_details 'automake'
- ;;
- aclocal*)
- echo "You should only need it if you modified 'acinclude.m4' or"
- echo "$configure_deps."
- program_details 'aclocal'
- ;;
- autom4te*)
- echo "You might have modified some maintainer files that require"
- echo "the 'autom4te' program to be rebuilt."
- program_details 'autom4te'
- ;;
- bison*|yacc*)
- echo "You should only need it if you modified a '.y' file."
- echo "You may want to install the GNU Bison package:"
- echo "<$gnu_software_URL/bison/>"
- ;;
- lex*|flex*)
- echo "You should only need it if you modified a '.l' file."
- echo "You may want to install the Fast Lexical Analyzer package:"
- echo "<$flex_URL>"
- ;;
- help2man*)
- echo "You should only need it if you modified a dependency" \
- "of a man page."
- echo "You may want to install the GNU Help2man package:"
- echo "<$gnu_software_URL/help2man/>"
- ;;
- makeinfo*)
- echo "You should only need it if you modified a '.texi' file, or"
- echo "any other file indirectly affecting the aspect of the manual."
- echo "You might want to install the Texinfo package:"
- echo "<$gnu_software_URL/texinfo/>"
- echo "The spurious makeinfo call might also be the consequence of"
- echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
- echo "want to install GNU make:"
- echo "<$gnu_software_URL/make/>"
- ;;
- *)
- echo "You might have modified some files without having the proper"
- echo "tools for further handling them. Check the 'README' file, it"
- echo "often tells you about the needed prerequisites for installing"
- echo "this package. You may also peek at any GNU archive site, in"
- echo "case some other package contains this missing '$1' program."
- ;;
- esac
-}
-
-give_advice "$1" | sed -e '1s/^/WARNING: /' \
- -e '2,$s/^/ /' >&2
-
-# Propagate the correct exit status (expected to be 127 for a program
-# not found, 63 for a program that failed due to version mismatch).
-exit $st
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/autotools/test-driver b/toolkit/crashreporter/google-breakpad/autotools/test-driver
deleted file mode 100755
index 8e575b017d..0000000000
--- a/toolkit/crashreporter/google-breakpad/autotools/test-driver
+++ /dev/null
@@ -1,148 +0,0 @@
-#! /bin/sh
-# test-driver - basic testsuite driver script.
-
-scriptversion=2013-07-13.22; # UTC
-
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-# Make unconditional expansion of undefined variables an error. This
-# helps a lot in preventing typo-related bugs.
-set -u
-
-usage_error ()
-{
- echo "$0: $*" >&2
- print_usage >&2
- exit 2
-}
-
-print_usage ()
-{
- cat <<END
-Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--]
- TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
-The '--test-name', '--log-file' and '--trs-file' options are mandatory.
-END
-}
-
-test_name= # Used for reporting.
-log_file= # Where to save the output of the test script.
-trs_file= # Where to save the metadata of the test run.
-expect_failure=no
-color_tests=no
-enable_hard_errors=yes
-while test $# -gt 0; do
- case $1 in
- --help) print_usage; exit $?;;
- --version) echo "test-driver $scriptversion"; exit $?;;
- --test-name) test_name=$2; shift;;
- --log-file) log_file=$2; shift;;
- --trs-file) trs_file=$2; shift;;
- --color-tests) color_tests=$2; shift;;
- --expect-failure) expect_failure=$2; shift;;
- --enable-hard-errors) enable_hard_errors=$2; shift;;
- --) shift; break;;
- -*) usage_error "invalid option: '$1'";;
- *) break;;
- esac
- shift
-done
-
-missing_opts=
-test x"$test_name" = x && missing_opts="$missing_opts --test-name"
-test x"$log_file" = x && missing_opts="$missing_opts --log-file"
-test x"$trs_file" = x && missing_opts="$missing_opts --trs-file"
-if test x"$missing_opts" != x; then
- usage_error "the following mandatory options are missing:$missing_opts"
-fi
-
-if test $# -eq 0; then
- usage_error "missing argument"
-fi
-
-if test $color_tests = yes; then
- # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'.
- red='' # Red.
- grn='' # Green.
- lgn='' # Light green.
- blu='' # Blue.
- mgn='' # Magenta.
- std='' # No color.
-else
- red= grn= lgn= blu= mgn= std=
-fi
-
-do_exit='rm -f $log_file $trs_file; (exit $st); exit $st'
-trap "st=129; $do_exit" 1
-trap "st=130; $do_exit" 2
-trap "st=141; $do_exit" 13
-trap "st=143; $do_exit" 15
-
-# Test script is run here.
-"$@" >$log_file 2>&1
-estatus=$?
-
-if test $enable_hard_errors = no && test $estatus -eq 99; then
- tweaked_estatus=1
-else
- tweaked_estatus=$estatus
-fi
-
-case $tweaked_estatus:$expect_failure in
- 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;;
- 0:*) col=$grn res=PASS recheck=no gcopy=no;;
- 77:*) col=$blu res=SKIP recheck=no gcopy=yes;;
- 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;;
- *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;;
- *:*) col=$red res=FAIL recheck=yes gcopy=yes;;
-esac
-
-# Report the test outcome and exit status in the logs, so that one can
-# know whether the test passed or failed simply by looking at the '.log'
-# file, without the need of also peaking into the corresponding '.trs'
-# file (automake bug#11814).
-echo "$res $test_name (exit status: $estatus)" >>$log_file
-
-# Report outcome to console.
-echo "${col}${res}${std}: $test_name"
-
-# Register the test result, and other relevant metadata.
-echo ":test-result: $res" > $trs_file
-echo ":global-test-result: $res" >> $trs_file
-echo ":recheck: $recheck" >> $trs_file
-echo ":copy-in-global-log: $gcopy" >> $trs_file
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/toolkit/crashreporter/google-breakpad/breakpad-client.pc.in b/toolkit/crashreporter/google-breakpad/breakpad-client.pc.in
deleted file mode 100644
index fcd2fa27e7..0000000000
--- a/toolkit/crashreporter/google-breakpad/breakpad-client.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@/@PACKAGE_NAME@
-
-Name: google-breakpad-client
-Description: An open-source multi-platform crash reporting system
-Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lbreakpad_client @PTHREAD_LIBS@
-Cflags: -I${includedir} @PTHREAD_CFLAGS@
diff --git a/toolkit/crashreporter/google-breakpad/breakpad.pc.in b/toolkit/crashreporter/google-breakpad/breakpad.pc.in
deleted file mode 100644
index 9aec9f8cb4..0000000000
--- a/toolkit/crashreporter/google-breakpad/breakpad.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@/@PACKAGE_NAME@
-
-Name: google-breakpad
-Description: An open-source multi-platform crash reporting system
-Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -lbreakpad @PTHREAD_LIBS@
-Cflags: -I${includedir} @PTHREAD_CFLAGS@
diff --git a/toolkit/crashreporter/google-breakpad/codereview.settings b/toolkit/crashreporter/google-breakpad/codereview.settings
deleted file mode 100644
index 2a60978c13..0000000000
--- a/toolkit/crashreporter/google-breakpad/codereview.settings
+++ /dev/null
@@ -1,4 +0,0 @@
-GERRIT_HOST: True
-GERRIT_SQUASH_UPLOADS: True
-CODE_REVIEW_SERVER: chromium-review.googlesource.com
-VIEW_VC: https://chromium.googlesource.com/breakpad/breakpad/+/
diff --git a/toolkit/crashreporter/google-breakpad/configure b/toolkit/crashreporter/google-breakpad/configure
deleted file mode 100755
index a02f7cd537..0000000000
--- a/toolkit/crashreporter/google-breakpad/configure
+++ /dev/null
@@ -1,9255 +0,0 @@
-#! /bin/sh
-# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for breakpad 0.1.
-#
-# Report bugs to <google-breakpad-dev@googlegroups.com>.
-#
-#
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
-#
-#
-# This configure script is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# Use a proper internal environment variable to ensure we don't fall
- # into an infinite loop, continuously re-executing ourselves.
- if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
- _as_can_reexec=no; export _as_can_reexec;
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
- fi
- # We don't want this to propagate to other subprocesses.
- { _as_can_reexec=; unset _as_can_reexec;}
-if test "x$CONFIG_SHELL" = x; then
- as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-"
- as_required="as_fn_return () { (exit \$1); }
-as_fn_success () { as_fn_return 0; }
-as_fn_failure () { as_fn_return 1; }
-as_fn_ret_success () { return 0; }
-as_fn_ret_failure () { return 1; }
-
-exitcode=0
-as_fn_success || { exitcode=1; echo as_fn_success failed.; }
-as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
-as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
-as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
-
-else
- exitcode=1; echo positional parameters were not saved.
-fi
-test x\$exitcode = x0 || exit 1
-test -x / || exit 1"
- as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
- as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
- eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
- test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
-test \$(( 1 + 1 )) = 2 || exit 1"
- if (eval "$as_required") 2>/dev/null; then :
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
-
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_found=false
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- as_found=:
- case $as_dir in #(
- /*)
- for as_base in sh bash ksh sh5; do
- # Try only shells that exist, to save several forks.
- as_shell=$as_dir/$as_base
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
- CONFIG_SHELL=$as_shell as_have_required=yes
- if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
- break 2
-fi
-fi
- done;;
- esac
- as_found=false
-done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
- { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
- CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
-IFS=$as_save_IFS
-
-
- if test "x$CONFIG_SHELL" != x; then :
- export CONFIG_SHELL
- # We cannot yet assume a decent shell, so we have to provide a
-# neutralization value for shells without unset; and this also
-# works around shells that cannot unset nonexistent variables.
-# Preserve -v and -x to the replacement shell.
-BASH_ENV=/dev/null
-ENV=/dev/null
-(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
-case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
-esac
-exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
-# Admittedly, this is quite paranoid, since all the known shells bail
-# out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-exit 255
-fi
-
- if test x$as_have_required = xno; then :
- $as_echo "$0: This script requires a shell more modern than all"
- $as_echo "$0: the shells that I found on your system."
- if test x${ZSH_VERSION+set} = xset ; then
- $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
- $as_echo "$0: be upgraded to zsh 4.3.4 or later."
- else
- $as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: google-breakpad-dev@googlegroups.com about your system,
-$0: including any error possibly output before this
-$0: message. Then install a modern shell, or manually run
-$0: the script under such a shell if you do have one."
- fi
- exit 1
-fi
-fi
-fi
-SHELL=${CONFIG_SHELL-/bin/sh}
-export SHELL
-# Unset more variables known to interfere with behavior of common tools.
-CLICOLOR_FORCE= GREP_OPTIONS=
-unset CLICOLOR_FORCE GREP_OPTIONS
-
-## --------------------- ##
-## M4sh Shell Functions. ##
-## --------------------- ##
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
- # already done that, so ensure we don't try to do so again and fall
- # in an infinite loop. This has already happened in practice.
- _as_can_reexec=no; export _as_can_reexec
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-test -n "$DJDIR" || exec 7<&0 </dev/null
-exec 6>&1
-
-# Name of the host.
-# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
-# so uname gets run too.
-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-
-#
-# Initializations.
-#
-ac_default_prefix=/usr/local
-ac_clean_files=
-ac_config_libobj_dir=.
-LIBOBJS=
-cross_compiling=no
-subdirs=
-MFLAGS=
-MAKEFLAGS=
-
-# Identity of this package.
-PACKAGE_NAME='breakpad'
-PACKAGE_TARNAME='breakpad'
-PACKAGE_VERSION='0.1'
-PACKAGE_STRING='breakpad 0.1'
-PACKAGE_BUGREPORT='google-breakpad-dev@googlegroups.com'
-PACKAGE_URL=''
-
-ac_unique_file="README.md"
-# Factoring default headers for most tests.
-ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
-#ifdef STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-# include <memory.h>
-# endif
-# include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-# include <inttypes.h>
-#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif"
-
-ac_subst_vars='am__EXEEXT_FALSE
-am__EXEEXT_TRUE
-LTLIBOBJS
-LIBOBJS
-SELFTEST_FALSE
-SELFTEST_TRUE
-GTEST_LIBS
-GTEST_CFLAGS
-GTEST_CONFIG
-GMOCK_LIBS
-GMOCK_CFLAGS
-GMOCK_CONFIG
-SYSTEM_TEST_LIBS_FALSE
-SYSTEM_TEST_LIBS_TRUE
-DISABLE_TOOLS_FALSE
-DISABLE_TOOLS_TRUE
-DISABLE_PROCESSOR_FALSE
-DISABLE_PROCESSOR_TRUE
-X86_HOST_FALSE
-X86_HOST_TRUE
-ANDROID_HOST_FALSE
-ANDROID_HOST_TRUE
-LINUX_HOST_FALSE
-LINUX_HOST_TRUE
-HAVE_CXX11
-PTHREAD_CFLAGS
-PTHREAD_LIBS
-PTHREAD_CC
-ax_pthread_config
-EGREP
-GREP
-GCC_FALSE
-GCC_TRUE
-RANLIB
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ac_ct_CXX
-CXXFLAGS
-CXX
-CPP
-am__fastdepCCAS_FALSE
-am__fastdepCCAS_TRUE
-CCASDEPMODE
-CCASFLAGS
-CCAS
-am__fastdepCC_FALSE
-am__fastdepCC_TRUE
-CCDEPMODE
-am__nodep
-AMDEPBACKSLASH
-AMDEP_FALSE
-AMDEP_TRUE
-am__quote
-am__include
-DEPDIR
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-ac_ct_AR
-AR
-MAINT
-MAINTAINER_MODE_FALSE
-MAINTAINER_MODE_TRUE
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
-am__untar
-am__tar
-AMTAR
-am__leading_dot
-SET_MAKE
-AWK
-mkdir_p
-MKDIR_P
-INSTALL_STRIP_PROGRAM
-STRIP
-install_sh
-MAKEINFO
-AUTOHEADER
-AUTOMAKE
-AUTOCONF
-ACLOCAL
-VERSION
-PACKAGE
-CYGPATH_W
-am__isrc
-INSTALL_DATA
-INSTALL_SCRIPT
-INSTALL_PROGRAM
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
-target_alias
-host_alias
-build_alias
-LIBS
-ECHO_T
-ECHO_N
-ECHO_C
-DEFS
-mandir
-localedir
-libdir
-psdir
-pdfdir
-dvidir
-htmldir
-infodir
-docdir
-oldincludedir
-includedir
-localstatedir
-sharedstatedir
-sysconfdir
-datadir
-datarootdir
-libexecdir
-sbindir
-bindir
-program_transform_name
-prefix
-exec_prefix
-PACKAGE_URL
-PACKAGE_BUGREPORT
-PACKAGE_STRING
-PACKAGE_VERSION
-PACKAGE_TARNAME
-PACKAGE_NAME
-PATH_SEPARATOR
-SHELL'
-ac_subst_files=''
-ac_user_opts='
-enable_option_checking
-enable_silent_rules
-enable_maintainer_mode
-enable_dependency_tracking
-enable_m32
-enable_largefile
-enable_processor
-enable_tools
-enable_system_test_libs
-enable_selftest
-'
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CCAS
-CCASFLAGS
-CPP
-CXX
-CXXFLAGS
-CCC
-GMOCK_CONFIG
-GMOCK_CFLAGS
-GMOCK_LIBS
-GTEST_CONFIG
-GTEST_CFLAGS
-GTEST_LIBS'
-
-
-# Initialize some variables set by options.
-ac_init_help=
-ac_init_version=false
-ac_unrecognized_opts=
-ac_unrecognized_sep=
-# The variables have the same names as the options, with
-# dashes changed to underlines.
-cache_file=/dev/null
-exec_prefix=NONE
-no_create=
-no_recursion=
-prefix=NONE
-program_prefix=NONE
-program_suffix=NONE
-program_transform_name=s,x,x,
-silent=
-site=
-srcdir=
-verbose=
-x_includes=NONE
-x_libraries=NONE
-
-# Installation directory options.
-# These are left unexpanded so users can "make install exec_prefix=/foo"
-# and all the variables that are supposed to be based on exec_prefix
-# by default will actually change.
-# Use braces instead of parens because sh, perl, etc. also accept them.
-# (The list follows the same order as the GNU Coding Standards.)
-bindir='${exec_prefix}/bin'
-sbindir='${exec_prefix}/sbin'
-libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
-sysconfdir='${prefix}/etc'
-sharedstatedir='${prefix}/com'
-localstatedir='${prefix}/var'
-includedir='${prefix}/include'
-oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
-
-ac_prev=
-ac_dashdash=
-for ac_option
-do
- # If the previous option needs an argument, assign it.
- if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
- ac_prev=
- continue
- fi
-
- case $ac_option in
- *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *=) ac_optarg= ;;
- *) ac_optarg=yes ;;
- esac
-
- # Accept the important Cygnus configure options, so we can diagnose typos.
-
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
-
- -bindir | --bindir | --bindi | --bind | --bin | --bi)
- ac_prev=bindir ;;
- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir=$ac_optarg ;;
-
- -build | --build | --buil | --bui | --bu)
- ac_prev=build_alias ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build_alias=$ac_optarg ;;
-
- -cache-file | --cache-file | --cache-fil | --cache-fi \
- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
- ac_prev=cache_file ;;
- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file=$ac_optarg ;;
-
- --config-cache | -C)
- cache_file=config.cache ;;
-
- -datadir | --datadir | --datadi | --datad)
- ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
- datadir=$ac_optarg ;;
-
- -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
- | --dataroo | --dataro | --datar)
- ac_prev=datarootdir ;;
- -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
- | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
- datarootdir=$ac_optarg ;;
-
- -disable-* | --disable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=no ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
-
- -enable-* | --enable-*)
- ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid feature name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"enable_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval enable_$ac_useropt=\$ac_optarg ;;
-
- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
- | --exec | --exe | --ex)
- ac_prev=exec_prefix ;;
- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
- | --exec=* | --exe=* | --ex=*)
- exec_prefix=$ac_optarg ;;
-
- -gas | --gas | --ga | --g)
- # Obsolete; use --with-gas.
- with_gas=yes ;;
-
- -help | --help | --hel | --he | -h)
- ac_init_help=long ;;
- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
- ac_init_help=recursive ;;
- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
- ac_init_help=short ;;
-
- -host | --host | --hos | --ho)
- ac_prev=host_alias ;;
- -host=* | --host=* | --hos=* | --ho=*)
- host_alias=$ac_optarg ;;
-
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
- -includedir | --includedir | --includedi | --included | --include \
- | --includ | --inclu | --incl | --inc)
- ac_prev=includedir ;;
- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
- | --includ=* | --inclu=* | --incl=* | --inc=*)
- includedir=$ac_optarg ;;
-
- -infodir | --infodir | --infodi | --infod | --info | --inf)
- ac_prev=infodir ;;
- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir=$ac_optarg ;;
-
- -libdir | --libdir | --libdi | --libd)
- ac_prev=libdir ;;
- -libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir=$ac_optarg ;;
-
- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
- | --libexe | --libex | --libe)
- ac_prev=libexecdir ;;
- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
- | --libexe=* | --libex=* | --libe=*)
- libexecdir=$ac_optarg ;;
-
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
- -localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
- ac_prev=localstatedir ;;
- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
- localstatedir=$ac_optarg ;;
-
- -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
- ac_prev=mandir ;;
- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir=$ac_optarg ;;
-
- -nfp | --nfp | --nf)
- # Obsolete; use --without-fp.
- with_fp=no ;;
-
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c | -n)
- no_create=yes ;;
-
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
- no_recursion=yes ;;
-
- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
- | --oldin | --oldi | --old | --ol | --o)
- ac_prev=oldincludedir ;;
- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir=$ac_optarg ;;
-
- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
- ac_prev=prefix ;;
- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix=$ac_optarg ;;
-
- -program-prefix | --program-prefix | --program-prefi | --program-pref \
- | --program-pre | --program-pr | --program-p)
- ac_prev=program_prefix ;;
- -program-prefix=* | --program-prefix=* | --program-prefi=* \
- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix=$ac_optarg ;;
-
- -program-suffix | --program-suffix | --program-suffi | --program-suff \
- | --program-suf | --program-su | --program-s)
- ac_prev=program_suffix ;;
- -program-suffix=* | --program-suffix=* | --program-suffi=* \
- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix=$ac_optarg ;;
-
- -program-transform-name | --program-transform-name \
- | --program-transform-nam | --program-transform-na \
- | --program-transform-n | --program-transform- \
- | --program-transform | --program-transfor \
- | --program-transfo | --program-transf \
- | --program-trans | --program-tran \
- | --progr-tra | --program-tr | --program-t)
- ac_prev=program_transform_name ;;
- -program-transform-name=* | --program-transform-name=* \
- | --program-transform-nam=* | --program-transform-na=* \
- | --program-transform-n=* | --program-transform-=* \
- | --program-transform=* | --program-transfor=* \
- | --program-transfo=* | --program-transf=* \
- | --program-trans=* | --program-tran=* \
- | --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name=$ac_optarg ;;
-
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- silent=yes ;;
-
- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
- ac_prev=sbindir ;;
- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
- | --sbi=* | --sb=*)
- sbindir=$ac_optarg ;;
-
- -sharedstatedir | --sharedstatedir | --sharedstatedi \
- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
- | --sharedst | --shareds | --shared | --share | --shar \
- | --sha | --sh)
- ac_prev=sharedstatedir ;;
- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
- | --sha=* | --sh=*)
- sharedstatedir=$ac_optarg ;;
-
- -site | --site | --sit)
- ac_prev=site ;;
- -site=* | --site=* | --sit=*)
- site=$ac_optarg ;;
-
- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
- ac_prev=srcdir ;;
- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir=$ac_optarg ;;
-
- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
- | --syscon | --sysco | --sysc | --sys | --sy)
- ac_prev=sysconfdir ;;
- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
- sysconfdir=$ac_optarg ;;
-
- -target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target_alias ;;
- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target_alias=$ac_optarg ;;
-
- -v | -verbose | --verbose | --verbos | --verbo | --verb)
- verbose=yes ;;
-
- -version | --version | --versio | --versi | --vers | -V)
- ac_init_version=: ;;
-
- -with-* | --with-*)
- ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=\$ac_optarg ;;
-
- -without-* | --without-*)
- ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
- # Reject names that are not valid shell variable names.
- expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
- as_fn_error $? "invalid package name: $ac_useropt"
- ac_useropt_orig=$ac_useropt
- ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
- case $ac_user_opts in
- *"
-"with_$ac_useropt"
-"*) ;;
- *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
- ac_unrecognized_sep=', ';;
- esac
- eval with_$ac_useropt=no ;;
-
- --x)
- # Obsolete; use --with-x.
- with_x=yes ;;
-
- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
- | --x-incl | --x-inc | --x-in | --x-i)
- ac_prev=x_includes ;;
- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes=$ac_optarg ;;
-
- -x-libraries | --x-libraries | --x-librarie | --x-librari \
- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
- ac_prev=x_libraries ;;
- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries=$ac_optarg ;;
-
- -*) as_fn_error $? "unrecognized option: \`$ac_option'
-Try \`$0 --help' for more information"
- ;;
-
- *=*)
- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
- # Reject names that are not valid shell variable names.
- case $ac_envvar in #(
- '' | [0-9]* | *[!_$as_cr_alnum]* )
- as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
- esac
- eval $ac_envvar=\$ac_optarg
- export $ac_envvar ;;
-
- *)
- # FIXME: should be removed in autoconf 3.0.
- $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
- $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
- : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
- ;;
-
- esac
-done
-
-if test -n "$ac_prev"; then
- ac_option=--`echo $ac_prev | sed 's/_/-/g'`
- as_fn_error $? "missing argument to $ac_option"
-fi
-
-if test -n "$ac_unrecognized_opts"; then
- case $enable_option_checking in
- no) ;;
- fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
- *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
- esac
-fi
-
-# Check all directory arguments for consistency.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
-do
- eval ac_val=\$$ac_var
- # Remove trailing slashes.
- case $ac_val in
- */ )
- ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
- eval $ac_var=\$ac_val;;
- esac
- # Be sure to have absolute directory names.
- case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
- esac
- as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
-done
-
-# There might be people who depend on the old broken behavior: `$host'
-# used to hold the argument of --host etc.
-# FIXME: To remove some day.
-build=$build_alias
-host=$host_alias
-target=$target_alias
-
-# FIXME: To remove some day.
-if test "x$host_alias" != x; then
- if test "x$build_alias" = x; then
- cross_compiling=maybe
- elif test "x$build_alias" != "x$host_alias"; then
- cross_compiling=yes
- fi
-fi
-
-ac_tool_prefix=
-test -n "$host_alias" && ac_tool_prefix=$host_alias-
-
-test "$silent" = yes && exec 6>/dev/null
-
-
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- as_fn_error $? "working directory cannot be determined"
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- as_fn_error $? "pwd does not report name of working directory"
-
-
-# Find the source files, if location was not specified.
-if test -z "$srcdir"; then
- ac_srcdir_defaulted=yes
- # Try the directory containing this script, then the parent directory.
- ac_confdir=`$as_dirname -- "$as_myself" ||
-$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_myself" : 'X\(//\)[^/]' \| \
- X"$as_myself" : 'X\(//\)$' \| \
- X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
- srcdir=..
- fi
-else
- ac_srcdir_defaulted=no
-fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
-fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
-
-#
-# Report the --help message.
-#
-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 breakpad 0.1 to adapt to many kinds of systems.
-
-Usage: $0 [OPTION]... [VAR=VALUE]...
-
-To assign environment variables (e.g., CC, CFLAGS...), specify them as
-VAR=VALUE. See below for descriptions of some of the useful variables.
-
-Defaults for the options are specified in brackets.
-
-Configuration:
- -h, --help display this help and exit
- --help=short display options specific to this package
- --help=recursive display the short help of all the included packages
- -V, --version display version information and exit
- -q, --quiet, --silent do not print \`checking ...' messages
- --cache-file=FILE cache test results in FILE [disabled]
- -C, --config-cache alias for \`--cache-file=config.cache'
- -n, --no-create do not create output files
- --srcdir=DIR find the sources in DIR [configure dir or \`..']
-
-Installation directories:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
-
-By default, \`make install' will install all the files in
-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
-an installation prefix other than \`$ac_default_prefix' using \`--prefix',
-for instance \`--prefix=\$HOME'.
-
-For better control, use the options below.
-
-Fine tuning of the installation directories:
- --bindir=DIR user executables [EPREFIX/bin]
- --sbindir=DIR system admin executables [EPREFIX/sbin]
- --libexecdir=DIR program executables [EPREFIX/libexec]
- --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data [PREFIX/var]
- --libdir=DIR object code libraries [EPREFIX/lib]
- --includedir=DIR C header files [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/breakpad]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
-_ACEOF
-
- cat <<\_ACEOF
-
-Program names:
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-
-System types:
- --build=BUILD configure for building on BUILD [guessed]
- --host=HOST cross-compile to build programs to run on HOST [BUILD]
-_ACEOF
-fi
-
-if test -n "$ac_init_help"; then
- case $ac_init_help in
- short | recursive ) echo "Configuration of breakpad 0.1:";;
- esac
- cat <<\_ACEOF
-
-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
- --enable-dependency-tracking
- do not reject slow dependency extractors
- --disable-dependency-tracking
- speeds up one-time build
- --enable-m32 Compile/build with -m32 (default is no)
- --disable-largefile omit support for large files
- --disable-processor Don't build processor library (default is no)
- --disable-tools Don't build tool binaries (default is no)
- --enable-system-test-libs
- Use gtest/gmock/etc... from the system instead of
- the local copies (default is local)
- --enable-selftest Run extra tests with "make check" (may conflict with
- optimizations) (default is no)
-
-Some influential environment variables:
- CC C compiler command
- CFLAGS C compiler flags
- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
- nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
- CCAS assembler compiler command (defaults to CC)
- CCASFLAGS assembler compiler flags (defaults to CFLAGS)
- CPP C preprocessor
- CXX C++ compiler command
- CXXFLAGS C++ compiler flags
- GMOCK_CONFIG
- Path to gmock-config script
- GMOCK_CFLAGS
- Compiler flags for gmock
- GMOCK_LIBS Linker flags for gmock
- GTEST_CONFIG
- Path to gtest-config script
- GTEST_CFLAGS
- Compiler flags for gtest
- GTEST_LIBS Linker flags for gtest
-
-Use these variables to override the choices made by `configure' or to help
-it to find libraries and programs with nonstandard names/locations.
-
-Report bugs to <google-breakpad-dev@googlegroups.com>.
-_ACEOF
-ac_status=$?
-fi
-
-if test "$ac_init_help" = "recursive"; then
- # If there are subdirs, report their specific --help.
- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" ||
- { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
- continue
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
- else
- $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
- done
-fi
-
-test -n "$ac_init_help" && exit $ac_status
-if $ac_init_version; then
- cat <<\_ACEOF
-breakpad configure 0.1
-generated by GNU Autoconf 2.69
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This configure script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it.
-_ACEOF
- exit
-fi
-
-## ------------------------ ##
-## Autoconf initialization. ##
-## ------------------------ ##
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-
-# ac_fn_c_try_cpp LINENO
-# ----------------------
-# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_cpp ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } > conftest.i && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_cpp
-
-# ac_fn_cxx_try_compile LINENO
-# ----------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_cxx_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_cxx_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_cxx_try_compile
-
-# ac_fn_c_try_run LINENO
-# ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
-ac_fn_c_try_run ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then :
- ac_retval=0
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=$ac_status
-fi
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_run
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- if eval \${$3+:} false; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
- # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_header_compiler=yes
-else
- ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- ac_header_preproc=yes
-else
- ac_header_preproc=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
- yes:no: )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
- ;;
- no:yes:* )
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## --------------------------------------------------- ##
-## Report this to google-breakpad-dev@googlegroups.com ##
-## --------------------------------------------------- ##"
- ) | sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_mongrel
-
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-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 breakpad $as_me 0.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- $ $0 $@
-
-_ACEOF
-exec 5>>config.log
-{
-cat <<_ASUNAME
-## --------- ##
-## Platform. ##
-## --------- ##
-
-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
-
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
-
-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
-
-_ASUNAME
-
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- $as_echo "PATH: $as_dir"
- done
-IFS=$as_save_IFS
-
-} >&5
-
-cat >&5 <<_ACEOF
-
-
-## ----------- ##
-## Core tests. ##
-## ----------- ##
-
-_ACEOF
-
-
-# Keep a trace of the command line.
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Strip out --silent because we don't want to record it for future runs.
-# Also quote any args containing shell meta-characters.
-# Make two passes to allow for proper duplicate-argument suppression.
-ac_configure_args=
-ac_configure_args0=
-ac_configure_args1=
-ac_must_keep_next=false
-for ac_pass in 1 2
-do
- for ac_arg
- do
- case $ac_arg in
- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil)
- continue ;;
- *\'*)
- ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- case $ac_pass in
- 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
- 2)
- as_fn_append ac_configure_args1 " '$ac_arg'"
- if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
- else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
- fi
- as_fn_append ac_configure_args " '$ac_arg'"
- ;;
- esac
- done
-done
-{ ac_configure_args0=; unset ac_configure_args0;}
-{ ac_configure_args1=; unset ac_configure_args1;}
-
-# When interrupted or exit'd, cleanup temporary files, and complete
-# config.log. We remove comments because anyway the quotes in there
-# would cause problems or look ugly.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
-trap 'exit_status=$?
- # Save into config.log some information that might help in debugging.
- {
- echo
-
- $as_echo "## ---------------- ##
-## Cache variables. ##
-## ---------------- ##"
- echo
- # The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
- (set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- sed -n \
- "s/'\''/'\''\\\\'\'''\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
- ;; #(
- *)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-)
- echo
-
- $as_echo "## ----------------- ##
-## Output variables. ##
-## ----------------- ##"
- echo
- for ac_var in $ac_subst_vars
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
-
- if test -n "$ac_subst_files"; then
- $as_echo "## ------------------- ##
-## File substitutions. ##
-## ------------------- ##"
- echo
- for ac_var in $ac_subst_files
- do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- $as_echo "$ac_var='\''$ac_val'\''"
- done | sort
- echo
- fi
-
- if test -s confdefs.h; then
- $as_echo "## ----------- ##
-## confdefs.h. ##
-## ----------- ##"
- echo
- cat confdefs.h
- echo
- fi
- test "$ac_signal" != 0 &&
- $as_echo "$as_me: caught signal $ac_signal"
- $as_echo "$as_me: exit $exit_status"
- } >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
- exit $exit_status
-' 0
-for ac_signal in 1 2 13 15; do
- trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
-done
-ac_signal=0
-
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -f -r conftest* confdefs.h
-
-$as_echo "/* confdefs.h */" > confdefs.h
-
-# Predefined preprocessor variables.
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
-
-
-# Let the site file select an alternate cache file if it wants to.
-# Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
-if test -n "$CONFIG_SITE"; then
- # We do not want a PATH search for config.site.
- case $CONFIG_SITE in #((
- -*) ac_site_file1=./$CONFIG_SITE;;
- */*) ac_site_file1=$CONFIG_SITE;;
- *) ac_site_file1=./$CONFIG_SITE;;
- esac
-elif test "x$prefix" != xNONE; then
- ac_site_file1=$prefix/share/config.site
- ac_site_file2=$prefix/etc/config.site
-else
- ac_site_file1=$ac_default_prefix/share/config.site
- ac_site_file2=$ac_default_prefix/etc/config.site
-fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
-do
- test "x$ac_site_file" = xNONE && continue
- if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
- sed 's/^/| /' "$ac_site_file" >&5
- . "$ac_site_file" \
- || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
- fi
-done
-
-if test -r "$cache_file"; then
- # Some versions of bash will fail to source /dev/null (special files
- # actually), so we avoid doing that. DJGPP emulates it as a regular file.
- if test /dev/null != "$cache_file" && test -f "$cache_file"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
- case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
- esac
- fi
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
- >$cache_file
-fi
-
-# Check that the precious variables saved in the cache have kept the same
-# value.
-ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
- eval ac_old_set=\$ac_cv_env_${ac_var}_set
- eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val=\$ac_cv_env_${ac_var}_value
- eval ac_new_val=\$ac_env_${ac_var}_value
- case $ac_old_set,$ac_new_set in
- set,)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,set)
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
- ac_cache_corrupted=: ;;
- ,);;
- *)
- if test "x$ac_old_val" != "x$ac_new_val"; then
- # differences in whitespace do not lead to failure.
- ac_old_val_w=`echo x $ac_old_val`
- ac_new_val_w=`echo x $ac_new_val`
- if test "$ac_old_val_w" != "$ac_new_val_w"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- ac_cache_corrupted=:
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
- eval $ac_var=\$ac_old_val
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
-$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
-$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
- fi;;
- esac
- # Pass precious variables to config.status.
- if test "$ac_new_set" = set; then
- case $ac_new_val in
- *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
- *) ac_arg=$ac_var=$ac_new_val ;;
- esac
- case " $ac_configure_args " in
- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
- *) as_fn_append ac_configure_args " '$ac_arg'" ;;
- esac
- fi
-done
-if $ac_cache_corrupted; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
- { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
- as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
-fi
-## -------------------- ##
-## Main body of script. ##
-## -------------------- ##
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-
-ac_aux_dir=
-for ac_dir in autotools "$srcdir"/autotools; do
- if test -f "$ac_dir/install-sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install-sh -c"
- break
- elif test -f "$ac_dir/install.sh"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/install.sh -c"
- break
- elif test -f "$ac_dir/shtool"; then
- ac_aux_dir=$ac_dir
- ac_install_sh="$ac_aux_dir/shtool install -c"
- break
- fi
-done
-if test -z "$ac_aux_dir"; then
- as_fn_error $? "cannot find install-sh, install.sh, or shtool in autotools \"$srcdir\"/autotools" "$LINENO" 5
-fi
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
-
-
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-
-am__api_version='1.15'
-
-# Find a good install program. We prefer a C program (faster),
-# so one script is as good as another. But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
- ./ | .// | /[cC]/* | \
- /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
- /usr/ucb/* ) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- # Don't use installbsd from OSF since it installs stuff as root
- # by default.
- for ac_prog in ginstall scoinst install; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- rm -rf conftest.one conftest.two conftest.dir
- echo one > conftest.one
- echo two > conftest.two
- mkdir conftest.dir
- if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
- test -s conftest.one && test -s conftest.two &&
- test -s conftest.dir/conftest.one &&
- test -s conftest.dir/conftest.two
- then
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
- fi
- done
- done
- ;;
-esac
-
- done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
-fi
- if test "${ac_cv_path_install+set}" = set; then
- INSTALL=$ac_cv_path_install
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for INSTALL within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- INSTALL=$ac_install_sh
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name. Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
- *[\\\"\#\$\&\'\`$am_lf]*)
- as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
- *[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments. Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
- am_has_slept=no
- for am_try in 1 2; do
- echo "timestamp, slept: $am_has_slept" > conftest.file
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
- alias in your environment" "$LINENO" 5
- fi
- if test "$2" = conftest.file || test $am_try -eq 2; then
- break
- fi
- # Just in case.
- sleep 1
- am_has_slept=yes
- done
- test "$2" = conftest.file
- )
-then
- # Ok.
- :
-else
- as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
- ( sleep 1 ) &
- am_sleep_pid=$!
-fi
-
-rm -f conftest.file
-
-test "$program_prefix" != NONE &&
- program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
- program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-
-# Expand $ac_aux_dir to an absolute path.
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
-
-if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
-fi
-# Use eval to expand $SHELL
-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
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
-fi
-
-if test x"${install_sh+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
- *)
- install_sh="\${SHELL} $am_aux_dir/install-sh"
- esac
-fi
-
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip". However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_STRIP="${ac_tool_prefix}strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
- ac_ct_STRIP=$STRIP
- # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_STRIP"; then
- ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_STRIP="strip"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_STRIP" = x; then
- STRIP=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- STRIP=$ac_ct_STRIP
- fi
-else
- STRIP="$ac_cv_prog_STRIP"
-fi
-
-fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
- if ${ac_cv_path_mkdir+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in mkdir gmkdir; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
- case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
- 'mkdir (GNU coreutils) '* | \
- 'mkdir (coreutils) '* | \
- 'mkdir (fileutils) '4.1*)
- ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
- break 3;;
- esac
- done
- done
- done
-IFS=$as_save_IFS
-
-fi
-
- test -d ./--version && rmdir ./--version
- if test "${ac_cv_path_mkdir+set}" = set; then
- MKDIR_P="$ac_cv_path_mkdir -p"
- else
- # As a last resort, use the slow shell script. Don't cache a
- # value for MKDIR_P within a source directory, because that will
- # break other packages using the cache if that directory is
- # removed, or if the value is a relative name.
- MKDIR_P="$ac_install_sh -d"
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
-
-for ac_prog in gawk mawk nawk awk
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AWK"; then
- ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AWK="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
- @echo '@@@%%%=$(MAKE)=@@@%%%'
-_ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
- *@@@%%%=?*=@@@%%%*)
- eval ac_cv_prog_make_${ac_make}_set=yes;;
- *)
- eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
- SET_MAKE=
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
- SET_MAKE="MAKE=${MAKE-make}"
-fi
-
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
- am__leading_dot=.
-else
- am__leading_dot=_
-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."
- am__isrc=' -I$(srcdir)'
- # test to see if srcdir already configured
- if test -f $srcdir/config.status; then
- as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
- fi
-fi
-
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
- if (cygpath --version) >/dev/null 2>/dev/null; then
- CYGPATH_W='cygpath -w'
- else
- CYGPATH_W=echo
- fi
-fi
-
-
-# Define the identity of the package.
- PACKAGE='breakpad'
- VERSION='0.1'
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
-
-# Some tools Automake needs.
-
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
-
-
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
-
-
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-
-
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
-
-
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-# 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 (and possibly the TAP driver). The
-# system "awk" is bad on some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
-
-
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar plaintar pax cpio none'
-
-# 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
-
- # 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
- (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
- ($am__untar <conftest.tar) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }
- { 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 :
- $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 "$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
-
-ac_config_headers="$ac_config_headers src/config.h"
-
-
-{ $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.
-if test "${enable_maintainer_mode+set}" = set; then :
- enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
-else
- USE_MAINTAINER_MODE=no
-fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
-$as_echo "$USE_MAINTAINER_MODE" >&6; }
- if test $USE_MAINTAINER_MODE = yes; then
- MAINTAINER_MODE_TRUE=
- MAINTAINER_MODE_FALSE='#'
-else
- MAINTAINER_MODE_TRUE='#'
- MAINTAINER_MODE_FALSE=
-fi
-
- MAINT=$MAINTAINER_MODE_TRUE
-
-
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
- @echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
-
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
- enableval=$enable_dependency_tracking;
-fi
-
-if test "x$enable_dependency_tracking" != xno; then
- am_depcomp="$ac_aux_dir/depcomp"
- AMDEPBACKSLASH='\'
- am__nodep='_no'
-fi
- if test "x$enable_dependency_tracking" != xno; then
- AMDEP_TRUE=
- AMDEP_FALSE='#'
-else
- AMDEP_TRUE='#'
- AMDEP_FALSE=
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
-
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link_default") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
- ;;
- [ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
- *.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
- * )
- break;;
- esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
-else
- ac_file=''
-fi
-if test -z "$ac_file"; then :
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
-
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
- test -f "$ac_file" || continue
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
- * ) break;;
- esac
-done
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
-
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
-
- ;
- return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run. If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
- { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if { ac_try='./conftest$ac_cv_exeext'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- cross_compiling=no
- else
- if test "$cross_compiling" = maybe; then
- cross_compiling=yes
- else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
- fi
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
-
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; then :
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
- break;;
- esac
-done
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- # Make sure it works both with $CC and with simple cc.
- # Following AC_PROG_CC_C_O, we do the test twice because some
- # compilers refuse to overwrite an existing .o file with -o,
- # though they will create one.
- am_cv_prog_cc_c_o=yes
- for am_i in 1 2; do
- if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
- ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } \
- && test -f conftest2.$ac_objext; then
- : OK
- else
- am_cv_prog_cc_c_o=no
- break
- fi
- done
- rm -f core conftest*
- unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-if test -n "$ac_tool_prefix"; then
- for ac_prog in ar lib "link -lib"
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$AR"; then
- ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$AR" && break
- done
-fi
-if test -z "$AR"; then
- ac_ct_AR=$AR
- for ac_prog in ar lib "link -lib"
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_AR"; then
- ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_AR" && break
-done
-
- if test "x$ac_ct_AR" = x; then
- AR="false"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- AR=$ac_ct_AR
- fi
-fi
-
-: ${AR=ar}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
-$as_echo_n "checking the archiver ($AR) interface... " >&6; }
-if ${am_cv_ar_interface+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- am_cv_ar_interface=ar
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-int some_variable = 0;
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
- (eval $am_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- am_cv_ar_interface=ar
- else
- am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
- (eval $am_ar_try) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
- am_cv_ar_interface=lib
- else
- am_cv_ar_interface=unknown
- fi
- fi
- rm -f conftest.lib libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
-$as_echo "$am_cv_ar_interface" >&6; }
-
-case $am_cv_ar_interface in
-ar)
- ;;
-lib)
- # Microsoft lib, so override with the ar-lib wrapper script.
- # FIXME: It is wrong to rewrite AR.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__AR in this case,
- # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
- # similar.
- AR="$am_aux_dir/ar-lib $AR"
- ;;
-unknown)
- as_fn_error $? "could not determine $AR interface" "$LINENO" 5
- ;;
-esac
-
-# By default we simply use the C compiler to build assembly code.
-
-test "${CCAS+set}" = set || CCAS=$CC
-test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
-
-
-
-depcc="$CCAS" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CCAS_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
-
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CCAS_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CCAS_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
-CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
- am__fastdepCCAS_TRUE=
- am__fastdepCCAS_FALSE='#'
-else
- am__fastdepCCAS_TRUE='#'
- am__fastdepCCAS_FALSE=
-fi
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="gcc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-else
- CC="$ac_cv_prog_CC"
-fi
-
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="${ac_tool_prefix}cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- fi
-fi
-if test -z "$CC"; then
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
- ac_prog_rejected=no
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
- ac_prog_rejected=yes
- continue
- fi
- ac_cv_prog_CC="cc"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-if test $ac_prog_rejected = yes; then
- # We found a bogon in the path, so make sure we never use it.
- set dummy $ac_cv_prog_CC
- shift
- if test $# != 0; then
- # We chose a different compiler from the bogus one.
- # However, it has the same basename, so the bogon will be chosen
- # first if we set CC to just the basename; use the full file name.
- shift
- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
- fi
-fi
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- for ac_prog in cl.exe
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CC"; then
- ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CC" && break
- done
-fi
-if test -z "$CC"; then
- ac_ct_CC=$CC
- for ac_prog in cl.exe
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CC" && break
-done
-
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
-fi
-
-fi
-
-
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
-
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GCC=yes
-else
- GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-else
- CFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
- CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
- if test "$GCC" = yes; then
- CFLAGS="-g -O2"
- else
- CFLAGS="-g"
- fi
-else
- if test "$GCC" = yes; then
- CFLAGS="-O2"
- else
- CFLAGS=
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
- char **p;
- int i;
-{
- return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
- char *s;
- va_list v;
- va_start (v,p);
- s = g (p, va_arg (v,int));
- va_end (v);
- return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
- CC="$ac_save_CC $ac_arg"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c89"
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- # Make sure it works both with $CC and with simple cc.
- # Following AC_PROG_CC_C_O, we do the test twice because some
- # compilers refuse to overwrite an existing .o file with -o,
- # though they will create one.
- am_cv_prog_cc_c_o=yes
- for am_i in 1 2; do
- if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
- ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } \
- && test -f conftest2.$ac_objext; then
- : OK
- else
- am_cv_prog_cc_c_o=no
- break
- fi
- done
- rm -f core conftest*
- unset am_i
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-depcc="$CC" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CC_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CC_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CC_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
- am__fastdepCC_TRUE=
- am__fastdepCC_FALSE='#'
-else
- am__fastdepCC_TRUE='#'
- am__fastdepCC_FALSE=
-fi
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if ${ac_cv_prog_CPP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-
-else
- # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
- # Broken: success on invalid input.
-continue
-else
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-
-else
- { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-if test -z "$CXX"; then
- if test -n "$CCC"; then
- CXX=$CCC
- else
- if test -n "$ac_tool_prefix"; then
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
- do
- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$CXX"; then
- ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$CXX" && break
- done
-fi
-if test -z "$CXX"; then
- ac_ct_CXX=$CXX
- for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_CXX"; then
- ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CXX="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$ac_ct_CXX" && break
-done
-
- if test "x$ac_ct_CXX" = x; then
- CXX="g++"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- CXX=$ac_ct_CXX
- fi
-fi
-
- fi
-fi
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
- { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compiler $ac_option >&5") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- sed '10a\
-... rest of stderr output deleted ...
- 10q' conftest.err >conftest.er1
- cat conftest.er1 >&5
- fi
- rm -f conftest.er1 conftest.err
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
-$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
-if ${ac_cv_cxx_compiler_gnu+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-#ifndef __GNUC__
- choke me
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_compiler_gnu=yes
-else
- ac_compiler_gnu=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
-$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
- GXX=yes
-else
- GXX=
-fi
-ac_test_CXXFLAGS=${CXXFLAGS+set}
-ac_save_CXXFLAGS=$CXXFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
-$as_echo_n "checking whether $CXX accepts -g... " >&6; }
-if ${ac_cv_prog_cxx_g+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_cxx_werror_flag=$ac_cxx_werror_flag
- ac_cxx_werror_flag=yes
- ac_cv_prog_cxx_g=no
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-else
- CXXFLAGS=""
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
-
-else
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
- CXXFLAGS="-g"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ac_cv_prog_cxx_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cxx_werror_flag=$ac_save_cxx_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
-$as_echo "$ac_cv_prog_cxx_g" >&6; }
-if test "$ac_test_CXXFLAGS" = set; then
- CXXFLAGS=$ac_save_CXXFLAGS
-elif test $ac_cv_prog_cxx_g = yes; then
- if test "$GXX" = yes; then
- CXXFLAGS="-g -O2"
- else
- CXXFLAGS="-g"
- fi
-else
- if test "$GXX" = yes; then
- CXXFLAGS="-O2"
- else
- CXXFLAGS=
- fi
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-depcc="$CXX" am_compiler_list=
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
- # We make a subdir and do the tests there. Otherwise we can end up
- # making bogus files that we don't know about and never remove. For
- # instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named 'D' -- because '-MD' means "put the output
- # in D".
- rm -rf conftest.dir
- mkdir conftest.dir
- # Copy depcomp to subdir because otherwise we won't find it if we're
- # using a relative directory.
- cp "$am_depcomp" conftest.dir
- cd conftest.dir
- # We will build objects and dependencies in a subdirectory because
- # it helps to detect inapplicable dependency modes. For instance
- # both Tru64's cc and ICC support -MD to output dependencies as a
- # side effect of compilation, but ICC will put the dependencies in
- # the current directory while Tru64 will put them in the object
- # directory.
- mkdir sub
-
- am_cv_CXX_dependencies_compiler_type=none
- if test "$am_compiler_list" = ""; then
- am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
- fi
- am__universal=false
- case " $depcc " in #(
- *\ -arch\ *\ -arch\ *) am__universal=true ;;
- esac
-
- for depmode in $am_compiler_list; do
- # Setup a source with many dependencies, because some compilers
- # like to wrap large dependency lists on column 80 (with \), and
- # we should not choose a depcomp mode which is confused by this.
- #
- # We need to recreate these files for each test, as the compiler may
- # overwrite some of them when testing with obscure command lines.
- # This happens at least with the AIX C compiler.
- : > sub/conftest.c
- for i in 1 2 3 4 5 6; do
- echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
- # Solaris 10 /bin/sh.
- echo '/* dummy */' > sub/conftst$i.h
- done
- echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
-
- # We check with '-c' and '-o' for the sake of the "dashmstdout"
- # mode. It turns out that the SunPro C++ compiler does not properly
- # handle '-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs.
- am__obj=sub/conftest.${OBJEXT-o}
- am__minus_obj="-o $am__obj"
- case $depmode in
- gcc)
- # This depmode causes a compiler race in universal mode.
- test "$am__universal" = false || continue
- ;;
- nosideeffect)
- # After this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested.
- if test "x$enable_dependency_tracking" = xyes; then
- continue
- else
- break
- fi
- ;;
- msvc7 | msvc7msys | msvisualcpp | msvcmsys)
- # This compiler won't grok '-c -o', but also, the minuso test has
- # not run yet. These depmodes are late enough in the game, and
- # so weak that their functioning should not be impacted.
- am__obj=conftest.${OBJEXT-o}
- am__minus_obj=
- ;;
- none) break ;;
- esac
- if depmode=$depmode \
- source=sub/conftest.c object=$am__obj \
- depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
- $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
- >/dev/null 2>conftest.err &&
- grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
- grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
- grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
- ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
- # icc doesn't choke on unknown options, it will just issue warnings
- # or remarks (even with -Werror). So we grep stderr for any message
- # that says an option was ignored or not supported.
- # When given -MP, icc 7.0 and 7.1 complain thusly:
- # icc: Command line warning: ignoring option '-M'; no argument required
- # The diagnosis changed in icc 8.0:
- # icc: Command line remark: option '-MP' not supported
- if (grep 'ignoring option' conftest.err ||
- grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
- am_cv_CXX_dependencies_compiler_type=$depmode
- break
- fi
- fi
- done
-
- cd ..
- rm -rf conftest.dir
-else
- am_cv_CXX_dependencies_compiler_type=none
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-
- if
- test "x$enable_dependency_tracking" != xno \
- && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
- am__fastdepCXX_TRUE=
- am__fastdepCXX_FALSE='#'
-else
- am__fastdepCXX_TRUE='#'
- am__fastdepCXX_FALSE=
-fi
-
-
-if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-RANLIB=$ac_cv_prog_RANLIB
-if test -n "$RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
- ac_ct_RANLIB=$RANLIB
- # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_RANLIB"; then
- ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_RANLIB="ranlib"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_RANLIB" = x; then
- RANLIB=":"
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- RANLIB=$ac_ct_RANLIB
- fi
-else
- RANLIB="$ac_cv_prog_RANLIB"
-fi
-
- if test "$GCC" = yes; then
- GCC_TRUE=
- GCC_FALSE='#'
-else
- GCC_TRUE='#'
- GCC_FALSE=
-fi
- # let the Makefile know if we're gcc
-
-# Check whether --enable-m32 was given.
-if test "${enable_m32+set}" = set; then :
- enableval=$enable_m32; case "${enableval}" in
- yes)
- CFLAGS="${CFLAGS} -m32"
- CXXFLAGS="${CXXFLAGS} -m32"
- usem32=true
- ;;
- no)
- usem32=false
- ;;
- *)
- as_fn_error $? "bad value ${enableval} for --enable-m32" "$LINENO" 5
- ;;
- esac
-else
- usem32=false
-fi
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -z "$GREP"; then
- ac_path_GREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_GREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_GREP"; then
- as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_GREP=$GREP
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- if test -z "$EGREP"; then
- ac_path_EGREP_found=false
- # Loop through the user's path and test for each of PROGNAME-LIST
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- $as_echo_n 0123456789 >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- $as_echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- as_fn_arith $ac_count + 1 && ac_count=$as_val
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
- $ac_path_EGREP_found && break 3
- done
- done
- done
-IFS=$as_save_IFS
- if test -z "$ac_cv_path_EGREP"; then
- as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
- fi
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_header_stdc=yes
-else
- ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then :
- :
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
- ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
- enableval=$enable_largefile;
-fi
-
-if test "$enable_largefile" != no; then
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_cv_sys_largefile_CC=no
- if test "$GCC" != yes; then
- ac_save_CC=$CC
- while :; do
- # IRIX 6.2 and later do not support large files by default,
- # so use the C compiler's -n32 option if that helps.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
- if ac_fn_c_try_compile "$LINENO"; then :
- break
-fi
-rm -f core conftest.err conftest.$ac_objext
- CC="$CC -n32"
- if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_largefile_CC=' -n32'; break
-fi
-rm -f core conftest.err conftest.$ac_objext
- break
- done
- CC=$ac_save_CC
- rm -f conftest.$ac_ext
- fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
- if test "$ac_cv_sys_largefile_CC" != no; then
- CC=$CC$ac_cv_sys_largefile_CC
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_file_offset_bits=64; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_file_offset_bits=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
-case $ac_cv_sys_file_offset_bits in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
-;;
-esac
-rm -rf conftest*
- if test $ac_cv_sys_file_offset_bits = unknown; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- while :; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=no; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
- We can't simply define LARGE_OFF_T to be 9223372036854775807,
- since some C++ compilers masquerading as C compilers
- incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31))
- int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
- && LARGE_OFF_T % 2147483647 == 1)
- ? 1 : -1];
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- ac_cv_sys_large_files=1; break
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_cv_sys_large_files=unknown
- break
-done
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
-case $ac_cv_sys_large_files in #(
- no | unknown) ;;
- *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
-;;
-esac
-rm -rf conftest*
- fi
-
-
-fi
-
-# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_pthread.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-#
-# DESCRIPTION
-#
-# This macro figures out how to build C programs using POSIX threads. It
-# sets the PTHREAD_LIBS output variable to the threads library and linker
-# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
-# flags that are needed. (The user can also force certain compiler
-# flags/libs to be tested by setting these environment variables.)
-#
-# Also sets PTHREAD_CC to any special C compiler that is needed for
-# multi-threaded programs (defaults to the value of CC otherwise). (This
-# is necessary on AIX to use the special cc_r compiler alias.)
-#
-# NOTE: You are assumed to not only compile your program with these flags,
-# but also link it with them as well. e.g. you should link with
-# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
-#
-# If you are only building threads programs, you may wish to use these
-# variables in your default LIBS, CFLAGS, and CC:
-#
-# LIBS="$PTHREAD_LIBS $LIBS"
-# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-# CC="$PTHREAD_CC"
-#
-# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
-# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
-# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-#
-# ACTION-IF-FOUND is a list of shell commands to run if a threads library
-# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
-# is not found. If ACTION-IF-FOUND is not specified, the default action
-# will define HAVE_PTHREAD.
-#
-# Please let the authors know if this macro fails on any platform, or if
-# you have any other suggestions or comments. This macro was based on work
-# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
-# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
-# Alejandro Forero Cuervo to the autoconf macro repository. We are also
-# grateful for the helpful feedback of numerous users.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 6
-
-# This is what autoupdate's m4 run will expand. It fires
-# the warning (with _au_warn_XXX), outputs it into the
-# updated configure.ac (with AC_DIAGNOSE), and then outputs
-# the replacement expansion.
-
-
-# This is an auxiliary macro that is also run when
-# autoupdate runs m4. It simply calls m4_warning, but
-# we need a wrapper so that each warning is emitted only
-# once. We break the quoting in m4_warning's argument in
-# order to expand this macro's arguments, not AU_DEFUN's.
-
-
-# Finally, this is the expansion that is picked up by
-# autoconf. It tells the user to run autoupdate, and
-# then outputs the replacement expansion. We do not care
-# about autoupdate's warning because that contains
-# information on what to do *after* running autoupdate.
-
-
-
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-ax_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
-$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_join ();
-int
-main ()
-{
-return pthread_join ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ax_pthread_ok=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
-$as_echo "$ax_pthread_ok" >&6; }
- if test x"$ax_pthread_ok" = xno; then
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
- fi
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try. Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-
-# The ordering *is* (sometimes) important. Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-# other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-# doesn't hurt to check since this sometimes defines pthreads too;
-# also defines -D_REENTRANT)
-# ... -mt is also the pthreads flag for HP/aCC
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
- *solaris*)
-
- # On Solaris (at least, for some versions), libc contains stubbed
- # (non-functional) versions of the pthreads routines, so link-based
- # tests will erroneously succeed. (We need to link with -pthreads/-mt/
- # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
- # a function called by this macro, so we could check for that, but
- # who knows whether they'll stub that too in a future libc.) So,
- # we'll just look for -pthreads and -lpthread first:
-
- ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
- ;;
-
- *-darwin*)
- acx_pthread_flags="-pthread $acx_pthread_flags"
- ;;
-esac
-
-if test x"$ax_pthread_ok" = xno; then
-for flag in $ax_pthread_flags; do
-
- case $flag in
- none)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
-$as_echo_n "checking whether pthreads work without any flags... " >&6; }
- ;;
-
- -*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
-$as_echo_n "checking whether pthreads work with $flag... " >&6; }
- PTHREAD_CFLAGS="$flag"
- ;;
-
- pthread-config)
- # Extract the first word of "pthread-config", so it can be a program name with args.
-set dummy pthread-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ax_pthread_config+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ax_pthread_config"; then
- ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ax_pthread_config="yes"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
- test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
-fi
-fi
-ax_pthread_config=$ac_cv_prog_ax_pthread_config
-if test -n "$ax_pthread_config"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
-$as_echo "$ax_pthread_config" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- if test x"$ax_pthread_config" = xno; then continue; fi
- PTHREAD_CFLAGS="`pthread-config --cflags`"
- PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
- ;;
-
- *)
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
-$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
- PTHREAD_LIBS="-l$flag"
- ;;
- esac
-
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Check for various functions. We must include pthread.h,
- # since some functions may be macros. (On the Sequent, we
- # need a special flag -Kthread to make this header compile.)
- # We check for pthread_join because it is in -lpthread on IRIX
- # while pthread_create is in libc. We check for pthread_attr_init
- # due to DEC craziness with -lpthreads. We check for
- # pthread_cleanup_push because it is one of the few pthread
- # functions on Solaris that doesn't have a non-functional libc stub.
- # We try pthread_create on general principles.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <pthread.h>
- static void routine(void* a) {a=0;}
- static void* start_routine(void* a) {return a;}
-int
-main ()
-{
-pthread_t th; pthread_attr_t attr;
- pthread_join(th, 0);
- pthread_attr_init(&attr);
- pthread_cleanup_push(routine, 0);
- pthread_create(&th,0,start_routine,0);
- pthread_cleanup_pop(0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ax_pthread_ok=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
-$as_echo "$ax_pthread_ok" >&6; }
- if test "x$ax_pthread_ok" = xyes; then
- break;
- fi
-
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
-done
-fi
-
-# Various other checks:
-if test "x$ax_pthread_ok" = xyes; then
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
-$as_echo_n "checking for joinable pthread attribute... " >&6; }
- attr_name=unknown
- for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <pthread.h>
-int
-main ()
-{
-int attr=$attr; return attr;
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- attr_name=$attr; break
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
- done
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
-$as_echo "$attr_name" >&6; }
- if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
-
-cat >>confdefs.h <<_ACEOF
-#define PTHREAD_CREATE_JOINABLE $attr_name
-_ACEOF
-
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
-$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
- flag=no
- case "${host_cpu}-${host_os}" in
- *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
- *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
- esac
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
-$as_echo "${flag}" >&6; }
- if test "x$flag" != xno; then
- PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
- fi
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- # More AIX lossage: must compile with xlc_r or cc_r
- if test x"$GCC" != xyes; then
- for ac_prog in xlc_r cc_r
-do
- # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_PTHREAD_CC+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$PTHREAD_CC"; then
- ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_PTHREAD_CC="$ac_prog"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
-if test -n "$PTHREAD_CC"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
-$as_echo "$PTHREAD_CC" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
- test -n "$PTHREAD_CC" && break
-done
-test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
-
- else
- PTHREAD_CC=$CC
- fi
-else
- PTHREAD_CC="$CC"
-fi
-
-
-
-
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$ax_pthread_ok" = xyes; then
-
-$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h
-
- :
-else
- ax_pthread_ok=no
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-for ac_header in a.out.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "a.out.h" "ac_cv_header_a_out_h" "$ac_includes_default"
-if test "x$ac_cv_header_a_out_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_A_OUT_H 1
-_ACEOF
-
-fi
-
-done
-
-
-# ===========================================================================
-# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
-#
-# DESCRIPTION
-#
-# Check for baseline language coverage in the compiler for the specified
-# version of the C++ standard. If necessary, add switches to CXXFLAGS to
-# enable support. VERSION may be '11' (for the C++11 standard) or '14'
-# (for the C++14 standard).
-#
-# The second argument, if specified, indicates whether you insist on an
-# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
-# -std=c++11). If neither is specified, you get whatever works, with
-# preference for an extended mode.
-#
-# The third argument, if specified 'mandatory' or if left unspecified,
-# indicates that baseline support for the specified C++ standard is
-# required and that the macro should error out if no mode with that
-# support is found. If specified 'optional', then configuration proceeds
-# regardless, after defining HAVE_CXX${VERSION} if and only if a
-# supporting mode is found.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
-# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
-# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
-# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
-# Copyright (c) 2015 Paul Norman <penorman@mac.com>
-# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
-#
-# Copying and distribution of this file, with or without modification, are
-# permitted in any medium without royalty provided the copyright notice
-# and this notice are preserved. This file is offered as-is, without any
-# warranty.
-
-#serial 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ax_cxx_compile_cxx11_required=true
- ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
- ac_success=no
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5
-$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; }
-if ${ax_cv_cxx_compile_cxx11+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
-// If the compiler admits that it is not ready for C++11, why torture it?
-// Hopefully, this will speed up the test.
-
-#ifndef __cplusplus
-
-#error "This is not a C++ compiler"
-
-#elif __cplusplus < 201103L
-
-#error "This is not a C++11 compiler"
-
-#else
-
-namespace cxx11
-{
-
- namespace test_static_assert
- {
-
- template <typename T>
- struct check
- {
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
- };
-
- }
-
- namespace test_final_override
- {
-
- struct Base
- {
- virtual void f() {}
- };
-
- struct Derived : public Base
- {
- virtual void f() override {}
- };
-
- }
-
- namespace test_double_right_angle_brackets
- {
-
- template < typename T >
- struct check {};
-
- typedef check<void> single_type;
- typedef check<check<void>> double_type;
- typedef check<check<check<void>>> triple_type;
- typedef check<check<check<check<void>>>> quadruple_type;
-
- }
-
- namespace test_decltype
- {
-
- int
- f()
- {
- int a = 1;
- decltype(a) b = 2;
- return a + b;
- }
-
- }
-
- namespace test_type_deduction
- {
-
- template < typename T1, typename T2 >
- struct is_same
- {
- static const bool value = false;
- };
-
- template < typename T >
- struct is_same<T, T>
- {
- static const bool value = true;
- };
-
- template < typename T1, typename T2 >
- auto
- add(T1 a1, T2 a2) -> decltype(a1 + a2)
- {
- return a1 + a2;
- }
-
- int
- test(const int c, volatile int v)
- {
- static_assert(is_same<int, decltype(0)>::value == true, "");
- static_assert(is_same<int, decltype(c)>::value == false, "");
- static_assert(is_same<int, decltype(v)>::value == false, "");
- auto ac = c;
- auto av = v;
- auto sumi = ac + av + 'x';
- auto sumf = ac + av + 1.0;
- static_assert(is_same<int, decltype(ac)>::value == true, "");
- static_assert(is_same<int, decltype(av)>::value == true, "");
- static_assert(is_same<int, decltype(sumi)>::value == true, "");
- static_assert(is_same<int, decltype(sumf)>::value == false, "");
- static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
- return (sumf > 0.0) ? sumi : add(c, v);
- }
-
- }
-
- namespace test_noexcept
- {
-
- int f() { return 0; }
- int g() noexcept { return 0; }
-
- static_assert(noexcept(f()) == false, "");
- static_assert(noexcept(g()) == true, "");
-
- }
-
- namespace test_constexpr
- {
-
- template < typename CharT >
- unsigned long constexpr
- strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
- {
- return *s ? strlen_c_r(s + 1, acc + 1) : acc;
- }
-
- template < typename CharT >
- unsigned long constexpr
- strlen_c(const CharT *const s) noexcept
- {
- return strlen_c_r(s, 0UL);
- }
-
- static_assert(strlen_c("") == 0UL, "");
- static_assert(strlen_c("1") == 1UL, "");
- static_assert(strlen_c("example") == 7UL, "");
- static_assert(strlen_c("another\0example") == 7UL, "");
-
- }
-
- namespace test_rvalue_references
- {
-
- template < int N >
- struct answer
- {
- static constexpr int value = N;
- };
-
- answer<1> f(int&) { return answer<1>(); }
- answer<2> f(const int&) { return answer<2>(); }
- answer<3> f(int&&) { return answer<3>(); }
-
- void
- test()
- {
- int i = 0;
- const int c = 0;
- static_assert(decltype(f(i))::value == 1, "");
- static_assert(decltype(f(c))::value == 2, "");
- static_assert(decltype(f(0))::value == 3, "");
- }
-
- }
-
- namespace test_uniform_initialization
- {
-
- struct test
- {
- static const int zero {};
- static const int one {1};
- };
-
- static_assert(test::zero == 0, "");
- static_assert(test::one == 1, "");
-
- }
-
- namespace test_lambdas
- {
-
- void
- test1()
- {
- auto lambda1 = [](){};
- auto lambda2 = lambda1;
- lambda1();
- lambda2();
- }
-
- int
- test2()
- {
- auto a = [](int i, int j){ return i + j; }(1, 2);
- auto b = []() -> int { return '0'; }();
- auto c = [=](){ return a + b; }();
- auto d = [&](){ return c; }();
- auto e = [a, &b](int x) mutable {
- const auto identity = [](int y){ return y; };
- for (auto i = 0; i < a; ++i)
- a += b--;
- return x + identity(a + b);
- }(0);
- return a + b + c + d + e;
- }
-
- int
- test3()
- {
- const auto nullary = [](){ return 0; };
- const auto unary = [](int x){ return x; };
- using nullary_t = decltype(nullary);
- using unary_t = decltype(unary);
- const auto higher1st = [](nullary_t f){ return f(); };
- const auto higher2nd = [unary](nullary_t f1){
- return [unary, f1](unary_t f2){ return f2(unary(f1())); };
- };
- return higher1st(nullary) + higher2nd(nullary)(unary);
- }
-
- }
-
- namespace test_variadic_templates
- {
-
- template <int...>
- struct sum;
-
- template <int N0, int... N1toN>
- struct sum<N0, N1toN...>
- {
- static constexpr auto value = N0 + sum<N1toN...>::value;
- };
-
- template <>
- struct sum<>
- {
- static constexpr auto value = 0;
- };
-
- static_assert(sum<>::value == 0, "");
- static_assert(sum<1>::value == 1, "");
- static_assert(sum<23>::value == 23, "");
- static_assert(sum<1, 2>::value == 3, "");
- static_assert(sum<5, 5, 11>::value == 21, "");
- static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
-
- }
-
- // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
- // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
- // because of this.
- namespace test_template_alias_sfinae
- {
-
- struct foo {};
-
- template<typename T>
- using member = typename T::member_type;
-
- template<typename T>
- void func(...) {}
-
- template<typename T>
- void func(member<T>*) {}
-
- void test();
-
- void test() { func<foo>(0); }
-
- }
-
-} // namespace cxx11
-
-#endif // __cplusplus >= 201103L
-
-
-
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- ax_cv_cxx_compile_cxx11=yes
-else
- ax_cv_cxx_compile_cxx11=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5
-$as_echo "$ax_cv_cxx_compile_cxx11" >&6; }
- if test x$ax_cv_cxx_compile_cxx11 = xyes; then
- ac_success=yes
- fi
-
-
-
- if test x$ac_success = xno; then
- for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do
- cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5
-$as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; }
-if eval \${$cachevar+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_save_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $switch"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-
-// If the compiler admits that it is not ready for C++11, why torture it?
-// Hopefully, this will speed up the test.
-
-#ifndef __cplusplus
-
-#error "This is not a C++ compiler"
-
-#elif __cplusplus < 201103L
-
-#error "This is not a C++11 compiler"
-
-#else
-
-namespace cxx11
-{
-
- namespace test_static_assert
- {
-
- template <typename T>
- struct check
- {
- static_assert(sizeof(int) <= sizeof(T), "not big enough");
- };
-
- }
-
- namespace test_final_override
- {
-
- struct Base
- {
- virtual void f() {}
- };
-
- struct Derived : public Base
- {
- virtual void f() override {}
- };
-
- }
-
- namespace test_double_right_angle_brackets
- {
-
- template < typename T >
- struct check {};
-
- typedef check<void> single_type;
- typedef check<check<void>> double_type;
- typedef check<check<check<void>>> triple_type;
- typedef check<check<check<check<void>>>> quadruple_type;
-
- }
-
- namespace test_decltype
- {
-
- int
- f()
- {
- int a = 1;
- decltype(a) b = 2;
- return a + b;
- }
-
- }
-
- namespace test_type_deduction
- {
-
- template < typename T1, typename T2 >
- struct is_same
- {
- static const bool value = false;
- };
-
- template < typename T >
- struct is_same<T, T>
- {
- static const bool value = true;
- };
-
- template < typename T1, typename T2 >
- auto
- add(T1 a1, T2 a2) -> decltype(a1 + a2)
- {
- return a1 + a2;
- }
-
- int
- test(const int c, volatile int v)
- {
- static_assert(is_same<int, decltype(0)>::value == true, "");
- static_assert(is_same<int, decltype(c)>::value == false, "");
- static_assert(is_same<int, decltype(v)>::value == false, "");
- auto ac = c;
- auto av = v;
- auto sumi = ac + av + 'x';
- auto sumf = ac + av + 1.0;
- static_assert(is_same<int, decltype(ac)>::value == true, "");
- static_assert(is_same<int, decltype(av)>::value == true, "");
- static_assert(is_same<int, decltype(sumi)>::value == true, "");
- static_assert(is_same<int, decltype(sumf)>::value == false, "");
- static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
- return (sumf > 0.0) ? sumi : add(c, v);
- }
-
- }
-
- namespace test_noexcept
- {
-
- int f() { return 0; }
- int g() noexcept { return 0; }
-
- static_assert(noexcept(f()) == false, "");
- static_assert(noexcept(g()) == true, "");
-
- }
-
- namespace test_constexpr
- {
-
- template < typename CharT >
- unsigned long constexpr
- strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
- {
- return *s ? strlen_c_r(s + 1, acc + 1) : acc;
- }
-
- template < typename CharT >
- unsigned long constexpr
- strlen_c(const CharT *const s) noexcept
- {
- return strlen_c_r(s, 0UL);
- }
-
- static_assert(strlen_c("") == 0UL, "");
- static_assert(strlen_c("1") == 1UL, "");
- static_assert(strlen_c("example") == 7UL, "");
- static_assert(strlen_c("another\0example") == 7UL, "");
-
- }
-
- namespace test_rvalue_references
- {
-
- template < int N >
- struct answer
- {
- static constexpr int value = N;
- };
-
- answer<1> f(int&) { return answer<1>(); }
- answer<2> f(const int&) { return answer<2>(); }
- answer<3> f(int&&) { return answer<3>(); }
-
- void
- test()
- {
- int i = 0;
- const int c = 0;
- static_assert(decltype(f(i))::value == 1, "");
- static_assert(decltype(f(c))::value == 2, "");
- static_assert(decltype(f(0))::value == 3, "");
- }
-
- }
-
- namespace test_uniform_initialization
- {
-
- struct test
- {
- static const int zero {};
- static const int one {1};
- };
-
- static_assert(test::zero == 0, "");
- static_assert(test::one == 1, "");
-
- }
-
- namespace test_lambdas
- {
-
- void
- test1()
- {
- auto lambda1 = [](){};
- auto lambda2 = lambda1;
- lambda1();
- lambda2();
- }
-
- int
- test2()
- {
- auto a = [](int i, int j){ return i + j; }(1, 2);
- auto b = []() -> int { return '0'; }();
- auto c = [=](){ return a + b; }();
- auto d = [&](){ return c; }();
- auto e = [a, &b](int x) mutable {
- const auto identity = [](int y){ return y; };
- for (auto i = 0; i < a; ++i)
- a += b--;
- return x + identity(a + b);
- }(0);
- return a + b + c + d + e;
- }
-
- int
- test3()
- {
- const auto nullary = [](){ return 0; };
- const auto unary = [](int x){ return x; };
- using nullary_t = decltype(nullary);
- using unary_t = decltype(unary);
- const auto higher1st = [](nullary_t f){ return f(); };
- const auto higher2nd = [unary](nullary_t f1){
- return [unary, f1](unary_t f2){ return f2(unary(f1())); };
- };
- return higher1st(nullary) + higher2nd(nullary)(unary);
- }
-
- }
-
- namespace test_variadic_templates
- {
-
- template <int...>
- struct sum;
-
- template <int N0, int... N1toN>
- struct sum<N0, N1toN...>
- {
- static constexpr auto value = N0 + sum<N1toN...>::value;
- };
-
- template <>
- struct sum<>
- {
- static constexpr auto value = 0;
- };
-
- static_assert(sum<>::value == 0, "");
- static_assert(sum<1>::value == 1, "");
- static_assert(sum<23>::value == 23, "");
- static_assert(sum<1, 2>::value == 3, "");
- static_assert(sum<5, 5, 11>::value == 21, "");
- static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
-
- }
-
- // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
- // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
- // because of this.
- namespace test_template_alias_sfinae
- {
-
- struct foo {};
-
- template<typename T>
- using member = typename T::member_type;
-
- template<typename T>
- void func(...) {}
-
- template<typename T>
- void func(member<T>*) {}
-
- void test();
-
- void test() { func<foo>(0); }
-
- }
-
-} // namespace cxx11
-
-#endif // __cplusplus >= 201103L
-
-
-
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"; then :
- eval $cachevar=yes
-else
- eval $cachevar=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CXXFLAGS="$ac_save_CXXFLAGS"
-fi
-eval ac_res=\$$cachevar
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- if eval test x\$$cachevar = xyes; then
- CXXFLAGS="$CXXFLAGS $switch"
- ac_success=yes
- break
- fi
- done
- fi
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
- if test x$ax_cxx_compile_cxx11_required = xtrue; then
- if test x$ac_success = xno; then
- as_fn_error $? "*** A compiler with support for C++11 language features is required." "$LINENO" 5
- fi
- else
- if test x$ac_success = xno; then
- HAVE_CXX11=0
- { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++11 support was found" >&5
-$as_echo "$as_me: No compiler with C++11 support was found" >&6;}
- else
- HAVE_CXX11=1
-
-$as_echo "#define HAVE_CXX11 1" >>confdefs.h
-
- fi
-
-
- fi
-
-
-# Only build Linux client libs when compiling for Linux
-case $host in
- *-*-linux* | *-android* )
- LINUX_HOST=true
- ;;
-esac
- if test x$LINUX_HOST = xtrue; then
- LINUX_HOST_TRUE=
- LINUX_HOST_FALSE='#'
-else
- LINUX_HOST_TRUE='#'
- LINUX_HOST_FALSE=
-fi
-
-
-# Only use Android support headers when compiling for Android
-case $host in
- *-android*)
- ANDROID_HOST=true
- ;;
-esac
- if test x$ANDROID_HOST = xtrue; then
- ANDROID_HOST_TRUE=
- ANDROID_HOST_FALSE='#'
-else
- ANDROID_HOST_TRUE='#'
- ANDROID_HOST_FALSE=
-fi
-
-
-# Some tools (like mac ones) only support x86 currently.
-case $host_cpu in
- i?86|x86_64)
- X86_HOST=true
- ;;
-esac
- if test x$X86_HOST = xtrue; then
- X86_HOST_TRUE=
- X86_HOST_FALSE='#'
-else
- X86_HOST_TRUE='#'
- X86_HOST_FALSE=
-fi
-
-
-# Check whether --enable-processor was given.
-if test "${enable_processor+set}" = set; then :
- enableval=$enable_processor; case "${enableval}" in
- yes)
- disable_processor=false
- ;;
- no)
- disable_processor=true
- ;;
- *)
- as_fn_error $? "bad value ${enableval} for --disable-processor" "$LINENO" 5
- ;;
- esac
-else
- disable_processor=false
-fi
-
- if test x$disable_processor = xtrue; then
- DISABLE_PROCESSOR_TRUE=
- DISABLE_PROCESSOR_FALSE='#'
-else
- DISABLE_PROCESSOR_TRUE='#'
- DISABLE_PROCESSOR_FALSE=
-fi
-
-
-# Check whether --enable-tools was given.
-if test "${enable_tools+set}" = set; then :
- enableval=$enable_tools; case "${enableval}" in
- yes)
- disable_tools=false
- ;;
- no)
- disable_tools=true
- ;;
- *)
- as_fn_error $? "bad value ${enableval} for --disable-tools" "$LINENO" 5
- ;;
- esac
-else
- disable_tools=false
-fi
-
- if test x$disable_tools = xtrue; then
- DISABLE_TOOLS_TRUE=
- DISABLE_TOOLS_FALSE='#'
-else
- DISABLE_TOOLS_TRUE='#'
- DISABLE_TOOLS_FALSE=
-fi
-
-
-if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then
- as_fn_error $? "--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!" "$LINENO" 5
-fi
-
-# Check whether --enable-system-test-libs was given.
-if test "${enable_system_test_libs+set}" = set; then :
- enableval=$enable_system_test_libs; case "${enableval}" in
- yes)
- system_test_libs=true
- ;;
- no)
- system_test_libs=false
- ;;
- *)
- as_fn_error $? "bad value ${enableval} for --enable-system-test-libs" "$LINENO" 5
- ;;
- esac
-else
- system_test_libs=false
-fi
-
- if test x$system_test_libs = xtrue; then
- SYSTEM_TEST_LIBS_TRUE=
- SYSTEM_TEST_LIBS_FALSE='#'
-else
- SYSTEM_TEST_LIBS_TRUE='#'
- SYSTEM_TEST_LIBS_FALSE=
-fi
-
-
-
-
-
-
-
-
-if test x$system_test_libs = xtrue; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gmock-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gmock-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GMOCK_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$GMOCK_CONFIG"; then
- ac_cv_prog_GMOCK_CONFIG="$GMOCK_CONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_GMOCK_CONFIG="${ac_tool_prefix}gmock-config"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-GMOCK_CONFIG=$ac_cv_prog_GMOCK_CONFIG
-if test -n "$GMOCK_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GMOCK_CONFIG" >&5
-$as_echo "$GMOCK_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_GMOCK_CONFIG"; then
- ac_ct_GMOCK_CONFIG=$GMOCK_CONFIG
- # Extract the first word of "gmock-config", so it can be a program name with args.
-set dummy gmock-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_GMOCK_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_GMOCK_CONFIG"; then
- ac_cv_prog_ac_ct_GMOCK_CONFIG="$ac_ct_GMOCK_CONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_GMOCK_CONFIG="gmock-config"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_GMOCK_CONFIG=$ac_cv_prog_ac_ct_GMOCK_CONFIG
-if test -n "$ac_ct_GMOCK_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GMOCK_CONFIG" >&5
-$as_echo "$ac_ct_GMOCK_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_GMOCK_CONFIG" = x; then
- GMOCK_CONFIG=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- GMOCK_CONFIG=$ac_ct_GMOCK_CONFIG
- fi
-else
- GMOCK_CONFIG="$ac_cv_prog_GMOCK_CONFIG"
-fi
-
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}gtest-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gtest-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_GTEST_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$GTEST_CONFIG"; then
- ac_cv_prog_GTEST_CONFIG="$GTEST_CONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_GTEST_CONFIG="${ac_tool_prefix}gtest-config"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-GTEST_CONFIG=$ac_cv_prog_GTEST_CONFIG
-if test -n "$GTEST_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTEST_CONFIG" >&5
-$as_echo "$GTEST_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_GTEST_CONFIG"; then
- ac_ct_GTEST_CONFIG=$GTEST_CONFIG
- # Extract the first word of "gtest-config", so it can be a program name with args.
-set dummy gtest-config; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_GTEST_CONFIG+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$ac_ct_GTEST_CONFIG"; then
- ac_cv_prog_ac_ct_GTEST_CONFIG="$ac_ct_GTEST_CONFIG" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_GTEST_CONFIG="gtest-config"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_GTEST_CONFIG=$ac_cv_prog_ac_ct_GTEST_CONFIG
-if test -n "$ac_ct_GTEST_CONFIG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_GTEST_CONFIG" >&5
-$as_echo "$ac_ct_GTEST_CONFIG" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_ct_GTEST_CONFIG" = x; then
- GTEST_CONFIG=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
- GTEST_CONFIG=$ac_ct_GTEST_CONFIG
- fi
-else
- GTEST_CONFIG="$ac_cv_prog_GTEST_CONFIG"
-fi
-
- GMOCK_CFLAGS=`$GMOCK_CONFIG --cppflags --cxxflags`
- GMOCK_LIBS=`$GMOCK_CONFIG --ldflags --libs`
- GTEST_CFLAGS=`$GTEST_CONFIG --cppflags --cxxflags`
- GTEST_LIBS=`$GTEST_CONFIG --ldflags --libs`
-fi
-
-# Check whether --enable-selftest was given.
-if test "${enable_selftest+set}" = set; then :
- enableval=$enable_selftest; case "${enableval}" in
- yes)
- selftest=true
- ;;
- no)
- selftest=false
- ;;
- *)
- as_fn_error $? "bad value ${enableval} for --enable-selftest" "$LINENO" 5
- ;;
- esac
-else
- selftest=false
-fi
-
- if test x$selftest = xtrue; then
- SELFTEST_TRUE=
- SELFTEST_FALSE='#'
-else
- SELFTEST_TRUE='#'
- SELFTEST_FALSE=
-fi
-
-
-ac_config_files="$ac_config_files breakpad.pc breakpad-client.pc Makefile"
-
-
-cat >confcache <<\_ACEOF
-# This file is a shell script that caches the results of configure
-# tests run on this system so they can be shared between configure
-# scripts and configure runs, see configure's option --config-cache.
-# It is not useful on other systems. If it contains results you don't
-# want to keep, you may remove or edit it.
-#
-# config.status only pays attention to the cache file if you give it
-# the --recheck option to rerun configure.
-#
-# `ac_cv_env_foo' variables (set or unset) will be overridden when
-# loading this file, other *unset* `ac_cv_foo' will be assigned the
-# following values.
-
-_ACEOF
-
-# The following way of writing the cache mishandles newlines in values,
-# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
-# Ultrix sh set writes to stderr and can't be redirected directly,
-# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
- *) { eval $ac_var=; unset $ac_var;} ;;
- esac ;;
- esac
- done
-
- (set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
- # `set' does not quote correctly, so add quotes: double-quote
- # substitution turns \\\\ into \\, and sed turns \\ into \.
- sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
- *)
- # `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
- ;;
- esac |
- sort
-) |
- sed '
- /^ac_cv_env_/b end
- t clear
- :clear
- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
- t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- if test "x$cache_file" != "x/dev/null"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
- if test ! -f "$cache_file" || test -h "$cache_file"; then
- cat confcache >"$cache_file"
- else
- case $cache_file in #(
- */* | ?:*)
- mv -f confcache "$cache_file"$$ &&
- mv -f "$cache_file"$$ "$cache_file" ;; #(
- *)
- mv -f confcache "$cache_file" ;;
- esac
- fi
- fi
- else
- { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
- fi
-fi
-rm -f confcache
-
-test "x$prefix" = xNONE && prefix=$ac_default_prefix
-# Let make expand exec_prefix.
-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-
-DEFS=-DHAVE_CONFIG_H
-
-ac_libobjs=
-ac_ltlibobjs=
-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
- # 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
-done
-LIBOBJS=$ac_libobjs
-
-LTLIBOBJS=$ac_ltlibobjs
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
- if test -n "$am_sleep_pid"; then
- # Hide warnings about reused PIDs.
- wait $am_sleep_pid 2>/dev/null
- fi
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
- if test -n "$EXEEXT"; then
- am__EXEEXT_TRUE=
- am__EXEEXT_FALSE='#'
-else
- am__EXEEXT_TRUE='#'
- am__EXEEXT_FALSE=
-fi
-
-if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
- as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
- as_fn_error $? "conditional \"AMDEP\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
- as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${GCC_TRUE}" && test -z "${GCC_FALSE}"; then
- as_fn_error $? "conditional \"GCC\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${LINUX_HOST_TRUE}" && test -z "${LINUX_HOST_FALSE}"; then
- as_fn_error $? "conditional \"LINUX_HOST\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${ANDROID_HOST_TRUE}" && test -z "${ANDROID_HOST_FALSE}"; then
- as_fn_error $? "conditional \"ANDROID_HOST\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${X86_HOST_TRUE}" && test -z "${X86_HOST_FALSE}"; then
- as_fn_error $? "conditional \"X86_HOST\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DISABLE_PROCESSOR_TRUE}" && test -z "${DISABLE_PROCESSOR_FALSE}"; then
- as_fn_error $? "conditional \"DISABLE_PROCESSOR\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${DISABLE_TOOLS_TRUE}" && test -z "${DISABLE_TOOLS_FALSE}"; then
- as_fn_error $? "conditional \"DISABLE_TOOLS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${SYSTEM_TEST_LIBS_TRUE}" && test -z "${SYSTEM_TEST_LIBS_FALSE}"; then
- as_fn_error $? "conditional \"SYSTEM_TEST_LIBS\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${SELFTEST_TRUE}" && test -z "${SELFTEST_FALSE}"; then
- as_fn_error $? "conditional \"SELFTEST\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-
-: "${CONFIG_STATUS=./config.status}"
-ac_write_fail=0
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
-as_write_fail=0
-cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate the current configuration.
-# Compiler output produced by configure, useful for debugging
-# configure, is in config.log if it exists.
-
-debug=false
-ac_cs_recheck=false
-ac_cs_silent=false
-
-SHELL=\${CONFIG_SHELL-$SHELL}
-export SHELL
-_ASEOF
-cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
-## -------------------- ##
-## M4sh Initialization. ##
-## -------------------- ##
-
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
- emulate sh
- NULLCMD=:
- # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in #(
- *posix*) :
- set -o posix ;; #(
- *) :
- ;;
-esac
-fi
-
-
-as_nl='
-'
-export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
- && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='print -r --'
- as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
- as_echo='printf %s\n'
- as_echo_n='printf %s'
-else
- if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
- as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
- as_echo_n='/usr/ucb/echo -n'
- else
- as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
- as_echo_n_body='eval
- arg=$1;
- case $arg in #(
- *"$as_nl"*)
- expr "X$arg" : "X\\(.*\\)$as_nl";
- arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
- esac;
- expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
- '
- export as_echo_n_body
- as_echo_n='sh -c $as_echo_n_body as_echo'
- fi
- export as_echo_body
- as_echo='sh -c $as_echo_body as_echo'
-fi
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- PATH_SEPARATOR=:
- (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
- (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
- PATH_SEPARATOR=';'
- }
-fi
-
-
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-as_myself=
-case $0 in #((
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
- done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- exit 1
-fi
-
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there. '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
- && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-
-# as_fn_error STATUS ERROR [LINENO LOG_FD]
-# ----------------------------------------
-# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
-# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
-# script with STATUS, using 1 if that was 0.
-as_fn_error ()
-{
- as_status=$1; test $as_status -eq 0 && as_status=1
- if test "$4"; then
- as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
- fi
- $as_echo "$as_me: error: $2" >&2
- as_fn_exit $as_status
-} # as_fn_error
-
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-
-# as_fn_unset VAR
-# ---------------
-# Portably unset VAR.
-as_fn_unset ()
-{
- { eval $1=; unset $1;}
-}
-as_unset=as_fn_unset
-# as_fn_append VAR VALUE
-# ----------------------
-# Append the text in VALUE to the end of the definition contained in VAR. Take
-# advantage of any shell optimizations that allow amortized linear growth over
-# repeated appends, instead of the typical quadratic growth present in naive
-# implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
- eval 'as_fn_append ()
- {
- eval $1+=\$2
- }'
-else
- as_fn_append ()
- {
- eval $1=\$$1\$2
- }
-fi # as_fn_append
-
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in #(((((
--n*)
- case `echo 'xy\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- xy) ECHO_C='\c';;
- *) echo `echo ksh88 bug on AIX 6.1` > /dev/null
- ECHO_T=' ';;
- esac;;
-*)
- ECHO_N='-n';;
-esac
-
-rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir 2>/dev/null
-fi
-if (echo >conf$$.file) 2>/dev/null; then
- if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -pR'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -pR'
- elif ln conf$$.file conf$$ 2>/dev/null; then
- as_ln_s=ln
- else
- as_ln_s='cp -pR'
- fi
-else
- as_ln_s='cp -pR'
-fi
-rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
-
-
-# as_fn_mkdir_p
-# -------------
-# Create "$as_dir" as a directory, including parents if necessary.
-as_fn_mkdir_p ()
-{
-
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || eval $as_mkdir_p || {
- as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
- done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
-
-
-} # as_fn_mkdir_p
-if mkdir -p . 2>/dev/null; then
- as_mkdir_p='mkdir -p "$as_dir"'
-else
- test -d ./-p && rmdir ./-p
- as_mkdir_p=false
-fi
-
-
-# as_fn_executable_p FILE
-# -----------------------
-# Test if FILE is an executable regular file.
-as_fn_executable_p ()
-{
- test -f "$1" && test -x "$1"
-} # as_fn_executable_p
-as_test_x='test -x'
-as_executable_p=as_fn_executable_p
-
-# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
-
-# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-
-
-exec 6>&1
-## ----------------------------------- ##
-## Main body of $CONFIG_STATUS script. ##
-## ----------------------------------- ##
-_ASEOF
-test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# Save the log message, to keep $0 and so on meaningful, and to
-# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
-This file was extended by breakpad $as_me 0.1, which was
-generated by GNU Autoconf 2.69. Invocation command line was
-
- CONFIG_FILES = $CONFIG_FILES
- CONFIG_HEADERS = $CONFIG_HEADERS
- CONFIG_LINKS = $CONFIG_LINKS
- CONFIG_COMMANDS = $CONFIG_COMMANDS
- $ $0 $@
-
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
-_ACEOF
-
-case $ac_config_files in *"
-"*) set x $ac_config_files; shift; ac_config_files=$*;;
-esac
-
-case $ac_config_headers in *"
-"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
-esac
-
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
-config_commands="$ac_config_commands"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-ac_cs_usage="\
-\`$as_me' instantiates files and other configuration actions
-from templates according to the current configuration. Unless the files
-and actions are specified as TAGs, all are instantiated by default.
-
-Usage: $0 [OPTION]... [TAG]...
-
- -h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
- --config print configuration, then exit
- -q, --quiet, --silent
- do not print progress messages
- -d, --debug don't remove temporary files
- --recheck update $as_me by reconfiguring in the same conditions
- --file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
- --header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
-
-Configuration files:
-$config_files
-
-Configuration headers:
-$config_headers
-
-Configuration commands:
-$config_commands
-
-Report bugs to <google-breakpad-dev@googlegroups.com>."
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
-ac_cs_version="\\
-breakpad config.status 0.1
-configured by $0, generated by GNU Autoconf 2.69,
- with options \\"\$ac_cs_config\\"
-
-Copyright (C) 2012 Free Software Foundation, Inc.
-This config.status script is free software; the Free Software Foundation
-gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
-MKDIR_P='$MKDIR_P'
-AWK='$AWK'
-test -n "\$AWK" || AWK=awk
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# The default lists apply if the user does not specify any file.
-ac_need_defaults=:
-while test $# != 0
-do
- case $1 in
- --*=?*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
- ac_shift=:
- ;;
- --*=)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=
- ac_shift=:
- ;;
- *)
- ac_option=$1
- ac_optarg=$2
- ac_shift=shift
- ;;
- esac
-
- case $ac_option in
- # Handling of the options.
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- $as_echo "$ac_cs_version"; exit ;;
- --config | --confi | --conf | --con | --co | --c )
- $as_echo "$ac_cs_config"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
- debug=: ;;
- --file | --fil | --fi | --f )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- '') as_fn_error $? "missing file argument" ;;
- esac
- as_fn_append CONFIG_FILES " '$ac_optarg'"
- ac_need_defaults=false;;
- --header | --heade | --head | --hea )
- $ac_shift
- case $ac_optarg in
- *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
- esac
- as_fn_append CONFIG_HEADERS " '$ac_optarg'"
- ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- as_fn_error $? "ambiguous option: \`$1'
-Try \`$0 --help' for more information.";;
- --help | --hel | -h )
- $as_echo "$ac_cs_usage"; exit ;;
- -q | -quiet | --quiet | --quie | --qui | --qu | --q \
- | -silent | --silent | --silen | --sile | --sil | --si | --s)
- ac_cs_silent=: ;;
-
- # This is an error.
- -*) as_fn_error $? "unrecognized option: \`$1'
-Try \`$0 --help' for more information." ;;
-
- *) as_fn_append ac_config_targets " $1"
- ac_need_defaults=false ;;
-
- esac
- shift
-done
-
-ac_configure_extra_args=
-
-if $ac_cs_silent; then
- exec 6>/dev/null
- ac_configure_extra_args="$ac_configure_extra_args --silent"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-if \$ac_cs_recheck; then
- set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
- shift
- \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
- CONFIG_SHELL='$SHELL'
- export CONFIG_SHELL
- exec "\$@"
-fi
-
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- $as_echo "$ac_log"
-} >&5
-
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-#
-# INIT-COMMANDS
-#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
-
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-
-# Handling of arguments.
-for ac_config_target in $ac_config_targets
-do
- case $ac_config_target in
- "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
- "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "breakpad.pc") CONFIG_FILES="$CONFIG_FILES breakpad.pc" ;;
- "breakpad-client.pc") CONFIG_FILES="$CONFIG_FILES breakpad-client.pc" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
-
- *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
- esac
-done
-
-
-# If the user did not use the arguments to specify the items to instantiate,
-# then the envvar interface is used. Set only those that are not.
-# We use the long form for the default assignment because of an extremely
-# bizarre bug on SunOS 4.1.3.
-if $ac_need_defaults; then
- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
-fi
-
-# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
-# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
-$debug ||
-{
- tmp= ac_tmp=
- trap 'exit_status=$?
- : "${ac_tmp:=$tmp}"
- { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
-' 0
- trap 'as_fn_exit 1' 1 2 13 15
-}
-# Create a (secure) tmp directory for tmp files.
-
-{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
- test -d "$tmp"
-} ||
-{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
-} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
-
-# Set up the scripts for CONFIG_FILES section.
-# No need to generate them if there are no CONFIG_FILES.
-# This happens for instance with `./config.status config.h'.
-if test -n "$CONFIG_FILES"; then
-
-
-ac_cr=`echo X | tr X '\015'`
-# On cygwin, bash can eat \r inside `` if the user requested igncr.
-# But we know of no other shell where ac_cr would be empty at this
-# point, so we can use a bashism as a fallback.
-if test "x$ac_cr" = x; then
- eval ac_cr=\$\'\\r\'
-fi
-ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
-if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
- ac_cs_awk_cr='\\r'
-else
- ac_cs_awk_cr=$ac_cr
-fi
-
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
-_ACEOF
-
-
-{
- echo "cat >conf$$subs.awk <<_ACEOF" &&
- echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
- echo "_ACEOF"
-} >conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- . ./conf$$subs.sh ||
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
-
- ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
- if test $ac_delim_n = $ac_delim_num; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-rm -f conf$$subs.sh
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
-_ACEOF
-sed -n '
-h
-s/^/S["/; s/!.*/"]=/
-p
-g
-s/^[^!]*!//
-:repl
-t repl
-s/'"$ac_delim"'$//
-t delim
-:nl
-h
-s/\(.\{148\}\)..*/\1/
-t more1
-s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
-p
-n
-b repl
-:more1
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t nl
-:delim
-h
-s/\(.\{148\}\)..*/\1/
-t more2
-s/["\\]/\\&/g; s/^/"/; s/$/"/
-p
-b
-:more2
-s/["\\]/\\&/g; s/^/"/; s/$/"\\/
-p
-g
-s/.\{148\}//
-t delim
-' <conf$$subs.awk | sed '
-/^[^""]/{
- N
- s/\n//
-}
-' >>$CONFIG_STATUS || ac_write_fail=1
-rm -f conf$$subs.awk
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-_ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
- for (key in S) S_is_set[key] = 1
- FS = ""
-
-}
-{
- line = $ 0
- nfields = split(line, field, "@")
- substed = 0
- len = length(field[1])
- for (i = 2; i < nfields; i++) {
- key = field[i]
- keylen = length(key)
- if (S_is_set[key]) {
- value = S[key]
- line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
- len += length(value) + length(field[++i])
- substed = 1
- } else
- len += 1 + keylen
- }
-
- print line
-}
-
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
- sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
-else
- cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
- || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
-_ACEOF
-
-# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
-# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
-h
-s///
-s/^/:/
-s/[ ]*$/:/
-s/:\$(srcdir):/:/g
-s/:\${srcdir}:/:/g
-s/:@srcdir@:/:/g
-s/^:*//
-s/:*$//
-x
-s/\(=[ ]*\).*/\1/
-G
-s/\n//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-fi # test -n "$CONFIG_FILES"
-
-# Set up the scripts for CONFIG_HEADERS section.
-# No need to generate them if there are no CONFIG_HEADERS.
-# This happens for instance with `./config.status Makefile'.
-if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
-BEGIN {
-_ACEOF
-
-# Transform confdefs.h into an awk script `defines.awk', embedded as
-# here-document in config.status, that substitutes the proper values into
-# config.h.in to produce config.h.
-
-# Create a delimiter string that does not exist in confdefs.h, to ease
-# handling of long lines.
-ac_delim='%!_!# '
-for ac_last_try in false false :; do
- ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
- if test -z "$ac_tt"; then
- break
- elif $ac_last_try; then
- as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
- fi
-done
-
-# For the awk script, D is an array of macro values keyed by name,
-# likewise P contains macro parameters if any. Preserve backslash
-# newline sequences.
-
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-sed -n '
-s/.\{148\}/&'"$ac_delim"'/g
-t rset
-:rset
-s/^[ ]*#[ ]*define[ ][ ]*/ /
-t def
-d
-:def
-s/\\$//
-t bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3"/p
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
-d
-:bsnl
-s/["\\]/\\&/g
-s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
-D["\1"]=" \3\\\\\\n"\\/p
-t cont
-s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
-t cont
-d
-:cont
-n
-s/.\{148\}/&'"$ac_delim"'/g
-t clear
-:clear
-s/\\$//
-t bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/"/p
-d
-:bsnlc
-s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
-b cont
-' <confdefs.h | sed '
-s/'"$ac_delim"'/"\\\
-"/g' >>$CONFIG_STATUS || ac_write_fail=1
-
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- for (key in D) D_is_set[key] = 1
- FS = ""
-}
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
- line = \$ 0
- split(line, arg, " ")
- if (arg[1] == "#") {
- defundef = arg[2]
- mac1 = arg[3]
- } else {
- defundef = substr(arg[1], 2)
- mac1 = arg[2]
- }
- split(mac1, mac2, "(") #)
- macro = mac2[1]
- prefix = substr(line, 1, index(line, defundef) - 1)
- if (D_is_set[macro]) {
- # Preserve the white space surrounding the "#".
- print prefix "define", macro P[macro] D[macro]
- next
- } else {
- # Replace #undef with comments. This is necessary, for example,
- # in the case of _POSIX_SOURCE, which is predefined and required
- # on some systems where configure will not decide to define it.
- if (defundef == "undef") {
- print "/*", prefix defundef, macro, "*/"
- next
- }
- }
-}
-{ print }
-_ACAWK
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
- as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
-fi # test -n "$CONFIG_HEADERS"
-
-
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
-shift
-for ac_tag
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$ac_tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
- esac
- case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
- as_fn_append ac_file_inputs " '$ac_f'"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input='Generated from '`
- $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
- `' by configure.'
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
- fi
- # Neutralize special characters interpreted by sed in replacement strings.
- case $configure_input in #(
- *\&* | *\|* | *\\* )
- ac_sed_conf_input=`$as_echo "$configure_input" |
- sed 's/[\\\\&|]/\\\\&/g'`;; #(
- *) ac_sed_conf_input=$configure_input;;
- esac
-
- case $ac_tag in
- *:-:* | *:-) cat >"$ac_tmp/stdin" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
- esac
- ;;
- esac
-
- ac_dir=`$as_dirname -- "$ac_file" ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir="$ac_dir"; as_fn_mkdir_p
- ac_builddir=.
-
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
- ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
-
-case $srcdir in
- .) # We are building in place.
- ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
-esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
-
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
-
- case $INSTALL in
- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
- esac
- ac_MKDIR_P=$MKDIR_P
- case $MKDIR_P in
- [\\/$]* | ?:[\\/]* ) ;;
- */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
- esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-ac_sed_dataroot='
-/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p'
-case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
-_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
-cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_sed_extra="$ac_vpsub
-$extrasub
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
-:t
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s|@configure_input@|$ac_sed_conf_input|;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@top_build_prefix@&$ac_top_build_prefix&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-s&@MKDIR_P@&$ac_MKDIR_P&;t t
-$ac_datarootdir_hack
-"
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
- >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
- "$ac_tmp/out"`; test -z "$ac_out"; } &&
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined" >&2;}
-
- rm -f "$ac_tmp/stdin"
- case $ac_file in
- -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
- *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
- esac \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
- if test x"$ac_file" != x-; then
- {
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
- } >"$ac_tmp/config.h" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
- else
- rm -f "$ac_file"
- mv "$ac_tmp/config.h" "$ac_file" \
- || as_fn_error $? "could not create $ac_file" "$LINENO" 5
- fi
- else
- $as_echo "/* $configure_input */" \
- && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
- || as_fn_error $? "could not create -" "$LINENO" 5
- fi
-# Compute "$ac_file"'s index in $config_headers.
-_am_arg="$ac_file"
-_am_stamp_count=1
-for _am_header in $config_headers :; do
- case $_am_header in
- $_am_arg | $_am_arg:* )
- break ;;
- * )
- _am_stamp_count=`expr $_am_stamp_count + 1` ;;
- esac
-done
-echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
-$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$_am_arg" : 'X\(//\)[^/]' \| \
- X"$_am_arg" : 'X\(//\)$' \| \
- X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`/stamp-h$_am_stamp_count
- ;;
-
- :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
- ;;
- esac
-
-
- case $ac_file$ac_mode in
- "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Older Autoconf quotes --file arguments for eval, but not when files
- # are listed without --file. Let's play safe and only enable the eval
- # if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
- shift
- for mf
- do
- # Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
- # limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
- done
-}
- ;;
-
- esac
-done # for ac_tag
-
-
-as_fn_exit 0
-_ACEOF
-ac_clean_files=$ac_clean_files_save
-
-test $ac_write_fail = 0 ||
- as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
-
-
-# configure is writing to config.log, and then calls config.status.
-# config.status does its own redirection, appending to config.log.
-# Unfortunately, on DOS this fails, as config.log is still kept open
-# by configure, so config.status won't be able to write to it; its
-# output is simply discarded. So we exec the FD to /dev/null,
-# effectively closing config.log, so it can be properly (re)opened and
-# appended to by config.status. When coming back to configure, we
-# need to make the FD available again.
-if test "$no_create" != yes; then
- ac_cs_success=:
- ac_config_status_args=
- test "$silent" = yes &&
- ac_config_status_args="$ac_config_status_args --quiet"
- exec 5>/dev/null
- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
- exec 5>>config.log
- # Use ||, not &&, to avoid exiting from the if with $? = 1, which
- # would make configure fail if this is the last instruction.
- $ac_cs_success || as_fn_exit 1
-fi
-if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
-fi
-
diff --git a/toolkit/crashreporter/google-breakpad/configure.ac b/toolkit/crashreporter/google-breakpad/configure.ac
deleted file mode 100644
index 23195b7d3e..0000000000
--- a/toolkit/crashreporter/google-breakpad/configure.ac
+++ /dev/null
@@ -1,204 +0,0 @@
-# Copyright (c) 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-AC_PREREQ(2.57)
-
-AC_INIT(breakpad, 0.1, google-breakpad-dev@googlegroups.com)
-dnl Sanity check: the argument is just a file that should exist.
-AC_CONFIG_SRCDIR(README.md)
-AC_CONFIG_AUX_DIR(autotools)
-AC_CONFIG_MACRO_DIR([m4])
-AC_CANONICAL_HOST
-
-AM_INIT_AUTOMAKE(subdir-objects tar-ustar 1.11.1)
-AM_CONFIG_HEADER(src/config.h)
-AM_MAINTAINER_MODE
-
-AM_PROG_AR
-AM_PROG_AS
-AC_PROG_CC
-AM_PROG_CC_C_O
-AC_PROG_CPP
-AC_PROG_CXX
-AC_PROG_RANLIB
-AM_CONDITIONAL(GCC, test "$GCC" = yes) # let the Makefile know if we're gcc
-
-dnl This must come before all the feature tests below.
-AC_ARG_ENABLE(m32,
- AS_HELP_STRING([--enable-m32],
- [Compile/build with -m32]
- [(default is no)]),
- [case "${enableval}" in
- yes)
- CFLAGS="${CFLAGS} -m32"
- CXXFLAGS="${CXXFLAGS} -m32"
- usem32=true
- ;;
- no)
- usem32=false
- ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} for --enable-m32)
- ;;
- esac],
- [usem32=false])
-
-AC_HEADER_STDC
-AC_SYS_LARGEFILE
-m4_include(m4/ax_pthread.m4)
-AX_PTHREAD
-AC_CHECK_HEADERS([a.out.h])
-
-m4_include(m4/ax_cxx_compile_stdcxx.m4)
-AX_CXX_COMPILE_STDCXX(11, noext, mandatory)
-
-# Only build Linux client libs when compiling for Linux
-case $host in
- *-*-linux* | *-android* )
- LINUX_HOST=true
- ;;
-esac
-AM_CONDITIONAL(LINUX_HOST, test x$LINUX_HOST = xtrue)
-
-# Only use Android support headers when compiling for Android
-case $host in
- *-android*)
- ANDROID_HOST=true
- ;;
-esac
-AM_CONDITIONAL(ANDROID_HOST, test x$ANDROID_HOST = xtrue)
-
-# Some tools (like mac ones) only support x86 currently.
-case $host_cpu in
- i?86|x86_64)
- X86_HOST=true
- ;;
-esac
-AM_CONDITIONAL(X86_HOST, test x$X86_HOST = xtrue)
-
-AC_ARG_ENABLE(processor,
- AS_HELP_STRING([--disable-processor],
- [Don't build processor library]
- [(default is no)]),
- [case "${enableval}" in
- yes)
- disable_processor=false
- ;;
- no)
- disable_processor=true
- ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} for --disable-processor)
- ;;
- esac],
- [disable_processor=false])
-AM_CONDITIONAL(DISABLE_PROCESSOR, test x$disable_processor = xtrue)
-
-AC_ARG_ENABLE(tools,
- AS_HELP_STRING([--disable-tools],
- [Don't build tool binaries]
- [(default is no)]),
- [case "${enableval}" in
- yes)
- disable_tools=false
- ;;
- no)
- disable_tools=true
- ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} for --disable-tools)
- ;;
- esac],
- [disable_tools=false])
-AM_CONDITIONAL(DISABLE_TOOLS, test x$disable_tools = xtrue)
-
-if test x$LINUX_HOST = xfalse -a x$disable_processor = xtrue -a x$disable_tools = xtrue; then
- AC_MSG_ERROR([--disable-processor and --disable-tools were specified, and not building for Linux. Nothing to build!])
-fi
-
-AC_ARG_ENABLE(system-test-libs,
- AS_HELP_STRING([--enable-system-test-libs],
- [Use gtest/gmock/etc... from the system instead ]
- [of the local copies (default is local)]),
- [case "${enableval}" in
- yes)
- system_test_libs=true
- ;;
- no)
- system_test_libs=false
- ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} for --enable-system-test-libs)
- ;;
- esac],
- [system_test_libs=false])
-AM_CONDITIONAL(SYSTEM_TEST_LIBS, test x$system_test_libs = xtrue)
-
-AC_ARG_VAR([GMOCK_CONFIG], [Path to gmock-config script])
-AC_ARG_VAR([GMOCK_CFLAGS], [Compiler flags for gmock])
-AC_ARG_VAR([GMOCK_LIBS], [Linker flags for gmock])
-AC_ARG_VAR([GTEST_CONFIG], [Path to gtest-config script])
-AC_ARG_VAR([GTEST_CFLAGS], [Compiler flags for gtest])
-AC_ARG_VAR([GTEST_LIBS], [Linker flags for gtest])
-if test x$system_test_libs = xtrue; then
- AC_CHECK_TOOL([GMOCK_CONFIG], [gmock-config])
- AC_CHECK_TOOL([GTEST_CONFIG], [gtest-config])
- GMOCK_CFLAGS=`$GMOCK_CONFIG --cppflags --cxxflags`
- GMOCK_LIBS=`$GMOCK_CONFIG --ldflags --libs`
- GTEST_CFLAGS=`$GTEST_CONFIG --cppflags --cxxflags`
- GTEST_LIBS=`$GTEST_CONFIG --ldflags --libs`
-fi
-
-AC_ARG_ENABLE(selftest,
- AS_HELP_STRING([--enable-selftest],
- [Run extra tests with "make check" ]
- [(may conflict with optimizations) ]
- [(default is no)]),
- [case "${enableval}" in
- yes)
- selftest=true
- ;;
- no)
- selftest=false
- ;;
- *)
- AC_MSG_ERROR(bad value ${enableval} for --enable-selftest)
- ;;
- esac],
- [selftest=false])
-AM_CONDITIONAL(SELFTEST, test x$selftest = xtrue)
-
-AC_CONFIG_FILES(m4_flatten([
- breakpad.pc
- breakpad-client.pc
- Makefile
-]))
-
-AC_OUTPUT
diff --git a/toolkit/crashreporter/google-breakpad/m4/ax_pthread.m4 b/toolkit/crashreporter/google-breakpad/m4/ax_pthread.m4
deleted file mode 100644
index ca164eb25a..0000000000
--- a/toolkit/crashreporter/google-breakpad/m4/ax_pthread.m4
+++ /dev/null
@@ -1,283 +0,0 @@
-# ===========================================================================
-# http://www.nongnu.org/autoconf-archive/ax_pthread.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
-#
-# DESCRIPTION
-#
-# This macro figures out how to build C programs using POSIX threads. It
-# sets the PTHREAD_LIBS output variable to the threads library and linker
-# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
-# flags that are needed. (The user can also force certain compiler
-# flags/libs to be tested by setting these environment variables.)
-#
-# Also sets PTHREAD_CC to any special C compiler that is needed for
-# multi-threaded programs (defaults to the value of CC otherwise). (This
-# is necessary on AIX to use the special cc_r compiler alias.)
-#
-# NOTE: You are assumed to not only compile your program with these flags,
-# but also link it with them as well. e.g. you should link with
-# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
-#
-# If you are only building threads programs, you may wish to use these
-# variables in your default LIBS, CFLAGS, and CC:
-#
-# LIBS="$PTHREAD_LIBS $LIBS"
-# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-# CC="$PTHREAD_CC"
-#
-# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
-# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
-# (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
-#
-# ACTION-IF-FOUND is a list of shell commands to run if a threads library
-# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
-# is not found. If ACTION-IF-FOUND is not specified, the default action
-# will define HAVE_PTHREAD.
-#
-# Please let the authors know if this macro fails on any platform, or if
-# you have any other suggestions or comments. This macro was based on work
-# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
-# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
-# Alejandro Forero Cuervo to the autoconf macro repository. We are also
-# grateful for the helpful feedback of numerous users.
-#
-# LICENSE
-#
-# Copyright (c) 2008 Steven G. Johnson <stevenj@alum.mit.edu>
-#
-# This program is free software: you can redistribute it and/or modify it
-# under the terms of the GNU General Public License as published by the
-# Free Software Foundation, either version 3 of the License, or (at your
-# option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-# Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-# As a special exception, the respective Autoconf Macro's copyright owner
-# gives unlimited permission to copy, distribute and modify the configure
-# scripts that are the output of Autoconf when processing the Macro. You
-# need not follow the terms of the GNU General Public License when using
-# or distributing such scripts, even though portions of the text of the
-# Macro appear in them. The GNU General Public License (GPL) does govern
-# all other use of the material that constitutes the Autoconf Macro.
-#
-# This special exception to the GPL applies to versions of the Autoconf
-# Macro released by the Autoconf Archive. When you make and distribute a
-# modified version of the Autoconf Macro, you may extend this special
-# exception to the GPL to apply to your modified version as well.
-
-#serial 6
-
-AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
-AC_DEFUN([AX_PTHREAD], [
-AC_REQUIRE([AC_CANONICAL_HOST])
-AC_LANG_SAVE
-AC_LANG_C
-ax_pthread_ok=no
-
-# We used to check for pthread.h first, but this fails if pthread.h
-# requires special compiler flags (e.g. on True64 or Sequent).
-# It gets checked for in the link test anyway.
-
-# First of all, check if the user has set any of the PTHREAD_LIBS,
-# etcetera environment variables, and if threads linking works using
-# them:
-if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
- AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
- AC_MSG_RESULT($ax_pthread_ok)
- if test x"$ax_pthread_ok" = xno; then
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
- fi
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-fi
-
-# We must check for the threads library under a number of different
-# names; the ordering is very important because some systems
-# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
-# libraries is broken (non-POSIX).
-
-# Create a list of thread flags to try. Items starting with a "-" are
-# C compiler flags, and other items are library names, except for "none"
-# which indicates that we try without any flags at all, and "pthread-config"
-# which is a program returning the flags for the Pth emulation library.
-
-ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
-
-# The ordering *is* (sometimes) important. Some notes on the
-# individual items follow:
-
-# pthreads: AIX (must check this before -lpthread)
-# none: in case threads are in libc; should be tried before -Kthread and
-# other compiler flags to prevent continual compiler warnings
-# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
-# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
-# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
-# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
-# -pthreads: Solaris/gcc
-# -mthreads: Mingw32/gcc, Lynx/gcc
-# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
-# doesn't hurt to check since this sometimes defines pthreads too;
-# also defines -D_REENTRANT)
-# ... -mt is also the pthreads flag for HP/aCC
-# pthread: Linux, etcetera
-# --thread-safe: KAI C++
-# pthread-config: use pthread-config program (for GNU Pth library)
-
-case "${host_cpu}-${host_os}" in
- *solaris*)
-
- # On Solaris (at least, for some versions), libc contains stubbed
- # (non-functional) versions of the pthreads routines, so link-based
- # tests will erroneously succeed. (We need to link with -pthreads/-mt/
- # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
- # a function called by this macro, so we could check for that, but
- # who knows whether they'll stub that too in a future libc.) So,
- # we'll just look for -pthreads and -lpthread first:
-
- ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
- ;;
-
- *-darwin*)
- acx_pthread_flags="-pthread $acx_pthread_flags"
- ;;
-esac
-
-if test x"$ax_pthread_ok" = xno; then
-for flag in $ax_pthread_flags; do
-
- case $flag in
- none)
- AC_MSG_CHECKING([whether pthreads work without any flags])
- ;;
-
- -*)
- AC_MSG_CHECKING([whether pthreads work with $flag])
- PTHREAD_CFLAGS="$flag"
- ;;
-
- pthread-config)
- AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
- if test x"$ax_pthread_config" = xno; then continue; fi
- PTHREAD_CFLAGS="`pthread-config --cflags`"
- PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
- ;;
-
- *)
- AC_MSG_CHECKING([for the pthreads library -l$flag])
- PTHREAD_LIBS="-l$flag"
- ;;
- esac
-
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Check for various functions. We must include pthread.h,
- # since some functions may be macros. (On the Sequent, we
- # need a special flag -Kthread to make this header compile.)
- # We check for pthread_join because it is in -lpthread on IRIX
- # while pthread_create is in libc. We check for pthread_attr_init
- # due to DEC craziness with -lpthreads. We check for
- # pthread_cleanup_push because it is one of the few pthread
- # functions on Solaris that doesn't have a non-functional libc stub.
- # We try pthread_create on general principles.
- AC_TRY_LINK([#include <pthread.h>
- static void routine(void* a) {a=0;}
- static void* start_routine(void* a) {return a;}],
- [pthread_t th; pthread_attr_t attr;
- pthread_join(th, 0);
- pthread_attr_init(&attr);
- pthread_cleanup_push(routine, 0);
- pthread_create(&th,0,start_routine,0);
- pthread_cleanup_pop(0); ],
- [ax_pthread_ok=yes])
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- AC_MSG_RESULT($ax_pthread_ok)
- if test "x$ax_pthread_ok" = xyes; then
- break;
- fi
-
- PTHREAD_LIBS=""
- PTHREAD_CFLAGS=""
-done
-fi
-
-# Various other checks:
-if test "x$ax_pthread_ok" = xyes; then
- save_LIBS="$LIBS"
- LIBS="$PTHREAD_LIBS $LIBS"
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-
- # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
- AC_MSG_CHECKING([for joinable pthread attribute])
- attr_name=unknown
- for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
- AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
- [attr_name=$attr; break])
- done
- AC_MSG_RESULT($attr_name)
- if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
- AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
- [Define to necessary symbol if this constant
- uses a non-standard name on your system.])
- fi
-
- AC_MSG_CHECKING([if more special flags are required for pthreads])
- flag=no
- case "${host_cpu}-${host_os}" in
- *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
- *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
- esac
- AC_MSG_RESULT(${flag})
- if test "x$flag" != xno; then
- PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
- fi
-
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
-
- # More AIX lossage: must compile with xlc_r or cc_r
- if test x"$GCC" != xyes; then
- AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
- else
- PTHREAD_CC=$CC
- fi
-else
- PTHREAD_CC="$CC"
-fi
-
-AC_SUBST(PTHREAD_LIBS)
-AC_SUBST(PTHREAD_CFLAGS)
-AC_SUBST(PTHREAD_CC)
-
-# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
-if test x"$ax_pthread_ok" = xyes; then
- ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
- :
-else
- ax_pthread_ok=no
- $2
-fi
-AC_LANG_RESTORE
-])dnl AX_PTHREAD \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/m4/libtool.m4 b/toolkit/crashreporter/google-breakpad/m4/libtool.m4
deleted file mode 100644
index a3fee5360f..0000000000
--- a/toolkit/crashreporter/google-breakpad/m4/libtool.m4
+++ /dev/null
@@ -1,7377 +0,0 @@
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# 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.
-
-m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
-#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-])
-
-# serial 56 LT_INIT
-
-
-# LT_PREREQ(VERSION)
-# ------------------
-# Complain and exit if this libtool version is less that VERSION.
-m4_defun([LT_PREREQ],
-[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
- [m4_default([$3],
- [m4_fatal([Libtool version $1 or higher is required],
- 63)])],
- [$2])])
-
-
-# _LT_CHECK_BUILDDIR
-# ------------------
-# Complain if the absolute build directory name contains unusual characters
-m4_defun([_LT_CHECK_BUILDDIR],
-[case `pwd` in
- *\ * | *\ *)
- AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
-esac
-])
-
-
-# LT_INIT([OPTIONS])
-# ------------------
-AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
-AC_BEFORE([$0], [LT_LANG])dnl
-AC_BEFORE([$0], [LT_OUTPUT])dnl
-AC_BEFORE([$0], [LTDL_INIT])dnl
-m4_require([_LT_CHECK_BUILDDIR])dnl
-
-dnl Autoconf doesn't catch unexpanded LT_ macros by default:
-m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
-m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
-dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
-dnl unless we require an AC_DEFUNed macro:
-AC_REQUIRE([LTOPTIONS_VERSION])dnl
-AC_REQUIRE([LTSUGAR_VERSION])dnl
-AC_REQUIRE([LTVERSION_VERSION])dnl
-AC_REQUIRE([LTOBSOLETE_VERSION])dnl
-m4_require([_LT_PROG_LTMAIN])dnl
-
-dnl Parse OPTIONS
-_LT_SET_OPTIONS([$0], [$1])
-
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
-
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
-
-_LT_SETUP
-
-# Only expand once:
-m4_define([LT_INIT])
-])# LT_INIT
-
-# Old names:
-AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
-AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
-dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
-
-
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
-m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
-])
-
-
-# _LT_FILEUTILS_DEFAULTS
-# ----------------------
-# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
-m4_defun([_LT_FILEUTILS_DEFAULTS],
-[: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
-])# _LT_FILEUTILS_DEFAULTS
-
-
-# _LT_SETUP
-# ---------
-m4_defun([_LT_SETUP],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-_LT_DECL([], [host_alias], [0], [The host system])dnl
-_LT_DECL([], [host], [0])dnl
-_LT_DECL([], [host_os], [0])dnl
-dnl
-_LT_DECL([], [build_alias], [0], [The build system])dnl
-_LT_DECL([], [build], [0])dnl
-_LT_DECL([], [build_os], [0])dnl
-dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-dnl
-AC_REQUIRE([AC_PROG_LN_S])dnl
-test -z "$LN_S" && LN_S="ln -s"
-_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
-dnl
-AC_REQUIRE([LT_CMD_MAX_LEN])dnl
-_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
-_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
-dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_CHECK_SHELL_FEATURES])dnl
-m4_require([_LT_CMD_RELOAD])dnl
-m4_require([_LT_CHECK_MAGIC_METHOD])dnl
-m4_require([_LT_CMD_OLD_ARCHIVE])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-
-_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
-# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-])
-if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
-fi
-
-_LT_CHECK_OBJDIR
-
-m4_require([_LT_TAG_COMPILER])dnl
-_LT_PROG_ECHO_BACKSLASH
-
-case $host_os in
-aix3*)
- # AIX sometimes has problems with the GCC collect2 program. For some
- # reason, if we set the COLLECT_NAMES environment variable, the problems
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([["`\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Sed substitution to delay expansion of an escaped single quote.
-delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
-
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
-
-# Global variables:
-ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
-test -z "$LD" && LD=ld
-test -z "$ac_objext" && ac_objext=o
-
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-case $deplibs_check_method in
-file_magic*)
- if test "$file_magic_cmd" = '$MAGIC_CMD'; then
- _LT_PATH_MAGIC
- fi
- ;;
-esac
-
-# Use C for the default configuration in the libtool script
-LT_SUPPORTED_TAG([CC])
-_LT_LANG_C_CONFIG
-_LT_LANG_DEFAULT_CONFIG
-_LT_CONFIG_COMMANDS
-])# _LT_SETUP
-
-
-# _LT_PROG_LTMAIN
-# ---------------
-# Note that this code is called both from `configure', and `config.status'
-# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
-# so we pass a copy along to make sure it has a sensible value anyway.
-m4_defun([_LT_PROG_LTMAIN],
-[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
-_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
-])# _LT_PROG_LTMAIN
-
-
-## ------------------------------------- ##
-## Accumulate code for creating libtool. ##
-## ------------------------------------- ##
-
-# So that we can recreate a full libtool script including additional
-# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
-# label.
-
-
-# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
-# ----------------------------------------
-# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL_INIT],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_INIT])
-
-
-# _LT_CONFIG_LIBTOOL([COMMANDS])
-# ------------------------------
-# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
-m4_define([_LT_CONFIG_LIBTOOL],
-[m4_ifval([$1],
- [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
- [$1
-])])])
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
-
-
-# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
-# -----------------------------------------------------
-m4_defun([_LT_CONFIG_SAVE_COMMANDS],
-[_LT_CONFIG_LIBTOOL([$1])
-_LT_CONFIG_LIBTOOL_INIT([$2])
-])
-
-
-# _LT_FORMAT_COMMENT([COMMENT])
-# -----------------------------
-# Add leading comment marks to the start of each line, and a trailing
-# full-stop to the whole comment if one is not present already.
-m4_define([_LT_FORMAT_COMMENT],
-[m4_ifval([$1], [
-m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
- [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
-)])
-
-
-
-## ------------------------ ##
-## FIXME: Eliminate VARNAME ##
-## ------------------------ ##
-
-
-# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
-# -------------------------------------------------------------------
-# CONFIGNAME is the name given to the value in the libtool script.
-# VARNAME is the (base) name used in the configure script.
-# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
-# VARNAME. Any other value will be used directly.
-m4_define([_LT_DECL],
-[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
- [m4_ifval([$1], [$1], [$2])])
- lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
- m4_ifval([$4],
- [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
- lt_dict_add_subkey([lt_decl_dict], [$2],
- [tagged?], [m4_ifval([$5], [yes], [no])])])
-])
-
-
-# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
-# --------------------------------------------------------
-m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
-
-
-# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_tag_varnames],
-[_lt_decl_filter([tagged?], [yes], $@)])
-
-
-# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
-# ---------------------------------------------------------
-m4_define([_lt_decl_filter],
-[m4_case([$#],
- [0], [m4_fatal([$0: too few arguments: $#])],
- [1], [m4_fatal([$0: too few arguments: $#: $1])],
- [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
- [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
- [lt_dict_filter([lt_decl_dict], $@)])[]dnl
-])
-
-
-# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
-# --------------------------------------------------
-m4_define([lt_decl_quote_varnames],
-[_lt_decl_filter([value], [1], $@)])
-
-
-# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_dquote_varnames],
-[_lt_decl_filter([value], [2], $@)])
-
-
-# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
-# ---------------------------------------------------
-m4_define([lt_decl_varnames_tagged],
-[m4_assert([$# <= 2])dnl
-_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
- m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
-m4_define([_lt_decl_varnames_tagged],
-[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
-
-
-# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
-# ------------------------------------------------
-m4_define([lt_decl_all_varnames],
-[_$0(m4_quote(m4_default([$1], [[, ]])),
- m4_if([$2], [],
- m4_quote(lt_decl_varnames),
- m4_quote(m4_shift($@))))[]dnl
-])
-m4_define([_lt_decl_all_varnames],
-[lt_join($@, lt_decl_varnames_tagged([$1],
- lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
-])
-
-
-# _LT_CONFIG_STATUS_DECLARE([VARNAME])
-# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'. VARNAME
-# must have a single quote delimited value for this to work.
-m4_define([_LT_CONFIG_STATUS_DECLARE],
-[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`'])
-
-
-# _LT_CONFIG_STATUS_DECLARATIONS
-# ------------------------------
-# We delimit libtool config variables with single quotes, so when
-# we write them to config.status, we have to be sure to quote all
-# embedded single quotes properly. In configure, this macro expands
-# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
-#
-# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`'
-m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
- [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAGS
-# ----------------
-# Output comment and list of tags supported by the script
-m4_defun([_LT_LIBTOOL_TAGS],
-[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
-])
-
-
-# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
-# -----------------------------------
-# Extract the dictionary values for VARNAME (optionally with TAG) and
-# expand to a commented shell variable setting:
-#
-# # Some comment about what VAR is for.
-# visible_name=$lt_internal_name
-m4_define([_LT_LIBTOOL_DECLARE],
-[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
- [description])))[]dnl
-m4_pushdef([_libtool_name],
- m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
-m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
- [0], [_libtool_name=[$]$1],
- [1], [_libtool_name=$lt_[]$1],
- [2], [_libtool_name=$lt_[]$1],
- [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
-m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
-])
-
-
-# _LT_LIBTOOL_CONFIG_VARS
-# -----------------------
-# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
-# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
-# section) are produced by _LT_LIBTOOL_TAG_VARS.
-m4_defun([_LT_LIBTOOL_CONFIG_VARS],
-[m4_foreach([_lt_var],
- m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
-
-
-# _LT_LIBTOOL_TAG_VARS(TAG)
-# -------------------------
-m4_define([_LT_LIBTOOL_TAG_VARS],
-[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
- [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
-
-
-# _LT_TAGVAR(VARNAME, [TAGNAME])
-# ------------------------------
-m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
-
-
-# _LT_CONFIG_COMMANDS
-# -------------------
-# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
-# variables for single and double quote escaping we saved from calls
-# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'. Finally, any additional code accumulated
-# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
-m4_defun([_LT_CONFIG_COMMANDS],
-[AC_PROVIDE_IFELSE([LT_OUTPUT],
- dnl If the libtool generation code has been placed in $CONFIG_LT,
- dnl instead of duplicating it all over again into config.status,
- dnl then we will have config.status run $CONFIG_LT later, so it
- dnl needs to know what name is stored there:
- [AC_CONFIG_COMMANDS([libtool],
- [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
- dnl If the libtool generation code is destined for config.status,
- dnl expand the accumulated commands and init code now:
- [AC_CONFIG_COMMANDS([libtool],
- [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
-])#_LT_CONFIG_COMMANDS
-
-
-# Initialize.
-m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
-[
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-sed_quote_subst='$sed_quote_subst'
-double_quote_subst='$double_quote_subst'
-delay_variable_subst='$delay_variable_subst'
-_LT_CONFIG_STATUS_DECLARATIONS
-LTCC='$LTCC'
-LTCFLAGS='$LTCFLAGS'
-compiler='$compiler_DEFAULT'
-
-# Quote evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_quote_varnames); do
- case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Double-quote double-evaled strings.
-for var in lt_decl_all_varnames([[ \
-]], lt_decl_dquote_varnames); do
- case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in
- *[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
- ;;
- *)
- eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
- ;;
- esac
-done
-
-# Fix-up fallback echo if it was mangled by the above quoting rules.
-case \$lt_ECHO in
-*'\\\[$]0 --fallback-echo"')dnl "
- lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\`
- ;;
-esac
-
-_LT_OUTPUT_LIBTOOL_INIT
-])
-
-
-# LT_OUTPUT
-# ---------
-# This macro allows early generation of the libtool script (before
-# AC_OUTPUT is called), incase it is used in configure for compilation
-# tests.
-AC_DEFUN([LT_OUTPUT],
-[: ${CONFIG_LT=./config.lt}
-AC_MSG_NOTICE([creating $CONFIG_LT])
-cat >"$CONFIG_LT" <<_LTEOF
-#! $SHELL
-# Generated by $as_me.
-# Run this file to recreate a libtool stub with the current configuration.
-
-lt_cl_silent=false
-SHELL=\${CONFIG_SHELL-$SHELL}
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AS_SHELL_SANITIZE
-_AS_PREPARE
-
-exec AS_MESSAGE_FD>&1
-exec AS_MESSAGE_LOG_FD>>config.log
-{
- echo
- AS_BOX([Running $as_me.])
-} >&AS_MESSAGE_LOG_FD
-
-lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
-for use in further configure time tests before the real libtool is
-generated.
-
-Usage: $[0] [[OPTIONS]]
-
- -h, --help print this help, then exit
- -V, --version print version number, then exit
- -q, --quiet do not print progress messages
- -d, --debug don't remove temporary files
-
-Report bugs to <bug-libtool@gnu.org>."
-
-lt_cl_version="\
-m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
-m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
-configured by $[0], generated by m4_PACKAGE_STRING.
-
-Copyright (C) 2008 Free Software Foundation, Inc.
-This config.lt script is free software; the Free Software Foundation
-gives unlimited permision to copy, distribute and modify it."
-
-while test $[#] != 0
-do
- case $[1] in
- --version | --v* | -V )
- echo "$lt_cl_version"; exit 0 ;;
- --help | --h* | -h )
- echo "$lt_cl_help"; exit 0 ;;
- --debug | --d* | -d )
- debug=: ;;
- --quiet | --q* | --silent | --s* | -q )
- lt_cl_silent=: ;;
-
- -*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
-
- *) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
- esac
- shift
-done
-
-if $lt_cl_silent; then
- exec AS_MESSAGE_FD>/dev/null
-fi
-_LTEOF
-
-cat >>"$CONFIG_LT" <<_LTEOF
-_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
-_LTEOF
-
-cat >>"$CONFIG_LT" <<\_LTEOF
-AC_MSG_NOTICE([creating $ofile])
-_LT_OUTPUT_LIBTOOL_COMMANDS
-AS_EXIT(0)
-_LTEOF
-chmod +x "$CONFIG_LT"
-
-# configure is writing to config.log, but config.lt does its own redirection,
-# appending to config.log, which fails on DOS, as config.log is still kept
-# open by configure. Here we exec the FD to /dev/null, effectively closing
-# config.log, so it can be properly (re)opened and appended to by config.lt.
-if test "$no_create" != yes; then
- lt_cl_success=:
- test "$silent" = yes &&
- lt_config_lt_args="$lt_config_lt_args --quiet"
- exec AS_MESSAGE_LOG_FD>/dev/null
- $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
- exec AS_MESSAGE_LOG_FD>>config.log
- $lt_cl_success || AS_EXIT(1)
-fi
-])# LT_OUTPUT
-
-
-# _LT_CONFIG(TAG)
-# ---------------
-# If TAG is the built-in tag, create an initial libtool script with a
-# default configuration from the untagged config vars. Otherwise add code
-# to config.status for appending the configuration named by TAG from the
-# matching tagged config vars.
-m4_defun([_LT_CONFIG],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_CONFIG_SAVE_COMMANDS([
- m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
- m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options which allow our
- # commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
- setopt NO_GLOB_SUBST
- fi
-
- cfgfile="${ofile}T"
- trap "$RM \"$cfgfile\"; exit 1" 1 2 15
- $RM "$cfgfile"
-
- cat <<_LT_EOF >> "$cfgfile"
-#! $SHELL
-
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-_LT_COPYING
-_LT_LIBTOOL_TAGS
-
-# ### BEGIN LIBTOOL CONFIG
-_LT_LIBTOOL_CONFIG_VARS
-_LT_LIBTOOL_TAG_VARS
-# ### END LIBTOOL CONFIG
-
-_LT_EOF
-
- case $host_os in
- aix3*)
- cat <<\_LT_EOF >> "$cfgfile"
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-_LT_EOF
- ;;
- esac
-
- _LT_PROG_LTMAIN
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- _LT_PROG_XSI_SHELLFNS
-
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
- (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
- chmod +x "$ofile"
-],
-[cat <<_LT_EOF >> "$ofile"
-
-dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
-dnl in a comment (ie after a #).
-# ### BEGIN LIBTOOL TAG CONFIG: $1
-_LT_LIBTOOL_TAG_VARS(_LT_TAG)
-# ### END LIBTOOL TAG CONFIG: $1
-_LT_EOF
-])dnl /m4_if
-],
-[m4_if([$1], [], [
- PACKAGE='$PACKAGE'
- VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
- RM='$RM'
- ofile='$ofile'], [])
-])dnl /_LT_CONFIG_SAVE_COMMANDS
-])# _LT_CONFIG
-
-
-# LT_SUPPORTED_TAG(TAG)
-# ---------------------
-# Trace this macro to discover what tags are supported by the libtool
-# --tag option, using:
-# autoconf --trace 'LT_SUPPORTED_TAG:$1'
-AC_DEFUN([LT_SUPPORTED_TAG], [])
-
-
-# C support is built-in for now
-m4_define([_LT_LANG_C_enabled], [])
-m4_define([_LT_TAGS], [])
-
-
-# LT_LANG(LANG)
-# -------------
-# Enable libtool support for the given language if not already enabled.
-AC_DEFUN([LT_LANG],
-[AC_BEFORE([$0], [LT_OUTPUT])dnl
-m4_case([$1],
- [C], [_LT_LANG(C)],
- [C++], [_LT_LANG(CXX)],
- [Java], [_LT_LANG(GCJ)],
- [Fortran 77], [_LT_LANG(F77)],
- [Fortran], [_LT_LANG(FC)],
- [Windows Resource], [_LT_LANG(RC)],
- [m4_ifdef([_LT_LANG_]$1[_CONFIG],
- [_LT_LANG($1)],
- [m4_fatal([$0: unsupported language: "$1"])])])dnl
-])# LT_LANG
-
-
-# _LT_LANG(LANGNAME)
-# ------------------
-m4_defun([_LT_LANG],
-[m4_ifdef([_LT_LANG_]$1[_enabled], [],
- [LT_SUPPORTED_TAG([$1])dnl
- m4_append([_LT_TAGS], [$1 ])dnl
- m4_define([_LT_LANG_]$1[_enabled], [])dnl
- _LT_LANG_$1_CONFIG($1)])dnl
-])# _LT_LANG
-
-
-# _LT_LANG_DEFAULT_CONFIG
-# -----------------------
-m4_defun([_LT_LANG_DEFAULT_CONFIG],
-[AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [LT_LANG(CXX)],
- [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_F77],
- [LT_LANG(F77)],
- [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
-
-AC_PROVIDE_IFELSE([AC_PROG_FC],
- [LT_LANG(FC)],
- [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
-
-dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
-dnl pulling things in needlessly.
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [LT_LANG(GCJ)],
- [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
- [LT_LANG(GCJ)],
- [m4_ifdef([AC_PROG_GCJ],
- [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([A][M_PROG_GCJ],
- [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
- m4_ifdef([LT_PROG_GCJ],
- [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
-
-AC_PROVIDE_IFELSE([LT_PROG_RC],
- [LT_LANG(RC)],
- [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
-])# _LT_LANG_DEFAULT_CONFIG
-
-# Obsolete macros:
-AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
-AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
-AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
-AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
-dnl AC_DEFUN([AC_LIBTOOL_F77], [])
-dnl AC_DEFUN([AC_LIBTOOL_FC], [])
-dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
-
-
-# _LT_TAG_COMPILER
-# ----------------
-m4_defun([_LT_TAG_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
-_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
-_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
-_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_TAG_COMPILER
-
-
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-m4_defun([_LT_COMPILER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$RM conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-m4_defun([_LT_LINKER_BOILERPLATE],
-[m4_require([_LT_DECL_SED])dnl
-ac_outfile=conftest.$ac_objext
-echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$RM -r conftest*
-])# _LT_LINKER_BOILERPLATE
-
-# _LT_REQUIRED_DARWIN_CHECKS
-# -------------------------
-m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
- case $host_os in
- rhapsody* | darwin*)
- AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
- AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
- AC_CHECK_TOOL([LIPO], [lipo], [:])
- AC_CHECK_TOOL([OTOOL], [otool], [:])
- AC_CHECK_TOOL([OTOOL64], [otool64], [:])
- _LT_DECL([], [DSYMUTIL], [1],
- [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
- _LT_DECL([], [NMEDIT], [1],
- [Tool to change global to local symbols on Mac OS X])
- _LT_DECL([], [LIPO], [1],
- [Tool to manipulate fat objects and archives on Mac OS X])
- _LT_DECL([], [OTOOL], [1],
- [ldd/readelf like tool for Mach-O binaries on Mac OS X])
- _LT_DECL([], [OTOOL64], [1],
- [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
-
- AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
- [lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
- # By default we will add the -single_module flag. You can override
- # by either setting the environment variable LT_MULTI_MODULE
- # non-empty at configure time, or by adding -multi_module to the
- # link flags.
- rm -rf libconftest.dylib*
- echo "int foo(void){return 1;}" > conftest.c
- echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
--dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
- $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
- -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
- _lt_result=$?
- if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
- lt_cv_apple_cc_single_mod=yes
- else
- cat conftest.err >&AS_MESSAGE_LOG_FD
- fi
- rm -rf libconftest.dylib*
- rm -f conftest.*
- fi])
- AC_CACHE_CHECK([for -exported_symbols_list linker flag],
- [lt_cv_ld_exported_symbols_list],
- [lt_cv_ld_exported_symbols_list=no
- save_LDFLAGS=$LDFLAGS
- echo "_main" > conftest.sym
- LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [lt_cv_ld_exported_symbols_list=yes],
- [lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
- ])
- case $host_os in
- rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
- darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- darwin*) # darwin 5.x on
- # if running on 10.5 or later, the deployment target defaults
- # to the OS version, if on x86, and 10.4, the deployment
- # target defaults to 10.4. Don't you love it?
- case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
- 10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- esac
- ;;
- esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
- _lt_dar_single_mod='$single_module'
- fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
- else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- if test "$DSYMUTIL" != ":"; then
- _lt_dsymutil='~$DSYMUTIL $lib || :'
- else
- _lt_dsymutil=
- fi
- ;;
- esac
-])
-
-
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
-# Checks for linker and compiler features on darwin
-m4_defun([_LT_DARWIN_LINKER_FEATURES],
-[
- m4_require([_LT_REQUIRED_DARWIN_CHECKS])
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_automatic, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(whole_archive_flag_spec, $1)=''
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
- case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
- *) _lt_dar_can_shared=$GCC ;;
- esac
- if test "$_lt_dar_can_shared" = "yes"; then
- output_verbose_link_cmd=echo
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
- m4_if([$1], [CXX],
-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
- fi
-],[])
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
-])
-
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-m4_defun([_LT_SYS_MODULE_PATH_AIX],
-[m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_SYS_MODULE_PATH_AIX
-
-
-# _LT_SHELL_INIT(ARG)
-# -------------------
-m4_define([_LT_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
- [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_SHELL_INIT
-
-
-# _LT_PROG_ECHO_BACKSLASH
-# -----------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-m4_defun([_LT_PROG_ECHO_BACKSLASH],
-[_LT_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$lt_ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-ECHO=${lt_ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then
- # Yippee, $ECHO works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<_LT_EOF
-[$]*
-_LT_EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-if test -z "$lt_ECHO"; then
- if test "X${echo_test_string+set}" != Xset; then
- # find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if { echo_test_string=`eval $cmd`; } 2>/dev/null &&
- { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null
- then
- break
- fi
- done
- fi
-
- if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
- else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- IFS="$lt_save_ifs"
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- ECHO="$dir/echo"
- break
- fi
- done
- IFS="$lt_save_ifs"
-
- if test "X$ECHO" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- ECHO='print -r'
- elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- ECHO='printf %s\n'
- if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- ECHO="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- ECHO=echo
- fi
- fi
- fi
- fi
- fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-lt_ECHO=$ECHO
-if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(lt_ECHO)
-])
-_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
-_LT_DECL([], [ECHO], [1],
- [An echo program that does not interpret backslashes])
-])# _LT_PROG_ECHO_BACKSLASH
-
-
-# _LT_ENABLE_LOCK
-# ---------------
-m4_defun([_LT_ENABLE_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
- [AS_HELP_STRING([--disable-libtool-lock],
- [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *ELF-32*)
- HPUX_IA64_MODE="32"
- ;;
- *ELF-64*)
- HPUX_IA64_MODE="64"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-*-*-irix6*)
- # Find out which ABI we are using.
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -melf32bsmip"
- ;;
- *N32*)
- LD="${LD-ld} -melf32bmipn32"
- ;;
- *64-bit*)
- LD="${LD-ld} -melf64bmip"
- ;;
- esac
- else
- case `/usr/bin/file conftest.$ac_objext` in
- *32-bit*)
- LD="${LD-ld} -32"
- ;;
- *N32*)
- LD="${LD-ld} -n32"
- ;;
- *64-bit*)
- LD="${LD-ld} -64"
- ;;
- esac
- fi
- fi
- rm -rf conftest*
- ;;
-
-x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
-s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *32-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_i386_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_i386"
- ;;
- ppc64-*linux*|powerpc64-*linux*)
- LD="${LD-ld} -m elf32ppclinux"
- ;;
- s390x-*linux*)
- LD="${LD-ld} -m elf_s390"
- ;;
- sparc64-*linux*)
- LD="${LD-ld} -m elf32_sparc"
- ;;
- esac
- ;;
- *64-bit*)
- case $host in
- x86_64-*kfreebsd*-gnu)
- LD="${LD-ld} -m elf_x86_64_fbsd"
- ;;
- x86_64-*linux*)
- LD="${LD-ld} -m elf_x86_64"
- ;;
- ppc*-*linux*|powerpc*-*linux*)
- LD="${LD-ld} -m elf64ppc"
- ;;
- s390*-*linux*|s390*-*tpf*)
- LD="${LD-ld} -m elf64_s390"
- ;;
- sparc*-*linux*)
- LD="${LD-ld} -m elf64_sparc"
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-
-*-*-sco3.2v5*)
- # On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -belf"
- AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_PUSH(C)
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
- # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
- fi
- ;;
-sparc*-*solaris*)
- # Find out which ABI we are using.
- echo 'int i;' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.o` in
- *64-bit*)
- case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
- *)
- if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
- LD="${LD-ld} -64"
- fi
- ;;
- esac
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-need_locks="$enable_libtool_lock"
-])# _LT_ENABLE_LOCK
-
-
-# _LT_CMD_OLD_ARCHIVE
-# -------------------
-m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
-
-AC_CHECK_TOOL(STRIP, strip, :)
-test -z "$STRIP" && STRIP=:
-_LT_DECL([], [STRIP], [1], [A symbol stripping program])
-
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-test -z "$RANLIB" && RANLIB=:
-_LT_DECL([], [RANLIB], [1],
- [Commands used to install an old-style archive])
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
- ;;
- *)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-_LT_DECL([], [old_postinstall_cmds], [2])
-_LT_DECL([], [old_postuninstall_cmds], [2])
-_LT_TAGDECL([], [old_archive_cmds], [2],
- [Commands used to build an old-style archive])
-])# _LT_CMD_OLD_ARCHIVE
-
-
-# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([_LT_COMPILER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- # The option is referenced via a variable to avoid confusing sed.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>conftest.err)
- ac_status=$?
- cat conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s "$ac_outfile"; then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings other than the usual output.
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- fi
- $RM conftest*
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$5], , :, [$5])
-else
- m4_if([$6], , :, [$6])
-fi
-])# _LT_COMPILER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
-
-
-# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-# [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------
-# Check whether the given linker option works
-AC_DEFUN([_LT_LINKER_OPTION],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_CACHE_CHECK([$1], [$2],
- [$2=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $3"
- echo "$lt_simple_link_test_code" > conftest.$ac_ext
- if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
- # The linker can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- # Append any errors to the config.log.
- cat conftest.err 1>&AS_MESSAGE_LOG_FD
- $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
- $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
- if diff conftest.exp conftest.er2 >/dev/null; then
- $2=yes
- fi
- else
- $2=yes
- fi
- fi
- $RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
- m4_if([$4], , :, [$4])
-else
- m4_if([$5], , :, [$5])
-fi
-])# _LT_LINKER_OPTION
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
-
-
-# LT_CMD_MAX_LEN
-#---------------
-AC_DEFUN([LT_CMD_MAX_LEN],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
- i=0
- teststring="ABCD"
-
- case $build_os in
- msdosdjgpp*)
- # On DJGPP, this test can blow up pretty badly due to problems in libc
- # (any single argument exceeding 2000 bytes causes a buffer overrun
- # during glob expansion). Even if it were fixed, the result of this
- # check would be larger than it should be.
- lt_cv_sys_max_cmd_len=12288; # 12K is about right
- ;;
-
- gnu*)
- # Under GNU Hurd, this test is not required because there is
- # no limit to the length of command line arguments.
- # Libtool will interpret -1 as no limit whatsoever
- lt_cv_sys_max_cmd_len=-1;
- ;;
-
- cygwin* | mingw* | cegcc*)
- # On Win9x/ME, this test blows up -- it succeeds, but takes
- # about 5 minutes as the teststring grows exponentially.
- # Worse, since 9x/ME are not pre-emptively multitasking,
- # you end up with a "frozen" computer, even though with patience
- # the test eventually succeeds (with a max line length of 256k).
- # Instead, let's just punt: use the minimum linelength reported by
- # all of the supported platforms: 8192 (on NT/2K/XP).
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- amigaos*)
- # On AmigaOS with pdksh, this test takes hours, literally.
- # So we just punt and use a minimum line length of 8192.
- lt_cv_sys_max_cmd_len=8192;
- ;;
-
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
- # This has been around since 386BSD, at least. Likely further.
- if test -x /sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
- elif test -x /usr/sbin/sysctl; then
- lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
- else
- lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
- fi
- # And add a safety zone
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- ;;
-
- interix*)
- # We know the value 262144 and hardcode it with a safety zone (like BSD)
- lt_cv_sys_max_cmd_len=196608
- ;;
-
- osf*)
- # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
- # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
- # nice to cause kernel panics so lets avoid the loop below.
- # First set a reasonable default.
- lt_cv_sys_max_cmd_len=16384
- #
- if test -x /sbin/sysconfig; then
- case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
- *1*) lt_cv_sys_max_cmd_len=-1 ;;
- esac
- fi
- ;;
- sco3.2v5*)
- lt_cv_sys_max_cmd_len=102400
- ;;
- sysv5* | sco5v6* | sysv4.2uw2*)
- kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
- if test -n "$kargmax"; then
- lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
- else
- lt_cv_sys_max_cmd_len=32768
- fi
- ;;
- *)
- lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
- if test -n "$lt_cv_sys_max_cmd_len"; then
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
- else
- # Make teststring a little bigger before we do anything with it.
- # a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
- teststring=$teststring$teststring
- done
- SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
- # If test is not a shell built-in, we'll probably end up computing a
- # maximum length that is only half of the actual maximum length, but
- # we can't tell.
- while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
- = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
- do
- i=`expr $i + 1`
- teststring=$teststring$teststring
- done
- # Only check the string length outside the loop.
- lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
- teststring=
- # Add a significant safety factor because C++ compilers can tack on
- # massive amounts of additional arguments before passing them to the
- # linker. It appears as though 1/2 is a usable value.
- lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
- fi
- ;;
- esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
- AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
- AC_MSG_RESULT(none)
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
-_LT_DECL([], [max_cmd_len], [0],
- [What is the maximum length of a command?])
-])# LT_CMD_MAX_LEN
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
-
-
-# _LT_HEADER_DLFCN
-# ----------------
-m4_defun([_LT_HEADER_DLFCN],
-[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
-])# _LT_HEADER_DLFCN
-
-
-# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ----------------------------------------------------------------
-m4_defun([_LT_TRY_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
- [$4]
-else
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<_LT_EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
- else
- puts (dlerror ());
-
- return status;
-}]
-_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_dlunknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_TRY_DLOPEN_SELF
-
-
-# LT_SYS_DLOPEN_SELF
-# ------------------
-AC_DEFUN([LT_SYS_DLOPEN_SELF],
-[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- cygwin*)
- lt_cv_dlopen="dlopen"
- lt_cv_dlopen_libs=
- ;;
-
- darwin*)
- # if libdl is installed we need to link against it
- AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ])
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- case $lt_cv_dlopen_self in
- yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
- *) enable_dlopen_self=unknown ;;
- esac
-
- case $lt_cv_dlopen_self_static in
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-_LT_DECL([dlopen_support], [enable_dlopen], [0],
- [Whether dlopen is supported])
-_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
- [Whether dlopen of programs is supported])
-_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
- [Whether dlopen of statically linked programs is supported])
-])# LT_SYS_DLOPEN_SELF
-
-# Old name:
-AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
-
-
-# _LT_COMPILER_C_O([TAGNAME])
-# ---------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler.
-# This macro does not hard code the compiler like AC_PROG_CC_C_O.
-m4_defun([_LT_COMPILER_C_O],
-[m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
- [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
- $RM -r conftest 2>/dev/null
- mkdir conftest
- cd conftest
- mkdir out
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- lt_compiler_flag="-o out/conftest2.$ac_objext"
- # Insert the option either (1) after the last *FLAGS variable, or
- # (2) before a word containing "conftest.", or (3) at the end.
- # Note that $ac_compile itself does not contain backslashes and begins
- # with a dollar sign (not a hyphen), so the echo should work correctly.
- lt_compile=`echo "$ac_compile" | $SED \
- -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
- -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
- -e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$lt_compile" 2>out/conftest.err)
- ac_status=$?
- cat out/conftest.err >&AS_MESSAGE_LOG_FD
- echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
- if (exit $ac_status) && test -s out/conftest2.$ac_objext
- then
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
- $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
- if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
- _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
- fi
- fi
- chmod u+w . 2>&AS_MESSAGE_LOG_FD
- $RM conftest*
- # SGI C++ compiler will create directory out/ii_files/ for
- # template instantiation
- test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
- $RM out/* && rmdir out
- cd ..
- $RM -r conftest
- $RM conftest*
-])
-_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
- [Does compiler simultaneously support -c and -o options?])
-])# _LT_COMPILER_C_O
-
-
-# _LT_COMPILER_FILE_LOCKS([TAGNAME])
-# ----------------------------------
-# Check to see if we can do hard links to lock some files if needed
-m4_defun([_LT_COMPILER_FILE_LOCKS],
-[m4_require([_LT_ENABLE_LOCK])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-_LT_COMPILER_C_O([$1])
-
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $RM conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
-])# _LT_COMPILER_FILE_LOCKS
-
-
-# _LT_CHECK_OBJDIR
-# ----------------
-m4_defun([_LT_CHECK_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- lt_cv_objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-_LT_DECL([], [objdir], [0],
- [The name of the directory that contains temporary libtool files])dnl
-m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
-])# _LT_CHECK_OBJDIR
-
-
-# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
-# --------------------------------------
-# Check hardcoding attributes.
-m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
- test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
-
- # We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
- # Linking always hardcodes the temporary library directory.
- _LT_TAGVAR(hardcode_action, $1)=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- _LT_TAGVAR(hardcode_action, $1)=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- _LT_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-_LT_TAGDECL([], [hardcode_action], [0],
- [How to hardcode a shared library path into an executable])
-])# _LT_LINKER_HARDCODE_LIBPATH
-
-
-# _LT_CMD_STRIPLIB
-# ----------------
-m4_defun([_LT_CMD_STRIPLIB],
-[m4_require([_LT_DECL_EGREP])
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
- case $host_os in
- darwin*)
- if test -n "$STRIP" ; then
- striplib="$STRIP -x"
- old_striplib="$STRIP -S"
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- fi
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
-fi
-_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
-_LT_DECL([], [striplib], [1])
-])# _LT_CMD_STRIPLIB
-
-
-# _LT_SYS_DYNAMIC_LINKER([TAG])
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-m4_defun([_LT_SYS_DYNAMIC_LINKER],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_OBJDUMP])dnl
-m4_require([_LT_DECL_SED])dnl
-AC_MSG_CHECKING([dynamic linker characteristics])
-m4_if([$1],
- [], [
-if test "$GCC" = yes; then
- case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
- esac
- lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then
- # if the path contains ";" then we assume it to be the separator
- # otherwise default to the standard path separator (i.e. ":") - it is
- # assumed that no part of a normal pathname contains ";" but that should
- # okay in the real world where ";" in dirpaths is itself problematic.
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'`
- else
- lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- # Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
- lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
- for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
- test -d "$lt_sys_path" && \
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
- fi
- done
- lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
- for (lt_i = NF; lt_i > 0; lt_i--) {
- if ($lt_i != "" && $lt_i != ".") {
- if ($lt_i == "..") {
- lt_count++;
- } else {
- if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
- } else {
- lt_count--;
- }
- }
- }
- }
- if (lt_foo != "") { lt_freq[[lt_foo]]++; }
- if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
-}'`
- sys_lib_search_path_spec=`$ECHO $lt_search_path_spec`
-else
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-fi])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-need_lib_prefix=unknown
-hardcode_into_libs=no
-
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
-
-case $host_os in
-aix3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
- shlibpath_var=LIBPATH
-
- # AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
-
-aix[[4-9]]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- else
- # With GCC up to 2.95.x, collect2 would create an import file
- # for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
- # development snapshots of GCC prior to 3.0.
- case $host_os in
- aix4 | aix4.[[01]] | aix4.[[01]].*)
- if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
- echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
- :
- else
- can_build_shared=no
- fi
- ;;
- esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
- # soname into executable. Probably we can add versioning support to
- # collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
- # If using run time linking (on AIX 4.2 or later) use lib<name>.so
- # instead of lib<name>.a to let people know that these are not
- # typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
- # We preserve .a as extension for shared libraries through AIX4.2
- # and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- case $host_cpu in
- powerpc)
- # Since July 2007 AmigaOS4 officially supports .so libraries.
- # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- ;;
- m68k)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
- ;;
- esac
- ;;
-
-beos*)
- library_names_spec='${libname}${shared_ext}'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi[[45]]*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32* | cegcc*)
- version_type=windows
- shrext_cmds=".dll"
- need_version=no
- need_lib_prefix=no
-
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
- library_names_spec='$libname.dll.a'
- # DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
- dldir=$destdir/`dirname \$dlpath`~
- test -d \$dldir || mkdir -p \$dldir~
- $install_prog $dir/$dlname \$dldir/$dlname~
- chmod a+x \$dldir/$dlname~
- if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
- eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
- fi'
- postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
- dlpath=$dir/\$dldll~
- $RM \$dlpath'
- shlibpath_overrides_runpath=yes
-
- case $host_os in
- cygwin*)
- # Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
- ;;
- mingw* | cegcc*)
- # MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
- if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
- # It is most probably a Windows format PATH printed by
- # mingw gcc, but we are running on Cygwin. Gcc prints its search
- # path with ; separators, and with drive letters. We can handle the
- # drive letters (cygwin fileutils understands them), so leave them,
- # especially as we might pass files found there to a mingw objdump,
- # which wouldn't understand a cygwinified path. Ahh.
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
- else
- sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
- fi
- ;;
- pw32*)
- # pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- ;;
- esac
- ;;
-
- *)
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
- shlibpath_overrides_runpath=yes
- shlibpath_var=DYLD_LIBRARY_PATH
- shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-m4_if([$1], [],[
- sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
- sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-freebsd1*)
- dynamic_linker=no
- ;;
-
-freebsd* | dragonfly*)
- # DragonFly does not have aout. When/if they implement a new
- # versioning mechanism, adjust this.
- if test -x /usr/bin/objformat; then
- objformat=`/usr/bin/objformat`
- else
- case $host_os in
- freebsd[[123]]*) objformat=aout ;;
- *) objformat=elf ;;
- esac
- fi
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- freebsd3.[[01]]* | freebsdelf3.[[01]]*)
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
- freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- *) # from 4.6 on, and DragonFly
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- case $host_cpu in
- ia64*)
- shrext_cmds='.so'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.so"
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
- sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
- else
- sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
- fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- hppa*64*)
- shrext_cmds='.sl'
- hardcode_into_libs=yes
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
- shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
- ;;
- *)
- shrext_cmds='.sl'
- dynamic_linker="$host_os dld.sl"
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- ;;
- esac
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-interix[[3-9]]*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $host_os in
- nonstopux*) version_type=nonstopux ;;
- *)
- if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
- else
- version_type=irix
- fi ;;
- esac
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
- case $host_os in
- irix5* | nonstopux*)
- libsuff= shlibsuff=
- ;;
- *)
- case $LD in # libtool.m4 will add one of these switches to LD
- *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
- libsuff= shlibsuff= libmagic=32-bit;;
- *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
- libsuff=32 shlibsuff=N32 libmagic=N32;;
- *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
- libsuff=64 shlibsuff=64 libmagic=64-bit;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- hardcode_into_libs=yes
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # Some binutils ld are patched to set DT_RUNPATH
- save_LDFLAGS=$LDFLAGS
- save_libdir=$libdir
- eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
- LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
- [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
- [shlibpath_overrides_runpath=yes])])
- LDFLAGS=$save_LDFLAGS
- libdir=$save_libdir
-
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # Append ld.so.conf contents to the search path
- if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
- fi
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsdelf*-gnu)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='NetBSD ld.elf_so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- ;;
-
-newsos6)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- ;;
-
-*nto* | *qnx*)
- version_type=qnx
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- dynamic_linker='ldqnx.so'
- ;;
-
-openbsd*)
- version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
- need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- ;;
-
-os2*)
- libname_spec='$name'
- shrext_cmds=".dll"
- need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_lib_prefix=no
- need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-rdos*)
- dynamic_linker=no
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.3*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- case $host_vendor in
- sni)
- shlibpath_overrides_runpath=no
- need_lib_prefix=no
- runpath_var=LD_RUN_PATH
- ;;
- siemens)
- need_lib_prefix=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
- sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
- else
- sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
- case $host_os in
- sco3.2v5*)
- sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
- ;;
- esac
- fi
- sys_lib_dlsearch_path_spec='/usr/lib'
- ;;
-
-tpf*)
- # TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
-fi
-
-_LT_DECL([], [variables_saved_for_relink], [1],
- [Variables whose values should be saved in libtool wrapper scripts and
- restored at link time])
-_LT_DECL([], [need_lib_prefix], [0],
- [Do we need the "lib" prefix for modules?])
-_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
-_LT_DECL([], [version_type], [0], [Library versioning type])
-_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable])
-_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
-_LT_DECL([], [shlibpath_overrides_runpath], [0],
- [Is shlibpath searched before the hard-coded library search path?])
-_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
-_LT_DECL([], [library_names_spec], [1],
- [[List of archive names. First name is the real one, the rest are links.
- The last name is the one that the linker finds with -lNAME]])
-_LT_DECL([], [soname_spec], [1],
- [[The coded name of the library, if different from the real name]])
-_LT_DECL([], [postinstall_cmds], [2],
- [Command to use after installation of a shared archive])
-_LT_DECL([], [postuninstall_cmds], [2],
- [Command to use after uninstallation of a shared archive])
-_LT_DECL([], [finish_cmds], [2],
- [Commands used to finish a libtool library installation in a directory])
-_LT_DECL([], [finish_eval], [1],
- [[As "finish_cmds", except a single script fragment to be evaled but
- not shown]])
-_LT_DECL([], [hardcode_into_libs], [0],
- [Whether we should hardcode library paths into libraries])
-_LT_DECL([], [sys_lib_search_path_spec], [2],
- [Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
-])# _LT_SYS_DYNAMIC_LINKER
-
-
-# _LT_PATH_TOOL_PREFIX(TOOL)
-# --------------------------
-# find a file program which can recognize shared library
-AC_DEFUN([_LT_PATH_TOOL_PREFIX],
-[m4_require([_LT_DECL_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
- ;;
-*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="m4_if([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
- if test -n "$file_magic_test_file"; then
- case $deplibs_check_method in
- "file_magic "*)
- file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
- if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
- $EGREP "$file_magic_regex" > /dev/null; then
- :
- else
- cat <<_LT_EOF 1>&2
-
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such. This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem. Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
-
-_LT_EOF
- fi ;;
- esac
- fi
- break
- fi
- done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
- ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-_LT_DECL([], [MAGIC_CMD], [0],
- [Used to examine libraries when file_magic_cmd begins with "file"])dnl
-])# _LT_PATH_TOOL_PREFIX
-
-# Old name:
-AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
-
-
-# _LT_PATH_MAGIC
-# --------------
-# find a file program which can recognize a shared library
-m4_defun([_LT_PATH_MAGIC],
-[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
- if test -n "$ac_tool_prefix"; then
- _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
- else
- MAGIC_CMD=:
- fi
-fi
-])# _LT_PATH_MAGIC
-
-
-# LT_PATH_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([LT_PATH_LD],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-
-AC_ARG_WITH([gnu-ld],
- [AS_HELP_STRING([--with-gnu-ld],
- [assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
- [with_gnu_ld=no])dnl
-
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of ld
- ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
- while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some variants of GNU ld only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
- ;;
- *)
- test "$with_gnu_ld" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-_LT_PATH_LD_GNU
-AC_SUBST([LD])
-
-_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
-])# LT_PATH_LD
-
-# Old names:
-AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
-AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_LD], [])
-dnl AC_DEFUN([AC_PROG_LD], [])
-
-
-# _LT_PATH_LD_GNU
-#- --------------
-m4_defun([_LT_PATH_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- lt_cv_prog_gnu_ld=yes
- ;;
-*)
- lt_cv_prog_gnu_ld=no
- ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# _LT_PATH_LD_GNU
-
-
-# _LT_CMD_RELOAD
-# --------------
-# find reload flag for linker
-# -- PORTME Some linkers may need a different reload flag.
-m4_defun([_LT_CMD_RELOAD],
-[AC_CACHE_CHECK([for $LD option to reload object files],
- lt_cv_ld_reload_flag,
- [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
- darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
- else
- reload_cmds='$LD$reload_flag -o $output$reload_objs'
- fi
- ;;
-esac
-_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
-_LT_DECL([], [reload_cmds], [2])dnl
-])# _LT_CMD_RELOAD
-
-
-# _LT_CHECK_MAGIC_METHOD
-# ----------------------
-# how to check for library dependencies
-# -- PORTME fill in with the dynamic library characteristics
-m4_defun([_LT_CHECK_MAGIC_METHOD],
-[m4_require([_LT_DECL_EGREP])
-m4_require([_LT_DECL_OBJDUMP])
-AC_CACHE_CHECK([how to recognize dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[[4-9]]*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-bsdi[[45]]*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
- lt_cv_file_magic_cmd='/usr/bin/file -L'
- lt_cv_file_magic_test_file=/shlib/libc.so
- ;;
-
-cygwin*)
- # func_win32_libid is a shell function defined in ltmain.sh
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- ;;
-
-mingw* | pw32*)
- # Base MSYS/MinGW do not provide the 'file' command needed by
- # func_win32_libid shell function, so use a weaker test based on 'objdump',
- # unless we find 'file', for example because we are cross-compiling.
- if ( file / ) >/dev/null 2>&1; then
- lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
- lt_cv_file_magic_cmd='func_win32_libid'
- else
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- fi
- ;;
-
-cegcc)
- # use the weaker test based on 'objdump'. See mingw*.
- lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
- lt_cv_file_magic_cmd='$OBJDUMP -f'
- ;;
-
-darwin* | rhapsody*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-freebsd* | dragonfly*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- case $host_cpu in
- i*86 )
- # Not sure whether the presence of OpenBSD here was a mistake.
- # Let's accept both of them until this is cleared up.
- lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- ;;
- esac
- else
- lt_cv_deplibs_check_method=pass_all
- fi
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-hpux10.20* | hpux11*)
- lt_cv_file_magic_cmd=/usr/bin/file
- case $host_cpu in
- ia64*)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
- lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
- ;;
- hppa*64*)
- [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
- lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
- ;;
- *)
- lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
- ;;
- esac
- ;;
-
-interix[[3-9]]*)
- # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
- ;;
-
-irix5* | irix6* | nonstopux*)
- case $LD in
- *-32|*"-32 ") libmagic=32-bit;;
- *-n32|*"-n32 ") libmagic=N32;;
- *-64|*"-64 ") libmagic=64-bit;;
- *) libmagic=never-match;;
- esac
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu | kopensolaris*-gnu)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
- fi
- ;;
-
-newos6*)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libnls.so
- ;;
-
-*nto* | *qnx*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
- else
- lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
- fi
- ;;
-
-osf3* | osf4* | osf5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-rdos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-sysv4 | sysv4.3*)
- case $host_vendor in
- motorola)
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- siemens)
- lt_cv_deplibs_check_method=pass_all
- ;;
- pc)
- lt_cv_deplibs_check_method=pass_all
- ;;
- esac
- ;;
-
-tpf*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-_LT_DECL([], [deplibs_check_method], [1],
- [Method to check whether dependent libraries are shared objects])
-_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method == "file_magic"])
-])# _LT_CHECK_MAGIC_METHOD
-
-
-# LT_PATH_NM
-# ----------
-# find the pathname to a BSD- or MS-compatible name lister
-AC_DEFUN([LT_PATH_NM],
-[AC_REQUIRE([AC_PROG_CC])dnl
-AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
-[if test -n "$NM"; then
- # Let the user override the test.
- lt_cv_path_NM="$NM"
-else
- lt_nm_to_check="${ac_tool_prefix}nm"
- if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
- lt_nm_to_check="$lt_nm_to_check nm"
- fi
- for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
- # Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
- # nm: unknown option "B" ignored
- # Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
- lt_cv_path_NM="$tmp_nm -B"
- break
- ;;
- *)
- case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
- */dev/null*)
- lt_cv_path_NM="$tmp_nm -p"
- break
- ;;
- *)
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- ;;
- esac
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
- done
- : ${lt_cv_path_NM=no}
-fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
-else
- # Didn't find any BSD compatible name lister, look for dumpbin.
- AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :)
- AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
- fi
-fi
-test -z "$NM" && NM=nm
-AC_SUBST([NM])
-_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
-
-AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
- [lt_cv_nm_interface="BSD nm"
- echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
- (eval "$ac_compile" 2>conftest.err)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
- (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
- cat conftest.err >&AS_MESSAGE_LOG_FD
- (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD)
- cat conftest.out >&AS_MESSAGE_LOG_FD
- if $GREP 'External.*some_variable' conftest.out > /dev/null; then
- lt_cv_nm_interface="MS dumpbin"
- fi
- rm -f conftest*])
-])# LT_PATH_NM
-
-# Old names:
-AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
-AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_PROG_NM], [])
-dnl AC_DEFUN([AC_PROG_NM], [])
-
-
-# LT_LIB_M
-# --------
-# check for math library
-AC_DEFUN([LT_LIB_M],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
- # These system don't have libm, or don't need it
- ;;
-*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
- ;;
-*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
- ;;
-esac
-AC_SUBST([LIBM])
-])# LT_LIB_M
-
-# Old name:
-AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_CHECK_LIBM], [])
-
-
-# _LT_COMPILER_NO_RTTI([TAGNAME])
-# -------------------------------
-m4_defun([_LT_COMPILER_NO_RTTI],
-[m4_require([_LT_TAG_COMPILER])dnl
-
-_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-
-if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-
- _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
- lt_cv_prog_compiler_rtti_exceptions,
- [-fno-rtti -fno-exceptions], [],
- [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
-fi
-_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
- [Compiler flag to turn off builtin functions])
-])# _LT_COMPILER_NO_RTTI
-
-
-# _LT_CMD_GLOBAL_SYMBOLS
-# ----------------------
-m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-AC_REQUIRE([LT_PATH_LD])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-AC_MSG_CHECKING([command to parse $NM output from $compiler object])
-AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
-[
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix. What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32* | cegcc*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*)
- if test "$host_cpu" = ia64; then
- symcode='[[ABCDEGRST]]'
- fi
- ;;
-irix* | nonstopux*)
- symcode='[[BCDEGRST]]'
- ;;
-osf*)
- symcode='[[BCDEGQRST]]'
- ;;
-solaris*)
- symcode='[[BDRT]]'
- ;;
-sco3.2v5*)
- symcode='[[DT]]'
- ;;
-sysv4.2uw2*)
- symcode='[[DT]]'
- ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
- symcode='[[ABDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
- symcode='[[ABCDGIRSTW]]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
- opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
- symxfrm="\\1 $ac_symprfx\\2 \\2"
-
- # Write the raw and C identifiers.
- if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
- # Also find C++ and __fastcall symbols from MSVC++,
- # which start with @ or ?.
- lt_cv_sys_global_symbol_pipe="$AWK ['"\
-" {last_section=section; section=\$ 3};"\
-" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-" \$ 0!~/External *\|/{next};"\
-" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-" ' prfx=^$ac_symprfx]"
- else
- lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
- fi
-
- # Check to see that the pipe works correctly.
- pipe_works=no
-
- rm -f conftest*
- cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
- if AC_TRY_EVAL(ac_compile); then
- # Now try to grab the symbols.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
- if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<_LT_EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-_LT_EOF
- # Now generate the symbol file.
- eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
-
- cat <<_LT_EOF >> conftest.$ac_ext
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- void *address;
-}
-lt__PROGRAM__LTX_preloaded_symbols[[]] =
-{
- { "@PROGRAM@", (void *) 0 },
-_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
- cat <<\_LT_EOF >> conftest.$ac_ext
- {0, (void *) 0}
-};
-
-/* This works around a problem in FreeBSD linker */
-#ifdef FREEBSD_WORKAROUND
-static const void *lt_preloaded_setup() {
- return lt__PROGRAM__LTX_preloaded_symbols;
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-_LT_EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
- pipe_works=yes
- fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
- fi
- else
- echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
- cat conftest.$ac_ext >&5
- fi
- rm -rf conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- lt_cv_sys_global_symbol_to_cdecl=
-fi
-if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-
-_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
- [Take the output of nm and produce a listing of raw symbols and C names])
-_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
- [Transform the output of nm in a proper C declaration])
-_LT_DECL([global_symbol_to_c_name_address],
- [lt_cv_sys_global_symbol_to_c_name_address], [1],
- [Transform the output of nm in a C name address pair])
-_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
- [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
- [Transform the output of nm in a C name address pair when lib prefix is needed])
-]) # _LT_CMD_GLOBAL_SYMBOLS
-
-
-# _LT_COMPILER_PIC([TAGNAME])
-# ---------------------------
-m4_defun([_LT_COMPILER_PIC],
-[m4_require([_LT_TAG_COMPILER])dnl
-_LT_TAGVAR(lt_prog_compiler_wl, $1)=
-_LT_TAGVAR(lt_prog_compiler_pic, $1)=
-_LT_TAGVAR(lt_prog_compiler_static, $1)=
-
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-m4_if([$1], [CXX], [
- # C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- mingw* | cygwin* | os2* | pw32* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
- *djgpp*)
- # DJGPP does not support shared libraries at all
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- case $host_os in
- aix[[4-9]]*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
- chorus*)
- case $cc_basename in
- cxch68*)
- # Green Hills C++ Compiler
- # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
- ;;
- esac
- ;;
- dgux*)
- case $cc_basename in
- ec++*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- freebsd* | dragonfly*)
- # FreeBSD uses GNU C++
- ;;
- hpux9* | hpux10* | hpux11*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- fi
- ;;
- aCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- ;;
- *)
- ;;
- esac
- ;;
- interix*)
- # This is c89, which is MS Visual C++ (no shared libs)
- # Anyone wants to do a port?
- ;;
- irix5* | irix6* | nonstopux*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- # CC pic flag -KPIC is the default.
- ;;
- *)
- ;;
- esac
- ;;
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- KCC*)
- # KAI C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- icpc* )
- # Intel C++, used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- cxx*)
- # Compaq C++
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xlc* | xlC*)
- # IBM XL 8.0 on PPC
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- esac
- ;;
- esac
- ;;
- lynxos*)
- ;;
- m88k*)
- ;;
- mvs*)
- case $cc_basename in
- cxx*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
- ;;
- *)
- ;;
- esac
- ;;
- netbsd* | netbsdelf*-gnu)
- ;;
- *qnx* | *nto*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
- ;;
- RCC*)
- # Rational C++ 2.4.1
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- cxx*)
- # Digital/Compaq C++
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # Make sure the PIC flag is empty. It appears that all Alpha
- # Linux and Compaq Tru64 Unix objects are PIC.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- *)
- ;;
- esac
- ;;
- psos*)
- ;;
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- ;;
- *)
- ;;
- esac
- ;;
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- lcc*)
- # Lucid
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- ;;
- *)
- ;;
- esac
- ;;
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- case $cc_basename in
- CC*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- esac
- ;;
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- ;;
- *)
- ;;
- esac
- ;;
- vxworks*)
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-],
-[
- if test "$GCC" = yes; then
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
-
- case $host_os in
- aix*)
- # All AIX code is PIC.
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- m68k)
- # FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
- ;;
- esac
- ;;
-
- beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- # Although the cygwin gcc ignores -fPIC, still need this for old-style
- # (--disable-auto-import) libraries
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
- ;;
-
- hpux*)
- # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
- # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag
- # sets the default TLS model and affects inlining.
- case $host_cpu in
- hppa*64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- # Interix 3.x gcc -fpic/-fPIC options generate broken code.
- # Instead, we relocate shared libraries at runtime.
- ;;
-
- msdosdjgpp*)
- # Just because we use GCC doesn't mean we suddenly get shared libraries
- # on systems that don't support them.
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- enable_shared=no
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
- fi
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- ;;
- esac
- else
- # PORTME Check for flag to pass linker flags through the system compiler.
- case $host_os in
- aix*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
- # AIX 5 now supports IA64 processor
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- else
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
- fi
- ;;
-
- mingw* | cygwin* | pw32* | os2* | cegcc*)
- # This hack is so that the source file can tell whether it is being
- # built for inclusion in a dll (and should export symbols for example).
- m4_if([$1], [GCJ], [],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
- ;;
-
- hpux9* | hpux10* | hpux11*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
- # not for PA HP-UX.
- case $host_cpu in
- hppa*64*|ia64*)
- # +Z the default
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
- ;;
- esac
- # Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- ;;
-
- irix5* | irix6* | nonstopux*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # PIC (with -KPIC) is the default.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
- ecc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # icc used to be incompatible with GCC.
- # ICC 10 doesn't accept -KPIC any more.
- icc* | ifort*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
- ;;
- # Lahey Fortran 8.1.
- lf95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
- ;;
- pgcc* | pgf77* | pgf90* | pgf95*)
- # Portland Group compilers (*not* the Pentium gcc compiler,
- # which looks to be a dead project)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
- ccc*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All Alpha code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
- xl*)
- # IBM XL C 8.0/Fortran 10.1 on PPC
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C 5.9
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- ;;
- *Sun\ F*)
- # Sun Fortran 8.3 passes all unrecognized flags to the linker
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
- ;;
- esac
- ;;
- esac
- ;;
-
- newsos6)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *nto* | *qnx*)
- # QNX uses GNU C++, but need to define -shared option too, otherwise
- # it will coredump.
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
- ;;
-
- osf3* | osf4* | osf5*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- # All OSF/1 code is PIC.
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- rdos*)
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
- ;;
-
- solaris*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- case $cc_basename in
- f77* | f90* | f95*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
- *)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- fi
- ;;
-
- sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- unicos*)
- _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
-
- uts4*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
- ;;
-
- *)
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
- ;;
- esac
- fi
-])
-case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
- *djgpp*)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)=
- ;;
- *)
- _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
- ;;
-esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
-
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
- _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
- [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
- [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
- [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
- "" | " "*) ;;
- *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
- esac],
- [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
- _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
-fi
-_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
- [Additional compiler flags for building library objects])
-
-#
-# Check to make sure the static flag actually works.
-#
-wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
-_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
- _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
- $lt_tmp_static_flag,
- [],
- [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
-_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
- [Compiler flag to prevent dynamic linking])
-])# _LT_COMPILER_PIC
-
-
-# _LT_LINKER_SHLIBS([TAGNAME])
-# ----------------------------
-# See if the linker supports building shared libraries.
-m4_defun([_LT_LINKER_SHLIBS],
-[AC_REQUIRE([LT_PATH_LD])dnl
-AC_REQUIRE([LT_PATH_NM])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-m4_require([_LT_DECL_SED])dnl
-m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
-m4_require([_LT_TAG_COMPILER])dnl
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-m4_if([$1], [CXX], [
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- case $host_os in
- aix[[4-9]]*)
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- ;;
- pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
- cygwin* | mingw* | cegcc*)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- linux* | k*bsd*-gnu)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- *)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
- esac
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
-], [
- runpath_var=
- _LT_TAGVAR(allow_undefined_flag, $1)=
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(archive_cmds, $1)=
- _LT_TAGVAR(archive_expsym_cmds, $1)=
- _LT_TAGVAR(compiler_needs_object, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- _LT_TAGVAR(hardcode_automatic, $1)=no
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- _LT_TAGVAR(hardcode_minus_L, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_TAGVAR(inherit_rpath, $1)=no
- _LT_TAGVAR(link_all_deplibs, $1)=unknown
- _LT_TAGVAR(module_cmds, $1)=
- _LT_TAGVAR(module_expsym_cmds, $1)=
- _LT_TAGVAR(old_archive_from_new_cmds, $1)=
- _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
- _LT_TAGVAR(thread_safe_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- # include_expsyms should be a list of space-separated symbols to be *always*
- # included in the symbol list
- _LT_TAGVAR(include_expsyms, $1)=
- # exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
- # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
- # platforms (ab)use it in PIC code, but their linkers get confused if
- # the symbol is explicitly referenced. Since portable code cannot
- # rely on this symbol name, it's probably fine to never include it in
- # preloaded symbol tables.
- # Exclude shared library initialization/finalization symbols.
-dnl Note also adjust exclude_expsyms for C++ above.
- extract_expsyms_cmds=
-
- case $host_os in
- cygwin* | mingw* | pw32* | cegcc*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
- interix*)
- # we just hope/assume this is gcc and not c89 (= MSVC++)
- with_gnu_ld=yes
- ;;
- openbsd*)
- with_gnu_ld=no
- ;;
- linux* | k*bsd*-gnu)
- _LT_TAGVAR(link_all_deplibs, $1)=no
- ;;
- esac
-
- _LT_TAGVAR(ld_shlibs, $1)=yes
- if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # Set some defaults for GNU ld with shared library support. These
- # are reset later if shared libraries are not supported. Putting them
- # here allows them to be overridden if necessary.
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- supports_anon_versioning=no
- case `$LD -v 2>&1` in
- *GNU\ gold*) supports_anon_versioning=yes ;;
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
- *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
- *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
- *\ 2.11.*) ;; # other 2.11 versions
- *) supports_anon_versioning=yes ;;
- esac
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix[[3-9]]*)
- # On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-_LT_EOF
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
-
- gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
- tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
- case $cc_basename in
- diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
- esac
- fi
- if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
- then
- tmp_addflag=
- tmp_sharedflag='-shared'
- case $cc_basename,$host_cpu in
- pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag'
- ;;
- pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
- tmp_addflag=' $pic_flag -Mnomain' ;;
- ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
- tmp_addflag=' -i_dynamic' ;;
- efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
- tmp_addflag=' -i_dynamic -nofor_main' ;;
- ifc* | ifort*) # Intel Fortran compiler
- tmp_addflag=' -nofor_main' ;;
- lf95*) # Lahey Fortran 8.1
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- tmp_sharedflag='--shared' ;;
- xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
- tmp_sharedflag='-qmkshrobj'
- tmp_addflag= ;;
- esac
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
- tmp_sharedflag='-G' ;;
- *Sun\ F*) # Sun Fortran 8.3
- tmp_sharedflag='-G' ;;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
-
- case $cc_basename in
- xlf*)
- # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
- _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
- fi
- ;;
- esac
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- fi
- ;;
-
- solaris*)
- if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
- case `$LD -v 2>&1` in
- *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- cat <<_LT_EOF 1>&2
-
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
-*** reliably create shared libraries on SCO systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-_LT_EOF
- ;;
- *)
- # For security reasons, it is highly recommended that you always
- # use absolute paths for naming shared libraries, and exclude the
- # DT_RUNPATH tag from executables and libraries. But doing so
- # requires that you compile everything twice, which is a pain.
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- sunos4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
-
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
- runpath_var=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=yes
- _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- # If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
- fi
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- ;;
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- amigaos*)
- case $host_cpu in
- powerpc)
- # see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)=''
- ;;
- m68k)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- ;;
-
- bsdi[[45]]*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- ;;
-
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- freebsd1*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
-
- hpux10*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- fi
- ;;
-
- hpux11*)
- if test "$GCC" = yes -a "$with_gnu_ld" = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- else
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-
- # hardcode_minus_L: Not really in the search PATH,
- # but as the default location of the library.
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- ;;
- esac
- fi
- ;;
-
- irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- # Try to use the -exported_symbol ld option, if it does not
- # work, assume that -exports_file does not work either and
- # implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(int foo(void) {},
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- )
- LDFLAGS="$save_LDFLAGS"
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- netbsd* | netbsdelf*-gnu)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- newsos6)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *nto* | *qnx*)
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- os2*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- else
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
-
- # Both c and cxx compiler support -rpath directly
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- fi
- _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- ;;
-
- solaris*)
- _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- else
- case `$CC -V 2>&1` in
- *"Compilers 5.0"*)
- wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
- ;;
- *)
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
- ;;
- esac
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
- # but is careful enough not to reorder.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- fi
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4)
- case $host_vendor in
- sni)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
- ;;
- siemens)
- ## LD is ld it makes a PLAMLIB
- ## CC just makes a GrossModule.
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
- _LT_TAGVAR(hardcode_direct, $1)=no
- ;;
- motorola)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
- ;;
- esac
- runpath_var='LD_RUN_PATH'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- sysv4.3*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- _LT_TAGVAR(ld_shlibs, $1)=yes
- fi
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- fi
- ;;
-
- uts4*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
-
- *)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- if test x$host_vendor = xsni; then
- case $host in
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
- ;;
- esac
- fi
- fi
-])
-AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
-_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
-
-_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
-_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
-_LT_DECL([], [extract_expsyms_cmds], [2],
- [The commands to extract the exported symbol list from a shared archive])
-
-#
-# Do we need to explicitly link libc?
-#
-case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
- # Assume -lc should be added
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
-
- if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $_LT_TAGVAR(archive_cmds, $1) in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- $RM conftest*
- echo "$lt_simple_compile_test_code" > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
- pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
- _LT_TAGVAR(allow_undefined_flag, $1)=
- if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
- then
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- else
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- fi
- _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi
- $RM conftest*
- AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)])
- ;;
- esac
- fi
- ;;
-esac
-
-_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
- [Whether or not to add -lc for building shared libraries])
-_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
- [enable_shared_with_static_runtimes], [0],
- [Whether or not to disallow shared libs when runtime libs are static])
-_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
- [Compiler flag to allow reflexive dlopens])
-_LT_TAGDECL([], [whole_archive_flag_spec], [1],
- [Compiler flag to generate shared objects directly from archives])
-_LT_TAGDECL([], [compiler_needs_object], [1],
- [Whether the compiler copes with passing no objects directly])
-_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
- [Create an old-style archive from a shared archive])
-_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
- [Create a temporary old-style archive to link instead of a shared archive])
-_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
-_LT_TAGDECL([], [archive_expsym_cmds], [2])
-_LT_TAGDECL([], [module_cmds], [2],
- [Commands used to build a loadable module if different from building
- a shared archive.])
-_LT_TAGDECL([], [module_expsym_cmds], [2])
-_LT_TAGDECL([], [with_gnu_ld], [1],
- [Whether we are building with GNU ld or not])
-_LT_TAGDECL([], [allow_undefined_flag], [1],
- [Flag that allows shared libraries with undefined symbols to be built])
-_LT_TAGDECL([], [no_undefined_flag], [1],
- [Flag that enforces no undefined symbols])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
- [Flag to hardcode $libdir into a binary during linking.
- This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
- [[If ld is used when linking, flag to hardcode $libdir into a binary
- during linking. This must work even if $libdir does not exist]])
-_LT_TAGDECL([], [hardcode_libdir_separator], [1],
- [Whether we need a single "-rpath" flag with a separated argument])
-_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary])
-_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
- DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting ${shlibpath_var} if the
- library is relocated])
-_LT_TAGDECL([], [hardcode_minus_L], [0],
- [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
- [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
- into the resulting binary])
-_LT_TAGDECL([], [hardcode_automatic], [0],
- [Set to "yes" if building a shared library automatically hardcodes DIR
- into the library and all subsequent libraries and executables linked
- against it])
-_LT_TAGDECL([], [inherit_rpath], [0],
- [Set to yes if linker adds runtime paths of dependent libraries
- to runtime path list])
-_LT_TAGDECL([], [link_all_deplibs], [0],
- [Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
- [Fix the shell variable $srcfile for the compiler])
-_LT_TAGDECL([], [always_export_symbols], [0],
- [Set to "yes" if exported symbols are required])
-_LT_TAGDECL([], [export_symbols_cmds], [2],
- [The commands to list exported symbols])
-_LT_TAGDECL([], [exclude_expsyms], [1],
- [Symbols that should not be listed in the preloaded symbols])
-_LT_TAGDECL([], [include_expsyms], [1],
- [Symbols that must always be exported])
-_LT_TAGDECL([], [prelink_cmds], [2],
- [Commands necessary for linking programs (against libraries) with templates])
-_LT_TAGDECL([], [file_list_spec], [1],
- [Specify filename containing input files])
-dnl FIXME: Not yet implemented
-dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
-dnl [Compiler flag to generate thread safe objects])
-])# _LT_LINKER_SHLIBS
-
-
-# _LT_LANG_C_CONFIG([TAG])
-# ------------------------
-# Ensure that the configuration variables for a C compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_C_CONFIG],
-[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
-AC_LANG_PUSH(C)
-
-# Source file extension for C test sources.
-ac_ext=c
-
-# Object file extension for compiled C test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}'
-
-_LT_TAG_COMPILER
-# Save the default compiler, since it gets overwritten when the other
-# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
-compiler_DEFAULT=$CC
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
- LT_SYS_DLOPEN_SELF
- _LT_CMD_STRIPLIB
-
- # Report which library types will actually be built
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_CONFIG($1)
-fi
-AC_LANG_POP
-CC="$lt_save_CC"
-])# _LT_LANG_C_CONFIG
-
-
-# _LT_PROG_CXX
-# ------------
-# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++
-# compiler, we have our own version here.
-m4_defun([_LT_PROG_CXX],
-[
-pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes])
-AC_PROG_CXX
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
- AC_PROG_CXXCPP
-else
- _lt_caught_CXX_error=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_CXX
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_CXX], [])
-
-
-# _LT_LANG_CXX_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a C++ compiler are suitably
-# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_CXX_CONFIG],
-[AC_REQUIRE([_LT_PROG_CXX])dnl
-m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-m4_require([_LT_DECL_EGREP])dnl
-
-AC_LANG_PUSH(C++)
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(compiler_needs_object, $1)=no
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for C++ test sources.
-ac_ext=cpp
-
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the CXX compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="int some_variable = 0;"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC=$CC
- lt_save_LD=$LD
- lt_save_GCC=$GCC
- GCC=$GXX
- lt_save_with_gnu_ld=$with_gnu_ld
- lt_save_path_LD=$lt_cv_path_LD
- if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
- lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
- else
- $as_unset lt_cv_prog_gnu_ld
- fi
- if test -n "${lt_cv_path_LDCXX+set}"; then
- lt_cv_path_LD=$lt_cv_path_LDCXX
- else
- $as_unset lt_cv_path_LD
- fi
- test -z "${LDCXX+set}" || LD=$LDCXX
- CC=${CXX-"c++"}
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- # We don't want -fno-exception when compiling C++ code, so set the
- # no_builtin_flag separately
- if test "$GXX" = yes; then
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
- else
- _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
- fi
-
- if test "$GXX" = yes; then
- # Set up default GNU C++ configuration
-
- LT_PATH_LD
-
- # Check if GNU C++ uses GNU ld as the underlying linker, since the
- # archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # If archive_cmds runs LD, not CC, wlarc should be empty
- # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
- # investigate it a little bit more. (MM)
- wlarc='${wl}'
-
- # ancient GNU ld didn't support --whole-archive et. al.
- if eval "`$CC -print-prog-name=ld` --help 2>&1" |
- $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- _LT_TAGVAR(whole_archive_flag_spec, $1)=
- fi
- else
- with_gnu_ld=no
- wlarc=
-
- # A generic and very simple default shared library creation
- # command for GNU C++ for the case where it uses the native
- # linker, instead of GNU ld. If possible, this setting should
- # overridden to take advantage of the native linker features on
- # the platform it is being used on.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- fi
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
- else
- GXX=no
- with_gnu_ld=no
- wlarc=
- fi
-
- # PORTME: fill in a description of your system's C++ link characteristics
- AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
- _LT_TAGVAR(ld_shlibs, $1)=yes
- case $host_os in
- aix3*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
- # On IA64, the linker does run time linking by default, so we don't
- # have to do anything special.
- aix_use_runtimelinking=no
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # Test if we are trying to use run time linking or normal
- # AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
- for ld_flag in $LDFLAGS; do
- case $ld_flag in
- *-brtl*)
- aix_use_runtimelinking=yes
- break
- ;;
- esac
- done
- ;;
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # When large executables or shared objects are built, AIX ld can
- # have problems creating the table of contents. If linking a library
- # or program results in "error TOC overflow" add -mminimal-toc to
- # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
- # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
-
- _LT_TAGVAR(archive_cmds, $1)=''
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
-
- if test "$GXX" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- # We only want to do this on AIX 4.2 and lower, the check
- # below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
- if test -f "$collect2name" &&
- strings "$collect2name" | $GREP resolve_lib_name >/dev/null
- then
- # We have reworked collect2
- :
- else
- # We have old collect2
- _LT_TAGVAR(hardcode_direct, $1)=unsupported
- # It fails to find uninstalled libraries when the uninstalled
- # path is not listed in the libpath. Setting hardcode_minus_L
- # to unsupported forces relinking
- _LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=
- fi
- esac
- shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
- fi
- else
- # not using gcc
- if test "$host_cpu" = ia64; then
- # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
- # chokes on -Wl,-G. The following line is correct:
- shared_flag='-G'
- else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
- # It seems that -bexpall does not export symbols beginning with
- # underscore (_), so it is better to generate a list of symbols to
- # export.
- _LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
- # Determine the default libpath from the value encoded in an empty
- # executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
- _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
- else
- # Determine the default libpath from the value encoded in an
- # empty executable.
- _LT_SYS_MODULE_PATH_AIX
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- # Warning - without using the other run time loading flags,
- # -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- # Exported symbols can be pulled into shared objects from archives
- _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
- fi
- fi
- ;;
-
- beos*)
- if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- chorus*)
- case $cc_basename in
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- darwin* | rhapsody*)
- _LT_DARWIN_LINKER_FEATURES($1)
- ;;
-
- dgux*)
- case $cc_basename in
- ec++*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- ghcx*)
- # Green Hills C++ Compiler
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- freebsd[[12]]*)
- # C++ shared libraries reported to be fairly broken before
- # switch to ELF
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- freebsd-elf*)
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- ;;
-
- freebsd* | dragonfly*)
- # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
- # conventions
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- gnu*)
- ;;
-
- hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
- ;;
- *)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- case $host_cpu in
- hppa*64*|ia64*)
- ;;
- *)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- ;;
- esac
- fi
- case $host_cpu in
- hppa*64*|ia64*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- ;;
- *)
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
- # but as the default
- # location of the library.
- ;;
- esac
-
- case $cc_basename in
- CC*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- aCC*)
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
- ;;
- *)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
- case $host_cpu in
- hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- ;;
- esac
- fi
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- interix[[3-9]]*)
- _LT_TAGVAR(hardcode_direct, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
- # Instead, shared libraries are loaded at an image base (0x10000000 by
- # default) and relocated if they conflict, which is a slow very memory
- # consuming and fragmenting process. To avoid this, we pick a random,
- # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
- # time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- ;;
- irix5* | irix6*)
- case $cc_basename in
- CC*)
- # SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
-
- # Archives containing C++ object files must be created using
- # "CC -ar", where "CC" is the IRIX C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
- ;;
- *)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib'
- fi
- fi
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- ;;
- esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(inherit_rpath, $1)=yes
- ;;
-
- linux* | k*bsd*-gnu | kopensolaris*-gnu)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-
- # Archives containing C++ object files must be created using
- # "CC -Bstatic", where "CC" is the KAI C++ compiler.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
- ;;
- icpc* | ecpc* )
- # Intel C++
- with_gnu_ld=yes
- # version 8.0 and above of icpc choke on multiply defined symbols
- # if we add $predep_objects and $postdep_objects, however 7.1 and
- # earlier do not add the objects themselves.
- case `$CC -V 2>&1` in
- *"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- *) # Version 8.0 or newer
- tmp_idyn=
- case $host_cpu in
- ia64*) tmp_idyn=' -i_dynamic';;
- esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
- ;;
- esac
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
- ;;
- pgCC* | pgcpp*)
- # Portland Group C++ compiler
- case `$CC -V` in
- *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*)
- _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
- _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
- $RANLIB $oldlib'
- _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- *) # Version 6 will use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
- ;;
- cxx*)
- # Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
-
- runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
- ;;
- xl*)
- # IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
- fi
- ;;
- *)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive'
- _LT_TAGVAR(compiler_needs_object, $1)=yes
-
- # Not sure whether something based on
- # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
- # would be better.
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- esac
- ;;
- esac
- ;;
-
- lynxos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- m88k*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- mvs*)
- case $cc_basename in
- cxx*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- netbsd*)
- if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
- wlarc=
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- fi
- # Workaround some broken pre-1.5 toolchains
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
- ;;
-
- *nto* | *qnx*)
- _LT_TAGVAR(ld_shlibs, $1)=yes
- ;;
-
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
- if test -f /usr/libexec/ld.so; then
- _LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- fi
- output_verbose_link_cmd=echo
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
-
- osf3* | osf4* | osf5*)
- case $cc_basename in
- KCC*)
- # Kuck and Associates, Inc. (KAI) C++ Compiler
-
- # KCC will only create a shared library if the output file
- # ends with ".so" (or ".sl" for HP-UX), so rename the library
- # to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Archives containing C++ object files must be created using
- # the KAI C++ compiler.
- case $host in
- osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
- *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
- esac
- ;;
- RCC*)
- # Rational C++ 2.4.1
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- cxx*)
- case $host in
- osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- ;;
- *)
- _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- #
- # There doesn't appear to be a way to prevent this compiler from
- # explicitly linking system object files so we need to strip them
- # from the output so that they don't get included in the library
- # dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed'
- ;;
- *)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- case $host in
- osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- ;;
- esac
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=:
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
-
- else
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
- esac
- ;;
-
- psos*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- sunos4*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.x
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- lcc*)
- # Lucid
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- solaris*)
- case $cc_basename in
- CC*)
- # Sun C++ 4.2, 5.x and Centerline C++
- _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
- _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- # The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
- # Supported since Solaris 2.6 (maybe 2.5.1?)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
- ;;
- esac
- _LT_TAGVAR(link_all_deplibs, $1)=yes
-
- output_verbose_link_cmd='echo'
-
- # Archives containing C++ object files must be created using
- # "CC -xar", where "CC" is the Sun C++ compiler. This is
- # necessary to make sure instantiated templates are included
- # in the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
- ;;
- gcx*)
- # Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-
- # The C++ compiler must be used to create the archive.
- _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
- ;;
- *)
- # GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
- if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
- else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
- # platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
-
- # Commands to make compiler produce verbose output that lists
- # what "hidden" libraries, object files and flags are used when
- # linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"'
- fi
-
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
- case $host_os in
- solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
- *)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
- ;;
- esac
- fi
- ;;
- esac
- ;;
-
- sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
- # link with -lc, and that would cause any symbols used from libc to
- # always be unresolved, which means just about no library would
- # ever link correctly. If we're not using GNU ld we use -z text
- # though, which does catch some bad symbols but isn't as heavy-handed
- # as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
- _LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
- _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
- _LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
- runpath_var='LD_RUN_PATH'
-
- case $cc_basename in
- CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- ;;
- esac
- ;;
-
- tandem*)
- case $cc_basename in
- NCC*)
- # NonStop-UX NCC 3.20
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
- ;;
-
- vxworks*)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- *)
- # FIXME: insert proper C++ library support
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
- esac
-
- AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
-
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- CC=$lt_save_CC
- LDCXX=$LD
- LD=$lt_save_LD
- GCC=$lt_save_GCC
- with_gnu_ld=$lt_save_with_gnu_ld
- lt_cv_path_LDCXX=$lt_cv_path_LD
- lt_cv_path_LD=$lt_save_path_LD
- lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
- lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
-
-AC_LANG_POP
-])# _LT_LANG_CXX_CONFIG
-
-
-# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
-# ---------------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
-[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
-# Dependencies to place before and after the object being linked:
-_LT_TAGVAR(predep_objects, $1)=
-_LT_TAGVAR(postdep_objects, $1)=
-_LT_TAGVAR(predeps, $1)=
-_LT_TAGVAR(postdeps, $1)=
-_LT_TAGVAR(compiler_lib_search_path, $1)=
-
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library. It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
-int a;
-void foo (void) { a = 0; }
-_LT_EOF
-], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
-class Foo
-{
-public:
- Foo (void) { a = 0; }
-private:
- int a;
-};
-_LT_EOF
-], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer*4 a
- a=0
- return
- end
-_LT_EOF
-], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
- subroutine foo
- implicit none
- integer a
- a=0
- return
- end
-_LT_EOF
-], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
-public class foo {
- private int a;
- public void bar (void) {
- a = 0;
- }
-};
-_LT_EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
- # Parse the compiler output and extract the necessary
- # objects, libraries and library flags.
-
- # Sentinel used to keep track of whether or not we are before
- # the conftest object file.
- pre_test_object_deps_done=no
-
- for p in `eval "$output_verbose_link_cmd"`; do
- case $p in
-
- -L* | -R* | -l*)
- # Some compilers place space between "-{L,R}" and the path.
- # Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
- prev=$p
- continue
- else
- prev=
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
- # Internal compiler library paths should come after those
- # provided the user. The postdeps already come after the
- # user supplied libs so there is no need to process them.
- if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
- else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
- fi
- ;;
- # The "-l" case would never come before the object being
- # linked, so don't bother handling this case.
- esac
- else
- if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
- else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
- fi
- fi
- ;;
-
- *.$objext)
- # This assumes that the test object file only shows up
- # once in the compiler output.
- if test "$p" = "conftest.$objext"; then
- pre_test_object_deps_done=yes
- continue
- fi
-
- if test "$pre_test_object_deps_done" = no; then
- if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
- else
- _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
- fi
- else
- if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)="$p"
- else
- _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
- fi
- fi
- ;;
-
- *) ;; # Ignore the rest.
-
- esac
- done
-
- # Clean up.
- rm -f a.out a.exe
-else
- echo "libtool.m4: error: problem compiling $1 test program"
-fi
-
-$RM -f confest.$objext
-
-# PORTME: override above test on systems where it is broken
-m4_if([$1], [CXX],
-[case $host_os in
-interix[[3-9]]*)
- # Interix 3.5 installs completely hosed .la files for C++, so rather than
- # hack all around it, let's just trust "g++" to DTRT.
- _LT_TAGVAR(predep_objects,$1)=
- _LT_TAGVAR(postdep_objects,$1)=
- _LT_TAGVAR(postdeps,$1)=
- ;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-esac
-])
-
-case " $_LT_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=
-if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
-fi
-_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
- [The directories searched by this compiler when creating a shared library])
-_LT_TAGDECL([], [predep_objects], [1],
- [Dependencies to place before and after the objects being linked to
- create a shared library])
-_LT_TAGDECL([], [postdep_objects], [1])
-_LT_TAGDECL([], [predeps], [1])
-_LT_TAGDECL([], [postdeps], [1])
-_LT_TAGDECL([], [compiler_lib_search_path], [1],
- [The library search path used internally by the compiler when linking
- a shared library])
-])# _LT_SYS_HIDDEN_LIBDEPS
-
-
-# _LT_PROG_F77
-# ------------
-# Since AC_PROG_F77 is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_F77],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes])
-AC_PROG_F77
-if test -z "$F77" || test "X$F77" = "Xno"; then
- _lt_disable_F77=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_F77
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_F77], [])
-
-
-# _LT_LANG_F77_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for a Fortran 77 compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_F77_CONFIG],
-[AC_REQUIRE([_LT_PROG_F77])dnl
-AC_LANG_PUSH(Fortran 77)
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for f77 test sources.
-ac_ext=f
-
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the F77 compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- CC=${F77-"f77"}
- compiler=$CC
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
- GCC=$G77
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
-fi # test "$_lt_disable_F77" != yes
-
-AC_LANG_POP
-])# _LT_LANG_F77_CONFIG
-
-
-# _LT_PROG_FC
-# -----------
-# Since AC_PROG_FC is broken, in that it returns the empty string
-# if there is no fortran compiler, we have our own version here.
-m4_defun([_LT_PROG_FC],
-[
-pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes])
-AC_PROG_FC
-if test -z "$FC" || test "X$FC" = "Xno"; then
- _lt_disable_FC=yes
-fi
-popdef([AC_MSG_ERROR])
-])# _LT_PROG_FC
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([_LT_PROG_FC], [])
-
-
-# _LT_LANG_FC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for a Fortran compiler are
-# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_FC_CONFIG],
-[AC_REQUIRE([_LT_PROG_FC])dnl
-AC_LANG_PUSH(Fortran)
-
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_TAGVAR(allow_undefined_flag, $1)=
-_LT_TAGVAR(always_export_symbols, $1)=no
-_LT_TAGVAR(archive_expsym_cmds, $1)=
-_LT_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_TAGVAR(hardcode_direct, $1)=no
-_LT_TAGVAR(hardcode_direct_absolute, $1)=no
-_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_TAGVAR(hardcode_minus_L, $1)=no
-_LT_TAGVAR(hardcode_automatic, $1)=no
-_LT_TAGVAR(inherit_rpath, $1)=no
-_LT_TAGVAR(module_cmds, $1)=
-_LT_TAGVAR(module_expsym_cmds, $1)=
-_LT_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_TAGVAR(no_undefined_flag, $1)=
-_LT_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-
-# Source file extension for fc test sources.
-ac_ext=${ac_fc_srcext-f}
-
-# Object file extension for compiled fc test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# No sense in running all these tests if we already determined that
-# the FC compiler isn't working. Some variables (like enable_shared)
-# are currently assumed to apply to all compilers on this platform,
-# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
- # Code to be used in simple compile tests
- lt_simple_compile_test_code="\
- subroutine t
- return
- end
-"
-
- # Code to be used in simple link tests
- lt_simple_link_test_code="\
- program t
- end
-"
-
- # ltmain only uses $CC for tagged configurations so make sure $CC is set.
- _LT_TAG_COMPILER
-
- # save warnings/boilerplate of simple test code
- _LT_COMPILER_BOILERPLATE
- _LT_LINKER_BOILERPLATE
-
- # Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
- lt_save_GCC=$GCC
- CC=${FC-"f95"}
- compiler=$CC
- GCC=$ac_cv_fc_compiler_gnu
-
- _LT_TAGVAR(compiler, $1)=$CC
- _LT_CC_BASENAME([$compiler])
-
- if test -n "$compiler"; then
- AC_MSG_CHECKING([if libtool supports shared libraries])
- AC_MSG_RESULT([$can_build_shared])
-
- AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
-
- # On AIX, shared libraries and static libraries use the same namespace, and
- # are all built from PIC.
- case $host_os in
- aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
- aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
- esac
- AC_MSG_RESULT([$enable_shared])
-
- AC_MSG_CHECKING([whether to build static libraries])
- # Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
- AC_MSG_RESULT([$enable_static])
-
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
-
- ## CAVEAT EMPTOR:
- ## There is no encapsulation within the following macros, do not change
- ## the running order or otherwise move them around unless you know exactly
- ## what you are doing...
- _LT_SYS_HIDDEN_LIBDEPS($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_SYS_DYNAMIC_LINKER($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
- fi # test -n "$compiler"
-
- GCC=$lt_save_GCC
- CC="$lt_save_CC"
-fi # test "$_lt_disable_FC" != yes
-
-AC_LANG_POP
-])# _LT_LANG_FC_CONFIG
-
-
-# _LT_LANG_GCJ_CONFIG([TAG])
-# --------------------------
-# Ensure that the configuration variables for the GNU Java Compiler compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_GCJ_CONFIG],
-[AC_REQUIRE([LT_PROG_GCJ])dnl
-AC_LANG_SAVE
-
-# Source file extension for Java test sources.
-ac_ext=java
-
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
-
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=yes
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
-_LT_CC_BASENAME([$compiler])
-
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_TAGVAR(archive_cmds_need_lc, $1)=no
-
-_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-if test -n "$compiler"; then
- _LT_COMPILER_NO_RTTI($1)
- _LT_COMPILER_PIC($1)
- _LT_COMPILER_C_O($1)
- _LT_COMPILER_FILE_LOCKS($1)
- _LT_LINKER_SHLIBS($1)
- _LT_LINKER_HARDCODE_LIBPATH($1)
-
- _LT_CONFIG($1)
-fi
-
-AC_LANG_RESTORE
-
-GCC=$lt_save_GCC
-CC="$lt_save_CC"
-])# _LT_LANG_GCJ_CONFIG
-
-
-# _LT_LANG_RC_CONFIG([TAG])
-# -------------------------
-# Ensure that the configuration variables for the Windows resource compiler
-# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
-m4_defun([_LT_LANG_RC_CONFIG],
-[AC_REQUIRE([LT_PROG_RC])dnl
-AC_LANG_SAVE
-
-# Source file extension for RC test sources.
-ac_ext=rc
-
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_TAGVAR(objext, $1)=$objext
-
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
-
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
-
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_TAG_COMPILER
-
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
-
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-lt_save_GCC=$GCC
-GCC=
-CC=${RC-"windres"}
-compiler=$CC
-_LT_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-
-if test -n "$compiler"; then
- :
- _LT_CONFIG($1)
-fi
-
-GCC=$lt_save_GCC
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# _LT_LANG_RC_CONFIG
-
-
-# LT_PROG_GCJ
-# -----------
-AC_DEFUN([LT_PROG_GCJ],
-[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
- [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
- [AC_CHECK_TOOL(GCJ, gcj,)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)])])[]dnl
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
-
-
-# LT_PROG_RC
-# ----------
-AC_DEFUN([LT_PROG_RC],
-[AC_CHECK_TOOL(RC, windres,)
-])
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_RC], [])
-
-
-# _LT_DECL_EGREP
-# --------------
-# If we don't have a new enough Autoconf to choose the best grep
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_EGREP],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_REQUIRE([AC_PROG_FGREP])dnl
-test -z "$GREP" && GREP=grep
-_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
-_LT_DECL([], [EGREP], [1], [An ERE matcher])
-_LT_DECL([], [FGREP], [1], [A literal string matcher])
-dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
-AC_SUBST([GREP])
-])
-
-
-# _LT_DECL_OBJDUMP
-# --------------
-# If we don't have a new enough Autoconf to choose the best objdump
-# available, choose the one first in the user's PATH.
-m4_defun([_LT_DECL_OBJDUMP],
-[AC_CHECK_TOOL(OBJDUMP, objdump, false)
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
-AC_SUBST([OBJDUMP])
-])
-
-
-# _LT_DECL_SED
-# ------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible. Prefer GNU sed if found.
-m4_defun([_LT_DECL_SED],
-[AC_PROG_SED
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
-_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
-_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
- [Sed that helps us avoid accidentally triggering echo(1) options like -n])
-])# _LT_DECL_SED
-
-m4_ifndef([AC_PROG_SED], [
-############################################################
-# NOTE: This macro has been submitted for inclusion into #
-# GNU Autoconf as AC_PROG_SED. When it is available in #
-# a released version of Autoconf we should remove this #
-# macro and use it instead. #
-############################################################
-
-m4_defun([AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
-done
-])
-SED=$lt_cv_path_SED
-AC_SUBST([SED])
-AC_MSG_RESULT([$SED])
-])#AC_PROG_SED
-])#m4_ifndef
-
-# Old name:
-AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([LT_AC_PROG_SED], [])
-
-
-# _LT_CHECK_SHELL_FEATURES
-# ------------------------
-# Find out whether the shell is Bourne or XSI compatible,
-# or has some other useful features.
-m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
- lt_unset=unset
-else
- lt_unset=false
-fi
-_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
-
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
- # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
- lt_SP2NL='tr \040 \012'
- lt_NL2SP='tr \015\012 \040\040'
- ;;
- *) # EBCDIC based system
- lt_SP2NL='tr \100 \n'
- lt_NL2SP='tr \r\n \100\100'
- ;;
-esac
-_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
-_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
-])# _LT_CHECK_SHELL_FEATURES
-
-
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $[*] ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
-
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"`
-}
-
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "X${3}" \
- | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "X${3}" \
- | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;;
- esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$[@]"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]+=\$[2]"
-}
-_LT_EOF
- ;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
- ;;
- esac
-])
diff --git a/toolkit/crashreporter/google-breakpad/m4/ltoptions.m4 b/toolkit/crashreporter/google-breakpad/m4/ltoptions.m4
deleted file mode 100644
index 34151a3ba6..0000000000
--- a/toolkit/crashreporter/google-breakpad/m4/ltoptions.m4
+++ /dev/null
@@ -1,368 +0,0 @@
-# Helper functions for option handling. -*- Autoconf -*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# 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 ltoptions.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
-
-
-# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
-# ------------------------------------------
-m4_define([_LT_MANGLE_OPTION],
-[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
-
-
-# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
-# ---------------------------------------
-# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
-# matching handler defined, dispatch to it. Other OPTION-NAMEs are
-# saved as a flag.
-m4_define([_LT_SET_OPTION],
-[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
-m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
- _LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
-])
-
-
-# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
-# ------------------------------------------------------------
-# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
-m4_define([_LT_IF_OPTION],
-[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
-
-
-# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
-# -------------------------------------------------------
-# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
-# are set.
-m4_define([_LT_UNLESS_OPTIONS],
-[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
- [m4_define([$0_found])])])[]dnl
-m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
-])[]dnl
-])
-
-
-# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
-# ----------------------------------------
-# OPTION-LIST is a space-separated list of Libtool options associated
-# with MACRO-NAME. If any OPTION has a matching handler declared with
-# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
-# the unknown option and exit.
-m4_defun([_LT_SET_OPTIONS],
-[# Set options
-m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
- [_LT_SET_OPTION([$1], _LT_Option)])
-
-m4_if([$1],[LT_INIT],[
- dnl
- dnl Simply set some default values (i.e off) if boolean options were not
- dnl specified:
- _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
- ])
- _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
- ])
- dnl
- dnl If no reference was made to various pairs of opposing options, then
- dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
- dnl archives by default:
- _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
- _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
- _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
- ])
-])# _LT_SET_OPTIONS
-
-
-## --------------------------------- ##
-## Macros to handle LT_INIT options. ##
-## --------------------------------- ##
-
-# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
-# -----------------------------------------
-m4_define([_LT_MANGLE_DEFUN],
-[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
-
-
-# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
-# -----------------------------------------------
-m4_define([LT_OPTION_DEFINE],
-[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
-])# LT_OPTION_DEFINE
-
-
-# dlopen
-# ------
-LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
-])
-
-AU_DEFUN([AC_LIBTOOL_DLOPEN],
-[_LT_SET_OPTION([LT_INIT], [dlopen])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
-
-
-# win32-dll
-# ---------
-# Declare package support for building win32 dll's.
-LT_OPTION_DEFINE([LT_INIT], [win32-dll],
-[enable_win32_dll=yes
-
-case $host in
-*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*)
- AC_CHECK_TOOL(AS, as, false)
- AC_CHECK_TOOL(DLLTOOL, dlltool, false)
- AC_CHECK_TOOL(OBJDUMP, objdump, false)
- ;;
-esac
-
-test -z "$AS" && AS=as
-_LT_DECL([], [AS], [0], [Assembler program])dnl
-
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl
-
-test -z "$OBJDUMP" && OBJDUMP=objdump
-_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl
-])# win32-dll
-
-AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-_LT_SET_OPTION([LT_INIT], [win32-dll])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
-
-
-# _LT_ENABLE_SHARED([DEFAULT])
-# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_SHARED],
-[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([shared],
- [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
- [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
-
- _LT_DECL([build_libtool_libs], [enable_shared], [0],
- [Whether or not to build shared libraries])
-])# _LT_ENABLE_SHARED
-
-LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
-])
-
-AC_DEFUN([AC_DISABLE_SHARED],
-[_LT_SET_OPTION([LT_INIT], [disable-shared])
-])
-
-AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
-AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_SHARED], [])
-dnl AC_DEFUN([AM_DISABLE_SHARED], [])
-
-
-
-# _LT_ENABLE_STATIC([DEFAULT])
-# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_STATIC],
-[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([static],
- [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
- [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
-
- _LT_DECL([build_old_libs], [enable_static], [0],
- [Whether or not to build static libraries])
-])# _LT_ENABLE_STATIC
-
-LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
-
-# Old names:
-AC_DEFUN([AC_ENABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
-])
-
-AC_DEFUN([AC_DISABLE_STATIC],
-[_LT_SET_OPTION([LT_INIT], [disable-static])
-])
-
-AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
-AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AM_ENABLE_STATIC], [])
-dnl AC_DEFUN([AM_DISABLE_STATIC], [])
-
-
-
-# _LT_ENABLE_FAST_INSTALL([DEFAULT])
-# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
-m4_define([_LT_ENABLE_FAST_INSTALL],
-[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
-AC_ARG_ENABLE([fast-install],
- [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
- [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
- [p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac],
- [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
-
-_LT_DECL([fast_install], [enable_fast_install], [0],
- [Whether or not to optimize for fast installation])dnl
-])# _LT_ENABLE_FAST_INSTALL
-
-LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
-LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
-
-# Old names:
-AU_DEFUN([AC_ENABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
-])
-
-AU_DEFUN([AC_DISABLE_FAST_INSTALL],
-[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
-dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
-
-
-# _LT_WITH_PIC([MODE])
-# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
-# LT_INIT options.
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
-m4_define([_LT_WITH_PIC],
-[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic],
- [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
- [pic_mode=default])
-
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
-_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
-])# _LT_WITH_PIC
-
-LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
-LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
-
-# Old name:
-AU_DEFUN([AC_LIBTOOL_PICMODE],
-[_LT_SET_OPTION([LT_INIT], [pic-only])
-AC_DIAGNOSE([obsolete],
-[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
-])
-
-dnl aclocal-1.4 backwards compatibility:
-dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
-
-## ----------------- ##
-## LTDL_INIT Options ##
-## ----------------- ##
-
-m4_define([_LTDL_MODE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
- [m4_define([_LTDL_MODE], [nonrecursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [recursive],
- [m4_define([_LTDL_MODE], [recursive])])
-LT_OPTION_DEFINE([LTDL_INIT], [subproject],
- [m4_define([_LTDL_MODE], [subproject])])
-
-m4_define([_LTDL_TYPE], [])
-LT_OPTION_DEFINE([LTDL_INIT], [installable],
- [m4_define([_LTDL_TYPE], [installable])])
-LT_OPTION_DEFINE([LTDL_INIT], [convenience],
- [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/toolkit/crashreporter/google-breakpad/m4/ltsugar.m4 b/toolkit/crashreporter/google-breakpad/m4/ltsugar.m4
deleted file mode 100644
index 9000a057d3..0000000000
--- a/toolkit/crashreporter/google-breakpad/m4/ltsugar.m4
+++ /dev/null
@@ -1,123 +0,0 @@
-# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
-# Written by Gary V. Vaughan, 2004
-#
-# 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 ltsugar.m4
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
-
-
-# lt_join(SEP, ARG1, [ARG2...])
-# -----------------------------
-# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
-# associated separator.
-# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
-# versions in m4sugar had bugs.
-m4_define([lt_join],
-[m4_if([$#], [1], [],
- [$#], [2], [[$2]],
- [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
-m4_define([_lt_join],
-[m4_if([$#$2], [2], [],
- [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
-
-
-# lt_car(LIST)
-# lt_cdr(LIST)
-# ------------
-# Manipulate m4 lists.
-# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
-m4_define([lt_car], [[$1]])
-m4_define([lt_cdr],
-[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
- [$#], 1, [],
- [m4_dquote(m4_shift($@))])])
-m4_define([lt_unquote], $1)
-
-
-# lt_append(MACRO-NAME, STRING, [SEPARATOR])
-# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
-# Note that neither SEPARATOR nor STRING are expanded; they are appended
-# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
-# No SEPARATOR is output if MACRO-NAME was previously undefined (different
-# than defined and empty).
-#
-# This macro is needed until we can rely on Autoconf 2.62, since earlier
-# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
-m4_define([lt_append],
-[m4_define([$1],
- m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
-
-
-
-# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
-# ----------------------------------------------------------
-# Produce a SEP delimited list of all paired combinations of elements of
-# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
-# has the form PREFIXmINFIXSUFFIXn.
-# Needed until we can rely on m4_combine added in Autoconf 2.62.
-m4_define([lt_combine],
-[m4_if(m4_eval([$# > 3]), [1],
- [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
-[[m4_foreach([_Lt_prefix], [$2],
- [m4_foreach([_Lt_suffix],
- ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
- [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
-
-
-# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
-# -----------------------------------------------------------------------
-# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
-# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
-m4_define([lt_if_append_uniq],
-[m4_ifdef([$1],
- [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
- [lt_append([$1], [$2], [$3])$4],
- [$5])],
- [lt_append([$1], [$2], [$3])$4])])
-
-
-# lt_dict_add(DICT, KEY, VALUE)
-# -----------------------------
-m4_define([lt_dict_add],
-[m4_define([$1($2)], [$3])])
-
-
-# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
-# --------------------------------------------
-m4_define([lt_dict_add_subkey],
-[m4_define([$1($2:$3)], [$4])])
-
-
-# lt_dict_fetch(DICT, KEY, [SUBKEY])
-# ----------------------------------
-m4_define([lt_dict_fetch],
-[m4_ifval([$3],
- m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
- m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
-
-
-# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
-# -----------------------------------------------------------------
-m4_define([lt_if_dict_fetch],
-[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
- [$5],
- [$6])])
-
-
-# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
-# --------------------------------------------------------------
-m4_define([lt_dict_filter],
-[m4_if([$5], [], [],
- [lt_join(m4_quote(m4_default([$4], [[, ]])),
- lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
- [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
-])
diff --git a/toolkit/crashreporter/google-breakpad/m4/ltversion.m4 b/toolkit/crashreporter/google-breakpad/m4/ltversion.m4
deleted file mode 100644
index f3c5309802..0000000000
--- a/toolkit/crashreporter/google-breakpad/m4/ltversion.m4
+++ /dev/null
@@ -1,23 +0,0 @@
-# ltversion.m4 -- version numbers -*- Autoconf -*-
-#
-# Copyright (C) 2004 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004
-#
-# 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.
-
-# Generated from ltversion.in.
-
-# serial 3017 ltversion.m4
-# This file is part of GNU Libtool
-
-m4_define([LT_PACKAGE_VERSION], [2.2.6b])
-m4_define([LT_PACKAGE_REVISION], [1.3017])
-
-AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.6b'
-macro_revision='1.3017'
-_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
-_LT_DECL(, macro_revision, 0)
-])
diff --git a/toolkit/crashreporter/google-breakpad/m4/lt~obsolete.m4 b/toolkit/crashreporter/google-breakpad/m4/lt~obsolete.m4
deleted file mode 100644
index 637bb2066c..0000000000
--- a/toolkit/crashreporter/google-breakpad/m4/lt~obsolete.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
-#
-# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
-# Written by Scott James Remnant, 2004.
-#
-# 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 4 lt~obsolete.m4
-
-# These exist entirely to fool aclocal when bootstrapping libtool.
-#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
-# which have later been changed to m4_define as they aren't part of the
-# exported API, or moved to Autoconf or Automake where they belong.
-#
-# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
-# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
-# using a macro with the same name in our local m4/libtool.m4 it'll
-# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
-# and doesn't know about Autoconf macros at all.)
-#
-# So we provide this file, which has a silly filename so it's always
-# included after everything else. This provides aclocal with the
-# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
-# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
-#
-# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
-# Yes, that means every name once taken will need to remain here until
-# we give up compatibility with versions before 1.7, at which point
-# we need to keep only those names which we still refer to.
-
-# This is to help aclocal find these macros, as it can't see m4_define.
-AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
-
-m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
-m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
-m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
-m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
-m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
-m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
-m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
-m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
-m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
-m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
-m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
-m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
-m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
-m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
-m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
-m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
-m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
-m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
-m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
-m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
-m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
-m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
-m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
-m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
-m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
-m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
-m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
-m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
-m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
-m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
-m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
-m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
-m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
-m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
-m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
-m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
-m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
-m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
-m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
-m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])])
-m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
-m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
-m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
-m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
-m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
-m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
-m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
-m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
-m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
diff --git a/toolkit/crashreporter/google-breakpad/src/breakpad_googletest_includes.h b/toolkit/crashreporter/google-breakpad/src/breakpad_googletest_includes.h
deleted file mode 100644
index 19a3e98077..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/breakpad_googletest_includes.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef BREAKPAD_GOOGLETEST_INCLUDES_H__
-#define BREAKPAD_GOOGLETEST_INCLUDES_H__
-
-#include "gtest/gtest.h"
-#include "gmock/gmock.h"
-
-// If AddressSanitizer is used, NULL pointer dereferences generate SIGILL
-// (illegal instruction) instead of SIGSEGV (segmentation fault). Also,
-// the number of memory regions differs, so there is no point in running
-// this test if AddressSanitizer is used.
-//
-// Ideally we'd use this attribute to disable ASAN on a per-func basis,
-// but this doesn't seem to actually work, and it's changed names over
-// time. So just stick with disabling the actual tests.
-// http://crbug.com/304575
-//#define NO_ASAN __attribute__((no_sanitize_address))
-#if defined(__clang__) && defined(__has_feature)
-// Have to keep this check sep from above as newer gcc will barf on it.
-# if __has_feature(address_sanitizer)
-# define ADDRESS_SANITIZER
-# endif
-#elif defined(__GNUC__) && defined(__SANITIZE_ADDRESS__)
-# define ADDRESS_SANITIZER
-#else
-# undef ADDRESS_SANITIZER
-#endif
-
-#endif // BREAKPAD_GOOGLETEST_INCLUDES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/build/all.gyp b/toolkit/crashreporter/google-breakpad/src/build/all.gyp
deleted file mode 100644
index 4b59d917bb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/build/all.gyp
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'targets': [
- {
- 'target_name': 'All',
- 'type': 'none',
- 'dependencies': [
- '../common/common.gyp:*',
- '../processor/processor.gyp:*',
- '../tools/tools.gyp:*',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/build/common.gypi b/toolkit/crashreporter/google-breakpad/src/build/common.gypi
deleted file mode 100644
index b9466a325a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/build/common.gypi
+++ /dev/null
@@ -1,1045 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# IMPORTANT:
-# Please don't directly include this file if you are building via gyp_chromium,
-# since gyp_chromium is automatically forcing its inclusion.
-{
- 'variables': {
- # Variables expected to be overriden on the GYP command line (-D) or by
- # ~/.gyp/include.gypi.
-
- # Putting a variables dict inside another variables dict looks kind of
- # weird. This is necessary to get these variables defined for the conditions
- # within this variables dict that operate on these variables.
- 'variables': {
- 'variables': {
- # Compute the architecture that we're building on.
- 'conditions': [
- [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
- # This handles the Linux platforms we generally deal with. Anything
- # else gets passed through, which probably won't work very well; such
- # hosts should pass an explicit target_arch to gyp.
- 'host_arch%':
- '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
- }, { # OS!="linux"
- 'host_arch%': 'ia32',
- }],
- ],
- },
-
- 'host_arch%': '<(host_arch)',
-
- # Default architecture we're building for is the architecture we're
- # building on.
- 'target_arch%': '<(host_arch)',
-
- # This variable tells WebCore.gyp and JavaScriptCore.gyp whether they are
- # are built under a chromium full build (1) or a webkit.org chromium
- # build (0).
- 'inside_chromium_build%': 1,
-
- # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
- # libraries on linux x86-64 and arm.
- 'linux_fpic%': 0,
-
- # Python version.
- 'python_ver%': '2.5',
-
- # Determine ARM compilation flags.
- 'arm_version%': 7,
-
- # Set Neon compilation flags (only meaningful if arm_version==7).
- 'arm_neon%': 1,
-
- # The system root for cross-compiles. Default: none.
- 'sysroot%': '',
-
- # On Linux, we build with sse2 for Chromium builds.
- 'disable_sse2%': 0,
- },
-
- 'target_arch%': '<(target_arch)',
- 'host_arch%': '<(host_arch)',
- 'inside_chromium_build%': '<(inside_chromium_build)',
- 'linux_fpic%': '<(linux_fpic)',
- 'python_ver%': '<(python_ver)',
- 'arm_version%': '<(arm_version)',
- 'arm_neon%': '<(arm_neon)',
- 'sysroot%': '<(sysroot)',
- 'disable_sse2%': '<(disable_sse2)',
-
- # The release channel that this build targets. This is used to restrict
- # channel-specific build options, like which installer packages to create.
- # The default is 'all', which does no channel-specific filtering.
- 'channel%': 'all',
-
- # Override chromium_mac_pch and set it to 0 to suppress the use of
- # precompiled headers on the Mac. Prefix header injection may still be
- # used, but prefix headers will not be precompiled. This is useful when
- # using distcc to distribute a build to compile slaves that don't
- # share the same compiler executable as the system driving the compilation,
- # because precompiled headers rely on pointers into a specific compiler
- # executable's image. Setting this to 0 is needed to use an experimental
- # Linux-Mac cross compiler distcc farm.
- 'chromium_mac_pch%': 1,
-
- # Mac OS X SDK and deployment target support.
- # The SDK identifies the version of the system headers that will be used,
- # and corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time macro.
- # "Maximum allowed" refers to the operating system version whose APIs are
- # available in the headers.
- # The deployment target identifies the minimum system version that the
- # built products are expected to function on. It corresponds to the
- # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.
- # To ensure these macros are available, #include <AvailabilityMacros.h>.
- # Additional documentation on these macros is available at
- # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
- # Chrome normally builds with the Mac OS X 10.5 SDK and sets the
- # deployment target to 10.5. Other projects, such as O3D, may override
- # these defaults.
- 'mac_sdk%': '10.5',
- 'mac_deployment_target%': '10.5',
-
- # Set to 1 to enable code coverage. In addition to build changes
- # (e.g. extra CFLAGS), also creates a new target in the src/chrome
- # project file called "coverage".
- # Currently ignored on Windows.
- 'coverage%': 0,
-
- # Although base/allocator lets you select a heap library via an
- # environment variable, the libcmt shim it uses sometimes gets in
- # the way. To disable it entirely, and switch to normal msvcrt, do e.g.
- # 'win_use_allocator_shim': 0,
- # 'win_release_RuntimeLibrary': 2
- # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
- 'win_use_allocator_shim%': 1, # 0 = shim allocator via libcmt; 1 = msvcrt
-
- # Whether usage of OpenMAX is enabled.
- 'enable_openmax%': 0,
-
- # TODO(bradnelson): eliminate this when possible.
- # To allow local gyp files to prevent release.vsprops from being included.
- # Yes(1) means include release.vsprops.
- # Once all vsprops settings are migrated into gyp, this can go away.
- 'msvs_use_common_release%': 1,
-
- # TODO(bradnelson): eliminate this when possible.
- # To allow local gyp files to override additional linker options for msvs.
- # Yes(1) means set use the common linker options.
- 'msvs_use_common_linker_extras%': 1,
-
- # TODO(sgk): eliminate this if possible.
- # It would be nicer to support this via a setting in 'target_defaults'
- # in chrome/app/locales/locales.gypi overriding the setting in the
- # 'Debug' configuration in the 'target_defaults' dict below,
- # but that doesn't work as we'd like.
- 'msvs_debug_link_incremental%': '2',
-
- # This is the location of the sandbox binary. Chrome looks for this before
- # running the zygote process. If found, and SUID, it will be used to
- # sandbox the zygote process and, thus, all renderer processes.
- 'linux_sandbox_path%': '',
-
- # Set this to true to enable SELinux support.
- 'selinux%': 0,
-
- # Strip the binary after dumping symbols.
- 'linux_strip_binary%': 0,
-
- # Enable TCMalloc.
- 'linux_use_tcmalloc%': 1,
-
- # Disable TCMalloc's debugallocation.
- 'linux_use_debugallocation%': 0,
-
- # Disable TCMalloc's heapchecker.
- 'linux_use_heapchecker%': 0,
-
- # Set to 1 to turn on seccomp sandbox by default.
- # (Note: this is ignored for official builds.)
- 'linux_use_seccomp_sandbox%': 0,
-
- # Set to select the Title Case versions of strings in GRD files.
- 'use_titlecase_in_grd%': 0,
-
- # Used to disable Native Client at compile time, for platforms where it
- # isn't supported
- 'disable_nacl%': 0,
-
- # Set Thumb compilation flags.
- 'arm_thumb%': 0,
-
- # Set ARM fpu compilation flags (only meaningful if arm_version==7 and
- # arm_neon==0).
- 'arm_fpu%': 'vfpv3',
-
- # Enable new NPDevice API.
- 'enable_new_npdevice_api%': 0,
-
- 'conditions': [
- # Whether to use multiple cores to compile with visual studio. This is
- # optional because it sometimes causes corruption on VS 2005.
- # It is on by default on VS 2008 and off on VS 2005.
- ['OS=="win"', {
- 'conditions': [
- ['MSVS_VERSION=="2005"', {
- 'msvs_multi_core_compile%': 0,
- },{
- 'msvs_multi_core_compile%': 1,
- }],
- # Don't do incremental linking for large modules on 32-bit.
- ['MSVS_OS_BITS==32', {
- 'msvs_large_module_debug_link_mode%': '1', # No
- },{
- 'msvs_large_module_debug_link_mode%': '2', # Yes
- }],
- ],
- 'nacl_win64_defines': [
- # This flag is used to minimize dependencies when building
- # Native Client loader for 64-bit Windows.
- 'NACL_WIN64',
- ],
- }],
- ],
-
- # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
- # so Cocoa is happy (http://crbug.com/20441).
- 'locales': [
- 'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
- 'en-US', 'es-419', 'es', 'et', 'fi', 'fil', 'fr', 'gu', 'he',
- 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
- 'ml', 'mr', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
- 'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
- 'vi', 'zh-CN', 'zh-TW',
- ],
- },
- 'target_defaults': {
- 'includes': [
- 'filename_rules.gypi',
- ],
- 'variables': {
- # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
- 'mac_release_optimization%': '3', # Use -O3 unless overridden
- 'mac_debug_optimization%': '0', # Use -O0 unless overridden
- # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
- 'win_release_Optimization%': '2', # 2 = /Os
- 'win_debug_Optimization%': '0', # 0 = /Od
- # See http://msdn.microsoft.com/en-us/library/aa652367(VS.71).aspx
- 'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
- 'win_debug_RuntimeLibrary%': '1', # 1 = /MTd (debug static)
-
- 'release_extra_cflags%': '',
- 'debug_extra_cflags%': '',
- 'release_valgrind_build%': 0,
- },
- 'conditions': [
- ['selinux==1', {
- 'defines': ['CHROMIUM_SELINUX=1'],
- }],
- ['win_use_allocator_shim==0', {
- 'conditions': [
- ['OS=="win"', {
- 'defines': ['NO_TCMALLOC'],
- }],
- ],
- }],
- ['coverage!=0', {
- 'conditions': [
- ['OS=="mac"', {
- 'xcode_settings': {
- 'GCC_INSTRUMENT_PROGRAM_FLOW_ARCS': 'YES', # -fprofile-arcs
- 'GCC_GENERATE_TEST_COVERAGE_FILES': 'YES', # -ftest-coverage
- },
- # Add -lgcov for types executable, shared_library, and
- # loadable_module; not for static_library.
- # This is a delayed conditional.
- 'target_conditions': [
- ['_type!="static_library"', {
- 'xcode_settings': { 'OTHER_LDFLAGS': [ '-lgcov' ] },
- }],
- ],
- }],
- # Linux gyp (into scons) doesn't like target_conditions?
- # TODO(???): track down why 'target_conditions' doesn't work
- # on Linux gyp into scons like it does on Mac gyp into xcodeproj.
- ['OS=="linux"', {
- 'cflags': [ '-ftest-coverage',
- '-fprofile-arcs' ],
- 'link_settings': { 'libraries': [ '-lgcov' ] },
- }],
- # Finally, for Windows, we simply turn on profiling.
- ['OS=="win"', {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'Profile': 'true',
- },
- 'VCCLCompilerTool': {
- # /Z7, not /Zi, so coverage is happyb
- 'DebugInformationFormat': '1',
- 'AdditionalOptions': ['/Yd'],
- }
- }
- }], # OS==win
- ], # conditions for coverage
- }], # coverage!=0
- ], # conditions for 'target_defaults'
- 'target_conditions': [
- [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
- 'cflags!': [
- '-Wall',
- '-Wextra',
- '-Werror',
- ],
- }],
- [ 'OS=="win"', {
- 'defines': [
- '_CRT_SECURE_NO_DEPRECATE',
- '_CRT_NONSTDC_NO_WARNINGS',
- '_CRT_NONSTDC_NO_DEPRECATE',
- # This is required for ATL to use XP-safe versions of its functions.
- '_USING_V110_SDK71_',
- ],
- 'msvs_disabled_warnings': [4800],
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'WarnAsError': 'true',
- 'Detect64BitPortabilityProblems': 'false',
- },
- },
- }],
- [ 'OS=="mac"', {
- 'xcode_settings': {
- 'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',
- 'WARNING_CFLAGS!': ['-Wall'],
- },
- }],
- ], # target_conditions for 'target_defaults'
- 'default_configuration': 'Debug',
- 'configurations': {
- # VCLinkerTool LinkIncremental values below:
- # 0 == default
- # 1 == /INCREMENTAL:NO
- # 2 == /INCREMENTAL
- # Debug links incremental, Release does not.
- #
- # Abstract base configurations to cover common
- # attributes.
- #
- 'Common_Base': {
- 'abstract': 1,
- 'msvs_configuration_attributes': {
- 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
- 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
- 'CharacterSet': '1',
- },
- },
- 'x86_Base': {
- 'abstract': 1,
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'MinimumRequiredVersion': '5.01', # XP.
- 'TargetMachine': '1',
- },
- },
- 'msvs_configuration_platform': 'Win32',
- },
- 'x64_Base': {
- 'abstract': 1,
- 'msvs_configuration_platform': 'x64',
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'TargetMachine': '17', # x86 - 64
- 'AdditionalLibraryDirectories!':
- ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
- 'AdditionalLibraryDirectories':
- ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
- },
- 'VCLibrarianTool': {
- 'AdditionalLibraryDirectories!':
- ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
- 'AdditionalLibraryDirectories':
- ['<(DEPTH)/third_party/platformsdk_win7/files/Lib/x64'],
- },
- },
- 'defines': [
- # Not sure if tcmalloc works on 64-bit Windows.
- 'NO_TCMALLOC',
- ],
- },
- 'Debug_Base': {
- 'abstract': 1,
- 'xcode_settings': {
- 'COPY_PHASE_STRIP': 'NO',
- 'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
- 'OTHER_CFLAGS': [ '<@(debug_extra_cflags)', ],
- },
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '<(win_debug_Optimization)',
- 'PreprocessorDefinitions': ['_DEBUG'],
- 'BasicRuntimeChecks': '3',
- 'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
- },
- 'VCLinkerTool': {
- 'LinkIncremental': '<(msvs_debug_link_incremental)',
- },
- 'VCResourceCompilerTool': {
- 'PreprocessorDefinitions': ['_DEBUG'],
- },
- },
- 'conditions': [
- ['OS=="linux"', {
- 'cflags': [
- '<@(debug_extra_cflags)',
- ],
- }],
- ],
- },
- 'Release_Base': {
- 'abstract': 1,
- 'defines': [
- 'NDEBUG',
- ],
- 'xcode_settings': {
- 'DEAD_CODE_STRIPPING': 'YES', # -Wl,-dead_strip
- 'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
- 'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
- },
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '<(win_release_Optimization)',
- 'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
- },
- 'VCLinkerTool': {
- 'LinkIncremental': '1',
- },
- },
- 'conditions': [
- ['release_valgrind_build==0', {
- 'defines': ['NVALGRIND'],
- }],
- ['win_use_allocator_shim==0', {
- 'defines': ['NO_TCMALLOC'],
- }],
- ['win_release_RuntimeLibrary==2', {
- # Visual C++ 2008 barfs when building anything with /MD (msvcrt):
- # VC\include\typeinfo(139) : warning C4275: non dll-interface
- # class 'stdext::exception' used as base for dll-interface
- # class 'std::bad_cast'
- 'msvs_disabled_warnings': [4275],
- }],
- ['OS=="linux"', {
- 'cflags': [
- '<@(release_extra_cflags)',
- ],
- }],
- ],
- },
- 'Purify_Base': {
- 'abstract': 1,
- 'defines': [
- 'PURIFY',
- 'NO_TCMALLOC',
- ],
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '0',
- 'RuntimeLibrary': '0',
- 'BufferSecurityCheck': 'false',
- },
- 'VCLinkerTool': {
- 'EnableCOMDATFolding': '1',
- 'LinkIncremental': '1',
- },
- },
- },
- #
- # Concrete configurations
- #
- 'Debug': {
- 'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
- },
- 'Release': {
- 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
- 'conditions': [
- ['msvs_use_common_release', {
- 'defines': ['OFFICIAL_BUILD'],
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'Optimization': '3',
- 'StringPooling': 'true',
- 'OmitFramePointers': 'true',
- 'InlineFunctionExpansion': '2',
- 'EnableIntrinsicFunctions': 'true',
- 'FavorSizeOrSpeed': '2',
- 'OmitFramePointers': 'true',
- 'EnableFiberSafeOptimizations': 'true',
- 'WholeProgramOptimization': 'true',
- },
- 'VCLibrarianTool': {
- 'AdditionalOptions': ['/ltcg', '/expectedoutputsize:120000000'],
- },
- 'VCLinkerTool': {
- 'LinkIncremental': '1',
- 'OptimizeReferences': '2',
- 'EnableCOMDATFolding': '2',
- 'OptimizeForWindows98': '1',
- 'LinkTimeCodeGeneration': '1',
- },
- },
- }],
- ]
- },
- 'conditions': [
- [ 'OS=="win"', {
- # TODO(bradnelson): add a gyp mechanism to make this more graceful.
- 'Purify': {
- 'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base', 'Purify'],
- },
- 'Debug_x64': {
- 'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
- },
- 'Release_x64': {
- 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
- },
- 'Purify_x64': {
- 'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base', 'Purify_Base'],
- },
- }],
- ],
- },
- },
- 'conditions': [
- ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
- 'target_defaults': {
- # Enable -Werror by default, but put it in a variable so it can
- # be disabled in ~/.gyp/include.gypi on the valgrind builders.
- 'variables': {
- # Use -fno-strict-aliasing by default since gcc 4.4 has periodic
- # issues that slip through the cracks. We could do this just for
- # gcc 4.4 but it makes more sense to be consistent on all
- # compilers in use. TODO(Craig): turn this off again when
- # there is some 4.4 test infrastructure in place and existing
- # aliasing issues have been fixed.
- 'no_strict_aliasing%': 1,
- 'conditions': [['OS=="linux"', {'werror%': '-Werror',}],
- ['OS=="freebsd"', {'werror%': '',}],
- ['OS=="openbsd"', {'werror%': '',}],
- ],
- },
- 'cflags': [
- '<(werror)', # See note above about the werror variable.
- '-pthread',
- '-fno-exceptions',
- '-Wall',
- # TODO(evan): turn this back on once all the builds work.
- # '-Wextra',
- # Don't warn about unused function params. We use those everywhere.
- '-Wno-unused-parameter',
- # Don't warn about the "struct foo f = {0};" initialization pattern.
- '-Wno-missing-field-initializers',
- '-D_FILE_OFFSET_BITS=64',
- # Don't export any symbols (for example, to plugins we dlopen()).
- # Note: this is *required* to make some plugins work.
- '-fvisibility=hidden',
- ],
- 'cflags_cc': [
- '-frtti',
- '-fno-threadsafe-statics',
- # Make inline functions have hidden visiblity by default.
- # Surprisingly, not covered by -fvisibility=hidden.
- '-fvisibility-inlines-hidden',
- ],
- 'ldflags': [
- '-pthread', '-Wl,-z,noexecstack',
- ],
- 'scons_variable_settings': {
- 'LIBPATH': ['$LIB_DIR'],
- # Linking of large files uses lots of RAM, so serialize links
- # using the handy flock command from util-linux.
- 'FLOCK_LINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'],
- 'FLOCK_SHLINK': ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'],
- 'FLOCK_LDMODULE': ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'],
-
- # We have several cases where archives depend on each other in
- # a cyclic fashion. Since the GNU linker does only a single
- # pass over the archives we surround the libraries with
- # --start-group and --end-group (aka -( and -) ). That causes
- # ld to loop over the group until no more undefined symbols
- # are found. In an ideal world we would only make groups from
- # those libraries which we knew to be in cycles. However,
- # that's tough with SCons, so we bodge it by making all the
- # archives a group by redefining the linking command here.
- #
- # TODO: investigate whether we still have cycles that
- # require --{start,end}-group. There has been a lot of
- # refactoring since this was first coded, which might have
- # eliminated the circular dependencies.
- #
- # Note: $_LIBDIRFLAGS comes before ${LINK,SHLINK,LDMODULE}FLAGS
- # so that we prefer our own built libraries (e.g. -lpng) to
- # system versions of libraries that pkg-config might turn up.
- # TODO(sgk): investigate handling this not by re-ordering the
- # flags this way, but by adding a hook to use the SCons
- # ParseFlags() option on the output from pkg-config.
- 'LINKCOM': [['$FLOCK_LINK', '-o', '$TARGET',
- '$_LIBDIRFLAGS', '$LINKFLAGS', '$SOURCES',
- '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
- 'SHLINKCOM': [['$FLOCK_SHLINK', '-o', '$TARGET',
- '$_LIBDIRFLAGS', '$SHLINKFLAGS', '$SOURCES',
- '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
- 'LDMODULECOM': [['$FLOCK_LDMODULE', '-o', '$TARGET',
- '$_LIBDIRFLAGS', '$LDMODULEFLAGS', '$SOURCES',
- '-Wl,--start-group', '$_LIBFLAGS', '-Wl,--end-group']],
- 'IMPLICIT_COMMAND_DEPENDENCIES': 0,
- },
- 'scons_import_variables': [
- 'AS',
- 'CC',
- 'CXX',
- 'LINK',
- ],
- 'scons_propagate_variables': [
- 'AS',
- 'CC',
- 'CCACHE_DIR',
- 'CXX',
- 'DISTCC_DIR',
- 'DISTCC_HOSTS',
- 'HOME',
- 'INCLUDE_SERVER_ARGS',
- 'INCLUDE_SERVER_PORT',
- 'LINK',
- 'CHROME_BUILD_TYPE',
- 'CHROMIUM_BUILD',
- 'OFFICIAL_BUILD',
- ],
- 'configurations': {
- 'Debug_Base': {
- 'variables': {
- 'debug_optimize%': '0',
- },
- 'defines': [
- '_DEBUG',
- ],
- 'cflags': [
- '-O>(debug_optimize)',
- '-g',
- # One can use '-gstabs' to enable building the debugging
- # information in STABS format for breakpad's dumpsyms.
- ],
- 'ldflags': [
- '-rdynamic', # Allows backtrace to resolve symbols.
- ],
- },
- 'Release_Base': {
- 'variables': {
- 'release_optimize%': '2',
- },
- 'cflags': [
- '-O>(release_optimize)',
- # Don't emit the GCC version ident directives, they just end up
- # in the .comment section taking up binary size.
- '-fno-ident',
- # Put data and code in their own sections, so that unused symbols
- # can be removed at link time with --gc-sections.
- '-fdata-sections',
- '-ffunction-sections',
- ],
- 'ldflags': [
- '-Wl,--gc-sections',
- ],
- },
- },
- 'variants': {
- 'coverage': {
- 'cflags': ['-fprofile-arcs', '-ftest-coverage'],
- 'ldflags': ['-fprofile-arcs'],
- },
- 'profile': {
- 'cflags': ['-pg', '-g'],
- 'ldflags': ['-pg'],
- },
- 'symbols': {
- 'cflags': ['-g'],
- },
- },
- 'conditions': [
- [ 'target_arch=="ia32"', {
- 'asflags': [
- # Needed so that libs with .s files (e.g. libicudata.a)
- # are compatible with the general 32-bit-ness.
- '-32',
- ],
- # All floating-point computations on x87 happens in 80-bit
- # precision. Because the C and C++ language standards allow
- # the compiler to keep the floating-point values in higher
- # precision than what's specified in the source and doing so
- # is more efficient than constantly rounding up to 64-bit or
- # 32-bit precision as specified in the source, the compiler,
- # especially in the optimized mode, tries very hard to keep
- # values in x87 floating-point stack (in 80-bit precision)
- # as long as possible. This has important side effects, that
- # the real value used in computation may change depending on
- # how the compiler did the optimization - that is, the value
- # kept in 80-bit is different than the value rounded down to
- # 64-bit or 32-bit. There are possible compiler options to make
- # this behavior consistent (e.g. -ffloat-store would keep all
- # floating-values in the memory, thus force them to be rounded
- # to its original precision) but they have significant runtime
- # performance penalty.
- #
- # -mfpmath=sse -msse2 makes the compiler use SSE instructions
- # which keep floating-point values in SSE registers in its
- # native precision (32-bit for single precision, and 64-bit for
- # double precision values). This means the floating-point value
- # used during computation does not change depending on how the
- # compiler optimized the code, since the value is always kept
- # in its specified precision.
- 'conditions': [
- ['disable_sse2==0', {
- 'cflags': [
- '-march=pentium4',
- '-msse2',
- '-mfpmath=sse',
- ],
- }],
- ],
- # -mmmx allows mmintrin.h to be used for mmx intrinsics.
- # video playback is mmx and sse2 optimized.
- 'cflags': [
- '-m32',
- '-mmmx',
- ],
- 'ldflags': [
- '-m32',
- ],
- }],
- ['target_arch=="arm"', {
- 'target_conditions': [
- ['_toolset=="target"', {
- 'cflags_cc': [
- # The codesourcery arm-2009q3 toolchain warns at that the ABI
- # has changed whenever it encounters a varargs function. This
- # silences those warnings, as they are not helpful and
- # clutter legitimate warnings.
- '-Wno-abi',
- ],
- 'conditions': [
- ['arm_thumb == 1', {
- 'cflags': [
- '-mthumb',
- # TODO(piman): -Wa,-mimplicit-it=thumb is needed for
- # inline assembly that uses condition codes but it's
- # suboptimal. Better would be to #ifdef __thumb__ at the
- # right place and have a separate thumb path.
- '-Wa,-mimplicit-it=thumb',
- ]
- }],
- ['arm_version==7', {
- 'cflags': [
- '-march=armv7-a',
- '-mtune=cortex-a8',
- '-mfloat-abi=softfp',
- ],
- 'conditions': [
- ['arm_neon==1', {
- 'cflags': [ '-mfpu=neon', ],
- }, {
- 'cflags': [ '-mfpu=<(arm_fpu)', ],
- }]
- ],
- }],
- ],
- }],
- ],
- }],
- ['linux_fpic==1', {
- 'cflags': [
- '-fPIC',
- ],
- }],
- ['sysroot!=""', {
- 'target_conditions': [
- ['_toolset=="target"', {
- 'cflags': [
- '--sysroot=<(sysroot)',
- ],
- 'ldflags': [
- '--sysroot=<(sysroot)',
- ],
- }]]
- }],
- ['no_strict_aliasing==1', {
- 'cflags': [
- '-fno-strict-aliasing',
- ],
- }],
- ['linux_use_heapchecker==1', {
- 'variables': {'linux_use_tcmalloc%': 1},
- }],
- ['linux_use_tcmalloc==0', {
- 'defines': ['NO_TCMALLOC'],
- }],
- ['linux_use_heapchecker==0', {
- 'defines': ['NO_HEAPCHECKER'],
- }],
- ],
- },
- }],
- # FreeBSD-specific options; note that most FreeBSD options are set above,
- # with Linux.
- ['OS=="freebsd"', {
- 'target_defaults': {
- 'ldflags': [
- '-Wl,--no-keep-memory',
- ],
- },
- }],
- ['OS=="solaris"', {
- 'cflags!': ['-fvisibility=hidden'],
- 'cflags_cc!': ['-fvisibility-inlines-hidden'],
- }],
- ['OS=="mac"', {
- 'target_defaults': {
- 'variables': {
- # This should be 'mac_real_dsym%', but there seems to be a bug
- # with % in variables that are intended to be set to different
- # values in different targets, like this one.
- 'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
- },
- 'mac_bundle': 0,
- 'xcode_settings': {
- 'ALWAYS_SEARCH_USER_PATHS': 'NO',
- 'GCC_C_LANGUAGE_STANDARD': 'c99', # -std=c99
- 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
- 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
- # (Equivalent to -fPIC)
- 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
- 'GCC_ENABLE_CPP_RTTI': 'YES', # -frtti
- 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
- # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
- 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
- 'GCC_OBJC_CALL_CXX_CDTORS': 'YES', # -fobjc-call-cxx-cdtors
- 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
- 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
- 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
- 'GCC_VERSION': '4.2',
- 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
- # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
- 'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
- 'PREBINDING': 'NO', # No -Wl,-prebind
- 'USE_HEADERMAP': 'NO',
- 'WARNING_CFLAGS': ['-Wall', '-Wendif-labels'],
- 'conditions': [
- ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
- {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
- ],
- ],
- },
- 'target_conditions': [
- ['_type!="static_library"', {
- 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
- }],
- ['_mac_bundle', {
- 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
- }],
- ], # target_conditions
- }, # target_defaults
- }], # OS=="mac"
- ['OS=="win"', {
- 'target_defaults': {
- 'defines': [
- '_WIN32_WINNT=0x0600',
- 'WINVER=0x0600',
- 'WIN32',
- '_WINDOWS',
- '_HAS_EXCEPTIONS=0',
- 'NOMINMAX',
- '_CRT_RAND_S',
- 'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
- 'WIN32_LEAN_AND_MEAN',
- '_SECURE_ATL',
- '_HAS_TR1=0',
- ],
- 'msvs_system_include_dirs': [
- '<(DEPTH)/third_party/platformsdk_win7/files/Include',
- '$(VSInstallDir)/VC/atlmfc/include',
- ],
- 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
- 'msvs_disabled_warnings': [
- 4100, 4127, 4396, 4503, 4512, 4819, 4995, 4702
- ],
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'MinimalRebuild': 'false',
- 'ExceptionHandling': '0',
- 'BufferSecurityCheck': 'true',
- 'EnableFunctionLevelLinking': 'true',
- 'RuntimeTypeInfo': 'false',
- 'WarningLevel': '4',
- 'WarnAsError': 'true',
- 'DebugInformationFormat': '3',
- 'conditions': [
- [ 'msvs_multi_core_compile', {
- 'AdditionalOptions': ['/MP'],
- }],
- ],
- },
- 'VCLibrarianTool': {
- 'AdditionalOptions': ['/ignore:4221'],
- 'AdditionalLibraryDirectories':
- ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
- },
- 'VCLinkerTool': {
- 'AdditionalDependencies': [
- 'wininet.lib',
- 'version.lib',
- 'msimg32.lib',
- 'ws2_32.lib',
- 'usp10.lib',
- 'psapi.lib',
- 'dbghelp.lib',
- ],
- 'AdditionalLibraryDirectories':
- ['<(DEPTH)/third_party/platformsdk_win7/files/Lib'],
- 'GenerateDebugInformation': 'true',
- 'MapFileName': '$(OutDir)\\$(TargetName).map',
- 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
- 'FixedBaseAddress': '1',
- # SubSystem values:
- # 0 == not set
- # 1 == /SUBSYSTEM:CONSOLE
- # 2 == /SUBSYSTEM:WINDOWS
- # Most of the executables we'll ever create are tests
- # and utilities with console output.
- 'SubSystem': '1',
- },
- 'VCMIDLTool': {
- 'GenerateStublessProxies': 'true',
- 'TypeLibraryName': '$(InputName).tlb',
- 'OutputDirectory': '$(IntDir)',
- 'HeaderFileName': '$(InputName).h',
- 'DLLDataFileName': 'dlldata.c',
- 'InterfaceIdentifierFileName': '$(InputName)_i.c',
- 'ProxyFileName': '$(InputName)_p.c',
- },
- 'VCResourceCompilerTool': {
- 'Culture' : '1033',
- 'AdditionalIncludeDirectories': ['<(DEPTH)'],
- },
- },
- },
- }],
- ['disable_nacl==1 or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
- 'target_defaults': {
- 'defines': [
- 'DISABLE_NACL',
- ],
- },
- }],
- ['OS=="win" and msvs_use_common_linker_extras', {
- 'target_defaults': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'DelayLoadDLLs': [
- 'dbghelp.dll',
- 'dwmapi.dll',
- 'uxtheme.dll',
- ],
- },
- },
- 'configurations': {
- 'x86_Base': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalOptions': [
- '/safeseh',
- '/dynamicbase',
- '/ignore:4199',
- '/ignore:4221',
- '/nxcompat',
- ],
- },
- },
- },
- 'x64_Base': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalOptions': [
- # safeseh is not compatible with x64
- '/dynamicbase',
- '/ignore:4199',
- '/ignore:4221',
- '/nxcompat',
- ],
- },
- },
- },
- },
- },
- }],
- ['enable_new_npdevice_api==1', {
- 'target_defaults': {
- 'defines': [
- 'ENABLE_NEW_NPDEVICE_API',
- ],
- },
- }],
- ],
- 'scons_settings': {
- 'sconsbuild_dir': '<(DEPTH)/sconsbuild',
- 'tools': ['ar', 'as', 'gcc', 'g++', 'gnulink', 'chromium_builders'],
- },
- 'xcode_settings': {
- # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
- # This block adds *project-wide* configuration settings to each project
- # file. It's almost always wrong to put things here. Specify your
- # custom xcode_settings in target_defaults to add them to targets instead.
-
- # In an Xcode Project Info window, the "Base SDK for All Configurations"
- # setting sets the SDK on a project-wide basis. In order to get the
- # configured SDK to show properly in the Xcode UI, SDKROOT must be set
- # here at the project level.
- 'SDKROOT': 'macosx<(mac_sdk)', # -isysroot
-
- # The Xcode generator will look for an xcode_settings section at the root
- # of each dict and use it to apply settings on a file-wide basis. Most
- # settings should not be here, they should be in target-specific
- # xcode_settings sections, or better yet, should use non-Xcode-specific
- # settings in target dicts. SYMROOT is a special case, because many other
- # Xcode variables depend on it, including variables such as
- # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
- # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
- # files to appear (when present) in the UI as actual files and not red
- # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
- # and therefore SYMROOT, needs to be set at the project level.
- 'SYMROOT': '<(DEPTH)/xcodebuild',
- },
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/build/filename_rules.gypi b/toolkit/crashreporter/google-breakpad/src/build/filename_rules.gypi
deleted file mode 100644
index 78cd1808a9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/build/filename_rules.gypi
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'target_conditions': [
- ['OS!="win"', {
- 'sources/': [
- ['exclude', '(^|/)windows/'],
- ],
- }],
- ['OS!="linux"', {
- 'sources/': [
- ['exclude', '(^|/)linux/'],
- ],
- }],
- ['OS!="mac"', {
- 'sources/': [
- ['exclude', '(^|/)mac/'],
- ],
- }],
- ['OS!="android"', {
- 'sources/': [
- ['exclude', '(^|/)android/'],
- ],
- }],
- ['OS!="solaris"', {
- 'sources/': [
- ['exclude', '(^|/)solaris/'],
- ],
- }],
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/build/gyp_breakpad b/toolkit/crashreporter/google-breakpad/src/build/gyp_breakpad
deleted file mode 100755
index 0b8077d2f4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/build/gyp_breakpad
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-import os
-import platform
-import sys
-
-script_dir = os.path.dirname(os.path.realpath(__file__))
-breakpad_root = os.path.abspath(os.path.join(script_dir, os.pardir))
-
-sys.path.insert(0, os.path.join(breakpad_root, 'tools', 'gyp', 'pylib'))
-import gyp
-
-def run_gyp(args):
- rc = gyp.main(args)
- if rc != 0:
- print 'Error running GYP'
- sys.exit(rc)
-
-
-def main():
- args = sys.argv[1:]
- args.append(os.path.join(script_dir, 'all.gyp'))
-
- args.append('-I')
- args.append(os.path.join(breakpad_root, 'build', 'common.gypi'))
-
- args.extend(['-D', 'gyp_output_dir=out'])
-
- # Set the GYP DEPTH variable to the root of the project.
- args.append('--depth=' + os.path.relpath(breakpad_root))
-
- print 'Updating projects from gyp files...'
- sys.stdout.flush()
-
- run_gyp(args)
-
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/toolkit/crashreporter/google-breakpad/src/build/testing.gypi b/toolkit/crashreporter/google-breakpad/src/build/testing.gypi
deleted file mode 100644
index 3a77230a56..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/build/testing.gypi
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'targets': [
- {
- 'target_name': 'gtest',
- 'type': 'static_library',
- 'sources': [
- '../testing/gtest/src/gtest-all.cc',
- ],
- 'include_dirs': [
- '../testing/gtest',
- '../testing/gtest/include',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '../testing/gtest/include',
- ],
- },
- },
- {
- 'target_name': 'gtest_main',
- 'type': 'static_library',
- 'dependencies': [
- 'gtest',
- ],
- 'sources': [
- 'gtest/src/gtest_main.cc',
- ],
- },
- {
- 'target_name': 'gmock',
- 'type': 'static_library',
- 'dependencies': [
- 'gtest',
- ],
- 'sources': [
- '../testing/src/gmock-all.cc',
- ],
- 'include_dirs': [
- '../testing',
- '../testing/include',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '../testing/include',
- ],
- },
- 'export_dependent_settings': [
- 'gtest',
- ],
- },
- {
- 'target_name': 'gmock_main',
- 'type': 'static_library',
- 'dependencies': [
- 'gmock',
- ],
- 'sources': [
- '../testing/src/gmock_main.cc',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/apple/Framework/BreakpadDefines.h b/toolkit/crashreporter/google-breakpad/src/client/apple/Framework/BreakpadDefines.h
deleted file mode 100644
index 410a5a6f3a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/apple/Framework/BreakpadDefines.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Keys for configuration file
-#define kReporterMinidumpDirectoryKey "MinidumpDir"
-#define kReporterMinidumpIDKey "MinidumpID"
-
-// Filename for recording uploaded IDs
-#define kReporterLogFilename "uploads.log"
-
-// The default subdirectory of the Library to put crash dumps in
-// The subdirectory is
-// ~/Library/<kDefaultLibrarySubdirectory>/<GoogleBreakpadProduct>
-#define kDefaultLibrarySubdirectory "Breakpad"
-
-// Specify some special keys to be used in the configuration file that is
-// generated by Breakpad and consumed by the crash_sender.
-#define BREAKPAD_PRODUCT "BreakpadProduct"
-#define BREAKPAD_PRODUCT_DISPLAY "BreakpadProductDisplay"
-#define BREAKPAD_VERSION "BreakpadVersion"
-#define BREAKPAD_VENDOR "BreakpadVendor"
-#define BREAKPAD_URL "BreakpadURL"
-#define BREAKPAD_REPORT_INTERVAL "BreakpadReportInterval"
-#define BREAKPAD_SKIP_CONFIRM "BreakpadSkipConfirm"
-#define BREAKPAD_CONFIRM_TIMEOUT "BreakpadConfirmTimeout"
-#define BREAKPAD_SEND_AND_EXIT "BreakpadSendAndExit"
-#define BREAKPAD_DUMP_DIRECTORY "BreakpadMinidumpLocation"
-#define BREAKPAD_INSPECTOR_LOCATION "BreakpadInspectorLocation"
-#define BREAKPAD_REPORTER_EXE_LOCATION \
- "BreakpadReporterExeLocation"
-#define BREAKPAD_LOGFILES "BreakpadLogFiles"
-#define BREAKPAD_LOGFILE_UPLOAD_SIZE "BreakpadLogFileTailSize"
-#define BREAKPAD_REQUEST_COMMENTS "BreakpadRequestComments"
-#define BREAKPAD_COMMENTS "BreakpadComments"
-#define BREAKPAD_REQUEST_EMAIL "BreakpadRequestEmail"
-#define BREAKPAD_EMAIL "BreakpadEmail"
-#define BREAKPAD_SERVER_TYPE "BreakpadServerType"
-#define BREAKPAD_SERVER_PARAMETER_DICT "BreakpadServerParameters"
-#define BREAKPAD_IN_PROCESS "BreakpadInProcess"
-
-// The keys below are NOT user supplied, and are used internally.
-#define BREAKPAD_PROCESS_START_TIME "BreakpadProcStartTime"
-#define BREAKPAD_PROCESS_UP_TIME "BreakpadProcessUpTime"
-#define BREAKPAD_PROCESS_CRASH_TIME "BreakpadProcessCrashTime"
-#define BREAKPAD_LOGFILE_KEY_PREFIX "BreakpadAppLogFile"
-#define BREAKPAD_SERVER_PARAMETER_PREFIX "BreakpadServerParameterPrefix_"
-#define BREAKPAD_ON_DEMAND "BreakpadOnDemand"
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.h b/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.h
deleted file mode 100644
index c099ad07cf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.h
+++ /dev/null
@@ -1,246 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Framework to provide a simple C API to crash reporting for
-// applications. By default, if any machine-level exception (e.g.,
-// EXC_BAD_ACCESS) occurs, it will be handled by the BreakpadRef
-// object as follows:
-//
-// 1. Create a minidump file (see Breakpad for details)
-// 2. Create a config file.
-//
-// These files can then be uploaded to a server.
-
-typedef void *BreakpadRef;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <Foundation/Foundation.h>
-
-#include <client/apple/Framework/BreakpadDefines.h>
-
-// The keys in the dictionary returned by |BreakpadGenerateReport|.
-#define BREAKPAD_OUTPUT_DUMP_FILE "BreakpadDumpFile"
-#define BREAKPAD_OUTPUT_CONFIG_FILE "BreakpadConfigFile"
-
-// Optional user-defined function to decide if we should handle this crash or
-// forward it along.
-// Return true if you want Breakpad to handle it.
-// Return false if you want Breakpad to skip it
-// The exception handler always returns false, as if SEND_AND_EXIT were false
-// (which means the next exception handler will take the exception)
-typedef bool (*BreakpadFilterCallback)(int exception_type,
- int exception_code,
- mach_port_t crashing_thread,
- void *context);
-
-// Create a new BreakpadRef object and install it as an exception
-// handler. The |parameters| will typically be the contents of your
-// bundle's Info.plist.
-//
-// You can also specify these additional keys for customizable behavior:
-// Key: Value:
-// BREAKPAD_PRODUCT Product name (e.g., "MyAwesomeProduct")
-// This one is used as the key to identify
-// the product when uploading. Falls back to
-// CFBundleName if not specified.
-// REQUIRED
-//
-// BREAKPAD_PRODUCT_DISPLAY This is the display name, e.g. a pretty
-// name for the product when the crash_sender
-// pops up UI for the user. Falls back first to
-// CFBundleDisplayName and then to
-// BREAKPAD_PRODUCT if not specified.
-//
-// BREAKPAD_VERSION Product version (e.g., 1.2.3), used
-// as metadata for crash report. Falls back to
-// CFBundleVersion if not specified.
-// REQUIRED
-//
-// BREAKPAD_VENDOR Vendor name, used in UI (e.g. "A report has
-// been created that you can send to <vendor>")
-//
-// BREAKPAD_URL URL destination for reporting
-// REQUIRED
-//
-// BREAKPAD_DUMP_DIRECTORY The directory to store crash-dumps
-// in. By default, we use
-// ~/Library/Cache/Breakpad/<BREAKPAD_PRODUCT>
-// The path you specify here is tilde-expanded.
-//
-// BREAKPAD_SERVER_TYPE A parameter that tells Breakpad how to
-// rewrite the upload parameters for a specific
-// server type. The currently valid values are
-// 'socorro' or 'google'. If you want to add
-// other types, see the function in
-// crash_report_sender.m that maps parameters to
-// URL parameters. Defaults to 'google'.
-//
-// BREAKPAD_SERVER_PARAMETER_DICT A plist dictionary of static
-// parameters that are uploaded to the
-// server. The parameters are sent as
-// is to the crash server. Their
-// content isn't added to the minidump
-// but pass as URL parameters when
-// uploading theminidump to the crash
-// server.
-//=============================================================================
-// The BREAKPAD_PRODUCT, BREAKPAD_VERSION and BREAKPAD_URL are
-// required to have non-NULL values. By default, the BREAKPAD_PRODUCT
-// will be the CFBundleName and the BREAKPAD_VERSION will be the
-// CFBundleVersion when these keys are present in the bundle's
-// Info.plist, which is usually passed in to BreakpadCreate() as an
-// NSDictionary (you could also pass in another dictionary that had
-// the same keys configured). If the BREAKPAD_PRODUCT or
-// BREAKPAD_VERSION are ultimately undefined, BreakpadCreate() will
-// fail. You have been warned.
-//
-// If you are running in a debugger, Breakpad will not install, unless the
-// BREAKPAD_IGNORE_DEBUGGER envionment variable is set and/or non-zero.
-//
-//=============================================================================
-// The following are NOT user-supplied but are documented here for
-// completeness. They are calculated by Breakpad during initialization &
-// crash-dump generation, or entered in by the user.
-//
-// BREAKPAD_PROCESS_START_TIME The time, in seconds since the Epoch, the
-// process started
-//
-// BREAKPAD_PROCESS_CRASH_TIME The time, in seconds since the Epoch, the
-// process crashed.
-//
-// BREAKPAD_PROCESS_UP_TIME The total time in milliseconds the process
-// has been running. This parameter is not
-// set until the crash-dump-generation phase.
-//
-// BREAKPAD_SERVER_PARAMETER_PREFIX This prefix is used by Breakpad
-// internally, because Breakpad uses
-// the same dictionary internally to
-// track both its internal
-// configuration parameters and
-// parameters meant to be uploaded
-// to the server. This string is
-// used internally by Breakpad to
-// prefix user-supplied parameter
-// names so those can be sent to the
-// server without leaking Breakpad's
-// internal values.
-
-// Returns a new BreakpadRef object on success, NULL otherwise.
-BreakpadRef BreakpadCreate(NSDictionary *parameters);
-
-// Uninstall and release the data associated with |ref|.
-void BreakpadRelease(BreakpadRef ref);
-
-// User defined key and value string storage. Generally this is used
-// to configure Breakpad's internal operation, such as whether the
-// crash_sender should prompt the user, or the filesystem location for
-// the minidump file. See Breakpad.h for some parameters that can be
-// set. Anything longer than 255 bytes will be truncated. Note that
-// the string is converted to UTF8 before truncation, so any multibyte
-// character that straddles the 255(256 - 1 for terminator) byte limit
-// will be mangled.
-//
-// A maximum number of 64 key/value pairs are supported. An assert()
-// will fire if more than this number are set. Unfortunately, right
-// now, the same dictionary is used for both Breakpad's parameters AND
-// the Upload parameters.
-//
-// TODO (nealsid): Investigate how necessary this is if we don't
-// automatically upload parameters to the server anymore.
-// TODO (nealsid): separate server parameter dictionary from the
-// dictionary used to configure Breakpad, and document limits for each
-// independently.
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value);
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key);
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key);
-
-// You can use this method to specify parameters that will be uploaded
-// to the crash server. They will be automatically encoded as
-// necessary. Note that as mentioned above there are limits on both
-// the number of keys and their length.
-void BreakpadAddUploadParameter(BreakpadRef ref, NSString *key,
- NSString *value);
-
-// This method will remove a previously-added parameter from the
-// upload parameter set.
-void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString *key);
-
-// Method to handle uploading data to the server
-
-// Returns the number of crash reports waiting to send to the server.
-int BreakpadGetCrashReportCount(BreakpadRef ref);
-
-// Returns the next upload configuration. The report file is deleted.
-NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref);
-
-// Upload next report to the server.
-void BreakpadUploadNextReport(BreakpadRef ref);
-
-// Upload next report to the server.
-// |server_parameters| is additional server parameters to send.
-void BreakpadUploadNextReportWithParameters(BreakpadRef ref,
- NSDictionary *server_parameters);
-
-// Upload a report to the server.
-// |server_parameters| is additional server parameters to send.
-// |configuration| is the configuration of the breakpad report to send.
-void BreakpadUploadReportWithParametersAndConfiguration(
- BreakpadRef ref,
- NSDictionary *server_parameters,
- NSDictionary *configuration);
-
-// Handles the network response of a breakpad upload. This function is needed if
-// the actual upload is done by the Breakpad client.
-// |configuration| is the configuration of the upload. It must contain the same
-// fields as the configuration passed to
-// BreakpadUploadReportWithParametersAndConfiguration.
-// |data| and |error| contain the network response.
-void BreakpadHandleNetworkResponse(BreakpadRef ref,
- NSDictionary *configuration,
- NSData *data,
- NSError *error);
-
-// Upload a file to the server. |data| is the content of the file to sent.
-// |server_parameters| is additional server parameters to send.
-void BreakpadUploadData(BreakpadRef ref, NSData *data, NSString *name,
- NSDictionary *server_parameters);
-
-// Generate a breakpad minidump and configuration file in the dump directory.
-// The report will be available for uploading. The paths of the created files
-// are returned in the dictionary. |server_parameters| is additional server
-// parameters to add in the config file.
-NSDictionary *BreakpadGenerateReport(BreakpadRef ref,
- NSDictionary *server_parameters);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm b/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm
deleted file mode 100644
index ce635bd271..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.mm
+++ /dev/null
@@ -1,916 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#define IGNORE_DEBUGGER "BREAKPAD_IGNORE_DEBUGGER"
-
-#import "client/ios/Breakpad.h"
-
-#include <assert.h>
-#import <Foundation/Foundation.h>
-#include <pthread.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-
-#import "client/ios/handler/ios_exception_minidump_generator.h"
-#import "client/mac/crash_generation/ConfigFile.h"
-#import "client/mac/handler/exception_handler.h"
-#import "client/mac/handler/minidump_generator.h"
-#import "client/mac/sender/uploader.h"
-#import "client/mac/handler/protected_memory_allocator.h"
-#import "common/simple_string_dictionary.h"
-
-#if !defined(__EXCEPTIONS) || (__clang__ && !__has_feature(cxx_exceptions))
-// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
-// <c++/4.2.1/exception_defines.h> allowing this file to work properly with
-// exceptions disabled even when other C++ libraries are used. #undef the try
-// and catch macros first in case libstdc++ is in use and has already provided
-// its own definitions.
-#undef try
-#define try if (true)
-#undef catch
-#define catch(X) if (false)
-#endif // __EXCEPTIONS
-
-using google_breakpad::ConfigFile;
-using google_breakpad::EnsureDirectoryPathExists;
-using google_breakpad::SimpleStringDictionary;
-
-//=============================================================================
-// We want any memory allocations which are used by breakpad during the
-// exception handling process (after a crash has happened) to be read-only
-// to prevent them from being smashed before a crash occurs. Unfortunately
-// we cannot protect against smashes to our exception handling thread's
-// stack.
-//
-// NOTE: Any memory allocations which are not used during the exception
-// handling process may be allocated in the normal ways.
-//
-// The ProtectedMemoryAllocator class provides an Allocate() method which
-// we'll using in conjunction with placement operator new() to control
-// allocation of C++ objects. Note that we don't use operator delete()
-// but instead call the objects destructor directly: object->~ClassName();
-//
-ProtectedMemoryAllocator *gMasterAllocator = NULL;
-ProtectedMemoryAllocator *gKeyValueAllocator = NULL;
-ProtectedMemoryAllocator *gBreakpadAllocator = NULL;
-
-// Mutex for thread-safe access to the key/value dictionary used by breakpad.
-// It's a global instead of an instance variable of Breakpad
-// since it can't live in a protected memory area.
-pthread_mutex_t gDictionaryMutex;
-
-//=============================================================================
-// Stack-based object for thread-safe access to a memory-protected region.
-// It's assumed that normally the memory block (allocated by the allocator)
-// is protected (read-only). Creating a stack-based instance of
-// ProtectedMemoryLocker will unprotect this block after taking the lock.
-// Its destructor will first re-protect the memory then release the lock.
-class ProtectedMemoryLocker {
- public:
- ProtectedMemoryLocker(pthread_mutex_t *mutex,
- ProtectedMemoryAllocator *allocator)
- : mutex_(mutex),
- allocator_(allocator) {
- // Lock the mutex
- __attribute__((unused)) int rv = pthread_mutex_lock(mutex_);
- assert(rv == 0);
-
- // Unprotect the memory
- allocator_->Unprotect();
- }
-
- ~ProtectedMemoryLocker() {
- // First protect the memory
- allocator_->Protect();
-
- // Then unlock the mutex
- __attribute__((unused)) int rv = pthread_mutex_unlock(mutex_);
- assert(rv == 0);
- };
-
- private:
- ProtectedMemoryLocker();
- ProtectedMemoryLocker(const ProtectedMemoryLocker&);
- ProtectedMemoryLocker& operator=(const ProtectedMemoryLocker&);
-
- pthread_mutex_t *mutex_;
- ProtectedMemoryAllocator *allocator_;
-};
-
-//=============================================================================
-class Breakpad {
- public:
- // factory method
- static Breakpad *Create(NSDictionary *parameters) {
- // Allocate from our special allocation pool
- Breakpad *breakpad =
- new (gBreakpadAllocator->Allocate(sizeof(Breakpad)))
- Breakpad();
-
- if (!breakpad)
- return NULL;
-
- if (!breakpad->Initialize(parameters)) {
- // Don't use operator delete() here since we allocated from special pool
- breakpad->~Breakpad();
- return NULL;
- }
-
- return breakpad;
- }
-
- ~Breakpad();
-
- void SetKeyValue(NSString *key, NSString *value);
- NSString *KeyValue(NSString *key);
- void RemoveKeyValue(NSString *key);
- NSArray *CrashReportsToUpload();
- NSString *NextCrashReportToUpload();
- NSDictionary *NextCrashReportConfiguration();
- void UploadNextReport(NSDictionary *server_parameters);
- void UploadReportWithConfiguration(NSDictionary *configuration,
- NSDictionary *server_parameters);
- void UploadData(NSData *data, NSString *name,
- NSDictionary *server_parameters);
- void HandleNetworkResponse(NSDictionary *configuration,
- NSData *data,
- NSError *error);
- NSDictionary *GenerateReport(NSDictionary *server_parameters);
-
- private:
- Breakpad()
- : handler_(NULL),
- config_params_(NULL) {}
-
- bool Initialize(NSDictionary *parameters);
-
- bool ExtractParameters(NSDictionary *parameters);
-
- // Dispatches to HandleMinidump()
- static bool HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context, bool succeeded);
-
- bool HandleMinidump(const char *dump_dir,
- const char *minidump_id);
-
- // NSException handler
- static void UncaughtExceptionHandler(NSException *exception);
-
- // Handle an uncaught NSException.
- void HandleUncaughtException(NSException *exception);
-
- // Since ExceptionHandler (w/o namespace) is defined as typedef in OSX's
- // MachineExceptions.h, we have to explicitly name the handler.
- google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)
-
- SimpleStringDictionary *config_params_; // Create parameters (STRONG)
-
- ConfigFile config_file_;
-
- // A static reference to the current Breakpad instance. Used for handling
- // NSException.
- static Breakpad *current_breakpad_;
-};
-
-Breakpad *Breakpad::current_breakpad_ = NULL;
-
-#pragma mark -
-#pragma mark Helper functions
-
-//=============================================================================
-// Helper functions
-
-//=============================================================================
-static BOOL IsDebuggerActive() {
- BOOL result = NO;
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
-
- // We check both defaults and the environment variable here
-
- BOOL ignoreDebugger = [stdDefaults boolForKey:@IGNORE_DEBUGGER];
-
- if (!ignoreDebugger) {
- char *ignoreDebuggerStr = getenv(IGNORE_DEBUGGER);
- ignoreDebugger =
- (ignoreDebuggerStr ? strtol(ignoreDebuggerStr, NULL, 10) : 0) != 0;
- }
-
- if (!ignoreDebugger) {
- pid_t pid = getpid();
- int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid};
- int mibSize = sizeof(mib) / sizeof(int);
- size_t actualSize;
-
- if (sysctl(mib, mibSize, NULL, &actualSize, NULL, 0) == 0) {
- struct kinfo_proc *info = (struct kinfo_proc *)malloc(actualSize);
-
- if (info) {
- // This comes from looking at the Darwin xnu Kernel
- if (sysctl(mib, mibSize, info, &actualSize, NULL, 0) == 0)
- result = (info->kp_proc.p_flag & P_TRACED) ? YES : NO;
-
- free(info);
- }
- }
- }
-
- return result;
-}
-
-//=============================================================================
-bool Breakpad::HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context, bool succeeded) {
- Breakpad *breakpad = (Breakpad *)context;
-
- // If our context is damaged or something, just return false to indicate that
- // the handler should continue without us.
- if (!breakpad || !succeeded)
- return false;
-
- return breakpad->HandleMinidump(dump_dir, minidump_id);
-}
-
-//=============================================================================
-void Breakpad::UncaughtExceptionHandler(NSException *exception) {
- NSSetUncaughtExceptionHandler(NULL);
- if (current_breakpad_) {
- current_breakpad_->HandleUncaughtException(exception);
- BreakpadRelease(current_breakpad_);
- }
-}
-
-//=============================================================================
-#pragma mark -
-
-//=============================================================================
-bool Breakpad::Initialize(NSDictionary *parameters) {
- // Initialize
- current_breakpad_ = this;
- config_params_ = NULL;
- handler_ = NULL;
-
- // Gather any user specified parameters
- if (!ExtractParameters(parameters)) {
- return false;
- }
-
- // Check for debugger
- if (IsDebuggerActive()) {
- return true;
- }
-
- // Create the handler (allocating it in our special protected pool)
- handler_ =
- new (gBreakpadAllocator->Allocate(
- sizeof(google_breakpad::ExceptionHandler)))
- google_breakpad::ExceptionHandler(
- config_params_->GetValueForKey(BREAKPAD_DUMP_DIRECTORY),
- 0, &HandleMinidumpCallback, this, true, 0);
- NSSetUncaughtExceptionHandler(&Breakpad::UncaughtExceptionHandler);
- return true;
-}
-
-//=============================================================================
-Breakpad::~Breakpad() {
- NSSetUncaughtExceptionHandler(NULL);
- current_breakpad_ = NULL;
- // Note that we don't use operator delete() on these pointers,
- // since they were allocated by ProtectedMemoryAllocator objects.
- //
- if (config_params_) {
- config_params_->~SimpleStringDictionary();
- }
-
- if (handler_)
- handler_->~ExceptionHandler();
-}
-
-//=============================================================================
-bool Breakpad::ExtractParameters(NSDictionary *parameters) {
- NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
- NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
- NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
- NSString *version = [parameters objectForKey:@BREAKPAD_VERSION];
- NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL];
- NSString *vendor =
- [parameters objectForKey:@BREAKPAD_VENDOR];
- // We check both parameters and the environment variable here.
- char *envVarDumpSubdirectory = getenv(BREAKPAD_DUMP_DIRECTORY);
- NSString *dumpSubdirectory = envVarDumpSubdirectory ?
- [NSString stringWithUTF8String:envVarDumpSubdirectory] :
- [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY];
-
- NSDictionary *serverParameters =
- [parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT];
-
- if (!product)
- product = [parameters objectForKey:@"CFBundleName"];
-
- if (!display) {
- display = [parameters objectForKey:@"CFBundleDisplayName"];
- if (!display) {
- display = product;
- }
- }
-
- if (!version.length) // Default nil or empty string to CFBundleVersion
- version = [parameters objectForKey:@"CFBundleVersion"];
-
- if (!vendor) {
- vendor = @"Vendor not specified";
- }
-
- if (!dumpSubdirectory) {
- NSString *cachePath =
- [NSSearchPathForDirectoriesInDomains(NSCachesDirectory,
- NSUserDomainMask,
- YES)
- objectAtIndex:0];
- dumpSubdirectory =
- [cachePath stringByAppendingPathComponent:@kDefaultLibrarySubdirectory];
-
- EnsureDirectoryPathExists(dumpSubdirectory);
- }
-
- // The product, version, and URL are required values.
- if (![product length]) {
- return false;
- }
-
- if (![version length]) {
- return false;
- }
-
- if (![urlStr length]) {
- return false;
- }
-
- config_params_ =
- new (gKeyValueAllocator->Allocate(sizeof(SimpleStringDictionary)) )
- SimpleStringDictionary();
-
- SimpleStringDictionary &dictionary = *config_params_;
-
- dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_PRODUCT, [product UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_VERSION, [version UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_URL, [urlStr UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_VENDOR, [vendor UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_DUMP_DIRECTORY,
- [dumpSubdirectory UTF8String]);
-
- struct timeval tv;
- gettimeofday(&tv, NULL);
- char timeStartedString[32];
- sprintf(timeStartedString, "%zd", tv.tv_sec);
- dictionary.SetKeyValue(BREAKPAD_PROCESS_START_TIME, timeStartedString);
-
- if (serverParameters) {
- // For each key-value pair, call BreakpadAddUploadParameter()
- NSEnumerator *keyEnumerator = [serverParameters keyEnumerator];
- NSString *aParameter;
- while ((aParameter = [keyEnumerator nextObject])) {
- BreakpadAddUploadParameter(this, aParameter,
- [serverParameters objectForKey:aParameter]);
- }
- }
- return true;
-}
-
-//=============================================================================
-void Breakpad::SetKeyValue(NSString *key, NSString *value) {
- // We allow nil values. This is the same as removing the keyvalue.
- if (!config_params_ || !key)
- return;
-
- config_params_->SetKeyValue([key UTF8String], [value UTF8String]);
-}
-
-//=============================================================================
-NSString *Breakpad::KeyValue(NSString *key) {
- if (!config_params_ || !key)
- return nil;
-
- const char *value = config_params_->GetValueForKey([key UTF8String]);
- return value ? [NSString stringWithUTF8String:value] : nil;
-}
-
-//=============================================================================
-void Breakpad::RemoveKeyValue(NSString *key) {
- if (!config_params_ || !key) return;
-
- config_params_->RemoveKey([key UTF8String]);
-}
-
-//=============================================================================
-NSArray *Breakpad::CrashReportsToUpload() {
- NSString *directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
- if (!directory)
- return nil;
- NSArray *dirContents = [[NSFileManager defaultManager]
- contentsOfDirectoryAtPath:directory error:nil];
- NSArray *configs = [dirContents filteredArrayUsingPredicate:[NSPredicate
- predicateWithFormat:@"self BEGINSWITH 'Config-'"]];
- return configs;
-}
-
-//=============================================================================
-NSString *Breakpad::NextCrashReportToUpload() {
- NSString *directory = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
- if (!directory)
- return nil;
- NSString *config = [CrashReportsToUpload() lastObject];
- if (!config)
- return nil;
- return [NSString stringWithFormat:@"%@/%@", directory, config];
-}
-
-//=============================================================================
-NSDictionary *Breakpad::NextCrashReportConfiguration() {
- return [Uploader readConfigurationDataFromFile:NextCrashReportToUpload()];
-}
-
-//=============================================================================
-void Breakpad::HandleNetworkResponse(NSDictionary *configuration,
- NSData *data,
- NSError *error) {
- Uploader *uploader = [[[Uploader alloc]
- initWithConfig:configuration] autorelease];
- [uploader handleNetworkResponse:data withError:error];
-}
-
-//=============================================================================
-void Breakpad::UploadReportWithConfiguration(NSDictionary *configuration,
- NSDictionary *server_parameters) {
- Uploader *uploader = [[[Uploader alloc]
- initWithConfig:configuration] autorelease];
- if (!uploader)
- return;
- for (NSString *key in server_parameters) {
- [uploader addServerParameter:[server_parameters objectForKey:key]
- forKey:key];
- }
- [uploader report];
-}
-
-//=============================================================================
-void Breakpad::UploadNextReport(NSDictionary *server_parameters) {
- NSDictionary *configuration = NextCrashReportConfiguration();
- if (configuration) {
- return UploadReportWithConfiguration(configuration, server_parameters);
- }
-}
-
-//=============================================================================
-void Breakpad::UploadData(NSData *data, NSString *name,
- NSDictionary *server_parameters) {
- NSMutableDictionary *config = [NSMutableDictionary dictionary];
-
- SimpleStringDictionary::Iterator it(*config_params_);
- while (const SimpleStringDictionary::Entry *next = it.Next()) {
- [config setValue:[NSString stringWithUTF8String:next->value]
- forKey:[NSString stringWithUTF8String:next->key]];
- }
-
- Uploader *uploader =
- [[[Uploader alloc] initWithConfig:config] autorelease];
- for (NSString *key in server_parameters) {
- [uploader addServerParameter:[server_parameters objectForKey:key]
- forKey:key];
- }
- [uploader uploadData:data name:name];
-}
-
-//=============================================================================
-NSDictionary *Breakpad::GenerateReport(NSDictionary *server_parameters) {
- NSString *dumpDirAsNSString = KeyValue(@BREAKPAD_DUMP_DIRECTORY);
- if (!dumpDirAsNSString)
- return nil;
- const char *dumpDir = [dumpDirAsNSString UTF8String];
-
- google_breakpad::MinidumpGenerator generator(mach_task_self(),
- MACH_PORT_NULL);
- std::string dumpId;
- std::string dumpFilename = generator.UniqueNameInDirectory(dumpDir, &dumpId);
- bool success = generator.Write(dumpFilename.c_str());
- if (!success)
- return nil;
-
- SimpleStringDictionary params = *config_params_;
- for (NSString *key in server_parameters) {
- params.SetKeyValue([key UTF8String],
- [[server_parameters objectForKey:key] UTF8String]);
- }
- ConfigFile config_file;
- config_file.WriteFile(dumpDir, &params, dumpDir, dumpId.c_str());
-
- // Handle results.
- NSMutableDictionary *result = [NSMutableDictionary dictionary];
- NSString *dumpFullPath = [NSString stringWithUTF8String:dumpFilename.c_str()];
- [result setValue:dumpFullPath
- forKey:@BREAKPAD_OUTPUT_DUMP_FILE];
- [result setValue:[NSString stringWithUTF8String:config_file.GetFilePath()]
- forKey:@BREAKPAD_OUTPUT_CONFIG_FILE];
- return result;
-}
-
-//=============================================================================
-bool Breakpad::HandleMinidump(const char *dump_dir,
- const char *minidump_id) {
- config_file_.WriteFile(dump_dir,
- config_params_,
- dump_dir,
- minidump_id);
-
- // Return true here to indicate that we've processed things as much as we
- // want.
- return true;
-}
-
-//=============================================================================
-void Breakpad::HandleUncaughtException(NSException *exception) {
- // Generate the minidump.
- google_breakpad::IosExceptionMinidumpGenerator generator(exception);
- const char *minidump_path =
- config_params_->GetValueForKey(BREAKPAD_DUMP_DIRECTORY);
- std::string minidump_id;
- std::string minidump_filename = generator.UniqueNameInDirectory(minidump_path,
- &minidump_id);
- generator.Write(minidump_filename.c_str());
-
- // Copy the config params and our custom parameter. This is necessary for 2
- // reasons:
- // 1- config_params_ is protected.
- // 2- If the application crash while trying to handle this exception, a usual
- // report will be generated. This report must not contain these special
- // keys.
- SimpleStringDictionary params = *config_params_;
- params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "type", "exception");
- params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "exceptionName",
- [[exception name] UTF8String]);
- params.SetKeyValue(BREAKPAD_SERVER_PARAMETER_PREFIX "exceptionReason",
- [[exception reason] UTF8String]);
-
- // And finally write the config file.
- ConfigFile config_file;
- config_file.WriteFile(minidump_path,
- &params,
- minidump_path,
- minidump_id.c_str());
-}
-
-//=============================================================================
-
-#pragma mark -
-#pragma mark Public API
-
-//=============================================================================
-BreakpadRef BreakpadCreate(NSDictionary *parameters) {
- try {
- // This is confusing. Our two main allocators for breakpad memory are:
- // - gKeyValueAllocator for the key/value memory
- // - gBreakpadAllocator for the Breakpad, ExceptionHandler, and other
- // breakpad allocations which are accessed at exception handling time.
- //
- // But in order to avoid these two allocators themselves from being smashed,
- // we'll protect them as well by allocating them with gMasterAllocator.
- //
- // gMasterAllocator itself will NOT be protected, but this doesn't matter,
- // since once it does its allocations and locks the memory, smashes to
- // itself don't affect anything we care about.
- gMasterAllocator =
- new ProtectedMemoryAllocator(sizeof(ProtectedMemoryAllocator) * 2);
-
- gKeyValueAllocator =
- new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
- ProtectedMemoryAllocator(sizeof(SimpleStringDictionary));
-
- // Create a mutex for use in accessing the SimpleStringDictionary
- int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL);
- if (mutexResult == 0) {
-
- // With the current compiler, gBreakpadAllocator is allocating 1444 bytes.
- // Let's round up to the nearest page size.
- //
- int breakpad_pool_size = 4096;
-
- /*
- sizeof(Breakpad)
- + sizeof(google_breakpad::ExceptionHandler)
- + sizeof( STUFF ALLOCATED INSIDE ExceptionHandler )
- */
-
- gBreakpadAllocator =
- new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
- ProtectedMemoryAllocator(breakpad_pool_size);
-
- // Stack-based autorelease pool for Breakpad::Create() obj-c code.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Breakpad *breakpad = Breakpad::Create(parameters);
-
- if (breakpad) {
- // Make read-only to protect against memory smashers
- gMasterAllocator->Protect();
- gKeyValueAllocator->Protect();
- gBreakpadAllocator->Protect();
- // Can uncomment this line to figure out how much space was actually
- // allocated using this allocator
- // printf("gBreakpadAllocator allocated size = %d\n",
- // gBreakpadAllocator->GetAllocatedSize() );
- [pool release];
- return (BreakpadRef)breakpad;
- }
-
- [pool release];
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadCreate() : error\n");
- }
-
- if (gKeyValueAllocator) {
- gKeyValueAllocator->~ProtectedMemoryAllocator();
- gKeyValueAllocator = NULL;
- }
-
- if (gBreakpadAllocator) {
- gBreakpadAllocator->~ProtectedMemoryAllocator();
- gBreakpadAllocator = NULL;
- }
-
- delete gMasterAllocator;
- gMasterAllocator = NULL;
-
- return NULL;
-}
-
-//=============================================================================
-void BreakpadRelease(BreakpadRef ref) {
- try {
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (gMasterAllocator) {
- gMasterAllocator->Unprotect();
- gKeyValueAllocator->Unprotect();
- gBreakpadAllocator->Unprotect();
-
- breakpad->~Breakpad();
-
- // Unfortunately, it's not possible to deallocate this stuff
- // because the exception handling thread is still finishing up
- // asynchronously at this point... OK, it could be done with
- // locks, etc. But since BreakpadRelease() should usually only
- // be called right before the process exits, it's not worth
- // deallocating this stuff.
-#if 0
- gKeyValueAllocator->~ProtectedMemoryAllocator();
- gBreakpadAllocator->~ProtectedMemoryAllocator();
- delete gMasterAllocator;
-
- gMasterAllocator = NULL;
- gKeyValueAllocator = NULL;
- gBreakpadAllocator = NULL;
-#endif
-
- pthread_mutex_destroy(&gDictionaryMutex);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadRelease() : error\n");
- }
-}
-
-//=============================================================================
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- breakpad->SetKeyValue(key, value);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadSetKeyValue() : error\n");
- }
-}
-
-void BreakpadAddUploadParameter(BreakpadRef ref,
- NSString *key,
- NSString *value) {
- // The only difference, internally, between an upload parameter and
- // a key value one that is set with BreakpadSetKeyValue is that we
- // prepend the keyname with a special prefix. This informs the
- // crash sender that the parameter should be sent along with the
- // POST of the crash dump upload.
- try {
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- NSString *prefixedKey = [@BREAKPAD_SERVER_PARAMETER_PREFIX
- stringByAppendingString:key];
- breakpad->SetKeyValue(prefixedKey, value);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadSetKeyValue() : error\n");
- }
-}
-
-void BreakpadRemoveUploadParameter(BreakpadRef ref,
- NSString *key) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- NSString *prefixedKey = [NSString stringWithFormat:@"%@%@",
- @BREAKPAD_SERVER_PARAMETER_PREFIX, key];
- breakpad->RemoveKeyValue(prefixedKey);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadRemoveKeyValue() : error\n");
- }
-}
-//=============================================================================
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key) {
- NSString *value = nil;
-
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (!breakpad || !key || !gKeyValueAllocator)
- return nil;
-
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- value = breakpad->KeyValue(key);
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadKeyValue() : error\n");
- }
-
- return value;
-}
-
-//=============================================================================
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- breakpad->RemoveKeyValue(key);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadRemoveKeyValue() : error\n");
- }
-}
-
-//=============================================================================
-int BreakpadGetCrashReportCount(BreakpadRef ref) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad) {
- return static_cast<int>([breakpad->CrashReportsToUpload() count]);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadGetCrashReportCount() : error\n");
- }
- return false;
-}
-
-//=============================================================================
-void BreakpadUploadNextReport(BreakpadRef ref) {
- BreakpadUploadNextReportWithParameters(ref, nil);
-}
-
-//=============================================================================
-NSDictionary *BreakpadGetNextReportConfiguration(BreakpadRef ref) {
- try {
- Breakpad *breakpad = (Breakpad *)ref;
- if (breakpad)
- return breakpad->NextCrashReportConfiguration();
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadGetNextReportConfiguration() : error\n");
- }
- return nil;
-}
-
-//=============================================================================
-void BreakpadUploadReportWithParametersAndConfiguration(
- BreakpadRef ref,
- NSDictionary *server_parameters,
- NSDictionary *configuration) {
- try {
- Breakpad *breakpad = (Breakpad *)ref;
- if (!breakpad || !configuration)
- return;
- breakpad->UploadReportWithConfiguration(configuration, server_parameters);
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr,
- "BreakpadUploadReportWithParametersAndConfiguration() : error\n");
- }
-
-}
-
-//=============================================================================
-void BreakpadUploadNextReportWithParameters(BreakpadRef ref,
- NSDictionary *server_parameters) {
- try {
- Breakpad *breakpad = (Breakpad *)ref;
- if (!breakpad)
- return;
- NSDictionary *configuration = breakpad->NextCrashReportConfiguration();
- if (!configuration)
- return;
- return BreakpadUploadReportWithParametersAndConfiguration(ref,
- server_parameters,
- configuration);
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadUploadNextReportWithParameters() : error\n");
- }
-}
-
-void BreakpadHandleNetworkResponse(BreakpadRef ref,
- NSDictionary *configuration,
- NSData *data,
- NSError *error) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
- if (breakpad && configuration)
- breakpad->HandleNetworkResponse(configuration,data, error);
-
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadHandleNetworkResponse() : error\n");
- }
-}
-
-//=============================================================================
-void BreakpadUploadData(BreakpadRef ref, NSData *data, NSString *name,
- NSDictionary *server_parameters) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad) {
- breakpad->UploadData(data, name, server_parameters);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadUploadData() : error\n");
- }
-}
-
-//=============================================================================
-NSDictionary *BreakpadGenerateReport(BreakpadRef ref,
- NSDictionary *server_parameters) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad) {
- return breakpad->GenerateReport(server_parameters);
- } else {
- return nil;
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadGenerateReport() : error\n");
- return nil;
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.xcodeproj/project.pbxproj
deleted file mode 100644
index e9fcae3f9d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,578 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 14569321182CE29F0029C465 /* ucontext_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 14569320182CE29F0029C465 /* ucontext_compat.h */; };
- 14569323182CE2C10029C465 /* mach_vm_compat.h in Headers */ = {isa = PBXBuildFile; fileRef = 14569322182CE2C10029C465 /* mach_vm_compat.h */; };
- 16BFA67014E195E9009704F8 /* ios_exception_minidump_generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 16BFA66E14E195E9009704F8 /* ios_exception_minidump_generator.h */; };
- 16BFA67214E1965A009704F8 /* ios_exception_minidump_generator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 16BFA67114E1965A009704F8 /* ios_exception_minidump_generator.mm */; };
- 16C7CCCB147D4A4300776EAD /* BreakpadDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7C968147D4A4200776EAD /* BreakpadDefines.h */; };
- 16C7CCCC147D4A4300776EAD /* Breakpad.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7C96A147D4A4200776EAD /* Breakpad.h */; };
- 16C7CCCD147D4A4300776EAD /* Breakpad.mm in Sources */ = {isa = PBXBuildFile; fileRef = 16C7C96B147D4A4200776EAD /* Breakpad.mm */; };
- 16C7CDE8147D4A4300776EAD /* ConfigFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CB9E147D4A4300776EAD /* ConfigFile.h */; };
- 16C7CDE9147D4A4300776EAD /* ConfigFile.mm in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CB9F147D4A4300776EAD /* ConfigFile.mm */; };
- 16C7CDF5147D4A4300776EAD /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CBAD147D4A4300776EAD /* breakpad_nlist_64.cc */; };
- 16C7CDF6147D4A4300776EAD /* breakpad_nlist_64.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CBAE147D4A4300776EAD /* breakpad_nlist_64.h */; };
- 16C7CDF7147D4A4300776EAD /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CBAF147D4A4300776EAD /* dynamic_images.cc */; };
- 16C7CDF8147D4A4300776EAD /* dynamic_images.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CBB0147D4A4300776EAD /* dynamic_images.h */; };
- 16C7CDF9147D4A4300776EAD /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CBB1147D4A4300776EAD /* exception_handler.cc */; };
- 16C7CDFA147D4A4300776EAD /* exception_handler.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CBB2147D4A4300776EAD /* exception_handler.h */; };
- 16C7CDFC147D4A4300776EAD /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CBB4147D4A4300776EAD /* minidump_generator.cc */; };
- 16C7CDFD147D4A4300776EAD /* minidump_generator.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CBB5147D4A4300776EAD /* minidump_generator.h */; };
- 16C7CDFE147D4A4300776EAD /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CBBC147D4A4300776EAD /* protected_memory_allocator.cc */; };
- 16C7CDFF147D4A4300776EAD /* protected_memory_allocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CBBD147D4A4300776EAD /* protected_memory_allocator.h */; };
- 16C7CE08147D4A4300776EAD /* uploader.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CBEA147D4A4300776EAD /* uploader.h */; };
- 16C7CE09147D4A4300776EAD /* uploader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CBEB147D4A4300776EAD /* uploader.mm */; };
- 16C7CE18147D4A4300776EAD /* minidump_file_writer-inl.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC04147D4A4300776EAD /* minidump_file_writer-inl.h */; };
- 16C7CE19147D4A4300776EAD /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC05147D4A4300776EAD /* minidump_file_writer.cc */; };
- 16C7CE1A147D4A4300776EAD /* minidump_file_writer.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC06147D4A4300776EAD /* minidump_file_writer.h */; };
- 16C7CE40147D4A4300776EAD /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC4A147D4A4300776EAD /* convert_UTF.c */; };
- 16C7CE41147D4A4300776EAD /* convert_UTF.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC4B147D4A4300776EAD /* convert_UTF.h */; };
- 16C7CE78147D4A4300776EAD /* GTMLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC88147D4A4300776EAD /* GTMLogger.h */; };
- 16C7CE79147D4A4300776EAD /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC89147D4A4300776EAD /* GTMLogger.m */; };
- 16C7CE7A147D4A4300776EAD /* HTTPMultipartUpload.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC8A147D4A4300776EAD /* HTTPMultipartUpload.h */; };
- 16C7CE7B147D4A4300776EAD /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC8B147D4A4300776EAD /* HTTPMultipartUpload.m */; };
- 16C7CE83147D4A4300776EAD /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC93147D4A4300776EAD /* file_id.cc */; };
- 16C7CE84147D4A4300776EAD /* file_id.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC94147D4A4300776EAD /* file_id.h */; };
- 16C7CE85147D4A4300776EAD /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC95147D4A4300776EAD /* macho_id.cc */; };
- 16C7CE86147D4A4300776EAD /* macho_id.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC96147D4A4300776EAD /* macho_id.h */; };
- 16C7CE8A147D4A4300776EAD /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC9A147D4A4300776EAD /* macho_utilities.cc */; };
- 16C7CE8B147D4A4300776EAD /* macho_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC9B147D4A4300776EAD /* macho_utilities.h */; };
- 16C7CE8C147D4A4300776EAD /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC9C147D4A4300776EAD /* macho_walker.cc */; };
- 16C7CE8D147D4A4300776EAD /* macho_walker.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CC9D147D4A4300776EAD /* macho_walker.h */; };
- 16C7CE8F147D4A4300776EAD /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CC9F147D4A4300776EAD /* string_utilities.cc */; };
- 16C7CE90147D4A4300776EAD /* string_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CCA0147D4A4300776EAD /* string_utilities.h */; };
- 16C7CE93147D4A4300776EAD /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CCA4147D4A4300776EAD /* md5.cc */; };
- 16C7CE94147D4A4300776EAD /* md5.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CCA5147D4A4300776EAD /* md5.h */; };
- 16C7CEA7147D4A4300776EAD /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 16C7CCB9147D4A4300776EAD /* string_conversion.cc */; };
- 16C7CEA8147D4A4300776EAD /* string_conversion.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7CCBA147D4A4300776EAD /* string_conversion.h */; };
- 16C92FAD150DF8330053D7BA /* BreakpadController.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C92FAB150DF8330053D7BA /* BreakpadController.h */; };
- 16C92FAE150DF8330053D7BA /* BreakpadController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 16C92FAC150DF8330053D7BA /* BreakpadController.mm */; };
- 1EEEB60F1720821900F7E689 /* simple_string_dictionary.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1EEEB60C1720821900F7E689 /* simple_string_dictionary.cc */; };
- 1EEEB6101720821900F7E689 /* simple_string_dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */; };
- AA747D9F0F9514B9006C5449 /* Breakpad_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */; };
- AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 14569320182CE29F0029C465 /* ucontext_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ucontext_compat.h; sourceTree = "<group>"; };
- 14569322182CE2C10029C465 /* mach_vm_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mach_vm_compat.h; sourceTree = "<group>"; };
- 16BFA66E14E195E9009704F8 /* ios_exception_minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ios_exception_minidump_generator.h; sourceTree = "<group>"; };
- 16BFA67114E1965A009704F8 /* ios_exception_minidump_generator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ios_exception_minidump_generator.mm; sourceTree = "<group>"; };
- 16C7C968147D4A4200776EAD /* BreakpadDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakpadDefines.h; sourceTree = "<group>"; };
- 16C7C96A147D4A4200776EAD /* Breakpad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpad.h; sourceTree = "<group>"; };
- 16C7C96B147D4A4200776EAD /* Breakpad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Breakpad.mm; sourceTree = "<group>"; };
- 16C7CB9E147D4A4300776EAD /* ConfigFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ConfigFile.h; sourceTree = "<group>"; };
- 16C7CB9F147D4A4300776EAD /* ConfigFile.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ConfigFile.mm; sourceTree = "<group>"; };
- 16C7CBAD147D4A4300776EAD /* breakpad_nlist_64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = breakpad_nlist_64.cc; sourceTree = "<group>"; };
- 16C7CBAE147D4A4300776EAD /* breakpad_nlist_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = breakpad_nlist_64.h; sourceTree = "<group>"; };
- 16C7CBAF147D4A4300776EAD /* dynamic_images.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = dynamic_images.cc; sourceTree = "<group>"; };
- 16C7CBB0147D4A4300776EAD /* dynamic_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dynamic_images.h; sourceTree = "<group>"; };
- 16C7CBB1147D4A4300776EAD /* exception_handler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = exception_handler.cc; sourceTree = "<group>"; };
- 16C7CBB2147D4A4300776EAD /* exception_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = exception_handler.h; sourceTree = "<group>"; };
- 16C7CBB4147D4A4300776EAD /* minidump_generator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_generator.cc; sourceTree = "<group>"; };
- 16C7CBB5147D4A4300776EAD /* minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = minidump_generator.h; sourceTree = "<group>"; };
- 16C7CBBC147D4A4300776EAD /* protected_memory_allocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = protected_memory_allocator.cc; sourceTree = "<group>"; };
- 16C7CBBD147D4A4300776EAD /* protected_memory_allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = protected_memory_allocator.h; sourceTree = "<group>"; };
- 16C7CBEA147D4A4300776EAD /* uploader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uploader.h; sourceTree = "<group>"; };
- 16C7CBEB147D4A4300776EAD /* uploader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = uploader.mm; sourceTree = "<group>"; };
- 16C7CC04147D4A4300776EAD /* minidump_file_writer-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "minidump_file_writer-inl.h"; sourceTree = "<group>"; };
- 16C7CC05147D4A4300776EAD /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_file_writer.cc; sourceTree = "<group>"; };
- 16C7CC06147D4A4300776EAD /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = minidump_file_writer.h; sourceTree = "<group>"; };
- 16C7CC07147D4A4300776EAD /* minidump_file_writer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_file_writer_unittest.cc; sourceTree = "<group>"; };
- 16C7CC4A147D4A4300776EAD /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = convert_UTF.c; sourceTree = "<group>"; };
- 16C7CC4B147D4A4300776EAD /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = convert_UTF.h; sourceTree = "<group>"; };
- 16C7CC88147D4A4300776EAD /* GTMLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GTMLogger.h; sourceTree = "<group>"; };
- 16C7CC89147D4A4300776EAD /* GTMLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GTMLogger.m; sourceTree = "<group>"; };
- 16C7CC8A147D4A4300776EAD /* HTTPMultipartUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTTPMultipartUpload.h; sourceTree = "<group>"; };
- 16C7CC8B147D4A4300776EAD /* HTTPMultipartUpload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HTTPMultipartUpload.m; sourceTree = "<group>"; };
- 16C7CC93147D4A4300776EAD /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = file_id.cc; sourceTree = "<group>"; };
- 16C7CC94147D4A4300776EAD /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = file_id.h; sourceTree = "<group>"; };
- 16C7CC95147D4A4300776EAD /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_id.cc; sourceTree = "<group>"; };
- 16C7CC96147D4A4300776EAD /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho_id.h; sourceTree = "<group>"; };
- 16C7CC9A147D4A4300776EAD /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_utilities.cc; sourceTree = "<group>"; };
- 16C7CC9B147D4A4300776EAD /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho_utilities.h; sourceTree = "<group>"; };
- 16C7CC9C147D4A4300776EAD /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_walker.cc; sourceTree = "<group>"; };
- 16C7CC9D147D4A4300776EAD /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macho_walker.h; sourceTree = "<group>"; };
- 16C7CC9F147D4A4300776EAD /* string_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string_utilities.cc; sourceTree = "<group>"; };
- 16C7CCA0147D4A4300776EAD /* string_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string_utilities.h; sourceTree = "<group>"; };
- 16C7CCA4147D4A4300776EAD /* md5.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = md5.cc; sourceTree = "<group>"; };
- 16C7CCA5147D4A4300776EAD /* md5.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = md5.h; sourceTree = "<group>"; };
- 16C7CCB9147D4A4300776EAD /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = string_conversion.cc; sourceTree = "<group>"; };
- 16C7CCBA147D4A4300776EAD /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string_conversion.h; sourceTree = "<group>"; };
- 16C92FAB150DF8330053D7BA /* BreakpadController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakpadController.h; sourceTree = "<group>"; };
- 16C92FAC150DF8330053D7BA /* BreakpadController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BreakpadController.mm; sourceTree = "<group>"; };
- 1EEEB60C1720821900F7E689 /* simple_string_dictionary.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = simple_string_dictionary.cc; sourceTree = "<group>"; };
- 1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = simple_string_dictionary.h; sourceTree = "<group>"; };
- AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Breakpad_Prefix.pch; sourceTree = SOURCE_ROOT; };
- AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- D2AAC07E0554694100DB518D /* libBreakpad.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libBreakpad.a; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- D2AAC07C0554694100DB518D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 034768DFFF38A50411DB9C8B /* Products */ = {
- isa = PBXGroup;
- children = (
- D2AAC07E0554694100DB518D /* libBreakpad.a */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 0867D691FE84028FC02AAC07 /* Breakpad */ = {
- isa = PBXGroup;
- children = (
- 08FB77AEFE84172EC02AAC07 /* Classes */,
- 32C88DFF0371C24200C91783 /* Other Sources */,
- 0867D69AFE84028FC02AAC07 /* Frameworks */,
- 034768DFFF38A50411DB9C8B /* Products */,
- );
- name = Breakpad;
- sourceTree = "<group>";
- };
- 0867D69AFE84028FC02AAC07 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- AACBBE490F95108600F1A2B1 /* Foundation.framework */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 08FB77AEFE84172EC02AAC07 /* Classes */ = {
- isa = PBXGroup;
- children = (
- 16C7C965147D4A4200776EAD /* client */,
- 16C7CC47147D4A4300776EAD /* common */,
- );
- name = Classes;
- sourceTree = "<group>";
- };
- 16BFA66A14E195E9009704F8 /* handler */ = {
- isa = PBXGroup;
- children = (
- 16BFA67114E1965A009704F8 /* ios_exception_minidump_generator.mm */,
- 16BFA66E14E195E9009704F8 /* ios_exception_minidump_generator.h */,
- );
- path = handler;
- sourceTree = "<group>";
- };
- 16C7C965147D4A4200776EAD /* client */ = {
- isa = PBXGroup;
- children = (
- 16C7C966147D4A4200776EAD /* apple */,
- 16C7C969147D4A4200776EAD /* ios */,
- 16C7C99E147D4A4200776EAD /* mac */,
- 16C7CC04147D4A4300776EAD /* minidump_file_writer-inl.h */,
- 16C7CC05147D4A4300776EAD /* minidump_file_writer.cc */,
- 16C7CC06147D4A4300776EAD /* minidump_file_writer.h */,
- 16C7CC07147D4A4300776EAD /* minidump_file_writer_unittest.cc */,
- );
- name = client;
- path = ..;
- sourceTree = SOURCE_ROOT;
- };
- 16C7C966147D4A4200776EAD /* apple */ = {
- isa = PBXGroup;
- children = (
- 16C7C967147D4A4200776EAD /* Framework */,
- );
- path = apple;
- sourceTree = "<group>";
- };
- 16C7C967147D4A4200776EAD /* Framework */ = {
- isa = PBXGroup;
- children = (
- 16C7C968147D4A4200776EAD /* BreakpadDefines.h */,
- );
- path = Framework;
- sourceTree = "<group>";
- };
- 16C7C969147D4A4200776EAD /* ios */ = {
- isa = PBXGroup;
- children = (
- 16C92FAB150DF8330053D7BA /* BreakpadController.h */,
- 16C92FAC150DF8330053D7BA /* BreakpadController.mm */,
- 16BFA66A14E195E9009704F8 /* handler */,
- 16C7C96A147D4A4200776EAD /* Breakpad.h */,
- 16C7C96B147D4A4200776EAD /* Breakpad.mm */,
- );
- path = ios;
- sourceTree = "<group>";
- };
- 16C7C99E147D4A4200776EAD /* mac */ = {
- isa = PBXGroup;
- children = (
- 16C7CB9D147D4A4300776EAD /* crash_generation */,
- 16C7CBAA147D4A4300776EAD /* handler */,
- 16C7CBC8147D4A4300776EAD /* sender */,
- );
- path = mac;
- sourceTree = "<group>";
- };
- 16C7CB9D147D4A4300776EAD /* crash_generation */ = {
- isa = PBXGroup;
- children = (
- 16C7CB9E147D4A4300776EAD /* ConfigFile.h */,
- 16C7CB9F147D4A4300776EAD /* ConfigFile.mm */,
- );
- path = crash_generation;
- sourceTree = "<group>";
- };
- 16C7CBAA147D4A4300776EAD /* handler */ = {
- isa = PBXGroup;
- children = (
- 16C7CBAD147D4A4300776EAD /* breakpad_nlist_64.cc */,
- 16C7CBAE147D4A4300776EAD /* breakpad_nlist_64.h */,
- 16C7CBAF147D4A4300776EAD /* dynamic_images.cc */,
- 16C7CBB0147D4A4300776EAD /* dynamic_images.h */,
- 16C7CBB1147D4A4300776EAD /* exception_handler.cc */,
- 16C7CBB2147D4A4300776EAD /* exception_handler.h */,
- 14569322182CE2C10029C465 /* mach_vm_compat.h */,
- 16C7CBB4147D4A4300776EAD /* minidump_generator.cc */,
- 16C7CBB5147D4A4300776EAD /* minidump_generator.h */,
- 16C7CBBC147D4A4300776EAD /* protected_memory_allocator.cc */,
- 16C7CBBD147D4A4300776EAD /* protected_memory_allocator.h */,
- 14569320182CE29F0029C465 /* ucontext_compat.h */,
- );
- path = handler;
- sourceTree = "<group>";
- };
- 16C7CBC8147D4A4300776EAD /* sender */ = {
- isa = PBXGroup;
- children = (
- 16C7CBEA147D4A4300776EAD /* uploader.h */,
- 16C7CBEB147D4A4300776EAD /* uploader.mm */,
- );
- path = sender;
- sourceTree = "<group>";
- };
- 16C7CC47147D4A4300776EAD /* common */ = {
- isa = PBXGroup;
- children = (
- 1EEEB60C1720821900F7E689 /* simple_string_dictionary.cc */,
- 1EEEB60D1720821900F7E689 /* simple_string_dictionary.h */,
- 16C7CC4A147D4A4300776EAD /* convert_UTF.c */,
- 16C7CC4B147D4A4300776EAD /* convert_UTF.h */,
- 16C7CC82147D4A4300776EAD /* mac */,
- 16C7CCA4147D4A4300776EAD /* md5.cc */,
- 16C7CCA5147D4A4300776EAD /* md5.h */,
- 16C7CCB9147D4A4300776EAD /* string_conversion.cc */,
- 16C7CCBA147D4A4300776EAD /* string_conversion.h */,
- );
- name = common;
- path = ../../common;
- sourceTree = SOURCE_ROOT;
- };
- 16C7CC82147D4A4300776EAD /* mac */ = {
- isa = PBXGroup;
- children = (
- 16C7CC88147D4A4300776EAD /* GTMLogger.h */,
- 16C7CC89147D4A4300776EAD /* GTMLogger.m */,
- 16C7CC8A147D4A4300776EAD /* HTTPMultipartUpload.h */,
- 16C7CC8B147D4A4300776EAD /* HTTPMultipartUpload.m */,
- 16C7CC93147D4A4300776EAD /* file_id.cc */,
- 16C7CC94147D4A4300776EAD /* file_id.h */,
- 16C7CC95147D4A4300776EAD /* macho_id.cc */,
- 16C7CC96147D4A4300776EAD /* macho_id.h */,
- 16C7CC9A147D4A4300776EAD /* macho_utilities.cc */,
- 16C7CC9B147D4A4300776EAD /* macho_utilities.h */,
- 16C7CC9C147D4A4300776EAD /* macho_walker.cc */,
- 16C7CC9D147D4A4300776EAD /* macho_walker.h */,
- 16C7CC9F147D4A4300776EAD /* string_utilities.cc */,
- 16C7CCA0147D4A4300776EAD /* string_utilities.h */,
- );
- path = mac;
- sourceTree = "<group>";
- };
- 32C88DFF0371C24200C91783 /* Other Sources */ = {
- isa = PBXGroup;
- children = (
- AA747D9E0F9514B9006C5449 /* Breakpad_Prefix.pch */,
- );
- name = "Other Sources";
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- D2AAC07A0554694100DB518D /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- AA747D9F0F9514B9006C5449 /* Breakpad_Prefix.pch in Headers */,
- 16C7CCCB147D4A4300776EAD /* BreakpadDefines.h in Headers */,
- 16C7CCCC147D4A4300776EAD /* Breakpad.h in Headers */,
- 16C7CDE8147D4A4300776EAD /* ConfigFile.h in Headers */,
- 14569321182CE29F0029C465 /* ucontext_compat.h in Headers */,
- 16C7CDF6147D4A4300776EAD /* breakpad_nlist_64.h in Headers */,
- 16C7CDF8147D4A4300776EAD /* dynamic_images.h in Headers */,
- 16C7CDFA147D4A4300776EAD /* exception_handler.h in Headers */,
- 16C7CDFD147D4A4300776EAD /* minidump_generator.h in Headers */,
- 16C7CDFF147D4A4300776EAD /* protected_memory_allocator.h in Headers */,
- 16C7CE08147D4A4300776EAD /* uploader.h in Headers */,
- 16C7CE18147D4A4300776EAD /* minidump_file_writer-inl.h in Headers */,
- 16C7CE1A147D4A4300776EAD /* minidump_file_writer.h in Headers */,
- 16C7CE41147D4A4300776EAD /* convert_UTF.h in Headers */,
- 16C7CE78147D4A4300776EAD /* GTMLogger.h in Headers */,
- 16C7CE7A147D4A4300776EAD /* HTTPMultipartUpload.h in Headers */,
- 16C7CE84147D4A4300776EAD /* file_id.h in Headers */,
- 16C7CE86147D4A4300776EAD /* macho_id.h in Headers */,
- 16C7CE8B147D4A4300776EAD /* macho_utilities.h in Headers */,
- 16C7CE8D147D4A4300776EAD /* macho_walker.h in Headers */,
- 16C7CE90147D4A4300776EAD /* string_utilities.h in Headers */,
- 16C7CE94147D4A4300776EAD /* md5.h in Headers */,
- 16C7CEA8147D4A4300776EAD /* string_conversion.h in Headers */,
- 16BFA67014E195E9009704F8 /* ios_exception_minidump_generator.h in Headers */,
- 16C92FAD150DF8330053D7BA /* BreakpadController.h in Headers */,
- 1EEEB6101720821900F7E689 /* simple_string_dictionary.h in Headers */,
- 14569323182CE2C10029C465 /* mach_vm_compat.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- D2AAC07D0554694100DB518D /* Breakpad */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */;
- buildPhases = (
- D2AAC07A0554694100DB518D /* Headers */,
- D2AAC07B0554694100DB518D /* Sources */,
- D2AAC07C0554694100DB518D /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = Breakpad;
- productName = Breakpad;
- productReference = D2AAC07E0554694100DB518D /* libBreakpad.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0510;
- };
- buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Breakpad" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- da,
- de,
- es,
- fr,
- it,
- ja,
- nl,
- no,
- sl,
- sv,
- tr,
- );
- mainGroup = 0867D691FE84028FC02AAC07 /* Breakpad */;
- productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- D2AAC07D0554694100DB518D /* Breakpad */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- D2AAC07B0554694100DB518D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 16C7CCCD147D4A4300776EAD /* Breakpad.mm in Sources */,
- 16C7CDE9147D4A4300776EAD /* ConfigFile.mm in Sources */,
- 16C7CDF5147D4A4300776EAD /* breakpad_nlist_64.cc in Sources */,
- 16C7CDF7147D4A4300776EAD /* dynamic_images.cc in Sources */,
- 16C7CDF9147D4A4300776EAD /* exception_handler.cc in Sources */,
- 16C7CDFC147D4A4300776EAD /* minidump_generator.cc in Sources */,
- 16C7CDFE147D4A4300776EAD /* protected_memory_allocator.cc in Sources */,
- 16C7CE09147D4A4300776EAD /* uploader.mm in Sources */,
- 16C7CE19147D4A4300776EAD /* minidump_file_writer.cc in Sources */,
- 16C7CE40147D4A4300776EAD /* convert_UTF.c in Sources */,
- 16C7CE79147D4A4300776EAD /* GTMLogger.m in Sources */,
- 16C7CE7B147D4A4300776EAD /* HTTPMultipartUpload.m in Sources */,
- 16C7CE83147D4A4300776EAD /* file_id.cc in Sources */,
- 16C7CE85147D4A4300776EAD /* macho_id.cc in Sources */,
- 16C7CE8A147D4A4300776EAD /* macho_utilities.cc in Sources */,
- 16C7CE8C147D4A4300776EAD /* macho_walker.cc in Sources */,
- 16C7CE8F147D4A4300776EAD /* string_utilities.cc in Sources */,
- 16C7CE93147D4A4300776EAD /* md5.cc in Sources */,
- 16C7CEA7147D4A4300776EAD /* string_conversion.cc in Sources */,
- 16BFA67214E1965A009704F8 /* ios_exception_minidump_generator.mm in Sources */,
- 16C92FAE150DF8330053D7BA /* BreakpadController.mm in Sources */,
- 1EEEB60F1720821900F7E689 /* simple_string_dictionary.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB921F08733DC00010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- DSTROOT = /tmp/Breakpad.dst;
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../mac/build/Debug\"",
- );
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Breakpad_Prefix.pch;
- INSTALL_PATH = /usr/local/lib;
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/Breakpad.build/Objects-normal/i386\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/Breakpad.build/Objects-normal/x86_64\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/breakpadUtilities.build/Objects-normal/i386\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/breakpadUtilities.build/Objects-normal/x86_64\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/gtest.build/Objects-normal/i386\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/gtest.build/Objects-normal/x86_64\"",
- "\"$(SRCROOT)/../mac/build/Debug\"",
- "\"$(SRCROOT)/../mac/gcov\"",
- );
- PRODUCT_NAME = Breakpad;
- };
- name = Debug;
- };
- 1DEB922008733DC00010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- DSTROOT = /tmp/Breakpad.dst;
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../mac/build/Debug\"",
- );
- GCC_MODEL_TUNING = G5;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Breakpad_Prefix.pch;
- INSTALL_PATH = /usr/local/lib;
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/Breakpad.build/Objects-normal/i386\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/Breakpad.build/Objects-normal/x86_64\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/breakpadUtilities.build/Objects-normal/i386\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/breakpadUtilities.build/Objects-normal/x86_64\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/gtest.build/Objects-normal/i386\"",
- "\"$(SRCROOT)/../mac/build/Breakpad.build/Debug/gtest.build/Objects-normal/x86_64\"",
- "\"$(SRCROOT)/../mac/build/Debug\"",
- "\"$(SRCROOT)/../mac/gcov\"",
- );
- PRODUCT_NAME = Breakpad;
- };
- name = Release;
- };
- 1DEB922308733DC00010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
- CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_SHADOW = YES;
- GCC_WARN_SIGN_COMPARE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNKNOWN_PRAGMAS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_LABEL = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- ../../,
- ../../client/apple/Framework,
- ../../common/mac,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- ONLY_ACTIVE_ARCH = YES;
- OTHER_LDFLAGS = "-ObjC";
- SDKROOT = iphoneos;
- WARNING_CFLAGS = "-Wundef";
- };
- name = Debug;
- };
- 1DEB922408733DC00010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
- CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES;
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_SHADOW = YES;
- GCC_WARN_SIGN_COMPARE = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNKNOWN_PRAGMAS = YES;
- GCC_WARN_UNUSED_FUNCTION = YES;
- GCC_WARN_UNUSED_LABEL = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- ../../,
- ../../client/apple/Framework,
- ../../common/mac,
- );
- IPHONEOS_DEPLOYMENT_TARGET = 5.0;
- OTHER_LDFLAGS = "-ObjC";
- SDKROOT = iphoneos;
- WARNING_CFLAGS = "-Wundef";
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB921F08733DC00010E9CD /* Debug */,
- 1DEB922008733DC00010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "Breakpad" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB922308733DC00010E9CD /* Debug */,
- 1DEB922408733DC00010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h b/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h
deleted file mode 100644
index 13609cb8dc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.h
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_IOS_HANDLER_IOS_BREAKPAD_CONTROLLER_H_
-#define CLIENT_IOS_HANDLER_IOS_BREAKPAD_CONTROLLER_H_
-
-#import <Foundation/Foundation.h>
-
-#import "client/ios/Breakpad.h"
-
-// This class is used to offer a higher level API around BreakpadRef. It
-// configures it, ensures thread-safety, and sends crash reports back to the
-// collecting server. By default, no crash reports are sent, the user must call
-// |setUploadingEnabled:YES| to start the uploading.
-@interface BreakpadController : NSObject {
- @private
- // The dispatch queue that will own the breakpad reference.
- dispatch_queue_t queue_;
-
- // Instance of Breakpad crash reporter. This is owned by the queue, but can
- // be created on the main thread at startup.
- BreakpadRef breakpadRef_;
-
- // The dictionary that contains configuration for breakpad. Modifying it
- // should only happen when the controller is not started. The initial value
- // is the infoDictionary of the bundle of the application.
- NSMutableDictionary* configuration_;
-
- // Whether or not crash reports should be uploaded.
- BOOL enableUploads_;
-
- // Whether the controller has been started on the main thread. This is only
- // used to assert the initialization order is correct.
- BOOL started_;
-
- // The interval to wait between two uploads. Value is 0 if no upload must be
- // done.
- int uploadIntervalInSeconds_;
-
- // The dictionary that contains additional server parameters to send when
- // uploading crash reports.
- NSDictionary* uploadTimeParameters_;
-}
-
-// Singleton.
-+ (BreakpadController*)sharedInstance;
-
-// Update the controller configuration. Merges its old configuration with the
-// new one. Merge is done by replacing the old values by the new values.
-- (void)updateConfiguration:(NSDictionary*)configuration;
-
-// Reset the controller configuration to its initial value, which is the
-// infoDictionary of the bundle of the application.
-- (void)resetConfiguration;
-
-// Configure the URL to upload the report to. This must be called at least once
-// if the URL is not in the bundle information.
-- (void)setUploadingURL:(NSString*)url;
-
-// Set the minimal interval between two uploads in seconds. This must be called
-// at least once if the interval is not in the bundle information. A value of 0
-// will prevent uploads.
-- (void)setUploadInterval:(int)intervalInSeconds;
-
-// Set additional server parameters to send when uploading crash reports.
-- (void)setParametersToAddAtUploadTime:(NSDictionary*)uploadTimeParameters;
-
-// Specify an upload parameter that will be added to the crash report when a
-// crash report is generated. See |BreakpadAddUploadParameter|.
-- (void)addUploadParameter:(NSString*)value forKey:(NSString*)key;
-
-// Remove a previously-added parameter from the upload parameter set. See
-// |BreakpadRemoveUploadParameter|.
-- (void)removeUploadParameterForKey:(NSString*)key;
-
-// Access the underlying BreakpadRef. This method is asynchronous, and will be
-// executed on the thread owning the BreakpadRef variable. Moreover, if the
-// controller is not started, the block will be called with a NULL parameter.
-- (void)withBreakpadRef:(void(^)(BreakpadRef))callback;
-
-// Starts the BreakpadController by registering crash handlers. If
-// |onCurrentThread| is YES, all setup is done on the current thread, otherwise
-// it is done on a private queue.
-- (void)start:(BOOL)onCurrentThread;
-
-// Unregisters the crash handlers.
-- (void)stop;
-
-// Enables or disables uploading of crash reports, but does not stop the
-// BreakpadController.
-- (void)setUploadingEnabled:(BOOL)enabled;
-
-// Check if there is currently a crash report to upload.
-- (void)hasReportToUpload:(void(^)(BOOL))callback;
-
-// Get the number of crash reports waiting to upload.
-- (void)getCrashReportCount:(void(^)(int))callback;
-
-// Get the next report to upload.
-// - If upload is disabled, callback will be called with (nil, -1).
-// - If a delay is to be waited before sending, callback will be called with
-// (nil, n), with n (> 0) being the number of seconds to wait.
-// - if no delay is needed, callback will be called with (0, configuration),
-// configuration being next report to upload, or nil if none is pending.
-- (void)getNextReportConfigurationOrSendDelay:
- (void(^)(NSDictionary*, int))callback;
-
-// Sends synchronously the report specified by |configuration|. This method is
-// NOT thread safe and must be called from the breakpad thread.
-- (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration
- withBreakpadRef:(BreakpadRef)ref;
-
-@end
-
-#endif // CLIENT_IOS_HANDLER_IOS_BREAKPAD_CONTROLLER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm b/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm
deleted file mode 100644
index dd71cff68a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/BreakpadController.mm
+++ /dev/null
@@ -1,354 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import "BreakpadController.h"
-
-#import <UIKit/UIKit.h>
-#include <asl.h>
-#include <execinfo.h>
-#include <signal.h>
-#include <unistd.h>
-#include <sys/sysctl.h>
-
-#include <common/scoped_ptr.h>
-
-#pragma mark -
-#pragma mark Private Methods
-
-@interface BreakpadController ()
-
-// Init the singleton instance.
-- (id)initSingleton;
-
-// Load a crash report and send it to the server.
-- (void)sendStoredCrashReports;
-
-// Returns when a report can be sent. |-1| means never, |0| means that a report
-// can be sent immediately, a positive number is the number of seconds to wait
-// before being allowed to upload a report.
-- (int)sendDelay;
-
-// Notifies that a report will be sent, and update the last sending time
-// accordingly.
-- (void)reportWillBeSent;
-
-@end
-
-#pragma mark -
-#pragma mark Anonymous namespace
-
-namespace {
-
-// The name of the user defaults key for the last submission to the crash
-// server.
-NSString* const kLastSubmission = @"com.google.Breakpad.LastSubmission";
-
-// Returns a NSString describing the current platform.
-NSString* GetPlatform() {
- // Name of the system call for getting the platform.
- static const char kHwMachineSysctlName[] = "hw.machine";
-
- NSString* result = nil;
-
- size_t size = 0;
- if (sysctlbyname(kHwMachineSysctlName, NULL, &size, NULL, 0) || size == 0)
- return nil;
- google_breakpad::scoped_array<char> machine(new char[size]);
- if (sysctlbyname(kHwMachineSysctlName, machine.get(), &size, NULL, 0) == 0)
- result = [NSString stringWithUTF8String:machine.get()];
- return result;
-}
-
-} // namespace
-
-#pragma mark -
-#pragma mark BreakpadController Implementation
-
-@implementation BreakpadController
-
-+ (BreakpadController*)sharedInstance {
- @synchronized(self) {
- static BreakpadController* sharedInstance_ =
- [[BreakpadController alloc] initSingleton];
- return sharedInstance_;
- }
-}
-
-- (id)init {
- return nil;
-}
-
-- (id)initSingleton {
- self = [super init];
- if (self) {
- queue_ = dispatch_queue_create("com.google.BreakpadQueue", NULL);
- enableUploads_ = NO;
- started_ = NO;
- [self resetConfiguration];
- }
- return self;
-}
-
-// Since this class is a singleton, this method is not expected to be called.
-- (void)dealloc {
- assert(!breakpadRef_);
- dispatch_release(queue_);
- [configuration_ release];
- [uploadTimeParameters_ release];
- [super dealloc];
-}
-
-#pragma mark -
-
-- (void)start:(BOOL)onCurrentThread {
- if (started_)
- return;
- started_ = YES;
- void(^startBlock)() = ^{
- assert(!breakpadRef_);
- breakpadRef_ = BreakpadCreate(configuration_);
- if (breakpadRef_) {
- BreakpadAddUploadParameter(breakpadRef_, @"platform", GetPlatform());
- }
- };
- if (onCurrentThread)
- startBlock();
- else
- dispatch_async(queue_, startBlock);
-}
-
-- (void)stop {
- if (!started_)
- return;
- started_ = NO;
- dispatch_sync(queue_, ^{
- if (breakpadRef_) {
- BreakpadRelease(breakpadRef_);
- breakpadRef_ = NULL;
- }
- });
-}
-
-// This method must be called from the breakpad queue.
-- (void)threadUnsafeSendReportWithConfiguration:(NSDictionary*)configuration
- withBreakpadRef:(BreakpadRef)ref {
- NSAssert(started_, @"The controller must be started before "
- "threadUnsafeSendReportWithConfiguration is called");
- if (breakpadRef_) {
- BreakpadUploadReportWithParametersAndConfiguration(breakpadRef_,
- uploadTimeParameters_,
- configuration);
- }
-}
-
-- (void)setUploadingEnabled:(BOOL)enabled {
- NSAssert(started_,
- @"The controller must be started before setUploadingEnabled is called");
- dispatch_async(queue_, ^{
- if (enabled == enableUploads_)
- return;
- if (enabled) {
- // Set this before calling doSendStoredCrashReport, because that
- // calls sendDelay, which in turn checks this flag.
- enableUploads_ = YES;
- [self sendStoredCrashReports];
- } else {
- enableUploads_ = NO;
- [NSObject cancelPreviousPerformRequestsWithTarget:self
- selector:@selector(sendStoredCrashReports)
- object:nil];
- }
- });
-}
-
-- (void)updateConfiguration:(NSDictionary*)configuration {
- NSAssert(!started_,
- @"The controller must not be started when updateConfiguration is called");
- [configuration_ addEntriesFromDictionary:configuration];
- NSString* uploadInterval =
- [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
- if (uploadInterval)
- [self setUploadInterval:[uploadInterval intValue]];
-}
-
-- (void)resetConfiguration {
- NSAssert(!started_,
- @"The controller must not be started when resetConfiguration is called");
- [configuration_ autorelease];
- configuration_ = [[[NSBundle mainBundle] infoDictionary] mutableCopy];
- NSString* uploadInterval =
- [configuration_ valueForKey:@BREAKPAD_REPORT_INTERVAL];
- [self setUploadInterval:[uploadInterval intValue]];
- [self setParametersToAddAtUploadTime:nil];
-}
-
-- (void)setUploadingURL:(NSString*)url {
- NSAssert(!started_,
- @"The controller must not be started when setUploadingURL is called");
- [configuration_ setValue:url forKey:@BREAKPAD_URL];
-}
-
-- (void)setUploadInterval:(int)intervalInSeconds {
- NSAssert(!started_,
- @"The controller must not be started when setUploadInterval is called");
- [configuration_ removeObjectForKey:@BREAKPAD_REPORT_INTERVAL];
- uploadIntervalInSeconds_ = intervalInSeconds;
- if (uploadIntervalInSeconds_ < 0)
- uploadIntervalInSeconds_ = 0;
-}
-
-- (void)setParametersToAddAtUploadTime:(NSDictionary*)uploadTimeParameters {
- NSAssert(!started_, @"The controller must not be started when "
- "setParametersToAddAtUploadTime is called");
- [uploadTimeParameters_ autorelease];
- uploadTimeParameters_ = [uploadTimeParameters copy];
-}
-
-- (void)addUploadParameter:(NSString*)value forKey:(NSString*)key {
- NSAssert(started_,
- @"The controller must be started before addUploadParameter is called");
- dispatch_async(queue_, ^{
- if (breakpadRef_)
- BreakpadAddUploadParameter(breakpadRef_, key, value);
- });
-}
-
-- (void)removeUploadParameterForKey:(NSString*)key {
- NSAssert(started_, @"The controller must be started before "
- "removeUploadParameterForKey is called");
- dispatch_async(queue_, ^{
- if (breakpadRef_)
- BreakpadRemoveUploadParameter(breakpadRef_, key);
- });
-}
-
-- (void)withBreakpadRef:(void(^)(BreakpadRef))callback {
- NSAssert(started_,
- @"The controller must be started before withBreakpadRef is called");
- dispatch_async(queue_, ^{
- callback(breakpadRef_);
- });
-}
-
-- (void)hasReportToUpload:(void(^)(BOOL))callback {
- NSAssert(started_, @"The controller must be started before "
- "hasReportToUpload is called");
- dispatch_async(queue_, ^{
- callback(breakpadRef_ && (BreakpadGetCrashReportCount(breakpadRef_) > 0));
- });
-}
-
-- (void)getCrashReportCount:(void(^)(int))callback {
- NSAssert(started_, @"The controller must be started before "
- "getCrashReportCount is called");
- dispatch_async(queue_, ^{
- callback(breakpadRef_ ? BreakpadGetCrashReportCount(breakpadRef_) : 0);
- });
-}
-
-- (void)getNextReportConfigurationOrSendDelay:
- (void(^)(NSDictionary*, int))callback {
- NSAssert(started_, @"The controller must be started before "
- "getNextReportConfigurationOrSendDelay is called");
- dispatch_async(queue_, ^{
- if (!breakpadRef_) {
- callback(nil, -1);
- return;
- }
- int delay = [self sendDelay];
- if (delay != 0) {
- callback(nil, delay);
- return;
- }
- [self reportWillBeSent];
- callback(BreakpadGetNextReportConfiguration(breakpadRef_), 0);
- });
-}
-
-#pragma mark -
-
-- (int)sendDelay {
- if (!breakpadRef_ || uploadIntervalInSeconds_ <= 0 || !enableUploads_)
- return -1;
-
- // To prevent overloading the crash server, crashes are not sent than one
- // report every |uploadIntervalInSeconds_|. A value in the user defaults is
- // used to keep the time of the last upload.
- NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
- NSNumber *lastTimeNum = [userDefaults objectForKey:kLastSubmission];
- NSTimeInterval lastTime = lastTimeNum ? [lastTimeNum floatValue] : 0;
- NSTimeInterval spanSeconds = CFAbsoluteTimeGetCurrent() - lastTime;
-
- if (spanSeconds >= uploadIntervalInSeconds_)
- return 0;
- return uploadIntervalInSeconds_ - static_cast<int>(spanSeconds);
-}
-
-- (void)reportWillBeSent {
- NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
- [userDefaults setObject:[NSNumber numberWithDouble:CFAbsoluteTimeGetCurrent()]
- forKey:kLastSubmission];
- [userDefaults synchronize];
-}
-
-- (void)sendStoredCrashReports {
- dispatch_async(queue_, ^{
- if (BreakpadGetCrashReportCount(breakpadRef_) == 0)
- return;
-
- int timeToWait = [self sendDelay];
-
- // Unable to ever send report.
- if (timeToWait == -1)
- return;
-
- // A report can be sent now.
- if (timeToWait == 0) {
- [self reportWillBeSent];
- BreakpadUploadNextReportWithParameters(breakpadRef_,
- uploadTimeParameters_);
-
- // If more reports must be sent, make sure this method is called again.
- if (BreakpadGetCrashReportCount(breakpadRef_) > 0)
- timeToWait = uploadIntervalInSeconds_;
- }
-
- // A report must be sent later.
- if (timeToWait > 0) {
- // performSelector: doesn't work on queue_
- dispatch_async(dispatch_get_main_queue(), ^{
- [self performSelector:@selector(sendStoredCrashReports)
- withObject:nil
- afterDelay:timeToWait];
- });
- }
- });
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad_Prefix.pch b/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad_Prefix.pch
deleted file mode 100644
index bfb739423d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/Breakpad_Prefix.pch
+++ /dev/null
@@ -1,7 +0,0 @@
-//
-// Prefix header for all source files of the 'CocoaTouchStaticLibrary' target in the 'CocoaTouchStaticLibrary' project.
-//
-
-#ifdef __OBJC__
- #import <Foundation/Foundation.h>
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.h b/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.h
deleted file mode 100644
index 21133e6329..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ios_exception_minidump_generator.h: Create a fake minidump from a
-// NSException.
-
-#ifndef CLIENT_IOS_HANDLER_IOS_EXCEPTION_MINIDUMP_GENERATOR_H_
-#define CLIENT_IOS_HANDLER_IOS_EXCEPTION_MINIDUMP_GENERATOR_H_
-
-#include <Foundation/Foundation.h>
-
-#include "client/mac/handler/minidump_generator.h"
-
-namespace google_breakpad {
-
-class IosExceptionMinidumpGenerator : public MinidumpGenerator {
- public:
- explicit IosExceptionMinidumpGenerator(NSException *exception);
- virtual ~IosExceptionMinidumpGenerator();
-
- protected:
- virtual bool WriteExceptionStream(MDRawDirectory *exception_stream);
- virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread);
-
- private:
-
- // Get the crashing program counter from the exception.
- uintptr_t GetPCFromException();
-
- // Get the crashing link register from the exception.
- uintptr_t GetLRFromException();
-
- // Write a virtual thread context for the crashing site.
- bool WriteCrashingContext(MDLocationDescriptor *register_location);
- // Per-CPU implementations of the above method.
-#ifdef HAS_ARM_SUPPORT
- bool WriteCrashingContextARM(MDLocationDescriptor *register_location);
-#endif
-#ifdef HAS_ARM64_SUPPORT
- bool WriteCrashingContextARM64(MDLocationDescriptor *register_location);
-#endif
-
- NSArray *return_addresses_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_IOS_HANDLER_IOS_EXCEPTION_MINIDUMP_GENERATOR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm b/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
deleted file mode 100644
index 82ea5bb5d3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/ios/handler/ios_exception_minidump_generator.mm
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/ios/handler/ios_exception_minidump_generator.h"
-
-#include <pthread.h>
-
-#include "google_breakpad/common/minidump_cpu_arm.h"
-#include "google_breakpad/common/minidump_cpu_arm64.h"
-#include "google_breakpad/common/minidump_exception_mac.h"
-#include "client/minidump_file_writer-inl.h"
-#include "common/scoped_ptr.h"
-
-#if defined(HAS_ARM_SUPPORT) && defined(HAS_ARM64_SUPPORT)
-#error "This file should be compiled for only one architecture at a time"
-#endif
-
-namespace {
-
-const int kExceptionType = EXC_SOFTWARE;
-const int kExceptionCode = MD_EXCEPTION_CODE_MAC_NS_EXCEPTION;
-
-#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT)
-const uintptr_t kExpectedFinalFp = sizeof(uintptr_t);
-const uintptr_t kExpectedFinalSp = 0;
-
-// Append the given value to the sp position of the stack represented
-// by memory.
-void AppendToMemory(uint8_t *memory, uintptr_t sp, uintptr_t data) {
- memcpy(memory + sp, &data, sizeof(data));
-}
-#endif
-
-} // namespace
-
-namespace google_breakpad {
-
-IosExceptionMinidumpGenerator::IosExceptionMinidumpGenerator(
- NSException *exception)
- : MinidumpGenerator(mach_task_self(), 0) {
- return_addresses_ = [[exception callStackReturnAddresses] retain];
- SetExceptionInformation(kExceptionType,
- kExceptionCode,
- 0,
- pthread_mach_thread_np(pthread_self()));
-}
-
-IosExceptionMinidumpGenerator::~IosExceptionMinidumpGenerator() {
- [return_addresses_ release];
-}
-
-bool IosExceptionMinidumpGenerator::WriteCrashingContext(
- MDLocationDescriptor *register_location) {
-#ifdef HAS_ARM_SUPPORT
- return WriteCrashingContextARM(register_location);
-#elif defined(HAS_ARM64_SUPPORT)
- return WriteCrashingContextARM64(register_location);
-#else
- assert(false);
- return false;
-#endif
-}
-
-#ifdef HAS_ARM_SUPPORT
-bool IosExceptionMinidumpGenerator::WriteCrashingContextARM(
- MDLocationDescriptor *register_location) {
- TypedMDRVA<MDRawContextARM> context(&writer_);
- if (!context.Allocate())
- return false;
- *register_location = context.location();
- MDRawContextARM *context_ptr = context.get();
- memset(context_ptr, 0, sizeof(MDRawContextARM));
- context_ptr->context_flags = MD_CONTEXT_ARM_FULL;
- context_ptr->iregs[MD_CONTEXT_ARM_REG_IOS_FP] = kExpectedFinalFp; // FP
- context_ptr->iregs[MD_CONTEXT_ARM_REG_SP] = kExpectedFinalSp; // SP
- context_ptr->iregs[MD_CONTEXT_ARM_REG_LR] = GetLRFromException(); // LR
- context_ptr->iregs[MD_CONTEXT_ARM_REG_PC] = GetPCFromException(); // PC
- return true;
-}
-#endif
-
-#ifdef HAS_ARM64_SUPPORT
-bool IosExceptionMinidumpGenerator::WriteCrashingContextARM64(
- MDLocationDescriptor *register_location) {
- TypedMDRVA<MDRawContextARM64> context(&writer_);
- if (!context.Allocate())
- return false;
- *register_location = context.location();
- MDRawContextARM64 *context_ptr = context.get();
- memset(context_ptr, 0, sizeof(*context_ptr));
- context_ptr->context_flags = MD_CONTEXT_ARM64_FULL;
- context_ptr->iregs[MD_CONTEXT_ARM64_REG_FP] = kExpectedFinalFp; // FP
- context_ptr->iregs[MD_CONTEXT_ARM64_REG_SP] = kExpectedFinalSp; // SP
- context_ptr->iregs[MD_CONTEXT_ARM64_REG_LR] = GetLRFromException(); // LR
- context_ptr->iregs[MD_CONTEXT_ARM64_REG_PC] = GetPCFromException(); // PC
- return true;
-}
-#endif
-
-uintptr_t IosExceptionMinidumpGenerator::GetPCFromException() {
- return [[return_addresses_ objectAtIndex:0] unsignedIntegerValue];
-}
-
-uintptr_t IosExceptionMinidumpGenerator::GetLRFromException() {
- return [[return_addresses_ objectAtIndex:1] unsignedIntegerValue];
-}
-
-bool IosExceptionMinidumpGenerator::WriteExceptionStream(
- MDRawDirectory *exception_stream) {
-#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT)
- TypedMDRVA<MDRawExceptionStream> exception(&writer_);
-
- if (!exception.Allocate())
- return false;
-
- exception_stream->stream_type = MD_EXCEPTION_STREAM;
- exception_stream->location = exception.location();
- MDRawExceptionStream *exception_ptr = exception.get();
- exception_ptr->thread_id = pthread_mach_thread_np(pthread_self());
-
- // This naming is confusing, but it is the proper translation from
- // mach naming to minidump naming.
- exception_ptr->exception_record.exception_code = kExceptionType;
- exception_ptr->exception_record.exception_flags = kExceptionCode;
-
- if (!WriteCrashingContext(&exception_ptr->thread_context))
- return false;
-
- exception_ptr->exception_record.exception_address = GetPCFromException();
- return true;
-#else
- return MinidumpGenerator::WriteExceptionStream(exception_stream);
-#endif
-}
-
-bool IosExceptionMinidumpGenerator::WriteThreadStream(mach_port_t thread_id,
- MDRawThread *thread) {
-#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT)
- if (pthread_mach_thread_np(pthread_self()) != thread_id)
- return MinidumpGenerator::WriteThreadStream(thread_id, thread);
-
- size_t frame_count = [return_addresses_ count];
- if (frame_count == 0)
- return false;
- UntypedMDRVA memory(&writer_);
- size_t pointer_size = sizeof(uintptr_t);
- size_t frame_record_size = 2 * pointer_size;
- size_t stack_size = frame_record_size * (frame_count - 1) + pointer_size;
- if (!memory.Allocate(stack_size))
- return false;
- scoped_array<uint8_t> stack_memory(new uint8_t[stack_size]);
- uintptr_t sp = stack_size - pointer_size;
- uintptr_t fp = 0;
- uintptr_t lr = 0;
- for (size_t current_frame = frame_count - 1;
- current_frame > 0;
- --current_frame) {
- AppendToMemory(stack_memory.get(), sp, lr);
- sp -= pointer_size;
- AppendToMemory(stack_memory.get(), sp, fp);
- fp = sp;
- sp -= pointer_size;
- lr = [[return_addresses_ objectAtIndex:current_frame] unsignedIntegerValue];
- }
- if (!memory.Copy(stack_memory.get(), stack_size))
- return false;
- assert(sp == kExpectedFinalSp);
- assert(fp == kExpectedFinalFp);
- assert(lr == GetLRFromException());
- thread->stack.start_of_memory_range = sp;
- thread->stack.memory = memory.location();
- memory_blocks_.push_back(thread->stack);
-
- if (!WriteCrashingContext(&thread->thread_context))
- return false;
-
- thread->thread_id = thread_id;
- return true;
-#else
- return MinidumpGenerator::WriteThreadStream(thread_id, thread);
-#endif
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
deleted file mode 100644
index d0a184a637..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/client_info.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_CRASH_GENERATION_CLIENT_INFO_H_
-#define CLIENT_LINUX_CRASH_GENERATION_CLIENT_INFO_H_
-
-namespace google_breakpad {
-
-class CrashGenerationServer;
-
-class ClientInfo {
- public:
- ClientInfo(pid_t pid, CrashGenerationServer* crash_server)
- : crash_server_(crash_server),
- pid_(pid) {}
-
- CrashGenerationServer* crash_server() const { return crash_server_; }
- pid_t pid() const { return pid_; }
-
- private:
- CrashGenerationServer* crash_server_;
- pid_t pid_;
-};
-
-}
-
-#endif // CLIENT_LINUX_CRASH_GENERATION_CLIENT_INFO_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
deleted file mode 100644
index d8bfbbad27..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.cc
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/linux/crash_generation/crash_generation_client.h"
-
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-
-#include <algorithm>
-
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/ignore_ret.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-namespace {
-
-class CrashGenerationClientImpl : public CrashGenerationClient {
- public:
- explicit CrashGenerationClientImpl(int server_fd) : server_fd_(server_fd) {}
- virtual ~CrashGenerationClientImpl() {}
-
- virtual bool RequestDump(const void* blob, size_t blob_size) {
- int fds[2];
- if (sys_pipe(fds) < 0)
- return false;
- static const unsigned kControlMsgSize = CMSG_SPACE(sizeof(int));
-
- struct kernel_iovec iov;
- iov.iov_base = const_cast<void*>(blob);
- iov.iov_len = blob_size;
-
- struct kernel_msghdr msg = { 0 };
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- char cmsg[kControlMsgSize] = "";
- msg.msg_control = cmsg;
- msg.msg_controllen = sizeof(cmsg);
-
- struct cmsghdr* hdr = CMSG_FIRSTHDR(&msg);
- hdr->cmsg_level = SOL_SOCKET;
- hdr->cmsg_type = SCM_RIGHTS;
- hdr->cmsg_len = CMSG_LEN(sizeof(int));
- int* p = reinterpret_cast<int*>(CMSG_DATA(hdr));
- *p = fds[1];
-
- ssize_t ret = HANDLE_EINTR(sys_sendmsg(server_fd_, &msg, 0));
- sys_close(fds[1]);
- if (ret < 0) {
- sys_close(fds[0]);
- return false;
- }
-
- // Wait for an ACK from the server.
- char b;
- IGNORE_RET(HANDLE_EINTR(sys_read(fds[0], &b, 1)));
- sys_close(fds[0]);
-
- return true;
- }
-
- private:
- int server_fd_;
-
- DISALLOW_COPY_AND_ASSIGN(CrashGenerationClientImpl);
-};
-
-} // namespace
-
-// static
-CrashGenerationClient* CrashGenerationClient::TryCreate(int server_fd) {
- if (server_fd < 0)
- return NULL;
- return new CrashGenerationClientImpl(server_fd);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.h b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.h
deleted file mode 100644
index 4e68424ae8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_client.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
-#define CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
-
-#include "common/basictypes.h"
-
-#include <stddef.h>
-
-namespace google_breakpad {
-
-// CrashGenerationClient is an interface for implementing out-of-process crash
-// dumping. The default implementation, accessed via the TryCreate() factory,
-// works in conjunction with the CrashGenerationServer to generate a minidump
-// via a remote process.
-class CrashGenerationClient {
- public:
- CrashGenerationClient() {}
- virtual ~CrashGenerationClient() {}
-
- // Request the crash server to generate a dump. |blob| is an opaque
- // CrashContext pointer from exception_handler.h.
- // Returns true if the dump was successful; false otherwise.
- virtual bool RequestDump(const void* blob, size_t blob_size) = 0;
-
- // Returns a new CrashGenerationClient if |server_fd| is valid and
- // connects to a CrashGenerationServer. Otherwise, return NULL.
- // The returned CrashGenerationClient* is owned by the caller of
- // this function.
- static CrashGenerationClient* TryCreate(int server_fd);
-
- private:
- DISALLOW_COPY_AND_ASSIGN(CrashGenerationClient);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
deleted file mode 100644
index 1d7d93b99c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.cc
+++ /dev/null
@@ -1,333 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <assert.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <poll.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <vector>
-
-#include "client/linux/crash_generation/crash_generation_server.h"
-#include "client/linux/crash_generation/client_info.h"
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/guid_creator.h"
-#include "common/linux/safe_readlink.h"
-
-static const char kCommandQuit = 'x';
-
-namespace google_breakpad {
-
-CrashGenerationServer::CrashGenerationServer(
- const int listen_fd,
- OnClientDumpRequestCallback dump_callback,
- void* dump_context,
- OnClientExitingCallback exit_callback,
- void* exit_context,
- bool generate_dumps,
- const string* dump_path) :
- server_fd_(listen_fd),
- dump_callback_(dump_callback),
- dump_context_(dump_context),
- exit_callback_(exit_callback),
- exit_context_(exit_context),
- generate_dumps_(generate_dumps),
- started_(false)
-{
- if (dump_path)
- dump_dir_ = *dump_path;
- else
- dump_dir_ = "/tmp";
-}
-
-CrashGenerationServer::~CrashGenerationServer()
-{
- if (started_)
- Stop();
-}
-
-bool
-CrashGenerationServer::Start()
-{
- if (started_ || 0 > server_fd_)
- return false;
-
- int control_pipe[2];
- if (pipe(control_pipe))
- return false;
-
- if (fcntl(control_pipe[0], F_SETFD, FD_CLOEXEC))
- return false;
- if (fcntl(control_pipe[1], F_SETFD, FD_CLOEXEC))
- return false;
-
- if (fcntl(control_pipe[0], F_SETFL, O_NONBLOCK))
- return false;
-
- control_pipe_in_ = control_pipe[0];
- control_pipe_out_ = control_pipe[1];
-
- if (pthread_create(&thread_, NULL,
- ThreadMain, reinterpret_cast<void*>(this)))
- return false;
-
- started_ = true;
- return true;
-}
-
-void
-CrashGenerationServer::Stop()
-{
- assert(pthread_self() != thread_);
-
- if (!started_)
- return;
-
- HANDLE_EINTR(write(control_pipe_out_, &kCommandQuit, 1));
-
- void* dummy;
- pthread_join(thread_, &dummy);
-
- close(control_pipe_in_);
- close(control_pipe_out_);
-
- started_ = false;
-}
-
-//static
-bool
-CrashGenerationServer::CreateReportChannel(int* server_fd, int* client_fd)
-{
- int fds[2];
-
- if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds))
- return false;
-
- static const int on = 1;
- // Enable passcred on the server end of the socket
- if (setsockopt(fds[1], SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)))
- return false;
-
- if (fcntl(fds[1], F_SETFL, O_NONBLOCK))
- return false;
- if (fcntl(fds[1], F_SETFD, FD_CLOEXEC))
- return false;
-
- *client_fd = fds[0];
- *server_fd = fds[1];
- return true;
-}
-
-// The following methods/functions execute on the server thread
-
-void
-CrashGenerationServer::Run()
-{
- struct pollfd pollfds[2];
- memset(&pollfds, 0, sizeof(pollfds));
-
- pollfds[0].fd = server_fd_;
- pollfds[0].events = POLLIN;
-
- pollfds[1].fd = control_pipe_in_;
- pollfds[1].events = POLLIN;
-
- while (true) {
- // infinite timeout
- int nevents = poll(pollfds, sizeof(pollfds)/sizeof(pollfds[0]), -1);
- if (-1 == nevents) {
- if (EINTR == errno) {
- continue;
- } else {
- return;
- }
- }
-
- if (pollfds[0].revents && !ClientEvent(pollfds[0].revents))
- return;
-
- if (pollfds[1].revents && !ControlEvent(pollfds[1].revents))
- return;
- }
-}
-
-bool
-CrashGenerationServer::ClientEvent(short revents)
-{
- if (POLLHUP & revents)
- return false;
- assert(POLLIN & revents);
-
- // A process has crashed and has signaled us by writing a datagram
- // to the death signal socket. The datagram contains the crash context needed
- // for writing the minidump as well as a file descriptor and a credentials
- // block so that they can't lie about their pid.
-
- // The length of the control message:
- static const unsigned kControlMsgSize =
- CMSG_SPACE(sizeof(int)) + CMSG_SPACE(sizeof(struct ucred));
- // The length of the regular payload:
- static const unsigned kCrashContextSize =
- sizeof(google_breakpad::ExceptionHandler::CrashContext);
-
- struct msghdr msg = {0};
- struct iovec iov[1];
- char crash_context[kCrashContextSize];
- char control[kControlMsgSize];
- const ssize_t expected_msg_size = sizeof(crash_context);
-
- iov[0].iov_base = crash_context;
- iov[0].iov_len = sizeof(crash_context);
- msg.msg_iov = iov;
- msg.msg_iovlen = sizeof(iov)/sizeof(iov[0]);
- msg.msg_control = control;
- msg.msg_controllen = kControlMsgSize;
-
- const ssize_t msg_size = HANDLE_EINTR(recvmsg(server_fd_, &msg, 0));
- if (msg_size != expected_msg_size)
- return true;
-
- if (msg.msg_controllen != kControlMsgSize ||
- msg.msg_flags & ~MSG_TRUNC)
- return true;
-
- // Walk the control payload and extract the file descriptor and validated pid.
- pid_t crashing_pid = -1;
- int signal_fd = -1;
- for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
- hdr = CMSG_NXTHDR(&msg, hdr)) {
- if (hdr->cmsg_level != SOL_SOCKET)
- continue;
- if (hdr->cmsg_type == SCM_RIGHTS) {
- const unsigned len = hdr->cmsg_len -
- (((uint8_t*)CMSG_DATA(hdr)) - (uint8_t*)hdr);
- assert(len % sizeof(int) == 0u);
- const unsigned num_fds = len / sizeof(int);
- if (num_fds > 1 || num_fds == 0) {
- // A nasty process could try and send us too many descriptors and
- // force a leak.
- for (unsigned i = 0; i < num_fds; ++i)
- close(reinterpret_cast<int*>(CMSG_DATA(hdr))[i]);
- return true;
- } else {
- signal_fd = reinterpret_cast<int*>(CMSG_DATA(hdr))[0];
- }
- } else if (hdr->cmsg_type == SCM_CREDENTIALS) {
- const struct ucred *cred =
- reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
- crashing_pid = cred->pid;
- }
- }
-
- if (crashing_pid == -1 || signal_fd == -1) {
- if (signal_fd)
- close(signal_fd);
- return true;
- }
-
- string minidump_filename;
- if (!MakeMinidumpFilename(minidump_filename))
- return true;
-
- if (!google_breakpad::WriteMinidump(minidump_filename.c_str(),
- crashing_pid, crash_context,
- kCrashContextSize)) {
- close(signal_fd);
- return true;
- }
-
- if (dump_callback_) {
- ClientInfo info(crashing_pid, this);
-
- dump_callback_(dump_context_, &info, &minidump_filename);
- }
-
- // Send the done signal to the process: it can exit now.
- // (Closing this will make the child's sys_read unblock and return 0.)
- close(signal_fd);
-
- return true;
-}
-
-bool
-CrashGenerationServer::ControlEvent(short revents)
-{
- if (POLLHUP & revents)
- return false;
- assert(POLLIN & revents);
-
- char command;
- if (read(control_pipe_in_, &command, 1))
- return false;
-
- switch (command) {
- case kCommandQuit:
- return false;
- default:
- assert(0);
- }
-
- return true;
-}
-
-bool
-CrashGenerationServer::MakeMinidumpFilename(string& outFilename)
-{
- GUID guid;
- char guidString[kGUIDStringLength+1];
-
- if (!(CreateGUID(&guid)
- && GUIDToString(&guid, guidString, sizeof(guidString))))
- return false;
-
- char path[PATH_MAX];
- snprintf(path, sizeof(path), "%s/%s.dmp", dump_dir_.c_str(), guidString);
-
- outFilename = path;
- return true;
-}
-
-// static
-void*
-CrashGenerationServer::ThreadMain(void *arg)
-{
- reinterpret_cast<CrashGenerationServer*>(arg)->Run();
- return NULL;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.h b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.h
deleted file mode 100644
index 483fb709bf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/crash_generation_server.h
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_
-#define CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_
-
-#include <pthread.h>
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-class ClientInfo;
-
-class CrashGenerationServer {
-public:
- // WARNING: callbacks may be invoked on a different thread
- // than that which creates the CrashGenerationServer. They must
- // be thread safe.
- typedef void (*OnClientDumpRequestCallback)(void* context,
- const ClientInfo* client_info,
- const string* file_path);
-
- typedef void (*OnClientExitingCallback)(void* context,
- const ClientInfo* client_info);
-
- // Create an instance with the given parameters.
- //
- // Parameter listen_fd: The server fd created by CreateReportChannel().
- // Parameter dump_callback: Callback for a client crash dump request.
- // Parameter dump_context: Context for client crash dump request callback.
- // Parameter exit_callback: Callback for client process exit.
- // Parameter exit_context: Context for client exit callback.
- // Parameter generate_dumps: Whether to automatically generate dumps.
- // Client code of this class might want to generate dumps explicitly
- // in the crash dump request callback. In that case, false can be
- // passed for this parameter.
- // Parameter dump_path: Path for generating dumps; required only if true is
- // passed for generateDumps parameter; NULL can be passed otherwise.
- CrashGenerationServer(const int listen_fd,
- OnClientDumpRequestCallback dump_callback,
- void* dump_context,
- OnClientExitingCallback exit_callback,
- void* exit_context,
- bool generate_dumps,
- const string* dump_path);
-
- ~CrashGenerationServer();
-
- // Perform initialization steps needed to start listening to clients.
- //
- // Return true if initialization is successful; false otherwise.
- bool Start();
-
- // Stop the server.
- void Stop();
-
- // Create a "channel" that can be used by clients to report crashes
- // to a CrashGenerationServer. |*server_fd| should be passed to
- // this class's constructor, and |*client_fd| should be passed to
- // the ExceptionHandler constructor in the client process.
- static bool CreateReportChannel(int* server_fd, int* client_fd);
-
-private:
- // Run the server's event loop
- void Run();
-
- // Invoked when an child process (client) event occurs
- // Returning true => "keep running", false => "exit loop"
- bool ClientEvent(short revents);
-
- // Invoked when the controlling thread (main) event occurs
- // Returning true => "keep running", false => "exit loop"
- bool ControlEvent(short revents);
-
- // Return a unique filename at which a minidump can be written
- bool MakeMinidumpFilename(string& outFilename);
-
- // Trampoline to |Run()|
- static void* ThreadMain(void* arg);
-
- int server_fd_;
-
- OnClientDumpRequestCallback dump_callback_;
- void* dump_context_;
-
- OnClientExitingCallback exit_callback_;
- void* exit_context_;
-
- bool generate_dumps_;
-
- string dump_dir_;
-
- bool started_;
-
- pthread_t thread_;
- int control_pipe_in_;
- int control_pipe_out_;
-
- // disable these
- CrashGenerationServer(const CrashGenerationServer&);
- CrashGenerationServer& operator=(const CrashGenerationServer&);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-amd.sym b/toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-amd.sym
deleted file mode 100644
index e042a5ec42..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-amd.sym
+++ /dev/null
@@ -1,3 +0,0 @@
-MODULE Linux x86 B8CFDE93002D54DA1900A40AA1BD67690 linux-gate.so
-PUBLIC 400 0 __kernel_vsyscall
-STACK WIN 4 400 100 1 1 0 0 0 0 0 1
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-intel.sym b/toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-intel.sym
deleted file mode 100644
index c209c23756..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/data/linux-gate-intel.sym
+++ /dev/null
@@ -1,3 +0,0 @@
-MODULE Linux x86 4FBDA58B5A1DF5A379E3CF19A235EA090 linux-gate.so
-PUBLIC 400 0 __kernel_vsyscall
-STACK WIN 4 400 200 3 3 0 0 0 0 0 1 \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/mapping_info.h b/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/mapping_info.h
deleted file mode 100644
index 5f247cfd4e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/mapping_info.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_DUMP_WRITER_COMMON_MAPPING_INFO_H_
-#define CLIENT_LINUX_DUMP_WRITER_COMMON_MAPPING_INFO_H_
-
-#include <limits.h>
-#include <list>
-#include <stdint.h>
-
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// One of these is produced for each mapping in the process (i.e. line in
-// /proc/$x/maps).
-struct MappingInfo {
- uintptr_t start_addr;
- size_t size;
- size_t offset; // offset into the backed file.
- bool exec; // true if the mapping has the execute bit set.
- char name[NAME_MAX];
-};
-
-struct MappingEntry {
- MappingInfo first;
- uint8_t second[sizeof(MDGUID)];
-};
-
-// A list of <MappingInfo, GUID>
-typedef std::list<MappingEntry> MappingList;
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_DUMP_WRITER_COMMON_MAPPING_INFO_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h b/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
deleted file mode 100644
index e2ef45df5d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/raw_context_cpu.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_DUMP_WRITER_COMMON_RAW_CONTEXT_CPU_H
-#define CLIENT_LINUX_DUMP_WRITER_COMMON_RAW_CONTEXT_CPU_H
-
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-#if defined(__i386__)
-typedef MDRawContextX86 RawContextCPU;
-#elif defined(__x86_64)
-typedef MDRawContextAMD64 RawContextCPU;
-#elif defined(__ARM_EABI__)
-typedef MDRawContextARM RawContextCPU;
-#elif defined(__aarch64__)
-typedef MDRawContextARM64 RawContextCPU;
-#elif defined(__mips__)
-typedef MDRawContextMIPS RawContextCPU;
-#else
-#error "This code has not been ported to your platform yet."
-#endif
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_DUMP_WRITER_COMMON_RAW_CONTEXT_CPU_H
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.cc
deleted file mode 100644
index 0a1041d62d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.cc
+++ /dev/null
@@ -1,305 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/linux/dump_writer_common/thread_info.h"
-
-#include <string.h>
-#include <assert.h>
-
-#include "common/linux/linux_libc_support.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace {
-
-#if defined(__i386__)
-// Write a uint16_t to memory
-// out: memory location to write to
-// v: value to write.
-void U16(void* out, uint16_t v) {
- my_memcpy(out, &v, sizeof(v));
-}
-
-// Write a uint32_t to memory
-// out: memory location to write to
-// v: value to write.
-void U32(void* out, uint32_t v) {
- my_memcpy(out, &v, sizeof(v));
-}
-#endif
-
-}
-
-namespace google_breakpad {
-
-#if defined(__i386__)
-
-uintptr_t ThreadInfo::GetInstructionPointer() const {
- return regs.eip;
-}
-
-void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- out->context_flags = MD_CONTEXT_X86_ALL;
-
- out->dr0 = dregs[0];
- out->dr1 = dregs[1];
- out->dr2 = dregs[2];
- out->dr3 = dregs[3];
- // 4 and 5 deliberatly omitted because they aren't included in the minidump
- // format.
- out->dr6 = dregs[6];
- out->dr7 = dregs[7];
-
- out->gs = regs.xgs;
- out->fs = regs.xfs;
- out->es = regs.xes;
- out->ds = regs.xds;
-
- out->edi = regs.edi;
- out->esi = regs.esi;
- out->ebx = regs.ebx;
- out->edx = regs.edx;
- out->ecx = regs.ecx;
- out->eax = regs.eax;
-
- out->ebp = regs.ebp;
- out->eip = regs.eip;
- out->cs = regs.xcs;
- out->eflags = regs.eflags;
- out->esp = regs.esp;
- out->ss = regs.xss;
-
- out->float_save.control_word = fpregs.cwd;
- out->float_save.status_word = fpregs.swd;
- out->float_save.tag_word = fpregs.twd;
- out->float_save.error_offset = fpregs.fip;
- out->float_save.error_selector = fpregs.fcs;
- out->float_save.data_offset = fpregs.foo;
- out->float_save.data_selector = fpregs.fos;
-
- // 8 registers * 10 bytes per register.
- my_memcpy(out->float_save.register_area, fpregs.st_space, 10 * 8);
-
- // This matches the Intel fpsave format.
- U16(out->extended_registers + 0, fpregs.cwd);
- U16(out->extended_registers + 2, fpregs.swd);
- U16(out->extended_registers + 4, fpregs.twd);
- U16(out->extended_registers + 6, fpxregs.fop);
- U32(out->extended_registers + 8, fpxregs.fip);
- U16(out->extended_registers + 12, fpxregs.fcs);
- U32(out->extended_registers + 16, fpregs.foo);
- U16(out->extended_registers + 20, fpregs.fos);
- U32(out->extended_registers + 24, fpxregs.mxcsr);
-
- my_memcpy(out->extended_registers + 32, &fpxregs.st_space, 128);
- my_memcpy(out->extended_registers + 160, &fpxregs.xmm_space, 128);
-}
-
-#elif defined(__x86_64)
-
-uintptr_t ThreadInfo::GetInstructionPointer() const {
- return regs.rip;
-}
-
-void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- out->context_flags = MD_CONTEXT_AMD64_FULL |
- MD_CONTEXT_AMD64_SEGMENTS;
-
- out->cs = regs.cs;
-
- out->ds = regs.ds;
- out->es = regs.es;
- out->fs = regs.fs;
- out->gs = regs.gs;
-
- out->ss = regs.ss;
- out->eflags = regs.eflags;
-
- out->dr0 = dregs[0];
- out->dr1 = dregs[1];
- out->dr2 = dregs[2];
- out->dr3 = dregs[3];
- // 4 and 5 deliberatly omitted because they aren't included in the minidump
- // format.
- out->dr6 = dregs[6];
- out->dr7 = dregs[7];
-
- out->rax = regs.rax;
- out->rcx = regs.rcx;
- out->rdx = regs.rdx;
- out->rbx = regs.rbx;
-
- out->rsp = regs.rsp;
-
- out->rbp = regs.rbp;
- out->rsi = regs.rsi;
- out->rdi = regs.rdi;
- out->r8 = regs.r8;
- out->r9 = regs.r9;
- out->r10 = regs.r10;
- out->r11 = regs.r11;
- out->r12 = regs.r12;
- out->r13 = regs.r13;
- out->r14 = regs.r14;
- out->r15 = regs.r15;
-
- out->rip = regs.rip;
-
- out->flt_save.control_word = fpregs.cwd;
- out->flt_save.status_word = fpregs.swd;
- out->flt_save.tag_word = fpregs.ftw;
- out->flt_save.error_opcode = fpregs.fop;
- out->flt_save.error_offset = fpregs.rip;
- out->flt_save.error_selector = 0; // We don't have this.
- out->flt_save.data_offset = fpregs.rdp;
- out->flt_save.data_selector = 0; // We don't have this.
- out->flt_save.mx_csr = fpregs.mxcsr;
- out->flt_save.mx_csr_mask = fpregs.mxcr_mask;
-
- my_memcpy(&out->flt_save.float_registers, &fpregs.st_space, 8 * 16);
- my_memcpy(&out->flt_save.xmm_registers, &fpregs.xmm_space, 16 * 16);
-}
-
-#elif defined(__ARM_EABI__)
-
-uintptr_t ThreadInfo::GetInstructionPointer() const {
- return regs.uregs[15];
-}
-
-void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- out->context_flags = MD_CONTEXT_ARM_FULL;
-
- for (int i = 0; i < MD_CONTEXT_ARM_GPR_COUNT; ++i)
- out->iregs[i] = regs.uregs[i];
- // No CPSR register in ThreadInfo(it's not accessible via ptrace)
- out->cpsr = 0;
-#if !defined(__ANDROID__)
- out->float_save.fpscr = fpregs.fpsr |
- (static_cast<uint64_t>(fpregs.fpcr) << 32);
- // TODO: sort this out, actually collect floating point registers
- my_memset(&out->float_save.regs, 0, sizeof(out->float_save.regs));
- my_memset(&out->float_save.extra, 0, sizeof(out->float_save.extra));
-#endif
-}
-
-#elif defined(__aarch64__)
-
-uintptr_t ThreadInfo::GetInstructionPointer() const {
- return regs.pc;
-}
-
-void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
- out->context_flags = MD_CONTEXT_ARM64_FULL;
-
- out->cpsr = static_cast<uint32_t>(regs.pstate);
- for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
- out->iregs[i] = regs.regs[i];
- out->iregs[MD_CONTEXT_ARM64_REG_SP] = regs.sp;
- out->iregs[MD_CONTEXT_ARM64_REG_PC] = regs.pc;
-
- out->float_save.fpsr = fpregs.fpsr;
- out->float_save.fpcr = fpregs.fpcr;
- my_memcpy(&out->float_save.regs, &fpregs.vregs,
- MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT * 16);
-}
-
-#elif defined(__mips__)
-
-uintptr_t ThreadInfo::GetInstructionPointer() const {
- return mcontext.pc;
-}
-
-void ThreadInfo::FillCPUContext(RawContextCPU* out) const {
-#if _MIPS_SIM == _ABI64
- out->context_flags = MD_CONTEXT_MIPS64_FULL;
-#elif _MIPS_SIM == _ABIO32
- out->context_flags = MD_CONTEXT_MIPS_FULL;
-#else
-# error "This mips ABI is currently not supported (n32)"
-#endif
-
- for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
- out->iregs[i] = mcontext.gregs[i];
-
- out->mdhi = mcontext.mdhi;
- out->mdlo = mcontext.mdlo;
- out->dsp_control = mcontext.dsp;
-
- out->hi[0] = mcontext.hi1;
- out->lo[0] = mcontext.lo1;
- out->hi[1] = mcontext.hi2;
- out->lo[1] = mcontext.lo2;
- out->hi[2] = mcontext.hi3;
- out->lo[2] = mcontext.lo3;
-
- out->epc = mcontext.pc;
- out->badvaddr = 0; // Not stored in mcontext
- out->status = 0; // Not stored in mcontext
- out->cause = 0; // Not stored in mcontext
-
- for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
- out->float_save.regs[i] = mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs;
-
- out->float_save.fpcsr = mcontext.fpc_csr;
-#if _MIPS_SIM == _ABIO32
- out->float_save.fir = mcontext.fpc_eir;
-#endif
-}
-#endif // __mips__
-
-void ThreadInfo::GetGeneralPurposeRegisters(void** gp_regs, size_t* size) {
- assert(gp_regs || size);
-#if defined(__mips__)
- if (gp_regs)
- *gp_regs = mcontext.gregs;
- if (size)
- *size = sizeof(mcontext.gregs);
-#else
- if (gp_regs)
- *gp_regs = &regs;
- if (size)
- *size = sizeof(regs);
-#endif
-}
-
-void ThreadInfo::GetFloatingPointRegisters(void** fp_regs, size_t* size) {
- assert(fp_regs || size);
-#if defined(__mips__)
- if (fp_regs)
- *fp_regs = &mcontext.fpregs;
- if (size)
- *size = sizeof(mcontext.fpregs);
-#else
- if (fp_regs)
- *fp_regs = &fpregs;
- if (size)
- *size = sizeof(fpregs);
-#endif
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.h b/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.h
deleted file mode 100644
index 99093d2e0b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/thread_info.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_DUMP_WRITER_COMMON_THREAD_INFO_H_
-#define CLIENT_LINUX_DUMP_WRITER_COMMON_THREAD_INFO_H_
-
-#include <sys/ucontext.h>
-#include <sys/user.h>
-
-#include "client/linux/dump_writer_common/raw_context_cpu.h"
-#include "common/memory.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-#if defined(__i386) || defined(__x86_64)
-typedef __typeof__(((struct user*) 0)->u_debugreg[0]) debugreg_t;
-#endif
-
-// We produce one of these structures for each thread in the crashed process.
-struct ThreadInfo {
- pid_t tgid; // thread group id
- pid_t ppid; // parent process
-
- uintptr_t stack_pointer; // thread stack pointer
-
-
-#if defined(__i386) || defined(__x86_64)
- user_regs_struct regs;
- user_fpregs_struct fpregs;
- static const unsigned kNumDebugRegisters = 8;
- debugreg_t dregs[8];
-#if defined(__i386)
- user_fpxregs_struct fpxregs;
-#endif // defined(__i386)
-
-#elif defined(__ARM_EABI__)
- // Mimicking how strace does this(see syscall.c, search for GETREGS)
- struct user_regs regs;
- struct user_fpregs fpregs;
-#elif defined(__aarch64__)
- // Use the structures defined in <sys/user.h>
- struct user_regs_struct regs;
- struct user_fpsimd_struct fpregs;
-#elif defined(__mips__)
- // Use the structure defined in <sys/ucontext.h>.
- mcontext_t mcontext;
-#endif
-
- // Returns the instruction pointer (platform-dependent impl.).
- uintptr_t GetInstructionPointer() const;
-
- // Fills a RawContextCPU using the context in the ThreadInfo object.
- void FillCPUContext(RawContextCPU* out) const;
-
- // Returns the pointer and size of general purpose register area.
- void GetGeneralPurposeRegisters(void** gp_regs, size_t* size);
-
- // Returns the pointer and size of float point register area.
- void GetFloatingPointRegisters(void** fp_regs, size_t* size);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_DUMP_WRITER_COMMON_THREAD_INFO_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
deleted file mode 100644
index 93b4d9f853..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/linux/dump_writer_common/ucontext_reader.h"
-
-#include "common/linux/linux_libc_support.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// Minidump defines register structures which are different from the raw
-// structures which we get from the kernel. These are platform specific
-// functions to juggle the ucontext and user structures into minidump format.
-
-#if defined(__i386__)
-
-uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.gregs[REG_ESP];
-}
-
-uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.gregs[REG_EIP];
-}
-
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
- const struct _libc_fpstate* fp) {
- const greg_t* regs = uc->uc_mcontext.gregs;
-
- out->context_flags = MD_CONTEXT_X86_FULL |
- MD_CONTEXT_X86_FLOATING_POINT;
-
- out->gs = regs[REG_GS];
- out->fs = regs[REG_FS];
- out->es = regs[REG_ES];
- out->ds = regs[REG_DS];
-
- out->edi = regs[REG_EDI];
- out->esi = regs[REG_ESI];
- out->ebx = regs[REG_EBX];
- out->edx = regs[REG_EDX];
- out->ecx = regs[REG_ECX];
- out->eax = regs[REG_EAX];
-
- out->ebp = regs[REG_EBP];
- out->eip = regs[REG_EIP];
- out->cs = regs[REG_CS];
- out->eflags = regs[REG_EFL];
- out->esp = regs[REG_UESP];
- out->ss = regs[REG_SS];
-
- out->float_save.control_word = fp->cw;
- out->float_save.status_word = fp->sw;
- out->float_save.tag_word = fp->tag;
- out->float_save.error_offset = fp->ipoff;
- out->float_save.error_selector = fp->cssel;
- out->float_save.data_offset = fp->dataoff;
- out->float_save.data_selector = fp->datasel;
-
- // 8 registers * 10 bytes per register.
- my_memcpy(out->float_save.register_area, fp->_st, 10 * 8);
-}
-
-#elif defined(__x86_64)
-
-uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.gregs[REG_RSP];
-}
-
-uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.gregs[REG_RIP];
-}
-
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
- const struct _libc_fpstate* fpregs) {
- const greg_t* regs = uc->uc_mcontext.gregs;
-
- out->context_flags = MD_CONTEXT_AMD64_FULL;
-
- out->cs = regs[REG_CSGSFS] & 0xffff;
-
- out->fs = (regs[REG_CSGSFS] >> 32) & 0xffff;
- out->gs = (regs[REG_CSGSFS] >> 16) & 0xffff;
-
- out->eflags = regs[REG_EFL];
-
- out->rax = regs[REG_RAX];
- out->rcx = regs[REG_RCX];
- out->rdx = regs[REG_RDX];
- out->rbx = regs[REG_RBX];
-
- out->rsp = regs[REG_RSP];
- out->rbp = regs[REG_RBP];
- out->rsi = regs[REG_RSI];
- out->rdi = regs[REG_RDI];
- out->r8 = regs[REG_R8];
- out->r9 = regs[REG_R9];
- out->r10 = regs[REG_R10];
- out->r11 = regs[REG_R11];
- out->r12 = regs[REG_R12];
- out->r13 = regs[REG_R13];
- out->r14 = regs[REG_R14];
- out->r15 = regs[REG_R15];
-
- out->rip = regs[REG_RIP];
-
- out->flt_save.control_word = fpregs->cwd;
- out->flt_save.status_word = fpregs->swd;
- out->flt_save.tag_word = fpregs->ftw;
- out->flt_save.error_opcode = fpregs->fop;
- out->flt_save.error_offset = fpregs->rip;
- out->flt_save.data_offset = fpregs->rdp;
- out->flt_save.error_selector = 0; // We don't have this.
- out->flt_save.data_selector = 0; // We don't have this.
- out->flt_save.mx_csr = fpregs->mxcsr;
- out->flt_save.mx_csr_mask = fpregs->mxcr_mask;
- my_memcpy(&out->flt_save.float_registers, &fpregs->_st, 8 * 16);
- my_memcpy(&out->flt_save.xmm_registers, &fpregs->_xmm, 16 * 16);
-}
-
-#elif defined(__ARM_EABI__)
-
-uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.arm_sp;
-}
-
-uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.arm_pc;
-}
-
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
- out->context_flags = MD_CONTEXT_ARM_FULL;
-
- out->iregs[0] = uc->uc_mcontext.arm_r0;
- out->iregs[1] = uc->uc_mcontext.arm_r1;
- out->iregs[2] = uc->uc_mcontext.arm_r2;
- out->iregs[3] = uc->uc_mcontext.arm_r3;
- out->iregs[4] = uc->uc_mcontext.arm_r4;
- out->iregs[5] = uc->uc_mcontext.arm_r5;
- out->iregs[6] = uc->uc_mcontext.arm_r6;
- out->iregs[7] = uc->uc_mcontext.arm_r7;
- out->iregs[8] = uc->uc_mcontext.arm_r8;
- out->iregs[9] = uc->uc_mcontext.arm_r9;
- out->iregs[10] = uc->uc_mcontext.arm_r10;
-
- out->iregs[11] = uc->uc_mcontext.arm_fp;
- out->iregs[12] = uc->uc_mcontext.arm_ip;
- out->iregs[13] = uc->uc_mcontext.arm_sp;
- out->iregs[14] = uc->uc_mcontext.arm_lr;
- out->iregs[15] = uc->uc_mcontext.arm_pc;
-
- out->cpsr = uc->uc_mcontext.arm_cpsr;
-
- // TODO: fix this after fixing ExceptionHandler
- out->float_save.fpscr = 0;
- my_memset(&out->float_save.regs, 0, sizeof(out->float_save.regs));
- my_memset(&out->float_save.extra, 0, sizeof(out->float_save.extra));
-}
-
-#elif defined(__aarch64__)
-
-uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.sp;
-}
-
-uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.pc;
-}
-
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
- const struct fpsimd_context* fpregs) {
- out->context_flags = MD_CONTEXT_ARM64_FULL;
-
- out->cpsr = static_cast<uint32_t>(uc->uc_mcontext.pstate);
- for (int i = 0; i < MD_CONTEXT_ARM64_REG_SP; ++i)
- out->iregs[i] = uc->uc_mcontext.regs[i];
- out->iregs[MD_CONTEXT_ARM64_REG_SP] = uc->uc_mcontext.sp;
- out->iregs[MD_CONTEXT_ARM64_REG_PC] = uc->uc_mcontext.pc;
-
- out->float_save.fpsr = fpregs->fpsr;
- out->float_save.fpcr = fpregs->fpcr;
- my_memcpy(&out->float_save.regs, &fpregs->vregs,
- MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT * 16);
-}
-
-#elif defined(__mips__)
-
-uintptr_t UContextReader::GetStackPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP];
-}
-
-uintptr_t UContextReader::GetInstructionPointer(const ucontext_t* uc) {
- return uc->uc_mcontext.pc;
-}
-
-void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext_t *uc) {
-#if _MIPS_SIM == _ABI64
- out->context_flags = MD_CONTEXT_MIPS64_FULL;
-#elif _MIPS_SIM == _ABIO32
- out->context_flags = MD_CONTEXT_MIPS_FULL;
-#else
-#error "This mips ABI is currently not supported (n32)"
-#endif
-
- for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
- out->iregs[i] = uc->uc_mcontext.gregs[i];
-
- out->mdhi = uc->uc_mcontext.mdhi;
- out->mdlo = uc->uc_mcontext.mdlo;
-
- out->hi[0] = uc->uc_mcontext.hi1;
- out->hi[1] = uc->uc_mcontext.hi2;
- out->hi[2] = uc->uc_mcontext.hi3;
- out->lo[0] = uc->uc_mcontext.lo1;
- out->lo[1] = uc->uc_mcontext.lo2;
- out->lo[2] = uc->uc_mcontext.lo3;
- out->dsp_control = uc->uc_mcontext.dsp;
-
- out->epc = uc->uc_mcontext.pc;
- out->badvaddr = 0; // Not reported in signal context.
- out->status = 0; // Not reported in signal context.
- out->cause = 0; // Not reported in signal context.
-
- for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
- out->float_save.regs[i] = uc->uc_mcontext.fpregs.fp_r.fp_dregs[i];
-
- out->float_save.fpcsr = uc->uc_mcontext.fpc_csr;
-#if _MIPS_SIM == _ABIO32
- out->float_save.fir = uc->uc_mcontext.fpc_eir; // Unused.
-#endif
-}
-#endif
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h b/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
deleted file mode 100644
index 2369a9ad33..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_DUMP_WRITER_COMMON_UCONTEXT_READER_H
-#define CLIENT_LINUX_DUMP_WRITER_COMMON_UCONTEXT_READER_H
-
-#include <sys/ucontext.h>
-#include <sys/user.h>
-
-#include "client/linux/dump_writer_common/raw_context_cpu.h"
-#include "common/memory.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// Wraps platform-dependent implementations of accessors to ucontext structs.
-struct UContextReader {
- static uintptr_t GetStackPointer(const ucontext_t* uc);
-
- static uintptr_t GetInstructionPointer(const ucontext_t* uc);
-
- // Juggle a arch-specific ucontext into a minidump format
- // out: the minidump structure
- // info: the collection of register structures.
-#if defined(__i386__) || defined(__x86_64)
- static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
- const struct _libc_fpstate* fp);
-#elif defined(__aarch64__)
- static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc,
- const struct fpsimd_context* fpregs);
-#else
- static void FillCPUContext(RawContextCPU *out, const ucontext_t *uc);
-#endif
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_DUMP_WRITER_COMMON_UCONTEXT_READER_H
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
deleted file mode 100644
index 288e0bb694..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc
+++ /dev/null
@@ -1,789 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The ExceptionHandler object installs signal handlers for a number of
-// signals. We rely on the signal handler running on the thread which crashed
-// in order to identify it. This is true of the synchronous signals (SEGV etc),
-// but not true of ABRT. Thus, if you send ABRT to yourself in a program which
-// uses ExceptionHandler, you need to use tgkill to direct it to the current
-// thread.
-//
-// The signal flow looks like this:
-//
-// SignalHandler (uses a global stack of ExceptionHandler objects to find
-// | one to handle the signal. If the first rejects it, try
-// | the second etc...)
-// V
-// HandleSignal ----------------------------| (clones a new process which
-// | | shares an address space with
-// (wait for cloned | the crashed process. This
-// process) | allows us to ptrace the crashed
-// | | process)
-// V V
-// (set signal handler to ThreadEntry (static function to bounce
-// SIG_DFL and rethrow, | back into the object)
-// killing the crashed |
-// process) V
-// DoDump (writes minidump)
-// |
-// V
-// sys_exit
-//
-
-// This code is a little fragmented. Different functions of the ExceptionHandler
-// class run in a number of different contexts. Some of them run in a normal
-// context and are easy to code, others run in a compromised context and the
-// restrictions at the top of minidump_writer.cc apply: no libc and use the
-// alternative malloc. Each function should have comment above it detailing the
-// context which it runs in.
-
-#include "client/linux/handler/exception_handler.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <linux/limits.h>
-#include <pthread.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-#include <sys/syscall.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <sys/signal.h>
-#include <sys/ucontext.h>
-#include <sys/user.h>
-#include <ucontext.h>
-
-#include <algorithm>
-#include <utility>
-#include <vector>
-
-#include "common/basictypes.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/memory.h"
-#include "client/linux/log/log.h"
-#include "client/linux/microdump_writer/microdump_writer.h"
-#include "client/linux/minidump_writer/linux_dumper.h"
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "common/linux/eintr_wrapper.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-#if defined(__ANDROID__)
-#include "linux/sched.h"
-#endif
-
-#ifndef PR_SET_PTRACER
-#define PR_SET_PTRACER 0x59616d61
-#endif
-
-// A wrapper for the tgkill syscall: send a signal to a specific thread.
-static int tgkill(pid_t tgid, pid_t tid, int sig) {
- return syscall(__NR_tgkill, tgid, tid, sig);
- return 0;
-}
-
-namespace google_breakpad {
-
-namespace {
-// The list of signals which we consider to be crashes. The default action for
-// all these signals must be Core (see man 7 signal) because we rethrow the
-// signal after handling it and expect that it'll be fatal.
-const int kExceptionSignals[] = {
- SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, SIGTRAP
-};
-const int kNumHandledSignals =
- sizeof(kExceptionSignals) / sizeof(kExceptionSignals[0]);
-struct sigaction old_handlers[kNumHandledSignals];
-bool handlers_installed = false;
-
-// InstallAlternateStackLocked will store the newly installed stack in new_stack
-// and (if it exists) the previously installed stack in old_stack.
-stack_t old_stack;
-stack_t new_stack;
-bool stack_installed = false;
-
-// Create an alternative stack to run the signal handlers on. This is done since
-// the signal might have been caused by a stack overflow.
-// Runs before crashing: normal context.
-void InstallAlternateStackLocked() {
- if (stack_installed)
- return;
-
- memset(&old_stack, 0, sizeof(old_stack));
- memset(&new_stack, 0, sizeof(new_stack));
-
- // SIGSTKSZ may be too small to prevent the signal handlers from overrunning
- // the alternative stack. Ensure that the size of the alternative stack is
- // large enough.
- static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
-
- // Only set an alternative stack if there isn't already one, or if the current
- // one is too small.
- if (sys_sigaltstack(NULL, &old_stack) == -1 || !old_stack.ss_sp ||
- old_stack.ss_size < kSigStackSize) {
- new_stack.ss_sp = calloc(1, kSigStackSize);
- new_stack.ss_size = kSigStackSize;
-
- if (sys_sigaltstack(&new_stack, NULL) == -1) {
- free(new_stack.ss_sp);
- return;
- }
- stack_installed = true;
- }
-}
-
-// Runs before crashing: normal context.
-void RestoreAlternateStackLocked() {
- if (!stack_installed)
- return;
-
- stack_t current_stack;
- if (sys_sigaltstack(NULL, &current_stack) == -1)
- return;
-
- // Only restore the old_stack if the current alternative stack is the one
- // installed by the call to InstallAlternateStackLocked.
- if (current_stack.ss_sp == new_stack.ss_sp) {
- if (old_stack.ss_sp) {
- if (sys_sigaltstack(&old_stack, NULL) == -1)
- return;
- } else {
- stack_t disable_stack;
- disable_stack.ss_flags = SS_DISABLE;
- if (sys_sigaltstack(&disable_stack, NULL) == -1)
- return;
- }
- }
-
- free(new_stack.ss_sp);
- stack_installed = false;
-}
-
-void InstallDefaultHandler(int sig) {
-#if defined(__ANDROID__)
- // Android L+ expose signal and sigaction symbols that override the system
- // ones. There is a bug in these functions where a request to set the handler
- // to SIG_DFL is ignored. In that case, an infinite loop is entered as the
- // signal is repeatedly sent to breakpad's signal handler.
- // To work around this, directly call the system's sigaction.
- struct kernel_sigaction sa;
- memset(&sa, 0, sizeof(sa));
- sys_sigemptyset(&sa.sa_mask);
- sa.sa_handler_ = SIG_DFL;
- sa.sa_flags = SA_RESTART;
- sys_rt_sigaction(sig, &sa, NULL, sizeof(kernel_sigset_t));
-#else
- signal(sig, SIG_DFL);
-#endif
-}
-
-// The global exception handler stack. This is needed because there may exist
-// multiple ExceptionHandler instances in a process. Each will have itself
-// registered in this stack.
-std::vector<ExceptionHandler*>* g_handler_stack_ = NULL;
-pthread_mutex_t g_handler_stack_mutex_ = PTHREAD_MUTEX_INITIALIZER;
-
-// sizeof(CrashContext) can be too big w.r.t the size of alternatate stack
-// for SignalHandler(). Keep the crash context as a .bss field. Exception
-// handlers are serialized by the |g_handler_stack_mutex_| and at most one at a
-// time can use |g_crash_context_|.
-ExceptionHandler::CrashContext g_crash_context_;
-
-} // namespace
-
-// Runs before crashing: normal context.
-ExceptionHandler::ExceptionHandler(const MinidumpDescriptor& descriptor,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- bool install_handler,
- const int server_fd)
- : filter_(filter),
- callback_(callback),
- callback_context_(callback_context),
- minidump_descriptor_(descriptor),
- crash_handler_(NULL) {
- if (server_fd >= 0)
- crash_generation_client_.reset(CrashGenerationClient::TryCreate(server_fd));
-
- if (!IsOutOfProcess() && !minidump_descriptor_.IsFD() &&
- !minidump_descriptor_.IsMicrodumpOnConsole())
- minidump_descriptor_.UpdatePath();
-
-#if defined(__ANDROID__)
- if (minidump_descriptor_.IsMicrodumpOnConsole())
- logger::initializeCrashLogWriter();
-#endif
-
- pthread_mutex_lock(&g_handler_stack_mutex_);
-
- // Pre-fault the crash context struct. This is to avoid failing due to OOM
- // if handling an exception when the process ran out of virtual memory.
- memset(&g_crash_context_, 0, sizeof(g_crash_context_));
-
- if (!g_handler_stack_)
- g_handler_stack_ = new std::vector<ExceptionHandler*>;
- if (install_handler) {
- InstallAlternateStackLocked();
- InstallHandlersLocked();
- }
- g_handler_stack_->push_back(this);
- pthread_mutex_unlock(&g_handler_stack_mutex_);
-}
-
-// Runs before crashing: normal context.
-ExceptionHandler::~ExceptionHandler() {
- pthread_mutex_lock(&g_handler_stack_mutex_);
- std::vector<ExceptionHandler*>::iterator handler =
- std::find(g_handler_stack_->begin(), g_handler_stack_->end(), this);
- g_handler_stack_->erase(handler);
- if (g_handler_stack_->empty()) {
- delete g_handler_stack_;
- g_handler_stack_ = NULL;
- RestoreAlternateStackLocked();
- RestoreHandlersLocked();
- }
- pthread_mutex_unlock(&g_handler_stack_mutex_);
-}
-
-// Runs before crashing: normal context.
-// static
-bool ExceptionHandler::InstallHandlersLocked() {
- if (handlers_installed)
- return false;
-
- // Fail if unable to store all the old handlers.
- for (int i = 0; i < kNumHandledSignals; ++i) {
- if (sigaction(kExceptionSignals[i], NULL, &old_handlers[i]) == -1)
- return false;
- }
-
- struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
- sigemptyset(&sa.sa_mask);
-
- // Mask all exception signals when we're handling one of them.
- for (int i = 0; i < kNumHandledSignals; ++i)
- sigaddset(&sa.sa_mask, kExceptionSignals[i]);
-
- sa.sa_sigaction = SignalHandler;
- sa.sa_flags = SA_ONSTACK | SA_SIGINFO;
-
- for (int i = 0; i < kNumHandledSignals; ++i) {
- if (sigaction(kExceptionSignals[i], &sa, NULL) == -1) {
- // At this point it is impractical to back out changes, and so failure to
- // install a signal is intentionally ignored.
- }
- }
- handlers_installed = true;
- return true;
-}
-
-// This function runs in a compromised context: see the top of the file.
-// Runs on the crashing thread.
-// static
-void ExceptionHandler::RestoreHandlersLocked() {
- if (!handlers_installed)
- return;
-
- for (int i = 0; i < kNumHandledSignals; ++i) {
- if (sigaction(kExceptionSignals[i], &old_handlers[i], NULL) == -1) {
- InstallDefaultHandler(kExceptionSignals[i]);
- }
- }
- handlers_installed = false;
-}
-
-// void ExceptionHandler::set_crash_handler(HandlerCallback callback) {
-// crash_handler_ = callback;
-// }
-
-// This function runs in a compromised context: see the top of the file.
-// Runs on the crashing thread.
-// static
-void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
- // All the exception signals are blocked at this point.
- pthread_mutex_lock(&g_handler_stack_mutex_);
-
- // Sometimes, Breakpad runs inside a process where some other buggy code
- // saves and restores signal handlers temporarily with 'signal'
- // instead of 'sigaction'. This loses the SA_SIGINFO flag associated
- // with this function. As a consequence, the values of 'info' and 'uc'
- // become totally bogus, generally inducing a crash.
- //
- // The following code tries to detect this case. When it does, it
- // resets the signal handlers with sigaction + SA_SIGINFO and returns.
- // This forces the signal to be thrown again, but this time the kernel
- // will call the function with the right arguments.
- struct sigaction cur_handler;
- if (sigaction(sig, NULL, &cur_handler) == 0 &&
- (cur_handler.sa_flags & SA_SIGINFO) == 0) {
- // Reset signal handler with the right flags.
- sigemptyset(&cur_handler.sa_mask);
- sigaddset(&cur_handler.sa_mask, sig);
-
- cur_handler.sa_sigaction = SignalHandler;
- cur_handler.sa_flags = SA_ONSTACK | SA_SIGINFO;
-
- if (sigaction(sig, &cur_handler, NULL) == -1) {
- // When resetting the handler fails, try to reset the
- // default one to avoid an infinite loop here.
- InstallDefaultHandler(sig);
- }
- pthread_mutex_unlock(&g_handler_stack_mutex_);
- return;
- }
-
- bool handled = false;
- for (int i = g_handler_stack_->size() - 1; !handled && i >= 0; --i) {
- handled = (*g_handler_stack_)[i]->HandleSignal(sig, info, uc);
- }
-
- // Upon returning from this signal handler, sig will become unmasked and then
- // it will be retriggered. If one of the ExceptionHandlers handled it
- // successfully, restore the default handler. Otherwise, restore the
- // previously installed handler. Then, when the signal is retriggered, it will
- // be delivered to the appropriate handler.
- if (handled) {
- InstallDefaultHandler(sig);
- } else {
- RestoreHandlersLocked();
- }
-
- pthread_mutex_unlock(&g_handler_stack_mutex_);
-
- // info->si_code <= 0 iff SI_FROMUSER (SI_FROMKERNEL otherwise).
- if (info->si_code <= 0 || sig == SIGABRT) {
- // This signal was triggered by somebody sending us the signal with kill().
- // In order to retrigger it, we have to queue a new signal by calling
- // kill() ourselves. The special case (si_pid == 0 && sig == SIGABRT) is
- // due to the kernel sending a SIGABRT from a user request via SysRQ.
- if (tgkill(getpid(), syscall(__NR_gettid), sig) < 0) {
- // If we failed to kill ourselves (e.g. because a sandbox disallows us
- // to do so), we instead resort to terminating our process. This will
- // result in an incorrect exit code.
- _exit(1);
- }
- } else {
- // This was a synchronous signal triggered by a hard fault (e.g. SIGSEGV).
- // No need to reissue the signal. It will automatically trigger again,
- // when we return from the signal handler.
- }
-}
-
-struct ThreadArgument {
- pid_t pid; // the crashing process
- const MinidumpDescriptor* minidump_descriptor;
- ExceptionHandler* handler;
- const void* context; // a CrashContext structure
- size_t context_size;
-};
-
-// This is the entry function for the cloned process. We are in a compromised
-// context here: see the top of the file.
-// static
-int ExceptionHandler::ThreadEntry(void *arg) {
- const ThreadArgument *thread_arg = reinterpret_cast<ThreadArgument*>(arg);
-
- // Block here until the crashing process unblocks us when
- // we're allowed to use ptrace
- thread_arg->handler->WaitForContinueSignal();
-
- return thread_arg->handler->DoDump(thread_arg->pid, thread_arg->context,
- thread_arg->context_size) == false;
-}
-
-// This function runs in a compromised context: see the top of the file.
-// Runs on the crashing thread.
-bool ExceptionHandler::HandleSignal(int sig, siginfo_t* info, void* uc) {
- if (filter_ && !filter_(callback_context_))
- return false;
-
- // Allow ourselves to be dumped if the signal is trusted.
- bool signal_trusted = info->si_code > 0;
- bool signal_pid_trusted = info->si_code == SI_USER ||
- info->si_code == SI_TKILL;
- if (signal_trusted || (signal_pid_trusted && info->si_pid == getpid())) {
- sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
- }
-
- // Fill in all the holes in the struct to make Valgrind happy.
- memset(&g_crash_context_, 0, sizeof(g_crash_context_));
- memcpy(&g_crash_context_.siginfo, info, sizeof(siginfo_t));
- memcpy(&g_crash_context_.context, uc, sizeof(ucontext_t));
-#if defined(__aarch64__)
- ucontext_t* uc_ptr = (ucontext_t*)uc;
- struct fpsimd_context* fp_ptr =
- (struct fpsimd_context*)&uc_ptr->uc_mcontext.__reserved;
- if (fp_ptr->head.magic == FPSIMD_MAGIC) {
- memcpy(&g_crash_context_.float_state, fp_ptr,
- sizeof(g_crash_context_.float_state));
- }
-#elif !defined(__ARM_EABI__) && !defined(__mips__)
- // FP state is not part of user ABI on ARM Linux.
- // In case of MIPS Linux FP state is already part of ucontext_t
- // and 'float_state' is not a member of CrashContext.
- ucontext_t* uc_ptr = (ucontext_t*)uc;
- if (uc_ptr->uc_mcontext.fpregs) {
- memcpy(&g_crash_context_.float_state, uc_ptr->uc_mcontext.fpregs,
- sizeof(g_crash_context_.float_state));
- }
-#endif
- g_crash_context_.tid = syscall(__NR_gettid);
- if (crash_handler_ != NULL) {
- if (crash_handler_(&g_crash_context_, sizeof(g_crash_context_),
- callback_context_)) {
- return true;
- }
- }
- return GenerateDump(&g_crash_context_);
-}
-
-// This is a public interface to HandleSignal that allows the client to
-// generate a crash dump. This function may run in a compromised context.
-bool ExceptionHandler::SimulateSignalDelivery(int sig) {
- siginfo_t siginfo = {};
- // Mimic a trusted signal to allow tracing the process (see
- // ExceptionHandler::HandleSignal().
- siginfo.si_code = SI_USER;
- siginfo.si_pid = getpid();
- ucontext_t context;
- getcontext(&context);
- return HandleSignal(sig, &siginfo, &context);
-}
-
-// This function may run in a compromised context: see the top of the file.
-bool ExceptionHandler::GenerateDump(CrashContext *context) {
- if (IsOutOfProcess())
- return crash_generation_client_->RequestDump(context, sizeof(*context));
-
- // Allocating too much stack isn't a problem, and better to err on the side
- // of caution than smash it into random locations.
- static const unsigned kChildStackSize = 16000;
- PageAllocator allocator;
- uint8_t* stack = reinterpret_cast<uint8_t*>(allocator.Alloc(kChildStackSize));
- if (!stack)
- return false;
- // clone() needs the top-most address. (scrub just to be safe)
- stack += kChildStackSize;
- my_memset(stack - 16, 0, 16);
-
- ThreadArgument thread_arg;
- thread_arg.handler = this;
- thread_arg.minidump_descriptor = &minidump_descriptor_;
- thread_arg.pid = getpid();
- thread_arg.context = context;
- thread_arg.context_size = sizeof(*context);
-
- // We need to explicitly enable ptrace of parent processes on some
- // kernels, but we need to know the PID of the cloned process before we
- // can do this. Create a pipe here which we can use to block the
- // cloned process after creating it, until we have explicitly enabled ptrace
- if (sys_pipe(fdes) == -1) {
- // Creating the pipe failed. We'll log an error but carry on anyway,
- // as we'll probably still get a useful crash report. All that will happen
- // is the write() and read() calls will fail with EBADF
- static const char no_pipe_msg[] = "ExceptionHandler::GenerateDump "
- "sys_pipe failed:";
- logger::write(no_pipe_msg, sizeof(no_pipe_msg) - 1);
- logger::write(strerror(errno), strlen(strerror(errno)));
- logger::write("\n", 1);
-
- // Ensure fdes[0] and fdes[1] are invalid file descriptors.
- fdes[0] = fdes[1] = -1;
- }
-
- const pid_t child = sys_clone(
- ThreadEntry, stack, CLONE_FILES | CLONE_FS | CLONE_UNTRACED,
- &thread_arg, NULL, NULL, NULL);
- if (child == -1) {
- sys_close(fdes[0]);
- sys_close(fdes[1]);
- return false;
- }
-
- if (child != 0) {
- static const char clonedMsg[] =
- "ExceptionHandler::GenerateDump cloned child ";
- char pidMsg[32];
-
- unsigned int pidLen = my_uint_len(child);
- my_uitos(pidMsg, child, pidLen);
-
- logger::write(clonedMsg, my_strlen(clonedMsg));
- logger::write(pidMsg, pidLen);
- logger::write("\n", 1);
- } else {
- static const char childMsg[] =
- "ExceptionHandler::GenerateDump I'm the child\n";
- logger::write(childMsg, my_strlen(childMsg));
- }
-
- // Allow the child to ptrace us
- sys_prctl(PR_SET_PTRACER, child, 0, 0, 0);
- SendContinueSignalToChild();
- int status;
- const int r = HANDLE_EINTR(sys_waitpid(child, &status, __WALL));
-
- sys_close(fdes[0]);
- sys_close(fdes[1]);
-
- if (r == -1) {
- static const char msg[] = "ExceptionHandler::GenerateDump waitpid failed:";
- logger::write(msg, sizeof(msg) - 1);
- logger::write(strerror(errno), strlen(strerror(errno)));
- logger::write("\n", 1);
- }
-
- bool success = r != -1 && WIFEXITED(status) && WEXITSTATUS(status) == 0;
- if (callback_)
- success = callback_(minidump_descriptor_, callback_context_, success);
- return success;
-}
-
-// This function runs in a compromised context: see the top of the file.
-void ExceptionHandler::SendContinueSignalToChild() {
- static const char okToContinueMessage = 'a';
- int r;
- r = HANDLE_EINTR(sys_write(fdes[1], &okToContinueMessage, sizeof(char)));
- if (r == -1) {
- static const char msg[] = "ExceptionHandler::SendContinueSignalToChild "
- "sys_write failed:";
- logger::write(msg, sizeof(msg) - 1);
- logger::write(strerror(errno), strlen(strerror(errno)));
- logger::write("\n", 1);
- }
-
- const char* msg = "ExceptionHandler::SendContinueSignalToChild sent continue signal to child\n";
- logger::write(msg, my_strlen(msg));
-}
-
-// This function runs in a compromised context: see the top of the file.
-// Runs on the cloned process.
-void ExceptionHandler::WaitForContinueSignal() {
- int r;
- char receivedMessage;
-
- const char* waitMsg = "ExceptionHandler::WaitForContinueSignal waiting for continue signal...\n";
- logger::write(waitMsg, my_strlen(waitMsg));
-
- r = HANDLE_EINTR(sys_read(fdes[0], &receivedMessage, sizeof(char)));
- if (r == -1) {
- static const char msg[] = "ExceptionHandler::WaitForContinueSignal "
- "sys_read failed:";
- logger::write(msg, sizeof(msg) - 1);
- logger::write(strerror(errno), strlen(strerror(errno)));
- logger::write("\n", 1);
- }
-}
-
-// This function runs in a compromised context: see the top of the file.
-// Runs on the cloned process.
-bool ExceptionHandler::DoDump(pid_t crashing_process, const void* context,
- size_t context_size) {
- if (minidump_descriptor_.IsMicrodumpOnConsole()) {
- return google_breakpad::WriteMicrodump(
- crashing_process,
- context,
- context_size,
- mapping_list_,
- *minidump_descriptor_.microdump_extra_info());
- }
- if (minidump_descriptor_.IsFD()) {
- return google_breakpad::WriteMinidump(minidump_descriptor_.fd(),
- minidump_descriptor_.size_limit(),
- crashing_process,
- context,
- context_size,
- mapping_list_,
- app_memory_list_);
- }
- return google_breakpad::WriteMinidump(minidump_descriptor_.path(),
- minidump_descriptor_.size_limit(),
- crashing_process,
- context,
- context_size,
- mapping_list_,
- app_memory_list_);
-}
-
-// static
-bool ExceptionHandler::WriteMinidump(const string& dump_path,
- MinidumpCallback callback,
- void* callback_context) {
- MinidumpDescriptor descriptor(dump_path);
- ExceptionHandler eh(descriptor, NULL, callback, callback_context, false, -1);
- return eh.WriteMinidump();
-}
-
-// In order to making using EBP to calculate the desired value for ESP
-// a valid operation, ensure that this function is compiled with a
-// frame pointer using the following attribute. This attribute
-// is supported on GCC but not on clang.
-#if defined(__i386__) && defined(__GNUC__) && !defined(__clang__)
-__attribute__((optimize("no-omit-frame-pointer")))
-#endif
-bool ExceptionHandler::WriteMinidump() {
- if (!IsOutOfProcess() && !minidump_descriptor_.IsFD() &&
- !minidump_descriptor_.IsMicrodumpOnConsole()) {
- // Update the path of the minidump so that this can be called multiple times
- // and new files are created for each minidump. This is done before the
- // generation happens, as clients may want to access the MinidumpDescriptor
- // after this call to find the exact path to the minidump file.
- minidump_descriptor_.UpdatePath();
- } else if (minidump_descriptor_.IsFD()) {
- // Reposition the FD to its beginning and resize it to get rid of the
- // previous minidump info.
- lseek(minidump_descriptor_.fd(), 0, SEEK_SET);
- ignore_result(ftruncate(minidump_descriptor_.fd(), 0));
- }
-
- // Allow this process to be dumped.
- sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
-
- CrashContext context;
- int getcontext_result = getcontext(&context.context);
- if (getcontext_result)
- return false;
-
-#if defined(__i386__)
- // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved
- // from REG_UESP instead of from REG_ESP. REG_UESP is the user stack pointer
- // and it only makes sense when running in kernel mode with a different stack
- // pointer. When WriteMiniDump is called during normal processing REG_UESP is
- // zero which leads to bad minidump files.
- if (!context.context.uc_mcontext.gregs[REG_UESP]) {
- // If REG_UESP is set to REG_ESP then that includes the stack space for the
- // CrashContext object in this function, which is about 128 KB. Since the
- // Linux dumper only records 32 KB of stack this would mean that nothing
- // useful would be recorded. A better option is to set REG_UESP to REG_EBP,
- // perhaps with a small negative offset in case there is any code that
- // objects to them being equal.
- context.context.uc_mcontext.gregs[REG_UESP] =
- context.context.uc_mcontext.gregs[REG_EBP] - 16;
- // The stack saving is based off of REG_ESP so it must be set to match the
- // new REG_UESP.
- context.context.uc_mcontext.gregs[REG_ESP] =
- context.context.uc_mcontext.gregs[REG_UESP];
- }
-#endif
-
-#if !defined(__ARM_EABI__) && !defined(__aarch64__) && !defined(__mips__)
- // FPU state is not part of ARM EABI ucontext_t.
- memcpy(&context.float_state, context.context.uc_mcontext.fpregs,
- sizeof(context.float_state));
-#endif
- context.tid = sys_gettid();
-
- // Add an exception stream to the minidump for better reporting.
- memset(&context.siginfo, 0, sizeof(context.siginfo));
- context.siginfo.si_signo = MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED;
-#if defined(__i386__)
- context.siginfo.si_addr =
- reinterpret_cast<void*>(context.context.uc_mcontext.gregs[REG_EIP]);
-#elif defined(__x86_64__)
- context.siginfo.si_addr =
- reinterpret_cast<void*>(context.context.uc_mcontext.gregs[REG_RIP]);
-#elif defined(__arm__)
- context.siginfo.si_addr =
- reinterpret_cast<void*>(context.context.uc_mcontext.arm_pc);
-#elif defined(__aarch64__)
- context.siginfo.si_addr =
- reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-#elif defined(__mips__)
- context.siginfo.si_addr =
- reinterpret_cast<void*>(context.context.uc_mcontext.pc);
-#else
-#error "This code has not been ported to your platform yet."
-#endif
-
- return GenerateDump(&context);
-}
-
-void ExceptionHandler::AddMappingInfo(const string& name,
- const uint8_t identifier[sizeof(MDGUID)],
- uintptr_t start_address,
- size_t mapping_size,
- size_t file_offset) {
- MappingInfo info;
- info.start_addr = start_address;
- info.size = mapping_size;
- info.offset = file_offset;
- strncpy(info.name, name.c_str(), sizeof(info.name) - 1);
- info.name[sizeof(info.name) - 1] = '\0';
-
- MappingEntry mapping;
- mapping.first = info;
- memcpy(mapping.second, identifier, sizeof(MDGUID));
- mapping_list_.push_back(mapping);
-}
-
-void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) {
- AppMemoryList::iterator iter =
- std::find(app_memory_list_.begin(), app_memory_list_.end(), ptr);
- if (iter != app_memory_list_.end()) {
- // Don't allow registering the same pointer twice.
- return;
- }
-
- AppMemory app_memory;
- app_memory.ptr = ptr;
- app_memory.length = length;
- app_memory_list_.push_back(app_memory);
-}
-
-void ExceptionHandler::UnregisterAppMemory(void* ptr) {
- AppMemoryList::iterator iter =
- std::find(app_memory_list_.begin(), app_memory_list_.end(), ptr);
- if (iter != app_memory_list_.end()) {
- app_memory_list_.erase(iter);
- }
-}
-
-// static
-bool ExceptionHandler::WriteMinidumpForChild(pid_t child,
- pid_t child_blamed_thread,
- const string& dump_path,
- MinidumpCallback callback,
- void* callback_context) {
- // This function is not run in a compromised context.
- MinidumpDescriptor descriptor(dump_path);
- descriptor.UpdatePath();
- if (!google_breakpad::WriteMinidump(descriptor.path(),
- child,
- child_blamed_thread))
- return false;
-
- return callback ? callback(descriptor, callback_context, true) : true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
deleted file mode 100644
index 846df772f5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.h
+++ /dev/null
@@ -1,278 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_
-#define CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_
-
-#include <signal.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/ucontext.h>
-
-#include <string>
-
-#include "client/linux/crash_generation/crash_generation_client.h"
-#include "client/linux/handler/minidump_descriptor.h"
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// ExceptionHandler
-//
-// ExceptionHandler can write a minidump file when an exception occurs,
-// or when WriteMinidump() is called explicitly by your program.
-//
-// To have the exception handler write minidumps when an uncaught exception
-// (crash) occurs, you should create an instance early in the execution
-// of your program, and keep it around for the entire time you want to
-// have crash handling active (typically, until shutdown).
-// (NOTE): There should be only be one this kind of exception handler
-// object per process.
-//
-// If you want to write minidumps without installing the exception handler,
-// you can create an ExceptionHandler with install_handler set to false,
-// then call WriteMinidump. You can also use this technique if you want to
-// use different minidump callbacks for different call sites.
-//
-// In either case, a callback function is called when a minidump is written,
-// which receives the full path or file descriptor of the minidump. The
-// caller can collect and write additional application state to that minidump,
-// and launch an external crash-reporting application.
-//
-// Caller should try to make the callbacks as crash-friendly as possible,
-// it should avoid use heap memory allocation as much as possible.
-
-class ExceptionHandler {
- public:
- // A callback function to run before Breakpad performs any substantial
- // processing of an exception. A FilterCallback is called before writing
- // a minidump. |context| is the parameter supplied by the user as
- // callback_context when the handler was created.
- //
- // If a FilterCallback returns true, Breakpad will continue processing,
- // attempting to write a minidump. If a FilterCallback returns false,
- // Breakpad will immediately report the exception as unhandled without
- // writing a minidump, allowing another handler the opportunity to handle it.
- typedef bool (*FilterCallback)(void *context);
-
- // A callback function to run after the minidump has been written.
- // |descriptor| contains the file descriptor or file path containing the
- // minidump. |context| is the parameter supplied by the user as
- // callback_context when the handler was created. |succeeded| indicates
- // whether a minidump file was successfully written.
- //
- // If an exception occurred and the callback returns true, Breakpad will
- // treat the exception as fully-handled, suppressing any other handlers from
- // being notified of the exception. If the callback returns false, Breakpad
- // will treat the exception as unhandled, and allow another handler to handle
- // it. If there are no other handlers, Breakpad will report the exception to
- // the system as unhandled, allowing a debugger or native crash dialog the
- // opportunity to handle the exception. Most callback implementations
- // should normally return the value of |succeeded|, or when they wish to
- // not report an exception of handled, false. Callbacks will rarely want to
- // return true directly (unless |succeeded| is true).
- typedef bool (*MinidumpCallback)(const MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded);
-
- // In certain cases, a user may wish to handle the generation of the minidump
- // themselves. In this case, they can install a handler callback which is
- // called when a crash has occurred. If this function returns true, no other
- // processing of occurs and the process will shortly be crashed. If this
- // returns false, the normal processing continues.
- typedef bool (*HandlerCallback)(const void* crash_context,
- size_t crash_context_size,
- void* context);
-
- // Creates a new ExceptionHandler instance to handle writing minidumps.
- // Before writing a minidump, the optional |filter| callback will be called.
- // Its return value determines whether or not Breakpad should write a
- // minidump. The minidump content will be written to the file path or file
- // descriptor from |descriptor|, and the optional |callback| is called after
- // writing the dump file, as described above.
- // If install_handler is true, then a minidump will be written whenever
- // an unhandled exception occurs. If it is false, minidumps will only
- // be written when WriteMinidump is called.
- // If |server_fd| is valid, the minidump is generated out-of-process. If it
- // is -1, in-process generation will always be used.
- ExceptionHandler(const MinidumpDescriptor& descriptor,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- bool install_handler,
- const int server_fd);
- ~ExceptionHandler();
-
- const MinidumpDescriptor& minidump_descriptor() const {
- return minidump_descriptor_;
- }
-
- void set_minidump_descriptor(const MinidumpDescriptor& descriptor) {
- minidump_descriptor_ = descriptor;
- }
-
- void set_crash_handler(HandlerCallback callback) {
- crash_handler_ = callback;
- }
-
- void set_crash_generation_client(CrashGenerationClient* client) {
- crash_generation_client_.reset(client);
- }
-
- // Writes a minidump immediately. This can be used to capture the execution
- // state independently of a crash.
- // Returns true on success.
- // If the ExceptionHandler has been created with a path, a new file is
- // generated for each minidump. The file path can be retrieved in the
- // MinidumpDescriptor passed to the MinidumpCallback or by accessing the
- // MinidumpDescriptor directly from the ExceptionHandler (with
- // minidump_descriptor()).
- // If the ExceptionHandler has been created with a file descriptor, the file
- // descriptor is repositioned to its beginning and the previous generated
- // minidump is overwritten.
- // Note that this method is not supposed to be called from a compromised
- // context as it uses the heap.
- bool WriteMinidump();
-
- // Convenience form of WriteMinidump which does not require an
- // ExceptionHandler instance.
- static bool WriteMinidump(const string& dump_path,
- MinidumpCallback callback,
- void* callback_context);
-
- // Write a minidump of |child| immediately. This can be used to
- // capture the execution state of |child| independently of a crash.
- // Pass a meaningful |child_blamed_thread| to make that thread in
- // the child process the one from which a crash signature is
- // extracted.
- //
- // WARNING: the return of this function *must* happen before
- // the code that will eventually reap |child| executes.
- // Otherwise there's a pernicious race condition in which |child|
- // exits, is reaped, another process created with its pid, then that
- // new process dumped.
- static bool WriteMinidumpForChild(pid_t child,
- pid_t child_blamed_thread,
- const string& dump_path,
- MinidumpCallback callback,
- void* callback_context);
-
- // This structure is passed to minidump_writer.h:WriteMinidump via an opaque
- // blob. It shouldn't be needed in any user code.
- struct CrashContext {
- siginfo_t siginfo;
- pid_t tid; // the crashing thread.
- ucontext_t context;
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- // #ifdef this out because FP state is not part of user ABI for Linux ARM.
- // In case of MIPS Linux FP state is already part of struct
- // ucontext so 'float_state' is not required.
- fpstate_t float_state;
-#endif
- };
-
- // Returns whether out-of-process dump generation is used or not.
- bool IsOutOfProcess() const {
- return crash_generation_client_.get() != NULL;
- }
-
- // Add information about a memory mapping. This can be used if
- // a custom library loader is used that maps things in a way
- // that the linux dumper can't handle by reading the maps file.
- void AddMappingInfo(const string& name,
- const uint8_t identifier[sizeof(MDGUID)],
- uintptr_t start_address,
- size_t mapping_size,
- size_t file_offset);
-
- // Register a block of memory of length bytes starting at address ptr
- // to be copied to the minidump when a crash happens.
- void RegisterAppMemory(void* ptr, size_t length);
-
- // Unregister a block of memory that was registered with RegisterAppMemory.
- void UnregisterAppMemory(void* ptr);
-
- // Force signal handling for the specified signal.
- bool SimulateSignalDelivery(int sig);
-
- // Report a crash signal from an SA_SIGINFO signal handler.
- bool HandleSignal(int sig, siginfo_t* info, void* uc);
-
- private:
- // Save the old signal handlers and install new ones.
- static bool InstallHandlersLocked();
- // Restore the old signal handlers.
- static void RestoreHandlersLocked();
-
- void PreresolveSymbols();
- bool GenerateDump(CrashContext *context);
- void SendContinueSignalToChild();
- void WaitForContinueSignal();
-
- static void SignalHandler(int sig, siginfo_t* info, void* uc);
- static int ThreadEntry(void* arg);
- bool DoDump(pid_t crashing_process, const void* context,
- size_t context_size);
-
- const FilterCallback filter_;
- const MinidumpCallback callback_;
- void* const callback_context_;
-
- scoped_ptr<CrashGenerationClient> crash_generation_client_;
-
- MinidumpDescriptor minidump_descriptor_;
-
- // Must be volatile. The compiler is unaware of the code which runs in
- // the signal handler which reads this variable. Without volatile the
- // compiler is free to optimise away writes to this variable which it
- // believes are never read.
- volatile HandlerCallback crash_handler_;
-
- // We need to explicitly enable ptrace of parent processes on some
- // kernels, but we need to know the PID of the cloned process before we
- // can do this. We create a pipe which we can use to block the
- // cloned process after creating it, until we have explicitly enabled
- // ptrace. This is used to store the file descriptors for the pipe
- int fdes[2];
-
- // Callers can add extra info about mappings for cases where the
- // dumper code cannot extract enough information from /proc/<pid>/maps.
- MappingList mapping_list_;
-
- // Callers can request additional memory regions to be included in
- // the dump.
- AppMemoryList app_memory_list_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_HANDLER_EXCEPTION_HANDLER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc
deleted file mode 100644
index 17d84cf7be..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler_unittest.cc
+++ /dev/null
@@ -1,1179 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdint.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/mman.h>
-#include <sys/poll.h>
-#include <sys/socket.h>
-#include <sys/uio.h>
-#include <sys/wait.h>
-#if defined(__mips__)
-#include <sys/cachectl.h>
-#endif
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/ignore_ret.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/tests/auto_tempdir.h"
-#include "common/using_std_string.h"
-#include "third_party/lss/linux_syscall_support.h"
-#include "google_breakpad/processor/minidump.h"
-
-using namespace google_breakpad;
-
-namespace {
-
-// Flush the instruction cache for a given memory range.
-// Only required on ARM and mips.
-void FlushInstructionCache(const char* memory, uint32_t memory_size) {
-#if defined(__arm__)
- long begin = reinterpret_cast<long>(memory);
- long end = begin + static_cast<long>(memory_size);
-# if defined(__ANDROID__)
- // Provided by Android's <unistd.h>
- cacheflush(begin, end, 0);
-# elif defined(__linux__)
- // GLibc/ARM doesn't provide a wrapper for it, do a direct syscall.
-# ifndef __ARM_NR_cacheflush
-# define __ARM_NR_cacheflush 0xf0002
-# endif
- syscall(__ARM_NR_cacheflush, begin, end, 0);
-# else
-# error "Your operating system is not supported yet"
-# endif
-#elif defined(__mips__)
-# if defined(__ANDROID__)
- // Provided by Android's <unistd.h>
- long begin = reinterpret_cast<long>(memory);
- long end = begin + static_cast<long>(memory_size);
-#if _MIPS_SIM == _ABIO32
- cacheflush(begin, end, 0);
-#else
- syscall(__NR_cacheflush, begin, end, ICACHE);
-#endif
-# elif defined(__linux__)
- // See http://www.linux-mips.org/wiki/Cacheflush_Syscall.
- cacheflush(const_cast<char*>(memory), memory_size, ICACHE);
-# else
-# error "Your operating system is not supported yet"
-# endif
-#endif
-}
-
-void sigchld_handler(int signo) { }
-
-int CreateTMPFile(const string& dir, string* path) {
- string file = dir + "/exception-handler-unittest.XXXXXX";
- const char* c_file = file.c_str();
- // Copy that string, mkstemp needs a C string it can modify.
- char* c_path = strdup(c_file);
- const int fd = mkstemp(c_path);
- if (fd >= 0)
- *path = c_path;
- free(c_path);
- return fd;
-}
-
-class ExceptionHandlerTest : public ::testing::Test {
- protected:
- void SetUp() {
- // We need to be able to wait for children, so SIGCHLD cannot be SIG_IGN.
- struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = sigchld_handler;
- ASSERT_NE(sigaction(SIGCHLD, &sa, &old_action), -1);
- }
-
- void TearDown() {
- sigaction(SIGCHLD, &old_action, NULL);
- }
-
- struct sigaction old_action;
-};
-
-
-void WaitForProcessToTerminate(pid_t process_id, int expected_status) {
- int status;
- ASSERT_NE(HANDLE_EINTR(waitpid(process_id, &status, 0)), -1);
- ASSERT_TRUE(WIFSIGNALED(status));
- ASSERT_EQ(expected_status, WTERMSIG(status));
-}
-
-// Reads the minidump path sent over the pipe |fd| and sets it in |path|.
-void ReadMinidumpPathFromPipe(int fd, string* path) {
- struct pollfd pfd;
- memset(&pfd, 0, sizeof(pfd));
- pfd.fd = fd;
- pfd.events = POLLIN | POLLERR;
-
- const int r = HANDLE_EINTR(poll(&pfd, 1, 0));
- ASSERT_EQ(1, r);
- ASSERT_TRUE(pfd.revents & POLLIN);
-
- int32_t len;
- ASSERT_EQ(static_cast<ssize_t>(sizeof(len)), read(fd, &len, sizeof(len)));
- ASSERT_LT(len, 2048);
- char* filename = static_cast<char*>(malloc(len + 1));
- ASSERT_EQ(len, read(fd, filename, len));
- filename[len] = 0;
- close(fd);
- *path = filename;
- free(filename);
-}
-
-} // namespace
-
-TEST(ExceptionHandlerTest, SimpleWithPath) {
- AutoTempDir temp_dir;
- ExceptionHandler handler(
- MinidumpDescriptor(temp_dir.path()), NULL, NULL, NULL, true, -1);
- EXPECT_EQ(temp_dir.path(), handler.minidump_descriptor().directory());
- string temp_subdir = temp_dir.path() + "/subdir";
- handler.set_minidump_descriptor(MinidumpDescriptor(temp_subdir));
- EXPECT_EQ(temp_subdir, handler.minidump_descriptor().directory());
-}
-
-TEST(ExceptionHandlerTest, SimpleWithFD) {
- AutoTempDir temp_dir;
- string path;
- const int fd = CreateTMPFile(temp_dir.path(), &path);
- ExceptionHandler handler(MinidumpDescriptor(fd), NULL, NULL, NULL, true, -1);
- close(fd);
-}
-
-static bool DoneCallback(const MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded) {
- if (!succeeded)
- return false;
-
- if (!descriptor.IsFD()) {
- int fd = reinterpret_cast<intptr_t>(context);
- uint32_t len = 0;
- len = my_strlen(descriptor.path());
- IGNORE_RET(HANDLE_EINTR(sys_write(fd, &len, sizeof(len))));
- IGNORE_RET(HANDLE_EINTR(sys_write(fd, descriptor.path(), len)));
- }
- return true;
-}
-
-#ifndef ADDRESS_SANITIZER
-
-// This is a replacement for "*reinterpret_cast<volatile int*>(NULL) = 0;"
-// It is needed because GCC is allowed to assume that the program will
-// not execute any undefined behavior (UB) operation. Further, when GCC
-// observes that UB statement is reached, it can assume that all statements
-// leading to the UB one are never executed either, and can completely
-// optimize them out. In the case of ExceptionHandlerTest::ExternalDumper,
-// GCC-4.9 optimized out the entire set up of ExceptionHandler, causing
-// test failure.
-volatile int *p_null; // external linkage, so GCC can't tell that it
- // remains NULL. Volatile just for a good measure.
-static void DoNullPointerDereference() {
- *p_null = 1;
-}
-
-void ChildCrash(bool use_fd) {
- AutoTempDir temp_dir;
- int fds[2] = {0};
- int minidump_fd = -1;
- string minidump_path;
- if (use_fd) {
- minidump_fd = CreateTMPFile(temp_dir.path(), &minidump_path);
- } else {
- ASSERT_NE(pipe(fds), -1);
- }
-
- const pid_t child = fork();
- if (child == 0) {
- {
- google_breakpad::scoped_ptr<ExceptionHandler> handler;
- if (use_fd) {
- handler.reset(new ExceptionHandler(MinidumpDescriptor(minidump_fd),
- NULL, NULL, NULL, true, -1));
- } else {
- close(fds[0]); // Close the reading end.
- void* fd_param = reinterpret_cast<void*>(fds[1]);
- handler.reset(new ExceptionHandler(MinidumpDescriptor(temp_dir.path()),
- NULL, DoneCallback, fd_param,
- true, -1));
- }
- // Crash with the exception handler in scope.
- DoNullPointerDereference();
- }
- }
- if (!use_fd)
- close(fds[1]); // Close the writting end.
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-
- if (!use_fd)
- ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
-
- struct stat st;
- ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
- unlink(minidump_path.c_str());
-}
-
-TEST(ExceptionHandlerTest, ChildCrashWithPath) {
- ASSERT_NO_FATAL_FAILURE(ChildCrash(false));
-}
-
-TEST(ExceptionHandlerTest, ChildCrashWithFD) {
- ASSERT_NO_FATAL_FAILURE(ChildCrash(true));
-}
-
-static bool DoneCallbackReturnFalse(const MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded) {
- return false;
-}
-
-static bool DoneCallbackReturnTrue(const MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded) {
- return true;
-}
-
-static bool DoneCallbackRaiseSIGKILL(const MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded) {
- raise(SIGKILL);
- return true;
-}
-
-static bool FilterCallbackReturnFalse(void* context) {
- return false;
-}
-
-static bool FilterCallbackReturnTrue(void* context) {
- return true;
-}
-
-// SIGKILL cannot be blocked and a handler cannot be installed for it. In the
-// following tests, if the child dies with signal SIGKILL, then the signal was
-// redelivered to this handler. If the child dies with SIGSEGV then it wasn't.
-static void RaiseSIGKILL(int sig) {
- raise(SIGKILL);
-}
-
-static bool InstallRaiseSIGKILL() {
- struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
- sa.sa_handler = RaiseSIGKILL;
- return sigaction(SIGSEGV, &sa, NULL) != -1;
-}
-
-static void CrashWithCallbacks(ExceptionHandler::FilterCallback filter,
- ExceptionHandler::MinidumpCallback done,
- string path) {
- ExceptionHandler handler(
- MinidumpDescriptor(path), filter, done, NULL, true, -1);
- // Crash with the exception handler in scope.
- DoNullPointerDereference();
-}
-
-TEST(ExceptionHandlerTest, RedeliveryOnFilterCallbackFalse) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ASSERT_TRUE(InstallRaiseSIGKILL());
- CrashWithCallbacks(FilterCallbackReturnFalse, NULL, temp_dir.path());
- }
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
-}
-
-TEST(ExceptionHandlerTest, RedeliveryOnDoneCallbackFalse) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ASSERT_TRUE(InstallRaiseSIGKILL());
- CrashWithCallbacks(NULL, DoneCallbackReturnFalse, temp_dir.path());
- }
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
-}
-
-TEST(ExceptionHandlerTest, NoRedeliveryOnDoneCallbackTrue) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ASSERT_TRUE(InstallRaiseSIGKILL());
- CrashWithCallbacks(NULL, DoneCallbackReturnTrue, temp_dir.path());
- }
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-}
-
-TEST(ExceptionHandlerTest, NoRedeliveryOnFilterCallbackTrue) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ASSERT_TRUE(InstallRaiseSIGKILL());
- CrashWithCallbacks(FilterCallbackReturnTrue, NULL, temp_dir.path());
- }
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-}
-
-TEST(ExceptionHandlerTest, RedeliveryToDefaultHandler) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- CrashWithCallbacks(FilterCallbackReturnFalse, NULL, temp_dir.path());
- }
-
- // As RaiseSIGKILL wasn't installed, the redelivery should just kill the child
- // with SIGSEGV.
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-}
-
-// Check that saving and restoring the signal handler with 'signal'
-// instead of 'sigaction' doesn't make the Breakpad signal handler
-// crash. See comments in ExceptionHandler::SignalHandler for full
-// details.
-TEST(ExceptionHandlerTest, RedeliveryOnBadSignalHandlerFlag) {
- AutoTempDir temp_dir;
- const pid_t child = fork();
- if (child == 0) {
- // Install the RaiseSIGKILL handler for SIGSEGV.
- ASSERT_TRUE(InstallRaiseSIGKILL());
-
- // Create a new exception handler, this installs a new SIGSEGV
- // handler, after saving the old one.
- ExceptionHandler handler(
- MinidumpDescriptor(temp_dir.path()), NULL,
- DoneCallbackReturnFalse, NULL, true, -1);
-
- // Install the default SIGSEGV handler, saving the current one.
- // Then re-install the current one with 'signal', this loses the
- // SA_SIGINFO flag associated with the Breakpad handler.
- sighandler_t old_handler = signal(SIGSEGV, SIG_DFL);
- ASSERT_NE(reinterpret_cast<void*>(old_handler),
- reinterpret_cast<void*>(SIG_ERR));
- ASSERT_NE(reinterpret_cast<void*>(signal(SIGSEGV, old_handler)),
- reinterpret_cast<void*>(SIG_ERR));
-
- // Crash with the exception handler in scope.
- DoNullPointerDereference();
- }
- // SIGKILL means Breakpad's signal handler didn't crash.
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
-}
-
-TEST(ExceptionHandlerTest, StackedHandlersDeliveredToTop) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ExceptionHandler bottom(MinidumpDescriptor(temp_dir.path()),
- NULL,
- NULL,
- NULL,
- true,
- -1);
- CrashWithCallbacks(NULL, DoneCallbackRaiseSIGKILL, temp_dir.path());
- }
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
-}
-
-TEST(ExceptionHandlerTest, StackedHandlersNotDeliveredToBottom) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ExceptionHandler bottom(MinidumpDescriptor(temp_dir.path()),
- NULL,
- DoneCallbackRaiseSIGKILL,
- NULL,
- true,
- -1);
- CrashWithCallbacks(NULL, NULL, temp_dir.path());
- }
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-}
-
-TEST(ExceptionHandlerTest, StackedHandlersFilteredToBottom) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ExceptionHandler bottom(MinidumpDescriptor(temp_dir.path()),
- NULL,
- DoneCallbackRaiseSIGKILL,
- NULL,
- true,
- -1);
- CrashWithCallbacks(FilterCallbackReturnFalse, NULL, temp_dir.path());
- }
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
-}
-
-TEST(ExceptionHandlerTest, StackedHandlersUnhandledToBottom) {
- AutoTempDir temp_dir;
-
- const pid_t child = fork();
- if (child == 0) {
- ExceptionHandler bottom(MinidumpDescriptor(temp_dir.path()),
- NULL,
- DoneCallbackRaiseSIGKILL,
- NULL,
- true,
- -1);
- CrashWithCallbacks(NULL, DoneCallbackReturnFalse, temp_dir.path());
- }
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGKILL));
-}
-
-#endif // !ADDRESS_SANITIZER
-
-const unsigned char kIllegalInstruction[] = {
-#if defined(__mips__)
- // mfc2 zero,Impl - usually illegal in userspace.
- 0x48, 0x00, 0x00, 0x48
-#else
- // This crashes with SIGILL on x86/x86-64/arm.
- 0xff, 0xff, 0xff, 0xff
-#endif
-};
-
-// Test that memory around the instruction pointer is written
-// to the dump as a MinidumpMemoryRegion.
-TEST(ExceptionHandlerTest, InstructionPointerMemory) {
- AutoTempDir temp_dir;
- int fds[2];
- ASSERT_NE(pipe(fds), -1);
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t kMemorySize = 256; // bytes
- const int kOffset = kMemorySize / 2;
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[0]);
- ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL,
- DoneCallback, reinterpret_cast<void*>(fds[1]),
- true, -1);
- // Get some executable memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- if (!memory)
- exit(0);
-
- // Write some instructions that will crash. Put them in the middle
- // of the block of memory, because the minidump should contain 128
- // bytes on either side of the instruction pointer.
- memcpy(memory + kOffset, kIllegalInstruction, sizeof(kIllegalInstruction));
- FlushInstructionCache(memory, kMemorySize);
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- memory_function();
- }
- close(fds[1]);
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGILL));
-
- string minidump_path;
- ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
-
- struct stat st;
- ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- Minidump minidump(minidump_path);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_LT(0U, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemorySize, region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t prefix_bytes[kOffset];
- uint8_t suffix_bytes[kMemorySize - kOffset - sizeof(kIllegalInstruction)];
- memset(prefix_bytes, 0, sizeof(prefix_bytes));
- memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset, kIllegalInstruction,
- sizeof(kIllegalInstruction)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(kIllegalInstruction),
- suffix_bytes, sizeof(suffix_bytes)) == 0);
-
- unlink(minidump_path.c_str());
-}
-
-// Test that the memory region around the instruction pointer is
-// bounded correctly on the low end.
-TEST(ExceptionHandlerTest, InstructionPointerMemoryMinBound) {
- AutoTempDir temp_dir;
- int fds[2];
- ASSERT_NE(pipe(fds), -1);
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t kMemorySize = 256; // bytes
- const int kOffset = 0;
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[0]);
- ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL,
- DoneCallback, reinterpret_cast<void*>(fds[1]),
- true, -1);
- // Get some executable memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- if (!memory)
- exit(0);
-
- // Write some instructions that will crash. Put them in the middle
- // of the block of memory, because the minidump should contain 128
- // bytes on either side of the instruction pointer.
- memcpy(memory + kOffset, kIllegalInstruction, sizeof(kIllegalInstruction));
- FlushInstructionCache(memory, kMemorySize);
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- memory_function();
- }
- close(fds[1]);
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGILL));
-
- string minidump_path;
- ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
-
- struct stat st;
- ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- Minidump minidump(minidump_path);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_LT(0U, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemorySize / 2, region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t suffix_bytes[kMemorySize / 2 - sizeof(kIllegalInstruction)];
- memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_TRUE(memcmp(bytes + kOffset, kIllegalInstruction,
- sizeof(kIllegalInstruction)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(kIllegalInstruction),
- suffix_bytes, sizeof(suffix_bytes)) == 0);
- unlink(minidump_path.c_str());
-}
-
-// Test that the memory region around the instruction pointer is
-// bounded correctly on the high end.
-TEST(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- AutoTempDir temp_dir;
- int fds[2];
- ASSERT_NE(pipe(fds), -1);
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- // Use 4k here because the OS will hand out a single page even
- // if a smaller size is requested, and this test wants to
- // test the upper bound of the memory range.
- const uint32_t kMemorySize = 4096; // bytes
- const int kOffset = kMemorySize - sizeof(kIllegalInstruction);
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[0]);
- ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL,
- DoneCallback, reinterpret_cast<void*>(fds[1]),
- true, -1);
- // Get some executable memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- if (!memory)
- exit(0);
-
- // Write some instructions that will crash. Put them in the middle
- // of the block of memory, because the minidump should contain 128
- // bytes on either side of the instruction pointer.
- memcpy(memory + kOffset, kIllegalInstruction, sizeof(kIllegalInstruction));
- FlushInstructionCache(memory, kMemorySize);
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- memory_function();
- }
- close(fds[1]);
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGILL));
-
- string minidump_path;
- ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
-
- struct stat st;
- ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- // Read the minidump. Locate the exception record and the memory list, and
- // then ensure that there is a memory region in the memory list that covers
- // the instruction pointer from the exception record.
- Minidump minidump(minidump_path);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_LT(0U, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- ASSERT_TRUE(region);
-
- const size_t kPrefixSize = 128; // bytes
- EXPECT_EQ(kPrefixSize + sizeof(kIllegalInstruction), region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t prefix_bytes[kPrefixSize];
- memset(prefix_bytes, 0, sizeof(prefix_bytes));
- EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
- EXPECT_TRUE(memcmp(bytes + kPrefixSize,
- kIllegalInstruction, sizeof(kIllegalInstruction)) == 0);
-
- unlink(minidump_path.c_str());
-}
-
-#ifndef ADDRESS_SANITIZER
-
-// Ensure that an extra memory block doesn't get added when the instruction
-// pointer is not in mapped memory.
-TEST(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) {
- AutoTempDir temp_dir;
- int fds[2];
- ASSERT_NE(pipe(fds), -1);
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[0]);
- ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL,
- DoneCallback, reinterpret_cast<void*>(fds[1]),
- true, -1);
- // Try calling a NULL pointer.
- typedef void (*void_function)(void);
- // Volatile markings are needed to keep Clang from generating invalid
- // opcodes. See http://crbug.com/498354 for details.
- volatile void_function memory_function =
- reinterpret_cast<void_function>(NULL);
- memory_function();
- // not reached
- exit(1);
- }
- close(fds[1]);
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-
- string minidump_path;
- ASSERT_NO_FATAL_FAILURE(ReadMinidumpPathFromPipe(fds[0], &minidump_path));
-
- struct stat st;
- ASSERT_EQ(0, stat(minidump_path.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- Minidump minidump(minidump_path);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_EQ(static_cast<unsigned int>(1), memory_list->region_count());
-
- unlink(minidump_path.c_str());
-}
-
-#endif // !ADDRESS_SANITIZER
-
-// Test that anonymous memory maps can be annotated with names and IDs.
-TEST(ExceptionHandlerTest, ModuleInfo) {
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t kMemorySize = sysconf(_SC_PAGESIZE);
- const char* kMemoryName = "a fake module";
- const uint8_t kModuleGUID[sizeof(MDGUID)] = {
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
- };
- const string module_identifier = "33221100554477668899AABBCCDDEEFF0";
-
- // Get some memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- AutoTempDir temp_dir;
- ExceptionHandler handler(
- MinidumpDescriptor(temp_dir.path()), NULL, NULL, NULL, true, -1);
-
- // Add info about the anonymous memory mapping.
- handler.AddMappingInfo(kMemoryName,
- kModuleGUID,
- kMemoryAddress,
- kMemorySize,
- 0);
- ASSERT_TRUE(handler.WriteMinidump());
-
- const MinidumpDescriptor& minidump_desc = handler.minidump_descriptor();
- // Read the minidump. Load the module list, and ensure that the mmap'ed
- // |memory| is listed with the given module name and debug ID.
- Minidump minidump(minidump_desc.path());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* module =
- module_list->GetModuleForAddress(kMemoryAddress);
- ASSERT_TRUE(module);
-
- EXPECT_EQ(kMemoryAddress, module->base_address());
- EXPECT_EQ(kMemorySize, module->size());
- EXPECT_EQ(kMemoryName, module->code_file());
- EXPECT_EQ(module_identifier, module->debug_identifier());
-
- unlink(minidump_desc.path());
-}
-
-#ifndef ADDRESS_SANITIZER
-
-static const unsigned kControlMsgSize =
- CMSG_SPACE(sizeof(int)) + CMSG_SPACE(sizeof(struct ucred));
-
-static bool
-CrashHandler(const void* crash_context, size_t crash_context_size,
- void* context) {
- const int fd = (intptr_t) context;
- int fds[2];
- if (pipe(fds) == -1) {
- // There doesn't seem to be any way to reliably handle
- // this failure without the parent process hanging
- // At least make sure that this process doesn't access
- // unexpected file descriptors
- fds[0] = -1;
- fds[1] = -1;
- }
- struct kernel_msghdr msg = {0};
- struct kernel_iovec iov;
- iov.iov_base = const_cast<void*>(crash_context);
- iov.iov_len = crash_context_size;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- char cmsg[kControlMsgSize];
- memset(cmsg, 0, kControlMsgSize);
- msg.msg_control = cmsg;
- msg.msg_controllen = sizeof(cmsg);
-
- struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg);
- hdr->cmsg_level = SOL_SOCKET;
- hdr->cmsg_type = SCM_RIGHTS;
- hdr->cmsg_len = CMSG_LEN(sizeof(int));
- *((int*) CMSG_DATA(hdr)) = fds[1];
- hdr = CMSG_NXTHDR((struct msghdr*) &msg, hdr);
- hdr->cmsg_level = SOL_SOCKET;
- hdr->cmsg_type = SCM_CREDENTIALS;
- hdr->cmsg_len = CMSG_LEN(sizeof(struct ucred));
- struct ucred *cred = reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
- cred->uid = getuid();
- cred->gid = getgid();
- cred->pid = getpid();
-
- ssize_t ret = HANDLE_EINTR(sys_sendmsg(fd, &msg, 0));
- sys_close(fds[1]);
- if (ret <= 0)
- return false;
-
- char b;
- IGNORE_RET(HANDLE_EINTR(sys_read(fds[0], &b, 1)));
-
- return true;
-}
-
-TEST(ExceptionHandlerTest, ExternalDumper) {
- int fds[2];
- ASSERT_NE(socketpair(AF_UNIX, SOCK_DGRAM, 0, fds), -1);
- static const int on = 1;
- setsockopt(fds[0], SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
- setsockopt(fds[1], SOL_SOCKET, SO_PASSCRED, &on, sizeof(on));
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[0]);
- ExceptionHandler handler(MinidumpDescriptor("/tmp1"), NULL, NULL,
- reinterpret_cast<void*>(fds[1]), true, -1);
- handler.set_crash_handler(CrashHandler);
- DoNullPointerDereference();
- }
- close(fds[1]);
- struct msghdr msg = {0};
- struct iovec iov;
- static const unsigned kCrashContextSize =
- sizeof(ExceptionHandler::CrashContext);
- char context[kCrashContextSize];
- char control[kControlMsgSize];
- iov.iov_base = context;
- iov.iov_len = kCrashContextSize;
- msg.msg_iov = &iov;
- msg.msg_iovlen = 1;
- msg.msg_control = control;
- msg.msg_controllen = kControlMsgSize;
-
- const ssize_t n = HANDLE_EINTR(recvmsg(fds[0], &msg, 0));
- ASSERT_EQ(static_cast<ssize_t>(kCrashContextSize), n);
- ASSERT_EQ(kControlMsgSize, msg.msg_controllen);
- ASSERT_EQ(static_cast<__typeof__(msg.msg_flags)>(0), msg.msg_flags);
- ASSERT_EQ(0, close(fds[0]));
-
- pid_t crashing_pid = -1;
- int signal_fd = -1;
- for (struct cmsghdr *hdr = CMSG_FIRSTHDR(&msg); hdr;
- hdr = CMSG_NXTHDR(&msg, hdr)) {
- if (hdr->cmsg_level != SOL_SOCKET)
- continue;
- if (hdr->cmsg_type == SCM_RIGHTS) {
- const unsigned len = hdr->cmsg_len -
- (((uint8_t*)CMSG_DATA(hdr)) - (uint8_t*)hdr);
- ASSERT_EQ(sizeof(int), len);
- signal_fd = *(reinterpret_cast<int*>(CMSG_DATA(hdr)));
- } else if (hdr->cmsg_type == SCM_CREDENTIALS) {
- const struct ucred *cred =
- reinterpret_cast<struct ucred*>(CMSG_DATA(hdr));
- crashing_pid = cred->pid;
- }
- }
-
- ASSERT_NE(crashing_pid, -1);
- ASSERT_NE(signal_fd, -1);
-
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + "/exception-handler-unittest";
- ASSERT_TRUE(WriteMinidump(templ.c_str(), crashing_pid, context,
- kCrashContextSize));
- static const char b = 0;
- ASSERT_EQ(1, (HANDLE_EINTR(write(signal_fd, &b, 1))));
- ASSERT_EQ(0, close(signal_fd));
-
- ASSERT_NO_FATAL_FAILURE(WaitForProcessToTerminate(child, SIGSEGV));
-
- struct stat st;
- ASSERT_EQ(0, stat(templ.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
- unlink(templ.c_str());
-}
-
-#endif // !ADDRESS_SANITIZER
-
-TEST(ExceptionHandlerTest, WriteMinidumpExceptionStream) {
- AutoTempDir temp_dir;
- ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL, NULL,
- NULL, false, -1);
- ASSERT_TRUE(handler.WriteMinidump());
-
- string minidump_path = handler.minidump_descriptor().path();
-
- // Read the minidump and check the exception stream.
- Minidump minidump(minidump_path);
- ASSERT_TRUE(minidump.Read());
- MinidumpException* exception = minidump.GetException();
- ASSERT_TRUE(exception);
- const MDRawExceptionStream* raw = exception->exception();
- ASSERT_TRUE(raw);
- EXPECT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED,
- raw->exception_record.exception_code);
-}
-
-TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithFD) {
- AutoTempDir temp_dir;
- string path;
- const int fd = CreateTMPFile(temp_dir.path(), &path);
- ExceptionHandler handler(MinidumpDescriptor(fd), NULL, NULL, NULL, false, -1);
- ASSERT_TRUE(handler.WriteMinidump());
- // Check by the size of the data written to the FD that a minidump was
- // generated.
- off_t size = lseek(fd, 0, SEEK_CUR);
- ASSERT_GT(size, 0);
-
- // Generate another minidump.
- ASSERT_TRUE(handler.WriteMinidump());
- size = lseek(fd, 0, SEEK_CUR);
- ASSERT_GT(size, 0);
-}
-
-TEST(ExceptionHandlerTest, GenerateMultipleDumpsWithPath) {
- AutoTempDir temp_dir;
- ExceptionHandler handler(MinidumpDescriptor(temp_dir.path()), NULL, NULL,
- NULL, false, -1);
- ASSERT_TRUE(handler.WriteMinidump());
-
- const MinidumpDescriptor& minidump_1 = handler.minidump_descriptor();
- struct stat st;
- ASSERT_EQ(0, stat(minidump_1.path(), &st));
- ASSERT_GT(st.st_size, 0);
- string minidump_1_path(minidump_1.path());
- // Check it is a valid minidump.
- Minidump minidump1(minidump_1_path);
- ASSERT_TRUE(minidump1.Read());
- unlink(minidump_1.path());
-
- // Generate another minidump, it should go to a different file.
- ASSERT_TRUE(handler.WriteMinidump());
- const MinidumpDescriptor& minidump_2 = handler.minidump_descriptor();
- ASSERT_EQ(0, stat(minidump_2.path(), &st));
- ASSERT_GT(st.st_size, 0);
- string minidump_2_path(minidump_2.path());
- // Check it is a valid minidump.
- Minidump minidump2(minidump_2_path);
- ASSERT_TRUE(minidump2.Read());
- unlink(minidump_2.path());
-
- // 2 distinct files should be produced.
- ASSERT_STRNE(minidump_1_path.c_str(), minidump_2_path.c_str());
-}
-
-// Test that an additional memory region can be added to the minidump.
-TEST(ExceptionHandlerTest, AdditionalMemory) {
- const uint32_t kMemorySize = sysconf(_SC_PAGESIZE);
-
- // Get some heap memory.
- uint8_t* memory = new uint8_t[kMemorySize];
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- // Stick some data into the memory so the contents can be verified.
- for (uint32_t i = 0; i < kMemorySize; ++i) {
- memory[i] = i % 255;
- }
-
- AutoTempDir temp_dir;
- ExceptionHandler handler(
- MinidumpDescriptor(temp_dir.path()), NULL, NULL, NULL, true, -1);
-
- // Add the memory region to the list of memory to be included.
- handler.RegisterAppMemory(memory, kMemorySize);
- handler.WriteMinidump();
-
- const MinidumpDescriptor& minidump_desc = handler.minidump_descriptor();
-
- // Read the minidump. Ensure that the memory region is present
- Minidump minidump(minidump_desc.path());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpMemoryList* dump_memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(dump_memory_list);
- const MinidumpMemoryRegion* region =
- dump_memory_list->GetMemoryRegionForAddress(kMemoryAddress);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemoryAddress, region->GetBase());
- EXPECT_EQ(kMemorySize, region->GetSize());
-
- // Verify memory contents.
- EXPECT_EQ(0, memcmp(region->GetMemory(), memory, kMemorySize));
-
- delete[] memory;
-}
-
-// Test that a memory region that was previously registered
-// can be unregistered.
-TEST(ExceptionHandlerTest, AdditionalMemoryRemove) {
- const uint32_t kMemorySize = sysconf(_SC_PAGESIZE);
-
- // Get some heap memory.
- uint8_t* memory = new uint8_t[kMemorySize];
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- AutoTempDir temp_dir;
- ExceptionHandler handler(
- MinidumpDescriptor(temp_dir.path()), NULL, NULL, NULL, true, -1);
-
- // Add the memory region to the list of memory to be included.
- handler.RegisterAppMemory(memory, kMemorySize);
-
- // ...and then remove it
- handler.UnregisterAppMemory(memory);
- handler.WriteMinidump();
-
- const MinidumpDescriptor& minidump_desc = handler.minidump_descriptor();
-
- // Read the minidump. Ensure that the memory region is not present.
- Minidump minidump(minidump_desc.path());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpMemoryList* dump_memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(dump_memory_list);
- const MinidumpMemoryRegion* region =
- dump_memory_list->GetMemoryRegionForAddress(kMemoryAddress);
- EXPECT_FALSE(region);
-
- delete[] memory;
-}
-
-static bool SimpleCallback(const MinidumpDescriptor& descriptor,
- void* context,
- bool succeeded) {
- string* filename = reinterpret_cast<string*>(context);
- *filename = descriptor.path();
- return true;
-}
-
-TEST(ExceptionHandlerTest, WriteMinidumpForChild) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- AutoTempDir temp_dir;
- string minidump_filename;
- ASSERT_TRUE(
- ExceptionHandler::WriteMinidumpForChild(child, child,
- temp_dir.path(), SimpleCallback,
- (void*)&minidump_filename));
-
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
- // Check that the crashing thread is the main thread of |child|
- MinidumpException* exception = minidump.GetException();
- ASSERT_TRUE(exception);
- uint32_t thread_id;
- ASSERT_TRUE(exception->GetThreadID(&thread_id));
- EXPECT_EQ(child, static_cast<int32_t>(thread_id));
-
- const MDRawExceptionStream* raw = exception->exception();
- ASSERT_TRUE(raw);
- EXPECT_EQ(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED,
- raw->exception_record.exception_code);
-
- close(fds[1]);
- unlink(minidump_filename.c_str());
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/microdump_extra_info.h b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/microdump_extra_info.h
deleted file mode 100644
index bf01f0c7b1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/microdump_extra_info.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright 2015 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_HANDLER_MICRODUMP_EXTRA_INFO_H_
-#define CLIENT_LINUX_HANDLER_MICRODUMP_EXTRA_INFO_H_
-
-namespace google_breakpad {
-
-struct MicrodumpExtraInfo {
- // Strings pointed to by this struct are not copied, and are
- // expected to remain valid for the lifetime of the process.
- const char* build_fingerprint;
- const char* product_info;
- const char* gpu_fingerprint;
- const char* process_type;
-
- MicrodumpExtraInfo()
- : build_fingerprint(NULL),
- product_info(NULL),
- gpu_fingerprint(NULL),
- process_type(NULL) {}
-};
-
-}
-
-#endif // CLIENT_LINUX_HANDLER_MICRODUMP_EXTRA_INFO_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc
deleted file mode 100644
index ce09153ddb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2012 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdio.h>
-
-#include "client/linux/handler/minidump_descriptor.h"
-
-#include "common/linux/guid_creator.h"
-
-namespace google_breakpad {
-
-//static
-const MinidumpDescriptor::MicrodumpOnConsole
- MinidumpDescriptor::kMicrodumpOnConsole = {};
-
-MinidumpDescriptor::MinidumpDescriptor(const MinidumpDescriptor& descriptor)
- : mode_(descriptor.mode_),
- fd_(descriptor.fd_),
- directory_(descriptor.directory_),
- c_path_(NULL),
- size_limit_(descriptor.size_limit_),
- microdump_extra_info_(descriptor.microdump_extra_info_) {
- // The copy constructor is not allowed to be called on a MinidumpDescriptor
- // with a valid path_, as getting its c_path_ would require the heap which
- // can cause problems in compromised environments.
- assert(descriptor.path_.empty());
-}
-
-MinidumpDescriptor& MinidumpDescriptor::operator=(
- const MinidumpDescriptor& descriptor) {
- assert(descriptor.path_.empty());
-
- mode_ = descriptor.mode_;
- fd_ = descriptor.fd_;
- directory_ = descriptor.directory_;
- path_.clear();
- if (c_path_) {
- // This descriptor already had a path set, so generate a new one.
- c_path_ = NULL;
- UpdatePath();
- }
- size_limit_ = descriptor.size_limit_;
- microdump_extra_info_ = descriptor.microdump_extra_info_;
- return *this;
-}
-
-void MinidumpDescriptor::UpdatePath() {
- assert(mode_ == kWriteMinidumpToFile && !directory_.empty());
-
- GUID guid;
- char guid_str[kGUIDStringLength + 1];
- if (!CreateGUID(&guid) || !GUIDToString(&guid, guid_str, sizeof(guid_str))) {
- assert(false);
- }
-
- path_.clear();
- path_ = directory_ + "/" + guid_str + ".dmp";
- c_path_ = path_.c_str();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h
deleted file mode 100644
index 782a60a4e7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_descriptor.h
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright (c) 2012 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
-#define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
-
-#include <assert.h>
-#include <sys/types.h>
-
-#include <string>
-
-#include "client/linux/handler/microdump_extra_info.h"
-#include "common/using_std_string.h"
-
-// This class describes how a crash dump should be generated, either:
-// - Writing a full minidump to a file in a given directory (the actual path,
-// inside the directory, is determined by this class).
-// - Writing a full minidump to a given fd.
-// - Writing a reduced microdump to the console (logcat on Android).
-namespace google_breakpad {
-
-class MinidumpDescriptor {
- public:
- struct MicrodumpOnConsole {};
- static const MicrodumpOnConsole kMicrodumpOnConsole;
-
- MinidumpDescriptor()
- : mode_(kUninitialized),
- fd_(-1),
- size_limit_(-1) {}
-
- explicit MinidumpDescriptor(const string& directory)
- : mode_(kWriteMinidumpToFile),
- fd_(-1),
- directory_(directory),
- c_path_(NULL),
- size_limit_(-1) {
- assert(!directory.empty());
- }
-
- explicit MinidumpDescriptor(int fd)
- : mode_(kWriteMinidumpToFd),
- fd_(fd),
- c_path_(NULL),
- size_limit_(-1) {
- assert(fd != -1);
- }
-
- explicit MinidumpDescriptor(const MicrodumpOnConsole&)
- : mode_(kWriteMicrodumpToConsole),
- fd_(-1),
- size_limit_(-1) {}
-
- explicit MinidumpDescriptor(const MinidumpDescriptor& descriptor);
- MinidumpDescriptor& operator=(const MinidumpDescriptor& descriptor);
-
- static MinidumpDescriptor getMicrodumpDescriptor();
-
- bool IsFD() const { return mode_ == kWriteMinidumpToFd; }
-
- int fd() const { return fd_; }
-
- string directory() const { return directory_; }
-
- const char* path() const { return c_path_; }
-
- bool IsMicrodumpOnConsole() const {
- return mode_ == kWriteMicrodumpToConsole;
- }
-
- // Updates the path so it is unique.
- // Should be called from a normal context: this methods uses the heap.
- void UpdatePath();
-
- off_t size_limit() const { return size_limit_; }
- void set_size_limit(off_t limit) { size_limit_ = limit; }
-
- MicrodumpExtraInfo* microdump_extra_info() {
- assert(IsMicrodumpOnConsole());
- return &microdump_extra_info_;
- };
-
- private:
- enum DumpMode {
- kUninitialized = 0,
- kWriteMinidumpToFile,
- kWriteMinidumpToFd,
- kWriteMicrodumpToConsole
- };
-
- // Specifies the dump mode (see DumpMode).
- DumpMode mode_;
-
- // The file descriptor where the minidump is generated.
- int fd_;
-
- // The directory where the minidump should be generated.
- string directory_;
-
- // The full path to the generated minidump.
- string path_;
-
- // The C string of |path_|. Precomputed so it can be access from a compromised
- // context.
- const char* c_path_;
-
- off_t size_limit_;
-
- // The extra microdump data (e.g. product name/version, build
- // fingerprint, gpu fingerprint) that should be appended to the dump
- // (microdump only). Microdumps don't have the ability of appending
- // extra metadata after the dump is generated (as opposite to
- // minidumps MIME fields), therefore the extra data must be provided
- // upfront. Any memory pointed to by members of the
- // MicrodumpExtraInfo struct must be valid for the lifetime of the
- // process (read: the caller has to guarantee that it is stored in
- // global static storage.)
- MicrodumpExtraInfo microdump_extra_info_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/log/log.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/log/log.cc
deleted file mode 100644
index fc23aa6d52..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/log/log.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2012 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/linux/log/log.h"
-
-#if defined(__ANDROID__)
-#include <android/log.h>
-#include <dlfcn.h>
-#else
-#include "third_party/lss/linux_syscall_support.h"
-#endif
-
-namespace logger {
-
-#if defined(__ANDROID__)
-namespace {
-
-// __android_log_buf_write() is not exported in the NDK and is being used by
-// dynamic runtime linking. Its declaration is taken from Android's
-// system/core/include/log/log.h.
-using AndroidLogBufferWriteFunc = int (*)(int bufID, int prio, const char *tag,
- const char *text);
-const int kAndroidCrashLogId = 4; // From LOG_ID_CRASH in log.h.
-const char kAndroidLogTag[] = "google-breakpad";
-
-bool g_crash_log_initialized = false;
-AndroidLogBufferWriteFunc g_android_log_buf_write = nullptr;
-
-} // namespace
-
-void initializeCrashLogWriter() {
- if (g_crash_log_initialized)
- return;
- g_android_log_buf_write = reinterpret_cast<AndroidLogBufferWriteFunc>(
- dlsym(RTLD_DEFAULT, "__android_log_buf_write"));
- g_crash_log_initialized = true;
-}
-
-int writeToCrashLog(const char* buf) {
- // Try writing to the crash log ring buffer. If not available, fall back to
- // the standard log buffer.
- if (g_android_log_buf_write) {
- return g_android_log_buf_write(kAndroidCrashLogId, ANDROID_LOG_FATAL,
- kAndroidLogTag, buf);
- }
- return __android_log_write(ANDROID_LOG_FATAL, kAndroidLogTag, buf);
-}
-#endif
-
-int write(const char* buf, size_t nbytes) {
-#if defined(__ANDROID__)
- return __android_log_write(ANDROID_LOG_WARN, kAndroidLogTag, buf);
-#else
- return sys_write(2, buf, nbytes);
-#endif
-}
-
-} // namespace logger
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/log/log.h b/toolkit/crashreporter/google-breakpad/src/client/linux/log/log.h
deleted file mode 100644
index f94bbd5fb7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/log/log.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_LOG_LOG_H_
-#define CLIENT_LINUX_LOG_LOG_H_
-
-#include <stddef.h>
-
-namespace logger {
-
-int write(const char* buf, size_t nbytes);
-
-// In the case of Android the log can be written to the default system log
-// (default behavior of write() above, or to the crash log (see
-// writeToCrashLog() below).
-#if defined(__ANDROID__)
-
-// The logger must be initialized in a non-compromised context.
-void initializeCrashLogWriter();
-
-// Once initialized, writeToCrashLog is safe to use in a compromised context,
-// even if the initialization failed, in which case this will silently fall
-// back on write().
-int writeToCrashLog(const char* buf);
-#endif
-
-} // namespace logger
-
-#endif // CLIENT_LINUX_LOG_LOG_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc
deleted file mode 100644
index a508667a06..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.cc
+++ /dev/null
@@ -1,609 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This translation unit generates microdumps into the console (logcat on
-// Android). See crbug.com/410294 for more info and design docs.
-
-#include "client/linux/microdump_writer/microdump_writer.h"
-
-#include <limits>
-
-#include <sys/utsname.h>
-
-#include "client/linux/dump_writer_common/thread_info.h"
-#include "client/linux/dump_writer_common/ucontext_reader.h"
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/handler/microdump_extra_info.h"
-#include "client/linux/log/log.h"
-#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
-#include "common/linux/file_id.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/memory.h"
-
-namespace {
-
-using google_breakpad::auto_wasteful_vector;
-using google_breakpad::ExceptionHandler;
-using google_breakpad::kDefaultBuildIdSize;
-using google_breakpad::LinuxDumper;
-using google_breakpad::LinuxPtraceDumper;
-using google_breakpad::MappingInfo;
-using google_breakpad::MappingList;
-using google_breakpad::MicrodumpExtraInfo;
-using google_breakpad::RawContextCPU;
-using google_breakpad::ThreadInfo;
-using google_breakpad::UContextReader;
-
-const size_t kLineBufferSize = 2048;
-
-#if !defined(__LP64__)
-// The following are only used by DumpFreeSpace, so need to be compiled
-// in conditionally in the same way.
-
-template <typename Dst, typename Src>
-Dst saturated_cast(Src src) {
- if (src >= std::numeric_limits<Dst>::max())
- return std::numeric_limits<Dst>::max();
- if (src <= std::numeric_limits<Dst>::min())
- return std::numeric_limits<Dst>::min();
- return static_cast<Dst>(src);
-}
-
-int Log2Floor(uint64_t n) {
- // Copied from chromium src/base/bits.h
- if (n == 0)
- return -1;
- int log = 0;
- uint64_t value = n;
- for (int i = 5; i >= 0; --i) {
- int shift = (1 << i);
- uint64_t x = value >> shift;
- if (x != 0) {
- value = x;
- log += shift;
- }
- }
- assert(value == 1u);
- return log;
-}
-
-bool MappingsAreAdjacent(const MappingInfo& a, const MappingInfo& b) {
- // Because of load biasing, we can end up with a situation where two
- // mappings actually overlap. So we will define adjacency to also include a
- // b start address that lies within a's address range (including starting
- // immediately after a).
- // Because load biasing only ever moves the start address backwards, the end
- // address should still increase.
- return a.start_addr <= b.start_addr && a.start_addr + a.size >= b.start_addr;
-}
-
-bool MappingLessThan(const MappingInfo* a, const MappingInfo* b) {
- // Return true if mapping a is before mapping b.
- // For the same reason (load biasing) we compare end addresses, which - unlike
- // start addresses - will not have been modified.
- return a->start_addr + a->size < b->start_addr + b->size;
-}
-
-size_t NextOrderedMapping(
- const google_breakpad::wasteful_vector<MappingInfo*>& mappings,
- size_t curr) {
- // Find the mapping that directly follows mappings[curr].
- // If no such mapping exists, return |invalid| to indicate this.
- const size_t invalid = std::numeric_limits<size_t>::max();
- size_t best = invalid;
- for (size_t next = 0; next < mappings.size(); ++next) {
- if (MappingLessThan(mappings[curr], mappings[next]) &&
- (best == invalid || MappingLessThan(mappings[next], mappings[best]))) {
- best = next;
- }
- }
- return best;
-}
-
-#endif // !__LP64__
-
-class MicrodumpWriter {
- public:
- MicrodumpWriter(const ExceptionHandler::CrashContext* context,
- const MappingList& mappings,
- const MicrodumpExtraInfo& microdump_extra_info,
- LinuxDumper* dumper)
- : ucontext_(context ? &context->context : NULL),
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- float_state_(context ? &context->float_state : NULL),
-#endif
- dumper_(dumper),
- mapping_list_(mappings),
- microdump_extra_info_(microdump_extra_info),
- log_line_(NULL) {
- log_line_ = reinterpret_cast<char*>(Alloc(kLineBufferSize));
- if (log_line_)
- log_line_[0] = '\0'; // Clear out the log line buffer.
- }
-
- ~MicrodumpWriter() { dumper_->ThreadsResume(); }
-
- bool Init() {
- // In the exceptional case where the system was out of memory and there
- // wasn't even room to allocate the line buffer, bail out. There is nothing
- // useful we can possibly achieve without the ability to Log. At least let's
- // try to not crash.
- if (!dumper_->Init() || !log_line_)
- return false;
- return dumper_->ThreadsSuspend() && dumper_->LateInit();
- }
-
- bool Dump() {
- bool success;
- LogLine("-----BEGIN BREAKPAD MICRODUMP-----");
- DumpProductInformation();
- DumpOSInformation();
- DumpProcessType();
- DumpGPUInformation();
-#if !defined(__LP64__)
- DumpFreeSpace();
-#endif
- success = DumpCrashingThread();
- if (success)
- success = DumpMappings();
- LogLine("-----END BREAKPAD MICRODUMP-----");
- dumper_->ThreadsResume();
- return success;
- }
-
- private:
- // Writes one line to the system log.
- void LogLine(const char* msg) {
-#if defined(__ANDROID__)
- logger::writeToCrashLog(msg);
-#else
- logger::write(msg, my_strlen(msg));
- logger::write("\n", 1);
-#endif
- }
-
- // Stages the given string in the current line buffer.
- void LogAppend(const char* str) {
- my_strlcat(log_line_, str, kLineBufferSize);
- }
-
- // As above (required to take precedence over template specialization below).
- void LogAppend(char* str) {
- LogAppend(const_cast<const char*>(str));
- }
-
- // Stages the hex repr. of the given int type in the current line buffer.
- template<typename T>
- void LogAppend(T value) {
- // Make enough room to hex encode the largest int type + NUL.
- static const char HEX[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
- 'A', 'B', 'C', 'D', 'E', 'F'};
- char hexstr[sizeof(T) * 2 + 1];
- for (int i = sizeof(T) * 2 - 1; i >= 0; --i, value >>= 4)
- hexstr[i] = HEX[static_cast<uint8_t>(value) & 0x0F];
- hexstr[sizeof(T) * 2] = '\0';
- LogAppend(hexstr);
- }
-
- // Stages the buffer content hex-encoded in the current line buffer.
- void LogAppend(const void* buf, size_t length) {
- const uint8_t* ptr = reinterpret_cast<const uint8_t*>(buf);
- for (size_t i = 0; i < length; ++i, ++ptr)
- LogAppend(*ptr);
- }
-
- // Writes out the current line buffer on the system log.
- void LogCommitLine() {
- LogLine(log_line_);
- my_strlcpy(log_line_, "", kLineBufferSize);
- }
-
- void DumpProductInformation() {
- LogAppend("V ");
- if (microdump_extra_info_.product_info) {
- LogAppend(microdump_extra_info_.product_info);
- } else {
- LogAppend("UNKNOWN:0.0.0.0");
- }
- LogCommitLine();
- }
-
- void DumpProcessType() {
- LogAppend("P ");
- if (microdump_extra_info_.process_type) {
- LogAppend(microdump_extra_info_.process_type);
- } else {
- LogAppend("UNKNOWN");
- }
- LogCommitLine();
- }
-
- void DumpOSInformation() {
- const uint8_t n_cpus = static_cast<uint8_t>(sysconf(_SC_NPROCESSORS_CONF));
-
-#if defined(__ANDROID__)
- const char kOSId[] = "A";
-#else
- const char kOSId[] = "L";
-#endif
-
-// Dump the runtime architecture. On multiarch devices it might not match the
-// hw architecture (the one returned by uname()), for instance in the case of
-// a 32-bit app running on a aarch64 device.
-#if defined(__aarch64__)
- const char kArch[] = "arm64";
-#elif defined(__ARMEL__)
- const char kArch[] = "arm";
-#elif defined(__x86_64__)
- const char kArch[] = "x86_64";
-#elif defined(__i386__)
- const char kArch[] = "x86";
-#elif defined(__mips__)
-# if _MIPS_SIM == _ABIO32
- const char kArch[] = "mips";
-# elif _MIPS_SIM == _ABI64
- const char kArch[] = "mips64";
-# else
-# error "This mips ABI is currently not supported (n32)"
-#endif
-#else
-#error "This code has not been ported to your platform yet"
-#endif
-
- LogAppend("O ");
- LogAppend(kOSId);
- LogAppend(" ");
- LogAppend(kArch);
- LogAppend(" ");
- LogAppend(n_cpus);
- LogAppend(" ");
-
- // Dump the HW architecture (e.g., armv7l, aarch64).
- struct utsname uts;
- const bool has_uts_info = (uname(&uts) == 0);
- const char* hwArch = has_uts_info ? uts.machine : "unknown_hw_arch";
- LogAppend(hwArch);
- LogAppend(" ");
-
- // If the client has attached a build fingerprint to the MinidumpDescriptor
- // use that one. Otherwise try to get some basic info from uname().
- if (microdump_extra_info_.build_fingerprint) {
- LogAppend(microdump_extra_info_.build_fingerprint);
- } else if (has_uts_info) {
- LogAppend(uts.release);
- LogAppend(" ");
- LogAppend(uts.version);
- } else {
- LogAppend("no build fingerprint available");
- }
- LogCommitLine();
- }
-
- void DumpGPUInformation() {
- LogAppend("G ");
- if (microdump_extra_info_.gpu_fingerprint) {
- LogAppend(microdump_extra_info_.gpu_fingerprint);
- } else {
- LogAppend("UNKNOWN");
- }
- LogCommitLine();
- }
-
- bool DumpThreadStack(uint32_t thread_id,
- uintptr_t stack_pointer,
- int max_stack_len,
- uint8_t** stack_copy) {
- *stack_copy = NULL;
- const void* stack;
- size_t stack_len;
-
- if (!dumper_->GetStackInfo(&stack, &stack_len, stack_pointer)) {
- // The stack pointer might not be available. In this case we don't hard
- // fail, just produce a (almost useless) microdump w/o a stack section.
- return true;
- }
-
- LogAppend("S 0 ");
- LogAppend(stack_pointer);
- LogAppend(" ");
- LogAppend(reinterpret_cast<uintptr_t>(stack));
- LogAppend(" ");
- LogAppend(stack_len);
- LogCommitLine();
-
- if (max_stack_len >= 0 &&
- stack_len > static_cast<unsigned int>(max_stack_len)) {
- stack_len = max_stack_len;
- }
-
- *stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
- dumper_->CopyFromProcess(*stack_copy, thread_id, stack, stack_len);
-
- // Dump the content of the stack, splicing it into chunks which size is
- // compatible with the max logcat line size (see LOGGER_ENTRY_MAX_PAYLOAD).
- const size_t STACK_DUMP_CHUNK_SIZE = 384;
- for (size_t stack_off = 0; stack_off < stack_len;
- stack_off += STACK_DUMP_CHUNK_SIZE) {
- LogAppend("S ");
- LogAppend(reinterpret_cast<uintptr_t>(stack) + stack_off);
- LogAppend(" ");
- LogAppend(*stack_copy + stack_off,
- std::min(STACK_DUMP_CHUNK_SIZE, stack_len - stack_off));
- LogCommitLine();
- }
- return true;
- }
-
- // Write information about the crashing thread.
- bool DumpCrashingThread() {
- const unsigned num_threads = dumper_->threads().size();
-
- for (unsigned i = 0; i < num_threads; ++i) {
- MDRawThread thread;
- my_memset(&thread, 0, sizeof(thread));
- thread.thread_id = dumper_->threads()[i];
-
- // Dump only the crashing thread.
- if (static_cast<pid_t>(thread.thread_id) != dumper_->crash_thread())
- continue;
-
- assert(ucontext_);
- assert(!dumper_->IsPostMortem());
-
- uint8_t* stack_copy;
- const uintptr_t stack_ptr = UContextReader::GetStackPointer(ucontext_);
- if (!DumpThreadStack(thread.thread_id, stack_ptr, -1, &stack_copy))
- return false;
-
- RawContextCPU cpu;
- my_memset(&cpu, 0, sizeof(RawContextCPU));
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- UContextReader::FillCPUContext(&cpu, ucontext_, float_state_);
-#else
- UContextReader::FillCPUContext(&cpu, ucontext_);
-#endif
- DumpCPUState(&cpu);
- }
- return true;
- }
-
- void DumpCPUState(RawContextCPU* cpu) {
- LogAppend("C ");
- LogAppend(cpu, sizeof(*cpu));
- LogCommitLine();
- }
-
- // If there is caller-provided information about this mapping
- // in the mapping_list_ list, return true. Otherwise, return false.
- bool HaveMappingInfo(const MappingInfo& mapping) {
- for (MappingList::const_iterator iter = mapping_list_.begin();
- iter != mapping_list_.end();
- ++iter) {
- // Ignore any mappings that are wholly contained within
- // mappings in the mapping_info_ list.
- if (mapping.start_addr >= iter->first.start_addr &&
- (mapping.start_addr + mapping.size) <=
- (iter->first.start_addr + iter->first.size)) {
- return true;
- }
- }
- return false;
- }
-
- // Dump information about the provided |mapping|. If |identifier| is non-NULL,
- // use it instead of calculating a file ID from the mapping.
- void DumpModule(const MappingInfo& mapping,
- bool member,
- unsigned int mapping_id,
- const uint8_t* identifier) {
-
- auto_wasteful_vector<uint8_t, kDefaultBuildIdSize> identifier_bytes(
- dumper_->allocator());
-
- if (identifier) {
- // GUID was provided by caller.
- identifier_bytes.insert(identifier_bytes.end(),
- identifier,
- identifier + sizeof(MDGUID));
- } else {
- dumper_->ElfFileIdentifierForMapping(
- mapping,
- member,
- mapping_id,
- identifier_bytes);
- }
-
- // Copy as many bytes of |identifier| as will fit into a MDGUID
- MDGUID module_identifier = {0};
- memcpy(&module_identifier, &identifier_bytes[0],
- std::min(sizeof(MDGUID), identifier_bytes.size()));
-
- char file_name[NAME_MAX];
- char file_path[NAME_MAX];
- dumper_->GetMappingEffectiveNameAndPath(
- mapping, file_path, sizeof(file_path), file_name, sizeof(file_name));
-
- LogAppend("M ");
- LogAppend(static_cast<uintptr_t>(mapping.start_addr));
- LogAppend(" ");
- LogAppend(mapping.offset);
- LogAppend(" ");
- LogAppend(mapping.size);
- LogAppend(" ");
- LogAppend(module_identifier.data1);
- LogAppend(module_identifier.data2);
- LogAppend(module_identifier.data3);
- LogAppend(module_identifier.data4[0]);
- LogAppend(module_identifier.data4[1]);
- LogAppend(module_identifier.data4[2]);
- LogAppend(module_identifier.data4[3]);
- LogAppend(module_identifier.data4[4]);
- LogAppend(module_identifier.data4[5]);
- LogAppend(module_identifier.data4[6]);
- LogAppend(module_identifier.data4[7]);
- LogAppend("0 "); // Age is always 0 on Linux.
- LogAppend(file_name);
- LogCommitLine();
- }
-
-#if !defined(__LP64__)
- void DumpFreeSpace() {
- const google_breakpad::wasteful_vector<MappingInfo*>& mappings =
- dumper_->mappings();
- if (mappings.size() == 0) return;
-
- // This is complicated by the fact that mappings is not in order. It should
- // be mostly in order, however the mapping that contains the entry point for
- // the process is always at the front of the vector.
-
- static const int HBITS = sizeof(size_t) * 8;
- size_t hole_histogram[HBITS];
- my_memset(hole_histogram, 0, sizeof(hole_histogram));
-
- // Find the lowest address mapping.
- size_t curr = 0;
- for (size_t i = 1; i < mappings.size(); ++i) {
- if (mappings[i]->start_addr < mappings[curr]->start_addr) curr = i;
- }
-
- uintptr_t lo_addr = mappings[curr]->start_addr;
-
- size_t hole_cnt = 0;
- size_t hole_max = 0;
- size_t hole_sum = 0;
-
- while (true) {
- // Skip to the end of an adjacent run of mappings. This is an optimization
- // for the fact that mappings is mostly sorted.
- while (curr != mappings.size() - 1 &&
- MappingsAreAdjacent(*mappings[curr], *mappings[curr + 1])) {
- ++curr;
- }
-
- size_t next = NextOrderedMapping(mappings, curr);
- if (next == std::numeric_limits<size_t>::max())
- break;
-
- uintptr_t hole_lo = mappings[curr]->start_addr + mappings[curr]->size;
- uintptr_t hole_hi = mappings[next]->start_addr;
-
- if (hole_hi > hole_lo) {
- size_t hole_sz = hole_hi - hole_lo;
- hole_sum += hole_sz;
- hole_max = std::max(hole_sz, hole_max);
- ++hole_cnt;
- ++hole_histogram[Log2Floor(hole_sz)];
- }
- curr = next;
- }
-
- uintptr_t hi_addr = mappings[curr]->start_addr + mappings[curr]->size;
-
- LogAppend("H ");
- LogAppend(lo_addr);
- LogAppend(" ");
- LogAppend(hi_addr);
- LogAppend(" ");
- LogAppend(saturated_cast<uint16_t>(hole_cnt));
- LogAppend(" ");
- LogAppend(hole_max);
- LogAppend(" ");
- LogAppend(hole_sum);
- for (unsigned int i = 0; i < HBITS; ++i) {
- if (!hole_histogram[i]) continue;
- LogAppend(" ");
- LogAppend(saturated_cast<uint8_t>(i));
- LogAppend(":");
- LogAppend(saturated_cast<uint8_t>(hole_histogram[i]));
- }
- LogCommitLine();
- }
-#endif
-
- // Write information about the mappings in effect.
- bool DumpMappings() {
- // First write all the mappings from the dumper
- for (unsigned i = 0; i < dumper_->mappings().size(); ++i) {
- const MappingInfo& mapping = *dumper_->mappings()[i];
- if (mapping.name[0] == 0 || // only want modules with filenames.
- !mapping.exec || // only want executable mappings.
- mapping.size < 4096 || // too small to get a signature for.
- HaveMappingInfo(mapping)) {
- continue;
- }
-
- DumpModule(mapping, true, i, NULL);
- }
- // Next write all the mappings provided by the caller
- for (MappingList::const_iterator iter = mapping_list_.begin();
- iter != mapping_list_.end();
- ++iter) {
- DumpModule(iter->first, false, 0, iter->second);
- }
- return true;
- }
-
- void* Alloc(unsigned bytes) { return dumper_->allocator()->Alloc(bytes); }
-
- const ucontext_t* const ucontext_;
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- const google_breakpad::fpstate_t* const float_state_;
-#endif
- LinuxDumper* dumper_;
- const MappingList& mapping_list_;
- const MicrodumpExtraInfo microdump_extra_info_;
- char* log_line_;
-};
-} // namespace
-
-namespace google_breakpad {
-
-bool WriteMicrodump(pid_t crashing_process,
- const void* blob,
- size_t blob_size,
- const MappingList& mappings,
- const MicrodumpExtraInfo& microdump_extra_info) {
- LinuxPtraceDumper dumper(crashing_process);
- const ExceptionHandler::CrashContext* context = NULL;
- if (blob) {
- if (blob_size != sizeof(ExceptionHandler::CrashContext))
- return false;
- context = reinterpret_cast<const ExceptionHandler::CrashContext*>(blob);
- dumper.set_crash_address(
- reinterpret_cast<uintptr_t>(context->siginfo.si_addr));
- dumper.set_crash_signal(context->siginfo.si_signo);
- dumper.set_crash_thread(context->tid);
- }
- MicrodumpWriter writer(context, mappings, microdump_extra_info, &dumper);
- if (!writer.Init())
- return false;
- return writer.Dump();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.h b/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.h
deleted file mode 100644
index 7c742761d7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_MICRODUMP_WRITER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_MICRODUMP_WRITER_H_
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include "client/linux/dump_writer_common/mapping_info.h"
-
-namespace google_breakpad {
-
-struct MicrodumpExtraInfo;
-
-// Writes a microdump (a reduced dump containing only the state of the crashing
-// thread) on the console (logcat on Android). These functions do not malloc nor
-// use libc functions which may. Thus, it can be used in contexts where the
-// state of the heap may be corrupt.
-// Args:
-// crashing_process: the pid of the crashing process. This must be trusted.
-// blob: a blob of data from the crashing process. See exception_handler.h
-// blob_size: the length of |blob| in bytes.
-// mappings: a list of additional mappings provided by the application.
-// build_fingerprint: a (optional) C string which determines the OS
-// build fingerprint (e.g., aosp/occam/mako:5.1.1/LMY47W/1234:eng/dev-keys).
-// product_info: a (optional) C string which determines the product name and
-// version (e.g., WebView:42.0.2311.136).
-//
-// Returns true iff successful.
-bool WriteMicrodump(pid_t crashing_process,
- const void* blob,
- size_t blob_size,
- const MappingList& mappings,
- const MicrodumpExtraInfo& microdump_extra_info);
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_MICRODUMP_WRITER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
deleted file mode 100644
index 58a7311889..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/microdump_writer/microdump_writer_unittest.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (c) 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <ctype.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <sstream>
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/handler/microdump_extra_info.h"
-#include "client/linux/microdump_writer/microdump_writer.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/ignore_ret.h"
-#include "common/scoped_ptr.h"
-#include "common/tests/auto_tempdir.h"
-#include "common/using_std_string.h"
-
-using namespace google_breakpad;
-
-namespace {
-
-typedef testing::Test MicrodumpWriterTest;
-
-MicrodumpExtraInfo MakeMicrodumpExtraInfo(
- const char* build_fingerprint,
- const char* product_info,
- const char* gpu_fingerprint) {
- MicrodumpExtraInfo info;
- info.build_fingerprint = build_fingerprint;
- info.product_info = product_info;
- info.gpu_fingerprint = gpu_fingerprint;
- return info;
-}
-
-void CrashAndGetMicrodump(
- const MappingList& mappings,
- const MicrodumpExtraInfo& microdump_extra_info,
- scoped_array<char>* buf) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- AutoTempDir temp_dir;
- string stderr_file = temp_dir.path() + "/stderr.log";
- int err_fd = open(stderr_file.c_str(), O_CREAT | O_RDWR, S_IRUSR | S_IWUSR);
- ASSERT_NE(-1, err_fd);
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
-
- // Set a non-zero tid to avoid tripping asserts.
- context.tid = child;
-
- // Redirect temporarily stderr to the stderr.log file.
- int save_err = dup(STDERR_FILENO);
- ASSERT_NE(-1, save_err);
- ASSERT_NE(-1, dup2(err_fd, STDERR_FILENO));
-
- ASSERT_TRUE(WriteMicrodump(child, &context, sizeof(context), mappings,
- microdump_extra_info));
-
- // Revert stderr back to the console.
- dup2(save_err, STDERR_FILENO);
- close(save_err);
-
- // Read back the stderr file and check for the microdump marker.
- fsync(err_fd);
- lseek(err_fd, 0, SEEK_SET);
- const size_t kBufSize = 64 * 1024;
- buf->reset(new char[kBufSize]);
- ASSERT_GT(read(err_fd, buf->get(), kBufSize), 0);
-
- close(err_fd);
- close(fds[1]);
-
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf->get(), "-----BEGIN BREAKPAD MICRODUMP-----"));
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf->get(), "-----END BREAKPAD MICRODUMP-----"));
-}
-
-void CheckMicrodumpContents(const string& microdump_content,
- const MicrodumpExtraInfo& expected_info) {
- std::istringstream iss(microdump_content);
- bool did_find_os_info = false;
- bool did_find_product_info = false;
- bool did_find_gpu_info = false;
- for (string line; std::getline(iss, line);) {
- if (line.find("O ") == 0) {
- std::istringstream os_info_tokens(line);
- string token;
- os_info_tokens.ignore(2); // Ignore the "O " preamble.
- // Check the OS descriptor char (L=Linux, A=Android).
- os_info_tokens >> token;
- ASSERT_TRUE(token == "L" || token == "A");
-
- os_info_tokens >> token; // HW architecture.
- os_info_tokens >> token; // Number of cpus.
- for (size_t i = 0; i < token.size(); ++i)
- ASSERT_TRUE(isxdigit(token[i]));
- os_info_tokens >> token; // SW architecture.
-
- // Check that the build fingerprint is in the right place.
- os_info_tokens >> token;
- if (expected_info.build_fingerprint)
- ASSERT_EQ(expected_info.build_fingerprint, token);
- did_find_os_info = true;
- } else if (line.find("V ") == 0) {
- if (expected_info.product_info)
- ASSERT_EQ(string("V ") + expected_info.product_info, line);
- did_find_product_info = true;
- } else if (line.find("G ") == 0) {
- if (expected_info.gpu_fingerprint)
- ASSERT_EQ(string("G ") + expected_info.gpu_fingerprint, line);
- did_find_gpu_info = true;
- }
- }
- ASSERT_TRUE(did_find_os_info);
- ASSERT_TRUE(did_find_product_info);
- ASSERT_TRUE(did_find_gpu_info);
-}
-
-void CheckMicrodumpContents(const string& microdump_content,
- const string& expected_fingerprint,
- const string& expected_product_info,
- const string& expected_gpu_fingerprint) {
- CheckMicrodumpContents(
- microdump_content,
- MakeMicrodumpExtraInfo(expected_fingerprint.c_str(),
- expected_product_info.c_str(),
- expected_gpu_fingerprint.c_str()));
-}
-
-TEST(MicrodumpWriterTest, BasicWithMappings) {
- // Push some extra mapping to check the MappingList logic.
- const uint32_t memory_size = sysconf(_SC_PAGESIZE);
- const char* kMemoryName = "libfoo.so";
- const uint8_t kModuleGUID[sizeof(MDGUID)] = {
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
- };
-
- MappingInfo info;
- info.start_addr = memory_size;
- info.size = memory_size;
- info.offset = 42;
- strcpy(info.name, kMemoryName);
-
- MappingList mappings;
- MappingEntry mapping;
- mapping.first = info;
- memcpy(mapping.second, kModuleGUID, sizeof(MDGUID));
- mappings.push_back(mapping);
-
- scoped_array<char> buf;
- CrashAndGetMicrodump(mappings, MicrodumpExtraInfo(), &buf);
-
-#ifdef __LP64__
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "M 0000000000001000 000000000000002A 0000000000001000 "
- "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-#else
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "M 00001000 0000002A 00001000 "
- "33221100554477668899AABBCCDDEEFF0 libfoo.so"));
-#endif
-
- // In absence of a product info in the minidump, the writer should just write
- // an unknown marker.
- ASSERT_NE(static_cast<char*>(0), strstr(
- buf.get(), "V UNKNOWN:0.0.0.0"));
-}
-
-// Ensure that the product info and build fingerprint metadata show up in the
-// final microdump if present.
-TEST(MicrodumpWriterTest, BuildFingerprintAndProductInfo) {
- const char kProductInfo[] = "MockProduct:42.0.2311.99";
- const char kBuildFingerprint[] =
- "aosp/occam/mako:5.1.1/LMY47W/12345678:userdegbug/dev-keys";
- const char kGPUFingerprint[] =
- "Qualcomm;Adreno (TM) 330;OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)";
- const MicrodumpExtraInfo kMicrodumpExtraInfo(
- MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, kGPUFingerprint));
- scoped_array<char> buf;
- MappingList no_mappings;
-
- CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfo, &buf);
- CheckMicrodumpContents(string(buf.get()), kMicrodumpExtraInfo);
-}
-
-TEST(MicrodumpWriterTest, NoProductInfo) {
- const char kBuildFingerprint[] = "foobar";
- const char kGPUFingerprint[] = "bazqux";
- scoped_array<char> buf;
- MappingList no_mappings;
-
- const MicrodumpExtraInfo kMicrodumpExtraInfoNoProductInfo(
- MakeMicrodumpExtraInfo(kBuildFingerprint, NULL, kGPUFingerprint));
-
- CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfoNoProductInfo, &buf);
- CheckMicrodumpContents(string(buf.get()), kBuildFingerprint,
- "UNKNOWN:0.0.0.0", kGPUFingerprint);
-}
-
-TEST(MicrodumpWriterTest, NoGPUInfo) {
- const char kProductInfo[] = "bazqux";
- const char kBuildFingerprint[] = "foobar";
- scoped_array<char> buf;
- MappingList no_mappings;
-
- const MicrodumpExtraInfo kMicrodumpExtraInfoNoGPUInfo(
- MakeMicrodumpExtraInfo(kBuildFingerprint, kProductInfo, NULL));
-
- CrashAndGetMicrodump(no_mappings, kMicrodumpExtraInfoNoGPUInfo, &buf);
- CheckMicrodumpContents(string(buf.get()), kBuildFingerprint,
- kProductInfo, "UNKNOWN");
-}
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set.h
deleted file mode 100644
index 1cca9aa5a0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set.h
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_CPU_SET_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_CPU_SET_H_
-
-#include <stdint.h>
-#include <assert.h>
-#include <string.h>
-
-#include "common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-// Helper class used to model a set of CPUs, as read from sysfs
-// files like /sys/devices/system/cpu/present
-// See See http://www.kernel.org/doc/Documentation/cputopology.txt
-class CpuSet {
-public:
- // The maximum number of supported CPUs.
- static const size_t kMaxCpus = 1024;
-
- CpuSet() {
- my_memset(mask_, 0, sizeof(mask_));
- }
-
- // Parse a sysfs file to extract the corresponding CPU set.
- bool ParseSysFile(int fd) {
- char buffer[512];
- int ret = sys_read(fd, buffer, sizeof(buffer)-1);
- if (ret < 0)
- return false;
-
- buffer[ret] = '\0';
-
- // Expected format: comma-separated list of items, where each
- // item can be a decimal integer, or two decimal integers separated
- // by a dash.
- // E.g.:
- // 0
- // 0,1,2,3
- // 0-3
- // 1,10-23
- const char* p = buffer;
- const char* p_end = p + ret;
- while (p < p_end) {
- // Skip leading space, if any
- while (p < p_end && my_isspace(*p))
- p++;
-
- // Find start and size of current item.
- const char* item = p;
- size_t item_len = static_cast<size_t>(p_end - p);
- const char* item_next =
- static_cast<const char*>(my_memchr(p, ',', item_len));
- if (item_next != NULL) {
- p = item_next + 1;
- item_len = static_cast<size_t>(item_next - item);
- } else {
- p = p_end;
- item_next = p_end;
- }
-
- // Ignore trailing spaces.
- while (item_next > item && my_isspace(item_next[-1]))
- item_next--;
-
- // skip empty items.
- if (item_next == item)
- continue;
-
- // read first decimal value.
- uintptr_t start = 0;
- const char* next = my_read_decimal_ptr(&start, item);
- uintptr_t end = start;
- if (*next == '-')
- my_read_decimal_ptr(&end, next+1);
-
- while (start <= end)
- SetBit(start++);
- }
- return true;
- }
-
- // Intersect this CPU set with another one.
- void IntersectWith(const CpuSet& other) {
- for (size_t nn = 0; nn < kMaskWordCount; ++nn)
- mask_[nn] &= other.mask_[nn];
- }
-
- // Return the number of CPUs in this set.
- int GetCount() {
- int result = 0;
- for (size_t nn = 0; nn < kMaskWordCount; ++nn) {
- result += __builtin_popcount(mask_[nn]);
- }
- return result;
- }
-
-private:
- void SetBit(uintptr_t index) {
- size_t nn = static_cast<size_t>(index);
- if (nn < kMaxCpus)
- mask_[nn / kMaskWordBits] |= (1U << (nn % kMaskWordBits));
- }
-
- typedef uint32_t MaskWordType;
- static const size_t kMaskWordBits = 8*sizeof(MaskWordType);
- static const size_t kMaskWordCount =
- (kMaxCpus + kMaskWordBits - 1) / kMaskWordBits;
-
- MaskWordType mask_[kMaskWordCount];
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_CPU_SET_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set_unittest.cc
deleted file mode 100644
index e2274bd17a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/cpu_set_unittest.cc
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-#include "breakpad_googletest_includes.h"
-#include "client/linux/minidump_writer/cpu_set.h"
-#include "common/linux/tests/auto_testfile.h"
-
-using namespace google_breakpad;
-
-namespace {
-
-typedef testing::Test CpuSetTest;
-
-// Helper class to write test text file to a temporary file and return
-// its file descriptor.
-class ScopedTestFile : public AutoTestFile {
-public:
- explicit ScopedTestFile(const char* text)
- : AutoTestFile("cpu_set", text) {
- }
-};
-
-}
-
-TEST(CpuSetTest, EmptyCount) {
- CpuSet set;
- ASSERT_EQ(0, set.GetCount());
-}
-
-TEST(CpuSetTest, OneCpu) {
- ScopedTestFile file("10");
- ASSERT_TRUE(file.IsOk());
-
- CpuSet set;
- ASSERT_TRUE(set.ParseSysFile(file.GetFd()));
- ASSERT_EQ(1, set.GetCount());
-}
-
-TEST(CpuSetTest, OneCpuTerminated) {
- ScopedTestFile file("10\n");
- ASSERT_TRUE(file.IsOk());
-
- CpuSet set;
- ASSERT_TRUE(set.ParseSysFile(file.GetFd()));
- ASSERT_EQ(1, set.GetCount());
-}
-
-TEST(CpuSetTest, TwoCpusWithComma) {
- ScopedTestFile file("1,10");
- ASSERT_TRUE(file.IsOk());
-
- CpuSet set;
- ASSERT_TRUE(set.ParseSysFile(file.GetFd()));
- ASSERT_EQ(2, set.GetCount());
-}
-
-TEST(CpuSetTest, TwoCpusWithRange) {
- ScopedTestFile file("1-2");
- ASSERT_TRUE(file.IsOk());
-
- CpuSet set;
- ASSERT_TRUE(set.ParseSysFile(file.GetFd()));
- ASSERT_EQ(2, set.GetCount());
-}
-
-TEST(CpuSetTest, TenCpusWithRange) {
- ScopedTestFile file("9-18");
- ASSERT_TRUE(file.IsOk());
-
- CpuSet set;
- ASSERT_TRUE(set.ParseSysFile(file.GetFd()));
- ASSERT_EQ(10, set.GetCount());
-}
-
-TEST(CpuSetTest, MultiItems) {
- ScopedTestFile file("0, 2-4, 128");
- ASSERT_TRUE(file.IsOk());
-
- CpuSet set;
- ASSERT_TRUE(set.ParseSysFile(file.GetFd()));
- ASSERT_EQ(5, set.GetCount());
-}
-
-TEST(CpuSetTest, IntersectWith) {
- ScopedTestFile file1("9-19");
- ASSERT_TRUE(file1.IsOk());
- CpuSet set1;
- ASSERT_TRUE(set1.ParseSysFile(file1.GetFd()));
- ASSERT_EQ(11, set1.GetCount());
-
- ScopedTestFile file2("16-24");
- ASSERT_TRUE(file2.IsOk());
- CpuSet set2;
- ASSERT_TRUE(set2.ParseSysFile(file2.GetFd()));
- ASSERT_EQ(9, set2.GetCount());
-
- set1.IntersectWith(set2);
- ASSERT_EQ(4, set1.GetCount());
- ASSERT_EQ(9, set2.GetCount());
-}
-
-TEST(CpuSetTest, SelfIntersection) {
- ScopedTestFile file1("9-19");
- ASSERT_TRUE(file1.IsOk());
- CpuSet set1;
- ASSERT_TRUE(set1.ParseSysFile(file1.GetFd()));
- ASSERT_EQ(11, set1.GetCount());
-
- set1.IntersectWith(set1);
- ASSERT_EQ(11, set1.GetCount());
-}
-
-TEST(CpuSetTest, EmptyIntersection) {
- ScopedTestFile file1("0-19");
- ASSERT_TRUE(file1.IsOk());
- CpuSet set1;
- ASSERT_TRUE(set1.ParseSysFile(file1.GetFd()));
- ASSERT_EQ(20, set1.GetCount());
-
- ScopedTestFile file2("20-39");
- ASSERT_TRUE(file2.IsOk());
- CpuSet set2;
- ASSERT_TRUE(set2.ParseSysFile(file2.GetFd()));
- ASSERT_EQ(20, set2.GetCount());
-
- set1.IntersectWith(set2);
- ASSERT_EQ(0, set1.GetCount());
-
- ASSERT_EQ(20, set2.GetCount());
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader.h
deleted file mode 100644
index a4bde18031..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_DIRECTORY_READER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_DIRECTORY_READER_H_
-
-#include <stdint.h>
-#include <unistd.h>
-#include <limits.h>
-#include <assert.h>
-#include <errno.h>
-#include <string.h>
-
-#include "common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-// A class for enumerating a directory without using diropen/readdir or other
-// functions which may allocate memory.
-class DirectoryReader {
- public:
- DirectoryReader(int fd)
- : fd_(fd),
- buf_used_(0) {
- }
-
- // Return the next entry from the directory
- // name: (output) the NUL terminated entry name
- //
- // Returns true iff successful (false on EOF).
- //
- // After calling this, one must call |PopEntry| otherwise you'll get the same
- // entry over and over.
- bool GetNextEntry(const char** name) {
- struct kernel_dirent* const dent =
- reinterpret_cast<kernel_dirent*>(buf_);
-
- if (buf_used_ == 0) {
- // need to read more entries.
- const int n = sys_getdents(fd_, dent, sizeof(buf_));
- if (n < 0) {
- return false;
- } else if (n == 0) {
- hit_eof_ = true;
- } else {
- buf_used_ += n;
- }
- }
-
- if (buf_used_ == 0 && hit_eof_)
- return false;
-
- assert(buf_used_ > 0);
-
- *name = dent->d_name;
- return true;
- }
-
- void PopEntry() {
- if (!buf_used_)
- return;
-
- const struct kernel_dirent* const dent =
- reinterpret_cast<kernel_dirent*>(buf_);
-
- buf_used_ -= dent->d_reclen;
- my_memmove(buf_, buf_ + dent->d_reclen, buf_used_);
- }
-
- private:
- const int fd_;
- bool hit_eof_;
- unsigned buf_used_;
- uint8_t buf_[sizeof(struct kernel_dirent) + NAME_MAX + 1];
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_DIRECTORY_READER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc
deleted file mode 100644
index 326f9e36b4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/directory_reader_unittest.cc
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <set>
-#include <string>
-
-#include <dirent.h>
-#include <fcntl.h>
-#include <sys/types.h>
-
-#include "client/linux/minidump_writer/directory_reader.h"
-#include "common/using_std_string.h"
-#include "breakpad_googletest_includes.h"
-
-using namespace google_breakpad;
-
-namespace {
-typedef testing::Test DirectoryReaderTest;
-}
-
-TEST(DirectoryReaderTest, CompareResults) {
- std::set<string> dent_set;
-
- DIR *const dir = opendir("/proc/self");
- ASSERT_TRUE(dir != NULL);
-
- struct dirent* dent;
- while ((dent = readdir(dir)))
- dent_set.insert(dent->d_name);
-
- closedir(dir);
-
- const int fd = open("/proc/self", O_DIRECTORY | O_RDONLY);
- ASSERT_GE(fd, 0);
-
- DirectoryReader dir_reader(fd);
- unsigned seen = 0;
-
- const char* name;
- while (dir_reader.GetNextEntry(&name)) {
- ASSERT_TRUE(dent_set.find(name) != dent_set.end());
- seen++;
- dir_reader.PopEntry();
- }
-
- ASSERT_TRUE(dent_set.find("status") != dent_set.end());
- ASSERT_TRUE(dent_set.find("stat") != dent_set.end());
- ASSERT_TRUE(dent_set.find("cmdline") != dent_set.end());
-
- ASSERT_EQ(dent_set.size(), seen);
- close(fd);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader.h
deleted file mode 100644
index 779cfeb603..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader.h
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_LINE_READER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_LINE_READER_H_
-
-#include <stdint.h>
-#include <assert.h>
-#include <string.h>
-
-#include "common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-// A class for reading a file, line by line, without using fopen/fgets or other
-// functions which may allocate memory.
-class LineReader {
- public:
- LineReader(int fd)
- : fd_(fd),
- hit_eof_(false),
- buf_used_(0) {
- }
-
- // The maximum length of a line.
- static const size_t kMaxLineLen = 512;
-
- // Return the next line from the file.
- // line: (output) a pointer to the start of the line. The line is NUL
- // terminated.
- // len: (output) the length of the line (not inc the NUL byte)
- //
- // Returns true iff successful (false on EOF).
- //
- // One must call |PopLine| after this function, otherwise you'll continue to
- // get the same line over and over.
- bool GetNextLine(const char **line, unsigned *len) {
- for (;;) {
- if (buf_used_ == 0 && hit_eof_)
- return false;
-
- for (unsigned i = 0; i < buf_used_; ++i) {
- if (buf_[i] == '\n' || buf_[i] == 0) {
- buf_[i] = 0;
- *len = i;
- *line = buf_;
- return true;
- }
- }
-
- if (buf_used_ == sizeof(buf_)) {
- // we scanned the whole buffer and didn't find an end-of-line marker.
- // This line is too long to process.
- return false;
- }
-
- // We didn't find any end-of-line terminators in the buffer. However, if
- // this is the last line in the file it might not have one:
- if (hit_eof_) {
- assert(buf_used_);
- // There's room for the NUL because of the buf_used_ == sizeof(buf_)
- // check above.
- buf_[buf_used_] = 0;
- *len = buf_used_;
- buf_used_ += 1; // since we appended the NUL.
- *line = buf_;
- return true;
- }
-
- // Otherwise, we should pull in more data from the file
- const ssize_t n = sys_read(fd_, buf_ + buf_used_,
- sizeof(buf_) - buf_used_);
- if (n < 0) {
- return false;
- } else if (n == 0) {
- hit_eof_ = true;
- } else {
- buf_used_ += n;
- }
-
- // At this point, we have either set the hit_eof_ flag, or we have more
- // data to process...
- }
- }
-
- void PopLine(unsigned len) {
- // len doesn't include the NUL byte at the end.
-
- assert(buf_used_ >= len + 1);
- buf_used_ -= len + 1;
- my_memmove(buf_, buf_ + len + 1, buf_used_);
- }
-
- private:
- const int fd_;
-
- bool hit_eof_;
- unsigned buf_used_;
- char buf_[kMaxLineLen];
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_LINE_READER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
deleted file mode 100644
index 29686f04aa..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/line_reader_unittest.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include "client/linux/minidump_writer/line_reader.h"
-#include "breakpad_googletest_includes.h"
-#include "common/linux/tests/auto_testfile.h"
-
-using namespace google_breakpad;
-
-namespace {
-
-typedef testing::Test LineReaderTest;
-
-class ScopedTestFile : public AutoTestFile {
-public:
- explicit ScopedTestFile(const char* text)
- : AutoTestFile("line_reader", text) {
- }
-
- ScopedTestFile(const char* text, size_t text_len)
- : AutoTestFile("line_reader", text, text_len) {
- }
-};
-
-}
-
-TEST(LineReaderTest, EmptyFile) {
- ScopedTestFile file("");
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned len;
- ASSERT_FALSE(reader.GetNextLine(&line, &len));
-}
-
-TEST(LineReaderTest, OneLineTerminated) {
- ScopedTestFile file("a\n");
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned int len;
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ((unsigned int)1, len);
- ASSERT_EQ('a', line[0]);
- ASSERT_EQ('\0', line[1]);
- reader.PopLine(len);
-
- ASSERT_FALSE(reader.GetNextLine(&line, &len));
-}
-
-TEST(LineReaderTest, OneLine) {
- ScopedTestFile file("a");
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned len;
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ((unsigned)1, len);
- ASSERT_EQ('a', line[0]);
- ASSERT_EQ('\0', line[1]);
- reader.PopLine(len);
-
- ASSERT_FALSE(reader.GetNextLine(&line, &len));
-}
-
-TEST(LineReaderTest, TwoLinesTerminated) {
- ScopedTestFile file("a\nb\n");
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned len;
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ((unsigned)1, len);
- ASSERT_EQ('a', line[0]);
- ASSERT_EQ('\0', line[1]);
- reader.PopLine(len);
-
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ((unsigned)1, len);
- ASSERT_EQ('b', line[0]);
- ASSERT_EQ('\0', line[1]);
- reader.PopLine(len);
-
- ASSERT_FALSE(reader.GetNextLine(&line, &len));
-}
-
-TEST(LineReaderTest, TwoLines) {
- ScopedTestFile file("a\nb");
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned len;
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ((unsigned)1, len);
- ASSERT_EQ('a', line[0]);
- ASSERT_EQ('\0', line[1]);
- reader.PopLine(len);
-
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ((unsigned)1, len);
- ASSERT_EQ('b', line[0]);
- ASSERT_EQ('\0', line[1]);
- reader.PopLine(len);
-
- ASSERT_FALSE(reader.GetNextLine(&line, &len));
-}
-
-TEST(LineReaderTest, MaxLength) {
- char l[LineReader::kMaxLineLen-1];
- memset(l, 'a', sizeof(l));
- ScopedTestFile file(l, sizeof(l));
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned len;
- ASSERT_TRUE(reader.GetNextLine(&line, &len));
- ASSERT_EQ(sizeof(l), len);
- ASSERT_TRUE(memcmp(l, line, sizeof(l)) == 0);
- ASSERT_EQ('\0', line[len]);
-}
-
-TEST(LineReaderTest, TooLong) {
- // Note: this writes kMaxLineLen 'a' chars in the test file.
- char l[LineReader::kMaxLineLen];
- memset(l, 'a', sizeof(l));
- ScopedTestFile file(l, sizeof(l));
- ASSERT_TRUE(file.IsOk());
- LineReader reader(file.GetFd());
-
- const char *line;
- unsigned len;
- ASSERT_FALSE(reader.GetNextLine(&line, &len));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
deleted file mode 100644
index 622f050694..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.cc
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_core_dumper.cc: Implement google_breakpad::LinuxCoreDumper.
-// See linux_core_dumper.h for details.
-
-#include "client/linux/minidump_writer/linux_core_dumper.h"
-
-#include <asm/ptrace.h>
-#include <assert.h>
-#include <elf.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/procfs.h>
-#if defined(__mips__) && defined(__ANDROID__)
-// To get register definitions.
-#include <asm/reg.h>
-#endif
-
-#include "common/linux/linux_libc_support.h"
-
-namespace google_breakpad {
-
-LinuxCoreDumper::LinuxCoreDumper(pid_t pid,
- const char* core_path,
- const char* procfs_path,
- const char* root_prefix)
- : LinuxDumper(pid, root_prefix),
- core_path_(core_path),
- procfs_path_(procfs_path),
- thread_infos_(&allocator_, 8) {
- assert(core_path_);
-}
-
-bool LinuxCoreDumper::BuildProcPath(char* path, pid_t pid,
- const char* node) const {
- if (!path || !node)
- return false;
-
- size_t node_len = my_strlen(node);
- if (node_len == 0)
- return false;
-
- size_t procfs_path_len = my_strlen(procfs_path_);
- size_t total_length = procfs_path_len + 1 + node_len;
- if (total_length >= NAME_MAX)
- return false;
-
- memcpy(path, procfs_path_, procfs_path_len);
- path[procfs_path_len] = '/';
- memcpy(path + procfs_path_len + 1, node, node_len);
- path[total_length] = '\0';
- return true;
-}
-
-bool LinuxCoreDumper::CopyFromProcess(void* dest, pid_t child,
- const void* src, size_t length) {
- ElfCoreDump::Addr virtual_address = reinterpret_cast<ElfCoreDump::Addr>(src);
- // TODO(benchan): Investigate whether the data to be copied could span
- // across multiple segments in the core dump file. ElfCoreDump::CopyData
- // and this method do not handle that case yet.
- if (!core_.CopyData(dest, virtual_address, length)) {
- // If the data segment is not found in the core dump, fill the result
- // with marker characters.
- memset(dest, 0xab, length);
- return false;
- }
- return true;
-}
-
-bool LinuxCoreDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- if (index >= thread_infos_.size())
- return false;
-
- *info = thread_infos_[index];
- const uint8_t* stack_pointer;
-#if defined(__i386)
- memcpy(&stack_pointer, &info->regs.esp, sizeof(info->regs.esp));
-#elif defined(__x86_64)
- memcpy(&stack_pointer, &info->regs.rsp, sizeof(info->regs.rsp));
-#elif defined(__ARM_EABI__)
- memcpy(&stack_pointer, &info->regs.ARM_sp, sizeof(info->regs.ARM_sp));
-#elif defined(__aarch64__)
- memcpy(&stack_pointer, &info->regs.sp, sizeof(info->regs.sp));
-#elif defined(__mips__)
- stack_pointer =
- reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-#else
-#error "This code hasn't been ported to your platform yet."
-#endif
- info->stack_pointer = reinterpret_cast<uintptr_t>(stack_pointer);
- return true;
-}
-
-bool LinuxCoreDumper::IsPostMortem() const {
- return true;
-}
-
-bool LinuxCoreDumper::ThreadsSuspend() {
- return true;
-}
-
-bool LinuxCoreDumper::ThreadsResume() {
- return true;
-}
-
-bool LinuxCoreDumper::EnumerateThreads() {
- if (!mapped_core_file_.Map(core_path_, 0)) {
- fprintf(stderr, "Could not map core dump file into memory\n");
- return false;
- }
-
- core_.SetContent(mapped_core_file_.content());
- if (!core_.IsValid()) {
- fprintf(stderr, "Invalid core dump file\n");
- return false;
- }
-
- ElfCoreDump::Note note = core_.GetFirstNote();
- if (!note.IsValid()) {
- fprintf(stderr, "PT_NOTE section not found\n");
- return false;
- }
-
- bool first_thread = true;
- do {
- ElfCoreDump::Word type = note.GetType();
- MemoryRange name = note.GetName();
- MemoryRange description = note.GetDescription();
-
- if (type == 0 || name.IsEmpty() || description.IsEmpty()) {
- fprintf(stderr, "Could not found a valid PT_NOTE.\n");
- return false;
- }
-
- // Based on write_note_info() in linux/kernel/fs/binfmt_elf.c, notes are
- // ordered as follows (NT_PRXFPREG and NT_386_TLS are i386 specific):
- // Thread Name Type
- // -------------------------------------------------------------------
- // 1st thread CORE NT_PRSTATUS
- // process-wide CORE NT_PRPSINFO
- // process-wide CORE NT_AUXV
- // 1st thread CORE NT_FPREGSET
- // 1st thread LINUX NT_PRXFPREG
- // 1st thread LINUX NT_386_TLS
- //
- // 2nd thread CORE NT_PRSTATUS
- // 2nd thread CORE NT_FPREGSET
- // 2nd thread LINUX NT_PRXFPREG
- // 2nd thread LINUX NT_386_TLS
- //
- // 3rd thread CORE NT_PRSTATUS
- // 3rd thread CORE NT_FPREGSET
- // 3rd thread LINUX NT_PRXFPREG
- // 3rd thread LINUX NT_386_TLS
- //
- // The following code only works if notes are ordered as expected.
- switch (type) {
- case NT_PRSTATUS: {
- if (description.length() != sizeof(elf_prstatus)) {
- fprintf(stderr, "Found NT_PRSTATUS descriptor of unexpected size\n");
- return false;
- }
-
- const elf_prstatus* status =
- reinterpret_cast<const elf_prstatus*>(description.data());
- pid_t pid = status->pr_pid;
- ThreadInfo info;
- memset(&info, 0, sizeof(ThreadInfo));
- info.tgid = status->pr_pgrp;
- info.ppid = status->pr_ppid;
-#if defined(__mips__)
-#if defined(__ANDROID__)
- for (int i = EF_R0; i <= EF_R31; i++)
- info.mcontext.gregs[i - EF_R0] = status->pr_reg[i];
-#else // __ANDROID__
- for (int i = EF_REG0; i <= EF_REG31; i++)
- info.mcontext.gregs[i - EF_REG0] = status->pr_reg[i];
-#endif // __ANDROID__
- info.mcontext.mdlo = status->pr_reg[EF_LO];
- info.mcontext.mdhi = status->pr_reg[EF_HI];
- info.mcontext.pc = status->pr_reg[EF_CP0_EPC];
-#else // __mips__
- memcpy(&info.regs, status->pr_reg, sizeof(info.regs));
-#endif // __mips__
- if (first_thread) {
- crash_thread_ = pid;
- crash_signal_ = status->pr_info.si_signo;
- }
- first_thread = false;
- threads_.push_back(pid);
- thread_infos_.push_back(info);
- break;
- }
-#if defined(__i386) || defined(__x86_64)
- case NT_FPREGSET: {
- if (thread_infos_.empty())
- return false;
-
- ThreadInfo* info = &thread_infos_.back();
- if (description.length() != sizeof(info->fpregs)) {
- fprintf(stderr, "Found NT_FPREGSET descriptor of unexpected size\n");
- return false;
- }
-
- memcpy(&info->fpregs, description.data(), sizeof(info->fpregs));
- break;
- }
-#endif
-#if defined(__i386)
- case NT_PRXFPREG: {
- if (thread_infos_.empty())
- return false;
-
- ThreadInfo* info = &thread_infos_.back();
- if (description.length() != sizeof(info->fpxregs)) {
- fprintf(stderr, "Found NT_PRXFPREG descriptor of unexpected size\n");
- return false;
- }
-
- memcpy(&info->fpxregs, description.data(), sizeof(info->fpxregs));
- break;
- }
-#endif
- }
- note = note.GetNextNote();
- } while (note.IsValid());
-
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.h
deleted file mode 100644
index 8a7c924b61..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_core_dumper.h: Define the google_breakpad::LinuxCoreDumper
-// class, which is derived from google_breakpad::LinuxDumper to extract
-// information from a crashed process via its core dump and proc files.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_LINUX_CORE_DUMPER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_LINUX_CORE_DUMPER_H_
-
-#include "client/linux/minidump_writer/linux_dumper.h"
-#include "common/linux/elf_core_dump.h"
-#include "common/linux/memory_mapped_file.h"
-
-namespace google_breakpad {
-
-class LinuxCoreDumper : public LinuxDumper {
- public:
- // Constructs a dumper for extracting information of a given process
- // with a process ID of |pid| via its core dump file at |core_path| and
- // its proc files at |procfs_path|. If |procfs_path| is a copy of
- // /proc/<pid>, it should contain the following files:
- // auxv, cmdline, environ, exe, maps, status
- // See LinuxDumper for the purpose of |root_prefix|.
- LinuxCoreDumper(pid_t pid, const char* core_path, const char* procfs_path,
- const char* root_prefix = "");
-
- // Implements LinuxDumper::BuildProcPath().
- // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>).
- // |path| is a character array of at least NAME_MAX bytes to return the
- // result.|node| is the final node without any slashes. Return true on
- // success.
- //
- // As this dumper performs a post-mortem dump and makes use of a copy
- // of the proc files of the crashed process, this derived method does
- // not actually make use of |pid| and always returns a subpath of
- // |procfs_path_| regardless of whether |pid| corresponds to the main
- // process or a thread of the process, i.e. assuming both the main process
- // and its threads have the following proc files with the same content:
- // auxv, cmdline, environ, exe, maps, status
- virtual bool BuildProcPath(char* path, pid_t pid, const char* node) const;
-
- // Implements LinuxDumper::CopyFromProcess().
- // Copies content of |length| bytes from a given process |child|,
- // starting from |src|, into |dest|. This method extracts the content
- // the core dump and fills |dest| with a sequence of marker bytes
- // if the expected data is not found in the core dump. Returns true if
- // the expected data is found in the core dump.
- virtual bool CopyFromProcess(void* dest, pid_t child, const void* src,
- size_t length);
-
- // Implements LinuxDumper::GetThreadInfoByIndex().
- // Reads information about the |index|-th thread of |threads_|.
- // Returns true on success. One must have called |ThreadsSuspend| first.
- virtual bool GetThreadInfoByIndex(size_t index, ThreadInfo* info);
-
- // Implements LinuxDumper::IsPostMortem().
- // Always returns true to indicate that this dumper performs a
- // post-mortem dump of a crashed process via a core dump file.
- virtual bool IsPostMortem() const;
-
- // Implements LinuxDumper::ThreadsSuspend().
- // As the dumper performs a post-mortem dump via a core dump file,
- // there is no threads to suspend. This method does nothing and
- // always returns true.
- virtual bool ThreadsSuspend();
-
- // Implements LinuxDumper::ThreadsResume().
- // As the dumper performs a post-mortem dump via a core dump file,
- // there is no threads to resume. This method does nothing and
- // always returns true.
- virtual bool ThreadsResume();
-
- protected:
- // Implements LinuxDumper::EnumerateThreads().
- // Enumerates all threads of the given process into |threads_|.
- virtual bool EnumerateThreads();
-
- private:
- // Path of the core dump file.
- const char* core_path_;
-
- // Path of the directory containing the proc files of the given process,
- // which is usually a copy of /proc/<pid>.
- const char* procfs_path_;
-
- // Memory-mapped core dump file at |core_path_|.
- MemoryMappedFile mapped_core_file_;
-
- // Content of the core dump file.
- ElfCoreDump core_;
-
- // Thread info found in the core dump file.
- wasteful_vector<ThreadInfo> thread_infos_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_HANDLER_LINUX_CORE_DUMPER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
deleted file mode 100644
index ae0c965b34..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_core_dumper_unittest.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_core_dumper_unittest.cc:
-// Unit tests for google_breakpad::LinuxCoreDumoer.
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/linux/minidump_writer/linux_core_dumper.h"
-#include "common/linux/tests/crash_generator.h"
-#include "common/using_std_string.h"
-
-using namespace google_breakpad;
-
-TEST(LinuxCoreDumperTest, GetMappingAbsolutePath) {
- const LinuxCoreDumper dumper(getpid(), "core", "/tmp", "/mnt/root");
- const MappingInfo mapping = { 0, 0, 0, false, "/usr/lib/libc.so" };
-
- char path[PATH_MAX];
- dumper.GetMappingAbsolutePath(mapping, path);
-
- EXPECT_STREQ("/mnt/root/usr/lib/libc.so", path);
-}
-
-TEST(LinuxCoreDumperTest, BuildProcPath) {
- const pid_t pid = getpid();
- const char procfs_path[] = "/procfs_copy";
- LinuxCoreDumper dumper(getpid(), "core_file", procfs_path);
-
- char maps_path[NAME_MAX] = "";
- char maps_path_expected[NAME_MAX];
- snprintf(maps_path_expected, sizeof(maps_path_expected),
- "%s/maps", procfs_path);
- EXPECT_TRUE(dumper.BuildProcPath(maps_path, pid, "maps"));
- EXPECT_STREQ(maps_path_expected, maps_path);
-
- EXPECT_FALSE(dumper.BuildProcPath(NULL, pid, "maps"));
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, pid, ""));
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, pid, NULL));
-
- char long_node[NAME_MAX];
- size_t long_node_len = NAME_MAX - strlen(procfs_path) - 1;
- memset(long_node, 'a', long_node_len);
- long_node[long_node_len] = '\0';
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, pid, long_node));
-}
-
-TEST(LinuxCoreDumperTest, VerifyDumpWithMultipleThreads) {
- CrashGenerator crash_generator;
- if (!crash_generator.HasDefaultCorePattern()) {
- fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test "
- "is skipped due to non-default core pattern\n");
- return;
- }
-
- const unsigned kNumOfThreads = 3;
- const unsigned kCrashThread = 1;
- const int kCrashSignal = SIGABRT;
- pid_t child_pid;
- ASSERT_TRUE(crash_generator.CreateChildCrash(kNumOfThreads, kCrashThread,
- kCrashSignal, &child_pid));
-
- const string core_file = crash_generator.GetCoreFilePath();
- const string procfs_path = crash_generator.GetDirectoryOfProcFilesCopy();
-
-#if defined(__ANDROID__)
- struct stat st;
- if (stat(core_file.c_str(), &st) != 0) {
- fprintf(stderr, "LinuxCoreDumperTest.VerifyDumpWithMultipleThreads test is "
- "skipped due to no core file being generated");
- return;
- }
-#endif
-
- LinuxCoreDumper dumper(child_pid, core_file.c_str(), procfs_path.c_str());
-
- EXPECT_TRUE(dumper.Init());
-
- EXPECT_TRUE(dumper.IsPostMortem());
-
- // These are no-ops and should always return true.
- EXPECT_TRUE(dumper.ThreadsSuspend());
- EXPECT_TRUE(dumper.ThreadsResume());
-
- // LinuxCoreDumper cannot determine the crash address and thus it always
- // sets the crash address to 0.
- EXPECT_EQ(0U, dumper.crash_address());
- EXPECT_EQ(kCrashSignal, dumper.crash_signal());
- EXPECT_EQ(crash_generator.GetThreadId(kCrashThread),
- dumper.crash_thread());
-
- EXPECT_EQ(kNumOfThreads, dumper.threads().size());
- for (unsigned i = 0; i < kNumOfThreads; ++i) {
- ThreadInfo info;
- EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &info));
- const void* stack;
- size_t stack_len;
- EXPECT_TRUE(dumper.GetStackInfo(&stack, &stack_len, info.stack_pointer));
- EXPECT_EQ(getpid(), info.ppid);
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc
deleted file mode 100644
index bdbdc65077..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.cc
+++ /dev/null
@@ -1,776 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_dumper.cc: Implement google_breakpad::LinuxDumper.
-// See linux_dumper.h for details.
-
-// This code deals with the mechanics of getting information about a crashed
-// process. Since this code may run in a compromised address space, the same
-// rules apply as detailed at the top of minidump_writer.h: no libc calls and
-// use the alternative allocator.
-
-#include "client/linux/minidump_writer/linux_dumper.h"
-
-#include <assert.h>
-#include <elf.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stddef.h>
-#include <string.h>
-
-#include "client/linux/minidump_writer/line_reader.h"
-#include "common/linux/elfutils.h"
-#include "common/linux/file_id.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/linux/memory_mapped_file.h"
-#include "common/linux/safe_readlink.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-#if defined(__ANDROID__)
-
-// Android packed relocations definitions are not yet available from the
-// NDK header files, so we have to provide them manually here.
-#ifndef DT_LOOS
-#define DT_LOOS 0x6000000d
-#endif
-#ifndef DT_ANDROID_REL
-static const int DT_ANDROID_REL = DT_LOOS + 2;
-#endif
-#ifndef DT_ANDROID_RELA
-static const int DT_ANDROID_RELA = DT_LOOS + 4;
-#endif
-
-#endif // __ANDROID __
-
-static const char kMappedFileUnsafePrefix[] = "/dev/";
-static const char kDeletedSuffix[] = " (deleted)";
-static const char kReservedFlags[] = " ---p";
-
-inline static bool IsMappedFileOpenUnsafe(
- const google_breakpad::MappingInfo& mapping) {
- // It is unsafe to attempt to open a mapped file that lives under /dev,
- // because the semantics of the open may be driver-specific so we'd risk
- // hanging the crash dumper. And a file in /dev/ almost certainly has no
- // ELF file identifier anyways.
- return my_strncmp(mapping.name,
- kMappedFileUnsafePrefix,
- sizeof(kMappedFileUnsafePrefix) - 1) == 0;
-}
-
-namespace google_breakpad {
-
-#if defined(__CHROMEOS__)
-
-namespace {
-
-// Recover memory mappings before writing dump on ChromeOS
-//
-// On Linux, breakpad relies on /proc/[pid]/maps to associate symbols from
-// addresses. ChromeOS' hugepage implementation replaces some segments with
-// anonymous private pages, which is a restriction of current implementation
-// in Linux kernel at the time of writing. Thus, breakpad can no longer
-// symbolize addresses from those text segments replaced with hugepages.
-//
-// This postprocess tries to recover the mappings. Because hugepages are always
-// inserted in between some .text sections, it tries to infer the names and
-// offsets of the segments, by looking at segments immediately precede and
-// succeed them.
-//
-// For example, a text segment before hugepage optimization
-// 02001000-03002000 r-xp /opt/google/chrome/chrome
-//
-// can be broken into
-// 02001000-02200000 r-xp /opt/google/chrome/chrome
-// 02200000-03000000 r-xp
-// 03000000-03002000 r-xp /opt/google/chrome/chrome
-//
-// For more details, see:
-// crbug.com/628040 ChromeOS' use of hugepages confuses crash symbolization
-
-// Copied from CrOS' hugepage implementation, which is unlikely to change.
-// The hugepage size is 2M.
-const unsigned int kHpageShift = 21;
-const size_t kHpageSize = (1 << kHpageShift);
-const size_t kHpageMask = (~(kHpageSize - 1));
-
-// Find and merge anonymous r-xp segments with surrounding named segments.
-// There are two cases:
-
-// Case 1: curr, next
-// curr is anonymous
-// curr is r-xp
-// curr.size >= 2M
-// curr.size is a multiple of 2M.
-// next is backed by some file.
-// curr and next are contiguous.
-// offset(next) == sizeof(curr)
-void TryRecoverMappings(MappingInfo *curr, MappingInfo *next) {
- // Merged segments are marked with size = 0.
- if (curr->size == 0 || next->size == 0)
- return;
-
- if (curr->size >= kHpageSize &&
- curr->exec &&
- (curr->size & kHpageMask) == curr->size &&
- (curr->start_addr & kHpageMask) == curr->start_addr &&
- curr->name[0] == '\0' &&
- next->name[0] != '\0' &&
- curr->start_addr + curr->size == next->start_addr &&
- curr->size == next->offset) {
-
- // matched
- my_strlcpy(curr->name, next->name, NAME_MAX);
- if (next->exec) {
- // (curr, next)
- curr->size += next->size;
- next->size = 0;
- }
- }
-}
-
-// Case 2: prev, curr, next
-// curr is anonymous
-// curr is r-xp
-// curr.size >= 2M
-// curr.size is a multiple of 2M.
-// next and prev are backed by the same file.
-// prev, curr and next are contiguous.
-// offset(next) == offset(prev) + sizeof(prev) + sizeof(curr)
-void TryRecoverMappings(MappingInfo *prev, MappingInfo *curr,
- MappingInfo *next) {
- // Merged segments are marked with size = 0.
- if (prev->size == 0 || curr->size == 0 || next->size == 0)
- return;
-
- if (curr->size >= kHpageSize &&
- curr->exec &&
- (curr->size & kHpageMask) == curr->size &&
- (curr->start_addr & kHpageMask) == curr->start_addr &&
- curr->name[0] == '\0' &&
- next->name[0] != '\0' &&
- curr->start_addr + curr->size == next->start_addr &&
- prev->start_addr + prev->size == curr->start_addr &&
- my_strncmp(prev->name, next->name, NAME_MAX) == 0 &&
- next->offset == prev->offset + prev->size + curr->size) {
-
- // matched
- my_strlcpy(curr->name, prev->name, NAME_MAX);
- if (prev->exec) {
- curr->offset = prev->offset;
- curr->start_addr = prev->start_addr;
- if (next->exec) {
- // (prev, curr, next)
- curr->size += prev->size + next->size;
- prev->size = 0;
- next->size = 0;
- } else {
- // (prev, curr), next
- curr->size += prev->size;
- prev->size = 0;
- }
- } else {
- curr->offset = prev->offset + prev->size;
- if (next->exec) {
- // prev, (curr, next)
- curr->size += next->size;
- next->size = 0;
- } else {
- // prev, curr, next
- }
- }
- }
-}
-
-// mappings_ is sorted excepted for the first entry.
-// This function tries to merge segemnts into the first entry,
-// then check for other sorted entries.
-// See LinuxDumper::EnumerateMappings().
-void CrOSPostProcessMappings(wasteful_vector<MappingInfo*>& mappings) {
- // Find the candidate "next" to first segment, which is the only one that
- // could be out-of-order.
- size_t l = 1;
- size_t r = mappings.size();
- size_t next = mappings.size();
- while (l < r) {
- int m = (l + r) / 2;
- if (mappings[m]->start_addr > mappings[0]->start_addr)
- r = next = m;
- else
- l = m + 1;
- }
-
- // Try to merge segments into the first.
- if (next < mappings.size()) {
- TryRecoverMappings(mappings[0], mappings[next]);
- if (next - 1 > 0)
- TryRecoverMappings(mappings[next - 1], mappings[0], mappings[next]);
- }
-
- // Iterate through normal, sorted cases.
- // Normal case 1.
- for (size_t i = 1; i < mappings.size() - 1; i++)
- TryRecoverMappings(mappings[i], mappings[i + 1]);
-
- // Normal case 2.
- for (size_t i = 1; i < mappings.size() - 2; i++)
- TryRecoverMappings(mappings[i], mappings[i + 1], mappings[i + 2]);
-
- // Collect merged (size == 0) segments.
- size_t f, e;
- for (f = e = 0; e < mappings.size(); e++)
- if (mappings[e]->size > 0)
- mappings[f++] = mappings[e];
- mappings.resize(f);
-}
-
-} // namespace
-#endif // __CHROMEOS__
-
-// All interesting auvx entry types are below AT_SYSINFO_EHDR
-#define AT_MAX AT_SYSINFO_EHDR
-
-LinuxDumper::LinuxDumper(pid_t pid, const char* root_prefix)
- : pid_(pid),
- root_prefix_(root_prefix),
- crash_address_(0),
- crash_signal_(0),
- crash_thread_(pid),
- threads_(&allocator_, 8),
- mappings_(&allocator_),
- auxv_(&allocator_, AT_MAX + 1) {
- assert(root_prefix_ && my_strlen(root_prefix_) < PATH_MAX);
- // The passed-in size to the constructor (above) is only a hint.
- // Must call .resize() to do actual initialization of the elements.
- auxv_.resize(AT_MAX + 1);
-}
-
-LinuxDumper::~LinuxDumper() {
-}
-
-bool LinuxDumper::Init() {
- return ReadAuxv() && EnumerateThreads() && EnumerateMappings();
-}
-
-bool LinuxDumper::LateInit() {
-#if defined(__ANDROID__)
- LatePostprocessMappings();
-#endif
-
-#if defined(__CHROMEOS__)
- CrOSPostProcessMappings(mappings_);
-#endif
-
- return true;
-}
-
-bool
-LinuxDumper::ElfFileIdentifierForMapping(const MappingInfo& mapping,
- bool member,
- unsigned int mapping_id,
- wasteful_vector<uint8_t>& identifier) {
- assert(!member || mapping_id < mappings_.size());
- if (IsMappedFileOpenUnsafe(mapping))
- return false;
-
- // Special-case linux-gate because it's not a real file.
- if (my_strcmp(mapping.name, kLinuxGateLibraryName) == 0) {
- void* linux_gate = NULL;
- if (pid_ == sys_getpid()) {
- linux_gate = reinterpret_cast<void*>(mapping.start_addr);
- } else {
- linux_gate = allocator_.Alloc(mapping.size);
- CopyFromProcess(linux_gate, pid_,
- reinterpret_cast<const void*>(mapping.start_addr),
- mapping.size);
- }
- return FileID::ElfFileIdentifierFromMappedFile(linux_gate, identifier);
- }
-
- char filename[PATH_MAX];
- if (!GetMappingAbsolutePath(mapping, filename))
- return false;
- bool filename_modified = HandleDeletedFileInMapping(filename);
-
- MemoryMappedFile mapped_file(filename, mapping.offset);
- if (!mapped_file.data() || mapped_file.size() < SELFMAG)
- return false;
-
- bool success =
- FileID::ElfFileIdentifierFromMappedFile(mapped_file.data(), identifier);
- if (success && member && filename_modified) {
- mappings_[mapping_id]->name[my_strlen(mapping.name) -
- sizeof(kDeletedSuffix) + 1] = '\0';
- }
-
- return success;
-}
-
-bool LinuxDumper::GetMappingAbsolutePath(const MappingInfo& mapping,
- char path[PATH_MAX]) const {
- return my_strlcpy(path, root_prefix_, PATH_MAX) < PATH_MAX &&
- my_strlcat(path, mapping.name, PATH_MAX) < PATH_MAX;
-}
-
-namespace {
-bool ElfFileSoNameFromMappedFile(
- const void* elf_base, char* soname, size_t soname_size) {
- if (!IsValidElf(elf_base)) {
- // Not ELF
- return false;
- }
-
- const void* segment_start;
- size_t segment_size;
- int elf_class;
- if (!FindElfSection(elf_base, ".dynamic", SHT_DYNAMIC,
- &segment_start, &segment_size, &elf_class)) {
- // No dynamic section
- return false;
- }
-
- const void* dynstr_start;
- size_t dynstr_size;
- if (!FindElfSection(elf_base, ".dynstr", SHT_STRTAB,
- &dynstr_start, &dynstr_size, &elf_class)) {
- // No dynstr section
- return false;
- }
-
- const ElfW(Dyn)* dynamic = static_cast<const ElfW(Dyn)*>(segment_start);
- size_t dcount = segment_size / sizeof(ElfW(Dyn));
- for (const ElfW(Dyn)* dyn = dynamic; dyn < dynamic + dcount; ++dyn) {
- if (dyn->d_tag == DT_SONAME) {
- const char* dynstr = static_cast<const char*>(dynstr_start);
- if (dyn->d_un.d_val >= dynstr_size) {
- // Beyond the end of the dynstr section
- return false;
- }
- const char* str = dynstr + dyn->d_un.d_val;
- const size_t maxsize = dynstr_size - dyn->d_un.d_val;
- my_strlcpy(soname, str, maxsize < soname_size ? maxsize : soname_size);
- return true;
- }
- }
-
- // Did not find SONAME
- return false;
-}
-
-// Find the shared object name (SONAME) by examining the ELF information
-// for |mapping|. If the SONAME is found copy it into the passed buffer
-// |soname| and return true. The size of the buffer is |soname_size|.
-// The SONAME will be truncated if it is too long to fit in the buffer.
-bool ElfFileSoName(const LinuxDumper& dumper,
- const MappingInfo& mapping, char* soname, size_t soname_size) {
- if (IsMappedFileOpenUnsafe(mapping)) {
- // Not safe
- return false;
- }
-
- char filename[PATH_MAX];
- if (!dumper.GetMappingAbsolutePath(mapping, filename))
- return false;
-
- MemoryMappedFile mapped_file(filename, mapping.offset);
- if (!mapped_file.data() || mapped_file.size() < SELFMAG) {
- // mmap failed
- return false;
- }
-
- return ElfFileSoNameFromMappedFile(mapped_file.data(), soname, soname_size);
-}
-
-} // namespace
-
-
-void LinuxDumper::GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
- char* file_path,
- size_t file_path_size,
- char* file_name,
- size_t file_name_size) {
- my_strlcpy(file_path, mapping.name, file_path_size);
-
- // If an executable is mapped from a non-zero offset, this is likely because
- // the executable was loaded directly from inside an archive file (e.g., an
- // apk on Android). We try to find the name of the shared object (SONAME) by
- // looking in the file for ELF sections.
- bool mapped_from_archive = false;
- if (mapping.exec && mapping.offset != 0) {
- mapped_from_archive =
- ElfFileSoName(*this, mapping, file_name, file_name_size);
- }
-
- if (mapped_from_archive) {
- // Some tools (e.g., stackwalk) extract the basename from the pathname. In
- // this case, we append the file_name to the mapped archive path as follows:
- // file_name := libname.so
- // file_path := /path/to/ARCHIVE.APK/libname.so
- if (my_strlen(file_path) + 1 + my_strlen(file_name) < file_path_size) {
- my_strlcat(file_path, "/", file_path_size);
- my_strlcat(file_path, file_name, file_path_size);
- }
- } else {
- // Common case:
- // file_path := /path/to/libname.so
- // file_name := libname.so
- const char* basename = my_strrchr(file_path, '/');
- basename = basename == NULL ? file_path : (basename + 1);
- my_strlcpy(file_name, basename, file_name_size);
- }
-}
-
-bool LinuxDumper::ReadAuxv() {
- char auxv_path[NAME_MAX];
- if (!BuildProcPath(auxv_path, pid_, "auxv")) {
- return false;
- }
-
- int fd = sys_open(auxv_path, O_RDONLY, 0);
- if (fd < 0) {
- return false;
- }
-
- elf_aux_entry one_aux_entry;
- bool res = false;
- while (sys_read(fd,
- &one_aux_entry,
- sizeof(elf_aux_entry)) == sizeof(elf_aux_entry) &&
- one_aux_entry.a_type != AT_NULL) {
- if (one_aux_entry.a_type <= AT_MAX) {
- auxv_[one_aux_entry.a_type] = one_aux_entry.a_un.a_val;
- res = true;
- }
- }
- sys_close(fd);
- return res;
-}
-
-bool LinuxDumper::EnumerateMappings() {
- char maps_path[NAME_MAX];
- if (!BuildProcPath(maps_path, pid_, "maps"))
- return false;
-
- // linux_gate_loc is the beginning of the kernel's mapping of
- // linux-gate.so in the process. It doesn't actually show up in the
- // maps list as a filename, but it can be found using the AT_SYSINFO_EHDR
- // aux vector entry, which gives the information necessary to special
- // case its entry when creating the list of mappings.
- // See http://www.trilithium.com/johan/2005/08/linux-gate/ for more
- // information.
- const void* linux_gate_loc =
- reinterpret_cast<void *>(auxv_[AT_SYSINFO_EHDR]);
- // Although the initial executable is usually the first mapping, it's not
- // guaranteed (see http://crosbug.com/25355); therefore, try to use the
- // actual entry point to find the mapping.
- const void* entry_point_loc = reinterpret_cast<void *>(auxv_[AT_ENTRY]);
-
- const int fd = sys_open(maps_path, O_RDONLY, 0);
- if (fd < 0)
- return false;
- LineReader* const line_reader = new(allocator_) LineReader(fd);
-
- const char* line;
- unsigned line_len;
- while (line_reader->GetNextLine(&line, &line_len)) {
- uintptr_t start_addr, end_addr, offset;
-
- const char* i1 = my_read_hex_ptr(&start_addr, line);
- if (*i1 == '-') {
- const char* i2 = my_read_hex_ptr(&end_addr, i1 + 1);
- if (*i2 == ' ') {
- bool exec = (*(i2 + 3) == 'x');
- const char* i3 = my_read_hex_ptr(&offset, i2 + 6 /* skip ' rwxp ' */);
- if (*i3 == ' ') {
- const char* name = NULL;
- // Only copy name if the name is a valid path name, or if
- // it's the VDSO image.
- if (((name = my_strchr(line, '/')) == NULL) &&
- linux_gate_loc &&
- reinterpret_cast<void*>(start_addr) == linux_gate_loc) {
- name = kLinuxGateLibraryName;
- offset = 0;
- }
- // Merge adjacent mappings with the same name into one module,
- // assuming they're a single library mapped by the dynamic linker
- if (name && !mappings_.empty()) {
- MappingInfo* module = mappings_.back();
- if ((start_addr == module->start_addr + module->size) &&
- (my_strlen(name) == my_strlen(module->name)) &&
- (my_strncmp(name, module->name, my_strlen(name)) == 0)) {
- module->size = end_addr - module->start_addr;
- line_reader->PopLine(line_len);
- continue;
- }
- }
- // Also merge mappings that result from address ranges that the
- // linker reserved but which a loaded library did not use. These
- // appear as an anonymous private mapping with no access flags set
- // and which directly follow an executable mapping.
- if (!name && !mappings_.empty()) {
- MappingInfo* module = mappings_.back();
- if ((start_addr == module->start_addr + module->size) &&
- module->exec &&
- module->name[0] == '/' &&
- offset == 0 && my_strncmp(i2,
- kReservedFlags,
- sizeof(kReservedFlags) - 1) == 0) {
- module->size = end_addr - module->start_addr;
- line_reader->PopLine(line_len);
- continue;
- }
- }
- MappingInfo* const module = new(allocator_) MappingInfo;
- my_memset(module, 0, sizeof(MappingInfo));
- module->start_addr = start_addr;
- module->size = end_addr - start_addr;
- module->offset = offset;
- module->exec = exec;
- if (name != NULL) {
- const unsigned l = my_strlen(name);
- if (l < sizeof(module->name))
- my_memcpy(module->name, name, l);
- }
- // If this is the entry-point mapping, and it's not already the
- // first one, then we need to make it be first. This is because
- // the minidump format assumes the first module is the one that
- // corresponds to the main executable (as codified in
- // processor/minidump.cc:MinidumpModuleList::GetMainModule()).
- if (entry_point_loc &&
- (entry_point_loc >=
- reinterpret_cast<void*>(module->start_addr)) &&
- (entry_point_loc <
- reinterpret_cast<void*>(module->start_addr+module->size)) &&
- !mappings_.empty()) {
- // push the module onto the front of the list.
- mappings_.resize(mappings_.size() + 1);
- for (size_t idx = mappings_.size() - 1; idx > 0; idx--)
- mappings_[idx] = mappings_[idx - 1];
- mappings_[0] = module;
- } else {
- mappings_.push_back(module);
- }
- }
- }
- }
- line_reader->PopLine(line_len);
- }
-
- sys_close(fd);
-
- return !mappings_.empty();
-}
-
-#if defined(__ANDROID__)
-
-bool LinuxDumper::GetLoadedElfHeader(uintptr_t start_addr, ElfW(Ehdr)* ehdr) {
- CopyFromProcess(ehdr, pid_,
- reinterpret_cast<const void*>(start_addr),
- sizeof(*ehdr));
- return my_memcmp(&ehdr->e_ident, ELFMAG, SELFMAG) == 0;
-}
-
-void LinuxDumper::ParseLoadedElfProgramHeaders(ElfW(Ehdr)* ehdr,
- uintptr_t start_addr,
- uintptr_t* min_vaddr_ptr,
- uintptr_t* dyn_vaddr_ptr,
- size_t* dyn_count_ptr) {
- uintptr_t phdr_addr = start_addr + ehdr->e_phoff;
-
- const uintptr_t max_addr = UINTPTR_MAX;
- uintptr_t min_vaddr = max_addr;
- uintptr_t dyn_vaddr = 0;
- size_t dyn_count = 0;
-
- for (size_t i = 0; i < ehdr->e_phnum; ++i) {
- ElfW(Phdr) phdr;
- CopyFromProcess(&phdr, pid_,
- reinterpret_cast<const void*>(phdr_addr),
- sizeof(phdr));
- if (phdr.p_type == PT_LOAD && phdr.p_vaddr < min_vaddr) {
- min_vaddr = phdr.p_vaddr;
- }
- if (phdr.p_type == PT_DYNAMIC) {
- dyn_vaddr = phdr.p_vaddr;
- dyn_count = phdr.p_memsz / sizeof(ElfW(Dyn));
- }
- phdr_addr += sizeof(phdr);
- }
-
- *min_vaddr_ptr = min_vaddr;
- *dyn_vaddr_ptr = dyn_vaddr;
- *dyn_count_ptr = dyn_count;
-}
-
-bool LinuxDumper::HasAndroidPackedRelocations(uintptr_t load_bias,
- uintptr_t dyn_vaddr,
- size_t dyn_count) {
- uintptr_t dyn_addr = load_bias + dyn_vaddr;
- for (size_t i = 0; i < dyn_count; ++i) {
- ElfW(Dyn) dyn;
- CopyFromProcess(&dyn, pid_,
- reinterpret_cast<const void*>(dyn_addr),
- sizeof(dyn));
- if (dyn.d_tag == DT_ANDROID_REL || dyn.d_tag == DT_ANDROID_RELA) {
- return true;
- }
- dyn_addr += sizeof(dyn);
- }
- return false;
-}
-
-uintptr_t LinuxDumper::GetEffectiveLoadBias(ElfW(Ehdr)* ehdr,
- uintptr_t start_addr) {
- uintptr_t min_vaddr = 0;
- uintptr_t dyn_vaddr = 0;
- size_t dyn_count = 0;
- ParseLoadedElfProgramHeaders(ehdr, start_addr,
- &min_vaddr, &dyn_vaddr, &dyn_count);
- // If |min_vaddr| is non-zero and we find Android packed relocation tags,
- // return the effective load bias.
- if (min_vaddr != 0) {
- const uintptr_t load_bias = start_addr - min_vaddr;
- if (HasAndroidPackedRelocations(load_bias, dyn_vaddr, dyn_count)) {
- return load_bias;
- }
- }
- // Either |min_vaddr| is zero, or it is non-zero but we did not find the
- // expected Android packed relocations tags.
- return start_addr;
-}
-
-void LinuxDumper::LatePostprocessMappings() {
- for (size_t i = 0; i < mappings_.size(); ++i) {
- // Only consider exec mappings that indicate a file path was mapped, and
- // where the ELF header indicates a mapped shared library.
- MappingInfo* mapping = mappings_[i];
- if (!(mapping->exec && mapping->name[0] == '/')) {
- continue;
- }
- ElfW(Ehdr) ehdr;
- if (!GetLoadedElfHeader(mapping->start_addr, &ehdr)) {
- continue;
- }
- if (ehdr.e_type == ET_DYN) {
- // Compute the effective load bias for this mapped library, and update
- // the mapping to hold that rather than |start_addr|, at the same time
- // adjusting |size| to account for the change in |start_addr|. Where
- // the library does not contain Android packed relocations,
- // GetEffectiveLoadBias() returns |start_addr| and the mapping entry
- // is not changed.
- const uintptr_t load_bias = GetEffectiveLoadBias(&ehdr,
- mapping->start_addr);
- mapping->size += mapping->start_addr - load_bias;
- mapping->start_addr = load_bias;
- }
- }
-}
-
-#endif // __ANDROID__
-
-// Get information about the stack, given the stack pointer. We don't try to
-// walk the stack since we might not have all the information needed to do
-// unwind. So we just grab, up to, 32k of stack.
-bool LinuxDumper::GetStackInfo(const void** stack, size_t* stack_len,
- uintptr_t int_stack_pointer) {
- // Move the stack pointer to the bottom of the page that it's in.
- const uintptr_t page_size = getpagesize();
-
- uint8_t* const stack_pointer =
- reinterpret_cast<uint8_t*>(int_stack_pointer & ~(page_size - 1));
-
- // The number of bytes of stack which we try to capture.
- static const ptrdiff_t kStackToCapture = 32 * 1024;
-
- const MappingInfo* mapping = FindMapping(stack_pointer);
- if (!mapping)
- return false;
- const ptrdiff_t offset = stack_pointer -
- reinterpret_cast<uint8_t*>(mapping->start_addr);
- const ptrdiff_t distance_to_end =
- static_cast<ptrdiff_t>(mapping->size) - offset;
- *stack_len = distance_to_end > kStackToCapture ?
- kStackToCapture : distance_to_end;
- *stack = stack_pointer;
- return true;
-}
-
-// Find the mapping which the given memory address falls in.
-const MappingInfo* LinuxDumper::FindMapping(const void* address) const {
- const uintptr_t addr = (uintptr_t) address;
-
- for (size_t i = 0; i < mappings_.size(); ++i) {
- const uintptr_t start = static_cast<uintptr_t>(mappings_[i]->start_addr);
- if (addr >= start && addr - start < mappings_[i]->size)
- return mappings_[i];
- }
-
- return NULL;
-}
-
-bool LinuxDumper::HandleDeletedFileInMapping(char* path) const {
- static const size_t kDeletedSuffixLen = sizeof(kDeletedSuffix) - 1;
-
- // Check for ' (deleted)' in |path|.
- // |path| has to be at least as long as "/x (deleted)".
- const size_t path_len = my_strlen(path);
- if (path_len < kDeletedSuffixLen + 2)
- return false;
- if (my_strncmp(path + path_len - kDeletedSuffixLen, kDeletedSuffix,
- kDeletedSuffixLen) != 0) {
- return false;
- }
-
- // Check |path| against the /proc/pid/exe 'symlink'.
- char exe_link[NAME_MAX];
- if (!BuildProcPath(exe_link, pid_, "exe"))
- return false;
- MappingInfo new_mapping = {0};
- if (!SafeReadLink(exe_link, new_mapping.name))
- return false;
- char new_path[PATH_MAX];
- if (!GetMappingAbsolutePath(new_mapping, new_path))
- return false;
- if (my_strcmp(path, new_path) != 0)
- return false;
-
- // Check to see if someone actually named their executable 'foo (deleted)'.
- struct kernel_stat exe_stat;
- struct kernel_stat new_path_stat;
- if (sys_stat(exe_link, &exe_stat) == 0 &&
- sys_stat(new_path, &new_path_stat) == 0 &&
- exe_stat.st_dev == new_path_stat.st_dev &&
- exe_stat.st_ino == new_path_stat.st_ino) {
- return false;
- }
-
- my_memcpy(path, exe_link, NAME_MAX);
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h
deleted file mode 100644
index c3c799267c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper.h
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_dumper.h: Define the google_breakpad::LinuxDumper class, which
-// is a base class for extracting information of a crashed process. It
-// was originally a complete implementation using the ptrace API, but
-// has been refactored to allow derived implementations supporting both
-// ptrace and core dump. A portion of the original implementation is now
-// in google_breakpad::LinuxPtraceDumper (see linux_ptrace_dumper.h for
-// details).
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_LINUX_DUMPER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_LINUX_DUMPER_H_
-
-#include <elf.h>
-#if defined(__ANDROID__)
-#include <link.h>
-#endif
-#include <linux/limits.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/user.h>
-
-#include "client/linux/dump_writer_common/mapping_info.h"
-#include "client/linux/dump_writer_common/thread_info.h"
-#include "common/linux/file_id.h"
-#include "common/memory.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// Typedef for our parsing of the auxv variables in /proc/pid/auxv.
-#if defined(__i386) || defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM == _ABIO32)
-typedef Elf32_auxv_t elf_aux_entry;
-#elif defined(__x86_64) || defined(__aarch64__) || \
- (defined(__mips__) && _MIPS_SIM != _ABIO32)
-typedef Elf64_auxv_t elf_aux_entry;
-#endif
-
-typedef __typeof__(((elf_aux_entry*) 0)->a_un.a_val) elf_aux_val_t;
-
-// When we find the VDSO mapping in the process's address space, this
-// is the name we use for it when writing it to the minidump.
-// This should always be less than NAME_MAX!
-const char kLinuxGateLibraryName[] = "linux-gate.so";
-
-class LinuxDumper {
- public:
- // The |root_prefix| is prepended to mapping paths before opening them, which
- // is useful if the crash originates from a chroot.
- explicit LinuxDumper(pid_t pid, const char* root_prefix = "");
-
- virtual ~LinuxDumper();
-
- // Parse the data for |threads| and |mappings|.
- virtual bool Init();
-
- // Take any actions that could not be taken in Init(). LateInit() is
- // called after all other caller's initialization is complete, and in
- // particular after it has called ThreadsSuspend(), so that ptrace is
- // available.
- virtual bool LateInit();
-
- // Return true if the dumper performs a post-mortem dump.
- virtual bool IsPostMortem() const = 0;
-
- // Suspend/resume all threads in the given process.
- virtual bool ThreadsSuspend() = 0;
- virtual bool ThreadsResume() = 0;
-
- // Read information about the |index|-th thread of |threads_|.
- // Returns true on success. One must have called |ThreadsSuspend| first.
- virtual bool GetThreadInfoByIndex(size_t index, ThreadInfo* info) = 0;
-
- // These are only valid after a call to |Init|.
- const wasteful_vector<pid_t> &threads() { return threads_; }
- const wasteful_vector<MappingInfo*> &mappings() { return mappings_; }
- const MappingInfo* FindMapping(const void* address) const;
- const wasteful_vector<elf_aux_val_t>& auxv() { return auxv_; }
-
- // Find a block of memory to take as the stack given the top of stack pointer.
- // stack: (output) the lowest address in the memory area
- // stack_len: (output) the length of the memory area
- // stack_top: the current top of the stack
- bool GetStackInfo(const void** stack, size_t* stack_len, uintptr_t stack_top);
-
- PageAllocator* allocator() { return &allocator_; }
-
- // Copy content of |length| bytes from a given process |child|,
- // starting from |src|, into |dest|. Returns true on success.
- virtual bool CopyFromProcess(void* dest, pid_t child, const void* src,
- size_t length) = 0;
-
- // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>).
- // |path| is a character array of at least NAME_MAX bytes to return the
- // result.|node| is the final node without any slashes. Returns true on
- // success.
- virtual bool BuildProcPath(char* path, pid_t pid, const char* node) const = 0;
-
- // Generate a File ID from the .text section of a mapped entry.
- // If not a member, mapping_id is ignored. This method can also manipulate the
- // |mapping|.name to truncate "(deleted)" from the file name if necessary.
- bool ElfFileIdentifierForMapping(const MappingInfo& mapping,
- bool member,
- unsigned int mapping_id,
- wasteful_vector<uint8_t>& identifier);
-
- uintptr_t crash_address() const { return crash_address_; }
- void set_crash_address(uintptr_t crash_address) {
- crash_address_ = crash_address;
- }
-
- int crash_signal() const { return crash_signal_; }
- void set_crash_signal(int crash_signal) { crash_signal_ = crash_signal; }
-
- pid_t crash_thread() const { return crash_thread_; }
- void set_crash_thread(pid_t crash_thread) { crash_thread_ = crash_thread; }
-
- // Concatenates the |root_prefix_| and |mapping| path. Writes into |path| and
- // returns true unless the string is too long.
- bool GetMappingAbsolutePath(const MappingInfo& mapping,
- char path[PATH_MAX]) const;
-
- // Extracts the effective path and file name of from |mapping|. In most cases
- // the effective name/path are just the mapping's path and basename. In some
- // other cases, however, a library can be mapped from an archive (e.g., when
- // loading .so libs from an apk on Android) and this method is able to
- // reconstruct the original file name.
- void GetMappingEffectiveNameAndPath(const MappingInfo& mapping,
- char* file_path,
- size_t file_path_size,
- char* file_name,
- size_t file_name_size);
-
- protected:
- bool ReadAuxv();
-
- virtual bool EnumerateMappings();
-
- virtual bool EnumerateThreads() = 0;
-
- // For the case where a running program has been deleted, it'll show up in
- // /proc/pid/maps as "/path/to/program (deleted)". If this is the case, then
- // see if '/path/to/program (deleted)' matches /proc/pid/exe and return
- // /proc/pid/exe in |path| so ELF identifier generation works correctly. This
- // also checks to see if '/path/to/program (deleted)' exists, so it does not
- // get fooled by a poorly named binary.
- // For programs that don't end with ' (deleted)', this is a no-op.
- // This assumes |path| is a buffer with length NAME_MAX.
- // Returns true if |path| is modified.
- bool HandleDeletedFileInMapping(char* path) const;
-
- // ID of the crashed process.
- const pid_t pid_;
-
- // Path of the root directory to which mapping paths are relative.
- const char* const root_prefix_;
-
- // Virtual address at which the process crashed.
- uintptr_t crash_address_;
-
- // Signal that terminated the crashed process.
- int crash_signal_;
-
- // ID of the crashed thread.
- pid_t crash_thread_;
-
- mutable PageAllocator allocator_;
-
- // IDs of all the threads.
- wasteful_vector<pid_t> threads_;
-
- // Info from /proc/<pid>/maps.
- wasteful_vector<MappingInfo*> mappings_;
-
- // Info from /proc/<pid>/auxv
- wasteful_vector<elf_aux_val_t> auxv_;
-
-#if defined(__ANDROID__)
- private:
- // Android M and later support packed ELF relocations in shared libraries.
- // Packing relocations changes the vaddr of the LOAD segments, such that
- // the effective load bias is no longer the same as the start address of
- // the memory mapping containing the executable parts of the library. The
- // packing is applied to the stripped library run on the target, but not to
- // any other library, and in particular not to the library used to generate
- // breakpad symbols. As a result, we need to adjust the |start_addr| for
- // any mapping that results from a shared library that contains Android
- // packed relocations, so that it properly represents the effective library
- // load bias. The following functions support this adjustment.
-
- // Check that a given mapping at |start_addr| is for an ELF shared library.
- // If it is, place the ELF header in |ehdr| and return true.
- // The first LOAD segment in an ELF shared library has offset zero, so the
- // ELF file header is at the start of this map entry, and in already mapped
- // memory.
- bool GetLoadedElfHeader(uintptr_t start_addr, ElfW(Ehdr)* ehdr);
-
- // For the ELF file mapped at |start_addr|, iterate ELF program headers to
- // find the min vaddr of all program header LOAD segments, the vaddr for
- // the DYNAMIC segment, and a count of DYNAMIC entries. Return values in
- // |min_vaddr_ptr|, |dyn_vaddr_ptr|, and |dyn_count_ptr|.
- // The program header table is also in already mapped memory.
- void ParseLoadedElfProgramHeaders(ElfW(Ehdr)* ehdr,
- uintptr_t start_addr,
- uintptr_t* min_vaddr_ptr,
- uintptr_t* dyn_vaddr_ptr,
- size_t* dyn_count_ptr);
-
- // Search the DYNAMIC tags for the ELF file with the given |load_bias|, and
- // return true if the tags indicate that the file contains Android packed
- // relocations. Dynamic tags are found at |dyn_vaddr| past the |load_bias|.
- bool HasAndroidPackedRelocations(uintptr_t load_bias,
- uintptr_t dyn_vaddr,
- size_t dyn_count);
-
- // If the ELF file mapped at |start_addr| contained Android packed
- // relocations, return the load bias that the system linker (or Chromium
- // crazy linker) will have used. If the file did not contain Android
- // packed relocations, returns |start_addr|, indicating that no adjustment
- // is necessary.
- // The effective load bias is |start_addr| adjusted downwards by the
- // min vaddr in the library LOAD segments.
- uintptr_t GetEffectiveLoadBias(ElfW(Ehdr)* ehdr, uintptr_t start_addr);
-
- // Called from LateInit(). Iterates |mappings_| and rewrites the |start_addr|
- // field of any that represent ELF shared libraries with Android packed
- // relocations, so that |start_addr| is the load bias that the system linker
- // (or Chromium crazy linker) used. This value matches the addresses produced
- // when the non-relocation-packed library is used for breakpad symbol
- // generation.
- void LatePostprocessMappings();
-#endif // __ANDROID__
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_HANDLER_LINUX_DUMPER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
deleted file mode 100644
index 4ccb7201fa..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Helper program for the linux_dumper class, which creates a bunch of
-// threads. The first word of each thread's stack is set to the thread
-// id.
-
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#include "common/scoped_ptr.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-#if defined(__ARM_EABI__)
-#define TID_PTR_REGISTER "r3"
-#elif defined(__aarch64__)
-#define TID_PTR_REGISTER "x3"
-#elif defined(__i386)
-#define TID_PTR_REGISTER "ecx"
-#elif defined(__x86_64)
-#define TID_PTR_REGISTER "rcx"
-#elif defined(__mips__)
-#define TID_PTR_REGISTER "$1"
-#else
-#error This test has not been ported to this platform.
-#endif
-
-void *thread_function(void *data) {
- int pipefd = *static_cast<int *>(data);
- volatile pid_t thread_id = syscall(__NR_gettid);
- // Signal parent that a thread has started.
- uint8_t byte = 1;
- if (write(pipefd, &byte, sizeof(byte)) != sizeof(byte)) {
- perror("ERROR: parent notification failed");
- return NULL;
- }
- register volatile pid_t *thread_id_ptr asm(TID_PTR_REGISTER) = &thread_id;
- while (true)
- asm volatile ("" : : "r" (thread_id_ptr));
- return NULL;
-}
-
-int main(int argc, char *argv[]) {
- if (argc < 3) {
- fprintf(stderr,
- "usage: linux_dumper_unittest_helper <pipe fd> <# of threads>\n");
- return 1;
- }
- int pipefd = atoi(argv[1]);
- int num_threads = atoi(argv[2]);
- if (num_threads < 1) {
- fprintf(stderr, "ERROR: number of threads is 0");
- return 1;
- }
- google_breakpad::scoped_array<pthread_t> threads(new pthread_t[num_threads]);
- pthread_attr_t thread_attributes;
- pthread_attr_init(&thread_attributes);
- pthread_attr_setdetachstate(&thread_attributes, PTHREAD_CREATE_DETACHED);
- for (int i = 1; i < num_threads; i++) {
- pthread_create(&threads[i], &thread_attributes, &thread_function, &pipefd);
- }
- thread_function(&pipefd);
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
deleted file mode 100644
index c35e0e9583..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_ptrace_dumper.cc: Implement google_breakpad::LinuxPtraceDumper.
-// See linux_ptrace_dumper.h for detals.
-// This class was originally splitted from google_breakpad::LinuxDumper.
-
-// This code deals with the mechanics of getting information about a crashed
-// process. Since this code may run in a compromised address space, the same
-// rules apply as detailed at the top of minidump_writer.h: no libc calls and
-// use the alternative allocator.
-
-#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
-
-#include <asm/ptrace.h>
-#include <assert.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ptrace.h>
-#include <sys/uio.h>
-#include <sys/wait.h>
-
-#if defined(__i386)
-#include <cpuid.h>
-#endif
-
-#include "client/linux/minidump_writer/directory_reader.h"
-#include "client/linux/minidump_writer/line_reader.h"
-#include "common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-// Suspends a thread by attaching to it.
-static bool SuspendThread(pid_t pid) {
- // This may fail if the thread has just died or debugged.
- errno = 0;
- if (sys_ptrace(PTRACE_ATTACH, pid, NULL, NULL) != 0 &&
- errno != 0) {
- return false;
- }
- while (sys_waitpid(pid, NULL, __WALL) < 0) {
- if (errno != EINTR) {
- sys_ptrace(PTRACE_DETACH, pid, NULL, NULL);
- return false;
- }
- }
-#if defined(__i386) || defined(__x86_64)
- // On x86, the stack pointer is NULL or -1, when executing trusted code in
- // the seccomp sandbox. Not only does this cause difficulties down the line
- // when trying to dump the thread's stack, it also results in the minidumps
- // containing information about the trusted threads. This information is
- // generally completely meaningless and just pollutes the minidumps.
- // We thus test the stack pointer and exclude any threads that are part of
- // the seccomp sandbox's trusted code.
- user_regs_struct regs;
- if (sys_ptrace(PTRACE_GETREGS, pid, NULL, &regs) == -1 ||
-#if defined(__i386)
- !regs.esp
-#elif defined(__x86_64)
- !regs.rsp
-#endif
- ) {
- sys_ptrace(PTRACE_DETACH, pid, NULL, NULL);
- return false;
- }
-#endif
- return true;
-}
-
-// Resumes a thread by detaching from it.
-static bool ResumeThread(pid_t pid) {
- return sys_ptrace(PTRACE_DETACH, pid, NULL, NULL) >= 0;
-}
-
-namespace google_breakpad {
-
-LinuxPtraceDumper::LinuxPtraceDumper(pid_t pid)
- : LinuxDumper(pid),
- threads_suspended_(false) {
-}
-
-bool LinuxPtraceDumper::BuildProcPath(char* path, pid_t pid,
- const char* node) const {
- if (!path || !node || pid <= 0)
- return false;
-
- size_t node_len = my_strlen(node);
- if (node_len == 0)
- return false;
-
- const unsigned pid_len = my_uint_len(pid);
- const size_t total_length = 6 + pid_len + 1 + node_len;
- if (total_length >= NAME_MAX)
- return false;
-
- my_memcpy(path, "/proc/", 6);
- my_uitos(path + 6, pid, pid_len);
- path[6 + pid_len] = '/';
- my_memcpy(path + 6 + pid_len + 1, node, node_len);
- path[total_length] = '\0';
- return true;
-}
-
-bool LinuxPtraceDumper::CopyFromProcess(void* dest, pid_t child,
- const void* src, size_t length) {
- unsigned long tmp = 55;
- size_t done = 0;
- static const size_t word_size = sizeof(tmp);
- uint8_t* const local = (uint8_t*) dest;
- uint8_t* const remote = (uint8_t*) src;
-
- while (done < length) {
- const size_t l = (length - done > word_size) ? word_size : (length - done);
- if (sys_ptrace(PTRACE_PEEKDATA, child, remote + done, &tmp) == -1) {
- tmp = 0;
- }
- my_memcpy(local + done, &tmp, l);
- done += l;
- }
- return true;
-}
-
-// Read thread info from /proc/$pid/status.
-// Fill out the |tgid|, |ppid| and |pid| members of |info|. If unavailable,
-// these members are set to -1. Returns true iff all three members are
-// available.
-bool LinuxPtraceDumper::GetThreadInfoByIndex(size_t index, ThreadInfo* info) {
- if (index >= threads_.size())
- return false;
-
- pid_t tid = threads_[index];
-
- assert(info != NULL);
- char status_path[NAME_MAX];
- if (!BuildProcPath(status_path, tid, "status"))
- return false;
-
- const int fd = sys_open(status_path, O_RDONLY, 0);
- if (fd < 0)
- return false;
-
- LineReader* const line_reader = new(allocator_) LineReader(fd);
- const char* line;
- unsigned line_len;
-
- info->ppid = info->tgid = -1;
-
- while (line_reader->GetNextLine(&line, &line_len)) {
- if (my_strncmp("Tgid:\t", line, 6) == 0) {
- my_strtoui(&info->tgid, line + 6);
- } else if (my_strncmp("PPid:\t", line, 6) == 0) {
- my_strtoui(&info->ppid, line + 6);
- }
-
- line_reader->PopLine(line_len);
- }
- sys_close(fd);
-
- if (info->ppid == -1 || info->tgid == -1)
- return false;
-
-#ifdef PTRACE_GETREGSET
- struct iovec io;
- info->GetGeneralPurposeRegisters(&io.iov_base, &io.iov_len);
- if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_PRSTATUS, (void*)&io) == -1) {
- return false;
- }
-
- info->GetFloatingPointRegisters(&io.iov_base, &io.iov_len);
- if (sys_ptrace(PTRACE_GETREGSET, tid, (void*)NT_FPREGSET, (void*)&io) == -1) {
- return false;
- }
-#else // PTRACE_GETREGSET
- void* gp_addr;
- info->GetGeneralPurposeRegisters(&gp_addr, NULL);
- if (sys_ptrace(PTRACE_GETREGS, tid, NULL, gp_addr) == -1) {
- return false;
- }
-
-#if !(defined(__ANDROID__) && defined(__ARM_EABI__))
- // When running an arm build on an arm64 device, attempting to get the
- // floating point registers fails. On Android, the floating point registers
- // aren't written to the cpu context anyway, so just don't get them here.
- // See http://crbug.com/508324
- void* fp_addr;
- info->GetFloatingPointRegisters(&fp_addr, NULL);
- if (sys_ptrace(PTRACE_GETFPREGS, tid, NULL, fp_addr) == -1) {
- return false;
- }
-#endif
-#endif // PTRACE_GETREGSET
-
-#if defined(__i386)
-#if !defined(bit_FXSAVE) // e.g. Clang
-#define bit_FXSAVE bit_FXSR
-#endif
- // Detect if the CPU supports the FXSAVE/FXRSTOR instructions
- int eax, ebx, ecx, edx;
- __cpuid(1, eax, ebx, ecx, edx);
- if (edx & bit_FXSAVE) {
- if (sys_ptrace(PTRACE_GETFPXREGS, tid, NULL, &info->fpxregs) == -1) {
- return false;
- }
- } else {
- memset(&info->fpxregs, 0, sizeof(info->fpxregs));
- }
-#endif // defined(__i386)
-
-#if defined(__i386) || defined(__x86_64)
- for (unsigned i = 0; i < ThreadInfo::kNumDebugRegisters; ++i) {
- if (sys_ptrace(
- PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*> (offsetof(struct user,
- u_debugreg[0]) + i *
- sizeof(debugreg_t)),
- &info->dregs[i]) == -1) {
- return false;
- }
- }
-#endif
-
-#if defined(__mips__)
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE), &info->mcontext.hi1);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + 1), &info->mcontext.lo1);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + 2), &info->mcontext.hi2);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + 3), &info->mcontext.lo2);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + 4), &info->mcontext.hi3);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_BASE + 5), &info->mcontext.lo3);
- sys_ptrace(PTRACE_PEEKUSER, tid,
- reinterpret_cast<void*>(DSP_CONTROL), &info->mcontext.dsp);
-#endif
-
- const uint8_t* stack_pointer;
-#if defined(__i386)
- my_memcpy(&stack_pointer, &info->regs.esp, sizeof(info->regs.esp));
-#elif defined(__x86_64)
- my_memcpy(&stack_pointer, &info->regs.rsp, sizeof(info->regs.rsp));
-#elif defined(__ARM_EABI__)
- my_memcpy(&stack_pointer, &info->regs.ARM_sp, sizeof(info->regs.ARM_sp));
-#elif defined(__aarch64__)
- my_memcpy(&stack_pointer, &info->regs.sp, sizeof(info->regs.sp));
-#elif defined(__mips__)
- stack_pointer =
- reinterpret_cast<uint8_t*>(info->mcontext.gregs[MD_CONTEXT_MIPS_REG_SP]);
-#else
-#error "This code hasn't been ported to your platform yet."
-#endif
- info->stack_pointer = reinterpret_cast<uintptr_t>(stack_pointer);
-
- return true;
-}
-
-bool LinuxPtraceDumper::IsPostMortem() const {
- return false;
-}
-
-bool LinuxPtraceDumper::ThreadsSuspend() {
- if (threads_suspended_)
- return true;
- for (size_t i = 0; i < threads_.size(); ++i) {
- if (!SuspendThread(threads_[i])) {
- // If the thread either disappeared before we could attach to it, or if
- // it was part of the seccomp sandbox's trusted code, it is OK to
- // silently drop it from the minidump.
- if (i < threads_.size() - 1) {
- my_memmove(&threads_[i], &threads_[i + 1],
- (threads_.size() - i - 1) * sizeof(threads_[i]));
- }
- threads_.resize(threads_.size() - 1);
- --i;
- }
- }
- threads_suspended_ = true;
- return threads_.size() > 0;
-}
-
-bool LinuxPtraceDumper::ThreadsResume() {
- if (!threads_suspended_)
- return false;
- bool good = true;
- for (size_t i = 0; i < threads_.size(); ++i)
- good &= ResumeThread(threads_[i]);
- threads_suspended_ = false;
- return good;
-}
-
-// Parse /proc/$pid/task to list all the threads of the process identified by
-// pid.
-bool LinuxPtraceDumper::EnumerateThreads() {
- char task_path[NAME_MAX];
- if (!BuildProcPath(task_path, pid_, "task"))
- return false;
-
- const int fd = sys_open(task_path, O_RDONLY | O_DIRECTORY, 0);
- if (fd < 0)
- return false;
- DirectoryReader* dir_reader = new(allocator_) DirectoryReader(fd);
-
- // The directory may contain duplicate entries which we filter by assuming
- // that they are consecutive.
- int last_tid = -1;
- const char* dent_name;
- while (dir_reader->GetNextEntry(&dent_name)) {
- if (my_strcmp(dent_name, ".") &&
- my_strcmp(dent_name, "..")) {
- int tid = 0;
- if (my_strtoui(&tid, dent_name) &&
- last_tid != tid) {
- last_tid = tid;
- threads_.push_back(tid);
- }
- }
- dir_reader->PopEntry();
- }
-
- sys_close(fd);
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.h
deleted file mode 100644
index 2ce834b0fd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_ptrace_dumper.h: Define the google_breakpad::LinuxPtraceDumper
-// class, which is derived from google_breakpad::LinuxDumper to extract
-// information from a crashed process via ptrace.
-// This class was originally splitted from google_breakpad::LinuxDumper.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_LINUX_PTRACE_DUMPER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_LINUX_PTRACE_DUMPER_H_
-
-#include "client/linux/minidump_writer/linux_dumper.h"
-
-namespace google_breakpad {
-
-class LinuxPtraceDumper : public LinuxDumper {
- public:
- // Constructs a dumper for extracting information of a given process
- // with a process ID of |pid|.
- explicit LinuxPtraceDumper(pid_t pid);
-
- // Implements LinuxDumper::BuildProcPath().
- // Builds a proc path for a certain pid for a node (/proc/<pid>/<node>).
- // |path| is a character array of at least NAME_MAX bytes to return the
- // result. |node| is the final node without any slashes. Returns true on
- // success.
- virtual bool BuildProcPath(char* path, pid_t pid, const char* node) const;
-
- // Implements LinuxDumper::CopyFromProcess().
- // Copies content of |length| bytes from a given process |child|,
- // starting from |src|, into |dest|. This method uses ptrace to extract
- // the content from the target process. Always returns true.
- virtual bool CopyFromProcess(void* dest, pid_t child, const void* src,
- size_t length);
-
- // Implements LinuxDumper::GetThreadInfoByIndex().
- // Reads information about the |index|-th thread of |threads_|.
- // Returns true on success. One must have called |ThreadsSuspend| first.
- virtual bool GetThreadInfoByIndex(size_t index, ThreadInfo* info);
-
- // Implements LinuxDumper::IsPostMortem().
- // Always returns false to indicate this dumper performs a dump of
- // a crashed process via ptrace.
- virtual bool IsPostMortem() const;
-
- // Implements LinuxDumper::ThreadsSuspend().
- // Suspends all threads in the given process. Returns true on success.
- virtual bool ThreadsSuspend();
-
- // Implements LinuxDumper::ThreadsResume().
- // Resumes all threads in the given process. Returns true on success.
- virtual bool ThreadsResume();
-
- protected:
- // Implements LinuxDumper::EnumerateThreads().
- // Enumerates all threads of the given process into |threads_|.
- virtual bool EnumerateThreads();
-
- private:
- // Set to true if all threads of the crashed process are suspended.
- bool threads_suspended_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_HANDLER_LINUX_PTRACE_DUMPER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
deleted file mode 100644
index be533e157d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/linux_ptrace_dumper_unittest.cc
+++ /dev/null
@@ -1,470 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// linux_ptrace_dumper_unittest.cc:
-// Unit tests for google_breakpad::LinuxPtraceDumper.
-//
-// This file was renamed from linux_dumper_unittest.cc and modified due
-// to LinuxDumper being splitted into two classes.
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <unistd.h>
-#include <signal.h>
-#include <stdint.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-#include <sys/poll.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
-#include "client/linux/minidump_writer/minidump_writer_unittest_utils.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/file_id.h"
-#include "common/linux/ignore_ret.h"
-#include "common/linux/safe_readlink.h"
-#include "common/memory.h"
-#include "common/using_std_string.h"
-
-#ifndef PR_SET_PTRACER
-#define PR_SET_PTRACER 0x59616d61
-#endif
-
-using namespace google_breakpad;
-
-namespace {
-
-typedef wasteful_vector<uint8_t> id_vector;
-typedef testing::Test LinuxPtraceDumperTest;
-
-/* Fixture for running tests in a child process. */
-class LinuxPtraceDumperChildTest : public testing::Test {
- protected:
- virtual void SetUp() {
- child_pid_ = fork();
-#ifndef __ANDROID__
- prctl(PR_SET_PTRACER, child_pid_);
-#endif
- }
-
- /* Gtest is calling TestBody from this class, which sets up a child
- * process in which the RealTestBody virtual member is called.
- * As such, TestBody is not supposed to be overridden in derived classes.
- */
- virtual void TestBody() /* final */ {
- if (child_pid_ == 0) {
- // child process
- RealTestBody();
- exit(HasFatalFailure() ? kFatalFailure :
- (HasNonfatalFailure() ? kNonFatalFailure : 0));
- }
-
- ASSERT_TRUE(child_pid_ > 0);
- int status;
- waitpid(child_pid_, &status, 0);
- if (WEXITSTATUS(status) == kFatalFailure) {
- GTEST_FATAL_FAILURE_("Test failed in child process");
- } else if (WEXITSTATUS(status) == kNonFatalFailure) {
- GTEST_NONFATAL_FAILURE_("Test failed in child process");
- }
- }
-
- /* Gtest defines TestBody functions through its macros, but classes
- * derived from this one need to define RealTestBody instead.
- * This is achieved by defining a TestBody macro further below.
- */
- virtual void RealTestBody() = 0;
-
- id_vector make_vector() {
- return id_vector(&allocator, kDefaultBuildIdSize);
- }
-
- private:
- static const int kFatalFailure = 1;
- static const int kNonFatalFailure = 2;
-
- pid_t child_pid_;
- PageAllocator allocator;
-};
-
-} // namespace
-
-/* Replace TestBody declarations within TEST*() with RealTestBody
- * declarations */
-#define TestBody RealTestBody
-
-TEST_F(LinuxPtraceDumperChildTest, Setup) {
- LinuxPtraceDumper dumper(getppid());
-}
-
-TEST_F(LinuxPtraceDumperChildTest, FindMappings) {
- LinuxPtraceDumper dumper(getppid());
- ASSERT_TRUE(dumper.Init());
-
- ASSERT_TRUE(dumper.FindMapping(reinterpret_cast<void*>(getpid)));
- ASSERT_TRUE(dumper.FindMapping(reinterpret_cast<void*>(printf)));
- ASSERT_FALSE(dumper.FindMapping(NULL));
-}
-
-TEST_F(LinuxPtraceDumperChildTest, ThreadList) {
- LinuxPtraceDumper dumper(getppid());
- ASSERT_TRUE(dumper.Init());
-
- ASSERT_GE(dumper.threads().size(), (size_t)1);
- bool found = false;
- for (size_t i = 0; i < dumper.threads().size(); ++i) {
- if (dumper.threads()[i] == getppid()) {
- ASSERT_FALSE(found);
- found = true;
- }
- }
- ASSERT_TRUE(found);
-}
-
-// Helper stack class to close a file descriptor and unmap
-// a mmap'ed mapping.
-class StackHelper {
- public:
- StackHelper()
- : fd_(-1), mapping_(NULL), size_(0) {}
- ~StackHelper() {
- if (size_)
- munmap(mapping_, size_);
- if (fd_ >= 0)
- close(fd_);
- }
- void Init(int fd, char* mapping, size_t size) {
- fd_ = fd;
- mapping_ = mapping;
- size_ = size;
- }
-
- char* mapping() const { return mapping_; }
- size_t size() const { return size_; }
-
- private:
- int fd_;
- char* mapping_;
- size_t size_;
-};
-
-class LinuxPtraceDumperMappingsTest : public LinuxPtraceDumperChildTest {
- protected:
- virtual void SetUp();
-
- string helper_path_;
- size_t page_size_;
- StackHelper helper_;
-};
-
-void LinuxPtraceDumperMappingsTest::SetUp() {
- helper_path_ = GetHelperBinary();
- if (helper_path_.empty()) {
- FAIL() << "Couldn't find helper binary";
- exit(1);
- }
-
- // mmap two segments out of the helper binary, one
- // enclosed in the other, but with different protections.
- page_size_ = sysconf(_SC_PAGESIZE);
- const size_t kMappingSize = 3 * page_size_;
- int fd = open(helper_path_.c_str(), O_RDONLY);
- ASSERT_NE(-1, fd) << "Failed to open file: " << helper_path_
- << ", Error: " << strerror(errno);
- char* mapping =
- reinterpret_cast<char*>(mmap(NULL,
- kMappingSize,
- PROT_READ,
- MAP_SHARED,
- fd,
- 0));
- ASSERT_TRUE(mapping);
-
- // Ensure that things get cleaned up.
- helper_.Init(fd, mapping, kMappingSize);
-
- // Carve a page out of the first mapping with different permissions.
- char* inside_mapping = reinterpret_cast<char*>(
- mmap(mapping + 2 * page_size_,
- page_size_,
- PROT_NONE,
- MAP_SHARED | MAP_FIXED,
- fd,
- // Map a different offset just to
- // better test real-world conditions.
- page_size_));
- ASSERT_TRUE(inside_mapping);
-
- LinuxPtraceDumperChildTest::SetUp();
-}
-
-TEST_F(LinuxPtraceDumperMappingsTest, MergedMappings) {
- // Now check that LinuxPtraceDumper interpreted the mappings properly.
- LinuxPtraceDumper dumper(getppid());
- ASSERT_TRUE(dumper.Init());
- int mapping_count = 0;
- for (unsigned i = 0; i < dumper.mappings().size(); ++i) {
- const MappingInfo& mapping = *dumper.mappings()[i];
- if (strcmp(mapping.name, this->helper_path_.c_str()) == 0) {
- // This mapping should encompass the entire original mapped
- // range.
- EXPECT_EQ(reinterpret_cast<uintptr_t>(this->helper_.mapping()),
- mapping.start_addr);
- EXPECT_EQ(this->helper_.size(), mapping.size);
- EXPECT_EQ(0U, mapping.offset);
- mapping_count++;
- }
- }
- EXPECT_EQ(1, mapping_count);
-}
-
-TEST_F(LinuxPtraceDumperChildTest, BuildProcPath) {
- const pid_t pid = getppid();
- LinuxPtraceDumper dumper(pid);
-
- char maps_path[NAME_MAX] = "";
- char maps_path_expected[NAME_MAX];
- snprintf(maps_path_expected, sizeof(maps_path_expected),
- "/proc/%d/maps", pid);
- EXPECT_TRUE(dumper.BuildProcPath(maps_path, pid, "maps"));
- EXPECT_STREQ(maps_path_expected, maps_path);
-
- EXPECT_FALSE(dumper.BuildProcPath(NULL, pid, "maps"));
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, 0, "maps"));
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, pid, ""));
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, pid, NULL));
-
- char long_node[NAME_MAX];
- size_t long_node_len = NAME_MAX - strlen("/proc/123") - 1;
- memset(long_node, 'a', long_node_len);
- long_node[long_node_len] = '\0';
- EXPECT_FALSE(dumper.BuildProcPath(maps_path, 123, long_node));
-}
-
-#if !defined(__ARM_EABI__) && !defined(__mips__)
-// Ensure that the linux-gate VDSO is included in the mapping list.
-TEST_F(LinuxPtraceDumperChildTest, MappingsIncludeLinuxGate) {
- LinuxPtraceDumper dumper(getppid());
- ASSERT_TRUE(dumper.Init());
-
- void* linux_gate_loc =
- reinterpret_cast<void *>(dumper.auxv()[AT_SYSINFO_EHDR]);
- ASSERT_TRUE(linux_gate_loc);
- bool found_linux_gate = false;
-
- const wasteful_vector<MappingInfo*> mappings = dumper.mappings();
- const MappingInfo* mapping;
- for (unsigned i = 0; i < mappings.size(); ++i) {
- mapping = mappings[i];
- if (!strcmp(mapping->name, kLinuxGateLibraryName)) {
- found_linux_gate = true;
- break;
- }
- }
- EXPECT_TRUE(found_linux_gate);
- EXPECT_EQ(linux_gate_loc, reinterpret_cast<void*>(mapping->start_addr));
- EXPECT_EQ(0, memcmp(linux_gate_loc, ELFMAG, SELFMAG));
-}
-
-// Ensure that the linux-gate VDSO can generate a non-zeroed File ID.
-TEST_F(LinuxPtraceDumperChildTest, LinuxGateMappingID) {
- LinuxPtraceDumper dumper(getppid());
- ASSERT_TRUE(dumper.Init());
-
- bool found_linux_gate = false;
- const wasteful_vector<MappingInfo*> mappings = dumper.mappings();
- unsigned index = 0;
- for (unsigned i = 0; i < mappings.size(); ++i) {
- if (!strcmp(mappings[i]->name, kLinuxGateLibraryName)) {
- found_linux_gate = true;
- index = i;
- break;
- }
- }
- ASSERT_TRUE(found_linux_gate);
-
- // Need to suspend the child so ptrace actually works.
- ASSERT_TRUE(dumper.ThreadsSuspend());
- id_vector identifier(make_vector());
- ASSERT_TRUE(dumper.ElfFileIdentifierForMapping(*mappings[index],
- true,
- index,
- identifier));
-
- id_vector empty_identifier(make_vector());
- empty_identifier.resize(kDefaultBuildIdSize, 0);
- EXPECT_NE(empty_identifier, identifier);
- EXPECT_TRUE(dumper.ThreadsResume());
-}
-#endif
-
-TEST_F(LinuxPtraceDumperChildTest, FileIDsMatch) {
- // Calculate the File ID of our binary using both
- // FileID::ElfFileIdentifier and LinuxDumper::ElfFileIdentifierForMapping
- // and ensure that we get the same result from both.
- char exe_name[PATH_MAX];
- ASSERT_TRUE(SafeReadLink("/proc/self/exe", exe_name));
-
- LinuxPtraceDumper dumper(getppid());
- ASSERT_TRUE(dumper.Init());
- const wasteful_vector<MappingInfo*> mappings = dumper.mappings();
- bool found_exe = false;
- unsigned i;
- for (i = 0; i < mappings.size(); ++i) {
- const MappingInfo* mapping = mappings[i];
- if (!strcmp(mapping->name, exe_name)) {
- found_exe = true;
- break;
- }
- }
- ASSERT_TRUE(found_exe);
-
- id_vector identifier1(make_vector());
- id_vector identifier2(make_vector());
- EXPECT_TRUE(dumper.ElfFileIdentifierForMapping(*mappings[i], true, i,
- identifier1));
- FileID fileid(exe_name);
- EXPECT_TRUE(fileid.ElfFileIdentifier(identifier2));
-
- string identifier_string1 =
- FileID::ConvertIdentifierToUUIDString(identifier1);
- string identifier_string2 =
- FileID::ConvertIdentifierToUUIDString(identifier2);
- EXPECT_EQ(identifier_string1, identifier_string2);
-}
-
-/* Get back to normal behavior of TEST*() macros wrt TestBody. */
-#undef TestBody
-
-TEST(LinuxPtraceDumperTest, VerifyStackReadWithMultipleThreads) {
- static const int kNumberOfThreadsInHelperProgram = 5;
- char kNumberOfThreadsArgument[2];
- sprintf(kNumberOfThreadsArgument, "%d", kNumberOfThreadsInHelperProgram);
-
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- pid_t child_pid = fork();
- if (child_pid == 0) {
- // In child process.
- close(fds[0]);
-
- string helper_path(GetHelperBinary());
- if (helper_path.empty()) {
- FAIL() << "Couldn't find helper binary";
- exit(1);
- }
-
- // Pass the pipe fd and the number of threads as arguments.
- char pipe_fd_string[8];
- sprintf(pipe_fd_string, "%d", fds[1]);
- execl(helper_path.c_str(),
- "linux_dumper_unittest_helper",
- pipe_fd_string,
- kNumberOfThreadsArgument,
- NULL);
- // Kill if we get here.
- printf("Errno from exec: %d", errno);
- FAIL() << "Exec of " << helper_path << " failed: " << strerror(errno);
- exit(0);
- }
- close(fds[1]);
-
- // Wait for all child threads to indicate that they have started
- for (int threads = 0; threads < kNumberOfThreadsInHelperProgram; threads++) {
- struct pollfd pfd;
- memset(&pfd, 0, sizeof(pfd));
- pfd.fd = fds[0];
- pfd.events = POLLIN | POLLERR;
-
- const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
- ASSERT_EQ(1, r);
- ASSERT_TRUE(pfd.revents & POLLIN);
- uint8_t junk;
- ASSERT_EQ(read(fds[0], &junk, sizeof(junk)),
- static_cast<ssize_t>(sizeof(junk)));
- }
- close(fds[0]);
-
- // There is a race here because we may stop a child thread before
- // it is actually running the busy loop. Empirically this sleep
- // is sufficient to avoid the race.
- usleep(100000);
-
- // Children are ready now.
- LinuxPtraceDumper dumper(child_pid);
- ASSERT_TRUE(dumper.Init());
- EXPECT_EQ((size_t)kNumberOfThreadsInHelperProgram, dumper.threads().size());
- EXPECT_TRUE(dumper.ThreadsSuspend());
-
- ThreadInfo one_thread;
- for (size_t i = 0; i < dumper.threads().size(); ++i) {
- EXPECT_TRUE(dumper.GetThreadInfoByIndex(i, &one_thread));
- const void* stack;
- size_t stack_len;
- EXPECT_TRUE(dumper.GetStackInfo(&stack, &stack_len,
- one_thread.stack_pointer));
- // In the helper program, we stored a pointer to the thread id in a
- // specific register. Check that we can recover its value.
-#if defined(__ARM_EABI__)
- pid_t* process_tid_location = (pid_t*)(one_thread.regs.uregs[3]);
-#elif defined(__aarch64__)
- pid_t* process_tid_location = (pid_t*)(one_thread.regs.regs[3]);
-#elif defined(__i386)
- pid_t* process_tid_location = (pid_t*)(one_thread.regs.ecx);
-#elif defined(__x86_64)
- pid_t* process_tid_location = (pid_t*)(one_thread.regs.rcx);
-#elif defined(__mips__)
- pid_t* process_tid_location =
- reinterpret_cast<pid_t*>(one_thread.mcontext.gregs[1]);
-#else
-#error This test has not been ported to this platform.
-#endif
- pid_t one_thread_id;
- dumper.CopyFromProcess(&one_thread_id,
- dumper.threads()[i],
- process_tid_location,
- 4);
- EXPECT_EQ(dumper.threads()[i], one_thread_id);
- }
- EXPECT_TRUE(dumper.ThreadsResume());
- kill(child_pid, SIGKILL);
-
- // Reap child
- int status;
- ASSERT_NE(-1, HANDLE_EINTR(waitpid(child_pid, &status, 0)));
- ASSERT_TRUE(WIFSIGNALED(status));
- ASSERT_EQ(SIGKILL, WTERMSIG(status));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
deleted file mode 100644
index 4b1ae5ad3e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.cc
+++ /dev/null
@@ -1,1376 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This code writes out minidump files:
-// http://msdn.microsoft.com/en-us/library/ms680378(VS.85,loband).aspx
-//
-// Minidumps are a Microsoft format which Breakpad uses for recording crash
-// dumps. This code has to run in a compromised environment (the address space
-// may have received SIGSEGV), thus the following rules apply:
-// * You may not enter the dynamic linker. This means that we cannot call
-// any symbols in a shared library (inc libc). Because of this we replace
-// libc functions in linux_libc_support.h.
-// * You may not call syscalls via the libc wrappers. This rule is a subset
-// of the first rule but it bears repeating. We have direct wrappers
-// around the system calls in linux_syscall_support.h.
-// * You may not malloc. There's an alternative allocator in memory.h and
-// a canonical instance in the LinuxDumper object. We use the placement
-// new form to allocate objects and we don't delete them.
-
-#include "client/linux/handler/minidump_descriptor.h"
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "client/minidump_file_writer-inl.h"
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <link.h>
-#include <stdio.h>
-#if defined(__ANDROID__)
-#include <sys/system_properties.h>
-#endif
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#include <sys/user.h>
-#include <sys/utsname.h>
-#include <time.h>
-#include <unistd.h>
-
-#include <algorithm>
-
-#include "client/linux/dump_writer_common/thread_info.h"
-#include "client/linux/dump_writer_common/ucontext_reader.h"
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/minidump_writer/cpu_set.h"
-#include "client/linux/minidump_writer/line_reader.h"
-#include "client/linux/minidump_writer/linux_dumper.h"
-#include "client/linux/minidump_writer/linux_ptrace_dumper.h"
-#include "client/linux/minidump_writer/proc_cpuinfo_reader.h"
-#include "client/minidump_file_writer.h"
-#include "common/linux/file_id.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/minidump_type_helper.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace {
-
-using google_breakpad::AppMemoryList;
-using google_breakpad::auto_wasteful_vector;
-using google_breakpad::ExceptionHandler;
-using google_breakpad::CpuSet;
-using google_breakpad::kDefaultBuildIdSize;
-using google_breakpad::LineReader;
-using google_breakpad::LinuxDumper;
-using google_breakpad::LinuxPtraceDumper;
-using google_breakpad::MDTypeHelper;
-using google_breakpad::MappingEntry;
-using google_breakpad::MappingInfo;
-using google_breakpad::MappingList;
-using google_breakpad::MinidumpFileWriter;
-using google_breakpad::PageAllocator;
-using google_breakpad::ProcCpuInfoReader;
-using google_breakpad::RawContextCPU;
-using google_breakpad::ThreadInfo;
-using google_breakpad::TypedMDRVA;
-using google_breakpad::UContextReader;
-using google_breakpad::UntypedMDRVA;
-using google_breakpad::wasteful_vector;
-
-typedef MDTypeHelper<sizeof(void*)>::MDRawDebug MDRawDebug;
-typedef MDTypeHelper<sizeof(void*)>::MDRawLinkMap MDRawLinkMap;
-
-class MinidumpWriter {
- public:
- // The following kLimit* constants are for when minidump_size_limit_ is set
- // and the minidump size might exceed it.
- //
- // Estimate for how big each thread's stack will be (in bytes).
- static const unsigned kLimitAverageThreadStackLength = 8 * 1024;
- // Number of threads whose stack size we don't want to limit. These base
- // threads will simply be the first N threads returned by the dumper (although
- // the crashing thread will never be limited). Threads beyond this count are
- // the extra threads.
- static const unsigned kLimitBaseThreadCount = 20;
- // Maximum stack size to dump for any extra thread (in bytes).
- static const unsigned kLimitMaxExtraThreadStackLen = 2 * 1024;
- // Make sure this number of additional bytes can fit in the minidump
- // (exclude the stack data).
- static const unsigned kLimitMinidumpFudgeFactor = 64 * 1024;
-
- MinidumpWriter(const char* minidump_path,
- int minidump_fd,
- const ExceptionHandler::CrashContext* context,
- const MappingList& mappings,
- const AppMemoryList& appmem,
- LinuxDumper* dumper)
- : fd_(minidump_fd),
- path_(minidump_path),
- ucontext_(context ? &context->context : NULL),
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- float_state_(context ? &context->float_state : NULL),
-#endif
- dumper_(dumper),
- minidump_size_limit_(-1),
- memory_blocks_(dumper_->allocator()),
- mapping_list_(mappings),
- app_memory_list_(appmem) {
- // Assert there should be either a valid fd or a valid path, not both.
- assert(fd_ != -1 || minidump_path);
- assert(fd_ == -1 || !minidump_path);
- }
-
- bool Init() {
- if (!dumper_->Init())
- return false;
-
- if (fd_ != -1)
- minidump_writer_.SetFile(fd_);
- else if (!minidump_writer_.Open(path_))
- return false;
-
- return dumper_->ThreadsSuspend() && dumper_->LateInit();
- }
-
- ~MinidumpWriter() {
- // Don't close the file descriptor when it's been provided explicitly.
- // Callers might still need to use it.
- if (fd_ == -1)
- minidump_writer_.Close();
- dumper_->ThreadsResume();
- }
-
- bool Dump() {
- // A minidump file contains a number of tagged streams. This is the number
- // of stream which we write.
- unsigned kNumWriters = 13;
-
- TypedMDRVA<MDRawDirectory> dir(&minidump_writer_);
- {
- // Ensure the header gets flushed, as that happens in the destructor.
- // If we crash somewhere below, we should have a mostly-intact dump
- TypedMDRVA<MDRawHeader> header(&minidump_writer_);
- if (!header.Allocate())
- return false;
-
- if (!dir.AllocateArray(kNumWriters))
- return false;
-
- my_memset(header.get(), 0, sizeof(MDRawHeader));
-
- header.get()->signature = MD_HEADER_SIGNATURE;
- header.get()->version = MD_HEADER_VERSION;
- header.get()->time_date_stamp = time(NULL);
- header.get()->stream_count = kNumWriters;
- header.get()->stream_directory_rva = dir.position();
- }
-
- unsigned dir_index = 0;
- MDRawDirectory dirent;
-
- if (!WriteThreadListStream(&dirent))
- return false;
- dir.CopyIndex(dir_index++, &dirent);
-
- if (!WriteMappings(&dirent))
- return false;
- dir.CopyIndex(dir_index++, &dirent);
-
- if (!WriteAppMemory())
- return false;
-
- if (!WriteMemoryListStream(&dirent))
- return false;
- dir.CopyIndex(dir_index++, &dirent);
-
- if (!WriteExceptionStream(&dirent))
- return false;
- dir.CopyIndex(dir_index++, &dirent);
-
- if (!WriteSystemInfoStream(&dirent))
- return false;
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_CPU_INFO;
- if (!WriteFile(&dirent.location, "/proc/cpuinfo"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_PROC_STATUS;
- if (!WriteProcFile(&dirent.location, GetCrashThread(), "status"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_LSB_RELEASE;
- if (!WriteFile(&dirent.location, "/etc/lsb-release"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_CMD_LINE;
- if (!WriteProcFile(&dirent.location, GetCrashThread(), "cmdline"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_ENVIRON;
- if (!WriteProcFile(&dirent.location, GetCrashThread(), "environ"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_AUXV;
- if (!WriteProcFile(&dirent.location, GetCrashThread(), "auxv"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_MAPS;
- if (!WriteProcFile(&dirent.location, GetCrashThread(), "maps"))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- dirent.stream_type = MD_LINUX_DSO_DEBUG;
- if (!WriteDSODebugStream(&dirent))
- NullifyDirectoryEntry(&dirent);
- dir.CopyIndex(dir_index++, &dirent);
-
- // If you add more directory entries, don't forget to update kNumWriters,
- // above.
-
- dumper_->ThreadsResume();
- return true;
- }
-
- bool FillThreadStack(MDRawThread* thread, uintptr_t stack_pointer,
- int max_stack_len, uint8_t** stack_copy) {
- *stack_copy = NULL;
- const void* stack;
- size_t stack_len;
- if (dumper_->GetStackInfo(&stack, &stack_len, stack_pointer)) {
- UntypedMDRVA memory(&minidump_writer_);
- if (max_stack_len >= 0 &&
- stack_len > static_cast<unsigned int>(max_stack_len)) {
- stack_len = max_stack_len;
- // Skip empty chunks of length max_stack_len.
- uintptr_t int_stack = reinterpret_cast<uintptr_t>(stack);
- if (max_stack_len > 0) {
- while (int_stack + max_stack_len < stack_pointer) {
- int_stack += max_stack_len;
- }
- }
- stack = reinterpret_cast<const void*>(int_stack);
- }
- if (!memory.Allocate(stack_len))
- return false;
- *stack_copy = reinterpret_cast<uint8_t*>(Alloc(stack_len));
- dumper_->CopyFromProcess(*stack_copy, thread->thread_id, stack,
- stack_len);
- memory.Copy(*stack_copy, stack_len);
- thread->stack.start_of_memory_range =
- reinterpret_cast<uintptr_t>(stack);
- thread->stack.memory = memory.location();
- memory_blocks_.push_back(thread->stack);
- } else {
- thread->stack.start_of_memory_range = stack_pointer;
- thread->stack.memory.data_size = 0;
- thread->stack.memory.rva = minidump_writer_.position();
- }
- return true;
- }
-
- // Write information about the threads.
- bool WriteThreadListStream(MDRawDirectory* dirent) {
- const unsigned num_threads = dumper_->threads().size();
-
- TypedMDRVA<uint32_t> list(&minidump_writer_);
- if (!list.AllocateObjectAndArray(num_threads, sizeof(MDRawThread)))
- return false;
-
- dirent->stream_type = MD_THREAD_LIST_STREAM;
- dirent->location = list.location();
-
- *list.get() = num_threads;
-
- // If there's a minidump size limit, check if it might be exceeded. Since
- // most of the space is filled with stack data, just check against that.
- // If this expects to exceed the limit, set extra_thread_stack_len such
- // that any thread beyond the first kLimitBaseThreadCount threads will
- // have only kLimitMaxExtraThreadStackLen bytes dumped.
- int extra_thread_stack_len = -1; // default to no maximum
- if (minidump_size_limit_ >= 0) {
- const unsigned estimated_total_stack_size = num_threads *
- kLimitAverageThreadStackLength;
- const off_t estimated_minidump_size = minidump_writer_.position() +
- estimated_total_stack_size + kLimitMinidumpFudgeFactor;
- if (estimated_minidump_size > minidump_size_limit_)
- extra_thread_stack_len = kLimitMaxExtraThreadStackLen;
- }
-
- for (unsigned i = 0; i < num_threads; ++i) {
- MDRawThread thread;
- my_memset(&thread, 0, sizeof(thread));
- thread.thread_id = dumper_->threads()[i];
-
- // We have a different source of information for the crashing thread. If
- // we used the actual state of the thread we would find it running in the
- // signal handler with the alternative stack, which would be deeply
- // unhelpful.
- if (static_cast<pid_t>(thread.thread_id) == GetCrashThread() &&
- ucontext_ &&
- !dumper_->IsPostMortem()) {
- uint8_t* stack_copy;
- const uintptr_t stack_ptr = UContextReader::GetStackPointer(ucontext_);
- if (!FillThreadStack(&thread, stack_ptr, -1, &stack_copy))
- return false;
-
- // Copy 256 bytes around crashing instruction pointer to minidump.
- const size_t kIPMemorySize = 256;
- uint64_t ip = UContextReader::GetInstructionPointer(ucontext_);
- // Bound it to the upper and lower bounds of the memory map
- // it's contained within. If it's not in mapped memory,
- // don't bother trying to write it.
- bool ip_is_mapped = false;
- MDMemoryDescriptor ip_memory_d;
- for (unsigned j = 0; j < dumper_->mappings().size(); ++j) {
- const MappingInfo& mapping = *dumper_->mappings()[j];
- if (ip >= mapping.start_addr &&
- ip < mapping.start_addr + mapping.size) {
- ip_is_mapped = true;
- // Try to get 128 bytes before and after the IP, but
- // settle for whatever's available.
- ip_memory_d.start_of_memory_range =
- std::max(mapping.start_addr,
- uintptr_t(ip - (kIPMemorySize / 2)));
- uintptr_t end_of_range =
- std::min(uintptr_t(ip + (kIPMemorySize / 2)),
- uintptr_t(mapping.start_addr + mapping.size));
- ip_memory_d.memory.data_size =
- end_of_range - ip_memory_d.start_of_memory_range;
- break;
- }
- }
-
- if (ip_is_mapped) {
- UntypedMDRVA ip_memory(&minidump_writer_);
- if (!ip_memory.Allocate(ip_memory_d.memory.data_size))
- return false;
- uint8_t* memory_copy =
- reinterpret_cast<uint8_t*>(Alloc(ip_memory_d.memory.data_size));
- dumper_->CopyFromProcess(
- memory_copy,
- thread.thread_id,
- reinterpret_cast<void*>(ip_memory_d.start_of_memory_range),
- ip_memory_d.memory.data_size);
- ip_memory.Copy(memory_copy, ip_memory_d.memory.data_size);
- ip_memory_d.memory = ip_memory.location();
- memory_blocks_.push_back(ip_memory_d);
- }
-
- TypedMDRVA<RawContextCPU> cpu(&minidump_writer_);
- if (!cpu.Allocate())
- return false;
- my_memset(cpu.get(), 0, sizeof(RawContextCPU));
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- UContextReader::FillCPUContext(cpu.get(), ucontext_, float_state_);
-#else
- UContextReader::FillCPUContext(cpu.get(), ucontext_);
-#endif
- thread.thread_context = cpu.location();
- crashing_thread_context_ = cpu.location();
- } else {
- ThreadInfo info;
- if (!dumper_->GetThreadInfoByIndex(i, &info))
- return false;
-
- uint8_t* stack_copy;
- int max_stack_len = -1; // default to no maximum for this thread
- if (minidump_size_limit_ >= 0 && i >= kLimitBaseThreadCount)
- max_stack_len = extra_thread_stack_len;
- if (!FillThreadStack(&thread, info.stack_pointer, max_stack_len,
- &stack_copy))
- return false;
-
- TypedMDRVA<RawContextCPU> cpu(&minidump_writer_);
- if (!cpu.Allocate())
- return false;
- my_memset(cpu.get(), 0, sizeof(RawContextCPU));
- info.FillCPUContext(cpu.get());
- thread.thread_context = cpu.location();
- if (dumper_->threads()[i] == GetCrashThread()) {
- crashing_thread_context_ = cpu.location();
- if (!dumper_->IsPostMortem()) {
- // This is the crashing thread of a live process, but
- // no context was provided, so set the crash address
- // while the instruction pointer is already here.
- dumper_->set_crash_address(info.GetInstructionPointer());
- }
- }
- }
-
- list.CopyIndexAfterObject(i, &thread, sizeof(thread));
- }
-
- return true;
- }
-
- // Write application-provided memory regions.
- bool WriteAppMemory() {
- for (AppMemoryList::const_iterator iter = app_memory_list_.begin();
- iter != app_memory_list_.end();
- ++iter) {
- uint8_t* data_copy =
- reinterpret_cast<uint8_t*>(dumper_->allocator()->Alloc(iter->length));
- dumper_->CopyFromProcess(data_copy, GetCrashThread(), iter->ptr,
- iter->length);
-
- UntypedMDRVA memory(&minidump_writer_);
- if (!memory.Allocate(iter->length)) {
- return false;
- }
- memory.Copy(data_copy, iter->length);
- MDMemoryDescriptor desc;
- desc.start_of_memory_range = reinterpret_cast<uintptr_t>(iter->ptr);
- desc.memory = memory.location();
- memory_blocks_.push_back(desc);
- }
-
- return true;
- }
-
- static bool ShouldIncludeMapping(const MappingInfo& mapping) {
- if (mapping.name[0] == 0 || // only want modules with filenames.
- // Only want to include one mapping per shared lib.
- // Avoid filtering executable mappings.
- (mapping.offset != 0 && !mapping.exec) ||
- mapping.size < 4096) { // too small to get a signature for.
- return false;
- }
-
- return true;
- }
-
- // If there is caller-provided information about this mapping
- // in the mapping_list_ list, return true. Otherwise, return false.
- bool HaveMappingInfo(const MappingInfo& mapping) {
- for (MappingList::const_iterator iter = mapping_list_.begin();
- iter != mapping_list_.end();
- ++iter) {
- // Ignore any mappings that are wholly contained within
- // mappings in the mapping_info_ list.
- if (mapping.start_addr >= iter->first.start_addr &&
- (mapping.start_addr + mapping.size) <=
- (iter->first.start_addr + iter->first.size)) {
- return true;
- }
- }
- return false;
- }
-
- // Write information about the mappings in effect. Because we are using the
- // minidump format, the information about the mappings is pretty limited.
- // Because of this, we also include the full, unparsed, /proc/$x/maps file in
- // another stream in the file.
- bool WriteMappings(MDRawDirectory* dirent) {
- const unsigned num_mappings = dumper_->mappings().size();
- unsigned num_output_mappings = mapping_list_.size();
-
- for (unsigned i = 0; i < dumper_->mappings().size(); ++i) {
- const MappingInfo& mapping = *dumper_->mappings()[i];
- if (ShouldIncludeMapping(mapping) && !HaveMappingInfo(mapping))
- num_output_mappings++;
- }
-
- TypedMDRVA<uint32_t> list(&minidump_writer_);
- if (num_output_mappings) {
- if (!list.AllocateObjectAndArray(num_output_mappings, MD_MODULE_SIZE))
- return false;
- } else {
- // Still create the module list stream, although it will have zero
- // modules.
- if (!list.Allocate())
- return false;
- }
-
- dirent->stream_type = MD_MODULE_LIST_STREAM;
- dirent->location = list.location();
- *list.get() = num_output_mappings;
-
- // First write all the mappings from the dumper
- unsigned int j = 0;
- for (unsigned i = 0; i < num_mappings; ++i) {
- const MappingInfo& mapping = *dumper_->mappings()[i];
- if (!ShouldIncludeMapping(mapping) || HaveMappingInfo(mapping))
- continue;
-
- MDRawModule mod;
- if (!FillRawModule(mapping, true, i, &mod, NULL))
- return false;
- list.CopyIndexAfterObject(j++, &mod, MD_MODULE_SIZE);
- }
- // Next write all the mappings provided by the caller
- for (MappingList::const_iterator iter = mapping_list_.begin();
- iter != mapping_list_.end();
- ++iter) {
- MDRawModule mod;
- if (!FillRawModule(iter->first, false, 0, &mod, iter->second))
- return false;
- list.CopyIndexAfterObject(j++, &mod, MD_MODULE_SIZE);
- }
-
- return true;
- }
-
- // Fill the MDRawModule |mod| with information about the provided
- // |mapping|. If |identifier| is non-NULL, use it instead of calculating
- // a file ID from the mapping.
- bool FillRawModule(const MappingInfo& mapping,
- bool member,
- unsigned int mapping_id,
- MDRawModule* mod,
- const uint8_t* identifier) {
- my_memset(mod, 0, MD_MODULE_SIZE);
-
- mod->base_of_image = mapping.start_addr;
- mod->size_of_image = mapping.size;
-
- auto_wasteful_vector<uint8_t, kDefaultBuildIdSize> identifier_bytes(
- dumper_->allocator());
-
- if (identifier) {
- // GUID was provided by caller.
- identifier_bytes.insert(identifier_bytes.end(),
- identifier,
- identifier + sizeof(MDGUID));
- } else {
- // Note: ElfFileIdentifierForMapping() can manipulate the |mapping.name|.
- dumper_->ElfFileIdentifierForMapping(mapping,
- member,
- mapping_id,
- identifier_bytes);
- }
-
- if (!identifier_bytes.empty()) {
- UntypedMDRVA cv(&minidump_writer_);
- if (!cv.Allocate(MDCVInfoELF_minsize + identifier_bytes.size()))
- return false;
-
- const uint32_t cv_signature = MD_CVINFOELF_SIGNATURE;
- cv.Copy(&cv_signature, sizeof(cv_signature));
- cv.Copy(cv.position() + sizeof(cv_signature), &identifier_bytes[0],
- identifier_bytes.size());
-
- mod->cv_record = cv.location();
- }
-
- char file_name[NAME_MAX];
- char file_path[NAME_MAX];
- dumper_->GetMappingEffectiveNameAndPath(
- mapping, file_path, sizeof(file_path), file_name, sizeof(file_name));
-
- MDLocationDescriptor ld;
- if (!minidump_writer_.WriteString(file_path, my_strlen(file_path), &ld))
- return false;
- mod->module_name_rva = ld.rva;
- return true;
- }
-
- bool WriteMemoryListStream(MDRawDirectory* dirent) {
- TypedMDRVA<uint32_t> list(&minidump_writer_);
- if (memory_blocks_.size()) {
- if (!list.AllocateObjectAndArray(memory_blocks_.size(),
- sizeof(MDMemoryDescriptor)))
- return false;
- } else {
- // Still create the memory list stream, although it will have zero
- // memory blocks.
- if (!list.Allocate())
- return false;
- }
-
- dirent->stream_type = MD_MEMORY_LIST_STREAM;
- dirent->location = list.location();
-
- *list.get() = memory_blocks_.size();
-
- for (size_t i = 0; i < memory_blocks_.size(); ++i) {
- list.CopyIndexAfterObject(i, &memory_blocks_[i],
- sizeof(MDMemoryDescriptor));
- }
- return true;
- }
-
- bool WriteExceptionStream(MDRawDirectory* dirent) {
- TypedMDRVA<MDRawExceptionStream> exc(&minidump_writer_);
- if (!exc.Allocate())
- return false;
- my_memset(exc.get(), 0, sizeof(MDRawExceptionStream));
-
- dirent->stream_type = MD_EXCEPTION_STREAM;
- dirent->location = exc.location();
-
- exc.get()->thread_id = GetCrashThread();
- exc.get()->exception_record.exception_code = dumper_->crash_signal();
- exc.get()->exception_record.exception_address = dumper_->crash_address();
- exc.get()->thread_context = crashing_thread_context_;
-
- return true;
- }
-
- bool WriteSystemInfoStream(MDRawDirectory* dirent) {
- TypedMDRVA<MDRawSystemInfo> si(&minidump_writer_);
- if (!si.Allocate())
- return false;
- my_memset(si.get(), 0, sizeof(MDRawSystemInfo));
-
- dirent->stream_type = MD_SYSTEM_INFO_STREAM;
- dirent->location = si.location();
-
- WriteCPUInformation(si.get());
- WriteOSInformation(si.get());
-
- return true;
- }
-
- bool WriteDSODebugStream(MDRawDirectory* dirent) {
- ElfW(Phdr)* phdr = reinterpret_cast<ElfW(Phdr) *>(dumper_->auxv()[AT_PHDR]);
- char* base;
- int phnum = dumper_->auxv()[AT_PHNUM];
- if (!phnum || !phdr)
- return false;
-
- // Assume the program base is at the beginning of the same page as the PHDR
- base = reinterpret_cast<char *>(reinterpret_cast<uintptr_t>(phdr) & ~0xfff);
-
- // Search for the program PT_DYNAMIC segment
- ElfW(Addr) dyn_addr = 0;
- for (; phnum >= 0; phnum--, phdr++) {
- ElfW(Phdr) ph;
- if (!dumper_->CopyFromProcess(&ph, GetCrashThread(), phdr, sizeof(ph)))
- return false;
-
- // Adjust base address with the virtual address of the PT_LOAD segment
- // corresponding to offset 0
- if (ph.p_type == PT_LOAD && ph.p_offset == 0) {
- base -= ph.p_vaddr;
- }
- if (ph.p_type == PT_DYNAMIC) {
- dyn_addr = ph.p_vaddr;
- }
- }
- if (!dyn_addr)
- return false;
-
- ElfW(Dyn) *dynamic = reinterpret_cast<ElfW(Dyn) *>(dyn_addr + base);
-
- // The dynamic linker makes information available that helps gdb find all
- // DSOs loaded into the program. If this information is indeed available,
- // dump it to a MD_LINUX_DSO_DEBUG stream.
- struct r_debug* r_debug = NULL;
- uint32_t dynamic_length = 0;
-
- for (int i = 0; ; ++i) {
- ElfW(Dyn) dyn;
- dynamic_length += sizeof(dyn);
- if (!dumper_->CopyFromProcess(&dyn, GetCrashThread(), dynamic + i,
- sizeof(dyn))) {
- return false;
- }
-
-#ifdef __mips__
- const int32_t debug_tag = DT_MIPS_RLD_MAP;
-#else
- const int32_t debug_tag = DT_DEBUG;
-#endif
- if (dyn.d_tag == debug_tag) {
- r_debug = reinterpret_cast<struct r_debug*>(dyn.d_un.d_ptr);
- continue;
- } else if (dyn.d_tag == DT_NULL) {
- break;
- }
- }
-
- // The "r_map" field of that r_debug struct contains a linked list of all
- // loaded DSOs.
- // Our list of DSOs potentially is different from the ones in the crashing
- // process. So, we have to be careful to never dereference pointers
- // directly. Instead, we use CopyFromProcess() everywhere.
- // See <link.h> for a more detailed discussion of the how the dynamic
- // loader communicates with debuggers.
-
- // Count the number of loaded DSOs
- int dso_count = 0;
- struct r_debug debug_entry;
- if (!dumper_->CopyFromProcess(&debug_entry, GetCrashThread(), r_debug,
- sizeof(debug_entry))) {
- return false;
- }
- for (struct link_map* ptr = debug_entry.r_map; ptr; ) {
- struct link_map map;
- if (!dumper_->CopyFromProcess(&map, GetCrashThread(), ptr, sizeof(map)))
- return false;
-
- ptr = map.l_next;
- dso_count++;
- }
-
- MDRVA linkmap_rva = minidump_writer_.kInvalidMDRVA;
- if (dso_count > 0) {
- // If we have at least one DSO, create an array of MDRawLinkMap
- // entries in the minidump file.
- TypedMDRVA<MDRawLinkMap> linkmap(&minidump_writer_);
- if (!linkmap.AllocateArray(dso_count))
- return false;
- linkmap_rva = linkmap.location().rva;
- int idx = 0;
-
- // Iterate over DSOs and write their information to mini dump
- for (struct link_map* ptr = debug_entry.r_map; ptr; ) {
- struct link_map map;
- if (!dumper_->CopyFromProcess(&map, GetCrashThread(), ptr, sizeof(map)))
- return false;
-
- ptr = map.l_next;
- char filename[257] = { 0 };
- if (map.l_name) {
- dumper_->CopyFromProcess(filename, GetCrashThread(), map.l_name,
- sizeof(filename) - 1);
- }
- MDLocationDescriptor location;
- if (!minidump_writer_.WriteString(filename, 0, &location))
- return false;
- MDRawLinkMap entry;
- entry.name = location.rva;
- entry.addr = map.l_addr;
- entry.ld = reinterpret_cast<uintptr_t>(map.l_ld);
- linkmap.CopyIndex(idx++, &entry);
- }
- }
-
- // Write MD_LINUX_DSO_DEBUG record
- TypedMDRVA<MDRawDebug> debug(&minidump_writer_);
- if (!debug.AllocateObjectAndArray(1, dynamic_length))
- return false;
- my_memset(debug.get(), 0, sizeof(MDRawDebug));
- dirent->stream_type = MD_LINUX_DSO_DEBUG;
- dirent->location = debug.location();
-
- debug.get()->version = debug_entry.r_version;
- debug.get()->map = linkmap_rva;
- debug.get()->dso_count = dso_count;
- debug.get()->brk = debug_entry.r_brk;
- debug.get()->ldbase = debug_entry.r_ldbase;
- debug.get()->dynamic = reinterpret_cast<uintptr_t>(dynamic);
-
- wasteful_vector<char> dso_debug_data(dumper_->allocator(), dynamic_length);
- // The passed-in size to the constructor (above) is only a hint.
- // Must call .resize() to do actual initialization of the elements.
- dso_debug_data.resize(dynamic_length);
- dumper_->CopyFromProcess(&dso_debug_data[0], GetCrashThread(), dynamic,
- dynamic_length);
- debug.CopyIndexAfterObject(0, &dso_debug_data[0], dynamic_length);
-
- return true;
- }
-
- void set_minidump_size_limit(off_t limit) { minidump_size_limit_ = limit; }
-
- private:
- void* Alloc(unsigned bytes) {
- return dumper_->allocator()->Alloc(bytes);
- }
-
- pid_t GetCrashThread() const {
- return dumper_->crash_thread();
- }
-
- void NullifyDirectoryEntry(MDRawDirectory* dirent) {
- dirent->stream_type = 0;
- dirent->location.data_size = 0;
- dirent->location.rva = 0;
- }
-
-#if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
- bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
- char vendor_id[sizeof(sys_info->cpu.x86_cpu_info.vendor_id) + 1] = {0};
- static const char vendor_id_name[] = "vendor_id";
-
- struct CpuInfoEntry {
- const char* info_name;
- int value;
- bool found;
- } cpu_info_table[] = {
- { "processor", -1, false },
-#if defined(__i386__) || defined(__x86_64__)
- { "model", 0, false },
- { "stepping", 0, false },
- { "cpu family", 0, false },
-#endif
- };
-
- // processor_architecture should always be set, do this first
- sys_info->processor_architecture =
-#if defined(__mips__)
-# if _MIPS_SIM == _ABIO32
- MD_CPU_ARCHITECTURE_MIPS;
-# elif _MIPS_SIM == _ABI64
- MD_CPU_ARCHITECTURE_MIPS64;
-# else
-# error "This mips ABI is currently not supported (n32)"
-#endif
-#elif defined(__i386__)
- MD_CPU_ARCHITECTURE_X86;
-#else
- MD_CPU_ARCHITECTURE_AMD64;
-#endif
-
- const int fd = sys_open("/proc/cpuinfo", O_RDONLY, 0);
- if (fd < 0)
- return false;
-
- {
- PageAllocator allocator;
- ProcCpuInfoReader* const reader = new(allocator) ProcCpuInfoReader(fd);
- const char* field;
- while (reader->GetNextField(&field)) {
- bool is_first_entry = true;
- for (CpuInfoEntry& entry : cpu_info_table) {
- if (!is_first_entry && entry.found) {
- // except for the 'processor' field, ignore repeated values.
- continue;
- }
- is_first_entry = false;
- if (!my_strcmp(field, entry.info_name)) {
- size_t value_len;
- const char* value = reader->GetValueAndLen(&value_len);
- if (value_len == 0)
- continue;
-
- uintptr_t val;
- if (my_read_decimal_ptr(&val, value) == value)
- continue;
-
- entry.value = static_cast<int>(val);
- entry.found = true;
- }
- }
-
- // special case for vendor_id
- if (!my_strcmp(field, vendor_id_name)) {
- size_t value_len;
- const char* value = reader->GetValueAndLen(&value_len);
- if (value_len > 0)
- my_strlcpy(vendor_id, value, sizeof(vendor_id));
- }
- }
- sys_close(fd);
- }
-
- // make sure we got everything we wanted
- for (const CpuInfoEntry& entry : cpu_info_table) {
- if (!entry.found) {
- return false;
- }
- }
- // cpu_info_table[0] holds the last cpu id listed in /proc/cpuinfo,
- // assuming this is the highest id, change it to the number of CPUs
- // by adding one.
- cpu_info_table[0].value++;
-
- sys_info->number_of_processors = cpu_info_table[0].value;
-#if defined(__i386__) || defined(__x86_64__)
- sys_info->processor_level = cpu_info_table[3].value;
- sys_info->processor_revision = cpu_info_table[1].value << 8 |
- cpu_info_table[2].value;
-#endif
-
- if (vendor_id[0] != '\0') {
- my_memcpy(sys_info->cpu.x86_cpu_info.vendor_id, vendor_id,
- sizeof(sys_info->cpu.x86_cpu_info.vendor_id));
- }
- return true;
- }
-#elif defined(__arm__) || defined(__aarch64__)
- bool WriteCPUInformation(MDRawSystemInfo* sys_info) {
- // The CPUID value is broken up in several entries in /proc/cpuinfo.
- // This table is used to rebuild it from the entries.
- const struct CpuIdEntry {
- const char* field;
- char format;
- char bit_lshift;
- char bit_length;
- } cpu_id_entries[] = {
- { "CPU implementer", 'x', 24, 8 },
- { "CPU variant", 'x', 20, 4 },
- { "CPU part", 'x', 4, 12 },
- { "CPU revision", 'd', 0, 4 },
- };
-
- // The ELF hwcaps are listed in the "Features" entry as textual tags.
- // This table is used to rebuild them.
- const struct CpuFeaturesEntry {
- const char* tag;
- uint32_t hwcaps;
- } cpu_features_entries[] = {
-#if defined(__arm__)
- { "swp", MD_CPU_ARM_ELF_HWCAP_SWP },
- { "half", MD_CPU_ARM_ELF_HWCAP_HALF },
- { "thumb", MD_CPU_ARM_ELF_HWCAP_THUMB },
- { "26bit", MD_CPU_ARM_ELF_HWCAP_26BIT },
- { "fastmult", MD_CPU_ARM_ELF_HWCAP_FAST_MULT },
- { "fpa", MD_CPU_ARM_ELF_HWCAP_FPA },
- { "vfp", MD_CPU_ARM_ELF_HWCAP_VFP },
- { "edsp", MD_CPU_ARM_ELF_HWCAP_EDSP },
- { "java", MD_CPU_ARM_ELF_HWCAP_JAVA },
- { "iwmmxt", MD_CPU_ARM_ELF_HWCAP_IWMMXT },
- { "crunch", MD_CPU_ARM_ELF_HWCAP_CRUNCH },
- { "thumbee", MD_CPU_ARM_ELF_HWCAP_THUMBEE },
- { "neon", MD_CPU_ARM_ELF_HWCAP_NEON },
- { "vfpv3", MD_CPU_ARM_ELF_HWCAP_VFPv3 },
- { "vfpv3d16", MD_CPU_ARM_ELF_HWCAP_VFPv3D16 },
- { "tls", MD_CPU_ARM_ELF_HWCAP_TLS },
- { "vfpv4", MD_CPU_ARM_ELF_HWCAP_VFPv4 },
- { "idiva", MD_CPU_ARM_ELF_HWCAP_IDIVA },
- { "idivt", MD_CPU_ARM_ELF_HWCAP_IDIVT },
- { "idiv", MD_CPU_ARM_ELF_HWCAP_IDIVA | MD_CPU_ARM_ELF_HWCAP_IDIVT },
-#elif defined(__aarch64__)
- // No hwcaps on aarch64.
-#endif
- };
-
- // processor_architecture should always be set, do this first
- sys_info->processor_architecture =
-#if defined(__aarch64__)
- MD_CPU_ARCHITECTURE_ARM64;
-#else
- MD_CPU_ARCHITECTURE_ARM;
-#endif
-
- // /proc/cpuinfo is not readable under various sandboxed environments
- // (e.g. Android services with the android:isolatedProcess attribute)
- // prepare for this by setting default values now, which will be
- // returned when this happens.
- //
- // Note: Bogus values are used to distinguish between failures (to
- // read /sys and /proc files) and really badly configured kernels.
- sys_info->number_of_processors = 0;
- sys_info->processor_level = 1U; // There is no ARMv1
- sys_info->processor_revision = 42;
- sys_info->cpu.arm_cpu_info.cpuid = 0;
- sys_info->cpu.arm_cpu_info.elf_hwcaps = 0;
-
- // Counting the number of CPUs involves parsing two sysfs files,
- // because the content of /proc/cpuinfo will only mirror the number
- // of 'online' cores, and thus will vary with time.
- // See http://www.kernel.org/doc/Documentation/cputopology.txt
- {
- CpuSet cpus_present;
- CpuSet cpus_possible;
-
- int fd = sys_open("/sys/devices/system/cpu/present", O_RDONLY, 0);
- if (fd >= 0) {
- cpus_present.ParseSysFile(fd);
- sys_close(fd);
-
- fd = sys_open("/sys/devices/system/cpu/possible", O_RDONLY, 0);
- if (fd >= 0) {
- cpus_possible.ParseSysFile(fd);
- sys_close(fd);
-
- cpus_present.IntersectWith(cpus_possible);
- int cpu_count = cpus_present.GetCount();
- if (cpu_count > 255)
- cpu_count = 255;
- sys_info->number_of_processors = static_cast<uint8_t>(cpu_count);
- }
- }
- }
-
- // Parse /proc/cpuinfo to reconstruct the CPUID value, as well
- // as the ELF hwcaps field. For the latter, it would be easier to
- // read /proc/self/auxv but unfortunately, this file is not always
- // readable from regular Android applications on later versions
- // (>= 4.1) of the Android platform.
- const int fd = sys_open("/proc/cpuinfo", O_RDONLY, 0);
- if (fd < 0) {
- // Do not return false here to allow the minidump generation
- // to happen properly.
- return true;
- }
-
- {
- PageAllocator allocator;
- ProcCpuInfoReader* const reader =
- new(allocator) ProcCpuInfoReader(fd);
- const char* field;
- while (reader->GetNextField(&field)) {
- for (const CpuIdEntry& entry : cpu_id_entries) {
- if (my_strcmp(entry.field, field) != 0)
- continue;
- uintptr_t result = 0;
- const char* value = reader->GetValue();
- const char* p = value;
- if (value[0] == '0' && value[1] == 'x') {
- p = my_read_hex_ptr(&result, value+2);
- } else if (entry.format == 'x') {
- p = my_read_hex_ptr(&result, value);
- } else {
- p = my_read_decimal_ptr(&result, value);
- }
- if (p == value)
- continue;
-
- result &= (1U << entry.bit_length)-1;
- result <<= entry.bit_lshift;
- sys_info->cpu.arm_cpu_info.cpuid |=
- static_cast<uint32_t>(result);
- }
-#if defined(__arm__)
- // Get the architecture version from the "Processor" field.
- // Note that it is also available in the "CPU architecture" field,
- // however, some existing kernels are misconfigured and will report
- // invalid values here (e.g. 6, while the CPU is ARMv7-A based).
- // The "Processor" field doesn't have this issue.
- if (!my_strcmp(field, "Processor")) {
- size_t value_len;
- const char* value = reader->GetValueAndLen(&value_len);
- // Expected format: <text> (v<level><endian>)
- // Where <text> is some text like "ARMv7 Processor rev 2"
- // and <level> is a decimal corresponding to the ARM
- // architecture number. <endian> is either 'l' or 'b'
- // and corresponds to the endianess, it is ignored here.
- while (value_len > 0 && my_isspace(value[value_len-1]))
- value_len--;
-
- size_t nn = value_len;
- while (nn > 0 && value[nn-1] != '(')
- nn--;
- if (nn > 0 && value[nn] == 'v') {
- uintptr_t arch_level = 5;
- my_read_decimal_ptr(&arch_level, value + nn + 1);
- sys_info->processor_level = static_cast<uint16_t>(arch_level);
- }
- }
-#elif defined(__aarch64__)
- // The aarch64 architecture does not provide the architecture level
- // in the Processor field, so we instead check the "CPU architecture"
- // field.
- if (!my_strcmp(field, "CPU architecture")) {
- uintptr_t arch_level = 0;
- const char* value = reader->GetValue();
- const char* p = value;
- p = my_read_decimal_ptr(&arch_level, value);
- if (p == value)
- continue;
- sys_info->processor_level = static_cast<uint16_t>(arch_level);
- }
-#endif
- // Rebuild the ELF hwcaps from the 'Features' field.
- if (!my_strcmp(field, "Features")) {
- size_t value_len;
- const char* value = reader->GetValueAndLen(&value_len);
-
- // Parse each space-separated tag.
- while (value_len > 0) {
- const char* tag = value;
- size_t tag_len = value_len;
- const char* p = my_strchr(tag, ' ');
- if (p) {
- tag_len = static_cast<size_t>(p - tag);
- value += tag_len + 1;
- value_len -= tag_len + 1;
- } else {
- tag_len = strlen(tag);
- value_len = 0;
- }
- for (const CpuFeaturesEntry& entry : cpu_features_entries) {
- if (tag_len == strlen(entry.tag) &&
- !memcmp(tag, entry.tag, tag_len)) {
- sys_info->cpu.arm_cpu_info.elf_hwcaps |= entry.hwcaps;
- break;
- }
- }
- }
- }
- }
- sys_close(fd);
- }
-
- return true;
- }
-#else
-# error "Unsupported CPU"
-#endif
-
- bool WriteFile(MDLocationDescriptor* result, const char* filename) {
- const int fd = sys_open(filename, O_RDONLY, 0);
- if (fd < 0)
- return false;
-
- // We can't stat the files because several of the files that we want to
- // read are kernel seqfiles, which always have a length of zero. So we have
- // to read as much as we can into a buffer.
- static const unsigned kBufSize = 1024 - 2*sizeof(void*);
- struct Buffers {
- Buffers* next;
- size_t len;
- uint8_t data[kBufSize];
- } *buffers = reinterpret_cast<Buffers*>(Alloc(sizeof(Buffers)));
- buffers->next = NULL;
- buffers->len = 0;
-
- size_t total = 0;
- for (Buffers* bufptr = buffers;;) {
- ssize_t r;
- do {
- r = sys_read(fd, &bufptr->data[bufptr->len], kBufSize - bufptr->len);
- } while (r == -1 && errno == EINTR);
-
- if (r < 1)
- break;
-
- total += r;
- bufptr->len += r;
- if (bufptr->len == kBufSize) {
- bufptr->next = reinterpret_cast<Buffers*>(Alloc(sizeof(Buffers)));
- bufptr = bufptr->next;
- bufptr->next = NULL;
- bufptr->len = 0;
- }
- }
- sys_close(fd);
-
- if (!total)
- return false;
-
- UntypedMDRVA memory(&minidump_writer_);
- if (!memory.Allocate(total))
- return false;
- for (MDRVA pos = memory.position(); buffers; buffers = buffers->next) {
- // Check for special case of a zero-length buffer. This should only
- // occur if a file's size happens to be a multiple of the buffer's
- // size, in which case the final sys_read() will have resulted in
- // zero bytes being read after the final buffer was just allocated.
- if (buffers->len == 0) {
- // This can only occur with final buffer.
- assert(buffers->next == NULL);
- continue;
- }
- memory.Copy(pos, &buffers->data, buffers->len);
- pos += buffers->len;
- }
- *result = memory.location();
- return true;
- }
-
- bool WriteOSInformation(MDRawSystemInfo* sys_info) {
-#if defined(__ANDROID__)
- sys_info->platform_id = MD_OS_ANDROID;
-#else
- sys_info->platform_id = MD_OS_LINUX;
-#endif
-
- struct utsname uts;
- if (uname(&uts))
- return false;
-
- static const size_t buf_len = 512;
- char buf[buf_len] = {0};
- size_t space_left = buf_len - 1;
- const char* info_table[] = {
- uts.sysname,
- uts.release,
- uts.version,
- uts.machine,
- NULL
- };
- bool first_item = true;
- for (const char** cur_info = info_table; *cur_info; cur_info++) {
- static const char separator[] = " ";
- size_t separator_len = sizeof(separator) - 1;
- size_t info_len = my_strlen(*cur_info);
- if (info_len == 0)
- continue;
-
- if (space_left < info_len + (first_item ? 0 : separator_len))
- break;
-
- if (!first_item) {
- my_strlcat(buf, separator, sizeof(buf));
- space_left -= separator_len;
- }
-
- first_item = false;
- my_strlcat(buf, *cur_info, sizeof(buf));
- space_left -= info_len;
- }
-
- MDLocationDescriptor location;
- if (!minidump_writer_.WriteString(buf, 0, &location))
- return false;
- sys_info->csd_version_rva = location.rva;
-
- return true;
- }
-
- bool WriteProcFile(MDLocationDescriptor* result, pid_t pid,
- const char* filename) {
- char buf[NAME_MAX];
- if (!dumper_->BuildProcPath(buf, pid, filename))
- return false;
- return WriteFile(result, buf);
- }
-
- // Only one of the 2 member variables below should be set to a valid value.
- const int fd_; // File descriptor where the minidum should be written.
- const char* path_; // Path to the file where the minidum should be written.
-
- const ucontext_t* const ucontext_; // also from the signal handler
-#if !defined(__ARM_EABI__) && !defined(__mips__)
- const google_breakpad::fpstate_t* const float_state_; // ditto
-#endif
- LinuxDumper* dumper_;
- MinidumpFileWriter minidump_writer_;
- off_t minidump_size_limit_;
- MDLocationDescriptor crashing_thread_context_;
- // Blocks of memory written to the dump. These are all currently
- // written while writing the thread list stream, but saved here
- // so a memory list stream can be written afterwards.
- wasteful_vector<MDMemoryDescriptor> memory_blocks_;
- // Additional information about some mappings provided by the caller.
- const MappingList& mapping_list_;
- // Additional memory regions to be included in the dump,
- // provided by the caller.
- const AppMemoryList& app_memory_list_;
-};
-
-
-bool WriteMinidumpImpl(const char* minidump_path,
- int minidump_fd,
- off_t minidump_size_limit,
- pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appmem) {
- LinuxPtraceDumper dumper(crashing_process);
- const ExceptionHandler::CrashContext* context = NULL;
- if (blob) {
- if (blob_size != sizeof(ExceptionHandler::CrashContext))
- return false;
- context = reinterpret_cast<const ExceptionHandler::CrashContext*>(blob);
- dumper.set_crash_address(
- reinterpret_cast<uintptr_t>(context->siginfo.si_addr));
- dumper.set_crash_signal(context->siginfo.si_signo);
- dumper.set_crash_thread(context->tid);
- }
- MinidumpWriter writer(minidump_path, minidump_fd, context, mappings,
- appmem, &dumper);
- // Set desired limit for file size of minidump (-1 means no limit).
- writer.set_minidump_size_limit(minidump_size_limit);
- if (!writer.Init())
- return false;
- return writer.Dump();
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
- const void* blob, size_t blob_size) {
- return WriteMinidumpImpl(minidump_path, -1, -1,
- crashing_process, blob, blob_size,
- MappingList(), AppMemoryList());
-}
-
-bool WriteMinidump(int minidump_fd, pid_t crashing_process,
- const void* blob, size_t blob_size) {
- return WriteMinidumpImpl(NULL, minidump_fd, -1,
- crashing_process, blob, blob_size,
- MappingList(), AppMemoryList());
-}
-
-bool WriteMinidump(const char* minidump_path, pid_t process,
- pid_t process_blamed_thread) {
- LinuxPtraceDumper dumper(process);
- // MinidumpWriter will set crash address
- dumper.set_crash_signal(MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED);
- dumper.set_crash_thread(process_blamed_thread);
- MinidumpWriter writer(minidump_path, -1, NULL, MappingList(),
- AppMemoryList(), &dumper);
- if (!writer.Init())
- return false;
- return writer.Dump();
-}
-
-bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appmem) {
- return WriteMinidumpImpl(minidump_path, -1, -1, crashing_process,
- blob, blob_size,
- mappings, appmem);
-}
-
-bool WriteMinidump(int minidump_fd, pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appmem) {
- return WriteMinidumpImpl(NULL, minidump_fd, -1, crashing_process,
- blob, blob_size,
- mappings, appmem);
-}
-
-bool WriteMinidump(const char* minidump_path, off_t minidump_size_limit,
- pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appmem) {
- return WriteMinidumpImpl(minidump_path, -1, minidump_size_limit,
- crashing_process, blob, blob_size,
- mappings, appmem);
-}
-
-bool WriteMinidump(int minidump_fd, off_t minidump_size_limit,
- pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appmem) {
- return WriteMinidumpImpl(NULL, minidump_fd, minidump_size_limit,
- crashing_process, blob, blob_size,
- mappings, appmem);
-}
-
-bool WriteMinidump(const char* filename,
- const MappingList& mappings,
- const AppMemoryList& appmem,
- LinuxDumper* dumper) {
- MinidumpWriter writer(filename, -1, NULL, mappings, appmem, dumper);
- if (!writer.Init())
- return false;
- return writer.Dump();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h
deleted file mode 100644
index d13fb120b5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer.h
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_
-
-#include <stdint.h>
-#include <sys/types.h>
-#include <sys/ucontext.h>
-#include <unistd.h>
-
-#include <list>
-#include <utility>
-
-#include "client/linux/minidump_writer/linux_dumper.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-class ExceptionHandler;
-
-#if defined(__aarch64__)
-typedef struct fpsimd_context fpstate_t;
-#elif !defined(__ARM_EABI__) && !defined(__mips__)
-typedef struct _libc_fpstate fpstate_t;
-#endif
-
-// These entries store a list of memory regions that the client wants included
-// in the minidump.
-struct AppMemory {
- void* ptr;
- size_t length;
-
- bool operator==(const struct AppMemory& other) const {
- return ptr == other.ptr;
- }
-
- bool operator==(const void* other) const {
- return ptr == other;
- }
-};
-typedef std::list<AppMemory> AppMemoryList;
-
-// Writes a minidump to the filesystem. These functions do not malloc nor use
-// libc functions which may. Thus, it can be used in contexts where the state
-// of the heap may be corrupt.
-// minidump_path: the path to the file to write to. This is opened O_EXCL and
-// fails open fails.
-// crashing_process: the pid of the crashing process. This must be trusted.
-// blob: a blob of data from the crashing process. See exception_handler.h
-// blob_size: the length of |blob|, in bytes
-//
-// Returns true iff successful.
-bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
- const void* blob, size_t blob_size);
-// Same as above but takes an open file descriptor instead of a path.
-bool WriteMinidump(int minidump_fd, pid_t crashing_process,
- const void* blob, size_t blob_size);
-
-// Alternate form of WriteMinidump() that works with processes that
-// are not expected to have crashed. If |process_blamed_thread| is
-// meaningful, it will be the one from which a crash signature is
-// extracted. It is not expected that this function will be called
-// from a compromised context, but it is safe to do so.
-bool WriteMinidump(const char* minidump_path, pid_t process,
- pid_t process_blamed_thread);
-
-// These overloads also allow passing a list of known mappings and
-// a list of additional memory regions to be included in the minidump.
-bool WriteMinidump(const char* minidump_path, pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appdata);
-bool WriteMinidump(int minidump_fd, pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appdata);
-
-// These overloads also allow passing a file size limit for the minidump.
-bool WriteMinidump(const char* minidump_path, off_t minidump_size_limit,
- pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appdata);
-bool WriteMinidump(int minidump_fd, off_t minidump_size_limit,
- pid_t crashing_process,
- const void* blob, size_t blob_size,
- const MappingList& mappings,
- const AppMemoryList& appdata);
-
-bool WriteMinidump(const char* filename,
- const MappingList& mappings,
- const AppMemoryList& appdata,
- LinuxDumper* dumper);
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
deleted file mode 100644
index 2e4749e7e9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest.cc
+++ /dev/null
@@ -1,775 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <fcntl.h>
-#include <sys/poll.h>
-#include <sys/stat.h>
-#include <sys/syscall.h>
-#include <sys/types.h>
-#include <ucontext.h>
-#include <unistd.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/linux/handler/exception_handler.h"
-#include "client/linux/minidump_writer/linux_dumper.h"
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "client/linux/minidump_writer/minidump_writer_unittest_utils.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/file_id.h"
-#include "common/linux/ignore_ret.h"
-#include "common/linux/safe_readlink.h"
-#include "common/scoped_ptr.h"
-#include "common/tests/auto_tempdir.h"
-#include "common/tests/file_utils.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/minidump.h"
-
-using namespace google_breakpad;
-
-namespace {
-
-typedef testing::Test MinidumpWriterTest;
-
-const char kMDWriterUnitTestFileName[] = "/minidump-writer-unittest";
-
-TEST(MinidumpWriterTest, SetupWithPath) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
-
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + kMDWriterUnitTestFileName;
- // Set a non-zero tid to avoid tripping asserts.
- context.tid = child;
- ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context)));
- struct stat st;
- ASSERT_EQ(0, stat(templ.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- close(fds[1]);
-}
-
-TEST(MinidumpWriterTest, SetupWithFD) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
-
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + kMDWriterUnitTestFileName;
- int fd = open(templ.c_str(), O_CREAT | O_WRONLY, S_IRWXU);
- // Set a non-zero tid to avoid tripping asserts.
- context.tid = child;
- ASSERT_TRUE(WriteMinidump(fd, child, &context, sizeof(context)));
- struct stat st;
- ASSERT_EQ(0, stat(templ.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- close(fds[1]);
-}
-
-// Test that mapping info can be specified when writing a minidump,
-// and that it ends up in the module list of the minidump.
-TEST(MinidumpWriterTest, MappingInfo) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t memory_size = sysconf(_SC_PAGESIZE);
- const char* kMemoryName = "a fake module";
- const uint8_t kModuleGUID[sizeof(MDGUID)] = {
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
- };
- const string module_identifier = "33221100554477668899AABBCCDDEEFF0";
-
- // Get some memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- memory_size,
- PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
- ASSERT_EQ(0, getcontext(&context.context));
- context.tid = child;
-
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + kMDWriterUnitTestFileName;
-
- // Add information about the mapped memory.
- MappingInfo info;
- info.start_addr = kMemoryAddress;
- info.size = memory_size;
- info.offset = 0;
- info.exec = false;
- strcpy(info.name, kMemoryName);
-
- MappingList mappings;
- AppMemoryList memory_list;
- MappingEntry mapping;
- mapping.first = info;
- memcpy(mapping.second, kModuleGUID, sizeof(MDGUID));
- mappings.push_back(mapping);
- ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context),
- mappings, memory_list));
-
- // Read the minidump. Load the module list, and ensure that
- // the mmap'ed |memory| is listed with the given module name
- // and debug ID.
- Minidump minidump(templ);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* module =
- module_list->GetModuleForAddress(kMemoryAddress);
- ASSERT_TRUE(module);
-
- EXPECT_EQ(kMemoryAddress, module->base_address());
- EXPECT_EQ(memory_size, module->size());
- EXPECT_EQ(kMemoryName, module->code_file());
- EXPECT_EQ(module_identifier, module->debug_identifier());
-
- uint32_t len;
- // These streams are expected to be there
- EXPECT_TRUE(minidump.SeekToStreamType(MD_THREAD_LIST_STREAM, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_MEMORY_LIST_STREAM, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_EXCEPTION_STREAM, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_SYSTEM_INFO_STREAM, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_CPU_INFO, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_PROC_STATUS, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_CMD_LINE, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_ENVIRON, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_AUXV, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_MAPS, &len));
- EXPECT_TRUE(minidump.SeekToStreamType(MD_LINUX_DSO_DEBUG, &len));
-
- close(fds[1]);
-}
-
-// Test that a binary with a longer-than-usual build id note
-// makes its way all the way through to the minidump unscathed.
-// The linux_client_unittest is linked with an explicit --build-id
-// in Makefile.am.
-TEST(MinidumpWriterTest, BuildIDLong) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
- ASSERT_EQ(0, getcontext(&context.context));
- context.tid = child;
-
- AutoTempDir temp_dir;
- const string dump_path = temp_dir.path() + kMDWriterUnitTestFileName;
-
- EXPECT_TRUE(WriteMinidump(dump_path.c_str(),
- child, &context, sizeof(context)));
- close(fds[1]);
-
- // Read the minidump. Load the module list, and ensure that
- // the main module has the correct debug id and code id.
- Minidump minidump(dump_path);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* module = module_list->GetMainModule();
- ASSERT_TRUE(module);
- const string module_identifier = "030201000504070608090A0B0C0D0E0F0";
- // This is passed explicitly to the linker in Makefile.am
- const string build_id =
- "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f";
- EXPECT_EQ(module_identifier, module->debug_identifier());
- EXPECT_EQ(build_id, module->code_identifier());
-}
-
-// Test that mapping info can be specified, and that it overrides
-// existing mappings that are wholly contained within the specified
-// range.
-TEST(MinidumpWriterTest, MappingInfoContained) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const int32_t memory_size = sysconf(_SC_PAGESIZE);
- const char* kMemoryName = "a fake module";
- const uint8_t kModuleGUID[sizeof(MDGUID)] = {
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
- 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF
- };
- const string module_identifier = "33221100554477668899AABBCCDDEEFF0";
-
- // mmap a file
- AutoTempDir temp_dir;
- string tempfile = temp_dir.path() + "/minidump-writer-unittest-temp";
- int fd = open(tempfile.c_str(), O_RDWR | O_CREAT, 0);
- ASSERT_NE(-1, fd);
- unlink(tempfile.c_str());
- // fill with zeros
- google_breakpad::scoped_array<char> buffer(new char[memory_size]);
- memset(buffer.get(), 0, memory_size);
- ASSERT_EQ(memory_size, write(fd, buffer.get(), memory_size));
- lseek(fd, 0, SEEK_SET);
-
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- memory_size,
- PROT_READ | PROT_WRITE,
- MAP_PRIVATE,
- fd,
- 0));
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
- close(fd);
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- IGNORE_RET(HANDLE_EINTR(read(fds[0], &b, sizeof(b))));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
- context.tid = 1;
-
- string dumpfile = temp_dir.path() + kMDWriterUnitTestFileName;
-
- // Add information about the mapped memory. Report it as being larger than
- // it actually is.
- MappingInfo info;
- info.start_addr = kMemoryAddress - memory_size;
- info.size = memory_size * 3;
- info.offset = 0;
- info.exec = false;
- strcpy(info.name, kMemoryName);
-
- MappingList mappings;
- AppMemoryList memory_list;
- MappingEntry mapping;
- mapping.first = info;
- memcpy(mapping.second, kModuleGUID, sizeof(MDGUID));
- mappings.push_back(mapping);
- ASSERT_TRUE(WriteMinidump(dumpfile.c_str(), child, &context, sizeof(context),
- mappings, memory_list));
-
- // Read the minidump. Load the module list, and ensure that
- // the mmap'ed |memory| is listed with the given module name
- // and debug ID.
- Minidump minidump(dumpfile);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* module =
- module_list->GetModuleForAddress(kMemoryAddress);
- ASSERT_TRUE(module);
-
- EXPECT_EQ(info.start_addr, module->base_address());
- EXPECT_EQ(info.size, module->size());
- EXPECT_EQ(kMemoryName, module->code_file());
- EXPECT_EQ(module_identifier, module->debug_identifier());
-
- close(fds[1]);
-}
-
-TEST(MinidumpWriterTest, DeletedBinary) {
- const string kNumberOfThreadsArgument = "1";
- const string helper_path(GetHelperBinary());
- if (helper_path.empty()) {
- FAIL() << "Couldn't find helper binary";
- exit(1);
- }
-
- // Copy binary to a temp file.
- AutoTempDir temp_dir;
- string binpath = temp_dir.path() + "/linux-dumper-unittest-helper";
- ASSERT_TRUE(CopyFile(helper_path.c_str(), binpath.c_str()))
- << "Failed to copy " << helper_path << " to " << binpath;
- ASSERT_EQ(0, chmod(binpath.c_str(), 0755));
-
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- pid_t child_pid = fork();
- if (child_pid == 0) {
- // In child process.
- close(fds[0]);
-
- // Pass the pipe fd and the number of threads as arguments.
- char pipe_fd_string[8];
- sprintf(pipe_fd_string, "%d", fds[1]);
- execl(binpath.c_str(),
- binpath.c_str(),
- pipe_fd_string,
- kNumberOfThreadsArgument.c_str(),
- NULL);
- }
- close(fds[1]);
- // Wait for the child process to signal that it's ready.
- struct pollfd pfd;
- memset(&pfd, 0, sizeof(pfd));
- pfd.fd = fds[0];
- pfd.events = POLLIN | POLLERR;
-
- const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
- ASSERT_EQ(1, r);
- ASSERT_TRUE(pfd.revents & POLLIN);
- uint8_t junk;
- const int nr = HANDLE_EINTR(read(fds[0], &junk, sizeof(junk)));
- ASSERT_EQ(static_cast<ssize_t>(sizeof(junk)), nr);
- close(fds[0]);
-
- // Child is ready now.
- // Unlink the test binary.
- unlink(binpath.c_str());
-
- ExceptionHandler::CrashContext context;
- memset(&context, 0, sizeof(context));
-
- string templ = temp_dir.path() + kMDWriterUnitTestFileName;
- // Set a non-zero tid to avoid tripping asserts.
- context.tid = child_pid;
- ASSERT_TRUE(WriteMinidump(templ.c_str(), child_pid, &context,
- sizeof(context)));
- kill(child_pid, SIGKILL);
-
- struct stat st;
- ASSERT_EQ(0, stat(templ.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
-
- Minidump minidump(templ);
- ASSERT_TRUE(minidump.Read());
-
- // Check that the main module filename is correct.
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* module = module_list->GetMainModule();
- EXPECT_STREQ(binpath.c_str(), module->code_file().c_str());
- // Check that the file ID is correct.
- FileID fileid(helper_path.c_str());
- PageAllocator allocator;
- wasteful_vector<uint8_t> identifier(&allocator, kDefaultBuildIdSize);
- EXPECT_TRUE(fileid.ElfFileIdentifier(identifier));
- string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
- string module_identifier(identifier_string);
- // Strip out dashes
- size_t pos;
- while ((pos = module_identifier.find('-')) != string::npos) {
- module_identifier.erase(pos, 1);
- }
- // And append a zero, because module IDs include an "age" field
- // which is always zero on Linux.
- module_identifier += "0";
- EXPECT_EQ(module_identifier, module->debug_identifier());
-}
-
-// Test that an additional memory region can be added to the minidump.
-TEST(MinidumpWriterTest, AdditionalMemory) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t kMemorySize = sysconf(_SC_PAGESIZE);
-
- // Get some heap memory.
- uint8_t* memory = new uint8_t[kMemorySize];
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- // Stick some data into the memory so the contents can be verified.
- for (uint32_t i = 0; i < kMemorySize; ++i) {
- memory[i] = i % 255;
- }
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
-
- // This needs a valid context for minidump writing to work, but getting
- // a useful one from the child is too much work, so just use one from
- // the parent since the child is just a forked copy anyway.
- ASSERT_EQ(0, getcontext(&context.context));
- context.tid = child;
-
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + kMDWriterUnitTestFileName;
- unlink(templ.c_str());
-
- MappingList mappings;
- AppMemoryList memory_list;
-
- // Add the memory region to the list of memory to be included.
- AppMemory app_memory;
- app_memory.ptr = memory;
- app_memory.length = kMemorySize;
- memory_list.push_back(app_memory);
- ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context),
- mappings, memory_list));
-
- // Read the minidump. Ensure that the memory region is present
- Minidump minidump(templ);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpMemoryList* dump_memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(dump_memory_list);
- const MinidumpMemoryRegion* region =
- dump_memory_list->GetMemoryRegionForAddress(kMemoryAddress);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemoryAddress, region->GetBase());
- EXPECT_EQ(kMemorySize, region->GetSize());
-
- // Verify memory contents.
- EXPECT_EQ(0, memcmp(region->GetMemory(), memory, kMemorySize));
-
- delete[] memory;
- close(fds[1]);
-}
-
-// Test that an invalid thread stack pointer still results in a minidump.
-TEST(MinidumpWriterTest, InvalidStackPointer) {
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- const pid_t child = fork();
- if (child == 0) {
- close(fds[1]);
- char b;
- HANDLE_EINTR(read(fds[0], &b, sizeof(b)));
- close(fds[0]);
- syscall(__NR_exit);
- }
- close(fds[0]);
-
- ExceptionHandler::CrashContext context;
-
- // This needs a valid context for minidump writing to work, but getting
- // a useful one from the child is too much work, so just use one from
- // the parent since the child is just a forked copy anyway.
- ASSERT_EQ(0, getcontext(&context.context));
- context.tid = child;
-
- // Fake the child's stack pointer for its crashing thread. NOTE: This must
- // be an invalid memory address for the child process (stack or otherwise).
- // Try 1MB below the current stack.
- uintptr_t invalid_stack_pointer =
- reinterpret_cast<uintptr_t>(&context) - 1024*1024;
-#if defined(__i386)
- context.context.uc_mcontext.gregs[REG_ESP] = invalid_stack_pointer;
-#elif defined(__x86_64)
- context.context.uc_mcontext.gregs[REG_RSP] = invalid_stack_pointer;
-#elif defined(__ARM_EABI__)
- context.context.uc_mcontext.arm_sp = invalid_stack_pointer;
-#elif defined(__aarch64__)
- context.context.uc_mcontext.sp = invalid_stack_pointer;
-#elif defined(__mips__)
- context.context.uc_mcontext.gregs[MD_CONTEXT_MIPS_REG_SP] =
- invalid_stack_pointer;
-#else
-# error "This code has not been ported to your platform yet."
-#endif
-
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + kMDWriterUnitTestFileName;
- // NOTE: In previous versions of Breakpad, WriteMinidump() would fail if
- // presented with an invalid stack pointer.
- ASSERT_TRUE(WriteMinidump(templ.c_str(), child, &context, sizeof(context)));
-
- // Read the minidump. Ensure that the memory region is present
- Minidump minidump(templ);
- ASSERT_TRUE(minidump.Read());
-
- // TODO(ted.mielczarek,mkrebs): Enable this part of the test once
- // https://breakpad.appspot.com/413002/ is committed.
-#if 0
- // Make sure there's a thread without a stack. NOTE: It's okay if
- // GetThreadList() shows the error: "ERROR: MinidumpThread has a memory
- // region problem".
- MinidumpThreadList* dump_thread_list = minidump.GetThreadList();
- ASSERT_TRUE(dump_thread_list);
- bool found_empty_stack = false;
- for (int i = 0; i < dump_thread_list->thread_count(); i++) {
- MinidumpThread* thread = dump_thread_list->GetThreadAtIndex(i);
- ASSERT_TRUE(thread->thread() != NULL);
- // When the stack size is zero bytes, GetMemory() returns NULL.
- if (thread->GetMemory() == NULL) {
- found_empty_stack = true;
- break;
- }
- }
- // NOTE: If you fail this, first make sure that "invalid_stack_pointer"
- // above is indeed set to an invalid address.
- ASSERT_TRUE(found_empty_stack);
-#endif
-
- close(fds[1]);
-}
-
-// Test that limiting the size of the minidump works.
-TEST(MinidumpWriterTest, MinidumpSizeLimit) {
- static const int kNumberOfThreadsInHelperProgram = 40;
-
- char number_of_threads_arg[3];
- sprintf(number_of_threads_arg, "%d", kNumberOfThreadsInHelperProgram);
-
- string helper_path(GetHelperBinary());
- if (helper_path.empty()) {
- FAIL() << "Couldn't find helper binary";
- exit(1);
- }
-
- int fds[2];
- ASSERT_NE(-1, pipe(fds));
-
- pid_t child_pid = fork();
- if (child_pid == 0) {
- // In child process.
- close(fds[0]);
-
- // Pass the pipe fd and the number of threads as arguments.
- char pipe_fd_string[8];
- sprintf(pipe_fd_string, "%d", fds[1]);
- execl(helper_path.c_str(),
- helper_path.c_str(),
- pipe_fd_string,
- number_of_threads_arg,
- NULL);
- }
- close(fds[1]);
-
- // Wait for all child threads to indicate that they have started
- for (int threads = 0; threads < kNumberOfThreadsInHelperProgram; threads++) {
- struct pollfd pfd;
- memset(&pfd, 0, sizeof(pfd));
- pfd.fd = fds[0];
- pfd.events = POLLIN | POLLERR;
-
- const int r = HANDLE_EINTR(poll(&pfd, 1, 1000));
- ASSERT_EQ(1, r);
- ASSERT_TRUE(pfd.revents & POLLIN);
- uint8_t junk;
- ASSERT_EQ(read(fds[0], &junk, sizeof(junk)),
- static_cast<ssize_t>(sizeof(junk)));
- }
- close(fds[0]);
-
- // There is a race here because we may stop a child thread before
- // it is actually running the busy loop. Empirically this sleep
- // is sufficient to avoid the race.
- usleep(100000);
-
- // Child and its threads are ready now.
-
-
- off_t normal_file_size;
- int total_normal_stack_size = 0;
- AutoTempDir temp_dir;
-
- // First, write a minidump with no size limit.
- {
- string normal_dump = temp_dir.path() +
- "/minidump-writer-unittest.dmp";
- ASSERT_TRUE(WriteMinidump(normal_dump.c_str(), -1,
- child_pid, NULL, 0,
- MappingList(), AppMemoryList()));
- struct stat st;
- ASSERT_EQ(0, stat(normal_dump.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
- normal_file_size = st.st_size;
-
- Minidump minidump(normal_dump);
- ASSERT_TRUE(minidump.Read());
- MinidumpThreadList* dump_thread_list = minidump.GetThreadList();
- ASSERT_TRUE(dump_thread_list);
- for (unsigned int i = 0; i < dump_thread_list->thread_count(); i++) {
- MinidumpThread* thread = dump_thread_list->GetThreadAtIndex(i);
- ASSERT_TRUE(thread->thread() != NULL);
- // When the stack size is zero bytes, GetMemory() returns NULL.
- MinidumpMemoryRegion* memory = thread->GetMemory();
- ASSERT_TRUE(memory != NULL);
- total_normal_stack_size += memory->GetSize();
- }
- }
-
- // Second, write a minidump with a size limit big enough to not trigger
- // anything.
- {
- // Set size limit arbitrarily 1MB larger than the normal file size -- such
- // that the limiting code will not kick in.
- const off_t minidump_size_limit = normal_file_size + 1024*1024;
-
- string same_dump = temp_dir.path() +
- "/minidump-writer-unittest-same.dmp";
- ASSERT_TRUE(WriteMinidump(same_dump.c_str(), minidump_size_limit,
- child_pid, NULL, 0,
- MappingList(), AppMemoryList()));
- struct stat st;
- ASSERT_EQ(0, stat(same_dump.c_str(), &st));
- // Make sure limiting wasn't actually triggered. NOTE: If you fail this,
- // first make sure that "minidump_size_limit" above is indeed set to a
- // large enough value -- the limit-checking code in minidump_writer.cc
- // does just a rough estimate.
- ASSERT_EQ(normal_file_size, st.st_size);
- }
-
- // Third, write a minidump with a size limit small enough to be triggered.
- {
- // Set size limit to some arbitrary amount, such that the limiting code
- // will kick in. The equation used to set this value was determined by
- // simply reversing the size-limit logic a little bit in order to pick a
- // size we know will trigger it. The definition of
- // kLimitAverageThreadStackLength here was copied from class
- // MinidumpWriter in minidump_writer.cc.
- static const unsigned kLimitAverageThreadStackLength = 8 * 1024;
- off_t minidump_size_limit = kNumberOfThreadsInHelperProgram *
- kLimitAverageThreadStackLength;
- // If, in reality, each of the threads' stack is *smaller* than
- // kLimitAverageThreadStackLength, the normal file size could very well be
- // smaller than the arbitrary limit that was just set. In that case,
- // either of these numbers should trigger the size-limiting code, but we
- // might as well pick the smallest.
- if (normal_file_size < minidump_size_limit)
- minidump_size_limit = normal_file_size;
-
- string limit_dump = temp_dir.path() +
- "/minidump-writer-unittest-limit.dmp";
- ASSERT_TRUE(WriteMinidump(limit_dump.c_str(), minidump_size_limit,
- child_pid, NULL, 0,
- MappingList(), AppMemoryList()));
- struct stat st;
- ASSERT_EQ(0, stat(limit_dump.c_str(), &st));
- ASSERT_GT(st.st_size, 0);
- // Make sure the file size is at least smaller than the original. If this
- // fails because it's the same size, then the size-limit logic didn't kick
- // in like it was supposed to.
- EXPECT_LT(st.st_size, normal_file_size);
-
- Minidump minidump(limit_dump);
- ASSERT_TRUE(minidump.Read());
- MinidumpThreadList* dump_thread_list = minidump.GetThreadList();
- ASSERT_TRUE(dump_thread_list);
- int total_limit_stack_size = 0;
- for (unsigned int i = 0; i < dump_thread_list->thread_count(); i++) {
- MinidumpThread* thread = dump_thread_list->GetThreadAtIndex(i);
- ASSERT_TRUE(thread->thread() != NULL);
- // When the stack size is zero bytes, GetMemory() returns NULL.
- MinidumpMemoryRegion* memory = thread->GetMemory();
- ASSERT_TRUE(memory != NULL);
- total_limit_stack_size += memory->GetSize();
- }
-
- // Make sure stack size shrunk by at least 1KB per extra thread. The
- // definition of kLimitBaseThreadCount here was copied from class
- // MinidumpWriter in minidump_writer.cc.
- // Note: The 1KB is arbitrary, and assumes that the thread stacks are big
- // enough to shrink by that much. For example, if each thread stack was
- // originally only 2KB, the current size-limit logic wouldn't actually
- // shrink them because that's the size to which it tries to shrink. If
- // you fail this part of the test due to something like that, the test
- // logic should probably be improved to account for your situation.
- const unsigned kLimitBaseThreadCount = 20;
- const unsigned kMinPerExtraThreadStackReduction = 1024;
- const int min_expected_reduction = (kNumberOfThreadsInHelperProgram -
- kLimitBaseThreadCount) * kMinPerExtraThreadStackReduction;
- EXPECT_LT(total_limit_stack_size,
- total_normal_stack_size - min_expected_reduction);
- }
-
- // Kill the helper program.
- kill(child_pid, SIGKILL);
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
deleted file mode 100644
index 9f46fa65c8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_writer_unittest_utils.cc:
-// Shared routines used by unittests under client/linux/minidump_writer.
-
-#include <limits.h>
-#include <stdlib.h>
-
-#include "client/linux/minidump_writer/minidump_writer_unittest_utils.h"
-#include "common/linux/safe_readlink.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-string GetHelperBinary() {
- string helper_path;
- char *bindir = getenv("bindir");
- if (bindir) {
- helper_path = string(bindir) + "/";
- } else {
- // Locate helper binary next to the current binary.
- char self_path[PATH_MAX];
- if (!SafeReadLink("/proc/self/exe", self_path)) {
- return "";
- }
- helper_path = string(self_path);
- size_t pos = helper_path.rfind('/');
- if (pos == string::npos) {
- return "";
- }
- helper_path.erase(pos + 1);
- }
-
- helper_path += "linux_dumper_unittest_helper";
-
- return helper_path;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h
deleted file mode 100644
index f16cc086bd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/minidump_writer_unittest_utils.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_writer_unittest_utils.h:
-// Shared routines used by unittests under client/linux/minidump_writer.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_UNITTEST_UTILS_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_UNITTEST_UTILS_H_
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// Returns the full path to linux_dumper_unittest_helper. The full path is
-// discovered either by using the environment variable "bindir" or by using
-// the location of the main module of the currently running process.
-string GetHelperBinary();
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_MINIDUMP_WRITER_UNITTEST_UTILS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h
deleted file mode 100644
index d9461bf301..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_LINUX_MINIDUMP_WRITER_PROC_CPUINFO_READER_H_
-#define CLIENT_LINUX_MINIDUMP_WRITER_PROC_CPUINFO_READER_H_
-
-#include <stdint.h>
-#include <assert.h>
-#include <string.h>
-
-#include "client/linux/minidump_writer/line_reader.h"
-#include "common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-// A class for reading /proc/cpuinfo without using fopen/fgets or other
-// functions which may allocate memory.
-class ProcCpuInfoReader {
-public:
- ProcCpuInfoReader(int fd)
- : line_reader_(fd), pop_count_(-1) {
- }
-
- // Return the next field name, or NULL in case of EOF.
- // field: (output) Pointer to zero-terminated field name.
- // Returns true on success, or false on EOF or error (line too long).
- bool GetNextField(const char** field) {
- for (;;) {
- const char* line;
- unsigned line_len;
-
- // Try to read next line.
- if (pop_count_ >= 0) {
- line_reader_.PopLine(pop_count_);
- pop_count_ = -1;
- }
-
- if (!line_reader_.GetNextLine(&line, &line_len))
- return false;
-
- pop_count_ = static_cast<int>(line_len);
-
- const char* line_end = line + line_len;
-
- // Expected format: <field-name> <space>+ ':' <space> <value>
- // Note that:
- // - empty lines happen.
- // - <field-name> can contain spaces.
- // - some fields have an empty <value>
- char* sep = static_cast<char*>(my_memchr(line, ':', line_len));
- if (sep == NULL)
- continue;
-
- // Record the value. Skip leading space after the column to get
- // its start.
- const char* val = sep+1;
- while (val < line_end && my_isspace(*val))
- val++;
-
- value_ = val;
- value_len_ = static_cast<size_t>(line_end - val);
-
- // Remove trailing spaces before the column to properly 0-terminate
- // the field name.
- while (sep > line && my_isspace(sep[-1]))
- sep--;
-
- if (sep == line)
- continue;
-
- // zero-terminate field name.
- *sep = '\0';
-
- *field = line;
- return true;
- }
- }
-
- // Return the field value. This must be called after a succesful
- // call to GetNextField().
- const char* GetValue() {
- assert(value_);
- return value_;
- }
-
- // Same as GetValue(), but also returns the length in characters of
- // the value.
- const char* GetValueAndLen(size_t* length) {
- assert(value_);
- *length = value_len_;
- return value_;
- }
-
-private:
- LineReader line_reader_;
- int pop_count_;
- const char* value_;
- size_t value_len_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_LINUX_MINIDUMP_WRITER_PROC_CPUINFO_READER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
deleted file mode 100644
index 6037c7e665..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/proc_cpuinfo_reader_unittest.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-
-#include "client/linux/minidump_writer/proc_cpuinfo_reader.h"
-#include "breakpad_googletest_includes.h"
-#include "common/linux/tests/auto_testfile.h"
-
-using namespace google_breakpad;
-
-#if !defined(__ANDROID__)
-#define TEMPDIR "/tmp"
-#else
-#define TEMPDIR "/data/local/tmp"
-#endif
-
-
-namespace {
-
-typedef testing::Test ProcCpuInfoReaderTest;
-
-class ScopedTestFile : public AutoTestFile {
-public:
- explicit ScopedTestFile(const char* text)
- : AutoTestFile("proc_cpuinfo_reader", text) {
- }
-};
-
-}
-
-TEST(ProcCpuInfoReaderTest, EmptyFile) {
- ScopedTestFile file("");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char *field;
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, OneLineTerminated) {
- ScopedTestFile file("foo : bar\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char *field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, OneLine) {
- ScopedTestFile file("foo : bar");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char *field;
- size_t value_len;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValueAndLen(&value_len));
- ASSERT_EQ(3U, value_len);
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, TwoLinesTerminated) {
- ScopedTestFile file("foo : bar\nzoo : tut\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValue());
-
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("zoo", field);
- ASSERT_STREQ("tut", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, SkipMalformedLine) {
- ScopedTestFile file("this line should have a column\nfoo : bar\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, SkipOneEmptyLine) {
- ScopedTestFile file("\n\nfoo : bar\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, SkipEmptyField) {
- ScopedTestFile file(" : bar\nzoo : tut\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("zoo", field);
- ASSERT_STREQ("tut", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, SkipTwoEmptyLines) {
- ScopedTestFile file("foo : bar\n\n\nfoo : bar\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValue());
-
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- ASSERT_STREQ("bar", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, FieldWithSpaces) {
- ScopedTestFile file("foo bar : zoo\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo bar", field);
- ASSERT_STREQ("zoo", reader.GetValue());
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
-
-TEST(ProcCpuInfoReaderTest, EmptyValue) {
- ScopedTestFile file("foo :\n");
- ASSERT_TRUE(file.IsOk());
- ProcCpuInfoReader reader(file.GetFd());
-
- const char* field;
- ASSERT_TRUE(reader.GetNextField(&field));
- ASSERT_STREQ("foo", field);
- size_t value_len;
- ASSERT_STREQ("", reader.GetValueAndLen(&value_len));
- ASSERT_EQ(0U, value_len);
-
- ASSERT_FALSE(reader.GetNextField(&field));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/moz.build b/toolkit/crashreporter/google-breakpad/src/client/linux/moz.build
deleted file mode 100644
index 9bb8bace32..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/moz.build
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'crash_generation/crash_generation_client.cc',
- 'crash_generation/crash_generation_server.cc',
- 'dump_writer_common/thread_info.cc',
- 'dump_writer_common/ucontext_reader.cc',
- 'handler/exception_handler.cc',
- 'handler/minidump_descriptor.cc',
- 'log/log.cc',
- 'microdump_writer/microdump_writer.cc',
- 'minidump_writer/linux_dumper.cc',
- 'minidump_writer/linux_ptrace_dumper.cc',
- 'minidump_writer/minidump_writer.cc',
-]
-
-if CONFIG['OS_TARGET'] == 'Android':
- LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src/common/android/include',
- ]
-
-# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
-
-FINAL_LIBRARY = 'xul'
-
-if CONFIG['OS_TARGET'] == 'Android' and CONFIG['CPU_ARCH'] == 'x86':
- # The NDK's user.h defines this struct with a different name.
- DEFINES['user_fpxregs_struct'] = 'user_fxsr_struct'
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/sender/google_crash_report_sender.cc b/toolkit/crashreporter/google-breakpad/src/client/linux/sender/google_crash_report_sender.cc
deleted file mode 100644
index ec6c06e87d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/sender/google_crash_report_sender.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/linux/google_crashdump_uploader.h"
-#include "third_party/linux/include/gflags/gflags.h"
-#include <string>
-#include <iostream>
-
-#include "common/using_std_string.h"
-
-DEFINE_string(crash_server, "https://clients2.google.com/cr",
- "The crash server to upload minidumps to.");
-DEFINE_string(product_name, "",
- "The product name that the minidump corresponds to.");
-DEFINE_string(product_version, "",
- "The version of the product that produced the minidump.");
-DEFINE_string(client_id, "",
- "The client GUID");
-DEFINE_string(minidump_path, "",
- "The path of the minidump file.");
-DEFINE_string(ptime, "",
- "The process uptime in milliseconds.");
-DEFINE_string(ctime, "",
- "The cumulative process uptime in milliseconds.");
-DEFINE_string(email, "",
- "The user's email address.");
-DEFINE_string(comments, "",
- "Extra user comments");
-DEFINE_string(proxy_host, "",
- "Proxy host");
-DEFINE_string(proxy_userpasswd, "",
- "Proxy username/password in user:pass format.");
-
-
-bool CheckForRequiredFlagsOrDie() {
- string error_text = "";
- if (FLAGS_product_name.empty()) {
- error_text.append("\nProduct name must be specified.");
- }
-
- if (FLAGS_product_version.empty()) {
- error_text.append("\nProduct version must be specified.");
- }
-
- if (FLAGS_client_id.empty()) {
- error_text.append("\nClient ID must be specified.");
- }
-
- if (FLAGS_minidump_path.empty()) {
- error_text.append("\nMinidump pathname must be specified.");
- }
-
- if (!error_text.empty()) {
- std::cout << error_text;
- return false;
- }
- return true;
-}
-
-int main(int argc, char *argv[]) {
- google::InitGoogleLogging(argv[0]);
- google::ParseCommandLineFlags(&argc, &argv, true);
- if (!CheckForRequiredFlagsOrDie()) {
- return 1;
- }
- google_breakpad::GoogleCrashdumpUploader g(FLAGS_product_name,
- FLAGS_product_version,
- FLAGS_client_id,
- FLAGS_ptime,
- FLAGS_ctime,
- FLAGS_email,
- FLAGS_comments,
- FLAGS_minidump_path,
- FLAGS_crash_server,
- FLAGS_proxy_host,
- FLAGS_proxy_userpasswd);
- g.Upload(NULL, NULL, NULL);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj
deleted file mode 100644
index 1a93ce6dd6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Breakpad.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,2788 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 45;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- F94585840F782326009A47BF /* All */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = F94585930F78235C009A47BF /* Build configuration list for PBXAggregateTarget "All" */;
- buildPhases = (
- );
- dependencies = (
- F94585880F78232B009A47BF /* PBXTargetDependency */,
- F945858A0F78232E009A47BF /* PBXTargetDependency */,
- F945858C0F782330009A47BF /* PBXTargetDependency */,
- F945858E0F782333009A47BF /* PBXTargetDependency */,
- F94585900F782336009A47BF /* PBXTargetDependency */,
- F93DE3A70F830D1D00608B94 /* PBXTargetDependency */,
- F95BB8B3101F94D300AA053B /* PBXTargetDependency */,
- F95BB8B5101F94D300AA053B /* PBXTargetDependency */,
- F95BB8B7101F94D300AA053B /* PBXTargetDependency */,
- 8B31023911F0CF0600FCF3E4 /* PBXTargetDependency */,
- 8B31051711F1010E00FCF3E4 /* PBXTargetDependency */,
- 8B31051911F1010E00FCF3E4 /* PBXTargetDependency */,
- 8B31051B11F1010E00FCF3E4 /* PBXTargetDependency */,
- 8B31051D11F1010E00FCF3E4 /* PBXTargetDependency */,
- 8B31051F11F1010E00FCF3E4 /* PBXTargetDependency */,
- );
- name = All;
- productName = All;
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
- 162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; };
- 162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 162F64F1161C577500CD68D5 /* arch_utilities.h */; };
- 162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F0161C577500CD68D5 /* arch_utilities.cc */; };
- 162F64F5161C579B00CD68D5 /* arch_utilities.h in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F1161C577500CD68D5 /* arch_utilities.h */; };
- 163201D61443019E00C4DBF5 /* ConfigFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 163201D41443019E00C4DBF5 /* ConfigFile.h */; };
- 163201D71443019E00C4DBF5 /* ConfigFile.mm in Sources */ = {isa = PBXBuildFile; fileRef = 163201D51443019E00C4DBF5 /* ConfigFile.mm */; };
- 163201E31443029300C4DBF5 /* ConfigFile.mm in Sources */ = {isa = PBXBuildFile; fileRef = 163201D51443019E00C4DBF5 /* ConfigFile.mm */; };
- 16C7C918147D45AE00776EAD /* BreakpadDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 16C7C917147D45AE00776EAD /* BreakpadDefines.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 16E02DB8147410F0008C604D /* uploader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 16E02DB4147410D4008C604D /* uploader.mm */; };
- 1EEEB6231720829E00F7E689 /* simple_string_dictionary.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1EEEB6211720829E00F7E689 /* simple_string_dictionary.cc */; };
- 1EEEB6241720829E00F7E689 /* simple_string_dictionary.h in Headers */ = {isa = PBXBuildFile; fileRef = 1EEEB6221720829E00F7E689 /* simple_string_dictionary.h */; };
- 1EEEB6271720831E00F7E689 /* BreakpadFramework_Test.mm in Sources */ = {isa = PBXBuildFile; fileRef = F91AF5CF0FD60393009D8BE2 /* BreakpadFramework_Test.mm */; };
- 1EEEB62A1720859200F7E689 /* simple_string_dictionary_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1EEEB6251720830600F7E689 /* simple_string_dictionary_unittest.cc */; };
- 1EEEB62B1720868C00F7E689 /* simple_string_dictionary.cc in Sources */ = {isa = PBXBuildFile; fileRef = 1EEEB6211720829E00F7E689 /* simple_string_dictionary.cc */; };
- 3329D4ED0FA16D820007BBC5 /* Breakpad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3329D4EC0FA16D820007BBC5 /* Breakpad.xib */; };
- 33880C800F9E097100817F82 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 33880C7E0F9E097100817F82 /* InfoPlist.strings */; };
- 4084699D0F5D9CF900FDCA37 /* crash_report_sender.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */; };
- 4D61A25F14F43CFC002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
- 4D61A26B14F43D3C002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
- 4D61A26C14F43D42002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
- 4D61A26D14F43D43002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
- 4D61A26E14F43D45002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
- 4D61A26F14F43D48002D5862 /* bootstrap_compat.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */; };
- 4D72CA0E13DFAD5C006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
- 4D72CA2513DFAE1C006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
- 4D72CA2F13DFAE65006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
- 4D72CA3813DFAE91006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
- 4D72CA3913DFAE92006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA0D13DFAD5C006CABE3 /* md5.cc */; };
- 4DBE49A6134A4F200072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
- 4DBE49A7134A4F280072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
- 4DBE49A8134A4F380072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
- 4DBE49A9134A4F460072546A /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DBE4769134A4F080072546A /* CoreServices.framework */; };
- 8B3101C611F0CD9F00FCF3E4 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
- 8B3101C711F0CD9F00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- 8B3101CA11F0CDB000FCF3E4 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D6A5FE840307C02AAC07 /* AppKit.framework */; };
- 8B3101CB11F0CDB000FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- 8B3101EA11F0CDE300FCF3E4 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */; };
- 8B31029411F0D54300FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- 8B3102E611F0D74C00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- 8B3102EB11F0D78000FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- 8B31FC8211EFD2B800FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */; };
- D23F4B2E12A7E13200686C8D /* minidump_generator_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D23F4B2C12A7E13200686C8D /* minidump_generator_test.cc */; };
- D23F4B3312A7E17700686C8D /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2F9A41512131EF0002747C1 /* libgtest.a */; };
- D23F4BB112A868CB00686C8D /* minidump_generator_test_helper.cc in Sources */ = {isa = PBXBuildFile; fileRef = D23F4B9A12A8688800686C8D /* minidump_generator_test_helper.cc */; };
- D23F4BB812A868F700686C8D /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
- D244536A12426F00009BBCE0 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535112426EBB009BBCE0 /* logging.cc */; };
- D244536B12426F00009BBCE0 /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535212426EBB009BBCE0 /* minidump.cc */; };
- D244536C12426F00009BBCE0 /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535312426EBB009BBCE0 /* pathname_stripper.cc */; };
- D244536D12426F00009BBCE0 /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244534F12426E98009BBCE0 /* basic_code_modules.cc */; };
- D244540B12439BA0009BBCE0 /* memory_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244540A12439BA0009BBCE0 /* memory_unittest.cc */; };
- D246417012BAA40E005170D0 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
- D246417112BAA41C005170D0 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; };
- D246417512BAA438005170D0 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
- D246417612BAA43F005170D0 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
- D246417712BAA444005170D0 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; };
- D246418412BAA4BA005170D0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- D246418812BAA4E3005170D0 /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
- D246418C12BAA508005170D0 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- D246419012BAA52A005170D0 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- D246419112BAA52F005170D0 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
- D246419512BAA54C005170D0 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
- D246419612BAA55A005170D0 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
- D24641A012BAA67F005170D0 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
- D24641AF12BAA82D005170D0 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
- D24641EC12BAC6FB005170D0 /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535112426EBB009BBCE0 /* logging.cc */; };
- D24641ED12BAC6FB005170D0 /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535212426EBB009BBCE0 /* minidump.cc */; };
- D24641EE12BAC6FB005170D0 /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535312426EBB009BBCE0 /* pathname_stripper.cc */; };
- D24641EF12BAC6FB005170D0 /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244534F12426E98009BBCE0 /* basic_code_modules.cc */; };
- D24BBBFD121050F000F3D417 /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
- D24BBD291211EDB100F3D417 /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
- D24BBD321212CACF00F3D417 /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
- D2A5DD301188633800081F03 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; };
- D2A5DD401188640400081F03 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; };
- D2A5DD411188642E00081F03 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; };
- D2C1DBE412AFC270006917BD /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535112426EBB009BBCE0 /* logging.cc */; };
- D2C1DBE512AFC270006917BD /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535212426EBB009BBCE0 /* minidump.cc */; };
- D2C1DBE612AFC270006917BD /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244535312426EBB009BBCE0 /* pathname_stripper.cc */; };
- D2C1DBE712AFC270006917BD /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = D244534F12426E98009BBCE0 /* basic_code_modules.cc */; };
- D2F9A3D51212F87C002747C1 /* exception_handler_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */; };
- D2F9A43D12131F55002747C1 /* gmock-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A43C12131F55002747C1 /* gmock-all.cc */; };
- D2F9A44012131F65002747C1 /* gtest_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A43E12131F65002747C1 /* gtest_main.cc */; };
- D2F9A44112131F65002747C1 /* gtest-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A43F12131F65002747C1 /* gtest-all.cc */; };
- D2F9A44412131F84002747C1 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2F9A41512131EF0002747C1 /* libgtest.a */; };
- D2F9A4C9121336C7002747C1 /* client_info.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F9A4C4121336C7002747C1 /* client_info.h */; };
- D2F9A4CA121336C7002747C1 /* crash_generation_client.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F9A4C5121336C7002747C1 /* crash_generation_client.h */; };
- D2F9A4CB121336C7002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; };
- D2F9A4CC121336C7002747C1 /* crash_generation_server.h in Headers */ = {isa = PBXBuildFile; fileRef = D2F9A4C7121336C7002747C1 /* crash_generation_server.h */; };
- D2F9A4CD121336C7002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; };
- D2F9A4DF12133AD9002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; };
- D2F9A4E012133AD9002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; };
- D2F9A4E112133AE2002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; };
- D2F9A4E212133AE2002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; };
- D2F9A52E121383A1002747C1 /* crash_generation_client.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */; };
- D2F9A52F121383A1002747C1 /* crash_generation_server.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */; };
- D2F9A530121383A1002747C1 /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
- D2F9A531121383A1002747C1 /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */; };
- D2F9A532121383A1002747C1 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
- D2F9A533121383A1002747C1 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
- D2F9A534121383A1002747C1 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
- D2F9A535121383A1002747C1 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- D2F9A536121383A1002747C1 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
- D2F9A537121383A1002747C1 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- D2F9A538121383A1002747C1 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
- D2F9A539121383A1002747C1 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
- D2F9A53A121383A1002747C1 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
- D2F9A53B121383A1002747C1 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
- D2F9A53C121383A1002747C1 /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
- D2F9A53F121383A1002747C1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- D2F9A541121383A1002747C1 /* libgtest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D2F9A41512131EF0002747C1 /* libgtest.a */; };
- D2F9A553121383DC002747C1 /* crash_generation_server_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F9A4CE121336F7002747C1 /* crash_generation_server_test.cc */; };
- F4DAB1DD19F1027100A5A838 /* launch_reporter.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4DAB1DB19F1027100A5A838 /* launch_reporter.cc */; };
- F4DAB1DE19F1027100A5A838 /* launch_reporter.h in Headers */ = {isa = PBXBuildFile; fileRef = F4DAB1DC19F1027100A5A838 /* launch_reporter.h */; };
- F4F916B619F10FFC00B83BE4 /* launch_reporter.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4DAB1DB19F1027100A5A838 /* launch_reporter.cc */; };
- F91AF6210FD60784009D8BE2 /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
- F9286B3A0F7EB25800A4DCC8 /* InspectorMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9286B390F7EB25800A4DCC8 /* InspectorMain.mm */; };
- F92C53B80ECCE7B3009BE4BA /* Inspector.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53B70ECCE7B3009BE4BA /* Inspector.mm */; };
- F92C554C0ECCF534009BE4BA /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0867D69BFE84028FC02AAC07 /* Foundation.framework */; };
- F92C55D00ECD0064009BE4BA /* Breakpad.h in Headers */ = {isa = PBXBuildFile; fileRef = F92C55CE0ECD0064009BE4BA /* Breakpad.h */; settings = {ATTRIBUTES = (Public, ); }; };
- F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C55CF0ECD0064009BE4BA /* Breakpad.mm */; };
- F92C56330ECD0DF1009BE4BA /* OnDemandServer.h in Headers */ = {isa = PBXBuildFile; fileRef = F92C56310ECD0DF1009BE4BA /* OnDemandServer.h */; };
- F92C56340ECD0DF1009BE4BA /* OnDemandServer.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C56320ECD0DF1009BE4BA /* OnDemandServer.mm */; };
- F92C563F0ECD10CA009BE4BA /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
- F92C56400ECD10CA009BE4BA /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
- F92C56410ECD10CA009BE4BA /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
- F92C56420ECD10CA009BE4BA /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
- F92C56430ECD10CA009BE4BA /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
- F92C56440ECD10CA009BE4BA /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
- F92C56450ECD10CA009BE4BA /* MachIPC.mm in Sources */ = {isa = PBXBuildFile; fileRef = F92C53790ECCE635009BE4BA /* MachIPC.mm */; };
- F92C56460ECD10CA009BE4BA /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F92C56470ECD10CA009BE4BA /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
- F92C56490ECD10CA009BE4BA /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
- F92C564A0ECD10CA009BE4BA /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- F92C564C0ECD10DD009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
- F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C554A0ECCF530009BE4BA /* Carbon.framework */; };
- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
- F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */; };
- F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */ = {isa = PBXBuildFile; fileRef = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */; };
- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */ = {isa = PBXBuildFile; fileRef = F92C53540ECCE349009BE4BA /* Inspector */; };
- F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */; };
- F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
- F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
- F93803CF0F8083B7004D428B /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
- F93803D00F8083B7004D428B /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F93803D10F8083B7004D428B /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
- F93803D20F8083B7004D428B /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- F93803D30F8083B7004D428B /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
- F93803D40F8083B7004D428B /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
- F93803D50F8083B7004D428B /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
- F93803D60F8083B7004D428B /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
- F93803D70F8083B7004D428B /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
- F93DE2D80F82A70E00608B94 /* minidump_file_writer_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = F93DE2D70F82A70E00608B94 /* minidump_file_writer_unittest.cc */; };
- F93DE2D90F82A73500608B94 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F93DE2DA0F82A73500608B94 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
- F93DE2DB0F82A73500608B94 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- F93DE3350F82C66B00608B94 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */; };
- F93DE3360F82C66B00608B94 /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */; };
- F93DE3370F82C66B00608B94 /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */; };
- F93DE3380F82C66B00608B94 /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */; };
- F93DE3390F82C66B00608B94 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = F92C53870ECCE6C0009BE4BA /* convert_UTF.c */; };
- F93DE33A0F82C66B00608B94 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53850ECCE6AD009BE4BA /* string_conversion.cc */; };
- F93DE33B0F82C66B00608B94 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53740ECCE635009BE4BA /* file_id.cc */; };
- F93DE33C0F82C66B00608B94 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537A0ECCE635009BE4BA /* macho_id.cc */; };
- F93DE33D0F82C66B00608B94 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537C0ECCE635009BE4BA /* macho_utilities.cc */; };
- F93DE33E0F82C66B00608B94 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C537E0ECCE635009BE4BA /* macho_walker.cc */; };
- F93DE33F0F82C66B00608B94 /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = F92C53820ECCE635009BE4BA /* string_utilities.cc */; };
- F945849E0F280E3C009A47BF /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F945849C0F280E3C009A47BF /* Localizable.strings */; };
- F9B630A0100FF96B00D0F4AC /* goArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = F9B6309F100FF96B00D0F4AC /* goArrow.png */; };
- F9C44DB20EF07288003AEBAA /* Controller.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44DAC0EF07288003AEBAA /* Controller.m */; };
- F9C44DB30EF07288003AEBAA /* crashduringload in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DAD0EF07288003AEBAA /* crashduringload */; };
- F9C44DB40EF07288003AEBAA /* crashInMain in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DAE0EF07288003AEBAA /* crashInMain */; };
- F9C44DB60EF07288003AEBAA /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44DB00EF07288003AEBAA /* main.m */; };
- F9C44DB70EF07288003AEBAA /* TestClass.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9C44DB10EF07288003AEBAA /* TestClass.mm */; };
- F9C44DBC0EF072A0003AEBAA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DB80EF072A0003AEBAA /* InfoPlist.strings */; };
- F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */; };
- F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
- F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */; };
- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */ = {isa = PBXBuildFile; fileRef = F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */; };
- F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */; };
- F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */; };
- F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */; };
- F9C77E130F7DDF810045F7DB /* GTMSenTestCase.m in Sources */ = {isa = PBXBuildFile; fileRef = F9C77E120F7DDF810045F7DB /* GTMSenTestCase.m */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 8B31023811F0CF0600FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = B88FAFC9116BDCAD00407530;
- remoteInfo = all_unittests;
- };
- 8B31051611F1010E00FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F93803BD0F80820F004D428B;
- remoteInfo = generator_test;
- };
- 8B31051811F1010E00FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F93DE2D00F82A67300608B94;
- remoteInfo = minidump_file_writer_unittest;
- };
- 8B31051A11F1010E00FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F93DE32B0F82C55600608B94;
- remoteInfo = handler_test;
- };
- 8B31051C11F1010E00FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = B89E0E731166575200DD08C9;
- remoteInfo = macho_dump;
- };
- 8B31051E11F1010E00FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB894101F94C000AA053B /* symupload.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = 9BD835FA0B0544950055103E;
- remoteInfo = minidump_upload;
- };
- 8B31F7A011EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B89E0E741166575200DD08C9;
- remoteInfo = macho_dump;
- };
- 8B31F7A211EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB024116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- 8B31F7A411EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB14B116CF4A700407530;
- remoteInfo = byte_cursor_unittest;
- };
- 8B31F7A611EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B89E0E9511665A6400DD08C9;
- remoteInfo = macho_reader_unittest;
- };
- 8B31F7A811EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB007116BDE8300407530;
- remoteInfo = stabs_reader_unittest;
- };
- 8B31F7AA11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB135116CF30F00407530;
- remoteInfo = bytereader_unittest;
- };
- 8B31F7AC11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FAF2F116A591E00407530;
- remoteInfo = dwarf2reader_cfi_unittest;
- };
- 8B31F7AE11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB0DF116CEEA800407530;
- remoteInfo = dwarf2diehandler_unittest;
- };
- 8B31F7B011EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB10A116CF07900407530;
- remoteInfo = dwarf_cu_to_module_unittest;
- };
- 8B31F7B211EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB0F2116CEF1900407530;
- remoteInfo = dwarf_line_to_module_unittest;
- };
- 8B31F7B411EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB11F116CF27F00407530;
- remoteInfo = dwarf_cfi_to_module_unittest;
- };
- 8B31F7B611EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B84A91F4116CF784006C210E;
- remoteInfo = stabs_to_module_unittest;
- };
- 8B31F7B811EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = B88FB0B9116CEABF00407530;
- remoteInfo = module_unittest;
- };
- 8B31F7BA11EF9A8700FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = D21F97D211CBA0F200239E38;
- remoteInfo = test_assembler_unittest;
- };
- D23F4B2F12A7E16200686C8D /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D2F9A41412131EF0002747C1;
- remoteInfo = gtest;
- };
- D23F4BB912A8694C00686C8D /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D23F4BAA12A868A500686C8D;
- remoteInfo = minidump_generator_test_helper;
- };
- D2F9A44212131F80002747C1 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D2F9A41412131EF0002747C1;
- remoteInfo = gtest;
- };
- D2F9A52C121383A1002747C1 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D2F9A41412131EF0002747C1;
- remoteInfo = gtest;
- };
- D2F9A5DE12142A6A002747C1 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D2F9A52A121383A1002747C1;
- remoteInfo = crash_generation_server_test;
- };
- F91AF6370FD60A74009D8BE2 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
- remoteInfo = Breakpad;
- };
- F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
- remoteInfo = breakpadUtilities;
- };
- F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
- remoteInfo = breakpadUtilities;
- };
- F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C53530ECCE349009BE4BA;
- remoteInfo = Inspector;
- };
- F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F93803BD0F80820F004D428B;
- remoteInfo = generator_test;
- };
- F93DE36F0F82CC1300608B94 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F93DE32B0F82C55600608B94;
- remoteInfo = handler_test;
- };
- F93DE3A60F830D1D00608B94 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F9C77DD90F7DD5CF0045F7DB;
- remoteInfo = UnitTests;
- };
- F94585870F78232B009A47BF /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
- remoteInfo = Breakpad;
- };
- F94585890F78232E009A47BF /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C53530ECCE349009BE4BA;
- remoteInfo = Inspector;
- };
- F945858B0F782330009A47BF /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C563B0ECD10B3009BE4BA;
- remoteInfo = breakpadUtilities;
- };
- F945858D0F782333009A47BF /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C569F0ECE04A7009BE4BA;
- remoteInfo = crash_report_sender;
- };
- F945858F0F782336009A47BF /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F9C44DA40EF060A8003AEBAA;
- remoteInfo = BreakpadTest;
- };
- F95BB884101F949F00AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB87C101F949F00AA053B /* crash_report.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 8DD76FA10486AA7600D96B5E;
- remoteInfo = crash_report;
- };
- F95BB891101F94AC00AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 8DD76FA10486AA7600D96B5E;
- remoteInfo = dump_syms;
- };
- F95BB89E101F94C000AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB894101F94C000AA053B /* symupload.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 8DD76FA10486AA7600D96B5E;
- remoteInfo = symupload;
- };
- F95BB8A0101F94C000AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB894101F94C000AA053B /* symupload.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 9BD835FB0B0544950055103E;
- remoteInfo = minidump_upload;
- };
- F95BB8B2101F94D300AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = B8C5B5101166531A00D34F4E;
- remoteInfo = dump_syms;
- };
- F95BB8B4101F94D300AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB894101F94C000AA053B /* symupload.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = 8DD76F960486AA7600D96B5E;
- remoteInfo = symupload;
- };
- F95BB8B6101F94D300AA053B /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = F95BB87C101F949F00AA053B /* crash_report.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = 8DD76F960486AA7600D96B5E;
- remoteInfo = crash_report;
- };
- F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = 8DC2EF4F0486A6940098B216;
- remoteInfo = Breakpad;
- };
- F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 0867D690FE84028FC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = F92C569F0ECE04A7009BE4BA;
- remoteInfo = crash_report_sender;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- F9C44E410EF08B17003AEBAA /* Copy Frameworks */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 2147483647;
- dstPath = "";
- dstSubfolderSpec = 10;
- files = (
- F9C44E3C0EF08B12003AEBAA /* Breakpad.framework in Copy Frameworks */,
- );
- name = "Copy Frameworks";
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
- 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
- 162F64F0161C577500CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
- 162F64F1161C577500CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
- 163201D41443019E00C4DBF5 /* ConfigFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ConfigFile.h; path = crash_generation/ConfigFile.h; sourceTree = "<group>"; };
- 163201D51443019E00C4DBF5 /* ConfigFile.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = ConfigFile.mm; path = crash_generation/ConfigFile.mm; sourceTree = "<group>"; };
- 163202431443201300C4DBF5 /* uploader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = uploader.h; path = sender/uploader.h; sourceTree = "<group>"; };
- 16C7C917147D45AE00776EAD /* BreakpadDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BreakpadDefines.h; sourceTree = "<group>"; };
- 16E02DB4147410D4008C604D /* uploader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = uploader.mm; path = sender/uploader.mm; sourceTree = "<group>"; };
- 1EEEB6211720829E00F7E689 /* simple_string_dictionary.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = simple_string_dictionary.cc; path = ../../common/simple_string_dictionary.cc; sourceTree = "<group>"; };
- 1EEEB6221720829E00F7E689 /* simple_string_dictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simple_string_dictionary.h; path = ../../common/simple_string_dictionary.h; sourceTree = "<group>"; };
- 1EEEB6251720830600F7E689 /* simple_string_dictionary_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = simple_string_dictionary_unittest.cc; path = ../../common/simple_string_dictionary_unittest.cc; sourceTree = "<group>"; };
- 32DBCF5E0370ADEE00C91783 /* Breakpad_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpad_Prefix.pch; path = Framework/Breakpad_Prefix.pch; sourceTree = "<group>"; };
- 3329D4EC0FA16D820007BBC5 /* Breakpad.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Breakpad.xib; path = sender/Breakpad.xib; sourceTree = "<group>"; };
- 33880C7F0F9E097100817F82 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = sender/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- 4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = crash_report_sender.icns; path = sender/crash_report_sender.icns; sourceTree = "<group>"; };
- 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bootstrap_compat.cc; path = ../../common/mac/bootstrap_compat.cc; sourceTree = SOURCE_ROOT; };
- 4D61A25E14F43CFC002D5862 /* bootstrap_compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bootstrap_compat.h; path = ../../common/mac/bootstrap_compat.h; sourceTree = SOURCE_ROOT; };
- 4D72CA0D13DFAD5C006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../common/md5.cc; sourceTree = SOURCE_ROOT; };
- 4DBE4769134A4F080072546A /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; };
- 8B31007011F0CD3C00FCF3E4 /* GTMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMDefines.h; path = ../../common/mac/GTMDefines.h; sourceTree = SOURCE_ROOT; };
- 8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
- 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B31FFF611F0C90500FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
- 8DC2EF5B0486A6940098B216 /* Breakpad.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Breakpad.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- D23F4B2C12A7E13200686C8D /* minidump_generator_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_generator_test.cc; path = tests/minidump_generator_test.cc; sourceTree = "<group>"; };
- D23F4B9A12A8688800686C8D /* minidump_generator_test_helper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_generator_test_helper.cc; path = tests/minidump_generator_test_helper.cc; sourceTree = "<group>"; };
- D23F4BAB12A868A500686C8D /* minidump_generator_test_helper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidump_generator_test_helper; sourceTree = BUILT_PRODUCTS_DIR; };
- D244534F12426E98009BBCE0 /* basic_code_modules.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = basic_code_modules.cc; path = ../../processor/basic_code_modules.cc; sourceTree = SOURCE_ROOT; };
- D244535112426EBB009BBCE0 /* logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cc; path = ../../processor/logging.cc; sourceTree = SOURCE_ROOT; };
- D244535212426EBB009BBCE0 /* minidump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump.cc; path = ../../processor/minidump.cc; sourceTree = SOURCE_ROOT; };
- D244535312426EBB009BBCE0 /* pathname_stripper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pathname_stripper.cc; path = ../../processor/pathname_stripper.cc; sourceTree = SOURCE_ROOT; };
- D244540A12439BA0009BBCE0 /* memory_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = memory_unittest.cc; path = ../../common/memory_unittest.cc; sourceTree = SOURCE_ROOT; };
- D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler_test.cc; path = tests/exception_handler_test.cc; sourceTree = "<group>"; };
- D2F9A41512131EF0002747C1 /* libgtest.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgtest.a; sourceTree = BUILT_PRODUCTS_DIR; };
- D2F9A43C12131F55002747C1 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../testing/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; };
- D2F9A43E12131F65002747C1 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../testing/gtest/src/gtest_main.cc; sourceTree = "<group>"; };
- D2F9A43F12131F65002747C1 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../testing/gtest/src/gtest-all.cc"; sourceTree = "<group>"; };
- D2F9A4C4121336C7002747C1 /* client_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = client_info.h; path = crash_generation/client_info.h; sourceTree = "<group>"; };
- D2F9A4C5121336C7002747C1 /* crash_generation_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crash_generation_client.h; path = crash_generation/crash_generation_client.h; sourceTree = "<group>"; };
- D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_client.cc; path = crash_generation/crash_generation_client.cc; sourceTree = "<group>"; };
- D2F9A4C7121336C7002747C1 /* crash_generation_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crash_generation_server.h; path = crash_generation/crash_generation_server.h; sourceTree = "<group>"; };
- D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_server.cc; path = crash_generation/crash_generation_server.cc; sourceTree = "<group>"; };
- D2F9A4CE121336F7002747C1 /* crash_generation_server_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = crash_generation_server_test.cc; path = tests/crash_generation_server_test.cc; sourceTree = "<group>"; };
- D2F9A546121383A1002747C1 /* crash_generation_server_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = crash_generation_server_test; sourceTree = BUILT_PRODUCTS_DIR; };
- DE43467411C72855004F095F /* da */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = da; path = sender/da.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467511C72857004F095F /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = sender/de.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467611C7285B004F095F /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = sender/es.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467711C72862004F095F /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = sender/fr.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467811C72869004F095F /* it */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = it; path = sender/it.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467911C7286D004F095F /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = sender/nl.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467A11C72873004F095F /* no */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = no; path = sender/no.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467B11C72877004F095F /* sl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sl; path = sender/sl.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467C11C7287A004F095F /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sender/sv.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467E11C728DC004F095F /* ja */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ja; path = sender/ja.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43467F11C728E1004F095F /* tr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = tr; path = sender/tr.lproj/Localizable.strings; sourceTree = "<group>"; };
- DE43468611C72958004F095F /* de */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = de; path = sender/de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468711C7295D004F095F /* da */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = da; path = sender/da.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468811C7295F004F095F /* es */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = es; path = sender/es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468911C72964004F095F /* fr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = fr; path = sender/fr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468A11C72967004F095F /* it */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = it; path = sender/it.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468B11C7296B004F095F /* ja */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = ja; path = sender/ja.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468C11C7296D004F095F /* nl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = nl; path = sender/nl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468D11C7296F004F095F /* no */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = no; path = sender/no.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468E11C72971004F095F /* sl */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sl; path = sender/sl.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43468F11C72973004F095F /* sv */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = sv; path = sender/sv.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- DE43469011C72976004F095F /* tr */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = tr; path = sender/tr.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- F4DAB1DB19F1027100A5A838 /* launch_reporter.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = launch_reporter.cc; path = ../../common/mac/launch_reporter.cc; sourceTree = SOURCE_ROOT; };
- F4DAB1DC19F1027100A5A838 /* launch_reporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = launch_reporter.h; path = ../../common/mac/launch_reporter.h; sourceTree = SOURCE_ROOT; };
- F91AF5CF0FD60393009D8BE2 /* BreakpadFramework_Test.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = BreakpadFramework_Test.mm; path = tests/BreakpadFramework_Test.mm; sourceTree = "<group>"; };
- F9286B380F7EB25800A4DCC8 /* Inspector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Inspector.h; path = crash_generation/Inspector.h; sourceTree = "<group>"; };
- F9286B390F7EB25800A4DCC8 /* InspectorMain.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = InspectorMain.mm; path = crash_generation/InspectorMain.mm; sourceTree = "<group>"; };
- F92C53540ECCE349009BE4BA /* Inspector */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Inspector; sourceTree = BUILT_PRODUCTS_DIR; };
- F92C53670ECCE3FD009BE4BA /* breakpad_exc_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = breakpad_exc_server.c; path = handler/breakpad_exc_server.c; sourceTree = SOURCE_ROOT; };
- F92C53680ECCE3FD009BE4BA /* breakpad_exc_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = breakpad_exc_server.h; path = handler/breakpad_exc_server.h; sourceTree = SOURCE_ROOT; };
- F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = breakpad_nlist_64.cc; path = handler/breakpad_nlist_64.cc; sourceTree = SOURCE_ROOT; };
- F92C536A0ECCE3FD009BE4BA /* breakpad_nlist_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = breakpad_nlist_64.h; path = handler/breakpad_nlist_64.h; sourceTree = SOURCE_ROOT; };
- F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dynamic_images.cc; path = handler/dynamic_images.cc; sourceTree = SOURCE_ROOT; };
- F92C536C0ECCE3FD009BE4BA /* dynamic_images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dynamic_images.h; path = handler/dynamic_images.h; sourceTree = SOURCE_ROOT; };
- F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exception_handler.cc; path = handler/exception_handler.cc; sourceTree = SOURCE_ROOT; };
- F92C536E0ECCE3FD009BE4BA /* exception_handler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = exception_handler.h; path = handler/exception_handler.h; sourceTree = SOURCE_ROOT; };
- F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_generator.cc; path = handler/minidump_generator.cc; sourceTree = SOURCE_ROOT; };
- F92C53700ECCE3FD009BE4BA /* minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_generator.h; path = handler/minidump_generator.h; sourceTree = SOURCE_ROOT; };
- F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = protected_memory_allocator.cc; path = handler/protected_memory_allocator.cc; sourceTree = SOURCE_ROOT; };
- F92C53730ECCE3FD009BE4BA /* protected_memory_allocator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = protected_memory_allocator.h; path = handler/protected_memory_allocator.h; sourceTree = SOURCE_ROOT; };
- F92C53740ECCE635009BE4BA /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; };
- F92C53750ECCE635009BE4BA /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ../../common/mac/file_id.h; sourceTree = SOURCE_ROOT; };
- F92C53760ECCE635009BE4BA /* HTTPMultipartUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPMultipartUpload.h; path = ../../common/mac/HTTPMultipartUpload.h; sourceTree = SOURCE_ROOT; };
- F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPMultipartUpload.m; path = ../../common/mac/HTTPMultipartUpload.m; sourceTree = SOURCE_ROOT; };
- F92C53780ECCE635009BE4BA /* MachIPC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MachIPC.h; path = ../../common/mac/MachIPC.h; sourceTree = SOURCE_ROOT; };
- F92C53790ECCE635009BE4BA /* MachIPC.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MachIPC.mm; path = ../../common/mac/MachIPC.mm; sourceTree = SOURCE_ROOT; };
- F92C537A0ECCE635009BE4BA /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ../../common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; };
- F92C537B0ECCE635009BE4BA /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ../../common/mac/macho_id.h; sourceTree = SOURCE_ROOT; };
- F92C537C0ECCE635009BE4BA /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; };
- F92C537D0ECCE635009BE4BA /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; };
- F92C537E0ECCE635009BE4BA /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ../../common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; };
- F92C537F0ECCE635009BE4BA /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ../../common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; };
- F92C53820ECCE635009BE4BA /* string_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_utilities.cc; path = ../../common/mac/string_utilities.cc; sourceTree = SOURCE_ROOT; };
- F92C53830ECCE635009BE4BA /* string_utilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_utilities.h; path = ../../common/mac/string_utilities.h; sourceTree = SOURCE_ROOT; };
- F92C53850ECCE6AD009BE4BA /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ../../common/string_conversion.cc; sourceTree = SOURCE_ROOT; };
- F92C53860ECCE6AD009BE4BA /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ../../common/string_conversion.h; sourceTree = SOURCE_ROOT; };
- F92C53870ECCE6C0009BE4BA /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ../../common/convert_UTF.c; sourceTree = SOURCE_ROOT; };
- F92C53880ECCE6C0009BE4BA /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ../../common/convert_UTF.h; sourceTree = SOURCE_ROOT; };
- F92C538E0ECCE70A009BE4BA /* minidump_file_writer-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "minidump_file_writer-inl.h"; path = "../minidump_file_writer-inl.h"; sourceTree = SOURCE_ROOT; };
- F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer.cc; path = ../minidump_file_writer.cc; sourceTree = SOURCE_ROOT; };
- F92C53900ECCE70A009BE4BA /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = minidump_file_writer.h; path = ../minidump_file_writer.h; sourceTree = SOURCE_ROOT; };
- F92C53B70ECCE7B3009BE4BA /* Inspector.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Inspector.mm; path = crash_generation/Inspector.mm; sourceTree = SOURCE_ROOT; };
- F92C554A0ECCF530009BE4BA /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
- F92C55CE0ECD0064009BE4BA /* Breakpad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpad.h; path = Framework/Breakpad.h; sourceTree = "<group>"; };
- F92C55CF0ECD0064009BE4BA /* Breakpad.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Breakpad.mm; path = Framework/Breakpad.mm; sourceTree = "<group>"; };
- F92C56310ECD0DF1009BE4BA /* OnDemandServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OnDemandServer.h; path = Framework/OnDemandServer.h; sourceTree = "<group>"; };
- F92C56320ECD0DF1009BE4BA /* OnDemandServer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = OnDemandServer.mm; path = Framework/OnDemandServer.mm; sourceTree = "<group>"; };
- F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = breakpadUtilities.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
- F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = crash_report_sender.app; sourceTree = BUILT_PRODUCTS_DIR; };
- F92C56A20ECE04A7009BE4BA /* crash_report_sender-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "crash_report_sender-Info.plist"; path = "sender/crash_report_sender-Info.plist"; sourceTree = "<group>"; };
- F92C56A70ECE04C5009BE4BA /* crash_report_sender.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = crash_report_sender.h; path = sender/crash_report_sender.h; sourceTree = "<group>"; };
- F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = crash_report_sender.m; path = sender/crash_report_sender.m; sourceTree = "<group>"; };
- F93803BE0F80820F004D428B /* generator_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = generator_test; sourceTree = BUILT_PRODUCTS_DIR; };
- F93DE2D10F82A67300608B94 /* minidump_file_writer_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidump_file_writer_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- F93DE2D70F82A70E00608B94 /* minidump_file_writer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer_unittest.cc; path = ../minidump_file_writer_unittest.cc; sourceTree = SOURCE_ROOT; };
- F93DE32C0F82C55600608B94 /* handler_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = handler_test; sourceTree = BUILT_PRODUCTS_DIR; };
- F945849D0F280E3C009A47BF /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = sender/English.lproj/Localizable.strings; sourceTree = "<group>"; };
- F945859D0F78241E009A47BF /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Framework/Info.plist; sourceTree = "<group>"; };
- F95BB87C101F949F00AA053B /* crash_report.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = crash_report.xcodeproj; path = ../../tools/mac/crash_report/crash_report.xcodeproj; sourceTree = SOURCE_ROOT; };
- F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = dump_syms.xcodeproj; path = ../../tools/mac/dump_syms/dump_syms.xcodeproj; sourceTree = SOURCE_ROOT; };
- F95BB894101F94C000AA053B /* symupload.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = symupload.xcodeproj; path = ../../tools/mac/symupload/symupload.xcodeproj; sourceTree = SOURCE_ROOT; };
- F9B6309F100FF96B00D0F4AC /* goArrow.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = goArrow.png; path = sender/goArrow.png; sourceTree = "<group>"; };
- F9C44DA50EF060A8003AEBAA /* BreakpadTest.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BreakpadTest.app; sourceTree = BUILT_PRODUCTS_DIR; };
- F9C44DAC0EF07288003AEBAA /* Controller.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Controller.m; path = testapp/Controller.m; sourceTree = "<group>"; };
- F9C44DAD0EF07288003AEBAA /* crashduringload */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = crashduringload; path = testapp/crashduringload; sourceTree = "<group>"; };
- F9C44DAE0EF07288003AEBAA /* crashInMain */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = crashInMain; path = testapp/crashInMain; sourceTree = "<group>"; };
- F9C44DAF0EF07288003AEBAA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = testapp/Info.plist; sourceTree = "<group>"; };
- F9C44DB00EF07288003AEBAA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = testapp/main.m; sourceTree = "<group>"; };
- F9C44DB10EF07288003AEBAA /* TestClass.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = TestClass.mm; path = testapp/TestClass.mm; sourceTree = "<group>"; };
- F9C44DB90EF072A0003AEBAA /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = testapp/English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
- F9C44DBB0EF072A0003AEBAA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = testapp/English.lproj/MainMenu.xib; sourceTree = "<group>"; };
- F9C44DBF0EF0778F003AEBAA /* Controller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Controller.h; path = testapp/Controller.h; sourceTree = "<group>"; };
- F9C44DC00EF0778F003AEBAA /* TestClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestClass.h; path = testapp/TestClass.h; sourceTree = "<group>"; };
- F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
- F9C44EE70EF0A3C1003AEBAA /* GTMLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMLogger.h; path = ../../common/mac/GTMLogger.h; sourceTree = SOURCE_ROOT; };
- F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMLogger.m; path = ../../common/mac/GTMLogger.m; sourceTree = SOURCE_ROOT; };
- F9C77DDA0F7DD5CF0045F7DB /* UnitTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = UnitTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
- F9C77DDB0F7DD5CF0045F7DB /* UnitTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "UnitTests-Info.plist"; sourceTree = "<group>"; };
- F9C77E110F7DDF810045F7DB /* GTMSenTestCase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GTMSenTestCase.h; path = ../../common/mac/testing/GTMSenTestCase.h; sourceTree = SOURCE_ROOT; };
- F9C77E120F7DDF810045F7DB /* GTMSenTestCase.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = GTMSenTestCase.m; path = ../../common/mac/testing/GTMSenTestCase.m; sourceTree = SOURCE_ROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8DC2EF560486A6940098B216 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F92C565C0ECD1158009BE4BA /* breakpadUtilities.dylib in Frameworks */,
- 8DC2EF570486A6940098B216 /* Cocoa.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D23F4BA912A868A500686C8D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D246418412BAA4BA005170D0 /* Foundation.framework in Frameworks */,
- 4DBE49A6134A4F200072546A /* CoreServices.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2F9A41312131EF0002747C1 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2F9A53E121383A1002747C1 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D2F9A53F121383A1002747C1 /* Foundation.framework in Frameworks */,
- D2F9A541121383A1002747C1 /* libgtest.a in Frameworks */,
- 4DBE49A9134A4F460072546A /* CoreServices.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C53520ECCE349009BE4BA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F92C564C0ECD10DD009BE4BA /* breakpadUtilities.dylib in Frameworks */,
- F92C554C0ECCF534009BE4BA /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C563A0ECD10B3009BE4BA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8B31FC8211EFD2B800FCF3E4 /* Foundation.framework in Frameworks */,
- F92C56570ECD113E009BE4BA /* Carbon.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C569E0ECE04A7009BE4BA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44EE50EF0A006003AEBAA /* SystemConfiguration.framework in Frameworks */,
- 8B3101C611F0CD9F00FCF3E4 /* AppKit.framework in Frameworks */,
- 8B3101C711F0CD9F00FCF3E4 /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93803BC0F80820F004D428B /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8B31029411F0D54300FCF3E4 /* Foundation.framework in Frameworks */,
- D23F4B3312A7E17700686C8D /* libgtest.a in Frameworks */,
- 4DBE49A7134A4F280072546A /* CoreServices.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93DE2CF0F82A67300608B94 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93DE32A0F82C55600608B94 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8B3102E611F0D74C00FCF3E4 /* Foundation.framework in Frameworks */,
- D2F9A44412131F84002747C1 /* libgtest.a in Frameworks */,
- 4DBE49A8134A4F380072546A /* CoreServices.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9C44DA30EF060A8003AEBAA /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44E000EF077CD003AEBAA /* Breakpad.framework in Frameworks */,
- 8B3101CA11F0CDB000FCF3E4 /* AppKit.framework in Frameworks */,
- 8B3101CB11F0CDB000FCF3E4 /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9C77DD70F7DD5CF0045F7DB /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F91AF6210FD60784009D8BE2 /* Breakpad.framework in Frameworks */,
- 8B3101EA11F0CDE300FCF3E4 /* SenTestingKit.framework in Frameworks */,
- 8B3102EB11F0D78000FCF3E4 /* Foundation.framework in Frameworks */,
- D24BBBFD121050F000F3D417 /* breakpadUtilities.dylib in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 034768DFFF38A50411DB9C8B /* Products */ = {
- isa = PBXGroup;
- children = (
- 8DC2EF5B0486A6940098B216 /* Breakpad.framework */,
- F92C53540ECCE349009BE4BA /* Inspector */,
- F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */,
- F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */,
- F9C44DA50EF060A8003AEBAA /* BreakpadTest.app */,
- F9C77DDA0F7DD5CF0045F7DB /* UnitTests.octest */,
- F93803BE0F80820F004D428B /* generator_test */,
- F93DE2D10F82A67300608B94 /* minidump_file_writer_unittest */,
- F93DE32C0F82C55600608B94 /* handler_test */,
- D2F9A41512131EF0002747C1 /* libgtest.a */,
- D2F9A546121383A1002747C1 /* crash_generation_server_test */,
- D23F4BAB12A868A500686C8D /* minidump_generator_test_helper */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 0867D691FE84028FC02AAC07 /* Breakpad */ = {
- isa = PBXGroup;
- children = (
- D2F9A43812131F3B002747C1 /* gtest */,
- 8B31FFF611F0C90500FCF3E4 /* Breakpad.xcconfig */,
- 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */,
- 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */,
- F95BB8A3101F94C300AA053B /* Tools */,
- 32DBCF5E0370ADEE00C91783 /* Breakpad_Prefix.pch */,
- F92C538D0ECCE6F2009BE4BA /* client */,
- F92C53600ECCE3D6009BE4BA /* common */,
- D244536912426EE7009BBCE0 /* processor */,
- 0867D69AFE84028FC02AAC07 /* Frameworks */,
- 034768DFFF38A50411DB9C8B /* Products */,
- F9C77DDB0F7DD5CF0045F7DB /* UnitTests-Info.plist */,
- );
- name = Breakpad;
- sourceTree = "<group>";
- };
- 0867D69AFE84028FC02AAC07 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 8B3101E911F0CDE300FCF3E4 /* SenTestingKit.framework */,
- F9C44EE40EF0A006003AEBAA /* SystemConfiguration.framework */,
- F92C554A0ECCF530009BE4BA /* Carbon.framework */,
- 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */,
- 0867D6A5FE840307C02AAC07 /* AppKit.framework */,
- 0867D69BFE84028FC02AAC07 /* Foundation.framework */,
- 4DBE4769134A4F080072546A /* CoreServices.framework */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 16C7C915147D45AE00776EAD /* apple */ = {
- isa = PBXGroup;
- children = (
- 16C7C916147D45AE00776EAD /* Framework */,
- );
- name = apple;
- path = ../apple;
- sourceTree = SOURCE_ROOT;
- };
- 16C7C916147D45AE00776EAD /* Framework */ = {
- isa = PBXGroup;
- children = (
- 16C7C917147D45AE00776EAD /* BreakpadDefines.h */,
- );
- path = Framework;
- sourceTree = "<group>";
- };
- D244536912426EE7009BBCE0 /* processor */ = {
- isa = PBXGroup;
- children = (
- D244535112426EBB009BBCE0 /* logging.cc */,
- D244535212426EBB009BBCE0 /* minidump.cc */,
- D244535312426EBB009BBCE0 /* pathname_stripper.cc */,
- D244534F12426E98009BBCE0 /* basic_code_modules.cc */,
- );
- name = processor;
- sourceTree = "<group>";
- };
- D2F9A43812131F3B002747C1 /* gtest */ = {
- isa = PBXGroup;
- children = (
- D2F9A43E12131F65002747C1 /* gtest_main.cc */,
- D2F9A43F12131F65002747C1 /* gtest-all.cc */,
- D2F9A43C12131F55002747C1 /* gmock-all.cc */,
- );
- name = gtest;
- sourceTree = "<group>";
- };
- F92C53590ECCE3BB009BE4BA /* handler */ = {
- isa = PBXGroup;
- children = (
- F92C53670ECCE3FD009BE4BA /* breakpad_exc_server.c */,
- F92C53680ECCE3FD009BE4BA /* breakpad_exc_server.h */,
- F92C53690ECCE3FD009BE4BA /* breakpad_nlist_64.cc */,
- F92C536A0ECCE3FD009BE4BA /* breakpad_nlist_64.h */,
- F92C536B0ECCE3FD009BE4BA /* dynamic_images.cc */,
- F92C536C0ECCE3FD009BE4BA /* dynamic_images.h */,
- F92C536D0ECCE3FD009BE4BA /* exception_handler.cc */,
- F92C536E0ECCE3FD009BE4BA /* exception_handler.h */,
- F92C536F0ECCE3FD009BE4BA /* minidump_generator.cc */,
- F92C53700ECCE3FD009BE4BA /* minidump_generator.h */,
- F92C53720ECCE3FD009BE4BA /* protected_memory_allocator.cc */,
- F92C53730ECCE3FD009BE4BA /* protected_memory_allocator.h */,
- );
- name = handler;
- sourceTree = "<group>";
- };
- F92C53600ECCE3D6009BE4BA /* common */ = {
- isa = PBXGroup;
- children = (
- D244540A12439BA0009BBCE0 /* memory_unittest.cc */,
- F92C53870ECCE6C0009BE4BA /* convert_UTF.c */,
- F92C53880ECCE6C0009BE4BA /* convert_UTF.h */,
- 4D72CA0D13DFAD5C006CABE3 /* md5.cc */,
- 1EEEB6211720829E00F7E689 /* simple_string_dictionary.cc */,
- 1EEEB6221720829E00F7E689 /* simple_string_dictionary.h */,
- F92C53850ECCE6AD009BE4BA /* string_conversion.cc */,
- F92C53860ECCE6AD009BE4BA /* string_conversion.h */,
- F92C53840ECCE68D009BE4BA /* mac */,
- );
- name = common;
- sourceTree = "<group>";
- };
- F92C53840ECCE68D009BE4BA /* mac */ = {
- isa = PBXGroup;
- children = (
- 162F64F0161C577500CD68D5 /* arch_utilities.cc */,
- 162F64F1161C577500CD68D5 /* arch_utilities.h */,
- 8B31007011F0CD3C00FCF3E4 /* GTMDefines.h */,
- F9C77E0F0F7DDF650045F7DB /* testing */,
- F9C44EE70EF0A3C1003AEBAA /* GTMLogger.h */,
- F9C44EE80EF0A3C1003AEBAA /* GTMLogger.m */,
- F92C53740ECCE635009BE4BA /* file_id.cc */,
- F92C53750ECCE635009BE4BA /* file_id.h */,
- F92C53760ECCE635009BE4BA /* HTTPMultipartUpload.h */,
- F92C53770ECCE635009BE4BA /* HTTPMultipartUpload.m */,
- F4DAB1DB19F1027100A5A838 /* launch_reporter.cc */,
- F4DAB1DC19F1027100A5A838 /* launch_reporter.h */,
- F92C53780ECCE635009BE4BA /* MachIPC.h */,
- F92C53790ECCE635009BE4BA /* MachIPC.mm */,
- 4D61A25D14F43CFC002D5862 /* bootstrap_compat.cc */,
- 4D61A25E14F43CFC002D5862 /* bootstrap_compat.h */,
- F92C537A0ECCE635009BE4BA /* macho_id.cc */,
- F92C537B0ECCE635009BE4BA /* macho_id.h */,
- F92C537C0ECCE635009BE4BA /* macho_utilities.cc */,
- F92C537D0ECCE635009BE4BA /* macho_utilities.h */,
- F92C537E0ECCE635009BE4BA /* macho_walker.cc */,
- F92C537F0ECCE635009BE4BA /* macho_walker.h */,
- F92C53820ECCE635009BE4BA /* string_utilities.cc */,
- F92C53830ECCE635009BE4BA /* string_utilities.h */,
- );
- name = mac;
- sourceTree = "<group>";
- };
- F92C538D0ECCE6F2009BE4BA /* client */ = {
- isa = PBXGroup;
- children = (
- 16C7C915147D45AE00776EAD /* apple */,
- F92C53990ECCE78E009BE4BA /* mac */,
- F92C538E0ECCE70A009BE4BA /* minidump_file_writer-inl.h */,
- F92C538F0ECCE70A009BE4BA /* minidump_file_writer.cc */,
- F92C53900ECCE70A009BE4BA /* minidump_file_writer.h */,
- F93DE2D70F82A70E00608B94 /* minidump_file_writer_unittest.cc */,
- );
- name = client;
- sourceTree = "<group>";
- };
- F92C53990ECCE78E009BE4BA /* mac */ = {
- isa = PBXGroup;
- children = (
- F9C77DDF0F7DD7CF0045F7DB /* tests */,
- F9C44DAB0EF0726F003AEBAA /* testapp */,
- F92C56A60ECE04B6009BE4BA /* sender */,
- F92C55CD0ECD0053009BE4BA /* Framework */,
- F92C53B50ECCE799009BE4BA /* crash_generation */,
- F92C53590ECCE3BB009BE4BA /* handler */,
- );
- name = mac;
- sourceTree = "<group>";
- };
- F92C53B50ECCE799009BE4BA /* crash_generation */ = {
- isa = PBXGroup;
- children = (
- 163201D41443019E00C4DBF5 /* ConfigFile.h */,
- 163201D51443019E00C4DBF5 /* ConfigFile.mm */,
- D2F9A4C4121336C7002747C1 /* client_info.h */,
- D2F9A4C5121336C7002747C1 /* crash_generation_client.h */,
- D2F9A4C6121336C7002747C1 /* crash_generation_client.cc */,
- D2F9A4C7121336C7002747C1 /* crash_generation_server.h */,
- D2F9A4C8121336C7002747C1 /* crash_generation_server.cc */,
- F9286B380F7EB25800A4DCC8 /* Inspector.h */,
- F9286B390F7EB25800A4DCC8 /* InspectorMain.mm */,
- F92C53B70ECCE7B3009BE4BA /* Inspector.mm */,
- );
- name = crash_generation;
- sourceTree = "<group>";
- };
- F92C55CD0ECD0053009BE4BA /* Framework */ = {
- isa = PBXGroup;
- children = (
- F945859D0F78241E009A47BF /* Info.plist */,
- F92C56310ECD0DF1009BE4BA /* OnDemandServer.h */,
- F92C56320ECD0DF1009BE4BA /* OnDemandServer.mm */,
- F92C55CE0ECD0064009BE4BA /* Breakpad.h */,
- F92C55CF0ECD0064009BE4BA /* Breakpad.mm */,
- );
- name = Framework;
- sourceTree = "<group>";
- };
- F92C56A60ECE04B6009BE4BA /* sender */ = {
- isa = PBXGroup;
- children = (
- 16E02DB4147410D4008C604D /* uploader.mm */,
- 163202431443201300C4DBF5 /* uploader.h */,
- F9B6309F100FF96B00D0F4AC /* goArrow.png */,
- F92C56A70ECE04C5009BE4BA /* crash_report_sender.h */,
- F92C56A80ECE04C5009BE4BA /* crash_report_sender.m */,
- F945849C0F280E3C009A47BF /* Localizable.strings */,
- 33880C7E0F9E097100817F82 /* InfoPlist.strings */,
- 3329D4EC0FA16D820007BBC5 /* Breakpad.xib */,
- 4084699C0F5D9CF900FDCA37 /* crash_report_sender.icns */,
- F92C56A20ECE04A7009BE4BA /* crash_report_sender-Info.plist */,
- );
- name = sender;
- sourceTree = "<group>";
- };
- F95BB87D101F949F00AA053B /* Products */ = {
- isa = PBXGroup;
- children = (
- F95BB885101F949F00AA053B /* crash_report */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- F95BB88A101F94AC00AA053B /* Products */ = {
- isa = PBXGroup;
- children = (
- F95BB892101F94AC00AA053B /* dump_syms */,
- 8B31F7A111EF9A8700FCF3E4 /* macho_dump */,
- 8B31F7A311EF9A8700FCF3E4 /* libgtestmockall.a */,
- 8B31F7A511EF9A8700FCF3E4 /* byte_cursor_unittest */,
- 8B31F7A711EF9A8700FCF3E4 /* macho_reader_unittest */,
- 8B31F7A911EF9A8700FCF3E4 /* stabs_reader_unittest */,
- 8B31F7AB11EF9A8700FCF3E4 /* bytereader_unittest */,
- 8B31F7AD11EF9A8700FCF3E4 /* dwarf2reader_cfi_unittest */,
- 8B31F7AF11EF9A8700FCF3E4 /* dwarf2diehandler_unittest */,
- 8B31F7B111EF9A8700FCF3E4 /* dwarf_cu_to_module_unittest */,
- 8B31F7B311EF9A8700FCF3E4 /* dwarf_line_to_module_unittest */,
- 8B31F7B511EF9A8700FCF3E4 /* dwarf_cfi_to_module_unittest */,
- 8B31F7B711EF9A8700FCF3E4 /* stabs_to_module_unittest */,
- 8B31F7B911EF9A8700FCF3E4 /* module_unittest */,
- 8B31F7BB11EF9A8700FCF3E4 /* test_assembler_unittest */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- F95BB895101F94C000AA053B /* Products */ = {
- isa = PBXGroup;
- children = (
- F95BB89F101F94C000AA053B /* symupload */,
- F95BB8A1101F94C000AA053B /* minidump_upload */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- F95BB8A3101F94C300AA053B /* Tools */ = {
- isa = PBXGroup;
- children = (
- F95BB894101F94C000AA053B /* symupload.xcodeproj */,
- F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */,
- F95BB87C101F949F00AA053B /* crash_report.xcodeproj */,
- );
- name = Tools;
- sourceTree = "<group>";
- };
- F9C44DAB0EF0726F003AEBAA /* testapp */ = {
- isa = PBXGroup;
- children = (
- F9C44DBF0EF0778F003AEBAA /* Controller.h */,
- F9C44DC00EF0778F003AEBAA /* TestClass.h */,
- F9C44DB80EF072A0003AEBAA /* InfoPlist.strings */,
- F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */,
- F9C44DAC0EF07288003AEBAA /* Controller.m */,
- F9C44DAD0EF07288003AEBAA /* crashduringload */,
- F9C44DAE0EF07288003AEBAA /* crashInMain */,
- F9C44DAF0EF07288003AEBAA /* Info.plist */,
- F9C44DB00EF07288003AEBAA /* main.m */,
- F9C44DB10EF07288003AEBAA /* TestClass.mm */,
- );
- name = testapp;
- sourceTree = "<group>";
- };
- F9C77DDF0F7DD7CF0045F7DB /* tests */ = {
- isa = PBXGroup;
- children = (
- 1EEEB6251720830600F7E689 /* simple_string_dictionary_unittest.cc */,
- D23F4B9A12A8688800686C8D /* minidump_generator_test_helper.cc */,
- D23F4B2C12A7E13200686C8D /* minidump_generator_test.cc */,
- D2F9A4CE121336F7002747C1 /* crash_generation_server_test.cc */,
- D2F9A3D41212F87C002747C1 /* exception_handler_test.cc */,
- F91AF5CF0FD60393009D8BE2 /* BreakpadFramework_Test.mm */,
- );
- name = tests;
- sourceTree = "<group>";
- };
- F9C77E0F0F7DDF650045F7DB /* testing */ = {
- isa = PBXGroup;
- children = (
- F9C77E110F7DDF810045F7DB /* GTMSenTestCase.h */,
- F9C77E120F7DDF810045F7DB /* GTMSenTestCase.m */,
- );
- name = testing;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- 8DC2EF500486A6940098B216 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F92C55D00ECD0064009BE4BA /* Breakpad.h in Headers */,
- F92C56330ECD0DF1009BE4BA /* OnDemandServer.h in Headers */,
- D2F9A4C9121336C7002747C1 /* client_info.h in Headers */,
- D2F9A4CA121336C7002747C1 /* crash_generation_client.h in Headers */,
- D2F9A4CC121336C7002747C1 /* crash_generation_server.h in Headers */,
- 163201D61443019E00C4DBF5 /* ConfigFile.h in Headers */,
- 16C7C918147D45AE00776EAD /* BreakpadDefines.h in Headers */,
- 162F64F3161C577500CD68D5 /* arch_utilities.h in Headers */,
- F4DAB1DE19F1027100A5A838 /* launch_reporter.h in Headers */,
- 1EEEB6241720829E00F7E689 /* simple_string_dictionary.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2F9A41112131EF0002747C1 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C56380ECD10B3009BE4BA /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- 8DC2EF4F0486A6940098B216 /* Breakpad */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */;
- buildPhases = (
- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */,
- 8DC2EF500486A6940098B216 /* Headers */,
- 8DC2EF520486A6940098B216 /* Resources */,
- 8DC2EF540486A6940098B216 /* Sources */,
- 8DC2EF560486A6940098B216 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */,
- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */,
- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */,
- );
- name = Breakpad;
- productInstallPath = "$(HOME)/Library/Frameworks";
- productName = Breakpad;
- productReference = 8DC2EF5B0486A6940098B216 /* Breakpad.framework */;
- productType = "com.apple.product-type.framework";
- };
- D23F4BAA12A868A500686C8D /* minidump_generator_test_helper */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = D23F4BB012A868C400686C8D /* Build configuration list for PBXNativeTarget "minidump_generator_test_helper" */;
- buildPhases = (
- D23F4BA812A868A500686C8D /* Sources */,
- D23F4BA912A868A500686C8D /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = minidump_generator_test_helper;
- productName = minidump_generator_test_helper;
- productReference = D23F4BAB12A868A500686C8D /* minidump_generator_test_helper */;
- productType = "com.apple.product-type.tool";
- };
- D2F9A41412131EF0002747C1 /* gtest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = D2F9A42D12131F0E002747C1 /* Build configuration list for PBXNativeTarget "gtest" */;
- buildPhases = (
- D2F9A41112131EF0002747C1 /* Headers */,
- D2F9A41212131EF0002747C1 /* Sources */,
- D2F9A41312131EF0002747C1 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = gtest;
- productName = gtest;
- productReference = D2F9A41512131EF0002747C1 /* libgtest.a */;
- productType = "com.apple.product-type.library.static";
- };
- D2F9A52A121383A1002747C1 /* crash_generation_server_test */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = D2F9A542121383A1002747C1 /* Build configuration list for PBXNativeTarget "crash_generation_server_test" */;
- buildPhases = (
- D2F9A52D121383A1002747C1 /* Sources */,
- D2F9A53E121383A1002747C1 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- D2F9A52B121383A1002747C1 /* PBXTargetDependency */,
- );
- name = crash_generation_server_test;
- productName = handler_test;
- productReference = D2F9A546121383A1002747C1 /* crash_generation_server_test */;
- productType = "com.apple.product-type.tool";
- };
- F92C53530ECCE349009BE4BA /* Inspector */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F92C53580ECCE36D009BE4BA /* Build configuration list for PBXNativeTarget "Inspector" */;
- buildPhases = (
- F94584840F27FB40009A47BF /* Change install name of breakpadUtilities */,
- F92C53510ECCE349009BE4BA /* Sources */,
- F92C53520ECCE349009BE4BA /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- F92C564E0ECD10E5009BE4BA /* PBXTargetDependency */,
- );
- name = Inspector;
- productName = Inspector;
- productReference = F92C53540ECCE349009BE4BA /* Inspector */;
- productType = "com.apple.product-type.tool";
- };
- F92C563B0ECD10B3009BE4BA /* breakpadUtilities */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F92C56670ECD11A3009BE4BA /* Build configuration list for PBXNativeTarget "breakpadUtilities" */;
- buildPhases = (
- F92C56380ECD10B3009BE4BA /* Headers */,
- F92C56390ECD10B3009BE4BA /* Sources */,
- F92C563A0ECD10B3009BE4BA /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = breakpadUtilities;
- productName = breakpadUtilities;
- productReference = F92C563C0ECD10B3009BE4BA /* breakpadUtilities.dylib */;
- productType = "com.apple.product-type.library.dynamic";
- };
- F92C569F0ECE04A7009BE4BA /* crash_report_sender */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F92C56A50ECE04A8009BE4BA /* Build configuration list for PBXNativeTarget "crash_report_sender" */;
- buildPhases = (
- F92C569C0ECE04A7009BE4BA /* Resources */,
- F92C569D0ECE04A7009BE4BA /* Sources */,
- F92C569E0ECE04A7009BE4BA /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = crash_report_sender;
- productName = crash_report_sender;
- productReference = F92C56A00ECE04A7009BE4BA /* crash_report_sender.app */;
- productType = "com.apple.product-type.application";
- };
- F93803BD0F80820F004D428B /* generator_test */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F93803C40F80822E004D428B /* Build configuration list for PBXNativeTarget "generator_test" */;
- buildPhases = (
- F93803BB0F80820F004D428B /* Sources */,
- F93803BC0F80820F004D428B /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- D23F4B3012A7E16200686C8D /* PBXTargetDependency */,
- D23F4BBA12A8694C00686C8D /* PBXTargetDependency */,
- );
- name = generator_test;
- productName = generator_test;
- productReference = F93803BE0F80820F004D428B /* generator_test */;
- productType = "com.apple.product-type.tool";
- };
- F93DE2D00F82A67300608B94 /* minidump_file_writer_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F93DE2D60F82A67700608B94 /* Build configuration list for PBXNativeTarget "minidump_file_writer_unittest" */;
- buildPhases = (
- F93DE2CE0F82A67300608B94 /* Sources */,
- F93DE2CF0F82A67300608B94 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = minidump_file_writer_unittest;
- productName = minidump_file_writer_unittest;
- productReference = F93DE2D10F82A67300608B94 /* minidump_file_writer_unittest */;
- productType = "com.apple.product-type.tool";
- };
- F93DE32B0F82C55600608B94 /* handler_test */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F93DE3320F82C5D800608B94 /* Build configuration list for PBXNativeTarget "handler_test" */;
- buildPhases = (
- F93DE3290F82C55600608B94 /* Sources */,
- F93DE32A0F82C55600608B94 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- D2F9A44312131F80002747C1 /* PBXTargetDependency */,
- );
- name = handler_test;
- productName = handler_test;
- productReference = F93DE32C0F82C55600608B94 /* handler_test */;
- productType = "com.apple.product-type.tool";
- };
- F9C44DA40EF060A8003AEBAA /* BreakpadTest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F9C44DAA0EF060A9003AEBAA /* Build configuration list for PBXNativeTarget "BreakpadTest" */;
- buildPhases = (
- F9C44DA10EF060A8003AEBAA /* Resources */,
- F9C44DA20EF060A8003AEBAA /* Sources */,
- F9C44DA30EF060A8003AEBAA /* Frameworks */,
- F9C44E410EF08B17003AEBAA /* Copy Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- F9C44E1A0EF0790F003AEBAA /* PBXTargetDependency */,
- );
- name = BreakpadTest;
- productName = BreakpadTest;
- productReference = F9C44DA50EF060A8003AEBAA /* BreakpadTest.app */;
- productType = "com.apple.product-type.application";
- };
- F9C77DD90F7DD5CF0045F7DB /* UnitTests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F9C77DDE0F7DD5D00045F7DB /* Build configuration list for PBXNativeTarget "UnitTests" */;
- buildPhases = (
- F9C77DD50F7DD5CF0045F7DB /* Resources */,
- F9C77DD60F7DD5CF0045F7DB /* Sources */,
- F9C77DD70F7DD5CF0045F7DB /* Frameworks */,
- F9C77DD80F7DD5CF0045F7DB /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */,
- F93DE3700F82CC1300608B94 /* PBXTargetDependency */,
- F91AF6380FD60A74009D8BE2 /* PBXTargetDependency */,
- D2F9A5DF12142A6A002747C1 /* PBXTargetDependency */,
- );
- name = UnitTests;
- productName = UnitTests;
- productReference = F9C77DDA0F7DD5CF0045F7DB /* UnitTests.octest */;
- productType = "com.apple.product-type.bundle";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */;
- compatibilityVersion = "Xcode 3.1";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- da,
- de,
- es,
- fr,
- it,
- ja,
- nl,
- no,
- sl,
- sv,
- tr,
- );
- mainGroup = 0867D691FE84028FC02AAC07 /* Breakpad */;
- productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
- projectDirPath = "";
- projectReferences = (
- {
- ProductGroup = F95BB87D101F949F00AA053B /* Products */;
- ProjectRef = F95BB87C101F949F00AA053B /* crash_report.xcodeproj */;
- },
- {
- ProductGroup = F95BB88A101F94AC00AA053B /* Products */;
- ProjectRef = F95BB889101F94AC00AA053B /* dump_syms.xcodeproj */;
- },
- {
- ProductGroup = F95BB895101F94C000AA053B /* Products */;
- ProjectRef = F95BB894101F94C000AA053B /* symupload.xcodeproj */;
- },
- );
- projectRoot = "";
- targets = (
- 8DC2EF4F0486A6940098B216 /* Breakpad */,
- F92C53530ECCE349009BE4BA /* Inspector */,
- F92C563B0ECD10B3009BE4BA /* breakpadUtilities */,
- F92C569F0ECE04A7009BE4BA /* crash_report_sender */,
- F9C44DA40EF060A8003AEBAA /* BreakpadTest */,
- F94585840F782326009A47BF /* All */,
- F9C77DD90F7DD5CF0045F7DB /* UnitTests */,
- F93803BD0F80820F004D428B /* generator_test */,
- F93DE2D00F82A67300608B94 /* minidump_file_writer_unittest */,
- F93DE32B0F82C55600608B94 /* handler_test */,
- D2F9A41412131EF0002747C1 /* gtest */,
- D2F9A52A121383A1002747C1 /* crash_generation_server_test */,
- D23F4BAA12A868A500686C8D /* minidump_generator_test_helper */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
- 8B31F7A111EF9A8700FCF3E4 /* macho_dump */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = macho_dump;
- remoteRef = 8B31F7A011EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7A311EF9A8700FCF3E4 /* libgtestmockall.a */ = {
- isa = PBXReferenceProxy;
- fileType = archive.ar;
- path = libgtestmockall.a;
- remoteRef = 8B31F7A211EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7A511EF9A8700FCF3E4 /* byte_cursor_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = byte_cursor_unittest;
- remoteRef = 8B31F7A411EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7A711EF9A8700FCF3E4 /* macho_reader_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = macho_reader_unittest;
- remoteRef = 8B31F7A611EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7A911EF9A8700FCF3E4 /* stabs_reader_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = stabs_reader_unittest;
- remoteRef = 8B31F7A811EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7AB11EF9A8700FCF3E4 /* bytereader_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = bytereader_unittest;
- remoteRef = 8B31F7AA11EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7AD11EF9A8700FCF3E4 /* dwarf2reader_cfi_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = dwarf2reader_cfi_unittest;
- remoteRef = 8B31F7AC11EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7AF11EF9A8700FCF3E4 /* dwarf2diehandler_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = dwarf2diehandler_unittest;
- remoteRef = 8B31F7AE11EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7B111EF9A8700FCF3E4 /* dwarf_cu_to_module_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = dwarf_cu_to_module_unittest;
- remoteRef = 8B31F7B011EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7B311EF9A8700FCF3E4 /* dwarf_line_to_module_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = dwarf_line_to_module_unittest;
- remoteRef = 8B31F7B211EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7B511EF9A8700FCF3E4 /* dwarf_cfi_to_module_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = dwarf_cfi_to_module_unittest;
- remoteRef = 8B31F7B411EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7B711EF9A8700FCF3E4 /* stabs_to_module_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = stabs_to_module_unittest;
- remoteRef = 8B31F7B611EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7B911EF9A8700FCF3E4 /* module_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = module_unittest;
- remoteRef = 8B31F7B811EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 8B31F7BB11EF9A8700FCF3E4 /* test_assembler_unittest */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = test_assembler_unittest;
- remoteRef = 8B31F7BA11EF9A8700FCF3E4 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F95BB885101F949F00AA053B /* crash_report */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = crash_report;
- remoteRef = F95BB884101F949F00AA053B /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F95BB892101F94AC00AA053B /* dump_syms */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = dump_syms;
- remoteRef = F95BB891101F94AC00AA053B /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F95BB89F101F94C000AA053B /* symupload */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = symupload;
- remoteRef = F95BB89E101F94C000AA053B /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- F95BB8A1101F94C000AA053B /* minidump_upload */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = minidump_upload;
- remoteRef = F95BB8A0101F94C000AA053B /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-/* End PBXReferenceProxy section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8DC2EF520486A6940098B216 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44E980EF09F56003AEBAA /* crash_report_sender.app in Resources */,
- F92C568A0ECD15F9009BE4BA /* Inspector in Resources */,
- F92C56650ECD1185009BE4BA /* breakpadUtilities.dylib in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C569C0ECE04A7009BE4BA /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F945849E0F280E3C009A47BF /* Localizable.strings in Resources */,
- 4084699D0F5D9CF900FDCA37 /* crash_report_sender.icns in Resources */,
- 33880C800F9E097100817F82 /* InfoPlist.strings in Resources */,
- 3329D4ED0FA16D820007BBC5 /* Breakpad.xib in Resources */,
- F9B630A0100FF96B00D0F4AC /* goArrow.png in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9C44DA10EF060A8003AEBAA /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44DB30EF07288003AEBAA /* crashduringload in Resources */,
- F9C44DB40EF07288003AEBAA /* crashInMain in Resources */,
- F9C44DBC0EF072A0003AEBAA /* InfoPlist.strings in Resources */,
- F9C44DBD0EF072A0003AEBAA /* MainMenu.xib in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9C77DD50F7DD5CF0045F7DB /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- F94584840F27FB40009A47BF /* Change install name of breakpadUtilities */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Change install name of breakpadUtilities";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "install_name_tool -id \"@executable_path/../Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
- };
- F97A0E850ED4EC15008784D3 /* Change install name of breakpadUtilities */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- name = "Change install name of breakpadUtilities";
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "#!/bin/bash\ninstall_name_tool -id \"@executable_path/../Frameworks/Breakpad.framework/Resources/breakpadUtilities.dylib\" \"${BUILT_PRODUCTS_DIR}/breakpadUtilities.dylib\"\n";
- };
- F9C77DD80F7DD5CF0045F7DB /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\necho running minidump generator tests...\n\"${BUILT_PRODUCTS_DIR}/generator_test\"\necho Running exception handler tests...\n\"${BUILT_PRODUCTS_DIR}/handler_test\"\necho Running crash generation server tests...\n\"${BUILT_PRODUCTS_DIR}/crash_generation_server_test\"\n";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8DC2EF540486A6940098B216 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F92C565F0ECD116B009BE4BA /* protected_memory_allocator.cc in Sources */,
- F92C56630ECD1179009BE4BA /* exception_handler.cc in Sources */,
- F92C55D10ECD0064009BE4BA /* Breakpad.mm in Sources */,
- F4DAB1DD19F1027100A5A838 /* launch_reporter.cc in Sources */,
- F92C56340ECD0DF1009BE4BA /* OnDemandServer.mm in Sources */,
- D2F9A4CB121336C7002747C1 /* crash_generation_client.cc in Sources */,
- D2F9A4CD121336C7002747C1 /* crash_generation_server.cc in Sources */,
- 163201D71443019E00C4DBF5 /* ConfigFile.mm in Sources */,
- 162F64F2161C577500CD68D5 /* arch_utilities.cc in Sources */,
- 1EEEB6231720829E00F7E689 /* simple_string_dictionary.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D23F4BA812A868A500686C8D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D23F4BB112A868CB00686C8D /* minidump_generator_test_helper.cc in Sources */,
- D23F4BB812A868F700686C8D /* MachIPC.mm in Sources */,
- D246417012BAA40E005170D0 /* exception_handler.cc in Sources */,
- D246417112BAA41C005170D0 /* crash_generation_client.cc in Sources */,
- D246417512BAA438005170D0 /* minidump_generator.cc in Sources */,
- D246417612BAA43F005170D0 /* dynamic_images.cc in Sources */,
- D246417712BAA444005170D0 /* breakpad_nlist_64.cc in Sources */,
- D246418812BAA4E3005170D0 /* string_utilities.cc in Sources */,
- D246418C12BAA508005170D0 /* minidump_file_writer.cc in Sources */,
- D246419012BAA52A005170D0 /* string_conversion.cc in Sources */,
- D246419112BAA52F005170D0 /* convert_UTF.c in Sources */,
- D246419512BAA54C005170D0 /* file_id.cc in Sources */,
- D246419612BAA55A005170D0 /* macho_id.cc in Sources */,
- D24641A012BAA67F005170D0 /* macho_walker.cc in Sources */,
- D24641AF12BAA82D005170D0 /* macho_utilities.cc in Sources */,
- 4D72CA2513DFAE1C006CABE3 /* md5.cc in Sources */,
- 4D61A26C14F43D42002D5862 /* bootstrap_compat.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2F9A41212131EF0002747C1 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D2F9A43D12131F55002747C1 /* gmock-all.cc in Sources */,
- D2F9A44012131F65002747C1 /* gtest_main.cc in Sources */,
- D2F9A44112131F65002747C1 /* gtest-all.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D2F9A52D121383A1002747C1 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D2F9A553121383DC002747C1 /* crash_generation_server_test.cc in Sources */,
- D2F9A52E121383A1002747C1 /* crash_generation_client.cc in Sources */,
- D2F9A52F121383A1002747C1 /* crash_generation_server.cc in Sources */,
- D2F9A530121383A1002747C1 /* MachIPC.mm in Sources */,
- D2F9A531121383A1002747C1 /* breakpad_nlist_64.cc in Sources */,
- D2F9A532121383A1002747C1 /* dynamic_images.cc in Sources */,
- D2F9A533121383A1002747C1 /* exception_handler.cc in Sources */,
- D2F9A534121383A1002747C1 /* minidump_generator.cc in Sources */,
- D2F9A535121383A1002747C1 /* minidump_file_writer.cc in Sources */,
- D2F9A536121383A1002747C1 /* convert_UTF.c in Sources */,
- D2F9A537121383A1002747C1 /* string_conversion.cc in Sources */,
- D2F9A538121383A1002747C1 /* file_id.cc in Sources */,
- D2F9A539121383A1002747C1 /* macho_id.cc in Sources */,
- D2F9A53A121383A1002747C1 /* macho_utilities.cc in Sources */,
- D2F9A53B121383A1002747C1 /* macho_walker.cc in Sources */,
- D2F9A53C121383A1002747C1 /* string_utilities.cc in Sources */,
- D24641EC12BAC6FB005170D0 /* logging.cc in Sources */,
- D24641ED12BAC6FB005170D0 /* minidump.cc in Sources */,
- D24641EE12BAC6FB005170D0 /* pathname_stripper.cc in Sources */,
- D24641EF12BAC6FB005170D0 /* basic_code_modules.cc in Sources */,
- 4D72CA3913DFAE92006CABE3 /* md5.cc in Sources */,
- 4D61A26F14F43D48002D5862 /* bootstrap_compat.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C53510ECCE349009BE4BA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F92C53B80ECCE7B3009BE4BA /* Inspector.mm in Sources */,
- F9286B3A0F7EB25800A4DCC8 /* InspectorMain.mm in Sources */,
- 163201E31443029300C4DBF5 /* ConfigFile.mm in Sources */,
- 4D61A26B14F43D3C002D5862 /* bootstrap_compat.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C56390ECD10B3009BE4BA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F4F916B619F10FFC00B83BE4 /* launch_reporter.cc in Sources */,
- 162F64F4161C579B00CD68D5 /* arch_utilities.cc in Sources */,
- 162F64F5161C579B00CD68D5 /* arch_utilities.h in Sources */,
- D2A5DD301188633800081F03 /* breakpad_nlist_64.cc in Sources */,
- F92C563F0ECD10CA009BE4BA /* convert_UTF.c in Sources */,
- F92C56400ECD10CA009BE4BA /* dynamic_images.cc in Sources */,
- F92C56410ECD10CA009BE4BA /* file_id.cc in Sources */,
- F92C56420ECD10CA009BE4BA /* macho_id.cc in Sources */,
- F92C56430ECD10CA009BE4BA /* macho_utilities.cc in Sources */,
- F92C56440ECD10CA009BE4BA /* macho_walker.cc in Sources */,
- F92C56450ECD10CA009BE4BA /* MachIPC.mm in Sources */,
- 4D72CA0E13DFAD5C006CABE3 /* md5.cc in Sources */,
- F92C56460ECD10CA009BE4BA /* minidump_file_writer.cc in Sources */,
- F92C56470ECD10CA009BE4BA /* minidump_generator.cc in Sources */,
- F92C56490ECD10CA009BE4BA /* string_utilities.cc in Sources */,
- F92C564A0ECD10CA009BE4BA /* string_conversion.cc in Sources */,
- 4D61A25F14F43CFC002D5862 /* bootstrap_compat.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F92C569D0ECE04A7009BE4BA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44EA20EF09F93003AEBAA /* HTTPMultipartUpload.m in Sources */,
- F92C56A90ECE04C5009BE4BA /* crash_report_sender.m in Sources */,
- F9C44EE90EF0A3C1003AEBAA /* GTMLogger.m in Sources */,
- 16E02DB8147410F0008C604D /* uploader.mm in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93803BB0F80820F004D428B /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D2C1DBE412AFC270006917BD /* logging.cc in Sources */,
- D2C1DBE512AFC270006917BD /* minidump.cc in Sources */,
- D2C1DBE612AFC270006917BD /* pathname_stripper.cc in Sources */,
- D2C1DBE712AFC270006917BD /* basic_code_modules.cc in Sources */,
- D2F9A4DF12133AD9002747C1 /* crash_generation_client.cc in Sources */,
- D2F9A4E012133AD9002747C1 /* crash_generation_server.cc in Sources */,
- D24BBD291211EDB100F3D417 /* MachIPC.mm in Sources */,
- D2A5DD401188640400081F03 /* breakpad_nlist_64.cc in Sources */,
- F93803CD0F8083B7004D428B /* dynamic_images.cc in Sources */,
- F93803CE0F8083B7004D428B /* exception_handler.cc in Sources */,
- F93803CF0F8083B7004D428B /* minidump_generator.cc in Sources */,
- F93803D00F8083B7004D428B /* minidump_file_writer.cc in Sources */,
- F93803D10F8083B7004D428B /* convert_UTF.c in Sources */,
- F93803D20F8083B7004D428B /* string_conversion.cc in Sources */,
- F93803D30F8083B7004D428B /* file_id.cc in Sources */,
- F93803D40F8083B7004D428B /* macho_id.cc in Sources */,
- F93803D50F8083B7004D428B /* macho_utilities.cc in Sources */,
- F93803D60F8083B7004D428B /* macho_walker.cc in Sources */,
- F93803D70F8083B7004D428B /* string_utilities.cc in Sources */,
- D23F4B2E12A7E13200686C8D /* minidump_generator_test.cc in Sources */,
- 4D72CA2F13DFAE65006CABE3 /* md5.cc in Sources */,
- 4D61A26D14F43D43002D5862 /* bootstrap_compat.cc in Sources */,
- 1EEEB62B1720868C00F7E689 /* simple_string_dictionary.cc in Sources */,
- 1EEEB62A1720859200F7E689 /* simple_string_dictionary_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93DE2CE0F82A67300608B94 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F93DE2D90F82A73500608B94 /* minidump_file_writer.cc in Sources */,
- F93DE2DA0F82A73500608B94 /* convert_UTF.c in Sources */,
- F93DE2DB0F82A73500608B94 /* string_conversion.cc in Sources */,
- F93DE2D80F82A70E00608B94 /* minidump_file_writer_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93DE3290F82C55600608B94 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D244536A12426F00009BBCE0 /* logging.cc in Sources */,
- D244536B12426F00009BBCE0 /* minidump.cc in Sources */,
- D244536C12426F00009BBCE0 /* pathname_stripper.cc in Sources */,
- D244536D12426F00009BBCE0 /* basic_code_modules.cc in Sources */,
- D2F9A4E112133AE2002747C1 /* crash_generation_client.cc in Sources */,
- D2F9A4E212133AE2002747C1 /* crash_generation_server.cc in Sources */,
- D24BBD321212CACF00F3D417 /* MachIPC.mm in Sources */,
- D2A5DD411188642E00081F03 /* breakpad_nlist_64.cc in Sources */,
- F93DE3350F82C66B00608B94 /* dynamic_images.cc in Sources */,
- F93DE3360F82C66B00608B94 /* exception_handler.cc in Sources */,
- F93DE3370F82C66B00608B94 /* minidump_generator.cc in Sources */,
- F93DE3380F82C66B00608B94 /* minidump_file_writer.cc in Sources */,
- F93DE3390F82C66B00608B94 /* convert_UTF.c in Sources */,
- F93DE33A0F82C66B00608B94 /* string_conversion.cc in Sources */,
- F93DE33B0F82C66B00608B94 /* file_id.cc in Sources */,
- F93DE33C0F82C66B00608B94 /* macho_id.cc in Sources */,
- F93DE33D0F82C66B00608B94 /* macho_utilities.cc in Sources */,
- F93DE33E0F82C66B00608B94 /* macho_walker.cc in Sources */,
- F93DE33F0F82C66B00608B94 /* string_utilities.cc in Sources */,
- D2F9A3D51212F87C002747C1 /* exception_handler_test.cc in Sources */,
- D244540B12439BA0009BBCE0 /* memory_unittest.cc in Sources */,
- 4D72CA3813DFAE91006CABE3 /* md5.cc in Sources */,
- 4D61A26E14F43D45002D5862 /* bootstrap_compat.cc in Sources */,
- 1EEEB6271720831E00F7E689 /* BreakpadFramework_Test.mm in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9C44DA20EF060A8003AEBAA /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C44DB20EF07288003AEBAA /* Controller.m in Sources */,
- F9C44DB60EF07288003AEBAA /* main.m in Sources */,
- F9C44DB70EF07288003AEBAA /* TestClass.mm in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9C77DD60F7DD5CF0045F7DB /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9C77E130F7DDF810045F7DB /* GTMSenTestCase.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 8B31023911F0CF0600FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = all_unittests;
- targetProxy = 8B31023811F0CF0600FCF3E4 /* PBXContainerItemProxy */;
- };
- 8B31051711F1010E00FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F93803BD0F80820F004D428B /* generator_test */;
- targetProxy = 8B31051611F1010E00FCF3E4 /* PBXContainerItemProxy */;
- };
- 8B31051911F1010E00FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F93DE2D00F82A67300608B94 /* minidump_file_writer_unittest */;
- targetProxy = 8B31051811F1010E00FCF3E4 /* PBXContainerItemProxy */;
- };
- 8B31051B11F1010E00FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F93DE32B0F82C55600608B94 /* handler_test */;
- targetProxy = 8B31051A11F1010E00FCF3E4 /* PBXContainerItemProxy */;
- };
- 8B31051D11F1010E00FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = macho_dump;
- targetProxy = 8B31051C11F1010E00FCF3E4 /* PBXContainerItemProxy */;
- };
- 8B31051F11F1010E00FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = minidump_upload;
- targetProxy = 8B31051E11F1010E00FCF3E4 /* PBXContainerItemProxy */;
- };
- D23F4B3012A7E16200686C8D /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D2F9A41412131EF0002747C1 /* gtest */;
- targetProxy = D23F4B2F12A7E16200686C8D /* PBXContainerItemProxy */;
- };
- D23F4BBA12A8694C00686C8D /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D23F4BAA12A868A500686C8D /* minidump_generator_test_helper */;
- targetProxy = D23F4BB912A8694C00686C8D /* PBXContainerItemProxy */;
- };
- D2F9A44312131F80002747C1 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D2F9A41412131EF0002747C1 /* gtest */;
- targetProxy = D2F9A44212131F80002747C1 /* PBXContainerItemProxy */;
- };
- D2F9A52B121383A1002747C1 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D2F9A41412131EF0002747C1 /* gtest */;
- targetProxy = D2F9A52C121383A1002747C1 /* PBXContainerItemProxy */;
- };
- D2F9A5DF12142A6A002747C1 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D2F9A52A121383A1002747C1 /* crash_generation_server_test */;
- targetProxy = D2F9A5DE12142A6A002747C1 /* PBXContainerItemProxy */;
- };
- F91AF6380FD60A74009D8BE2 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8DC2EF4F0486A6940098B216 /* Breakpad */;
- targetProxy = F91AF6370FD60A74009D8BE2 /* PBXContainerItemProxy */;
- };
- F92C564E0ECD10E5009BE4BA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
- targetProxy = F92C564D0ECD10E5009BE4BA /* PBXContainerItemProxy */;
- };
- F92C56860ECD15EF009BE4BA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
- targetProxy = F92C56850ECD15EF009BE4BA /* PBXContainerItemProxy */;
- };
- F92C56880ECD15F1009BE4BA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C53530ECCE349009BE4BA /* Inspector */;
- targetProxy = F92C56870ECD15F1009BE4BA /* PBXContainerItemProxy */;
- };
- F93DE2FC0F82C3C600608B94 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F93803BD0F80820F004D428B /* generator_test */;
- targetProxy = F93DE2FB0F82C3C600608B94 /* PBXContainerItemProxy */;
- };
- F93DE3700F82CC1300608B94 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F93DE32B0F82C55600608B94 /* handler_test */;
- targetProxy = F93DE36F0F82CC1300608B94 /* PBXContainerItemProxy */;
- };
- F93DE3A70F830D1D00608B94 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F9C77DD90F7DD5CF0045F7DB /* UnitTests */;
- targetProxy = F93DE3A60F830D1D00608B94 /* PBXContainerItemProxy */;
- };
- F94585880F78232B009A47BF /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8DC2EF4F0486A6940098B216 /* Breakpad */;
- targetProxy = F94585870F78232B009A47BF /* PBXContainerItemProxy */;
- };
- F945858A0F78232E009A47BF /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C53530ECCE349009BE4BA /* Inspector */;
- targetProxy = F94585890F78232E009A47BF /* PBXContainerItemProxy */;
- };
- F945858C0F782330009A47BF /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C563B0ECD10B3009BE4BA /* breakpadUtilities */;
- targetProxy = F945858B0F782330009A47BF /* PBXContainerItemProxy */;
- };
- F945858E0F782333009A47BF /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C569F0ECE04A7009BE4BA /* crash_report_sender */;
- targetProxy = F945858D0F782333009A47BF /* PBXContainerItemProxy */;
- };
- F94585900F782336009A47BF /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F9C44DA40EF060A8003AEBAA /* BreakpadTest */;
- targetProxy = F945858F0F782336009A47BF /* PBXContainerItemProxy */;
- };
- F95BB8B3101F94D300AA053B /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = dump_syms;
- targetProxy = F95BB8B2101F94D300AA053B /* PBXContainerItemProxy */;
- };
- F95BB8B5101F94D300AA053B /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = symupload;
- targetProxy = F95BB8B4101F94D300AA053B /* PBXContainerItemProxy */;
- };
- F95BB8B7101F94D300AA053B /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = crash_report;
- targetProxy = F95BB8B6101F94D300AA053B /* PBXContainerItemProxy */;
- };
- F9C44E1A0EF0790F003AEBAA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = 8DC2EF4F0486A6940098B216 /* Breakpad */;
- targetProxy = F9C44E190EF0790F003AEBAA /* PBXContainerItemProxy */;
- };
- F9C44E970EF09F4B003AEBAA /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = F92C569F0ECE04A7009BE4BA /* crash_report_sender */;
- targetProxy = F9C44E960EF09F4B003AEBAA /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin PBXVariantGroup section */
- 33880C7E0F9E097100817F82 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 33880C7F0F9E097100817F82 /* English */,
- DE43468711C7295D004F095F /* da */,
- DE43468611C72958004F095F /* de */,
- DE43468811C7295F004F095F /* es */,
- DE43468911C72964004F095F /* fr */,
- DE43468A11C72967004F095F /* it */,
- DE43468B11C7296B004F095F /* ja */,
- DE43468C11C7296D004F095F /* nl */,
- DE43468D11C7296F004F095F /* no */,
- DE43468E11C72971004F095F /* sl */,
- DE43468F11C72973004F095F /* sv */,
- DE43469011C72976004F095F /* tr */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
- F945849C0F280E3C009A47BF /* Localizable.strings */ = {
- isa = PBXVariantGroup;
- children = (
- F945849D0F280E3C009A47BF /* English */,
- DE43467411C72855004F095F /* da */,
- DE43467511C72857004F095F /* de */,
- DE43467611C7285B004F095F /* es */,
- DE43467711C72862004F095F /* fr */,
- DE43467811C72869004F095F /* it */,
- DE43467E11C728DC004F095F /* ja */,
- DE43467911C7286D004F095F /* nl */,
- DE43467A11C72873004F095F /* no */,
- DE43467B11C72877004F095F /* sl */,
- DE43467C11C7287A004F095F /* sv */,
- DE43467F11C728E1004F095F /* tr */,
- );
- name = Localizable.strings;
- sourceTree = "<group>";
- };
- F9C44DB80EF072A0003AEBAA /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- F9C44DB90EF072A0003AEBAA /* English */,
- );
- name = InfoPlist.strings;
- sourceTree = "<group>";
- };
- F9C44DBA0EF072A0003AEBAA /* MainMenu.xib */ = {
- isa = PBXVariantGroup;
- children = (
- F9C44DBB0EF072A0003AEBAA /* English */,
- );
- name = MainMenu.xib;
- sourceTree = "<group>";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB91AE08733DA50010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Framework/Breakpad_Prefix.pch;
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = Framework/Info.plist;
- INSTALL_PATH = "@executable_path/../Frameworks";
- PRODUCT_NAME = Breakpad;
- WRAPPER_EXTENSION = framework;
- };
- name = Debug;
- };
- 1DEB91AF08733DA50010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Framework/Breakpad_Prefix.pch;
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = Framework/Info.plist;
- INSTALL_PATH = "@executable_path/../Frameworks";
- PRODUCT_NAME = Breakpad;
- WRAPPER_EXTENSION = framework;
- };
- name = Release;
- };
- 1DEB91B208733DA50010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
- buildSettings = {
- GCC_TREAT_WARNINGS_AS_ERRORS = NO;
- SDKROOT = macosx10.5;
- };
- name = Debug;
- };
- 1DEB91B308733DA50010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B31027811F0D3AF00FCF3E4 /* BreakpadRelease.xcconfig */;
- buildSettings = {
- GCC_TREAT_WARNINGS_AS_ERRORS = NO;
- };
- name = Release;
- };
- D23F4BAD12A868A600686C8D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- HEADER_SEARCH_PATHS = ../..;
- INSTALL_PATH = /usr/local/bin;
- PREBINDING = NO;
- PRODUCT_NAME = minidump_generator_test_helper;
- };
- name = Debug;
- };
- D23F4BAE12A868A600686C8D /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- HEADER_SEARCH_PATHS = ../..;
- INSTALL_PATH = /usr/local/bin;
- PREBINDING = NO;
- PRODUCT_NAME = minidump_generator_test_helper;
- };
- name = "Debug With Code Coverage";
- };
- D23F4BAF12A868A600686C8D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- GCC_MODEL_TUNING = G5;
- HEADER_SEARCH_PATHS = ../..;
- INSTALL_PATH = /usr/local/bin;
- PREBINDING = NO;
- PRODUCT_NAME = minidump_generator_test_helper;
- ZERO_LINK = NO;
- };
- name = Release;
- };
- D2F9A41612131EF0002747C1 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_OPTIMIZATION_LEVEL = 0;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- PREBINDING = NO;
- PRODUCT_NAME = gtest;
- };
- name = Debug;
- };
- D2F9A41712131EF0002747C1 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- PREBINDING = NO;
- PRODUCT_NAME = gtest;
- };
- name = "Debug With Code Coverage";
- };
- D2F9A41812131EF0002747C1 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_ENABLE_FIX_AND_CONTINUE = NO;
- HEADER_SEARCH_PATHS = (
- "$(inherited)",
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- PREBINDING = NO;
- PRODUCT_NAME = gtest;
- ZERO_LINK = NO;
- };
- name = Release;
- };
- D2F9A543121383A1002747C1 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = dwarf;
- GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- GCC_PREPROCESSOR_DEFINITIONS = "BP_LOGGING_INCLUDE=\\\"client/mac/tests/testlogging.h\\\"";
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- HEADER_SEARCH_PATHS = (
- ../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/build/Debug\"",
- );
- PRODUCT_NAME = crash_generation_server_test;
- };
- name = Debug;
- };
- D2F9A544121383A1002747C1 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\\\"$(SRCROOT)/build/Debug\\\"",
- );
- PRODUCT_NAME = crash_generation_server_test;
- };
- name = "Debug With Code Coverage";
- };
- D2F9A545121383A1002747C1 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\\\"$(SRCROOT)/build/Debug\\\"",
- );
- PRODUCT_NAME = crash_generation_server_test;
- };
- name = Release;
- };
- F92C53560ECCE34A009BE4BA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- PRODUCT_NAME = Inspector;
- };
- name = Debug;
- };
- F92C53570ECCE34A009BE4BA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- PRODUCT_NAME = Inspector;
- };
- name = Release;
- };
- F92C563D0ECD10B3009BE4BA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- HEADER_SEARCH_PATHS = ../..;
- LD_DYLIB_INSTALL_NAME = "@executable_path/../Resources/$(EXECUTABLE_PATH)";
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-headerpad_max_install_names",
- );
- PRODUCT_NAME = breakpadUtilities;
- };
- name = Debug;
- };
- F92C563E0ECD10B3009BE4BA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- HEADER_SEARCH_PATHS = ../..;
- LD_DYLIB_INSTALL_NAME = "@executable_path/../Resources/$(EXECUTABLE_PATH)";
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-headerpad_max_install_names",
- );
- PRODUCT_NAME = breakpadUtilities;
- };
- name = Release;
- };
- F92C56A30ECE04A8009BE4BA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = "sender/crash_report_sender-Info.plist";
- PRODUCT_NAME = crash_report_sender;
- };
- name = Debug;
- };
- F92C56A40ECE04A8009BE4BA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = "sender/crash_report_sender-Info.plist";
- PRODUCT_NAME = crash_report_sender;
- };
- name = Release;
- };
- F93803C00F808210004D428B /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = "BP_LOGGING_INCLUDE=\\\"client/mac/tests/testlogging.h\\\"";
- HEADER_SEARCH_PATHS = (
- ../..,
- ../../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- PRODUCT_NAME = generator_test;
- };
- name = Debug;
- };
- F93803C10F808210004D428B /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../..,
- ../../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- PRODUCT_NAME = generator_test;
- };
- name = Release;
- };
- F93DE2D30F82A67400608B94 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- PRODUCT_NAME = minidump_file_writer_unittest;
- };
- name = Debug;
- };
- F93DE2D40F82A67400608B94 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- PRODUCT_NAME = minidump_file_writer_unittest;
- };
- name = Release;
- };
- F93DE32E0F82C55700608B94 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DEBUG_INFORMATION_FORMAT = dwarf;
- GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
- GCC_PREPROCESSOR_DEFINITIONS = "BP_LOGGING_INCLUDE=\\\"client/mac/tests/testlogging.h\\\"";
- GCC_SYMBOLS_PRIVATE_EXTERN = NO;
- HEADER_SEARCH_PATHS = (
- ../../..,
- ../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/build/Debug\"",
- );
- PRODUCT_NAME = handler_test;
- };
- name = Debug;
- };
- F93DE32F0F82C55700608B94 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../../..,
- ../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/build/Debug\"",
- );
- PRODUCT_NAME = handler_test;
- };
- name = Release;
- };
- F93DE3B90F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B31027711F0D3AF00FCF3E4 /* BreakpadDebug.xcconfig */;
- buildSettings = {
- GCC_TREAT_WARNINGS_AS_ERRORS = NO;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3BA0F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- GCC_PRECOMPILE_PREFIX_HEADER = YES;
- GCC_PREFIX_HEADER = Framework/Breakpad_Prefix.pch;
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = Framework/Info.plist;
- INSTALL_PATH = "@executable_path/../Frameworks";
- PRODUCT_NAME = Breakpad;
- WRAPPER_EXTENSION = framework;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3BB0F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- PRODUCT_NAME = Inspector;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3BC0F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- HEADER_SEARCH_PATHS = ../..;
- LD_DYLIB_INSTALL_NAME = "@executable_path/../Resources/$(EXECUTABLE_PATH)";
- OTHER_LDFLAGS = (
- "$(inherited)",
- "-headerpad_max_install_names",
- );
- PRODUCT_NAME = breakpadUtilities;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3BD0F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = "sender/crash_report_sender-Info.plist";
- PRODUCT_NAME = crash_report_sender;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3BE0F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/build/$(CONFIGURATION)";
- INFOPLIST_FILE = testapp/Info.plist;
- PRODUCT_NAME = BreakpadTest;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3BF0F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = All;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3C00F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
- );
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- HEADER_SEARCH_PATHS = ../..;
- INFOPLIST_FILE = "UnitTests-Info.plist";
- PRODUCT_NAME = UnitTests;
- WRAPPER_EXTENSION = octest;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3C10F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../..,
- ../../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- PRODUCT_NAME = generator_test;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3C20F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../..;
- PRODUCT_NAME = minidump_file_writer_unittest;
- };
- name = "Debug With Code Coverage";
- };
- F93DE3C30F830E7000608B94 /* Debug With Code Coverage */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../../..,
- ../..,
- ../../testing,
- ../../testing/include,
- ../../testing/gtest,
- ../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(SRCROOT)/build/Debug\"",
- );
- PRODUCT_NAME = handler_test;
- };
- name = "Debug With Code Coverage";
- };
- F94585850F782326009A47BF /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = All;
- };
- name = Debug;
- };
- F94585860F782326009A47BF /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = All;
- };
- name = Release;
- };
- F9C44DA80EF060A8003AEBAA /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/build/$(CONFIGURATION)";
- INFOPLIST_FILE = testapp/Info.plist;
- PRODUCT_NAME = BreakpadTest;
- };
- name = Debug;
- };
- F9C44DA90EF060A8003AEBAA /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(SRCROOT)/build/$(CONFIGURATION)";
- INFOPLIST_FILE = testapp/Info.plist;
- PRODUCT_NAME = BreakpadTest;
- };
- name = Release;
- };
- F9C77DDC0F7DD5D00045F7DB /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
- );
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- INFOPLIST_FILE = "UnitTests-Info.plist";
- PRODUCT_NAME = UnitTests;
- WRAPPER_EXTENSION = octest;
- };
- name = Debug;
- };
- F9C77DDD0F7DD5D00045F7DB /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
- );
- GCC_ENABLE_OBJC_EXCEPTIONS = YES;
- INFOPLIST_FILE = "UnitTests-Info.plist";
- PRODUCT_NAME = UnitTests;
- WRAPPER_EXTENSION = octest;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "Breakpad" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB91AE08733DA50010E9CD /* Debug */,
- F93DE3BA0F830E7000608B94 /* Debug With Code Coverage */,
- 1DEB91AF08733DA50010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "Breakpad" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB91B208733DA50010E9CD /* Debug */,
- F93DE3B90F830E7000608B94 /* Debug With Code Coverage */,
- 1DEB91B308733DA50010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- D23F4BB012A868C400686C8D /* Build configuration list for PBXNativeTarget "minidump_generator_test_helper" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- D23F4BAD12A868A600686C8D /* Debug */,
- D23F4BAE12A868A600686C8D /* Debug With Code Coverage */,
- D23F4BAF12A868A600686C8D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- D2F9A42D12131F0E002747C1 /* Build configuration list for PBXNativeTarget "gtest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- D2F9A41612131EF0002747C1 /* Debug */,
- D2F9A41712131EF0002747C1 /* Debug With Code Coverage */,
- D2F9A41812131EF0002747C1 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- D2F9A542121383A1002747C1 /* Build configuration list for PBXNativeTarget "crash_generation_server_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- D2F9A543121383A1002747C1 /* Debug */,
- D2F9A544121383A1002747C1 /* Debug With Code Coverage */,
- D2F9A545121383A1002747C1 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F92C53580ECCE36D009BE4BA /* Build configuration list for PBXNativeTarget "Inspector" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F92C53560ECCE34A009BE4BA /* Debug */,
- F93DE3BB0F830E7000608B94 /* Debug With Code Coverage */,
- F92C53570ECCE34A009BE4BA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F92C56670ECD11A3009BE4BA /* Build configuration list for PBXNativeTarget "breakpadUtilities" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F92C563D0ECD10B3009BE4BA /* Debug */,
- F93DE3BC0F830E7000608B94 /* Debug With Code Coverage */,
- F92C563E0ECD10B3009BE4BA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F92C56A50ECE04A8009BE4BA /* Build configuration list for PBXNativeTarget "crash_report_sender" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F92C56A30ECE04A8009BE4BA /* Debug */,
- F93DE3BD0F830E7000608B94 /* Debug With Code Coverage */,
- F92C56A40ECE04A8009BE4BA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F93803C40F80822E004D428B /* Build configuration list for PBXNativeTarget "generator_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F93803C00F808210004D428B /* Debug */,
- F93DE3C10F830E7000608B94 /* Debug With Code Coverage */,
- F93803C10F808210004D428B /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F93DE2D60F82A67700608B94 /* Build configuration list for PBXNativeTarget "minidump_file_writer_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F93DE2D30F82A67400608B94 /* Debug */,
- F93DE3C20F830E7000608B94 /* Debug With Code Coverage */,
- F93DE2D40F82A67400608B94 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F93DE3320F82C5D800608B94 /* Build configuration list for PBXNativeTarget "handler_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F93DE32E0F82C55700608B94 /* Debug */,
- F93DE3C30F830E7000608B94 /* Debug With Code Coverage */,
- F93DE32F0F82C55700608B94 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F94585930F78235C009A47BF /* Build configuration list for PBXAggregateTarget "All" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F94585850F782326009A47BF /* Debug */,
- F93DE3BF0F830E7000608B94 /* Debug With Code Coverage */,
- F94585860F782326009A47BF /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F9C44DAA0EF060A9003AEBAA /* Build configuration list for PBXNativeTarget "BreakpadTest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F9C44DA80EF060A8003AEBAA /* Debug */,
- F93DE3BE0F830E7000608B94 /* Debug With Code Coverage */,
- F9C44DA90EF060A8003AEBAA /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F9C77DDE0F7DD5D00045F7DB /* Build configuration list for PBXNativeTarget "UnitTests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F9C77DDC0F7DD5D00045F7DB /* Debug */,
- F93DE3C00F830E7000608B94 /* Debug With Code Coverage */,
- F9C77DDD0F7DD5D00045F7DB /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h
deleted file mode 100644
index dc7e45d1c8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.h
+++ /dev/null
@@ -1,285 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Framework to provide a simple C API to crash reporting for
-// applications. By default, if any machine-level exception (e.g.,
-// EXC_BAD_ACCESS) occurs, it will be handled by the BreakpadRef
-// object as follows:
-//
-// 1. Create a minidump file (see Breakpad for details)
-// 2. Prompt the user (using CFUserNotification)
-// 3. Invoke a command line reporting tool to send the minidump to a
-// server
-//
-// By specifying parameters to the BreakpadCreate function, you can
-// modify the default behavior to suit your needs and wants and
-// desires.
-
-// A service name associated with the original bootstrap parent port, saved in
-// OnDemandServer and restored in Inspector.
-#define BREAKPAD_BOOTSTRAP_PARENT_PORT "com.Breakpad.BootstrapParent"
-
-typedef void *BreakpadRef;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <Foundation/Foundation.h>
-
-#include "BreakpadDefines.h"
-
-// Optional user-defined function to dec to decide if we should handle
-// this crash or forward it along.
-// Return true if you want Breakpad to handle it.
-// Return false if you want Breakpad to skip it
-// The exception handler always returns false, as if SEND_AND_EXIT were false
-// (which means the next exception handler will take the exception)
-typedef bool (*BreakpadFilterCallback)(int exception_type,
- int exception_code,
- mach_port_t crashing_thread,
- void *context);
-
-// Create a new BreakpadRef object and install it as an exception
-// handler. The |parameters| will typically be the contents of your
-// bundle's Info.plist.
-//
-// You can also specify these additional keys for customizable behavior:
-// Key: Value:
-// BREAKPAD_PRODUCT Product name (e.g., "MyAwesomeProduct")
-// This one is used as the key to identify
-// the product when uploading. Falls back to
-// CFBundleName if not specified.
-// REQUIRED
-//
-// BREAKPAD_PRODUCT_DISPLAY This is the display name, e.g. a pretty
-// name for the product when the crash_sender
-// pops up UI for the user. Falls back first to
-// CFBundleDisplayName and then to
-// BREAKPAD_PRODUCT if not specified.
-//
-// BREAKPAD_VERSION Product version (e.g., 1.2.3), used
-// as metadata for crash report. Falls back to
-// CFBundleVersion if not specified.
-// REQUIRED
-//
-// BREAKPAD_VENDOR Vendor name, used in UI (e.g. "A report has
-// been created that you can send to <vendor>")
-//
-// BREAKPAD_URL URL destination for reporting
-// REQUIRED
-//
-// BREAKPAD_REPORT_INTERVAL # of seconds between sending
-// reports. If an additional report is
-// generated within this time, it will
-// be ignored. Default: 3600sec.
-// Specify 0 to send all reports.
-//
-// BREAKPAD_SKIP_CONFIRM If true, the reporter will send the report
-// without any user intervention.
-// Defaults to NO
-//
-// BREAKPAD_CONFIRM_TIMEOUT Number of seconds before the upload
-// confirmation dialog will be automatically
-// dismissed (cancelling the upload).
-// Default: 300 seconds (min of 60).
-// Specify 0 to prevent timeout.
-//
-// BREAKPAD_SEND_AND_EXIT If true, the handler will exit after sending.
-// This will prevent any other handler (e.g.,
-// CrashReporter) from getting the crash.
-// Defaults TO YES
-//
-// BREAKPAD_DUMP_DIRECTORY The directory to store crash-dumps
-// in. By default, we use
-// ~/Library/Breakpad/<BREAKPAD_PRODUCT>
-// The path you specify here is tilde-expanded.
-//
-// BREAKPAD_INSPECTOR_LOCATION The full path to the Inspector executable.
-// Defaults to <Framework resources>/Inspector
-//
-// BREAKPAD_REPORTER_EXE_LOCATION The full path to the Reporter/sender
-// executable.
-// Default:
-// <Framework Resources>/crash_report_sender.app
-//
-// BREAKPAD_LOGFILES Indicates an array of log file paths that
-// should be uploaded at crash time.
-//
-// BREAKPAD_REQUEST_COMMENTS If true, the message dialog will have a
-// text box for the user to enter comments.
-// Default: NO
-//
-// BREAKPAD_REQUEST_EMAIL If true and BREAKPAD_REQUEST_COMMENTS is also
-// true, the message dialog will have a text
-// box for the user to enter their email address.
-// Default: NO
-//
-// BREAKPAD_SERVER_TYPE A parameter that tells Breakpad how to
-// rewrite the upload parameters for a specific
-// server type. The currently valid values are
-// 'socorro' or 'google'. If you want to add
-// other types, see the function in
-// crash_report_sender.m that maps parameters to
-// URL parameters. Defaults to 'google'.
-//
-// BREAKPAD_SERVER_PARAMETER_DICT A plist dictionary of static
-// parameters that are uploaded to the
-// server. The parameters are sent as
-// is to the crash server. Their
-// content isn't added to the minidump
-// but pass as URL parameters when
-// uploading theminidump to the crash
-// server.
-//
-// BREAKPAD_IN_PROCESS A boolean NSNumber value. If YES, Breakpad
-// will write the dump file in-process and then
-// launch the reporter executable as a child
-// process.
-//=============================================================================
-// The BREAKPAD_PRODUCT, BREAKPAD_VERSION and BREAKPAD_URL are
-// required to have non-NULL values. By default, the BREAKPAD_PRODUCT
-// will be the CFBundleName and the BREAKPAD_VERSION will be the
-// CFBundleVersion when these keys are present in the bundle's
-// Info.plist, which is usually passed in to BreakpadCreate() as an
-// NSDictionary (you could also pass in another dictionary that had
-// the same keys configured). If the BREAKPAD_PRODUCT or
-// BREAKPAD_VERSION are ultimately undefined, BreakpadCreate() will
-// fail. You have been warned.
-//
-// If you are running in a debugger, Breakpad will not install, unless the
-// BREAKPAD_IGNORE_DEBUGGER envionment variable is set and/or non-zero.
-//
-// The BREAKPAD_SKIP_CONFIRM and BREAKPAD_SEND_AND_EXIT default
-// values are NO and YES. However, they can be controlled by setting their
-// values in a user or global plist.
-//
-// It's easiest to use Breakpad via the Framework, but if you're compiling the
-// code in directly, BREAKPAD_INSPECTOR_LOCATION and
-// BREAKPAD_REPORTER_EXE_LOCATION allow you to specify custom paths
-// to the helper executables.
-//
-//=============================================================================
-// The following are NOT user-supplied but are documented here for
-// completeness. They are calculated by Breakpad during initialization &
-// crash-dump generation, or entered in by the user.
-//
-// BREAKPAD_PROCESS_START_TIME The time, in seconds since the Epoch, the
-// process started
-//
-// BREAKPAD_PROCESS_CRASH_TIME The time, in seconds since the Epoch, the
-// process crashed.
-//
-// BREAKPAD_PROCESS_UP_TIME The total time in milliseconds the process
-// has been running. This parameter is not
-// set until the crash-dump-generation phase.
-//
-// BREAKPAD_LOGFILE_KEY_PREFIX Used to find out which parameters in the
-// parameter dictionary correspond to log
-// file paths.
-//
-// BREAKPAD_SERVER_PARAMETER_PREFIX This prefix is used by Breakpad
-// internally, because Breakpad uses
-// the same dictionary internally to
-// track both its internal
-// configuration parameters and
-// parameters meant to be uploaded
-// to the server. This string is
-// used internally by Breakpad to
-// prefix user-supplied parameter
-// names so those can be sent to the
-// server without leaking Breakpad's
-// internal values.
-//
-// BREAKPAD_ON_DEMAND Used internally to indicate to the
-// Reporter that we're sending on-demand,
-// not as result of a crash.
-//
-// BREAKPAD_COMMENTS The text the user provided as comments.
-// Only used in crash_report_sender.
-
-// Returns a new BreakpadRef object on success, NULL otherwise.
-BreakpadRef BreakpadCreate(NSDictionary *parameters);
-
-// Uninstall and release the data associated with |ref|.
-void BreakpadRelease(BreakpadRef ref);
-
-// Clients may set an optional callback which gets called when a crash
-// occurs. The callback function should return |true| if we should
-// handle the crash, generate a crash report, etc. or |false| if we
-// should ignore it and forward the crash (normally to CrashReporter).
-// Context is a pointer to arbitrary data to make the callback with.
-void BreakpadSetFilterCallback(BreakpadRef ref,
- BreakpadFilterCallback callback,
- void *context);
-
-// User defined key and value string storage. Generally this is used
-// to configure Breakpad's internal operation, such as whether the
-// crash_sender should prompt the user, or the filesystem location for
-// the minidump file. See Breakpad.h for some parameters that can be
-// set. Anything longer than 255 bytes will be truncated. Note that
-// the string is converted to UTF8 before truncation, so any multibyte
-// character that straddles the 255(256 - 1 for terminator) byte limit
-// will be mangled.
-//
-// A maximum number of 64 key/value pairs are supported. An assert()
-// will fire if more than this number are set. Unfortunately, right
-// now, the same dictionary is used for both Breakpad's parameters AND
-// the Upload parameters.
-//
-// TODO (nealsid): Investigate how necessary this is if we don't
-// automatically upload parameters to the server anymore.
-// TODO (nealsid): separate server parameter dictionary from the
-// dictionary used to configure Breakpad, and document limits for each
-// independently.
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value);
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key);
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key);
-
-// You can use this method to specify parameters that will be uploaded
-// to the crash server. They will be automatically encoded as
-// necessary. Note that as mentioned above there are limits on both
-// the number of keys and their length.
-void BreakpadAddUploadParameter(BreakpadRef ref, NSString *key,
- NSString *value);
-
-// This method will remove a previously-added parameter from the
-// upload parameter set.
-void BreakpadRemoveUploadParameter(BreakpadRef ref, NSString *key);
-
-// Add a log file for Breakpad to read and send upon crash dump
-void BreakpadAddLogFile(BreakpadRef ref, NSString *logPathname);
-
-// Generate a minidump and send
-void BreakpadGenerateAndSendReport(BreakpadRef ref);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm
deleted file mode 100644
index 1d2e519bbd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad.mm
+++ /dev/null
@@ -1,1043 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-
-
-#define IGNORE_DEBUGGER "BREAKPAD_IGNORE_DEBUGGER"
-
-#import "client/mac/Framework/Breakpad.h"
-
-#include <assert.h>
-#import <Foundation/Foundation.h>
-#include <pthread.h>
-#include <sys/stat.h>
-#include <sys/sysctl.h>
-
-#import "client/mac/crash_generation/Inspector.h"
-#import "client/mac/handler/exception_handler.h"
-#import "client/mac/Framework/Breakpad.h"
-#import "client/mac/Framework/OnDemandServer.h"
-#import "client/mac/handler/protected_memory_allocator.h"
-#include "common/mac/launch_reporter.h"
-#import "common/mac/MachIPC.h"
-#import "common/simple_string_dictionary.h"
-
-#if !defined(__EXCEPTIONS) || (__clang__ && !__has_feature(cxx_exceptions))
-// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
-// <c++/4.2.1/exception_defines.h> allowing this file to work properly with
-// exceptions disabled even when other C++ libraries are used. #undef the try
-// and catch macros first in case libstdc++ is in use and has already provided
-// its own definitions.
-#undef try
-#define try if (true)
-#undef catch
-#define catch(X) if (false)
-#endif // __EXCEPTIONS
-
-using google_breakpad::MachPortSender;
-using google_breakpad::MachReceiveMessage;
-using google_breakpad::MachSendMessage;
-using google_breakpad::ReceivePort;
-using google_breakpad::SimpleStringDictionary;
-
-//=============================================================================
-// We want any memory allocations which are used by breakpad during the
-// exception handling process (after a crash has happened) to be read-only
-// to prevent them from being smashed before a crash occurs. Unfortunately
-// we cannot protect against smashes to our exception handling thread's
-// stack.
-//
-// NOTE: Any memory allocations which are not used during the exception
-// handling process may be allocated in the normal ways.
-//
-// The ProtectedMemoryAllocator class provides an Allocate() method which
-// we'll using in conjunction with placement operator new() to control
-// allocation of C++ objects. Note that we don't use operator delete()
-// but instead call the objects destructor directly: object->~ClassName();
-//
-ProtectedMemoryAllocator *gMasterAllocator = NULL;
-ProtectedMemoryAllocator *gKeyValueAllocator = NULL;
-ProtectedMemoryAllocator *gBreakpadAllocator = NULL;
-
-// Mutex for thread-safe access to the key/value dictionary used by breakpad.
-// It's a global instead of an instance variable of Breakpad
-// since it can't live in a protected memory area.
-pthread_mutex_t gDictionaryMutex;
-
-//=============================================================================
-// Stack-based object for thread-safe access to a memory-protected region.
-// It's assumed that normally the memory block (allocated by the allocator)
-// is protected (read-only). Creating a stack-based instance of
-// ProtectedMemoryLocker will unprotect this block after taking the lock.
-// Its destructor will first re-protect the memory then release the lock.
-class ProtectedMemoryLocker {
- public:
- ProtectedMemoryLocker(pthread_mutex_t *mutex,
- ProtectedMemoryAllocator *allocator)
- : mutex_(mutex),
- allocator_(allocator) {
- // Lock the mutex
- __attribute__((unused)) int rv = pthread_mutex_lock(mutex_);
- assert(rv == 0);
-
- // Unprotect the memory
- allocator_->Unprotect();
- }
-
- ~ProtectedMemoryLocker() {
- // First protect the memory
- allocator_->Protect();
-
- // Then unlock the mutex
- __attribute__((unused)) int rv = pthread_mutex_unlock(mutex_);
- assert(rv == 0);
- };
-
- private:
- ProtectedMemoryLocker();
- ProtectedMemoryLocker(const ProtectedMemoryLocker&);
- ProtectedMemoryLocker& operator=(const ProtectedMemoryLocker&);
-
- pthread_mutex_t *mutex_;
- ProtectedMemoryAllocator *allocator_;
-};
-
-//=============================================================================
-class Breakpad {
- public:
- // factory method
- static Breakpad *Create(NSDictionary *parameters) {
- // Allocate from our special allocation pool
- Breakpad *breakpad =
- new (gBreakpadAllocator->Allocate(sizeof(Breakpad)))
- Breakpad();
-
- if (!breakpad)
- return NULL;
-
- if (!breakpad->Initialize(parameters)) {
- // Don't use operator delete() here since we allocated from special pool
- breakpad->~Breakpad();
- return NULL;
- }
-
- return breakpad;
- }
-
- ~Breakpad();
-
- void SetKeyValue(NSString *key, NSString *value);
- NSString *KeyValue(NSString *key);
- void RemoveKeyValue(NSString *key);
-
- void GenerateAndSendReport();
-
- void SetFilterCallback(BreakpadFilterCallback callback, void *context) {
- filter_callback_ = callback;
- filter_callback_context_ = context;
- }
-
- private:
- Breakpad()
- : handler_(NULL),
- config_params_(NULL),
- send_and_exit_(true),
- filter_callback_(NULL),
- filter_callback_context_(NULL) {
- inspector_path_[0] = 0;
- }
-
- bool Initialize(NSDictionary *parameters);
- bool InitializeInProcess(NSDictionary *parameters);
- bool InitializeOutOfProcess(NSDictionary *parameters);
-
- bool ExtractParameters(NSDictionary *parameters);
-
- // Dispatches to HandleException()
- static bool ExceptionHandlerDirectCallback(void *context,
- int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread);
-
- bool HandleException(int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread);
-
- // Dispatches to HandleMinidump().
- // This gets called instead of ExceptionHandlerDirectCallback when running
- // with the BREAKPAD_IN_PROCESS option.
- static bool HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context,
- bool succeeded);
-
- // This is only used when BREAKPAD_IN_PROCESS is YES.
- bool HandleMinidump(const char *dump_dir, const char *minidump_id);
-
- // Since ExceptionHandler (w/o namespace) is defined as typedef in OSX's
- // MachineExceptions.h, we have to explicitly name the handler.
- google_breakpad::ExceptionHandler *handler_; // The actual handler (STRONG)
-
- char inspector_path_[PATH_MAX]; // Path to inspector tool
-
- SimpleStringDictionary *config_params_; // Create parameters (STRONG)
-
- OnDemandServer inspector_;
-
- bool send_and_exit_; // Exit after sending, if true
-
- BreakpadFilterCallback filter_callback_;
- void *filter_callback_context_;
-};
-
-#pragma mark -
-#pragma mark Helper functions
-
-//=============================================================================
-// Helper functions
-
-//=============================================================================
-static BOOL IsDebuggerActive() {
- BOOL result = NO;
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
-
- // We check both defaults and the environment variable here
-
- BOOL ignoreDebugger = [stdDefaults boolForKey:@IGNORE_DEBUGGER];
-
- if (!ignoreDebugger) {
- char *ignoreDebuggerStr = getenv(IGNORE_DEBUGGER);
- ignoreDebugger = (ignoreDebuggerStr ? strtol(ignoreDebuggerStr, NULL, 10) : 0) != 0;
- }
-
- if (!ignoreDebugger) {
- pid_t pid = getpid();
- int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid};
- int mibSize = sizeof(mib) / sizeof(int);
- size_t actualSize;
-
- if (sysctl(mib, mibSize, NULL, &actualSize, NULL, 0) == 0) {
- struct kinfo_proc *info = (struct kinfo_proc *)malloc(actualSize);
-
- if (info) {
- // This comes from looking at the Darwin xnu Kernel
- if (sysctl(mib, mibSize, info, &actualSize, NULL, 0) == 0)
- result = (info->kp_proc.p_flag & P_TRACED) ? YES : NO;
-
- free(info);
- }
- }
- }
-
- return result;
-}
-
-//=============================================================================
-bool Breakpad::ExceptionHandlerDirectCallback(void *context,
- int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread) {
- Breakpad *breakpad = (Breakpad *)context;
-
- // If our context is damaged or something, just return false to indicate that
- // the handler should continue without us.
- if (!breakpad)
- return false;
-
- return breakpad->HandleException( exception_type,
- exception_code,
- exception_subcode,
- crashing_thread);
-}
-
-//=============================================================================
-bool Breakpad::HandleMinidumpCallback(const char *dump_dir,
- const char *minidump_id,
- void *context,
- bool succeeded) {
- Breakpad *breakpad = (Breakpad *)context;
-
- // If our context is damaged or something, just return false to indicate that
- // the handler should continue without us.
- if (!breakpad || !succeeded)
- return false;
-
- return breakpad->HandleMinidump(dump_dir, minidump_id);
-}
-
-//=============================================================================
-#pragma mark -
-
-#include <dlfcn.h>
-
-//=============================================================================
-// Returns the pathname to the Resources directory for this version of
-// Breakpad which we are now running.
-//
-// Don't make the function static, since _dyld_lookup_and_bind_fully needs a
-// simple non-static C name
-//
-extern "C" {
-NSString * GetResourcePath();
-NSString * GetResourcePath() {
- NSString *resourcePath = nil;
-
- // If there are multiple breakpads installed then calling bundleWithIdentifier
- // will not work properly, so only use that as a backup plan.
- // We want to find the bundle containing the code where this function lives
- // and work from there
- //
-
- // Get the pathname to the code which contains this function
- Dl_info info;
- if (dladdr((const void*)GetResourcePath, &info) != 0) {
- NSFileManager *filemgr = [NSFileManager defaultManager];
- NSString *filePath =
- [filemgr stringWithFileSystemRepresentation:info.dli_fname
- length:strlen(info.dli_fname)];
- NSString *bundlePath = [filePath stringByDeletingLastPathComponent];
- // The "Resources" directory should be in the same directory as the
- // executable code, since that's how the Breakpad framework is built.
- resourcePath = [bundlePath stringByAppendingPathComponent:@"Resources/"];
- } else {
- // fallback plan
- NSBundle *bundle =
- [NSBundle bundleWithIdentifier:@"com.Google.BreakpadFramework"];
- resourcePath = [bundle resourcePath];
- }
-
- return resourcePath;
-}
-} // extern "C"
-
-//=============================================================================
-bool Breakpad::Initialize(NSDictionary *parameters) {
- // Initialize
- config_params_ = NULL;
- handler_ = NULL;
-
- // Check for debugger
- if (IsDebuggerActive()) {
- return true;
- }
-
- // Gather any user specified parameters
- if (!ExtractParameters(parameters)) {
- return false;
- }
-
- if ([[parameters objectForKey:@BREAKPAD_IN_PROCESS] boolValue])
- return InitializeInProcess(parameters);
- else
- return InitializeOutOfProcess(parameters);
-}
-
-//=============================================================================
-bool Breakpad::InitializeInProcess(NSDictionary* parameters) {
- handler_ =
- new (gBreakpadAllocator->Allocate(
- sizeof(google_breakpad::ExceptionHandler)))
- google_breakpad::ExceptionHandler(
- config_params_->GetValueForKey(BREAKPAD_DUMP_DIRECTORY),
- 0, &HandleMinidumpCallback, this, true, 0);
- return true;
-}
-
-//=============================================================================
-bool Breakpad::InitializeOutOfProcess(NSDictionary* parameters) {
- // Get path to Inspector executable.
- NSString *inspectorPathString = KeyValue(@BREAKPAD_INSPECTOR_LOCATION);
-
- // Standardize path (resolve symlinkes, etc.) and escape spaces
- inspectorPathString = [inspectorPathString stringByStandardizingPath];
- inspectorPathString = [[inspectorPathString componentsSeparatedByString:@" "]
- componentsJoinedByString:@"\\ "];
-
- // Create an on-demand server object representing the Inspector.
- // In case of a crash, we simply need to call the LaunchOnDemand()
- // method on it, then send a mach message to its service port.
- // It will then launch and perform a process inspection of our crashed state.
- // See the HandleException() method for the details.
-#define RECEIVE_PORT_NAME "com.Breakpad.Inspector"
-
- name_t portName;
- snprintf(portName, sizeof(name_t), "%s%d", RECEIVE_PORT_NAME, getpid());
-
- // Save the location of the Inspector
- strlcpy(inspector_path_, [inspectorPathString fileSystemRepresentation],
- sizeof(inspector_path_));
-
- // Append a single command-line argument to the Inspector path
- // representing the bootstrap name of the launch-on-demand receive port.
- // When the Inspector is launched, it can use this to lookup the port
- // by calling bootstrap_check_in().
- strlcat(inspector_path_, " ", sizeof(inspector_path_));
- strlcat(inspector_path_, portName, sizeof(inspector_path_));
-
- kern_return_t kr = inspector_.Initialize(inspector_path_,
- portName,
- true); // shutdown on exit
-
- if (kr != KERN_SUCCESS) {
- return false;
- }
-
- // Create the handler (allocating it in our special protected pool)
- handler_ =
- new (gBreakpadAllocator->Allocate(
- sizeof(google_breakpad::ExceptionHandler)))
- google_breakpad::ExceptionHandler(
- Breakpad::ExceptionHandlerDirectCallback, this, true);
- return true;
-}
-
-//=============================================================================
-Breakpad::~Breakpad() {
- // Note that we don't use operator delete() on these pointers,
- // since they were allocated by ProtectedMemoryAllocator objects.
- //
- if (config_params_) {
- config_params_->~SimpleStringDictionary();
- }
-
- if (handler_)
- handler_->~ExceptionHandler();
-}
-
-//=============================================================================
-bool Breakpad::ExtractParameters(NSDictionary *parameters) {
- NSUserDefaults *stdDefaults = [NSUserDefaults standardUserDefaults];
- NSString *skipConfirm = [stdDefaults stringForKey:@BREAKPAD_SKIP_CONFIRM];
- NSString *sendAndExit = [stdDefaults stringForKey:@BREAKPAD_SEND_AND_EXIT];
-
- NSString *serverType = [parameters objectForKey:@BREAKPAD_SERVER_TYPE];
- NSString *display = [parameters objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
- NSString *product = [parameters objectForKey:@BREAKPAD_PRODUCT];
- NSString *version = [parameters objectForKey:@BREAKPAD_VERSION];
- NSString *urlStr = [parameters objectForKey:@BREAKPAD_URL];
- NSString *interval = [parameters objectForKey:@BREAKPAD_REPORT_INTERVAL];
- NSString *inspectorPathString =
- [parameters objectForKey:@BREAKPAD_INSPECTOR_LOCATION];
- NSString *reporterPathString =
- [parameters objectForKey:@BREAKPAD_REPORTER_EXE_LOCATION];
- NSString *timeout = [parameters objectForKey:@BREAKPAD_CONFIRM_TIMEOUT];
- NSArray *logFilePaths = [parameters objectForKey:@BREAKPAD_LOGFILES];
- NSString *logFileTailSize =
- [parameters objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE];
- NSString *requestUserText =
- [parameters objectForKey:@BREAKPAD_REQUEST_COMMENTS];
- NSString *requestEmail = [parameters objectForKey:@BREAKPAD_REQUEST_EMAIL];
- NSString *vendor =
- [parameters objectForKey:@BREAKPAD_VENDOR];
- NSString *dumpSubdirectory =
- [parameters objectForKey:@BREAKPAD_DUMP_DIRECTORY];
-
- NSDictionary *serverParameters =
- [parameters objectForKey:@BREAKPAD_SERVER_PARAMETER_DICT];
-
- // These may have been set above as user prefs, which take priority.
- if (!skipConfirm) {
- skipConfirm = [parameters objectForKey:@BREAKPAD_SKIP_CONFIRM];
- }
- if (!sendAndExit) {
- sendAndExit = [parameters objectForKey:@BREAKPAD_SEND_AND_EXIT];
- }
-
- if (!product)
- product = [parameters objectForKey:@"CFBundleName"];
-
- if (!display) {
- display = [parameters objectForKey:@"CFBundleDisplayName"];
- if (!display) {
- display = product;
- }
- }
-
- if (!version)
- version = [parameters objectForKey:@"CFBundleVersion"];
-
- if (!interval)
- interval = @"3600";
-
- if (!timeout)
- timeout = @"300";
-
- if (!logFileTailSize)
- logFileTailSize = @"200000";
-
- if (!vendor) {
- vendor = @"Vendor not specified";
- }
-
- // Normalize the values.
- if (skipConfirm) {
- skipConfirm = [skipConfirm uppercaseString];
-
- if ([skipConfirm isEqualToString:@"YES"] ||
- [skipConfirm isEqualToString:@"TRUE"] ||
- [skipConfirm isEqualToString:@"1"])
- skipConfirm = @"YES";
- else
- skipConfirm = @"NO";
- } else {
- skipConfirm = @"NO";
- }
-
- send_and_exit_ = true;
- if (sendAndExit) {
- sendAndExit = [sendAndExit uppercaseString];
-
- if ([sendAndExit isEqualToString:@"NO"] ||
- [sendAndExit isEqualToString:@"FALSE"] ||
- [sendAndExit isEqualToString:@"0"])
- send_and_exit_ = false;
- }
-
- if (requestUserText) {
- requestUserText = [requestUserText uppercaseString];
-
- if ([requestUserText isEqualToString:@"YES"] ||
- [requestUserText isEqualToString:@"TRUE"] ||
- [requestUserText isEqualToString:@"1"])
- requestUserText = @"YES";
- else
- requestUserText = @"NO";
- } else {
- requestUserText = @"NO";
- }
-
- // Find the helper applications if not specified in user config.
- NSString *resourcePath = nil;
- if (!inspectorPathString || !reporterPathString) {
- resourcePath = GetResourcePath();
- if (!resourcePath) {
- return false;
- }
- }
-
- // Find Inspector.
- if (!inspectorPathString) {
- inspectorPathString =
- [resourcePath stringByAppendingPathComponent:@"Inspector"];
- }
-
- // Verify that there is an Inspector tool.
- if (![[NSFileManager defaultManager] fileExistsAtPath:inspectorPathString]) {
- return false;
- }
-
- // Find Reporter.
- if (!reporterPathString) {
- reporterPathString =
- [resourcePath
- stringByAppendingPathComponent:@"crash_report_sender.app"];
- reporterPathString =
- [[NSBundle bundleWithPath:reporterPathString] executablePath];
- }
-
- // Verify that there is a Reporter application.
- if (![[NSFileManager defaultManager]
- fileExistsAtPath:reporterPathString]) {
- return false;
- }
-
- if (!dumpSubdirectory) {
- dumpSubdirectory = @"";
- }
-
- // The product, version, and URL are required values.
- if (![product length]) {
- return false;
- }
-
- if (![version length]) {
- return false;
- }
-
- if (![urlStr length]) {
- return false;
- }
-
- config_params_ =
- new (gKeyValueAllocator->Allocate(sizeof(SimpleStringDictionary)) )
- SimpleStringDictionary();
-
- SimpleStringDictionary &dictionary = *config_params_;
-
- dictionary.SetKeyValue(BREAKPAD_SERVER_TYPE, [serverType UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_PRODUCT_DISPLAY, [display UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_PRODUCT, [product UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_VERSION, [version UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_URL, [urlStr UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_REPORT_INTERVAL, [interval UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_SKIP_CONFIRM, [skipConfirm UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_CONFIRM_TIMEOUT, [timeout UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_INSPECTOR_LOCATION,
- [inspectorPathString fileSystemRepresentation]);
- dictionary.SetKeyValue(BREAKPAD_REPORTER_EXE_LOCATION,
- [reporterPathString fileSystemRepresentation]);
- dictionary.SetKeyValue(BREAKPAD_LOGFILE_UPLOAD_SIZE,
- [logFileTailSize UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_REQUEST_COMMENTS,
- [requestUserText UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_REQUEST_EMAIL, [requestEmail UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_VENDOR, [vendor UTF8String]);
- dictionary.SetKeyValue(BREAKPAD_DUMP_DIRECTORY,
- [dumpSubdirectory UTF8String]);
-
- struct timeval tv;
- gettimeofday(&tv, NULL);
- char timeStartedString[32];
- sprintf(timeStartedString, "%zd", tv.tv_sec);
- dictionary.SetKeyValue(BREAKPAD_PROCESS_START_TIME,
- timeStartedString);
-
- if (logFilePaths) {
- char logFileKey[255];
- for(unsigned int i = 0; i < [logFilePaths count]; i++) {
- sprintf(logFileKey,"%s%d", BREAKPAD_LOGFILE_KEY_PREFIX, i);
- dictionary.SetKeyValue(logFileKey,
- [[logFilePaths objectAtIndex:i]
- fileSystemRepresentation]);
- }
- }
-
- if (serverParameters) {
- // For each key-value pair, call BreakpadAddUploadParameter()
- NSEnumerator *keyEnumerator = [serverParameters keyEnumerator];
- NSString *aParameter;
- while ((aParameter = [keyEnumerator nextObject])) {
- BreakpadAddUploadParameter(this, aParameter,
- [serverParameters objectForKey:aParameter]);
- }
- }
- return true;
-}
-
-//=============================================================================
-void Breakpad::SetKeyValue(NSString *key, NSString *value) {
- // We allow nil values. This is the same as removing the keyvalue.
- if (!config_params_ || !key)
- return;
-
- config_params_->SetKeyValue([key UTF8String], [value UTF8String]);
-}
-
-//=============================================================================
-NSString *Breakpad::KeyValue(NSString *key) {
- if (!config_params_ || !key)
- return nil;
-
- const char *value = config_params_->GetValueForKey([key UTF8String]);
- return value ? [NSString stringWithUTF8String:value] : nil;
-}
-
-//=============================================================================
-void Breakpad::RemoveKeyValue(NSString *key) {
- if (!config_params_ || !key) return;
-
- config_params_->RemoveKey([key UTF8String]);
-}
-
-//=============================================================================
-void Breakpad::GenerateAndSendReport() {
- config_params_->SetKeyValue(BREAKPAD_ON_DEMAND, "YES");
- HandleException(0, 0, 0, mach_thread_self());
- config_params_->SetKeyValue(BREAKPAD_ON_DEMAND, "NO");
-}
-
-//=============================================================================
-bool Breakpad::HandleException(int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread) {
- if (filter_callback_) {
- bool should_handle = filter_callback_(exception_type,
- exception_code,
- crashing_thread,
- filter_callback_context_);
- if (!should_handle) return false;
- }
-
- // We need to reset the memory protections to be read/write,
- // since LaunchOnDemand() requires changing state.
- gBreakpadAllocator->Unprotect();
- // Configure the server to launch when we message the service port.
- // The reason we do this here, rather than at startup, is that we
- // can leak a bootstrap service entry if this method is called and
- // there never ends up being a crash.
- inspector_.LaunchOnDemand();
- gBreakpadAllocator->Protect();
-
- // The Inspector should send a message to this port to verify it
- // received our information and has finished the inspection.
- ReceivePort acknowledge_port;
-
- // Send initial information to the Inspector.
- MachSendMessage message(kMsgType_InspectorInitialInfo);
- message.AddDescriptor(mach_task_self()); // our task
- message.AddDescriptor(crashing_thread); // crashing thread
- message.AddDescriptor(mach_thread_self()); // exception-handling thread
- message.AddDescriptor(acknowledge_port.GetPort());// message receive port
-
- InspectorInfo info;
- info.exception_type = exception_type;
- info.exception_code = exception_code;
- info.exception_subcode = exception_subcode;
- info.parameter_count = config_params_->GetCount();
- message.SetData(&info, sizeof(info));
-
- MachPortSender sender(inspector_.GetServicePort());
-
- kern_return_t result = sender.SendMessage(message, 2000);
-
- if (result == KERN_SUCCESS) {
- // Now, send a series of key-value pairs to the Inspector.
- const SimpleStringDictionary::Entry *entry = NULL;
- SimpleStringDictionary::Iterator iter(*config_params_);
-
- while ( (entry = iter.Next()) ) {
- KeyValueMessageData keyvalue_data(*entry);
-
- MachSendMessage keyvalue_message(kMsgType_InspectorKeyValuePair);
- keyvalue_message.SetData(&keyvalue_data, sizeof(keyvalue_data));
-
- result = sender.SendMessage(keyvalue_message, 2000);
-
- if (result != KERN_SUCCESS) {
- break;
- }
- }
-
- if (result == KERN_SUCCESS) {
- // Wait for acknowledgement that the inspection has finished.
- MachReceiveMessage acknowledge_messsage;
- result = acknowledge_port.WaitForMessage(&acknowledge_messsage, 5000);
- }
- }
-
-#if VERBOSE
- PRINT_MACH_RESULT(result, "Breakpad: SendMessage ");
- printf("Breakpad: Inspector service port = %#x\n",
- inspector_.GetServicePort());
-#endif
-
- // If we don't want any forwarding, return true here to indicate that we've
- // processed things as much as we want.
- if (send_and_exit_) return true;
-
- return false;
-}
-
-//=============================================================================
-bool Breakpad::HandleMinidump(const char *dump_dir, const char *minidump_id) {
- google_breakpad::ConfigFile config_file;
- config_file.WriteFile(dump_dir, config_params_, dump_dir, minidump_id);
- google_breakpad::LaunchReporter(
- config_params_->GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION),
- config_file.GetFilePath());
- return true;
-}
-
-//=============================================================================
-//=============================================================================
-
-#pragma mark -
-#pragma mark Public API
-
-//=============================================================================
-BreakpadRef BreakpadCreate(NSDictionary *parameters) {
- try {
- // This is confusing. Our two main allocators for breakpad memory are:
- // - gKeyValueAllocator for the key/value memory
- // - gBreakpadAllocator for the Breakpad, ExceptionHandler, and other
- // breakpad allocations which are accessed at exception handling time.
- //
- // But in order to avoid these two allocators themselves from being smashed,
- // we'll protect them as well by allocating them with gMasterAllocator.
- //
- // gMasterAllocator itself will NOT be protected, but this doesn't matter,
- // since once it does its allocations and locks the memory, smashes to itself
- // don't affect anything we care about.
- gMasterAllocator =
- new ProtectedMemoryAllocator(sizeof(ProtectedMemoryAllocator) * 2);
-
- gKeyValueAllocator =
- new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
- ProtectedMemoryAllocator(sizeof(SimpleStringDictionary));
-
- // Create a mutex for use in accessing the SimpleStringDictionary
- int mutexResult = pthread_mutex_init(&gDictionaryMutex, NULL);
- if (mutexResult == 0) {
-
- // With the current compiler, gBreakpadAllocator is allocating 1444 bytes.
- // Let's round up to the nearest page size.
- //
- int breakpad_pool_size = 4096;
-
- /*
- sizeof(Breakpad)
- + sizeof(google_breakpad::ExceptionHandler)
- + sizeof( STUFF ALLOCATED INSIDE ExceptionHandler )
- */
-
- gBreakpadAllocator =
- new (gMasterAllocator->Allocate(sizeof(ProtectedMemoryAllocator)))
- ProtectedMemoryAllocator(breakpad_pool_size);
-
- // Stack-based autorelease pool for Breakpad::Create() obj-c code.
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Breakpad *breakpad = Breakpad::Create(parameters);
-
- if (breakpad) {
- // Make read-only to protect against memory smashers
- gMasterAllocator->Protect();
- gKeyValueAllocator->Protect();
- gBreakpadAllocator->Protect();
- // Can uncomment this line to figure out how much space was actually
- // allocated using this allocator
- // printf("gBreakpadAllocator allocated size = %d\n",
- // gBreakpadAllocator->GetAllocatedSize() );
- [pool release];
- return (BreakpadRef)breakpad;
- }
-
- [pool release];
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadCreate() : error\n");
- }
-
- if (gKeyValueAllocator) {
- gKeyValueAllocator->~ProtectedMemoryAllocator();
- gKeyValueAllocator = NULL;
- }
-
- if (gBreakpadAllocator) {
- gBreakpadAllocator->~ProtectedMemoryAllocator();
- gBreakpadAllocator = NULL;
- }
-
- delete gMasterAllocator;
- gMasterAllocator = NULL;
-
- return NULL;
-}
-
-//=============================================================================
-void BreakpadRelease(BreakpadRef ref) {
- try {
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (gMasterAllocator) {
- gMasterAllocator->Unprotect();
- gKeyValueAllocator->Unprotect();
- gBreakpadAllocator->Unprotect();
-
- breakpad->~Breakpad();
-
- // Unfortunately, it's not possible to deallocate this stuff
- // because the exception handling thread is still finishing up
- // asynchronously at this point... OK, it could be done with
- // locks, etc. But since BreakpadRelease() should usually only
- // be called right before the process exits, it's not worth
- // deallocating this stuff.
-#if 0
- gKeyValueAllocator->~ProtectedMemoryAllocator();
- gBreakpadAllocator->~ProtectedMemoryAllocator();
- delete gMasterAllocator;
-
- gMasterAllocator = NULL;
- gKeyValueAllocator = NULL;
- gBreakpadAllocator = NULL;
-#endif
-
- pthread_mutex_destroy(&gDictionaryMutex);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadRelease() : error\n");
- }
-}
-
-//=============================================================================
-void BreakpadSetKeyValue(BreakpadRef ref, NSString *key, NSString *value) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- breakpad->SetKeyValue(key, value);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadSetKeyValue() : error\n");
- }
-}
-
-void BreakpadAddUploadParameter(BreakpadRef ref,
- NSString *key,
- NSString *value) {
- // The only difference, internally, between an upload parameter and
- // a key value one that is set with BreakpadSetKeyValue is that we
- // prepend the keyname with a special prefix. This informs the
- // crash sender that the parameter should be sent along with the
- // POST of the crash dump upload.
- try {
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- NSString *prefixedKey = [@BREAKPAD_SERVER_PARAMETER_PREFIX
- stringByAppendingString:key];
- breakpad->SetKeyValue(prefixedKey, value);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadSetKeyValue() : error\n");
- }
-}
-
-void BreakpadRemoveUploadParameter(BreakpadRef ref,
- NSString *key) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- NSString *prefixedKey = [NSString stringWithFormat:@"%@%@",
- @BREAKPAD_SERVER_PARAMETER_PREFIX, key];
- breakpad->RemoveKeyValue(prefixedKey);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadRemoveKeyValue() : error\n");
- }
-}
-//=============================================================================
-NSString *BreakpadKeyValue(BreakpadRef ref, NSString *key) {
- NSString *value = nil;
-
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (!breakpad || !key || !gKeyValueAllocator)
- return nil;
-
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- value = breakpad->KeyValue(key);
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadKeyValue() : error\n");
- }
-
- return value;
-}
-
-//=============================================================================
-void BreakpadRemoveKeyValue(BreakpadRef ref, NSString *key) {
- try {
- // Not called at exception time
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && key && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- breakpad->RemoveKeyValue(key);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadRemoveKeyValue() : error\n");
- }
-}
-
-//=============================================================================
-void BreakpadGenerateAndSendReport(BreakpadRef ref) {
- try {
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && gKeyValueAllocator) {
- ProtectedMemoryLocker locker(&gDictionaryMutex, gKeyValueAllocator);
-
- gBreakpadAllocator->Unprotect();
- breakpad->GenerateAndSendReport();
- gBreakpadAllocator->Protect();
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadGenerateAndSendReport() : error\n");
- }
-}
-
-//=============================================================================
-void BreakpadSetFilterCallback(BreakpadRef ref,
- BreakpadFilterCallback callback,
- void *context) {
-
- try {
- Breakpad *breakpad = (Breakpad *)ref;
-
- if (breakpad && gBreakpadAllocator) {
- // share the dictionary mutex here (we really don't need a mutex)
- ProtectedMemoryLocker locker(&gDictionaryMutex, gBreakpadAllocator);
-
- breakpad->SetFilterCallback(callback, context);
- }
- } catch(...) { // don't let exceptions leave this C API
- fprintf(stderr, "BreakpadSetFilterCallback() : error\n");
- }
-}
-
-//============================================================================
-void BreakpadAddLogFile(BreakpadRef ref, NSString *logPathname) {
- int logFileCounter = 0;
-
- NSString *logFileKey = [NSString stringWithFormat:@"%@%d",
- @BREAKPAD_LOGFILE_KEY_PREFIX,
- logFileCounter];
-
- NSString *existingLogFilename = nil;
- existingLogFilename = BreakpadKeyValue(ref, logFileKey);
- // Find the first log file key that we can use by testing for existence
- while (existingLogFilename) {
- if ([existingLogFilename isEqualToString:logPathname]) {
- return;
- }
- logFileCounter++;
- logFileKey = [NSString stringWithFormat:@"%@%d",
- @BREAKPAD_LOGFILE_KEY_PREFIX,
- logFileCounter];
- existingLogFilename = BreakpadKeyValue(ref, logFileKey);
- }
-
- BreakpadSetKeyValue(ref, logFileKey, logPathname);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad_Prefix.pch b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad_Prefix.pch
deleted file mode 100644
index 729866635b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Breakpad_Prefix.pch
+++ /dev/null
@@ -1,8 +0,0 @@
-//
-// Prefix header for all source files of the 'Breakpad' target in the
-// 'Breakpad' project.
-//
-
-#ifdef __OBJC__
- #import <Cocoa/Cocoa.h>
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Info.plist
deleted file mode 100644
index e43baddc0a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundleIconFile</key>
- <string></string>
- <key>CFBundleIdentifier</key>
- <string>com.googlecode.google-breakpad</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>FMWK</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>NSPrincipalClass</key>
- <string></string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.h b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.h
deleted file mode 100644
index b8aabbe47f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.h
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <mach/mach.h>
-#include <servers/bootstrap.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-//==============================================================================
-// class OnDemandServer :
-// A basic on-demand server launcher supporting a single named service port
-//
-// Example Usage :
-//
-// kern_return_t result;
-// OnDemandServer *server = OnDemandServer::Create("/tmp/myserver",
-// "com.MyCompany.MyServiceName",
-// true,
-// &result);
-//
-// if (server) {
-// server->LaunchOnDemand();
-// mach_port_t service_port = GetServicePort();
-//
-// // Send a mach message to service_port and "myserver" will be launched
-// }
-//
-//
-// ---- Now in the server code ----
-//
-// // "myserver" should get the service port and read the message which
-// // launched it:
-// mach_port_t service_rcv_port_;
-// kern_return_t kr = bootstrap_check_in(bootstrap_port,
-// "com.MyCompany.MyServiceName",
-// &service_rcv_port_);
-// // mach_msg() read service_rcv_port_ ....
-//
-// ....
-//
-// // Later "myserver" may want to unregister the service if it doesn't
-// // want its bootstrap service to stick around after it exits.
-//
-// // DO NOT use mach_port_deallocate() here -- it will fail and the
-// // following bootstrap_register() will also fail leaving our service
-// // name hanging around forever (until reboot)
-// kern_return_t kr = mach_port_destroy(mach_task_self(), service_rcv_port_);
-//
-// kr = bootstrap_register(bootstrap_port,
-// "com.MyCompany.MyServiceName",
-// MACH_PORT_NULL);
-
-class OnDemandServer {
- public:
- // must call Initialize() to be useful
- OnDemandServer()
- : server_port_(MACH_PORT_NULL),
- service_port_(MACH_PORT_NULL),
- unregister_on_cleanup_(true) {
- }
-
- // Creates the bootstrap server and service
- kern_return_t Initialize(const char *server_command,
- const char *service_name,
- bool unregister_on_cleanup);
-
- // Returns an OnDemandServer object if successful, or NULL if there's
- // an error. The error result will be returned in out_result.
- //
- // server_command : the full path name including optional command-line
- // arguments to the executable representing the server
- //
- // service_name : represents service name
- // something like "com.company.ServiceName"
- //
- // unregister_on_cleanup : if true, unregisters the service name
- // when the OnDemandServer is deleted -- unregistering will
- // ONLY be possible if LaunchOnDemand() has NOT been called.
- // If false, then the service will continue to be registered
- // even after the current process quits.
- //
- // out_result : if non-NULL, returns the result
- // this value will be KERN_SUCCESS if Create() returns non-NULL
- //
- static OnDemandServer *Create(const char *server_command,
- const char *service_name,
- bool unregister_on_cleanup,
- kern_return_t *out_result);
-
- // Cleans up and if LaunchOnDemand() has not yet been called then
- // the bootstrap service will be unregistered.
- ~OnDemandServer();
-
- // This must be called if we intend to commit to launching the server
- // by sending a mach message to our service port. Do not call it otherwise
- // or it will be difficult (impossible?) to unregister the service name.
- void LaunchOnDemand();
-
- // This is the port we need to send a mach message to after calling
- // LaunchOnDemand(). Sending a message causing an immediate launch
- // of the server
- mach_port_t GetServicePort() { return service_port_; };
-
- private:
- // Disallow copy constructor
- OnDemandServer(const OnDemandServer&);
-
- // Cleans up and if LaunchOnDemand() has not yet been called then
- // the bootstrap service will be unregistered.
- void Unregister();
-
- name_t service_name_;
-
- mach_port_t server_port_;
- mach_port_t service_port_;
- bool unregister_on_cleanup_;
-};
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm
deleted file mode 100644
index dbe601bb89..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/Framework/OnDemandServer.mm
+++ /dev/null
@@ -1,189 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import "OnDemandServer.h"
-
-#import "Breakpad.h"
-#include "common/mac/bootstrap_compat.h"
-
-#if DEBUG
- #define PRINT_MACH_RESULT(result_, message_) \
- printf(message_"%s (%d)\n", mach_error_string(result_), result_ );
-#if defined(MAC_OS_X_VERSION_10_5) && \
- MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- #define PRINT_BOOTSTRAP_RESULT(result_, message_) \
- printf(message_"%s (%d)\n", bootstrap_strerror(result_), result_ );
-#else
- #define PRINT_BOOTSTRAP_RESULT(result_, message_) \
- PRINT_MACH_RESULT(result_, message_)
-#endif
-#else
- #define PRINT_MACH_RESULT(result_, message_)
- #define PRINT_BOOTSTRAP_RESULT(result_, message_)
-#endif
-
-//==============================================================================
-OnDemandServer *OnDemandServer::Create(const char *server_command,
- const char *service_name,
- bool unregister_on_cleanup,
- kern_return_t *out_result) {
- OnDemandServer *server = new OnDemandServer();
-
- if (!server) return NULL;
-
- kern_return_t result = server->Initialize(server_command,
- service_name,
- unregister_on_cleanup);
-
- if (out_result) {
- *out_result = result;
- }
-
- if (result == KERN_SUCCESS) {
- return server;
- }
-
- delete server;
- return NULL;
-};
-
-//==============================================================================
-kern_return_t OnDemandServer::Initialize(const char *server_command,
- const char *service_name,
- bool unregister_on_cleanup) {
- unregister_on_cleanup_ = unregister_on_cleanup;
-
- mach_port_t self_task = mach_task_self();
-
- mach_port_t bootstrap_port;
- kern_return_t kr = task_get_bootstrap_port(self_task, &bootstrap_port);
- if (kr != KERN_SUCCESS) {
- PRINT_MACH_RESULT(kr, "task_get_bootstrap_port(): ");
- return kr;
- }
-
- mach_port_t bootstrap_subset_port;
- kr = bootstrap_subset(bootstrap_port, self_task, &bootstrap_subset_port);
- if (kr != BOOTSTRAP_SUCCESS) {
- PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_subset(): ");
- return kr;
- }
-
- // The inspector will be invoked with its bootstrap port set to the subset,
- // but the sender will need access to the original bootstrap port. Although
- // the original port is the subset's parent, bootstrap_parent can't be used
- // because it requires extra privileges. Stash the original bootstrap port
- // in the subset by registering it under a known name. The inspector will
- // recover this port and set it as its own bootstrap port in Inspector.mm
- // Inspector::ResetBootstrapPort.
- kr = breakpad::BootstrapRegister(
- bootstrap_subset_port,
- const_cast<char*>(BREAKPAD_BOOTSTRAP_PARENT_PORT),
- bootstrap_port);
- if (kr != BOOTSTRAP_SUCCESS) {
- PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_register(): ");
- return kr;
- }
-
- kr = bootstrap_create_server(bootstrap_subset_port,
- const_cast<char*>(server_command),
- geteuid(), // server uid
- true,
- &server_port_);
- if (kr != BOOTSTRAP_SUCCESS) {
- PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_create_server(): ");
- return kr;
- }
-
- strlcpy(service_name_, service_name, sizeof(service_name_));
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
- // Create a service called service_name, and return send rights to
- // that port in service_port_.
- kr = bootstrap_create_service(server_port_,
- const_cast<char*>(service_name),
- &service_port_);
-#pragma clang diagnostic pop
- if (kr != BOOTSTRAP_SUCCESS) {
- PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_create_service(): ");
-
- // perhaps the service has already been created - try to look it up
- kr = bootstrap_look_up(bootstrap_port, (char*)service_name, &service_port_);
-
- if (kr != BOOTSTRAP_SUCCESS) {
- PRINT_BOOTSTRAP_RESULT(kr, "bootstrap_look_up(): ");
- Unregister(); // clean up server port
- return kr;
- }
- }
-
- return KERN_SUCCESS;
-}
-
-//==============================================================================
-OnDemandServer::~OnDemandServer() {
- if (unregister_on_cleanup_) {
- Unregister();
- }
-}
-
-//==============================================================================
-void OnDemandServer::LaunchOnDemand() {
- // We need to do this, since the launched server is another process
- // and holding on to this port delays launching until the current process
- // exits!
- mach_port_deallocate(mach_task_self(), server_port_);
- server_port_ = MACH_PORT_DEAD;
-
- // Now, the service is still registered and all we need to do is send
- // a mach message to the service port in order to launch the server.
-}
-
-//==============================================================================
-void OnDemandServer::Unregister() {
- if (service_port_ != MACH_PORT_NULL) {
- mach_port_deallocate(mach_task_self(), service_port_);
- service_port_ = MACH_PORT_NULL;
- }
-
- if (server_port_ != MACH_PORT_NULL) {
- // unregister the service
- kern_return_t kr = breakpad::BootstrapRegister(server_port_,
- service_name_,
- MACH_PORT_NULL);
-
- if (kr != KERN_SUCCESS) {
- PRINT_MACH_RESULT(kr, "Breakpad UNREGISTER : bootstrap_register() : ");
- }
-
- mach_port_deallocate(mach_task_self(), server_port_);
- server_port_ = MACH_PORT_NULL;
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/UnitTests-Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/UnitTests-Info.plist
deleted file mode 100644
index 65013556de..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/UnitTests-Info.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.h
deleted file mode 100644
index 5662e8b09c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Utility class that can persist a SimpleStringDictionary to disk.
-
-#import <Foundation/Foundation.h>
-
-#include "common/simple_string_dictionary.h"
-
-namespace google_breakpad {
-
-BOOL EnsureDirectoryPathExists(NSString *dirPath);
-
-//=============================================================================
-class ConfigFile {
- public:
- ConfigFile() {
- config_file_ = -1;
- config_file_path_[0] = 0;
- has_created_file_ = false;
- };
-
- ~ConfigFile() {
- };
-
- void WriteFile(const char* directory,
- const SimpleStringDictionary *configurationParameters,
- const char *dump_dir,
- const char *minidump_id);
-
- const char *GetFilePath() { return config_file_path_; }
-
- void Unlink() {
- if (config_file_ != -1)
- unlink(config_file_path_);
-
- config_file_ = -1;
- }
-
- private:
- BOOL WriteData(const void *data, size_t length);
-
- BOOL AppendConfigData(const char *key,
- const void *data,
- size_t length);
-
- BOOL AppendConfigString(const char *key,
- const char *value);
-
- BOOL AppendCrashTimeParameters(const char *processStartTimeString);
-
- int config_file_; // descriptor for config file
- char config_file_path_[PATH_MAX]; // Path to configuration file
- bool has_created_file_;
-};
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.mm
deleted file mode 100644
index acab7de84c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/ConfigFile.mm
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Utility class that can persist a SimpleStringDictionary to disk.
-
-#import "client/mac/crash_generation/ConfigFile.h"
-
-#import <Foundation/Foundation.h>
-#include <stdio.h>
-#include <sys/time.h>
-
-#import "client/apple/Framework/BreakpadDefines.h"
-#import "common/mac/GTMDefines.h"
-
-
-namespace google_breakpad {
-
-//=============================================================================
-BOOL EnsureDirectoryPathExists(NSString *dirPath) {
- NSFileManager *mgr = [NSFileManager defaultManager];
-
- NSDictionary *attrs =
- [NSDictionary dictionaryWithObject:[NSNumber numberWithUnsignedLong:0750]
- forKey:NSFilePosixPermissions];
-
- return [mgr createDirectoryAtPath:dirPath
- withIntermediateDirectories:YES
- attributes:attrs
- error:nil];
-}
-
-//=============================================================================
-BOOL ConfigFile::WriteData(const void *data, size_t length) {
- size_t result = write(config_file_, data, length);
-
- return result == length;
-}
-
-//=============================================================================
-BOOL ConfigFile::AppendConfigData(const char *key,
- const void *data, size_t length) {
- assert(config_file_ != -1);
-
- if (!key) {
- return NO;
- }
-
- if (!data) {
- return NO;
- }
-
- // Write the key, \n, length of data (ascii integer), \n, data
- char buffer[16];
- char nl = '\n';
- BOOL result = WriteData(key, strlen(key));
-
- snprintf(buffer, sizeof(buffer) - 1, "\n%lu\n", length);
- result &= WriteData(buffer, strlen(buffer));
- result &= WriteData(data, length);
- result &= WriteData(&nl, 1);
- return result;
-}
-
-//=============================================================================
-BOOL ConfigFile::AppendConfigString(const char *key,
- const char *value) {
- return AppendConfigData(key, value, strlen(value));
-}
-
-//=============================================================================
-BOOL ConfigFile::AppendCrashTimeParameters(const char *processStartTimeString) {
- // Set process uptime parameter
- struct timeval tv;
- gettimeofday(&tv, NULL);
-
- char processUptimeString[32], processCrashtimeString[32];
- // Set up time if we've received the start time.
- if (processStartTimeString) {
- time_t processStartTime = strtol(processStartTimeString, NULL, 10);
- time_t processUptime = tv.tv_sec - processStartTime;
- // Store the uptime in milliseconds.
- sprintf(processUptimeString, "%llu",
- static_cast<unsigned long long int>(processUptime) * 1000);
- if (!AppendConfigString(BREAKPAD_PROCESS_UP_TIME, processUptimeString))
- return false;
- }
-
- sprintf(processCrashtimeString, "%zd", tv.tv_sec);
- return AppendConfigString(BREAKPAD_PROCESS_CRASH_TIME,
- processCrashtimeString);
-}
-
-//=============================================================================
-void ConfigFile::WriteFile(const char* directory,
- const SimpleStringDictionary *configurationParameters,
- const char *dump_dir,
- const char *minidump_id) {
-
- assert(config_file_ == -1);
-
- // Open and write out configuration file preamble
- if (directory) {
- snprintf(config_file_path_, sizeof(config_file_path_), "%s/Config-XXXXXX",
- directory);
- } else {
- strlcpy(config_file_path_, "/tmp/Config-XXXXXX",
- sizeof(config_file_path_));
- }
- config_file_ = mkstemp(config_file_path_);
-
- if (config_file_ == -1) {
- return;
- }
-
- has_created_file_ = true;
-
- // Add the minidump dir
- AppendConfigString(kReporterMinidumpDirectoryKey, dump_dir);
- AppendConfigString(kReporterMinidumpIDKey, minidump_id);
-
- // Write out the configuration parameters
- BOOL result = YES;
- const SimpleStringDictionary &dictionary = *configurationParameters;
-
- const SimpleStringDictionary::Entry *entry = NULL;
- SimpleStringDictionary::Iterator iter(dictionary);
-
- while ((entry = iter.Next())) {
- result = AppendConfigString(entry->key, entry->value);
-
- if (!result)
- break;
- }
- AppendCrashTimeParameters(
- configurationParameters->GetValueForKey(BREAKPAD_PROCESS_START_TIME));
-
- close(config_file_);
- config_file_ = -1;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.h
deleted file mode 100644
index 6712355134..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.h
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Interface file between the Breakpad.framework and
-// the Inspector process.
-
-#include "common/simple_string_dictionary.h"
-
-#import <Foundation/Foundation.h>
-#include <mach/mach.h>
-
-#import "client/mac/crash_generation/ConfigFile.h"
-#import "client/mac/handler/minidump_generator.h"
-
-
-// Types of mach messsages (message IDs)
-enum {
- kMsgType_InspectorInitialInfo = 0, // data is InspectorInfo
- kMsgType_InspectorKeyValuePair = 1, // data is KeyValueMessageData
- kMsgType_InspectorAcknowledgement = 2 // no data sent
-};
-
-// Initial information sent from the crashed process by
-// Breakpad.framework to the Inspector process
-// The mach message with this struct as data will also include
-// several descriptors for sending mach port rights to the crashed
-// task, etc.
-struct InspectorInfo {
- int exception_type;
- int exception_code;
- int exception_subcode;
- unsigned int parameter_count; // key-value pairs
-};
-
-// Key/value message data to be sent to the Inspector
-struct KeyValueMessageData {
- public:
- KeyValueMessageData() {}
- explicit KeyValueMessageData(
- const google_breakpad::SimpleStringDictionary::Entry &inEntry) {
- strlcpy(key, inEntry.key, sizeof(key) );
- strlcpy(value, inEntry.value, sizeof(value) );
- }
-
- char key[google_breakpad::SimpleStringDictionary::key_size];
- char value[google_breakpad::SimpleStringDictionary::value_size];
-};
-
-using std::string;
-using google_breakpad::MinidumpGenerator;
-
-namespace google_breakpad {
-
-//=============================================================================
-class MinidumpLocation {
- public:
- MinidumpLocation(NSString *minidumpDir) {
- // Ensure that the path exists. Fallback to /tmp if unable to locate path.
- assert(minidumpDir);
- if (!EnsureDirectoryPathExists(minidumpDir)) {
- minidumpDir = @"/tmp";
- }
-
- strlcpy(minidump_dir_path_, [minidumpDir fileSystemRepresentation],
- sizeof(minidump_dir_path_));
-
- // now generate a unique ID
- string dump_path(minidump_dir_path_);
- string next_minidump_id;
-
- string next_minidump_path_ =
- (MinidumpGenerator::UniqueNameInDirectory(dump_path, &next_minidump_id));
-
- strlcpy(minidump_id_, next_minidump_id.c_str(), sizeof(minidump_id_));
- };
-
- const char *GetPath() { return minidump_dir_path_; }
- const char *GetID() { return minidump_id_; }
-
- private:
- char minidump_dir_path_[PATH_MAX]; // Path to minidump directory
- char minidump_id_[128];
-};
-
-//=============================================================================
-class Inspector {
- public:
- Inspector() {};
-
- // given a bootstrap service name, receives mach messages
- // from a crashed process, then inspects it, creates a minidump file
- // and asks the user if he wants to upload it to a server.
- void Inspect(const char *receive_port_name);
-
- private:
- // The Inspector is invoked with its bootstrap port set to the bootstrap
- // subset established in OnDemandServer.mm OnDemandServer::Initialize.
- // For proper communication with the system, the sender (which will inherit
- // the Inspector's bootstrap port) needs the per-session bootstrap namespace
- // available directly in its bootstrap port. OnDemandServer stashed this
- // port into the subset namespace under a special name. ResetBootstrapPort
- // recovers this port and switches this task to use it as its own bootstrap
- // (ensuring that children like the sender will inherit it), and saves the
- // subset in bootstrap_subset_port_ for use by ServiceCheckIn and
- // ServiceCheckOut.
- kern_return_t ResetBootstrapPort();
-
- kern_return_t ServiceCheckIn(const char *receive_port_name);
- kern_return_t ServiceCheckOut(const char *receive_port_name);
-
- kern_return_t ReadMessages();
-
- bool InspectTask();
- kern_return_t SendAcknowledgement();
-
- // The bootstrap port in which the inspector is registered and into which it
- // must check in.
- mach_port_t bootstrap_subset_port_;
-
- mach_port_t service_rcv_port_;
-
- int exception_type_;
- int exception_code_;
- int exception_subcode_;
- mach_port_t remote_task_;
- mach_port_t crashing_thread_;
- mach_port_t handler_thread_;
- mach_port_t ack_port_;
-
- SimpleStringDictionary config_params_;
-
- ConfigFile config_file_;
-};
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm
deleted file mode 100644
index dc6f48086d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Inspector.mm
+++ /dev/null
@@ -1,362 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Utility that can inspect another process and write a crash dump
-
-#include <cstdio>
-#include <iostream>
-#include <servers/bootstrap.h>
-#include <stdio.h>
-#include <string.h>
-#include <string>
-
-#import "client/mac/crash_generation/Inspector.h"
-
-#import "client/mac/Framework/Breakpad.h"
-#import "client/mac/handler/minidump_generator.h"
-
-#import "common/mac/MachIPC.h"
-#include "common/mac/bootstrap_compat.h"
-#include "common/mac/launch_reporter.h"
-
-#import "GTMDefines.h"
-
-#import <Foundation/Foundation.h>
-
-namespace google_breakpad {
-
-//=============================================================================
-void Inspector::Inspect(const char *receive_port_name) {
- kern_return_t result = ResetBootstrapPort();
- if (result != KERN_SUCCESS) {
- return;
- }
-
- result = ServiceCheckIn(receive_port_name);
-
- if (result == KERN_SUCCESS) {
- result = ReadMessages();
-
- if (result == KERN_SUCCESS) {
- // Inspect the task and write a minidump file.
- bool wrote_minidump = InspectTask();
-
- // Send acknowledgement to the crashed process that the inspection
- // has finished. It will then be able to cleanly exit.
- // The return value is ignored because failure isn't fatal. If the process
- // didn't get the message there's nothing we can do, and we still want to
- // send the report.
- SendAcknowledgement();
-
- if (wrote_minidump) {
- // Ask the user if he wants to upload the crash report to a server,
- // and do so if he agrees.
- LaunchReporter(
- config_params_.GetValueForKey(BREAKPAD_REPORTER_EXE_LOCATION),
- config_file_.GetFilePath());
- } else {
- fprintf(stderr, "Inspection of crashed process failed\n");
- }
-
- // Now that we're done reading messages, cleanup the service, but only
- // if there was an actual exception
- // Otherwise, it means the dump was generated on demand and the process
- // lives on, and we might be needed again in the future.
- if (exception_code_) {
- ServiceCheckOut(receive_port_name);
- }
- } else {
- PRINT_MACH_RESULT(result, "Inspector: WaitForMessage()");
- }
- }
-}
-
-//=============================================================================
-kern_return_t Inspector::ResetBootstrapPort() {
- // A reasonable default, in case anything fails.
- bootstrap_subset_port_ = bootstrap_port;
-
- mach_port_t self_task = mach_task_self();
-
- kern_return_t kr = task_get_bootstrap_port(self_task,
- &bootstrap_subset_port_);
- if (kr != KERN_SUCCESS) {
- NSLog(@"ResetBootstrapPort: task_get_bootstrap_port failed: %s (%d)",
- mach_error_string(kr), kr);
- return kr;
- }
-
- mach_port_t bootstrap_parent_port;
- kr = bootstrap_look_up(bootstrap_subset_port_,
- const_cast<char*>(BREAKPAD_BOOTSTRAP_PARENT_PORT),
- &bootstrap_parent_port);
- if (kr != BOOTSTRAP_SUCCESS) {
- NSLog(@"ResetBootstrapPort: bootstrap_look_up failed: %s (%d)",
-#if defined(MAC_OS_X_VERSION_10_5) && \
- MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
- bootstrap_strerror(kr),
-#else
- mach_error_string(kr),
-#endif
- kr);
- return kr;
- }
-
- kr = task_set_bootstrap_port(self_task, bootstrap_parent_port);
- if (kr != KERN_SUCCESS) {
- NSLog(@"ResetBootstrapPort: task_set_bootstrap_port failed: %s (%d)",
- mach_error_string(kr), kr);
- return kr;
- }
-
- // Some things access the bootstrap port through this global variable
- // instead of calling task_get_bootstrap_port.
- bootstrap_port = bootstrap_parent_port;
-
- return KERN_SUCCESS;
-}
-
-//=============================================================================
-kern_return_t Inspector::ServiceCheckIn(const char *receive_port_name) {
- // We need to get the mach port representing this service, so we can
- // get information from the crashed process.
- kern_return_t kr = bootstrap_check_in(bootstrap_subset_port_,
- (char*)receive_port_name,
- &service_rcv_port_);
-
- if (kr != KERN_SUCCESS) {
-#if VERBOSE
- PRINT_MACH_RESULT(kr, "Inspector: bootstrap_check_in()");
-#endif
- }
-
- return kr;
-}
-
-//=============================================================================
-kern_return_t Inspector::ServiceCheckOut(const char *receive_port_name) {
- // We're done receiving mach messages from the crashed process,
- // so clean up a bit.
- kern_return_t kr;
-
- // DO NOT use mach_port_deallocate() here -- it will fail and the
- // following bootstrap_register() will also fail leaving our service
- // name hanging around forever (until reboot)
- kr = mach_port_destroy(mach_task_self(), service_rcv_port_);
-
- if (kr != KERN_SUCCESS) {
- PRINT_MACH_RESULT(kr,
- "Inspector: UNREGISTERING: service_rcv_port mach_port_deallocate()");
- return kr;
- }
-
- // Unregister the service associated with the receive port.
- kr = breakpad::BootstrapRegister(bootstrap_subset_port_,
- (char*)receive_port_name,
- MACH_PORT_NULL);
-
- if (kr != KERN_SUCCESS) {
- PRINT_MACH_RESULT(kr, "Inspector: UNREGISTERING: bootstrap_register()");
- }
-
- return kr;
-}
-
-//=============================================================================
-kern_return_t Inspector::ReadMessages() {
- // Wait for an initial message from the crashed process containing basic
- // information about the crash.
- ReceivePort receive_port(service_rcv_port_);
-
- MachReceiveMessage message;
- kern_return_t result = receive_port.WaitForMessage(&message, 1000);
-
- if (result == KERN_SUCCESS) {
- InspectorInfo &info = (InspectorInfo &)*message.GetData();
- exception_type_ = info.exception_type;
- exception_code_ = info.exception_code;
- exception_subcode_ = info.exception_subcode;
-
-#if VERBOSE
- printf("message ID = %d\n", message.GetMessageID());
-#endif
-
- remote_task_ = message.GetTranslatedPort(0);
- crashing_thread_ = message.GetTranslatedPort(1);
- handler_thread_ = message.GetTranslatedPort(2);
- ack_port_ = message.GetTranslatedPort(3);
-
-#if VERBOSE
- printf("exception_type = %d\n", exception_type_);
- printf("exception_code = %d\n", exception_code_);
- printf("exception_subcode = %d\n", exception_subcode_);
- printf("remote_task = %d\n", remote_task_);
- printf("crashing_thread = %d\n", crashing_thread_);
- printf("handler_thread = %d\n", handler_thread_);
- printf("ack_port_ = %d\n", ack_port_);
- printf("parameter count = %d\n", info.parameter_count);
-#endif
-
- // In certain situations where multiple crash requests come
- // through quickly, we can end up with the mach IPC messages not
- // coming through correctly. Since we don't know what parameters
- // we've missed, we can't do much besides abort the crash dump
- // situation in this case.
- unsigned int parameters_read = 0;
- // The initial message contains the number of key value pairs that
- // we are expected to read.
- // Read each key/value pair, one mach message per key/value pair.
- for (unsigned int i = 0; i < info.parameter_count; ++i) {
- MachReceiveMessage parameter_message;
- result = receive_port.WaitForMessage(&parameter_message, 1000);
-
- if(result == KERN_SUCCESS) {
- KeyValueMessageData &key_value_data =
- (KeyValueMessageData&)*parameter_message.GetData();
- // If we get a blank key, make sure we don't increment the
- // parameter count; in some cases (notably on-demand generation
- // many times in a short period of time) caused the Mach IPC
- // messages to not come through correctly.
- if (strlen(key_value_data.key) == 0) {
- continue;
- }
- parameters_read++;
-
- config_params_.SetKeyValue(key_value_data.key, key_value_data.value);
- } else {
- PRINT_MACH_RESULT(result, "Inspector: key/value message");
- break;
- }
- }
- if (parameters_read != info.parameter_count) {
- return KERN_FAILURE;
- }
- }
-
- return result;
-}
-
-//=============================================================================
-bool Inspector::InspectTask() {
- // keep the task quiet while we're looking at it
- task_suspend(remote_task_);
-
- NSString *minidumpDir;
-
- const char *minidumpDirectory =
- config_params_.GetValueForKey(BREAKPAD_DUMP_DIRECTORY);
-
- // If the client app has not specified a minidump directory,
- // use a default of Library/<kDefaultLibrarySubdirectory>/<Product Name>
- if (!minidumpDirectory || 0 == strlen(minidumpDirectory)) {
- NSArray *libraryDirectories =
- NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
- NSUserDomainMask,
- YES);
-
- NSString *applicationSupportDirectory =
- [libraryDirectories objectAtIndex:0];
- NSString *library_subdirectory = [NSString
- stringWithUTF8String:kDefaultLibrarySubdirectory];
- NSString *breakpad_product = [NSString
- stringWithUTF8String:config_params_.GetValueForKey(BREAKPAD_PRODUCT)];
-
- NSArray *path_components = [NSArray
- arrayWithObjects:applicationSupportDirectory,
- library_subdirectory,
- breakpad_product,
- nil];
-
- minidumpDir = [NSString pathWithComponents:path_components];
- } else {
- minidumpDir = [[NSString stringWithUTF8String:minidumpDirectory]
- stringByExpandingTildeInPath];
- }
-
- MinidumpLocation minidumpLocation(minidumpDir);
-
- // Obscure bug alert:
- // Don't use [NSString stringWithFormat] to build up the path here since it
- // assumes system encoding and in RTL locales will prepend an LTR override
- // character for paths beginning with '/' which fileSystemRepresentation does
- // not remove. Filed as rdar://6889706 .
- NSString *path_ns = [NSString
- stringWithUTF8String:minidumpLocation.GetPath()];
- NSString *pathid_ns = [NSString
- stringWithUTF8String:minidumpLocation.GetID()];
- NSString *minidumpPath = [path_ns stringByAppendingPathComponent:pathid_ns];
- minidumpPath = [minidumpPath
- stringByAppendingPathExtension:@"dmp"];
-
- config_file_.WriteFile( 0,
- &config_params_,
- minidumpLocation.GetPath(),
- minidumpLocation.GetID());
-
-
- MinidumpGenerator generator(remote_task_, handler_thread_);
-
- if (exception_type_ && exception_code_) {
- generator.SetExceptionInformation(exception_type_,
- exception_code_,
- exception_subcode_,
- crashing_thread_);
- }
-
-
- bool result = generator.Write([minidumpPath fileSystemRepresentation]);
-
- // let the task continue
- task_resume(remote_task_);
-
- return result;
-}
-
-//=============================================================================
-// The crashed task needs to be told that the inspection has finished.
-// It will wait on a mach port (with timeout) until we send acknowledgement.
-kern_return_t Inspector::SendAcknowledgement() {
- if (ack_port_ != MACH_PORT_DEAD) {
- MachPortSender sender(ack_port_);
- MachSendMessage ack_message(kMsgType_InspectorAcknowledgement);
-
- kern_return_t result = sender.SendMessage(ack_message, 2000);
-
-#if VERBOSE
- PRINT_MACH_RESULT(result, "Inspector: sent acknowledgement");
-#endif
-
- return result;
- }
-
- return KERN_INVALID_NAME;
-}
-
-} // namespace google_breakpad
-
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/InspectorMain.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/InspectorMain.mm
deleted file mode 100644
index 137c6a1e1b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/InspectorMain.mm
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Main driver for Inspector
-
-#import "client/mac/crash_generation/Inspector.h"
-#import <Cocoa/Cocoa.h>
-
-namespace google_breakpad {
-
-//=============================================================================
-extern "C" {
-
-int main(int argc, char *const argv[]) {
-#if DEBUG
- // Since we're launched on-demand, this is necessary to see debugging
- // output in the console window.
- freopen("/dev/console", "w", stdout);
- freopen("/dev/console", "w", stderr);
-#endif
-
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- if (argc != 2) {
- exit(0);
- }
- // Our first command-line argument contains the name of the service
- // that we're providing.
- google_breakpad::Inspector inspector;
- inspector.Inspect(argv[1]);
-
- [pool release];
-
- return 0;
-}
-
-} // extern "C"
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h
deleted file mode 100644
index a3a95dcace..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/client_info.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_
-#define CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_
-
-namespace google_breakpad {
-
-class ClientInfo {
- public:
- explicit ClientInfo(pid_t pid) : pid_(pid) {}
-
- pid_t pid() const { return pid_; }
-
- private:
- pid_t pid_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_MAC_CRASH_GENERATION_CLIENT_INFO_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc
deleted file mode 100644
index f6bf14f580..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/mac/crash_generation/crash_generation_client.h"
-
-#include "client/mac/crash_generation/crash_generation_server.h"
-#include "common/mac/MachIPC.h"
-
-namespace google_breakpad {
-
-bool CrashGenerationClient::RequestDumpForException(
- int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread) {
- // The server will send a message to this port indicating that it
- // has finished its work.
- ReceivePort acknowledge_port;
-
- MachSendMessage message(kDumpRequestMessage);
- message.AddDescriptor(mach_task_self()); // this task
- message.AddDescriptor(crashing_thread); // crashing thread
- message.AddDescriptor(MACH_PORT_NULL); // handler thread
- message.AddDescriptor(acknowledge_port.GetPort()); // message receive port
-
- ExceptionInfo info;
- info.exception_type = exception_type;
- info.exception_code = exception_code;
- info.exception_subcode = exception_subcode;
- message.SetData(&info, sizeof(info));
-
- const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000;
- kern_return_t result = sender_.SendMessage(message, kSendTimeoutMs);
- if (result != KERN_SUCCESS)
- return false;
-
- // Give the server slightly longer to reply since it has to
- // inspect this task and write the minidump.
- const mach_msg_timeout_t kReceiveTimeoutMs = 5 * 1000;
- MachReceiveMessage acknowledge_message;
- result = acknowledge_port.WaitForMessage(&acknowledge_message,
- kReceiveTimeoutMs);
- return result == KERN_SUCCESS;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h
deleted file mode 100644
index 527f577a51..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_client.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
-#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
-
-#include "common/mac/MachIPC.h"
-
-namespace google_breakpad {
-
-class CrashGenerationClient {
- public:
- explicit CrashGenerationClient(const char* mach_port_name)
- : sender_(mach_port_name) {
- }
-
- // Request the crash server to generate a dump.
- //
- // Return true if the dump was successful; false otherwise.
- bool RequestDumpForException(int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t crashing_thread);
-
- bool RequestDump() {
- return RequestDumpForException(0, 0, 0, MACH_PORT_NULL);
- }
-
- private:
- MachPortSender sender_;
-
- // Prevent copy construction and assignment.
- CrashGenerationClient(const CrashGenerationClient&);
- CrashGenerationClient& operator=(const CrashGenerationClient&);
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc
deleted file mode 100644
index 451e8d9c2a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.cc
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/mac/crash_generation/crash_generation_server.h"
-
-#include <pthread.h>
-
-#include "client/mac/crash_generation/client_info.h"
-#include "client/mac/handler/minidump_generator.h"
-#include "common/mac/scoped_task_suspend-inl.h"
-
-namespace google_breakpad {
-
-CrashGenerationServer::CrashGenerationServer(
- const char *mach_port_name,
- FilterCallback filter,
- void *filter_context,
- OnClientDumpRequestCallback dump_callback,
- void *dump_context,
- OnClientExitingCallback exit_callback,
- void *exit_context,
- bool generate_dumps,
- const std::string &dump_path)
- : filter_(filter),
- filter_context_(filter_context),
- dump_callback_(dump_callback),
- dump_context_(dump_context),
- exit_callback_(exit_callback),
- exit_context_(exit_context),
- generate_dumps_(generate_dumps),
- dump_dir_(dump_path.empty() ? "/tmp" : dump_path),
- started_(false),
- receive_port_(mach_port_name),
- mach_port_name_(mach_port_name) {
-}
-
-CrashGenerationServer::~CrashGenerationServer() {
- if (started_)
- Stop();
-}
-
-bool CrashGenerationServer::Start() {
- int thread_create_result = pthread_create(&server_thread_, NULL,
- &WaitForMessages, this);
- started_ = thread_create_result == 0;
- return started_;
-}
-
-bool CrashGenerationServer::Stop() {
- if (!started_)
- return false;
-
- // Send a quit message to the background thread, and then join it.
- MachPortSender sender(mach_port_name_.c_str());
- MachSendMessage quit_message(kQuitMessage);
- const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000;
- kern_return_t result = sender.SendMessage(quit_message, kSendTimeoutMs);
- if (result == KERN_SUCCESS) {
- int thread_join_result = pthread_join(server_thread_, NULL);
- started_ = thread_join_result != 0;
- }
-
- return !started_;
-}
-
-// static
-void *CrashGenerationServer::WaitForMessages(void *server) {
- CrashGenerationServer *self =
- reinterpret_cast<CrashGenerationServer*>(server);
- while (self->WaitForOneMessage()) {}
- return NULL;
-}
-
-bool CrashGenerationServer::WaitForOneMessage() {
- MachReceiveMessage message;
- kern_return_t result = receive_port_.WaitForMessage(&message,
- MACH_MSG_TIMEOUT_NONE);
- if (result == KERN_SUCCESS) {
- switch (message.GetMessageID()) {
- case kDumpRequestMessage: {
- ExceptionInfo &info = (ExceptionInfo &)*message.GetData();
-
- mach_port_t remote_task = message.GetTranslatedPort(0);
- mach_port_t crashing_thread = message.GetTranslatedPort(1);
- mach_port_t handler_thread = message.GetTranslatedPort(2);
- mach_port_t ack_port = message.GetTranslatedPort(3);
- pid_t remote_pid = -1;
- pid_for_task(remote_task, &remote_pid);
- ClientInfo client(remote_pid);
-
- bool result;
- std::string dump_path;
- if (generate_dumps_ && (!filter_ || filter_(filter_context_))) {
- ScopedTaskSuspend suspend(remote_task);
-
- MinidumpGenerator generator(remote_task, handler_thread);
- dump_path = generator.UniqueNameInDirectory(dump_dir_, NULL);
-
- if (info.exception_type && info.exception_code) {
- generator.SetExceptionInformation(info.exception_type,
- info.exception_code,
- info.exception_subcode,
- crashing_thread);
- }
- result = generator.Write(dump_path.c_str());
- } else {
- result = true;
- }
-
- if (result && dump_callback_) {
- dump_callback_(dump_context_, client, dump_path);
- }
-
- // TODO(ted): support a way for the client to send additional data,
- // perhaps with a callback so users of the server can read the data
- // themselves?
-
- if (ack_port != MACH_PORT_DEAD && ack_port != MACH_PORT_NULL) {
- MachPortSender sender(ack_port);
- MachSendMessage ack_message(kAcknowledgementMessage);
- const mach_msg_timeout_t kSendTimeoutMs = 2 * 1000;
-
- sender.SendMessage(ack_message, kSendTimeoutMs);
- }
-
- if (exit_callback_) {
- exit_callback_(exit_context_, client);
- }
- break;
- }
- case kQuitMessage:
- return false;
- }
- } else { // result != KERN_SUCCESS
- return false;
- }
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h
deleted file mode 100644
index 85bd5b5e33..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/crash_generation_server.h
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_
-#define GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_
-
-#include <stdint.h>
-
-#include <string>
-
-#include "common/mac/MachIPC.h"
-
-namespace google_breakpad {
-
-class ClientInfo;
-
-// Messages the server can read via its mach port
-enum {
- kDumpRequestMessage = 1,
- kAcknowledgementMessage = 2,
- kQuitMessage = 3
-};
-
-// Exception details sent by the client when requesting a dump.
-struct ExceptionInfo {
- int32_t exception_type;
- int32_t exception_code;
- int32_t exception_subcode;
-};
-
-class CrashGenerationServer {
- public:
- // WARNING: callbacks may be invoked on a different thread
- // than that which creates the CrashGenerationServer. They must
- // be thread safe.
- typedef void (*OnClientDumpRequestCallback)(void *context,
- const ClientInfo &client_info,
- const std::string &file_path);
-
- typedef void (*OnClientExitingCallback)(void *context,
- const ClientInfo &client_info);
- // If a FilterCallback returns false, the dump will not be written.
- typedef bool (*FilterCallback)(void *context);
-
- // Create an instance with the given parameters.
- //
- // mach_port_name: Named server port to listen on.
- // filter: Callback for a client to cancel writing a dump.
- // filter_context: Context for the filter callback.
- // dump_callback: Callback for a client crash dump request.
- // dump_context: Context for client crash dump request callback.
- // exit_callback: Callback for client process exit.
- // exit_context: Context for client exit callback.
- // generate_dumps: Whether to automatically generate dumps.
- // Client code of this class might want to generate dumps explicitly
- // in the crash dump request callback. In that case, false can be
- // passed for this parameter.
- // dump_path: Path for generating dumps; required only if true is
- // passed for generateDumps parameter; NULL can be passed otherwise.
- CrashGenerationServer(const char *mach_port_name,
- FilterCallback filter,
- void *filter_context,
- OnClientDumpRequestCallback dump_callback,
- void *dump_context,
- OnClientExitingCallback exit_callback,
- void *exit_context,
- bool generate_dumps,
- const std::string &dump_path);
-
- ~CrashGenerationServer();
-
- // Perform initialization steps needed to start listening to clients.
- //
- // Return true if initialization is successful; false otherwise.
- bool Start();
-
- // Stop the server.
- bool Stop();
-
- private:
- // Return a unique filename at which a minidump can be written.
- bool MakeMinidumpFilename(std::string &outFilename);
-
- // Loop reading client messages and responding to them until
- // a quit message is received.
- static void *WaitForMessages(void *server);
-
- // Wait for a single client message and respond to it. Returns false
- // if a quit message was received or if an error occurred.
- bool WaitForOneMessage();
-
- FilterCallback filter_;
- void *filter_context_;
-
- OnClientDumpRequestCallback dump_callback_;
- void *dump_context_;
-
- OnClientExitingCallback exit_callback_;
- void *exit_context_;
-
- bool generate_dumps_;
-
- std::string dump_dir_;
-
- bool started_;
-
- // The mach port that receives requests to dump from child processes.
- ReceivePort receive_port_;
-
- // The name of the mach port. Stored so the Stop method can message
- // the background thread to shut it down.
- std::string mach_port_name_;
-
- // The thread that waits on the receive port.
- pthread_t server_thread_;
-
- // Disable copy constructor and operator=.
- CrashGenerationServer(const CrashGenerationServer&);
- CrashGenerationServer& operator=(const CrashGenerationServer&);
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_CLIENT_MAC_CRASH_GENERATION_CRASH_GENERATION_SERVER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
deleted file mode 100644
index 79afa4504f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'crash_generation_client.cc',
- 'crash_generation_server.cc',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '../../..',
-]
-
-if CONFIG['CLANG_CXX']:
- CXXFLAGS += ['-Wno-shadow']
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc
deleted file mode 100644
index 3492b823da..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.cc
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-
-/*
- * This file was copied from libc/gen/nlist.c from Darwin's source code
- * The version of nlist used as a base is from 10.5.2, libc-498
- * http://www.opensource.apple.com/darwinsource/10.5.2/Libc-498/gen/nlist.c
- *
- * The full tarball is at:
- * http://www.opensource.apple.com/darwinsource/tarballs/apsl/Libc-498.tar.gz
- *
- * I've modified it to be compatible with 64-bit images.
-*/
-
-#include "breakpad_nlist_64.h"
-
-#include <CoreFoundation/CoreFoundation.h>
-#include <fcntl.h>
-#include <mach-o/nlist.h>
-#include <mach-o/loader.h>
-#include <mach-o/fat.h>
-#include <mach/mach.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <TargetConditionals.h>
-#include <unistd.h>
-
-/* Stuff lifted from <a.out.h> and <sys/exec.h> since they are gone */
-/*
- * Header prepended to each a.out file.
- */
-struct exec {
- unsigned short a_machtype; /* machine type */
- unsigned short a_magic; /* magic number */
- unsigned long a_text; /* size of text segment */
- unsigned long a_data; /* size of initialized data */
- unsigned long a_bss; /* size of uninitialized data */
- unsigned long a_syms; /* size of symbol table */
- unsigned long a_entry; /* entry point */
- unsigned long a_trsize; /* size of text relocation */
- unsigned long a_drsize; /* size of data relocation */
-};
-
-#define OMAGIC 0407 /* old impure format */
-#define NMAGIC 0410 /* read-only text */
-#define ZMAGIC 0413 /* demand load format */
-
-#define N_BADMAG(x) \
- (((x).a_magic)!=OMAGIC && ((x).a_magic)!=NMAGIC && ((x).a_magic)!=ZMAGIC)
-#define N_TXTOFF(x) \
- ((x).a_magic==ZMAGIC ? 0 : sizeof (struct exec))
-#define N_SYMOFF(x) \
- (N_TXTOFF(x) + (x).a_text+(x).a_data + (x).a_trsize+(x).a_drsize)
-
-// Traits structs for specializing function templates to handle
-// 32-bit/64-bit Mach-O files.
-template<typename T>
-struct MachBits {};
-
-typedef struct nlist nlist32;
-typedef struct nlist_64 nlist64;
-
-template<>
-struct MachBits<nlist32> {
- typedef mach_header mach_header_type;
- typedef uint32_t word_type;
- static const uint32_t magic = MH_MAGIC;
-};
-
-template<>
-struct MachBits<nlist64> {
- typedef mach_header_64 mach_header_type;
- typedef uint64_t word_type;
- static const uint32_t magic = MH_MAGIC_64;
-};
-
-template<typename nlist_type>
-int
-__breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
- cpu_type_t cpu_type);
-
-/*
- * nlist - retreive attributes from name list (string table version)
- */
-
-template <typename nlist_type>
-int breakpad_nlist_common(const char *name,
- nlist_type *list,
- const char **symbolNames,
- cpu_type_t cpu_type) {
- int fd = open(name, O_RDONLY, 0);
- if (fd < 0)
- return -1;
- int n = __breakpad_fdnlist(fd, list, symbolNames, cpu_type);
- close(fd);
- return n;
-}
-
-int breakpad_nlist(const char *name,
- struct nlist *list,
- const char **symbolNames,
- cpu_type_t cpu_type) {
- return breakpad_nlist_common(name, list, symbolNames, cpu_type);
-}
-
-int breakpad_nlist(const char *name,
- struct nlist_64 *list,
- const char **symbolNames,
- cpu_type_t cpu_type) {
- return breakpad_nlist_common(name, list, symbolNames, cpu_type);
-}
-
-/* Note: __fdnlist() is called from kvm_nlist in libkvm's kvm.c */
-
-template<typename nlist_type>
-int __breakpad_fdnlist(int fd, nlist_type *list, const char **symbolNames,
- cpu_type_t cpu_type) {
- typedef typename MachBits<nlist_type>::mach_header_type mach_header_type;
- typedef typename MachBits<nlist_type>::word_type word_type;
-
- const uint32_t magic = MachBits<nlist_type>::magic;
-
- int maxlen = 500;
- int nreq = 0;
- for (nlist_type* q = list;
- symbolNames[q-list] && symbolNames[q-list][0];
- q++, nreq++) {
-
- q->n_type = 0;
- q->n_value = 0;
- q->n_desc = 0;
- q->n_sect = 0;
- q->n_un.n_strx = 0;
- }
-
- struct exec buf;
- if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf) ||
- (N_BADMAG(buf) && *((uint32_t *)&buf) != magic &&
- CFSwapInt32BigToHost(*((uint32_t *)&buf)) != FAT_MAGIC &&
- /* The following is the big-endian ppc64 check */
- (*((uint32_t*)&buf)) != FAT_MAGIC)) {
- return -1;
- }
-
- /* Deal with fat file if necessary */
- unsigned arch_offset = 0;
- if (CFSwapInt32BigToHost(*((uint32_t *)&buf)) == FAT_MAGIC ||
- /* The following is the big-endian ppc64 check */
- *((unsigned int *)&buf) == FAT_MAGIC) {
- /* Read in the fat header */
- struct fat_header fh;
- if (lseek(fd, 0, SEEK_SET) == -1) {
- return -1;
- }
- if (read(fd, (char *)&fh, sizeof(fh)) != sizeof(fh)) {
- return -1;
- }
-
- /* Convert fat_narchs to host byte order */
- fh.nfat_arch = CFSwapInt32BigToHost(fh.nfat_arch);
-
- /* Read in the fat archs */
- struct fat_arch *fat_archs =
- (struct fat_arch *)malloc(fh.nfat_arch * sizeof(struct fat_arch));
- if (fat_archs == NULL) {
- return -1;
- }
- if (read(fd, (char *)fat_archs,
- sizeof(struct fat_arch) * fh.nfat_arch) !=
- (ssize_t)(sizeof(struct fat_arch) * fh.nfat_arch)) {
- free(fat_archs);
- return -1;
- }
-
- /*
- * Convert archs to host byte ordering (a constraint of
- * cpusubtype_getbestarch()
- */
- for (unsigned i = 0; i < fh.nfat_arch; i++) {
- fat_archs[i].cputype =
- CFSwapInt32BigToHost(fat_archs[i].cputype);
- fat_archs[i].cpusubtype =
- CFSwapInt32BigToHost(fat_archs[i].cpusubtype);
- fat_archs[i].offset =
- CFSwapInt32BigToHost(fat_archs[i].offset);
- fat_archs[i].size =
- CFSwapInt32BigToHost(fat_archs[i].size);
- fat_archs[i].align =
- CFSwapInt32BigToHost(fat_archs[i].align);
- }
-
- struct fat_arch *fap = NULL;
- for (unsigned i = 0; i < fh.nfat_arch; i++) {
- if (fat_archs[i].cputype == cpu_type) {
- fap = &fat_archs[i];
- break;
- }
- }
-
- if (!fap) {
- free(fat_archs);
- return -1;
- }
- arch_offset = fap->offset;
- free(fat_archs);
-
- /* Read in the beginning of the architecture-specific file */
- if (lseek(fd, arch_offset, SEEK_SET) == -1) {
- return -1;
- }
- if (read(fd, (char *)&buf, sizeof(buf)) != sizeof(buf)) {
- return -1;
- }
- }
-
- off_t sa; /* symbol address */
- off_t ss; /* start of strings */
- register_t n;
- if (*((unsigned int *)&buf) == magic) {
- if (lseek(fd, arch_offset, SEEK_SET) == -1) {
- return -1;
- }
- mach_header_type mh;
- if (read(fd, (char *)&mh, sizeof(mh)) != sizeof(mh)) {
- return -1;
- }
-
- struct load_command *load_commands =
- (struct load_command *)malloc(mh.sizeofcmds);
- if (load_commands == NULL) {
- return -1;
- }
- if (read(fd, (char *)load_commands, mh.sizeofcmds) !=
- (ssize_t)mh.sizeofcmds) {
- free(load_commands);
- return -1;
- }
- struct symtab_command *stp = NULL;
- struct load_command *lcp = load_commands;
- // iterate through all load commands, looking for
- // LC_SYMTAB load command
- for (uint32_t i = 0; i < mh.ncmds; i++) {
- if (lcp->cmdsize % sizeof(word_type) != 0 ||
- lcp->cmdsize <= 0 ||
- (char *)lcp + lcp->cmdsize >
- (char *)load_commands + mh.sizeofcmds) {
- free(load_commands);
- return -1;
- }
- if (lcp->cmd == LC_SYMTAB) {
- if (lcp->cmdsize !=
- sizeof(struct symtab_command)) {
- free(load_commands);
- return -1;
- }
- stp = (struct symtab_command *)lcp;
- break;
- }
- lcp = (struct load_command *)
- ((char *)lcp + lcp->cmdsize);
- }
- if (stp == NULL) {
- free(load_commands);
- return -1;
- }
- // sa points to the beginning of the symbol table
- sa = stp->symoff + arch_offset;
- // ss points to the beginning of the string table
- ss = stp->stroff + arch_offset;
- // n is the number of bytes in the symbol table
- // each symbol table entry is an nlist structure
- n = stp->nsyms * sizeof(nlist_type);
- free(load_commands);
- } else {
- sa = N_SYMOFF(buf) + arch_offset;
- ss = sa + buf.a_syms + arch_offset;
- n = buf.a_syms;
- }
-
- if (lseek(fd, sa, SEEK_SET) == -1) {
- return -1;
- }
-
- // the algorithm here is to read the nlist entries in m-sized
- // chunks into q. q is then iterated over. for each entry in q,
- // use the string table index(q->n_un.n_strx) to read the symbol
- // name, then scan the nlist entries passed in by the user(via p),
- // and look for a match
- while (n) {
- nlist_type space[BUFSIZ/sizeof (nlist_type)];
- register_t m = sizeof (space);
-
- if (n < m)
- m = n;
- if (read(fd, (char *)space, m) != m)
- break;
- n -= m;
- off_t savpos = lseek(fd, 0, SEEK_CUR);
- if (savpos == -1) {
- return -1;
- }
- for (nlist_type* q = space; (m -= sizeof(nlist_type)) >= 0; q++) {
- char nambuf[BUFSIZ];
-
- if (q->n_un.n_strx == 0 || q->n_type & N_STAB)
- continue;
-
- // seek to the location in the binary where the symbol
- // name is stored & read it into memory
- if (lseek(fd, ss+q->n_un.n_strx, SEEK_SET) == -1) {
- return -1;
- }
- if (read(fd, nambuf, maxlen+1) == -1) {
- return -1;
- }
- const char *s2 = nambuf;
- for (nlist_type *p = list;
- symbolNames[p-list] && symbolNames[p-list][0];
- p++) {
- // get the symbol name the user has passed in that
- // corresponds to the nlist entry that we're looking at
- const char *s1 = symbolNames[p - list];
- while (*s1) {
- if (*s1++ != *s2++)
- goto cont;
- }
- if (*s2)
- goto cont;
-
- p->n_value = q->n_value;
- p->n_type = q->n_type;
- p->n_desc = q->n_desc;
- p->n_sect = q->n_sect;
- p->n_un.n_strx = q->n_un.n_strx;
- if (--nreq == 0)
- return nreq;
-
- break;
- cont: ;
- }
- }
- if (lseek(fd, savpos, SEEK_SET) == -1) {
- return -1;
- }
- }
- return nreq;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.h
deleted file mode 100644
index 1d2c639134..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/breakpad_nlist_64.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// breakpad_nlist.h
-//
-// This file is meant to provide a header for clients of the modified
-// nlist function implemented to work on 64-bit.
-
-#ifndef CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__
-
-#include <mach/machine.h>
-
-int breakpad_nlist(const char *name,
- struct nlist *list,
- const char **symbolNames,
- cpu_type_t cpu_type);
-int breakpad_nlist(const char *name,
- struct nlist_64 *list,
- const char **symbolNames,
- cpu_type_t cpu_type);
-
-#endif /* CLIENT_MAC_HANDLER_BREAKPAD_NLIST_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc
deleted file mode 100644
index cdba6df4ac..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.cc
+++ /dev/null
@@ -1,573 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/mac/handler/dynamic_images.h"
-
-extern "C" { // needed to compile on Leopard
- #include <mach-o/nlist.h>
- #include <stdlib.h>
- #include <stdio.h>
-}
-
-#include <assert.h>
-#include <AvailabilityMacros.h>
-#include <dlfcn.h>
-#include <mach/task_info.h>
-#include <sys/sysctl.h>
-#include <TargetConditionals.h>
-#include <unistd.h>
-
-#include <algorithm>
-#include <string>
-#include <vector>
-
-#include "breakpad_nlist_64.h"
-
-#if !TARGET_OS_IPHONE
-#include <CoreServices/CoreServices.h>
-
-#ifndef MAC_OS_X_VERSION_10_6
-#define MAC_OS_X_VERSION_10_6 1060
-#endif
-
-#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_6
-
-// Fallback declarations for TASK_DYLD_INFO and friends, introduced in
-// <mach/task_info.h> in the Mac OS X 10.6 SDK.
-#define TASK_DYLD_INFO 17
-struct task_dyld_info {
- mach_vm_address_t all_image_info_addr;
- mach_vm_size_t all_image_info_size;
-};
-typedef struct task_dyld_info task_dyld_info_data_t;
-typedef struct task_dyld_info *task_dyld_info_t;
-#define TASK_DYLD_INFO_COUNT (sizeof(task_dyld_info_data_t) / sizeof(natural_t))
-
-#endif
-
-#endif // !TARGET_OS_IPHONE
-
-namespace google_breakpad {
-
-using std::string;
-using std::vector;
-
-//==============================================================================
-// Returns the size of the memory region containing |address| and the
-// number of bytes from |address| to the end of the region.
-// We potentially, will extend the size of the original
-// region by the size of the following region if it's contiguous with the
-// first in order to handle cases when we're reading strings and they
-// straddle two vm regions.
-//
-static mach_vm_size_t GetMemoryRegionSize(task_port_t target_task,
- const uint64_t address,
- mach_vm_size_t *size_to_end) {
- mach_vm_address_t region_base = (mach_vm_address_t)address;
- mach_vm_size_t region_size;
- natural_t nesting_level = 0;
- vm_region_submap_info_64 submap_info;
- mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64;
-
- // Get information about the vm region containing |address|
- vm_region_recurse_info_t region_info;
- region_info = reinterpret_cast<vm_region_recurse_info_t>(&submap_info);
-
- kern_return_t result =
- mach_vm_region_recurse(target_task,
- &region_base,
- &region_size,
- &nesting_level,
- region_info,
- &info_count);
-
- if (result == KERN_SUCCESS) {
- // Get distance from |address| to the end of this region
- *size_to_end = region_base + region_size -(mach_vm_address_t)address;
-
- // If we want to handle strings as long as 4096 characters we may need
- // to check if there's a vm region immediately following the first one.
- // If so, we need to extend |*size_to_end| to go all the way to the end
- // of the second region.
- if (*size_to_end < 4096) {
- // Second region starts where the first one ends
- mach_vm_address_t region_base2 =
- (mach_vm_address_t)(region_base + region_size);
- mach_vm_size_t region_size2;
-
- // Get information about the following vm region
- result =
- mach_vm_region_recurse(target_task,
- &region_base2,
- &region_size2,
- &nesting_level,
- region_info,
- &info_count);
-
- // Extend region_size to go all the way to the end of the 2nd region
- if (result == KERN_SUCCESS
- && region_base2 == region_base + region_size) {
- region_size += region_size2;
- }
- }
-
- *size_to_end = region_base + region_size -(mach_vm_address_t)address;
- } else {
- region_size = 0;
- *size_to_end = 0;
- }
-
- return region_size;
-}
-
-#define kMaxStringLength 8192
-//==============================================================================
-// Reads a NULL-terminated string from another task.
-//
-// Warning! This will not read any strings longer than kMaxStringLength-1
-//
-static string ReadTaskString(task_port_t target_task,
- const uint64_t address) {
- // The problem is we don't know how much to read until we know how long
- // the string is. And we don't know how long the string is, until we've read
- // the memory! So, we'll try to read kMaxStringLength bytes
- // (or as many bytes as we can until we reach the end of the vm region).
- mach_vm_size_t size_to_end;
- GetMemoryRegionSize(target_task, address, &size_to_end);
-
- if (size_to_end > 0) {
- mach_vm_size_t size_to_read =
- size_to_end > kMaxStringLength ? kMaxStringLength : size_to_end;
-
- vector<uint8_t> bytes;
- if (ReadTaskMemory(target_task, address, (size_t)size_to_read, bytes) !=
- KERN_SUCCESS)
- return string();
-
- return string(reinterpret_cast<const char*>(&bytes[0]));
- }
-
- return string();
-}
-
-//==============================================================================
-// Reads an address range from another task. The bytes read will be returned
-// in bytes, which will be resized as necessary.
-kern_return_t ReadTaskMemory(task_port_t target_task,
- const uint64_t address,
- size_t length,
- vector<uint8_t> &bytes) {
- int systemPageSize = getpagesize();
-
- // use the negative of the page size for the mask to find the page address
- mach_vm_address_t page_address = address & (-systemPageSize);
-
- mach_vm_address_t last_page_address =
- (address + length + (systemPageSize - 1)) & (-systemPageSize);
-
- mach_vm_size_t page_size = last_page_address - page_address;
- uint8_t* local_start;
- uint32_t local_length;
-
- kern_return_t r = mach_vm_read(target_task,
- page_address,
- page_size,
- reinterpret_cast<vm_offset_t*>(&local_start),
- &local_length);
-
- if (r != KERN_SUCCESS)
- return r;
-
- bytes.resize(length);
- memcpy(&bytes[0],
- &local_start[(mach_vm_address_t)address - page_address],
- length);
- mach_vm_deallocate(mach_task_self(), (uintptr_t)local_start, local_length);
- return KERN_SUCCESS;
-}
-
-#pragma mark -
-
-//==============================================================================
-// Traits structs for specializing function templates to handle
-// 32-bit/64-bit Mach-O files.
-struct MachO32 {
- typedef mach_header mach_header_type;
- typedef segment_command mach_segment_command_type;
- typedef dyld_image_info32 dyld_image_info;
- typedef dyld_all_image_infos32 dyld_all_image_infos;
- typedef struct nlist nlist_type;
- static const uint32_t magic = MH_MAGIC;
- static const uint32_t segment_load_command = LC_SEGMENT;
-};
-
-struct MachO64 {
- typedef mach_header_64 mach_header_type;
- typedef segment_command_64 mach_segment_command_type;
- typedef dyld_image_info64 dyld_image_info;
- typedef dyld_all_image_infos64 dyld_all_image_infos;
- typedef struct nlist_64 nlist_type;
- static const uint32_t magic = MH_MAGIC_64;
- static const uint32_t segment_load_command = LC_SEGMENT_64;
-};
-
-template<typename MachBits>
-bool FindTextSection(DynamicImage& image) {
- typedef typename MachBits::mach_header_type mach_header_type;
- typedef typename MachBits::mach_segment_command_type
- mach_segment_command_type;
-
- const mach_header_type* header =
- reinterpret_cast<const mach_header_type*>(&image.header_[0]);
-
- if(header->magic != MachBits::magic) {
- return false;
- }
-
- const struct load_command *cmd =
- reinterpret_cast<const struct load_command *>(header + 1);
-
- bool found_text_section = false;
- bool found_dylib_id_command = false;
- for (unsigned int i = 0; cmd && (i < header->ncmds); ++i) {
- if (!found_text_section) {
- if (cmd->cmd == MachBits::segment_load_command) {
- const mach_segment_command_type *seg =
- reinterpret_cast<const mach_segment_command_type *>(cmd);
-
- if (!strcmp(seg->segname, "__TEXT")) {
- image.vmaddr_ = static_cast<mach_vm_address_t>(seg->vmaddr);
- image.vmsize_ = static_cast<mach_vm_size_t>(seg->vmsize);
- image.slide_ = 0;
-
- if (seg->fileoff == 0 && seg->filesize != 0) {
- image.slide_ =
- (uintptr_t)image.GetLoadAddress() - (uintptr_t)seg->vmaddr;
- }
- found_text_section = true;
- }
- }
- }
-
- if (!found_dylib_id_command) {
- if (cmd->cmd == LC_ID_DYLIB) {
- const struct dylib_command *dc =
- reinterpret_cast<const struct dylib_command *>(cmd);
-
- image.version_ = dc->dylib.current_version;
- found_dylib_id_command = true;
- }
- }
-
- if (found_dylib_id_command && found_text_section) {
- return true;
- }
-
- cmd = reinterpret_cast<const struct load_command *>
- (reinterpret_cast<const char *>(cmd) + cmd->cmdsize);
- }
-
- return false;
-}
-
-//==============================================================================
-// Initializes vmaddr_, vmsize_, and slide_
-void DynamicImage::CalculateMemoryAndVersionInfo() {
- // unless we can process the header, ensure that calls to
- // IsValid() will return false
- vmaddr_ = 0;
- vmsize_ = 0;
- slide_ = 0;
- version_ = 0;
-
- // The function template above does all the real work.
- if (Is64Bit())
- FindTextSection<MachO64>(*this);
- else
- FindTextSection<MachO32>(*this);
-}
-
-//==============================================================================
-// The helper function template abstracts the 32/64-bit differences.
-template<typename MachBits>
-uint32_t GetFileTypeFromHeader(DynamicImage& image) {
- typedef typename MachBits::mach_header_type mach_header_type;
-
- const mach_header_type* header =
- reinterpret_cast<const mach_header_type*>(&image.header_[0]);
- return header->filetype;
-}
-
-uint32_t DynamicImage::GetFileType() {
- if (Is64Bit())
- return GetFileTypeFromHeader<MachO64>(*this);
-
- return GetFileTypeFromHeader<MachO32>(*this);
-}
-
-#pragma mark -
-
-//==============================================================================
-// Loads information about dynamically loaded code in the given task.
-DynamicImages::DynamicImages(mach_port_t task)
- : task_(task),
- cpu_type_(DetermineTaskCPUType(task)),
- image_list_() {
- ReadImageInfoForTask();
-}
-
-template<typename MachBits>
-static uint64_t LookupSymbol(const char* symbol_name,
- const char* filename,
- cpu_type_t cpu_type) {
- typedef typename MachBits::nlist_type nlist_type;
-
- nlist_type symbol_info[8] = {};
- const char *symbolNames[2] = { symbol_name, "\0" };
- nlist_type &list = symbol_info[0];
- int invalidEntriesCount = breakpad_nlist(filename,
- &list,
- symbolNames,
- cpu_type);
-
- if(invalidEntriesCount != 0) {
- return 0;
- }
-
- assert(list.n_value);
- return list.n_value;
-}
-
-#if TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
-static bool HasTaskDyldInfo() {
- return true;
-}
-#else
-static SInt32 GetOSVersionInternal() {
- SInt32 os_version = 0;
- Gestalt(gestaltSystemVersion, &os_version);
- return os_version;
-}
-
-static SInt32 GetOSVersion() {
- static SInt32 os_version = GetOSVersionInternal();
- return os_version;
-}
-
-static bool HasTaskDyldInfo() {
- return GetOSVersion() >= 0x1060;
-}
-#endif // TARGET_OS_IPHONE || MAC_OS_X_VERSION_MIN_REQUIRED >= 10_6
-
-uint64_t DynamicImages::GetDyldAllImageInfosPointer() {
- if (HasTaskDyldInfo()) {
- task_dyld_info_data_t task_dyld_info;
- mach_msg_type_number_t count = TASK_DYLD_INFO_COUNT;
- if (task_info(task_, TASK_DYLD_INFO, (task_info_t)&task_dyld_info,
- &count) != KERN_SUCCESS) {
- return 0;
- }
-
- return (uint64_t)task_dyld_info.all_image_info_addr;
- } else {
- const char *imageSymbolName = "_dyld_all_image_infos";
- const char *dyldPath = "/usr/lib/dyld";
-
- if (Is64Bit())
- return LookupSymbol<MachO64>(imageSymbolName, dyldPath, cpu_type_);
- return LookupSymbol<MachO32>(imageSymbolName, dyldPath, cpu_type_);
- }
-}
-
-//==============================================================================
-// This code was written using dyld_debug.c (from Darwin) as a guide.
-
-template<typename MachBits>
-void ReadImageInfo(DynamicImages& images,
- uint64_t image_list_address) {
- typedef typename MachBits::dyld_image_info dyld_image_info;
- typedef typename MachBits::dyld_all_image_infos dyld_all_image_infos;
- typedef typename MachBits::mach_header_type mach_header_type;
-
- // Read the structure inside of dyld that contains information about
- // loaded images. We're reading from the desired task's address space.
-
- // Here we make the assumption that dyld loaded at the same address in
- // the crashed process vs. this one. This is an assumption made in
- // "dyld_debug.c" and is said to be nearly always valid.
- vector<uint8_t> dyld_all_info_bytes;
- if (ReadTaskMemory(images.task_,
- image_list_address,
- sizeof(dyld_all_image_infos),
- dyld_all_info_bytes) != KERN_SUCCESS)
- return;
-
- dyld_all_image_infos *dyldInfo =
- reinterpret_cast<dyld_all_image_infos*>(&dyld_all_info_bytes[0]);
-
- // number of loaded images
- int count = dyldInfo->infoArrayCount;
-
- // Read an array of dyld_image_info structures each containing
- // information about a loaded image.
- vector<uint8_t> dyld_info_array_bytes;
- if (ReadTaskMemory(images.task_,
- dyldInfo->infoArray,
- count * sizeof(dyld_image_info),
- dyld_info_array_bytes) != KERN_SUCCESS)
- return;
-
- dyld_image_info *infoArray =
- reinterpret_cast<dyld_image_info*>(&dyld_info_array_bytes[0]);
- images.image_list_.reserve(count);
-
- for (int i = 0; i < count; ++i) {
- dyld_image_info &info = infoArray[i];
-
- // First read just the mach_header from the image in the task.
- vector<uint8_t> mach_header_bytes;
- if (ReadTaskMemory(images.task_,
- info.load_address_,
- sizeof(mach_header_type),
- mach_header_bytes) != KERN_SUCCESS)
- continue; // bail on this dynamic image
-
- mach_header_type *header =
- reinterpret_cast<mach_header_type*>(&mach_header_bytes[0]);
-
- // Now determine the total amount necessary to read the header
- // plus all of the load commands.
- size_t header_size =
- sizeof(mach_header_type) + header->sizeofcmds;
-
- if (ReadTaskMemory(images.task_,
- info.load_address_,
- header_size,
- mach_header_bytes) != KERN_SUCCESS)
- continue;
-
- // Read the file name from the task's memory space.
- string file_path;
- if (info.file_path_) {
- // Although we're reading kMaxStringLength bytes, it's copied in the
- // the DynamicImage constructor below with the correct string length,
- // so it's not really wasting memory.
- file_path = ReadTaskString(images.task_, info.file_path_);
- }
-
- // Create an object representing this image and add it to our list.
- DynamicImage *new_image;
- new_image = new DynamicImage(&mach_header_bytes[0],
- header_size,
- info.load_address_,
- file_path,
- static_cast<uintptr_t>(info.file_mod_date_),
- images.task_,
- images.cpu_type_);
-
- if (new_image->IsValid()) {
- images.image_list_.push_back(DynamicImageRef(new_image));
- } else {
- delete new_image;
- }
- }
-
- // sorts based on loading address
- sort(images.image_list_.begin(), images.image_list_.end());
- // remove duplicates - this happens in certain strange cases
- // You can see it in DashboardClient when Google Gadgets plugin
- // is installed. Apple's crash reporter log and gdb "info shared"
- // both show the same library multiple times at the same address
-
- vector<DynamicImageRef>::iterator it = unique(images.image_list_.begin(),
- images.image_list_.end());
- images.image_list_.erase(it, images.image_list_.end());
-}
-
-void DynamicImages::ReadImageInfoForTask() {
- uint64_t imageList = GetDyldAllImageInfosPointer();
-
- if (imageList) {
- if (Is64Bit())
- ReadImageInfo<MachO64>(*this, imageList);
- else
- ReadImageInfo<MachO32>(*this, imageList);
- }
-}
-
-//==============================================================================
-DynamicImage *DynamicImages::GetExecutableImage() {
- int executable_index = GetExecutableImageIndex();
-
- if (executable_index >= 0) {
- return GetImage(executable_index);
- }
-
- return NULL;
-}
-
-//==============================================================================
-// returns -1 if failure to find executable
-int DynamicImages::GetExecutableImageIndex() {
- int image_count = GetImageCount();
-
- for (int i = 0; i < image_count; ++i) {
- DynamicImage *image = GetImage(i);
- if (image->GetFileType() == MH_EXECUTE) {
- return i;
- }
- }
-
- return -1;
-}
-
-//==============================================================================
-// static
-cpu_type_t DynamicImages::DetermineTaskCPUType(task_t task) {
- if (task == mach_task_self())
- return GetNativeCPUType();
-
- int mib[CTL_MAXNAME];
- size_t mibLen = CTL_MAXNAME;
- int err = sysctlnametomib("sysctl.proc_cputype", mib, &mibLen);
- if (err == 0) {
- assert(mibLen < CTL_MAXNAME);
- pid_for_task(task, &mib[mibLen]);
- mibLen += 1;
-
- cpu_type_t cpu_type;
- size_t cpuTypeSize = sizeof(cpu_type);
- sysctl(mib, static_cast<u_int>(mibLen), &cpu_type, &cpuTypeSize, 0, 0);
- return cpu_type;
- }
-
- return GetNativeCPUType();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h
deleted file mode 100644
index 65147900b8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/dynamic_images.h
+++ /dev/null
@@ -1,319 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dynamic_images.h
-//
-// Implements most of the function of the dyld API, but allowing an
-// arbitrary task to be introspected, unlike the dyld API which
-// only allows operation on the current task. The current implementation
-// is limited to use by 32-bit tasks.
-
-#ifndef CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__
-#define CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__
-
-#include <mach/mach.h>
-#include <mach-o/dyld.h>
-#include <mach-o/loader.h>
-#include <sys/types.h>
-
-#include <string>
-#include <vector>
-
-#include "mach_vm_compat.h"
-
-namespace google_breakpad {
-
-using std::string;
-using std::vector;
-
-//==============================================================================
-// The memory layout of this struct matches the dyld_image_info struct
-// defined in "dyld_gdb.h" in the darwin source.
-typedef struct dyld_image_info32 {
- uint32_t load_address_; // struct mach_header*
- uint32_t file_path_; // char*
- uint32_t file_mod_date_;
-} dyld_image_info32;
-
-typedef struct dyld_image_info64 {
- uint64_t load_address_; // struct mach_header*
- uint64_t file_path_; // char*
- uint64_t file_mod_date_;
-} dyld_image_info64;
-
-//==============================================================================
-// This is as defined in "dyld_gdb.h" in the darwin source.
-// _dyld_all_image_infos (in dyld) is a structure of this type
-// which will be used to determine which dynamic code has been loaded.
-typedef struct dyld_all_image_infos32 {
- uint32_t version; // == 1 in Mac OS X 10.4
- uint32_t infoArrayCount;
- uint32_t infoArray; // const struct dyld_image_info*
- uint32_t notification;
- bool processDetachedFromSharedRegion;
-} dyld_all_image_infos32;
-
-typedef struct dyld_all_image_infos64 {
- uint32_t version; // == 1 in Mac OS X 10.4
- uint32_t infoArrayCount;
- uint64_t infoArray; // const struct dyld_image_info*
- uint64_t notification;
- bool processDetachedFromSharedRegion;
-} dyld_all_image_infos64;
-
-// some typedefs to isolate 64/32 bit differences
-#ifdef __LP64__
-typedef mach_header_64 breakpad_mach_header;
-typedef segment_command_64 breakpad_mach_segment_command;
-#else
-typedef mach_header breakpad_mach_header;
-typedef segment_command breakpad_mach_segment_command;
-#endif
-
-// Helper functions to deal with 32-bit/64-bit Mach-O differences.
-class DynamicImage;
-template<typename MachBits>
-bool FindTextSection(DynamicImage& image);
-
-template<typename MachBits>
-uint32_t GetFileTypeFromHeader(DynamicImage& image);
-
-//==============================================================================
-// Represents a single dynamically loaded mach-o image
-class DynamicImage {
- public:
- DynamicImage(uint8_t *header, // data is copied
- size_t header_size, // includes load commands
- uint64_t load_address,
- string file_path,
- uintptr_t image_mod_date,
- mach_port_t task,
- cpu_type_t cpu_type)
- : header_(header, header + header_size),
- header_size_(header_size),
- load_address_(load_address),
- vmaddr_(0),
- vmsize_(0),
- slide_(0),
- version_(0),
- file_path_(file_path),
- file_mod_date_(image_mod_date),
- task_(task),
- cpu_type_(cpu_type) {
- CalculateMemoryAndVersionInfo();
- }
-
- // Size of mach_header plus load commands
- size_t GetHeaderSize() const {return header_.size();}
-
- // Full path to mach-o binary
- string GetFilePath() {return file_path_;}
-
- uint64_t GetModDate() const {return file_mod_date_;}
-
- // Actual address where the image was loaded
- uint64_t GetLoadAddress() const {return load_address_;}
-
- // Address where the image should be loaded
- mach_vm_address_t GetVMAddr() const {return vmaddr_;}
-
- // Difference between GetLoadAddress() and GetVMAddr()
- ptrdiff_t GetVMAddrSlide() const {return slide_;}
-
- // Size of the image
- mach_vm_size_t GetVMSize() const {return vmsize_;}
-
- // Task owning this loaded image
- mach_port_t GetTask() {return task_;}
-
- // CPU type of the task
- cpu_type_t GetCPUType() {return cpu_type_;}
-
- // filetype from the Mach-O header.
- uint32_t GetFileType();
-
- // Return true if the task is a 64-bit architecture.
- bool Is64Bit() { return (GetCPUType() & CPU_ARCH_ABI64) == CPU_ARCH_ABI64; }
-
- uint32_t GetVersion() {return version_;}
- // For sorting
- bool operator<(const DynamicImage &inInfo) {
- return GetLoadAddress() < inInfo.GetLoadAddress();
- }
-
- // Sanity checking
- bool IsValid() {return GetVMSize() != 0;}
-
- private:
- DynamicImage(const DynamicImage &);
- DynamicImage &operator=(const DynamicImage &);
-
- friend class DynamicImages;
- template<typename MachBits>
- friend bool FindTextSection(DynamicImage& image);
- template<typename MachBits>
- friend uint32_t GetFileTypeFromHeader(DynamicImage& image);
-
- // Initializes vmaddr_, vmsize_, and slide_
- void CalculateMemoryAndVersionInfo();
-
- const vector<uint8_t> header_; // our local copy of the header
- size_t header_size_; // mach_header plus load commands
- uint64_t load_address_; // base address image is mapped into
- mach_vm_address_t vmaddr_;
- mach_vm_size_t vmsize_;
- ptrdiff_t slide_;
- uint32_t version_; // Dylib version
- string file_path_; // path dyld used to load the image
- uintptr_t file_mod_date_; // time_t of image file
-
- mach_port_t task_;
- cpu_type_t cpu_type_; // CPU type of task_
-};
-
-//==============================================================================
-// DynamicImageRef is just a simple wrapper for a pointer to
-// DynamicImage. The reason we use it instead of a simple typedef is so
-// that we can use stl::sort() on a vector of DynamicImageRefs
-// and simple class pointers can't implement operator<().
-//
-class DynamicImageRef {
- public:
- explicit DynamicImageRef(DynamicImage *inP) : p(inP) {}
- // The copy constructor is required by STL
- DynamicImageRef(const DynamicImageRef &inRef) : p(inRef.p) {}
-
- bool operator<(const DynamicImageRef &inRef) const {
- return (*const_cast<DynamicImageRef*>(this)->p)
- < (*const_cast<DynamicImageRef&>(inRef).p);
- }
-
- bool operator==(const DynamicImageRef &inInfo) const {
- return (*const_cast<DynamicImageRef*>(this)->p).GetLoadAddress() ==
- (*const_cast<DynamicImageRef&>(inInfo)).GetLoadAddress();
- }
-
- // Be just like DynamicImage*
- DynamicImage *operator->() {return p;}
- operator DynamicImage*() {return p;}
-
- private:
- DynamicImage *p;
-};
-
-// Helper function to deal with 32-bit/64-bit Mach-O differences.
-class DynamicImages;
-template<typename MachBits>
-void ReadImageInfo(DynamicImages& images, uint64_t image_list_address);
-
-//==============================================================================
-// An object of type DynamicImages may be created to allow introspection of
-// an arbitrary task's dynamically loaded mach-o binaries. This makes the
-// assumption that the current task has send rights to the target task.
-class DynamicImages {
- public:
- explicit DynamicImages(mach_port_t task);
-
- ~DynamicImages() {
- for (int i = 0; i < GetImageCount(); ++i) {
- delete image_list_[i];
- }
- }
-
- // Returns the number of dynamically loaded mach-o images.
- int GetImageCount() const {return static_cast<int>(image_list_.size());}
-
- // Returns an individual image.
- DynamicImage *GetImage(int i) {
- if (i < (int)image_list_.size()) {
- return image_list_[i];
- }
- return NULL;
- }
-
- // Returns the image corresponding to the main executable.
- DynamicImage *GetExecutableImage();
- int GetExecutableImageIndex();
-
- // Returns the task which we're looking at.
- mach_port_t GetTask() const {return task_;}
-
- // CPU type of the task
- cpu_type_t GetCPUType() {return cpu_type_;}
-
- // Return true if the task is a 64-bit architecture.
- bool Is64Bit() { return (GetCPUType() & CPU_ARCH_ABI64) == CPU_ARCH_ABI64; }
-
- // Determine the CPU type of the task being dumped.
- static cpu_type_t DetermineTaskCPUType(task_t task);
-
- // Get the native CPU type of this task.
- static cpu_type_t GetNativeCPUType() {
-#if defined(__i386__)
- return CPU_TYPE_I386;
-#elif defined(__x86_64__)
- return CPU_TYPE_X86_64;
-#elif defined(__ppc__)
- return CPU_TYPE_POWERPC;
-#elif defined(__ppc64__)
- return CPU_TYPE_POWERPC64;
-#elif defined(__arm__)
- return CPU_TYPE_ARM;
-#elif defined(__aarch64__)
- return CPU_TYPE_ARM64;
-#else
-#error "GetNativeCPUType not implemented for this architecture"
-#endif
- }
-
- private:
- template<typename MachBits>
- friend void ReadImageInfo(DynamicImages& images, uint64_t image_list_address);
-
- bool IsOurTask() {return task_ == mach_task_self();}
-
- // Initialization
- void ReadImageInfoForTask();
- uint64_t GetDyldAllImageInfosPointer();
-
- mach_port_t task_;
- cpu_type_t cpu_type_; // CPU type of task_
- vector<DynamicImageRef> image_list_;
-};
-
-// Fill bytes with the contents of memory at a particular
-// location in another task.
-kern_return_t ReadTaskMemory(task_port_t target_task,
- const uint64_t address,
- size_t length,
- vector<uint8_t> &bytes);
-
-} // namespace google_breakpad
-
-#endif // CLIENT_MAC_HANDLER_DYNAMIC_IMAGES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
deleted file mode 100644
index dd0e1678ce..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.cc
+++ /dev/null
@@ -1,854 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <mach/exc.h>
-#include <mach/mig.h>
-#include <pthread.h>
-#include <signal.h>
-#include <TargetConditionals.h>
-
-#include <map>
-
-#include "client/mac/handler/exception_handler.h"
-#include "client/mac/handler/minidump_generator.h"
-#include "common/mac/macho_utilities.h"
-#include "common/mac/scoped_task_suspend-inl.h"
-#include "google_breakpad/common/minidump_exception_mac.h"
-
-#ifndef __EXCEPTIONS
-// This file uses C++ try/catch (but shouldn't). Duplicate the macros from
-// <c++/4.2.1/exception_defines.h> allowing this file to work properly with
-// exceptions disabled even when other C++ libraries are used. #undef the try
-// and catch macros first in case libstdc++ is in use and has already provided
-// its own definitions.
-#undef try
-#define try if (true)
-#undef catch
-#define catch(X) if (false)
-#endif // __EXCEPTIONS
-
-#ifndef USE_PROTECTED_ALLOCATIONS
-#if TARGET_OS_IPHONE
-#define USE_PROTECTED_ALLOCATIONS 1
-#else
-#define USE_PROTECTED_ALLOCATIONS 0
-#endif
-#endif
-
-// If USE_PROTECTED_ALLOCATIONS is activated then the
-// gBreakpadAllocator needs to be setup in other code
-// ahead of time. Please see ProtectedMemoryAllocator.h
-// for more details.
-#if USE_PROTECTED_ALLOCATIONS
- #include "protected_memory_allocator.h"
- extern ProtectedMemoryAllocator *gBreakpadAllocator;
-#endif
-
-namespace google_breakpad {
-
-static union {
-#if USE_PROTECTED_ALLOCATIONS
-#if defined PAGE_MAX_SIZE
- char protected_buffer[PAGE_MAX_SIZE] __attribute__((aligned(PAGE_MAX_SIZE)));
-#else
- char protected_buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE)));
-#endif // defined PAGE_MAX_SIZE
-#endif // USE_PROTECTED_ALLOCATIONS
- google_breakpad::ExceptionHandler *handler;
-} gProtectedData;
-
-using std::map;
-
-// These structures and techniques are illustrated in
-// Mac OS X Internals, Amit Singh, ch 9.7
-struct ExceptionMessage {
- mach_msg_header_t header;
- mach_msg_body_t body;
- mach_msg_port_descriptor_t thread;
- mach_msg_port_descriptor_t task;
- NDR_record_t ndr;
- exception_type_t exception;
- mach_msg_type_number_t code_count;
- integer_t code[EXCEPTION_CODE_MAX];
- char padding[512];
-};
-
-struct ExceptionParameters {
- ExceptionParameters() : count(0) {}
- mach_msg_type_number_t count;
- exception_mask_t masks[EXC_TYPES_COUNT];
- mach_port_t ports[EXC_TYPES_COUNT];
- exception_behavior_t behaviors[EXC_TYPES_COUNT];
- thread_state_flavor_t flavors[EXC_TYPES_COUNT];
-};
-
-struct ExceptionReplyMessage {
- mach_msg_header_t header;
- NDR_record_t ndr;
- kern_return_t return_code;
-};
-
-// Only catch these three exceptions. The other ones are nebulously defined
-// and may result in treating a non-fatal exception as fatal.
-exception_mask_t s_exception_mask = EXC_MASK_BAD_ACCESS |
-EXC_MASK_BAD_INSTRUCTION | EXC_MASK_ARITHMETIC | EXC_MASK_BREAKPOINT;
-
-#if !TARGET_OS_IPHONE
-extern "C" {
- // Forward declarations for functions that need "C" style compilation
- boolean_t exc_server(mach_msg_header_t* request,
- mach_msg_header_t* reply);
-
- // This symbol must be visible to dlsym() - see
- // http://code.google.com/p/google-breakpad/issues/detail?id=345 for details.
- kern_return_t catch_exception_raise(mach_port_t target_port,
- mach_port_t failed_thread,
- mach_port_t task,
- exception_type_t exception,
- exception_data_t code,
- mach_msg_type_number_t code_count)
- __attribute__((visibility("default")));
-}
-#endif
-
-kern_return_t ForwardException(mach_port_t task,
- mach_port_t failed_thread,
- exception_type_t exception,
- exception_data_t code,
- mach_msg_type_number_t code_count);
-
-#if TARGET_OS_IPHONE
-// Implementation is based on the implementation generated by mig.
-boolean_t breakpad_exc_server(mach_msg_header_t* InHeadP,
- mach_msg_header_t* OutHeadP) {
- OutHeadP->msgh_bits =
- MACH_MSGH_BITS(MACH_MSGH_BITS_REMOTE(InHeadP->msgh_bits), 0);
- OutHeadP->msgh_remote_port = InHeadP->msgh_remote_port;
- /* Minimal size: routine() will update it if different */
- OutHeadP->msgh_size = (mach_msg_size_t)sizeof(mig_reply_error_t);
- OutHeadP->msgh_local_port = MACH_PORT_NULL;
- OutHeadP->msgh_id = InHeadP->msgh_id + 100;
-
- if (InHeadP->msgh_id != 2401) {
- ((mig_reply_error_t*)OutHeadP)->NDR = NDR_record;
- ((mig_reply_error_t*)OutHeadP)->RetCode = MIG_BAD_ID;
- return FALSE;
- }
-
-#ifdef __MigPackStructs
-#pragma pack(4)
-#endif
- typedef struct {
- mach_msg_header_t Head;
- /* start of the kernel processed data */
- mach_msg_body_t msgh_body;
- mach_msg_port_descriptor_t thread;
- mach_msg_port_descriptor_t task;
- /* end of the kernel processed data */
- NDR_record_t NDR;
- exception_type_t exception;
- mach_msg_type_number_t codeCnt;
- integer_t code[2];
- mach_msg_trailer_t trailer;
- } Request;
-
- typedef struct {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- kern_return_t RetCode;
- } Reply;
-#ifdef __MigPackStructs
-#pragma pack()
-#endif
-
- Request* In0P = (Request*)InHeadP;
- Reply* OutP = (Reply*)OutHeadP;
-
- if (In0P->task.name != mach_task_self()) {
- return FALSE;
- }
- OutP->RetCode = ForwardException(In0P->task.name,
- In0P->thread.name,
- In0P->exception,
- In0P->code,
- In0P->codeCnt);
- OutP->NDR = NDR_record;
- return TRUE;
-}
-#else
-boolean_t breakpad_exc_server(mach_msg_header_t* request,
- mach_msg_header_t* reply) {
- return exc_server(request, reply);
-}
-
-// Callback from exc_server()
-kern_return_t catch_exception_raise(mach_port_t port, mach_port_t failed_thread,
- mach_port_t task,
- exception_type_t exception,
- exception_data_t code,
- mach_msg_type_number_t code_count) {
- if (task != mach_task_self()) {
- return KERN_FAILURE;
- }
- return ForwardException(task, failed_thread, exception, code, code_count);
-}
-#endif
-
-ExceptionHandler::ExceptionHandler(const string &dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- bool install_handler,
- const char* port_name)
- : dump_path_(),
- filter_(filter),
- callback_(callback),
- callback_context_(callback_context),
- directCallback_(NULL),
- handler_thread_(NULL),
- handler_port_(MACH_PORT_NULL),
- previous_(NULL),
- installed_exception_handler_(false),
- is_in_teardown_(false),
- last_minidump_write_result_(false),
- use_minidump_write_mutex_(false) {
- // This will update to the ID and C-string pointers
- set_dump_path(dump_path);
- MinidumpGenerator::GatherSystemInformation();
-#if !TARGET_OS_IPHONE
- if (port_name)
- crash_generation_client_.reset(new CrashGenerationClient(port_name));
-#endif
- Setup(install_handler);
-}
-
-// special constructor if we want to bypass minidump writing and
-// simply get a callback with the exception information
-ExceptionHandler::ExceptionHandler(DirectCallback callback,
- void* callback_context,
- bool install_handler)
- : dump_path_(),
- filter_(NULL),
- callback_(NULL),
- callback_context_(callback_context),
- directCallback_(callback),
- handler_thread_(NULL),
- handler_port_(MACH_PORT_NULL),
- previous_(NULL),
- installed_exception_handler_(false),
- is_in_teardown_(false),
- last_minidump_write_result_(false),
- use_minidump_write_mutex_(false) {
- MinidumpGenerator::GatherSystemInformation();
- Setup(install_handler);
-}
-
-ExceptionHandler::~ExceptionHandler() {
- Teardown();
-}
-
-bool ExceptionHandler::WriteMinidump(bool write_exception_stream) {
- // If we're currently writing, just return
- if (use_minidump_write_mutex_)
- return false;
-
- use_minidump_write_mutex_ = true;
- last_minidump_write_result_ = false;
-
- // Lock the mutex. Since we just created it, this will return immediately.
- if (pthread_mutex_lock(&minidump_write_mutex_) == 0) {
- // Send an empty message to the handle port so that a minidump will
- // be written
- bool result = SendMessageToHandlerThread(write_exception_stream ?
- kWriteDumpWithExceptionMessage :
- kWriteDumpMessage);
- if (!result) {
- pthread_mutex_unlock(&minidump_write_mutex_);
- return false;
- }
-
- // Wait for the minidump writer to complete its writing. It will unlock
- // the mutex when completed
- pthread_mutex_lock(&minidump_write_mutex_);
- }
-
- use_minidump_write_mutex_ = false;
- UpdateNextID();
- return last_minidump_write_result_;
-}
-
-// static
-bool ExceptionHandler::WriteMinidump(const string &dump_path,
- bool write_exception_stream,
- MinidumpCallback callback,
- void* callback_context) {
- ExceptionHandler handler(dump_path, NULL, callback, callback_context, false,
- NULL);
- return handler.WriteMinidump(write_exception_stream);
-}
-
-// static
-bool ExceptionHandler::WriteMinidumpForChild(mach_port_t child,
- mach_port_t child_blamed_thread,
- const string &dump_path,
- MinidumpCallback callback,
- void* callback_context) {
- ScopedTaskSuspend suspend(child);
-
- MinidumpGenerator generator(child, MACH_PORT_NULL);
- string dump_id;
- string dump_filename = generator.UniqueNameInDirectory(dump_path, &dump_id);
-
- generator.SetExceptionInformation(EXC_BREAKPOINT,
-#if defined(__i386__) || defined(__x86_64__)
- EXC_I386_BPT,
-#elif defined(__ppc__) || defined(__ppc64__)
- EXC_PPC_BREAKPOINT,
-#elif defined(__arm__) || defined(__aarch64__)
- EXC_ARM_BREAKPOINT,
-#else
-#error architecture not supported
-#endif
- 0,
- child_blamed_thread);
- bool result = generator.Write(dump_filename.c_str());
-
- if (callback) {
- return callback(dump_path.c_str(), dump_id.c_str(),
- callback_context, result);
- }
- return result;
-}
-
-bool ExceptionHandler::WriteMinidumpWithException(
- int exception_type,
- int exception_code,
- int exception_subcode,
- breakpad_ucontext_t* task_context,
- mach_port_t thread_name,
- bool exit_after_write,
- bool report_current_thread) {
- bool result = false;
-
- if (directCallback_) {
- if (directCallback_(callback_context_,
- exception_type,
- exception_code,
- exception_subcode,
- thread_name) ) {
- if (exit_after_write)
- _exit(exception_type);
- }
-#if !TARGET_OS_IPHONE
- } else if (IsOutOfProcess()) {
- if (exception_type && exception_code) {
- // If this is a real exception, give the filter (if any) a chance to
- // decide if this should be sent.
- if (filter_ && !filter_(callback_context_))
- return false;
- result = crash_generation_client_->RequestDumpForException(
- exception_type,
- exception_code,
- exception_subcode,
- thread_name);
- if (result && exit_after_write) {
- _exit(exception_type);
- }
- }
-#endif
- } else {
- string minidump_id;
-
- // Putting the MinidumpGenerator in its own context will ensure that the
- // destructor is executed, closing the newly created minidump file.
- if (!dump_path_.empty()) {
- MinidumpGenerator md(mach_task_self(),
- report_current_thread ? MACH_PORT_NULL :
- mach_thread_self());
- md.SetTaskContext(task_context);
- if (exception_type && exception_code) {
- // If this is a real exception, give the filter (if any) a chance to
- // decide if this should be sent.
- if (filter_ && !filter_(callback_context_))
- return false;
-
- md.SetExceptionInformation(exception_type, exception_code,
- exception_subcode, thread_name);
- }
-
- result = md.Write(next_minidump_path_c_);
- }
-
- // Call user specified callback (if any)
- if (callback_) {
- // If the user callback returned true and we're handling an exception
- // (rather than just writing out the file), then we should exit without
- // forwarding the exception to the next handler.
- if (callback_(dump_path_c_, next_minidump_id_c_, callback_context_,
- result)) {
- if (exit_after_write)
- _exit(exception_type);
- }
- }
- }
-
- return result;
-}
-
-kern_return_t ForwardException(mach_port_t task, mach_port_t failed_thread,
- exception_type_t exception,
- exception_data_t code,
- mach_msg_type_number_t code_count) {
- // At this time, we should have called Uninstall() on the exception handler
- // so that the current exception ports are the ones that we should be
- // forwarding to.
- ExceptionParameters current;
-
- current.count = EXC_TYPES_COUNT;
- mach_port_t current_task = mach_task_self();
- task_get_exception_ports(current_task,
- s_exception_mask,
- current.masks,
- &current.count,
- current.ports,
- current.behaviors,
- current.flavors);
-
- // Find the first exception handler that matches the exception
- unsigned int found;
- for (found = 0; found < current.count; ++found) {
- if (current.masks[found] & (1 << exception)) {
- break;
- }
- }
-
- // Nothing to forward
- if (found == current.count) {
- fprintf(stderr, "** No previous ports for forwarding!! \n");
- exit(KERN_FAILURE);
- }
-
- mach_port_t target_port = current.ports[found];
- exception_behavior_t target_behavior = current.behaviors[found];
-
- kern_return_t result;
- // TODO: Handle the case where |target_behavior| has MACH_EXCEPTION_CODES
- // set. https://code.google.com/p/google-breakpad/issues/detail?id=551
- switch (target_behavior) {
- case EXCEPTION_DEFAULT:
- result = exception_raise(target_port, failed_thread, task, exception,
- code, code_count);
- break;
- default:
- fprintf(stderr, "** Unknown exception behavior: %d\n", target_behavior);
- result = KERN_FAILURE;
- break;
- }
-
- return result;
-}
-
-// static
-void* ExceptionHandler::WaitForMessage(void* exception_handler_class) {
- ExceptionHandler* self =
- reinterpret_cast<ExceptionHandler*>(exception_handler_class);
- ExceptionMessage receive;
-
- // Wait for the exception info
- while (1) {
- receive.header.msgh_local_port = self->handler_port_;
- receive.header.msgh_size = static_cast<mach_msg_size_t>(sizeof(receive));
- kern_return_t result = mach_msg(&(receive.header),
- MACH_RCV_MSG | MACH_RCV_LARGE, 0,
- receive.header.msgh_size,
- self->handler_port_,
- MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
-
-
- if (result == KERN_SUCCESS) {
- // Uninstall our handler so that we don't get in a loop if the process of
- // writing out a minidump causes an exception. However, if the exception
- // was caused by a fork'd process, don't uninstall things
-
- // If the actual exception code is zero, then we're calling this handler
- // in a way that indicates that we want to either exit this thread or
- // generate a minidump
- //
- // While reporting, all threads (except this one) must be suspended
- // to avoid misleading stacks. If appropriate they will be resumed
- // afterwards.
- if (!receive.exception) {
- // Don't touch self, since this message could have been sent
- // from its destructor.
- if (receive.header.msgh_id == kShutdownMessage)
- return NULL;
-
- self->SuspendThreads();
-
-#if USE_PROTECTED_ALLOCATIONS
- if (gBreakpadAllocator)
- gBreakpadAllocator->Unprotect();
-#endif
-
- mach_port_t thread = MACH_PORT_NULL;
- int exception_type = 0;
- int exception_code = 0;
- if (receive.header.msgh_id == kWriteDumpWithExceptionMessage) {
- thread = receive.thread.name;
- exception_type = EXC_BREAKPOINT;
-#if defined(__i386__) || defined(__x86_64__)
- exception_code = EXC_I386_BPT;
-#elif defined(__ppc__) || defined(__ppc64__)
- exception_code = EXC_PPC_BREAKPOINT;
-#elif defined(__arm__) || defined(__aarch64__)
- exception_code = EXC_ARM_BREAKPOINT;
-#else
-#error architecture not supported
-#endif
- }
-
- // Write out the dump and save the result for later retrieval
- self->last_minidump_write_result_ =
- self->WriteMinidumpWithException(exception_type, exception_code,
- 0, NULL, thread,
- false, false);
-
-#if USE_PROTECTED_ALLOCATIONS
- if (gBreakpadAllocator)
- gBreakpadAllocator->Protect();
-#endif
-
- self->ResumeThreads();
-
- if (self->use_minidump_write_mutex_)
- pthread_mutex_unlock(&self->minidump_write_mutex_);
- } else {
- // When forking a child process with the exception handler installed,
- // if the child crashes, it will send the exception back to the parent
- // process. The check for task == self_task() ensures that only
- // exceptions that occur in the parent process are caught and
- // processed. If the exception was not caused by this task, we
- // still need to call into the exception server and have it return
- // KERN_FAILURE (see catch_exception_raise) in order for the kernel
- // to move onto the host exception handler for the child task
- if (receive.task.name == mach_task_self()) {
- self->SuspendThreads();
-
-#if USE_PROTECTED_ALLOCATIONS
- if (gBreakpadAllocator)
- gBreakpadAllocator->Unprotect();
-#endif
-
- int subcode = 0;
- if (receive.exception == EXC_BAD_ACCESS && receive.code_count > 1)
- subcode = receive.code[1];
-
- // Generate the minidump with the exception data.
- self->WriteMinidumpWithException(receive.exception, receive.code[0],
- subcode, NULL, receive.thread.name,
- true, false);
-
-#if USE_PROTECTED_ALLOCATIONS
- // This may have become protected again within
- // WriteMinidumpWithException, but it needs to be unprotected for
- // UninstallHandler.
- if (gBreakpadAllocator)
- gBreakpadAllocator->Unprotect();
-#endif
-
- self->UninstallHandler(true);
-
-#if USE_PROTECTED_ALLOCATIONS
- if (gBreakpadAllocator)
- gBreakpadAllocator->Protect();
-#endif
- }
- // Pass along the exception to the server, which will setup the
- // message and call catch_exception_raise() and put the return
- // code into the reply.
- ExceptionReplyMessage reply;
- if (!breakpad_exc_server(&receive.header, &reply.header))
- exit(1);
-
- // Send a reply and exit
- mach_msg(&(reply.header), MACH_SEND_MSG,
- reply.header.msgh_size, 0, MACH_PORT_NULL,
- MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
- }
- }
- }
-
- return NULL;
-}
-
-// static
-void ExceptionHandler::SignalHandler(int sig, siginfo_t* info, void* uc) {
-#if USE_PROTECTED_ALLOCATIONS
- if (gBreakpadAllocator)
- gBreakpadAllocator->Unprotect();
-#endif
- gProtectedData.handler->WriteMinidumpWithException(
- EXC_SOFTWARE,
- MD_EXCEPTION_CODE_MAC_ABORT,
- 0,
- static_cast<breakpad_ucontext_t*>(uc),
- mach_thread_self(),
- true,
- true);
-#if USE_PROTECTED_ALLOCATIONS
- if (gBreakpadAllocator)
- gBreakpadAllocator->Protect();
-#endif
-}
-
-bool ExceptionHandler::InstallHandler() {
- // If a handler is already installed, something is really wrong.
- if (gProtectedData.handler != NULL) {
- return false;
- }
-
- struct sigaction sa;
- memset(&sa, 0, sizeof(sa));
- sigemptyset(&sa.sa_mask);
- sigaddset(&sa.sa_mask, SIGABRT);
- sa.sa_sigaction = ExceptionHandler::SignalHandler;
- sa.sa_flags = SA_SIGINFO;
-
- scoped_ptr<struct sigaction> old(new struct sigaction);
- if (sigaction(SIGABRT, &sa, old.get()) == -1) {
- return false;
- }
- old_handler_.swap(old);
- gProtectedData.handler = this;
-#if USE_PROTECTED_ALLOCATIONS
- assert(((size_t)(gProtectedData.protected_buffer) & PAGE_MASK) == 0);
- mprotect(gProtectedData.protected_buffer, PAGE_SIZE, PROT_READ);
-#endif
-
- try {
-#if USE_PROTECTED_ALLOCATIONS
- previous_ = new (gBreakpadAllocator->Allocate(sizeof(ExceptionParameters)) )
- ExceptionParameters();
-#else
- previous_ = new ExceptionParameters();
-#endif
- }
- catch (std::bad_alloc) {
- return false;
- }
-
- // Save the current exception ports so that we can forward to them
- previous_->count = EXC_TYPES_COUNT;
- mach_port_t current_task = mach_task_self();
- kern_return_t result = task_get_exception_ports(current_task,
- s_exception_mask,
- previous_->masks,
- &previous_->count,
- previous_->ports,
- previous_->behaviors,
- previous_->flavors);
-
- // Setup the exception ports on this task
- if (result == KERN_SUCCESS)
- result = task_set_exception_ports(current_task, s_exception_mask,
- handler_port_, EXCEPTION_DEFAULT,
- THREAD_STATE_NONE);
-
- installed_exception_handler_ = (result == KERN_SUCCESS);
-
- return installed_exception_handler_;
-}
-
-bool ExceptionHandler::UninstallHandler(bool in_exception) {
- kern_return_t result = KERN_SUCCESS;
-
- if (old_handler_.get()) {
- sigaction(SIGABRT, old_handler_.get(), NULL);
-#if USE_PROTECTED_ALLOCATIONS
- mprotect(gProtectedData.protected_buffer, PAGE_SIZE,
- PROT_READ | PROT_WRITE);
-#endif
- old_handler_.reset();
- gProtectedData.handler = NULL;
- }
-
- if (installed_exception_handler_) {
- mach_port_t current_task = mach_task_self();
-
- // Restore the previous ports
- for (unsigned int i = 0; i < previous_->count; ++i) {
- result = task_set_exception_ports(current_task, previous_->masks[i],
- previous_->ports[i],
- previous_->behaviors[i],
- previous_->flavors[i]);
- if (result != KERN_SUCCESS)
- return false;
- }
-
- // this delete should NOT happen if an exception just occurred!
- if (!in_exception) {
-#if USE_PROTECTED_ALLOCATIONS
- previous_->~ExceptionParameters();
-#else
- delete previous_;
-#endif
- }
-
- previous_ = NULL;
- installed_exception_handler_ = false;
- }
-
- return result == KERN_SUCCESS;
-}
-
-bool ExceptionHandler::Setup(bool install_handler) {
- if (pthread_mutex_init(&minidump_write_mutex_, NULL))
- return false;
-
- // Create a receive right
- mach_port_t current_task = mach_task_self();
- kern_return_t result = mach_port_allocate(current_task,
- MACH_PORT_RIGHT_RECEIVE,
- &handler_port_);
- // Add send right
- if (result == KERN_SUCCESS)
- result = mach_port_insert_right(current_task, handler_port_, handler_port_,
- MACH_MSG_TYPE_MAKE_SEND);
-
- if (install_handler && result == KERN_SUCCESS)
- if (!InstallHandler())
- return false;
-
- if (result == KERN_SUCCESS) {
- // Install the handler in its own thread, detached as we won't be joining.
- pthread_attr_t attr;
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- int thread_create_result = pthread_create(&handler_thread_, &attr,
- &WaitForMessage, this);
- pthread_attr_destroy(&attr);
- result = thread_create_result ? KERN_FAILURE : KERN_SUCCESS;
- }
-
- return result == KERN_SUCCESS;
-}
-
-bool ExceptionHandler::Teardown() {
- kern_return_t result = KERN_SUCCESS;
- is_in_teardown_ = true;
-
- if (!UninstallHandler(false))
- return false;
-
- // Send an empty message so that the handler_thread exits
- if (SendMessageToHandlerThread(kShutdownMessage)) {
- mach_port_t current_task = mach_task_self();
- result = mach_port_deallocate(current_task, handler_port_);
- if (result != KERN_SUCCESS)
- return false;
- } else {
- return false;
- }
-
- handler_thread_ = NULL;
- handler_port_ = MACH_PORT_NULL;
- pthread_mutex_destroy(&minidump_write_mutex_);
-
- return result == KERN_SUCCESS;
-}
-
-bool ExceptionHandler::SendMessageToHandlerThread(
- HandlerThreadMessage message_id) {
- ExceptionMessage msg;
- memset(&msg, 0, sizeof(msg));
- msg.header.msgh_id = message_id;
- if (message_id == kWriteDumpMessage ||
- message_id == kWriteDumpWithExceptionMessage) {
- // Include this thread's port.
- msg.thread.name = mach_thread_self();
- msg.thread.disposition = MACH_MSG_TYPE_PORT_SEND;
- msg.thread.type = MACH_MSG_PORT_DESCRIPTOR;
- }
- msg.header.msgh_size = sizeof(msg) - sizeof(msg.padding);
- msg.header.msgh_remote_port = handler_port_;
- msg.header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND,
- MACH_MSG_TYPE_MAKE_SEND_ONCE);
- kern_return_t result = mach_msg(&(msg.header),
- MACH_SEND_MSG | MACH_SEND_TIMEOUT,
- msg.header.msgh_size, 0, 0,
- MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
-
- return result == KERN_SUCCESS;
-}
-
-void ExceptionHandler::UpdateNextID() {
- next_minidump_path_ =
- (MinidumpGenerator::UniqueNameInDirectory(dump_path_, &next_minidump_id_));
-
- next_minidump_path_c_ = next_minidump_path_.c_str();
- next_minidump_id_c_ = next_minidump_id_.c_str();
-}
-
-bool ExceptionHandler::SuspendThreads() {
- thread_act_port_array_t threads_for_task;
- mach_msg_type_number_t thread_count;
-
- if (task_threads(mach_task_self(), &threads_for_task, &thread_count))
- return false;
-
- // suspend all of the threads except for this one
- for (unsigned int i = 0; i < thread_count; ++i) {
- if (threads_for_task[i] != mach_thread_self()) {
- if (thread_suspend(threads_for_task[i]))
- return false;
- }
- }
-
- return true;
-}
-
-bool ExceptionHandler::ResumeThreads() {
- thread_act_port_array_t threads_for_task;
- mach_msg_type_number_t thread_count;
-
- if (task_threads(mach_task_self(), &threads_for_task, &thread_count))
- return false;
-
- // resume all of the threads except for this one
- for (unsigned int i = 0; i < thread_count; ++i) {
- if (threads_for_task[i] != mach_thread_self()) {
- if (thread_resume(threads_for_task[i]))
- return false;
- }
- }
-
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h
deleted file mode 100644
index f1d9ae92de..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/exception_handler.h
+++ /dev/null
@@ -1,281 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exception_handler.h: MacOS exception handler
-// This class can install a Mach exception port handler to trap most common
-// programming errors. If an exception occurs, a minidump file will be
-// generated which contains detailed information about the process and the
-// exception.
-
-#ifndef CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__
-#define CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__
-
-#include <mach/mach.h>
-#include <TargetConditionals.h>
-
-#include <string>
-
-#include "client/mac/handler/ucontext_compat.h"
-#include "common/scoped_ptr.h"
-
-#if !TARGET_OS_IPHONE
-#include "client/mac/crash_generation/crash_generation_client.h"
-#endif
-
-namespace google_breakpad {
-
-using std::string;
-
-struct ExceptionParameters;
-
-enum HandlerThreadMessage {
- // Message ID telling the handler thread to write a dump.
- kWriteDumpMessage = 0,
- // Message ID telling the handler thread to write a dump and include
- // an exception stream.
- kWriteDumpWithExceptionMessage = 1,
- // Message ID telling the handler thread to quit.
- kShutdownMessage = 2
-};
-
-class ExceptionHandler {
- public:
- // A callback function to run before Breakpad performs any substantial
- // processing of an exception. A FilterCallback is called before writing
- // a minidump. context is the parameter supplied by the user as
- // callback_context when the handler was created.
- //
- // If a FilterCallback returns true, Breakpad will continue processing,
- // attempting to write a minidump. If a FilterCallback returns false, Breakpad
- // will immediately report the exception as unhandled without writing a
- // minidump, allowing another handler the opportunity to handle it.
- typedef bool (*FilterCallback)(void *context);
-
- // A callback function to run after the minidump has been written.
- // |minidump_id| is a unique id for the dump, so the minidump
- // file is <dump_dir>/<minidump_id>.dmp.
- // |context| is the value passed into the constructor.
- // |succeeded| indicates whether a minidump file was successfully written.
- // Return true if the exception was fully handled and breakpad should exit.
- // Return false to allow any other exception handlers to process the
- // exception.
- typedef bool (*MinidumpCallback)(const char *dump_dir,
- const char *minidump_id,
- void *context, bool succeeded);
-
- // A callback function which will be called directly if an exception occurs.
- // This bypasses the minidump file writing and simply gives the client
- // the exception information.
- typedef bool (*DirectCallback)( void *context,
- int exception_type,
- int exception_code,
- int exception_subcode,
- mach_port_t thread_name);
-
- // Creates a new ExceptionHandler instance to handle writing minidumps.
- // Minidump files will be written to dump_path, and the optional callback
- // is called after writing the dump file, as described above.
- // If install_handler is true, then a minidump will be written whenever
- // an unhandled exception occurs. If it is false, minidumps will only
- // be written when WriteMinidump is called.
- // If port_name is non-NULL, attempt to perform out-of-process dump generation
- // If port_name is NULL, in-process dump generation will be used.
- ExceptionHandler(const string &dump_path,
- FilterCallback filter, MinidumpCallback callback,
- void *callback_context, bool install_handler,
- const char *port_name);
-
- // A special constructor if we want to bypass minidump writing and
- // simply get a callback with the exception information.
- ExceptionHandler(DirectCallback callback,
- void *callback_context,
- bool install_handler);
-
- ~ExceptionHandler();
-
- // Get and set the minidump path.
- string dump_path() const { return dump_path_; }
- void set_dump_path(const string &dump_path) {
- dump_path_ = dump_path;
- dump_path_c_ = dump_path_.c_str();
- UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_.
- }
-
- // Writes a minidump immediately. This can be used to capture the
- // execution state independently of a crash. Returns true on success.
- bool WriteMinidump() {
- return WriteMinidump(false);
- }
-
- bool WriteMinidump(bool write_exception_stream);
-
- // Convenience form of WriteMinidump which does not require an
- // ExceptionHandler instance.
- static bool WriteMinidump(const string &dump_path, MinidumpCallback callback,
- void *callback_context) {
- return WriteMinidump(dump_path, false, callback, callback_context);
- }
-
- static bool WriteMinidump(const string &dump_path,
- bool write_exception_stream,
- MinidumpCallback callback,
- void *callback_context);
-
- // Write a minidump of child immediately. This can be used to capture
- // the execution state of a child process independently of a crash.
- static bool WriteMinidumpForChild(mach_port_t child,
- mach_port_t child_blamed_thread,
- const std::string &dump_path,
- MinidumpCallback callback,
- void *callback_context);
-
- // Returns whether out-of-process dump generation is used or not.
- bool IsOutOfProcess() const {
-#if TARGET_OS_IPHONE
- return false;
-#else
- return crash_generation_client_.get() != NULL;
-#endif
- }
-
- private:
- // Install the mach exception handler
- bool InstallHandler();
-
- // Uninstall the mach exception handler (if any)
- bool UninstallHandler(bool in_exception);
-
- // Setup the handler thread, and if |install_handler| is true, install the
- // mach exception port handler
- bool Setup(bool install_handler);
-
- // Uninstall the mach exception handler (if any) and terminate the helper
- // thread
- bool Teardown();
-
- // Send a mach message to the exception handler. Return true on
- // success, false otherwise.
- bool SendMessageToHandlerThread(HandlerThreadMessage message_id);
-
- // All minidump writing goes through this one routine.
- // |task_context| can be NULL. If not, it will be used to retrieve the
- // context of the current thread, instead of using |thread_get_state|.
- bool WriteMinidumpWithException(int exception_type,
- int exception_code,
- int exception_subcode,
- breakpad_ucontext_t *task_context,
- mach_port_t thread_name,
- bool exit_after_write,
- bool report_current_thread);
-
- // When installed, this static function will be call from a newly created
- // pthread with |this| as the argument
- static void *WaitForMessage(void *exception_handler_class);
-
- // Signal handler for SIGABRT.
- static void SignalHandler(int sig, siginfo_t* info, void* uc);
-
- // disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
-
- // Generates a new ID and stores it in next_minidump_id_, and stores the
- // path of the next minidump to be written in next_minidump_path_.
- void UpdateNextID();
-
- // These functions will suspend/resume all threads except for the
- // reporting thread
- bool SuspendThreads();
- bool ResumeThreads();
-
- // The destination directory for the minidump
- string dump_path_;
-
- // The basename of the next minidump w/o extension
- string next_minidump_id_;
-
- // The full path to the next minidump to be written, including extension
- string next_minidump_path_;
-
- // Pointers to the UTF-8 versions of above
- const char *dump_path_c_;
- const char *next_minidump_id_c_;
- const char *next_minidump_path_c_;
-
- // The callback function and pointer to be passed back after the minidump
- // has been written
- FilterCallback filter_;
- MinidumpCallback callback_;
- void *callback_context_;
-
- // The callback function to be passed back when we don't want a minidump
- // file to be written
- DirectCallback directCallback_;
-
- // The thread that is created for the handler
- pthread_t handler_thread_;
-
- // The port that is waiting on an exception message to be sent, if the
- // handler is installed
- mach_port_t handler_port_;
-
- // These variables save the previous exception handler's data so that it
- // can be re-installed when this handler is uninstalled
- ExceptionParameters *previous_;
-
- // True, if we've installed the exception handler
- bool installed_exception_handler_;
-
- // True, if we're in the process of uninstalling the exception handler and
- // the thread.
- bool is_in_teardown_;
-
- // Save the last result of the last minidump
- bool last_minidump_write_result_;
-
- // A mutex for use when writing out a minidump that was requested on a
- // thread other than the exception handler.
- pthread_mutex_t minidump_write_mutex_;
-
- // True, if we're using the mutext to indicate when mindump writing occurs
- bool use_minidump_write_mutex_;
-
- // Old signal handler for SIGABRT. Used to be able to restore it when
- // uninstalling.
- scoped_ptr<struct sigaction> old_handler_;
-
-#if !TARGET_OS_IPHONE
- // Client for out-of-process dump generation.
- scoped_ptr<CrashGenerationClient> crash_generation_client_;
-#endif
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_MAC_HANDLER_EXCEPTION_HANDLER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/mach_vm_compat.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/mach_vm_compat.h
deleted file mode 100644
index 9e9028b928..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/mach_vm_compat.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_
-#define CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_
-
-#include <TargetConditionals.h>
-
-// On iOS 5 and higher, mach/mach_vm.h is not supported. Use the corresponding
-// vm_map functions instead.
-#if TARGET_OS_IPHONE
-#include <mach/vm_map.h>
-#define mach_vm_address_t vm_address_t
-#define mach_vm_deallocate vm_deallocate
-#define mach_vm_read vm_read
-#define mach_vm_region_recurse vm_region_recurse_64
-#define mach_vm_size_t vm_size_t
-#else
-#include <mach/mach_vm.h>
-#endif // TARGET_OS_IPHONE
-
-#endif // CLIENT_MAC_GENERATOR_MACH_VM_COMPAT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc
deleted file mode 100644
index 48cd2e99b6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.cc
+++ /dev/null
@@ -1,1604 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <algorithm>
-#include <cstdio>
-
-#include <mach/host_info.h>
-#include <mach/machine.h>
-#include <mach/vm_statistics.h>
-#include <mach-o/dyld.h>
-#include <mach-o/loader.h>
-#include <sys/sysctl.h>
-#include <sys/resource.h>
-
-#include <CoreFoundation/CoreFoundation.h>
-
-#include "client/mac/handler/minidump_generator.h"
-
-#if defined(HAS_ARM_SUPPORT) || defined(HAS_ARM64_SUPPORT)
-#include <mach/arm/thread_status.h>
-#endif
-#ifdef HAS_PPC_SUPPORT
-#include <mach/ppc/thread_status.h>
-#endif
-#ifdef HAS_X86_SUPPORT
-#include <mach/i386/thread_status.h>
-#endif
-
-#include "client/minidump_file_writer-inl.h"
-#include "common/mac/file_id.h"
-#include "common/mac/macho_id.h"
-#include "common/mac/string_utilities.h"
-
-using MacStringUtils::ConvertToString;
-using MacStringUtils::IntegerValueAtIndex;
-
-namespace google_breakpad {
-
-#if defined(__LP64__) && __LP64__
-#define LC_SEGMENT_ARCH LC_SEGMENT_64
-#else
-#define LC_SEGMENT_ARCH LC_SEGMENT
-#endif
-
-// constructor when generating from within the crashed process
-MinidumpGenerator::MinidumpGenerator()
- : writer_(),
- exception_type_(0),
- exception_code_(0),
- exception_subcode_(0),
- exception_thread_(0),
- crashing_task_(mach_task_self()),
- handler_thread_(mach_thread_self()),
- cpu_type_(DynamicImages::GetNativeCPUType()),
- task_context_(NULL),
- dynamic_images_(NULL),
- memory_blocks_(&allocator_) {
- GatherSystemInformation();
-}
-
-// constructor when generating from a different process than the
-// crashed process
-MinidumpGenerator::MinidumpGenerator(mach_port_t crashing_task,
- mach_port_t handler_thread)
- : writer_(),
- exception_type_(0),
- exception_code_(0),
- exception_subcode_(0),
- exception_thread_(0),
- crashing_task_(crashing_task),
- handler_thread_(handler_thread),
- cpu_type_(DynamicImages::GetNativeCPUType()),
- task_context_(NULL),
- dynamic_images_(NULL),
- memory_blocks_(&allocator_) {
- if (crashing_task != mach_task_self()) {
- dynamic_images_ = new DynamicImages(crashing_task_);
- cpu_type_ = dynamic_images_->GetCPUType();
- } else {
- dynamic_images_ = NULL;
- cpu_type_ = DynamicImages::GetNativeCPUType();
- }
-
- GatherSystemInformation();
-}
-
-MinidumpGenerator::~MinidumpGenerator() {
- delete dynamic_images_;
-}
-
-char MinidumpGenerator::build_string_[16];
-int MinidumpGenerator::os_major_version_ = 0;
-int MinidumpGenerator::os_minor_version_ = 0;
-int MinidumpGenerator::os_build_number_ = 0;
-
-// static
-void MinidumpGenerator::GatherSystemInformation() {
- // If this is non-zero, then we've already gathered the information
- if (os_major_version_)
- return;
-
- // This code extracts the version and build information from the OS
- CFStringRef vers_path =
- CFSTR("/System/Library/CoreServices/SystemVersion.plist");
- CFURLRef sys_vers =
- CFURLCreateWithFileSystemPath(NULL,
- vers_path,
- kCFURLPOSIXPathStyle,
- false);
- CFReadStreamRef read_stream = CFReadStreamCreateWithFile(NULL, sys_vers);
- CFRelease(sys_vers);
- if (!read_stream) {
- return;
- }
- if (!CFReadStreamOpen(read_stream)) {
- CFRelease(read_stream);
- return;
- }
- CFMutableDataRef data = NULL;
- while (true) {
- // Actual data file tests: Mac at 480 bytes and iOS at 413 bytes.
- const CFIndex kMaxBufferLength = 1024;
- UInt8 data_bytes[kMaxBufferLength];
- CFIndex num_bytes_read =
- CFReadStreamRead(read_stream, data_bytes, kMaxBufferLength);
- if (num_bytes_read < 0) {
- if (data) {
- CFRelease(data);
- data = NULL;
- }
- break;
- } else if (num_bytes_read == 0) {
- break;
- } else if (!data) {
- data = CFDataCreateMutable(NULL, 0);
- }
- CFDataAppendBytes(data, data_bytes, num_bytes_read);
- }
- CFReadStreamClose(read_stream);
- CFRelease(read_stream);
- if (!data) {
- return;
- }
- CFDictionaryRef list =
- static_cast<CFDictionaryRef>(CFPropertyListCreateWithData(
- NULL, data, kCFPropertyListImmutable, NULL, NULL));
- CFRelease(data);
- if (!list) {
- return;
- }
- CFStringRef build_version = static_cast<CFStringRef>
- (CFDictionaryGetValue(list, CFSTR("ProductBuildVersion")));
- CFStringRef product_version = static_cast<CFStringRef>
- (CFDictionaryGetValue(list, CFSTR("ProductVersion")));
- string build_str = ConvertToString(build_version);
- string product_str = ConvertToString(product_version);
-
- CFRelease(list);
-
- strlcpy(build_string_, build_str.c_str(), sizeof(build_string_));
-
- // Parse the string that looks like "10.4.8"
- os_major_version_ = IntegerValueAtIndex(product_str, 0);
- os_minor_version_ = IntegerValueAtIndex(product_str, 1);
- os_build_number_ = IntegerValueAtIndex(product_str, 2);
-}
-
-void MinidumpGenerator::SetTaskContext(breakpad_ucontext_t *task_context) {
- task_context_ = task_context;
-}
-
-string MinidumpGenerator::UniqueNameInDirectory(const string &dir,
- string *unique_name) {
- CFUUIDRef uuid = CFUUIDCreate(NULL);
- CFStringRef uuid_cfstr = CFUUIDCreateString(NULL, uuid);
- CFRelease(uuid);
- string file_name(ConvertToString(uuid_cfstr));
- CFRelease(uuid_cfstr);
- string path(dir);
-
- // Ensure that the directory (if non-empty) has a trailing slash so that
- // we can append the file name and have a valid pathname.
- if (!dir.empty()) {
- if (dir.at(dir.size() - 1) != '/')
- path.append(1, '/');
- }
-
- path.append(file_name);
- path.append(".dmp");
-
- if (unique_name)
- *unique_name = file_name;
-
- return path;
-}
-
-bool MinidumpGenerator::Write(const char *path) {
- WriteStreamFN writers[] = {
- &MinidumpGenerator::WriteThreadListStream,
- &MinidumpGenerator::WriteMemoryListStream,
- &MinidumpGenerator::WriteSystemInfoStream,
- &MinidumpGenerator::WriteModuleListStream,
- &MinidumpGenerator::WriteMiscInfoStream,
- &MinidumpGenerator::WriteBreakpadInfoStream,
- // Exception stream needs to be the last entry in this array as it may
- // be omitted in the case where the minidump is written without an
- // exception.
- &MinidumpGenerator::WriteExceptionStream,
- };
- bool result = false;
-
- // If opening was successful, create the header, directory, and call each
- // writer. The destructor for the TypedMDRVAs will cause the data to be
- // flushed. The destructor for the MinidumpFileWriter will close the file.
- if (writer_.Open(path)) {
- TypedMDRVA<MDRawHeader> header(&writer_);
- TypedMDRVA<MDRawDirectory> dir(&writer_);
-
- if (!header.Allocate())
- return false;
-
- int writer_count = static_cast<int>(sizeof(writers) / sizeof(writers[0]));
-
- // If we don't have exception information, don't write out the
- // exception stream
- if (!exception_thread_ && !exception_type_)
- --writer_count;
-
- // Add space for all writers
- if (!dir.AllocateArray(writer_count))
- return false;
-
- MDRawHeader *header_ptr = header.get();
- header_ptr->signature = MD_HEADER_SIGNATURE;
- header_ptr->version = MD_HEADER_VERSION;
- time(reinterpret_cast<time_t *>(&(header_ptr->time_date_stamp)));
- header_ptr->stream_count = writer_count;
- header_ptr->stream_directory_rva = dir.position();
-
- MDRawDirectory local_dir;
- result = true;
- for (int i = 0; (result) && (i < writer_count); ++i) {
- result = (this->*writers[i])(&local_dir);
-
- if (result)
- dir.CopyIndex(i, &local_dir);
- }
- }
- return result;
-}
-
-size_t MinidumpGenerator::CalculateStackSize(mach_vm_address_t start_addr) {
- mach_vm_address_t stack_region_base = start_addr;
- mach_vm_size_t stack_region_size;
- natural_t nesting_level = 0;
- vm_region_submap_info_64 submap_info;
- mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64;
-
- vm_region_recurse_info_t region_info;
- region_info = reinterpret_cast<vm_region_recurse_info_t>(&submap_info);
-
- if (start_addr == 0) {
- return 0;
- }
-
- kern_return_t result =
- mach_vm_region_recurse(crashing_task_, &stack_region_base,
- &stack_region_size, &nesting_level,
- region_info, &info_count);
-
- if (result != KERN_SUCCESS || start_addr < stack_region_base) {
- // Failure or stack corruption, since mach_vm_region had to go
- // higher in the process address space to find a valid region.
- return 0;
- }
-
- unsigned int tag = submap_info.user_tag;
-
- // If the user tag is VM_MEMORY_STACK, look for more readable regions with
- // the same tag placed immediately above the computed stack region. Under
- // some circumstances, the stack for thread 0 winds up broken up into
- // multiple distinct abutting regions. This can happen for several reasons,
- // including user code that calls setrlimit(RLIMIT_STACK, ...) or changes
- // the access on stack pages by calling mprotect.
- if (tag == VM_MEMORY_STACK) {
- while (true) {
- mach_vm_address_t next_region_base = stack_region_base +
- stack_region_size;
- mach_vm_address_t proposed_next_region_base = next_region_base;
- mach_vm_size_t next_region_size;
- nesting_level = 0;
- info_count = VM_REGION_SUBMAP_INFO_COUNT_64;
- result = mach_vm_region_recurse(crashing_task_, &next_region_base,
- &next_region_size, &nesting_level,
- region_info, &info_count);
- if (result != KERN_SUCCESS ||
- next_region_base != proposed_next_region_base ||
- submap_info.user_tag != tag ||
- (submap_info.protection & VM_PROT_READ) == 0) {
- break;
- }
-
- stack_region_size += next_region_size;
- }
- }
-
- return stack_region_base + stack_region_size - start_addr;
-}
-
-bool MinidumpGenerator::WriteStackFromStartAddress(
- mach_vm_address_t start_addr,
- MDMemoryDescriptor *stack_location) {
- UntypedMDRVA memory(&writer_);
-
- bool result = false;
- size_t size = CalculateStackSize(start_addr);
-
- if (size == 0) {
- // In some situations the stack address for the thread can come back 0.
- // In these cases we skip over the threads in question and stuff the
- // stack with a clearly borked value.
- start_addr = 0xDEADBEEF;
- size = 16;
- if (!memory.Allocate(size))
- return false;
-
- unsigned long long dummy_stack[2]; // Fill dummy stack with 16 bytes of
- // junk.
- dummy_stack[0] = 0xDEADBEEF;
- dummy_stack[1] = 0xDEADBEEF;
-
- result = memory.Copy(dummy_stack, size);
- } else {
-
- if (!memory.Allocate(size))
- return false;
-
- if (dynamic_images_) {
- vector<uint8_t> stack_memory;
- if (ReadTaskMemory(crashing_task_,
- start_addr,
- size,
- stack_memory) != KERN_SUCCESS) {
- return false;
- }
-
- result = memory.Copy(&stack_memory[0], size);
- } else {
- result = memory.Copy(reinterpret_cast<const void *>(start_addr), size);
- }
- }
-
- stack_location->start_of_memory_range = start_addr;
- stack_location->memory = memory.location();
-
- return result;
-}
-
-bool MinidumpGenerator::WriteStack(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- switch (cpu_type_) {
-#ifdef HAS_ARM_SUPPORT
- case CPU_TYPE_ARM:
- return WriteStackARM(state, stack_location);
-#endif
-#ifdef HAS_ARM64_SUPPORT
- case CPU_TYPE_ARM64:
- return WriteStackARM64(state, stack_location);
-#endif
-#ifdef HAS_PPC_SUPPORT
- case CPU_TYPE_POWERPC:
- return WriteStackPPC(state, stack_location);
- case CPU_TYPE_POWERPC64:
- return WriteStackPPC64(state, stack_location);
-#endif
-#ifdef HAS_X86_SUPPORT
- case CPU_TYPE_I386:
- return WriteStackX86(state, stack_location);
- case CPU_TYPE_X86_64:
- return WriteStackX86_64(state, stack_location);
-#endif
- default:
- return false;
- }
-}
-
-bool MinidumpGenerator::WriteContext(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location) {
- switch (cpu_type_) {
-#ifdef HAS_ARM_SUPPORT
- case CPU_TYPE_ARM:
- return WriteContextARM(state, register_location);
-#endif
-#ifdef HAS_ARM64_SUPPORT
- case CPU_TYPE_ARM64:
- return WriteContextARM64(state, register_location);
-#endif
-#ifdef HAS_PPC_SUPPORT
- case CPU_TYPE_POWERPC:
- return WriteContextPPC(state, register_location);
- case CPU_TYPE_POWERPC64:
- return WriteContextPPC64(state, register_location);
-#endif
-#ifdef HAS_X86_SUPPORT
- case CPU_TYPE_I386:
- return WriteContextX86(state, register_location);
- case CPU_TYPE_X86_64:
- return WriteContextX86_64(state, register_location);
-#endif
- default:
- return false;
- }
-}
-
-uint64_t MinidumpGenerator::CurrentPCForStack(
- breakpad_thread_state_data_t state) {
- switch (cpu_type_) {
-#ifdef HAS_ARM_SUPPORT
- case CPU_TYPE_ARM:
- return CurrentPCForStackARM(state);
-#endif
-#ifdef HAS_ARM64_SUPPORT
- case CPU_TYPE_ARM64:
- return CurrentPCForStackARM64(state);
-#endif
-#ifdef HAS_PPC_SUPPORT
- case CPU_TYPE_POWERPC:
- return CurrentPCForStackPPC(state);
- case CPU_TYPE_POWERPC64:
- return CurrentPCForStackPPC64(state);
-#endif
-#ifdef HAS_X86_SUPPORT
- case CPU_TYPE_I386:
- return CurrentPCForStackX86(state);
- case CPU_TYPE_X86_64:
- return CurrentPCForStackX86_64(state);
-#endif
- default:
- assert(0 && "Unknown CPU type!");
- return 0;
- }
-}
-
-#ifdef HAS_ARM_SUPPORT
-bool MinidumpGenerator::WriteStackARM(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- arm_thread_state_t *machine_state =
- reinterpret_cast<arm_thread_state_t *>(state);
- mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp);
- return WriteStackFromStartAddress(start_addr, stack_location);
-}
-
-uint64_t
-MinidumpGenerator::CurrentPCForStackARM(breakpad_thread_state_data_t state) {
- arm_thread_state_t *machine_state =
- reinterpret_cast<arm_thread_state_t *>(state);
-
- return REGISTER_FROM_THREADSTATE(machine_state, pc);
-}
-
-bool MinidumpGenerator::WriteContextARM(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
-{
- TypedMDRVA<MDRawContextARM> context(&writer_);
- arm_thread_state_t *machine_state =
- reinterpret_cast<arm_thread_state_t *>(state);
-
- if (!context.Allocate())
- return false;
-
- *register_location = context.location();
- MDRawContextARM *context_ptr = context.get();
- context_ptr->context_flags = MD_CONTEXT_ARM_FULL;
-
-#define AddGPR(a) context_ptr->iregs[a] = REGISTER_FROM_THREADSTATE(machine_state, r[a])
-
- context_ptr->iregs[13] = REGISTER_FROM_THREADSTATE(machine_state, sp);
- context_ptr->iregs[14] = REGISTER_FROM_THREADSTATE(machine_state, lr);
- context_ptr->iregs[15] = REGISTER_FROM_THREADSTATE(machine_state, pc);
- context_ptr->cpsr = REGISTER_FROM_THREADSTATE(machine_state, cpsr);
-
- AddGPR(0);
- AddGPR(1);
- AddGPR(2);
- AddGPR(3);
- AddGPR(4);
- AddGPR(5);
- AddGPR(6);
- AddGPR(7);
- AddGPR(8);
- AddGPR(9);
- AddGPR(10);
- AddGPR(11);
- AddGPR(12);
-#undef AddGPR
-
- return true;
-}
-#endif
-
-#ifdef HAS_ARM64_SUPPORT
-bool MinidumpGenerator::WriteStackARM64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- arm_thread_state64_t *machine_state =
- reinterpret_cast<arm_thread_state64_t *>(state);
- mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, sp);
- return WriteStackFromStartAddress(start_addr, stack_location);
-}
-
-uint64_t
-MinidumpGenerator::CurrentPCForStackARM64(breakpad_thread_state_data_t state) {
- arm_thread_state64_t *machine_state =
- reinterpret_cast<arm_thread_state64_t *>(state);
-
- return REGISTER_FROM_THREADSTATE(machine_state, pc);
-}
-
-bool
-MinidumpGenerator::WriteContextARM64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
-{
- TypedMDRVA<MDRawContextARM64> context(&writer_);
- arm_thread_state64_t *machine_state =
- reinterpret_cast<arm_thread_state64_t *>(state);
-
- if (!context.Allocate())
- return false;
-
- *register_location = context.location();
- MDRawContextARM64 *context_ptr = context.get();
- context_ptr->context_flags = MD_CONTEXT_ARM64_FULL;
-
-#define AddGPR(a) context_ptr->iregs[a] = \
- REGISTER_FROM_THREADSTATE(machine_state, x[a])
-
- context_ptr->iregs[29] = REGISTER_FROM_THREADSTATE(machine_state, fp);
- context_ptr->iregs[30] = REGISTER_FROM_THREADSTATE(machine_state, lr);
- context_ptr->iregs[31] = REGISTER_FROM_THREADSTATE(machine_state, sp);
- context_ptr->iregs[32] = REGISTER_FROM_THREADSTATE(machine_state, pc);
- context_ptr->cpsr = REGISTER_FROM_THREADSTATE(machine_state, cpsr);
-
- AddGPR(0);
- AddGPR(1);
- AddGPR(2);
- AddGPR(3);
- AddGPR(4);
- AddGPR(5);
- AddGPR(6);
- AddGPR(7);
- AddGPR(8);
- AddGPR(9);
- AddGPR(10);
- AddGPR(11);
- AddGPR(12);
- AddGPR(13);
- AddGPR(14);
- AddGPR(15);
- AddGPR(16);
- AddGPR(17);
- AddGPR(18);
- AddGPR(19);
- AddGPR(20);
- AddGPR(21);
- AddGPR(22);
- AddGPR(23);
- AddGPR(24);
- AddGPR(25);
- AddGPR(26);
- AddGPR(27);
- AddGPR(28);
-#undef AddGPR
-
- return true;
-}
-#endif
-
-#ifdef HAS_PCC_SUPPORT
-bool MinidumpGenerator::WriteStackPPC(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- ppc_thread_state_t *machine_state =
- reinterpret_cast<ppc_thread_state_t *>(state);
- mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1);
- return WriteStackFromStartAddress(start_addr, stack_location);
-}
-
-bool MinidumpGenerator::WriteStackPPC64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- ppc_thread_state64_t *machine_state =
- reinterpret_cast<ppc_thread_state64_t *>(state);
- mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, r1);
- return WriteStackFromStartAddress(start_addr, stack_location);
-}
-
-uint64_t
-MinidumpGenerator::CurrentPCForStackPPC(breakpad_thread_state_data_t state) {
- ppc_thread_state_t *machine_state =
- reinterpret_cast<ppc_thread_state_t *>(state);
-
- return REGISTER_FROM_THREADSTATE(machine_state, srr0);
-}
-
-uint64_t
-MinidumpGenerator::CurrentPCForStackPPC64(breakpad_thread_state_data_t state) {
- ppc_thread_state64_t *machine_state =
- reinterpret_cast<ppc_thread_state64_t *>(state);
-
- return REGISTER_FROM_THREADSTATE(machine_state, srr0);
-}
-
-bool MinidumpGenerator::WriteContextPPC(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
-{
- TypedMDRVA<MDRawContextPPC> context(&writer_);
- ppc_thread_state_t *machine_state =
- reinterpret_cast<ppc_thread_state_t *>(state);
-
- if (!context.Allocate())
- return false;
-
- *register_location = context.location();
- MDRawContextPPC *context_ptr = context.get();
- context_ptr->context_flags = MD_CONTEXT_PPC_BASE;
-
-#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
- REGISTER_FROM_THREADSTATE(machine_state, a))
-#define AddGPR(a) context_ptr->gpr[a] = \
- static_cast<__typeof__(context_ptr->a)>( \
- REGISTER_FROM_THREADSTATE(machine_state, r ## a)
-
- AddReg(srr0);
- AddReg(cr);
- AddReg(xer);
- AddReg(ctr);
- AddReg(lr);
- AddReg(vrsave);
-
- AddGPR(0);
- AddGPR(1);
- AddGPR(2);
- AddGPR(3);
- AddGPR(4);
- AddGPR(5);
- AddGPR(6);
- AddGPR(7);
- AddGPR(8);
- AddGPR(9);
- AddGPR(10);
- AddGPR(11);
- AddGPR(12);
- AddGPR(13);
- AddGPR(14);
- AddGPR(15);
- AddGPR(16);
- AddGPR(17);
- AddGPR(18);
- AddGPR(19);
- AddGPR(20);
- AddGPR(21);
- AddGPR(22);
- AddGPR(23);
- AddGPR(24);
- AddGPR(25);
- AddGPR(26);
- AddGPR(27);
- AddGPR(28);
- AddGPR(29);
- AddGPR(30);
- AddGPR(31);
- AddReg(mq);
-#undef AddReg
-#undef AddGPR
-
- return true;
-}
-
-bool MinidumpGenerator::WriteContextPPC64(
- breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location) {
- TypedMDRVA<MDRawContextPPC64> context(&writer_);
- ppc_thread_state64_t *machine_state =
- reinterpret_cast<ppc_thread_state64_t *>(state);
-
- if (!context.Allocate())
- return false;
-
- *register_location = context.location();
- MDRawContextPPC64 *context_ptr = context.get();
- context_ptr->context_flags = MD_CONTEXT_PPC_BASE;
-
-#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
- REGISTER_FROM_THREADSTATE(machine_state, a))
-#define AddGPR(a) context_ptr->gpr[a] = \
- static_cast<__typeof__(context_ptr->a)>( \
- REGISTER_FROM_THREADSTATE(machine_state, r ## a)
-
- AddReg(srr0);
- AddReg(cr);
- AddReg(xer);
- AddReg(ctr);
- AddReg(lr);
- AddReg(vrsave);
-
- AddGPR(0);
- AddGPR(1);
- AddGPR(2);
- AddGPR(3);
- AddGPR(4);
- AddGPR(5);
- AddGPR(6);
- AddGPR(7);
- AddGPR(8);
- AddGPR(9);
- AddGPR(10);
- AddGPR(11);
- AddGPR(12);
- AddGPR(13);
- AddGPR(14);
- AddGPR(15);
- AddGPR(16);
- AddGPR(17);
- AddGPR(18);
- AddGPR(19);
- AddGPR(20);
- AddGPR(21);
- AddGPR(22);
- AddGPR(23);
- AddGPR(24);
- AddGPR(25);
- AddGPR(26);
- AddGPR(27);
- AddGPR(28);
- AddGPR(29);
- AddGPR(30);
- AddGPR(31);
-#undef AddReg
-#undef AddGPR
-
- return true;
-}
-
-#endif
-
-#ifdef HAS_X86_SUPPORT
-bool MinidumpGenerator::WriteStackX86(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- i386_thread_state_t *machine_state =
- reinterpret_cast<i386_thread_state_t *>(state);
-
- mach_vm_address_t start_addr = REGISTER_FROM_THREADSTATE(machine_state, esp);
- return WriteStackFromStartAddress(start_addr, stack_location);
-}
-
-bool MinidumpGenerator::WriteStackX86_64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location) {
- x86_thread_state64_t *machine_state =
- reinterpret_cast<x86_thread_state64_t *>(state);
-
- mach_vm_address_t start_addr = static_cast<mach_vm_address_t>(
- REGISTER_FROM_THREADSTATE(machine_state, rsp));
- return WriteStackFromStartAddress(start_addr, stack_location);
-}
-
-uint64_t
-MinidumpGenerator::CurrentPCForStackX86(breakpad_thread_state_data_t state) {
- i386_thread_state_t *machine_state =
- reinterpret_cast<i386_thread_state_t *>(state);
-
- return REGISTER_FROM_THREADSTATE(machine_state, eip);
-}
-
-uint64_t
-MinidumpGenerator::CurrentPCForStackX86_64(breakpad_thread_state_data_t state) {
- x86_thread_state64_t *machine_state =
- reinterpret_cast<x86_thread_state64_t *>(state);
-
- return REGISTER_FROM_THREADSTATE(machine_state, rip);
-}
-
-bool MinidumpGenerator::WriteContextX86(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location)
-{
- TypedMDRVA<MDRawContextX86> context(&writer_);
- i386_thread_state_t *machine_state =
- reinterpret_cast<i386_thread_state_t *>(state);
-
- if (!context.Allocate())
- return false;
-
- *register_location = context.location();
- MDRawContextX86 *context_ptr = context.get();
-
-#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
- REGISTER_FROM_THREADSTATE(machine_state, a))
-
- context_ptr->context_flags = MD_CONTEXT_X86;
- AddReg(eax);
- AddReg(ebx);
- AddReg(ecx);
- AddReg(edx);
- AddReg(esi);
- AddReg(edi);
- AddReg(ebp);
- AddReg(esp);
-
- AddReg(cs);
- AddReg(ds);
- AddReg(ss);
- AddReg(es);
- AddReg(fs);
- AddReg(gs);
- AddReg(eflags);
-
- AddReg(eip);
-#undef AddReg
-
- return true;
-}
-
-bool MinidumpGenerator::WriteContextX86_64(
- breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location) {
- TypedMDRVA<MDRawContextAMD64> context(&writer_);
- x86_thread_state64_t *machine_state =
- reinterpret_cast<x86_thread_state64_t *>(state);
-
- if (!context.Allocate())
- return false;
-
- *register_location = context.location();
- MDRawContextAMD64 *context_ptr = context.get();
-
-#define AddReg(a) context_ptr->a = static_cast<__typeof__(context_ptr->a)>( \
- REGISTER_FROM_THREADSTATE(machine_state, a))
-
- context_ptr->context_flags = MD_CONTEXT_AMD64;
- AddReg(rax);
- AddReg(rbx);
- AddReg(rcx);
- AddReg(rdx);
- AddReg(rdi);
- AddReg(rsi);
- AddReg(rbp);
- AddReg(rsp);
- AddReg(r8);
- AddReg(r9);
- AddReg(r10);
- AddReg(r11);
- AddReg(r12);
- AddReg(r13);
- AddReg(r14);
- AddReg(r15);
- AddReg(rip);
- // according to AMD's software developer guide, bits above 18 are
- // not used in the flags register. Since the minidump format
- // specifies 32 bits for the flags register, we can truncate safely
- // with no loss.
- context_ptr->eflags = static_cast<uint32_t>(REGISTER_FROM_THREADSTATE(machine_state, rflags));
- AddReg(cs);
- AddReg(fs);
- AddReg(gs);
-#undef AddReg
-
- return true;
-}
-#endif
-
-bool MinidumpGenerator::GetThreadState(thread_act_t target_thread,
- thread_state_t state,
- mach_msg_type_number_t *count) {
- if (task_context_ && target_thread == mach_thread_self()) {
- switch (cpu_type_) {
-#ifdef HAS_ARM_SUPPORT
- case CPU_TYPE_ARM:
- size_t final_size =
- std::min(static_cast<size_t>(*count), sizeof(arm_thread_state_t));
- memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size);
- *count = static_cast<mach_msg_type_number_t>(final_size);
- return true;
-#endif
-#ifdef HAS_ARM64_SUPPORT
- case CPU_TYPE_ARM64: {
- size_t final_size =
- std::min(static_cast<size_t>(*count), sizeof(arm_thread_state64_t));
- memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size);
- *count = static_cast<mach_msg_type_number_t>(final_size);
- return true;
- }
-#endif
-#ifdef HAS_X86_SUPPORT
- case CPU_TYPE_I386:
- case CPU_TYPE_X86_64: {
- size_t state_size = cpu_type_ == CPU_TYPE_I386 ?
- sizeof(i386_thread_state_t) : sizeof(x86_thread_state64_t);
- size_t final_size =
- std::min(static_cast<size_t>(*count), state_size);
- memcpy(state, &task_context_->breakpad_uc_mcontext->__ss, final_size);
- *count = static_cast<mach_msg_type_number_t>(final_size);
- return true;
- }
-#endif
- }
- }
-
- thread_state_flavor_t flavor;
- switch (cpu_type_) {
-#ifdef HAS_ARM_SUPPORT
- case CPU_TYPE_ARM:
- flavor = ARM_THREAD_STATE;
- break;
-#endif
-#ifdef HAS_ARM64_SUPPORT
- case CPU_TYPE_ARM64:
- flavor = ARM_THREAD_STATE64;
- break;
-#endif
-#ifdef HAS_PPC_SUPPORT
- case CPU_TYPE_POWERPC:
- flavor = PPC_THREAD_STATE;
- break;
- case CPU_TYPE_POWERPC64:
- flavor = PPC_THREAD_STATE64;
- break;
-#endif
-#ifdef HAS_X86_SUPPORT
- case CPU_TYPE_I386:
- flavor = i386_THREAD_STATE;
- break;
- case CPU_TYPE_X86_64:
- flavor = x86_THREAD_STATE64;
- break;
-#endif
- default:
- return false;
- }
- return thread_get_state(target_thread, flavor,
- state, count) == KERN_SUCCESS;
-}
-
-bool MinidumpGenerator::WriteThreadStream(mach_port_t thread_id,
- MDRawThread *thread) {
- breakpad_thread_state_data_t state;
- mach_msg_type_number_t state_count
- = static_cast<mach_msg_type_number_t>(sizeof(state));
-
- if (GetThreadState(thread_id, state, &state_count)) {
- if (!WriteStack(state, &thread->stack))
- return false;
-
- memory_blocks_.push_back(thread->stack);
-
- if (!WriteContext(state, &thread->thread_context))
- return false;
-
- thread->thread_id = thread_id;
- } else {
- return false;
- }
-
- return true;
-}
-
-bool MinidumpGenerator::WriteThreadListStream(
- MDRawDirectory *thread_list_stream) {
- TypedMDRVA<MDRawThreadList> list(&writer_);
- thread_act_port_array_t threads_for_task;
- mach_msg_type_number_t thread_count;
- int non_generator_thread_count;
-
- if (task_threads(crashing_task_, &threads_for_task, &thread_count))
- return false;
-
- // Don't include the generator thread
- if (handler_thread_ != MACH_PORT_NULL)
- non_generator_thread_count = thread_count - 1;
- else
- non_generator_thread_count = thread_count;
- if (!list.AllocateObjectAndArray(non_generator_thread_count,
- sizeof(MDRawThread)))
- return false;
-
- thread_list_stream->stream_type = MD_THREAD_LIST_STREAM;
- thread_list_stream->location = list.location();
-
- list.get()->number_of_threads = non_generator_thread_count;
-
- MDRawThread thread;
- int thread_idx = 0;
-
- for (unsigned int i = 0; i < thread_count; ++i) {
- memset(&thread, 0, sizeof(MDRawThread));
-
- if (threads_for_task[i] != handler_thread_) {
- if (!WriteThreadStream(threads_for_task[i], &thread))
- return false;
-
- list.CopyIndexAfterObject(thread_idx++, &thread, sizeof(MDRawThread));
- }
- }
-
- return true;
-}
-
-bool MinidumpGenerator::WriteMemoryListStream(
- MDRawDirectory *memory_list_stream) {
- TypedMDRVA<MDRawMemoryList> list(&writer_);
-
- // If the dump has an exception, include some memory around the
- // instruction pointer.
- const size_t kIPMemorySize = 256; // bytes
- bool have_ip_memory = false;
- MDMemoryDescriptor ip_memory_d;
- if (exception_thread_ && exception_type_) {
- breakpad_thread_state_data_t state;
- mach_msg_type_number_t stateCount
- = static_cast<mach_msg_type_number_t>(sizeof(state));
-
- if (GetThreadState(exception_thread_, state, &stateCount)) {
- uint64_t ip = CurrentPCForStack(state);
- // Bound it to the upper and lower bounds of the region
- // it's contained within. If it's not in a known memory region,
- // don't bother trying to write it.
- mach_vm_address_t addr = static_cast<vm_address_t>(ip);
- mach_vm_size_t size;
- natural_t nesting_level = 0;
- vm_region_submap_info_64 info;
- mach_msg_type_number_t info_count = VM_REGION_SUBMAP_INFO_COUNT_64;
- vm_region_recurse_info_t recurse_info;
- recurse_info = reinterpret_cast<vm_region_recurse_info_t>(&info);
-
- kern_return_t ret =
- mach_vm_region_recurse(crashing_task_,
- &addr,
- &size,
- &nesting_level,
- recurse_info,
- &info_count);
- if (ret == KERN_SUCCESS && ip >= addr && ip < (addr + size)) {
- // Try to get 128 bytes before and after the IP, but
- // settle for whatever's available.
- ip_memory_d.start_of_memory_range =
- std::max(uintptr_t(addr),
- uintptr_t(ip - (kIPMemorySize / 2)));
- uintptr_t end_of_range =
- std::min(uintptr_t(ip + (kIPMemorySize / 2)),
- uintptr_t(addr + size));
- uintptr_t range_diff = end_of_range -
- static_cast<uintptr_t>(ip_memory_d.start_of_memory_range);
- ip_memory_d.memory.data_size = static_cast<uint32_t>(range_diff);
- have_ip_memory = true;
- // This needs to get appended to the list even though
- // the memory bytes aren't filled in yet so the entire
- // list can be written first. The memory bytes will get filled
- // in after the memory list is written.
- memory_blocks_.push_back(ip_memory_d);
- }
- }
- }
-
- // Now fill in the memory list and write it.
- size_t memory_count = memory_blocks_.size();
- if (!list.AllocateObjectAndArray(memory_count,
- sizeof(MDMemoryDescriptor)))
- return false;
-
- memory_list_stream->stream_type = MD_MEMORY_LIST_STREAM;
- memory_list_stream->location = list.location();
-
- list.get()->number_of_memory_ranges = static_cast<uint32_t>(memory_count);
-
- unsigned int i;
- for (i = 0; i < memory_count; ++i) {
- list.CopyIndexAfterObject(i, &memory_blocks_[i],
- sizeof(MDMemoryDescriptor));
- }
-
- if (have_ip_memory) {
- // Now read the memory around the instruction pointer.
- UntypedMDRVA ip_memory(&writer_);
- if (!ip_memory.Allocate(ip_memory_d.memory.data_size))
- return false;
-
- if (dynamic_images_) {
- // Out-of-process.
- vector<uint8_t> memory;
- if (ReadTaskMemory(crashing_task_,
- ip_memory_d.start_of_memory_range,
- ip_memory_d.memory.data_size,
- memory) != KERN_SUCCESS) {
- return false;
- }
-
- ip_memory.Copy(&memory[0], ip_memory_d.memory.data_size);
- } else {
- // In-process, just copy from local memory.
- ip_memory.Copy(
- reinterpret_cast<const void *>(ip_memory_d.start_of_memory_range),
- ip_memory_d.memory.data_size);
- }
-
- ip_memory_d.memory = ip_memory.location();
- // Write this again now that the data location is filled in.
- list.CopyIndexAfterObject(i - 1, &ip_memory_d,
- sizeof(MDMemoryDescriptor));
- }
-
- return true;
-}
-
-bool
-MinidumpGenerator::WriteExceptionStream(MDRawDirectory *exception_stream) {
- TypedMDRVA<MDRawExceptionStream> exception(&writer_);
-
- if (!exception.Allocate())
- return false;
-
- exception_stream->stream_type = MD_EXCEPTION_STREAM;
- exception_stream->location = exception.location();
- MDRawExceptionStream *exception_ptr = exception.get();
- exception_ptr->thread_id = exception_thread_;
-
- // This naming is confusing, but it is the proper translation from
- // mach naming to minidump naming.
- exception_ptr->exception_record.exception_code = exception_type_;
- exception_ptr->exception_record.exception_flags = exception_code_;
-
- breakpad_thread_state_data_t state;
- mach_msg_type_number_t state_count
- = static_cast<mach_msg_type_number_t>(sizeof(state));
-
- if (!GetThreadState(exception_thread_, state, &state_count))
- return false;
-
- if (!WriteContext(state, &exception_ptr->thread_context))
- return false;
-
- if (exception_type_ == EXC_BAD_ACCESS)
- exception_ptr->exception_record.exception_address = exception_subcode_;
- else
- exception_ptr->exception_record.exception_address = CurrentPCForStack(state);
-
- return true;
-}
-
-bool MinidumpGenerator::WriteSystemInfoStream(
- MDRawDirectory *system_info_stream) {
- TypedMDRVA<MDRawSystemInfo> info(&writer_);
-
- if (!info.Allocate())
- return false;
-
- system_info_stream->stream_type = MD_SYSTEM_INFO_STREAM;
- system_info_stream->location = info.location();
-
- // CPU Information
- uint32_t number_of_processors;
- size_t len = sizeof(number_of_processors);
- sysctlbyname("hw.ncpu", &number_of_processors, &len, NULL, 0);
- MDRawSystemInfo *info_ptr = info.get();
-
- switch (cpu_type_) {
-#ifdef HAS_ARM_SUPPORT
- case CPU_TYPE_ARM:
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM;
- break;
-#endif
-#ifdef HAS_ARM64_SUPPORT
- case CPU_TYPE_ARM64:
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_ARM64;
- break;
-#endif
-#ifdef HAS_PPC_SUPPORT
- case CPU_TYPE_POWERPC:
- case CPU_TYPE_POWERPC64:
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_PPC;
- break;
-#endif
-#ifdef HAS_X86_SUPPORT
- case CPU_TYPE_I386:
- case CPU_TYPE_X86_64:
- if (cpu_type_ == CPU_TYPE_I386)
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_X86;
- else
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_AMD64;
-#ifdef __i386__
- // ebx is used for PIC code, so we need
- // to preserve it.
-#define cpuid(op,eax,ebx,ecx,edx) \
- asm ("pushl %%ebx \n\t" \
- "cpuid \n\t" \
- "movl %%ebx,%1 \n\t" \
- "popl %%ebx" \
- : "=a" (eax), \
- "=g" (ebx), \
- "=c" (ecx), \
- "=d" (edx) \
- : "0" (op))
-#elif defined(__x86_64__)
-
-#define cpuid(op,eax,ebx,ecx,edx) \
- asm ("cpuid \n\t" \
- : "=a" (eax), \
- "=b" (ebx), \
- "=c" (ecx), \
- "=d" (edx) \
- : "0" (op))
-#endif
-
-#if defined(__i386__) || defined(__x86_64__)
- int unused, unused2;
- // get vendor id
- cpuid(0, unused, info_ptr->cpu.x86_cpu_info.vendor_id[0],
- info_ptr->cpu.x86_cpu_info.vendor_id[2],
- info_ptr->cpu.x86_cpu_info.vendor_id[1]);
- // get version and feature info
- cpuid(1, info_ptr->cpu.x86_cpu_info.version_information, unused, unused2,
- info_ptr->cpu.x86_cpu_info.feature_information);
-
- // family
- info_ptr->processor_level =
- (info_ptr->cpu.x86_cpu_info.version_information & 0xF00) >> 8;
- // 0xMMSS (Model, Stepping)
- info_ptr->processor_revision = static_cast<uint16_t>(
- (info_ptr->cpu.x86_cpu_info.version_information & 0xF) |
- ((info_ptr->cpu.x86_cpu_info.version_information & 0xF0) << 4));
-
- // decode extended model info
- if (info_ptr->processor_level == 0xF ||
- info_ptr->processor_level == 0x6) {
- info_ptr->processor_revision |=
- ((info_ptr->cpu.x86_cpu_info.version_information & 0xF0000) >> 4);
- }
-
- // decode extended family info
- if (info_ptr->processor_level == 0xF) {
- info_ptr->processor_level +=
- ((info_ptr->cpu.x86_cpu_info.version_information & 0xFF00000) >> 20);
- }
-
-#endif // __i386__ || __x86_64_
- break;
-#endif // HAS_X86_SUPPORT
- default:
- info_ptr->processor_architecture = MD_CPU_ARCHITECTURE_UNKNOWN;
- break;
- }
-
- info_ptr->number_of_processors = static_cast<uint8_t>(number_of_processors);
-#if TARGET_OS_IPHONE
- info_ptr->platform_id = MD_OS_IOS;
-#else
- info_ptr->platform_id = MD_OS_MAC_OS_X;
-#endif // TARGET_OS_IPHONE
-
- MDLocationDescriptor build_string_loc;
-
- if (!writer_.WriteString(build_string_, 0,
- &build_string_loc))
- return false;
-
- info_ptr->csd_version_rva = build_string_loc.rva;
- info_ptr->major_version = os_major_version_;
- info_ptr->minor_version = os_minor_version_;
- info_ptr->build_number = os_build_number_;
-
- return true;
-}
-
-bool MinidumpGenerator::WriteModuleStream(unsigned int index,
- MDRawModule *module) {
- if (dynamic_images_) {
- // we're in a different process than the crashed process
- DynamicImage *image = dynamic_images_->GetImage(index);
-
- if (!image)
- return false;
-
- memset(module, 0, sizeof(MDRawModule));
-
- MDLocationDescriptor string_location;
-
- string name = image->GetFilePath();
- if (!writer_.WriteString(name.c_str(), 0, &string_location))
- return false;
-
- module->base_of_image = image->GetVMAddr() + image->GetVMAddrSlide();
- module->size_of_image = static_cast<uint32_t>(image->GetVMSize());
- module->module_name_rva = string_location.rva;
-
- // We'll skip the executable module, because they don't have
- // LC_ID_DYLIB load commands, and the crash processing server gets
- // version information from the Plist file, anyway.
- if (index != static_cast<uint32_t>(FindExecutableModule())) {
- module->version_info.signature = MD_VSFIXEDFILEINFO_SIGNATURE;
- module->version_info.struct_version |= MD_VSFIXEDFILEINFO_VERSION;
- // Convert MAC dylib version format, which is a 32 bit number, to the
- // format used by minidump. The mac format is <16 bits>.<8 bits>.<8 bits>
- // so it fits nicely into the windows version with some massaging
- // The mapping is:
- // 1) upper 16 bits of MAC version go to lower 16 bits of product HI
- // 2) Next most significant 8 bits go to upper 16 bits of product LO
- // 3) Least significant 8 bits go to lower 16 bits of product LO
- uint32_t modVersion = image->GetVersion();
- module->version_info.file_version_hi = 0;
- module->version_info.file_version_hi = modVersion >> 16;
- module->version_info.file_version_lo |= (modVersion & 0xff00) << 8;
- module->version_info.file_version_lo |= (modVersion & 0xff);
- }
-
- if (!WriteCVRecord(module, image->GetCPUType(), name.c_str(), false)) {
- return false;
- }
- } else {
- // Getting module info in the crashed process
- const breakpad_mach_header *header;
- header = (breakpad_mach_header*)_dyld_get_image_header(index);
- if (!header)
- return false;
-
-#ifdef __LP64__
- assert(header->magic == MH_MAGIC_64);
-
- if(header->magic != MH_MAGIC_64)
- return false;
-#else
- assert(header->magic == MH_MAGIC);
-
- if(header->magic != MH_MAGIC)
- return false;
-#endif
-
- int cpu_type = header->cputype;
- unsigned long slide = _dyld_get_image_vmaddr_slide(index);
- const char* name = _dyld_get_image_name(index);
- const struct load_command *cmd =
- reinterpret_cast<const struct load_command *>(header + 1);
-
- memset(module, 0, sizeof(MDRawModule));
-
- for (unsigned int i = 0; cmd && (i < header->ncmds); i++) {
- if (cmd->cmd == LC_SEGMENT_ARCH) {
-
- const breakpad_mach_segment_command *seg =
- reinterpret_cast<const breakpad_mach_segment_command *>(cmd);
-
- if (!strcmp(seg->segname, "__TEXT")) {
- MDLocationDescriptor string_location;
-
- if (!writer_.WriteString(name, 0, &string_location))
- return false;
-
- module->base_of_image = seg->vmaddr + slide;
- module->size_of_image = static_cast<uint32_t>(seg->vmsize);
- module->module_name_rva = string_location.rva;
-
- bool in_memory = false;
-#if TARGET_OS_IPHONE
- in_memory = true;
-#endif
- if (!WriteCVRecord(module, cpu_type, name, in_memory))
- return false;
-
- return true;
- }
- }
-
- cmd = reinterpret_cast<struct load_command*>((char *)cmd + cmd->cmdsize);
- }
- }
-
- return true;
-}
-
-int MinidumpGenerator::FindExecutableModule() {
- if (dynamic_images_) {
- int index = dynamic_images_->GetExecutableImageIndex();
-
- if (index >= 0) {
- return index;
- }
- } else {
- int image_count = _dyld_image_count();
- const struct mach_header *header;
-
- for (int index = 0; index < image_count; ++index) {
- header = _dyld_get_image_header(index);
-
- if (header->filetype == MH_EXECUTE)
- return index;
- }
- }
-
- // failed - just use the first image
- return 0;
-}
-
-bool MinidumpGenerator::WriteCVRecord(MDRawModule *module, int cpu_type,
- const char *module_path, bool in_memory) {
- TypedMDRVA<MDCVInfoPDB70> cv(&writer_);
-
- // Only return the last path component of the full module path
- const char *module_name = strrchr(module_path, '/');
-
- // Increment past the slash
- if (module_name)
- ++module_name;
- else
- module_name = "<Unknown>";
-
- size_t module_name_length = strlen(module_name);
-
- if (!cv.AllocateObjectAndArray(module_name_length + 1, sizeof(uint8_t)))
- return false;
-
- if (!cv.CopyIndexAfterObject(0, module_name, module_name_length))
- return false;
-
- module->cv_record = cv.location();
- MDCVInfoPDB70 *cv_ptr = cv.get();
- cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE;
- cv_ptr->age = 0;
-
- // Get the module identifier
- unsigned char identifier[16];
- bool result = false;
- if (in_memory) {
- MacFileUtilities::MachoID macho(module_path,
- reinterpret_cast<void *>(module->base_of_image),
- static_cast<size_t>(module->size_of_image));
- result = macho.UUIDCommand(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier);
- if (!result)
- result = macho.MD5(cpu_type, CPU_SUBTYPE_MULTIPLE, identifier);
- }
-
- if (!result) {
- FileID file_id(module_path);
- result = file_id.MachoIdentifier(cpu_type, CPU_SUBTYPE_MULTIPLE,
- identifier);
- }
-
- if (result) {
- cv_ptr->signature.data1 =
- static_cast<uint32_t>(identifier[0]) << 24 |
- static_cast<uint32_t>(identifier[1]) << 16 |
- static_cast<uint32_t>(identifier[2]) << 8 |
- static_cast<uint32_t>(identifier[3]);
- cv_ptr->signature.data2 =
- static_cast<uint16_t>(identifier[4] << 8) | identifier[5];
- cv_ptr->signature.data3 =
- static_cast<uint16_t>(identifier[6] << 8) | identifier[7];
- cv_ptr->signature.data4[0] = identifier[8];
- cv_ptr->signature.data4[1] = identifier[9];
- cv_ptr->signature.data4[2] = identifier[10];
- cv_ptr->signature.data4[3] = identifier[11];
- cv_ptr->signature.data4[4] = identifier[12];
- cv_ptr->signature.data4[5] = identifier[13];
- cv_ptr->signature.data4[6] = identifier[14];
- cv_ptr->signature.data4[7] = identifier[15];
- }
-
- return true;
-}
-
-bool MinidumpGenerator::WriteModuleListStream(
- MDRawDirectory *module_list_stream) {
- TypedMDRVA<MDRawModuleList> list(&writer_);
-
- uint32_t image_count = dynamic_images_ ?
- dynamic_images_->GetImageCount() :
- _dyld_image_count();
-
- if (!list.AllocateObjectAndArray(image_count, MD_MODULE_SIZE))
- return false;
-
- module_list_stream->stream_type = MD_MODULE_LIST_STREAM;
- module_list_stream->location = list.location();
- list.get()->number_of_modules = static_cast<uint32_t>(image_count);
-
- // Write out the executable module as the first one
- MDRawModule module;
- uint32_t executableIndex = FindExecutableModule();
-
- if (!WriteModuleStream(static_cast<unsigned>(executableIndex), &module)) {
- return false;
- }
-
- list.CopyIndexAfterObject(0, &module, MD_MODULE_SIZE);
- int destinationIndex = 1; // Write all other modules after this one
-
- for (uint32_t i = 0; i < image_count; ++i) {
- if (i != executableIndex) {
- if (!WriteModuleStream(static_cast<unsigned>(i), &module)) {
- return false;
- }
-
- list.CopyIndexAfterObject(destinationIndex++, &module, MD_MODULE_SIZE);
- }
- }
-
- return true;
-}
-
-bool MinidumpGenerator::WriteMiscInfoStream(MDRawDirectory *misc_info_stream) {
- TypedMDRVA<MDRawMiscInfo> info(&writer_);
-
- if (!info.Allocate())
- return false;
-
- misc_info_stream->stream_type = MD_MISC_INFO_STREAM;
- misc_info_stream->location = info.location();
-
- MDRawMiscInfo *info_ptr = info.get();
- info_ptr->size_of_info = static_cast<uint32_t>(sizeof(MDRawMiscInfo));
- info_ptr->flags1 = MD_MISCINFO_FLAGS1_PROCESS_ID |
- MD_MISCINFO_FLAGS1_PROCESS_TIMES |
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO;
-
- // Process ID
- info_ptr->process_id = getpid();
-
- // Times
- struct rusage usage;
- if (getrusage(RUSAGE_SELF, &usage) != -1) {
- // Omit the fractional time since the MDRawMiscInfo only wants seconds
- info_ptr->process_user_time =
- static_cast<uint32_t>(usage.ru_utime.tv_sec);
- info_ptr->process_kernel_time =
- static_cast<uint32_t>(usage.ru_stime.tv_sec);
- }
- int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID,
- static_cast<int>(info_ptr->process_id) };
- uint mibsize = static_cast<uint>(sizeof(mib) / sizeof(mib[0]));
- struct kinfo_proc proc;
- size_t size = sizeof(proc);
- if (sysctl(mib, mibsize, &proc, &size, NULL, 0) == 0) {
- info_ptr->process_create_time =
- static_cast<uint32_t>(proc.kp_proc.p_starttime.tv_sec);
- }
-
- // Speed
- uint64_t speed;
- const uint64_t kOneMillion = 1000 * 1000;
- size = sizeof(speed);
- sysctlbyname("hw.cpufrequency_max", &speed, &size, NULL, 0);
- info_ptr->processor_max_mhz = static_cast<uint32_t>(speed / kOneMillion);
- info_ptr->processor_mhz_limit = static_cast<uint32_t>(speed / kOneMillion);
- size = sizeof(speed);
- sysctlbyname("hw.cpufrequency", &speed, &size, NULL, 0);
- info_ptr->processor_current_mhz = static_cast<uint32_t>(speed / kOneMillion);
-
- return true;
-}
-
-bool MinidumpGenerator::WriteBreakpadInfoStream(
- MDRawDirectory *breakpad_info_stream) {
- TypedMDRVA<MDRawBreakpadInfo> info(&writer_);
-
- if (!info.Allocate())
- return false;
-
- breakpad_info_stream->stream_type = MD_BREAKPAD_INFO_STREAM;
- breakpad_info_stream->location = info.location();
- MDRawBreakpadInfo *info_ptr = info.get();
-
- if (exception_thread_ && exception_type_) {
- info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID |
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID;
- info_ptr->dump_thread_id = handler_thread_;
- info_ptr->requesting_thread_id = exception_thread_;
- } else {
- info_ptr->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID;
- info_ptr->dump_thread_id = handler_thread_;
- info_ptr->requesting_thread_id = 0;
- }
-
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.h
deleted file mode 100644
index 4e4b4a6848..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_generator.h
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_generator.h: Create a minidump of the current MacOS process.
-
-#ifndef CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__
-#define CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__
-
-#include <mach/mach.h>
-#include <TargetConditionals.h>
-
-#include <string>
-
-#include "client/mac/handler/ucontext_compat.h"
-#include "client/minidump_file_writer.h"
-#include "common/memory.h"
-#include "common/mac/macho_utilities.h"
-#include "google_breakpad/common/minidump_format.h"
-
-#include "dynamic_images.h"
-#include "mach_vm_compat.h"
-
-#if !TARGET_OS_IPHONE && (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7)
- #define HAS_PPC_SUPPORT
-#endif
-#if defined(__arm__)
-#define HAS_ARM_SUPPORT
-#elif defined(__aarch64__)
-#define HAS_ARM64_SUPPORT
-#elif defined(__i386__) || defined(__x86_64__)
- #define HAS_X86_SUPPORT
-#endif
-
-namespace google_breakpad {
-
-using std::string;
-
-// Use the REGISTER_FROM_THREADSTATE to access a register name from the
-// breakpad_thread_state_t structure.
-#if __DARWIN_UNIX03 || TARGET_CPU_X86_64 || TARGET_CPU_PPC64 || TARGET_CPU_ARM
-// In The 10.5 SDK Headers Apple prepended __ to the variable names in the
-// i386_thread_state_t structure. There's no good way to tell what version of
-// the SDK we're compiling against so we just toggle on the same preprocessor
-// symbol Apple's headers use.
-#define REGISTER_FROM_THREADSTATE(a, b) ((a)->__ ## b)
-#else
-#define REGISTER_FROM_THREADSTATE(a, b) (a->b)
-#endif
-
-// Creates a minidump file of the current process. If there is exception data,
-// use SetExceptionInformation() to add this to the minidump. The minidump
-// file is generated by the Write() function.
-// Usage:
-// MinidumpGenerator minidump();
-// minidump.Write("/tmp/minidump");
-//
-class MinidumpGenerator {
- public:
- MinidumpGenerator();
- MinidumpGenerator(mach_port_t crashing_task, mach_port_t handler_thread);
-
- virtual ~MinidumpGenerator();
-
- // Return <dir>/<unique_name>.dmp
- // Sets |unique_name| (if requested) to the unique name for the minidump
- static string UniqueNameInDirectory(const string &dir, string *unique_name);
-
- // Write out the minidump into |path|
- // All of the components of |path| must exist and be writable
- // Return true if successful, false otherwise
- bool Write(const char *path);
-
- // Specify some exception information, if applicable
- void SetExceptionInformation(int type, int code, int subcode,
- mach_port_t thread_name) {
- exception_type_ = type;
- exception_code_ = code;
- exception_subcode_ = subcode;
- exception_thread_ = thread_name;
- }
-
- // Specify the task context. If |task_context| is not NULL, it will be used
- // to retrieve the context of the current thread, instead of using
- // |thread_get_state|.
- void SetTaskContext(breakpad_ucontext_t *task_context);
-
- // Gather system information. This should be call at least once before using
- // the MinidumpGenerator class.
- static void GatherSystemInformation();
-
- protected:
- // Overridable Stream writers
- virtual bool WriteExceptionStream(MDRawDirectory *exception_stream);
-
- // Overridable Helper
- virtual bool WriteThreadStream(mach_port_t thread_id, MDRawThread *thread);
-
- private:
- typedef bool (MinidumpGenerator::*WriteStreamFN)(MDRawDirectory *);
-
- // Stream writers
- bool WriteThreadListStream(MDRawDirectory *thread_list_stream);
- bool WriteMemoryListStream(MDRawDirectory *memory_list_stream);
- bool WriteSystemInfoStream(MDRawDirectory *system_info_stream);
- bool WriteModuleListStream(MDRawDirectory *module_list_stream);
- bool WriteMiscInfoStream(MDRawDirectory *misc_info_stream);
- bool WriteBreakpadInfoStream(MDRawDirectory *breakpad_info_stream);
-
- // Helpers
- uint64_t CurrentPCForStack(breakpad_thread_state_data_t state);
- bool GetThreadState(thread_act_t target_thread, thread_state_t state,
- mach_msg_type_number_t *count);
- bool WriteStackFromStartAddress(mach_vm_address_t start_addr,
- MDMemoryDescriptor *stack_location);
- bool WriteStack(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContext(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- bool WriteCVRecord(MDRawModule *module, int cpu_type,
- const char *module_path, bool in_memory);
- bool WriteModuleStream(unsigned int index, MDRawModule *module);
- size_t CalculateStackSize(mach_vm_address_t start_addr);
- int FindExecutableModule();
-
- // Per-CPU implementations of these methods
-#ifdef HAS_ARM_SUPPORT
- bool WriteStackARM(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContextARM(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- uint64_t CurrentPCForStackARM(breakpad_thread_state_data_t state);
-#endif
-#ifdef HAS_ARM64_SUPPORT
- bool WriteStackARM64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContextARM64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- uint64_t CurrentPCForStackARM64(breakpad_thread_state_data_t state);
-#endif
-#ifdef HAS_PPC_SUPPORT
- bool WriteStackPPC(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContextPPC(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- uint64_t CurrentPCForStackPPC(breakpad_thread_state_data_t state);
- bool WriteStackPPC64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContextPPC64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- uint64_t CurrentPCForStackPPC64(breakpad_thread_state_data_t state);
-#endif
-#ifdef HAS_X86_SUPPORT
- bool WriteStackX86(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContextX86(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- uint64_t CurrentPCForStackX86(breakpad_thread_state_data_t state);
- bool WriteStackX86_64(breakpad_thread_state_data_t state,
- MDMemoryDescriptor *stack_location);
- bool WriteContextX86_64(breakpad_thread_state_data_t state,
- MDLocationDescriptor *register_location);
- uint64_t CurrentPCForStackX86_64(breakpad_thread_state_data_t state);
-#endif
-
- // disallow copy ctor and operator=
- explicit MinidumpGenerator(const MinidumpGenerator &);
- void operator=(const MinidumpGenerator &);
-
- protected:
- // Use this writer to put the data to disk
- MinidumpFileWriter writer_;
-
- private:
- // Exception information
- int exception_type_;
- int exception_code_;
- int exception_subcode_;
- mach_port_t exception_thread_;
- mach_port_t crashing_task_;
- mach_port_t handler_thread_;
-
- // CPU type of the task being dumped.
- cpu_type_t cpu_type_;
-
- // System information
- static char build_string_[16];
- static int os_major_version_;
- static int os_minor_version_;
- static int os_build_number_;
-
- // Context of the task to dump.
- breakpad_ucontext_t *task_context_;
-
- // Information about dynamically loaded code
- DynamicImages *dynamic_images_;
-
- // PageAllocator makes it possible to allocate memory
- // directly from the system, even while handling an exception.
- mutable PageAllocator allocator_;
-
- protected:
- // Blocks of memory written to the dump. These are all currently
- // written while writing the thread list stream, but saved here
- // so a memory list stream can be written afterwards.
- wasteful_vector<MDMemoryDescriptor> memory_blocks_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_MAC_GENERATOR_MINIDUMP_GENERATOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj
deleted file mode 100644
index 2a597d502d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_test.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,841 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 8BFC813F11FF9A58002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; };
- 8BFC814411FF9A9C002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; };
- 8BFC814511FF9A9D002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; };
- 8BFC814811FF9B13002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; };
- 8BFC814911FF9B13002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; };
- 8BFC814A11FF9B13002CB4DC /* libcrypto.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */; };
- 8BFC814B11FF9B3F002CB4DC /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */; };
- 8BFC814C11FF9B3F002CB4DC /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */; };
- 8BFC81A211FF9C2E002CB4DC /* CPlusTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */; };
- 8BFC81A311FF9C2F002CB4DC /* CPlusTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */; };
- 8BFC81AD11FF9C8A002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
- 8BFC81AE11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
- 8BFC81AF11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
- 8BFC81B011FF9C8D002CB4DC /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
- 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; };
- 9B35FF5B0B267D5F008DE8C7 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; };
- 9B37CEEC0AF98ECD00FA4BD4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */; };
- 9B7CA7700B12873A00CD3A1D /* minidump_file_writer-inl.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BE3C01E0B0CE329009892DF /* minidump_file_writer-inl.h */; };
- 9B7CA8540B12989000CD3A1D /* minidump_file_writer_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B7CA8530B12989000CD3A1D /* minidump_file_writer_unittest.cc */; };
- 9B7CA8550B1298A100CD3A1D /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C230B01344C0055103E /* minidump_file_writer.cc */; };
- 9BC1D2940B336F2300F2A2B4 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; };
- 9BC1D2950B336F2500F2A2B4 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; };
- 9BD82AC10B0029DF0055103E /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */; };
- 9BD82BFF0B01333D0055103E /* exception_handler_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82BFD0B01333D0055103E /* exception_handler_test.cc */; };
- 9BD82C020B01333D0055103E /* minidump_generator_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82BFE0B01333D0055103E /* minidump_generator_test.cc */; };
- 9BD82C0D0B0133520055103E /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C090B0133520055103E /* exception_handler.cc */; };
- 9BD82C0E0B0133520055103E /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C0B0B0133520055103E /* minidump_generator.cc */; };
- 9BD82C0F0B0133520055103E /* exception_handler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C090B0133520055103E /* exception_handler.cc */; };
- 9BD82C100B0133520055103E /* exception_handler.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BD82C0A0B0133520055103E /* exception_handler.h */; };
- 9BD82C110B0133520055103E /* minidump_generator.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C0B0B0133520055103E /* minidump_generator.cc */; };
- 9BD82C120B0133520055103E /* minidump_generator.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BD82C0C0B0133520055103E /* minidump_generator.h */; };
- 9BD82C250B01344C0055103E /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C230B01344C0055103E /* minidump_file_writer.cc */; };
- 9BD82C260B01344C0055103E /* minidump_file_writer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C230B01344C0055103E /* minidump_file_writer.cc */; };
- 9BD82C270B01344C0055103E /* minidump_file_writer.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BD82C240B01344C0055103E /* minidump_file_writer.h */; };
- 9BD82C2D0B01345E0055103E /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C2B0B01345E0055103E /* string_utilities.cc */; };
- 9BD82C2E0B01345E0055103E /* string_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BD82C2B0B01345E0055103E /* string_utilities.cc */; };
- 9BD82C2F0B01345E0055103E /* string_utilities.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BD82C2C0B01345E0055103E /* string_utilities.h */; };
- D2F651000BEF947200920385 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FA0BEF947200920385 /* file_id.cc */; };
- D2F651010BEF947200920385 /* file_id.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2F650FB0BEF947200920385 /* file_id.h */; };
- D2F651020BEF947200920385 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FC0BEF947200920385 /* macho_id.cc */; };
- D2F651030BEF947200920385 /* macho_id.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2F650FD0BEF947200920385 /* macho_id.h */; };
- D2F651040BEF947200920385 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FE0BEF947200920385 /* macho_utilities.cc */; };
- D2F651050BEF947200920385 /* macho_utilities.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2F650FF0BEF947200920385 /* macho_utilities.h */; };
- D2F651090BEF949A00920385 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F651070BEF949A00920385 /* dynamic_images.cc */; };
- D2F6510A0BEF949A00920385 /* dynamic_images.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2F651080BEF949A00920385 /* dynamic_images.h */; };
- D2F6510E0BEF94EB00920385 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F6510C0BEF94EB00920385 /* macho_walker.cc */; };
- D2F6510F0BEF94EB00920385 /* macho_walker.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = D2F6510D0BEF94EB00920385 /* macho_walker.h */; };
- D2F651110BEF951700920385 /* string_conversion.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */; };
- D2F651130BEF951C00920385 /* string_conversion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FF590B267D5F008DE8C7 /* string_conversion.h */; };
- D2F651150BEF953000920385 /* convert_UTF.c in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */; };
- D2F651160BEF953100920385 /* convert_UTF.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B35FF570B267D5F008DE8C7 /* convert_UTF.h */; };
- D2F6511B0BEF970E00920385 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F651070BEF949A00920385 /* dynamic_images.cc */; };
- D2F6511D0BEF973500920385 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FA0BEF947200920385 /* file_id.cc */; };
- D2F6511E0BEF973600920385 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FC0BEF947200920385 /* macho_id.cc */; };
- D2F6511F0BEF973900920385 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FE0BEF947200920385 /* macho_utilities.cc */; };
- D2F651210BEF975400920385 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F6510C0BEF94EB00920385 /* macho_walker.cc */; };
- F93A887D0E8B4C8C0026AF89 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F6510C0BEF94EB00920385 /* macho_walker.cc */; };
- F93A887E0E8B4C8C0026AF89 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FC0BEF947200920385 /* macho_id.cc */; };
- F93A887F0E8B4C8C0026AF89 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FE0BEF947200920385 /* macho_utilities.cc */; };
- F93A88800E8B4C8C0026AF89 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F650FA0BEF947200920385 /* file_id.cc */; };
- F93A88860E8B4C9A0026AF89 /* dwarftests.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9721F310E8B07E800D7E813 /* dwarftests.mm */; };
- F93A88870E8B4C9A0026AF89 /* dump_syms.mm in Sources */ = {isa = PBXBuildFile; fileRef = F9721F390E8B0D0D00D7E813 /* dump_syms.mm */; };
- F93A88880E8B4C9A0026AF89 /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F760E8B0DC700D7E813 /* bytereader.cc */; };
- F93A88890E8B4C9A0026AF89 /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */; };
- F93A888A0E8B4C9A0026AF89 /* functioninfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721F780E8B0DC700D7E813 /* functioninfo.cc */; };
- F93A888B0E8B4C9A0026AF89 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9721FA80E8B0E4800D7E813 /* md5.cc */; };
- F9721F6C0E8B0D7000D7E813 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */; };
- F9721FA20E8B0E2300D7E813 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */; };
- F982089C0DB3280D0017AECA /* breakpad_nlist_test.cc in Sources */ = {isa = PBXBuildFile; fileRef = F982089B0DB3280D0017AECA /* breakpad_nlist_test.cc */; };
- F98208A30DB32CAE0017AECA /* breakpad_nlist_64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */; };
- F9AE5B390DBFDBDB00505983 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F651070BEF949A00920385 /* dynamic_images.cc */; };
- F9AE5B3A0DBFDBDB00505983 /* DynamicImagesTests.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C5A4210DB82DD800209C76 /* DynamicImagesTests.cc */; };
- F9B34E870DBC1E1600306484 /* dynamic_images.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2F651070BEF949A00920385 /* dynamic_images.cc */; };
- F9C5A4220DB82DD800209C76 /* DynamicImagesTests.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C5A4210DB82DD800209C76 /* DynamicImagesTests.cc */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 8DD76F690486A84900D96B5E /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 8;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- 9BD82C100B0133520055103E /* exception_handler.h in CopyFiles */,
- 9BD82C120B0133520055103E /* minidump_generator.h in CopyFiles */,
- 9BD82C270B01344C0055103E /* minidump_file_writer.h in CopyFiles */,
- 9BD82C2F0B01345E0055103E /* string_utilities.h in CopyFiles */,
- 9B7CA7700B12873A00CD3A1D /* minidump_file_writer-inl.h in CopyFiles */,
- D2F651010BEF947200920385 /* file_id.h in CopyFiles */,
- D2F651030BEF947200920385 /* macho_id.h in CopyFiles */,
- D2F651050BEF947200920385 /* macho_utilities.h in CopyFiles */,
- D2F6510A0BEF949A00920385 /* dynamic_images.h in CopyFiles */,
- D2F6510F0BEF94EB00920385 /* macho_walker.h in CopyFiles */,
- D2F651130BEF951C00920385 /* string_conversion.h in CopyFiles */,
- D2F651160BEF953100920385 /* convert_UTF.h in CopyFiles */,
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 8BFC812011FF99D5002CB4DC /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
- 8BFC812111FF99D5002CB4DC /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
- 8BFC812211FF99D5002CB4DC /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
- 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libcrypto.dylib; path = usr/lib/libcrypto.dylib; sourceTree = SDKROOT; };
- 8BFC815411FF9B7F002CB4DC /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
- 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CPlusTest.framework; path = Library/Frameworks/CPlusTest.framework; sourceTree = DEVELOPER_DIR; };
- 8DD76F6C0486A84900D96B5E /* generator_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = generator_test; sourceTree = BUILT_PRODUCTS_DIR; };
- 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = convert_UTF.c; path = ../../../common/convert_UTF.c; sourceTree = SOURCE_ROOT; };
- 9B35FF570B267D5F008DE8C7 /* convert_UTF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = convert_UTF.h; path = ../../../common/convert_UTF.h; sourceTree = SOURCE_ROOT; };
- 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = string_conversion.cc; path = ../../../common/string_conversion.cc; sourceTree = SOURCE_ROOT; };
- 9B35FF590B267D5F008DE8C7 /* string_conversion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = string_conversion.h; path = ../../../common/string_conversion.h; sourceTree = SOURCE_ROOT; };
- 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
- 9B7CA84E0B1297F200CD3A1D /* unit_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = unit_test; sourceTree = BUILT_PRODUCTS_DIR; };
- 9B7CA8530B12989000CD3A1D /* minidump_file_writer_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer_unittest.cc; path = ../../minidump_file_writer_unittest.cc; sourceTree = "<group>"; };
- 9BD82A9B0B00267E0055103E /* handler_test */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = handler_test; sourceTree = BUILT_PRODUCTS_DIR; };
- 9BD82BFD0B01333D0055103E /* exception_handler_test.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = exception_handler_test.cc; sourceTree = SOURCE_ROOT; };
- 9BD82BFE0B01333D0055103E /* minidump_generator_test.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_generator_test.cc; sourceTree = SOURCE_ROOT; };
- 9BD82C090B0133520055103E /* exception_handler.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = exception_handler.cc; sourceTree = SOURCE_ROOT; };
- 9BD82C0A0B0133520055103E /* exception_handler.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = exception_handler.h; sourceTree = SOURCE_ROOT; };
- 9BD82C0B0B0133520055103E /* minidump_generator.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = minidump_generator.cc; sourceTree = SOURCE_ROOT; };
- 9BD82C0C0B0133520055103E /* minidump_generator.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_generator.h; sourceTree = SOURCE_ROOT; };
- 9BD82C230B01344C0055103E /* minidump_file_writer.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_file_writer.cc; path = ../../minidump_file_writer.cc; sourceTree = SOURCE_ROOT; };
- 9BD82C240B01344C0055103E /* minidump_file_writer.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = minidump_file_writer.h; path = ../../minidump_file_writer.h; sourceTree = SOURCE_ROOT; };
- 9BD82C2B0B01345E0055103E /* string_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = string_utilities.cc; path = ../../../common/mac/string_utilities.cc; sourceTree = SOURCE_ROOT; };
- 9BD82C2C0B01345E0055103E /* string_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = string_utilities.h; path = ../../../common/mac/string_utilities.h; sourceTree = SOURCE_ROOT; };
- 9BE3C01E0B0CE329009892DF /* minidump_file_writer-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "minidump_file_writer-inl.h"; path = "../../minidump_file_writer-inl.h"; sourceTree = SOURCE_ROOT; };
- D2F650FA0BEF947200920385 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; };
- D2F650FB0BEF947200920385 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ../../../common/mac/file_id.h; sourceTree = SOURCE_ROOT; };
- D2F650FC0BEF947200920385 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ../../../common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; };
- D2F650FD0BEF947200920385 /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ../../../common/mac/macho_id.h; sourceTree = SOURCE_ROOT; };
- D2F650FE0BEF947200920385 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; };
- D2F650FF0BEF947200920385 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; };
- D2F651070BEF949A00920385 /* dynamic_images.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dynamic_images.cc; sourceTree = "<group>"; };
- D2F651080BEF949A00920385 /* dynamic_images.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dynamic_images.h; sourceTree = "<group>"; };
- D2F6510C0BEF94EB00920385 /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ../../../common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; };
- D2F6510D0BEF94EB00920385 /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ../../../common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; };
- F917C4F70E03265A00F86017 /* breakpad_exc_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = breakpad_exc_server.c; sourceTree = "<group>"; };
- F917C4F80E03265A00F86017 /* breakpad_exc_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = breakpad_exc_server.h; sourceTree = "<group>"; };
- F93A88750E8B4C700026AF89 /* octestcases.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = octestcases.octest; sourceTree = BUILT_PRODUCTS_DIR; };
- F93A88760E8B4C700026AF89 /* obj-cTestCases-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "obj-cTestCases-Info.plist"; sourceTree = "<group>"; };
- F9721F300E8B07E800D7E813 /* dwarftests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dwarftests.h; sourceTree = "<group>"; };
- F9721F310E8B07E800D7E813 /* dwarftests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dwarftests.mm; sourceTree = "<group>"; };
- F9721F380E8B0CFC00D7E813 /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = SOURCE_ROOT; };
- F9721F390E8B0D0D00D7E813 /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = SOURCE_ROOT; };
- F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
- F9721F760E8B0DC700D7E813 /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; };
- F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader.cc; path = ../../../common/dwarf/dwarf2reader.cc; sourceTree = SOURCE_ROOT; };
- F9721F780E8B0DC700D7E813 /* functioninfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = functioninfo.cc; path = ../../../common/dwarf/functioninfo.cc; sourceTree = SOURCE_ROOT; };
- F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
- F9721FA80E8B0E4800D7E813 /* md5.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = md5.cc; path = ../../../common/md5.cc; sourceTree = SOURCE_ROOT; };
- F982089A0DB3280D0017AECA /* breakpad_nlist_test.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = breakpad_nlist_test.h; sourceTree = "<group>"; };
- F982089B0DB3280D0017AECA /* breakpad_nlist_test.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = breakpad_nlist_test.cc; sourceTree = "<group>"; };
- F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = breakpad_nlist_64.cc; sourceTree = "<group>"; };
- F98208A20DB32CAE0017AECA /* breakpad_nlist_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = breakpad_nlist_64.h; sourceTree = "<group>"; };
- F9AE19B50DB040E300C98454 /* minidump_tests32-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "minidump_tests32-Info.plist"; sourceTree = "<group>"; };
- F9AE19C30DB04A9500C98454 /* minidump_tests64.cptest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = minidump_tests64.cptest; sourceTree = BUILT_PRODUCTS_DIR; };
- F9AE5B330DBFDBA300505983 /* minidump_tests32.cptest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = minidump_tests32.cptest; sourceTree = BUILT_PRODUCTS_DIR; };
- F9AE5B340DBFDBA300505983 /* minidump_tests64-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "minidump_tests64-Info.plist"; sourceTree = "<group>"; };
- F9C5A4200DB82DD800209C76 /* DynamicImagesTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicImagesTests.h; sourceTree = "<group>"; };
- F9C5A4210DB82DD800209C76 /* DynamicImagesTests.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicImagesTests.cc; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8DD76F660486A84900D96B5E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9B37CEEC0AF98ECD00FA4BD4 /* CoreFoundation.framework in Frameworks */,
- 8BFC813F11FF9A58002CB4DC /* libcrypto.dylib in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 9B7CA84C0B1297F200CD3A1D /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8BFC814511FF9A9D002CB4DC /* libcrypto.dylib in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 9BD82A990B00267E0055103E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9BD82AC10B0029DF0055103E /* CoreFoundation.framework in Frameworks */,
- 8BFC814411FF9A9C002CB4DC /* libcrypto.dylib in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93A88720E8B4C700026AF89 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8BFC814A11FF9B13002CB4DC /* libcrypto.dylib in Frameworks */,
- 8BFC814B11FF9B3F002CB4DC /* SenTestingKit.framework in Frameworks */,
- 8BFC814C11FF9B3F002CB4DC /* Cocoa.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AE19C00DB04A9500C98454 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8BFC814811FF9B13002CB4DC /* libcrypto.dylib in Frameworks */,
- 8BFC81A211FF9C2E002CB4DC /* CPlusTest.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AE5B300DBFDBA300505983 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9721F6C0E8B0D7000D7E813 /* Cocoa.framework in Frameworks */,
- F9721FA20E8B0E2300D7E813 /* SenTestingKit.framework in Frameworks */,
- 8BFC814911FF9B13002CB4DC /* libcrypto.dylib in Frameworks */,
- 8BFC81A311FF9C2F002CB4DC /* CPlusTest.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* MinidumpWriter */ = {
- isa = PBXGroup;
- children = (
- 8BFC812011FF99D5002CB4DC /* Breakpad.xcconfig */,
- 8BFC812111FF99D5002CB4DC /* BreakpadDebug.xcconfig */,
- 8BFC812211FF99D5002CB4DC /* BreakpadRelease.xcconfig */,
- F9721FA80E8B0E4800D7E813 /* md5.cc */,
- F9721F760E8B0DC700D7E813 /* bytereader.cc */,
- F9721F770E8B0DC700D7E813 /* dwarf2reader.cc */,
- F9721F780E8B0DC700D7E813 /* functioninfo.cc */,
- F9721F390E8B0D0D00D7E813 /* dump_syms.mm */,
- F9721F380E8B0CFC00D7E813 /* dump_syms.h */,
- F917C4F70E03265A00F86017 /* breakpad_exc_server.c */,
- F917C4F80E03265A00F86017 /* breakpad_exc_server.h */,
- F98208A10DB32CAE0017AECA /* breakpad_nlist_64.cc */,
- F98208A20DB32CAE0017AECA /* breakpad_nlist_64.h */,
- D2F6510C0BEF94EB00920385 /* macho_walker.cc */,
- D2F6510D0BEF94EB00920385 /* macho_walker.h */,
- D2F651070BEF949A00920385 /* dynamic_images.cc */,
- D2F651080BEF949A00920385 /* dynamic_images.h */,
- D2F650FA0BEF947200920385 /* file_id.cc */,
- D2F650FB0BEF947200920385 /* file_id.h */,
- D2F650FC0BEF947200920385 /* macho_id.cc */,
- D2F650FD0BEF947200920385 /* macho_id.h */,
- D2F650FE0BEF947200920385 /* macho_utilities.cc */,
- D2F650FF0BEF947200920385 /* macho_utilities.h */,
- F9C5A41F0DB82DB000209C76 /* testcases */,
- 9BD82C040B0133420055103E /* Breakpad */,
- 08FB7795FE84155DC02AAC07 /* Source */,
- 9B37CEEA0AF98EB600FA4BD4 /* Frameworks */,
- 1AB674ADFE9D54B511CA2CBB /* Products */,
- F9AE19B50DB040E300C98454 /* minidump_tests32-Info.plist */,
- F9AE5B340DBFDBA300505983 /* minidump_tests64-Info.plist */,
- F93A88760E8B4C700026AF89 /* obj-cTestCases-Info.plist */,
- );
- name = MinidumpWriter;
- sourceTree = "<group>";
- };
- 08FB7795FE84155DC02AAC07 /* Source */ = {
- isa = PBXGroup;
- children = (
- 9BD82BFD0B01333D0055103E /* exception_handler_test.cc */,
- 9BD82BFE0B01333D0055103E /* minidump_generator_test.cc */,
- 9B7CA8530B12989000CD3A1D /* minidump_file_writer_unittest.cc */,
- );
- name = Source;
- sourceTree = "<group>";
- };
- 1AB674ADFE9D54B511CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8DD76F6C0486A84900D96B5E /* generator_test */,
- 9BD82A9B0B00267E0055103E /* handler_test */,
- 9B7CA84E0B1297F200CD3A1D /* unit_test */,
- F9AE19C30DB04A9500C98454 /* minidump_tests64.cptest */,
- F9AE5B330DBFDBA300505983 /* minidump_tests32.cptest */,
- F93A88750E8B4C700026AF89 /* octestcases.octest */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 9B37CEEA0AF98EB600FA4BD4 /* Frameworks */ = {
- isa = PBXGroup;
- children = (
- 8BFC813E11FF9A58002CB4DC /* libcrypto.dylib */,
- 8BFC815411FF9B7F002CB4DC /* Carbon.framework */,
- F9721FA10E8B0E2300D7E813 /* SenTestingKit.framework */,
- F9721F6B0E8B0D7000D7E813 /* Cocoa.framework */,
- 9B37CEEB0AF98ECD00FA4BD4 /* CoreFoundation.framework */,
- 8BFC819211FF9C23002CB4DC /* CPlusTest.framework */,
- );
- name = Frameworks;
- sourceTree = "<group>";
- };
- 9BD82C040B0133420055103E /* Breakpad */ = {
- isa = PBXGroup;
- children = (
- 9B35FF560B267D5F008DE8C7 /* convert_UTF.c */,
- 9B35FF570B267D5F008DE8C7 /* convert_UTF.h */,
- 9B35FF580B267D5F008DE8C7 /* string_conversion.cc */,
- 9B35FF590B267D5F008DE8C7 /* string_conversion.h */,
- 9BD82C090B0133520055103E /* exception_handler.cc */,
- 9BD82C0A0B0133520055103E /* exception_handler.h */,
- 9BD82C0B0B0133520055103E /* minidump_generator.cc */,
- 9BD82C0C0B0133520055103E /* minidump_generator.h */,
- 9BD82C230B01344C0055103E /* minidump_file_writer.cc */,
- 9BE3C01E0B0CE329009892DF /* minidump_file_writer-inl.h */,
- 9BD82C240B01344C0055103E /* minidump_file_writer.h */,
- 9BD82C2B0B01345E0055103E /* string_utilities.cc */,
- 9BD82C2C0B01345E0055103E /* string_utilities.h */,
- );
- name = Breakpad;
- sourceTree = "<group>";
- };
- F9C5A41F0DB82DB000209C76 /* testcases */ = {
- isa = PBXGroup;
- children = (
- F982089A0DB3280D0017AECA /* breakpad_nlist_test.h */,
- F982089B0DB3280D0017AECA /* breakpad_nlist_test.cc */,
- F9C5A4200DB82DD800209C76 /* DynamicImagesTests.h */,
- F9C5A4210DB82DD800209C76 /* DynamicImagesTests.cc */,
- F9721F300E8B07E800D7E813 /* dwarftests.h */,
- F9721F310E8B07E800D7E813 /* dwarftests.mm */,
- );
- path = testcases;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8DD76F620486A84900D96B5E /* generator_test */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "generator_test" */;
- buildPhases = (
- 8DD76F640486A84900D96B5E /* Sources */,
- 8DD76F660486A84900D96B5E /* Frameworks */,
- 8DD76F690486A84900D96B5E /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = generator_test;
- productInstallPath = "$(HOME)/bin";
- productName = MinidumpWriter;
- productReference = 8DD76F6C0486A84900D96B5E /* generator_test */;
- productType = "com.apple.product-type.tool";
- };
- 9B7CA84D0B1297F200CD3A1D /* unit_test */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 9B7CA8500B12984300CD3A1D /* Build configuration list for PBXNativeTarget "unit_test" */;
- buildPhases = (
- 9B7CA84B0B1297F200CD3A1D /* Sources */,
- 9B7CA84C0B1297F200CD3A1D /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = unit_test;
- productName = "filewriter unit test";
- productReference = 9B7CA84E0B1297F200CD3A1D /* unit_test */;
- productType = "com.apple.product-type.tool";
- };
- 9BD82A9A0B00267E0055103E /* handler_test */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 9BD82AA60B0026BF0055103E /* Build configuration list for PBXNativeTarget "handler_test" */;
- buildPhases = (
- 9BD82A980B00267E0055103E /* Sources */,
- 9BD82A990B00267E0055103E /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = handler_test;
- productName = ExceptionTester;
- productReference = 9BD82A9B0B00267E0055103E /* handler_test */;
- productType = "com.apple.product-type.tool";
- };
- F93A88740E8B4C700026AF89 /* obj-c_TestCases */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F93A88790E8B4C700026AF89 /* Build configuration list for PBXNativeTarget "obj-c_TestCases" */;
- buildPhases = (
- F93A88700E8B4C700026AF89 /* Resources */,
- F93A88710E8B4C700026AF89 /* Sources */,
- F93A88720E8B4C700026AF89 /* Frameworks */,
- F93A88730E8B4C700026AF89 /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = "obj-c_TestCases";
- productName = octestcases;
- productReference = F93A88750E8B4C700026AF89 /* octestcases.octest */;
- productType = "com.apple.product-type.bundle";
- };
- F9AE19C20DB04A9500C98454 /* minidump_tests64 */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F9AE19C70DB04AA200C98454 /* Build configuration list for PBXNativeTarget "minidump_tests64" */;
- buildPhases = (
- F9AE19BE0DB04A9500C98454 /* Resources */,
- F9AE19BF0DB04A9500C98454 /* Sources */,
- F9AE19C00DB04A9500C98454 /* Frameworks */,
- F9AE19C10DB04A9500C98454 /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = minidump_tests64;
- productName = minidump_tests;
- productReference = F9AE19C30DB04A9500C98454 /* minidump_tests64.cptest */;
- productType = "com.apple.product-type.bundle";
- };
- F9AE5B320DBFDBA300505983 /* minidump_tests32 */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = F9AE5B380DBFDBA300505983 /* Build configuration list for PBXNativeTarget "minidump_tests32" */;
- buildPhases = (
- F9AE5B2E0DBFDBA300505983 /* Resources */,
- F9AE5B2F0DBFDBA300505983 /* Sources */,
- F9AE5B300DBFDBA300505983 /* Frameworks */,
- F9AE5B310DBFDBA300505983 /* ShellScript */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = minidump_tests32;
- productName = Untitled;
- productReference = F9AE5B330DBFDBA300505983 /* minidump_tests32.cptest */;
- productType = "com.apple.product-type.bundle";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "minidump_test" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- );
- mainGroup = 08FB7794FE84155DC02AAC07 /* MinidumpWriter */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8DD76F620486A84900D96B5E /* generator_test */,
- 9BD82A9A0B00267E0055103E /* handler_test */,
- 9B7CA84D0B1297F200CD3A1D /* unit_test */,
- F9AE19C20DB04A9500C98454 /* minidump_tests64 */,
- F9AE5B320DBFDBA300505983 /* minidump_tests32 */,
- F93A88740E8B4C700026AF89 /* obj-c_TestCases */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- F93A88700E8B4C700026AF89 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AE19BE0DB04A9500C98454 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AE5B2E0DBFDBA300505983 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
- F93A88730E8B4C700026AF89 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
- };
- F9AE19C10DB04A9500C98454 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n# Run gcov on the framework getting tested\nif [ \"${CONFIGURATION}\" = 'Coverage' ];\nthen\n FRAMEWORK_NAME=minidump_tests64\n FRAMEWORK_OBJ_DIR=${OBJROOT}/${PROJECT_NAME}.build/${CONFIGURATION}/${FRAMEWORK_NAME}.build/Objects-normal/${NATIVE_ARCH_ACTUAL}\n mkdir -p coverage\n pushd coverage\n echo find ${OBJROOT} -name *.gcda -exec gcov -o ${FRAMEWORK_OBJ_DIR} {} \\;\n find ${OBJROOT} -name *.gcda -exec gcov -o ${FRAMEWORK_OBJ_DIR} {} \\;\n popd\nfi ";
- };
- F9AE5B310DBFDBA300505983 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n\n";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8DD76F640486A84900D96B5E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9BD82C020B01333D0055103E /* minidump_generator_test.cc in Sources */,
- 9BD82C0F0B0133520055103E /* exception_handler.cc in Sources */,
- 9BD82C110B0133520055103E /* minidump_generator.cc in Sources */,
- 9BD82C260B01344C0055103E /* minidump_file_writer.cc in Sources */,
- 9BD82C2E0B01345E0055103E /* string_utilities.cc in Sources */,
- D2F651000BEF947200920385 /* file_id.cc in Sources */,
- D2F651020BEF947200920385 /* macho_id.cc in Sources */,
- D2F651040BEF947200920385 /* macho_utilities.cc in Sources */,
- D2F651090BEF949A00920385 /* dynamic_images.cc in Sources */,
- D2F6510E0BEF94EB00920385 /* macho_walker.cc in Sources */,
- D2F651110BEF951700920385 /* string_conversion.cc in Sources */,
- D2F651150BEF953000920385 /* convert_UTF.c in Sources */,
- 8BFC81B011FF9C8D002CB4DC /* breakpad_nlist_64.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 9B7CA84B0B1297F200CD3A1D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9B7CA8540B12989000CD3A1D /* minidump_file_writer_unittest.cc in Sources */,
- 9B7CA8550B1298A100CD3A1D /* minidump_file_writer.cc in Sources */,
- 9BC1D2940B336F2300F2A2B4 /* convert_UTF.c in Sources */,
- 9BC1D2950B336F2500F2A2B4 /* string_conversion.cc in Sources */,
- 8BFC81AE11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 9BD82A980B00267E0055103E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9BD82BFF0B01333D0055103E /* exception_handler_test.cc in Sources */,
- 9BD82C0D0B0133520055103E /* exception_handler.cc in Sources */,
- 9BD82C0E0B0133520055103E /* minidump_generator.cc in Sources */,
- 9BD82C250B01344C0055103E /* minidump_file_writer.cc in Sources */,
- 9BD82C2D0B01345E0055103E /* string_utilities.cc in Sources */,
- 9B35FF5A0B267D5F008DE8C7 /* convert_UTF.c in Sources */,
- 9B35FF5B0B267D5F008DE8C7 /* string_conversion.cc in Sources */,
- D2F6511B0BEF970E00920385 /* dynamic_images.cc in Sources */,
- D2F6511D0BEF973500920385 /* file_id.cc in Sources */,
- D2F6511E0BEF973600920385 /* macho_id.cc in Sources */,
- D2F6511F0BEF973900920385 /* macho_utilities.cc in Sources */,
- D2F651210BEF975400920385 /* macho_walker.cc in Sources */,
- 8BFC81AF11FF9C8C002CB4DC /* breakpad_nlist_64.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F93A88710E8B4C700026AF89 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F93A88860E8B4C9A0026AF89 /* dwarftests.mm in Sources */,
- F93A88870E8B4C9A0026AF89 /* dump_syms.mm in Sources */,
- F93A88880E8B4C9A0026AF89 /* bytereader.cc in Sources */,
- F93A88890E8B4C9A0026AF89 /* dwarf2reader.cc in Sources */,
- F93A888A0E8B4C9A0026AF89 /* functioninfo.cc in Sources */,
- F93A888B0E8B4C9A0026AF89 /* md5.cc in Sources */,
- F93A887D0E8B4C8C0026AF89 /* macho_walker.cc in Sources */,
- F93A887E0E8B4C8C0026AF89 /* macho_id.cc in Sources */,
- F93A887F0E8B4C8C0026AF89 /* macho_utilities.cc in Sources */,
- F93A88800E8B4C8C0026AF89 /* file_id.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AE19BF0DB04A9500C98454 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9B34E870DBC1E1600306484 /* dynamic_images.cc in Sources */,
- F982089C0DB3280D0017AECA /* breakpad_nlist_test.cc in Sources */,
- F98208A30DB32CAE0017AECA /* breakpad_nlist_64.cc in Sources */,
- F9C5A4220DB82DD800209C76 /* DynamicImagesTests.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- F9AE5B2F0DBFDBA300505983 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- F9AE5B390DBFDBDB00505983 /* dynamic_images.cc in Sources */,
- F9AE5B3A0DBFDBDB00505983 /* DynamicImagesTests.cc in Sources */,
- 8BFC81AD11FF9C8A002CB4DC /* breakpad_nlist_64.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB923208733DC60010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
- );
- PRODUCT_NAME = generator_test;
- USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)";
- };
- name = Debug;
- };
- 1DEB923308733DC60010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = (
- "$(inherited)",
- "\"$(DEVELOPER_FRAMEWORKS_DIR)\"",
- );
- PRODUCT_NAME = generator_test;
- USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)";
- };
- name = Release;
- };
- 1DEB923608733DC60010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8BFC812111FF99D5002CB4DC /* BreakpadDebug.xcconfig */;
- buildSettings = {
- };
- name = Debug;
- };
- 1DEB923708733DC60010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8BFC812211FF99D5002CB4DC /* BreakpadRelease.xcconfig */;
- buildSettings = {
- };
- name = Release;
- };
- 9B7CA8510B12984300CD3A1D /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = unit_test;
- USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)";
- };
- name = Debug;
- };
- 9B7CA8520B12984300CD3A1D /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = unit_test;
- USER_HEADER_SEARCH_PATHS = "../../../** $(inherited)";
- };
- name = Release;
- };
- 9BD82AA70B0026BF0055103E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = handler_test;
- USER_HEADER_SEARCH_PATHS = "../../.. $(inherited)";
- };
- name = Debug;
- };
- 9BD82AA80B0026BF0055103E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = handler_test;
- USER_HEADER_SEARCH_PATHS = "../../.. $(inherited)";
- };
- name = Release;
- };
- F93A88770E8B4C700026AF89 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- INFOPLIST_FILE = "obj-cTestCases-Info.plist";
- PRODUCT_NAME = octestcases;
- USER_HEADER_SEARCH_PATHS = "../../../..//**";
- WRAPPER_EXTENSION = octest;
- };
- name = Debug;
- };
- F93A88780E8B4C700026AF89 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- INFOPLIST_FILE = "obj-cTestCases-Info.plist";
- PRODUCT_NAME = octestcases;
- USER_HEADER_SEARCH_PATHS = "../../../..//**";
- WRAPPER_EXTENSION = octest;
- };
- name = Release;
- };
- F9AE19C40DB04A9500C98454 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- INFOPLIST_FILE = "minidump_tests64-Info.plist";
- PRODUCT_NAME = minidump_tests64;
- USER_HEADER_SEARCH_PATHS = "../../../**";
- WRAPPER_EXTENSION = cptest;
- };
- name = Debug;
- };
- F9AE19C50DB04A9500C98454 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- INFOPLIST_FILE = "minidump_tests64-Info.plist";
- PRODUCT_NAME = minidump_tests64;
- USER_HEADER_SEARCH_PATHS = "../../../**";
- WRAPPER_EXTENSION = cptest;
- };
- name = Release;
- };
- F9AE5B350DBFDBA300505983 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- INFOPLIST_FILE = "minidump_tests32-Info.plist";
- PRODUCT_NAME = minidump_tests32;
- USER_HEADER_SEARCH_PATHS = "../../../**";
- WRAPPER_EXTENSION = cptest;
- };
- name = Debug;
- };
- F9AE5B370DBFDBA300505983 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks";
- INFOPLIST_FILE = "minidump_tests32-Info.plist";
- PRODUCT_NAME = minidump_tests32;
- USER_HEADER_SEARCH_PATHS = "../../../**";
- WRAPPER_EXTENSION = cptest;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB923108733DC60010E9CD /* Build configuration list for PBXNativeTarget "generator_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB923208733DC60010E9CD /* Debug */,
- 1DEB923308733DC60010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB923508733DC60010E9CD /* Build configuration list for PBXProject "minidump_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB923608733DC60010E9CD /* Debug */,
- 1DEB923708733DC60010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 9B7CA8500B12984300CD3A1D /* Build configuration list for PBXNativeTarget "unit_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 9B7CA8510B12984300CD3A1D /* Debug */,
- 9B7CA8520B12984300CD3A1D /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 9BD82AA60B0026BF0055103E /* Build configuration list for PBXNativeTarget "handler_test" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 9BD82AA70B0026BF0055103E /* Debug */,
- 9BD82AA80B0026BF0055103E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F93A88790E8B4C700026AF89 /* Build configuration list for PBXNativeTarget "obj-c_TestCases" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F93A88770E8B4C700026AF89 /* Debug */,
- F93A88780E8B4C700026AF89 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F9AE19C70DB04AA200C98454 /* Build configuration list for PBXNativeTarget "minidump_tests64" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F9AE19C40DB04A9500C98454 /* Debug */,
- F9AE19C50DB04A9500C98454 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- F9AE5B380DBFDBA300505983 /* Build configuration list for PBXNativeTarget "minidump_tests32" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- F9AE5B350DBFDBA300505983 /* Debug */,
- F9AE5B370DBFDBA300505983 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests32-Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests32-Info.plist
deleted file mode 100644
index 921ebf3574..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests32-Info.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>com.google.breakpad.minidump_tests32</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests64-Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests64-Info.plist
deleted file mode 100644
index acfbd3091e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/minidump_tests64-Info.plist
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>com.google.breakpad.minidump_tests64</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>CSResourcesFileMapped</key>
- <string>yes</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
deleted file mode 100644
index 7b3260808e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'breakpad_nlist_64.cc',
- 'dynamic_images.cc',
- 'exception_handler.cc',
- 'minidump_generator.cc',
-]
-
-# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '../../..',
-]
-
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/obj-cTestCases-Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/obj-cTestCases-Info.plist
deleted file mode 100644
index 65013556de..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/obj-cTestCases-Info.plist
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIdentifier</key>
- <string>com.yourcompany.${PRODUCT_NAME:identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundlePackageType</key>
- <string>BNDL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc
deleted file mode 100644
index 6142ad124a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// ProtectedMemoryAllocator
-//
-// See the header file for documentation
-
-#include "protected_memory_allocator.h"
-#include <assert.h>
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-ProtectedMemoryAllocator::ProtectedMemoryAllocator(vm_size_t pool_size)
- : pool_size_(pool_size),
- next_alloc_offset_(0),
- valid_(false) {
-
- kern_return_t result = vm_allocate(mach_task_self(),
- &base_address_,
- pool_size,
- TRUE
- );
-
- valid_ = (result == KERN_SUCCESS);
- assert(valid_);
-}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-ProtectedMemoryAllocator::~ProtectedMemoryAllocator() {
- vm_deallocate(mach_task_self(),
- base_address_,
- pool_size_
- );
-}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-char *ProtectedMemoryAllocator::Allocate(vm_size_t bytes) {
- if (valid_ && next_alloc_offset_ + bytes <= pool_size_) {
- char *p = (char*)base_address_ + next_alloc_offset_;
- next_alloc_offset_ += bytes;
- return p;
- }
-
- return NULL; // ran out of memory in our allocation block
-}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-kern_return_t ProtectedMemoryAllocator::Protect() {
- kern_return_t result = vm_protect(mach_task_self(),
- base_address_,
- pool_size_,
- FALSE,
- VM_PROT_READ);
-
- return result;
-}
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-kern_return_t ProtectedMemoryAllocator::Unprotect() {
- kern_return_t result = vm_protect(mach_task_self(),
- base_address_,
- pool_size_,
- FALSE,
- VM_PROT_READ | VM_PROT_WRITE);
-
- return result;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h
deleted file mode 100644
index 7e188db268..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/protected_memory_allocator.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// ProtectedMemoryAllocator
-//
-// A very simple allocator class which allows allocation, but not deallocation.
-// The allocations can be made read-only with the Protect() method.
-// This class is NOT useful as a general-purpose memory allocation system,
-// since it does not allow deallocation. It is useful to use for a group
-// of allocations which are created in the same time-frame and destroyed
-// in the same time-frame. It is useful for making allocations of memory
-// which will not need to change often once initialized. This memory can then
-// be protected from memory smashers by calling the Protect() method.
-
-#ifndef PROTECTED_MEMORY_ALLOCATOR_H__
-#define PROTECTED_MEMORY_ALLOCATOR_H__
-
-#include <mach/mach.h>
-
-//
-class ProtectedMemoryAllocator {
- public:
- ProtectedMemoryAllocator(vm_size_t pool_size);
- ~ProtectedMemoryAllocator();
-
- // Returns a pointer to an allocation of size n within the pool.
- // Fails by returning NULL is no more space is available.
- // Please note that the pointers returned from this method should not
- // be freed in any way (for example by calling free() on them ).
- char * Allocate(vm_size_t n);
-
- // Returns the base address of the allocation pool.
- char * GetBaseAddress() { return (char*)base_address_; }
-
- // Returns the size of the allocation pool, including allocated
- // plus free space.
- vm_size_t GetTotalSize() { return pool_size_; }
-
- // Returns the number of bytes already allocated in the pool.
- vm_size_t GetAllocatedSize() { return next_alloc_offset_; }
-
- // Returns the number of bytes available for allocation.
- vm_size_t GetFreeSize() { return pool_size_ - next_alloc_offset_; }
-
- // Makes the entire allocation pool read-only including, of course,
- // all allocations made from the pool.
- kern_return_t Protect();
-
- // Makes the entire allocation pool read/write.
- kern_return_t Unprotect();
-
- private:
- vm_size_t pool_size_;
- vm_address_t base_address_;
- vm_size_t next_alloc_offset_;
- bool valid_;
-};
-
-#endif // PROTECTED_MEMORY_ALLOCATOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc
deleted file mode 100644
index 0fc7825b24..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// DynamicImagesTests.cpp
-// minidump_test
-//
-// Created by Neal Sidhwaney on 4/17/08.
-// Copyright 2008 Google Inc. All rights reserved.
-//
-
-#include "client/mac/handler/testcases/DynamicImagesTests.h"
-#include "client/mac/handler/dynamic_images.h"
-
-DynamicImagesTests test2(TEST_INVOCATION(DynamicImagesTests,
- ReadTaskMemoryTest));
-DynamicImagesTests test3(TEST_INVOCATION(DynamicImagesTests,
- ReadLibrariesFromLocalTaskTest));
-
-DynamicImagesTests::DynamicImagesTests(TestInvocation *invocation)
- : TestCase(invocation) {
-}
-
-DynamicImagesTests::~DynamicImagesTests() {
-}
-
-void DynamicImagesTests::ReadTaskMemoryTest() {
- kern_return_t kr;
-
- // pick test2 as a symbol we know to be valid to read
- // anything will work, really
- void *addr = reinterpret_cast<void*>(&test2);
- std::vector<uint8_t> buf(getpagesize());
-
- fprintf(stderr, "reading 0x%p\n", addr);
- kr = google_breakpad::ReadTaskMemory(mach_task_self(),
- (uint64_t)addr,
- getpagesize(),
- buf);
-
- CPTAssert(kr == KERN_SUCCESS);
-
- CPTAssert(0 == memcmp(&buf[0], (const void*)addr, getpagesize()));
-}
-
-void DynamicImagesTests::ReadLibrariesFromLocalTaskTest() {
-
- mach_port_t me = mach_task_self();
- google_breakpad::DynamicImages *d = new google_breakpad::DynamicImages(me);
-
- fprintf(stderr,"Local task image count: %d\n", d->GetImageCount());
-
- CPTAssert(d->GetImageCount() > 0);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.h
deleted file mode 100644
index e1e79993bb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/DynamicImagesTests.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// DynamicImagesTests.h
-// minidump_test
-//
-// Created by Neal Sidhwaney on 4/17/08.
-// Copyright 2008 Google Inc. All rights reserved.
-//
-//
-
-#ifndef _CLIENT_MAC_HANDLER_TESTCASES_DYNAMICIMAGESTESTS_H__
-#define _CLIENT_MAC_HANDLER_TESTCASES_DYNAMICIMAGESTESTS_H__
-
-#include <CPlusTest/CPlusTest.h>
-
-class DynamicImagesTests : public TestCase {
- public:
- explicit DynamicImagesTests(TestInvocation* invocation);
- virtual ~DynamicImagesTests();
-
- void ReadTaskMemoryTest();
- void ReadLibrariesFromLocalTaskTest();
-};
-
-#endif /* _CLIENT_MAC_HANDLER_TESTCASES_DYNAMICIMAGESTESTS_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc
deleted file mode 100644
index e7332bfb65..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// breakpad_nlist_test.cc
-// minidump_test
-//
-// Created by Neal Sidhwaney on 4/13/08.
-// Copyright 2008 Google Inc. All rights reserved.
-//
-
-#include "client/mac/handler/testcases/breakpad_nlist_test.h"
-#include <mach-o/nlist.h>
-#include "client/mac/handler/breakpad_nlist_64.h"
-
-BreakpadNlistTest test1(TEST_INVOCATION(BreakpadNlistTest, CompareToNM));
-
-BreakpadNlistTest::BreakpadNlistTest(TestInvocation *invocation)
- : TestCase(invocation) {
-}
-
-
-BreakpadNlistTest::~BreakpadNlistTest() {
-}
-
-void BreakpadNlistTest::CompareToNM() {
-#if TARGET_CPU_X86_64
- system("/usr/bin/nm -arch x86_64 /usr/lib/dyld > /tmp/dyld-namelist.txt");
-#elif TARGET_CPU_PPC64
- system("/usr/bin/nm -arch ppc64 /usr/lib/dyld > /tmp/dyld-namelist.txt");
-#endif
-
- FILE *fd = fopen("/tmp/dyld-namelist.txt", "rt");
-
- char oneNMAddr[30];
- char symbolType;
- char symbolName[500];
- while (!feof(fd)) {
- fscanf(fd, "%s %c %s", oneNMAddr, &symbolType, symbolName);
- breakpad_nlist symbolList[2];
- breakpad_nlist &list = symbolList[0];
-
- memset(symbolList, 0, sizeof(breakpad_nlist)*2);
- const char *symbolNames[2];
- symbolNames[0] = (const char*)symbolName;
- symbolNames[1] = "\0";
- breakpad_nlist_64("/usr/lib/dyld", &list, symbolNames);
- uint64_t nmAddr = strtol(oneNMAddr, NULL, 16);
- if (!IsSymbolMoreThanOnceInDyld(symbolName)) {
- CPTAssert(nmAddr == symbolList[0].n_value);
- }
- }
-
- fclose(fd);
-}
-
-bool BreakpadNlistTest::IsSymbolMoreThanOnceInDyld(const char *symbolName) {
- // These are the symbols that occur more than once when nm dumps
- // the symbol table of /usr/lib/dyld. Our nlist program returns
- // the first address because it's doing a search so we need to exclude
- // these from causing the test to fail
- const char *multipleSymbols[] = {
- "__Z41__static_initialization_and_destruction_0ii",
- "___tcf_0",
- "___tcf_1",
- "_read_encoded_value_with_base",
- "_read_sleb128",
- "_read_uleb128",
- "\0"};
-
- bool found = false;
-
- for (int i = 0; multipleSymbols[i][0]; i++) {
- if (!strcmp(multipleSymbols[i], symbolName)) {
- found = true;
- break;
- }
- }
-
- return found;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h
deleted file mode 100644
index e93657cc90..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/breakpad_nlist_test.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// breakpad_nlist_test.h
-// minidump_test
-//
-// Created by Neal Sidhwaney on 4/13/08.
-// Copyright 2008 Google Inc. All rights reserved.
-//
-//
-
-#ifndef CLIENT_MAC_HANDLER_TESTCASES_BREAKPAD_NLIST_TEST_H__
-#define CLIENT_MAC_HANDLER_TESTCASES_BREAKPAD_NLIST_TEST_H__
-
-#include <CPlusTest/CPlusTest.h>
-
-class BreakpadNlistTest : public TestCase {
- private:
-
- // nm dumps multiple addresses for the same symbol in
- // /usr/lib/dyld. So we track those so we don't report failures
- // in mismatches between what our nlist returns and what nm has
- // for the duplicate symbols.
- bool IsSymbolMoreThanOnceInDyld(const char *symbolName);
-
- public:
- explicit BreakpadNlistTest(TestInvocation* invocation);
- virtual ~BreakpadNlistTest();
-
-
- /* This test case runs nm on /usr/lib/dyld and then compares the
- output of every symbol to what our nlist implementation returns */
- void CompareToNM();
-};
-
-#endif /* CLIENT_MAC_HANDLER_TESTCASES_BREAKPAD_NLIST_TEST_H__*/
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.h
deleted file mode 100644
index 21ff7a44f0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// dwarftests.h
-// minidump_test
-//
-// Created by Neal Sidhwaney on 9/24/08.
-// Copyright 2008 Google Inc. All rights reserved.
-//
-
-#import <SenTestingKit/SenTestingKit.h>
-
-
-@interface dwarftests : SenTestCase {
-
-}
-
-- (void) testDWARFSymbolFileGeneration;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.mm
deleted file mode 100644
index 40c69aff25..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/dwarftests.mm
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// dwarftests.m
-// minidump_test
-//
-// Created by Neal Sidhwaney on 9/24/08.
-// Copyright 2008 Google Inc. All rights reserved.
-//
-
-#import "dwarftests.h"
-#import "dump_syms.h"
-
-@implementation dwarftests
-- (void) testDWARFSymbolFileGeneration {
- NSString *inputBreakpadSymbolFile = @"testcases/testdata/dump_syms_i386_breakpad.sym";
- NSString *outputBreakpadSymbolFile = @"/tmp/dump_syms_i386.breakpad";
-
- DumpSymbols *dump = [[DumpSymbols alloc] initWithContentsOfFile:@"testcases/testdata/dump_syms_dwarf_data"];
-
- STAssertNotNil(dump, @"DumpSymbols is nil");
- [dump setArchitecture:@"i386"];
- [dump writeSymbolFile:outputBreakpadSymbolFile];
-
- NSData *d = [[NSData alloc] initWithContentsOfFile:inputBreakpadSymbolFile];
- STAssertNotNil(d, @"Input breakpad symbol file not found");
-
- NSData *d1 = [[NSData alloc] initWithContentsOfFile:outputBreakpadSymbolFile];
- STAssertNotNil(d1, @"Output breakpad symbol file not found");
-
- STAssertTrue([d isEqualToData:d1],
- @"Symbol files were not equal!",nil);
-}
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_dwarf_data b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_dwarf_data
deleted file mode 100644
index 5be17aeedc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_dwarf_data
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym
deleted file mode 100644
index bca43c1037..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/testcases/testdata/dump_syms_i386_breakpad.sym
+++ /dev/null
@@ -1,5300 +0,0 @@
-MODULE mac x86 94BF873C47A73BC07125291390B4C5F10 dump_syms_dwarf_data
-FILE 1 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/libkern/i386/OSByteOrder.h
-FILE 2 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/architecture/byte_order.h
-FILE 3 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/dump_syms.mm
-FILE 4 /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSRange.h
-FILE 5 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/new
-FILE 6 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/hash_fun.h
-FILE 7 ../../../common/mac/dwarf/dwarf2reader.h
-FILE 8 ../../../common/mac/file_id.h
-FILE 9 ../../../common/mac/dwarf/functioninfo.h
-FILE 10 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_tree.h
-FILE 11 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_iterator.h
-FILE 12 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/hashtable.h
-FILE 13 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_pair.h
-FILE 14 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/new_allocator.h
-FILE 15 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/allocator.h
-FILE 16 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_vector.h
-FILE 17 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_iterator_base_types.h
-FILE 18 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_iterator_base_funcs.h
-FILE 19 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_algo.h
-FILE 20 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_map.h
-FILE 21 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_construct.h
-FILE 22 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_function.h
-FILE 23 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/hash_map
-FILE 24 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/basic_string.h
-FILE 25 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_algobase.h
-FILE 26 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_list.h
-FILE 27 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/list.tcc
-FILE 28 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_uninitialized.h
-FILE 29 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/vector.tcc
-FILE 30 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/dwarf/functioninfo.cc
-FILE 31 ../../../common/mac/dwarf/dwarf2reader.h
-FILE 32 ../../../common/mac/dwarf/functioninfo.h
-FILE 33 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_pair.h
-FILE 34 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/hashtable.h
-FILE 35 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/memory
-FILE 36 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/new_allocator.h
-FILE 37 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/basic_string.h
-FILE 38 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_iterator.h
-FILE 39 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_vector.h
-FILE 40 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_tree.h
-FILE 41 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_function.h
-FILE 42 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/hash_map
-FILE 43 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_construct.h
-FILE 44 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_algobase.h
-FILE 45 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_map.h
-FILE 46 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_uninitialized.h
-FILE 47 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/vector.tcc
-FILE 48 /g/code/breakpad-staging/src/tools/mac/dump_syms/dump_syms_tool.mm
-FILE 49 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/file_id.cc
-FILE 50 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/architecture/byte_order.h
-FILE 51 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/macho_id.cc
-FILE 52 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/libkern/i386/OSByteOrder.h
-FILE 53 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/architecture/byte_order.h
-FILE 54 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/macho_walker.cc
-FILE 55 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/libkern/i386/OSByteOrder.h
-FILE 56 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/architecture/byte_order.h
-FILE 57 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/macho_utilities.cc
-FILE 58 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/dwarf/bytereader.cc
-FILE 59 ../../../common/mac/dwarf/bytereader-inl.h
-FILE 60 /g/code/breakpad-staging/src/tools/mac/dump_syms/../../../common/mac/dwarf/dwarf2reader.cc
-FILE 61 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_algobase.h
-FILE 62 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_deque.h
-FILE 63 ../../../common/mac/dwarf/bytereader.h
-FILE 64 ../../../common/mac/dwarf/bytereader-inl.h
-FILE 65 ../../../common/mac/dwarf/line_state_machine.h
-FILE 66 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_list.h
-FILE 67 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/memory
-FILE 68 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/ext/new_allocator.h
-FILE 69 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/allocator.h
-FILE 70 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_pair.h
-FILE 71 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_vector.h
-FILE 72 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_iterator.h
-FILE 73 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_construct.h
-FILE 74 ../../../common/mac/dwarf/dwarf2reader.h
-FILE 75 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_stack.h
-FILE 76 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/deque.tcc
-FILE 77 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/list.tcc
-FILE 78 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/vector.tcc
-FILE 79 /Developer/SDKs/MacOSX10.4u.sdk/usr/include/c++/4.0.0/bits/stl_uninitialized.h
-FILE 80 /var/tmp/gcc/gcc-5484~1/src/gcc/libgcc2.c
-FUNC 162a 28 0 _OSSwapInt16
-162a 10 44 55
-163a 16 46 55
-1650 2 47 55
-FUNC 1652 1c 0 _OSSwapInt32
-1652 f 53 55
-1661 8 55 55
-1669 3 56 55
-166c 2 57 55
-FUNC 166e 2b 0 _OSSwapInt64
-166e 12 64 55
-1680 11 69 55
-1691 6 70 55
-1697 2 71 55
-1699 1 71 55
-FUNC 169a 1e 0 NXSwapShort
-169a 10 43 56
-16aa c 45 56
-16b6 2 46 56
-FUNC 16b8 19 0 NXSwapInt
-16b8 f 52 56
-16c7 8 54 56
-16cf 2 55 56
-16d1 1 55 56
-FUNC 16d2 19 0 NXSwapLong
-16d2 f 61 56
-16e1 8 63 56
-16e9 2 64 56
-16eb 1 64 56
-FUNC 16ec 1f 0 NXSwapLongLong
-16ec 12 70 56
-16fe b 72 56
-1709 2 73 56
-170b 1 73 56
-FUNC 170c 181 0 -[DumpSymbols convertCPlusPlusSymbols:]
-170c 14 128 3
-1720 54 130 3
-1774 f 132 3
-1783 7 133 3
-178a 1a 136 3
-17a4 5 138 3
-17a9 1a 139 3
-17c3 23 140 3
-17e6 7 141 3
-17ed 44 142 3
-1831 1e 145 3
-184f 29 138 3
-1878 b 148 3
-1883 3 150 3
-1886 7 151 3
-188d 1 151 3
-FUNC 188e 323 0 -[DumpSymbols convertSymbols]
-188e 14 154 3
-18a2 1f 155 3
-18c1 3e 156 3
-18ff 2b 160 3
-192a c 162 3
-1936 43 164 3
-1979 2a 165 3
-19a3 20 168 3
-19c3 d 169 3
-19d0 1e 171 3
-19ee 11 162 3
-19ff 7 181 3
-1a06 6 182 3
-1a0c 5 184 3
-1a11 15 185 3
-1a26 6 18 4
-1a2c 6 19 4
-1a32 6 20 4
-1a38 6 185 3
-1a3e 28 186 3
-1a66 21 187 3
-1a87 1a 188 3
-1aa1 a 190 3
-1aab c 194 3
-1ab7 43 198 3
-1afa 21 199 3
-1b1b 20 202 3
-1b3b 2e 203 3
-1b69 1e 194 3
-1b87 c 184 3
-1b93 17 207 3
-1baa 7 208 3
-1bb1 1 208 3
-FUNC 1bb2 4a2 0 -[DumpSymbols addFunction:line:address:section:]
-1bb2 21 211 3
-1bd3 2f 212 3
-1c02 e 214 3
-1c10 4 219 3
-1c14 2a 221 3
-1c3e 22 223 3
-1c60 6 224 3
-1c66 2a 225 3
-1c90 4 226 3
-1c94 2e 230 3
-1cc2 2e 233 3
-1cf0 2e 236 3
-1d1e a 239 3
-1d28 2b 253 3
-1d53 e 254 3
-1d61 3c 255 3
-1d9d 22 32 4
-1dbf 3 256 3
-1dc2 6 259 3
-1dc8 a 260 3
-1dd2 3c 261 3
-1e0e 25 262 3
-1e33 2a 263 3
-1e5d 22 265 3
-1e7f 26 270 3
-1ea5 6 272 3
-1eab 37 273 3
-1ee2 2a 274 3
-1f0c 17 275 3
-1f23 43 278 3
-1f66 2e 279 3
-1f94 23 282 3
-1fb7 43 285 3
-1ffa 52 287 3
-204c 8 289 3
-FUNC 2054 5a4 0 -[DumpSymbols processSymbolItem:stringTable:]
-2054 18 292 3
-206c 8 293 3
-2074 4 294 3
-2078 16 297 3
-208e c 298 3
-209a f 300 3
-20a9 b 301 3
-20b4 16 303 3
-20ca 4d 309 3
-2117 38 311 3
-214f 30 315 3
-217f 60 317 3
-21df d 322 3
-21ec 2b 325 3
-2217 3a 327 3
-2251 f 332 3
-2260 2d 333 3
-228d 1a 334 3
-22a7 32 335 3
-22d9 20 342 3
-22f9 c 343 3
-2305 24 348 3
-2329 a 349 3
-2333 3c 350 3
-236f 2a 352 3
-2399 1c 353 3
-23b5 9 354 3
-23be f 356 3
-23cd 2d 357 3
-23fa 2f 358 3
-2429 20 360 3
-2449 c 361 3
-2455 7 363 3
-245c 21 365 3
-247d 4a 368 3
-24c7 9 370 3
-24d0 1a 371 3
-24ea 4b 372 3
-2535 4 373 3
-2539 5 371 3
-253e 29 374 3
-2567 2d 376 3
-2594 4b 378 3
-25df 4 379 3
-25e3 a 382 3
-25ed b 383 3
-FUNC 25f8 c9 0 -[DumpSymbols loadSymbolInfo:offset:]
-25f8 13 391 3
-260b 2b 392 3
-2636 2a 393 3
-2660 2d 395 3
-268d 2e 398 3
-26bb 6 399 3
-26c1 1 399 3
-FUNC 26c2 2be 0 -[DumpSymbols loadSTABSSymbolInfo:offset:]
-26c2 16 537 3
-26d8 9 538 3
-26e1 10 539 3
-26f1 2e 540 3
-271f 9 542 3
-2728 22 543 3
-274a 4 544 3
-274e a 546 3
-2758 3c 547 3
-2794 c 549 3
-27a0 e 550 3
-27ae 6 551 3
-27b4 25 552 3
-27d9 25 553 3
-27fe 25 554 3
-2823 c 555 3
-282f c 556 3
-283b c 559 3
-2847 23 562 3
-286a a 563 3
-2874 a 564 3
-287e 2e 565 3
-28ac 39 566 3
-28e5 2e 570 3
-2913 4 571 3
-2917 17 559 3
-292e 25 575 3
-2953 9 576 3
-295c 17 549 3
-2973 4 579 3
-2977 9 580 3
-FUNC 2980 28a 0 -[DumpSymbols loadSymbolInfo64:offset:]
-2980 16 583 3
-2996 9 585 3
-299f 10 586 3
-29af 2e 587 3
-29dd 9 589 3
-29e6 22 590 3
-2a08 4 591 3
-2a0c c 593 3
-2a18 e 594 3
-2a26 6 595 3
-2a2c 25 596 3
-2a51 25 597 3
-2a76 25 598 3
-2a9b 9 599 3
-2aa4 c 600 3
-2ab0 c 603 3
-2abc 17 604 3
-2ad3 23 609 3
-2af6 a 610 3
-2b00 a 611 3
-2b0a 2e 612 3
-2b38 37 613 3
-2b6f 2e 615 3
-2b9d 4 616 3
-2ba1 17 603 3
-2bb8 25 620 3
-2bdd 9 621 3
-2be6 17 593 3
-2bfd 4 624 3
-2c01 9 625 3
-FUNC 2c0a 199 0 -[DumpSymbols loadSymbolInfoForArchitecture]
-2c0a 13 628 3
-2c1d 41 630 3
-2c5e 2b 631 3
-2c89 1a 632 3
-2ca3 40 634 3
-2ce3 40 635 3
-2d23 5f 637 3
-2d82 17 639 3
-2d99 4 640 3
-2d9d 6 641 3
-2da3 1 641 3
-FUNC 2da4 3e5 0 -[DumpSymbols loadHeader:offset:]
-2da4 18 728 3
-2dbc 9 729 3
-2dc5 10 730 3
-2dd5 2e 731 3
-2e03 9 733 3
-2e0c 2b 734 3
-2e37 1e 736 3
-2e55 c 738 3
-2e61 e 739 3
-2e6f 6 740 3
-2e75 50 742 3
-2ec5 2e 743 3
-2ef3 2e 744 3
-2f21 2e 745 3
-2f4f 20 746 3
-2f6f 1b7 755 3
-3126 9 757 3
-312f 25 761 3
-3154 9 762 3
-315d 17 738 3
-3174 a 765 3
-317e b 766 3
-3189 1 766 3
-FUNC 318a 41d 0 -[DumpSymbols loadHeader64:offset:]
-318a 18 769 3
-31a2 9 771 3
-31ab 10 772 3
-31bb 2e 773 3
-31e9 9 775 3
-31f2 c 777 3
-31fe 2b 778 3
-3229 e 779 3
-3237 6 780 3
-323d 50 781 3
-328d 49 782 3
-32d6 49 783 3
-331f 2e 784 3
-334d 9 785 3
-3356 29 786 3
-337f 1c5 794 3
-3544 9 795 3
-354d 25 799 3
-3572 9 800 3
-357b 17 777 3
-3592 a 803 3
-359c b 804 3
-35a7 1 804 3
-FUNC 35a8 52a 0 -[DumpSymbols loadModuleInfo]
-35a8 14 807 3
-35bc e 808 3
-35ca 41 810 3
-360b 1a 811 3
-3625 6 812 3
-362b 6 814 3
-3631 17 815 3
-3648 c 816 3
-3654 29 820 3
-367d 29 821 3
-36a6 29 822 3
-36cf 35 824 3
-3704 12 826 3
-3716 17 827 3
-372d c 828 3
-3739 3c 832 3
-3775 a 834 3
-377f 9 836 3
-3788 25 837 3
-37ad c 839 3
-37b9 54 840 3
-380d 57 841 3
-3864 57 842 3
-38bb 57 843 3
-3912 57 844 3
-3969 1c 846 3
-3985 4b 847 3
-39d0 49 849 3
-3a19 13 839 3
-3a2c 6 851 3
-3a32 3c 852 3
-3a6e 3a 854 3
-3aa8 17 857 3
-3abf c 858 3
-3acb 7 859 3
-FUNC 3ad2 b6 0 WriteFormat
-3ad2 10 862 3
-3ae2 6 867 3
-3ae8 24 868 3
-3b0c 27 869 3
-3b33 40 870 3
-3b73 c 873 3
-3b7f 9 874 3
-FUNC 3b88 35 0 -[DumpSymbols availableArchitectures]
-3b88 13 1140 3
-3b9b 1c 1141 3
-3bb7 6 1142 3
-3bbd 1 1142 3
-FUNC 3bbe 1b4 0 -[DumpSymbols setArchitecture:]
-3bbe 13 1158 3
-3bd1 1a 1159 3
-3beb 4 1160 3
-3bef 2a 1162 3
-3c19 9 1163 3
-3c22 2a 1165 3
-3c4c 9 1166 3
-3c55 9 1167 3
-3c5e 2a 1169 3
-3c88 6 1170 3
-3c8e 2a 1172 3
-3cb8 6 1173 3
-3cbe 2a 1175 3
-3ce8 4 1176 3
-3cec 6 1179 3
-3cf2 2c 1180 3
-3d1e 9 1181 3
-3d27 1c 1183 3
-3d43 1f 1184 3
-3d62 a 1187 3
-3d6c 6 1188 3
-FUNC 3d72 14 0 -[DumpSymbols architecture]
-3d72 c 1191 3
-3d7e 6 1192 3
-3d84 2 1193 3
-FUNC 3d86 e7 0 -[DumpSymbols writeSymbolFile:]
-3d86 13 1196 3
-3d99 1a 1197 3
-3db3 48 1200 3
-3dfb 9 1201 3
-3e04 1e 1203 3
-3e22 6 1205 3
-3e28 9 1206 3
-3e31 21 1208 3
-3e52 b 1210 3
-3e5d a 1212 3
-3e67 6 1213 3
-3e6d 1 1213 3
-FUNC 3e6e 65 0 -[MachSection initWithMachSection:andNumber:]
-3e6e 13 1219 3
-3e81 37 1220 3
-3eb8 9 1221 3
-3ec1 9 1222 3
-3eca 3 1225 3
-3ecd 6 1226 3
-3ed3 1 1226 3
-FUNC 3ed4 14 0 -[MachSection sectionPointer]
-3ed4 c 1228 3
-3ee0 6 1229 3
-3ee6 2 1230 3
-FUNC 3ee8 14 0 -[MachSection sectionNumber]
-3ee8 c 1232 3
-3ef4 6 1233 3
-3efa 2 1234 3
-FUNC 3efc 17c 0 -[DumpSymbols processDWARFSourceFileInfo:]
-3efc 14 459 3
-3f10 a 460 3
-3f1a 3c 461 3
-3f56 20 463 3
-3f76 5 464 3
-3f7b 3a 465 3
-3fb5 1d 466 3
-3fd2 3a 467 3
-400c 2a 468 3
-4036 3b 464 3
-4071 7 471 3
-FUNC 4078 1d7 0 DumpFunctionMap(std::map<unsigned long long, dwarf2reader::FunctionInfo*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >)
-4078 15 82 3
-408d 13 83 3
-40a0 1e 85 3
-40be 42 89 3
-4100 20 90 3
-4120 2b 91 3
-414b 1a 92 3
-4165 23 93 3
-4188 46 96 3
-41ce 46 99 3
-4214 33 83 3
-4247 8 102 3
-424f 1 102 3
-FUNC 4250 3ef 0 -[DumpSymbols processDWARFFunctionInfo:]
-4250 15 473 3
-4265 25 474 3
-428a 1e 476 3
-42a8 a 480 3
-42b2 3c 481 3
-42ee 3d 483 3
-432b 23 485 3
-434e 26 487 3
-4374 6 489 3
-437a 37 490 3
-43b1 2a 491 3
-43db 17 492 3
-43f2 30 496 3
-4422 3d 497 3
-445f 2e 498 3
-448d 30 502 3
-44bd 64 504 3
-4521 34 507 3
-4555 9d 509 3
-45f2 45 474 3
-4637 8 513 3
-463f 1 513 3
-FUNC 4640 1f5 0 -[DumpSymbols processDWARFLineNumberInfo:]
-4640 15 515 3
-4655 25 516 3
-467a 39 520 3
-46b3 26 521 3
-46d9 6 523 3
-46df 37 524 3
-4716 2a 525 3
-4740 17 526 3
-4757 30 529 3
-4787 61 531 3
-47e8 45 516 3
-482d 8 534 3
-4835 1 534 3
-FUNC 4836 10f 0 -[DumpSymbols dealloc]
-4836 13 1145 3
-4849 1c 1146 3
-4865 1c 1147 3
-4881 1c 1148 3
-489d 1c 1149 3
-48b9 1c 1150 3
-48d5 1c 1151 3
-48f1 25 1152 3
-4916 29 1154 3
-493f 6 1155 3
-4945 1 1155 3
-FUNC 4946 512 0 -[DumpSymbols loadDWARFSymbolInfo:offset:]
-4946 17 402 3
-495d 9 405 3
-4966 10 406 3
-4976 2b 408 3
-49a1 38 409 3
-49d9 3a 410 3
-4a13 2e 411 3
-4a41 31 416 3
-4a72 e 418 3
-4a80 24 420 3
-4aa4 5 422 3
-4aa9 b 424 3
-4ab4 b 425 3
-4abf e 426 3
-4acd 2b 427 3
-4af8 2b 428 3
-4b23 2c 431 3
-4b4f 52 439 3
-4ba1 34 444 3
-4bd5 1a 446 3
-4bef 21 451 3
-4c10 1e 452 3
-4c2e 21 453 3
-4c4f 40 422 3
-4c8f 6 453 3
-4c95 170 422 3
-4e05 43 456 3
-4e48 10 457 3
-FUNC 4e58 4fd 0 -[DumpSymbols generateSectionDictionary:]
-4e58 18 663 3
-4e70 10 665 3
-4e80 2e 666 3
-4eae 9 668 3
-4eb7 2b 669 3
-4ee2 7 670 3
-4ee9 2e 672 3
-4f17 d 676 3
-4f24 32 678 3
-4f56 29 680 3
-4f7f a 684 3
-4f89 3c 685 3
-4fc5 31 688 3
-4ff6 5d 689 3
-5053 26 692 3
-5079 21 694 3
-509a c 698 3
-50a6 e 699 3
-50b4 6 700 3
-50ba 9 701 3
-50c3 2e 702 3
-50f1 c 704 3
-50fd 3c 706 3
-5139 66 709 3
-519f 1c 712 3
-51bb fb 714 3
-52b6 6 717 3
-52bc 5 718 3
-52c1 19 704 3
-52da 25 714 3
-52ff 2e 722 3
-532d 9 723 3
-5336 17 698 3
-534d 8 725 3
-5355 1 725 3
-FUNC 5356 24a 0 -[DumpSymbols getSectionMapForArchitecture:]
-5356 14 643 3
-536a 43 645 3
-53ad 1a 648 3
-53c7 1c 645 3
-53e3 18 648 3
-53fb 40 650 3
-543b 20 651 3
-545b 17 652 3
-5472 16 651 3
-5488 cb 652 3
-5553 11 654 3
-5564 32 657 3
-5596 a 658 3
-FUNC 55a0 3fe 0 -[DumpSymbols initWithContentsOfFile:]
-55a0 14 1056 3
-55b4 3b 1057 3
-55ef 44 1059 3
-5633 17 1060 3
-564a c 1061 3
-5656 1f 1064 3
-5675 2b 1067 3
-56a0 a 1069 3
-56aa 35 1083 3
-56df 2 1087 3
-56e1 1a 1088 3
-56fb 3d 1087 3
-5738 33 1092 3
-576b 6 1094 3
-5771 e 1095 3
-577f 17 1096 3
-5796 c 1097 3
-57a2 1c 1101 3
-57be 1f 1103 3
-57dd 18 1104 3
-57f5 23 1107 3
-5818 25 1109 3
-583d 1c 1107 3
-5859 17 1110 3
-5870 c 1111 3
-587c 2a 1115 3
-58a6 8 1116 3
-58ae a 1118 3
-58b8 9 1119 3
-58c1 d 1122 3
-58ce 29 1124 3
-58f7 20 1126 3
-5917 20 1128 3
-5937 57 1132 3
-598e 9 1136 3
-5997 7 1137 3
-FUNC 599e d74 0 -[DumpSymbols outputSymbolFile:]
-599e 18 877 3
-59b6 2e 879 3
-59e4 30 880 3
-5a14 5d 882 3
-5a71 30 883 3
-5aa1 5d 885 3
-5afe 2e 888 3
-5b2c 38 891 3
-5b64 46 892 3
-5baa 26 893 3
-5bd0 20 895 3
-5bf0 20 904 3
-5c10 30 898 3
-5c40 f 899 3
-5c4f 1e 904 3
-5c6d 17 907 3
-5c84 17 908 3
-5c9b 44 911 3
-5cdf 44 914 3
-5d23 a 917 3
-5d2d 36 921 3
-5d63 30 923 3
-5d93 9 18 4
-5d9c 9 19 4
-5da5 c 20 4
-5db1 56 923 3
-5e07 74 925 3
-5e7b f 927 3
-5e8a 44 932 3
-5ece 20 933 3
-5eee c 934 3
-5efa 4e 935 3
-5f48 41 936 3
-5f89 f 937 3
-5f98 14 934 3
-5fac 7 941 3
-5fb3 14 942 3
-5fc7 14 943 3
-5fdb 1d 946 3
-5ff8 c 948 3
-6004 24 949 3
-6028 29 950 3
-6051 9 953 3
-605a 28 954 3
-6082 2e 955 3
-60b0 1e 957 3
-60ce 7 959 3
-60d5 26 962 3
-60fb 2a 963 3
-6125 2a 964 3
-614f 6 966 3
-6155 2a 967 3
-617f e 971 3
-618d 43 972 3
-61d0 4c 974 3
-621c 8 975 3
-6224 2e 979 3
-6252 2e 982 3
-6280 2e 985 3
-62ae 2e 988 3
-62dc 2e 991 3
-630a 2e 994 3
-6338 2e 997 3
-6366 2e 1000 3
-6394 54 1004 3
-63e8 c 1005 3
-63f4 e 1007 3
-6402 27 1008 3
-6429 8 1009 3
-6431 34 1010 3
-6465 24 1012 3
-6489 2 1013 3
-648b 2a 1017 3
-64b5 a 1019 3
-64bf 14 1020 3
-64d3 1d 1021 3
-64f0 a 1025 3
-64fa 32 1026 3
-652c 33 1028 3
-655f c 1029 3
-656b 55 1034 3
-65c0 f 1036 3
-65cf 16 1040 3
-65e5 61 1041 3
-6646 f 1043 3
-6655 47 1046 3
-669c c 1048 3
-66a8 11 948 3
-66b9 4e 1052 3
-6707 b 1053 3
-FUNC 6712 11 0 operator new(unsigned long, void*)
-6712 c 94 5
-671e 5 94 5
-6723 1 94 5
-FUNC 6724 e 0 operator delete(void*, void*)
-6724 c 98 5
-6730 2 98 5
-673e 7 76 6
-6745 2 77 6
-6747 1a 78 6
-6761 d 77 6
-676e 3 79 6
-6771 2 80 6
-6773 1 80 6
-6780 d 95 6
-678d 1 95 6
-678e 13 127 74
-67a1 2a 127 74
-67cb 1 127 74
-67cc 13 127 74
-67df 2a 127 74
-6809 1 127 74
-680a 13 127 74
-681d 2a 127 74
-6847 1 127 74
-FUNC 6848 e 0 dwarf2reader::LineInfoHandler::DefineDir(std::string const&, unsigned int)
-6848 c 131 7
-6854 2 131 74
-FUNC 6856 26 0 dwarf2reader::LineInfoHandler::DefineFile(std::string const&, int, unsigned int, unsigned long long, unsigned long long)
-6856 24 142 7
-687a 2 142 74
-FUNC 687c 1a 0 dwarf2reader::LineInfoHandler::AddLine(unsigned long long, unsigned int, unsigned int, unsigned int)
-687c 18 150 7
-6894 2 150 74
-6896 12 299 74
-68a8 12 299 74
-68ba 13 301 74
-68cd 2a 301 74
-68f7 1 301 74
-68f8 13 301 74
-690b 2a 301 74
-6935 1 301 74
-6936 13 301 74
-6949 2a 301 74
-6973 1 301 74
-FUNC 6974 44 0 dwarf2reader::Dwarf2Handler::StartCompilationUnit(unsigned long long, unsigned char, unsigned char, unsigned long long, unsigned char)
-6974 39 308 7
-69ad b 308 74
-FUNC 69b8 1f 0 dwarf2reader::Dwarf2Handler::StartDIE(unsigned long long, dwarf2reader::DwarfTag, std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > > const&)
-69b8 18 314 7
-69d0 7 314 74
-69d7 1 314 74
-FUNC 69d8 26 0 dwarf2reader::Dwarf2Handler::ProcessAttributeUnsigned(unsigned long long, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm, unsigned long long)
-69d8 24 323 7
-69fc 2 323 74
-FUNC 69fe 26 0 dwarf2reader::Dwarf2Handler::ProcessAttributeSigned(unsigned long long, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm, long long)
-69fe 24 332 7
-6a22 2 332 74
-FUNC 6a24 26 0 dwarf2reader::Dwarf2Handler::ProcessAttributeBuffer(unsigned long long, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm, char const*, unsigned long long)
-6a24 24 345 7
-6a48 2 345 74
-FUNC 6a4a 1a 0 dwarf2reader::Dwarf2Handler::ProcessAttributeString(unsigned long long, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm, std::string const&)
-6a4a 18 354 7
-6a62 2 354 74
-FUNC 6a64 1a 0 dwarf2reader::Dwarf2Handler::EndDIE(unsigned long long)
-6a64 18 360 7
-6a7c 2 360 74
-6a7e c 44 8
-6a8a 2 44 8
-6a8c 13 55 32
-6a9f 35 55 32
-6ad4 13 91 32
-6ae7 73 96 32
-6b5a 13 98 32
-6b6d 35 98 32
-6bae 1a 75 3
-6bc8 2 76 3
-FUNC 6bca 20 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator!=(std::_Rb_tree_const_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > const&) const
-6bca c 287 10
-6bd6 14 288 40
-FUNC 6bea 16 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator->() const
-6bea c 249 10
-6bf6 a 250 40
-6c0c 7 614 72
-6c13 1 614 72
-6c14 c 241 40
-6c20 c 242 40
-FUNC 6c2c 16 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator*() const
-6c2c c 245 11
-6c38 a 246 40
-6c42 c 241 40
-6c4e c 242 40
-FUNC 6c5a 20 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >::operator!=(std::_Rb_tree_const_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > const&) const
-6c5a c 287 11
-6c66 14 288 40
-FUNC 6c7a 16 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >::operator->() const
-6c7a c 249 11
-6c86 a 250 40
-6c90 c 185 34
-6c9c 18 186 34
-6cc0 14 204 34
-6cd4 c 69 70
-6ce0 d 69 70
-6ced 1 69 70
-6cee c 89 70
-6cfa 20 90 70
-6d1a c 69 70
-6d26 d 69 70
-6d33 1 69 70
-6d34 c 69 70
-6d40 d 69 70
-6d4d 1 69 70
-FUNC 6d4e 25 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator++()
-6d4e c 253 13
-6d5a 14 255 40
-6d6e 5 256 40
-6d73 1 256 40
-FUNC 6d74 25 0 std::_Rb_tree_const_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >::operator++()
-6d74 c 253 13
-6d80 14 255 40
-6d94 5 256 40
-6d99 1 256 40
-FUNC 6d9a 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_begin()
-6d9a c 461 13
-6da6 8 462 40
-FUNC 6dae 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_begin()
-6dae c 461 13
-6dba 8 462 40
-6dc2 c 65 68
-6dce 2 65 68
-6dd0 c 72 68
-6ddc 2 72 68
-6dde c 97 69
-6dea d 97 69
-6df7 1 97 69
-6df8 c 105 69
-6e04 d 105 69
-6e11 1 105 69
-6e12 c 105 69
-6e1e d 105 69
-6e2b 1 105 69
-6e2c c 67 68
-6e38 2 67 68
-6e3a c 99 69
-6e46 14 100 69
-6e5a c 99 69
-6e66 14 100 69
-FUNC 6e7a 2b 0 std::_Vector_base<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::get_allocator() const
-6e7a 10 93 16
-6e8a 1b 94 71
-6ea5 1 94 71
-6ea6 c 65 68
-6eb2 2 65 68
-6eb4 c 72 68
-6ec0 2 72 68
-6ec2 c 97 69
-6ece d 97 69
-6edb 1 97 69
-6edc c 105 69
-6ee8 d 105 69
-6ef5 1 105 69
-6ef6 c 105 69
-6f02 d 105 69
-6f0f 1 105 69
-6f10 c 67 68
-6f1c 2 67 68
-6f1e c 99 69
-6f2a 14 100 69
-6f3e c 99 69
-6f4a 14 100 69
-FUNC 6f5e 2b 0 std::_Vector_base<std::string, std::allocator<std::string> >::get_allocator() const
-6f5e 10 93 16
-6f6e 1b 94 71
-6f89 1 94 71
-6f8a c 603 72
-6f96 c 603 72
-FUNC 6fa2 23 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::begin()
-6fa2 c 333 16
-6fae 17 334 71
-6fc5 1 334 71
-FUNC 6fc6 26 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::end()
-6fc6 c 351 16
-6fd2 1a 352 71
-6ff8 5 666 72
-6ffd 1 666 72
-6ffe c 608 72
-700a 14 609 72
-702a 5 666 72
-702f 1 666 72
-FUNC 7030 35 0 bool __gnu_cxx::operator!=<dwarf2reader::SourceFileInfo const*, dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >(__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo const*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > > const&, __gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > > const&)
-7030 d 693 16
-703d 28 694 72
-7065 1 694 72
-7066 c 603 72
-7072 c 603 72
-708a 27 629 72
-70b1 1 629 72
-70b2 c 84 70
-70be 1f 85 70
-70dd 1 85 70
-FUNC 70de 32 0 std::pair<std::string, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> std::make_pair<std::string, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*>(std::string, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*)
-70de 10 144 16
-70ee 22 145 70
-711c a 190 34
-7132 d 194 34
-713f 1 194 34
-7140 c 84 70
-714c 17 85 70
-7163 1 85 70
-FUNC 7164 2d 0 std::pair<char const*, unsigned long> std::make_pair<char const*, unsigned long>(char const*, unsigned long)
-7164 c 144 16
-7170 21 145 70
-7191 1 145 70
-7192 c 84 70
-719e 1d 85 70
-71bb 1 85 70
-FUNC 71bc 30 0 std::pair<char*, std::pair<char const*, unsigned long> > std::make_pair<char*, std::pair<char const*, unsigned long> >(char*, std::pair<char const*, unsigned long>)
-71bc 10 144 16
-71cc 20 145 70
-71ec c 89 70
-71f8 20 90 70
-7218 d 89 70
-7225 70 90 70
-7295 1 90 70
-FUNC 7296 12 0 std::iterator_traits<unsigned long const*>::iterator_category std::__iterator_category<unsigned long const*>(unsigned long const* const&)
-7296 c 164 17
-72a2 6 165 17
-FUNC 72a8 1d 0 std::iterator_traits<unsigned long const*>::difference_type std::__distance<unsigned long const*>(unsigned long const*, unsigned long const*, std::random_access_iterator_tag)
-72a8 c 92 18
-72b4 11 97 18
-72c5 1 97 18
-FUNC 72c6 33 0 std::iterator_traits<unsigned long const*>::difference_type std::distance<unsigned long const*>(unsigned long const*, unsigned long const*)
-72c6 c 114 18
-72d2 27 118 18
-72f9 1 118 18
-FUNC 72fa 20 0 void std::__advance<unsigned long const*, int>(unsigned long const*&, int, std::random_access_iterator_tag)
-72fa c 150 18
-7306 14 155 18
-FUNC 731a 33 0 void std::advance<unsigned long const*, int>(unsigned long const*&, int)
-731a c 172 18
-7326 27 175 18
-734d 1 175 18
-FUNC 734e 7a 0 unsigned long const* std::lower_bound<unsigned long const*, unsigned long>(unsigned long const*, unsigned long const*, unsigned long const&)
-734e c 2625 19
-735a 15 2642 19
-736f 2 2646 19
-7371 8 2648 19
-7379 6 2649 19
-737f 12 2650 19
-7391 e 2651 19
-739f 6 2653 19
-73a5 4 2654 19
-73a9 e 2655 19
-73b7 6 2658 19
-73bd 6 2646 19
-73c3 5 2660 19
-73db b 227 34
-73e6 e 228 34
-73f4 1c 229 34
-7410 20 230 34
-7430 6 231 34
-7436 c 72 68
-7442 2 72 68
-7444 c 105 69
-7450 d 105 69
-745d 1 105 69
-745e c 105 69
-746a d 105 69
-7477 1 105 69
-7478 c 80 71
-7484 d 80 71
-7491 1 80 71
-7492 c 67 68
-749e 2 67 68
-74a0 c 99 69
-74ac 14 100 69
-FUNC 74c0 2b 0 std::_Vector_base<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::get_allocator() const
-74c0 10 93 19
-74d0 1b 94 71
-74eb 1 94 71
-74ec c 238 40
-74f8 a 239 40
-FUNC 7502 26 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::begin() const
-7502 c 585 19
-750e 1a 588 40
-FUNC 7528 19 0 std::map<unsigned long long, dwarf2reader::FunctionInfo*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::begin() const
-7528 c 243 20
-7534 d 244 45
-7541 1 244 45
-FUNC 7542 26 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::end() const
-7542 c 596 20
-754e 1a 597 40
-FUNC 7568 19 0 std::map<unsigned long long, dwarf2reader::FunctionInfo*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::end() const
-7568 c 260 20
-7574 d 261 45
-7581 1 261 45
-7582 c 65 68
-758e 2 65 68
-7590 c 72 68
-759c 2 72 68
-759e c 97 69
-75aa d 97 69
-75b7 1 97 69
-75b8 c 105 69
-75c4 d 105 69
-75d1 1 105 69
-75d2 c 72 68
-75de 2 72 68
-75e0 c 105 69
-75ec d 105 69
-75f9 1 105 69
-75fa c 397 40
-7606 d 397 40
-7613 1 397 40
-7614 c 105 69
-7620 d 105 69
-762d 1 105 69
-FUNC 762e 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_S_right(std::_Rb_tree_node_base*)
-762e c 496 20
-763a 8 497 40
-FUNC 7642 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_S_left(std::_Rb_tree_node_base*)
-7642 c 488 20
-764e 8 489 40
-7656 c 65 68
-7662 2 65 68
-7664 c 72 68
-7670 2 72 68
-7672 c 97 69
-767e d 97 69
-768b 1 97 69
-768c c 105 69
-7698 d 105 69
-76a5 1 105 69
-76a6 c 72 68
-76b2 2 72 68
-76b4 c 105 69
-76c0 d 105 69
-76cd 1 105 69
-76ce c 397 40
-76da d 397 40
-76e7 1 397 40
-76e8 c 105 69
-76f4 d 105 69
-7701 1 105 69
-FUNC 7702 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_S_right(std::_Rb_tree_node_base*)
-7702 c 496 20
-770e 8 497 40
-FUNC 7716 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_S_left(std::_Rb_tree_node_base*)
-7716 c 488 20
-7722 8 489 40
-772a c 84 71
-7736 2f 85 71
-7765 2 86 71
-7767 1 86 71
-7768 c 80 71
-7774 d 80 71
-7781 1 80 71
-7782 c 96 71
-778e 12 97 71
-77a0 2 98 71
-77a2 c 84 71
-77ae 2f 85 71
-77dd 2 86 71
-77df 1 86 71
-77e0 c 80 71
-77ec d 80 71
-77f9 1 80 71
-77fa c 96 71
-7806 12 97 71
-7818 2 98 71
-7826 d 107 68
-7833 1 107 68
-FUNC 7834 2e 0 void std::_Destroy<std::string*, std::allocator<std::string> >(std::string*, std::string*, std::allocator<std::string>)
-7834 c 171 21
-7840 2 173 73
-7842 12 174 73
-7854 c 173 73
-7860 2 174 73
-7862 c 167 40
-786e a 168 40
-FUNC 7878 26 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::begin()
-7878 c 581 21
-7884 1a 582 40
-FUNC 789e 19 0 std::map<unsigned long long, dwarf2reader::FunctionInfo*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::begin()
-789e c 234 21
-78aa d 235 45
-78b7 1 235 45
-FUNC 78b8 26 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::end()
-78b8 c 592 21
-78c4 1a 593 40
-FUNC 78de 19 0 std::map<unsigned long long, dwarf2reader::FunctionInfo*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::end()
-78de c 251 21
-78ea d 252 45
-78f7 1 252 45
-78f8 c 167 40
-7904 a 168 40
-FUNC 790e 26 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::begin()
-790e c 581 21
-791a 1a 582 40
-FUNC 7934 19 0 std::map<unsigned long long, std::pair<std::string, unsigned int>, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::begin()
-7934 c 234 21
-7940 d 235 45
-794d 1 235 45
-FUNC 794e 26 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::end()
-794e c 592 21
-795a 1a 593 40
-FUNC 7974 19 0 std::map<unsigned long long, std::pair<std::string, unsigned int>, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::end()
-7974 c 251 21
-7980 d 252 45
-798d 1 252 45
-FUNC 798e 11 0 std::_Select1st<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >::operator()(std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*>&) const
-798e c 546 22
-799a 5 547 41
-799f 1 547 41
-79a0 c 128 34
-79ac 13 129 34
-79bf 1 129 34
-79cc 22 396 34
-79fa d 199 42
-7a07 1 199 42
-7a08 c 65 68
-7a14 2 65 68
-7a16 c 72 68
-7a22 2 72 68
-7a24 c 97 69
-7a30 d 97 69
-7a3d 1 97 69
-7a3e c 105 69
-7a4a d 105 69
-7a57 1 105 69
-7a58 c 65 68
-7a64 2 65 68
-7a66 c 72 68
-7a72 2 72 68
-7a74 c 105 69
-7a80 d 105 69
-7a8d 1 105 69
-7a8e c 97 69
-7a9a d 97 69
-7aa7 1 97 69
-7aa8 c 72 68
-7ab4 2 72 68
-7ab6 c 105 69
-7ac2 d 105 69
-7acf 1 105 69
-7adc d 94 68
-7ae9 1 94 68
-FUNC 7aea 2f 0 std::_Vector_base<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::_M_deallocate(dwarf2reader::CompilationUnit::Abbrev*, unsigned long)
-7aea c 120 23
-7af6 6 122 71
-7afc 1d 123 71
-7b19 1 123 71
-7b1a c 108 71
-7b26 43 109 71
-7b69 1 109 71
-7b6a c 65 68
-7b76 2 65 68
-7b78 c 103 69
-7b84 d 103 69
-7b91 1 103 69
-7b92 c 65 68
-7b9e 2 65 68
-7ba0 c 103 69
-7bac d 103 69
-7bb9 1 103 69
-7bc6 d 94 68
-7bd3 1 94 68
-FUNC 7bd4 2f 0 std::_Vector_base<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::_M_deallocate(dwarf2reader::SourceFileInfo*, unsigned long)
-7bd4 c 120 23
-7be0 6 122 71
-7be6 1d 123 71
-7c03 1 123 71
-7c04 c 108 71
-7c10 43 109 71
-7c53 1 109 71
-7c54 c 188 71
-7c60 12 189 71
-7c72 2 190 71
-7c74 c 35 32
-7c80 d 35 32
-7c8d 1 35 32
-7c9a d 107 68
-7ca7 1 107 68
-FUNC 7ca8 2e 0 void std::_Destroy<dwarf2reader::SourceFileInfo*, std::allocator<dwarf2reader::SourceFileInfo> >(dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*, std::allocator<dwarf2reader::SourceFileInfo>)
-7ca8 c 171 23
-7cb4 2 173 73
-7cb6 12 174 73
-7cc8 c 173 73
-7cd4 2 174 73
-7cd6 d 272 71
-7ce3 8c 273 71
-7d6f 1 273 71
-7d7c d 94 68
-7d89 1 94 68
-FUNC 7d8a 2f 0 std::_Vector_base<std::string, std::allocator<std::string> >::_M_deallocate(std::string*, unsigned long)
-7d8a c 120 23
-7d96 6 122 71
-7d9c 1d 123 71
-7db9 1 123 71
-7dba c 108 71
-7dc6 3d 109 71
-7e03 1 109 71
-7e04 c 188 71
-7e10 12 189 71
-7e22 2 190 71
-7e24 d 272 71
-7e31 8c 273 71
-7ebd 1 273 71
-7eca 2b 596 34
-7ef5 1 596 34
-7f02 7 614 72
-7f09 1 614 72
-7f0a c 65 68
-7f16 2 65 68
-7f18 c 72 68
-7f24 2 72 68
-7f26 c 103 69
-7f32 d 103 69
-7f3f 1 103 69
-7f40 c 105 69
-7f4c d 105 69
-7f59 1 105 69
-7f5a c 65 68
-7f66 2 65 68
-7f68 c 72 68
-7f74 2 72 68
-7f76 c 103 69
-7f82 d 103 69
-7f8f 1 103 69
-7f90 c 105 69
-7f9c d 105 69
-7fa9 1 105 69
-7faa c 105 69
-7fb6 d 105 69
-7fc3 1 105 69
-7fd0 d 575 34
-7fdd 1 575 34
-7fea d 575 34
-7ff7 1 575 34
-FUNC 7ff8 11 0 std::_Select1st<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >::operator()(std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> const&) const
-7ff8 c 550 23
-8004 5 551 41
-8009 1 551 41
-8016 2f 600 34
-8045 1 600 34
-8046 c 84 70
-8052 1e 85 70
-FUNC 8070 11 0 std::_Select1st<std::pair<std::string const, std::pair<char const*, unsigned long long> > >::operator()(std::pair<std::string const, std::pair<char const*, unsigned long long> >&) const
-8070 c 546 23
-807c 5 547 41
-8081 1 547 41
-FUNC 8082 11 0 std::_Select1st<std::pair<std::string const, std::pair<char const*, unsigned long long> > >::operator()(std::pair<std::string const, std::pair<char const*, unsigned long long> > const&) const
-8082 c 550 23
-808e 5 551 41
-8093 1 551 41
-8094 c 128 34
-80a0 13 129 34
-80b3 1 129 34
-80b4 c 84 70
-80c0 1e 85 70
-80de c 65 68
-80ea 2 65 68
-80ec c 103 69
-80f8 d 103 69
-8105 1 103 69
-8106 c 65 68
-8112 2 65 68
-8114 c 72 68
-8120 2 72 68
-8122 c 105 69
-812e d 105 69
-813b 1 105 69
-813c c 103 69
-8148 d 103 69
-8155 1 103 69
-8156 c 105 69
-8162 d 105 69
-816f 1 105 69
-8170 c 80 71
-817c d 80 71
-8189 1 80 71
-818a c 67 68
-8196 2 67 68
-8198 c 99 69
-81a4 14 100 69
-FUNC 81b8 2b 0 std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::get_allocator() const
-81b8 10 93 23
-81c8 1b 94 71
-81e3 1 94 71
-81e4 c 99 69
-81f0 14 100 69
-8210 2 107 68
-FUNC 8212 2e 0 void std::_Destroy<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >(__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>)
-8212 c 171 23
-821e 2 173 73
-8220 12 174 73
-8232 c 173 73
-823e 2 174 73
-824c d 107 68
-8259 1 107 68
-825a c 67 68
-8266 2 67 68
-8268 c 99 69
-8274 14 100 69
-8288 c 403 40
-8294 1c 404 40
-82b0 a 406 40
-82ba a 407 40
-82c4 c 408 40
-82d0 e 409 40
-82de c 553 40
-82ea 36 554 40
-8320 2 555 40
-8322 c 103 69
-832e d 103 69
-833b 1 103 69
-FUNC 833c 2b 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::get_allocator() const
-833c 10 350 23
-834c 1b 351 40
-8367 1 351 40
-8368 c 69 70
-8374 2 69 70
-8382 d 107 68
-838f 1 107 68
-839c d 94 68
-83a9 1 94 68
-FUNC 83aa 2a 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_put_node(std::_Rb_tree_node<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >*)
-83aa c 359 23
-83b6 1e 360 40
-FUNC 83d4 59 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::destroy_node(std::_Rb_tree_node<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >*)
-83d4 d 387 23
-83e1 35 389 40
-8416 17 390 40
-842d 1 390 40
-FUNC 842e 56 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >*)
-842e c 1051 23
-843a 2 1054 40
-843c 1a 1056 40
-8456 e 1057 40
-8464 12 1058 40
-8476 6 1059 40
-847c 6 1054 40
-8482 2 1059 40
-8484 d 569 40
-8491 58 570 40
-84e9 1 570 40
-84ea c 147 45
-84f6 31 148 45
-8527 1 148 45
-8528 c 92 45
-8534 d 92 45
-8541 1 92 45
-8542 c 67 68
-854e 2 67 68
-8550 c 99 69
-855c 14 100 69
-8570 c 403 40
-857c 1c 404 40
-8598 a 406 40
-85a2 a 407 40
-85ac c 408 40
-85b8 e 409 40
-85c6 c 553 40
-85d2 36 554 40
-8608 2 555 40
-860a c 103 69
-8616 d 103 69
-8623 1 103 69
-FUNC 8624 2b 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::get_allocator() const
-8624 10 350 23
-8634 1b 351 40
-864f 1 351 40
-8650 c 69 70
-865c d 69 70
-8669 1 69 70
-866a c 69 70
-8676 30 69 70
-86b2 d 107 68
-86bf 1 107 68
-86cc d 94 68
-86d9 1 94 68
-FUNC 86da 2a 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_put_node(std::_Rb_tree_node<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >*)
-86da c 359 23
-86e6 1e 360 40
-FUNC 8704 59 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::destroy_node(std::_Rb_tree_node<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >*)
-8704 d 387 23
-8711 35 389 40
-8746 17 390 40
-875d 1 390 40
-FUNC 875e 56 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_erase(std::_Rb_tree_node<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >*)
-875e c 1051 23
-876a 2 1054 40
-876c 1a 1056 40
-8786 e 1057 40
-8794 12 1058 40
-87a6 6 1059 40
-87ac 6 1054 40
-87b2 2 1059 40
-87b4 d 569 40
-87c1 58 570 40
-8819 1 570 40
-881a c 147 45
-8826 31 148 45
-8857 1 148 45
-8858 c 92 45
-8864 d 92 45
-8871 1 92 45
-8872 c 603 72
-887e c 603 72
-FUNC 888a 23 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::begin()
-888a c 333 23
-8896 17 334 71
-88ad 1 334 71
-88ba 2a 654 72
-FUNC 88e4 42 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::operator[](unsigned long)
-88e4 c 494 23
-88f0 36 495 71
-FUNC 8926 26 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::end()
-8926 c 351 23
-8932 1a 352 71
-FUNC 894c 28 0 bool std::operator==<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
-894c c 2115 24
-8958 1c 2116 37
-FUNC 8974 23 0 std::equal_to<std::string>::operator()(std::string const&, std::string const&) const
-8974 c 199 24
-8980 17 200 41
-8997 1 200 41
-8998 c 80 71
-89a4 d 80 71
-89b1 1 80 71
-89b2 c 67 68
-89be 2 67 68
-89c0 c 99 69
-89cc 14 100 69
-FUNC 89e0 2b 0 std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::get_allocator() const
-89e0 10 93 24
-89f0 1b 94 71
-8a0b 1 94 71
-8a0c c 99 69
-8a18 14 100 69
-8a2c c 84 71
-8a38 2f 85 71
-8a67 2 86 71
-8a69 1 86 71
-8a6a c 96 71
-8a76 12 97 71
-8a88 2 98 71
-8a96 2 107 68
-FUNC 8a98 2e 0 void std::_Destroy<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >(__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>)
-8a98 c 171 24
-8aa4 2 173 73
-8aa6 12 174 73
-8ab8 c 173 73
-8ac4 2 174 73
-FUNC 8ac6 13 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::max_size() const
-8ac6 c 407 24
-8ad2 7 408 71
-8ad9 1 408 71
-8ada c 603 72
-8ae6 c 603 72
-FUNC 8af2 26 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::end()
-8af2 c 351 24
-8afe 1a 352 71
-FUNC 8b18 23 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::begin()
-8b18 c 333 24
-8b24 17 334 71
-8b3b 1 334 71
-8b48 2a 654 72
-8b7e 7 614 72
-8b85 1 614 72
-FUNC 8b86 42 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::operator[](unsigned long)
-8b86 c 494 24
-8b92 36 495 71
-8bd4 d 107 68
-8be1 1 107 68
-FUNC 8be2 28 0 void std::swap<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**&, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**&)
-8be2 c 92 25
-8bee 8 97 61
-8bf6 a 98 61
-8c00 a 99 61
-FUNC 8c0a 50 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::swap(std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >&)
-8c0a c 733 25
-8c16 12 735 71
-8c28 18 736 71
-8c40 1a 737 71
-8c66 2b 596 34
-8c91 1 596 34
-8c9e 2f 600 34
-8ccd 1 600 34
-FUNC 8cce 28 0 void std::swap<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**&, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**&)
-8cce c 92 25
-8cda 8 97 61
-8ce2 a 98 61
-8cec a 99 61
-FUNC 8cf6 50 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::swap(std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >&)
-8cf6 c 733 25
-8d02 12 735 71
-8d14 18 736 71
-8d2c 1a 737 71
-8d46 c 84 71
-8d52 2f 85 71
-8d81 2 86 71
-8d83 1 86 71
-8d84 c 96 71
-8d90 12 97 71
-8da2 2 98 71
-FUNC 8da4 13 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::max_size() const
-8da4 c 407 25
-8db0 7 408 71
-8db7 1 408 71
-8dc4 d 94 68
-8dd1 1 94 68
-FUNC 8dd2 2f 0 std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::_M_deallocate(__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long)
-8dd2 c 120 25
-8dde 6 122 71
-8de4 1d 123 71
-8e01 1 123 71
-8e02 c 108 71
-8e0e 3d 109 71
-8e4b 1 109 71
-8e4c c 272 71
-8e58 4b 273 71
-8ea3 1 273 71
-8ea4 c 188 71
-8eb0 12 189 71
-8ec2 2 190 71
-8ec4 c 603 72
-8ed0 c 603 72
-FUNC 8edc 2b 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::begin() const
-8edc c 342 25
-8ee8 1f 343 71
-8f07 1 343 71
-FUNC 8f08 2c 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::end() const
-8f08 c 360 25
-8f14 20 361 71
-8f40 5 666 72
-8f45 1 666 72
-8f53 2b 759 72
-FUNC 8f7e 3c 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::size() const
-8f7e c 402 25
-8f8a 30 403 71
-8fc6 26 588 34
-8ff8 15 511 34
-900d 79 513 34
-9086 21 517 34
-90a7 1 517 34
-90b4 14 225 42
-90d4 26 592 34
-FUNC 90fa 49 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::capacity() const
-90fa c 449 25
-9106 3d 451 71
-9143 1 451 71
-9144 c 103 69
-9150 d 103 69
-915d 1 103 69
-916e 1b 286 34
-9189 1 286 34
-9196 d 94 68
-91a3 1 94 68
-91b0 1e 301 34
-91db 56 622 34
-9231 17 623 34
-9254 9 1080 34
-925d 1a 1082 34
-9277 2 1083 34
-9279 8 1085 34
-9281 12 1086 34
-9293 6 1087 34
-9299 6 1083 34
-929f 1b 1089 34
-92ba 1d 1080 34
-92d7 c 1091 34
-92e3 1 1091 34
-92e4 d 360 34
-92f1 77 361 34
-9368 c 93 42
-9374 d 93 42
-9381 1 93 42
-9382 c 72 68
-938e 2 72 68
-9390 c 105 69
-939c d 105 69
-93a9 1 105 69
-93aa c 301 66
-93b6 d 301 66
-93c3 1 301 66
-93d0 d 94 68
-93dd 1 94 68
-FUNC 93de 2f 0 std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::_M_deallocate(__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long)
-93de c 120 26
-93ea 6 122 71
-93f0 1d 123 71
-940d 1 123 71
-940e c 108 71
-941a 3d 109 71
-9457 1 109 71
-9458 c 188 71
-9464 12 189 71
-9476 2 190 71
-9478 c 272 71
-9484 4b 273 71
-94cf 1 273 71
-94d0 c 603 72
-94dc c 603 72
-FUNC 94e8 2b 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::begin() const
-94e8 c 342 26
-94f4 1f 343 71
-9513 1 343 71
-FUNC 9514 2c 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::end() const
-9514 c 360 26
-9520 20 361 71
-954c 2d 662 72
-9579 1 662 72
-FUNC 957a 2d 0 unsigned long const& std::max<unsigned long>(unsigned long const&, unsigned long const&)
-957a c 206 26
-9586 e 211 61
-9594 8 212 61
-959c b 213 61
-95a7 1 213 61
-95b4 19 650 72
-95cd 1 650 72
-95da 5 666 72
-95df 1 666 72
-95ed 2b 759 72
-9624 5 666 72
-9629 1 666 72
-9637 2b 759 72
-FUNC 9662 49 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::capacity() const
-9662 c 449 26
-966e 3d 451 71
-96ab 1 451 71
-FUNC 96ac 3c 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::size() const
-96ac c 402 26
-96b8 30 403 71
-96f4 26 588 34
-9726 26 592 34
-974c c 103 69
-9758 d 103 69
-9765 1 103 69
-9776 1b 286 34
-9791 1 286 34
-979e d 94 68
-97ab 1 94 68
-97b8 1e 301 34
-97e3 56 622 34
-9839 17 623 34
-985c 9 1080 34
-9865 1a 1082 34
-987f 2 1083 34
-9881 8 1085 34
-9889 12 1086 34
-989b 6 1087 34
-98a1 6 1083 34
-98a7 1b 1089 34
-98c2 1d 1080 34
-98df c 1091 34
-98eb 1 1091 34
-98ec d 360 34
-98f9 77 361 34
-9970 c 69 70
-997c 20 69 70
-99a9 5c 104 68
-9a05 1 104 68
-9a06 c 69 70
-9a12 2c 69 70
-9a4b 5c 104 68
-9aa7 1 104 68
-9ab4 2d 662 72
-9ae1 1 662 72
-9aee 19 650 72
-9b07 1 650 72
-9b14 5 666 72
-9b19 1 666 72
-9b27 2b 759 72
-9b52 c 72 68
-9b5e 2 72 68
-9b60 c 105 69
-9b6c d 105 69
-9b79 1 105 69
-9b7a c 69 70
-9b86 2 69 70
-9b94 d 107 68
-9ba1 1 107 68
-9bae d 94 68
-9bbb 1 94 68
-FUNC 9bbc 2a 0 std::_List_base<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_put_node(std::_List_node<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >*)
-9bbc c 315 26
-9bc8 1e 316 66
-FUNC 9be6 35 0 bool __gnu_cxx::operator!=<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > > const&, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > > const&)
-9be6 d 699 26
-9bf3 28 700 72
-9c1b 1 700 72
-9c28 d 623 72
-9c35 5 624 72
-FUNC 9c3a 4b 0 void std::__fill<true>::fill<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&)
-9c3a c 539 61
-9c46 8 541 61
-9c4e 2 542 61
-9c50 12 543 61
-9c62 21 542 61
-9c83 2 543 61
-9c85 1 543 61
-FUNC 9c86 2b 0 void std::fill<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&)
-9c86 c 560 26
-9c92 4 567 61
-9c96 1b 568 61
-9cb1 1 568 61
-FUNC 9cb2 4b 0 void std::_Destroy<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>)
-9cb2 c 171 26
-9cbe 2 173 73
-9cc0 1a 174 73
-9cda 21 173 73
-9cfb 2 174 73
-9cfd 1 174 73
-9d0a 7 98 68
-9d11 1 98 68
-9d1e 1d 85 68
-9d3b 5 86 68
-9d40 16 88 68
-9d62 1d 297 34
-9d7f 1 297 34
-9d8d e 605 34
-9d9b 9 606 34
-9da4 3c 609 34
-9de0 b 610 34
-9deb 11 609 34
-9dfc b 612 34
-9e07 12 614 34
-9e19 b 615 34
-9e24 13 612 34
-9e37 8 615 34
-9e3f 1 615 34
-9e4d 15 751 34
-9e62 1a 752 34
-9e7c b 754 34
-9e87 49 755 34
-9ed0 3b 756 34
-9f0b 12 754 34
-9f1d 15 758 34
-9f32 8 759 34
-9f3a 1c 760 34
-9f56 f 761 34
-9f65 41 762 34
-9fb2 7 98 68
-9fb9 1 98 68
-9fc6 1d 85 68
-9fe3 5 86 68
-9fe8 17 88 68
-9fff 1 88 68
-a00c 1d 297 34
-a029 1 297 34
-a037 e 605 34
-a045 9 606 34
-a04e 3c 609 34
-a08a b 610 34
-a095 11 609 34
-a0a6 b 612 34
-a0b1 12 614 34
-a0c3 b 615 34
-a0ce 13 612 34
-a0e1 8 615 34
-a0e9 1 615 34
-a0f7 15 751 34
-a10c 1a 752 34
-a126 b 754 34
-a131 49 755 34
-a17a 3b 756 34
-a1b5 12 754 34
-a1c7 15 758 34
-a1dc 8 759 34
-a1e4 1c 760 34
-a200 f 761 34
-a20f 41 762 34
-FUNC a250 35 0 bool __gnu_cxx::operator!=<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > > const&, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > > const&)
-a250 d 699 26
-a25d 28 700 72
-a285 1 700 72
-a292 d 623 72
-a29f 5 624 72
-FUNC a2a4 4b 0 void std::__fill<true>::fill<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&)
-a2a4 c 539 61
-a2b0 8 541 61
-a2b8 2 542 61
-a2ba 12 543 61
-a2cc 21 542 61
-a2ed 2 543 61
-a2ef 1 543 61
-FUNC a2f0 2b 0 void std::fill<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&)
-a2f0 c 560 26
-a2fc 4 567 61
-a300 1b 568 61
-a31b 1 568 61
-FUNC a31c 4b 0 void std::_Destroy<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, __gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>)
-a31c c 171 26
-a328 2 173 73
-a32a 1a 174 73
-a344 21 173 73
-a365 2 174 73
-a367 1 174 73
-a368 c 65 68
-a374 2 65 68
-a376 c 103 69
-a382 d 103 69
-a38f 1 103 69
-FUNC a390 2b 0 std::_List_base<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::get_allocator() const
-a390 10 322 26
-a3a0 1b 324 66
-a3bb 1 324 66
-FUNC a3bc 7b 0 std::_List_base<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_clear()
-a3bc d 69 27
-a3c9 8 72 77
-a3d1 2 73 77
-a3d3 6 75 77
-a3d9 8 76 77
-a3e1 35 77 77
-a416 12 78 77
-a428 a 73 77
-a432 5 78 77
-a437 1 78 77
-a438 c 331 66
-a444 18 332 66
-a45c c 392 66
-a468 d 392 66
-a475 1 392 66
-a476 c 211 74
-a482 10 211 74
-a49e d 107 68
-a4ab 1 107 68
-FUNC a4ac 2e 0 void std::_Destroy<dwarf2reader::CompilationUnit::Abbrev*, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, std::allocator<dwarf2reader::CompilationUnit::Abbrev>)
-a4ac c 171 27
-a4b8 2 173 73
-a4ba 12 174 73
-a4cc c 173 73
-a4d8 2 174 73
-a4da c 272 71
-a4e6 4b 273 71
-a531 1 273 71
-a532 13 196 74
-a545 10 196 74
-a555 2f 197 74
-a584 1a 198 74
-a59e 13 196 74
-a5b1 10 196 74
-a5c1 2f 197 74
-a5f0 1a 198 74
-a616 7 98 68
-a61d 1 98 68
-a62a 1d 85 68
-a647 5 86 68
-a64c 10 88 68
-FUNC a65c 2a 0 std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::_M_allocate(unsigned long)
-a65c c 116 27
-a668 1e 117 71
-a686 d 100 71
-a693 12 101 71
-a6a5 19 103 71
-a6be b 104 71
-a6c9 3a 105 71
-a703 1 105 71
-a710 7 98 68
-a717 1 98 68
-a724 1d 85 68
-a741 5 86 68
-a746 10 88 68
-FUNC a756 2a 0 std::_Vector_base<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::_M_allocate(unsigned long)
-a756 c 116 27
-a762 1e 117 71
-a780 d 100 71
-a78d 12 101 71
-a79f 19 103 71
-a7b8 b 104 71
-a7c3 3a 105 71
-a7fd 1 105 71
-a80b 12 424 61
-a81d 2e 425 61
-a84b 13 426 61
-a86a 4 440 61
-a86e 1b 443 61
-a889 1 443 61
-a898 56 482 61
-a8fa 4 514 61
-a8fe 4 515 61
-a902 1b 517 61
-a91d 1 517 61
-a92a 8 616 61
-a932 2 617 61
-a934 8 618 61
-a93c f 617 61
-a94b 5 619 61
-a95c 4 641 61
-a960 1b 642 61
-a97b 1 642 61
-FUNC a97c 27 0 void std::__uninitialized_fill_n_aux<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&, __true_type)
-a97c c 182 28
-a988 1b 183 79
-a9a3 1 183 79
-FUNC a9a4 2f 0 void std::uninitialized_fill_n<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&)
-a9a4 c 214 28
-a9b0 23 218 79
-a9d3 1 218 79
-FUNC a9d4 27 0 void std::__uninitialized_fill_n_a<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>)
-a9d4 c 308 28
-a9e0 1b 310 79
-a9fb 1 310 79
-a9fc c 200 71
-aa08 19 201 71
-aa21 42 203 71
-aa63 15 205 71
-aa85 11 992 34
-aa96 c 993 34
-aaa2 15 995 34
-aab7 c 996 34
-aac3 4a 998 34
-ab0d f 1001 34
-ab1c 1c 998 34
-ab38 1a 1003 34
-ab52 5 1004 34
-ab57 1f 1007 34
-ab76 1c 1008 34
-ab92 19 1009 34
-abab 19 1010 34
-abc4 1a 1011 34
-abde a 1004 34
-abe8 11 1001 34
-abf9 15 1014 34
-ac0e 13 1028 34
-ac21 b 1016 34
-ac2c 9 1018 34
-ac35 19 1023 34
-ac4e 23 1024 34
-ac71 19 1025 34
-ac8a 1d 1021 34
-aca7 1a 1018 34
-acc1 b 1028 34
-accc b 1016 34
-acd7 1e 1028 34
-acf5 1 1028 34
-ad06 16 438 34
-ad1c 37 439 34
-ad53 1 439 34
-ad64 37 212 42
-ad9b 1 212 42
-ada8 8 616 61
-adb0 2 617 61
-adb2 8 618 61
-adba f 617 61
-adc9 5 619 61
-adda 4 641 61
-adde 1b 642 61
-adf9 1 642 61
-FUNC adfa 27 0 void std::__uninitialized_fill_n_aux<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&, __true_type)
-adfa c 182 28
-ae06 1b 183 79
-ae21 1 183 79
-FUNC ae22 2f 0 void std::uninitialized_fill_n<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&)
-ae22 c 214 28
-ae2e 23 218 79
-ae51 1 218 79
-FUNC ae52 27 0 void std::__uninitialized_fill_n_a<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>)
-ae52 c 308 28
-ae5e 1b 310 79
-ae79 1 310 79
-ae7a c 200 71
-ae86 19 201 71
-ae9f 42 203 71
-aee1 15 205 71
-af03 11 992 34
-af14 c 993 34
-af20 15 995 34
-af35 c 996 34
-af41 4a 998 34
-af8b f 1001 34
-af9a 1c 998 34
-afb6 1a 1003 34
-afd0 5 1004 34
-afd5 1f 1007 34
-aff4 1c 1008 34
-b010 19 1009 34
-b029 19 1010 34
-b042 1a 1011 34
-b05c a 1004 34
-b066 11 1001 34
-b077 15 1014 34
-b08c 13 1028 34
-b09f b 1016 34
-b0aa 9 1018 34
-b0b3 19 1023 34
-b0cc 23 1024 34
-b0ef 19 1025 34
-b108 1d 1021 34
-b125 1a 1018 34
-b13f b 1028 34
-b14a b 1016 34
-b155 1e 1028 34
-b173 1 1028 34
-b184 16 438 34
-b19a 37 439 34
-b1d1 1 439 34
-b1e2 37 212 42
-b219 1 212 42
-b227 12 424 61
-b239 2e 425 61
-b267 13 426 61
-b286 4 440 61
-b28a 1b 443 61
-b2a5 1 443 61
-b2b4 56 482 61
-b316 4 514 61
-b31a 4 515 61
-b31e 1b 517 61
-b339 1 517 61
-b346 8 616 61
-b34e 2 617 61
-b350 12 618 61
-b362 16 617 61
-b378 5 619 61
-b37d 1 619 61
-b38a 4 641 61
-b38e 1b 642 61
-b3a9 1 642 61
-FUNC b3aa 27 0 void std::__uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&, __true_type)
-b3aa c 182 28
-b3b6 1b 183 79
-b3d1 1 183 79
-FUNC b3d2 2f 0 void std::uninitialized_fill_n<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&)
-b3d2 c 214 28
-b3de 23 218 79
-b401 1 218 79
-FUNC b402 27 0 void std::__uninitialized_fill_n_a<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*>)
-b402 c 308 28
-b40e 1b 310 79
-b429 1 310 79
-b436 8 616 61
-b43e 2 617 61
-b440 12 618 61
-b452 16 617 61
-b468 5 619 61
-b46d 1 619 61
-b47a 4 641 61
-b47e 1b 642 61
-b499 1 642 61
-FUNC b49a 27 0 void std::__uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&, __true_type)
-b49a c 182 28
-b4a6 1b 183 79
-b4c1 1 183 79
-FUNC b4c2 2f 0 void std::uninitialized_fill_n<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&)
-b4c2 c 214 28
-b4ce 23 218 79
-b4f1 1 218 79
-FUNC b4f2 27 0 void std::__uninitialized_fill_n_a<__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*>)
-b4f2 c 308 28
-b4fe 1b 310 79
-b519 1 310 79
-b526 22 300 61
-b548 11 301 61
-b559 1 301 61
-b566 4 315 61
-b56a 1b 317 61
-b585 1 317 61
-b592 1b 326 61
-b5ad 1 326 61
-b5ba 4 384 61
-b5be 4 385 61
-b5c2 1b 387 61
-b5dd 1 387 61
-b5ea 1b 74 79
-b605 1 74 79
-b612 23 113 79
-b635 1 113 79
-b642 1b 254 79
-b65d 1 254 79
-b66a 15 763 71
-b67f 40 766 71
-b6bf 3 768 71
-b6c2 2 773 71
-FUNC b6c4 124 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::reserve(unsigned long)
-b6c4 13 69 29
-b6d7 15 71 78
-b6ec e 72 78
-b6fa 19 73 78
-b713 e 75 78
-b721 28 78 78
-b749 3e 79 78
-b787 30 81 78
-b7b7 8 84 78
-b7bf 11 85 78
-b7d0 18 86 78
-b7f5 33 335 61
-b834 4 384 61
-b838 4 385 61
-b83c 1b 387 61
-b857 1 387 61
-b864 1b 74 79
-b87f 1 74 79
-b88c 23 113 79
-b8af 1 113 79
-b8bc 1b 254 79
-b8d7 1 254 79
-b8e6 56 354 61
-b948 4 384 61
-b94c 4 385 61
-b950 1b 387 61
-b96b 1 387 61
-b978 1b 74 79
-b993 1 74 79
-b9a0 23 113 79
-b9c3 1 113 79
-b9d0 1b 254 79
-b9eb 1 254 79
-FUNC b9ec 46e 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::_M_fill_insert(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&)
-b9ec 14 311 29
-ba00 b 313 78
-ba0b 24 315 78
-ba2f 8 318 78
-ba37 23 319 78
-ba5a 15 320 78
-ba6f c 321 78
-ba7b 51 323 78
-bacc 14 327 78
-bae0 30 328 78
-bb10 35 330 78
-bb45 48 334 78
-bb8d 17 338 78
-bba4 43 339 78
-bbe7 14 342 78
-bbfb 1e 343 78
-bc19 e 348 78
-bc27 1e 349 78
-bc45 e 350 78
-bc53 1d 353 78
-bc70 8 354 78
-bc78 e 355 78
-bc86 27 357 78
-bcad 6 358 78
-bcb3 4d 361 78
-bd00 40 365 78
-bd40 18 367 78
-bd58 4d 368 78
-bda5 3e 379 78
-bde3 30 381 78
-be13 12 384 78
-be25 13 385 78
-be38 22 386 78
-FUNC be5a 2e 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::insert(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >* const&)
-be5a c 657 29
-be66 22 658 71
-be94 15 580 34
-bea9 15 581 34
-bebe 37 582 34
-bef5 c 583 34
-bf01 1 583 34
-bf02 d 335 34
-bf0f 4e 337 34
-bf5d 4d 338 34
-bfaa d 134 42
-bfb7 65 135 42
-c028 22 300 61
-c04a 11 301 61
-c05b 1 301 61
-c068 4 315 61
-c06c 1b 317 61
-c087 1 317 61
-c094 1b 326 61
-c0af 1 326 61
-c0bc 4 384 61
-c0c0 4 385 61
-c0c4 1b 387 61
-c0df 1 387 61
-c0ec 1b 74 79
-c107 1 74 79
-c114 23 113 79
-c137 1 113 79
-c144 1b 254 79
-c15f 1 254 79
-c16c 15 763 71
-c181 40 766 71
-c1c1 3 768 71
-c1c4 2 773 71
-FUNC c1c6 124 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::reserve(unsigned long)
-c1c6 13 69 29
-c1d9 15 71 78
-c1ee e 72 78
-c1fc 19 73 78
-c215 e 75 78
-c223 28 78 78
-c24b 3e 79 78
-c289 30 81 78
-c2b9 8 84 78
-c2c1 11 85 78
-c2d2 18 86 78
-c2f7 33 335 61
-c336 4 384 61
-c33a 4 385 61
-c33e 1b 387 61
-c359 1 387 61
-c366 1b 74 79
-c381 1 74 79
-c38e 23 113 79
-c3b1 1 113 79
-c3be 1b 254 79
-c3d9 1 254 79
-c3e8 56 354 61
-c44a 4 384 61
-c44e 4 385 61
-c452 1b 387 61
-c46d 1 387 61
-c47a 1b 74 79
-c495 1 74 79
-c4a2 23 113 79
-c4c5 1 113 79
-c4d2 1b 254 79
-c4ed 1 254 79
-FUNC c4ee 46e 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::_M_fill_insert(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&)
-c4ee 14 311 29
-c502 b 313 78
-c50d 24 315 78
-c531 8 318 78
-c539 23 319 78
-c55c 15 320 78
-c571 c 321 78
-c57d 51 323 78
-c5ce 14 327 78
-c5e2 30 328 78
-c612 35 330 78
-c647 48 334 78
-c68f 17 338 78
-c6a6 43 339 78
-c6e9 14 342 78
-c6fd 1e 343 78
-c71b e 348 78
-c729 1e 349 78
-c747 e 350 78
-c755 1d 353 78
-c772 8 354 78
-c77a e 355 78
-c788 27 357 78
-c7af 6 358 78
-c7b5 4d 361 78
-c802 40 365 78
-c842 18 367 78
-c85a 4d 368 78
-c8a7 3e 379 78
-c8e5 30 381 78
-c915 12 384 78
-c927 13 385 78
-c93a 22 386 78
-FUNC c95c 2e 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> >::insert(__gnu_cxx::__normal_iterator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >**, std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >*> > >, unsigned long, __gnu_cxx::_Hashtable_node<std::pair<std::string const, __gnu_cxx::hash_map<std::string, std::pair<char const*, unsigned long long>, __gnu_cxx::hash<std::string>, std::equal_to<std::string>, std::allocator<std::pair<char const*, unsigned long long> > >*> >* const&)
-c95c c 657 29
-c968 22 658 71
-c996 15 580 34
-c9ab 15 581 34
-c9c0 37 582 34
-c9f7 c 583 34
-ca03 1 583 34
-ca04 d 335 34
-ca11 4e 337 34
-ca5f 4d 338 34
-caac d 134 42
-cab9 65 135 42
-FUNC cb1e 44 0 dwarf2reader::CUFunctionInfoHandler::StartCompilationUnit(unsigned long long, unsigned char, unsigned char, unsigned long long, unsigned char)
-cb1e 39 135 42
-cb57 5 102 30
-cb5c 6 103 30
-FUNC cb62 41 0 dwarf2reader::CUFunctionInfoHandler::ProcessAttributeString(unsigned long long, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm, std::string const&)
-cb62 18 136 30
-cb7a 10 137 30
-cb8a 17 138 30
-cba1 2 139 30
-cba3 1 139 30
-FUNC cba4 2a5 0 dwarf2reader::CUFunctionInfoHandler::ProcessAttributeUnsigned(unsigned long long, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm, unsigned long long)
-cba4 2d 144 30
-cbd1 a 145 30
-cbdb 58 146 30
-cc33 35 147 30
-cc68 32 146 30
-cc9a 2a 147 30
-ccc4 82 152 30
-cd46 18 153 30
-cd5e 1c 152 30
-cd7a 2f 153 30
-cda9 e 154 30
-cdb7 28 155 30
-cddf 12 157 30
-cdf1 2 158 30
-cdf3 12 160 30
-ce05 2 161 30
-ce07 c 163 30
-ce13 2 164 30
-ce15 2c 166 30
-ce41 8 172 30
-ce49 1 172 30
-FUNC ce4a 19c 0 dwarf2reader::CULineInfoHandler::AddLine(unsigned long long, unsigned int, unsigned int, unsigned int)
-ce4a 20 84 30
-ce6a 1c 85 30
-ce86 9c 87 30
-cf22 4f 89 30
-cf71 19 87 30
-cf8a 25 90 30
-cfaf 30 93 30
-cfdf 7 95 30
-FUNC cfe6 9f 0 dwarf2reader::CUFunctionInfoHandler::EndDIE(unsigned long long)
-cfe6 19 174 30
-cfff 1c 175 30
-d01b 65 177 30
-d080 5 178 30
-d085 1 178 30
-FUNC d086 164 0 dwarf2reader::CUFunctionInfoHandler::StartDIE(unsigned long long, dwarf2reader::DwarfTag, std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > > const&)
-d086 20 111 30
-d0a6 1c 112 30
-d0c2 c 126 30
-d0ce 23 115 30
-d0f1 26 116 30
-d117 1a 117 30
-d131 d 118 30
-d13e 1b 119 30
-d159 5f 120 30
-d1b8 c 124 30
-d1c4 1c 115 30
-d1e0 3 126 30
-d1e3 7 129 30
-FUNC d1ea 73 0 dwarf2reader::CULineInfoHandler::DefineDir(std::string const&, unsigned int)
-d1ea 13 52 30
-d1fd 45 54 30
-d242 15 55 30
-d257 6 56 30
-d25d 1 56 30
-FUNC d25e 23b 0 dwarf2reader::CULineInfoHandler::DefineFile(std::string const&, int, unsigned int, unsigned long long, unsigned long long)
-d25e 2c 60 30
-d28a 45 62 30
-d2cf 2f 65 30
-d2fe 24 66 30
-d322 b 68 30
-d32d e 69 30
-d33b 19 71 30
-d354 17 72 30
-d36b 93 74 30
-d3fe 64 77 30
-d462 30 79 30
-d492 7 81 30
-d499 1 81 30
-d49a 14 38 30
-d4ae 36 40 30
-d4e4 41 43 30
-d525 41 44 30
-d566 67 45 30
-d5cd 10 46 30
-d5dd 13 45 30
-d5f0 15 47 30
-d605 e 48 30
-d613 3d 49 30
-d650 20 50 30
-d670 14 38 30
-d684 36 40 30
-d6ba 41 43 30
-d6fb 41 44 30
-d73c 67 45 30
-d7a3 10 46 30
-d7b3 13 45 30
-d7c6 15 47 30
-d7db e 48 30
-d7e9 3d 49 30
-d826 20 50 30
-d846 12 125 74
-d858 12 125 74
-d86a 13 55 32
-d87d 35 55 32
-d8b2 13 98 32
-d8c5 35 98 32
-d8fa c 35 32
-d906 d 35 32
-d913 1 35 32
-d914 d 22 32
-d921 40 22 32
-d961 1 22 32
-d962 c 89 70
-d96e 1e 90 70
-d998 14 208 34
-d9ac c 190 67
-d9b8 a 190 67
-d9c2 c 259 67
-d9ce 21 259 67
-d9ef 1 259 67
-FUNC d9f0 13 0 std::auto_ptr<dwarf2reader::LineInfo>::operator->() const
-d9f0 c 283 35
-d9fc 7 286 67
-da03 1 286 67
-da11 5c 104 68
-da6d 1 104 68
-FUNC da6e 28 0 bool std::operator==<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)
-da6e c 2139 37
-da7a 1c 2140 37
-FUNC da96 5d 0 std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*)
-da96 d 2081 37
-daa3 12 2083 37
-dab5 1a 2084 37
-dacf 24 2085 37
-daf3 1 2085 37
-FUNC daf4 5d 0 std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
-daf4 d 2044 37
-db01 12 2046 37
-db13 1a 2047 37
-db2d 24 2048 37
-db51 1 2048 37
-db52 c 84 70
-db5e 17 85 70
-db75 1 85 70
-FUNC db76 2d 0 std::pair<char const*, unsigned int> std::make_pair<char const*, unsigned int>(char const*, unsigned int)
-db76 c 144 37
-db82 21 145 70
-dba3 1 145 70
-dba4 c 84 70
-dbb0 23 85 70
-dbd3 1 85 70
-FUNC dbd4 3c 0 std::pair<unsigned long long, std::pair<char const*, unsigned int> > std::make_pair<unsigned long long, std::pair<char const*, unsigned int> >(unsigned long long, std::pair<char const*, unsigned int>)
-dbd4 1c 144 37
-dbf0 20 145 70
-dc10 d 89 70
-dc1d 64 90 70
-dc81 1 90 70
-dc82 c 89 70
-dc8e 2a 90 70
-dcb8 c 84 70
-dcc4 1d 85 70
-dce1 1 85 70
-FUNC dce2 3c 0 std::pair<unsigned long long, dwarf2reader::FunctionInfo*> std::make_pair<unsigned long long, dwarf2reader::FunctionInfo*>(unsigned long long, dwarf2reader::FunctionInfo*)
-dce2 1c 144 37
-dcfe 20 145 70
-dd2a a 190 34
-dd40 d 194 34
-dd4d 1 194 34
-dd4e c 603 72
-dd5a c 603 72
-FUNC dd66 2b 0 std::vector<std::string, std::allocator<std::string> >::begin() const
-dd66 c 342 39
-dd72 1f 343 71
-dd91 1 343 71
-FUNC dd92 2c 0 std::vector<std::string, std::allocator<std::string> >::end() const
-dd92 c 360 39
-dd9e 20 361 71
-ddca 5 666 72
-ddcf 1 666 72
-dddd 2b 759 72
-FUNC de08 3c 0 std::vector<std::string, std::allocator<std::string> >::size() const
-de08 c 402 39
-de14 30 403 71
-FUNC de44 2b 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::begin() const
-de44 c 342 39
-de50 1f 343 71
-de6f 1 343 71
-FUNC de70 2c 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::end() const
-de70 c 360 39
-de7c 20 361 71
-dea9 31 759 72
-FUNC deda 3c 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::size() const
-deda c 402 39
-dee6 30 403 71
-df16 c 603 72
-df22 c 603 72
-FUNC df2e 26 0 std::vector<std::string, std::allocator<std::string> >::end()
-df2e c 351 39
-df3a 1a 352 71
-df60 7 614 72
-df67 1 614 72
-FUNC df68 13 0 std::vector<std::string, std::allocator<std::string> >::max_size() const
-df68 c 407 39
-df74 7 408 71
-df7b 1 408 71
-df88 5 666 72
-df8d 1 666 72
-df9a d 623 72
-dfa7 5 624 72
-FUNC dfac 23 0 std::vector<std::string, std::allocator<std::string> >::begin()
-dfac c 333 39
-dfb8 17 334 71
-dfcf 1 334 71
-dfd0 c 35 32
-dfdc 26 35 32
-e00f 5c 104 68
-e06b 1 104 68
-e078 7 614 72
-e07f 1 614 72
-FUNC e080 35 0 dwarf2reader::SourceFileInfo::operator=(dwarf2reader::SourceFileInfo const&)
-e080 c 35 39
-e08c 29 35 32
-e0b5 1 35 32
-FUNC e0b6 13 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::max_size() const
-e0b6 c 407 39
-e0c2 7 408 71
-e0c9 1 408 71
-e0d6 d 623 72
-e0e3 5 624 72
-FUNC e0e8 3c 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::_M_range_check(unsigned long) const
-e0e8 13 515 39
-e0fb 15 517 71
-e110 14 518 71
-FUNC e124 3c 0 std::vector<std::string, std::allocator<std::string> >::_M_range_check(unsigned long) const
-e124 13 515 39
-e137 15 517 71
-e14c 14 518 71
-e16c 2a 654 72
-FUNC e196 42 0 std::vector<std::string, std::allocator<std::string> >::operator[](unsigned long)
-e196 c 494 39
-e1a2 36 495 71
-FUNC e1d8 32 0 std::vector<std::string, std::allocator<std::string> >::at(unsigned long)
-e1d8 c 534 39
-e1e4 12 536 71
-e1f6 14 537 71
-e216 32 654 72
-FUNC e248 42 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::operator[](unsigned long)
-e248 c 494 39
-e254 36 495 71
-FUNC e28a 32 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::at(unsigned long)
-e28a c 534 39
-e296 12 536 71
-e2a8 14 537 71
-FUNC e2bc 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_end()
-e2bc c 472 40
-e2c8 8 473 40
-FUNC e2d0 11 0 std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >::operator()(std::pair<unsigned long long const, std::pair<std::string, unsigned int> > const&) const
-e2d0 c 550 41
-e2dc 5 551 41
-e2e1 1 551 41
-FUNC e2e2 53 0 std::less<unsigned long long>::operator()(unsigned long long const&, unsigned long long const&) const
-e2e2 c 226 41
-e2ee 47 227 41
-e335 1 227 41
-FUNC e336 20 0 std::_Rb_tree_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >::operator==(std::_Rb_tree_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > const&) const
-e336 c 209 41
-e342 14 210 40
-e356 c 84 70
-e362 18 85 70
-FUNC e37a 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_end()
-e37a c 472 41
-e386 8 473 40
-FUNC e38e 11 0 std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator()(std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> const&) const
-e38e c 550 41
-e39a 5 551 41
-e39f 1 551 41
-FUNC e3a0 20 0 std::_Rb_tree_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator==(std::_Rb_tree_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > const&) const
-e3a0 c 209 41
-e3ac 14 210 40
-e3c0 c 84 70
-e3cc 18 85 70
-e3e4 c 180 34
-e3f0 13 181 34
-e403 1 181 34
-e410 22 409 34
-e43e d 207 42
-e44b 1 207 42
-FUNC e44c 35 0 bool __gnu_cxx::operator!=<std::string*, std::vector<std::string, std::allocator<std::string> > >(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > > const&, __gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > > const&)
-e44c d 699 42
-e459 28 700 72
-e481 1 700 72
-FUNC e482 4b 0 void std::_Destroy<__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::allocator<std::string> >(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, __gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::allocator<std::string>)
-e482 c 171 43
-e48e 2 173 73
-e490 1a 174 73
-e4aa 21 173 73
-e4cb 2 174 73
-e4cd 1 174 73
-FUNC e4ce 35 0 bool __gnu_cxx::operator!=<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >(__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > > const&, __gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > > const&)
-e4ce d 699 43
-e4db 28 700 72
-e503 1 700 72
-FUNC e504 4b 0 void std::_Destroy<__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, std::allocator<dwarf2reader::SourceFileInfo> >(__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, __gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, std::allocator<dwarf2reader::SourceFileInfo>)
-e504 c 171 43
-e510 2 173 73
-e512 1a 174 73
-e52c 21 173 73
-e54d 2 174 73
-e54f 1 174 73
-FUNC e550 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_S_value(std::_Rb_tree_node<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > const*)
-e550 c 480 43
-e55c 8 481 40
-FUNC e564 28 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_S_key(std::_Rb_tree_node<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > const*)
-e564 c 484 43
-e570 1c 485 40
-FUNC e58c 25 0 std::_Rb_tree_iterator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >::operator--()
-e58c c 194 43
-e598 14 196 40
-e5ac 5 197 40
-e5b1 1 197 40
-FUNC e5b2 25 0 std::_Rb_tree_iterator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >::operator--()
-e5b2 c 194 43
-e5be 14 196 40
-e5d2 5 197 40
-e5d7 1 197 40
-FUNC e5d8 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_S_value(std::_Rb_tree_node_base const*)
-e5d8 c 504 43
-e5e4 8 505 40
-FUNC e5ec 28 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_S_key(std::_Rb_tree_node_base const*)
-e5ec c 508 43
-e5f8 1c 509 40
-FUNC e614 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_S_value(std::_Rb_tree_node<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > const*)
-e614 c 480 43
-e620 8 481 40
-FUNC e628 28 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_S_key(std::_Rb_tree_node<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > const*)
-e628 c 484 43
-e634 1c 485 40
-FUNC e650 14 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_S_value(std::_Rb_tree_node_base const*)
-e650 c 504 43
-e65c 8 505 40
-FUNC e664 28 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_S_key(std::_Rb_tree_node_base const*)
-e664 c 508 43
-e670 1c 509 40
-e698 7 614 72
-e69f 1 614 72
-e6ac 7 98 68
-e6b3 1 98 68
-e6c0 1d 85 68
-e6dd 5 86 68
-e6e2 10 88 68
-FUNC e6f2 2a 0 std::_Vector_base<std::string, std::allocator<std::string> >::_M_allocate(unsigned long)
-e6f2 c 116 43
-e6fe 1e 117 71
-e728 7 98 68
-e72f 1 98 68
-e73c 1d 85 68
-e759 5 86 68
-e75e 16 88 68
-FUNC e774 2a 0 std::_Vector_base<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::_M_allocate(unsigned long)
-e774 c 116 43
-e780 1e 117 71
-e7aa 3a 104 68
-e7f0 2a 654 72
-FUNC e81a 42 0 std::vector<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*, std::allocator<__gnu_cxx::_Hashtable_node<std::pair<std::string const, std::pair<char const*, unsigned long long> > >*> >::operator[](unsigned long) const
-e81a c 509 43
-e826 36 510 71
-FUNC e85c 4e 0 std::string* std::__copy_backward<false, std::random_access_iterator_tag>::copy_b<std::string*, std::string*>(std::string*, std::string*, std::string*)
-e85c c 408 61
-e868 14 411 61
-e87c 1e 412 61
-e89a b 411 61
-e8a5 5 413 61
-FUNC e8aa 2b 0 std::string* std::__copy_backward_aux<std::string*, std::string*>(std::string*, std::string*, std::string*)
-e8aa c 432 44
-e8b6 4 440 61
-e8ba 1b 443 61
-e8d5 1 443 61
-e8e4 56 482 61
-e946 4 514 61
-e94a 4 515 61
-e94e 1b 517 61
-e969 1 517 61
-FUNC e96a 69 0 void std::_Construct<std::string, std::string>(std::string*, std::string const&)
-e96a d 77 44
-e977 5c 81 73
-e9d3 1 81 73
-FUNC e9d4 54 0 dwarf2reader::SourceFileInfo* std::__copy_backward<false, std::random_access_iterator_tag>::copy_b<dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*>(dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*)
-e9d4 c 408 61
-e9e0 1a 411 61
-e9fa 1e 412 61
-ea18 b 411 61
-ea23 5 413 61
-FUNC ea28 2b 0 dwarf2reader::SourceFileInfo* std::__copy_backward_aux<dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*>(dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo*)
-ea28 c 432 44
-ea34 4 440 61
-ea38 1b 443 61
-ea53 1 443 61
-ea62 56 482 61
-eac4 4 514 61
-eac8 4 515 61
-eacc 1b 517 61
-eae7 1 517 61
-FUNC eae8 69 0 void std::_Construct<dwarf2reader::SourceFileInfo, dwarf2reader::SourceFileInfo>(dwarf2reader::SourceFileInfo*, dwarf2reader::SourceFileInfo const&)
-eae8 d 77 44
-eaf5 5c 81 73
-eb51 1 81 73
-eb52 c 69 70
-eb5e 20 69 70
-eb7e c 69 70
-eb8a 2a 69 70
-ebc1 5c 104 68
-ec1d 1 104 68
-ec2a 15 523 34
-ec3f 79 525 34
-ecb8 21 529 34
-ecd9 1 529 34
-ece6 14 229 42
-ed06 7 98 68
-ed0d 1 98 68
-ed1a 1d 85 68
-ed37 5 86 68
-ed3c 10 88 68
-FUNC ed4c 29 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_get_node()
-ed4c c 355 44
-ed58 1d 356 40
-ed75 1 356 40
-FUNC ed76 b6 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_create_node(std::pair<unsigned long long const, std::pair<std::string, unsigned int> > const&)
-ed76 d 363 44
-ed83 e 365 40
-ed91 3c 367 40
-edcd b 373 40
-edd8 11 367 40
-ede9 b 368 40
-edf4 12 370 40
-ee06 b 371 40
-ee11 13 368 40
-ee24 8 373 40
-FUNC ee2c cd 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<unsigned long long const, std::pair<std::string, unsigned int> > const&)
-ee2c d 787 44
-ee39 15 789 40
-ee4e 5d 792 40
-eeab 24 796 40
-eecf f 798 40
-eede 1b 799 40
-eef9 1 799 40
-FUNC eefa 1ef 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, std::pair<std::string, unsigned int> >, std::_Select1st<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::insert_unique(std::pair<unsigned long long const, std::pair<std::string, unsigned int> > const&)
-eefa d 869 44
-ef07 e 871 40
-ef15 e 872 40
-ef23 4 873 40
-ef27 2 874 40
-ef29 6 876 40
-ef2f 35 877 40
-ef64 2a 878 40
-ef8e 6 874 40
-ef94 12 880 40
-efa6 a 881 40
-efb0 24 882 40
-efd4 51 883 40
-f025 b 885 40
-f030 36 886 40
-f066 4e 887 40
-f0b4 35 888 40
-f0e9 1 888 40
-FUNC f0ea 20 0 std::map<unsigned long long, std::pair<std::string, unsigned int>, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, std::pair<std::string, unsigned int> > > >::insert(std::pair<unsigned long long const, std::pair<std::string, unsigned int> > const&)
-f0ea c 359 45
-f0f6 14 360 45
-f116 7 98 68
-f11d 1 98 68
-f12a 1d 85 68
-f147 5 86 68
-f14c 1d 88 68
-f169 1 88 68
-FUNC f16a 29 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_get_node()
-f16a c 355 45
-f176 1d 356 40
-f193 1 356 40
-FUNC f194 5f 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_create_node(std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> const&)
-f194 d 363 45
-f1a1 e 365 40
-f1af 3c 367 40
-f1eb 8 373 40
-f1f3 1 373 40
-FUNC f1f4 cd 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> const&)
-f1f4 d 787 45
-f201 15 789 40
-f216 5d 792 40
-f273 24 796 40
-f297 f 798 40
-f2a6 1b 799 40
-f2c1 1 799 40
-FUNC f2c2 1ef 0 std::_Rb_tree<unsigned long long, std::pair<unsigned long long const, dwarf2reader::FunctionInfo*>, std::_Select1st<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> >, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::insert_unique(std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> const&)
-f2c2 d 869 45
-f2cf e 871 40
-f2dd e 872 40
-f2eb 4 873 40
-f2ef 2 874 40
-f2f1 6 876 40
-f2f7 35 877 40
-f32c 2a 878 40
-f356 6 874 40
-f35c 12 880 40
-f36e a 881 40
-f378 24 882 40
-f39c 51 883 40
-f3ed b 885 40
-f3f8 36 886 40
-f42e 4e 887 40
-f47c 35 888 40
-f4b1 1 888 40
-FUNC f4b2 20 0 std::map<unsigned long long, dwarf2reader::FunctionInfo*, std::less<unsigned long long>, std::allocator<std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> > >::insert(std::pair<unsigned long long const, dwarf2reader::FunctionInfo*> const&)
-f4b2 c 359 45
-f4be 14 360 45
-FUNC f4d2 19 0 void std::_Destroy<std::string>(std::string*)
-f4d2 c 106 45
-f4de d 107 73
-f4eb 1 107 73
-FUNC f4ec 44 0 void std::__destroy_aux<__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > > >(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, __gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, __false_type)
-f4ec c 119 45
-f4f8 2 121 73
-f4fa 13 122 73
-f50d 21 121 73
-f52e 2 122 73
-FUNC f530 28 0 void std::_Destroy<__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > > >(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, __gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >)
-f530 c 148 45
-f53c 1c 155 73
-f565 6 82 79
-f56b 2 85 79
-f56d 24 86 79
-f591 2c 85 79
-f5bd b 87 79
-f5c8 b 89 79
-f5d3 12 91 79
-f5e5 b 92 79
-f5f0 13 89 79
-f603 9 92 79
-f618 23 113 79
-f63b 1 113 79
-f648 1b 254 79
-f663 1 254 79
-FUNC f664 430 0 std::vector<std::string, std::allocator<std::string> >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::string*, std::vector<std::string, std::allocator<std::string> > >, std::string const&)
-f664 14 249 47
-f678 14 251 78
-f68c 22 253 78
-f6ae f 255 78
-f6bd 12 256 78
-f6cf 55 257 78
-f724 4b 260 78
-f76f e 264 78
-f77d 15 265 78
-f792 e 266 78
-f7a0 1d 271 78
-f7bd 8 272 78
-f7c5 e 273 78
-f7d3 27 275 78
-f7fa 6 276 78
-f800 55 279 78
-f855 25 284 78
-f87a b 285 78
-f885 4f 286 78
-f8d4 3 284 78
-f8d7 13 279 78
-f8ea e 286 78
-f8f8 4d 298 78
-f945 30 299 78
-f975 12 302 78
-f987 13 303 78
-f99a 23 304 78
-f9bd 3 298 78
-f9c0 13 286 78
-f9d3 b 292 78
-f9de 39 294 78
-fa17 23 295 78
-fa3a 8 296 78
-fa42 16 294 78
-fa58 3 296 78
-fa5b 19 292 78
-fa74 19 298 78
-fa8d 7 304 78
-FUNC fa94 70 0 std::vector<std::string, std::allocator<std::string> >::push_back(std::string const&)
-fa94 c 602 47
-faa0 10 604 71
-fab0 1e 606 71
-face 11 607 71
-fadf 25 610 71
-FUNC fb04 19 0 void std::_Destroy<dwarf2reader::SourceFileInfo>(dwarf2reader::SourceFileInfo*)
-fb04 c 106 47
-fb10 d 107 73
-fb1d 1 107 73
-FUNC fb1e 44 0 void std::__destroy_aux<__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > > >(__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, __gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, __false_type)
-fb1e c 119 47
-fb2a 2 121 73
-fb2c 13 122 73
-fb3f 21 121 73
-fb60 2 122 73
-FUNC fb62 28 0 void std::_Destroy<__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > > >(__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, __gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >)
-fb62 c 148 47
-fb6e 1c 155 73
-fb97 6 82 79
-fb9d 2 85 79
-fb9f 24 86 79
-fbc3 2c 85 79
-fbef b 87 79
-fbfa b 89 79
-fc05 12 91 79
-fc17 b 92 79
-fc22 13 89 79
-fc35 9 92 79
-fc4a 23 113 79
-fc6d 1 113 79
-fc7a 1b 254 79
-fc95 1 254 79
-FUNC fc96 43d 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::_M_insert_aux(__gnu_cxx::__normal_iterator<dwarf2reader::SourceFileInfo*, std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> > >, dwarf2reader::SourceFileInfo const&)
-fc96 14 249 47
-fcaa 14 251 78
-fcbe 22 253 78
-fce0 f 255 78
-fcef 12 256 78
-fd01 55 257 78
-fd56 4b 260 78
-fda1 e 264 78
-fdaf 15 265 78
-fdc4 e 266 78
-fdd2 1d 271 78
-fdef 8 272 78
-fdf7 e 273 78
-fe05 27 275 78
-fe2c 6 276 78
-fe32 55 279 78
-fe87 25 284 78
-feac b 285 78
-feb7 4f 286 78
-ff06 3 284 78
-ff09 13 279 78
-ff1c e 286 78
-ff2a 4d 298 78
-ff77 36 299 78
-ffad 12 302 78
-ffbf 13 303 78
-ffd2 2a 304 78
-fffc 3 298 78
-ffff 13 286 78
-10012 b 292 78
-1001d 39 294 78
-10056 23 295 78
-10079 8 296 78
-10081 16 294 78
-10097 3 296 78
-1009a 19 292 78
-100b3 19 298 78
-100cc 7 304 78
-100d3 1 304 78
-FUNC 100d4 70 0 std::vector<dwarf2reader::SourceFileInfo, std::allocator<dwarf2reader::SourceFileInfo> >::push_back(dwarf2reader::SourceFileInfo const&)
-100d4 c 602 47
-100e0 10 604 71
-100f0 1e 606 71
-1010e 11 607 71
-1011f 25 610 71
-FUNC 10144 16c 0 Start
-10144 17 610 71
-1015b 40 49 48
-1019b 6 51 48
-101a1 3f 53 48
-101e0 7 54 48
-101e7 5 55 48
-101ec 2a 58 48
-10216 61 61 48
-10277 7 62 48
-1027e 2 63 48
-10280 29 66 48
-102a9 7 67 48
-FUNC 102b0 108 0 Usage
-102b0 19 70 48
-102c9 30 71 48
-102f9 29 73 48
-10322 30 74 48
-10352 30 75 48
-10382 30 76 48
-103b2 6 77 48
-FUNC 103b8 3af 0 SetupOptions
-103b8 21 80 48
-103d9 8 82 48
-103e1 6 85 48
-103e7 10 86 48
-103f7 2e 88 48
-10425 2f 94 48
-10454 2a 91 48
-1047e 23 95 48
-104a1 3e 97 48
-104df 11 98 48
-104f0 7c 99 48
-1056c c 100 48
-10578 5 99 48
-1057d 3e 101 48
-105bb 11 102 48
-105cc 3e 103 48
-1060a 11 104 48
-1061b 37 106 48
-10652 b 107 48
-1065d c 108 48
-10669 b 113 48
-10674 c 114 48
-10680 14 119 48
-10694 30 120 48
-106c4 b 121 48
-106cf c 122 48
-106db 81 127 48
-1075c b 128 48
-10767 1 128 48
-FUNC 10768 a7 0 main
-10768 13 131 48
-1077b 37 132 48
-107b2 1e 135 48
-107d0 e 136 48
-107de 8 137 48
-107e6 17 139 48
-107fd c 141 48
-10809 6 142 48
-1080f 1 142 48
-10810 c 47 49
-1081c 1a 48 49
-10836 2 49 49
-10838 c 47 49
-10844 1a 48 49
-1085e 2 49 49
-FUNC 10860 cb 0 google_breakpad::FileID::FileIdentifier(unsigned char*)
-10860 f 51 49
-1086f 16 52 49
-10885 6 53 49
-1088b f 54 49
-1089a b 57 49
-108a5 7 62 49
-108ac 2 63 49
-108ae 1c 64 49
-108ca 32 63 49
-108fc b 67 49
-10907 12 68 49
-10919 10 70 49
-10929 2 71 49
-1092b 1 71 49
-FUNC 1092c f2 0 google_breakpad::FileID::MachoIdentifier(int, unsigned char*)
-1092c 10 73 49
-1093c 15 74 49
-10951 20 76 49
-10971 f 77 49
-10980 20 79 49
-109a0 c 80 49
-109ac 69 82 49
-10a15 9 83 49
-FUNC 10a1e fb 0 google_breakpad::FileID::ConvertIdentifierToString(unsigned char const*, char*, int)
-10a1e c 87 49
-10a2a 7 88 49
-10a31 c 89 49
-10a3d 15 90 49
-10a52 12 91 49
-10a64 18 93 49
-10a7c e 94 49
-10a8a 2b 96 49
-10ab5 2b 97 49
-10ae0 17 89 49
-10af7 20 101 49
-10b17 2 102 49
-10b19 1 102 49
-FUNC 10b1a 13 0 NXHostByteOrder
-10b1a c 144 56
-10b26 5 147 56
-10b2b 2 153 56
-10b2d 1 153 56
-10b2e c 56 51
-10b3a 1a 57 51
-10b54 1e 58 51
-10b72 2 59 51
-10b74 c 56 51
-10b80 1a 57 51
-10b9a 1e 58 51
-10bb8 2 59 51
-10bba c 61 51
-10bc6 e 62 51
-10bd4 11 63 51
-10be5 2 64 51
-10be7 1 64 51
-10be8 c 61 51
-10bf4 e 62 51
-10c02 11 63 51
-10c13 2 64 51
-10c15 1 64 51
-FUNC 10c16 477 0 MacFileUtilities::MachoID::UpdateCRC(unsigned char*, unsigned long)
-10c16 c 74 51
-10c22 11 82 51
-10c33 14 83 51
-10c47 5 86 51
-10c4c 9 87 51
-10c55 7 88 51
-10c5c 18b 90 51
-10de7 6 91 51
-10ded 14 89 51
-10e01 23 93 51
-10e24 23 94 51
-10e47 d 86 51
-10e54 f 98 51
-10e63 6 100 51
-10e69 18b 101 51
-10ff4 6 102 51
-10ffa c 99 51
-11006 13 105 51
-11019 8 106 51
-11021 10 104 51
-11031 23 108 51
-11054 23 109 51
-11077 14 110 51
-1108b 2 112 51
-1108d 1 112 51
-FUNC 1108e 2c 0 MacFileUtilities::MachoID::UpdateMD5(unsigned char*, unsigned long)
-1108e c 114 51
-1109a 1e 115 51
-110b8 2 116 51
-FUNC 110ba 2c 0 MacFileUtilities::MachoID::UpdateSHA1(unsigned char*, unsigned long)
-110ba c 118 51
-110c6 1e 119 51
-110e4 2 120 51
-FUNC 110e6 121 0 MacFileUtilities::MachoID::Update(MacFileUtilities::MachoWalker*, unsigned long, unsigned long)
-110e6 f 122 51
-110f5 1b 123 51
-11110 e 129 51
-1111e 5 130 51
-11123 9 131 51
-1112c 7 132 51
-11133 a 133 51
-1113d 6 135 51
-11143 7 136 51
-1114a 35 139 51
-1117f 6c 142 51
-111eb 10 143 51
-111fb a 130 51
-11205 2 145 51
-11207 1 145 51
-FUNC 11208 cf 0 MacFileUtilities::MachoID::UUIDCommand(int, unsigned char*)
-11208 14 147 51
-1121c 25 149 51
-11241 7 151 51
-11248 19 152 51
-11261 9 153 51
-1126a 8 157 51
-11272 1f 158 51
-11291 9 159 51
-1129a 36 162 51
-112d0 7 163 51
-112d7 1 163 51
-FUNC 112d8 224 0 MacFileUtilities::MachoID::IDCommand(int, unsigned char*)
-112d8 15 165 51
-112ed 25 167 51
-11312 7 169 51
-11319 19 170 51
-11332 c 171 51
-1133e c 175 51
-1134a 6 180 51
-11350 7 181 51
-11357 9 182 51
-11360 9 183 51
-11369 28 185 51
-11391 33 186 51
-113c4 1e 185 51
-113e2 10 189 51
-113f2 10 190 51
-11402 10 191 51
-11412 d 192 51
-1141f 10 193 51
-1142f 10 194 51
-1143f 10 195 51
-1144f d 196 51
-1145c 17 197 51
-11473 17 198 51
-1148a 17 199 51
-114a1 14 200 51
-114b5 9 202 51
-114be 36 205 51
-114f4 8 206 51
-FUNC 114fc d1 0 MacFileUtilities::MachoID::Adler32(int)
-114fc 14 208 51
-11510 25 209 51
-11535 27 210 51
-1155c d 211 51
-11569 19 213 51
-11582 9 214 51
-1158b 3b 216 51
-115c6 7 217 51
-115cd 1 217 51
-FUNC 115ce f8 0 MacFileUtilities::MachoID::MD5(int, unsigned char*)
-115ce 14 219 51
-115e2 25 220 51
-11607 27 221 51
-1162e 19 223 51
-11647 19 224 51
-11660 9 225 51
-11669 17 227 51
-11680 9 228 51
-11689 36 231 51
-116bf 7 232 51
-FUNC 116c6 f8 0 MacFileUtilities::MachoID::SHA1(int, unsigned char*)
-116c6 14 234 51
-116da 25 235 51
-116ff 27 236 51
-11726 19 238 51
-1173f 19 239 51
-11758 9 240 51
-11761 17 242 51
-11778 9 243 51
-11781 36 246 51
-117b7 7 247 51
-FUNC 117be 378 0 MacFileUtilities::MachoID::WalkerCB(MacFileUtilities::MachoWalker*, load_command*, long long, bool, void*)
-117be 2b 251 51
-117e9 6 252 51
-117ef e 254 51
-117fd 38 257 51
-11835 f 258 51
-11844 9 260 51
-1184d 17 261 51
-11864 20 266 51
-11884 f 267 51
-11893 d 271 51
-118a0 c 273 51
-118ac 38 274 51
-118e4 f 275 51
-118f3 9 277 51
-118fc 1f 278 51
-1191b 14 282 51
-1192f 2b 283 51
-1195a d 285 51
-11967 19 273 51
-11980 e 287 51
-1198e 38 290 51
-119c6 f 291 51
-119d5 9 293 51
-119de 17 294 51
-119f5 20 299 51
-11a15 f 300 51
-11a24 d 304 51
-11a31 c 306 51
-11a3d 38 307 51
-11a75 f 308 51
-11a84 9 310 51
-11a8d 1f 311 51
-11aac 1a 315 51
-11ac6 39 316 51
-11aff d 318 51
-11b0c 11 306 51
-11b1d 10 323 51
-11b2d 9 324 51
-FUNC 11b36 95 0 MacFileUtilities::MachoID::UUIDWalkerCB(MacFileUtilities::MachoWalker*, load_command*, long long, bool, void*)
-11b36 1e 328 51
-11b54 a 329 51
-11b5e 6 331 51
-11b64 2f 333 51
-11b93 9 335 51
-11b9c 6 337 51
-11ba2 14 338 51
-11bb6 9 340 51
-11bbf a 344 51
-11bc9 2 345 51
-11bcb 1 345 51
-FUNC 11bcc 95 0 MacFileUtilities::MachoID::IDWalkerCB(MacFileUtilities::MachoWalker*, load_command*, long long, bool, void*)
-11bcc 1e 349 51
-11bea a 350 51
-11bf4 6 351 51
-11bfa 2f 353 51
-11c29 9 354 51
-11c32 6 356 51
-11c38 14 357 51
-11c4c 9 359 51
-11c55 a 363 51
-11c5f 2 364 51
-11c61 1 364 51
-FUNC 11c62 1c 0 _OSSwapInt32
-11c62 f 53 55
-11c71 8 55 55
-11c79 3 56 55
-11c7c 2 57 55
-FUNC 11c7e 19 0 NXSwapInt
-11c7e f 52 56
-11c8d 8 54 56
-11c95 2 55 56
-11c97 1 55 56
-FUNC 11c98 13 0 NXHostByteOrder
-11c98 c 144 56
-11ca4 5 147 56
-11ca9 2 153 56
-11cab 1 153 56
-11cac c 52 54
-11cb8 12 54 54
-11cca 1a 55 54
-11ce4 2 56 54
-11ce6 c 52 54
-11cf2 12 54 54
-11d04 1a 55 54
-11d1e 2 56 54
-11d20 c 58 54
-11d2c a 59 54
-11d36 d 60 54
-11d43 2 61 54
-11d45 1 61 54
-11d46 c 58 54
-11d52 a 59 54
-11d5c d 60 54
-11d69 2 61 54
-11d6b 1 61 54
-FUNC 11d6c 37 0 MacFileUtilities::MachoWalker::ValidateCPUType(int)
-11d6c c 63 54
-11d78 6 66 54
-11d7e 8 67 54
-11d86 6 68 54
-11d8c b 69 54
-11d97 7 74 54
-11d9e 3 80 54
-11da1 2 81 54
-11da3 1 81 54
-FUNC 11da4 50 0 MacFileUtilities::MachoWalker::ReadBytes(void*, unsigned long, long long)
-11da4 18 96 54
-11dbc 36 97 54
-11df2 2 98 54
-FUNC 11df4 73 0 MacFileUtilities::MachoWalker::CurrentHeader(mach_header_64*, long long*)
-11df4 c 100 54
-11e00 a 101 54
-11e0a 37 102 54
-11e41 11 103 54
-11e52 9 104 54
-11e5b a 107 54
-11e65 2 108 54
-11e67 1 108 54
-FUNC 11e68 2a6 0 MacFileUtilities::MachoWalker::FindHeader(int, long long&)
-11e68 c 110 54
-11e74 15 111 54
-11e89 31 114 54
-11eba c 115 54
-11ec6 10 117 54
-11ed6 4 120 54
-11eda 14 121 54
-11eee 4 122 54
-11ef2 11 129 54
-11f03 28 124 54
-11f2b c 126 54
-11f37 31 133 54
-11f68 c 134 54
-11f74 14 136 54
-11f88 b 137 54
-11f93 8 139 54
-11f9b c 140 54
-11fa7 10 142 54
-11fb7 c 143 54
-11fc3 10 146 54
-11fd3 31 148 54
-12004 c 149 54
-12010 f 151 54
-1201f 14 152 54
-12033 16 154 54
-12049 c 158 54
-12055 31 159 54
-12086 9 160 54
-1208f f 162 54
-1209e 1c 163 54
-120ba 8 165 54
-120c2 10 166 54
-120d2 9 167 54
-120db 16 170 54
-120f1 11 158 54
-12102 a 174 54
-1210c 2 175 54
-FUNC 1210e 109 0 MacFileUtilities::MachoWalker::WalkHeaderCore(long long, unsigned int, bool)
-1210e 1e 224 54
-1212c c 225 54
-12138 2f 227 54
-12167 c 228 54
-12173 6 230 54
-12179 14 231 54
-1218d 5b 234 54
-121e8 12 237 54
-121fa 11 225 54
-1220b a 240 54
-12215 2 241 54
-12217 1 241 54
-FUNC 12218 10e 0 MacFileUtilities::MachoWalker::WalkHeader64AtOffset(long long)
-12218 18 203 54
-12230 2f 205 54
-1225f c 206 54
-1226b e 208 54
-12279 6 209 54
-1227f 14 210 54
-12293 9 212 54
-1229c a 213 54
-122a6 f 214 54
-122b5 15 215 54
-122ca 2b 216 54
-122f5 a 217 54
-122ff a 218 54
-12309 11 219 54
-1231a a 220 54
-12324 2 221 54
-FUNC 12326 143 0 MacFileUtilities::MachoWalker::WalkHeaderAtOffset(long long)
-12326 18 177 54
-1233e 2f 179 54
-1236d c 180 54
-12379 e 182 54
-12387 6 183 54
-1238d 14 184 54
-123a1 2e 189 54
-123cf 7 190 54
-123d6 9 192 54
-123df a 193 54
-123e9 f 194 54
-123f8 15 195 54
-1240d 2b 196 54
-12438 a 197 54
-12442 a 198 54
-1244c 11 199 54
-1245d a 200 54
-12467 2 201 54
-12469 1 201 54
-FUNC 1246a 99 0 MacFileUtilities::MachoWalker::WalkHeader(int)
-1246a c 83 54
-12476 15 84 54
-1248b 1d 86 54
-124a8 d 87 54
-124b5 21 88 54
-124d6 21 90 54
-124f7 a 93 54
-12501 2 94 54
-12503 1 94 54
-FUNC 12504 1c 0 _OSSwapInt32
-12504 f 53 55
-12513 8 55 55
-1251b 3 56 55
-1251e 2 57 55
-FUNC 12520 2b 0 _OSSwapInt64
-12520 12 64 55
-12532 11 69 55
-12543 6 70 55
-12549 2 71 55
-1254b 1 71 55
-FUNC 1254c 19 0 NXSwapLong
-1254c f 61 56
-1255b 8 63 56
-12563 2 64 56
-12565 1 64 56
-FUNC 12566 1f 0 NXSwapLongLong
-12566 12 70 56
-12578 b 72 56
-12583 2 73 56
-12585 1 73 56
-FUNC 12586 32 0 breakpad_swap_uuid_command(breakpad_uuid_command*, NXByteOrder)
-12586 c 37 57
-12592 11 39 57
-125a3 13 40 57
-125b6 2 41 57
-FUNC 125b8 da 0 breakpad_swap_segment_command_64(segment_command_64*, NXByteOrder)
-125b8 c 44 57
-125c4 11 46 57
-125d5 13 47 57
-125e8 17 49 57
-125ff 17 50 57
-12616 17 51 57
-1262d 17 52 57
-12644 13 54 57
-12657 13 55 57
-1266a 13 56 57
-1267d 13 57 57
-12690 2 58 57
-FUNC 12692 a4 0 breakpad_swap_mach_header_64(mach_header_64*, NXByteOrder)
-12692 c 61 57
-1269e 11 63 57
-126af 13 64 57
-126c2 13 65 57
-126d5 13 66 57
-126e8 13 67 57
-126fb 13 68 57
-1270e 13 69 57
-12721 13 70 57
-12734 2 71 57
-FUNC 12736 1d1 0 breakpad_swap_section_64(section_64*, unsigned int, NXByteOrder)
-12736 d 75 57
-12743 c 77 57
-1274f 33 78 57
-12782 33 79 57
-127b5 2d 81 57
-127e2 2d 82 57
-1280f 2d 83 57
-1283c 2d 84 57
-12869 2d 85 57
-12896 2d 86 57
-128c3 2d 87 57
-128f0 11 77 57
-12901 6 89 57
-12907 1 89 57
-12908 12 9 58
-1291a 4f 11 58
-12969 2 12 58
-1296b 1 12 58
-1296c 12 9 58
-1297e 4f 11 58
-129cd 2 12 58
-129cf 1 12 58
-129d0 13 14 58
-129e3 2a 14 58
-12a0d 1 14 58
-12a0e 13 14 58
-12a21 2a 14 58
-12a4b 1 14 58
-12a4c 13 14 58
-12a5f 2a 14 58
-12a89 1 14 58
-FUNC 12a8a bb 0 dwarf2reader::ByteReader::SetOffsetSize(unsigned char)
-12a8a 19 16 58
-12aa3 a 17 58
-12aad 48 18 58
-12af5 6 19 58
-12afb 23 20 58
-12b1e 21 22 58
-12b3f 6 24 58
-12b45 1 24 58
-FUNC 12b46 bb 0 dwarf2reader::ByteReader::SetAddressSize(unsigned char)
-12b46 19 26 58
-12b5f a 27 58
-12b69 48 28 58
-12bb1 6 29 58
-12bb7 23 30 58
-12bda 21 32 58
-12bfb 6 34 58
-12c01 1 34 58
-FUNC 12c02 a2 0 dwarf2reader::ByteReader::ReadFourBytes(char const*) const
-12c02 c 24 59
-12c0e c 25 64
-12c1a d 26 64
-12c27 f 27 64
-12c36 f 28 64
-12c45 b 29 64
-12c50 27 30 64
-12c77 2b 32 64
-12ca2 2 34 64
-FUNC 12ca4 40e 0 dwarf2reader::ByteReader::ReadEightBytes(char const*) const
-12ca4 11 36 59
-12cb5 1a 37 64
-12ccf 1b 38 64
-12cea 1d 39 64
-12d07 1d 40 64
-12d24 1d 41 64
-12d41 1d 42 64
-12d5e 1d 43 64
-12d7b 1d 44 64
-12d98 f 45 64
-12da7 18f 47 64
-12f36 172 50 64
-130a8 a 52 64
-130b2 2 52 64
-FUNC 130b4 a6 0 ReadInitialLength
-130b4 15 29 60
-130c9 18 30 60
-130e1 6 31 60
-130e7 d 35 60
-130f4 13 36 60
-13107 9 37 60
-13110 1a 38 60
-1312a 13 40 60
-1313d 9 41 60
-13146 12 43 60
-13158 2 44 60
-1315a 1f 47 60
-13179 65 50 60
-131de 1f 47 60
-131fd 65 50 60
-FUNC 13262 393 0 dwarf2reader::CompilationUnit::SkipAttribute(char const*, dwarf2reader::DwarfForm)
-13262 14 133 60
-13276 82 136 60
-132f8 1f 139 60
-13317 a 140 60
-13321 21 141 60
-13342 c 147 60
-1334e e 151 60
-1335c e 155 60
-1336a e 159 60
-13378 27 162 60
-1339f 1c 166 60
-133bb 10 167 60
-133cb 1c 171 60
-133e7 10 172 60
-133f7 1e 175 60
-13415 56 180 60
-1346b d 181 60
-13478 1e 182 60
-13496 11 183 60
-134a7 1e 184 60
-134c5 24 189 60
-134e9 26 192 60
-1350f 23 195 60
-13532 22 198 60
-13554 15 199 60
-13569 1b 203 60
-13584 30 206 60
-135b4 30 208 60
-135e4 a 209 60
-135ee 7 210 60
-135f5 1 210 60
-FUNC 135f6 29b 0 dwarf2reader::CompilationUnit::ReadHeader()
-135f6 14 217 60
-1360a 9 218 60
-13613 4e 221 60
-13661 17 223 60
-13678 a 224 60
-13682 f 225 60
-13691 4e 227 60
-136df 1e 228 60
-136fd 6 229 60
-13703 5e 231 60
-13761 1e 232 60
-1377f 18 233 60
-13797 4c 235 60
-137e3 1d 236 60
-13800 1c 237 60
-1381c 5 238 60
-13821 9 240 60
-1382a 60 245 60
-1388a 7 247 60
-13891 1 247 60
-FUNC 13892 a57 0 dwarf2reader::CompilationUnit::ProcessAttribute(unsigned long long, char const*, dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm)
-13892 24 299 60
-138b6 8a 302 60
-13940 1f 307 60
-1395f a 308 60
-13969 36 309 60
-1399f 5b 316 60
-139fa c 317 60
-13a06 5b 322 60
-13a61 e 323 60
-13a6f 55 328 60
-13ac4 e 329 60
-13ad2 55 334 60
-13b27 e 335 60
-13b35 6 338 60
-13b3b 9a 340 60
-13bd5 33 341 60
-13c08 25 340 60
-13c2d 5c 348 60
-13c89 10 349 60
-13c99 5c 354 60
-13cf5 10 355 60
-13d05 55 359 60
-13d5a 1e 360 60
-13d78 56 365 60
-13dce d 366 60
-13ddb 55 368 60
-13e30 1e 369 60
-13e4e 11 370 60
-13e5f 55 372 60
-13eb4 1e 373 60
-13ed2 29 378 60
-13efb 4a 380 60
-13f45 f 381 60
-13f54 29 385 60
-13f7d 4c 387 60
-13fc9 11 388 60
-13fda 1b 392 60
-13ff5 4c 394 60
-14041 11 395 60
-14052 22 399 60
-14074 4e 401 60
-140c2 15 402 60
-140d7 3c 406 60
-14113 1b 408 60
-1412e 54 409 60
-14182 f 411 60
-14191 9a 413 60
-1422b 24 414 60
-1424f 25 413 60
-14274 30 418 60
-142a4 30 420 60
-142d4 a 421 60
-142de b 422 60
-142e9 1 422 60
-142ea 1f 489 60
-14309 3a 491 60
-14343 a 492 60
-1434d 6 493 60
-14353 1 493 60
-14354 1f 489 60
-14373 3a 491 60
-143ad a 492 60
-143b7 6 493 60
-143bd 1 493 60
-FUNC 143be b5 0 dwarf2reader::CompilationUnit::ProcessDIE(unsigned long long, char const*, dwarf2reader::CompilationUnit::Abbrev const&)
-143be 19 426 60
-143d7 13 427 60
-143ea 46 430 60
-14430 3a 427 60
-1446a 3 432 60
-1446d 6 433 60
-14473 1 433 60
-FUNC 14474 85 0 dwarf2reader::CompilationUnit::SkipDIE(char const*, dwarf2reader::CompilationUnit::Abbrev const&)
-14474 c 122 60
-14480 13 123 60
-14493 27 126 60
-144ba 3a 123 60
-144f4 3 128 60
-144f7 2 129 60
-144f9 1 129 60
-FUNC 144fa be4 0 dwarf2reader::LineInfo::ProcessOneOpcode(dwarf2reader::ByteReader*, dwarf2reader::LineInfoHandler*, dwarf2reader::LineInfoHeader const&, char const*, dwarf2reader::LineStateMachine*, unsigned long*, unsigned long, bool*)
-144fa 18 593 60
-14512 a 594 60
-1451c 18 596 60
-14534 8 597 60
-1453c 5 598 60
-14541 19 602 60
-1455a f 603 60
-14569 50 605 60
-145b9 46 607 60
-145ff e0 610 60
-146df 6 612 60
-146e5 22 615 60
-14707 22 616 60
-14729 7 617 60
-14730 b 618 60
-1473b f 619 60
-1474a 5a 623 60
-147a4 7 625 60
-147ab b 626 60
-147b6 f 627 60
-147c5 28 631 60
-147ed e 632 60
-147fb 144 635 60
-1493f 6 637 60
-14945 9e 640 60
-149e3 5 642 60
-149e8 22 644 60
-14a0a e 645 60
-14a18 1c 646 60
-14a34 2b 652 60
-14a5f b 653 60
-14a6a 22 658 60
-14a8c e 659 60
-14a9a 8 660 60
-14aa2 5 662 60
-14aa7 22 664 60
-14ac9 e 665 60
-14ad7 9 666 60
-14ae0 5 668 60
-14ae5 12 670 60
-14af7 5 672 60
-14afc 7 674 60
-14b03 5 676 60
-14b08 16 678 60
-14b1e 9 679 60
-14b27 d9 682 60
-14c00 6 684 60
-14c06 1f 687 60
-14c25 5 689 60
-14c2a 40 693 60
-14c6a d6 696 60
-14d40 6 698 60
-14d46 1c 701 60
-14d62 5 703 60
-14d67 1f 706 60
-14d86 d 707 60
-14d93 13 708 60
-14da6 26 710 60
-14dcc 5 711 60
-14dd1 50 713 60
-14e21 7 715 60
-14e28 b 716 60
-14e33 f 717 60
-14e42 18 725 60
-14e5a f 726 60
-14e69 5 728 60
-14e6e 6 730 60
-14e74 28 732 60
-14e9c d 733 60
-14ea9 22 735 60
-14ecb e 736 60
-14ed9 22 739 60
-14efb e 740 60
-14f09 22 743 60
-14f2b e 744 60
-14f39 a 746 60
-14f43 fd 748 60
-15040 a 758 60
-1504a 9 759 60
-15053 1c 761 60
-1506f d 762 60
-1507c e 763 60
-1508a 2e 759 60
-150b8 b 769 60
-150c3 10 770 60
-150d3 b 771 60
-FUNC 150de 14b 0 dwarf2reader::LineInfo::ReadLines()
-150de e 773 60
-150ec 9 778 60
-150f5 17 782 60
-1510c 8 783 60
-15114 6 785 60
-1511a 9 787 60
-15123 5 788 60
-15128 19 789 60
-15141 5 790 60
-15146 4a 793 60
-15190 6 794 60
-15196 4a 796 60
-151e0 a 797 60
-151ea f 790 60
-151f9 15 788 60
-1520e 14 801 60
-15222 7 802 60
-15229 1 802 60
-FUNC 1522a 4fd 0 dwarf2reader::CompilationUnit::ReadAbbrevs()
-1522a 18 60 60
-15242 e 61 60
-15250 58 65 60
-152a8 38 66 60
-152e0 44 65 60
-15324 2a 66 60
-1534e 45 68 60
-15393 16 69 60
-153a9 1d 75 60
-153c6 6 76 60
-153cc 40 77 60
-1540c b 80 60
-15417 1f 82 60
-15436 e 84 60
-15444 6 77 60
-1544a 1f 68 60
-15469 a 84 60
-15473 1d 79 60
-15490 6 86 60
-15496 a 87 60
-154a0 3d 89 60
-154dd 1f 90 60
-154fc a 91 60
-15506 6 92 60
-1550c 3d 94 60
-15549 1d 95 60
-15566 5 96 60
-1556b 3d 98 60
-155a8 1f 101 60
-155c7 a 102 60
-155d1 3d 104 60
-1560e 1f 105 60
-1562d a 106 60
-15637 c 107 60
-15643 6 111 60
-15649 6 112 60
-1564f 32 113 60
-15681 47 115 60
-156c8 30 116 60
-156f8 24 79 60
-1571c b 118 60
-15727 1 118 60
-FUNC 15728 5dc 0 dwarf2reader::LineInfo::ReadHeader()
-15728 18 503 60
-15740 9 504 60
-15749 17 508 60
-15760 a 510 60
-1576a f 511 60
-15779 60 512 60
-157d9 44 516 60
-1581d 1e 518 60
-1583b 6 519 60
-15841 1e 521 60
-1585f 18 522 60
-15877 1d 524 60
-15894 5 525 60
-15899 20 527 60
-158b9 5 528 60
-158be c 530 60
-158ca 5 531 60
-158cf 1d 533 60
-158ec 5 534 60
-158f1 1d 536 60
-1590e 5 537 60
-15913 45 539 60
-15958 1f 540 60
-15977 19 541 60
-15990 15 542 60
-159a5 1f 539 60
-159c4 30 543 60
-159f4 5 544 60
-159f9 14 542 60
-15a0d e 548 60
-15a1b 7 549 60
-15a22 5 550 60
-15a27 6 551 60
-15a2d 8b 552 60
-15ab8 28 553 60
-15ae0 5 554 60
-15ae5 16 550 60
-15afb 25 552 60
-15b20 5 557 60
-15b25 e 560 60
-15b33 7 561 60
-15b3a 5 563 60
-15b3f 6 564 60
-15b45 28 565 60
-15b6d 22 567 60
-15b8f a 568 60
-15b99 22 570 60
-15bbb a 571 60
-15bc5 22 573 60
-15be7 a 574 60
-15bf1 ba 576 60
-15cab 5 577 60
-15cb0 16 563 60
-15cc6 25 576 60
-15ceb 5 580 60
-15cf0 9 582 60
-15cf9 b 583 60
-FUNC 15d04 3d 0 dwarf2reader::LineInfo::Start()
-15d04 c 495 60
-15d10 b 496 60
-15d1b b 497 60
-15d26 19 498 60
-15d3f 2 499 60
-15d41 1 499 60
-FUNC 15d42 304 0 dwarf2reader::CompilationUnit::ProcessDIEs()
-15d42 11 435 60
-15d53 9 436 60
-15d5c 9 441 60
-15d65 17 445 60
-15d7c 8 446 60
-15d84 6 448 60
-15d8a 6c 453 60
-15df6 8 455 60
-15dfe 16 453 60
-15e14 3 455 60
-15e17 2f 453 60
-15e46 29 458 60
-15e6f 22 460 60
-15e91 a 462 60
-15e9b a 465 60
-15ea5 1e 466 60
-15ec3 13 467 60
-15ed6 2b 468 60
-15f01 18 472 60
-15f19 9 473 60
-15f22 42 474 60
-15f64 1e 475 60
-15f82 2a 477 60
-15fac b 480 60
-15fb7 1e 481 60
-15fd5 26 483 60
-15ffb 1d 455 60
-16018 24 485 60
-1603c a 486 60
-FUNC 16046 35f 0 dwarf2reader::CompilationUnit::Start()
-16046 18 249 60
-1605e 58 251 60
-160b6 35 252 60
-160eb 32 251 60
-1611d 2a 252 60
-16147 20 255 60
-16167 37 256 60
-1619e b 259 60
-161a9 f 264 60
-161b8 17 265 60
-161cf c 266 60
-161db a 268 60
-161e5 95 271 60
-1627a 11 276 60
-1628b b 279 60
-16296 58 282 60
-162ee 2f 283 60
-1631d 32 282 60
-1634f 14 284 60
-16363 1a 285 60
-1637d b 289 60
-16388 12 291 60
-1639a b 292 60
-163a5 1 292 60
-FUNC 163a6 3a 0 std::fill(unsigned char*, unsigned char*, unsigned char const&)
-163a6 c 573 61
-163b2 9 576 61
-163bb 23 577 61
-163de 2 578 61
-FUNC 163e0 33 0 std::__deque_buf_size(unsigned long)
-163e0 c 83 62
-163ec 27 84 62
-16413 1 84 62
-FUNC 16414 18 0 dwarf2reader::ByteReader::OffsetSize() const
-16414 c 38 63
-16420 c 38 63
-FUNC 1642c 18 0 dwarf2reader::ByteReader::AddressSize() const
-1642c c 41 63
-16438 c 41 63
-FUNC 16444 17 0 dwarf2reader::ByteReader::ReadOneByte(char const*) const
-16444 c 10 64
-16450 9 11 64
-16459 2 12 64
-1645b 1 12 64
-FUNC 1645c 63 0 dwarf2reader::ByteReader::ReadTwoBytes(char const*) const
-1645c c 14 64
-16468 d 15 64
-16475 e 16 64
-16483 b 17 64
-1648e 17 18 64
-164a5 18 20 64
-164bd 2 22 64
-164bf 1 22 64
-FUNC 164c0 98 0 dwarf2reader::ByteReader::ReadUnsignedLEB128(char const*, unsigned long*) const
-164c0 e 59 64
-164ce e 60 64
-164dc 7 61 64
-164e3 7 62 64
-164ea e 66 64
-164f8 5 67 64
-164fd 38 69 64
-16535 6 71 64
-1653b 8 65 64
-16543 8 75 64
-1654b 6 77 64
-16551 7 78 64
-FUNC 16558 ee 0 dwarf2reader::ByteReader::ReadSignedLEB128(char const*, unsigned long*) const
-16558 e 84 64
-16566 e 85 64
-16574 7 86 64
-1657b 7 87 64
-16582 e 91 64
-16590 5 92 64
-16595 44 93 64
-165d9 6 94 64
-165df 8 90 64
-165e7 14 97 64
-165fb 36 98 64
-16631 8 99 64
-16639 6 100 64
-1663f 7 101 64
-FUNC 16646 a2 0 dwarf2reader::ByteReader::ReadOffset(char const*) const
-16646 13 103 64
-16659 3f 104 64
-16698 4a 105 64
-166e2 6 106 64
-FUNC 166e8 a2 0 dwarf2reader::ByteReader::ReadAddress(char const*) const
-166e8 13 108 64
-166fb 3f 109 64
-1673a 4a 110 64
-16784 6 111 64
-FUNC 1678a 61 0 dwarf2reader::LineStateMachine::Reset(bool)
-1678a 12 12 65
-1679c 9 13 65
-167a5 11 14 65
-167b6 11 15 65
-167c7 a 16 65
-167d1 a 17 65
-167db 7 18 65
-167e2 7 19 65
-167e9 2 20 65
-167eb 1 20 65
-FUNC 167ec 20 0 std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator!=(std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > const&) const
-167ec c 253 66
-167f8 14 254 66
-FUNC 1680c 25 0 std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator++(int)
-1680c c 226 66
-16818 8 228 66
-16820 c 229 66
-1682c 5 230 66
-16831 1 230 66
-FUNC 16832 16 0 std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator->() const
-16832 c 215 66
-1683e a 216 66
-16848 c 190 67
-16854 a 190 67
-FUNC 1685e 13 0 std::auto_ptr<std::stack<unsigned long long, std::deque<unsigned long long, std::allocator<unsigned long long> > > >::operator->() const
-1685e c 283 67
-1686a 7 286 67
-16871 1 286 67
-16872 c 65 68
-1687e 2 65 68
-16880 c 97 69
-1688c d 97 69
-16899 1 97 69
-1689a c 99 69
-168a6 14 100 69
-168ba c 97 69
-168c6 d 97 69
-168d3 1 97 69
-168d4 c 84 70
-168e0 17 85 70
-168f7 1 85 70
-FUNC 168f8 2d 0 std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> std::make_pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>(dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm)
-168f8 c 144 70
-16904 21 145 70
-16925 1 145 70
-16926 c 202 66
-16932 a 203 66
-FUNC 1693c 25 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::begin() const
-1693c c 588 70
-16948 19 589 66
-16961 1 589 66
-FUNC 16962 23 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::end() const
-16962 c 605 70
-1696e 17 606 66
-16985 1 606 66
-16986 c 65 68
-16992 2 65 68
-16994 c 72 68
-169a0 2 72 68
-169a2 c 97 69
-169ae d 97 69
-169bb 1 97 69
-169bc c 105 69
-169c8 d 105 69
-169d5 1 105 69
-169d6 c 105 69
-169e2 d 105 69
-169ef 1 105 69
-169f0 c 67 68
-169fc 2 67 68
-169fe c 99 69
-16a0a 14 100 69
-16a1e c 99 69
-16a2a 14 100 69
-16a3e c 129 62
-16a4a 30 131 62
-16a7a c 65 68
-16a86 2 65 68
-16a88 c 72 68
-16a94 2 72 68
-16a96 c 97 69
-16aa2 d 97 69
-16aaf 1 97 69
-16ab0 c 105 69
-16abc d 105 69
-16ac9 1 105 69
-16aca c 105 69
-16ad6 d 105 69
-16ae3 1 105 69
-16ae4 c 67 68
-16af0 2 67 68
-16af2 c 99 69
-16afe 14 100 69
-16b12 c 99 69
-16b1e 14 100 69
-FUNC 16b32 2b 0 std::_Vector_base<unsigned char, std::allocator<unsigned char> >::get_allocator() const
-16b32 10 93 71
-16b42 1b 94 71
-16b5d 1 94 71
-16b6a 7 614 72
-16b71 1 614 72
-16b72 c 80 71
-16b7e d 80 71
-16b8b 1 80 71
-16b98 2 107 68
-FUNC 16b9a 2d 0 void std::_Destroy<unsigned char*, std::allocator<unsigned char> >(unsigned char*, unsigned char*, std::allocator<unsigned char>)
-16b9a c 171 73
-16ba6 2 173 73
-16ba8 12 174 73
-16bba b 173 73
-16bc5 2 174 73
-16bc7 1 174 73
-16bc8 c 84 71
-16bd4 2f 85 71
-16c03 2 86 71
-16c05 1 86 71
-16c06 c 96 71
-16c12 12 97 71
-16c24 2 98 71
-FUNC 16c26 1f 0 std::_List_base<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_init()
-16c26 c 338 73
-16c32 8 340 66
-16c3a b 341 66
-16c45 1 341 66
-16c46 c 105 69
-16c52 d 105 69
-16c5f 1 105 69
-16c60 c 125 66
-16c6c a 126 66
-FUNC 16c76 25 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::begin()
-16c76 c 579 73
-16c82 19 580 66
-16c9b 1 580 66
-FUNC 16c9c 23 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::end()
-16c9c c 597 73
-16ca8 17 597 66
-16cbf 1 597 66
-16cc0 c 603 72
-16ccc c 603 72
-FUNC 16cd8 2b 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::begin() const
-16cd8 c 342 73
-16ce4 1f 343 71
-16d03 1 343 71
-FUNC 16d04 2c 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::end() const
-16d04 c 360 73
-16d10 20 361 71
-16d3c 5 666 72
-16d41 1 666 72
-16d4f 31 759 72
-FUNC 16d80 3c 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::size() const
-16d80 c 402 73
-16d8c 30 403 71
-16dbc c 603 72
-16dc8 c 603 72
-FUNC 16dd4 23 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::begin()
-16dd4 c 333 73
-16de0 17 334 71
-16df7 1 334 71
-16e04 33 654 72
-16e37 1 654 72
-FUNC 16e38 26 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::end()
-16e38 c 351 73
-16e44 1a 352 71
-16e6a 7 614 72
-16e71 1 614 72
-FUNC 16e72 42 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::operator[](unsigned long)
-16e72 c 494 73
-16e7e 36 495 71
-FUNC 16eb4 13 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::max_size() const
-16eb4 c 407 73
-16ec0 7 408 71
-16ec7 1 408 71
-16ed4 5 666 72
-16ed9 1 666 72
-16ee6 d 623 72
-16ef3 5 624 72
-16ef8 c 382 62
-16f04 d 382 62
-16f11 1 382 62
-FUNC 16f12 2b 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::get_allocator() const
-16f12 10 360 73
-16f22 1b 361 62
-16f3d 1 361 62
-FUNC 16f3e 2d 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::get_allocator() const
-16f3e 10 764 73
-16f4e 1d 765 62
-16f6b 1 765 62
-FUNC 16f6c 13 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>::operator*() const
-16f6c c 134 73
-16f78 7 135 62
-16f7f 1 135 62
-16f8c 2 107 68
-16f8e c 129 62
-16f9a 30 131 62
-FUNC 16fca 2c 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::end() const
-16fca 10 799 73
-16fda 1c 800 62
-FUNC 16ff6 2c 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::begin() const
-16ff6 10 781 73
-17006 1c 782 62
-FUNC 17022 2e 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::end()
-17022 10 790 73
-17032 1e 791 62
-FUNC 17050 3c 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::_M_range_check(unsigned long) const
-17050 13 515 73
-17063 15 517 71
-17078 14 518 71
-FUNC 1708c 32 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::at(unsigned long)
-1708c c 534 73
-17098 12 536 71
-170aa 14 537 71
-170ca 2e 104 68
-170f8 c 84 71
-17104 2f 85 71
-17133 2 86 71
-17135 1 86 71
-17136 c 96 71
-17142 12 97 71
-17154 2 98 71
-17156 c 603 72
-17162 c 603 72
-FUNC 1716e 23 0 std::vector<unsigned char, std::allocator<unsigned char> >::begin()
-1716e c 333 73
-1717a 17 334 71
-17191 1 334 71
-1719e 27 654 72
-171c5 1 654 72
-FUNC 171c6 42 0 std::vector<unsigned char, std::allocator<unsigned char> >::operator[](unsigned long)
-171c6 c 494 73
-171d2 36 495 71
-FUNC 17208 26 0 std::vector<unsigned char, std::allocator<unsigned char> >::end()
-17208 c 351 73
-17214 1a 352 71
-1723a d 94 68
-17247 1 94 68
-FUNC 17248 2f 0 std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_deallocate(unsigned char*, unsigned long)
-17248 c 120 73
-17254 6 122 71
-1725a 1d 123 71
-17277 1 123 71
-17278 c 108 71
-17284 3a 109 71
-172be c 188 71
-172ca 12 189 71
-172dc 2 190 71
-172de c 272 71
-172ea 4b 273 71
-17335 1 273 71
-17336 13 62 74
-17349 10 62 74
-17359 a 63 74
-17363 25 64 74
-17388 1a 66 74
-173a2 13 62 74
-173b5 10 62 74
-173c5 a 63 74
-173cf 25 64 74
-173f4 1a 66 74
-1740e c 188 71
-1741a 12 189 71
-1742c 2 190 71
-1743b 31 759 72
-1746c c 65 68
-17478 2 65 68
-1747a c 103 69
-17486 d 103 69
-17493 1 103 69
-FUNC 17494 2d 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::get_allocator() const
-17494 10 570 74
-174a4 1d 571 66
-174c1 1 571 66
-174ce 2e 104 68
-FUNC 174fc 20 0 std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator!=(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > const&) const
-174fc c 172 74
-17508 14 173 66
-FUNC 1751c 1d 0 std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator++()
-1751c c 219 74
-17528 c 221 66
-17534 5 222 66
-17539 1 222 66
-FUNC 1753a 1d 0 std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator++()
-1753a c 138 74
-17546 c 140 66
-17552 5 141 66
-17557 1 141 66
-FUNC 17558 16 0 std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator*() const
-17558 c 211 74
-17564 a 212 66
-FUNC 1756e 16 0 std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator*() const
-1756e c 130 74
-1757a a 131 66
-FUNC 17584 20 0 std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >::operator==(std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > const&) const
-17584 c 249 74
-17590 14 250 66
-FUNC 175a4 35 0 bool __gnu_cxx::operator!=<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > > const&, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > > const&)
-175a4 d 699 74
-175b1 28 700 72
-175d9 1 700 72
-FUNC 175da 4b 0 void std::_Destroy<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, std::allocator<dwarf2reader::CompilationUnit::Abbrev>)
-175da c 171 74
-175e6 2 173 73
-175e8 1a 174 73
-17602 21 173 73
-17623 2 174 73
-17625 1 174 73
-17626 c 127 62
-17632 29 127 62
-1765b 1 127 62
-1765c c 388 62
-17668 41 389 62
-176a9 2 390 62
-176ab 1 390 62
-176b8 d 94 68
-176c5 1 94 68
-FUNC 176c6 20 0 bool std::operator==<unsigned long long, unsigned long long&, unsigned long long*>(std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> const&, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> const&)
-176c6 c 243 74
-176d2 14 244 62
-FUNC 176e6 26 0 bool std::operator!=<unsigned long long, unsigned long long&, unsigned long long*>(std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> const&, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> const&)
-176e6 c 256 74
-176f2 1a 257 62
-FUNC 1770c 1a 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>::_S_buffer_size()
-1770c c 106 74
-17718 e 107 62
-FUNC 17726 3e 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>::_M_set_node(unsigned long long**)
-17726 d 229 74
-17733 9 231 62
-1773c b 232 62
-17747 1d 233 62
-FUNC 17764 50 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>::operator++()
-17764 c 142 74
-17770 d 144 62
-1777d f 145 62
-1778c 18 147 62
-177a4 b 148 62
-177af 5 150 62
-FUNC 177b4 4b 0 void std::_Destroy<std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>, std::allocator<unsigned long long> >(std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>, std::allocator<unsigned long long>)
-177b4 c 171 74
-177c0 2 173 73
-177c2 1a 174 73
-177dc 21 173 73
-177fd 2 174 73
-177ff 1 174 73
-FUNC 17800 50 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>::operator--()
-17800 c 162 74
-1780c f 164 62
-1781b 18 166 62
-17833 b 167 62
-1783e d 169 62
-1784b 5 170 62
-FUNC 17850 39 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::back()
-17850 c 988 74
-1785c 15 990 62
-17871 b 991 62
-1787c d 992 62
-17889 1 992 62
-FUNC 1788a 19 0 std::stack<unsigned long long, std::deque<unsigned long long, std::allocator<unsigned long long> > >::top()
-1788a c 163 75
-17896 d 166 75
-178a3 1 166 75
-FUNC 178a4 66 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>::difference_type std::operator-<unsigned long long, unsigned long long&, unsigned long long*, unsigned long long&, unsigned long long*>(std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> const&, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> const&)
-178a4 d 328 75
-178b1 59 333 62
-FUNC 1790a 26 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::size() const
-1790a c 840 75
-17916 1a 841 62
-1793c 36 662 72
-1797e 23 650 72
-179a1 1 650 72
-179a2 c 67 68
-179ae 2 67 68
-179b0 c 99 69
-179bc 14 100 69
-179d0 c 303 66
-179dc 12 304 66
-179ee 2 305 66
-179f0 c 326 66
-179fc 2f 327 66
-17a2b d 328 66
-17a38 c 457 66
-17a44 14 458 66
-17a58 c 211 74
-17a64 2d 211 74
-17a91 1 211 74
-17a9e 7 98 68
-17aa5 1 98 68
-17ab2 1d 85 68
-17acf 5 86 68
-17ad4 17 88 68
-17aeb 1 88 68
-FUNC 17aec 2a 0 std::_Vector_base<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::_M_allocate(unsigned long)
-17aec c 116 75
-17af8 1e 117 71
-17b22 d 94 68
-17b2f 1 94 68
-FUNC 17b30 34 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_deallocate_node(unsigned long long*)
-17b30 c 402 75
-17b3c 28 403 62
-FUNC 17b64 38 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_destroy_nodes(unsigned long long**, unsigned long long**)
-17b64 c 504 75
-17b70 8 506 62
-17b78 14 507 62
-17b8c e 506 62
-17b9a 2 507 62
-FUNC 17b9c 62 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::_M_pop_back_aux()
-17b9c c 391 76
-17ba8 15 393 76
-17bbd 1b 394 76
-17bd8 f 395 76
-17be7 17 396 76
-FUNC 17bfe 4f 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::pop_back()
-17bfe c 1081 76
-17c0a 10 1083 62
-17c1a f 1086 62
-17c29 17 1087 62
-17c40 d 1090 62
-17c4d 1 1090 62
-FUNC 17c4e 19 0 std::stack<unsigned long long, std::deque<unsigned long long, std::allocator<unsigned long long> > >::pop()
-17c4e c 205 76
-17c5a d 208 75
-17c67 1 208 75
-17c68 c 72 68
-17c74 2 72 68
-17c76 c 105 69
-17c82 d 105 69
-17c8f 1 105 69
-17c90 c 603 72
-17c9c c 603 72
-FUNC 17ca8 2b 0 std::vector<unsigned char, std::allocator<unsigned char> >::begin() const
-17ca8 c 342 76
-17cb4 1f 343 71
-17cd3 1 343 71
-FUNC 17cd4 2c 0 std::vector<unsigned char, std::allocator<unsigned char> >::end() const
-17cd4 c 360 76
-17ce0 20 361 71
-17d0c 5 666 72
-17d11 1 666 72
-17d1f 28 759 72
-17d47 1 759 72
-FUNC 17d48 3c 0 std::vector<unsigned char, std::allocator<unsigned char> >::size() const
-17d48 c 402 76
-17d54 30 403 71
-17d90 d 623 72
-17d9d 5 624 72
-17dae 5 666 72
-17db3 1 666 72
-FUNC 17db4 35 0 bool __gnu_cxx::operator!=<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > > const&, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > > const&)
-17db4 d 699 76
-17dc1 28 700 72
-17de9 1 700 72
-FUNC 17dea 4b 0 void std::_Destroy<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<unsigned char> >(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<unsigned char>)
-17dea c 171 76
-17df6 2 173 73
-17df8 1a 174 73
-17e12 21 173 73
-17e33 2 174 73
-17e35 1 174 73
-17e43 28 759 72
-17e6b 1 759 72
-17e78 2a 662 72
-FUNC 17ea2 13 0 std::vector<unsigned char, std::allocator<unsigned char> >::max_size() const
-17ea2 c 407 76
-17eae 7 408 71
-17eb5 1 408 71
-17ec2 16 650 72
-17ee4 7 98 68
-17eeb 1 98 68
-17ef8 1d 85 68
-17f15 5 86 68
-17f1a 10 88 68
-FUNC 17f2a 29 0 std::_List_base<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_get_node()
-17f2a c 311 76
-17f36 1d 312 66
-17f53 1 312 66
-FUNC 17f54 5f 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_create_node(std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> const&)
-17f54 d 435 76
-17f61 e 437 66
-17f6f 3c 440 66
-17fab 8 447 66
-17fb3 1 447 66
-FUNC 17fb4 35 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_insert(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> const&)
-17fb4 c 1149 76
-17fc0 15 1151 66
-17fd5 14 1152 66
-17fe9 1 1152 66
-FUNC 17fea 52 0 void std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_insert_dispatch<std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, __false_type)
-17fea c 1126 66
-17ff6 2 1128 66
-17ff8 21 1129 66
-18019 21 1128 66
-1803a 2 1129 66
-FUNC 1803c 36 0 void std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::insert<std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, std::_List_const_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >)
-1803c c 838 66
-18048 2a 842 66
-18072 e 491 66
-18080 32 492 66
-180b2 64 493 66
-18116 c 211 74
-18122 3d 211 74
-1815f 1 211 74
-1816d 5c 104 68
-181c9 1 104 68
-FUNC 181ca 31 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::push_back(std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> const&)
-181ca c 772 76
-181d6 25 773 66
-181fb 1 773 66
-FUNC 181fc 69 0 void std::_Construct<dwarf2reader::CompilationUnit::Abbrev, dwarf2reader::CompilationUnit::Abbrev>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev const&)
-181fc d 77 76
-18209 5c 81 73
-18265 1 81 73
-18272 7 98 68
-18279 1 98 68
-18286 1d 85 68
-182a3 5 86 68
-182a8 10 88 68
-182b8 c 65 68
-182c4 2 65 68
-182c6 c 103 69
-182d2 d 103 69
-182df 1 103 69
-FUNC 182e0 4d 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_get_map_allocator() const
-182e0 11 394 76
-182f1 3c 395 62
-1832d 1 395 62
-FUNC 1832e 75 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_allocate_map(unsigned long)
-1832e d 406 76
-1833b 68 407 62
-183a3 1 407 62
-FUNC 183a4 47 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_deallocate_map(unsigned long long**, unsigned long)
-183a4 c 410 76
-183b0 3b 411 62
-183eb 1 411 62
-183ec c 424 62
-183f8 9 426 62
-18401 22 428 62
-18423 2b 430 62
-1844e c 714 62
-1845a 70 715 62
-184ca c 111 75
-184d6 d 111 75
-184e3 1 111 75
-184e4 c 259 67
-184f0 26 259 67
-18522 7 98 68
-18529 1 98 68
-18536 1d 85 68
-18553 5 86 68
-18558 10 88 68
-FUNC 18568 33 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_allocate_node()
-18568 c 398 76
-18574 27 399 62
-1859b 1 399 62
-FUNC 1859c 82 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_create_nodes(unsigned long long**, unsigned long long**)
-1859c d 486 76
-185a9 8 491 62
-185b1 12 492 62
-185c3 13 491 62
-185d6 b 494 62
-185e1 19 496 62
-185fa b 497 62
-18605 13 494 62
-18618 6 497 62
-FUNC 1861e 17b 0 std::_Deque_base<unsigned long long, std::allocator<unsigned long long> >::_M_initialize_map(unsigned long)
-1861e d 447 76
-1862b 1e 450 62
-18649 2a 452 62
-18673 1c 454 62
-1868f 19 462 62
-186a8 c 463 62
-186b4 1e 466 62
-186d2 b 467 62
-186dd 1e 469 62
-186fb 9 470 62
-18704 a 471 62
-1870e b 472 62
-18719 13 467 62
-1872c 15 475 62
-18741 18 476 62
-18759 c 477 62
-18765 34 478 62
-18799 1 478 62
-1879a d 366 62
-187a7 12 367 62
-187b9 39 368 62
-187f2 c 645 62
-187fe 1c 646 62
-FUNC 1881a 4d 0 void std::__fill<true>::fill<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char const&)
-1881a c 539 61
-18826 9 541 61
-1882f 2 542 61
-18831 13 543 61
-18844 21 542 61
-18865 2 543 61
-18867 1 543 61
-FUNC 18868 2b 0 void std::fill<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char const&)
-18868 c 560 76
-18874 4 567 61
-18878 1b 568 61
-18893 1 568 61
-FUNC 18894 6a 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::_M_erase(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >)
-18894 d 1157 76
-188a1 b 1159 66
-188ac 6 1160 66
-188b2 35 1161 66
-188e7 17 1162 66
-FUNC 188fe 37 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::erase(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >)
-188fe c 95 77
-1890a 14 97 77
-1891e 12 98 77
-18930 5 99 77
-18935 1 99 77
-FUNC 18936 3e 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::erase(std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >, std::_List_iterator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> >)
-18936 c 883 77
-18942 2 885 66
-18944 15 886 66
-18959 16 885 66
-1896f 5 887 66
-FUNC 18974 129 0 std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > >::operator=(std::list<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm>, std::allocator<std::pair<dwarf2reader::DwarfAttribute, dwarf2reader::DwarfForm> > > const&)
-18974 e 120 77
-18982 c 122 77
-1898e e 124 77
-1899c e 125 77
-189aa e 126 77
-189b8 e 127 77
-189c6 2 128 77
-189c8 20 130 77
-189e8 5a 128 77
-18a42 16 131 77
-18a58 1b 132 77
-18a73 20 134 77
-18a93 a 136 77
-18a9d 1 136 77
-FUNC 18a9e 4c 0 dwarf2reader::CompilationUnit::Abbrev::operator=(dwarf2reader::CompilationUnit::Abbrev const&)
-18a9e c 211 77
-18aaa 40 211 74
-FUNC 18aea 52 0 dwarf2reader::CompilationUnit::Abbrev* std::__copy<false, std::random_access_iterator_tag>::copy<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*)
-18aea c 280 61
-18af6 1a 283 61
-18b10 12 285 61
-18b22 4 286 61
-18b26 6 287 61
-18b2c b 283 61
-18b37 5 289 61
-FUNC 18b3c 2b 0 dwarf2reader::CompilationUnit::Abbrev* std::__copy_aux<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*)
-18b3c c 307 77
-18b48 4 315 61
-18b4c 1b 317 61
-18b67 1 317 61
-18b76 56 354 61
-18bd8 4 384 61
-18bdc 4 385 61
-18be0 1b 387 61
-18bfb 1 387 61
-FUNC 18bfc ac 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::erase(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >)
-18bfc d 122 78
-18c09 26 124 78
-18c2f 43 125 78
-18c72 2e 126 78
-18ca0 8 127 78
-FUNC 18ca8 54 0 dwarf2reader::CompilationUnit::Abbrev* std::__copy_backward<false, std::random_access_iterator_tag>::copy_b<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*)
-18ca8 c 408 61
-18cb4 1a 411 61
-18cce 1e 412 61
-18cec b 411 61
-18cf7 5 413 61
-FUNC 18cfc 2b 0 dwarf2reader::CompilationUnit::Abbrev* std::__copy_backward_aux<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*)
-18cfc c 432 78
-18d08 4 440 61
-18d0c 1b 443 61
-18d27 1 443 61
-18d36 56 482 61
-18d98 4 514 61
-18d9c 4 515 61
-18da0 1b 517 61
-18dbb 1 517 61
-FUNC 18dbc 4d 0 void std::__fill<false>::fill<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev const&)
-18dbc c 526 61
-18dc8 2 528 61
-18dca 1c 529 61
-18de6 21 528 61
-18e07 2 529 61
-18e09 1 529 61
-FUNC 18e0a 2b 0 void std::fill<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev const&)
-18e0a c 560 78
-18e16 4 567 61
-18e1a 1b 568 61
-18e35 1 568 61
-FUNC 18e36 3f 0 unsigned char* std::__copy<true, std::random_access_iterator_tag>::copy<unsigned char>(unsigned char const*, unsigned char const*, unsigned char*)
-18e36 c 298 61
-18e42 22 300 61
-18e64 11 301 61
-18e75 1 301 61
-FUNC 18e76 2b 0 unsigned char* std::__copy_aux<unsigned char*, unsigned char*>(unsigned char*, unsigned char*, unsigned char*)
-18e76 c 307 78
-18e82 4 315 61
-18e86 1b 317 61
-18ea1 1 317 61
-18eb0 56 354 61
-18f12 4 384 61
-18f16 4 385 61
-18f1a 1b 387 61
-18f35 1 387 61
-FUNC 18f36 a0 0 std::vector<unsigned char, std::allocator<unsigned char> >::erase(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >)
-18f36 d 122 78
-18f43 26 124 78
-18f69 43 125 78
-18fac 22 126 78
-18fce 8 127 78
-18fe2 7 98 68
-18fe9 1 98 68
-18ff6 1d 85 68
-19013 5 86 68
-19018 d 88 68
-19025 1 88 68
-FUNC 19026 2a 0 std::_Vector_base<unsigned char, std::allocator<unsigned char> >::_M_allocate(unsigned long)
-19026 c 116 78
-19032 1e 117 71
-1905c 1b 74 79
-19077 1 74 79
-19084 23 113 79
-190a7 1 113 79
-190b4 1b 254 79
-190cf 1 254 79
-FUNC 190d0 19 0 void std::_Destroy<dwarf2reader::CompilationUnit::Abbrev>(dwarf2reader::CompilationUnit::Abbrev*)
-190d0 c 106 79
-190dc d 107 73
-190e9 1 107 73
-FUNC 190ea 44 0 void std::__destroy_aux<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > > >(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __false_type)
-190ea c 119 79
-190f6 2 121 73
-190f8 13 122 73
-1910b 21 121 73
-1912c 2 122 73
-FUNC 1912e 28 0 void std::_Destroy<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > > >(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >)
-1912e c 148 79
-1913a 1c 155 73
-FUNC 19156 8d 0 void std::__uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&, __false_type)
-19156 d 188 79
-19163 6 190 79
-19169 2 193 79
-1916b 1c 194 79
-19187 1b 193 79
-191a2 b 196 79
-191ad 12 198 79
-191bf b 199 79
-191ca 13 196 79
-191dd 6 199 79
-191e3 1 199 79
-FUNC 191e4 2f 0 void std::uninitialized_fill_n<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&)
-191e4 c 214 79
-191f0 23 218 79
-19213 1 218 79
-FUNC 19214 27 0 void std::__uninitialized_fill_n_a<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev, dwarf2reader::CompilationUnit::Abbrev>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&, std::allocator<dwarf2reader::CompilationUnit::Abbrev>)
-19214 c 308 79
-19220 1b 310 79
-1923b 1 310 79
-19249 6 82 79
-1924f 2 85 79
-19251 24 86 79
-19275 2c 85 79
-192a1 b 87 79
-192ac b 89 79
-192b7 12 91 79
-192c9 b 92 79
-192d4 13 89 79
-192e7 9 92 79
-192fc 23 113 79
-1931f 1 113 79
-1932c 1b 254 79
-19347 1 254 79
-FUNC 19348 409 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::_M_insert_aux(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev const&)
-19348 14 249 79
-1935c 14 251 78
-19370 22 253 78
-19392 f 255 78
-193a1 12 256 78
-193b3 55 257 78
-19408 4b 260 78
-19453 e 264 78
-19461 15 265 78
-19476 e 266 78
-19484 1d 271 78
-194a1 8 272 78
-194a9 e 273 78
-194b7 27 275 78
-194de 6 276 78
-194e4 55 279 78
-19539 25 284 78
-1955e b 285 78
-19569 4f 286 78
-195b8 3 284 78
-195bb 13 279 78
-195ce e 286 78
-195dc 4d 298 78
-19629 36 299 78
-1965f 12 302 78
-19671 13 303 78
-19684 2e 304 78
-196b2 13 286 78
-196c5 b 292 78
-196d0 39 294 78
-19709 23 295 78
-1972c b 296 78
-19737 13 292 78
-1974a 7 304 78
-19751 1 304 78
-FUNC 19752 70 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::push_back(dwarf2reader::CompilationUnit::Abbrev const&)
-19752 c 602 79
-1975e 10 604 71
-1976e 1e 606 71
-1978c 11 607 71
-1979d 25 610 71
-FUNC 197c2 50 0 unsigned char* std::__copy_backward<true, std::random_access_iterator_tag>::copy_b<unsigned char>(unsigned char const*, unsigned char const*, unsigned char*)
-197c2 d 422 61
-197cf f 424 61
-197de 24 425 61
-19802 10 426 61
-FUNC 19812 2b 0 unsigned char* std::__copy_backward_aux<unsigned char*, unsigned char*>(unsigned char*, unsigned char*, unsigned char*)
-19812 c 432 79
-1981e 4 440 61
-19822 1b 443 61
-1983d 1 443 61
-1984c 56 482 61
-198ae 4 514 61
-198b2 4 515 61
-198b6 1b 517 61
-198d1 1 517 61
-FUNC 198d2 32 0 unsigned char* std::fill_n<unsigned long>(unsigned char*, unsigned long, unsigned char const&)
-198d2 c 647 79
-198de 1e 649 61
-198fc 8 650 61
-FUNC 19904 27 0 void std::__uninitialized_fill_n_aux<unsigned char*, unsigned long, unsigned char>(unsigned char*, unsigned long, unsigned char const&, __true_type)
-19904 c 182 79
-19910 1b 183 79
-1992b 1 183 79
-FUNC 1992c 2f 0 void std::uninitialized_fill_n<unsigned char*, unsigned long, unsigned char>(unsigned char*, unsigned long, unsigned char const&)
-1992c c 214 79
-19938 23 218 79
-1995b 1 218 79
-FUNC 1995c 27 0 void std::__uninitialized_fill_n_a<unsigned char*, unsigned long, unsigned char, unsigned char>(unsigned char*, unsigned long, unsigned char const&, std::allocator<unsigned char>)
-1995c c 308 79
-19968 1b 310 79
-19983 1 310 79
-FUNC 19984 27 0 void std::__destroy_aux<dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, __false_type)
-19984 c 119 79
-19990 2 121 73
-19992 b 122 73
-1999d c 121 73
-199a9 2 122 73
-199ab 1 122 73
-FUNC 199ac 28 0 void std::_Destroy<dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*)
-199ac c 148 79
-199b8 1c 155 73
-FUNC 199d4 88 0 dwarf2reader::CompilationUnit::Abbrev* std::__uninitialized_copy_aux<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, __false_type)
-199d4 d 80 79
-199e1 6 82 79
-199e7 2 85 79
-199e9 12 86 79
-199fb 12 85 79
-19a0d b 87 79
-19a18 b 89 79
-19a23 12 91 79
-19a35 b 92 79
-19a40 13 89 79
-19a53 9 92 79
-FUNC 19a5c 2f 0 dwarf2reader::CompilationUnit::Abbrev* std::uninitialized_copy<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*)
-19a5c c 108 79
-19a68 23 113 79
-19a8b 1 113 79
-FUNC 19a8c 27 0 dwarf2reader::CompilationUnit::Abbrev* std::__uninitialized_copy_a<dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev>(dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev*, std::allocator<dwarf2reader::CompilationUnit::Abbrev>)
-19a8c c 252 79
-19a98 1b 254 79
-19ab3 1 254 79
-FUNC 19ab4 7e 0 void std::__uninitialized_fill_n_aux<dwarf2reader::CompilationUnit::Abbrev*, unsigned long, dwarf2reader::CompilationUnit::Abbrev>(dwarf2reader::CompilationUnit::Abbrev*, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&, __false_type)
-19ab4 d 188 79
-19ac1 6 190 79
-19ac7 2 193 79
-19ac9 12 194 79
-19adb 16 193 79
-19af1 b 196 79
-19afc 12 198 79
-19b0e b 199 79
-19b19 13 196 79
-19b2c 6 199 79
-FUNC 19b32 2f 0 void std::uninitialized_fill_n<dwarf2reader::CompilationUnit::Abbrev*, unsigned long, dwarf2reader::CompilationUnit::Abbrev>(dwarf2reader::CompilationUnit::Abbrev*, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&)
-19b32 c 214 79
-19b3e 23 218 79
-19b61 1 218 79
-FUNC 19b62 27 0 void std::__uninitialized_fill_n_a<dwarf2reader::CompilationUnit::Abbrev*, unsigned long, dwarf2reader::CompilationUnit::Abbrev, dwarf2reader::CompilationUnit::Abbrev>(dwarf2reader::CompilationUnit::Abbrev*, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&, std::allocator<dwarf2reader::CompilationUnit::Abbrev>)
-19b62 c 308 79
-19b6e 1b 310 79
-19b89 1 310 79
-FUNC 19b8a a5 0 dwarf2reader::CompilationUnit::Abbrev* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev*>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev*, __false_type)
-19b8a d 80 79
-19b97 6 82 79
-19b9d 2 85 79
-19b9f 1a 86 79
-19bb9 27 85 79
-19be0 b 87 79
-19beb b 89 79
-19bf6 12 91 79
-19c08 b 92 79
-19c13 13 89 79
-19c26 9 92 79
-19c2f 1 92 79
-FUNC 19c30 2f 0 dwarf2reader::CompilationUnit::Abbrev* std::uninitialized_copy<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev*>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev*)
-19c30 c 108 79
-19c3c 23 113 79
-19c5f 1 113 79
-FUNC 19c60 27 0 dwarf2reader::CompilationUnit::Abbrev* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev*, dwarf2reader::CompilationUnit::Abbrev>(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, __gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, dwarf2reader::CompilationUnit::Abbrev*, std::allocator<dwarf2reader::CompilationUnit::Abbrev>)
-19c60 c 252 79
-19c6c 1b 254 79
-19c87 1 254 79
-FUNC 19c88 5f8 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::_M_fill_insert(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&)
-19c88 15 311 79
-19c9d b 313 78
-19ca8 2a 315 78
-19cd2 12 318 78
-19ce4 23 319 78
-19d07 15 320 78
-19d1c c 321 78
-19d28 5a 323 78
-19d82 1c 327 78
-19d9e 35 328 78
-19dd3 16 323 78
-19de9 30 330 78
-19e19 10 343 78
-19e29 48 334 78
-19e71 21 338 78
-19e92 3d 339 78
-19ecf 13 334 78
-19ee2 b 339 78
-19eed 1c 342 78
-19f09 1e 343 78
-19f27 13 339 78
-19f3a 24 343 78
-19f5e e 348 78
-19f6c 1e 349 78
-19f8a e 350 78
-19f98 1d 353 78
-19fb5 8 354 78
-19fbd e 355 78
-19fcb 27 357 78
-19ff2 6 358 78
-19ff8 4d 361 78
-1a045 40 365 78
-1a085 18 367 78
-1a09d 44 368 78
-1a0e1 3 365 78
-1a0e4 19 361 78
-1a0fd 13 365 78
-1a110 e 368 78
-1a11e 3e 379 78
-1a15c 36 381 78
-1a192 12 384 78
-1a1a4 13 385 78
-1a1b7 2e 386 78
-1a1e5 e 368 78
-1a1f3 b 372 78
-1a1fe 39 374 78
-1a237 23 376 78
-1a25a b 377 78
-1a265 13 372 78
-1a278 8 386 78
-FUNC 1a280 2e 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::insert(__gnu_cxx::__normal_iterator<dwarf2reader::CompilationUnit::Abbrev*, std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> > >, unsigned long, dwarf2reader::CompilationUnit::Abbrev const&)
-1a280 c 657 79
-1a28c 22 658 71
-FUNC 1a2ae ab 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::resize(unsigned long, dwarf2reader::CompilationUnit::Abbrev const&)
-1a2ae d 422 79
-1a2bb 15 424 71
-1a2d0 48 425 71
-1a318 41 427 71
-1a359 1 427 71
-FUNC 1a35a 63 0 std::vector<dwarf2reader::CompilationUnit::Abbrev, std::allocator<dwarf2reader::CompilationUnit::Abbrev> >::resize(unsigned long)
-1a35a d 441 79
-1a367 56 442 71
-1a3bd 1 442 71
-FUNC 1a3be 13 0 std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>::operator*() const
-1a3be c 134 79
-1a3ca 7 135 62
-1a3d1 1 135 62
-FUNC 1a3d2 3f 0 unsigned long long** std::__copy<true, std::random_access_iterator_tag>::copy<unsigned long long*>(unsigned long long* const*, unsigned long long* const*, unsigned long long**)
-1a3d2 c 298 61
-1a3de 22 300 61
-1a400 11 301 61
-1a411 1 301 61
-FUNC 1a412 2b 0 unsigned long long** std::__copy_aux<unsigned long long**, unsigned long long**>(unsigned long long**, unsigned long long**, unsigned long long**)
-1a412 c 307 79
-1a41e 4 315 61
-1a422 1b 317 61
-1a43d 1 317 61
-FUNC 1a43e 27 0 unsigned long long** std::__copy_normal<false, false>::copy_n<unsigned long long**, unsigned long long**>(unsigned long long**, unsigned long long**, unsigned long long**)
-1a43e c 325 61
-1a44a 1b 326 61
-1a465 1 326 61
-FUNC 1a466 2f 0 unsigned long long** std::copy<unsigned long long**, unsigned long long**>(unsigned long long**, unsigned long long**, unsigned long long**)
-1a466 c 376 79
-1a472 4 384 61
-1a476 4 385 61
-1a47a 1b 387 61
-1a495 1 387 61
-FUNC 1a496 60 0 unsigned long long** std::__copy_backward<true, std::random_access_iterator_tag>::copy_b<unsigned long long*>(unsigned long long* const*, unsigned long long* const*, unsigned long long**)
-1a496 d 422 61
-1a4a3 12 424 61
-1a4b5 2e 425 61
-1a4e3 13 426 61
-FUNC 1a4f6 2b 0 unsigned long long** std::__copy_backward_aux<unsigned long long**, unsigned long long**>(unsigned long long**, unsigned long long**, unsigned long long**)
-1a4f6 c 432 79
-1a502 4 440 61
-1a506 1b 443 61
-1a521 1 443 61
-FUNC 1a522 27 0 unsigned long long** std::__copy_backward_normal<false, false>::copy_b_n<unsigned long long**, unsigned long long**>(unsigned long long**, unsigned long long**, unsigned long long**)
-1a522 c 451 61
-1a52e 1b 452 61
-1a549 1 452 61
-FUNC 1a54a 2f 0 unsigned long long** std::copy_backward<unsigned long long**, unsigned long long**>(unsigned long long**, unsigned long long**, unsigned long long**)
-1a54a c 504 79
-1a556 4 514 61
-1a55a 4 515 61
-1a55e 1b 517 61
-1a579 1 517 61
-FUNC 1a57a 1df 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::_M_reallocate_map(unsigned long, bool)
-1a57a 13 723 79
-1a58d 1b 726 76
-1a5a8 9 727 76
-1a5b1 13 730 76
-1a5c4 39 732 76
-1a5fd b 735 76
-1a608 27 736 76
-1a62f 2f 740 76
-1a65e 26 748 76
-1a684 15 750 76
-1a699 36 751 76
-1a6cf 22 753 76
-1a6f1 1e 756 76
-1a70f 8 758 76
-1a717 9 759 76
-1a720 15 762 76
-1a735 24 763 76
-1a759 1 763 76
-FUNC 1a75a 59 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::_M_reserve_map_at_back(unsigned long)
-1a75a e 1443 79
-1a768 2a 1445 62
-1a792 21 1447 62
-1a7b3 1 1447 62
-FUNC 1a7b4 8c 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::_M_push_back_aux(unsigned long long const&)
-1a7b4 c 345 79
-1a7c0 e 347 76
-1a7ce 13 348 76
-1a7e1 18 349 76
-1a7f9 1e 352 76
-1a817 1b 353 76
-1a832 c 355 76
-1a83e 2 360 76
-FUNC 1a840 62 0 std::deque<unsigned long long, std::allocator<unsigned long long> >::push_back(unsigned long long const&)
-1a840 c 1039 79
-1a84c 13 1041 62
-1a85f 1e 1044 62
-1a87d 11 1045 62
-1a88e 14 1048 62
-FUNC 1a8a2 20 0 std::stack<unsigned long long, std::deque<unsigned long long, std::allocator<unsigned long long> > >::push(unsigned long long const&)
-1a8a2 c 190 79
-1a8ae 14 191 75
-FUNC 1a8c2 27 0 unsigned char* std::__copy_normal<false, false>::copy_n<unsigned char*, unsigned char*>(unsigned char*, unsigned char*, unsigned char*)
-1a8c2 c 325 61
-1a8ce 1b 326 61
-1a8e9 1 326 61
-FUNC 1a8ea 2f 0 unsigned char* std::copy<unsigned char*, unsigned char*>(unsigned char*, unsigned char*, unsigned char*)
-1a8ea c 376 79
-1a8f6 4 384 61
-1a8fa 4 385 61
-1a8fe 1b 387 61
-1a919 1 387 61
-FUNC 1a91a 27 0 unsigned char* std::__uninitialized_copy_aux<unsigned char*, unsigned char*>(unsigned char*, unsigned char*, unsigned char*, __true_type)
-1a91a c 73 79
-1a926 1b 74 79
-1a941 1 74 79
-FUNC 1a942 2f 0 unsigned char* std::uninitialized_copy<unsigned char*, unsigned char*>(unsigned char*, unsigned char*, unsigned char*)
-1a942 c 108 79
-1a94e 23 113 79
-1a971 1 113 79
-FUNC 1a972 27 0 unsigned char* std::__uninitialized_copy_a<unsigned char*, unsigned char*, unsigned char>(unsigned char*, unsigned char*, unsigned char*, std::allocator<unsigned char>)
-1a972 c 252 79
-1a97e 1b 254 79
-1a999 1 254 79
-FUNC 1a99a 40 0 unsigned char* std::__copy_normal<true, false>::copy_n<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*)
-1a99a d 334 61
-1a9a7 33 335 61
-FUNC 1a9da 2f 0 unsigned char* std::copy<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*)
-1a9da c 376 79
-1a9e6 4 384 61
-1a9ea 4 385 61
-1a9ee 1b 387 61
-1aa09 1 387 61
-FUNC 1aa0a 27 0 unsigned char* std::__uninitialized_copy_aux<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*, __true_type)
-1aa0a c 73 79
-1aa16 1b 74 79
-1aa31 1 74 79
-FUNC 1aa32 2f 0 unsigned char* std::uninitialized_copy<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*)
-1aa32 c 108 79
-1aa3e 23 113 79
-1aa61 1 113 79
-FUNC 1aa62 27 0 unsigned char* std::__uninitialized_copy_a<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*, unsigned char>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, __gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned char*, std::allocator<unsigned char>)
-1aa62 c 252 79
-1aa6e 1b 254 79
-1aa89 1 254 79
-1aa96 9 616 61
-1aa9f 2 617 61
-1aaa1 13 618 61
-1aab4 16 617 61
-1aaca 5 619 61
-1aacf 1 619 61
-1aadc 4 641 61
-1aae0 1b 642 61
-1aafb 1 642 61
-FUNC 1aafc 27 0 void std::__uninitialized_fill_n_aux<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&, __true_type)
-1aafc c 182 79
-1ab08 1b 183 79
-1ab23 1 183 79
-FUNC 1ab24 2f 0 void std::uninitialized_fill_n<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&)
-1ab24 c 214 79
-1ab30 23 218 79
-1ab53 1 218 79
-FUNC 1ab54 27 0 void std::__uninitialized_fill_n_a<__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char, unsigned char>(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&, std::allocator<unsigned char>)
-1ab54 c 308 79
-1ab60 1b 310 79
-1ab7b 1 310 79
-FUNC 1ab7c 45a 0 std::vector<unsigned char, std::allocator<unsigned char> >::_M_fill_insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&)
-1ab7c 14 311 79
-1ab90 b 313 78
-1ab9b 21 315 78
-1abbc 9 318 78
-1abc5 23 319 78
-1abe8 15 320 78
-1abfd c 321 78
-1ac09 4e 323 78
-1ac57 11 327 78
-1ac68 30 328 78
-1ac98 35 330 78
-1accd 48 334 78
-1ad15 14 338 78
-1ad29 43 339 78
-1ad6c 11 342 78
-1ad7d 1e 343 78
-1ad9b e 348 78
-1ada9 1e 349 78
-1adc7 e 350 78
-1add5 1d 353 78
-1adf2 8 354 78
-1adfa e 355 78
-1ae08 27 357 78
-1ae2f 6 358 78
-1ae35 4d 361 78
-1ae82 40 365 78
-1aec2 18 367 78
-1aeda 4d 368 78
-1af27 3e 379 78
-1af65 2d 381 78
-1af92 12 384 78
-1afa4 13 385 78
-1afb7 1f 386 78
-FUNC 1afd6 2e 0 std::vector<unsigned char, std::allocator<unsigned char> >::insert(__gnu_cxx::__normal_iterator<unsigned char*, std::vector<unsigned char, std::allocator<unsigned char> > >, unsigned long, unsigned char const&)
-1afd6 c 657 79
-1afe2 22 658 71
-FUNC 1b004 ab 0 std::vector<unsigned char, std::allocator<unsigned char> >::resize(unsigned long, unsigned char const&)
-1b004 d 422 79
-1b011 15 424 71
-1b026 48 425 71
-1b06e 41 427 71
-1b0af 1 427 71
-FUNC 1b0b0 2b 0 std::vector<unsigned char, std::allocator<unsigned char> >::resize(unsigned long)
-1b0b0 c 441 79
-1b0bc 1f 442 71
-1b0db 1 442 71
-FUNC 1b0dc 1a 0 std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>::_S_buffer_size()
-1b0dc c 106 79
-1b0e8 e 107 62
-FUNC 1b0f6 66 0 std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>::difference_type std::operator-<unsigned long long, unsigned long long const&, unsigned long long const*, unsigned long long const&, unsigned long long const*>(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*> const&, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*> const&)
-1b0f6 d 328 79
-1b103 59 333 62
-FUNC 1b15c 3e 0 std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>::_M_set_node(unsigned long long**)
-1b15c d 229 79
-1b169 9 231 62
-1b172 b 232 62
-1b17d 1d 233 62
-FUNC 1b19a 50 0 std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>::operator++()
-1b19a c 142 79
-1b1a6 d 144 62
-1b1b3 f 145 62
-1b1c2 18 147 62
-1b1da b 148 62
-1b1e5 5 150 62
-FUNC 1b1ea 84 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::__copy<false, std::random_access_iterator_tag>::copy<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> >(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>)
-1b1ea e 280 61
-1b1f8 17 283 61
-1b20f 20 285 61
-1b22f b 286 61
-1b23a b 287 61
-1b245 b 283 61
-1b250 1e 289 61
-FUNC 1b26e 7e 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::__copy_aux<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> >(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>)
-1b26e 11 307 79
-1b27f 4 315 61
-1b283 69 317 61
-FUNC 1b2ec 7a 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::__copy_normal<false, false>::copy_n<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> >(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>)
-1b2ec 11 325 61
-1b2fd 69 326 61
-FUNC 1b366 82 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::copy<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> >(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>)
-1b366 11 376 79
-1b377 4 384 61
-1b37b 4 385 61
-1b37f 69 387 61
-FUNC 1b3e8 7a 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::__uninitialized_copy_aux<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> >(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>, __true_type)
-1b3e8 11 73 79
-1b3f9 69 74 79
-FUNC 1b462 82 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::uninitialized_copy<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> >(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>)
-1b462 11 108 79
-1b473 71 113 79
-FUNC 1b4e4 7a 0 std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*> std::__uninitialized_copy_a<std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>, unsigned long long>(std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long const&, unsigned long long const*>, std::_Deque_iterator<unsigned long long, unsigned long long&, unsigned long long*>, std::allocator<unsigned long long>)
-1b4e4 11 252 79
-1b4f5 69 254 79
-1b55e 10 679 62
-1b56e 64 680 62
-1b5d2 e8 681 62
-1b6ba c 143 75
-1b6c6 14 144 75
-1b6da 6 144 75
-FUNC 1b6e0 4d 0 __eprintf
-1b6e0 6 1826 80
-1b6e6 3 1832 80
-1b6e9 c 1826 80
-1b6f5 29 1832 80
-1b71e a 1837 80
-1b728 5 1838 80
-1b72d e8d3 1838 80
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/ucontext_compat.h b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/ucontext_compat.h
deleted file mode 100644
index 1e4b752e51..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/ucontext_compat.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_
-#define CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_
-
-#include <sys/ucontext.h>
-
-// The purpose of this file is to work around the fact that ucontext_t's
-// uc_mcontext member is an mcontext_t rather than an mcontext64_t on ARM64.
-#if defined(__aarch64__)
-// <sys/ucontext.h> doesn't include the below file.
-#include <sys/_types/_ucontext64.h>
-typedef ucontext64_t breakpad_ucontext_t;
-#define breakpad_uc_mcontext uc_mcontext64
-#else
-typedef ucontext_t breakpad_ucontext_t;
-#define breakpad_uc_mcontext uc_mcontext
-#endif // defined(__aarch64__)
-
-#endif // CLIENT_MAC_HANDLER_UCONTEXT_COMPAT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/Breakpad.xib b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/Breakpad.xib
deleted file mode 100644
index 7966f895c5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/Breakpad.xib
+++ /dev/null
@@ -1,1140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
- <data>
- <int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">10F569</string>
- <string key="IBDocument.InterfaceBuilderVersion">762</string>
- <string key="IBDocument.AppKitVersion">1038.29</string>
- <string key="IBDocument.HIToolboxVersion">461.00</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys" id="0">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <reference key="IBDocument.PluginDependencies" ref="0"/>
- <object class="NSMutableDictionary" key="IBDocument.Metadata">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <object class="NSMutableArray" key="IBDocument.RootObjects" id="504246249">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSCustomObject" id="273934324">
- <string key="NSClassName">Reporter</string>
- </object>
- <object class="NSCustomObject" id="388635980">
- <string key="NSClassName">FirstResponder</string>
- </object>
- <object class="NSCustomObject" id="220995958">
- <string key="NSClassName">NSApplication</string>
- </object>
- <object class="NSWindowTemplate" id="762998835">
- <int key="NSWindowStyleMask">1</int>
- <int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{72, 251}, {490, 489}}</string>
- <int key="NSWTFlags">536871936</int>
- <string key="NSWindowTitle"/>
- <string key="NSWindowClass">NSWindow</string>
- <nil key="NSViewClass"/>
- <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
- <string key="NSWindowContentMinSize">{72, 5}</string>
- <object class="NSView" key="NSWindowView" id="197525436">
- <nil key="NSNextResponder"/>
- <int key="NSvFlags">264</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSBox" id="469837363">
- <reference key="NSNextResponder" ref="197525436"/>
- <int key="NSvFlags">272</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSView" id="966817352">
- <reference key="NSNextResponder" ref="469837363"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="997378142">
- <reference key="NSNextResponder" ref="966817352"/>
- <int key="NSvFlags">290</int>
- <string key="NSFrame">{{17, 36}, {456, 70}}</string>
- <reference key="NSSuperview" ref="966817352"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="509794736">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">272760832</int>
- <string key="NSContents">Providing your email address is optional and will allow us contact you in case we need more details. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed arcu urna, pulvinar sit amet, tincidunt ac, fermentum ut, ligula. Quisque mi. Duis lectus. Vestibulum velit. Morbi turpis. Nunc at diam consectetur turpis volutpat tristique. Donec quis diam. Suspendisse scelerisque.</string>
- <object class="NSFont" key="NSSupport" id="26">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">11</double>
- <int key="NSfFlags">3100</int>
- </object>
- <reference key="NSControlView" ref="997378142"/>
- <object class="NSColor" key="NSBackgroundColor" id="420457920">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
- </object>
- </object>
- <object class="NSColor" key="NSTextColor" id="800255527">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlTextColor</string>
- <object class="NSColor" key="NSColor" id="908763363">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MAA</bytes>
- </object>
- </object>
- </object>
- </object>
- <object class="NSTextField" id="975305147">
- <reference key="NSNextResponder" ref="966817352"/>
- <int key="NSvFlags">290</int>
- <string key="NSFrame">{{87, 9}, {195, 19}}</string>
- <reference key="NSSuperview" ref="966817352"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="592393645">
- <int key="NSCellFlags">-1804468671</int>
- <int key="NSCellFlags2">272761856</int>
- <string key="NSContents"/>
- <reference key="NSSupport" ref="26"/>
- <string key="NSPlaceholderString">optional</string>
- <reference key="NSControlView" ref="975305147"/>
- <bool key="NSDrawsBackground">YES</bool>
- <object class="NSColor" key="NSBackgroundColor" id="128478752">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">textBackgroundColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
- </object>
- </object>
- <object class="NSColor" key="NSTextColor" id="734930533">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">textColor</string>
- <reference key="NSColor" ref="908763363"/>
- </object>
- </object>
- </object>
- <object class="NSTextField" id="268211031">
- <reference key="NSNextResponder" ref="966817352"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{17, 11}, {65, 14}}</string>
- <reference key="NSSuperview" ref="966817352"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="461570326">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
- <string key="NSContents">EmailLabel:</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="268211031"/>
- <reference key="NSBackgroundColor" ref="420457920"/>
- <reference key="NSTextColor" ref="800255527"/>
- </object>
- </object>
- <object class="NSButton" id="538303250">
- <reference key="NSNextResponder" ref="966817352"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{456, 10}, {16, 17}}</string>
- <reference key="NSSuperview" ref="966817352"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="778004767">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Privacy Policy</string>
- <object class="NSFont" key="NSSupport" id="222882491">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">13</double>
- <int key="NSfFlags">1044</int>
- </object>
- <reference key="NSControlView" ref="538303250"/>
- <int key="NSButtonFlags">-2040250113</int>
- <int key="NSButtonFlags2">36</int>
- <object class="NSCustomResource" key="NSNormalImage">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">goArrow</string>
- </object>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- </object>
- <object class="NSTextField" id="655227981">
- <reference key="NSNextResponder" ref="966817352"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{355, 11}, {100, 14}}</string>
- <reference key="NSSuperview" ref="966817352"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="1012850565">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">4326400</int>
- <string key="NSContents">PrivacyPolicyLabel</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="655227981"/>
- <reference key="NSBackgroundColor" ref="420457920"/>
- <reference key="NSTextColor" ref="800255527"/>
- </object>
- </object>
- </object>
- <string key="NSFrameSize">{490, 114}</string>
- <reference key="NSSuperview" ref="469837363"/>
- </object>
- </object>
- <string key="NSFrame">{{0, 51}, {490, 114}}</string>
- <reference key="NSSuperview" ref="197525436"/>
- <string key="NSOffsets">{0, 0}</string>
- <object class="NSTextFieldCell" key="NSTitleCell">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Title</string>
- <object class="NSFont" key="NSSupport" id="668643277">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">11</double>
- <int key="NSfFlags">16</int>
- </object>
- <reference key="NSBackgroundColor" ref="128478752"/>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
- </object>
- </object>
- <reference key="NSContentView" ref="966817352"/>
- <int key="NSBorderType">0</int>
- <int key="NSBoxType">3</int>
- <int key="NSTitlePosition">0</int>
- <bool key="NSTransparent">NO</bool>
- </object>
- <object class="NSButton" id="219938755">
- <reference key="NSNextResponder" ref="197525436"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{330, 12}, {146, 32}}</string>
- <reference key="NSSuperview" ref="197525436"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="733475259">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">SendReportLabel</string>
- <reference key="NSSupport" ref="222882491"/>
- <reference key="NSControlView" ref="219938755"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">129</int>
- <reference key="NSAlternateImage" ref="222882491"/>
- <string key="NSAlternateContents"/>
- <string type="base64-UTF8" key="NSKeyEquivalent">DQ</string>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="409721323">
- <reference key="NSNextResponder" ref="197525436"/>
- <int key="NSvFlags">289</int>
- <string key="NSFrame">{{214, 12}, {116, 32}}</string>
- <reference key="NSSuperview" ref="197525436"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="586160416">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">CancelLabel</string>
- <reference key="NSSupport" ref="222882491"/>
- <reference key="NSControlView" ref="409721323"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">129</int>
- <reference key="NSAlternateImage" ref="222882491"/>
- <string key="NSAlternateContents"/>
- <string type="base64-UTF8" key="NSKeyEquivalent">Gw</string>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSBox" id="468151514">
- <reference key="NSNextResponder" ref="197525436"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSView" id="1059038623">
- <reference key="NSNextResponder" ref="468151514"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="375247105">
- <reference key="NSNextResponder" ref="1059038623"/>
- <int key="NSvFlags">266</int>
- <string key="NSFrame">{{17, 83}, {456, 154}}</string>
- <reference key="NSSuperview" ref="1059038623"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="188082030">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">272760832</int>
- <string type="base64-UTF8" key="NSContents">VGhlIHN5c3RlbSBhbmQgb3RoZXIgYXBwbGljYXRpb25zIGhhdmUgbm90IGJlZW4gYWZmZWN0ZWQuIEEg
-cmVwb3J0IGhhcyBiZWVuIGNyZWF0ZWQgdGhhdCB5b3UgY2FuIHNlbmQgdG8gPFJlYWxseSBMb25nIENv
-bXBhbnkgTmFtZT4gdG8gaGVscCBpZGVudGlmeSB0aGUgcHJvYmxlbS4gTG9yZW0gaXBzdW0gZG9sb3Ig
-c2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2NpbmcgZWxpdC4gU2VkIGFyY3UgdXJuYSwgcHVsdmlu
-YXIgc2l0IGFtZXQsIHRpbmNpZHVudCBhYywgZmVybWVudHVtIHV0LCBsaWd1bGEuIFF1aXNxdWUgbWku
-IER1aXMgbGVjdHVzLiBWZXN0aWJ1bHVtIHZlbGl0LiBNb3JiaSB0dXJwaXMuIE51bmMgYXQgZGlhbSBj
-b25zZWN0ZXR1ciB0dXJwaXMgdm9sdXRwYXQgdHJpc3RpcXVlLiBEb25lYyBxdWlzIGRpYW0uIFN1c3Bl
-bmRpc3NlIHNjZWxlcmlzcXVlLiBRdWlzcXVlIHB1bHZpbmFyIG1pIGlkIHB1cnVzLiBFdGlhbSB2aXRh
-ZSB0dXJwaXMgdml0YWUgbmVxdWUgcG9ydGEgY29uZ3VlLgoKUGxlYXNlIGhlbHAgdXMgZml4IHRoZSBw
-cm9ibGVtIGJ5IGRlc2NyaWJpbmcgd2hhdCBoYXBwZW5lZCBiZWZvcmUgdGhlIGNyYXNoLiBMb3JlbSBp
-cHN1bSBkb2xvciBzaXQgYW1ldCwgY29uc2VjdGV0dXIgYWRpcGlzY2luZyBlbGl0LiBTZWQgYXJjdSB1
-cm5hLCBwdWx2aW5hciBzaXQgYW1ldCwgdGluY2lkdW50IGFjLCBmZXJtZW50dW0gdXQsIGxpZ3VsYS4g
-UXVpc3F1ZSBtaS4gRHVpcyBsZWN0dXMuA</string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="375247105"/>
- <reference key="NSBackgroundColor" ref="420457920"/>
- <reference key="NSTextColor" ref="800255527"/>
- </object>
- </object>
- <object class="NSTextField" id="996404163">
- <reference key="NSNextResponder" ref="1059038623"/>
- <int key="NSvFlags">274</int>
- <string key="NSFrame">{{20, 14}, {450, 61}}</string>
- <reference key="NSSuperview" ref="1059038623"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="242564194">
- <int key="NSCellFlags">341966337</int>
- <int key="NSCellFlags2">272760832</int>
- <string key="NSContents">Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 1 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 2 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 3 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 Line 4 </string>
- <reference key="NSSupport" ref="26"/>
- <reference key="NSControlView" ref="996404163"/>
- <bool key="NSDrawsBackground">YES</bool>
- <reference key="NSBackgroundColor" ref="128478752"/>
- <reference key="NSTextColor" ref="734930533"/>
- </object>
- </object>
- <object class="NSBox" id="667608859">
- <reference key="NSNextResponder" ref="1059038623"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSView" id="971021844">
- <reference key="NSNextResponder" ref="667608859"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="1032334641">
- <reference key="NSNextResponder" ref="971021844"/>
- <int key="NSvFlags">266</int>
- <string key="NSFrame">{{85, 10}, {381, 54}}</string>
- <reference key="NSSuperview" ref="971021844"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="316557784">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">272629760</int>
- <string key="NSContents">The application &lt;Really Long App Name Here&gt; has quit unexpectedly.</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande-Bold</string>
- <double key="NSSize">14</double>
- <int key="NSfFlags">16</int>
- </object>
- <reference key="NSControlView" ref="1032334641"/>
- <reference key="NSBackgroundColor" ref="420457920"/>
- <reference key="NSTextColor" ref="800255527"/>
- </object>
- </object>
- <object class="NSImageView" id="594334723">
- <reference key="NSNextResponder" ref="971021844"/>
- <int key="NSvFlags">268</int>
- <object class="NSMutableSet" key="NSDragTypes">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="set.sortedObjects">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>Apple PDF pasteboard type</string>
- <string>Apple PICT pasteboard type</string>
- <string>Apple PNG pasteboard type</string>
- <string>NSFilenamesPboardType</string>
- <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
- <string>NeXT TIFF v4.0 pasteboard type</string>
- </object>
- </object>
- <string key="NSFrame">{{16, 0}, {64, 64}}</string>
- <reference key="NSSuperview" ref="971021844"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSImageCell" key="NSCell" id="465445685">
- <int key="NSCellFlags">130560</int>
- <int key="NSCellFlags2">33554432</int>
- <object class="NSCustomResource" key="NSContents">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSApplicationIcon</string>
- </object>
- <int key="NSAlign">0</int>
- <int key="NSScale">0</int>
- <int key="NSStyle">0</int>
- <bool key="NSAnimates">NO</bool>
- </object>
- <bool key="NSEditable">YES</bool>
- </object>
- </object>
- <string key="NSFrameSize">{482, 70}</string>
- <reference key="NSSuperview" ref="667608859"/>
- </object>
- </object>
- <string key="NSFrame">{{4, 245}, {482, 70}}</string>
- <reference key="NSSuperview" ref="1059038623"/>
- <string key="NSOffsets">{0, 0}</string>
- <object class="NSTextFieldCell" key="NSTitleCell">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Title</string>
- <reference key="NSSupport" ref="668643277"/>
- <reference key="NSBackgroundColor" ref="128478752"/>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
- </object>
- </object>
- <reference key="NSContentView" ref="971021844"/>
- <int key="NSBorderType">0</int>
- <int key="NSBoxType">3</int>
- <int key="NSTitlePosition">0</int>
- <bool key="NSTransparent">NO</bool>
- </object>
- </object>
- <string key="NSFrameSize">{490, 325}</string>
- <reference key="NSSuperview" ref="468151514"/>
- </object>
- </object>
- <string key="NSFrame">{{0, 160}, {490, 325}}</string>
- <reference key="NSSuperview" ref="197525436"/>
- <string key="NSOffsets">{0, 0}</string>
- <object class="NSTextFieldCell" key="NSTitleCell">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Title</string>
- <reference key="NSSupport" ref="668643277"/>
- <reference key="NSBackgroundColor" ref="128478752"/>
- <object class="NSColor" key="NSTextColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwLjgwMDAwMDAxAA</bytes>
- </object>
- </object>
- <reference key="NSContentView" ref="1059038623"/>
- <int key="NSBorderType">0</int>
- <int key="NSBoxType">3</int>
- <int key="NSTitlePosition">0</int>
- <bool key="NSTransparent">NO</bool>
- </object>
- <object class="NSTextField" id="149448677">
- <reference key="NSNextResponder" ref="197525436"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 20}, {163, 14}}</string>
- <reference key="NSSuperview" ref="197525436"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="690832321">
- <int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">272630784</int>
- <string key="NSContents">xx seconds.</string>
- <reference key="NSSupport" ref="668643277"/>
- <reference key="NSControlView" ref="149448677"/>
- <reference key="NSBackgroundColor" ref="420457920"/>
- <reference key="NSTextColor" ref="800255527"/>
- </object>
- </object>
- </object>
- <string key="NSFrameSize">{490, 489}</string>
- </object>
- <string key="NSScreenRect">{{0, 0}, {2560, 1578}}</string>
- <string key="NSMinSize">{72, 27}</string>
- <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
- </object>
- <object class="NSUserDefaultsController" id="626548788">
- <bool key="NSSharedInstance">YES</bool>
- </object>
- </object>
- <object class="IBObjectContainer" key="IBDocument.Objects">
- <object class="NSMutableArray" key="connectionRecords">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">sendReport:</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="219938755"/>
- </object>
- <int key="connectionID">45</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">cancel:</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="409721323"/>
- </object>
- <int key="connectionID">46</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">showPrivacyPolicy:</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="538303250"/>
- </object>
- <int key="connectionID">53</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: emailValue</string>
- <reference key="source" ref="975305147"/>
- <reference key="destination" ref="273934324"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="975305147"/>
- <reference key="NSDestination" ref="273934324"/>
- <string key="NSLabel">value: emailValue</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">emailValue</string>
- <object class="NSDictionary" key="NSOptions">
- <string key="NS.key.0">NSNullPlaceholder</string>
- <string key="NS.object.0">optional</string>
- </object>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">90</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">initialFirstResponder</string>
- <reference key="source" ref="762998835"/>
- <reference key="destination" ref="219938755"/>
- </object>
- <int key="connectionID">91</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: commentsValue</string>
- <reference key="source" ref="996404163"/>
- <reference key="destination" ref="273934324"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="996404163"/>
- <reference key="NSDestination" ref="273934324"/>
- <string key="NSLabel">value: commentsValue</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">commentsValue</string>
- <object class="NSDictionary" key="NSOptions">
- <string key="NS.key.0">NSNullPlaceholder</string>
- <string key="NS.object.0">optional comments</string>
- </object>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">124</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">nextKeyView</string>
- <reference key="source" ref="975305147"/>
- <reference key="destination" ref="219938755"/>
- </object>
- <int key="connectionID">125</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">nextKeyView</string>
- <reference key="source" ref="996404163"/>
- <reference key="destination" ref="975305147"/>
- </object>
- <int key="connectionID">126</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">nextKeyView</string>
- <reference key="source" ref="219938755"/>
- <reference key="destination" ref="996404163"/>
- </object>
- <int key="connectionID">127</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">delegate</string>
- <reference key="source" ref="996404163"/>
- <reference key="destination" ref="273934324"/>
- </object>
- <int key="connectionID">128</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">alertWindow_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="762998835"/>
- </object>
- <int key="connectionID">142</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">preEmailBox_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="468151514"/>
- </object>
- <int key="connectionID">150</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">headerBox_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="667608859"/>
- </object>
- <int key="connectionID">151</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">emailSectionBox_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="469837363"/>
- </object>
- <int key="connectionID">152</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">privacyLinkLabel_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="655227981"/>
- </object>
- <int key="connectionID">153</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">commentMessage_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="375247105"/>
- </object>
- <int key="connectionID">154</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">dialogTitle_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="1032334641"/>
- </object>
- <int key="connectionID">155</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">emailLabel_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="268211031"/>
- </object>
- <int key="connectionID">156</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">cancelButton_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="409721323"/>
- </object>
- <int key="connectionID">158</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">sendButton_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="219938755"/>
- </object>
- <int key="connectionID">159</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">emailEntryField_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="975305147"/>
- </object>
- <int key="connectionID">161</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">privacyLinkArrow_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="538303250"/>
- </object>
- <int key="connectionID">162</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">emailMessage_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="997378142"/>
- </object>
- <int key="connectionID">163</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">commentsEntryField_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="996404163"/>
- </object>
- <int key="connectionID">176</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">value: countdownMessage</string>
- <reference key="source" ref="149448677"/>
- <reference key="destination" ref="273934324"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="149448677"/>
- <reference key="NSDestination" ref="273934324"/>
- <string key="NSLabel">value: countdownMessage</string>
- <string key="NSBinding">value</string>
- <string key="NSKeyPath">countdownMessage</string>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
- </object>
- <int key="connectionID">194</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">countdownLabel_</string>
- <reference key="source" ref="273934324"/>
- <reference key="destination" ref="149448677"/>
- </object>
- <int key="connectionID">208</int>
- </object>
- </object>
- <object class="IBMutableOrderedSet" key="objectRecords">
- <object class="NSArray" key="orderedObjects">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBObjectRecord">
- <int key="objectID">0</int>
- <reference key="object" ref="0"/>
- <reference key="children" ref="504246249"/>
- <nil key="parent"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-2</int>
- <reference key="object" ref="273934324"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">File's Owner</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-1</int>
- <reference key="object" ref="388635980"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">First Responder</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-3</int>
- <reference key="object" ref="220995958"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">Application</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">1</int>
- <reference key="object" ref="762998835"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="197525436"/>
- </object>
- <reference key="parent" ref="0"/>
- <string key="objectName">Window</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">2</int>
- <reference key="object" ref="197525436"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="219938755"/>
- <reference ref="409721323"/>
- <reference ref="469837363"/>
- <reference ref="468151514"/>
- <reference ref="149448677"/>
- </object>
- <reference key="parent" ref="762998835"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">12</int>
- <reference key="object" ref="219938755"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="733475259"/>
- </object>
- <reference key="parent" ref="197525436"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">14</int>
- <reference key="object" ref="409721323"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="586160416"/>
- </object>
- <reference key="parent" ref="197525436"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">132</int>
- <reference key="object" ref="469837363"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="997378142"/>
- <reference ref="975305147"/>
- <reference ref="268211031"/>
- <reference ref="538303250"/>
- <reference ref="655227981"/>
- </object>
- <reference key="parent" ref="197525436"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">145</int>
- <reference key="object" ref="468151514"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="375247105"/>
- <reference ref="996404163"/>
- <reference ref="667608859"/>
- </object>
- <reference key="parent" ref="197525436"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">189</int>
- <reference key="object" ref="149448677"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="690832321"/>
- </object>
- <reference key="parent" ref="197525436"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">191</int>
- <reference key="object" ref="626548788"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">Shared User Defaults Controller</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">210</int>
- <reference key="object" ref="733475259"/>
- <reference key="parent" ref="219938755"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">211</int>
- <reference key="object" ref="586160416"/>
- <reference key="parent" ref="409721323"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">221</int>
- <reference key="object" ref="690832321"/>
- <reference key="parent" ref="149448677"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">58</int>
- <reference key="object" ref="997378142"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="509794736"/>
- </object>
- <reference key="parent" ref="469837363"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">215</int>
- <reference key="object" ref="509794736"/>
- <reference key="parent" ref="997378142"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">18</int>
- <reference key="object" ref="975305147"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="592393645"/>
- </object>
- <reference key="parent" ref="469837363"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">212</int>
- <reference key="object" ref="592393645"/>
- <reference key="parent" ref="975305147"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">20</int>
- <reference key="object" ref="268211031"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="461570326"/>
- </object>
- <reference key="parent" ref="469837363"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">213</int>
- <reference key="object" ref="461570326"/>
- <reference key="parent" ref="268211031"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">48</int>
- <reference key="object" ref="538303250"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="778004767"/>
- </object>
- <reference key="parent" ref="469837363"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">214</int>
- <reference key="object" ref="778004767"/>
- <reference key="parent" ref="538303250"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">66</int>
- <reference key="object" ref="655227981"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1012850565"/>
- </object>
- <reference key="parent" ref="469837363"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">216</int>
- <reference key="object" ref="1012850565"/>
- <reference key="parent" ref="655227981"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">8</int>
- <reference key="object" ref="375247105"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="188082030"/>
- </object>
- <reference key="parent" ref="468151514"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">217</int>
- <reference key="object" ref="188082030"/>
- <reference key="parent" ref="375247105"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">116</int>
- <reference key="object" ref="996404163"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="242564194"/>
- </object>
- <reference key="parent" ref="468151514"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">218</int>
- <reference key="object" ref="242564194"/>
- <reference key="parent" ref="996404163"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">147</int>
- <reference key="object" ref="667608859"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1032334641"/>
- <reference ref="594334723"/>
- </object>
- <reference key="parent" ref="468151514"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">3</int>
- <reference key="object" ref="1032334641"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="316557784"/>
- </object>
- <reference key="parent" ref="667608859"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">219</int>
- <reference key="object" ref="316557784"/>
- <reference key="parent" ref="1032334641"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">6</int>
- <reference key="object" ref="594334723"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="465445685"/>
- </object>
- <reference key="parent" ref="667608859"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">220</int>
- <reference key="object" ref="465445685"/>
- <reference key="parent" ref="594334723"/>
- </object>
- </object>
- </object>
- <object class="NSMutableDictionary" key="flattenedProperties">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>-3.ImportedFromIB2</string>
- <string>1.IBEditorWindowLastContentRect</string>
- <string>1.IBWindowTemplateEditedContentRect</string>
- <string>1.ImportedFromIB2</string>
- <string>1.windowTemplate.hasMinSize</string>
- <string>1.windowTemplate.minSize</string>
- <string>116.CustomClassName</string>
- <string>116.ImportedFromIB2</string>
- <string>12.ImportedFromIB2</string>
- <string>132.ImportedFromIB2</string>
- <string>14.ImportedFromIB2</string>
- <string>145.ImportedFromIB2</string>
- <string>147.ImportedFromIB2</string>
- <string>18.CustomClassName</string>
- <string>18.ImportedFromIB2</string>
- <string>189.ImportedFromIB2</string>
- <string>191.ImportedFromIB2</string>
- <string>2.ImportedFromIB2</string>
- <string>20.ImportedFromIB2</string>
- <string>3.ImportedFromIB2</string>
- <string>48.ImportedFromIB2</string>
- <string>58.ImportedFromIB2</string>
- <string>6.ImportedFromIB2</string>
- <string>66.ImportedFromIB2</string>
- <string>8.ImportedFromIB2</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <boolean value="YES"/>
- <string>{{0, 656}, {490, 489}}</string>
- <string>{{0, 656}, {490, 489}}</string>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <string>{72, 5}</string>
- <string>LengthLimitingTextField</string>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <string>LengthLimitingTextField</string>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <boolean value="YES"/>
- </object>
- </object>
- <object class="NSMutableDictionary" key="unlocalizedProperties">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <nil key="activeLocalization"/>
- <object class="NSMutableDictionary" key="localizations">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <nil key="sourceID"/>
- <int key="maxID">221</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <object class="NSMutableArray" key="referencedPartialClassDescriptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">LengthLimitingTextField</string>
- <string key="superclassName">NSTextField</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBUserSource</string>
- <string key="minorKey"/>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">Reporter</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>cancel:</string>
- <string>sendReport:</string>
- <string>showPrivacyPolicy:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>alertWindow_</string>
- <string>cancelButton_</string>
- <string>commentMessage_</string>
- <string>commentsEntryField_</string>
- <string>countdownLabel_</string>
- <string>dialogTitle_</string>
- <string>emailEntryField_</string>
- <string>emailLabel_</string>
- <string>emailMessage_</string>
- <string>emailSectionBox_</string>
- <string>headerBox_</string>
- <string>preEmailBox_</string>
- <string>privacyLinkArrow_</string>
- <string>privacyLinkLabel_</string>
- <string>sendButton_</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>NSWindow</string>
- <string>NSButton</string>
- <string>NSTextField</string>
- <string>LengthLimitingTextField</string>
- <string>NSTextField</string>
- <string>NSTextField</string>
- <string>LengthLimitingTextField</string>
- <string>NSTextField</string>
- <string>NSTextField</string>
- <string>NSBox</string>
- <string>NSBox</string>
- <string>NSBox</string>
- <string>NSView</string>
- <string>NSTextField</string>
- <string>NSButton</string>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBUserSource</string>
- <string key="minorKey"/>
- </object>
- </object>
- </object>
- </object>
- <int key="IBDocument.localizationMode">0</int>
- <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1050" key="NS.object.0"/>
- </object>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
- <integer value="3000" key="NS.object.0"/>
- </object>
- <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">../Breakpad.xcodeproj</string>
- <int key="IBDocument.defaultPropertyAccessControl">3</int>
- <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>NSApplicationIcon</string>
- <string>goArrow</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>{128, 128}</string>
- <string>{128, 128}</string>
- </object>
- </object>
- </data>
-</archive>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/InfoPlist.strings
deleted file mode 100644
index 65d161818a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/Localizable.strings
deleted file mode 100644
index 5f1cc82698..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/English.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ReporterIcon.graffle b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ReporterIcon.graffle
deleted file mode 100644
index 14a0e7c4c9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ReporterIcon.graffle
+++ /dev/null
@@ -1,2489 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>ActiveLayerIndex</key>
- <integer>0</integer>
- <key>ApplicationVersion</key>
- <array>
- <string>com.omnigroup.OmniGrafflePro</string>
- <string>137.6.0.106738</string>
- </array>
- <key>AutoAdjust</key>
- <false/>
- <key>BackgroundGraphic</key>
- <dict>
- <key>Bounds</key>
- <string>{{0, 0}, {512, 512}}</string>
- <key>Class</key>
- <string>SolidGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>112</real>
- </dict>
- <key>ID</key>
- <integer>2</integer>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0</string>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.852018</string>
- <key>r</key>
- <string>0.998962</string>
- </dict>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- </dict>
- <key>CanvasOrigin</key>
- <string>{0, 0}</string>
- <key>CanvasSize</key>
- <string>{512, 512}</string>
- <key>ColumnAlign</key>
- <integer>1</integer>
- <key>ColumnSpacing</key>
- <real>36</real>
- <key>CreationDate</key>
- <string>2008-11-14 16:58:15 -0700</string>
- <key>Creator</key>
- <string>John P. Developer</string>
- <key>DisplayScale</key>
- <string>1 pt = 1 px</string>
- <key>FileType</key>
- <string>flat</string>
- <key>GraphDocumentVersion</key>
- <integer>6</integer>
- <key>GraphicsList</key>
- <array>
- <dict>
- <key>Bounds</key>
- <string>{{33.9443, 35.3885}, {444.111, 437.112}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>112</real>
- </dict>
- <key>ID</key>
- <integer>31</integer>
- <key>Rotation</key>
- <real>270</real>
- <key>Shape</key>
- <string>Bezier</string>
- <key>ShapeData</key>
- <dict>
- <key>UnitPoints</key>
- <array>
- <string>{-0.5, -0.439247}</string>
- <string>{-0.5, -0.485429}</string>
- <string>{-0.446294, -0.512626}</string>
- <string>{-0.409932, -0.494153}</string>
- <string>{-0.373569, -0.47568}</string>
- <string>{0.436363, -0.0733799}</string>
- <string>{0.472729, -0.0549059}</string>
- <string>{0.50909, -0.0364333}</string>
- <string>{0.509091, 0.0364345}</string>
- <string>{0.472729, 0.0549059}</string>
- <string>{0.436368, 0.0733802}</string>
- <string>{-0.373569, 0.475681}</string>
- <string>{-0.409932, 0.494153}</string>
- <string>{-0.446294, 0.512626}</string>
- <string>{-0.500001, 0.485429}</string>
- <string>{-0.5, 0.439247}</string>
- <string>{-0.49998, 0.393072}</string>
- <string>{-0.500002, -0.393066}</string>
- </array>
- </dict>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.770962</string>
- <key>r</key>
- <string>0.997971</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>FillType</key>
- <integer>3</integer>
- <key>GradientCenter</key>
- <string>{-0.609524, 0}</string>
- <key>GradientColor</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.911574</string>
- <key>r</key>
- <string>0.998779</string>
- </dict>
- <key>MiddleFraction</key>
- <real>0.6111111044883728</real>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0.43</string>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>Fuzziness</key>
- <real>7.2213706970214844</real>
- <key>ShadowVector</key>
- <string>{0, 6}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.766903</string>
- <key>r</key>
- <string>0.997925</string>
- </dict>
- <key>Width</key>
- <real>7</real>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Pad</key>
- <integer>0</integer>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- <key>TextRelativeArea</key>
- <string>{{0.06, 0.17}, {0.88, 0.5}}</string>
- <key>TextRotation</key>
- <real>90</real>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{3.89085, 67.8908}, {404.218, 332}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>112</real>
- </dict>
- <key>ID</key>
- <integer>30</integer>
- <key>Rotation</key>
- <real>270</real>
- <key>Shape</key>
- <string>Bezier</string>
- <key>ShapeData</key>
- <dict>
- <key>UnitPoints</key>
- <array>
- <string>{-0.5, -0.5}</string>
- <string>{-0.459695, -0.475464}</string>
- <string>{0.429465, 0.0537758}</string>
- <string>{0.469773, 0.0783133}</string>
- <string>{0.510074, 0.102849}</string>
- <string>{0.510077, 0.198357}</string>
- <string>{0.469773, 0.222892}</string>
- <string>{0.429473, 0.247428}</string>
- <string>{-0.00521517, 0.499998}</string>
- <string>{-0.00521785, 0.5}</string>
- <string>{-0.00521713, -0.113381}</string>
- <string>{-0.44962, -0.458615}</string>
- </array>
- </dict>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0</string>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>1</string>
- <key>r</key>
- <string>1</string>
- </dict>
- <key>FillType</key>
- <integer>2</integer>
- <key>GradientAngle</key>
- <real>180</real>
- <key>GradientCenter</key>
- <string>{-0.609524, 0}</string>
- <key>GradientColor</key>
- <dict>
- <key>a</key>
- <string>0.5</string>
- <key>w</key>
- <string>1</string>
- </dict>
- <key>MiddleFraction</key>
- <real>0.6111111044883728</real>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0.51</string>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>Fuzziness</key>
- <real>3.3371961116790771</real>
- <key>ShadowVector</key>
- <string>{0, 2}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.766903</string>
- <key>r</key>
- <string>0.997925</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Pad</key>
- <integer>0</integer>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- <key>TextRelativeArea</key>
- <string>{{0.06, 0.17}, {0.88, 0.5}}</string>
- <key>TextRotation</key>
- <real>90</real>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{33.9443, 35.3886}, {444.112, 437.111}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>112</real>
- </dict>
- <key>ID</key>
- <integer>29</integer>
- <key>Rotation</key>
- <real>270</real>
- <key>Shape</key>
- <string>Bezier</string>
- <key>ShapeData</key>
- <dict>
- <key>UnitPoints</key>
- <array>
- <string>{-0.5, -0.439247}</string>
- <string>{-0.500001, -0.485429}</string>
- <string>{-0.446295, -0.512626}</string>
- <string>{-0.409932, -0.494153}</string>
- <string>{-0.373568, -0.475681}</string>
- <string>{0.436363, -0.0733802}</string>
- <string>{0.472729, -0.0549062}</string>
- <string>{0.509089, -0.0364334}</string>
- <string>{0.509092, 0.0364341}</string>
- <string>{0.472729, 0.0549056}</string>
- <string>{0.436369, 0.0733803}</string>
- <string>{-0.373568, 0.475681}</string>
- <string>{-0.409932, 0.494153}</string>
- <string>{-0.446294, 0.512626}</string>
- <string>{-0.500001, 0.485428}</string>
- <string>{-0.5, 0.439248}</string>
- <string>{-0.499978, 0.39307}</string>
- <string>{-0.500003, -0.393066}</string>
- </array>
- </dict>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0.2</string>
- <key>b</key>
- <string>1</string>
- <key>g</key>
- <string>1</string>
- <key>r</key>
- <string>1</string>
- </dict>
- <key>FillType</key>
- <integer>2</integer>
- <key>GradientAngle</key>
- <real>90</real>
- <key>GradientCenter</key>
- <string>{-0.609524, 0}</string>
- <key>GradientColor</key>
- <dict>
- <key>a</key>
- <string>0</string>
- <key>w</key>
- <string>1</string>
- </dict>
- <key>MiddleFraction</key>
- <real>0.6111111044883728</real>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0.51</string>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>Fuzziness</key>
- <real>3.3371961116790771</real>
- <key>ShadowVector</key>
- <string>{0, 2}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.766903</string>
- <key>r</key>
- <string>0.997925</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Pad</key>
- <integer>0</integer>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- <key>TextRelativeArea</key>
- <string>{{0.06, 0.17}, {0.88, 0.5}}</string>
- <key>TextRotation</key>
- <real>90</real>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{176, 102.384}, {158.841, 537.616}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>425</real>
- </dict>
- <key>ID</key>
- <integer>26</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Pad</key>
- <integer>0</integer>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350
-{\fonttbl\f0\fnil\fcharset0 CalistoMT;}
-{\colortbl;\red255\green255\blue255;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
-
-\f0\b\fs850 \cf1 !}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{176, 104}, {158.841, 537.616}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.749523</string>
- <key>r</key>
- <string>0.997726</string>
- </dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>425</real>
- </dict>
- <key>ID</key>
- <integer>27</integer>
- <key>Shape</key>
- <string>Rectangle</string>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Draws</key>
- <string>NO</string>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Pad</key>
- <integer>0</integer>
- <key>RTFD</key>
- <data>
- BAtzdHJlYW10eXBlZIHoA4QBQISEhBJOU0F0dHJpYnV0
- ZWRTdHJpbmcAhIQITlNPYmplY3QAhZKEhIQITlNTdHJp
- bmcBlIQBKwEhhoQCaUkBAZKEhIQMTlNEaWN0aW9uYXJ5
- AJSEAWkEkoSWlhBOU1BhcmFncmFwaFN0eWxlhpKEhIQQ
- TlNQYXJhZ3JhcGhTdHlsZQCUhARDQ0BTAgCEhIQHTlNB
- cnJheQCUmQyShISECU5TVGV4dFRhYgCUhAJDZgAchpKE
- n54AOIaShJ+eAFSGkoSfngBwhpKEn54AgYwAhpKEn54A
- gagAhpKEn54AgcQAhpKEn54AgeAAhpKEn54AgfwAhpKE
- n54AgRgBhpKEn54AgTQBhpKEn54AgVABhoYAhpKElpYG
- TlNGb250hpKEhIQGTlNGb250HpSZIIQFWzMyY10GAAAA
- FgAAAP/+QwBhAGwAaQBzAE0AVABCAG8AbAAAAIQBZoGp
- AYQBYwCiAaIAogCGkoSWlg1OU1N0cm9rZVdpZHRohpKE
- hIQITlNOdW1iZXIAhIQHTlNWYWx1ZQCUhAEqhIQBZKYD
- hpKElpYHTlNDb2xvcoaShISEB05TQ29sb3IAlKIChARm
- ZmZmAYN4dz8/AAGGhoY=
- </data>
- <key>Text</key>
- <string>{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf350
-{\fonttbl\f0\fnil\fcharset0 CalistoMT;}
-{\colortbl;\red255\green255\blue255;\red254\green191\blue0;}
-\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural
-
-\f0\b\fs850 \cf2 \outl\strokewidth60 \strokec2 !}</string>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- <dict>
- <key>Bounds</key>
- <string>{{33.9441, 35.3884}, {444.112, 437.111}}</string>
- <key>Class</key>
- <string>ShapedGraphic</string>
- <key>FontInfo</key>
- <dict>
- <key>Font</key>
- <string>CalisMTBol</string>
- <key>Size</key>
- <real>112</real>
- </dict>
- <key>ID</key>
- <integer>16</integer>
- <key>Rotation</key>
- <real>270</real>
- <key>Shape</key>
- <string>Bezier</string>
- <key>ShapeData</key>
- <dict>
- <key>UnitPoints</key>
- <array>
- <string>{-0.5, -0.439247}</string>
- <string>{-0.5, -0.485429}</string>
- <string>{-0.446295, -0.512626}</string>
- <string>{-0.409933, -0.494153}</string>
- <string>{-0.373569, -0.47568}</string>
- <string>{0.436363, -0.073379}</string>
- <string>{0.472729, -0.0549049}</string>
- <string>{0.50909, -0.0364324}</string>
- <string>{0.509091, 0.0364344}</string>
- <string>{0.472729, 0.0549058}</string>
- <string>{0.436368, 0.0733801}</string>
- <string>{-0.373569, 0.47568}</string>
- <string>{-0.409933, 0.494153}</string>
- <string>{-0.446295, 0.512626}</string>
- <string>{-0.500001, 0.485429}</string>
- <string>{-0.5, 0.439247}</string>
- <string>{-0.49998, 0.393072}</string>
- <string>{-0.500002, -0.393066}</string>
- </array>
- </dict>
- <key>Style</key>
- <dict>
- <key>fill</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.770962</string>
- <key>r</key>
- <string>0.997971</string>
- </dict>
- <key>FillType</key>
- <integer>3</integer>
- <key>GradientCenter</key>
- <string>{-0.609524, 0}</string>
- <key>GradientColor</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.911574</string>
- <key>r</key>
- <string>0.998779</string>
- </dict>
- <key>MiddleFraction</key>
- <real>0.6111111044883728</real>
- </dict>
- <key>shadow</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>a</key>
- <string>0.9</string>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0</string>
- <key>r</key>
- <string>0</string>
- </dict>
- <key>Fuzziness</key>
- <real>8.0632610321044922</real>
- <key>ShadowVector</key>
- <string>{0, 9}</string>
- </dict>
- <key>stroke</key>
- <dict>
- <key>Color</key>
- <dict>
- <key>b</key>
- <string>0</string>
- <key>g</key>
- <string>0.766903</string>
- <key>r</key>
- <string>0.997925</string>
- </dict>
- <key>Draws</key>
- <string>NO</string>
- <key>Width</key>
- <real>2</real>
- </dict>
- </dict>
- <key>Text</key>
- <dict>
- <key>Pad</key>
- <integer>0</integer>
- <key>VerticalPad</key>
- <integer>0</integer>
- </dict>
- <key>TextPlacement</key>
- <integer>0</integer>
- <key>TextRelativeArea</key>
- <string>{{0.06, 0.17}, {0.88, 0.5}}</string>
- <key>TextRotation</key>
- <real>90</real>
- <key>Wrap</key>
- <string>NO</string>
- </dict>
- </array>
- <key>GridInfo</key>
- <dict>
- <key>GridSpacing</key>
- <real>4</real>
- <key>ShowsGrid</key>
- <string>YES</string>
- <key>SnapsToGrid</key>
- <string>YES</string>
- </dict>
- <key>GuidesLocked</key>
- <string>NO</string>
- <key>GuidesVisible</key>
- <string>YES</string>
- <key>HPages</key>
- <integer>1</integer>
- <key>ImageCounter</key>
- <integer>2</integer>
- <key>KeepToScale</key>
- <false/>
- <key>Layers</key>
- <array>
- <dict>
- <key>Lock</key>
- <string>NO</string>
- <key>Name</key>
- <string>Layer 1</string>
- <key>Print</key>
- <string>YES</string>
- <key>View</key>
- <string>YES</string>
- </dict>
- </array>
- <key>LayoutInfo</key>
- <dict>
- <key>Animate</key>
- <string>NO</string>
- <key>circoMinDist</key>
- <real>18</real>
- <key>circoSeparation</key>
- <real>0.0</real>
- <key>layoutEngine</key>
- <string>dot</string>
- <key>neatoSeparation</key>
- <real>0.0</real>
- <key>twopiSeparation</key>
- <real>0.0</real>
- </dict>
- <key>LinksVisible</key>
- <string>NO</string>
- <key>MagnetsVisible</key>
- <string>NO</string>
- <key>MasterSheets</key>
- <array/>
- <key>ModificationDate</key>
- <string>2008-11-17 11:41:28 -0700</string>
- <key>Modifier</key>
- <string>Preston Jackson</string>
- <key>NotesVisible</key>
- <string>NO</string>
- <key>Orientation</key>
- <integer>2</integer>
- <key>OriginVisible</key>
- <string>NO</string>
- <key>PageBreaks</key>
- <string>YES</string>
- <key>PrintInfo</key>
- <dict>
- <key>NSBottomMargin</key>
- <array>
- <string>float</string>
- <string>41</string>
- </array>
- <key>NSLeftMargin</key>
- <array>
- <string>float</string>
- <string>18</string>
- </array>
- <key>NSPaperSize</key>
- <array>
- <string>size</string>
- <string>{612, 792}</string>
- </array>
- <key>NSRightMargin</key>
- <array>
- <string>float</string>
- <string>18</string>
- </array>
- <key>NSTopMargin</key>
- <array>
- <string>float</string>
- <string>18</string>
- </array>
- </dict>
- <key>PrintOnePage</key>
- <false/>
- <key>QuickLookPreview</key>
- <data>
- JVBERi0xLjMKJcTl8uXrp/Og0MTGCjQgMCBvYmoKPDwgL0xlbmd0aCA1IDAgUiAvRmls
- dGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAGVlktvJEUQhO/9K5IbHFyuR9brioEV
- nFh5JM5o5MWsPIA9IP4+X2b12gPrBbHWSt3lzkdFREb6Ud7Ko0R+asr+/+lOfpBfJIYW
- /Z/8LNc35yTHsyROh/ZYxyTgfJTrN/zip7NcxVD3r1+e9oQbCd/J9fd3T8e7337/48cH
- eSLjm3O2wEfR2ry8tiJ5hDJSVEk9pF7jkONJrr89JfnqV/p8uz1KK1YpJynNHlKVk2gJ
- JZWqdqZz9iklBc21ZmkxlJoin0/vsEonTo6b9lC79iQzh6azSc7FYjINZWIkk4MCKtrG
- ejhyRpZeRYcSNIbk7oXmtk5m4mRaD/NvYcOK1bKnpnkuu4qt6jqEVujLmtuOvFgdrXv7
- mcjWQxut71ds5LcbAIADIcTkDgpt4TKmyigWoXNzVAYtfYzdUe5fOT25ACxMtZAQiPeX
- xEVTSCkNeaBLDbXWDhwfnxH1QHJX0sfiulDDhhpMgMnUJZAGDLkCea3T6b+9T3K+N/pf
- F6qL8+ZW0hYDjM4ESlFubyTlAFd/kvfwRKilj3IFRdTQHJsk6EwzW5UvDwBY1xf2cNVL
- SDWiyTa2AyL8JgXr8fBOPv/sCzm8l68PNERtwm0wGIb4yTrK2LiYt3+rI5+uY1df7JW8
- CD9tS/XNGUdxFSUs1e+yiQPuXPUMyVI9lL2qeh2bq16Rjet+qRdVLcWrceySz8+S30+A
- zyTPTNiYWMQSe10Z64vY+/OoudZNus9dudwRqE+rVVty97v63bZd7iZHL7PkjnfYe5xw
- vvTOAJtW5+gMv3vFB8RetF6yzYQ5x3/L08wKeQZ3t1pin5Fp1GpD0ORKy7AnlLN/kbPS
- 2ofZwIlqwA1G35aT5d3JyGncLARwMKZb0Tt2gIAHLOBGpTJExgtaxZ/MjxbK+B8mYdQ0
- 5QuYoSumBgvBBXEsP0n9khlidnI8xrK6LZqBzVm2bFzEhIjMiIwcPyGGeQqjdjrwT7h+
- LYHiADxbwGHg6+Uux+3+4u1/I6yj5DSiaKw0CBBXpRSDluldCFM4zgHvPa9zujJygMR3
- RXlB+JWt1t0PvmNg35PwHxsOE4mw1Weu0cykNci2JJjJhX+sVUm1pt4BgIOOr6HBGsLd
- eYUt0uRFYFIEgAl4n6yrBqw6QuzKxtA0wdf4g/OZ2QWMAd4DfUgXOqHaYjtc4/Gjshmh
- y/PP/YQ62VDzj4dlZttYGh2ZHAwCzaCeVcoaJty3VGm2b4bnZwuhC2LommlOA9lxF2ub
- WDS6QrjdWjcjNZJ3Uzh/OyA6IjK7cIVwj0t8fPwuD05ya6b+F7C1v1cKZW5kc3RyZWFt
- CmVuZG9iago1IDAgb2JqCjk4MwplbmRvYmoKMiAwIG9iago8PCAvVHlwZSAvUGFnZSAv
- UGFyZW50IDMgMCBSIC9SZXNvdXJjZXMgNiAwIFIgL0NvbnRlbnRzIDQgMCBSIC9NZWRp
- YUJveCBbMCAwIDUxMiA1MTJdCj4+CmVuZG9iago2IDAgb2JqCjw8IC9Qcm9jU2V0IFsg
- L1BERiAvVGV4dCAvSW1hZ2VCIC9JbWFnZUMgL0ltYWdlSSBdIC9Db2xvclNwYWNlIDw8
- IC9DczIgMTIgMCBSCi9DczEgNyAwIFIgPj4gL0V4dEdTdGF0ZSA8PCAvR3MxIDE3IDAg
- UiAvR3MyIDE4IDAgUiA+PiAvRm9udCA8PCAvRjEuMCAxMSAwIFIKPj4gL1hPYmplY3Qg
- PDwgL0ltMiAxMyAwIFIgL0ltMSA4IDAgUiAvSW0zIDE1IDAgUiA+PiAvU2hhZGluZyA8
- PCAvU2gxIDEwIDAgUgo+PiA+PgplbmRvYmoKMTAgMCBvYmoKPDwgL0NvbG9yU3BhY2Ug
- NyAwIFIgL1NoYWRpbmdUeXBlIDMgL0Nvb3JkcyBbIC0yNzEuMzA2MyAwIDAgLTI3MS4z
- MDYzIDAgNTQwLjI2NApdIC9Eb21haW4gWyAwIDEgXSAvRXh0ZW5kIFsgZmFsc2UgZmFs
- c2UgXSAvRnVuY3Rpb24gMTkgMCBSID4+CmVuZG9iagoxMyAwIG9iago8PCAvTGVuZ3Ro
- IDE0IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2UgL1dpZHRoIDI1NiAv
- SGVpZ2h0IDI1NiAvQ29sb3JTcGFjZQo3IDAgUiAvU01hc2sgMjAgMCBSIC9CaXRzUGVy
- Q29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngB7dABAQAA
- CAKg/p+2Bx4QJpBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
- AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
- wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
- GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
- AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
- wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
- GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
- AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
- wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
- GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
- AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
- wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
- GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
- AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBg
- wIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYM
- GDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIAB
- AwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDDQBg4DBgwYMGDA
- wNjAA65NNU0KZW5kc3RyZWFtCmVuZG9iagoxNCAwIG9iago4ODMKZW5kb2JqCjggMCBv
- YmoKPDwgL0xlbmd0aCA5IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1hZ2Ug
- L1dpZHRoIDkxMiAvSGVpZ2h0IDkyNiAvQ29sb3JTcGFjZQoyMiAwIFIgL1NNYXNrIDIz
- IDAgUiAvQml0c1BlckNvbXBvbmVudCA4IC9GaWx0ZXIgL0ZsYXRlRGVjb2RlID4+CnN0
- cmVhbQp4Ae3QgQAAAADDoPlTH+SFUGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- gAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwY
- MGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAED
- BgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDA
- wMvAAKraAAEKZW5kc3RyZWFtCmVuZG9iago5IDAgb2JqCjExMDcwCmVuZG9iagoxNSAw
- IG9iago8PCAvTGVuZ3RoIDE2IDAgUiAvVHlwZSAvWE9iamVjdCAvU3VidHlwZSAvSW1h
- Z2UgL1dpZHRoIDI1NiAvSGVpZ2h0IDI1NiAvQ29sb3JTcGFjZQo3IDAgUiAvU01hc2sg
- MjUgMCBSIC9CaXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4K
- c3RyZWFtCngB7dKBDQAgDMMw/n+6SHBGvA+aeXMKFAucd8XlNiuw8U9BuQD/5e/bzj8D
- 5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL8F/+
- vu38M1AuwH/5+7bzz0C5AP/l79vOPwPlAvyXv287/wyUC/Bf/r7t/DNQLsB/+fu2889A
- uQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC/Je/
- bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5AP/l79vOPwPlAvyXv287/wyUC/Bf/r7t/DNQ
- LsB/+fu2889AuQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA/+Xv
- 284/A+UC/Je/bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5AP/l79vOPwPlAvyXv287/wyU
- C/Bf/r7t/DNQLsB/+fu2889AuQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7
- tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5AP/l79vOPwPl
- AvyXv287/wyUC/Bf/r7t/DNQLsB/+fu2889AuQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+
- 7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5
- AP/l79vOPwPlAvyXv287/wyUC/Bf/r7t/DNQLsB/+fu2889AuQD/5e/bzj8D5QL8l79v
- O/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL8F/+vu38M1Au
- wH/5+7bzz0C5AP/l79vOPwPlAvyXv287/wyUC/Bf/r7t/DNQLsB/+fu2889AuQD/5e/b
- zj8D5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL
- 8F/+vu38M1AuwH/5+7bzz0C5AP/l79vOPwPlAvyXv287/wyUC/Bf/r7t/DNQLsB/+fu2
- 889AuQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC
- /Je/bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5AP/l79vOPwPlAvyXv287/wyUC/Bf/r7t
- /DNQLsB/+fu2889AuQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+7fwzUC7Af/n7tvPPQLkA
- /+Xv284/A+UC/Je/bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5AP/l79vOPwPlAvyXv287
- /wyUC/Bf/r7t/DNQLsB/+fu2889AuQD/5e/bzj8D5QL8l79vO/8MlAvwX/6+7fwzUC7A
- f/n7tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL8F/+vu38M1AuwH/5+7bzz0C5AP/l79vO
- PwPlAvyXv287/wyUC/Bf/r7t/DNQLsB/+fu2889AuQD/5e/bzj8D5QL8l79vO/8MlAvw
- X/6+7fwzUC7Af/n7tvPPQLkA/+Xv284/A+UC/Je/bzv/DJQL8F/+vu3f/wUgwjJ6CmVu
- ZHN0cmVhbQplbmRvYmoKMTYgMCBvYmoKMTIxNAplbmRvYmoKMjMgMCBvYmoKPDwgL0xl
- bmd0aCAyNCAwIFIgL1R5cGUgL1hPYmplY3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCA5
- MTIgL0hlaWdodCA5MjYgL0NvbG9yU3BhY2UKL0RldmljZUdyYXkgL0JpdHNQZXJDb21w
- b25lbnQgOCAvRmlsdGVyIC9GbGF0ZURlY29kZSA+PgpzdHJlYW0KeAHsnYlfTV37/288
- j4xJUVJRGtCEoggliZCxyFQUlUiGNCgJIXOFyFTKlCljmUMlUaZK4XY/N31fv//jd621
- 9z57n6nxDPvU1ev1PHfts89a61zn+njvz7XW3uuvv/AHI4ARwAhgBDACGAGMQOeIQDfy
- 0132hx7tHB8QPwVGQCciwOiwR48e//nPf/4r9QMH/gPHQaRwjk58FhwkRkCHI0ClSIT4
- 3//27Kmn10vuR0+vZ8///peoEjWpw98zDl0HIkAuT0GLIEWqxN59+vTt269ff8lPv379
- +vbt07s3iJSoEkSJmtSBrxWHqIsRoGKkWuzVqzcRYn/9AQMMDAwGDhxoyPwMHAh/GgzQ
- 1+/fD1QJmtQDTTKc1MUPjGPGCIg1AqwYe8IFKmiRSNFgoKHRoEGDjY1NTIbAjyn5PxMT
- Y+PBg4wMQZcD9PszmmQkiWZSrN8sjkv3IgBqJI6xJxEjaNHAAKRobDLE1HSombmFxbBh
- w+nPsGHDLMzNzYaampqAKkGUA/SBk+TSFShJLlx174PjiDECoosAMY0gRj0qRuCi0WDj
- IaZDzS2GWVpZjbC2sbG1tWN+bG1trEdYWVkOH2ZuBqIETRoYEEyCJOl1KypSdN8tDkjX
- IsCqsVevPn37DwAwDjYBLYIUR9jYjRxlb+/g6OjkDD9j4H9OTo4O9vajR9nZgiyHW5iZ
- DjEmmNTvB2aSgSQqUte+fhyvqCLAqJGiUZ+QcYipmYWllbXtyNH2js5jxrm4uI6f4Obu
- 7j5xIvyfm9uE8a4u48Y6OznYj7KzGWE1zHyoKUjSYED/vqhIUX2vOBhdjAD1jWAbwTXq
- GxgOMiFiHGEzcrSD0xgX1wnuEz0mT5nq6TVtmrf39One3t7TvLw8p0yePMndbbzLWGdH
- +1G21lbDzU2HDDYayCmS+EhdjASOGSOg9QiQKg4p4vTpBxeqgEbz4VY2I+0dQYtuEydP
- 8Zw23cd3pt/sOXPn+jM/c+fM9pvlO8PH22vqZA/3CS5jnQCT1pbDzACSAw0oI0llBy9a
- tf7N4gB0LwIUjlDFoWwcPGSohaW13WgQ44SJk6dOmz5j1uy5/vMXLgoIDFyydGkQ+Vm6
- ZElgwOJFC+b5z/Hz9fH2nDzJzXUcSNKGQBIUSRlJa62ISN1LBxyxdiNA4QjGsS9cqYIa
- hxE0Oo8bP3Gyp/eMWXP8FywOXLpsxargkNWhYWFr165bt27t2rDQNauDg1cuDwoMWDjf
- f7avz7QpHm4uYxxH244gijQyGNCvDxR2EJHa/Waxdx2MAJEjgWP/AQMHmQy1sLIZ5TDG
- xc3Dc7qvH2hxybKVwWvCwiPWb4jeFBOzecuWrVu3btmyOSYmemNUZPja0JBVy5cGLpo3
- Z6aP1+SJ4wGSdiOGw1WroYE+FHYAkegidTAlcMhaiwC5ViV1HICjkbGpuaU1qNF14uRp
- Pn7+CwODVoaEhkdu2LR5a2x8QmJS8s6UXbt2pe7alZKyM2lHQnzcti0xG9eHr10dvHzJ
- YpDk9KkeE1yc7G2thg0dAhetBJHURWrtw2HHGAHdigDI8T//Jc4R4DjEbPiIkfagxine
- vnPmBwStXL02YkPM1u3xO3bu2r133/709IOHDh0mP4cOpqcf2Je2JzUlKSFu2+bo9eGh
- wcsDF/r7+Xh6TBjnNNrGyoJctFJEkmtW3YoJjhYjoKUIsNaxT38DQ2NTCytbe2cXUOPM
- uQsDV4SsjdgYExuflLI77UD64aPHMzNPnDyVnX0afrKzT508kZWZcezIwfR9e1KTE+O2
- booKX7MqaPG82T5eHhPGOoy0Hm4GiNTvR65ZUZBa+naxWx2LACtHcq1qYjbcepTjOLfJ
- RI1LVq4J3wBiTE7de+DQ0Yysk9k5OecuXMzNu3QpH34uXcrLvXjh/NmcM6dOZB47nL5v
- d8qOuC3RkWHBywLmASMnuY6Bi1Zz08GG5JoVBaljWYHD1VIEmEoOWEe4VjUHOI4Z7+E1
- g6gxNCJ6S3xSalr64eNZp86cvZB7Kf/y1WvXC2/cuHETfuA/NwqvX71SkJ938VzO6ROZ
- Rw/u370zITZm/TqiyFnTp7i5OI4cMYyUdfqjILX07WK3OhaBbt2gsNqrN1jHwXCtOtJh
- nNsUH7/5gSvXRERvjd+5+wCIMTvnQl7+lWuFN27dKbp3/wH8PCQ/8N/79+4W3b554/rV
- gksXz505mXk0PS11x/aYqLXBQYvm+np5uDqPthk+1MSICFIPL1l1LDVwuFqIAJRyeuox
- chw2YpSTyyQvX//Fy0LCN25NSNmbfjQTxHjp8jWQ4r0HDx6VPH7y9NmzZ8+ZH/jt6ZOS
- 4ocP7hfdvnH9Sn7uuTMnjh/al5q0PWZ92KrA+X7TJ7uNtbe1NBtCBYmXrFr4erFL3YoA
- raz27jtgoLHpMOvRY8ZP9vabv2TV2qjN8Tv3ph87ceZ8XsG1G7fvghSfPHv+ovTV6zdl
- ZeXsT1nZm9evSl++ePb0cTFo8lbhlfyLOacyD+9P3RG7KXz1ssVzZ3i6uzjYWZmzgsQq
- q24lB45W0xEg8456vcA7GpsOt7EfA9eqcxYtWx2xaXvSblBjzoX8qzdu33tQ/OTZi9LX
- b8rL31a+q6p6//4D8/P+fdW7yrcV5WVvXr18/rTk4f2im9cLcs9mZx7atythS9TaVYHz
- ZnpNcnEUChJnPTT9FWN/uhMBiRwHEzmOdZs6wz9gRVjUloTU/UeyzlzIv3ajiIjx5euy
- 8rfvqj5UV9d8/Pjp8+fPX+AH/vPp08ea6uoP799VVpS/KX3+rOThvduFl/POnjp+cE/y
- 9k3hwUsX+Hl7uDqOpISEaQ9YqYOC1J30wJFqOAK0ltNH32AwXKzaj3X39PUPDF4XHZu8
- 52BG9vn8azfvPighYqyoBC2CEL98ra2rl/qpq6v9+uUzqPL9u7dEkk8e3QdF5uacOLp/
- V/zmyDXLFs6ePpkI0swEpj16Y01Hw18wdqdLESDmEZasGgzi5DhvSXB4THzK/iMncvKu
- 3Lj74PGz0jflle+raz59+QpK/NbQ0Pj9+w/Jz/fvjY0N3+rrQZSfP1Z/qHpb/vrF0+L7
- t6/nXzidkb57x9ao0OWL5hBB2lkONTYc0LeX3n96ICB1KUVwrBqMADGPvfsZGA2xGDF6
- jJun77ylIRExCanpx7MvFBTeATW+KntbRcRYW18PSvzx8+fff/+S/vn7758/vhNR1hFJ
- vq8kinx07+bVvJysw2nJsRvDViyeM93DxcF2+NDBA/VhGhKvWDX4BWNXuhQBMtXRq+8A
- QxMzq5HOE6b6zlsSErk5cffBzJzcqzfvFT8rLXv7vvojiPFbA2iRKPGf//3vf/8KfuDP
- f/6B43//BE0SSdZ8eAeKfPLgTmH+uZNH9+3cvnHtikWzvSe52NsMMx1k0B+vWHUpQXCs
- mowAKebA1erAwUMt7RzHT57hD3LckrjnUFbOpet3Hjx58QbY+AkuU0GMoMV//gEl/v79
- h/w00R/66+/fv//993+gSSLJb/W1oMjK8lfPiu/duHwh+9j+lO0bw5Yv8ps2cezoERZD
- jAb0Q0Bq8ivGvnQoAlDMIVerYB5tHFwm+0ApJ2Jz4p7DJ87l37j76Nmr8ndEjd8af/wk
- XAQtskL8P+EPEeafP6BJKskf3xuIIt+/ffPi8YNbV3NPHz9ABLlswSxPN+dRVmbG9IoV
- V5brUJLgUDUVAcnVqvmI0eMmes8JWBUeQ+VYcONeyfM3bz/UfCFq/JsTIyhPqET+d4Ek
- AZIN9V8/Vb8rL3368Pa13DPH9++M3bAmaN6MKeMdbYebDmauWLGko6kvGfvRmQh0I8Wc
- /gaDh4J5dPOctXDFuk3xuw+dOFdw4/7jl2UAx9r6BkaNQEalYmRlSSlJIAmK/Fb3peZ9
- xetnj+5cA0LuT962PiTQ38fDxd6aXLH2xStWnUkRHKjmIsDg0cCIXK26Tp4xLyh0Y1zq
- wayzIMcnpeVVBI7ffxI2UjXyNCS//T/mR+ogoSS9bP37RyMg8sNbRpDZR9N2bA5fFTB7
- mvsYesXavw9MQiIgNfdFY086EQHAY68++gNNyNXqpOlzA0PWx6akZ+bks3L8SuGoSI2s
- GOUlKVEkILL2c3XlGyDk1YunjuxJiFm3fIEvc8U6yABLOjqRHzhIjUaA4pEUcyztnCZ4
- zlq0KnxL0r7jZy4V3nv8svz9x6/1jSwcpV2jlBjpH0JIMletcNH6vaGOCvLh7SvnTxxM
- jdu4ZilcsY6zH2FuYgiTkAhIjX7X2Jn4I8Dg0XCIhbU91FbnBYVtit9zJDv3+t2SF+VV
- rBzlLlXl1SgrSeai9dffP4gg4ZL1wc2Cs5kHdm6NDF4828vNeaQllHQQkOJPDxyhZiPA
- 4pEUc8a4T5sTGBIVu+vgifNX7jx6XlZV87WeWEeQoxQclaiRHOYhSRBJ6jpEkB8qXj25
- f+PSmWNpiTFrl8+fMZmWdBCQmv2qsTcdiACHR1LMmeK7cEX45qT9GTn5Nx88e1NZ/YVc
- rBLrKJRjM2qUU+RvIshvdZ/el78sKbp28eSh1LgNqwPnek+Eks5QBKQO5AcOUaMR4PE4
- auzE6f5L1myM330kO6/w3pNXb6s/K5BjC2qURSQI8m8o6nysKnv+8Ba5Yk3eEr5y4cwp
- rg42w4YgIDX6XWNn4o+ABI+2juOnQjEnYuvO9Cy4Wi1+Uf7+U13DD9mL1ZblKFQkMZH/
- g6JO/ZfqytdP4Yr19NE98dGhS/2nTxqLgBR/duAINRwBDo9mVjDX4eO/NGxTwt5jZ/Jv
- wNXqu5qv32Tl2Co1ygvyZ2P95w/kivXqhRPpKdsiVi2aNXW8IwJSw182dif6CFA8DjAa
- MszWEeY6FgdHQjHn5MVrdx+XVhDz+Pev/wm9Y2vlKCjrACH/JRaSXLFCjTU/53hawqaw
- IH+fSeNGo4MUfX7gADUaASEePXz8g8JiEvdl5BTcevgcpjrqGkgtR1DKab0cBYgka3XA
- QsIV69tXj+9ev3jy4K5YmPPw85zgaIsOUqPfNnYm9ggw7pHgEZYC+C0OXh+beuhU7nUo
- 5lRWw1TH3zDTIamstkmN0oL836+fDaTGSko6ORn7EmMIID0AkGZYYhV7iuD4NBcBaTzO
- C1obs2NfxtnLtx/RYg6Z6oCrVXZGsa1ylFyzMles3799ra589eReYe6pQ6mx6xGQmvuW
- sSddiYA0HgOC128HPOYV3n/6upIt5kiuVtsuR16QpMb6s5EA8sWj25fPZuzbEbM2aB4C
- UlfSBMepmQjI4HEZwWMmg8cPMPX49y+yEKDdeOQvWdmSztcaMuehAJB4m4dmvm/sRdwR
- EMw9gnukeDwsxGOHrlYpUBkxk5LOr79hzgMBKe6EwNFpMwLK8AhLATg8csWc9lytkvew
- cKWrAn58EwByu5SDREBqMw+wb3FEAPCo10ffkJl7ZPAo5R55PLZXjpwgm5rInEdj/acP
- 5S+KJQ4S5yDFkQc4ClFEQBEeSXGVw6NgrqP9emQJKQ9IpsQKj9Khc5AISFGkBA5CixGQ
- xiPMPcoUV1WBRyEgqYMEQHIlVlyko8UvH7sWWwQ4PA6lK1f5uUd5PHaAjhILqRiQszy5
- VawISLHlB45HsxEQ4HE8vzSHn3tUDR45QRIHSQBJHCQAUrJIZ9I4vM1Ds9879ibKCEjj
- kaxcZZbmcHiEuUe2uNoxPEquWMmiAGGJla5i5W/zQECKMk1wUBqKgASPNuS+R27lqhrw
- yAqSAhLuu2IAya9ixfsgNfSFYzdijgCPx1Fj4b5H9sYOunL1wydmaY6K8MgD8l8OkE/u
- Xc89eYgHpAV5UAACUsz5gmNTbwRk8Qj3PcKNHWrBIwdIskiHAJIs0oHbPI6nJW4Kg2c/
- 8oDs0V29nxlbxwiINQJkf7l+ZIcAIR4LmBs7yENzVOYeifvkVs3RG5PhNo/XFJDkPkj6
- oAAHGwSkWPMEx6WRCHB4tGDdI8HjSXLfI3tjB7kNmVFRR6s59P20KTrlIQ9IwZN0EJAa
- +fKxE9FFoHsPHo/TyVNzEtOOw2MB6H2PDB5ZPapEjgoBSR4UsE0CSPKwcr3/dsfdPESX
- Kjgg9UegW3dm5aqFjQN9qFzkNnhqDoPHauYhVirFI+8gufsgnzMOMmGT5FFzdDcPBKT6
- v3vsQXwRYPA4iLpHwGOoEI91wscCqAaP8g4SHhRAn6RDHjU3cyo8i9UCANlb7z8ISPEl
- C45I3RGAyQ5yY4eJFB4vsk/Noc94VDEeFQCSPEmHPGqOAHIieRbrIAPYDxIBqe7vHtsX
- XwTk8JjAuMfn5BHI6sCjUkDSZ7GSh5VbIyDFlyc4Io1EgOCxN4NH16kz4ZHkxD2qF48K
- AQnPYt2bQB9WDrt5WJoiIDXy7WMnYosAwWNfA+oeYccOcI8MHuGZq2rDoxQguUfNXb/I
- PqycBeTA/uggxZYrOB61R0CCR2vY0IriMUX9eFQCyGMEkEv8Ybsr2A8SAan27x47EF8E
- WDyaWo4cQ/EYnbD3eE4+eSS5GvEoB8i3r57Aw8oBkFsjmO2uwEEiIMWXLTgiNUeA4rH/
- QBMLHo/pJy5ev0v2l/v67TvsZ6Xy4iozayJcpMM+rDw/59je+Og1S8h+kBJA4poANWcA
- Ni+mCAjx6O2/JBTweEwDeJQGZP1XupvHNbLdFQtIewSkmNIEx6KZCEjjceHKiK0pgEfY
- 0IrgsV6NeJRykLCbB9mgFba7kgPkf3sgIDWTCtiLCCLQjSmuUvfoPXfJmuh4gseb6naP
- 5JJVcJsHt90VAeTOrbBhsu8UV3trc3SQIsgQHIIGI8Dj0R6KqwtXhhM8XmDw+EW9eJTo
- kezm0VBH9oMUAtKdc5AISA3mA3al3QjAjVZk7lEej2VVsDu5cEMrVS1dFbQjC8jSx3d5
- QE52QUBqNzewd41HgMOjuTXg0ZfgcafG8MhfsEoB8szRPfEbSYmVAeSAvr0QkBrPC+xQ
- OxGgeBxA8ehO3ONGcI9nwD0+K2O3Q5ZsaCXAmup+VQjIrPSdW8JXLPRFQGonJ7BXrUVA
- gEeXySwes4h7LH1brW73SFTN6ZEH5IOb+RSQqwPneLs7kzlIBKTW0gM71nAE5PG45yjg
- 8YGG8MgLEnbXoSXW0sdFVy8wgFxAADkCS6waTgnsTnsRkMbjghXhW3amaxKPvB4FgLwh
- AeQ0d2c7S1MjBKT2MgR71mQEeDw6u0+bE7h6Y7yG8cgLUgjI81npyeAgWUAawyrWnvig
- AE3mBfallQgAHnv27j/Q2HyEPbhHDo9Xi1j3+LfaVq4KCkJSDrKWzEE+kAbkcASkVpID
- O9V4BBg8Gpla2gnxeENz7lFY0mEBWVFaUnSVA+QM6iCNDRCQGs8N7FDjEZDHY3J61nmC
- xwpSXNUIHvkLVuogOUCePro7fgOUWKe5OdshIDWeGdihNiLA4XG4nbMbcY8bqHtk8Fir
- 7qU5/CUrd8UqBcjMA8mbwUEiILWRGNinNiLA4NGAcY8ziHtk8FiiUTwqBuSl00ekAdkH
- F+loI0ewT81FQB6Pu4+eztc4HnlBygNy+XwKSDN0kJpLC+xJOxGQxuP8FeGbkw9kgnvU
- NB55PXIO8g2UWAkg4zaEBM72cnOiDhIBqZ00wV41FAGCxz4DjEwl7jFu95HTlwCPb6o+
- atA9SkqsTU1/KCA/V1e8LCm6cp44yHU8IPv1wjlIDWUGdqOFCFA89jMwNiNzjzPmL5fg
- 8WVF9We2uMrsaMVXXtT1G1fRAUD+aKj9+A4BqYWEwC61GgEej05uXrMDQzZI8PhO03hk
- r1ilAHnnyrnMA0kcIK3AQSIgtZov2LlaI0DwCPuvSvC4bnPSgcxzV+6UaAGPUg6SB2T2
- kdS4KMZB2pI5SHSQas0IbFybEZDFY5QUHn/8+p9673uUvfKlV6wSQH6oeFnMADIGHKQP
- LNJBQGozWbBvdUdAgkcrcI8+85drF4+ygKyhDjIv+zABZMBsrwlOtsMQkOrOCWxfexGQ
- 4NGWcY9RcalHsmlx9V1NbYPG8ShxkL+ZEisHyP1JMeuWzfPxGDfaymwwOkjt5Qv2rNYI
- yOExJmk/cY/FLys+aLq4yly6Ckus32p5QG6PCmYBOcRIHx2kWrMCG9dWBDg8DrN1muA1
- OyAkanvq4ew8MveoJTxKAbKx/vOHcsZBAiDXIiC1lSbYr2YiwOJxsJnV6HEePvOWrZPg
- sRzw2Ag3dvxu0tTcI1fZkQfk/RvEQRJA+nkSBznEEAGpmfzAXjQbAYpHfaMhBI+efgHB
- UniE7ck1XFwVXLE2NREHyQHy8rnM/TsQkJpNDuxN0xGQxePamB2se9QeHqVLrMRBvn7K
- AnI9BaQjA0g9fBarptMF+1NzBBg8GgIeHSke1zPu8f7T1+AetYVHeQf5ovj25bMISDUn
- Azav7QgoxOPZy1Bc1SYeZQD5lQKyMO8UOMj1wYvBQSIgtZ042L9aIgB41OujL43HU3k3
- tI1HJYDM2AcOMoiZgxyKc5BqyQhsVIsRkMFjELjHfZlnL98ufqFdPMoBshIcZGHuqUOp
- sRSQ4x1taIkVHaQWkwe7VnkEpPG4OBjc46FTeYWAx8qar9pzj6TIyq5ilZRYqYMkgAwL
- 8veZBIt0EJAqTwdsULsR4PA4FOYeJ/n4UzxmiAKPzQNy1lQEpHYzB3tXRwQkeLRxHO85
- C/AYC3jMFQUeBYD8xcxBvngEJdaMfYkMIMeOQkCqIyWwTe1FQBaPYeAeCR4fse7xlxaW
- 5nBLdJQCcldsZPBiBKT2sgZ7VlcEhHicCniMFBMehYD82Vj/6X05ALIgJyNNFpA9uqsr
- PtguRkCDEeDxOGoscY9hMYn7MnIKKB4/wcpV7eJRASCf3CvMPXmQB6QFWcWKJVYNpgx2
- pcYIcHi0APfI4HGXeNwjX2L98/vfXxwgbxXkHE9L3BS21H/6JImDRECqMUmwaY1FoHsP
- 8tScwUOtWDxuSkxj8fge8PhT23jkAfnvP79+fPtaXfn6yb3rBJDbIlctAgfpYMMCsns3
- jcUMO8IIqCkCMnhcFRm76+DJ3Ov3nrBzj5rYYI6v3ij8jZmDZABZRx0kC8hQDpCDyIMC
- EJBqShFsVoMREOJxuv/SMMDj8ZyCW1Bc5fD4R9P3PcqKkrsPkgPkKwDkRSlAmhjq99bD
- /Vk1mDbYlXoi0K07s3LVwsYB3OOiVZHbAI8XKR6rydIcEeCRK7H+IZsHNBJAPn9EAZmw
- iQByInGQgwz6IiDVkyHYqiYjwOBxEHWPgMfQTQkMHp8DHuvAPUruQ5aFlib/VgLIlG0R
- qxbNnOoKDhIBqcmkwb7UFQGY7NDrrW9oAnh0JXiM4PD4qlI8eFQAyIe38qHEygJyzCgr
- UwSkulIE29VgBAge+xpQPE4ULR7lSqxvWQfJAHKKq4O1hcnA/uggNZg42JU6IkDx2J/B
- 45SZBI8pjHsUFx6VAPLY3oTo0CX+3hPHjLREQKojP7BNzUaAxaOp5agxFI/RCXuP5+Tf
- eigq90icqsBBfoc5SADk3esXT6SnbI1YuXAmAlKzWYO9qSkCDB4HmlhYO7iyeEw/QYqr
- r96KyT1KBNkkKLESB0kAuWbJXCEgcU2AmnIFm1V/BCR4HDlmorf/klDA4zFR4lEakPVf
- AJCP7167wAPSHh2k+tMFe1BvBKTxuHBlxNYUwOO1uxSP9d/FMffIzatwi3SYOciqsucP
- bxJAxksDEh/9qN6UwdbVGIFuTHHV1JLgce6SNdHxBI83xeceJRes/0c2MP/1XQDInVvD
- Vy70neJqb22OJVY15go2rfYIcHg0t7YH97hwZTjB44Vrdx+De/wiNjxKKjpkkU5D3ceq
- smcsIDcSB+nOlVgRkGrPG+xAPRGAleRk7pHg0V0Kj2VVn+oaRLI0h7tclXeQpYyDZAAJ
- +7MiINWTJtiqZiIgxONkX4LHnSLGI69HHpAPbuafObonXgDIAX17ISA1kz7Yi4ojQPE4
- gMfjRtY9Piur+iiFx//jGaXV34RzkMRBUkBmpe/cEr5igS8CUsXpgc1pNgICPLpweMwi
- 7rFUjO5RWNGRB+TqwDnT3J3JIh0EpGazCHtTVQR4PDqDewxcszF+z9Ez+TcfiBaP/BUr
- 3cCcArLo6gUBIEeYG8Mq1p54H6SqcgTb0VgEJHgcYQ94XLAifMvOdMBjEYtH2H+VvQ1Z
- LFerQEjuglUAyBuMg2QAaWdpaoSA1FgKYUcqjIAEj3bO7tPmBK7WATzygmQBWVH6uOjq
- +az0ZM5BIiBVmCHYlAYjAHjs2bv/QGNzKTxeFTUeeT1SQNaSOcgHDCA3EEC6OdsNR0Bq
- MImwK5VFgMGjkelwKTzeoO6xVjj3KKLLVcEVqwSQJTwgZ0CJFQBpgA5SZVmCDWkoAgwe
- DRg8ziDuMTk96zzBYwVZmiNK9yhXYuUAefro7ngEpIYyB7tRRwQEeHQj7nFD/G4orooe
- j/wVqxQgMw8kbw5fPh8BqY5UwTbVHwE5PG5OPpAJeCwROR55PXIO8g04yEunj+yO2xDC
- O8g+uEhH/TmEPaguAgrweOT0JR3AIyvIJnKbx9/kNo+KlyVFV84LAWlmbNAP5yBVlyvY
- ktojwOHRjBRXZ8xfHq4zeJQD5DshIGd7uTnREisCUu05hB2oLgIEj30G0OKqm9fswJAN
- cbsZPL6p+iji4iop6MgA8jMB5J0r5zIPJG1exzpIAsheuEhHdemCLak3AgSPsIOOsTQe
- rxSVvKyo/swWV7W9RQCjPUX/L1ik86Oh9iMPyKiQQAJIWzIHiYBUbwph6yqMAI9HJxk8
- vgM8/uAfSS6uuUdOnMyDO1gHKQNIH5iDtEJAqjBZsCl1R0CCRyvGPa7bnHQg89yVO7qB
- RykHCYCsYQCZfSQ1jgJyAgJS3QmE7as0AhI82jJ4jIpLPZJNiqtvdAKPsg7yQ8XLYuIg
- 9yfFgIP08SCAHIwOUqUpg42pLwJSePSZv3xdDIPHYp1wj+SiVdpBMoDMyz6cuj0qJGC2
- FwBymKmRPjpI9aUQtqzCCAjwOMFrdkAI4PFwdh7FY40OuEeJIJuafsMcZGP95w/lPCCX
- zfPxGDcaAanCfMGm1BoBFo+DzaxGj/PwmbcM8LifuEfA4wemuPq7SbzFVaamIwTkN9ZB
- MoAMDvDzJIAcYoiAVGsaYeMqigDFo77RkGG2TgSPwVHbBXiE/Vcl+z2Ks7gqEKQ8IHfE
- rEVAqihPsBmNREAWj2sleCwHPDbCjR3ix6O0gySAfP30/g0KyPUUkI4MIPXwUXMaySns
- pP0RYPBoSPHo6RcQvJ7B4/1nr9/V1OoKHiUlVqGDvHw2cz8Csv2Zge/UQgTk8bgD3ONl
- cI+6hEcZQH6lgCzMOwUlVgSkFrIKu2xvBACPen30CR4dJwjx+FS38CgPyBfFty+fzdgH
- gAxiSqxDcQ6yvUmC79NUBBTgcV/m2cu3i1/oFh7lAFkJDrIw99Sh1Nj1wYv9PMc72tAS
- KzpITWUW9tOeCEjjcTFxj4dO5RXeJ3j8qjvuUdEcpASQYUH+PpNgDhIB2Z4MwfdoMAIc
- Hocyc49Ba2N27MvQSTw2D8hZUxGQGkwr7KqdEZDg0cZxvKcf4DEW8JhL8Fipa3gUOMhf
- zCKdF4+og0yMoYAcOwoB2c4swbdpKAJCPE7y8Q8K02E8KgXkrtjI4MUISA2lFHbTgQgI
- 8Th11uLgSF3GowwgP70vB0AW5GSkyQKyR/cOhAzfihFQVwR4PI4ay+AxcV9GzuXbj6C4
- +gmW5vzSiaU5zII5SUUHNjCHR839+Pa1pvL1k3uFuScP8oC0IKtYscSqrnzCdjsWAQ6P
- FuAeGTzu0l33KBEk6PHfXz8b6zlAHk9L3BS21H/6JImDREB2LG/w3eqJQPce5Kk5g4da
- SfCYlpFTQPD4HvD4U9fwyDvIf/8hgKwmgLxOALktctUicJAONiwgu3dTT0CxVYxA+yOg
- AI8HT+Zev/dEF4urzFUr8yQdBpB1AMjnj24V5BBAhnKAHEQeFICAbH/W4DvVFQEhHqf7
- Lw3blJh2PKfglgCP7IaPvEMT+2/cfZAcIF8BIC9KAdLEUL+3Hu7Pqq6cwnbbHYFu3enK
- VRMLGwdwj4tWRW7bdfDkRYrHarI0R4z7r7b47wEHyP+BgxQAMoECciJxkIMM+iIg2500
- +Ea1RYDB4yDqHgGPoZsSGDw+B/dYB+5Rch9yiyIQ0QlKAJmyLWLVoplTXcFBmhj2R0Cq
- Lamw4fZGACY79HrrGxI8uhI8RnB4fFWpu3jk5iDJlAcLyIe38sFBsoAcM8rKFAHZ3pTB
- 96kxAgSPfQ0oHid2GjzKlVjfsg6SAeQUVwdrC5OBCEg15hU23a4IUDz2H2hiYe3gOmUm
- wWMK4x51G49KAHlsb0J06BJ/74ljRloiINuVMPgmtUaAxaOp5cgxFI/RCXuP5+TfeqjT
- 7pEYWYGD/A5zkADIu9cvnkhP2RqxcuFMBKRakwobb28EFOAx/QQprr56q8vuUSJIumhO
- 4CCP7Y2PXrNkrhCQuCagvcmD71N5BIR49PZfEgp4PNYp8CgNSNif9e2rx3evXeABaW9t
- jg5S5fmEDXYoAjwe7cE9LlwZsTUF8HjtLsVj/XfdnHvkpl0Ec5ANdZ+qyp4/vJmfIwdI
- fPRjhzII36zKCMBSOVJcpe7Re+6SNdHxBI83dd89Si5Y4TYPWKRDNjDnALlza/jKhb5T
- XBGQqswkbEsFEeDwaG4NePRduDKc4PHCtbuPwT1+0XU8Sio6ZA6yoe5jVdkzFpAbiYN0
- pyXWAX17ISBVkEnYhCoiIMCjuxQey6o+1TXo6NIc7nJV3kGWEgeZlc4AEvZnRQepiiTC
- NlQVASEeJ1M87uxEeOT1yAPywc38M0f3xDOAdCZzkAhIVWUTttPRCFA8DqDukeJxY/ye
- Y2fAPT4rq/oohUcx76DD41D+N+EcJHGQHCC3hK9Y4IuA7Gj+4PtVGgEBHl0AjyvCt+xM
- zyLusbQzuEdhRUcekKsD50xzR0CqNJ+wsY5FgMejs7v3nMA1gMejgMcHnQaP/BUr7M9K
- S6ylj4uuEgfJAXKEuTGsYu2J90F2LJPw3SqIAOCxZ+/+A43NR9gDHhdweCxi8QgbzLG3
- Ievq1SoQkrtgpYCsJSXWBzcYB8kA0m64qRE6SBUkEzbR4QgweDQytbRzdp82J3B1J8Qj
- L0gWkBUEkOez0pMJIGeAg0RAdjiPsAGVREAxHq92KjzyepQD5AYCSDdnBKRKkgkb6XAE
- ODwOt3N24/F4g7rHWuHcow5frgquWCWALAFAZkoB0gAdZIezCRvoYAQYPBow7nEGcY/J
- 6VnnrxaVlFaQpTmdwj3KlVg5B3n6yO54BGQHMwjfrsoIyOJxQ/zuo6fzOx0e+StWaUAe
- SN4cvnw+dZBmxghIVWYWttWOCMjhcXPygcxOiEdej5yDfAMl1ksAyLgNIYFzvFgH2QdX
- sbYjifAtKosAwWOfAUamnHvcELf7yOlLnRCPrCCbyG0edA6y4mVJ0ZXzmdKA7IdzkCpL
- LWyo7RGgeOxnYGxG5h5nzF8ezuHxZedyjwoc5DshIGd7uTnREisCsu1JhO9QWQR4PDq5
- ec0ODJHg8c27j52ouErkKAPIz9UAyDtXzmUeSNq8jnGQVuAgYfMAXKSjsvTChtoWAYJH
- 2EFHgsd1BI/nrhSVAB4/s8XVJrq2hclo3f5/wSKdHw21HzlApsZFhQQSQNqSRToIyLal
- EJ6twgjI4jGKc48Ujz/4R5Lr9twj988IFSTnIAkgixlAxgAgfWCRDgJShbmFTbU5AhI8
- WoF79Jm/fN3mJILHO50Tj1IlVgBkDQPI7MMEkAGzvSYgINucQfgGVUZAgkdbpwnEPUbF
- pR7JJsXVN+9qahs6HR4lDvI3LbF+/sACcn9SzLpl83w8xo22MhuMDlKVGYZttSECLB4H
- mwEePQgeY5L2EzwWv6z40PncI7loFTrIbywg8wCQ26OCGUAOG2Kkjw6yDTmEp6ouAhSP
- +kamwygeA0Kitqcezs7rxHiUAmRj/ecP5YyDBECuRUCqLrGwpfZEgMfj6HEePvOWSeOx
- EVau/m7qPMVVpqYjD8j7Nygg1wcH+HmCgxw2xBAB2Z5swvd0NAIMHg2HEDx6+gUES+ER
- 9l+V7PfYOYqrAkE2NREHyQHy8rnM/TsQkB1NJ3x/xyIgi8e1MTtY91gO7rFz4lHeQb5+
- KgVIRwaQevgs1o4lF767zREAPOr10Sd4dKR4XM+4x/tPX0NxtbPiUd5Bvii+ffls5j4E
- ZJsTCN+gyggoxOPZy1Bc7cx4lAHk15p3AMjCvFOHUrevD14MDhIBqcokw7ZaHQFFeDyV
- V9jZ8agEkBkEkEH+dA5yKM5BtjqL8EQVRYDD41ArWlwNAve4L/Ps5dvFLzo3HuUAWUkA
- mQuAjKWAHO9oQ0us6CBVlGjYTKsiIMDjeE+/xcHrY1MPncoleKys+dp53aNkUYCgxPri
- EThIAsgwAOQkWKSDgGxVCuFJqouAEI+TfPyDwgCPGV0Cj80AMjJ48aypCEjVZRm21NoI
- SPBo4zh+6qwuhUeBg/wFc5CfPpQDIAtyMvYlMoAcOwoB2do0wvNUEwEej6PGMnhMpHh8
- xLrHX51waQ6zHkBywQr7s8KTdH58+1rDOchdsRwgLcgiHXSQqsk1bKXlCMjiMTJ2V1dx
- jxJBEgf56ycA8j0LyLTETdRBSgDZo3vLkcQzMAIdj0D3HuSxAIOHWknwmJaRU3Ab8Pj+
- EyzN6dx4FDjIf1hAPrl3PffkQQRkxzMLW2hHBDg8WrDuEfB48GRu4b0uUFxlrlqZBwX8
- oYCso4C8VZBznAByqf/0SQSQg8h9kAjIdiQXvqXNERDicbr/0rBNiWnHeTz+7Ox45AH5
- LwVkdeVrAORFAOS2yFWLoMTqYGNhQh1k925tji2+ASPQxgh0686sXLWwcYDi6qJVDB6v
- 33vyurKazD12hg3m+OqNwt84QP4PHCQB5PNHFJAJm0IRkG3MJjy9oxFg8DiIukfAYyiD
- x1vUPdY1EjyyGz4qTOVOcZC7D5ID5CsOkBGrFs2c6soAsrcePvqxo7mG728xAjDZoddb
- 39BEgsdt4B4vAh5fdRk8cnOQZMpDASAnMg6yLzrIFpMJT+hwBAge+xpQPE6keEwg7vHW
- o+dQXCV4lNyH3ClIqORDKAFkyjYCyCmuDtYWJrCBOQKyw9mGDbQQAQEeXafOXLQqYltK
- 18OjAkA+vJWfc3xvQjRxkBPHjLQ0HWSAgGwhl/DljkeAxaOp1agxPB7zbz3sUniUK7G+
- pQ7yRDoAciUCsuNZhi20MgIUj/0HmlhYO7hOkcLj265SXGUuYeVKrASQxwggl8z1RkC2
- Mp3wtA5GgMOj5cgxE739l4RGJ+w9ltP18CgFyO/1X6vfvnp899pFAOTWiJULwUHao4Ps
- YKbh21sRAWk8LlwZsTUl/cTF63efvCJ4/N4V5h65Co88IG8SQMZHrxECEp9s1YqswlPa
- G4FuTHHVlOJx7pI10fFdFI8ygPzCAPLCifSdW8NXLvQlgDTHEmt70wzf17oI8Hi0B/fI
- 4vHCtbuPAY9f6rsUHqVKrA11n6rKnj8UANKdK7EiIFuXWnhWOyIAK8nJ3KMMHm8+fF5W
- 1XXmHqUuWOE+SFik871eFpCTEZDtyC98S5siwOHR3Brw6LtwZfjWneknuioehbvr/Gyo
- +1hV9gwAeebYnviNxEEygBzQtxcCsk05hie3PgIUjwMoHt29wT1upO7x5sNnZVUf6xq6
- yNIcDo/yDrIUSqwXstJ3bglfsdAX9mdFB9n61MIz2x4BAR5dJrN4zCJ4LO2C7hFkyS2a
- I6tYGUA+AEAeBUCuDpzj7e5MFukgINueZ/iO1kVAHo97jp7Jv/lADo+daQcdHofyv3GC
- pPuzgoMsfVzEAXIBAeQIc2NYxdoTb/NoXX7hWW2KgDQeF6wI37IzvSvjsQVATnN3trM0
- NUJAtinJ8ORWR4DHo7P7tDmBqzfGd3E88oIUAPLqecZBIiBbnVh4YnsiAHjs2bv/QGPz
- EfbgHjk8Xi1i3SPsv8rehtxVrlZlHWQtKbE+uCFxkNPcnO2GIyDbk2v4npYjwODRyNTS
- TohH2J5ctrjahfQoKemwgKwoLSkigEyGEuuCGYyDNEAH2XJy4RltjYA8HpPTs84TPFaQ
- pTldEo/8BSstsXKAPH10d/wGKLEiINuaZHh+qyPA4XG4nbMbcY8bqHtk8FgrnHvsSnjk
- BSkFyMwDyZvDV8xHQLY6u/DENkaAwaMB4x5nEPeYnJ4JeCzp0njk9SgE5KXTR3bHCQHZ
- BxfptDHd8PQWIiCPx91HTud3eTzyguQA+ZI4SArI5QwgzYwN+uEcZAvphS+3LQIcHs1I
- cXXG/OXhm5MPIB7JCgFuTQALyHdvoMTKADIkcLaXmxMtsSIg25ZueHYLESB47DPAyJS4
- R685gSEb4gCPlwCPb6o+dmH3KBFkE7nN4+/v9Z+rK16W3LlyjgBynQCQvXCRTgsZhi+3
- IQIUj/0MjKXxeKWo5CVfXG2ipCAZ2rV+BID80VD7kQdkFAKyDSmGp7YhAjwendy8Zgvx
- +K6r45G9YpUHZBIBpA/MQVoRB4mAbEO64anNR4DgETaYMzazYtzjus1JBzLPXblD8PiZ
- nXvsqniUcpAAyBoGkNlHUuMoICc42ZJFOuggm08xfLUNEZDg0ZbBY1RcKuseCR5/8I8k
- 71pzj9x1Ob1ilQDyQ8XLYuIg9yfFEEB6EEAORkC2Id3w1OYjIIVHn/nL18UweCxGPFJJ
- SjtIBpB52YdTt0eFBMz2AkAOMzXSR0A2n2T4aqsjIMDjBK/ZASGAx8PZtLj6rgbxCJJk
- AfkbSqyN9Z8/lPOAXDbPx2PcaARkq3MNT2wxAiweB5tZjR7n4TNvGeBxP3GPgMcPjHv8
- 3dR13SMhpBCQ31gHyQAyOMDPkwByCOzPiot0Wkw1PKEVEaB41DcaMszWieAxOGo74DGP
- zD0CHmH/VcmGVl3TPUoE2dQkC8gdMWsRkK3IMDylDRGQxeNaCR7LAY+NcGNHV8ejPCBf
- P71/gwJyPQWkIwNIPXzUXBvyDk9VHAEGj4YUj55+AcHrGTzef/Ya8UjYSH8UOMjLZzP3
- IyAV5xQebXcE5PG4A9zjZXCPiEdOjTKA/FrzDgBZmHcKSqwIyHZnHr5RUQQAj3p99Ake
- HScI8fgU8cjLUb7E+qL49uWzGfsAkEFMiXUozkEqSi881rYIcHgcyhZX18bs2Jd59vLt
- 4heIRzk9wuYBcJvHj29fayoJIHNPHUqNXR+82M9zvKMNLbGig2xb9uHZshGQxuNi4h4P
- ncorvE/w+BWLq7wkZR2kBJBhQf4+k2AOEgEpm1v4d5sjII1H/yCCxwzEIy9DyW9Sc5Ay
- gJw1FQHZ5tTDNyiIgASPNo7jPf0Aj7GAx1yCx0rEo0SL9BcJIH8xi3RePKIOMjGGAnLs
- KASkgvzCQ22KAI/HUeMm+fgHhbF4fITuUVqM8JcSQO6KjQxejIBsU9rhyUoiIMTj1FmL
- gyMRj3I6lByQAuSn9+UAyIKcjDRZQPboriTYeBgj0EIEmPseBw+1GjWWwWPivoycgtsE
- j59gac4vXJojUaMCQD65V5h78iAPSAuyihVLrC3kHL6sNAIcHi3APTJ43IXuUaBAmV8Z
- QP75/e+vn431HCCPpyVuClvqP32SxEEiIJUmHL7QbAS69yCPBWDwOB3c46bENBaP7wGP
- PxGP0oLkHCRsYA5zkNWVr5/cu04AuS1y1SJwkA42LCC7d2s26vgiRkBhBLp1Z5bmCPB4
- 8GTu9XtP2OLqP7+73g460gqU+UsIyDoA5PNHtwpyCCBDOUAOIg8KQEAqTDc82EIEGDwO
- ou5xuv9SgsfjOQW3wD2+/1RH8cjqUSYtu+yfsoB8BYC8SAAZQQDpCoA0MdTvrYf7s7aQ
- ePiyogjAZAdZuWpiYeMA7nHRqshtuw6evEjxWE2W5nTFDeZa+KeGAyRsYN4oAGQCBeRE
- 4iAHGfRFQCrKNjzWUgRk8Bi6KYHB43MWj5L7kFtI0i70shJAphBAzpzCALI/ArKlzMPX
- FUSA4LE3g0fXqTMXrYrg8PiqEvGo7N8YOUA+vJWfc3wvC8gxoyxNEZAKcg0PtRwBgse+
- BsQ9jpkI7pHD40PEozIxwnEZQL5lHGS6BJDWFiYDEZAtJx+eIRsBisf+A00srB1cp1A8
- pjDuEfHYjB7ZR82R265YB0kAeWxvQnToEn/viWNGIiBlEw3/blUEWDyaWo4cM9Eb8Bid
- sPd4Tv4txGNzapQC5HeYgwRA3r1+8UR6ytaIlQvBQdojIFuVfXiSTARk8LgyYmtK+glS
- XH31Ft1jc5JU6CCP7Y2PXrNkrhCQuCZAJuPwz+Yi0I1xjwwe5y4heDyGeGxOiOxrAgf5
- vf4LAPLx3WsXCCDDWUCao4NsLvHwNUUR4PFoD+5xIYvHa3cfEzzWf8e5R+XKFACyoe5T
- VdnzhzeJg2QA6c45SHz0o6K0w2NKIgAryUlxlcPjmuh4gsebD5+XMUtzcO5RqSCVAHIn
- AaTvZHCQCEglSYeHlUWAw6O5NeDRd+HK8K07009cYPD4BfGoVIvkBU6PdAPzuo9VZc9Y
- QG4kDpIB5IC+uHmAstzD4/IREODR3XvuEgken5VVfapr+MlvEdBsZnbRFzlBwm0e1EGW
- EgeZlc4C0gUBKZ9veKTZCAjw6DJZiMfSt9WIx5b+meH0yAPywc38M0f3xG9cEzjH292Z
- zEEiIJtNQHxRKgIUjwOoe6R43Bi/5+gZcI+Ax49SeOy6O+g0J0pOkLD9HAvIIgrILeEr
- FvjCBuYjqIPsibd5SCUd/qEsAjJ4XBG+ZWd6FnGPiMfmZCh5jdOjPCBXB86Z5u5sZwkb
- mKODVJZ+eFwmAjwend295wSuZvH4APEokVzzv3CCFADyKnGQPCCNYRUrAlIm7/BPhREA
- PPbs3X+gsfkIe3CPC1g8Xi1i8QgbzOFjAVqnRwrIWlJifXCDcZAEkG7OdsMRkApTDw8q
- iACDRyNTSztn92kSPML+q+gem5ch/6oMICtKHxddPZ+VnkwAOYM6SGMDBKSC3MNDchGQ
- x2NyetZ5gscKUlxFPPKyU/obp0cpQJ4+ujt+AwJSLuHwQLMR4PA43M7ZTRaPtcK5Ryyu
- KtWjZFEA6yArSksAkJkHkjcjIJtNPnxRNgIMHg0Y9ziDuEcGjyWIR+Xyk3tFESAvnT6y
- O04IyD64SEc2+/Bv2QjI4nFD/O6jp/MZ94h4lBOesgOcIOUBuXw+dZBmxgb9sMQqm334
- t0wEpPE4f3n45uQDmeAeEY/KlKf4OKdHzkG+gRIrA8iQwNlebk60xIqAlMk+/FM2AgSP
- fQYYmbLuMWRD3O4jpy8BHt9UfUQ8KtaewqNUkE1NfyggP1dXvCwpukId5DoBIHvhHKRs
- AuLfwghQPPYzMDYjc48zODxeKSp5icVVhbJTelAAyB8NtR/fISCFeYa/ty4CPB6d3Lxm
- Bwrw+A7xqFR7Cl+QB+SdK+cyDyRtZgFpRRwkArJ1edlFzyJ4hB10JHhcR9zjuSt3CB4/
- s3OPTTTRFKYgHhREQCEgs4+kxkUxDtKWLNJBB9lFlda6jy3Boy2DxyiJeyR4/MHf94hz
- jwLlKflVDpDFBJD7k2IAkD4eLvZWZoMRkK3Lyy56lgSPVuAefeYvXxeThHhUoraWD0sD
- soY6yLzsw6nbo0ICZntNcLIdZmqkj4DsolprzccW4HECcY9RcalHsmlx9V0N4rFlBcqc
- wQLyN5RYG+s/fyh/KQHksnk+HuNGIyBbk5Rd9xwWj4PNrEa7ePjMWwZ43E/cY/HLig/o
- HmXE1oo/hYD8VisEZHCAnycBJNnAHBfpdF3FNf/JKR71jUyH2ToBHgOCo7anHs7OI3OP
- gEfYYE7yUDl0j61QI5yiBJA7YtYiIJtPRXz1r78EeBwnjcdywGMj3NjxuwmLq61TInOW
- LCBfP71/gzrI9RSQjgwg9fBZrCg/BRFg8Gg4hODR0w/x2BblKTlXASAvn83cj4BUkH54
- SDoCsnhcG7ODdY+IRyVya/GwFCC/1rwDQBbmnYISKwJSOvnwL7kIAB7J9uSAR0eKx/WM
- e7z/9DW6xxaFp+wEWUC+KL4NgNwHgAxiSqxDcQ5SLhPxAERAIR7PXr5T/ALxqExtLR+X
- AWQlAWTuqUOpseuDF/t5jne0oSVWdJAoQdkISONxcTDB46m8QorHr1hcbVl6is9QCMgM
- AGRYkL/PJJiDREDKZiL+DRHg8DjUajQprgaBe9yXcfbybcSjYp219mhzgJw1FQGJ4lMc
- AQkebRzHe/oBHmNTD53KJXisrEE8tlZ9Cs6TAPIXs0jnxSNwkBn7EhlAjh2FgFSckF37
- qBCPk3z8g8IQjwq01Z5DSgC5KzYyeDECsmurTvmnF+Jx6qzFwZGIx/aIT9F7pAD56X05
- ALIgJyNNFpA9uiv/dvCVLhYBHo+jxjJ4TKTu8RFbXP2FS3MUSa1Vx+QBea8w9+RBHpAW
- ZBUrlli7mOSa/bgcHi3APTJ43IXusVVqa8VJPCB/NtZzgDyelrgpbKn/9EkSB4mAbDZF
- u9SL3XuQxwIMHmolwWNaRk7BbcDj+0/1jT8Rj62QndJTOEDC/qw/vn2trnz95N51Asht
- kasWgYN0sGEB2b1bl8o5/LBKI6AAjwdP5hbee4LFVaUqa8MLDCD//P7318/GOgrIWwU5
- BJChHCAHkQcFICCVJmgXe0GIx+n+S8M2JaYdzym4JcAju6NVG5IQT5VEQBaQrwCQFwkg
- IzhAmhjq99bD/Vm7mOyUfdxu3enKVRMLGwdwj4tWRW7bdfDkxesEj9Vk7hE3mJNIq32/
- cID8HwvI548oIBMoICcSBznIoC8CUll+drXjDB4HUfcIeAzdlMDg8Tm4xzrqHhGP7RMi
- +y4lgEwhgJw51RUcpIlhfwRkV9Odks8Lkx16vfUNCR5dp85ctCqCw+MrxGOHZMi/WQ6Q
- D2/l5xzfywJyzChLUwSkkuzseocJHvsaUDxOVIRHyWM6+PzC39oWARlAvmUcZDoDyCmu
- DtYWJrCBOTrIric++U9M8dh/oImFtYPrFIrHFMY9Ih7bJrrmzlYIyGN7E6JDl/h7Txwz
- EgEpn5hd9AiLR1PLkWMoHqMT9h7Pyb/1kHOPiMfmhNbK1wSA/A5zkADIu9cvnkhP2Rqx
- cuFMBGQXlZ6ijy2Dx5UR21LST5Di6qu3WFxtpdpacZoSQMZHr1kyVwhIXBOgKEm70DEh
- Hr3nLgkFPB5DPLZCYW07RQjI+i8AyMd3r10ggAyngLS3NkcH2YVUp/Sj8ni0B/e4cGXE
- VoLHa3cfEzzWf8e5x7bJTvnZ0oCsKnv+8GZ+zrG9DCDdOQeJj35Umqld4wVYKkeKq9Q9
- Ah7XRMcTPN5E96hcWe17RQkgdxJA+k52RUB2Db218Ck5PJpbAx59F64M37oz/cQFBo9f
- EI/tk57idwkA2VD3sarsGQvIjcRBMoAc0Bc3D2ghYTv5ywI8ukvhsazqU13DT36LAMU5
- hkdbHwFZQJYSB5mVzgLSBQHZyaXWmo8nxONkxGPrxdWOMzk9/oZVrAwgH9zMP3N0T/zG
- NYEASGcyB4mAbE3Wdt5zKB4HUPdI8bgxfs+xM+Aen5VVfZTCI+6g0w4FyryFEyRsP/ed
- lFhLHxdRQG4JX7HAd7KL/QgssXZepbXqkwnw6AJ4XBG+ZWd6FnGPpW+r0T3KyKnDf3J6
- lAfk6sA509yd7RCQrcraznsSj0dnd+85gasBj0cBjw8Qjx0Wn6IGOEEKAHmVOEgekMaw
- irUn3gfZeRXX7CcDPPbs3X+gsfkI2J7cdwGHxyIWj7DBHHufFV6tKpJXm49xeqSArCUl
- 1gc3GAfJAnK4qRE6yGZTtlO/yODRyNTSztl9GuKxzfpq8xs4QbKArAAHefV8VnoyAeQM
- 6iCNDRCQnVpzzXw4eTwmp2edv4p4bLPOWvsGTo8ygNwdv4EA0s3ZDgHZTL529pc4PA63
- c3bj8Qjbk0NxtVY494iXq60VXEvncYKUALIEAJmZnrwZAdnZ1dbi52PwaMC4xxnEPTJ4
- LCmtIMVVdI8tiasdr3N6FALy0ukj0oDsg4t0WkzeTniCLB43xO8+ejof8dgOmbX+LZwg
- pQF5AAC5fD51kGbGBv2wxNoJ5dbSR5LG4/wV4ZuTD2SCe0Q8tl5dbT+T0yMHyDdQYiWA
- jNsQEjjbi3WQCMiWkrcTvk7w2GeAkSnnHjfE7T5y+hLg8Q26x7brrNXvoIJsavpDAfm5
- uuJlSdGV85kAyHUCQPbCOchOqLhmPxLFYz8DYzMy9zhj/nIJHl+ie2y1uNpxogCQPxpq
- P76TAaQTLbEiIJvN3c74Io9HJzev2YEhPB7fYXG1HTpr9VvkAXnnyrnMA0kcIK2Ig0RA
- dkbNNfOZCB5hBx0JHtcR93juyp0SwONntrjaRFOn1YmGJ7YqAgoBmX0kNS6KOkgnWzIH
- iYBsJnc740uyeIySuEeCxx/8fY8499gqlbXhJDlAFhNA7k+KAQfpA4t0rMwGIyA7o+aa
- +UwSPFqBe/SZv3zd5iTEYxs01ZFTpQFZQx1kXvbh1O1RIQGzvSY42Q4zNdJHQDaTvZ3v
- JQkebZ0mEPcYFZd6JJsWV9/VIB47orZWvJcF5G8osTbWf/5Q8VICyGXzfDzGjUZAdj7B
- Nf+JWDwONrMa7eJB8BiTtJ+4x+KXFR/QPbZCUh06RQjIb7VCQAYH+HkSQJINzHGRTvM5
- 3JlepXjUNzIdRvEYEBK1PfVwdh6ZewQ8wgZzkkeSo3vskPKUvFkGkOUSQK5FQHYmmbX2
- swjwOM7DZ94yHo/lgMdGWLn6uwmLq0rEpILDsoB8/fT+Deog11NAOjKA1MNnsbY2oXX8
- PAaPhkMIHj39AoIRjyoQWVuaUADIy2cz9++IQUDquLTaM3xZPK6N2cG6R8RjW1TV/nMV
- ALIw7xSUWBGQ7UloHX8P4FGvjz7BoyPF43rGPd5/+hrdY/s11qZ3ygLyRfFtAOQ+AGQQ
- U2IdinOQOq6yVg9fIR7PXr5T/ALx2CZRdeBkKUB+rakEB1mYe+pQauz64MV+nuPRQbY6
- m3X/REV4PJVXSPH4FYurHVBZG96qEJAZFJD+PpNgDhIBqftKa9Un4PA41Go0Ka4GgXvc
- l3H28m3EYxvk1OFTmwPkrKnjHW3oHCSWWFuV0jp9kgSPNo7jPf0WB6+PTT10KpfgsbIG
- 8dhhobW2AQkgf9FFOuUvHoGDzNiXGBMWBIAcOwoBqdMqa/XghXic5OMfFIZ4bK2EVHqe
- EkDuio0MXoyAbHU66/yJQjxOnYV4VKnI2tKYFCA/vSeALMiRB2SP7jqfcvgBlEeAx+Oo
- sQweE6l7fMQWV3/h0py2iKoD58oD8l5h7slDPCAtyCpWdJDKc7kzvMLh0QLcI8FjZOwu
- dI8dUFUH3soD8mdjPQfI42mJm8KW+k/nHSQCsjPoTtln6N6DPBZg8FArCR7TMnIKbgMe
- 33+qb/yJeOyAwNr4Vg6Q//7z68e3r9WVr5/cu5578uCubZGrFoGDdLBhAdm9m7IvE4/r
- egQU4PHgydzCe0+wuNpGNangdAaQf37/++tnYx0A8vmjWwU5BJChHCAHkQcFICB1XXXK
- xy/E43T/pWGbEtOO5xTcEuCR3dFKBemGTbQQAVlAvgJAXpQCpImhfm893H5OeT7r+Cvd
- utOVqyYWNg7gHhetity26+DJi9cJHqvJ3CNuMNeChFT7MgdI2MBcCMgECsiJZA5ykEFf
- BKSOi66Z4TN4HETdI+AxdFMCg8fn4B7rqHtEPKpWcs22pgSQKdsiVi2aOdUVHKSJYX8E
- ZDMJrdsvwWSHXm99Q4JHV4LHCA6PrxCPzQpHXS/KAfLhrXxwkCwgx4yyMkVA6rbkmh09
- wWNfA4rHiYrwKHlMh7ryD9uVjoAMIN+yDpIB5BRXB2sLE9jAHB1ks1mtsy9SPPYfaGJh
- 7eA6ZSbBYwrjHhGP0jLR3F8KAXlsb0J06BJ/74ljRloiIHVWbi0OnMWjqeXIMRSP0Ql7
- j+fk33rIuUfEo+aEyPYkAOR3mIMEQN69fvFEesrWiJULZyIgW0xpXT5BAR7TT5Di6qu3
- WFzVuBKFgmz6Q7afY0qsxEEe2xsfvWbJXCEgcU2ALktP4diFePSeuyQU8HgM8agtIQr1
- +H9k+7lf3+u/ACAf3712gQAynALS3tocHaTCbNb5gzwe7cE9LlwZsTUF8Hjt7mOCx/rv
- OPeoHWUKHGRD3aeqsucPb/KAdOccJD76Uef1J/sBYKkcKa5S9wh4XBMdT/B4E92jdnTI
- 9Sp0kAJA7iSA9J3iioCUzeNO8jeHR3NrwKPvwpXhBI8XGDx+QTxy8tD8f6UA+bGq7BkL
- yI3EQTKAHNAXNw/oJDKUfAwBHt2l8FhW9amu4Se/RYDmM7Jr9ygLyFLiILPSGUDC9nPo
- ICU53Il+EeJxMsXjTsSjKP4h4PRISqwNdQSQD27mnzm6J37jmkAApDOZg0RAdiIp0o9C
- 8TiAukeKx43xe46dAff4rKzqoxQecQcdTauUEyRXYuUAuSV8xQJfAOQILLF2NjX+JcCj
- C+BxRfiWnelZxD2Wvq1G96hpBUr3x+lRHpCrA+dMc3e2s4QNzNFBdipN8nh0dveeE7gG
- 8HgU8PgA8SitDa38xQkS9melc5Clj4uuEgfJA9IYVrH2xPsgO40kAY89e/cfaGw+ArYn
- 913A4bGIxSNsMMfeZ4VXq1pQJKdHCsha6iBvMA6SBeRwBGSnkSL9IAwejUwt7Zzdp80J
- XI141ILslHfJCZIFZAUB5Pms9GQCyBnUQSIgO5Mg5fGYnJ51/iriUblENPoKp0cZQO6O
- 30AA6eZsh4DsTHL8i8PjcDtnNx6PsD05FFdrhXOPeLmqUR1KOuMEKQFkCQAyMz15Mw9I
- A3SQnUWTDB4NGPc4g7hHBo8lpRWkuIruUaILbf3C6VEIyEunj0gDsg8u0ukcipTF44b4
- 3UdP5yMetaU+Bf1ygpQG5AEA5PL51EGaGRv0wxJrp9CjNB7nLw/fnHwgE9wj4lGBMLR0
- iNMjB8g3zx7cIICM2xASONvLzYk6SARk59Aj3NjRZ4CRKeseQzbE7T5y+hLg8Q26Ry3J
- T75bKsgmch8kzEF+rq54WVJ05XwmAHKdAJC9cA5S9xVJ8djPwNiMzD3O4PB4pajkJbpH
- eV1o64gMIN8hIHVfeYo/AXGPDB6d3LxmBwrw+A6Lq9qSn3y/8oC8c+Vc5oEkDpBWxEEi
- IBXnuA4dJXiEHXQkeFxH3OO5K3cIHj+zxdUmmgzyOYJHNBcBASB/NNR+ZACZfSQ1Lopx
- kLZkDhIdpA4pT/FQZfEYJXGPBI8/+Psece5Rc+JT1JMcIIsJIPcnxYCD9PFwsbcyG4yA
- VJzjOnRUgkcrcI8+85ev25yEeFQkB60fkwZkDQVkXvbh1O1RIQGzvSY42Q4zNdJHQOqQ
- 9hQNVYJHW6cJxD1GxaUeyabF1Xc1iEeti1A4ABaQv6HE2lj/+UPFSwkgl83z8Rg3GgGp
- KMF16xiLx8FmVqNdPAgeY5L2E/dY/LLiA7pHoRq0/7sQkN9qhYAMDvDzJIAkG5jjIh3d
- UqD0aCke9Y1Mh1E8BoREbU89nJ1H5h4Bj7DBnOSR5OgeRSLIpiYOkOUSQK5FQEqnta7+
- JcDjOA+fect4PJYDHhth5ervJiyual+JzAhkAfn66f0b1EGup4B0ZACph89i1VU50hs7
- +ugbDiF49PQLCEY8ikV7Csch4yAJIC+fzdy/IwYBqbMSFA5cFo9rY3aw7hHxqFAQWj6o
- AJCFeaegxIqAFKa1zv4O7lGPwaMjxeN6xj3ef/oa3aOWpae4e1lAvii+DYDcB4AMYkqs
- Q3EOUmfVSB4qR5bmkOIqdY8Uj2cv3yl+gXhUrAdtH5UC5NeaSnCQhbmnDhFALvbzHI8O
- UnfFCCOXxuPiYILHU3mFFI9fsbiqbfEp6l8hIDMoIP19JsEcJAJSZyXJ4XEog8cgwOO+
- jLOXbyMeFSlBHMeUATIWADlr6nhHGzoHiSVWXRSlBI82juM9/QCPsamHTuUSPFbWIB7F
- oT+5UUgA+Ysu0il/8QgcZMa+xJiwIADk2FEISF2UIhmzEI+TfPyDwhCPctkvvgNKALkr
- NhIBqatKZMYtxOPUWYhH8WlP4YikAPnpPQFkQU5Gmiwge3TX7ezscqPn8ThqLIPHROoe
- H7HF1V+4NEehHrR9UB6Q96DEepAHpAVZxYoOUtcEzeHRAtwjwWNk7C50j9oWW2v65wH5
- s7GeA+TxtMRNYUv9p/MOEgGpW4rs3oPOPQ61kuAxLSOn4Dbg8f2n+safiMfWaEMb53CA
- hO3nfnz7Wl35+sm967knD+7aFrlqEZRYHWxYQHbvplsJ2bVHqwCPB0/mFt57gsVVbYis
- LX0ygPzz+99fPxvrKCBvFeQQQIZygBxEHhSAgNQlhQvxON1/adimxLTjOQW3BHhkd7Rq
- S6bguZqIgCwgXwEgLxJARnCANDHU762H28/pkB67dacrV00sbBzAPS5aFbltF+DxOsFj
- NZl7xA3mNKGsdvbBARI2MKeAfP6IAjKBAnIimYMcZNAXAalDcvyLweMg6h4Bj6GbEhg8
- Pgf3WEfdI+KxnWpR/9uUADKFAHLmVFdwkCaG/RGQOqRHmOzQ661vSPDoSvAYQfB4EfD4
- CvGofj11uAc5QD68lQ8OkgXkmFFWpghIHVLjXxSPfQ0oHicqwqPkMR0dTh1sQA0RkAHk
- W9ZBMoCc4upgbWECG5ijg9QVTVI89h9oYmHt4DplJsFjCuJRDbpRW5MKAXlsb0J06BJ/
- 74ljRloiIHVFi2ScxD0CHk0tR46heIxO2Hs8J//WQ849Ih7VpiTVNCwA5HeYgwRA3r1+
- 8UR6ytaIlQtnIiB1SYswVgV4TD9B3eNbLK6qRjDqbkUJIOOj1yyZKwQkrgnQAW0K8eg9
- d0ko4PEY4lHdElJp+0JA1n8BQD6+e+0CD0h7a3N0kDqgRDpEHo/24B4XrozYmgJ4vHb3
- 8SvAY/13nHtUqXLU1Jg0IKvKnj+8mZ9zbC8DSHfOQeKjH3VAlLBUTuIeAY9rouMJHm+i
- e1STdNTSrBJA7twavnKh72RXBKQOCJEZIodHc2vAo+/CleEEjxcYPH5BPKpFPWpoVADI
- hrqPVWXPWEBuJA6SAeSAvrh5gPhlKcCjuxQey6o+1TX85LcIUEMSYZMqi4AsIEuJg8xK
- ZwHpgoAUvxLpCIV4nEzxuBPxqDKVaK4hTo+/YRUrA8gHN/PPHN0Tv3FNIADSmcxBIiDF
- L0qKxwF07pHicWP8nmNnwD0+K6v6KIVH3EFHc+JqT0+cIGH7ue+kxFr6uIgCckv4igW+
- k13sR2CJVfxqlMw9gnt0ATyuCN+yMz2LuMfSt9XoHtujC229h9OjPCBXB86Z5u5sZwkb
- mKODFLkmeTw6u3vPCVwDeDwKeHyAeNSWrtrdLydIASCvEgfJA9IYVrH2xPsgRSxJcI89
- e/cfaGw+guBxAYfHIhaPsMEce58VXq22WyeaeiOnRwrIWlJifXCDcZAsIIcjIEUsRTo0
- Bo9GppZ2zu7T5gSuRjxqSj1q6IcTJAvICnCQV89npScTQM6gDhIBKW5ByuMxOT3r/FXE
- oxrUov4mOT3KAHJ3/AYCSDdnOwSkuOVI91/tO8DIdLidsxuPR9ieHIqrtcK5R7xcVb+c
- Ot4DJ0gJIEsAkJnpyZt5QBqggxSvJhk8GjDucQZxjwweS0orSHEV3WPHJaLRFjg9CgF5
- 6fQRaUD2wUU6YlUk5x45PG6I3330dD7iUaMiUmVnnCClAXkAALl8PnWQZsYG/bDEKlI9
- SuNx/vLwzckHMsE9Ih5VqRFNtsXpkQPkGyixEkDGbQgJnO3l5kQdJAJSrHqEGzv68O4x
- ZEPc7iOnLwEe36B71KSKVNgXFWRT0x8KyM/VFS9Liq6czwRArhMAshfOQYpRkRSP/QyM
- zcjc4wwOj1eKSl6ie1ShRDTalAwg3yEgxag8xWMi7pHBo5Ob1+xAAR7fYXFVoypSYWfy
- gLxz5VzmgSQOkFbEQSIgFStCq0cJHnsJ8LiOuMdzV+4QPH5mi6tN9OtVYbpgU2qOgACQ
- PxpqPzKAzD6SGhfFOEhbMgeJDlKrylPcuSweoyTukeDxB3/fI849qllDKm1eDpDFBJD7
- k2LAQfrAIh0rs8EISMWK0OpRCR6twD36zF++bnMS4lGlytBOY9KArKGAzMs+nLo9KiRg
- ttcEJ9thpkb6CEitak9R5xI82jpNIO4xKi71SDYtrr6rQTxqR0sq6ZUF5G8osTbWf/5Q
- 8VICyGXzfDzGjUZAKpKDto+xeBxsZjXaxYPgMSZpP3GPxS8rPqB7VIkwtNSIEJDfaoWA
- DA7w8ySAJBuY4yIdbStQun+KR30j02EUjwEhUdtTD2fnkblHwCNsMCd5JDm6Ry3pqt3d
- ygCynAXkjpi1CEhpEYjnLwEex3n4zFvG47Ec8NgIK1d/N2Fxtd2S0OobZQH5+un9G9RB
- rqeAdGQAqYfPYhWPHOmNHX30DYcQPHr6BQQjHrUqIdV2rgCQl89m7kdAikiA0kORxePa
- mB2se0Q8qlYb2mhNASAL805BiRUBKS0D0fwF7lGPwaMjxeN6xj3ef/oa3aM2FKTiPmUB
- +aL4NgByHwAyiCmxDsU5SNFoEQaiEI9nL98pfoF4VLE0tNKcFCC/1lSCgwRAHiKAXOzn
- OR4dpJjESPSoAI+n8gopHr9icVUrGlJppwoBmUEB6e8zCeYgEZAikiSHx6FWo0lxNQjc
- 476Ms5dvIx5VKgotNqYIkLkAyFgA5Kyp4x1t6BwklljFIUoJHm0cx3v6LQ5eH5t66FQu
- wWNlDeJRizJSXdcSQP6ii3TKXzwCB5mxLzEmLAgAOXYUAlIcUiSjEOJxko9/UBjiUXVC
- EElLSgEZiYAUjxKZkQjxOHUW4lEkElLtMKQA+ek9AWRBjjwge3QXW3Z2ufHweBw1lsFj
- InWPj9ji6i9cmqNaaWilNXlA3isEB7krlgOkBVnFig5S+/Ln8GgB7pHgMTJ2F7pHrWhG
- rZ3ygPzZWM8B8nha4qawpf7TeQeJgNS2Irv3II8FGDzUSoLHtIycgtuAx/ef6ht/Ih7V
- KhONNc4B8t9/fv349rW68vWTe9dzTx7ctS1y1SIosTrYsIDs3k3bCdm1+1eAx4Mncwvv
- PcHiqsa0opGOGED++f3vr5+NdRSQtwpyCCBDOUAOIg8KQEBq998DIR6n+y8N25SYdjyn
- 4JYAj+yOVhpJGuxEbRGQBeQrAORFAsgIDpAmhvq99XD7Oa3qsVt3unLVxMLGAdzjolWR
- 23YdPHnxOsFjNZl7xA3m1CYQTTfMARI2MKeAfP6IAjKBAnIimYMcZNAXAalVOf7F4HEQ
- dY+Ax9BNCQwen4N7rKPuEfGoaeGoqT8lgEwhgJw51RUcpIlhfwSkVvUIkx16vfUNCR5d
- p85ctCqCw+MrxKOaZKG9ZuUA+fBWPjhIFpBjRlmZIiC1qsa/KB77GlA8TlSER8ljOrSX
- RdizqiIgA8i3rINkADnF1cHawgQ2MEcHqT1NUjz2H2hiYe3gOoXiMYVxj4hHVYlATO0o
- BOSxvQnRoUv8vSeOGWmJgNSeFknPxD0CHk0tR46heIxO2Hs8J//WQ849Ih7FJKcOj0UA
- yO8wBwmAvHv94on0lK0RKxfOREBqV4vQuwweV0ZsS0k/QYqrr95icbXD2S/CBpQAMj56
- zZK5QkDimgCtaFOIR++5S0IBj8cQjyLUkaqGJARk/RcA5OO71y7wgLS3NkcHqRUl0k55
- PNqDe1y4MmIrweO1u48JHuu/49yjqmQgnnakAVlV9vzhzfycY3sZQLpzDhIf/agVUcJS
- OYl7BDyuiY4neLyJ7lE8+lH1SJQAcufW8JULfSe7IiC1IkSmUw6P5taAR9+FK8O37kw/
- cYHB4xfEo6qlII72BIBsqPtYVfaMBeRG4iAZQA7oi5sHaEOWAjy6S+GxrOpTXcNPfosA
- cWQSjkIVEZAFZClxkFnpLCBdEJDaUCLtU4jHyYhHVSS7DrTB6fE3rGJlAPngZv6Zo3vi
- N64JBEA6kzlIBKQ2REnxOIDOPVI8bozfc+wMuMdnZVUfpfCIO+jogM5aPUROkLD93HdS
- Yi19XEQBuSV8xQJf2J91BJZYtaFGydwjuEcXwOOK8C0707OIeyx9W43usdXprXMncnqU
- B+TqwDnT3J3tLGEDc3SQGtckj0dnd+85gasBj0cBjw8QjzonsbYNmBOkAJBXiYPkAWkM
- q1h74n2QGpUkuMeevfsPNDYfQfC4gMNjEYtH2GCOvc8Kr1bblu6iP5vTIwVkLSmxPrjB
- OEgWkMMRkBqVIu2MwaORqaWds/s0xKPoVaTCAXKCZAFZAQ7y6vms9GQCyBnUQRobICA1
- K0mFeDx/FfGowrwXa1OcHmUAuTt+AwGkm7MdAlKzYoTeODwOt3N24/EI25NDcbVWOPeI
- l6tilVX7x8UJUgLIEgBkZnryZgSkxoXIdMjg0YBxjzOIe0xOzwI8lpRWkOIqusf2J7sO
- vJPToxCQl04fkQZkH1ykozlxyuJxQ/zuo6fzEY86ICZVDJETpDQgDwAgl8+nDtLM2KAf
- llg1pkdpPM5fEb45+UAm4lEVqa4TbXB65AD5BkqsBJBxG0ICZ3u5OVEHiYDUnB7hxo4+
- A4xMOfe4IW73kdOXAI9v0D3qhKA6OkgqyKamPxSQn6srXpYUXTmfCYBcJwBkL5yD1Iwi
- KR77GRibkbnHGfOXS/D4Et1jRzNdN94vAOSPhtqP7xCQmlGe4l6Ie2Tw6OTmNTswhMfj
- Oyyu6oagOjpKeUDeuXIu80ASB0gr4iARkIr1o+KjBI+wg44Ej+uIezx35U4J4PEzW1xt
- ol9YR791fL9YI6AQkNlHUuOiGAdpS+Yg0UGqWHmKm5PFY5TEPRI8/uDve8S5R7HKqePj
- kgNkMQHk/qQYcJA+Hi72VmaDEZCK9aPioxI8WoF79Jm/fN3mJMRjxxNcx1qQBmQNdZB5
- 2YdTt0eFBMz2muBkO8zUSB8BqWLtKWpOgkdbpwnEPUbFpR7JpsXVdzWIRx2TVfuHywLy
- N5RYG+s/f6h4KQHksnk+HuNGIyAViUf1x1g8DjazGu3iQfAYk7SfuMfilxUf0D22P791
- 7Z1CQH6rFQIyOMDPkwCSbGCOi3RUr0DpFike9Y1Mh1E8BoREbU89nJ1H5h4Bj7DBnOSR
- 5OgedU1ibRuvDCDLJYBci4CUlow6/xLgcZyHz7xlPB7LAY+NsHL1dxMWV9uW2bp5tiwg
- Xz+9f4M6yPUUkI4MIPXwWazqlCO9saOPvuEQgkdPv4BgxKNuqkkFo1YAyMtnM/fviEFA
- qlWCwsZl8bg2ZgfrHhGPKkhxnWpCASAL805BiRUBKZSMWn8H96jH4NGR4nE94x7vP32N
- 7lGnxKSKwcoC8kXxbQDkPgBkEFNiHYpzkGpVI3moHFmaQ4qr1D1SPJ69fKf4BeJRFRmu
- W21IAfJrTSU4yMLcU4dSY9cHL/bzHI8OUr1ihNYV4fFUXiHF41csruqWnDo+WoWAzKCA
- 9PeZBHOQCEi1SpLD41AGj0GAx30ZZy/fRjx2PLd1sYXmADlr6nhHGzoHiSVWdYlSgkcb
- x/GefouD18emHjqVS/BYWYN41EVFdXDMEkD+oot0yl88AgeZsS8xJiwIADl2FAJSXVIk
- 7QrxOMnHPygM8djBfNb1tysB5K7YyODFCEh1apHqkSuuAh6nzkI86rqaVDB+KUB+ek8A
- WZCTkSYLyB7d1Z2bXbB9Ho+jxjJ4TKTu8RFbXP2FS3NUkOG61YQ8IO8V5p48yAPSgqxi
- RQepjn8uOPdoweIxMnYXukfdko/qR8sD8mdjPQfI42mJm8KW+k/nHSQCUvWK7N6Dzj0O
- tZLgMS0jp+A24PH9p/rGn4hH1We7+FvkAPnvP79+fPtaXfn6yb3rBJDbIlctAgfpYMMC
- sns31Sdk125RAR4PnswtvPcEi6vil436RsgA8s/vf3/9bKwDQD5/dKsghwAylAPkIPKg
- AASkqv/1EOJxuv/SsE2JacdzCm4J8MjuaKW+7x5bFl8EZAH5CgB5UQqQJob6vfVw+zkV
- 67Fbd7py1cTCxgGKq4tWRW7bdfDkxesEj9Vk7hE3mBOfVjQyIg6QsIG5EJAJFJATyRzk
- IIO+CEgVy/EvBo+DqHsEPIZuSmDw+BzcYx11j4hHjeS/2DpRAsiUbRGrFs2c6goO0sSw
- PwJSxXqEyQ693vqGBI+uBI8RHB5fIR7FphANj0cOkA9v5YODZAE5ZpSVKQJSxWr8i+Kx
- rwHF40RFeJQ8pkPDyYDdaT0CMoB8yzpIBpBTXB2sLUxgA3N0kKrUJMVj/4EmFtYOrlNm
- EjymMO4R8ah1PWh9AAoBeWxvQnToEn/viWNGWiIgValF0hZxj4BHU8uRYygeoxP2Hs/J
- v/WQc4+IR62rQnsDEADyO8xBAiDvXr94Ij1la8TKhTMRkKrWIrSnAI/pJ0hx9dVbLK5q
- Twhi6VkJIOOj1yyZKwQkrglQkTaFePT2XxIKeDyGeBSLHLQ+DiEg678AIB/fvXaBADKc
- AtLe2hwdpIqUSJvh8WgP7nHhyoitKQSPdxk8fse5R60rQssDEACyoe5TVdnzhzfzc47t
- ZQDpzjlIfPSjikQJS+Uk7tF77pI10fGIRy0rQFzdKwHkTgJI3ymuCEgVCZFphsOjuTXg
- 0XfhynCCxwvX7j4G9/ilHvEoLm1oZTRSgPxYVfaMBeRG4iAZQA7oi5sHqEaWAjy683i8
- +fB5WdWnuoaf/BYBWkkF7FQEEZAFZClxkFnpDCAnuyAgVaNE2ooQj5MpHnciHkWgATEN
- gdPjb1jF2lBHAPngZv6Zo3viN64JBEA6kzlIBKRqREnxOIDOPVI8bozfc+xM/s2Hz8qq
- PkrhEXfQEZNENDsWTpBwH+R3UmLlALklfMUCXwDkCCyxqkaNkrlHcI8ugMcV4Vt2pmcR
- 91iK7lGzOS/m3jg9ygNydeCcae7OdpawgTk6SBVoksejs7v3nMA1gMejgMcHiEcx60Pj
- Y+MECfuzsoAsukocJA9IY1jF2hPvg+ygJME99uzdf6Cx+QiCxwUcHotYPMIGc+x9Vni1
- qnENiKlDTo8UkLXUQd5gHCQLyOEIyA5Kkb6dwaORqaWds/u0OYGrEY9iUoGIxsIJkgVk
- Renjoqvns9KTCSBnUAeJgOy4IOXxmAzu8SriUURKEMdQOD3KAHJ3/AYCSDdnOwRkx+VI
- 91/tO8DIdLidsxuPR9ieHIqrtcK5R7xcFYcstDcKTpASQJYAIDPTkzfzgDRAB9kxTTJ4
- NGDc4wziHgGP568WlZRWkKU56B61l/6i65nToxCQl04fkQZkH1yk0xFFcu6Rw+OG+N1H
- T+cjHkUnBjEMiBOkNCAPACCXz6cO0szYoB+WWDugR2k8zl8Rvjn5QCbiUQzJL8IxcHrk
- APnm2YMbBJBxG0ICZ3u5OVEHiYDsiB7hxo4+Ave4IW73kdOXAI9v0D2KUBDaHhIVZFPT
- HwrIz9UVL0uKrpzPBECuEwCyF85BtleRFI/9DIzNyNzjjPnLJXh8ie5R27kvxv5lAPkO
- Adle5Sl+H3GPDB6d3LxmB4bweHyHxVUxCkLbY5IH5J0r5zIPJHGAtCIOEgGpWG0tHiV4
- 7CXA4zriHs9duVMCePzMFleb6Feg7TzA/sURAQEgfzTUfmQAmX0kNS6KcZC2ZA4SHWSL
- ylN8giweoyTukeDxB3/fI849ikMO2h+FHCCLCSD3J8WAg/TxcLG3MhuMgFSsthaPSvBo
- Be7RZ/7ydZuTEI/aT3lRj0AakDUUkHnZh1O3R4UEzPaa4GQ7zNRIHwHZovYUnSDBo63T
- BOIeo+JSj2TT4uq7GsSjqGWhvcGxgPwNJdbG+s8fKl5KALlsno/HuNEISEVSa80xFo+D
- zaxGu3gQPMYk7SfusfhlxQd0j9rLeHH3LATkt1ohIIMD/DwJIMkG5rhIpzUKlD6H4lHf
- yHQYxWNASNT21MPZeWTuEfAIG8xJHkmO7lHcEtHs6GQAWS4B5FoEpLTA2vaXAI/jPHzm
- LePxWA54bISVq7+bsLiq2VzXhd5kAfn66f0b1EGup4B0ZACph89ibZsc6Y0dffQNhxA8
- evoFBCMedUENIhijAkBePpu5f0cMArKNEhSeLovHtTE7WPeIeBRB0ot4CAoAWZh3Ckqs
- CEihwNr4O7hHPQaPjhSP6xn3eP/pa3SPIhaDGIYmC8gXxbcBkPsAkEFMiXUozkG2UY3k
- oXJkaQ4prlL3SPF49vKd4heIRzHkvJjHIAXIrzWV4CALc08dIoBc7Oc5Hh1kW8UI50vj
- cXEwweOpvEKKx69YXBWzHLQ/NoWAzKCA9PeZBHOQCMg2SpLD41AGj0GAx30ZZy/fRjxq
- P9vFPwJlgIwFQM6aOt7Rhs5BYom19aKU4NHGcbynH+AxNvXQqVyCx8oaxKP4FaHlEUoA
- +Ysu0il/8QgcZMa+xJiwIADk2FEIyNZLkZwpxOMkH/+gMMSjljNct7pXAshdsZEIyLYp
- kTlbiMepsxCPuqUGEYxWCpCf3hNAFuRkpMkCskf39mRnl3sPj8dRYxk8JlL3+Igtrv7C
- pTkiyHkxD0EekPegxHqQB6QFWcWKDrJ1/7RweLQA90jwGBm7C92jmNNffGPjAfmzsZ4D
- 5PG0xE1hS/2n8w4SAdkaRXbvQeceh1pJ8JiWkVNwG/D4/lN940/Eo/jyX2wj4gAJ28/9
- +Pa1uvL1k3vXc08e3LUtctUiKLE62LCA7N6tNQnZtc9RgMeDJ3ML7z3B4qrY0l6842EA
- +ef3v79+NtZRQN4qyCGADOUAOYg8KAAB2fK/NUI8TvdfGrYpMe14TsEtAR7ZHa3Emw04
- Mm1HQBaQrwCQ/7+9c3+oaev6+ME5HLdEKqko5VYpROVSoVCEKNcuRBclhVRUlFshVC7J
- raTcKUohSipKN1QKx3OO4/1H3jHnWmvvtXflnEN7t9daY/3wPJ7zPNaec6wxns/8jjnm
- HFcIIIM5QOqP0Bo4ANvP/WM89ulLK1f1jc0tQT2u9A3Ztf/omSs3CR4byN4jNpjrbV8X
- xO9zgIQG5hSQzx5RQMZSQDqQPciR2oMRkP8Yjr8weBxJ1SPgMWB7LIPHZ6AeW6l6RDwK
- IiJ6d5DdAHIfAeQiR1tQkPojhiIg/zEeYbNjwECtEQSPto6LVvoGc3h8gXjsXQ8X2K93
- AmTx3VxQkCwgbSaZGiAg/zEaf6F4HKxN8ejQFR5l13QIzD1wuGq2gBIgX7EKkgHkXFtL
- M2N9aGCOCvL7MUnxOHS4vrGZpe1cisd9jHpEPKrZnwX/c10C8uTB2PCA1R7zHWwmmiAg
- vx+L5L8l6hHwaGAy0YbiMTz24Kms3LvFnHpEPAo+TtQ1AR4gP8IeJACy8OaV0yn7dgb7
- eC5CQP5zLML/ogs8ppwmydUXrzC5qi5HFsvvdAPImPBNq5fyAYk1Ad3GJh+P8z1WBwAe
- TyIexRIgap4HH5Bt7wCQjwtvXJYD0sLMCBVkt5FI/ws5Hi1APXr6BO/cB3i8UUjx2PYR
- 9x7V7NEC/zlFQNZVPSu+k5t18qASIPHqx26DEkrlZOpx/tLVm8JjCB7voHoUeGD00vC7
- AWTCziAfz4VzbRGQ3QYi819weDQyAzwu9PQJIni8fKPwMajHd4jHXvJqAf8sD5DtrU11
- VWUsILcRBWlPU6zDBmPzgO7CkodHewU8VtU1t7Z/lrcIELCL4NDVaAFlQFYQBZmRwgBy
- znQEZHeRSP85H49zKB4TEI9q9F7x/RQXj1+hipUBZNGd3PMnDsRs2+QNgLQme5AIyO6C
- kuJxGN17pHjcFnPg5HlQj2VVdU0KeMQOOuILHdXMiAtIOAf5kaRYKx4XUEDuCNqwYiEA
- chymWLuLRtneI6jH6YDHDUE7ElIyiHqsQPWoGm8V/1u5eOwMyI3eS+bZW08wgQbmqCC7
- jEk5Hq3t5y/x3gh4PAF4LEI8ij9uVDZDLiChPysHyOtEQcoBqQdVrP3xHGSnkAT12H/g
- 0OF6RuMIHldweCxg8QgN5thzVrhaVZn3iu/FXDxSQLaQFGvRbUZBsoAci4DsFIr0HzB4
- 1DEwmWBtPw/xKL7Q6J0ZcQHJArIGFOT1Sxkp8QSQrlRBIiC7Csgu8XjpOuKxd9xYNL/K
- xaMSIJNiwggg7awnICC7Ckfaf3XwMB2DsROs7eR4hPbkkFxt4e894nJVNLGilolwASkD
- ZCkAMj0lPlIOSG1UkMoxyeBRm1GPrkQ9xqdkAB5LK2pIaQ6qR7X4rhh/hItHPiCvZqYq
- AnIQFukoRiSnHjk8hsUkncjMRTyKMULUPCcuIBUBmQyAXL+cKkhDPQSkYjTSDjoDh3J4
- XL4hKDI+OR3xqGbPFefPcfHIAfIlpFgJIKPD/L3dne2mUAWJgFSISILHQTz1GBadlJp5
- FfEozghR86xoQH779jcF5NuGmvLSgvxL6QDIQDkg4W5k3IOUhSRVj0O09QzJ3qPr8vUy
- PJajelSz84rw55QAWYuAlAVeN3+Q43GKnbO7t78Mjy9rMbkqwghR85Q6A/J+/sX05DgO
- kKagIBGQ8tgkePydh8dAoh4v5t8vBTy+ZZOr36hR1fwh8edEYQEeID+1tzQxgDyXmhgd
- yijI8WQPEhWkLCCV8RjKqUeKx0/yc4+49yiK+FD7JDoBsoQA8khcBChIFyjSMTXURUDK
- w5HDoymoR5fl6wMj4xCPavdZMf+gIiAbKSBzzh0ngPRyd545ZfwYBKQsHGlpDk2ujp8y
- k6jH0OjE1HMkufqytrGlHfEo5khR09xYQH6FFGtH29v6mnIZINctc5k9bTICkheODB51
- DQGPswkeI+KOEPVYUl5Tj+pRTQ4r8p/hA/JDixyQu0P9vNycCCBH6WihgqRBSdWjlo7B
- GIpHL//Q3YnHz+UgHkUeIuqdnhIgq2WA3IKAlKOR/IlNrgIeJ0+b7bJsnRyP1YDHDqhc
- /foNk6vq9V7x/ZoyICvLHt4mCnL3VhkgR2gNGoB3sTLqUWvEKIJHJzcvPwU8Qv9VWccO
- TK6KL0zUN6MuAJl3If3I3ggEpAIflfG4JWIvqx4Rj+rzVvH/UidAPn14K+esDJBWoCAR
- kGS52o+2Jwc8WlE8bmXU48OnlZBcRTyKP1DUNUNlQD4vuQeAPAyAXMukWEfjHmRn9Ujx
- eCEPkquIR3V5qjR+RwGQ7xtrKykgjxEFucrNaQYCki5bu8Lj2ZxbFI/vEY/SCBX1zLJL
- QKZRQHq4zII9SASkLLk6mkmurgU8Hk67kHev5DniUT1eKp1fUQLkawLI7LPHEqMAkIsB
- kOaoIOXq0dxqhpPbKr+tUYnHzmYTPL5uRDxKJ1bUMtNOgHwECjLt8J6IzWsBkFMnISC5
- 5CrB4ywXj7WbEY9q8Uxp/ki3gAwBQDoiIHnJVcCj42LEozTjRG2zlgHyC1SxNtdXP390
- 71pWZ0D266uwIyed/yDH46SpDB73UPX4iFWPX7A0R22+KoUf6gzIB0RB7o/iAGks7T1I
- WXKVxWNI1H5Uj1IIjN6aoxyQnwGQbxhAnjq0Z/vmNR4L5ApSqoDs249cC6A72lSGx0Np
- WdfuAR7fNLd1fEY89pbfivV3OUBC+7lPH943vK588uBm9pmjAEhfoiAtzVlA9u0jnUWq
- fKYcHo3leDx6JvvWgyeYXBVrQPT2vBhA/v31ry+fO1opIO9eyyKADOAAOZJcFCBNQPLx
- uMBjzebtew6dUsQj29Gqt78i/r5YLKAMyBcAyCsAyF0hvisZQOqP0Bo4QJJXP/bpSytX
- 9Y3NLSG5utI3ZNd+wONNgscGsveIDebEEgUaNA8OkNDAnALy2SMKyFg+IAdLE5AMHkdS
- 9Qh4DGDwePfRM1CPrVQ9Ih41yJPFMZRuALlvV7DvykWOtqAgpQpI2OwYMFBrBMGjLcFj
- MMHjFcDjC8SjOHxfI2fRCZDFPEA62EwyNRipLUlAEjwO1qZ4dKB4jCXqUY5H2Tlkjfys
- OCiBWkAJkK9YBckAcq6tpZmxPjQwl56CpHgcCng0s7Sdu4jgcR/iUaA+LqhhdwHI3KyT
- B2PDA1Z7zHewmWgiTUCyeDQwmWjD4vHgqazcu8WcekQ8CsrLhTNYHiA/wh4kALLw5pXT
- Kft2Bvt4LpIsIBk8DufjMeU0VY+vMLkqHOcW4ki7BeSm1Uv5gJRUTQAfj/M9VgeExx48
- iXgUonsLbsx8QLa9A0A+LrxxWQ5ICykqSDkeLUA9evoE79xH8Fj45AXB40fcexSclwto
- wIqArKt6VnyHKMiYcAVASurqxz5McpWqx/lLV28Kj0E8CsijhT3UbgCZsDPIx3PhXFsL
- MyOppVg5PBqZAR4XevoEETxevlH4GPD4rg3xKGx/1/jR8wDZ3tpUV1XGAnIbAaQ9TbEO
- G/y7hAAJleRk75Hg0V6OxzvFz6rqmlvbP8vvQNb4T4sDFKAFlAFZwShIBpDQfk5qgOTj
- cQ7FYwLiUYB+LdQhc/H4FapYGUAW3ck9f+JAjEQBSfE4TI7HbTEHILl6p7isqq5JAY/Y
- IkCoLq/Z4+YCEs5BfiQpVgrIjJSEHUEbViyUHCB5eJwOeNwQtDMhJYOoxwpUj5rtx2IZ
- HRePnQG50XvJPHtrUqQjHQUpx6O1/fwl3psAjyfO594pQjyKxd81fh5cQEJ/VhaQBdcv
- 8wA5zkgPqlj7S+IcJOCx/8Chw/WMxkF78oUrNgTtoHgsYPEIDebYc1a4WtV4vxbqALl4
- pIBsISnWotuMgmQAOcEEGphLJMXK4FHHwGSCtf28Jd4bEY9C9WoBj5sLSBaQNRWPC65f
- ykiJ5xSkdADZNR6vIx4F7N3CGzoXj50AGUYAaWc9YaxUAMnhcewEazs5HqE9OSRXW/h7
- j7hcFZ6bC2fEXEDKAFkKgExnAOkKKVYApLYUFCSDR21GPboS9RifknGJ4LGGlOagehSO
- Swt6pFw8KgAyMzUphg/IQeIv0lHGY1hM0onMXMSjoJ1biIPnAlIRkMnxkUHrl1NAGkoB
- kJ3wGBmfnA54LEU8CtGpBTxmLh45QL6EFOtVAGR0mL/3EmdWQYoekASPg4bpGHDqEfCY
- mnkV8Shgxxbq0GlAfvv2NwfI8tKC/EvpioAcIvI9SIrHIdp6hmTv0XX5+iDEo1DdWfDj
- VgJkLR+Q7s52U2iKVeSAlONxip2zu7d/WDSLx5eYXBW8gwttAgqAfNtQU156P/9ienJc
- ZCCjIE1BQULzABEX6RA8QgcdGR4DCR4v5heUltc0vGWTq9+omYT2bXG8wrMAD5Cf2lua
- OEAmRof6exNAjid7kKIGZPd4rIW9x0/yc4+49yg89xbeiDsBsoQBZAQA0gX2IMUOSBke
- TUE9uixfHxgZR/B4H/EoPF8Ww4gVAdnIAPLccQJIL3fnmVPGjxE3IGV4HD9lJlGPodGJ
- qedIcvUl4lEM/i24ObCA/EpTrG/ra8opII/ERQSuW+Yye9pkU0NdEStIFo+6hoDH2QSP
- EXFHCB5LymvqUT0KzplFMGA+ID+0MIDMAUDuDvVjATlKR0u0CpLiUUvHYAzFo5d/6O7E
- 4+dyKB4bUT2KwL2FNwUeIDva3tZXywC5RfyAlONx8rTZLsvWKeKxAypXv37D5KrwfFrI
- I+4MyIe3KSC3+nm5OREFOWqEWAHJ4HHEKIJHJzcvPwU8Qv9VWccOTK4K2cWFNfYuAJl3
- Mf3I3gjRA1IZj1si9rLqsRrUI+JRWH4sltEqA7LyqQIgrRhADhDhXayAxwGDtAgerSge
- tzLq8eHTytrGFsSjWBxcaPNQBuTzknt5F/iAHC3OFGuXeLyQB8lVxKPQfFhM41UA5PvG
- WgDkrZyzkGLd6rcKFKRoAdkVHs/m3EI8ism5hTiXLgGZdhgU5FoPugcpSkByeBxtSpOr
- a0E9Hk6/kHev5DniUYheLJ4xKwHyNQFk9tljiVEAyMVOM6zMaYpVbAqSh8cZTm6r/LZG
- JR47m03w+LrxPapH8bi38GbSCZCPQEESQG4GQM6aNslUhIDk43GWi8fazYDHNMSj8JxX
- hCPuFpAhAEhHcQJShkdzqxmOixGPInRr4U5JBsgvf3S0NddXPwdAZqUd3sMAcqockL+I
- 5ZHjcdJUBo97KB4fserxC5bmCNedBT/ybgC5P4oDpDEp0hGTglTGY0jUflSPgvdj0UxA
- DsjPAMg3BJDXstIO7dkOCnLBLBkg+/UVCx/7QnvyIdq6o01leDyUlnXtHuDxTTOU5iAe
- RePagpyIDJD/+/Lpw/vG15VPHtzMPnO0EyD79hFHQHJ4NGbVI+Dx6JnsWw8wuSpI9xXf
- oBlA/v31ry+fO1opIO9eyzpFALmGBeRIcg5SLIDk43GBx5rN2/ccOiXH42fEo/g8XFgz
- 4gAJ/VkBkA0UkFcAkLtCfFdCitXS3FifKEiR3GzVpy9TuWpsbgnJ1ZW+IbsIHm8+eFL5
- uoHsPWKDOWF5rwhHywESGphTQD57RAEZuz1AhIBk8DiSqkfAYwCDx7tUPbZ2EDyyDR9F
- +KFxSoKwgDIgX4CCBEDu2xXsu3KRoy0DyIHiACRsdgwYqDVCXwGPVwCPLxCPgnBWKQyy
- EyCLeYB0sJlkajBSe7A4FCTB42BtikcHisdYoh7vPnoGyVWCR9k5ZCl8d5yjZlrgu4Cc
- a2tpZqwPDczFAEiKx6EUj7aOi1b6Bu/ad/QM4lEz3VK6o+oCkLlZJw/GhoOCnO9gM9FE
- LIBk8WhgOslGjsfcu8WIR+k6vwbOXAmQr6iCPJ2yb2ewz8pFIgIkg8fh+sZmlrZzFfD4
- CpOrGuiXkh1S94BcvZQPSIHXBHB4NJlo4zDfY3VAeOzBk1mIR8m6vcZOnAfIj23vG169
- eFx44woDSE8ApIU4FKQiHj19gnfuSzl95WbhkxcEjx9x71Fj/VNyA1MEZF31s+I7REHG
- hG/iA1LgN1v1YZKrBhSPS1dvCo9BPErO04UxYQVAvmMAefl0SsLOIB/PhQSQRsJPsXJ4
- NDKzAPXI4vHyjcLHgMd3bYhHYXiqREbJA2R7a1NdVRkfkPZcilXQgIRKcrL3qITHO8XP
- qupw71Eibi6YaSoDsgIUpAyQ0H5O+IBUwONCT5+gnQkppxGPgvFQaQ2Ui8evUMUqA+T5
- EwdithEFyQBy2ODfBQxIisdhFI/280E9bqPq8U5xWVVdU2s7luZIy981frZcQMIxj49t
- oCApIDNSEnYEbfBcKAJA8vA4fQ6LxwyCxwpUjxrvnBIcIBePckAW3cmlgNzovWSevTUp
- 0hEyIOV4tAY8egMeD5w4n3unqBMesYOOBL1fA6fMBSTtz0oBWXD9MgPIFQSQ44z0oIq1
- v0DPQcrwOA7aky9csSFoR0IK4lED3RCHxFqAi0ceIG/zATnBBBqYC1ZByvA4wdp+3hLv
- jYhHdHwNtwAXkHxAXspIiQcFKXhAAh77Dxw6XM9IAY/XC1j1CP1X2WPIuFrVcC+VzvC4
- eKSAbCF7kEU8QNpZTxgrXEAyeNQxGKuAR2hPDsnVFn5yFeNROg6v6TPlApIFZE1FacF1
- DpCujILUFqaCVMCjK1GP8SkZlwgea0hpDuJR011TkuPj4lEBkJknkmLCSIpVyIDk4dGO
- qMewmCRIriIeJenmwpk0F5AKgExPjo8MWr9cyIBk8KjNqEcWj+mAx1LEo3CcU4Ij5eKR
- A+RLUJBXM1OTosP85YAcJLwinS7wmJqJeJSghwtsylxAcoAsLy3Iv8QHpKGe9hDB7UFy
- eDQkyVXX5euDIuOTEY8Cc01JDpeLRxaQtXxAujvbTaEpVsEBkuBx0DCaXLVzdvf2D4tO
- Ss28CurxJSZXJenmwpk0Dchv3/6mgHzbUFNeej//YnpyXGQgqyAJIH8XVpEOxeMQbT1F
- POYXlJbXNLxlk6vf6MSF851wpNKwAA+Qn9pbmuSADPX3JoAcT/YgBQZIOR6nKOGxFvce
- peHWwp1ld4CMAEC6wB6kqeAASfAIDeb0DE0Z9RgYGZecfjH/PuJRuF4qnZErArKRAeS5
- 1MRoCsiZAgSkDI/jGTyGRiey6pHg8ZP8SnIszZGOmwtnpoqArK8pLyEK8kgcBeRsAkhd
- QSlIBTy6LF8fGMHgsQTVo3CcUsIj7QqQOeeOJ+4O9fdydwZAjjHQ0RKQguThcaazu5c/
- 4PH4OZpcrW1EPErY0YUydRaQXyHF2tH2tr5aDsh1y1xmT5ssLECyeNQ1NJ08bbbLsnWA
- xyNEPQIe65nk6tdvmFwVim9KcZx8QH5oYRQkA0g/LzcnAshR0J9VKEU6FI9aOqPGjJ9C
- 8OgXuhvwmEP2HgGP0H9V1tAK1aMUnV0Ic+4GkHsjtggPkMp43CLDYzXgsQMOdiAeheCT
- Uh6jMiArnz68TQG5lQLSigHkAEFcNcfgcQTFo5Obl99WBo8PyyoRj1L2cUHNXRmQz0vu
- 511IPyJAQHbG415Qj3mgHhGPgnJJSQ9WAZDvG2sBkLdyzkKKVXCABDwOGKRF8Gg1k4/H
- p4hHSXu4wCbfGZD38i6kHQZArmVSrKOFsQfZBR4Pp1/Iu1fyHPEoMJeU9HCVAPmaADL7
- 7LHEqK1+q9ycZliZ0xSr5itIRTyuIurx2NmcWw8JHt9jclXSPi6oyXcLyM1rPVxmwR6k
- IADJ4XE03Xv0WLslYu/hNMSjoDwRB0ss8D1ALnYUCiBleDS3muHkBniMAjxmEzy+Rjyi
- owvJAjJAfmGKdJ4/ogpyTwQF5NRJQgAkH4+zXDzWbmbx+AjVo5BcEccKFugGkPujQvxW
- CQWQfDw6Ll7lF4J4RN8WqgXkgPzc0db8phoAeS0r7ZAyIPv1/UVjH+bco+5o00lTGTzu
- OZyWde0ewWMzlOZ8wdIcoTqnBMfdCZBPHtzKPnNUDkhjUsWqySlWDo/GoB4ZPO5H9ShB
- TxbJlBlA/v31ry88QJ46tGf75jUeC2bJFKTmArJvP3ItgByP2/ccYvH4BvD4GfEoEkeV
- yDQ4QEJ/1k8f3je8rnzy4CYB5K4Q35WgIC3NWUD27aOZC9Y+fZnSHBaPviFR+4+eyb75
- 4AmbXMUOOhJxZLFMkw/IVlCQzx7dvZZFABnAAXIkuShAUwHJx+MCjzWbAY+nsq7dBfXI
- 4ZHtaCWW74XzELcFlAH5AgB5hQAymADSFgCpP0Jr4AAN7c8Kmx2kclXf2NwS1ONK35Bd
- gMcrFI8NpDQH8Shu7xXh7DhA/gkKkgfIWApIB6IgR2oP1lRAMngcSZOrgMeA7bEMHp8B
- HltBPcrOIYvww+GURGmBbgC5jwBy0VwGkEM1FJAEjwMZPNo6LlrpG8zh8cVrxKMovVUC
- k+oEyOK7uVmnDrKAtJlkYqCxgCR4HKxN8eiAeJSAr0phikqAfMUoyBQZIM2M9YdrJiAp
- HocO1zc2s7SdS/G4j1GPiEcpOK5Y59glIE8ejA0PWO0x38FmosYCksWjgclEG4rH8NiD
- p7Jy7xajehSrq0piXjxAfoQ9SABk4c0rp1P27Qz28SQKUlMB2QUeU06T5OqLV6geJeG5
- Ip1kN4CMCd+0eikfkBpWE8DH4/ylqwMAjycRjyL1USlNiw/ItncAyMeFNy7LAWlhZqSJ
- ClKORwtQj54+wTv3AR5vFD4meGz7iHuPUnJhcc2VB8j21ua6qmfFd3KzTh5kAGnPKUgN
- u/oRKslJcpWqR8DjpvAYgsc7qB7F5ZtSnE03gEzYGeTjuXCOrUYCksOjkRngcaGnTxDB
- 42UGj+8Qj1J0Y9HMmYtH2sC8tamuqowF5DaiIBlADhusWc0DeHi0V8BjVV1zazuW5ojG
- OaU4ES4g4ZjHR6IgK4iCzEhhATldAwHJx+MciscExKMUXVeUc+biUQ7Ioju5508ciNm2
- yRsAaU32IDULkBSPw6h6pHjcFnPg5HlQj2VVdU0KeMQOOqL0WJFPigtIaD/HArKAAnJH
- 0IYVC6GB+TgNS7Hy8Dgd8LghaEdCSgZRjxWvGlA9itxZJTA9Lh47A3Kj95J59tYTNAyQ
- cjxa289f4r0R8HgC8FiEeJSAs0philxA8gB5nShIOSD1oIq1v4acgwQ89h84dLie0TgL
- wOMKDo8FLB6hwRx7DBlXq1JwXhHOkYtHCsgWkmItus0oSBaQYw10NEdBMnjUMTCZYG0/
- D/EoQn+U/JS4gGQBWVPxuOD6pYyUeAJIV6ogNQeQXeLx0nXEo+S9WDwG4OJRCZBJMWEE
- kHbWEzQIkBwex06wtpPjEdqTQ3K1hb/3iMtV8Tio1GbCBaQMkKUAyPSU+Eg5ILU1Q0Ey
- eNRm1KMrUY/xKRmAx9KKGpJcRfUoNdcV5Xy5eFQAZGaqBgJSGY9hMUknMnMRj6J0S+lO
- igtIRUAmAyDXL6cK0lBPIwDZCY+R8cnpiEfpOq5IZ87FIwfIl5BivQqAjA7z93Z3ZhXk
- oN6vYiV4HDRMx4BTj4DH1MyriEeRuqV0p0UD8tu3vykg3zbUlJcW5F9KVwTkkF7fg6R4
- HKKtZ0j2Hl2Xrw/i8FiO6lG6vivGmSsBslYJkFNoirXXASnH4xQ7Z3dv/7BoFo8vazG5
- Kka3lO6cOgPyfv7F9OS4yEBGQZqCgoTmAb1apEPwCB10ZHgMJHi8mF9QCnh8yyZXv9GJ
- SPc74szFYQEeID+1tzQxgDyXmhgdShXklPFkD7KXAfl9PH6SX0mOe4/icEopz6ITIEsY
- QEYAIF2gSKf3ASnDoymoR5fl6wMj4wge7yMepey3Yp27IiAbWUAeJ4D0cneeqQGAlOFx
- PKMeQ6MTU8+R5OrL2saWdsSjWD1TovNiAfmVSbHW15RTQB6Jiwhct8xl9rTJpoa6vaog
- O+ExIu4IwWNJeU09qkeJOq2Ip80H5IcWBpA5544n7g71YwA5ZpSOVi8qSIpHLR2DMeOn
- zHR29/IP3Z14/FwO4lHELintqfEA2dH2tr5aBsgtmgBIFo+6hqaTp812WbYuUAGPHVC5
- +vUbJlel7cHimr0yICvLHt7mAOnmBApyzKgRvQdIBo8jRhE8Orl5+SngEfqvyvo9YnJV
- XG4p3dl0Aci8i+lH9kZoACCV8bglYi+rHqtBPSIepeu14p15J0A+ZQG51c8LAGnFAHJA
- r1xWDngk7ckBj1YUj1sZ9fjwaSUkVxGP4nVKKc9MGZDPS+7lXUg/rAGA7BKPF/IguYp4
- lLLHinvuCoB831hb+fThrZyzxxJ3b/Vb1buA7AqPZ3NuIR7F7ZBSn12XgEwjgFzL7EGO
- 7p09SA6Po5nk6lpQj4fTL+TdK3mOeJS6z4p5/kqAfE0AmQ2AjKKAnGFlTlOs6leQinhc
- 5Qfq8RiDx9eN71E9itklpT23bgG5ea2Hyywo0ukVQPLxOMvFg+IxDfEobVeVxOy/B8jF
- jr0FSBkeza1mOC0GPEYBHrOJekQ8SsItpTtJGSC//NHR1lxf/fwRpFjTDu+JoICcOqk3
- ACnH46RpBI+bI/YcJnh8xKrHL1iaI12HFfnMuwHk/qgQv1UUkMakSEe9CpKPR0fAYwji
- UeReiNOTWUAOyM8AyDcEkNey0g4pA7Jf31/U9jDXAuiONp00VYbHrGsUj81QmoN4lH08
- /IPoLNAJkE8e3Mw+c7QXAcnh0RjUI4PH/ageRed3OKFuLMAA8u+vf33hAHn3WtapQ3u2
- b17jsWCWTEGqD5B9+5Fbcxg8LgD1uH3PoTQGj28Aj58Rj918SPzHorAAB0hoYP7pw/uG
- 15UsIHeF+K4EBWlpzirIvn3Us2Dt05epXGXx6BsStf/omeybD55Uvm4ge4/YYE4UboeT
- 6M4CHCD/BEC2goJ89ogCMnZ7AAfIkeSiAHUBksHjSKoeF3isIXg8lXXtLiRX3zS3Ujyy
- DR+7mw/+c7SAkC2gDMgXAMgroCB3BRNA2gIg9UdoDRygpqsfYbODHOzQNza3BPW40jdk
- F+DxCuJRyB6GY/9PFvguIB2IghypPVhdgFTCY8D2WAaPz1g8ys4h/6cp4v8YLSAYC3QD
- yH0EkIvmMoAcqiZAEjwOZPBo67hopW/wrn0MHl+gehSMQ+FAf84CnQBZfDc369TB2HCi
- IB1sJpkYqA2QBI+DtUcawN6jA6hHDo/FiMef+8T4twVkASVAvqIK8nSKDJBmxvrD1QNI
- isehw/WNzSxt5yIeBeRDONQetECXgDxJALnaY76DzUS1AZLDo8lEG4f5gMfw2IOnsnLv
- Ih578GPjqzTeAjxAfoQ9SABk4c0rAMidwT6eREGqC5BKePQB9ZhymiRXX7zCvUeN9yIc
- YI9ZoBtAxoRvWr2UD0gV1wQo4HHpaoLHk4jHHvvK+CKhWIAPyLZ3AMjHhTcuywFpYWak
- DgUpx6MFqEdPn+CdBI83Ch8TPLZ9xNIcobgTjvNnLcADZHtrc13Vs+I7uVknDzKAtOcU
- pIqvfoRKcppcpepx6epN4TEEj3dQPf7s18W/LzQLdAPIhJ1BPp4L59qqBZAcHo3MAI8L
- PX2CCB4vM3h8h3gUmkvheH/CAlw8foUq1vbWprqqMhaQ24iCZAA5bPDvKgUkD4/28/l4
- rKprbm3/LG8R8BPzxL+KFhCEBbiAhGMeH4mCrCAKMiOFAST0Z1W9guTjcQ7FYwLiURC+
- g4PseQtw8SgHZNGd3PMnDsRs2+QNgLQme5CqBSTF47CRBqAeKR63xRw4eR7UY1lVXZMC
- HrGDTs9/fnyjplmAC0g5IAsoIHcEbVixEAA5TsUpVh4epwMeNwTtSEjJIOqx4lUDqkdN
- 8xYcj6otwMVjZ0Bu9F4yz956gooBKcejtf38Jd6bAI8nAI9FiEdVf3l8v0ZagAtI2sCc
- KsiC60RBygGpB1Ws/VV0DlKGx3EWgMcVHB4LWDxC/1X2GDKuVjXSe3BQPW0BLh4pIFtI
- irXoNqMgZYDUUZ2CZPCoY2Aywdp+3hLvjYjHnv6++D6BWYALSBaQNRWPC65fykiJJ4B0
- pQpSdYAEPPYfOHS4npECHq8jHgXmQzjcnrMAF49KgEyKCSOAtLOeMNZAZYDk8DhWAY+3
- qXps4e894nK15z44vkmzLcAFpAyQpQDIdAVAaqtGQTJ41Gbw6ErUY3xKxiWCxxqSXEX1
- qNmOg6NTiQW4eFQAZGaqGgDJw6MdUY9hMUknMnMRjyr5zPhSoViAC0hFQCbHRwatX04V
- pKGeSgDZCY+R8cnpgMdSxKNQXAfHqQILcPHIAfIlpFivAiCjw/y93Z1ZBTmo56tYu8Bj
- auZVxKMKPjG+UkgWoAH57dvfFJBvG2rKSwvyL6UrAnJIj+9Bcng0JMlV1+Xrgzg8lqN6
- FJL34Fh72gJKgKxVAuQUmmLtcUASPA4apmMwdsIUO2d3b/+w6CQGjy/rmjC52tPfGN8n
- IAt0BuT9/IvpyXGRgYyCNAUFCc0DerRIh+AROujocXgMpHjMLygFPL5lk6vf6MAEZEgc
- KlqgByzAA+Sn9pYmOSBDqYKcMp7sQfYwILvHYy3g8ZP83CPuPfbAF8ZXCMoC3wOkCxTp
- 9DwgZXg0ZdRjYGRccvrF/PuIR0E5Dg5WJRZQBGQjA8hzqYnRFJAzVQBIGR7HM+oxNDox
- 9RxJrr6sbUQ8quQj40uFYwFFQNbXlJcQBXkkLgIUpMtsAkjdHlWQCnh0Wb4+MILBYwmq
- R+E4DY5UZRbgA/JDCwPInHPHE3eH+nu5OwMgxxjoaPWgguThcaazu5c/4PH4uRzEo8o+
- ML5YWBZgAfkV9iA72t7WV8sBuW6Zy+xpk3sWkCwedQ1NJ0+f7bJsHeDxCFGPgMd6Jrn6
- 9RsmV4XlQTjanrRA94D083JzIoAcNaLnAEnxqKUzasz4KQSPfqG7eXiE9uSyfo+YXO3J
- j4zvEo4FugHk3ogtPQ9IHh6nETxukeGxGvDYAQc7EI/C8RwcqSosoAzIyqcPb1MFuZUC
- 0ooB5IAeuYuVweMIikcnNxkeH9LkKuJRFZ8X3yk0CygD8nnJ/bwL6UdUAMjOeNwL6jEP
- 1CPiUWheg+NVlQW6AOStnLOQYu1xQAIeBwzSIni0mknwuJVRjw+fVsLeI+JRVR8Y3yss
- C3QG5L28C2mHAZBrmRTr6J7Zg+wSjxfy7pU8RzwKy2NwtKq0gAIg3ze+BgV5K/vsscSo
- rX6r3Jxm9JiC7AqPZ3NuUTy+Rzyq8hPju4Vkge8A0sNlFuxB9gggOTyONp1Mkqtrt0Ts
- PZyGeBSSo+BY1WKB7wFyMQDSnO5B/myKlYfHGU5uq/y2RiUeO5tN8Pi6EfGolg+NPyIM
- C8gA+YUp0nn+iCrIPRGb1xJATuoJQPLxOMvFY+1mxKMwnANHqXYLdAPI/VEhfqsWO/YM
- IGV4NLea4bgY8aj2j4w/KBwLKACyub4aAHktK+0wC8ipckD+8qOPHI+TpjJ43EPV4yM2
- ufoFS3OE4y44UhVboBMgnzwgKVY5II1JFevPKEhlPIZE7Uf1qOKviq8XrAXkgPzc0db8
- hgHkqUN7tm9eAwpSBsh+fX+Uj8ytObqjTXl4zLp2D/D4prmt4zPiUbCugwNXgQU4QEJ/
- 1k8f3je8rnzy4Gb2maMASF9GQbKA7NvnxwKSw6Mxqx4JHs9k33rwBJOrKvia+ErBW4AB
- 5N9f//rCAfLutSwCyIA1Hgt+HpB9+5FL5Rg8LvBYs3n7nkOnEI+C9xqcgKos0BUgrwAg
- d4X4roQUq6W5sT5RkD949WOfvkzlqrG5JUmu+gIej57Jvknw2ED2HrH/qqq+K75XoBbg
- APknALIVFOSzRxSQsXJAjiQ36fyYgmTwOJKqR8BjAIPHu1Q9tlL1yPZDFqjxcNhogR62
- gDIgX4CCpIAM9l25yNGWAeTAHwMkbHaQgx36DB5X+obsAjxeQTz28CfE14nJAp0AWcwD
- pANJsY7UHvxjgOyEx1iiHu8+egbJVYJH2TUdYrInzgUt8DMW6AaQ+3YRQM61tTQjCvKH
- AEnwOJDBo63jopW+wRweX6B6/Jkvhn9X1BboApC5WacOxoaTFKuDzSQTgx8EJMHjYG2q
- Hh2oemTwWIx4FLU/4eR+zgI8QH6EPchXVEGeTuEDcvjQHwCkDI9mlrZzKR73MeoR8fhz
- Hwz/trgt0CUgTxJArvaY72Az8QcByeLRwGSiDcVjeOzBU1m5dxGP4vYmnN3PWoAPyDYK
- yMIbVwCQO4N9PFkF+QOApHgcOlzfmMGjT/CufSmnSXL1xSvYe/yIe48/+9nw74vVAp0B
- eSc36+TBmPBNq5fyAfmfiub4eJzvsToA8HgS8ShWF8J59aAFFAD5DhTk48Ibl+WAtIAU
- 638GpCIePX2CdxI83iikeGxDPPbg58NXic0CPEC2tzbXVT0r7gqQ/+lu5D5McpWqx/lL
- V28KjyF4vIPqUWy+g/PpeQt0A8iEnUE+ngvn2lqYGf1XQMrxaAHJVRaPl28UPgb1+A7x
- 2POfEN8oIgtw8fgVqljbW5vqqspYQG4jCtKepliHDf79PwASDlqRvcfOeKyqa25tx9Ic
- ETkPTqXnLcAFJJyD/NgGCrKCKMiMFAaQ0MD8vwKSw6ORGeBxoadP0M6ElNOIx57/cPhG
- UVqAi0c5IIvu5J4/cSDmBwFJ8TiM4tGeqMdtMQdOngf1WFZV16SAR2wwJ0p/wkn9pAW4
- gFQG5I6gDZ4L/zMgeXicPofFYwbBYwWqx5/8UPjXJWEBLh67AKT30nn21qRI598ryC7w
- eALwWIR4lIQz4SR/3gJcQEIDc1ZBFlwnChIAuYIActx/SLEq4XFD0I6EFMTjz38jfIN0
- LMDFIw+QtxkFudF7CQBygomBzr8FpByP1vbzlnoT9Yh4lI4r4Ux7wgJcQLKArKl4XHD9
- kgIg9aBIp/+/uElHhsdxFqAeV7B4vF7AqkdoT87e0oHJnJ74cPgOUVqAi0cKyBayB1n0
- g4Bk8KhjYDIB8LjEeyODx9uoHkXpNzgpFVmAC0gZIEspIOOJgnSlClJP+98AEvDYf+DQ
- 4XpGMjzGp2RcInisIaU5iEcVfT98rbgswMWjAiAzYQ8yjChIO+sJY/+dgvweHlv4pTm4
- XBWXA+FsetYCXED+HCAZPGozeHQl6pHBYynisWc/F75N5Bbg4pEPyKuZJ5L+GyA5PI6d
- YG1H1GMYJFczcxn1iHgUuQvh9HrSAjQgv337WwGQ6cnxkUHrl1MFafjPCrIrPKaDekQ8
- 9uSXwndJwQJKgKx9CSnWq5mpSdFh/nIFOej7xzwIHgcN0zGQ4zHpROZVxKMU/Afn2MMW
- UADk24aacpJiJYAM/LeApHgcoq1nSJKrrsvXB0XGJyvj8Rv9mR4eOr4OLSA6C/AA+am9
- pUkBkO7OdlNoivW7gJTjcYqds7u3f1h0UirF48vaJlSPonMYnJBqLdAZkPfzL6Ynx3GA
- NAUFCd11ui3SIXiEBnN6hqYMHgMj4wCP+QWl5TUNb9m9R8Sjar8hvl08FugGkInRof7e
- BJDjx8Ae5HcASfGopWMwZjyDx9DoRB4eP8k7duDeo3icBmeiOgt0DcgjcRGB65a7zJ42
- 2dRQlwFk1/2S2fbkhqaTp812Wb4uMCLuSPrF/PuIR9V9MXyzmC2gCMhGRkGeO564O9TP
- y81pptX4MaNIf9ZubtLh+q+OGW8108nNyy90d+LxcyS5StUj4lHMnoNzU4kFFAFZX1Ne
- QhTkkb0RW9Yto4AcTQHZdX9Wcskj2558tsuydVsi9lI8lpTX1KN6VMnnwpeK3AJ8QH5o
- IYB8eDuHAHKr3yo3xxlW5gSQ3XTXgWwO12COtCf32wp4PJtz+yHgsbGlHfEoctfB6anC
- Aiwgv0KRTkfb2/rq8pJ7eRfSDu+N2LzWY8Esrj9rlwtWWirHXvK4wGPt5og9h9Mu5N0r
- eV6NeFTFp8J3SsACyoCsfPrwVvbZY/ujQmT9WZnmAZ0zOtxBK3LJIzSYg/bkx85m33r4
- tBLw+AHxKAHnwSn2vAWUAfn80b1rWacO7dkesIa9G7mbLQ+yXB0Emx1QKgfXdECLALY9
- OcVjB5x7/PoN9x57/nvhG8VtAQVAvm98Xfnkwc0rZ46S9nPMzVZMTUC/Tt2uyHIVsjlM
- LQActKIddEiDOaY9+Z9f8ZoOcXsOzk4lFlAAZPOb6mfFd2n7uW0boSZgJtQE0C2PX/sq
- L1iZ5eooY3Oy2QGlcswtVrSDThviUSWfCl8qAQsoApJtP5eRAlXlsOXRfUYHNh/hZAfT
- sgOyOVsiSKkcc4vVe1SPEvAbnKKKLMAHJGk/xxy7olsei+faWpoZwU1zv/dXXrAyy1Xm
- ZMdCT9+QKKgFyGFvser4/AXVo4q+Fr5W7BbgAxK668CxK1ITcBgyOqvJXeXklAfU6Cgv
- WKEYYODQEaOgdHUmnOwg2Ry62QGV5KTBHKpHsXsNzk9lFpABEtrPwbEruuVBMjpBG5gi
- VqjRge5zfRUzOiS7CgeRTSZNneXisS4Q7iQ/fQWyOZWvoRYA8aiyb4UvFr8FZIAk7eeg
- JoDJ6MBNc36rFjvSBSsUlSuXBIB8HAzZVXrLo6cv1OakwrU5xWXVb5rxkkfxuwzOUJUW
- YAD5N9xs9enDe9IOktwTAEWsZMFKjiWTmjklAUlqV4cO14fs6gwnd++NdLnKnOx4R7M5
- uPeoyg+G7xa1BThAkqI56JdMLtLJgRqdnUHrmQwrNLtSFpBEPmqNoMUA8z3WbImMp8tV
- WpvT/hlbBIjaXXByqraAHJB0wfr8EWxBnjgQvdVv5SJyVTmcgiQCkr8D2YfIx5EGzMnH
- DcG72JNWVWS5Ks/mqHrc+H60gBgtIAPkl8/sgpVmWMOhJMAJDnkY6w8HAakQj31/lcnH
- RSv9QqEhcta1e3DSqoEuV7E0R4xegnNSmwU4QNIFK8mw3rxyGkoCtpAaVtjxGDUCWnko
- 7EBCOgcuzqHy0Q3k454jUAxQ+PgFza7KlqtqGz7+EFpAVBZgAQkZHViwvqkmJQFwCnIX
- KyChGSQcglSOx6HDye6jHdSSb44g8hGOdsDFAK1QK4eV5KJyDpyM+i3AAvIvyLC+a6h+
- XgKHPE6CgPT1hJvKJ5uOpgkd3gYkm84xmWjjsMBjXdDO/cfoRR3Vb+BiAJCPeLBD/V8Q
- f1FMFuDi8X+f25kdj/yLaYdiyQ7kXFs2ocOv0IF4JGetTCeRi6w2BO9OhI7Idx/BUat3
- bZ++cA1YxWQfnAtaQK0WYALyKwhIUqLz5MGNyxnJe7dv9HajCR1yD6tiPJL06mjTydAS
- GaoBYg6eysqj98q9/0B2O+jL1Dp8/DG0gKgswMYjCEioKYdrdG5ln0mJh4oA6AUJZ66U
- E6yw3cFW58DVAH5hsYfgnscCLp3zFeNRVK6Bk+kNC5CA/PY3P6FzbN+OLWs9SIIVzkAO
- Vdjw6EO2O/QM4aoOx8Ve/ttIevVGIRSvknQOKx97Yw74m2gBsViAiUdI6DAlrHdyM0mC
- dZ3HAgebiWMNYMPjt37yggCIR9juMDK3pNVy2+OSSTE5VOdgPIrFHXAevWwBumD9+y+o
- CCAJVqjQOX8iMYq/4dFfOR5J9So9bAXbHWfgJquyl3W0OoepBujl6eDPowWEbQESkNCc
- lVTowL3IZMMjaXcwPXI1yZRsQPLjkZQDQDX5eCs75yWrAyISSDwWlVXx4lHYtsDRowV6
- 2wJ0wfqVxuOripL7eVmnDkSH+KxwnQN9PAxGag3iF+hw8QjlAEugHCDhKFyEDPHIbD9S
- Pvb2bPD30QICtwAE5DeIR7oBWXo/78Kpg7x4HNZdPJLyHIV4pNuPAjcFDh8t0OsWYOLx
- D148xmwlfGQLdLrhI8Zjr384HIAoLfBj8YjrVVE6A06q1y3wnfUqKWBV4CPsdyjlc+jd
- cvL8aq/PBgeAFhC2Bdh4pCcgO+dzFA5c0f3H7+53CNsUOHq0QG9bAMLx/779y/0O5XoA
- clsHd9wK63N6+0vi74vBAiQe2XqAGubGju/WA0C9nJGZ5QxHNy9/OI6ccfkGXPaI9Tli
- cAScgyZYgOIR4vFT27v66ufFUC+X+r16ObaeHFrNrYJ68sPpF6FXAL0egBxHJu/ShDnh
- GNACQrUAE49w5aPsgoBj+3cEMvXk5MIOxXryfsx5KwvZeasLcN6q4lXDe3q7HHkXBqRQ
- PQHHrQkW4OLxYxvTwwPOWyVEbKY3sHZx3grOI5Pr5bjzyEknsq7BeWTmOiv2PLImTArH
- gBYQpgUo0r59/ZPcwAoXWkETyIzkuO2b4IK5meSCOaXzyL+Q61ehW8BE6BawbF0QXPeY
- mXsHes2RTuVf/mSvlxOmIXDUaAENsACNx7/hfoD2lsbXL+gN5Ydjt/mTjgEW0OIKLmDl
- 3w/wCxSwkm460Bt5/lK4Djnh6Jls+QYk3p+jAR8UhyBkCzB4pOlVeryDlJMfjAn181wI
- FyKbQkcduKCcd58ViUdSEMAeuNq+N5lNsEI3HUjoICCF7As49t63ABuPNJ1DOurcyT2f
- mhglP24FDQMU73ukFwQYjbOwnbsYEqwx0G0O2neQhM4H6G6F8dj7XxRHIGAL0HCE0x3k
- ug4mnZNz9ug+kl5lrwdQbqjD9AugF1q5rvAJ2Z3Ev2COu/ARU6wCdgkcei9agFuuMvKR
- vV4uLiLAe4nzTHqdleJ2xy+/9Ok3gEno2JD2j0E79x1jTkDWNdMLkRGQvfgx8aeFbgEW
- j6QagN4OQE4/ph2KCaPpHNKxnDSAVOjfQS5E5i4oJzcExBEBWfiEaRggW7AiIIXuGTj+
- XrAAF45cuwAiH6E6Zze9HYCeftQerNSwvA9J6NCKObhhjghIuIGVbagDNyJju/Je+Ir4
- k2KxABePTP9HtmF5SsKOQOZ2OaZ9h0J69ZdfaIMrciPytDkgIIOjuIZzcIUOdPDgMjoI
- SLH4CM5DbRbgwlHWH7n0PtNuDqoBnGdajR8zavjQ3/mnH8m9j5DQIQJyLNmB9Fi7hV2w
- 0hJWyLBCRofp4YEBqbbPiD8kDgsw4Qh3IQMeaXcruttxIknejpXKR4XtDpLQkTcshyMe
- 22IOQgdI2sKDlOjIAYkBKQ4vwVmoywI8PH4mxTmQXSXdHxN2BK3rtl05xCMISNIywBRK
- ysmCddf+Y2fhDlbScq6lHbYguZoArCtX13fE3xGFBXh4hM1HOGsFd6/mZUFzq/BNsNtB
- mnfQbqxK8pEIyAGkxRWzYF2zOWLvEejhQXvqvGMBiStWUTgITkKdFpCFI6hHwGNT7Uto
- xpoDzVijQnxpsdw4ZrdDablKF6yw46FvbGZJM6yh0YmpmVdpDWtTKwBSnmLFFas6vyf+
- lqAtwIUjUY8Ej3A1Oc3mJMdFQC8dUpxjYjBy2GDYfeRXr9KETj+6YCUZ1tkuy9YHRsan
- ZFy6XlBaAYeuFAGJASloF8HBq88CbDhCMofisbWpror0Ks9MTYoO8/diej+OGgHNyhUO
- d9C+On3ognWEAfQsJ008Nm6LOQA1cwwgiYIkgGRXrBiQ6vui+EtCtgCHx7+/0uQq4LGi
- tOD6pYyU+B1B65e7zIZWAYa6UJyjvNtBIrIvZFihJMBwHM3obAjakcAHJOxBylM6GJBC
- dhIcu7oswIUjrFbhZAenHq+eP3EgZttGms2ZMNZAB852dF6uEgEJC1a4JMAEtiDnLfXe
- RABJFeTL2saWD59gzwMDUl0fEn9HBBaQLVaZ1WoHafxYXnI/n8HjBtIpwAKyOcOHDuzf
- eblKdjygJAAyOkZm9BYdHwJIkmIteV5dD1XlsGKFKh1uxYqEFIHD4BRUaQF+ONLV6vuG
- 15VPH1L1SPE4z96ay+Z0yq4yGZ3+sAUJgJxoA7cEEAWZlHou59bDJy9ekZTOHwoSEgNS
- ld8S3y14CyiGI12tvql+9uhe3oX05PjIoA0ryM0AZkb6gEfI5ihnV2k8Mhkd2PIggFyx
- ISgy7kgaFOkUQyPIppYPHxkJiYQUvKvgBFRvAS4cSWoVxONnWK1CMudx4c0rZ48lRoeB
- emTxCDfndJXNkWd0CCBBQS7x9g/dnXj0zGXY8yivftPc2s5KSFlAIiJV/1nxF4Rpgc7h
- +A5Wq7DXkZt16tDeiMD1y4l6JHjU6jqbwyxYf4ManRGMgnRdvm5LROxBktKhK9a3bbDp
- QXM6GJDC9BEctdoswIXjN4aOUEf+vrGuClar+RczUvbtCvHzcne2s54AtQBks6OrbA67
- YCVbHiTFOsXOyW2Vb/DO+OT0C9fuFJVVvgYJCTkdDEi1fVP8IaFagIvG/5OF44eWpjfV
- 5aUFN7LPHk+KCQ9Y4+EymyRXGTx2mc1hAfn7IC1IsY6bPG3WAo/Vm8KiE4+evpR/79Gz
- qtrGrgIS16xCdRoct6os0FU4NtfXVDyB3Or5k4f2Rgb5eC5ynGE1fizgEdRj19kcGSAH
- a+tAkY7VjLkLV6yHFeuB1HPZNwpg06Ou8T1HSN6+B573UNVnxfcK0gKyaOTRsbW5/tWL
- p0V3crPSkxN2bfXzXjLfYeokU0Oy9zjgt27xSGsCYA9SW2+06SQb+3nuq3yDdsQdPnX+
- 6q1CyOlwAfknKQyQi0hEpCD9BgetCgsoRCOpkvvyx8cPrc0NryCXczfvYsbRxOhtAWuW
- uUAyx3zMKB2oJP8OHmlNAOxBDhsxiux5zHbx8PbfuishOS0r9/aDxyQg37W1f4J9SBqQ
- GJGq+KD4TgFbQB6NFI5f//zfl88fP7QAHSvLiu/lXz5zPCl2+5b1sFqdOQWSObra/4BH
- Akgo0iEpnbHjrWznui5bG7Bt9/6U9Au5tx+SgISkTjsUBvzvz6+KiMRVq4C9CIfeIxbg
- BSOJRrrtSPYd2XC8f/3KudSDIB59V7nPc5g62dRIf4TWINh77LIWgKhH8vTpC1WskNLR
- MzSdaG3ntNhz/ZbwmMSjGTQgn1fXNrxt+QBpVopIhUUrjKZHZoUvQQsI0QKK0Ui3OWCt
- +qm97X3Tm5oXZcUkHE8eitsR4ue9lORWzcYY6MBex4Bfv6MemYD8lVmxQo51qgNISJ/A
- iJjEYyQgH5Q+f/m6vvk9XbP+jyxalSMSQ1KIroRj/kkL8GPx/4CNEI1UOX7u+ND6tqGu
- uuJp0b3r2ZknD8fv2rpxtYfrHFur8bLV6nfxyACSWbGOMQcJuWCJl29QRGwSDcjCkrLK
- mjeN71o/dICK5CKSpyPZgf3k9PCvowWEYgHFUGSCkaxU//cFlCPAsbnhdVX5k6K7+Vcy
- Tx5JiArdtHb5QseZ1hNJbpWsVrvf66DLVbpi/RVWrEO1dUebgIScAzkdPxKQR9Ozcm8W
- FD+tgDVr83smImlIUkrC/ycojwz/M1pAUhaAGADVSNAI0fgHicaWt41val4+K314J+/y
- uZOHE6LCAtatWOxkbzN5nBHNrf7japWuWPuRFSsjIafM4AIyEQIy58a9osfPX9bUQUS2
- fej4+PmPLyQk//oK2R180AIStwCEwV9//UnQ+McnEo3vmupfV1eUPSq8fe3SmROH40k4
- ero5O0wj4hEK5cjW4z+sVhkF2e+3Ab8PGQZ1rKaTrGfOdaWEjElMScu8knf7waOyiqpX
- bwgj29o7PpGQ/PK///0Jz1/4oAUkawESAf+DUAQyQjB+ADY21ddWVz57XHTvZu6F08cP
- xe8KC1jv6TZvFuw8jiVbHf9qtSoLSNj00BllPI4XkPuPnDx7MfcmILLsRTVEZNNbCMkP
- 7R0fP33+/AcJS3zQAhK2wB9/QCh++tjR3gZobG6sr615Wf4U4JiffT796IG9O0MJHSEc
- LcePHa07XItUAvxDbpUEI3ngpoD+REKONDAeN9mGEtI3MHx3wqHjGVnZ+bcLi588e1H1
- qraehGRLaxsEZXtHx0fyfMIHLSA5C1DX7+joaP/woa2t9T0EY8Ob19Uvy8tKHgIcL507
- lZIYGxmyce0KJhxNRuuNgMKcf7daZQKSSEheQLos9fLZHLZrb1JK2rmLuTfuFBY/Lqt4
- Wf2qrr6hsentu/cQla0Ql/igBSRrgdbWlpb37942NzVAMNZUvXj+tKTo/q287KyM1MP7
- YiKC/NesWEzpaGII4fhvxSMNR1oVAAGppa3LEHKOy5KV6zdtjYzZfzg14/zl3Jt3CotK
- y55DSNa8rn1T39DQ2NjU1AzPW3zQApKzAPH85qamxgYIxbraV9VVleVlTx49vH87P+fC
- 2VMpSXFR2wL9vJctcnaAxaqJoT4Tjv+81cEEI/lXUqYzAJKsEJBjQEPOmDPfbcUav6Dw
- qLiklJOns67k3rhd8PDR46fPyl+8rKquefX6dW1tXV3dG3zQAlK0APh+be3rVzXVEIsV
- z8uelBQV3r2Vl3PxXPoxgGPk1oANXh6uTvbTLGg4Qmr13+w8ysORF5BEQ06cYjtr3qJl
- 3j6bQyNjEg4ePXUm63Ju/q27BQ+LSx4/LXtWXvHiReXLly+ryFOND1pAQhagTl/18mVl
- 5YuK8ufPyp6UPip6cO/2jWvZF86lpx5J3LsrPMh/recSl7l2Uy3MTUZTOtJcTld3WPFj
- UOHPMkJCQJpOsJru4Oi6dOU6/6BtO2P3Hzp68nTmxezc67fu3Ct8WFT8qPTxkydPn5bh
- gxaQqgWePn3yuLTkUVHRg/t3b9/Iu3o562z68eSkuOiIrQE+3ssWz58zw2ay2ViSyqF0
- /Dc7j0oB+SuzZB05ysh0vMXUmXMWLF7mvWFT8PZde/YfTElNP5sFIZl3/ebtO3fvFxQ+
- ePDwYRE+aAFJWuDhw4cPCgvu37t7+9aN/Nycy1mZGaeOHUmMi44MDfRbu3Kpq5PD9CmT
- xo0x+OFwpLseEJCQZdXRNxxrNtnadpaT6xLP1b6bQ7bviklIOnL0RPqZzKxLV3Jyr+Xl
- X79x8+atW7fxQQtI0AK3bt26eePG9fxruVezL1/IOptx6njKwf17oyPDgvzXe3kAHGdO
- s5xgamygO/wH6UhQySxZISBH6EFWZ6LlNLs58xd5rFzjGxAcviN6774DR1JST6WfPpuZ
- lXXx0uXLV7Kzs3PwQQtIzgLg+FeuXL508ULW+XNnMtJOHEs+lBgfsysiNNB/vfdydxdH
- h+nWk81NDEeN1NYaTFI5/3mxyqxcSUDCtseQYcN1DYxMzSdbT3eYu2AxRKTPpqDQiJ3R
- exISDx5OOXr8xKm09PSM02fOnDmLD1pAchYAxz99OiM9Pe1k6rGU5ENJ++NioiK3BW/2
- WwfR6Oo8e+ZUy4njxozW14Fw/H3AD4cjJSQUBgwcoqU9Un80INLCxnaWI0Skp/d6v4Cg
- 0O2RUTF74vYlJh08dPhIcgo8R5nnGD6aaAH26+C/8S3wMx+KfQ/x/OTkI4cOHkjcn7A3
- ZvfOiG0hWzb6rFm1DKJxjt30KQBHIwPdEaRmdcBvP0pHdsn6a3/YiKRrViMTs0mWU2fM
- cpy/cMmyVavX+20KDA4Nj9ixa3d0TOyevXHx8fEJ8OzDBy0gGQsQj0+Ij4+L27snJmZ3
- 1M6I7WEhQZv9fdZ6e3osdiHRaG0xwRTgOJKRjr9BGcB/2uhglqrcv8KSlaRZyZoVEGls
- aj7Jaqqtwxxnl8VLl6/0XrvBzz9gS1BwSGjYtvDt2yO4JxIfTbQA93nw33kW+JkPJX/N
- 9vDwsNCtIUGBmzf5+axb7bXCw33hfMfZNBrHjTWkcOSk40+EIyxZGRE5kCBSd9ToMRCR
- ljbT7WY7znNZ5O6xfKWX95p1G3z8/Pw3bty0KQCezfigBaRkAeL0mzZt9Pfz8/VZv3a1
- 96oVy5a6uS5wmuMwY9oUiwnjYKmqp6M9bMjPrlVZRPaRIVJLW0d3lCFE5ESLKdNs7WbP
- dV7gsshticey5StWrvLy8oZnNT5oAclZgHi+t9eqlZ4rlnksdV/s6jLPcY7DzOk2lpNp
- NJKl6lACR1ir/ovzx9zStNt/pwHZ/3eyaNXW0Rs12tjEbMJkS+tp02c6zJ7j6DzfxcV1
- 4aLFbm7u7kvgWYoPWkBCFiA+v8Td3c1t8aKFri4L5jnNnTPLbsZ0GyuLieamY40MIBrp
- LgeTyPmptSoXoRwiYdEKEak7ysBorCmEpIWVzbTpM+zsZ82eM2euo6OTk7Oz8zx80AIS
- swC4vbOTk+PcOXNmz3Kwm2k7faq1pcXE8eNMjA0N9Eg0kqVqf7iboyfgyMRkn75MXodG
- 5IiRegajjceajhs/cbKF5RRriMrp021nzJg5c6YdPmgByVkAHH/GDFvb6dOnTbWZYmUx
- edIEM1OTMYYGo3R1ZNFIdjl6BI4sJGlEwtbHwEGwGzlcR1ffYLTRGIhJs/ETJk6abGFh
- YWlpZWU1BR+0gOQsAI5vZWkJMTB50sTx5uMgFoGMo/RGjtCmuhHY2NPRCEEJi1aGkb8P
- GjwUQhIoCTFpCEFpYmoKcWlmZm5uPh4ftIDkLACOb25mNm6cqanJ2DHGRqMNRunr6kAw
- wkJ1IFmpqiAaCSXZiKSQJCEJmBypq6c/ygDC0tDIyMgYnjH4oAUkZgHi98ZGRoaGo0cb
- QCjqQSwOBzIOgZQqKcdRUTSSiKS7kb/++huEJFByyFCtYRCUI3QgLHX19PT0uWcUPmgB
- aViAc3lwf13dkSMhEodr01gEMrJo7FndSMOQ9y8MJJmQBDEJQQlRCWFJn+H4oAWkaAHG
- /YcN09ICLA5mYpGsU3s4icOLQ94faUhCGR1gEjj5+8CBgwYNGjx48BD5MxQfTbSA/APh
- n2QW+JkPJXvJEIhCiMNBA4GKvw8Y0B9iEZapqiUjLyJh3UqyO/36wdr1t/79IS5JYOKD
- FpCyBSAKIBZ+I6FIY7Entzf4wdfdn2lQsmH5Kzy/4YMWkKgFiP+TOCSRCFjs0a3G7uKv
- m39Ofh0eGAc+aAHpWoAJA3VDsZugxH+MFkALoAXQAmgBtABaAC2AFkALoAXQAmgBtABa
- AC2AFkALoAXQAmgBtABaoFct8P/b5umcCmVuZHN0cmVhbQplbmRvYmoKMjQgMCBvYmoK
- NDQ4NjUKZW5kb2JqCjIwIDAgb2JqCjw8IC9MZW5ndGggMjEgMCBSIC9UeXBlIC9YT2Jq
- ZWN0IC9TdWJ0eXBlIC9JbWFnZSAvV2lkdGggMjU2IC9IZWlnaHQgMjU2IC9Db2xvclNw
- YWNlCi9EZXZpY2VHcmF5IC9CaXRzUGVyQ29tcG9uZW50IDggL0ZpbHRlciAvRmxhdGVE
- ZWNvZGUgPj4Kc3RyZWFtCngB7dCFQQIAAABBsTswEAxsBQWD/XdzkL8b4Vartj8MGDBg
- IDnwiwEDBgwkB34wYMCAgeTANwYMGDCQHFhiwIABA8mBBQYMGDCQHPjCgAEDBpIDnxgw
- YMCAgeDAHAMGDBhIDswwYMCAgeTABwYMGDCQHHjHgAEDBpIDbxgwYMBAcuAVAwYMGEgO
- vGDAgAEDBoIDzxgwYMBAcuAJAwYMGEgOPGLAgAEDyYEHDBgwYCA5MMWAAQMGkgP3GDBg
- wEBy4A4DBgwYSA7cYsCAAQMGggM3GDBgwEByYIIBAwYMJAfGGDBgIDpwjQED2YERBgxk
- B64wYCA7cIkBA9mBCwyEB84xYCA7MMSAgezAGQYMZAdOMWAgO3CCAQPZgWMMGMgOHGHA
- QHbgEAMGsgMHGDCQHdjHQHhgDwMGsgO7GDCQHdjBgIHswDYGDGQHtjBgIDuwiQED2YEN
- DBjIDqxjwEB2YIABA9mBNQyEB/4BLgXylgplbmRzdHJlYW0KZW5kb2JqCjIxIDAgb2Jq
- CjM2NgplbmRvYmoKMjUgMCBvYmoKPDwgL0xlbmd0aCAyNiAwIFIgL1R5cGUgL1hPYmpl
- Y3QgL1N1YnR5cGUgL0ltYWdlIC9XaWR0aCAyNTYgL0hlaWdodCAyNTYgL0NvbG9yU3Bh
- Y2UKL0RldmljZUdyYXkgL0JpdHNQZXJDb21wb25lbnQgOCAvRmlsdGVyIC9GbGF0ZURl
- Y29kZSA+PgpzdHJlYW0KeAHt3Qs/k2EYB+A5j2HOZpjz+TxzNkQSSSJJJJEkkkgStq/e
- B+n6CPtte9/nuQ//K51KPT483N//vbv7c3v7++bm1/X11dXPy8sfFxffz8/Pzr6dnn49
- OflyfPz56Ojw8NPBwcf9/Q97e7u773d23m1vv93aerO5ubHxen391dray9XVFysry8vP
- l5aeLS4+XViYn38yNzc7OzOTTCanp6empiYnJyYmxsfHxsZGR0dGEonE8HA8Hh8aGhwc
- HBjo7+/v6+vt7e3p6e7u6urq7Ozo6Ghvb2tra21taWlpbm5qampsbGiIxWL19XV1dbW1
- 0Wi0piYSiVRXV1VVVVZWVJSXl5eVlZaWlpSEw+Hi4qKiosLCUChUUJCfHwwG8/Jyc3Nz
- crKzs7OyMjMzMzICgbTP7/v3+/f/9/zz/Pf+8/53/nH+c/51/nf/cf9z/3X/V/9Q/1H/
- Uv9T/1T/Vf9W/9f/0P/R/9L/0//U/9X/1v83/2D+w/yL+R/zT+a/zL+Z/zP/aP7T/Kv5
- X/PP5r/Nv5v/t/9g/8P+i/0f+0/2v+y/2f+z/2j/0/6r/V/7z/a/7b/b/5d/IP9B/oX8
- D/kn8l/k38j/kX8k/0n+lfwv+Wfy3+Tfyf+Tfyj/Uf6l/E/5p/Jf5d/K/5V/LP9Z/rX8
- b/nn8t/l38v/5x/wH/gX/A/+Cf+Ff8P/4R/xn/hX/C/+Gf+Nf8f/4x/yH/mX/E/+Kf+V
- f8v/5R/zn/nX/G/+Of89IxBIp1L8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8
- d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/
- zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf
- +e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47
- /53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/nv/Pf+e/8d/47/53/zn/n
- vwfSqdTjw3/sv/8DK6twSQplbmRzdHJlYW0KZW5kb2JqCjI2IDAgb2JqCjgxNwplbmRv
- YmoKMTcgMCBvYmoKPDwgL1R5cGUgL0V4dEdTdGF0ZSAvY2EgMCA+PgplbmRvYmoKMTgg
- MCBvYmoKPDwgL1R5cGUgL0V4dEdTdGF0ZSAvY2EgMSA+PgplbmRvYmoKMjcgMCBvYmoK
- PDwgL0xlbmd0aCAyOCAwIFIgL04gMSAvQWx0ZXJuYXRlIC9EZXZpY2VHcmF5IC9GaWx0
- ZXIgL0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4AYVST0gUURz+zTYShIhBhXiIdwoJlSms
- rKDadnVZlW1bldKiGGffuqOzM9Ob2TXFkwRdojx1D6JjdOzQoZuXosCsS9cgqSAIPHXo
- +83s6iiEb3k73/v9/X7fe0RtnabvOylBVHNDlSulp25OTYuDHylFHdROWKYV+OlicYyx
- 67mSv7vX1mfS2LLex7V2+/Y9tZVlYCHqLba3EPohkWYAH5mfKGWAs8Adlq/YPgE8WA6s
- GvAjogMPmrkw09GcdKWyLZFT5qIoKq9iO0mu+/m5xr6LtYmD/lyPZtaOvbPqqtFM1LT3
- RKG8D65EGc9fVPZsNRSnDeOcSEMaKfKu1d8rTMcRkSsQSgZSNWS5n2pOnXXgdRi7XbqT
- 4/j2EKU+yWCoibXpspkdhX0AdirL7BDwBejxsmIP54F7Yf9bUcOTwCdhP2SHedatH/YX
- rlPge4Q9NeDOFK7F8dqKH14tAUP3VCNojHNNxNPXOXOkiO8x1BmY90Y5pgsxd5aqEzeA
- O2EfWapmCrFd+67qJe57AnfT4zvRmzkLXKAcSXKxFdkU0DwJWBR9i7BJDjw+zh5V4Heo
- mMAcuYnczSj3HtURG2ejUoFWeo1Xxk/jufHF+GVsGM+Afqx213t8/+njFXXXtj48+Y16
- 3DmuvZ0bVWFWcWUL3f/HMoSP2Sc5psHToVlYa9h25A+azEywDCjEfwU+l/qSE1Xc1e7t
- uEUSzFA+LGwluktUbinU6j2DSqwcK9gAdnCSxCxaHLhTa7o5eHfYInpt+U1XsuuG/vr2
- evva8h5tyqgpKBPNs0RmlLFbo+TdeNv9ZpERnzg6vue9ilrJ/klFED+FOVoq8hRV9FZQ
- 1sRvZw5+G7Z+XD+l5/VB/TwJPa2f0a/ooxG+DHRJz8JzUR+jSfCwaSHiEqCKgzPUTlRj
- jQPiKfHytFtkkf0PQBn9ZgplbmRzdHJlYW0KZW5kb2JqCjI4IDAgb2JqCjcwNAplbmRv
- YmoKMTIgMCBvYmoKWyAvSUNDQmFzZWQgMjcgMCBSIF0KZW5kb2JqCjI5IDAgb2JqCjw8
- IC9MZW5ndGggMzAgMCBSIC9OIDMgL0FsdGVybmF0ZSAvRGV2aWNlUkdCIC9GaWx0ZXIg
- L0ZsYXRlRGVjb2RlID4+CnN0cmVhbQp4Aa2TzWsTQRjGn02QCtZQi0jx4oJSPERdkhbb
- W9t8SOwSlySlfhw02d1soslm3d1ErR561H+gFEQQPOjBmxc9tSeR4ieC9OBdUU9a6qGU
- 9Z0Zd4Ng8eK7zMxvH555Z+adXSC+UXWcVgxA2/bd0qkZ+ey58/LAOiQcQgJJyFXdc6Y1
- TSXLDrH5gdwU74+xXF9iz7c+fdtz58Li7bXDSw9bO0wK5YRLCwJSkoT9luApxjXBFcbX
- fMcnT4Ox3qgaxLeIk26llCF+RJywBD9lXBP8gnFPt9jcdWLFNpo2ENtNPGGYnk48RWwZ
- nt4mpjwS2u0O5Y+znEd1x6W58bfER1hdaKS4mgAmv5J+r69dPAE8WQMOaH1tdBkYvgQ8
- m+xrP97wWkkjNa+eTvF00uBBYNdqEHwPgAHyb78Ogq3lINheojU2gJWi3nV73EsblF4B
- /3oXZxbZgXd0Bgp+R39nURfuUoAHq0BlEVBpvEvj6E9g301AA+lUpnQ6bKKGJAN7szlV
- lVNjynhem+fKf+zarS7dFY9h6gftWvEMjSPUPju+RpsS7PXKuZDrzXwhZKOanQ15oZEp
- hlx386WQL1dPswPynKY9Vw7ZafFv//daM5Hf9HKRZ6FRYWfmHrdbmgv5Smc28htmNtqb
- 3Sqy/4n7m34h2j+yyEGlR0YKY1AwjjyVfV58kzQDQ4+B+0PKyXR55eNLJvwRvnmd33Wm
- 49xwm1bDl6fpjzSTcsHWjyfllKJM4BeDarM/CmVuZHN0cmVhbQplbmRvYmoKMzAgMCBv
- YmoKNTY1CmVuZG9iagoyMiAwIG9iagpbIC9JQ0NCYXNlZCAyOSAwIFIgXQplbmRvYmoK
- MzEgMCBvYmoKPDwgL0xlbmd0aCAzMiAwIFIgL04gMyAvQWx0ZXJuYXRlIC9EZXZpY2VS
- R0IgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBhZRNSBRhGMf/s40EsQbR
- lwjF0MEkVCYLUgLT9StTtmXVTAlinX13nRxnp5ndLUUihOiYdYwuVkSHiE7hoUOnOkQE
- mXWJoKNFEAVeIrb/O5O7Y1S+MDO/eZ7/+3y9wwBVj1KOY0U0YMrOu8nemHZ6dEzb/BpV
- qEYUXCnDczoSiQGfqZXP9Wv1LRRpWWqUsdb7NnyrdpkQUDQqd2QDPix5PODjki/knTw1
- ZyQbE6k02SE3uEPJTvIt8tZsiMdDnBaeAVS1U5MzHJdxIjvILUUjK2M+IOt22rTJ76U9
- 7RlT1LDfyDc5C9q48v1A2x5g04uKbcwDHtwDdtdVbPU1wM4RYPFQxfY96c9H2fXKyxxq
- 9sMp0Rhr+lAqfa8DNt8Afl4vlX7cLpV+3mEO1vHUMgpu0deyMOUlENQb7Gb85Br9i4Oe
- fFULsMA5jmwB+q8ANz8C+x8C2x8DiWpgqBWRy2w3uPLiIucCdOacadfMTuS1Zl0/onXw
- aIXWZxtNDVrKsjTf5Wmu8IRbFOkmTFkFztlf23iPCnt4kE/2F7kkvO7frMylU12cJZrY
- 1qe06OomN5DvZ8yePnI9r/cZt2c4YOWAme8bCjhyyrbiPBepidTY4/GTZMZXVCcfk/OQ
- POcVB2VM334udSJBrqU9OZnrl5pd3Ns+MzHEM5KsWDMTnfHf/MYtJGXefdTcdSz/m2dt
- kWcYhQUBEzbvNjQk0YsYGuHARQ4ZekwqTFqlX9BqwsPkX5UWEuVdFhW9WOGeFX/PeRS4
- W8Y/hVgccw3lCJr+Tv+iL+sL+l3983xtob7imXPPmsara18ZV2aW1ci4QY0yvqwpiG+w
- 2g56LWRpneIV9OSV9Y3h6jL2fG3Zo8kc4mp8NdSlCGVqxDjjya5l90WyxTfh51vL9q/p
- Uft89klNJdeyunhmKfp8NlwNa/+zq2DSsqvw5I2QLjxroe5VD6p9aovaCk09prarbWoX
- 346qA+Udw5yViQus22X1KfZgY5reyklXZovg38Ivhv+lXmEL1zQ0+Q9NuLmMaQnfEdw2
- cIeU/8NfswMN3gplbmRzdHJlYW0KZW5kb2JqCjMyIDAgb2JqCjc5MgplbmRvYmoKNyAw
- IG9iagpbIC9JQ0NCYXNlZCAzMSAwIFIgXQplbmRvYmoKMTkgMCBvYmoKPDwgL0xlbmd0
- aCAzMyAwIFIgL0Z1bmN0aW9uVHlwZSAwIC9CaXRzUGVyU2FtcGxlIDggL1NpemUgWyAx
- MzY1IF0gL0RvbWFpbgpbIDAgMSBdIC9SYW5nZSBbIDAgMSAwIDEgMCAxIF0gL0ZpbHRl
- ciAvRmxhdGVEZWNvZGUgPj4Kc3RyZWFtCngBzcLXcQJAEAXByT8vjLDCO4HwIoobfRPA
- K7arW4f22V1akT1anX3ae/t85hfWOcAih1jnCIscY50TLHKKdX5jkTMsco51LrDIJda5
- wiLXWOcGQ7cYusPEPYYeMPEHQ4+YeMLQXww9Y+IFQ6+YeMPQO4Y+MPGJoX+Y+MLAf+tF
- vN4KZW5kc3RyZWFtCmVuZG9iagozMyAwIG9iagoxMzAKZW5kb2JqCjMgMCBvYmoKPDwg
- L1R5cGUgL1BhZ2VzIC9NZWRpYUJveCBbMCAwIDUxMiA1MTJdIC9Db3VudCAxIC9LaWRz
- IFsgMiAwIFIgXSA+PgplbmRvYmoKMzQgMCBvYmoKPDwgL1R5cGUgL0NhdGFsb2cgL1Bh
- Z2VzIDMgMCBSIC9WZXJzaW9uIC8xLjQgPj4KZW5kb2JqCjM1IDAgb2JqCjw8IC9MZW5n
- dGggMzYgMCBSIC9MZW5ndGgxIDUwMzIgL0ZpbHRlciAvRmxhdGVEZWNvZGUgPj4Kc3Ry
- ZWFtCngB7TiNfxNVtufcOzOZNkDT0pbQAJl0aJWm2QIKlEJpaJKWNkILVDepsCb9kADF
- Flo+n9Iqq2L4sK7a1d+u6K6rFaw6bZENRZevxdUVfn6ivLfig4X14z0R9Af7VoHOO5Nq
- BZd9f8Gbk3vn3nPOveeej3vu3AACwBBoAw7u2mXhJpBhGmEOU7HWrmpR3tm342NqnwaQ
- V9zetGhZ6hcziZ4QABDKFzWsvT0yatrbAEN/RzyvR+rDdWeXqscBhjVQf3KEEMPGCEQf
- ZtDHRpa1rJH3Yxf1X6e+3NBYG4Y6SKc+8YC0LLymiT0q3k39Y9RX7ggvqx+59bl11P8H
- 9dWmxuYWvQpuB0gaRf3sphX1TWeOuN6jvpfWEyYcEhjPEJCoADgMjNgLILbBGCojeA9k
- 6hf0v1L5zCj9s4j2NCT31wDwEmpvi4+/qhJP0OyeAZT+L56rBlyzMzAQDE2Ncu2nHMxQ
- AltABAsI8Az1zsJxuA8klGEyJEM+vIAfgQcq4R4shJ8TTwaUwQuwGz7ARfolEPSgfgCW
- QidOIv0zoAAWwF44T3x/gp9CGNZAK96j30XWSYQxkAk3kDVXwDo4SRwJkAY2yMQsNo0f
- gxE0sgHaYAPsFir0Z/XjNCaBoAKeheegH6sxou/STxEmH6aCD+bDHcT7AIqYJo7R/6Kf
- 18/DRFrnQlhE8yyHx2AXmnA4OvEPrIh3wDjSsxGaIAod8Ev4M2bjm7xS3w4uggkwh+a7
- FWpozi3QB2/ANyixGraGvcB28RX8ogDCUfFtyae/ph+hyBXBSmMKaMRtFE+Lad4H4R34
- EP4KX8HXmIaZOAEn4wwsw6WsQTJLP9X30BgzjAaFbJADebTSAigmmEe2uBMehS54BV4l
- OABfokJwHcE4vBWfwR48xZKYwg6zd9g3PJ/7+aOCVVgo3Ck+Jp6UcnSPvosslQJ2UGEK
- zVhOFrsVamlVzWT9X0InwYuwE2LwHvwFTsHfaH0j0Iqj0IOlWI7nGGePs8/5ZL5OkPpH
- 6xP19fGoTqLVziAoJ7gJZsNcuJk8GoB68vY6+De4C9bDPRQRD0I7gSFnQEof7IPXKeLe
- JXv8B/n5FPwXnKOI+BYukz+SSLIDc/AGzMfp6CXwYQVBBFfj/bgZ2/Fh7CKNN7KH2Vc8
- kafycl7P7+ab+JN8Lz/IjwjZwiyhR+gVC8RScROBJh4TP5G45JEekj4zbTe9IlvlIrlM
- Xiz/+tLOfug/2n9On6HP0bfoW/V2/b/j3pPIYjL5YwhFeCpFrRNupIgqp+iZD1UQ/M5+
- yyhSmwlWwipYC/fC/bCZYAs8RBH0G3geeuBl2A9/hNdIUwOO0c75mOA07aF/kK4ymnEo
- aWwhGIVjcCzFnBNzMQ8nYSG6yf5zMIj1uAI34TZ8GV/Ft/AjBuRtG1NZAZvO6sgKz7Od
- bC/55zryUD6/iS8iazwpJAluEcQO8TOpU3oV3sPptN+ufh6Br/RUYQucod2zGt7neXod
- r8Xl0CLehk74lnbGbtJF5ZSLcRycE75AJ1vN0nAjS2OT2GnxFXykP4qJ5MuPIIdW5hM6
- 4N+hkM+gvbqW+4WF7PdCNu6kCK3BL9lC9ivmE9ewaijGF9GF5XwcHDFlSZ+wevycZ5pC
- cBFXkRaV8Du2AzYyF/4Pm9a/T3KJE2G78BHzwHY4xjJMEkvjF9m77Am4gz1Ee+IRirpv
- 4Be03qG4gnKOCwvwXYqmg/g+5d8XxDb9vHgnK2TT8R32N4ogEJ4QwgNc/yJx/j86bgF4
- iS0zzaKsO0I8IB4w2uwQa+Qu7mImOEJ1IzOxD4Ri+AXXTDoWiptQkd6U3sQlUCciZEOF
- 8DPswK/xIPQKU+A8fg0opEAFZkvT8AlxGlSII+ExlgkP0Sn3Br7I18DnOJrGLGGHTLMw
- X7gICzEffisUC5/wDvYImlkOnsT78O8EDZRdnbgW1ksvwWq+EfJ42PQ+OtjP2R5oYaWU
- ZeewbKzkb8Eh2CMVsJvpnQ37+TYWoCyXJx+GM9ggbBA24AdQxuZBG2sVEJLwuHAJGqQW
- uFP8EO7C1XEpfYYc2vO/IVmT8E902m2gHJNNZ8sewn4IRZBLuXsN5e0dlAOClCmQzsYz
- KFFmMHLeKbYTGfweZsHD3Mct0sNwN/sWMyjD1BE2C5bBVlQpSxRS1jyIH9M5GqBT73pe
- A3NN24HhcNqhIG6lk0eFE/AqlsNP4EPMoMyoAjKB34htcAmrWEd/jVACiXw53yAuxRLa
- Ty8C6qnwZz0i0PeGe1L+lBsmjM/7iSvXmTPu+uuys8aqmQ7FPmb0KFvGSOuI9LTU4SnJ
- lqRhQ4eYExNkkyQKnCHk+tSSkKJlhzQhW501y2X01TAhwlcgQppCqJKreTTFGBcm0lWc
- buK8/Uec7gFO9yAnWpTpMN2Vq/hURTviVZUYVs8NUHuLVw0q2pl4e3a8LWTHO0Op43DQ
- CMVnjXgVDUOKTyvVhCwtsSrg0MqCqyJRX8jrysVuc6JH9dQnunKhO9FMTTO1tBK1qRtL
- ZmC8wUp8Bd0M5KGkrlauen1amUpDaUae5QvXaZVzAz6vzeEIunI19NSqNRqoxVqSM84C
- nrgYTfJoprgYZbFGmsEmpTt3X3RzzAI1IeeQOrUuvCCg8TDN4dOSnVqp6tVK1522unJj
- +GxVQEvwxBCqAruhXG/rLmvzeoOGtBRP4P4r2W086rMuVozR0ej9ivbU3MAVk9kcxpTB
- IE3qyvXPCzho1apvs2KoMS8Q14AmRWseLdzAGWoOKFyv+gxMaImiJajFaiS6JER+y4hq
- MG+toyej3L1bPwHlPiVaFVAdWpFNDYa9o7pTITpvbW+ZWym7muLK7bYkD1i6e1jSd40h
- Q69s1JMXBmjxVpzdaNGqvzc1GitSyzQ3hVutQisJqBrLyjeq+nyI1uaTR+gJIll0Mdkv
- FLUUkHaamGVRlegFoJhQz3xxNSb8HUbKslwAg2hEzmD0aRj+vq05nVpOjhEpJg+5llY2
- I96f5MpdpfnVJoui+clkUBmgQcGCPDK5w2F4eVPMDTXU0drmBgb6CtTYesCd5wxqLGRQ
- 9n1PSbvZoLR9TxkcHlIpsnfGbxJpmpw9+EuypA/3RQo0TP8/yPUD9BLax9FoiaqUREPR
- cExvq1EVixrt9vujTT7afwMrj+l9m2xayeagZglFkMynDfcEuI0ZsUctZuNBF31GUGKg
- nERAX0smutQkO5KzqKLTFS4pfN8ltwgXQRH2ERcw6NKPMyvdY0wwHCrciRIKAJQeuRDD
- ZW6b/PwwM98q3CfhSrO0MjmttLTc/HxyWeqCVVbnHMv52Zfn+Oq9n8y2nCY4fwaKLn9Z
- hMkpU4HK1AnjcQTjKqNPn4mUwCQ1M3vSjZPx0wlTb1non3ggtTwSKS+LLBK3Zfe/cfkW
- thyvL7z4noGKlJVHaG2GGgzgsulXoduSpl8Am2ysGA6VNvQMvmn1pOk24k2I8xsEGiex
- y81wWt7f/1j/4/ITgxSDajxMIhTbT9/tQPfJOqoHZC0geQvITIzuU6kwnRgLhR6yokFF
- +ko33jQ5fXeCd25xZdktTk+4YXHz7KriRrrC0lqNR7/JuHNe4zHoZNwYf7Rn+Uh7jF/s
- pdeUGJrdGWNW22+hspCK0jq+1d3KX37Qa59iWWfpQw6MHd7VNNZ+6ORwewz7e0+OtOfN
- TMAHoIgKg5PsIF3F7Oyge/5rqr2pta2VtZofND9pfsm81/yWme5hlgT2dsKJhHMJPInb
- OftPfpbrnOcpaM+8LfOsoitCkpKnFCkVSqPSqrykmJIy7ZkVmbxtOVpmOlgTKFTGU3FT
- aafyFBVpEGtgeJxWSS02iCd9qW9hTe5EtmNdpr1tHW7siumHe63p8bf7emv6U5+a7E99
- +owpfUnnnqyBquPp8faOpxPGpz/dmZMwUMVwQs/jZnsfToDH8Ua3xXwFLSVZdsdY/ss3
- 2xJsCe1/wOcoktvx1/Fachea2i+a2ttM7UtN7YtM7SFT+89M7QHTWDlTVuQx8ig5gy4c
- 6XKqnCJb5GHyEDlRlmVJFmQmg5wa00+4JxiuT6V/HRDSJYvxkowdAkK8bSElKZTIsxQb
- DGVG9xD0a/tqwV+jaH+fr8YwcW61JqrFqKX4wV9VbEVtOPcz//xiLd/pj8kwT5vi9GsJ
- lbcGuhG3BgmrsY3x4yWGIw3UvTbjZNlNXy7z7t1iM976vVuCQUhfVWQtSpmRPLXEe40q
- 9AMy5HX+82P9AYX+yrV7wY5nyWh2VOJ1aq/J/qTJ4PHPJ2J7nNgeJ7YjEdsHiNbRWod/
- fkDbMTqoTTQa+uhgb3XfhqM+OqRCqq+eSkjbtCpi1dpqFKV7Q59BoLMiO1RTGzHe4Xqt
- T633ahtUr9JdHR/3I/JRg1ytervhqK8q0H3UXe/tqXZX+9SwN9jb2dLYdZWsBwZlNbZc
- Q1aLMVmjIaszPu5HsroMcqchq8uQ1WXI6nR3xmWhb/H8YrJVoFuG4qBnwcC7l5kTyT0h
- myNYHPfTNId1va2PXcACMNMpMoQ+PoZSMVzomumaSSQP88RJw4zvku9I1vXTHLY+LGAX
- 4iQLoZMpaPAHLxmtZmdzc/PKFqpaVkLLSoJm4miOU5zQMsBMwfi/LcjbTgplbmRzdHJl
- YW0KZW5kb2JqCjM2IDAgb2JqCjM0NTYKZW5kb2JqCjM3IDAgb2JqCjw8IC9UeXBlIC9G
- b250RGVzY3JpcHRvciAvQXNjZW50IDc1MSAvQ2FwSGVpZ2h0IDY5NSAvRGVzY2VudCAt
- MzE5IC9GbGFncyAzMgovRm9udEJCb3ggWy0xNzYgLTIyNyAxMDc2IDkxM10gL0ZvbnRO
- YW1lIC9EUUJQSVYrQ2FsaXNNVEJvbCAvSXRhbGljQW5nbGUgMAovU3RlbVYgMCAvTGVh
- ZGluZyAxMTEgL01heFdpZHRoIDEwOTQgL1hIZWlnaHQgNDcxIC9Gb250RmlsZTIgMzUg
- MCBSID4+CmVuZG9iagozOCAwIG9iagpbIDM0NCBdCmVuZG9iagoxMSAwIG9iago8PCAv
- VHlwZSAvRm9udCAvU3VidHlwZSAvVHJ1ZVR5cGUgL0Jhc2VGb250IC9EUUJQSVYrQ2Fs
- aXNNVEJvbCAvRm9udERlc2NyaXB0b3IKMzcgMCBSIC9XaWR0aHMgMzggMCBSIC9GaXJz
- dENoYXIgMzMgL0xhc3RDaGFyIDMzIC9FbmNvZGluZyAvTWFjUm9tYW5FbmNvZGluZwo+
- PgplbmRvYmoKMSAwIG9iago8PCAvVGl0bGUgKFVudGl0bGVkKSAvQXV0aG9yIChQcmVz
- dG9uIEphY2tzb24pIC9DcmVhdG9yIChPbW5pR3JhZmZsZSBQcm9mZXNzaW9uYWwpCi9Q
- cm9kdWNlciAoTWFjIE9TIFggMTAuNS41IFF1YXJ0eiBQREZDb250ZXh0KSAvQ3JlYXRp
- b25EYXRlIChEOjIwMDgxMTE3MTg0NzE0WjAwJzAwJykKL01vZERhdGUgKEQ6MjAwODEx
- MTcxODQ3MTRaMDAnMDAnKSA+PgplbmRvYmoKeHJlZgowIDM5CjAwMDAwMDAwMDAgNjU1
- MzUgZiAKMDAwMDA2OTExNCAwMDAwMCBuIAowMDAwMDAxMDk4IDAwMDAwIG4gCjAwMDAw
- NjQ5NjMgMDAwMDAgbiAKMDAwMDAwMDAyMiAwMDAwMCBuIAowMDAwMDAxMDc5IDAwMDAw
- IG4gCjAwMDAwMDEyMDIgMDAwMDAgbiAKMDAwMDA2NDYxNCAwMDAwMCBuIAowMDAwMDAy
- Njk4IDAwMDAwIG4gCjAwMDAwMTM5NDkgMDAwMDAgbiAKMDAwMDAwMTQ1NSAwMDAwMCBu
- IAowMDAwMDY4OTM5IDAwMDAwIG4gCjAwMDAwNjI5MzcgMDAwMDAgbiAKMDAwMDAwMTYx
- MyAwMDAwMCBuIAowMDAwMDAyNjc4IDAwMDAwIG4gCjAwMDAwMTM5NzAgMDAwMDAgbiAK
- MDAwMDAxNTM2NiAwMDAwMCBuIAowMDAwMDYyMDE5IDAwMDAwIG4gCjAwMDAwNjIwNjQg
- MDAwMDAgbiAKMDAwMDA2NDY1MCAwMDAwMCBuIAowMDAwMDYwNDQ4IDAwMDAwIG4gCjAw
- MDAwNjA5ODggMDAwMDAgbiAKMDAwMDA2MzY2MiAwMDAwMCBuIAowMDAwMDE1Mzg3IDAw
- MDAwIG4gCjAwMDAwNjA0MjYgMDAwMDAgbiAKMDAwMDA2MTAwOCAwMDAwMCBuIAowMDAw
- MDYxOTk5IDAwMDAwIG4gCjAwMDAwNjIxMDkgMDAwMDAgbiAKMDAwMDA2MjkxNyAwMDAw
- MCBuIAowMDAwMDYyOTc0IDAwMDAwIG4gCjAwMDAwNjM2NDIgMDAwMDAgbiAKMDAwMDA2
- MzY5OSAwMDAwMCBuIAowMDAwMDY0NTk0IDAwMDAwIG4gCjAwMDAwNjQ5NDMgMDAwMDAg
- biAKMDAwMDA2NTA0NiAwMDAwMCBuIAowMDAwMDY1MTEwIDAwMDAwIG4gCjAwMDAwNjg2
- NTYgMDAwMDAgbiAKMDAwMDA2ODY3NyAwMDAwMCBuIAowMDAwMDY4OTE1IDAwMDAwIG4g
- CnRyYWlsZXIKPDwgL1NpemUgMzkgL1Jvb3QgMzQgMCBSIC9JbmZvIDEgMCBSIC9JRCBb
- IDw0OWU2MjQzZGUwYzBiMTQ0NmRmMDQzNjRjNzc1ZGNlZj4KPDQ5ZTYyNDNkZTBjMGIx
- NDQ2ZGYwNDM2NGM3NzVkY2VmPiBdID4+CnN0YXJ0eHJlZgo2OTMzNgolJUVPRgoxIDAg
- b2JqCjw8L0F1dGhvciAoUHJlc3RvbiBKYWNrc29uKS9DcmVhdGlvbkRhdGUgKEQ6MjAw
- ODExMTQyMzU4MDBaKS9DcmVhdG9yIChPbW5pR3JhZmZsZSBQcm9mZXNzaW9uYWwgNS4x
- IHJjIDEpL01vZERhdGUgKEQ6MjAwODExMTcxODQxMDBaKS9Qcm9kdWNlciAoTWFjIE9T
- IFggMTAuNS41IFF1YXJ0eiBQREZDb250ZXh0KS9UaXRsZSAoUmVwb3J0ZXJJY29uLmdy
- YWZmbGUpPj4KZW5kb2JqCnhyZWYKMSAxCjAwMDAwNzAyNzQgMDAwMDAgbiAKdHJhaWxl
- cgo8PC9JRCBbPDQ5ZTYyNDNkZTBjMGIxNDQ2ZGYwNDM2NGM3NzVkY2VmPiA8NDllNjI0
- M2RlMGMwYjE0NDZkZjA0MzY0Yzc3NWRjZWY+XSAvSW5mbyAxIDAgUiAvUHJldiA2OTMz
- NiAvUm9vdCAzNCAwIFIgL1NpemUgMzk+PgpzdGFydHhyZWYKNzA0OTgKJSVFT0YK
- </data>
- <key>QuickLookThumbnail</key>
- <data>
- TU0AKgAALDSAACBQOCQWDQeEQmFQuGQ2HQ+IRGJROKQoViABCsQhoAiEKA8AhR2PF/ux
- vuZ/t9quB/NWKy+YTGZTOaTWbTecTmdTucAYCAADHwwUEzlADGcLA8ABaISd/N9PLV9p
- 5FKZ9op9PwAPqeV2vV+wWGxWOyWWCiAMAEQMRMgtihsJAANAABAKBAoEgB/gYDAAAgO7
- P9+v2/Pp9gB/PV7P4BP9/gJpt1+tMnHh8E5wOh/uCzZ3PZ/QaHRaOCT6gN5XA1vhsIv8
- NP8HA6BBII366wYAv+BbqB7x/P6BO94QJ4vMAMxsP1mDs0vcd1mt6TpdPqdXrdNIHEEp
- I3lIBm0AbGBBQKwfgQjHboA+uB8DHQJ+ul2PwCPZ6gQ9Jl8npDqR9kO68AwFAcCQKh4G
- LyBx2FsBp1r4AIDACDoQIEwC9Pe9iDt496/AC3qDH8wh8G2cR8sUf56BAKp6hAeh7gAe
- kDRlGcaRqsxGDaBBJjmKwCDYAAIgmvQIAgv0jSO9MOt3DEMve3T1IOfZ2HcfgCnmeICD
- uS58juqqrxtMEwzFMaIAUA4AAYdpcAadgEQjM4OhCgTbt2hbeQ/KEPTrPaCRCAB8m6cR
- 9OKfx4BCKp7BCex8gAe0yUfSFIxkQw0gQRo8i0Ag5H+B64gCCIKIE3ML1FI9R1IgzeSa
- 872Mc4E9ABKUqAKeksDkSZ8jkR5VH2R9JV/YFgs7NwAAVNQGnaBUIgQAAOBFCqfz4gkn
- r1I1YWpKD0NwgZ+K0fRvnCfZ2ngfx2BEK57BEfCuHxYV3XfeCZj+MYDkOQAwAKPAAAhI
- R/gi8sPT0f73IG9dryXUsLvVVdq1FgVq1gfR0nafYDHseACjaR58jaShXH2Sl45FkeSI
- M0wEHcXIHHaBYDn+BR/g6Eq/AGAeCt288j4bhuGSVVGeYPVFW27WJvm+fZ1Hcfx0hHdA
- RugrmS6lqdJDwLwDkAQ4ygKP4AAfIQAAkDE8YhDeISNalYT5D20oLbGdW2fJ0nSfQDnu
- eIDDQRZ8DQTJZH4TOqcFwcZgLmwDzVlYGgSf4F2aEyBAIAsPz3DiC1hnODyTtW1WnVKB
- rsgWiH2cBvH4cp1H8cgTCyewTH2wjD8J2faNIOQsgOPRGjUApCn+BshJCudSbTnudSfD
- Gyc5gWCYd5GHc09+JHVup8bwMZDnwMZPFsfhPdr8HwrFCwC8SdoH8YBtmhRyK+z5O+2M
- RuFp/hymd214/6/e+CtH4cI3X/DoH8OEE4Wh7AnH6cAwj4oGQNJoGoKYBg5iVDgAYRgA
- HgECAmBxPCqlTtuaE8ZJbCyCNsYGz6EMHXnIfHwOcdA+QED6HkAcLwhB8BeFGLkfgo4H
- Q9h8Q8ASHgCDsFwA8dgEQFD9KUBwFRenJPzIUbpV5DU7m9VVFZhL9FssOfsk8fZXB/Dj
- G8P0bg5B/DcBUFwewKh/RSh/G+OBAgyBNAMGwTYdgDCTTQv0CgHW0J2Q1Fx+61FRJOZv
- Id4jZyGJ3iqAAfA5RywwH4PMA4WA/j4CwKkXw/BUxxk8+JPQAx1C2AeOoCgDR+lxA2Cs
- gQBX3QgQ4/GFDOWEIdka/dz0UZEPPj+3A3kXwAD9HIN0fw1xwD9GsC4L49wXNmk/M9qg
- XAkAFDIKMPYBxNgAAXHwD8KJYwlZxFl+kWXLOeliteQktm1zgaE/pao9xyDiHwAkfo9A
- EBTD2PcKYrhhD9FdNCgDJABDoFqA8dIFwHD9VCBsFjkUzv5Z252dMsn7SyQyb8hU6JCu
- VkQnVtshx/j6UYP8csxBpGSGkDEMQ9wY0BpcsIKwQwCheFSIAA4oVilxH+BRZ6GZzLWi
- 6zeNznXMNueS9GEjZFStBlxR9hI9hxjhHwAof09gnB3HuE4WYxh+izpfV9MYAhyiyAgO
- YDQER+AXAABmhpQC8wpL0qyir+Jbl+mctKQNEYsPHYLIyQCsV2j+HNMQZpyRmg2DMPcG
- 1YLGIzCeD0AgVxYCGAQKinJAgKgkkC/Wdzb6JV6kXFGRtTmfSGShaNgsHyBD2HEN+qY/
- x6gICQHMe4SBcjKH6LmxtuzrACHCLACA4wPATH4a8DILS/AGAVXmEEunPrai3R6Dz9rm
- xUupZtgo+kXj/HONwf4xxqD9GODsNRzreXnNEEgG4BAoC3EYAgV4AAEm1H+BYE8UGFTe
- ivUapLP6O17VHOeLE7rQRanVLijcWTgD1HENwe7jh7gJCGG8e4QxfDOH6L69GGyxgBG8
- K0CA4AQgWH4B4AAGLkAAAOAyv8Vb9zfv3f65kuSE1+kdAtdaFTAgML65y67lG1G8Hyo4
- AA6RuAAGCM8fowQgBuHuEDDmUSeBBBkAMJIvhIgJFsAABCRQAAXBTfxDrAqJ3Wc+5tVr
- ya+tuH4YQAI+CtSOdlLQg60WvLMLpc+vipa/D0HCNse4DABYRB8GsewPhhjSH8MPKWjS
- ZgBGyKoCA3ATAZH4s8DALiBYrrxOSutd8g56nYqhDg+XZZwdEzlO7oQHA5labUAA7KvE
- FdDBih4BXQ6huciYgQ6sji7GWPwXYRg5D4CNo7ZBEwdgtAGEEYglgEi+H+AgpQAQL3Ic
- 3qNs0W7SIfim0FnJ0B/6mMLqpkzwwJhKg0E3TdaiCpqIEOEQxAh/IvIKBSt8QWEPFlqh
- keg3xsD2AYAOqYOQzj2ByMgaw/hkbJ4dRkaopwIjYBUBwfbkAL6avkUq6uNVU11Paed2
- BetyABH1nRPYAnHJACEQICIRyBANBhIIiA7xgkCG8HZOZuwJF5YDj+D8tx8HGABr4AAt
- hjj8FsEsOw+Al8P6gQMGoKABg7GUJsBIxMVcc0zqKkCTIunn3EPkrQAeR3VADQ8B4OuX
- BEIEA4HCFaHk1HWLEgQ4t5lA1Znh+GoMbEH3+NXgQBB9AKBoGQewNBmjZH8M3qOyAAjQ
- FGBEaYLwQD7lYBbFN8682d5CQIedI8234uT28G5AgIBBIEA8HaFa3lhHEI4gQ6xVF3J+
- P8BLk2Db9xpyAgQ9zh6xG8AAWAwh+CwCiHsfAUfH5RBeCQAQNBnifAUMrtIDkPAYpaw2
- pzbU9OYN4O7IgArlnh1cvsH3pkK54NGNpH4AB5+Ogw+401EHPRTo9UDeiMBweCAWAGHy
- ASBgDCHuBgpOH8Gk+at2ACGWFAAiGeBoBGH2BeAAAq2wASeC48qM5oN4Hg3sBKe+vkQo
- QMGkCSIEH2Hi5czw30p+5+f2IUPOHwHeIEJMAAFWF+H4FWCsD8HwCtAUq+BSIwBcGqFE
- AUGg7SAa+yBoIeeQYWYeWqVeHoUYAAA2EC9Q9aQEH1BmAAGo3YT2AkzwSazWwKWqzQqK
- WoHqG8GmHsAUAGH0AQBYC8HsBYGuHCH+GvB+meACGME2AgGUByBQH5CWAo40AUVCwI46
- r+HsaiAgC+IEAwC0QGHmGeIEG2DcQqN2AeTPBc28/0VOrqbU5QHsHaIEHaG+AAFMF2H2
- FMC2EEHyC3DyjgBKA4ACBUGyFMAWGoQgAYQ8Ay9OT2o0z47BA2wO7IIEAMB+IEA+X0QE
- HUFgIEHIEbGOdCAY7m88rw34o42+YSHoG6GeHsASAGH2AOBSjUBSG2HIH+G3FigcGCEu
- AgGMB8BYH41dEILu3cwQxpE+unGIowVixMAABMEqQGHGEhBovivkWiAQcmues6VU7+qK
- cuIGHqHWIEHdFOFAFsH2FADCEOHyDDHYfABCAyACBOG6FSAXDwAMAWPWAw/OzSv6nGue
- SatGjaL86IAABcFkQGG2DiIEHoGcL0AW90AMZsz4bKl2rk36eYYSliPeHoHAGcHsAQAE
- H4AMBMgMBMG+HOJTJCcGF2EkAgGCCIBiH4/SAmxSAWAy4+lg/1DKSYc606HiHqIEBQss
- KAbAOoGoCnBPFI/mcjKM4826s8Z05QIQHqHQOCHCAAE2FkH2E2DMEWHyDNK8ZKA6AsAC
- BGHAFYAYG2AEAKASNyAy9a93ESxmrm/yTy9A3sA+ES5jAoNIH5LoAAGmCYbcAgWYp8Ig
- hOl8kQMIljBYQ5JtKgGaHsQiPoBICwHsBIHGHUH+HHMqXgFoEaAgF0CWBsH4CKH+AkuQ
- ACAYeHA0kXH4xcnIIGHsXbAqDWPG6eNIHqGwIEG0DUL1KMACAdDCx+xkeOVZLiME5oly
- N8HoHKMeHiHGACEqFcH0EqDYEeH0/fOiUkAyAmACA+HIFeAYG9M+ASLsA1GSz2IAAACA
- AA/4NAoJBIPCYS/4IAYHBodA4HCoLDoE+n3BAWTIIGzNDJFI5JJZNJ5E7V3BHGiIIBAF
- BAYB4S/oTEYLAoxFpHGIhF4nOYtO5/PIuAHq4GU9wIAH6AhCVnsIXO7X+55RWa1W65Xa
- 9X7BYbFY7JJFciQetCiOn6SwAEhbBAaHaNJp3DZLO7vN7xPH2/IIAxjBBCgLLh5E5k9B
- HUp4IB6aAASBZrYL1KL3dYVPoi83C/wC8XIAUgqn0kDik30ccRrddr9hsdlYgsEACG3O
- sgY4gEBARMQ0QYfMYdQbzIoXFZzQeVDOLOYpBH7gAA+wrBBOmdnYnAg4I8GHBMnBchAu
- bJH/NqJy4PEPPBPVfPRzou/QA9nAyHuAX8/n+EIqqmdR4H+dTtwPBEEwVBYAFQQgHlcK
- 4fn6KIAAiuIAAaD75uczjMsyk71vg+R/vsAB5uoFhXuHBiTmyNCCHubyZJoACYIezbjM
- wvrkR5HaSJsfx5G+fwBHmcwBEUUp9EUO5MH0O8WylKcqSqAAJgcAALnSWYHHKAYCgMAY
- AA0ISHzG9cQPons2JGirkqEkp5nsggSk4x4MSshZpiehR8oKBoEIEmLLM3HyHoi9LzR4
- 5SDxEhTAPwZB8H8flKhAKp6hAdp5AAdsrVBUNRLGUI/AcVAvCKfwrwsFlABFRcOIan04
- qyjCFoQzUOome0/gADo/rkGUrHydaCGwLscIIBwFR44r2qLWqjADW9HxNXM3varSHH6e
- Btn8AZ6nQARClCfRCj4Th9D5Ud23dd6CAgBkrnWWoHHSAgCALMYNCKwMx2krdqLq56H0
- c+WEJtOLlHufSCAoMmHiVKx5mgghvD0l6KgXQSR4UkVGrxNOFx7XWSrynabHub5iHwfZ
- 9n+fQPioeoPngegAHheGd55BZNDyBxQjKJR/C9CwVrkEllYCrdn0RNc1TVQ1cgAfLqAZ
- icyDFKx2FqghykqggDUIBMa6Yvbnujk017PH9HoOfp3GofoBnudwBj+Tp8j+QRQH2QWe
- 8DwTEAaBIAAgdpcAedYCgIAYCH+DQjUGyNtq/XDj6W57mMq6rqAJYYABBjMqnKTaCHaW
- GxMi8aj5BWfNWrzWEzogzAIG6h/9yjcRoK6k4owfs6Huc51HyfB8n+ewPinmp5nvE/B+
- l6atEmOgGk0Ngnn+MvD6QAAHBMu2EKH8jl/NtiGPfRWlvUfqbACfgLoIExJSsb/AROZS
- CgQygApiR6jooY/noLUV8P8fB0k6EFgSQR3gAGPtvKArEoRBn4HNIGPseY9R+AFH0PoA
- gehMj5D0IcUg+xDvUhVCtjj4B3C4AgOwAwBQAgFH+BsJJ5jKNUUeh12ZfVGsjfhDx1x7
- y+k7HqiYFRjoKILGyGogg+RyEcAMQQATCh/DxOkPMhQ9SFMOh4rci0F1sk5iGTeMrVCG
- H9aWyQgp9h8DpHkPkeg9R/jzUwpoesCYvQrj8zwRobgGCTDkFUAAbAAAPBUvGRcRVDpu
- jErJzLJ31NTkoQQej0AAJ2bEBJBRCxor+Oqp8AADIHu8Oax+NLA1lPskuUYzkln0yPOS
- TYfcc4Oj7HyAQOolR8h1EYKgfYjI/zFVEAmKoCx3i5AgO4A5lIqgcLcAAAUO4xQCZDG4
- 5C0D0E+kirFXDBSdMIj2QQD53gAALBSgofA5iCDOBsSMCS8yhrabRGhEUrkQHKWuTibD
- sCJEInuoiLEUR1DyH0PAeY/h3oAKmw0AEmpjUTQWIUNIDBGh6C0AAOQ/wHTrACBFV0rW
- PldakyVtL61tRoIVSVDg93eAXDSQQCIQEFDwGMQQawVjAkVWY08gtLo1ENPijhtE3FnI
- /VzK59Eb04y3ZcAYfg+gChvEiPkN4khWD7ftRSrxspnmSmWBEd0yB/qCA2R4AAA2zI5q
- GrapUk2mnQqXUIfR1AHhQIIBaniCR0CmYuHZsTAIWvtkeSVRrCnMVARKwsopyZ8wRJPK
- whg/T7D6HYPQfY6x3j+HUCMK49gRj5I2r6r9pyyB+DGAsQwgQwABDy+AFFNAXohlm2wn
- Ftk2xEcufCWI/2XkCAQDkggHA2oKHAIYgg5hLGPh2AomlASIIguoiGVSPGFLRdhUue0k
- nOyVaqO9hoBx/D7AMGoRo+A1CXFgPwS9qL4FeX2AAA47xdARHeAu8jhgNhNMCoJtM3ag
- NMlYh+ult2SXSpVUZqY+h0wOk8AAFcTEEDYJCAAdwtiCAKiqACGcbaiNPwVdV11Aq6Uu
- h6UKbNQcRLQMuTyNg+7Mj7HMOwf45gShYHsCUfZ9oH3xyASMO4XAFB/EQGcARhgGgnII
- BIGd37wQVVotOw8r5tWKJItFW7Ch+IGOrg+CEYB7gLIIDMZKChohHIIPUapcmOgDYAtG
- xVJzmofyxG3EjJbH5zsni8kg+B3j2H0Ah3QBgyCIHwGQTotR+CdyDo+tZMQC32AkO8mY
- /AFgBA4n0f4A3DXaiOdCk59IBSXglqVN51MuwOHQQqB5yj1Dxi8AEGo2DA1tNgMmdZTo
- uPgcNNRgD5yJ4FpZixkeCsoomxSfPAN27Hn2KIwOyGPh2wcHEOgf44QThaHsCd95TtIW
- oDgFcBQdxHhsAES4Br4krg1J7qOb7lrcNMrgAAfg7oHDji+iSoRDB5M4AAC4Xh4gRmwH
- 1vgAAzbauuAes2JsQK3HnMzsSWRD87wUz9LO6RIqhRGghREdzyHDD8AOF8Qg+AviiFyP
- wUW4aJgCIGAQdwuQJjuAeAkfYDQAAbQqjbhzJ5/Ym3rONN2zrtxrgWPocB8GcYjbXOIA
- I9YFgjMWhYH5sB5jPIINQJzBllz0YOojjNSnZMgUSfbj0QbHdlsR2zEh/t7DuHoP0bo5
- R/jcBUFwewKu4b95c4EMwUAEBuEyHMAgkZSglYeDqw+BuvQVqaTyb/Ht7EEH1vre2YGA
- lEqPqhGMmgNLBAABgLhsB1orAANwNzGiCgK0/Bi7ERc6ocLuiDjqiSgyx8ks/Yca2E2M
- uyQMew7R7D4AUAEfoCAsiAHwFkVAvR+Co7+4MioAx2i5AoO0CICh8gP52FMggBZ6LSOT
- Eaxa294EE1W1UcJCTqbSyn8C7xInkZNDDOa2Jrxx+IAAOSYjDxgBsrp7iBhDtxkR8zsa
- 3ZqD+JqiyQzTZo6QmxboeofwbAcIfwa4FoLwe4FreL6ZdoMIJYBANITwPAAi5oBhpQf4
- CgHyoaCRtbKsBQhqMAfAbaN5nS6bKjULoripXSD48QIZ+i5o14bgOYggdYVS5wggBDDr
- 87FUDx87LTPL3yH7KxD6e6C7eaWBQwezkL4wAT5IKgPge4KgVoYIfoVsD5d4AQdYW4Cg
- dYCgBgfKTwDYKT8L7yuY47UozAjAfiUgfIbrVz+beiAMFzLL9SB7xQAAFoWQ2AaiQxE4
- ZA8TDpxsQ53qbUBJ4C6yxxRhR7PkKrfr+L8qlqN7aAeIe4fwaQbsVIGIMQe4wcNRUILA
- IgA4MAU4P4AoT6dJpQAACw4TZDd4rhqROBEwfMGx3RYziSRz3SpkSzj5NkUY+BEwe5jo
- GgZw2AZqeIAAfQrCdJGrOCbSer3qbccaHjvyI8UR8q7Q4ruDUCMyNTtQnjFbj4eodofD
- MYAYfwBIJwO4e4JwWYYwfoWcWJKYAQdAWoCodIC4Bwe4ChMgKgx4CK3ZbLUpp0eC7BnR
- qobQ+CBplC70YCHzoUeL8wjAeSPoGrNqtbn4sAfyMAZMXgoQBzX6t8kMkbAScbBRkKC0
- mh18dEYKNTsalKgC7qCBIIeUVAZobAf0bIMwe8bUghBIKQH4AwLIVoQgAywABZWEXpyb
- Fi3q3QhgfQcTyzpcGSbcQbycm8eJ8ZE6BYFoXDDbdgsJlYggaEFokSn8PJOBgjPEHccx
- NyNJgLArxwgUUMQbEJRYeodge7MYAkfQJIOge4JIXAZIfsuEqA2QAQcoWYCwcwDICAew
- C426voAwCcKMnsZ7oZ3SBga4gQfodiH7jbfkcryCR8ebqDFSMptIeqTQEh05CxMwsQeA
- YIgga70qagiIBjT81D3joRRjFTZ0tI+C7JqZaLtRtKxbaK68S8LR9j+DizaAeQfAf4Y4
- agfwY4HYNQe4HczA14JYHIAwKYWgRQAwVgAABQEAggC6HKcEwiyhRKM4hSTQe4aQ+CBb
- eUjxWricizykKal5XwDYPoggDBowsQdAUYggb50hxzDbXAuzF825Dkiiobi7jzEkaKCr
- jpNJRTLUKi8AegdQe4ewBgAwf4BQIgOAe4IgXoZofoXs9osgAIcQWACwcgDoCYewDRMi
- voA468sy3hkofk2CiIawi4jdFrEE6pZzibo7Ubo1LUn8H4t4L6cwPYsYcAQoggc4TBsS
- HZ/sHTjibypTWE2wmqorjAm9E7Ok7c71L4o7ANOgpxEwehhwYIZ4foYIIANwe6m1IAr4
- IYGYAoJQXgSAA4Wof4BJDYAIDLrq3SHqb4fIb7y0QNTxEhWkdMHptsPMmtLQjC4M+8II
- AAE0IYsIbKmbDAWkJcShytUxg1OUsBtik870wNPL2TeL2ySBacK5WTKYeYdQfAewBtGo
- BQHwNYewHwYYaQfw8NRwrIAIbwVoC4cAEICweoD1JcJZ+boskD2oggfDWw6qKddk3Dob
- d6AUJzKcnJQxka3QfhEwATdgFoWIsYaStQeoaMJbACGghDyj3aVpD0vjojozFEBFZLEr
- Kkw0nrjYy78rF5SzNZhwXgZgfgXgIoOIfCUVbokgHYFoAgIQYgSwBFH4BNc4AADLnsQj
- 2UUiiNArezLz872dnKMMBVB1i8Hlo0GDGBhQfLhwGgZgsYZQFw6Qd7DbX4AdhrWETNYp
- hbF5NUc5NrPcGMLZk1osTUeQgYeYdIfAeoBoA4f4BYHIM4ewHIZAawf0SVlQh4bIVQC4
- bgEwDIepWADUSABIDaR0m7yp5TrT5DfFjtXtpKbs2jo4zaIboL2FiLK1yiNSDYggG1eA
- AZjorIfjgAZaRooQBbhxQkcNzVhsA5HUCEBrjquU09YVO8HNxycET8mxkVj7qJhwWwY4
- fgWwJYOwfCadRwGwFIAgHYZITQBAYgAABADgj6vskLEwiYfyBoe1p6CDgDzb9Ir0vdBU
- n9zMtBEL+IebgAF9H4yTgorQeteAaUrooQBjMjojZbEs6VslsUZ9/FVVnNPrxr2kZi7J
- qVZwfNtltwBYGgMgewGgZobMpczAAIaoVADAbAFQDYeh8QDKvoBQul/17LNbM6CFA7tj
- jViETDKl8F61yZ2MKrilpIeyBYEwUBeMu4rIdwXQggbJiIf5QgAIBTn9VBXV8TzlZUGM
- nbtKgCfF/ji9VVEa3LKJRTaL9xEweojYWIYYfgWIKAPQfCvUNQF4EgAQGgZ4T4BQZQAI
- BADRagDYLckS7CBIf4erM4/l70tWF1rks8i8Hd3GFsv1EK7lytiwnce4ggDoQk/QLIrY
- c7RwAAcAQIl5QgBF0JzdhmF9h0/svtpMZrecBljj3UrzPRN86iSye73LAb31tOBAmdGw
- GAMIe4GEVUVLlwAIaAUgDAagF4D4eiRYDMSABYEMHqBCTFvGOlzGF0kGQFKF8uItZdQG
- TOZxgIfJXwCU44DJ7orQcoSAxj6QAESq+jDtoUBdo82seU5o91ndBFYNLOUbjTA5zVjM
- wS7dfwggewwAVYX4fgVYKwPwfF6q+IFQEAAQF4agUYBQZ4AIA4DIgYDlMl3JPyTAYqLs
- vlT9E58l/S6mIjYUnmc8tiV6cKoAjSKJP9fmZwA9Xd/lZY4+QmdEBVr8Kzx8K8LMAlpE
- wYlFr6ygh1tIfQeoBdGoBIFoL4ewFoawcAf9Kq04AIZgUIDAZ4GYEQegF4f4DMiAAIBc
- RSNZXweuiiCDXtBOsNP1dsr+sSWjPx9b4NMGPloJt9PSxlEE5+AauKpM1CNk5lrZk+ji
- oV8Rttebx6x+uLyw6ge4+wUwXYfYUwLYQQfOOCigEoDgAIFQbIU4Bgah/4CwgYDwMYno
- wAf4el6A/iLSerEFBktePW08cmTEnBbTFdYVL2s+uVswheu46c6eQIitDjSI+WGKNzAs
- 7Y52tVsYk1ErUKMhkVFgorWGU1/eu25hg9yV2gvFZwfYeoBSGwBAFLvQFIbYcgf8GyP4
- Y4ToDAZgHAEwegGYf4DGq4Bi2Z3oegY46TL0mswMwh87Bmc+KW2VVmZNMGJUmmjW4ExG
- 2xqqA92dyAjBfNNqNoistetEn2QY82tNo+I+tjUdEu0zzuOM6rOkxAhYfgjAe4wAUIW4
- fYUIMAQwfIMCFQEWNoFAbgVIBgax/4CggYDoM6oAewZaByKbyTBG1GPUJy29L21+Tmsl
- 1dw9pAfxEwfCBohYhYA1dQBSRoBZ74ATX7Nme4ald0stVQA5ju3V/+PPDk6uUvCi2+nc
- TdsFPzKWTOGNoPNoo4eYdm6oBIpoA4EzbgEwb4c4f9URwQYITIDAYwHwFQei4gDD8BDK
- kYe5iyBEQNy9P+eJDu4+PmZiAO1sKtYabfSuj98Bascuu+Q51wBYGAggEYRTDerQsAfd
- qgAAb70Qdr1D84A5GucOALUliWvXClinBjeMc7ANssUWULsUvpOFOU2T9RhWwoAATYWQ
- fYTYMwRYfLC5eAD2zIEgcAVoBkjYAoCYiAD4NbyxGaiLrVD8w8vzUyld8ikxt1FybNFH
- IJhXUYf4yIDb1bnZGAgTYI2IdoW5i5KI6rhAhgBLN91XIpXWnCw1VedvAFjOKJ9WE+ur
- FaykxG4IAAegdgfgew8oAoEi0IEgcQdQf8sZdoXYSgDAYIIgF4ekFoC7noBVJRE48Ih2
- mt8ethH2FmPXS4zG4Qu+4EBMaPJ73R479Q6gEpsJK8/hKge79oAAaSUR4RpfgqK1YmnJ
- WVQNBLj2mNFzBHYetdsztuU9o4fXJgmwSwVwfYSwNYR4fPcRUADXb4EAcYWABobyaoB/
- G2znjAXw+CVHndBk6G/pNvI9xG2VoHnN82kAoWu9GQggCa/yTb/hd1C5i7/IhgAqHY8r
- K+UGJ0sHhXOA9G5nMWusmtemmcTIy4egdfjYAomIAYEQqQEQcwqydxKYWwR4C4XYJIGg
- eoIkXtToAJT5EpTsKV1ejHTnCXwe+8oGdKx6SayL+SH/iCNIfRXwAMPAFwXL8MiRnoaq
- jYAAeIYRpYBV0MecHviqCcHK3GsmttfKulY/YypHSXYvBDrw9M2htHso0B5IgABSKrfS
- ROCSfRwAELhkNh0PiERhoXCIBDjmWIOcICAoNAQACo2hb7c8PAMMf7/iQAlMLk8Llsrl
- UymENmcRmM3l8smYBl8xm0MAM3oMOoFEoUwmb4e0LDJphYdOcrqlVq1XhbwYsLaxXlEL
- BIIhYCnc7mc6m9npAAoc0hj+l1mr8spNvmsutcxnd0nkmtUunFzvU7uGAllwejsfj2Ac
- nAIhKr2ELpd7/dNYzEOV6LCy1KA4exKAARG8sAdNn0Nn9ph9ou8quGOiFnmsqvdGmW0u
- dsoz/2Op1tK3eEusRfz9hb3e8LEqVhYTJGZ6XTiL7eELZYsuYHA0LAgE1uFiXil9m8XF
- oHB39U3102243mz4XBtlIwes1+1tk/lD5fh/AEfQAAERhTn0Rg6ksfQ6uoqoKAeAAMnS
- WYIHIAQCAQj4IhCwz4Pooq7w83a+LlEcTN7D6cMK4D0vlFLhoW47kuWAAYF+hYEA9Bsd
- x4ZocIWfJxoWAwCu88D4r5D61tUwqdRHJcVpQnqfvOuazLWtq+yQo8Otc16exA2bkHqd
- p/OWuB/BAKp6hAdh4gAdkeIcVRDAqV4qh6e4oAABoQRwBz5xc3jdS3JclylLqiqJMEQr
- 5Q0wpMlEVyour2odFiZn8wp8uQAAbGsuM5VEzJrC8rJeoWAsjgM7stJtRkYog4irS5JE
- SUQ/K8Rc8z2K+nS9vwvVcNuux/HzTUAwGQ5Rn0Q49E0fQ9TkCIGpAdZaggc4B22AYAAm
- Ezi1wiT7TBR8UKuvNDsFYdiUdSEX1zQr5nupoABkZMhgpUd9qsaAhoWexsVTVoC26w1h
- N3dVY0ut9YQ8/D40tYFBRBcj1w63CUvfLElp3TqWntMp7n65B+A+Kh6g+d55gAd7qFIQ
- ILFULYhHsKoAAYDSwAqwSVSc2csXFRVZUJV+DpavcrxjKdG4q9Dw17S7VuSeqFhMTyFg
- iH9+a4hx+nwhZlBOmB+IWA4DoXbcur+u+lP2u1aY5E9eSSAFJp437y0zuWmvpLMW761e
- L6+44Bn2AABkET59EEP5PH0P7MAeBYAAkdhbAgdQCW6AZ/gmFK2AEj9XaKwMk7dRdE19
- pFMYx0q5vJoEYKNKstqFoufr4fR8qcN6Fg2NWu+EAB5mghZpiZXQAASBUTqBEss6M+qs
- bZW75JTvL54nJUQ+jhXvOE+9I7gmy4Hudp/nwfMBHxNU2Hjqs3qoTo+AmUYxCOfIuAAB
- YMoWAsCyjXqnsYU3VQLpkwrmgSa13K73pEOdqh5qZd1NFjA+QsFosSxpFeGqIbweyFjo
- FCkZIcHCcMQXMix2rbjVLDYUpY+DdDgKObulp6Lpm/wKPQlEr4/B7j/H6ARsoAw+ibHy
- H0Qgoh9iEIiA0BIAAIDsFuA4dQBgCABSK58lgAVurtMOuhdT2DeIldOz1UK8YDH0YhGV
- L5dYctRjY9InY+EaAYDQQsDxU4OnUHgMQrgWCHgIie9NqRMHYohYgeWCLCYapJkaW9Tp
- wG/u3RcwgvpsD9m3Z8oN1ZcWmKuh47QAA+B3D/HyPZsCbGUJ+IgH0MACBCCCDGASED/X
- /wBaO6s96HyhwFXS2s3MEo0upbrA2Q0Z3AQQUrDWZLPx/tlAA+shYKhWELAaDCPZVR+M
- sAANFf80RzJDbQ4h0cLIyF5ke+Q4o/mHENlCYOY7TZNwzfK+OGz33qw6dOAFKrGm3gAM
- XM8AhyACBqEaPh4JDwBjeFYA8b4IQLj9A6AACgKyXJHhafOZLsi3TEhPPZwEloHonb6o
- eRb2lxLtkOpZSw/lqgABEIlrIQJskMHuN8hY3HfPEGcqmDgA4OPbYfMt10657HkjWlZc
- UKVJRnUcrAvShHtpZnZUUlcoZhoxHkpoYQ0R+jCIgA4fIvwGjsAMAgA6RQJAoJ5LuSsB
- VETzds3WQ6UjYq2edVBRTHWoPjYkiWZrT1zxsmekBsBIJAAAA+Hw7zlEGkxHQJ8hY4RD
- oxRoAVVoBITVNkIZhiSIFZ0frxPF6JJ65T6bbUs9ytob0odW9lvsyl5MRIYNoao/RxAW
- IrS9AZDAMj+GEAwcYAQDALJOBFcDC1Dl/mM0KBjFJKwOudGqBClGMRme68qqtrHyQTsI
- p0fjhy2KAT4DMhYCqLP8vSAOQY9RqkLvcQsejxpRjeJc6MAsHABMGnhF+0ZD3apev63Z
- dEjT8UqPFO27ryrA2pV22yYhZSlV3koREZozB+DeBgCQAUF1UkMA+PEXQDRpgOAWhhb1
- 6Y0sRwTGCYOAFKzuXDa5VzpqPLEhhYCT9T1BXek/DCjOQCYKdgqABkmQ25nlYMAN0boo
- BEmutCzGc8YY3WozjVLtWLUV/bg61hdc3rOnWCw6qWMl5K/IWOQbw/R3F0sOABVoAAQj
- FEwAwXIOqLQXAk6BxGccbVwgPW8t1sWh4MxtaC7Fo1anjsE7kolK5E4LnvUSf6SZnaRk
- RMDSuAczX/qwsO1V/56q2tRpbB6gW9aJwroxvxL8itVAALEYY/BcEMowB4KQPgBh8FaI
- UBIYQAAIAmSwBoHNRaLP0bKS5dNlYNv7jnQKl2fSPerF5QMzq6pN1Xd5WaXoETDx/BHH
- 5PVCUiyuTeutUG2JZy9ivb+DJmQontautx+t6xpbcW2MRPrvHFn5Da1o5Bwj9HuBwCQA
- gEhTD2PcMRxQLlkAAEQbgqQFiYBABkAICgAgOBAScA6EI1aAyxYPQq8D4Uez/YJiNSVX
- Rkr2rJhNz5/q1cBCrlTQcAbxqdugla7dFt8ulzrTOm3upQ5uoKvXMcHQ2OMX6UY9TfAH
- H6P8AI1hwD+HGC4L49wZEQAYQwGQLAQgCDKM0ToCgtX534AwDZQwDgS5nswqtG9A77RZ
- y+5rzoHaO1RzLHi8MvbP6FYTdONJLc25JMjA+iMv6hnpOrTVQ9REoU6uO65u6V6ftXPS
- AZdK72mKFv8ho9x6KaAGPwlWRx+g2DKPcMA1Bvj+FeRBgwAANkMCGEIGQAwvivEMAgHm
- JouD/AGAfqgBgHEnAHnHa3I0RXZ2j5bd27249HdVdLbHio4cux70qz3fOl95+m9xHdJ+
- TfU/HqYiWUldmtH7OweQ8iUgP40AId38h8hUD4PgR4vxnh+hLCGByiqHmjmCGAgAQAMA
- Agjg/AwADAbAtgjACAJEiPHqawLwMQMwNQNwOQOwPF9h9B9jfBShdB+BwhBBQB9BQBwB
- 0B/hYCGBtqbCsLyKYCGLzCFgXlqM5AUgPgBALAQgMgBAGFVPJnhO6QPwkQkwlQlwmQNB
- +GShvhzh/B2urB/Brh4B6AABliGKeiFr7CFpuEGwCgAALsQLfCGQaITHRwmw2Q2w3Q3w
- 4Q2DxLxAAB5CGJwrJiGB1CGF6muPapBgAQxpxrevLw4xDRDxERExFO5nyHeGAQZCFvKx
- FxJxKRKxLRLxMRMxNRNxOROxPRPxQRQxRRRxSRSxTRTxURUxVRVxWRWxXRXxYRYxZRZx
- aRaxbRbxcRcxdRdxeRexfRfxgRgxhRhxiRixjRjxkRkxlRlxmRmxnRnxoRoxpRpxqRqx
- rRrxsRsxtRtxuRuxvRvxwRwxxRxxyRyxzRzx0R0x1R1x2R2x3R3x4R4x5R5x6R6x7R7x
- 8R8x9R9x+R+x/R/yASAyBSByCSCyDSDyESEyFSFyGSGyHSHyISIyJSJx4iAgAA8BAAAD
- AAAAAQBxAAABAQADAAAAAQCZAAABAgADAAAABAAALO4BAwADAAAAAQAFAAABBgADAAAA
- AQACAAABEQAEAAAAAQAAAAgBEgADAAAAAQABAAABFQADAAAAAQAEAAABFgADAAAAAQEh
- AAABFwAEAAAAAQAALCwBHAADAAAAAQABAAABPQADAAAAAQACAAABUgADAAAAAQABAAAB
- UwADAAAABAAALPaHcwAHAAAD9AAALP4AAAAAAAgACAAIAAgAAQABAAEAAQAAA/RhcHBs
- AgAAAG1udHJSR0IgWFlaIAfYAAEAHwAOACwAIGFjc3BBUFBMAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAD21gABAAAAANMtYXBwbOoCxvvn7AuJW4CIyiOWp2wAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAADnJYWVoAAAEsAAAAFGdYWVoAAAFAAAAAFGJYWVoA
- AAFUAAAAFHd0cHQAAAFoAAAAFGNoYWQAAAF8AAAALHJUUkMAAAGoAAAADmdUUkMAAAG4
- AAAADmJUUkMAAAHIAAAADnZjZ3QAAAHYAAAAMG5kaW4AAAIIAAAAOGRlc2MAAAJAAAAA
- Z2RzY20AAAKoAAABAG1tb2QAAAOoAAAAKGNwcnQAAAPQAAAAJFhZWiAAAAAAAABxDgAA
- OesAAAOdWFlaIAAAAAAAAF8vAACzygAAFlBYWVogAAAAAAAAJpgAABJgAAC5OVhZWiAA
- AAAAAADzzwABAAAAARhic2YzMgAAAAAAAQwaAAAFwP//8v8AAAdgAAD9zv//+5j///2W
- AAAD9AAAv05jdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAGN1cnYAAAAAAAAA
- AQHNAAB2Y2d0AAAAAAAAAAEAANF0AAAAAAABAAAAANF0AAAAAAABAAAAANF0AAAAAAAB
- AABuZGluAAAAAAAAADAAAKPAAABUgAAATMAAAJuAAAAm9wAAEXsAAFAAAABUAAACMzMA
- AjMzAAIzM2Rlc2MAAAAAAAAADURFTEwgMjQwNUZQVwAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
- AAAAAAAAAAAAbWx1YwAAAAAAAAASAAAADG5iTk8AAAAYAAAA6HB0UFQAAAAYAAAA6HN2
- U0UAAAAYAAAA6GZpRkkAAAAYAAAA6GRhREsAAAAYAAAA6HpoQ04AAAAYAAAA6GZyRlIA
- AAAYAAAA6GphSlAAAAAYAAAA6GVuVVMAAAAYAAAA6HBsUEwAAAAYAAAA6HB0QlIAAAAY
- AAAA6GVzRVMAAAAYAAAA6HpoVFcAAAAYAAAA6HJ1UlUAAAAYAAAA6GtvS1IAAAAYAAAA
- 6GRlREUAAAAYAAAA6G5sTkwAAAAYAAAA6Gl0SVQAAAAYAAAA6ABEAEUATABMACAAMgA0
- ADAANQBGAFAAV21tb2QAAAAAAAAQrAAAoBAwNzNTv9zMAAAAAAAAAAAAAAAAAAAAAAB0
- ZXh0AAAAAENvcHlyaWdodCBBcHBsZSwgSW5jLiwgMjAwOAA=
- </data>
- <key>ReadOnly</key>
- <string>NO</string>
- <key>RowAlign</key>
- <integer>1</integer>
- <key>RowSpacing</key>
- <real>36</real>
- <key>SheetTitle</key>
- <string>Canvas 1</string>
- <key>SmartAlignmentGuidesActive</key>
- <string>NO</string>
- <key>SmartDistanceGuidesActive</key>
- <string>NO</string>
- <key>UniqueID</key>
- <integer>1</integer>
- <key>UseEntirePage</key>
- <false/>
- <key>VPages</key>
- <integer>1</integer>
- <key>WindowInfo</key>
- <dict>
- <key>CurrentSheet</key>
- <integer>0</integer>
- <key>ExpandedCanvases</key>
- <array>
- <dict>
- <key>name</key>
- <string>Canvas 1</string>
- </dict>
- </array>
- <key>Frame</key>
- <string>{{2002, 20}, {1215, 1180}}</string>
- <key>ListView</key>
- <true/>
- <key>OutlineWidth</key>
- <integer>142</integer>
- <key>RightSidebar</key>
- <false/>
- <key>Sidebar</key>
- <true/>
- <key>SidebarWidth</key>
- <integer>157</integer>
- <key>VisibleRegion</key>
- <string>{{-4.5, 0.5}, {522, 535.5}}</string>
- <key>Zoom</key>
- <real>2</real>
- <key>ZoomValues</key>
- <array>
- <array>
- <string>Canvas 1</string>
- <real>2</real>
- <real>4</real>
- </array>
- </array>
- </dict>
- <key>saveQuickLookFiles</key>
- <string>YES</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender-Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender-Info.plist
deleted file mode 100644
index 976687e116..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender-Info.plist
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleDisplayName</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string>crash_report_sender</string>
- <key>CFBundleIdentifier</key>
- <string>com.Breakpad.${PRODUCT_NAME:identifier}</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>LSHasLocalizedDisplayName</key>
- <true/>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h
deleted file mode 100644
index 6a29d48a18..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// This component uses the HTTPMultipartUpload of the breakpad project to send
-// the minidump and associated data to the crash reporting servers.
-// It will perform throttling based on the parameters passed to it and will
-// prompt the user to send the minidump.
-
-#import <Cocoa/Cocoa.h>
-
-#include "client/mac/sender/uploader.h"
-#import "GTMDefines.h"
-
-// We're sublcassing NSTextField in order to override a particular
-// method (see the implementation) that lets us reject changes if they
-// are longer than a particular length. Bindings would normally solve
-// this problem, but when we implemented a validation method, and
-// returned NO for strings that were too long, the UI was not updated
-// right away, which was a poor user experience. The UI would be
-// updated as soon as the text field lost first responder status,
-// which isn't soon enough. It is a known bug that the UI KVO didn't
-// work in the middle of a validation.
-@interface LengthLimitingTextField : NSTextField {
- @private
- NSUInteger maximumLength_;
-}
-
-- (void)setMaximumLength:(NSUInteger)maxLength;
-@end
-
-@interface Reporter : NSObject {
- @public
- IBOutlet NSWindow *alertWindow_; // The alert window
-
- // Grouping boxes used for resizing.
- IBOutlet NSBox *headerBox_;
- IBOutlet NSBox *preEmailBox_;
- IBOutlet NSBox *emailSectionBox_;
- // Localized elements (or things that need to be moved during localization).
- IBOutlet NSTextField *dialogTitle_;
- IBOutlet NSTextField *commentMessage_;
- IBOutlet NSTextField *emailMessage_;
- IBOutlet NSTextField *emailLabel_;
- IBOutlet NSTextField *privacyLinkLabel_;
- IBOutlet NSButton *sendButton_;
- IBOutlet NSButton *cancelButton_;
- IBOutlet LengthLimitingTextField *emailEntryField_;
- IBOutlet LengthLimitingTextField *commentsEntryField_;
- IBOutlet NSTextField *countdownLabel_;
- IBOutlet NSView *privacyLinkArrow_;
-
- // Text field bindings, for user input.
- NSString *commentsValue_; // Comments from the user
- NSString *emailValue_; // Email from the user
- NSString *countdownMessage_; // Message indicating time
- // left for input.
- @private
- NSTimeInterval remainingDialogTime_; // Keeps track of how long
- // we have until we cancel
- // the dialog
- NSTimer *messageTimer_; // Timer we use to update
- // the dialog
- Uploader* uploader_; // Uploader we use to send the data.
-}
-
-// Stops the modal panel with an NSAlertDefaultReturn value. This is the action
-// invoked by the "Send Report" button.
-- (IBAction)sendReport:(id)sender;
-// Stops the modal panel with an NSAlertAlternateReturn value. This is the
-// action invoked by the "Cancel" button.
-- (IBAction)cancel:(id)sender;
-// Opens the Privacy Policy url in the default web browser.
-- (IBAction)showPrivacyPolicy:(id)sender;
-
-// Delegate methods for the NSTextField for comments. We want to capture the
-// Return key and use it to send the message when no text has been entered.
-// Otherwise, we want Return to add a carriage return to the comments field.
-- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView
- doCommandBySelector:(SEL)commandSelector;
-
-// Accessors to make bindings work
-- (NSString *)commentsValue;
-- (void)setCommentsValue:(NSString *)value;
-
-- (NSString *)emailValue;
-- (void)setEmailValue:(NSString *)value;
-
-- (NSString *)countdownMessage;
-- (void)setCountdownMessage:(NSString *)value;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.icns b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.icns
deleted file mode 100644
index e8c21242bf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.icns
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m
deleted file mode 100644
index 88d26fb038..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/crash_report_sender.m
+++ /dev/null
@@ -1,755 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import "client/mac/sender/crash_report_sender.h"
-
-#import <Cocoa/Cocoa.h>
-#import <pwd.h>
-#import <sys/stat.h>
-#import <SystemConfiguration/SystemConfiguration.h>
-#import <unistd.h>
-
-#import "client/apple/Framework/BreakpadDefines.h"
-#import "common/mac/GTMLogger.h"
-#import "common/mac/HTTPMultipartUpload.h"
-
-
-#define kLastSubmission @"LastSubmission"
-const int kUserCommentsMaxLength = 1500;
-const int kEmailMaxLength = 64;
-
-#define kApplePrefsSyncExcludeAllKey \
- @"com.apple.PreferenceSync.ExcludeAllSyncKeys"
-
-#pragma mark -
-
-@interface NSView (ResizabilityExtentions)
-// Shifts the view vertically by the given amount.
-- (void)breakpad_shiftVertically:(CGFloat)offset;
-
-// Shifts the view horizontally by the given amount.
-- (void)breakpad_shiftHorizontally:(CGFloat)offset;
-@end
-
-@implementation NSView (ResizabilityExtentions)
-- (void)breakpad_shiftVertically:(CGFloat)offset {
- NSPoint origin = [self frame].origin;
- origin.y += offset;
- [self setFrameOrigin:origin];
-}
-
-- (void)breakpad_shiftHorizontally:(CGFloat)offset {
- NSPoint origin = [self frame].origin;
- origin.x += offset;
- [self setFrameOrigin:origin];
-}
-@end
-
-@interface NSWindow (ResizabilityExtentions)
-// Adjusts the window height by heightDelta relative to its current height,
-// keeping all the content at the same size.
-- (void)breakpad_adjustHeight:(CGFloat)heightDelta;
-@end
-
-@implementation NSWindow (ResizabilityExtentions)
-- (void)breakpad_adjustHeight:(CGFloat)heightDelta {
- [[self contentView] setAutoresizesSubviews:NO];
-
- NSRect windowFrame = [self frame];
- windowFrame.size.height += heightDelta;
- [self setFrame:windowFrame display:YES];
- // For some reason the content view is resizing, but not adjusting its origin,
- // so correct it manually.
- [[self contentView] setFrameOrigin:NSMakePoint(0, 0)];
-
- [[self contentView] setAutoresizesSubviews:YES];
-}
-@end
-
-@interface NSTextField (ResizabilityExtentions)
-// Grows or shrinks the height of the field to the minimum required to show the
-// current text, preserving the existing width and origin.
-// Returns the change in height.
-- (CGFloat)breakpad_adjustHeightToFit;
-
-// Grows or shrinks the width of the field to the minimum required to show the
-// current text, preserving the existing height and origin.
-// Returns the change in width.
-- (CGFloat)breakpad_adjustWidthToFit;
-@end
-
-@implementation NSTextField (ResizabilityExtentions)
-- (CGFloat)breakpad_adjustHeightToFit {
- NSRect oldFrame = [self frame];
- // Starting with the 10.5 SDK, height won't grow, so make it huge to start.
- NSRect presizeFrame = oldFrame;
- presizeFrame.size.height = MAXFLOAT;
- // sizeToFit will blow out the width rather than making the field taller, so
- // we do it manually.
- NSSize newSize = [[self cell] cellSizeForBounds:presizeFrame];
- NSRect newFrame = NSMakeRect(oldFrame.origin.x, oldFrame.origin.y,
- NSWidth(oldFrame), newSize.height);
- [self setFrame:newFrame];
-
- return newSize.height - NSHeight(oldFrame);
-}
-
-- (CGFloat)breakpad_adjustWidthToFit {
- NSRect oldFrame = [self frame];
- [self sizeToFit];
- return NSWidth([self frame]) - NSWidth(oldFrame);
-}
-@end
-
-@interface NSButton (ResizabilityExtentions)
-// Resizes to fit the label using IB-style size-to-fit metrics and enforcing a
-// minimum width of 70, while preserving the right edge location.
-// Returns the change in width.
-- (CGFloat)breakpad_smartSizeToFit;
-@end
-
-@implementation NSButton (ResizabilityExtentions)
-- (CGFloat)breakpad_smartSizeToFit {
- NSRect oldFrame = [self frame];
- [self sizeToFit];
- NSRect newFrame = [self frame];
- // sizeToFit gives much worse results that IB's Size to Fit option. This is
- // the amount of padding IB adds over a sizeToFit, empirically determined.
- const float kExtraPaddingAmount = 12;
- const float kMinButtonWidth = 70; // The default button size in IB.
- newFrame.size.width = NSWidth(newFrame) + kExtraPaddingAmount;
- if (NSWidth(newFrame) < kMinButtonWidth)
- newFrame.size.width = kMinButtonWidth;
- // Preserve the right edge location.
- newFrame.origin.x = NSMaxX(oldFrame) - NSWidth(newFrame);
- [self setFrame:newFrame];
- return NSWidth(newFrame) - NSWidth(oldFrame);
-}
-@end
-
-#pragma mark -
-
-@interface Reporter(PrivateMethods)
-- (id)initWithConfigFile:(const char *)configFile;
-
-// Returns YES if it has been long enough since the last report that we should
-// submit a report for this crash.
-- (BOOL)reportIntervalElapsed;
-
-// Returns YES if we should send the report without asking the user first.
-- (BOOL)shouldSubmitSilently;
-
-// Returns YES if the minidump was generated on demand.
-- (BOOL)isOnDemand;
-
-// Returns YES if we should ask the user to provide comments.
-- (BOOL)shouldRequestComments;
-
-// Returns YES if we should ask the user to provide an email address.
-- (BOOL)shouldRequestEmail;
-
-// Shows UI to the user to ask for permission to send and any extra information
-// we've been instructed to request. Returns YES if the user allows the report
-// to be sent.
-- (BOOL)askUserPermissionToSend;
-
-// Returns the short description of the crash, suitable for use as a dialog
-// title (e.g., "The application Foo has quit unexpectedly").
-- (NSString*)shortDialogMessage;
-
-// Return explanatory text about the crash and the reporter, suitable for the
-// body text of a dialog.
-- (NSString*)explanatoryDialogText;
-
-// Returns the amount of time the UI should be shown before timing out.
-- (NSTimeInterval)messageTimeout;
-
-// Preps the comment-prompting alert window for display:
-// * localizes all the elements
-// * resizes and adjusts layout as necessary for localization
-// * removes the email section if includeEmail is NO
-- (void)configureAlertWindowIncludingEmail:(BOOL)includeEmail;
-
-// Rmevoes the email section of the dialog, adjusting the rest of the window
-// as necessary.
-- (void)removeEmailPrompt;
-
-// Run an alert window with the given timeout. Returns
-// NSRunStoppedResponse if the timeout is exceeded. A timeout of 0
-// queues the message immediately in the modal run loop.
-- (NSInteger)runModalWindow:(NSWindow*)window
- withTimeout:(NSTimeInterval)timeout;
-
-// This method is used to periodically update the UI with how many
-// seconds are left in the dialog display.
-- (void)updateSecondsLeftInDialogDisplay:(NSTimer*)theTimer;
-
-// When we receive this notification, it means that the user has
-// begun editing the email address or comments field, and we disable
-// the timers so that the user has as long as they want to type
-// in their comments/email.
-- (void)controlTextDidBeginEditing:(NSNotification *)aNotification;
-
-- (void)report;
-
-@end
-
-@implementation Reporter
-//=============================================================================
-- (id)initWithConfigFile:(const char *)configFile {
- if ((self = [super init])) {
- remainingDialogTime_ = 0;
- uploader_ = [[Uploader alloc] initWithConfigFile:configFile];
- if (!uploader_) {
- [self release];
- return nil;
- }
- }
- return self;
-}
-
-//=============================================================================
-- (BOOL)askUserPermissionToSend {
- // Initialize Cocoa, needed to display the alert
- NSApplicationLoad();
-
- // Get the timeout value for the notification.
- NSTimeInterval timeout = [self messageTimeout];
-
- NSInteger buttonPressed = NSAlertAlternateReturn;
- // Determine whether we should create a text box for user feedback.
- if ([self shouldRequestComments]) {
- BOOL didLoadNib = [NSBundle loadNibNamed:@"Breakpad" owner:self];
- if (!didLoadNib) {
- return NO;
- }
-
- [self configureAlertWindowIncludingEmail:[self shouldRequestEmail]];
-
- buttonPressed = [self runModalWindow:alertWindow_ withTimeout:timeout];
-
- // Extract info from the user into the uploader_.
- if ([self commentsValue]) {
- [[uploader_ parameters] setObject:[self commentsValue]
- forKey:@BREAKPAD_COMMENTS];
- }
- if ([self emailValue]) {
- [[uploader_ parameters] setObject:[self emailValue]
- forKey:@BREAKPAD_EMAIL];
- }
- } else {
- // Create an alert panel to tell the user something happened
- NSPanel* alert =
- NSGetAlertPanel([self shortDialogMessage],
- @"%@",
- NSLocalizedString(@"sendReportButton", @""),
- NSLocalizedString(@"cancelButton", @""),
- nil,
- [self explanatoryDialogText]);
-
- // Pop the alert with an automatic timeout, and wait for the response
- buttonPressed = [self runModalWindow:alert withTimeout:timeout];
-
- // Release the panel memory
- NSReleaseAlertPanel(alert);
- }
- return buttonPressed == NSAlertDefaultReturn;
-}
-
-- (void)configureAlertWindowIncludingEmail:(BOOL)includeEmail {
- // Swap in localized values, making size adjustments to impacted elements as
- // we go. Remember that the origin is in the bottom left, so elements above
- // "fall" as text areas are shrunk from their overly-large IB sizes.
-
- // Localize the header. No resizing needed, as it has plenty of room.
- [dialogTitle_ setStringValue:[self shortDialogMessage]];
-
- // Localize the explanatory text field.
- [commentMessage_ setStringValue:[NSString stringWithFormat:@"%@\n\n%@",
- [self explanatoryDialogText],
- NSLocalizedString(@"commentsMsg", @"")]];
- CGFloat commentHeightDelta = [commentMessage_ breakpad_adjustHeightToFit];
- [headerBox_ breakpad_shiftVertically:commentHeightDelta];
- [alertWindow_ breakpad_adjustHeight:commentHeightDelta];
-
- // Either localize the email explanation field or remove the whole email
- // section depending on whether or not we are asking for email.
- if (includeEmail) {
- [emailMessage_ setStringValue:NSLocalizedString(@"emailMsg", @"")];
- CGFloat emailHeightDelta = [emailMessage_ breakpad_adjustHeightToFit];
- [preEmailBox_ breakpad_shiftVertically:emailHeightDelta];
- [alertWindow_ breakpad_adjustHeight:emailHeightDelta];
- } else {
- [self removeEmailPrompt]; // Handles necessary resizing.
- }
-
- // Localize the email label, and shift the associated text field.
- [emailLabel_ setStringValue:NSLocalizedString(@"emailLabel", @"")];
- CGFloat emailLabelWidthDelta = [emailLabel_ breakpad_adjustWidthToFit];
- [emailEntryField_ breakpad_shiftHorizontally:emailLabelWidthDelta];
-
- // Localize the privacy policy label, and keep it right-aligned to the arrow.
- [privacyLinkLabel_ setStringValue:NSLocalizedString(@"privacyLabel", @"")];
- CGFloat privacyLabelWidthDelta =
- [privacyLinkLabel_ breakpad_adjustWidthToFit];
- [privacyLinkLabel_ breakpad_shiftHorizontally:(-privacyLabelWidthDelta)];
-
- // Ensure that the email field and the privacy policy link don't overlap.
- CGFloat kMinControlPadding = 8;
- CGFloat maxEmailFieldWidth = NSMinX([privacyLinkLabel_ frame]) -
- NSMinX([emailEntryField_ frame]) -
- kMinControlPadding;
- if (NSWidth([emailEntryField_ bounds]) > maxEmailFieldWidth &&
- maxEmailFieldWidth > 0) {
- NSSize emailSize = [emailEntryField_ frame].size;
- emailSize.width = maxEmailFieldWidth;
- [emailEntryField_ setFrameSize:emailSize];
- }
-
- // Localize the placeholder text.
- [[commentsEntryField_ cell]
- setPlaceholderString:NSLocalizedString(@"commentsPlaceholder", @"")];
- [[emailEntryField_ cell]
- setPlaceholderString:NSLocalizedString(@"emailPlaceholder", @"")];
-
- // Localize the buttons, and keep the cancel button at the right distance.
- [sendButton_ setTitle:NSLocalizedString(@"sendReportButton", @"")];
- CGFloat sendButtonWidthDelta = [sendButton_ breakpad_smartSizeToFit];
- [cancelButton_ breakpad_shiftHorizontally:(-sendButtonWidthDelta)];
- [cancelButton_ setTitle:NSLocalizedString(@"cancelButton", @"")];
- [cancelButton_ breakpad_smartSizeToFit];
-}
-
-- (void)removeEmailPrompt {
- [emailSectionBox_ setHidden:YES];
- CGFloat emailSectionHeight = NSHeight([emailSectionBox_ frame]);
- [preEmailBox_ breakpad_shiftVertically:(-emailSectionHeight)];
- [alertWindow_ breakpad_adjustHeight:(-emailSectionHeight)];
-}
-
-- (NSInteger)runModalWindow:(NSWindow*)window
- withTimeout:(NSTimeInterval)timeout {
- // Queue a |stopModal| message to be performed in |timeout| seconds.
- if (timeout > 0.001) {
- remainingDialogTime_ = timeout;
- SEL updateSelector = @selector(updateSecondsLeftInDialogDisplay:);
- messageTimer_ = [NSTimer scheduledTimerWithTimeInterval:1.0
- target:self
- selector:updateSelector
- userInfo:nil
- repeats:YES];
- }
-
- // Run the window modally and wait for either a |stopModal| message or a
- // button click.
- [NSApp activateIgnoringOtherApps:YES];
- NSInteger returnMethod = [NSApp runModalForWindow:window];
-
- return returnMethod;
-}
-
-- (IBAction)sendReport:(id)sender {
- // Force the text fields to end editing so text for the currently focused
- // field will be commited.
- [alertWindow_ makeFirstResponder:alertWindow_];
-
- [alertWindow_ orderOut:self];
- // Use NSAlertDefaultReturn so that the return value of |runModalWithWindow|
- // matches the AppKit function NSRunAlertPanel()
- [NSApp stopModalWithCode:NSAlertDefaultReturn];
-}
-
-// UI Button Actions
-//=============================================================================
-- (IBAction)cancel:(id)sender {
- [alertWindow_ orderOut:self];
- // Use NSAlertDefaultReturn so that the return value of |runModalWithWindow|
- // matches the AppKit function NSRunAlertPanel()
- [NSApp stopModalWithCode:NSAlertAlternateReturn];
-}
-
-- (IBAction)showPrivacyPolicy:(id)sender {
- // Get the localized privacy policy URL and open it in the default browser.
- NSURL* privacyPolicyURL =
- [NSURL URLWithString:NSLocalizedString(@"privacyPolicyURL", @"")];
- [[NSWorkspace sharedWorkspace] openURL:privacyPolicyURL];
-}
-
-// Text Field Delegate Methods
-//=============================================================================
-- (BOOL) control:(NSControl*)control
- textView:(NSTextView*)textView
-doCommandBySelector:(SEL)commandSelector {
- BOOL result = NO;
- // If the user has entered text on the comment field, don't end
- // editing on "return".
- if (control == commentsEntryField_ &&
- commandSelector == @selector(insertNewline:)
- && [[textView string] length] > 0) {
- [textView insertNewlineIgnoringFieldEditor:self];
- result = YES;
- }
- return result;
-}
-
-- (void)controlTextDidBeginEditing:(NSNotification *)aNotification {
- [messageTimer_ invalidate];
- [self setCountdownMessage:@""];
-}
-
-- (void)updateSecondsLeftInDialogDisplay:(NSTimer*)theTimer {
- remainingDialogTime_ -= 1;
-
- NSString *countdownMessage;
- NSString *formatString;
-
- int displayedTimeLeft; // This can be either minutes or seconds.
-
- if (remainingDialogTime_ > 59) {
- // calculate minutes remaining for UI purposes
- displayedTimeLeft = (int)(remainingDialogTime_ / 60);
-
- if (displayedTimeLeft == 1) {
- formatString = NSLocalizedString(@"countdownMsgMinuteSingular", @"");
- } else {
- formatString = NSLocalizedString(@"countdownMsgMinutesPlural", @"");
- }
- } else {
- displayedTimeLeft = (int)remainingDialogTime_;
- if (displayedTimeLeft == 1) {
- formatString = NSLocalizedString(@"countdownMsgSecondSingular", @"");
- } else {
- formatString = NSLocalizedString(@"countdownMsgSecondsPlural", @"");
- }
- }
- countdownMessage = [NSString stringWithFormat:formatString,
- displayedTimeLeft];
- if (remainingDialogTime_ <= 30) {
- [countdownLabel_ setTextColor:[NSColor redColor]];
- }
- [self setCountdownMessage:countdownMessage];
- if (remainingDialogTime_ <= 0) {
- [messageTimer_ invalidate];
- [NSApp stopModal];
- }
-}
-
-
-
-#pragma mark Accessors
-#pragma mark -
-//=============================================================================
-
-- (NSString *)commentsValue {
- return [[commentsValue_ retain] autorelease];
-}
-
-- (void)setCommentsValue:(NSString *)value {
- if (commentsValue_ != value) {
- [commentsValue_ release];
- commentsValue_ = [value copy];
- }
-}
-
-- (NSString *)emailValue {
- return [[emailValue_ retain] autorelease];
-}
-
-- (void)setEmailValue:(NSString *)value {
- if (emailValue_ != value) {
- [emailValue_ release];
- emailValue_ = [value copy];
- }
-}
-
-- (NSString *)countdownMessage {
- return [[countdownMessage_ retain] autorelease];
-}
-
-- (void)setCountdownMessage:(NSString *)value {
- if (countdownMessage_ != value) {
- [countdownMessage_ release];
- countdownMessage_ = [value copy];
- }
-}
-
-#pragma mark -
-//=============================================================================
-- (BOOL)reportIntervalElapsed {
- float interval = [[[uploader_ parameters]
- objectForKey:@BREAKPAD_REPORT_INTERVAL] floatValue];
- NSString *program = [[uploader_ parameters] objectForKey:@BREAKPAD_PRODUCT];
- NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
- NSMutableDictionary *programDict =
- [NSMutableDictionary dictionaryWithDictionary:[ud dictionaryForKey:program]];
- NSNumber *lastTimeNum = [programDict objectForKey:kLastSubmission];
- NSTimeInterval lastTime = lastTimeNum ? [lastTimeNum floatValue] : 0;
- NSTimeInterval now = CFAbsoluteTimeGetCurrent();
- NSTimeInterval spanSeconds = (now - lastTime);
-
- [programDict setObject:[NSNumber numberWithDouble:now]
- forKey:kLastSubmission];
- [ud setObject:programDict forKey:program];
- [ud synchronize];
-
- // If we've specified an interval and we're within that time, don't ask the
- // user if we should report
- GTMLoggerDebug(@"Reporter Interval: %f", interval);
- if (interval > spanSeconds) {
- GTMLoggerDebug(@"Within throttling interval, not sending report");
- return NO;
- }
- return YES;
-}
-
-- (BOOL)isOnDemand {
- return [[[uploader_ parameters] objectForKey:@BREAKPAD_ON_DEMAND]
- isEqualToString:@"YES"];
-}
-
-- (BOOL)shouldSubmitSilently {
- return [[[uploader_ parameters] objectForKey:@BREAKPAD_SKIP_CONFIRM]
- isEqualToString:@"YES"];
-}
-
-- (BOOL)shouldRequestComments {
- return [[[uploader_ parameters] objectForKey:@BREAKPAD_REQUEST_COMMENTS]
- isEqualToString:@"YES"];
-}
-
-- (BOOL)shouldRequestEmail {
- return [[[uploader_ parameters] objectForKey:@BREAKPAD_REQUEST_EMAIL]
- isEqualToString:@"YES"];
-}
-
-- (NSString*)shortDialogMessage {
- NSString *displayName =
- [[uploader_ parameters] objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
- if (![displayName length])
- displayName = [[uploader_ parameters] objectForKey:@BREAKPAD_PRODUCT];
-
- if ([self isOnDemand]) {
- // Local variable to pacify clang's -Wformat-extra-args.
- NSString* format = NSLocalizedString(@"noCrashDialogHeader", @"");
- return [NSString stringWithFormat:format, displayName];
- } else {
- // Local variable to pacify clang's -Wformat-extra-args.
- NSString* format = NSLocalizedString(@"crashDialogHeader", @"");
- return [NSString stringWithFormat:format, displayName];
- }
-}
-
-- (NSString*)explanatoryDialogText {
- NSString *displayName =
- [[uploader_ parameters] objectForKey:@BREAKPAD_PRODUCT_DISPLAY];
- if (![displayName length])
- displayName = [[uploader_ parameters] objectForKey:@BREAKPAD_PRODUCT];
-
- NSString *vendor = [[uploader_ parameters] objectForKey:@BREAKPAD_VENDOR];
- if (![vendor length])
- vendor = @"unknown vendor";
-
- if ([self isOnDemand]) {
- // Local variable to pacify clang's -Wformat-extra-args.
- NSString* format = NSLocalizedString(@"noCrashDialogMsg", @"");
- return [NSString stringWithFormat:format, vendor, displayName];
- } else {
- // Local variable to pacify clang's -Wformat-extra-args.
- NSString* format = NSLocalizedString(@"crashDialogMsg", @"");
- return [NSString stringWithFormat:format, vendor];
- }
-}
-
-- (NSTimeInterval)messageTimeout {
- // Get the timeout value for the notification.
- NSTimeInterval timeout = [[[uploader_ parameters]
- objectForKey:@BREAKPAD_CONFIRM_TIMEOUT] floatValue];
- // Require a timeout of at least a minute (except 0, which means no timeout).
- if (timeout > 0.001 && timeout < 60.0) {
- timeout = 60.0;
- }
- return timeout;
-}
-
-- (void)report {
- [uploader_ report];
-}
-
-//=============================================================================
-- (void)dealloc {
- [uploader_ release];
- [super dealloc];
-}
-
-- (void)awakeFromNib {
- [emailEntryField_ setMaximumLength:kEmailMaxLength];
- [commentsEntryField_ setMaximumLength:kUserCommentsMaxLength];
-}
-
-@end
-
-//=============================================================================
-@implementation LengthLimitingTextField
-
-- (void)setMaximumLength:(NSUInteger)maxLength {
- maximumLength_ = maxLength;
-}
-
-// This is the method we're overriding in NSTextField, which lets us
-// limit the user's input if it makes the string too long.
-- (BOOL) textView:(NSTextView *)textView
-shouldChangeTextInRange:(NSRange)affectedCharRange
- replacementString:(NSString *)replacementString {
-
- // Sometimes the range comes in invalid, so reject if we can't
- // figure out if the replacement text is too long.
- if (affectedCharRange.location == NSNotFound) {
- return NO;
- }
- // Figure out what the new string length would be, taking into
- // account user selections.
- NSUInteger newStringLength =
- [[textView string] length] - affectedCharRange.length +
- [replacementString length];
- if (newStringLength > maximumLength_) {
- return NO;
- } else {
- return YES;
- }
-}
-
-// Cut, copy, and paste have to be caught specifically since there is no menu.
-- (BOOL)performKeyEquivalent:(NSEvent*)event {
- // Only handle the key equivalent if |self| is the text field with focus.
- NSText* fieldEditor = [self currentEditor];
- if (fieldEditor != nil) {
- // Check for a single "Command" modifier
- NSUInteger modifiers = [event modifierFlags];
- modifiers &= NSDeviceIndependentModifierFlagsMask;
- if (modifiers == NSCommandKeyMask) {
- // Now, check for Select All, Cut, Copy, or Paste key equivalents.
- NSString* characters = [event characters];
- // Select All is Command-A.
- if ([characters isEqualToString:@"a"]) {
- [fieldEditor selectAll:self];
- return YES;
- // Cut is Command-X.
- } else if ([characters isEqualToString:@"x"]) {
- [fieldEditor cut:self];
- return YES;
- // Copy is Command-C.
- } else if ([characters isEqualToString:@"c"]) {
- [fieldEditor copy:self];
- return YES;
- // Paste is Command-V.
- } else if ([characters isEqualToString:@"v"]) {
- [fieldEditor paste:self];
- return YES;
- }
- }
- }
- // Let the super class handle the rest (e.g. Command-Period will cancel).
- return [super performKeyEquivalent:event];
-}
-
-@end
-
-//=============================================================================
-int main(int argc, const char *argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-#if DEBUG
- // Log to stderr in debug builds.
- [GTMLogger setSharedLogger:[GTMLogger standardLoggerWithStderr]];
-#endif
- GTMLoggerDebug(@"Reporter Launched, argc=%d", argc);
- // The expectation is that there will be one argument which is the path
- // to the configuration file
- if (argc != 2) {
- exit(1);
- }
-
- Reporter *reporter = [[Reporter alloc] initWithConfigFile:argv[1]];
- if (!reporter) {
- GTMLoggerDebug(@"reporter initialization failed");
- exit(1);
- }
-
- // only submit a report if we have not recently crashed in the past
- BOOL shouldSubmitReport = [reporter reportIntervalElapsed];
- BOOL okayToSend = NO;
-
- // ask user if we should send
- if (shouldSubmitReport) {
- if ([reporter shouldSubmitSilently]) {
- GTMLoggerDebug(@"Skipping confirmation and sending report");
- okayToSend = YES;
- } else {
- okayToSend = [reporter askUserPermissionToSend];
- }
- }
-
- // If we're running as root, switch over to nobody
- if (getuid() == 0 || geteuid() == 0) {
- struct passwd *pw = getpwnam("nobody");
-
- // If we can't get a non-root uid, don't send the report
- if (!pw) {
- GTMLoggerDebug(@"!pw - %s", strerror(errno));
- exit(0);
- }
-
- if (setgid(pw->pw_gid) == -1) {
- GTMLoggerDebug(@"setgid(pw->pw_gid) == -1 - %s", strerror(errno));
- exit(0);
- }
-
- if (setuid(pw->pw_uid) == -1) {
- GTMLoggerDebug(@"setuid(pw->pw_uid) == -1 - %s", strerror(errno));
- exit(0);
- }
- }
- else {
- GTMLoggerDebug(@"getuid() !=0 || geteuid() != 0");
- }
-
- if (okayToSend && shouldSubmitReport) {
- GTMLoggerDebug(@"Sending Report");
- [reporter report];
- GTMLoggerDebug(@"Report Sent!");
- } else {
- GTMLoggerDebug(@"Not sending crash report okayToSend=%d, "\
- "shouldSubmitReport=%d", okayToSend, shouldSubmitReport);
- }
-
- GTMLoggerDebug(@"Exiting with no errors");
- // Cleanup
- [reporter release];
- [pool release];
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings
deleted file mode 100644
index 2b8bb96939..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/da.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/InfoPlist.strings
deleted file mode 100644
index 3180973eac..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings
deleted file mode 100644
index 73da36f48b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/de.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings
deleted file mode 100644
index a82c013e05..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings
deleted file mode 100644
index c31d6f48bb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/es.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings
deleted file mode 100644
index c32f8ff7a6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/fr.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/goArrow.png b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/goArrow.png
deleted file mode 100644
index f318a56711..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/goArrow.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings
deleted file mode 100644
index a4b7fd3acd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/it.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings
deleted file mode 100644
index 1f1a4fee5c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/ja.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/Localizable.strings
deleted file mode 100644
index a4a54f7593..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/nl.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/Localizable.strings
deleted file mode 100644
index 725ef5a262..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/no.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings
deleted file mode 100644
index 585f6221dc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings
deleted file mode 100644
index b7dfeecebe..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sl.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings
deleted file mode 100644
index 4cfd32c54b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings
deleted file mode 100644
index f7d1251668..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/sv.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/InfoPlist.strings
deleted file mode 100644
index 088fb4f6cd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/Localizable.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/Localizable.strings
deleted file mode 100644
index a82f990edc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/tr.lproj/Localizable.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.h b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.h
deleted file mode 100644
index 5f6aa464df..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// This component uses the HTTPMultipartUpload of the breakpad project to send
-// the minidump and associated data to the crash reporting servers.
-// It will perform throttling based on the parameters passed to it and will
-// prompt the user to send the minidump.
-
-#include <Foundation/Foundation.h>
-
-#import "common/mac/GTMDefines.h"
-
-#define kClientIdPreferenceKey @"clientid"
-
-extern NSString *const kGoogleServerType;
-extern NSString *const kSocorroServerType;
-extern NSString *const kDefaultServerType;
-
-@interface Uploader : NSObject {
- @private
- NSMutableDictionary *parameters_; // Key value pairs of data (STRONG)
- NSData *minidumpContents_; // The data in the minidump (STRONG)
- NSData *logFileData_; // An NSdata for the tar,
- // bz2'd log file.
- NSMutableDictionary *serverDictionary_; // The dictionary mapping a
- // server type name to a
- // dictionary of server
- // parameter names.
- NSMutableDictionary *socorroDictionary_; // The dictionary for
- // Socorro.
- NSMutableDictionary *googleDictionary_; // The dictionary for
- // Google.
- NSMutableDictionary *extraServerVars_; // A dictionary containing
- // extra key/value pairs
- // that are uploaded to the
- // crash server with the
- // minidump.
-}
-
-- (id)initWithConfigFile:(const char *)configFile;
-
-- (id)initWithConfig:(NSDictionary *)config;
-
-// Reads the file |configFile| and returns the corresponding NSDictionary.
-// |configFile| will be deleted after reading.
-+ (NSDictionary *)readConfigurationDataFromFile:(NSString *)configFile;
-
-- (NSMutableDictionary *)parameters;
-
-- (void)report;
-
-// Upload the given data to the crash server.
-- (void)uploadData:(NSData *)data name:(NSString *)name;
-
-// This method adds a key/value pair to the dictionary that
-// will be uploaded to the crash server.
-- (void)addServerParameter:(id)value forKey:(NSString *)key;
-
-// This method process the HTTP response and renames the minidump file with the
-// new ID.
-- (void)handleNetworkResponse:(NSData *)data withError:(NSError *)error;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.mm
deleted file mode 100644
index 42a43bfc33..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/sender/uploader.mm
+++ /dev/null
@@ -1,636 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import <fcntl.h>
-#import <sys/stat.h>
-#include <TargetConditionals.h>
-#import <unistd.h>
-
-#import <SystemConfiguration/SystemConfiguration.h>
-
-#import "common/mac/HTTPMultipartUpload.h"
-
-#import "client/apple/Framework/BreakpadDefines.h"
-#import "client/mac/sender/uploader.h"
-#import "common/mac/GTMLogger.h"
-
-const int kMinidumpFileLengthLimit = 2 * 1024 * 1024; // 2MB
-
-#define kApplePrefsSyncExcludeAllKey \
- @"com.apple.PreferenceSync.ExcludeAllSyncKeys"
-
-NSString *const kGoogleServerType = @"google";
-NSString *const kSocorroServerType = @"socorro";
-NSString *const kDefaultServerType = @"google";
-
-#pragma mark -
-
-namespace {
-// Read one line from the configuration file.
-NSString *readString(int fileId) {
- NSMutableString *str = [NSMutableString stringWithCapacity:32];
- char ch[2] = { 0 };
-
- while (read(fileId, &ch[0], 1) == 1) {
- if (ch[0] == '\n') {
- // Break if this is the first newline after reading some other string
- // data.
- if ([str length])
- break;
- } else {
- [str appendString:[NSString stringWithUTF8String:ch]];
- }
- }
-
- return str;
-}
-
-//=============================================================================
-// Read |length| of binary data from the configuration file. This method will
-// returns |nil| in case of error.
-NSData *readData(int fileId, ssize_t length) {
- NSMutableData *data = [NSMutableData dataWithLength:length];
- char *bytes = (char *)[data bytes];
-
- if (read(fileId, bytes, length) != length)
- return nil;
-
- return data;
-}
-
-//=============================================================================
-// Read the configuration from the config file.
-NSDictionary *readConfigurationData(const char *configFile) {
- int fileId = open(configFile, O_RDONLY, 0600);
- if (fileId == -1) {
- GTMLoggerDebug(@"Couldn't open config file %s - %s",
- configFile,
- strerror(errno));
- }
-
- // we want to avoid a build-up of old config files even if they
- // have been incorrectly written by the framework
- if (unlink(configFile)) {
- GTMLoggerDebug(@"Couldn't unlink config file %s - %s",
- configFile,
- strerror(errno));
- }
-
- if (fileId == -1) {
- return nil;
- }
-
- NSMutableDictionary *config = [NSMutableDictionary dictionary];
-
- while (1) {
- NSString *key = readString(fileId);
-
- if (![key length])
- break;
-
- // Read the data. Try to convert to a UTF-8 string, or just save
- // the data
- NSString *lenStr = readString(fileId);
- ssize_t len = [lenStr intValue];
- NSData *data = readData(fileId, len);
- id value = [[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding];
-
- [config setObject:(value ? value : data) forKey:key];
- [value release];
- }
-
- close(fileId);
- return config;
-}
-} // namespace
-
-#pragma mark -
-
-@interface Uploader(PrivateMethods)
-
-// Update |parameters_| as well as the server parameters using |config|.
-- (void)translateConfigurationData:(NSDictionary *)config;
-
-// Read the minidump referenced in |parameters_| and update |minidumpContents_|
-// with its content.
-- (BOOL)readMinidumpData;
-
-// Read the log files referenced in |parameters_| and update |logFileData_|
-// with their content.
-- (BOOL)readLogFileData;
-
-// Returns a unique client id (user-specific), creating a persistent
-// one in the user defaults, if necessary.
-- (NSString*)clientID;
-
-// Returns a dictionary that can be used to map Breakpad parameter names to
-// URL parameter names.
-- (NSMutableDictionary *)dictionaryForServerType:(NSString *)serverType;
-
-// Helper method to set HTTP parameters based on server type. This is
-// called right before the upload - crashParameters will contain, on exit,
-// URL parameters that should be sent with the minidump.
-- (BOOL)populateServerDictionary:(NSMutableDictionary *)crashParameters;
-
-// Initialization helper to create dictionaries mapping Breakpad
-// parameters to URL parameters
-- (void)createServerParameterDictionaries;
-
-// Accessor method for the URL parameter dictionary
-- (NSMutableDictionary *)urlParameterDictionary;
-
-// Records the uploaded crash ID to the log file.
-- (void)logUploadWithID:(const char *)uploadID;
-@end
-
-@implementation Uploader
-
-//=============================================================================
-- (id)initWithConfigFile:(const char *)configFile {
- NSDictionary *config = readConfigurationData(configFile);
- if (!config)
- return nil;
-
- return [self initWithConfig:config];
-}
-
-//=============================================================================
-- (id)initWithConfig:(NSDictionary *)config {
- if ((self = [super init])) {
- // Because the reporter is embedded in the framework (and many copies
- // of the framework may exist) its not completely certain that the OS
- // will obey the com.apple.PreferenceSync.ExcludeAllSyncKeys in our
- // Info.plist. To make sure, also set the key directly if needed.
- NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
- if (![ud boolForKey:kApplePrefsSyncExcludeAllKey]) {
- [ud setBool:YES forKey:kApplePrefsSyncExcludeAllKey];
- }
-
- [self createServerParameterDictionaries];
-
- [self translateConfigurationData:config];
-
- // Read the minidump into memory.
- [self readMinidumpData];
- [self readLogFileData];
- }
- return self;
-}
-
-//=============================================================================
-+ (NSDictionary *)readConfigurationDataFromFile:(NSString *)configFile {
- return readConfigurationData([configFile fileSystemRepresentation]);
-}
-
-//=============================================================================
-- (void)translateConfigurationData:(NSDictionary *)config {
- parameters_ = [[NSMutableDictionary alloc] init];
-
- NSEnumerator *it = [config keyEnumerator];
- while (NSString *key = [it nextObject]) {
- // If the keyname is prefixed by BREAKPAD_SERVER_PARAMETER_PREFIX
- // that indicates that it should be uploaded to the server along
- // with the minidump, so we treat it specially.
- if ([key hasPrefix:@BREAKPAD_SERVER_PARAMETER_PREFIX]) {
- NSString *urlParameterKey =
- [key substringFromIndex:[@BREAKPAD_SERVER_PARAMETER_PREFIX length]];
- if ([urlParameterKey length]) {
- id value = [config objectForKey:key];
- if ([value isKindOfClass:[NSString class]]) {
- [self addServerParameter:(NSString *)value
- forKey:urlParameterKey];
- } else {
- [self addServerParameter:(NSData *)value
- forKey:urlParameterKey];
- }
- }
- } else {
- [parameters_ setObject:[config objectForKey:key] forKey:key];
- }
- }
-
- // generate a unique client ID based on this host's MAC address
- // then add a key/value pair for it
- NSString *clientID = [self clientID];
- [parameters_ setObject:clientID forKey:@"guid"];
-}
-
-// Per user per machine
-- (NSString *)clientID {
- NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
- NSString *crashClientID = [ud stringForKey:kClientIdPreferenceKey];
- if (crashClientID) {
- return crashClientID;
- }
-
- // Otherwise, if we have no client id, generate one!
- srandom((int)[[NSDate date] timeIntervalSince1970]);
- long clientId1 = random();
- long clientId2 = random();
- long clientId3 = random();
- crashClientID = [NSString stringWithFormat:@"%lx%lx%lx",
- clientId1, clientId2, clientId3];
-
- [ud setObject:crashClientID forKey:kClientIdPreferenceKey];
- [ud synchronize];
- return crashClientID;
-}
-
-//=============================================================================
-- (BOOL)readLogFileData {
-#if TARGET_OS_IPHONE
- return NO;
-#else
- unsigned int logFileCounter = 0;
-
- NSString *logPath;
- size_t logFileTailSize =
- [[parameters_ objectForKey:@BREAKPAD_LOGFILE_UPLOAD_SIZE] intValue];
-
- NSMutableArray *logFilenames; // An array of NSString, one per log file
- logFilenames = [[NSMutableArray alloc] init];
-
- char tmpDirTemplate[80] = "/tmp/CrashUpload-XXXXX";
- char *tmpDir = mkdtemp(tmpDirTemplate);
-
- // Construct key names for the keys we expect to contain log file paths
- for(logFileCounter = 0;; logFileCounter++) {
- NSString *logFileKey = [NSString stringWithFormat:@"%@%d",
- @BREAKPAD_LOGFILE_KEY_PREFIX,
- logFileCounter];
-
- logPath = [parameters_ objectForKey:logFileKey];
-
- // They should all be consecutive, so if we don't find one, assume
- // we're done
-
- if (!logPath) {
- break;
- }
-
- NSData *entireLogFile = [[NSData alloc] initWithContentsOfFile:logPath];
-
- if (entireLogFile == nil) {
- continue;
- }
-
- NSRange fileRange;
-
- // Truncate the log file, only if necessary
-
- if ([entireLogFile length] <= logFileTailSize) {
- fileRange = NSMakeRange(0, [entireLogFile length]);
- } else {
- fileRange = NSMakeRange([entireLogFile length] - logFileTailSize,
- logFileTailSize);
- }
-
- char tmpFilenameTemplate[100];
-
- // Generate a template based on the log filename
- sprintf(tmpFilenameTemplate,"%s/%s-XXXX", tmpDir,
- [[logPath lastPathComponent] fileSystemRepresentation]);
-
- char *tmpFile = mktemp(tmpFilenameTemplate);
-
- NSData *logSubdata = [entireLogFile subdataWithRange:fileRange];
- NSString *tmpFileString = [NSString stringWithUTF8String:tmpFile];
- [logSubdata writeToFile:tmpFileString atomically:NO];
-
- [logFilenames addObject:[tmpFileString lastPathComponent]];
- [entireLogFile release];
- }
-
- if ([logFilenames count] == 0) {
- [logFilenames release];
- logFileData_ = nil;
- return NO;
- }
-
- // now, bzip all files into one
- NSTask *tarTask = [[NSTask alloc] init];
-
- [tarTask setCurrentDirectoryPath:[NSString stringWithUTF8String:tmpDir]];
- [tarTask setLaunchPath:@"/usr/bin/tar"];
-
- NSMutableArray *bzipArgs = [NSMutableArray arrayWithObjects:@"-cjvf",
- @"log.tar.bz2",nil];
- [bzipArgs addObjectsFromArray:logFilenames];
-
- [logFilenames release];
-
- [tarTask setArguments:bzipArgs];
- [tarTask launch];
- [tarTask waitUntilExit];
- [tarTask release];
-
- NSString *logTarFile = [NSString stringWithFormat:@"%s/log.tar.bz2",tmpDir];
- logFileData_ = [[NSData alloc] initWithContentsOfFile:logTarFile];
- if (logFileData_ == nil) {
- GTMLoggerDebug(@"Cannot find temp tar log file: %@", logTarFile);
- return NO;
- }
- return YES;
-#endif // TARGET_OS_IPHONE
-}
-
-//=============================================================================
-- (BOOL)readMinidumpData {
- NSString *minidumpDir =
- [parameters_ objectForKey:@kReporterMinidumpDirectoryKey];
- NSString *minidumpID = [parameters_ objectForKey:@kReporterMinidumpIDKey];
-
- if (![minidumpID length])
- return NO;
-
- NSString *path = [minidumpDir stringByAppendingPathComponent:minidumpID];
- path = [path stringByAppendingPathExtension:@"dmp"];
-
- // check the size of the minidump and limit it to a reasonable size
- // before attempting to load into memory and upload
- const char *fileName = [path fileSystemRepresentation];
- struct stat fileStatus;
-
- BOOL success = YES;
-
- if (!stat(fileName, &fileStatus)) {
- if (fileStatus.st_size > kMinidumpFileLengthLimit) {
- fprintf(stderr, "Breakpad Uploader: minidump file too large " \
- "to upload : %d\n", (int)fileStatus.st_size);
- success = NO;
- }
- } else {
- fprintf(stderr, "Breakpad Uploader: unable to determine minidump " \
- "file length\n");
- success = NO;
- }
-
- if (success) {
- minidumpContents_ = [[NSData alloc] initWithContentsOfFile:path];
- success = ([minidumpContents_ length] ? YES : NO);
- }
-
- if (!success) {
- // something wrong with the minidump file -- delete it
- unlink(fileName);
- }
-
- return success;
-}
-
-#pragma mark -
-//=============================================================================
-
-- (void)createServerParameterDictionaries {
- serverDictionary_ = [[NSMutableDictionary alloc] init];
- socorroDictionary_ = [[NSMutableDictionary alloc] init];
- googleDictionary_ = [[NSMutableDictionary alloc] init];
- extraServerVars_ = [[NSMutableDictionary alloc] init];
-
- [serverDictionary_ setObject:socorroDictionary_ forKey:kSocorroServerType];
- [serverDictionary_ setObject:googleDictionary_ forKey:kGoogleServerType];
-
- [googleDictionary_ setObject:@"ptime" forKey:@BREAKPAD_PROCESS_UP_TIME];
- [googleDictionary_ setObject:@"email" forKey:@BREAKPAD_EMAIL];
- [googleDictionary_ setObject:@"comments" forKey:@BREAKPAD_COMMENTS];
- [googleDictionary_ setObject:@"prod" forKey:@BREAKPAD_PRODUCT];
- [googleDictionary_ setObject:@"ver" forKey:@BREAKPAD_VERSION];
- [googleDictionary_ setObject:@"guid" forKey:@"guid"];
-
- [socorroDictionary_ setObject:@"Comments" forKey:@BREAKPAD_COMMENTS];
- [socorroDictionary_ setObject:@"CrashTime"
- forKey:@BREAKPAD_PROCESS_CRASH_TIME];
- [socorroDictionary_ setObject:@"StartupTime"
- forKey:@BREAKPAD_PROCESS_START_TIME];
- [socorroDictionary_ setObject:@"Version"
- forKey:@BREAKPAD_VERSION];
- [socorroDictionary_ setObject:@"ProductName"
- forKey:@BREAKPAD_PRODUCT];
- [socorroDictionary_ setObject:@"Email"
- forKey:@BREAKPAD_EMAIL];
-}
-
-- (NSMutableDictionary *)dictionaryForServerType:(NSString *)serverType {
- if (serverType == nil || [serverType length] == 0) {
- return [serverDictionary_ objectForKey:kDefaultServerType];
- }
- return [serverDictionary_ objectForKey:serverType];
-}
-
-- (NSMutableDictionary *)urlParameterDictionary {
- NSString *serverType = [parameters_ objectForKey:@BREAKPAD_SERVER_TYPE];
- return [self dictionaryForServerType:serverType];
-
-}
-
-- (BOOL)populateServerDictionary:(NSMutableDictionary *)crashParameters {
- NSDictionary *urlParameterNames = [self urlParameterDictionary];
-
- id key;
- NSEnumerator *enumerator = [parameters_ keyEnumerator];
-
- while ((key = [enumerator nextObject])) {
- // The key from parameters_ corresponds to a key in
- // urlParameterNames. The value in parameters_ gets stored in
- // crashParameters with a key that is the value in
- // urlParameterNames.
-
- // For instance, if parameters_ has [PRODUCT_NAME => "FOOBAR"] and
- // urlParameterNames has [PRODUCT_NAME => "pname"] the final HTTP
- // URL parameter becomes [pname => "FOOBAR"].
- NSString *breakpadParameterName = (NSString *)key;
- NSString *urlParameter = [urlParameterNames
- objectForKey:breakpadParameterName];
- if (urlParameter) {
- [crashParameters setObject:[parameters_ objectForKey:key]
- forKey:urlParameter];
- }
- }
-
- // Now, add the parameters that were added by the application.
- enumerator = [extraServerVars_ keyEnumerator];
-
- while ((key = [enumerator nextObject])) {
- NSString *urlParameterName = (NSString *)key;
- NSString *urlParameterValue =
- [extraServerVars_ objectForKey:urlParameterName];
- [crashParameters setObject:urlParameterValue
- forKey:urlParameterName];
- }
- return YES;
-}
-
-- (void)addServerParameter:(id)value forKey:(NSString *)key {
- [extraServerVars_ setObject:value forKey:key];
-}
-
-//=============================================================================
-- (void)handleNetworkResponse:(NSData *)data withError:(NSError *)error {
- NSString *result = [[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding];
- const char *reportID = "ERR";
- if (error) {
- fprintf(stderr, "Breakpad Uploader: Send Error: %s\n",
- [[error description] UTF8String]);
- } else {
- NSCharacterSet *trimSet =
- [NSCharacterSet whitespaceAndNewlineCharacterSet];
- reportID = [[result stringByTrimmingCharactersInSet:trimSet] UTF8String];
- [self logUploadWithID:reportID];
- }
-
- // rename the minidump file according to the id returned from the server
- NSString *minidumpDir =
- [parameters_ objectForKey:@kReporterMinidumpDirectoryKey];
- NSString *minidumpID = [parameters_ objectForKey:@kReporterMinidumpIDKey];
-
- NSString *srcString = [NSString stringWithFormat:@"%@/%@.dmp",
- minidumpDir, minidumpID];
- NSString *destString = [NSString stringWithFormat:@"%@/%s.dmp",
- minidumpDir, reportID];
-
- const char *src = [srcString fileSystemRepresentation];
- const char *dest = [destString fileSystemRepresentation];
-
- if (rename(src, dest) == 0) {
- GTMLoggerInfo(@"Breakpad Uploader: Renamed %s to %s after successful " \
- "upload",src, dest);
- }
- else {
- // can't rename - don't worry - it's not important for users
- GTMLoggerDebug(@"Breakpad Uploader: successful upload report ID = %s\n",
- reportID );
- }
- [result release];
-}
-
-//=============================================================================
-- (void)report {
- NSURL *url = [NSURL URLWithString:[parameters_ objectForKey:@BREAKPAD_URL]];
- HTTPMultipartUpload *upload = [[HTTPMultipartUpload alloc] initWithURL:url];
- NSMutableDictionary *uploadParameters = [NSMutableDictionary dictionary];
-
- if (![self populateServerDictionary:uploadParameters]) {
- [upload release];
- return;
- }
-
- [upload setParameters:uploadParameters];
-
- // Add minidump file
- if (minidumpContents_) {
- [upload addFileContents:minidumpContents_ name:@"upload_file_minidump"];
-
- // If there is a log file, upload it together with the minidump.
- if (logFileData_) {
- [upload addFileContents:logFileData_ name:@"log"];
- }
-
- // Send it
- NSError *error = nil;
- NSData *data = [upload send:&error];
-
- if (![url isFileURL]) {
- [self handleNetworkResponse:data withError:error];
- } else {
- if (error) {
- fprintf(stderr, "Breakpad Uploader: Error writing request file: %s\n",
- [[error description] UTF8String]);
- }
- }
-
- } else {
- // Minidump is missing -- upload just the log file.
- if (logFileData_) {
- [self uploadData:logFileData_ name:@"log"];
- }
- }
- [upload release];
-}
-
-- (void)uploadData:(NSData *)data name:(NSString *)name {
- NSURL *url = [NSURL URLWithString:[parameters_ objectForKey:@BREAKPAD_URL]];
- NSMutableDictionary *uploadParameters = [NSMutableDictionary dictionary];
-
- if (![self populateServerDictionary:uploadParameters])
- return;
-
- HTTPMultipartUpload *upload =
- [[HTTPMultipartUpload alloc] initWithURL:url];
-
- [uploadParameters setObject:name forKey:@"type"];
- [upload setParameters:uploadParameters];
- [upload addFileContents:data name:name];
-
- [upload send:nil];
- [upload release];
-}
-
-- (void)logUploadWithID:(const char *)uploadID {
- NSString *minidumpDir =
- [parameters_ objectForKey:@kReporterMinidumpDirectoryKey];
- NSString *logFilePath = [NSString stringWithFormat:@"%@/%s",
- minidumpDir, kReporterLogFilename];
- NSString *logLine = [NSString stringWithFormat:@"%0.f,%s\n",
- [[NSDate date] timeIntervalSince1970], uploadID];
- NSData *logData = [logLine dataUsingEncoding:NSUTF8StringEncoding];
-
- NSFileManager *fileManager = [NSFileManager defaultManager];
- if ([fileManager fileExistsAtPath:logFilePath]) {
- NSFileHandle *logFileHandle =
- [NSFileHandle fileHandleForWritingAtPath:logFilePath];
- [logFileHandle seekToEndOfFile];
- [logFileHandle writeData:logData];
- [logFileHandle closeFile];
- } else {
- [fileManager createFileAtPath:logFilePath
- contents:logData
- attributes:nil];
- }
-}
-
-//=============================================================================
-- (NSMutableDictionary *)parameters {
- return parameters_;
-}
-
-//=============================================================================
-- (void)dealloc {
- [parameters_ release];
- [minidumpContents_ release];
- [logFileData_ release];
- [googleDictionary_ release];
- [socorroDictionary_ release];
- [serverDictionary_ release];
- [extraServerVars_ release];
- [super dealloc];
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.h b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.h
deleted file mode 100644
index 7b3be2d698..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import <Cocoa/Cocoa.h>
-
-#import <Breakpad/Breakpad.h>
-
-enum BreakpadForkBehavior {
- DONOTHING = 0,
- UNINSTALL,
- RESETEXCEPTIONPORT
-};
-
-enum BreakpadForkTestCrashPoint {
- DURINGLAUNCH = 5,
- AFTERLAUNCH = 6,
- BETWEENFORKEXEC = 7
-};
-
-@interface Controller : NSObject {
- IBOutlet NSWindow *window_;
- IBOutlet NSWindow *forkTestOptions_;
-
- BreakpadRef breakpad_;
-
- enum BreakpadForkBehavior bpForkOption;
-
- BOOL useVFork;
- enum BreakpadForkTestCrashPoint progCrashPoint;
-}
-
-- (IBAction)crash:(id)sender;
-- (IBAction)forkTestOptions:(id)sender;
-- (IBAction)forkTestGo:(id)sender;
-- (IBAction)showForkTestWindow:(id) sender;
-- (void)generateReportWithoutCrash:(id)sender;
-- (void)awakeFromNib;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m
deleted file mode 100644
index 87c43024bc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Controller.m
+++ /dev/null
@@ -1,261 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import <Breakpad/Breakpad.h>
-
-#import "Controller.h"
-#import "TestClass.h"
-#import "GTMDefines.h"
-#include <unistd.h>
-#include <mach/mach.h>
-
-@implementation Controller
-
-- (void)causeCrash {
- float *aPtr = nil;
- NSLog(@"Crash!");
- NSLog(@"Bad programmer: %f", *aPtr);
-}
-
-- (void)generateReportWithoutCrash:(id)sender {
- BreakpadGenerateAndSendReport(breakpad_);
-}
-
-- (IBAction)showForkTestWindow:(id) sender {
- [forkTestOptions_ setIsVisible:YES];
-}
-
-- (IBAction)forkTestOptions:(id)sender {
- NSInteger tag = [[sender selectedCell] tag];
- NSLog(@"sender tag: %d", tag);
- if (tag <= 2) {
- bpForkOption = tag;
- }
-
- if (tag == 3) {
- useVFork = NO;
- }
-
- if (tag == 4) {
- useVFork = YES;
- }
-
- if (tag >= 5 && tag <= 7) {
- progCrashPoint = tag;
- }
-
-}
-
-- (IBAction)forkTestGo:(id)sender {
-
- NSString *resourcePath = [[NSBundle bundleForClass:
- [self class]] resourcePath];
- NSString *execProgname = nil;
- if (progCrashPoint == DURINGLAUNCH) {
- execProgname = [resourcePath stringByAppendingString:@"/crashduringload"];
- } else if (progCrashPoint == AFTERLAUNCH) {
- execProgname = [resourcePath stringByAppendingString:@"/crashInMain"];
- }
-
- const char *progName = NULL;
- if (progCrashPoint != BETWEENFORKEXEC) {
- progName = [execProgname UTF8String];
- }
-
- int pid;
-
- if (bpForkOption == UNINSTALL) {
- BreakpadRelease(breakpad_);
- }
-
- if (useVFork) {
- pid = vfork();
- } else {
- pid = fork();
- }
-
- if (pid == 0) {
- sleep(3);
- NSLog(@"Child continuing");
- FILE *fd = fopen("/tmp/childlog.txt","wt");
- kern_return_t kr;
- if (bpForkOption == RESETEXCEPTIONPORT) {
- kr = task_set_exception_ports(mach_task_self(),
- EXC_MASK_BAD_ACCESS | EXC_MASK_BAD_INSTRUCTION |
- EXC_MASK_ARITHMETIC | EXC_MASK_BREAKPOINT,
- MACH_PORT_NULL,
- EXCEPTION_DEFAULT,
- THREAD_STATE_NONE);
- fprintf(fd,"task_set_exception_ports returned %d\n", kr);
- }
-
- if (progCrashPoint == BETWEENFORKEXEC) {
- fprintf(fd,"crashing post-fork\n");
- int *a = NULL;
- printf("%d\n",*a++);
- }
-
- fprintf(fd,"about to call exec with %s\n", progName);
- fclose(fd);
- int i = execl(progName, progName, NULL);
- fprintf(fd, "exec returned! %d\n", i);
- fclose(fd);
- }
-}
-
-- (IBAction)crash:(id)sender {
- NSInteger tag = [sender tag];
-
- if (tag == 1) {
- [NSObject cancelPreviousPerformRequestsWithTarget:self];
- [self performSelector:@selector(causeCrash) withObject:nil afterDelay:10.0];
- [sender setState:NSOnState];
- return;
- }
-
- if (tag == 2 && breakpad_) {
- BreakpadRelease(breakpad_);
- breakpad_ = NULL;
- return;
- }
-
- [self causeCrash];
-}
-
-- (void)anotherThread {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- TestClass *tc = [[TestClass alloc] init];
-
- [tc wait];
-
- [pool release];
-}
-
-- (void)awakeFromNib {
- NSBundle *bundle = [NSBundle mainBundle];
- NSDictionary *info = [bundle infoDictionary];
-
-
- breakpad_ = BreakpadCreate(info);
-
- // Do some unit tests with keys
- // first a series of bogus values
- BreakpadSetKeyValue(breakpad_, nil, @"bad2");
- BreakpadSetKeyValue(nil, @"bad3", @"bad3");
-
- // Now some good ones
- BreakpadSetKeyValue(breakpad_,@"key1", @"value1");
- BreakpadSetKeyValue(breakpad_,@"key2", @"value2");
- BreakpadSetKeyValue(breakpad_,@"key3", @"value3");
-
- // Look for a bogus one that we didn't try to set
- NSString *test = BreakpadKeyValue(breakpad_, @"bad4");
- if (test) {
- NSLog(@"Bad BreakpadKeyValue (bad4)");
- }
-
- // Look for a bogus one we did try to set
- test = BreakpadKeyValue(breakpad_, @"bad1");
- if (test) {
- NSLog(@"Bad BreakpadKeyValue (bad1)");
- }
-
- // Test some bad args for BreakpadKeyValue
- test = BreakpadKeyValue(nil, @"bad5");
- if (test) {
- NSLog(@"Bad BreakpadKeyValue (bad5)");
- }
-
- test = BreakpadKeyValue(breakpad_, nil);
- if (test) {
- NSLog(@"Bad BreakpadKeyValue (nil)");
- }
-
- // Find some we did set
- test = BreakpadKeyValue(breakpad_, @"key1");
- if (![test isEqualToString:@"value1"]) {
- NSLog(@"Can't find BreakpadKeyValue (key1)");
- }
- test = BreakpadKeyValue(breakpad_, @"key2");
- if (![test isEqualToString:@"value2"]) {
- NSLog(@"Can't find BreakpadKeyValue (key2)");
- }
- test = BreakpadKeyValue(breakpad_, @"key3");
- if (![test isEqualToString:@"value3"]) {
- NSLog(@"Can't find BreakpadKeyValue (key3)");
- }
-
- // Bad args for BreakpadRemoveKeyValue
- BreakpadRemoveKeyValue(nil, @"bad6");
- BreakpadRemoveKeyValue(breakpad_, nil);
-
- // Remove one that is valid
- BreakpadRemoveKeyValue(breakpad_, @"key3");
-
- // Try and find it
- test = BreakpadKeyValue(breakpad_, @"key3");
- if (test) {
- NSLog(@"Shouldn't find BreakpadKeyValue (key3)");
- }
-
- // Try and remove it again
- BreakpadRemoveKeyValue(breakpad_, @"key3");
-
- // Try removal by setting to nil
- BreakpadSetKeyValue(breakpad_,@"key2", nil);
- // Try and find it
- test = BreakpadKeyValue(breakpad_, @"key2");
- if (test) {
- NSLog(@"Shouldn't find BreakpadKeyValue (key2)");
- }
-
- BreakpadAddUploadParameter(breakpad_,
- @"MeaningOfLife",
- @"42");
- [NSThread detachNewThreadSelector:@selector(anotherThread)
- toTarget:self withObject:nil];
-
- NSUserDefaults *args = [NSUserDefaults standardUserDefaults];
-
- // If the user specified autocrash on the command line, toggle
- // Breakpad to not confirm and crash immediately. This is for
- // automated testing.
- if ([args boolForKey:@"autocrash"]) {
- BreakpadSetKeyValue(breakpad_,
- @BREAKPAD_SKIP_CONFIRM,
- @"YES");
- [self causeCrash];
- }
-
- progCrashPoint = DURINGLAUNCH;
- [window_ center];
- [window_ makeKeyAndOrderFront:self];
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/InfoPlist.strings b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/InfoPlist.strings
deleted file mode 100644
index b8c6c6bf0b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/InfoPlist.strings
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib
deleted file mode 100644
index 840c0db33b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/English.lproj/MainMenu.xib
+++ /dev/null
@@ -1,3748 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
- <data>
- <int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">10F569</string>
- <string key="IBDocument.InterfaceBuilderVersion">788</string>
- <string key="IBDocument.AppKitVersion">1038.29</string>
- <string key="IBDocument.HIToolboxVersion">461.00</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string key="NS.object.0">788</string>
- </object>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="220"/>
- </object>
- <object class="NSArray" key="IBDocument.PluginDependencies">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- </object>
- <object class="NSMutableDictionary" key="IBDocument.Metadata">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys" id="0">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <object class="NSMutableArray" key="IBDocument.RootObjects" id="925601844">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSCustomObject" id="870565383">
- <object class="NSMutableString" key="NSClassName">
- <characters key="NS.bytes">NSApplication</characters>
- </object>
- </object>
- <object class="NSCustomObject" id="442653439">
- <string key="NSClassName">FirstResponder</string>
- </object>
- <object class="NSCustomObject" id="751079937">
- <string key="NSClassName">NSApplication</string>
- </object>
- <object class="NSWindowTemplate" id="341270541">
- <int key="NSWindowStyleMask">15</int>
- <int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{945, 874}, {320, 188}}</string>
- <int key="NSWTFlags">1886912512</int>
- <string key="NSWindowTitle">Window</string>
- <string key="NSWindowClass">NSWindow</string>
- <object class="NSMutableString" key="NSViewClass">
- <characters key="NS.bytes">View</characters>
- </object>
- <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
- <string key="NSWindowContentMinSize">{213, 107}</string>
- <object class="NSView" key="NSWindowView" id="814272478">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSButton" id="726278107">
- <reference key="NSNextResponder" ref="814272478"/>
- <int key="NSvFlags">301</int>
- <string key="NSFrame">{{14, 140}, {292, 32}}</string>
- <reference key="NSSuperview" ref="814272478"/>
- <reference key="NSWindow"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="539552922">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Crash! (Airbag Installed)</string>
- <object class="NSFont" key="NSSupport" id="933596199">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">13</double>
- <int key="NSfFlags">1044</int>
- </object>
- <reference key="NSControlView" ref="726278107"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">1</int>
- <reference key="NSAlternateImage" ref="933596199"/>
- <string key="NSAlternateContents"/>
- <object class="NSMutableString" key="NSKeyEquivalent">
- <characters key="NS.bytes"/>
- </object>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="799567279">
- <reference key="NSNextResponder" ref="814272478"/>
- <int key="NSvFlags">301</int>
- <string key="NSFrame">{{14, 76}, {292, 32}}</string>
- <reference key="NSSuperview" ref="814272478"/>
- <reference key="NSWindow"/>
- <int key="NSTag">2</int>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="1010617379">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Crash! (Airbag NOT Installed)</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="799567279"/>
- <int key="NSTag">2</int>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">1</int>
- <reference key="NSAlternateImage" ref="933596199"/>
- <string key="NSAlternateContents"/>
- <object class="NSMutableString" key="NSKeyEquivalent">
- <characters key="NS.bytes"/>
- </object>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="27781390">
- <reference key="NSNextResponder" ref="814272478"/>
- <int key="NSvFlags">301</int>
- <string key="NSFrame">{{14, 108}, {292, 32}}</string>
- <reference key="NSSuperview" ref="814272478"/>
- <reference key="NSWindow"/>
- <int key="NSTag">1</int>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="547901497">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Crash! (Airbag Installed w/10sec delay)</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="27781390"/>
- <int key="NSTag">1</int>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">1</int>
- <reference key="NSAlternateImage" ref="933596199"/>
- <string key="NSAlternateContents"/>
- <object class="NSMutableString" key="NSKeyEquivalent">
- <characters key="NS.bytes"/>
- </object>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="856256540">
- <reference key="NSNextResponder" ref="814272478"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{14, 44}, {292, 32}}</string>
- <reference key="NSSuperview" ref="814272478"/>
- <reference key="NSWindow"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="353736234">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Fork Test</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="856256540"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">129</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <object class="NSButton" id="460755987">
- <reference key="NSNextResponder" ref="814272478"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{14, 12}, {292, 32}}</string>
- <reference key="NSSuperview" ref="814272478"/>
- <reference key="NSWindow"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="775425649">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Generate report without crash</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="460755987"/>
- <int key="NSButtonFlags">-2038284033</int>
- <int key="NSButtonFlags2">129</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- </object>
- <string key="NSFrameSize">{320, 188}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
- </object>
- <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
- <string key="NSMinSize">{213, 129}</string>
- <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
- </object>
- <object class="NSMenu" id="695387251">
- <string key="NSTitle">MainMenu</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="458207250">
- <reference key="NSMenu" ref="695387251"/>
- <string key="NSTitle">NewApplication</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <object class="NSCustomResource" key="NSOnImage" id="419346806">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSMenuCheckmark</string>
- </object>
- <object class="NSCustomResource" key="NSMixedImage" id="290286705">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSMenuMixedState</string>
- </object>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="753534561">
- <string key="NSTitle">NewApplication</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="838552093">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">About NewApplication</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="758254482">
- <reference key="NSMenu" ref="753534561"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="443649494">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">Preferences…</string>
- <string key="NSKeyEquiv">,</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="217746140">
- <reference key="NSMenu" ref="753534561"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="826764396">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">Services</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="276709607">
- <object class="NSMutableString" key="NSTitle">
- <characters key="NS.bytes">Services</characters>
- </object>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- <string key="NSName">_NSServicesMenu</string>
- </object>
- </object>
- <object class="NSMenuItem" id="881859155">
- <reference key="NSMenu" ref="753534561"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="104472016">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">Hide NewApplication</string>
- <string key="NSKeyEquiv">h</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="216168366">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">Hide Others</string>
- <string key="NSKeyEquiv">h</string>
- <int key="NSKeyEquivModMask">1572864</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="667790509">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">Show All</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="928933982">
- <reference key="NSMenu" ref="753534561"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="887927135">
- <reference key="NSMenu" ref="753534561"/>
- <string key="NSTitle">Quit NewApplication</string>
- <string key="NSKeyEquiv">q</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- <string key="NSName">_NSAppleMenu</string>
- </object>
- </object>
- <object class="NSMenuItem" id="369472335">
- <reference key="NSMenu" ref="695387251"/>
- <string key="NSTitle">File</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="902982238">
- <object class="NSMutableString" key="NSTitle">
- <characters key="NS.bytes">File</characters>
- </object>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="660391032">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">New</string>
- <string key="NSKeyEquiv">n</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="367379562">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Open...</string>
- <string key="NSKeyEquiv">o</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="84883275">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Open Recent</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="693280130">
- <object class="NSMutableString" key="NSTitle">
- <characters key="NS.bytes">Open Recent</characters>
- </object>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="85018532">
- <reference key="NSMenu" ref="693280130"/>
- <string key="NSTitle">Clear Menu</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- <string key="NSName">_NSRecentDocumentsMenu</string>
- </object>
- </object>
- <object class="NSMenuItem" id="154948703">
- <reference key="NSMenu" ref="902982238"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="468594275">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Close</string>
- <string key="NSKeyEquiv">w</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="479945444">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Save</string>
- <string key="NSKeyEquiv">s</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="976375553">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Save As…</string>
- <string key="NSKeyEquiv">S</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="885975128">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Revert</string>
- <string key="NSKeyEquiv"/>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="232609393">
- <reference key="NSMenu" ref="902982238"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="409810395">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Page Setup…</string>
- <string key="NSKeyEquiv">P</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="302505815">
- <reference key="NSMenu" ref="902982238"/>
- <string key="NSTitle">Print…</string>
- <string key="NSKeyEquiv">p</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="542216986">
- <reference key="NSMenu" ref="695387251"/>
- <string key="NSTitle">Edit</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="1053284541">
- <object class="NSMutableString" key="NSTitle">
- <characters key="NS.bytes">Edit</characters>
- </object>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="284548410">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Undo</string>
- <string key="NSKeyEquiv">z</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="1001272176">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Redo</string>
- <string key="NSKeyEquiv">Z</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="209744238">
- <reference key="NSMenu" ref="1053284541"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="909447496">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Cut</string>
- <string key="NSKeyEquiv">x</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="994487277">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Copy</string>
- <string key="NSKeyEquiv">c</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="84012734">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Paste</string>
- <string key="NSKeyEquiv">v</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="182251545">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Paste and Match Style</string>
- <string key="NSKeyEquiv">V</string>
- <int key="NSKeyEquivModMask">1572864</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="512189403">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Delete</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="917620781">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Select All</string>
- <string key="NSKeyEquiv">a</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="431895313">
- <reference key="NSMenu" ref="1053284541"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="153501847">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Find</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="333484665">
- <object class="NSMutableString" key="NSTitle">
- <characters key="NS.bytes">Find</characters>
- </object>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="203238834">
- <reference key="NSMenu" ref="333484665"/>
- <string key="NSTitle">Find…</string>
- <string key="NSKeyEquiv">f</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <int key="NSTag">1</int>
- </object>
- <object class="NSMenuItem" id="861312964">
- <reference key="NSMenu" ref="333484665"/>
- <string key="NSTitle">Find Next</string>
- <string key="NSKeyEquiv">g</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <int key="NSTag">2</int>
- </object>
- <object class="NSMenuItem" id="743767160">
- <reference key="NSMenu" ref="333484665"/>
- <string key="NSTitle">Find Previous</string>
- <string key="NSKeyEquiv">G</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <int key="NSTag">3</int>
- </object>
- <object class="NSMenuItem" id="180446588">
- <reference key="NSMenu" ref="333484665"/>
- <string key="NSTitle">Use Selection for Find</string>
- <string key="NSKeyEquiv">e</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <int key="NSTag">7</int>
- </object>
- <object class="NSMenuItem" id="731027425">
- <reference key="NSMenu" ref="333484665"/>
- <string key="NSTitle">Jump to Selection</string>
- <string key="NSKeyEquiv">j</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="61602259">
- <reference key="NSMenu" ref="1053284541"/>
- <string key="NSTitle">Spelling</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="8174285">
- <string key="NSTitle">Spelling</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="438210660">
- <reference key="NSMenu" ref="8174285"/>
- <string key="NSTitle">Spelling…</string>
- <string key="NSKeyEquiv">:</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="102172584">
- <reference key="NSMenu" ref="8174285"/>
- <string key="NSTitle">Check Spelling</string>
- <string key="NSKeyEquiv">;</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="540509341">
- <reference key="NSMenu" ref="8174285"/>
- <string key="NSTitle">Check Spelling as You Type</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- </object>
- </object>
- </object>
- </object>
- </object>
- <object class="NSMenuItem" id="764068863">
- <reference key="NSMenu" ref="695387251"/>
- <string key="NSTitle">Window</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="200536676">
- <object class="NSMutableString" key="NSTitle">
- <characters key="NS.bytes">Window</characters>
- </object>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="683986939">
- <reference key="NSMenu" ref="200536676"/>
- <string key="NSTitle">Minimize</string>
- <string key="NSKeyEquiv">m</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="548098734">
- <reference key="NSMenu" ref="200536676"/>
- <string key="NSTitle">Zoom</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="297002686">
- <reference key="NSMenu" ref="200536676"/>
- <bool key="NSIsDisabled">YES</bool>
- <bool key="NSIsSeparator">YES</bool>
- <string key="NSTitle"/>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- <object class="NSMenuItem" id="164762492">
- <reference key="NSMenu" ref="200536676"/>
- <string key="NSTitle">Bring All to Front</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- <string key="NSName">_NSWindowsMenu</string>
- </object>
- </object>
- <object class="NSMenuItem" id="599772536">
- <reference key="NSMenu" ref="695387251"/>
- <string key="NSTitle">Help</string>
- <string key="NSKeyEquiv"/>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- <string key="NSAction">submenuAction:</string>
- <object class="NSMenu" key="NSSubmenu" id="1066958924">
- <string key="NSTitle">Help</string>
- <object class="NSMutableArray" key="NSMenuItems">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMenuItem" id="192540884">
- <reference key="NSMenu" ref="1066958924"/>
- <string key="NSTitle">NewApplication Help</string>
- <string key="NSKeyEquiv">?</string>
- <int key="NSKeyEquivModMask">1048576</int>
- <int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSOnImage" ref="419346806"/>
- <reference key="NSMixedImage" ref="290286705"/>
- </object>
- </object>
- </object>
- </object>
- </object>
- <string key="NSName">_NSMainMenu</string>
- </object>
- <object class="NSCustomObject" id="623097029">
- <string key="NSClassName">Controller</string>
- </object>
- <object class="NSWindowTemplate" id="347013037">
- <int key="NSWindowStyleMask">15</int>
- <int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{858, 755}, {787, 260}}</string>
- <int key="NSWTFlags">603979776</int>
- <string key="NSWindowTitle">Window</string>
- <string key="NSWindowClass">NSWindow</string>
- <nil key="NSViewClass"/>
- <string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
- <object class="NSView" key="NSWindowView" id="594333702">
- <reference key="NSNextResponder"/>
- <int key="NSvFlags">256</int>
- <object class="NSMutableArray" key="NSSubviews">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSMatrix" id="891367997">
- <reference key="NSNextResponder" ref="594333702"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{20, 7}, {645, 79}}</string>
- <reference key="NSSuperview" ref="594333702"/>
- <bool key="NSEnabled">YES</bool>
- <int key="NSNumRows">3</int>
- <int key="NSNumCols">1</int>
- <object class="NSMutableArray" key="NSCells">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSButtonCell" id="410017819">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">program crashes during launch because of missing dylib</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="891367997"/>
- <int key="NSTag">5</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSButtonImageSource" key="NSAlternateImage" id="619763889">
- <string key="NSImageName">NSRadioButton</string>
- </object>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- <object class="NSButtonCell" id="904578786">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">program crashes after launch</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="891367997"/>
- <int key="NSTag">6</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAwYAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAMGGFw
-cGwCAAAAbW50clJHQiBYWVogB9YABAADABMALAASYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAPbWAAEAAAAA0y1hcHBsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAOclhZWgAAASwAAAAUZ1hZWgAAAUAAAAAUYlhZWgAAAVQAAAAUd3RwdAAAAWgAAAAUY2hhZAAA
-AXwAAAAsclRSQwAAAagAAAAOZ1RSQwAAAbgAAAAOYlRSQwAAAcgAAAAOdmNndAAAAdgAAAMSbmRpbgAA
-BOwAAAY+ZGVzYwAACywAAABkZHNjbQAAC5AAAAAubW1vZAAAC8AAAAAoY3BydAAAC+gAAAAtWFlaIAAA
-AAAAAF1KAAA0kQAACCVYWVogAAAAAAAAdCAAALRgAAAjPVhZWiAAAAAAAAAlbAAAFyoAAKfDWFlaIAAA
-AAAAAPNSAAEAAAABFs9zZjMyAAAAAAABDEIAAAXe///zJgAAB5IAAP2R///7ov///aMAAAPcAADAbGN1
-cnYAAAAAAAAAAQHNAABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAAD
-AQAAAQACBAUGBwkKCw0ODxASExQWFxgaGxweHyAiIyQmJygpKywtLzAxMjM1Njc4OTs8PT5AQUJDREZH
-SElKS0xOT1BRUlNUVVZXWFlaW1xdXl9hYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SF
-hoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnZ6foKGio6SlpqanqKmqq6ytra6vsLGysrO0tba3uLi5uru8
-vL2+v8DBwcLDxMXGxsfIycrKy8zNzs7P0NHS0tPU1dbW19jZ2drb3Nzd3t/g4eLi4+Tl5ufo6enq6+zt
-7u/w8fHy8/T19vf4+fr7/P3+/v8AAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR8gISIjJCUnKCkq
-Ky0uLzAxMzQ1Njc4OTo7PD0/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaWltcXV5fYGFiY2RlZmdo
-aWprbG1ub3BxcnN0dXZ3d3h5ent8fH1+f4CBgoKDhIWGh4iIiYqLjI2Oj5CRkpOUlJWWl5iZmpucnZ2e
-n6ChoqOkpaamp6ipqqusra6vsLCxsrO0tba3uLm5uru8vb6/wMHCw8TFx8jJysvMzc7P0NDR0tPU1dbX
-2Nna29ze3+Dh4uPk5ebn6err7O3u7/Hy8/T19vf5+vv8/f7/AAIDAwQFBgcICQoKCwwNDg8QERITFBUW
-FxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODg5Ojs8PT4+P0BBQkNDREVGR0hJSUpLTE1O
-Tk9QUVJSU1RVVVZXWFhZWltbXF1eXl9gYWFiY2RkZWZnZ2hpaWprbGxtbm5vcHFxcnNzdHV1dnd4eHl6
-ent8fH1+fn+AgYGCg4SEhYaHiImJiouMjY6Oj5CRkpOTlJWWl5iZmZqbnJ2en6ChoqOkpaanqKmqq6yt
-rq+xsrO0tba3uLq7vL2+wMHDxMbHycrMzs/R0tTW19nb3d7g4uTm6Ors7vDy9Pb4+vz+/wAAbmRpbgAA
-AAAAAAY2AACXGgAAVjoAAFPKAACJ3gAAJ8IAABaoAABQDQAAVDkAAiuFAAIZmQABeFEAAwEAAAIAAAAA
-AAEABgANABcAIwAxAEAAUgBlAHsAkwCrAMUA4gD/AR8BPwFhAYUBqgHQAfgCIAJLAncCpQLSAwIDMwNl
-A5gDzgQFBD0EdQSvBOsFKQVnBacF6AYqBm4GtQb8B0UHkgfkCDkIkAjnCT4JmAn0ClAKrQsLC2sLygwq
-DIwM8Q1XDcAOKA6SDv4PbA/bEE0QxBE7EbQSMRKwEzITuRREFNAVYBXxFocXHhfAGGIZBBmsGlQa+RuU
-HC4czh1yHhQeux9jIA0gvCFoIhkizyOJJEEk+SW6JnknOygFKMspkypiKzIsASzXLawuhy9gMD4xGzH8
-MtszvzSgNYY2cjdcOEw5OTorOxs8CD0EPfU+6z/nQOFB2ELUQ9VE00XcRttH5EjxSgBLCUwdTTFOUE9v
-UI9Rt1LdVAVVNlZsV6VY4FohW21ct135X09goGH0Y0tkqGYFZ19oxGova5ptCG54b/BxbnLsdG119Xd/
-eQh6knwqfcV/W4D4gpSEO4Xih4CJKorYjIqOOY/jkZuTWJUOlsyYiZpSnB6d4Z+soX+jWqUvpxOo+6rj
-rMuuwLC4sra0rra0uL+60LzfvwDBHcLdxLXGhchYyi7MCs3lz7rRmtOA1WPXR9kq2xPc/97s4M/iveSn
-5o3obupT7ELuLPAM8fLz0PW396H5f/tZ/T3//wAAAAEAAwALABYAJQA3AE0AZQCBAJ8AwQDlAQsBNQFh
-AZABwQH1AisCZAKfAtwDHANfA6MD6gQ0BH8EzQT1BR0FcAXEBhsGdAbPBy0HXAeMB+4IUgi4CSAJVAmK
-CfYKZArVC0cLgQu8DDIMqw0mDaIOIQ6hDyQPqRAvELgQ/RFDEc8SXRLuE4AUFRSrFUMV3RZ5FxcXthhY
-GPwZoRpIGvEbnBxJHPgdqB5bHw8fxSB9ITch8iKwJDAk8yW3Jn4nRigQKNwpqSp5K0osHCzxLccuoC95
-MFUxMzISMvMz1TS5NaA2hzdxOFw5STo4Oyg8Gj4DPvs/9EDuQepD6ETpRexG8Uf3SP9LFEwhTTBOQE9S
-UGZSklOrVMVV4Vb/WB5ZP1phW4Vcq13SXvthUmJ/Y69k4GYSZ0dofGm0au1tZG6ib+FxInJlc6l073Y2
-d396FXtjfLJ+A39VgKmB/4NWhK+GCYjCiiGLgYzjjkePrJESknuT5Ja8mCuZm5sMnH+d9J9qoOGiWqPV
-pVGmz6eOqE6pzqtRrNSuWq/gsWmy8rR+tgu5Kbq6vE294b93wQ7Cp8RBxd3He8kZyrrLisxbzf/Po9FK
-0vHUm9ZF1/HZn9tO3Cbc/96x4GTiGePQ5YjnQegf6Pzquex27jbv9/G583z0X/VC9wj40Pqa/GX+Mf//
-AAAAAQADAAsAJQA3AE0AZQCBAJ8AwQELATUBYQGQAcEB9QIrAmQCnwLcAxwDXwOjA+oENAR/BM0FHQVw
-BcQGGwZ0Bs8HLQeMB+4IUgi4CSAJign2CmQK1QtHC7wMMgyrDSYNog4hDqEPJA+pEC8QuBFDEl0S7hOA
-FBUUqxVDFnkXFxe2GFgY/BpIGvEbnBxJHPgdqB8PH8UgfSE3IfIjbyQwJPMltydGKBAo3Cp5K0osHC3H
-LqAveTEzMhIy8zS5NaA2hzhcOUk6ODwaPQ4+Az/0QO5C6EPoROlG8Uf3SglLFEwhTkBPUlF7UpJUxVXh
-Vv9ZP1phXKtd0mAlYVJjr2TgZhJofGm0au1tZG6ib+FxInJldO92Nnd/eMl6FXyyfgN/VYCpgf+Er4YJ
-h2WIwoohi4GOR4+skRKSe5PklVCWvJgrmZubDJx/nfSfaqDholqj1aVRps+oTqnOq1Gs1K2Xrlqv4LFp
-svK0frYLt5m5Kbnxurq8Tb3hv3fBDsHawqfEQcUPxd3He8hKyRnKusuKzFvN/87Rz6PQdtFK0vHTxtSb
-1kXXG9fx2MjZn9tO3Cbc/93Y3rHfiuBk4hni9ePQ5KzliOZk50HoH+j86drqueuX7HbtVu427xbv9/DX
-8bnymvN89F/1QvYl9wj37PjQ+bX6mvt//GX9S/4x//8AAGRlc2MAAAAAAAAACkNvbG9yIExDRAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABIAAAAcAEMAbwBsAG8AcgAgAEwAQwBE
-AABtbW9kAAAAAAAABhAAAJxOAAAAAL5zkQAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQg
-QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA</bytes>
- </object>
- </object>
- </object>
- </object>
- <object class="NSColor" key="NSColor" id="30384615">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MCAwAA</bytes>
- </object>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- <object class="NSButtonCell" id="971445237">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">program crashes in between fork() and exec() (3rd option in first group will happen before crash)</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="891367997"/>
- <int key="NSTag">7</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAv0AAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAL9GFw
-cGwCAAAAbW50clJHQiBYWVogB9gAAgAMAAoAFgAIYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAPbWAAEAAAAA0y1hcHBs625VECyhxeSV9P9A73pKGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAANclhZWgAAASAAAAAUZ1hZWgAAATQAAAAUYlhZWgAAAUgAAAAUd3RwdAAAAVwAAAAUY2hhZAAA
-AXAAAAAsclRSQwAAAZwAAAAOZ1RSQwAAAawAAAAOYlRSQwAAAbwAAAAOdmNndAAAAcwAAAYSbmRpbgAA
-B+AAAAMOZGVzYwAACvAAAACZY3BydAAAC4wAAABAbW1vZAAAC8wAAAAoWFlaIAAAAAAAAJumAABMVQAA
-ArBYWVogAAAAAAAANWMAAJ/rAAAZsVhZWiAAAAAAAAAlzQAAE9UAALbFWFlaIAAAAAAAAPPYAAEAAAAB
-FghzZjMyAAAAAAABC7cAAAWW///zVwAABykAAP3X///7t////aYAAAPaAADA9mN1cnYAAAAAAAAAAQHN
-AABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAADAQAAAgAAAioENAYA
-B9AJlAtRDQwOshBOEekTgxUVFqMYMRm9GzwcvR4+H7chLiKnJBoliCb3KGIpyCswLJMt9C9WMLIyDjNn
-NL02FTdoOLs6ETtdPKw9+D9DQJBB1kMeRGZFq0bySDRJeEq6S/tNPk59T75Q+lI2U25Uo1XZVwlYOlln
-WpZbwFzsXhdfQWBrYZRiv2PoZRNmPWdqaJhpyGr5bC1tZW6hb+BxLXJ+c9d1OHafeA55gnr5fHR98H9t
-gOuCY4PYhUqGsIgSiWyKuIwBjTqObY+VkLORyJLUk9eU05XFlrWXlZh2mUuaG5rsm6ucbJ0qndqei588
-n9+ghKEqoceiYqL/o5qkLqTDpVml66Z7pwunnKgpqLWpQqnQqlqq5Ktvq/qsg60MrZauIa6qrzOvvbBH
-sNGxXLHnsnKy/7OMtBm0p7U3tci2Wbbrt4C4FrituUa54rqAux27wbxlvQq9rr5Tvvi/ncBAwOXBisIu
-wtPDeMQdxMLFaMYPxrXHXMgEyKzJVcn/yqnLVcwBzK7NXc4Mzr3PcNAk0NnRkdJK0wTTw9SC1UTWCtbR
-153Ybdk+2hfa8dvM3KfdhN5g3zzgGuD34dbiteOV5HblWeY85yHoCOjw6drqxuu27Kbtm+6R74zwivGM
-8pPzn/Sw9cj25/gP+T76e/u//Rr+hP//AAABpANzBRoGsggnCZsLFQx+Dd4PRRCiEf8TYxS0FgoXXRiu
-GgQbTRyZHekfMCB8IcIjCSRSJZUm3SgdKWAqpCvjLSYuZC+lMOIyIDNgNJs12TcTOFA5izrEO/49NT5w
-P6dA30IWQ01Eg0W4Ru9IIElVSoZLt0zmThVPRFBwUZ5SylP5VSRWUVd+WKtZ2lsIXDhdaV6bX89hBWI8
-Y3dktGX0ZzhohGnVayxsiW3sb1Vww3I0c6p1I3aeeBl5k3sMfIR99X9kgM6CLYOJhNyGJodriKGJ1Ir5
-jBuNL45Aj0WQSJE8kjKTGJP+lNyVspaKl1OYHZjlmaSaZJshm9ecj51EnfSepJ9Vn/+gqqFWofyio6NL
-o/CklKU4pdymfacfp8KoYqkDqaWqRarlq4asJ6zHrWiuCq6rr02v77CSsTax27KAsyezzrR3tSG1zLZ5
-tye32LiKuT659rqwu2q8J7zkvaK+YL8ev93AnMFcwhzC3MOdxF7FIMXixqXHaMgryPDJtcp6y0DMB8zO
-zZbOX88oz/PQvtGJ0lbTI9Px1MDVkNZi1zTYB9jb2bDah9te3DjdEt3t3sjfpOB/4VviN+MT4/DkzeWq
-5ojnZuhG6SXqBuro68rsre2S7nfvXvBH8TDyHPMI8/j06fXc9tL3yvjF+cL6w/vG/ND92v7s//8AAAMJ
-BboIZwrCDSsPghG8E/IWHxg5GkgcVB5VIEQiMyQTJeknuimHK00tCy7AMHEyHDO/NV829ziKOhs7pj0s
-PrBALEGmQx9EkkYCR3JI3EpCS6pND05vT89RLVKKU+dVP1aYV+9ZRVqdW/NdSV6hX+thM2JzY61k42YS
-Z0FoZ2mOaq5rz2zsbglvI3A9cVRybHOEdJx1tHbOd+d5A3ofez98Yn2Lfrl/8IEqgmyDsoT8hkuHnYjw
-ikSLmYzsjj+PjJDWkh2TW5SXlceW85gWmTOaSJtVnFqdWp5Pn0SgKaEQoeuiwqOYpGClKaXtpqmnZqgf
-qNKph6o5quWrk6xArOatja41rtevebAcsLyxWbH3spWzL7PJtGO0/LWTtiq2wrdWt+q4f7kUuaW6OLrL
-u1277Lx9vQ69nr4tvry/TL/bwGjA98GGwhPCocMvw77ESsTYxWXF9MZ/xwzHmcgkyKXJJ8mpyizKpMsc
-y5XMDsyFzPjNa83fzlPOxc81z6fQGNCK0PvRbNHe0lDSw9M206vUINSV1QvVhtYA1nzW+Nd61//YhNkK
-2ZnaL9rG213cCty63WveI97d35fgUuEO4crih+NE5ALkw+WD5kXnCufP6JbpYOor6vrry+yd7XbuUe8w
-8BXw+/Ht8uDz4PTl9fj3E/hE+X363vxa/gH//wAAbmRpbgAAAAAAAAMGAACogAAAUwAAADRAAACqQAAA
-JpcAABLbAABQQAAAVEAAAj99AAI1egACxUsAAwB4AAIAAAADAAsAGQAsAEUAYwCHALEA4QEWAVEBkgHZ
-AiYCeQLSAzEDlwQDBHYE7wVvBfUGgwcXB7IIUwj8CawKYgsgC+QMrw2BDloPORAfEQ0SBRMGFBEVJBZA
-F2MYjhm/GvYcMh1xHrMf9SE1ImwjnSTJJfAnFig7KWMqjivBLP4uSC+jMRMymzRBNgo3+joWPGY+8EG8
-RNhIQEvvT95UCFhkXOxhlWZYaylv/XTKeYN+GoKOhxGLqJBOlP6Ztp5voyan1Kx0sQG1c7nGvfHB9cX7
-ygbOFNIi1izaMN4p4hTl7emv7Vbw3vRC93z6iP1g//8AAAAEAA8AIgA9AF8AiQC7APQBNAF8AcwCIgKB
-AuYDUwPHBEIExAVOBd4GdgcUB7oIZgkaCdQKlQteDC0NAw3gDsQPrxCiEZwSnxOpFLsV0xbyGBcZQRpw
-G6Mc2R4RH0oggyG3IuckEyU8JmQniyiyKd0rDCxBLYAuyTAhMYkzBjSbNkw4HToSPDA+fED8Q7FGmUmx
-TPdQaFQAV7tbll+KY5RnrmvTb/p0H3g6fEOAMoQXiASL+I/yk/KX+JwBoA2kHKgrrDuwS7RYuGK8aMBo
-xGvId8yI0J/UuNjS3OvhAOUQ6RftE/EC9OH4rfxi//8AAAABAAYADQAXACUANQBIAF8AeQCWALcA3AEE
-ATABYQGVAc4CDAJOApUC4QMyA4gD5QRGBK4FHAWPBgkGigcQB54IMQjMCW0KFArDC3cMMgzzDbsOiA9a
-EDIRFhIIEwgUFRUvFlYXhxjDGgkbVhyqHgMfYCC8IhIjYSSrJfMnOSiBKc0rHyx7LeQvXTDrMpE0VTY7
-OEg6gjzuP5NCckWCSMJMMk/QU5xXk1u1X/9kcGkGbb5ylneLfJqByoeDjcyUf5t4oo2plLBetru8eMFr
-xirK7c+v1GnZFd2r4iXme+ql7pryUvXD+OT7qv4M//8AAGRlc2MAAAAAAAAAFUhQIExQMzA2NSBDYWxp
-YnJhdGVkAAAAAAAAAAAVAEgAUAAgAEwAUAAzADAANgA1ACAAQwBhAGwAaQBiAHIAYQB0AGUAZAAAAAAV
-SFAgTFAzMDY1IENhbGlicmF0ZWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlIEluYy4sIDIwMDgAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAABtbW9kAAAAAAAAIvAAACaQAAAAAMJtVwAAAAAAAAAAAAAAAAAAAAAAA</bytes>
- </object>
- </object>
- </object>
- </object>
- <reference key="NSColor" ref="30384615"/>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <string key="NSAlternateContents"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- </object>
- <string key="NSCellSize">{645, 25}</string>
- <string key="NSIntercellSpacing">{4, 2}</string>
- <int key="NSMatrixFlags">1151868928</int>
- <string key="NSCellClass">NSActionCell</string>
- <object class="NSButtonCell" key="NSProtoCell" id="1072218638">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">program crashes after launch</string>
- <reference key="NSSupport" ref="933596199"/>
- <int key="NSTag">5</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <reference key="NSAlternateImage" ref="619763889"/>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- <reference key="NSSelectedCell" ref="410017819"/>
- <object class="NSColor" key="NSBackgroundColor" id="349124561">
- <int key="NSColorSpace">6</int>
- <string key="NSCatalogName">System</string>
- <string key="NSColorName">controlColor</string>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
- </object>
- </object>
- <object class="NSColor" key="NSCellBackgroundColor" id="195671423">
- <int key="NSColorSpace">3</int>
- <bytes key="NSWhite">MQA</bytes>
- </object>
- <reference key="NSFont" ref="933596199"/>
- </object>
- <object class="NSMatrix" id="7590393">
- <reference key="NSNextResponder" ref="594333702"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{20, 170}, {565, 70}}</string>
- <reference key="NSSuperview" ref="594333702"/>
- <bool key="NSEnabled">YES</bool>
- <int key="NSNumRows">3</int>
- <int key="NSNumCols">1</int>
- <object class="NSMutableArray" key="NSCells">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSButtonCell" id="808388382">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Leave breakpad alone before fork</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="7590393"/>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <reference key="NSAlternateImage" ref="619763889"/>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- <object class="NSButtonCell" id="378736460">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Uninitialize Breakpad before fork</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="7590393"/>
- <int key="NSTag">1</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAwYAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAMGGFw
-cGwCAAAAbW50clJHQiBYWVogB9YABAADABMALAASYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAPbWAAEAAAAA0y1hcHBsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAOclhZWgAAASwAAAAUZ1hZWgAAAUAAAAAUYlhZWgAAAVQAAAAUd3RwdAAAAWgAAAAUY2hhZAAA
-AXwAAAAsclRSQwAAAagAAAAOZ1RSQwAAAbgAAAAOYlRSQwAAAcgAAAAOdmNndAAAAdgAAAMSbmRpbgAA
-BOwAAAY+ZGVzYwAACywAAABkZHNjbQAAC5AAAAAubW1vZAAAC8AAAAAoY3BydAAAC+gAAAAtWFlaIAAA
-AAAAAF1KAAA0kQAACCVYWVogAAAAAAAAdCAAALRgAAAjPVhZWiAAAAAAAAAlbAAAFyoAAKfDWFlaIAAA
-AAAAAPNSAAEAAAABFs9zZjMyAAAAAAABDEIAAAXe///zJgAAB5IAAP2R///7ov///aMAAAPcAADAbGN1
-cnYAAAAAAAAAAQHNAABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAAD
-AQAAAQACBAUGBwkKCw0ODxASExQWFxgaGxweHyAiIyQmJygpKywtLzAxMjM1Njc4OTs8PT5AQUJDREZH
-SElKS0xOT1BRUlNUVVZXWFlaW1xdXl9hYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SF
-hoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnZ6foKGio6SlpqanqKmqq6ytra6vsLGysrO0tba3uLi5uru8
-vL2+v8DBwcLDxMXGxsfIycrKy8zNzs7P0NHS0tPU1dbW19jZ2drb3Nzd3t/g4eLi4+Tl5ufo6enq6+zt
-7u/w8fHy8/T19vf4+fr7/P3+/v8AAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR8gISIjJCUnKCkq
-Ky0uLzAxMzQ1Njc4OTo7PD0/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaWltcXV5fYGFiY2RlZmdo
-aWprbG1ub3BxcnN0dXZ3d3h5ent8fH1+f4CBgoKDhIWGh4iIiYqLjI2Oj5CRkpOUlJWWl5iZmpucnZ2e
-n6ChoqOkpaamp6ipqqusra6vsLCxsrO0tba3uLm5uru8vb6/wMHCw8TFx8jJysvMzc7P0NDR0tPU1dbX
-2Nna29ze3+Dh4uPk5ebn6err7O3u7/Hy8/T19vf5+vv8/f7/AAIDAwQFBgcICQoKCwwNDg8QERITFBUW
-FxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODg5Ojs8PT4+P0BBQkNDREVGR0hJSUpLTE1O
-Tk9QUVJSU1RVVVZXWFhZWltbXF1eXl9gYWFiY2RkZWZnZ2hpaWprbGxtbm5vcHFxcnNzdHV1dnd4eHl6
-ent8fH1+fn+AgYGCg4SEhYaHiImJiouMjY6Oj5CRkpOTlJWWl5iZmZqbnJ2en6ChoqOkpaanqKmqq6yt
-rq+xsrO0tba3uLq7vL2+wMHDxMbHycrMzs/R0tTW19nb3d7g4uTm6Ors7vDy9Pb4+vz+/wAAbmRpbgAA
-AAAAAAY2AACXGgAAVjoAAFPKAACJ3gAAJ8IAABaoAABQDQAAVDkAAiuFAAIZmQABeFEAAwEAAAIAAAAA
-AAEABgANABcAIwAxAEAAUgBlAHsAkwCrAMUA4gD/AR8BPwFhAYUBqgHQAfgCIAJLAncCpQLSAwIDMwNl
-A5gDzgQFBD0EdQSvBOsFKQVnBacF6AYqBm4GtQb8B0UHkgfkCDkIkAjnCT4JmAn0ClAKrQsLC2sLygwq
-DIwM8Q1XDcAOKA6SDv4PbA/bEE0QxBE7EbQSMRKwEzITuRREFNAVYBXxFocXHhfAGGIZBBmsGlQa+RuU
-HC4czh1yHhQeux9jIA0gvCFoIhkizyOJJEEk+SW6JnknOygFKMspkypiKzIsASzXLawuhy9gMD4xGzH8
-MtszvzSgNYY2cjdcOEw5OTorOxs8CD0EPfU+6z/nQOFB2ELUQ9VE00XcRttH5EjxSgBLCUwdTTFOUE9v
-UI9Rt1LdVAVVNlZsV6VY4FohW21ct135X09goGH0Y0tkqGYFZ19oxGova5ptCG54b/BxbnLsdG119Xd/
-eQh6knwqfcV/W4D4gpSEO4Xih4CJKorYjIqOOY/jkZuTWJUOlsyYiZpSnB6d4Z+soX+jWqUvpxOo+6rj
-rMuuwLC4sra0rra0uL+60LzfvwDBHcLdxLXGhchYyi7MCs3lz7rRmtOA1WPXR9kq2xPc/97s4M/iveSn
-5o3obupT7ELuLPAM8fLz0PW396H5f/tZ/T3//wAAAAEAAwALABYAJQA3AE0AZQCBAJ8AwQDlAQsBNQFh
-AZABwQH1AisCZAKfAtwDHANfA6MD6gQ0BH8EzQT1BR0FcAXEBhsGdAbPBy0HXAeMB+4IUgi4CSAJVAmK
-CfYKZArVC0cLgQu8DDIMqw0mDaIOIQ6hDyQPqRAvELgQ/RFDEc8SXRLuE4AUFRSrFUMV3RZ5FxcXthhY
-GPwZoRpIGvEbnBxJHPgdqB5bHw8fxSB9ITch8iKwJDAk8yW3Jn4nRigQKNwpqSp5K0osHCzxLccuoC95
-MFUxMzISMvMz1TS5NaA2hzdxOFw5STo4Oyg8Gj4DPvs/9EDuQepD6ETpRexG8Uf3SP9LFEwhTTBOQE9S
-UGZSklOrVMVV4Vb/WB5ZP1phW4Vcq13SXvthUmJ/Y69k4GYSZ0dofGm0au1tZG6ib+FxInJlc6l073Y2
-d396FXtjfLJ+A39VgKmB/4NWhK+GCYjCiiGLgYzjjkePrJESknuT5Ja8mCuZm5sMnH+d9J9qoOGiWqPV
-pVGmz6eOqE6pzqtRrNSuWq/gsWmy8rR+tgu5Kbq6vE294b93wQ7Cp8RBxd3He8kZyrrLisxbzf/Po9FK
-0vHUm9ZF1/HZn9tO3Cbc/96x4GTiGePQ5YjnQegf6Pzquex27jbv9/G583z0X/VC9wj40Pqa/GX+Mf//
-AAAAAQADAAsAJQA3AE0AZQCBAJ8AwQELATUBYQGQAcEB9QIrAmQCnwLcAxwDXwOjA+oENAR/BM0FHQVw
-BcQGGwZ0Bs8HLQeMB+4IUgi4CSAJign2CmQK1QtHC7wMMgyrDSYNog4hDqEPJA+pEC8QuBFDEl0S7hOA
-FBUUqxVDFnkXFxe2GFgY/BpIGvEbnBxJHPgdqB8PH8UgfSE3IfIjbyQwJPMltydGKBAo3Cp5K0osHC3H
-LqAveTEzMhIy8zS5NaA2hzhcOUk6ODwaPQ4+Az/0QO5C6EPoROlG8Uf3SglLFEwhTkBPUlF7UpJUxVXh
-Vv9ZP1phXKtd0mAlYVJjr2TgZhJofGm0au1tZG6ib+FxInJldO92Nnd/eMl6FXyyfgN/VYCpgf+Er4YJ
-h2WIwoohi4GOR4+skRKSe5PklVCWvJgrmZubDJx/nfSfaqDholqj1aVRps+oTqnOq1Gs1K2Xrlqv4LFp
-svK0frYLt5m5Kbnxurq8Tb3hv3fBDsHawqfEQcUPxd3He8hKyRnKusuKzFvN/87Rz6PQdtFK0vHTxtSb
-1kXXG9fx2MjZn9tO3Cbc/93Y3rHfiuBk4hni9ePQ5KzliOZk50HoH+j86drqueuX7HbtVu427xbv9/DX
-8bnymvN89F/1QvYl9wj37PjQ+bX6mvt//GX9S/4x//8AAGRlc2MAAAAAAAAACkNvbG9yIExDRAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABIAAAAcAEMAbwBsAG8AcgAgAEwAQwBE
-AABtbW9kAAAAAAAABhAAAJxOAAAAAL5zkQAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQg
-QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA</bytes>
- </object>
- </object>
- </object>
- </object>
- <reference key="NSColor" ref="30384615"/>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- <object class="NSButtonCell" id="251439646">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Call task_set_exception_port with null exception port in child process before exec</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="7590393"/>
- <int key="NSTag">2</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAv0AAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAL9GFw
-cGwCAAAAbW50clJHQiBYWVogB9gAAgAMAAoAFgAIYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAPbWAAEAAAAA0y1hcHBs625VECyhxeSV9P9A73pKGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAANclhZWgAAASAAAAAUZ1hZWgAAATQAAAAUYlhZWgAAAUgAAAAUd3RwdAAAAVwAAAAUY2hhZAAA
-AXAAAAAsclRSQwAAAZwAAAAOZ1RSQwAAAawAAAAOYlRSQwAAAbwAAAAOdmNndAAAAcwAAAYSbmRpbgAA
-B+AAAAMOZGVzYwAACvAAAACZY3BydAAAC4wAAABAbW1vZAAAC8wAAAAoWFlaIAAAAAAAAJumAABMVQAA
-ArBYWVogAAAAAAAANWMAAJ/rAAAZsVhZWiAAAAAAAAAlzQAAE9UAALbFWFlaIAAAAAAAAPPYAAEAAAAB
-FghzZjMyAAAAAAABC7cAAAWW///zVwAABykAAP3X///7t////aYAAAPaAADA9mN1cnYAAAAAAAAAAQHN
-AABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAADAQAAAgAAAioENAYA
-B9AJlAtRDQwOshBOEekTgxUVFqMYMRm9GzwcvR4+H7chLiKnJBoliCb3KGIpyCswLJMt9C9WMLIyDjNn
-NL02FTdoOLs6ETtdPKw9+D9DQJBB1kMeRGZFq0bySDRJeEq6S/tNPk59T75Q+lI2U25Uo1XZVwlYOlln
-WpZbwFzsXhdfQWBrYZRiv2PoZRNmPWdqaJhpyGr5bC1tZW6hb+BxLXJ+c9d1OHafeA55gnr5fHR98H9t
-gOuCY4PYhUqGsIgSiWyKuIwBjTqObY+VkLORyJLUk9eU05XFlrWXlZh2mUuaG5rsm6ucbJ0qndqei588
-n9+ghKEqoceiYqL/o5qkLqTDpVml66Z7pwunnKgpqLWpQqnQqlqq5Ktvq/qsg60MrZauIa6qrzOvvbBH
-sNGxXLHnsnKy/7OMtBm0p7U3tci2Wbbrt4C4FrituUa54rqAux27wbxlvQq9rr5Tvvi/ncBAwOXBisIu
-wtPDeMQdxMLFaMYPxrXHXMgEyKzJVcn/yqnLVcwBzK7NXc4Mzr3PcNAk0NnRkdJK0wTTw9SC1UTWCtbR
-153Ybdk+2hfa8dvM3KfdhN5g3zzgGuD34dbiteOV5HblWeY85yHoCOjw6drqxuu27Kbtm+6R74zwivGM
-8pPzn/Sw9cj25/gP+T76e/u//Rr+hP//AAABpANzBRoGsggnCZsLFQx+Dd4PRRCiEf8TYxS0FgoXXRiu
-GgQbTRyZHekfMCB8IcIjCSRSJZUm3SgdKWAqpCvjLSYuZC+lMOIyIDNgNJs12TcTOFA5izrEO/49NT5w
-P6dA30IWQ01Eg0W4Ru9IIElVSoZLt0zmThVPRFBwUZ5SylP5VSRWUVd+WKtZ2lsIXDhdaV6bX89hBWI8
-Y3dktGX0ZzhohGnVayxsiW3sb1Vww3I0c6p1I3aeeBl5k3sMfIR99X9kgM6CLYOJhNyGJodriKGJ1Ir5
-jBuNL45Aj0WQSJE8kjKTGJP+lNyVspaKl1OYHZjlmaSaZJshm9ecj51EnfSepJ9Vn/+gqqFWofyio6NL
-o/CklKU4pdymfacfp8KoYqkDqaWqRarlq4asJ6zHrWiuCq6rr02v77CSsTax27KAsyezzrR3tSG1zLZ5
-tye32LiKuT659rqwu2q8J7zkvaK+YL8ev93AnMFcwhzC3MOdxF7FIMXixqXHaMgryPDJtcp6y0DMB8zO
-zZbOX88oz/PQvtGJ0lbTI9Px1MDVkNZi1zTYB9jb2bDah9te3DjdEt3t3sjfpOB/4VviN+MT4/DkzeWq
-5ojnZuhG6SXqBuro68rsre2S7nfvXvBH8TDyHPMI8/j06fXc9tL3yvjF+cL6w/vG/ND92v7s//8AAAMJ
-BboIZwrCDSsPghG8E/IWHxg5GkgcVB5VIEQiMyQTJeknuimHK00tCy7AMHEyHDO/NV829ziKOhs7pj0s
-PrBALEGmQx9EkkYCR3JI3EpCS6pND05vT89RLVKKU+dVP1aYV+9ZRVqdW/NdSV6hX+thM2JzY61k42YS
-Z0FoZ2mOaq5rz2zsbglvI3A9cVRybHOEdJx1tHbOd+d5A3ofez98Yn2Lfrl/8IEqgmyDsoT8hkuHnYjw
-ikSLmYzsjj+PjJDWkh2TW5SXlceW85gWmTOaSJtVnFqdWp5Pn0SgKaEQoeuiwqOYpGClKaXtpqmnZqgf
-qNKph6o5quWrk6xArOatja41rtevebAcsLyxWbH3spWzL7PJtGO0/LWTtiq2wrdWt+q4f7kUuaW6OLrL
-u1277Lx9vQ69nr4tvry/TL/bwGjA98GGwhPCocMvw77ESsTYxWXF9MZ/xwzHmcgkyKXJJ8mpyizKpMsc
-y5XMDsyFzPjNa83fzlPOxc81z6fQGNCK0PvRbNHe0lDSw9M206vUINSV1QvVhtYA1nzW+Nd61//YhNkK
-2ZnaL9rG213cCty63WveI97d35fgUuEO4crih+NE5ALkw+WD5kXnCufP6JbpYOor6vrry+yd7XbuUe8w
-8BXw+/Ht8uDz4PTl9fj3E/hE+X363vxa/gH//wAAbmRpbgAAAAAAAAMGAACogAAAUwAAADRAAACqQAAA
-JpcAABLbAABQQAAAVEAAAj99AAI1egACxUsAAwB4AAIAAAADAAsAGQAsAEUAYwCHALEA4QEWAVEBkgHZ
-AiYCeQLSAzEDlwQDBHYE7wVvBfUGgwcXB7IIUwj8CawKYgsgC+QMrw2BDloPORAfEQ0SBRMGFBEVJBZA
-F2MYjhm/GvYcMh1xHrMf9SE1ImwjnSTJJfAnFig7KWMqjivBLP4uSC+jMRMymzRBNgo3+joWPGY+8EG8
-RNhIQEvvT95UCFhkXOxhlWZYaylv/XTKeYN+GoKOhxGLqJBOlP6Ztp5voyan1Kx0sQG1c7nGvfHB9cX7
-ygbOFNIi1izaMN4p4hTl7emv7Vbw3vRC93z6iP1g//8AAAAEAA8AIgA9AF8AiQC7APQBNAF8AcwCIgKB
-AuYDUwPHBEIExAVOBd4GdgcUB7oIZgkaCdQKlQteDC0NAw3gDsQPrxCiEZwSnxOpFLsV0xbyGBcZQRpw
-G6Mc2R4RH0oggyG3IuckEyU8JmQniyiyKd0rDCxBLYAuyTAhMYkzBjSbNkw4HToSPDA+fED8Q7FGmUmx
-TPdQaFQAV7tbll+KY5RnrmvTb/p0H3g6fEOAMoQXiASL+I/yk/KX+JwBoA2kHKgrrDuwS7RYuGK8aMBo
-xGvId8yI0J/UuNjS3OvhAOUQ6RftE/EC9OH4rfxi//8AAAABAAYADQAXACUANQBIAF8AeQCWALcA3AEE
-ATABYQGVAc4CDAJOApUC4QMyA4gD5QRGBK4FHAWPBgkGigcQB54IMQjMCW0KFArDC3cMMgzzDbsOiA9a
-EDIRFhIIEwgUFRUvFlYXhxjDGgkbVhyqHgMfYCC8IhIjYSSrJfMnOSiBKc0rHyx7LeQvXTDrMpE0VTY7
-OEg6gjzuP5NCckWCSMJMMk/QU5xXk1u1X/9kcGkGbb5ylneLfJqByoeDjcyUf5t4oo2plLBetru8eMFr
-xirK7c+v1GnZFd2r4iXme+ql7pryUvXD+OT7qv4M//8AAGRlc2MAAAAAAAAAFUhQIExQMzA2NSBDYWxp
-YnJhdGVkAAAAAAAAAAAVAEgAUAAgAEwAUAAzADAANgA1ACAAQwBhAGwAaQBiAHIAYQB0AGUAZAAAAAAV
-SFAgTFAzMDY1IENhbGlicmF0ZWQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAHRleHQAAAAAQ29weXJpZ2h0IEFwcGxlIEluYy4sIDIwMDgAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAABtbW9kAAAAAAAAIvAAACaQAAAAAMJtVwAAAAAAAAAAAAAAAAAAAAAAA</bytes>
- </object>
- </object>
- </object>
- </object>
- <reference key="NSColor" ref="30384615"/>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- </object>
- <string key="NSCellSize">{565, 22}</string>
- <string key="NSIntercellSpacing">{4, 2}</string>
- <int key="NSMatrixFlags">1151868928</int>
- <string key="NSCellClass">NSActionCell</string>
- <object class="NSButtonCell" key="NSProtoCell" id="773902463">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Radio</string>
- <reference key="NSSupport" ref="933596199"/>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
- </object>
- </object>
- </object>
- </object>
- <reference key="NSColor" ref="30384615"/>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- <reference key="NSSelectedCell" ref="808388382"/>
- <reference key="NSBackgroundColor" ref="349124561"/>
- <reference key="NSCellBackgroundColor" ref="195671423"/>
- <reference key="NSFont" ref="933596199"/>
- </object>
- <object class="NSMatrix" id="1050951576">
- <reference key="NSNextResponder" ref="594333702"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{20, 104}, {565, 38}}</string>
- <reference key="NSSuperview" ref="594333702"/>
- <bool key="NSEnabled">YES</bool>
- <int key="NSNumRows">2</int>
- <int key="NSNumCols">1</int>
- <object class="NSMutableArray" key="NSCells">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSButtonCell" id="943458284">
- <int key="NSCellFlags">-2080244224</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">fork()</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="1050951576"/>
- <int key="NSTag">3</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <reference key="NSAlternateImage" ref="619763889"/>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">200</int>
- <int key="NSPeriodicInterval">25</int>
- </object>
- <object class="NSButtonCell" id="69061500">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">vfork()</string>
- <reference key="NSSupport" ref="933596199"/>
- <reference key="NSControlView" ref="1050951576"/>
- <int key="NSTag">4</int>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFxgEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFzodzAAcAAAwYAAAF1gAAAAAACAAIAAgACAABAAEAAQABAAAMGGFw
-cGwCAAAAbW50clJHQiBYWVogB9YABAADABMALAASYWNzcEFQUEwAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAPbWAAEAAAAA0y1hcHBsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAOclhZWgAAASwAAAAUZ1hZWgAAAUAAAAAUYlhZWgAAAVQAAAAUd3RwdAAAAWgAAAAUY2hhZAAA
-AXwAAAAsclRSQwAAAagAAAAOZ1RSQwAAAbgAAAAOYlRSQwAAAcgAAAAOdmNndAAAAdgAAAMSbmRpbgAA
-BOwAAAY+ZGVzYwAACywAAABkZHNjbQAAC5AAAAAubW1vZAAAC8AAAAAoY3BydAAAC+gAAAAtWFlaIAAA
-AAAAAF1KAAA0kQAACCVYWVogAAAAAAAAdCAAALRgAAAjPVhZWiAAAAAAAAAlbAAAFyoAAKfDWFlaIAAA
-AAAAAPNSAAEAAAABFs9zZjMyAAAAAAABDEIAAAXe///zJgAAB5IAAP2R///7ov///aMAAAPcAADAbGN1
-cnYAAAAAAAAAAQHNAABjdXJ2AAAAAAAAAAEBzQAAY3VydgAAAAAAAAABAc0AAHZjZ3QAAAAAAAAAAAAD
-AQAAAQACBAUGBwkKCw0ODxASExQWFxgaGxweHyAiIyQmJygpKywtLzAxMjM1Njc4OTs8PT5AQUJDREZH
-SElKS0xOT1BRUlNUVVZXWFlaW1xdXl9hYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SF
-hoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnZ6foKGio6SlpqanqKmqq6ytra6vsLGysrO0tba3uLi5uru8
-vL2+v8DBwcLDxMXGxsfIycrKy8zNzs7P0NHS0tPU1dbW19jZ2drb3Nzd3t/g4eLi4+Tl5ufo6enq6+zt
-7u/w8fHy8/T19vf4+fr7/P3+/v8AAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR8gISIjJCUnKCkq
-Ky0uLzAxMzQ1Njc4OTo7PD0/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaWltcXV5fYGFiY2RlZmdo
-aWprbG1ub3BxcnN0dXZ3d3h5ent8fH1+f4CBgoKDhIWGh4iIiYqLjI2Oj5CRkpOUlJWWl5iZmpucnZ2e
-n6ChoqOkpaamp6ipqqusra6vsLCxsrO0tba3uLm5uru8vb6/wMHCw8TFx8jJysvMzc7P0NDR0tPU1dbX
-2Nna29ze3+Dh4uPk5ebn6err7O3u7/Hy8/T19vf5+vv8/f7/AAIDAwQFBgcICQoKCwwNDg8QERITFBUW
-FxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODg5Ojs8PT4+P0BBQkNDREVGR0hJSUpLTE1O
-Tk9QUVJSU1RVVVZXWFhZWltbXF1eXl9gYWFiY2RkZWZnZ2hpaWprbGxtbm5vcHFxcnNzdHV1dnd4eHl6
-ent8fH1+fn+AgYGCg4SEhYaHiImJiouMjY6Oj5CRkpOTlJWWl5iZmZqbnJ2en6ChoqOkpaanqKmqq6yt
-rq+xsrO0tba3uLq7vL2+wMHDxMbHycrMzs/R0tTW19nb3d7g4uTm6Ors7vDy9Pb4+vz+/wAAbmRpbgAA
-AAAAAAY2AACXGgAAVjoAAFPKAACJ3gAAJ8IAABaoAABQDQAAVDkAAiuFAAIZmQABeFEAAwEAAAIAAAAA
-AAEABgANABcAIwAxAEAAUgBlAHsAkwCrAMUA4gD/AR8BPwFhAYUBqgHQAfgCIAJLAncCpQLSAwIDMwNl
-A5gDzgQFBD0EdQSvBOsFKQVnBacF6AYqBm4GtQb8B0UHkgfkCDkIkAjnCT4JmAn0ClAKrQsLC2sLygwq
-DIwM8Q1XDcAOKA6SDv4PbA/bEE0QxBE7EbQSMRKwEzITuRREFNAVYBXxFocXHhfAGGIZBBmsGlQa+RuU
-HC4czh1yHhQeux9jIA0gvCFoIhkizyOJJEEk+SW6JnknOygFKMspkypiKzIsASzXLawuhy9gMD4xGzH8
-MtszvzSgNYY2cjdcOEw5OTorOxs8CD0EPfU+6z/nQOFB2ELUQ9VE00XcRttH5EjxSgBLCUwdTTFOUE9v
-UI9Rt1LdVAVVNlZsV6VY4FohW21ct135X09goGH0Y0tkqGYFZ19oxGova5ptCG54b/BxbnLsdG119Xd/
-eQh6knwqfcV/W4D4gpSEO4Xih4CJKorYjIqOOY/jkZuTWJUOlsyYiZpSnB6d4Z+soX+jWqUvpxOo+6rj
-rMuuwLC4sra0rra0uL+60LzfvwDBHcLdxLXGhchYyi7MCs3lz7rRmtOA1WPXR9kq2xPc/97s4M/iveSn
-5o3obupT7ELuLPAM8fLz0PW396H5f/tZ/T3//wAAAAEAAwALABYAJQA3AE0AZQCBAJ8AwQDlAQsBNQFh
-AZABwQH1AisCZAKfAtwDHANfA6MD6gQ0BH8EzQT1BR0FcAXEBhsGdAbPBy0HXAeMB+4IUgi4CSAJVAmK
-CfYKZArVC0cLgQu8DDIMqw0mDaIOIQ6hDyQPqRAvELgQ/RFDEc8SXRLuE4AUFRSrFUMV3RZ5FxcXthhY
-GPwZoRpIGvEbnBxJHPgdqB5bHw8fxSB9ITch8iKwJDAk8yW3Jn4nRigQKNwpqSp5K0osHCzxLccuoC95
-MFUxMzISMvMz1TS5NaA2hzdxOFw5STo4Oyg8Gj4DPvs/9EDuQepD6ETpRexG8Uf3SP9LFEwhTTBOQE9S
-UGZSklOrVMVV4Vb/WB5ZP1phW4Vcq13SXvthUmJ/Y69k4GYSZ0dofGm0au1tZG6ib+FxInJlc6l073Y2
-d396FXtjfLJ+A39VgKmB/4NWhK+GCYjCiiGLgYzjjkePrJESknuT5Ja8mCuZm5sMnH+d9J9qoOGiWqPV
-pVGmz6eOqE6pzqtRrNSuWq/gsWmy8rR+tgu5Kbq6vE294b93wQ7Cp8RBxd3He8kZyrrLisxbzf/Po9FK
-0vHUm9ZF1/HZn9tO3Cbc/96x4GTiGePQ5YjnQegf6Pzquex27jbv9/G583z0X/VC9wj40Pqa/GX+Mf//
-AAAAAQADAAsAJQA3AE0AZQCBAJ8AwQELATUBYQGQAcEB9QIrAmQCnwLcAxwDXwOjA+oENAR/BM0FHQVw
-BcQGGwZ0Bs8HLQeMB+4IUgi4CSAJign2CmQK1QtHC7wMMgyrDSYNog4hDqEPJA+pEC8QuBFDEl0S7hOA
-FBUUqxVDFnkXFxe2GFgY/BpIGvEbnBxJHPgdqB8PH8UgfSE3IfIjbyQwJPMltydGKBAo3Cp5K0osHC3H
-LqAveTEzMhIy8zS5NaA2hzhcOUk6ODwaPQ4+Az/0QO5C6EPoROlG8Uf3SglLFEwhTkBPUlF7UpJUxVXh
-Vv9ZP1phXKtd0mAlYVJjr2TgZhJofGm0au1tZG6ib+FxInJldO92Nnd/eMl6FXyyfgN/VYCpgf+Er4YJ
-h2WIwoohi4GOR4+skRKSe5PklVCWvJgrmZubDJx/nfSfaqDholqj1aVRps+oTqnOq1Gs1K2Xrlqv4LFp
-svK0frYLt5m5Kbnxurq8Tb3hv3fBDsHawqfEQcUPxd3He8hKyRnKusuKzFvN/87Rz6PQdtFK0vHTxtSb
-1kXXG9fx2MjZn9tO3Cbc/93Y3rHfiuBk4hni9ePQ5KzliOZk50HoH+j86drqueuX7HbtVu427xbv9/DX
-8bnymvN89F/1QvYl9wj37PjQ+bX6mvt//GX9S/4x//8AAGRlc2MAAAAAAAAACkNvbG9yIExDRAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAAAAAAAAAAAAAABtbHVjAAAAAAAAAAEAAAAMZW5VUwAAABIAAAAcAEMAbwBsAG8AcgAgAEwAQwBE
-AABtbW9kAAAAAAAABhAAAJxOAAAAAL5zkQAAAAAAAAAAAAAAAAAAAAAAdGV4dAAAAABDb3B5cmlnaHQg
-QXBwbGUgQ29tcHV0ZXIsIEluYy4sIDIwMDUAAAAAA</bytes>
- </object>
- </object>
- </object>
- </object>
- <reference key="NSColor" ref="30384615"/>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- </object>
- <string key="NSCellSize">{565, 18}</string>
- <string key="NSIntercellSpacing">{4, 2}</string>
- <int key="NSMatrixFlags">1151868928</int>
- <string key="NSCellClass">NSActionCell</string>
- <object class="NSButtonCell" key="NSProtoCell" id="709643899">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">0</int>
- <string key="NSContents">Radio</string>
- <reference key="NSSupport" ref="933596199"/>
- <int key="NSButtonFlags">1211912703</int>
- <int key="NSButtonFlags2">0</int>
- <object class="NSImage" key="NSNormalImage">
- <int key="NSImageFlags">549453824</int>
- <string key="NSSize">{18, 18}</string>
- <object class="NSMutableArray" key="NSReps">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <object class="NSBitmapImageRep">
- <object class="NSData" key="NSTIFFRepresentation">
- <bytes key="NS.bytes">TU0AKgAABRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAAA
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAADwRERGLJycnySsrK/A1NTXw
-IyMjyRwcHIsJCQk8AAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFFRUVdVBQUOCoqKj/
-29vb//n5+f/6+vr/2tra/6qqqv9UVFTgHx8fdQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUZGRl5
-dXV198PDw//8/Pz////////////////////////////U1NT/fHx89yUlJXkAAAAFAAAAAAAAAAAAAAAA
-AAAAAxEREUZqamrmtbW1/+3t7f/+/v7//v7+//7+/v/9/f3//f39//39/f/39/f/xMTE/3d3d+YZGRlG
-AAAAAwAAAAAAAAAAAAAACkJCQqGtra3/xsbG/+vr6//y8vL/9fX1//X19f/z8/P/9fX1//Ly8v/u7u7/
-0tLS/6+vr/9KSkqhAAAACgAAAAAAAAAAAAAAF3h4eN2/v7//z8/P/93d3f/q6ur/7+/v/+/v7//w8PD/
-7e3t/+3t7f/i4uL/zs7O/8XFxf98fHzdAAAAFwAAAAAAAAADAAAAJKSkpPjOzs7/2dnZ/+Dg4P/i4uL/
-5eXl/+bm5v/n5+f/5eXl/+Li4v/e3t7/2tra/9DQ0P+srKz4AAAAJAAAAAMAAAADAAAALrCwsPrW1tb/
-3t7e/+Tk5P/p6en/6+vr/+zs7P/p6en/6+vr/+fn5//k5OT/4ODg/9nZ2f+zs7P6AAAALgAAAAMAAAAD
-AAAALp2dnezg4OD/5eXl/+rq6v/u7u7/8PDw//Dw8P/x8fH/8PDw/+7u7v/q6ur/5ubm/+Hh4f+ZmZns
-AAAALgAAAAMAAAADAAAAJG5ubs/l5eX/6enp/+/v7//y8vL/9vb2//r6+v/5+fn/9/f3//b29v/x8fH/
-6+vr/+Tk5P9ra2vPAAAAJAAAAAMAAAAAAAAAFy4uLpPCwsL67Ozs//Pz8//5+fn//v7+//7+/v/+/v7/
-/v7+//v7+//19fX/8PDw/8LCwvosLCyTAAAAFwAAAAAAAAAAAAAACgAAAENfX1/S5OTk/vn5+f/+/v7/
-///////////////////////////8/Pz/5ubm/l9fX9IAAABDAAAACgAAAAAAAAAAAAAAAwAAABcAAABl
-YmJi3NLS0v3////////////////////////////////V1dX9ZGRk3AAAAGUAAAAXAAAAAwAAAAAAAAAA
-AAAAAAAAAAUAAAAfAAAAZTMzM8KAgIDwv7+//O3t7f/t7e3/v7+//ICAgPAzMzPCAAAAZQAAAB8AAAAF
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAFwAAAEMAAAB3AAAAnwAAALMAAACzAAAAnwAAAHcAAABD
-AAAAFwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAoAAAAXAAAAJAAAAC4AAAAu
-AAAAJAAAABcAAAAKAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-AAAAAwAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADQEAAAMAAAABABIAAAEB
-AAMAAAABABIAAAECAAMAAAAEAAAFugEDAAMAAAABAAEAAAEGAAMAAAABAAIAAAERAAQAAAABAAAACAES
-AAMAAAABAAEAAAEVAAMAAAABAAQAAAEWAAMAAAABABIAAAEXAAQAAAABAAAFEAEcAAMAAAABAAEAAAFS
-AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
- </object>
- </object>
- </object>
- </object>
- <reference key="NSColor" ref="30384615"/>
- </object>
- <reference key="NSAlternateImage" ref="619763889"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- <reference key="NSSelectedCell" ref="943458284"/>
- <reference key="NSBackgroundColor" ref="349124561"/>
- <reference key="NSCellBackgroundColor" ref="195671423"/>
- <reference key="NSFont" ref="933596199"/>
- </object>
- <object class="NSButton" id="512228208">
- <reference key="NSNextResponder" ref="594333702"/>
- <int key="NSvFlags">268</int>
- <string key="NSFrame">{{591, 59}, {178, 161}}</string>
- <reference key="NSSuperview" ref="594333702"/>
- <bool key="NSEnabled">YES</bool>
- <object class="NSButtonCell" key="NSCell" id="69630975">
- <int key="NSCellFlags">67239424</int>
- <int key="NSCellFlags2">134217728</int>
- <string key="NSContents">Go!</string>
- <object class="NSFont" key="NSSupport">
- <string key="NSName">LucidaGrande</string>
- <double key="NSSize">10</double>
- <int key="NSfFlags">16</int>
- </object>
- <reference key="NSControlView" ref="512228208"/>
- <int key="NSButtonFlags">-2033434369</int>
- <int key="NSButtonFlags2">130</int>
- <string key="NSAlternateContents"/>
- <string key="NSKeyEquivalent"/>
- <int key="NSPeriodicDelay">400</int>
- <int key="NSPeriodicInterval">75</int>
- </object>
- </object>
- </object>
- <string key="NSFrameSize">{787, 260}</string>
- <reference key="NSSuperview"/>
- </object>
- <string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
- <string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
- </object>
- </object>
- <object class="IBObjectContainer" key="IBDocument.Objects">
- <object class="NSMutableArray" key="connectionRecords">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performMiniaturize:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="683986939"/>
- </object>
- <int key="connectionID">37</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">arrangeInFront:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="164762492"/>
- </object>
- <int key="connectionID">39</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">print:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="302505815"/>
- </object>
- <int key="connectionID">86</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">runPageLayout:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="409810395"/>
- </object>
- <int key="connectionID">87</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">showHelp:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="192540884"/>
- </object>
- <int key="connectionID">122</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">clearRecentDocuments:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="85018532"/>
- </object>
- <int key="connectionID">127</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">terminate:</string>
- <reference key="source" ref="870565383"/>
- <reference key="destination" ref="887927135"/>
- </object>
- <int key="connectionID">139</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">orderFrontStandardAboutPanel:</string>
- <reference key="source" ref="870565383"/>
- <reference key="destination" ref="838552093"/>
- </object>
- <int key="connectionID">142</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">hideOtherApplications:</string>
- <reference key="source" ref="870565383"/>
- <reference key="destination" ref="216168366"/>
- </object>
- <int key="connectionID">146</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">hide:</string>
- <reference key="source" ref="870565383"/>
- <reference key="destination" ref="104472016"/>
- </object>
- <int key="connectionID">152</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">unhideAllApplications:</string>
- <reference key="source" ref="870565383"/>
- <reference key="destination" ref="667790509"/>
- </object>
- <int key="connectionID">153</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">cut:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="909447496"/>
- </object>
- <int key="connectionID">175</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">paste:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="84012734"/>
- </object>
- <int key="connectionID">176</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">redo:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="1001272176"/>
- </object>
- <int key="connectionID">178</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">selectAll:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="917620781"/>
- </object>
- <int key="connectionID">179</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">undo:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="284548410"/>
- </object>
- <int key="connectionID">180</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">copy:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="994487277"/>
- </object>
- <int key="connectionID">181</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">showGuessPanel:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="438210660"/>
- </object>
- <int key="connectionID">188</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">checkSpelling:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="102172584"/>
- </object>
- <int key="connectionID">190</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">toggleContinuousSpellChecking:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="540509341"/>
- </object>
- <int key="connectionID">192</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performClose:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="468594275"/>
- </object>
- <int key="connectionID">193</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">delete:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="512189403"/>
- </object>
- <int key="connectionID">195</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performZoom:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="548098734"/>
- </object>
- <int key="connectionID">198</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performFindPanelAction:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="203238834"/>
- </object>
- <int key="connectionID">199</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performFindPanelAction:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="861312964"/>
- </object>
- <int key="connectionID">200</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performFindPanelAction:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="743767160"/>
- </object>
- <int key="connectionID">201</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">performFindPanelAction:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="180446588"/>
- </object>
- <int key="connectionID">202</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">centerSelectionInVisibleArea:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="731027425"/>
- </object>
- <int key="connectionID">203</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">pasteAsPlainText:</string>
- <reference key="source" ref="442653439"/>
- <reference key="destination" ref="182251545"/>
- </object>
- <int key="connectionID">205</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">crash:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="726278107"/>
- </object>
- <int key="connectionID">208</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">window_</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="341270541"/>
- </object>
- <int key="connectionID">209</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">crash:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="799567279"/>
- </object>
- <int key="connectionID">211</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">crash:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="27781390"/>
- </object>
- <int key="connectionID">213</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">forkTestOptions_</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="347013037"/>
- </object>
- <int key="connectionID">241</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forkTestOptions:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="943458284"/>
- </object>
- <int key="connectionID">242</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forkTestOptions:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="7590393"/>
- </object>
- <int key="connectionID">243</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forkTestOptions:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="410017819"/>
- </object>
- <int key="connectionID">244</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forkTestGo:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="512228208"/>
- </object>
- <int key="connectionID">250</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forkTestOptions:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="1050951576"/>
- </object>
- <int key="connectionID">261</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">forkTestOptions:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="891367997"/>
- </object>
- <int key="connectionID">262</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">showForkTestWindow:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="856256540"/>
- </object>
- <int key="connectionID">283</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">generateReportWithoutCrash:</string>
- <reference key="source" ref="623097029"/>
- <reference key="destination" ref="460755987"/>
- </object>
- <int key="connectionID">327</int>
- </object>
- </object>
- <object class="IBMutableOrderedSet" key="objectRecords">
- <object class="NSArray" key="orderedObjects">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBObjectRecord">
- <int key="objectID">0</int>
- <reference key="object" ref="0"/>
- <reference key="children" ref="925601844"/>
- <nil key="parent"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-2</int>
- <reference key="object" ref="870565383"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">File's Owner</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-1</int>
- <reference key="object" ref="442653439"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">First Responder</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">-3</int>
- <reference key="object" ref="751079937"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">Application</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">21</int>
- <reference key="object" ref="341270541"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="814272478"/>
- </object>
- <reference key="parent" ref="0"/>
- <string key="objectName">Window</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">2</int>
- <reference key="object" ref="814272478"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="726278107"/>
- <reference ref="799567279"/>
- <reference ref="27781390"/>
- <reference ref="856256540"/>
- <reference ref="460755987"/>
- </object>
- <reference key="parent" ref="341270541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">206</int>
- <reference key="object" ref="726278107"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="539552922"/>
- </object>
- <reference key="parent" ref="814272478"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">210</int>
- <reference key="object" ref="799567279"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1010617379"/>
- </object>
- <reference key="parent" ref="814272478"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">212</int>
- <reference key="object" ref="27781390"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="547901497"/>
- </object>
- <reference key="parent" ref="814272478"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">218</int>
- <reference key="object" ref="856256540"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="353736234"/>
- </object>
- <reference key="parent" ref="814272478"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">325</int>
- <reference key="object" ref="460755987"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="775425649"/>
- </object>
- <reference key="parent" ref="814272478"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">29</int>
- <reference key="object" ref="695387251"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="764068863"/>
- <reference ref="458207250"/>
- <reference ref="369472335"/>
- <reference ref="599772536"/>
- <reference ref="542216986"/>
- </object>
- <reference key="parent" ref="0"/>
- <string key="objectName">MainMenu</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">19</int>
- <reference key="object" ref="764068863"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="200536676"/>
- </object>
- <reference key="parent" ref="695387251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">24</int>
- <reference key="object" ref="200536676"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="164762492"/>
- <reference ref="683986939"/>
- <reference ref="297002686"/>
- <reference ref="548098734"/>
- </object>
- <reference key="parent" ref="764068863"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">5</int>
- <reference key="object" ref="164762492"/>
- <reference key="parent" ref="200536676"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">23</int>
- <reference key="object" ref="683986939"/>
- <reference key="parent" ref="200536676"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">92</int>
- <reference key="object" ref="297002686"/>
- <reference key="parent" ref="200536676"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">197</int>
- <reference key="object" ref="548098734"/>
- <reference key="parent" ref="200536676"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">56</int>
- <reference key="object" ref="458207250"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="753534561"/>
- </object>
- <reference key="parent" ref="695387251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">57</int>
- <reference key="object" ref="753534561"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="838552093"/>
- <reference ref="443649494"/>
- <reference ref="826764396"/>
- <reference ref="104472016"/>
- <reference ref="887927135"/>
- <reference ref="217746140"/>
- <reference ref="881859155"/>
- <reference ref="216168366"/>
- <reference ref="928933982"/>
- <reference ref="667790509"/>
- <reference ref="758254482"/>
- </object>
- <reference key="parent" ref="458207250"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">58</int>
- <reference key="object" ref="838552093"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">129</int>
- <reference key="object" ref="443649494"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">131</int>
- <reference key="object" ref="826764396"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="276709607"/>
- </object>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">130</int>
- <reference key="object" ref="276709607"/>
- <reference key="parent" ref="826764396"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">134</int>
- <reference key="object" ref="104472016"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">136</int>
- <reference key="object" ref="887927135"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">143</int>
- <reference key="object" ref="217746140"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">144</int>
- <reference key="object" ref="881859155"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">145</int>
- <reference key="object" ref="216168366"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">149</int>
- <reference key="object" ref="928933982"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">150</int>
- <reference key="object" ref="667790509"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">196</int>
- <reference key="object" ref="758254482"/>
- <reference key="parent" ref="753534561"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">83</int>
- <reference key="object" ref="369472335"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="902982238"/>
- </object>
- <reference key="parent" ref="695387251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">81</int>
- <reference key="object" ref="902982238"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="367379562"/>
- <reference ref="468594275"/>
- <reference ref="232609393"/>
- <reference ref="479945444"/>
- <reference ref="409810395"/>
- <reference ref="302505815"/>
- <reference ref="154948703"/>
- <reference ref="976375553"/>
- <reference ref="660391032"/>
- <reference ref="885975128"/>
- <reference ref="84883275"/>
- </object>
- <reference key="parent" ref="369472335"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">72</int>
- <reference key="object" ref="367379562"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">73</int>
- <reference key="object" ref="468594275"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">74</int>
- <reference key="object" ref="232609393"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">75</int>
- <reference key="object" ref="479945444"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">77</int>
- <reference key="object" ref="409810395"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">78</int>
- <reference key="object" ref="302505815"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">79</int>
- <reference key="object" ref="154948703"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">80</int>
- <reference key="object" ref="976375553"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">82</int>
- <reference key="object" ref="660391032"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">112</int>
- <reference key="object" ref="885975128"/>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">124</int>
- <reference key="object" ref="84883275"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="693280130"/>
- </object>
- <reference key="parent" ref="902982238"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">125</int>
- <reference key="object" ref="693280130"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="85018532"/>
- </object>
- <reference key="parent" ref="84883275"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">126</int>
- <reference key="object" ref="85018532"/>
- <reference key="parent" ref="693280130"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">103</int>
- <reference key="object" ref="599772536"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1066958924"/>
- </object>
- <reference key="parent" ref="695387251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">106</int>
- <reference key="object" ref="1066958924"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="192540884"/>
- </object>
- <reference key="parent" ref="599772536"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">111</int>
- <reference key="object" ref="192540884"/>
- <reference key="parent" ref="1066958924"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">163</int>
- <reference key="object" ref="542216986"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="1053284541"/>
- </object>
- <reference key="parent" ref="695387251"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">169</int>
- <reference key="object" ref="1053284541"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="209744238"/>
- <reference ref="994487277"/>
- <reference ref="284548410"/>
- <reference ref="909447496"/>
- <reference ref="512189403"/>
- <reference ref="153501847"/>
- <reference ref="84012734"/>
- <reference ref="917620781"/>
- <reference ref="1001272176"/>
- <reference ref="431895313"/>
- <reference ref="61602259"/>
- <reference ref="182251545"/>
- </object>
- <reference key="parent" ref="542216986"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">156</int>
- <reference key="object" ref="209744238"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">157</int>
- <reference key="object" ref="994487277"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">158</int>
- <reference key="object" ref="284548410"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">160</int>
- <reference key="object" ref="909447496"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">164</int>
- <reference key="object" ref="512189403"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">168</int>
- <reference key="object" ref="153501847"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="333484665"/>
- </object>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">159</int>
- <reference key="object" ref="333484665"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="203238834"/>
- <reference ref="731027425"/>
- <reference ref="180446588"/>
- <reference ref="743767160"/>
- <reference ref="861312964"/>
- </object>
- <reference key="parent" ref="153501847"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">154</int>
- <reference key="object" ref="203238834"/>
- <reference key="parent" ref="333484665"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">155</int>
- <reference key="object" ref="731027425"/>
- <reference key="parent" ref="333484665"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">161</int>
- <reference key="object" ref="180446588"/>
- <reference key="parent" ref="333484665"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">162</int>
- <reference key="object" ref="743767160"/>
- <reference key="parent" ref="333484665"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">167</int>
- <reference key="object" ref="861312964"/>
- <reference key="parent" ref="333484665"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">171</int>
- <reference key="object" ref="84012734"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">172</int>
- <reference key="object" ref="917620781"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">173</int>
- <reference key="object" ref="1001272176"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">174</int>
- <reference key="object" ref="431895313"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">184</int>
- <reference key="object" ref="61602259"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="8174285"/>
- </object>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">185</int>
- <reference key="object" ref="8174285"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="438210660"/>
- <reference ref="102172584"/>
- <reference ref="540509341"/>
- </object>
- <reference key="parent" ref="61602259"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">187</int>
- <reference key="object" ref="438210660"/>
- <reference key="parent" ref="8174285"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">189</int>
- <reference key="object" ref="102172584"/>
- <reference key="parent" ref="8174285"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">191</int>
- <reference key="object" ref="540509341"/>
- <reference key="parent" ref="8174285"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">204</int>
- <reference key="object" ref="182251545"/>
- <reference key="parent" ref="1053284541"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">207</int>
- <reference key="object" ref="623097029"/>
- <reference key="parent" ref="0"/>
- <string key="objectName">Controller</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">220</int>
- <reference key="object" ref="347013037"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="594333702"/>
- </object>
- <reference key="parent" ref="0"/>
- <string key="objectName">Window (Window)</string>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">221</int>
- <reference key="object" ref="594333702"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="891367997"/>
- <reference ref="7590393"/>
- <reference ref="1050951576"/>
- <reference ref="512228208"/>
- </object>
- <reference key="parent" ref="347013037"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">226</int>
- <reference key="object" ref="891367997"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="410017819"/>
- <reference ref="904578786"/>
- <reference ref="971445237"/>
- <reference ref="1072218638"/>
- </object>
- <reference key="parent" ref="594333702"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">227</int>
- <reference key="object" ref="410017819"/>
- <reference key="parent" ref="891367997"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">228</int>
- <reference key="object" ref="904578786"/>
- <reference key="parent" ref="891367997"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">272</int>
- <reference key="object" ref="971445237"/>
- <reference key="parent" ref="891367997"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">232</int>
- <reference key="object" ref="7590393"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="808388382"/>
- <reference ref="378736460"/>
- <reference ref="251439646"/>
- <reference ref="773902463"/>
- </object>
- <reference key="parent" ref="594333702"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">233</int>
- <reference key="object" ref="808388382"/>
- <reference key="parent" ref="7590393"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">234</int>
- <reference key="object" ref="378736460"/>
- <reference key="parent" ref="7590393"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">236</int>
- <reference key="object" ref="251439646"/>
- <reference key="parent" ref="7590393"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">237</int>
- <reference key="object" ref="1050951576"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="943458284"/>
- <reference ref="69061500"/>
- <reference ref="709643899"/>
- </object>
- <reference key="parent" ref="594333702"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">238</int>
- <reference key="object" ref="943458284"/>
- <reference key="parent" ref="1050951576"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">239</int>
- <reference key="object" ref="69061500"/>
- <reference key="parent" ref="1050951576"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">248</int>
- <reference key="object" ref="512228208"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="69630975"/>
- </object>
- <reference key="parent" ref="594333702"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">329</int>
- <reference key="object" ref="539552922"/>
- <reference key="parent" ref="726278107"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">330</int>
- <reference key="object" ref="1010617379"/>
- <reference key="parent" ref="799567279"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">331</int>
- <reference key="object" ref="547901497"/>
- <reference key="parent" ref="27781390"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">332</int>
- <reference key="object" ref="353736234"/>
- <reference key="parent" ref="856256540"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">333</int>
- <reference key="object" ref="775425649"/>
- <reference key="parent" ref="460755987"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">334</int>
- <reference key="object" ref="69630975"/>
- <reference key="parent" ref="512228208"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">335</int>
- <reference key="object" ref="1072218638"/>
- <reference key="parent" ref="891367997"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">336</int>
- <reference key="object" ref="773902463"/>
- <reference key="parent" ref="7590393"/>
- </object>
- <object class="IBObjectRecord">
- <int key="objectID">337</int>
- <reference key="object" ref="709643899"/>
- <reference key="parent" ref="1050951576"/>
- </object>
- </object>
- </object>
- <object class="NSMutableDictionary" key="flattenedProperties">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>-3.IBPluginDependency</string>
- <string>-3.ImportedFromIB2</string>
- <string>103.IBPluginDependency</string>
- <string>103.ImportedFromIB2</string>
- <string>106.IBPluginDependency</string>
- <string>106.ImportedFromIB2</string>
- <string>111.IBPluginDependency</string>
- <string>111.ImportedFromIB2</string>
- <string>112.IBPluginDependency</string>
- <string>112.ImportedFromIB2</string>
- <string>124.IBPluginDependency</string>
- <string>124.ImportedFromIB2</string>
- <string>125.IBPluginDependency</string>
- <string>125.ImportedFromIB2</string>
- <string>126.IBPluginDependency</string>
- <string>126.ImportedFromIB2</string>
- <string>129.IBPluginDependency</string>
- <string>129.ImportedFromIB2</string>
- <string>130.IBPluginDependency</string>
- <string>130.ImportedFromIB2</string>
- <string>131.IBPluginDependency</string>
- <string>131.ImportedFromIB2</string>
- <string>134.IBPluginDependency</string>
- <string>134.ImportedFromIB2</string>
- <string>136.IBPluginDependency</string>
- <string>136.ImportedFromIB2</string>
- <string>143.IBPluginDependency</string>
- <string>143.ImportedFromIB2</string>
- <string>144.IBPluginDependency</string>
- <string>144.ImportedFromIB2</string>
- <string>145.IBPluginDependency</string>
- <string>145.ImportedFromIB2</string>
- <string>149.IBPluginDependency</string>
- <string>149.ImportedFromIB2</string>
- <string>150.IBPluginDependency</string>
- <string>150.ImportedFromIB2</string>
- <string>154.IBPluginDependency</string>
- <string>154.ImportedFromIB2</string>
- <string>155.IBPluginDependency</string>
- <string>155.ImportedFromIB2</string>
- <string>156.IBPluginDependency</string>
- <string>156.ImportedFromIB2</string>
- <string>157.IBPluginDependency</string>
- <string>157.ImportedFromIB2</string>
- <string>158.IBPluginDependency</string>
- <string>158.ImportedFromIB2</string>
- <string>159.IBPluginDependency</string>
- <string>159.ImportedFromIB2</string>
- <string>160.IBPluginDependency</string>
- <string>160.ImportedFromIB2</string>
- <string>161.IBPluginDependency</string>
- <string>161.ImportedFromIB2</string>
- <string>162.IBPluginDependency</string>
- <string>162.ImportedFromIB2</string>
- <string>163.IBPluginDependency</string>
- <string>163.ImportedFromIB2</string>
- <string>164.IBPluginDependency</string>
- <string>164.ImportedFromIB2</string>
- <string>167.IBPluginDependency</string>
- <string>167.ImportedFromIB2</string>
- <string>168.IBPluginDependency</string>
- <string>168.ImportedFromIB2</string>
- <string>169.IBPluginDependency</string>
- <string>169.ImportedFromIB2</string>
- <string>171.IBPluginDependency</string>
- <string>171.ImportedFromIB2</string>
- <string>172.IBPluginDependency</string>
- <string>172.ImportedFromIB2</string>
- <string>173.IBPluginDependency</string>
- <string>173.ImportedFromIB2</string>
- <string>174.IBPluginDependency</string>
- <string>174.ImportedFromIB2</string>
- <string>184.IBPluginDependency</string>
- <string>184.ImportedFromIB2</string>
- <string>185.IBPluginDependency</string>
- <string>185.ImportedFromIB2</string>
- <string>187.IBPluginDependency</string>
- <string>187.ImportedFromIB2</string>
- <string>189.IBPluginDependency</string>
- <string>189.ImportedFromIB2</string>
- <string>19.IBPluginDependency</string>
- <string>19.ImportedFromIB2</string>
- <string>191.IBPluginDependency</string>
- <string>191.ImportedFromIB2</string>
- <string>196.IBPluginDependency</string>
- <string>196.ImportedFromIB2</string>
- <string>197.IBPluginDependency</string>
- <string>197.ImportedFromIB2</string>
- <string>2.IBPluginDependency</string>
- <string>2.ImportedFromIB2</string>
- <string>204.IBPluginDependency</string>
- <string>204.ImportedFromIB2</string>
- <string>206.IBPluginDependency</string>
- <string>206.ImportedFromIB2</string>
- <string>207.ImportedFromIB2</string>
- <string>21.IBEditorWindowLastContentRect</string>
- <string>21.IBPluginDependency</string>
- <string>21.IBWindowTemplateEditedContentRect</string>
- <string>21.ImportedFromIB2</string>
- <string>21.windowTemplate.hasMinSize</string>
- <string>21.windowTemplate.minSize</string>
- <string>210.IBPluginDependency</string>
- <string>210.ImportedFromIB2</string>
- <string>212.IBPluginDependency</string>
- <string>212.ImportedFromIB2</string>
- <string>218.IBPluginDependency</string>
- <string>218.ImportedFromIB2</string>
- <string>220.IBEditorWindowLastContentRect</string>
- <string>220.IBPluginDependency</string>
- <string>220.IBWindowTemplateEditedContentRect</string>
- <string>220.ImportedFromIB2</string>
- <string>221.IBPluginDependency</string>
- <string>221.ImportedFromIB2</string>
- <string>226.IBPluginDependency</string>
- <string>226.ImportedFromIB2</string>
- <string>227.IBPluginDependency</string>
- <string>227.ImportedFromIB2</string>
- <string>228.IBPluginDependency</string>
- <string>228.ImportedFromIB2</string>
- <string>23.IBPluginDependency</string>
- <string>23.ImportedFromIB2</string>
- <string>232.IBPluginDependency</string>
- <string>232.ImportedFromIB2</string>
- <string>233.IBPluginDependency</string>
- <string>233.ImportedFromIB2</string>
- <string>234.IBPluginDependency</string>
- <string>234.ImportedFromIB2</string>
- <string>236.IBPluginDependency</string>
- <string>236.ImportedFromIB2</string>
- <string>237.IBPluginDependency</string>
- <string>237.ImportedFromIB2</string>
- <string>238.IBPluginDependency</string>
- <string>238.ImportedFromIB2</string>
- <string>239.IBPluginDependency</string>
- <string>239.ImportedFromIB2</string>
- <string>24.IBPluginDependency</string>
- <string>24.ImportedFromIB2</string>
- <string>248.IBPluginDependency</string>
- <string>248.ImportedFromIB2</string>
- <string>272.IBPluginDependency</string>
- <string>272.ImportedFromIB2</string>
- <string>29.IBEditorWindowLastContentRect</string>
- <string>29.IBPluginDependency</string>
- <string>29.ImportedFromIB2</string>
- <string>325.IBPluginDependency</string>
- <string>325.ImportedFromIB2</string>
- <string>329.IBPluginDependency</string>
- <string>330.IBPluginDependency</string>
- <string>331.IBPluginDependency</string>
- <string>332.IBPluginDependency</string>
- <string>333.IBPluginDependency</string>
- <string>334.IBPluginDependency</string>
- <string>335.IBPluginDependency</string>
- <string>336.IBPluginDependency</string>
- <string>337.IBPluginDependency</string>
- <string>5.IBPluginDependency</string>
- <string>5.ImportedFromIB2</string>
- <string>56.IBPluginDependency</string>
- <string>56.ImportedFromIB2</string>
- <string>57.IBPluginDependency</string>
- <string>57.ImportedFromIB2</string>
- <string>58.IBPluginDependency</string>
- <string>58.ImportedFromIB2</string>
- <string>72.IBPluginDependency</string>
- <string>72.ImportedFromIB2</string>
- <string>73.IBPluginDependency</string>
- <string>73.ImportedFromIB2</string>
- <string>74.IBPluginDependency</string>
- <string>74.ImportedFromIB2</string>
- <string>75.IBPluginDependency</string>
- <string>75.ImportedFromIB2</string>
- <string>77.IBPluginDependency</string>
- <string>77.ImportedFromIB2</string>
- <string>78.IBPluginDependency</string>
- <string>78.ImportedFromIB2</string>
- <string>79.IBPluginDependency</string>
- <string>79.ImportedFromIB2</string>
- <string>80.IBPluginDependency</string>
- <string>80.ImportedFromIB2</string>
- <string>81.IBPluginDependency</string>
- <string>81.ImportedFromIB2</string>
- <string>82.IBPluginDependency</string>
- <string>82.ImportedFromIB2</string>
- <string>83.IBPluginDependency</string>
- <string>83.ImportedFromIB2</string>
- <string>92.IBPluginDependency</string>
- <string>92.ImportedFromIB2</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <string>{{510, 1250}, {320, 188}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{510, 1250}, {320, 188}}</string>
- <boolean value="YES"/>
- <boolean value="YES"/>
- <string>{213, 107}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>{{-55, 1287}, {787, 260}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{-55, 1287}, {787, 260}}</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>{{0, 1114}, {362, 20}}</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <boolean value="YES"/>
- </object>
- </object>
- <object class="NSMutableDictionary" key="unlocalizedProperties">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <nil key="activeLocalization"/>
- <object class="NSMutableDictionary" key="localizations">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
- </object>
- <nil key="sourceID"/>
- <int key="maxID">337</int>
- </object>
- <object class="IBClassDescriber" key="IBDocument.Classes">
- <object class="NSMutableArray" key="referencedPartialClassDescriptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">Controller</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>crash:</string>
- <string>forkTestGo:</string>
- <string>forkTestOptions:</string>
- <string>generateReportWithoutCrash:</string>
- <string>showForkTestWindow:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>crash:</string>
- <string>forkTestGo:</string>
- <string>forkTestOptions:</string>
- <string>generateReportWithoutCrash:</string>
- <string>showForkTestWindow:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBActionInfo">
- <string key="name">crash:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">forkTestGo:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">forkTestOptions:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">generateReportWithoutCrash:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">showForkTestWindow:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- </object>
- <object class="NSMutableDictionary" key="outlets">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>forkTestOptions_</string>
- <string>window_</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>NSWindow</string>
- <string>NSWindow</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="toOneOutletInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>forkTestOptions_</string>
- <string>window_</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBToOneOutletInfo">
- <string key="name">forkTestOptions_</string>
- <string key="candidateClassName">NSWindow</string>
- </object>
- <object class="IBToOneOutletInfo">
- <string key="name">window_</string>
- <string key="candidateClassName">NSWindow</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBProjectSource</string>
- <string key="minorKey">testapp/Controller.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">Controller</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBUserSource</string>
- <string key="minorKey"/>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">FirstResponder</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBUserSource</string>
- <string key="minorKey"/>
- </object>
- </object>
- </object>
- <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBPartialClassDescription">
- <string key="className">NSActionCell</string>
- <string key="superclassName">NSCell</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSActionCell.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSApplication</string>
- <string key="superclassName">NSResponder</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="785325875">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSApplication.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="806686590">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSApplicationScripting.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="301712406">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSColorPanel.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSHelpManager.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSPageLayout.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSApplication</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSUserInterfaceItemSearching.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSBrowser</string>
- <string key="superclassName">NSControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSBrowser.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSButton</string>
- <string key="superclassName">NSControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSButtonCell</string>
- <string key="superclassName">NSActionCell</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSCell</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSCell.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSControl</string>
- <string key="superclassName">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="787388657">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSControl.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSDocument</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>printDocument:</string>
- <string>revertDocumentToSaved:</string>
- <string>runPageLayout:</string>
- <string>saveDocument:</string>
- <string>saveDocumentAs:</string>
- <string>saveDocumentTo:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>printDocument:</string>
- <string>revertDocumentToSaved:</string>
- <string>runPageLayout:</string>
- <string>saveDocument:</string>
- <string>saveDocumentAs:</string>
- <string>saveDocumentTo:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBActionInfo">
- <string key="name">printDocument:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">revertDocumentToSaved:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">runPageLayout:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">saveDocument:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">saveDocumentAs:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">saveDocumentTo:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSDocument.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSDocument</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSDocumentScripting.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSDocumentController</string>
- <string key="superclassName">NSObject</string>
- <object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>clearRecentDocuments:</string>
- <string>newDocument:</string>
- <string>openDocument:</string>
- <string>saveAllDocuments:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
- </object>
- <object class="NSMutableDictionary" key="actionInfosByName">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>clearRecentDocuments:</string>
- <string>newDocument:</string>
- <string>openDocument:</string>
- <string>saveAllDocuments:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBActionInfo">
- <string key="name">clearRecentDocuments:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">newDocument:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">openDocument:</string>
- <string key="candidateClassName">id</string>
- </object>
- <object class="IBActionInfo">
- <string key="name">saveAllDocuments:</string>
- <string key="candidateClassName">id</string>
- </object>
- </object>
- </object>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSDocumentController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSFormatter</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSFormatter.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSMatrix</string>
- <string key="superclassName">NSControl</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSMatrix.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSMenu</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="136824428">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSMenu.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSMenuItem</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="171959132">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSMenuItem.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSMovieView</string>
- <string key="superclassName">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSMovieView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSAccessibility.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="785325875"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="806686590"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="301712406"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="787388657"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSDictionaryController.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSDragging.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSFontManager.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSFontPanel.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSKeyValueBinding.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <reference key="sourceIdentifier" ref="136824428"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSNibLoading.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSOutlineView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSPasteboard.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSSavePanel.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="521965700">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSTableView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSToolbarItem.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier" id="104369095">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSArchiver.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSClassDescription.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSError.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSFileManager.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSKeyValueCoding.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSKeyValueObserving.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSKeyedArchiver.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSObject.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSObjectScripting.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSPortCoder.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSRunLoop.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSScriptClassDescription.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSScriptKeyValueCoding.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSScriptObjectSpecifiers.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSScriptWhoseTests.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSThread.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSURL.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSURLConnection.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">Foundation.framework/Headers/NSURLDownload.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSResponder</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSInterfaceStyle.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSResponder</string>
- <string key="superclassName">NSObject</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSResponder.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSTableView</string>
- <string key="superclassName">NSControl</string>
- <reference key="sourceIdentifier" ref="521965700"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSText</string>
- <string key="superclassName">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSText.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSClipView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSView</string>
- <reference key="sourceIdentifier" ref="171959132"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSView</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSRulerView.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSView</string>
- <string key="superclassName">NSResponder</string>
- <reference key="sourceIdentifier" ref="104369095"/>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSWindow</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSDrawer.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSWindow</string>
- <string key="superclassName">NSResponder</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSWindow.h</string>
- </object>
- </object>
- <object class="IBPartialClassDescription">
- <string key="className">NSWindow</string>
- <object class="IBClassDescriptionSource" key="sourceIdentifier">
- <string key="majorKey">IBFrameworkSource</string>
- <string key="minorKey">AppKit.framework/Headers/NSWindowScripting.h</string>
- </object>
- </object>
- </object>
- </object>
- <int key="IBDocument.localizationMode">0</int>
- <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1050" key="NS.object.0"/>
- </object>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
- <integer value="1050" key="NS.object.0"/>
- </object>
- <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
- <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.InterfaceBuilder3</string>
- <integer value="3000" key="NS.object.0"/>
- </object>
- <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">../../Breakpad.xcodeproj</string>
- <int key="IBDocument.defaultPropertyAccessControl">3</int>
- <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>NSMenuCheckmark</string>
- <string>NSMenuMixedState</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>{9, 8}</string>
- <string>{7, 2}</string>
- </object>
- </object>
- </data>
-</archive>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Info.plist b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Info.plist
deleted file mode 100644
index 6094ec6ce0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/Info.plist
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleExecutable</key>
- <string>${EXECUTABLE_NAME}</string>
- <key>CFBundleIconFile</key>
- <string>bomb</string>
- <key>CFBundleIdentifier</key>
- <string>com.Google.BreakpadTest</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>CFBundleName</key>
- <string>${PRODUCT_NAME}</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>????</string>
- <key>CFBundleVersion</key>
- <string>1.0</string>
- <key>NSMainNibFile</key>
- <string>MainMenu</string>
- <key>NSPrincipalClass</key>
- <string>NSApplication</string>
- <key>BreakpadProductDisplay</key>
- <string>Breakpad Tester</string>
- <key>BreakpadProduct</key>
- <string>Breakpad_Tester</string>
- <key>BreakpadVersion</key>
- <string>1.2.3.4</string>
- <key>BreakpadReportInterval</key>
- <string>10</string>
- <key>BreakpadSkipConfirm</key>
- <string>NO</string>
- <key>BreakpadSendAndExit</key>
- <string>YES</string>
- <key>BreakpadRequestEmail</key>
- <string>YES</string>
- <key>BreakpadRequestComments</key>
- <string>YES</string>
- <key>BreakpadVendor</key>
- <string>Foo Bar Corp, Incorporated, LTD, LLC</string>
- <key>BreakpadServerParameters</key>
- <dict>
- <key>Param1</key>
- <string>Value1</string>
- <key>Param2</key>
- <string>Value2</string>
- </dict>
- <key>LSUIElement</key>
- <string>1</string>
-</dict>
-</plist>
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.h b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.h
deleted file mode 100644
index 0a6d736d17..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import <Cocoa/Cocoa.h>
-
-@interface TestClass : NSObject {
-}
-
-- (void)wait;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm
deleted file mode 100644
index 6e6a8833d5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/TestClass.mm
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <unistd.h>
-
-#import "TestClass.h"
-
-struct AStruct {
- int x;
- float y;
- double z;
-};
-
-class InternalTestClass {
- public:
- InternalTestClass(int a) : a_(a) {}
- ~InternalTestClass() {}
-
- void snooze(float a);
- void snooze(int a);
- int snooze(int a, float b);
-
- protected:
- int a_;
- AStruct s_;
-
- static void InternalFunction(AStruct &s);
- static float kStaticFloatValue;
-};
-
-void InternalTestClass::snooze(float a) {
- InternalFunction(s_);
- sleep(a_ * a);
-}
-
-void InternalTestClass::snooze(int a) {
- InternalFunction(s_);
- sleep(a_ * a);
-}
-
-int InternalTestClass::snooze(int a, float b) {
- InternalFunction(s_);
- sleep(a_ * a * b);
-
- return 33;
-}
-
-void InternalTestClass::InternalFunction(AStruct &s) {
- s.x = InternalTestClass::kStaticFloatValue;
-}
-
-float InternalTestClass::kStaticFloatValue = 42;
-
-static float PlainOldFunction() {
- return 3.14145f;
-}
-
-@implementation TestClass
-
-- (void)wait {
- InternalTestClass t(10);
- float z = PlainOldFunction();
-
- while (1) {
- t.snooze(z);
- }
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/bomb.icns b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/bomb.icns
deleted file mode 100644
index c360dbf618..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/bomb.icns
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashInMain b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashInMain
deleted file mode 100755
index 03bb317276..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashInMain
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashduringload b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashduringload
deleted file mode 100755
index 5ca9debb75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/crashduringload
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/main.m b/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/main.m
deleted file mode 100644
index 1ed19bf961..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/testapp/main.m
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, char *argv[]) {
- return NSApplicationMain(argc, (const char **) argv);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/BreakpadFramework_Test.mm b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/BreakpadFramework_Test.mm
deleted file mode 100644
index 2ea103c694..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/BreakpadFramework_Test.mm
+++ /dev/null
@@ -1,217 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// BreakpadFramework_Test.mm
-// Test case file for Breakpad.h/mm.
-//
-
-#import "GTMSenTestCase.h"
-#import "Breakpad.h"
-
-#include <mach/mach.h>
-
-@interface BreakpadFramework_Test : GTMTestCase {
- @private
- int last_exception_code_;
- int last_exception_type_;
- mach_port_t last_exception_thread_;
- // We're not using Obj-C BOOL because we need to interop with
- // Breakpad's callback.
- bool shouldHandleException_;
-}
-
-// This method is used by a callback used by test cases to determine
-// whether to return true or false to Breakpad when handling an
-// exception.
-- (bool)shouldHandleException;
-// This method returns a minimal dictionary that has what
-// Breakpad needs to initialize.
-- (NSMutableDictionary *)breakpadInitializationDictionary;
-// This method is used by the exception handling callback
-// to communicate to test cases the properites of the last
-// exception.
-- (void)setLastExceptionType:(int)type andCode:(int)code
- andThread:(mach_port_t)thread;
-@end
-
-// Callback for Breakpad exceptions
-bool myBreakpadCallback(int exception_type,
- int exception_code,
- mach_port_t crashing_thread,
- void *context);
-
-bool myBreakpadCallback(int exception_type,
- int exception_code,
- mach_port_t crashing_thread,
- void *context) {
- BreakpadFramework_Test *testCaseClass =
- (BreakpadFramework_Test *)context;
- [testCaseClass setLastExceptionType:exception_type
- andCode:exception_code
- andThread:crashing_thread];
- bool shouldHandleException =
- [testCaseClass shouldHandleException];
- NSLog(@"Callback returning %d", shouldHandleException);
- return shouldHandleException;
-}
-const int kNoLastExceptionCode = -1;
-const int kNoLastExceptionType = -1;
-const mach_port_t kNoLastExceptionThread = MACH_PORT_NULL;
-
-@implementation BreakpadFramework_Test
-- (void) initializeExceptionStateVariables {
- last_exception_code_ = kNoLastExceptionCode;
- last_exception_type_ = kNoLastExceptionType;
- last_exception_thread_ = kNoLastExceptionThread;
-}
-
-- (NSMutableDictionary *)breakpadInitializationDictionary {
- NSMutableDictionary *breakpadParams =
- [NSMutableDictionary dictionaryWithCapacity:3];
-
- [breakpadParams setObject:@"UnitTests" forKey:@BREAKPAD_PRODUCT];
- [breakpadParams setObject:@"1.0" forKey:@BREAKPAD_VERSION];
- [breakpadParams setObject:@"http://staging" forKey:@BREAKPAD_URL];
- return breakpadParams;
-}
-
-- (bool)shouldHandleException {
- return shouldHandleException_;
-}
-
-- (void)setLastExceptionType:(int)type
- andCode:(int)code
- andThread:(mach_port_t)thread {
- last_exception_type_ = type;
- last_exception_code_ = code;
- last_exception_thread_ = thread;
-}
-
-// Test that the parameters mark required actually enable Breakpad to
-// be initialized.
-- (void)testBreakpadInstantiationWithRequiredParameters {
- BreakpadRef b = BreakpadCreate([self breakpadInitializationDictionary]);
- STAssertNotNULL(b, @"BreakpadCreate failed with required parameters");
- BreakpadRelease(b);
-}
-
-// Test that Breakpad fails to initialize cleanly when required
-// parameters are not present.
-- (void)testBreakpadInstantiationWithoutRequiredParameters {
- NSMutableDictionary *breakpadDictionary =
- [self breakpadInitializationDictionary];
-
- // Skip setting version, so that BreakpadCreate fails.
- [breakpadDictionary removeObjectForKey:@BREAKPAD_VERSION];
- BreakpadRef b = BreakpadCreate(breakpadDictionary);
- STAssertNULL(b, @"BreakpadCreate did not fail when missing a required"
- " parameter!");
-
- breakpadDictionary = [self breakpadInitializationDictionary];
- // Now test with no product
- [breakpadDictionary removeObjectForKey:@BREAKPAD_PRODUCT];
- b = BreakpadCreate(breakpadDictionary);
- STAssertNULL(b, @"BreakpadCreate did not fail when missing a required"
- " parameter!");
-
- breakpadDictionary = [self breakpadInitializationDictionary];
- // Now test with no URL
- [breakpadDictionary removeObjectForKey:@BREAKPAD_URL];
- b = BreakpadCreate(breakpadDictionary);
- STAssertNULL(b, @"BreakpadCreate did not fail when missing a required"
- " parameter!");
- BreakpadRelease(b);
-}
-
-// Test to ensure that when we call BreakpadAddUploadParameter,
-// it's added to the dictionary correctly(this test depends on
-// some internal details of Breakpad, namely, the special prefix
-// that it uses to figure out which key/value pairs to upload).
-- (void)testAddingBreakpadServerVariable {
- NSMutableDictionary *breakpadDictionary =
- [self breakpadInitializationDictionary];
-
- BreakpadRef b = BreakpadCreate(breakpadDictionary);
- STAssertNotNULL(b, @"BreakpadCreate failed with valid dictionary!");
-
- BreakpadAddUploadParameter(b,
- @"key",
- @"value");
-
- // Test that it did not add the key/value directly, e.g. without
- // prepending the key with the prefix.
- STAssertNil(BreakpadKeyValue(b, @"key"),
- @"AddUploadParameter added key directly to dictionary"
- " instead of prepending it!");
-
- NSString *prependedKeyname =
- [@BREAKPAD_SERVER_PARAMETER_PREFIX stringByAppendingString:@"key"];
-
- STAssertEqualStrings(BreakpadKeyValue(b, prependedKeyname),
- @"value",
- @"Calling BreakpadAddUploadParameter did not prepend "
- "key name");
- BreakpadRelease(b);
-}
-
-// Test that when we do on-demand minidump generation,
-// the exception code/type/thread are set properly.
-- (void)testFilterCallbackReturnsFalse {
- NSMutableDictionary *breakpadDictionary =
- [self breakpadInitializationDictionary];
-
- BreakpadRef b = BreakpadCreate(breakpadDictionary);
- STAssertNotNULL(b, @"BreakpadCreate failed with valid dictionary!");
- BreakpadSetFilterCallback(b, &myBreakpadCallback, self);
-
- // This causes the callback to return false, meaning
- // Breakpad won't take the exception
- shouldHandleException_ = false;
-
- [self initializeExceptionStateVariables];
- STAssertEquals(last_exception_type_, kNoLastExceptionType,
- @"Last exception type not initialized correctly.");
- STAssertEquals(last_exception_code_, kNoLastExceptionCode,
- @"Last exception code not initialized correctly.");
- STAssertEquals(last_exception_thread_, kNoLastExceptionThread,
- @"Last exception thread is not initialized correctly.");
-
- // Cause Breakpad's exception handler to be invoked.
- BreakpadGenerateAndSendReport(b);
-
- STAssertEquals(last_exception_type_, 0,
- @"Last exception type is not 0 for on demand");
- STAssertEquals(last_exception_code_, 0,
- @"Last exception code is not 0 for on demand");
- STAssertEquals(last_exception_thread_, mach_thread_self(),
- @"Last exception thread is not mach_thread_self() "
- "for on demand");
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc
deleted file mode 100644
index 0164f4a298..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/crash_generation_server_test.cc
+++ /dev/null
@@ -1,398 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// crash_generation_server_test.cc
-// Unit tests for CrashGenerationServer
-
-#include <dirent.h>
-#include <glob.h>
-#include <stdint.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/mac/crash_generation/client_info.h"
-#include "client/mac/crash_generation/crash_generation_client.h"
-#include "client/mac/crash_generation/crash_generation_server.h"
-#include "client/mac/handler/exception_handler.h"
-#include "client/mac/tests/spawn_child_process.h"
-#include "common/tests/auto_tempdir.h"
-#include "google_breakpad/processor/minidump.h"
-
-namespace google_breakpad {
-// This acts as the log sink for INFO logging from the processor
-// logging code. The logging output confuses XCode and makes it think
-// there are unit test failures. testlogging.h handles the overriding.
-std::ostringstream info_log;
-}
-
-namespace {
-using std::string;
-using google_breakpad::AutoTempDir;
-using google_breakpad::ClientInfo;
-using google_breakpad::CrashGenerationClient;
-using google_breakpad::CrashGenerationServer;
-using google_breakpad::ExceptionHandler;
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpContext;
-using google_breakpad::MinidumpException;
-using google_breakpad::MinidumpModule;
-using google_breakpad::MinidumpModuleList;
-using google_breakpad::MinidumpSystemInfo;
-using google_breakpad::MinidumpThread;
-using google_breakpad::MinidumpThreadList;
-using testing::Test;
-using namespace google_breakpad_test;
-
-class CrashGenerationServerTest : public Test {
-public:
- // The port name to receive messages on
- char mach_port_name[128];
- // Filename of the last dump that was generated
- string last_dump_name;
- // PID of the child process
- pid_t child_pid;
- // A temp dir
- AutoTempDir temp_dir;
- // Counter just to ensure that we don't hit the same port again
- static int i;
- bool filter_callback_called;
-
- void SetUp() {
- sprintf(mach_port_name,
- "com.google.breakpad.ServerTest.%d.%d", getpid(),
- CrashGenerationServerTest::i++);
- child_pid = (pid_t)-1;
- filter_callback_called = false;
- }
-};
-int CrashGenerationServerTest::i = 0;
-
-// Test that starting and stopping a server works
-TEST_F(CrashGenerationServerTest, testStartStopServer) {
- CrashGenerationServer server(mach_port_name,
- NULL, // filter callback
- NULL, // filter context
- NULL, // dump callback
- NULL, // dump context
- NULL, // exit callback
- NULL, // exit context
- false, // generate dumps
- ""); // dump path
- ASSERT_TRUE(server.Start());
- ASSERT_TRUE(server.Stop());
-}
-
-// Test that requesting a dump via CrashGenerationClient works
-// Test without actually dumping
-TEST_F(CrashGenerationServerTest, testRequestDumpNoDump) {
- CrashGenerationServer server(mach_port_name,
- NULL, // filter callback
- NULL, // filter context
- NULL, // dump callback
- NULL, // dump context
- NULL, // exit callback
- NULL, // exit context
- false, // don't generate dumps
- temp_dir.path()); // dump path
- ASSERT_TRUE(server.Start());
-
- pid_t pid = fork();
- ASSERT_NE(-1, pid);
- if (pid == 0) {
- CrashGenerationClient client(mach_port_name);
- bool result = client.RequestDump();
- exit(result ? 0 : 1);
- }
-
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_TRUE(WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
- EXPECT_TRUE(server.Stop());
- // check that no minidump was written
- string pattern = temp_dir.path() + "/*";
- glob_t dirContents;
- ret = glob(pattern.c_str(), GLOB_NOSORT, NULL, &dirContents);
- EXPECT_EQ(GLOB_NOMATCH, ret);
- if (ret != GLOB_NOMATCH)
- globfree(&dirContents);
-}
-
-void dumpCallback(void *context, const ClientInfo &client_info,
- const std::string &file_path) {
- if (context) {
- CrashGenerationServerTest* self =
- reinterpret_cast<CrashGenerationServerTest*>(context);
- if (!file_path.empty())
- self->last_dump_name = file_path;
- self->child_pid = client_info.pid();
- }
-}
-
-void *RequestDump(void *context) {
- CrashGenerationClient client((const char*)context);
- bool result = client.RequestDump();
- return (void*)(result ? 0 : 1);
-}
-
-// Test that actually writing a minidump works
-TEST_F(CrashGenerationServerTest, testRequestDump) {
- CrashGenerationServer server(mach_port_name,
- NULL, // filter callback
- NULL, // filter context
- dumpCallback, // dump callback
- this, // dump context
- NULL, // exit callback
- NULL, // exit context
- true, // generate dumps
- temp_dir.path()); // dump path
- ASSERT_TRUE(server.Start());
-
- pid_t pid = fork();
- ASSERT_NE(-1, pid);
- if (pid == 0) {
- // Have to spawn off a separate thread to request the dump,
- // because MinidumpGenerator assumes the handler thread is not
- // the only thread
- pthread_t thread;
- if (pthread_create(&thread, NULL, RequestDump, (void*)mach_port_name) != 0)
- exit(1);
- void* result;
- pthread_join(thread, &result);
- exit(reinterpret_cast<intptr_t>(result));
- }
-
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_TRUE(WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
- EXPECT_TRUE(server.Stop());
- // check that minidump was written
- ASSERT_FALSE(last_dump_name.empty());
- struct stat st;
- EXPECT_EQ(0, stat(last_dump_name.c_str(), &st));
- EXPECT_LT(0, st.st_size);
- // check client's PID
- ASSERT_EQ(pid, child_pid);
-}
-
-static void Crasher() {
- int *a = (int*)0x42;
-
- fprintf(stdout, "Going to crash...\n");
- fprintf(stdout, "A = %d", *a);
-}
-
-// Test that crashing a child process with an OOP ExceptionHandler installed
-// results in a minidump being written by the CrashGenerationServer in
-// the parent.
-TEST_F(CrashGenerationServerTest, testChildProcessCrash) {
- CrashGenerationServer server(mach_port_name,
- NULL, // filter callback
- NULL, // filter context
- dumpCallback, // dump callback
- this, // dump context
- NULL, // exit callback
- NULL, // exit context
- true, // generate dumps
- temp_dir.path()); // dump path
- ASSERT_TRUE(server.Start());
-
- pid_t pid = fork();
- ASSERT_NE(-1, pid);
- if (pid == 0) {
- // Instantiate an OOP exception handler.
- ExceptionHandler eh("", NULL, NULL, NULL, true, mach_port_name);
- Crasher();
- // not reached
- exit(0);
- }
-
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_FALSE(WIFEXITED(ret));
- EXPECT_TRUE(server.Stop());
- // check that minidump was written
- ASSERT_FALSE(last_dump_name.empty());
- struct stat st;
- EXPECT_EQ(0, stat(last_dump_name.c_str(), &st));
- EXPECT_LT(0, st.st_size);
-
- // Read the minidump, sanity check some data.
- Minidump minidump(last_dump_name.c_str());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpSystemInfo* system_info = minidump.GetSystemInfo();
- ASSERT_TRUE(system_info);
- const MDRawSystemInfo* raw_info = system_info->system_info();
- ASSERT_TRUE(raw_info);
- EXPECT_EQ(kNativeArchitecture, raw_info->processor_architecture);
-
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list);
- ASSERT_EQ((unsigned int)1, thread_list->thread_count());
-
- MinidumpThread* main_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(main_thread);
- MinidumpContext* context = main_thread->GetContext();
- ASSERT_TRUE(context);
- EXPECT_EQ(kNativeContext, context->GetContextCPU());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* main_module = module_list->GetMainModule();
- ASSERT_TRUE(main_module);
- EXPECT_EQ(GetExecutablePath(), main_module->code_file());
-}
-
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) && \
- (defined(__x86_64__) || defined(__i386__))
-// Test that crashing a child process of a different architecture
-// produces a valid minidump.
-TEST_F(CrashGenerationServerTest, testChildProcessCrashCrossArchitecture) {
- CrashGenerationServer server(mach_port_name,
- NULL, // filter callback
- NULL, // filter context
- dumpCallback, // dump callback
- this, // dump context
- NULL, // exit callback
- NULL, // exit context
- true, // generate dumps
- temp_dir.path()); // dump path
- ASSERT_TRUE(server.Start());
-
- // Spawn a child process
- string helper_path = GetHelperPath();
- const char* argv[] = {
- helper_path.c_str(),
- "crash",
- mach_port_name,
- NULL
- };
- pid_t pid = spawn_child_process(argv);
- ASSERT_NE(-1, pid);
-
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_FALSE(WIFEXITED(ret));
- EXPECT_TRUE(server.Stop());
- // check that minidump was written
- ASSERT_FALSE(last_dump_name.empty());
- struct stat st;
- EXPECT_EQ(0, stat(last_dump_name.c_str(), &st));
- EXPECT_LT(0, st.st_size);
-
-const MDCPUArchitecture kExpectedArchitecture =
-#if defined(__x86_64__)
- MD_CPU_ARCHITECTURE_X86
-#elif defined(__i386__)
- MD_CPU_ARCHITECTURE_AMD64
-#endif
- ;
-const uint32_t kExpectedContext =
-#if defined(__i386__)
- MD_CONTEXT_AMD64
-#elif defined(__x86_64__)
- MD_CONTEXT_X86
-#endif
- ;
-
- // Read the minidump, sanity check some data.
- Minidump minidump(last_dump_name.c_str());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpSystemInfo* system_info = minidump.GetSystemInfo();
- ASSERT_TRUE(system_info);
- const MDRawSystemInfo* raw_info = system_info->system_info();
- ASSERT_TRUE(raw_info);
- EXPECT_EQ(kExpectedArchitecture, raw_info->processor_architecture);
-
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list);
- ASSERT_EQ((unsigned int)1, thread_list->thread_count());
-
- MinidumpThread* main_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(main_thread);
- MinidumpContext* context = main_thread->GetContext();
- ASSERT_TRUE(context);
- EXPECT_EQ(kExpectedContext, context->GetContextCPU());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* main_module = module_list->GetMainModule();
- ASSERT_TRUE(main_module);
- EXPECT_EQ(helper_path, main_module->code_file());
-}
-#endif
-
-bool filter_callback(void* context) {
- CrashGenerationServerTest* self =
- reinterpret_cast<CrashGenerationServerTest*>(context);
- self->filter_callback_called = true;
- // veto dump generation
- return false;
-}
-
-// Test that a filter callback can veto minidump writing.
-TEST_F(CrashGenerationServerTest, testFilter) {
- CrashGenerationServer server(mach_port_name,
- filter_callback, // filter callback
- this, // filter context
- dumpCallback, // dump callback
- this, // dump context
- NULL, // exit callback
- NULL, // exit context
- true, // generate dumps
- temp_dir.path()); // dump path
- ASSERT_TRUE(server.Start());
-
- pid_t pid = fork();
- ASSERT_NE(-1, pid);
- if (pid == 0) {
- // Instantiate an OOP exception handler.
- ExceptionHandler eh("", NULL, NULL, NULL, true, mach_port_name);
- Crasher();
- // not reached
- exit(0);
- }
-
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_FALSE(WIFEXITED(ret));
- EXPECT_TRUE(server.Stop());
-
- // check that no minidump was written
- EXPECT_TRUE(last_dump_name.empty());
- EXPECT_TRUE(filter_callback_called);
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc
deleted file mode 100644
index a8cf6968c8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/exception_handler_test.cc
+++ /dev/null
@@ -1,713 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exception_handler_test.cc: Unit tests for google_breakpad::ExceptionHandler
-
-#include <pthread.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "breakpad_googletest_includes.h"
-#include "client/mac/handler/exception_handler.h"
-#include "common/mac/MachIPC.h"
-#include "common/tests/auto_tempdir.h"
-#include "google_breakpad/processor/minidump.h"
-
-namespace google_breakpad {
-// This acts as the log sink for INFO logging from the processor
-// logging code. The logging output confuses XCode and makes it think
-// there are unit test failures. testlogging.h handles the overriding.
-std::ostringstream info_log;
-}
-
-namespace {
-using std::string;
-using google_breakpad::AutoTempDir;
-using google_breakpad::ExceptionHandler;
-using google_breakpad::MachPortSender;
-using google_breakpad::MachReceiveMessage;
-using google_breakpad::MachSendMessage;
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpContext;
-using google_breakpad::MinidumpException;
-using google_breakpad::MinidumpMemoryList;
-using google_breakpad::MinidumpMemoryRegion;
-using google_breakpad::ReceivePort;
-using testing::Test;
-
-class ExceptionHandlerTest : public Test {
- public:
- void InProcessCrash(bool aborting);
- AutoTempDir tempDir;
- string lastDumpName;
-};
-
-static void Crasher() {
- int *a = (int*)0x42;
-
- fprintf(stdout, "Going to crash...\n");
- fprintf(stdout, "A = %d", *a);
-}
-
-static void AbortCrasher() {
- fprintf(stdout, "Going to crash...\n");
- abort();
-}
-
-static void SoonToCrash(void(*crasher)()) {
- crasher();
-}
-
-static bool MDCallback(const char *dump_dir, const char *file_name,
- void *context, bool success) {
- string path(dump_dir);
- path.append("/");
- path.append(file_name);
- path.append(".dmp");
-
- int fd = *reinterpret_cast<int*>(context);
- (void)write(fd, path.c_str(), path.length() + 1);
- close(fd);
- exit(0);
- // not reached
- return true;
-}
-
-void ExceptionHandlerTest::InProcessCrash(bool aborting) {
- // Give the child process a pipe to report back on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
- // Fork off a child process so it can crash.
- pid_t pid = fork();
- if (pid == 0) {
- // In the child process.
- close(fds[0]);
- ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
- // crash
- SoonToCrash(aborting ? &AbortCrasher : &Crasher);
- // not reached
- exit(1);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- // Wait for the background process to return the minidump file.
- close(fds[1]);
- char minidump_file[PATH_MAX];
- ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file));
- ASSERT_NE(0, nbytes);
-
- Minidump minidump(minidump_file);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- ASSERT_TRUE(exception);
-
- const MDRawExceptionStream* raw_exception = exception->exception();
- ASSERT_TRUE(raw_exception);
-
- if (aborting) {
- EXPECT_EQ(MD_EXCEPTION_MAC_SOFTWARE,
- raw_exception->exception_record.exception_code);
- EXPECT_EQ(MD_EXCEPTION_CODE_MAC_ABORT,
- raw_exception->exception_record.exception_flags);
- } else {
- EXPECT_EQ(MD_EXCEPTION_MAC_BAD_ACCESS,
- raw_exception->exception_record.exception_code);
-#if defined(__x86_64__)
- EXPECT_EQ(MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS,
- raw_exception->exception_record.exception_flags);
-#elif defined(__i386__)
- EXPECT_EQ(MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE,
- raw_exception->exception_record.exception_flags);
-#endif
- }
-
- const MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- // Ideally would like to sanity check that abort() is on the stack
- // but that's hard.
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(memory_list);
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- EXPECT_TRUE(region);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-}
-
-TEST_F(ExceptionHandlerTest, InProcess) {
- InProcessCrash(false);
-}
-
-TEST_F(ExceptionHandlerTest, InProcessAbort) {
- InProcessCrash(true);
-}
-
-static bool DumpNameMDCallback(const char *dump_dir, const char *file_name,
- void *context, bool success) {
- ExceptionHandlerTest *self = reinterpret_cast<ExceptionHandlerTest*>(context);
- if (dump_dir && file_name) {
- self->lastDumpName = dump_dir;
- self->lastDumpName += "/";
- self->lastDumpName += file_name;
- self->lastDumpName += ".dmp";
- }
- return true;
-}
-
-TEST_F(ExceptionHandlerTest, WriteMinidump) {
- ExceptionHandler eh(tempDir.path(), NULL, DumpNameMDCallback, this, true,
- NULL);
- ASSERT_TRUE(eh.WriteMinidump());
-
- // Ensure that minidump file exists and is > 0 bytes.
- ASSERT_FALSE(lastDumpName.empty());
- struct stat st;
- ASSERT_EQ(0, stat(lastDumpName.c_str(), &st));
- ASSERT_LT(0, st.st_size);
-
- // The minidump should not contain an exception stream.
- Minidump minidump(lastDumpName);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- EXPECT_FALSE(exception);
-}
-
-TEST_F(ExceptionHandlerTest, WriteMinidumpWithException) {
- ExceptionHandler eh(tempDir.path(), NULL, DumpNameMDCallback, this, true,
- NULL);
- ASSERT_TRUE(eh.WriteMinidump(true));
-
- // Ensure that minidump file exists and is > 0 bytes.
- ASSERT_FALSE(lastDumpName.empty());
- struct stat st;
- ASSERT_EQ(0, stat(lastDumpName.c_str(), &st));
- ASSERT_LT(0, st.st_size);
-
- // The minidump should contain an exception stream.
- Minidump minidump(lastDumpName);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- ASSERT_TRUE(exception);
- const MDRawExceptionStream* raw_exception = exception->exception();
- ASSERT_TRUE(raw_exception);
-
- EXPECT_EQ(MD_EXCEPTION_MAC_BREAKPOINT,
- raw_exception->exception_record.exception_code);
-}
-
-TEST_F(ExceptionHandlerTest, DumpChildProcess) {
- const int kTimeoutMs = 2000;
- // Create a mach port to receive the child task on.
- char machPortName[128];
- sprintf(machPortName, "ExceptionHandlerTest.%d", getpid());
- ReceivePort parent_recv_port(machPortName);
-
- // Give the child process a pipe to block on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- // Fork off a child process to dump.
- pid_t pid = fork();
- if (pid == 0) {
- // In the child process
- close(fds[1]);
-
- // Send parent process the task and thread ports.
- MachSendMessage child_message(0);
- child_message.AddDescriptor(mach_task_self());
- child_message.AddDescriptor(mach_thread_self());
-
- MachPortSender child_sender(machPortName);
- if (child_sender.SendMessage(child_message, kTimeoutMs) != KERN_SUCCESS)
- exit(1);
-
- // Wait for the parent process.
- uint8_t data;
- read(fds[0], &data, 1);
- exit(0);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[0]);
-
- // Read the child's task and thread ports.
- MachReceiveMessage child_message;
- ASSERT_EQ(KERN_SUCCESS,
- parent_recv_port.WaitForMessage(&child_message, kTimeoutMs));
- mach_port_t child_task = child_message.GetTranslatedPort(0);
- mach_port_t child_thread = child_message.GetTranslatedPort(1);
- ASSERT_NE((mach_port_t)MACH_PORT_NULL, child_task);
- ASSERT_NE((mach_port_t)MACH_PORT_NULL, child_thread);
-
- // Write a minidump of the child process.
- bool result = ExceptionHandler::WriteMinidumpForChild(child_task,
- child_thread,
- tempDir.path(),
- DumpNameMDCallback,
- this);
- ASSERT_EQ(true, result);
-
- // Ensure that minidump file exists and is > 0 bytes.
- ASSERT_FALSE(lastDumpName.empty());
- struct stat st;
- ASSERT_EQ(0, stat(lastDumpName.c_str(), &st));
- ASSERT_LT(0, st.st_size);
-
- // Unblock child process
- uint8_t data = 1;
- (void)write(fds[1], &data, 1);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-}
-
-// Test that memory around the instruction pointer is written
-// to the dump as a MinidumpMemoryRegion.
-TEST_F(ExceptionHandlerTest, InstructionPointerMemory) {
- // Give the child process a pipe to report back on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t kMemorySize = 256; // bytes
- const int kOffset = kMemorySize / 2;
- // This crashes with SIGILL on x86/x86-64/arm.
- const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
-
- pid_t pid = fork();
- if (pid == 0) {
- close(fds[0]);
- ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
- // Get some executable memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- if (!memory)
- exit(0);
-
- // Write some instructions that will crash. Put them in the middle
- // of the block of memory, because the minidump should contain 128
- // bytes on either side of the instruction pointer.
- memcpy(memory + kOffset, instructions, sizeof(instructions));
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- memory_function();
- // not reached
- exit(1);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[1]);
-
- // Wait for the background process to return the minidump file.
- close(fds[1]);
- char minidump_file[PATH_MAX];
- ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file));
- ASSERT_NE(0, nbytes);
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(minidump_file, &st));
- ASSERT_LT(0, st.st_size);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- Minidump minidump(minidump_file);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_NE((unsigned int)0, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- EXPECT_TRUE(region);
-
- EXPECT_EQ(kMemorySize, region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t prefix_bytes[kOffset];
- uint8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)];
- memset(prefix_bytes, 0, sizeof(prefix_bytes));
- memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset, instructions, sizeof(instructions)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(instructions),
- suffix_bytes, sizeof(suffix_bytes)) == 0);
-}
-
-// Test that the memory region around the instruction pointer is
-// bounded correctly on the low end.
-TEST_F(ExceptionHandlerTest, InstructionPointerMemoryMinBound) {
- // Give the child process a pipe to report back on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- const uint32_t kMemorySize = 256; // bytes
- const int kOffset = 0;
- // This crashes with SIGILL on x86/x86-64/arm.
- const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
-
- pid_t pid = fork();
- if (pid == 0) {
- close(fds[0]);
- ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
- // Get some executable memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- if (!memory)
- exit(0);
-
- // Write some instructions that will crash. Put them at the start
- // of the block of memory, to ensure that the memory bounding
- // works properly.
- memcpy(memory + kOffset, instructions, sizeof(instructions));
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- memory_function();
- // not reached
- exit(1);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[1]);
-
- // Wait for the background process to return the minidump file.
- close(fds[1]);
- char minidump_file[PATH_MAX];
- ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file));
- ASSERT_NE(0, nbytes);
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(minidump_file, &st));
- ASSERT_LT(0, st.st_size);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- Minidump minidump(minidump_file);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_NE((unsigned int)0, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- EXPECT_TRUE(region);
-
- EXPECT_EQ(kMemorySize / 2, region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t suffix_bytes[kMemorySize / 2 - sizeof(instructions)];
- memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_TRUE(memcmp(bytes + kOffset, instructions, sizeof(instructions)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(instructions),
- suffix_bytes, sizeof(suffix_bytes)) == 0);
-}
-
-// Test that the memory region around the instruction pointer is
-// bounded correctly on the high end.
-TEST_F(ExceptionHandlerTest, InstructionPointerMemoryMaxBound) {
- // Give the child process a pipe to report back on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- // These are defined here so the parent can use them to check the
- // data from the minidump afterwards.
- // Use 4k here because the OS will hand out a single page even
- // if a smaller size is requested, and this test wants to
- // test the upper bound of the memory range.
- const uint32_t kMemorySize = 4096; // bytes
- // This crashes with SIGILL on x86/x86-64/arm.
- const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
- const int kOffset = kMemorySize - sizeof(instructions);
-
- pid_t pid = fork();
- if (pid == 0) {
- close(fds[0]);
- ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
- // Get some executable memory.
- char* memory =
- reinterpret_cast<char*>(mmap(NULL,
- kMemorySize,
- PROT_READ | PROT_WRITE | PROT_EXEC,
- MAP_PRIVATE | MAP_ANON,
- -1,
- 0));
- if (!memory)
- exit(0);
-
- // Write some instructions that will crash. Put them at the start
- // of the block of memory, to ensure that the memory bounding
- // works properly.
- memcpy(memory + kOffset, instructions, sizeof(instructions));
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- memory_function();
- // not reached
- exit(1);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[1]);
-
- // Wait for the background process to return the minidump file.
- close(fds[1]);
- char minidump_file[PATH_MAX];
- ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file));
- ASSERT_NE(0, nbytes);
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(minidump_file, &st));
- ASSERT_LT(0, st.st_size);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- Minidump minidump(minidump_file);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_NE((unsigned int)0, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- EXPECT_TRUE(region);
-
- const size_t kPrefixSize = 128; // bytes
- EXPECT_EQ(kPrefixSize + sizeof(instructions), region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t prefix_bytes[kPrefixSize];
- memset(prefix_bytes, 0, sizeof(prefix_bytes));
- EXPECT_TRUE(memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)) == 0);
- EXPECT_TRUE(memcmp(bytes + kPrefixSize,
- instructions, sizeof(instructions)) == 0);
-}
-
-// Ensure that an extra memory block doesn't get added when the
-// instruction pointer is not in mapped memory.
-TEST_F(ExceptionHandlerTest, InstructionPointerMemoryNullPointer) {
- // Give the child process a pipe to report back on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- pid_t pid = fork();
- if (pid == 0) {
- close(fds[0]);
- ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
- // Try calling a NULL pointer.
- typedef void (*void_function)(void);
- // Volatile markings are needed to keep Clang from generating invalid
- // opcodes. See http://crbug.com/498354 for details.
- volatile void_function memory_function =
- reinterpret_cast<void_function>(NULL);
- memory_function();
- // not reached
- exit(1);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[1]);
-
- // Wait for the background process to return the minidump file.
- close(fds[1]);
- char minidump_file[PATH_MAX];
- ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file));
- ASSERT_NE(0, nbytes);
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(minidump_file, &st));
- ASSERT_LT(0, st.st_size);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is only one memory region
- // in the memory list (the thread memory from the single thread).
- Minidump minidump(minidump_file);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_EQ((unsigned int)1, memory_list->region_count());
-}
-
-static void *Junk(void *) {
- sleep(1000000);
- return NULL;
-}
-
-// Test that the memory list gets written correctly when multiple
-// threads are running.
-TEST_F(ExceptionHandlerTest, MemoryListMultipleThreads) {
- // Give the child process a pipe to report back on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- pid_t pid = fork();
- if (pid == 0) {
- close(fds[0]);
- ExceptionHandler eh(tempDir.path(), NULL, MDCallback, &fds[1], true, NULL);
-
- // Run an extra thread so >2 memory regions will be written.
- pthread_t junk_thread;
- if (pthread_create(&junk_thread, NULL, Junk, NULL) == 0)
- pthread_detach(junk_thread);
-
- // Just crash.
- Crasher();
-
- // not reached
- exit(1);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[1]);
-
- // Wait for the background process to return the minidump file.
- close(fds[1]);
- char minidump_file[PATH_MAX];
- ssize_t nbytes = read(fds[0], minidump_file, sizeof(minidump_file));
- ASSERT_NE(0, nbytes);
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(minidump_file, &st));
- ASSERT_LT(0, st.st_size);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-
- // Read the minidump, and verify that the memory list can be read.
- Minidump minidump(minidump_file);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(memory_list);
- // Verify that there are three memory regions:
- // one per thread, and one for the instruction pointer memory.
- ASSERT_EQ((unsigned int)3, memory_list->region_count());
-}
-
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test.cc
deleted file mode 100644
index d40c7d986a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test.cc
+++ /dev/null
@@ -1,319 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_generator_test.cc: Unit tests for google_breakpad::MinidumpGenerator
-
-#include <AvailabilityMacros.h>
-#ifndef MAC_OS_X_VERSION_10_6
-#define MAC_OS_X_VERSION_10_6 1060
-#endif
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "client/mac/handler/minidump_generator.h"
-#include "client/mac/tests/spawn_child_process.h"
-#include "common/mac/MachIPC.h"
-#include "common/tests/auto_tempdir.h"
-#include "google_breakpad/processor/minidump.h"
-
-namespace google_breakpad {
-// This acts as the log sink for INFO logging from the processor
-// logging code. The logging output confuses XCode and makes it think
-// there are unit test failures. testlogging.h handles the overriding.
-std::ostringstream info_log;
-}
-
-namespace {
-using std::string;
-using std::vector;
-using google_breakpad::AutoTempDir;
-using google_breakpad::MinidumpGenerator;
-using google_breakpad::MachPortSender;
-using google_breakpad::MachReceiveMessage;
-using google_breakpad::MachSendMessage;
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpContext;
-using google_breakpad::MinidumpException;
-using google_breakpad::MinidumpModule;
-using google_breakpad::MinidumpModuleList;
-using google_breakpad::MinidumpSystemInfo;
-using google_breakpad::MinidumpThread;
-using google_breakpad::MinidumpThreadList;
-using google_breakpad::ReceivePort;
-using testing::Test;
-using namespace google_breakpad_test;
-
-class MinidumpGeneratorTest : public Test {
- public:
- AutoTempDir tempDir;
-};
-
-static void *Junk(void* data) {
- bool* wait = reinterpret_cast<bool*>(data);
- while (!*wait) {
- usleep(10000);
- }
- return NULL;
-}
-
-TEST_F(MinidumpGeneratorTest, InProcess) {
- MinidumpGenerator generator;
- string dump_filename =
- MinidumpGenerator::UniqueNameInDirectory(tempDir.path(), NULL);
-
- // Run an extra thread since MinidumpGenerator assumes there
- // are 2 or more threads.
- pthread_t junk_thread;
- bool quit = false;
- ASSERT_EQ(0, pthread_create(&junk_thread, NULL, Junk, &quit));
-
- ASSERT_TRUE(generator.Write(dump_filename.c_str()));
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(dump_filename.c_str(), &st));
- ASSERT_LT(0, st.st_size);
-
- // join the background thread
- quit = true;
- pthread_join(junk_thread, NULL);
-
- // Read the minidump, sanity check some data.
- Minidump minidump(dump_filename.c_str());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpSystemInfo* system_info = minidump.GetSystemInfo();
- ASSERT_TRUE(system_info);
- const MDRawSystemInfo* raw_info = system_info->system_info();
- ASSERT_TRUE(raw_info);
- EXPECT_EQ(kNativeArchitecture, raw_info->processor_architecture);
-
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list);
- ASSERT_EQ((unsigned int)1, thread_list->thread_count());
-
- MinidumpThread* main_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(main_thread);
- MinidumpContext* context = main_thread->GetContext();
- ASSERT_TRUE(context);
- EXPECT_EQ(kNativeContext, context->GetContextCPU());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* main_module = module_list->GetMainModule();
- ASSERT_TRUE(main_module);
- EXPECT_EQ(GetExecutablePath(), main_module->code_file());
-}
-
-TEST_F(MinidumpGeneratorTest, OutOfProcess) {
- const int kTimeoutMs = 2000;
- // Create a mach port to receive the child task on.
- char machPortName[128];
- sprintf(machPortName, "MinidumpGeneratorTest.OutOfProcess.%d", getpid());
- ReceivePort parent_recv_port(machPortName);
-
- // Give the child process a pipe to block on.
- int fds[2];
- ASSERT_EQ(0, pipe(fds));
-
- // Fork off a child process to dump.
- pid_t pid = fork();
- if (pid == 0) {
- // In the child process
- close(fds[1]);
-
- // Send parent process the task port.
- MachSendMessage child_message(0);
- child_message.AddDescriptor(mach_task_self());
-
- MachPortSender child_sender(machPortName);
- if (child_sender.SendMessage(child_message, kTimeoutMs) != KERN_SUCCESS) {
- fprintf(stderr, "Error sending message from child process!\n");
- exit(1);
- }
-
- // Wait for the parent process.
- uint8_t data;
- read(fds[0], &data, 1);
- exit(0);
- }
- // In the parent process.
- ASSERT_NE(-1, pid);
- close(fds[0]);
-
- // Read the child's task port.
- MachReceiveMessage child_message;
- ASSERT_EQ(KERN_SUCCESS,
- parent_recv_port.WaitForMessage(&child_message, kTimeoutMs));
- mach_port_t child_task = child_message.GetTranslatedPort(0);
- ASSERT_NE((mach_port_t)MACH_PORT_NULL, child_task);
-
- // Write a minidump of the child process.
- MinidumpGenerator generator(child_task, MACH_PORT_NULL);
- string dump_filename =
- MinidumpGenerator::UniqueNameInDirectory(tempDir.path(), NULL);
- ASSERT_TRUE(generator.Write(dump_filename.c_str()));
-
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(dump_filename.c_str(), &st));
- ASSERT_LT(0, st.st_size);
-
- // Unblock child process
- uint8_t data = 1;
- (void)write(fds[1], &data, 1);
-
- // Child process should have exited with a zero status.
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
- EXPECT_NE(0, WIFEXITED(ret));
- EXPECT_EQ(0, WEXITSTATUS(ret));
-
- // Read the minidump, sanity check some data.
- Minidump minidump(dump_filename.c_str());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpSystemInfo* system_info = minidump.GetSystemInfo();
- ASSERT_TRUE(system_info);
- const MDRawSystemInfo* raw_info = system_info->system_info();
- ASSERT_TRUE(raw_info);
- EXPECT_EQ(kNativeArchitecture, raw_info->processor_architecture);
-
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list);
- ASSERT_EQ((unsigned int)1, thread_list->thread_count());
-
- MinidumpThread* main_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(main_thread);
- MinidumpContext* context = main_thread->GetContext();
- ASSERT_TRUE(context);
- EXPECT_EQ(kNativeContext, context->GetContextCPU());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* main_module = module_list->GetMainModule();
- ASSERT_TRUE(main_module);
- EXPECT_EQ(GetExecutablePath(), main_module->code_file());
-}
-
-// This test fails on 10.5, but I don't have easy access to a 10.5 machine,
-// so it's simpler to just limit it to 10.6 for now.
-#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) && \
- (defined(__x86_64__) || defined(__i386__))
-
-TEST_F(MinidumpGeneratorTest, CrossArchitectureDump) {
- const int kTimeoutMs = 5000;
- // Create a mach port to receive the child task on.
- char machPortName[128];
- sprintf(machPortName,
- "MinidumpGeneratorTest.CrossArchitectureDump.%d", getpid());
-
- ReceivePort parent_recv_port(machPortName);
-
- // Spawn a child process to dump.
- string helper_path = GetHelperPath();
- const char* argv[] = {
- helper_path.c_str(),
- machPortName,
- NULL
- };
- pid_t pid = spawn_child_process(argv);
- ASSERT_NE(-1, pid);
-
- // Read the child's task port.
- MachReceiveMessage child_message;
- ASSERT_EQ(KERN_SUCCESS,
- parent_recv_port.WaitForMessage(&child_message, kTimeoutMs));
- mach_port_t child_task = child_message.GetTranslatedPort(0);
- ASSERT_NE((mach_port_t)MACH_PORT_NULL, child_task);
-
- // Write a minidump of the child process.
- MinidumpGenerator generator(child_task, MACH_PORT_NULL);
- string dump_filename =
- MinidumpGenerator::UniqueNameInDirectory(tempDir.path(), NULL);
- ASSERT_TRUE(generator.Write(dump_filename.c_str()));
-
- // Ensure that minidump file exists and is > 0 bytes.
- struct stat st;
- ASSERT_EQ(0, stat(dump_filename.c_str(), &st));
- ASSERT_LT(0, st.st_size);
-
- // Kill child process.
- kill(pid, SIGKILL);
-
- int ret;
- ASSERT_EQ(pid, waitpid(pid, &ret, 0));
-
-const MDCPUArchitecture kExpectedArchitecture =
-#if defined(__x86_64__)
- MD_CPU_ARCHITECTURE_X86
-#elif defined(__i386__)
- MD_CPU_ARCHITECTURE_AMD64
-#endif
- ;
-const uint32_t kExpectedContext =
-#if defined(__i386__)
- MD_CONTEXT_AMD64
-#elif defined(__x86_64__)
- MD_CONTEXT_X86
-#endif
- ;
-
- // Read the minidump, sanity check some data.
- Minidump minidump(dump_filename.c_str());
- ASSERT_TRUE(minidump.Read());
-
- MinidumpSystemInfo* system_info = minidump.GetSystemInfo();
- ASSERT_TRUE(system_info);
- const MDRawSystemInfo* raw_info = system_info->system_info();
- ASSERT_TRUE(raw_info);
- EXPECT_EQ(kExpectedArchitecture, raw_info->processor_architecture);
-
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list);
- ASSERT_EQ((unsigned int)1, thread_list->thread_count());
-
- MinidumpThread* main_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(main_thread);
- MinidumpContext* context = main_thread->GetContext();
- ASSERT_TRUE(context);
- EXPECT_EQ(kExpectedContext, context->GetContextCPU());
-
- MinidumpModuleList* module_list = minidump.GetModuleList();
- ASSERT_TRUE(module_list);
- const MinidumpModule* main_module = module_list->GetMainModule();
- ASSERT_TRUE(main_module);
- EXPECT_EQ(helper_path, main_module->code_file());
-}
-#endif // 10.6 && (x86-64 || i386)
-
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test_helper.cc b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test_helper.cc
deleted file mode 100644
index 4e8ce3cf00..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/minidump_generator_test_helper.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_generator_test_helper.cc: A helper program that
-// minidump_generator_test.cc can launch to test certain things
-// that require a separate executable.
-
-#include <unistd.h>
-
-#include "client/mac/handler/exception_handler.h"
-#include "common/mac/MachIPC.h"
-
-using google_breakpad::MachPortSender;
-using google_breakpad::MachReceiveMessage;
-using google_breakpad::MachSendMessage;
-using google_breakpad::ReceivePort;
-
-int main(int argc, char** argv) {
- if (argc < 2)
- return 1;
-
- if (strcmp(argv[1], "crash") != 0) {
- const int kTimeoutMs = 2000;
- // Send parent process the task and thread ports.
- MachSendMessage child_message(0);
- child_message.AddDescriptor(mach_task_self());
- child_message.AddDescriptor(mach_thread_self());
-
- MachPortSender child_sender(argv[1]);
- if (child_sender.SendMessage(child_message, kTimeoutMs) != KERN_SUCCESS) {
- fprintf(stderr, "Error sending message from child process!\n");
- exit(1);
- }
-
- // Loop forever.
- while (true) {
- sleep(100);
- }
- } else if (argc == 3 && strcmp(argv[1], "crash") == 0) {
- // Instantiate an OOP exception handler
- google_breakpad::ExceptionHandler eh("", NULL, NULL, NULL, true, argv[2]);
- // and crash.
- int *a = (int*)0x42;
- *a = 1;
- }
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/spawn_child_process.h b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/spawn_child_process.h
deleted file mode 100644
index e52ff6b659..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/spawn_child_process.h
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utility functions for spawning a helper process using a different
-// CPU architecture.
-
-#ifndef GOOGLE_BREAKPAD_CLIENT_MAC_TESTS_SPAWN_CHILD_PROCESS
-#define GOOGLE_BREAKPAD_CLIENT_MAC_TESTS_SPAWN_CHILD_PROCESS
-
-#include <AvailabilityMacros.h>
-#ifndef MAC_OS_X_VERSION_10_6
-#define MAC_OS_X_VERSION_10_6 1060
-#endif
-#include <crt_externs.h>
-#include <mach-o/dyld.h>
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
-#include <spawn.h>
-#endif
-
-#include <string>
-#include <vector>
-
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad_test {
-
-using std::string;
-using std::vector;
-
-const MDCPUArchitecture kNativeArchitecture =
-#if defined(__i386__)
- MD_CPU_ARCHITECTURE_X86
-#elif defined(__x86_64__)
- MD_CPU_ARCHITECTURE_AMD64
-#elif defined(__ppc__) || defined(__ppc64__)
- MD_CPU_ARCHITECTURE_PPC
-#else
-#error "This file has not been ported to this CPU architecture."
-#endif
- ;
-
-const uint32_t kNativeContext =
-#if defined(__i386__)
- MD_CONTEXT_X86
-#elif defined(__x86_64__)
- MD_CONTEXT_AMD64
-#elif defined(__ppc__) || defined(__ppc64__)
- MD_CONTEXT_PPC
-#else
-#error "This file has not been ported to this CPU architecture."
-#endif
- ;
-
-string GetExecutablePath() {
- char self_path[PATH_MAX];
- uint32_t size = sizeof(self_path);
- if (_NSGetExecutablePath(self_path, &size) != 0)
- return "";
- return self_path;
-}
-
-string GetHelperPath() {
- string helper_path(GetExecutablePath());
- size_t pos = helper_path.rfind('/');
- if (pos == string::npos)
- return "";
-
- helper_path.erase(pos + 1);
- helper_path += "minidump_generator_test_helper";
- return helper_path;
-}
-
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6
-
-pid_t spawn_child_process(const char** argv) {
- posix_spawnattr_t spawnattr;
- if (posix_spawnattr_init(&spawnattr) != 0)
- return (pid_t)-1;
-
- cpu_type_t pref_cpu_types[2] = {
-#if defined(__x86_64__)
- CPU_TYPE_X86,
-#elif defined(__i386__)
- CPU_TYPE_X86_64,
-#endif
- CPU_TYPE_ANY
- };
-
- // Set spawn attributes.
- size_t attr_count = sizeof(pref_cpu_types) / sizeof(pref_cpu_types[0]);
- size_t attr_ocount = 0;
- if (posix_spawnattr_setbinpref_np(&spawnattr,
- attr_count,
- pref_cpu_types,
- &attr_ocount) != 0 ||
- attr_ocount != attr_count) {
- posix_spawnattr_destroy(&spawnattr);
- return (pid_t)-1;
- }
-
- // Create an argv array.
- vector<char*> argv_v;
- while (*argv) {
- argv_v.push_back(strdup(*argv));
- argv++;
- }
- argv_v.push_back(NULL);
- pid_t new_pid = 0;
- int result = posix_spawnp(&new_pid, argv_v[0], NULL, &spawnattr,
- &argv_v[0], *_NSGetEnviron());
- posix_spawnattr_destroy(&spawnattr);
-
- for (unsigned i = 0; i < argv_v.size(); i++) {
- free(argv_v[i]);
- }
-
- return result == 0 ? new_pid : -1;
-}
-#endif
-
-} // namespace google_breakpad_test
-
-#endif // GOOGLE_BREAKPAD_CLIENT_MAC_TESTS_SPAWN_CHILD_PROCESS
diff --git a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/testlogging.h b/toolkit/crashreporter/google-breakpad/src/client/mac/tests/testlogging.h
deleted file mode 100644
index c6b6be699b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/tests/testlogging.h
+++ /dev/null
@@ -1,9 +0,0 @@
-// This file exists to override the processor logging for unit tests,
-// since it confuses XCode into thinking unit tests have failed.
-#include <sstream>
-
-namespace google_breakpad {
-extern std::ostringstream info_log;
-}
-
-#define BPLOG_INFO_STREAM google_breakpad::info_log
diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h
deleted file mode 100644
index 0e12e00b69..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer-inl.h
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_file_writer-inl.h: Minidump file writer implementation.
-//
-// See minidump_file_writer.h for documentation.
-
-#ifndef CLIENT_MINIDUMP_FILE_WRITER_INL_H__
-#define CLIENT_MINIDUMP_FILE_WRITER_INL_H__
-
-#include <assert.h>
-
-#include "client/minidump_file_writer.h"
-#include "google_breakpad/common/minidump_size.h"
-
-namespace google_breakpad {
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::Allocate() {
- allocation_state_ = SINGLE_OBJECT;
- return UntypedMDRVA::Allocate(minidump_size<MDType>::size());
-}
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::Allocate(size_t additional) {
- allocation_state_ = SINGLE_OBJECT;
- return UntypedMDRVA::Allocate(minidump_size<MDType>::size() + additional);
-}
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::AllocateArray(size_t count) {
- assert(count);
- allocation_state_ = ARRAY;
- return UntypedMDRVA::Allocate(minidump_size<MDType>::size() * count);
-}
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::AllocateObjectAndArray(size_t count,
- size_t length) {
- assert(count && length);
- allocation_state_ = SINGLE_OBJECT_WITH_ARRAY;
- return UntypedMDRVA::Allocate(minidump_size<MDType>::size() + count * length);
-}
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::CopyIndex(unsigned int index, MDType *item) {
- assert(allocation_state_ == ARRAY);
- return writer_->Copy(
- static_cast<MDRVA>(position_ + index * minidump_size<MDType>::size()),
- item, minidump_size<MDType>::size());
-}
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::CopyIndexAfterObject(unsigned int index,
- const void *src,
- size_t length) {
- assert(allocation_state_ == SINGLE_OBJECT_WITH_ARRAY);
- return writer_->Copy(
- static_cast<MDRVA>(position_ + minidump_size<MDType>::size()
- + index * length),
- src, length);
-}
-
-template<typename MDType>
-inline bool TypedMDRVA<MDType>::Flush() {
- return writer_->Copy(position_, &data_, minidump_size<MDType>::size());
-}
-
-} // namespace google_breakpad
-
-#endif // CLIENT_MINIDUMP_FILE_WRITER_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc
deleted file mode 100644
index a1957f324a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.cc
+++ /dev/null
@@ -1,350 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_file_writer.cc: Minidump file writer implementation.
-//
-// See minidump_file_writer.h for documentation.
-
-#include <fcntl.h>
-#include <limits.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "client/minidump_file_writer-inl.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/string_conversion.h"
-#if defined(__linux__) && __linux__
-#include "third_party/lss/linux_syscall_support.h"
-#endif
-
-#if defined(__ANDROID__)
-#include <errno.h>
-
-namespace {
-
-bool g_need_ftruncate_workaround = false;
-bool g_checked_need_ftruncate_workaround = false;
-
-void CheckNeedsFTruncateWorkAround(int file) {
- if (g_checked_need_ftruncate_workaround) {
- return;
- }
- g_checked_need_ftruncate_workaround = true;
-
- // Attempt an idempotent truncate that chops off nothing and see if we
- // run into any sort of errors.
- off_t offset = sys_lseek(file, 0, SEEK_END);
- if (offset == -1) {
- // lseek failed. Don't apply work around. It's unlikely that we can write
- // to a minidump with either method.
- return;
- }
-
- int result = ftruncate(file, offset);
- if (result == -1 && errno == EACCES) {
- // It very likely that we are running into the kernel bug in M devices.
- // We are going to deploy the workaround for writing minidump files
- // without uses of ftruncate(). This workaround should be fine even
- // for kernels without the bug.
- // See http://crbug.com/542840 for more details.
- g_need_ftruncate_workaround = true;
- }
-}
-
-bool NeedsFTruncateWorkAround() {
- return g_need_ftruncate_workaround;
-}
-
-} // namespace
-#endif // defined(__ANDROID__)
-
-namespace google_breakpad {
-
-const MDRVA MinidumpFileWriter::kInvalidMDRVA = static_cast<MDRVA>(-1);
-
-MinidumpFileWriter::MinidumpFileWriter()
- : file_(-1),
- close_file_when_destroyed_(true),
- position_(0),
- size_(0) {
-}
-
-MinidumpFileWriter::~MinidumpFileWriter() {
- if (close_file_when_destroyed_)
- Close();
-}
-
-bool MinidumpFileWriter::Open(const char *path) {
- assert(file_ == -1);
-#if defined(__linux__) && __linux__
- file_ = sys_open(path, O_WRONLY | O_CREAT | O_EXCL, 0600);
-#else
- file_ = open(path, O_WRONLY | O_CREAT | O_EXCL, 0600);
-#endif
-
- return file_ != -1;
-}
-
-void MinidumpFileWriter::SetFile(const int file) {
- assert(file_ == -1);
- file_ = file;
- close_file_when_destroyed_ = false;
-#if defined(__ANDROID__)
- CheckNeedsFTruncateWorkAround(file);
-#endif
-}
-
-bool MinidumpFileWriter::Close() {
- bool result = true;
-
- if (file_ != -1) {
-#if defined(__ANDROID__)
- if (!NeedsFTruncateWorkAround() && ftruncate(file_, position_)) {
- return false;
- }
-#else
- if (ftruncate(file_, position_)) {
- return false;
- }
-#endif
-#if defined(__linux__) && __linux__
- result = (sys_close(file_) == 0);
-#else
- result = (close(file_) == 0);
-#endif
- file_ = -1;
- }
-
- return result;
-}
-
-bool MinidumpFileWriter::CopyStringToMDString(const wchar_t *str,
- unsigned int length,
- TypedMDRVA<MDString> *mdstring) {
- bool result = true;
- if (sizeof(wchar_t) == sizeof(uint16_t)) {
- // Shortcut if wchar_t is the same size as MDString's buffer
- result = mdstring->Copy(str, mdstring->get()->length);
- } else {
- uint16_t out[2];
- int out_idx = 0;
-
- // Copy the string character by character
- while (length && result) {
- UTF32ToUTF16Char(*str, out);
- if (!out[0])
- return false;
-
- // Process one character at a time
- --length;
- ++str;
-
- // Append the one or two UTF-16 characters. The first one will be non-
- // zero, but the second one may be zero, depending on the conversion from
- // UTF-32.
- int out_count = out[1] ? 2 : 1;
- size_t out_size = sizeof(uint16_t) * out_count;
- result = mdstring->CopyIndexAfterObject(out_idx, out, out_size);
- out_idx += out_count;
- }
- }
- return result;
-}
-
-bool MinidumpFileWriter::CopyStringToMDString(const char *str,
- unsigned int length,
- TypedMDRVA<MDString> *mdstring) {
- bool result = true;
- uint16_t out[2];
- int out_idx = 0;
-
- // Copy the string character by character
- while (length && result) {
- int conversion_count = UTF8ToUTF16Char(str, length, out);
- if (!conversion_count)
- return false;
-
- // Move the pointer along based on the nubmer of converted characters
- length -= conversion_count;
- str += conversion_count;
-
- // Append the one or two UTF-16 characters
- int out_count = out[1] ? 2 : 1;
- size_t out_size = sizeof(uint16_t) * out_count;
- result = mdstring->CopyIndexAfterObject(out_idx, out, out_size);
- out_idx += out_count;
- }
- return result;
-}
-
-template <typename CharType>
-bool MinidumpFileWriter::WriteStringCore(const CharType *str,
- unsigned int length,
- MDLocationDescriptor *location) {
- assert(str);
- assert(location);
- // Calculate the mdstring length by either limiting to |length| as passed in
- // or by finding the location of the NULL character.
- unsigned int mdstring_length = 0;
- if (!length)
- length = INT_MAX;
- for (; mdstring_length < length && str[mdstring_length]; ++mdstring_length)
- ;
-
- // Allocate the string buffer
- TypedMDRVA<MDString> mdstring(this);
- if (!mdstring.AllocateObjectAndArray(mdstring_length + 1, sizeof(uint16_t)))
- return false;
-
- // Set length excluding the NULL and copy the string
- mdstring.get()->length =
- static_cast<uint32_t>(mdstring_length * sizeof(uint16_t));
- bool result = CopyStringToMDString(str, mdstring_length, &mdstring);
-
- // NULL terminate
- if (result) {
- uint16_t ch = 0;
- result = mdstring.CopyIndexAfterObject(mdstring_length, &ch, sizeof(ch));
-
- if (result)
- *location = mdstring.location();
- }
-
- return result;
-}
-
-bool MinidumpFileWriter::WriteString(const wchar_t *str, unsigned int length,
- MDLocationDescriptor *location) {
- return WriteStringCore(str, length, location);
-}
-
-bool MinidumpFileWriter::WriteString(const char *str, unsigned int length,
- MDLocationDescriptor *location) {
- return WriteStringCore(str, length, location);
-}
-
-bool MinidumpFileWriter::WriteMemory(const void *src, size_t size,
- MDMemoryDescriptor *output) {
- assert(src);
- assert(output);
- UntypedMDRVA mem(this);
-
- if (!mem.Allocate(size))
- return false;
- if (!mem.Copy(src, mem.size()))
- return false;
-
- output->start_of_memory_range = reinterpret_cast<uint64_t>(src);
- output->memory = mem.location();
-
- return true;
-}
-
-MDRVA MinidumpFileWriter::Allocate(size_t size) {
- assert(size);
- assert(file_ != -1);
-#if defined(__ANDROID__)
- if (NeedsFTruncateWorkAround()) {
- // If ftruncate() is not available. We simply increase the size beyond the
- // current file size. sys_write() will expand the file when data is written
- // to it. Because we did not over allocate to fit memory pages, we also
- // do not need to ftruncate() the file once we are done.
- size_ += size;
-
- // We don't need to seek since the file is unchanged.
- MDRVA current_position = position_;
- position_ += static_cast<MDRVA>(size);
- return current_position;
- }
-#endif
- size_t aligned_size = (size + 7) & ~7; // 64-bit alignment
-
- if (position_ + aligned_size > size_) {
- size_t growth = aligned_size;
- size_t minimal_growth = getpagesize();
-
- // Ensure that the file grows by at least the size of a memory page
- if (growth < minimal_growth)
- growth = minimal_growth;
-
- size_t new_size = size_ + growth;
- if (ftruncate(file_, new_size) != 0)
- return kInvalidMDRVA;
-
- size_ = new_size;
- }
-
- MDRVA current_position = position_;
- position_ += static_cast<MDRVA>(aligned_size);
-
- return current_position;
-}
-
-bool MinidumpFileWriter::Copy(MDRVA position, const void *src, ssize_t size) {
- assert(src);
- assert(size);
- assert(file_ != -1);
-
- // Ensure that the data will fit in the allocated space
- if (static_cast<size_t>(size + position) > size_)
- return false;
-
- // Seek and write the data
-#if defined(__linux__) && __linux__
- if (sys_lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) {
- if (sys_write(file_, src, size) == size) {
- return true;
- }
- }
-#else
- if (lseek(file_, position, SEEK_SET) == static_cast<off_t>(position)) {
- if (write(file_, src, size) == size) {
- return true;
- }
- }
-#endif
- return false;
-}
-
-bool UntypedMDRVA::Allocate(size_t size) {
- assert(size_ == 0);
- size_ = size;
- position_ = writer_->Allocate(size_);
- return position_ != MinidumpFileWriter::kInvalidMDRVA;
-}
-
-bool UntypedMDRVA::Copy(MDRVA pos, const void *src, size_t size) {
- assert(src);
- assert(size);
- assert(pos + size <= position_ + size_);
- return writer_->Copy(pos, src, size);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h
deleted file mode 100644
index ce32b6d087..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer.h
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_file_writer.h: Implements file-based minidump generation. It's
-// intended to be used with the Google Breakpad open source crash handling
-// project.
-
-#ifndef CLIENT_MINIDUMP_FILE_WRITER_H__
-#define CLIENT_MINIDUMP_FILE_WRITER_H__
-
-#include <string>
-
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-class UntypedMDRVA;
-template<typename MDType> class TypedMDRVA;
-
-// The user of this class can Open() a file and add minidump streams, data, and
-// strings using the definitions in minidump_format.h. Since this class is
-// expected to be used in a situation where the current process may be
-// damaged, it will not allocate heap memory.
-// Sample usage:
-// MinidumpFileWriter writer;
-// writer.Open("/tmp/minidump.dmp");
-// TypedMDRVA<MDRawHeader> header(&writer_);
-// header.Allocate();
-// header->get()->signature = MD_HEADER_SIGNATURE;
-// :
-// writer.Close();
-//
-// An alternative is to use SetFile and provide a file descriptor:
-// MinidumpFileWriter writer;
-// writer.SetFile(minidump_fd);
-// TypedMDRVA<MDRawHeader> header(&writer_);
-// header.Allocate();
-// header->get()->signature = MD_HEADER_SIGNATURE;
-// :
-// writer.Close();
-
-class MinidumpFileWriter {
-public:
- // Invalid MDRVA (Minidump Relative Virtual Address)
- // returned on failed allocation
- static const MDRVA kInvalidMDRVA;
-
- MinidumpFileWriter();
- ~MinidumpFileWriter();
-
- // Open |path| as the destination of the minidump data. If |path| already
- // exists, then Open() will fail.
- // Return true on success, or false on failure.
- bool Open(const char *path);
-
- // Sets the file descriptor |file| as the destination of the minidump data.
- // Can be used as an alternative to Open() when a file descriptor is
- // available.
- // Note that |fd| is not closed when the instance of MinidumpFileWriter is
- // destroyed.
- void SetFile(const int file);
-
- // Close the current file (that was either created when Open was called, or
- // specified with SetFile).
- // Return true on success, or false on failure.
- bool Close();
-
- // Copy the contents of |str| to a MDString and write it to the file.
- // |str| is expected to be either UTF-16 or UTF-32 depending on the size
- // of wchar_t.
- // Maximum |length| of characters to copy from |str|, or specify 0 to use the
- // entire NULL terminated string. Copying will stop at the first NULL.
- // |location| the allocated location
- // Return true on success, or false on failure
- bool WriteString(const wchar_t *str, unsigned int length,
- MDLocationDescriptor *location);
-
- // Same as above, except with |str| as a UTF-8 string
- bool WriteString(const char *str, unsigned int length,
- MDLocationDescriptor *location);
-
- // Write |size| bytes starting at |src| into the current position.
- // Return true on success and set |output| to position, or false on failure
- bool WriteMemory(const void *src, size_t size, MDMemoryDescriptor *output);
-
- // Copies |size| bytes from |src| to |position|
- // Return true on success, or false on failure
- bool Copy(MDRVA position, const void *src, ssize_t size);
-
- // Return the current position for writing to the minidump
- inline MDRVA position() const { return position_; }
-
- private:
- friend class UntypedMDRVA;
-
- // Allocates an area of |size| bytes.
- // Returns the position of the allocation, or kInvalidMDRVA if it was
- // unable to allocate the bytes.
- MDRVA Allocate(size_t size);
-
- // The file descriptor for the output file.
- int file_;
-
- // Whether |file_| should be closed when the instance is destroyed.
- bool close_file_when_destroyed_;
-
- // Current position in buffer
- MDRVA position_;
-
- // Current allocated size
- size_t size_;
-
- // Copy |length| characters from |str| to |mdstring|. These are distinct
- // because the underlying MDString is a UTF-16 based string. The wchar_t
- // variant may need to create a MDString that has more characters than the
- // source |str|, whereas the UTF-8 variant may coalesce characters to form
- // a single UTF-16 character.
- bool CopyStringToMDString(const wchar_t *str, unsigned int length,
- TypedMDRVA<MDString> *mdstring);
- bool CopyStringToMDString(const char *str, unsigned int length,
- TypedMDRVA<MDString> *mdstring);
-
- // The common templated code for writing a string
- template <typename CharType>
- bool WriteStringCore(const CharType *str, unsigned int length,
- MDLocationDescriptor *location);
-};
-
-// Represents an untyped allocated chunk
-class UntypedMDRVA {
- public:
- explicit UntypedMDRVA(MinidumpFileWriter *writer)
- : writer_(writer),
- position_(writer->position()),
- size_(0) {}
-
- // Allocates |size| bytes. Must not call more than once.
- // Return true on success, or false on failure
- bool Allocate(size_t size);
-
- // Returns the current position or kInvalidMDRVA if allocation failed
- inline MDRVA position() const { return position_; }
-
- // Number of bytes allocated
- inline size_t size() const { return size_; }
-
- // Return size and position
- inline MDLocationDescriptor location() const {
- MDLocationDescriptor location = { static_cast<uint32_t>(size_),
- position_ };
- return location;
- }
-
- // Copy |size| bytes starting at |src| into the minidump at |position|
- // Return true on success, or false on failure
- bool Copy(MDRVA position, const void *src, size_t size);
-
- // Copy |size| bytes from |src| to the current position
- inline bool Copy(const void *src, size_t size) {
- return Copy(position_, src, size);
- }
-
- protected:
- // Writer we associate with
- MinidumpFileWriter *writer_;
-
- // Position of the start of the data
- MDRVA position_;
-
- // Allocated size
- size_t size_;
-};
-
-// Represents a Minidump object chunk. Additional memory can be allocated at
-// the end of the object as a:
-// - single allocation
-// - Array of MDType objects
-// - A MDType object followed by an array
-template<typename MDType>
-class TypedMDRVA : public UntypedMDRVA {
- public:
- // Constructs an unallocated MDRVA
- explicit TypedMDRVA(MinidumpFileWriter *writer)
- : UntypedMDRVA(writer),
- data_(),
- allocation_state_(UNALLOCATED) {}
-
- inline ~TypedMDRVA() {
- // Ensure that the data_ object is written out
- if (allocation_state_ != ARRAY)
- Flush();
- }
-
- // Address of object data_ of MDType. This is not declared const as the
- // typical usage will be to access the underlying |data_| object as to
- // alter its contents.
- MDType *get() { return &data_; }
-
- // Allocates minidump_size<MDType>::size() bytes.
- // Must not call more than once.
- // Return true on success, or false on failure
- bool Allocate();
-
- // Allocates minidump_size<MDType>::size() + |additional| bytes.
- // Must not call more than once.
- // Return true on success, or false on failure
- bool Allocate(size_t additional);
-
- // Allocate an array of |count| elements of MDType.
- // Must not call more than once.
- // Return true on success, or false on failure
- bool AllocateArray(size_t count);
-
- // Allocate an array of |count| elements of |size| after object of MDType
- // Must not call more than once.
- // Return true on success, or false on failure
- bool AllocateObjectAndArray(size_t count, size_t size);
-
- // Copy |item| to |index|
- // Must have been allocated using AllocateArray().
- // Return true on success, or false on failure
- bool CopyIndex(unsigned int index, MDType *item);
-
- // Copy |size| bytes starting at |str| to |index|
- // Must have been allocated using AllocateObjectAndArray().
- // Return true on success, or false on failure
- bool CopyIndexAfterObject(unsigned int index, const void *src, size_t size);
-
- // Write data_
- bool Flush();
-
- private:
- enum AllocationState {
- UNALLOCATED = 0,
- SINGLE_OBJECT,
- ARRAY,
- SINGLE_OBJECT_WITH_ARRAY
- };
-
- MDType data_;
- AllocationState allocation_state_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_MINIDUMP_FILE_WRITER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc b/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc
deleted file mode 100644
index 60c364e689..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/minidump_file_writer_unittest.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: waylonis@google.com (Dan Waylonis)
-
-/*
- g++ -I../ ../common/convert_UTF.c \
- ../common/string_conversion.cc \
- minidump_file_writer.cc \
- minidump_file_writer_unittest.cc \
- -o minidump_file_writer_unittest
- */
-
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "minidump_file_writer-inl.h"
-
-using google_breakpad::MinidumpFileWriter;
-
-#define ASSERT_TRUE(cond) \
-if (!(cond)) { \
- fprintf(stderr, "FAILED: %s at %s:%d\n", #cond, __FILE__, __LINE__); \
- return false; \
-}
-
-#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2))
-#define ASSERT_NE(e1, e2) ASSERT_TRUE((e1) != (e2))
-
-struct StringStructure {
- unsigned long integer_value;
- MDLocationDescriptor first_string;
- MDLocationDescriptor second_string;
-};
-
-struct ArrayStructure {
- unsigned char char_value;
- unsigned short short_value;
- unsigned long long_value;
-};
-
-typedef struct {
- unsigned long count;
- ArrayStructure array[0];
-} ObjectAndArrayStructure;
-
-static bool WriteFile(const char *path) {
- MinidumpFileWriter writer;
- if (writer.Open(path)) {
- // Test a single structure
- google_breakpad::TypedMDRVA<StringStructure> strings(&writer);
- ASSERT_TRUE(strings.Allocate());
- strings.get()->integer_value = 0xBEEF;
- const char *first = "First String";
- ASSERT_TRUE(writer.WriteString(first, 0, &strings.get()->first_string));
- const wchar_t *second = L"Second String";
- ASSERT_TRUE(writer.WriteString(second, 0, &strings.get()->second_string));
-
- // Test an array structure
- google_breakpad::TypedMDRVA<ArrayStructure> array(&writer);
- unsigned int count = 10;
- ASSERT_TRUE(array.AllocateArray(count));
- for (unsigned char i = 0; i < count; ++i) {
- ArrayStructure local;
- local.char_value = i;
- local.short_value = i + 1;
- local.long_value = i + 2;
- ASSERT_TRUE(array.CopyIndex(i, &local));
- }
-
- // Test an object followed by an array
- google_breakpad::TypedMDRVA<ObjectAndArrayStructure> obj_array(&writer);
- ASSERT_TRUE(obj_array.AllocateObjectAndArray(count,
- sizeof(ArrayStructure)));
- obj_array.get()->count = count;
- for (unsigned char i = 0; i < count; ++i) {
- ArrayStructure local;
- local.char_value = i;
- local.short_value = i + 1;
- local.long_value = i + 2;
- ASSERT_TRUE(obj_array.CopyIndexAfterObject(i, &local, sizeof(local)));
- }
- }
-
- return writer.Close();
-}
-
-static bool CompareFile(const char *path) {
- unsigned long expected[] = {
-#if defined(__BIG_ENDIAN__)
- 0x0000beef, 0x0000001e, 0x00000018, 0x00000020, 0x00000038, 0x00000000,
- 0x00000018, 0x00460069, 0x00720073, 0x00740020, 0x00530074, 0x00720069,
- 0x006e0067, 0x00000000, 0x0000001a, 0x00530065, 0x0063006f, 0x006e0064,
- 0x00200053, 0x00740072, 0x0069006e, 0x00670000, 0x00000001, 0x00000002,
- 0x01000002, 0x00000003, 0x02000003, 0x00000004, 0x03000004, 0x00000005,
- 0x04000005, 0x00000006, 0x05000006, 0x00000007, 0x06000007, 0x00000008,
- 0x07000008, 0x00000009, 0x08000009, 0x0000000a, 0x0900000a, 0x0000000b,
- 0x0000000a, 0x00000001, 0x00000002, 0x01000002, 0x00000003, 0x02000003,
- 0x00000004, 0x03000004, 0x00000005, 0x04000005, 0x00000006, 0x05000006,
- 0x00000007, 0x06000007, 0x00000008, 0x07000008, 0x00000009, 0x08000009,
- 0x0000000a, 0x0900000a, 0x0000000b, 0x00000000
-#else
- 0x0000beef, 0x0000001e, 0x00000018, 0x00000020,
- 0x00000038, 0x00000000, 0x00000018, 0x00690046,
- 0x00730072, 0x00200074, 0x00740053, 0x00690072,
- 0x0067006e, 0x00000000, 0x0000001a, 0x00650053,
- 0x006f0063, 0x0064006e, 0x00530020, 0x00720074,
- 0x006e0069, 0x00000067, 0x00011e00, 0x00000002,
- 0x00021e01, 0x00000003, 0x00031e02, 0x00000004,
- 0x00041e03, 0x00000005, 0x00051e04, 0x00000006,
- 0x00061e05, 0x00000007, 0x00071e06, 0x00000008,
- 0x00081e07, 0x00000009, 0x00091e08, 0x0000000a,
- 0x000a1e09, 0x0000000b, 0x0000000a, 0x00011c00,
- 0x00000002, 0x00021c01, 0x00000003, 0x00031c02,
- 0x00000004, 0x00041c03, 0x00000005, 0x00051c04,
- 0x00000006, 0x00061c05, 0x00000007, 0x00071c06,
- 0x00000008, 0x00081c07, 0x00000009, 0x00091c08,
- 0x0000000a, 0x000a1c09, 0x0000000b, 0x00000000,
-#endif
- };
- size_t expected_byte_count = sizeof(expected);
- int fd = open(path, O_RDONLY, 0600);
- void *buffer = malloc(expected_byte_count);
- ASSERT_NE(fd, -1);
- ASSERT_TRUE(buffer);
- ASSERT_EQ(read(fd, buffer, expected_byte_count),
- static_cast<ssize_t>(expected_byte_count));
-
- char *b1, *b2;
- b1 = reinterpret_cast<char*>(buffer);
- b2 = reinterpret_cast<char*>(expected);
- while (*b1 == *b2) {
- b1++;
- b2++;
- }
-
- printf("%p\n", reinterpret_cast<void*>(b1 - (char*)buffer));
-
- ASSERT_EQ(memcmp(buffer, expected, expected_byte_count), 0);
- return true;
-}
-
-static bool RunTests() {
- const char *path = "/tmp/minidump_file_writer_unittest.dmp";
- ASSERT_TRUE(WriteFile(path));
- ASSERT_TRUE(CompareFile(path));
- unlink(path);
- return true;
-}
-
-extern "C" int main(int argc, const char *argv[]) {
- return RunTests() ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/moz.build b/toolkit/crashreporter/google-breakpad/src/client/moz.build
deleted file mode 100644
index 49a1797be2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- 'minidump_file_writer.cc',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '..',
-]
-
-if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-shadow']
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile
deleted file mode 100644
index beeb9448fb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile
+++ /dev/null
@@ -1,78 +0,0 @@
-# Copyright (c) 2007, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Author: Alfred Peng
-
-CC=cc
-CXX=CC
-
-CPPFLAGS=-g -I../../.. -DNDEBUG -features=extensions -D_REENTRANT
-LDFLAGS=-lpthread -lssl -lgnutls-openssl -lelf
-
-OBJ_DIR=.
-BIN_DIR=.
-
-THREAD_SRC=solaris_lwp.cc
-SHARE_SRC=../../minidump_file_writer.cc\
- ../../../common/md5.cc\
- ../../../common/string_conversion.cc\
- ../../../common/solaris/file_id.cc\
- minidump_generator.cc
-HANDLER_SRC=exception_handler.cc\
- ../../../common/solaris/guid_creator.cc
-SHARE_C_SRC=../../../common/convert_UTF.c
-
-MINIDUMP_TEST_SRC=minidump_test.cc
-EXCEPTION_TEST_SRC=exception_handler_test.cc
-
-THREAD_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(THREAD_SRC))
-SHARE_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(SHARE_SRC))
-HANDLER_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o,$(HANDLER_SRC))
-SHARE_C_OBJ=$(patsubst %.c,$(OBJ_DIR)/%.o,$(SHARE_C_SRC))
-MINIDUMP_TEST_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o, $(MINIDUMP_TEST_SRC))\
- $(THREAD_OBJ) $(SHARE_OBJ) $(SHARE_C_OBJ) $(HANDLER_OBJ)
-EXCEPTION_TEST_OBJ=$(patsubst %.cc,$(OBJ_DIR)/%.o, $(EXCEPTION_TEST_SRC))\
- $(THREAD_OBJ) $(SHARE_OBJ) $(SHARE_C_OBJ) $(HANDLER_OBJ)
-
-BIN=$(BIN_DIR)/minidump_test\
- $(BIN_DIR)/exception_handler_test
-
-.PHONY:all clean
-
-all:$(BIN)
-
-$(BIN_DIR)/minidump_test:$(MINIDUMP_TEST_OBJ)
- $(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
-
-$(BIN_DIR)/exception_handler_test:$(EXCEPTION_TEST_OBJ)
- $(CXX) $(CPPFLAGS) $(LDFLAGS) $^ -o $@
-
-clean:
- rm -f $(BIN) *.o *.out *.dmp core ../../minidump_file_writer.o\
- ../../../common/*.o ../../../common/solaris/*.o
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.cc
deleted file mode 100644
index 7fc8d2557e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.cc
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <signal.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <cassert>
-#include <cstdlib>
-#include <ctime>
-
-#include "client/solaris/handler/exception_handler.h"
-#include "common/solaris/guid_creator.h"
-#include "common/solaris/message_output.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// Signals that we are interested.
-static const int kSigTable[] = {
- SIGSEGV,
- SIGABRT,
- SIGFPE,
- SIGILL,
- SIGBUS
-};
-
-std::vector<ExceptionHandler*> *ExceptionHandler::handler_stack_ = NULL;
-int ExceptionHandler::handler_stack_index_ = 0;
-pthread_mutex_t ExceptionHandler::handler_stack_mutex_ =
- PTHREAD_MUTEX_INITIALIZER;
-
-ExceptionHandler::ExceptionHandler(const string &dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void *callback_context,
- bool install_handler)
- : filter_(filter),
- callback_(callback),
- callback_context_(callback_context),
- dump_path_(),
- installed_handler_(install_handler) {
- set_dump_path(dump_path);
-
- if (install_handler) {
- SetupHandler();
- }
-
- if (install_handler) {
- pthread_mutex_lock(&handler_stack_mutex_);
-
- if (handler_stack_ == NULL)
- handler_stack_ = new std::vector<ExceptionHandler *>;
- handler_stack_->push_back(this);
- pthread_mutex_unlock(&handler_stack_mutex_);
- }
-}
-
-ExceptionHandler::~ExceptionHandler() {
- TeardownAllHandlers();
- pthread_mutex_lock(&handler_stack_mutex_);
- if (handler_stack_->back() == this) {
- handler_stack_->pop_back();
- } else {
- print_message1(2, "warning: removing Breakpad handler out of order\n");
- for (std::vector<ExceptionHandler *>::iterator iterator =
- handler_stack_->begin();
- iterator != handler_stack_->end();
- ++iterator) {
- if (*iterator == this) {
- handler_stack_->erase(iterator);
- }
- }
- }
-
- if (handler_stack_->empty()) {
- // When destroying the last ExceptionHandler that installed a handler,
- // clean up the handler stack.
- delete handler_stack_;
- handler_stack_ = NULL;
- }
- pthread_mutex_unlock(&handler_stack_mutex_);
-}
-
-bool ExceptionHandler::WriteMinidump() {
- return InternalWriteMinidump(0, 0, NULL);
-}
-
-// static
-bool ExceptionHandler::WriteMinidump(const string &dump_path,
- MinidumpCallback callback,
- void *callback_context) {
- ExceptionHandler handler(dump_path, NULL, callback,
- callback_context, false);
- return handler.InternalWriteMinidump(0, 0, NULL);
-}
-
-void ExceptionHandler::SetupHandler() {
- // Signal on a different stack to avoid using the stack
- // of the crashing lwp.
- struct sigaltstack sig_stack;
- sig_stack.ss_sp = malloc(MINSIGSTKSZ);
- if (sig_stack.ss_sp == NULL)
- return;
- sig_stack.ss_size = MINSIGSTKSZ;
- sig_stack.ss_flags = 0;
-
- if (sigaltstack(&sig_stack, NULL) < 0)
- return;
- for (size_t i = 0; i < sizeof(kSigTable) / sizeof(kSigTable[0]); ++i)
- SetupHandler(kSigTable[i]);
-}
-
-void ExceptionHandler::SetupHandler(int signo) {
- struct sigaction act, old_act;
- act.sa_handler = HandleException;
- act.sa_flags = SA_ONSTACK;
- if (sigaction(signo, &act, &old_act) < 0)
- return;
- old_handlers_[signo] = old_act.sa_handler;
-}
-
-void ExceptionHandler::TeardownHandler(int signo) {
- if (old_handlers_.find(signo) != old_handlers_.end()) {
- struct sigaction act;
- act.sa_handler = old_handlers_[signo];
- act.sa_flags = 0;
- sigaction(signo, &act, 0);
- }
-}
-
-void ExceptionHandler::TeardownAllHandlers() {
- for (size_t i = 0; i < sizeof(kSigTable) / sizeof(kSigTable[0]); ++i) {
- TeardownHandler(kSigTable[i]);
- }
-}
-
-// static
-void ExceptionHandler::HandleException(int signo) {
-//void ExceptionHandler::HandleException(int signo, siginfo_t *sip, ucontext_t *sig_ctx) {
- // The context information about the signal is put on the stack of
- // the signal handler frame as value parameter. For some reasons, the
- // prototype of the handler doesn't declare this information as parameter, we
- // will do it by hand. The stack layout for a signal handler frame is here:
- // http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libproc/common/Pstack.c#81
- //
- // However, if we are being called by another signal handler passing the
- // signal up the chain, then we may not have this random extra parameter,
- // so we may have to walk the stack to find it. We do the actual work
- // on another thread, where it's a little safer, but we want the ebp
- // from this frame to find it.
- uintptr_t current_ebp = (uintptr_t)_getfp();
-
- pthread_mutex_lock(&handler_stack_mutex_);
- ExceptionHandler *current_handler =
- handler_stack_->at(handler_stack_->size() - ++handler_stack_index_);
- pthread_mutex_unlock(&handler_stack_mutex_);
-
- // Restore original handler.
- current_handler->TeardownHandler(signo);
-
- ucontext_t *sig_ctx = NULL;
- if (current_handler->InternalWriteMinidump(signo, current_ebp, &sig_ctx)) {
-// if (current_handler->InternalWriteMinidump(signo, &sig_ctx)) {
- // Fully handled this exception, safe to exit.
- exit(EXIT_FAILURE);
- } else {
- // Exception not fully handled, will call the next handler in stack to
- // process it.
- typedef void (*SignalHandler)(int signo);
- SignalHandler old_handler =
- reinterpret_cast<SignalHandler>(current_handler->old_handlers_[signo]);
- if (old_handler != NULL)
- old_handler(signo);
- }
-
- pthread_mutex_lock(&handler_stack_mutex_);
- current_handler->SetupHandler(signo);
- --handler_stack_index_;
- // All the handlers in stack have been invoked to handle the exception,
- // normally the process should be terminated and should not reach here.
- // In case we got here, ask the OS to handle it to avoid endless loop,
- // normally the OS will generate a core and termiate the process. This
- // may be desired to debug the program.
- if (handler_stack_index_ == 0)
- signal(signo, SIG_DFL);
- pthread_mutex_unlock(&handler_stack_mutex_);
-}
-
-bool ExceptionHandler::InternalWriteMinidump(int signo,
- uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) {
- if (filter_ && !filter_(callback_context_))
- return false;
-
- bool success = false;
- GUID guid;
- char guid_str[kGUIDStringLength + 1];
- if (CreateGUID(&guid) && GUIDToString(&guid, guid_str, sizeof(guid_str))) {
- char minidump_path[PATH_MAX];
- snprintf(minidump_path, sizeof(minidump_path), "%s/%s.dmp",
- dump_path_c_, guid_str);
-
- // Block all the signals we want to process when writing minidump.
- // We don't want it to be interrupted.
- sigset_t sig_blocked, sig_old;
- bool blocked = true;
- sigfillset(&sig_blocked);
- for (size_t i = 0; i < sizeof(kSigTable) / sizeof(kSigTable[0]); ++i)
- sigdelset(&sig_blocked, kSigTable[i]);
- if (sigprocmask(SIG_BLOCK, &sig_blocked, &sig_old) != 0) {
- blocked = false;
- print_message1(2, "HandleException: failed to block signals.\n");
- }
-
- success = minidump_generator_.WriteMinidumpToFile(
- minidump_path, signo, sighandler_ebp, sig_ctx);
-
- // Unblock the signals.
- if (blocked)
- sigprocmask(SIG_SETMASK, &sig_old, &sig_old);
-
- if (callback_)
- success = callback_(dump_path_c_, guid_str, callback_context_, success);
- }
- return success;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.h b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.h
deleted file mode 100644
index 4d72485feb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler.h
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: Alfred Peng
-
-#ifndef CLIENT_SOLARIS_HANDLER_EXCEPTION_HANDLER_H__
-#define CLIENT_SOLARIS_HANDLER_EXCEPTION_HANDLER_H__
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "client/solaris/handler/minidump_generator.h"
-
-namespace google_breakpad {
-
-using std::string;
-
-//
-// ExceptionHandler
-//
-// ExceptionHandler can write a minidump file when an exception occurs,
-// or when WriteMinidump() is called explicitly by your program.
-//
-// To have the exception handler write minidumps when an uncaught exception
-// (crash) occurs, you should create an instance early in the execution
-// of your program, and keep it around for the entire time you want to
-// have crash handling active (typically, until shutdown).
-// (NOTE): There should be only one this kind of exception handler
-// object per process.
-//
-// If you want to write minidumps without installing the exception handler,
-// you can create an ExceptionHandler with install_handler set to false,
-// then call WriteMinidump. You can also use this technique if you want to
-// use different minidump callbacks for different call sites.
-//
-// In either case, a callback function is called when a minidump is written,
-// which receives the unqiue id of the minidump. The caller can use this
-// id to collect and write additional application state, and to launch an
-// external crash-reporting application.
-//
-// Caller should try to make the callbacks as crash-friendly as possible,
-// it should avoid use heap memory allocation as much as possible.
-//
-class ExceptionHandler {
- public:
- // A callback function to run before Breakpad performs any substantial
- // processing of an exception. A FilterCallback is called before writing
- // a minidump. context is the parameter supplied by the user as
- // callback_context when the handler was created.
- //
- // If a FilterCallback returns true, Breakpad will continue processing,
- // attempting to write a minidump. If a FilterCallback returns false,
- // Breakpad will immediately report the exception as unhandled without
- // writing a minidump, allowing another handler the opportunity to handle it.
- typedef bool (*FilterCallback)(void *context);
-
- // A callback function to run after the minidump has been written.
- // minidump_id is a unique id for the dump, so the minidump
- // file is <dump_path>/<minidump_id>.dmp. context is the parameter supplied
- // by the user as callback_context when the handler was created. succeeded
- // indicates whether a minidump file was successfully written.
- //
- // If an exception occurred and the callback returns true, Breakpad will
- // treat the exception as fully-handled, suppressing any other handlers from
- // being notified of the exception. If the callback returns false, Breakpad
- // will treat the exception as unhandled, and allow another handler to handle
- // it. If there are no other handlers, Breakpad will report the exception to
- // the system as unhandled, allowing a debugger or native crash dialog the
- // opportunity to handle the exception. Most callback implementations
- // should normally return the value of |succeeded|, or when they wish to
- // not report an exception of handled, false. Callbacks will rarely want to
- // return true directly (unless |succeeded| is true).
- typedef bool (*MinidumpCallback)(const char *dump_path,
- const char *minidump_id,
- void *context,
- bool succeeded);
-
- // Creates a new ExceptionHandler instance to handle writing minidumps.
- // Before writing a minidump, the optional filter callback will be called.
- // Its return value determines whether or not Breakpad should write a
- // minidump. Minidump files will be written to dump_path, and the optional
- // callback is called after writing the dump file, as described above.
- // If install_handler is true, then a minidump will be written whenever
- // an unhandled exception occurs. If it is false, minidumps will only
- // be written when WriteMinidump is called.
- ExceptionHandler(const string &dump_path,
- FilterCallback filter, MinidumpCallback callback,
- void *callback_context,
- bool install_handler);
- ~ExceptionHandler();
-
- // Get and Set the minidump path.
- string dump_path() const { return dump_path_; }
- void set_dump_path(const string &dump_path) {
- dump_path_ = dump_path;
- dump_path_c_ = dump_path_.c_str();
- }
-
- // Writes a minidump immediately. This can be used to capture the
- // execution state independently of a crash. Returns true on success.
- bool WriteMinidump();
-
- // Convenience form of WriteMinidump which does not require an
- // ExceptionHandler instance.
- static bool WriteMinidump(const string &dump_path,
- MinidumpCallback callback,
- void *callback_context);
-
- private:
- // Setup crash handler.
- void SetupHandler();
- // Setup signal handler for a signal.
- void SetupHandler(int signo);
- // Teardown the handler for a signal.
- void TeardownHandler(int signo);
- // Teardown all handlers.
- void TeardownAllHandlers();
-
- // Runs the main loop for the exception handler thread.
- static void* ExceptionHandlerThreadMain(void *lpParameter);
-
- // Signal handler.
- static void HandleException(int signo);
-
- // Write all the information to the dump file.
- // If called from a signal handler, sighandler_ebp is the ebp of
- // that signal handler's frame, and sig_ctx is an out parameter
- // that will be set to point at the ucontext_t that was placed
- // on the stack by the kernel. You can pass zero and NULL
- // for the second and third parameters if you are not calling
- // this from a signal handler.
- bool InternalWriteMinidump(int signo, uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx);
-
- private:
- // The callbacks before and after writing the dump file.
- FilterCallback filter_;
- MinidumpCallback callback_;
- void *callback_context_;
-
- // The directory in which a minidump will be written, set by the dump_path
- // argument to the constructor, or set_dump_path.
- string dump_path_;
- // C style dump path. Keep this when setting dump path, since calling
- // c_str() of std::string when crashing may not be safe.
- const char *dump_path_c_;
-
- // True if the ExceptionHandler installed an unhandled exception filter
- // when created (with an install_handler parameter set to true).
- bool installed_handler_;
-
- // Keep the previous handlers for the signal.
- typedef void (*sighandler_t)(int);
- std::map<int, sighandler_t> old_handlers_;
-
- // The global exception handler stack. This is need becuase there may exist
- // multiple ExceptionHandler instances in a process. Each will have itself
- // registered in this stack.
- static std::vector<ExceptionHandler *> *handler_stack_;
- // The index of the handler that should handle the next exception.
- static int handler_stack_index_;
- static pthread_mutex_t handler_stack_mutex_;
-
- // The minidump generator.
- MinidumpGenerator minidump_generator_;
-
- // disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_SOLARIS_HANDLER_EXCEPTION_HANDLER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler_test.cc b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler_test.cc
deleted file mode 100644
index 6bb8e18d95..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/exception_handler_test.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <pthread.h>
-#include <unistd.h>
-
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-#include "client/solaris/handler/exception_handler.h"
-#include "client/solaris/handler/solaris_lwp.h"
-
-using namespace google_breakpad;
-
-// Thread use this to see if it should stop working.
-static bool should_exit = false;
-
-static int foo2(int arg) {
- // Stack variable, used for debugging stack dumps.
- int c = 0xcccccccc;
- fprintf(stderr, "Thread trying to crash: %x\n", getpid());
- c = *reinterpret_cast<int *>(0x5);
- return c;
-}
-
-static int foo(int arg) {
- // Stack variable, used for debugging stack dumps.
- int b = 0xbbbbbbbb;
- b = foo2(b);
- return b;
-}
-
-static void *thread_crash(void *) {
- // Stack variable, used for debugging stack dumps.
- int a = 0xaaaaaaaa;
- sleep(3);
- a = foo(a);
- printf("%x\n", a);
- return NULL;
-}
-
-static void *thread_main(void *) {
- while (!should_exit)
- sleep(1);
- return NULL;
-}
-
-static void CreateCrashThread() {
- pthread_t h;
- pthread_create(&h, NULL, thread_crash, NULL);
- pthread_detach(h);
-}
-
-// Create working threads.
-static void CreateThread(int num) {
- pthread_t h;
- for (int i = 0; i < num; ++i) {
- pthread_create(&h, NULL, thread_main, NULL);
- pthread_detach(h);
- }
-}
-
-// Callback when minidump written.
-static bool MinidumpCallback(const char *dump_path,
- const char *minidump_id,
- void *context,
- bool succeeded) {
- int index = reinterpret_cast<int>(context);
- if (index == 0) {
- should_exit = true;
- return true;
- }
- // Don't process it.
- return false;
-}
-
-int main(int argc, char *argv[]) {
- int handler_index = 1;
- ExceptionHandler handler_ignore(".", NULL, MinidumpCallback,
- (void*)handler_index, true);
- CreateCrashThread();
- CreateThread(10);
-
- while (true)
- sleep(20);
- should_exit = true;
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.cc b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.cc
deleted file mode 100644
index 7485025fe4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.cc
+++ /dev/null
@@ -1,786 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <fcntl.h>
-#include <sys/frame.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/utsname.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <cstdlib>
-#include <ctime>
-
-#include "client/solaris/handler/minidump_generator.h"
-#include "client/minidump_file_writer-inl.h"
-#include "common/solaris/file_id.h"
-
-namespace {
-
-using namespace google_breakpad;
-
-// Argument for the writer function.
-struct WriterArgument {
- MinidumpFileWriter *minidump_writer;
-
- // Pid of the lwp who called WriteMinidumpToFile
- int requester_pid;
-
- // The stack bottom of the lwp which caused the dump.
- // Mainly used to find the lwp id of the crashed lwp since signal
- // handler may not be called in the lwp who caused it.
- uintptr_t crashed_stack_bottom;
-
- // Id of the crashing lwp.
- int crashed_lwpid;
-
- // Signal number when crash happened. Can be 0 if this is a requested dump.
- int signo;
-
- // The ebp of the signal handler frame on x86. Can be 0 if this is a
- // requested dump.
- uintptr_t sighandler_ebp;
-
- // User context when crash happens. Can be NULL if this is a requested dump.
- // This is actually an out parameter, but it will be filled in at the start
- // of the writer LWP.
- ucontext_t *sig_ctx;
-
- // Used to get information about the lwps.
- SolarisLwp *lwp_lister;
-};
-
-// Holding context information for the callback of finding the crashing lwp.
-struct FindCrashLwpContext {
- const SolarisLwp *lwp_lister;
- uintptr_t crashing_stack_bottom;
- int crashing_lwpid;
-
- FindCrashLwpContext() :
- lwp_lister(NULL),
- crashing_stack_bottom(0UL),
- crashing_lwpid(-1) {
- }
-};
-
-// Callback for list lwps.
-// It will compare the stack bottom of the provided lwp with the stack
-// bottom of the crashed lwp, it they are eqaul, this lwp is the one
-// who crashed.
-bool IsLwpCrashedCallback(lwpstatus_t *lsp, void *context) {
- FindCrashLwpContext *crashing_context =
- static_cast<FindCrashLwpContext *>(context);
- const SolarisLwp *lwp_lister = crashing_context->lwp_lister;
- const prgregset_t *gregs = &(lsp->pr_reg);
-#if TARGET_CPU_SPARC
- uintptr_t last_ebp = (*gregs)[R_FP];
-#elif TARGET_CPU_X86
- uintptr_t last_ebp = (*gregs)[EBP];
-#endif
- uintptr_t stack_bottom = lwp_lister->GetLwpStackBottom(last_ebp);
- if (stack_bottom > last_ebp &&
- stack_bottom == crashing_context->crashing_stack_bottom) {
- // Got it. Stop iteration.
- crashing_context->crashing_lwpid = lsp->pr_lwpid;
- return false;
- }
-
- return true;
-}
-
-// Find the crashing lwpid.
-// This is done based on stack bottom comparing.
-int FindCrashingLwp(uintptr_t crashing_stack_bottom,
- int requester_pid,
- const SolarisLwp *lwp_lister) {
- FindCrashLwpContext context;
- context.lwp_lister = lwp_lister;
- context.crashing_stack_bottom = crashing_stack_bottom;
- CallbackParam<LwpCallback> callback_param(IsLwpCrashedCallback,
- &context);
- lwp_lister->Lwp_iter_all(lwp_lister->getpid(), &callback_param);
- return context.crashing_lwpid;
-}
-
-bool WriteLwpStack(const SolarisLwp *lwp_lister,
- uintptr_t last_esp,
- UntypedMDRVA *memory,
- MDMemoryDescriptor *loc) {
- uintptr_t stack_bottom = lwp_lister->GetLwpStackBottom(last_esp);
- if (stack_bottom >= last_esp) {
- int size = stack_bottom - last_esp;
- if (size > 0) {
- if (!memory->Allocate(size))
- return false;
- memory->Copy(reinterpret_cast<void *>(last_esp), size);
- loc->start_of_memory_range = last_esp;
- loc->memory = memory->location();
- }
- return true;
- }
- return false;
-}
-
-#if TARGET_CPU_SPARC
-bool WriteContext(MDRawContextSPARC *context, ucontext_t *sig_ctx) {
- assert(sig_ctx != NULL);
- int* regs = sig_ctx->uc_mcontext.gregs;
- context->context_flags = MD_CONTEXT_SPARC_FULL;
-
- context->ccr = (unsigned int)(regs[0]);
- context->pc = (unsigned int)(regs[REG_PC]);
- context->npc = (unsigned int)(regs[REG_nPC]);
- context->y = (unsigned int)(regs[REG_Y]);
- context->asi = (unsigned int)(regs[19]);
- context->fprs = (unsigned int)(regs[20]);
-
- for ( int i = 0 ; i < 32; ++i ) {
- context->g_r[i] = 0;
- }
-
- for ( int i = 1 ; i < 16; ++i ) {
- context->g_r[i] = (uintptr_t)(sig_ctx->uc_mcontext.gregs[i + 3]);
- }
- context->g_r[30] = (uintptr_t)(((struct frame *)context->g_r[14])->fr_savfp);
-
- return true;
-}
-
-bool WriteContext(MDRawContextSPARC *context, prgregset_t regs,
- prfpregset_t *fp_regs) {
- if (!context || !regs)
- return false;
-
- context->context_flags = MD_CONTEXT_SPARC_FULL;
-
- context->ccr = (uintptr_t)(regs[32]);
- context->pc = (uintptr_t)(regs[R_PC]);
- context->npc = (uintptr_t)(regs[R_nPC]);
- context->y = (uintptr_t)(regs[R_Y]);
- context->asi = (uintptr_t)(regs[36]);
- context->fprs = (uintptr_t)(regs[37]);
- for ( int i = 0 ; i < 32 ; ++i ){
- context->g_r[i] = (uintptr_t)(regs[i]);
- }
-
- return true;
-}
-#elif TARGET_CPU_X86
-bool WriteContext(MDRawContextX86 *context, prgregset_t regs,
- prfpregset_t *fp_regs) {
- if (!context || !regs)
- return false;
-
- context->context_flags = MD_CONTEXT_X86_FULL;
-
- context->cs = regs[CS];
- context->ds = regs[DS];
- context->es = regs[ES];
- context->fs = regs[FS];
- context->gs = regs[GS];
- context->ss = regs[SS];
- context->edi = regs[EDI];
- context->esi = regs[ESI];
- context->ebx = regs[EBX];
- context->edx = regs[EDX];
- context->ecx = regs[ECX];
- context->eax = regs[EAX];
- context->ebp = regs[EBP];
- context->eip = regs[EIP];
- context->esp = regs[UESP];
- context->eflags = regs[EFL];
-
- return true;
-}
-#endif /* TARGET_CPU_XXX */
-
-// Write information about a crashed Lwp.
-// When a lwp crash, kernel will write something on the stack for processing
-// signal. This makes the current stack not reliable, and our stack walker
-// won't figure out the whole call stack for this. So we write the stack at the
-// time of the crash into the minidump file, not the current stack.
-bool WriteCrashedLwpStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- const lwpstatus_t *lsp,
- MDRawThread *lwp) {
- assert(writer_args->sig_ctx != NULL);
-
- lwp->thread_id = lsp->pr_lwpid;
-
-#if TARGET_CPU_SPARC
- UntypedMDRVA memory(minidump_writer);
- if (!WriteLwpStack(writer_args->lwp_lister,
- writer_args->sig_ctx->uc_mcontext.gregs[REG_O6],
- &memory,
- &lwp->stack))
- return false;
-
- TypedMDRVA<MDRawContextSPARC> context(minidump_writer);
- if (!context.Allocate())
- return false;
- lwp->thread_context = context.location();
- memset(context.get(), 0, sizeof(MDRawContextSPARC));
- return WriteContext(context.get(), writer_args->sig_ctx);
-#elif TARGET_CPU_X86
- UntypedMDRVA memory(minidump_writer);
- if (!WriteLwpStack(writer_args->lwp_lister,
- writer_args->sig_ctx->uc_mcontext.gregs[UESP],
- &memory,
- &lwp->stack))
- return false;
-
- TypedMDRVA<MDRawContextX86> context(minidump_writer);
- if (!context.Allocate())
- return false;
- lwp->thread_context = context.location();
- memset(context.get(), 0, sizeof(MDRawContextX86));
- return WriteContext(context.get(),
- (int *)&writer_args->sig_ctx->uc_mcontext.gregs,
- &writer_args->sig_ctx->uc_mcontext.fpregs);
-#endif
-}
-
-bool WriteLwpStream(MinidumpFileWriter *minidump_writer,
- const SolarisLwp *lwp_lister,
- const lwpstatus_t *lsp, MDRawThread *lwp) {
- prfpregset_t fp_regs = lsp->pr_fpreg;
- const prgregset_t *gregs = &(lsp->pr_reg);
- UntypedMDRVA memory(minidump_writer);
-#if TARGET_CPU_SPARC
- if (!WriteLwpStack(lwp_lister,
- (*gregs)[R_SP],
- &memory,
- &lwp->stack))
- return false;
-
- // Write context
- TypedMDRVA<MDRawContextSPARC> context(minidump_writer);
- if (!context.Allocate())
- return false;
- // should be the thread_id
- lwp->thread_id = lsp->pr_lwpid;
- lwp->thread_context = context.location();
- memset(context.get(), 0, sizeof(MDRawContextSPARC));
-#elif TARGET_CPU_X86
- if (!WriteLwpStack(lwp_lister,
- (*gregs)[UESP],
- &memory,
- &lwp->stack))
- return false;
-
- // Write context
- TypedMDRVA<MDRawContextX86> context(minidump_writer);
- if (!context.Allocate())
- return false;
- // should be the thread_id
- lwp->thread_id = lsp->pr_lwpid;
- lwp->thread_context = context.location();
- memset(context.get(), 0, sizeof(MDRawContextX86));
-#endif /* TARGET_CPU_XXX */
- return WriteContext(context.get(), (int *)gregs, &fp_regs);
-}
-
-bool WriteCPUInformation(MDRawSystemInfo *sys_info) {
- struct utsname uts;
- char *major, *minor, *build;
-
- sys_info->number_of_processors = sysconf(_SC_NPROCESSORS_CONF);
- sys_info->processor_architecture = MD_CPU_ARCHITECTURE_UNKNOWN;
- if (uname(&uts) != -1) {
- // Match "i86pc" as X86 architecture.
- if (strcmp(uts.machine, "i86pc") == 0)
- sys_info->processor_architecture = MD_CPU_ARCHITECTURE_X86;
- else if (strcmp(uts.machine, "sun4u") == 0)
- sys_info->processor_architecture = MD_CPU_ARCHITECTURE_SPARC;
- }
-
- major = uts.release;
- minor = strchr(major, '.');
- *minor = '\0';
- ++minor;
- sys_info->major_version = atoi(major);
- sys_info->minor_version = atoi(minor);
-
- build = strchr(uts.version, '_');
- ++build;
- sys_info->build_number = atoi(build);
-
- return true;
-}
-
-bool WriteOSInformation(MinidumpFileWriter *minidump_writer,
- MDRawSystemInfo *sys_info) {
- sys_info->platform_id = MD_OS_SOLARIS;
-
- struct utsname uts;
- if (uname(&uts) != -1) {
- char os_version[512];
- size_t space_left = sizeof(os_version);
- memset(os_version, 0, space_left);
- const char *os_info_table[] = {
- uts.sysname,
- uts.release,
- uts.version,
- uts.machine,
- "OpenSolaris",
- NULL
- };
- for (const char **cur_os_info = os_info_table;
- *cur_os_info != NULL;
- ++cur_os_info) {
- if (cur_os_info != os_info_table && space_left > 1) {
- strcat(os_version, " ");
- --space_left;
- }
- if (space_left > strlen(*cur_os_info)) {
- strcat(os_version, *cur_os_info);
- space_left -= strlen(*cur_os_info);
- } else {
- break;
- }
- }
-
- MDLocationDescriptor location;
- if (!minidump_writer->WriteString(os_version, 0, &location))
- return false;
- sys_info->csd_version_rva = location.rva;
- }
- return true;
-}
-
-// Callback context for get writting lwp information.
-struct LwpInfoCallbackCtx {
- MinidumpFileWriter *minidump_writer;
- const WriterArgument *writer_args;
- TypedMDRVA<MDRawThreadList> *list;
- int lwp_index;
-};
-
-bool LwpInformationCallback(lwpstatus_t *lsp, void *context) {
- bool success = true;
- LwpInfoCallbackCtx *callback_context =
- static_cast<LwpInfoCallbackCtx *>(context);
-
- // The current lwp is the one to handle the crash. Ignore it.
- if (lsp->pr_lwpid != pthread_self()) {
- LwpInfoCallbackCtx *callback_context =
- static_cast<LwpInfoCallbackCtx *>(context);
- MDRawThread lwp;
- memset(&lwp, 0, sizeof(MDRawThread));
-
- if (lsp->pr_lwpid != callback_context->writer_args->crashed_lwpid ||
- callback_context->writer_args->sig_ctx == NULL) {
- success = WriteLwpStream(callback_context->minidump_writer,
- callback_context->writer_args->lwp_lister,
- lsp, &lwp);
- } else {
- success = WriteCrashedLwpStream(callback_context->minidump_writer,
- callback_context->writer_args,
- lsp, &lwp);
- }
- if (success) {
- callback_context->list->CopyIndexAfterObject(
- callback_context->lwp_index++,
- &lwp, sizeof(MDRawThread));
- }
- }
-
- return success;
-}
-
-bool WriteLwpListStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
- // Get the lwp information.
- const SolarisLwp *lwp_lister = writer_args->lwp_lister;
- int lwp_count = lwp_lister->GetLwpCount();
- if (lwp_count < 0)
- return false;
- TypedMDRVA<MDRawThreadList> list(minidump_writer);
- if (!list.AllocateObjectAndArray(lwp_count - 1, sizeof(MDRawThread)))
- return false;
- dir->stream_type = MD_THREAD_LIST_STREAM;
- dir->location = list.location();
- list.get()->number_of_threads = lwp_count - 1;
-
- LwpInfoCallbackCtx context;
- context.minidump_writer = minidump_writer;
- context.writer_args = writer_args;
- context.list = &list;
- context.lwp_index = 0;
- CallbackParam<LwpCallback> callback_param(LwpInformationCallback,
- &context);
- int written =
- lwp_lister->Lwp_iter_all(lwp_lister->getpid(), &callback_param);
- return written == lwp_count;
-}
-
-bool WriteCVRecord(MinidumpFileWriter *minidump_writer,
- MDRawModule *module,
- const char *module_path,
- char *realname) {
- TypedMDRVA<MDCVInfoPDB70> cv(minidump_writer);
-
- char path[PATH_MAX];
- const char *module_name = module_path ? module_path : "<Unknown>";
- snprintf(path, sizeof(path), "/proc/self/object/%s", module_name);
-
- size_t module_name_length = strlen(realname);
- if (!cv.AllocateObjectAndArray(module_name_length + 1, sizeof(uint8_t)))
- return false;
- if (!cv.CopyIndexAfterObject(0, realname, module_name_length))
- return false;
-
- module->cv_record = cv.location();
- MDCVInfoPDB70 *cv_ptr = cv.get();
- memset(cv_ptr, 0, sizeof(MDCVInfoPDB70));
- cv_ptr->cv_signature = MD_CVINFOPDB70_SIGNATURE;
- cv_ptr->age = 0;
-
- // Get the module identifier
- FileID file_id(path);
- unsigned char identifier[16];
-
- if (file_id.ElfFileIdentifier(identifier)) {
- cv_ptr->signature.data1 = (uint32_t)identifier[0] << 24 |
- (uint32_t)identifier[1] << 16 | (uint32_t)identifier[2] << 8 |
- (uint32_t)identifier[3];
- cv_ptr->signature.data2 = (uint32_t)identifier[4] << 8 | identifier[5];
- cv_ptr->signature.data3 = (uint32_t)identifier[6] << 8 | identifier[7];
- cv_ptr->signature.data4[0] = identifier[8];
- cv_ptr->signature.data4[1] = identifier[9];
- cv_ptr->signature.data4[2] = identifier[10];
- cv_ptr->signature.data4[3] = identifier[11];
- cv_ptr->signature.data4[4] = identifier[12];
- cv_ptr->signature.data4[5] = identifier[13];
- cv_ptr->signature.data4[6] = identifier[14];
- cv_ptr->signature.data4[7] = identifier[15];
- }
- return true;
-}
-
-struct ModuleInfoCallbackCtx {
- MinidumpFileWriter *minidump_writer;
- const WriterArgument *writer_args;
- TypedMDRVA<MDRawModuleList> *list;
- int module_index;
-};
-
-bool ModuleInfoCallback(const ModuleInfo &module_info, void *context) {
- ModuleInfoCallbackCtx *callback_context =
- static_cast<ModuleInfoCallbackCtx *>(context);
- // Skip those modules without name, or those that are not modules.
- if (strlen(module_info.name) == 0)
- return true;
-
- MDRawModule module;
- memset(&module, 0, sizeof(module));
- MDLocationDescriptor loc;
- char path[PATH_MAX];
- char buf[PATH_MAX];
- char *realname;
- int count;
-
- snprintf(path, sizeof (path), "/proc/self/path/%s", module_info.name);
- if ((count = readlink(path, buf, PATH_MAX)) < 0)
- return false;
- buf[count] = '\0';
-
- if ((realname = strrchr(buf, '/')) == NULL)
- return false;
- realname++;
-
- if (!callback_context->minidump_writer->WriteString(realname, 0, &loc))
- return false;
-
- module.base_of_image = (uint64_t)module_info.start_addr;
- module.size_of_image = module_info.size;
- module.module_name_rva = loc.rva;
-
- if (!WriteCVRecord(callback_context->minidump_writer, &module,
- module_info.name, realname))
- return false;
-
- callback_context->list->CopyIndexAfterObject(
- callback_context->module_index++, &module, MD_MODULE_SIZE);
- return true;
-}
-
-bool WriteModuleListStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
- TypedMDRVA<MDRawModuleList> list(minidump_writer);
- int module_count = writer_args->lwp_lister->GetModuleCount();
-
- if (module_count <= 0 ||
- !list.AllocateObjectAndArray(module_count, MD_MODULE_SIZE)) {
- return false;
- }
-
- dir->stream_type = MD_MODULE_LIST_STREAM;
- dir->location = list.location();
- list.get()->number_of_modules = module_count;
- ModuleInfoCallbackCtx context;
- context.minidump_writer = minidump_writer;
- context.writer_args = writer_args;
- context.list = &list;
- context.module_index = 0;
- CallbackParam<ModuleCallback> callback(ModuleInfoCallback, &context);
- return writer_args->lwp_lister->ListModules(&callback) == module_count;
-}
-
-bool WriteSystemInfoStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
- TypedMDRVA<MDRawSystemInfo> sys_info(minidump_writer);
-
- if (!sys_info.Allocate())
- return false;
-
- dir->stream_type = MD_SYSTEM_INFO_STREAM;
- dir->location = sys_info.location();
-
- return WriteCPUInformation(sys_info.get()) &&
- WriteOSInformation(minidump_writer, sys_info.get());
-}
-
-bool WriteExceptionStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
- // This happenes when this is not a crash, but a requested dump.
- if (writer_args->sig_ctx == NULL)
- return false;
-
- TypedMDRVA<MDRawExceptionStream> exception(minidump_writer);
- if (!exception.Allocate())
- return false;
-
- dir->stream_type = MD_EXCEPTION_STREAM;
- dir->location = exception.location();
- exception.get()->thread_id = writer_args->crashed_lwpid;
- exception.get()->exception_record.exception_code = writer_args->signo;
- exception.get()->exception_record.exception_flags = 0;
-
-#if TARGET_CPU_SPARC
- if (writer_args->sig_ctx != NULL) {
- exception.get()->exception_record.exception_address =
- writer_args->sig_ctx->uc_mcontext.gregs[REG_PC];
- } else {
- return true;
- }
-
- // Write context of the exception.
- TypedMDRVA<MDRawContextSPARC> context(minidump_writer);
- if (!context.Allocate())
- return false;
- exception.get()->thread_context = context.location();
- memset(context.get(), 0, sizeof(MDRawContextSPARC));
- return WriteContext(context.get(), writer_args->sig_ctx);
-#elif TARGET_CPU_X86
- if (writer_args->sig_ctx != NULL) {
- exception.get()->exception_record.exception_address =
- writer_args->sig_ctx->uc_mcontext.gregs[EIP];
- } else {
- return true;
- }
-
- // Write context of the exception.
- TypedMDRVA<MDRawContextX86> context(minidump_writer);
- if (!context.Allocate())
- return false;
- exception.get()->thread_context = context.location();
- memset(context.get(), 0, sizeof(MDRawContextX86));
- return WriteContext(context.get(),
- (int *)&writer_args->sig_ctx->uc_mcontext.gregs,
- NULL);
-#endif
-}
-
-bool WriteMiscInfoStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
- TypedMDRVA<MDRawMiscInfo> info(minidump_writer);
-
- if (!info.Allocate())
- return false;
-
- dir->stream_type = MD_MISC_INFO_STREAM;
- dir->location = info.location();
- info.get()->size_of_info = sizeof(MDRawMiscInfo);
- info.get()->flags1 = MD_MISCINFO_FLAGS1_PROCESS_ID;
- info.get()->process_id = writer_args->requester_pid;
-
- return true;
-}
-
-bool WriteBreakpadInfoStream(MinidumpFileWriter *minidump_writer,
- const WriterArgument *writer_args,
- MDRawDirectory *dir) {
- TypedMDRVA<MDRawBreakpadInfo> info(minidump_writer);
-
- if (!info.Allocate())
- return false;
-
- dir->stream_type = MD_BREAKPAD_INFO_STREAM;
- dir->location = info.location();
-
- info.get()->validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID |
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID;
- info.get()->dump_thread_id = getpid();
- info.get()->requesting_thread_id = writer_args->requester_pid;
- return true;
-}
-
-class AutoLwpResumer {
- public:
- AutoLwpResumer(SolarisLwp *lwp) : lwp_(lwp) {}
- ~AutoLwpResumer() { lwp_->ControlAllLwps(false); }
- private:
- SolarisLwp *lwp_;
-};
-
-// Prototype of writer functions.
-typedef bool (*WriteStreamFN)(MinidumpFileWriter *,
- const WriterArgument *,
- MDRawDirectory *);
-
-// Function table to writer a full minidump.
-const WriteStreamFN writers[] = {
- WriteLwpListStream,
- WriteModuleListStream,
- WriteSystemInfoStream,
- WriteExceptionStream,
- WriteMiscInfoStream,
- WriteBreakpadInfoStream,
-};
-
-// Will call each writer function in the writers table.
-//void* MinidumpGenerator::Write(void *argument) {
-void* Write(void *argument) {
- WriterArgument *writer_args = static_cast<WriterArgument *>(argument);
-
- if (!writer_args->lwp_lister->ControlAllLwps(true))
- return NULL;
-
- AutoLwpResumer lwpResumer(writer_args->lwp_lister);
-
- if (writer_args->sighandler_ebp != 0 &&
- writer_args->lwp_lister->FindSigContext(writer_args->sighandler_ebp,
- &writer_args->sig_ctx)) {
- writer_args->crashed_stack_bottom =
- writer_args->lwp_lister->GetLwpStackBottom(
-#if TARGET_CPU_SPARC
- writer_args->sig_ctx->uc_mcontext.gregs[REG_O6]
-#elif TARGET_CPU_X86
- writer_args->sig_ctx->uc_mcontext.gregs[UESP]
-#endif
- );
-
- int crashed_lwpid = FindCrashingLwp(writer_args->crashed_stack_bottom,
- writer_args->requester_pid,
- writer_args->lwp_lister);
- if (crashed_lwpid > 0)
- writer_args->crashed_lwpid = crashed_lwpid;
- }
-
- MinidumpFileWriter *minidump_writer = writer_args->minidump_writer;
- TypedMDRVA<MDRawHeader> header(minidump_writer);
- TypedMDRVA<MDRawDirectory> dir(minidump_writer);
- if (!header.Allocate())
- return 0;
-
- int writer_count = sizeof(writers) / sizeof(writers[0]);
- // Need directory space for all writers.
- if (!dir.AllocateArray(writer_count))
- return 0;
- header.get()->signature = MD_HEADER_SIGNATURE;
- header.get()->version = MD_HEADER_VERSION;
- header.get()->time_date_stamp = time(NULL);
- header.get()->stream_count = writer_count;
- header.get()->stream_directory_rva = dir.position();
-
- int dir_index = 0;
- MDRawDirectory local_dir;
- for (int i = 0; i < writer_count; ++i) {
- if ((*writers[i])(minidump_writer, writer_args, &local_dir))
- dir.CopyIndex(dir_index++, &local_dir);
- }
-
- return 0;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-MinidumpGenerator::MinidumpGenerator() {
-}
-
-MinidumpGenerator::~MinidumpGenerator() {
-}
-
-// Write minidump into file.
-// It runs in a different thread from the crashing thread.
-bool MinidumpGenerator::WriteMinidumpToFile(const char *file_pathname,
- int signo,
- uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) const {
- // The exception handler thread.
- pthread_t handler_thread;
-
- assert(file_pathname != NULL);
-
- if (file_pathname == NULL)
- return false;
-
- MinidumpFileWriter minidump_writer;
- if (minidump_writer.Open(file_pathname)) {
- WriterArgument argument;
- memset(&argument, 0, sizeof(argument));
- SolarisLwp lwp_lister(getpid());
- argument.lwp_lister = &lwp_lister;
- argument.minidump_writer = &minidump_writer;
- argument.requester_pid = getpid();
- argument.crashed_lwpid = pthread_self();
- argument.signo = signo;
- argument.sighandler_ebp = sighandler_ebp;
- argument.sig_ctx = NULL;
-
- pthread_create(&handler_thread, NULL, Write, (void *)&argument);
- pthread_join(handler_thread, NULL);
- return true;
- }
-
- return false;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.h b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.h
deleted file mode 100644
index 882f9e1de5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_generator.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#ifndef CLIENT_SOLARIS_HANDLER_MINIDUMP_GENERATOR_H__
-#define CLIENT_SOLARIS_HANDLER_MINIDUMP_GENERATOR_H__
-
-#include <ucontext.h>
-
-#include "client/minidump_file_writer.h"
-#include "client/solaris/handler/solaris_lwp.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-//
-// MinidumpGenerator
-//
-// A minidump generator should be created before any exception happen.
-//
-class MinidumpGenerator {
- // Callback run for writing lwp information in the process.
- friend bool LwpInformationCallback(lwpstatus_t *lsp, void *context);
-
- // Callback run for writing module information in the process.
- friend bool ModuleInfoCallback(const ModuleInfo &module_info, void *context);
-
- public:
- MinidumpGenerator();
-
- ~MinidumpGenerator();
-
- // Write minidump.
- bool WriteMinidumpToFile(const char *file_pathname,
- int signo,
- uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) const;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_SOLARIS_HANDLER_MINIDUMP_GENERATOR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_test.cc b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_test.cc
deleted file mode 100644
index 33302d86ab..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/minidump_test.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <pthread.h>
-#include <unistd.h>
-
-#include "client/minidump_file_writer.h"
-#include "client/solaris/handler/minidump_generator.h"
-
-using std::string;
-using google_breakpad::MinidumpGenerator;
-
-static bool doneWritingReport = false;
-
-static void *Reporter(void *) {
- char buffer[PATH_MAX];
- MinidumpGenerator md;
-
- // Write it to the desktop
- snprintf(buffer, sizeof(buffer), "./minidump_test.out");
- fprintf(stdout, "Writing %s\n", buffer);
-
- md.WriteMinidumpToFile(buffer, 0, 0, NULL);
- doneWritingReport = true;
-
- return NULL;
-}
-
-static void SleepyFunction() {
- while (!doneWritingReport) {
- usleep(100);
- }
-}
-
-int main(int argc, char * const argv[]) {
- pthread_t reporter_thread;
-
- if (pthread_create(&reporter_thread, NULL, Reporter, NULL) == 0) {
- pthread_detach(reporter_thread);
- } else {
- perror("pthread_create");
- }
-
- SleepyFunction();
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
deleted file mode 100644
index 3442ac0f88..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- 'exception_handler.cc',
- 'minidump_generator.cc',
- 'solaris_lwp.cc',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '../../..',
-]
-
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.cc b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.cc
deleted file mode 100644
index 0148997ad4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.cc
+++ /dev/null
@@ -1,436 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <dirent.h>
-#include <elf.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <sys/frame.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <algorithm>
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <functional>
-
-#include "client/solaris/handler/solaris_lwp.h"
-#include "common/solaris/message_output.h"
-
-using namespace google_breakpad;
-
-// This unamed namespace contains helper function.
-namespace {
-
-uintptr_t stack_base_address = 0;
-static const int HEADER_MAX = 2000;
-static const int MAP_MAX = 1000;
-
-// Context information for the callbacks when validating address by listing
-// modules.
-struct AddressValidatingContext {
- uintptr_t address;
- bool is_mapped;
-
- AddressValidatingContext() : address(0UL), is_mapped(false) {
- }
-};
-
-// Convert from string to int.
-static bool LocalAtoi(char *s, int *r) {
- assert(s != NULL);
- assert(r != NULL);
- char *endptr = NULL;
- int ret = strtol(s, &endptr, 10);
- if (endptr == s)
- return false;
- *r = ret;
- return true;
-}
-
-// Callback invoked for each mapped module.
-// It uses the module's adderss range to validate the address.
-static bool AddressNotInModuleCallback(const ModuleInfo &module_info,
- void *context) {
- AddressValidatingContext *addr =
- reinterpret_cast<AddressValidatingContext *>(context);
- if (addr->is_mapped = ((module_info.start_addr > 0) &&
- (addr->address >= module_info.start_addr) &&
- (addr->address <= module_info.start_addr +
- module_info.size))) {
- stack_base_address = module_info.start_addr + module_info.size;
- }
-
- return !addr->is_mapped;
-}
-
-static int IterateLwpAll(int pid,
- CallbackParam<LwpidCallback> *callback_param) {
- char lwp_path[40];
- DIR *dir;
- int count = 0;
-
- snprintf(lwp_path, sizeof (lwp_path), "/proc/%d/lwp", (int)pid);
- if ((dir = opendir(lwp_path)) == NULL)
- return -1;
-
- struct dirent *entry = NULL;
- while ((entry = readdir(dir)) != NULL) {
- if ((strcmp(entry->d_name, ".") != 0) &&
- (strcmp(entry->d_name, "..") != 0)) {
- int lwpid = 0;
- int last_pid = 0;
- if (LocalAtoi(entry->d_name, &lwpid) && last_pid != lwpid) {
- last_pid = lwpid;
- ++count;
- if (callback_param &&
- !(callback_param->call_back)(lwpid, callback_param->context)) {
- break;
- }
- }
- }
- }
-
- closedir(dir);
- return count;
-}
-
-#if defined(__i386) && !defined(NO_FRAME_POINTER)
-void *GetNextFrame(void **last_ebp) {
- void *sp = *last_ebp;
- if ((unsigned long)sp == (unsigned long)last_ebp)
- return NULL;
- if ((unsigned long)sp & (sizeof(void *) - 1))
- return NULL;
- if ((unsigned long)sp - (unsigned long)last_ebp > 100000)
- return NULL;
- return sp;
-}
-#elif defined(__sparc)
-void *GetNextFrame(void *last_ebp) {
- return reinterpret_cast<struct frame *>(last_ebp)->fr_savfp;
-}
-#else
-void *GetNextFrame(void **last_ebp) {
- return reinterpret_cast<void*>(last_ebp);
-}
-#endif
-
-
-class AutoCloser {
- public:
- AutoCloser(int fd) : fd_(fd) {}
- ~AutoCloser() { if (fd_) close(fd_); }
- private:
- int fd_;
-};
-
-// Control the execution of the lwp.
-// Suspend/Resume lwp based on the value of context.
-static bool ControlLwp(int lwpid, void *context) {
- // The current thread is the one to handle the crash. Ignore it.
- if (lwpid != pthread_self()) {
- int ctlfd;
- char procname[PATH_MAX];
- bool suspend = *(bool *)context;
-
- // Open the /proc/$pid/lwp/$lwpid/lwpctl files
- snprintf(procname, sizeof (procname), "/proc/self/lwp/%d/lwpctl", lwpid);
-
- if ((ctlfd = open(procname, O_WRONLY|O_EXCL)) < 0) {
- print_message2(2, "failed to open %s in ControlLwp\n", procname);
- return false;
- }
-
- AutoCloser autocloser(ctlfd);
-
- long ctl[2];
- ctl[0] = suspend ? PCSTOP : PCRUN;
- ctl[1] = 0;
- if (write(ctlfd, ctl, sizeof (ctl)) != sizeof (ctl)) {
- print_message2(2, "failed in lwp %d\n", lwpid);
- return false;
- }
- }
-
- return true;
-}
-
-/*
- * Utility function to read the contents of a file that contains a
- * prheader_t at the start (/proc/$pid/lstatus or /proc/$pid/lpsinfo).
- * Return true on success.
- */
-static bool read_lfile(int pid, const char *lname, prheader_t *lhp) {
- char lpath[PATH_MAX];
- struct stat statb;
- int fd;
- size_t size;
-
- snprintf(lpath, sizeof (lpath), "/proc/%d/%s", pid, lname);
- if ((fd = open(lpath, O_RDONLY)) < 0) {
- print_message2(2, "failed to open %s in read_lfile\n", lpath);
- return false;
- }
-
- AutoCloser autocloser(fd);
-
- if (fstat(fd, &statb) != 0)
- return false;
-
- size = statb.st_size;
- if ((size / sizeof (prheader_t)) + 32 > HEADER_MAX) {
- print_message1(2, "map size overflow\n");
- return false;
- }
-
- if (pread(fd, lhp, size, 0) <= sizeof (prheader_t))
- return false;
-
- return true;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-SolarisLwp::SolarisLwp(int pid) : pid_(pid) {
-}
-
-SolarisLwp::~SolarisLwp() {
-}
-
-int SolarisLwp::ControlAllLwps(bool suspend) {
- CallbackParam<LwpidCallback> callback_param(ControlLwp, &suspend);
- return IterateLwpAll(pid_, &callback_param);
-}
-
-int SolarisLwp::GetLwpCount() const {
- return IterateLwpAll(pid_, NULL);
-}
-
-int SolarisLwp::Lwp_iter_all(int pid,
- CallbackParam<LwpCallback> *callback_param) const {
- lwpstatus_t *Lsp;
- lwpstatus_t *sp;
- prheader_t lphp[HEADER_MAX];
- prheader_t lhp[HEADER_MAX];
- prheader_t *Lphp = lphp;
- prheader_t *Lhp = lhp;
- lwpsinfo_t *Lpsp;
- long nstat;
- long ninfo;
- int rv = 0;
-
- /*
- * The /proc/pid/lstatus file has the array of lwpstatus_t's and the
- * /proc/pid/lpsinfo file has the array of lwpsinfo_t's.
- */
- if (read_lfile(pid, "lstatus", Lhp) == NULL)
- return -1;
- if (read_lfile(pid, "lpsinfo", Lphp) == NULL) {
- return -1;
- }
-
- Lsp = (lwpstatus_t *)(uintptr_t)(Lhp + 1);
- Lpsp = (lwpsinfo_t *)(uintptr_t)(Lphp + 1);
-
- for (ninfo = Lphp->pr_nent; ninfo != 0; --ninfo) {
- if (Lpsp->pr_sname != 'Z') {
- sp = Lsp;
- Lsp = (lwpstatus_t *)((uintptr_t)Lsp + Lhp->pr_entsize);
- } else {
- sp = NULL;
- }
- if (callback_param &&
- !(callback_param->call_back)(sp, callback_param->context))
- break;
- ++rv;
- Lpsp = (lwpsinfo_t *)((uintptr_t)Lpsp + Lphp->pr_entsize);
- }
-
- return rv;
-}
-
-uintptr_t SolarisLwp::GetLwpStackBottom(uintptr_t current_esp) const {
- AddressValidatingContext addr;
- addr.address = current_esp;
- CallbackParam<ModuleCallback> callback_param(AddressNotInModuleCallback,
- &addr);
- ListModules(&callback_param);
- return stack_base_address;
-}
-
-int SolarisLwp::GetModuleCount() const {
- return ListModules(NULL);
-}
-
-int SolarisLwp::ListModules(
- CallbackParam<ModuleCallback> *callback_param) const {
- const char *maps_path = "/proc/self/map";
- struct stat status;
- int fd = 0, num;
- prmap_t map_array[MAP_MAX];
- prmap_t *maps = map_array;
- size_t size;
-
- if ((fd = open(maps_path, O_RDONLY)) == -1) {
- print_message2(2, "failed to open %s in ListModules\n", maps_path);
- return -1;
- }
-
- AutoCloser autocloser(fd);
-
- if (fstat(fd, &status))
- return -1;
-
- /*
- * Determine number of mappings, this value must be
- * larger than the actual module count
- */
- size = status.st_size;
- if ((num = (int)(size / sizeof (prmap_t))) > MAP_MAX) {
- print_message1(2, "map size overflow\n");
- return -1;
- }
-
- if (read(fd, (void *)maps, size) < 0) {
- print_message2(2, "failed to read %d\n", fd);
- return -1;
- }
-
- prmap_t *_maps;
- int _num;
- int module_count = 0;
-
- /*
- * Scan each mapping - note it is assummed that the mappings are
- * presented in order. We fill holes between mappings. On intel
- * the last mapping is usually the data segment of ld.so.1, after
- * this comes a red zone into which non-fixed mapping won't get
- * place. Thus we can simply bail from the loop after seeing the
- * last mapping.
- */
- for (_num = 0, _maps = maps; _num < num; ++_num, ++_maps) {
- ModuleInfo module;
- char *name = _maps->pr_mapname;
-
- memset(&module, 0, sizeof (module));
- module.start_addr = _maps->pr_vaddr;
- module.size = _maps->pr_size;
- if (strlen(name) > 0) {
- int objectfd = 0;
- char path[PATH_MAX];
- char buf[SELFMAG];
-
- snprintf(path, sizeof (path), "/proc/self/object/%s", name);
- if ((objectfd = open(path, O_RDONLY)) < 0) {
- print_message1(2, "can't open module file\n");
- continue;
- }
-
- AutoCloser autocloser(objectfd);
-
- if (read(objectfd, buf, SELFMAG) != SELFMAG) {
- print_message1(2, "can't read module file\n");
- continue;
- }
- if (buf[0] != ELFMAG0 || buf[1] != ELFMAG1 ||
- buf[2] != ELFMAG2 || buf[3] != ELFMAG3) {
- continue;
- }
-
- strncpy(module.name, name, sizeof (module.name) - 1);
- ++module_count;
- }
- if (callback_param &&
- (!callback_param->call_back(module, callback_param->context))) {
- break;
- }
- }
-
- return module_count;
-}
-
-// Check if the address is a valid virtual address.
-// If the address is in any of the mapped modules, we take it as valid.
-// Otherwise it is invalid.
-bool SolarisLwp::IsAddressMapped(uintptr_t address) const {
- AddressValidatingContext addr;
- addr.address = address;
- CallbackParam<ModuleCallback> callback_param(AddressNotInModuleCallback,
- &addr);
- ListModules(&callback_param);
- return addr.is_mapped;
-}
-
-// We're looking for a ucontext_t as the second parameter
-// to a signal handler function call. Luckily, the ucontext_t
-// has an ebp(fp on SPARC) member which should match the ebp(fp)
-// pointed to by the ebp(fp) of the signal handler frame.
-// The Solaris stack looks like this:
-// http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libproc/common/Pstack.c#81
-bool SolarisLwp::FindSigContext(uintptr_t sighandler_ebp,
- ucontext_t **sig_ctx) {
- uintptr_t previous_ebp;
- uintptr_t sig_ebp;
- const int MAX_STACK_DEPTH = 50;
- int depth_counter = 0;
-
- do {
-#if TARGET_CPU_SPARC
- previous_ebp = reinterpret_cast<uintptr_t>(GetNextFrame(
- reinterpret_cast<void*>(sighandler_ebp)));
- *sig_ctx = reinterpret_cast<ucontext_t*>(sighandler_ebp + sizeof (struct frame));
- uintptr_t sig_esp = (*sig_ctx)->uc_mcontext.gregs[REG_O6];
- if (sig_esp < previous_ebp && sig_esp > sighandler_ebp)
- sig_ebp = (uintptr_t)(((struct frame *)sig_esp)->fr_savfp);
-
-#elif TARGET_CPU_X86
- previous_ebp = reinterpret_cast<uintptr_t>(GetNextFrame(
- reinterpret_cast<void**>(sighandler_ebp)));
- *sig_ctx = reinterpret_cast<ucontext_t*>(sighandler_ebp + sizeof (struct frame) +
- 3 * sizeof(uintptr_t));
- sig_ebp = (*sig_ctx)->uc_mcontext.gregs[EBP];
-#endif
- sighandler_ebp = previous_ebp;
- depth_counter++;
- } while(previous_ebp != sig_ebp && sighandler_ebp != 0 &&
- IsAddressMapped(sighandler_ebp) && depth_counter < MAX_STACK_DEPTH);
-
- return previous_ebp == sig_ebp && previous_ebp != 0;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.h b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.h
deleted file mode 100644
index 0914cfcd87..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/solaris_lwp.h
+++ /dev/null
@@ -1,160 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#ifndef CLIENT_SOLARIS_HANDLER_SOLARIS_LWP_H__
-#define CLIENT_SOLARIS_HANDLER_SOLARIS_LWP_H__
-
-#if defined(sparc) || defined(__sparc)
-#define TARGET_CPU_SPARC 1
-#elif defined(i386) || defined(__i386)
-#define TARGET_CPU_X86 1
-#else
-#error "cannot determine cpu type"
-#endif
-
-#include <signal.h>
-#include <stdint.h>
-#include <sys/user.h>
-#include <ucontext.h>
-
-#ifndef _KERNEL
-#define _KERNEL
-#define MUST_UNDEF_KERNEL
-#endif // _KERNEL
-#include <sys/procfs.h>
-#ifdef MUST_UNDEF_KERNEL
-#undef _KERNEL
-#undef MUST_UNDEF_KERNEL
-#endif // MUST_UNDEF_KERNEL
-
-namespace google_breakpad {
-
-// Max module path name length.
-static const int kMaxModuleNameLength = 256;
-
-// Holding infomaton about a module in the process.
-struct ModuleInfo {
- char name[kMaxModuleNameLength];
- uintptr_t start_addr;
- int size;
-};
-
-// A callback to run when getting a lwp in the process.
-// Return true will go on to the next lwp while return false will stop the
-// iteration.
-typedef bool (*LwpCallback)(lwpstatus_t* lsp, void *context);
-
-// A callback to run when a new module is found in the process.
-// Return true will go on to the next module while return false will stop the
-// iteration.
-typedef bool (*ModuleCallback)(const ModuleInfo &module_info, void *context);
-
-// A callback to run when getting a lwpid in the process.
-// Return true will go on to the next lwp while return false will stop the
-// iteration.
-typedef bool (*LwpidCallback)(int lwpid, void *context);
-
-// Holding the callback information.
-template<class CallbackFunc>
-struct CallbackParam {
- // Callback function address.
- CallbackFunc call_back;
- // Callback context;
- void *context;
-
- CallbackParam() : call_back(NULL), context(NULL) {
- }
-
- CallbackParam(CallbackFunc func, void *func_context) :
- call_back(func), context(func_context) {
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
-//
-// SolarisLwp
-//
-// Provides handy support for operation on Solaris lwps.
-// It uses proc file system to get lwp information.
-//
-// TODO(Alfred): Currently it only supports x86. Add SPARC support.
-//
-class SolarisLwp {
- public:
- // Create a SolarisLwp instance to list all the lwps in a process.
- explicit SolarisLwp(int pid);
- ~SolarisLwp();
-
- int getpid() const { return this->pid_; }
-
- // Control all the lwps in the process.
- // Return the number of suspended/resumed lwps in the process.
- // Return -1 means failed to control lwps.
- int ControlAllLwps(bool suspend);
-
- // Get the count of lwps in the process.
- // Return -1 means error.
- int GetLwpCount() const;
-
- // Iterate the lwps of process.
- // Whenever there is a lwp found, the callback will be invoked to process
- // the information.
- // Return the callback return value or -1 on error.
- int Lwp_iter_all(int pid, CallbackParam<LwpCallback> *callback_param) const;
-
- // Get the module count of the current process.
- int GetModuleCount() const;
-
- // Get the mapped modules in the address space.
- // Whenever a module is found, the callback will be invoked to process the
- // information.
- // Return how may modules are found.
- int ListModules(CallbackParam<ModuleCallback> *callback_param) const;
-
- // Get the bottom of the stack from esp.
- uintptr_t GetLwpStackBottom(uintptr_t current_esp) const;
-
- // Finds a signal context on the stack given the ebp of our signal handler.
- bool FindSigContext(uintptr_t sighandler_ebp, ucontext_t **sig_ctx);
-
- private:
- // Check if the address is a valid virtual address.
- bool IsAddressMapped(uintptr_t address) const;
-
- private:
- // The pid of the process we are listing lwps.
- int pid_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_SOLARIS_HANDLER_SOLARIS_LWP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/breakpad_client.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/breakpad_client.gyp
deleted file mode 100644
index 6479753428..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/breakpad_client.gyp
+++ /dev/null
@@ -1,66 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'build_all',
- 'type': 'none',
- 'dependencies': [
- './crash_generation/crash_generation.gyp:*',
- './handler/exception_handler.gyp:*',
- './sender/crash_report_sender.gyp:*',
- './unittests/client_tests.gyp:*',
- './unittests/testing.gyp:*',
- './tests/crash_generation_app/crash_generation_app.gyp:*',
- ]
- },
- {
- 'target_name': 'common',
- 'type': 'static_library',
- 'include_dirs': [
- '<(DEPTH)',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(DEPTH)',
- ]
- },
- 'sources': [
- '<(DEPTH)/common/windows/guid_string.cc',
- '<(DEPTH)/common/windows/guid_string.h',
- '<(DEPTH)/common/windows/http_upload.cc',
- '<(DEPTH)/common/windows/http_upload.h',
- '<(DEPTH)/common/windows/string_utils.cc',
- ]
- }
- ]
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/common/auto_critical_section.h b/toolkit/crashreporter/google-breakpad/src/client/windows/common/auto_critical_section.h
deleted file mode 100644
index 3fd4b9b7e6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/common/auto_critical_section.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_COMMON_AUTO_CRITICAL_SECTION_H__
-#define CLIENT_WINDOWS_COMMON_AUTO_CRITICAL_SECTION_H__
-
-#include <windows.h>
-
-namespace google_breakpad {
-
-// Automatically enters the critical section in the constructor and leaves
-// the critical section in the destructor.
-class AutoCriticalSection {
- public:
- // Creates a new instance with the given critical section object
- // and enters the critical section immediately.
- explicit AutoCriticalSection(CRITICAL_SECTION* cs) : cs_(cs), taken_(false) {
- assert(cs_);
- Acquire();
- }
-
- // Destructor: leaves the critical section.
- ~AutoCriticalSection() {
- if (taken_) {
- Release();
- }
- }
-
- // Enters the critical section. Recursive Acquire() calls are not allowed.
- void Acquire() {
- assert(!taken_);
- EnterCriticalSection(cs_);
- taken_ = true;
- }
-
- // Leaves the critical section. The caller should not call Release() unless
- // the critical seciton has been entered already.
- void Release() {
- assert(taken_);
- taken_ = false;
- LeaveCriticalSection(cs_);
- }
-
- private:
- // Disable copy ctor and operator=.
- AutoCriticalSection(const AutoCriticalSection&);
- AutoCriticalSection& operator=(const AutoCriticalSection&);
-
- CRITICAL_SECTION* cs_;
- bool taken_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_COMMON_AUTO_CRITICAL_SECTION_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/common/ipc_protocol.h b/toolkit/crashreporter/google-breakpad/src/client/windows/common/ipc_protocol.h
deleted file mode 100644
index c74868198c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/common/ipc_protocol.h
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__
-#define CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__
-
-#include <windows.h>
-#include <dbghelp.h>
-#include <string>
-#include <utility>
-#include "common/windows/string_utils-inl.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// Name/value pair for custom client information.
-struct CustomInfoEntry {
- // Maximum length for name and value for client custom info.
- static const int kNameMaxLength = 64;
- static const int kValueMaxLength = 64;
-
- CustomInfoEntry() {
- // Putting name and value in initializer list makes VC++ show warning 4351.
- set_name(NULL);
- set_value(NULL);
- }
-
- CustomInfoEntry(const wchar_t* name_arg, const wchar_t* value_arg) {
- set_name(name_arg);
- set_value(value_arg);
- }
-
- void set_name(const wchar_t* name_arg) {
- if (!name_arg) {
- name[0] = L'\0';
- return;
- }
- WindowsStringUtils::safe_wcscpy(name, kNameMaxLength, name_arg);
- }
-
- void set_value(const wchar_t* value_arg) {
- if (!value_arg) {
- value[0] = L'\0';
- return;
- }
-
- WindowsStringUtils::safe_wcscpy(value, kValueMaxLength, value_arg);
- }
-
- void set(const wchar_t* name_arg, const wchar_t* value_arg) {
- set_name(name_arg);
- set_value(value_arg);
- }
-
- wchar_t name[kNameMaxLength];
- wchar_t value[kValueMaxLength];
-};
-
-// Constants for the protocol between client and the server.
-
-// Tags sent with each message indicating the purpose of
-// the message.
-enum MessageTag {
- MESSAGE_TAG_NONE = 0,
- MESSAGE_TAG_REGISTRATION_REQUEST = 1,
- MESSAGE_TAG_REGISTRATION_RESPONSE = 2,
- MESSAGE_TAG_REGISTRATION_ACK = 3,
- MESSAGE_TAG_UPLOAD_REQUEST = 4
-};
-
-struct CustomClientInfo {
- const CustomInfoEntry* entries;
- size_t count;
-};
-
-// Message structure for IPC between crash client and crash server.
-struct ProtocolMessage {
- ProtocolMessage()
- : tag(MESSAGE_TAG_NONE),
- id(0),
- dump_type(MiniDumpNormal),
- thread_id(0),
- exception_pointers(NULL),
- assert_info(NULL),
- custom_client_info(),
- dump_request_handle(NULL),
- dump_generated_handle(NULL),
- server_alive_handle(NULL) {
- }
-
- // Creates an instance with the given parameters.
- ProtocolMessage(MessageTag arg_tag,
- DWORD arg_id,
- MINIDUMP_TYPE arg_dump_type,
- DWORD* arg_thread_id,
- EXCEPTION_POINTERS** arg_exception_pointers,
- MDRawAssertionInfo* arg_assert_info,
- const CustomClientInfo& custom_info,
- HANDLE arg_dump_request_handle,
- HANDLE arg_dump_generated_handle,
- HANDLE arg_server_alive)
- : tag(arg_tag),
- id(arg_id),
- dump_type(arg_dump_type),
- thread_id(arg_thread_id),
- exception_pointers(arg_exception_pointers),
- assert_info(arg_assert_info),
- custom_client_info(custom_info),
- dump_request_handle(arg_dump_request_handle),
- dump_generated_handle(arg_dump_generated_handle),
- server_alive_handle(arg_server_alive) {
- }
-
- // Tag in the message.
- MessageTag tag;
-
- // The id for this message. This may be either a process id or a crash id
- // depending on the type of message.
- DWORD id;
-
- // Dump type requested.
- MINIDUMP_TYPE dump_type;
-
- // Client thread id pointer.
- DWORD* thread_id;
-
- // Exception information.
- EXCEPTION_POINTERS** exception_pointers;
-
- // Assert information in case of an invalid parameter or
- // pure call failure.
- MDRawAssertionInfo* assert_info;
-
- // Custom client information.
- CustomClientInfo custom_client_info;
-
- // Handle to signal the crash event.
- HANDLE dump_request_handle;
-
- // Handle to check if server is done generating crash.
- HANDLE dump_generated_handle;
-
- // Handle to a mutex that becomes signaled (WAIT_ABANDONED)
- // if server process goes down.
- HANDLE server_alive_handle;
-
- private:
- // Disable copy ctor and operator=.
- ProtocolMessage(const ProtocolMessage& msg);
- ProtocolMessage& operator=(const ProtocolMessage& msg);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_COMMON_IPC_PROTOCOL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/ReadMe.txt b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/ReadMe.txt
deleted file mode 100644
index b54d0e11b7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/ReadMe.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-=========================================================================
- State machine transitions for the Crash Generation Server
-=========================================================================
-
-=========================================================================
- |
- STATE | ACTIONS
- |
-=========================================================================
- ERROR | Clean up resources used to serve clients.
- | Always remain in ERROR state.
--------------------------------------------------------------------------
- INITIAL | Connect to the pipe asynchronously.
- | If connection is successfully queued up asynchronously,
- | go into CONNECTING state.
- | If connection is done synchronously, go into CONNECTED
- | state.
- | For any unexpected problems, go into ERROR state.
--------------------------------------------------------------------------
- CONNECTING | Get the result of async connection request.
- | If I/O is still incomplete, remain in the CONNECTING
- | state.
- | If connection is complete, go into CONNECTED state.
- | For any unexpected problems, go into DISCONNECTING state.
--------------------------------------------------------------------------
- CONNECTED | Read from the pipe asynchronously.
- | If read request is successfully queued up asynchronously,
- | go into READING state.
- | For any unexpected problems, go into DISCONNECTING state.
--------------------------------------------------------------------------
- READING | Get the result of async read request.
- | If read is done, go into READ_DONE state.
- | For any unexpected problems, go into DISCONNECTING state.
--------------------------------------------------------------------------
- READ_DONE | Register the client, prepare the reply and write the
- | reply to the pipe asynchronously.
- | If write request is successfully queued up asynchronously,
- | go into WRITING state.
- | For any unexpected problems, go into DISCONNECTING state.
--------------------------------------------------------------------------
- WRITING | Get the result of the async write request.
- | If write is done, go into WRITE_DONE state.
- | For any unexpected problems, go into DISCONNECTING state.
--------------------------------------------------------------------------
- WRITE_DONE | Read from the pipe asynchronously (for an ACK).
- | If read request is successfully queued up asynchonously,
- | go into READING_ACK state.
- | For any unexpected problems, go into DISCONNECTING state.
--------------------------------------------------------------------------
- READING_ACK | Get the result of the async read request.
- | If read is done, perform action for successful client
- | connection.
- | Go into DISCONNECTING state.
--------------------------------------------------------------------------
- DISCONNECTING | Disconnect from the pipe, reset the event and go into
- | INITIAL state and signal the event again. If anything
- | fails, go into ERROR state.
-=========================================================================
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.cc
deleted file mode 100644
index ed31263811..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/windows/crash_generation/client_info.h"
-#include "client/windows/common/ipc_protocol.h"
-
-static const wchar_t kCustomInfoProcessUptimeName[] = L"ptime";
-static const size_t kMaxCustomInfoEntries = 4096;
-
-namespace google_breakpad {
-
-ClientInfo::ClientInfo(CrashGenerationServer* crash_server,
- DWORD pid,
- MINIDUMP_TYPE dump_type,
- DWORD* thread_id,
- EXCEPTION_POINTERS** ex_info,
- MDRawAssertionInfo* assert_info,
- const CustomClientInfo& custom_client_info)
- : crash_server_(crash_server),
- pid_(pid),
- dump_type_(dump_type),
- ex_info_(ex_info),
- assert_info_(assert_info),
- custom_client_info_(custom_client_info),
- thread_id_(thread_id),
- process_handle_(NULL),
- dump_requested_handle_(NULL),
- dump_generated_handle_(NULL),
- dump_request_wait_handle_(NULL),
- process_exit_wait_handle_(NULL),
- crash_id_(NULL) {
- GetSystemTimeAsFileTime(&start_time_);
-}
-
-bool ClientInfo::Initialize() {
- process_handle_ = OpenProcess(GENERIC_ALL, FALSE, pid_);
- if (!process_handle_) {
- return false;
- }
-
- // The crash_id will be the low order word of the process creation time.
- FILETIME creation_time, exit_time, kernel_time, user_time;
- if (GetProcessTimes(process_handle_, &creation_time, &exit_time,
- &kernel_time, &user_time)) {
- start_time_ = creation_time;
- }
- crash_id_ = start_time_.dwLowDateTime;
-
- dump_requested_handle_ = CreateEvent(NULL, // Security attributes.
- TRUE, // Manual reset.
- FALSE, // Initial state.
- NULL); // Name.
- if (!dump_requested_handle_) {
- return false;
- }
-
- dump_generated_handle_ = CreateEvent(NULL, // Security attributes.
- TRUE, // Manual reset.
- FALSE, // Initial state.
- NULL); // Name.
- return dump_generated_handle_ != NULL;
-}
-
-void ClientInfo::UnregisterDumpRequestWaitAndBlockUntilNoPending() {
- if (dump_request_wait_handle_) {
- // Wait for callbacks that might already be running to finish.
- UnregisterWaitEx(dump_request_wait_handle_, INVALID_HANDLE_VALUE);
- dump_request_wait_handle_ = NULL;
- }
-}
-
-void ClientInfo::UnregisterProcessExitWait(bool block_until_no_pending) {
- if (process_exit_wait_handle_) {
- if (block_until_no_pending) {
- // Wait for the callback that might already be running to finish.
- UnregisterWaitEx(process_exit_wait_handle_, INVALID_HANDLE_VALUE);
- } else {
- UnregisterWait(process_exit_wait_handle_);
- }
- process_exit_wait_handle_ = NULL;
- }
-}
-
-ClientInfo::~ClientInfo() {
- // Waiting for the callback to finish here is safe because ClientInfo's are
- // never destroyed from the dump request handling callback.
- UnregisterDumpRequestWaitAndBlockUntilNoPending();
-
- // This is a little tricky because ClientInfo's may be destroyed by the same
- // callback (OnClientEnd) and waiting for it to finish will cause a deadlock.
- // Regardless of this complication, wait for any running callbacks to finish
- // so that the common case is properly handled. In order to avoid deadlocks,
- // the OnClientEnd callback must call UnregisterProcessExitWait(false)
- // before deleting the ClientInfo.
- UnregisterProcessExitWait(true);
-
- if (process_handle_) {
- CloseHandle(process_handle_);
- }
-
- if (dump_requested_handle_) {
- CloseHandle(dump_requested_handle_);
- }
-
- if (dump_generated_handle_) {
- CloseHandle(dump_generated_handle_);
- }
-}
-
-bool ClientInfo::GetClientExceptionInfo(EXCEPTION_POINTERS** ex_info) const {
- SIZE_T bytes_count = 0;
- if (!ReadProcessMemory(process_handle_,
- ex_info_,
- ex_info,
- sizeof(*ex_info),
- &bytes_count)) {
- return false;
- }
-
- return bytes_count == sizeof(*ex_info);
-}
-
-bool ClientInfo::GetClientThreadId(DWORD* thread_id) const {
- SIZE_T bytes_count = 0;
- if (!ReadProcessMemory(process_handle_,
- thread_id_,
- thread_id,
- sizeof(*thread_id),
- &bytes_count)) {
- return false;
- }
-
- return bytes_count == sizeof(*thread_id);
-}
-
-void ClientInfo::SetProcessUptime() {
- FILETIME now = {0};
- GetSystemTimeAsFileTime(&now);
-
- ULARGE_INTEGER time_start;
- time_start.HighPart = start_time_.dwHighDateTime;
- time_start.LowPart = start_time_.dwLowDateTime;
-
- ULARGE_INTEGER time_now;
- time_now.HighPart = now.dwHighDateTime;
- time_now.LowPart = now.dwLowDateTime;
-
- // Calculate the delay and convert it from 100-nanoseconds to milliseconds.
- __int64 delay = (time_now.QuadPart - time_start.QuadPart) / 10 / 1000;
-
- // Convert it to a string.
- wchar_t* value = custom_info_entries_.get()[custom_client_info_.count].value;
- _i64tow_s(delay, value, CustomInfoEntry::kValueMaxLength, 10);
-}
-
-bool ClientInfo::PopulateCustomInfo() {
- if (custom_client_info_.count > kMaxCustomInfoEntries)
- return false;
-
- SIZE_T bytes_count = 0;
- SIZE_T read_count = sizeof(CustomInfoEntry) * custom_client_info_.count;
-
- // If the scoped array for custom info already has an array, it will be
- // the same size as what we need. This is because the number of custom info
- // entries is always the same. So allocate memory only if scoped array has
- // a NULL pointer.
- if (!custom_info_entries_.get()) {
- // Allocate an extra entry for reporting uptime for the client process.
- custom_info_entries_.reset(
- new CustomInfoEntry[custom_client_info_.count + 1]);
- // Use the last element in the array for uptime.
- custom_info_entries_.get()[custom_client_info_.count].set_name(
- kCustomInfoProcessUptimeName);
- }
-
- if (!ReadProcessMemory(process_handle_,
- custom_client_info_.entries,
- custom_info_entries_.get(),
- read_count,
- &bytes_count)) {
- return false;
- }
-
- SetProcessUptime();
- return (bytes_count == read_count);
-}
-
-CustomClientInfo ClientInfo::GetCustomInfo() const {
- CustomClientInfo custom_info;
- custom_info.entries = custom_info_entries_.get();
- // Add 1 to the count from the client process to account for extra entry for
- // process uptime.
- custom_info.count = custom_client_info_.count + 1;
- return custom_info;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h
deleted file mode 100644
index 6a8fba31f4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/client_info.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_CRASH_GENERATION_CLIENT_INFO_H__
-#define CLIENT_WINDOWS_CRASH_GENERATION_CLIENT_INFO_H__
-
-#include <windows.h>
-#include <dbghelp.h>
-#include "client/windows/common/ipc_protocol.h"
-#include "common/scoped_ptr.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-class CrashGenerationServer;
-
-// Abstraction for a crash client process.
-class ClientInfo {
- public:
- // Creates an instance with the given values. Gets the process
- // handle for the given process id and creates necessary event
- // objects.
- ClientInfo(CrashGenerationServer* crash_server,
- DWORD pid,
- MINIDUMP_TYPE dump_type,
- DWORD* thread_id,
- EXCEPTION_POINTERS** ex_info,
- MDRawAssertionInfo* assert_info,
- const CustomClientInfo& custom_client_info);
-
- ~ClientInfo();
-
- CrashGenerationServer* crash_server() const { return crash_server_; }
- DWORD pid() const { return pid_; }
- MINIDUMP_TYPE dump_type() const { return dump_type_; }
- EXCEPTION_POINTERS** ex_info() const { return ex_info_; }
- MDRawAssertionInfo* assert_info() const { return assert_info_; }
- DWORD* thread_id() const { return thread_id_; }
- HANDLE process_handle() const { return process_handle_; }
- HANDLE dump_requested_handle() const { return dump_requested_handle_; }
- HANDLE dump_generated_handle() const { return dump_generated_handle_; }
- DWORD crash_id() const { return crash_id_; }
- const CustomClientInfo& custom_client_info() const {
- return custom_client_info_;
- }
-
- void set_dump_request_wait_handle(HANDLE value) {
- dump_request_wait_handle_ = value;
- }
-
- void set_process_exit_wait_handle(HANDLE value) {
- process_exit_wait_handle_ = value;
- }
-
- // Unregister the dump request wait operation and wait for all callbacks
- // that might already be running to complete before returning.
- void UnregisterDumpRequestWaitAndBlockUntilNoPending();
-
- // Unregister the process exit wait operation. If block_until_no_pending is
- // true, wait for all callbacks that might already be running to complete
- // before returning.
- void UnregisterProcessExitWait(bool block_until_no_pending);
-
- bool Initialize();
- bool GetClientExceptionInfo(EXCEPTION_POINTERS** ex_info) const;
- bool GetClientThreadId(DWORD* thread_id) const;
-
- // Reads the custom information from the client process address space.
- bool PopulateCustomInfo();
-
- // Returns the client custom information.
- CustomClientInfo GetCustomInfo() const;
-
- private:
- // Calcualtes the uptime for the client process, converts it to a string and
- // stores it in the last entry of client custom info.
- void SetProcessUptime();
-
- // Crash generation server.
- CrashGenerationServer* crash_server_;
-
- // Client process ID.
- DWORD pid_;
-
- // Dump type requested by the client.
- MINIDUMP_TYPE dump_type_;
-
- // Address of an EXCEPTION_POINTERS* variable in the client
- // process address space that will point to an instance of
- // EXCEPTION_POINTERS containing information about crash.
- //
- // WARNING: Do not dereference these pointers as they are pointers
- // in the address space of another process.
- EXCEPTION_POINTERS** ex_info_;
-
- // Address of an instance of MDRawAssertionInfo in the client
- // process address space that will contain information about
- // non-exception related crashes like invalid parameter assertion
- // failures and pure calls.
- //
- // WARNING: Do not dereference these pointers as they are pointers
- // in the address space of another process.
- MDRawAssertionInfo* assert_info_;
-
- // Custom information about the client.
- CustomClientInfo custom_client_info_;
-
- // Contains the custom client info entries read from the client process
- // memory. This will be populated only if the method GetClientCustomInfo
- // is called.
- scoped_array<CustomInfoEntry> custom_info_entries_;
-
- // Address of a variable in the client process address space that
- // will contain the thread id of the crashing client thread.
- //
- // WARNING: Do not dereference these pointers as they are pointers
- // in the address space of another process.
- DWORD* thread_id_;
-
- // Client process handle.
- HANDLE process_handle_;
-
- // Dump request event handle.
- HANDLE dump_requested_handle_;
-
- // Dump generated event handle.
- HANDLE dump_generated_handle_;
-
- // Wait handle for dump request event.
- HANDLE dump_request_wait_handle_;
-
- // Wait handle for process exit event.
- HANDLE process_exit_wait_handle_;
-
- // Time when the client process started. It is used to determine the uptime
- // for the client process when it signals a crash.
- FILETIME start_time_;
-
- // The crash id which can be used to request an upload. This will be the
- // value of the low order dword of the process creation time for the process
- // being dumped.
- DWORD crash_id_;
-
- // Disallow copy ctor and operator=.
- ClientInfo(const ClientInfo& client_info);
- ClientInfo& operator=(const ClientInfo& client_info);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_CRASH_GENERATION_CLIENT_INFO_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp
deleted file mode 100644
index ba343768ab..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation.gyp
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'crash_generation_server',
- 'type': 'static_library',
- 'sources': [
- 'client_info.cc',
- 'crash_generation_server.cc',
- 'minidump_generator.cc',
- 'client_info.h',
- 'crash_generation_client.h',
- 'crash_generation_server.h',
- 'minidump_generator.h',
- ],
- 'dependencies': [
- '../breakpad_client.gyp:common'
- ],
- },
- {
- 'target_name': 'crash_generation_client',
- 'type': 'static_library',
- 'include_dirs': [
- '<(DEPTH)',
- ],
- 'sources': [
- 'crash_generation_client.h',
- 'crash_generation_client.cc',
- 'crash_generation_server.h',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.cc
deleted file mode 100644
index 3ba5d4e4fb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.cc
+++ /dev/null
@@ -1,405 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/windows/crash_generation/crash_generation_client.h"
-#include <cassert>
-#include <utility>
-#include "client/windows/common/ipc_protocol.h"
-
-namespace google_breakpad {
-
-const int kPipeBusyWaitTimeoutMs = 2000;
-
-#ifdef _DEBUG
-const DWORD kWaitForServerTimeoutMs = INFINITE;
-#else
-const DWORD kWaitForServerTimeoutMs = 15000;
-#endif
-
-const int kPipeConnectMaxAttempts = 2;
-
-const DWORD kPipeDesiredAccess = FILE_READ_DATA |
- FILE_WRITE_DATA |
- FILE_WRITE_ATTRIBUTES;
-
-const DWORD kPipeFlagsAndAttributes = SECURITY_IDENTIFICATION |
- SECURITY_SQOS_PRESENT;
-
-const DWORD kPipeMode = PIPE_READMODE_MESSAGE;
-
-const size_t kWaitEventCount = 2;
-
-// This function is orphan for production code. It can be used
-// for debugging to help repro some scenarios like the client
-// is slow in writing to the pipe after connecting, the client
-// is slow in reading from the pipe after writing, etc. The parameter
-// overlapped below is not used and it is present to match the signature
-// of this function to TransactNamedPipe Win32 API. Uncomment if needed
-// for debugging.
-/**
-static bool TransactNamedPipeDebugHelper(HANDLE pipe,
- const void* in_buffer,
- DWORD in_size,
- void* out_buffer,
- DWORD out_size,
- DWORD* bytes_count,
- LPOVERLAPPED) {
- // Uncomment the next sleep to create a gap before writing
- // to pipe.
- // Sleep(5000);
-
- if (!WriteFile(pipe,
- in_buffer,
- in_size,
- bytes_count,
- NULL)) {
- return false;
- }
-
- // Uncomment the next sleep to create a gap between write
- // and read.
- // Sleep(5000);
-
- return ReadFile(pipe, out_buffer, out_size, bytes_count, NULL) != FALSE;
-}
-**/
-
-CrashGenerationClient::CrashGenerationClient(
- const wchar_t* pipe_name,
- MINIDUMP_TYPE dump_type,
- const CustomClientInfo* custom_info)
- : pipe_name_(pipe_name),
- pipe_handle_(NULL),
- custom_info_(),
- dump_type_(dump_type),
- crash_event_(NULL),
- crash_generated_(NULL),
- server_alive_(NULL),
- server_process_id_(0),
- thread_id_(0),
- exception_pointers_(NULL) {
- memset(&assert_info_, 0, sizeof(assert_info_));
- if (custom_info) {
- custom_info_ = *custom_info;
- }
-}
-
-CrashGenerationClient::CrashGenerationClient(
- HANDLE pipe_handle,
- MINIDUMP_TYPE dump_type,
- const CustomClientInfo* custom_info)
- : pipe_name_(),
- pipe_handle_(pipe_handle),
- custom_info_(),
- dump_type_(dump_type),
- crash_event_(NULL),
- crash_generated_(NULL),
- server_alive_(NULL),
- server_process_id_(0),
- thread_id_(0),
- exception_pointers_(NULL) {
- memset(&assert_info_, 0, sizeof(assert_info_));
- if (custom_info) {
- custom_info_ = *custom_info;
- }
-}
-
-CrashGenerationClient::~CrashGenerationClient() {
- if (crash_event_) {
- CloseHandle(crash_event_);
- }
-
- if (crash_generated_) {
- CloseHandle(crash_generated_);
- }
-
- if (server_alive_) {
- CloseHandle(server_alive_);
- }
-}
-
-// Performs the registration step with the server process.
-// The registration step involves communicating with the server
-// via a named pipe. The client sends the following pieces of
-// data to the server:
-//
-// * Message tag indicating the client is requesting registration.
-// * Process id of the client process.
-// * Address of a DWORD variable in the client address space
-// that will contain the thread id of the client thread that
-// caused the crash.
-// * Address of a EXCEPTION_POINTERS* variable in the client
-// address space that will point to an instance of EXCEPTION_POINTERS
-// when the crash happens.
-// * Address of an instance of MDRawAssertionInfo that will contain
-// relevant information in case of non-exception crashes like assertion
-// failures and pure calls.
-//
-// In return the client expects the following information from the server:
-//
-// * Message tag indicating successful registration.
-// * Server process id.
-// * Handle to an object that client can signal to request dump
-// generation from the server.
-// * Handle to an object that client can wait on after requesting
-// dump generation for the server to finish dump generation.
-// * Handle to a mutex object that client can wait on to make sure
-// server is still alive.
-//
-// If any step of the expected behavior mentioned above fails, the
-// registration step is not considered successful and hence out-of-process
-// dump generation service is not available.
-//
-// Returns true if the registration is successful; false otherwise.
-bool CrashGenerationClient::Register() {
- if (IsRegistered()) {
- return true;
- }
-
- HANDLE pipe = ConnectToServer();
- if (!pipe) {
- return false;
- }
-
- bool success = RegisterClient(pipe);
- CloseHandle(pipe);
- return success;
-}
-
-bool CrashGenerationClient::RequestUpload(DWORD crash_id) {
- HANDLE pipe = ConnectToServer();
- if (!pipe) {
- return false;
- }
-
- CustomClientInfo custom_info = {NULL, 0};
- ProtocolMessage msg(MESSAGE_TAG_UPLOAD_REQUEST, crash_id,
- static_cast<MINIDUMP_TYPE>(NULL), NULL, NULL, NULL,
- custom_info, NULL, NULL, NULL);
- DWORD bytes_count = 0;
- bool success = WriteFile(pipe, &msg, sizeof(msg), &bytes_count, NULL) != 0;
-
- CloseHandle(pipe);
- return success;
-}
-
-HANDLE CrashGenerationClient::ConnectToServer() {
- HANDLE pipe = ConnectToPipe(pipe_name_.c_str(),
- kPipeDesiredAccess,
- kPipeFlagsAndAttributes);
- if (!pipe) {
- return NULL;
- }
-
- DWORD mode = kPipeMode;
- if (!SetNamedPipeHandleState(pipe, &mode, NULL, NULL)) {
- CloseHandle(pipe);
- pipe = NULL;
- }
-
- return pipe;
-}
-
-bool CrashGenerationClient::RegisterClient(HANDLE pipe) {
- ProtocolMessage msg(MESSAGE_TAG_REGISTRATION_REQUEST,
- GetCurrentProcessId(),
- dump_type_,
- &thread_id_,
- &exception_pointers_,
- &assert_info_,
- custom_info_,
- NULL,
- NULL,
- NULL);
- ProtocolMessage reply;
- DWORD bytes_count = 0;
- // The call to TransactNamedPipe below can be changed to a call
- // to TransactNamedPipeDebugHelper to help repro some scenarios.
- // For details see comments for TransactNamedPipeDebugHelper.
- if (!TransactNamedPipe(pipe,
- &msg,
- sizeof(msg),
- &reply,
- sizeof(ProtocolMessage),
- &bytes_count,
- NULL)) {
- return false;
- }
-
- if (!ValidateResponse(reply)) {
- return false;
- }
-
- ProtocolMessage ack_msg;
- ack_msg.tag = MESSAGE_TAG_REGISTRATION_ACK;
-
- if (!WriteFile(pipe, &ack_msg, sizeof(ack_msg), &bytes_count, NULL)) {
- return false;
- }
- crash_event_ = reply.dump_request_handle;
- crash_generated_ = reply.dump_generated_handle;
- server_alive_ = reply.server_alive_handle;
- server_process_id_ = reply.id;
-
- return true;
-}
-
-HANDLE CrashGenerationClient::ConnectToPipe(const wchar_t* pipe_name,
- DWORD pipe_access,
- DWORD flags_attrs) {
- if (pipe_handle_) {
- HANDLE t = pipe_handle_;
- pipe_handle_ = NULL;
- return t;
- }
-
- for (int i = 0; i < kPipeConnectMaxAttempts; ++i) {
- HANDLE pipe = CreateFile(pipe_name,
- pipe_access,
- 0,
- NULL,
- OPEN_EXISTING,
- flags_attrs,
- NULL);
- if (pipe != INVALID_HANDLE_VALUE) {
- return pipe;
- }
-
- // Cannot continue retrying if error is something other than
- // ERROR_PIPE_BUSY.
- if (GetLastError() != ERROR_PIPE_BUSY) {
- break;
- }
-
- // Cannot continue retrying if wait on pipe fails.
- if (!WaitNamedPipe(pipe_name, kPipeBusyWaitTimeoutMs)) {
- break;
- }
- }
-
- return NULL;
-}
-
-bool CrashGenerationClient::ValidateResponse(
- const ProtocolMessage& msg) const {
- return (msg.tag == MESSAGE_TAG_REGISTRATION_RESPONSE) &&
- (msg.id != 0) &&
- (msg.dump_request_handle != NULL) &&
- (msg.dump_generated_handle != NULL) &&
- (msg.server_alive_handle != NULL);
-}
-
-bool CrashGenerationClient::IsRegistered() const {
- return crash_event_ != NULL;
-}
-
-bool CrashGenerationClient::RequestDump(EXCEPTION_POINTERS* ex_info,
- MDRawAssertionInfo* assert_info) {
- if (!IsRegistered()) {
- return false;
- }
-
- exception_pointers_ = ex_info;
- thread_id_ = GetCurrentThreadId();
-
- if (assert_info) {
- memcpy(&assert_info_, assert_info, sizeof(assert_info_));
- } else {
- memset(&assert_info_, 0, sizeof(assert_info_));
- }
-
- return SignalCrashEventAndWait();
-}
-
-bool CrashGenerationClient::RequestDump(EXCEPTION_POINTERS* ex_info) {
- return RequestDump(ex_info, NULL);
-}
-
-bool CrashGenerationClient::RequestDump(MDRawAssertionInfo* assert_info) {
- return RequestDump(NULL, assert_info);
-}
-
-bool CrashGenerationClient::SignalCrashEventAndWait() {
- assert(crash_event_);
- assert(crash_generated_);
- assert(server_alive_);
-
- // Reset the dump generated event before signaling the crash
- // event so that the server can set the dump generated event
- // once it is done generating the event.
- if (!ResetEvent(crash_generated_)) {
- return false;
- }
-
- if (!SetEvent(crash_event_)) {
- return false;
- }
-
- HANDLE wait_handles[kWaitEventCount] = {crash_generated_, server_alive_};
-
- DWORD result = WaitForMultipleObjects(kWaitEventCount,
- wait_handles,
- FALSE,
- kWaitForServerTimeoutMs);
-
- // Crash dump was successfully generated only if the server
- // signaled the crash generated event.
- return result == WAIT_OBJECT_0;
-}
-
-HANDLE CrashGenerationClient::DuplicatePipeToClientProcess(const wchar_t* pipe_name,
- HANDLE hProcess) {
- for (int i = 0; i < kPipeConnectMaxAttempts; ++i) {
- HANDLE local_pipe = CreateFile(pipe_name, kPipeDesiredAccess,
- 0, NULL, OPEN_EXISTING,
- kPipeFlagsAndAttributes, NULL);
- if (local_pipe != INVALID_HANDLE_VALUE) {
- HANDLE remotePipe = INVALID_HANDLE_VALUE;
- if (DuplicateHandle(GetCurrentProcess(), local_pipe,
- hProcess, &remotePipe, 0, FALSE,
- DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS)) {
- return remotePipe;
- } else {
- return INVALID_HANDLE_VALUE;
- }
- }
-
- // Cannot continue retrying if the error wasn't a busy pipe.
- if (GetLastError() != ERROR_PIPE_BUSY) {
- return INVALID_HANDLE_VALUE;
- }
-
- if (!WaitNamedPipe(pipe_name, kPipeBusyWaitTimeoutMs)) {
- return INVALID_HANDLE_VALUE;
- }
- }
- return INVALID_HANDLE_VALUE;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h
deleted file mode 100644
index 457f731957..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_client.h
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
-#define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
-
-#include <windows.h>
-#include <dbghelp.h>
-#include <string>
-#include <utility>
-#include "client/windows/common/ipc_protocol.h"
-#include "common/scoped_ptr.h"
-
-namespace google_breakpad {
-
-struct CustomClientInfo;
-
-// Abstraction of client-side implementation of out of process
-// crash generation.
-//
-// The process that desires to have out-of-process crash dump
-// generation service can use this class in the following way:
-//
-// * Create an instance.
-// * Call Register method so that the client tries to register
-// with the server process and check the return value. If
-// registration is not successful, out-of-process crash dump
-// generation will not be available
-// * Request dump generation by calling either of the two
-// overloaded RequestDump methods - one in case of exceptions
-// and the other in case of assertion failures
-//
-// Note that it is the responsibility of the client code of
-// this class to set the unhandled exception filter with the
-// system by calling the SetUnhandledExceptionFilter function
-// and the client code should explicitly request dump generation.
-class CrashGenerationClient {
- public:
- CrashGenerationClient(const wchar_t* pipe_name,
- MINIDUMP_TYPE dump_type,
- const CustomClientInfo* custom_info);
-
- CrashGenerationClient(HANDLE pipe_handle,
- MINIDUMP_TYPE dump_type,
- const CustomClientInfo* custom_info);
-
- ~CrashGenerationClient();
-
- // Registers the client process with the crash server.
- //
- // Returns true if the registration is successful; false otherwise.
- bool Register();
-
- // Requests the crash server to upload a previous dump with the
- // given crash id.
- bool RequestUpload(DWORD crash_id);
-
- bool RequestDump(EXCEPTION_POINTERS* ex_info,
- MDRawAssertionInfo* assert_info);
-
- // Requests the crash server to generate a dump with the given
- // exception information.
- //
- // Returns true if the dump was successful; false otherwise. Note that
- // if the registration step was not performed or it was not successful,
- // false will be returned.
- bool RequestDump(EXCEPTION_POINTERS* ex_info);
-
- // Requests the crash server to generate a dump with the given
- // assertion information.
- //
- // Returns true if the dump was successful; false otherwise. Note that
- // if the registration step was not performed or it was not successful,
- // false will be returned.
- bool RequestDump(MDRawAssertionInfo* assert_info);
-
- // If the crash generation client is running in a sandbox that prevents it
- // from opening the named pipe directly, the server process may open the
- // handle and duplicate it into the client process with this helper method.
- // Returns INVALID_HANDLE_VALUE on failure. The process must have been opened
- // with the PROCESS_DUP_HANDLE access right.
- static HANDLE DuplicatePipeToClientProcess(const wchar_t* pipe_name,
- HANDLE hProcess);
-
- private:
- // Connects to the appropriate pipe and sets the pipe handle state.
- //
- // Returns the pipe handle if everything goes well; otherwise Returns NULL.
- HANDLE ConnectToServer();
-
- // Performs a handshake with the server over the given pipe which should be
- // already connected to the server.
- //
- // Returns true if handshake with the server was successful; false otherwise.
- bool RegisterClient(HANDLE pipe);
-
- // Validates the given server response.
- bool ValidateResponse(const ProtocolMessage& msg) const;
-
- // Returns true if the registration step succeeded; false otherwise.
- bool IsRegistered() const;
-
- // Connects to the given named pipe with given parameters.
- //
- // Returns true if the connection is successful; false otherwise.
- HANDLE ConnectToPipe(const wchar_t* pipe_name,
- DWORD pipe_access,
- DWORD flags_attrs);
-
- // Signals the crash event and wait for the server to generate crash.
- bool SignalCrashEventAndWait();
-
- // Pipe name to use to talk to server.
- std::wstring pipe_name_;
-
- // Pipe handle duplicated from server process. Only valid before
- // Register is called.
- HANDLE pipe_handle_;
-
- // Custom client information
- CustomClientInfo custom_info_;
-
- // Type of dump to generate.
- MINIDUMP_TYPE dump_type_;
-
- // Event to signal in case of a crash.
- HANDLE crash_event_;
-
- // Handle to wait on after signaling a crash for the server
- // to finish generating crash dump.
- HANDLE crash_generated_;
-
- // Handle to a mutex that will become signaled with WAIT_ABANDONED
- // if the server process goes down.
- HANDLE server_alive_;
-
- // Server process id.
- DWORD server_process_id_;
-
- // Id of the thread that caused the crash.
- DWORD thread_id_;
-
- // Exception pointers for an exception crash.
- EXCEPTION_POINTERS* exception_pointers_;
-
- // Assertion info for an invalid parameter or pure call crash.
- MDRawAssertionInfo assert_info_;
-
- // Disable copy ctor and operator=.
- CrashGenerationClient(const CrashGenerationClient& crash_client);
- CrashGenerationClient& operator=(const CrashGenerationClient& crash_client);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc
deleted file mode 100644
index bb0968fe01..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.cc
+++ /dev/null
@@ -1,931 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/windows/crash_generation/crash_generation_server.h"
-#include <windows.h>
-#include <cassert>
-#include <list>
-#include "client/windows/common/auto_critical_section.h"
-#include "common/scoped_ptr.h"
-
-#include "client/windows/crash_generation/client_info.h"
-
-namespace google_breakpad {
-
-// Output buffer size.
-static const size_t kOutBufferSize = 64;
-
-// Input buffer size.
-static const size_t kInBufferSize = 64;
-
-// Access flags for the client on the dump request event.
-static const DWORD kDumpRequestEventAccess = EVENT_MODIFY_STATE;
-
-// Access flags for the client on the dump generated event.
-static const DWORD kDumpGeneratedEventAccess = EVENT_MODIFY_STATE |
- SYNCHRONIZE;
-
-// Access flags for the client on the mutex.
-static const DWORD kMutexAccess = SYNCHRONIZE;
-
-// Attribute flags for the pipe.
-static const DWORD kPipeAttr = FILE_FLAG_FIRST_PIPE_INSTANCE |
- PIPE_ACCESS_DUPLEX |
- FILE_FLAG_OVERLAPPED;
-
-// Mode for the pipe.
-static const DWORD kPipeMode = PIPE_TYPE_MESSAGE |
- PIPE_READMODE_MESSAGE |
- PIPE_WAIT;
-
-// For pipe I/O, execute the callback in the wait thread itself,
-// since the callback does very little work. The callback executes
-// the code for one of the states of the server state machine and
-// the code for all of the states perform async I/O and hence
-// finish very quickly.
-static const ULONG kPipeIOThreadFlags = WT_EXECUTEINWAITTHREAD;
-
-// Dump request threads will, most likely, generate dumps. That may
-// take some time to finish, so specify WT_EXECUTELONGFUNCTION flag.
-static const ULONG kDumpRequestThreadFlags = WT_EXECUTEINWAITTHREAD |
- WT_EXECUTELONGFUNCTION;
-
-static bool IsClientRequestValid(const ProtocolMessage& msg) {
- return msg.tag == MESSAGE_TAG_UPLOAD_REQUEST ||
- (msg.tag == MESSAGE_TAG_REGISTRATION_REQUEST &&
- msg.id != 0 &&
- msg.thread_id != NULL &&
- msg.exception_pointers != NULL &&
- msg.assert_info != NULL);
-}
-
-#ifndef NDEBUG
-static bool CheckForIOIncomplete(bool success) {
- // We should never get an I/O incomplete since we should not execute this
- // unless the operation has finished and the overlapped event is signaled. If
- // we do get INCOMPLETE, we have a bug in our code.
- return success ? false : (GetLastError() == ERROR_IO_INCOMPLETE);
-}
-#endif
-
-CrashGenerationServer::CrashGenerationServer(
- const std::wstring& pipe_name,
- SECURITY_ATTRIBUTES* pipe_sec_attrs,
- OnClientConnectedCallback connect_callback,
- void* connect_context,
- OnClientDumpRequestCallback dump_callback,
- void* dump_context,
- OnClientExitedCallback exit_callback,
- void* exit_context,
- OnClientUploadRequestCallback upload_request_callback,
- void* upload_context,
- bool generate_dumps,
- const std::wstring* dump_path)
- : pipe_name_(pipe_name),
- pipe_sec_attrs_(pipe_sec_attrs),
- pipe_(NULL),
- pipe_wait_handle_(NULL),
- server_alive_handle_(NULL),
- connect_callback_(connect_callback),
- connect_context_(connect_context),
- dump_callback_(dump_callback),
- dump_context_(dump_context),
- exit_callback_(exit_callback),
- exit_context_(exit_context),
- upload_request_callback_(upload_request_callback),
- upload_context_(upload_context),
- generate_dumps_(generate_dumps),
- pre_fetch_custom_info_(true),
- dump_path_(dump_path ? *dump_path : L""),
- server_state_(IPC_SERVER_STATE_UNINITIALIZED),
- shutting_down_(false),
- overlapped_(),
- client_info_(NULL) {
- InitializeCriticalSection(&sync_);
-}
-
-// This should never be called from the OnPipeConnected callback.
-// Otherwise the UnregisterWaitEx call below will cause a deadlock.
-CrashGenerationServer::~CrashGenerationServer() {
- // New scope to release the lock automatically.
- {
- // Make sure no clients are added or removed beyond this point.
- // Before adding or removing any clients, the critical section
- // must be entered and the shutting_down_ flag checked. The
- // critical section is then exited only after the clients_ list
- // modifications are done and the list is in a consistent state.
- AutoCriticalSection lock(&sync_);
-
- // Indicate to existing threads that server is shutting down.
- shutting_down_ = true;
- }
- // No one will modify the clients_ list beyond this point -
- // not even from another thread.
-
- // Even if there are no current worker threads running, it is possible that
- // an I/O request is pending on the pipe right now but not yet done.
- // In fact, it's very likely this is the case unless we are in an ERROR
- // state. If we don't wait for the pending I/O to be done, then when the I/O
- // completes, it may write to invalid memory. AppVerifier will flag this
- // problem too. So we disconnect from the pipe and then wait for the server
- // to get into error state so that the pending I/O will fail and get
- // cleared.
- DisconnectNamedPipe(pipe_);
- int num_tries = 100;
- while (num_tries-- && server_state_ != IPC_SERVER_STATE_ERROR) {
- Sleep(10);
- }
-
- // Unregister wait on the pipe.
- if (pipe_wait_handle_) {
- // Wait for already executing callbacks to finish.
- UnregisterWaitEx(pipe_wait_handle_, INVALID_HANDLE_VALUE);
- }
-
- // Close the pipe to avoid further client connections.
- if (pipe_) {
- CloseHandle(pipe_);
- }
-
- // Request all ClientInfo objects to unregister all waits.
- // No need to enter the critical section because no one is allowed to modify
- // the clients_ list once the shutting_down_ flag is set.
- std::list<ClientInfo*>::iterator iter;
- for (iter = clients_.begin(); iter != clients_.end(); ++iter) {
- ClientInfo* client_info = *iter;
- // Unregister waits. Wait for already executing callbacks to finish.
- // Unregister the client process exit wait first and only then unregister
- // the dump request wait. The reason is that the OnClientExit callback
- // also unregisters the dump request wait and such a race (doing the same
- // unregistration from two threads) is undesirable.
- client_info->UnregisterProcessExitWait(true);
- client_info->UnregisterDumpRequestWaitAndBlockUntilNoPending();
-
- // Destroying the ClientInfo here is safe because all wait operations for
- // this ClientInfo were unregistered and no pending or running callbacks
- // for this ClientInfo can possible exist (block_until_no_pending option
- // was used).
- delete client_info;
- }
-
- if (server_alive_handle_) {
- // Release the mutex before closing the handle so that clients requesting
- // dumps wait for a long time for the server to generate a dump.
- ReleaseMutex(server_alive_handle_);
- CloseHandle(server_alive_handle_);
- }
-
- if (overlapped_.hEvent) {
- CloseHandle(overlapped_.hEvent);
- }
-
- DeleteCriticalSection(&sync_);
-}
-
-bool CrashGenerationServer::Start() {
- if (server_state_ != IPC_SERVER_STATE_UNINITIALIZED) {
- return false;
- }
-
- server_state_ = IPC_SERVER_STATE_INITIAL;
-
- server_alive_handle_ = CreateMutex(NULL, TRUE, NULL);
- if (!server_alive_handle_) {
- return false;
- }
-
- // Event to signal the client connection and pipe reads and writes.
- overlapped_.hEvent = CreateEvent(NULL, // Security descriptor.
- TRUE, // Manual reset.
- FALSE, // Initially nonsignaled.
- NULL); // Name.
- if (!overlapped_.hEvent) {
- return false;
- }
-
- // Register a callback with the thread pool for the client connection.
- if (!RegisterWaitForSingleObject(&pipe_wait_handle_,
- overlapped_.hEvent,
- OnPipeConnected,
- this,
- INFINITE,
- kPipeIOThreadFlags)) {
- return false;
- }
-
- pipe_ = CreateNamedPipe(pipe_name_.c_str(),
- kPipeAttr,
- kPipeMode,
- 1,
- kOutBufferSize,
- kInBufferSize,
- 0,
- pipe_sec_attrs_);
- if (pipe_ == INVALID_HANDLE_VALUE) {
- return false;
- }
-
- // Kick-start the state machine. This will initiate an asynchronous wait
- // for client connections.
- if (!SetEvent(overlapped_.hEvent)) {
- server_state_ = IPC_SERVER_STATE_ERROR;
- return false;
- }
-
- // If we are in error state, it's because we failed to start listening.
- return true;
-}
-
-// If the server thread serving clients ever gets into the
-// ERROR state, reset the event, close the pipe and remain
-// in the error state forever. Error state means something
-// that we didn't account for has happened, and it's dangerous
-// to do anything unknowingly.
-void CrashGenerationServer::HandleErrorState() {
- assert(server_state_ == IPC_SERVER_STATE_ERROR);
-
- // If the server is shutting down anyway, don't clean up
- // here since shut down process will clean up.
- if (shutting_down_) {
- return;
- }
-
- if (pipe_wait_handle_) {
- UnregisterWait(pipe_wait_handle_);
- pipe_wait_handle_ = NULL;
- }
-
- if (pipe_) {
- CloseHandle(pipe_);
- pipe_ = NULL;
- }
-
- if (overlapped_.hEvent) {
- CloseHandle(overlapped_.hEvent);
- overlapped_.hEvent = NULL;
- }
-}
-
-// When the server thread serving clients is in the INITIAL state,
-// try to connect to the pipe asynchronously. If the connection
-// finishes synchronously, directly go into the CONNECTED state;
-// otherwise go into the CONNECTING state. For any problems, go
-// into the ERROR state.
-void CrashGenerationServer::HandleInitialState() {
- assert(server_state_ == IPC_SERVER_STATE_INITIAL);
-
- if (!ResetEvent(overlapped_.hEvent)) {
- EnterErrorState();
- return;
- }
-
- bool success = ConnectNamedPipe(pipe_, &overlapped_) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
- // From MSDN, it is not clear that when ConnectNamedPipe is used
- // in an overlapped mode, will it ever return non-zero value, and
- // if so, in what cases.
- assert(!success);
-
- switch (error_code) {
- case ERROR_IO_PENDING:
- EnterStateWhenSignaled(IPC_SERVER_STATE_CONNECTING);
- break;
-
- case ERROR_PIPE_CONNECTED:
- EnterStateImmediately(IPC_SERVER_STATE_CONNECTED);
- break;
-
- default:
- EnterErrorState();
- break;
- }
-}
-
-// When the server thread serving the clients is in the CONNECTING state,
-// try to get the result of the asynchronous connection request using
-// the OVERLAPPED object. If the result indicates the connection is done,
-// go into the CONNECTED state. If the result indicates I/O is still
-// INCOMPLETE, remain in the CONNECTING state. For any problems,
-// go into the DISCONNECTING state.
-void CrashGenerationServer::HandleConnectingState() {
- assert(server_state_ == IPC_SERVER_STATE_CONNECTING);
-
- DWORD bytes_count = 0;
- bool success = GetOverlappedResult(pipe_,
- &overlapped_,
- &bytes_count,
- FALSE) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
- if (success) {
- EnterStateImmediately(IPC_SERVER_STATE_CONNECTED);
- } else if (error_code != ERROR_IO_INCOMPLETE) {
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- } else {
- // remain in CONNECTING state
- }
-}
-
-// When the server thread serving the clients is in the CONNECTED state,
-// try to issue an asynchronous read from the pipe. If read completes
-// synchronously or if I/O is pending then go into the READING state.
-// For any problems, go into the DISCONNECTING state.
-void CrashGenerationServer::HandleConnectedState() {
- assert(server_state_ == IPC_SERVER_STATE_CONNECTED);
-
- DWORD bytes_count = 0;
- memset(&msg_, 0, sizeof(msg_));
- bool success = ReadFile(pipe_,
- &msg_,
- sizeof(msg_),
- &bytes_count,
- &overlapped_) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
- // Note that the asynchronous read issued above can finish before the
- // code below executes. But, it is okay to change state after issuing
- // the asynchronous read. This is because even if the asynchronous read
- // is done, the callback for it would not be executed until the current
- // thread finishes its execution.
- if (success || error_code == ERROR_IO_PENDING) {
- EnterStateWhenSignaled(IPC_SERVER_STATE_READING);
- } else {
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- }
-}
-
-// When the server thread serving the clients is in the READING state,
-// try to get the result of the async read. If async read is done,
-// go into the READ_DONE state. For any problems, go into the
-// DISCONNECTING state.
-void CrashGenerationServer::HandleReadingState() {
- assert(server_state_ == IPC_SERVER_STATE_READING);
-
- DWORD bytes_count = 0;
- bool success = GetOverlappedResult(pipe_,
- &overlapped_,
- &bytes_count,
- FALSE) != FALSE;
- if (success && bytes_count == sizeof(ProtocolMessage)) {
- EnterStateImmediately(IPC_SERVER_STATE_READ_DONE);
- return;
- }
-
- assert(!CheckForIOIncomplete(success));
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
-}
-
-// When the server thread serving the client is in the READ_DONE state,
-// validate the client's request message, register the client by
-// creating appropriate objects and prepare the response. Then try to
-// write the response to the pipe asynchronously. If that succeeds,
-// go into the WRITING state. For any problems, go into the DISCONNECTING
-// state.
-void CrashGenerationServer::HandleReadDoneState() {
- assert(server_state_ == IPC_SERVER_STATE_READ_DONE);
-
- if (!IsClientRequestValid(msg_)) {
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- return;
- }
-
- if (msg_.tag == MESSAGE_TAG_UPLOAD_REQUEST) {
- if (upload_request_callback_)
- upload_request_callback_(upload_context_, msg_.id);
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- return;
- }
-
- scoped_ptr<ClientInfo> client_info(
- new ClientInfo(this,
- msg_.id,
- msg_.dump_type,
- msg_.thread_id,
- msg_.exception_pointers,
- msg_.assert_info,
- msg_.custom_client_info));
-
- if (!client_info->Initialize()) {
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- return;
- }
-
- // Issues an asynchronous WriteFile call if successful.
- // Iff successful, assigns ownership of the client_info pointer to the server
- // instance, in which case we must be sure not to free it in this function.
- if (!RespondToClient(client_info.get())) {
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- return;
- }
-
- // This is only valid as long as it can be found in the clients_ list
- client_info_ = client_info.release();
-
- // Note that the asynchronous write issued by RespondToClient function
- // can finish before the code below executes. But it is okay to change
- // state after issuing the asynchronous write. This is because even if
- // the asynchronous write is done, the callback for it would not be
- // executed until the current thread finishes its execution.
- EnterStateWhenSignaled(IPC_SERVER_STATE_WRITING);
-}
-
-// When the server thread serving the clients is in the WRITING state,
-// try to get the result of the async write. If the async write is done,
-// go into the WRITE_DONE state. For any problems, go into the
-// DISONNECTING state.
-void CrashGenerationServer::HandleWritingState() {
- assert(server_state_ == IPC_SERVER_STATE_WRITING);
-
- DWORD bytes_count = 0;
- bool success = GetOverlappedResult(pipe_,
- &overlapped_,
- &bytes_count,
- FALSE) != FALSE;
- if (success) {
- EnterStateImmediately(IPC_SERVER_STATE_WRITE_DONE);
- return;
- }
-
- assert(!CheckForIOIncomplete(success));
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
-}
-
-// When the server thread serving the clients is in the WRITE_DONE state,
-// try to issue an async read on the pipe. If the read completes synchronously
-// or if I/O is still pending then go into the READING_ACK state. For any
-// issues, go into the DISCONNECTING state.
-void CrashGenerationServer::HandleWriteDoneState() {
- assert(server_state_ == IPC_SERVER_STATE_WRITE_DONE);
-
- DWORD bytes_count = 0;
- bool success = ReadFile(pipe_,
- &msg_,
- sizeof(msg_),
- &bytes_count,
- &overlapped_) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
- if (success) {
- EnterStateImmediately(IPC_SERVER_STATE_READING_ACK);
- } else if (error_code == ERROR_IO_PENDING) {
- EnterStateWhenSignaled(IPC_SERVER_STATE_READING_ACK);
- } else {
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
- }
-}
-
-// When the server thread serving the clients is in the READING_ACK state,
-// try to get result of async read. Go into the DISCONNECTING state.
-void CrashGenerationServer::HandleReadingAckState() {
- assert(server_state_ == IPC_SERVER_STATE_READING_ACK);
-
- DWORD bytes_count = 0;
- bool success = GetOverlappedResult(pipe_,
- &overlapped_,
- &bytes_count,
- FALSE) != FALSE;
- if (success) {
- // The connection handshake with the client is now complete; perform
- // the callback.
- if (connect_callback_) {
- // Note that there is only a single copy of the ClientInfo of the
- // currently connected client. However it is being referenced from
- // two different places:
- // - the client_info_ member
- // - the clients_ list
- // The lifetime of this ClientInfo depends on the lifetime of the
- // client process - basically it can go away at any time.
- // However, as long as it is referenced by the clients_ list it
- // is guaranteed to be valid. Enter the critical section and check
- // to see whether the client_info_ can be found in the list.
- // If found, execute the callback and only then leave the critical
- // section.
- AutoCriticalSection lock(&sync_);
-
- bool client_is_still_alive = false;
- std::list<ClientInfo*>::iterator iter;
- for (iter = clients_.begin(); iter != clients_.end(); ++iter) {
- if (client_info_ == *iter) {
- client_is_still_alive = true;
- break;
- }
- }
-
- if (client_is_still_alive) {
- connect_callback_(connect_context_, client_info_);
- }
- }
- } else {
- assert(!CheckForIOIncomplete(success));
- }
-
- EnterStateImmediately(IPC_SERVER_STATE_DISCONNECTING);
-}
-
-// When the server thread serving the client is in the DISCONNECTING state,
-// disconnect from the pipe and reset the event. If anything fails, go into
-// the ERROR state. If it goes well, go into the INITIAL state and set the
-// event to start all over again.
-void CrashGenerationServer::HandleDisconnectingState() {
- assert(server_state_ == IPC_SERVER_STATE_DISCONNECTING);
-
- // Done serving the client.
- client_info_ = NULL;
-
- overlapped_.Internal = NULL;
- overlapped_.InternalHigh = NULL;
- overlapped_.Offset = 0;
- overlapped_.OffsetHigh = 0;
- overlapped_.Pointer = NULL;
-
- if (!ResetEvent(overlapped_.hEvent)) {
- EnterErrorState();
- return;
- }
-
- if (!DisconnectNamedPipe(pipe_)) {
- EnterErrorState();
- return;
- }
-
- // If the server is shutting down do not connect to the
- // next client.
- if (shutting_down_) {
- return;
- }
-
- EnterStateImmediately(IPC_SERVER_STATE_INITIAL);
-}
-
-void CrashGenerationServer::EnterErrorState() {
- SetEvent(overlapped_.hEvent);
- server_state_ = IPC_SERVER_STATE_ERROR;
-}
-
-void CrashGenerationServer::EnterStateWhenSignaled(IPCServerState state) {
- server_state_ = state;
-}
-
-void CrashGenerationServer::EnterStateImmediately(IPCServerState state) {
- server_state_ = state;
-
- if (!SetEvent(overlapped_.hEvent)) {
- server_state_ = IPC_SERVER_STATE_ERROR;
- }
-}
-
-bool CrashGenerationServer::PrepareReply(const ClientInfo& client_info,
- ProtocolMessage* reply) const {
- reply->tag = MESSAGE_TAG_REGISTRATION_RESPONSE;
- reply->id = GetCurrentProcessId();
-
- if (CreateClientHandles(client_info, reply)) {
- return true;
- }
-
- // Closing of remote handles (belonging to a different process) can
- // only be done through DuplicateHandle.
- if (reply->dump_request_handle) {
- DuplicateHandle(client_info.process_handle(), // hSourceProcessHandle
- reply->dump_request_handle, // hSourceHandle
- NULL, // hTargetProcessHandle
- 0, // lpTargetHandle
- 0, // dwDesiredAccess
- FALSE, // bInheritHandle
- DUPLICATE_CLOSE_SOURCE); // dwOptions
- reply->dump_request_handle = NULL;
- }
-
- if (reply->dump_generated_handle) {
- DuplicateHandle(client_info.process_handle(), // hSourceProcessHandle
- reply->dump_generated_handle, // hSourceHandle
- NULL, // hTargetProcessHandle
- 0, // lpTargetHandle
- 0, // dwDesiredAccess
- FALSE, // bInheritHandle
- DUPLICATE_CLOSE_SOURCE); // dwOptions
- reply->dump_generated_handle = NULL;
- }
-
- if (reply->server_alive_handle) {
- DuplicateHandle(client_info.process_handle(), // hSourceProcessHandle
- reply->server_alive_handle, // hSourceHandle
- NULL, // hTargetProcessHandle
- 0, // lpTargetHandle
- 0, // dwDesiredAccess
- FALSE, // bInheritHandle
- DUPLICATE_CLOSE_SOURCE); // dwOptions
- reply->server_alive_handle = NULL;
- }
-
- return false;
-}
-
-bool CrashGenerationServer::CreateClientHandles(const ClientInfo& client_info,
- ProtocolMessage* reply) const {
- HANDLE current_process = GetCurrentProcess();
- if (!DuplicateHandle(current_process,
- client_info.dump_requested_handle(),
- client_info.process_handle(),
- &reply->dump_request_handle,
- kDumpRequestEventAccess,
- FALSE,
- 0)) {
- return false;
- }
-
- if (!DuplicateHandle(current_process,
- client_info.dump_generated_handle(),
- client_info.process_handle(),
- &reply->dump_generated_handle,
- kDumpGeneratedEventAccess,
- FALSE,
- 0)) {
- return false;
- }
-
- if (!DuplicateHandle(current_process,
- server_alive_handle_,
- client_info.process_handle(),
- &reply->server_alive_handle,
- kMutexAccess,
- FALSE,
- 0)) {
- return false;
- }
-
- return true;
-}
-
-bool CrashGenerationServer::RespondToClient(ClientInfo* client_info) {
- ProtocolMessage reply;
- if (!PrepareReply(*client_info, &reply)) {
- return false;
- }
-
- DWORD bytes_count = 0;
- bool success = WriteFile(pipe_,
- &reply,
- sizeof(reply),
- &bytes_count,
- &overlapped_) != FALSE;
- DWORD error_code = success ? ERROR_SUCCESS : GetLastError();
-
- if (!success && error_code != ERROR_IO_PENDING) {
- return false;
- }
-
- // Takes over ownership of client_info. We MUST return true if AddClient
- // succeeds.
- return AddClient(client_info);
-}
-
-// The server thread servicing the clients runs this method. The method
-// implements the state machine described in ReadMe.txt along with the
-// helper methods HandleXXXState.
-void CrashGenerationServer::HandleConnectionRequest() {
- // If the server is shutting down, get into ERROR state, reset the event so
- // more workers don't run and return immediately.
- if (shutting_down_) {
- server_state_ = IPC_SERVER_STATE_ERROR;
- ResetEvent(overlapped_.hEvent);
- return;
- }
-
- switch (server_state_) {
- case IPC_SERVER_STATE_ERROR:
- HandleErrorState();
- break;
-
- case IPC_SERVER_STATE_INITIAL:
- HandleInitialState();
- break;
-
- case IPC_SERVER_STATE_CONNECTING:
- HandleConnectingState();
- break;
-
- case IPC_SERVER_STATE_CONNECTED:
- HandleConnectedState();
- break;
-
- case IPC_SERVER_STATE_READING:
- HandleReadingState();
- break;
-
- case IPC_SERVER_STATE_READ_DONE:
- HandleReadDoneState();
- break;
-
- case IPC_SERVER_STATE_WRITING:
- HandleWritingState();
- break;
-
- case IPC_SERVER_STATE_WRITE_DONE:
- HandleWriteDoneState();
- break;
-
- case IPC_SERVER_STATE_READING_ACK:
- HandleReadingAckState();
- break;
-
- case IPC_SERVER_STATE_DISCONNECTING:
- HandleDisconnectingState();
- break;
-
- default:
- assert(false);
- // This indicates that we added one more state without
- // adding handling code.
- server_state_ = IPC_SERVER_STATE_ERROR;
- break;
- }
-}
-
-bool CrashGenerationServer::AddClient(ClientInfo* client_info) {
- HANDLE request_wait_handle = NULL;
- if (!RegisterWaitForSingleObject(&request_wait_handle,
- client_info->dump_requested_handle(),
- OnDumpRequest,
- client_info,
- INFINITE,
- kDumpRequestThreadFlags)) {
- return false;
- }
-
- client_info->set_dump_request_wait_handle(request_wait_handle);
-
- // OnClientEnd will be called when the client process terminates.
- HANDLE process_wait_handle = NULL;
- if (!RegisterWaitForSingleObject(&process_wait_handle,
- client_info->process_handle(),
- OnClientEnd,
- client_info,
- INFINITE,
- WT_EXECUTEONLYONCE)) {
- return false;
- }
-
- client_info->set_process_exit_wait_handle(process_wait_handle);
-
- // New scope to hold the lock for the shortest time.
- {
- AutoCriticalSection lock(&sync_);
- if (shutting_down_) {
- // If server is shutting down, don't add new clients
- return false;
- }
- clients_.push_back(client_info);
- }
-
- return true;
-}
-
-// static
-void CALLBACK CrashGenerationServer::OnPipeConnected(void* context, BOOLEAN) {
- assert(context);
-
- CrashGenerationServer* obj =
- reinterpret_cast<CrashGenerationServer*>(context);
- obj->HandleConnectionRequest();
-}
-
-// static
-void CALLBACK CrashGenerationServer::OnDumpRequest(void* context, BOOLEAN) {
- assert(context);
- ClientInfo* client_info = reinterpret_cast<ClientInfo*>(context);
-
- CrashGenerationServer* crash_server = client_info->crash_server();
- assert(crash_server);
- if (crash_server->pre_fetch_custom_info_) {
- client_info->PopulateCustomInfo();
- }
- crash_server->HandleDumpRequest(*client_info);
-
- ResetEvent(client_info->dump_requested_handle());
-}
-
-// static
-void CALLBACK CrashGenerationServer::OnClientEnd(void* context, BOOLEAN) {
- assert(context);
- ClientInfo* client_info = reinterpret_cast<ClientInfo*>(context);
-
- CrashGenerationServer* crash_server = client_info->crash_server();
- assert(crash_server);
-
- crash_server->HandleClientProcessExit(client_info);
-}
-
-void CrashGenerationServer::HandleClientProcessExit(ClientInfo* client_info) {
- assert(client_info);
-
- // Must unregister the dump request wait operation and wait for any
- // dump requests that might be pending to finish before proceeding
- // with the client_info cleanup.
- client_info->UnregisterDumpRequestWaitAndBlockUntilNoPending();
-
- if (exit_callback_) {
- exit_callback_(exit_context_, client_info);
- }
-
- // Start a new scope to release lock automatically.
- {
- AutoCriticalSection lock(&sync_);
- if (shutting_down_) {
- // The crash generation server is shutting down and as part of the
- // shutdown process it will delete all clients from the clients_ list.
- return;
- }
- clients_.remove(client_info);
- }
-
- // Explicitly unregister the process exit wait using the non-blocking method.
- // Otherwise, the destructor will attempt to unregister it using the blocking
- // method which will lead to a deadlock because it is being called from the
- // callback of the same wait operation
- client_info->UnregisterProcessExitWait(false);
-
- delete client_info;
-}
-
-void CrashGenerationServer::HandleDumpRequest(const ClientInfo& client_info) {
- bool execute_callback = true;
- // Generate the dump only if it's explicitly requested by the
- // server application; otherwise the server might want to generate
- // dump in the callback.
- std::wstring dump_path;
- if (generate_dumps_) {
- if (!GenerateDump(client_info, &dump_path)) {
- // client proccess terminated or some other error
- execute_callback = false;
- }
- }
-
- if (dump_callback_ && execute_callback) {
- std::wstring* ptr_dump_path = (dump_path == L"") ? NULL : &dump_path;
- dump_callback_(dump_context_, &client_info, ptr_dump_path);
- }
-
- SetEvent(client_info.dump_generated_handle());
-}
-
-bool CrashGenerationServer::GenerateDump(const ClientInfo& client,
- std::wstring* dump_path) {
- assert(client.pid() != 0);
- assert(client.process_handle());
-
- // We have to get the address of EXCEPTION_INFORMATION from
- // the client process address space.
- EXCEPTION_POINTERS* client_ex_info = NULL;
- if (!client.GetClientExceptionInfo(&client_ex_info)) {
- return false;
- }
-
- DWORD client_thread_id = 0;
- if (!client.GetClientThreadId(&client_thread_id)) {
- return false;
- }
-
- MinidumpGenerator dump_generator(dump_path_,
- client.process_handle(),
- client.pid(),
- client_thread_id,
- GetCurrentThreadId(),
- client_ex_info,
- client.assert_info(),
- client.dump_type(),
- true);
- if (!dump_generator.GenerateDumpFile(dump_path)) {
- return false;
- }
- return dump_generator.WriteMinidump();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h
deleted file mode 100644
index 0ea90e5100..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/crash_generation_server.h
+++ /dev/null
@@ -1,299 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_SERVER_H__
-#define CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_SERVER_H__
-
-#include <list>
-#include <string>
-#include "client/windows/common/ipc_protocol.h"
-#include "client/windows/crash_generation/minidump_generator.h"
-#include "common/scoped_ptr.h"
-
-namespace google_breakpad {
-class ClientInfo;
-
-// Abstraction for server side implementation of out-of-process crash
-// generation protocol for Windows platform only. It generates Windows
-// minidump files for client processes that request dump generation. When
-// the server is requested to start listening for clients (by calling the
-// Start method), it creates a named pipe and waits for the clients to
-// register. In response, it hands them event handles that the client can
-// signal to request dump generation. When the clients request dump
-// generation in this way, the server generates Windows minidump files.
-class CrashGenerationServer {
- public:
- typedef void (*OnClientConnectedCallback)(void* context,
- const ClientInfo* client_info);
-
- typedef void (*OnClientDumpRequestCallback)(void* context,
- const ClientInfo* client_info,
- const std::wstring* file_path);
-
- typedef void (*OnClientExitedCallback)(void* context,
- const ClientInfo* client_info);
-
- typedef void (*OnClientUploadRequestCallback)(void* context,
- const DWORD crash_id);
-
- // Creates an instance with the given parameters.
- //
- // Parameter pipe_name: Name of the Windows named pipe
- // Parameter pipe_sec_attrs Security attributes to set on the pipe. Pass
- // NULL to use default security on the pipe. By default, the pipe created
- // allows Local System, Administrators and the Creator full control and
- // the Everyone group read access on the pipe.
- // Parameter connect_callback: Callback for a new client connection.
- // Parameter connect_context: Context for client connection callback.
- // Parameter crash_callback: Callback for a client crash dump request.
- // Parameter crash_context: Context for client crash dump request callback.
- // Parameter exit_callback: Callback for client process exit.
- // Parameter exit_context: Context for client exit callback.
- // Parameter generate_dumps: Whether to automatically generate dumps.
- // Client code of this class might want to generate dumps explicitly in the
- // crash dump request callback. In that case, false can be passed for this
- // parameter.
- // Parameter dump_path: Path for generating dumps; required only if true is
- // passed for generateDumps parameter; NULL can be passed otherwise.
- CrashGenerationServer(const std::wstring& pipe_name,
- SECURITY_ATTRIBUTES* pipe_sec_attrs,
- OnClientConnectedCallback connect_callback,
- void* connect_context,
- OnClientDumpRequestCallback dump_callback,
- void* dump_context,
- OnClientExitedCallback exit_callback,
- void* exit_context,
- OnClientUploadRequestCallback upload_request_callback,
- void* upload_context,
- bool generate_dumps,
- const std::wstring* dump_path);
-
- ~CrashGenerationServer();
-
- // Performs initialization steps needed to start listening to clients. Upon
- // successful return clients may connect to this server's pipe.
- //
- // Returns true if initialization is successful; false otherwise.
- bool Start();
-
- void pre_fetch_custom_info(bool do_pre_fetch) {
- pre_fetch_custom_info_ = do_pre_fetch;
- }
-
- private:
- // Various states the client can be in during the handshake with
- // the server.
- enum IPCServerState {
- // Server starts in this state.
- IPC_SERVER_STATE_UNINITIALIZED,
-
- // Server is in error state and it cannot serve any clients.
- IPC_SERVER_STATE_ERROR,
-
- // Server starts in this state.
- IPC_SERVER_STATE_INITIAL,
-
- // Server has issued an async connect to the pipe and it is waiting
- // for the connection to be established.
- IPC_SERVER_STATE_CONNECTING,
-
- // Server is connected successfully.
- IPC_SERVER_STATE_CONNECTED,
-
- // Server has issued an async read from the pipe and it is waiting for
- // the read to finish.
- IPC_SERVER_STATE_READING,
-
- // Server is done reading from the pipe.
- IPC_SERVER_STATE_READ_DONE,
-
- // Server has issued an async write to the pipe and it is waiting for
- // the write to finish.
- IPC_SERVER_STATE_WRITING,
-
- // Server is done writing to the pipe.
- IPC_SERVER_STATE_WRITE_DONE,
-
- // Server has issued an async read from the pipe for an ack and it
- // is waiting for the read to finish.
- IPC_SERVER_STATE_READING_ACK,
-
- // Server is done writing to the pipe and it is now ready to disconnect
- // and reconnect.
- IPC_SERVER_STATE_DISCONNECTING
- };
-
- //
- // Helper methods to handle various server IPC states.
- //
- void HandleErrorState();
- void HandleInitialState();
- void HandleConnectingState();
- void HandleConnectedState();
- void HandleReadingState();
- void HandleReadDoneState();
- void HandleWritingState();
- void HandleWriteDoneState();
- void HandleReadingAckState();
- void HandleDisconnectingState();
-
- // Prepares reply for a client from the given parameters.
- bool PrepareReply(const ClientInfo& client_info,
- ProtocolMessage* reply) const;
-
- // Duplicates various handles in the ClientInfo object for the client
- // process and stores them in the given ProtocolMessage instance. If
- // creating any handle fails, ProtocolMessage will contain the handles
- // already created successfully, which should be closed by the caller.
- bool CreateClientHandles(const ClientInfo& client_info,
- ProtocolMessage* reply) const;
-
- // Response to the given client. Return true if all steps of
- // responding to the client succeed, false otherwise.
- bool RespondToClient(ClientInfo* client_info);
-
- // Handles a connection request from the client.
- void HandleConnectionRequest();
-
- // Handles a dump request from the client.
- void HandleDumpRequest(const ClientInfo& client_info);
-
- // Callback for pipe connected event.
- static void CALLBACK OnPipeConnected(void* context, BOOLEAN timer_or_wait);
-
- // Callback for a dump request.
- static void CALLBACK OnDumpRequest(void* context, BOOLEAN timer_or_wait);
-
- // Callback for client process exit event.
- static void CALLBACK OnClientEnd(void* context, BOOLEAN timer_or_wait);
-
- // Handles client process exit.
- void HandleClientProcessExit(ClientInfo* client_info);
-
- // Adds the given client to the list of registered clients.
- bool AddClient(ClientInfo* client_info);
-
- // Generates dump for the given client.
- bool GenerateDump(const ClientInfo& client, std::wstring* dump_path);
-
- // Puts the server in a permanent error state and sets a signal such that
- // the state will be immediately entered after the current state transition
- // is complete.
- void EnterErrorState();
-
- // Puts the server in the specified state and sets a signal such that the
- // state is immediately entered after the current state transition is
- // complete.
- void EnterStateImmediately(IPCServerState state);
-
- // Puts the server in the specified state. No signal will be set, so the state
- // transition will only occur when signaled manually or by completion of an
- // asynchronous IO operation.
- void EnterStateWhenSignaled(IPCServerState state);
-
- // Sync object for thread-safe access to the shared list of clients.
- CRITICAL_SECTION sync_;
-
- // List of clients.
- std::list<ClientInfo*> clients_;
-
- // Pipe name.
- std::wstring pipe_name_;
-
- // Pipe security attributes
- SECURITY_ATTRIBUTES* pipe_sec_attrs_;
-
- // Handle to the pipe used for handshake with clients.
- HANDLE pipe_;
-
- // Pipe wait handle.
- HANDLE pipe_wait_handle_;
-
- // Handle to server-alive mutex.
- HANDLE server_alive_handle_;
-
- // Callback for a successful client connection.
- OnClientConnectedCallback connect_callback_;
-
- // Context for client connected callback.
- void* connect_context_;
-
- // Callback for a client dump request.
- OnClientDumpRequestCallback dump_callback_;
-
- // Context for client dump request callback.
- void* dump_context_;
-
- // Callback for client process exit.
- OnClientExitedCallback exit_callback_;
-
- // Context for client process exit callback.
- void* exit_context_;
-
- // Callback for upload request.
- OnClientUploadRequestCallback upload_request_callback_;
-
- // Context for upload request callback.
- void* upload_context_;
-
- // Whether to generate dumps.
- bool generate_dumps_;
-
- // Wether to populate custom information up-front.
- bool pre_fetch_custom_info_;
-
- // The dump path for the server.
- const std::wstring dump_path_;
-
- // State of the server in performing the IPC with the client.
- // Note that since we restrict the pipe to one instance, we
- // only need to keep one state of the server. Otherwise, server
- // would have one state per client it is talking to.
- IPCServerState server_state_;
-
- // Whether the server is shutting down.
- bool shutting_down_;
-
- // Overlapped instance for async I/O on the pipe.
- OVERLAPPED overlapped_;
-
- // Message object used in IPC with the client.
- ProtocolMessage msg_;
-
- // Client Info for the client that's connecting to the server.
- ClientInfo* client_info_;
-
- // Disable copy ctor and operator=.
- CrashGenerationServer(const CrashGenerationServer& crash_server);
- CrashGenerationServer& operator=(const CrashGenerationServer& crash_server);
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_CRASH_GENERATION_CRASH_GENERATION_SERVER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.cc
deleted file mode 100644
index 786c9b9372..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.cc
+++ /dev/null
@@ -1,579 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/windows/crash_generation/minidump_generator.h"
-
-#include <assert.h>
-#include <avrfsdk.h>
-
-#include <algorithm>
-#include <iterator>
-#include <list>
-#include <vector>
-
-#include "client/windows/common/auto_critical_section.h"
-#include "common/scoped_ptr.h"
-#include "common/windows/guid_string.h"
-
-using std::wstring;
-
-namespace {
-
-// A helper class used to collect handle operations data. Unlike
-// |MiniDumpWithHandleData| it records the operations for a single handle value
-// only, making it possible to include this information to a minidump.
-class HandleTraceData {
- public:
- HandleTraceData();
- ~HandleTraceData();
-
- // Collects the handle operations data and formats a user stream to be added
- // to the minidump.
- bool CollectHandleData(HANDLE process_handle,
- EXCEPTION_POINTERS* exception_pointers);
-
- // Fills the user dump entry with a pointer to the collected handle operations
- // data. Returns |true| if the entry was initialized successfully, or |false|
- // if no trace data is available.
- bool GetUserStream(MINIDUMP_USER_STREAM* user_stream);
-
- private:
- // Reads the exception code from the client process's address space.
- // This routine assumes that the client process's pointer width matches ours.
- static bool ReadExceptionCode(HANDLE process_handle,
- EXCEPTION_POINTERS* exception_pointers,
- DWORD* exception_code);
-
- // Stores handle operations retrieved by VerifierEnumerateResource().
- static ULONG CALLBACK RecordHandleOperations(void* resource_description,
- void* enumeration_context,
- ULONG* enumeration_level);
-
- // Function pointer type for VerifierEnumerateResource, which is looked up
- // dynamically.
- typedef BOOL (WINAPI* VerifierEnumerateResourceType)(
- HANDLE Process,
- ULONG Flags,
- ULONG ResourceType,
- AVRF_RESOURCE_ENUMERATE_CALLBACK ResourceCallback,
- PVOID EnumerationContext);
-
- // Handle to dynamically loaded verifier.dll.
- HMODULE verifier_module_;
-
- // Pointer to the VerifierEnumerateResource function.
- VerifierEnumerateResourceType enumerate_resource_;
-
- // Handle value to look for.
- ULONG64 handle_;
-
- // List of handle operations for |handle_|.
- std::list<AVRF_HANDLE_OPERATION> operations_;
-
- // Minidump stream data.
- std::vector<char> stream_;
-};
-
-HandleTraceData::HandleTraceData()
- : verifier_module_(NULL),
- enumerate_resource_(NULL),
- handle_(NULL) {
-}
-
-HandleTraceData::~HandleTraceData() {
- if (verifier_module_) {
- FreeLibrary(verifier_module_);
- }
-}
-
-bool HandleTraceData::CollectHandleData(
- HANDLE process_handle,
- EXCEPTION_POINTERS* exception_pointers) {
- DWORD exception_code;
- if (!ReadExceptionCode(process_handle, exception_pointers, &exception_code)) {
- return false;
- }
-
- // Verify whether the execption is STATUS_INVALID_HANDLE. Do not record any
- // handle information if it is a different exception to keep the minidump
- // small.
- if (exception_code != STATUS_INVALID_HANDLE) {
- return true;
- }
-
- // Load verifier!VerifierEnumerateResource() dynamically.
- verifier_module_ = LoadLibrary(TEXT("verifier.dll"));
- if (!verifier_module_) {
- return false;
- }
-
- enumerate_resource_ = reinterpret_cast<VerifierEnumerateResourceType>(
- GetProcAddress(verifier_module_, "VerifierEnumerateResource"));
- if (!enumerate_resource_) {
- return false;
- }
-
- // STATUS_INVALID_HANDLE does not provide the offending handle value in
- // the exception parameters so we have to guess. At the moment we scan
- // the handle operations trace looking for the last invalid handle operation
- // and record only the operations for that handle value.
- if (enumerate_resource_(process_handle,
- 0,
- AvrfResourceHandleTrace,
- &RecordHandleOperations,
- this) != ERROR_SUCCESS) {
- // The handle tracing must have not been enabled.
- return true;
- }
-
- // Now that |handle_| is initialized, purge all irrelevant operations.
- std::list<AVRF_HANDLE_OPERATION>::iterator i = operations_.begin();
- std::list<AVRF_HANDLE_OPERATION>::iterator i_end = operations_.end();
- while (i != i_end) {
- if (i->Handle == handle_) {
- ++i;
- } else {
- i = operations_.erase(i);
- }
- }
-
- // Convert the list of recorded operations to a minidump stream.
- stream_.resize(sizeof(MINIDUMP_HANDLE_OPERATION_LIST) +
- sizeof(AVRF_HANDLE_OPERATION) * operations_.size());
-
- MINIDUMP_HANDLE_OPERATION_LIST* stream_data =
- reinterpret_cast<MINIDUMP_HANDLE_OPERATION_LIST*>(
- &stream_.front());
- stream_data->SizeOfHeader = sizeof(MINIDUMP_HANDLE_OPERATION_LIST);
- stream_data->SizeOfEntry = sizeof(AVRF_HANDLE_OPERATION);
- stream_data->NumberOfEntries = static_cast<ULONG32>(operations_.size());
- stream_data->Reserved = 0;
- std::copy(operations_.begin(),
- operations_.end(),
-#ifdef _MSC_VER
- stdext::checked_array_iterator<AVRF_HANDLE_OPERATION*>(
- reinterpret_cast<AVRF_HANDLE_OPERATION*>(stream_data + 1),
- operations_.size())
-#else
- reinterpret_cast<AVRF_HANDLE_OPERATION*>(stream_data + 1)
-#endif
- );
-
- return true;
-}
-
-bool HandleTraceData::GetUserStream(MINIDUMP_USER_STREAM* user_stream) {
- if (stream_.empty()) {
- return false;
- } else {
- user_stream->Type = HandleOperationListStream;
- user_stream->BufferSize = static_cast<ULONG>(stream_.size());
- user_stream->Buffer = &stream_.front();
- return true;
- }
-}
-
-bool HandleTraceData::ReadExceptionCode(
- HANDLE process_handle,
- EXCEPTION_POINTERS* exception_pointers,
- DWORD* exception_code) {
- EXCEPTION_POINTERS pointers;
- if (!ReadProcessMemory(process_handle,
- exception_pointers,
- &pointers,
- sizeof(pointers),
- NULL)) {
- return false;
- }
-
- if (!ReadProcessMemory(process_handle,
- pointers.ExceptionRecord,
- exception_code,
- sizeof(*exception_code),
- NULL)) {
- return false;
- }
-
- return true;
-}
-
-ULONG CALLBACK HandleTraceData::RecordHandleOperations(
- void* resource_description,
- void* enumeration_context,
- ULONG* enumeration_level) {
- AVRF_HANDLE_OPERATION* description =
- reinterpret_cast<AVRF_HANDLE_OPERATION*>(resource_description);
- HandleTraceData* self =
- reinterpret_cast<HandleTraceData*>(enumeration_context);
-
- // Remember the last invalid handle operation.
- if (description->OperationType == OperationDbBADREF) {
- self->handle_ = description->Handle;
- }
-
- // Record all handle operations.
- self->operations_.push_back(*description);
-
- *enumeration_level = HeapEnumerationEverything;
- return ERROR_SUCCESS;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-MinidumpGenerator::MinidumpGenerator(
- const std::wstring& dump_path,
- const HANDLE process_handle,
- const DWORD process_id,
- const DWORD thread_id,
- const DWORD requesting_thread_id,
- EXCEPTION_POINTERS* exception_pointers,
- MDRawAssertionInfo* assert_info,
- const MINIDUMP_TYPE dump_type,
- const bool is_client_pointers)
- : dbghelp_module_(NULL),
- write_dump_(NULL),
- rpcrt4_module_(NULL),
- create_uuid_(NULL),
- process_handle_(process_handle),
- process_id_(process_id),
- thread_id_(thread_id),
- requesting_thread_id_(requesting_thread_id),
- exception_pointers_(exception_pointers),
- assert_info_(assert_info),
- dump_type_(dump_type),
- is_client_pointers_(is_client_pointers),
- dump_path_(dump_path),
- dump_file_(INVALID_HANDLE_VALUE),
- full_dump_file_(INVALID_HANDLE_VALUE),
- dump_file_is_internal_(false),
- full_dump_file_is_internal_(false),
- additional_streams_(NULL),
- callback_info_(NULL) {
- InitializeCriticalSection(&module_load_sync_);
- InitializeCriticalSection(&get_proc_address_sync_);
-}
-
-MinidumpGenerator::~MinidumpGenerator() {
- if (dump_file_is_internal_ && dump_file_ != INVALID_HANDLE_VALUE) {
- CloseHandle(dump_file_);
- }
-
- if (full_dump_file_is_internal_ && full_dump_file_ != INVALID_HANDLE_VALUE) {
- CloseHandle(full_dump_file_);
- }
-
- if (dbghelp_module_) {
- FreeLibrary(dbghelp_module_);
- }
-
- if (rpcrt4_module_) {
- FreeLibrary(rpcrt4_module_);
- }
-
- DeleteCriticalSection(&get_proc_address_sync_);
- DeleteCriticalSection(&module_load_sync_);
-}
-
-bool MinidumpGenerator::WriteMinidump() {
- bool full_memory_dump = (dump_type_ & MiniDumpWithFullMemory) != 0;
- if (dump_file_ == INVALID_HANDLE_VALUE ||
- (full_memory_dump && full_dump_file_ == INVALID_HANDLE_VALUE)) {
- return false;
- }
-
- MiniDumpWriteDumpType write_dump = GetWriteDump();
- if (!write_dump) {
- return false;
- }
-
- MINIDUMP_EXCEPTION_INFORMATION* dump_exception_pointers = NULL;
- MINIDUMP_EXCEPTION_INFORMATION dump_exception_info;
-
- // Setup the exception information object only if it's a dump
- // due to an exception.
- if (exception_pointers_) {
- dump_exception_pointers = &dump_exception_info;
- dump_exception_info.ThreadId = thread_id_;
- dump_exception_info.ExceptionPointers = exception_pointers_;
- dump_exception_info.ClientPointers = is_client_pointers_;
- }
-
- // Add an MDRawBreakpadInfo stream to the minidump, to provide additional
- // information about the exception handler to the Breakpad processor.
- // The information will help the processor determine which threads are
- // relevant. The Breakpad processor does not require this information but
- // can function better with Breakpad-generated dumps when it is present.
- // The native debugger is not harmed by the presence of this information.
- MDRawBreakpadInfo breakpad_info = {0};
- if (!is_client_pointers_) {
- // Set the dump thread id and requesting thread id only in case of
- // in-process dump generation.
- breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID |
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID;
- breakpad_info.dump_thread_id = thread_id_;
- breakpad_info.requesting_thread_id = requesting_thread_id_;
- }
-
- int additional_streams_count = additional_streams_ ?
- additional_streams_->UserStreamCount : 0;
- scoped_array<MINIDUMP_USER_STREAM> user_stream_array(
- new MINIDUMP_USER_STREAM[3 + additional_streams_count]);
- user_stream_array[0].Type = MD_BREAKPAD_INFO_STREAM;
- user_stream_array[0].BufferSize = sizeof(breakpad_info);
- user_stream_array[0].Buffer = &breakpad_info;
-
- MINIDUMP_USER_STREAM_INFORMATION user_streams;
- user_streams.UserStreamCount = 1;
- user_streams.UserStreamArray = user_stream_array.get();
-
- MDRawAssertionInfo* actual_assert_info = assert_info_;
- MDRawAssertionInfo client_assert_info = {{0}};
-
- if (assert_info_) {
- // If the assertion info object lives in the client process,
- // read the memory of the client process.
- if (is_client_pointers_) {
- SIZE_T bytes_read = 0;
- if (!ReadProcessMemory(process_handle_,
- assert_info_,
- &client_assert_info,
- sizeof(client_assert_info),
- &bytes_read)) {
- if (dump_file_is_internal_)
- CloseHandle(dump_file_);
- if (full_dump_file_is_internal_ &&
- full_dump_file_ != INVALID_HANDLE_VALUE)
- CloseHandle(full_dump_file_);
- return false;
- }
-
- if (bytes_read != sizeof(client_assert_info)) {
- if (dump_file_is_internal_)
- CloseHandle(dump_file_);
- if (full_dump_file_is_internal_ &&
- full_dump_file_ != INVALID_HANDLE_VALUE)
- CloseHandle(full_dump_file_);
- return false;
- }
-
- actual_assert_info = &client_assert_info;
- }
-
- user_stream_array[1].Type = MD_ASSERTION_INFO_STREAM;
- user_stream_array[1].BufferSize = sizeof(MDRawAssertionInfo);
- user_stream_array[1].Buffer = actual_assert_info;
- ++user_streams.UserStreamCount;
- }
-
- if (additional_streams_) {
- for (size_t i = 0;
- i < additional_streams_->UserStreamCount;
- i++, user_streams.UserStreamCount++) {
- user_stream_array[user_streams.UserStreamCount].Type =
- additional_streams_->UserStreamArray[i].Type;
- user_stream_array[user_streams.UserStreamCount].BufferSize =
- additional_streams_->UserStreamArray[i].BufferSize;
- user_stream_array[user_streams.UserStreamCount].Buffer =
- additional_streams_->UserStreamArray[i].Buffer;
- }
- }
-
- // If the process is terminated by STATUS_INVALID_HANDLE exception store
- // the trace of operations for the offending handle value. Do nothing special
- // if the client already requested the handle trace to be stored in the dump.
- HandleTraceData handle_trace_data;
- if (exception_pointers_ && (dump_type_ & MiniDumpWithHandleData) == 0) {
- if (!handle_trace_data.CollectHandleData(process_handle_,
- exception_pointers_)) {
- if (dump_file_is_internal_)
- CloseHandle(dump_file_);
- if (full_dump_file_is_internal_ &&
- full_dump_file_ != INVALID_HANDLE_VALUE)
- CloseHandle(full_dump_file_);
- return false;
- }
- }
-
- bool result_full_memory = true;
- if (full_memory_dump) {
- result_full_memory = write_dump(
- process_handle_,
- process_id_,
- full_dump_file_,
- static_cast<MINIDUMP_TYPE>((dump_type_ & (~MiniDumpNormal))
- | MiniDumpWithHandleData),
- exception_pointers_ ? &dump_exception_info : NULL,
- &user_streams,
- NULL) != FALSE;
- }
-
- // Add handle operations trace stream to the minidump if it was collected.
- if (handle_trace_data.GetUserStream(
- &user_stream_array[user_streams.UserStreamCount])) {
- ++user_streams.UserStreamCount;
- }
-
- bool result_minidump = write_dump(
- process_handle_,
- process_id_,
- dump_file_,
- static_cast<MINIDUMP_TYPE>((dump_type_ & (~MiniDumpWithFullMemory))
- | MiniDumpNormal),
- exception_pointers_ ? &dump_exception_info : NULL,
- &user_streams,
- callback_info_) != FALSE;
-
- return result_minidump && result_full_memory;
-}
-
-bool MinidumpGenerator::GenerateDumpFile(wstring* dump_path) {
- // The dump file was already set by handle or this function was previously
- // called.
- if (dump_file_ != INVALID_HANDLE_VALUE) {
- return false;
- }
-
- wstring dump_file_path;
- if (!GenerateDumpFilePath(&dump_file_path)) {
- return false;
- }
-
- dump_file_ = CreateFile(dump_file_path.c_str(),
- GENERIC_WRITE,
- 0,
- NULL,
- CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (dump_file_ == INVALID_HANDLE_VALUE) {
- return false;
- }
-
- dump_file_is_internal_ = true;
- *dump_path = dump_file_path;
- return true;
-}
-
-bool MinidumpGenerator::GenerateFullDumpFile(wstring* full_dump_path) {
- // A full minidump was not requested.
- if ((dump_type_ & MiniDumpWithFullMemory) == 0) {
- return false;
- }
-
- // The dump file was already set by handle or this function was previously
- // called.
- if (full_dump_file_ != INVALID_HANDLE_VALUE) {
- return false;
- }
-
- wstring full_dump_file_path;
- if (!GenerateDumpFilePath(&full_dump_file_path)) {
- return false;
- }
- full_dump_file_path.resize(full_dump_file_path.size() - 4); // strip .dmp
- full_dump_file_path.append(TEXT("-full.dmp"));
-
- full_dump_file_ = CreateFile(full_dump_file_path.c_str(),
- GENERIC_WRITE,
- 0,
- NULL,
- CREATE_NEW,
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (full_dump_file_ == INVALID_HANDLE_VALUE) {
- return false;
- }
-
- full_dump_file_is_internal_ = true;
- *full_dump_path = full_dump_file_path;
- return true;
-}
-
-HMODULE MinidumpGenerator::GetDbghelpModule() {
- AutoCriticalSection lock(&module_load_sync_);
- if (!dbghelp_module_) {
- dbghelp_module_ = LoadLibrary(TEXT("dbghelp.dll"));
- }
-
- return dbghelp_module_;
-}
-
-MinidumpGenerator::MiniDumpWriteDumpType MinidumpGenerator::GetWriteDump() {
- AutoCriticalSection lock(&get_proc_address_sync_);
- if (!write_dump_) {
- HMODULE module = GetDbghelpModule();
- if (module) {
- FARPROC proc = GetProcAddress(module, "MiniDumpWriteDump");
- write_dump_ = reinterpret_cast<MiniDumpWriteDumpType>(proc);
- }
- }
-
- return write_dump_;
-}
-
-HMODULE MinidumpGenerator::GetRpcrt4Module() {
- AutoCriticalSection lock(&module_load_sync_);
- if (!rpcrt4_module_) {
- rpcrt4_module_ = LoadLibrary(TEXT("rpcrt4.dll"));
- }
-
- return rpcrt4_module_;
-}
-
-MinidumpGenerator::UuidCreateType MinidumpGenerator::GetCreateUuid() {
- AutoCriticalSection lock(&module_load_sync_);
- if (!create_uuid_) {
- HMODULE module = GetRpcrt4Module();
- if (module) {
- FARPROC proc = GetProcAddress(module, "UuidCreate");
- create_uuid_ = reinterpret_cast<UuidCreateType>(proc);
- }
- }
-
- return create_uuid_;
-}
-
-bool MinidumpGenerator::GenerateDumpFilePath(wstring* file_path) {
- UUID id = {0};
-
- UuidCreateType create_uuid = GetCreateUuid();
- if (!create_uuid) {
- return false;
- }
-
- create_uuid(&id);
- wstring id_str = GUIDString::GUIDToWString(&id);
-
- *file_path = dump_path_ + TEXT("\\") + id_str + TEXT(".dmp");
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.h b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.h
deleted file mode 100644
index a3c123056f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/minidump_generator.h
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_CRASH_GENERATION_MINIDUMP_GENERATOR_H_
-#define CLIENT_WINDOWS_CRASH_GENERATION_MINIDUMP_GENERATOR_H_
-
-#include <windows.h>
-#include <dbghelp.h>
-#include <rpc.h>
-#include <list>
-#include <string>
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// Abstraction for various objects and operations needed to generate
-// minidump on Windows. This abstraction is useful to hide all the gory
-// details for minidump generation and provide a clean interface to
-// the clients to generate minidumps.
-class MinidumpGenerator {
- public:
- // Creates an instance with the given parameters.
- // is_client_pointers specifies whether the exception_pointers and
- // assert_info point into the process that is being dumped.
- // Before calling WriteMinidump on the returned instance a dump file muct be
- // specified by a call to either SetDumpFile() or GenerateDumpFile().
- // If a full dump file will be requested via a subsequent call to either
- // SetFullDumpFile or GenerateFullDumpFile() dump_type must include
- // MiniDumpWithFullMemory.
- MinidumpGenerator(const std::wstring& dump_path,
- const HANDLE process_handle,
- const DWORD process_id,
- const DWORD thread_id,
- const DWORD requesting_thread_id,
- EXCEPTION_POINTERS* exception_pointers,
- MDRawAssertionInfo* assert_info,
- const MINIDUMP_TYPE dump_type,
- const bool is_client_pointers);
-
- ~MinidumpGenerator();
-
- void SetDumpFile(const HANDLE dump_file) { dump_file_ = dump_file; }
- void SetFullDumpFile(const HANDLE full_dump_file) {
- full_dump_file_ = full_dump_file;
- }
-
- // Generate the name for the dump file that will be written to once
- // WriteMinidump() is called. Can only be called once and cannot be called
- // if the dump file is set via SetDumpFile().
- bool GenerateDumpFile(std::wstring* dump_path);
-
- // Generate the name for the full dump file that will be written to once
- // WriteMinidump() is called. Cannot be called unless the minidump type
- // includes MiniDumpWithFullMemory. Can only be called once and cannot be
- // called if the dump file is set via SetFullDumpFile().
- bool GenerateFullDumpFile(std::wstring* full_dump_path);
-
- void SetAdditionalStreams(
- MINIDUMP_USER_STREAM_INFORMATION* additional_streams) {
- additional_streams_ = additional_streams;
- }
-
- void SetCallback(MINIDUMP_CALLBACK_INFORMATION* callback_info) {
- callback_info_ = callback_info;
- }
-
- // Writes the minidump with the given parameters. Stores the
- // dump file path in the dump_path parameter if dump generation
- // succeeds.
- bool WriteMinidump();
-
- private:
- // Function pointer type for MiniDumpWriteDump, which is looked up
- // dynamically.
- typedef BOOL (WINAPI* MiniDumpWriteDumpType)(
- HANDLE hProcess,
- DWORD ProcessId,
- HANDLE hFile,
- MINIDUMP_TYPE DumpType,
- CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
- CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
- CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam);
-
- // Function pointer type for UuidCreate, which is looked up dynamically.
- typedef RPC_STATUS (RPC_ENTRY* UuidCreateType)(UUID* Uuid);
-
- // Loads the appropriate DLL lazily in a thread safe way.
- HMODULE GetDbghelpModule();
-
- // Loads the appropriate DLL and gets a pointer to the MiniDumpWriteDump
- // function lazily and in a thread-safe manner.
- MiniDumpWriteDumpType GetWriteDump();
-
- // Loads the appropriate DLL lazily in a thread safe way.
- HMODULE GetRpcrt4Module();
-
- // Loads the appropriate DLL and gets a pointer to the UuidCreate
- // function lazily and in a thread-safe manner.
- UuidCreateType GetCreateUuid();
-
- // Returns the path for the file to write dump to.
- bool GenerateDumpFilePath(std::wstring* file_path);
-
- // Handle to dynamically loaded DbgHelp.dll.
- HMODULE dbghelp_module_;
-
- // Pointer to the MiniDumpWriteDump function.
- MiniDumpWriteDumpType write_dump_;
-
- // Handle to dynamically loaded rpcrt4.dll.
- HMODULE rpcrt4_module_;
-
- // Pointer to the UuidCreate function.
- UuidCreateType create_uuid_;
-
- // Handle for the process to dump.
- HANDLE process_handle_;
-
- // Process ID for the process to dump.
- DWORD process_id_;
-
- // The crashing thread ID.
- DWORD thread_id_;
-
- // The thread ID which is requesting the dump.
- DWORD requesting_thread_id_;
-
- // Pointer to the exception information for the crash. This may point to an
- // address in the crashing process so it should not be dereferenced.
- EXCEPTION_POINTERS* exception_pointers_;
-
- // Assertion info for the report.
- MDRawAssertionInfo* assert_info_;
-
- // Type of minidump to generate.
- MINIDUMP_TYPE dump_type_;
-
- // Specifies whether the exception_pointers_ reference memory in the crashing
- // process.
- bool is_client_pointers_;
-
- // Folder path to store dump files.
- std::wstring dump_path_;
-
- // The file where the dump will be written.
- HANDLE dump_file_;
-
- // The file where the full dump will be written.
- HANDLE full_dump_file_;
-
- // Tracks whether the dump file handle is managed externally.
- bool dump_file_is_internal_;
-
- // Tracks whether the full dump file handle is managed externally.
- bool full_dump_file_is_internal_;
-
- // Additional streams to be written to the dump.
- MINIDUMP_USER_STREAM_INFORMATION* additional_streams_;
-
- // The user defined callback for the various stages of the dump process.
- MINIDUMP_CALLBACK_INFORMATION* callback_info_;
-
- // Critical section to sychronize action of loading modules dynamically.
- CRITICAL_SECTION module_load_sync_;
-
- // Critical section to synchronize action of dynamically getting function
- // addresses from modules.
- CRITICAL_SECTION get_proc_address_sync_;
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_CRASH_GENERATION_MINIDUMP_GENERATOR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild b/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild
deleted file mode 100644
index 549c14e10a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation/objs.mozbuild
+++ /dev/null
@@ -1,17 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-lobjs_crash_generation = [
- 'client_info.cc',
- 'crash_generation_client.cc',
- 'crash_generation_server.cc',
- 'minidump_generator.cc',
-]
-
-subdir = 'toolkit/crashreporter/google-breakpad/src/client/windows/crash_generation'
-objs_crash_generation = [
- '/%s/%s' % (subdir, s) for s in lobjs_crash_generation
-]
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc
deleted file mode 100644
index 1f7b19f9a6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.cc
+++ /dev/null
@@ -1,1073 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <objbase.h>
-
-#include <algorithm>
-#include <cassert>
-#include <cstdio>
-
-#include "common/windows/string_utils-inl.h"
-
-#include "client/windows/common/ipc_protocol.h"
-#include "client/windows/handler/exception_handler.h"
-#include "common/windows/guid_string.h"
-
-namespace google_breakpad {
-
-// This is passed as the context to the MinidumpWriteDump callback.
-typedef struct {
- AppMemoryList::const_iterator iter;
- AppMemoryList::const_iterator end;
-} MinidumpCallbackContext;
-
-vector<ExceptionHandler*>* ExceptionHandler::handler_stack_ = NULL;
-LONG ExceptionHandler::handler_stack_index_ = 0;
-CRITICAL_SECTION ExceptionHandler::handler_stack_critical_section_;
-volatile LONG ExceptionHandler::instance_count_ = 0;
-
-ExceptionHandler::ExceptionHandler(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- MINIDUMP_TYPE dump_type,
- const wchar_t* pipe_name,
- const CustomClientInfo* custom_info) {
- Initialize(dump_path,
- filter,
- callback,
- callback_context,
- handler_types,
- dump_type,
- pipe_name,
- NULL, // pipe_handle
- NULL, // crash_generation_client
- custom_info);
-}
-
-ExceptionHandler::ExceptionHandler(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- MINIDUMP_TYPE dump_type,
- HANDLE pipe_handle,
- const CustomClientInfo* custom_info) {
- Initialize(dump_path,
- filter,
- callback,
- callback_context,
- handler_types,
- dump_type,
- NULL, // pipe_name
- pipe_handle,
- NULL, // crash_generation_client
- custom_info);
-}
-
-ExceptionHandler::ExceptionHandler(
- const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- CrashGenerationClient* crash_generation_client) {
- // The dump_type, pipe_name and custom_info that are passed in to Initialize()
- // are not used. The ones set in crash_generation_client are used instead.
- Initialize(dump_path,
- filter,
- callback,
- callback_context,
- handler_types,
- MiniDumpNormal, // dump_type - not used
- NULL, // pipe_name - not used
- NULL, // pipe_handle
- crash_generation_client,
- NULL); // custom_info - not used
-}
-
-ExceptionHandler::ExceptionHandler(const wstring &dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types) {
- Initialize(dump_path,
- filter,
- callback,
- callback_context,
- handler_types,
- MiniDumpNormal,
- NULL, // pipe_name
- NULL, // pipe_handle
- NULL, // crash_generation_client
- NULL); // custom_info
-}
-
-void ExceptionHandler::Initialize(
- const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- MINIDUMP_TYPE dump_type,
- const wchar_t* pipe_name,
- HANDLE pipe_handle,
- CrashGenerationClient* crash_generation_client,
- const CustomClientInfo* custom_info) {
- LONG instance_count = InterlockedIncrement(&instance_count_);
- filter_ = filter;
- callback_ = callback;
- callback_context_ = callback_context;
- dump_path_c_ = NULL;
- next_minidump_id_c_ = NULL;
- next_minidump_path_c_ = NULL;
- dbghelp_module_ = NULL;
- minidump_write_dump_ = NULL;
- dump_type_ = dump_type;
- rpcrt4_module_ = NULL;
- uuid_create_ = NULL;
- handler_types_ = handler_types;
- previous_filter_ = NULL;
-#if _MSC_VER >= 1400 // MSVC 2005/8
- previous_iph_ = NULL;
-#endif // _MSC_VER >= 1400
- previous_pch_ = NULL;
- handler_thread_ = NULL;
- is_shutdown_ = false;
- handler_start_semaphore_ = NULL;
- handler_finish_semaphore_ = NULL;
- requesting_thread_id_ = 0;
- exception_info_ = NULL;
- assertion_ = NULL;
- handler_return_value_ = false;
- handle_debug_exceptions_ = false;
- consume_invalid_handle_exceptions_ = false;
-
- // Attempt to use out-of-process if user has specified a pipe or a
- // crash generation client.
- scoped_ptr<CrashGenerationClient> client;
- if (crash_generation_client) {
- client.reset(crash_generation_client);
- } else if (pipe_name) {
- client.reset(
- new CrashGenerationClient(pipe_name, dump_type_, custom_info));
- } else if (pipe_handle) {
- client.reset(
- new CrashGenerationClient(pipe_handle, dump_type_, custom_info));
- }
-
- if (client.get() != NULL) {
- // If successful in registering with the monitoring process,
- // there is no need to setup in-process crash generation.
- if (client->Register()) {
- crash_generation_client_.reset(client.release());
- }
- }
-
- if (!IsOutOfProcess()) {
- // Either client did not ask for out-of-process crash generation
- // or registration with the server process failed. In either case,
- // setup to do in-process crash generation.
-
- // Set synchronization primitives and the handler thread. Each
- // ExceptionHandler object gets its own handler thread because that's the
- // only way to reliably guarantee sufficient stack space in an exception,
- // and it allows an easy way to get a snapshot of the requesting thread's
- // context outside of an exception.
- InitializeCriticalSection(&handler_critical_section_);
- handler_start_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL);
- assert(handler_start_semaphore_ != NULL);
-
- handler_finish_semaphore_ = CreateSemaphore(NULL, 0, 1, NULL);
- assert(handler_finish_semaphore_ != NULL);
-
- // Don't attempt to create the thread if we could not create the semaphores.
- if (handler_finish_semaphore_ != NULL && handler_start_semaphore_ != NULL) {
- DWORD thread_id;
- const int kExceptionHandlerThreadInitialStackSize = 64 * 1024;
- handler_thread_ = CreateThread(NULL, // lpThreadAttributes
- kExceptionHandlerThreadInitialStackSize,
- ExceptionHandlerThreadMain,
- this, // lpParameter
- 0, // dwCreationFlags
- &thread_id);
- assert(handler_thread_ != NULL);
- }
-
- dbghelp_module_ = LoadLibrary(L"dbghelp.dll");
- if (dbghelp_module_) {
- minidump_write_dump_ = reinterpret_cast<MiniDumpWriteDump_type>(
- GetProcAddress(dbghelp_module_, "MiniDumpWriteDump"));
- }
-
- // Load this library dynamically to not affect existing projects. Most
- // projects don't link against this directly, it's usually dynamically
- // loaded by dependent code.
- rpcrt4_module_ = LoadLibrary(L"rpcrt4.dll");
- if (rpcrt4_module_) {
- uuid_create_ = reinterpret_cast<UuidCreate_type>(
- GetProcAddress(rpcrt4_module_, "UuidCreate"));
- }
-
- // set_dump_path calls UpdateNextID. This sets up all of the path and id
- // strings, and their equivalent c_str pointers.
- set_dump_path(dump_path);
- }
-
- // Reserve one element for the instruction memory
- AppMemory instruction_memory;
- instruction_memory.ptr = NULL;
- instruction_memory.length = 0;
- app_memory_info_.push_back(instruction_memory);
-
- // There is a race condition here. If the first instance has not yet
- // initialized the critical section, the second (and later) instances may
- // try to use uninitialized critical section object. The feature of multiple
- // instances in one module is not used much, so leave it as is for now.
- // One way to solve this in the current design (that is, keeping the static
- // handler stack) is to use spin locks with volatile bools to synchronize
- // the handler stack. This works only if the compiler guarantees to generate
- // cache coherent code for volatile.
- // TODO(munjal): Fix this in a better way by changing the design if possible.
-
- // Lazy initialization of the handler_stack_critical_section_
- if (instance_count == 1) {
- InitializeCriticalSection(&handler_stack_critical_section_);
- }
-
- if (handler_types != HANDLER_NONE) {
- EnterCriticalSection(&handler_stack_critical_section_);
-
- // The first time an ExceptionHandler that installs a handler is
- // created, set up the handler stack.
- if (!handler_stack_) {
- handler_stack_ = new vector<ExceptionHandler*>();
- }
- handler_stack_->push_back(this);
-
- if (handler_types & HANDLER_EXCEPTION)
- previous_filter_ = SetUnhandledExceptionFilter(HandleException);
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
- if (handler_types & HANDLER_INVALID_PARAMETER)
- previous_iph_ = _set_invalid_parameter_handler(HandleInvalidParameter);
-#endif // _MSC_VER >= 1400
-
- if (handler_types & HANDLER_PURECALL)
- previous_pch_ = _set_purecall_handler(HandlePureVirtualCall);
-
- LeaveCriticalSection(&handler_stack_critical_section_);
- }
-}
-
-ExceptionHandler::~ExceptionHandler() {
- if (dbghelp_module_) {
- FreeLibrary(dbghelp_module_);
- }
-
- if (rpcrt4_module_) {
- FreeLibrary(rpcrt4_module_);
- }
-
- if (handler_types_ != HANDLER_NONE) {
- EnterCriticalSection(&handler_stack_critical_section_);
-
- if (handler_types_ & HANDLER_EXCEPTION)
- SetUnhandledExceptionFilter(previous_filter_);
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
- if (handler_types_ & HANDLER_INVALID_PARAMETER)
- _set_invalid_parameter_handler(previous_iph_);
-#endif // _MSC_VER >= 1400
-
- if (handler_types_ & HANDLER_PURECALL)
- _set_purecall_handler(previous_pch_);
-
- if (handler_stack_->back() == this) {
- handler_stack_->pop_back();
- } else {
- // TODO(mmentovai): use advapi32!ReportEvent to log the warning to the
- // system's application event log.
- fprintf(stderr, "warning: removing Breakpad handler out of order\n");
- vector<ExceptionHandler*>::iterator iterator = handler_stack_->begin();
- while (iterator != handler_stack_->end()) {
- if (*iterator == this) {
- iterator = handler_stack_->erase(iterator);
- } else {
- ++iterator;
- }
- }
- }
-
- if (handler_stack_->empty()) {
- // When destroying the last ExceptionHandler that installed a handler,
- // clean up the handler stack.
- delete handler_stack_;
- handler_stack_ = NULL;
- }
-
- LeaveCriticalSection(&handler_stack_critical_section_);
- }
-
- // Some of the objects were only initialized if out of process
- // registration was not done.
- if (!IsOutOfProcess()) {
-#ifdef BREAKPAD_NO_TERMINATE_THREAD
- // Clean up the handler thread and synchronization primitives. The handler
- // thread is either waiting on the semaphore to handle a crash or it is
- // handling a crash. Coming out of the wait is fast but wait more in the
- // eventuality a crash is handled. This compilation option results in a
- // deadlock if the exception handler is destroyed while executing code
- // inside DllMain.
- is_shutdown_ = true;
- ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
- const int kWaitForHandlerThreadMs = 60000;
- WaitForSingleObject(handler_thread_, kWaitForHandlerThreadMs);
-#else
- TerminateThread(handler_thread_, 1);
-#endif // BREAKPAD_NO_TERMINATE_THREAD
-
- CloseHandle(handler_thread_);
- handler_thread_ = NULL;
- DeleteCriticalSection(&handler_critical_section_);
- CloseHandle(handler_start_semaphore_);
- CloseHandle(handler_finish_semaphore_);
- }
-
- // There is a race condition in the code below: if this instance is
- // deleting the static critical section and a new instance of the class
- // is created, then there is a possibility that the critical section be
- // initialized while the same critical section is being deleted. Given the
- // usage pattern for the code, this race condition is unlikely to hit, but it
- // is a race condition nonetheless.
- if (InterlockedDecrement(&instance_count_) == 0) {
- DeleteCriticalSection(&handler_stack_critical_section_);
- }
-}
-
-bool ExceptionHandler::RequestUpload(DWORD crash_id) {
- return crash_generation_client_->RequestUpload(crash_id);
-}
-
-// static
-DWORD ExceptionHandler::ExceptionHandlerThreadMain(void* lpParameter) {
- ExceptionHandler* self = reinterpret_cast<ExceptionHandler *>(lpParameter);
- assert(self);
- assert(self->handler_start_semaphore_ != NULL);
- assert(self->handler_finish_semaphore_ != NULL);
-
- while (true) {
- if (WaitForSingleObject(self->handler_start_semaphore_, INFINITE) ==
- WAIT_OBJECT_0) {
- // Perform the requested action.
- if (self->is_shutdown_) {
- // The instance of the exception handler is being destroyed.
- break;
- } else {
- self->handler_return_value_ =
- self->WriteMinidumpWithException(self->requesting_thread_id_,
- self->exception_info_,
- self->assertion_);
- }
-
- // Allow the requesting thread to proceed.
- ReleaseSemaphore(self->handler_finish_semaphore_, 1, NULL);
- }
- }
-
- // This statement is not reached when the thread is unconditionally
- // terminated by the ExceptionHandler destructor.
- return 0;
-}
-
-// HandleException and HandleInvalidParameter must create an
-// AutoExceptionHandler object to maintain static state and to determine which
-// ExceptionHandler instance to use. The constructor locates the correct
-// instance, and makes it available through get_handler(). The destructor
-// restores the state in effect prior to allocating the AutoExceptionHandler.
-class AutoExceptionHandler {
- public:
- AutoExceptionHandler() {
- // Increment handler_stack_index_ so that if another Breakpad handler is
- // registered using this same HandleException function, and it needs to be
- // called while this handler is running (either because this handler
- // declines to handle the exception, or an exception occurs during
- // handling), HandleException will find the appropriate ExceptionHandler
- // object in handler_stack_ to deliver the exception to.
- //
- // Because handler_stack_ is addressed in reverse (as |size - index|),
- // preincrementing handler_stack_index_ avoids needing to subtract 1 from
- // the argument to |at|.
- //
- // The index is maintained instead of popping elements off of the handler
- // stack and pushing them at the end of this method. This avoids ruining
- // the order of elements in the stack in the event that some other thread
- // decides to manipulate the handler stack (such as creating a new
- // ExceptionHandler object) while an exception is being handled.
- EnterCriticalSection(&ExceptionHandler::handler_stack_critical_section_);
- handler_ = ExceptionHandler::handler_stack_->at(
- ExceptionHandler::handler_stack_->size() -
- ++ExceptionHandler::handler_stack_index_);
-
- // In case another exception occurs while this handler is doing its thing,
- // it should be delivered to the previous filter.
- SetUnhandledExceptionFilter(handler_->previous_filter_);
-#if _MSC_VER >= 1400 // MSVC 2005/8
- _set_invalid_parameter_handler(handler_->previous_iph_);
-#endif // _MSC_VER >= 1400
- _set_purecall_handler(handler_->previous_pch_);
- }
-
- ~AutoExceptionHandler() {
- // Put things back the way they were before entering this handler.
- SetUnhandledExceptionFilter(ExceptionHandler::HandleException);
-#if _MSC_VER >= 1400 // MSVC 2005/8
- _set_invalid_parameter_handler(ExceptionHandler::HandleInvalidParameter);
-#endif // _MSC_VER >= 1400
- _set_purecall_handler(ExceptionHandler::HandlePureVirtualCall);
-
- --ExceptionHandler::handler_stack_index_;
- LeaveCriticalSection(&ExceptionHandler::handler_stack_critical_section_);
- }
-
- ExceptionHandler* get_handler() const { return handler_; }
-
- private:
- ExceptionHandler* handler_;
-};
-
-// static
-LONG ExceptionHandler::HandleException(EXCEPTION_POINTERS* exinfo) {
- AutoExceptionHandler auto_exception_handler;
- ExceptionHandler* current_handler = auto_exception_handler.get_handler();
-
- // Ignore EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP exceptions. This
- // logic will short-circuit before calling WriteMinidumpOnHandlerThread,
- // allowing something else to handle the breakpoint without incurring the
- // overhead transitioning to and from the handler thread. This behavior
- // can be overridden by calling ExceptionHandler::set_handle_debug_exceptions.
- DWORD code = exinfo->ExceptionRecord->ExceptionCode;
- LONG action;
- bool is_debug_exception = (code == EXCEPTION_BREAKPOINT) ||
- (code == EXCEPTION_SINGLE_STEP);
-
- if (code == EXCEPTION_INVALID_HANDLE &&
- current_handler->consume_invalid_handle_exceptions_) {
- return EXCEPTION_CONTINUE_EXECUTION;
- }
-
- bool success = false;
-
- if (!is_debug_exception ||
- current_handler->get_handle_debug_exceptions()) {
- // If out-of-proc crash handler client is available, we have to use that
- // to generate dump and we cannot fall back on in-proc dump generation
- // because we never prepared for an in-proc dump generation
-
- // In case of out-of-process dump generation, directly call
- // WriteMinidumpWithException since there is no separate thread running.
- if (current_handler->IsOutOfProcess()) {
- success = current_handler->WriteMinidumpWithException(
- GetCurrentThreadId(),
- exinfo,
- NULL);
- } else {
- success = current_handler->WriteMinidumpOnHandlerThread(exinfo, NULL);
- }
- }
-
- // The handler fully handled the exception. Returning
- // EXCEPTION_EXECUTE_HANDLER indicates this to the system, and usually
- // results in the application being terminated.
- //
- // Note: If the application was launched from within the Cygwin
- // environment, returning EXCEPTION_EXECUTE_HANDLER seems to cause the
- // application to be restarted.
- if (success) {
- action = EXCEPTION_EXECUTE_HANDLER;
- } else {
- // There was an exception, it was a breakpoint or something else ignored
- // above, or it was passed to the handler, which decided not to handle it.
- // This could be because the filter callback didn't want it, because
- // minidump writing failed for some reason, or because the post-minidump
- // callback function indicated failure. Give the previous handler a
- // chance to do something with the exception. If there is no previous
- // handler, return EXCEPTION_CONTINUE_SEARCH, which will allow a debugger
- // or native "crashed" dialog to handle the exception.
- if (current_handler->previous_filter_) {
- action = current_handler->previous_filter_(exinfo);
- } else {
- action = EXCEPTION_CONTINUE_SEARCH;
- }
- }
-
- return action;
-}
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
-// static
-void ExceptionHandler::HandleInvalidParameter(const wchar_t* expression,
- const wchar_t* function,
- const wchar_t* file,
- unsigned int line,
- uintptr_t reserved) {
- // This is an invalid parameter, not an exception. It's safe to play with
- // sprintf here.
- AutoExceptionHandler auto_exception_handler;
- ExceptionHandler* current_handler = auto_exception_handler.get_handler();
-
- MDRawAssertionInfo assertion;
- memset(&assertion, 0, sizeof(assertion));
- _snwprintf_s(reinterpret_cast<wchar_t*>(assertion.expression),
- sizeof(assertion.expression) / sizeof(assertion.expression[0]),
- _TRUNCATE, L"%s", expression);
- _snwprintf_s(reinterpret_cast<wchar_t*>(assertion.function),
- sizeof(assertion.function) / sizeof(assertion.function[0]),
- _TRUNCATE, L"%s", function);
- _snwprintf_s(reinterpret_cast<wchar_t*>(assertion.file),
- sizeof(assertion.file) / sizeof(assertion.file[0]),
- _TRUNCATE, L"%s", file);
- assertion.line = line;
- assertion.type = MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER;
-
- // Make up an exception record for the current thread and CPU context
- // to make it possible for the crash processor to classify these
- // as do regular crashes, and to make it humane for developers to
- // analyze them.
- EXCEPTION_RECORD exception_record = {};
- CONTEXT exception_context = {};
- EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context };
-
- ::RtlCaptureContext(&exception_context);
-
- exception_record.ExceptionCode = STATUS_INVALID_PARAMETER;
-
- // We store pointers to the the expression and function strings,
- // and the line as exception parameters to make them easy to
- // access by the developer on the far side.
- exception_record.NumberParameters = 3;
- exception_record.ExceptionInformation[0] =
- reinterpret_cast<ULONG_PTR>(&assertion.expression);
- exception_record.ExceptionInformation[1] =
- reinterpret_cast<ULONG_PTR>(&assertion.file);
- exception_record.ExceptionInformation[2] = assertion.line;
-
- bool success = false;
- // In case of out-of-process dump generation, directly call
- // WriteMinidumpWithException since there is no separate thread running.
- if (current_handler->IsOutOfProcess()) {
- success = current_handler->WriteMinidumpWithException(
- GetCurrentThreadId(),
- &exception_ptrs,
- &assertion);
- } else {
- success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs,
- &assertion);
- }
-
- if (!success) {
- if (current_handler->previous_iph_) {
- // The handler didn't fully handle the exception. Give it to the
- // previous invalid parameter handler.
- current_handler->previous_iph_(expression,
- function,
- file,
- line,
- reserved);
- } else {
- // If there's no previous handler, pass the exception back in to the
- // invalid parameter handler's core. That's the routine that called this
- // function, but now, since this function is no longer registered (and in
- // fact, no function at all is registered), this will result in the
- // default code path being taken: _CRT_DEBUGGER_HOOK and _invoke_watson.
- // Use _invalid_parameter where it exists (in _DEBUG builds) as it passes
- // more information through. In non-debug builds, it is not available,
- // so fall back to using _invalid_parameter_noinfo. See invarg.c in the
- // CRT source.
-#ifdef _DEBUG
- _invalid_parameter(expression, function, file, line, reserved);
-#else // _DEBUG
- _invalid_parameter_noinfo();
-#endif // _DEBUG
- }
- }
-
- // The handler either took care of the invalid parameter problem itself,
- // or passed it on to another handler. "Swallow" it by exiting, paralleling
- // the behavior of "swallowing" exceptions.
- exit(0);
-}
-#endif // _MSC_VER >= 1400
-
-// static
-void ExceptionHandler::HandlePureVirtualCall() {
- // This is an pure virtual function call, not an exception. It's safe to
- // play with sprintf here.
- AutoExceptionHandler auto_exception_handler;
- ExceptionHandler* current_handler = auto_exception_handler.get_handler();
-
- MDRawAssertionInfo assertion;
- memset(&assertion, 0, sizeof(assertion));
- assertion.type = MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL;
-
- // Make up an exception record for the current thread and CPU context
- // to make it possible for the crash processor to classify these
- // as do regular crashes, and to make it humane for developers to
- // analyze them.
- EXCEPTION_RECORD exception_record = {};
- CONTEXT exception_context = {};
- EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context };
-
- ::RtlCaptureContext(&exception_context);
-
- exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION;
-
- // We store pointers to the the expression and function strings,
- // and the line as exception parameters to make them easy to
- // access by the developer on the far side.
- exception_record.NumberParameters = 3;
- exception_record.ExceptionInformation[0] =
- reinterpret_cast<ULONG_PTR>(&assertion.expression);
- exception_record.ExceptionInformation[1] =
- reinterpret_cast<ULONG_PTR>(&assertion.file);
- exception_record.ExceptionInformation[2] = assertion.line;
-
- bool success = false;
- // In case of out-of-process dump generation, directly call
- // WriteMinidumpWithException since there is no separate thread running.
-
- if (current_handler->IsOutOfProcess()) {
- success = current_handler->WriteMinidumpWithException(
- GetCurrentThreadId(),
- &exception_ptrs,
- &assertion);
- } else {
- success = current_handler->WriteMinidumpOnHandlerThread(&exception_ptrs,
- &assertion);
- }
-
- if (!success) {
- if (current_handler->previous_pch_) {
- // The handler didn't fully handle the exception. Give it to the
- // previous purecall handler.
- current_handler->previous_pch_();
- } else {
- // If there's no previous handler, return and let _purecall handle it.
- // This will just put up an assertion dialog.
- return;
- }
- }
-
- // The handler either took care of the invalid parameter problem itself,
- // or passed it on to another handler. "Swallow" it by exiting, paralleling
- // the behavior of "swallowing" exceptions.
- exit(0);
-}
-
-bool ExceptionHandler::WriteMinidumpOnHandlerThread(
- EXCEPTION_POINTERS* exinfo, MDRawAssertionInfo* assertion) {
- EnterCriticalSection(&handler_critical_section_);
-
- // There isn't much we can do if the handler thread
- // was not successfully created.
- if (handler_thread_ == NULL) {
- LeaveCriticalSection(&handler_critical_section_);
- return false;
- }
-
- // The handler thread should only be created when the semaphores are valid.
- assert(handler_start_semaphore_ != NULL);
- assert(handler_finish_semaphore_ != NULL);
-
- // Set up data to be passed in to the handler thread.
- requesting_thread_id_ = GetCurrentThreadId();
- exception_info_ = exinfo;
- assertion_ = assertion;
-
- // This causes the handler thread to call WriteMinidumpWithException.
- ReleaseSemaphore(handler_start_semaphore_, 1, NULL);
-
- // Wait until WriteMinidumpWithException is done and collect its return value.
- WaitForSingleObject(handler_finish_semaphore_, INFINITE);
- bool status = handler_return_value_;
-
- // Clean up.
- requesting_thread_id_ = 0;
- exception_info_ = NULL;
- assertion_ = NULL;
-
- LeaveCriticalSection(&handler_critical_section_);
-
- return status;
-}
-
-bool ExceptionHandler::WriteMinidump() {
- // Make up an exception record for the current thread and CPU context
- // to make it possible for the crash processor to classify these
- // as do regular crashes, and to make it humane for developers to
- // analyze them.
- EXCEPTION_RECORD exception_record = {};
- CONTEXT exception_context = {};
- EXCEPTION_POINTERS exception_ptrs = { &exception_record, &exception_context };
-
- ::RtlCaptureContext(&exception_context);
- exception_record.ExceptionCode = STATUS_NONCONTINUABLE_EXCEPTION;
-
- return WriteMinidumpForException(&exception_ptrs);
-}
-
-bool ExceptionHandler::WriteMinidumpForException(EXCEPTION_POINTERS* exinfo) {
- // In case of out-of-process dump generation, directly call
- // WriteMinidumpWithException since there is no separate thread running.
- if (IsOutOfProcess()) {
- return WriteMinidumpWithException(GetCurrentThreadId(),
- exinfo,
- NULL);
- }
-
- bool success = WriteMinidumpOnHandlerThread(exinfo, NULL);
- UpdateNextID();
- return success;
-}
-
-// static
-bool ExceptionHandler::WriteMinidump(const wstring &dump_path,
- MinidumpCallback callback,
- void* callback_context,
- MINIDUMP_TYPE dump_type) {
- ExceptionHandler handler(dump_path, NULL, callback, callback_context,
- HANDLER_NONE, dump_type, (HANDLE)NULL, NULL);
- return handler.WriteMinidump();
-}
-
-// static
-bool ExceptionHandler::WriteMinidumpForChild(HANDLE child,
- DWORD child_blamed_thread,
- const wstring& dump_path,
- MinidumpCallback callback,
- void* callback_context,
- MINIDUMP_TYPE dump_type) {
- EXCEPTION_RECORD ex;
- CONTEXT ctx;
- EXCEPTION_POINTERS exinfo = { NULL, NULL };
- // As documented on MSDN, on failure SuspendThread returns (DWORD) -1
- const DWORD kFailedToSuspendThread = static_cast<DWORD>(-1);
- DWORD last_suspend_count = kFailedToSuspendThread;
- HANDLE child_thread_handle = OpenThread(THREAD_GET_CONTEXT |
- THREAD_QUERY_INFORMATION |
- THREAD_SUSPEND_RESUME,
- FALSE,
- child_blamed_thread);
- // This thread may have died already, so not opening the handle is a
- // non-fatal error.
- if (child_thread_handle != NULL) {
- last_suspend_count = SuspendThread(child_thread_handle);
- if (last_suspend_count != kFailedToSuspendThread) {
- ctx.ContextFlags = CONTEXT_ALL;
- if (GetThreadContext(child_thread_handle, &ctx)) {
- memset(&ex, 0, sizeof(ex));
- ex.ExceptionCode = EXCEPTION_BREAKPOINT;
-#if defined(_M_IX86)
- ex.ExceptionAddress = reinterpret_cast<PVOID>(ctx.Eip);
-#elif defined(_M_X64)
- ex.ExceptionAddress = reinterpret_cast<PVOID>(ctx.Rip);
-#endif
- exinfo.ExceptionRecord = &ex;
- exinfo.ContextRecord = &ctx;
- }
- }
- }
-
- ExceptionHandler handler(dump_path, NULL, callback, callback_context,
- HANDLER_NONE, dump_type, (HANDLE)NULL, NULL);
- bool success = handler.WriteMinidumpWithExceptionForProcess(
- child_blamed_thread,
- exinfo.ExceptionRecord ? &exinfo : NULL,
- NULL, child, false);
-
- if (last_suspend_count != kFailedToSuspendThread) {
- ResumeThread(child_thread_handle);
- }
-
- CloseHandle(child_thread_handle);
-
- if (callback) {
- success = callback(handler.dump_path_c_, handler.next_minidump_id_c_,
- callback_context, NULL, NULL, success);
- }
-
- return success;
-}
-
-bool ExceptionHandler::WriteMinidumpWithException(
- DWORD requesting_thread_id,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion) {
- // Give user code a chance to approve or prevent writing a minidump. If the
- // filter returns false, don't handle the exception at all. If this method
- // was called as a result of an exception, returning false will cause
- // HandleException to call any previous handler or return
- // EXCEPTION_CONTINUE_SEARCH on the exception thread, allowing it to appear
- // as though this handler were not present at all.
- if (filter_ && !filter_(callback_context_, exinfo, assertion)) {
- return false;
- }
-
- bool success = false;
- if (IsOutOfProcess()) {
- success = crash_generation_client_->RequestDump(exinfo, assertion);
- } else {
- success = WriteMinidumpWithExceptionForProcess(requesting_thread_id,
- exinfo,
- assertion,
- GetCurrentProcess(),
- true);
- }
-
- if (callback_) {
- // TODO(munjal): In case of out-of-process dump generation, both
- // dump_path_c_ and next_minidump_id_ will be NULL. For out-of-process
- // scenario, the server process ends up creating the dump path and dump
- // id so they are not known to the client.
- success = callback_(dump_path_c_, next_minidump_id_c_, callback_context_,
- exinfo, assertion, success);
- }
-
- return success;
-}
-
-// static
-BOOL CALLBACK ExceptionHandler::MinidumpWriteDumpCallback(
- PVOID context,
- const PMINIDUMP_CALLBACK_INPUT callback_input,
- PMINIDUMP_CALLBACK_OUTPUT callback_output) {
- switch (callback_input->CallbackType) {
- case MemoryCallback: {
- MinidumpCallbackContext* callback_context =
- reinterpret_cast<MinidumpCallbackContext*>(context);
- if (callback_context->iter == callback_context->end)
- return FALSE;
-
- // Include the specified memory region.
- callback_output->MemoryBase = callback_context->iter->ptr;
- callback_output->MemorySize = callback_context->iter->length;
- callback_context->iter++;
- return TRUE;
- }
-
- // Include all modules.
- case IncludeModuleCallback:
- case ModuleCallback:
- return TRUE;
-
- // Include all threads.
- case IncludeThreadCallback:
- case ThreadCallback:
- return TRUE;
-
- // Stop receiving cancel callbacks.
- case CancelCallback:
- callback_output->CheckCancel = FALSE;
- callback_output->Cancel = FALSE;
- return TRUE;
- }
- // Ignore other callback types.
- return FALSE;
-}
-
-bool ExceptionHandler::WriteMinidumpWithExceptionForProcess(
- DWORD requesting_thread_id,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- HANDLE process,
- bool write_requester_stream) {
- bool success = false;
- if (minidump_write_dump_) {
- HANDLE dump_file = CreateFile(next_minidump_path_c_,
- GENERIC_WRITE,
- 0, // no sharing
- NULL,
- CREATE_NEW, // fail if exists
- FILE_ATTRIBUTE_NORMAL,
- NULL);
- if (dump_file != INVALID_HANDLE_VALUE) {
- MINIDUMP_EXCEPTION_INFORMATION except_info;
- except_info.ThreadId = requesting_thread_id;
- except_info.ExceptionPointers = exinfo;
- except_info.ClientPointers = FALSE;
-
- // Leave room in user_stream_array for possible breakpad and
- // assertion info streams.
- MINIDUMP_USER_STREAM user_stream_array[2];
- MINIDUMP_USER_STREAM_INFORMATION user_streams;
- user_streams.UserStreamCount = 0;
- user_streams.UserStreamArray = user_stream_array;
-
- if (write_requester_stream) {
- // Add an MDRawBreakpadInfo stream to the minidump, to provide
- // additional information about the exception handler to the Breakpad
- // processor. The information will help the processor determine which
- // threads are relevant. The Breakpad processor does not require this
- // information but can function better with Breakpad-generated dumps
- // when it is present. The native debugger is not harmed by the
- // presence of this information.
- MDRawBreakpadInfo breakpad_info;
- breakpad_info.validity = MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID |
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID;
- breakpad_info.dump_thread_id = GetCurrentThreadId();
- breakpad_info.requesting_thread_id = requesting_thread_id;
-
- int index = user_streams.UserStreamCount;
- user_stream_array[index].Type = MD_BREAKPAD_INFO_STREAM;
- user_stream_array[index].BufferSize = sizeof(breakpad_info);
- user_stream_array[index].Buffer = &breakpad_info;
- ++user_streams.UserStreamCount;
- }
-
- if (assertion) {
- int index = user_streams.UserStreamCount;
- user_stream_array[index].Type = MD_ASSERTION_INFO_STREAM;
- user_stream_array[index].BufferSize = sizeof(MDRawAssertionInfo);
- user_stream_array[index].Buffer = assertion;
- ++user_streams.UserStreamCount;
- }
-
- // Older versions of DbgHelp.dll don't correctly put the memory around
- // the faulting instruction pointer into the minidump. This
- // callback will ensure that it gets included.
- if (exinfo) {
- // Find a memory region of 256 bytes centered on the
- // faulting instruction pointer.
- const ULONG64 instruction_pointer =
-#if defined(_M_IX86)
- exinfo->ContextRecord->Eip;
-#elif defined(_M_AMD64)
- exinfo->ContextRecord->Rip;
-#else
-#error Unsupported platform
-#endif
-
- MEMORY_BASIC_INFORMATION info;
- if (VirtualQueryEx(process,
- reinterpret_cast<LPCVOID>(instruction_pointer),
- &info,
- sizeof(MEMORY_BASIC_INFORMATION)) != 0 &&
- info.State == MEM_COMMIT) {
- // Attempt to get 128 bytes before and after the instruction
- // pointer, but settle for whatever's available up to the
- // boundaries of the memory region.
- const ULONG64 kIPMemorySize = 256;
- ULONG64 base =
- (std::max)(reinterpret_cast<ULONG64>(info.BaseAddress),
- instruction_pointer - (kIPMemorySize / 2));
- ULONG64 end_of_range =
- (std::min)(instruction_pointer + (kIPMemorySize / 2),
- reinterpret_cast<ULONG64>(info.BaseAddress)
- + info.RegionSize);
- ULONG size = static_cast<ULONG>(end_of_range - base);
-
- AppMemory& elt = app_memory_info_.front();
- elt.ptr = base;
- elt.length = size;
- }
- }
-
- MinidumpCallbackContext context;
- context.iter = app_memory_info_.begin();
- context.end = app_memory_info_.end();
-
- // Skip the reserved element if there was no instruction memory
- if (context.iter->ptr == 0) {
- context.iter++;
- }
-
- MINIDUMP_CALLBACK_INFORMATION callback;
- callback.CallbackRoutine = MinidumpWriteDumpCallback;
- callback.CallbackParam = reinterpret_cast<void*>(&context);
-
- // The explicit comparison to TRUE avoids a warning (C4800).
- success = (minidump_write_dump_(process,
- GetProcessId(process),
- dump_file,
- dump_type_,
- exinfo ? &except_info : NULL,
- &user_streams,
- &callback) == TRUE);
-
- CloseHandle(dump_file);
- }
- }
-
- return success;
-}
-
-void ExceptionHandler::UpdateNextID() {
- assert(uuid_create_);
- UUID id = {0};
- if (uuid_create_) {
- uuid_create_(&id);
- }
- next_minidump_id_ = GUIDString::GUIDToWString(&id);
- next_minidump_id_c_ = next_minidump_id_.c_str();
-
- wchar_t minidump_path[MAX_PATH];
- swprintf(minidump_path, MAX_PATH, L"%s\\%s.dmp",
- dump_path_c_, next_minidump_id_c_);
-
- // remove when VC++7.1 is no longer supported
- minidump_path[MAX_PATH - 1] = L'\0';
-
- next_minidump_path_ = minidump_path;
- next_minidump_path_c_ = next_minidump_path_.c_str();
-}
-
-void ExceptionHandler::RegisterAppMemory(void* ptr, size_t length) {
- AppMemoryList::iterator iter =
- std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr);
- if (iter != app_memory_info_.end()) {
- // Don't allow registering the same pointer twice.
- return;
- }
-
- AppMemory app_memory;
- app_memory.ptr = reinterpret_cast<ULONG64>(ptr);
- app_memory.length = static_cast<ULONG>(length);
- app_memory_info_.push_back(app_memory);
-}
-
-void ExceptionHandler::UnregisterAppMemory(void* ptr) {
- AppMemoryList::iterator iter =
- std::find(app_memory_info_.begin(), app_memory_info_.end(), ptr);
- if (iter != app_memory_info_.end()) {
- app_memory_info_.erase(iter);
- }
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp
deleted file mode 100644
index c5733277df..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.gyp
+++ /dev/null
@@ -1,47 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'exception_handler',
- 'type': 'static_library',
- 'sources': [
- "exception_handler.cc",
- "exception_handler.h",
- ],
- 'dependencies': [
- '../breakpad_client.gyp:common',
- '../crash_generation/crash_generation.gyp:crash_generation_server',
- ]
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h
deleted file mode 100644
index 11babe513e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/exception_handler.h
+++ /dev/null
@@ -1,524 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ExceptionHandler can write a minidump file when an exception occurs,
-// or when WriteMinidump() is called explicitly by your program.
-//
-// To have the exception handler write minidumps when an uncaught exception
-// (crash) occurs, you should create an instance early in the execution
-// of your program, and keep it around for the entire time you want to
-// have crash handling active (typically, until shutdown).
-//
-// If you want to write minidumps without installing the exception handler,
-// you can create an ExceptionHandler with install_handler set to false,
-// then call WriteMinidump. You can also use this technique if you want to
-// use different minidump callbacks for different call sites.
-//
-// In either case, a callback function is called when a minidump is written,
-// which receives the unqiue id of the minidump. The caller can use this
-// id to collect and write additional application state, and to launch an
-// external crash-reporting application.
-//
-// It is important that creation and destruction of ExceptionHandler objects
-// be nested cleanly, when using install_handler = true.
-// Avoid the following pattern:
-// ExceptionHandler *e = new ExceptionHandler(...);
-// ExceptionHandler *f = new ExceptionHandler(...);
-// delete e;
-// This will put the exception filter stack into an inconsistent state.
-
-#ifndef CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__
-#define CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__
-
-#include <stdlib.h>
-#include <windows.h>
-#include <dbghelp.h>
-#include <rpc.h>
-
-#pragma warning(push)
-// Disable exception handler warnings.
-#pragma warning(disable:4530)
-
-#include <list>
-#include <string>
-#include <vector>
-
-#include "client/windows/common/ipc_protocol.h"
-#include "client/windows/crash_generation/crash_generation_client.h"
-#include "common/scoped_ptr.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-using std::vector;
-using std::wstring;
-
-// These entries store a list of memory regions that the client wants included
-// in the minidump.
-struct AppMemory {
- ULONG64 ptr;
- ULONG length;
-
- bool operator==(const struct AppMemory& other) const {
- return ptr == other.ptr;
- }
-
- bool operator==(const void* other) const {
- return ptr == reinterpret_cast<ULONG64>(other);
- }
-};
-typedef std::list<AppMemory> AppMemoryList;
-
-class ExceptionHandler {
- public:
- // A callback function to run before Breakpad performs any substantial
- // processing of an exception. A FilterCallback is called before writing
- // a minidump. context is the parameter supplied by the user as
- // callback_context when the handler was created. exinfo points to the
- // exception record, if any; assertion points to assertion information,
- // if any.
- //
- // If a FilterCallback returns true, Breakpad will continue processing,
- // attempting to write a minidump. If a FilterCallback returns false,
- // Breakpad will immediately report the exception as unhandled without
- // writing a minidump, allowing another handler the opportunity to handle it.
- typedef bool (*FilterCallback)(void* context, EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion);
-
- // A callback function to run after the minidump has been written.
- // minidump_id is a unique id for the dump, so the minidump
- // file is <dump_path>\<minidump_id>.dmp. context is the parameter supplied
- // by the user as callback_context when the handler was created. exinfo
- // points to the exception record, or NULL if no exception occurred.
- // succeeded indicates whether a minidump file was successfully written.
- // assertion points to information about an assertion if the handler was
- // invoked by an assertion.
- //
- // If an exception occurred and the callback returns true, Breakpad will treat
- // the exception as fully-handled, suppressing any other handlers from being
- // notified of the exception. If the callback returns false, Breakpad will
- // treat the exception as unhandled, and allow another handler to handle it.
- // If there are no other handlers, Breakpad will report the exception to the
- // system as unhandled, allowing a debugger or native crash dialog the
- // opportunity to handle the exception. Most callback implementations
- // should normally return the value of |succeeded|, or when they wish to
- // not report an exception of handled, false. Callbacks will rarely want to
- // return true directly (unless |succeeded| is true).
- //
- // For out-of-process dump generation, dump path and minidump ID will always
- // be NULL. In case of out-of-process dump generation, the dump path and
- // minidump id are controlled by the server process and are not communicated
- // back to the crashing process.
- typedef bool (*MinidumpCallback)(const wchar_t* dump_path,
- const wchar_t* minidump_id,
- void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- bool succeeded);
-
- // HandlerType specifies which types of handlers should be installed, if
- // any. Use HANDLER_NONE for an ExceptionHandler that remains idle,
- // without catching any failures on its own. This type of handler may
- // still be triggered by calling WriteMinidump. Otherwise, use a
- // combination of the other HANDLER_ values, or HANDLER_ALL to install
- // all handlers.
- enum HandlerType {
- HANDLER_NONE = 0,
- HANDLER_EXCEPTION = 1 << 0, // SetUnhandledExceptionFilter
- HANDLER_INVALID_PARAMETER = 1 << 1, // _set_invalid_parameter_handler
- HANDLER_PURECALL = 1 << 2, // _set_purecall_handler
- HANDLER_ALL = HANDLER_EXCEPTION |
- HANDLER_INVALID_PARAMETER |
- HANDLER_PURECALL
- };
-
- // Creates a new ExceptionHandler instance to handle writing minidumps.
- // Before writing a minidump, the optional filter callback will be called.
- // Its return value determines whether or not Breakpad should write a
- // minidump. Minidump files will be written to dump_path, and the optional
- // callback is called after writing the dump file, as described above.
- // handler_types specifies the types of handlers that should be installed.
- ExceptionHandler(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types);
-
- // Creates a new ExceptionHandler instance that can attempt to perform
- // out-of-process dump generation if pipe_name is not NULL. If pipe_name is
- // NULL, or if out-of-process dump generation registration step fails,
- // in-process dump generation will be used. This also allows specifying
- // the dump type to generate.
- ExceptionHandler(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- MINIDUMP_TYPE dump_type,
- const wchar_t* pipe_name,
- const CustomClientInfo* custom_info);
-
- // As above, creates a new ExceptionHandler instance to perform
- // out-of-process dump generation if the given pipe_handle is not NULL.
- ExceptionHandler(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- MINIDUMP_TYPE dump_type,
- HANDLE pipe_handle,
- const CustomClientInfo* custom_info);
-
- // ExceptionHandler that ENSURES out-of-process dump generation. Expects a
- // crash generation client that is already registered with a crash generation
- // server. Takes ownership of the passed-in crash_generation_client.
- //
- // Usage example:
- // crash_generation_client = new CrashGenerationClient(..);
- // if (crash_generation_client->Register()) {
- // // Registration with the crash generation server succeeded.
- // // Out-of-process dump generation is guaranteed.
- // g_handler = new ExceptionHandler(.., crash_generation_client, ..);
- // return true;
- // }
- ExceptionHandler(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- CrashGenerationClient* crash_generation_client);
-
- ~ExceptionHandler();
-
- // Get and set the minidump path.
- wstring dump_path() const { return dump_path_; }
- void set_dump_path(const wstring &dump_path) {
- dump_path_ = dump_path;
- dump_path_c_ = dump_path_.c_str();
- UpdateNextID(); // Necessary to put dump_path_ in next_minidump_path_.
- }
-
- // Requests that a previously reported crash be uploaded.
- bool RequestUpload(DWORD crash_id);
-
- // Writes a minidump immediately. This can be used to capture the
- // execution state independently of a crash. Returns true on success.
- bool WriteMinidump();
-
- // Writes a minidump immediately, with the user-supplied exception
- // information.
- bool WriteMinidumpForException(EXCEPTION_POINTERS* exinfo);
-
- // Convenience form of WriteMinidump which does not require an
- // ExceptionHandler instance.
- static bool WriteMinidump(const wstring &dump_path,
- MinidumpCallback callback, void* callback_context,
- MINIDUMP_TYPE dump_type = MiniDumpNormal);
-
- // Write a minidump of |child| immediately. This can be used to
- // capture the execution state of |child| independently of a crash.
- // Pass a meaningful |child_blamed_thread| to make that thread in
- // the child process the one from which a crash signature is
- // extracted.
- static bool WriteMinidumpForChild(HANDLE child,
- DWORD child_blamed_thread,
- const wstring& dump_path,
- MinidumpCallback callback,
- void* callback_context,
- MINIDUMP_TYPE dump_type = MiniDumpNormal);
-
- // Get the thread ID of the thread requesting the dump (either the exception
- // thread or any other thread that called WriteMinidump directly). This
- // may be useful if you want to include additional thread state in your
- // dumps.
- DWORD get_requesting_thread_id() const { return requesting_thread_id_; }
-
- // Controls behavior of EXCEPTION_BREAKPOINT and EXCEPTION_SINGLE_STEP.
- bool get_handle_debug_exceptions() const { return handle_debug_exceptions_; }
- void set_handle_debug_exceptions(bool handle_debug_exceptions) {
- handle_debug_exceptions_ = handle_debug_exceptions;
- }
-
- // Controls behavior of EXCEPTION_INVALID_HANDLE.
- bool get_consume_invalid_handle_exceptions() const {
- return consume_invalid_handle_exceptions_;
- }
- void set_consume_invalid_handle_exceptions(
- bool consume_invalid_handle_exceptions) {
- consume_invalid_handle_exceptions_ = consume_invalid_handle_exceptions;
- }
-
- // Returns whether out-of-process dump generation is used or not.
- bool IsOutOfProcess() const { return crash_generation_client_.get() != NULL; }
-
- // Calling RegisterAppMemory(p, len) causes len bytes starting
- // at address p to be copied to the minidump when a crash happens.
- void RegisterAppMemory(void* ptr, size_t length);
- void UnregisterAppMemory(void* ptr);
-
- private:
- friend class AutoExceptionHandler;
-
- // Initializes the instance with given values.
- void Initialize(const wstring& dump_path,
- FilterCallback filter,
- MinidumpCallback callback,
- void* callback_context,
- int handler_types,
- MINIDUMP_TYPE dump_type,
- const wchar_t* pipe_name,
- HANDLE pipe_handle,
- CrashGenerationClient* crash_generation_client,
- const CustomClientInfo* custom_info);
-
- // Function pointer type for MiniDumpWriteDump, which is looked up
- // dynamically.
- typedef BOOL (WINAPI *MiniDumpWriteDump_type)(
- HANDLE hProcess,
- DWORD dwPid,
- HANDLE hFile,
- MINIDUMP_TYPE DumpType,
- CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
- CONST PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
- CONST PMINIDUMP_CALLBACK_INFORMATION CallbackParam);
-
- // Function pointer type for UuidCreate, which is looked up dynamically.
- typedef RPC_STATUS (RPC_ENTRY *UuidCreate_type)(UUID* Uuid);
-
- // Runs the main loop for the exception handler thread.
- static DWORD WINAPI ExceptionHandlerThreadMain(void* lpParameter);
-
- // Called on the exception thread when an unhandled exception occurs.
- // Signals the exception handler thread to handle the exception.
- static LONG WINAPI HandleException(EXCEPTION_POINTERS* exinfo);
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
- // This function will be called by some CRT functions when they detect
- // that they were passed an invalid parameter. Note that in _DEBUG builds,
- // the CRT may display an assertion dialog before calling this function,
- // and the function will not be called unless the assertion dialog is
- // dismissed by clicking "Ignore."
- static void HandleInvalidParameter(const wchar_t* expression,
- const wchar_t* function,
- const wchar_t* file,
- unsigned int line,
- uintptr_t reserved);
-#endif // _MSC_VER >= 1400
-
- // This function will be called by the CRT when a pure virtual
- // function is called.
- static void HandlePureVirtualCall();
-
- // This is called on the exception thread or on another thread that
- // the user wishes to produce a dump from. It calls
- // WriteMinidumpWithException on the handler thread, avoiding stack
- // overflows and inconsistent dumps due to writing the dump from
- // the exception thread. If the dump is requested as a result of an
- // exception, exinfo contains exception information, otherwise, it
- // is NULL. If the dump is requested as a result of an assertion
- // (such as an invalid parameter being passed to a CRT function),
- // assertion contains data about the assertion, otherwise, it is NULL.
- bool WriteMinidumpOnHandlerThread(EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion);
-
- // This function is called on the handler thread. It calls into
- // WriteMinidumpWithExceptionForProcess() with a handle to the
- // current process. requesting_thread_id is the ID of the thread
- // that requested the dump. If the dump is requested as a result of
- // an exception, exinfo contains exception information, otherwise,
- // it is NULL.
- bool WriteMinidumpWithException(DWORD requesting_thread_id,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion);
-
- // This function is used as a callback when calling MinidumpWriteDump,
- // in order to add additional memory regions to the dump.
- static BOOL CALLBACK MinidumpWriteDumpCallback(
- PVOID context,
- const PMINIDUMP_CALLBACK_INPUT callback_input,
- PMINIDUMP_CALLBACK_OUTPUT callback_output);
-
- // This function does the actual writing of a minidump. It is
- // called on the handler thread. requesting_thread_id is the ID of
- // the thread that requested the dump, if that information is
- // meaningful. If the dump is requested as a result of an
- // exception, exinfo contains exception information, otherwise, it
- // is NULL. process is the one that will be dumped. If
- // requesting_thread_id is meaningful and should be added to the
- // minidump, write_requester_stream is |true|.
- bool WriteMinidumpWithExceptionForProcess(DWORD requesting_thread_id,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- HANDLE process,
- bool write_requester_stream);
-
- // Generates a new ID and stores it in next_minidump_id_, and stores the
- // path of the next minidump to be written in next_minidump_path_.
- void UpdateNextID();
-
- FilterCallback filter_;
- MinidumpCallback callback_;
- void* callback_context_;
-
- scoped_ptr<CrashGenerationClient> crash_generation_client_;
-
- // The directory in which a minidump will be written, set by the dump_path
- // argument to the constructor, or set_dump_path.
- wstring dump_path_;
-
- // The basename of the next minidump to be written, without the extension.
- wstring next_minidump_id_;
-
- // The full pathname of the next minidump to be written, including the file
- // extension.
- wstring next_minidump_path_;
-
- // Pointers to C-string representations of the above. These are set when
- // the above wstring versions are set in order to avoid calling c_str during
- // an exception, as c_str may attempt to allocate heap memory. These
- // pointers are not owned by the ExceptionHandler object, but their lifetimes
- // should be equivalent to the lifetimes of the associated wstring, provided
- // that the wstrings are not altered.
- const wchar_t* dump_path_c_;
- const wchar_t* next_minidump_id_c_;
- const wchar_t* next_minidump_path_c_;
-
- HMODULE dbghelp_module_;
- MiniDumpWriteDump_type minidump_write_dump_;
- MINIDUMP_TYPE dump_type_;
-
- HMODULE rpcrt4_module_;
- UuidCreate_type uuid_create_;
-
- // Tracks the handler types that were installed according to the
- // handler_types constructor argument.
- int handler_types_;
-
- // When installed_handler_ is true, previous_filter_ is the unhandled
- // exception filter that was set prior to installing ExceptionHandler as
- // the unhandled exception filter and pointing it to |this|. NULL indicates
- // that there is no previous unhandled exception filter.
- LPTOP_LEVEL_EXCEPTION_FILTER previous_filter_;
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
- // Beginning in VC 8, the CRT provides an invalid parameter handler that will
- // be called when some CRT functions are passed invalid parameters. In
- // earlier CRTs, the same conditions would cause unexpected behavior or
- // crashes.
- _invalid_parameter_handler previous_iph_;
-#endif // _MSC_VER >= 1400
-
- // The CRT allows you to override the default handler for pure
- // virtual function calls.
- _purecall_handler previous_pch_;
-
- // The exception handler thread.
- HANDLE handler_thread_;
-
- // True if the exception handler is being destroyed.
- // Starting with MSVC 2005, Visual C has stronger guarantees on volatile vars.
- // It has release semantics on write and acquire semantics on reads.
- // See the msdn documentation.
- volatile bool is_shutdown_;
-
- // The critical section enforcing the requirement that only one exception be
- // handled by a handler at a time.
- CRITICAL_SECTION handler_critical_section_;
-
- // Semaphores used to move exception handling between the exception thread
- // and the handler thread. handler_start_semaphore_ is signalled by the
- // exception thread to wake up the handler thread when an exception occurs.
- // handler_finish_semaphore_ is signalled by the handler thread to wake up
- // the exception thread when handling is complete.
- HANDLE handler_start_semaphore_;
- HANDLE handler_finish_semaphore_;
-
- // The next 2 fields contain data passed from the requesting thread to
- // the handler thread.
-
- // The thread ID of the thread requesting the dump (either the exception
- // thread or any other thread that called WriteMinidump directly).
- DWORD requesting_thread_id_;
-
- // The exception info passed to the exception handler on the exception
- // thread, if an exception occurred. NULL for user-requested dumps.
- EXCEPTION_POINTERS* exception_info_;
-
- // If the handler is invoked due to an assertion, this will contain a
- // pointer to the assertion information. It is NULL at other times.
- MDRawAssertionInfo* assertion_;
-
- // The return value of the handler, passed from the handler thread back to
- // the requesting thread.
- bool handler_return_value_;
-
- // If true, the handler will intercept EXCEPTION_BREAKPOINT and
- // EXCEPTION_SINGLE_STEP exceptions. Leave this false (the default)
- // to not interfere with debuggers.
- bool handle_debug_exceptions_;
-
- // If true, the handler will consume any EXCEPTION_INVALID_HANDLE exceptions.
- // Leave this false (the default) to handle these exceptions as normal.
- bool consume_invalid_handle_exceptions_;
-
- // Callers can request additional memory regions to be included in
- // the dump.
- AppMemoryList app_memory_info_;
-
- // A stack of ExceptionHandler objects that have installed unhandled
- // exception filters. This vector is used by HandleException to determine
- // which ExceptionHandler object to route an exception to. When an
- // ExceptionHandler is created with install_handler true, it will append
- // itself to this list.
- static vector<ExceptionHandler*>* handler_stack_;
-
- // The index of the ExceptionHandler in handler_stack_ that will handle the
- // next exception. Note that 0 means the last entry in handler_stack_, 1
- // means the next-to-last entry, and so on. This is used by HandleException
- // to support multiple stacked Breakpad handlers.
- static LONG handler_stack_index_;
-
- // handler_stack_critical_section_ guards operations on handler_stack_ and
- // handler_stack_index_. The critical section is initialized by the
- // first instance of the class and destroyed by the last instance of it.
- static CRITICAL_SECTION handler_stack_critical_section_;
-
- // The number of instances of this class.
- static volatile LONG instance_count_;
-
- // disallow copy ctor and operator=
- explicit ExceptionHandler(const ExceptionHandler &);
- void operator=(const ExceptionHandler &);
-};
-
-} // namespace google_breakpad
-
-#pragma warning(pop)
-
-#endif // CLIENT_WINDOWS_HANDLER_EXCEPTION_HANDLER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild b/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild
deleted file mode 100644
index 6cabb09b77..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/handler/objs.mozbuild
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-lobjs_handler = [
- 'exception_handler.cc',
-]
-
-subdir = 'toolkit/crashreporter/google-breakpad/src/client/windows/handler'
-objs_handler = [
- '/%s/%s' % (subdir, s) for s in lobjs_handler
-]
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.cc
deleted file mode 100644
index 70c36b0e27..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.cc
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Disable exception handler warnings.
-#pragma warning( disable : 4530 )
-
-#include <errno.h>
-
-#include "client/windows/sender/crash_report_sender.h"
-#include "common/windows/http_upload.h"
-
-#if _MSC_VER < 1400 // MSVC 2005/8
-// Older MSVC doesn't have fscanf_s, but they are compatible as long as
-// we don't use the string conversions (%s/%c/%S/%C).
-#define fscanf_s fscanf
-#endif
-
-namespace google_breakpad {
-
-static const char kCheckpointSignature[] = "GBP1\n";
-
-CrashReportSender::CrashReportSender(const wstring &checkpoint_file)
- : checkpoint_file_(checkpoint_file),
- max_reports_per_day_(-1),
- last_sent_date_(-1),
- reports_sent_(0) {
- FILE *fd;
- if (OpenCheckpointFile(L"r", &fd) == 0) {
- ReadCheckpoint(fd);
- fclose(fd);
- }
-}
-
-ReportResult CrashReportSender::SendCrashReport(
- const wstring &url, const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files, wstring *report_code) {
- int today = GetCurrentDate();
- if (today == last_sent_date_ &&
- max_reports_per_day_ != -1 &&
- reports_sent_ >= max_reports_per_day_) {
- return RESULT_THROTTLED;
- }
-
- int http_response = 0;
- bool result = HTTPUpload::SendRequest(
- url, parameters, files, NULL, report_code,
- &http_response);
-
- if (result) {
- ReportSent(today);
- return RESULT_SUCCEEDED;
- } else if (http_response >= 400 && http_response < 500) {
- return RESULT_REJECTED;
- } else {
- return RESULT_FAILED;
- }
-}
-
-void CrashReportSender::ReadCheckpoint(FILE *fd) {
- char buf[128];
- if (!fgets(buf, sizeof(buf), fd) ||
- strcmp(buf, kCheckpointSignature) != 0) {
- return;
- }
-
- if (fscanf_s(fd, "%d\n", &last_sent_date_) != 1) {
- last_sent_date_ = -1;
- return;
- }
- if (fscanf_s(fd, "%d\n", &reports_sent_) != 1) {
- reports_sent_ = 0;
- return;
- }
-}
-
-void CrashReportSender::ReportSent(int today) {
- // Update the report stats
- if (today != last_sent_date_) {
- last_sent_date_ = today;
- reports_sent_ = 0;
- }
- ++reports_sent_;
-
- // Update the checkpoint file
- FILE *fd;
- if (OpenCheckpointFile(L"w", &fd) == 0) {
- fputs(kCheckpointSignature, fd);
- fprintf(fd, "%d\n", last_sent_date_);
- fprintf(fd, "%d\n", reports_sent_);
- fclose(fd);
- }
-}
-
-int CrashReportSender::GetCurrentDate() const {
- SYSTEMTIME system_time;
- GetSystemTime(&system_time);
- return (system_time.wYear * 10000) + (system_time.wMonth * 100) +
- system_time.wDay;
-}
-
-int CrashReportSender::OpenCheckpointFile(const wchar_t *mode, FILE **fd) {
- if (checkpoint_file_.empty()) {
- return ENOENT;
- }
-#if _MSC_VER >= 1400 // MSVC 2005/8
- return _wfopen_s(fd, checkpoint_file_.c_str(), mode);
-#else
- *fd = _wfopen(checkpoint_file_.c_str(), mode);
- if (*fd == NULL) {
- return errno;
- }
- return 0;
-#endif
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp
deleted file mode 100644
index dc8583a0af..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.gyp
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'crash_report_sender',
- 'type': 'static_library',
- 'sources': [
- 'crash_report_sender.cc',
- 'crash_report_sender.h',
- ],
- 'dependencies': [
- '../breakpad_client.gyp:common'
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.h b/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.h
deleted file mode 100644
index 7786cc699c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/crash_report_sender.h
+++ /dev/null
@@ -1,125 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_SENDER_CRASH_REPORT_SENDER_H__
-#define CLIENT_WINDOWS_SENDER_CRASH_REPORT_SENDER_H__
-
-// CrashReportSender is a "static" class which provides an API to upload
-// crash reports via HTTP(S). A crash report is formatted as a multipart POST
-// request, which contains a set of caller-supplied string key/value pairs,
-// and a minidump file to upload.
-//
-// To use this library in your project, you will need to link against
-// wininet.lib.
-
-#pragma warning( push )
-// Disable exception handler warnings.
-#pragma warning( disable : 4530 )
-
-#include <map>
-#include <string>
-
-namespace google_breakpad {
-
-using std::wstring;
-using std::map;
-
-typedef enum {
- RESULT_FAILED = 0, // Failed to communicate with the server; try later.
- RESULT_REJECTED, // Successfully sent the crash report, but the
- // server rejected it; don't resend this report.
- RESULT_SUCCEEDED, // The server accepted the crash report.
- RESULT_THROTTLED // No attempt was made to send the crash report, because
- // we exceeded the maximum reports per day.
-} ReportResult;
-
-class CrashReportSender {
- public:
- // Initializes a CrashReportSender instance.
- // If checkpoint_file is non-empty, breakpad will persist crash report
- // state to this file. A checkpoint file is required for
- // set_max_reports_per_day() to function properly.
- explicit CrashReportSender(const wstring &checkpoint_file);
- ~CrashReportSender() {}
-
- // Sets the maximum number of crash reports that will be sent in a 24-hour
- // period. This uses the state persisted to the checkpoint file.
- // The default value of -1 means that there is no limit on reports sent.
- void set_max_reports_per_day(int reports) {
- max_reports_per_day_ = reports;
- }
-
- int max_reports_per_day() const { return max_reports_per_day_; }
-
- // Sends the specified files, along with the map of
- // name value pairs, as a multipart POST request to the given URL.
- // Parameter names must contain only printable ASCII characters,
- // and may not contain a quote (") character.
- // Only HTTP(S) URLs are currently supported. The return value indicates
- // the result of the operation (see above for possible results).
- // If report_code is non-NULL and the report is sent successfully (that is,
- // the return value is RESULT_SUCCEEDED), a code uniquely identifying the
- // report will be returned in report_code.
- // (Otherwise, report_code will be unchanged.)
- ReportResult SendCrashReport(const wstring &url,
- const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- wstring *report_code);
-
- private:
- // Reads persistent state from a checkpoint file.
- void ReadCheckpoint(FILE *fd);
-
- // Called when a new report has been sent, to update the checkpoint state.
- void ReportSent(int today);
-
- // Returns today's date (UTC) formatted as YYYYMMDD.
- int GetCurrentDate() const;
-
- // Opens the checkpoint file with the specified mode.
- // Returns zero on success, or an error code on failure.
- int OpenCheckpointFile(const wchar_t *mode, FILE **fd);
-
- wstring checkpoint_file_;
- int max_reports_per_day_;
- // The last date on which we sent a report, expressed as YYYYMMDD.
- int last_sent_date_;
- // Number of reports sent on last_sent_date_
- int reports_sent_;
-
- // Disallow copy constructor and operator=
- explicit CrashReportSender(const CrashReportSender &);
- void operator=(const CrashReportSender &);
-};
-
-} // namespace google_breakpad
-
-#pragma warning( pop )
-
-#endif // CLIENT_WINDOWS_SENDER_CRASH_REPORT_SENDER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mozbuild b/toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mozbuild
deleted file mode 100644
index 7b519328dc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/sender/objs.mozbuild
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-lobjs_sender = [
- 'crash_report_sender.cc',
-]
-
-subdir = 'toolkit/crashreporter/google-breakpad/src/client/windows/sender'
-objs_sender = [
- '/%s/%s' % (subdir, s) for s in lobjs_sender
-]
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.cc
deleted file mode 100644
index 32f78f2b95..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/windows/tests/crash_generation_app/abstract_class.h"
-
-namespace google_breakpad {
-
-Base::Base(Derived* derived)
- : derived_(derived) {
-}
-
-Base::~Base() {
- derived_->DoSomething();
-}
-
-#pragma warning(push)
-#pragma warning(disable:4355)
-// Disable warning C4355: 'this' : used in base member initializer list.
-Derived::Derived()
- : Base(this) { // C4355
-}
-#pragma warning(pop)
-
-void Derived::DoSomething() {
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.h b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.h
deleted file mode 100644
index e3f2a4f371..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/abstract_class.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_ABSTRACT_CLASS_H__
-#define CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_ABSTRACT_CLASS_H__
-
-namespace google_breakpad {
-
-// Dummy classes to help generate a pure call violation.
-
-class Derived;
-
-class Base {
- public:
- Base(Derived* derived);
- virtual ~Base();
- virtual void DoSomething() = 0;
-
- private:
- Derived* derived_;
-};
-
-class Derived : public Base {
- public:
- Derived();
- virtual void DoSomething();
-};
-
-} // namespace google_breakpad
-
-#endif // CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_CRASH_GENERATION_APP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
deleted file mode 100644
index 0d837e521d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.cc
+++ /dev/null
@@ -1,522 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// crash_generation_app.cpp : Defines the entry point for the application.
-//
-
-#include "client/windows/tests/crash_generation_app/crash_generation_app.h"
-
-#include <windows.h>
-#include <tchar.h>
-
-#include "client/windows/crash_generation/client_info.h"
-#include "client/windows/crash_generation/crash_generation_server.h"
-#include "client/windows/handler/exception_handler.h"
-#include "client/windows/common/ipc_protocol.h"
-
-#include "client/windows/tests/crash_generation_app/abstract_class.h"
-
-namespace google_breakpad {
-
-const int kMaxLoadString = 100;
-const wchar_t kPipeName[] = L"\\\\.\\pipe\\BreakpadCrashServices\\TestServer";
-
-const DWORD kEditBoxStyles = WS_CHILD |
- WS_VISIBLE |
- WS_VSCROLL |
- ES_LEFT |
- ES_MULTILINE |
- ES_AUTOVSCROLL |
- ES_READONLY;
-
-// Maximum length of a line in the edit box.
-const size_t kMaximumLineLength = 256;
-
-// CS to access edit control in a thread safe way.
-static CRITICAL_SECTION* cs_edit = NULL;
-
-// Edit control.
-static HWND client_status_edit_box;
-
-HINSTANCE current_instance; // Current instance.
-TCHAR title[kMaxLoadString]; // Title bar text.
-TCHAR window_class[kMaxLoadString]; // Main window class name.
-
-ATOM MyRegisterClass(HINSTANCE instance);
-BOOL InitInstance(HINSTANCE, int);
-LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
-INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
-
-static size_t kCustomInfoCount = 2;
-static CustomInfoEntry kCustomInfoEntries[] = {
- CustomInfoEntry(L"prod", L"CrashTestApp"),
- CustomInfoEntry(L"ver", L"1.0"),
-};
-
-static ExceptionHandler* handler = NULL;
-static CrashGenerationServer* crash_server = NULL;
-
-// Registers the window class.
-//
-// This function and its usage are only necessary if you want this code
-// to be compatible with Win32 systems prior to the 'RegisterClassEx'
-// function that was added to Windows 95. It is important to call this
-// function so that the application will get 'well formed' small icons
-// associated with it.
-ATOM MyRegisterClass(HINSTANCE instance) {
- WNDCLASSEX wcex;
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.style = CS_HREDRAW | CS_VREDRAW;
- wcex.lpfnWndProc = WndProc;
- wcex.cbClsExtra = 0;
- wcex.cbWndExtra = 0;
- wcex.hInstance = instance;
- wcex.hIcon = LoadIcon(instance,
- MAKEINTRESOURCE(IDI_CRASHGENERATIONAPP));
- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
- wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- wcex.lpszMenuName = MAKEINTRESOURCE(IDC_CRASHGENERATIONAPP);
- wcex.lpszClassName = window_class;
- wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
-
- return RegisterClassEx(&wcex);
-}
-
-// Saves instance handle and creates main window
-//
-// In this function, we save the instance handle in a global variable and
-// create and display the main program window.
-BOOL InitInstance(HINSTANCE instance, int command_show) {
- current_instance = instance;
- HWND wnd = CreateWindow(window_class,
- title,
- WS_OVERLAPPEDWINDOW,
- CW_USEDEFAULT,
- 0,
- CW_USEDEFAULT,
- 0,
- NULL,
- NULL,
- instance,
- NULL);
-
- if (!wnd) {
- return FALSE;
- }
-
- ShowWindow(wnd, command_show);
- UpdateWindow(wnd);
-
- return TRUE;
-}
-
-static void AppendTextToEditBox(TCHAR* text) {
- EnterCriticalSection(cs_edit);
- SYSTEMTIME current_time;
- GetLocalTime(&current_time);
- TCHAR line[kMaximumLineLength];
- int result = swprintf_s(line,
- kMaximumLineLength,
- L"[%.2d-%.2d-%.4d %.2d:%.2d:%.2d] %s",
- current_time.wMonth,
- current_time.wDay,
- current_time.wYear,
- current_time.wHour,
- current_time.wMinute,
- current_time.wSecond,
- text);
-
- if (result == -1) {
- return;
- }
-
- int length = GetWindowTextLength(client_status_edit_box);
- SendMessage(client_status_edit_box,
- EM_SETSEL,
- (WPARAM)length,
- (LPARAM)length);
- SendMessage(client_status_edit_box,
- EM_REPLACESEL,
- (WPARAM)FALSE,
- (LPARAM)line);
- LeaveCriticalSection(cs_edit);
-}
-
-static DWORD WINAPI AppendTextWorker(void* context) {
- TCHAR* text = reinterpret_cast<TCHAR*>(context);
-
- AppendTextToEditBox(text);
- delete[] text;
-
- return 0;
-}
-
-bool ShowDumpResults(const wchar_t* dump_path,
- const wchar_t* minidump_id,
- void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- bool succeeded) {
- TCHAR* text = new TCHAR[kMaximumLineLength];
- text[0] = _T('\0');
- int result = swprintf_s(text,
- kMaximumLineLength,
- TEXT("Dump generation request %s\r\n"),
- succeeded ? TEXT("succeeded") : TEXT("failed"));
- if (result == -1) {
- delete [] text;
- }
-
- QueueUserWorkItem(AppendTextWorker, text, WT_EXECUTEDEFAULT);
- return succeeded;
-}
-
-static void ShowClientConnected(void* context,
- const ClientInfo* client_info) {
- TCHAR* line = new TCHAR[kMaximumLineLength];
- line[0] = _T('\0');
- int result = swprintf_s(line,
- kMaximumLineLength,
- L"Client connected:\t\t%d\r\n",
- client_info->pid());
-
- if (result == -1) {
- delete[] line;
- return;
- }
-
- QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
-}
-
-static void ShowClientCrashed(void* context,
- const ClientInfo* client_info,
- const wstring* dump_path) {
- TCHAR* line = new TCHAR[kMaximumLineLength];
- line[0] = _T('\0');
- int result = swprintf_s(line,
- kMaximumLineLength,
- TEXT("Client requested dump:\t%d\r\n"),
- client_info->pid());
-
- if (result == -1) {
- delete[] line;
- return;
- }
-
- QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
-
- CustomClientInfo custom_info = client_info->GetCustomInfo();
- if (custom_info.count <= 0) {
- return;
- }
-
- wstring str_line;
- for (size_t i = 0; i < custom_info.count; ++i) {
- if (i > 0) {
- str_line += L", ";
- }
- str_line += custom_info.entries[i].name;
- str_line += L": ";
- str_line += custom_info.entries[i].value;
- }
-
- line = new TCHAR[kMaximumLineLength];
- line[0] = _T('\0');
- result = swprintf_s(line,
- kMaximumLineLength,
- L"%s\n",
- str_line.c_str());
- if (result == -1) {
- delete[] line;
- return;
- }
- QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
-}
-
-static void ShowClientExited(void* context,
- const ClientInfo* client_info) {
- TCHAR* line = new TCHAR[kMaximumLineLength];
- line[0] = _T('\0');
- int result = swprintf_s(line,
- kMaximumLineLength,
- TEXT("Client exited:\t\t%d\r\n"),
- client_info->pid());
-
- if (result == -1) {
- delete[] line;
- return;
- }
-
- QueueUserWorkItem(AppendTextWorker, line, WT_EXECUTEDEFAULT);
-}
-
-void CrashServerStart() {
- // Do not create another instance of the server.
- if (crash_server) {
- return;
- }
-
- std::wstring dump_path = L"C:\\Dumps\\";
-
- if (_wmkdir(dump_path.c_str()) && (errno != EEXIST)) {
- MessageBoxW(NULL, L"Unable to create dump directory", L"Dumper", MB_OK);
- return;
- }
-
- crash_server = new CrashGenerationServer(kPipeName,
- NULL,
- ShowClientConnected,
- NULL,
- ShowClientCrashed,
- NULL,
- ShowClientExited,
- NULL,
- NULL,
- NULL,
- true,
- &dump_path);
-
- if (!crash_server->Start()) {
- MessageBoxW(NULL, L"Unable to start server", L"Dumper", MB_OK);
- delete crash_server;
- crash_server = NULL;
- }
-}
-
-void CrashServerStop() {
- delete crash_server;
- crash_server = NULL;
-}
-
-void DerefZeroCrash() {
- int* x = 0;
- *x = 1;
-}
-
-void InvalidParamCrash() {
- printf(NULL);
-}
-
-void PureCallCrash() {
- Derived derived;
-}
-
-void RequestDump() {
- if (!handler->WriteMinidump()) {
- MessageBoxW(NULL, L"Dump request failed", L"Dumper", MB_OK);
- }
- kCustomInfoEntries[1].set_value(L"1.1");
-}
-
-void CleanUp() {
- if (cs_edit) {
- DeleteCriticalSection(cs_edit);
- delete cs_edit;
- }
-
- if (handler) {
- delete handler;
- }
-
- if (crash_server) {
- delete crash_server;
- }
-}
-
-// Processes messages for the main window.
-//
-// WM_COMMAND - process the application menu.
-// WM_PAINT - Paint the main window.
-// WM_DESTROY - post a quit message and return.
-LRESULT CALLBACK WndProc(HWND wnd,
- UINT message,
- WPARAM w_param,
- LPARAM l_param) {
- int message_id;
- int message_event;
- PAINTSTRUCT ps;
- HDC hdc;
-
- HINSTANCE instance = (HINSTANCE)GetWindowLongPtr(wnd, GWLP_HINSTANCE);
-
- switch (message) {
- case WM_COMMAND:
- // Parse the menu selections.
- message_id = LOWORD(w_param);
- message_event = HIWORD(w_param);
- switch (message_id) {
- case IDM_ABOUT:
- DialogBox(current_instance,
- MAKEINTRESOURCE(IDD_ABOUTBOX),
- wnd,
- About);
- break;
- case IDM_EXIT:
- DestroyWindow(wnd);
- break;
- case ID_SERVER_START:
- CrashServerStart();
- break;
- case ID_SERVER_STOP:
- CrashServerStop();
- break;
- case ID_CLIENT_DEREFZERO:
- DerefZeroCrash();
- break;
- case ID_CLIENT_INVALIDPARAM:
- InvalidParamCrash();
- break;
- case ID_CLIENT_PURECALL:
- PureCallCrash();
- break;
- case ID_CLIENT_REQUESTEXPLICITDUMP:
- RequestDump();
- break;
- default:
- return DefWindowProc(wnd, message, w_param, l_param);
- }
- break;
- case WM_CREATE:
- client_status_edit_box = CreateWindow(TEXT("EDIT"),
- NULL,
- kEditBoxStyles,
- 0,
- 0,
- 0,
- 0,
- wnd,
- NULL,
- instance,
- NULL);
- break;
- case WM_SIZE:
- // Make the edit control the size of the window's client area.
- MoveWindow(client_status_edit_box,
- 0,
- 0,
- LOWORD(l_param), // width of client area.
- HIWORD(l_param), // height of client area.
- TRUE); // repaint window.
- break;
- case WM_SETFOCUS:
- SetFocus(client_status_edit_box);
- break;
- case WM_PAINT:
- hdc = BeginPaint(wnd, &ps);
- EndPaint(wnd, &ps);
- break;
- case WM_DESTROY:
- CleanUp();
- PostQuitMessage(0);
- break;
- default:
- return DefWindowProc(wnd, message, w_param, l_param);
- }
-
- return 0;
-}
-
-// Message handler for about box.
-INT_PTR CALLBACK About(HWND dlg,
- UINT message,
- WPARAM w_param,
- LPARAM l_param) {
- UNREFERENCED_PARAMETER(l_param);
- switch (message) {
- case WM_INITDIALOG:
- return (INT_PTR)TRUE;
-
- case WM_COMMAND:
- if (LOWORD(w_param) == IDOK || LOWORD(w_param) == IDCANCEL) {
- EndDialog(dlg, LOWORD(w_param));
- return (INT_PTR)TRUE;
- }
- break;
- }
-
- return (INT_PTR)FALSE;
-}
-
-} // namespace google_breakpad
-
-int APIENTRY _tWinMain(HINSTANCE instance,
- HINSTANCE previous_instance,
- LPTSTR command_line,
- int command_show) {
- using namespace google_breakpad;
-
- UNREFERENCED_PARAMETER(previous_instance);
- UNREFERENCED_PARAMETER(command_line);
-
- cs_edit = new CRITICAL_SECTION();
- InitializeCriticalSection(cs_edit);
-
- CustomClientInfo custom_info = {kCustomInfoEntries, kCustomInfoCount};
-
- CrashServerStart();
- // This is needed for CRT to not show dialog for invalid param
- // failures and instead let the code handle it.
- _CrtSetReportMode(_CRT_ASSERT, 0);
- handler = new ExceptionHandler(L"C:\\dumps\\",
- NULL,
- google_breakpad::ShowDumpResults,
- NULL,
- ExceptionHandler::HANDLER_ALL,
- MiniDumpNormal,
- kPipeName,
- &custom_info);
-
- // Initialize global strings.
- LoadString(instance, IDS_APP_TITLE, title, kMaxLoadString);
- LoadString(instance,
- IDC_CRASHGENERATIONAPP,
- window_class,
- kMaxLoadString);
- MyRegisterClass(instance);
-
- // Perform application initialization.
- if (!InitInstance(instance, command_show)) {
- return FALSE;
- }
-
- HACCEL accel_table = LoadAccelerators(
- instance,
- MAKEINTRESOURCE(IDC_CRASHGENERATIONAPP));
-
- // Main message loop.
- MSG msg;
- while (GetMessage(&msg, NULL, 0, 0)) {
- if (!TranslateAccelerator(msg.hwnd, accel_table, &msg)) {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
-
- return static_cast<int>(msg.wParam);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp
deleted file mode 100644
index 3ce307da0d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.gyp
+++ /dev/null
@@ -1,63 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'crash_generation_app',
- 'type': 'executable',
- 'sources': [
- 'abstract_class.cc',
- 'abstract_class.h',
- 'crash_generation_app.cc',
- 'crash_generation_app.h',
- 'crash_generation_app.ico',
- 'crash_generation_app.rc',
- 'resource.h',
- 'small.ico',
- ],
- 'libraries': [
- 'user32.lib',
- ],
- 'dependencies': [
- '../../breakpad_client.gyp:common',
- '../../crash_generation/crash_generation.gyp:crash_generation_server',
- '../../crash_generation/crash_generation.gyp:crash_generation_client',
- '../../handler/exception_handler.gyp:exception_handler',
- ],
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'SubSystem': '2', # Windows Subsystem as opposed to a console app
- },
- },
- }
- ]
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.h b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.h
deleted file mode 100644
index 4d3bb6eb2a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_CRASH_GENERATION_APP_H__
-#define CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_CRASH_GENERATION_APP_H__
-
-#include "resource.h"
-
-#endif // CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_CRASH_GENERATION_APP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.ico b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.ico
deleted file mode 100644
index d551aa3aaf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.ico
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.rc b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.rc
deleted file mode 100644
index a362562b92..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/crash_generation_app.rc
+++ /dev/null
@@ -1,144 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#define APSTUDIO_HIDDEN_SYMBOLS
-#include "windows.h"
-#undef APSTUDIO_HIDDEN_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDI_CRASHGENERATIONAPP ICON "crash_generation_app.ico"
-IDI_SMALL ICON "small.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDC_CRASHGENERATIONAPP MENU
-BEGIN
- POPUP "&File"
- BEGIN
- MENUITEM "E&xit", IDM_EXIT
- END
- POPUP "&Server"
- BEGIN
- MENUITEM "&Start", ID_SERVER_START
- MENUITEM "S&top", ID_SERVER_STOP
- END
- POPUP "&Client"
- BEGIN
- MENUITEM "&Deref Zero", ID_CLIENT_DEREFZERO
- MENUITEM "&Invalid Param", ID_CLIENT_INVALIDPARAM
- MENUITEM "&Pure Call", ID_CLIENT_PURECALL
- MENUITEM "&Request Dump", ID_CLIENT_REQUESTEXPLICITDUMP
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDC_CRASHGENERATIONAPP ACCELERATORS
-BEGIN
- "?", IDM_ABOUT, ASCII, ALT
- "/", IDM_ABOUT, ASCII, ALT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOG 22, 17, 230, 75
-STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
-CAPTION "About"
-FONT 8, "System"
-BEGIN
- ICON IDI_CRASHGENERATIONAPP,IDC_MYICON,14,9,16,16
- LTEXT "CrashGenerationApp Version 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX
- LTEXT "Copyright (C) 2008",IDC_STATIC,49,20,119,8
- DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP
-END
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
- "#include ""windows.h""\r\n"
- "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE
-BEGIN
- IDS_APP_TITLE "CrashGenerationApp"
- IDC_CRASHGENERATIONAPP "CRASHGENERATIONAPP"
-END
-
-#endif // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/resource.h b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/resource.h
deleted file mode 100644
index 8c7f6570a8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/resource.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// PreCompile.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#ifndef CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_RESOURCE_H__
-#define CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_RESOURCE_H__
-
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by crash_generation_app.rc
-//
-#define IDC_MYICON 2
-#define IDD_CRASHGENERATIONAPP_DIALOG 102
-#define IDS_APP_TITLE 103
-#define IDD_ABOUTBOX 103
-#define IDM_ABOUT 104
-#define IDM_EXIT 105
-#define IDI_CRASHGENERATIONAPP 107
-#define IDI_SMALL 108
-#define IDC_CRASHGENERATIONAPP 109
-#define IDR_MAINFRAME 128
-#define ID_SERVER_START 32771
-#define ID_SERVER_STOP 32772
-#define ID_CLIENT_INVALIDPARAM 32773
-#define ID_CLIENT_ASSERTFAILURE 32774
-#define ID_CLIENT_DEREFZERO 32775
-#define ID_CLIENT_PURECALL 32777
-#define ID_CLIENT_REQUESTEXPLICITDUMP 32778
-#define IDC_STATIC -1
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NO_MFC 1
-#define _APS_NEXT_RESOURCE_VALUE 129
-#define _APS_NEXT_COMMAND_VALUE 32780
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 110
-#endif
-#endif
-
-#endif // CLIENT_WINDOWS_TESTS_CRASH_GENERATION_APP_RESOURCE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/small.ico b/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/small.ico
deleted file mode 100644
index d551aa3aaf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/tests/crash_generation_app/small.ico
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp
deleted file mode 100644
index b13603ef44..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/client_tests.gyp
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'client_tests',
- 'type': 'executable',
- 'sources': [
- 'exception_handler_test.h',
- 'exception_handler_test.cc',
- 'exception_handler_death_test.cc',
- 'exception_handler_nesting_test.cc',
- 'minidump_test.cc',
- 'dump_analysis.cc',
- 'dump_analysis.h',
- 'crash_generation_server_test.cc'
- ],
- 'dependencies': [
- 'testing.gyp:gtest',
- 'testing.gyp:gmock',
- '../breakpad_client.gyp:common',
- '../crash_generation/crash_generation.gyp:crash_generation_server',
- '../crash_generation/crash_generation.gyp:crash_generation_client',
- '../handler/exception_handler.gyp:exception_handler',
- 'processor_bits',
- ]
- },
- {
- 'target_name': 'processor_bits',
- 'type': 'static_library',
- 'include_dirs': [
- '<(DEPTH)',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(DEPTH)',
- ]
- },
- 'sources': [
- '<(DEPTH)/common/string_conversion.cc',
- '<(DEPTH)/processor/basic_code_modules.cc',
- '<(DEPTH)/processor/dump_context.cc',
- '<(DEPTH)/processor/dump_object.cc',
- '<(DEPTH)/processor/logging.cc',
- '<(DEPTH)/processor/minidump.cc',
- '<(DEPTH)/processor/pathname_stripper.cc',
- '<(DEPTH)/processor/proc_maps_linux.cc',
- ]
- }
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/crash_generation_server_test.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/crash_generation_server_test.cc
deleted file mode 100644
index b7b2b84f2d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/crash_generation_server_test.cc
+++ /dev/null
@@ -1,305 +0,0 @@
-// Copyright 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "testing/gtest/include/gtest/gtest.h"
-#include "testing/include/gmock/gmock.h"
-
-#include "client/windows/crash_generation/crash_generation_server.h"
-#include "client/windows/common/ipc_protocol.h"
-
-using testing::_;
-
-namespace {
-
-const wchar_t kPipeName[] =
- L"\\\\.\\pipe\\CrashGenerationServerTest\\TestCaseServer";
-
-const DWORD kPipeDesiredAccess = FILE_READ_DATA |
- FILE_WRITE_DATA |
- FILE_WRITE_ATTRIBUTES;
-
-const DWORD kPipeFlagsAndAttributes = SECURITY_IDENTIFICATION |
- SECURITY_SQOS_PRESENT;
-
-const DWORD kPipeMode = PIPE_READMODE_MESSAGE;
-
-#define arraysize(f) (sizeof(f) / sizeof(*f))
-const google_breakpad::CustomInfoEntry kCustomInfoEntries[] = {
- google_breakpad::CustomInfoEntry(L"prod", L"CrashGenerationServerTest"),
- google_breakpad::CustomInfoEntry(L"ver", L"1.0"),
-};
-
-class CrashGenerationServerTest : public ::testing::Test {
- public:
- CrashGenerationServerTest()
- : crash_generation_server_(kPipeName,
- NULL,
- CallOnClientConnected, &mock_callbacks_,
- CallOnClientDumpRequested, &mock_callbacks_,
- CallOnClientExited, &mock_callbacks_,
- CallOnClientUploadRequested, &mock_callbacks_,
- false,
- NULL),
- thread_id_(0),
- exception_pointers_(NULL) {
- memset(&assert_info_, 0, sizeof(assert_info_));
- }
-
- protected:
- class MockCrashGenerationServerCallbacks {
- public:
- MOCK_METHOD1(OnClientConnected,
- void(const google_breakpad::ClientInfo* client_info));
- MOCK_METHOD2(OnClientDumpRequested,
- void(const google_breakpad::ClientInfo* client_info,
- const std::wstring* file_path));
- MOCK_METHOD1(OnClientExited,
- void(const google_breakpad::ClientInfo* client_info));
- MOCK_METHOD1(OnClientUploadRequested,
- void(const DWORD crash_id));
- };
-
- enum ClientFault {
- NO_FAULT,
- CLOSE_AFTER_CONNECT,
- SEND_INVALID_REGISTRATION,
- TRUNCATE_REGISTRATION,
- CLOSE_AFTER_REGISTRATION,
- RESPONSE_BUFFER_TOO_SMALL,
- CLOSE_AFTER_RESPONSE,
- SEND_INVALID_ACK
- };
-
- void SetUp() {
- ASSERT_TRUE(crash_generation_server_.Start());
- }
-
- void FaultyClient(ClientFault fault_type) {
- HANDLE pipe = CreateFile(kPipeName,
- kPipeDesiredAccess,
- 0,
- NULL,
- OPEN_EXISTING,
- kPipeFlagsAndAttributes,
- NULL);
-
- if (pipe == INVALID_HANDLE_VALUE) {
- ASSERT_EQ(ERROR_PIPE_BUSY, GetLastError());
-
- // Cannot continue retrying if wait on pipe fails.
- ASSERT_TRUE(WaitNamedPipe(kPipeName, 500));
-
- pipe = CreateFile(kPipeName,
- kPipeDesiredAccess,
- 0,
- NULL,
- OPEN_EXISTING,
- kPipeFlagsAndAttributes,
- NULL);
- }
-
- ASSERT_NE(pipe, INVALID_HANDLE_VALUE);
-
- DWORD mode = kPipeMode;
- ASSERT_TRUE(SetNamedPipeHandleState(pipe, &mode, NULL, NULL));
-
- DoFaultyClient(fault_type, pipe);
-
- CloseHandle(pipe);
- }
-
- void DoTestFault(ClientFault fault) {
- EXPECT_CALL(mock_callbacks_, OnClientConnected(_)).Times(0);
- ASSERT_NO_FATAL_FAILURE(FaultyClient(fault));
- ASSERT_NO_FATAL_FAILURE(FaultyClient(fault));
- ASSERT_NO_FATAL_FAILURE(FaultyClient(fault));
-
- EXPECT_CALL(mock_callbacks_, OnClientConnected(_));
-
- ASSERT_NO_FATAL_FAILURE(FaultyClient(NO_FAULT));
-
- // Slight hack. The OnClientConnected is only invoked after the ack is
- // received by the server. At that point, the FaultyClient call has already
- // returned. The best way to wait until the server is done handling that is
- // to send one more ping, whose processing will be blocked by delivery of
- // the OnClientConnected message.
- ASSERT_NO_FATAL_FAILURE(FaultyClient(CLOSE_AFTER_CONNECT));
- }
-
- MockCrashGenerationServerCallbacks mock_callbacks_;
-
- private:
- // Depends on the caller to successfully open the pipe before invocation and
- // to close it immediately afterwards.
- void DoFaultyClient(ClientFault fault_type, HANDLE pipe) {
- if (fault_type == CLOSE_AFTER_CONNECT) {
- return;
- }
-
- google_breakpad::CustomClientInfo custom_info = {kCustomInfoEntries,
- arraysize(kCustomInfoEntries)};
-
- google_breakpad::ProtocolMessage msg(
- fault_type == SEND_INVALID_REGISTRATION ?
- google_breakpad::MESSAGE_TAG_NONE :
- google_breakpad::MESSAGE_TAG_REGISTRATION_REQUEST,
- GetCurrentProcessId(),
- MiniDumpNormal,
- &thread_id_,
- &exception_pointers_,
- &assert_info_,
- custom_info,
- NULL,
- NULL,
- NULL);
-
- DWORD bytes_count = 0;
-
- ASSERT_TRUE(WriteFile(pipe,
- &msg,
- fault_type == TRUNCATE_REGISTRATION ?
- sizeof(msg) / 2 : sizeof(msg),
- &bytes_count,
- NULL));
-
- if (fault_type == CLOSE_AFTER_REGISTRATION) {
- return;
- }
-
- google_breakpad::ProtocolMessage reply;
-
- if (!ReadFile(pipe,
- &reply,
- fault_type == RESPONSE_BUFFER_TOO_SMALL ?
- sizeof(google_breakpad::ProtocolMessage) / 2 :
- sizeof(google_breakpad::ProtocolMessage),
- &bytes_count,
- NULL)) {
- switch (fault_type) {
- case TRUNCATE_REGISTRATION:
- case RESPONSE_BUFFER_TOO_SMALL:
- case SEND_INVALID_REGISTRATION:
- return;
-
- default:
- FAIL() << "Unexpectedly failed to register.";
- }
- }
-
- if (fault_type == CLOSE_AFTER_RESPONSE) {
- return;
- }
-
- google_breakpad::ProtocolMessage ack_msg;
- ack_msg.tag = google_breakpad::MESSAGE_TAG_REGISTRATION_ACK;
-
- ASSERT_TRUE(WriteFile(pipe,
- &ack_msg,
- SEND_INVALID_ACK ?
- sizeof(ack_msg) : sizeof(ack_msg) / 2,
- &bytes_count,
- NULL));
-
- return;
- }
-
- static void CallOnClientConnected(
- void* context, const google_breakpad::ClientInfo* client_info) {
- static_cast<MockCrashGenerationServerCallbacks*>(context)->
- OnClientConnected(client_info);
- }
-
- static void CallOnClientDumpRequested(
- void* context,
- const google_breakpad::ClientInfo* client_info,
- const std::wstring* file_path) {
- static_cast<MockCrashGenerationServerCallbacks*>(context)->
- OnClientDumpRequested(client_info, file_path);
- }
-
- static void CallOnClientExited(
- void* context, const google_breakpad::ClientInfo* client_info) {
- static_cast<MockCrashGenerationServerCallbacks*>(context)->
- OnClientExited(client_info);
- }
-
- static void CallOnClientUploadRequested(void* context, const DWORD crash_id) {
- static_cast<MockCrashGenerationServerCallbacks*>(context)->
- OnClientUploadRequested(crash_id);
- }
-
- DWORD thread_id_;
- EXCEPTION_POINTERS* exception_pointers_;
- MDRawAssertionInfo assert_info_;
-
- google_breakpad::CrashGenerationServer crash_generation_server_;
-};
-
-TEST_F(CrashGenerationServerTest, PingServerTest) {
- DoTestFault(CLOSE_AFTER_CONNECT);
-}
-
-TEST_F(CrashGenerationServerTest, InvalidRegistration) {
- DoTestFault(SEND_INVALID_REGISTRATION);
-}
-
-TEST_F(CrashGenerationServerTest, TruncateRegistration) {
- DoTestFault(TRUNCATE_REGISTRATION);
-}
-
-TEST_F(CrashGenerationServerTest, CloseAfterRegistration) {
- DoTestFault(CLOSE_AFTER_REGISTRATION);
-}
-
-TEST_F(CrashGenerationServerTest, ResponseBufferTooSmall) {
- DoTestFault(RESPONSE_BUFFER_TOO_SMALL);
-}
-
-TEST_F(CrashGenerationServerTest, CloseAfterResponse) {
- DoTestFault(CLOSE_AFTER_RESPONSE);
-}
-
-// It turns out that, as long as you send one byte, the ACK is accepted and
-// registration succeeds.
-TEST_F(CrashGenerationServerTest, SendInvalidAck) {
- EXPECT_CALL(mock_callbacks_, OnClientConnected(_));
- ASSERT_NO_FATAL_FAILURE(FaultyClient(SEND_INVALID_ACK));
-
- // See DoTestFault for an explanation of this line
- ASSERT_NO_FATAL_FAILURE(FaultyClient(CLOSE_AFTER_CONNECT));
-
- EXPECT_CALL(mock_callbacks_, OnClientConnected(_));
- ASSERT_NO_FATAL_FAILURE(FaultyClient(NO_FAULT));
-
- // See DoTestFault for an explanation of this line
- ASSERT_NO_FATAL_FAILURE(FaultyClient(CLOSE_AFTER_CONNECT));
-}
-
-} // anonymous namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc
deleted file mode 100644
index 6bf8547196..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <windows.h>
-#include <objbase.h>
-#include <dbghelp.h>
-
-#include "client/windows/unittests/dump_analysis.h" // NOLINT
-#include "testing/gtest/include/gtest/gtest.h"
-
-DumpAnalysis::~DumpAnalysis() {
- if (dump_file_view_ != NULL) {
- EXPECT_TRUE(::UnmapViewOfFile(dump_file_view_));
- ::CloseHandle(dump_file_mapping_);
- dump_file_mapping_ = NULL;
- }
-
- if (dump_file_handle_ != NULL) {
- ::CloseHandle(dump_file_handle_);
- dump_file_handle_ = NULL;
- }
-}
-
-void DumpAnalysis::EnsureDumpMapped() {
- if (dump_file_view_ == NULL) {
- dump_file_handle_ = ::CreateFile(dump_file_.c_str(),
- GENERIC_READ,
- 0,
- NULL,
- OPEN_EXISTING,
- 0,
- NULL);
- ASSERT_TRUE(dump_file_handle_ != NULL);
- ASSERT_TRUE(dump_file_mapping_ == NULL);
-
- dump_file_mapping_ = ::CreateFileMapping(dump_file_handle_,
- NULL,
- PAGE_READONLY,
- 0,
- 0,
- NULL);
- ASSERT_TRUE(dump_file_mapping_ != NULL);
-
- dump_file_view_ = ::MapViewOfFile(dump_file_mapping_,
- FILE_MAP_READ,
- 0,
- 0,
- 0);
- ASSERT_TRUE(dump_file_view_ != NULL);
- }
-}
-
-bool DumpAnalysis::HasTebs() const {
- MINIDUMP_THREAD_LIST* thread_list = NULL;
- size_t thread_list_size = GetStream(ThreadListStream, &thread_list);
-
- if (thread_list_size > 0 && thread_list != NULL) {
- for (ULONG i = 0; i < thread_list->NumberOfThreads; ++i) {
- if (!HasMemory(thread_list->Threads[i].Teb))
- return false;
- }
-
- return true;
- }
-
- // No thread list, no TEB info.
- return false;
-}
-
-bool DumpAnalysis::HasPeb() const {
- MINIDUMP_THREAD_LIST* thread_list = NULL;
- size_t thread_list_size = GetStream(ThreadListStream, &thread_list);
-
- if (thread_list_size > 0 && thread_list != NULL &&
- thread_list->NumberOfThreads > 0) {
- FakeTEB* teb = NULL;
- if (!HasMemory(thread_list->Threads[0].Teb, &teb))
- return false;
-
- return HasMemory(teb->peb);
- }
-
- return false;
-}
-
-bool DumpAnalysis::HasStream(ULONG stream_number) const {
- void* stream = NULL;
- size_t stream_size = GetStreamImpl(stream_number, &stream);
- return stream_size > 0 && stream != NULL;
-}
-
-size_t DumpAnalysis::GetStreamImpl(ULONG stream_number, void** stream) const {
- MINIDUMP_DIRECTORY* directory = NULL;
- ULONG memory_list_size = 0;
- BOOL ret = ::MiniDumpReadDumpStream(dump_file_view_,
- stream_number,
- &directory,
- stream,
- &memory_list_size);
-
- return ret ? memory_list_size : 0;
-}
-
-bool DumpAnalysis::HasMemoryImpl(const void *addr_in, size_t structuresize,
- void **structure) const {
- uintptr_t address = reinterpret_cast<uintptr_t>(addr_in);
- MINIDUMP_MEMORY_LIST* memory_list = NULL;
- size_t memory_list_size = GetStream(MemoryListStream, &memory_list);
- if (memory_list_size > 0 && memory_list != NULL) {
- for (ULONG i = 0; i < memory_list->NumberOfMemoryRanges; ++i) {
- MINIDUMP_MEMORY_DESCRIPTOR& descr = memory_list->MemoryRanges[i];
- const uintptr_t range_start =
- static_cast<uintptr_t>(descr.StartOfMemoryRange);
- uintptr_t range_end = range_start + descr.Memory.DataSize;
-
- if (address >= range_start &&
- address + structuresize < range_end) {
- // The start address falls in the range, and the end address is
- // in bounds, return a pointer to the structure if requested.
- if (structure != NULL)
- *structure = RVA_TO_ADDR(dump_file_view_, descr.Memory.Rva);
-
- return true;
- }
- }
- }
-
- // We didn't find the range in a MINIDUMP_MEMORY_LIST, so maybe this
- // is a full dump using MINIDUMP_MEMORY64_LIST with all the memory at the
- // end of the dump file.
- MINIDUMP_MEMORY64_LIST* memory64_list = NULL;
- memory_list_size = GetStream(Memory64ListStream, &memory64_list);
- if (memory_list_size > 0 && memory64_list != NULL) {
- // Keep track of where the current descriptor maps to.
- RVA64 curr_rva = memory64_list->BaseRva;
- for (ULONG i = 0; i < memory64_list->NumberOfMemoryRanges; ++i) {
- MINIDUMP_MEMORY_DESCRIPTOR64& descr = memory64_list->MemoryRanges[i];
- uintptr_t range_start =
- static_cast<uintptr_t>(descr.StartOfMemoryRange);
- uintptr_t range_end = range_start + static_cast<size_t>(descr.DataSize);
-
- if (address >= range_start &&
- address + structuresize < range_end) {
- // The start address falls in the range, and the end address is
- // in bounds, return a pointer to the structure if requested.
- if (structure != NULL)
- *structure = RVA_TO_ADDR(dump_file_view_, curr_rva);
-
- return true;
- }
-
- // Advance the current RVA.
- curr_rva += descr.DataSize;
- }
- }
-
- return false;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h
deleted file mode 100644
index 6cef48d814..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/dump_analysis.h
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_UNITTESTS_DUMP_ANALYSIS_H_
-#define CLIENT_WINDOWS_UNITTESTS_DUMP_ANALYSIS_H_
-
-#include "client/windows/crash_generation/minidump_generator.h"
-
-// Convenience to get to the PEB pointer in a TEB.
-struct FakeTEB {
- char dummy[0x30];
- void* peb;
-};
-
-class DumpAnalysis {
- public:
- explicit DumpAnalysis(const std::wstring& file_path)
- : dump_file_(file_path), dump_file_view_(NULL), dump_file_mapping_(NULL),
- dump_file_handle_(NULL) {
- EnsureDumpMapped();
- }
- ~DumpAnalysis();
-
- bool HasStream(ULONG stream_number) const;
-
- // This is template to keep type safety in the front, but we end up casting
- // to void** inside the implementation to pass the pointer to Win32. So
- // casting here is considered safe.
- template <class StreamType>
- size_t GetStream(ULONG stream_number, StreamType** stream) const {
- return GetStreamImpl(stream_number, reinterpret_cast<void**>(stream));
- }
-
- bool HasTebs() const;
- bool HasPeb() const;
- bool HasMemory(ULONG64 address) const {
- return HasMemory<BYTE>(address, NULL);
- }
-
- bool HasMemory(const void* address) const {
- return HasMemory<BYTE>(address, NULL);
- }
-
- template <class StructureType>
- bool HasMemory(ULONG64 address, StructureType** structure = NULL) const {
- // We can't cope with 64 bit addresses for now.
- if (address > 0xFFFFFFFFUL)
- return false;
-
- return HasMemory(reinterpret_cast<void*>(address), structure);
- }
-
- template <class StructureType>
- bool HasMemory(const void* addr_in, StructureType** structure = NULL) const {
- return HasMemoryImpl(addr_in, sizeof(StructureType),
- reinterpret_cast<void**>(structure));
- }
-
- protected:
- void EnsureDumpMapped();
-
- HANDLE dump_file_mapping_;
- HANDLE dump_file_handle_;
- void* dump_file_view_;
- std::wstring dump_file_;
-
- private:
- // This is the implementation of GetStream<>.
- size_t GetStreamImpl(ULONG stream_number, void** stream) const;
-
- // This is the implementation of HasMemory<>.
- bool HasMemoryImpl(const void* addr_in, size_t pointersize,
- void** structure) const;
-};
-
-#endif // CLIENT_WINDOWS_UNITTESTS_DUMP_ANALYSIS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc
deleted file mode 100644
index 079ca3d6fd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_death_test.cc
+++ /dev/null
@@ -1,582 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <windows.h>
-#include <dbghelp.h>
-#include <strsafe.h>
-#include <objbase.h>
-#include <shellapi.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/windows/crash_generation/crash_generation_server.h"
-#include "client/windows/handler/exception_handler.h"
-#include "client/windows/unittests/exception_handler_test.h"
-#include "common/windows/string_utils-inl.h"
-#include "google_breakpad/processor/minidump.h"
-
-namespace {
-
-using std::wstring;
-using namespace google_breakpad;
-
-const wchar_t kPipeName[] = L"\\\\.\\pipe\\BreakpadCrashTest\\TestCaseServer";
-const char kSuccessIndicator[] = "success";
-const char kFailureIndicator[] = "failure";
-
-// Utility function to test for a path's existence.
-BOOL DoesPathExist(const TCHAR *path_name);
-
-enum OutOfProcGuarantee {
- OUT_OF_PROC_GUARANTEED,
- OUT_OF_PROC_BEST_EFFORT,
-};
-
-class ExceptionHandlerDeathTest : public ::testing::Test {
- protected:
- // Member variable for each test that they can use
- // for temporary storage.
- TCHAR temp_path_[MAX_PATH];
- // Actually constructs a temp path name.
- virtual void SetUp();
- // A helper method that tests can use to crash.
- void DoCrashAccessViolation(const OutOfProcGuarantee out_of_proc_guarantee);
- void DoCrashPureVirtualCall();
-};
-
-void ExceptionHandlerDeathTest::SetUp() {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
- TCHAR temp_path[MAX_PATH] = { '\0' };
- TCHAR test_name_wide[MAX_PATH] = { '\0' };
- // We want the temporary directory to be what the OS returns
- // to us, + the test case name.
- GetTempPath(MAX_PATH, temp_path);
- // The test case name is exposed as a c-style string,
- // convert it to a wchar_t string.
- int dwRet = MultiByteToWideChar(CP_ACP, 0, test_info->name(),
- strlen(test_info->name()),
- test_name_wide,
- MAX_PATH);
- if (!dwRet) {
- assert(false);
- }
- StringCchPrintfW(temp_path_, MAX_PATH, L"%s%s", temp_path, test_name_wide);
- CreateDirectory(temp_path_, NULL);
-}
-
-BOOL DoesPathExist(const TCHAR *path_name) {
- DWORD flags = GetFileAttributes(path_name);
- if (flags == INVALID_FILE_ATTRIBUTES) {
- return FALSE;
- }
- return TRUE;
-}
-
-bool MinidumpWrittenCallback(const wchar_t* dump_path,
- const wchar_t* minidump_id,
- void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- bool succeeded) {
- if (succeeded && DoesPathExist(dump_path)) {
- fprintf(stderr, kSuccessIndicator);
- } else {
- fprintf(stderr, kFailureIndicator);
- }
- // If we don't flush, the output doesn't get sent before
- // this process dies.
- fflush(stderr);
- return succeeded;
-}
-
-TEST_F(ExceptionHandlerDeathTest, InProcTest) {
- // For the in-proc test, we just need to instantiate an exception
- // handler in in-proc mode, and crash. Since the entire test is
- // reexecuted in the child process, we don't have to worry about
- // the semantics of the exception handler being inherited/not
- // inherited across CreateProcess().
- ASSERT_TRUE(DoesPathExist(temp_path_));
- scoped_ptr<google_breakpad::ExceptionHandler> exc(
- new google_breakpad::ExceptionHandler(
- temp_path_,
- NULL,
- &MinidumpWrittenCallback,
- NULL,
- google_breakpad::ExceptionHandler::HANDLER_ALL));
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- int *i = NULL;
- ASSERT_DEATH((*i)++, kSuccessIndicator);
-}
-
-static bool gDumpCallbackCalled = false;
-
-void clientDumpCallback(void *dump_context,
- const google_breakpad::ClientInfo *client_info,
- const std::wstring *dump_path) {
- gDumpCallbackCalled = true;
-}
-
-void ExceptionHandlerDeathTest::DoCrashAccessViolation(
- const OutOfProcGuarantee out_of_proc_guarantee) {
- scoped_ptr<google_breakpad::ExceptionHandler> exc;
-
- if (out_of_proc_guarantee == OUT_OF_PROC_GUARANTEED) {
- google_breakpad::CrashGenerationClient *client =
- new google_breakpad::CrashGenerationClient(kPipeName,
- MiniDumpNormal,
- NULL); // custom_info
- ASSERT_TRUE(client->Register());
- exc.reset(new google_breakpad::ExceptionHandler(
- temp_path_,
- NULL, // filter
- NULL, // callback
- NULL, // callback_context
- google_breakpad::ExceptionHandler::HANDLER_ALL,
- client));
- } else {
- ASSERT_TRUE(out_of_proc_guarantee == OUT_OF_PROC_BEST_EFFORT);
- exc.reset(new google_breakpad::ExceptionHandler(
- temp_path_,
- NULL, // filter
- NULL, // callback
- NULL, // callback_context
- google_breakpad::ExceptionHandler::HANDLER_ALL,
- MiniDumpNormal,
- kPipeName,
- NULL)); // custom_info
- }
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- // Although this is executing in the child process of the death test,
- // if it's not true we'll still get an error rather than the crash
- // being expected.
- ASSERT_TRUE(exc->IsOutOfProcess());
- int *i = NULL;
- printf("%d\n", (*i)++);
-}
-
-TEST_F(ExceptionHandlerDeathTest, OutOfProcTest) {
- // We can take advantage of a detail of google test here to save some
- // complexity in testing: when you do a death test, it actually forks.
- // So we can make the main test harness the crash generation server,
- // and call ASSERT_DEATH on a NULL dereference, it to expecting test
- // the out of process scenario, since it's happening in a different
- // process! This is different from the above because, above, we pass
- // a NULL pipe name, and we also don't start a crash generation server.
-
- ASSERT_TRUE(DoesPathExist(temp_path_));
- std::wstring dump_path(temp_path_);
- google_breakpad::CrashGenerationServer server(
- kPipeName, NULL, NULL, NULL, &clientDumpCallback, NULL, NULL, NULL, NULL,
- NULL, true, &dump_path);
-
- // This HAS to be EXPECT_, because when this test case is executed in the
- // child process, the server registration will fail due to the named pipe
- // being the same.
- EXPECT_TRUE(server.Start());
- gDumpCallbackCalled = false;
- ASSERT_DEATH(this->DoCrashAccessViolation(OUT_OF_PROC_BEST_EFFORT), "");
- EXPECT_TRUE(gDumpCallbackCalled);
-}
-
-TEST_F(ExceptionHandlerDeathTest, OutOfProcGuaranteedTest) {
- // This is similar to the previous test (OutOfProcTest). The only difference
- // is that in this test, the crash generation client is created and registered
- // with the crash generation server outside of the ExceptionHandler
- // constructor which allows breakpad users to opt out of the default
- // in-process dump generation when the registration with the crash generation
- // server fails.
-
- ASSERT_TRUE(DoesPathExist(temp_path_));
- std::wstring dump_path(temp_path_);
- google_breakpad::CrashGenerationServer server(
- kPipeName, NULL, NULL, NULL, &clientDumpCallback, NULL, NULL, NULL, NULL,
- NULL, true, &dump_path);
-
- // This HAS to be EXPECT_, because when this test case is executed in the
- // child process, the server registration will fail due to the named pipe
- // being the same.
- EXPECT_TRUE(server.Start());
- gDumpCallbackCalled = false;
- ASSERT_DEATH(this->DoCrashAccessViolation(OUT_OF_PROC_GUARANTEED), "");
- EXPECT_TRUE(gDumpCallbackCalled);
-}
-
-TEST_F(ExceptionHandlerDeathTest, InvalidParameterTest) {
- using google_breakpad::ExceptionHandler;
-
- ASSERT_TRUE(DoesPathExist(temp_path_));
- ExceptionHandler handler(temp_path_, NULL, NULL, NULL,
- ExceptionHandler::HANDLER_INVALID_PARAMETER);
-
- // Disable the message box for assertions
- _CrtSetReportMode(_CRT_ASSERT, 0);
-
- // Call with a bad argument. The invalid parameter will be swallowed
- // and a dump will be generated, the process will exit(0).
- ASSERT_EXIT(printf(NULL), ::testing::ExitedWithCode(0), "");
-}
-
-
-struct PureVirtualCallBase {
- PureVirtualCallBase() {
- // We have to reinterpret so the linker doesn't get confused because the
- // method isn't defined.
- reinterpret_cast<PureVirtualCallBase*>(this)->PureFunction();
- }
- virtual ~PureVirtualCallBase() {}
- virtual void PureFunction() const = 0;
-};
-struct PureVirtualCall : public PureVirtualCallBase {
- PureVirtualCall() { PureFunction(); }
- virtual void PureFunction() const {}
-};
-
-void ExceptionHandlerDeathTest::DoCrashPureVirtualCall() {
- PureVirtualCall instance;
-}
-
-TEST_F(ExceptionHandlerDeathTest, PureVirtualCallTest) {
- using google_breakpad::ExceptionHandler;
-
- ASSERT_TRUE(DoesPathExist(temp_path_));
- ExceptionHandler handler(temp_path_, NULL, NULL, NULL,
- ExceptionHandler::HANDLER_PURECALL);
-
- // Disable the message box for assertions
- _CrtSetReportMode(_CRT_ASSERT, 0);
-
- // Calls a pure virtual function.
- EXPECT_EXIT(DoCrashPureVirtualCall(), ::testing::ExitedWithCode(0), "");
-}
-
-wstring find_minidump_in_directory(const wstring &directory) {
- wstring search_path = directory + L"\\*";
- WIN32_FIND_DATA find_data;
- HANDLE find_handle = FindFirstFileW(search_path.c_str(), &find_data);
- if (find_handle == INVALID_HANDLE_VALUE)
- return wstring();
-
- wstring filename;
- do {
- const wchar_t extension[] = L".dmp";
- const int extension_length = sizeof(extension) / sizeof(extension[0]) - 1;
- const int filename_length = wcslen(find_data.cFileName);
- if (filename_length > extension_length &&
- wcsncmp(extension,
- find_data.cFileName + filename_length - extension_length,
- extension_length) == 0) {
- filename = directory + L"\\" + find_data.cFileName;
- break;
- }
- } while (FindNextFile(find_handle, &find_data));
- FindClose(find_handle);
- return filename;
-}
-
-#ifndef ADDRESS_SANITIZER
-
-TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemory) {
- ASSERT_TRUE(DoesPathExist(temp_path_));
- scoped_ptr<google_breakpad::ExceptionHandler> exc(
- new google_breakpad::ExceptionHandler(
- temp_path_,
- NULL,
- NULL,
- NULL,
- google_breakpad::ExceptionHandler::HANDLER_ALL));
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- // Get some executable memory.
- const uint32_t kMemorySize = 256; // bytes
- const int kOffset = kMemorySize / 2;
- // This crashes with SIGILL on x86/x86-64/arm.
- const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
- char* memory = reinterpret_cast<char*>(VirtualAlloc(NULL,
- kMemorySize,
- MEM_COMMIT | MEM_RESERVE,
- PAGE_EXECUTE_READWRITE));
- ASSERT_TRUE(memory);
-
- // Write some instructions that will crash. Put them
- // in the middle of the block of memory, because the
- // minidump should contain 128 bytes on either side of the
- // instruction pointer.
- memcpy(memory + kOffset, instructions, sizeof(instructions));
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- ASSERT_DEATH(memory_function(), "");
-
- // free the memory.
- VirtualFree(memory, 0, MEM_RELEASE);
-
- // Verify that the resulting minidump contains the memory around the IP
- wstring minidump_filename_wide = find_minidump_in_directory(temp_path_);
- ASSERT_FALSE(minidump_filename_wide.empty());
- string minidump_filename;
- ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(minidump_filename_wide,
- &minidump_filename));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- {
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_LT((unsigned)0, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemorySize, region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t prefix_bytes[kOffset];
- uint8_t suffix_bytes[kMemorySize - kOffset - sizeof(instructions)];
- memset(prefix_bytes, 0, sizeof(prefix_bytes));
- memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_EQ(0, memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)));
- EXPECT_EQ(0, memcmp(bytes + kOffset, instructions, sizeof(instructions)));
- EXPECT_EQ(0, memcmp(bytes + kOffset + sizeof(instructions),
- suffix_bytes, sizeof(suffix_bytes)));
- }
-
- DeleteFileW(minidump_filename_wide.c_str());
-}
-
-TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMinBound) {
- ASSERT_TRUE(DoesPathExist(temp_path_));
- scoped_ptr<google_breakpad::ExceptionHandler> exc(
- new google_breakpad::ExceptionHandler(
- temp_path_,
- NULL,
- NULL,
- NULL,
- google_breakpad::ExceptionHandler::HANDLER_ALL));
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- SYSTEM_INFO sSysInfo; // Useful information about the system
- GetSystemInfo(&sSysInfo); // Initialize the structure.
-
- const uint32_t kMemorySize = 256; // bytes
- const DWORD kPageSize = sSysInfo.dwPageSize;
- const int kOffset = 0;
- // This crashes with SIGILL on x86/x86-64/arm.
- const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
- // Get some executable memory. Specifically, reserve two pages,
- // but only commit the second.
- char* all_memory = reinterpret_cast<char*>(VirtualAlloc(NULL,
- kPageSize * 2,
- MEM_RESERVE,
- PAGE_NOACCESS));
- ASSERT_TRUE(all_memory);
- char* memory = all_memory + kPageSize;
- ASSERT_TRUE(VirtualAlloc(memory, kPageSize,
- MEM_COMMIT, PAGE_EXECUTE_READWRITE));
-
- // Write some instructions that will crash. Put them
- // in the middle of the block of memory, because the
- // minidump should contain 128 bytes on either side of the
- // instruction pointer.
- memcpy(memory + kOffset, instructions, sizeof(instructions));
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- ASSERT_DEATH(memory_function(), "");
-
- // free the memory.
- VirtualFree(memory, 0, MEM_RELEASE);
-
- // Verify that the resulting minidump contains the memory around the IP
- wstring minidump_filename_wide = find_minidump_in_directory(temp_path_);
- ASSERT_FALSE(minidump_filename_wide.empty());
- string minidump_filename;
- ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(minidump_filename_wide,
- &minidump_filename));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- {
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_LT((unsigned)0, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemorySize / 2, region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t suffix_bytes[kMemorySize / 2 - sizeof(instructions)];
- memset(suffix_bytes, 0, sizeof(suffix_bytes));
- EXPECT_TRUE(memcmp(bytes + kOffset,
- instructions, sizeof(instructions)) == 0);
- EXPECT_TRUE(memcmp(bytes + kOffset + sizeof(instructions),
- suffix_bytes, sizeof(suffix_bytes)) == 0);
- }
-
- DeleteFileW(minidump_filename_wide.c_str());
-}
-
-TEST_F(ExceptionHandlerDeathTest, InstructionPointerMemoryMaxBound) {
- ASSERT_TRUE(DoesPathExist(temp_path_));
- scoped_ptr<google_breakpad::ExceptionHandler> exc(
- new google_breakpad::ExceptionHandler(
- temp_path_,
- NULL,
- NULL,
- NULL,
- google_breakpad::ExceptionHandler::HANDLER_ALL));
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- SYSTEM_INFO sSysInfo; // Useful information about the system
- GetSystemInfo(&sSysInfo); // Initialize the structure.
-
- const DWORD kPageSize = sSysInfo.dwPageSize;
- // This crashes with SIGILL on x86/x86-64/arm.
- const unsigned char instructions[] = { 0xff, 0xff, 0xff, 0xff };
- const int kOffset = kPageSize - sizeof(instructions);
- // Get some executable memory. Specifically, reserve two pages,
- // but only commit the first.
- char* memory = reinterpret_cast<char*>(VirtualAlloc(NULL,
- kPageSize * 2,
- MEM_RESERVE,
- PAGE_NOACCESS));
- ASSERT_TRUE(memory);
- ASSERT_TRUE(VirtualAlloc(memory, kPageSize,
- MEM_COMMIT, PAGE_EXECUTE_READWRITE));
-
- // Write some instructions that will crash.
- memcpy(memory + kOffset, instructions, sizeof(instructions));
-
- // Now execute the instructions, which should crash.
- typedef void (*void_function)(void);
- void_function memory_function =
- reinterpret_cast<void_function>(memory + kOffset);
- ASSERT_DEATH(memory_function(), "");
-
- // free the memory.
- VirtualFree(memory, 0, MEM_RELEASE);
-
- // Verify that the resulting minidump contains the memory around the IP
- wstring minidump_filename_wide = find_minidump_in_directory(temp_path_);
- ASSERT_FALSE(minidump_filename_wide.empty());
- string minidump_filename;
- ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(minidump_filename_wide,
- &minidump_filename));
-
- // Read the minidump. Locate the exception record and the
- // memory list, and then ensure that there is a memory region
- // in the memory list that covers the instruction pointer from
- // the exception record.
- {
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(exception);
- ASSERT_TRUE(memory_list);
- ASSERT_LT((unsigned)0, memory_list->region_count());
-
- MinidumpContext* context = exception->GetContext();
- ASSERT_TRUE(context);
-
- uint64_t instruction_pointer;
- ASSERT_TRUE(context->GetInstructionPointer(&instruction_pointer));
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- ASSERT_TRUE(region);
-
- const size_t kPrefixSize = 128; // bytes
- EXPECT_EQ(kPrefixSize + sizeof(instructions), region->GetSize());
- const uint8_t* bytes = region->GetMemory();
- ASSERT_TRUE(bytes);
-
- uint8_t prefix_bytes[kPrefixSize];
- memset(prefix_bytes, 0, sizeof(prefix_bytes));
- EXPECT_EQ(0, memcmp(bytes, prefix_bytes, sizeof(prefix_bytes)));
- EXPECT_EQ(0, memcmp(bytes + kPrefixSize,
- instructions, sizeof(instructions)));
- }
-
- DeleteFileW(minidump_filename_wide.c_str());
-}
-
-#endif // !ADDRESS_SANITIZER
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
deleted file mode 100644
index 3ae1d7cd05..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_nesting_test.cc
+++ /dev/null
@@ -1,327 +0,0 @@
-// Copyright 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <windows.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/windows/handler/exception_handler.h"
-#include "client/windows/unittests/exception_handler_test.h"
-
-namespace {
-
-const char kFoo[] = "foo";
-const char kBar[] = "bar";
-
-const char kStartOfLine[] = "^";
-const char kEndOfLine[] = "$";
-
-const char kFilterReturnsTrue[] = "filter_returns_true";
-const char kFilterReturnsFalse[] = "filter_returns_false";
-
-const char kCallbackReturnsTrue[] = "callback_returns_true";
-const char kCallbackReturnsFalse[] = "callback_returns_false";
-
-bool DoesPathExist(const wchar_t *path_name) {
- DWORD flags = GetFileAttributes(path_name);
- if (flags == INVALID_FILE_ATTRIBUTES) {
- return false;
- }
- return true;
-}
-
-// A callback function to run before Breakpad performs any substantial
-// processing of an exception. A FilterCallback is called before writing
-// a minidump. context is the parameter supplied by the user as
-// callback_context when the handler was created. exinfo points to the
-// exception record, if any; assertion points to assertion information,
-// if any.
-//
-// If a FilterCallback returns true, Breakpad will continue processing,
-// attempting to write a minidump. If a FilterCallback returns false,
-// Breakpad will immediately report the exception as unhandled without
-// writing a minidump, allowing another handler the opportunity to handle it.
-template <bool filter_return_value>
-bool CrashHandlerFilter(void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion) {
- if (filter_return_value) {
- fprintf(stderr, kFilterReturnsTrue);
- } else {
- fprintf(stderr, kFilterReturnsFalse);
- }
- fflush(stderr);
-
- return filter_return_value;
-}
-
-// A callback function to run after the minidump has been written.
-// minidump_id is a unique id for the dump, so the minidump
-// file is <dump_path>\<minidump_id>.dmp. context is the parameter supplied
-// by the user as callback_context when the handler was created. exinfo
-// points to the exception record, or NULL if no exception occurred.
-// succeeded indicates whether a minidump file was successfully written.
-// assertion points to information about an assertion if the handler was
-// invoked by an assertion.
-//
-// If an exception occurred and the callback returns true, Breakpad will treat
-// the exception as fully-handled, suppressing any other handlers from being
-// notified of the exception. If the callback returns false, Breakpad will
-// treat the exception as unhandled, and allow another handler to handle it.
-// If there are no other handlers, Breakpad will report the exception to the
-// system as unhandled, allowing a debugger or native crash dialog the
-// opportunity to handle the exception. Most callback implementations
-// should normally return the value of |succeeded|, or when they wish to
-// not report an exception of handled, false. Callbacks will rarely want to
-// return true directly (unless |succeeded| is true).
-//
-// For out-of-process dump generation, dump path and minidump ID will always
-// be NULL. In case of out-of-process dump generation, the dump path and
-// minidump id are controlled by the server process and are not communicated
-// back to the crashing process.
-template <bool callback_return_value>
-bool MinidumpWrittenCallback(const wchar_t* dump_path,
- const wchar_t* minidump_id,
- void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- bool succeeded) {
- bool rv = false;
- if (callback_return_value &&
- succeeded &&
- DoesPathExist(dump_path)) {
- rv = true;
- fprintf(stderr, kCallbackReturnsTrue);
- } else {
- fprintf(stderr, kCallbackReturnsFalse);
- }
- fflush(stderr);
-
- return rv;
-}
-
-
-void DoCrash(const char *message) {
- if (message) {
- fprintf(stderr, "%s", message);
- fflush(stderr);
- }
- int *i = NULL;
- (*i)++;
-
- ASSERT_TRUE(false);
-}
-
-void InstallExceptionHandlerAndCrash(bool install_filter,
- bool filter_return_value,
- bool install_callback,
- bool callback_return_value) {
- wchar_t temp_path[MAX_PATH] = { '\0' };
- GetTempPath(MAX_PATH, temp_path);
-
- ASSERT_TRUE(DoesPathExist(temp_path));
- google_breakpad::ExceptionHandler exc(
- temp_path,
- install_filter ?
- (filter_return_value ?
- &CrashHandlerFilter<true> :
- &CrashHandlerFilter<false>) :
- NULL,
- install_callback ?
- (callback_return_value ?
- &MinidumpWrittenCallback<true> :
- &MinidumpWrittenCallback<false>) :
- NULL,
- NULL, // callback_context
- google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- DoCrash(NULL);
-}
-
-TEST(AssertDeathSanity, Simple) {
- ASSERT_DEATH(DoCrash(NULL), "");
-}
-
-TEST(AssertDeathSanity, Regex) {
- ASSERT_DEATH(DoCrash(kFoo),
- std::string(kStartOfLine) +
- std::string(kFoo) +
- std::string(kEndOfLine));
-
- ASSERT_DEATH(DoCrash(kBar),
- std::string(kStartOfLine) +
- std::string(kBar) +
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerCallbacks, FilterTrue_No_Callback) {
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- true, // filter_return_value
- false, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsTrue) +
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerCallbacks, FilterTrue_Callback) {
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- true, // filter_return_value
- true, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsTrue) +
- std::string(kCallbackReturnsFalse) +
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerCallbacks, FilterFalse_No_Callback) {
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- false, // filter_return_value
- false, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsFalse) +
- std::string(kEndOfLine));
-}
-
-// Callback shouldn't be executed when filter returns false
-TEST(ExceptionHandlerCallbacks, FilterFalse_Callback) {
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- false, // filter_return_value
- true, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsFalse) +
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerCallbacks, No_Filter_No_Callback) {
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(false, // install_filter
- true, // filter_return_value
- false, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerCallbacks, No_Filter_Callback) {
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(false, // install_filter
- true, // filter_return_value
- true, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kCallbackReturnsFalse) +
- std::string(kEndOfLine));
-}
-
-
-TEST(ExceptionHandlerNesting, Skip_From_Inner_Filter) {
- wchar_t temp_path[MAX_PATH] = { '\0' };
- GetTempPath(MAX_PATH, temp_path);
-
- ASSERT_TRUE(DoesPathExist(temp_path));
- google_breakpad::ExceptionHandler exc(
- temp_path,
- &CrashHandlerFilter<true>,
- &MinidumpWrittenCallback<false>,
- NULL, // callback_context
- google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
-
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- false, // filter_return_value
- true, // install_callback
- true), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsFalse) + // inner filter
- std::string(kFilterReturnsTrue) + // outer filter
- std::string(kCallbackReturnsFalse) + // outer callback
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerNesting, Skip_From_Inner_Callback) {
- wchar_t temp_path[MAX_PATH] = { '\0' };
- GetTempPath(MAX_PATH, temp_path);
-
- ASSERT_TRUE(DoesPathExist(temp_path));
- google_breakpad::ExceptionHandler exc(
- temp_path,
- &CrashHandlerFilter<true>,
- &MinidumpWrittenCallback<false>,
- NULL, // callback_context
- google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
-
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- true, // filter_return_value
- true, // install_callback
- false), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsTrue) + // inner filter
- std::string(kCallbackReturnsFalse) + // inner callback
- std::string(kFilterReturnsTrue) + // outer filter
- std::string(kCallbackReturnsFalse) + // outer callback
- std::string(kEndOfLine));
-}
-
-TEST(ExceptionHandlerNesting, Handled_By_Inner_Handler) {
- wchar_t temp_path[MAX_PATH] = { '\0' };
- GetTempPath(MAX_PATH, temp_path);
-
- ASSERT_TRUE(DoesPathExist(temp_path));
- google_breakpad::ExceptionHandler exc(
- temp_path,
- &CrashHandlerFilter<true>,
- &MinidumpWrittenCallback<true>,
- NULL, // callback_context
- google_breakpad::ExceptionHandler::HANDLER_EXCEPTION);
-
- ASSERT_DEATH(
- InstallExceptionHandlerAndCrash(true, // install_filter
- true, // filter_return_value
- true, // install_callback
- true), // callback_return_value
- std::string(kStartOfLine) +
- std::string(kFilterReturnsTrue) + // inner filter
- std::string(kCallbackReturnsTrue) + // inner callback
- std::string(kEndOfLine));
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc
deleted file mode 100644
index 55275323ee..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.cc
+++ /dev/null
@@ -1,501 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "client/windows/unittests/exception_handler_test.h"
-
-#include <windows.h>
-#include <dbghelp.h>
-#include <strsafe.h>
-#include <objbase.h>
-#include <shellapi.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "client/windows/crash_generation/crash_generation_server.h"
-#include "client/windows/handler/exception_handler.h"
-#include "client/windows/unittests/dump_analysis.h" // NOLINT
-#include "common/windows/string_utils-inl.h"
-#include "google_breakpad/processor/minidump.h"
-
-namespace testing {
-
-DisableExceptionHandlerInScope::DisableExceptionHandlerInScope() {
- catch_exceptions_ = GTEST_FLAG(catch_exceptions);
- GTEST_FLAG(catch_exceptions) = false;
-}
-
-DisableExceptionHandlerInScope::~DisableExceptionHandlerInScope() {
- GTEST_FLAG(catch_exceptions) = catch_exceptions_;
-}
-
-} // namespace testing
-
-namespace {
-
-using std::wstring;
-using namespace google_breakpad;
-
-const wchar_t kPipeName[] = L"\\\\.\\pipe\\BreakpadCrashTest\\TestCaseServer";
-const char kSuccessIndicator[] = "success";
-const char kFailureIndicator[] = "failure";
-
-const MINIDUMP_TYPE kFullDumpType = static_cast<MINIDUMP_TYPE>(
- MiniDumpWithFullMemory | // Full memory from process.
- MiniDumpWithProcessThreadData | // Get PEB and TEB.
- MiniDumpWithHandleData); // Get all handle information.
-
-class ExceptionHandlerTest : public ::testing::Test {
- protected:
- // Member variable for each test that they can use
- // for temporary storage.
- TCHAR temp_path_[MAX_PATH];
-
- // Actually constructs a temp path name.
- virtual void SetUp();
-
- // Deletes temporary files.
- virtual void TearDown();
-
- void DoCrashInvalidParameter();
- void DoCrashPureVirtualCall();
-
- // Utility function to test for a path's existence.
- static BOOL DoesPathExist(const TCHAR *path_name);
-
- // Client callback.
- static void ClientDumpCallback(
- void *dump_context,
- const google_breakpad::ClientInfo *client_info,
- const std::wstring *dump_path);
-
- static bool DumpCallback(const wchar_t* dump_path,
- const wchar_t* minidump_id,
- void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- bool succeeded);
-
- static std::wstring dump_file;
- static std::wstring full_dump_file;
-};
-
-std::wstring ExceptionHandlerTest::dump_file;
-std::wstring ExceptionHandlerTest::full_dump_file;
-
-void ExceptionHandlerTest::SetUp() {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
- TCHAR temp_path[MAX_PATH] = { '\0' };
- TCHAR test_name_wide[MAX_PATH] = { '\0' };
- // We want the temporary directory to be what the OS returns
- // to us, + the test case name.
- GetTempPath(MAX_PATH, temp_path);
- // THe test case name is exposed to use as a c-style string,
- // But we might be working in UNICODE here on Windows.
- int dwRet = MultiByteToWideChar(CP_ACP, 0, test_info->name(),
- strlen(test_info->name()),
- test_name_wide,
- MAX_PATH);
- if (!dwRet) {
- assert(false);
- }
- StringCchPrintfW(temp_path_, MAX_PATH, L"%s%s", temp_path, test_name_wide);
- CreateDirectory(temp_path_, NULL);
-}
-
-void ExceptionHandlerTest::TearDown() {
- if (!dump_file.empty()) {
- ::DeleteFile(dump_file.c_str());
- dump_file = L"";
- }
- if (!full_dump_file.empty()) {
- ::DeleteFile(full_dump_file.c_str());
- full_dump_file = L"";
- }
-}
-
-BOOL ExceptionHandlerTest::DoesPathExist(const TCHAR *path_name) {
- DWORD flags = GetFileAttributes(path_name);
- if (flags == INVALID_FILE_ATTRIBUTES) {
- return FALSE;
- }
- return TRUE;
-}
-
-// static
-void ExceptionHandlerTest::ClientDumpCallback(
- void *dump_context,
- const google_breakpad::ClientInfo *client_info,
- const wstring *dump_path) {
- dump_file = *dump_path;
- // Create the full dump file name from the dump path.
- full_dump_file = dump_file.substr(0, dump_file.length() - 4) + L"-full.dmp";
-}
-
-// static
-bool ExceptionHandlerTest::DumpCallback(const wchar_t* dump_path,
- const wchar_t* minidump_id,
- void* context,
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
- bool succeeded) {
- dump_file = dump_path;
- dump_file += L"\\";
- dump_file += minidump_id;
- dump_file += L".dmp";
- return succeeded;
-}
-
-void ExceptionHandlerTest::DoCrashInvalidParameter() {
- google_breakpad::ExceptionHandler *exc =
- new google_breakpad::ExceptionHandler(
- temp_path_, NULL, NULL, NULL,
- google_breakpad::ExceptionHandler::HANDLER_INVALID_PARAMETER,
- kFullDumpType, kPipeName, NULL);
-
- // Disable the message box for assertions
- _CrtSetReportMode(_CRT_ASSERT, 0);
-
- // Although this is executing in the child process of the death test,
- // if it's not true we'll still get an error rather than the crash
- // being expected.
- ASSERT_TRUE(exc->IsOutOfProcess());
- printf(NULL);
-}
-
-
-struct PureVirtualCallBase {
- PureVirtualCallBase() {
- // We have to reinterpret so the linker doesn't get confused because the
- // method isn't defined.
- reinterpret_cast<PureVirtualCallBase*>(this)->PureFunction();
- }
- virtual ~PureVirtualCallBase() {}
- virtual void PureFunction() const = 0;
-};
-struct PureVirtualCall : public PureVirtualCallBase {
- PureVirtualCall() { PureFunction(); }
- virtual void PureFunction() const {}
-};
-
-void ExceptionHandlerTest::DoCrashPureVirtualCall() {
- google_breakpad::ExceptionHandler *exc =
- new google_breakpad::ExceptionHandler(
- temp_path_, NULL, NULL, NULL,
- google_breakpad::ExceptionHandler::HANDLER_PURECALL,
- kFullDumpType, kPipeName, NULL);
-
- // Disable the message box for assertions
- _CrtSetReportMode(_CRT_ASSERT, 0);
-
- // Although this is executing in the child process of the death test,
- // if it's not true we'll still get an error rather than the crash
- // being expected.
- ASSERT_TRUE(exc->IsOutOfProcess());
-
- // Create a new frame to ensure PureVirtualCall is not optimized to some
- // other line in this function.
- {
- PureVirtualCall instance;
- }
-}
-
-// This test validates that the minidump is written correctly.
-TEST_F(ExceptionHandlerTest, InvalidParameterMiniDumpTest) {
- ASSERT_TRUE(DoesPathExist(temp_path_));
-
- // Call with a bad argument
- ASSERT_TRUE(DoesPathExist(temp_path_));
- wstring dump_path(temp_path_);
- google_breakpad::CrashGenerationServer server(
- kPipeName, NULL, NULL, NULL, ClientDumpCallback, NULL, NULL, NULL, NULL,
- NULL, true, &dump_path);
-
- ASSERT_TRUE(dump_file.empty() && full_dump_file.empty());
-
- // This HAS to be EXPECT_, because when this test case is executed in the
- // child process, the server registration will fail due to the named pipe
- // being the same.
- EXPECT_TRUE(server.Start());
- EXPECT_EXIT(DoCrashInvalidParameter(), ::testing::ExitedWithCode(0), "");
- ASSERT_TRUE(!dump_file.empty() && !full_dump_file.empty());
- ASSERT_TRUE(DoesPathExist(dump_file.c_str()));
-
- // Verify the dump for infos.
- DumpAnalysis mini(dump_file);
- DumpAnalysis full(full_dump_file);
-
- // The dump should have all of these streams.
- EXPECT_TRUE(mini.HasStream(ThreadListStream));
- EXPECT_TRUE(full.HasStream(ThreadListStream));
- EXPECT_TRUE(mini.HasStream(ModuleListStream));
- EXPECT_TRUE(full.HasStream(ModuleListStream));
- EXPECT_TRUE(mini.HasStream(ExceptionStream));
- EXPECT_TRUE(full.HasStream(ExceptionStream));
- EXPECT_TRUE(mini.HasStream(SystemInfoStream));
- EXPECT_TRUE(full.HasStream(SystemInfoStream));
- EXPECT_TRUE(mini.HasStream(MiscInfoStream));
- EXPECT_TRUE(full.HasStream(MiscInfoStream));
- EXPECT_TRUE(mini.HasStream(HandleDataStream));
- EXPECT_TRUE(full.HasStream(HandleDataStream));
-
- // We expect PEB and TEBs in this dump.
- EXPECT_TRUE(mini.HasTebs() || full.HasTebs());
- EXPECT_TRUE(mini.HasPeb() || full.HasPeb());
-
- // Minidump should have a memory listing, but no 64-bit memory.
- EXPECT_TRUE(mini.HasStream(MemoryListStream));
- EXPECT_FALSE(mini.HasStream(Memory64ListStream));
-
- EXPECT_FALSE(full.HasStream(MemoryListStream));
- EXPECT_TRUE(full.HasStream(Memory64ListStream));
-
- // This is the only place we don't use OR because we want both not
- // to have the streams.
- EXPECT_FALSE(mini.HasStream(ThreadExListStream));
- EXPECT_FALSE(full.HasStream(ThreadExListStream));
- EXPECT_FALSE(mini.HasStream(CommentStreamA));
- EXPECT_FALSE(full.HasStream(CommentStreamA));
- EXPECT_FALSE(mini.HasStream(CommentStreamW));
- EXPECT_FALSE(full.HasStream(CommentStreamW));
- EXPECT_FALSE(mini.HasStream(FunctionTableStream));
- EXPECT_FALSE(full.HasStream(FunctionTableStream));
- EXPECT_FALSE(mini.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(full.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(mini.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(full.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(mini.HasStream(HandleOperationListStream));
- EXPECT_FALSE(full.HasStream(HandleOperationListStream));
- EXPECT_FALSE(mini.HasStream(TokenStream));
- EXPECT_FALSE(full.HasStream(TokenStream));
-}
-
-
-// This test validates that the minidump is written correctly.
-TEST_F(ExceptionHandlerTest, PureVirtualCallMiniDumpTest) {
- ASSERT_TRUE(DoesPathExist(temp_path_));
-
- // Call with a bad argument
- ASSERT_TRUE(DoesPathExist(temp_path_));
- wstring dump_path(temp_path_);
- google_breakpad::CrashGenerationServer server(
- kPipeName, NULL, NULL, NULL, ClientDumpCallback, NULL, NULL, NULL, NULL,
- NULL, true, &dump_path);
-
- ASSERT_TRUE(dump_file.empty() && full_dump_file.empty());
-
- // This HAS to be EXPECT_, because when this test case is executed in the
- // child process, the server registration will fail due to the named pipe
- // being the same.
- EXPECT_TRUE(server.Start());
- EXPECT_EXIT(DoCrashPureVirtualCall(), ::testing::ExitedWithCode(0), "");
- ASSERT_TRUE(!dump_file.empty() && !full_dump_file.empty());
- ASSERT_TRUE(DoesPathExist(dump_file.c_str()));
-
- // Verify the dump for infos.
- DumpAnalysis mini(dump_file);
- DumpAnalysis full(full_dump_file);
-
- // The dump should have all of these streams.
- EXPECT_TRUE(mini.HasStream(ThreadListStream));
- EXPECT_TRUE(full.HasStream(ThreadListStream));
- EXPECT_TRUE(mini.HasStream(ModuleListStream));
- EXPECT_TRUE(full.HasStream(ModuleListStream));
- EXPECT_TRUE(mini.HasStream(ExceptionStream));
- EXPECT_TRUE(full.HasStream(ExceptionStream));
- EXPECT_TRUE(mini.HasStream(SystemInfoStream));
- EXPECT_TRUE(full.HasStream(SystemInfoStream));
- EXPECT_TRUE(mini.HasStream(MiscInfoStream));
- EXPECT_TRUE(full.HasStream(MiscInfoStream));
- EXPECT_TRUE(mini.HasStream(HandleDataStream));
- EXPECT_TRUE(full.HasStream(HandleDataStream));
-
- // We expect PEB and TEBs in this dump.
- EXPECT_TRUE(mini.HasTebs() || full.HasTebs());
- EXPECT_TRUE(mini.HasPeb() || full.HasPeb());
-
- // Minidump should have a memory listing, but no 64-bit memory.
- EXPECT_TRUE(mini.HasStream(MemoryListStream));
- EXPECT_FALSE(mini.HasStream(Memory64ListStream));
-
- EXPECT_FALSE(full.HasStream(MemoryListStream));
- EXPECT_TRUE(full.HasStream(Memory64ListStream));
-
- // This is the only place we don't use OR because we want both not
- // to have the streams.
- EXPECT_FALSE(mini.HasStream(ThreadExListStream));
- EXPECT_FALSE(full.HasStream(ThreadExListStream));
- EXPECT_FALSE(mini.HasStream(CommentStreamA));
- EXPECT_FALSE(full.HasStream(CommentStreamA));
- EXPECT_FALSE(mini.HasStream(CommentStreamW));
- EXPECT_FALSE(full.HasStream(CommentStreamW));
- EXPECT_FALSE(mini.HasStream(FunctionTableStream));
- EXPECT_FALSE(full.HasStream(FunctionTableStream));
- EXPECT_FALSE(mini.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(full.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(mini.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(full.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(mini.HasStream(HandleOperationListStream));
- EXPECT_FALSE(full.HasStream(HandleOperationListStream));
- EXPECT_FALSE(mini.HasStream(TokenStream));
- EXPECT_FALSE(full.HasStream(TokenStream));
-}
-
-// Test that writing a minidump produces a valid minidump containing
-// some expected structures.
-TEST_F(ExceptionHandlerTest, WriteMinidumpTest) {
- ExceptionHandler handler(temp_path_,
- NULL,
- DumpCallback,
- NULL,
- ExceptionHandler::HANDLER_ALL);
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- ASSERT_TRUE(handler.WriteMinidump());
- ASSERT_FALSE(dump_file.empty());
-
- string minidump_filename;
- ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(dump_file,
- &minidump_filename));
-
- // Read the minidump and verify some info.
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
- // TODO(ted): more comprehensive tests...
-}
-
-// Test that an additional memory region can be included in the minidump.
-TEST_F(ExceptionHandlerTest, AdditionalMemory) {
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- const uint32_t kMemorySize = si.dwPageSize;
-
- // Get some heap memory.
- uint8_t* memory = new uint8_t[kMemorySize];
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- // Stick some data into the memory so the contents can be verified.
- for (uint32_t i = 0; i < kMemorySize; ++i) {
- memory[i] = i % 255;
- }
-
- ExceptionHandler handler(temp_path_,
- NULL,
- DumpCallback,
- NULL,
- ExceptionHandler::HANDLER_ALL);
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- // Add the memory region to the list of memory to be included.
- handler.RegisterAppMemory(memory, kMemorySize);
- ASSERT_TRUE(handler.WriteMinidump());
- ASSERT_FALSE(dump_file.empty());
-
- string minidump_filename;
- ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(dump_file,
- &minidump_filename));
-
- // Read the minidump. Ensure that the memory region is present
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpMemoryList* dump_memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(dump_memory_list);
- const MinidumpMemoryRegion* region =
- dump_memory_list->GetMemoryRegionForAddress(kMemoryAddress);
- ASSERT_TRUE(region);
-
- EXPECT_EQ(kMemoryAddress, region->GetBase());
- EXPECT_EQ(kMemorySize, region->GetSize());
-
- // Verify memory contents.
- EXPECT_EQ(0, memcmp(region->GetMemory(), memory, kMemorySize));
-
- delete[] memory;
-}
-
-// Test that a memory region that was previously registered
-// can be unregistered.
-TEST_F(ExceptionHandlerTest, AdditionalMemoryRemove) {
- SYSTEM_INFO si;
- GetSystemInfo(&si);
- const uint32_t kMemorySize = si.dwPageSize;
-
- // Get some heap memory.
- uint8_t* memory = new uint8_t[kMemorySize];
- const uintptr_t kMemoryAddress = reinterpret_cast<uintptr_t>(memory);
- ASSERT_TRUE(memory);
-
- // Stick some data into the memory so the contents can be verified.
- for (uint32_t i = 0; i < kMemorySize; ++i) {
- memory[i] = i % 255;
- }
-
- ExceptionHandler handler(temp_path_,
- NULL,
- DumpCallback,
- NULL,
- ExceptionHandler::HANDLER_ALL);
-
- // Disable GTest SEH handler
- testing::DisableExceptionHandlerInScope disable_exception_handler;
-
- // Add the memory region to the list of memory to be included.
- handler.RegisterAppMemory(memory, kMemorySize);
-
- // ...and then remove it
- handler.UnregisterAppMemory(memory);
-
- ASSERT_TRUE(handler.WriteMinidump());
- ASSERT_FALSE(dump_file.empty());
-
- string minidump_filename;
- ASSERT_TRUE(WindowsStringUtils::safe_wcstombs(dump_file,
- &minidump_filename));
-
- // Read the minidump. Ensure that the memory region is not present.
- Minidump minidump(minidump_filename);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpMemoryList* dump_memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(dump_memory_list);
- const MinidumpMemoryRegion* region =
- dump_memory_list->GetMemoryRegionForAddress(kMemoryAddress);
- EXPECT_FALSE(region);
-
- delete[] memory;
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h
deleted file mode 100644
index ef973e5392..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/exception_handler_test.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef CLIENT_WINDOWS_UNITTESTS_EXCEPTION_HANDLER_TEST_H_
-#define CLIENT_WINDOWS_UNITTESTS_EXCEPTION_HANDLER_TEST_H_
-
-namespace testing {
-
-// By default, GTest (on Windows) installs a SEH filter (and a handler) before
-// starting to run all the tests in order to avoid test interruptions is some
-// of the tests are crashing. Unfortunately, this functionality prevents the
-// execution to reach the UnhandledExceptionFilter installed by Google-Breakpad
-// ExceptionHandler so in order to test the Google-Breakpad exception handling
-// code the exception handling done by GTest must be disabled.
-// Usage:
-//
-// google_breakpad::ExceptionHandler exc(...);
-//
-// // Disable GTest SEH handler
-// testing::DisableExceptionHandlerInScope disable_exception_handler;
-// ...
-// ASSERT_DEATH( ... some crash ...);
-//
-class DisableExceptionHandlerInScope {
- public:
- DisableExceptionHandlerInScope();
- ~DisableExceptionHandlerInScope();
-
- private:
- bool catch_exceptions_;
-};
-
-} // namespace testing
-
-#endif // CLIENT_WINDOWS_UNITTESTS_EXCEPTION_HANDLER_TEST_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc
deleted file mode 100644
index 8d2d726c49..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/minidump_test.cc
+++ /dev/null
@@ -1,333 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <windows.h>
-#include <objbase.h>
-#include <dbghelp.h>
-
-#include "client/windows/crash_generation/minidump_generator.h"
-#include "client/windows/unittests/dump_analysis.h" // NOLINT
-
-#include "gtest/gtest.h"
-
-namespace {
-
-// Minidump with stacks, PEB, TEB, and unloaded module list.
-const MINIDUMP_TYPE kSmallDumpType = static_cast<MINIDUMP_TYPE>(
- MiniDumpWithProcessThreadData | // Get PEB and TEB.
- MiniDumpWithUnloadedModules); // Get unloaded modules when available.
-
-// Minidump with all of the above, plus memory referenced from stack.
-const MINIDUMP_TYPE kLargerDumpType = static_cast<MINIDUMP_TYPE>(
- MiniDumpWithProcessThreadData | // Get PEB and TEB.
- MiniDumpWithUnloadedModules | // Get unloaded modules when available.
- MiniDumpWithIndirectlyReferencedMemory); // Get memory referenced by stack.
-
-// Large dump with all process memory.
-const MINIDUMP_TYPE kFullDumpType = static_cast<MINIDUMP_TYPE>(
- MiniDumpWithFullMemory | // Full memory from process.
- MiniDumpWithProcessThreadData | // Get PEB and TEB.
- MiniDumpWithHandleData | // Get all handle information.
- MiniDumpWithUnloadedModules); // Get unloaded modules when available.
-
-class MinidumpTest: public testing::Test {
- public:
- MinidumpTest() {
- wchar_t temp_dir_path[ MAX_PATH ] = {0};
- ::GetTempPath(MAX_PATH, temp_dir_path);
- dump_path_ = temp_dir_path;
- }
-
- virtual void SetUp() {
- // Make sure URLMon isn't loaded into our process.
- ASSERT_EQ(NULL, ::GetModuleHandle(L"urlmon.dll"));
-
- // Then load and unload it to ensure we have something to
- // stock the unloaded module list with.
- HMODULE urlmon = ::LoadLibrary(L"urlmon.dll");
- ASSERT_TRUE(urlmon != NULL);
- ASSERT_TRUE(::FreeLibrary(urlmon));
- }
-
- virtual void TearDown() {
- if (!dump_file_.empty()) {
- ::DeleteFile(dump_file_.c_str());
- dump_file_ = L"";
- }
- if (!full_dump_file_.empty()) {
- ::DeleteFile(full_dump_file_.c_str());
- full_dump_file_ = L"";
- }
- }
-
- bool WriteDump(ULONG flags) {
- using google_breakpad::MinidumpGenerator;
-
- // Fake exception is access violation on write to this.
- EXCEPTION_RECORD ex_record = {
- STATUS_ACCESS_VIOLATION, // ExceptionCode
- 0, // ExceptionFlags
- NULL, // ExceptionRecord;
- reinterpret_cast<void*>(0xCAFEBABE), // ExceptionAddress;
- 2, // NumberParameters;
- { EXCEPTION_WRITE_FAULT, reinterpret_cast<ULONG_PTR>(this) }
- };
- CONTEXT ctx_record = {};
- EXCEPTION_POINTERS ex_ptrs = {
- &ex_record,
- &ctx_record,
- };
-
- MinidumpGenerator generator(dump_path_,
- ::GetCurrentProcess(),
- ::GetCurrentProcessId(),
- ::GetCurrentThreadId(),
- ::GetCurrentThreadId(),
- &ex_ptrs,
- NULL,
- static_cast<MINIDUMP_TYPE>(flags),
- TRUE);
- generator.GenerateDumpFile(&dump_file_);
- generator.GenerateFullDumpFile(&full_dump_file_);
- // And write a dump
- bool result = generator.WriteMinidump();
- return result == TRUE;
- }
-
- protected:
- std::wstring dump_file_;
- std::wstring full_dump_file_;
-
- std::wstring dump_path_;
-};
-
-// We need to be able to get file information from Windows
-bool HasFileInfo(const std::wstring& file_path) {
- DWORD dummy;
- const wchar_t* path = file_path.c_str();
- DWORD length = ::GetFileVersionInfoSize(path, &dummy);
- if (length == 0)
- return NULL;
-
- void* data = calloc(length, 1);
- if (!data)
- return false;
-
- if (!::GetFileVersionInfo(path, dummy, length, data)) {
- free(data);
- return false;
- }
-
- void* translate = NULL;
- UINT page_count;
- BOOL query_result = VerQueryValue(
- data,
- L"\\VarFileInfo\\Translation",
- static_cast<void**>(&translate),
- &page_count);
-
- free(data);
- if (query_result && translate) {
- return true;
- } else {
- return false;
- }
-}
-
-TEST_F(MinidumpTest, Version) {
- // Loads DbgHelp.dll in process
- ImagehlpApiVersion();
-
- HMODULE dbg_help = ::GetModuleHandle(L"dbghelp.dll");
- ASSERT_TRUE(dbg_help != NULL);
-
- wchar_t dbg_help_file[1024] = {};
- ASSERT_TRUE(::GetModuleFileName(dbg_help,
- dbg_help_file,
- sizeof(dbg_help_file) /
- sizeof(*dbg_help_file)));
- ASSERT_TRUE(HasFileInfo(std::wstring(dbg_help_file)) != NULL);
-
-// LOG(INFO) << "DbgHelp.dll version: " << file_info->file_version();
-}
-
-TEST_F(MinidumpTest, Normal) {
- EXPECT_TRUE(WriteDump(MiniDumpNormal));
- DumpAnalysis mini(dump_file_);
-
- // We expect threads, modules and some memory.
- EXPECT_TRUE(mini.HasStream(ThreadListStream));
- EXPECT_TRUE(mini.HasStream(ModuleListStream));
- EXPECT_TRUE(mini.HasStream(MemoryListStream));
- EXPECT_TRUE(mini.HasStream(ExceptionStream));
- EXPECT_TRUE(mini.HasStream(SystemInfoStream));
- EXPECT_TRUE(mini.HasStream(MiscInfoStream));
-
- EXPECT_FALSE(mini.HasStream(ThreadExListStream));
- EXPECT_FALSE(mini.HasStream(Memory64ListStream));
- EXPECT_FALSE(mini.HasStream(CommentStreamA));
- EXPECT_FALSE(mini.HasStream(CommentStreamW));
- EXPECT_FALSE(mini.HasStream(HandleDataStream));
- EXPECT_FALSE(mini.HasStream(FunctionTableStream));
- EXPECT_FALSE(mini.HasStream(UnloadedModuleListStream));
- EXPECT_FALSE(mini.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(mini.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(mini.HasStream(HandleOperationListStream));
- EXPECT_FALSE(mini.HasStream(TokenStream));
-
- // We expect no PEB nor TEBs in this dump.
- EXPECT_FALSE(mini.HasTebs());
- EXPECT_FALSE(mini.HasPeb());
-
- // We expect no off-stack memory in this dump.
- EXPECT_FALSE(mini.HasMemory(this));
-}
-
-TEST_F(MinidumpTest, SmallDump) {
- ASSERT_TRUE(WriteDump(kSmallDumpType));
- DumpAnalysis mini(dump_file_);
-
- EXPECT_TRUE(mini.HasStream(ThreadListStream));
- EXPECT_TRUE(mini.HasStream(ModuleListStream));
- EXPECT_TRUE(mini.HasStream(MemoryListStream));
- EXPECT_TRUE(mini.HasStream(ExceptionStream));
- EXPECT_TRUE(mini.HasStream(SystemInfoStream));
- EXPECT_TRUE(mini.HasStream(UnloadedModuleListStream));
- EXPECT_TRUE(mini.HasStream(MiscInfoStream));
-
- // We expect PEB and TEBs in this dump.
- EXPECT_TRUE(mini.HasTebs());
- EXPECT_TRUE(mini.HasPeb());
-
- EXPECT_FALSE(mini.HasStream(ThreadExListStream));
- EXPECT_FALSE(mini.HasStream(Memory64ListStream));
- EXPECT_FALSE(mini.HasStream(CommentStreamA));
- EXPECT_FALSE(mini.HasStream(CommentStreamW));
- EXPECT_FALSE(mini.HasStream(HandleDataStream));
- EXPECT_FALSE(mini.HasStream(FunctionTableStream));
- EXPECT_FALSE(mini.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(mini.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(mini.HasStream(HandleOperationListStream));
- EXPECT_FALSE(mini.HasStream(TokenStream));
-
- // We expect no off-stack memory in this dump.
- EXPECT_FALSE(mini.HasMemory(this));
-}
-
-TEST_F(MinidumpTest, LargerDump) {
- ASSERT_TRUE(WriteDump(kLargerDumpType));
- DumpAnalysis mini(dump_file_);
-
- // The dump should have all of these streams.
- EXPECT_TRUE(mini.HasStream(ThreadListStream));
- EXPECT_TRUE(mini.HasStream(ModuleListStream));
- EXPECT_TRUE(mini.HasStream(MemoryListStream));
- EXPECT_TRUE(mini.HasStream(ExceptionStream));
- EXPECT_TRUE(mini.HasStream(SystemInfoStream));
- EXPECT_TRUE(mini.HasStream(UnloadedModuleListStream));
- EXPECT_TRUE(mini.HasStream(MiscInfoStream));
-
- // We expect memory referenced by stack in this dump.
- EXPECT_TRUE(mini.HasMemory(this));
-
- // We expect PEB and TEBs in this dump.
- EXPECT_TRUE(mini.HasTebs());
- EXPECT_TRUE(mini.HasPeb());
-
- EXPECT_FALSE(mini.HasStream(ThreadExListStream));
- EXPECT_FALSE(mini.HasStream(Memory64ListStream));
- EXPECT_FALSE(mini.HasStream(CommentStreamA));
- EXPECT_FALSE(mini.HasStream(CommentStreamW));
- EXPECT_FALSE(mini.HasStream(HandleDataStream));
- EXPECT_FALSE(mini.HasStream(FunctionTableStream));
- EXPECT_FALSE(mini.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(mini.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(mini.HasStream(HandleOperationListStream));
- EXPECT_FALSE(mini.HasStream(TokenStream));
-}
-
-TEST_F(MinidumpTest, FullDump) {
- ASSERT_TRUE(WriteDump(kFullDumpType));
- ASSERT_TRUE(dump_file_ != L"");
- ASSERT_TRUE(full_dump_file_ != L"");
- DumpAnalysis mini(dump_file_);
- DumpAnalysis full(full_dump_file_);
-
- // Either dumps can contain part of the information.
-
- // The dump should have all of these streams.
- EXPECT_TRUE(mini.HasStream(ThreadListStream));
- EXPECT_TRUE(full.HasStream(ThreadListStream));
- EXPECT_TRUE(mini.HasStream(ModuleListStream));
- EXPECT_TRUE(full.HasStream(ModuleListStream));
- EXPECT_TRUE(mini.HasStream(ExceptionStream));
- EXPECT_TRUE(full.HasStream(ExceptionStream));
- EXPECT_TRUE(mini.HasStream(SystemInfoStream));
- EXPECT_TRUE(full.HasStream(SystemInfoStream));
- EXPECT_TRUE(mini.HasStream(UnloadedModuleListStream));
- EXPECT_TRUE(full.HasStream(UnloadedModuleListStream));
- EXPECT_TRUE(mini.HasStream(MiscInfoStream));
- EXPECT_TRUE(full.HasStream(MiscInfoStream));
- EXPECT_TRUE(mini.HasStream(HandleDataStream));
- EXPECT_TRUE(full.HasStream(HandleDataStream));
-
- // We expect memory referenced by stack in this dump.
- EXPECT_FALSE(mini.HasMemory(this));
- EXPECT_TRUE(full.HasMemory(this));
-
- // We expect PEB and TEBs in this dump.
- EXPECT_TRUE(mini.HasTebs() || full.HasTebs());
- EXPECT_TRUE(mini.HasPeb() || full.HasPeb());
-
- EXPECT_TRUE(mini.HasStream(MemoryListStream));
- EXPECT_TRUE(full.HasStream(Memory64ListStream));
- EXPECT_FALSE(mini.HasStream(Memory64ListStream));
- EXPECT_FALSE(full.HasStream(MemoryListStream));
-
- // This is the only place we don't use OR because we want both not
- // to have the streams.
- EXPECT_FALSE(mini.HasStream(ThreadExListStream));
- EXPECT_FALSE(full.HasStream(ThreadExListStream));
- EXPECT_FALSE(mini.HasStream(CommentStreamA));
- EXPECT_FALSE(full.HasStream(CommentStreamA));
- EXPECT_FALSE(mini.HasStream(CommentStreamW));
- EXPECT_FALSE(full.HasStream(CommentStreamW));
- EXPECT_FALSE(mini.HasStream(FunctionTableStream));
- EXPECT_FALSE(full.HasStream(FunctionTableStream));
- EXPECT_FALSE(mini.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(full.HasStream(MemoryInfoListStream));
- EXPECT_FALSE(mini.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(full.HasStream(ThreadInfoListStream));
- EXPECT_FALSE(mini.HasStream(HandleOperationListStream));
- EXPECT_FALSE(full.HasStream(HandleOperationListStream));
- EXPECT_FALSE(mini.HasStream(TokenStream));
- EXPECT_FALSE(full.HasStream(TokenStream));
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp b/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp
deleted file mode 100644
index 141d0ed0c8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/client/windows/unittests/testing.gyp
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'target_defaults': {
- },
- 'targets': [
- {
- 'target_name': 'gtest',
- 'type': 'static_library',
- 'include_dirs': [
- '<(DEPTH)/testing/include',
- '<(DEPTH)/testing/gtest',
- '<(DEPTH)/testing/gtest/include',
- ],
- 'sources': [
- '<(DEPTH)/testing/gtest/src/gtest-all.cc',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(DEPTH)/testing/include',
- '<(DEPTH)/testing/gtest/include',
- ],
- # Visual C++ implements variadic templates strangely, and
- # VC++2012 broke Google Test by lowering this value. See
- # http://stackoverflow.com/questions/12558327/google-test-in-visual-studio-2012
- 'defines': ['_VARIADIC_MAX=10'],
- },
- 'defines': ['_VARIADIC_MAX=10'],
- },
- {
- 'target_name': 'gmock',
- 'type': 'static_library',
- 'include_dirs': [
- '<(DEPTH)/testing/include',
- '<(DEPTH)/testing/',
- '<(DEPTH)/testing/gtest',
- '<(DEPTH)/testing/gtest/include',
- ],
- 'sources': [
- '<(DEPTH)/testing/src/gmock-all.cc',
- '<(DEPTH)/testing/src/gmock_main.cc',
- ],
- 'direct_dependent_settings': {
- 'include_dirs': [
- '<(DEPTH)/testing/include',
- '<(DEPTH)/testing/gtest/include',
- ],
- 'defines': ['_VARIADIC_MAX=10'],
- },
- 'defines': ['_VARIADIC_MAX=10'],
- },
-
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/Makefile.in b/toolkit/crashreporter/google-breakpad/src/common/Makefile.in
deleted file mode 100644
index 44a1f79fdf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/Makefile.in
+++ /dev/null
@@ -1,9 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/rules.mk
-
-# memory.h in this dir breaks things if -I$(srcdir) gets added, since memory.h
-# is also a system header and the copy here winds up getting included instead.
-INCLUDES := $(LOCAL_INCLUDES) -I$(DIST)/include
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext.S b/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext.S
deleted file mode 100644
index fd6326adfe..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext.S
+++ /dev/null
@@ -1,489 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A minimalistic implementation of getcontext() to be used by
-// Google Breakpad on Android.
-
-#include "common/android/ucontext_constants.h"
-
-/* int getcontext (ucontext_t *ucp) */
-
-#if defined(__arm__)
-
- .text
- .global breakpad_getcontext
- .hidden breakpad_getcontext
- .type breakpad_getcontext, #function
- .align 0
- .fnstart
-breakpad_getcontext:
-
- /* First, save r4-r11 */
- add r1, r0, #(MCONTEXT_GREGS_OFFSET + 4*4)
- stm r1, {r4-r11}
-
- /* r12 is a scratch register, don't save it */
-
- /* Save sp and lr explicitly. */
- /* - sp can't be stored with stmia in Thumb-2 */
- /* - STM instructions that store sp and pc are deprecated in ARM */
- str sp, [r0, #(MCONTEXT_GREGS_OFFSET + 13*4)]
- str lr, [r0, #(MCONTEXT_GREGS_OFFSET + 14*4)]
-
- /* Save the caller's address in 'pc' */
- str lr, [r0, #(MCONTEXT_GREGS_OFFSET + 15*4)]
-
- /* Save ucontext_t* pointer across next call */
- mov r4, r0
-
- /* Call sigprocmask(SIG_BLOCK, NULL, &(ucontext->uc_sigmask)) */
- mov r0, #0 /* SIG_BLOCK */
- mov r1, #0 /* NULL */
- add r2, r4, #UCONTEXT_SIGMASK_OFFSET
- bl sigprocmask(PLT)
-
- /* Intentionally do not save the FPU state here. This is because on
- * Linux/ARM, one should instead use ptrace(PTRACE_GETFPREGS) or
- * ptrace(PTRACE_GETVFPREGS) to get it.
- *
- * Note that a real implementation of getcontext() would need to save
- * this here to allow setcontext()/swapcontext() to work correctly.
- */
-
- /* Restore the values of r4 and lr */
- mov r0, r4
- ldr lr, [r0, #(MCONTEXT_GREGS_OFFSET + 14*4)]
- ldr r4, [r0, #(MCONTEXT_GREGS_OFFSET + 4*4)]
-
- /* Return 0 */
- mov r0, #0
- bx lr
-
- .fnend
- .size breakpad_getcontext, . - breakpad_getcontext
-
-#elif defined(__aarch64__)
-
-#define _NSIG 64
-#define __NR_rt_sigprocmask 135
-
- .text
- .global breakpad_getcontext
- .hidden breakpad_getcontext
- .type breakpad_getcontext, #function
- .align 4
- .cfi_startproc
-breakpad_getcontext:
-
- /* The saved context will return to the getcontext() call point
- with a return value of 0 */
- str xzr, [x0, MCONTEXT_GREGS_OFFSET + 0 * REGISTER_SIZE]
-
- stp x18, x19, [x0, MCONTEXT_GREGS_OFFSET + 18 * REGISTER_SIZE]
- stp x20, x21, [x0, MCONTEXT_GREGS_OFFSET + 20 * REGISTER_SIZE]
- stp x22, x23, [x0, MCONTEXT_GREGS_OFFSET + 22 * REGISTER_SIZE]
- stp x24, x25, [x0, MCONTEXT_GREGS_OFFSET + 24 * REGISTER_SIZE]
- stp x26, x27, [x0, MCONTEXT_GREGS_OFFSET + 26 * REGISTER_SIZE]
- stp x28, x29, [x0, MCONTEXT_GREGS_OFFSET + 28 * REGISTER_SIZE]
- str x30, [x0, MCONTEXT_GREGS_OFFSET + 30 * REGISTER_SIZE]
-
- /* Place LR into the saved PC, this will ensure that when
- switching to this saved context with setcontext() control
- will pass back to the caller of getcontext(), we have
- already arranged to return the appropriate return value in x0
- above. */
- str x30, [x0, MCONTEXT_PC_OFFSET]
-
- /* Save the current SP */
- mov x2, sp
- str x2, [x0, MCONTEXT_SP_OFFSET]
-
- /* Initialize the pstate. */
- str xzr, [x0, MCONTEXT_PSTATE_OFFSET]
-
- /* Figure out where to place the first context extension
- block. */
- add x2, x0, #MCONTEXT_EXTENSION_OFFSET
-
- /* Write the context extension fpsimd header. */
- mov w3, #(FPSIMD_MAGIC & 0xffff)
- movk w3, #(FPSIMD_MAGIC >> 16), lsl #16
- str w3, [x2, #FPSIMD_CONTEXT_MAGIC_OFFSET]
- mov w3, #FPSIMD_CONTEXT_SIZE
- str w3, [x2, #FPSIMD_CONTEXT_SIZE_OFFSET]
-
- /* Fill in the FP SIMD context. */
- add x3, x2, #(FPSIMD_CONTEXT_VREGS_OFFSET + 8 * SIMD_REGISTER_SIZE)
- stp d8, d9, [x3], #(2 * SIMD_REGISTER_SIZE)
- stp d10, d11, [x3], #(2 * SIMD_REGISTER_SIZE)
- stp d12, d13, [x3], #(2 * SIMD_REGISTER_SIZE)
- stp d14, d15, [x3], #(2 * SIMD_REGISTER_SIZE)
-
- add x3, x2, FPSIMD_CONTEXT_FPSR_OFFSET
-
- mrs x4, fpsr
- str w4, [x3]
-
- mrs x4, fpcr
- str w4, [x3, FPSIMD_CONTEXT_FPCR_OFFSET - FPSIMD_CONTEXT_FPSR_OFFSET]
-
- /* Write the termination context extension header. */
- add x2, x2, #FPSIMD_CONTEXT_SIZE
-
- str xzr, [x2, #FPSIMD_CONTEXT_MAGIC_OFFSET]
- str xzr, [x2, #FPSIMD_CONTEXT_SIZE_OFFSET]
-
- /* Grab the signal mask */
- /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
- add x2, x0, #UCONTEXT_SIGMASK_OFFSET
- mov x0, #0 /* SIG_BLOCK */
- mov x1, #0 /* NULL */
- mov x3, #(_NSIG / 8)
- mov x8, #__NR_rt_sigprocmask
- svc 0
-
- /* Return x0 for success */
- mov x0, 0
- ret
-
- .cfi_endproc
- .size breakpad_getcontext, . - breakpad_getcontext
-
-#elif defined(__i386__)
-
- .text
- .global breakpad_getcontext
- .hidden breakpad_getcontext
- .align 4
- .type breakpad_getcontext, @function
-
-breakpad_getcontext:
-
- movl 4(%esp), %eax /* eax = uc */
-
- /* Save register values */
- movl %ecx, MCONTEXT_ECX_OFFSET(%eax)
- movl %edx, MCONTEXT_EDX_OFFSET(%eax)
- movl %ebx, MCONTEXT_EBX_OFFSET(%eax)
- movl %edi, MCONTEXT_EDI_OFFSET(%eax)
- movl %esi, MCONTEXT_ESI_OFFSET(%eax)
- movl %ebp, MCONTEXT_EBP_OFFSET(%eax)
-
- movl (%esp), %edx /* return address */
- lea 4(%esp), %ecx /* exclude return address from stack */
- mov %edx, MCONTEXT_EIP_OFFSET(%eax)
- mov %ecx, MCONTEXT_ESP_OFFSET(%eax)
-
- xorl %ecx, %ecx
- movw %fs, %cx
- mov %ecx, MCONTEXT_FS_OFFSET(%eax)
-
- movl $0, MCONTEXT_EAX_OFFSET(%eax)
-
- /* Save floating point state to fpregstate, then update
- * the fpregs pointer to point to it */
- leal UCONTEXT_FPREGS_MEM_OFFSET(%eax), %ecx
- fnstenv (%ecx)
- fldenv (%ecx)
- mov %ecx, UCONTEXT_FPREGS_OFFSET(%eax)
-
- /* Save signal mask: sigprocmask(SIGBLOCK, NULL, &uc->uc_sigmask) */
- leal UCONTEXT_SIGMASK_OFFSET(%eax), %edx
- xorl %ecx, %ecx
- push %edx /* &uc->uc_sigmask */
- push %ecx /* NULL */
- push %ecx /* SIGBLOCK == 0 on i386 */
- call sigprocmask@PLT
- addl $12, %esp
-
- movl $0, %eax
- ret
-
- .size breakpad_getcontext, . - breakpad_getcontext
-
-#elif defined(__mips__)
-
-// This implementation is inspired by implementation of getcontext in glibc.
-#if _MIPS_SIM == _ABIO32
-#include <asm/asm.h>
-#include <asm/regdef.h>
-#include <asm/fpregdef.h>
-#else
-#include <machine/asm.h>
-#include <machine/regdef.h>
-#endif
-
-// from asm/asm.h
-#if _MIPS_SIM == _ABIO32
-#define ALSZ 7
-#define ALMASK ~7
-#define SZREG 4
-#else // _MIPS_SIM != _ABIO32
-#define ALSZ 15
-#define ALMASK ~15
-#define SZREG 8
-#endif
-
-#include <asm/unistd.h> // for __NR_rt_sigprocmask
-
-#define _NSIG8 128 / 8
-#define SIG_BLOCK 1
-
-
- .text
-LOCALS_NUM = 1 // save gp on stack
-FRAME_SIZE = ((LOCALS_NUM * SZREG) + ALSZ) & ALMASK
-
-GP_FRAME_OFFSET = FRAME_SIZE - (1 * SZREG)
-MCONTEXT_REG_SIZE = 8
-
-#if _MIPS_SIM == _ABIO32
-
-NESTED (breakpad_getcontext, FRAME_SIZE, ra)
- .mask 0x00000000, 0
- .fmask 0x00000000, 0
-
- .set noreorder
- .cpload t9
- .set reorder
-
- move a2, sp
-#define _SP a2
-
- addiu sp, -FRAME_SIZE
- .cprestore GP_FRAME_OFFSET
-
- sw s0, (16 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s1, (17 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s2, (18 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s3, (19 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s4, (20 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s5, (21 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s6, (22 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw s7, (23 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw _SP, (29 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw fp, (30 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw ra, (31 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sw ra, MCONTEXT_PC_OFFSET(a0)
-
-#ifdef __mips_hard_float
- s.d fs0, (20 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d fs1, (22 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d fs2, (24 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d fs3, (26 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d fs4, (28 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d fs5, (30 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
-
- cfc1 v1, fcr31
- sw v1, MCONTEXT_FPC_CSR(a0)
-#endif // __mips_hard_float
-
- /* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
- li a3, _NSIG8
- addu a2, a0, UCONTEXT_SIGMASK_OFFSET
- move a1, zero
- li a0, SIG_BLOCK
- li v0, __NR_rt_sigprocmask
- syscall
-
- addiu sp, FRAME_SIZE
- jr ra
-
-END (breakpad_getcontext)
-#else
-
-#ifndef NESTED
-/*
- * NESTED - declare nested routine entry point
- */
-#define NESTED(symbol, framesize, rpc) \
- .globl symbol; \
- .align 2; \
- .type symbol,@function; \
- .ent symbol,0; \
-symbol: .frame sp, framesize, rpc;
-#endif
-
-/*
- * END - mark end of function
- */
-#ifndef END
-# define END(function) \
- .end function; \
- .size function,.-function
-#endif
-
-/* int getcontext (ucontext_t *ucp) */
-
-NESTED (breakpad_getcontext, FRAME_SIZE, ra)
- .mask 0x10000000, 0
- .fmask 0x00000000, 0
-
- move a2, sp
-#define _SP a2
- move a3, gp
-#define _GP a3
-
- daddiu sp, -FRAME_SIZE
- .cpsetup $25, GP_FRAME_OFFSET, breakpad_getcontext
-
- /* Store a magic flag. */
- li v1, 1
- sd v1, (0 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0) /* zero */
-
- sd s0, (16 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s1, (17 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s2, (18 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s3, (19 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s4, (20 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s5, (21 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s6, (22 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s7, (23 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd _GP, (28 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd _SP, (29 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd s8, (30 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd ra, (31 * MCONTEXT_REG_SIZE + MCONTEXT_GREGS_OFFSET)(a0)
- sd ra, MCONTEXT_PC_OFFSET(a0)
-
-#ifdef __mips_hard_float
- s.d $f24, (24 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f25, (25 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f26, (26 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f27, (27 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f28, (28 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f29, (29 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f30, (30 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
- s.d $f31, (31 * MCONTEXT_REG_SIZE + MCONTEXT_FPREGS_OFFSET)(a0)
-
- cfc1 v1, $31
- sw v1, MCONTEXT_FPC_CSR(a0)
-#endif /* __mips_hard_float */
-
-/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8) */
- li a3, _NSIG8
- daddu a2, a0, UCONTEXT_SIGMASK_OFFSET
- move a1, zero
- li a0, SIG_BLOCK
-
- li v0, __NR_rt_sigprocmask
- syscall
-
- .cpreturn
- daddiu sp, FRAME_SIZE
- move v0, zero
- jr ra
-
-END (breakpad_getcontext)
-#endif // _MIPS_SIM == _ABIO32
-
-#elif defined(__x86_64__)
-/* The x64 implementation of breakpad_getcontext was derived in part
- from the implementation of libunwind which requires the following
- notice. */
-/* libunwind - a platform-independent unwind library
- Copyright (C) 2008 Google, Inc
- Contributed by Paul Pluzhnikov <ppluzhnikov@google.com>
- Copyright (C) 2010 Konstantin Belousov <kib@freebsd.org>
-
-This file is part of libunwind.
-
-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. */
-
- .text
- .global breakpad_getcontext
- .hidden breakpad_getcontext
- .align 4
- .type breakpad_getcontext, @function
-
-breakpad_getcontext:
- .cfi_startproc
-
- /* Callee saved: RBX, RBP, R12-R15 */
- movq %r12, MCONTEXT_GREGS_R12(%rdi)
- movq %r13, MCONTEXT_GREGS_R13(%rdi)
- movq %r14, MCONTEXT_GREGS_R14(%rdi)
- movq %r15, MCONTEXT_GREGS_R15(%rdi)
- movq %rbp, MCONTEXT_GREGS_RBP(%rdi)
- movq %rbx, MCONTEXT_GREGS_RBX(%rdi)
-
- /* Save argument registers (not strictly needed, but setcontext
- restores them, so don't restore garbage). */
- movq %r8, MCONTEXT_GREGS_R8(%rdi)
- movq %r9, MCONTEXT_GREGS_R9(%rdi)
- movq %rdi, MCONTEXT_GREGS_RDI(%rdi)
- movq %rsi, MCONTEXT_GREGS_RSI(%rdi)
- movq %rdx, MCONTEXT_GREGS_RDX(%rdi)
- movq %rax, MCONTEXT_GREGS_RAX(%rdi)
- movq %rcx, MCONTEXT_GREGS_RCX(%rdi)
-
- /* Save fp state (not needed, except for setcontext not
- restoring garbage). */
- leaq MCONTEXT_FPREGS_MEM(%rdi),%r8
- movq %r8, MCONTEXT_FPREGS_PTR(%rdi)
- fnstenv (%r8)
- stmxcsr FPREGS_OFFSET_MXCSR(%r8)
-
- leaq 8(%rsp), %rax /* exclude this call. */
- movq %rax, MCONTEXT_GREGS_RSP(%rdi)
-
- movq 0(%rsp), %rax
- movq %rax, MCONTEXT_GREGS_RIP(%rdi)
-
- /* Save signal mask: sigprocmask(SIGBLOCK, NULL, &uc->uc_sigmask) */
- leaq UCONTEXT_SIGMASK_OFFSET(%rdi), %rdx // arg3
- xorq %rsi, %rsi // arg2 NULL
- xorq %rdi, %rdi // arg1 SIGBLOCK == 0
- call sigprocmask@PLT
-
- /* Always return 0 for success, even if sigprocmask failed. */
- xorl %eax, %eax
- ret
- .cfi_endproc
- .size breakpad_getcontext, . - breakpad_getcontext
-
-#else
-#error "This file has not been ported for your CPU!"
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext_unittest.cc
deleted file mode 100644
index 2c550bf280..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/breakpad_getcontext_unittest.cc
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#if defined(__x86_64__)
-#include <asm/sigcontext.h>
-#endif
-
-#include <sys/ucontext.h>
-
-#include "breakpad_googletest_includes.h"
-#include "common/android/ucontext_constants.h"
-
-template <int left, int right>
-struct CompileAssertEquals {
- // a compilation error here indicates left and right are not equal.
- char left_too_large[right - left];
- // a compilation error here indicates left and right are not equal.
- char right_too_large[left - right];
-};
-
-#define COMPILE_ASSERT_EQ(left, right, tag) \
- CompileAssertEquals<left, right> tag;
-
-TEST(AndroidUContext, GRegsOffset) {
-#if defined(__arm__)
- // There is no gregs[] array on ARM, so compare to the offset of
- // first register fields, since they're stored in order.
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.arm_r0));
-#elif defined(__aarch64__)
- // There is no gregs[] array on ARM, so compare to the offset of
- // first register fields, since they're stored in order.
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.regs[0]));
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_SP_OFFSET),
- offsetof(ucontext_t,uc_mcontext.sp));
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_PC_OFFSET),
- offsetof(ucontext_t,uc_mcontext.pc));
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_PSTATE_OFFSET),
- offsetof(ucontext_t,uc_mcontext.pstate));
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_EXTENSION_OFFSET),
- offsetof(ucontext_t,uc_mcontext.__reserved));
-#elif defined(__i386__)
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.gregs));
-#define CHECK_REG(x) \
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_##x##_OFFSET), \
- offsetof(ucontext_t,uc_mcontext.gregs[REG_##x]))
- CHECK_REG(GS);
- CHECK_REG(FS);
- CHECK_REG(ES);
- CHECK_REG(DS);
- CHECK_REG(EDI);
- CHECK_REG(ESI);
- CHECK_REG(EBP);
- CHECK_REG(ESP);
- CHECK_REG(EBX);
- CHECK_REG(EDX);
- CHECK_REG(ECX);
- CHECK_REG(EAX);
- CHECK_REG(TRAPNO);
- CHECK_REG(ERR);
- CHECK_REG(EIP);
- CHECK_REG(CS);
- CHECK_REG(EFL);
- CHECK_REG(UESP);
- CHECK_REG(SS);
-
- ASSERT_EQ(static_cast<size_t>(UCONTEXT_FPREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.fpregs));
-
- ASSERT_EQ(static_cast<size_t>(UCONTEXT_FPREGS_MEM_OFFSET),
- offsetof(ucontext_t,__fpregs_mem));
-#elif defined(__mips__)
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.gregs));
-
- // PC for mips is not part of gregs.
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_PC_OFFSET),
- offsetof(ucontext_t,uc_mcontext.pc));
-
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_FPREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.fpregs));
-
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_FPC_CSR),
- offsetof(ucontext_t,uc_mcontext.fpc_csr));
-#elif defined(__x86_64__)
-
- COMPILE_ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.gregs),
- mcontext_gregs_offset);
-#define CHECK_REG(x) \
- COMPILE_ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_##x), \
- offsetof(ucontext_t,uc_mcontext.gregs[REG_##x]), reg_##x)
- CHECK_REG(R8);
- CHECK_REG(R9);
- CHECK_REG(R10);
- CHECK_REG(R11);
- CHECK_REG(R12);
- CHECK_REG(R13);
- CHECK_REG(R14);
- CHECK_REG(R15);
- CHECK_REG(RDI);
- CHECK_REG(RSI);
- CHECK_REG(RBP);
- CHECK_REG(RBX);
- CHECK_REG(RDX);
- CHECK_REG(RAX);
- CHECK_REG(RCX);
- CHECK_REG(RSP);
- CHECK_REG(RIP);
-
- // sigcontext is an analog to mcontext_t. The layout should be the same.
- COMPILE_ASSERT_EQ(offsetof(mcontext_t,fpregs),
- offsetof(sigcontext,fpstate), sigcontext_fpstate);
- // Check that _fpstate from asm/sigcontext.h is essentially the same
- // as _libc_fpstate.
- COMPILE_ASSERT_EQ(sizeof(_libc_fpstate), sizeof(_fpstate),
- sigcontext_fpstate_size);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,cwd),offsetof(_fpstate,cwd),
- sigcontext_fpstate_cwd);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,swd),offsetof(_fpstate,swd),
- sigcontext_fpstate_swd);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,ftw),offsetof(_fpstate,twd),
- sigcontext_fpstate_twd);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,fop),offsetof(_fpstate,fop),
- sigcontext_fpstate_fop);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,rip),offsetof(_fpstate,rip),
- sigcontext_fpstate_rip);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,rdp),offsetof(_fpstate,rdp),
- sigcontext_fpstate_rdp);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,mxcsr),offsetof(_fpstate,mxcsr),
- sigcontext_fpstate_mxcsr);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,mxcr_mask),
- offsetof(_fpstate,mxcsr_mask),
- sigcontext_fpstate_mxcsr_mask);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,_st), offsetof(_fpstate,st_space),
- sigcontext_fpstate_stspace);
- COMPILE_ASSERT_EQ(offsetof(_libc_fpstate,_xmm), offsetof(_fpstate,xmm_space),
- sigcontext_fpstate_xmm_space);
-
- COMPILE_ASSERT_EQ(MCONTEXT_FPREGS_PTR,
- offsetof(ucontext_t,uc_mcontext.fpregs),
- mcontext_fpregs_ptr);
- COMPILE_ASSERT_EQ(MCONTEXT_FPREGS_MEM, offsetof(ucontext_t,__fpregs_mem),
- mcontext_fpregs_mem);
- COMPILE_ASSERT_EQ(FPREGS_OFFSET_MXCSR, offsetof(_libc_fpstate,mxcsr),
- fpregs_offset_mxcsr);
- COMPILE_ASSERT_EQ(UCONTEXT_SIGMASK_OFFSET, offsetof(ucontext_t, uc_sigmask),
- ucontext_sigmask);
-#else
- ASSERT_EQ(static_cast<size_t>(MCONTEXT_GREGS_OFFSET),
- offsetof(ucontext_t,uc_mcontext.gregs));
-#endif
-}
-
-TEST(AndroidUContext, SigmakOffset) {
- ASSERT_EQ(static_cast<size_t>(UCONTEXT_SIGMASK_OFFSET),
- offsetof(ucontext_t,uc_sigmask));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/elf.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/elf.h
deleted file mode 100644
index b2a28df448..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/elf.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ELF_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ELF_H
-
-#include <stdint.h>
-#include <libgen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-// The Android <elf.h> provides BSD-based definitions for the ElfXX_Nhdr
-// types
-// always source-compatible with the GLibc/kernel ones. To overcome this
-// issue without modifying a lot of code in Breakpad, use an ugly macro
-// renaming trick with #include_next
-
-// Avoid conflict with BSD-based definition of ElfXX_Nhdr.
-// Unfortunately, their field member names do not use a 'n_' prefix.
-#define Elf32_Nhdr __bsd_Elf32_Nhdr
-#define Elf64_Nhdr __bsd_Elf64_Nhdr
-
-// In case they are defined by the NDK version
-#define Elf32_auxv_t __bionic_Elf32_auxv_t
-#define Elf64_auxv_t __bionic_Elf64_auxv_t
-
-#define Elf32_Dyn __bionic_Elf32_Dyn
-#define Elf64_Dyn __bionic_Elf64_Dyn
-
-#include_next <elf.h>
-
-#undef Elf32_Nhdr
-#undef Elf64_Nhdr
-
-typedef struct {
- Elf32_Word n_namesz;
- Elf32_Word n_descsz;
- Elf32_Word n_type;
-} Elf32_Nhdr;
-
-typedef struct {
- Elf64_Word n_namesz;
- Elf64_Word n_descsz;
- Elf64_Word n_type;
-} Elf64_Nhdr;
-
-#undef Elf32_auxv_t
-#undef Elf64_auxv_t
-
-typedef struct {
- uint32_t a_type;
- union {
- uint32_t a_val;
- } a_un;
-} Elf32_auxv_t;
-
-typedef struct {
- uint64_t a_type;
- union {
- uint64_t a_val;
- } a_un;
-} Elf64_auxv_t;
-
-#undef Elf32_Dyn
-#undef Elf64_Dyn
-
-typedef struct {
- Elf32_Sword d_tag;
- union {
- Elf32_Word d_val;
- Elf32_Addr d_ptr;
- } d_un;
-} Elf32_Dyn;
-
-typedef struct {
- Elf64_Sxword d_tag;
- union {
- Elf64_Xword d_val;
- Elf64_Addr d_ptr;
- } d_un;
-} Elf64_Dyn;
-
-
-// __WORDSIZE is GLibc-specific and used by Google Breakpad on Linux.
-#ifndef __WORDSIZE
-#if defined(__i386__) || defined(__ARM_EABI__) || defined(__mips__)
-#define __WORDSIZE 32
-#elif defined(__x86_64__) || defined(__aarch64__)
-#define __WORDSIZE 64
-#else
-#error "Unsupported Android CPU ABI"
-#endif
-#endif
-
-// The Android headers don't always define this constant.
-#ifndef EM_X86_64
-#define EM_X86_64 62
-#endif
-
-#ifndef EM_PPC64
-#define EM_PPC64 21
-#endif
-
-#ifndef EM_S390
-#define EM_S390 22
-#endif
-
-#if !defined(AT_SYSINFO_EHDR)
-#define AT_SYSINFO_EHDR 33
-#endif
-
-#if !defined(NT_PRSTATUS)
-#define NT_PRSTATUS 1
-#endif
-
-#if !defined(NT_PRPSINFO)
-#define NT_PRPSINFO 3
-#endif
-
-#if !defined(NT_AUXV)
-#define NT_AUXV 6
-#endif
-
-#if !defined(NT_PRXFPREG)
-#define NT_PRXFPREG 0x46e62b7f
-#endif
-
-#if !defined(NT_FPREGSET)
-#define NT_FPREGSET 2
-#endif
-
-#if !defined(SHT_MIPS_DWARF)
-#define SHT_MIPS_DWARF 0x7000001e
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ELF_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/link.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/link.h
deleted file mode 100644
index 0f7d98e753..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/link.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_ANDROID_INCLUDE_LINK_H
-#define GOOGLE_BREAKPAD_ANDROID_INCLUDE_LINK_H
-
-/* Android doesn't provide all the data-structures required in its <link.h>.
- Provide custom version here. */
-#include_next <link.h>
-
-// TODO(rmcilroy): Remove this file once the ndk is updated for other
-// architectures - crbug.com/358831
-#if !defined(__aarch64__) && !defined(__x86_64__) && \
- !(defined(__mips__) && _MIPS_SIM == _ABI64)
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#if defined(ANDROID) && ANDROID_VERSION <= 20
-struct r_debug {
- int r_version;
- struct link_map* r_map;
- ElfW(Addr) r_brk;
- enum {
- RT_CONSISTENT,
- RT_ADD,
- RT_DELETE } r_state;
- ElfW(Addr) r_ldbase;
-};
-
-struct link_map {
- ElfW(Addr) l_addr;
- char* l_name;
- ElfW(Dyn)* l_ld;
- struct link_map* l_next;
- struct link_map* l_prev;
-};
-#endif
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // !defined(__aarch64__) && !defined(__x86_64__)
-
-#endif /* GOOGLE_BREAKPAD_ANDROID_INCLUDE_LINK_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/sgidefs.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/sgidefs.h
deleted file mode 100644
index 33796dcf74..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/sgidefs.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_ANDROID_INCLUDE_SGIDEFS_H
-#define GOOGLE_BREAKPAD_ANDROID_INCLUDE_SGIDEFS_H
-
-#ifdef __mips__
-
-// Android doesn't contain sgidefs.h, but does have <asm/sgidefs.h> which
-// contains what we need.
-#include <asm/sgidefs.h>
-
-#endif // __mips__
-
-#endif // GOOGLE_BREAKPAD_ANDROID_INCLUDE_SGIDEFS_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h
deleted file mode 100644
index cd92902151..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/stab.h
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
-
-#include <sys/cdefs.h>
-
-#ifdef __BIONIC_HAVE_STAB_H
-#include <stab.h>
-#else
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#define _STAB_CODE_LIST \
- _STAB_CODE_DEF(UNDF,0x00) \
- _STAB_CODE_DEF(GSYM,0x20) \
- _STAB_CODE_DEF(FNAME,0x22) \
- _STAB_CODE_DEF(FUN,0x24) \
- _STAB_CODE_DEF(STSYM,0x26) \
- _STAB_CODE_DEF(LCSYM,0x28) \
- _STAB_CODE_DEF(MAIN,0x2a) \
- _STAB_CODE_DEF(PC,0x30) \
- _STAB_CODE_DEF(NSYMS,0x32) \
- _STAB_CODE_DEF(NOMAP,0x34) \
- _STAB_CODE_DEF(OBJ,0x38) \
- _STAB_CODE_DEF(OPT,0x3c) \
- _STAB_CODE_DEF(RSYM,0x40) \
- _STAB_CODE_DEF(M2C,0x42) \
- _STAB_CODE_DEF(SLINE,0x44) \
- _STAB_CODE_DEF(DSLINE,0x46) \
- _STAB_CODE_DEF(BSLINE,0x48) \
- _STAB_CODE_DEF(BROWS,0x48) \
- _STAB_CODE_DEF(DEFD,0x4a) \
- _STAB_CODE_DEF(EHDECL,0x50) \
- _STAB_CODE_DEF(MOD2,0x50) \
- _STAB_CODE_DEF(CATCH,0x54) \
- _STAB_CODE_DEF(SSYM,0x60) \
- _STAB_CODE_DEF(SO,0x64) \
- _STAB_CODE_DEF(LSYM,0x80) \
- _STAB_CODE_DEF(BINCL,0x82) \
- _STAB_CODE_DEF(SOL,0x84) \
- _STAB_CODE_DEF(PSYM,0xa0) \
- _STAB_CODE_DEF(EINCL,0xa2) \
- _STAB_CODE_DEF(ENTRY,0xa4) \
- _STAB_CODE_DEF(LBRAC,0xc0) \
- _STAB_CODE_DEF(EXCL,0xc2) \
- _STAB_CODE_DEF(SCOPE,0xc4) \
- _STAB_CODE_DEF(RBRAC,0xe0) \
- _STAB_CODE_DEF(BCOMM,0xe2) \
- _STAB_CODE_DEF(ECOMM,0xe4) \
- _STAB_CODE_DEF(ECOML,0xe8) \
- _STAB_CODE_DEF(NBTEXT,0xf0) \
- _STAB_CODE_DEF(NBDATA,0xf2) \
- _STAB_CODE_DEF(NBBSS,0xf4) \
- _STAB_CODE_DEF(NBSTS,0xf6) \
- _STAB_CODE_DEF(NBLCS,0xf8) \
- _STAB_CODE_DEF(LENG,0xfe)
-
-enum __stab_debug_code {
-#define _STAB_CODE_DEF(x,y) N_##x = y,
-_STAB_CODE_LIST
-#undef _STAB_CODE_DEF
-};
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // __BIONIC_HAVE_STAB_H
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_STAB_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/procfs.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/procfs.h
deleted file mode 100644
index 185124364e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/procfs.h
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_SYS_PROCFS_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_SYS_PROCFS_H
-
-#ifdef __BIONIC_HAVE_SYS_PROCFS_H
-
-#include_next <sys/procfs.h>
-
-#else
-
-#include <asm/ptrace.h>
-#include <sys/cdefs.h>
-#if defined (__mips__)
-#include <sys/types.h>
-#endif
-#include <sys/user.h>
-#include <unistd.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-#if defined(__x86_64__) || defined(__aarch64__)
-typedef unsigned long long elf_greg_t;
-#else
-typedef unsigned long elf_greg_t;
-#endif
-
-#ifdef __arm__
-#define ELF_NGREG (sizeof(struct user_regs) / sizeof(elf_greg_t))
-#elif defined(__aarch64__)
-#define ELF_NGREG (sizeof(struct user_pt_regs) / sizeof(elf_greg_t))
-#elif defined(__mips__)
-#define ELF_NGREG 45
-#else
-#define ELF_NGREG (sizeof(struct user_regs_struct) / sizeof(elf_greg_t))
-#endif
-
-typedef elf_greg_t elf_gregset_t[ELF_NGREG];
-
-struct elf_siginfo {
- int si_signo;
- int si_code;
- int si_errno;
-};
-
-struct elf_prstatus {
- struct elf_siginfo pr_info;
- short pr_cursig;
- unsigned long pr_sigpend;
- unsigned long pr_sighold;
- pid_t pr_pid;
- pid_t pr_ppid;
- pid_t pr_pgrp;
- pid_t pd_sid;
- struct timeval pr_utime;
- struct timeval pr_stime;
- struct timeval pr_cutime;
- struct timeval pr_cstime;
- elf_gregset_t pr_reg;
- int pr_fpvalid;
-};
-
-#define ELF_PRARGSZ 80
-
-struct elf_prpsinfo {
- char pr_state;
- char pr_sname;
- char pr_zomb;
- char pr_nice;
- unsigned long pr_flags;
-#ifdef __x86_64__
- unsigned int pr_uid;
- unsigned int pr_gid;
-#elif defined(__mips__)
- __kernel_uid_t pr_uid;
- __kernel_gid_t pr_gid;
-#else
- unsigned short pr_uid;
- unsigned short pr_gid;
-#endif
- int pr_pid;
- int pr_ppid;
- int pr_pgrp;
- int pr_sid;
- char pr_fname[16];
- char pr_psargs[ELF_PRARGSZ];
-};
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // __BIONIC_HAVE_SYS_PROCFS_H
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_SYS_PROCFS_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h
deleted file mode 100644
index 20c81e9379..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/signal.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
-
-#include <signal.h>
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_SIGNAL_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/user.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/user.h
deleted file mode 100644
index 1eb02a57d2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/sys/user.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
-
-// The purpose of this file is to glue the mismatching headers (Android NDK vs
-// glibc) and therefore avoid doing otherwise awkward #ifdefs in the code.
-// The following quirks are currently handled by this file:
-// - i386: Use the Android NDK but alias user_fxsr_struct > user_fpxregs_struct.
-// - aarch64:
-// - NDK r10: Add missing user_regs_struct and user_fpsimd_struct structs.
-// - NDK r11+: Add missing <stdint.h> include
-// - Other platforms: Just use the Android NDK unchanged.
-
-// TODO(primiano): remove these changes after Chromium has stably rolled to
-// an NDK with the appropriate fixes.
-
-#if defined(ANDROID_NDK_MAJOR_VERSION) && ANDROID_NDK_MAJOR_VERSION > 10
-#ifdef __aarch64__
-#include <stdint.h>
-#endif // __aarch64__
-#endif // defined(ANDROID_NDK_MAJOR_VERSION) && ANDROID_NDK_MAJOR_VERSION > 10
-
-#include_next <sys/user.h>
-
-#ifdef __i386__
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-typedef struct user_fxsr_struct user_fpxregs_struct;
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-#endif // __i386__
-
-#if !defined(ANDROID_NDK_MAJOR_VERSION) || ANDROID_NDK_MAJOR_VERSION == 10
-#ifdef __aarch64__
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-struct user_regs_struct {
- __u64 regs[31];
- __u64 sp;
- __u64 pc;
- __u64 pstate;
-};
-struct user_fpsimd_struct {
- __uint128_t vregs[32];
- __u32 fpsr;
- __u32 fpcr;
-};
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-#endif // __aarch64__
-#endif // defined(ANDROID_NDK_VERSION) && ANDROID_NDK_MAJOR_VERSION == 10
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_USER_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/include/ucontext.h b/toolkit/crashreporter/google-breakpad/src/common/android/include/ucontext.h
deleted file mode 100644
index 29db8adee6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/include/ucontext.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H
-
-#include <sys/cdefs.h>
-
-#ifdef __BIONIC_UCONTEXT_H
-#include <ucontext.h>
-#else
-
-#include <sys/ucontext.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-// Provided by src/android/common/breakpad_getcontext.S
-int breakpad_getcontext(ucontext_t* ucp);
-
-#define getcontext(x) breakpad_getcontext(x)
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-
-#endif // __BIONIC_UCONTEXT_H
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/testing/include/wchar.h b/toolkit/crashreporter/google-breakpad/src/common/android/testing/include/wchar.h
deleted file mode 100644
index 85373fd2a0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/testing/include/wchar.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Android doesn't provide wcscasecmp(), so provide an alternative here.
-//
-// Note that this header is not needed when Breakpad is compiled against
-// a recent version of Googletest. It shall be considered for removal once
-// src/testing/ is updated to an appropriate revision in the future.
-
-#ifndef GOOGLEBREAKPAD_COMMON_ANDROID_INCLUDE_WCHAR_H
-#define GOOGLEBREAKPAD_COMMON_ANDROID_INCLUDE_WCHAR_H
-
-#include_next <wchar.h>
-
-#if !defined(__aarch64__) && !defined(__x86_64__) && \
- !(defined(__mips__) && _MIPS_SIM == _ABI64)
-
-// This needs to be in an extern "C" namespace, or Googletest will not
-// compile against it.
-#ifdef __cplusplus
-extern "C" {
-#endif // __cplusplus
-
-static wchar_t inline wcstolower(wchar_t ch) {
- if (ch >= L'a' && ch <= L'A')
- ch -= L'a' - L'A';
- return ch;
-}
-
-static int inline wcscasecmp(const wchar_t* s1, const wchar_t* s2) {
- for (;;) {
- wchar_t c1 = wcstolower(*s1);
- wchar_t c2 = wcstolower(*s2);
- if (c1 < c2)
- return -1;
- if (c1 > c2)
- return 1;
- if (c1 == L'0')
- return 0;
- s1++;
- s2++;
- }
-}
-
-#ifdef __cplusplus
-} // extern "C"
-#endif // __cplusplus
-#endif
-
-#endif // GOOGLEBREAKPAD_COMMON_ANDROID_INCLUDE_WCHAR_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/testing/mkdtemp.h b/toolkit/crashreporter/google-breakpad/src/common/android/testing/mkdtemp.h
deleted file mode 100644
index b86e2cd783..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/testing/mkdtemp.h
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// mkdtemp() wasn't declared in <stdlib.h> until NDK r9b due to a simple
-// packaging bug (the function has always been implemented in all versions
-// of the C library). This header is provided to build Breakpad with earlier
-// NDK revisions (e.g. the one used by Chromium). It may be removed in the
-// future once all major projects upgrade to use a more recent NDK.
-//
-// The reason this is inlined here is to avoid linking a new object file
-// into each unit test program (i.e. keep build files simple).
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_MKDTEMP_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_MKDTEMP_H
-
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-
-// Using a macro renaming trick here is necessary when building against
-// NDK r9b. Otherwise the compiler will complain that calls to mkdtemp()
-// are ambiguous.
-#define mkdtemp breakpad_mkdtemp
-
-namespace {
-
-char* breakpad_mkdtemp(char* path) {
- if (path == NULL) {
- errno = EINVAL;
- return NULL;
- }
-
- // 'path' must be terminated with six 'X'
- const char kSuffix[] = "XXXXXX";
- const size_t kSuffixLen = strlen(kSuffix);
- char* path_end = path + strlen(path);
-
- if (static_cast<size_t>(path_end - path) < kSuffixLen ||
- memcmp(path_end - kSuffixLen, kSuffix, kSuffixLen) != 0) {
- errno = EINVAL;
- return NULL;
- }
-
- // If 'path' contains a directory separator, check that it exists to
- // avoid looping later.
- char* sep = strrchr(path, '/');
- if (sep != NULL) {
- struct stat st;
- int ret;
- *sep = '\0'; // temporarily zero-terminate the dirname.
- ret = stat(path, &st);
- *sep = '/'; // restore full path.
- if (ret < 0)
- return NULL;
- if (!S_ISDIR(st.st_mode)) {
- errno = ENOTDIR;
- return NULL;
- }
- }
-
- // Loop. On each iteration, replace the XXXXXX suffix with a random
- // number.
- int tries;
- for (tries = 128; tries > 0; tries--) {
- int random = rand() % 1000000;
-
- snprintf(path_end - kSuffixLen, kSuffixLen + 1, "%0d", random);
- if (mkdir(path, 0700) == 0)
- return path; // Success
-
- if (errno != EEXIST)
- return NULL;
- }
-
- assert(errno == EEXIST);
- return NULL;
-}
-
-} // namespace
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_MKDTEMP_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/testing/pthread_fixes.h b/toolkit/crashreporter/google-breakpad/src/common/android/testing/pthread_fixes.h
deleted file mode 100644
index 15c6309ecc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/testing/pthread_fixes.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This contains Pthread-related functions not provided by the Android NDK
-// but required by the Breakpad unit test. The functions are inlined here
-// in a C++ anonymous namespace in order to keep the build files simples.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H
-#define GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H
-
-#include <pthread.h>
-
-namespace {
-
-// Android doesn't provide pthread_barrier_t for now.
-#ifndef PTHREAD_BARRIER_SERIAL_THREAD
-
-// Anything except 0 will do here.
-#define PTHREAD_BARRIER_SERIAL_THREAD 0x12345
-
-typedef struct {
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- unsigned count;
-} pthread_barrier_t;
-
-int pthread_barrier_init(pthread_barrier_t* barrier,
- const void* /* barrier_attr */,
- unsigned count) {
- barrier->count = count;
- pthread_mutex_init(&barrier->mutex, NULL);
- pthread_cond_init(&barrier->cond, NULL);
- return 0;
-}
-
-int pthread_barrier_wait(pthread_barrier_t* barrier) {
- // Lock the mutex
- pthread_mutex_lock(&barrier->mutex);
- // Decrement the count. If this is the first thread to reach 0, wake up
- // waiters, unlock the mutex, then return PTHREAD_BARRIER_SERIAL_THREAD.
- if (--barrier->count == 0) {
- // First thread to reach the barrier
- pthread_cond_broadcast(&barrier->cond);
- pthread_mutex_unlock(&barrier->mutex);
- return PTHREAD_BARRIER_SERIAL_THREAD;
- }
- // Otherwise, wait for other threads until the count reaches 0, then
- // return 0 to indicate this is not the first thread.
- do {
- pthread_cond_wait(&barrier->cond, &barrier->mutex);
- } while (barrier->count > 0);
-
- pthread_mutex_unlock(&barrier->mutex);
- return 0;
-}
-
-int pthread_barrier_destroy(pthread_barrier_t *barrier) {
- barrier->count = 0;
- pthread_cond_destroy(&barrier->cond);
- pthread_mutex_destroy(&barrier->mutex);
- return 0;
-}
-
-#endif // defined(PTHREAD_BARRIER_SERIAL_THREAD)
-
-int pthread_yield(void) {
- sched_yield();
- return 0;
-}
-
-} // namespace
-
-#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/android/ucontext_constants.h b/toolkit/crashreporter/google-breakpad/src/common/android/ucontext_constants.h
deleted file mode 100644
index 1932d5739c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/android/ucontext_constants.h
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This header can be included either from a C, C++ or Assembly file.
-// Its purpose is to contain constants that must match the offsets of
-// various fields in ucontext_t.
-//
-// They should match the definitions from
-// src/common/android/include/sys/ucontext.h
-//
-// Used by src/common/android/breakpad_getcontext.S
-// Tested by src/common/android/testing/breakpad_getcontext_unittest.cc
-
-#ifndef GOOGLEBREAKPAD_COMMON_ANDROID_UCONTEXT_CONSTANTS_H
-#define GOOGLEBREAKPAD_COMMON_ANDROID_UCONTEXT_CONSTANTS_H
-
-#if defined(__arm__)
-
-#define MCONTEXT_GREGS_OFFSET 32
-#define UCONTEXT_SIGMASK_OFFSET 104
-
-#elif defined(__aarch64__)
-
-#define UCONTEXT_SIGMASK_OFFSET 40
-
-#define MCONTEXT_GREGS_OFFSET 184
-#define MCONTEXT_SP_OFFSET 432
-#define MCONTEXT_PC_OFFSET 440
-#define MCONTEXT_PSTATE_OFFSET 448
-#define MCONTEXT_EXTENSION_OFFSET 464
-
-#define FPSIMD_MAGIC 0x46508001
-
-#define FPSIMD_CONTEXT_MAGIC_OFFSET 0
-#define FPSIMD_CONTEXT_SIZE_OFFSET 4
-#define FPSIMD_CONTEXT_FPSR_OFFSET 8
-#define FPSIMD_CONTEXT_FPCR_OFFSET 12
-#define FPSIMD_CONTEXT_VREGS_OFFSET 16
-#define FPSIMD_CONTEXT_SIZE 528
-
-#define REGISTER_SIZE 8
-#define SIMD_REGISTER_SIZE 16
-
-#elif defined(__i386__)
-
-#define MCONTEXT_GREGS_OFFSET 20
-#define MCONTEXT_GS_OFFSET (MCONTEXT_GREGS_OFFSET + 0*4)
-#define MCONTEXT_FS_OFFSET (MCONTEXT_GREGS_OFFSET + 1*4)
-#define MCONTEXT_ES_OFFSET (MCONTEXT_GREGS_OFFSET + 2*4)
-#define MCONTEXT_DS_OFFSET (MCONTEXT_GREGS_OFFSET + 3*4)
-#define MCONTEXT_EDI_OFFSET (MCONTEXT_GREGS_OFFSET + 4*4)
-#define MCONTEXT_ESI_OFFSET (MCONTEXT_GREGS_OFFSET + 5*4)
-#define MCONTEXT_EBP_OFFSET (MCONTEXT_GREGS_OFFSET + 6*4)
-#define MCONTEXT_ESP_OFFSET (MCONTEXT_GREGS_OFFSET + 7*4)
-#define MCONTEXT_EBX_OFFSET (MCONTEXT_GREGS_OFFSET + 8*4)
-#define MCONTEXT_EDX_OFFSET (MCONTEXT_GREGS_OFFSET + 9*4)
-#define MCONTEXT_ECX_OFFSET (MCONTEXT_GREGS_OFFSET + 10*4)
-#define MCONTEXT_EAX_OFFSET (MCONTEXT_GREGS_OFFSET + 11*4)
-#define MCONTEXT_TRAPNO_OFFSET (MCONTEXT_GREGS_OFFSET + 12*4)
-#define MCONTEXT_ERR_OFFSET (MCONTEXT_GREGS_OFFSET + 13*4)
-#define MCONTEXT_EIP_OFFSET (MCONTEXT_GREGS_OFFSET + 14*4)
-#define MCONTEXT_CS_OFFSET (MCONTEXT_GREGS_OFFSET + 15*4)
-#define MCONTEXT_EFL_OFFSET (MCONTEXT_GREGS_OFFSET + 16*4)
-#define MCONTEXT_UESP_OFFSET (MCONTEXT_GREGS_OFFSET + 17*4)
-#define MCONTEXT_SS_OFFSET (MCONTEXT_GREGS_OFFSET + 18*4)
-
-#define UCONTEXT_SIGMASK_OFFSET 108
-
-#define UCONTEXT_FPREGS_OFFSET 96
-#define UCONTEXT_FPREGS_MEM_OFFSET 116
-
-#elif defined(__mips__)
-
-#if _MIPS_SIM == _ABIO32
-#define MCONTEXT_PC_OFFSET 32
-#define MCONTEXT_GREGS_OFFSET 40
-#define MCONTEXT_FPREGS_OFFSET 296
-#define MCONTEXT_FPC_CSR 556
-#define UCONTEXT_SIGMASK_OFFSET 616
-#else
-#define MCONTEXT_GREGS_OFFSET 40
-#define MCONTEXT_FPREGS_OFFSET 296
-#define MCONTEXT_PC_OFFSET 616
-#define MCONTEXT_FPC_CSR 624
-#define UCONTEXT_SIGMASK_OFFSET 640
-#endif
-
-#elif defined(__x86_64__)
-
-#define MCONTEXT_GREGS_OFFSET 40
-#define UCONTEXT_SIGMASK_OFFSET 296
-
-#define MCONTEXT_GREGS_R8 40
-#define MCONTEXT_GREGS_R9 48
-#define MCONTEXT_GREGS_R10 56
-#define MCONTEXT_GREGS_R11 64
-#define MCONTEXT_GREGS_R12 72
-#define MCONTEXT_GREGS_R13 80
-#define MCONTEXT_GREGS_R14 88
-#define MCONTEXT_GREGS_R15 96
-#define MCONTEXT_GREGS_RDI 104
-#define MCONTEXT_GREGS_RSI 112
-#define MCONTEXT_GREGS_RBP 120
-#define MCONTEXT_GREGS_RBX 128
-#define MCONTEXT_GREGS_RDX 136
-#define MCONTEXT_GREGS_RAX 144
-#define MCONTEXT_GREGS_RCX 152
-#define MCONTEXT_GREGS_RSP 160
-#define MCONTEXT_GREGS_RIP 168
-#define MCONTEXT_FPREGS_PTR 224
-#define MCONTEXT_FPREGS_MEM 304
-#define FPREGS_OFFSET_MXCSR 24
-
-#else
-#error "This header has not been ported for your CPU"
-#endif
-
-#endif // GOOGLEBREAKPAD_COMMON_ANDROID_UCONTEXT_CONSTANTS_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.cc b/toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.cc
deleted file mode 100644
index 2d1ed983dc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.cc
+++ /dev/null
@@ -1,487 +0,0 @@
-
-/* libunwind - a platform-independent unwind library
- Copyright 2011 Linaro Limited
-
-This file is part of libunwind.
-
-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. */
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Derived from libunwind, with extensive modifications.
-
-
-#include "common/arm_ex_reader.h"
-
-#include <assert.h>
-#include <stdio.h>
-
-// This file, in conjunction with arm_ex_to_module.cc, translates
-// EXIDX unwind information into the same format that Breakpad uses
-// for CFI information. Hence Breakpad's CFI unwinding abilities
-// also become usable for EXIDX.
-//
-// See: "Exception Handling ABI for the ARM Architecture", ARM IHI 0038A
-// http://infocenter.arm.com/help/topic/com.arm.doc.ihi0038a/IHI0038A_ehabi.pdf
-
-// EXIDX data is presented in two parts:
-//
-// * an index table. This contains two words per routine,
-// the first of which identifies the routine, and the second
-// of which is a reference to the unwind bytecode. If the
-// bytecode is very compact -- 3 bytes or less -- it can be
-// stored directly in the second word.
-//
-// * an area containing the unwind bytecodes.
-
-// General flow is: ExceptionTableInfo::Start iterates over all
-// of the index table entries (pairs). For each entry, it:
-//
-// * calls ExceptionTableInfo::ExtabEntryExtract to copy the bytecode
-// out into an intermediate buffer.
-
-// * uses ExceptionTableInfo::ExtabEntryDecode to parse the intermediate
-// buffer. Each bytecode instruction is bundled into a
-// arm_ex_to_module::extab_data structure, and handed to ..
-//
-// * .. ARMExToModule::ImproveStackFrame, which in turn hands it to
-// ARMExToModule::TranslateCmd, and that generates the pseudo-CFI
-// records that Breakpad stores.
-
-#define ARM_EXIDX_CANT_UNWIND 0x00000001
-#define ARM_EXIDX_COMPACT 0x80000000
-#define ARM_EXTBL_OP_FINISH 0xb0
-#define ARM_EXIDX_TABLE_LIMIT (255*4)
-
-namespace arm_ex_reader {
-
-using arm_ex_to_module::ARM_EXIDX_CMD_FINISH;
-using arm_ex_to_module::ARM_EXIDX_CMD_SUB_FROM_VSP;
-using arm_ex_to_module::ARM_EXIDX_CMD_ADD_TO_VSP;
-using arm_ex_to_module::ARM_EXIDX_CMD_REG_POP;
-using arm_ex_to_module::ARM_EXIDX_CMD_REG_TO_SP;
-using arm_ex_to_module::ARM_EXIDX_CMD_VFP_POP;
-using arm_ex_to_module::ARM_EXIDX_CMD_WREG_POP;
-using arm_ex_to_module::ARM_EXIDX_CMD_WCGR_POP;
-using arm_ex_to_module::ARM_EXIDX_CMD_RESERVED;
-using arm_ex_to_module::ARM_EXIDX_CMD_REFUSED;
-using arm_ex_to_module::exidx_entry;
-using arm_ex_to_module::ARM_EXIDX_VFP_SHIFT_16;
-using arm_ex_to_module::ARM_EXIDX_VFP_FSTMD;
-using google_breakpad::MemoryRange;
-
-
-static void* Prel31ToAddr(const void* addr) {
- uint32_t offset32 = *reinterpret_cast<const uint32_t*>(addr);
- // sign extend offset32[30:0] to 64 bits -- copy bit 30 to positions
- // 63:31 inclusive.
- uint64_t offset64 = offset32;
- if (offset64 & (1ULL << 30))
- offset64 |= 0xFFFFFFFF80000000ULL;
- else
- offset64 &= 0x000000007FFFFFFFULL;
- return ((char*)addr) + (uintptr_t)offset64;
-}
-
-
-// Extract unwind bytecode for the function denoted by |entry| into |buf|,
-// and return the number of bytes of |buf| written, along with a code
-// indicating the outcome.
-
-ExceptionTableInfo::ExExtractResult ExceptionTableInfo::ExtabEntryExtract(
- const struct exidx_entry* entry,
- uint8_t* buf, size_t buf_size,
- size_t* buf_used) {
- MemoryRange mr_out(buf, buf_size);
-
- *buf_used = 0;
-
-# define PUT_BUF_U8(_byte) \
- do { if (!mr_out.Covers(*buf_used, 1)) return ExOutBufOverflow; \
- buf[(*buf_used)++] = (_byte); } while (0)
-
-# define GET_EX_U32(_lval, _addr, _sec_mr) \
- do { if (!(_sec_mr).Covers(reinterpret_cast<const uint8_t*>(_addr) \
- - (_sec_mr).data(), 4)) \
- return ExInBufOverflow; \
- (_lval) = *(reinterpret_cast<const uint32_t*>(_addr)); } while (0)
-
-# define GET_EXIDX_U32(_lval, _addr) \
- GET_EX_U32(_lval, _addr, mr_exidx_)
-# define GET_EXTAB_U32(_lval, _addr) \
- GET_EX_U32(_lval, _addr, mr_extab_)
-
- uint32_t data;
- GET_EXIDX_U32(data, &entry->data);
-
- // A function can be marked CANT_UNWIND if (eg) it is known to be
- // at the bottom of the stack.
- if (data == ARM_EXIDX_CANT_UNWIND)
- return ExCantUnwind;
-
- uint32_t pers; // personality number
- uint32_t extra; // number of extra data words required
- uint32_t extra_allowed; // number of extra data words allowed
- uint32_t* extbl_data; // the handler entry, if not inlined
-
- if (data & ARM_EXIDX_COMPACT) {
- // The handler table entry has been inlined into the index table entry.
- // In this case it can only be an ARM-defined compact model, since
- // bit 31 is 1. Only personalities 0, 1 and 2 are defined for the
- // ARM compact model, but 1 and 2 are "Long format" and may require
- // extra data words. Hence the allowable personalities here are:
- // personality 0, in which case 'extra' has no meaning
- // personality 1, with zero extra words
- // personality 2, with zero extra words
- extbl_data = NULL;
- pers = (data >> 24) & 0x0F;
- extra = (data >> 16) & 0xFF;
- extra_allowed = 0;
- }
- else {
- // The index table entry is a pointer to the handler entry. Note
- // that Prel31ToAddr will read the given address, but we already
- // range-checked above.
- extbl_data = reinterpret_cast<uint32_t*>(Prel31ToAddr(&entry->data));
- GET_EXTAB_U32(data, extbl_data);
- if (!(data & ARM_EXIDX_COMPACT)) {
- // This denotes a "generic model" handler. That will involve
- // executing arbitary machine code, which is something we
- // can't represent here; hence reject it.
- return ExCantRepresent;
- }
- // So we have a compact model representation. Again, 3 possible
- // personalities, but this time up to 255 allowable extra words.
- pers = (data >> 24) & 0x0F;
- extra = (data >> 16) & 0xFF;
- extra_allowed = 255;
- extbl_data++;
- }
-
- // Now look at the the handler table entry. The first word is
- // |data| and subsequent words start at |*extbl_data|. The number
- // of extra words to use is |extra|, provided that the personality
- // allows extra words. Even if it does, none may be available --
- // extra_allowed is the maximum number of extra words allowed. */
- if (pers == 0) {
- // "Su16" in the documentation -- 3 unwinding insn bytes
- // |extra| has no meaning here; instead that byte is an unwind-info byte
- PUT_BUF_U8(data >> 16);
- PUT_BUF_U8(data >> 8);
- PUT_BUF_U8(data);
- }
- else if ((pers == 1 || pers == 2) && extra <= extra_allowed) {
- // "Lu16" or "Lu32" respectively -- 2 unwinding insn bytes,
- // and up to 255 extra words.
- PUT_BUF_U8(data >> 8);
- PUT_BUF_U8(data);
- for (uint32_t j = 0; j < extra; j++) {
- GET_EXTAB_U32(data, extbl_data);
- extbl_data++;
- PUT_BUF_U8(data >> 24);
- PUT_BUF_U8(data >> 16);
- PUT_BUF_U8(data >> 8);
- PUT_BUF_U8(data >> 0);
- }
- }
- else {
- // The entry is invalid.
- return ExInvalid;
- }
-
- // Make sure the entry is terminated with "FINISH"
- if (*buf_used > 0 && buf[(*buf_used) - 1] != ARM_EXTBL_OP_FINISH)
- PUT_BUF_U8(ARM_EXTBL_OP_FINISH);
-
- return ExSuccess;
-
-# undef GET_EXTAB_U32
-# undef GET_EXIDX_U32
-# undef GET_U32
-# undef PUT_BUF_U8
-}
-
-
-// Take the unwind information extracted by ExtabEntryExtract
-// and parse it into frame-unwind instructions. These are as
-// specified in "Table 4, ARM-defined frame-unwinding instructions"
-// in the specification document detailed in comments at the top
-// of this file.
-//
-// This reads from |buf[0, +data_size)|. It checks for overruns of
-// the input buffer and returns a negative value if that happens, or
-// for any other failure cases. It returns zero in case of success.
-int ExceptionTableInfo::ExtabEntryDecode(const uint8_t* buf, size_t buf_size) {
- if (buf == NULL || buf_size == 0)
- return -1;
-
- MemoryRange mr_in(buf, buf_size);
- const uint8_t* buf_initially = buf;
-
-# define GET_BUF_U8(_lval) \
- do { if (!mr_in.Covers(buf - buf_initially, 1)) return -1; \
- (_lval) = *(buf++); } while (0)
-
- const uint8_t* end = buf + buf_size;
-
- while (buf < end) {
- struct arm_ex_to_module::extab_data edata;
- memset(&edata, 0, sizeof(edata));
-
- uint8_t op;
- GET_BUF_U8(op);
- if ((op & 0xc0) == 0x00) {
- // vsp = vsp + (xxxxxx << 2) + 4
- edata.cmd = ARM_EXIDX_CMD_ADD_TO_VSP;
- edata.data = (((int)op & 0x3f) << 2) + 4;
- } else if ((op & 0xc0) == 0x40) {
- // vsp = vsp - (xxxxxx << 2) - 4
- edata.cmd = ARM_EXIDX_CMD_SUB_FROM_VSP;
- edata.data = (((int)op & 0x3f) << 2) + 4;
- } else if ((op & 0xf0) == 0x80) {
- uint8_t op2;
- GET_BUF_U8(op2);
- if (op == 0x80 && op2 == 0x00) {
- // Refuse to unwind
- edata.cmd = ARM_EXIDX_CMD_REFUSED;
- } else {
- // Pop up to 12 integer registers under masks {r15-r12},{r11-r4}
- edata.cmd = ARM_EXIDX_CMD_REG_POP;
- edata.data = ((op & 0xf) << 8) | op2;
- edata.data = edata.data << 4;
- }
- } else if ((op & 0xf0) == 0x90) {
- if (op == 0x9d || op == 0x9f) {
- // 9d: Reserved as prefix for ARM register to register moves
- // 9f: Reserved as perfix for Intel Wireless MMX reg to reg moves
- edata.cmd = ARM_EXIDX_CMD_RESERVED;
- } else {
- // Set vsp = r[nnnn]
- edata.cmd = ARM_EXIDX_CMD_REG_TO_SP;
- edata.data = op & 0x0f;
- }
- } else if ((op & 0xf0) == 0xa0) {
- // Pop r4 to r[4+nnn], or
- // Pop r4 to r[4+nnn] and r14 or
- unsigned end = (op & 0x07);
- edata.data = (1 << (end + 1)) - 1;
- edata.data = edata.data << 4;
- if (op & 0x08) edata.data |= 1 << 14;
- edata.cmd = ARM_EXIDX_CMD_REG_POP;
- } else if (op == ARM_EXTBL_OP_FINISH) {
- // Finish
- edata.cmd = ARM_EXIDX_CMD_FINISH;
- buf = end;
- } else if (op == 0xb1) {
- uint8_t op2;
- GET_BUF_U8(op2);
- if (op2 == 0 || (op2 & 0xf0)) {
- // Spare
- edata.cmd = ARM_EXIDX_CMD_RESERVED;
- } else {
- // Pop integer registers under mask {r3,r2,r1,r0}
- edata.cmd = ARM_EXIDX_CMD_REG_POP;
- edata.data = op2 & 0x0f;
- }
- } else if (op == 0xb2) {
- // vsp = vsp + 0x204 + (uleb128 << 2)
- uint64_t offset = 0;
- uint8_t byte, shift = 0;
- do {
- GET_BUF_U8(byte);
- offset |= (byte & 0x7f) << shift;
- shift += 7;
- } while ((byte & 0x80) && buf < end);
- edata.data = offset * 4 + 0x204;
- edata.cmd = ARM_EXIDX_CMD_ADD_TO_VSP;
- } else if (op == 0xb3 || op == 0xc8 || op == 0xc9) {
- // b3: Pop VFP regs D[ssss] to D[ssss+cccc], FSTMFDX-ishly
- // c8: Pop VFP regs D[16+ssss] to D[16+ssss+cccc], FSTMFDD-ishly
- // c9: Pop VFP regs D[ssss] to D[ssss+cccc], FSTMFDD-ishly
- edata.cmd = ARM_EXIDX_CMD_VFP_POP;
- GET_BUF_U8(edata.data);
- if (op == 0xc8) edata.data |= ARM_EXIDX_VFP_SHIFT_16;
- if (op != 0xb3) edata.data |= ARM_EXIDX_VFP_FSTMD;
- } else if ((op & 0xf8) == 0xb8 || (op & 0xf8) == 0xd0) {
- // b8: Pop VFP regs D[8] to D[8+nnn], FSTMFDX-ishly
- // d0: Pop VFP regs D[8] to D[8+nnn], FSTMFDD-ishly
- edata.cmd = ARM_EXIDX_CMD_VFP_POP;
- edata.data = 0x80 | (op & 0x07);
- if ((op & 0xf8) == 0xd0) edata.data |= ARM_EXIDX_VFP_FSTMD;
- } else if (op >= 0xc0 && op <= 0xc5) {
- // Intel Wireless MMX pop wR[10]-wr[10+nnn], nnn != 6,7
- edata.cmd = ARM_EXIDX_CMD_WREG_POP;
- edata.data = 0xa0 | (op & 0x07);
- } else if (op == 0xc6) {
- // Intel Wireless MMX pop wR[ssss] to wR[ssss+cccc]
- edata.cmd = ARM_EXIDX_CMD_WREG_POP;
- GET_BUF_U8(edata.data);
- } else if (op == 0xc7) {
- uint8_t op2;
- GET_BUF_U8(op2);
- if (op2 == 0 || (op2 & 0xf0)) {
- // Spare
- edata.cmd = ARM_EXIDX_CMD_RESERVED;
- } else {
- // Intel Wireless MMX pop wCGR registers under mask {wCGR3,2,1,0}
- edata.cmd = ARM_EXIDX_CMD_WCGR_POP;
- edata.data = op2 & 0x0f;
- }
- } else {
- // Spare
- edata.cmd = ARM_EXIDX_CMD_RESERVED;
- }
-
- int ret = handler_->ImproveStackFrame(&edata);
- if (ret < 0)
- return ret;
- }
- return 0;
-
-# undef GET_BUF_U8
-}
-
-void ExceptionTableInfo::Start() {
- const struct exidx_entry* start
- = reinterpret_cast<const struct exidx_entry*>(mr_exidx_.data());
- const struct exidx_entry* end
- = reinterpret_cast<const struct exidx_entry*>(mr_exidx_.data()
- + mr_exidx_.length());
-
- // Iterate over each of the EXIDX entries (pairs of 32-bit words).
- // These occupy the entire .exidx section.
- for (const struct exidx_entry* entry = start; entry < end; ++entry) {
- // Figure out the code address range that this table entry is
- // associated with.
- uint32_t addr = (reinterpret_cast<char*>(Prel31ToAddr(&entry->addr))
- - mapping_addr_ + loading_addr_) & 0x7fffffff;
- uint32_t next_addr;
- if (entry < end - 1) {
- next_addr = (reinterpret_cast<char*>(Prel31ToAddr(&((entry + 1)->addr)))
- - mapping_addr_ + loading_addr_) & 0x7fffffff;
- } else {
- // This is the last EXIDX entry in the sequence, so we don't
- // have an address for the start of the next function, to limit
- // this one. Instead use the address of the last byte of the
- // text section associated with this .exidx section, that we
- // have been given. So as to avoid junking up the CFI unwind
- // tables with absurdly large address ranges in the case where
- // text_last_svma_ is wrong, only use the value if it is nonzero
- // and within one page of |addr|. Otherwise assume a length of 1.
- //
- // In some cases, gcc has been observed to finish the exidx
- // section with an entry of length 1 marked CANT_UNWIND,
- // presumably exactly for the purpose of giving a definite
- // length for the last real entry, without having to look at
- // text segment boundaries.
- bool plausible = false;
- next_addr = addr + 1;
- if (text_last_svma_ != 0) {
- uint32_t maybe_next_addr = text_last_svma_ + 1;
- if (maybe_next_addr > addr && maybe_next_addr - addr <= 4096) {
- next_addr = maybe_next_addr;
- plausible = true;
- }
- }
- if (!plausible) {
- fprintf(stderr, "ExceptionTableInfo: implausible EXIDX last entry size "
- "%d, using 1 instead.", (int32_t)(text_last_svma_ - addr));
- }
- }
-
- // Extract the unwind info into |buf|. This might fail for
- // various reasons. It involves reading both the .exidx and
- // .extab sections. All accesses to those sections are
- // bounds-checked.
- uint8_t buf[ARM_EXIDX_TABLE_LIMIT];
- size_t buf_used = 0;
- ExExtractResult res = ExtabEntryExtract(entry, buf, sizeof(buf), &buf_used);
- if (res != ExSuccess) {
- // Couldn't extract the unwind info, for some reason. Move on.
- switch (res) {
- case ExInBufOverflow:
- fprintf(stderr, "ExtabEntryExtract: .exidx/.extab section overrun");
- break;
- case ExOutBufOverflow:
- fprintf(stderr, "ExtabEntryExtract: bytecode buffer overflow");
- break;
- case ExCantUnwind:
- fprintf(stderr, "ExtabEntryExtract: function is marked CANT_UNWIND");
- break;
- case ExCantRepresent:
- fprintf(stderr, "ExtabEntryExtract: bytecode can't be represented");
- break;
- case ExInvalid:
- fprintf(stderr, "ExtabEntryExtract: index table entry is invalid");
- break;
- default:
- fprintf(stderr, "ExtabEntryExtract: unknown error: %d", (int)res);
- break;
- }
- continue;
- }
-
- // Finally, work through the unwind instructions in |buf| and
- // create CFI entries that Breakpad can use. This can also fail.
- // First, add a new stack frame entry, into which ExtabEntryDecode
- // will write the CFI entries.
- if (!handler_->HasStackFrame(addr, next_addr - addr)) {
- handler_->AddStackFrame(addr, next_addr - addr);
- int ret = ExtabEntryDecode(buf, buf_used);
- if (ret < 0) {
- handler_->DeleteStackFrame();
- fprintf(stderr, "ExtabEntryDecode: failed with error code: %d", ret);
- continue;
- }
- handler_->SubmitStackFrame();
- }
-
- } /* iterating over .exidx */
-}
-
-} // namespace arm_ex_reader
diff --git a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.h b/toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.h
deleted file mode 100644
index 9b54e8a0be..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_reader.h
+++ /dev/null
@@ -1,114 +0,0 @@
-/* libunwind - a platform-independent unwind library
- Copyright 2011 Linaro Limited
-
-This file is part of libunwind.
-
-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. */
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Derived from libunwind, with extensive modifications.
-
-#ifndef COMMON_ARM_EX_READER_H__
-#define COMMON_ARM_EX_READER_H__
-
-#include "common/arm_ex_to_module.h"
-#include "common/memory_range.h"
-
-namespace arm_ex_reader {
-
-// This class is a reader for ARM unwind information
-// from .ARM.exidx and .ARM.extab sections.
-class ExceptionTableInfo {
- public:
- ExceptionTableInfo(const char* exidx, size_t exidx_size,
- const char* extab, size_t extab_size,
- uint32_t text_last_svma,
- arm_ex_to_module::ARMExToModule* handler,
- const char* mapping_addr,
- uint32_t loading_addr)
- : mr_exidx_(google_breakpad::MemoryRange(exidx, exidx_size)),
- mr_extab_(google_breakpad::MemoryRange(extab, extab_size)),
- text_last_svma_(text_last_svma),
- handler_(handler), mapping_addr_(mapping_addr),
- loading_addr_(loading_addr) { }
-
- ~ExceptionTableInfo() { }
-
- // Parses the entries in .ARM.exidx and possibly
- // in .ARM.extab tables, reports what we find to
- // arm_ex_to_module::ARMExToModule.
- void Start();
-
- private:
- google_breakpad::MemoryRange mr_exidx_;
- google_breakpad::MemoryRange mr_extab_;
- uint32_t text_last_svma_;
- arm_ex_to_module::ARMExToModule* handler_;
- const char* mapping_addr_;
- uint32_t loading_addr_;
-
- enum ExExtractResult {
- ExSuccess, // success
- ExInBufOverflow, // out-of-range while reading .exidx
- ExOutBufOverflow, // output buffer is too small
- ExCantUnwind, // this function is marked CANT_UNWIND
- ExCantRepresent, // entry valid, but we can't represent it
- ExInvalid // entry is invalid
- };
- ExExtractResult
- ExtabEntryExtract(const struct arm_ex_to_module::exidx_entry* entry,
- uint8_t* buf, size_t buf_size,
- size_t* buf_used);
-
- int ExtabEntryDecode(const uint8_t* buf, size_t buf_size);
-};
-
-} // namespace arm_ex_reader
-
-#endif // COMMON_ARM_EX_READER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.cc
deleted file mode 100644
index c326744f64..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.cc
+++ /dev/null
@@ -1,209 +0,0 @@
-
-/* libunwind - a platform-independent unwind library
- Copyright 2011 Linaro Limited
-
-This file is part of libunwind.
-
-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. */
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Derived from libunwind, with extensive modifications.
-
-#include "common/arm_ex_to_module.h"
-
-#include <stdio.h>
-#include <assert.h>
-
-// For big-picture comments on how the EXIDX reader works,
-// see arm_ex_reader.cc.
-
-#define ARM_EXBUF_START(x) (((x) >> 4) & 0x0f)
-#define ARM_EXBUF_COUNT(x) ((x) & 0x0f)
-#define ARM_EXBUF_END(x) (ARM_EXBUF_START(x) + ARM_EXBUF_COUNT(x))
-
-using google_breakpad::Module;
-
-namespace arm_ex_to_module {
-
-static const char* const regnames[] = {
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc",
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
- "fps", "cpsr"
-};
-
-// Translate command from extab_data to command for Module.
-int ARMExToModule::TranslateCmd(const struct extab_data* edata,
- Module::StackFrameEntry* entry, string& vsp) {
- int ret = 0;
- switch (edata->cmd) {
- case ARM_EXIDX_CMD_FINISH:
- /* Copy LR to PC if there isn't currently a rule for PC in force. */
- if (entry->initial_rules.find("pc")
- == entry->initial_rules.end()) {
- if (entry->initial_rules.find("lr")
- == entry->initial_rules.end()) {
- entry->initial_rules["pc"] = "lr";
- } else {
- entry->initial_rules["pc"] = entry->initial_rules["lr"];
- }
- }
- break;
- case ARM_EXIDX_CMD_SUB_FROM_VSP:
- {
- char c[16];
- sprintf(c, " %d -", edata->data);
- vsp += c;
- }
- break;
- case ARM_EXIDX_CMD_ADD_TO_VSP:
- {
- char c[16];
- sprintf(c, " %d +", edata->data);
- vsp += c;
- }
- break;
- case ARM_EXIDX_CMD_REG_POP:
- for (unsigned int i = 0; i < 16; i++) {
- if (edata->data & (1 << i)) {
- entry->initial_rules[regnames[i]]
- = vsp + " ^";
- vsp += " 4 +";
- }
- }
- /* Set cfa in case the SP got popped. */
- if (edata->data & (1 << 13)) {
- vsp = entry->initial_rules["sp"];
- }
- break;
- case ARM_EXIDX_CMD_REG_TO_SP: {
- assert (edata->data < 16);
- const char* const regname = regnames[edata->data];
- if (entry->initial_rules.find(regname) == entry->initial_rules.end()) {
- entry->initial_rules["sp"] = regname;
- } else {
- entry->initial_rules["sp"] = entry->initial_rules[regname];
- }
- vsp = entry->initial_rules["sp"];
- break;
- }
- case ARM_EXIDX_CMD_VFP_POP:
- /* Don't recover VFP registers, but be sure to adjust the stack
- pointer. */
- for (unsigned int i = ARM_EXBUF_START(edata->data);
- i <= ARM_EXBUF_END(edata->data); i++) {
- vsp += " 8 +";
- }
- if (!(edata->data & ARM_EXIDX_VFP_FSTMD)) {
- vsp += " 4 +";
- }
- break;
- case ARM_EXIDX_CMD_WREG_POP:
- for (unsigned int i = ARM_EXBUF_START(edata->data);
- i <= ARM_EXBUF_END(edata->data); i++) {
- vsp += " 8 +";
- }
- break;
- case ARM_EXIDX_CMD_WCGR_POP:
- // Pop wCGR registers under mask {wCGR3,2,1,0}, hence "i < 4"
- for (unsigned int i = 0; i < 4; i++) {
- if (edata->data & (1 << i)) {
- vsp += " 4 +";
- }
- }
- break;
- case ARM_EXIDX_CMD_REFUSED:
- case ARM_EXIDX_CMD_RESERVED:
- ret = -1;
- break;
- }
- return ret;
-}
-
-bool ARMExToModule::HasStackFrame(uintptr_t addr, size_t size) {
- // Invariant: the range [addr,covered) is covered by existing stack
- // frame entries.
- uintptr_t covered = addr;
- while (covered < addr + size) {
- const Module::StackFrameEntry *old_entry =
- module_->FindStackFrameEntryByAddress(covered);
- if (!old_entry) {
- return false;
- }
- covered = old_entry->address + old_entry->size;
- }
- return true;
-}
-
-void ARMExToModule::AddStackFrame(uintptr_t addr, size_t size) {
- stack_frame_entry_ = new Module::StackFrameEntry;
- stack_frame_entry_->address = addr;
- stack_frame_entry_->size = size;
- stack_frame_entry_->initial_rules[".cfa"] = "sp";
- vsp_ = "sp";
-}
-
-int ARMExToModule::ImproveStackFrame(const struct extab_data* edata) {
- return TranslateCmd(edata, stack_frame_entry_, vsp_) ;
-}
-
-void ARMExToModule::DeleteStackFrame() {
- delete stack_frame_entry_;
-}
-
-void ARMExToModule::SubmitStackFrame() {
- // return address always winds up in pc
- stack_frame_entry_->initial_rules[".ra"]
- = stack_frame_entry_->initial_rules["pc"];
- // the final value of vsp is the new value of sp
- stack_frame_entry_->initial_rules["sp"] = vsp_;
- module_->AddStackFrameEntry(stack_frame_entry_);
-}
-
-} // namespace arm_ex_to_module
diff --git a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.h
deleted file mode 100644
index f413a16a93..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/arm_ex_to_module.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* libunwind - a platform-independent unwind library
- Copyright 2011 Linaro Limited
-
-This file is part of libunwind.
-
-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. */
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Derived from libunwind, with extensive modifications.
-
-#ifndef COMMON_ARM_EX_TO_MODULE__
-#define COMMON_ARM_EX_TO_MODULE__
-
-#include "common/module.h"
-
-#include <string.h>
-
-namespace arm_ex_to_module {
-
-using google_breakpad::Module;
-
-typedef enum extab_cmd {
- ARM_EXIDX_CMD_FINISH,
- ARM_EXIDX_CMD_SUB_FROM_VSP,
- ARM_EXIDX_CMD_ADD_TO_VSP,
- ARM_EXIDX_CMD_REG_POP,
- ARM_EXIDX_CMD_REG_TO_SP,
- ARM_EXIDX_CMD_VFP_POP,
- ARM_EXIDX_CMD_WREG_POP,
- ARM_EXIDX_CMD_WCGR_POP,
- ARM_EXIDX_CMD_RESERVED,
- ARM_EXIDX_CMD_REFUSED,
-} extab_cmd_t;
-
-struct exidx_entry {
- uint32_t addr;
- uint32_t data;
-};
-
-struct extab_data {
- extab_cmd_t cmd;
- uint32_t data;
-};
-
-enum extab_cmd_flags {
- ARM_EXIDX_VFP_SHIFT_16 = 1 << 16,
- ARM_EXIDX_VFP_FSTMD = 1 << 17, // distinguishes FSTMxxD from FSTMxxX
-};
-
-// Receives information from arm_ex_reader::ExceptionTableInfo
-// and adds it to the Module object
-class ARMExToModule {
- public:
- ARMExToModule(Module* module)
- : module_(module) { }
- ~ARMExToModule() { }
- bool HasStackFrame(uintptr_t addr, size_t size);
- void AddStackFrame(uintptr_t addr, size_t size);
- int ImproveStackFrame(const struct extab_data* edata);
- void DeleteStackFrame();
- void SubmitStackFrame();
- private:
- Module* module_;
- Module::StackFrameEntry* stack_frame_entry_;
- string vsp_;
- int TranslateCmd(const struct extab_data* edata,
- Module::StackFrameEntry* entry,
- string& vsp);
-};
-
-} // namespace arm_ex_to_module
-
-#endif // COMMON_ARM_EX_TO_MODULE__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/basictypes.h b/toolkit/crashreporter/google-breakpad/src/common/basictypes.h
deleted file mode 100644
index 9426c1f6c2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/basictypes.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_BASICTYPES_H_
-#define COMMON_BASICTYPES_H_
-
-// A macro to disallow the copy constructor and operator= functions
-// This should be used in the private: declarations for a class
-#ifndef DISALLOW_COPY_AND_ASSIGN
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
-#endif // DISALLOW_COPY_AND_ASSIGN
-
-namespace google_breakpad {
-
-// Used to explicitly mark the return value of a function as unused. If you are
-// really sure you don't want to do anything with the return value of a function
-// that has been marked with __attribute__((warn_unused_result)), wrap it with
-// this. Example:
-//
-// scoped_ptr<MyType> my_var = ...;
-// if (TakeOwnership(my_var.get()) == SUCCESS)
-// ignore_result(my_var.release());
-//
-template<typename T>
-inline void ignore_result(const T&) {
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_BASICTYPES_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/byte_cursor.h b/toolkit/crashreporter/google-breakpad/src/common/byte_cursor.h
deleted file mode 100644
index accd54e0a4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/byte_cursor.h
+++ /dev/null
@@ -1,265 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// byte_cursor.h: Classes for parsing values from a buffer of bytes.
-// The ByteCursor class provides a convenient interface for reading
-// fixed-size integers of arbitrary endianness, being thorough about
-// checking for buffer overruns.
-
-#ifndef COMMON_BYTE_CURSOR_H_
-#define COMMON_BYTE_CURSOR_H_
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// A buffer holding a series of bytes.
-struct ByteBuffer {
- ByteBuffer() : start(0), end(0) { }
- ByteBuffer(const uint8_t *set_start, size_t set_size)
- : start(set_start), end(set_start + set_size) { }
- ~ByteBuffer() { };
-
- // Equality operators. Useful in unit tests, and when we're using
- // ByteBuffers to refer to regions of a larger buffer.
- bool operator==(const ByteBuffer &that) const {
- return start == that.start && end == that.end;
- }
- bool operator!=(const ByteBuffer &that) const {
- return start != that.start || end != that.end;
- }
-
- // Not C++ style guide compliant, but this definitely belongs here.
- size_t Size() const {
- assert(start <= end);
- return end - start;
- }
-
- const uint8_t *start, *end;
-};
-
-// A cursor pointing into a ByteBuffer that can parse numbers of various
-// widths and representations, strings, and data blocks, advancing through
-// the buffer as it goes. All ByteCursor operations check that accesses
-// haven't gone beyond the end of the enclosing ByteBuffer.
-class ByteCursor {
- public:
- // Create a cursor reading bytes from the start of BUFFER. By default, the
- // cursor reads multi-byte values in little-endian form.
- ByteCursor(const ByteBuffer *buffer, bool big_endian = false)
- : buffer_(buffer), here_(buffer->start),
- big_endian_(big_endian), complete_(true) { }
-
- // Accessor and setter for this cursor's endianness flag.
- bool big_endian() const { return big_endian_; }
- void set_big_endian(bool big_endian) { big_endian_ = big_endian; }
-
- // Accessor and setter for this cursor's current position. The setter
- // returns a reference to this cursor.
- const uint8_t *here() const { return here_; }
- ByteCursor &set_here(const uint8_t *here) {
- assert(buffer_->start <= here && here <= buffer_->end);
- here_ = here;
- return *this;
- }
-
- // Return the number of bytes available to read at the cursor.
- size_t Available() const { return size_t(buffer_->end - here_); }
-
- // Return true if this cursor is at the end of its buffer.
- bool AtEnd() const { return Available() == 0; }
-
- // When used as a boolean value this cursor converts to true if all
- // prior reads have been completed, or false if we ran off the end
- // of the buffer.
- operator bool() const { return complete_; }
-
- // Read a SIZE-byte integer at this cursor, signed if IS_SIGNED is true,
- // unsigned otherwise, using the cursor's established endianness, and set
- // *RESULT to the number. If we read off the end of our buffer, clear
- // this cursor's complete_ flag, and store a dummy value in *RESULT.
- // Return a reference to this cursor.
- template<typename T>
- ByteCursor &Read(size_t size, bool is_signed, T *result) {
- if (CheckAvailable(size)) {
- T v = 0;
- if (big_endian_) {
- for (size_t i = 0; i < size; i++)
- v = (v << 8) + here_[i];
- } else {
- // This loop condition looks weird, but size_t is unsigned, so
- // decrementing i after it is zero yields the largest size_t value.
- for (size_t i = size - 1; i < size; i--)
- v = (v << 8) + here_[i];
- }
- if (is_signed && size < sizeof(T)) {
- size_t sign_bit = (T)1 << (size * 8 - 1);
- v = (v ^ sign_bit) - sign_bit;
- }
- here_ += size;
- *result = v;
- } else {
- *result = (T) 0xdeadbeef;
- }
- return *this;
- }
-
- // Read an integer, using the cursor's established endianness and
- // *RESULT's size and signedness, and set *RESULT to the number. If we
- // read off the end of our buffer, clear this cursor's complete_ flag.
- // Return a reference to this cursor.
- template<typename T>
- ByteCursor &operator>>(T &result) {
- bool T_is_signed = (T)-1 < 0;
- return Read(sizeof(T), T_is_signed, &result);
- }
-
- // Copy the SIZE bytes at the cursor to BUFFER, and advance this
- // cursor to the end of them. If we read off the end of our buffer,
- // clear this cursor's complete_ flag, and set *POINTER to NULL.
- // Return a reference to this cursor.
- ByteCursor &Read(uint8_t *buffer, size_t size) {
- if (CheckAvailable(size)) {
- memcpy(buffer, here_, size);
- here_ += size;
- }
- return *this;
- }
-
- // Set STR to a copy of the '\0'-terminated string at the cursor. If the
- // byte buffer does not contain a terminating zero, clear this cursor's
- // complete_ flag, and set STR to the empty string. Return a reference to
- // this cursor.
- ByteCursor &CString(string *str) {
- const uint8_t *end
- = static_cast<const uint8_t *>(memchr(here_, '\0', Available()));
- if (end) {
- str->assign(reinterpret_cast<const char *>(here_), end - here_);
- here_ = end + 1;
- } else {
- str->clear();
- here_ = buffer_->end;
- complete_ = false;
- }
- return *this;
- }
-
- // Like CString(STR), but extract the string from a fixed-width buffer
- // LIMIT bytes long, which may or may not contain a terminating '\0'
- // byte. Specifically:
- //
- // - If there are not LIMIT bytes available at the cursor, clear the
- // cursor's complete_ flag and set STR to the empty string.
- //
- // - Otherwise, if the LIMIT bytes at the cursor contain any '\0'
- // characters, set *STR to a copy of the bytes before the first '\0',
- // and advance the cursor by LIMIT bytes.
- //
- // - Otherwise, set *STR to a copy of those LIMIT bytes, and advance the
- // cursor by LIMIT bytes.
- ByteCursor &CString(string *str, size_t limit) {
- if (CheckAvailable(limit)) {
- const uint8_t *end
- = static_cast<const uint8_t *>(memchr(here_, '\0', limit));
- if (end)
- str->assign(reinterpret_cast<const char *>(here_), end - here_);
- else
- str->assign(reinterpret_cast<const char *>(here_), limit);
- here_ += limit;
- } else {
- str->clear();
- }
- return *this;
- }
-
- // Set *POINTER to point to the SIZE bytes at the cursor, and advance
- // this cursor to the end of them. If SIZE is omitted, don't move the
- // cursor. If we read off the end of our buffer, clear this cursor's
- // complete_ flag, and set *POINTER to NULL. Return a reference to this
- // cursor.
- ByteCursor &PointTo(const uint8_t **pointer, size_t size = 0) {
- if (CheckAvailable(size)) {
- *pointer = here_;
- here_ += size;
- } else {
- *pointer = NULL;
- }
- return *this;
- }
-
- // Skip SIZE bytes at the cursor. If doing so would advance us off
- // the end of our buffer, clear this cursor's complete_ flag, and
- // set *POINTER to NULL. Return a reference to this cursor.
- ByteCursor &Skip(size_t size) {
- if (CheckAvailable(size))
- here_ += size;
- return *this;
- }
-
- private:
- // If there are at least SIZE bytes available to read from the buffer,
- // return true. Otherwise, set here_ to the end of the buffer, set
- // complete_ to false, and return false.
- bool CheckAvailable(size_t size) {
- if (Available() >= size) {
- return true;
- } else {
- here_ = buffer_->end;
- complete_ = false;
- return false;
- }
- }
-
- // The buffer we're reading bytes from.
- const ByteBuffer *buffer_;
-
- // The next byte within buffer_ that we'll read.
- const uint8_t *here_;
-
- // True if we should read numbers in big-endian form; false if we
- // should read in little-endian form.
- bool big_endian_;
-
- // True if we've been able to read all we've been asked to.
- bool complete_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_BYTE_CURSOR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/byte_cursor_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/byte_cursor_unittest.cc
deleted file mode 100644
index 06bfd89d73..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/byte_cursor_unittest.cc
+++ /dev/null
@@ -1,776 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// byte_cursor_unittest.cc: Unit tests for google_breakpad::ByteBuffer
-// and google_breakpad::ByteCursor.
-
-#include <string>
-
-#include <string.h>
-
-#include "breakpad_googletest_includes.h"
-#include "common/byte_cursor.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::ByteBuffer;
-using google_breakpad::ByteCursor;
-
-TEST(Buffer, SizeOfNothing) {
- uint8_t data[1];
- ByteBuffer buffer(data, 0);
- EXPECT_EQ(0U, buffer.Size());
-}
-
-TEST(Buffer, SizeOfSomething) {
- uint8_t data[10];
- ByteBuffer buffer(data, sizeof(data));
- EXPECT_EQ(10U, buffer.Size());
-}
-
-TEST(Extent, AvailableEmpty) {
- uint8_t data[1];
- ByteBuffer buffer(data, 0);
- ByteCursor cursor(&buffer);
- EXPECT_EQ(0U, cursor.Available());
-}
-
-TEST(Extent, AtEndEmpty) {
- uint8_t data[1];
- ByteBuffer buffer(data, 0);
- ByteCursor cursor(&buffer);
- EXPECT_TRUE(cursor.AtEnd());
-}
-
-TEST(Extent, AsBoolEmpty) {
- uint8_t data[1];
- ByteBuffer buffer(data, 0);
- ByteCursor cursor(&buffer);
- EXPECT_TRUE(cursor);
-}
-
-TEST(Extent, AvailableSome) {
- uint8_t data[10];
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- EXPECT_EQ(10U, cursor.Available());
-}
-
-TEST(Extent, AtEndSome) {
- uint8_t data[10];
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- EXPECT_FALSE(cursor.AtEnd());
- EXPECT_TRUE(cursor.Skip(sizeof(data)).AtEnd());
-}
-
-TEST(Extent, AsBoolSome) {
- uint8_t data[10];
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- EXPECT_TRUE(cursor);
- EXPECT_TRUE(cursor.Skip(sizeof(data)));
- EXPECT_FALSE(cursor.Skip(1));
-}
-
-TEST(Extent, Cursor) {
- uint8_t data[] = { 0xf7,
- 0x9f, 0xbe,
- 0x67, 0xfb, 0xd3, 0x58,
- 0x6f, 0x36, 0xde, 0xd1,
- 0x2a, 0x2a, 0x2a };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
-
- uint8_t a;
- uint16_t b;
- uint32_t c;
- uint32_t d;
- uint8_t stars[3];
-
- EXPECT_EQ(data + 0U, cursor.here());
-
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(data + 1U, cursor.here());
-
- EXPECT_TRUE(cursor >> b);
- EXPECT_EQ(data + 3U, cursor.here());
-
- EXPECT_TRUE(cursor >> c);
- EXPECT_EQ(data + 7U, cursor.here());
-
- EXPECT_TRUE(cursor.Skip(4));
- EXPECT_EQ(data + 11U, cursor.here());
-
- EXPECT_TRUE(cursor.Read(stars, 3));
- EXPECT_EQ(data + 14U, cursor.here());
-
- EXPECT_FALSE(cursor >> d);
- EXPECT_EQ(data + 14U, cursor.here());
-}
-
-TEST(Extent, SetOffset) {
- uint8_t data[] = { 0x5c, 0x79, 0x8c, 0xd5 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
-
- uint8_t a, b, c, d, e;
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(0x5cU, a);
- EXPECT_EQ(data + 1U, cursor.here());
- EXPECT_TRUE(((cursor >> b).set_here(data + 3) >> c).set_here(data + 1)
- >> d >> e);
- EXPECT_EQ(0x79U, b);
- EXPECT_EQ(0xd5U, c);
- EXPECT_EQ(0x79U, d);
- EXPECT_EQ(0x8cU, e);
- EXPECT_EQ(data + 3U, cursor.here());
-}
-
-TEST(BigEndian, Signed1) {
- uint8_t data[] = { 0x00, 0x7f, 0x80, 0xff };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- cursor.set_big_endian(true);
- int a, b, c, d, e;
- ASSERT_TRUE(cursor
- .Read(1, true, &a)
- .Read(1, true, &b)
- .Read(1, true, &c)
- .Read(1, true, &d));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7f, b);
- EXPECT_EQ(-0x80, c);
- EXPECT_EQ(-1, d);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(1, true, &e));
-}
-
-TEST(BigEndian, Signed2) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x80, 0x7f, 0xff,
- 0x80, 0x00, 0x80, 0x80, 0xff, 0xff,
- 0x39, 0xf1, 0x8a, 0xbc, 0x5a, 0xec };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer, true);
- int a, b, c, d, e, f, g, h, i, j;
- ASSERT_TRUE(cursor
- .Read(2, true, &a)
- .Read(2, true, &b)
- .Read(2, true, &c)
- .Read(2, true, &d)
- .Read(2, true, &e)
- .Read(2, true, &f)
- .Read(2, true, &g)
- .Read(2, true, &h)
- .Read(2, true, &i));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x80, b);
- EXPECT_EQ(0x7fff, c);
- EXPECT_EQ(-0x8000, d);
- EXPECT_EQ(-0x7f80, e);
- EXPECT_EQ(-1, f);
- EXPECT_EQ(0x39f1, g);
- EXPECT_EQ(-0x7544, h);
- EXPECT_EQ(0x5aec, i);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(2, true, &j));
-}
-
-TEST(BigEndian, Signed4) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0xff, 0xff, 0xff,
- 0x80, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff,
- 0xb6, 0xb1, 0xff, 0xef,
- 0x19, 0x6a, 0xca, 0x46 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- cursor.set_big_endian(true);
- int64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(4, true, &a)
- .Read(4, true, &b)
- .Read(4, true, &c)
- .Read(4, true, &d)
- .Read(4, true, &e)
- .Read(4, true, &f));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7fffffff, b);
- EXPECT_EQ(-0x80000000LL, c);
- EXPECT_EQ(-1, d);
- EXPECT_EQ((int32_t) 0xb6b1ffef, e);
- EXPECT_EQ(0x196aca46, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(4, true, &g));
-}
-
-TEST(BigEndian, Signed8) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x93, 0x20, 0xd5, 0xe9, 0xd2, 0xd5, 0x87, 0x9c,
- 0x4e, 0x42, 0x49, 0xd2, 0x7f, 0x84, 0x14, 0xa4 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer, true);
- int64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(8, true, &a)
- .Read(8, true, &b)
- .Read(8, true, &c)
- .Read(8, true, &d)
- .Read(8, true, &e)
- .Read(8, true, &f));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7fffffffffffffffLL, b);
- EXPECT_EQ(-0x7fffffffffffffffLL - 1, c);
- EXPECT_EQ(-1, d);
- EXPECT_EQ((int64_t) 0x9320d5e9d2d5879cULL, e);
- EXPECT_EQ(0x4e4249d27f8414a4LL, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(8, true, &g));
-}
-
-TEST(BigEndian, Unsigned1) {
- uint8_t data[] = { 0x00, 0x7f, 0x80, 0xff };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- cursor.set_big_endian(true);
- int32_t a, b, c, d, e;
- ASSERT_TRUE(cursor
- .Read(1, false, &a)
- .Read(1, false, &b)
- .Read(1, false, &c)
- .Read(1, false, &d));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7f, b);
- EXPECT_EQ(0x80, c);
- EXPECT_EQ(0xff, d);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(1, false, &e));
-}
-
-TEST(BigEndian, Unsigned2) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x80, 0x7f, 0xff,
- 0x80, 0x00, 0x80, 0x80, 0xff, 0xff,
- 0x39, 0xf1, 0x8a, 0xbc, 0x5a, 0xec };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer, true);
- int64_t a, b, c, d, e, f, g, h, i, j;
- ASSERT_TRUE(cursor
- .Read(2, false, &a)
- .Read(2, false, &b)
- .Read(2, false, &c)
- .Read(2, false, &d)
- .Read(2, false, &e)
- .Read(2, false, &f)
- .Read(2, false, &g)
- .Read(2, false, &h)
- .Read(2, false, &i));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x80, b);
- EXPECT_EQ(0x7fff, c);
- EXPECT_EQ(0x8000, d);
- EXPECT_EQ(0x8080, e);
- EXPECT_EQ(0xffff, f);
- EXPECT_EQ(0x39f1, g);
- EXPECT_EQ(0x8abc, h);
- EXPECT_EQ(0x5aec, i);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(2, false, &j));
-}
-
-TEST(BigEndian, Unsigned4) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0xff, 0xff, 0xff,
- 0x80, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff,
- 0xb6, 0xb1, 0xff, 0xef,
- 0x19, 0x6a, 0xca, 0x46 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- cursor.set_big_endian(true);
- int64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(4, false, &a)
- .Read(4, false, &b)
- .Read(4, false, &c)
- .Read(4, false, &d)
- .Read(4, false, &e)
- .Read(4, false, &f));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7fffffff, b);
- EXPECT_EQ(0x80000000, c);
- EXPECT_EQ(0xffffffff, d);
- EXPECT_EQ(0xb6b1ffef, e);
- EXPECT_EQ(0x196aca46, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(4, false, &g));
-}
-
-TEST(BigEndian, Unsigned8) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x93, 0x20, 0xd5, 0xe9, 0xd2, 0xd5, 0x87, 0x9c,
- 0x4e, 0x42, 0x49, 0xd2, 0x7f, 0x84, 0x14, 0xa4 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer, true);
- uint64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(8, false, &a)
- .Read(8, false, &b)
- .Read(8, false, &c)
- .Read(8, false, &d)
- .Read(8, false, &e)
- .Read(8, false, &f));
- EXPECT_EQ(0U, a);
- EXPECT_EQ(0x7fffffffffffffffULL, b);
- EXPECT_EQ(0x8000000000000000ULL, c);
- EXPECT_EQ(0xffffffffffffffffULL, d);
- EXPECT_EQ(0x9320d5e9d2d5879cULL, e);
- EXPECT_EQ(0x4e4249d27f8414a4ULL, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(8, false, &g));
-}
-
-TEST(LittleEndian, Signed1) {
- uint8_t data[] = { 0x00, 0x7f, 0x80, 0xff };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int32_t a, b, c, d, e;
- ASSERT_TRUE(cursor
- .Read(1, true, &a)
- .Read(1, true, &b)
- .Read(1, true, &c)
- .Read(1, true, &d));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7f, b);
- EXPECT_EQ(-0x80, c);
- EXPECT_EQ(-1, d);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(1, true, &e));
-}
-
-TEST(LittleEndian, Signed2) {
- uint8_t data[] = { 0x00, 0x00, 0x80, 0x00, 0xff, 0x7f,
- 0x00, 0x80, 0x80, 0x80, 0xff, 0xff,
- 0xf1, 0x39, 0xbc, 0x8a, 0xec, 0x5a };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer, false);
- int32_t a, b, c, d, e, f, g, h, i, j;
- ASSERT_TRUE(cursor
- .Read(2, true, &a)
- .Read(2, true, &b)
- .Read(2, true, &c)
- .Read(2, true, &d)
- .Read(2, true, &e)
- .Read(2, true, &f)
- .Read(2, true, &g)
- .Read(2, true, &h)
- .Read(2, true, &i));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x80, b);
- EXPECT_EQ(0x7fff, c);
- EXPECT_EQ(-0x8000, d);
- EXPECT_EQ(-0x7f80, e);
- EXPECT_EQ(-1, f);
- EXPECT_EQ(0x39f1, g);
- EXPECT_EQ(-0x7544, h);
- EXPECT_EQ(0x5aec, i);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(2, true, &j));
-}
-
-TEST(LittleEndian, Signed4) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0x7f,
- 0x00, 0x00, 0x00, 0x80,
- 0xff, 0xff, 0xff, 0xff,
- 0xef, 0xff, 0xb1, 0xb6,
- 0x46, 0xca, 0x6a, 0x19 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(4, true, &a)
- .Read(4, true, &b)
- .Read(4, true, &c)
- .Read(4, true, &d)
- .Read(4, true, &e)
- .Read(4, true, &f));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7fffffff, b);
- EXPECT_EQ(-0x80000000LL, c);
- EXPECT_EQ(-1, d);
- EXPECT_EQ((int32_t) 0xb6b1ffef, e);
- EXPECT_EQ(0x196aca46, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(4, true, &g));
-}
-
-TEST(LittleEndian, Signed8) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x9c, 0x87, 0xd5, 0xd2, 0xe9, 0xd5, 0x20, 0x93,
- 0xa4, 0x14, 0x84, 0x7f, 0xd2, 0x49, 0x42, 0x4e };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer, false);
- int64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(8, true, &a)
- .Read(8, true, &b)
- .Read(8, true, &c)
- .Read(8, true, &d)
- .Read(8, true, &e)
- .Read(8, true, &f));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7fffffffffffffffLL, b);
- EXPECT_EQ(-0x7fffffffffffffffLL - 1, c);
- EXPECT_EQ(-1, d);
- EXPECT_EQ((int64_t) 0x9320d5e9d2d5879cULL, e);
- EXPECT_EQ(0x4e4249d27f8414a4LL, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(8, true, &g));
-}
-
-TEST(LittleEndian, Unsigned1) {
- uint8_t data[] = { 0x00, 0x7f, 0x80, 0xff };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int32_t a, b, c, d, e;
- ASSERT_TRUE(cursor
- .Read(1, false, &a)
- .Read(1, false, &b)
- .Read(1, false, &c)
- .Read(1, false, &d));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7f, b);
- EXPECT_EQ(0x80, c);
- EXPECT_EQ(0xff, d);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(1, false, &e));
-}
-
-TEST(LittleEndian, Unsigned2) {
- uint8_t data[] = { 0x00, 0x00, 0x80, 0x00, 0xff, 0x7f,
- 0x00, 0x80, 0x80, 0x80, 0xff, 0xff,
- 0xf1, 0x39, 0xbc, 0x8a, 0xec, 0x5a };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int32_t a, b, c, d, e, f, g, h, i, j;
- ASSERT_TRUE(cursor
- .Read(2, false, &a)
- .Read(2, false, &b)
- .Read(2, false, &c)
- .Read(2, false, &d)
- .Read(2, false, &e)
- .Read(2, false, &f)
- .Read(2, false, &g)
- .Read(2, false, &h)
- .Read(2, false, &i));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x80, b);
- EXPECT_EQ(0x7fff, c);
- EXPECT_EQ(0x8000, d);
- EXPECT_EQ(0x8080, e);
- EXPECT_EQ(0xffff, f);
- EXPECT_EQ(0x39f1, g);
- EXPECT_EQ(0x8abc, h);
- EXPECT_EQ(0x5aec, i);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(2, false, &j));
-}
-
-TEST(LittleEndian, Unsigned4) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0x7f,
- 0x00, 0x00, 0x00, 0x80,
- 0xff, 0xff, 0xff, 0xff,
- 0xef, 0xff, 0xb1, 0xb6,
- 0x46, 0xca, 0x6a, 0x19 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(4, false, &a)
- .Read(4, false, &b)
- .Read(4, false, &c)
- .Read(4, false, &d)
- .Read(4, false, &e)
- .Read(4, false, &f));
- EXPECT_EQ(0, a);
- EXPECT_EQ(0x7fffffff, b);
- EXPECT_EQ(0x80000000, c);
- EXPECT_EQ(0xffffffff, d);
- EXPECT_EQ(0xb6b1ffef, e);
- EXPECT_EQ(0x196aca46, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(4, false, &g));
-}
-
-TEST(LittleEndian, Unsigned8) {
- uint8_t data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x9c, 0x87, 0xd5, 0xd2, 0xe9, 0xd5, 0x20, 0x93,
- 0xa4, 0x14, 0x84, 0x7f, 0xd2, 0x49, 0x42, 0x4e };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- uint64_t a, b, c, d, e, f, g;
- ASSERT_TRUE(cursor
- .Read(8, false, &a)
- .Read(8, false, &b)
- .Read(8, false, &c)
- .Read(8, false, &d)
- .Read(8, false, &e)
- .Read(8, false, &f));
- EXPECT_EQ(0U, a);
- EXPECT_EQ(0x7fffffffffffffffULL, b);
- EXPECT_EQ(0x8000000000000000ULL, c);
- EXPECT_EQ(0xffffffffffffffffULL, d);
- EXPECT_EQ(0x9320d5e9d2d5879cULL, e);
- EXPECT_EQ(0x4e4249d27f8414a4ULL, f);
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor.Read(8, false, &g));
-}
-
-TEST(Extractor, Signed1) {
- uint8_t data[] = { 0xfd };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int8_t a;
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(-3, a);
- EXPECT_FALSE(cursor >> a);
-}
-
-TEST(Extractor, Signed2) {
- uint8_t data[] = { 0x13, 0xcd };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int16_t a;
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(-13037, a);
- EXPECT_FALSE(cursor >> a);
-}
-
-TEST(Extractor, Signed4) {
- uint8_t data[] = { 0xd2, 0xe4, 0x53, 0xe9 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- int32_t a;
- // For some reason, G++ 4.4.1 complains:
- // warning: array subscript is above array bounds
- // in ByteCursor::Read(size_t, bool, T *) as it inlines this call, but
- // I'm not able to see how such a reference would occur.
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(-380377902, a);
- EXPECT_FALSE(cursor >> a);
-}
-
-TEST(Extractor, Unsigned1) {
- uint8_t data[] = { 0xfd };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- uint8_t a;
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(0xfd, a);
- EXPECT_FALSE(cursor >> a);
-}
-
-TEST(Extractor, Unsigned2) {
- uint8_t data[] = { 0x13, 0xcd };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- uint16_t a;
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(0xcd13, a);
- EXPECT_FALSE(cursor >> a);
-}
-
-TEST(Extractor, Unsigned4) {
- uint8_t data[] = { 0xd2, 0xe4, 0x53, 0xe9 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- uint32_t a;
- // For some reason, G++ 4.4.1 complains:
- // warning: array subscript is above array bounds
- // in ByteCursor::Read(size_t, bool, T *) as it inlines this call, but
- // I'm not able to see how such a reference would occur.
- EXPECT_TRUE(cursor >> a);
- EXPECT_EQ(0xe953e4d2, a);
- EXPECT_FALSE(cursor >> a);
- EXPECT_FALSE(cursor >> a);
-}
-
-TEST(Extractor, Mixed) {
- uint8_t data[] = { 0x42,
- 0x25, 0x0b,
- 0x3d, 0x25, 0xed, 0x2a,
- 0xec, 0x16, 0x9e, 0x14, 0x61, 0x5b, 0x2c, 0xcf,
- 0xd8,
- 0x22, 0xa5,
- 0x3a, 0x02, 0x6a, 0xd7,
- 0x93, 0x2a, 0x2d, 0x8d, 0xb4, 0x95, 0xe0, 0xc6 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
- cursor.set_big_endian(true);
-
- uint8_t a;
- uint16_t b;
- uint32_t c;
- uint64_t d;
- int8_t e;
- int16_t f;
- int32_t g;
- int64_t h;
- int z;
- EXPECT_FALSE(cursor.AtEnd());
- EXPECT_TRUE(cursor >> a >> b >> c >> d >> e >> f >> g >> h);
- EXPECT_EQ(0x42U, a);
- EXPECT_EQ(0x250bU, b);
- EXPECT_EQ(0x3d25ed2aU, c);
- EXPECT_EQ(0xec169e14615b2ccfULL, d);
- EXPECT_EQ(-40, e);
- EXPECT_EQ(0x22a5, f);
- EXPECT_EQ(0x3a026ad7, g);
- EXPECT_EQ(-7842405714468937530LL, h);
-
- EXPECT_TRUE(cursor.AtEnd());
- EXPECT_FALSE(cursor >> z);
-}
-
-TEST(Strings, Zero) {
- uint8_t data[] = { 0xa6 };
- ByteBuffer buffer(data, 0);
- ByteCursor cursor(&buffer);
-
- uint8_t received[1];
- received[0] = 0xc2;
- EXPECT_TRUE(cursor.Read(received, 0));
- EXPECT_EQ(0xc2U, received[0]);
-}
-
-TEST(Strings, Some) {
- uint8_t data[] = { 0x5d, 0x31, 0x09, 0xa6, 0x2e, 0x2c, 0x83, 0xbb };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
-
- uint8_t received[7] = { 0xa7, 0xf7, 0x43, 0x0c, 0x27, 0xea, 0xed };
- EXPECT_TRUE(cursor.Skip(2).Read(received, 5));
- uint8_t expected[7] = { 0x09, 0xa6, 0x2e, 0x2c, 0x83, 0xea, 0xed };
- EXPECT_TRUE(memcmp(received, expected, 7) == 0);
-}
-
-TEST(Strings, TooMuch) {
- uint8_t data[] = { 0x5d, 0x31, 0x09, 0xa6, 0x2e, 0x2c, 0x83, 0xbb };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
-
- uint8_t received1[3];
- uint8_t received2[3];
- uint8_t received3[3];
- EXPECT_FALSE(cursor
- .Read(received1, 3)
- .Read(received2, 3)
- .Read(received3, 3));
- uint8_t expected1[3] = { 0x5d, 0x31, 0x09 };
- uint8_t expected2[3] = { 0xa6, 0x2e, 0x2c };
-
- EXPECT_TRUE(memcmp(received1, expected1, 3) == 0);
- EXPECT_TRUE(memcmp(received2, expected2, 3) == 0);
-}
-
-TEST(Strings, PointTo) {
- uint8_t data[] = { 0x83, 0x80, 0xb4, 0x38, 0x00, 0x2c, 0x0a, 0x27 };
- ByteBuffer buffer(data, sizeof(data));
- ByteCursor cursor(&buffer);
-
- const uint8_t *received1;
- const uint8_t *received2;
- const uint8_t *received3;
- const uint8_t *received4;
- EXPECT_FALSE(cursor
- .PointTo(&received1, 3)
- .PointTo(&received2, 3)
- .PointTo(&received3)
- .PointTo(&received4, 3));
- EXPECT_EQ(data + 0, received1);
- EXPECT_EQ(data + 3, received2);
- EXPECT_EQ(data + 6, received3);
- EXPECT_EQ(NULL, received4);
-}
-
-TEST(Strings, CString) {
- uint8_t data[] = "abc\0\0foo";
- ByteBuffer buffer(data, sizeof(data) - 1); // don't include terminating '\0'
- ByteCursor cursor(&buffer);
-
- string a, b, c;
- EXPECT_TRUE(cursor.CString(&a).CString(&b));
- EXPECT_EQ("abc", a);
- EXPECT_EQ("", b);
- EXPECT_FALSE(cursor.CString(&c));
- EXPECT_EQ("", c);
- EXPECT_TRUE(cursor.AtEnd());
-}
-
-TEST(Strings, CStringLimit) {
- uint8_t data[] = "abcdef\0\0foobar";
- ByteBuffer buffer(data, sizeof(data) - 1); // don't include terminating '\0'
- ByteCursor cursor(&buffer);
-
- string a, b, c, d, e;
-
- EXPECT_TRUE(cursor.CString(&a, 3));
- EXPECT_EQ("abc", a);
-
- EXPECT_TRUE(cursor.CString(&b, 0));
- EXPECT_EQ("", b);
-
- EXPECT_TRUE(cursor.CString(&c, 6));
- EXPECT_EQ("def", c);
-
- EXPECT_TRUE(cursor.CString(&d, 4));
- EXPECT_EQ("ooba", d);
-
- EXPECT_FALSE(cursor.CString(&e, 4));
- EXPECT_EQ("", e);
-
- EXPECT_TRUE(cursor.AtEnd());
-}
-
-// uint8_t data[] = { 0xa6, 0x54, 0xdf, 0x67, 0x51, 0x43, 0xac, 0xf1 };
-// ByteBuffer buffer(data, sizeof(data));
diff --git a/toolkit/crashreporter/google-breakpad/src/common/common.gyp b/toolkit/crashreporter/google-breakpad/src/common/common.gyp
deleted file mode 100644
index 08772bf756..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/common.gyp
+++ /dev/null
@@ -1,250 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'target_defaults': {
- 'target_conditions': [
- ['OS=="mac"', {
- 'defines': ['HAVE_MACH_O_NLIST_H'],
- }],
- ['OS=="linux"', {
- 'defines': ['HAVE_A_OUT_H'],
- }],
- ['OS!="android"', {'sources/': [['exclude', '(^|/)android/']]}],
- ['OS!="linux"', {'sources/': [['exclude', '(^|/)linux/']]}],
- ['OS!="mac"', {'sources/': [['exclude', '(^|/)mac/']]}],
- ['OS!="solaris"', {'sources/': [['exclude', '(^|/)solaris/']]}],
- ['OS!="win"', {'sources/': [['exclude', '(^|/)windows/']]}],
- ],
- },
- 'targets': [
- {
- 'target_name': 'common',
- 'type': 'static_library',
- 'sources': [
- 'android/breakpad_getcontext.S',
- 'android/include/elf.h',
- 'android/include/link.h',
- 'android/include/sgidefs.h',
- 'android/include/stab.h',
- 'android/include/sys/procfs.h',
- 'android/include/sys/signal.h',
- 'android/include/sys/user.h',
- 'android/include/ucontext.h',
- 'android/testing/include/wchar.h',
- 'android/testing/mkdtemp.h',
- 'android/testing/pthread_fixes.h',
- 'android/ucontext_constants.h',
- 'basictypes.h',
- 'byte_cursor.h',
- 'convert_UTF.c',
- 'convert_UTF.h',
- 'dwarf/bytereader-inl.h',
- 'dwarf/bytereader.cc',
- 'dwarf/bytereader.h',
- 'dwarf/cfi_assembler.cc',
- 'dwarf/cfi_assembler.h',
- 'dwarf/dwarf2diehandler.cc',
- 'dwarf/dwarf2diehandler.h',
- 'dwarf/dwarf2enums.h',
- 'dwarf/dwarf2reader.cc',
- 'dwarf/dwarf2reader.h',
- 'dwarf/dwarf2reader_test_common.h',
- 'dwarf/elf_reader.cc',
- 'dwarf/elf_reader.h',
- 'dwarf/functioninfo.cc',
- 'dwarf/functioninfo.h',
- 'dwarf/line_state_machine.h',
- 'dwarf/types.h',
- 'dwarf_cfi_to_module.cc',
- 'dwarf_cfi_to_module.h',
- 'dwarf_cu_to_module.cc',
- 'dwarf_cu_to_module.h',
- 'dwarf_line_to_module.cc',
- 'dwarf_line_to_module.h',
- 'language.cc',
- 'language.h',
- 'linux/crc32.cc',
- 'linux/crc32.h',
- 'linux/dump_symbols.cc',
- 'linux/dump_symbols.h',
- 'linux/eintr_wrapper.h',
- 'linux/elf_core_dump.cc',
- 'linux/elf_core_dump.h',
- 'linux/elf_gnu_compat.h',
- 'linux/elf_symbols_to_module.cc',
- 'linux/elf_symbols_to_module.h',
- 'linux/elfutils-inl.h',
- 'linux/elfutils.cc',
- 'linux/elfutils.h',
- 'linux/file_id.cc',
- 'linux/file_id.h',
- 'linux/google_crashdump_uploader.cc',
- 'linux/google_crashdump_uploader.h',
- 'linux/guid_creator.cc',
- 'linux/guid_creator.h',
- 'linux/http_upload.cc',
- 'linux/http_upload.h',
- 'linux/ignore_ret.h',
- 'linux/libcurl_wrapper.cc',
- 'linux/libcurl_wrapper.h',
- 'linux/linux_libc_support.cc',
- 'linux/linux_libc_support.h',
- 'linux/memory_mapped_file.cc',
- 'linux/memory_mapped_file.h',
- 'linux/safe_readlink.cc',
- 'linux/safe_readlink.h',
- 'linux/synth_elf.cc',
- 'linux/synth_elf.h',
- 'mac/arch_utilities.cc',
- 'mac/arch_utilities.h',
- 'mac/bootstrap_compat.cc',
- 'mac/bootstrap_compat.h',
- 'mac/byteswap.h',
- 'mac/dump_syms.h',
- 'mac/dump_syms.cc',
- 'mac/file_id.cc',
- 'mac/file_id.h',
- 'mac/GTMDefines.h',
- 'mac/GTMLogger.h',
- 'mac/GTMLogger.m',
- 'mac/HTTPMultipartUpload.h',
- 'mac/HTTPMultipartUpload.m',
- 'mac/MachIPC.h',
- 'mac/MachIPC.mm',
- 'mac/macho_id.cc',
- 'mac/macho_id.h',
- 'mac/macho_reader.cc',
- 'mac/macho_reader.h',
- 'mac/macho_utilities.cc',
- 'mac/macho_utilities.h',
- 'mac/macho_walker.cc',
- 'mac/macho_walker.h',
- 'mac/scoped_task_suspend-inl.h',
- 'mac/string_utilities.cc',
- 'mac/string_utilities.h',
- 'mac/super_fat_arch.h',
- 'md5.cc',
- 'md5.h',
- 'memory.h',
- 'memory_range.h',
- 'module.cc',
- 'module.h',
- 'scoped_ptr.h',
- 'simple_string_dictionary.cc',
- 'simple_string_dictionary.h',
- 'solaris/dump_symbols.cc',
- 'solaris/dump_symbols.h',
- 'solaris/file_id.cc',
- 'solaris/file_id.h',
- 'solaris/guid_creator.cc',
- 'solaris/guid_creator.h',
- 'solaris/message_output.h',
- 'stabs_reader.cc',
- 'stabs_reader.h',
- 'stabs_to_module.cc',
- 'stabs_to_module.h',
- 'string_conversion.cc',
- 'string_conversion.h',
- 'symbol_data.h',
- 'test_assembler.cc',
- 'test_assembler.h',
- 'unordered.h',
- 'using_std_string.h',
- 'windows/common_windows.gyp',
- 'windows/dia_util.cc',
- 'windows/dia_util.h',
- 'windows/guid_string.cc',
- 'windows/guid_string.h',
- 'windows/http_upload.cc',
- 'windows/http_upload.h',
- 'windows/omap.cc',
- 'windows/omap.h',
- 'windows/omap_internal.h',
- 'windows/pdb_source_line_writer.cc',
- 'windows/pdb_source_line_writer.h',
- 'windows/string_utils-inl.h',
- 'windows/string_utils.cc',
- ],
- 'include_dirs': [
- '..',
- ],
- },
- {
- 'target_name': 'common_unittests',
- 'type': 'executable',
- 'sources': [
- 'android/breakpad_getcontext_unittest.cc',
- 'byte_cursor_unittest.cc',
- 'dwarf/bytereader_unittest.cc',
- 'dwarf/dwarf2diehandler_unittest.cc',
- 'dwarf/dwarf2reader_cfi_unittest.cc',
- 'dwarf/dwarf2reader_die_unittest.cc',
- 'dwarf_cfi_to_module_unittest.cc',
- 'dwarf_cu_to_module_unittest.cc',
- 'dwarf_line_to_module_unittest.cc',
- 'linux/dump_symbols_unittest.cc',
- 'linux/elf_core_dump_unittest.cc',
- 'linux/elf_symbols_to_module_unittest.cc',
- 'linux/file_id_unittest.cc',
- 'linux/google_crashdump_uploader_test.cc',
- 'linux/linux_libc_support_unittest.cc',
- 'linux/memory_mapped_file_unittest.cc',
- 'linux/safe_readlink_unittest.cc',
- 'linux/synth_elf_unittest.cc',
- 'linux/tests/auto_testfile.h',
- 'linux/tests/crash_generator.cc',
- 'linux/tests/crash_generator.h',
- 'mac/macho_reader_unittest.cc',
- 'memory_range_unittest.cc',
- 'memory_unittest.cc',
- 'module_unittest.cc',
- 'simple_string_dictionary_unittest.cc',
- 'stabs_reader_unittest.cc',
- 'stabs_to_module_unittest.cc',
- 'test_assembler_unittest.cc',
- 'tests/auto_tempdir.h',
- 'tests/file_utils.cc',
- 'tests/file_utils.h',
- 'windows/omap_unittest.cc',
- ],
- 'include_dirs': [
- '..',
- ],
- 'dependencies': [
- 'common',
- '../build/testing.gypi:gmock_main',
- '../build/testing.gypi:gmock',
- '../build/testing.gypi:gtest',
- ],
- 'libraries': [
- '-ldl',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/convert_UTF.c b/toolkit/crashreporter/google-breakpad/src/common/convert_UTF.c
deleted file mode 100644
index 12a3c89174..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/convert_UTF.c
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Copyright © 1991-2015 Unicode, Inc. All rights reserved.
- * Distributed under the Terms of Use in
- * http://www.unicode.org/copyright.html.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of the Unicode data files and any associated documentation
- * (the "Data Files") or Unicode software and any associated documentation
- * (the "Software") to deal in the Data Files or Software
- * without restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, and/or sell copies of
- * the Data Files or Software, and to permit persons to whom the Data Files
- * or Software are furnished to do so, provided that
- * (a) this copyright and permission notice appear with all copies
- * of the Data Files or Software,
- * (b) this copyright and permission notice appear in associated
- * documentation, and
- * (c) there is clear notice in each modified Data File or in the Software
- * as well as in the documentation associated with the Data File(s) or
- * Software that the data or software has been modified.
- *
- * THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
- * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
- * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THE DATA FILES OR SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in these Data Files or Software without prior
- * written authorization of the copyright holder.
- */
-
-/* ---------------------------------------------------------------------
-
-Conversions between UTF32, UTF-16, and UTF-8. Source code file.
-Author: Mark E. Davis, 1994.
-Rev History: Rick McGowan, fixes & updates May 2001.
-Sept 2001: fixed const & error conditions per
-mods suggested by S. Parent & A. Lillich.
-June 2002: Tim Dodd added detection and handling of incomplete
-source sequences, enhanced error detection, added casts
-to eliminate compiler warnings.
-July 2003: slight mods to back out aggressive FFFE detection.
-Jan 2004: updated switches in from-UTF8 conversions.
-Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions.
-
-See the header file "ConvertUTF.h" for complete documentation.
-
------------------------------------------------------------------------- */
-
-
-#include "convert_UTF.h"
-#ifdef CVTUTF_DEBUG
-#include <stdio.h>
-#endif
-
-static const int halfShift = 10; /* used for shifting by 10 bits */
-
-static const UTF32 halfBase = 0x0010000UL;
-static const UTF32 halfMask = 0x3FFUL;
-
-#define UNI_SUR_HIGH_START (UTF32)0xD800
-#define UNI_SUR_HIGH_END (UTF32)0xDBFF
-#define UNI_SUR_LOW_START (UTF32)0xDC00
-#define UNI_SUR_LOW_END (UTF32)0xDFFF
-
-#ifndef false
-#define false 0
-#endif
-#ifndef true
-#define true 1
-#endif
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF32* source = *sourceStart;
- UTF16* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- if (target >= targetEnd) {
- result = targetExhausted; break;
- }
- ch = *source++;
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_LEGAL_UTF32) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- --source; /* Back up source pointer! */
- result = targetExhausted; break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
- }
-*sourceStart = source;
-*targetStart = target;
-return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF16* source = *sourceStart;
- UTF32* target = *targetStart;
- UTF32 ch, ch2;
- while (source < sourceEnd) {
- const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
- + (ch2 - UNI_SUR_LOW_START) + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- if (target >= targetEnd) {
- source = oldSource; /* Back up source pointer! */
- result = targetExhausted; break;
- }
- *target++ = ch;
- }
- *sourceStart = source;
- *targetStart = target;
-#ifdef CVTUTF_DEBUG
- if (result == sourceIllegal) {
- fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2);
- fflush(stderr);
- }
-#endif
- return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Index into the table below with the first byte of a UTF-8 sequence to
- * get the number of trailing bytes that are supposed to follow it.
- * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is
- * left as-is for anyone who may want to do such conversion, which was
- * allowed in earlier algorithms.
- */
-static const char trailingBytesForUTF8[256] = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5
-};
-
-/*
- * Magic values subtracted from a buffer value during UTF8 conversion.
- * This table contains as many values as there might be trailing bytes
- * in a UTF-8 sequence.
- */
-static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL,
- 0x03C82080UL, 0xFA082080UL, 0x82082080UL };
-
-/*
- * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed
- * into the first byte, depending on how many bytes follow. There are
- * as many entries in this table as there are UTF-8 sequence types.
- * (I.e., one byte sequence, two byte... etc.). Remember that sequencs
- * for *legal* UTF-8 will be 4 or fewer bytes total.
- */
-static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC };
-
-/* --------------------------------------------------------------------- */
-
-/* The interface converts a whole buffer to avoid function-call overhead.
-* Constants have been gathered. Loops & conditionals have been removed as
-* much as possible for efficiency, in favor of drop-through switches.
-* (See "Note A" at the bottom of the file for equivalent code.)
-* If your compiler supports it, the "isLegalUTF8" call can be turned
-* into an inline function.
-*/
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF16* source = *sourceStart;
- UTF8* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */
- ch = *source++;
- /* If we have a surrogate pair, convert to UTF32 first. */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) {
- /* If the 16 bits following the high surrogate are in the source buffer... */
- if (source < sourceEnd) {
- UTF32 ch2 = *source;
- /* If it's a low surrogate, convert to UTF32. */
- if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) {
- ch = ((ch - UNI_SUR_HIGH_START) << halfShift)
- + (ch2 - UNI_SUR_LOW_START) + halfBase;
- ++source;
- } else if (flags == strictConversion) { /* it's an unpaired high surrogate */
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- } else { /* We don't have the 16 bits following the high surrogate. */
- --source; /* return to the high surrogate */
- result = sourceExhausted;
- break;
- }
- } else if (flags == strictConversion) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /* Figure out how many bytes the result will require */
- if (ch < (UTF32)0x80) { bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
- } else if (ch < (UTF32)0x110000) { bytesToWrite = 4;
- } else { bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- source = oldSource; /* Back up source pointer! */
- target -= bytesToWrite; result = targetExhausted; break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
- }
-*sourceStart = source;
-*targetStart = target;
-return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Utility routine to tell whether a sequence of bytes is legal UTF-8.
- * This must be called with the length pre-determined by the first byte.
- * If not calling this from ConvertUTF8to*, then the length can be set by:
- * length = trailingBytesForUTF8[*source]+1;
- * and the sequence is illegal right away if there aren't that many bytes
- * available.
- * If presented with a length > 4, this returns false. The Unicode
- * definition of UTF-8 goes up to 4-byte sequences.
- */
-
-static Boolean isLegalUTF8(const UTF8 *source, int length) {
- UTF8 a;
- const UTF8 *srcptr = source+length;
- switch (length) {
- default: return false;
- /* Everything else falls through when "true"... */
- case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;
- case 2: if ((a = (*--srcptr)) > 0xBF) return false;
-
- switch (*source) {
- /* no fall-through in this inner switch */
- case 0xE0: if (a < 0xA0) return false; break;
- case 0xED: if (a > 0x9F) return false; break;
- case 0xF0: if (a < 0x90) return false; break;
- case 0xF4: if (a > 0x8F) return false; break;
- default: if (a < 0x80) return false;
- }
-
- case 1: if (*source >= 0x80 && *source < 0xC2) return false;
- }
- if (*source > 0xF4) return false;
- return true;
-}
-
-/* --------------------------------------------------------------------- */
-
-/*
- * Exported function to return whether a UTF-8 sequence is legal or not.
- * This is not used here; it's just exported.
- */
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
- int length = trailingBytesForUTF8[*source]+1;
- if (source+length > sourceEnd) {
- return false;
- }
- return isLegalUTF8(source, length);
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF8* source = *sourceStart;
- UTF16* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted; break;
- }
- /* Do this check whether lenient or strict */
- if (! isLegalUTF8(source, extraBytesToRead+1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up source pointer! */
- result = targetExhausted; break;
- }
- if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = (UTF16)ch; /* normal case */
- }
- } else if (ch > UNI_MAX_UTF16) {
- if (flags == strictConversion) {
- result = sourceIllegal;
- source -= (extraBytesToRead+1); /* return to the start */
- break; /* Bail out; shouldn't continue */
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- /* target is a character in range 0xFFFF - 0x10FFFF. */
- if (target + 1 >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up source pointer! */
- result = targetExhausted; break;
- }
- ch -= halfBase;
- *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START);
- *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START);
- }
- }
-*sourceStart = source;
-*targetStart = target;
-return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF32* source = *sourceStart;
- UTF8* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch;
- unsigned short bytesToWrite = 0;
- const UTF32 byteMask = 0xBF;
- const UTF32 byteMark = 0x80;
- ch = *source++;
- if (flags == strictConversion ) {
- /* UTF-16 surrogate values are illegal in UTF-32 */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- --source; /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- }
- }
- /*
- * Figure out how many bytes the result will require. Turn any
- * illegally large UTF32 things (> Plane 17) into replacement chars.
- */
- if (ch < (UTF32)0x80) { bytesToWrite = 1;
- } else if (ch < (UTF32)0x800) { bytesToWrite = 2;
- } else if (ch < (UTF32)0x10000) { bytesToWrite = 3;
- } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4;
- } else { bytesToWrite = 3;
- ch = UNI_REPLACEMENT_CHAR;
- result = sourceIllegal;
- }
-
- target += bytesToWrite;
- if (target > targetEnd) {
- --source; /* Back up source pointer! */
- target -= bytesToWrite; result = targetExhausted; break;
- }
- switch (bytesToWrite) { /* note: everything falls through. */
- case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6;
- case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]);
- }
- target += bytesToWrite;
- }
-*sourceStart = source;
-*targetStart = target;
-return result;
-}
-
-/* --------------------------------------------------------------------- */
-
-ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
- ConversionResult result = conversionOK;
- const UTF8* source = *sourceStart;
- UTF32* target = *targetStart;
- while (source < sourceEnd) {
- UTF32 ch = 0;
- unsigned short extraBytesToRead = trailingBytesForUTF8[*source];
- if (source + extraBytesToRead >= sourceEnd) {
- result = sourceExhausted; break;
- }
- /* Do this check whether lenient or strict */
- if (! isLegalUTF8(source, extraBytesToRead+1)) {
- result = sourceIllegal;
- break;
- }
- /*
- * The cases all fall through. See "Note A" below.
- */
- switch (extraBytesToRead) {
- case 5: ch += *source++; ch <<= 6;
- case 4: ch += *source++; ch <<= 6;
- case 3: ch += *source++; ch <<= 6;
- case 2: ch += *source++; ch <<= 6;
- case 1: ch += *source++; ch <<= 6;
- case 0: ch += *source++;
- }
- ch -= offsetsFromUTF8[extraBytesToRead];
-
- if (target >= targetEnd) {
- source -= (extraBytesToRead+1); /* Back up the source pointer! */
- result = targetExhausted; break;
- }
- if (ch <= UNI_MAX_LEGAL_UTF32) {
- /*
- * UTF-16 surrogate values are illegal in UTF-32, and anything
- * over Plane 17 (> 0x10FFFF) is illegal.
- */
- if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) {
- if (flags == strictConversion) {
- source -= (extraBytesToRead+1); /* return to the illegal value itself */
- result = sourceIllegal;
- break;
- } else {
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- } else {
- *target++ = ch;
- }
- } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */
- result = sourceIllegal;
- *target++ = UNI_REPLACEMENT_CHAR;
- }
- }
- *sourceStart = source;
- *targetStart = target;
- return result;
-}
-
-/* ---------------------------------------------------------------------
-
-Note A.
-The fall-through switches in UTF-8 reading code save a
-temp variable, some decrements & conditionals. The switches
-are equivalent to the following loop:
-{
- int tmpBytesToRead = extraBytesToRead+1;
- do {
- ch += *source++;
- --tmpBytesToRead;
- if (tmpBytesToRead) ch <<= 6;
- } while (tmpBytesToRead > 0);
-}
-In UTF-8 writing code, the switches on "bytesToWrite" are
-similarly unrolled loops.
-
---------------------------------------------------------------------- */
diff --git a/toolkit/crashreporter/google-breakpad/src/common/convert_UTF.h b/toolkit/crashreporter/google-breakpad/src/common/convert_UTF.h
deleted file mode 100644
index 644d099506..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/convert_UTF.h
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright © 1991-2015 Unicode, Inc. All rights reserved.
- * Distributed under the Terms of Use in
- * http://www.unicode.org/copyright.html.
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of the Unicode data files and any associated documentation
- * (the "Data Files") or Unicode software and any associated documentation
- * (the "Software") to deal in the Data Files or Software
- * without restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, and/or sell copies of
- * the Data Files or Software, and to permit persons to whom the Data Files
- * or Software are furnished to do so, provided that
- * (a) this copyright and permission notice appear with all copies
- * of the Data Files or Software,
- * (b) this copyright and permission notice appear in associated
- * documentation, and
- * (c) there is clear notice in each modified Data File or in the Software
- * as well as in the documentation associated with the Data File(s) or
- * Software that the data or software has been modified.
- *
- * THE DATA FILES AND SOFTWARE ARE 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 OF THIRD PARTY RIGHTS.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
- * NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
- * DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THE DATA FILES OR SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in these Data Files or Software without prior
- * written authorization of the copyright holder.
- */
-
-#ifndef COMMON_CONVERT_UTF_H_
-#define COMMON_CONVERT_UTF_H_
-
-/* ---------------------------------------------------------------------
-
-Conversions between UTF32, UTF-16, and UTF-8. Header file.
-
-Several funtions are included here, forming a complete set of
-conversions between the three formats. UTF-7 is not included
-here, but is handled in a separate source file.
-
-Each of these routines takes pointers to input buffers and output
-buffers. The input buffers are const.
-
-Each routine converts the text between *sourceStart and sourceEnd,
-putting the result into the buffer between *targetStart and
-targetEnd. Note: the end pointers are *after* the last item: e.g.
-*(sourceEnd - 1) is the last item.
-
-The return result indicates whether the conversion was successful,
-and if not, whether the problem was in the source or target buffers.
-(Only the first encountered problem is indicated.)
-
-After the conversion, *sourceStart and *targetStart are both
-updated to point to the end of last text successfully converted in
-the respective buffers.
-
-Input parameters:
-sourceStart - pointer to a pointer to the source buffer.
-The contents of this are modified on return so that
-it points at the next thing to be converted.
-targetStart - similarly, pointer to pointer to the target buffer.
-sourceEnd, targetEnd - respectively pointers to the ends of the
-two buffers, for overflow checking only.
-
-These conversion functions take a ConversionFlags argument. When this
-flag is set to strict, both irregular sequences and isolated surrogates
-will cause an error. When the flag is set to lenient, both irregular
-sequences and isolated surrogates are converted.
-
-Whether the flag is strict or lenient, all illegal sequences will cause
-an error return. This includes sequences such as: <F4 90 80 80>, <C0 80>,
-or <A0> in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code
-must check for illegal sequences.
-
-When the flag is set to lenient, characters over 0x10FFFF are converted
-to the replacement character; otherwise (when the flag is set to strict)
-they constitute an error.
-
-Output parameters:
-The value "sourceIllegal" is returned from some routines if the input
-sequence is malformed. When "sourceIllegal" is returned, the source
-value will point to the illegal value that caused the problem. E.g.,
-in UTF-8 when a sequence is malformed, it points to the start of the
-malformed sequence.
-
-Author: Mark E. Davis, 1994.
-Rev History: Rick McGowan, fixes & updates May 2001.
-Fixes & updates, Sept 2001.
-
------------------------------------------------------------------------- */
-
-/* ---------------------------------------------------------------------
-The following 4 definitions are compiler-specific.
-The C standard does not guarantee that wchar_t has at least
-16 bits, so wchar_t is no less portable than unsigned short!
-All should be unsigned values to avoid sign extension during
-bit mask & shift operations.
------------------------------------------------------------------------- */
-
-typedef unsigned long UTF32; /* at least 32 bits */
-typedef unsigned short UTF16; /* at least 16 bits */
-typedef unsigned char UTF8; /* typically 8 bits */
-typedef unsigned char Boolean; /* 0 or 1 */
-
-/* Some fundamental constants */
-#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
-#define UNI_MAX_BMP (UTF32)0x0000FFFF
-#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
-#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
-#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
-
-typedef enum {
- conversionOK, /* conversion successful */
- sourceExhausted, /* partial character in source, but hit end */
- targetExhausted, /* insuff. room in target for conversion */
- sourceIllegal /* source sequence is illegal/malformed */
-} ConversionResult;
-
-typedef enum {
- strictConversion = 0,
- lenientConversion
-} ConversionFlags;
-
-/* This is for C++ and does no harm in C */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF8toUTF32 (const UTF8** sourceStart, const UTF8* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF32toUTF8 (const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd,
- UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags);
-
-ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd,
- UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags);
-
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
-
-#ifdef __cplusplus
-}
-#endif
-
-/* --------------------------------------------------------------------- */
-
-#endif // COMMON_CONVERT_UTF_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader-inl.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader-inl.h
deleted file mode 100644
index 42c92f943f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader-inl.h
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright 2006 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef UTIL_DEBUGINFO_BYTEREADER_INL_H__
-#define UTIL_DEBUGINFO_BYTEREADER_INL_H__
-
-#include "common/dwarf/bytereader.h"
-
-#include <assert.h>
-#include <stdint.h>
-
-namespace dwarf2reader {
-
-inline uint8 ByteReader::ReadOneByte(const uint8_t *buffer) const {
- return buffer[0];
-}
-
-inline uint16 ByteReader::ReadTwoBytes(const uint8_t *buffer) const {
- const uint16 buffer0 = buffer[0];
- const uint16 buffer1 = buffer[1];
- if (endian_ == ENDIANNESS_LITTLE) {
- return buffer0 | buffer1 << 8;
- } else {
- return buffer1 | buffer0 << 8;
- }
-}
-
-inline uint64 ByteReader::ReadFourBytes(const uint8_t *buffer) const {
- const uint32 buffer0 = buffer[0];
- const uint32 buffer1 = buffer[1];
- const uint32 buffer2 = buffer[2];
- const uint32 buffer3 = buffer[3];
- if (endian_ == ENDIANNESS_LITTLE) {
- return buffer0 | buffer1 << 8 | buffer2 << 16 | buffer3 << 24;
- } else {
- return buffer3 | buffer2 << 8 | buffer1 << 16 | buffer0 << 24;
- }
-}
-
-inline uint64 ByteReader::ReadEightBytes(const uint8_t *buffer) const {
- const uint64 buffer0 = buffer[0];
- const uint64 buffer1 = buffer[1];
- const uint64 buffer2 = buffer[2];
- const uint64 buffer3 = buffer[3];
- const uint64 buffer4 = buffer[4];
- const uint64 buffer5 = buffer[5];
- const uint64 buffer6 = buffer[6];
- const uint64 buffer7 = buffer[7];
- if (endian_ == ENDIANNESS_LITTLE) {
- return buffer0 | buffer1 << 8 | buffer2 << 16 | buffer3 << 24 |
- buffer4 << 32 | buffer5 << 40 | buffer6 << 48 | buffer7 << 56;
- } else {
- return buffer7 | buffer6 << 8 | buffer5 << 16 | buffer4 << 24 |
- buffer3 << 32 | buffer2 << 40 | buffer1 << 48 | buffer0 << 56;
- }
-}
-
-// Read an unsigned LEB128 number. Each byte contains 7 bits of
-// information, plus one bit saying whether the number continues or
-// not.
-
-inline uint64 ByteReader::ReadUnsignedLEB128(const uint8_t *buffer,
- size_t* len) const {
- uint64 result = 0;
- size_t num_read = 0;
- unsigned int shift = 0;
- uint8_t byte;
-
- do {
- byte = *buffer++;
- num_read++;
-
- result |= (static_cast<uint64>(byte & 0x7f)) << shift;
-
- shift += 7;
-
- } while (byte & 0x80);
-
- *len = num_read;
-
- return result;
-}
-
-// Read a signed LEB128 number. These are like regular LEB128
-// numbers, except the last byte may have a sign bit set.
-
-inline int64 ByteReader::ReadSignedLEB128(const uint8_t *buffer,
- size_t* len) const {
- int64 result = 0;
- unsigned int shift = 0;
- size_t num_read = 0;
- uint8_t byte;
-
- do {
- byte = *buffer++;
- num_read++;
- result |= (static_cast<uint64>(byte & 0x7f) << shift);
- shift += 7;
- } while (byte & 0x80);
-
- if ((shift < 8 * sizeof (result)) && (byte & 0x40))
- result |= -((static_cast<int64>(1)) << shift);
- *len = num_read;
- return result;
-}
-
-inline uint64 ByteReader::ReadOffset(const uint8_t *buffer) const {
- assert(this->offset_reader_);
- return (this->*offset_reader_)(buffer);
-}
-
-inline uint64 ByteReader::ReadAddress(const uint8_t *buffer) const {
- assert(this->address_reader_);
- return (this->*address_reader_)(buffer);
-}
-
-inline void ByteReader::SetCFIDataBase(uint64 section_base,
- const uint8_t *buffer_base) {
- section_base_ = section_base;
- buffer_base_ = buffer_base;
- have_section_base_ = true;
-}
-
-inline void ByteReader::SetTextBase(uint64 text_base) {
- text_base_ = text_base;
- have_text_base_ = true;
-}
-
-inline void ByteReader::SetDataBase(uint64 data_base) {
- data_base_ = data_base;
- have_data_base_ = true;
-}
-
-inline void ByteReader::SetFunctionBase(uint64 function_base) {
- function_base_ = function_base;
- have_function_base_ = true;
-}
-
-inline void ByteReader::ClearFunctionBase() {
- have_function_base_ = false;
-}
-
-} // namespace dwarf2reader
-
-#endif // UTIL_DEBUGINFO_BYTEREADER_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc
deleted file mode 100644
index 14b43adb8f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.cc
+++ /dev/null
@@ -1,250 +0,0 @@
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/bytereader.h"
-
-namespace dwarf2reader {
-
-ByteReader::ByteReader(enum Endianness endian)
- :offset_reader_(NULL), address_reader_(NULL), endian_(endian),
- address_size_(0), offset_size_(0),
- have_section_base_(), have_text_base_(), have_data_base_(),
- have_function_base_() { }
-
-ByteReader::~ByteReader() { }
-
-void ByteReader::SetOffsetSize(uint8 size) {
- offset_size_ = size;
- assert(size == 4 || size == 8);
- if (size == 4) {
- this->offset_reader_ = &ByteReader::ReadFourBytes;
- } else {
- this->offset_reader_ = &ByteReader::ReadEightBytes;
- }
-}
-
-void ByteReader::SetAddressSize(uint8 size) {
- address_size_ = size;
- assert(size == 4 || size == 8);
- if (size == 4) {
- this->address_reader_ = &ByteReader::ReadFourBytes;
- } else {
- this->address_reader_ = &ByteReader::ReadEightBytes;
- }
-}
-
-uint64 ByteReader::ReadInitialLength(const uint8_t *start, size_t* len) {
- const uint64 initial_length = ReadFourBytes(start);
- start += 4;
-
- // In DWARF2/3, if the initial length is all 1 bits, then the offset
- // size is 8 and we need to read the next 8 bytes for the real length.
- if (initial_length == 0xffffffff) {
- SetOffsetSize(8);
- *len = 12;
- return ReadOffset(start);
- } else {
- SetOffsetSize(4);
- *len = 4;
- }
- return initial_length;
-}
-
-bool ByteReader::ValidEncoding(DwarfPointerEncoding encoding) const {
- if (encoding == DW_EH_PE_omit) return true;
- if (encoding == DW_EH_PE_aligned) return true;
- if ((encoding & 0x7) > DW_EH_PE_udata8)
- return false;
- if ((encoding & 0x70) > DW_EH_PE_funcrel)
- return false;
- return true;
-}
-
-bool ByteReader::UsableEncoding(DwarfPointerEncoding encoding) const {
- switch (encoding & 0x70) {
- case DW_EH_PE_absptr: return true;
- case DW_EH_PE_pcrel: return have_section_base_;
- case DW_EH_PE_textrel: return have_text_base_;
- case DW_EH_PE_datarel: return have_data_base_;
- case DW_EH_PE_funcrel: return have_function_base_;
- default: return false;
- }
-}
-
-uint64 ByteReader::ReadEncodedPointer(const uint8_t *buffer,
- DwarfPointerEncoding encoding,
- size_t *len) const {
- // UsableEncoding doesn't approve of DW_EH_PE_omit, so we shouldn't
- // see it here.
- assert(encoding != DW_EH_PE_omit);
-
- // The Linux Standards Base 4.0 does not make this clear, but the
- // GNU tools (gcc/unwind-pe.h; readelf/dwarf.c; gdb/dwarf2-frame.c)
- // agree that aligned pointers are always absolute, machine-sized,
- // machine-signed pointers.
- if (encoding == DW_EH_PE_aligned) {
- assert(have_section_base_);
-
- // We don't need to align BUFFER in *our* address space. Rather, we
- // need to find the next position in our buffer that would be aligned
- // when the .eh_frame section the buffer contains is loaded into the
- // program's memory. So align assuming that buffer_base_ gets loaded at
- // address section_base_, where section_base_ itself may or may not be
- // aligned.
-
- // First, find the offset to START from the closest prior aligned
- // address.
- uint64 skew = section_base_ & (AddressSize() - 1);
- // Now find the offset from that aligned address to buffer.
- uint64 offset = skew + (buffer - buffer_base_);
- // Round up to the next boundary.
- uint64 aligned = (offset + AddressSize() - 1) & -AddressSize();
- // Convert back to a pointer.
- const uint8_t *aligned_buffer = buffer_base_ + (aligned - skew);
- // Finally, store the length and actually fetch the pointer.
- *len = aligned_buffer - buffer + AddressSize();
- return ReadAddress(aligned_buffer);
- }
-
- // Extract the value first, ignoring whether it's a pointer or an
- // offset relative to some base.
- uint64 offset;
- switch (encoding & 0x0f) {
- case DW_EH_PE_absptr:
- // DW_EH_PE_absptr is weird, as it is used as a meaningful value for
- // both the high and low nybble of encoding bytes. When it appears in
- // the high nybble, it means that the pointer is absolute, not an
- // offset from some base address. When it appears in the low nybble,
- // as here, it means that the pointer is stored as a normal
- // machine-sized and machine-signed address. A low nybble of
- // DW_EH_PE_absptr does not imply that the pointer is absolute; it is
- // correct for us to treat the value as an offset from a base address
- // if the upper nybble is not DW_EH_PE_absptr.
- offset = ReadAddress(buffer);
- *len = AddressSize();
- break;
-
- case DW_EH_PE_uleb128:
- offset = ReadUnsignedLEB128(buffer, len);
- break;
-
- case DW_EH_PE_udata2:
- offset = ReadTwoBytes(buffer);
- *len = 2;
- break;
-
- case DW_EH_PE_udata4:
- offset = ReadFourBytes(buffer);
- *len = 4;
- break;
-
- case DW_EH_PE_udata8:
- offset = ReadEightBytes(buffer);
- *len = 8;
- break;
-
- case DW_EH_PE_sleb128:
- offset = ReadSignedLEB128(buffer, len);
- break;
-
- case DW_EH_PE_sdata2:
- offset = ReadTwoBytes(buffer);
- // Sign-extend from 16 bits.
- offset = (offset ^ 0x8000) - 0x8000;
- *len = 2;
- break;
-
- case DW_EH_PE_sdata4:
- offset = ReadFourBytes(buffer);
- // Sign-extend from 32 bits.
- offset = (offset ^ 0x80000000ULL) - 0x80000000ULL;
- *len = 4;
- break;
-
- case DW_EH_PE_sdata8:
- // No need to sign-extend; this is the full width of our type.
- offset = ReadEightBytes(buffer);
- *len = 8;
- break;
-
- default:
- abort();
- }
-
- // Find the appropriate base address.
- uint64 base;
- switch (encoding & 0x70) {
- case DW_EH_PE_absptr:
- base = 0;
- break;
-
- case DW_EH_PE_pcrel:
- assert(have_section_base_);
- base = section_base_ + (buffer - buffer_base_);
- break;
-
- case DW_EH_PE_textrel:
- assert(have_text_base_);
- base = text_base_;
- break;
-
- case DW_EH_PE_datarel:
- assert(have_data_base_);
- base = data_base_;
- break;
-
- case DW_EH_PE_funcrel:
- assert(have_function_base_);
- base = function_base_;
- break;
-
- default:
- abort();
- }
-
- uint64 pointer = base + offset;
-
- // Remove inappropriate upper bits.
- if (AddressSize() == 4)
- pointer = pointer & 0xffffffff;
- else
- assert(AddressSize() == sizeof(uint64));
-
- return pointer;
-}
-
-Endianness ByteReader::GetEndianness() const {
- return endian_;
-}
-
-} // namespace dwarf2reader
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h
deleted file mode 100644
index 59d4303480..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader.h
+++ /dev/null
@@ -1,315 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_DWARF_BYTEREADER_H__
-#define COMMON_DWARF_BYTEREADER_H__
-
-#include <stdint.h>
-
-#include <string>
-
-#include "common/dwarf/types.h"
-#include "common/dwarf/dwarf2enums.h"
-
-namespace dwarf2reader {
-
-// We can't use the obvious name of LITTLE_ENDIAN and BIG_ENDIAN
-// because it conflicts with a macro
-enum Endianness {
- ENDIANNESS_BIG,
- ENDIANNESS_LITTLE
-};
-
-// A ByteReader knows how to read single- and multi-byte values of
-// various endiannesses, sizes, and encodings, as used in DWARF
-// debugging information and Linux C++ exception handling data.
-class ByteReader {
- public:
- // Construct a ByteReader capable of reading one-, two-, four-, and
- // eight-byte values according to ENDIANNESS, absolute machine-sized
- // addresses, DWARF-style "initial length" values, signed and
- // unsigned LEB128 numbers, and Linux C++ exception handling data's
- // encoded pointers.
- explicit ByteReader(enum Endianness endianness);
- virtual ~ByteReader();
-
- // Read a single byte from BUFFER and return it as an unsigned 8 bit
- // number.
- uint8 ReadOneByte(const uint8_t *buffer) const;
-
- // Read two bytes from BUFFER and return them as an unsigned 16 bit
- // number, using this ByteReader's endianness.
- uint16 ReadTwoBytes(const uint8_t *buffer) const;
-
- // Read four bytes from BUFFER and return them as an unsigned 32 bit
- // number, using this ByteReader's endianness. This function returns
- // a uint64 so that it is compatible with ReadAddress and
- // ReadOffset. The number it returns will never be outside the range
- // of an unsigned 32 bit integer.
- uint64 ReadFourBytes(const uint8_t *buffer) const;
-
- // Read eight bytes from BUFFER and return them as an unsigned 64
- // bit number, using this ByteReader's endianness.
- uint64 ReadEightBytes(const uint8_t *buffer) const;
-
- // Read an unsigned LEB128 (Little Endian Base 128) number from
- // BUFFER and return it as an unsigned 64 bit integer. Set LEN to
- // the number of bytes read.
- //
- // The unsigned LEB128 representation of an integer N is a variable
- // number of bytes:
- //
- // - If N is between 0 and 0x7f, then its unsigned LEB128
- // representation is a single byte whose value is N.
- //
- // - Otherwise, its unsigned LEB128 representation is (N & 0x7f) |
- // 0x80, followed by the unsigned LEB128 representation of N /
- // 128, rounded towards negative infinity.
- //
- // In other words, we break VALUE into groups of seven bits, put
- // them in little-endian order, and then write them as eight-bit
- // bytes with the high bit on all but the last.
- uint64 ReadUnsignedLEB128(const uint8_t *buffer, size_t *len) const;
-
- // Read a signed LEB128 number from BUFFER and return it as an
- // signed 64 bit integer. Set LEN to the number of bytes read.
- //
- // The signed LEB128 representation of an integer N is a variable
- // number of bytes:
- //
- // - If N is between -0x40 and 0x3f, then its signed LEB128
- // representation is a single byte whose value is N in two's
- // complement.
- //
- // - Otherwise, its signed LEB128 representation is (N & 0x7f) |
- // 0x80, followed by the signed LEB128 representation of N / 128,
- // rounded towards negative infinity.
- //
- // In other words, we break VALUE into groups of seven bits, put
- // them in little-endian order, and then write them as eight-bit
- // bytes with the high bit on all but the last.
- int64 ReadSignedLEB128(const uint8_t *buffer, size_t *len) const;
-
- // Indicate that addresses on this architecture are SIZE bytes long. SIZE
- // must be either 4 or 8. (DWARF allows addresses to be any number of
- // bytes in length from 1 to 255, but we only support 32- and 64-bit
- // addresses at the moment.) You must call this before using the
- // ReadAddress member function.
- //
- // For data in a .debug_info section, or something that .debug_info
- // refers to like line number or macro data, the compilation unit
- // header's address_size field indicates the address size to use. Call
- // frame information doesn't indicate its address size (a shortcoming of
- // the spec); you must supply the appropriate size based on the
- // architecture of the target machine.
- void SetAddressSize(uint8 size);
-
- // Return the current address size, in bytes. This is either 4,
- // indicating 32-bit addresses, or 8, indicating 64-bit addresses.
- uint8 AddressSize() const { return address_size_; }
-
- // Read an address from BUFFER and return it as an unsigned 64 bit
- // integer, respecting this ByteReader's endianness and address size. You
- // must call SetAddressSize before calling this function.
- uint64 ReadAddress(const uint8_t *buffer) const;
-
- // DWARF actually defines two slightly different formats: 32-bit DWARF
- // and 64-bit DWARF. This is *not* related to the size of registers or
- // addresses on the target machine; it refers only to the size of section
- // offsets and data lengths appearing in the DWARF data. One only needs
- // 64-bit DWARF when the debugging data itself is larger than 4GiB.
- // 32-bit DWARF can handle x86_64 or PPC64 code just fine, unless the
- // debugging data itself is very large.
- //
- // DWARF information identifies itself as 32-bit or 64-bit DWARF: each
- // compilation unit and call frame information entry begins with an
- // "initial length" field, which, in addition to giving the length of the
- // data, also indicates the size of section offsets and lengths appearing
- // in that data. The ReadInitialLength member function, below, reads an
- // initial length and sets the ByteReader's offset size as a side effect.
- // Thus, in the normal process of reading DWARF data, the appropriate
- // offset size is set automatically. So, you should only need to call
- // SetOffsetSize if you are using the same ByteReader to jump from the
- // midst of one block of DWARF data into another.
-
- // Read a DWARF "initial length" field from START, and return it as
- // an unsigned 64 bit integer, respecting this ByteReader's
- // endianness. Set *LEN to the length of the initial length in
- // bytes, either four or twelve. As a side effect, set this
- // ByteReader's offset size to either 4 (if we see a 32-bit DWARF
- // initial length) or 8 (if we see a 64-bit DWARF initial length).
- //
- // A DWARF initial length is either:
- //
- // - a byte count stored as an unsigned 32-bit value less than
- // 0xffffff00, indicating that the data whose length is being
- // measured uses the 32-bit DWARF format, or
- //
- // - The 32-bit value 0xffffffff, followed by a 64-bit byte count,
- // indicating that the data whose length is being measured uses
- // the 64-bit DWARF format.
- uint64 ReadInitialLength(const uint8_t *start, size_t *len);
-
- // Read an offset from BUFFER and return it as an unsigned 64 bit
- // integer, respecting the ByteReader's endianness. In 32-bit DWARF, the
- // offset is 4 bytes long; in 64-bit DWARF, the offset is eight bytes
- // long. You must call ReadInitialLength or SetOffsetSize before calling
- // this function; see the comments above for details.
- uint64 ReadOffset(const uint8_t *buffer) const;
-
- // Return the current offset size, in bytes.
- // A return value of 4 indicates that we are reading 32-bit DWARF.
- // A return value of 8 indicates that we are reading 64-bit DWARF.
- uint8 OffsetSize() const { return offset_size_; }
-
- // Indicate that section offsets and lengths are SIZE bytes long. SIZE
- // must be either 4 (meaning 32-bit DWARF) or 8 (meaning 64-bit DWARF).
- // Usually, you should not call this function yourself; instead, let a
- // call to ReadInitialLength establish the data's offset size
- // automatically.
- void SetOffsetSize(uint8 size);
-
- // The Linux C++ ABI uses a variant of DWARF call frame information
- // for exception handling. This data is included in the program's
- // address space as the ".eh_frame" section, and intepreted at
- // runtime to walk the stack, find exception handlers, and run
- // cleanup code. The format is mostly the same as DWARF CFI, with
- // some adjustments made to provide the additional
- // exception-handling data, and to make the data easier to work with
- // in memory --- for example, to allow it to be placed in read-only
- // memory even when describing position-independent code.
- //
- // In particular, exception handling data can select a number of
- // different encodings for pointers that appear in the data, as
- // described by the DwarfPointerEncoding enum. There are actually
- // four axes(!) to the encoding:
- //
- // - The pointer size: pointers can be 2, 4, or 8 bytes long, or use
- // the DWARF LEB128 encoding.
- //
- // - The pointer's signedness: pointers can be signed or unsigned.
- //
- // - The pointer's base address: the data stored in the exception
- // handling data can be the actual address (that is, an absolute
- // pointer), or relative to one of a number of different base
- // addreses --- including that of the encoded pointer itself, for
- // a form of "pc-relative" addressing.
- //
- // - The pointer may be indirect: it may be the address where the
- // true pointer is stored. (This is used to refer to things via
- // global offset table entries, program linkage table entries, or
- // other tricks used in position-independent code.)
- //
- // There are also two options that fall outside that matrix
- // altogether: the pointer may be omitted, or it may have padding to
- // align it on an appropriate address boundary. (That last option
- // may seem like it should be just another axis, but it is not.)
-
- // Indicate that the exception handling data is loaded starting at
- // SECTION_BASE, and that the start of its buffer in our own memory
- // is BUFFER_BASE. This allows us to find the address that a given
- // byte in our buffer would have when loaded into the program the
- // data describes. We need this to resolve DW_EH_PE_pcrel pointers.
- void SetCFIDataBase(uint64 section_base, const uint8_t *buffer_base);
-
- // Indicate that the base address of the program's ".text" section
- // is TEXT_BASE. We need this to resolve DW_EH_PE_textrel pointers.
- void SetTextBase(uint64 text_base);
-
- // Indicate that the base address for DW_EH_PE_datarel pointers is
- // DATA_BASE. The proper value depends on the ABI; it is usually the
- // address of the global offset table, held in a designated register in
- // position-independent code. You will need to look at the startup code
- // for the target system to be sure. I tried; my eyes bled.
- void SetDataBase(uint64 data_base);
-
- // Indicate that the base address for the FDE we are processing is
- // FUNCTION_BASE. This is the start address of DW_EH_PE_funcrel
- // pointers. (This encoding does not seem to be used by the GNU
- // toolchain.)
- void SetFunctionBase(uint64 function_base);
-
- // Indicate that we are no longer processing any FDE, so any use of
- // a DW_EH_PE_funcrel encoding is an error.
- void ClearFunctionBase();
-
- // Return true if ENCODING is a valid pointer encoding.
- bool ValidEncoding(DwarfPointerEncoding encoding) const;
-
- // Return true if we have all the information we need to read a
- // pointer that uses ENCODING. This checks that the appropriate
- // SetFooBase function for ENCODING has been called.
- bool UsableEncoding(DwarfPointerEncoding encoding) const;
-
- // Read an encoded pointer from BUFFER using ENCODING; return the
- // absolute address it represents, and set *LEN to the pointer's
- // length in bytes, including any padding for aligned pointers.
- //
- // This function calls 'abort' if ENCODING is invalid or refers to a
- // base address this reader hasn't been given, so you should check
- // with ValidEncoding and UsableEncoding first if you would rather
- // die in a more helpful way.
- uint64 ReadEncodedPointer(const uint8_t *buffer,
- DwarfPointerEncoding encoding,
- size_t *len) const;
-
- Endianness GetEndianness() const;
- private:
-
- // Function pointer type for our address and offset readers.
- typedef uint64 (ByteReader::*AddressReader)(const uint8_t *) const;
-
- // Read an offset from BUFFER and return it as an unsigned 64 bit
- // integer. DWARF2/3 define offsets as either 4 or 8 bytes,
- // generally depending on the amount of DWARF2/3 info present.
- // This function pointer gets set by SetOffsetSize.
- AddressReader offset_reader_;
-
- // Read an address from BUFFER and return it as an unsigned 64 bit
- // integer. DWARF2/3 allow addresses to be any size from 0-255
- // bytes currently. Internally we support 4 and 8 byte addresses,
- // and will CHECK on anything else.
- // This function pointer gets set by SetAddressSize.
- AddressReader address_reader_;
-
- Endianness endian_;
- uint8 address_size_;
- uint8 offset_size_;
-
- // Base addresses for Linux C++ exception handling data's encoded pointers.
- bool have_section_base_, have_text_base_, have_data_base_;
- bool have_function_base_;
- uint64 section_base_, text_base_, data_base_, function_base_;
- const uint8_t *buffer_base_;
-};
-
-} // namespace dwarf2reader
-
-#endif // COMMON_DWARF_BYTEREADER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader_unittest.cc
deleted file mode 100644
index e66062d1fe..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/bytereader_unittest.cc
+++ /dev/null
@@ -1,707 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// bytereader_unittest.cc: Unit tests for dwarf2reader::ByteReader
-
-#include <stdint.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/dwarf/bytereader.h"
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/cfi_assembler.h"
-#include "common/using_std_string.h"
-
-using dwarf2reader::ByteReader;
-using dwarf2reader::DwarfPointerEncoding;
-using dwarf2reader::ENDIANNESS_BIG;
-using dwarf2reader::ENDIANNESS_LITTLE;
-using google_breakpad::CFISection;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Section;
-using testing::Test;
-
-struct ReaderFixture {
- string contents;
- size_t pointer_size;
-};
-
-class Reader: public ReaderFixture, public Test { };
-class ReaderDeathTest: public ReaderFixture, public Test { };
-
-TEST_F(Reader, SimpleConstructor) {
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(4);
- CFISection section(kBigEndian, 4);
- section
- .D8(0xc0)
- .D16(0xcf0d)
- .D32(0x96fdd219)
- .D64(0xbbf55fef0825f117ULL)
- .ULEB128(0xa0927048ba8121afULL)
- .LEB128(-0x4f337badf4483f83LL)
- .D32(0xfec319c9);
- ASSERT_TRUE(section.GetContents(&contents));
- const uint8_t *data = reinterpret_cast<const uint8_t *>(contents.data());
- EXPECT_EQ(0xc0U, reader.ReadOneByte(data));
- EXPECT_EQ(0xcf0dU, reader.ReadTwoBytes(data + 1));
- EXPECT_EQ(0x96fdd219U, reader.ReadFourBytes(data + 3));
- EXPECT_EQ(0xbbf55fef0825f117ULL, reader.ReadEightBytes(data + 7));
- size_t leb128_size;
- EXPECT_EQ(0xa0927048ba8121afULL,
- reader.ReadUnsignedLEB128(data + 15, &leb128_size));
- EXPECT_EQ(10U, leb128_size);
- EXPECT_EQ(-0x4f337badf4483f83LL,
- reader.ReadSignedLEB128(data + 25, &leb128_size));
- EXPECT_EQ(10U, leb128_size);
- EXPECT_EQ(0xfec319c9, reader.ReadAddress(data + 35));
-}
-
-TEST_F(Reader, ValidEncodings) {
- ByteReader reader(ENDIANNESS_LITTLE);
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_absptr)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_omit)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_aligned)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_uleb128)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata2)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata4)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata8)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sleb128)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata2)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata4)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata8)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_pcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_textrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_datarel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_absptr |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_uleb128 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata2 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata4 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_udata8 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sleb128 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata2 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata4 |
- dwarf2reader::DW_EH_PE_funcrel)));
- EXPECT_TRUE(reader.ValidEncoding(
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect |
- dwarf2reader::DW_EH_PE_sdata8 |
- dwarf2reader::DW_EH_PE_funcrel)));
-
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x05)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x07)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x0d)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x0f)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x51)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x60)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0x70)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0xf0)));
- EXPECT_FALSE(reader.ValidEncoding(DwarfPointerEncoding(0xd0)));
-}
-
-TEST_F(ReaderDeathTest, DW_EH_PE_omit) {
- static const uint8_t data[] = { 42 };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(4);
- EXPECT_DEATH(reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_omit,
- &pointer_size),
- "encoding != DW_EH_PE_omit");
-}
-
-TEST_F(Reader, DW_EH_PE_absptr4) {
- static const uint8_t data[] = { 0x27, 0x57, 0xea, 0x40 };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(4);
- EXPECT_EQ(0x40ea5727U,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_absptr,
- &pointer_size));
- EXPECT_EQ(4U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_absptr8) {
- static const uint8_t data[] = {
- 0x60, 0x27, 0x57, 0xea, 0x40, 0xc2, 0x98, 0x05, 0x01, 0x50
- };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(8);
- EXPECT_EQ(0x010598c240ea5727ULL,
- reader.ReadEncodedPointer(data + 1, dwarf2reader::DW_EH_PE_absptr,
- &pointer_size));
- EXPECT_EQ(8U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_uleb128) {
- static const uint8_t data[] = { 0x81, 0x84, 0x4c };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(4);
- EXPECT_EQ(0x130201U,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_uleb128,
- &pointer_size));
- EXPECT_EQ(3U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_udata2) {
- static const uint8_t data[] = { 0xf4, 0x8d };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(4);
- EXPECT_EQ(0xf48dU,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_udata2,
- &pointer_size));
- EXPECT_EQ(2U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_udata4) {
- static const uint8_t data[] = { 0xb2, 0x68, 0xa5, 0x62, 0x8f, 0x8b };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(8);
- EXPECT_EQ(0xa5628f8b,
- reader.ReadEncodedPointer(data + 2, dwarf2reader::DW_EH_PE_udata4,
- &pointer_size));
- EXPECT_EQ(4U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_udata8Addr8) {
- static const uint8_t data[] = {
- 0x27, 0x04, 0x73, 0x04, 0x69, 0x9f, 0x19, 0xed, 0x8f, 0xfe
- };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(8);
- EXPECT_EQ(0x8fed199f69047304ULL,
- reader.ReadEncodedPointer(data + 1, dwarf2reader::DW_EH_PE_udata8,
- &pointer_size));
- EXPECT_EQ(8U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_udata8Addr4) {
- static const uint8_t data[] = {
- 0x27, 0x04, 0x73, 0x04, 0x69, 0x9f, 0x19, 0xed, 0x8f, 0xfe
- };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(4);
- EXPECT_EQ(0x69047304ULL,
- reader.ReadEncodedPointer(data + 1, dwarf2reader::DW_EH_PE_udata8,
- &pointer_size));
- EXPECT_EQ(8U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_sleb128) {
- static const uint8_t data[] = { 0x42, 0xff, 0xfb, 0x73 };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(4);
- EXPECT_EQ(-0x030201U & 0xffffffff,
- reader.ReadEncodedPointer(data + 1, dwarf2reader::DW_EH_PE_sleb128,
- &pointer_size));
- EXPECT_EQ(3U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_sdata2) {
- static const uint8_t data[] = { 0xb9, 0xbf };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(8);
- EXPECT_EQ(0xffffffffffffbfb9ULL,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_sdata2,
- &pointer_size));
- EXPECT_EQ(2U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_sdata4) {
- static const uint8_t data[] = { 0xa0, 0xca, 0xf2, 0xb8, 0xc2, 0xad };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(8);
- EXPECT_EQ(0xffffffffadc2b8f2ULL,
- reader.ReadEncodedPointer(data + 2, dwarf2reader::DW_EH_PE_sdata4,
- &pointer_size));
- EXPECT_EQ(4U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_sdata8) {
- static const uint8_t data[] = {
- 0xf6, 0x66, 0x57, 0x79, 0xe0, 0x0c, 0x9b, 0x26, 0x87
- };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(8);
- EXPECT_EQ(0x87269b0ce0795766ULL,
- reader.ReadEncodedPointer(data + 1, dwarf2reader::DW_EH_PE_sdata8,
- &pointer_size));
- EXPECT_EQ(8U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_pcrel) {
- static const uint8_t data[] = {
- 0x4a, 0x8b, 0x1b, 0x14, 0xc8, 0xc4, 0x02, 0xce
- };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(4);
- DwarfPointerEncoding encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_pcrel
- | dwarf2reader::DW_EH_PE_absptr);
- reader.SetCFIDataBase(0x89951377, data);
- EXPECT_EQ(0x89951377 + 3 + 0x14c8c402,
- reader.ReadEncodedPointer(data + 3, encoding, &pointer_size));
- EXPECT_EQ(4U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_textrel) {
- static const uint8_t data[] = {
- 0xd9, 0x0d, 0x05, 0x17, 0xc9, 0x7a, 0x42, 0x1e
- };
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(4);
- reader.SetTextBase(0xb91beaf0);
- DwarfPointerEncoding encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_textrel
- | dwarf2reader::DW_EH_PE_sdata2);
- EXPECT_EQ((0xb91beaf0 + 0xffffc917) & 0xffffffff,
- reader.ReadEncodedPointer(data + 3, encoding, &pointer_size));
- EXPECT_EQ(2U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_datarel) {
- static const uint8_t data[] = {
- 0x16, 0xf2, 0xbb, 0x82, 0x68, 0xa7, 0xbc, 0x39
- };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(8);
- reader.SetDataBase(0xbef308bd25ce74f0ULL);
- DwarfPointerEncoding encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_datarel
- | dwarf2reader::DW_EH_PE_sleb128);
- EXPECT_EQ(0xbef308bd25ce74f0ULL + 0xfffffffffffa013bULL,
- reader.ReadEncodedPointer(data + 2, encoding, &pointer_size));
- EXPECT_EQ(3U, pointer_size);
-}
-
-TEST_F(Reader, DW_EH_PE_funcrel) {
- static const uint8_t data[] = {
- 0x84, 0xf8, 0x14, 0x01, 0x61, 0xd1, 0x48, 0xc9
- };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetAddressSize(4);
- reader.SetFunctionBase(0x823c3520);
- DwarfPointerEncoding encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_funcrel
- | dwarf2reader::DW_EH_PE_udata2);
- EXPECT_EQ(0x823c3520 + 0xd148,
- reader.ReadEncodedPointer(data + 5, encoding, &pointer_size));
- EXPECT_EQ(2U, pointer_size);
-}
-
-TEST(UsableBase, CFI) {
- static const uint8_t data[] = { 0x42 };
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetCFIDataBase(0xb31cbd20, data);
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_absptr));
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_pcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_textrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_datarel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_funcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_omit));
- EXPECT_FALSE(reader.UsableEncoding(DwarfPointerEncoding(0x60)));
-}
-
-TEST(UsableBase, Text) {
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetTextBase(0xa899ccb9);
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_absptr));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_pcrel));
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_textrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_datarel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_funcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_omit));
- EXPECT_FALSE(reader.UsableEncoding(DwarfPointerEncoding(0x60)));
-}
-
-TEST(UsableBase, Data) {
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetDataBase(0xf7b10bcd);
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_absptr));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_pcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_textrel));
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_datarel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_funcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_omit));
- EXPECT_FALSE(reader.UsableEncoding(DwarfPointerEncoding(0x60)));
-}
-
-TEST(UsableBase, Function) {
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetFunctionBase(0xc2c0ed81);
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_absptr));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_pcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_textrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_datarel));
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_funcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_omit));
- EXPECT_FALSE(reader.UsableEncoding(DwarfPointerEncoding(0x60)));
-}
-
-TEST(UsableBase, ClearFunction) {
- ByteReader reader(ENDIANNESS_BIG);
- reader.SetFunctionBase(0xc2c0ed81);
- reader.ClearFunctionBase();
- EXPECT_TRUE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_absptr));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_pcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_textrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_datarel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_funcrel));
- EXPECT_FALSE(reader.UsableEncoding(dwarf2reader::DW_EH_PE_omit));
- EXPECT_FALSE(reader.UsableEncoding(DwarfPointerEncoding(0x60)));
-}
-
-struct AlignedFixture {
- AlignedFixture() : reader(ENDIANNESS_BIG) { reader.SetAddressSize(4); }
- static const uint8_t data[10];
- ByteReader reader;
- size_t pointer_size;
-};
-
-const uint8_t AlignedFixture::data[10] = {
- 0xfe, 0x6e, 0x93, 0xd8, 0x34, 0xd5, 0x1c, 0xd3, 0xac, 0x2b
-};
-
-class Aligned: public AlignedFixture, public Test { };
-
-TEST_F(Aligned, DW_EH_PE_aligned0) {
- reader.SetCFIDataBase(0xb440305c, data);
- EXPECT_EQ(0xfe6e93d8U,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(4U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned1) {
- reader.SetCFIDataBase(0xb440305d, data);
- EXPECT_EQ(0xd834d51cU,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(7U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned2) {
- reader.SetCFIDataBase(0xb440305e, data);
- EXPECT_EQ(0x93d834d5U,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(6U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned3) {
- reader.SetCFIDataBase(0xb440305f, data);
- EXPECT_EQ(0x6e93d834U,
- reader.ReadEncodedPointer(data, dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(5U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned11) {
- reader.SetCFIDataBase(0xb4403061, data);
- EXPECT_EQ(0xd834d51cU,
- reader.ReadEncodedPointer(data + 1,
- dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(6U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned30) {
- reader.SetCFIDataBase(0xb4403063, data);
- EXPECT_EQ(0x6e93d834U,
- reader.ReadEncodedPointer(data + 1,
- dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(4U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned23) {
- reader.SetCFIDataBase(0xb4403062, data);
- EXPECT_EQ(0x1cd3ac2bU,
- reader.ReadEncodedPointer(data + 3,
- dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(7U, pointer_size);
-}
-
-TEST_F(Aligned, DW_EH_PE_aligned03) {
- reader.SetCFIDataBase(0xb4403064, data);
- EXPECT_EQ(0x34d51cd3U,
- reader.ReadEncodedPointer(data + 3,
- dwarf2reader::DW_EH_PE_aligned,
- &pointer_size));
- EXPECT_EQ(5U, pointer_size);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.cc
deleted file mode 100644
index dbc2efae6f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// cfi_assembler.cc: Implementation of google_breakpad::CFISection class.
-// See cfi_assembler.h for details.
-
-#include "common/dwarf/cfi_assembler.h"
-
-#include <assert.h>
-#include <stdlib.h>
-
-namespace google_breakpad {
-
-using dwarf2reader::DwarfPointerEncoding;
-
-CFISection &CFISection::CIEHeader(uint64_t code_alignment_factor,
- int data_alignment_factor,
- unsigned return_address_register,
- uint8_t version,
- const string &augmentation,
- bool dwarf64) {
- assert(!entry_length_);
- entry_length_ = new PendingLength();
- in_fde_ = false;
-
- if (dwarf64) {
- D32(kDwarf64InitialLengthMarker);
- D64(entry_length_->length);
- entry_length_->start = Here();
- D64(eh_frame_ ? kEHFrame64CIEIdentifier : kDwarf64CIEIdentifier);
- } else {
- D32(entry_length_->length);
- entry_length_->start = Here();
- D32(eh_frame_ ? kEHFrame32CIEIdentifier : kDwarf32CIEIdentifier);
- }
- D8(version);
- AppendCString(augmentation);
- ULEB128(code_alignment_factor);
- LEB128(data_alignment_factor);
- if (version == 1)
- D8(return_address_register);
- else
- ULEB128(return_address_register);
- return *this;
-}
-
-CFISection &CFISection::FDEHeader(Label cie_pointer,
- uint64_t initial_location,
- uint64_t address_range,
- bool dwarf64) {
- assert(!entry_length_);
- entry_length_ = new PendingLength();
- in_fde_ = true;
- fde_start_address_ = initial_location;
-
- if (dwarf64) {
- D32(0xffffffff);
- D64(entry_length_->length);
- entry_length_->start = Here();
- if (eh_frame_)
- D64(Here() - cie_pointer);
- else
- D64(cie_pointer);
- } else {
- D32(entry_length_->length);
- entry_length_->start = Here();
- if (eh_frame_)
- D32(Here() - cie_pointer);
- else
- D32(cie_pointer);
- }
- EncodedPointer(initial_location);
- // The FDE length in an .eh_frame section uses the same encoding as the
- // initial location, but ignores the base address (selected by the upper
- // nybble of the encoding), as it's a length, not an address that can be
- // made relative.
- EncodedPointer(address_range,
- DwarfPointerEncoding(pointer_encoding_ & 0x0f));
- return *this;
-}
-
-CFISection &CFISection::FinishEntry() {
- assert(entry_length_);
- Align(address_size_, dwarf2reader::DW_CFA_nop);
- entry_length_->length = Here() - entry_length_->start;
- delete entry_length_;
- entry_length_ = NULL;
- in_fde_ = false;
- return *this;
-}
-
-CFISection &CFISection::EncodedPointer(uint64_t address,
- DwarfPointerEncoding encoding,
- const EncodedPointerBases &bases) {
- // Omitted data is extremely easy to emit.
- if (encoding == dwarf2reader::DW_EH_PE_omit)
- return *this;
-
- // If (encoding & dwarf2reader::DW_EH_PE_indirect) != 0, then we assume
- // that ADDRESS is the address at which the pointer is stored --- in
- // other words, that bit has no effect on how we write the pointer.
- encoding = DwarfPointerEncoding(encoding & ~dwarf2reader::DW_EH_PE_indirect);
-
- // Find the base address to which this pointer is relative. The upper
- // nybble of the encoding specifies this.
- uint64_t base;
- switch (encoding & 0xf0) {
- case dwarf2reader::DW_EH_PE_absptr: base = 0; break;
- case dwarf2reader::DW_EH_PE_pcrel: base = bases.cfi + Size(); break;
- case dwarf2reader::DW_EH_PE_textrel: base = bases.text; break;
- case dwarf2reader::DW_EH_PE_datarel: base = bases.data; break;
- case dwarf2reader::DW_EH_PE_funcrel: base = fde_start_address_; break;
- case dwarf2reader::DW_EH_PE_aligned: base = 0; break;
- default: abort();
- };
-
- // Make ADDRESS relative. Yes, this is appropriate even for "absptr"
- // values; see gcc/unwind-pe.h.
- address -= base;
-
- // Align the pointer, if required.
- if ((encoding & 0xf0) == dwarf2reader::DW_EH_PE_aligned)
- Align(AddressSize());
-
- // Append ADDRESS to this section in the appropriate form. For the
- // fixed-width forms, we don't need to differentiate between signed and
- // unsigned encodings, because ADDRESS has already been extended to 64
- // bits before it was passed to us.
- switch (encoding & 0x0f) {
- case dwarf2reader::DW_EH_PE_absptr:
- Address(address);
- break;
-
- case dwarf2reader::DW_EH_PE_uleb128:
- ULEB128(address);
- break;
-
- case dwarf2reader::DW_EH_PE_sleb128:
- LEB128(address);
- break;
-
- case dwarf2reader::DW_EH_PE_udata2:
- case dwarf2reader::DW_EH_PE_sdata2:
- D16(address);
- break;
-
- case dwarf2reader::DW_EH_PE_udata4:
- case dwarf2reader::DW_EH_PE_sdata4:
- D32(address);
- break;
-
- case dwarf2reader::DW_EH_PE_udata8:
- case dwarf2reader::DW_EH_PE_sdata8:
- D64(address);
- break;
-
- default:
- abort();
- }
-
- return *this;
-};
-
-const uint32_t CFISection::kDwarf64InitialLengthMarker;
-const uint32_t CFISection::kDwarf32CIEIdentifier;
-const uint64_t CFISection::kDwarf64CIEIdentifier;
-const uint32_t CFISection::kEHFrame32CIEIdentifier;
-const uint64_t CFISection::kEHFrame64CIEIdentifier;
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.h
deleted file mode 100644
index 227812b588..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/cfi_assembler.h
+++ /dev/null
@@ -1,269 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// cfi_assembler.h: Define CFISection, a class for creating properly
-// (and improperly) formatted DWARF CFI data for unit tests.
-
-#ifndef PROCESSOR_CFI_ASSEMBLER_H_
-#define PROCESSOR_CFI_ASSEMBLER_H_
-
-#include <string>
-
-#include "common/dwarf/dwarf2enums.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-using dwarf2reader::DwarfPointerEncoding;
-using google_breakpad::test_assembler::Endianness;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-
-class CFISection: public Section {
- public:
-
- // CFI augmentation strings beginning with 'z', defined by the
- // Linux/IA-64 C++ ABI, can specify interesting encodings for
- // addresses appearing in FDE headers and call frame instructions (and
- // for additional fields whose presence the augmentation string
- // specifies). In particular, pointers can be specified to be relative
- // to various base address: the start of the .text section, the
- // location holding the address itself, and so on. These allow the
- // frame data to be position-independent even when they live in
- // write-protected pages. These variants are specified at the
- // following two URLs:
- //
- // http://refspecs.linux-foundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/dwarfext.html
- // http://refspecs.linux-foundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
- //
- // CFISection leaves the production of well-formed 'z'-augmented CIEs and
- // FDEs to the user, but does provide EncodedPointer, to emit
- // properly-encoded addresses for a given pointer encoding.
- // EncodedPointer uses an instance of this structure to find the base
- // addresses it should use; you can establish a default for all encoded
- // pointers appended to this section with SetEncodedPointerBases.
- struct EncodedPointerBases {
- EncodedPointerBases() : cfi(), text(), data() { }
-
- // The starting address of this CFI section in memory, for
- // DW_EH_PE_pcrel. DW_EH_PE_pcrel pointers may only be used in data
- // that has is loaded into the program's address space.
- uint64_t cfi;
-
- // The starting address of this file's .text section, for DW_EH_PE_textrel.
- uint64_t text;
-
- // The starting address of this file's .got or .eh_frame_hdr section,
- // for DW_EH_PE_datarel.
- uint64_t data;
- };
-
- // Create a CFISection whose endianness is ENDIANNESS, and where
- // machine addresses are ADDRESS_SIZE bytes long. If EH_FRAME is
- // true, use the .eh_frame format, as described by the Linux
- // Standards Base Core Specification, instead of the DWARF CFI
- // format.
- CFISection(Endianness endianness, size_t address_size,
- bool eh_frame = false)
- : Section(endianness), address_size_(address_size), eh_frame_(eh_frame),
- pointer_encoding_(dwarf2reader::DW_EH_PE_absptr),
- encoded_pointer_bases_(), entry_length_(NULL), in_fde_(false) {
- // The 'start', 'Here', and 'Mark' members of a CFISection all refer
- // to section offsets.
- start() = 0;
- }
-
- // Return this CFISection's address size.
- size_t AddressSize() const { return address_size_; }
-
- // Return true if this CFISection uses the .eh_frame format, or
- // false if it contains ordinary DWARF CFI data.
- bool ContainsEHFrame() const { return eh_frame_; }
-
- // Use ENCODING for pointers in calls to FDEHeader and EncodedPointer.
- void SetPointerEncoding(DwarfPointerEncoding encoding) {
- pointer_encoding_ = encoding;
- }
-
- // Use the addresses in BASES as the base addresses for encoded
- // pointers in subsequent calls to FDEHeader or EncodedPointer.
- // This function makes a copy of BASES.
- void SetEncodedPointerBases(const EncodedPointerBases &bases) {
- encoded_pointer_bases_ = bases;
- }
-
- // Append a Common Information Entry header to this section with the
- // given values. If dwarf64 is true, use the 64-bit DWARF initial
- // length format for the CIE's initial length. Return a reference to
- // this section. You should call FinishEntry after writing the last
- // instruction for the CIE.
- //
- // Before calling this function, you will typically want to use Mark
- // or Here to make a label to pass to FDEHeader that refers to this
- // CIE's position in the section.
- CFISection &CIEHeader(uint64_t code_alignment_factor,
- int data_alignment_factor,
- unsigned return_address_register,
- uint8_t version = 3,
- const string &augmentation = "",
- bool dwarf64 = false);
-
- // Append a Frame Description Entry header to this section with the
- // given values. If dwarf64 is true, use the 64-bit DWARF initial
- // length format for the CIE's initial length. Return a reference to
- // this section. You should call FinishEntry after writing the last
- // instruction for the CIE.
- //
- // This function doesn't support entries that are longer than
- // 0xffffff00 bytes. (The "initial length" is always a 32-bit
- // value.) Nor does it support .debug_frame sections longer than
- // 0xffffff00 bytes.
- CFISection &FDEHeader(Label cie_pointer,
- uint64_t initial_location,
- uint64_t address_range,
- bool dwarf64 = false);
-
- // Note the current position as the end of the last CIE or FDE we
- // started, after padding with DW_CFA_nops for alignment. This
- // defines the label representing the entry's length, cited in the
- // entry's header. Return a reference to this section.
- CFISection &FinishEntry();
-
- // Append the contents of BLOCK as a DW_FORM_block value: an
- // unsigned LEB128 length, followed by that many bytes of data.
- CFISection &Block(const string &block) {
- ULEB128(block.size());
- Append(block);
- return *this;
- }
-
- // Append ADDRESS to this section, in the appropriate size and
- // endianness. Return a reference to this section.
- CFISection &Address(uint64_t address) {
- Section::Append(endianness(), address_size_, address);
- return *this;
- }
- CFISection &Address(Label address) {
- Section::Append(endianness(), address_size_, address);
- return *this;
- }
-
- // Append ADDRESS to this section, using ENCODING and BASES. ENCODING
- // defaults to this section's default encoding, established by
- // SetPointerEncoding. BASES defaults to this section's bases, set by
- // SetEncodedPointerBases. If the DW_EH_PE_indirect bit is set in the
- // encoding, assume that ADDRESS is where the true address is stored.
- // Return a reference to this section.
- //
- // (C++ doesn't let me use default arguments here, because I want to
- // refer to members of *this in the default argument expression.)
- CFISection &EncodedPointer(uint64_t address) {
- return EncodedPointer(address, pointer_encoding_, encoded_pointer_bases_);
- }
- CFISection &EncodedPointer(uint64_t address, DwarfPointerEncoding encoding) {
- return EncodedPointer(address, encoding, encoded_pointer_bases_);
- }
- CFISection &EncodedPointer(uint64_t address, DwarfPointerEncoding encoding,
- const EncodedPointerBases &bases);
-
- // Restate some member functions, to keep chaining working nicely.
- CFISection &Mark(Label *label) { Section::Mark(label); return *this; }
- CFISection &D8(uint8_t v) { Section::D8(v); return *this; }
- CFISection &D16(uint16_t v) { Section::D16(v); return *this; }
- CFISection &D16(Label v) { Section::D16(v); return *this; }
- CFISection &D32(uint32_t v) { Section::D32(v); return *this; }
- CFISection &D32(const Label &v) { Section::D32(v); return *this; }
- CFISection &D64(uint64_t v) { Section::D64(v); return *this; }
- CFISection &D64(const Label &v) { Section::D64(v); return *this; }
- CFISection &LEB128(long long v) { Section::LEB128(v); return *this; }
- CFISection &ULEB128(uint64_t v) { Section::ULEB128(v); return *this; }
-
- private:
- // A length value that we've appended to the section, but is not yet
- // known. LENGTH is the appended value; START is a label referring
- // to the start of the data whose length was cited.
- struct PendingLength {
- Label length;
- Label start;
- };
-
- // Constants used in CFI/.eh_frame data:
-
- // If the first four bytes of an "initial length" are this constant, then
- // the data uses the 64-bit DWARF format, and the length itself is the
- // subsequent eight bytes.
- static const uint32_t kDwarf64InitialLengthMarker = 0xffffffffU;
-
- // The CIE identifier for 32- and 64-bit DWARF CFI and .eh_frame data.
- static const uint32_t kDwarf32CIEIdentifier = ~(uint32_t)0;
- static const uint64_t kDwarf64CIEIdentifier = ~(uint64_t)0;
- static const uint32_t kEHFrame32CIEIdentifier = 0;
- static const uint64_t kEHFrame64CIEIdentifier = 0;
-
- // The size of a machine address for the data in this section.
- size_t address_size_;
-
- // If true, we are generating a Linux .eh_frame section, instead of
- // a standard DWARF .debug_frame section.
- bool eh_frame_;
-
- // The encoding to use for FDE pointers.
- DwarfPointerEncoding pointer_encoding_;
-
- // The base addresses to use when emitting encoded pointers.
- EncodedPointerBases encoded_pointer_bases_;
-
- // The length value for the current entry.
- //
- // Oddly, this must be dynamically allocated. Labels never get new
- // values; they only acquire constraints on the value they already
- // have, or assert if you assign them something incompatible. So
- // each header needs truly fresh Label objects to cite in their
- // headers and track their positions. The alternative is explicit
- // destructor invocation and a placement new. Ick.
- PendingLength *entry_length_;
-
- // True if we are currently emitting an FDE --- that is, we have
- // called FDEHeader but have not yet called FinishEntry.
- bool in_fde_;
-
- // If in_fde_ is true, this is its starting address. We use this for
- // emitting DW_EH_PE_funcrel pointers.
- uint64_t fde_start_address_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_CFI_ASSEMBLER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc
deleted file mode 100644
index 94542b5ea9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf2diehandler.cc: Implement the dwarf2reader::DieDispatcher class.
-// See dwarf2diehandler.h for details.
-
-#include <assert.h>
-#include <stdint.h>
-
-#include <string>
-
-#include "common/dwarf/dwarf2diehandler.h"
-#include "common/using_std_string.h"
-
-namespace dwarf2reader {
-
-DIEDispatcher::~DIEDispatcher() {
- while (!die_handlers_.empty()) {
- HandlerStack &entry = die_handlers_.top();
- if (entry.handler_ != root_handler_)
- delete entry.handler_;
- die_handlers_.pop();
- }
-}
-
-bool DIEDispatcher::StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version) {
- return root_handler_->StartCompilationUnit(offset, address_size,
- offset_size, cu_length,
- dwarf_version);
-}
-
-bool DIEDispatcher::StartDIE(uint64 offset, enum DwarfTag tag) {
- // The stack entry for the parent of this DIE, if there is one.
- HandlerStack *parent = die_handlers_.empty() ? NULL : &die_handlers_.top();
-
- // Does this call indicate that we're done receiving the parent's
- // attributes' values? If so, call its EndAttributes member function.
- if (parent && parent->handler_ && !parent->reported_attributes_end_) {
- parent->reported_attributes_end_ = true;
- if (!parent->handler_->EndAttributes()) {
- // Finish off this handler now. and edit *PARENT to indicate that
- // we don't want to visit any of the children.
- parent->handler_->Finish();
- if (parent->handler_ != root_handler_)
- delete parent->handler_;
- parent->handler_ = NULL;
- return false;
- }
- }
-
- // Find a handler for this DIE.
- DIEHandler *handler;
- if (parent) {
- if (parent->handler_)
- // Ask the parent to find a handler.
- handler = parent->handler_->FindChildHandler(offset, tag);
- else
- // No parent handler means we're not interested in any of our
- // children.
- handler = NULL;
- } else {
- // This is the root DIE. For a non-root DIE, the parent's handler
- // decides whether to visit it, but the root DIE has no parent
- // handler, so we have a special method on the root DIE handler
- // itself to decide.
- if (root_handler_->StartRootDIE(offset, tag))
- handler = root_handler_;
- else
- handler = NULL;
- }
-
- // Push a handler stack entry for this new handler. As an
- // optimization, we don't push NULL-handler entries on top of other
- // NULL-handler entries; we just let the oldest such entry stand for
- // the whole subtree.
- if (handler || !parent || parent->handler_) {
- HandlerStack entry;
- entry.offset_ = offset;
- entry.handler_ = handler;
- entry.reported_attributes_end_ = false;
- die_handlers_.push(entry);
- }
-
- return handler != NULL;
-}
-
-void DIEDispatcher::EndDIE(uint64 offset) {
- assert(!die_handlers_.empty());
- HandlerStack *entry = &die_handlers_.top();
- if (entry->handler_) {
- // This entry had better be the handler for this DIE.
- assert(entry->offset_ == offset);
- // If a DIE has no children, this EndDIE call indicates that we're
- // done receiving its attributes' values.
- if (!entry->reported_attributes_end_)
- entry->handler_->EndAttributes(); // Ignore return value: no children.
- entry->handler_->Finish();
- if (entry->handler_ != root_handler_)
- delete entry->handler_;
- } else {
- // If this DIE is within a tree we're ignoring, then don't pop the
- // handler stack: that entry stands for the whole tree.
- if (entry->offset_ != offset)
- return;
- }
- die_handlers_.pop();
-}
-
-void DIEDispatcher::ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- HandlerStack &current = die_handlers_.top();
- // This had better be an attribute of the DIE we were meant to handle.
- assert(offset == current.offset_);
- current.handler_->ProcessAttributeUnsigned(attr, form, data);
-}
-
-void DIEDispatcher::ProcessAttributeSigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) {
- HandlerStack &current = die_handlers_.top();
- // This had better be an attribute of the DIE we were meant to handle.
- assert(offset == current.offset_);
- current.handler_->ProcessAttributeSigned(attr, form, data);
-}
-
-void DIEDispatcher::ProcessAttributeReference(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- HandlerStack &current = die_handlers_.top();
- // This had better be an attribute of the DIE we were meant to handle.
- assert(offset == current.offset_);
- current.handler_->ProcessAttributeReference(attr, form, data);
-}
-
-void DIEDispatcher::ProcessAttributeBuffer(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const uint8_t *data,
- uint64 len) {
- HandlerStack &current = die_handlers_.top();
- // This had better be an attribute of the DIE we were meant to handle.
- assert(offset == current.offset_);
- current.handler_->ProcessAttributeBuffer(attr, form, data, len);
-}
-
-void DIEDispatcher::ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string& data) {
- HandlerStack &current = die_handlers_.top();
- // This had better be an attribute of the DIE we were meant to handle.
- assert(offset == current.offset_);
- current.handler_->ProcessAttributeString(attr, form, data);
-}
-
-void DIEDispatcher::ProcessAttributeSignature(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 signature) {
- HandlerStack &current = die_handlers_.top();
- // This had better be an attribute of the DIE we were meant to handle.
- assert(offset == current.offset_);
- current.handler_->ProcessAttributeSignature(attr, form, signature);
-}
-
-} // namespace dwarf2reader
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h
deleted file mode 100644
index a1e589a863..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler.h
+++ /dev/null
@@ -1,365 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf2reader::CompilationUnit is a simple and direct parser for
-// DWARF data, but its handler interface is not convenient to use. In
-// particular:
-//
-// - CompilationUnit calls Dwarf2Handler's member functions to report
-// every attribute's value, regardless of what sort of DIE it is.
-// As a result, the ProcessAttributeX functions end up looking like
-// this:
-//
-// switch (parent_die_tag) {
-// case DW_TAG_x:
-// switch (attribute_name) {
-// case DW_AT_y:
-// handle attribute y of DIE type x
-// ...
-// } break;
-// ...
-// }
-//
-// In C++ it's much nicer to use virtual function dispatch to find
-// the right code for a given case than to switch on the DIE tag
-// like this.
-//
-// - Processing different kinds of DIEs requires different sets of
-// data: lexical block DIEs have start and end addresses, but struct
-// type DIEs don't. It would be nice to be able to have separate
-// handler classes for separate kinds of DIEs, each with the members
-// appropriate to its role, instead of having one handler class that
-// needs to hold data for every DIE type.
-//
-// - There should be a separate instance of the appropriate handler
-// class for each DIE, instead of a single object with tables
-// tracking all the dies in the compilation unit.
-//
-// - It's not convenient to take some action after all a DIE's
-// attributes have been seen, but before visiting any of its
-// children. The only indication you have that a DIE's attribute
-// list is complete is that you get either a StartDIE or an EndDIE
-// call.
-//
-// - It's not convenient to make use of the tree structure of the
-// DIEs. Skipping all the children of a given die requires
-// maintaining state and returning false from StartDIE until we get
-// an EndDIE call with the appropriate offset.
-//
-// This interface tries to take care of all that. (You're shocked, I'm sure.)
-//
-// Using the classes here, you provide an initial handler for the root
-// DIE of the compilation unit. Each handler receives its DIE's
-// attributes, and provides fresh handler objects for children of
-// interest, if any. The three classes are:
-//
-// - DIEHandler: the base class for your DIE-type-specific handler
-// classes.
-//
-// - RootDIEHandler: derived from DIEHandler, the base class for your
-// root DIE handler class.
-//
-// - DIEDispatcher: derived from Dwarf2Handler, an instance of this
-// invokes your DIE-type-specific handler objects.
-//
-// In detail:
-//
-// - Define handler classes specialized for the DIE types you're
-// interested in. These handler classes must inherit from
-// DIEHandler. Thus:
-//
-// class My_DW_TAG_X_Handler: public DIEHandler { ... };
-// class My_DW_TAG_Y_Handler: public DIEHandler { ... };
-//
-// DIEHandler subclasses needn't correspond exactly to single DIE
-// types, as shown here; the point is that you can have several
-// different classes appropriate to different kinds of DIEs.
-//
-// - In particular, define a handler class for the compilation
-// unit's root DIE, that inherits from RootDIEHandler:
-//
-// class My_DW_TAG_compile_unit_Handler: public RootDIEHandler { ... };
-//
-// RootDIEHandler inherits from DIEHandler, adding a few additional
-// member functions for examining the compilation unit as a whole,
-// and other quirks of rootness.
-//
-// - Then, create a DIEDispatcher instance, passing it an instance of
-// your root DIE handler class, and use that DIEDispatcher as the
-// dwarf2reader::CompilationUnit's handler:
-//
-// My_DW_TAG_compile_unit_Handler root_die_handler(...);
-// DIEDispatcher die_dispatcher(&root_die_handler);
-// CompilationUnit reader(sections, offset, bytereader, &die_dispatcher);
-//
-// Here, 'die_dispatcher' acts as a shim between 'reader' and the
-// various DIE-specific handlers you have defined.
-//
-// - When you call reader.Start(), die_dispatcher behaves as follows,
-// starting with your root die handler and the compilation unit's
-// root DIE:
-//
-// - It calls the handler's ProcessAttributeX member functions for
-// each of the DIE's attributes.
-//
-// - It calls the handler's EndAttributes member function. This
-// should return true if any of the DIE's children should be
-// visited, in which case:
-//
-// - For each of the DIE's children, die_dispatcher calls the
-// DIE's handler's FindChildHandler member function. If that
-// returns a pointer to a DIEHandler instance, then
-// die_dispatcher uses that handler to process the child, using
-// this procedure recursively. Alternatively, if
-// FindChildHandler returns NULL, die_dispatcher ignores that
-// child and its descendants.
-//
-// - When die_dispatcher has finished processing all the DIE's
-// children, it invokes the handler's Finish() member function,
-// and destroys the handler. (As a special case, it doesn't
-// destroy the root DIE handler.)
-//
-// This allows the code for handling a particular kind of DIE to be
-// gathered together in a single class, makes it easy to skip all the
-// children or individual children of a particular DIE, and provides
-// appropriate parental context for each die.
-
-#ifndef COMMON_DWARF_DWARF2DIEHANDLER_H__
-#define COMMON_DWARF_DWARF2DIEHANDLER_H__
-
-#include <stdint.h>
-
-#include <stack>
-#include <string>
-
-#include "common/dwarf/types.h"
-#include "common/dwarf/dwarf2enums.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/using_std_string.h"
-
-namespace dwarf2reader {
-
-// A base class for handlers for specific DIE types. The series of
-// calls made on a DIE handler is as follows:
-//
-// - for each attribute of the DIE:
-// - ProcessAttributeX()
-// - EndAttributes()
-// - if that returned true, then for each child:
-// - FindChildHandler()
-// - if that returns a non-NULL pointer to a new handler:
-// - recurse, with the new handler and the child die
-// - Finish()
-// - destruction
-class DIEHandler {
- public:
- DIEHandler() { }
- virtual ~DIEHandler() { }
-
- // When we visit a DIE, we first use these member functions to
- // report the DIE's attributes and their values. These have the
- // same restrictions as the corresponding member functions of
- // dwarf2reader::Dwarf2Handler.
- //
- // Since DWARF does not specify in what order attributes must
- // appear, avoid making decisions in these functions that would be
- // affected by the presence of other attributes. The EndAttributes
- // function is a more appropriate place for such work, as all the
- // DIE's attributes have been seen at that point.
- //
- // The default definitions ignore the values they are passed.
- virtual void ProcessAttributeUnsigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) { }
- virtual void ProcessAttributeSigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) { }
- virtual void ProcessAttributeReference(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) { }
- virtual void ProcessAttributeBuffer(enum DwarfAttribute attr,
- enum DwarfForm form,
- const uint8_t *data,
- uint64 len) { }
- virtual void ProcessAttributeString(enum DwarfAttribute attr,
- enum DwarfForm form,
- const string& data) { }
- virtual void ProcessAttributeSignature(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 signture) { }
-
- // Once we have reported all the DIE's attributes' values, we call
- // this member function. If it returns false, we skip all the DIE's
- // children. If it returns true, we call FindChildHandler on each
- // child. If that returns a handler object, we use that to visit
- // the child; otherwise, we skip the child.
- //
- // This is a good place to make decisions that depend on more than
- // one attribute. DWARF does not specify in what order attributes
- // must appear, so only when the EndAttributes function is called
- // does the handler have a complete picture of the DIE's attributes.
- //
- // The default definition elects to ignore the DIE's children.
- // You'll need to override this if you override FindChildHandler,
- // but at least the default behavior isn't to pass the children to
- // FindChildHandler, which then ignores them all.
- virtual bool EndAttributes() { return false; }
-
- // If EndAttributes returns true to indicate that some of the DIE's
- // children might be of interest, then we apply this function to
- // each of the DIE's children. If it returns a handler object, then
- // we use that to visit the child DIE. If it returns NULL, we skip
- // that child DIE (and all its descendants).
- //
- // OFFSET is the offset of the child; TAG indicates what kind of DIE
- // it is.
- //
- // The default definition skips all children.
- virtual DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag) {
- return NULL;
- }
-
- // When we are done processing a DIE, we call this member function.
- // This happens after the EndAttributes call, all FindChildHandler
- // calls (if any), and all operations on the children themselves (if
- // any). We call Finish on every handler --- even if EndAttributes
- // returns false.
- virtual void Finish() { };
-};
-
-// A subclass of DIEHandler, with additional kludges for handling the
-// compilation unit's root die.
-class RootDIEHandler: public DIEHandler {
- public:
- RootDIEHandler() { }
- virtual ~RootDIEHandler() { }
-
- // We pass the values reported via Dwarf2Handler::StartCompilationUnit
- // to this member function, and skip the entire compilation unit if it
- // returns false. So the root DIE handler is actually also
- // responsible for handling the compilation unit metadata.
- // The default definition always visits the compilation unit.
- virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version) { return true; }
-
- // For the root DIE handler only, we pass the offset, tag and
- // attributes of the compilation unit's root DIE. This is the only
- // way the root DIE handler can find the root DIE's tag. If this
- // function returns true, we will visit the root DIE using the usual
- // DIEHandler methods; otherwise, we skip the entire compilation
- // unit.
- //
- // The default definition elects to visit the root DIE.
- virtual bool StartRootDIE(uint64 offset, enum DwarfTag tag) { return true; }
-};
-
-class DIEDispatcher: public Dwarf2Handler {
- public:
- // Create a Dwarf2Handler which uses ROOT_HANDLER as the handler for
- // the compilation unit's root die, as described for the DIEHandler
- // class.
- DIEDispatcher(RootDIEHandler *root_handler) : root_handler_(root_handler) { }
- // Destroying a DIEDispatcher destroys all active handler objects
- // except the root handler.
- ~DIEDispatcher();
- bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version);
- bool StartDIE(uint64 offset, enum DwarfTag tag);
- void ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
- void ProcessAttributeSigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data);
- void ProcessAttributeReference(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
- void ProcessAttributeBuffer(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const uint8_t *data,
- uint64 len);
- void ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string &data);
- void ProcessAttributeSignature(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 signature);
- void EndDIE(uint64 offset);
-
- private:
-
- // The type of a handler stack entry. This includes some fields
- // which don't really need to be on the stack --- they could just be
- // single data members of DIEDispatcher --- but putting them here
- // makes it easier to see that the code is correct.
- struct HandlerStack {
- // The offset of the DIE for this handler stack entry.
- uint64 offset_;
-
- // The handler object interested in this DIE's attributes and
- // children. If NULL, we're not interested in either.
- DIEHandler *handler_;
-
- // Have we reported the end of this DIE's attributes to the handler?
- bool reported_attributes_end_;
- };
-
- // Stack of DIE attribute handlers. At StartDIE(D), the top of the
- // stack is the handler of D's parent, whom we may ask for a handler
- // for D itself. At EndDIE(D), the top of the stack is D's handler.
- // Special cases:
- //
- // - Before we've seen the compilation unit's root DIE, the stack is
- // empty; we'll call root_handler_'s special member functions, and
- // perhaps push root_handler_ on the stack to look at the root's
- // immediate children.
- //
- // - When we decide to ignore a subtree, we only push an entry on
- // the stack for the root of the tree being ignored, rather than
- // pushing lots of stack entries with handler_ set to NULL.
- std::stack<HandlerStack> die_handlers_;
-
- // The root handler. We don't push it on die_handlers_ until we
- // actually get the StartDIE call for the root.
- RootDIEHandler *root_handler_;
-};
-
-} // namespace dwarf2reader
-#endif // COMMON_DWARF_DWARF2DIEHANDLER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
deleted file mode 100644
index db70eb31b9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2diehandler_unittest.cc
+++ /dev/null
@@ -1,527 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf2diehander_unittest.cc: Unit tests for google_breakpad::DIEDispatcher.
-
-#include <stdint.h>
-
-#include <string>
-#include <utility>
-
-#include "breakpad_googletest_includes.h"
-
-#include "common/dwarf/dwarf2diehandler.h"
-#include "common/using_std_string.h"
-
-using std::make_pair;
-
-using ::testing::_;
-using ::testing::ContainerEq;
-using ::testing::ElementsAreArray;
-using ::testing::Eq;
-using ::testing::InSequence;
-using ::testing::Return;
-using ::testing::Sequence;
-using ::testing::StrEq;
-
-using dwarf2reader::DIEDispatcher;
-using dwarf2reader::DIEHandler;
-using dwarf2reader::DwarfAttribute;
-using dwarf2reader::DwarfForm;
-using dwarf2reader::DwarfTag;
-using dwarf2reader::RootDIEHandler;
-
-class MockDIEHandler: public DIEHandler {
- public:
- MOCK_METHOD3(ProcessAttributeUnsigned,
- void(DwarfAttribute, DwarfForm, uint64));
- MOCK_METHOD3(ProcessAttributeSigned,
- void(DwarfAttribute, DwarfForm, int64));
- MOCK_METHOD3(ProcessAttributeReference,
- void(DwarfAttribute, DwarfForm, uint64));
- MOCK_METHOD4(ProcessAttributeBuffer,
- void(DwarfAttribute, DwarfForm, const uint8_t *, uint64));
- MOCK_METHOD3(ProcessAttributeString,
- void(DwarfAttribute, DwarfForm, const string &));
- MOCK_METHOD3(ProcessAttributeSignature,
- void(DwarfAttribute, DwarfForm, uint64));
- MOCK_METHOD0(EndAttributes, bool());
- MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64, DwarfTag));
- MOCK_METHOD0(Finish, void());
-};
-
-class MockRootDIEHandler: public RootDIEHandler {
- public:
- MOCK_METHOD3(ProcessAttributeUnsigned,
- void(DwarfAttribute, DwarfForm, uint64));
- MOCK_METHOD3(ProcessAttributeSigned,
- void(DwarfAttribute, DwarfForm, int64));
- MOCK_METHOD3(ProcessAttributeReference,
- void(DwarfAttribute, DwarfForm, uint64));
- MOCK_METHOD4(ProcessAttributeBuffer,
- void(DwarfAttribute, DwarfForm, const uint8_t *, uint64));
- MOCK_METHOD3(ProcessAttributeString,
- void(DwarfAttribute, DwarfForm, const string &));
- MOCK_METHOD3(ProcessAttributeSignature,
- void(DwarfAttribute, DwarfForm, uint64));
- MOCK_METHOD0(EndAttributes, bool());
- MOCK_METHOD2(FindChildHandler, DIEHandler *(uint64, DwarfTag));
- MOCK_METHOD0(Finish, void());
- MOCK_METHOD5(StartCompilationUnit, bool(uint64, uint8, uint8, uint64, uint8));
- MOCK_METHOD2(StartRootDIE, bool(uint64, DwarfTag));
-};
-
-// If the handler elects to skip the compilation unit, the dispatcher
-// should tell the reader so.
-TEST(Dwarf2DIEHandler, SkipCompilationUnit) {
- Sequence s;
- MockRootDIEHandler mock_root_handler;
- DIEDispatcher die_dispatcher(&mock_root_handler);
-
- EXPECT_CALL(mock_root_handler,
- StartCompilationUnit(0x8d42aed77cfccf3eLL,
- 0x89, 0xdc,
- 0x2ecb4dc778a80f21LL,
- 0x66))
- .InSequence(s)
- .WillOnce(Return(false));
-
- EXPECT_FALSE(die_dispatcher.StartCompilationUnit(0x8d42aed77cfccf3eLL,
- 0x89, 0xdc,
- 0x2ecb4dc778a80f21LL,
- 0x66));
-}
-
-// If the handler elects to skip the root DIE, the dispatcher should
-// tell the reader so.
-TEST(Dwarf2DIEHandler, SkipRootDIE) {
- Sequence s;
- MockRootDIEHandler mock_root_handler;
- DIEDispatcher die_dispatcher(&mock_root_handler);
-
- EXPECT_CALL(mock_root_handler,
- StartCompilationUnit(0xde8994029fc8b999LL, 0xf4, 0x02,
- 0xb00febffa76e2b2bLL, 0x5c))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(mock_root_handler,
- StartRootDIE(0x7d08242b4b510cf2LL, (DwarfTag) 0xb4f98da6))
- .InSequence(s)
- .WillOnce(Return(false));
-
- EXPECT_TRUE(die_dispatcher.StartCompilationUnit(0xde8994029fc8b999LL,
- 0xf4, 0x02,
- 0xb00febffa76e2b2bLL, 0x5c));
- EXPECT_FALSE(die_dispatcher.StartDIE(0x7d08242b4b510cf2LL,
- (DwarfTag) 0xb4f98da6));
- die_dispatcher.EndDIE(0x7d08242b4b510cf2LL);
-}
-
-// If the handler elects to skip the root DIE's children, the
-// dispatcher should tell the reader so --- and avoid deleting the
-// root handler.
-TEST(Dwarf2DIEHandler, SkipRootDIEChildren) {
- MockRootDIEHandler mock_root_handler;
- DIEDispatcher die_dispatcher(&mock_root_handler);
-
- {
- InSequence s;
-
- EXPECT_CALL(mock_root_handler,
- StartCompilationUnit(0x15d6897480cc65a7LL, 0x26, 0xa0,
- 0x09f8bf0767f91675LL, 0xdb))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_root_handler,
- StartRootDIE(0x7d08242b4b510cf2LL, (DwarfTag) 0xb4f98da6))
- .WillOnce(Return(true));
- // Please don't tell me about my children.
- EXPECT_CALL(mock_root_handler, EndAttributes())
- .WillOnce(Return(false));
- EXPECT_CALL(mock_root_handler, Finish())
- .WillOnce(Return());
- }
-
- EXPECT_TRUE(die_dispatcher.StartCompilationUnit(0x15d6897480cc65a7LL,
- 0x26, 0xa0,
- 0x09f8bf0767f91675LL, 0xdb));
- EXPECT_TRUE(die_dispatcher.StartDIE(0x7d08242b4b510cf2LL,
- (DwarfTag) 0xb4f98da6));
- EXPECT_FALSE(die_dispatcher.StartDIE(0x435150ceedccda18LL,
- (DwarfTag) 0xc3a17bba));
- die_dispatcher.EndDIE(0x435150ceedccda18LL);
- die_dispatcher.EndDIE(0x7d08242b4b510cf2LL);
-}
-
-// The dispatcher should pass attribute values through to the die
-// handler accurately.
-TEST(Dwarf2DIEHandler, PassAttributeValues) {
- MockRootDIEHandler mock_root_handler;
- DIEDispatcher die_dispatcher(&mock_root_handler);
-
- const uint8_t buffer[10] = {
- 0x24, 0x24, 0x35, 0x9a, 0xca, 0xcf, 0xa8, 0x84, 0xa7, 0x18
- };
- string str = "\xc8\x26\x2e\x0d\xa4\x9c\x37\xd6\xfb\x1d";
-
- // Set expectations.
- {
- InSequence s;
-
- // We'll like the compilation unit header.
- EXPECT_CALL(mock_root_handler,
- StartCompilationUnit(0x8d42aed77cfccf3eLL, 0x89, 0xdc,
- 0x2ecb4dc778a80f21LL, 0x66))
- .WillOnce(Return(true));
-
- // We'll like the root DIE.
- EXPECT_CALL(mock_root_handler,
- StartRootDIE(0xe2222da01e29f2a9LL, (DwarfTag) 0x9829445c))
- .WillOnce(Return(true));
-
- // Expect some attribute values.
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeUnsigned((DwarfAttribute) 0x1cc0bfed,
- (DwarfForm) 0x424f1468,
- 0xa592571997facda1ULL))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeSigned((DwarfAttribute) 0x43694dc9,
- (DwarfForm) 0xf6f78901L,
- 0x92602a4e3bf1f446LL))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeReference((DwarfAttribute) 0x4033e8cL,
- (DwarfForm) 0xf66fbe0bL,
- 0x50fddef44734fdecULL))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeBuffer((DwarfAttribute) 0x25d7e0af,
- (DwarfForm) 0xe99a539a,
- buffer, sizeof(buffer)))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeString((DwarfAttribute) 0x310ed065,
- (DwarfForm) 0x15762fec,
- StrEq(str)))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeSignature((DwarfAttribute) 0x58790d72,
- (DwarfForm) 0x4159f138,
- 0x94682463613e6a5fULL))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler, EndAttributes())
- .WillOnce(Return(true));
- EXPECT_CALL(mock_root_handler, FindChildHandler(_, _))
- .Times(0);
- EXPECT_CALL(mock_root_handler, Finish())
- .WillOnce(Return());
- }
-
- // Drive the dispatcher.
-
- // Report the CU header.
- EXPECT_TRUE(die_dispatcher.StartCompilationUnit(0x8d42aed77cfccf3eLL,
- 0x89, 0xdc,
- 0x2ecb4dc778a80f21LL,
- 0x66));
- // Report the root DIE.
- EXPECT_TRUE(die_dispatcher.StartDIE(0xe2222da01e29f2a9LL,
- (DwarfTag) 0x9829445c));
-
- // Report some attribute values.
- die_dispatcher.ProcessAttributeUnsigned(0xe2222da01e29f2a9LL,
- (DwarfAttribute) 0x1cc0bfed,
- (DwarfForm) 0x424f1468,
- 0xa592571997facda1ULL);
- die_dispatcher.ProcessAttributeSigned(0xe2222da01e29f2a9LL,
- (DwarfAttribute) 0x43694dc9,
- (DwarfForm) 0xf6f78901,
- 0x92602a4e3bf1f446LL);
- die_dispatcher.ProcessAttributeReference(0xe2222da01e29f2a9LL,
- (DwarfAttribute) 0x4033e8c,
- (DwarfForm) 0xf66fbe0b,
- 0x50fddef44734fdecULL);
- die_dispatcher.ProcessAttributeBuffer(0xe2222da01e29f2a9LL,
- (DwarfAttribute) 0x25d7e0af,
- (DwarfForm) 0xe99a539a,
- buffer, sizeof(buffer));
- die_dispatcher.ProcessAttributeString(0xe2222da01e29f2a9LL,
- (DwarfAttribute) 0x310ed065,
- (DwarfForm) 0x15762fec,
- str);
- die_dispatcher.ProcessAttributeSignature(0xe2222da01e29f2a9LL,
- (DwarfAttribute) 0x58790d72,
- (DwarfForm) 0x4159f138,
- 0x94682463613e6a5fULL);
-
- // Finish the root DIE (and thus the CU).
- die_dispatcher.EndDIE(0xe2222da01e29f2a9LL);
-}
-
-TEST(Dwarf2DIEHandler, FindAndSkipChildren) {
- MockRootDIEHandler mock_root_handler;
- MockDIEHandler *mock_child1_handler = new(MockDIEHandler);
- MockDIEHandler *mock_child3_handler = new(MockDIEHandler);
- DIEDispatcher die_dispatcher(&mock_root_handler);
-
- {
- InSequence s;
-
- // We'll like the compilation unit header.
- EXPECT_CALL(mock_root_handler,
- StartCompilationUnit(0x9ec1e6d05e434a0eLL, 0xeb, 0x21,
- 0x47dd3c764275a216LL, 0xa5))
- .WillOnce(Return(true));
-
- // Root DIE.
- {
- EXPECT_CALL(mock_root_handler,
- StartRootDIE(0x15f0e06bdfe3c372LL, (DwarfTag) 0xf5d60c59))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_root_handler,
- ProcessAttributeSigned((DwarfAttribute) 0xf779a642,
- (DwarfForm) 0x2cb63027,
- 0x18e744661769d08fLL))
- .WillOnce(Return());
- EXPECT_CALL(mock_root_handler, EndAttributes())
- .WillOnce(Return(true));
-
- // First child DIE.
- EXPECT_CALL(mock_root_handler,
- FindChildHandler(0x149f644f8116fe8cLL,
- (DwarfTag) 0xac2cbd8c))
- .WillOnce(Return(mock_child1_handler));
- {
- EXPECT_CALL(*mock_child1_handler,
- ProcessAttributeSigned((DwarfAttribute) 0xa6fd6f65,
- (DwarfForm) 0xe4f64c41,
- 0x1b04e5444a55fe67LL))
- .WillOnce(Return());
- EXPECT_CALL(*mock_child1_handler, EndAttributes())
- .WillOnce(Return(false));
- // Skip first grandchild DIE and first great-grandchild DIE.
- EXPECT_CALL(*mock_child1_handler, Finish())
- .WillOnce(Return());
- }
-
- // Second child DIE. Root handler will decline to return a handler
- // for this child.
- EXPECT_CALL(mock_root_handler,
- FindChildHandler(0x97412be24875de9dLL,
- (DwarfTag) 0x505a068b))
- .WillOnce(Return((DIEHandler *) NULL));
-
- // Third child DIE.
- EXPECT_CALL(mock_root_handler,
- FindChildHandler(0x753c964c8ab538aeLL,
- (DwarfTag) 0x8c22970e))
- .WillOnce(Return(mock_child3_handler));
- {
- EXPECT_CALL(*mock_child3_handler,
- ProcessAttributeSigned((DwarfAttribute) 0x4e2b7cfb,
- (DwarfForm) 0x610b7ae1,
- 0x3ea5c609d7d7560fLL))
- .WillOnce(Return());
- EXPECT_CALL(*mock_child3_handler, EndAttributes())
- .WillOnce(Return(true));
- EXPECT_CALL(*mock_child3_handler, Finish())
- .WillOnce(Return());
- }
-
- EXPECT_CALL(mock_root_handler, Finish())
- .WillOnce(Return());
- }
- }
-
-
- // Drive the dispatcher.
-
- // Report the CU header.
- EXPECT_TRUE(die_dispatcher
- .StartCompilationUnit(0x9ec1e6d05e434a0eLL, 0xeb, 0x21,
- 0x47dd3c764275a216LL, 0xa5));
- // Report the root DIE.
- {
- EXPECT_TRUE(die_dispatcher.StartDIE(0x15f0e06bdfe3c372LL,
- (DwarfTag) 0xf5d60c59));
- die_dispatcher.ProcessAttributeSigned(0x15f0e06bdfe3c372LL,
- (DwarfAttribute) 0xf779a642,
- (DwarfForm) 0x2cb63027,
- 0x18e744661769d08fLL);
-
- // First child DIE.
- {
- EXPECT_TRUE(die_dispatcher.StartDIE(0x149f644f8116fe8cLL,
- (DwarfTag) 0xac2cbd8c));
- die_dispatcher.ProcessAttributeSigned(0x149f644f8116fe8cLL,
- (DwarfAttribute) 0xa6fd6f65,
- (DwarfForm) 0xe4f64c41,
- 0x1b04e5444a55fe67LL);
-
- // First grandchild DIE. Will be skipped.
- {
- EXPECT_FALSE(die_dispatcher.StartDIE(0xd68de1ee0bd29419LL,
- (DwarfTag) 0x22f05a15));
- // First great-grandchild DIE. Will be skipped without being
- // mentioned to any handler.
- {
- EXPECT_FALSE(die_dispatcher
- .StartDIE(0xb3076285d25cac25LL,
- (DwarfTag) 0xcff4061b));
- die_dispatcher.EndDIE(0xb3076285d25cac25LL);
- }
- die_dispatcher.EndDIE(0xd68de1ee0bd29419LL);
- }
- die_dispatcher.EndDIE(0x149f644f8116fe8cLL);
- }
-
- // Second child DIE. Root handler will decline to find a handler for it.
- {
- EXPECT_FALSE(die_dispatcher.StartDIE(0x97412be24875de9dLL,
- (DwarfTag) 0x505a068b));
- die_dispatcher.EndDIE(0x97412be24875de9dLL);
- }
-
- // Third child DIE.
- {
- EXPECT_TRUE(die_dispatcher.StartDIE(0x753c964c8ab538aeLL,
- (DwarfTag) 0x8c22970e));
- die_dispatcher.ProcessAttributeSigned(0x753c964c8ab538aeLL,
- (DwarfAttribute) 0x4e2b7cfb,
- (DwarfForm) 0x610b7ae1,
- 0x3ea5c609d7d7560fLL);
- die_dispatcher.EndDIE(0x753c964c8ab538aeLL);
- }
-
- // Finish the root DIE (and thus the CU).
- die_dispatcher.EndDIE(0x15f0e06bdfe3c372LL);
- }
-}
-
-// The DIEDispatcher destructor is supposed to delete all handlers on
-// the stack, except for the root.
-TEST(Dwarf2DIEHandler, FreeHandlersOnStack) {
- MockRootDIEHandler mock_root_handler;
- MockDIEHandler *mock_child_handler = new(MockDIEHandler);
- MockDIEHandler *mock_grandchild_handler = new(MockDIEHandler);
-
- {
- InSequence s;
-
- // We'll like the compilation unit header.
- EXPECT_CALL(mock_root_handler,
- StartCompilationUnit(0x87b41ba8381cd71cLL, 0xff, 0x89,
- 0x76d392ff393ddda2LL, 0xbf))
- .WillOnce(Return(true));
-
- // Root DIE.
- {
- EXPECT_CALL(mock_root_handler,
- StartRootDIE(0xbf13b761691ddc91LL, (DwarfTag) 0x98980361))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_root_handler, EndAttributes())
- .WillOnce(Return(true));
-
- // Child DIE.
- EXPECT_CALL(mock_root_handler,
- FindChildHandler(0x058f09240c5fc8c9LL,
- (DwarfTag) 0x898bf0d0))
- .WillOnce(Return(mock_child_handler));
- {
- EXPECT_CALL(*mock_child_handler, EndAttributes())
- .WillOnce(Return(true));
-
- // Grandchild DIE.
- EXPECT_CALL(*mock_child_handler,
- FindChildHandler(0x32dc00c9945dc0c8LL,
- (DwarfTag) 0x2802d007))
- .WillOnce(Return(mock_grandchild_handler));
- {
- EXPECT_CALL(*mock_grandchild_handler,
- ProcessAttributeSigned((DwarfAttribute) 0x4e2b7cfb,
- (DwarfForm) 0x610b7ae1,
- 0x3ea5c609d7d7560fLL))
- .WillOnce(Return());
-
- // At this point, we abandon the traversal, so none of the
- // usual stuff should get called.
- EXPECT_CALL(*mock_grandchild_handler, EndAttributes())
- .Times(0);
- EXPECT_CALL(*mock_grandchild_handler, Finish())
- .Times(0);
- }
-
- EXPECT_CALL(*mock_child_handler, Finish())
- .Times(0);
- }
-
- EXPECT_CALL(mock_root_handler, Finish())
- .Times(0);
- }
- }
-
- // The dispatcher.
- DIEDispatcher die_dispatcher(&mock_root_handler);
-
- // Report the CU header.
- EXPECT_TRUE(die_dispatcher
- .StartCompilationUnit(0x87b41ba8381cd71cLL, 0xff, 0x89,
- 0x76d392ff393ddda2LL, 0xbf));
- // Report the root DIE.
- {
- EXPECT_TRUE(die_dispatcher.StartDIE(0xbf13b761691ddc91LL,
- (DwarfTag) 0x98980361));
-
- // Child DIE.
- {
- EXPECT_TRUE(die_dispatcher.StartDIE(0x058f09240c5fc8c9LL,
- (DwarfTag) 0x898bf0d0));
-
- // Grandchild DIE.
- {
- EXPECT_TRUE(die_dispatcher.StartDIE(0x32dc00c9945dc0c8LL,
- (DwarfTag) 0x2802d007));
- die_dispatcher.ProcessAttributeSigned(0x32dc00c9945dc0c8LL,
- (DwarfAttribute) 0x4e2b7cfb,
- (DwarfForm) 0x610b7ae1,
- 0x3ea5c609d7d7560fLL);
-
- // Stop the traversal abruptly, so that there will still be
- // handlers on the stack when the dispatcher is destructed.
-
- // No EndDIE call...
- }
- // No EndDIE call...
- }
- // No EndDIE call...
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2enums.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2enums.h
deleted file mode 100644
index 6b8a724591..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2enums.h
+++ /dev/null
@@ -1,675 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_DWARF_DWARF2ENUMS_H__
-#define COMMON_DWARF_DWARF2ENUMS_H__
-
-namespace dwarf2reader {
-
-// These enums do not follow the google3 style only because they are
-// known universally (specs, other implementations) by the names in
-// exactly this capitalization.
-// Tag names and codes.
-enum DwarfTag {
- DW_TAG_padding = 0x00,
- DW_TAG_array_type = 0x01,
- DW_TAG_class_type = 0x02,
- DW_TAG_entry_point = 0x03,
- DW_TAG_enumeration_type = 0x04,
- DW_TAG_formal_parameter = 0x05,
- DW_TAG_imported_declaration = 0x08,
- DW_TAG_label = 0x0a,
- DW_TAG_lexical_block = 0x0b,
- DW_TAG_member = 0x0d,
- DW_TAG_pointer_type = 0x0f,
- DW_TAG_reference_type = 0x10,
- DW_TAG_compile_unit = 0x11,
- DW_TAG_string_type = 0x12,
- DW_TAG_structure_type = 0x13,
- DW_TAG_subroutine_type = 0x15,
- DW_TAG_typedef = 0x16,
- DW_TAG_union_type = 0x17,
- DW_TAG_unspecified_parameters = 0x18,
- DW_TAG_variant = 0x19,
- DW_TAG_common_block = 0x1a,
- DW_TAG_common_inclusion = 0x1b,
- DW_TAG_inheritance = 0x1c,
- DW_TAG_inlined_subroutine = 0x1d,
- DW_TAG_module = 0x1e,
- DW_TAG_ptr_to_member_type = 0x1f,
- DW_TAG_set_type = 0x20,
- DW_TAG_subrange_type = 0x21,
- DW_TAG_with_stmt = 0x22,
- DW_TAG_access_declaration = 0x23,
- DW_TAG_base_type = 0x24,
- DW_TAG_catch_block = 0x25,
- DW_TAG_const_type = 0x26,
- DW_TAG_constant = 0x27,
- DW_TAG_enumerator = 0x28,
- DW_TAG_file_type = 0x29,
- DW_TAG_friend = 0x2a,
- DW_TAG_namelist = 0x2b,
- DW_TAG_namelist_item = 0x2c,
- DW_TAG_packed_type = 0x2d,
- DW_TAG_subprogram = 0x2e,
- DW_TAG_template_type_param = 0x2f,
- DW_TAG_template_value_param = 0x30,
- DW_TAG_thrown_type = 0x31,
- DW_TAG_try_block = 0x32,
- DW_TAG_variant_part = 0x33,
- DW_TAG_variable = 0x34,
- DW_TAG_volatile_type = 0x35,
- // DWARF 3.
- DW_TAG_dwarf_procedure = 0x36,
- DW_TAG_restrict_type = 0x37,
- DW_TAG_interface_type = 0x38,
- DW_TAG_namespace = 0x39,
- DW_TAG_imported_module = 0x3a,
- DW_TAG_unspecified_type = 0x3b,
- DW_TAG_partial_unit = 0x3c,
- DW_TAG_imported_unit = 0x3d,
- // SGI/MIPS Extensions.
- DW_TAG_MIPS_loop = 0x4081,
- // HP extensions. See:
- // ftp://ftp.hp.com/pub/lang/tools/WDB/wdb-4.0.tar.gz
- DW_TAG_HP_array_descriptor = 0x4090,
- // GNU extensions.
- DW_TAG_format_label = 0x4101, // For FORTRAN 77 and Fortran 90.
- DW_TAG_function_template = 0x4102, // For C++.
- DW_TAG_class_template = 0x4103, // For C++.
- DW_TAG_GNU_BINCL = 0x4104,
- DW_TAG_GNU_EINCL = 0x4105,
- // Extensions for UPC. See: http://upc.gwu.edu/~upc.
- DW_TAG_upc_shared_type = 0x8765,
- DW_TAG_upc_strict_type = 0x8766,
- DW_TAG_upc_relaxed_type = 0x8767,
- // PGI (STMicroelectronics) extensions. No documentation available.
- DW_TAG_PGI_kanji_type = 0xA000,
- DW_TAG_PGI_interface_block = 0xA020
-};
-
-
-enum DwarfHasChild {
- DW_children_no = 0,
- DW_children_yes = 1
-};
-
-// Form names and codes.
-enum DwarfForm {
- DW_FORM_addr = 0x01,
- DW_FORM_block2 = 0x03,
- DW_FORM_block4 = 0x04,
- DW_FORM_data2 = 0x05,
- DW_FORM_data4 = 0x06,
- DW_FORM_data8 = 0x07,
- DW_FORM_string = 0x08,
- DW_FORM_block = 0x09,
- DW_FORM_block1 = 0x0a,
- DW_FORM_data1 = 0x0b,
- DW_FORM_flag = 0x0c,
- DW_FORM_sdata = 0x0d,
- DW_FORM_strp = 0x0e,
- DW_FORM_udata = 0x0f,
- DW_FORM_ref_addr = 0x10,
- DW_FORM_ref1 = 0x11,
- DW_FORM_ref2 = 0x12,
- DW_FORM_ref4 = 0x13,
- DW_FORM_ref8 = 0x14,
- DW_FORM_ref_udata = 0x15,
- DW_FORM_indirect = 0x16,
-
- // Added in DWARF 4:
- DW_FORM_sec_offset = 0x17,
- DW_FORM_exprloc = 0x18,
- DW_FORM_flag_present = 0x19,
- DW_FORM_ref_sig8 = 0x20,
- // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
- DW_FORM_GNU_addr_index = 0x1f01,
- DW_FORM_GNU_str_index = 0x1f02
-};
-
-// Attribute names and codes
-enum DwarfAttribute {
- DW_AT_sibling = 0x01,
- DW_AT_location = 0x02,
- DW_AT_name = 0x03,
- DW_AT_ordering = 0x09,
- DW_AT_subscr_data = 0x0a,
- DW_AT_byte_size = 0x0b,
- DW_AT_bit_offset = 0x0c,
- DW_AT_bit_size = 0x0d,
- DW_AT_element_list = 0x0f,
- DW_AT_stmt_list = 0x10,
- DW_AT_low_pc = 0x11,
- DW_AT_high_pc = 0x12,
- DW_AT_language = 0x13,
- DW_AT_member = 0x14,
- DW_AT_discr = 0x15,
- DW_AT_discr_value = 0x16,
- DW_AT_visibility = 0x17,
- DW_AT_import = 0x18,
- DW_AT_string_length = 0x19,
- DW_AT_common_reference = 0x1a,
- DW_AT_comp_dir = 0x1b,
- DW_AT_const_value = 0x1c,
- DW_AT_containing_type = 0x1d,
- DW_AT_default_value = 0x1e,
- DW_AT_inline = 0x20,
- DW_AT_is_optional = 0x21,
- DW_AT_lower_bound = 0x22,
- DW_AT_producer = 0x25,
- DW_AT_prototyped = 0x27,
- DW_AT_return_addr = 0x2a,
- DW_AT_start_scope = 0x2c,
- DW_AT_stride_size = 0x2e,
- DW_AT_upper_bound = 0x2f,
- DW_AT_abstract_origin = 0x31,
- DW_AT_accessibility = 0x32,
- DW_AT_address_class = 0x33,
- DW_AT_artificial = 0x34,
- DW_AT_base_types = 0x35,
- DW_AT_calling_convention = 0x36,
- DW_AT_count = 0x37,
- DW_AT_data_member_location = 0x38,
- DW_AT_decl_column = 0x39,
- DW_AT_decl_file = 0x3a,
- DW_AT_decl_line = 0x3b,
- DW_AT_declaration = 0x3c,
- DW_AT_discr_list = 0x3d,
- DW_AT_encoding = 0x3e,
- DW_AT_external = 0x3f,
- DW_AT_frame_base = 0x40,
- DW_AT_friend = 0x41,
- DW_AT_identifier_case = 0x42,
- DW_AT_macro_info = 0x43,
- DW_AT_namelist_items = 0x44,
- DW_AT_priority = 0x45,
- DW_AT_segment = 0x46,
- DW_AT_specification = 0x47,
- DW_AT_static_link = 0x48,
- DW_AT_type = 0x49,
- DW_AT_use_location = 0x4a,
- DW_AT_variable_parameter = 0x4b,
- DW_AT_virtuality = 0x4c,
- DW_AT_vtable_elem_location = 0x4d,
- // DWARF 3 values.
- DW_AT_allocated = 0x4e,
- DW_AT_associated = 0x4f,
- DW_AT_data_location = 0x50,
- DW_AT_stride = 0x51,
- DW_AT_entry_pc = 0x52,
- DW_AT_use_UTF8 = 0x53,
- DW_AT_extension = 0x54,
- DW_AT_ranges = 0x55,
- DW_AT_trampoline = 0x56,
- DW_AT_call_column = 0x57,
- DW_AT_call_file = 0x58,
- DW_AT_call_line = 0x59,
- // SGI/MIPS extensions.
- DW_AT_MIPS_fde = 0x2001,
- DW_AT_MIPS_loop_begin = 0x2002,
- DW_AT_MIPS_tail_loop_begin = 0x2003,
- DW_AT_MIPS_epilog_begin = 0x2004,
- DW_AT_MIPS_loop_unroll_factor = 0x2005,
- DW_AT_MIPS_software_pipeline_depth = 0x2006,
- DW_AT_MIPS_linkage_name = 0x2007,
- DW_AT_MIPS_stride = 0x2008,
- DW_AT_MIPS_abstract_name = 0x2009,
- DW_AT_MIPS_clone_origin = 0x200a,
- DW_AT_MIPS_has_inlines = 0x200b,
- // HP extensions.
- DW_AT_HP_block_index = 0x2000,
- DW_AT_HP_unmodifiable = 0x2001, // Same as DW_AT_MIPS_fde.
- DW_AT_HP_actuals_stmt_list = 0x2010,
- DW_AT_HP_proc_per_section = 0x2011,
- DW_AT_HP_raw_data_ptr = 0x2012,
- DW_AT_HP_pass_by_reference = 0x2013,
- DW_AT_HP_opt_level = 0x2014,
- DW_AT_HP_prof_version_id = 0x2015,
- DW_AT_HP_opt_flags = 0x2016,
- DW_AT_HP_cold_region_low_pc = 0x2017,
- DW_AT_HP_cold_region_high_pc = 0x2018,
- DW_AT_HP_all_variables_modifiable = 0x2019,
- DW_AT_HP_linkage_name = 0x201a,
- DW_AT_HP_prof_flags = 0x201b, // In comp unit of procs_info for -g.
- // GNU extensions.
- DW_AT_sf_names = 0x2101,
- DW_AT_src_info = 0x2102,
- DW_AT_mac_info = 0x2103,
- DW_AT_src_coords = 0x2104,
- DW_AT_body_begin = 0x2105,
- DW_AT_body_end = 0x2106,
- DW_AT_GNU_vector = 0x2107,
- // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
- DW_AT_GNU_dwo_name = 0x2130,
- DW_AT_GNU_dwo_id = 0x2131,
- DW_AT_GNU_ranges_base = 0x2132,
- DW_AT_GNU_addr_base = 0x2133,
- DW_AT_GNU_pubnames = 0x2134,
- DW_AT_GNU_pubtypes = 0x2135,
- // VMS extensions.
- DW_AT_VMS_rtnbeg_pd_address = 0x2201,
- // UPC extension.
- DW_AT_upc_threads_scaled = 0x3210,
- // PGI (STMicroelectronics) extensions.
- DW_AT_PGI_lbase = 0x3a00,
- DW_AT_PGI_soffset = 0x3a01,
- DW_AT_PGI_lstride = 0x3a02
-};
-
-
-// Line number opcodes.
-enum DwarfLineNumberOps {
- DW_LNS_extended_op = 0,
- DW_LNS_copy = 1,
- DW_LNS_advance_pc = 2,
- DW_LNS_advance_line = 3,
- DW_LNS_set_file = 4,
- DW_LNS_set_column = 5,
- DW_LNS_negate_stmt = 6,
- DW_LNS_set_basic_block = 7,
- DW_LNS_const_add_pc = 8,
- DW_LNS_fixed_advance_pc = 9,
- // DWARF 3.
- DW_LNS_set_prologue_end = 10,
- DW_LNS_set_epilogue_begin = 11,
- DW_LNS_set_isa = 12
-};
-
-// Line number extended opcodes.
-enum DwarfLineNumberExtendedOps {
- DW_LNE_end_sequence = 1,
- DW_LNE_set_address = 2,
- DW_LNE_define_file = 3,
- // HP extensions.
- DW_LNE_HP_negate_is_UV_update = 0x11,
- DW_LNE_HP_push_context = 0x12,
- DW_LNE_HP_pop_context = 0x13,
- DW_LNE_HP_set_file_line_column = 0x14,
- DW_LNE_HP_set_routine_name = 0x15,
- DW_LNE_HP_set_sequence = 0x16,
- DW_LNE_HP_negate_post_semantics = 0x17,
- DW_LNE_HP_negate_function_exit = 0x18,
- DW_LNE_HP_negate_front_end_logical = 0x19,
- DW_LNE_HP_define_proc = 0x20
-};
-
-// Type encoding names and codes
-enum DwarfEncoding {
- DW_ATE_address =0x1,
- DW_ATE_boolean =0x2,
- DW_ATE_complex_float =0x3,
- DW_ATE_float =0x4,
- DW_ATE_signed =0x5,
- DW_ATE_signed_char =0x6,
- DW_ATE_unsigned =0x7,
- DW_ATE_unsigned_char =0x8,
- // DWARF3/DWARF3f
- DW_ATE_imaginary_float =0x9,
- DW_ATE_packed_decimal =0xa,
- DW_ATE_numeric_string =0xb,
- DW_ATE_edited =0xc,
- DW_ATE_signed_fixed =0xd,
- DW_ATE_unsigned_fixed =0xe,
- DW_ATE_decimal_float =0xf,
- DW_ATE_lo_user =0x80,
- DW_ATE_hi_user =0xff
-};
-
-// Location virtual machine opcodes
-enum DwarfOpcode {
- DW_OP_addr =0x03,
- DW_OP_deref =0x06,
- DW_OP_const1u =0x08,
- DW_OP_const1s =0x09,
- DW_OP_const2u =0x0a,
- DW_OP_const2s =0x0b,
- DW_OP_const4u =0x0c,
- DW_OP_const4s =0x0d,
- DW_OP_const8u =0x0e,
- DW_OP_const8s =0x0f,
- DW_OP_constu =0x10,
- DW_OP_consts =0x11,
- DW_OP_dup =0x12,
- DW_OP_drop =0x13,
- DW_OP_over =0x14,
- DW_OP_pick =0x15,
- DW_OP_swap =0x16,
- DW_OP_rot =0x17,
- DW_OP_xderef =0x18,
- DW_OP_abs =0x19,
- DW_OP_and =0x1a,
- DW_OP_div =0x1b,
- DW_OP_minus =0x1c,
- DW_OP_mod =0x1d,
- DW_OP_mul =0x1e,
- DW_OP_neg =0x1f,
- DW_OP_not =0x20,
- DW_OP_or =0x21,
- DW_OP_plus =0x22,
- DW_OP_plus_uconst =0x23,
- DW_OP_shl =0x24,
- DW_OP_shr =0x25,
- DW_OP_shra =0x26,
- DW_OP_xor =0x27,
- DW_OP_bra =0x28,
- DW_OP_eq =0x29,
- DW_OP_ge =0x2a,
- DW_OP_gt =0x2b,
- DW_OP_le =0x2c,
- DW_OP_lt =0x2d,
- DW_OP_ne =0x2e,
- DW_OP_skip =0x2f,
- DW_OP_lit0 =0x30,
- DW_OP_lit1 =0x31,
- DW_OP_lit2 =0x32,
- DW_OP_lit3 =0x33,
- DW_OP_lit4 =0x34,
- DW_OP_lit5 =0x35,
- DW_OP_lit6 =0x36,
- DW_OP_lit7 =0x37,
- DW_OP_lit8 =0x38,
- DW_OP_lit9 =0x39,
- DW_OP_lit10 =0x3a,
- DW_OP_lit11 =0x3b,
- DW_OP_lit12 =0x3c,
- DW_OP_lit13 =0x3d,
- DW_OP_lit14 =0x3e,
- DW_OP_lit15 =0x3f,
- DW_OP_lit16 =0x40,
- DW_OP_lit17 =0x41,
- DW_OP_lit18 =0x42,
- DW_OP_lit19 =0x43,
- DW_OP_lit20 =0x44,
- DW_OP_lit21 =0x45,
- DW_OP_lit22 =0x46,
- DW_OP_lit23 =0x47,
- DW_OP_lit24 =0x48,
- DW_OP_lit25 =0x49,
- DW_OP_lit26 =0x4a,
- DW_OP_lit27 =0x4b,
- DW_OP_lit28 =0x4c,
- DW_OP_lit29 =0x4d,
- DW_OP_lit30 =0x4e,
- DW_OP_lit31 =0x4f,
- DW_OP_reg0 =0x50,
- DW_OP_reg1 =0x51,
- DW_OP_reg2 =0x52,
- DW_OP_reg3 =0x53,
- DW_OP_reg4 =0x54,
- DW_OP_reg5 =0x55,
- DW_OP_reg6 =0x56,
- DW_OP_reg7 =0x57,
- DW_OP_reg8 =0x58,
- DW_OP_reg9 =0x59,
- DW_OP_reg10 =0x5a,
- DW_OP_reg11 =0x5b,
- DW_OP_reg12 =0x5c,
- DW_OP_reg13 =0x5d,
- DW_OP_reg14 =0x5e,
- DW_OP_reg15 =0x5f,
- DW_OP_reg16 =0x60,
- DW_OP_reg17 =0x61,
- DW_OP_reg18 =0x62,
- DW_OP_reg19 =0x63,
- DW_OP_reg20 =0x64,
- DW_OP_reg21 =0x65,
- DW_OP_reg22 =0x66,
- DW_OP_reg23 =0x67,
- DW_OP_reg24 =0x68,
- DW_OP_reg25 =0x69,
- DW_OP_reg26 =0x6a,
- DW_OP_reg27 =0x6b,
- DW_OP_reg28 =0x6c,
- DW_OP_reg29 =0x6d,
- DW_OP_reg30 =0x6e,
- DW_OP_reg31 =0x6f,
- DW_OP_breg0 =0x70,
- DW_OP_breg1 =0x71,
- DW_OP_breg2 =0x72,
- DW_OP_breg3 =0x73,
- DW_OP_breg4 =0x74,
- DW_OP_breg5 =0x75,
- DW_OP_breg6 =0x76,
- DW_OP_breg7 =0x77,
- DW_OP_breg8 =0x78,
- DW_OP_breg9 =0x79,
- DW_OP_breg10 =0x7a,
- DW_OP_breg11 =0x7b,
- DW_OP_breg12 =0x7c,
- DW_OP_breg13 =0x7d,
- DW_OP_breg14 =0x7e,
- DW_OP_breg15 =0x7f,
- DW_OP_breg16 =0x80,
- DW_OP_breg17 =0x81,
- DW_OP_breg18 =0x82,
- DW_OP_breg19 =0x83,
- DW_OP_breg20 =0x84,
- DW_OP_breg21 =0x85,
- DW_OP_breg22 =0x86,
- DW_OP_breg23 =0x87,
- DW_OP_breg24 =0x88,
- DW_OP_breg25 =0x89,
- DW_OP_breg26 =0x8a,
- DW_OP_breg27 =0x8b,
- DW_OP_breg28 =0x8c,
- DW_OP_breg29 =0x8d,
- DW_OP_breg30 =0x8e,
- DW_OP_breg31 =0x8f,
- DW_OP_regX =0x90,
- DW_OP_fbreg =0x91,
- DW_OP_bregX =0x92,
- DW_OP_piece =0x93,
- DW_OP_deref_size =0x94,
- DW_OP_xderef_size =0x95,
- DW_OP_nop =0x96,
- // DWARF3/DWARF3f
- DW_OP_push_object_address =0x97,
- DW_OP_call2 =0x98,
- DW_OP_call4 =0x99,
- DW_OP_call_ref =0x9a,
- DW_OP_form_tls_address =0x9b,
- DW_OP_call_frame_cfa =0x9c,
- DW_OP_bit_piece =0x9d,
- DW_OP_lo_user =0xe0,
- DW_OP_hi_user =0xff,
- // GNU extensions
- DW_OP_GNU_push_tls_address =0xe0,
- // Extensions for Fission. See http://gcc.gnu.org/wiki/DebugFission.
- DW_OP_GNU_addr_index =0xfb,
- DW_OP_GNU_const_index =0xfc
-};
-
-// Section identifiers for DWP files
-enum DwarfSectionId {
- DW_SECT_INFO = 1,
- DW_SECT_TYPES = 2,
- DW_SECT_ABBREV = 3,
- DW_SECT_LINE = 4,
- DW_SECT_LOC = 5,
- DW_SECT_STR_OFFSETS = 6,
- DW_SECT_MACINFO = 7,
- DW_SECT_MACRO = 8
-};
-
-// Source languages. These are values for DW_AT_language.
-enum DwarfLanguage
- {
- DW_LANG_none =0x0000,
- DW_LANG_C89 =0x0001,
- DW_LANG_C =0x0002,
- DW_LANG_Ada83 =0x0003,
- DW_LANG_C_plus_plus =0x0004,
- DW_LANG_Cobol74 =0x0005,
- DW_LANG_Cobol85 =0x0006,
- DW_LANG_Fortran77 =0x0007,
- DW_LANG_Fortran90 =0x0008,
- DW_LANG_Pascal83 =0x0009,
- DW_LANG_Modula2 =0x000a,
- DW_LANG_Java =0x000b,
- DW_LANG_C99 =0x000c,
- DW_LANG_Ada95 =0x000d,
- DW_LANG_Fortran95 =0x000e,
- DW_LANG_PLI =0x000f,
- DW_LANG_ObjC =0x0010,
- DW_LANG_ObjC_plus_plus =0x0011,
- DW_LANG_UPC =0x0012,
- DW_LANG_D =0x0013,
- // Implementation-defined language code range.
- DW_LANG_lo_user = 0x8000,
- DW_LANG_hi_user = 0xffff,
-
- // Extensions.
-
- // MIPS assembly language. The GNU toolchain uses this for all
- // assembly languages, since there's no generic DW_LANG_ value for that.
- // See include/dwarf2.h in the binutils, gdb, or gcc source trees.
- DW_LANG_Mips_Assembler =0x8001,
- DW_LANG_Upc =0x8765 // Unified Parallel C
- };
-
-// Inline codes. These are values for DW_AT_inline.
-enum DwarfInline {
- DW_INL_not_inlined =0x0,
- DW_INL_inlined =0x1,
- DW_INL_declared_not_inlined =0x2,
- DW_INL_declared_inlined =0x3
-};
-
-// Call Frame Info instructions.
-enum DwarfCFI
- {
- DW_CFA_advance_loc = 0x40,
- DW_CFA_offset = 0x80,
- DW_CFA_restore = 0xc0,
- DW_CFA_nop = 0x00,
- DW_CFA_set_loc = 0x01,
- DW_CFA_advance_loc1 = 0x02,
- DW_CFA_advance_loc2 = 0x03,
- DW_CFA_advance_loc4 = 0x04,
- DW_CFA_offset_extended = 0x05,
- DW_CFA_restore_extended = 0x06,
- DW_CFA_undefined = 0x07,
- DW_CFA_same_value = 0x08,
- DW_CFA_register = 0x09,
- DW_CFA_remember_state = 0x0a,
- DW_CFA_restore_state = 0x0b,
- DW_CFA_def_cfa = 0x0c,
- DW_CFA_def_cfa_register = 0x0d,
- DW_CFA_def_cfa_offset = 0x0e,
- DW_CFA_def_cfa_expression = 0x0f,
- DW_CFA_expression = 0x10,
- DW_CFA_offset_extended_sf = 0x11,
- DW_CFA_def_cfa_sf = 0x12,
- DW_CFA_def_cfa_offset_sf = 0x13,
- DW_CFA_val_offset = 0x14,
- DW_CFA_val_offset_sf = 0x15,
- DW_CFA_val_expression = 0x16,
-
- // Opcodes in this range are reserved for user extensions.
- DW_CFA_lo_user = 0x1c,
- DW_CFA_hi_user = 0x3f,
-
- // SGI/MIPS specific.
- DW_CFA_MIPS_advance_loc8 = 0x1d,
-
- // GNU extensions.
- DW_CFA_GNU_window_save = 0x2d,
- DW_CFA_GNU_args_size = 0x2e,
- DW_CFA_GNU_negative_offset_extended = 0x2f
- };
-
-// Exception handling 'z' augmentation letters.
-enum DwarfZAugmentationCodes {
- // If the CFI augmentation string begins with 'z', then the CIE and FDE
- // have an augmentation data area just before the instructions, whose
- // contents are determined by the subsequent augmentation letters.
- DW_Z_augmentation_start = 'z',
-
- // If this letter is present in a 'z' augmentation string, the CIE
- // augmentation data includes a pointer encoding, and the FDE
- // augmentation data includes a language-specific data area pointer,
- // represented using that encoding.
- DW_Z_has_LSDA = 'L',
-
- // If this letter is present in a 'z' augmentation string, the CIE
- // augmentation data includes a pointer encoding, followed by a pointer
- // to a personality routine, represented using that encoding.
- DW_Z_has_personality_routine = 'P',
-
- // If this letter is present in a 'z' augmentation string, the CIE
- // augmentation data includes a pointer encoding describing how the FDE's
- // initial location, address range, and DW_CFA_set_loc operands are
- // encoded.
- DW_Z_has_FDE_address_encoding = 'R',
-
- // If this letter is present in a 'z' augmentation string, then code
- // addresses covered by FDEs that cite this CIE are signal delivery
- // trampolines. Return addresses of frames in trampolines should not be
- // adjusted as described in section 6.4.4 of the DWARF 3 spec.
- DW_Z_is_signal_trampoline = 'S'
-};
-
-// Exception handling frame description pointer formats, as described
-// by the Linux Standard Base Core Specification 4.0, section 11.5,
-// DWARF Extensions.
-enum DwarfPointerEncoding
- {
- DW_EH_PE_absptr = 0x00,
- DW_EH_PE_omit = 0xff,
- DW_EH_PE_uleb128 = 0x01,
- DW_EH_PE_udata2 = 0x02,
- DW_EH_PE_udata4 = 0x03,
- DW_EH_PE_udata8 = 0x04,
- DW_EH_PE_sleb128 = 0x09,
- DW_EH_PE_sdata2 = 0x0A,
- DW_EH_PE_sdata4 = 0x0B,
- DW_EH_PE_sdata8 = 0x0C,
- DW_EH_PE_pcrel = 0x10,
- DW_EH_PE_textrel = 0x20,
- DW_EH_PE_datarel = 0x30,
- DW_EH_PE_funcrel = 0x40,
- DW_EH_PE_aligned = 0x50,
-
- // The GNU toolchain sources define this enum value as well,
- // simply to help classify the lower nybble values into signed and
- // unsigned groups.
- DW_EH_PE_signed = 0x08,
-
- // This is not documented in LSB 4.0, but it is used in both the
- // Linux and OS X toolchains. It can be added to any other
- // encoding (except DW_EH_PE_aligned), and indicates that the
- // encoded value represents the address at which the true address
- // is stored, not the true address itself.
- DW_EH_PE_indirect = 0x80
- };
-
-} // namespace dwarf2reader
-#endif // COMMON_DWARF_DWARF2ENUMS_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc
deleted file mode 100644
index a65b43c8a3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.cc
+++ /dev/null
@@ -1,2734 +0,0 @@
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// CFI reader author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// Implementation of dwarf2reader::LineInfo, dwarf2reader::CompilationUnit,
-// and dwarf2reader::CallFrameInfo. See dwarf2reader.h for details.
-
-#include "common/dwarf/dwarf2reader.h"
-
-#include <assert.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <map>
-#include <memory>
-#include <stack>
-#include <string>
-#include <utility>
-
-#include <sys/stat.h>
-
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/bytereader.h"
-#include "common/dwarf/line_state_machine.h"
-#include "common/using_std_string.h"
-
-namespace dwarf2reader {
-
-CompilationUnit::CompilationUnit(const string& path,
- const SectionMap& sections, uint64 offset,
- ByteReader* reader, Dwarf2Handler* handler)
- : path_(path), offset_from_section_start_(offset), reader_(reader),
- sections_(sections), handler_(handler), abbrevs_(),
- string_buffer_(NULL), string_buffer_length_(0),
- str_offsets_buffer_(NULL), str_offsets_buffer_length_(0),
- addr_buffer_(NULL), addr_buffer_length_(0),
- is_split_dwarf_(false), dwo_id_(0), dwo_name_(),
- skeleton_dwo_id_(0), ranges_base_(0), addr_base_(0),
- have_checked_for_dwp_(false), dwp_path_(),
- dwp_byte_reader_(), dwp_reader_() {}
-
-// Initialize a compilation unit from a .dwo or .dwp file.
-// In this case, we need the .debug_addr section from the
-// executable file that contains the corresponding skeleton
-// compilation unit. We also inherit the Dwarf2Handler from
-// the executable file, and call it as if we were still
-// processing the original compilation unit.
-
-void CompilationUnit::SetSplitDwarf(const uint8_t* addr_buffer,
- uint64 addr_buffer_length,
- uint64 addr_base,
- uint64 ranges_base,
- uint64 dwo_id) {
- is_split_dwarf_ = true;
- addr_buffer_ = addr_buffer;
- addr_buffer_length_ = addr_buffer_length;
- addr_base_ = addr_base;
- ranges_base_ = ranges_base;
- skeleton_dwo_id_ = dwo_id;
-}
-
-// Read a DWARF2/3 abbreviation section.
-// Each abbrev consists of a abbreviation number, a tag, a byte
-// specifying whether the tag has children, and a list of
-// attribute/form pairs.
-// The list of forms is terminated by a 0 for the attribute, and a
-// zero for the form. The entire abbreviation section is terminated
-// by a zero for the code.
-
-void CompilationUnit::ReadAbbrevs() {
- if (abbrevs_)
- return;
-
- // First get the debug_abbrev section. ".debug_abbrev" is the name
- // recommended in the DWARF spec, and used on Linux;
- // "__debug_abbrev" is the name used in Mac OS X Mach-O files.
- SectionMap::const_iterator iter = sections_.find(".debug_abbrev");
- if (iter == sections_.end())
- iter = sections_.find("__debug_abbrev");
- assert(iter != sections_.end());
-
- abbrevs_ = new std::vector<Abbrev>;
- abbrevs_->resize(1);
-
- // The only way to check whether we are reading over the end of the
- // buffer would be to first compute the size of the leb128 data by
- // reading it, then go back and read it again.
- const uint8_t *abbrev_start = iter->second.first +
- header_.abbrev_offset;
- const uint8_t *abbrevptr = abbrev_start;
-#ifndef NDEBUG
- const uint64 abbrev_length = iter->second.second - header_.abbrev_offset;
-#endif
-
- while (1) {
- CompilationUnit::Abbrev abbrev;
- size_t len;
- const uint64 number = reader_->ReadUnsignedLEB128(abbrevptr, &len);
-
- if (number == 0)
- break;
- abbrev.number = number;
- abbrevptr += len;
-
- assert(abbrevptr < abbrev_start + abbrev_length);
- const uint64 tag = reader_->ReadUnsignedLEB128(abbrevptr, &len);
- abbrevptr += len;
- abbrev.tag = static_cast<enum DwarfTag>(tag);
-
- assert(abbrevptr < abbrev_start + abbrev_length);
- abbrev.has_children = reader_->ReadOneByte(abbrevptr);
- abbrevptr += 1;
-
- assert(abbrevptr < abbrev_start + abbrev_length);
-
- while (1) {
- const uint64 nametemp = reader_->ReadUnsignedLEB128(abbrevptr, &len);
- abbrevptr += len;
-
- assert(abbrevptr < abbrev_start + abbrev_length);
- const uint64 formtemp = reader_->ReadUnsignedLEB128(abbrevptr, &len);
- abbrevptr += len;
- if (nametemp == 0 && formtemp == 0)
- break;
-
- const enum DwarfAttribute name =
- static_cast<enum DwarfAttribute>(nametemp);
- const enum DwarfForm form = static_cast<enum DwarfForm>(formtemp);
- abbrev.attributes.push_back(std::make_pair(name, form));
- }
- assert(abbrev.number == abbrevs_->size());
- abbrevs_->push_back(abbrev);
- }
-}
-
-// Skips a single DIE's attributes.
-const uint8_t *CompilationUnit::SkipDIE(const uint8_t* start,
- const Abbrev& abbrev) {
- for (AttributeList::const_iterator i = abbrev.attributes.begin();
- i != abbrev.attributes.end();
- i++) {
- start = SkipAttribute(start, i->second);
- }
- return start;
-}
-
-// Skips a single attribute form's data.
-const uint8_t *CompilationUnit::SkipAttribute(const uint8_t *start,
- enum DwarfForm form) {
- size_t len;
-
- switch (form) {
- case DW_FORM_indirect:
- form = static_cast<enum DwarfForm>(reader_->ReadUnsignedLEB128(start,
- &len));
- start += len;
- return SkipAttribute(start, form);
-
- case DW_FORM_flag_present:
- return start;
- case DW_FORM_data1:
- case DW_FORM_flag:
- case DW_FORM_ref1:
- return start + 1;
- case DW_FORM_ref2:
- case DW_FORM_data2:
- return start + 2;
- case DW_FORM_ref4:
- case DW_FORM_data4:
- return start + 4;
- case DW_FORM_ref8:
- case DW_FORM_data8:
- case DW_FORM_ref_sig8:
- return start + 8;
- case DW_FORM_string:
- return start + strlen(reinterpret_cast<const char *>(start)) + 1;
- case DW_FORM_udata:
- case DW_FORM_ref_udata:
- case DW_FORM_GNU_str_index:
- case DW_FORM_GNU_addr_index:
- reader_->ReadUnsignedLEB128(start, &len);
- return start + len;
-
- case DW_FORM_sdata:
- reader_->ReadSignedLEB128(start, &len);
- return start + len;
- case DW_FORM_addr:
- return start + reader_->AddressSize();
- case DW_FORM_ref_addr:
- // DWARF2 and 3/4 differ on whether ref_addr is address size or
- // offset size.
- assert(header_.version >= 2);
- if (header_.version == 2) {
- return start + reader_->AddressSize();
- } else if (header_.version >= 3) {
- return start + reader_->OffsetSize();
- }
- break;
-
- case DW_FORM_block1:
- return start + 1 + reader_->ReadOneByte(start);
- case DW_FORM_block2:
- return start + 2 + reader_->ReadTwoBytes(start);
- case DW_FORM_block4:
- return start + 4 + reader_->ReadFourBytes(start);
- case DW_FORM_block:
- case DW_FORM_exprloc: {
- uint64 size = reader_->ReadUnsignedLEB128(start, &len);
- return start + size + len;
- }
- case DW_FORM_strp:
- case DW_FORM_sec_offset:
- return start + reader_->OffsetSize();
- }
- fprintf(stderr,"Unhandled form type");
- return NULL;
-}
-
-// Read a DWARF2/3 header.
-// The header is variable length in DWARF3 (and DWARF2 as extended by
-// most compilers), and consists of an length field, a version number,
-// the offset in the .debug_abbrev section for our abbrevs, and an
-// address size.
-void CompilationUnit::ReadHeader() {
- const uint8_t *headerptr = buffer_;
- size_t initial_length_size;
-
- assert(headerptr + 4 < buffer_ + buffer_length_);
- const uint64 initial_length
- = reader_->ReadInitialLength(headerptr, &initial_length_size);
- headerptr += initial_length_size;
- header_.length = initial_length;
-
- assert(headerptr + 2 < buffer_ + buffer_length_);
- header_.version = reader_->ReadTwoBytes(headerptr);
- headerptr += 2;
-
- assert(headerptr + reader_->OffsetSize() < buffer_ + buffer_length_);
- header_.abbrev_offset = reader_->ReadOffset(headerptr);
- headerptr += reader_->OffsetSize();
-
- // Compare against less than or equal because this may be the last
- // section in the file.
- assert(headerptr + 1 <= buffer_ + buffer_length_);
- header_.address_size = reader_->ReadOneByte(headerptr);
- reader_->SetAddressSize(header_.address_size);
- headerptr += 1;
-
- after_header_ = headerptr;
-
- // This check ensures that we don't have to do checking during the
- // reading of DIEs. header_.length does not include the size of the
- // initial length.
- assert(buffer_ + initial_length_size + header_.length <=
- buffer_ + buffer_length_);
-}
-
-uint64 CompilationUnit::Start() {
- // First get the debug_info section. ".debug_info" is the name
- // recommended in the DWARF spec, and used on Linux; "__debug_info"
- // is the name used in Mac OS X Mach-O files.
- SectionMap::const_iterator iter = sections_.find(".debug_info");
- if (iter == sections_.end())
- iter = sections_.find("__debug_info");
- assert(iter != sections_.end());
-
- // Set up our buffer
- buffer_ = iter->second.first + offset_from_section_start_;
- buffer_length_ = iter->second.second - offset_from_section_start_;
-
- // Read the header
- ReadHeader();
-
- // Figure out the real length from the end of the initial length to
- // the end of the compilation unit, since that is the value we
- // return.
- uint64 ourlength = header_.length;
- if (reader_->OffsetSize() == 8)
- ourlength += 12;
- else
- ourlength += 4;
-
- // See if the user wants this compilation unit, and if not, just return.
- if (!handler_->StartCompilationUnit(offset_from_section_start_,
- reader_->AddressSize(),
- reader_->OffsetSize(),
- header_.length,
- header_.version))
- return ourlength;
-
- // Otherwise, continue by reading our abbreviation entries.
- ReadAbbrevs();
-
- // Set the string section if we have one. ".debug_str" is the name
- // recommended in the DWARF spec, and used on Linux; "__debug_str"
- // is the name used in Mac OS X Mach-O files.
- iter = sections_.find(".debug_str");
- if (iter == sections_.end())
- iter = sections_.find("__debug_str");
- if (iter != sections_.end()) {
- string_buffer_ = iter->second.first;
- string_buffer_length_ = iter->second.second;
- }
-
- // Set the string offsets section if we have one.
- iter = sections_.find(".debug_str_offsets");
- if (iter != sections_.end()) {
- str_offsets_buffer_ = iter->second.first;
- str_offsets_buffer_length_ = iter->second.second;
- }
-
- // Set the address section if we have one.
- iter = sections_.find(".debug_addr");
- if (iter != sections_.end()) {
- addr_buffer_ = iter->second.first;
- addr_buffer_length_ = iter->second.second;
- }
-
- // Now that we have our abbreviations, start processing DIE's.
- ProcessDIEs();
-
- // If this is a skeleton compilation unit generated with split DWARF,
- // and the client needs the full debug info, we need to find the full
- // compilation unit in a .dwo or .dwp file.
- if (!is_split_dwarf_
- && dwo_name_ != NULL
- && handler_->NeedSplitDebugInfo())
- ProcessSplitDwarf();
-
- return ourlength;
-}
-
-// If one really wanted, you could merge SkipAttribute and
-// ProcessAttribute
-// This is all boring data manipulation and calling of the handler.
-const uint8_t *CompilationUnit::ProcessAttribute(
- uint64 dieoffset, const uint8_t *start, enum DwarfAttribute attr,
- enum DwarfForm form) {
- size_t len;
-
- switch (form) {
- // DW_FORM_indirect is never used because it is such a space
- // waster.
- case DW_FORM_indirect:
- form = static_cast<enum DwarfForm>(reader_->ReadUnsignedLEB128(start,
- &len));
- start += len;
- return ProcessAttribute(dieoffset, start, attr, form);
-
- case DW_FORM_flag_present:
- ProcessAttributeUnsigned(dieoffset, attr, form, 1);
- return start;
- case DW_FORM_data1:
- case DW_FORM_flag:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadOneByte(start));
- return start + 1;
- case DW_FORM_data2:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadTwoBytes(start));
- return start + 2;
- case DW_FORM_data4:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadFourBytes(start));
- return start + 4;
- case DW_FORM_data8:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadEightBytes(start));
- return start + 8;
- case DW_FORM_string: {
- const char *str = reinterpret_cast<const char *>(start);
- ProcessAttributeString(dieoffset, attr, form, str);
- return start + strlen(str) + 1;
- }
- case DW_FORM_udata:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadUnsignedLEB128(start, &len));
- return start + len;
-
- case DW_FORM_sdata:
- ProcessAttributeSigned(dieoffset, attr, form,
- reader_->ReadSignedLEB128(start, &len));
- return start + len;
- case DW_FORM_addr:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadAddress(start));
- return start + reader_->AddressSize();
- case DW_FORM_sec_offset:
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadOffset(start));
- return start + reader_->OffsetSize();
-
- case DW_FORM_ref1:
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadOneByte(start)
- + offset_from_section_start_);
- return start + 1;
- case DW_FORM_ref2:
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadTwoBytes(start)
- + offset_from_section_start_);
- return start + 2;
- case DW_FORM_ref4:
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadFourBytes(start)
- + offset_from_section_start_);
- return start + 4;
- case DW_FORM_ref8:
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadEightBytes(start)
- + offset_from_section_start_);
- return start + 8;
- case DW_FORM_ref_udata:
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadUnsignedLEB128(start,
- &len)
- + offset_from_section_start_);
- return start + len;
- case DW_FORM_ref_addr:
- // DWARF2 and 3/4 differ on whether ref_addr is address size or
- // offset size.
- assert(header_.version >= 2);
- if (header_.version == 2) {
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadAddress(start));
- return start + reader_->AddressSize();
- } else if (header_.version >= 3) {
- handler_->ProcessAttributeReference(dieoffset, attr, form,
- reader_->ReadOffset(start));
- return start + reader_->OffsetSize();
- }
- break;
- case DW_FORM_ref_sig8:
- handler_->ProcessAttributeSignature(dieoffset, attr, form,
- reader_->ReadEightBytes(start));
- return start + 8;
-
- case DW_FORM_block1: {
- uint64 datalen = reader_->ReadOneByte(start);
- handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 1,
- datalen);
- return start + 1 + datalen;
- }
- case DW_FORM_block2: {
- uint64 datalen = reader_->ReadTwoBytes(start);
- handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 2,
- datalen);
- return start + 2 + datalen;
- }
- case DW_FORM_block4: {
- uint64 datalen = reader_->ReadFourBytes(start);
- handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + 4,
- datalen);
- return start + 4 + datalen;
- }
- case DW_FORM_block:
- case DW_FORM_exprloc: {
- uint64 datalen = reader_->ReadUnsignedLEB128(start, &len);
- handler_->ProcessAttributeBuffer(dieoffset, attr, form, start + len,
- datalen);
- return start + datalen + len;
- }
- case DW_FORM_strp: {
- assert(string_buffer_ != NULL);
-
- const uint64 offset = reader_->ReadOffset(start);
- assert(string_buffer_ + offset < string_buffer_ + string_buffer_length_);
-
- const char *str = reinterpret_cast<const char *>(string_buffer_ + offset);
- ProcessAttributeString(dieoffset, attr, form, str);
- return start + reader_->OffsetSize();
- }
-
- case DW_FORM_GNU_str_index: {
- uint64 str_index = reader_->ReadUnsignedLEB128(start, &len);
- const uint8_t* offset_ptr =
- str_offsets_buffer_ + str_index * reader_->OffsetSize();
- const uint64 offset = reader_->ReadOffset(offset_ptr);
- if (offset >= string_buffer_length_) {
- return NULL;
- }
-
- const char* str = reinterpret_cast<const char *>(string_buffer_) + offset;
- ProcessAttributeString(dieoffset, attr, form, str);
- return start + len;
- break;
- }
- case DW_FORM_GNU_addr_index: {
- uint64 addr_index = reader_->ReadUnsignedLEB128(start, &len);
- const uint8_t* addr_ptr =
- addr_buffer_ + addr_base_ + addr_index * reader_->AddressSize();
- ProcessAttributeUnsigned(dieoffset, attr, form,
- reader_->ReadAddress(addr_ptr));
- return start + len;
- }
- }
- fprintf(stderr, "Unhandled form type\n");
- return NULL;
-}
-
-const uint8_t *CompilationUnit::ProcessDIE(uint64 dieoffset,
- const uint8_t *start,
- const Abbrev& abbrev) {
- for (AttributeList::const_iterator i = abbrev.attributes.begin();
- i != abbrev.attributes.end();
- i++) {
- start = ProcessAttribute(dieoffset, start, i->first, i->second);
- }
-
- // If this is a compilation unit in a split DWARF object, verify that
- // the dwo_id matches. If it does not match, we will ignore this
- // compilation unit.
- if (abbrev.tag == DW_TAG_compile_unit
- && is_split_dwarf_
- && dwo_id_ != skeleton_dwo_id_) {
- return NULL;
- }
-
- return start;
-}
-
-void CompilationUnit::ProcessDIEs() {
- const uint8_t *dieptr = after_header_;
- size_t len;
-
- // lengthstart is the place the length field is based on.
- // It is the point in the header after the initial length field
- const uint8_t *lengthstart = buffer_;
-
- // In 64 bit dwarf, the initial length is 12 bytes, because of the
- // 0xffffffff at the start.
- if (reader_->OffsetSize() == 8)
- lengthstart += 12;
- else
- lengthstart += 4;
-
- std::stack<uint64> die_stack;
-
- while (dieptr < (lengthstart + header_.length)) {
- // We give the user the absolute offset from the beginning of
- // debug_info, since they need it to deal with ref_addr forms.
- uint64 absolute_offset = (dieptr - buffer_) + offset_from_section_start_;
-
- uint64 abbrev_num = reader_->ReadUnsignedLEB128(dieptr, &len);
-
- dieptr += len;
-
- // Abbrev == 0 represents the end of a list of children, or padding
- // at the end of the compilation unit.
- if (abbrev_num == 0) {
- if (die_stack.size() == 0)
- // If it is padding, then we are done with the compilation unit's DIEs.
- return;
- const uint64 offset = die_stack.top();
- die_stack.pop();
- handler_->EndDIE(offset);
- continue;
- }
-
- const Abbrev& abbrev = abbrevs_->at(static_cast<size_t>(abbrev_num));
- const enum DwarfTag tag = abbrev.tag;
- if (!handler_->StartDIE(absolute_offset, tag)) {
- dieptr = SkipDIE(dieptr, abbrev);
- } else {
- dieptr = ProcessDIE(absolute_offset, dieptr, abbrev);
- }
-
- if (abbrev.has_children) {
- die_stack.push(absolute_offset);
- } else {
- handler_->EndDIE(absolute_offset);
- }
- }
-}
-
-// Check for a valid ELF file and return the Address size.
-// Returns 0 if not a valid ELF file.
-inline int GetElfWidth(const ElfReader& elf) {
- if (elf.IsElf32File())
- return 4;
- if (elf.IsElf64File())
- return 8;
- return 0;
-}
-
-void CompilationUnit::ProcessSplitDwarf() {
- struct stat statbuf;
- if (!have_checked_for_dwp_) {
- // Look for a .dwp file in the same directory as the executable.
- have_checked_for_dwp_ = true;
- string dwp_suffix(".dwp");
- dwp_path_ = path_ + dwp_suffix;
- if (stat(dwp_path_.c_str(), &statbuf) != 0) {
- // Fall back to a split .debug file in the same directory.
- string debug_suffix(".debug");
- dwp_path_ = path_;
- size_t found = path_.rfind(debug_suffix);
- if (found + debug_suffix.length() == path_.length())
- dwp_path_ = dwp_path_.replace(found, debug_suffix.length(), dwp_suffix);
- }
- if (stat(dwp_path_.c_str(), &statbuf) == 0) {
- ElfReader* elf = new ElfReader(dwp_path_);
- int width = GetElfWidth(*elf);
- if (width != 0) {
- dwp_byte_reader_.reset(new ByteReader(reader_->GetEndianness()));
- dwp_byte_reader_->SetAddressSize(width);
- dwp_reader_.reset(new DwpReader(*dwp_byte_reader_, elf));
- dwp_reader_->Initialize();
- } else {
- delete elf;
- }
- }
- }
- bool found_in_dwp = false;
- if (dwp_reader_) {
- // If we have a .dwp file, read the debug sections for the requested CU.
- SectionMap sections;
- dwp_reader_->ReadDebugSectionsForCU(dwo_id_, &sections);
- if (!sections.empty()) {
- found_in_dwp = true;
- CompilationUnit dwp_comp_unit(dwp_path_, sections, 0,
- dwp_byte_reader_.get(), handler_);
- dwp_comp_unit.SetSplitDwarf(addr_buffer_, addr_buffer_length_, addr_base_,
- ranges_base_, dwo_id_);
- dwp_comp_unit.Start();
- }
- }
- if (!found_in_dwp) {
- // If no .dwp file, try to open the .dwo file.
- if (stat(dwo_name_, &statbuf) == 0) {
- ElfReader elf(dwo_name_);
- int width = GetElfWidth(elf);
- if (width != 0) {
- ByteReader reader(ENDIANNESS_LITTLE);
- reader.SetAddressSize(width);
- SectionMap sections;
- ReadDebugSectionsFromDwo(&elf, &sections);
- CompilationUnit dwo_comp_unit(dwo_name_, sections, 0, &reader,
- handler_);
- dwo_comp_unit.SetSplitDwarf(addr_buffer_, addr_buffer_length_,
- addr_base_, ranges_base_, dwo_id_);
- dwo_comp_unit.Start();
- }
- }
- }
-}
-
-void CompilationUnit::ReadDebugSectionsFromDwo(ElfReader* elf_reader,
- SectionMap* sections) {
- static const char* const section_names[] = {
- ".debug_abbrev",
- ".debug_info",
- ".debug_str_offsets",
- ".debug_str"
- };
- for (unsigned int i = 0u;
- i < sizeof(section_names)/sizeof(*(section_names)); ++i) {
- string base_name = section_names[i];
- string dwo_name = base_name + ".dwo";
- size_t section_size;
- const char* section_data = elf_reader->GetSectionByName(dwo_name,
- &section_size);
- if (section_data != NULL)
- sections->insert(std::make_pair(
- base_name, std::make_pair(
- reinterpret_cast<const uint8_t *>(section_data),
- section_size)));
- }
-}
-
-DwpReader::DwpReader(const ByteReader& byte_reader, ElfReader* elf_reader)
- : elf_reader_(elf_reader), byte_reader_(byte_reader),
- cu_index_(NULL), cu_index_size_(0), string_buffer_(NULL),
- string_buffer_size_(0), version_(0), ncolumns_(0), nunits_(0),
- nslots_(0), phash_(NULL), pindex_(NULL), shndx_pool_(NULL),
- offset_table_(NULL), size_table_(NULL), abbrev_data_(NULL),
- abbrev_size_(0), info_data_(NULL), info_size_(0),
- str_offsets_data_(NULL), str_offsets_size_(0) {}
-
-DwpReader::~DwpReader() {
- if (elf_reader_) delete elf_reader_;
-}
-
-void DwpReader::Initialize() {
- cu_index_ = elf_reader_->GetSectionByName(".debug_cu_index",
- &cu_index_size_);
- if (cu_index_ == NULL) {
- return;
- }
- // The .debug_str.dwo section is shared by all CUs in the file.
- string_buffer_ = elf_reader_->GetSectionByName(".debug_str.dwo",
- &string_buffer_size_);
-
- version_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_));
-
- if (version_ == 1) {
- nslots_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_)
- + 3 * sizeof(uint32));
- phash_ = cu_index_ + 4 * sizeof(uint32);
- pindex_ = phash_ + nslots_ * sizeof(uint64);
- shndx_pool_ = pindex_ + nslots_ * sizeof(uint32);
- if (shndx_pool_ >= cu_index_ + cu_index_size_) {
- version_ = 0;
- }
- } else if (version_ == 2) {
- ncolumns_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_) + sizeof(uint32));
- nunits_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_) + 2 * sizeof(uint32));
- nslots_ = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(cu_index_) + 3 * sizeof(uint32));
- phash_ = cu_index_ + 4 * sizeof(uint32);
- pindex_ = phash_ + nslots_ * sizeof(uint64);
- offset_table_ = pindex_ + nslots_ * sizeof(uint32);
- size_table_ = offset_table_ + ncolumns_ * (nunits_ + 1) * sizeof(uint32);
- abbrev_data_ = elf_reader_->GetSectionByName(".debug_abbrev.dwo",
- &abbrev_size_);
- info_data_ = elf_reader_->GetSectionByName(".debug_info.dwo", &info_size_);
- str_offsets_data_ = elf_reader_->GetSectionByName(".debug_str_offsets.dwo",
- &str_offsets_size_);
- if (size_table_ >= cu_index_ + cu_index_size_) {
- version_ = 0;
- }
- }
-}
-
-void DwpReader::ReadDebugSectionsForCU(uint64 dwo_id,
- SectionMap* sections) {
- if (version_ == 1) {
- int slot = LookupCU(dwo_id);
- if (slot == -1) {
- return;
- }
-
- // The index table points to the section index pool, where we
- // can read a list of section indexes for the debug sections
- // for the CU whose dwo_id we are looking for.
- int index = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(pindex_)
- + slot * sizeof(uint32));
- const char* shndx_list = shndx_pool_ + index * sizeof(uint32);
- for (;;) {
- if (shndx_list >= cu_index_ + cu_index_size_) {
- version_ = 0;
- return;
- }
- unsigned int shndx = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(shndx_list));
- shndx_list += sizeof(uint32);
- if (shndx == 0)
- break;
- const char* section_name = elf_reader_->GetSectionName(shndx);
- size_t section_size;
- const char* section_data;
- // We're only interested in these four debug sections.
- // The section names in the .dwo file end with ".dwo", but we
- // add them to the sections table with their normal names.
- if (!strncmp(section_name, ".debug_abbrev", strlen(".debug_abbrev"))) {
- section_data = elf_reader_->GetSectionByIndex(shndx, &section_size);
- sections->insert(std::make_pair(
- ".debug_abbrev",
- std::make_pair(reinterpret_cast<const uint8_t *> (section_data),
- section_size)));
- } else if (!strncmp(section_name, ".debug_info", strlen(".debug_info"))) {
- section_data = elf_reader_->GetSectionByIndex(shndx, &section_size);
- sections->insert(std::make_pair(
- ".debug_info",
- std::make_pair(reinterpret_cast<const uint8_t *> (section_data),
- section_size)));
- } else if (!strncmp(section_name, ".debug_str_offsets",
- strlen(".debug_str_offsets"))) {
- section_data = elf_reader_->GetSectionByIndex(shndx, &section_size);
- sections->insert(std::make_pair(
- ".debug_str_offsets",
- std::make_pair(reinterpret_cast<const uint8_t *> (section_data),
- section_size)));
- }
- }
- sections->insert(std::make_pair(
- ".debug_str",
- std::make_pair(reinterpret_cast<const uint8_t *> (string_buffer_),
- string_buffer_size_)));
- } else if (version_ == 2) {
- uint32 index = LookupCUv2(dwo_id);
- if (index == 0) {
- return;
- }
-
- // The index points to a row in each of the section offsets table
- // and the section size table, where we can read the offsets and sizes
- // of the contributions to each debug section from the CU whose dwo_id
- // we are looking for. Row 0 of the section offsets table has the
- // section ids for each column of the table. The size table begins
- // with row 1.
- const char* id_row = offset_table_;
- const char* offset_row = offset_table_
- + index * ncolumns_ * sizeof(uint32);
- const char* size_row =
- size_table_ + (index - 1) * ncolumns_ * sizeof(uint32);
- if (size_row + ncolumns_ * sizeof(uint32) > cu_index_ + cu_index_size_) {
- version_ = 0;
- return;
- }
- for (unsigned int col = 0u; col < ncolumns_; ++col) {
- uint32 section_id =
- byte_reader_.ReadFourBytes(reinterpret_cast<const uint8_t *>(id_row)
- + col * sizeof(uint32));
- uint32 offset = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(offset_row)
- + col * sizeof(uint32));
- uint32 size = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(size_row) + col * sizeof(uint32));
- if (section_id == DW_SECT_ABBREV) {
- sections->insert(std::make_pair(
- ".debug_abbrev",
- std::make_pair(reinterpret_cast<const uint8_t *> (abbrev_data_)
- + offset, size)));
- } else if (section_id == DW_SECT_INFO) {
- sections->insert(std::make_pair(
- ".debug_info",
- std::make_pair(reinterpret_cast<const uint8_t *> (info_data_)
- + offset, size)));
- } else if (section_id == DW_SECT_STR_OFFSETS) {
- sections->insert(std::make_pair(
- ".debug_str_offsets",
- std::make_pair(reinterpret_cast<const uint8_t *> (str_offsets_data_)
- + offset, size)));
- }
- }
- sections->insert(std::make_pair(
- ".debug_str",
- std::make_pair(reinterpret_cast<const uint8_t *> (string_buffer_),
- string_buffer_size_)));
- }
-}
-
-int DwpReader::LookupCU(uint64 dwo_id) {
- uint32 slot = static_cast<uint32>(dwo_id) & (nslots_ - 1);
- uint64 probe = byte_reader_.ReadEightBytes(
- reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64));
- if (probe != 0 && probe != dwo_id) {
- uint32 secondary_hash =
- (static_cast<uint32>(dwo_id >> 32) & (nslots_ - 1)) | 1;
- do {
- slot = (slot + secondary_hash) & (nslots_ - 1);
- probe = byte_reader_.ReadEightBytes(
- reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64));
- } while (probe != 0 && probe != dwo_id);
- }
- if (probe == 0)
- return -1;
- return slot;
-}
-
-uint32 DwpReader::LookupCUv2(uint64 dwo_id) {
- uint32 slot = static_cast<uint32>(dwo_id) & (nslots_ - 1);
- uint64 probe = byte_reader_.ReadEightBytes(
- reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64));
- uint32 index = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(pindex_) + slot * sizeof(uint32));
- if (index != 0 && probe != dwo_id) {
- uint32 secondary_hash =
- (static_cast<uint32>(dwo_id >> 32) & (nslots_ - 1)) | 1;
- do {
- slot = (slot + secondary_hash) & (nslots_ - 1);
- probe = byte_reader_.ReadEightBytes(
- reinterpret_cast<const uint8_t *>(phash_) + slot * sizeof(uint64));
- index = byte_reader_.ReadFourBytes(
- reinterpret_cast<const uint8_t *>(pindex_) + slot * sizeof(uint32));
- } while (index != 0 && probe != dwo_id);
- }
- return index;
-}
-
-LineInfo::LineInfo(const uint8_t *buffer, uint64 buffer_length,
- ByteReader* reader, LineInfoHandler* handler):
- handler_(handler), reader_(reader), buffer_(buffer) {
-#ifndef NDEBUG
- buffer_length_ = buffer_length;
-#endif
- header_.std_opcode_lengths = NULL;
-}
-
-uint64 LineInfo::Start() {
- ReadHeader();
- ReadLines();
- return after_header_ - buffer_;
-}
-
-// The header for a debug_line section is mildly complicated, because
-// the line info is very tightly encoded.
-void LineInfo::ReadHeader() {
- const uint8_t *lineptr = buffer_;
- size_t initial_length_size;
-
- const uint64 initial_length
- = reader_->ReadInitialLength(lineptr, &initial_length_size);
-
- lineptr += initial_length_size;
- header_.total_length = initial_length;
- assert(buffer_ + initial_length_size + header_.total_length <=
- buffer_ + buffer_length_);
-
- // Address size *must* be set by CU ahead of time.
- assert(reader_->AddressSize() != 0);
-
- header_.version = reader_->ReadTwoBytes(lineptr);
- lineptr += 2;
-
- header_.prologue_length = reader_->ReadOffset(lineptr);
- lineptr += reader_->OffsetSize();
-
- header_.min_insn_length = reader_->ReadOneByte(lineptr);
- lineptr += 1;
-
- header_.default_is_stmt = reader_->ReadOneByte(lineptr);
- lineptr += 1;
-
- header_.line_base = *reinterpret_cast<const int8*>(lineptr);
- lineptr += 1;
-
- header_.line_range = reader_->ReadOneByte(lineptr);
- lineptr += 1;
-
- header_.opcode_base = reader_->ReadOneByte(lineptr);
- lineptr += 1;
-
- header_.std_opcode_lengths = new std::vector<unsigned char>;
- header_.std_opcode_lengths->resize(header_.opcode_base + 1);
- (*header_.std_opcode_lengths)[0] = 0;
- for (int i = 1; i < header_.opcode_base; i++) {
- (*header_.std_opcode_lengths)[i] = reader_->ReadOneByte(lineptr);
- lineptr += 1;
- }
-
- // It is legal for the directory entry table to be empty.
- if (*lineptr) {
- uint32 dirindex = 1;
- while (*lineptr) {
- const char *dirname = reinterpret_cast<const char *>(lineptr);
- handler_->DefineDir(dirname, dirindex);
- lineptr += strlen(dirname) + 1;
- dirindex++;
- }
- }
- lineptr++;
-
- // It is also legal for the file entry table to be empty.
- if (*lineptr) {
- uint32 fileindex = 1;
- size_t len;
- while (*lineptr) {
- const char *filename = reinterpret_cast<const char *>(lineptr);
- lineptr += strlen(filename) + 1;
-
- uint64 dirindex = reader_->ReadUnsignedLEB128(lineptr, &len);
- lineptr += len;
-
- uint64 mod_time = reader_->ReadUnsignedLEB128(lineptr, &len);
- lineptr += len;
-
- uint64 filelength = reader_->ReadUnsignedLEB128(lineptr, &len);
- lineptr += len;
- handler_->DefineFile(filename, fileindex, static_cast<uint32>(dirindex),
- mod_time, filelength);
- fileindex++;
- }
- }
- lineptr++;
-
- after_header_ = lineptr;
-}
-
-/* static */
-bool LineInfo::ProcessOneOpcode(ByteReader* reader,
- LineInfoHandler* handler,
- const struct LineInfoHeader &header,
- const uint8_t *start,
- struct LineStateMachine* lsm,
- size_t* len,
- uintptr pc,
- bool *lsm_passes_pc) {
- size_t oplen = 0;
- size_t templen;
- uint8 opcode = reader->ReadOneByte(start);
- oplen++;
- start++;
-
- // If the opcode is great than the opcode_base, it is a special
- // opcode. Most line programs consist mainly of special opcodes.
- if (opcode >= header.opcode_base) {
- opcode -= header.opcode_base;
- const int64 advance_address = (opcode / header.line_range)
- * header.min_insn_length;
- const int32 advance_line = (opcode % header.line_range)
- + header.line_base;
-
- // Check if the lsm passes "pc". If so, mark it as passed.
- if (lsm_passes_pc &&
- lsm->address <= pc && pc < lsm->address + advance_address) {
- *lsm_passes_pc = true;
- }
-
- lsm->address += advance_address;
- lsm->line_num += advance_line;
- lsm->basic_block = true;
- *len = oplen;
- return true;
- }
-
- // Otherwise, we have the regular opcodes
- switch (opcode) {
- case DW_LNS_copy: {
- lsm->basic_block = false;
- *len = oplen;
- return true;
- }
-
- case DW_LNS_advance_pc: {
- uint64 advance_address = reader->ReadUnsignedLEB128(start, &templen);
- oplen += templen;
-
- // Check if the lsm passes "pc". If so, mark it as passed.
- if (lsm_passes_pc && lsm->address <= pc &&
- pc < lsm->address + header.min_insn_length * advance_address) {
- *lsm_passes_pc = true;
- }
-
- lsm->address += header.min_insn_length * advance_address;
- }
- break;
- case DW_LNS_advance_line: {
- const int64 advance_line = reader->ReadSignedLEB128(start, &templen);
- oplen += templen;
- lsm->line_num += static_cast<int32>(advance_line);
-
- // With gcc 4.2.1, we can get the line_no here for the first time
- // since DW_LNS_advance_line is called after DW_LNE_set_address is
- // called. So we check if the lsm passes "pc" here, not in
- // DW_LNE_set_address.
- if (lsm_passes_pc && lsm->address == pc) {
- *lsm_passes_pc = true;
- }
- }
- break;
- case DW_LNS_set_file: {
- const uint64 fileno = reader->ReadUnsignedLEB128(start, &templen);
- oplen += templen;
- lsm->file_num = static_cast<uint32>(fileno);
- }
- break;
- case DW_LNS_set_column: {
- const uint64 colno = reader->ReadUnsignedLEB128(start, &templen);
- oplen += templen;
- lsm->column_num = static_cast<uint32>(colno);
- }
- break;
- case DW_LNS_negate_stmt: {
- lsm->is_stmt = !lsm->is_stmt;
- }
- break;
- case DW_LNS_set_basic_block: {
- lsm->basic_block = true;
- }
- break;
- case DW_LNS_fixed_advance_pc: {
- const uint16 advance_address = reader->ReadTwoBytes(start);
- oplen += 2;
-
- // Check if the lsm passes "pc". If so, mark it as passed.
- if (lsm_passes_pc &&
- lsm->address <= pc && pc < lsm->address + advance_address) {
- *lsm_passes_pc = true;
- }
-
- lsm->address += advance_address;
- }
- break;
- case DW_LNS_const_add_pc: {
- const int64 advance_address = header.min_insn_length
- * ((255 - header.opcode_base)
- / header.line_range);
-
- // Check if the lsm passes "pc". If so, mark it as passed.
- if (lsm_passes_pc &&
- lsm->address <= pc && pc < lsm->address + advance_address) {
- *lsm_passes_pc = true;
- }
-
- lsm->address += advance_address;
- }
- break;
- case DW_LNS_extended_op: {
- const uint64 extended_op_len = reader->ReadUnsignedLEB128(start,
- &templen);
- start += templen;
- oplen += templen + extended_op_len;
-
- const uint64 extended_op = reader->ReadOneByte(start);
- start++;
-
- switch (extended_op) {
- case DW_LNE_end_sequence: {
- lsm->end_sequence = true;
- *len = oplen;
- return true;
- }
- break;
- case DW_LNE_set_address: {
- // With gcc 4.2.1, we cannot tell the line_no here since
- // DW_LNE_set_address is called before DW_LNS_advance_line is
- // called. So we do not check if the lsm passes "pc" here. See
- // also the comment in DW_LNS_advance_line.
- uint64 address = reader->ReadAddress(start);
- lsm->address = address;
- }
- break;
- case DW_LNE_define_file: {
- const char *filename = reinterpret_cast<const char *>(start);
-
- templen = strlen(filename) + 1;
- start += templen;
-
- uint64 dirindex = reader->ReadUnsignedLEB128(start, &templen);
- oplen += templen;
-
- const uint64 mod_time = reader->ReadUnsignedLEB128(start,
- &templen);
- oplen += templen;
-
- const uint64 filelength = reader->ReadUnsignedLEB128(start,
- &templen);
- oplen += templen;
-
- if (handler) {
- handler->DefineFile(filename, -1, static_cast<uint32>(dirindex),
- mod_time, filelength);
- }
- }
- break;
- }
- }
- break;
-
- default: {
- // Ignore unknown opcode silently
- if (header.std_opcode_lengths) {
- for (int i = 0; i < (*header.std_opcode_lengths)[opcode]; i++) {
- reader->ReadUnsignedLEB128(start, &templen);
- start += templen;
- oplen += templen;
- }
- }
- }
- break;
- }
- *len = oplen;
- return false;
-}
-
-void LineInfo::ReadLines() {
- struct LineStateMachine lsm;
-
- // lengthstart is the place the length field is based on.
- // It is the point in the header after the initial length field
- const uint8_t *lengthstart = buffer_;
-
- // In 64 bit dwarf, the initial length is 12 bytes, because of the
- // 0xffffffff at the start.
- if (reader_->OffsetSize() == 8)
- lengthstart += 12;
- else
- lengthstart += 4;
-
- const uint8_t *lineptr = after_header_;
- lsm.Reset(header_.default_is_stmt);
-
- // The LineInfoHandler interface expects each line's length along
- // with its address, but DWARF only provides addresses (sans
- // length), and an end-of-sequence address; one infers the length
- // from the next address. So we report a line only when we get the
- // next line's address, or the end-of-sequence address.
- bool have_pending_line = false;
- uint64 pending_address = 0;
- uint32 pending_file_num = 0, pending_line_num = 0, pending_column_num = 0;
-
- while (lineptr < lengthstart + header_.total_length) {
- size_t oplength;
- bool add_row = ProcessOneOpcode(reader_, handler_, header_,
- lineptr, &lsm, &oplength, (uintptr)-1,
- NULL);
- if (add_row) {
- if (have_pending_line)
- handler_->AddLine(pending_address, lsm.address - pending_address,
- pending_file_num, pending_line_num,
- pending_column_num);
- if (lsm.end_sequence) {
- lsm.Reset(header_.default_is_stmt);
- have_pending_line = false;
- } else {
- pending_address = lsm.address;
- pending_file_num = lsm.file_num;
- pending_line_num = lsm.line_num;
- pending_column_num = lsm.column_num;
- have_pending_line = true;
- }
- }
- lineptr += oplength;
- }
-
- after_header_ = lengthstart + header_.total_length;
-}
-
-// A DWARF rule for recovering the address or value of a register, or
-// computing the canonical frame address. There is one subclass of this for
-// each '*Rule' member function in CallFrameInfo::Handler.
-//
-// It's annoying that we have to handle Rules using pointers (because
-// the concrete instances can have an arbitrary size). They're small,
-// so it would be much nicer if we could just handle them by value
-// instead of fretting about ownership and destruction.
-//
-// It seems like all these could simply be instances of std::tr1::bind,
-// except that we need instances to be EqualityComparable, too.
-//
-// This could logically be nested within State, but then the qualified names
-// get horrendous.
-class CallFrameInfo::Rule {
- public:
- virtual ~Rule() { }
-
- // Tell HANDLER that, at ADDRESS in the program, REGISTER can be
- // recovered using this rule. If REGISTER is kCFARegister, then this rule
- // describes how to compute the canonical frame address. Return what the
- // HANDLER member function returned.
- virtual bool Handle(Handler *handler,
- uint64 address, int register) const = 0;
-
- // Equality on rules. We use these to decide which rules we need
- // to report after a DW_CFA_restore_state instruction.
- virtual bool operator==(const Rule &rhs) const = 0;
-
- bool operator!=(const Rule &rhs) const { return ! (*this == rhs); }
-
- // Return a pointer to a copy of this rule.
- virtual Rule *Copy() const = 0;
-
- // If this is a base+offset rule, change its base register to REG.
- // Otherwise, do nothing. (Ugly, but required for DW_CFA_def_cfa_register.)
- virtual void SetBaseRegister(unsigned reg) { }
-
- // If this is a base+offset rule, change its offset to OFFSET. Otherwise,
- // do nothing. (Ugly, but required for DW_CFA_def_cfa_offset.)
- virtual void SetOffset(long long offset) { }
-};
-
-// Rule: the value the register had in the caller cannot be recovered.
-class CallFrameInfo::UndefinedRule: public CallFrameInfo::Rule {
- public:
- UndefinedRule() { }
- ~UndefinedRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->UndefinedRule(address, reg);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const UndefinedRule *our_rhs = dynamic_cast<const UndefinedRule *>(&rhs);
- return (our_rhs != NULL);
- }
- Rule *Copy() const { return new UndefinedRule(*this); }
-};
-
-// Rule: the register's value is the same as that it had in the caller.
-class CallFrameInfo::SameValueRule: public CallFrameInfo::Rule {
- public:
- SameValueRule() { }
- ~SameValueRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->SameValueRule(address, reg);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const SameValueRule *our_rhs = dynamic_cast<const SameValueRule *>(&rhs);
- return (our_rhs != NULL);
- }
- Rule *Copy() const { return new SameValueRule(*this); }
-};
-
-// Rule: the register is saved at OFFSET from BASE_REGISTER. BASE_REGISTER
-// may be CallFrameInfo::Handler::kCFARegister.
-class CallFrameInfo::OffsetRule: public CallFrameInfo::Rule {
- public:
- OffsetRule(int base_register, long offset)
- : base_register_(base_register), offset_(offset) { }
- ~OffsetRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->OffsetRule(address, reg, base_register_, offset_);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const OffsetRule *our_rhs = dynamic_cast<const OffsetRule *>(&rhs);
- return (our_rhs &&
- base_register_ == our_rhs->base_register_ &&
- offset_ == our_rhs->offset_);
- }
- Rule *Copy() const { return new OffsetRule(*this); }
- // We don't actually need SetBaseRegister or SetOffset here, since they
- // are only ever applied to CFA rules, for DW_CFA_def_cfa_offset, and it
- // doesn't make sense to use OffsetRule for computing the CFA: it
- // computes the address at which a register is saved, not a value.
- private:
- int base_register_;
- long offset_;
-};
-
-// Rule: the value the register had in the caller is the value of
-// BASE_REGISTER plus offset. BASE_REGISTER may be
-// CallFrameInfo::Handler::kCFARegister.
-class CallFrameInfo::ValOffsetRule: public CallFrameInfo::Rule {
- public:
- ValOffsetRule(int base_register, long offset)
- : base_register_(base_register), offset_(offset) { }
- ~ValOffsetRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->ValOffsetRule(address, reg, base_register_, offset_);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const ValOffsetRule *our_rhs = dynamic_cast<const ValOffsetRule *>(&rhs);
- return (our_rhs &&
- base_register_ == our_rhs->base_register_ &&
- offset_ == our_rhs->offset_);
- }
- Rule *Copy() const { return new ValOffsetRule(*this); }
- void SetBaseRegister(unsigned reg) { base_register_ = reg; }
- void SetOffset(long long offset) { offset_ = offset; }
- private:
- int base_register_;
- long offset_;
-};
-
-// Rule: the register has been saved in another register REGISTER_NUMBER_.
-class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule {
- public:
- explicit RegisterRule(int register_number)
- : register_number_(register_number) { }
- ~RegisterRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->RegisterRule(address, reg, register_number_);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const RegisterRule *our_rhs = dynamic_cast<const RegisterRule *>(&rhs);
- return (our_rhs && register_number_ == our_rhs->register_number_);
- }
- Rule *Copy() const { return new RegisterRule(*this); }
- private:
- int register_number_;
-};
-
-// Rule: EXPRESSION evaluates to the address at which the register is saved.
-class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
- public:
- explicit ExpressionRule(const string &expression)
- : expression_(expression) { }
- ~ExpressionRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->ExpressionRule(address, reg, expression_);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const ExpressionRule *our_rhs = dynamic_cast<const ExpressionRule *>(&rhs);
- return (our_rhs && expression_ == our_rhs->expression_);
- }
- Rule *Copy() const { return new ExpressionRule(*this); }
- private:
- string expression_;
-};
-
-// Rule: EXPRESSION evaluates to the address at which the register is saved.
-class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
- public:
- explicit ValExpressionRule(const string &expression)
- : expression_(expression) { }
- ~ValExpressionRule() { }
- bool Handle(Handler *handler, uint64 address, int reg) const {
- return handler->ValExpressionRule(address, reg, expression_);
- }
- bool operator==(const Rule &rhs) const {
- // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
- // been carefully considered; cheap RTTI-like workarounds are forbidden.
- const ValExpressionRule *our_rhs =
- dynamic_cast<const ValExpressionRule *>(&rhs);
- return (our_rhs && expression_ == our_rhs->expression_);
- }
- Rule *Copy() const { return new ValExpressionRule(*this); }
- private:
- string expression_;
-};
-
-// A map from register numbers to rules.
-class CallFrameInfo::RuleMap {
- public:
- RuleMap() : cfa_rule_(NULL) { }
- RuleMap(const RuleMap &rhs) : cfa_rule_(NULL) { *this = rhs; }
- ~RuleMap() { Clear(); }
-
- RuleMap &operator=(const RuleMap &rhs);
-
- // Set the rule for computing the CFA to RULE. Take ownership of RULE.
- void SetCFARule(Rule *rule) { delete cfa_rule_; cfa_rule_ = rule; }
-
- // Return the current CFA rule. Unlike RegisterRule, this RuleMap retains
- // ownership of the rule. We use this for DW_CFA_def_cfa_offset and
- // DW_CFA_def_cfa_register, and for detecting references to the CFA before
- // a rule for it has been established.
- Rule *CFARule() const { return cfa_rule_; }
-
- // Return the rule for REG, or NULL if there is none. The caller takes
- // ownership of the result.
- Rule *RegisterRule(int reg) const;
-
- // Set the rule for computing REG to RULE. Take ownership of RULE.
- void SetRegisterRule(int reg, Rule *rule);
-
- // Make all the appropriate calls to HANDLER as if we were changing from
- // this RuleMap to NEW_RULES at ADDRESS. We use this to implement
- // DW_CFA_restore_state, where lots of rules can change simultaneously.
- // Return true if all handlers returned true; otherwise, return false.
- bool HandleTransitionTo(Handler *handler, uint64 address,
- const RuleMap &new_rules) const;
-
- private:
- // A map from register numbers to Rules.
- typedef std::map<int, Rule *> RuleByNumber;
-
- // Remove all register rules and clear cfa_rule_.
- void Clear();
-
- // The rule for computing the canonical frame address. This RuleMap owns
- // this rule.
- Rule *cfa_rule_;
-
- // A map from register numbers to postfix expressions to recover
- // their values. This RuleMap owns the Rules the map refers to.
- RuleByNumber registers_;
-};
-
-CallFrameInfo::RuleMap &CallFrameInfo::RuleMap::operator=(const RuleMap &rhs) {
- Clear();
- // Since each map owns the rules it refers to, assignment must copy them.
- if (rhs.cfa_rule_) cfa_rule_ = rhs.cfa_rule_->Copy();
- for (RuleByNumber::const_iterator it = rhs.registers_.begin();
- it != rhs.registers_.end(); it++)
- registers_[it->first] = it->second->Copy();
- return *this;
-}
-
-CallFrameInfo::Rule *CallFrameInfo::RuleMap::RegisterRule(int reg) const {
- assert(reg != Handler::kCFARegister);
- RuleByNumber::const_iterator it = registers_.find(reg);
- if (it != registers_.end())
- return it->second->Copy();
- else
- return NULL;
-}
-
-void CallFrameInfo::RuleMap::SetRegisterRule(int reg, Rule *rule) {
- assert(reg != Handler::kCFARegister);
- assert(rule);
- Rule **slot = &registers_[reg];
- delete *slot;
- *slot = rule;
-}
-
-bool CallFrameInfo::RuleMap::HandleTransitionTo(
- Handler *handler,
- uint64 address,
- const RuleMap &new_rules) const {
- // Transition from cfa_rule_ to new_rules.cfa_rule_.
- if (cfa_rule_ && new_rules.cfa_rule_) {
- if (*cfa_rule_ != *new_rules.cfa_rule_ &&
- !new_rules.cfa_rule_->Handle(handler, address,
- Handler::kCFARegister))
- return false;
- } else if (cfa_rule_) {
- // this RuleMap has a CFA rule but new_rules doesn't.
- // CallFrameInfo::Handler has no way to handle this --- and shouldn't;
- // it's garbage input. The instruction interpreter should have
- // detected this and warned, so take no action here.
- } else if (new_rules.cfa_rule_) {
- // This shouldn't be possible: NEW_RULES is some prior state, and
- // there's no way to remove entries.
- assert(0);
- } else {
- // Both CFA rules are empty. No action needed.
- }
-
- // Traverse the two maps in order by register number, and report
- // whatever differences we find.
- RuleByNumber::const_iterator old_it = registers_.begin();
- RuleByNumber::const_iterator new_it = new_rules.registers_.begin();
- while (old_it != registers_.end() && new_it != new_rules.registers_.end()) {
- if (old_it->first < new_it->first) {
- // This RuleMap has an entry for old_it->first, but NEW_RULES
- // doesn't.
- //
- // This isn't really the right thing to do, but since CFI generally
- // only mentions callee-saves registers, and GCC's convention for
- // callee-saves registers is that they are unchanged, it's a good
- // approximation.
- if (!handler->SameValueRule(address, old_it->first))
- return false;
- old_it++;
- } else if (old_it->first > new_it->first) {
- // NEW_RULES has entry for new_it->first, but this RuleMap
- // doesn't. This shouldn't be possible: NEW_RULES is some prior
- // state, and there's no way to remove entries.
- assert(0);
- } else {
- // Both maps have an entry for this register. Report the new
- // rule if it is different.
- if (*old_it->second != *new_it->second &&
- !new_it->second->Handle(handler, address, new_it->first))
- return false;
- new_it++, old_it++;
- }
- }
- // Finish off entries from this RuleMap with no counterparts in new_rules.
- while (old_it != registers_.end()) {
- if (!handler->SameValueRule(address, old_it->first))
- return false;
- old_it++;
- }
- // Since we only make transitions from a rule set to some previously
- // saved rule set, and we can only add rules to the map, NEW_RULES
- // must have fewer rules than *this.
- assert(new_it == new_rules.registers_.end());
-
- return true;
-}
-
-// Remove all register rules and clear cfa_rule_.
-void CallFrameInfo::RuleMap::Clear() {
- delete cfa_rule_;
- cfa_rule_ = NULL;
- for (RuleByNumber::iterator it = registers_.begin();
- it != registers_.end(); it++)
- delete it->second;
- registers_.clear();
-}
-
-// The state of the call frame information interpreter as it processes
-// instructions from a CIE and FDE.
-class CallFrameInfo::State {
- public:
- // Create a call frame information interpreter state with the given
- // reporter, reader, handler, and initial call frame info address.
- State(ByteReader *reader, Handler *handler, Reporter *reporter,
- uint64 address)
- : reader_(reader), handler_(handler), reporter_(reporter),
- address_(address), entry_(NULL), cursor_(NULL) { }
-
- // Interpret instructions from CIE, save the resulting rule set for
- // DW_CFA_restore instructions, and return true. On error, report
- // the problem to reporter_ and return false.
- bool InterpretCIE(const CIE &cie);
-
- // Interpret instructions from FDE, and return true. On error,
- // report the problem to reporter_ and return false.
- bool InterpretFDE(const FDE &fde);
-
- private:
- // The operands of a CFI instruction, for ParseOperands.
- struct Operands {
- unsigned register_number; // A register number.
- uint64 offset; // An offset or address.
- long signed_offset; // A signed offset.
- string expression; // A DWARF expression.
- };
-
- // Parse CFI instruction operands from STATE's instruction stream as
- // described by FORMAT. On success, populate OPERANDS with the
- // results, and return true. On failure, report the problem and
- // return false.
- //
- // Each character of FORMAT should be one of the following:
- //
- // 'r' unsigned LEB128 register number (OPERANDS->register_number)
- // 'o' unsigned LEB128 offset (OPERANDS->offset)
- // 's' signed LEB128 offset (OPERANDS->signed_offset)
- // 'a' machine-size address (OPERANDS->offset)
- // (If the CIE has a 'z' augmentation string, 'a' uses the
- // encoding specified by the 'R' argument.)
- // '1' a one-byte offset (OPERANDS->offset)
- // '2' a two-byte offset (OPERANDS->offset)
- // '4' a four-byte offset (OPERANDS->offset)
- // '8' an eight-byte offset (OPERANDS->offset)
- // 'e' a DW_FORM_block holding a (OPERANDS->expression)
- // DWARF expression
- bool ParseOperands(const char *format, Operands *operands);
-
- // Interpret one CFI instruction from STATE's instruction stream, update
- // STATE, report any rule changes to handler_, and return true. On
- // failure, report the problem and return false.
- bool DoInstruction();
-
- // The following Do* member functions are subroutines of DoInstruction,
- // factoring out the actual work of operations that have several
- // different encodings.
-
- // Set the CFA rule to be the value of BASE_REGISTER plus OFFSET, and
- // return true. On failure, report and return false. (Used for
- // DW_CFA_def_cfa and DW_CFA_def_cfa_sf.)
- bool DoDefCFA(unsigned base_register, long offset);
-
- // Change the offset of the CFA rule to OFFSET, and return true. On
- // failure, report and return false. (Subroutine for
- // DW_CFA_def_cfa_offset and DW_CFA_def_cfa_offset_sf.)
- bool DoDefCFAOffset(long offset);
-
- // Specify that REG can be recovered using RULE, and return true. On
- // failure, report and return false.
- bool DoRule(unsigned reg, Rule *rule);
-
- // Specify that REG can be found at OFFSET from the CFA, and return true.
- // On failure, report and return false. (Subroutine for DW_CFA_offset,
- // DW_CFA_offset_extended, and DW_CFA_offset_extended_sf.)
- bool DoOffset(unsigned reg, long offset);
-
- // Specify that the caller's value for REG is the CFA plus OFFSET,
- // and return true. On failure, report and return false. (Subroutine
- // for DW_CFA_val_offset and DW_CFA_val_offset_sf.)
- bool DoValOffset(unsigned reg, long offset);
-
- // Restore REG to the rule established in the CIE, and return true. On
- // failure, report and return false. (Subroutine for DW_CFA_restore and
- // DW_CFA_restore_extended.)
- bool DoRestore(unsigned reg);
-
- // Return the section offset of the instruction at cursor. For use
- // in error messages.
- uint64 CursorOffset() { return entry_->offset + (cursor_ - entry_->start); }
-
- // Report that entry_ is incomplete, and return false. For brevity.
- bool ReportIncomplete() {
- reporter_->Incomplete(entry_->offset, entry_->kind);
- return false;
- }
-
- // For reading multi-byte values with the appropriate endianness.
- ByteReader *reader_;
-
- // The handler to which we should report the data we find.
- Handler *handler_;
-
- // For reporting problems in the info we're parsing.
- Reporter *reporter_;
-
- // The code address to which the next instruction in the stream applies.
- uint64 address_;
-
- // The entry whose instructions we are currently processing. This is
- // first a CIE, and then an FDE.
- const Entry *entry_;
-
- // The next instruction to process.
- const uint8_t *cursor_;
-
- // The current set of rules.
- RuleMap rules_;
-
- // The set of rules established by the CIE, used by DW_CFA_restore
- // and DW_CFA_restore_extended. We set this after interpreting the
- // CIE's instructions.
- RuleMap cie_rules_;
-
- // A stack of saved states, for DW_CFA_remember_state and
- // DW_CFA_restore_state.
- std::stack<RuleMap> saved_rules_;
-};
-
-bool CallFrameInfo::State::InterpretCIE(const CIE &cie) {
- entry_ = &cie;
- cursor_ = entry_->instructions;
- while (cursor_ < entry_->end)
- if (!DoInstruction())
- return false;
- // Note the rules established by the CIE, for use by DW_CFA_restore
- // and DW_CFA_restore_extended.
- cie_rules_ = rules_;
- return true;
-}
-
-bool CallFrameInfo::State::InterpretFDE(const FDE &fde) {
- entry_ = &fde;
- cursor_ = entry_->instructions;
- while (cursor_ < entry_->end)
- if (!DoInstruction())
- return false;
- return true;
-}
-
-bool CallFrameInfo::State::ParseOperands(const char *format,
- Operands *operands) {
- size_t len;
- const char *operand;
-
- for (operand = format; *operand; operand++) {
- size_t bytes_left = entry_->end - cursor_;
- switch (*operand) {
- case 'r':
- operands->register_number = reader_->ReadUnsignedLEB128(cursor_, &len);
- if (len > bytes_left) return ReportIncomplete();
- cursor_ += len;
- break;
-
- case 'o':
- operands->offset = reader_->ReadUnsignedLEB128(cursor_, &len);
- if (len > bytes_left) return ReportIncomplete();
- cursor_ += len;
- break;
-
- case 's':
- operands->signed_offset = reader_->ReadSignedLEB128(cursor_, &len);
- if (len > bytes_left) return ReportIncomplete();
- cursor_ += len;
- break;
-
- case 'a':
- operands->offset =
- reader_->ReadEncodedPointer(cursor_, entry_->cie->pointer_encoding,
- &len);
- if (len > bytes_left) return ReportIncomplete();
- cursor_ += len;
- break;
-
- case '1':
- if (1 > bytes_left) return ReportIncomplete();
- operands->offset = static_cast<unsigned char>(*cursor_++);
- break;
-
- case '2':
- if (2 > bytes_left) return ReportIncomplete();
- operands->offset = reader_->ReadTwoBytes(cursor_);
- cursor_ += 2;
- break;
-
- case '4':
- if (4 > bytes_left) return ReportIncomplete();
- operands->offset = reader_->ReadFourBytes(cursor_);
- cursor_ += 4;
- break;
-
- case '8':
- if (8 > bytes_left) return ReportIncomplete();
- operands->offset = reader_->ReadEightBytes(cursor_);
- cursor_ += 8;
- break;
-
- case 'e': {
- size_t expression_length = reader_->ReadUnsignedLEB128(cursor_, &len);
- if (len > bytes_left || expression_length > bytes_left - len)
- return ReportIncomplete();
- cursor_ += len;
- operands->expression = string(reinterpret_cast<const char *>(cursor_),
- expression_length);
- cursor_ += expression_length;
- break;
- }
-
- default:
- assert(0);
- }
- }
-
- return true;
-}
-
-bool CallFrameInfo::State::DoInstruction() {
- CIE *cie = entry_->cie;
- Operands ops;
-
- // Our entry's kind should have been set by now.
- assert(entry_->kind != kUnknown);
-
- // We shouldn't have been invoked unless there were more
- // instructions to parse.
- assert(cursor_ < entry_->end);
-
- unsigned opcode = *cursor_++;
- if ((opcode & 0xc0) != 0) {
- switch (opcode & 0xc0) {
- // Advance the address.
- case DW_CFA_advance_loc: {
- size_t code_offset = opcode & 0x3f;
- address_ += code_offset * cie->code_alignment_factor;
- break;
- }
-
- // Find a register at an offset from the CFA.
- case DW_CFA_offset:
- if (!ParseOperands("o", &ops) ||
- !DoOffset(opcode & 0x3f, ops.offset * cie->data_alignment_factor))
- return false;
- break;
-
- // Restore the rule established for a register by the CIE.
- case DW_CFA_restore:
- if (!DoRestore(opcode & 0x3f)) return false;
- break;
-
- // The 'if' above should have excluded this possibility.
- default:
- assert(0);
- }
-
- // Return here, so the big switch below won't be indented.
- return true;
- }
-
- switch (opcode) {
- // Set the address.
- case DW_CFA_set_loc:
- if (!ParseOperands("a", &ops)) return false;
- address_ = ops.offset;
- break;
-
- // Advance the address.
- case DW_CFA_advance_loc1:
- if (!ParseOperands("1", &ops)) return false;
- address_ += ops.offset * cie->code_alignment_factor;
- break;
-
- // Advance the address.
- case DW_CFA_advance_loc2:
- if (!ParseOperands("2", &ops)) return false;
- address_ += ops.offset * cie->code_alignment_factor;
- break;
-
- // Advance the address.
- case DW_CFA_advance_loc4:
- if (!ParseOperands("4", &ops)) return false;
- address_ += ops.offset * cie->code_alignment_factor;
- break;
-
- // Advance the address.
- case DW_CFA_MIPS_advance_loc8:
- if (!ParseOperands("8", &ops)) return false;
- address_ += ops.offset * cie->code_alignment_factor;
- break;
-
- // Compute the CFA by adding an offset to a register.
- case DW_CFA_def_cfa:
- if (!ParseOperands("ro", &ops) ||
- !DoDefCFA(ops.register_number, ops.offset))
- return false;
- break;
-
- // Compute the CFA by adding an offset to a register.
- case DW_CFA_def_cfa_sf:
- if (!ParseOperands("rs", &ops) ||
- !DoDefCFA(ops.register_number,
- ops.signed_offset * cie->data_alignment_factor))
- return false;
- break;
-
- // Change the base register used to compute the CFA.
- case DW_CFA_def_cfa_register: {
- if (!ParseOperands("r", &ops)) return false;
- Rule *cfa_rule = rules_.CFARule();
- if (!cfa_rule) {
- if (!DoDefCFA(ops.register_number, ops.offset)) {
- reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset());
- return false;
- }
- } else {
- cfa_rule->SetBaseRegister(ops.register_number);
- if (!cfa_rule->Handle(handler_, address_,
- Handler::kCFARegister))
- return false;
- }
- break;
- }
-
- // Change the offset used to compute the CFA.
- case DW_CFA_def_cfa_offset:
- if (!ParseOperands("o", &ops) ||
- !DoDefCFAOffset(ops.offset))
- return false;
- break;
-
- // Change the offset used to compute the CFA.
- case DW_CFA_def_cfa_offset_sf:
- if (!ParseOperands("s", &ops) ||
- !DoDefCFAOffset(ops.signed_offset * cie->data_alignment_factor))
- return false;
- break;
-
- // Specify an expression whose value is the CFA.
- case DW_CFA_def_cfa_expression: {
- if (!ParseOperands("e", &ops))
- return false;
- Rule *rule = new ValExpressionRule(ops.expression);
- rules_.SetCFARule(rule);
- if (!rule->Handle(handler_, address_,
- Handler::kCFARegister))
- return false;
- break;
- }
-
- // The register's value cannot be recovered.
- case DW_CFA_undefined: {
- if (!ParseOperands("r", &ops) ||
- !DoRule(ops.register_number, new UndefinedRule()))
- return false;
- break;
- }
-
- // The register's value is unchanged from its value in the caller.
- case DW_CFA_same_value: {
- if (!ParseOperands("r", &ops) ||
- !DoRule(ops.register_number, new SameValueRule()))
- return false;
- break;
- }
-
- // Find a register at an offset from the CFA.
- case DW_CFA_offset_extended:
- if (!ParseOperands("ro", &ops) ||
- !DoOffset(ops.register_number,
- ops.offset * cie->data_alignment_factor))
- return false;
- break;
-
- // The register is saved at an offset from the CFA.
- case DW_CFA_offset_extended_sf:
- if (!ParseOperands("rs", &ops) ||
- !DoOffset(ops.register_number,
- ops.signed_offset * cie->data_alignment_factor))
- return false;
- break;
-
- // The register is saved at an offset from the CFA.
- case DW_CFA_GNU_negative_offset_extended:
- if (!ParseOperands("ro", &ops) ||
- !DoOffset(ops.register_number,
- -ops.offset * cie->data_alignment_factor))
- return false;
- break;
-
- // The register's value is the sum of the CFA plus an offset.
- case DW_CFA_val_offset:
- if (!ParseOperands("ro", &ops) ||
- !DoValOffset(ops.register_number,
- ops.offset * cie->data_alignment_factor))
- return false;
- break;
-
- // The register's value is the sum of the CFA plus an offset.
- case DW_CFA_val_offset_sf:
- if (!ParseOperands("rs", &ops) ||
- !DoValOffset(ops.register_number,
- ops.signed_offset * cie->data_alignment_factor))
- return false;
- break;
-
- // The register has been saved in another register.
- case DW_CFA_register: {
- if (!ParseOperands("ro", &ops) ||
- !DoRule(ops.register_number, new RegisterRule(ops.offset)))
- return false;
- break;
- }
-
- // An expression yields the address at which the register is saved.
- case DW_CFA_expression: {
- if (!ParseOperands("re", &ops) ||
- !DoRule(ops.register_number, new ExpressionRule(ops.expression)))
- return false;
- break;
- }
-
- // An expression yields the caller's value for the register.
- case DW_CFA_val_expression: {
- if (!ParseOperands("re", &ops) ||
- !DoRule(ops.register_number, new ValExpressionRule(ops.expression)))
- return false;
- break;
- }
-
- // Restore the rule established for a register by the CIE.
- case DW_CFA_restore_extended:
- if (!ParseOperands("r", &ops) ||
- !DoRestore( ops.register_number))
- return false;
- break;
-
- // Save the current set of rules on a stack.
- case DW_CFA_remember_state:
- saved_rules_.push(rules_);
- break;
-
- // Pop the current set of rules off the stack.
- case DW_CFA_restore_state: {
- if (saved_rules_.empty()) {
- reporter_->EmptyStateStack(entry_->offset, entry_->kind,
- CursorOffset());
- return false;
- }
- const RuleMap &new_rules = saved_rules_.top();
- if (rules_.CFARule() && !new_rules.CFARule()) {
- reporter_->ClearingCFARule(entry_->offset, entry_->kind,
- CursorOffset());
- return false;
- }
- rules_.HandleTransitionTo(handler_, address_, new_rules);
- rules_ = new_rules;
- saved_rules_.pop();
- break;
- }
-
- // No operation. (Padding instruction.)
- case DW_CFA_nop:
- break;
-
- // A SPARC register window save: Registers 8 through 15 (%o0-%o7)
- // are saved in registers 24 through 31 (%i0-%i7), and registers
- // 16 through 31 (%l0-%l7 and %i0-%i7) are saved at CFA offsets
- // (0-15 * the register size). The register numbers must be
- // hard-coded. A GNU extension, and not a pretty one.
- case DW_CFA_GNU_window_save: {
- // Save %o0-%o7 in %i0-%i7.
- for (int i = 8; i < 16; i++)
- if (!DoRule(i, new RegisterRule(i + 16)))
- return false;
- // Save %l0-%l7 and %i0-%i7 at the CFA.
- for (int i = 16; i < 32; i++)
- // Assume that the byte reader's address size is the same as
- // the architecture's register size. !@#%*^ hilarious.
- if (!DoRule(i, new OffsetRule(Handler::kCFARegister,
- (i - 16) * reader_->AddressSize())))
- return false;
- break;
- }
-
- // I'm not sure what this is. GDB doesn't use it for unwinding.
- case DW_CFA_GNU_args_size:
- if (!ParseOperands("o", &ops)) return false;
- break;
-
- // An opcode we don't recognize.
- default: {
- reporter_->BadInstruction(entry_->offset, entry_->kind, CursorOffset());
- return false;
- }
- }
-
- return true;
-}
-
-bool CallFrameInfo::State::DoDefCFA(unsigned base_register, long offset) {
- Rule *rule = new ValOffsetRule(base_register, offset);
- rules_.SetCFARule(rule);
- return rule->Handle(handler_, address_,
- Handler::kCFARegister);
-}
-
-bool CallFrameInfo::State::DoDefCFAOffset(long offset) {
- Rule *cfa_rule = rules_.CFARule();
- if (!cfa_rule) {
- reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset());
- return false;
- }
- cfa_rule->SetOffset(offset);
- return cfa_rule->Handle(handler_, address_,
- Handler::kCFARegister);
-}
-
-bool CallFrameInfo::State::DoRule(unsigned reg, Rule *rule) {
- rules_.SetRegisterRule(reg, rule);
- return rule->Handle(handler_, address_, reg);
-}
-
-bool CallFrameInfo::State::DoOffset(unsigned reg, long offset) {
- if (!rules_.CFARule()) {
- reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset());
- return false;
- }
- return DoRule(reg,
- new OffsetRule(Handler::kCFARegister, offset));
-}
-
-bool CallFrameInfo::State::DoValOffset(unsigned reg, long offset) {
- if (!rules_.CFARule()) {
- reporter_->NoCFARule(entry_->offset, entry_->kind, CursorOffset());
- return false;
- }
- return DoRule(reg,
- new ValOffsetRule(Handler::kCFARegister, offset));
-}
-
-bool CallFrameInfo::State::DoRestore(unsigned reg) {
- // DW_CFA_restore and DW_CFA_restore_extended don't make sense in a CIE.
- if (entry_->kind == kCIE) {
- reporter_->RestoreInCIE(entry_->offset, CursorOffset());
- return false;
- }
- Rule *rule = cie_rules_.RegisterRule(reg);
- if (!rule) {
- // This isn't really the right thing to do, but since CFI generally
- // only mentions callee-saves registers, and GCC's convention for
- // callee-saves registers is that they are unchanged, it's a good
- // approximation.
- rule = new SameValueRule();
- }
- return DoRule(reg, rule);
-}
-
-bool CallFrameInfo::ReadEntryPrologue(const uint8_t *cursor, Entry *entry) {
- const uint8_t *buffer_end = buffer_ + buffer_length_;
-
- // Initialize enough of ENTRY for use in error reporting.
- entry->offset = cursor - buffer_;
- entry->start = cursor;
- entry->kind = kUnknown;
- entry->end = NULL;
-
- // Read the initial length. This sets reader_'s offset size.
- size_t length_size;
- uint64 length = reader_->ReadInitialLength(cursor, &length_size);
- if (length_size > size_t(buffer_end - cursor))
- return ReportIncomplete(entry);
- cursor += length_size;
-
- // In a .eh_frame section, a length of zero marks the end of the series
- // of entries.
- if (length == 0 && eh_frame_) {
- entry->kind = kTerminator;
- entry->end = cursor;
- return true;
- }
-
- // Validate the length.
- if (length > size_t(buffer_end - cursor))
- return ReportIncomplete(entry);
-
- // The length is the number of bytes after the initial length field;
- // we have that position handy at this point, so compute the end
- // now. (If we're parsing 64-bit-offset DWARF on a 32-bit machine,
- // and the length didn't fit in a size_t, we would have rejected it
- // above.)
- entry->end = cursor + length;
-
- // Parse the next field: either the offset of a CIE or a CIE id.
- size_t offset_size = reader_->OffsetSize();
- if (offset_size > size_t(entry->end - cursor)) return ReportIncomplete(entry);
- entry->id = reader_->ReadOffset(cursor);
-
- // Don't advance cursor past id field yet; in .eh_frame data we need
- // the id's position to compute the section offset of an FDE's CIE.
-
- // Now we can decide what kind of entry this is.
- if (eh_frame_) {
- // In .eh_frame data, an ID of zero marks the entry as a CIE, and
- // anything else is an offset from the id field of the FDE to the start
- // of the CIE.
- if (entry->id == 0) {
- entry->kind = kCIE;
- } else {
- entry->kind = kFDE;
- // Turn the offset from the id into an offset from the buffer's start.
- entry->id = (cursor - buffer_) - entry->id;
- }
- } else {
- // In DWARF CFI data, an ID of ~0 (of the appropriate width, given the
- // offset size for the entry) marks the entry as a CIE, and anything
- // else is the offset of the CIE from the beginning of the section.
- if (offset_size == 4)
- entry->kind = (entry->id == 0xffffffff) ? kCIE : kFDE;
- else {
- assert(offset_size == 8);
- entry->kind = (entry->id == 0xffffffffffffffffULL) ? kCIE : kFDE;
- }
- }
-
- // Now advance cursor past the id.
- cursor += offset_size;
-
- // The fields specific to this kind of entry start here.
- entry->fields = cursor;
-
- entry->cie = NULL;
-
- return true;
-}
-
-bool CallFrameInfo::ReadCIEFields(CIE *cie) {
- const uint8_t *cursor = cie->fields;
- size_t len;
-
- assert(cie->kind == kCIE);
-
- // Prepare for early exit.
- cie->version = 0;
- cie->augmentation.clear();
- cie->code_alignment_factor = 0;
- cie->data_alignment_factor = 0;
- cie->return_address_register = 0;
- cie->has_z_augmentation = false;
- cie->pointer_encoding = DW_EH_PE_absptr;
- cie->instructions = 0;
-
- // Parse the version number.
- if (cie->end - cursor < 1)
- return ReportIncomplete(cie);
- cie->version = reader_->ReadOneByte(cursor);
- cursor++;
-
- // If we don't recognize the version, we can't parse any more fields of the
- // CIE. For DWARF CFI, we handle versions 1 through 3 (there was never a
- // version 2 of CFI data). For .eh_frame, we handle versions 1 and 3 as well;
- // the difference between those versions seems to be the same as for
- // .debug_frame.
- if (cie->version < 1 || cie->version > 3) {
- reporter_->UnrecognizedVersion(cie->offset, cie->version);
- return false;
- }
-
- const uint8_t *augmentation_start = cursor;
- const uint8_t *augmentation_end =
- reinterpret_cast<const uint8_t *>(memchr(augmentation_start, '\0',
- cie->end - augmentation_start));
- if (! augmentation_end) return ReportIncomplete(cie);
- cursor = augmentation_end;
- cie->augmentation = string(reinterpret_cast<const char *>(augmentation_start),
- cursor - augmentation_start);
- // Skip the terminating '\0'.
- cursor++;
-
- // Is this CFI augmented?
- if (!cie->augmentation.empty()) {
- // Is it an augmentation we recognize?
- if (cie->augmentation[0] == DW_Z_augmentation_start) {
- // Linux C++ ABI 'z' augmentation, used for exception handling data.
- cie->has_z_augmentation = true;
- } else {
- // Not an augmentation we recognize. Augmentations can have arbitrary
- // effects on the form of rest of the content, so we have to give up.
- reporter_->UnrecognizedAugmentation(cie->offset, cie->augmentation);
- return false;
- }
- }
-
- // Parse the code alignment factor.
- cie->code_alignment_factor = reader_->ReadUnsignedLEB128(cursor, &len);
- if (size_t(cie->end - cursor) < len) return ReportIncomplete(cie);
- cursor += len;
-
- // Parse the data alignment factor.
- cie->data_alignment_factor = reader_->ReadSignedLEB128(cursor, &len);
- if (size_t(cie->end - cursor) < len) return ReportIncomplete(cie);
- cursor += len;
-
- // Parse the return address register. This is a ubyte in version 1, and
- // a ULEB128 in version 3.
- if (cie->version == 1) {
- if (cursor >= cie->end) return ReportIncomplete(cie);
- cie->return_address_register = uint8(*cursor++);
- } else {
- cie->return_address_register = reader_->ReadUnsignedLEB128(cursor, &len);
- if (size_t(cie->end - cursor) < len) return ReportIncomplete(cie);
- cursor += len;
- }
-
- // If we have a 'z' augmentation string, find the augmentation data and
- // use the augmentation string to parse it.
- if (cie->has_z_augmentation) {
- uint64_t data_size = reader_->ReadUnsignedLEB128(cursor, &len);
- if (size_t(cie->end - cursor) < len + data_size)
- return ReportIncomplete(cie);
- cursor += len;
- const uint8_t *data = cursor;
- cursor += data_size;
- const uint8_t *data_end = cursor;
-
- cie->has_z_lsda = false;
- cie->has_z_personality = false;
- cie->has_z_signal_frame = false;
-
- // Walk the augmentation string, and extract values from the
- // augmentation data as the string directs.
- for (size_t i = 1; i < cie->augmentation.size(); i++) {
- switch (cie->augmentation[i]) {
- case DW_Z_has_LSDA:
- // The CIE's augmentation data holds the language-specific data
- // area pointer's encoding, and the FDE's augmentation data holds
- // the pointer itself.
- cie->has_z_lsda = true;
- // Fetch the LSDA encoding from the augmentation data.
- if (data >= data_end) return ReportIncomplete(cie);
- cie->lsda_encoding = DwarfPointerEncoding(*data++);
- if (!reader_->ValidEncoding(cie->lsda_encoding)) {
- reporter_->InvalidPointerEncoding(cie->offset, cie->lsda_encoding);
- return false;
- }
- // Don't check if the encoding is usable here --- we haven't
- // read the FDE's fields yet, so we're not prepared for
- // DW_EH_PE_funcrel, although that's a fine encoding for the
- // LSDA to use, since it appears in the FDE.
- break;
-
- case DW_Z_has_personality_routine:
- // The CIE's augmentation data holds the personality routine
- // pointer's encoding, followed by the pointer itself.
- cie->has_z_personality = true;
- // Fetch the personality routine pointer's encoding from the
- // augmentation data.
- if (data >= data_end) return ReportIncomplete(cie);
- cie->personality_encoding = DwarfPointerEncoding(*data++);
- if (!reader_->ValidEncoding(cie->personality_encoding)) {
- reporter_->InvalidPointerEncoding(cie->offset,
- cie->personality_encoding);
- return false;
- }
- if (!reader_->UsableEncoding(cie->personality_encoding)) {
- reporter_->UnusablePointerEncoding(cie->offset,
- cie->personality_encoding);
- return false;
- }
- // Fetch the personality routine's pointer itself from the data.
- cie->personality_address =
- reader_->ReadEncodedPointer(data, cie->personality_encoding,
- &len);
- if (len > size_t(data_end - data))
- return ReportIncomplete(cie);
- data += len;
- break;
-
- case DW_Z_has_FDE_address_encoding:
- // The CIE's augmentation data holds the pointer encoding to use
- // for addresses in the FDE.
- if (data >= data_end) return ReportIncomplete(cie);
- cie->pointer_encoding = DwarfPointerEncoding(*data++);
- if (!reader_->ValidEncoding(cie->pointer_encoding)) {
- reporter_->InvalidPointerEncoding(cie->offset,
- cie->pointer_encoding);
- return false;
- }
- if (!reader_->UsableEncoding(cie->pointer_encoding)) {
- reporter_->UnusablePointerEncoding(cie->offset,
- cie->pointer_encoding);
- return false;
- }
- break;
-
- case DW_Z_is_signal_trampoline:
- // Frames using this CIE are signal delivery frames.
- cie->has_z_signal_frame = true;
- break;
-
- default:
- // An augmentation we don't recognize.
- reporter_->UnrecognizedAugmentation(cie->offset, cie->augmentation);
- return false;
- }
- }
- }
-
- // The CIE's instructions start here.
- cie->instructions = cursor;
-
- return true;
-}
-
-bool CallFrameInfo::ReadFDEFields(FDE *fde) {
- const uint8_t *cursor = fde->fields;
- size_t size;
-
- fde->address = reader_->ReadEncodedPointer(cursor, fde->cie->pointer_encoding,
- &size);
- if (size > size_t(fde->end - cursor))
- return ReportIncomplete(fde);
- cursor += size;
- reader_->SetFunctionBase(fde->address);
-
- // For the length, we strip off the upper nybble of the encoding used for
- // the starting address.
- DwarfPointerEncoding length_encoding =
- DwarfPointerEncoding(fde->cie->pointer_encoding & 0x0f);
- fde->size = reader_->ReadEncodedPointer(cursor, length_encoding, &size);
- if (size > size_t(fde->end - cursor))
- return ReportIncomplete(fde);
- cursor += size;
-
- // If the CIE has a 'z' augmentation string, then augmentation data
- // appears here.
- if (fde->cie->has_z_augmentation) {
- uint64_t data_size = reader_->ReadUnsignedLEB128(cursor, &size);
- if (size_t(fde->end - cursor) < size + data_size)
- return ReportIncomplete(fde);
- cursor += size;
-
- // In the abstract, we should walk the augmentation string, and extract
- // items from the FDE's augmentation data as we encounter augmentation
- // string characters that specify their presence: the ordering of items
- // in the augmentation string determines the arrangement of values in
- // the augmentation data.
- //
- // In practice, there's only ever one value in FDE augmentation data
- // that we support --- the LSDA pointer --- and we have to bail if we
- // see any unrecognized augmentation string characters. So if there is
- // anything here at all, we know what it is, and where it starts.
- if (fde->cie->has_z_lsda) {
- // Check whether the LSDA's pointer encoding is usable now: only once
- // we've parsed the FDE's starting address do we call reader_->
- // SetFunctionBase, so that the DW_EH_PE_funcrel encoding becomes
- // usable.
- if (!reader_->UsableEncoding(fde->cie->lsda_encoding)) {
- reporter_->UnusablePointerEncoding(fde->cie->offset,
- fde->cie->lsda_encoding);
- return false;
- }
-
- fde->lsda_address =
- reader_->ReadEncodedPointer(cursor, fde->cie->lsda_encoding, &size);
- if (size > data_size)
- return ReportIncomplete(fde);
- // Ideally, we would also complain here if there were unconsumed
- // augmentation data.
- }
-
- cursor += data_size;
- }
-
- // The FDE's instructions start after those.
- fde->instructions = cursor;
-
- return true;
-}
-
-bool CallFrameInfo::Start() {
- const uint8_t *buffer_end = buffer_ + buffer_length_;
- const uint8_t *cursor;
- bool all_ok = true;
- const uint8_t *entry_end;
- bool ok;
-
- // Traverse all the entries in buffer_, skipping CIEs and offering
- // FDEs to the handler.
- for (cursor = buffer_; cursor < buffer_end;
- cursor = entry_end, all_ok = all_ok && ok) {
- FDE fde;
-
- // Make it easy to skip this entry with 'continue': assume that
- // things are not okay until we've checked all the data, and
- // prepare the address of the next entry.
- ok = false;
-
- // Read the entry's prologue.
- if (!ReadEntryPrologue(cursor, &fde)) {
- if (!fde.end) {
- // If we couldn't even figure out this entry's extent, then we
- // must stop processing entries altogether.
- all_ok = false;
- break;
- }
- entry_end = fde.end;
- continue;
- }
-
- // The next iteration picks up after this entry.
- entry_end = fde.end;
-
- // Did we see an .eh_frame terminating mark?
- if (fde.kind == kTerminator) {
- // If there appears to be more data left in the section after the
- // terminating mark, warn the user. But this is just a warning;
- // we leave all_ok true.
- if (fde.end < buffer_end) reporter_->EarlyEHTerminator(fde.offset);
- break;
- }
-
- // In this loop, we skip CIEs. We only parse them fully when we
- // parse an FDE that refers to them. This limits our memory
- // consumption (beyond the buffer itself) to that needed to
- // process the largest single entry.
- if (fde.kind != kFDE) {
- ok = true;
- continue;
- }
-
- // Validate the CIE pointer.
- if (fde.id > buffer_length_) {
- reporter_->CIEPointerOutOfRange(fde.offset, fde.id);
- continue;
- }
-
- CIE cie;
-
- // Parse this FDE's CIE header.
- if (!ReadEntryPrologue(buffer_ + fde.id, &cie))
- continue;
- // This had better be an actual CIE.
- if (cie.kind != kCIE) {
- reporter_->BadCIEId(fde.offset, fde.id);
- continue;
- }
- if (!ReadCIEFields(&cie))
- continue;
-
- // We now have the values that govern both the CIE and the FDE.
- cie.cie = &cie;
- fde.cie = &cie;
-
- // Parse the FDE's header.
- if (!ReadFDEFields(&fde))
- continue;
-
- // Call Entry to ask the consumer if they're interested.
- if (!handler_->Entry(fde.offset, fde.address, fde.size,
- cie.version, cie.augmentation,
- cie.return_address_register)) {
- // The handler isn't interested in this entry. That's not an error.
- ok = true;
- continue;
- }
-
- if (cie.has_z_augmentation) {
- // Report the personality routine address, if we have one.
- if (cie.has_z_personality) {
- if (!handler_
- ->PersonalityRoutine(cie.personality_address,
- IsIndirectEncoding(cie.personality_encoding)))
- continue;
- }
-
- // Report the language-specific data area address, if we have one.
- if (cie.has_z_lsda) {
- if (!handler_
- ->LanguageSpecificDataArea(fde.lsda_address,
- IsIndirectEncoding(cie.lsda_encoding)))
- continue;
- }
-
- // If this is a signal-handling frame, report that.
- if (cie.has_z_signal_frame) {
- if (!handler_->SignalHandler())
- continue;
- }
- }
-
- // Interpret the CIE's instructions, and then the FDE's instructions.
- State state(reader_, handler_, reporter_, fde.address);
- ok = state.InterpretCIE(cie) && state.InterpretFDE(fde);
-
- // Tell the ByteReader that the function start address from the
- // FDE header is no longer valid.
- reader_->ClearFunctionBase();
-
- // Report the end of the entry.
- handler_->End();
- }
-
- return all_ok;
-}
-
-const char *CallFrameInfo::KindName(EntryKind kind) {
- if (kind == CallFrameInfo::kUnknown)
- return "entry";
- else if (kind == CallFrameInfo::kCIE)
- return "common information entry";
- else if (kind == CallFrameInfo::kFDE)
- return "frame description entry";
- else {
- assert (kind == CallFrameInfo::kTerminator);
- return ".eh_frame sequence terminator";
- }
-}
-
-bool CallFrameInfo::ReportIncomplete(Entry *entry) {
- reporter_->Incomplete(entry->offset, entry->kind);
- return false;
-}
-
-void CallFrameInfo::Reporter::Incomplete(uint64 offset,
- CallFrameInfo::EntryKind kind) {
- fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in '%s': entry ends early\n",
- filename_.c_str(), CallFrameInfo::KindName(kind), offset,
- section_.c_str());
-}
-
-void CallFrameInfo::Reporter::EarlyEHTerminator(uint64 offset) {
- fprintf(stderr,
- "%s: CFI at offset 0x%llx in '%s': saw end-of-data marker"
- " before end of section contents\n",
- filename_.c_str(), offset, section_.c_str());
-}
-
-void CallFrameInfo::Reporter::CIEPointerOutOfRange(uint64 offset,
- uint64 cie_offset) {
- fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
- " CIE pointer is out of range: 0x%llx\n",
- filename_.c_str(), offset, section_.c_str(), cie_offset);
-}
-
-void CallFrameInfo::Reporter::BadCIEId(uint64 offset, uint64 cie_offset) {
- fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
- " CIE pointer does not point to a CIE: 0x%llx\n",
- filename_.c_str(), offset, section_.c_str(), cie_offset);
-}
-
-void CallFrameInfo::Reporter::UnrecognizedVersion(uint64 offset, int version) {
- fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
- " CIE specifies unrecognized version: %d\n",
- filename_.c_str(), offset, section_.c_str(), version);
-}
-
-void CallFrameInfo::Reporter::UnrecognizedAugmentation(uint64 offset,
- const string &aug) {
- fprintf(stderr,
- "%s: CFI frame description entry at offset 0x%llx in '%s':"
- " CIE specifies unrecognized augmentation: '%s'\n",
- filename_.c_str(), offset, section_.c_str(), aug.c_str());
-}
-
-void CallFrameInfo::Reporter::InvalidPointerEncoding(uint64 offset,
- uint8 encoding) {
- fprintf(stderr,
- "%s: CFI common information entry at offset 0x%llx in '%s':"
- " 'z' augmentation specifies invalid pointer encoding: 0x%02x\n",
- filename_.c_str(), offset, section_.c_str(), encoding);
-}
-
-void CallFrameInfo::Reporter::UnusablePointerEncoding(uint64 offset,
- uint8 encoding) {
- fprintf(stderr,
- "%s: CFI common information entry at offset 0x%llx in '%s':"
- " 'z' augmentation specifies a pointer encoding for which"
- " we have no base address: 0x%02x\n",
- filename_.c_str(), offset, section_.c_str(), encoding);
-}
-
-void CallFrameInfo::Reporter::RestoreInCIE(uint64 offset, uint64 insn_offset) {
- fprintf(stderr,
- "%s: CFI common information entry at offset 0x%llx in '%s':"
- " the DW_CFA_restore instruction at offset 0x%llx"
- " cannot be used in a common information entry\n",
- filename_.c_str(), offset, section_.c_str(), insn_offset);
-}
-
-void CallFrameInfo::Reporter::BadInstruction(uint64 offset,
- CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
- fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the instruction at offset 0x%llx is unrecognized\n",
- filename_.c_str(), CallFrameInfo::KindName(kind),
- offset, section_.c_str(), insn_offset);
-}
-
-void CallFrameInfo::Reporter::NoCFARule(uint64 offset,
- CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
- fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the instruction at offset 0x%llx assumes that a CFA rule has"
- " been set, but none has been set\n",
- filename_.c_str(), CallFrameInfo::KindName(kind), offset,
- section_.c_str(), insn_offset);
-}
-
-void CallFrameInfo::Reporter::EmptyStateStack(uint64 offset,
- CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
- fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the DW_CFA_restore_state instruction at offset 0x%llx"
- " should pop a saved state from the stack, but the stack is empty\n",
- filename_.c_str(), CallFrameInfo::KindName(kind), offset,
- section_.c_str(), insn_offset);
-}
-
-void CallFrameInfo::Reporter::ClearingCFARule(uint64 offset,
- CallFrameInfo::EntryKind kind,
- uint64 insn_offset) {
- fprintf(stderr,
- "%s: CFI %s at offset 0x%llx in section '%s':"
- " the DW_CFA_restore_state instruction at offset 0x%llx"
- " would clear the CFA rule in effect\n",
- filename_.c_str(), CallFrameInfo::KindName(kind), offset,
- section_.c_str(), insn_offset);
-}
-
-} // namespace dwarf2reader
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h
deleted file mode 100644
index 064c42bc8a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader.h
+++ /dev/null
@@ -1,1288 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// CFI reader author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// This file contains definitions related to the DWARF2/3 reader and
-// it's handler interfaces.
-// The DWARF2/3 specification can be found at
-// http://dwarf.freestandards.org and should be considered required
-// reading if you wish to modify the implementation.
-// Only a cursory attempt is made to explain terminology that is
-// used here, as it is much better explained in the standard documents
-#ifndef COMMON_DWARF_DWARF2READER_H__
-#define COMMON_DWARF_DWARF2READER_H__
-
-#include <stdint.h>
-
-#include <list>
-#include <map>
-#include <string>
-#include <utility>
-#include <vector>
-#include <memory>
-
-#include "common/dwarf/bytereader.h"
-#include "common/dwarf/dwarf2enums.h"
-#include "common/dwarf/types.h"
-#include "common/using_std_string.h"
-#include "common/dwarf/elf_reader.h"
-
-namespace dwarf2reader {
-struct LineStateMachine;
-class Dwarf2Handler;
-class LineInfoHandler;
-class DwpReader;
-
-// This maps from a string naming a section to a pair containing a
-// the data for the section, and the size of the section.
-typedef std::map<string, std::pair<const uint8_t *, uint64> > SectionMap;
-typedef std::list<std::pair<enum DwarfAttribute, enum DwarfForm> >
- AttributeList;
-typedef AttributeList::iterator AttributeIterator;
-typedef AttributeList::const_iterator ConstAttributeIterator;
-
-struct LineInfoHeader {
- uint64 total_length;
- uint16 version;
- uint64 prologue_length;
- uint8 min_insn_length; // insn stands for instructin
- bool default_is_stmt; // stmt stands for statement
- int8 line_base;
- uint8 line_range;
- uint8 opcode_base;
- // Use a pointer so that signalsafe_addr2line is able to use this structure
- // without heap allocation problem.
- std::vector<unsigned char> *std_opcode_lengths;
-};
-
-class LineInfo {
- public:
-
- // Initializes a .debug_line reader. Buffer and buffer length point
- // to the beginning and length of the line information to read.
- // Reader is a ByteReader class that has the endianness set
- // properly.
- LineInfo(const uint8_t *buffer_, uint64 buffer_length,
- ByteReader* reader, LineInfoHandler* handler);
-
- virtual ~LineInfo() {
- if (header_.std_opcode_lengths) {
- delete header_.std_opcode_lengths;
- }
- }
-
- // Start processing line info, and calling callbacks in the handler.
- // Consumes the line number information for a single compilation unit.
- // Returns the number of bytes processed.
- uint64 Start();
-
- // Process a single line info opcode at START using the state
- // machine at LSM. Return true if we should define a line using the
- // current state of the line state machine. Place the length of the
- // opcode in LEN.
- // If LSM_PASSES_PC is non-NULL, this function also checks if the lsm
- // passes the address of PC. In other words, LSM_PASSES_PC will be
- // set to true, if the following condition is met.
- //
- // lsm's old address < PC <= lsm's new address
- static bool ProcessOneOpcode(ByteReader* reader,
- LineInfoHandler* handler,
- const struct LineInfoHeader &header,
- const uint8_t *start,
- struct LineStateMachine* lsm,
- size_t* len,
- uintptr pc,
- bool *lsm_passes_pc);
-
- private:
- // Reads the DWARF2/3 header for this line info.
- void ReadHeader();
-
- // Reads the DWARF2/3 line information
- void ReadLines();
-
- // The associated handler to call processing functions in
- LineInfoHandler* handler_;
-
- // The associated ByteReader that handles endianness issues for us
- ByteReader* reader_;
-
- // A DWARF2/3 line info header. This is not the same size as
- // in the actual file, as the one in the file may have a 32 bit or
- // 64 bit lengths
-
- struct LineInfoHeader header_;
-
- // buffer is the buffer for our line info, starting at exactly where
- // the line info to read is. after_header is the place right after
- // the end of the line information header.
- const uint8_t *buffer_;
-#ifndef NDEBUG
- uint64 buffer_length_;
-#endif
- const uint8_t *after_header_;
-};
-
-// This class is the main interface between the line info reader and
-// the client. The virtual functions inside this get called for
-// interesting events that happen during line info reading. The
-// default implementation does nothing
-
-class LineInfoHandler {
- public:
- LineInfoHandler() { }
-
- virtual ~LineInfoHandler() { }
-
- // Called when we define a directory. NAME is the directory name,
- // DIR_NUM is the directory number
- virtual void DefineDir(const string& name, uint32 dir_num) { }
-
- // Called when we define a filename. NAME is the filename, FILE_NUM
- // is the file number which is -1 if the file index is the next
- // index after the last numbered index (this happens when files are
- // dynamically defined by the line program), DIR_NUM is the
- // directory index for the directory name of this file, MOD_TIME is
- // the modification time of the file, and LENGTH is the length of
- // the file
- virtual void DefineFile(const string& name, int32 file_num,
- uint32 dir_num, uint64 mod_time,
- uint64 length) { }
-
- // Called when the line info reader has a new line, address pair
- // ready for us. ADDRESS is the address of the code, LENGTH is the
- // length of its machine code in bytes, FILE_NUM is the file number
- // containing the code, LINE_NUM is the line number in that file for
- // the code, and COLUMN_NUM is the column number the code starts at,
- // if we know it (0 otherwise).
- virtual void AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num, uint32 column_num) { }
-};
-
-// This class is the main interface between the reader and the
-// client. The virtual functions inside this get called for
-// interesting events that happen during DWARF2 reading.
-// The default implementation skips everything.
-class Dwarf2Handler {
- public:
- Dwarf2Handler() { }
-
- virtual ~Dwarf2Handler() { }
-
- // Start to process a compilation unit at OFFSET from the beginning of the
- // .debug_info section. Return false if you would like to skip this
- // compilation unit.
- virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version) { return false; }
-
- // When processing a skeleton compilation unit, resulting from a split
- // DWARF compilation, once the skeleton debug info has been read,
- // the reader will call this function to ask the client if it needs
- // the full debug info from the .dwo or .dwp file. Return true if
- // you need it, or false to skip processing the split debug info.
- virtual bool NeedSplitDebugInfo() { return true; }
-
- // Start to process a split compilation unit at OFFSET from the beginning of
- // the debug_info section in the .dwp/.dwo file. Return false if you would
- // like to skip this compilation unit.
- virtual bool StartSplitCompilationUnit(uint64 offset,
- uint64 cu_length) { return false; }
-
- // Start to process a DIE at OFFSET from the beginning of the .debug_info
- // section. Return false if you would like to skip this DIE.
- virtual bool StartDIE(uint64 offset, enum DwarfTag tag) { return false; }
-
- // Called when we have an attribute with unsigned data to give to our
- // handler. The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, and its value is
- // DATA.
- virtual void ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) { }
-
- // Called when we have an attribute with signed data to give to our handler.
- // The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, and its value is
- // DATA.
- virtual void ProcessAttributeSigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) { }
-
- // Called when we have an attribute whose value is a reference to
- // another DIE. The attribute belongs to the DIE at OFFSET from the
- // beginning of the .debug_info section. Its name is ATTR, its form
- // is FORM, and the offset of the DIE being referred to from the
- // beginning of the .debug_info section is DATA.
- virtual void ProcessAttributeReference(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) { }
-
- // Called when we have an attribute with a buffer of data to give to our
- // handler. The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, DATA points to
- // the buffer's contents, and its length in bytes is LENGTH. The buffer is
- // owned by the caller, not the callee, and may not persist for very long.
- // If you want the data to be available later, it needs to be copied.
- virtual void ProcessAttributeBuffer(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const uint8_t *data,
- uint64 len) { }
-
- // Called when we have an attribute with string data to give to our handler.
- // The attribute is for the DIE at OFFSET from the beginning of the
- // .debug_info section. Its name is ATTR, its form is FORM, and its value is
- // DATA.
- virtual void ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string& data) { }
-
- // Called when we have an attribute whose value is the 64-bit signature
- // of a type unit in the .debug_types section. OFFSET is the offset of
- // the DIE whose attribute we're reporting. ATTR and FORM are the
- // attribute's name and form. SIGNATURE is the type unit's signature.
- virtual void ProcessAttributeSignature(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 signature) { }
-
- // Called when finished processing the DIE at OFFSET.
- // Because DWARF2/3 specifies a tree of DIEs, you may get starts
- // before ends of the previous DIE, as we process children before
- // ending the parent.
- virtual void EndDIE(uint64 offset) { }
-
-};
-
-// The base of DWARF2/3 debug info is a DIE (Debugging Information
-// Entry.
-// DWARF groups DIE's into a tree and calls the root of this tree a
-// "compilation unit". Most of the time, there is one compilation
-// unit in the .debug_info section for each file that had debug info
-// generated.
-// Each DIE consists of
-
-// 1. a tag specifying a thing that is being described (ie
-// DW_TAG_subprogram for functions, DW_TAG_variable for variables, etc
-// 2. attributes (such as DW_AT_location for location in memory,
-// DW_AT_name for name), and data for each attribute.
-// 3. A flag saying whether the DIE has children or not
-
-// In order to gain some amount of compression, the format of
-// each DIE (tag name, attributes and data forms for the attributes)
-// are stored in a separate table called the "abbreviation table".
-// This is done because a large number of DIEs have the exact same tag
-// and list of attributes, but different data for those attributes.
-// As a result, the .debug_info section is just a stream of data, and
-// requires reading of the .debug_abbrev section to say what the data
-// means.
-
-// As a warning to the user, it should be noted that the reason for
-// using absolute offsets from the beginning of .debug_info is that
-// DWARF2/3 supports referencing DIE's from other DIE's by their offset
-// from either the current compilation unit start, *or* the beginning
-// of the .debug_info section. This means it is possible to reference
-// a DIE in one compilation unit from a DIE in another compilation
-// unit. This style of reference is usually used to eliminate
-// duplicated information that occurs across compilation
-// units, such as base types, etc. GCC 3.4+ support this with
-// -feliminate-dwarf2-dups. Other toolchains will sometimes do
-// duplicate elimination in the linker.
-
-class CompilationUnit {
- public:
-
- // Initialize a compilation unit. This requires a map of sections,
- // the offset of this compilation unit in the .debug_info section, a
- // ByteReader, and a Dwarf2Handler class to call callbacks in.
- CompilationUnit(const string& path, const SectionMap& sections, uint64 offset,
- ByteReader* reader, Dwarf2Handler* handler);
- virtual ~CompilationUnit() {
- if (abbrevs_) delete abbrevs_;
- }
-
- // Initialize a compilation unit from a .dwo or .dwp file.
- // In this case, we need the .debug_addr section from the
- // executable file that contains the corresponding skeleton
- // compilation unit. We also inherit the Dwarf2Handler from
- // the executable file, and call it as if we were still
- // processing the original compilation unit.
- void SetSplitDwarf(const uint8_t* addr_buffer, uint64 addr_buffer_length,
- uint64 addr_base, uint64 ranges_base, uint64 dwo_id);
-
- // Begin reading a Dwarf2 compilation unit, and calling the
- // callbacks in the Dwarf2Handler
-
- // Return the full length of the compilation unit, including
- // headers. This plus the starting offset passed to the constructor
- // is the offset of the end of the compilation unit --- and the
- // start of the next compilation unit, if there is one.
- uint64 Start();
-
- private:
-
- // This struct represents a single DWARF2/3 abbreviation
- // The abbreviation tells how to read a DWARF2/3 DIE, and consist of a
- // tag and a list of attributes, as well as the data form of each attribute.
- struct Abbrev {
- uint64 number;
- enum DwarfTag tag;
- bool has_children;
- AttributeList attributes;
- };
-
- // A DWARF2/3 compilation unit header. This is not the same size as
- // in the actual file, as the one in the file may have a 32 bit or
- // 64 bit length.
- struct CompilationUnitHeader {
- uint64 length;
- uint16 version;
- uint64 abbrev_offset;
- uint8 address_size;
- } header_;
-
- // Reads the DWARF2/3 header for this compilation unit.
- void ReadHeader();
-
- // Reads the DWARF2/3 abbreviations for this compilation unit
- void ReadAbbrevs();
-
- // Processes a single DIE for this compilation unit and return a new
- // pointer just past the end of it
- const uint8_t *ProcessDIE(uint64 dieoffset,
- const uint8_t *start,
- const Abbrev& abbrev);
-
- // Processes a single attribute and return a new pointer just past the
- // end of it
- const uint8_t *ProcessAttribute(uint64 dieoffset,
- const uint8_t *start,
- enum DwarfAttribute attr,
- enum DwarfForm form);
-
- // Called when we have an attribute with unsigned data to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of compilation unit, has a name of ATTR, a form of
- // FORM, and the actual data of the attribute is in DATA.
- // If we see a DW_AT_GNU_dwo_id attribute, save the value so that
- // we can find the debug info in a .dwo or .dwp file.
- void ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- if (attr == DW_AT_GNU_dwo_id) {
- dwo_id_ = data;
- }
- else if (attr == DW_AT_GNU_addr_base) {
- addr_base_ = data;
- }
- else if (attr == DW_AT_GNU_ranges_base) {
- ranges_base_ = data;
- }
- // TODO(yunlian): When we add DW_AT_ranges_base from DWARF-5,
- // that base will apply to DW_AT_ranges attributes in the
- // skeleton CU as well as in the .dwo/.dwp files.
- else if (attr == DW_AT_ranges && is_split_dwarf_) {
- data += ranges_base_;
- }
- handler_->ProcessAttributeUnsigned(offset, attr, form, data);
- }
-
- // Called when we have an attribute with signed data to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of compilation unit, has a name of ATTR, a form of
- // FORM, and the actual data of the attribute is in DATA.
- void ProcessAttributeSigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) {
- handler_->ProcessAttributeSigned(offset, attr, form, data);
- }
-
- // Called when we have an attribute with a buffer of data to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of compilation unit, has a name of ATTR, a form of
- // FORM, and the actual data of the attribute is in DATA, and the
- // length of the buffer is LENGTH.
- void ProcessAttributeBuffer(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const uint8_t* data,
- uint64 len) {
- handler_->ProcessAttributeBuffer(offset, attr, form, data, len);
- }
-
- // Called when we have an attribute with string data to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of compilation unit, has a name of ATTR, a form of
- // FORM, and the actual data of the attribute is in DATA.
- // If we see a DW_AT_GNU_dwo_name attribute, save the value so
- // that we can find the debug info in a .dwo or .dwp file.
- void ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const char* data) {
- if (attr == DW_AT_GNU_dwo_name)
- dwo_name_ = data;
- handler_->ProcessAttributeString(offset, attr, form, data);
- }
-
- // Processes all DIEs for this compilation unit
- void ProcessDIEs();
-
- // Skips the die with attributes specified in ABBREV starting at
- // START, and return the new place to position the stream to.
- const uint8_t *SkipDIE(const uint8_t *start, const Abbrev& abbrev);
-
- // Skips the attribute starting at START, with FORM, and return the
- // new place to position the stream to.
- const uint8_t *SkipAttribute(const uint8_t *start, enum DwarfForm form);
-
- // Process the actual debug information in a split DWARF file.
- void ProcessSplitDwarf();
-
- // Read the debug sections from a .dwo file.
- void ReadDebugSectionsFromDwo(ElfReader* elf_reader,
- SectionMap* sections);
-
- // Path of the file containing the debug information.
- const string path_;
-
- // Offset from section start is the offset of this compilation unit
- // from the beginning of the .debug_info section.
- uint64 offset_from_section_start_;
-
- // buffer is the buffer for our CU, starting at .debug_info + offset
- // passed in from constructor.
- // after_header points to right after the compilation unit header.
- const uint8_t *buffer_;
- uint64 buffer_length_;
- const uint8_t *after_header_;
-
- // The associated ByteReader that handles endianness issues for us
- ByteReader* reader_;
-
- // The map of sections in our file to buffers containing their data
- const SectionMap& sections_;
-
- // The associated handler to call processing functions in
- Dwarf2Handler* handler_;
-
- // Set of DWARF2/3 abbreviations for this compilation unit. Indexed
- // by abbreviation number, which means that abbrevs_[0] is not
- // valid.
- std::vector<Abbrev>* abbrevs_;
-
- // String section buffer and length, if we have a string section.
- // This is here to avoid doing a section lookup for strings in
- // ProcessAttribute, which is in the hot path for DWARF2 reading.
- const uint8_t *string_buffer_;
- uint64 string_buffer_length_;
-
- // String offsets section buffer and length, if we have a string offsets
- // section (.debug_str_offsets or .debug_str_offsets.dwo).
- const uint8_t* str_offsets_buffer_;
- uint64 str_offsets_buffer_length_;
-
- // Address section buffer and length, if we have an address section
- // (.debug_addr).
- const uint8_t* addr_buffer_;
- uint64 addr_buffer_length_;
-
- // Flag indicating whether this compilation unit is part of a .dwo
- // or .dwp file. If true, we are reading this unit because a
- // skeleton compilation unit in an executable file had a
- // DW_AT_GNU_dwo_name or DW_AT_GNU_dwo_id attribute.
- // In a .dwo file, we expect the string offsets section to
- // have a ".dwo" suffix, and we will use the ".debug_addr" section
- // associated with the skeleton compilation unit.
- bool is_split_dwarf_;
-
- // The value of the DW_AT_GNU_dwo_id attribute, if any.
- uint64 dwo_id_;
-
- // The value of the DW_AT_GNU_dwo_name attribute, if any.
- const char* dwo_name_;
-
- // If this is a split DWARF CU, the value of the DW_AT_GNU_dwo_id attribute
- // from the skeleton CU.
- uint64 skeleton_dwo_id_;
-
- // The value of the DW_AT_GNU_ranges_base attribute, if any.
- uint64 ranges_base_;
-
- // The value of the DW_AT_GNU_addr_base attribute, if any.
- uint64 addr_base_;
-
- // True if we have already looked for a .dwp file.
- bool have_checked_for_dwp_;
-
- // Path to the .dwp file.
- string dwp_path_;
-
- // ByteReader for the DWP file.
- std::unique_ptr<ByteReader> dwp_byte_reader_;
-
- // DWP reader.
- std::unique_ptr<DwpReader> dwp_reader_;
-};
-
-// A Reader for a .dwp file. Supports the fetching of DWARF debug
-// info for a given dwo_id.
-//
-// There are two versions of .dwp files. In both versions, the
-// .dwp file is an ELF file containing only debug sections.
-// In Version 1, the file contains many copies of each debug
-// section, one for each .dwo file that is packaged in the .dwp
-// file, and the .debug_cu_index section maps from the dwo_id
-// to a set of section indexes. In Version 2, the file contains
-// one of each debug section, and the .debug_cu_index section
-// maps from the dwo_id to a set of offsets and lengths that
-// identify each .dwo file's contribution to the larger sections.
-
-class DwpReader {
- public:
- DwpReader(const ByteReader& byte_reader, ElfReader* elf_reader);
-
- ~DwpReader();
-
- // Read the CU index and initialize data members.
- void Initialize();
-
- // Read the debug sections for the given dwo_id.
- void ReadDebugSectionsForCU(uint64 dwo_id, SectionMap* sections);
-
- private:
- // Search a v1 hash table for "dwo_id". Returns the slot index
- // where the dwo_id was found, or -1 if it was not found.
- int LookupCU(uint64 dwo_id);
-
- // Search a v2 hash table for "dwo_id". Returns the row index
- // in the offsets and sizes tables, or 0 if it was not found.
- uint32 LookupCUv2(uint64 dwo_id);
-
- // The ELF reader for the .dwp file.
- ElfReader* elf_reader_;
-
- // The ByteReader for the .dwp file.
- const ByteReader& byte_reader_;
-
- // Pointer to the .debug_cu_index section.
- const char* cu_index_;
-
- // Size of the .debug_cu_index section.
- size_t cu_index_size_;
-
- // Pointer to the .debug_str.dwo section.
- const char* string_buffer_;
-
- // Size of the .debug_str.dwo section.
- size_t string_buffer_size_;
-
- // Version of the .dwp file. We support versions 1 and 2 currently.
- int version_;
-
- // Number of columns in the section tables (version 2).
- unsigned int ncolumns_;
-
- // Number of units in the section tables (version 2).
- unsigned int nunits_;
-
- // Number of slots in the hash table.
- unsigned int nslots_;
-
- // Pointer to the beginning of the hash table.
- const char* phash_;
-
- // Pointer to the beginning of the index table.
- const char* pindex_;
-
- // Pointer to the beginning of the section index pool (version 1).
- const char* shndx_pool_;
-
- // Pointer to the beginning of the section offset table (version 2).
- const char* offset_table_;
-
- // Pointer to the beginning of the section size table (version 2).
- const char* size_table_;
-
- // Contents of the sections of interest (version 2).
- const char* abbrev_data_;
- size_t abbrev_size_;
- const char* info_data_;
- size_t info_size_;
- const char* str_offsets_data_;
- size_t str_offsets_size_;
-};
-
-// This class is a reader for DWARF's Call Frame Information. CFI
-// describes how to unwind stack frames --- even for functions that do
-// not follow fixed conventions for saving registers, whose frame size
-// varies as they execute, etc.
-//
-// CFI describes, at each machine instruction, how to compute the
-// stack frame's base address, how to find the return address, and
-// where to find the saved values of the caller's registers (if the
-// callee has stashed them somewhere to free up the registers for its
-// own use).
-//
-// For example, suppose we have a function whose machine code looks
-// like this (imagine an assembly language that looks like C, for a
-// machine with 32-bit registers, and a stack that grows towards lower
-// addresses):
-//
-// func: ; entry point; return address at sp
-// func+0: sp = sp - 16 ; allocate space for stack frame
-// func+1: sp[12] = r0 ; save r0 at sp+12
-// ... ; other code, not frame-related
-// func+10: sp -= 4; *sp = x ; push some x on the stack
-// ... ; other code, not frame-related
-// func+20: r0 = sp[16] ; restore saved r0
-// func+21: sp += 20 ; pop whole stack frame
-// func+22: pc = *sp; sp += 4 ; pop return address and jump to it
-//
-// DWARF CFI is (a very compressed representation of) a table with a
-// row for each machine instruction address and a column for each
-// register showing how to restore it, if possible.
-//
-// A special column named "CFA", for "Canonical Frame Address", tells how
-// to compute the base address of the frame; registers' entries may
-// refer to the CFA in describing where the registers are saved.
-//
-// Another special column, named "RA", represents the return address.
-//
-// For example, here is a complete (uncompressed) table describing the
-// function above:
-//
-// insn cfa r0 r1 ... ra
-// =======================================
-// func+0: sp cfa[0]
-// func+1: sp+16 cfa[0]
-// func+2: sp+16 cfa[-4] cfa[0]
-// func+11: sp+20 cfa[-4] cfa[0]
-// func+21: sp+20 cfa[0]
-// func+22: sp cfa[0]
-//
-// Some things to note here:
-//
-// - Each row describes the state of affairs *before* executing the
-// instruction at the given address. Thus, the row for func+0
-// describes the state before we allocate the stack frame. In the
-// next row, the formula for computing the CFA has changed,
-// reflecting that allocation.
-//
-// - The other entries are written in terms of the CFA; this allows
-// them to remain unchanged as the stack pointer gets bumped around.
-// For example, the rule for recovering the return address (the "ra"
-// column) remains unchanged throughout the function, even as the
-// stack pointer takes on three different offsets from the return
-// address.
-//
-// - Although we haven't shown it, most calling conventions designate
-// "callee-saves" and "caller-saves" registers. The callee must
-// preserve the values of callee-saves registers; if it uses them,
-// it must save their original values somewhere, and restore them
-// before it returns. In contrast, the callee is free to trash
-// caller-saves registers; if the callee uses these, it will
-// probably not bother to save them anywhere, and the CFI will
-// probably mark their values as "unrecoverable".
-//
-// (However, since the caller cannot assume the callee was going to
-// save them, caller-saves registers are probably dead in the caller
-// anyway, so compilers usually don't generate CFA for caller-saves
-// registers.)
-//
-// - Exactly where the CFA points is a matter of convention that
-// depends on the architecture and ABI in use. In the example, the
-// CFA is the value the stack pointer had upon entry to the
-// function, pointing at the saved return address. But on the x86,
-// the call frame information generated by GCC follows the
-// convention that the CFA is the address *after* the saved return
-// address.
-//
-// But by definition, the CFA remains constant throughout the
-// lifetime of the frame. This makes it a useful value for other
-// columns to refer to. It is also gives debuggers a useful handle
-// for identifying a frame.
-//
-// If you look at the table above, you'll notice that a given entry is
-// often the same as the one immediately above it: most instructions
-// change only one or two aspects of the stack frame, if they affect
-// it at all. The DWARF format takes advantage of this fact, and
-// reduces the size of the data by mentioning only the addresses and
-// columns at which changes take place. So for the above, DWARF CFI
-// data would only actually mention the following:
-//
-// insn cfa r0 r1 ... ra
-// =======================================
-// func+0: sp cfa[0]
-// func+1: sp+16
-// func+2: cfa[-4]
-// func+11: sp+20
-// func+21: r0
-// func+22: sp
-//
-// In fact, this is the way the parser reports CFI to the consumer: as
-// a series of statements of the form, "At address X, column Y changed
-// to Z," and related conventions for describing the initial state.
-//
-// Naturally, it would be impractical to have to scan the entire
-// program's CFI, noting changes as we go, just to recover the
-// unwinding rules in effect at one particular instruction. To avoid
-// this, CFI data is grouped into "entries", each of which covers a
-// specified range of addresses and begins with a complete statement
-// of the rules for all recoverable registers at that starting
-// address. Each entry typically covers a single function.
-//
-// Thus, to compute the contents of a given row of the table --- that
-// is, rules for recovering the CFA, RA, and registers at a given
-// instruction --- the consumer should find the entry that covers that
-// instruction's address, start with the initial state supplied at the
-// beginning of the entry, and work forward until it has processed all
-// the changes up to and including those for the present instruction.
-//
-// There are seven kinds of rules that can appear in an entry of the
-// table:
-//
-// - "undefined": The given register is not preserved by the callee;
-// its value cannot be recovered.
-//
-// - "same value": This register has the same value it did in the callee.
-//
-// - offset(N): The register is saved at offset N from the CFA.
-//
-// - val_offset(N): The value the register had in the caller is the
-// CFA plus offset N. (This is usually only useful for describing
-// the stack pointer.)
-//
-// - register(R): The register's value was saved in another register R.
-//
-// - expression(E): Evaluating the DWARF expression E using the
-// current frame's registers' values yields the address at which the
-// register was saved.
-//
-// - val_expression(E): Evaluating the DWARF expression E using the
-// current frame's registers' values yields the value the register
-// had in the caller.
-
-class CallFrameInfo {
- public:
- // The different kinds of entries one finds in CFI. Used internally,
- // and for error reporting.
- enum EntryKind { kUnknown, kCIE, kFDE, kTerminator };
-
- // The handler class to which the parser hands the parsed call frame
- // information. Defined below.
- class Handler;
-
- // A reporter class, which CallFrameInfo uses to report errors
- // encountered while parsing call frame information. Defined below.
- class Reporter;
-
- // Create a DWARF CFI parser. BUFFER points to the contents of the
- // .debug_frame section to parse; BUFFER_LENGTH is its length in bytes.
- // REPORTER is an error reporter the parser should use to report
- // problems. READER is a ByteReader instance that has the endianness and
- // address size set properly. Report the data we find to HANDLER.
- //
- // This class can also parse Linux C++ exception handling data, as found
- // in '.eh_frame' sections. This data is a variant of DWARF CFI that is
- // placed in loadable segments so that it is present in the program's
- // address space, and is interpreted by the C++ runtime to search the
- // call stack for a handler interested in the exception being thrown,
- // actually pop the frames, and find cleanup code to run.
- //
- // There are two differences between the call frame information described
- // in the DWARF standard and the exception handling data Linux places in
- // the .eh_frame section:
- //
- // - Exception handling data uses uses a different format for call frame
- // information entry headers. The distinguished CIE id, the way FDEs
- // refer to their CIEs, and the way the end of the series of entries is
- // determined are all slightly different.
- //
- // If the constructor's EH_FRAME argument is true, then the
- // CallFrameInfo parses the entry headers as Linux C++ exception
- // handling data. If EH_FRAME is false or omitted, the CallFrameInfo
- // parses standard DWARF call frame information.
- //
- // - Linux C++ exception handling data uses CIE augmentation strings
- // beginning with 'z' to specify the presence of additional data after
- // the CIE and FDE headers and special encodings used for addresses in
- // frame description entries.
- //
- // CallFrameInfo can handle 'z' augmentations in either DWARF CFI or
- // exception handling data if you have supplied READER with the base
- // addresses needed to interpret the pointer encodings that 'z'
- // augmentations can specify. See the ByteReader interface for details
- // about the base addresses. See the CallFrameInfo::Handler interface
- // for details about the additional information one might find in
- // 'z'-augmented data.
- //
- // Thus:
- //
- // - If you are parsing standard DWARF CFI, as found in a .debug_frame
- // section, you should pass false for the EH_FRAME argument, or omit
- // it, and you need not worry about providing READER with the
- // additional base addresses.
- //
- // - If you want to parse Linux C++ exception handling data from a
- // .eh_frame section, you should pass EH_FRAME as true, and call
- // READER's Set*Base member functions before calling our Start method.
- //
- // - If you want to parse DWARF CFI that uses the 'z' augmentations
- // (although I don't think any toolchain ever emits such data), you
- // could pass false for EH_FRAME, but call READER's Set*Base members.
- //
- // The extensions the Linux C++ ABI makes to DWARF for exception
- // handling are described here, rather poorly:
- // http://refspecs.linux-foundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/dwarfext.html
- // http://refspecs.linux-foundation.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
- //
- // The mechanics of C++ exception handling, personality routines,
- // and language-specific data areas are described here, rather nicely:
- // http://www.codesourcery.com/public/cxx-abi/abi-eh.html
- CallFrameInfo(const uint8_t *buffer, size_t buffer_length,
- ByteReader *reader, Handler *handler, Reporter *reporter,
- bool eh_frame = false)
- : buffer_(buffer), buffer_length_(buffer_length),
- reader_(reader), handler_(handler), reporter_(reporter),
- eh_frame_(eh_frame) { }
-
- ~CallFrameInfo() { }
-
- // Parse the entries in BUFFER, reporting what we find to HANDLER.
- // Return true if we reach the end of the section successfully, or
- // false if we encounter an error.
- bool Start();
-
- // Return the textual name of KIND. For error reporting.
- static const char *KindName(EntryKind kind);
-
- private:
-
- struct CIE;
-
- // A CFI entry, either an FDE or a CIE.
- struct Entry {
- // The starting offset of the entry in the section, for error
- // reporting.
- size_t offset;
-
- // The start of this entry in the buffer.
- const uint8_t *start;
-
- // Which kind of entry this is.
- //
- // We want to be able to use this for error reporting even while we're
- // in the midst of parsing. Error reporting code may assume that kind,
- // offset, and start fields are valid, although kind may be kUnknown.
- EntryKind kind;
-
- // The end of this entry's common prologue (initial length and id), and
- // the start of this entry's kind-specific fields.
- const uint8_t *fields;
-
- // The start of this entry's instructions.
- const uint8_t *instructions;
-
- // The address past the entry's last byte in the buffer. (Note that
- // since offset points to the entry's initial length field, and the
- // length field is the number of bytes after that field, this is not
- // simply buffer_ + offset + length.)
- const uint8_t *end;
-
- // For both DWARF CFI and .eh_frame sections, this is the CIE id in a
- // CIE, and the offset of the associated CIE in an FDE.
- uint64 id;
-
- // The CIE that applies to this entry, if we've parsed it. If this is a
- // CIE, then this field points to this structure.
- CIE *cie;
- };
-
- // A common information entry (CIE).
- struct CIE: public Entry {
- uint8 version; // CFI data version number
- string augmentation; // vendor format extension markers
- uint64 code_alignment_factor; // scale for code address adjustments
- int data_alignment_factor; // scale for stack pointer adjustments
- unsigned return_address_register; // which register holds the return addr
-
- // True if this CIE includes Linux C++ ABI 'z' augmentation data.
- bool has_z_augmentation;
-
- // Parsed 'z' augmentation data. These are meaningful only if
- // has_z_augmentation is true.
- bool has_z_lsda; // The 'z' augmentation included 'L'.
- bool has_z_personality; // The 'z' augmentation included 'P'.
- bool has_z_signal_frame; // The 'z' augmentation included 'S'.
-
- // If has_z_lsda is true, this is the encoding to be used for language-
- // specific data area pointers in FDEs.
- DwarfPointerEncoding lsda_encoding;
-
- // If has_z_personality is true, this is the encoding used for the
- // personality routine pointer in the augmentation data.
- DwarfPointerEncoding personality_encoding;
-
- // If has_z_personality is true, this is the address of the personality
- // routine --- or, if personality_encoding & DW_EH_PE_indirect, the
- // address where the personality routine's address is stored.
- uint64 personality_address;
-
- // This is the encoding used for addresses in the FDE header and
- // in DW_CFA_set_loc instructions. This is always valid, whether
- // or not we saw a 'z' augmentation string; its default value is
- // DW_EH_PE_absptr, which is what normal DWARF CFI uses.
- DwarfPointerEncoding pointer_encoding;
- };
-
- // A frame description entry (FDE).
- struct FDE: public Entry {
- uint64 address; // start address of described code
- uint64 size; // size of described code, in bytes
-
- // If cie->has_z_lsda is true, then this is the language-specific data
- // area's address --- or its address's address, if cie->lsda_encoding
- // has the DW_EH_PE_indirect bit set.
- uint64 lsda_address;
- };
-
- // Internal use.
- class Rule;
- class UndefinedRule;
- class SameValueRule;
- class OffsetRule;
- class ValOffsetRule;
- class RegisterRule;
- class ExpressionRule;
- class ValExpressionRule;
- class RuleMap;
- class State;
-
- // Parse the initial length and id of a CFI entry, either a CIE, an FDE,
- // or a .eh_frame end-of-data mark. CURSOR points to the beginning of the
- // data to parse. On success, populate ENTRY as appropriate, and return
- // true. On failure, report the problem, and return false. Even if we
- // return false, set ENTRY->end to the first byte after the entry if we
- // were able to figure that out, or NULL if we weren't.
- bool ReadEntryPrologue(const uint8_t *cursor, Entry *entry);
-
- // Parse the fields of a CIE after the entry prologue, including any 'z'
- // augmentation data. Assume that the 'Entry' fields of CIE are
- // populated; use CIE->fields and CIE->end as the start and limit for
- // parsing. On success, populate the rest of *CIE, and return true; on
- // failure, report the problem and return false.
- bool ReadCIEFields(CIE *cie);
-
- // Parse the fields of an FDE after the entry prologue, including any 'z'
- // augmentation data. Assume that the 'Entry' fields of *FDE are
- // initialized; use FDE->fields and FDE->end as the start and limit for
- // parsing. Assume that FDE->cie is fully initialized. On success,
- // populate the rest of *FDE, and return true; on failure, report the
- // problem and return false.
- bool ReadFDEFields(FDE *fde);
-
- // Report that ENTRY is incomplete, and return false. This is just a
- // trivial wrapper for invoking reporter_->Incomplete; it provides a
- // little brevity.
- bool ReportIncomplete(Entry *entry);
-
- // Return true if ENCODING has the DW_EH_PE_indirect bit set.
- static bool IsIndirectEncoding(DwarfPointerEncoding encoding) {
- return encoding & DW_EH_PE_indirect;
- }
-
- // The contents of the DWARF .debug_info section we're parsing.
- const uint8_t *buffer_;
- size_t buffer_length_;
-
- // For reading multi-byte values with the appropriate endianness.
- ByteReader *reader_;
-
- // The handler to which we should report the data we find.
- Handler *handler_;
-
- // For reporting problems in the info we're parsing.
- Reporter *reporter_;
-
- // True if we are processing .eh_frame-format data.
- bool eh_frame_;
-};
-
-// The handler class for CallFrameInfo. The a CFI parser calls the
-// member functions of a handler object to report the data it finds.
-class CallFrameInfo::Handler {
- public:
- // The pseudo-register number for the canonical frame address.
- enum { kCFARegister = -1 };
-
- Handler() { }
- virtual ~Handler() { }
-
- // The parser has found CFI for the machine code at ADDRESS,
- // extending for LENGTH bytes. OFFSET is the offset of the frame
- // description entry in the section, for use in error messages.
- // VERSION is the version number of the CFI format. AUGMENTATION is
- // a string describing any producer-specific extensions present in
- // the data. RETURN_ADDRESS is the number of the register that holds
- // the address to which the function should return.
- //
- // Entry should return true to process this CFI, or false to skip to
- // the next entry.
- //
- // The parser invokes Entry for each Frame Description Entry (FDE)
- // it finds. The parser doesn't report Common Information Entries
- // to the handler explicitly; instead, if the handler elects to
- // process a given FDE, the parser reiterates the appropriate CIE's
- // contents at the beginning of the FDE's rules.
- virtual bool Entry(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
- unsigned return_address) = 0;
-
- // When the Entry function returns true, the parser calls these
- // handler functions repeatedly to describe the rules for recovering
- // registers at each instruction in the given range of machine code.
- // Immediately after a call to Entry, the handler should assume that
- // the rule for each callee-saves register is "unchanged" --- that
- // is, that the register still has the value it had in the caller.
- //
- // If a *Rule function returns true, we continue processing this entry's
- // instructions. If a *Rule function returns false, we stop evaluating
- // instructions, and skip to the next entry. Either way, we call End
- // before going on to the next entry.
- //
- // In all of these functions, if the REG parameter is kCFARegister, then
- // the rule describes how to find the canonical frame address.
- // kCFARegister may be passed as a BASE_REGISTER argument, meaning that
- // the canonical frame address should be used as the base address for the
- // computation. All other REG values will be positive.
-
- // At ADDRESS, register REG's value is not recoverable.
- virtual bool UndefinedRule(uint64 address, int reg) = 0;
-
- // At ADDRESS, register REG's value is the same as that it had in
- // the caller.
- virtual bool SameValueRule(uint64 address, int reg) = 0;
-
- // At ADDRESS, register REG has been saved at offset OFFSET from
- // BASE_REGISTER.
- virtual bool OffsetRule(uint64 address, int reg,
- int base_register, long offset) = 0;
-
- // At ADDRESS, the caller's value of register REG is the current
- // value of BASE_REGISTER plus OFFSET. (This rule doesn't provide an
- // address at which the register's value is saved.)
- virtual bool ValOffsetRule(uint64 address, int reg,
- int base_register, long offset) = 0;
-
- // At ADDRESS, register REG has been saved in BASE_REGISTER. This differs
- // from ValOffsetRule(ADDRESS, REG, BASE_REGISTER, 0), in that
- // BASE_REGISTER is the "home" for REG's saved value: if you want to
- // assign to a variable whose home is REG in the calling frame, you
- // should put the value in BASE_REGISTER.
- virtual bool RegisterRule(uint64 address, int reg, int base_register) = 0;
-
- // At ADDRESS, the DWARF expression EXPRESSION yields the address at
- // which REG was saved.
- virtual bool ExpressionRule(uint64 address, int reg,
- const string &expression) = 0;
-
- // At ADDRESS, the DWARF expression EXPRESSION yields the caller's
- // value for REG. (This rule doesn't provide an address at which the
- // register's value is saved.)
- virtual bool ValExpressionRule(uint64 address, int reg,
- const string &expression) = 0;
-
- // Indicate that the rules for the address range reported by the
- // last call to Entry are complete. End should return true if
- // everything is okay, or false if an error has occurred and parsing
- // should stop.
- virtual bool End() = 0;
-
- // Handler functions for Linux C++ exception handling data. These are
- // only called if the data includes 'z' augmentation strings.
-
- // The Linux C++ ABI uses an extension of the DWARF CFI format to
- // walk the stack to propagate exceptions from the throw to the
- // appropriate catch, and do the appropriate cleanups along the way.
- // CFI entries used for exception handling have two additional data
- // associated with them:
- //
- // - The "language-specific data area" describes which exception
- // types the function has 'catch' clauses for, and indicates how
- // to go about re-entering the function at the appropriate catch
- // clause. If the exception is not caught, it describes the
- // destructors that must run before the frame is popped.
- //
- // - The "personality routine" is responsible for interpreting the
- // language-specific data area's contents, and deciding whether
- // the exception should continue to propagate down the stack,
- // perhaps after doing some cleanup for this frame, or whether the
- // exception will be caught here.
- //
- // In principle, the language-specific data area is opaque to
- // everybody but the personality routine. In practice, these values
- // may be useful or interesting to readers with extra context, and
- // we have to at least skip them anyway, so we might as well report
- // them to the handler.
-
- // This entry's exception handling personality routine's address is
- // ADDRESS. If INDIRECT is true, then ADDRESS is the address at
- // which the routine's address is stored. The default definition for
- // this handler function simply returns true, allowing parsing of
- // the entry to continue.
- virtual bool PersonalityRoutine(uint64 address, bool indirect) {
- return true;
- }
-
- // This entry's language-specific data area (LSDA) is located at
- // ADDRESS. If INDIRECT is true, then ADDRESS is the address at
- // which the area's address is stored. The default definition for
- // this handler function simply returns true, allowing parsing of
- // the entry to continue.
- virtual bool LanguageSpecificDataArea(uint64 address, bool indirect) {
- return true;
- }
-
- // This entry describes a signal trampoline --- this frame is the
- // caller of a signal handler. The default definition for this
- // handler function simply returns true, allowing parsing of the
- // entry to continue.
- //
- // The best description of the rationale for and meaning of signal
- // trampoline CFI entries seems to be in the GCC bug database:
- // http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26208
- virtual bool SignalHandler() { return true; }
-};
-
-// The CallFrameInfo class makes calls on an instance of this class to
-// report errors or warn about problems in the data it is parsing. The
-// default definitions of these methods print a message to stderr, but
-// you can make a derived class that overrides them.
-class CallFrameInfo::Reporter {
- public:
- // Create an error reporter which attributes troubles to the section
- // named SECTION in FILENAME.
- //
- // Normally SECTION would be .debug_frame, but the Mac puts CFI data
- // in a Mach-O section named __debug_frame. If we support
- // Linux-style exception handling data, we could be reading an
- // .eh_frame section.
- Reporter(const string &filename,
- const string &section = ".debug_frame")
- : filename_(filename), section_(section) { }
- virtual ~Reporter() { }
-
- // The CFI entry at OFFSET ends too early to be well-formed. KIND
- // indicates what kind of entry it is; KIND can be kUnknown if we
- // haven't parsed enough of the entry to tell yet.
- virtual void Incomplete(uint64 offset, CallFrameInfo::EntryKind kind);
-
- // The .eh_frame data has a four-byte zero at OFFSET where the next
- // entry's length would be; this is a terminator. However, the buffer
- // length as given to the CallFrameInfo constructor says there should be
- // more data.
- virtual void EarlyEHTerminator(uint64 offset);
-
- // The FDE at OFFSET refers to the CIE at CIE_OFFSET, but the
- // section is not that large.
- virtual void CIEPointerOutOfRange(uint64 offset, uint64 cie_offset);
-
- // The FDE at OFFSET refers to the CIE at CIE_OFFSET, but the entry
- // there is not a CIE.
- virtual void BadCIEId(uint64 offset, uint64 cie_offset);
-
- // The FDE at OFFSET refers to a CIE with version number VERSION,
- // which we don't recognize. We cannot parse DWARF CFI if it uses
- // a version number we don't recognize.
- virtual void UnrecognizedVersion(uint64 offset, int version);
-
- // The FDE at OFFSET refers to a CIE with augmentation AUGMENTATION,
- // which we don't recognize. We cannot parse DWARF CFI if it uses
- // augmentations we don't recognize.
- virtual void UnrecognizedAugmentation(uint64 offset,
- const string &augmentation);
-
- // The pointer encoding ENCODING, specified by the CIE at OFFSET, is not
- // a valid encoding.
- virtual void InvalidPointerEncoding(uint64 offset, uint8 encoding);
-
- // The pointer encoding ENCODING, specified by the CIE at OFFSET, depends
- // on a base address which has not been supplied.
- virtual void UnusablePointerEncoding(uint64 offset, uint8 encoding);
-
- // The CIE at OFFSET contains a DW_CFA_restore instruction at
- // INSN_OFFSET, which may not appear in a CIE.
- virtual void RestoreInCIE(uint64 offset, uint64 insn_offset);
-
- // The entry at OFFSET, of kind KIND, has an unrecognized
- // instruction at INSN_OFFSET.
- virtual void BadInstruction(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
-
- // The instruction at INSN_OFFSET in the entry at OFFSET, of kind
- // KIND, establishes a rule that cites the CFA, but we have not
- // established a CFA rule yet.
- virtual void NoCFARule(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
-
- // The instruction at INSN_OFFSET in the entry at OFFSET, of kind
- // KIND, is a DW_CFA_restore_state instruction, but the stack of
- // saved states is empty.
- virtual void EmptyStateStack(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
-
- // The DW_CFA_remember_state instruction at INSN_OFFSET in the entry
- // at OFFSET, of kind KIND, would restore a state that has no CFA
- // rule, whereas the current state does have a CFA rule. This is
- // bogus input, which the CallFrameInfo::Handler interface doesn't
- // (and shouldn't) have any way to report.
- virtual void ClearingCFARule(uint64 offset, CallFrameInfo::EntryKind kind,
- uint64 insn_offset);
-
- protected:
- // The name of the file whose CFI we're reading.
- string filename_;
-
- // The name of the CFI section in that file.
- string section_;
-};
-
-} // namespace dwarf2reader
-
-#endif // UTIL_DEBUGINFO_DWARF2READER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc
deleted file mode 100644
index e50ea5fbd3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_cfi_unittest.cc
+++ /dev/null
@@ -1,2468 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf2reader_cfi_unittest.cc: Unit tests for dwarf2reader::CallFrameInfo
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <string>
-#include <vector>
-
-// The '.eh_frame' format, used by the Linux C++ ABI for exception
-// handling, is poorly specified. To help test our support for .eh_frame,
-// if you #define WRITE_ELF while compiling this file, and add the
-// 'include' directory from the binutils, gcc, or gdb source tree to the
-// #include path, then each test that calls the
-// PERHAPS_WRITE_DEBUG_FRAME_FILE or PERHAPS_WRITE_EH_FRAME_FILE will write
-// an ELF file containing a .debug_frame or .eh_frame section; you can then
-// use tools like readelf to examine the test data, and check the tools'
-// interpretation against the test's intentions. Each ELF file is named
-// "cfitest-TEST", where TEST identifies the particular test.
-#ifdef WRITE_ELF
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-extern "C" {
-// To compile with WRITE_ELF, you should add the 'include' directory
-// of the binutils, gcc, or gdb source tree to your #include path;
-// that directory contains this header.
-#include "elf/common.h"
-}
-#endif
-
-#include "breakpad_googletest_includes.h"
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/cfi_assembler.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-using google_breakpad::CFISection;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Section;
-
-using dwarf2reader::DwarfPointerEncoding;
-using dwarf2reader::ENDIANNESS_BIG;
-using dwarf2reader::ENDIANNESS_LITTLE;
-using dwarf2reader::ByteReader;
-using dwarf2reader::CallFrameInfo;
-
-using std::vector;
-using testing::InSequence;
-using testing::Return;
-using testing::Sequence;
-using testing::Test;
-using testing::_;
-
-#ifdef WRITE_ELF
-void WriteELFFrameSection(const char *filename, const char *section_name,
- const CFISection &section);
-#define PERHAPS_WRITE_DEBUG_FRAME_FILE(name, section) \
- WriteELFFrameSection("cfitest-" name, ".debug_frame", section);
-#define PERHAPS_WRITE_EH_FRAME_FILE(name, section) \
- WriteELFFrameSection("cfitest-" name, ".eh_frame", section);
-#else
-#define PERHAPS_WRITE_DEBUG_FRAME_FILE(name, section)
-#define PERHAPS_WRITE_EH_FRAME_FILE(name, section)
-#endif
-
-class MockCallFrameInfoHandler: public CallFrameInfo::Handler {
- public:
- MOCK_METHOD6(Entry, bool(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
- unsigned return_address));
- MOCK_METHOD2(UndefinedRule, bool(uint64 address, int reg));
- MOCK_METHOD2(SameValueRule, bool(uint64 address, int reg));
- MOCK_METHOD4(OffsetRule, bool(uint64 address, int reg, int base_register,
- long offset));
- MOCK_METHOD4(ValOffsetRule, bool(uint64 address, int reg, int base_register,
- long offset));
- MOCK_METHOD3(RegisterRule, bool(uint64 address, int reg, int base_register));
- MOCK_METHOD3(ExpressionRule, bool(uint64 address, int reg,
- const string &expression));
- MOCK_METHOD3(ValExpressionRule, bool(uint64 address, int reg,
- const string &expression));
- MOCK_METHOD0(End, bool());
- MOCK_METHOD2(PersonalityRoutine, bool(uint64 address, bool indirect));
- MOCK_METHOD2(LanguageSpecificDataArea, bool(uint64 address, bool indirect));
- MOCK_METHOD0(SignalHandler, bool());
-};
-
-class MockCallFrameErrorReporter: public CallFrameInfo::Reporter {
- public:
- MockCallFrameErrorReporter() : Reporter("mock filename", "mock section") { }
- MOCK_METHOD2(Incomplete, void(uint64, CallFrameInfo::EntryKind));
- MOCK_METHOD1(EarlyEHTerminator, void(uint64));
- MOCK_METHOD2(CIEPointerOutOfRange, void(uint64, uint64));
- MOCK_METHOD2(BadCIEId, void(uint64, uint64));
- MOCK_METHOD2(UnrecognizedVersion, void(uint64, int version));
- MOCK_METHOD2(UnrecognizedAugmentation, void(uint64, const string &));
- MOCK_METHOD2(InvalidPointerEncoding, void(uint64, uint8));
- MOCK_METHOD2(UnusablePointerEncoding, void(uint64, uint8));
- MOCK_METHOD2(RestoreInCIE, void(uint64, uint64));
- MOCK_METHOD3(BadInstruction, void(uint64, CallFrameInfo::EntryKind, uint64));
- MOCK_METHOD3(NoCFARule, void(uint64, CallFrameInfo::EntryKind, uint64));
- MOCK_METHOD3(EmptyStateStack, void(uint64, CallFrameInfo::EntryKind, uint64));
-};
-
-struct CFIFixture {
-
- enum { kCFARegister = CallFrameInfo::Handler::kCFARegister };
-
- CFIFixture() {
- // Default expectations for the data handler.
- //
- // - Leave Entry and End without expectations, as it's probably a
- // good idea to set those explicitly in each test.
- //
- // - Expect the *Rule functions to not be called,
- // so that each test can simply list the calls they expect.
- //
- // I gather I could use StrictMock for this, but the manual seems
- // to suggest using that only as a last resort, and this isn't so
- // bad.
- EXPECT_CALL(handler, UndefinedRule(_, _)).Times(0);
- EXPECT_CALL(handler, SameValueRule(_, _)).Times(0);
- EXPECT_CALL(handler, OffsetRule(_, _, _, _)).Times(0);
- EXPECT_CALL(handler, ValOffsetRule(_, _, _, _)).Times(0);
- EXPECT_CALL(handler, RegisterRule(_, _, _)).Times(0);
- EXPECT_CALL(handler, ExpressionRule(_, _, _)).Times(0);
- EXPECT_CALL(handler, ValExpressionRule(_, _, _)).Times(0);
- EXPECT_CALL(handler, PersonalityRoutine(_, _)).Times(0);
- EXPECT_CALL(handler, LanguageSpecificDataArea(_, _)).Times(0);
- EXPECT_CALL(handler, SignalHandler()).Times(0);
-
- // Default expectations for the error/warning reporer.
- EXPECT_CALL(reporter, Incomplete(_, _)).Times(0);
- EXPECT_CALL(reporter, EarlyEHTerminator(_)).Times(0);
- EXPECT_CALL(reporter, CIEPointerOutOfRange(_, _)).Times(0);
- EXPECT_CALL(reporter, BadCIEId(_, _)).Times(0);
- EXPECT_CALL(reporter, UnrecognizedVersion(_, _)).Times(0);
- EXPECT_CALL(reporter, UnrecognizedAugmentation(_, _)).Times(0);
- EXPECT_CALL(reporter, InvalidPointerEncoding(_, _)).Times(0);
- EXPECT_CALL(reporter, UnusablePointerEncoding(_, _)).Times(0);
- EXPECT_CALL(reporter, RestoreInCIE(_, _)).Times(0);
- EXPECT_CALL(reporter, BadInstruction(_, _, _)).Times(0);
- EXPECT_CALL(reporter, NoCFARule(_, _, _)).Times(0);
- EXPECT_CALL(reporter, EmptyStateStack(_, _, _)).Times(0);
- }
-
- MockCallFrameInfoHandler handler;
- MockCallFrameErrorReporter reporter;
-};
-
-class CFI: public CFIFixture, public Test { };
-
-TEST_F(CFI, EmptyRegion) {
- EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, End()).Times(0);
- static const uint8_t data[] = { 42 };
-
- ByteReader byte_reader(ENDIANNESS_BIG);
- CallFrameInfo parser(data, 0, &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-TEST_F(CFI, IncompleteLength32) {
- CFISection section(kBigEndian, 8);
- section
- // Not even long enough for an initial length.
- .D16(0xa0f)
- // Padding to keep valgrind happy. We subtract these off when we
- // construct the parser.
- .D16(0);
-
- EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, End()).Times(0);
-
- EXPECT_CALL(reporter, Incomplete(_, CallFrameInfo::kUnknown))
- .WillOnce(Return());
-
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
-
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size() - 2,
- &byte_reader, &handler, &reporter);
- EXPECT_FALSE(parser.Start());
-}
-
-TEST_F(CFI, IncompleteLength64) {
- CFISection section(kLittleEndian, 4);
- section
- // An incomplete 64-bit DWARF initial length.
- .D32(0xffffffff).D32(0x71fbaec2)
- // Padding to keep valgrind happy. We subtract these off when we
- // construct the parser.
- .D32(0);
-
- EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, End()).Times(0);
-
- EXPECT_CALL(reporter, Incomplete(_, CallFrameInfo::kUnknown))
- .WillOnce(Return());
-
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
-
- ByteReader byte_reader(ENDIANNESS_LITTLE);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size() - 4,
- &byte_reader, &handler, &reporter);
- EXPECT_FALSE(parser.Start());
-}
-
-TEST_F(CFI, IncompleteId32) {
- CFISection section(kBigEndian, 8);
- section
- .D32(3) // Initial length, not long enough for id
- .D8(0xd7).D8(0xe5).D8(0xf1) // incomplete id
- .CIEHeader(8727, 3983, 8889, 3, "")
- .FinishEntry();
-
- EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, End()).Times(0);
-
- EXPECT_CALL(reporter, Incomplete(_, CallFrameInfo::kUnknown))
- .WillOnce(Return());
-
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
-
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_FALSE(parser.Start());
-}
-
-TEST_F(CFI, BadId32) {
- CFISection section(kBigEndian, 8);
- section
- .D32(0x100) // Initial length
- .D32(0xe802fade) // bogus ID
- .Append(0x100 - 4, 0x42); // make the length true
- section
- .CIEHeader(1672, 9872, 8529, 3, "")
- .FinishEntry();
-
- EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, End()).Times(0);
-
- EXPECT_CALL(reporter, CIEPointerOutOfRange(_, 0xe802fade))
- .WillOnce(Return());
-
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
-
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_FALSE(parser.Start());
-}
-
-// A lone CIE shouldn't cause any handler calls.
-TEST_F(CFI, SingleCIE) {
- CFISection section(kLittleEndian, 4);
- section.CIEHeader(0xffe799a8, 0x3398dcdd, 0x6e9683de, 3, "");
- section.Append(10, dwarf2reader::DW_CFA_nop);
- section.FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("SingleCIE", section);
-
- EXPECT_CALL(handler, Entry(_, _, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, End()).Times(0);
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_LITTLE);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-// One FDE, one CIE.
-TEST_F(CFI, OneFDE) {
- CFISection section(kBigEndian, 4);
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(0x4be22f75, 0x2492236e, 0x6b6efb87, 3, "")
- .FinishEntry()
- .FDEHeader(cie, 0x7714740d, 0x3d5a10cd)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("OneFDE", section);
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, 0x7714740d, 0x3d5a10cd, 3, "", 0x6b6efb87))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-// Two FDEs share a CIE.
-TEST_F(CFI, TwoFDEsOneCIE) {
- CFISection section(kBigEndian, 4);
- Label cie;
- section
- // First FDE. readelf complains about this one because it makes
- // a forward reference to its CIE.
- .FDEHeader(cie, 0xa42744df, 0xa3b42121)
- .FinishEntry()
- // CIE.
- .Mark(&cie)
- .CIEHeader(0x04f7dc7b, 0x3d00c05f, 0xbd43cb59, 3, "")
- .FinishEntry()
- // Second FDE.
- .FDEHeader(cie, 0x6057d391, 0x700f608d)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("TwoFDEsOneCIE", section);
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, 0xa42744df, 0xa3b42121, 3, "", 0xbd43cb59))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, 0x6057d391, 0x700f608d, 3, "", 0xbd43cb59))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-// Two FDEs, two CIEs.
-TEST_F(CFI, TwoFDEsTwoCIEs) {
- CFISection section(kLittleEndian, 8);
- Label cie1, cie2;
- section
- // First CIE.
- .Mark(&cie1)
- .CIEHeader(0x694d5d45, 0x4233221b, 0xbf45e65a, 3, "")
- .FinishEntry()
- // First FDE which cites second CIE. readelf complains about
- // this one because it makes a forward reference to its CIE.
- .FDEHeader(cie2, 0x778b27dfe5871f05ULL, 0x324ace3448070926ULL)
- .FinishEntry()
- // Second FDE, which cites first CIE.
- .FDEHeader(cie1, 0xf6054ca18b10bf5fULL, 0x45fdb970d8bca342ULL)
- .FinishEntry()
- // Second CIE.
- .Mark(&cie2)
- .CIEHeader(0xfba3fad7, 0x6287e1fd, 0x61d2c581, 2, "")
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("TwoFDEsTwoCIEs", section);
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, 0x778b27dfe5871f05ULL, 0x324ace3448070926ULL, 2,
- "", 0x61d2c581))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, 0xf6054ca18b10bf5fULL, 0x45fdb970d8bca342ULL, 3,
- "", 0xbf45e65a))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_LITTLE);
- byte_reader.SetAddressSize(8);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-// An FDE whose CIE specifies a version we don't recognize.
-TEST_F(CFI, BadVersion) {
- CFISection section(kBigEndian, 4);
- Label cie1, cie2;
- section
- .Mark(&cie1)
- .CIEHeader(0xca878cf0, 0x7698ec04, 0x7b616f54, 0x52, "")
- .FinishEntry()
- // We should skip this entry, as its CIE specifies a version we
- // don't recognize.
- .FDEHeader(cie1, 0x08852292, 0x2204004a)
- .FinishEntry()
- // Despite the above, we should visit this entry.
- .Mark(&cie2)
- .CIEHeader(0x7c3ae7c9, 0xb9b9a512, 0x96cb3264, 3, "")
- .FinishEntry()
- .FDEHeader(cie2, 0x2094735a, 0x6e875501)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("BadVersion", section);
-
- EXPECT_CALL(reporter, UnrecognizedVersion(_, 0x52))
- .WillOnce(Return());
-
- {
- InSequence s;
- // We should see no mention of the first FDE, but we should get
- // a call to Entry for the second.
- EXPECT_CALL(handler, Entry(_, 0x2094735a, 0x6e875501, 3, "",
- 0x96cb3264))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_FALSE(parser.Start());
-}
-
-// An FDE whose CIE specifies an augmentation we don't recognize.
-TEST_F(CFI, BadAugmentation) {
- CFISection section(kBigEndian, 4);
- Label cie1, cie2;
- section
- .Mark(&cie1)
- .CIEHeader(0x4be22f75, 0x2492236e, 0x6b6efb87, 3, "spaniels!")
- .FinishEntry()
- // We should skip this entry, as its CIE specifies an
- // augmentation we don't recognize.
- .FDEHeader(cie1, 0x7714740d, 0x3d5a10cd)
- .FinishEntry()
- // Despite the above, we should visit this entry.
- .Mark(&cie2)
- .CIEHeader(0xf8bc4399, 0x8cf09931, 0xf2f519b2, 3, "")
- .FinishEntry()
- .FDEHeader(cie2, 0x7bf0fda0, 0xcbcd28d8)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("BadAugmentation", section);
-
- EXPECT_CALL(reporter, UnrecognizedAugmentation(_, "spaniels!"))
- .WillOnce(Return());
-
- {
- InSequence s;
- // We should see no mention of the first FDE, but we should get
- // a call to Entry for the second.
- EXPECT_CALL(handler, Entry(_, 0x7bf0fda0, 0xcbcd28d8, 3, "",
- 0xf2f519b2))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_FALSE(parser.Start());
-}
-
-// The return address column field is a byte in CFI version 1
-// (DWARF2), but a ULEB128 value in version 3 (DWARF3).
-TEST_F(CFI, CIEVersion1ReturnColumn) {
- CFISection section(kBigEndian, 4);
- Label cie;
- section
- // CIE, using the version 1 format: return column is a ubyte.
- .Mark(&cie)
- // Use a value for the return column that is parsed differently
- // as a ubyte and as a ULEB128.
- .CIEHeader(0xbcdea24f, 0x5be28286, 0x9f, 1, "")
- .FinishEntry()
- // FDE, citing that CIE.
- .FDEHeader(cie, 0xb8d347b5, 0x825e55dc)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("CIEVersion1ReturnColumn", section);
-
- {
- InSequence s;
- EXPECT_CALL(handler, Entry(_, 0xb8d347b5, 0x825e55dc, 1, "", 0x9f))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-// The return address column field is a byte in CFI version 1
-// (DWARF2), but a ULEB128 value in version 3 (DWARF3).
-TEST_F(CFI, CIEVersion3ReturnColumn) {
- CFISection section(kBigEndian, 4);
- Label cie;
- section
- // CIE, using the version 3 format: return column is a ULEB128.
- .Mark(&cie)
- // Use a value for the return column that is parsed differently
- // as a ubyte and as a ULEB128.
- .CIEHeader(0x0ab4758d, 0xc010fdf7, 0x89, 3, "")
- .FinishEntry()
- // FDE, citing that CIE.
- .FDEHeader(cie, 0x86763f2b, 0x2a66dc23)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("CIEVersion3ReturnColumn", section);
-
- {
- InSequence s;
- EXPECT_CALL(handler, Entry(_, 0x86763f2b, 0x2a66dc23, 3, "", 0x89))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- string contents;
- EXPECT_TRUE(section.GetContents(&contents));
- ByteReader byte_reader(ENDIANNESS_BIG);
- byte_reader.SetAddressSize(4);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- EXPECT_TRUE(parser.Start());
-}
-
-struct CFIInsnFixture: public CFIFixture {
- CFIInsnFixture() : CFIFixture() {
- data_factor = 0xb6f;
- return_register = 0x9be1ed9f;
- version = 3;
- cfa_base_register = 0x383a3aa;
- cfa_offset = 0xf748;
- }
-
- // Prepare SECTION to receive FDE instructions.
- //
- // - Append a stock CIE header that establishes the fixture's
- // code_factor, data_factor, return_register, version, and
- // augmentation values.
- // - Have the CIE set up a CFA rule using cfa_base_register and
- // cfa_offset.
- // - Append a stock FDE header, referring to the above CIE, for the
- // fde_size bytes at fde_start. Choose fde_start and fde_size
- // appropriately for the section's address size.
- // - Set appropriate expectations on handler in sequence s for the
- // frame description entry and the CIE's CFA rule.
- //
- // On return, SECTION is ready to have FDE instructions appended to
- // it, and its FinishEntry member called.
- void StockCIEAndFDE(CFISection *section) {
- // Choose appropriate constants for our address size.
- if (section->AddressSize() == 4) {
- fde_start = 0xc628ecfbU;
- fde_size = 0x5dee04a2;
- code_factor = 0x60b;
- } else {
- assert(section->AddressSize() == 8);
- fde_start = 0x0005c57ce7806bd3ULL;
- fde_size = 0x2699521b5e333100ULL;
- code_factor = 0x01008e32855274a8ULL;
- }
-
- // Create the CIE.
- (*section)
- .Mark(&cie_label)
- .CIEHeader(code_factor, data_factor, return_register, version,
- "")
- .D8(dwarf2reader::DW_CFA_def_cfa)
- .ULEB128(cfa_base_register)
- .ULEB128(cfa_offset)
- .FinishEntry();
-
- // Create the FDE.
- section->FDEHeader(cie_label, fde_start, fde_size);
-
- // Expect an Entry call for the FDE and a ValOffsetRule call for the
- // CIE's CFA rule.
- EXPECT_CALL(handler, Entry(_, fde_start, fde_size, version, "",
- return_register))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(fde_start, kCFARegister,
- cfa_base_register, cfa_offset))
- .InSequence(s)
- .WillOnce(Return(true));
- }
-
- // Run the contents of SECTION through a CallFrameInfo parser,
- // expecting parser.Start to return SUCCEEDS
- void ParseSection(CFISection *section, bool succeeds = true) {
- string contents;
- EXPECT_TRUE(section->GetContents(&contents));
- dwarf2reader::Endianness endianness;
- if (section->endianness() == kBigEndian)
- endianness = ENDIANNESS_BIG;
- else {
- assert(section->endianness() == kLittleEndian);
- endianness = ENDIANNESS_LITTLE;
- }
- ByteReader byte_reader(endianness);
- byte_reader.SetAddressSize(section->AddressSize());
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter);
- if (succeeds)
- EXPECT_TRUE(parser.Start());
- else
- EXPECT_FALSE(parser.Start());
- }
-
- Label cie_label;
- Sequence s;
- uint64 code_factor;
- int data_factor;
- unsigned return_register;
- unsigned version;
- unsigned cfa_base_register;
- int cfa_offset;
- uint64 fde_start, fde_size;
-};
-
-class CFIInsn: public CFIInsnFixture, public Test { };
-
-TEST_F(CFIInsn, DW_CFA_set_loc) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_set_loc).D32(0xb1ee3e7a)
- // Use DW_CFA_def_cfa to force a handler call that we can use to
- // check the effect of the DW_CFA_set_loc.
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x4defb431).ULEB128(0x6d17b0ee)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_set_loc", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule(0xb1ee3e7a, kCFARegister, 0x4defb431, 0x6d17b0ee))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_advance_loc) {
- CFISection section(kBigEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_advance_loc | 0x2a)
- // Use DW_CFA_def_cfa to force a handler call that we can use to
- // check the effect of the DW_CFA_advance_loc.
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x5bbb3715).ULEB128(0x0186c7bf)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_advance_loc", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start + 0x2a * code_factor,
- kCFARegister, 0x5bbb3715, 0x0186c7bf))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_advance_loc1) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_advance_loc1).D8(0xd8)
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x69d5696a).ULEB128(0x1eb7fc93)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_advance_loc1", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule((fde_start + 0xd8 * code_factor),
- kCFARegister, 0x69d5696a, 0x1eb7fc93))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_advance_loc2) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_advance_loc2).D16(0x3adb)
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x3a368bed).ULEB128(0x3194ee37)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_advance_loc2", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule((fde_start + 0x3adb * code_factor),
- kCFARegister, 0x3a368bed, 0x3194ee37))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_advance_loc4) {
- CFISection section(kBigEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_advance_loc4).D32(0x15813c88)
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x135270c5).ULEB128(0x24bad7cb)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_advance_loc4", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule((fde_start + 0x15813c88ULL * code_factor),
- kCFARegister, 0x135270c5, 0x24bad7cb))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_MIPS_advance_loc8) {
- code_factor = 0x2d;
- CFISection section(kBigEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_MIPS_advance_loc8).D64(0x3c4f3945b92c14ULL)
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0xe17ed602).ULEB128(0x3d162e7f)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_advance_loc8", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule((fde_start + 0x3c4f3945b92c14ULL * code_factor),
- kCFARegister, 0xe17ed602, 0x3d162e7f))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_def_cfa) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x4e363a85).ULEB128(0x815f9aa7)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("DW_CFA_def_cfa", section);
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x4e363a85, 0x815f9aa7))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_def_cfa_sf) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_sf).ULEB128(0x8ccb32b7).LEB128(0x9ea)
- .D8(dwarf2reader::DW_CFA_def_cfa_sf).ULEB128(0x9b40f5da).LEB128(-0x40a2)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x8ccb32b7,
- 0x9ea * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x9b40f5da,
- -0x40a2 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_def_cfa_register) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_register).ULEB128(0x3e7e9363)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x3e7e9363, cfa_offset))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-// DW_CFA_def_cfa_register should have no effect when applied to a
-// non-base/offset rule.
-TEST_F(CFIInsn, DW_CFA_def_cfa_registerBadRule) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_expression).Block("needle in a haystack")
- .D8(dwarf2reader::DW_CFA_def_cfa_register).ULEB128(0xf1b49e49)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValExpressionRule(fde_start, kCFARegister,
- "needle in a haystack"))
- .WillRepeatedly(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_def_cfa_offset) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_offset).ULEB128(0x1e8e3b9b)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, cfa_base_register,
- 0x1e8e3b9b))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_def_cfa_offset_sf) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_offset_sf).LEB128(0x970)
- .D8(dwarf2reader::DW_CFA_def_cfa_offset_sf).LEB128(-0x2cd)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, cfa_base_register,
- 0x970 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, cfa_base_register,
- -0x2cd * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-// DW_CFA_def_cfa_offset should have no effect when applied to a
-// non-base/offset rule.
-TEST_F(CFIInsn, DW_CFA_def_cfa_offsetBadRule) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_expression).Block("six ways to Sunday")
- .D8(dwarf2reader::DW_CFA_def_cfa_offset).ULEB128(0x1e8e3b9b)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValExpressionRule(fde_start, kCFARegister, "six ways to Sunday"))
- .WillRepeatedly(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_def_cfa_expression) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_def_cfa_expression).Block("eating crow")
- .FinishEntry();
-
- EXPECT_CALL(handler, ValExpressionRule(fde_start, kCFARegister,
- "eating crow"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_undefined) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0x300ce45d)
- .FinishEntry();
-
- EXPECT_CALL(handler, UndefinedRule(fde_start, 0x300ce45d))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_same_value) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_same_value).ULEB128(0x3865a760)
- .FinishEntry();
-
- EXPECT_CALL(handler, SameValueRule(fde_start, 0x3865a760))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_offset) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_offset | 0x2c).ULEB128(0x9f6)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x2c, kCFARegister, 0x9f6 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_offset_extended) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_offset_extended).ULEB128(0x402b).ULEB128(0xb48)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x402b, kCFARegister, 0xb48 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_offset_extended_sf) {
- CFISection section(kBigEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_offset_extended_sf)
- .ULEB128(0x997c23ee).LEB128(0x2d00)
- .D8(dwarf2reader::DW_CFA_offset_extended_sf)
- .ULEB128(0x9519eb82).LEB128(-0xa77)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x997c23ee,
- kCFARegister, 0x2d00 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x9519eb82,
- kCFARegister, -0xa77 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_val_offset) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_offset).ULEB128(0x623562fe).ULEB128(0x673)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, 0x623562fe,
- kCFARegister, 0x673 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_val_offset_sf) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_offset_sf).ULEB128(0x6f4f).LEB128(0xaab)
- .D8(dwarf2reader::DW_CFA_val_offset_sf).ULEB128(0x2483).LEB128(-0x8a2)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, 0x6f4f,
- kCFARegister, 0xaab * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, 0x2483,
- kCFARegister, -0x8a2 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_register) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0x278d18f9).ULEB128(0x1a684414)
- .FinishEntry();
-
- EXPECT_CALL(handler, RegisterRule(fde_start, 0x278d18f9, 0x1a684414))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_expression) {
- CFISection section(kBigEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_expression).ULEB128(0xa1619fb2)
- .Block("plus ça change, plus c'est la même chose")
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ExpressionRule(fde_start, 0xa1619fb2,
- "plus ça change, plus c'est la même chose"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_val_expression) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_expression).ULEB128(0xc5e4a9e3)
- .Block("he who has the gold makes the rules")
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValExpressionRule(fde_start, 0xc5e4a9e3,
- "he who has the gold makes the rules"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_restore) {
- CFISection section(kLittleEndian, 8);
- code_factor = 0x01bd188a9b1fa083ULL;
- data_factor = -0x1ac8;
- return_register = 0x8c35b049;
- version = 2;
- fde_start = 0x2d70fe998298bbb1ULL;
- fde_size = 0x46ccc2e63cf0b108ULL;
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(code_factor, data_factor, return_register, version,
- "")
- // Provide a CFA rule, because register rules require them.
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x6ca1d50e).ULEB128(0x372e38e8)
- // Provide an offset(N) rule for register 0x3c.
- .D8(dwarf2reader::DW_CFA_offset | 0x3c).ULEB128(0xb348)
- .FinishEntry()
- // In the FDE...
- .FDEHeader(cie, fde_start, fde_size)
- // At a second address, provide a new offset(N) rule for register 0x3c.
- .D8(dwarf2reader::DW_CFA_advance_loc | 0x13)
- .D8(dwarf2reader::DW_CFA_offset | 0x3c).ULEB128(0x9a50)
- // At a third address, restore the original rule for register 0x3c.
- .D8(dwarf2reader::DW_CFA_advance_loc | 0x01)
- .D8(dwarf2reader::DW_CFA_restore | 0x3c)
- .FinishEntry();
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, fde_start, fde_size, version, "", return_register))
- .WillOnce(Return(true));
- // CIE's CFA rule.
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x6ca1d50e, 0x372e38e8))
- .WillOnce(Return(true));
- // CIE's rule for register 0x3c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x3c, kCFARegister, 0xb348 * data_factor))
- .WillOnce(Return(true));
- // FDE's rule for register 0x3c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start + 0x13 * code_factor, 0x3c,
- kCFARegister, 0x9a50 * data_factor))
- .WillOnce(Return(true));
- // Restore CIE's rule for register 0x3c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start + (0x13 + 0x01) * code_factor, 0x3c,
- kCFARegister, 0xb348 * data_factor))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_restoreNoRule) {
- CFISection section(kBigEndian, 4);
- code_factor = 0x005f78143c1c3b82ULL;
- data_factor = 0x25d0;
- return_register = 0xe8;
- version = 1;
- fde_start = 0x4062e30f;
- fde_size = 0x5302a389;
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(code_factor, data_factor, return_register, version, "")
- // Provide a CFA rule, because register rules require them.
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x470aa334).ULEB128(0x099ef127)
- .FinishEntry()
- // In the FDE...
- .FDEHeader(cie, fde_start, fde_size)
- // At a second address, provide an offset(N) rule for register 0x2c.
- .D8(dwarf2reader::DW_CFA_advance_loc | 0x7)
- .D8(dwarf2reader::DW_CFA_offset | 0x2c).ULEB128(0x1f47)
- // At a third address, restore the (missing) CIE rule for register 0x2c.
- .D8(dwarf2reader::DW_CFA_advance_loc | 0xb)
- .D8(dwarf2reader::DW_CFA_restore | 0x2c)
- .FinishEntry();
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, fde_start, fde_size, version, "", return_register))
- .WillOnce(Return(true));
- // CIE's CFA rule.
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x470aa334, 0x099ef127))
- .WillOnce(Return(true));
- // FDE's rule for register 0x2c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start + 0x7 * code_factor, 0x2c,
- kCFARegister, 0x1f47 * data_factor))
- .WillOnce(Return(true));
- // Restore CIE's (missing) rule for register 0x2c.
- EXPECT_CALL(handler,
- SameValueRule(fde_start + (0x7 + 0xb) * code_factor, 0x2c))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_restore_extended) {
- CFISection section(kBigEndian, 4);
- code_factor = 0x126e;
- data_factor = -0xd8b;
- return_register = 0x77711787;
- version = 3;
- fde_start = 0x01f55a45;
- fde_size = 0x452adb80;
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(code_factor, data_factor, return_register, version,
- "", true /* dwarf64 */ )
- // Provide a CFA rule, because register rules require them.
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x56fa0edd).ULEB128(0x097f78a5)
- // Provide an offset(N) rule for register 0x0f9b8a1c.
- .D8(dwarf2reader::DW_CFA_offset_extended)
- .ULEB128(0x0f9b8a1c).ULEB128(0xc979)
- .FinishEntry()
- // In the FDE...
- .FDEHeader(cie, fde_start, fde_size)
- // At a second address, provide a new offset(N) rule for reg 0x0f9b8a1c.
- .D8(dwarf2reader::DW_CFA_advance_loc | 0x3)
- .D8(dwarf2reader::DW_CFA_offset_extended)
- .ULEB128(0x0f9b8a1c).ULEB128(0x3b7b)
- // At a third address, restore the original rule for register 0x0f9b8a1c.
- .D8(dwarf2reader::DW_CFA_advance_loc | 0x04)
- .D8(dwarf2reader::DW_CFA_restore_extended).ULEB128(0x0f9b8a1c)
- .FinishEntry();
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- Entry(_, fde_start, fde_size, version, "", return_register))
- .WillOnce(Return(true));
- // CIE's CFA rule.
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x56fa0edd, 0x097f78a5))
- .WillOnce(Return(true));
- // CIE's rule for register 0x0f9b8a1c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x0f9b8a1c, kCFARegister,
- 0xc979 * data_factor))
- .WillOnce(Return(true));
- // FDE's rule for register 0x0f9b8a1c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start + 0x3 * code_factor, 0x0f9b8a1c,
- kCFARegister, 0x3b7b * data_factor))
- .WillOnce(Return(true));
- // Restore CIE's rule for register 0x0f9b8a1c.
- EXPECT_CALL(handler,
- OffsetRule(fde_start + (0x3 + 0x4) * code_factor, 0x0f9b8a1c,
- kCFARegister, 0xc979 * data_factor))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
- }
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_remember_and_restore_state) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
-
- // We create a state, save it, modify it, and then restore. We
- // refer to the state that is overridden the restore as the
- // "outgoing" state, and the restored state the "incoming" state.
- //
- // Register outgoing incoming expect
- // 1 offset(N) no rule new "same value" rule
- // 2 register(R) offset(N) report changed rule
- // 3 offset(N) offset(M) report changed offset
- // 4 offset(N) offset(N) no report
- // 5 offset(N) no rule new "same value" rule
- section
- // Create the "incoming" state, which we will save and later restore.
- .D8(dwarf2reader::DW_CFA_offset | 2).ULEB128(0x9806)
- .D8(dwarf2reader::DW_CFA_offset | 3).ULEB128(0x995d)
- .D8(dwarf2reader::DW_CFA_offset | 4).ULEB128(0x7055)
- .D8(dwarf2reader::DW_CFA_remember_state)
- // Advance to a new instruction; an implementation could legitimately
- // ignore all but the final rule for a given register at a given address.
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- // Create the "outgoing" state, which we will discard.
- .D8(dwarf2reader::DW_CFA_offset | 1).ULEB128(0xea1a)
- .D8(dwarf2reader::DW_CFA_register).ULEB128(2).ULEB128(0x1d2a3767)
- .D8(dwarf2reader::DW_CFA_offset | 3).ULEB128(0xdd29)
- .D8(dwarf2reader::DW_CFA_offset | 5).ULEB128(0xf1ce)
- // At a third address, restore the incoming state.
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- uint64 addr = fde_start;
-
- // Expect the incoming rules to be reported.
- EXPECT_CALL(handler, OffsetRule(addr, 2, kCFARegister, 0x9806 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(addr, 3, kCFARegister, 0x995d * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(addr, 4, kCFARegister, 0x7055 * data_factor))
- .InSequence(s).WillOnce(Return(true));
-
- addr += code_factor;
-
- // After the save, we establish the outgoing rule set.
- EXPECT_CALL(handler, OffsetRule(addr, 1, kCFARegister, 0xea1a * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, RegisterRule(addr, 2, 0x1d2a3767))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(addr, 3, kCFARegister, 0xdd29 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(addr, 5, kCFARegister, 0xf1ce * data_factor))
- .InSequence(s).WillOnce(Return(true));
-
- addr += code_factor;
-
- // Finally, after the restore, expect to see the differences from
- // the outgoing to the incoming rules reported.
- EXPECT_CALL(handler, SameValueRule(addr, 1))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(addr, 2, kCFARegister, 0x9806 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(addr, 3, kCFARegister, 0x995d * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, SameValueRule(addr, 5))
- .InSequence(s).WillOnce(Return(true));
-
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-// Check that restoring a rule set reports changes to the CFA rule.
-TEST_F(CFIInsn, DW_CFA_remember_and_restore_stateCFA) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
-
- section
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_def_cfa_offset).ULEB128(0x90481102)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ValOffsetRule(fde_start + code_factor, kCFARegister,
- cfa_base_register, 0x90481102))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(fde_start + code_factor * 2, kCFARegister,
- cfa_base_register, cfa_offset))
- .InSequence(s).WillOnce(Return(true));
-
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_nop) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_nop)
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x3fb8d4f1).ULEB128(0x078dc67b)
- .D8(dwarf2reader::DW_CFA_nop)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- ValOffsetRule(fde_start, kCFARegister, 0x3fb8d4f1, 0x078dc67b))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_GNU_window_save) {
- CFISection section(kBigEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_GNU_window_save)
- .FinishEntry();
-
- // Don't include all the rules in any particular sequence.
-
- // The caller's %o0-%o7 have become the callee's %i0-%i7. This is
- // the GCC register numbering.
- for (int i = 8; i < 16; i++)
- EXPECT_CALL(handler, RegisterRule(fde_start, i, i + 16))
- .WillOnce(Return(true));
- // The caller's %l0-%l7 and %i0-%i7 have been saved at the top of
- // its frame.
- for (int i = 16; i < 32; i++)
- EXPECT_CALL(handler, OffsetRule(fde_start, i, kCFARegister, (i-16) * 4))
- .WillOnce(Return(true));
-
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_GNU_args_size) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_GNU_args_size).ULEB128(0xeddfa520)
- // Verify that we see this, meaning we parsed the above properly.
- .D8(dwarf2reader::DW_CFA_offset | 0x23).ULEB128(0x269)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x23, kCFARegister, 0x269 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIInsn, DW_CFA_GNU_negative_offset_extended) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_GNU_negative_offset_extended)
- .ULEB128(0x430cc87a).ULEB128(0x613)
- .FinishEntry();
-
- EXPECT_CALL(handler,
- OffsetRule(fde_start, 0x430cc87a,
- kCFARegister, -0x613 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-// Three FDEs: skip the second
-TEST_F(CFIInsn, SkipFDE) {
- CFISection section(kBigEndian, 4);
- Label cie;
- section
- // CIE, used by all FDEs.
- .Mark(&cie)
- .CIEHeader(0x010269f2, 0x9177, 0xedca5849, 2, "")
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(0x42ed390b).ULEB128(0x98f43aad)
- .FinishEntry()
- // First FDE.
- .FDEHeader(cie, 0xa870ebdd, 0x60f6aa4)
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0x3a860351).ULEB128(0x6c9a6bcf)
- .FinishEntry()
- // Second FDE.
- .FDEHeader(cie, 0xc534f7c0, 0xf6552e9, true /* dwarf64 */)
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0x1b62c234).ULEB128(0x26586b18)
- .FinishEntry()
- // Third FDE.
- .FDEHeader(cie, 0xf681cfc8, 0x7e4594e)
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0x26c53934).ULEB128(0x18eeb8a4)
- .FinishEntry();
-
- {
- InSequence s;
-
- // Process the first FDE.
- EXPECT_CALL(handler, Entry(_, 0xa870ebdd, 0x60f6aa4, 2, "", 0xedca5849))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(0xa870ebdd, kCFARegister,
- 0x42ed390b, 0x98f43aad))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, RegisterRule(0xa870ebdd, 0x3a860351, 0x6c9a6bcf))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .WillOnce(Return(true));
-
- // Skip the second FDE.
- EXPECT_CALL(handler, Entry(_, 0xc534f7c0, 0xf6552e9, 2, "", 0xedca5849))
- .WillOnce(Return(false));
-
- // Process the third FDE.
- EXPECT_CALL(handler, Entry(_, 0xf681cfc8, 0x7e4594e, 2, "", 0xedca5849))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(0xf681cfc8, kCFARegister,
- 0x42ed390b, 0x98f43aad))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, RegisterRule(0xf681cfc8, 0x26c53934, 0x18eeb8a4))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .WillOnce(Return(true));
- }
-
- ParseSection(&section);
-}
-
-// Quit processing in the middle of an entry's instructions.
-TEST_F(CFIInsn, QuitMidentry) {
- CFISection section(kLittleEndian, 8);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0xe0cf850d).ULEB128(0x15aab431)
- .D8(dwarf2reader::DW_CFA_expression).ULEB128(0x46750aa5).Block("meat")
- .FinishEntry();
-
- EXPECT_CALL(handler, RegisterRule(fde_start, 0xe0cf850d, 0x15aab431))
- .InSequence(s).WillOnce(Return(false));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseSection(&section, false);
-}
-
-class CFIRestore: public CFIInsnFixture, public Test { };
-
-TEST_F(CFIRestore, RestoreUndefinedRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0x0bac878e)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, UndefinedRule(fde_start, 0x0bac878e))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreUndefinedRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0x7dedff5f)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_same_value).ULEB128(0x7dedff5f)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, UndefinedRule(fde_start, 0x7dedff5f))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, SameValueRule(fde_start + code_factor, 0x7dedff5f))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + 2 * code_factor, 0x7dedff5f))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreSameValueRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_same_value).ULEB128(0xadbc9b3a)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, SameValueRule(fde_start, 0xadbc9b3a))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreSameValueRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_same_value).ULEB128(0x3d90dcb5)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0x3d90dcb5)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, SameValueRule(fde_start, 0x3d90dcb5))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + code_factor, 0x3d90dcb5))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, SameValueRule(fde_start + 2 * code_factor, 0x3d90dcb5))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreOffsetRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_offset | 0x14).ULEB128(0xb6f)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, OffsetRule(fde_start, 0x14,
- kCFARegister, 0xb6f * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreOffsetRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_offset | 0x21).ULEB128(0xeb7)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0x21)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, OffsetRule(fde_start, 0x21,
- kCFARegister, 0xeb7 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + code_factor, 0x21))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(fde_start + 2 * code_factor, 0x21,
- kCFARegister, 0xeb7 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreOffsetRuleChangedOffset) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_offset | 0x21).ULEB128(0x134)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_offset | 0x21).ULEB128(0xf4f)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, OffsetRule(fde_start, 0x21,
- kCFARegister, 0x134 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(fde_start + code_factor, 0x21,
- kCFARegister, 0xf4f * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, OffsetRule(fde_start + 2 * code_factor, 0x21,
- kCFARegister, 0x134 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreValOffsetRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_offset).ULEB128(0x829caee6).ULEB128(0xe4c)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ValOffsetRule(fde_start, 0x829caee6,
- kCFARegister, 0xe4c * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreValOffsetRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_offset).ULEB128(0xf17c36d6).ULEB128(0xeb7)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0xf17c36d6)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ValOffsetRule(fde_start, 0xf17c36d6,
- kCFARegister, 0xeb7 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + code_factor, 0xf17c36d6))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(fde_start + 2 * code_factor, 0xf17c36d6,
- kCFARegister, 0xeb7 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreValOffsetRuleChangedValOffset) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_offset).ULEB128(0x2cf0ab1b).ULEB128(0x562)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_val_offset).ULEB128(0x2cf0ab1b).ULEB128(0xe88)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ValOffsetRule(fde_start, 0x2cf0ab1b,
- kCFARegister, 0x562 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(fde_start + code_factor, 0x2cf0ab1b,
- kCFARegister, 0xe88 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(fde_start + 2 * code_factor, 0x2cf0ab1b,
- kCFARegister, 0x562 * data_factor))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreRegisterRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0x77514acc).ULEB128(0x464de4ce)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, RegisterRule(fde_start, 0x77514acc, 0x464de4ce))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreRegisterRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0xe39acce5).ULEB128(0x095f1559)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0xe39acce5)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, RegisterRule(fde_start, 0xe39acce5, 0x095f1559))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + code_factor, 0xe39acce5))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, RegisterRule(fde_start + 2 * code_factor, 0xe39acce5,
- 0x095f1559))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreRegisterRuleChangedRegister) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0xd40e21b1).ULEB128(0x16607d6a)
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_register).ULEB128(0xd40e21b1).ULEB128(0xbabb4742)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, RegisterRule(fde_start, 0xd40e21b1, 0x16607d6a))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, RegisterRule(fde_start + code_factor, 0xd40e21b1,
- 0xbabb4742))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, RegisterRule(fde_start + 2 * code_factor, 0xd40e21b1,
- 0x16607d6a))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreExpressionRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_expression).ULEB128(0x666ae152).Block("dwarf")
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ExpressionRule(fde_start, 0x666ae152, "dwarf"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreExpressionRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_expression).ULEB128(0xb5ca5c46).Block("elf")
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0xb5ca5c46)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ExpressionRule(fde_start, 0xb5ca5c46, "elf"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + code_factor, 0xb5ca5c46))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ExpressionRule(fde_start + 2 * code_factor, 0xb5ca5c46,
- "elf"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreExpressionRuleChangedExpression) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_expression).ULEB128(0x500f5739).Block("smurf")
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_expression).ULEB128(0x500f5739).Block("orc")
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ExpressionRule(fde_start, 0x500f5739, "smurf"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ExpressionRule(fde_start + code_factor, 0x500f5739,
- "orc"))
- .InSequence(s).WillOnce(Return(true));
- // Expectations are not wishes.
- EXPECT_CALL(handler, ExpressionRule(fde_start + 2 * code_factor, 0x500f5739,
- "smurf"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreValExpressionRuleUnchanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_expression).ULEB128(0x666ae152)
- .Block("hideous")
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- EXPECT_CALL(handler, ValExpressionRule(fde_start, 0x666ae152, "hideous"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreValExpressionRuleChanged) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_expression).ULEB128(0xb5ca5c46)
- .Block("revolting")
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0xb5ca5c46)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("RestoreValExpressionRuleChanged", section);
-
- EXPECT_CALL(handler, ValExpressionRule(fde_start, 0xb5ca5c46, "revolting"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(fde_start + code_factor, 0xb5ca5c46))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValExpressionRule(fde_start + 2 * code_factor, 0xb5ca5c46,
- "revolting"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-TEST_F(CFIRestore, RestoreValExpressionRuleChangedValExpression) {
- CFISection section(kLittleEndian, 4);
- StockCIEAndFDE(&section);
- section
- .D8(dwarf2reader::DW_CFA_val_expression).ULEB128(0x500f5739)
- .Block("repulsive")
- .D8(dwarf2reader::DW_CFA_remember_state)
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_val_expression).ULEB128(0x500f5739)
- .Block("nauseous")
- .D8(dwarf2reader::DW_CFA_advance_loc | 1)
- .D8(dwarf2reader::DW_CFA_restore_state)
- .FinishEntry();
-
- PERHAPS_WRITE_DEBUG_FRAME_FILE("RestoreValExpressionRuleChangedValExpression",
- section);
-
- EXPECT_CALL(handler, ValExpressionRule(fde_start, 0x500f5739, "repulsive"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValExpressionRule(fde_start + code_factor, 0x500f5739,
- "nauseous"))
- .InSequence(s).WillOnce(Return(true));
- // Expectations are not wishes.
- EXPECT_CALL(handler, ValExpressionRule(fde_start + 2 * code_factor, 0x500f5739,
- "repulsive"))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End()).WillOnce(Return(true));
-
- ParseSection(&section);
-}
-
-struct EHFrameFixture: public CFIInsnFixture {
- EHFrameFixture()
- : CFIInsnFixture(), section(kBigEndian, 4, true) {
- encoded_pointer_bases.cfi = 0x7f496cb2;
- encoded_pointer_bases.text = 0x540f67b6;
- encoded_pointer_bases.data = 0xe3eab768;
- section.SetEncodedPointerBases(encoded_pointer_bases);
- }
- CFISection section;
- CFISection::EncodedPointerBases encoded_pointer_bases;
-
- // Parse CFIInsnFixture::ParseSection, but parse the section as
- // .eh_frame data, supplying stock base addresses.
- void ParseEHFrameSection(CFISection *section, bool succeeds = true) {
- EXPECT_TRUE(section->ContainsEHFrame());
- string contents;
- EXPECT_TRUE(section->GetContents(&contents));
- dwarf2reader::Endianness endianness;
- if (section->endianness() == kBigEndian)
- endianness = ENDIANNESS_BIG;
- else {
- assert(section->endianness() == kLittleEndian);
- endianness = ENDIANNESS_LITTLE;
- }
- ByteReader byte_reader(endianness);
- byte_reader.SetAddressSize(section->AddressSize());
- byte_reader.SetCFIDataBase(encoded_pointer_bases.cfi,
- reinterpret_cast<const uint8_t *>(contents.data()));
- byte_reader.SetTextBase(encoded_pointer_bases.text);
- byte_reader.SetDataBase(encoded_pointer_bases.data);
- CallFrameInfo parser(reinterpret_cast<const uint8_t *>(contents.data()),
- contents.size(),
- &byte_reader, &handler, &reporter, true);
- if (succeeds)
- EXPECT_TRUE(parser.Start());
- else
- EXPECT_FALSE(parser.Start());
- }
-
-};
-
-class EHFrame: public EHFrameFixture, public Test { };
-
-// A simple CIE, an FDE, and a terminator.
-TEST_F(EHFrame, Terminator) {
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(9968, 2466, 67, 1, "")
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(3772).ULEB128(1372)
- .FinishEntry()
- .FDEHeader(cie, 0x848037a1, 0x7b30475e)
- .D8(dwarf2reader::DW_CFA_set_loc).D32(0x17713850)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(5721)
- .FinishEntry()
- .D32(0) // Terminate the sequence.
- // This FDE should be ignored.
- .FDEHeader(cie, 0xf19629fe, 0x439fb09b)
- .FinishEntry();
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.Terminator", section);
-
- EXPECT_CALL(handler, Entry(_, 0x848037a1, 0x7b30475e, 1, "", 67))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(0x848037a1, kCFARegister, 3772, 1372))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(0x17713850, 5721))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(reporter, EarlyEHTerminator(_))
- .InSequence(s).WillOnce(Return());
-
- ParseEHFrameSection(&section);
-}
-
-// The parser should recognize the Linux Standards Base 'z' augmentations.
-TEST_F(EHFrame, SimpleFDE) {
- DwarfPointerEncoding lsda_encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_indirect
- | dwarf2reader::DW_EH_PE_datarel
- | dwarf2reader::DW_EH_PE_sdata2);
- DwarfPointerEncoding fde_encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_textrel
- | dwarf2reader::DW_EH_PE_udata2);
-
- section.SetPointerEncoding(fde_encoding);
- section.SetEncodedPointerBases(encoded_pointer_bases);
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(4873, 7012, 100, 1, "zSLPR")
- .ULEB128(7) // Augmentation data length
- .D8(lsda_encoding) // LSDA pointer format
- .D8(dwarf2reader::DW_EH_PE_pcrel) // personality pointer format
- .EncodedPointer(0x97baa00, dwarf2reader::DW_EH_PE_pcrel) // and value
- .D8(fde_encoding) // FDE pointer format
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(6706).ULEB128(31)
- .FinishEntry()
- .FDEHeader(cie, 0x540f6b56, 0xf686)
- .ULEB128(2) // Augmentation data length
- .EncodedPointer(0xe3eab475, lsda_encoding) // LSDA pointer, signed
- .D8(dwarf2reader::DW_CFA_set_loc)
- .EncodedPointer(0x540fa4ce, fde_encoding)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(0x675e)
- .FinishEntry()
- .D32(0); // terminator
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.SimpleFDE", section);
-
- EXPECT_CALL(handler, Entry(_, 0x540f6b56, 0xf686, 1, "zSLPR", 100))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, PersonalityRoutine(0x97baa00, false))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, LanguageSpecificDataArea(0xe3eab475, true))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, SignalHandler())
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(0x540f6b56, kCFARegister, 6706, 31))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(0x540fa4ce, 0x675e))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseEHFrameSection(&section);
-}
-
-// Check that we can handle an empty 'z' augmentation.
-TEST_F(EHFrame, EmptyZ) {
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(5955, 5805, 228, 1, "z")
- .ULEB128(0) // Augmentation data length
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(3629).ULEB128(247)
- .FinishEntry()
- .FDEHeader(cie, 0xda007738, 0xfb55c641)
- .ULEB128(0) // Augmentation data length
- .D8(dwarf2reader::DW_CFA_advance_loc1).D8(11)
- .D8(dwarf2reader::DW_CFA_undefined).ULEB128(3769)
- .FinishEntry();
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.EmptyZ", section);
-
- EXPECT_CALL(handler, Entry(_, 0xda007738, 0xfb55c641, 1, "z", 228))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, ValOffsetRule(0xda007738, kCFARegister, 3629, 247))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, UndefinedRule(0xda007738 + 11 * 5955, 3769))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseEHFrameSection(&section);
-}
-
-// Check that we recognize bad 'z' augmentation characters.
-TEST_F(EHFrame, BadZ) {
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(6937, 1045, 142, 1, "zQ")
- .ULEB128(0) // Augmentation data length
- .D8(dwarf2reader::DW_CFA_def_cfa).ULEB128(9006).ULEB128(7725)
- .FinishEntry()
- .FDEHeader(cie, 0x1293efa8, 0x236f53f2)
- .ULEB128(0) // Augmentation data length
- .D8(dwarf2reader::DW_CFA_advance_loc | 12)
- .D8(dwarf2reader::DW_CFA_register).ULEB128(5667).ULEB128(3462)
- .FinishEntry();
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.BadZ", section);
-
- EXPECT_CALL(reporter, UnrecognizedAugmentation(_, "zQ"))
- .WillOnce(Return());
-
- ParseEHFrameSection(&section, false);
-}
-
-TEST_F(EHFrame, zL) {
- Label cie;
- DwarfPointerEncoding lsda_encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_funcrel
- | dwarf2reader::DW_EH_PE_udata2);
- section
- .Mark(&cie)
- .CIEHeader(9285, 9959, 54, 1, "zL")
- .ULEB128(1) // Augmentation data length
- .D8(lsda_encoding) // encoding for LSDA pointer in FDE
-
- .FinishEntry()
- .FDEHeader(cie, 0xd40091aa, 0x9aa6e746)
- .ULEB128(2) // Augmentation data length
- .EncodedPointer(0xd40099cd, lsda_encoding) // LSDA pointer
- .FinishEntry()
- .D32(0); // terminator
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.zL", section);
-
- EXPECT_CALL(handler, Entry(_, 0xd40091aa, 0x9aa6e746, 1, "zL", 54))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, LanguageSpecificDataArea(0xd40099cd, false))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseEHFrameSection(&section);
-}
-
-TEST_F(EHFrame, zP) {
- Label cie;
- DwarfPointerEncoding personality_encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_datarel
- | dwarf2reader::DW_EH_PE_udata2);
- section
- .Mark(&cie)
- .CIEHeader(1097, 6313, 17, 1, "zP")
- .ULEB128(3) // Augmentation data length
- .D8(personality_encoding) // encoding for personality routine
- .EncodedPointer(0xe3eaccac, personality_encoding) // value
- .FinishEntry()
- .FDEHeader(cie, 0x0c8350c9, 0xbef11087)
- .ULEB128(0) // Augmentation data length
- .FinishEntry()
- .D32(0); // terminator
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.zP", section);
-
- EXPECT_CALL(handler, Entry(_, 0x0c8350c9, 0xbef11087, 1, "zP", 17))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, PersonalityRoutine(0xe3eaccac, false))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseEHFrameSection(&section);
-}
-
-TEST_F(EHFrame, zR) {
- Label cie;
- DwarfPointerEncoding pointer_encoding =
- DwarfPointerEncoding(dwarf2reader::DW_EH_PE_textrel
- | dwarf2reader::DW_EH_PE_sdata2);
- section.SetPointerEncoding(pointer_encoding);
- section
- .Mark(&cie)
- .CIEHeader(8011, 5496, 75, 1, "zR")
- .ULEB128(1) // Augmentation data length
- .D8(pointer_encoding) // encoding for FDE addresses
- .FinishEntry()
- .FDEHeader(cie, 0x540f9431, 0xbd0)
- .ULEB128(0) // Augmentation data length
- .FinishEntry()
- .D32(0); // terminator
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.zR", section);
-
- EXPECT_CALL(handler, Entry(_, 0x540f9431, 0xbd0, 1, "zR", 75))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseEHFrameSection(&section);
-}
-
-TEST_F(EHFrame, zS) {
- Label cie;
- section
- .Mark(&cie)
- .CIEHeader(9217, 7694, 57, 1, "zS")
- .ULEB128(0) // Augmentation data length
- .FinishEntry()
- .FDEHeader(cie, 0xd40091aa, 0x9aa6e746)
- .ULEB128(0) // Augmentation data length
- .FinishEntry()
- .D32(0); // terminator
-
- PERHAPS_WRITE_EH_FRAME_FILE("EHFrame.zS", section);
-
- EXPECT_CALL(handler, Entry(_, 0xd40091aa, 0x9aa6e746, 1, "zS", 57))
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, SignalHandler())
- .InSequence(s).WillOnce(Return(true));
- EXPECT_CALL(handler, End())
- .InSequence(s).WillOnce(Return(true));
-
- ParseEHFrameSection(&section);
-}
-
-// These tests require manual inspection of the test output.
-struct CFIReporterFixture {
- CFIReporterFixture() : reporter("test file name", "test section name") { }
- CallFrameInfo::Reporter reporter;
-};
-
-class CFIReporter: public CFIReporterFixture, public Test { };
-
-TEST_F(CFIReporter, Incomplete) {
- reporter.Incomplete(0x0102030405060708ULL, CallFrameInfo::kUnknown);
-}
-
-TEST_F(CFIReporter, EarlyEHTerminator) {
- reporter.EarlyEHTerminator(0x0102030405060708ULL);
-}
-
-TEST_F(CFIReporter, CIEPointerOutOfRange) {
- reporter.CIEPointerOutOfRange(0x0123456789abcdefULL, 0xfedcba9876543210ULL);
-}
-
-TEST_F(CFIReporter, BadCIEId) {
- reporter.BadCIEId(0x0123456789abcdefULL, 0xfedcba9876543210ULL);
-}
-
-TEST_F(CFIReporter, UnrecognizedVersion) {
- reporter.UnrecognizedVersion(0x0123456789abcdefULL, 43);
-}
-
-TEST_F(CFIReporter, UnrecognizedAugmentation) {
- reporter.UnrecognizedAugmentation(0x0123456789abcdefULL, "poodles");
-}
-
-TEST_F(CFIReporter, InvalidPointerEncoding) {
- reporter.InvalidPointerEncoding(0x0123456789abcdefULL, 0x42);
-}
-
-TEST_F(CFIReporter, UnusablePointerEncoding) {
- reporter.UnusablePointerEncoding(0x0123456789abcdefULL, 0x42);
-}
-
-TEST_F(CFIReporter, RestoreInCIE) {
- reporter.RestoreInCIE(0x0123456789abcdefULL, 0xfedcba9876543210ULL);
-}
-
-TEST_F(CFIReporter, BadInstruction) {
- reporter.BadInstruction(0x0123456789abcdefULL, CallFrameInfo::kFDE,
- 0xfedcba9876543210ULL);
-}
-
-TEST_F(CFIReporter, NoCFARule) {
- reporter.NoCFARule(0x0123456789abcdefULL, CallFrameInfo::kCIE,
- 0xfedcba9876543210ULL);
-}
-
-TEST_F(CFIReporter, EmptyStateStack) {
- reporter.EmptyStateStack(0x0123456789abcdefULL, CallFrameInfo::kTerminator,
- 0xfedcba9876543210ULL);
-}
-
-TEST_F(CFIReporter, ClearingCFARule) {
- reporter.ClearingCFARule(0x0123456789abcdefULL, CallFrameInfo::kFDE,
- 0xfedcba9876543210ULL);
-}
-
-#ifdef WRITE_ELF
-// See comments at the top of the file mentioning WRITE_ELF for details.
-
-using google_breakpad::test_assembler::Section;
-
-struct ELFSectionHeader {
- ELFSectionHeader(unsigned int set_type)
- : type(set_type), flags(0), address(0), link(0), info(0),
- alignment(1), entry_size(0) { }
- Label name;
- unsigned int type;
- uint64_t flags;
- uint64_t address;
- Label file_offset;
- Label file_size;
- unsigned int link;
- unsigned int info;
- uint64_t alignment;
- uint64_t entry_size;
-};
-
-void AppendSectionHeader(CFISection *table, const ELFSectionHeader &header) {
- (*table)
- .D32(header.name) // name, index in string tbl
- .D32(header.type) // type
- .Address(header.flags) // flags
- .Address(header.address) // address in memory
- .Address(header.file_offset) // offset in ELF file
- .Address(header.file_size) // length in bytes
- .D32(header.link) // link to related section
- .D32(header.info) // miscellaneous
- .Address(header.alignment) // alignment
- .Address(header.entry_size); // entry size
-}
-
-void WriteELFFrameSection(const char *filename, const char *cfi_name,
- const CFISection &cfi) {
- int elf_class = cfi.AddressSize() == 4 ? ELFCLASS32 : ELFCLASS64;
- int elf_data = (cfi.endianness() == kBigEndian
- ? ELFDATA2MSB : ELFDATA2LSB);
- CFISection elf(cfi.endianness(), cfi.AddressSize());
- Label elf_header_size, section_table_offset;
- elf
- .Append("\x7f" "ELF")
- .D8(elf_class) // 32-bit or 64-bit ELF
- .D8(elf_data) // endianness
- .D8(1) // ELF version
- .D8(ELFOSABI_LINUX) // Operating System/ABI indication
- .D8(0) // ABI version
- .Append(7, 0xda) // padding
- .D16(ET_EXEC) // file type: executable file
- .D16(EM_386) // architecture: Intel IA-32
- .D32(EV_CURRENT); // ELF version
- elf
- .Address(0x0123456789abcdefULL) // program entry point
- .Address(0) // program header offset
- .Address(section_table_offset) // section header offset
- .D32(0) // processor-specific flags
- .D16(elf_header_size) // ELF header size in bytes */
- .D16(elf_class == ELFCLASS32 ? 32 : 56) // program header entry size
- .D16(0) // program header table entry count
- .D16(elf_class == ELFCLASS32 ? 40 : 64) // section header entry size
- .D16(3) // section count
- .D16(1) // section name string table
- .Mark(&elf_header_size);
-
- // The null section. Every ELF file has one, as the first entry in
- // the section header table.
- ELFSectionHeader null_header(SHT_NULL);
- null_header.file_offset = 0;
- null_header.file_size = 0;
-
- // The CFI section. The whole reason for writing out this ELF file
- // is to put this in it so that we can run other dumping programs on
- // it to check its contents.
- ELFSectionHeader cfi_header(SHT_PROGBITS);
- cfi_header.file_size = cfi.Size();
-
- // The section holding the names of the sections. This is the
- // section whose index appears in the e_shstrndx member of the ELF
- // header.
- ELFSectionHeader section_names_header(SHT_STRTAB);
- CFISection section_names(cfi.endianness(), cfi.AddressSize());
- section_names
- .Mark(&null_header.name)
- .AppendCString("")
- .Mark(&section_names_header.name)
- .AppendCString(".shstrtab")
- .Mark(&cfi_header.name)
- .AppendCString(cfi_name)
- .Mark(&section_names_header.file_size);
-
- // Create the section table. The ELF header's e_shoff member refers
- // to this, and the e_shnum member gives the number of entries it
- // contains.
- CFISection section_table(cfi.endianness(), cfi.AddressSize());
- AppendSectionHeader(&section_table, null_header);
- AppendSectionHeader(&section_table, section_names_header);
- AppendSectionHeader(&section_table, cfi_header);
-
- // Append the section table and the section contents to the ELF file.
- elf
- .Mark(&section_table_offset)
- .Append(section_table)
- .Mark(&section_names_header.file_offset)
- .Append(section_names)
- .Mark(&cfi_header.file_offset)
- .Append(cfi);
-
- string contents;
- if (!elf.GetContents(&contents)) {
- fprintf(stderr, "failed to get ELF file contents\n");
- exit(1);
- }
-
- FILE *out = fopen(filename, "w");
- if (!out) {
- fprintf(stderr, "error opening ELF file '%s': %s\n",
- filename, strerror(errno));
- exit(1);
- }
-
- if (fwrite(contents.data(), 1, contents.size(), out) != contents.size()) {
- fprintf(stderr, "error writing ELF data to '%s': %s\n",
- filename, strerror(errno));
- exit(1);
- }
-
- if (fclose(out) == EOF) {
- fprintf(stderr, "error closing ELF file '%s': %s\n",
- filename, strerror(errno));
- exit(1);
- }
-}
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
deleted file mode 100644
index 71418eb8d7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_die_unittest.cc
+++ /dev/null
@@ -1,487 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf2reader_die_unittest.cc: Unit tests for dwarf2reader::CompilationUnit
-
-#include <stdint.h>
-#include <stdlib.h>
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/dwarf2reader_test_common.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-using google_breakpad::test_assembler::Endianness;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-
-using dwarf2reader::ByteReader;
-using dwarf2reader::CompilationUnit;
-using dwarf2reader::Dwarf2Handler;
-using dwarf2reader::DwarfAttribute;
-using dwarf2reader::DwarfForm;
-using dwarf2reader::DwarfHasChild;
-using dwarf2reader::DwarfTag;
-using dwarf2reader::ENDIANNESS_BIG;
-using dwarf2reader::ENDIANNESS_LITTLE;
-using dwarf2reader::SectionMap;
-
-using std::vector;
-using testing::InSequence;
-using testing::Pointee;
-using testing::Return;
-using testing::Sequence;
-using testing::Test;
-using testing::TestWithParam;
-using testing::_;
-
-class MockDwarf2Handler: public Dwarf2Handler {
- public:
- MOCK_METHOD5(StartCompilationUnit, bool(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version));
- MOCK_METHOD2(StartDIE, bool(uint64 offset, enum DwarfTag tag));
- MOCK_METHOD4(ProcessAttributeUnsigned, void(uint64 offset,
- DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data));
- MOCK_METHOD4(ProcessAttributeSigned, void(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data));
- MOCK_METHOD4(ProcessAttributeReference, void(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data));
- MOCK_METHOD5(ProcessAttributeBuffer, void(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const uint8_t *data,
- uint64 len));
- MOCK_METHOD4(ProcessAttributeString, void(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string& data));
- MOCK_METHOD4(ProcessAttributeSignature, void(uint64 offset,
- DwarfAttribute attr,
- enum DwarfForm form,
- uint64 signature));
- MOCK_METHOD1(EndDIE, void(uint64 offset));
-};
-
-struct DIEFixture {
-
- DIEFixture() {
- // Fix the initial offset of the .debug_info and .debug_abbrev sections.
- info.start() = 0;
- abbrevs.start() = 0;
-
- // Default expectations for the data handler.
- EXPECT_CALL(handler, StartCompilationUnit(_, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, StartDIE(_, _)).Times(0);
- EXPECT_CALL(handler, ProcessAttributeUnsigned(_, _, _, _)).Times(0);
- EXPECT_CALL(handler, ProcessAttributeSigned(_, _, _, _)).Times(0);
- EXPECT_CALL(handler, ProcessAttributeReference(_, _, _, _)).Times(0);
- EXPECT_CALL(handler, ProcessAttributeBuffer(_, _, _, _, _)).Times(0);
- EXPECT_CALL(handler, ProcessAttributeString(_, _, _, _)).Times(0);
- EXPECT_CALL(handler, EndDIE(_)).Times(0);
- }
-
- // Return a reference to a section map whose .debug_info section refers
- // to |info|, and whose .debug_abbrev section refers to |abbrevs|. This
- // function returns a reference to the same SectionMap each time; new
- // calls wipe out maps established by earlier calls.
- const SectionMap &MakeSectionMap() {
- // Copy the sections' contents into strings that will live as long as
- // the map itself.
- assert(info.GetContents(&info_contents));
- assert(abbrevs.GetContents(&abbrevs_contents));
- section_map.clear();
- section_map[".debug_info"].first
- = reinterpret_cast<const uint8_t *>(info_contents.data());
- section_map[".debug_info"].second = info_contents.size();
- section_map[".debug_abbrev"].first
- = reinterpret_cast<const uint8_t *>(abbrevs_contents.data());
- section_map[".debug_abbrev"].second = abbrevs_contents.size();
- return section_map;
- }
-
- TestCompilationUnit info;
- TestAbbrevTable abbrevs;
- MockDwarf2Handler handler;
- string abbrevs_contents, info_contents;
- SectionMap section_map;
-};
-
-struct DwarfHeaderParams {
- DwarfHeaderParams(Endianness endianness, size_t format_size,
- int version, size_t address_size)
- : endianness(endianness), format_size(format_size),
- version(version), address_size(address_size) { }
- Endianness endianness;
- size_t format_size; // 4-byte or 8-byte DWARF offsets
- int version;
- size_t address_size;
-};
-
-class DwarfHeader: public DIEFixture,
- public TestWithParam<DwarfHeaderParams> { };
-
-TEST_P(DwarfHeader, Header) {
- Label abbrev_table = abbrevs.Here();
- abbrevs.Abbrev(1, dwarf2reader::DW_TAG_compile_unit,
- dwarf2reader::DW_children_yes)
- .Attribute(dwarf2reader::DW_AT_name, dwarf2reader::DW_FORM_string)
- .EndAbbrev()
- .EndTable();
-
- info.set_format_size(GetParam().format_size);
- info.set_endianness(GetParam().endianness);
-
- info.Header(GetParam().version, abbrev_table, GetParam().address_size)
- .ULEB128(1) // DW_TAG_compile_unit, with children
- .AppendCString("sam") // DW_AT_name, DW_FORM_string
- .D8(0); // end of children
- info.Finish();
-
- {
- InSequence s;
- EXPECT_CALL(handler,
- StartCompilationUnit(0, GetParam().address_size,
- GetParam().format_size, _,
- GetParam().version))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, StartDIE(_, dwarf2reader::DW_TAG_compile_unit))
- .WillOnce(Return(true));
- EXPECT_CALL(handler, ProcessAttributeString(_, dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_string,
- "sam"))
- .WillOnce(Return());
- EXPECT_CALL(handler, EndDIE(_))
- .WillOnce(Return());
- }
-
- ByteReader byte_reader(GetParam().endianness == kLittleEndian ?
- ENDIANNESS_LITTLE : ENDIANNESS_BIG);
- CompilationUnit parser("", MakeSectionMap(), 0, &byte_reader, &handler);
- EXPECT_EQ(parser.Start(), info_contents.size());
-}
-
-INSTANTIATE_TEST_CASE_P(
- HeaderVariants, DwarfHeader,
- ::testing::Values(DwarfHeaderParams(kLittleEndian, 4, 2, 4),
- DwarfHeaderParams(kLittleEndian, 4, 2, 8),
- DwarfHeaderParams(kLittleEndian, 4, 3, 4),
- DwarfHeaderParams(kLittleEndian, 4, 3, 8),
- DwarfHeaderParams(kLittleEndian, 4, 4, 4),
- DwarfHeaderParams(kLittleEndian, 4, 4, 8),
- DwarfHeaderParams(kLittleEndian, 8, 2, 4),
- DwarfHeaderParams(kLittleEndian, 8, 2, 8),
- DwarfHeaderParams(kLittleEndian, 8, 3, 4),
- DwarfHeaderParams(kLittleEndian, 8, 3, 8),
- DwarfHeaderParams(kLittleEndian, 8, 4, 4),
- DwarfHeaderParams(kLittleEndian, 8, 4, 8),
- DwarfHeaderParams(kBigEndian, 4, 2, 4),
- DwarfHeaderParams(kBigEndian, 4, 2, 8),
- DwarfHeaderParams(kBigEndian, 4, 3, 4),
- DwarfHeaderParams(kBigEndian, 4, 3, 8),
- DwarfHeaderParams(kBigEndian, 4, 4, 4),
- DwarfHeaderParams(kBigEndian, 4, 4, 8),
- DwarfHeaderParams(kBigEndian, 8, 2, 4),
- DwarfHeaderParams(kBigEndian, 8, 2, 8),
- DwarfHeaderParams(kBigEndian, 8, 3, 4),
- DwarfHeaderParams(kBigEndian, 8, 3, 8),
- DwarfHeaderParams(kBigEndian, 8, 4, 4),
- DwarfHeaderParams(kBigEndian, 8, 4, 8)));
-
-struct DwarfFormsFixture: public DIEFixture {
- // Start a compilation unit, as directed by |params|, containing one
- // childless DIE of the given tag, with one attribute of the given name
- // and form. The 'info' fixture member is left just after the abbrev
- // code, waiting for the attribute value to be appended.
- void StartSingleAttributeDIE(const DwarfHeaderParams &params,
- DwarfTag tag, DwarfAttribute name,
- DwarfForm form) {
- // Create the abbreviation table.
- Label abbrev_table = abbrevs.Here();
- abbrevs.Abbrev(1, tag, dwarf2reader::DW_children_no)
- .Attribute(name, form)
- .EndAbbrev()
- .EndTable();
-
- // Create the compilation unit, up to the attribute value.
- info.set_format_size(params.format_size);
- info.set_endianness(params.endianness);
- info.Header(params.version, abbrev_table, params.address_size)
- .ULEB128(1); // abbrev code
- }
-
- // Set up handler to expect a compilation unit matching |params|,
- // containing one childless DIE of the given tag, in the sequence s. Stop
- // just before the expectations.
- void ExpectBeginCompilationUnit(const DwarfHeaderParams &params,
- DwarfTag tag, uint64 offset=0) {
- EXPECT_CALL(handler,
- StartCompilationUnit(offset, params.address_size,
- params.format_size, _,
- params.version))
- .InSequence(s)
- .WillOnce(Return(true));
- EXPECT_CALL(handler, StartDIE(_, tag))
- .InSequence(s)
- .WillOnce(Return(true));
- }
-
- void ExpectEndCompilationUnit() {
- EXPECT_CALL(handler, EndDIE(_))
- .InSequence(s)
- .WillOnce(Return());
- }
-
- void ParseCompilationUnit(const DwarfHeaderParams &params, uint64 offset=0) {
- ByteReader byte_reader(params.endianness == kLittleEndian ?
- ENDIANNESS_LITTLE : ENDIANNESS_BIG);
- CompilationUnit parser("", MakeSectionMap(), offset, &byte_reader, &handler);
- EXPECT_EQ(offset + parser.Start(), info_contents.size());
- }
-
- // The sequence to which the fixture's methods append expectations.
- Sequence s;
-};
-
-struct DwarfForms: public DwarfFormsFixture,
- public TestWithParam<DwarfHeaderParams> { };
-
-TEST_P(DwarfForms, addr) {
- StartSingleAttributeDIE(GetParam(), dwarf2reader::DW_TAG_compile_unit,
- dwarf2reader::DW_AT_low_pc,
- dwarf2reader::DW_FORM_addr);
- uint64_t value;
- if (GetParam().address_size == 4) {
- value = 0xc8e9ffcc;
- info.D32(value);
- } else {
- value = 0xe942517fc2768564ULL;
- info.D64(value);
- }
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), dwarf2reader::DW_TAG_compile_unit);
- EXPECT_CALL(handler, ProcessAttributeUnsigned(_, dwarf2reader::DW_AT_low_pc,
- dwarf2reader::DW_FORM_addr,
- value))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-TEST_P(DwarfForms, block2_empty) {
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0x16e4d2f7,
- (DwarfAttribute) 0xe52c4463,
- dwarf2reader::DW_FORM_block2);
- info.D16(0);
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x16e4d2f7);
- EXPECT_CALL(handler, ProcessAttributeBuffer(_, (DwarfAttribute) 0xe52c4463,
- dwarf2reader::DW_FORM_block2,
- _, 0))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-TEST_P(DwarfForms, block2) {
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0x16e4d2f7,
- (DwarfAttribute) 0xe52c4463,
- dwarf2reader::DW_FORM_block2);
- unsigned char data[258];
- memset(data, '*', sizeof(data));
- info.D16(sizeof(data))
- .Append(data, sizeof(data));
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x16e4d2f7);
- EXPECT_CALL(handler, ProcessAttributeBuffer(_, (DwarfAttribute) 0xe52c4463,
- dwarf2reader::DW_FORM_block2,
- Pointee('*'), 258))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-TEST_P(DwarfForms, flag_present) {
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0x3e449ac2,
- (DwarfAttribute) 0x359d1972,
- dwarf2reader::DW_FORM_flag_present);
- // DW_FORM_flag_present occupies no space in the DIE.
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x3e449ac2);
- EXPECT_CALL(handler,
- ProcessAttributeUnsigned(_, (DwarfAttribute) 0x359d1972,
- dwarf2reader::DW_FORM_flag_present,
- 1))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-TEST_P(DwarfForms, sec_offset) {
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0x1d971689,
- (DwarfAttribute) 0xa060bfd1,
- dwarf2reader::DW_FORM_sec_offset);
- uint64_t value;
- if (GetParam().format_size == 4) {
- value = 0xacc9c388;
- info.D32(value);
- } else {
- value = 0xcffe5696ffe3ed0aULL;
- info.D64(value);
- }
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x1d971689);
- EXPECT_CALL(handler, ProcessAttributeUnsigned(_, (DwarfAttribute) 0xa060bfd1,
- dwarf2reader::DW_FORM_sec_offset,
- value))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-TEST_P(DwarfForms, exprloc) {
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0xb6d167bb,
- (DwarfAttribute) 0xba3ae5cb,
- dwarf2reader::DW_FORM_exprloc);
- info.ULEB128(29)
- .Append(29, 173);
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0xb6d167bb);
- EXPECT_CALL(handler, ProcessAttributeBuffer(_, (DwarfAttribute) 0xba3ae5cb,
- dwarf2reader::DW_FORM_exprloc,
- Pointee(173), 29))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-TEST_P(DwarfForms, ref_sig8) {
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0x253e7b2b,
- (DwarfAttribute) 0xd708d908,
- dwarf2reader::DW_FORM_ref_sig8);
- info.D64(0xf72fa0cb6ddcf9d6ULL);
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x253e7b2b);
- EXPECT_CALL(handler, ProcessAttributeSignature(_, (DwarfAttribute) 0xd708d908,
- dwarf2reader::DW_FORM_ref_sig8,
- 0xf72fa0cb6ddcf9d6ULL))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam());
-}
-
-// A value passed to ProcessAttributeSignature is just an absolute number,
-// not an offset within the compilation unit as most of the other
-// DW_FORM_ref forms are. Check that the reader doesn't try to apply any
-// offset to the signature, by reading it from a compilation unit that does
-// not start at the beginning of the section.
-TEST_P(DwarfForms, ref_sig8_not_first) {
- info.Append(98, '*');
- StartSingleAttributeDIE(GetParam(), (DwarfTag) 0x253e7b2b,
- (DwarfAttribute) 0xd708d908,
- dwarf2reader::DW_FORM_ref_sig8);
- info.D64(0xf72fa0cb6ddcf9d6ULL);
- info.Finish();
-
- ExpectBeginCompilationUnit(GetParam(), (DwarfTag) 0x253e7b2b, 98);
- EXPECT_CALL(handler, ProcessAttributeSignature(_, (DwarfAttribute) 0xd708d908,
- dwarf2reader::DW_FORM_ref_sig8,
- 0xf72fa0cb6ddcf9d6ULL))
- .InSequence(s)
- .WillOnce(Return());
- ExpectEndCompilationUnit();
-
- ParseCompilationUnit(GetParam(), 98);
-}
-
-// Tests for the other attribute forms could go here.
-
-INSTANTIATE_TEST_CASE_P(
- HeaderVariants, DwarfForms,
- ::testing::Values(DwarfHeaderParams(kLittleEndian, 4, 2, 4),
- DwarfHeaderParams(kLittleEndian, 4, 2, 8),
- DwarfHeaderParams(kLittleEndian, 4, 3, 4),
- DwarfHeaderParams(kLittleEndian, 4, 3, 8),
- DwarfHeaderParams(kLittleEndian, 4, 4, 4),
- DwarfHeaderParams(kLittleEndian, 4, 4, 8),
- DwarfHeaderParams(kLittleEndian, 8, 2, 4),
- DwarfHeaderParams(kLittleEndian, 8, 2, 8),
- DwarfHeaderParams(kLittleEndian, 8, 3, 4),
- DwarfHeaderParams(kLittleEndian, 8, 3, 8),
- DwarfHeaderParams(kLittleEndian, 8, 4, 4),
- DwarfHeaderParams(kLittleEndian, 8, 4, 8),
- DwarfHeaderParams(kBigEndian, 4, 2, 4),
- DwarfHeaderParams(kBigEndian, 4, 2, 8),
- DwarfHeaderParams(kBigEndian, 4, 3, 4),
- DwarfHeaderParams(kBigEndian, 4, 3, 8),
- DwarfHeaderParams(kBigEndian, 4, 4, 4),
- DwarfHeaderParams(kBigEndian, 4, 4, 8),
- DwarfHeaderParams(kBigEndian, 8, 2, 4),
- DwarfHeaderParams(kBigEndian, 8, 2, 8),
- DwarfHeaderParams(kBigEndian, 8, 3, 4),
- DwarfHeaderParams(kBigEndian, 8, 3, 8),
- DwarfHeaderParams(kBigEndian, 8, 4, 4),
- DwarfHeaderParams(kBigEndian, 8, 4, 8)));
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_test_common.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_test_common.h
deleted file mode 100644
index e91de90610..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/dwarf2reader_test_common.h
+++ /dev/null
@@ -1,149 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf2reader_test_common.h: Define TestCompilationUnit and
-// TestAbbrevTable, classes for creating properly (and improperly)
-// formatted DWARF compilation unit data for unit tests.
-
-#ifndef COMMON_DWARF_DWARF2READER_TEST_COMMON_H__
-#define COMMON_DWARF_DWARF2READER_TEST_COMMON_H__
-
-#include "common/test_assembler.h"
-#include "common/dwarf/dwarf2enums.h"
-
-// A subclass of test_assembler::Section, specialized for constructing
-// DWARF compilation units.
-class TestCompilationUnit: public google_breakpad::test_assembler::Section {
- public:
- typedef dwarf2reader::DwarfTag DwarfTag;
- typedef dwarf2reader::DwarfAttribute DwarfAttribute;
- typedef dwarf2reader::DwarfForm DwarfForm;
- typedef google_breakpad::test_assembler::Label Label;
-
- // Set the section's DWARF format size (the 32-bit DWARF format or the
- // 64-bit DWARF format, for lengths and section offsets --- not the
- // address size) to format_size.
- void set_format_size(size_t format_size) {
- assert(format_size == 4 || format_size == 8);
- format_size_ = format_size;
- }
-
- // Append a DWARF section offset value, of the appropriate size for this
- // compilation unit.
- template<typename T>
- void SectionOffset(T offset) {
- if (format_size_ == 4)
- D32(offset);
- else
- D64(offset);
- }
-
- // Append a DWARF compilation unit header to the section, with the given
- // DWARF version, abbrev table offset, and address size.
- TestCompilationUnit &Header(int version, const Label &abbrev_offset,
- size_t address_size) {
- if (format_size_ == 4) {
- D32(length_);
- } else {
- D32(0xffffffff);
- D64(length_);
- }
- post_length_offset_ = Size();
- D16(version);
- SectionOffset(abbrev_offset);
- D8(address_size);
- return *this;
- }
-
- // Mark the end of this header's DIEs.
- TestCompilationUnit &Finish() {
- length_ = Size() - post_length_offset_;
- return *this;
- }
-
- private:
- // The DWARF format size for this compilation unit.
- size_t format_size_;
-
- // The offset of the point in the compilation unit header immediately
- // after the initial length field.
- uint64_t post_length_offset_;
-
- // The length of the compilation unit, not including the initial length field.
- Label length_;
-};
-
-// A subclass of test_assembler::Section specialized for constructing DWARF
-// abbreviation tables.
-class TestAbbrevTable: public google_breakpad::test_assembler::Section {
- public:
- typedef dwarf2reader::DwarfTag DwarfTag;
- typedef dwarf2reader::DwarfAttribute DwarfAttribute;
- typedef dwarf2reader::DwarfForm DwarfForm;
- typedef dwarf2reader::DwarfHasChild DwarfHasChild;
- typedef google_breakpad::test_assembler::Label Label;
-
- // Start a new abbreviation table entry for abbreviation code |code|,
- // encoding a DIE whose tag is |tag|, and which has children if and only
- // if |has_children| is true.
- TestAbbrevTable &Abbrev(int code, DwarfTag tag, DwarfHasChild has_children) {
- assert(code != 0);
- ULEB128(code);
- ULEB128(static_cast<unsigned>(tag));
- D8(static_cast<unsigned>(has_children));
- return *this;
- };
-
- // Add an attribute to the current abbreviation code whose name is |name|
- // and whose form is |form|.
- TestAbbrevTable &Attribute(DwarfAttribute name, DwarfForm form) {
- ULEB128(static_cast<unsigned>(name));
- ULEB128(static_cast<unsigned>(form));
- return *this;
- }
-
- // Finish the current abbreviation code.
- TestAbbrevTable &EndAbbrev() {
- ULEB128(0);
- ULEB128(0);
- return *this;
- }
-
- // Finish the current abbreviation table.
- TestAbbrevTable &EndTable() {
- ULEB128(0);
- return *this;
- }
-};
-
-#endif // COMMON_DWARF_DWARF2READER_TEST_COMMON_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.cc
deleted file mode 100644
index 4135a51a98..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.cc
+++ /dev/null
@@ -1,1273 +0,0 @@
-// Copyright 2005 Google Inc. All Rights Reserved.
-// Author: chatham@google.com (Andrew Chatham)
-// Author: satorux@google.com (Satoru Takabayashi)
-//
-// Code for reading in ELF files.
-//
-// For information on the ELF format, see
-// http://www.x86.org/ftp/manuals/tools/elf.pdf
-//
-// I also liked:
-// http://www.caldera.com/developers/gabi/1998-04-29/contents.html
-//
-// A note about types: When dealing with the file format, we use types
-// like Elf32_Word, but in the public interfaces we treat all
-// addresses as uint64. As a result, we should be able to symbolize
-// 64-bit binaries from a 32-bit process (which we don't do,
-// anyway). size_t should therefore be avoided, except where required
-// by things like mmap().
-//
-// Although most of this code can deal with arbitrary ELF files of
-// either word size, the public ElfReader interface only examines
-// files loaded into the current address space, which must all match
-// __WORDSIZE. This code cannot handle ELF files with a non-native
-// byte ordering.
-//
-// TODO(chatham): It would be nice if we could accomplish this task
-// without using malloc(), so we could use it as the process is dying.
-
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE // needed for pread()
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <string.h>
-
-#include <algorithm>
-#include <map>
-#include <string>
-#include <vector>
-// TODO(saugustine): Add support for compressed debug.
-// Also need to add configure tests for zlib.
-//#include "zlib.h"
-
-#include "third_party/musl/include/elf.h"
-#include "elf_reader.h"
-#include "common/using_std_string.h"
-
-// EM_AARCH64 is not defined by elf.h of GRTE v3 on x86.
-// TODO(dougkwan): Remove this when v17 is retired.
-#if !defined(EM_AARCH64)
-#define EM_AARCH64 183 /* ARM AARCH64 */
-#endif
-
-// Map Linux macros to their Apple equivalents.
-#if __APPLE__
-#ifndef __LITTLE_ENDIAN
-#define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
-#endif // __LITTLE_ENDIAN
-#ifndef __BIG_ENDIAN
-#define __BIG_ENDIAN __ORDER_BIG_ENDIAN__
-#endif // __BIG_ENDIAN
-#ifndef __BYTE_ORDER
-#define __BYTE_ORDER __BYTE_ORDER__
-#endif // __BYTE_ORDER
-#endif // __APPLE__
-
-// TODO(dthomson): Can be removed once all Java code is using the Google3
-// launcher. We need to avoid processing PLT functions as it causes memory
-// fragmentation in malloc, which is fixed in tcmalloc - and if the Google3
-// launcher is used the JVM will then use tcmalloc. b/13735638
-//DEFINE_bool(elfreader_process_dynsyms, true,
-// "Activate PLT function processing");
-
-using std::vector;
-
-namespace {
-
-// The lowest bit of an ARM symbol value is used to indicate a Thumb address.
-const int kARMThumbBitOffset = 0;
-
-// Converts an ARM Thumb symbol value to a true aligned address value.
-template <typename T>
-T AdjustARMThumbSymbolValue(const T& symbol_table_value) {
- return symbol_table_value & ~(1 << kARMThumbBitOffset);
-}
-
-// Names of PLT-related sections.
-const char kElfPLTRelSectionName[] = ".rel.plt"; // Use Rel struct.
-const char kElfPLTRelaSectionName[] = ".rela.plt"; // Use Rela struct.
-const char kElfPLTSectionName[] = ".plt";
-const char kElfDynSymSectionName[] = ".dynsym";
-
-const int kX86PLTCodeSize = 0x10; // Size of one x86 PLT function in bytes.
-const int kARMPLTCodeSize = 0xc;
-const int kAARCH64PLTCodeSize = 0x10;
-
-const int kX86PLT0Size = 0x10; // Size of the special PLT0 entry.
-const int kARMPLT0Size = 0x14;
-const int kAARCH64PLT0Size = 0x20;
-
-// Suffix for PLT functions when it needs to be explicitly identified as such.
-const char kPLTFunctionSuffix[] = "@plt";
-
-} // namespace
-
-namespace dwarf2reader {
-
-template <class ElfArch> class ElfReaderImpl;
-
-// 32-bit and 64-bit ELF files are processed exactly the same, except
-// for various field sizes. Elf32 and Elf64 encompass all of the
-// differences between the two formats, and all format-specific code
-// in this file is templated on one of them.
-class Elf32 {
- public:
- typedef Elf32_Ehdr Ehdr;
- typedef Elf32_Shdr Shdr;
- typedef Elf32_Phdr Phdr;
- typedef Elf32_Word Word;
- typedef Elf32_Sym Sym;
- typedef Elf32_Rel Rel;
- typedef Elf32_Rela Rela;
-
- // What should be in the EI_CLASS header.
- static const int kElfClass = ELFCLASS32;
-
- // Given a symbol pointer, return the binding type (eg STB_WEAK).
- static char Bind(const Elf32_Sym *sym) {
- return ELF32_ST_BIND(sym->st_info);
- }
- // Given a symbol pointer, return the symbol type (eg STT_FUNC).
- static char Type(const Elf32_Sym *sym) {
- return ELF32_ST_TYPE(sym->st_info);
- }
-
- // Extract the symbol index from the r_info field of a relocation.
- static int r_sym(const Elf32_Word r_info) {
- return ELF32_R_SYM(r_info);
- }
-};
-
-
-class Elf64 {
- public:
- typedef Elf64_Ehdr Ehdr;
- typedef Elf64_Shdr Shdr;
- typedef Elf64_Phdr Phdr;
- typedef Elf64_Word Word;
- typedef Elf64_Sym Sym;
- typedef Elf64_Rel Rel;
- typedef Elf64_Rela Rela;
-
- // What should be in the EI_CLASS header.
- static const int kElfClass = ELFCLASS64;
-
- static char Bind(const Elf64_Sym *sym) {
- return ELF64_ST_BIND(sym->st_info);
- }
- static char Type(const Elf64_Sym *sym) {
- return ELF64_ST_TYPE(sym->st_info);
- }
- static int r_sym(const Elf64_Xword r_info) {
- return ELF64_R_SYM(r_info);
- }
-};
-
-
-// ElfSectionReader mmaps a section of an ELF file ("section" is ELF
-// terminology). The ElfReaderImpl object providing the section header
-// must exist for the lifetime of this object.
-//
-// The motivation for mmaping individual sections of the file is that
-// many Google executables are large enough when unstripped that we
-// have to worry about running out of virtual address space.
-//
-// For compressed sections we have no choice but to allocate memory.
-template<class ElfArch>
-class ElfSectionReader {
- public:
- ElfSectionReader(const char *name, const string &path, int fd,
- const typename ElfArch::Shdr &section_header)
- : contents_aligned_(NULL),
- contents_(NULL),
- header_(section_header) {
- // Back up to the beginning of the page we're interested in.
- const size_t additional = header_.sh_offset % getpagesize();
- const size_t offset_aligned = header_.sh_offset - additional;
- section_size_ = header_.sh_size;
- size_aligned_ = section_size_ + additional;
- // If the section has been stripped or is empty, do not attempt
- // to process its contents.
- if (header_.sh_type == SHT_NOBITS || header_.sh_size == 0)
- return;
- contents_aligned_ = mmap(NULL, size_aligned_, PROT_READ, MAP_SHARED,
- fd, offset_aligned);
- // Set where the offset really should begin.
- contents_ = reinterpret_cast<char *>(contents_aligned_) +
- (header_.sh_offset - offset_aligned);
-
- // Check for and handle any compressed contents.
- //if (strncmp(name, ".zdebug_", strlen(".zdebug_")) == 0)
- // DecompressZlibContents();
- // TODO(saugustine): Add support for proposed elf-section flag
- // "SHF_COMPRESS".
- }
-
- ~ElfSectionReader() {
- if (contents_aligned_ != NULL)
- munmap(contents_aligned_, size_aligned_);
- else
- delete[] contents_;
- }
-
- // Return the section header for this section.
- typename ElfArch::Shdr const &header() const { return header_; }
-
- // Return memory at the given offset within this section.
- const char *GetOffset(typename ElfArch::Word bytes) const {
- return contents_ + bytes;
- }
-
- const char *contents() const { return contents_; }
- size_t section_size() const { return section_size_; }
-
- private:
- // page-aligned file contents
- void *contents_aligned_;
- // contents as usable by the client. For non-compressed sections,
- // pointer within contents_aligned_ to where the section data
- // begins; for compressed sections, pointer to the decompressed
- // data.
- char *contents_;
- // size of contents_aligned_
- size_t size_aligned_;
- // size of contents.
- size_t section_size_;
- const typename ElfArch::Shdr header_;
-};
-
-// An iterator over symbols in a given section. It handles walking
-// through the entries in the specified section and mapping symbol
-// entries to their names in the appropriate string table (in
-// another section).
-template<class ElfArch>
-class SymbolIterator {
- public:
- SymbolIterator(ElfReaderImpl<ElfArch> *reader,
- typename ElfArch::Word section_type)
- : symbol_section_(reader->GetSectionByType(section_type)),
- string_section_(NULL),
- num_symbols_in_section_(0),
- symbol_within_section_(0) {
-
- // If this section type doesn't exist, leave
- // num_symbols_in_section_ as zero, so this iterator is already
- // done().
- if (symbol_section_ != NULL) {
- num_symbols_in_section_ = symbol_section_->header().sh_size /
- symbol_section_->header().sh_entsize;
-
- // Symbol sections have sh_link set to the section number of
- // the string section containing the symbol names.
- string_section_ = reader->GetSection(symbol_section_->header().sh_link);
- }
- }
-
- // Return true iff we have passed all symbols in this section.
- bool done() const {
- return symbol_within_section_ >= num_symbols_in_section_;
- }
-
- // Advance to the next symbol in this section.
- // REQUIRES: !done()
- void Next() { ++symbol_within_section_; }
-
- // Return a pointer to the current symbol.
- // REQUIRES: !done()
- const typename ElfArch::Sym *GetSymbol() const {
- return reinterpret_cast<const typename ElfArch::Sym*>(
- symbol_section_->GetOffset(symbol_within_section_ *
- symbol_section_->header().sh_entsize));
- }
-
- // Return the name of the current symbol, NULL if it has none.
- // REQUIRES: !done()
- const char *GetSymbolName() const {
- int name_offset = GetSymbol()->st_name;
- if (name_offset == 0)
- return NULL;
- return string_section_->GetOffset(name_offset);
- }
-
- int GetCurrentSymbolIndex() const {
- return symbol_within_section_;
- }
-
- private:
- const ElfSectionReader<ElfArch> *const symbol_section_;
- const ElfSectionReader<ElfArch> *string_section_;
- int num_symbols_in_section_;
- int symbol_within_section_;
-};
-
-
-// Copied from strings/strutil.h. Per chatham,
-// this library should not depend on strings.
-
-static inline bool MyHasSuffixString(const string& str, const string& suffix) {
- int len = str.length();
- int suflen = suffix.length();
- return (suflen <= len) && (str.compare(len-suflen, suflen, suffix) == 0);
-}
-
-
-// ElfReader loads an ELF binary and can provide information about its
-// contents. It is most useful for matching addresses to function
-// names. It does not understand debugging formats (eg dwarf2), so it
-// can't print line numbers. It takes a path to an elf file and a
-// readable file descriptor for that file, which it does not assume
-// ownership of.
-template<class ElfArch>
-class ElfReaderImpl {
- public:
- explicit ElfReaderImpl(const string &path, int fd)
- : path_(path),
- fd_(fd),
- section_headers_(NULL),
- program_headers_(NULL),
- opd_section_(NULL),
- base_for_text_(0),
- plts_supported_(false),
- plt_code_size_(0),
- plt0_size_(0),
- visited_relocation_entries_(false) {
- string error;
- is_dwp_ = MyHasSuffixString(path, ".dwp");
- ParseHeaders(fd, path);
- // Currently we need some extra information for PowerPC64 binaries
- // including a way to read the .opd section for function descriptors and a
- // way to find the linked base for function symbols.
- if (header_.e_machine == EM_PPC64) {
- // "opd_section_" must always be checked for NULL before use.
- opd_section_ = GetSectionInfoByName(".opd", &opd_info_);
- for (unsigned int k = 0u; k < GetNumSections(); ++k) {
- const char *name = GetSectionName(section_headers_[k].sh_name);
- if (strncmp(name, ".text", strlen(".text")) == 0) {
- base_for_text_ =
- section_headers_[k].sh_addr - section_headers_[k].sh_offset;
- break;
- }
- }
- }
- // Turn on PLTs.
- if (header_.e_machine == EM_386 || header_.e_machine == EM_X86_64) {
- plt_code_size_ = kX86PLTCodeSize;
- plt0_size_ = kX86PLT0Size;
- plts_supported_ = true;
- } else if (header_.e_machine == EM_ARM) {
- plt_code_size_ = kARMPLTCodeSize;
- plt0_size_ = kARMPLT0Size;
- plts_supported_ = true;
- } else if (header_.e_machine == EM_AARCH64) {
- plt_code_size_ = kAARCH64PLTCodeSize;
- plt0_size_ = kAARCH64PLT0Size;
- plts_supported_ = true;
- }
- }
-
- ~ElfReaderImpl() {
- for (unsigned int i = 0u; i < sections_.size(); ++i)
- delete sections_[i];
- delete [] section_headers_;
- delete [] program_headers_;
- }
-
- // Examine the headers of the file and return whether the file looks
- // like an ELF file for this architecture. Takes an already-open
- // file descriptor for the candidate file, reading in the prologue
- // to see if the ELF file appears to match the current
- // architecture. If error is non-NULL, it will be set with a reason
- // in case of failure.
- static bool IsArchElfFile(int fd, string *error) {
- unsigned char header[EI_NIDENT];
- if (pread(fd, header, sizeof(header), 0) != sizeof(header)) {
- if (error != NULL) *error = "Could not read header";
- return false;
- }
-
- if (memcmp(header, ELFMAG, SELFMAG) != 0) {
- if (error != NULL) *error = "Missing ELF magic";
- return false;
- }
-
- if (header[EI_CLASS] != ElfArch::kElfClass) {
- if (error != NULL) *error = "Different word size";
- return false;
- }
-
- int endian = 0;
- if (header[EI_DATA] == ELFDATA2LSB)
- endian = __LITTLE_ENDIAN;
- else if (header[EI_DATA] == ELFDATA2MSB)
- endian = __BIG_ENDIAN;
- if (endian != __BYTE_ORDER) {
- if (error != NULL) *error = "Different byte order";
- return false;
- }
-
- return true;
- }
-
- // Return true if we can use this symbol in Address-to-Symbol map.
- bool CanUseSymbol(const char *name, const typename ElfArch::Sym *sym) {
- // For now we only save FUNC and NOTYPE symbols. For now we just
- // care about functions, but some functions written in assembler
- // don't have a proper ELF type attached to them, so we store
- // NOTYPE symbols as well. The remaining significant type is
- // OBJECT (eg global variables), which represent about 25% of
- // the symbols in a typical google3 binary.
- if (ElfArch::Type(sym) != STT_FUNC &&
- ElfArch::Type(sym) != STT_NOTYPE) {
- return false;
- }
-
- // Target specific filtering.
- switch (header_.e_machine) {
- case EM_AARCH64:
- case EM_ARM:
- // Filter out '$x' special local symbols used by tools
- return name[0] != '$' || ElfArch::Bind(sym) != STB_LOCAL;
- case EM_X86_64:
- // Filter out read-only constants like .LC123.
- return name[0] != '.' || ElfArch::Bind(sym) != STB_LOCAL;
- default:
- return true;
- }
- }
-
- // Iterate over the symbols in a section, either SHT_DYNSYM or
- // SHT_SYMTAB. Add all symbols to the given SymbolMap.
- /*
- void GetSymbolPositions(SymbolMap *symbols,
- typename ElfArch::Word section_type,
- uint64 mem_offset,
- uint64 file_offset) {
- // This map is used to filter out "nested" functions.
- // See comment below.
- AddrToSymMap addr_to_sym_map;
- for (SymbolIterator<ElfArch> it(this, section_type);
- !it.done(); it.Next()) {
- const char *name = it.GetSymbolName();
- if (name == NULL)
- continue;
- const typename ElfArch::Sym *sym = it.GetSymbol();
- if (CanUseSymbol(name, sym)) {
- const int sec = sym->st_shndx;
-
- // We don't support special section indices. The most common
- // is SHN_ABS, for absolute symbols used deep in the bowels of
- // glibc. Also ignore any undefined symbols.
- if (sec == SHN_UNDEF ||
- (sec >= SHN_LORESERVE && sec <= SHN_HIRESERVE)) {
- continue;
- }
-
- const typename ElfArch::Shdr& hdr = section_headers_[sec];
-
- // Adjust for difference between where we expected to mmap
- // this section, and where it was actually mmapped.
- const int64 expected_base = hdr.sh_addr - hdr.sh_offset;
- const int64 real_base = mem_offset - file_offset;
- const int64 adjust = real_base - expected_base;
-
- uint64 start = sym->st_value + adjust;
-
- // Adjust function symbols for PowerPC64 by dereferencing and adjusting
- // the function descriptor to get the function address.
- if (header_.e_machine == EM_PPC64 && ElfArch::Type(sym) == STT_FUNC) {
- const uint64 opd_addr =
- AdjustPPC64FunctionDescriptorSymbolValue(sym->st_value);
- // Only adjust the returned value if the function address was found.
- if (opd_addr != sym->st_value) {
- const int64 adjust_function_symbols =
- real_base - base_for_text_;
- start = opd_addr + adjust_function_symbols;
- }
- }
-
- addr_to_sym_map.push_back(std::make_pair(start, sym));
- }
- }
- std::sort(addr_to_sym_map.begin(), addr_to_sym_map.end(), &AddrToSymSorter);
- addr_to_sym_map.erase(std::unique(addr_to_sym_map.begin(),
- addr_to_sym_map.end(), &AddrToSymEquals),
- addr_to_sym_map.end());
-
- // Squeeze out any "nested functions".
- // Nested functions are not allowed in C, but libc plays tricks.
- //
- // For example, here is disassembly of /lib64/tls/libc-2.3.5.so:
- // 0x00000000000aa380 <read+0>: cmpl $0x0,0x2781b9(%rip)
- // 0x00000000000aa387 <read+7>: jne 0xaa39b <read+27>
- // 0x00000000000aa389 <__read_nocancel+0>: mov $0x0,%rax
- // 0x00000000000aa390 <__read_nocancel+7>: syscall
- // 0x00000000000aa392 <__read_nocancel+9>: cmp $0xfffffffffffff001,%rax
- // 0x00000000000aa398 <__read_nocancel+15>: jae 0xaa3ef <read+111>
- // 0x00000000000aa39a <__read_nocancel+17>: retq
- // 0x00000000000aa39b <read+27>: sub $0x28,%rsp
- // 0x00000000000aa39f <read+31>: mov %rdi,0x8(%rsp)
- // ...
- // Without removing __read_nocancel, symbolizer will return NULL
- // given e.g. 0xaa39f (because the lower bound is __read_nocancel,
- // but 0xaa39f is beyond its end.
- if (addr_to_sym_map.empty()) {
- return;
- }
- const ElfSectionReader<ElfArch> *const symbol_section =
- this->GetSectionByType(section_type);
- const ElfSectionReader<ElfArch> *const string_section =
- this->GetSection(symbol_section->header().sh_link);
-
- typename AddrToSymMap::iterator curr = addr_to_sym_map.begin();
- // Always insert the first symbol.
- symbols->AddSymbol(string_section->GetOffset(curr->second->st_name),
- curr->first, curr->second->st_size);
- typename AddrToSymMap::iterator prev = curr++;
- for (; curr != addr_to_sym_map.end(); ++curr) {
- const uint64 prev_addr = prev->first;
- const uint64 curr_addr = curr->first;
- const typename ElfArch::Sym *const prev_sym = prev->second;
- const typename ElfArch::Sym *const curr_sym = curr->second;
- if (prev_addr + prev_sym->st_size <= curr_addr ||
- // The next condition is true if two symbols overlap like this:
- //
- // Previous symbol |----------------------------|
- // Current symbol |-------------------------------|
- //
- // These symbols are not found in google3 codebase, but in
- // jdk1.6.0_01_gg1/jre/lib/i386/server/libjvm.so.
- //
- // 0619e040 00000046 t CardTableModRefBS::write_region_work()
- // 0619e070 00000046 t CardTableModRefBS::write_ref_array_work()
- //
- // We allow overlapped symbols rather than ignore these.
- // Due to the way SymbolMap::GetSymbolAtPosition() works,
- // lookup for any address in [curr_addr, curr_addr + its size)
- // (e.g. 0619e071) will produce the current symbol,
- // which is the desired outcome.
- prev_addr + prev_sym->st_size < curr_addr + curr_sym->st_size) {
- const char *name = string_section->GetOffset(curr_sym->st_name);
- symbols->AddSymbol(name, curr_addr, curr_sym->st_size);
- prev = curr;
- } else {
- // Current symbol is "nested" inside previous one like this:
- //
- // Previous symbol |----------------------------|
- // Current symbol |---------------------|
- //
- // This happens within glibc, e.g. __read_nocancel is nested
- // "inside" __read. Ignore "inner" symbol.
- //DCHECK_LE(curr_addr + curr_sym->st_size,
- // prev_addr + prev_sym->st_size);
- ;
- }
- }
- }
-*/
-
- void VisitSymbols(typename ElfArch::Word section_type,
- ElfReader::SymbolSink *sink) {
- VisitSymbols(section_type, sink, -1, -1, false);
- }
-
- void VisitSymbols(typename ElfArch::Word section_type,
- ElfReader::SymbolSink *sink,
- int symbol_binding,
- int symbol_type,
- bool get_raw_symbol_values) {
- for (SymbolIterator<ElfArch> it(this, section_type);
- !it.done(); it.Next()) {
- const char *name = it.GetSymbolName();
- if (!name) continue;
- const typename ElfArch::Sym *sym = it.GetSymbol();
- if ((symbol_binding < 0 || ElfArch::Bind(sym) == symbol_binding) &&
- (symbol_type < 0 || ElfArch::Type(sym) == symbol_type)) {
- typename ElfArch::Sym symbol = *sym;
- // Add a PLT symbol in addition to the main undefined symbol.
- // Only do this for SHT_DYNSYM, because PLT symbols are dynamic.
- int symbol_index = it.GetCurrentSymbolIndex();
- // TODO(dthomson): Can be removed once all Java code is using the
- // Google3 launcher.
- if (section_type == SHT_DYNSYM &&
- static_cast<unsigned int>(symbol_index) < symbols_plt_offsets_.size() &&
- symbols_plt_offsets_[symbol_index] != 0) {
- string plt_name = string(name) + kPLTFunctionSuffix;
- if (plt_function_names_[symbol_index].empty()) {
- plt_function_names_[symbol_index] = plt_name;
- } else if (plt_function_names_[symbol_index] != plt_name) {
- ;
- }
- sink->AddSymbol(plt_function_names_[symbol_index].c_str(),
- symbols_plt_offsets_[it.GetCurrentSymbolIndex()],
- plt_code_size_);
- }
- if (!get_raw_symbol_values)
- AdjustSymbolValue(&symbol);
- sink->AddSymbol(name, symbol.st_value, symbol.st_size);
- }
- }
- }
-
- void VisitRelocationEntries() {
- if (visited_relocation_entries_) {
- return;
- }
- visited_relocation_entries_ = true;
-
- if (!plts_supported_) {
- return;
- }
- // First determine if PLTs exist. If not, then there is nothing to do.
- ElfReader::SectionInfo plt_section_info;
- const char* plt_section =
- GetSectionInfoByName(kElfPLTSectionName, &plt_section_info);
- if (!plt_section) {
- return;
- }
- if (plt_section_info.size == 0) {
- return;
- }
-
- // The PLTs could be referenced by either a Rel or Rela (Rel with Addend)
- // section.
- ElfReader::SectionInfo rel_section_info;
- ElfReader::SectionInfo rela_section_info;
- const char* rel_section =
- GetSectionInfoByName(kElfPLTRelSectionName, &rel_section_info);
- const char* rela_section =
- GetSectionInfoByName(kElfPLTRelaSectionName, &rela_section_info);
-
- const typename ElfArch::Rel* rel =
- reinterpret_cast<const typename ElfArch::Rel*>(rel_section);
- const typename ElfArch::Rela* rela =
- reinterpret_cast<const typename ElfArch::Rela*>(rela_section);
-
- if (!rel_section && !rela_section) {
- return;
- }
-
- // Use either Rel or Rela section, depending on which one exists.
- size_t section_size = rel_section ? rel_section_info.size
- : rela_section_info.size;
- size_t entry_size = rel_section ? sizeof(typename ElfArch::Rel)
- : sizeof(typename ElfArch::Rela);
-
- // Determine the number of entries in the dynamic symbol table.
- ElfReader::SectionInfo dynsym_section_info;
- const char* dynsym_section =
- GetSectionInfoByName(kElfDynSymSectionName, &dynsym_section_info);
- // The dynsym section might not exist, or it might be empty. In either case
- // there is nothing to be done so return.
- if (!dynsym_section || dynsym_section_info.size == 0) {
- return;
- }
- size_t num_dynamic_symbols =
- dynsym_section_info.size / dynsym_section_info.entsize;
- symbols_plt_offsets_.resize(num_dynamic_symbols, 0);
-
- // TODO(dthomson): Can be removed once all Java code is using the
- // Google3 launcher.
- // Make storage room for PLT function name strings.
- plt_function_names_.resize(num_dynamic_symbols);
-
- for (size_t i = 0; i < section_size / entry_size; ++i) {
- // Determine symbol index from the |r_info| field.
- int sym_index = ElfArch::r_sym(rel_section ? rel[i].r_info
- : rela[i].r_info);
- if (static_cast<unsigned int>(sym_index) >= symbols_plt_offsets_.size()) {
- continue;
- }
- symbols_plt_offsets_[sym_index] =
- plt_section_info.addr + plt0_size_ + i * plt_code_size_;
- }
- }
-
- // Return an ElfSectionReader for the first section of the given
- // type by iterating through all section headers. Returns NULL if
- // the section type is not found.
- const ElfSectionReader<ElfArch> *GetSectionByType(
- typename ElfArch::Word section_type) {
- for (unsigned int k = 0u; k < GetNumSections(); ++k) {
- if (section_headers_[k].sh_type == section_type) {
- return GetSection(k);
- }
- }
- return NULL;
- }
-
- // Return the name of section "shndx". Returns NULL if the section
- // is not found.
- const char *GetSectionNameByIndex(int shndx) {
- return GetSectionName(section_headers_[shndx].sh_name);
- }
-
- // Return a pointer to section "shndx", and store the size in
- // "size". Returns NULL if the section is not found.
- const char *GetSectionContentsByIndex(int shndx, size_t *size) {
- const ElfSectionReader<ElfArch> *section = GetSection(shndx);
- if (section != NULL) {
- *size = section->section_size();
- return section->contents();
- }
- return NULL;
- }
-
- // Return a pointer to the first section of the given name by
- // iterating through all section headers, and store the size in
- // "size". Returns NULL if the section name is not found.
- const char *GetSectionContentsByName(const string &section_name,
- size_t *size) {
- for (unsigned int k = 0u; k < GetNumSections(); ++k) {
- // When searching for sections in a .dwp file, the sections
- // we're looking for will always be at the end of the section
- // table, so reverse the direction of iteration.
- int shndx = is_dwp_ ? GetNumSections() - k - 1 : k;
- const char *name = GetSectionName(section_headers_[shndx].sh_name);
- if (name != NULL && ElfReader::SectionNamesMatch(section_name, name)) {
- const ElfSectionReader<ElfArch> *section = GetSection(shndx);
- if (section == NULL) {
- return NULL;
- } else {
- *size = section->section_size();
- return section->contents();
- }
- }
- }
- return NULL;
- }
-
- // This is like GetSectionContentsByName() but it returns a lot of extra
- // information about the section.
- const char *GetSectionInfoByName(const string &section_name,
- ElfReader::SectionInfo *info) {
- for (unsigned int k = 0u; k < GetNumSections(); ++k) {
- // When searching for sections in a .dwp file, the sections
- // we're looking for will always be at the end of the section
- // table, so reverse the direction of iteration.
- int shndx = is_dwp_ ? GetNumSections() - k - 1 : k;
- const char *name = GetSectionName(section_headers_[shndx].sh_name);
- if (name != NULL && ElfReader::SectionNamesMatch(section_name, name)) {
- const ElfSectionReader<ElfArch> *section = GetSection(shndx);
- if (section == NULL) {
- return NULL;
- } else {
- info->type = section->header().sh_type;
- info->flags = section->header().sh_flags;
- info->addr = section->header().sh_addr;
- info->offset = section->header().sh_offset;
- info->size = section->header().sh_size;
- info->link = section->header().sh_link;
- info->info = section->header().sh_info;
- info->addralign = section->header().sh_addralign;
- info->entsize = section->header().sh_entsize;
- return section->contents();
- }
- }
- }
- return NULL;
- }
-
- // p_vaddr of the first PT_LOAD segment (if any), or 0 if no PT_LOAD
- // segments are present. This is the address an ELF image was linked
- // (by static linker) to be loaded at. Usually (but not always) 0 for
- // shared libraries and position-independent executables.
- uint64 VaddrOfFirstLoadSegment() const {
- // Relocatable objects (of type ET_REL) do not have LOAD segments.
- if (header_.e_type == ET_REL) {
- return 0;
- }
- for (int i = 0; i < GetNumProgramHeaders(); ++i) {
- if (program_headers_[i].p_type == PT_LOAD) {
- return program_headers_[i].p_vaddr;
- }
- }
- return 0;
- }
-
- // According to the LSB ("ELF special sections"), sections with debug
- // info are prefixed by ".debug". The names are not specified, but they
- // look like ".debug_line", ".debug_info", etc.
- bool HasDebugSections() {
- // Debug sections are likely to be near the end, so reverse the
- // direction of iteration.
- for (int k = GetNumSections() - 1; k >= 0; --k) {
- const char *name = GetSectionName(section_headers_[k].sh_name);
- if (strncmp(name, ".debug", strlen(".debug")) == 0) return true;
- if (strncmp(name, ".zdebug", strlen(".zdebug")) == 0) return true;
- }
- return false;
- }
-
- bool IsDynamicSharedObject() const {
- return header_.e_type == ET_DYN;
- }
-
- // Return the number of sections.
- uint64_t GetNumSections() const {
- if (HasManySections())
- return first_section_header_.sh_size;
- return header_.e_shnum;
- }
-
- private:
- typedef vector<pair<uint64, const typename ElfArch::Sym *> > AddrToSymMap;
-
- static bool AddrToSymSorter(const typename AddrToSymMap::value_type& lhs,
- const typename AddrToSymMap::value_type& rhs) {
- return lhs.first < rhs.first;
- }
-
- static bool AddrToSymEquals(const typename AddrToSymMap::value_type& lhs,
- const typename AddrToSymMap::value_type& rhs) {
- return lhs.first == rhs.first;
- }
-
- // Does this ELF file have too many sections to fit in the program header?
- bool HasManySections() const {
- return header_.e_shnum == SHN_UNDEF;
- }
-
- // Return the number of program headers.
- int GetNumProgramHeaders() const {
- if (HasManySections() && header_.e_phnum == 0xffff &&
- first_section_header_.sh_info != 0)
- return first_section_header_.sh_info;
- return header_.e_phnum;
- }
-
- // Return the index of the string table.
- int GetStringTableIndex() const {
- if (HasManySections()) {
- if (header_.e_shstrndx == 0xffff)
- return first_section_header_.sh_link;
- else if (header_.e_shstrndx >= GetNumSections())
- return 0;
- }
- return header_.e_shstrndx;
- }
-
- // Given an offset into the section header string table, return the
- // section name.
- const char *GetSectionName(typename ElfArch::Word sh_name) {
- const ElfSectionReader<ElfArch> *shstrtab =
- GetSection(GetStringTableIndex());
- if (shstrtab != NULL) {
- return shstrtab->GetOffset(sh_name);
- }
- return NULL;
- }
-
- // Return an ElfSectionReader for the given section. The reader will
- // be freed when this object is destroyed.
- const ElfSectionReader<ElfArch> *GetSection(int num) {
- const char *name;
- // Hard-coding the name for the section-name string table prevents
- // infinite recursion.
- if (num == GetStringTableIndex())
- name = ".shstrtab";
- else
- name = GetSectionNameByIndex(num);
- ElfSectionReader<ElfArch> *& reader = sections_[num];
- if (reader == NULL)
- reader = new ElfSectionReader<ElfArch>(name, path_, fd_,
- section_headers_[num]);
- return reader;
- }
-
- // Parse out the overall header information from the file and assert
- // that it looks sane. This contains information like the magic
- // number and target architecture.
- bool ParseHeaders(int fd, const string &path) {
- // Read in the global ELF header.
- if (pread(fd, &header_, sizeof(header_), 0) != sizeof(header_)) {
- return false;
- }
-
- // Must be an executable, dynamic shared object or relocatable object
- if (header_.e_type != ET_EXEC &&
- header_.e_type != ET_DYN &&
- header_.e_type != ET_REL) {
- return false;
- }
- // Need a section header.
- if (header_.e_shoff == 0) {
- return false;
- }
-
- if (header_.e_shnum == SHN_UNDEF) {
- // The number of sections in the program header is only a 16-bit value. In
- // the event of overflow (greater than SHN_LORESERVE sections), e_shnum
- // will read SHN_UNDEF and the true number of section header table entries
- // is found in the sh_size field of the first section header.
- // See: http://www.sco.com/developers/gabi/2003-12-17/ch4.sheader.html
- if (pread(fd, &first_section_header_, sizeof(first_section_header_),
- header_.e_shoff) != sizeof(first_section_header_)) {
- return false;
- }
- }
-
- // Dynamically allocate enough space to store the section headers
- // and read them out of the file.
- const int section_headers_size =
- GetNumSections() * sizeof(*section_headers_);
- section_headers_ = new typename ElfArch::Shdr[section_headers_size];
- if (pread(fd, section_headers_, section_headers_size, header_.e_shoff) !=
- section_headers_size) {
- return false;
- }
-
- // Dynamically allocate enough space to store the program headers
- // and read them out of the file.
- //const int program_headers_size =
- // GetNumProgramHeaders() * sizeof(*program_headers_);
- program_headers_ = new typename ElfArch::Phdr[GetNumProgramHeaders()];
-
- // Presize the sections array for efficiency.
- sections_.resize(GetNumSections(), NULL);
- return true;
- }
-
- // Given the "value" of a function descriptor return the address of the
- // function (i.e. the dereferenced value). Otherwise return "value".
- uint64 AdjustPPC64FunctionDescriptorSymbolValue(uint64 value) {
- if (opd_section_ != NULL &&
- opd_info_.addr <= value &&
- value < opd_info_.addr + opd_info_.size) {
- uint64 offset = value - opd_info_.addr;
- return (*reinterpret_cast<const uint64*>(opd_section_ + offset));
- }
- return value;
- }
-
- void AdjustSymbolValue(typename ElfArch::Sym* sym) {
- switch (header_.e_machine) {
- case EM_ARM:
- // For ARM architecture, if the LSB of the function symbol offset is set,
- // it indicates a Thumb function. This bit should not be taken literally.
- // Clear it.
- if (ElfArch::Type(sym) == STT_FUNC)
- sym->st_value = AdjustARMThumbSymbolValue(sym->st_value);
- break;
- case EM_386:
- // No adjustment needed for Intel x86 architecture. However, explicitly
- // define this case as we use it quite often.
- break;
- case EM_PPC64:
- // PowerPC64 currently has function descriptors as part of the ABI.
- // Function symbols need to be adjusted accordingly.
- if (ElfArch::Type(sym) == STT_FUNC)
- sym->st_value = AdjustPPC64FunctionDescriptorSymbolValue(sym->st_value);
- break;
- default:
- break;
- }
- }
-
- friend class SymbolIterator<ElfArch>;
-
- // The file we're reading.
- const string path_;
- // Open file descriptor for path_. Not owned by this object.
- const int fd_;
-
- // The global header of the ELF file.
- typename ElfArch::Ehdr header_;
-
- // The header of the first section. This may be used to supplement the ELF
- // file header.
- typename ElfArch::Shdr first_section_header_;
-
- // Array of GetNumSections() section headers, allocated when we read
- // in the global header.
- typename ElfArch::Shdr *section_headers_;
-
- // Array of GetNumProgramHeaders() program headers, allocated when we read
- // in the global header.
- typename ElfArch::Phdr *program_headers_;
-
- // An array of pointers to ElfSectionReaders. Sections are
- // mmaped as they're needed and not released until this object is
- // destroyed.
- vector<ElfSectionReader<ElfArch>*> sections_;
-
- // For PowerPC64 we need to keep track of function descriptors when looking up
- // values for funtion symbols values. Function descriptors are kept in the
- // .opd section and are dereferenced to find the function address.
- ElfReader::SectionInfo opd_info_;
- const char *opd_section_; // Must be checked for NULL before use.
- int64 base_for_text_;
-
- // Read PLT-related sections for the current architecture.
- bool plts_supported_;
- // Code size of each PLT function for the current architecture.
- size_t plt_code_size_;
- // Size of the special first entry in the .plt section that calls the runtime
- // loader resolution routine, and that all other entries jump to when doing
- // lazy symbol binding.
- size_t plt0_size_;
-
- // Maps a dynamic symbol index to a PLT offset.
- // The vector entry index is the dynamic symbol index.
- std::vector<uint64> symbols_plt_offsets_;
-
- // Container for PLT function name strings. These strings are passed by
- // reference to SymbolSink::AddSymbol() so they need to be stored somewhere.
- std::vector<string> plt_function_names_;
-
- bool visited_relocation_entries_;
-
- // True if this is a .dwp file.
- bool is_dwp_;
-};
-
-ElfReader::ElfReader(const string &path)
- : path_(path), fd_(-1), impl32_(NULL), impl64_(NULL) {
- // linux 2.6.XX kernel can show deleted files like this:
- // /var/run/nscd/dbYLJYaE (deleted)
- // and the kernel-supplied vdso and vsyscall mappings like this:
- // [vdso]
- // [vsyscall]
- if (MyHasSuffixString(path, " (deleted)"))
- return;
- if (path == "[vdso]")
- return;
- if (path == "[vsyscall]")
- return;
-
- fd_ = open(path.c_str(), O_RDONLY);
-}
-
-ElfReader::~ElfReader() {
- if (fd_ != -1)
- close(fd_);
- if (impl32_ != NULL)
- delete impl32_;
- if (impl64_ != NULL)
- delete impl64_;
-}
-
-
-// The only word-size specific part of this file is IsNativeElfFile().
-#if __WORDSIZE == 32
-#define NATIVE_ELF_ARCH Elf32
-#elif __WORDSIZE == 64
-#define NATIVE_ELF_ARCH Elf64
-#else
-#error "Invalid word size"
-#endif
-
-template <typename ElfArch>
-static bool IsElfFile(const int fd, const string &path) {
- if (fd < 0)
- return false;
- if (!ElfReaderImpl<ElfArch>::IsArchElfFile(fd, NULL)) {
- // No error message here. IsElfFile gets called many times.
- return false;
- }
- return true;
-}
-
-bool ElfReader::IsNativeElfFile() const {
- return IsElfFile<NATIVE_ELF_ARCH>(fd_, path_);
-}
-
-bool ElfReader::IsElf32File() const {
- return IsElfFile<Elf32>(fd_, path_);
-}
-
-bool ElfReader::IsElf64File() const {
- return IsElfFile<Elf64>(fd_, path_);
-}
-
-/*
-void ElfReader::AddSymbols(SymbolMap *symbols,
- uint64 mem_offset, uint64 file_offset,
- uint64 length) {
- if (fd_ < 0)
- return;
- // TODO(chatham): Actually use the information about file offset and
- // the length of the mapped section. On some machines the data
- // section gets mapped as executable, and we'll end up reading the
- // file twice and getting some of the offsets wrong.
- if (IsElf32File()) {
- GetImpl32()->GetSymbolPositions(symbols, SHT_SYMTAB,
- mem_offset, file_offset);
- GetImpl32()->GetSymbolPositions(symbols, SHT_DYNSYM,
- mem_offset, file_offset);
- } else if (IsElf64File()) {
- GetImpl64()->GetSymbolPositions(symbols, SHT_SYMTAB,
- mem_offset, file_offset);
- GetImpl64()->GetSymbolPositions(symbols, SHT_DYNSYM,
- mem_offset, file_offset);
- }
-}
-*/
-
-void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink) {
- VisitSymbols(sink, -1, -1);
-}
-
-void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink,
- int symbol_binding,
- int symbol_type) {
- VisitSymbols(sink, symbol_binding, symbol_type, false);
-}
-
-void ElfReader::VisitSymbols(ElfReader::SymbolSink *sink,
- int symbol_binding,
- int symbol_type,
- bool get_raw_symbol_values) {
- if (IsElf32File()) {
- GetImpl32()->VisitRelocationEntries();
- GetImpl32()->VisitSymbols(SHT_SYMTAB, sink, symbol_binding, symbol_type,
- get_raw_symbol_values);
- GetImpl32()->VisitSymbols(SHT_DYNSYM, sink, symbol_binding, symbol_type,
- get_raw_symbol_values);
- } else if (IsElf64File()) {
- GetImpl64()->VisitRelocationEntries();
- GetImpl64()->VisitSymbols(SHT_SYMTAB, sink, symbol_binding, symbol_type,
- get_raw_symbol_values);
- GetImpl64()->VisitSymbols(SHT_DYNSYM, sink, symbol_binding, symbol_type,
- get_raw_symbol_values);
- }
-}
-
-uint64 ElfReader::VaddrOfFirstLoadSegment() {
- if (IsElf32File()) {
- return GetImpl32()->VaddrOfFirstLoadSegment();
- } else if (IsElf64File()) {
- return GetImpl64()->VaddrOfFirstLoadSegment();
- } else {
- return 0;
- }
-}
-
-const char *ElfReader::GetSectionName(int shndx) {
- if (shndx < 0 || static_cast<unsigned int>(shndx) >= GetNumSections()) return NULL;
- if (IsElf32File()) {
- return GetImpl32()->GetSectionNameByIndex(shndx);
- } else if (IsElf64File()) {
- return GetImpl64()->GetSectionNameByIndex(shndx);
- } else {
- return NULL;
- }
-}
-
-uint64 ElfReader::GetNumSections() {
- if (IsElf32File()) {
- return GetImpl32()->GetNumSections();
- } else if (IsElf64File()) {
- return GetImpl64()->GetNumSections();
- } else {
- return 0;
- }
-}
-
-const char *ElfReader::GetSectionByIndex(int shndx, size_t *size) {
- if (IsElf32File()) {
- return GetImpl32()->GetSectionContentsByIndex(shndx, size);
- } else if (IsElf64File()) {
- return GetImpl64()->GetSectionContentsByIndex(shndx, size);
- } else {
- return NULL;
- }
-}
-
-const char *ElfReader::GetSectionByName(const string &section_name,
- size_t *size) {
- if (IsElf32File()) {
- return GetImpl32()->GetSectionContentsByName(section_name, size);
- } else if (IsElf64File()) {
- return GetImpl64()->GetSectionContentsByName(section_name, size);
- } else {
- return NULL;
- }
-}
-
-const char *ElfReader::GetSectionInfoByName(const string &section_name,
- SectionInfo *info) {
- if (IsElf32File()) {
- return GetImpl32()->GetSectionInfoByName(section_name, info);
- } else if (IsElf64File()) {
- return GetImpl64()->GetSectionInfoByName(section_name, info);
- } else {
- return NULL;
- }
-}
-
-bool ElfReader::SectionNamesMatch(const string &name, const string &sh_name) {
- if ((name.find(".debug_", 0) == 0) && (sh_name.find(".zdebug_", 0) == 0)) {
- const string name_suffix(name, strlen(".debug_"));
- const string sh_name_suffix(sh_name, strlen(".zdebug_"));
- return name_suffix == sh_name_suffix;
- }
- return name == sh_name;
-}
-
-bool ElfReader::IsDynamicSharedObject() {
- if (IsElf32File()) {
- return GetImpl32()->IsDynamicSharedObject();
- } else if (IsElf64File()) {
- return GetImpl64()->IsDynamicSharedObject();
- } else {
- return false;
- }
-}
-
-ElfReaderImpl<Elf32> *ElfReader::GetImpl32() {
- if (impl32_ == NULL) {
- impl32_ = new ElfReaderImpl<Elf32>(path_, fd_);
- }
- return impl32_;
-}
-
-ElfReaderImpl<Elf64> *ElfReader::GetImpl64() {
- if (impl64_ == NULL) {
- impl64_ = new ElfReaderImpl<Elf64>(path_, fd_);
- }
- return impl64_;
-}
-
-// Return true if file is an ELF binary of ElfArch, with unstripped
-// debug info (debug_only=true) or symbol table (debug_only=false).
-// Otherwise, return false.
-template <typename ElfArch>
-static bool IsNonStrippedELFBinaryImpl(const string &path, const int fd,
- bool debug_only) {
- if (!ElfReaderImpl<ElfArch>::IsArchElfFile(fd, NULL)) return false;
- ElfReaderImpl<ElfArch> elf_reader(path, fd);
- return debug_only ?
- elf_reader.HasDebugSections()
- : (elf_reader.GetSectionByType(SHT_SYMTAB) != NULL);
-}
-
-// Helper for the IsNon[Debug]StrippedELFBinary functions.
-static bool IsNonStrippedELFBinaryHelper(const string &path,
- bool debug_only) {
- const int fd = open(path.c_str(), O_RDONLY);
- if (fd == -1) {
- return false;
- }
-
- if (IsNonStrippedELFBinaryImpl<Elf32>(path, fd, debug_only) ||
- IsNonStrippedELFBinaryImpl<Elf64>(path, fd, debug_only)) {
- close(fd);
- return true;
- }
- close(fd);
- return false;
-}
-
-bool ElfReader::IsNonStrippedELFBinary(const string &path) {
- return IsNonStrippedELFBinaryHelper(path, false);
-}
-
-bool ElfReader::IsNonDebugStrippedELFBinary(const string &path) {
- return IsNonStrippedELFBinaryHelper(path, true);
-}
-} // namespace dwarf2reader
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.h
deleted file mode 100644
index 07477341fd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/elf_reader.h
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright 2005 Google Inc. All Rights Reserved.
-// Author: chatham@google.com (Andrew Chatham)
-// Author: satorux@google.com (Satoru Takabayashi)
-//
-// ElfReader handles reading in ELF. It can extract symbols from the
-// current process, which may be used to symbolize stack traces
-// without having to make a potentially dangerous call to fork().
-//
-// ElfReader dynamically allocates memory, so it is not appropriate to
-// use once the address space might be corrupted, such as during
-// process death.
-//
-// ElfReader supports both 32-bit and 64-bit ELF binaries.
-
-#ifndef COMMON_DWARF_ELF_READER_H__
-#define COMMON_DWARF_ELF_READER_H__
-
-#include <string>
-#include <vector>
-
-#include "common/dwarf/types.h"
-
-using std::string;
-using std::vector;
-using std::pair;
-
-namespace dwarf2reader {
-
-class SymbolMap;
-class Elf32;
-class Elf64;
-template<typename ElfArch>
-class ElfReaderImpl;
-
-class ElfReader {
- public:
- explicit ElfReader(const string &path);
- ~ElfReader();
-
- // Parse the ELF prologue of this file and return whether it was
- // successfully parsed and matches the word size and byte order of
- // the current process.
- bool IsNativeElfFile() const;
-
- // Similar to IsNativeElfFile but checks if it's a 32-bit ELF file.
- bool IsElf32File() const;
-
- // Similar to IsNativeElfFile but checks if it's a 64-bit ELF file.
- bool IsElf64File() const;
-
- // Checks if it's an ELF file of type ET_DYN (shared object file).
- bool IsDynamicSharedObject();
-
- // Add symbols in the given ELF file into the provided SymbolMap,
- // assuming that the file has been loaded into the specified
- // offset.
- //
- // The remaining arguments are typically taken from a
- // ProcMapsIterator (base/sysinfo.h) and describe which portions of
- // the ELF file are mapped into which parts of memory:
- //
- // mem_offset - position at which the segment is mapped into memory
- // file_offset - offset in the file where the mapping begins
- // length - length of the mapped segment
- void AddSymbols(SymbolMap *symbols,
- uint64 mem_offset, uint64 file_offset,
- uint64 length);
-
- class SymbolSink {
- public:
- virtual ~SymbolSink() {}
- virtual void AddSymbol(const char *name, uint64 address, uint64 size) = 0;
- };
-
- // Like AddSymbols above, but with no address correction.
- // Processes any SHT_SYMTAB section, followed by any SHT_DYNSYM section.
- void VisitSymbols(SymbolSink *sink);
-
- // Like VisitSymbols above, but for a specific symbol binding/type.
- // A negative value for the binding and type parameters means any
- // binding or type.
- void VisitSymbols(SymbolSink *sink, int symbol_binding, int symbol_type);
-
- // Like VisitSymbols above but can optionally export raw symbol values instead
- // of adjusted ones.
- void VisitSymbols(SymbolSink *sink, int symbol_binding, int symbol_type,
- bool get_raw_symbol_values);
-
- // p_vaddr of the first PT_LOAD segment (if any), or 0 if no PT_LOAD
- // segments are present. This is the address an ELF image was linked
- // (by static linker) to be loaded at. Usually (but not always) 0 for
- // shared libraries and position-independent executables.
- uint64 VaddrOfFirstLoadSegment();
-
- // Return the name of section "shndx". Returns NULL if the section
- // is not found.
- const char *GetSectionName(int shndx);
-
- // Return the number of sections in the given ELF file.
- uint64 GetNumSections();
-
- // Get section "shndx" from the given ELF file. On success, return
- // the pointer to the section and store the size in "size".
- // On error, return NULL. The returned section data is only valid
- // until the ElfReader gets destroyed.
- const char *GetSectionByIndex(int shndx, size_t *size);
-
- // Get section with "section_name" (ex. ".text", ".symtab") in the
- // given ELF file. On success, return the pointer to the section
- // and store the size in "size". On error, return NULL. The
- // returned section data is only valid until the ElfReader gets
- // destroyed.
- const char *GetSectionByName(const string &section_name, size_t *size);
-
- // This is like GetSectionByName() but it returns a lot of extra information
- // about the section. The SectionInfo structure is almost identical to
- // the typedef struct Elf64_Shdr defined in <elf.h>, but is redefined
- // here so that the many short macro names in <elf.h> don't have to be
- // added to our already cluttered namespace.
- struct SectionInfo {
- uint32 type; // Section type (SHT_xxx constant from elf.h).
- uint64 flags; // Section flags (SHF_xxx constants from elf.h).
- uint64 addr; // Section virtual address at execution.
- uint64 offset; // Section file offset.
- uint64 size; // Section size in bytes.
- uint32 link; // Link to another section.
- uint32 info; // Additional section information.
- uint64 addralign; // Section alignment.
- uint64 entsize; // Entry size if section holds a table.
- };
- const char *GetSectionInfoByName(const string &section_name,
- SectionInfo *info);
-
- // Check if "path" is an ELF binary that has not been stripped of symbol
- // tables. This function supports both 32-bit and 64-bit ELF binaries.
- static bool IsNonStrippedELFBinary(const string &path);
-
- // Check if "path" is an ELF binary that has not been stripped of debug
- // info. Unlike IsNonStrippedELFBinary, this function will return
- // false for binaries passed through "strip -S".
- static bool IsNonDebugStrippedELFBinary(const string &path);
-
- // Match a requested section name with the section name as it
- // appears in the elf-file, adjusting for compressed debug section
- // names. For example, returns true if name == ".debug_abbrev" and
- // sh_name == ".zdebug_abbrev"
- static bool SectionNamesMatch(const string &name, const string &sh_name);
-
- private:
- // Lazily initialize impl32_ and return it.
- ElfReaderImpl<Elf32> *GetImpl32();
- // Ditto for impl64_.
- ElfReaderImpl<Elf64> *GetImpl64();
-
- // Path of the file we're reading.
- const string path_;
- // Read-only file descriptor for the file. May be -1 if there was an
- // error during open.
- int fd_;
- ElfReaderImpl<Elf32> *impl32_;
- ElfReaderImpl<Elf64> *impl64_;
-};
-
-} // namespace dwarf2reader
-
-#endif // COMMON_DWARF_ELF_READER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc
deleted file mode 100644
index 55a255eda6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.cc
+++ /dev/null
@@ -1,231 +0,0 @@
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This is a client for the dwarf2reader to extract function and line
-// information from the debug info.
-
-#include <assert.h>
-#include <limits.h>
-#include <stdio.h>
-
-#include <map>
-#include <queue>
-#include <vector>
-
-#include "common/dwarf/functioninfo.h"
-#include "common/dwarf/bytereader.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::scoped_ptr;
-
-namespace dwarf2reader {
-
-CULineInfoHandler::CULineInfoHandler(std::vector<SourceFileInfo>* files,
- std::vector<string>* dirs,
- LineMap* linemap):linemap_(linemap),
- files_(files),
- dirs_(dirs) {
- // The dirs and files are 1 indexed, so just make sure we put
- // nothing in the 0 vector.
- assert(dirs->size() == 0);
- assert(files->size() == 0);
- dirs->push_back("");
- SourceFileInfo s;
- s.name = "";
- s.lowpc = ULLONG_MAX;
- files->push_back(s);
-}
-
-void CULineInfoHandler::DefineDir(const string& name, uint32 dir_num) {
- // These should never come out of order, actually
- assert(dir_num == dirs_->size());
- dirs_->push_back(name);
-}
-
-void CULineInfoHandler::DefineFile(const string& name,
- int32 file_num, uint32 dir_num,
- uint64 mod_time, uint64 length) {
- assert(dir_num >= 0);
- assert(dir_num < dirs_->size());
-
- // These should never come out of order, actually.
- if (file_num == (int32)files_->size() || file_num == -1) {
- string dir = dirs_->at(dir_num);
-
- SourceFileInfo s;
- s.lowpc = ULLONG_MAX;
-
- if (dir == "") {
- s.name = name;
- } else {
- s.name = dir + "/" + name;
- }
-
- files_->push_back(s);
- } else {
- fprintf(stderr, "error in DefineFile");
- }
-}
-
-void CULineInfoHandler::AddLine(uint64 address, uint64 length, uint32 file_num,
- uint32 line_num, uint32 column_num) {
- if (file_num < files_->size()) {
- linemap_->insert(
- std::make_pair(address,
- std::make_pair(files_->at(file_num).name.c_str(),
- line_num)));
-
- if (address < files_->at(file_num).lowpc) {
- files_->at(file_num).lowpc = address;
- }
- } else {
- fprintf(stderr, "error in AddLine");
- }
-}
-
-bool CUFunctionInfoHandler::StartCompilationUnit(uint64 offset,
- uint8 address_size,
- uint8 offset_size,
- uint64 cu_length,
- uint8 dwarf_version) {
- current_compilation_unit_offset_ = offset;
- return true;
-}
-
-
-// For function info, we only care about subprograms and inlined
-// subroutines. For line info, the DW_AT_stmt_list lives in the
-// compile unit tag.
-
-bool CUFunctionInfoHandler::StartDIE(uint64 offset, enum DwarfTag tag) {
- switch (tag) {
- case DW_TAG_subprogram:
- case DW_TAG_inlined_subroutine: {
- current_function_info_ = new FunctionInfo;
- current_function_info_->lowpc = current_function_info_->highpc = 0;
- current_function_info_->name = "";
- current_function_info_->line = 0;
- current_function_info_->file = "";
- offset_to_funcinfo_->insert(std::make_pair(offset,
- current_function_info_));
- };
- // FALLTHROUGH
- case DW_TAG_compile_unit:
- return true;
- default:
- return false;
- }
- return false;
-}
-
-// Only care about the name attribute for functions
-
-void CUFunctionInfoHandler::ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string &data) {
- if (current_function_info_) {
- if (attr == DW_AT_name)
- current_function_info_->name = data;
- else if (attr == DW_AT_MIPS_linkage_name)
- current_function_info_->mangled_name = data;
- }
-}
-
-void CUFunctionInfoHandler::ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- if (attr == DW_AT_stmt_list) {
- SectionMap::const_iterator iter = sections_.find("__debug_line");
- assert(iter != sections_.end());
-
- scoped_ptr<LineInfo> lireader(new LineInfo(iter->second.first + data,
- iter->second.second - data,
- reader_, linehandler_));
- lireader->Start();
- } else if (current_function_info_) {
- switch (attr) {
- case DW_AT_low_pc:
- current_function_info_->lowpc = data;
- break;
- case DW_AT_high_pc:
- current_function_info_->highpc = data;
- break;
- case DW_AT_decl_line:
- current_function_info_->line = data;
- break;
- case DW_AT_decl_file:
- current_function_info_->file = files_->at(data).name;
- break;
- default:
- break;
- }
- }
-}
-
-void CUFunctionInfoHandler::ProcessAttributeReference(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- if (current_function_info_) {
- switch (attr) {
- case DW_AT_specification: {
- // Some functions have a "specification" attribute
- // which means they were defined elsewhere. The name
- // attribute is not repeated, and must be taken from
- // the specification DIE. Here we'll assume that
- // any DIE referenced in this manner will already have
- // been seen, but that's not really required by the spec.
- FunctionMap::iterator iter = offset_to_funcinfo_->find(data);
- if (iter != offset_to_funcinfo_->end()) {
- current_function_info_->name = iter->second->name;
- current_function_info_->mangled_name = iter->second->mangled_name;
- } else {
- // If you hit this, this code probably needs to be rewritten.
- fprintf(stderr,
- "Error: DW_AT_specification was seen before the referenced "
- "DIE! (Looking for DIE at offset %08llx, in DIE at "
- "offset %08llx)\n", data, offset);
- }
- break;
- }
- default:
- break;
- }
- }
-}
-
-void CUFunctionInfoHandler::EndDIE(uint64 offset) {
- if (current_function_info_ && current_function_info_->lowpc)
- address_to_funcinfo_->insert(std::make_pair(current_function_info_->lowpc,
- current_function_info_));
-}
-
-} // namespace dwarf2reader
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h
deleted file mode 100644
index 0b08a5fc5f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/functioninfo.h
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This file contains the definitions for a DWARF2/3 information
-// collector that uses the DWARF2/3 reader interface to build a mapping
-// of addresses to files, lines, and functions.
-
-#ifndef COMMON_DWARF_FUNCTIONINFO_H__
-#define COMMON_DWARF_FUNCTIONINFO_H__
-
-#include <map>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "common/dwarf/dwarf2reader.h"
-#include "common/using_std_string.h"
-
-
-namespace dwarf2reader {
-
-struct FunctionInfo {
- // Name of the function
- string name;
- // Mangled name of the function
- string mangled_name;
- // File containing this function
- string file;
- // Line number for start of function.
- uint32 line;
- // Beginning address for this function
- uint64 lowpc;
- // End address for this function.
- uint64 highpc;
-};
-
-struct SourceFileInfo {
- // Name of the source file name
- string name;
- // Low address of source file name
- uint64 lowpc;
-};
-
-typedef std::map<uint64, FunctionInfo*> FunctionMap;
-typedef std::map<uint64, std::pair<string, uint32> > LineMap;
-
-// This class is a basic line info handler that fills in the dirs,
-// file, and linemap passed into it with the data produced from the
-// LineInfoHandler.
-class CULineInfoHandler: public LineInfoHandler {
- public:
-
- //
- CULineInfoHandler(std::vector<SourceFileInfo>* files,
- std::vector<string>* dirs,
- LineMap* linemap);
- virtual ~CULineInfoHandler() { }
-
- // Called when we define a directory. We just place NAME into dirs_
- // at position DIR_NUM.
- virtual void DefineDir(const string& name, uint32 dir_num);
-
- // Called when we define a filename. We just place
- // concat(dirs_[DIR_NUM], NAME) into files_ at position FILE_NUM.
- virtual void DefineFile(const string& name, int32 file_num,
- uint32 dir_num, uint64 mod_time, uint64 length);
-
-
- // Called when the line info reader has a new line, address pair
- // ready for us. ADDRESS is the address of the code, LENGTH is the
- // length of its machine code in bytes, FILE_NUM is the file number
- // containing the code, LINE_NUM is the line number in that file for
- // the code, and COLUMN_NUM is the column number the code starts at,
- // if we know it (0 otherwise).
- virtual void AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num, uint32 column_num);
-
- private:
- LineMap* linemap_;
- std::vector<SourceFileInfo>* files_;
- std::vector<string>* dirs_;
-};
-
-class CUFunctionInfoHandler: public Dwarf2Handler {
- public:
- CUFunctionInfoHandler(std::vector<SourceFileInfo>* files,
- std::vector<string>* dirs,
- LineMap* linemap,
- FunctionMap* offset_to_funcinfo,
- FunctionMap* address_to_funcinfo,
- CULineInfoHandler* linehandler,
- const SectionMap& sections,
- ByteReader* reader)
- : files_(files), dirs_(dirs), linemap_(linemap),
- offset_to_funcinfo_(offset_to_funcinfo),
- address_to_funcinfo_(address_to_funcinfo),
- linehandler_(linehandler), sections_(sections),
- reader_(reader), current_function_info_(NULL) { }
-
- virtual ~CUFunctionInfoHandler() { }
-
- // Start to process a compilation unit at OFFSET from the beginning of the
- // .debug_info section. We want to see all compilation units, so we
- // always return true.
-
- virtual bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version);
-
- // Start to process a DIE at OFFSET from the beginning of the
- // .debug_info section. We only care about function related DIE's.
- virtual bool StartDIE(uint64 offset, enum DwarfTag tag);
-
- // Called when we have an attribute with unsigned data to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of the .debug_info section, has a name of ATTR, a form of
- // FORM, and the actual data of the attribute is in DATA.
- virtual void ProcessAttributeUnsigned(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
-
- // Called when we have an attribute with a DIE reference to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of the .debug_info section, has a name of ATTR, a form of
- // FORM, and the offset of the referenced DIE from the start of the
- // .debug_info section is in DATA.
- virtual void ProcessAttributeReference(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
-
- // Called when we have an attribute with string data to give to
- // our handler. The attribute is for the DIE at OFFSET from the
- // beginning of the .debug_info section, has a name of ATTR, a form of
- // FORM, and the actual data of the attribute is in DATA.
- virtual void ProcessAttributeString(uint64 offset,
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string& data);
-
- // Called when finished processing the DIE at OFFSET.
- // Because DWARF2/3 specifies a tree of DIEs, you may get starts
- // before ends of the previous DIE, as we process children before
- // ending the parent.
- virtual void EndDIE(uint64 offset);
-
- private:
- std::vector<SourceFileInfo>* files_;
- std::vector<string>* dirs_;
- LineMap* linemap_;
- FunctionMap* offset_to_funcinfo_;
- FunctionMap* address_to_funcinfo_;
- CULineInfoHandler* linehandler_;
- const SectionMap& sections_;
- ByteReader* reader_;
- FunctionInfo* current_function_info_;
- uint64 current_compilation_unit_offset_;
-};
-
-} // namespace dwarf2reader
-#endif // COMMON_DWARF_FUNCTIONINFO_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h
deleted file mode 100644
index 0ff72abcfc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/line_state_machine.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2008 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#ifndef COMMON_DWARF_LINE_STATE_MACHINE_H__
-#define COMMON_DWARF_LINE_STATE_MACHINE_H__
-
-namespace dwarf2reader {
-
-// This is the format of a DWARF2/3 line state machine that we process
-// opcodes using. There is no need for anything outside the lineinfo
-// processor to know how this works.
-struct LineStateMachine {
- void Reset(bool default_is_stmt) {
- file_num = 1;
- address = 0;
- line_num = 1;
- column_num = 0;
- is_stmt = default_is_stmt;
- basic_block = false;
- end_sequence = false;
- }
-
- uint32 file_num;
- uint64 address;
- uint32 line_num;
- uint32 column_num;
- bool is_stmt; // stmt means statement.
- bool basic_block;
- bool end_sequence;
-};
-
-} // namespace dwarf2reader
-
-
-#endif // COMMON_DWARF_LINE_STATE_MACHINE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build b/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build
deleted file mode 100644
index e1ccc65aca..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/moz.build
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HostLibrary('host_breakpad_dwarf_s')
-HOST_SOURCES += [
- 'bytereader.cc',
- 'dwarf2diehandler.cc',
- 'dwarf2reader.cc',
- 'elf_reader.cc',
- 'functioninfo.cc',
-]
-HOST_CXXFLAGS += [
- '-O2',
- '-g',
-]
-
-# need static lib
-FORCE_STATIC_LIB = True
-
-# This code is only compiled for build-time tools,
-# so enabling RTTI should be fine.
-HOST_CXXFLAGS += [
- '-frtti',
- '-funsigned-char',
-]
-
-if CONFIG['OS_ARCH'] == 'Darwin':
- HOST_CXXFLAGS += [
- '-stdlib=libc++',
- ]
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf/types.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf/types.h
deleted file mode 100644
index 59dda31600..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf/types.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2008 Google, Inc. All Rights reserved
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This file contains some typedefs for basic types
-
-
-#ifndef _COMMON_DWARF_TYPES_H__
-#define _COMMON_DWARF_TYPES_H__
-
-#include <stdint.h>
-
-typedef signed char int8;
-typedef short int16;
-typedef int int32;
-typedef long long int64;
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint32;
-typedef unsigned long long uint64;
-
-typedef intptr_t intptr;
-typedef uintptr_t uintptr;
-
-#endif // _COMMON_DWARF_TYPES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc
deleted file mode 100644
index 1bf1d96d59..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.cc
+++ /dev/null
@@ -1,295 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// Implementation of google_breakpad::DwarfCFIToModule.
-// See dwarf_cfi_to_module.h for details.
-
-#include <sstream>
-
-#include "common/dwarf_cfi_to_module.h"
-
-namespace google_breakpad {
-
-using std::ostringstream;
-
-vector<string> DwarfCFIToModule::RegisterNames::MakeVector(
- const char * const *strings,
- size_t size) {
- vector<string> names(strings, strings + size);
- return names;
-}
-
-vector<string> DwarfCFIToModule::RegisterNames::I386() {
- static const char *const names[] = {
- "$eax", "$ecx", "$edx", "$ebx", "$esp", "$ebp", "$esi", "$edi",
- "$eip", "$eflags", "$unused1",
- "$st0", "$st1", "$st2", "$st3", "$st4", "$st5", "$st6", "$st7",
- "$unused2", "$unused3",
- "$xmm0", "$xmm1", "$xmm2", "$xmm3", "$xmm4", "$xmm5", "$xmm6", "$xmm7",
- "$mm0", "$mm1", "$mm2", "$mm3", "$mm4", "$mm5", "$mm6", "$mm7",
- "$fcw", "$fsw", "$mxcsr",
- "$es", "$cs", "$ss", "$ds", "$fs", "$gs", "$unused4", "$unused5",
- "$tr", "$ldtr"
- };
-
- return MakeVector(names, sizeof(names) / sizeof(names[0]));
-}
-
-vector<string> DwarfCFIToModule::RegisterNames::X86_64() {
- static const char *const names[] = {
- "$rax", "$rdx", "$rcx", "$rbx", "$rsi", "$rdi", "$rbp", "$rsp",
- "$r8", "$r9", "$r10", "$r11", "$r12", "$r13", "$r14", "$r15",
- "$rip",
- "$xmm0","$xmm1","$xmm2", "$xmm3", "$xmm4", "$xmm5", "$xmm6", "$xmm7",
- "$xmm8","$xmm9","$xmm10","$xmm11","$xmm12","$xmm13","$xmm14","$xmm15",
- "$st0", "$st1", "$st2", "$st3", "$st4", "$st5", "$st6", "$st7",
- "$mm0", "$mm1", "$mm2", "$mm3", "$mm4", "$mm5", "$mm6", "$mm7",
- "$rflags",
- "$es", "$cs", "$ss", "$ds", "$fs", "$gs", "$unused1", "$unused2",
- "$fs.base", "$gs.base", "$unused3", "$unused4",
- "$tr", "$ldtr",
- "$mxcsr", "$fcw", "$fsw"
- };
-
- return MakeVector(names, sizeof(names) / sizeof(names[0]));
-}
-
-// Per ARM IHI 0040A, section 3.1
-vector<string> DwarfCFIToModule::RegisterNames::ARM() {
- static const char *const names[] = {
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc",
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
- "fps", "cpsr", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
- "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15",
- "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23",
- "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31",
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7"
- };
-
- return MakeVector(names, sizeof(names) / sizeof(names[0]));
-}
-
-// Per ARM IHI 0057A, section 3.1
-vector<string> DwarfCFIToModule::RegisterNames::ARM64() {
- static const char *const names[] = {
- "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
- "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15",
- "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23",
- "x24", "x25", "x26", "x27", "x28", "x29", "x30", "sp",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "", "", "", "", "", "", "", "",
- "v0", "v1", "v2", "v3", "v4", "v5", "v6", "v7",
- "v8", "v9", "v10", "v11", "v12", "v13", "v14", "v15",
- "v16", "v17", "v18", "v19", "v20", "v21", "v22", "v23",
- "v24", "v25", "v26", "v27", "v28", "v29", "v30", "v31"
- };
-
- return MakeVector(names, sizeof(names) / sizeof(names[0]));
-}
-
-vector<string> DwarfCFIToModule::RegisterNames::MIPS() {
- static const char* const kRegisterNames[] = {
- "$zero", "$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3",
- "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7",
- "$s0", "$s1", "$s2", "$s3", "$s4", "$s5", "$s6", "$s7",
- "$t8", "$t9", "$k0", "$k1", "$gp", "$sp", "$fp", "$ra",
- "$lo", "$hi", "$pc", "$f0", "$f2", "$f3", "$f4", "$f5",
- "$f6", "$f7", "$f8", "$f9", "$f10", "$f11", "$f12", "$f13",
- "$f14", "$f15", "$f16", "$f17", "$f18", "$f19", "$f20",
- "$f21", "$f22", "$f23", "$f24", "$f25", "$f26", "$f27",
- "$f28", "$f29", "$f30", "$f31", "$fcsr", "$fir"
- };
-
- return MakeVector(kRegisterNames,
- sizeof(kRegisterNames) / sizeof(kRegisterNames[0]));
-}
-
-bool DwarfCFIToModule::Entry(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
- unsigned return_address) {
- assert(!entry_);
-
- // If dwarf2reader::CallFrameInfo can handle this version and
- // augmentation, then we should be okay with that, so there's no
- // need to check them here.
-
- // Get ready to collect entries.
- entry_ = new Module::StackFrameEntry;
- entry_->address = address;
- entry_->size = length;
- entry_offset_ = offset;
- return_address_ = return_address;
-
- // Breakpad STACK CFI records must provide a .ra rule, but DWARF CFI
- // may not establish any rule for .ra if the return address column
- // is an ordinary register, and that register holds the return
- // address on entry to the function. So establish an initial .ra
- // rule citing the return address register.
- if (return_address_ < register_names_.size())
- entry_->initial_rules[ra_name_] = register_names_[return_address_];
-
- return true;
-}
-
-string DwarfCFIToModule::RegisterName(int i) {
- assert(entry_);
- if (i < 0) {
- assert(i == kCFARegister);
- return cfa_name_;
- }
- unsigned reg = i;
- if (reg == return_address_)
- return ra_name_;
-
- // Ensure that a non-empty name exists for this register value.
- if (reg < register_names_.size() && !register_names_[reg].empty())
- return register_names_[reg];
-
- reporter_->UnnamedRegister(entry_offset_, reg);
- char buf[30];
- sprintf(buf, "unnamed_register%u", reg);
- return buf;
-}
-
-void DwarfCFIToModule::Record(Module::Address address, int reg,
- const string &rule) {
- assert(entry_);
-
- // Place the name in our global set of strings, and then use the string
- // from the set. Even though the assignment looks like a copy, all the
- // major std::string implementations use reference counting internally,
- // so the effect is to have all our data structures share copies of rules
- // whenever possible. Since register names are drawn from a
- // vector<string>, register names are already shared.
- string shared_rule = *common_strings_.insert(rule).first;
-
- // Is this one of this entry's initial rules?
- if (address == entry_->address)
- entry_->initial_rules[RegisterName(reg)] = shared_rule;
- // File it under the appropriate address.
- else
- entry_->rule_changes[address][RegisterName(reg)] = shared_rule;
-}
-
-bool DwarfCFIToModule::UndefinedRule(uint64 address, int reg) {
- reporter_->UndefinedNotSupported(entry_offset_, RegisterName(reg));
- // Treat this as a non-fatal error.
- return true;
-}
-
-bool DwarfCFIToModule::SameValueRule(uint64 address, int reg) {
- ostringstream s;
- s << RegisterName(reg);
- Record(address, reg, s.str());
- return true;
-}
-
-bool DwarfCFIToModule::OffsetRule(uint64 address, int reg,
- int base_register, long offset) {
- ostringstream s;
- s << RegisterName(base_register) << " " << offset << " + ^";
- Record(address, reg, s.str());
- return true;
-}
-
-bool DwarfCFIToModule::ValOffsetRule(uint64 address, int reg,
- int base_register, long offset) {
- ostringstream s;
- s << RegisterName(base_register) << " " << offset << " +";
- Record(address, reg, s.str());
- return true;
-}
-
-bool DwarfCFIToModule::RegisterRule(uint64 address, int reg,
- int base_register) {
- ostringstream s;
- s << RegisterName(base_register);
- Record(address, reg, s.str());
- return true;
-}
-
-bool DwarfCFIToModule::ExpressionRule(uint64 address, int reg,
- const string &expression) {
- reporter_->ExpressionsNotSupported(entry_offset_, RegisterName(reg));
- // Treat this as a non-fatal error.
- return true;
-}
-
-bool DwarfCFIToModule::ValExpressionRule(uint64 address, int reg,
- const string &expression) {
- reporter_->ExpressionsNotSupported(entry_offset_, RegisterName(reg));
- // Treat this as a non-fatal error.
- return true;
-}
-
-bool DwarfCFIToModule::End() {
- module_->AddStackFrameEntry(entry_);
- entry_ = NULL;
- return true;
-}
-
-void DwarfCFIToModule::Reporter::UnnamedRegister(size_t offset, int reg) {
- fprintf(stderr, "%s, section '%s': "
- "the call frame entry at offset 0x%zx refers to register %d,"
- " whose name we don't know\n",
- file_.c_str(), section_.c_str(), offset, reg);
-}
-
-void DwarfCFIToModule::Reporter::UndefinedNotSupported(size_t offset,
- const string &reg) {
- fprintf(stderr, "%s, section '%s': "
- "the call frame entry at offset 0x%zx sets the rule for "
- "register '%s' to 'undefined', but the Breakpad symbol file format"
- " cannot express this\n",
- file_.c_str(), section_.c_str(), offset, reg.c_str());
-}
-
-void DwarfCFIToModule::Reporter::ExpressionsNotSupported(size_t offset,
- const string &reg) {
- fprintf(stderr, "%s, section '%s': "
- "the call frame entry at offset 0x%zx uses a DWARF expression to"
- " describe how to recover register '%s', "
- " but this translator cannot yet translate DWARF expressions to"
- " Breakpad postfix expressions\n",
- file_.c_str(), section_.c_str(), offset, reg.c_str());
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h
deleted file mode 100644
index 084b8f5a75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module.h
+++ /dev/null
@@ -1,202 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf_cfi_to_module.h: Define the DwarfCFIToModule class, which
-// accepts parsed DWARF call frame info and adds it to a
-// google_breakpad::Module object, which can write that information to
-// a Breakpad symbol file.
-
-#ifndef COMMON_LINUX_DWARF_CFI_TO_MODULE_H
-#define COMMON_LINUX_DWARF_CFI_TO_MODULE_H
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <set>
-#include <string>
-#include <vector>
-
-#include "common/module.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using dwarf2reader::CallFrameInfo;
-using google_breakpad::Module;
-using std::set;
-using std::vector;
-
-// A class that accepts parsed call frame information from the DWARF
-// CFI parser and populates a google_breakpad::Module object with the
-// contents.
-class DwarfCFIToModule: public CallFrameInfo::Handler {
- public:
-
- // DwarfCFIToModule uses an instance of this class to report errors
- // detected while converting DWARF CFI to Breakpad STACK CFI records.
- class Reporter {
- public:
- // Create a reporter that writes messages to the standard error
- // stream. FILE is the name of the file we're processing, and
- // SECTION is the name of the section within that file that we're
- // looking at (.debug_frame, .eh_frame, etc.).
- Reporter(const string &file, const string &section)
- : file_(file), section_(section) { }
- virtual ~Reporter() { }
-
- // The DWARF CFI entry at OFFSET cites register REG, but REG is not
- // covered by the vector of register names passed to the
- // DwarfCFIToModule constructor, nor does it match the return
- // address column number for this entry.
- virtual void UnnamedRegister(size_t offset, int reg);
-
- // The DWARF CFI entry at OFFSET says that REG is undefined, but the
- // Breakpad symbol file format cannot express this.
- virtual void UndefinedNotSupported(size_t offset, const string &reg);
-
- // The DWARF CFI entry at OFFSET says that REG uses a DWARF
- // expression to find its value, but DwarfCFIToModule is not
- // capable of translating DWARF expressions to Breakpad postfix
- // expressions.
- virtual void ExpressionsNotSupported(size_t offset, const string &reg);
-
- protected:
- string file_, section_;
- };
-
- // Register name tables. If TABLE is a vector returned by one of these
- // functions, then TABLE[R] is the name of the register numbered R in
- // DWARF call frame information.
- class RegisterNames {
- public:
- // Intel's "x86" or IA-32.
- static vector<string> I386();
-
- // AMD x86_64, AMD64, Intel EM64T, or Intel 64
- static vector<string> X86_64();
-
- // ARM.
- static vector<string> ARM();
-
- // ARM64, aka AARCH64.
- static vector<string> ARM64();
-
- // MIPS.
- static vector<string> MIPS();
-
- private:
- // Given STRINGS, an array of C strings with SIZE elements, return an
- // equivalent vector<string>.
- static vector<string> MakeVector(const char * const *strings, size_t size);
- };
-
- // Create a handler for the dwarf2reader::CallFrameInfo parser that
- // records the stack unwinding information it receives in MODULE.
- //
- // Use REGISTER_NAMES[I] as the name of register number I; *this
- // keeps a reference to the vector, so the vector should remain
- // alive for as long as the DwarfCFIToModule does.
- //
- // Use REPORTER for reporting problems encountered in the conversion
- // process.
- DwarfCFIToModule(Module *module, const vector<string> &register_names,
- Reporter *reporter)
- : module_(module), register_names_(register_names), reporter_(reporter),
- entry_(NULL), return_address_(-1), cfa_name_(".cfa"), ra_name_(".ra") {
- }
- virtual ~DwarfCFIToModule() { delete entry_; }
-
- virtual bool Entry(size_t offset, uint64 address, uint64 length,
- uint8 version, const string &augmentation,
- unsigned return_address);
- virtual bool UndefinedRule(uint64 address, int reg);
- virtual bool SameValueRule(uint64 address, int reg);
- virtual bool OffsetRule(uint64 address, int reg,
- int base_register, long offset);
- virtual bool ValOffsetRule(uint64 address, int reg,
- int base_register, long offset);
- virtual bool RegisterRule(uint64 address, int reg, int base_register);
- virtual bool ExpressionRule(uint64 address, int reg,
- const string &expression);
- virtual bool ValExpressionRule(uint64 address, int reg,
- const string &expression);
- virtual bool End();
-
- private:
- // Return the name to use for register REG.
- string RegisterName(int i);
-
- // Record RULE for register REG at ADDRESS.
- void Record(Module::Address address, int reg, const string &rule);
-
- // The module to which we should add entries.
- Module *module_;
-
- // Map from register numbers to register names.
- const vector<string> &register_names_;
-
- // The reporter to use to report problems.
- Reporter *reporter_;
-
- // The current entry we're constructing.
- Module::StackFrameEntry *entry_;
-
- // The section offset of the current frame description entry, for
- // use in error messages.
- size_t entry_offset_;
-
- // The return address column for that entry.
- unsigned return_address_;
-
- // The names of the return address and canonical frame address. Putting
- // these here instead of using string literals allows us to share their
- // texts in reference-counted std::string implementations (all the
- // popular ones). Many, many rules cite these strings.
- string cfa_name_, ra_name_;
-
- // A set of strings used by this CFI. Before storing a string in one of
- // our data structures, insert it into this set, and then use the string
- // from the set.
- //
- // Because std::string uses reference counting internally, simply using
- // strings from this set, even if passed by value, assigned, or held
- // directly in structures and containers (map<string, ...>, for example),
- // causes those strings to share a single instance of each distinct piece
- // of text.
- set<string> common_strings_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_DWARF_CFI_TO_MODULE_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module_unittest.cc
deleted file mode 100644
index 807d1b20c3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cfi_to_module_unittest.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf_cfi_to_module_unittest.cc: Tests for google_breakpad::DwarfCFIToModule.
-
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/dwarf_cfi_to_module.h"
-#include "common/using_std_string.h"
-
-using std::vector;
-
-using google_breakpad::Module;
-using google_breakpad::DwarfCFIToModule;
-using testing::ContainerEq;
-using testing::Test;
-using testing::_;
-
-struct MockCFIReporter: public DwarfCFIToModule::Reporter {
- MockCFIReporter(const string &file, const string &section)
- : Reporter(file, section) { }
- MOCK_METHOD2(UnnamedRegister, void(size_t offset, int reg));
- MOCK_METHOD2(UndefinedNotSupported, void(size_t offset, const string &reg));
- MOCK_METHOD2(ExpressionsNotSupported, void(size_t offset, const string &reg));
-};
-
-struct DwarfCFIToModuleFixture {
- DwarfCFIToModuleFixture()
- : module("module name", "module os", "module arch", "module id"),
- reporter("reporter file", "reporter section"),
- handler(&module, register_names, &reporter) {
- register_names.push_back("reg0");
- register_names.push_back("reg1");
- register_names.push_back("reg2");
- register_names.push_back("reg3");
- register_names.push_back("reg4");
- register_names.push_back("reg5");
- register_names.push_back("reg6");
- register_names.push_back("reg7");
- register_names.push_back("sp");
- register_names.push_back("pc");
- register_names.push_back("");
-
- EXPECT_CALL(reporter, UnnamedRegister(_, _)).Times(0);
- EXPECT_CALL(reporter, UndefinedNotSupported(_, _)).Times(0);
- EXPECT_CALL(reporter, ExpressionsNotSupported(_, _)).Times(0);
- }
-
- Module module;
- vector<string> register_names;
- MockCFIReporter reporter;
- DwarfCFIToModule handler;
- vector<Module::StackFrameEntry *> entries;
-};
-
-class Entry: public DwarfCFIToModuleFixture, public Test { };
-
-TEST_F(Entry, Accept) {
- ASSERT_TRUE(handler.Entry(0x3b8961b8, 0xa21069698096fc98ULL,
- 0xb440ce248169c8d6ULL, 3, "", 0xea93c106));
- ASSERT_TRUE(handler.End());
- module.GetStackFrameEntries(&entries);
- EXPECT_EQ(1U, entries.size());
- EXPECT_EQ(0xa21069698096fc98ULL, entries[0]->address);
- EXPECT_EQ(0xb440ce248169c8d6ULL, entries[0]->size);
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Entry, AcceptOldVersion) {
- ASSERT_TRUE(handler.Entry(0xeb60e0fc, 0x75b8806bb09eab78ULL,
- 0xc771f44958d40bbcULL, 1, "", 0x093c945e));
- ASSERT_TRUE(handler.End());
- module.GetStackFrameEntries(&entries);
- EXPECT_EQ(1U, entries.size());
- EXPECT_EQ(0x75b8806bb09eab78ULL, entries[0]->address);
- EXPECT_EQ(0xc771f44958d40bbcULL, entries[0]->size);
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-struct RuleFixture: public DwarfCFIToModuleFixture {
- RuleFixture() : DwarfCFIToModuleFixture() {
- entry_address = 0x89327ebf86b47492ULL;
- entry_size = 0x2f8cd573072fe02aULL;
- return_reg = 0x7886a346;
- }
- void StartEntry() {
- ASSERT_TRUE(handler.Entry(0x4445c05c, entry_address, entry_size,
- 3, "", return_reg));
- }
- void CheckEntry() {
- module.GetStackFrameEntries(&entries);
- EXPECT_EQ(1U, entries.size());
- EXPECT_EQ(entry_address, entries[0]->address);
- EXPECT_EQ(entry_size, entries[0]->size);
- }
- uint64 entry_address, entry_size;
- unsigned return_reg;
-};
-
-class Rule: public RuleFixture, public Test { };
-
-TEST_F(Rule, UndefinedRule) {
- EXPECT_CALL(reporter, UndefinedNotSupported(_, "reg7"));
- StartEntry();
- ASSERT_TRUE(handler.UndefinedRule(entry_address, 7));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, RegisterWithEmptyName) {
- EXPECT_CALL(reporter, UnnamedRegister(_, 10));
- EXPECT_CALL(reporter, UndefinedNotSupported(_, "unnamed_register10"));
- StartEntry();
- ASSERT_TRUE(handler.UndefinedRule(entry_address, 10));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, SameValueRule) {
- StartEntry();
- ASSERT_TRUE(handler.SameValueRule(entry_address, 6));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- Module::RuleMap expected_initial;
- expected_initial["reg6"] = "reg6";
- EXPECT_THAT(entries[0]->initial_rules, ContainerEq(expected_initial));
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, OffsetRule) {
- StartEntry();
- ASSERT_TRUE(handler.OffsetRule(entry_address + 1, return_reg,
- DwarfCFIToModule::kCFARegister,
- 16927065));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- Module::RuleChangeMap expected_changes;
- expected_changes[entry_address + 1][".ra"] = ".cfa 16927065 + ^";
- EXPECT_THAT(entries[0]->rule_changes, ContainerEq(expected_changes));
-}
-
-TEST_F(Rule, OffsetRuleNegative) {
- StartEntry();
- ASSERT_TRUE(handler.OffsetRule(entry_address + 1,
- DwarfCFIToModule::kCFARegister, 4, -34530721));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- Module::RuleChangeMap expected_changes;
- expected_changes[entry_address + 1][".cfa"] = "reg4 -34530721 + ^";
- EXPECT_THAT(entries[0]->rule_changes, ContainerEq(expected_changes));
-}
-
-TEST_F(Rule, ValOffsetRule) {
- // Use an unnamed register number, to exercise that branch of RegisterName.
- EXPECT_CALL(reporter, UnnamedRegister(_, 11));
- StartEntry();
- ASSERT_TRUE(handler.ValOffsetRule(entry_address + 0x5ab7,
- DwarfCFIToModule::kCFARegister,
- 11, 61812979));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- Module::RuleChangeMap expected_changes;
- expected_changes[entry_address + 0x5ab7][".cfa"] =
- "unnamed_register11 61812979 +";
- EXPECT_THAT(entries[0]->rule_changes, ContainerEq(expected_changes));
-}
-
-TEST_F(Rule, RegisterRule) {
- StartEntry();
- ASSERT_TRUE(handler.RegisterRule(entry_address, return_reg, 3));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- Module::RuleMap expected_initial;
- expected_initial[".ra"] = "reg3";
- EXPECT_THAT(entries[0]->initial_rules, ContainerEq(expected_initial));
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, ExpressionRule) {
- EXPECT_CALL(reporter, ExpressionsNotSupported(_, "reg2"));
- StartEntry();
- ASSERT_TRUE(handler.ExpressionRule(entry_address + 0xf326, 2,
- "it takes two to tango"));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, ValExpressionRule) {
- EXPECT_CALL(reporter, ExpressionsNotSupported(_, "reg0"));
- StartEntry();
- ASSERT_TRUE(handler.ValExpressionRule(entry_address + 0x6367, 0,
- "bit off more than he could chew"));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- EXPECT_EQ(0U, entries[0]->initial_rules.size());
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, DefaultReturnAddressRule) {
- return_reg = 2;
- StartEntry();
- ASSERT_TRUE(handler.RegisterRule(entry_address, 0, 1));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- Module::RuleMap expected_initial;
- expected_initial[".ra"] = "reg2";
- expected_initial["reg0"] = "reg1";
- EXPECT_THAT(entries[0]->initial_rules, ContainerEq(expected_initial));
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, DefaultReturnAddressRuleOverride) {
- return_reg = 2;
- StartEntry();
- ASSERT_TRUE(handler.RegisterRule(entry_address, return_reg, 1));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- Module::RuleMap expected_initial;
- expected_initial[".ra"] = "reg1";
- EXPECT_THAT(entries[0]->initial_rules, ContainerEq(expected_initial));
- EXPECT_EQ(0U, entries[0]->rule_changes.size());
-}
-
-TEST_F(Rule, DefaultReturnAddressRuleLater) {
- return_reg = 2;
- StartEntry();
- ASSERT_TRUE(handler.RegisterRule(entry_address + 1, return_reg, 1));
- ASSERT_TRUE(handler.End());
- CheckEntry();
- Module::RuleMap expected_initial;
- expected_initial[".ra"] = "reg2";
- EXPECT_THAT(entries[0]->initial_rules, ContainerEq(expected_initial));
- Module::RuleChangeMap expected_changes;
- expected_changes[entry_address + 1][".ra"] = "reg1";
- EXPECT_THAT(entries[0]->rule_changes, ContainerEq(expected_changes));
-}
-
-TEST(RegisterNames, I386) {
- vector<string> names = DwarfCFIToModule::RegisterNames::I386();
-
- EXPECT_EQ("$eax", names[0]);
- EXPECT_EQ("$ecx", names[1]);
- EXPECT_EQ("$esp", names[4]);
- EXPECT_EQ("$eip", names[8]);
-}
-
-TEST(RegisterNames, ARM) {
- vector<string> names = DwarfCFIToModule::RegisterNames::ARM();
-
- EXPECT_EQ("r0", names[0]);
- EXPECT_EQ("r10", names[10]);
- EXPECT_EQ("sp", names[13]);
- EXPECT_EQ("lr", names[14]);
- EXPECT_EQ("pc", names[15]);
-}
-
-TEST(RegisterNames, X86_64) {
- vector<string> names = DwarfCFIToModule::RegisterNames::X86_64();
-
- EXPECT_EQ("$rax", names[0]);
- EXPECT_EQ("$rdx", names[1]);
- EXPECT_EQ("$rbp", names[6]);
- EXPECT_EQ("$rsp", names[7]);
- EXPECT_EQ("$rip", names[16]);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc
deleted file mode 100644
index 479e39b221..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.cc
+++ /dev/null
@@ -1,1075 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// Implement the DwarfCUToModule class; see dwarf_cu_to_module.h.
-
-// For <inttypes.h> PRI* macros, before anything else might #include it.
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif /* __STDC_FORMAT_MACROS */
-
-#include "common/dwarf_cu_to_module.h"
-
-#include <assert.h>
-#if !defined(__ANDROID__)
-#include <cxxabi.h>
-#endif
-#include <inttypes.h>
-#include <stdint.h>
-#include <stdio.h>
-
-#include <algorithm>
-#include <utility>
-
-#include "common/dwarf_line_to_module.h"
-#include "common/unordered.h"
-
-namespace google_breakpad {
-
-using std::map;
-using std::pair;
-using std::sort;
-using std::vector;
-
-// Data provided by a DWARF specification DIE.
-//
-// In DWARF, the DIE for a definition may contain a DW_AT_specification
-// attribute giving the offset of the corresponding declaration DIE, and
-// the definition DIE may omit information given in the declaration. For
-// example, it's common for a function's address range to appear only in
-// its definition DIE, but its name to appear only in its declaration
-// DIE.
-//
-// The dumper needs to be able to follow DW_AT_specification links to
-// bring all this information together in a FUNC record. Conveniently,
-// DIEs that are the target of such links have a DW_AT_declaration flag
-// set, so we can identify them when we first see them, and record their
-// contents for later reference.
-//
-// A Specification holds information gathered from a declaration DIE that
-// we may need if we find a DW_AT_specification link pointing to it.
-struct DwarfCUToModule::Specification {
- // The qualified name that can be found by demangling DW_AT_MIPS_linkage_name.
- string qualified_name;
-
- // The name of the enclosing scope, or the empty string if there is none.
- string enclosing_name;
-
- // The name for the specification DIE itself, without any enclosing
- // name components.
- string unqualified_name;
-};
-
-// An abstract origin -- base definition of an inline function.
-struct AbstractOrigin {
- AbstractOrigin() : name() {}
- explicit AbstractOrigin(const string& name) : name(name) {}
-
- string name;
-};
-
-typedef map<uint64, AbstractOrigin> AbstractOriginByOffset;
-
-// Data global to the DWARF-bearing file that is private to the
-// DWARF-to-Module process.
-struct DwarfCUToModule::FilePrivate {
- // A set of strings used in this CU. Before storing a string in one of
- // our data structures, insert it into this set, and then use the string
- // from the set.
- //
- // In some STL implementations, strings are reference-counted internally,
- // meaning that simply using strings from this set, even if passed by
- // value, assigned, or held directly in structures and containers
- // (map<string, ...>, for example), causes those strings to share a
- // single instance of each distinct piece of text. GNU's libstdc++ uses
- // reference counts, and I believe MSVC did as well, at some point.
- // However, C++ '11 implementations are moving away from reference
- // counting.
- //
- // In other implementations, string assignments copy the string's text,
- // so this set will actually hold yet another copy of the string (although
- // everything will still work). To improve memory consumption portably,
- // we will probably need to use pointers to strings held in this set.
- unordered_set<string> common_strings;
-
- // A map from offsets of DIEs within the .debug_info section to
- // Specifications describing those DIEs. Specification references can
- // cross compilation unit boundaries.
- SpecificationByOffset specifications;
-
- AbstractOriginByOffset origins;
-};
-
-DwarfCUToModule::FileContext::FileContext(const string &filename,
- Module *module,
- bool handle_inter_cu_refs)
- : filename_(filename),
- module_(module),
- handle_inter_cu_refs_(handle_inter_cu_refs),
- file_private_(new FilePrivate()) {
-}
-
-DwarfCUToModule::FileContext::~FileContext() {
-}
-
-void DwarfCUToModule::FileContext::AddSectionToSectionMap(
- const string& name, const uint8_t *contents, uint64 length) {
- section_map_[name] = std::make_pair(contents, length);
-}
-
-void DwarfCUToModule::FileContext::ClearSectionMapForTest() {
- section_map_.clear();
-}
-
-const dwarf2reader::SectionMap&
-DwarfCUToModule::FileContext::section_map() const {
- return section_map_;
-}
-
-void DwarfCUToModule::FileContext::ClearSpecifications() {
- if (!handle_inter_cu_refs_)
- file_private_->specifications.clear();
-}
-
-bool DwarfCUToModule::FileContext::IsUnhandledInterCUReference(
- uint64 offset, uint64 compilation_unit_start) const {
- if (handle_inter_cu_refs_)
- return false;
- return offset < compilation_unit_start;
-}
-
-// Information global to the particular compilation unit we're
-// parsing. This is for data shared across the CU's entire DIE tree,
-// and parameters from the code invoking the CU parser.
-struct DwarfCUToModule::CUContext {
- CUContext(FileContext *file_context_arg, WarningReporter *reporter_arg)
- : file_context(file_context_arg),
- reporter(reporter_arg),
- language(Language::CPlusPlus) {}
-
- ~CUContext() {
- for (vector<Module::Function *>::iterator it = functions.begin();
- it != functions.end(); ++it) {
- delete *it;
- }
- };
-
- // The DWARF-bearing file into which this CU was incorporated.
- FileContext *file_context;
-
- // For printing error messages.
- WarningReporter *reporter;
-
- // The source language of this compilation unit.
- const Language *language;
-
- // The functions defined in this compilation unit. We accumulate
- // them here during parsing. Then, in DwarfCUToModule::Finish, we
- // assign them lines and add them to file_context->module.
- //
- // Destroying this destroys all the functions this vector points to.
- vector<Module::Function *> functions;
-};
-
-// Information about the context of a particular DIE. This is for
-// information that changes as we descend the tree towards the leaves:
-// the containing classes/namespaces, etc.
-struct DwarfCUToModule::DIEContext {
- // The fully-qualified name of the context. For example, for a
- // tree like:
- //
- // DW_TAG_namespace Foo
- // DW_TAG_class Bar
- // DW_TAG_subprogram Baz
- //
- // in a C++ compilation unit, the DIEContext's name for the
- // DW_TAG_subprogram DIE would be "Foo::Bar". The DIEContext's
- // name for the DW_TAG_namespace DIE would be "".
- string name;
-};
-
-// An abstract base class for all the dumper's DIE handlers.
-class DwarfCUToModule::GenericDIEHandler: public dwarf2reader::DIEHandler {
- public:
- // Create a handler for the DIE at OFFSET whose compilation unit is
- // described by CU_CONTEXT, and whose immediate context is described
- // by PARENT_CONTEXT.
- GenericDIEHandler(CUContext *cu_context, DIEContext *parent_context,
- uint64 offset)
- : cu_context_(cu_context),
- parent_context_(parent_context),
- offset_(offset),
- declaration_(false),
- specification_(NULL) { }
-
- // Derived classes' ProcessAttributeUnsigned can defer to this to
- // handle DW_AT_declaration, or simply not override it.
- void ProcessAttributeUnsigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
-
- // Derived classes' ProcessAttributeReference can defer to this to
- // handle DW_AT_specification, or simply not override it.
- void ProcessAttributeReference(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
-
- // Derived classes' ProcessAttributeReference can defer to this to
- // handle DW_AT_specification, or simply not override it.
- void ProcessAttributeString(enum DwarfAttribute attr,
- enum DwarfForm form,
- const string &data);
-
- protected:
- // Compute and return the fully-qualified name of the DIE. If this
- // DIE is a declaration DIE, to be cited by other DIEs'
- // DW_AT_specification attributes, record its enclosing name and
- // unqualified name in the specification table.
- //
- // Use this from EndAttributes member functions, not ProcessAttribute*
- // functions; only the former can be sure that all the DIE's attributes
- // have been seen.
- string ComputeQualifiedName();
-
- CUContext *cu_context_;
- DIEContext *parent_context_;
- uint64 offset_;
-
- // Place the name in the global set of strings. Even though this looks
- // like a copy, all the major std::string implementations use reference
- // counting internally, so the effect is to have all the data structures
- // share copies of strings whenever possible.
- // FIXME: Should this return something like a string_ref to avoid the
- // assumption about how strings are implemented?
- string AddStringToPool(const string &str);
-
- // If this DIE has a DW_AT_declaration attribute, this is its value.
- // It is false on DIEs with no DW_AT_declaration attribute.
- bool declaration_;
-
- // If this DIE has a DW_AT_specification attribute, this is the
- // Specification structure for the DIE the attribute refers to.
- // Otherwise, this is NULL.
- Specification *specification_;
-
- // The value of the DW_AT_name attribute, or the empty string if the
- // DIE has no such attribute.
- string name_attribute_;
-
- // The demangled value of the DW_AT_MIPS_linkage_name attribute, or the empty
- // string if the DIE has no such attribute or its content could not be
- // demangled.
- string demangled_name_;
-};
-
-void DwarfCUToModule::GenericDIEHandler::ProcessAttributeUnsigned(
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- switch (attr) {
- case dwarf2reader::DW_AT_declaration: declaration_ = (data != 0); break;
- default: break;
- }
-}
-
-void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference(
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- switch (attr) {
- case dwarf2reader::DW_AT_specification: {
- FileContext *file_context = cu_context_->file_context;
- if (file_context->IsUnhandledInterCUReference(
- data, cu_context_->reporter->cu_offset())) {
- cu_context_->reporter->UnhandledInterCUReference(offset_, data);
- break;
- }
- // Find the Specification to which this attribute refers, and
- // set specification_ appropriately. We could do more processing
- // here, but it's better to leave the real work to our
- // EndAttribute member function, at which point we know we have
- // seen all the DIE's attributes.
- SpecificationByOffset *specifications =
- &file_context->file_private_->specifications;
- SpecificationByOffset::iterator spec = specifications->find(data);
- if (spec != specifications->end()) {
- specification_ = &spec->second;
- } else {
- // Technically, there's no reason a DW_AT_specification
- // couldn't be a forward reference, but supporting that would
- // be a lot of work (changing to a two-pass structure), and I
- // don't think any producers we care about ever emit such
- // things.
- cu_context_->reporter->UnknownSpecification(offset_, data);
- }
- break;
- }
- default: break;
- }
-}
-
-string DwarfCUToModule::GenericDIEHandler::AddStringToPool(const string &str) {
- pair<unordered_set<string>::iterator, bool> result =
- cu_context_->file_context->file_private_->common_strings.insert(str);
- return *result.first;
-}
-
-void DwarfCUToModule::GenericDIEHandler::ProcessAttributeString(
- enum DwarfAttribute attr,
- enum DwarfForm form,
- const string &data) {
- switch (attr) {
- case dwarf2reader::DW_AT_name:
- name_attribute_ = AddStringToPool(data);
- break;
- case dwarf2reader::DW_AT_MIPS_linkage_name: {
- char* demangled = NULL;
- int status = -1;
-#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
- demangled = abi::__cxa_demangle(data.c_str(), NULL, NULL, &status);
-#endif
- if (status != 0) {
- cu_context_->reporter->DemangleError(data, status);
- demangled_name_ = "";
- break;
- }
- if (demangled) {
- demangled_name_ = AddStringToPool(demangled);
- free(reinterpret_cast<void*>(demangled));
- }
- break;
- }
- default: break;
- }
-}
-
-string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
- // Use the demangled name, if one is available. Demangled names are
- // preferable to those inferred from the DWARF structure because they
- // include argument types.
- const string *qualified_name = NULL;
- if (!demangled_name_.empty()) {
- // Found it is this DIE.
- qualified_name = &demangled_name_;
- } else if (specification_ && !specification_->qualified_name.empty()) {
- // Found it on the specification.
- qualified_name = &specification_->qualified_name;
- }
-
- const string *unqualified_name = NULL;
- const string *enclosing_name;
- if (!qualified_name) {
- // Find the unqualified name. If the DIE has its own DW_AT_name
- // attribute, then use that; otherwise, check the specification.
- if (!name_attribute_.empty())
- unqualified_name = &name_attribute_;
- else if (specification_)
- unqualified_name = &specification_->unqualified_name;
-
- // Find the name of the enclosing context. If this DIE has a
- // specification, it's the specification's enclosing context that
- // counts; otherwise, use this DIE's context.
- if (specification_)
- enclosing_name = &specification_->enclosing_name;
- else
- enclosing_name = &parent_context_->name;
- }
-
- // Prepare the return value before upcoming mutations possibly invalidate the
- // existing pointers.
- string return_value;
- if (qualified_name) {
- return_value = *qualified_name;
- } else if (unqualified_name && enclosing_name) {
- // Combine the enclosing name and unqualified name to produce our
- // own fully-qualified name.
- return_value = cu_context_->language->MakeQualifiedName(*enclosing_name,
- *unqualified_name);
- }
-
- // If this DIE was marked as a declaration, record its names in the
- // specification table.
- if ((declaration_ && qualified_name) ||
- (unqualified_name && enclosing_name)) {
- Specification spec;
- if (qualified_name) {
- spec.qualified_name = *qualified_name;
- } else {
- spec.enclosing_name = *enclosing_name;
- spec.unqualified_name = *unqualified_name;
- }
- cu_context_->file_context->file_private_->specifications[offset_] = spec;
- }
-
- return return_value;
-}
-
-// A handler class for DW_TAG_subprogram DIEs.
-class DwarfCUToModule::FuncHandler: public GenericDIEHandler {
- public:
- FuncHandler(CUContext *cu_context, DIEContext *parent_context,
- uint64 offset)
- : GenericDIEHandler(cu_context, parent_context, offset),
- low_pc_(0), high_pc_(0), high_pc_form_(dwarf2reader::DW_FORM_addr),
- abstract_origin_(NULL), inline_(false) { }
- void ProcessAttributeUnsigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
- void ProcessAttributeSigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data);
- void ProcessAttributeReference(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
-
- bool EndAttributes();
- void Finish();
-
- private:
- // The fully-qualified name, as derived from name_attribute_,
- // specification_, parent_context_. Computed in EndAttributes.
- string name_;
- uint64 low_pc_, high_pc_; // DW_AT_low_pc, DW_AT_high_pc
- DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address.
- const AbstractOrigin* abstract_origin_;
- bool inline_;
-};
-
-void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned(
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- switch (attr) {
- // If this attribute is present at all --- even if its value is
- // DW_INL_not_inlined --- then GCC may cite it as someone else's
- // DW_AT_abstract_origin attribute.
- case dwarf2reader::DW_AT_inline: inline_ = true; break;
-
- case dwarf2reader::DW_AT_low_pc: low_pc_ = data; break;
- case dwarf2reader::DW_AT_high_pc:
- high_pc_form_ = form;
- high_pc_ = data;
- break;
-
- default:
- GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data);
- break;
- }
-}
-
-void DwarfCUToModule::FuncHandler::ProcessAttributeSigned(
- enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) {
- switch (attr) {
- // If this attribute is present at all --- even if its value is
- // DW_INL_not_inlined --- then GCC may cite it as someone else's
- // DW_AT_abstract_origin attribute.
- case dwarf2reader::DW_AT_inline: inline_ = true; break;
-
- default:
- break;
- }
-}
-
-void DwarfCUToModule::FuncHandler::ProcessAttributeReference(
- enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- switch (attr) {
- case dwarf2reader::DW_AT_abstract_origin: {
- const AbstractOriginByOffset& origins =
- cu_context_->file_context->file_private_->origins;
- AbstractOriginByOffset::const_iterator origin = origins.find(data);
- if (origin != origins.end()) {
- abstract_origin_ = &(origin->second);
- } else {
- cu_context_->reporter->UnknownAbstractOrigin(offset_, data);
- }
- break;
- }
- default:
- GenericDIEHandler::ProcessAttributeReference(attr, form, data);
- break;
- }
-}
-
-bool DwarfCUToModule::FuncHandler::EndAttributes() {
- // Compute our name, and record a specification, if appropriate.
- name_ = ComputeQualifiedName();
- if (name_.empty() && abstract_origin_) {
- name_ = abstract_origin_->name;
- }
- return true;
-}
-
-void DwarfCUToModule::FuncHandler::Finish() {
- // Make high_pc_ an address, if it isn't already.
- if (high_pc_form_ != dwarf2reader::DW_FORM_addr) {
- high_pc_ += low_pc_;
- }
-
- // Did we collect the information we need? Not all DWARF function
- // entries have low and high addresses (for example, inlined
- // functions that were never used), but all the ones we're
- // interested in cover a non-empty range of bytes.
- if (low_pc_ < high_pc_) {
- // Malformed DWARF may omit the name, but all Module::Functions must
- // have names.
- string name;
- if (!name_.empty()) {
- name = name_;
- } else {
- cu_context_->reporter->UnnamedFunction(offset_);
- name = "<name omitted>";
- }
-
- // Create a Module::Function based on the data we've gathered, and
- // add it to the functions_ list.
- scoped_ptr<Module::Function> func(new Module::Function(name, low_pc_));
- func->size = high_pc_ - low_pc_;
- func->parameter_size = 0;
- if (func->address) {
- // If the function address is zero this is a sign that this function
- // description is just empty debug data and should just be discarded.
- cu_context_->functions.push_back(func.release());
- }
- } else if (inline_) {
- AbstractOrigin origin(name_);
- cu_context_->file_context->file_private_->origins[offset_] = origin;
- }
-}
-
-// A handler for DIEs that contain functions and contribute a
-// component to their names: namespaces, classes, etc.
-class DwarfCUToModule::NamedScopeHandler: public GenericDIEHandler {
- public:
- NamedScopeHandler(CUContext *cu_context, DIEContext *parent_context,
- uint64 offset)
- : GenericDIEHandler(cu_context, parent_context, offset) { }
- bool EndAttributes();
- DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag);
-
- private:
- DIEContext child_context_; // A context for our children.
-};
-
-bool DwarfCUToModule::NamedScopeHandler::EndAttributes() {
- child_context_.name = ComputeQualifiedName();
- return true;
-}
-
-dwarf2reader::DIEHandler *DwarfCUToModule::NamedScopeHandler::FindChildHandler(
- uint64 offset,
- enum DwarfTag tag) {
- switch (tag) {
- case dwarf2reader::DW_TAG_subprogram:
- return new FuncHandler(cu_context_, &child_context_, offset);
- case dwarf2reader::DW_TAG_namespace:
- case dwarf2reader::DW_TAG_class_type:
- case dwarf2reader::DW_TAG_structure_type:
- case dwarf2reader::DW_TAG_union_type:
- return new NamedScopeHandler(cu_context_, &child_context_, offset);
- default:
- return NULL;
- }
-}
-
-void DwarfCUToModule::WarningReporter::CUHeading() {
- if (printed_cu_header_)
- return;
- fprintf(stderr, "%s: in compilation unit '%s' (offset 0x%llx):\n",
- filename_.c_str(), cu_name_.c_str(), cu_offset_);
- printed_cu_header_ = true;
-}
-
-void DwarfCUToModule::WarningReporter::UnknownSpecification(uint64 offset,
- uint64 target) {
- CUHeading();
- fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_specification"
- " attribute referring to the die at offset 0x%llx, which either"
- " was not marked as a declaration, or comes later in the file\n",
- filename_.c_str(), offset, target);
-}
-
-void DwarfCUToModule::WarningReporter::UnknownAbstractOrigin(uint64 offset,
- uint64 target) {
- CUHeading();
- fprintf(stderr, "%s: the DIE at offset 0x%llx has a DW_AT_abstract_origin"
- " attribute referring to the die at offset 0x%llx, which either"
- " was not marked as an inline, or comes later in the file\n",
- filename_.c_str(), offset, target);
-}
-
-void DwarfCUToModule::WarningReporter::MissingSection(const string &name) {
- CUHeading();
- fprintf(stderr, "%s: warning: couldn't find DWARF '%s' section\n",
- filename_.c_str(), name.c_str());
-}
-
-void DwarfCUToModule::WarningReporter::BadLineInfoOffset(uint64 offset) {
- CUHeading();
- fprintf(stderr, "%s: warning: line number data offset beyond end"
- " of '.debug_line' section\n",
- filename_.c_str());
-}
-
-void DwarfCUToModule::WarningReporter::UncoveredHeading() {
- if (printed_unpaired_header_)
- return;
- CUHeading();
- fprintf(stderr, "%s: warning: skipping unpaired lines/functions:\n",
- filename_.c_str());
- printed_unpaired_header_ = true;
-}
-
-void DwarfCUToModule::WarningReporter::UncoveredFunction(
- const Module::Function &function) {
- if (!uncovered_warnings_enabled_)
- return;
- UncoveredHeading();
- fprintf(stderr, " function%s: %s\n",
- function.size == 0 ? " (zero-length)" : "",
- function.name.c_str());
-}
-
-void DwarfCUToModule::WarningReporter::UncoveredLine(const Module::Line &line) {
- if (!uncovered_warnings_enabled_)
- return;
- UncoveredHeading();
- fprintf(stderr, " line%s: %s:%d at 0x%" PRIx64 "\n",
- (line.size == 0 ? " (zero-length)" : ""),
- line.file->name.c_str(), line.number, line.address);
-}
-
-void DwarfCUToModule::WarningReporter::UnnamedFunction(uint64 offset) {
- CUHeading();
- fprintf(stderr, "%s: warning: function at offset 0x%llx has no name\n",
- filename_.c_str(), offset);
-}
-
-void DwarfCUToModule::WarningReporter::DemangleError(
- const string &input, int error) {
- CUHeading();
- fprintf(stderr, "%s: warning: failed to demangle %s with error %d\n",
- filename_.c_str(), input.c_str(), error);
-}
-
-void DwarfCUToModule::WarningReporter::UnhandledInterCUReference(
- uint64 offset, uint64 target) {
- CUHeading();
- fprintf(stderr, "%s: warning: the DIE at offset 0x%llx has a "
- "DW_FORM_ref_addr attribute with an inter-CU reference to "
- "0x%llx, but inter-CU reference handling is turned off.\n",
- filename_.c_str(), offset, target);
-}
-
-DwarfCUToModule::DwarfCUToModule(FileContext *file_context,
- LineToModuleHandler *line_reader,
- WarningReporter *reporter)
- : line_reader_(line_reader),
- cu_context_(new CUContext(file_context, reporter)),
- child_context_(new DIEContext()),
- has_source_line_info_(false) {
-}
-
-DwarfCUToModule::~DwarfCUToModule() {
-}
-
-void DwarfCUToModule::ProcessAttributeSigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data) {
- switch (attr) {
- case dwarf2reader::DW_AT_language: // source language of this CU
- SetLanguage(static_cast<DwarfLanguage>(data));
- break;
- default:
- break;
- }
-}
-
-void DwarfCUToModule::ProcessAttributeUnsigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data) {
- switch (attr) {
- case dwarf2reader::DW_AT_stmt_list: // Line number information.
- has_source_line_info_ = true;
- source_line_offset_ = data;
- break;
- case dwarf2reader::DW_AT_language: // source language of this CU
- SetLanguage(static_cast<DwarfLanguage>(data));
- break;
- default:
- break;
- }
-}
-
-void DwarfCUToModule::ProcessAttributeString(enum DwarfAttribute attr,
- enum DwarfForm form,
- const string &data) {
- switch (attr) {
- case dwarf2reader::DW_AT_name:
- cu_context_->reporter->SetCUName(data);
- break;
- case dwarf2reader::DW_AT_comp_dir:
- line_reader_->StartCompilationUnit(data);
- break;
- default:
- break;
- }
-}
-
-bool DwarfCUToModule::EndAttributes() {
- return true;
-}
-
-dwarf2reader::DIEHandler *DwarfCUToModule::FindChildHandler(
- uint64 offset,
- enum DwarfTag tag) {
- switch (tag) {
- case dwarf2reader::DW_TAG_subprogram:
- return new FuncHandler(cu_context_.get(), child_context_.get(), offset);
- case dwarf2reader::DW_TAG_namespace:
- case dwarf2reader::DW_TAG_class_type:
- case dwarf2reader::DW_TAG_structure_type:
- case dwarf2reader::DW_TAG_union_type:
- return new NamedScopeHandler(cu_context_.get(), child_context_.get(),
- offset);
- default:
- return NULL;
- }
-}
-
-void DwarfCUToModule::SetLanguage(DwarfLanguage language) {
- switch (language) {
- case dwarf2reader::DW_LANG_Java:
- cu_context_->language = Language::Java;
- break;
-
- // DWARF has no generic language code for assembly language; this is
- // what the GNU toolchain uses.
- case dwarf2reader::DW_LANG_Mips_Assembler:
- cu_context_->language = Language::Assembler;
- break;
-
- // C++ covers so many cases that it probably has some way to cope
- // with whatever the other languages throw at us. So make it the
- // default.
- //
- // Objective C and Objective C++ seem to create entries for
- // methods whose DW_AT_name values are already fully-qualified:
- // "-[Classname method:]". These appear at the top level.
- //
- // DWARF data for C should never include namespaces or functions
- // nested in struct types, but if it ever does, then C++'s
- // notation is probably not a bad choice for that.
- default:
- case dwarf2reader::DW_LANG_ObjC:
- case dwarf2reader::DW_LANG_ObjC_plus_plus:
- case dwarf2reader::DW_LANG_C:
- case dwarf2reader::DW_LANG_C89:
- case dwarf2reader::DW_LANG_C99:
- case dwarf2reader::DW_LANG_C_plus_plus:
- cu_context_->language = Language::CPlusPlus;
- break;
- }
-}
-
-void DwarfCUToModule::ReadSourceLines(uint64 offset) {
- const dwarf2reader::SectionMap &section_map
- = cu_context_->file_context->section_map();
- dwarf2reader::SectionMap::const_iterator map_entry
- = section_map.find(".debug_line");
- // Mac OS X puts DWARF data in sections whose names begin with "__"
- // instead of ".".
- if (map_entry == section_map.end())
- map_entry = section_map.find("__debug_line");
- if (map_entry == section_map.end()) {
- cu_context_->reporter->MissingSection(".debug_line");
- return;
- }
- const uint8_t *section_start = map_entry->second.first;
- uint64 section_length = map_entry->second.second;
- if (offset >= section_length) {
- cu_context_->reporter->BadLineInfoOffset(offset);
- return;
- }
- line_reader_->ReadProgram(section_start + offset, section_length - offset,
- cu_context_->file_context->module_, &lines_);
-}
-
-namespace {
-// Return true if ADDRESS falls within the range of ITEM.
-template <class T>
-inline bool within(const T &item, Module::Address address) {
- // Because Module::Address is unsigned, and unsigned arithmetic
- // wraps around, this will be false if ADDRESS falls before the
- // start of ITEM, or if it falls after ITEM's end.
- return address - item.address < item.size;
-}
-}
-
-void DwarfCUToModule::AssignLinesToFunctions() {
- vector<Module::Function *> *functions = &cu_context_->functions;
- WarningReporter *reporter = cu_context_->reporter;
-
- // This would be simpler if we assumed that source line entries
- // don't cross function boundaries. However, there's no real reason
- // to assume that (say) a series of function definitions on the same
- // line wouldn't get coalesced into one line number entry. The
- // DWARF spec certainly makes no such promises.
- //
- // So treat the functions and lines as peers, and take the trouble
- // to compute their ranges' intersections precisely. In any case,
- // the hair here is a constant factor for performance; the
- // complexity from here on out is linear.
-
- // Put both our functions and lines in order by address.
- std::sort(functions->begin(), functions->end(),
- Module::Function::CompareByAddress);
- std::sort(lines_.begin(), lines_.end(), Module::Line::CompareByAddress);
-
- // The last line that we used any piece of. We use this only for
- // generating warnings.
- const Module::Line *last_line_used = NULL;
-
- // The last function and line we warned about --- so we can avoid
- // doing so more than once.
- const Module::Function *last_function_cited = NULL;
- const Module::Line *last_line_cited = NULL;
-
- // Make a single pass through both vectors from lower to higher
- // addresses, populating each Function's lines vector with lines
- // from our lines_ vector that fall within the function's address
- // range.
- vector<Module::Function *>::iterator func_it = functions->begin();
- vector<Module::Line>::const_iterator line_it = lines_.begin();
-
- Module::Address current;
-
- // Pointers to the referents of func_it and line_it, or NULL if the
- // iterator is at the end of the sequence.
- Module::Function *func;
- const Module::Line *line;
-
- // Start current at the beginning of the first line or function,
- // whichever is earlier.
- if (func_it != functions->end() && line_it != lines_.end()) {
- func = *func_it;
- line = &*line_it;
- current = std::min(func->address, line->address);
- } else if (line_it != lines_.end()) {
- func = NULL;
- line = &*line_it;
- current = line->address;
- } else if (func_it != functions->end()) {
- func = *func_it;
- line = NULL;
- current = (*func_it)->address;
- } else {
- return;
- }
-
- while (func || line) {
- // This loop has two invariants that hold at the top.
- //
- // First, at least one of the iterators is not at the end of its
- // sequence, and those that are not refer to the earliest
- // function or line that contains or starts after CURRENT.
- //
- // Note that every byte is in one of four states: it is covered
- // or not covered by a function, and, independently, it is
- // covered or not covered by a line.
- //
- // The second invariant is that CURRENT refers to a byte whose
- // state is different from its predecessor, or it refers to the
- // first byte in the address space. In other words, CURRENT is
- // always the address of a transition.
- //
- // Note that, although each iteration advances CURRENT from one
- // transition address to the next in each iteration, it might
- // not advance the iterators. Suppose we have a function that
- // starts with a line, has a gap, and then a second line, and
- // suppose that we enter an iteration with CURRENT at the end of
- // the first line. The next transition address is the start of
- // the second line, after the gap, so the iteration should
- // advance CURRENT to that point. At the head of that iteration,
- // the invariants require that the line iterator be pointing at
- // the second line. But this is also true at the head of the
- // next. And clearly, the iteration must not change the function
- // iterator. So neither iterator moves.
-
- // Assert the first invariant (see above).
- assert(!func || current < func->address || within(*func, current));
- assert(!line || current < line->address || within(*line, current));
-
- // The next transition after CURRENT.
- Module::Address next_transition;
-
- // Figure out which state we're in, add lines or warn, and compute
- // the next transition address.
- if (func && current >= func->address) {
- if (line && current >= line->address) {
- // Covered by both a line and a function.
- Module::Address func_left = func->size - (current - func->address);
- Module::Address line_left = line->size - (current - line->address);
- // This may overflow, but things work out.
- next_transition = current + std::min(func_left, line_left);
- Module::Line l = *line;
- l.address = current;
- l.size = next_transition - current;
- func->lines.push_back(l);
- last_line_used = line;
- } else {
- // Covered by a function, but no line.
- if (func != last_function_cited) {
- reporter->UncoveredFunction(*func);
- last_function_cited = func;
- }
- if (line && within(*func, line->address))
- next_transition = line->address;
- else
- // If this overflows, we'll catch it below.
- next_transition = func->address + func->size;
- }
- } else {
- if (line && current >= line->address) {
- // Covered by a line, but no function.
- //
- // If GCC emits padding after one function to align the start
- // of the next, then it will attribute the padding
- // instructions to the last source line of function (to reduce
- // the size of the line number info), but omit it from the
- // DW_AT_{low,high}_pc range given in .debug_info (since it
- // costs nothing to be precise there). If we did use at least
- // some of the line we're about to skip, and it ends at the
- // start of the next function, then assume this is what
- // happened, and don't warn.
- if (line != last_line_cited
- && !(func
- && line == last_line_used
- && func->address - line->address == line->size)) {
- reporter->UncoveredLine(*line);
- last_line_cited = line;
- }
- if (func && within(*line, func->address))
- next_transition = func->address;
- else
- // If this overflows, we'll catch it below.
- next_transition = line->address + line->size;
- } else {
- // Covered by neither a function nor a line. By the invariant,
- // both func and line begin after CURRENT. The next transition
- // is the start of the next function or next line, whichever
- // is earliest.
- assert(func || line);
- if (func && line)
- next_transition = std::min(func->address, line->address);
- else if (func)
- next_transition = func->address;
- else
- next_transition = line->address;
- }
- }
-
- // If a function or line abuts the end of the address space, then
- // next_transition may end up being zero, in which case we've completed
- // our pass. Handle that here, instead of trying to deal with it in
- // each place we compute next_transition.
- if (!next_transition)
- break;
-
- // Advance iterators as needed. If lines overlap or functions overlap,
- // then we could go around more than once. We don't worry too much
- // about what result we produce in that case, just as long as we don't
- // hang or crash.
- while (func_it != functions->end()
- && next_transition >= (*func_it)->address
- && !within(**func_it, next_transition))
- func_it++;
- func = (func_it != functions->end()) ? *func_it : NULL;
- while (line_it != lines_.end()
- && next_transition >= line_it->address
- && !within(*line_it, next_transition))
- line_it++;
- line = (line_it != lines_.end()) ? &*line_it : NULL;
-
- // We must make progress.
- assert(next_transition > current);
- current = next_transition;
- }
-}
-
-void DwarfCUToModule::Finish() {
- // Assembly language files have no function data, and that gives us
- // no place to store our line numbers (even though the GNU toolchain
- // will happily produce source line info for assembly language
- // files). To avoid spurious warnings about lines we can't assign
- // to functions, skip CUs in languages that lack functions.
- if (!cu_context_->language->HasFunctions())
- return;
-
- // Read source line info, if we have any.
- if (has_source_line_info_)
- ReadSourceLines(source_line_offset_);
-
- vector<Module::Function *> *functions = &cu_context_->functions;
-
- // Dole out lines to the appropriate functions.
- AssignLinesToFunctions();
-
- // Add our functions, which now have source lines assigned to them,
- // to module_.
- cu_context_->file_context->module_->AddFunctions(functions->begin(),
- functions->end());
-
- // Ownership of the function objects has shifted from cu_context to
- // the Module.
- functions->clear();
-
- cu_context_->file_context->ClearSpecifications();
-}
-
-bool DwarfCUToModule::StartCompilationUnit(uint64 offset,
- uint8 address_size,
- uint8 offset_size,
- uint64 cu_length,
- uint8 dwarf_version) {
- return dwarf_version >= 2;
-}
-
-bool DwarfCUToModule::StartRootDIE(uint64 offset, enum DwarfTag tag) {
- // We don't deal with partial compilation units (the only other tag
- // likely to be used for root DIE).
- return tag == dwarf2reader::DW_TAG_compile_unit;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h
deleted file mode 100644
index fca92710e6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module.h
+++ /dev/null
@@ -1,320 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// Add DWARF debugging information to a Breakpad symbol file. This
-// file defines the DwarfCUToModule class, which accepts parsed DWARF
-// data and populates a google_breakpad::Module with the results; the
-// Module can then write its contents as a Breakpad symbol file.
-
-#ifndef COMMON_LINUX_DWARF_CU_TO_MODULE_H__
-#define COMMON_LINUX_DWARF_CU_TO_MODULE_H__
-
-#include <stdint.h>
-
-#include <string>
-
-#include "common/language.h"
-#include "common/module.h"
-#include "common/dwarf/bytereader.h"
-#include "common/dwarf/dwarf2diehandler.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using dwarf2reader::DwarfAttribute;
-using dwarf2reader::DwarfForm;
-using dwarf2reader::DwarfLanguage;
-using dwarf2reader::DwarfTag;
-
-// Populate a google_breakpad::Module with DWARF debugging information.
-//
-// An instance of this class can be provided as a handler to a
-// dwarf2reader::DIEDispatcher, which can in turn be a handler for a
-// dwarf2reader::CompilationUnit DWARF parser. The handler uses the results
-// of parsing to populate a google_breakpad::Module with source file,
-// function, and source line information.
-class DwarfCUToModule: public dwarf2reader::RootDIEHandler {
- struct FilePrivate;
- public:
- // Information global to the DWARF-bearing file we are processing,
- // for use by DwarfCUToModule. Each DwarfCUToModule instance deals
- // with a single compilation unit within the file, but information
- // global to the whole file is held here. The client is responsible
- // for filling it in appropriately (except for the 'file_private'
- // field, which the constructor and destructor take care of), and
- // then providing it to the DwarfCUToModule instance for each
- // compilation unit we process in that file. Set HANDLE_INTER_CU_REFS
- // to true to handle debugging symbols with DW_FORM_ref_addr entries.
- class FileContext {
- public:
- FileContext(const string &filename,
- Module *module,
- bool handle_inter_cu_refs);
- ~FileContext();
-
- // Add CONTENTS of size LENGTH to the section map as NAME.
- void AddSectionToSectionMap(const string& name,
- const uint8_t *contents,
- uint64 length);
-
- // Clear the section map for testing.
- void ClearSectionMapForTest();
-
- const dwarf2reader::SectionMap& section_map() const;
-
- private:
- friend class DwarfCUToModule;
-
- // Clears all the Specifications if HANDLE_INTER_CU_REFS_ is false.
- void ClearSpecifications();
-
- // Given an OFFSET and a CU that starts at COMPILATION_UNIT_START, returns
- // true if this is an inter-compilation unit reference that is not being
- // handled.
- bool IsUnhandledInterCUReference(uint64 offset,
- uint64 compilation_unit_start) const;
-
- // The name of this file, for use in error messages.
- const string filename_;
-
- // A map of this file's sections, used for finding other DWARF
- // sections that the .debug_info section may refer to.
- dwarf2reader::SectionMap section_map_;
-
- // The Module to which we're contributing definitions.
- Module *module_;
-
- // True if we are handling references between compilation units.
- const bool handle_inter_cu_refs_;
-
- // Inter-compilation unit data used internally by the handlers.
- scoped_ptr<FilePrivate> file_private_;
- };
-
- // An abstract base class for handlers that handle DWARF line data
- // for DwarfCUToModule. DwarfCUToModule could certainly just use
- // dwarf2reader::LineInfo itself directly, but decoupling things
- // this way makes unit testing a little easier.
- class LineToModuleHandler {
- public:
- LineToModuleHandler() { }
- virtual ~LineToModuleHandler() { }
-
- // Called at the beginning of a new compilation unit, prior to calling
- // ReadProgram(). compilation_dir will indicate the path that the
- // current compilation unit was compiled in, consistent with the
- // DW_AT_comp_dir DIE.
- virtual void StartCompilationUnit(const string& compilation_dir) = 0;
-
- // Populate MODULE and LINES with source file names and code/line
- // mappings, given a pointer to some DWARF line number data
- // PROGRAM, and an overestimate of its size. Add no zero-length
- // lines to LINES.
- virtual void ReadProgram(const uint8_t *program, uint64 length,
- Module *module, vector<Module::Line> *lines) = 0;
- };
-
- // The interface DwarfCUToModule uses to report warnings. The member
- // function definitions for this class write messages to stderr, but
- // you can override them if you'd like to detect or report these
- // conditions yourself.
- class WarningReporter {
- public:
- // Warn about problems in the DWARF file FILENAME, in the
- // compilation unit at OFFSET.
- WarningReporter(const string &filename, uint64 cu_offset)
- : filename_(filename), cu_offset_(cu_offset), printed_cu_header_(false),
- printed_unpaired_header_(false),
- uncovered_warnings_enabled_(false) { }
- virtual ~WarningReporter() { }
-
- // Set the name of the compilation unit we're processing to NAME.
- virtual void SetCUName(const string &name) { cu_name_ = name; }
-
- // Accessor and setter for uncovered_warnings_enabled_.
- // UncoveredFunction and UncoveredLine only report a problem if that is
- // true. By default, these warnings are disabled, because those
- // conditions occur occasionally in healthy code.
- virtual bool uncovered_warnings_enabled() const {
- return uncovered_warnings_enabled_;
- }
- virtual void set_uncovered_warnings_enabled(bool value) {
- uncovered_warnings_enabled_ = value;
- }
-
- // A DW_AT_specification in the DIE at OFFSET refers to a DIE we
- // haven't processed yet, or that wasn't marked as a declaration,
- // at TARGET.
- virtual void UnknownSpecification(uint64 offset, uint64 target);
-
- // A DW_AT_abstract_origin in the DIE at OFFSET refers to a DIE we
- // haven't processed yet, or that wasn't marked as inline, at TARGET.
- virtual void UnknownAbstractOrigin(uint64 offset, uint64 target);
-
- // We were unable to find the DWARF section named SECTION_NAME.
- virtual void MissingSection(const string &section_name);
-
- // The CU's DW_AT_stmt_list offset OFFSET is bogus.
- virtual void BadLineInfoOffset(uint64 offset);
-
- // FUNCTION includes code covered by no line number data.
- virtual void UncoveredFunction(const Module::Function &function);
-
- // Line number NUMBER in LINE_FILE, of length LENGTH, includes code
- // covered by no function.
- virtual void UncoveredLine(const Module::Line &line);
-
- // The DW_TAG_subprogram DIE at OFFSET has no name specified directly
- // in the DIE, nor via a DW_AT_specification or DW_AT_abstract_origin
- // link.
- virtual void UnnamedFunction(uint64 offset);
-
- // __cxa_demangle() failed to demangle INPUT.
- virtual void DemangleError(const string &input, int error);
-
- // The DW_FORM_ref_addr at OFFSET to TARGET was not handled because
- // FilePrivate did not retain the inter-CU specification data.
- virtual void UnhandledInterCUReference(uint64 offset, uint64 target);
-
- uint64 cu_offset() const {
- return cu_offset_;
- }
-
- protected:
- const string filename_;
- const uint64 cu_offset_;
- string cu_name_;
- bool printed_cu_header_;
- bool printed_unpaired_header_;
- bool uncovered_warnings_enabled_;
-
- private:
- // Print a per-CU heading, once.
- void CUHeading();
- // Print an unpaired function/line heading, once.
- void UncoveredHeading();
- };
-
- // Create a DWARF debugging info handler for a compilation unit
- // within FILE_CONTEXT. This uses information received from the
- // dwarf2reader::CompilationUnit DWARF parser to populate
- // FILE_CONTEXT->module. Use LINE_READER to handle the compilation
- // unit's line number data. Use REPORTER to report problems with the
- // data we find.
- DwarfCUToModule(FileContext *file_context,
- LineToModuleHandler *line_reader,
- WarningReporter *reporter);
- ~DwarfCUToModule();
-
- void ProcessAttributeSigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- int64 data);
- void ProcessAttributeUnsigned(enum DwarfAttribute attr,
- enum DwarfForm form,
- uint64 data);
- void ProcessAttributeString(enum DwarfAttribute attr,
- enum DwarfForm form,
- const string &data);
- bool EndAttributes();
- DIEHandler *FindChildHandler(uint64 offset, enum DwarfTag tag);
-
- // Assign all our source Lines to the Functions that cover their
- // addresses, and then add them to module_.
- void Finish();
-
- bool StartCompilationUnit(uint64 offset, uint8 address_size,
- uint8 offset_size, uint64 cu_length,
- uint8 dwarf_version);
- bool StartRootDIE(uint64 offset, enum DwarfTag tag);
-
- private:
- // Used internally by the handler. Full definitions are in
- // dwarf_cu_to_module.cc.
- struct CUContext;
- struct DIEContext;
- struct Specification;
- class GenericDIEHandler;
- class FuncHandler;
- class NamedScopeHandler;
-
- // A map from section offsets to specifications.
- typedef map<uint64, Specification> SpecificationByOffset;
-
- // Set this compilation unit's source language to LANGUAGE.
- void SetLanguage(DwarfLanguage language);
-
- // Read source line information at OFFSET in the .debug_line
- // section. Record source files in module_, but record source lines
- // in lines_; we apportion them to functions in
- // AssignLinesToFunctions.
- void ReadSourceLines(uint64 offset);
-
- // Assign the lines in lines_ to the individual line lists of the
- // functions in functions_. (DWARF line information maps an entire
- // compilation unit at a time, and gives no indication of which
- // lines belong to which functions, beyond their addresses.)
- void AssignLinesToFunctions();
-
- // The only reason cu_context_ and child_context_ are pointers is
- // that we want to keep their definitions private to
- // dwarf_cu_to_module.cc, instead of listing them all here. They are
- // owned by this DwarfCUToModule: the constructor sets them, and the
- // destructor deletes them.
-
- // The handler to use to handle line number data.
- LineToModuleHandler *line_reader_;
-
- // This compilation unit's context.
- scoped_ptr<CUContext> cu_context_;
-
- // A context for our children.
- scoped_ptr<DIEContext> child_context_;
-
- // True if this compilation unit has source line information.
- bool has_source_line_info_;
-
- // The offset of this compilation unit's line number information in
- // the .debug_line section.
- uint64 source_line_offset_;
-
- // The line numbers we have seen thus far. We accumulate these here
- // during parsing. Then, in Finish, we call AssignLinesToFunctions
- // to dole them out to the appropriate functions.
- vector<Module::Line> lines_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_DWARF_CU_TO_MODULE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc
deleted file mode 100644
index 619e90a2ee..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_cu_to_module_unittest.cc
+++ /dev/null
@@ -1,1804 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf_cu_to_module.cc: Unit tests for google_breakpad::DwarfCUToModule.
-
-#include <stdint.h>
-
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/dwarf_cu_to_module.h"
-#include "common/using_std_string.h"
-
-using std::make_pair;
-using std::vector;
-
-using dwarf2reader::DIEHandler;
-using dwarf2reader::DwarfTag;
-using dwarf2reader::DwarfAttribute;
-using dwarf2reader::DwarfForm;
-using dwarf2reader::DwarfInline;
-using dwarf2reader::RootDIEHandler;
-using google_breakpad::DwarfCUToModule;
-using google_breakpad::Module;
-
-using ::testing::_;
-using ::testing::AtMost;
-using ::testing::Invoke;
-using ::testing::Return;
-using ::testing::Test;
-using ::testing::TestWithParam;
-using ::testing::Values;
-using ::testing::ValuesIn;
-
-// Mock classes.
-
-class MockLineToModuleHandler: public DwarfCUToModule::LineToModuleHandler {
- public:
- MOCK_METHOD1(StartCompilationUnit, void(const string& compilation_dir));
- MOCK_METHOD4(ReadProgram, void(const uint8_t *program, uint64 length,
- Module *module, vector<Module::Line> *lines));
-};
-
-class MockWarningReporter: public DwarfCUToModule::WarningReporter {
- public:
- MockWarningReporter(const string &filename, uint64 cu_offset)
- : DwarfCUToModule::WarningReporter(filename, cu_offset) { }
- MOCK_METHOD1(SetCUName, void(const string &name));
- MOCK_METHOD2(UnknownSpecification, void(uint64 offset, uint64 target));
- MOCK_METHOD2(UnknownAbstractOrigin, void(uint64 offset, uint64 target));
- MOCK_METHOD1(MissingSection, void(const string &section_name));
- MOCK_METHOD1(BadLineInfoOffset, void(uint64 offset));
- MOCK_METHOD1(UncoveredFunction, void(const Module::Function &function));
- MOCK_METHOD1(UncoveredLine, void(const Module::Line &line));
- MOCK_METHOD1(UnnamedFunction, void(uint64 offset));
- MOCK_METHOD2(DemangleError, void(const string &input, int error));
- MOCK_METHOD2(UnhandledInterCUReference, void(uint64 offset, uint64 target));
-};
-
-// A fixture class including all the objects needed to handle a
-// compilation unit, and their entourage. It includes member functions
-// for doing common kinds of setup and tests.
-class CUFixtureBase {
- public:
- // If we have:
- //
- // vector<Module::Line> lines;
- // AppendLinesFunctor appender(lines);
- //
- // then doing:
- //
- // appender(line_program, length, module, line_vector);
- //
- // will append lines to the end of line_vector. We can use this with
- // MockLineToModuleHandler like this:
- //
- // MockLineToModuleHandler l2m;
- // EXPECT_CALL(l2m, ReadProgram(_,_,_,_))
- // .WillOnce(DoAll(Invoke(appender), Return()));
- //
- // in which case calling l2m with some line vector will append lines.
- class AppendLinesFunctor {
- public:
- explicit AppendLinesFunctor(
- const vector<Module::Line> *lines) : lines_(lines) { }
- void operator()(const uint8_t *program, uint64 length,
- Module *module, vector<Module::Line> *lines) {
- lines->insert(lines->end(), lines_->begin(), lines_->end());
- }
- private:
- const vector<Module::Line> *lines_;
- };
-
- CUFixtureBase()
- : module_("module-name", "module-os", "module-arch", "module-id"),
- file_context_("dwarf-filename", &module_, true),
- language_(dwarf2reader::DW_LANG_none),
- language_signed_(false),
- appender_(&lines_),
- reporter_("dwarf-filename", 0xcf8f9bb6443d29b5LL),
- root_handler_(&file_context_, &line_reader_, &reporter_),
- functions_filled_(false) {
- // By default, expect no warnings to be reported, and expect the
- // compilation unit's name to be provided. The test can override
- // these expectations.
- EXPECT_CALL(reporter_, SetCUName("compilation-unit-name")).Times(1);
- EXPECT_CALL(reporter_, UnknownSpecification(_, _)).Times(0);
- EXPECT_CALL(reporter_, UnknownAbstractOrigin(_, _)).Times(0);
- EXPECT_CALL(reporter_, MissingSection(_)).Times(0);
- EXPECT_CALL(reporter_, BadLineInfoOffset(_)).Times(0);
- EXPECT_CALL(reporter_, UncoveredFunction(_)).Times(0);
- EXPECT_CALL(reporter_, UncoveredLine(_)).Times(0);
- EXPECT_CALL(reporter_, UnnamedFunction(_)).Times(0);
- EXPECT_CALL(reporter_, UnhandledInterCUReference(_, _)).Times(0);
-
- // By default, expect the line program reader not to be invoked. We
- // may override this in StartCU.
- EXPECT_CALL(line_reader_, StartCompilationUnit(_)).Times(0);
- EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_)).Times(0);
-
- // The handler will consult this section map to decide what to
- // pass to our line reader.
- file_context_.AddSectionToSectionMap(".debug_line",
- dummy_line_program_,
- dummy_line_size_);
- }
-
- // Add a line with the given address, size, filename, and line
- // number to the end of the statement list the handler will receive
- // when it invokes its LineToModuleHandler. Call this before calling
- // StartCU.
- void PushLine(Module::Address address, Module::Address size,
- const string &filename, int line_number);
-
- // Use LANGUAGE for the compilation unit. More precisely, arrange
- // for StartCU to pass the compilation unit's root DIE a
- // DW_AT_language attribute whose value is LANGUAGE.
- void SetLanguage(dwarf2reader::DwarfLanguage language) {
- language_ = language;
- }
-
- // If SIGNED true, have StartCU report DW_AT_language as a signed
- // attribute; if false, have it report it as unsigned.
- void SetLanguageSigned(bool is_signed) { language_signed_ = is_signed; }
-
- // Call the handler this.root_handler_'s StartCompilationUnit and
- // StartRootDIE member functions, passing it appropriate attributes as
- // determined by prior calls to PushLine and SetLanguage. Leave
- // this.root_handler_ ready to hear about children: call
- // this.root_handler_.EndAttributes, but not this.root_handler_.Finish.
- void StartCU();
-
- // Have HANDLER process some strange attribute/form/value triples.
- void ProcessStrangeAttributes(dwarf2reader::DIEHandler *handler);
-
- // Start a child DIE of PARENT with the given tag and name. Leave
- // the handler ready to hear about children: call EndAttributes, but
- // not Finish.
- DIEHandler *StartNamedDIE(DIEHandler *parent, DwarfTag tag,
- const string &name);
-
- // Start a child DIE of PARENT with the given tag and a
- // DW_AT_specification attribute whose value is SPECIFICATION. Leave
- // the handler ready to hear about children: call EndAttributes, but
- // not Finish. If NAME is non-zero, use it as the DW_AT_name
- // attribute.
- DIEHandler *StartSpecifiedDIE(DIEHandler *parent, DwarfTag tag,
- uint64 specification, const char *name = NULL);
-
- // Define a function as a child of PARENT with the given name, address, and
- // size. If high_pc_form is DW_FORM_addr then the DW_AT_high_pc attribute
- // will be written as an address; otherwise it will be written as the
- // function's size. Call EndAttributes and Finish; one cannot define
- // children of the defined function's DIE.
- void DefineFunction(DIEHandler *parent, const string &name,
- Module::Address address, Module::Address size,
- const char* mangled_name,
- DwarfForm high_pc_form = dwarf2reader::DW_FORM_addr);
-
- // Create a declaration DIE as a child of PARENT with the given
- // offset, tag and name. If NAME is the empty string, don't provide
- // a DW_AT_name attribute. Call EndAttributes and Finish.
- void DeclarationDIE(DIEHandler *parent, uint64 offset,
- DwarfTag tag, const string &name,
- const string &mangled_name);
-
- // Create a definition DIE as a child of PARENT with the given tag
- // that refers to the declaration DIE at offset SPECIFICATION as its
- // specification. If NAME is non-empty, pass it as the DW_AT_name
- // attribute. If SIZE is non-zero, record ADDRESS and SIZE as
- // low_pc/high_pc attributes.
- void DefinitionDIE(DIEHandler *parent, DwarfTag tag,
- uint64 specification, const string &name,
- Module::Address address = 0, Module::Address size = 0);
-
- // Create an inline DW_TAG_subprogram DIE as a child of PARENT. If
- // SPECIFICATION is non-zero, then the DIE refers to the declaration DIE at
- // offset SPECIFICATION as its specification. If Name is non-empty, pass it
- // as the DW_AT_name attribute.
- void AbstractInstanceDIE(DIEHandler *parent, uint64 offset,
- DwarfInline type, uint64 specification,
- const string &name,
- DwarfForm form = dwarf2reader::DW_FORM_data1);
-
- // Create a DW_TAG_subprogram DIE as a child of PARENT that refers to
- // ORIGIN in its DW_AT_abstract_origin attribute. If NAME is the empty
- // string, don't provide a DW_AT_name attribute.
- void DefineInlineInstanceDIE(DIEHandler *parent, const string &name,
- uint64 origin, Module::Address address,
- Module::Address size);
-
- // The following Test* functions should be called after calling
- // this.root_handler_.Finish. After that point, no further calls
- // should be made on the handler.
-
- // Test that the number of functions defined in the module this.module_ is
- // equal to EXPECTED.
- void TestFunctionCount(size_t expected);
-
- // Test that the I'th function (ordered by address) in the module
- // this.module_ has the given name, address, and size, and that its
- // parameter size is zero.
- void TestFunction(int i, const string &name,
- Module::Address address, Module::Address size);
-
- // Test that the number of source lines owned by the I'th function
- // in the module this.module_ is equal to EXPECTED.
- void TestLineCount(int i, size_t expected);
-
- // Test that the J'th line (ordered by address) of the I'th function
- // (again, by address) has the given address, size, filename, and
- // line number.
- void TestLine(int i, int j, Module::Address address, Module::Address size,
- const string &filename, int number);
-
- // Actual objects under test.
- Module module_;
- DwarfCUToModule::FileContext file_context_;
-
- // If this is not DW_LANG_none, we'll pass it as a DW_AT_language
- // attribute to the compilation unit. This defaults to DW_LANG_none.
- dwarf2reader::DwarfLanguage language_;
-
- // If this is true, report DW_AT_language as a signed value; if false,
- // report it as an unsigned value.
- bool language_signed_;
-
- // If this is not empty, we'll give the CU a DW_AT_comp_dir attribute that
- // indicates the path that this compilation unit was compiled in.
- string compilation_dir_;
-
- // If this is not empty, we'll give the CU a DW_AT_stmt_list
- // attribute that, when passed to line_reader_, adds these lines to the
- // provided lines array.
- vector<Module::Line> lines_;
-
- // Mock line program reader.
- MockLineToModuleHandler line_reader_;
- AppendLinesFunctor appender_;
- static const uint8_t dummy_line_program_[];
- static const size_t dummy_line_size_;
-
- MockWarningReporter reporter_;
- DwarfCUToModule root_handler_;
-
- private:
- // Fill functions_, if we haven't already.
- void FillFunctions();
-
- // If functions_filled_ is true, this is a table of functions we've
- // extracted from module_, sorted by address.
- vector<Module::Function *> functions_;
- // True if we have filled the above vector with this.module_'s function list.
- bool functions_filled_;
-};
-
-const uint8_t CUFixtureBase::dummy_line_program_[] = "lots of fun data";
-const size_t CUFixtureBase::dummy_line_size_ =
- sizeof(CUFixtureBase::dummy_line_program_);
-
-void CUFixtureBase::PushLine(Module::Address address, Module::Address size,
- const string &filename, int line_number) {
- Module::Line l;
- l.address = address;
- l.size = size;
- l.file = module_.FindFile(filename);
- l.number = line_number;
- lines_.push_back(l);
-}
-
-void CUFixtureBase::StartCU() {
- if (!compilation_dir_.empty())
- EXPECT_CALL(line_reader_,
- StartCompilationUnit(compilation_dir_)).Times(1);
-
- // If we have lines, make the line reader expect to be invoked at
- // most once. (Hey, if the handler can pass its tests without
- // bothering to read the line number data, that's great.)
- // Have it add the lines passed to PushLine. Otherwise, leave the
- // initial expectation (no calls) in force.
- if (!lines_.empty())
- EXPECT_CALL(line_reader_,
- ReadProgram(&dummy_line_program_[0], dummy_line_size_,
- &module_, _))
- .Times(AtMost(1))
- .WillOnce(DoAll(Invoke(appender_), Return()));
-
- ASSERT_TRUE(root_handler_
- .StartCompilationUnit(0x51182ec307610b51ULL, 0x81, 0x44,
- 0x4241b4f33720dd5cULL, 3));
- {
- ASSERT_TRUE(root_handler_.StartRootDIE(0x02e56bfbda9e7337ULL,
- dwarf2reader::DW_TAG_compile_unit));
- }
- root_handler_.ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- "compilation-unit-name");
- if (!compilation_dir_.empty())
- root_handler_.ProcessAttributeString(dwarf2reader::DW_AT_comp_dir,
- dwarf2reader::DW_FORM_strp,
- compilation_dir_);
- if (!lines_.empty())
- root_handler_.ProcessAttributeUnsigned(dwarf2reader::DW_AT_stmt_list,
- dwarf2reader::DW_FORM_ref4,
- 0);
- if (language_ != dwarf2reader::DW_LANG_none) {
- if (language_signed_)
- root_handler_.ProcessAttributeSigned(dwarf2reader::DW_AT_language,
- dwarf2reader::DW_FORM_sdata,
- language_);
- else
- root_handler_.ProcessAttributeUnsigned(dwarf2reader::DW_AT_language,
- dwarf2reader::DW_FORM_udata,
- language_);
- }
- ASSERT_TRUE(root_handler_.EndAttributes());
-}
-
-void CUFixtureBase::ProcessStrangeAttributes(
- dwarf2reader::DIEHandler *handler) {
- handler->ProcessAttributeUnsigned((DwarfAttribute) 0xf560dead,
- (DwarfForm) 0x4106e4db,
- 0xa592571997facda1ULL);
- handler->ProcessAttributeSigned((DwarfAttribute) 0x85380095,
- (DwarfForm) 0x0f16fe87,
- 0x12602a4e3bf1f446LL);
- handler->ProcessAttributeReference((DwarfAttribute) 0xf7f7480f,
- (DwarfForm) 0x829e038a,
- 0x50fddef44734fdecULL);
- static const uint8_t buffer[10] = "frobynode";
- handler->ProcessAttributeBuffer((DwarfAttribute) 0xa55ffb51,
- (DwarfForm) 0x2f43b041,
- buffer, sizeof(buffer));
- handler->ProcessAttributeString((DwarfAttribute) 0x2f43b041,
- (DwarfForm) 0x895ffa23,
- "strange string");
-}
-
-DIEHandler *CUFixtureBase::StartNamedDIE(DIEHandler *parent,
- DwarfTag tag,
- const string &name) {
- dwarf2reader::DIEHandler *handler
- = parent->FindChildHandler(0x8f4c783c0467c989ULL, tag);
- if (!handler)
- return NULL;
- handler->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
- ProcessStrangeAttributes(handler);
- if (!handler->EndAttributes()) {
- handler->Finish();
- delete handler;
- return NULL;
- }
-
- return handler;
-}
-
-DIEHandler *CUFixtureBase::StartSpecifiedDIE(DIEHandler *parent,
- DwarfTag tag,
- uint64 specification,
- const char *name) {
- dwarf2reader::DIEHandler *handler
- = parent->FindChildHandler(0x8f4c783c0467c989ULL, tag);
- if (!handler)
- return NULL;
- if (name)
- handler->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
- handler->ProcessAttributeReference(dwarf2reader::DW_AT_specification,
- dwarf2reader::DW_FORM_ref4,
- specification);
- if (!handler->EndAttributes()) {
- handler->Finish();
- delete handler;
- return NULL;
- }
-
- return handler;
-}
-
-void CUFixtureBase::DefineFunction(dwarf2reader::DIEHandler *parent,
- const string &name, Module::Address address,
- Module::Address size,
- const char* mangled_name,
- DwarfForm high_pc_form) {
- dwarf2reader::DIEHandler *func
- = parent->FindChildHandler(0xe34797c7e68590a8LL,
- dwarf2reader::DW_TAG_subprogram);
- ASSERT_TRUE(func != NULL);
- func->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
- func->ProcessAttributeUnsigned(dwarf2reader::DW_AT_low_pc,
- dwarf2reader::DW_FORM_addr,
- address);
-
- Module::Address high_pc = size;
- if (high_pc_form == dwarf2reader::DW_FORM_addr) {
- high_pc += address;
- }
- func->ProcessAttributeUnsigned(dwarf2reader::DW_AT_high_pc,
- high_pc_form,
- high_pc);
-
- if (mangled_name)
- func->ProcessAttributeString(dwarf2reader::DW_AT_MIPS_linkage_name,
- dwarf2reader::DW_FORM_strp,
- mangled_name);
-
- ProcessStrangeAttributes(func);
- EXPECT_TRUE(func->EndAttributes());
- func->Finish();
- delete func;
-}
-
-void CUFixtureBase::DeclarationDIE(DIEHandler *parent, uint64 offset,
- DwarfTag tag,
- const string &name,
- const string &mangled_name) {
- dwarf2reader::DIEHandler *die = parent->FindChildHandler(offset, tag);
- ASSERT_TRUE(die != NULL);
- if (!name.empty())
- die->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
- if (!mangled_name.empty())
- die->ProcessAttributeString(dwarf2reader::DW_AT_MIPS_linkage_name,
- dwarf2reader::DW_FORM_strp,
- mangled_name);
-
- die->ProcessAttributeUnsigned(dwarf2reader::DW_AT_declaration,
- dwarf2reader::DW_FORM_flag,
- 1);
- EXPECT_TRUE(die->EndAttributes());
- die->Finish();
- delete die;
-}
-
-void CUFixtureBase::DefinitionDIE(DIEHandler *parent,
- DwarfTag tag,
- uint64 specification,
- const string &name,
- Module::Address address,
- Module::Address size) {
- dwarf2reader::DIEHandler *die
- = parent->FindChildHandler(0x6ccfea031a9e6cc9ULL, tag);
- ASSERT_TRUE(die != NULL);
- die->ProcessAttributeReference(dwarf2reader::DW_AT_specification,
- dwarf2reader::DW_FORM_ref4,
- specification);
- if (!name.empty())
- die->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
- if (size) {
- die->ProcessAttributeUnsigned(dwarf2reader::DW_AT_low_pc,
- dwarf2reader::DW_FORM_addr,
- address);
- die->ProcessAttributeUnsigned(dwarf2reader::DW_AT_high_pc,
- dwarf2reader::DW_FORM_addr,
- address + size);
- }
- EXPECT_TRUE(die->EndAttributes());
- die->Finish();
- delete die;
-}
-
-void CUFixtureBase::AbstractInstanceDIE(DIEHandler *parent,
- uint64 offset,
- DwarfInline type,
- uint64 specification,
- const string &name,
- DwarfForm form) {
- dwarf2reader::DIEHandler *die
- = parent->FindChildHandler(offset, dwarf2reader::DW_TAG_subprogram);
- ASSERT_TRUE(die != NULL);
- if (specification != 0ULL)
- die->ProcessAttributeReference(dwarf2reader::DW_AT_specification,
- dwarf2reader::DW_FORM_ref4,
- specification);
- if (form == dwarf2reader::DW_FORM_sdata) {
- die->ProcessAttributeSigned(dwarf2reader::DW_AT_inline, form, type);
- } else {
- die->ProcessAttributeUnsigned(dwarf2reader::DW_AT_inline, form, type);
- }
- if (!name.empty())
- die->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
-
- EXPECT_TRUE(die->EndAttributes());
- die->Finish();
- delete die;
-}
-
-void CUFixtureBase::DefineInlineInstanceDIE(DIEHandler *parent,
- const string &name,
- uint64 origin,
- Module::Address address,
- Module::Address size) {
- dwarf2reader::DIEHandler *func
- = parent->FindChildHandler(0x11c70f94c6e87ccdLL,
- dwarf2reader::DW_TAG_subprogram);
- ASSERT_TRUE(func != NULL);
- if (!name.empty()) {
- func->ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- name);
- }
- func->ProcessAttributeUnsigned(dwarf2reader::DW_AT_low_pc,
- dwarf2reader::DW_FORM_addr,
- address);
- func->ProcessAttributeUnsigned(dwarf2reader::DW_AT_high_pc,
- dwarf2reader::DW_FORM_addr,
- address + size);
- func->ProcessAttributeReference(dwarf2reader::DW_AT_abstract_origin,
- dwarf2reader::DW_FORM_ref4,
- origin);
- ProcessStrangeAttributes(func);
- EXPECT_TRUE(func->EndAttributes());
- func->Finish();
- delete func;
-}
-
-void CUFixtureBase::FillFunctions() {
- if (functions_filled_)
- return;
- module_.GetFunctions(&functions_, functions_.end());
- sort(functions_.begin(), functions_.end(),
- Module::Function::CompareByAddress);
- functions_filled_ = true;
-}
-
-void CUFixtureBase::TestFunctionCount(size_t expected) {
- FillFunctions();
- ASSERT_EQ(expected, functions_.size());
-}
-
-void CUFixtureBase::TestFunction(int i, const string &name,
- Module::Address address,
- Module::Address size) {
- FillFunctions();
- ASSERT_LT((size_t) i, functions_.size());
-
- Module::Function *function = functions_[i];
- EXPECT_EQ(name, function->name);
- EXPECT_EQ(address, function->address);
- EXPECT_EQ(size, function->size);
- EXPECT_EQ(0U, function->parameter_size);
-}
-
-void CUFixtureBase::TestLineCount(int i, size_t expected) {
- FillFunctions();
- ASSERT_LT((size_t) i, functions_.size());
-
- ASSERT_EQ(expected, functions_[i]->lines.size());
-}
-
-void CUFixtureBase::TestLine(int i, int j,
- Module::Address address, Module::Address size,
- const string &filename, int number) {
- FillFunctions();
- ASSERT_LT((size_t) i, functions_.size());
- ASSERT_LT((size_t) j, functions_[i]->lines.size());
-
- Module::Line *line = &functions_[i]->lines[j];
- EXPECT_EQ(address, line->address);
- EXPECT_EQ(size, line->size);
- EXPECT_EQ(filename, line->file->name.c_str());
- EXPECT_EQ(number, line->number);
-}
-
-// Include caller locations for our test subroutines.
-#define TRACE(call) do { SCOPED_TRACE("called from here"); call; } while (0)
-#define PushLine(a,b,c,d) TRACE(PushLine((a),(b),(c),(d)))
-#define SetLanguage(a) TRACE(SetLanguage(a))
-#define StartCU() TRACE(StartCU())
-#define DefineFunction(a,b,c,d,e) TRACE(DefineFunction((a),(b),(c),(d),(e)))
-// (DefineFunction) instead of DefineFunction to avoid macro expansion.
-#define DefineFunction6(a,b,c,d,e,f) \
- TRACE((DefineFunction)((a),(b),(c),(d),(e),(f)))
-#define DeclarationDIE(a,b,c,d,e) TRACE(DeclarationDIE((a),(b),(c),(d),(e)))
-#define DefinitionDIE(a,b,c,d,e,f) \
- TRACE(DefinitionDIE((a),(b),(c),(d),(e),(f)))
-#define TestFunctionCount(a) TRACE(TestFunctionCount(a))
-#define TestFunction(a,b,c,d) TRACE(TestFunction((a),(b),(c),(d)))
-#define TestLineCount(a,b) TRACE(TestLineCount((a),(b)))
-#define TestLine(a,b,c,d,e,f) TRACE(TestLine((a),(b),(c),(d),(e),(f)))
-
-class SimpleCU: public CUFixtureBase, public Test {
-};
-
-TEST_F(SimpleCU, CompilationDir) {
- compilation_dir_ = "/src/build/";
-
- StartCU();
- root_handler_.Finish();
-}
-
-TEST_F(SimpleCU, OneFunc) {
- PushLine(0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, "line-file", 246571772);
-
- StartCU();
- DefineFunction(&root_handler_, "function1",
- 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "function1", 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL);
- TestLineCount(0, 1);
- TestLine(0, 0, 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, "line-file",
- 246571772);
-}
-
-// As above, only DW_AT_high_pc is a length rather than an address.
-TEST_F(SimpleCU, OneFuncHighPcIsLength) {
- PushLine(0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, "line-file", 246571772);
-
- StartCU();
- DefineFunction6(&root_handler_, "function1",
- 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, NULL,
- dwarf2reader::DW_FORM_udata);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "function1", 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL);
- TestLineCount(0, 1);
- TestLine(0, 0, 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, "line-file",
- 246571772);
-}
-
-TEST_F(SimpleCU, MangledName) {
- PushLine(0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, "line-file", 246571772);
-
- StartCU();
- DefineFunction(&root_handler_, "function1",
- 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL, "_ZN1n1fEi");
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "n::f(int)", 0x938cf8c07def4d34ULL, 0x55592d727f6cd01fLL);
-}
-
-TEST_F(SimpleCU, IrrelevantRootChildren) {
- StartCU();
- EXPECT_FALSE(root_handler_
- .FindChildHandler(0x7db32bff4e2dcfb1ULL,
- dwarf2reader::DW_TAG_lexical_block));
-}
-
-TEST_F(SimpleCU, IrrelevantNamedScopeChildren) {
- StartCU();
- DIEHandler *class_A_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type, "class_A");
- EXPECT_TRUE(class_A_handler != NULL);
- EXPECT_FALSE(class_A_handler
- ->FindChildHandler(0x02e55999b865e4e9ULL,
- dwarf2reader::DW_TAG_lexical_block));
- delete class_A_handler;
-}
-
-// Verify that FileContexts can safely be deleted unused.
-TEST_F(SimpleCU, UnusedFileContext) {
- Module m("module-name", "module-os", "module-arch", "module-id");
- DwarfCUToModule::FileContext fc("dwarf-filename", &m, true);
-
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-}
-
-TEST_F(SimpleCU, InlineFunction) {
- PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
-
- StartCU();
- AbstractInstanceDIE(&root_handler_, 0x1e8dac5d507ed7abULL,
- dwarf2reader::DW_INL_inlined, 0, "inline-name");
- DefineInlineInstanceDIE(&root_handler_, "", 0x1e8dac5d507ed7abULL,
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "inline-name",
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
-}
-
-TEST_F(SimpleCU, InlineFunctionSignedAttribute) {
- PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
-
- StartCU();
- AbstractInstanceDIE(&root_handler_, 0x1e8dac5d507ed7abULL,
- dwarf2reader::DW_INL_inlined, 0, "inline-name",
- dwarf2reader::DW_FORM_sdata);
- DefineInlineInstanceDIE(&root_handler_, "", 0x1e8dac5d507ed7abULL,
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "inline-name",
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
-}
-
-// Any DIE with an DW_AT_inline attribute can be cited by
-// DW_AT_abstract_origin attributes --- even if the value of the
-// DW_AT_inline attribute is DW_INL_not_inlined.
-TEST_F(SimpleCU, AbstractOriginNotInlined) {
- PushLine(0x2805c4531be6ca0eULL, 0x686b52155a8d4d2cULL, "line-file", 6111581);
-
- StartCU();
- AbstractInstanceDIE(&root_handler_, 0x93e9cdad52826b39ULL,
- dwarf2reader::DW_INL_not_inlined, 0, "abstract-instance");
- DefineInlineInstanceDIE(&root_handler_, "", 0x93e9cdad52826b39ULL,
- 0x2805c4531be6ca0eULL, 0x686b52155a8d4d2cULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "abstract-instance",
- 0x2805c4531be6ca0eULL, 0x686b52155a8d4d2cULL);
-}
-
-TEST_F(SimpleCU, UnknownAbstractOrigin) {
- EXPECT_CALL(reporter_, UnknownAbstractOrigin(_, 1ULL)).WillOnce(Return());
- EXPECT_CALL(reporter_, UnnamedFunction(0x11c70f94c6e87ccdLL))
- .WillOnce(Return());
- PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
-
- StartCU();
- AbstractInstanceDIE(&root_handler_, 0x1e8dac5d507ed7abULL,
- dwarf2reader::DW_INL_inlined, 0, "inline-name");
- DefineInlineInstanceDIE(&root_handler_, "", 1ULL,
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "<name omitted>",
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
-}
-
-TEST_F(SimpleCU, UnnamedFunction) {
- EXPECT_CALL(reporter_, UnnamedFunction(0xe34797c7e68590a8LL))
- .WillOnce(Return());
- PushLine(0x72b80e41a0ac1d40ULL, 0x537174f231ee181cULL, "line-file", 14044850);
-
- StartCU();
- DefineFunction(&root_handler_, "",
- 0x72b80e41a0ac1d40ULL, 0x537174f231ee181cULL, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "<name omitted>",
- 0x72b80e41a0ac1d40ULL, 0x537174f231ee181cULL);
-}
-
-// An address range.
-struct Range {
- Module::Address start, end;
-};
-
-// Test data for pairing functions and lines.
-struct Situation {
- // Two function intervals, and two line intervals.
- Range functions[2], lines[2];
-
- // The number of lines we expect to be assigned to each of the
- // functions, and the address ranges.
- int paired_count[2];
- Range paired[2][2];
-
- // The number of functions that are not entirely covered by lines,
- // and vice versa.
- int uncovered_functions, uncovered_lines;
-};
-
-#define PAIRING(func1_start, func1_end, func2_start, func2_end, \
- line1_start, line1_end, line2_start, line2_end, \
- func1_num_lines, func2_num_lines, \
- func1_line1_start, func1_line1_end, \
- func1_line2_start, func1_line2_end, \
- func2_line1_start, func2_line1_end, \
- func2_line2_start, func2_line2_end, \
- uncovered_functions, uncovered_lines) \
- { { { func1_start, func1_end }, { func2_start, func2_end } }, \
- { { line1_start, line1_end }, { line2_start, line2_end } }, \
- { func1_num_lines, func2_num_lines }, \
- { { { func1_line1_start, func1_line1_end }, \
- { func1_line2_start, func1_line2_end } }, \
- { { func2_line1_start, func2_line1_end }, \
- { func2_line2_start, func2_line2_end } } }, \
- uncovered_functions, uncovered_lines },
-
-Situation situations[] = {
-#include "common/testdata/func-line-pairing.h"
-};
-
-#undef PAIRING
-
-class FuncLinePairing: public CUFixtureBase,
- public TestWithParam<Situation> { };
-
-INSTANTIATE_TEST_CASE_P(AllSituations, FuncLinePairing,
- ValuesIn(situations));
-
-TEST_P(FuncLinePairing, Pairing) {
- const Situation &s = GetParam();
- PushLine(s.lines[0].start,
- s.lines[0].end - s.lines[0].start,
- "line-file", 67636963);
- PushLine(s.lines[1].start,
- s.lines[1].end - s.lines[1].start,
- "line-file", 67636963);
- if (s.uncovered_functions)
- EXPECT_CALL(reporter_, UncoveredFunction(_))
- .Times(s.uncovered_functions)
- .WillRepeatedly(Return());
- if (s.uncovered_lines)
- EXPECT_CALL(reporter_, UncoveredLine(_))
- .Times(s.uncovered_lines)
- .WillRepeatedly(Return());
-
- StartCU();
- DefineFunction(&root_handler_, "function1",
- s.functions[0].start,
- s.functions[0].end - s.functions[0].start, NULL);
- DefineFunction(&root_handler_, "function2",
- s.functions[1].start,
- s.functions[1].end - s.functions[1].start, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(2);
- TestFunction(0, "function1",
- s.functions[0].start,
- s.functions[0].end - s.functions[0].start);
- TestLineCount(0, s.paired_count[0]);
- for (int i = 0; i < s.paired_count[0]; i++)
- TestLine(0, i, s.paired[0][i].start,
- s.paired[0][i].end - s.paired[0][i].start,
- "line-file", 67636963);
- TestFunction(1, "function2",
- s.functions[1].start,
- s.functions[1].end - s.functions[1].start);
- TestLineCount(1, s.paired_count[1]);
- for (int i = 0; i < s.paired_count[1]; i++)
- TestLine(1, i, s.paired[1][i].start,
- s.paired[1][i].end - s.paired[1][i].start,
- "line-file", 67636963);
-}
-
-TEST_F(FuncLinePairing, EmptyCU) {
- StartCU();
- root_handler_.Finish();
-
- TestFunctionCount(0);
-}
-
-TEST_F(FuncLinePairing, LinesNoFuncs) {
- PushLine(40, 2, "line-file", 82485646);
- EXPECT_CALL(reporter_, UncoveredLine(_)).WillOnce(Return());
-
- StartCU();
- root_handler_.Finish();
-
- TestFunctionCount(0);
-}
-
-TEST_F(FuncLinePairing, FuncsNoLines) {
- EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return());
-
- StartCU();
- DefineFunction(&root_handler_, "function1", 0x127da12ffcf5c51fULL, 0x1000U,
- NULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "function1", 0x127da12ffcf5c51fULL, 0x1000U);
-}
-
-TEST_F(FuncLinePairing, GapThenFunction) {
- PushLine(20, 2, "line-file-2", 174314698);
- PushLine(10, 2, "line-file-1", 263008005);
-
- StartCU();
- DefineFunction(&root_handler_, "function1", 10, 2, NULL);
- DefineFunction(&root_handler_, "function2", 20, 2, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(2);
- TestFunction(0, "function1", 10, 2);
- TestLineCount(0, 1);
- TestLine(0, 0, 10, 2, "line-file-1", 263008005);
- TestFunction(1, "function2", 20, 2);
- TestLineCount(1, 1);
- TestLine(1, 0, 20, 2, "line-file-2", 174314698);
-}
-
-// If GCC emits padding after one function to align the start of
-// the next, then it will attribute the padding instructions to
-// the last source line of function (to reduce the size of the
-// line number info), but omit it from the DW_AT_{low,high}_pc
-// range given in .debug_info (since it costs nothing to be
-// precise there). If we did use at least some of the line
-// we're about to skip, then assume this is what happened, and
-// don't warn.
-TEST_F(FuncLinePairing, GCCAlignmentStretch) {
- PushLine(10, 10, "line-file", 63351048);
- PushLine(20, 10, "line-file", 61661044);
-
- StartCU();
- DefineFunction(&root_handler_, "function1", 10, 5, NULL);
- // five-byte gap between functions, covered by line 63351048.
- // This should not elicit a warning.
- DefineFunction(&root_handler_, "function2", 20, 10, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(2);
- TestFunction(0, "function1", 10, 5);
- TestLineCount(0, 1);
- TestLine(0, 0, 10, 5, "line-file", 63351048);
- TestFunction(1, "function2", 20, 10);
- TestLineCount(1, 1);
- TestLine(1, 0, 20, 10, "line-file", 61661044);
-}
-
-// Unfortunately, neither the DWARF parser's handler interface nor the
-// DIEHandler interface is capable of expressing a function that abuts
-// the end of the address space: the high_pc value looks like zero.
-
-TEST_F(FuncLinePairing, LineAtEndOfAddressSpace) {
- PushLine(0xfffffffffffffff0ULL, 16, "line-file", 63351048);
- EXPECT_CALL(reporter_, UncoveredLine(_)).WillOnce(Return());
-
- StartCU();
- DefineFunction(&root_handler_, "function1", 0xfffffffffffffff0ULL, 6, NULL);
- DefineFunction(&root_handler_, "function2", 0xfffffffffffffffaULL, 5, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(2);
- TestFunction(0, "function1", 0xfffffffffffffff0ULL, 6);
- TestLineCount(0, 1);
- TestLine(0, 0, 0xfffffffffffffff0ULL, 6, "line-file", 63351048);
- TestFunction(1, "function2", 0xfffffffffffffffaULL, 5);
- TestLineCount(1, 1);
- TestLine(1, 0, 0xfffffffffffffffaULL, 5, "line-file", 63351048);
-}
-
-// A function with more than one uncovered area should only be warned
-// about once.
-TEST_F(FuncLinePairing, WarnOnceFunc) {
- PushLine(20, 1, "line-file-2", 262951329);
- PushLine(11, 1, "line-file-1", 219964021);
- EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return());
-
- StartCU();
- DefineFunction(&root_handler_, "function", 10, 11, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "function", 10, 11);
- TestLineCount(0, 2);
- TestLine(0, 0, 11, 1, "line-file-1", 219964021);
- TestLine(0, 1, 20, 1, "line-file-2", 262951329);
-}
-
-// A line with more than one uncovered area should only be warned
-// about once.
-TEST_F(FuncLinePairing, WarnOnceLine) {
- PushLine(10, 20, "filename1", 118581871);
- EXPECT_CALL(reporter_, UncoveredLine(_)).WillOnce(Return());
-
- StartCU();
- DefineFunction(&root_handler_, "function1", 11, 1, NULL);
- DefineFunction(&root_handler_, "function2", 13, 1, NULL);
- root_handler_.Finish();
-
- TestFunctionCount(2);
- TestFunction(0, "function1", 11, 1);
- TestLineCount(0, 1);
- TestLine(0, 0, 11, 1, "filename1", 118581871);
- TestFunction(1, "function2", 13, 1);
- TestLineCount(1, 1);
- TestLine(1, 0, 13, 1, "filename1", 118581871);
-}
-
-class CXXQualifiedNames: public CUFixtureBase,
- public TestWithParam<DwarfTag> { };
-
-INSTANTIATE_TEST_CASE_P(VersusEnclosures, CXXQualifiedNames,
- Values(dwarf2reader::DW_TAG_class_type,
- dwarf2reader::DW_TAG_structure_type,
- dwarf2reader::DW_TAG_union_type,
- dwarf2reader::DW_TAG_namespace));
-
-TEST_P(CXXQualifiedNames, TwoFunctions) {
- DwarfTag tag = GetParam();
-
- SetLanguage(dwarf2reader::DW_LANG_C_plus_plus);
- PushLine(10, 1, "filename1", 69819327);
- PushLine(20, 1, "filename2", 95115701);
-
- StartCU();
- DIEHandler *enclosure_handler = StartNamedDIE(&root_handler_, tag,
- "Enclosure");
- EXPECT_TRUE(enclosure_handler != NULL);
- DefineFunction(enclosure_handler, "func_B", 10, 1, NULL);
- DefineFunction(enclosure_handler, "func_C", 20, 1, NULL);
- enclosure_handler->Finish();
- delete enclosure_handler;
- root_handler_.Finish();
-
- TestFunctionCount(2);
- TestFunction(0, "Enclosure::func_B", 10, 1);
- TestFunction(1, "Enclosure::func_C", 20, 1);
-}
-
-TEST_P(CXXQualifiedNames, FuncInEnclosureInNamespace) {
- DwarfTag tag = GetParam();
-
- SetLanguage(dwarf2reader::DW_LANG_C_plus_plus);
- PushLine(10, 1, "line-file", 69819327);
-
- StartCU();
- DIEHandler *namespace_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
- "Namespace");
- EXPECT_TRUE(namespace_handler != NULL);
- DIEHandler *enclosure_handler = StartNamedDIE(namespace_handler, tag,
- "Enclosure");
- EXPECT_TRUE(enclosure_handler != NULL);
- DefineFunction(enclosure_handler, "function", 10, 1, NULL);
- enclosure_handler->Finish();
- delete enclosure_handler;
- namespace_handler->Finish();
- delete namespace_handler;
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "Namespace::Enclosure::function", 10, 1);
-}
-
-TEST_F(CXXQualifiedNames, FunctionInClassInStructInNamespace) {
- SetLanguage(dwarf2reader::DW_LANG_C_plus_plus);
- PushLine(10, 1, "filename1", 69819327);
-
- StartCU();
- DIEHandler *namespace_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
- "namespace_A");
- EXPECT_TRUE(namespace_handler != NULL);
- DIEHandler *struct_handler
- = StartNamedDIE(namespace_handler, dwarf2reader::DW_TAG_structure_type,
- "struct_B");
- EXPECT_TRUE(struct_handler != NULL);
- DIEHandler *class_handler
- = StartNamedDIE(struct_handler, dwarf2reader::DW_TAG_class_type,
- "class_C");
- DefineFunction(class_handler, "function_D", 10, 1, NULL);
- class_handler->Finish();
- delete class_handler;
- struct_handler->Finish();
- delete struct_handler;
- namespace_handler->Finish();
- delete namespace_handler;
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "namespace_A::struct_B::class_C::function_D", 10, 1);
-}
-
-struct LanguageAndQualifiedName {
- dwarf2reader::DwarfLanguage language;
- const char *name;
-};
-
-const LanguageAndQualifiedName LanguageAndQualifiedNameCases[] = {
- { dwarf2reader::DW_LANG_none, "class_A::function_B" },
- { dwarf2reader::DW_LANG_C, "class_A::function_B" },
- { dwarf2reader::DW_LANG_C89, "class_A::function_B" },
- { dwarf2reader::DW_LANG_C99, "class_A::function_B" },
- { dwarf2reader::DW_LANG_C_plus_plus, "class_A::function_B" },
- { dwarf2reader::DW_LANG_Java, "class_A.function_B" },
- { dwarf2reader::DW_LANG_Cobol74, "class_A::function_B" },
- { dwarf2reader::DW_LANG_Mips_Assembler, NULL }
-};
-
-class QualifiedForLanguage
- : public CUFixtureBase,
- public TestWithParam<LanguageAndQualifiedName> { };
-
-INSTANTIATE_TEST_CASE_P(LanguageAndQualifiedName, QualifiedForLanguage,
- ValuesIn(LanguageAndQualifiedNameCases));
-
-TEST_P(QualifiedForLanguage, MemberFunction) {
- const LanguageAndQualifiedName &param = GetParam();
-
- PushLine(10, 1, "line-file", 212966758);
- SetLanguage(param.language);
-
- StartCU();
- DIEHandler *class_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- "class_A");
- DefineFunction(class_handler, "function_B", 10, 1, NULL);
- class_handler->Finish();
- delete class_handler;
- root_handler_.Finish();
-
- if (param.name) {
- TestFunctionCount(1);
- TestFunction(0, param.name, 10, 1);
- } else {
- TestFunctionCount(0);
- }
-}
-
-TEST_P(QualifiedForLanguage, MemberFunctionSignedLanguage) {
- const LanguageAndQualifiedName &param = GetParam();
-
- PushLine(10, 1, "line-file", 212966758);
- SetLanguage(param.language);
- SetLanguageSigned(true);
-
- StartCU();
- DIEHandler *class_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- "class_A");
- DefineFunction(class_handler, "function_B", 10, 1, NULL);
- class_handler->Finish();
- delete class_handler;
- root_handler_.Finish();
-
- if (param.name) {
- TestFunctionCount(1);
- TestFunction(0, param.name, 10, 1);
- } else {
- TestFunctionCount(0);
- }
-}
-
-class Specifications: public CUFixtureBase, public Test { };
-
-TEST_F(Specifications, Function) {
- PushLine(0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL, "line-file", 54883661);
-
- StartCU();
- DeclarationDIE(&root_handler_, 0xcd3c51b946fb1eeeLL,
- dwarf2reader::DW_TAG_subprogram, "declaration-name", "");
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0xcd3c51b946fb1eeeLL, "",
- 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "declaration-name",
- 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
-}
-
-TEST_F(Specifications, MangledName) {
- PushLine(0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL, "line-file", 54883661);
-
- StartCU();
- DeclarationDIE(&root_handler_, 0xcd3c51b946fb1eeeLL,
- dwarf2reader::DW_TAG_subprogram, "declaration-name",
- "_ZN1C1fEi");
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0xcd3c51b946fb1eeeLL, "",
- 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "C::f(int)",
- 0x93cd3dfc1aa10097ULL, 0x0397d47a0b4ca0d4ULL);
-}
-
-TEST_F(Specifications, MemberFunction) {
- PushLine(0x3341a248634e7170ULL, 0x5f6938ee5553b953ULL, "line-file", 18116691);
-
- StartCU();
- DIEHandler *class_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type, "class_A");
- DeclarationDIE(class_handler, 0x7d83028c431406e8ULL,
- dwarf2reader::DW_TAG_subprogram, "declaration-name", "");
- class_handler->Finish();
- delete class_handler;
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0x7d83028c431406e8ULL, "",
- 0x3341a248634e7170ULL, 0x5f6938ee5553b953ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "class_A::declaration-name",
- 0x3341a248634e7170ULL, 0x5f6938ee5553b953ULL);
-}
-
-// This case should gather the name from both the definition and the
-// declaration's parent.
-TEST_F(Specifications, FunctionDeclarationParent) {
- PushLine(0x463c9ddf405be227ULL, 0x6a47774af5049680ULL, "line-file", 70254922);
-
- StartCU();
- {
- DIEHandler *class_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- "class_A");
- ASSERT_TRUE(class_handler != NULL);
- DeclarationDIE(class_handler, 0x0e0e877c8404544aULL,
- dwarf2reader::DW_TAG_subprogram, "declaration-name", "");
- class_handler->Finish();
- delete class_handler;
- }
-
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0x0e0e877c8404544aULL, "definition-name",
- 0x463c9ddf405be227ULL, 0x6a47774af5049680ULL);
-
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "class_A::definition-name",
- 0x463c9ddf405be227ULL, 0x6a47774af5049680ULL);
-}
-
-// Named scopes should also gather enclosing name components from
-// their declarations.
-TEST_F(Specifications, NamedScopeDeclarationParent) {
- PushLine(0x5d13433d0df13d00ULL, 0x48ebebe5ade2cab4ULL, "line-file", 77392604);
-
- StartCU();
- {
- DIEHandler *space_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
- "space_A");
- ASSERT_TRUE(space_handler != NULL);
- DeclarationDIE(space_handler, 0x419bb1d12f9a73a2ULL,
- dwarf2reader::DW_TAG_class_type, "class-declaration-name",
- "");
- space_handler->Finish();
- delete space_handler;
- }
-
- {
- DIEHandler *class_handler
- = StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- 0x419bb1d12f9a73a2ULL, "class-definition-name");
- ASSERT_TRUE(class_handler != NULL);
- DefineFunction(class_handler, "function",
- 0x5d13433d0df13d00ULL, 0x48ebebe5ade2cab4ULL, NULL);
- class_handler->Finish();
- delete class_handler;
- }
-
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "space_A::class-definition-name::function",
- 0x5d13433d0df13d00ULL, 0x48ebebe5ade2cab4ULL);
-}
-
-// This test recreates bug 364.
-TEST_F(Specifications, InlineFunction) {
- PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
-
- StartCU();
- DeclarationDIE(&root_handler_, 0xcd3c51b946fb1eeeLL,
- dwarf2reader::DW_TAG_subprogram, "inline-name", "");
- AbstractInstanceDIE(&root_handler_, 0x1e8dac5d507ed7abULL,
- dwarf2reader::DW_INL_inlined, 0xcd3c51b946fb1eeeLL, "");
- DefineInlineInstanceDIE(&root_handler_, "", 0x1e8dac5d507ed7abULL,
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "inline-name",
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
-}
-
-// An inline function in a namespace should correctly derive its
-// name from its abstract origin, and not just the namespace name.
-TEST_F(Specifications, InlineFunctionInNamespace) {
- PushLine(0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL, "line-file", 75173118);
-
- StartCU();
- DIEHandler* space_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
- "Namespace");
- ASSERT_TRUE(space_handler != NULL);
- AbstractInstanceDIE(space_handler, 0x1e8dac5d507ed7abULL,
- dwarf2reader::DW_INL_inlined, 0LL, "func-name");
- DefineInlineInstanceDIE(space_handler, "", 0x1e8dac5d507ed7abULL,
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
- space_handler->Finish();
- delete space_handler;
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "Namespace::func-name",
- 0x1758a0f941b71efbULL, 0x1cf154f1f545e146ULL);
-}
-
-// Check name construction for a long chain containing each combination of:
-// - struct, union, class, namespace
-// - direct and definition
-TEST_F(Specifications, LongChain) {
- PushLine(0x5a0dd6bb85db754cULL, 0x3bccb213d08c7fd3ULL, "line-file", 21192926);
- SetLanguage(dwarf2reader::DW_LANG_C_plus_plus);
-
- StartCU();
- // The structure we're building here is:
- // space_A full definition
- // space_B declaration
- // space_B definition
- // struct_C full definition
- // struct_D declaration
- // struct_D definition
- // union_E full definition
- // union_F declaration
- // union_F definition
- // class_G full definition
- // class_H declaration
- // class_H definition
- // func_I declaration
- // func_I definition
- //
- // So:
- // - space_A, struct_C, union_E, and class_G don't use specifications;
- // - space_B, struct_D, union_F, and class_H do.
- // - func_I uses a specification.
- //
- // The full name for func_I is thus:
- //
- // space_A::space_B::struct_C::struct_D::union_E::union_F::
- // class_G::class_H::func_I
- {
- DIEHandler *space_A_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
- "space_A");
- DeclarationDIE(space_A_handler, 0x2e111126496596e2ULL,
- dwarf2reader::DW_TAG_namespace, "space_B", "");
- space_A_handler->Finish();
- delete space_A_handler;
- }
-
- {
- DIEHandler *space_B_handler
- = StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_namespace,
- 0x2e111126496596e2ULL);
- DIEHandler *struct_C_handler
- = StartNamedDIE(space_B_handler, dwarf2reader::DW_TAG_structure_type,
- "struct_C");
- DeclarationDIE(struct_C_handler, 0x20cd423bf2a25a4cULL,
- dwarf2reader::DW_TAG_structure_type, "struct_D", "");
- struct_C_handler->Finish();
- delete struct_C_handler;
- space_B_handler->Finish();
- delete space_B_handler;
- }
-
- {
- DIEHandler *struct_D_handler
- = StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_structure_type,
- 0x20cd423bf2a25a4cULL);
- DIEHandler *union_E_handler
- = StartNamedDIE(struct_D_handler, dwarf2reader::DW_TAG_union_type,
- "union_E");
- DeclarationDIE(union_E_handler, 0xe25c84805aa58c32ULL,
- dwarf2reader::DW_TAG_union_type, "union_F", "");
- union_E_handler->Finish();
- delete union_E_handler;
- struct_D_handler->Finish();
- delete struct_D_handler;
- }
-
- {
- DIEHandler *union_F_handler
- = StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_union_type,
- 0xe25c84805aa58c32ULL);
- DIEHandler *class_G_handler
- = StartNamedDIE(union_F_handler, dwarf2reader::DW_TAG_class_type,
- "class_G");
- DeclarationDIE(class_G_handler, 0xb70d960dcc173b6eULL,
- dwarf2reader::DW_TAG_class_type, "class_H", "");
- class_G_handler->Finish();
- delete class_G_handler;
- union_F_handler->Finish();
- delete union_F_handler;
- }
-
- {
- DIEHandler *class_H_handler
- = StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- 0xb70d960dcc173b6eULL);
- DeclarationDIE(class_H_handler, 0x27ff829e3bf69f37ULL,
- dwarf2reader::DW_TAG_subprogram, "func_I", "");
- class_H_handler->Finish();
- delete class_H_handler;
- }
-
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0x27ff829e3bf69f37ULL, "",
- 0x5a0dd6bb85db754cULL, 0x3bccb213d08c7fd3ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "space_A::space_B::struct_C::struct_D::union_E::union_F"
- "::class_G::class_H::func_I",
- 0x5a0dd6bb85db754cULL, 0x3bccb213d08c7fd3ULL);
-}
-
-TEST_F(Specifications, InterCU) {
- Module m("module-name", "module-os", "module-arch", "module-id");
- DwarfCUToModule::FileContext fc("dwarf-filename", &m, true);
- EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return());
- MockLineToModuleHandler lr;
- EXPECT_CALL(lr, ReadProgram(_,_,_,_)).Times(0);
-
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-
- // First CU. Declares class_A.
- {
- DwarfCUToModule root1_handler(&fc, &lr, &reporter_);
- ASSERT_TRUE(root1_handler.StartCompilationUnit(0, 1, 2, 3, 3));
- ASSERT_TRUE(root1_handler.StartRootDIE(1,
- dwarf2reader::DW_TAG_compile_unit));
- ProcessStrangeAttributes(&root1_handler);
- ASSERT_TRUE(root1_handler.EndAttributes());
- DeclarationDIE(&root1_handler, 0xb8fbfdd5f0b26fceULL,
- dwarf2reader::DW_TAG_class_type, "class_A", "");
- root1_handler.Finish();
- }
-
- // Second CU. Defines class_A, declares member_func_B.
- {
- DwarfCUToModule root2_handler(&fc, &lr, &reporter_);
- ASSERT_TRUE(root2_handler.StartCompilationUnit(0, 1, 2, 3, 3));
- ASSERT_TRUE(root2_handler.StartRootDIE(1,
- dwarf2reader::DW_TAG_compile_unit));
- ASSERT_TRUE(root2_handler.EndAttributes());
- DIEHandler *class_A_handler
- = StartSpecifiedDIE(&root2_handler, dwarf2reader::DW_TAG_class_type,
- 0xb8fbfdd5f0b26fceULL);
- DeclarationDIE(class_A_handler, 0xb01fef8b380bd1a2ULL,
- dwarf2reader::DW_TAG_subprogram, "member_func_B", "");
- class_A_handler->Finish();
- delete class_A_handler;
- root2_handler.Finish();
- }
-
- // Third CU. Defines member_func_B.
- {
- DwarfCUToModule root3_handler(&fc, &lr, &reporter_);
- ASSERT_TRUE(root3_handler.StartCompilationUnit(0, 1, 2, 3, 3));
- ASSERT_TRUE(root3_handler.StartRootDIE(1,
- dwarf2reader::DW_TAG_compile_unit));
- ASSERT_TRUE(root3_handler.EndAttributes());
- DefinitionDIE(&root3_handler, dwarf2reader::DW_TAG_subprogram,
- 0xb01fef8b380bd1a2ULL, "",
- 0x2618f00a1a711e53ULL, 0x4fd94b76d7c2caf5ULL);
- root3_handler.Finish();
- }
-
- vector<Module::Function *> functions;
- m.GetFunctions(&functions, functions.end());
- EXPECT_EQ(1U, functions.size());
- EXPECT_STREQ("class_A::member_func_B", functions[0]->name.c_str());
-}
-
-TEST_F(Specifications, UnhandledInterCU) {
- Module m("module-name", "module-os", "module-arch", "module-id");
- DwarfCUToModule::FileContext fc("dwarf-filename", &m, false);
- EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return());
- MockLineToModuleHandler lr;
- EXPECT_CALL(lr, ReadProgram(_,_,_,_)).Times(0);
-
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-
- // First CU. Declares class_A.
- {
- DwarfCUToModule root1_handler(&fc, &lr, &reporter_);
- ASSERT_TRUE(root1_handler.StartCompilationUnit(0, 1, 2, 3, 3));
- ASSERT_TRUE(root1_handler.StartRootDIE(1,
- dwarf2reader::DW_TAG_compile_unit));
- ProcessStrangeAttributes(&root1_handler);
- ASSERT_TRUE(root1_handler.EndAttributes());
- DeclarationDIE(&root1_handler, 0xb8fbfdd5f0b26fceULL,
- dwarf2reader::DW_TAG_class_type, "class_A", "");
- root1_handler.Finish();
- }
-
- // Second CU. Defines class_A, declares member_func_B.
- {
- DwarfCUToModule root2_handler(&fc, &lr, &reporter_);
- ASSERT_TRUE(root2_handler.StartCompilationUnit(0, 1, 2, 3, 3));
- ASSERT_TRUE(root2_handler.StartRootDIE(1,
- dwarf2reader::DW_TAG_compile_unit));
- ASSERT_TRUE(root2_handler.EndAttributes());
- EXPECT_CALL(reporter_, UnhandledInterCUReference(_, _)).Times(1);
- DIEHandler *class_A_handler
- = StartSpecifiedDIE(&root2_handler, dwarf2reader::DW_TAG_class_type,
- 0xb8fbfdd5f0b26fceULL);
- DeclarationDIE(class_A_handler, 0xb01fef8b380bd1a2ULL,
- dwarf2reader::DW_TAG_subprogram, "member_func_B", "");
- class_A_handler->Finish();
- delete class_A_handler;
- root2_handler.Finish();
- }
-
- // Third CU. Defines member_func_B.
- {
- DwarfCUToModule root3_handler(&fc, &lr, &reporter_);
- ASSERT_TRUE(root3_handler.StartCompilationUnit(0, 1, 2, 3, 3));
- ASSERT_TRUE(root3_handler.StartRootDIE(1,
- dwarf2reader::DW_TAG_compile_unit));
- ASSERT_TRUE(root3_handler.EndAttributes());
- EXPECT_CALL(reporter_, UnhandledInterCUReference(_, _)).Times(1);
- EXPECT_CALL(reporter_, UnnamedFunction(_)).Times(1);
- DefinitionDIE(&root3_handler, dwarf2reader::DW_TAG_subprogram,
- 0xb01fef8b380bd1a2ULL, "",
- 0x2618f00a1a711e53ULL, 0x4fd94b76d7c2caf5ULL);
- root3_handler.Finish();
- }
-}
-
-TEST_F(Specifications, BadOffset) {
- PushLine(0xa0277efd7ce83771ULL, 0x149554a184c730c1ULL, "line-file", 56636272);
- EXPECT_CALL(reporter_, UnknownSpecification(_, 0x2be953efa6f9a996ULL))
- .WillOnce(Return());
-
- StartCU();
- DeclarationDIE(&root_handler_, 0xefd7f7752c27b7e4ULL,
- dwarf2reader::DW_TAG_subprogram, "", "");
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0x2be953efa6f9a996ULL, "function",
- 0xa0277efd7ce83771ULL, 0x149554a184c730c1ULL);
- root_handler_.Finish();
-}
-
-TEST_F(Specifications, FunctionDefinitionHasOwnName) {
- PushLine(0xced50b3eea81022cULL, 0x08dd4d301cc7a7d2ULL, "line-file", 56792403);
-
- StartCU();
- DeclarationDIE(&root_handler_, 0xc34ff4786cae78bdULL,
- dwarf2reader::DW_TAG_subprogram, "declaration-name", "");
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0xc34ff4786cae78bdULL, "definition-name",
- 0xced50b3eea81022cULL, 0x08dd4d301cc7a7d2ULL);
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "definition-name",
- 0xced50b3eea81022cULL, 0x08dd4d301cc7a7d2ULL);
-}
-
-TEST_F(Specifications, ClassDefinitionHasOwnName) {
- PushLine(0x1d0f5e0f6ce309bdULL, 0x654e1852ec3599e7ULL, "line-file", 57119241);
-
- StartCU();
- DeclarationDIE(&root_handler_, 0xd0fe467ec2f1a58cULL,
- dwarf2reader::DW_TAG_class_type, "class-declaration-name", "");
-
- dwarf2reader::DIEHandler *class_definition
- = StartSpecifiedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- 0xd0fe467ec2f1a58cULL, "class-definition-name");
- ASSERT_TRUE(class_definition);
- DeclarationDIE(class_definition, 0x6d028229c15623dbULL,
- dwarf2reader::DW_TAG_subprogram,
- "function-declaration-name", "");
- class_definition->Finish();
- delete class_definition;
-
- DefinitionDIE(&root_handler_, dwarf2reader::DW_TAG_subprogram,
- 0x6d028229c15623dbULL, "function-definition-name",
- 0x1d0f5e0f6ce309bdULL, 0x654e1852ec3599e7ULL);
-
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "class-definition-name::function-definition-name",
- 0x1d0f5e0f6ce309bdULL, 0x654e1852ec3599e7ULL);
-}
-
-// DIEs that cite a specification should prefer the specification's
-// parents over their own when choosing qualified names. In this test,
-// we take the name from our definition but the enclosing scope name
-// from our declaration. I don't see why they'd ever be different, but
-// we want to verify what DwarfCUToModule is looking at.
-TEST_F(Specifications, PreferSpecificationParents) {
- PushLine(0xbbd9d54dce3b95b7ULL, 0x39188b7b52b0899fULL, "line-file", 79488694);
-
- StartCU();
- {
- dwarf2reader::DIEHandler *declaration_class_handler =
- StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- "declaration-class");
- DeclarationDIE(declaration_class_handler, 0x9ddb35517455ef7aULL,
- dwarf2reader::DW_TAG_subprogram, "function-declaration",
- "");
- declaration_class_handler->Finish();
- delete declaration_class_handler;
- }
- {
- dwarf2reader::DIEHandler *definition_class_handler
- = StartNamedDIE(&root_handler_, dwarf2reader::DW_TAG_class_type,
- "definition-class");
- DefinitionDIE(definition_class_handler, dwarf2reader::DW_TAG_subprogram,
- 0x9ddb35517455ef7aULL, "function-definition",
- 0xbbd9d54dce3b95b7ULL, 0x39188b7b52b0899fULL);
- definition_class_handler->Finish();
- delete definition_class_handler;
- }
- root_handler_.Finish();
-
- TestFunctionCount(1);
- TestFunction(0, "declaration-class::function-definition",
- 0xbbd9d54dce3b95b7ULL, 0x39188b7b52b0899fULL);
-}
-
-class CUErrors: public CUFixtureBase, public Test { };
-
-TEST_F(CUErrors, BadStmtList) {
- EXPECT_CALL(reporter_, BadLineInfoOffset(dummy_line_size_ + 10)).Times(1);
-
- ASSERT_TRUE(root_handler_
- .StartCompilationUnit(0xc591d5b037543d7cULL, 0x11, 0xcd,
- 0x2d7d19546cf6590cULL, 3));
- ASSERT_TRUE(root_handler_.StartRootDIE(0xae789dc102cfca54ULL,
- dwarf2reader::DW_TAG_compile_unit));
- root_handler_.ProcessAttributeString(dwarf2reader::DW_AT_name,
- dwarf2reader::DW_FORM_strp,
- "compilation-unit-name");
- root_handler_.ProcessAttributeUnsigned(dwarf2reader::DW_AT_stmt_list,
- dwarf2reader::DW_FORM_ref4,
- dummy_line_size_ + 10);
- root_handler_.EndAttributes();
- root_handler_.Finish();
-}
-
-TEST_F(CUErrors, NoLineSection) {
- EXPECT_CALL(reporter_, MissingSection(".debug_line")).Times(1);
- PushLine(0x88507fb678052611ULL, 0x42c8e9de6bbaa0faULL, "line-file", 64472290);
- // Delete the entry for .debug_line added by the fixture class's constructor.
- file_context_.ClearSectionMapForTest();
-
- StartCU();
- root_handler_.Finish();
-}
-
-TEST_F(CUErrors, BadDwarfVersion1) {
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-
- ASSERT_FALSE(root_handler_
- .StartCompilationUnit(0xadf6e0eb71e2b0d9ULL, 0x4d, 0x90,
- 0xc9de224ccb99ac3eULL, 1));
-}
-
-TEST_F(CUErrors, GoodDwarfVersion2) {
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-
- ASSERT_TRUE(root_handler_
- .StartCompilationUnit(0xadf6e0eb71e2b0d9ULL, 0x4d, 0x90,
- 0xc9de224ccb99ac3eULL, 2));
-}
-
-TEST_F(CUErrors, GoodDwarfVersion3) {
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-
- ASSERT_TRUE(root_handler_
- .StartCompilationUnit(0xadf6e0eb71e2b0d9ULL, 0x4d, 0x90,
- 0xc9de224ccb99ac3eULL, 3));
-}
-
-TEST_F(CUErrors, BadCURootDIETag) {
- // Kludge: satisfy reporter_'s expectation.
- reporter_.SetCUName("compilation-unit-name");
-
- ASSERT_TRUE(root_handler_
- .StartCompilationUnit(0xadf6e0eb71e2b0d9ULL, 0x4d, 0x90,
- 0xc9de224ccb99ac3eULL, 3));
-
- ASSERT_FALSE(root_handler_.StartRootDIE(0x02e56bfbda9e7337ULL,
- dwarf2reader::DW_TAG_subprogram));
-}
-
-// Tests for DwarfCUToModule::Reporter. These just produce (or fail to
-// produce) output, so their results need to be checked by hand.
-struct Reporter: public Test {
- Reporter()
- : reporter("filename", 0x123456789abcdef0ULL),
- function("function name", 0x19c45c30770c1eb0ULL),
- file("source file name") {
- reporter.SetCUName("compilation-unit-name");
-
- function.size = 0x89808a5bdfa0a6a3ULL;
- function.parameter_size = 0x6a329f18683dcd51ULL;
-
- line.address = 0x3606ac6267aebeccULL;
- line.size = 0x5de482229f32556aULL;
- line.file = &file;
- line.number = 93400201;
- }
-
- DwarfCUToModule::WarningReporter reporter;
- Module::Function function;
- Module::File file;
- Module::Line line;
-};
-
-TEST_F(Reporter, UnknownSpecification) {
- reporter.UnknownSpecification(0x123456789abcdef1ULL, 0x323456789abcdef2ULL);
-}
-
-TEST_F(Reporter, UnknownAbstractOrigin) {
- reporter.UnknownAbstractOrigin(0x123456789abcdef1ULL, 0x323456789abcdef2ULL);
-}
-
-TEST_F(Reporter, MissingSection) {
- reporter.MissingSection("section name");
-}
-
-TEST_F(Reporter, BadLineInfoOffset) {
- reporter.BadLineInfoOffset(0x123456789abcdef1ULL);
-}
-
-TEST_F(Reporter, UncoveredFunctionDisabled) {
- reporter.UncoveredFunction(function);
- EXPECT_FALSE(reporter.uncovered_warnings_enabled());
-}
-
-TEST_F(Reporter, UncoveredFunctionEnabled) {
- reporter.set_uncovered_warnings_enabled(true);
- reporter.UncoveredFunction(function);
- EXPECT_TRUE(reporter.uncovered_warnings_enabled());
-}
-
-TEST_F(Reporter, UncoveredLineDisabled) {
- reporter.UncoveredLine(line);
- EXPECT_FALSE(reporter.uncovered_warnings_enabled());
-}
-
-TEST_F(Reporter, UncoveredLineEnabled) {
- reporter.set_uncovered_warnings_enabled(true);
- reporter.UncoveredLine(line);
- EXPECT_TRUE(reporter.uncovered_warnings_enabled());
-}
-
-TEST_F(Reporter, UnnamedFunction) {
- reporter.UnnamedFunction(0x90c0baff9dedb2d9ULL);
-}
-
-// Would be nice to also test:
-// - overlapping lines, functions
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.cc
deleted file mode 100644
index 258b0b603f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.cc
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf_line_to_module.cc: Implementation of DwarfLineToModule class.
-// See dwarf_line_to_module.h for details.
-
-#include <stdio.h>
-
-#include <string>
-
-#include "common/dwarf_line_to_module.h"
-#include "common/using_std_string.h"
-
-// Trying to support Windows paths in a reasonable way adds a lot of
-// variations to test; it would be better to just put off dealing with
-// it until we actually have to deal with DWARF on Windows.
-
-// Return true if PATH is an absolute path, false if it is relative.
-static bool PathIsAbsolute(const string &path) {
- return (path.size() >= 1 && path[0] == '/');
-}
-
-static bool HasTrailingSlash(const string &path) {
- return (path.size() >= 1 && path[path.size() - 1] == '/');
-}
-
-// If PATH is an absolute path, return PATH. If PATH is a relative path,
-// treat it as relative to BASE and return the combined path.
-static string ExpandPath(const string &path,
- const string &base) {
- if (PathIsAbsolute(path) || base.empty())
- return path;
- return base + (HasTrailingSlash(base) ? "" : "/") + path;
-}
-
-namespace google_breakpad {
-
-void DwarfLineToModule::DefineDir(const string &name, uint32 dir_num) {
- // Directory number zero is reserved to mean the compilation
- // directory. Silently ignore attempts to redefine it.
- if (dir_num != 0)
- directories_[dir_num] = ExpandPath(name, compilation_dir_);
-}
-
-void DwarfLineToModule::DefineFile(const string &name, int32 file_num,
- uint32 dir_num, uint64 mod_time,
- uint64 length) {
- if (file_num == -1)
- file_num = ++highest_file_number_;
- else if (file_num > highest_file_number_)
- highest_file_number_ = file_num;
-
- string dir_name;
- if (dir_num == 0) {
- // Directory number zero is the compilation directory, and is stored as
- // an attribute on the compilation unit, rather than in the program table.
- dir_name = compilation_dir_;
- } else {
- DirectoryTable::const_iterator directory_it = directories_.find(dir_num);
- if (directory_it != directories_.end()) {
- dir_name = directory_it->second;
- } else {
- if (!warned_bad_directory_number_) {
- fprintf(stderr, "warning: DWARF line number data refers to undefined"
- " directory numbers\n");
- warned_bad_directory_number_ = true;
- }
- }
- }
-
- string full_name = ExpandPath(name, dir_name);
-
- // Find a Module::File object of the given name, and add it to the
- // file table.
- files_[file_num] = module_->FindFile(full_name);
-}
-
-void DwarfLineToModule::AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num,
- uint32 column_num) {
- if (length == 0)
- return;
-
- // Clip lines not to extend beyond the end of the address space.
- if (address + length < address)
- length = -address;
-
- // Should we omit this line? (See the comments for omitted_line_end_.)
- if (address == 0 || address == omitted_line_end_) {
- omitted_line_end_ = address + length;
- return;
- } else {
- omitted_line_end_ = 0;
- }
-
- // Find the source file being referred to.
- Module::File *file = files_[file_num];
- if (!file) {
- if (!warned_bad_file_number_) {
- fprintf(stderr, "warning: DWARF line number data refers to "
- "undefined file numbers\n");
- warned_bad_file_number_ = true;
- }
- return;
- }
- Module::Line line;
- line.address = address;
- // We set the size when we get the next line or the EndSequence call.
- line.size = length;
- line.file = file;
- line.number = line_num;
- lines_->push_back(line);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.h
deleted file mode 100644
index 1fdd4cb716..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module.h
+++ /dev/null
@@ -1,188 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// The DwarfLineToModule class accepts line number information from a
-// DWARF parser and adds it to a google_breakpad::Module. The Module
-// can write that data out as a Breakpad symbol file.
-
-#ifndef COMMON_LINUX_DWARF_LINE_TO_MODULE_H
-#define COMMON_LINUX_DWARF_LINE_TO_MODULE_H
-
-#include <string>
-
-#include "common/module.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// A class for producing a vector of google_breakpad::Module::Line
-// instances from parsed DWARF line number data.
-//
-// An instance of this class can be provided as a handler to a
-// dwarf2reader::LineInfo DWARF line number information parser. The
-// handler accepts source location information from the parser and
-// uses it to produce a vector of google_breakpad::Module::Line
-// objects, referring to google_breakpad::Module::File objects added
-// to a particular google_breakpad::Module.
-//
-// GNU toolchain omitted sections support:
-// ======================================
-//
-// Given the right options, the GNU toolchain will omit unreferenced
-// functions from the final executable. Unfortunately, when it does so, it
-// does not remove the associated portions of the DWARF line number
-// program; instead, it gives the DW_LNE_set_address instructions referring
-// to the now-deleted code addresses of zero. Given this input, the DWARF
-// line parser will call AddLine with a series of lines starting at address
-// zero. For example, here is the output from 'readelf -wl' for a program
-// with four functions, the first three of which have been omitted:
-//
-// Line Number Statements:
-// Extended opcode 2: set Address to 0x0
-// Advance Line by 14 to 15
-// Copy
-// Special opcode 48: advance Address by 3 to 0x3 and Line by 1 to 16
-// Special opcode 119: advance Address by 8 to 0xb and Line by 2 to 18
-// Advance PC by 2 to 0xd
-// Extended opcode 1: End of Sequence
-//
-// Extended opcode 2: set Address to 0x0
-// Advance Line by 14 to 15
-// Copy
-// Special opcode 48: advance Address by 3 to 0x3 and Line by 1 to 16
-// Special opcode 119: advance Address by 8 to 0xb and Line by 2 to 18
-// Advance PC by 2 to 0xd
-// Extended opcode 1: End of Sequence
-//
-// Extended opcode 2: set Address to 0x0
-// Advance Line by 19 to 20
-// Copy
-// Special opcode 48: advance Address by 3 to 0x3 and Line by 1 to 21
-// Special opcode 76: advance Address by 5 to 0x8 and Line by 1 to 22
-// Advance PC by 2 to 0xa
-// Extended opcode 1: End of Sequence
-//
-// Extended opcode 2: set Address to 0x80483a4
-// Advance Line by 23 to 24
-// Copy
-// Special opcode 202: advance Address by 14 to 0x80483b2 and Line by 1 to 25
-// Special opcode 76: advance Address by 5 to 0x80483b7 and Line by 1 to 26
-// Advance PC by 6 to 0x80483bd
-// Extended opcode 1: End of Sequence
-//
-// Instead of collecting runs of lines describing code that is not there,
-// we try to recognize and drop them. Since the linker doesn't explicitly
-// distinguish references to dropped sections from genuine references to
-// code at address zero, we must use a heuristic. We have chosen:
-//
-// - If a line starts at address zero, omit it. (On the platforms
-// breakpad targets, it is extremely unlikely that there will be code
-// at address zero.)
-//
-// - If a line starts immediately after an omitted line, omit it too.
-class DwarfLineToModule: public dwarf2reader::LineInfoHandler {
- public:
- // As the DWARF line info parser passes us line records, add source
- // files to MODULE, and add all lines to the end of LINES. LINES
- // need not be empty. If the parser hands us a zero-length line, we
- // omit it. If the parser hands us a line that extends beyond the
- // end of the address space, we clip it. It's up to our client to
- // sort out which lines belong to which functions; we don't add them
- // to any particular function in MODULE ourselves.
- DwarfLineToModule(Module *module, const string& compilation_dir,
- vector<Module::Line> *lines)
- : module_(module),
- compilation_dir_(compilation_dir),
- lines_(lines),
- highest_file_number_(-1),
- omitted_line_end_(0),
- warned_bad_file_number_(false),
- warned_bad_directory_number_(false) { }
-
- ~DwarfLineToModule() { }
-
- void DefineDir(const string &name, uint32 dir_num);
- void DefineFile(const string &name, int32 file_num,
- uint32 dir_num, uint64 mod_time,
- uint64 length);
- void AddLine(uint64 address, uint64 length,
- uint32 file_num, uint32 line_num, uint32 column_num);
-
- private:
-
- typedef std::map<uint32, string> DirectoryTable;
- typedef std::map<uint32, Module::File *> FileTable;
-
- // The module we're contributing debugging info to. Owned by our
- // client.
- Module *module_;
-
- // The compilation directory for the current compilation unit whose
- // lines are being accumulated.
- string compilation_dir_;
-
- // The vector of lines we're accumulating. Owned by our client.
- //
- // In a Module, as in a breakpad symbol file, lines belong to
- // specific functions, but DWARF simply assigns lines to addresses;
- // one must infer the line/function relationship using the
- // functions' beginning and ending addresses. So we can't add these
- // to the appropriate function from module_ until we've read the
- // function info as well. Instead, we accumulate lines here, and let
- // whoever constructed this sort it all out.
- vector<Module::Line> *lines_;
-
- // A table mapping directory numbers to paths.
- DirectoryTable directories_;
-
- // A table mapping file numbers to Module::File pointers.
- FileTable files_;
-
- // The highest file number we've seen so far, or -1 if we've seen
- // none. Used for dynamically defined file numbers.
- int32 highest_file_number_;
-
- // This is the ending address of the last line we omitted, or zero if we
- // didn't omit the previous line. It is zero before we have received any
- // AddLine calls.
- uint64 omitted_line_end_;
-
- // True if we've warned about:
- bool warned_bad_file_number_; // bad file numbers
- bool warned_bad_directory_number_; // bad directory numbers
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_DWARF_LINE_TO_MODULE_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module_unittest.cc
deleted file mode 100644
index 7c0fcfd35a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/dwarf_line_to_module_unittest.cc
+++ /dev/null
@@ -1,391 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dwarf_line_to_module.cc: Unit tests for google_breakpad::DwarfLineToModule.
-
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/dwarf_line_to_module.h"
-
-using std::vector;
-
-using google_breakpad::DwarfLineToModule;
-using google_breakpad::Module;
-using google_breakpad::Module;
-
-TEST(SimpleModule, One) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("file1", 0x30bf0f27, 0, 0, 0);
- h.AddLine(0x6fd126fbf74f2680LL, 0x63c9a14cf556712bLL, 0x30bf0f27,
- 0x4c090cbf, 0x1cf9fe0d);
-
- vector<Module::File *> files;
- m.GetFiles(&files);
- EXPECT_EQ(1U, files.size());
- EXPECT_STREQ("/file1", files[0]->name.c_str());
-
- EXPECT_EQ(1U, lines.size());
- EXPECT_EQ(0x6fd126fbf74f2680ULL, lines[0].address);
- EXPECT_EQ(0x63c9a14cf556712bULL, lines[0].size);
- EXPECT_TRUE(lines[0].file == files[0]);
- EXPECT_EQ(0x4c090cbf, lines[0].number);
-}
-
-TEST(SimpleModule, Many) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("directory1", 0x838299ab);
- h.DefineDir("directory2", 0xf85de023);
- h.DefineFile("file1", 0x2b80377a, 0x838299ab, 0, 0);
- h.DefineFile("file1", 0x63beb4a4, 0xf85de023, 0, 0);
- h.DefineFile("file2", 0x1d161d56, 0x838299ab, 0, 0);
- h.DefineFile("file2", 0x1e7a667c, 0xf85de023, 0, 0);
- h.AddLine(0x69900c5d553b7274ULL, 0x90fded183f0d0d3cULL, 0x2b80377a,
- 0x15b0f0a9U, 0x3ff5abd6U);
- h.AddLine(0x45811219a39b7101ULL, 0x25a5e6a924afc41fULL, 0x63beb4a4,
- 0x4d259ce9U, 0x41c5ee32U);
- h.AddLine(0xfa90514c1dc9704bULL, 0x0063efeabc02f313ULL, 0x1d161d56,
- 0x1ee9fa4fU, 0xbf70e46aU);
- h.AddLine(0x556b55fb6a647b10ULL, 0x3f3089ca2bfd80f5ULL, 0x1e7a667c,
- 0x77fc280eU, 0x2c4a728cU);
- h.DefineFile("file3", -1, 0, 0, 0);
- h.AddLine(0xe2d72a37f8d9403aULL, 0x034dfab5b0d4d236ULL, 0x63beb4a5,
- 0x75047044U, 0xb6a0016cU);
-
- vector<Module::File *> files;
- m.GetFiles(&files);
- ASSERT_EQ(5U, files.size());
- EXPECT_STREQ("/directory1/file1", files[0]->name.c_str());
- EXPECT_STREQ("/directory1/file2", files[1]->name.c_str());
- EXPECT_STREQ("/directory2/file1", files[2]->name.c_str());
- EXPECT_STREQ("/directory2/file2", files[3]->name.c_str());
- EXPECT_STREQ("/file3", files[4]->name.c_str());
-
- ASSERT_EQ(5U, lines.size());
-
- EXPECT_EQ(0x69900c5d553b7274ULL, lines[0].address);
- EXPECT_EQ(0x90fded183f0d0d3cULL, lines[0].size);
- EXPECT_TRUE(lines[0].file == files[0]);
- EXPECT_EQ(0x15b0f0a9, lines[0].number);
-
- EXPECT_EQ(0x45811219a39b7101ULL, lines[1].address);
- EXPECT_EQ(0x25a5e6a924afc41fULL, lines[1].size);
- EXPECT_TRUE(lines[1].file == files[2]);
- EXPECT_EQ(0x4d259ce9, lines[1].number);
-
- EXPECT_EQ(0xfa90514c1dc9704bULL, lines[2].address);
- EXPECT_EQ(0x0063efeabc02f313ULL, lines[2].size);
- EXPECT_TRUE(lines[2].file == files[1]);
- EXPECT_EQ(0x1ee9fa4f, lines[2].number);
-
- EXPECT_EQ(0x556b55fb6a647b10ULL, lines[3].address);
- EXPECT_EQ(0x3f3089ca2bfd80f5ULL, lines[3].size);
- EXPECT_TRUE(lines[3].file == files[3]);
- EXPECT_EQ(0x77fc280e, lines[3].number);
-
- EXPECT_EQ(0xe2d72a37f8d9403aULL, lines[4].address);
- EXPECT_EQ(0x034dfab5b0d4d236ULL, lines[4].size);
- EXPECT_TRUE(lines[4].file == files[4]);
- EXPECT_EQ(0x75047044, lines[4].number);
-}
-
-TEST(Filenames, Absolute) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("directory1", 1);
- h.DefineFile("/absolute", 1, 1, 0, 0);
-
- h.AddLine(1, 1, 1, 0, 0);
-
- vector<Module::File *> files;
- m.GetFiles(&files);
- ASSERT_EQ(1U, files.size());
- EXPECT_STREQ("/absolute", files[0]->name.c_str());
- ASSERT_EQ(1U, lines.size());
- EXPECT_TRUE(lines[0].file == files[0]);
-}
-
-TEST(Filenames, Relative) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("directory1", 1);
- h.DefineFile("relative", 1, 1, 0, 0);
-
- h.AddLine(1, 1, 1, 0, 0);
-
- vector<Module::File *> files;
- m.GetFiles(&files);
- ASSERT_EQ(1U, files.size());
- EXPECT_STREQ("/directory1/relative", files[0]->name.c_str());
- ASSERT_EQ(1U, lines.size());
- EXPECT_TRUE(lines[0].file == files[0]);
-}
-
-TEST(Filenames, StrangeFile) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("directory1", 1);
- h.DefineFile("", 1, 1, 0, 0);
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("/directory1/", lines[0].file->name.c_str());
-}
-
-TEST(Filenames, StrangeDirectory) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("", 1);
- h.DefineFile("file1", 1, 1, 0, 0);
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("/file1", lines[0].file->name.c_str());
-}
-
-TEST(Filenames, StrangeDirectoryAndFile) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("", 1);
- h.DefineFile("", 1, 1, 0, 0);
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("/", lines[0].file->name.c_str());
-}
-
-// We should use the compilation directory when encountering a file for
-// directory number zero.
-TEST(Filenames, DirectoryZeroFileIsRelativeToCompilationDir) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "src/build", &lines);
-
- h.DefineDir("Dir", 1);
- h.DefineFile("File", 1, 0, 0, 0);
-
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("src/build/File", lines[0].file->name.c_str());
-}
-
-// We should treat non-absolute directories as relative to the compilation
-// directory.
-TEST(Filenames, IncludeDirectoryRelativeToDirectoryZero) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "src/build", &lines);
-
- h.DefineDir("Dir", 1);
- h.DefineFile("File", 1, 1, 0, 0);
-
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("src/build/Dir/File", lines[0].file->name.c_str());
-}
-
-// We should treat absolute directories as absolute, and not relative to
-// the compilation dir.
-TEST(Filenames, IncludeDirectoryAbsolute) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "src/build", &lines);
-
- h.DefineDir("/Dir", 1);
- h.DefineFile("File", 1, 1, 0, 0);
-
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("/Dir/File", lines[0].file->name.c_str());
-}
-
-// We should silently ignore attempts to define directory number zero,
-// since that is always the compilation directory.
-TEST(ModuleErrors, DirectoryZero) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("directory0", 0); // should be ignored
- h.DefineFile("relative", 1, 0, 0, 0);
-
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("/relative", lines[0].file->name.c_str());
-}
-
-// We should refuse to add lines with bogus file numbers. We should
-// produce only one warning, however.
-TEST(ModuleErrors, BadFileNumber) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("relative", 1, 0, 0, 0);
- h.AddLine(1, 1, 2, 0, 0); // bad file number
- h.AddLine(2, 1, 2, 0, 0); // bad file number (no duplicate warning)
-
- EXPECT_EQ(0U, lines.size());
-}
-
-// We should treat files with bogus directory numbers as relative to
-// the compilation unit.
-TEST(ModuleErrors, BadDirectoryNumber) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineDir("directory1", 1);
- h.DefineFile("baddirnumber1", 1, 2, 0, 0); // bad directory number
- h.DefineFile("baddirnumber2", 2, 2, 0, 0); // bad dir number (no warning)
- h.AddLine(1, 1, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_STREQ("baddirnumber1", lines[0].file->name.c_str());
-}
-
-// We promise not to report empty lines.
-TEST(ModuleErrors, EmptyLine) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("filename1", 1, 0, 0, 0);
- h.AddLine(1, 0, 1, 0, 0);
-
- ASSERT_EQ(0U, lines.size());
-}
-
-// We are supposed to clip lines that extend beyond the end of the
-// address space.
-TEST(ModuleErrors, BigLine) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("filename1", 1, 0, 0, 0);
- h.AddLine(0xffffffffffffffffULL, 2, 1, 0, 0);
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_EQ(1U, lines[0].size);
-}
-
-// The 'Omitted' tests verify that we correctly omit line information
-// for code in sections that the linker has dropped. See "GNU
-// toolchain omitted sections support" at the top of the
-// DwarfLineToModule class.
-
-TEST(Omitted, DroppedThenGood) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("filename1", 1, 0, 0, 0);
- h.AddLine(0, 10, 1, 83816211, 0); // should be omitted
- h.AddLine(20, 10, 1, 13059195, 0); // should be recorded
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_EQ(13059195, lines[0].number);
-}
-
-TEST(Omitted, GoodThenDropped) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("filename1", 1, 0, 0, 0);
- h.AddLine(0x9dd6a372, 10, 1, 41454594, 0); // should be recorded
- h.AddLine(0, 10, 1, 44793413, 0); // should be omitted
-
- ASSERT_EQ(1U, lines.size());
- EXPECT_EQ(41454594, lines[0].number);
-}
-
-TEST(Omitted, Mix1) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("filename1", 1, 0, 0, 0);
- h.AddLine(0x679ed72f, 10, 1, 58932642, 0); // should be recorded
- h.AddLine(0xdfb5a72d, 10, 1, 39847385, 0); // should be recorded
- h.AddLine(0, 0x78, 1, 23053829, 0); // should be omitted
- h.AddLine(0x78, 0x6a, 1, 65317783, 0); // should be omitted
- h.AddLine(0x78 + 0x6a, 0x2a, 1, 77601423, 0); // should be omitted
- h.AddLine(0x9fe0cea5, 10, 1, 91806582, 0); // should be recorded
- h.AddLine(0x7e41a109, 10, 1, 56169221, 0); // should be recorded
-
- ASSERT_EQ(4U, lines.size());
- EXPECT_EQ(58932642, lines[0].number);
- EXPECT_EQ(39847385, lines[1].number);
- EXPECT_EQ(91806582, lines[2].number);
- EXPECT_EQ(56169221, lines[3].number);
-}
-
-TEST(Omitted, Mix2) {
- Module m("name", "os", "architecture", "id");
- vector<Module::Line> lines;
- DwarfLineToModule h(&m, "/", &lines);
-
- h.DefineFile("filename1", 1, 0, 0, 0);
- h.AddLine(0, 0xf2, 1, 58802211, 0); // should be omitted
- h.AddLine(0xf2, 0xb9, 1, 78958222, 0); // should be omitted
- h.AddLine(0xf2 + 0xb9, 0xf7, 1, 64861892, 0); // should be omitted
- h.AddLine(0x4e4d271e, 9, 1, 67355743, 0); // should be recorded
- h.AddLine(0xdfb5a72d, 30, 1, 23365776, 0); // should be recorded
- h.AddLine(0, 0x64, 1, 76196762, 0); // should be omitted
- h.AddLine(0x64, 0x33, 1, 71066611, 0); // should be omitted
- h.AddLine(0x64 + 0x33, 0xe3, 1, 61749337, 0); // should be omitted
-
- ASSERT_EQ(2U, lines.size());
- EXPECT_EQ(67355743, lines[0].number);
- EXPECT_EQ(23365776, lines[1].number);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/language.cc b/toolkit/crashreporter/google-breakpad/src/common/language.cc
deleted file mode 100644
index c2fd81f644..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/language.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// language.cc: Subclasses and singletons for google_breakpad::Language.
-// See language.h for details.
-
-#include "common/language.h"
-
-namespace google_breakpad {
-
-// C++ language-specific operations.
-class CPPLanguage: public Language {
- public:
- CPPLanguage() {}
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
- if (parent_name.empty())
- return name;
- else
- return parent_name + "::" + name;
- }
-};
-
-CPPLanguage CPPLanguageSingleton;
-
-// Java language-specific operations.
-class JavaLanguage: public Language {
- public:
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
- if (parent_name.empty())
- return name;
- else
- return parent_name + "." + name;
- }
-};
-
-JavaLanguage JavaLanguageSingleton;
-
-// Assembler language-specific operations.
-class AssemblerLanguage: public Language {
- bool HasFunctions() const { return false; }
- string MakeQualifiedName(const string &parent_name,
- const string &name) const {
- return name;
- }
-};
-
-AssemblerLanguage AssemblerLanguageSingleton;
-
-const Language * const Language::CPlusPlus = &CPPLanguageSingleton;
-const Language * const Language::Java = &JavaLanguageSingleton;
-const Language * const Language::Assembler = &AssemblerLanguageSingleton;
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/language.h b/toolkit/crashreporter/google-breakpad/src/common/language.h
deleted file mode 100644
index bbe303347a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/language.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// language.h: Define google_breakpad::Language. Instances of
-// subclasses of this class provide language-appropriate operations
-// for the Breakpad symbol dumper.
-
-#ifndef COMMON_LINUX_LANGUAGE_H__
-#define COMMON_LINUX_LANGUAGE_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// An abstract base class for language-specific operations. We choose
-// an instance of a subclass of this when we find the CU's language.
-// This class's definitions are appropriate for CUs with no specified
-// language.
-class Language {
- public:
- // A base class destructor should be either public and virtual,
- // or protected and nonvirtual.
- virtual ~Language() {}
-
- // Return true if this language has functions to which we can assign
- // line numbers. (Debugging info for assembly language, for example,
- // can have source location information, but does not have functions
- // recorded using DW_TAG_subprogram DIEs.)
- virtual bool HasFunctions() const { return true; }
-
- // Construct a fully-qualified, language-appropriate form of NAME,
- // given that PARENT_NAME is the name of the construct enclosing
- // NAME. If PARENT_NAME is the empty string, then NAME is a
- // top-level name.
- //
- // This API sort of assumes that a fully-qualified name is always
- // some simple textual composition of the unqualified name and its
- // parent's name, and that we don't need to know anything else about
- // the parent or the child (say, their DIEs' tags) to do the job.
- // This is true for the languages we support at the moment, and
- // keeps things concrete. Perhaps a more refined operation would
- // take into account the parent and child DIE types, allow languages
- // to use their own data type for complex parent names, etc. But if
- // C++ doesn't need all that, who would?
- virtual string MakeQualifiedName (const string &parent_name,
- const string &name) const = 0;
-
- // Instances for specific languages.
- static const Language * const CPlusPlus,
- * const Java,
- * const Assembler;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_LANGUAGE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/crc32.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/crc32.cc
deleted file mode 100644
index 8df636ce4d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/crc32.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/linux/crc32.h"
-
-namespace google_breakpad {
-
-// This implementation is based on the sample implementation in RFC 1952.
-
-// CRC32 polynomial, in reversed form.
-// See RFC 1952, or http://en.wikipedia.org/wiki/Cyclic_redundancy_check
-static const uint32_t kCrc32Polynomial = 0xEDB88320;
-static uint32_t kCrc32Table[256] = { 0 };
-
-#define arraysize(f) (sizeof(f) / sizeof(*f))
-
-static void EnsureCrc32TableInited() {
- if (kCrc32Table[arraysize(kCrc32Table) - 1])
- return; // already inited
- for (uint32_t i = 0; i < arraysize(kCrc32Table); ++i) {
- uint32_t c = i;
- for (size_t j = 0; j < 8; ++j) {
- if (c & 1) {
- c = kCrc32Polynomial ^ (c >> 1);
- } else {
- c >>= 1;
- }
- }
- kCrc32Table[i] = c;
- }
-}
-
-uint32_t UpdateCrc32(uint32_t start, const void* buf, size_t len) {
- EnsureCrc32TableInited();
-
- uint32_t c = start ^ 0xFFFFFFFF;
- const uint8_t* u = static_cast<const uint8_t*>(buf);
- for (size_t i = 0; i < len; ++i) {
- c = kCrc32Table[(c ^ u[i]) & 0xFF] ^ (c >> 8);
- }
- return c ^ 0xFFFFFFFF;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/crc32.h b/toolkit/crashreporter/google-breakpad/src/common/linux/crc32.h
deleted file mode 100644
index e3d9db92be..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/crc32.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_LINUX_CRC32_H_
-#define COMMON_LINUX_CRC32_H_
-
-#include <stdint.h>
-
-#include <string>
-
-namespace google_breakpad {
-
-// Updates a CRC32 checksum with |len| bytes from |buf|. |initial| holds the
-// checksum result from the previous update; for the first call, it should be 0.
-uint32_t UpdateCrc32(uint32_t initial, const void* buf, size_t len);
-
-// Computes a CRC32 checksum using |len| bytes from |buf|.
-inline uint32_t ComputeCrc32(const void* buf, size_t len) {
- return UpdateCrc32(0, buf, len);
-}
-inline uint32_t ComputeCrc32(const std::string& str) {
- return ComputeCrc32(str.c_str(), str.size());
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_CRC32_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
deleted file mode 100644
index cd99bee661..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc
+++ /dev/null
@@ -1,1159 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Restructured in 2009 by: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dump_symbols.cc: implement google_breakpad::WriteSymbolFile:
-// Find all the debugging info in a file and dump it as a Breakpad symbol file.
-
-#include "common/linux/dump_symbols.h"
-
-#include <assert.h>
-#include <elf.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <link.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <iostream>
-#include <set>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "common/arm_ex_reader.h"
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/dwarf2diehandler.h"
-#include "common/dwarf_cfi_to_module.h"
-#include "common/dwarf_cu_to_module.h"
-#include "common/dwarf_line_to_module.h"
-#include "common/linux/crc32.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/linux/elfutils.h"
-#include "common/linux/elfutils-inl.h"
-#include "common/linux/elf_symbols_to_module.h"
-#include "common/linux/file_id.h"
-#include "common/memory.h"
-#include "common/module.h"
-#include "common/scoped_ptr.h"
-#ifndef NO_STABS_SUPPORT
-#include "common/stabs_reader.h"
-#include "common/stabs_to_module.h"
-#endif
-#include "common/using_std_string.h"
-
-#ifndef SHT_ARM_EXIDX
-// bionic and older glibc don't define this
-# define SHT_ARM_EXIDX (SHT_LOPROC + 1)
-#endif
-
-// This namespace contains helper functions.
-namespace {
-
-using google_breakpad::DumpOptions;
-using google_breakpad::DwarfCFIToModule;
-using google_breakpad::DwarfCUToModule;
-using google_breakpad::DwarfLineToModule;
-using google_breakpad::ElfClass;
-using google_breakpad::ElfClass32;
-using google_breakpad::ElfClass64;
-using google_breakpad::FileID;
-using google_breakpad::FindElfSectionByName;
-using google_breakpad::GetOffset;
-using google_breakpad::IsValidElf;
-using google_breakpad::kDefaultBuildIdSize;
-using google_breakpad::Module;
-using google_breakpad::PageAllocator;
-#ifndef NO_STABS_SUPPORT
-using google_breakpad::StabsToModule;
-#endif
-using google_breakpad::scoped_ptr;
-using google_breakpad::wasteful_vector;
-
-// Define AARCH64 ELF architecture if host machine does not include this define.
-#ifndef EM_AARCH64
-#define EM_AARCH64 183
-#endif
-
-// Define SHT_ANDROID_REL and SHT_ANDROID_RELA if not defined by the host.
-// Sections with this type contain Android packed relocations.
-#ifndef SHT_ANDROID_REL
-#define SHT_ANDROID_REL (SHT_LOOS + 1)
-#endif
-#ifndef SHT_ANDROID_RELA
-#define SHT_ANDROID_RELA (SHT_LOOS + 2)
-#endif
-
-//
-// FDWrapper
-//
-// Wrapper class to make sure opened file is closed.
-//
-class FDWrapper {
- public:
- explicit FDWrapper(int fd) :
- fd_(fd) {}
- ~FDWrapper() {
- if (fd_ != -1)
- close(fd_);
- }
- int get() {
- return fd_;
- }
- int release() {
- int fd = fd_;
- fd_ = -1;
- return fd;
- }
- private:
- int fd_;
-};
-
-//
-// MmapWrapper
-//
-// Wrapper class to make sure mapped regions are unmapped.
-//
-class MmapWrapper {
- public:
- MmapWrapper() : is_set_(false) {}
- ~MmapWrapper() {
- if (is_set_ && base_ != NULL) {
- assert(size_ > 0);
- munmap(base_, size_);
- }
- }
- void set(void *mapped_address, size_t mapped_size) {
- is_set_ = true;
- base_ = mapped_address;
- size_ = mapped_size;
- }
- void release() {
- assert(is_set_);
- is_set_ = false;
- base_ = NULL;
- size_ = 0;
- }
-
- private:
- bool is_set_;
- void* base_;
- size_t size_;
-};
-
-// Find the preferred loading address of the binary.
-template<typename ElfClass>
-typename ElfClass::Addr GetLoadingAddress(
- const typename ElfClass::Phdr* program_headers,
- int nheader) {
- typedef typename ElfClass::Phdr Phdr;
-
- // For non-PIC executables (e_type == ET_EXEC), the load address is
- // the start address of the first PT_LOAD segment. (ELF requires
- // the segments to be sorted by load address.) For PIC executables
- // and dynamic libraries (e_type == ET_DYN), this address will
- // normally be zero.
- for (int i = 0; i < nheader; ++i) {
- const Phdr& header = program_headers[i];
- if (header.p_type == PT_LOAD)
- return header.p_vaddr;
- }
- return 0;
-}
-
-#ifndef NO_STABS_SUPPORT
-template<typename ElfClass>
-bool LoadStabs(const typename ElfClass::Ehdr* elf_header,
- const typename ElfClass::Shdr* stab_section,
- const typename ElfClass::Shdr* stabstr_section,
- const bool big_endian,
- Module* module) {
- // A callback object to handle data from the STABS reader.
- StabsToModule handler(module);
- // Find the addresses of the STABS data, and create a STABS reader object.
- // On Linux, STABS entries always have 32-bit values, regardless of the
- // address size of the architecture whose code they're describing, and
- // the strings are always "unitized".
- const uint8_t* stabs =
- GetOffset<ElfClass, uint8_t>(elf_header, stab_section->sh_offset);
- const uint8_t* stabstr =
- GetOffset<ElfClass, uint8_t>(elf_header, stabstr_section->sh_offset);
- google_breakpad::StabsReader reader(stabs, stab_section->sh_size,
- stabstr, stabstr_section->sh_size,
- big_endian, 4, true, &handler);
- // Read the STABS data, and do post-processing.
- if (!reader.Process())
- return false;
- handler.Finalize();
- return true;
-}
-#endif // NO_STABS_SUPPORT
-
-// A line-to-module loader that accepts line number info parsed by
-// dwarf2reader::LineInfo and populates a Module and a line vector
-// with the results.
-class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler {
- public:
- // Create a line-to-module converter using BYTE_READER.
- explicit DumperLineToModule(dwarf2reader::ByteReader *byte_reader)
- : byte_reader_(byte_reader) { }
- void StartCompilationUnit(const string& compilation_dir) {
- compilation_dir_ = compilation_dir;
- }
- void ReadProgram(const uint8_t *program, uint64 length,
- Module* module, std::vector<Module::Line>* lines) {
- DwarfLineToModule handler(module, compilation_dir_, lines);
- dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler);
- parser.Start();
- }
- private:
- string compilation_dir_;
- dwarf2reader::ByteReader *byte_reader_;
-};
-
-template<typename ElfClass>
-bool LoadDwarf(const string& dwarf_filename,
- const typename ElfClass::Ehdr* elf_header,
- const bool big_endian,
- bool handle_inter_cu_refs,
- Module* module) {
- typedef typename ElfClass::Shdr Shdr;
-
- const dwarf2reader::Endianness endianness = big_endian ?
- dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE;
- dwarf2reader::ByteReader byte_reader(endianness);
-
- // Construct a context for this file.
- DwarfCUToModule::FileContext file_context(dwarf_filename,
- module,
- handle_inter_cu_refs);
-
- // Build a map of the ELF file's sections.
- const Shdr* sections =
- GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
- int num_sections = elf_header->e_shnum;
- const Shdr* section_names = sections + elf_header->e_shstrndx;
- for (int i = 0; i < num_sections; i++) {
- const Shdr* section = &sections[i];
- string name = GetOffset<ElfClass, char>(elf_header,
- section_names->sh_offset) +
- section->sh_name;
- const uint8_t *contents = GetOffset<ElfClass, uint8_t>(elf_header,
- section->sh_offset);
- file_context.AddSectionToSectionMap(name, contents, section->sh_size);
- }
-
- // Parse all the compilation units in the .debug_info section.
- DumperLineToModule line_to_module(&byte_reader);
- dwarf2reader::SectionMap::const_iterator debug_info_entry =
- file_context.section_map().find(".debug_info");
- assert(debug_info_entry != file_context.section_map().end());
- const std::pair<const uint8_t *, uint64>& debug_info_section =
- debug_info_entry->second;
- // This should never have been called if the file doesn't have a
- // .debug_info section.
- assert(debug_info_section.first);
- uint64 debug_info_length = debug_info_section.second;
- for (uint64 offset = 0; offset < debug_info_length;) {
- // Make a handler for the root DIE that populates MODULE with the
- // data that was found.
- DwarfCUToModule::WarningReporter reporter(dwarf_filename, offset);
- DwarfCUToModule root_handler(&file_context, &line_to_module, &reporter);
- // Make a Dwarf2Handler that drives the DIEHandler.
- dwarf2reader::DIEDispatcher die_dispatcher(&root_handler);
- // Make a DWARF parser for the compilation unit at OFFSET.
- dwarf2reader::CompilationUnit reader(dwarf_filename,
- file_context.section_map(),
- offset,
- &byte_reader,
- &die_dispatcher);
- // Process the entire compilation unit; get the offset of the next.
- offset += reader.Start();
- }
- return true;
-}
-
-// Fill REGISTER_NAMES with the register names appropriate to the
-// machine architecture given in HEADER, indexed by the register
-// numbers used in DWARF call frame information. Return true on
-// success, or false if HEADER's machine architecture is not
-// supported.
-template<typename ElfClass>
-bool DwarfCFIRegisterNames(const typename ElfClass::Ehdr* elf_header,
- std::vector<string>* register_names) {
- switch (elf_header->e_machine) {
- case EM_386:
- *register_names = DwarfCFIToModule::RegisterNames::I386();
- return true;
- case EM_ARM:
- *register_names = DwarfCFIToModule::RegisterNames::ARM();
- return true;
- case EM_AARCH64:
- *register_names = DwarfCFIToModule::RegisterNames::ARM64();
- return true;
- case EM_MIPS:
- *register_names = DwarfCFIToModule::RegisterNames::MIPS();
- return true;
- case EM_X86_64:
- *register_names = DwarfCFIToModule::RegisterNames::X86_64();
- return true;
- default:
- return false;
- }
-}
-
-template<typename ElfClass>
-bool LoadDwarfCFI(const string& dwarf_filename,
- const typename ElfClass::Ehdr* elf_header,
- const char* section_name,
- const typename ElfClass::Shdr* section,
- const bool eh_frame,
- const typename ElfClass::Shdr* got_section,
- const typename ElfClass::Shdr* text_section,
- const bool big_endian,
- Module* module) {
- // Find the appropriate set of register names for this file's
- // architecture.
- std::vector<string> register_names;
- if (!DwarfCFIRegisterNames<ElfClass>(elf_header, &register_names)) {
- fprintf(stderr, "%s: unrecognized ELF machine architecture '%d';"
- " cannot convert DWARF call frame information\n",
- dwarf_filename.c_str(), elf_header->e_machine);
- return false;
- }
-
- const dwarf2reader::Endianness endianness = big_endian ?
- dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE;
-
- // Find the call frame information and its size.
- const uint8_t *cfi =
- GetOffset<ElfClass, uint8_t>(elf_header, section->sh_offset);
- size_t cfi_size = section->sh_size;
-
- // Plug together the parser, handler, and their entourages.
- DwarfCFIToModule::Reporter module_reporter(dwarf_filename, section_name);
- DwarfCFIToModule handler(module, register_names, &module_reporter);
- dwarf2reader::ByteReader byte_reader(endianness);
-
- byte_reader.SetAddressSize(ElfClass::kAddrSize);
-
- // Provide the base addresses for .eh_frame encoded pointers, if
- // possible.
- byte_reader.SetCFIDataBase(section->sh_addr, cfi);
- if (got_section)
- byte_reader.SetDataBase(got_section->sh_addr);
- if (text_section)
- byte_reader.SetTextBase(text_section->sh_addr);
-
- dwarf2reader::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename,
- section_name);
- dwarf2reader::CallFrameInfo parser(cfi, cfi_size,
- &byte_reader, &handler, &dwarf_reporter,
- eh_frame);
- parser.Start();
- return true;
-}
-
-template<typename ElfClass>
-bool LoadARMexidx(const typename ElfClass::Ehdr* elf_header,
- const typename ElfClass::Shdr* exidx_section,
- const typename ElfClass::Shdr* extab_section,
- uint32_t loading_addr,
- Module* module) {
- // To do this properly we need to know:
- // * the bounds of the .ARM.exidx section in the mapped image
- // * the bounds of the .ARM.extab section in the mapped image
- // * the vma of the last byte in the text section associated with the .exidx
- // The first two are easy. The third is a bit tricky. If we can't
- // figure out what it is, just pass in zero.
- const char *exidx_img
- = GetOffset<ElfClass, char>(elf_header, exidx_section->sh_offset);
- size_t exidx_size = exidx_section->sh_size;
- const char *extab_img
- = GetOffset<ElfClass, char>(elf_header, extab_section->sh_offset);
- size_t extab_size = extab_section->sh_size;
-
- // The sh_link field of the exidx section gives the section number
- // for the associated text section.
- uint32_t exidx_text_last_svma = 0;
- int exidx_text_sno = exidx_section->sh_link;
- typedef typename ElfClass::Shdr Shdr;
- // |sections| points to the section header table
- const Shdr* sections
- = GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
- const int num_sections = elf_header->e_shnum;
- if (exidx_text_sno >= 0 && exidx_text_sno < num_sections) {
- const Shdr* exidx_text_shdr = &sections[exidx_text_sno];
- if (exidx_text_shdr->sh_size > 0) {
- exidx_text_last_svma
- = exidx_text_shdr->sh_addr + exidx_text_shdr->sh_size - 1;
- }
- }
-
- arm_ex_to_module::ARMExToModule handler(module);
- arm_ex_reader::ExceptionTableInfo
- parser(exidx_img, exidx_size, extab_img, extab_size, exidx_text_last_svma,
- &handler,
- reinterpret_cast<const char*>(elf_header),
- loading_addr);
- parser.Start();
- return true;
-}
-
-bool LoadELF(const string& obj_file, MmapWrapper* map_wrapper,
- void** elf_header) {
- int obj_fd = open(obj_file.c_str(), O_RDONLY);
- if (obj_fd < 0) {
- fprintf(stderr, "Failed to open ELF file '%s': %s\n",
- obj_file.c_str(), strerror(errno));
- return false;
- }
- FDWrapper obj_fd_wrapper(obj_fd);
- struct stat st;
- if (fstat(obj_fd, &st) != 0 && st.st_size <= 0) {
- fprintf(stderr, "Unable to fstat ELF file '%s': %s\n",
- obj_file.c_str(), strerror(errno));
- return false;
- }
- void* obj_base = mmap(NULL, st.st_size,
- PROT_READ | PROT_WRITE, MAP_PRIVATE, obj_fd, 0);
- if (obj_base == MAP_FAILED) {
- fprintf(stderr, "Failed to mmap ELF file '%s': %s\n",
- obj_file.c_str(), strerror(errno));
- return false;
- }
- map_wrapper->set(obj_base, st.st_size);
- *elf_header = obj_base;
- if (!IsValidElf(*elf_header)) {
- fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str());
- return false;
- }
- return true;
-}
-
-// Get the endianness of ELF_HEADER. If it's invalid, return false.
-template<typename ElfClass>
-bool ElfEndianness(const typename ElfClass::Ehdr* elf_header,
- bool* big_endian) {
- if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) {
- *big_endian = false;
- return true;
- }
- if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) {
- *big_endian = true;
- return true;
- }
-
- fprintf(stderr, "bad data encoding in ELF header: %d\n",
- elf_header->e_ident[EI_DATA]);
- return false;
-}
-
-// Given |left_abspath|, find the absolute path for |right_path| and see if the
-// two absolute paths are the same.
-bool IsSameFile(const char* left_abspath, const string& right_path) {
- char right_abspath[PATH_MAX];
- if (!realpath(right_path.c_str(), right_abspath))
- return false;
- return strcmp(left_abspath, right_abspath) == 0;
-}
-
-// Read the .gnu_debuglink and get the debug file name. If anything goes
-// wrong, return an empty string.
-string ReadDebugLink(const uint8_t *debuglink,
- const size_t debuglink_size,
- const bool big_endian,
- const string& obj_file,
- const std::vector<string>& debug_dirs) {
- // Include '\0' + CRC32 (4 bytes).
- size_t debuglink_len = strlen(reinterpret_cast<const char *>(debuglink)) + 5;
- debuglink_len = 4 * ((debuglink_len + 3) / 4); // Round up to 4 bytes.
-
- // Sanity check.
- if (debuglink_len != debuglink_size) {
- fprintf(stderr, "Mismatched .gnu_debuglink string / section size: "
- "%zx %zx\n", debuglink_len, debuglink_size);
- return string();
- }
-
- char obj_file_abspath[PATH_MAX];
- if (!realpath(obj_file.c_str(), obj_file_abspath)) {
- fprintf(stderr, "Cannot resolve absolute path for %s\n", obj_file.c_str());
- return string();
- }
-
- std::vector<string> searched_paths;
- string debuglink_path;
- std::vector<string>::const_iterator it;
- for (it = debug_dirs.begin(); it < debug_dirs.end(); ++it) {
- const string& debug_dir = *it;
- debuglink_path = debug_dir + "/" +
- reinterpret_cast<const char *>(debuglink);
-
- // There is the annoying case of /path/to/foo.so having foo.so as the
- // debug link file name. Thus this may end up opening /path/to/foo.so again,
- // and there is a small chance of the two files having the same CRC.
- if (IsSameFile(obj_file_abspath, debuglink_path))
- continue;
-
- searched_paths.push_back(debug_dir);
- int debuglink_fd = open(debuglink_path.c_str(), O_RDONLY);
- if (debuglink_fd < 0)
- continue;
-
- FDWrapper debuglink_fd_wrapper(debuglink_fd);
-
- // The CRC is the last 4 bytes in |debuglink|.
- const dwarf2reader::Endianness endianness = big_endian ?
- dwarf2reader::ENDIANNESS_BIG : dwarf2reader::ENDIANNESS_LITTLE;
- dwarf2reader::ByteReader byte_reader(endianness);
- uint32_t expected_crc =
- byte_reader.ReadFourBytes(&debuglink[debuglink_size - 4]);
-
- uint32_t actual_crc = 0;
- while (true) {
- const size_t kReadSize = 4096;
- char buf[kReadSize];
- ssize_t bytes_read = HANDLE_EINTR(read(debuglink_fd, &buf, kReadSize));
- if (bytes_read < 0) {
- fprintf(stderr, "Error reading debug ELF file %s.\n",
- debuglink_path.c_str());
- return string();
- }
- if (bytes_read == 0)
- break;
- actual_crc = google_breakpad::UpdateCrc32(actual_crc, buf, bytes_read);
- }
- if (actual_crc != expected_crc) {
- fprintf(stderr, "Error reading debug ELF file - CRC32 mismatch: %s\n",
- debuglink_path.c_str());
- continue;
- }
-
- // Found debug file.
- return debuglink_path;
- }
-
- // Not found case.
- fprintf(stderr, "Failed to find debug ELF file for '%s' after trying:\n",
- obj_file.c_str());
- for (it = searched_paths.begin(); it < searched_paths.end(); ++it) {
- const string& debug_dir = *it;
- fprintf(stderr, " %s/%s\n", debug_dir.c_str(), debuglink);
- }
- return string();
-}
-
-//
-// LoadSymbolsInfo
-//
-// Holds the state between the two calls to LoadSymbols() in case it's necessary
-// to follow the .gnu_debuglink section and load debug information from a
-// different file.
-//
-template<typename ElfClass>
-class LoadSymbolsInfo {
- public:
- typedef typename ElfClass::Addr Addr;
-
- explicit LoadSymbolsInfo(const std::vector<string>& dbg_dirs) :
- debug_dirs_(dbg_dirs),
- has_loading_addr_(false) {}
-
- // Keeps track of which sections have been loaded so sections don't
- // accidentally get loaded twice from two different files.
- void LoadedSection(const string &section) {
- if (loaded_sections_.count(section) == 0) {
- loaded_sections_.insert(section);
- } else {
- fprintf(stderr, "Section %s has already been loaded.\n",
- section.c_str());
- }
- }
-
- // The ELF file and linked debug file are expected to have the same preferred
- // loading address.
- void set_loading_addr(Addr addr, const string &filename) {
- if (!has_loading_addr_) {
- loading_addr_ = addr;
- loaded_file_ = filename;
- return;
- }
-
- if (addr != loading_addr_) {
- fprintf(stderr,
- "ELF file '%s' and debug ELF file '%s' "
- "have different load addresses.\n",
- loaded_file_.c_str(), filename.c_str());
- assert(false);
- }
- }
-
- // Setters and getters
- const std::vector<string>& debug_dirs() const {
- return debug_dirs_;
- }
-
- string debuglink_file() const {
- return debuglink_file_;
- }
- void set_debuglink_file(string file) {
- debuglink_file_ = file;
- }
-
- private:
- const std::vector<string>& debug_dirs_; // Directories in which to
- // search for the debug ELF file.
-
- string debuglink_file_; // Full path to the debug ELF file.
-
- bool has_loading_addr_; // Indicate if LOADING_ADDR_ is valid.
-
- Addr loading_addr_; // Saves the preferred loading address from the
- // first call to LoadSymbols().
-
- string loaded_file_; // Name of the file loaded from the first call to
- // LoadSymbols().
-
- std::set<string> loaded_sections_; // Tracks the Loaded ELF sections
- // between calls to LoadSymbols().
-};
-
-template<typename ElfClass>
-bool LoadSymbols(const string& obj_file,
- const bool big_endian,
- const typename ElfClass::Ehdr* elf_header,
- const bool read_gnu_debug_link,
- LoadSymbolsInfo<ElfClass>* info,
- const DumpOptions& options,
- Module* module) {
- typedef typename ElfClass::Addr Addr;
- typedef typename ElfClass::Phdr Phdr;
- typedef typename ElfClass::Shdr Shdr;
- typedef typename ElfClass::Word Word;
-
- Addr loading_addr = GetLoadingAddress<ElfClass>(
- GetOffset<ElfClass, Phdr>(elf_header, elf_header->e_phoff),
- elf_header->e_phnum);
- module->SetLoadAddress(loading_addr);
- info->set_loading_addr(loading_addr, obj_file);
-
- Word debug_section_type =
- elf_header->e_machine == EM_MIPS ? SHT_MIPS_DWARF : SHT_PROGBITS;
- const Shdr* sections =
- GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
- const Shdr* section_names = sections + elf_header->e_shstrndx;
- const char* names =
- GetOffset<ElfClass, char>(elf_header, section_names->sh_offset);
- const char *names_end = names + section_names->sh_size;
- bool found_debug_info_section = false;
- bool found_usable_info = false;
-
- // Reject files that contain Android packed relocations. The pre-packed
- // version of the file should be symbolized; the packed version is only
- // intended for use on the target system.
- if (FindElfSectionByName<ElfClass>(".rel.dyn", SHT_ANDROID_REL,
- sections, names,
- names_end, elf_header->e_shnum)) {
- fprintf(stderr, "%s: file contains a \".rel.dyn\" section "
- "with type SHT_ANDROID_REL\n", obj_file.c_str());
- fprintf(stderr, "Files containing Android packed relocations "
- "may not be symbolized.\n");
- return false;
- }
- if (FindElfSectionByName<ElfClass>(".rela.dyn", SHT_ANDROID_RELA,
- sections, names,
- names_end, elf_header->e_shnum)) {
- fprintf(stderr, "%s: file contains a \".rela.dyn\" section "
- "with type SHT_ANDROID_RELA\n", obj_file.c_str());
- fprintf(stderr, "Files containing Android packed relocations "
- "may not be symbolized.\n");
- return false;
- }
-
- if (options.symbol_data != ONLY_CFI) {
-#ifndef NO_STABS_SUPPORT
- // Look for STABS debugging information, and load it if present.
- const Shdr* stab_section =
- FindElfSectionByName<ElfClass>(".stab", SHT_PROGBITS,
- sections, names, names_end,
- elf_header->e_shnum);
- if (stab_section) {
- const Shdr* stabstr_section = stab_section->sh_link + sections;
- if (stabstr_section) {
- found_debug_info_section = true;
- found_usable_info = true;
- info->LoadedSection(".stab");
- if (!LoadStabs<ElfClass>(elf_header, stab_section, stabstr_section,
- big_endian, module)) {
- fprintf(stderr, "%s: \".stab\" section found, but failed to load"
- " STABS debugging information\n", obj_file.c_str());
- }
- }
- }
-#endif // NO_STABS_SUPPORT
-
- // Look for DWARF debugging information, and load it if present.
- const Shdr* dwarf_section =
- FindElfSectionByName<ElfClass>(".debug_info", debug_section_type,
- sections, names, names_end,
- elf_header->e_shnum);
- if (dwarf_section) {
- found_debug_info_section = true;
- found_usable_info = true;
- info->LoadedSection(".debug_info");
- if (!LoadDwarf<ElfClass>(obj_file, elf_header, big_endian,
- options.handle_inter_cu_refs, module)) {
- fprintf(stderr, "%s: \".debug_info\" section found, but failed to load "
- "DWARF debugging information\n", obj_file.c_str());
- }
- }
-
- // See if there are export symbols available.
- const Shdr* symtab_section =
- FindElfSectionByName<ElfClass>(".symtab", SHT_SYMTAB,
- sections, names, names_end,
- elf_header->e_shnum);
- const Shdr* strtab_section =
- FindElfSectionByName<ElfClass>(".strtab", SHT_STRTAB,
- sections, names, names_end,
- elf_header->e_shnum);
- if (symtab_section && strtab_section) {
- info->LoadedSection(".symtab");
-
- const uint8_t* symtab =
- GetOffset<ElfClass, uint8_t>(elf_header,
- symtab_section->sh_offset);
- const uint8_t* strtab =
- GetOffset<ElfClass, uint8_t>(elf_header,
- strtab_section->sh_offset);
- bool result =
- ELFSymbolsToModule(symtab,
- symtab_section->sh_size,
- strtab,
- strtab_section->sh_size,
- big_endian,
- ElfClass::kAddrSize,
- module);
- found_usable_info = found_usable_info || result;
- } else {
- // Look in dynsym only if full symbol table was not available.
- const Shdr* dynsym_section =
- FindElfSectionByName<ElfClass>(".dynsym", SHT_DYNSYM,
- sections, names, names_end,
- elf_header->e_shnum);
- const Shdr* dynstr_section =
- FindElfSectionByName<ElfClass>(".dynstr", SHT_STRTAB,
- sections, names, names_end,
- elf_header->e_shnum);
- if (dynsym_section && dynstr_section) {
- info->LoadedSection(".dynsym");
-
- const uint8_t* dynsyms =
- GetOffset<ElfClass, uint8_t>(elf_header,
- dynsym_section->sh_offset);
- const uint8_t* dynstrs =
- GetOffset<ElfClass, uint8_t>(elf_header,
- dynstr_section->sh_offset);
- bool result =
- ELFSymbolsToModule(dynsyms,
- dynsym_section->sh_size,
- dynstrs,
- dynstr_section->sh_size,
- big_endian,
- ElfClass::kAddrSize,
- module);
- found_usable_info = found_usable_info || result;
- }
- }
- }
-
- if (options.symbol_data != NO_CFI) {
- // Dwarf Call Frame Information (CFI) is actually independent from
- // the other DWARF debugging information, and can be used alone.
- const Shdr* dwarf_cfi_section =
- FindElfSectionByName<ElfClass>(".debug_frame", debug_section_type,
- sections, names, names_end,
- elf_header->e_shnum);
- if (dwarf_cfi_section) {
- // Ignore the return value of this function; even without call frame
- // information, the other debugging information could be perfectly
- // useful.
- info->LoadedSection(".debug_frame");
- bool result =
- LoadDwarfCFI<ElfClass>(obj_file, elf_header, ".debug_frame",
- dwarf_cfi_section, false, 0, 0, big_endian,
- module);
- found_usable_info = found_usable_info || result;
- }
-
- // Linux C++ exception handling information can also provide
- // unwinding data.
- const Shdr* eh_frame_section =
- FindElfSectionByName<ElfClass>(".eh_frame", SHT_PROGBITS,
- sections, names, names_end,
- elf_header->e_shnum);
- if (eh_frame_section) {
- // Pointers in .eh_frame data may be relative to the base addresses of
- // certain sections. Provide those sections if present.
- const Shdr* got_section =
- FindElfSectionByName<ElfClass>(".got", SHT_PROGBITS,
- sections, names, names_end,
- elf_header->e_shnum);
- const Shdr* text_section =
- FindElfSectionByName<ElfClass>(".text", SHT_PROGBITS,
- sections, names, names_end,
- elf_header->e_shnum);
- info->LoadedSection(".eh_frame");
- // As above, ignore the return value of this function.
- bool result =
- LoadDwarfCFI<ElfClass>(obj_file, elf_header, ".eh_frame",
- eh_frame_section, true,
- got_section, text_section, big_endian, module);
- found_usable_info = found_usable_info || result;
- }
- }
-
- // ARM has special unwind tables that can be used.
- const Shdr* arm_exidx_section =
- FindElfSectionByName<ElfClass>(".ARM.exidx", SHT_ARM_EXIDX,
- sections, names, names_end,
- elf_header->e_shnum);
- const Shdr* arm_extab_section =
- FindElfSectionByName<ElfClass>(".ARM.extab", SHT_PROGBITS,
- sections, names, names_end,
- elf_header->e_shnum);
- // Load information from these sections even if there is
- // .debug_info, because some functions (e.g., hand-written or
- // script-generated assembly) could have exidx entries but no DWARF.
- // (For functions with both, the DWARF info that has already been
- // parsed will take precedence.)
- if (arm_exidx_section && arm_extab_section && options.symbol_data != NO_CFI) {
- info->LoadedSection(".ARM.exidx");
- info->LoadedSection(".ARM.extab");
- bool result = LoadARMexidx<ElfClass>(elf_header,
- arm_exidx_section, arm_extab_section,
- loading_addr, module);
- found_usable_info = found_usable_info || result;
- }
-
- if (!found_debug_info_section) {
- fprintf(stderr, "%s: file contains no debugging information"
- " (no \".stab\" or \".debug_info\" sections)\n",
- obj_file.c_str());
-
- // Failed, but maybe there's a .gnu_debuglink section?
- if (read_gnu_debug_link) {
- const Shdr* gnu_debuglink_section
- = FindElfSectionByName<ElfClass>(".gnu_debuglink", SHT_PROGBITS,
- sections, names,
- names_end, elf_header->e_shnum);
- if (gnu_debuglink_section) {
- if (!info->debug_dirs().empty()) {
- const uint8_t *debuglink_contents =
- GetOffset<ElfClass, uint8_t>(elf_header,
- gnu_debuglink_section->sh_offset);
- string debuglink_file =
- ReadDebugLink(debuglink_contents,
- gnu_debuglink_section->sh_size,
- big_endian,
- obj_file,
- info->debug_dirs());
- info->set_debuglink_file(debuglink_file);
- } else {
- fprintf(stderr, ".gnu_debuglink section found in '%s', "
- "but no debug path specified.\n", obj_file.c_str());
- }
- } else {
- fprintf(stderr, "%s does not contain a .gnu_debuglink section.\n",
- obj_file.c_str());
- }
- } else {
- // Return true if some usable information was found, since the caller
- // doesn't want to use .gnu_debuglink.
- return found_usable_info;
- }
-
- // No debug info was found, let the user try again with .gnu_debuglink
- // if present.
- return false;
- }
-
- return true;
-}
-
-// Return the breakpad symbol file identifier for the architecture of
-// ELF_HEADER.
-template<typename ElfClass>
-const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) {
- typedef typename ElfClass::Half Half;
- Half arch = elf_header->e_machine;
- switch (arch) {
- case EM_386: return "x86";
- case EM_ARM: return "arm";
- case EM_AARCH64: return "arm64";
- case EM_MIPS: return "mips";
- case EM_PPC64: return "ppc64";
- case EM_PPC: return "ppc";
- case EM_S390: return "s390";
- case EM_SPARC: return "sparc";
- case EM_SPARCV9: return "sparcv9";
- case EM_X86_64: return "x86_64";
- default: return NULL;
- }
-}
-
-// Return the non-directory portion of FILENAME: the portion after the
-// last slash, or the whole filename if there are no slashes.
-string BaseFileName(const string &filename) {
- // Lots of copies! basename's behavior is less than ideal.
- char* c_filename = strdup(filename.c_str());
- string base = basename(c_filename);
- free(c_filename);
- return base;
-}
-
-template<typename ElfClass>
-bool SanitizeDebugFile(const typename ElfClass::Ehdr* debug_elf_header,
- const string& debuglink_file,
- const string& obj_filename,
- const char* obj_file_architecture,
- const bool obj_file_is_big_endian) {
- const char* debug_architecture =
- ElfArchitecture<ElfClass>(debug_elf_header);
- if (!debug_architecture) {
- fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n",
- debuglink_file.c_str(), debug_elf_header->e_machine);
- return false;
- }
- if (strcmp(obj_file_architecture, debug_architecture)) {
- fprintf(stderr, "%s with ELF machine architecture %s does not match "
- "%s with ELF architecture %s\n",
- debuglink_file.c_str(), debug_architecture,
- obj_filename.c_str(), obj_file_architecture);
- return false;
- }
- bool debug_big_endian;
- if (!ElfEndianness<ElfClass>(debug_elf_header, &debug_big_endian))
- return false;
- if (debug_big_endian != obj_file_is_big_endian) {
- fprintf(stderr, "%s and %s does not match in endianness\n",
- obj_filename.c_str(), debuglink_file.c_str());
- return false;
- }
- return true;
-}
-
-template<typename ElfClass>
-bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header,
- const string& obj_filename,
- scoped_ptr<Module>& module) {
- PageAllocator allocator;
- wasteful_vector<uint8_t> identifier(&allocator, kDefaultBuildIdSize);
- if (!FileID::ElfFileIdentifierFromMappedFile(elf_header, identifier)) {
- fprintf(stderr, "%s: unable to generate file identifier\n",
- obj_filename.c_str());
- return false;
- }
-
- const char *architecture = ElfArchitecture<ElfClass>(elf_header);
- if (!architecture) {
- fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n",
- obj_filename.c_str(), elf_header->e_machine);
- return false;
- }
-
- string name = BaseFileName(obj_filename);
- string os = "Linux";
- // Add an extra "0" at the end. PDB files on Windows have an 'age'
- // number appended to the end of the file identifier; this isn't
- // really used or necessary on other platforms, but be consistent.
- string id = FileID::ConvertIdentifierToUUIDString(identifier) + "0";
- // This is just the raw Build ID in hex.
- string code_id = FileID::ConvertIdentifierToString(identifier);
-
- module.reset(new Module(name, os, architecture, id, code_id));
-
- return true;
-}
-
-template<typename ElfClass>
-bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header,
- const string& obj_filename,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- Module** out_module) {
- typedef typename ElfClass::Ehdr Ehdr;
-
- *out_module = NULL;
-
- scoped_ptr<Module> module;
- if (!InitModuleForElfClass<ElfClass>(elf_header, obj_filename, module)) {
- return false;
- }
-
- // Figure out what endianness this file is.
- bool big_endian;
- if (!ElfEndianness<ElfClass>(elf_header, &big_endian))
- return false;
-
- LoadSymbolsInfo<ElfClass> info(debug_dirs);
- if (!LoadSymbols<ElfClass>(obj_filename, big_endian, elf_header,
- !debug_dirs.empty(), &info,
- options, module.get())) {
- const string debuglink_file = info.debuglink_file();
- if (debuglink_file.empty())
- return false;
-
- // Load debuglink ELF file.
- fprintf(stderr, "Found debugging info in %s\n", debuglink_file.c_str());
- MmapWrapper debug_map_wrapper;
- Ehdr* debug_elf_header = NULL;
- if (!LoadELF(debuglink_file, &debug_map_wrapper,
- reinterpret_cast<void**>(&debug_elf_header)) ||
- !SanitizeDebugFile<ElfClass>(debug_elf_header, debuglink_file,
- obj_filename,
- module->architecture().c_str(),
- big_endian)) {
- return false;
- }
-
- if (!LoadSymbols<ElfClass>(debuglink_file, big_endian,
- debug_elf_header, false, &info,
- options, module.get())) {
- return false;
- }
- }
-
- *out_module = module.release();
- return true;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-// Not explicitly exported, but not static so it can be used in unit tests.
-bool ReadSymbolDataInternal(const uint8_t* obj_file,
- const string& obj_filename,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- Module** module) {
- if (!IsValidElf(obj_file)) {
- fprintf(stderr, "Not a valid ELF file: %s\n", obj_filename.c_str());
- return false;
- }
-
- int elfclass = ElfClass(obj_file);
- if (elfclass == ELFCLASS32) {
- return ReadSymbolDataElfClass<ElfClass32>(
- reinterpret_cast<const Elf32_Ehdr*>(obj_file), obj_filename, debug_dirs,
- options, module);
- }
- if (elfclass == ELFCLASS64) {
- return ReadSymbolDataElfClass<ElfClass64>(
- reinterpret_cast<const Elf64_Ehdr*>(obj_file), obj_filename, debug_dirs,
- options, module);
- }
-
- return false;
-}
-
-bool WriteSymbolFile(const string &obj_file,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- std::ostream &sym_stream) {
- Module* module;
- if (!ReadSymbolData(obj_file, debug_dirs, options, &module))
- return false;
-
- bool result = module->Write(sym_stream, options.symbol_data);
- delete module;
- return result;
-}
-
-// Read the selected object file's debugging information, and write out the
-// header only to |stream|. Return true on success; if an error occurs, report
-// it and return false.
-bool WriteSymbolFileHeader(const string& obj_file,
- std::ostream &sym_stream) {
- MmapWrapper map_wrapper;
- void* elf_header = NULL;
- if (!LoadELF(obj_file, &map_wrapper, &elf_header)) {
- fprintf(stderr, "Could not load ELF file: %s\n", obj_file.c_str());
- return false;
- }
-
- if (!IsValidElf(elf_header)) {
- fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str());
- return false;
- }
-
- int elfclass = ElfClass(elf_header);
- scoped_ptr<Module> module;
- if (elfclass == ELFCLASS32) {
- if (!InitModuleForElfClass<ElfClass32>(
- reinterpret_cast<const Elf32_Ehdr*>(elf_header), obj_file, module)) {
- fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str());
- return false;
- }
- } else if (elfclass == ELFCLASS64) {
- if (!InitModuleForElfClass<ElfClass64>(
- reinterpret_cast<const Elf64_Ehdr*>(elf_header), obj_file, module)) {
- fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str());
- return false;
- }
- } else {
- fprintf(stderr, "Unsupported module file: %s\n", obj_file.c_str());
- return false;
- }
-
- return module->Write(sym_stream, ALL_SYMBOL_DATA);
-}
-
-bool ReadSymbolData(const string& obj_file,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- Module** module) {
- MmapWrapper map_wrapper;
- void* elf_header = NULL;
- if (!LoadELF(obj_file, &map_wrapper, &elf_header))
- return false;
-
- return ReadSymbolDataInternal(reinterpret_cast<uint8_t*>(elf_header),
- obj_file, debug_dirs, options, module);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h
deleted file mode 100644
index 1f204cbada..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.h
+++ /dev/null
@@ -1,86 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dump_symbols.h: Read debugging information from an ELF file, and write
-// it out as a Breakpad symbol file.
-
-#ifndef COMMON_LINUX_DUMP_SYMBOLS_H__
-#define COMMON_LINUX_DUMP_SYMBOLS_H__
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "common/symbol_data.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-class Module;
-
-struct DumpOptions {
- DumpOptions(SymbolData symbol_data, bool handle_inter_cu_refs)
- : symbol_data(symbol_data),
- handle_inter_cu_refs(handle_inter_cu_refs) {
- }
-
- SymbolData symbol_data;
- bool handle_inter_cu_refs;
-};
-
-// Find all the debugging information in OBJ_FILE, an ELF executable
-// or shared library, and write it to SYM_STREAM in the Breakpad symbol
-// file format.
-// If OBJ_FILE has been stripped but contains a .gnu_debuglink section,
-// then look for the debug file in DEBUG_DIRS.
-// SYMBOL_DATA allows limiting the type of symbol data written.
-bool WriteSymbolFile(const string &obj_file,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- std::ostream &sym_stream);
-
-// Read the selected object file's debugging information, and write out the
-// header only to |stream|. Return true on success; if an error occurs, report
-// it and return false.
-bool WriteSymbolFileHeader(const string& obj_file,
- std::ostream &sym_stream);
-
-// As above, but simply return the debugging information in MODULE
-// instead of writing it to a stream. The caller owns the resulting
-// Module object and must delete it when finished.
-bool ReadSymbolData(const string& obj_file,
- const std::vector<string>& debug_dirs,
- const DumpOptions& options,
- Module** module);
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_DUMP_SYMBOLS_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols_unittest.cc
deleted file mode 100644
index bb7b20076e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols_unittest.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ted Mielczarek <ted.mielczarek@gmail.com>
-
-// dump_symbols_unittest.cc:
-// Unittests for google_breakpad::DumpSymbols
-
-#include <elf.h>
-#include <link.h>
-#include <stdio.h>
-
-#include <sstream>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/elf_gnu_compat.h"
-#include "common/linux/elfutils.h"
-#include "common/linux/dump_symbols.h"
-#include "common/linux/synth_elf.h"
-#include "common/module.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-bool ReadSymbolDataInternal(const uint8_t* obj_file,
- const string& obj_filename,
- const std::vector<string>& debug_dir,
- const DumpOptions& options,
- Module** module);
-
-using google_breakpad::synth_elf::ELF;
-using google_breakpad::synth_elf::Notes;
-using google_breakpad::synth_elf::StringTable;
-using google_breakpad::synth_elf::SymbolTable;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Section;
-using std::stringstream;
-using std::vector;
-using ::testing::Test;
-using ::testing::Types;
-
-template<typename ElfClass>
-class DumpSymbols : public Test {
- public:
- void GetElfContents(ELF& elf) {
- string contents;
- ASSERT_TRUE(elf.GetContents(&contents));
- ASSERT_LT(0U, contents.size());
-
- elfdata_v.clear();
- elfdata_v.insert(elfdata_v.begin(), contents.begin(), contents.end());
- elfdata = &elfdata_v[0];
- }
-
- vector<uint8_t> elfdata_v;
- uint8_t* elfdata;
-};
-
-typedef Types<ElfClass32, ElfClass64> ElfClasses;
-
-TYPED_TEST_CASE(DumpSymbols, ElfClasses);
-
-TYPED_TEST(DumpSymbols, Invalid) {
- Elf32_Ehdr header;
- memset(&header, 0, sizeof(header));
- Module* module;
- DumpOptions options(ALL_SYMBOL_DATA, true);
- EXPECT_FALSE(ReadSymbolDataInternal(reinterpret_cast<uint8_t*>(&header),
- "foo",
- vector<string>(),
- options,
- &module));
-}
-
-TYPED_TEST(DumpSymbols, SimplePublic) {
- ELF elf(TypeParam::kMachine, TypeParam::kClass, kLittleEndian);
- // Zero out text section for simplicity.
- Section text(kLittleEndian);
- text.Append(4096, 0);
- elf.AddSection(".text", text, SHT_PROGBITS);
-
- // Add a public symbol.
- StringTable table(kLittleEndian);
- SymbolTable syms(kLittleEndian, TypeParam::kAddrSize, table);
- syms.AddSymbol("superfunc",
- (typename TypeParam::Addr)0x1000,
- (typename TypeParam::Addr)0x10,
- // ELF32_ST_INFO works for 32-or 64-bit.
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- SHN_UNDEF + 1);
- int index = elf.AddSection(".dynstr", table, SHT_STRTAB);
- elf.AddSection(".dynsym", syms,
- SHT_DYNSYM, // type
- SHF_ALLOC, // flags
- 0, // addr
- index, // link
- sizeof(typename TypeParam::Sym)); // entsize
-
- elf.Finish();
- this->GetElfContents(elf);
-
- Module* module;
- DumpOptions options(ALL_SYMBOL_DATA, true);
- EXPECT_TRUE(ReadSymbolDataInternal(this->elfdata,
- "foo",
- vector<string>(),
- options,
- &module));
-
- stringstream s;
- module->Write(s, ALL_SYMBOL_DATA);
- const string expected =
- string("MODULE Linux ") + TypeParam::kMachineName
- + " 000000000000000000000000000000000 foo\n"
- "INFO CODE_ID 00000000000000000000000000000000\n"
- "PUBLIC 1000 0 superfunc\n";
- EXPECT_EQ(expected, s.str());
- delete module;
-}
-
-TYPED_TEST(DumpSymbols, SimpleBuildID) {
- ELF elf(TypeParam::kMachine, TypeParam::kClass, kLittleEndian);
- // Zero out text section for simplicity.
- Section text(kLittleEndian);
- text.Append(4096, 0);
- elf.AddSection(".text", text, SHT_PROGBITS);
-
- // Add a Build ID
- const uint8_t kExpectedIdentifierBytes[] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13};
- Notes notes(kLittleEndian);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
- sizeof(kExpectedIdentifierBytes));
- elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
-
- // Add a public symbol.
- StringTable table(kLittleEndian);
- SymbolTable syms(kLittleEndian, TypeParam::kAddrSize, table);
- syms.AddSymbol("superfunc",
- (typename TypeParam::Addr)0x1000,
- (typename TypeParam::Addr)0x10,
- // ELF32_ST_INFO works for 32-or 64-bit.
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- SHN_UNDEF + 1);
- int index = elf.AddSection(".dynstr", table, SHT_STRTAB);
- elf.AddSection(".dynsym", syms,
- SHT_DYNSYM, // type
- SHF_ALLOC, // flags
- 0, // addr
- index, // link
- sizeof(typename TypeParam::Sym)); // entsize
-
- elf.Finish();
- this->GetElfContents(elf);
-
- Module* module;
- DumpOptions options(ALL_SYMBOL_DATA, true);
- EXPECT_TRUE(ReadSymbolDataInternal(this->elfdata,
- "foo",
- vector<string>(),
- options,
- &module));
-
- stringstream s;
- module->Write(s, ALL_SYMBOL_DATA);
- const string expected =
- string("MODULE Linux ") + TypeParam::kMachineName
- + " 030201000504070608090A0B0C0D0E0F0 foo\n"
- "INFO CODE_ID 000102030405060708090A0B0C0D0E0F10111213\n"
- "PUBLIC 1000 0 superfunc\n";
- EXPECT_EQ(expected, s.str());
- delete module;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/eintr_wrapper.h b/toolkit/crashreporter/google-breakpad/src/common/linux/eintr_wrapper.h
deleted file mode 100644
index 3f1d184817..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/eintr_wrapper.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_LINUX_EINTR_WRAPPER_H_
-#define COMMON_LINUX_EINTR_WRAPPER_H_
-
-#include <errno.h>
-
-// This provides a wrapper around system calls which may be interrupted by a
-// signal and return EINTR. See man 7 signal.
-//
-
-#define HANDLE_EINTR(x) ({ \
- __typeof__(x) eintr_wrapper_result; \
- do { \
- eintr_wrapper_result = (x); \
- } while (eintr_wrapper_result == -1 && errno == EINTR); \
- eintr_wrapper_result; \
-})
-
-#define IGNORE_EINTR(x) ({ \
- __typeof__(x) eintr_wrapper_result; \
- do { \
- eintr_wrapper_result = (x); \
- if (eintr_wrapper_result == -1 && errno == EINTR) { \
- eintr_wrapper_result = 0; \
- } \
- } while (0); \
- eintr_wrapper_result; \
-})
-
-#endif // COMMON_LINUX_EINTR_WRAPPER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.cc
deleted file mode 100644
index 0e7db7b1fa..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// elf_core_dump.cc: Implement google_breakpad::ElfCoreDump.
-// See elf_core_dump.h for details.
-
-#include "common/linux/elf_core_dump.h"
-
-#include <stddef.h>
-#include <string.h>
-
-namespace google_breakpad {
-
-// Implementation of ElfCoreDump::Note.
-
-ElfCoreDump::Note::Note() {}
-
-ElfCoreDump::Note::Note(const MemoryRange& content) : content_(content) {}
-
-bool ElfCoreDump::Note::IsValid() const {
- return GetHeader() != NULL;
-}
-
-const ElfCoreDump::Nhdr* ElfCoreDump::Note::GetHeader() const {
- return content_.GetData<Nhdr>(0);
-}
-
-ElfCoreDump::Word ElfCoreDump::Note::GetType() const {
- const Nhdr* header = GetHeader();
- // 0 is not being used as a NOTE type.
- return header ? header->n_type : 0;
-}
-
-MemoryRange ElfCoreDump::Note::GetName() const {
- const Nhdr* header = GetHeader();
- if (header) {
- return content_.Subrange(sizeof(Nhdr), header->n_namesz);
- }
- return MemoryRange();
-}
-
-MemoryRange ElfCoreDump::Note::GetDescription() const {
- const Nhdr* header = GetHeader();
- if (header) {
- return content_.Subrange(AlignedSize(sizeof(Nhdr) + header->n_namesz),
- header->n_descsz);
- }
- return MemoryRange();
-}
-
-ElfCoreDump::Note ElfCoreDump::Note::GetNextNote() const {
- MemoryRange next_content;
- const Nhdr* header = GetHeader();
- if (header) {
- size_t next_offset = AlignedSize(sizeof(Nhdr) + header->n_namesz);
- next_offset = AlignedSize(next_offset + header->n_descsz);
- next_content =
- content_.Subrange(next_offset, content_.length() - next_offset);
- }
- return Note(next_content);
-}
-
-// static
-size_t ElfCoreDump::Note::AlignedSize(size_t size) {
- size_t mask = sizeof(Word) - 1;
- return (size + mask) & ~mask;
-}
-
-
-// Implementation of ElfCoreDump.
-
-ElfCoreDump::ElfCoreDump() {}
-
-ElfCoreDump::ElfCoreDump(const MemoryRange& content)
- : content_(content) {
-}
-
-void ElfCoreDump::SetContent(const MemoryRange& content) {
- content_ = content;
-}
-
-bool ElfCoreDump::IsValid() const {
- const Ehdr* header = GetHeader();
- return (header &&
- header->e_ident[0] == ELFMAG0 &&
- header->e_ident[1] == ELFMAG1 &&
- header->e_ident[2] == ELFMAG2 &&
- header->e_ident[3] == ELFMAG3 &&
- header->e_ident[4] == kClass &&
- header->e_version == EV_CURRENT &&
- header->e_type == ET_CORE);
-}
-
-const ElfCoreDump::Ehdr* ElfCoreDump::GetHeader() const {
- return content_.GetData<Ehdr>(0);
-}
-
-const ElfCoreDump::Phdr* ElfCoreDump::GetProgramHeader(unsigned index) const {
- const Ehdr* header = GetHeader();
- if (header) {
- return reinterpret_cast<const Phdr*>(content_.GetArrayElement(
- header->e_phoff, header->e_phentsize, index));
- }
- return NULL;
-}
-
-const ElfCoreDump::Phdr* ElfCoreDump::GetFirstProgramHeaderOfType(
- Word type) const {
- for (unsigned i = 0, n = GetProgramHeaderCount(); i < n; ++i) {
- const Phdr* program = GetProgramHeader(i);
- if (program->p_type == type) {
- return program;
- }
- }
- return NULL;
-}
-
-unsigned ElfCoreDump::GetProgramHeaderCount() const {
- const Ehdr* header = GetHeader();
- return header ? header->e_phnum : 0;
-}
-
-bool ElfCoreDump::CopyData(void* buffer, Addr virtual_address, size_t length) {
- for (unsigned i = 0, n = GetProgramHeaderCount(); i < n; ++i) {
- const Phdr* program = GetProgramHeader(i);
- if (program->p_type != PT_LOAD)
- continue;
-
- size_t offset_in_segment = virtual_address - program->p_vaddr;
- if (virtual_address >= program->p_vaddr &&
- offset_in_segment < program->p_filesz) {
- const void* data =
- content_.GetData(program->p_offset + offset_in_segment, length);
- if (data) {
- memcpy(buffer, data, length);
- return true;
- }
- }
- }
- return false;
-}
-
-ElfCoreDump::Note ElfCoreDump::GetFirstNote() const {
- MemoryRange note_content;
- const Phdr* program_header = GetFirstProgramHeaderOfType(PT_NOTE);
- if (program_header) {
- note_content = content_.Subrange(program_header->p_offset,
- program_header->p_filesz);
- }
- return Note(note_content);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h
deleted file mode 100644
index d03c7a88d3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump.h
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// elf_core_dump.h: Define the google_breakpad::ElfCoreDump class, which
-// encapsulates an ELF core dump file mapped into memory.
-
-#ifndef COMMON_LINUX_ELF_CORE_DUMP_H_
-#define COMMON_LINUX_ELF_CORE_DUMP_H_
-
-#include <elf.h>
-#include <link.h>
-#include <stddef.h>
-
-#include "common/memory_range.h"
-
-namespace google_breakpad {
-
-// A class encapsulating an ELF core dump file mapped into memory, which
-// provides methods for accessing program headers and the note section.
-class ElfCoreDump {
- public:
- // ELF types based on the value of __WORDSIZE.
- typedef ElfW(Ehdr) Ehdr;
- typedef ElfW(Nhdr) Nhdr;
- typedef ElfW(Phdr) Phdr;
- typedef ElfW(Word) Word;
- typedef ElfW(Addr) Addr;
-#if __WORDSIZE == 32
- static const int kClass = ELFCLASS32;
-#elif __WORDSIZE == 64
- static const int kClass = ELFCLASS64;
-#else
-#error "Unsupported __WORDSIZE for ElfCoreDump."
-#endif
-
- // A class encapsulating the note content in a core dump, which provides
- // methods for accessing the name and description of a note.
- class Note {
- public:
- Note();
-
- // Constructor that takes the note content from |content|.
- explicit Note(const MemoryRange& content);
-
- // Returns true if this note is valid, i,e. a note header is found in
- // |content_|, or false otherwise.
- bool IsValid() const;
-
- // Returns the note header, or NULL if no note header is found in
- // |content_|.
- const Nhdr* GetHeader() const;
-
- // Returns the note type, or 0 if no note header is found in |content_|.
- Word GetType() const;
-
- // Returns a memory range covering the note name, or an empty range
- // if no valid note name is found in |content_|.
- MemoryRange GetName() const;
-
- // Returns a memory range covering the note description, or an empty
- // range if no valid note description is found in |content_|.
- MemoryRange GetDescription() const;
-
- // Returns the note following this note, or an empty note if no valid
- // note is found after this note.
- Note GetNextNote() const;
-
- private:
- // Returns the size in bytes round up to the word alignment, specified
- // for the note section, of a given size in bytes.
- static size_t AlignedSize(size_t size);
-
- // Note content.
- MemoryRange content_;
- };
-
- ElfCoreDump();
-
- // Constructor that takes the core dump content from |content|.
- explicit ElfCoreDump(const MemoryRange& content);
-
- // Sets the core dump content to |content|.
- void SetContent(const MemoryRange& content);
-
- // Returns true if a valid ELF header in the core dump, or false otherwise.
- bool IsValid() const;
-
- // Returns the ELF header in the core dump, or NULL if no ELF header
- // is found in |content_|.
- const Ehdr* GetHeader() const;
-
- // Returns the |index|-th program header in the core dump, or NULL if no
- // ELF header is found in |content_| or |index| is out of bounds.
- const Phdr* GetProgramHeader(unsigned index) const;
-
- // Returns the first program header of |type| in the core dump, or NULL if
- // no ELF header is found in |content_| or no program header of |type| is
- // found.
- const Phdr* GetFirstProgramHeaderOfType(Word type) const;
-
- // Returns the number of program headers in the core dump, or 0 if no
- // ELF header is found in |content_|.
- unsigned GetProgramHeaderCount() const;
-
- // Copies |length| bytes of data starting at |virtual_address| in the core
- // dump to |buffer|. |buffer| should be a valid pointer to a buffer of at
- // least |length| bytes. Returns true if the data to be copied is found in
- // the core dump, or false otherwise.
- bool CopyData(void* buffer, Addr virtual_address, size_t length);
-
- // Returns the first note found in the note section of the core dump, or
- // an empty note if no note is found.
- Note GetFirstNote() const;
-
- private:
- // Core dump content.
- MemoryRange content_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_ELF_CORE_DUMP_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump_unittest.cc
deleted file mode 100644
index 9b41dceee2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_core_dump_unittest.cc
+++ /dev/null
@@ -1,256 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// elf_core_dump_unittest.cc: Unit tests for google_breakpad::ElfCoreDump.
-
-#include <sys/procfs.h>
-
-#include <set>
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/elf_core_dump.h"
-#include "common/linux/memory_mapped_file.h"
-#include "common/tests/file_utils.h"
-#include "common/linux/tests/crash_generator.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::AutoTempDir;
-using google_breakpad::CrashGenerator;
-using google_breakpad::ElfCoreDump;
-using google_breakpad::MemoryMappedFile;
-using google_breakpad::MemoryRange;
-using google_breakpad::WriteFile;
-using std::set;
-
-TEST(ElfCoreDumpTest, DefaultConstructor) {
- ElfCoreDump core;
- EXPECT_FALSE(core.IsValid());
- EXPECT_EQ(NULL, core.GetHeader());
- EXPECT_EQ(0U, core.GetProgramHeaderCount());
- EXPECT_EQ(NULL, core.GetProgramHeader(0));
- EXPECT_EQ(NULL, core.GetFirstProgramHeaderOfType(PT_LOAD));
- EXPECT_FALSE(core.GetFirstNote().IsValid());
-}
-
-TEST(ElfCoreDumpTest, TestElfHeader) {
- ElfCoreDump::Ehdr header;
- memset(&header, 0, sizeof(header));
-
- AutoTempDir temp_dir;
- string core_path = temp_dir.path() + "/core";
- const char* core_file = core_path.c_str();
- MemoryMappedFile mapped_core_file;
- ElfCoreDump core;
-
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header) - 1));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
- EXPECT_EQ(NULL, core.GetHeader());
- EXPECT_EQ(0U, core.GetProgramHeaderCount());
- EXPECT_EQ(NULL, core.GetProgramHeader(0));
- EXPECT_EQ(NULL, core.GetFirstProgramHeaderOfType(PT_LOAD));
- EXPECT_FALSE(core.GetFirstNote().IsValid());
-
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_ident[0] = ELFMAG0;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_ident[1] = ELFMAG1;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_ident[2] = ELFMAG2;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_ident[3] = ELFMAG3;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_ident[4] = ElfCoreDump::kClass;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_version = EV_CURRENT;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_FALSE(core.IsValid());
-
- header.e_type = ET_CORE;
- ASSERT_TRUE(WriteFile(core_file, &header, sizeof(header)));
- ASSERT_TRUE(mapped_core_file.Map(core_file, 0));
- core.SetContent(mapped_core_file.content());
- EXPECT_TRUE(core.IsValid());
-}
-
-TEST(ElfCoreDumpTest, ValidCoreFile) {
- CrashGenerator crash_generator;
- if (!crash_generator.HasDefaultCorePattern()) {
- fprintf(stderr, "ElfCoreDumpTest.ValidCoreFile test is skipped "
- "due to non-default core pattern");
- return;
- }
-
- const unsigned kNumOfThreads = 3;
- const unsigned kCrashThread = 1;
- const int kCrashSignal = SIGABRT;
- ASSERT_TRUE(crash_generator.CreateChildCrash(kNumOfThreads, kCrashThread,
- kCrashSignal, NULL));
- pid_t expected_crash_thread_id = crash_generator.GetThreadId(kCrashThread);
- set<pid_t> expected_thread_ids;
- for (unsigned i = 0; i < kNumOfThreads; ++i) {
- expected_thread_ids.insert(crash_generator.GetThreadId(i));
- }
-
-#if defined(__ANDROID__)
- struct stat st;
- if (stat(crash_generator.GetCoreFilePath().c_str(), &st) != 0) {
- fprintf(stderr, "ElfCoreDumpTest.ValidCoreFile test is skipped "
- "due to no core file being generated");
- return;
- }
-#endif
-
- MemoryMappedFile mapped_core_file;
- ASSERT_TRUE(
- mapped_core_file.Map(crash_generator.GetCoreFilePath().c_str(), 0));
-
- ElfCoreDump core;
- core.SetContent(mapped_core_file.content());
- EXPECT_TRUE(core.IsValid());
-
- // Based on write_note_info() in linux/kernel/fs/binfmt_elf.c, notes are
- // ordered as follows (NT_PRXFPREG and NT_386_TLS are i386 specific):
- // Thread Name Type
- // -------------------------------------------------------------------
- // 1st thread CORE NT_PRSTATUS
- // process-wide CORE NT_PRPSINFO
- // process-wide CORE NT_AUXV
- // 1st thread CORE NT_FPREGSET
- // 1st thread LINUX NT_PRXFPREG
- // 1st thread LINUX NT_386_TLS
- //
- // 2nd thread CORE NT_PRSTATUS
- // 2nd thread CORE NT_FPREGSET
- // 2nd thread LINUX NT_PRXFPREG
- // 2nd thread LINUX NT_386_TLS
- //
- // 3rd thread CORE NT_PRSTATUS
- // 3rd thread CORE NT_FPREGSET
- // 3rd thread LINUX NT_PRXFPREG
- // 3rd thread LINUX NT_386_TLS
-
- size_t num_nt_prpsinfo = 0;
- size_t num_nt_prstatus = 0;
- size_t num_pr_fpvalid = 0;
-#if defined(__i386__) || defined(__x86_64__)
- size_t num_nt_fpregset = 0;
-#endif
-#if defined(__i386__)
- size_t num_nt_prxfpreg = 0;
-#endif
- set<pid_t> actual_thread_ids;
- ElfCoreDump::Note note = core.GetFirstNote();
- while (note.IsValid()) {
- MemoryRange name = note.GetName();
- MemoryRange description = note.GetDescription();
- EXPECT_FALSE(name.IsEmpty());
- EXPECT_FALSE(description.IsEmpty());
-
- switch (note.GetType()) {
- case NT_PRPSINFO: {
- EXPECT_TRUE(description.data() != NULL);
- EXPECT_EQ(sizeof(elf_prpsinfo), description.length());
- ++num_nt_prpsinfo;
- break;
- }
- case NT_PRSTATUS: {
- EXPECT_TRUE(description.data() != NULL);
- EXPECT_EQ(sizeof(elf_prstatus), description.length());
- const elf_prstatus* status = description.GetData<elf_prstatus>(0);
- actual_thread_ids.insert(status->pr_pid);
- if (num_nt_prstatus == 0) {
- EXPECT_EQ(expected_crash_thread_id, status->pr_pid);
- EXPECT_EQ(kCrashSignal, status->pr_info.si_signo);
- }
- ++num_nt_prstatus;
- if (status->pr_fpvalid)
- ++num_pr_fpvalid;
- break;
- }
-#if defined(__i386__) || defined(__x86_64__)
- case NT_FPREGSET: {
- EXPECT_TRUE(description.data() != NULL);
- EXPECT_EQ(sizeof(user_fpregs_struct), description.length());
- ++num_nt_fpregset;
- break;
- }
-#endif
-#if defined(__i386__)
- case NT_PRXFPREG: {
- EXPECT_TRUE(description.data() != NULL);
- EXPECT_EQ(sizeof(user_fpxregs_struct), description.length());
- ++num_nt_prxfpreg;
- break;
- }
-#endif
- default:
- break;
- }
- note = note.GetNextNote();
- }
-
- EXPECT_TRUE(expected_thread_ids == actual_thread_ids);
- EXPECT_EQ(1U, num_nt_prpsinfo);
- EXPECT_EQ(kNumOfThreads, num_nt_prstatus);
-#if defined(__i386__) || defined(__x86_64__)
- EXPECT_EQ(num_pr_fpvalid, num_nt_fpregset);
-#endif
-#if defined(__i386__)
- EXPECT_EQ(num_pr_fpvalid, num_nt_prxfpreg);
-#endif
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_gnu_compat.h b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_gnu_compat.h
deleted file mode 100644
index f870cbc7d2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_gnu_compat.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Lei Zhang <thestig@google.com>
-
-// elf_gnu_compat.h: #defines unique to glibc's elf.h.
-
-#ifndef COMMON_LINUX_ELF_GNU_COMPAT_H_
-#define COMMON_LINUX_ELF_GNU_COMPAT_H_
-
-#include <elf.h>
-
-// A note type on GNU systems corresponding to the .note.gnu.build-id section.
-#ifndef NT_GNU_BUILD_ID
-#define NT_GNU_BUILD_ID 3
-#endif
-
-#endif // COMMON_LINUX_ELF_GNU_COMPAT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.cc
deleted file mode 100644
index 562875e11b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.cc
+++ /dev/null
@@ -1,178 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ted Mielczarek <ted.mielczarek@gmail.com>
-
-#include "common/linux/elf_symbols_to_module.h"
-
-#include <cxxabi.h>
-#include <elf.h>
-#include <string.h>
-
-#include "common/byte_cursor.h"
-#include "common/module.h"
-
-namespace google_breakpad {
-
-class ELFSymbolIterator {
-public:
- // The contents of an ELF symbol, adjusted for the host's endianness,
- // word size, and so on. Corresponds to the data in Elf32_Sym / Elf64_Sym.
- struct Symbol {
- // True if this iterator has reached the end of the symbol array. When
- // this is set, the other members of this structure are not valid.
- bool at_end;
-
- // The number of this symbol within the list.
- size_t index;
-
- // The current symbol's name offset. This is the offset within the
- // string table.
- size_t name_offset;
-
- // The current symbol's value, size, info and shndx fields.
- uint64_t value;
- uint64_t size;
- unsigned char info;
- uint16_t shndx;
- };
-
- // Create an ELFSymbolIterator walking the symbols in BUFFER. Treat the
- // symbols as big-endian if BIG_ENDIAN is true, as little-endian
- // otherwise. Assume each symbol has a 'value' field whose size is
- // VALUE_SIZE.
- //
- ELFSymbolIterator(const ByteBuffer *buffer, bool big_endian,
- size_t value_size)
- : value_size_(value_size), cursor_(buffer, big_endian) {
- // Actually, weird sizes could be handled just fine, but they're
- // probably mistakes --- expressed in bits, say.
- assert(value_size == 4 || value_size == 8);
- symbol_.index = 0;
- Fetch();
- }
-
- // Move to the next symbol. This function's behavior is undefined if
- // at_end() is true when it is called.
- ELFSymbolIterator &operator++() { Fetch(); symbol_.index++; return *this; }
-
- // Dereferencing this iterator produces a reference to an Symbol structure
- // that holds the current symbol's values. The symbol is owned by this
- // SymbolIterator, and will be invalidated at the next call to operator++.
- const Symbol &operator*() const { return symbol_; }
- const Symbol *operator->() const { return &symbol_; }
-
-private:
- // Read the symbol at cursor_, and set symbol_ appropriately.
- void Fetch() {
- // Elf32_Sym and Elf64_Sym have different layouts.
- unsigned char other;
- if (value_size_ == 4) {
- // Elf32_Sym
- cursor_
- .Read(4, false, &symbol_.name_offset)
- .Read(4, false, &symbol_.value)
- .Read(4, false, &symbol_.size)
- .Read(1, false, &symbol_.info)
- .Read(1, false, &other)
- .Read(2, false, &symbol_.shndx);
- } else {
- // Elf64_Sym
- cursor_
- .Read(4, false, &symbol_.name_offset)
- .Read(1, false, &symbol_.info)
- .Read(1, false, &other)
- .Read(2, false, &symbol_.shndx)
- .Read(8, false, &symbol_.value)
- .Read(8, false, &symbol_.size);
- }
- symbol_.at_end = !cursor_;
- }
-
- // The size of symbols' value field, in bytes.
- size_t value_size_;
-
- // A byte cursor traversing buffer_.
- ByteCursor cursor_;
-
- // Values for the symbol this iterator refers to.
- Symbol symbol_;
-};
-
-const char *SymbolString(ptrdiff_t offset, ByteBuffer& strings) {
- if (offset < 0 || (size_t) offset >= strings.Size()) {
- // Return the null string.
- offset = 0;
- }
- return reinterpret_cast<const char *>(strings.start + offset);
-}
-
-bool ELFSymbolsToModule(const uint8_t *symtab_section,
- size_t symtab_size,
- const uint8_t *string_section,
- size_t string_size,
- const bool big_endian,
- size_t value_size,
- Module *module) {
- ByteBuffer symbols(symtab_section, symtab_size);
- // Ensure that the string section is null-terminated.
- if (string_section[string_size - 1] != '\0') {
- const void* null_terminator = memrchr(string_section, '\0', string_size);
- string_size = reinterpret_cast<const uint8_t*>(null_terminator)
- - string_section;
- }
- ByteBuffer strings(string_section, string_size);
-
- // The iterator walking the symbol table.
- ELFSymbolIterator iterator(&symbols, big_endian, value_size);
-
- while(!iterator->at_end) {
- if (ELF32_ST_TYPE(iterator->info) == STT_FUNC &&
- iterator->shndx != SHN_UNDEF) {
- Module::Extern *ext = new Module::Extern(iterator->value);
- ext->name = SymbolString(iterator->name_offset, strings);
-#if !defined(__ANDROID__) // Android NDK doesn't provide abi::__cxa_demangle.
- int status = 0;
- char* demangled =
- abi::__cxa_demangle(ext->name.c_str(), NULL, NULL, &status);
- if (demangled) {
- if (status == 0)
- ext->name = demangled;
- free(demangled);
- }
-#endif
- module->AddExtern(ext);
- }
- ++iterator;
- }
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.h
deleted file mode 100644
index 2e7c097151..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ted Mielczarek <ted.mielczarek@gmail.com>
-
-// elf_symbols_to_module.h: Exposes ELFSymbolsToModule, a function
-// for reading ELF symbol tables and inserting exported symbol names
-// into a google_breakpad::Module as Extern definitions.
-
-#ifndef BREAKPAD_COMMON_LINUX_ELF_SYMBOLS_TO_MODULE_H_
-#define BREAKPAD_COMMON_LINUX_ELF_SYMBOLS_TO_MODULE_H_
-
-#include <stddef.h>
-#include <stdint.h>
-
-namespace google_breakpad {
-
-class Module;
-
-bool ELFSymbolsToModule(const uint8_t *symtab_section,
- size_t symtab_size,
- const uint8_t *string_section,
- size_t string_size,
- const bool big_endian,
- size_t value_size,
- Module *module);
-
-} // namespace google_breakpad
-
-
-#endif // BREAKPAD_COMMON_LINUX_ELF_SYMBOLS_TO_MODULE_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module_unittest.cc
deleted file mode 100644
index 8984449ab6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elf_symbols_to_module_unittest.cc
+++ /dev/null
@@ -1,370 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ted Mielczarek <ted.mielczarek@gmail.com>
-
-// elf_symbols_to_module_unittest.cc:
-// Unittests for google_breakpad::ELFSymbolsToModule
-
-#include <elf.h>
-
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/elf_symbols_to_module.h"
-#include "common/linux/synth_elf.h"
-#include "common/module.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::Module;
-using google_breakpad::synth_elf::StringTable;
-using google_breakpad::test_assembler::Endianness;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using ::testing::Test;
-using ::testing::TestWithParam;
-using std::vector;
-
-class ELFSymbolsToModuleTestFixture {
-public:
- ELFSymbolsToModuleTestFixture(Endianness endianness,
- size_t value_size) : module("a", "b", "c", "d"),
- section(endianness),
- table(endianness),
- value_size(value_size) {}
-
- bool ProcessSection() {
- string section_contents, table_contents;
- section.GetContents(&section_contents);
- table.GetContents(&table_contents);
-
- bool ret = ELFSymbolsToModule(reinterpret_cast<const uint8_t*>(section_contents.data()),
- section_contents.size(),
- reinterpret_cast<const uint8_t*>(table_contents.data()),
- table_contents.size(),
- section.endianness() == kBigEndian,
- value_size,
- &module);
- module.GetExterns(&externs, externs.end());
- return ret;
- }
-
- Module module;
- Section section;
- StringTable table;
- string section_contents;
- // 4 or 8 (bytes)
- size_t value_size;
-
- vector<Module::Extern *> externs;
-};
-
-class ELFSymbolsToModuleTest32 : public ELFSymbolsToModuleTestFixture,
- public TestWithParam<Endianness> {
-public:
- ELFSymbolsToModuleTest32() : ELFSymbolsToModuleTestFixture(GetParam(), 4) {}
-
- void AddElf32Sym(const string& name, uint32_t value,
- uint32_t size, unsigned info, uint16_t shndx) {
- section
- .D32(table.Add(name))
- .D32(value)
- .D32(size)
- .D8(info)
- .D8(0) // other
- .D16(shndx);
- }
-};
-
-TEST_P(ELFSymbolsToModuleTest32, NoFuncs) {
- ProcessSection();
-
- ASSERT_EQ((size_t)0, externs.size());
-}
-
-TEST_P(ELFSymbolsToModuleTest32, OneFunc) {
- const string kFuncName = "superfunc";
- const uint32_t kFuncAddr = 0x1000;
- const uint32_t kFuncSize = 0x10;
-
- AddElf32Sym(kFuncName, kFuncAddr, kFuncSize,
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 1);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)1, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr, extern1->address);
-}
-
-TEST_P(ELFSymbolsToModuleTest32, NameOutOfBounds) {
- const string kFuncName = "";
- const uint32_t kFuncAddr = 0x1000;
- const uint32_t kFuncSize = 0x10;
-
- table.Add("Foo");
- table.Add("Bar");
- // Can't use AddElf32Sym because it puts in a valid string offset.
- section
- .D32((uint32_t)table.Here().Value() + 1)
- .D32(kFuncAddr)
- .D32(kFuncSize)
- .D8(ELF32_ST_INFO(STB_GLOBAL, STT_FUNC))
- .D8(0) // other
- .D16(SHN_UNDEF + 1);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)1, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr, extern1->address);
-}
-
-TEST_P(ELFSymbolsToModuleTest32, NonTerminatedStringTable) {
- const string kFuncName = "";
- const uint32_t kFuncAddr = 0x1000;
- const uint32_t kFuncSize = 0x10;
-
- table.Add("Foo");
- table.Add("Bar");
- // Add a non-null-terminated string to the end of the string table
- Label l;
- table
- .Mark(&l)
- .Append("Unterminated");
- // Can't use AddElf32Sym because it puts in a valid string offset.
- section
- .D32((uint32_t)l.Value())
- .D32(kFuncAddr)
- .D32(kFuncSize)
- .D8(ELF32_ST_INFO(STB_GLOBAL, STT_FUNC))
- .D8(0) // other
- .D16(SHN_UNDEF + 1);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)1, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr, extern1->address);
-}
-
-TEST_P(ELFSymbolsToModuleTest32, MultipleFuncs) {
- const string kFuncName1 = "superfunc";
- const uint32_t kFuncAddr1 = 0x10001000;
- const uint32_t kFuncSize1 = 0x10;
- const string kFuncName2 = "awesomefunc";
- const uint32_t kFuncAddr2 = 0x20002000;
- const uint32_t kFuncSize2 = 0x2f;
- const string kFuncName3 = "megafunc";
- const uint32_t kFuncAddr3 = 0x30003000;
- const uint32_t kFuncSize3 = 0x3c;
-
- AddElf32Sym(kFuncName1, kFuncAddr1, kFuncSize1,
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 1);
- AddElf32Sym(kFuncName2, kFuncAddr2, kFuncSize2,
- ELF32_ST_INFO(STB_LOCAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 2);
- AddElf32Sym(kFuncName3, kFuncAddr3, kFuncSize3,
- ELF32_ST_INFO(STB_LOCAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 3);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)3, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName1, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr1, extern1->address);
- Module::Extern *extern2 = externs[1];
- EXPECT_EQ(kFuncName2, extern2->name);
- EXPECT_EQ((Module::Address)kFuncAddr2, extern2->address);
- Module::Extern *extern3 = externs[2];
- EXPECT_EQ(kFuncName3, extern3->name);
- EXPECT_EQ((Module::Address)kFuncAddr3, extern3->address);
-}
-
-TEST_P(ELFSymbolsToModuleTest32, SkipStuff) {
- const string kFuncName = "superfunc";
- const uint32_t kFuncAddr = 0x1000;
- const uint32_t kFuncSize = 0x10;
-
- // Should skip functions in SHN_UNDEF
- AddElf32Sym("skipme", 0xFFFF, 0x10,
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- SHN_UNDEF);
- AddElf32Sym(kFuncName, kFuncAddr, kFuncSize,
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 1);
- // Should skip non-STT_FUNC entries.
- AddElf32Sym("skipmetoo", 0xAAAA, 0x10,
- ELF32_ST_INFO(STB_GLOBAL, STT_FILE),
- SHN_UNDEF + 1);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)1, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr, extern1->address);
-}
-
-// Run all the 32-bit tests with both endianness
-INSTANTIATE_TEST_CASE_P(Endian,
- ELFSymbolsToModuleTest32,
- ::testing::Values(kLittleEndian, kBigEndian));
-
-// Similar tests, but with 64-bit values. Ostensibly this could be
-// shoehorned into the parameterization by using ::testing::Combine,
-// but that would make it difficult to get the types right since these
-// actual test cases aren't parameterized. This could also be written
-// as a type-parameterized test, but combining that with a value-parameterized
-// test seemed really ugly, and also makes it harder to test 64-bit
-// values.
-class ELFSymbolsToModuleTest64 : public ELFSymbolsToModuleTestFixture,
- public TestWithParam<Endianness> {
-public:
- ELFSymbolsToModuleTest64() : ELFSymbolsToModuleTestFixture(GetParam(), 8) {}
-
- void AddElf64Sym(const string& name, uint64_t value,
- uint64_t size, unsigned info, uint16_t shndx) {
- section
- .D32(table.Add(name))
- .D8(info)
- .D8(0) // other
- .D16(shndx)
- .D64(value)
- .D64(size);
- }
-};
-
-TEST_P(ELFSymbolsToModuleTest64, NoFuncs) {
- ProcessSection();
-
- ASSERT_EQ((size_t)0, externs.size());
-}
-
-TEST_P(ELFSymbolsToModuleTest64, OneFunc) {
- const string kFuncName = "superfunc";
- const uint64_t kFuncAddr = 0x1000200030004000ULL;
- const uint64_t kFuncSize = 0x1000;
-
- AddElf64Sym(kFuncName, kFuncAddr, kFuncSize,
- ELF64_ST_INFO(STB_GLOBAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 1);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)1, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr, extern1->address);
-}
-
-TEST_P(ELFSymbolsToModuleTest64, MultipleFuncs) {
- const string kFuncName1 = "superfunc";
- const uint64_t kFuncAddr1 = 0x1000100010001000ULL;
- const uint64_t kFuncSize1 = 0x1000;
- const string kFuncName2 = "awesomefunc";
- const uint64_t kFuncAddr2 = 0x2000200020002000ULL;
- const uint64_t kFuncSize2 = 0x2f00;
- const string kFuncName3 = "megafunc";
- const uint64_t kFuncAddr3 = 0x3000300030003000ULL;
- const uint64_t kFuncSize3 = 0x3c00;
-
- AddElf64Sym(kFuncName1, kFuncAddr1, kFuncSize1,
- ELF64_ST_INFO(STB_GLOBAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 1);
- AddElf64Sym(kFuncName2, kFuncAddr2, kFuncSize2,
- ELF64_ST_INFO(STB_LOCAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 2);
- AddElf64Sym(kFuncName3, kFuncAddr3, kFuncSize3,
- ELF64_ST_INFO(STB_LOCAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 3);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)3, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName1, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr1, extern1->address);
- Module::Extern *extern2 = externs[1];
- EXPECT_EQ(kFuncName2, extern2->name);
- EXPECT_EQ((Module::Address)kFuncAddr2, extern2->address);
- Module::Extern *extern3 = externs[2];
- EXPECT_EQ(kFuncName3, extern3->name);
- EXPECT_EQ((Module::Address)kFuncAddr3, extern3->address);
-}
-
-TEST_P(ELFSymbolsToModuleTest64, SkipStuff) {
- const string kFuncName = "superfunc";
- const uint64_t kFuncAddr = 0x1000100010001000ULL;
- const uint64_t kFuncSize = 0x1000;
-
- // Should skip functions in SHN_UNDEF
- AddElf64Sym("skipme", 0xFFFF, 0x10,
- ELF64_ST_INFO(STB_GLOBAL, STT_FUNC),
- SHN_UNDEF);
- AddElf64Sym(kFuncName, kFuncAddr, kFuncSize,
- ELF64_ST_INFO(STB_GLOBAL, STT_FUNC),
- // Doesn't really matter, just can't be SHN_UNDEF.
- SHN_UNDEF + 1);
- // Should skip non-STT_FUNC entries.
- AddElf64Sym("skipmetoo", 0xAAAA, 0x10,
- ELF64_ST_INFO(STB_GLOBAL, STT_FILE),
- SHN_UNDEF + 1);
-
- ProcessSection();
-
- ASSERT_EQ((size_t)1, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_EQ(kFuncName, extern1->name);
- EXPECT_EQ((Module::Address)kFuncAddr, extern1->address);
-}
-
-// Run all the 64-bit tests with both endianness
-INSTANTIATE_TEST_CASE_P(Endian,
- ELFSymbolsToModuleTest64,
- ::testing::Values(kLittleEndian, kBigEndian));
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils-inl.h b/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils-inl.h
deleted file mode 100644
index e56b37a9f5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils-inl.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_LINUX_ELFUTILS_INL_H__
-#define COMMON_LINUX_ELFUTILS_INL_H__
-
-#include "common/linux/linux_libc_support.h"
-#include "elfutils.h"
-
-namespace google_breakpad {
-
-template<typename ElfClass, typename T>
-const T* GetOffset(const typename ElfClass::Ehdr* elf_header,
- typename ElfClass::Off offset) {
- return reinterpret_cast<const T*>(reinterpret_cast<uintptr_t>(elf_header) +
- offset);
-}
-
-template<typename ElfClass>
-const typename ElfClass::Shdr* FindElfSectionByName(
- const char* name,
- typename ElfClass::Word section_type,
- const typename ElfClass::Shdr* sections,
- const char* section_names,
- const char* names_end,
- int nsection) {
- assert(name != NULL);
- assert(sections != NULL);
- assert(nsection > 0);
-
- int name_len = my_strlen(name);
- if (name_len == 0)
- return NULL;
-
- for (int i = 0; i < nsection; ++i) {
- const char* section_name = section_names + sections[i].sh_name;
- if (sections[i].sh_type == section_type &&
- names_end - section_name >= name_len + 1 &&
- my_strcmp(name, section_name) == 0) {
- return sections + i;
- }
- }
- return NULL;
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_ELFUTILS_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.cc
deleted file mode 100644
index a79391c133..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.cc
+++ /dev/null
@@ -1,194 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/linux/elfutils.h"
-
-#include <assert.h>
-#include <string.h>
-
-#include "common/linux/linux_libc_support.h"
-#include "common/linux/elfutils-inl.h"
-
-namespace google_breakpad {
-
-namespace {
-
-template<typename ElfClass>
-void FindElfClassSection(const char *elf_base,
- const char *section_name,
- typename ElfClass::Word section_type,
- const void **section_start,
- size_t *section_size) {
- typedef typename ElfClass::Ehdr Ehdr;
- typedef typename ElfClass::Shdr Shdr;
-
- assert(elf_base);
- assert(section_start);
- assert(section_size);
-
- assert(my_strncmp(elf_base, ELFMAG, SELFMAG) == 0);
-
- const Ehdr* elf_header = reinterpret_cast<const Ehdr*>(elf_base);
- assert(elf_header->e_ident[EI_CLASS] == ElfClass::kClass);
-
- const Shdr* sections =
- GetOffset<ElfClass, Shdr>(elf_header, elf_header->e_shoff);
- const Shdr* section_names = sections + elf_header->e_shstrndx;
- const char* names =
- GetOffset<ElfClass, char>(elf_header, section_names->sh_offset);
- const char *names_end = names + section_names->sh_size;
-
- const Shdr* section =
- FindElfSectionByName<ElfClass>(section_name, section_type,
- sections, names, names_end,
- elf_header->e_shnum);
-
- if (section != NULL && section->sh_size > 0) {
- *section_start = elf_base + section->sh_offset;
- *section_size = section->sh_size;
- }
-}
-
-template<typename ElfClass>
-void FindElfClassSegment(const char *elf_base,
- typename ElfClass::Word segment_type,
- const void **segment_start,
- size_t *segment_size) {
- typedef typename ElfClass::Ehdr Ehdr;
- typedef typename ElfClass::Phdr Phdr;
-
- assert(elf_base);
- assert(segment_start);
- assert(segment_size);
-
- assert(my_strncmp(elf_base, ELFMAG, SELFMAG) == 0);
-
- const Ehdr* elf_header = reinterpret_cast<const Ehdr*>(elf_base);
- assert(elf_header->e_ident[EI_CLASS] == ElfClass::kClass);
-
- const Phdr* phdrs =
- GetOffset<ElfClass, Phdr>(elf_header, elf_header->e_phoff);
-
- for (int i = 0; i < elf_header->e_phnum; ++i) {
- if (phdrs[i].p_type == segment_type) {
- *segment_start = elf_base + phdrs[i].p_offset;
- *segment_size = phdrs[i].p_filesz;
- return;
- }
- }
-}
-
-} // namespace
-
-bool IsValidElf(const void* elf_base) {
- return my_strncmp(reinterpret_cast<const char*>(elf_base),
- ELFMAG, SELFMAG) == 0;
-}
-
-int ElfClass(const void* elf_base) {
- const ElfW(Ehdr)* elf_header =
- reinterpret_cast<const ElfW(Ehdr)*>(elf_base);
-
- return elf_header->e_ident[EI_CLASS];
-}
-
-bool FindElfSection(const void *elf_mapped_base,
- const char *section_name,
- uint32_t section_type,
- const void **section_start,
- size_t *section_size,
- int *elfclass) {
- assert(elf_mapped_base);
- assert(section_start);
- assert(section_size);
-
- *section_start = NULL;
- *section_size = 0;
-
- if (!IsValidElf(elf_mapped_base))
- return false;
-
- int cls = ElfClass(elf_mapped_base);
- if (elfclass) {
- *elfclass = cls;
- }
-
- const char* elf_base =
- static_cast<const char*>(elf_mapped_base);
-
- if (cls == ELFCLASS32) {
- FindElfClassSection<ElfClass32>(elf_base, section_name, section_type,
- section_start, section_size);
- return *section_start != NULL;
- } else if (cls == ELFCLASS64) {
- FindElfClassSection<ElfClass64>(elf_base, section_name, section_type,
- section_start, section_size);
- return *section_start != NULL;
- }
-
- return false;
-}
-
-bool FindElfSegment(const void *elf_mapped_base,
- uint32_t segment_type,
- const void **segment_start,
- size_t *segment_size,
- int *elfclass) {
- assert(elf_mapped_base);
- assert(segment_start);
- assert(segment_size);
-
- *segment_start = NULL;
- *segment_size = 0;
-
- if (!IsValidElf(elf_mapped_base))
- return false;
-
- int cls = ElfClass(elf_mapped_base);
- if (elfclass) {
- *elfclass = cls;
- }
-
- const char* elf_base =
- static_cast<const char*>(elf_mapped_base);
-
- if (cls == ELFCLASS32) {
- FindElfClassSegment<ElfClass32>(elf_base, segment_type,
- segment_start, segment_size);
- return *segment_start != NULL;
- } else if (cls == ELFCLASS64) {
- FindElfClassSegment<ElfClass64>(elf_base, segment_type,
- segment_start, segment_size);
- return *segment_start != NULL;
- }
-
- return false;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.h b/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.h
deleted file mode 100644
index f34ba83142..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/elfutils.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// elfutils.h: Utilities for dealing with ELF files.
-//
-
-#ifndef COMMON_LINUX_ELFUTILS_H_
-#define COMMON_LINUX_ELFUTILS_H_
-
-#include <elf.h>
-#include <link.h>
-#include <stdint.h>
-
-namespace google_breakpad {
-
-// Traits classes so consumers can write templatized code to deal
-// with specific ELF bits.
-struct ElfClass32 {
- typedef Elf32_Addr Addr;
- typedef Elf32_Ehdr Ehdr;
- typedef Elf32_Nhdr Nhdr;
- typedef Elf32_Phdr Phdr;
- typedef Elf32_Shdr Shdr;
- typedef Elf32_Half Half;
- typedef Elf32_Off Off;
- typedef Elf32_Sym Sym;
- typedef Elf32_Word Word;
-
- static const int kClass = ELFCLASS32;
- static const uint16_t kMachine = EM_386;
- static const size_t kAddrSize = sizeof(Elf32_Addr);
- static constexpr const char* kMachineName = "x86";
-};
-
-struct ElfClass64 {
- typedef Elf64_Addr Addr;
- typedef Elf64_Ehdr Ehdr;
- typedef Elf64_Nhdr Nhdr;
- typedef Elf64_Phdr Phdr;
- typedef Elf64_Shdr Shdr;
- typedef Elf64_Half Half;
- typedef Elf64_Off Off;
- typedef Elf64_Sym Sym;
- typedef Elf64_Word Word;
-
- static const int kClass = ELFCLASS64;
- static const uint16_t kMachine = EM_X86_64;
- static const size_t kAddrSize = sizeof(Elf64_Addr);
- static constexpr const char* kMachineName = "x86_64";
-};
-
-bool IsValidElf(const void* elf_header);
-int ElfClass(const void* elf_base);
-
-// Attempt to find a section named |section_name| of type |section_type|
-// in the ELF binary data at |elf_mapped_base|. On success, returns true
-// and sets |*section_start| to point to the start of the section data,
-// and |*section_size| to the size of the section's data. If |elfclass|
-// is not NULL, set |*elfclass| to the ELF file class.
-bool FindElfSection(const void *elf_mapped_base,
- const char *section_name,
- uint32_t section_type,
- const void **section_start,
- size_t *section_size,
- int *elfclass);
-
-// Internal helper method, exposed for convenience for callers
-// that already have more info.
-template<typename ElfClass>
-const typename ElfClass::Shdr*
-FindElfSectionByName(const char* name,
- typename ElfClass::Word section_type,
- const typename ElfClass::Shdr* sections,
- const char* section_names,
- const char* names_end,
- int nsection);
-
-// Attempt to find the first segment of type |segment_type| in the ELF
-// binary data at |elf_mapped_base|. On success, returns true and sets
-// |*segment_start| to point to the start of the segment data, and
-// and |*segment_size| to the size of the segment's data. If |elfclass|
-// is not NULL, set |*elfclass| to the ELF file class.
-bool FindElfSegment(const void *elf_mapped_base,
- uint32_t segment_type,
- const void **segment_start,
- size_t *segment_size,
- int *elfclass);
-
-// Convert an offset from an Elf header into a pointer to the mapped
-// address in the current process. Takes an extra template parameter
-// to specify the return type to avoid having to dynamic_cast the
-// result.
-template<typename ElfClass, typename T>
-const T*
-GetOffset(const typename ElfClass::Ehdr* elf_header,
- typename ElfClass::Off offset);
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_ELFUTILS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.cc
deleted file mode 100644
index 311e030209..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// file_id.cc: Return a unique identifier for a file
-//
-// See file_id.h for documentation
-//
-
-#include "common/linux/file_id.h"
-
-#include <arpa/inet.h>
-#include <assert.h>
-#include <string.h>
-
-#include <algorithm>
-#include <string>
-
-#include "common/linux/elf_gnu_compat.h"
-#include "common/linux/elfutils.h"
-#include "common/linux/linux_libc_support.h"
-#include "common/linux/memory_mapped_file.h"
-#include "common/using_std_string.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-// Used in a few places for backwards-compatibility.
-const size_t kMDGUIDSize = sizeof(MDGUID);
-
-FileID::FileID(const char* path) : path_(path) {}
-
-// ELF note name and desc are 32-bits word padded.
-#define NOTE_PADDING(a) ((a + 3) & ~3)
-
-// These functions are also used inside the crashed process, so be safe
-// and use the syscall/libc wrappers instead of direct syscalls or libc.
-
-template<typename ElfClass>
-static bool ElfClassBuildIDNoteIdentifier(const void *section, size_t length,
- wasteful_vector<uint8_t>& identifier) {
- typedef typename ElfClass::Nhdr Nhdr;
-
- const void* section_end = reinterpret_cast<const char*>(section) + length;
- const Nhdr* note_header = reinterpret_cast<const Nhdr*>(section);
- while (reinterpret_cast<const void *>(note_header) < section_end) {
- if (note_header->n_type == NT_GNU_BUILD_ID)
- break;
- note_header = reinterpret_cast<const Nhdr*>(
- reinterpret_cast<const char*>(note_header) + sizeof(Nhdr) +
- NOTE_PADDING(note_header->n_namesz) +
- NOTE_PADDING(note_header->n_descsz));
- }
- if (reinterpret_cast<const void *>(note_header) >= section_end ||
- note_header->n_descsz == 0) {
- return false;
- }
-
- const uint8_t* build_id = reinterpret_cast<const uint8_t*>(note_header) +
- sizeof(Nhdr) + NOTE_PADDING(note_header->n_namesz);
- identifier.insert(identifier.end(),
- build_id,
- build_id + note_header->n_descsz);
-
- return true;
-}
-
-// Attempt to locate a .note.gnu.build-id section in an ELF binary
-// and copy it into |identifier|.
-static bool FindElfBuildIDNote(const void* elf_mapped_base,
- wasteful_vector<uint8_t>& identifier) {
- void* note_section;
- size_t note_size;
- int elfclass;
- if ((!FindElfSegment(elf_mapped_base, PT_NOTE,
- (const void**)&note_section, &note_size, &elfclass) ||
- note_size == 0) &&
- (!FindElfSection(elf_mapped_base, ".note.gnu.build-id", SHT_NOTE,
- (const void**)&note_section, &note_size, &elfclass) ||
- note_size == 0)) {
- return false;
- }
-
- if (elfclass == ELFCLASS32) {
- return ElfClassBuildIDNoteIdentifier<ElfClass32>(note_section, note_size,
- identifier);
- } else if (elfclass == ELFCLASS64) {
- return ElfClassBuildIDNoteIdentifier<ElfClass64>(note_section, note_size,
- identifier);
- }
-
- return false;
-}
-
-// Attempt to locate the .text section of an ELF binary and generate
-// a simple hash by XORing the first page worth of bytes into |identifier|.
-static bool HashElfTextSection(const void* elf_mapped_base,
- wasteful_vector<uint8_t>& identifier) {
- identifier.resize(kMDGUIDSize);
-
- void* text_section;
- size_t text_size;
- if (!FindElfSection(elf_mapped_base, ".text", SHT_PROGBITS,
- (const void**)&text_section, &text_size, NULL) ||
- text_size == 0) {
- return false;
- }
-
- // Only provide |kMDGUIDSize| bytes to keep identifiers produced by this
- // function backwards-compatible.
- my_memset(&identifier[0], 0, kMDGUIDSize);
- const uint8_t* ptr = reinterpret_cast<const uint8_t*>(text_section);
- const uint8_t* ptr_end = ptr + std::min(text_size, static_cast<size_t>(4096));
- while (ptr < ptr_end) {
- for (unsigned i = 0; i < kMDGUIDSize; i++)
- identifier[i] ^= ptr[i];
- ptr += kMDGUIDSize;
- }
- return true;
-}
-
-// static
-bool FileID::ElfFileIdentifierFromMappedFile(const void* base,
- wasteful_vector<uint8_t>& identifier) {
- // Look for a build id note first.
- if (FindElfBuildIDNote(base, identifier))
- return true;
-
- // Fall back on hashing the first page of the text section.
- return HashElfTextSection(base, identifier);
-}
-
-bool FileID::ElfFileIdentifier(wasteful_vector<uint8_t>& identifier) {
- MemoryMappedFile mapped_file(path_.c_str(), 0);
- if (!mapped_file.data()) // Should probably check if size >= ElfW(Ehdr)?
- return false;
-
- return ElfFileIdentifierFromMappedFile(mapped_file.data(), identifier);
-}
-
-// These three functions are not ever called in an unsafe context, so it's OK
-// to allocate memory and use libc.
-static string bytes_to_hex_string(const uint8_t* bytes, size_t count) {
- string result;
- for (unsigned int idx = 0; idx < count; ++idx) {
- char buf[3];
- snprintf(buf, sizeof(buf), "%02X", bytes[idx]);
- result.append(buf);
- }
- return result;
-}
-
-// static
-string FileID::ConvertIdentifierToUUIDString(
- const wasteful_vector<uint8_t>& identifier) {
- uint8_t identifier_swapped[kMDGUIDSize] = { 0 };
-
- // Endian-ness swap to match dump processor expectation.
- memcpy(identifier_swapped, &identifier[0],
- std::min(kMDGUIDSize, identifier.size()));
- uint32_t* data1 = reinterpret_cast<uint32_t*>(identifier_swapped);
- *data1 = htonl(*data1);
- uint16_t* data2 = reinterpret_cast<uint16_t*>(identifier_swapped + 4);
- *data2 = htons(*data2);
- uint16_t* data3 = reinterpret_cast<uint16_t*>(identifier_swapped + 6);
- *data3 = htons(*data3);
-
- return bytes_to_hex_string(identifier_swapped, kMDGUIDSize);
-}
-
-// static
-string FileID::ConvertIdentifierToString(
- const wasteful_vector<uint8_t>& identifier) {
- return bytes_to_hex_string(&identifier[0], identifier.size());
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.h b/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.h
deleted file mode 100644
index a1d2fd6ed6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/file_id.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// file_id.h: Return a unique identifier for a file
-//
-
-#ifndef COMMON_LINUX_FILE_ID_H__
-#define COMMON_LINUX_FILE_ID_H__
-
-#include <limits.h>
-#include <string>
-
-#include "common/linux/guid_creator.h"
-#include "common/memory.h"
-
-namespace google_breakpad {
-
-// GNU binutils' ld defaults to 'sha1', which is 160 bits == 20 bytes,
-// so this is enough to fit that, which most binaries will use.
-// This is just a sensible default for auto_wasteful_vector so most
-// callers can get away with stack allocation.
-static const size_t kDefaultBuildIdSize = 20;
-
-class FileID {
- public:
- explicit FileID(const char* path);
- ~FileID() {}
-
- // Load the identifier for the elf file path specified in the constructor into
- // |identifier|.
- //
- // The current implementation will look for a .note.gnu.build-id
- // section and use that as the file id, otherwise it falls back to
- // XORing the first 4096 bytes of the .text section to generate an identifier.
- bool ElfFileIdentifier(wasteful_vector<uint8_t>& identifier);
-
- // Load the identifier for the elf file mapped into memory at |base| into
- // |identifier|. Return false if the identifier could not be created for this
- // file.
- static bool ElfFileIdentifierFromMappedFile(
- const void* base,
- wasteful_vector<uint8_t>& identifier);
-
- // Convert the |identifier| data to a string. The string will
- // be formatted as a UUID in all uppercase without dashes.
- // (e.g., 22F065BBFC9C49F780FE26A7CEBD7BCE).
- static std::string ConvertIdentifierToUUIDString(
- const wasteful_vector<uint8_t>& identifier);
-
- // Convert the entire |identifier| data to a hex string.
- static std::string ConvertIdentifierToString(
- const wasteful_vector<uint8_t>& identifier);
-
- private:
- // Storage for the path specified
- std::string path_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_FILE_ID_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/file_id_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/file_id_unittest.cc
deleted file mode 100644
index 3a81930348..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/file_id_unittest.cc
+++ /dev/null
@@ -1,338 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit tests for FileID
-
-#include <elf.h>
-#include <stdlib.h>
-
-#include <string>
-#include <vector>
-
-#include "common/linux/elf_gnu_compat.h"
-#include "common/linux/elfutils.h"
-#include "common/linux/file_id.h"
-#include "common/linux/safe_readlink.h"
-#include "common/linux/synth_elf.h"
-#include "common/test_assembler.h"
-#include "common/tests/auto_tempdir.h"
-#include "common/using_std_string.h"
-#include "breakpad_googletest_includes.h"
-
-using namespace google_breakpad;
-using google_breakpad::synth_elf::ELF;
-using google_breakpad::synth_elf::Notes;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Section;
-using std::vector;
-using ::testing::Types;
-
-namespace {
-
-// Simply calling Section::Append(size, byte) produces a uninteresting pattern
-// that tends to get hashed to 0000...0000. This populates the section with
-// data to produce better hashes.
-void PopulateSection(Section* section, int size, int prime_number) {
- for (int i = 0; i < size; i++)
- section->Append(1, (i % prime_number) % 256);
-}
-
-typedef wasteful_vector<uint8_t> id_vector;
-
-} // namespace
-
-#ifndef __ANDROID__
-// This test is disabled on Android: It will always fail, since there is no
-// 'strip' binary installed on test devices.
-TEST(FileIDStripTest, StripSelf) {
- // Calculate the File ID of this binary using
- // FileID::ElfFileIdentifier, then make a copy of this binary,
- // strip it, and ensure that the result is the same.
- char exe_name[PATH_MAX];
- ASSERT_TRUE(SafeReadLink("/proc/self/exe", exe_name));
-
- // copy our binary to a temp file, and strip it
- AutoTempDir temp_dir;
- string templ = temp_dir.path() + "/file-id-unittest";
- char cmdline[4096];
- sprintf(cmdline, "cp \"%s\" \"%s\"", exe_name, templ.c_str());
- ASSERT_EQ(0, system(cmdline)) << "Failed to execute: " << cmdline;
- sprintf(cmdline, "chmod u+w \"%s\"", templ.c_str());
- ASSERT_EQ(0, system(cmdline)) << "Failed to execute: " << cmdline;
- sprintf(cmdline, "strip \"%s\"", templ.c_str());
- ASSERT_EQ(0, system(cmdline)) << "Failed to execute: " << cmdline;
-
- PageAllocator allocator;
- id_vector identifier1(&allocator, kDefaultBuildIdSize);
- id_vector identifier2(&allocator, kDefaultBuildIdSize);
-
- FileID fileid1(exe_name);
- EXPECT_TRUE(fileid1.ElfFileIdentifier(identifier1));
- FileID fileid2(templ.c_str());
- EXPECT_TRUE(fileid2.ElfFileIdentifier(identifier2));
-
- string identifier_string1 =
- FileID::ConvertIdentifierToUUIDString(identifier1);
- string identifier_string2 =
- FileID::ConvertIdentifierToUUIDString(identifier2);
- EXPECT_EQ(identifier_string1, identifier_string2);
-}
-#endif // !__ANDROID__
-
-template<typename ElfClass>
-class FileIDTest : public testing::Test {
-public:
- void GetElfContents(ELF& elf) {
- string contents;
- ASSERT_TRUE(elf.GetContents(&contents));
- ASSERT_LT(0U, contents.size());
-
- elfdata_v.clear();
- elfdata_v.insert(elfdata_v.begin(), contents.begin(), contents.end());
- elfdata = &elfdata_v[0];
- }
-
- id_vector make_vector() {
- return id_vector(&allocator, kDefaultBuildIdSize);
- }
-
- template<size_t N>
- string get_file_id(const uint8_t (&data)[N]) {
- id_vector expected_identifier(make_vector());
- expected_identifier.insert(expected_identifier.end(),
- &data[0],
- data + N);
- return FileID::ConvertIdentifierToUUIDString(expected_identifier);
- }
-
- vector<uint8_t> elfdata_v;
- uint8_t* elfdata;
- PageAllocator allocator;
-};
-
-typedef Types<ElfClass32, ElfClass64> ElfClasses;
-
-TYPED_TEST_CASE(FileIDTest, ElfClasses);
-
-TYPED_TEST(FileIDTest, ElfClass) {
- const char expected_identifier_string[] =
- "80808080808000000000008080808080";
- const size_t kTextSectionSize = 128;
-
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- Section text(kLittleEndian);
- for (size_t i = 0; i < kTextSectionSize; ++i) {
- text.D8(i * 3);
- }
- elf.AddSection(".text", text, SHT_PROGBITS);
- elf.Finish();
- this->GetElfContents(elf);
-
- id_vector identifier(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier));
-
- string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
- EXPECT_EQ(expected_identifier_string, identifier_string);
-}
-
-TYPED_TEST(FileIDTest, BuildID) {
- const uint8_t kExpectedIdentifierBytes[] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13};
- const string expected_identifier_string =
- this->get_file_id(kExpectedIdentifierBytes);
-
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- Section text(kLittleEndian);
- text.Append(4096, 0);
- elf.AddSection(".text", text, SHT_PROGBITS);
- Notes notes(kLittleEndian);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
- sizeof(kExpectedIdentifierBytes));
- elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
- elf.Finish();
- this->GetElfContents(elf);
-
- id_vector identifier(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier));
- EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
-
- string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
- EXPECT_EQ(expected_identifier_string, identifier_string);
-}
-
-// Test that a build id note with fewer bytes than usual is handled.
-TYPED_TEST(FileIDTest, BuildIDShort) {
- const uint8_t kExpectedIdentifierBytes[] =
- {0x00, 0x01, 0x02, 0x03};
- const string expected_identifier_string =
- this->get_file_id(kExpectedIdentifierBytes);
-
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- Section text(kLittleEndian);
- text.Append(4096, 0);
- elf.AddSection(".text", text, SHT_PROGBITS);
- Notes notes(kLittleEndian);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
- sizeof(kExpectedIdentifierBytes));
- elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
- elf.Finish();
- this->GetElfContents(elf);
-
- id_vector identifier(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier));
- EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
-
- string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
- EXPECT_EQ(expected_identifier_string, identifier_string);
-}
-
-// Test that a build id note with more bytes than usual is handled.
-TYPED_TEST(FileIDTest, BuildIDLong) {
- const uint8_t kExpectedIdentifierBytes[] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
- const string expected_identifier_string =
- this->get_file_id(kExpectedIdentifierBytes);
-
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- Section text(kLittleEndian);
- text.Append(4096, 0);
- elf.AddSection(".text", text, SHT_PROGBITS);
- Notes notes(kLittleEndian);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
- sizeof(kExpectedIdentifierBytes));
- elf.AddSection(".note.gnu.build-id", notes, SHT_NOTE);
- elf.Finish();
- this->GetElfContents(elf);
-
- id_vector identifier(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier));
- EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
-
- string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
- EXPECT_EQ(expected_identifier_string, identifier_string);
-}
-
-TYPED_TEST(FileIDTest, BuildIDPH) {
- const uint8_t kExpectedIdentifierBytes[] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13};
- const string expected_identifier_string =
- this->get_file_id(kExpectedIdentifierBytes);
-
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- Section text(kLittleEndian);
- text.Append(4096, 0);
- elf.AddSection(".text", text, SHT_PROGBITS);
- Notes notes(kLittleEndian);
- notes.AddNote(0, "Linux",
- reinterpret_cast<const uint8_t *>("\0x42\0x02\0\0"), 4);
- notes.AddNote(NT_GNU_BUILD_ID, "GNU", kExpectedIdentifierBytes,
- sizeof(kExpectedIdentifierBytes));
- int note_idx = elf.AddSection(".note", notes, SHT_NOTE);
- elf.AddSegment(note_idx, note_idx, PT_NOTE);
- elf.Finish();
- this->GetElfContents(elf);
-
- id_vector identifier(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier));
- EXPECT_EQ(sizeof(kExpectedIdentifierBytes), identifier.size());
-
- string identifier_string = FileID::ConvertIdentifierToUUIDString(identifier);
- EXPECT_EQ(expected_identifier_string, identifier_string);
-}
-
-// Test to make sure two files with different text sections produce
-// different hashes when not using a build id.
-TYPED_TEST(FileIDTest, UniqueHashes) {
- {
- ELF elf1(EM_386, TypeParam::kClass, kLittleEndian);
- Section foo_1(kLittleEndian);
- PopulateSection(&foo_1, 32, 5);
- elf1.AddSection(".foo", foo_1, SHT_PROGBITS);
- Section text_1(kLittleEndian);
- PopulateSection(&text_1, 4096, 17);
- elf1.AddSection(".text", text_1, SHT_PROGBITS);
- elf1.Finish();
- this->GetElfContents(elf1);
- }
-
- id_vector identifier_1(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier_1));
- string identifier_string_1 =
- FileID::ConvertIdentifierToUUIDString(identifier_1);
-
- {
- ELF elf2(EM_386, TypeParam::kClass, kLittleEndian);
- Section text_2(kLittleEndian);
- Section foo_2(kLittleEndian);
- PopulateSection(&foo_2, 32, 5);
- elf2.AddSection(".foo", foo_2, SHT_PROGBITS);
- PopulateSection(&text_2, 4096, 31);
- elf2.AddSection(".text", text_2, SHT_PROGBITS);
- elf2.Finish();
- this->GetElfContents(elf2);
- }
-
- id_vector identifier_2(this->make_vector());
- EXPECT_TRUE(FileID::ElfFileIdentifierFromMappedFile(this->elfdata,
- identifier_2));
- string identifier_string_2 =
- FileID::ConvertIdentifierToUUIDString(identifier_2);
-
- EXPECT_NE(identifier_string_1, identifier_string_2);
-}
-
-TYPED_TEST(FileIDTest, ConvertIdentifierToString) {
- const uint8_t kIdentifierBytes[] =
- {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
- 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
- 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
- 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
- const char* kExpected =
- "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F";
-
- id_vector identifier(this->make_vector());
- identifier.insert(identifier.end(),
- kIdentifierBytes,
- kIdentifierBytes + sizeof(kIdentifierBytes));
- ASSERT_EQ(kExpected,
- FileID::ConvertIdentifierToString(identifier));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.cc
deleted file mode 100644
index 6d86fb3697..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.cc
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "common/linux/google_crashdump_uploader.h"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <iostream>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-GoogleCrashdumpUploader::GoogleCrashdumpUploader(const string& product,
- const string& version,
- const string& guid,
- const string& ptime,
- const string& ctime,
- const string& email,
- const string& comments,
- const string& minidump_pathname,
- const string& crash_server,
- const string& proxy_host,
- const string& proxy_userpassword) {
- LibcurlWrapper* http_layer = new LibcurlWrapper();
- Init(product,
- version,
- guid,
- ptime,
- ctime,
- email,
- comments,
- minidump_pathname,
- crash_server,
- proxy_host,
- proxy_userpassword,
- http_layer);
-}
-
-GoogleCrashdumpUploader::GoogleCrashdumpUploader(const string& product,
- const string& version,
- const string& guid,
- const string& ptime,
- const string& ctime,
- const string& email,
- const string& comments,
- const string& minidump_pathname,
- const string& crash_server,
- const string& proxy_host,
- const string& proxy_userpassword,
- LibcurlWrapper* http_layer) {
- Init(product,
- version,
- guid,
- ptime,
- ctime,
- email,
- comments,
- minidump_pathname,
- crash_server,
- proxy_host,
- proxy_userpassword,
- http_layer);
-}
-
-void GoogleCrashdumpUploader::Init(const string& product,
- const string& version,
- const string& guid,
- const string& ptime,
- const string& ctime,
- const string& email,
- const string& comments,
- const string& minidump_pathname,
- const string& crash_server,
- const string& proxy_host,
- const string& proxy_userpassword,
- LibcurlWrapper* http_layer) {
- product_ = product;
- version_ = version;
- guid_ = guid;
- ptime_ = ptime;
- ctime_ = ctime;
- email_ = email;
- comments_ = comments;
- http_layer_.reset(http_layer);
-
- crash_server_ = crash_server;
- proxy_host_ = proxy_host;
- proxy_userpassword_ = proxy_userpassword;
- minidump_pathname_ = minidump_pathname;
- std::cout << "Uploader initializing";
- std::cout << "\tProduct: " << product_;
- std::cout << "\tVersion: " << version_;
- std::cout << "\tGUID: " << guid_;
- if (!ptime_.empty()) {
- std::cout << "\tProcess uptime: " << ptime_;
- }
- if (!ctime_.empty()) {
- std::cout << "\tCumulative Process uptime: " << ctime_;
- }
- if (!email_.empty()) {
- std::cout << "\tEmail: " << email_;
- }
- if (!comments_.empty()) {
- std::cout << "\tComments: " << comments_;
- }
-}
-
-bool GoogleCrashdumpUploader::CheckRequiredParametersArePresent() {
- string error_text;
- if (product_.empty()) {
- error_text.append("\nProduct name must be specified.");
- }
-
- if (version_.empty()) {
- error_text.append("\nProduct version must be specified.");
- }
-
- if (guid_.empty()) {
- error_text.append("\nClient ID must be specified.");
- }
-
- if (minidump_pathname_.empty()) {
- error_text.append("\nMinidump pathname must be specified.");
- }
-
- if (!error_text.empty()) {
- std::cout << error_text;
- return false;
- }
- return true;
-
-}
-
-bool GoogleCrashdumpUploader::Upload(int* http_status_code,
- string* http_response_header,
- string* http_response_body) {
- bool ok = http_layer_->Init();
- if (!ok) {
- std::cout << "http layer init failed";
- return ok;
- }
-
- if (!CheckRequiredParametersArePresent()) {
- return false;
- }
-
- struct stat st;
- int err = stat(minidump_pathname_.c_str(), &st);
- if (err) {
- std::cout << minidump_pathname_ << " could not be found";
- return false;
- }
-
- parameters_["prod"] = product_;
- parameters_["ver"] = version_;
- parameters_["guid"] = guid_;
- parameters_["ptime"] = ptime_;
- parameters_["ctime"] = ctime_;
- parameters_["email"] = email_;
- parameters_["comments_"] = comments_;
- if (!http_layer_->AddFile(minidump_pathname_,
- "upload_file_minidump")) {
- return false;
- }
- std::cout << "Sending request to " << crash_server_;
- return http_layer_->SendRequest(crash_server_,
- parameters_,
- http_status_code,
- http_response_header,
- http_response_body);
-}
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.h b/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.h
deleted file mode 100644
index a2d0575b5e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader.h
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#ifndef COMMON_LINUX_GOOGLE_CRASHDUMP_UPLOADER_H_
-#define COMMON_LINUX_GOOGLE_CRASHDUMP_UPLOADER_H_
-
-#include <string>
-#include <map>
-
-#include "common/linux/libcurl_wrapper.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-class GoogleCrashdumpUploader {
- public:
- GoogleCrashdumpUploader(const string& product,
- const string& version,
- const string& guid,
- const string& ptime,
- const string& ctime,
- const string& email,
- const string& comments,
- const string& minidump_pathname,
- const string& crash_server,
- const string& proxy_host,
- const string& proxy_userpassword);
-
- GoogleCrashdumpUploader(const string& product,
- const string& version,
- const string& guid,
- const string& ptime,
- const string& ctime,
- const string& email,
- const string& comments,
- const string& minidump_pathname,
- const string& crash_server,
- const string& proxy_host,
- const string& proxy_userpassword,
- LibcurlWrapper* http_layer);
-
- void Init(const string& product,
- const string& version,
- const string& guid,
- const string& ptime,
- const string& ctime,
- const string& email,
- const string& comments,
- const string& minidump_pathname,
- const string& crash_server,
- const string& proxy_host,
- const string& proxy_userpassword,
- LibcurlWrapper* http_layer);
- bool Upload(int* http_status_code,
- string* http_response_header,
- string* http_response_body);
-
- private:
- bool CheckRequiredParametersArePresent();
-
- scoped_ptr<LibcurlWrapper> http_layer_;
- string product_;
- string version_;
- string guid_;
- string ptime_;
- string ctime_;
- string email_;
- string comments_;
- string minidump_pathname_;
-
- string crash_server_;
- string proxy_host_;
- string proxy_userpassword_;
-
- std::map<string, string> parameters_;
-};
-}
-
-#endif // COMMON_LINUX_GOOGLE_CRASHDUMP_UPLOADER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader_test.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader_test.cc
deleted file mode 100644
index e94c5d62a2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/google_crashdump_uploader_test.cc
+++ /dev/null
@@ -1,170 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit test for crash dump uploader.
-
-#include <string>
-
-#include "common/linux/google_crashdump_uploader.h"
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using ::testing::Return;
-using ::testing::_;
-
-class MockLibcurlWrapper : public LibcurlWrapper {
- public:
- MOCK_METHOD0(Init, bool());
- MOCK_METHOD2(SetProxy, bool(const string& proxy_host,
- const string& proxy_userpwd));
- MOCK_METHOD2(AddFile, bool(const string& upload_file_path,
- const string& basename));
- MOCK_METHOD5(SendRequest,
- bool(const string& url,
- const std::map<string, string>& parameters,
- int* http_status_code,
- string* http_header_data,
- string* http_response_data));
-};
-
-class GoogleCrashdumpUploaderTest : public ::testing::Test {
-};
-
-TEST_F(GoogleCrashdumpUploaderTest, InitFailsCausesUploadFailure) {
- MockLibcurlWrapper m;
- EXPECT_CALL(m, Init()).Times(1).WillOnce(Return(false));
- GoogleCrashdumpUploader *uploader = new GoogleCrashdumpUploader("foobar",
- "1.0",
- "AAA-BBB",
- "",
- "",
- "test@test.com",
- "none",
- "/tmp/foo.dmp",
- "http://foo.com",
- "",
- "",
- &m);
- ASSERT_FALSE(uploader->Upload(NULL, NULL, NULL));
-}
-
-TEST_F(GoogleCrashdumpUploaderTest, TestSendRequestHappensWithValidParameters) {
- // Create a temp file
- char tempfn[80] = "/tmp/googletest-upload-XXXXXX";
- int fd = mkstemp(tempfn);
- ASSERT_NE(fd, -1);
- close(fd);
-
- MockLibcurlWrapper m;
- EXPECT_CALL(m, Init()).Times(1).WillOnce(Return(true));
- EXPECT_CALL(m, AddFile(tempfn, _)).WillOnce(Return(true));
- EXPECT_CALL(m,
- SendRequest("http://foo.com",_,_,_,_)).Times(1).WillOnce(Return(true));
- GoogleCrashdumpUploader *uploader = new GoogleCrashdumpUploader("foobar",
- "1.0",
- "AAA-BBB",
- "",
- "",
- "test@test.com",
- "none",
- tempfn,
- "http://foo.com",
- "",
- "",
- &m);
- ASSERT_TRUE(uploader->Upload(NULL, NULL, NULL));
-}
-
-
-TEST_F(GoogleCrashdumpUploaderTest, InvalidPathname) {
- MockLibcurlWrapper m;
- EXPECT_CALL(m, Init()).Times(1).WillOnce(Return(true));
- EXPECT_CALL(m, SendRequest(_,_,_,_,_)).Times(0);
- GoogleCrashdumpUploader *uploader = new GoogleCrashdumpUploader("foobar",
- "1.0",
- "AAA-BBB",
- "",
- "",
- "test@test.com",
- "none",
- "/tmp/foo.dmp",
- "http://foo.com",
- "",
- "",
- &m);
- ASSERT_FALSE(uploader->Upload(NULL, NULL, NULL));
-}
-
-TEST_F(GoogleCrashdumpUploaderTest, TestRequiredParametersMustBePresent) {
- // Test with empty product name.
- GoogleCrashdumpUploader uploader("",
- "1.0",
- "AAA-BBB",
- "",
- "",
- "test@test.com",
- "none",
- "/tmp/foo.dmp",
- "http://foo.com",
- "",
- "");
- ASSERT_FALSE(uploader.Upload(NULL, NULL, NULL));
-
- // Test with empty product version.
- GoogleCrashdumpUploader uploader1("product",
- "",
- "AAA-BBB",
- "",
- "",
- "",
- "",
- "/tmp/foo.dmp",
- "",
- "",
- "");
-
- ASSERT_FALSE(uploader1.Upload(NULL, NULL, NULL));
-
- // Test with empty client GUID.
- GoogleCrashdumpUploader uploader2("product",
- "1.0",
- "",
- "",
- "",
- "",
- "",
- "/tmp/foo.dmp",
- "",
- "",
- "");
- ASSERT_FALSE(uploader2.Upload(NULL, NULL, NULL));
-}
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.cc
deleted file mode 100644
index bfb308ee20..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/linux/guid_creator.h"
-
-#include <assert.h>
-#include <pthread.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-
-//
-// GUIDGenerator
-//
-// This class is used to generate random GUID.
-// Currently use random number to generate a GUID since Linux has
-// no native GUID generator. This should be OK since we don't expect
-// crash to happen very offen.
-//
-class GUIDGenerator {
- public:
- static uint32_t BytesToUInt32(const uint8_t bytes[]) {
- return ((uint32_t) bytes[0]
- | ((uint32_t) bytes[1] << 8)
- | ((uint32_t) bytes[2] << 16)
- | ((uint32_t) bytes[3] << 24));
- }
-
- static void UInt32ToBytes(uint8_t bytes[], uint32_t n) {
- bytes[0] = n & 0xff;
- bytes[1] = (n >> 8) & 0xff;
- bytes[2] = (n >> 16) & 0xff;
- bytes[3] = (n >> 24) & 0xff;
- }
-
- static bool CreateGUID(GUID *guid) {
- InitOnce();
- guid->data1 = random();
- guid->data2 = (uint16_t)(random());
- guid->data3 = (uint16_t)(random());
- UInt32ToBytes(&guid->data4[0], random());
- UInt32ToBytes(&guid->data4[4], random());
- return true;
- }
-
- private:
- static void InitOnce() {
- pthread_once(&once_control, &InitOnceImpl);
- }
-
- static void InitOnceImpl() {
- srandom(time(NULL));
- }
-
- static pthread_once_t once_control;
-};
-
-pthread_once_t GUIDGenerator::once_control = PTHREAD_ONCE_INIT;
-
-bool CreateGUID(GUID *guid) {
- return GUIDGenerator::CreateGUID(guid);
-}
-
-// Parse guid to string.
-bool GUIDToString(const GUID *guid, char *buf, int buf_len) {
- // Should allow more space the the max length of GUID.
- assert(buf_len > kGUIDStringLength);
- int num = snprintf(buf, buf_len, kGUIDFormatString,
- guid->data1, guid->data2, guid->data3,
- GUIDGenerator::BytesToUInt32(&(guid->data4[0])),
- GUIDGenerator::BytesToUInt32(&(guid->data4[4])));
- if (num != kGUIDStringLength)
- return false;
-
- buf[num] = '\0';
- return true;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.h b/toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.h
deleted file mode 100644
index c86d856c4d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/guid_creator.h
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_LINUX_GUID_CREATOR_H__
-#define COMMON_LINUX_GUID_CREATOR_H__
-
-#include "google_breakpad/common/minidump_format.h"
-
-typedef MDGUID GUID;
-
-// Format string for parsing GUID.
-#define kGUIDFormatString "%08x-%04x-%04x-%08x-%08x"
-// Length of GUID string. Don't count the ending '\0'.
-#define kGUIDStringLength 36
-
-// Create a guid.
-bool CreateGUID(GUID *guid);
-
-// Get the string from guid.
-bool GUIDToString(const GUID *guid, char *buf, int buf_len);
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc
deleted file mode 100644
index 702526af75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/linux/http_upload.h"
-
-#include <assert.h>
-#include <dlfcn.h>
-#include "third_party/curl/curl.h"
-
-namespace {
-
-// Callback to get the response data from server.
-static size_t WriteCallback(void *ptr, size_t size,
- size_t nmemb, void *userp) {
- if (!userp)
- return 0;
-
- string *response = reinterpret_cast<string *>(userp);
- size_t real_size = size * nmemb;
- response->append(reinterpret_cast<char *>(ptr), real_size);
- return real_size;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-static const char kUserAgent[] = "Breakpad/1.0 (Linux)";
-
-// static
-bool HTTPUpload::SendRequest(const string &url,
- const map<string, string> &parameters,
- const map<string, string> &files,
- const string &proxy,
- const string &proxy_user_pwd,
- const string &ca_certificate_file,
- string *response_body,
- long *response_code,
- string *error_description) {
- if (response_code != NULL)
- *response_code = 0;
-
- if (!CheckParameters(parameters))
- return false;
-
- // We may have been linked statically; if curl_easy_init is in the
- // current binary, no need to search for a dynamic version.
- void* curl_lib = dlopen(NULL, RTLD_NOW);
- if (!CheckCurlLib(curl_lib)) {
- fprintf(stderr,
- "Failed to open curl lib from binary, use libcurl.so instead\n");
- dlerror(); // Clear dlerror before attempting to open libraries.
- dlclose(curl_lib);
- curl_lib = NULL;
- }
- if (!curl_lib) {
- curl_lib = dlopen("libcurl.so", RTLD_NOW);
- }
- if (!curl_lib) {
- if (error_description != NULL)
- *error_description = dlerror();
- curl_lib = dlopen("libcurl.so.4", RTLD_NOW);
- }
- if (!curl_lib) {
- // Debian gives libcurl a different name when it is built against GnuTLS
- // instead of OpenSSL.
- curl_lib = dlopen("libcurl-gnutls.so.4", RTLD_NOW);
- }
- if (!curl_lib) {
- curl_lib = dlopen("libcurl.so.3", RTLD_NOW);
- }
- if (!curl_lib) {
- return false;
- }
-
- CURL* (*curl_easy_init)(void);
- *(void**) (&curl_easy_init) = dlsym(curl_lib, "curl_easy_init");
- CURL *curl = (*curl_easy_init)();
- if (error_description != NULL)
- *error_description = "No Error";
-
- if (!curl) {
- dlclose(curl_lib);
- return false;
- }
-
- CURLcode err_code = CURLE_OK;
- CURLcode (*curl_easy_setopt)(CURL *, CURLoption, ...);
- *(void**) (&curl_easy_setopt) = dlsym(curl_lib, "curl_easy_setopt");
- (*curl_easy_setopt)(curl, CURLOPT_URL, url.c_str());
- (*curl_easy_setopt)(curl, CURLOPT_USERAGENT, kUserAgent);
- // Support multithread by disabling timeout handling, would get SIGSEGV with
- // Curl_resolv_timeout in stack trace otherwise.
- // See https://curl.haxx.se/libcurl/c/threadsafe.html
- (*curl_easy_setopt)(curl, CURLOPT_NOSIGNAL, 1);
- // Set proxy information if necessary.
- if (!proxy.empty())
- (*curl_easy_setopt)(curl, CURLOPT_PROXY, proxy.c_str());
- if (!proxy_user_pwd.empty())
- (*curl_easy_setopt)(curl, CURLOPT_PROXYUSERPWD, proxy_user_pwd.c_str());
-
- if (!ca_certificate_file.empty())
- (*curl_easy_setopt)(curl, CURLOPT_CAINFO, ca_certificate_file.c_str());
-
- struct curl_httppost *formpost = NULL;
- struct curl_httppost *lastptr = NULL;
- // Add form data.
- CURLFORMcode (*curl_formadd)(struct curl_httppost **, struct curl_httppost **, ...);
- *(void**) (&curl_formadd) = dlsym(curl_lib, "curl_formadd");
- map<string, string>::const_iterator iter = parameters.begin();
- for (; iter != parameters.end(); ++iter)
- (*curl_formadd)(&formpost, &lastptr,
- CURLFORM_COPYNAME, iter->first.c_str(),
- CURLFORM_COPYCONTENTS, iter->second.c_str(),
- CURLFORM_END);
-
- // Add form files.
- for (iter = files.begin(); iter != files.end(); ++iter) {
- (*curl_formadd)(&formpost, &lastptr,
- CURLFORM_COPYNAME, iter->first.c_str(),
- CURLFORM_FILE, iter->second.c_str(),
- CURLFORM_END);
- }
-
- (*curl_easy_setopt)(curl, CURLOPT_HTTPPOST, formpost);
-
- // Disable 100-continue header.
- struct curl_slist *headerlist = NULL;
- char buf[] = "Expect:";
- struct curl_slist* (*curl_slist_append)(struct curl_slist *, const char *);
- *(void**) (&curl_slist_append) = dlsym(curl_lib, "curl_slist_append");
- headerlist = (*curl_slist_append)(headerlist, buf);
- (*curl_easy_setopt)(curl, CURLOPT_HTTPHEADER, headerlist);
-
- if (response_body != NULL) {
- (*curl_easy_setopt)(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
- (*curl_easy_setopt)(curl, CURLOPT_WRITEDATA,
- reinterpret_cast<void *>(response_body));
- }
-
- // Fail if 400+ is returned from the web server.
- (*curl_easy_setopt)(curl, CURLOPT_FAILONERROR, 1);
-
- CURLcode (*curl_easy_perform)(CURL *);
- *(void**) (&curl_easy_perform) = dlsym(curl_lib, "curl_easy_perform");
- err_code = (*curl_easy_perform)(curl);
- if (response_code != NULL) {
- CURLcode (*curl_easy_getinfo)(CURL *, CURLINFO, ...);
- *(void**) (&curl_easy_getinfo) = dlsym(curl_lib, "curl_easy_getinfo");
- (*curl_easy_getinfo)(curl, CURLINFO_RESPONSE_CODE, response_code);
- }
- const char* (*curl_easy_strerror)(CURLcode);
- *(void**) (&curl_easy_strerror) = dlsym(curl_lib, "curl_easy_strerror");
-#ifndef NDEBUG
- if (err_code != CURLE_OK)
- fprintf(stderr, "Failed to send http request to %s, error: %s\n",
- url.c_str(),
- (*curl_easy_strerror)(err_code));
-#endif
- if (error_description != NULL)
- *error_description = (*curl_easy_strerror)(err_code);
-
- void (*curl_easy_cleanup)(CURL *);
- *(void**) (&curl_easy_cleanup) = dlsym(curl_lib, "curl_easy_cleanup");
- (*curl_easy_cleanup)(curl);
- if (formpost != NULL) {
- void (*curl_formfree)(struct curl_httppost *);
- *(void**) (&curl_formfree) = dlsym(curl_lib, "curl_formfree");
- (*curl_formfree)(formpost);
- }
- if (headerlist != NULL) {
- void (*curl_slist_free_all)(struct curl_slist *);
- *(void**) (&curl_slist_free_all) = dlsym(curl_lib, "curl_slist_free_all");
- (*curl_slist_free_all)(headerlist);
- }
- dlclose(curl_lib);
- return err_code == CURLE_OK;
-}
-
-// static
-bool HTTPUpload::CheckCurlLib(void* curl_lib) {
- return curl_lib &&
- dlsym(curl_lib, "curl_easy_init") &&
- dlsym(curl_lib, "curl_easy_setopt");
-}
-
-// static
-bool HTTPUpload::CheckParameters(const map<string, string> &parameters) {
- for (map<string, string>::const_iterator pos = parameters.begin();
- pos != parameters.end(); ++pos) {
- const string &str = pos->first;
- if (str.size() == 0)
- return false; // disallow empty parameter names
- for (unsigned int i = 0; i < str.size(); ++i) {
- int c = str[i];
- if (c < 32 || c == '"' || c > 127) {
- return false;
- }
- }
- }
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.h b/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.h
deleted file mode 100644
index bc1d5d5700..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// HTTPUpload provides a "nice" API to send a multipart HTTP(S) POST
-// request using libcurl. It currently supports requests that contain
-// a set of string parameters (key/value pairs), and a file to upload.
-
-#ifndef COMMON_LINUX_HTTP_UPLOAD_H__
-#define COMMON_LINUX_HTTP_UPLOAD_H__
-
-#include <map>
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using std::map;
-
-class HTTPUpload {
- public:
- // Sends the given sets of parameters and files as a multipart POST
- // request to the given URL.
- // Each key in |files| is the name of the file part of the request
- // (i.e. it corresponds to the name= attribute on an <input type="file">.
- // Parameter names must contain only printable ASCII characters,
- // and may not contain a quote (") character.
- // Only HTTP(S) URLs are currently supported. Returns true on success.
- // If the request is successful and response_body is non-NULL,
- // the response body will be returned in response_body.
- // If response_code is non-NULL, it will be set to the HTTP response code
- // received (or 0 if the request failed before getting an HTTP response).
- // If the send fails, a description of the error will be
- // returned in error_description.
- static bool SendRequest(const string &url,
- const map<string, string> &parameters,
- const map<string, string> &files,
- const string &proxy,
- const string &proxy_user_pwd,
- const string &ca_certificate_file,
- string *response_body,
- long *response_code,
- string *error_description);
-
- private:
- // Checks that the given list of parameters has only printable
- // ASCII characters in the parameter name, and does not contain
- // any quote (") characters. Returns true if so.
- static bool CheckParameters(const map<string, string> &parameters);
-
- // Checks the curl_lib parameter points to a valid curl lib.
- static bool CheckCurlLib(void* curl_lib);
-
- // No instances of this class should be created.
- // Disallow all constructors, destructors, and operator=.
- HTTPUpload();
- explicit HTTPUpload(const HTTPUpload &);
- void operator=(const HTTPUpload &);
- ~HTTPUpload();
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_HTTP_UPLOAD_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/ignore_ret.h b/toolkit/crashreporter/google-breakpad/src/common/linux/ignore_ret.h
deleted file mode 100644
index efd274c20c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/ignore_ret.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2012 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_LINUX_IGNORE_RET_H_
-#define COMMON_LINUX_IGNORE_RET_H_
-
-// Some compilers are prone to warn about unused return values. In cases where
-// either a) the call cannot fail, or b) there is nothing that can be done when
-// the call fails, IGNORE_RET() can be used to mark the return code as ignored.
-// This avoids spurious compiler warnings.
-
-#define IGNORE_RET(x) do { if (x) {} } while (0)
-
-#endif // COMMON_LINUX_IGNORE_RET_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc
deleted file mode 100644
index fd4e34cd8f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc
+++ /dev/null
@@ -1,241 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <dlfcn.h>
-
-#include <iostream>
-#include <string>
-
-#include "common/linux/libcurl_wrapper.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-LibcurlWrapper::LibcurlWrapper()
- : init_ok_(false),
- formpost_(NULL),
- lastptr_(NULL),
- headerlist_(NULL) {
- curl_lib_ = dlopen("libcurl.so", RTLD_NOW);
- if (!curl_lib_) {
- curl_lib_ = dlopen("libcurl.so.4", RTLD_NOW);
- }
- if (!curl_lib_) {
- curl_lib_ = dlopen("libcurl.so.3", RTLD_NOW);
- }
- if (!curl_lib_) {
- std::cout << "Could not find libcurl via dlopen";
- return;
- }
- std::cout << "LibcurlWrapper init succeeded";
- init_ok_ = true;
- return;
-}
-
-LibcurlWrapper::~LibcurlWrapper() {}
-
-bool LibcurlWrapper::SetProxy(const string& proxy_host,
- const string& proxy_userpwd) {
- if (!init_ok_) {
- return false;
- }
- // Set proxy information if necessary.
- if (!proxy_host.empty()) {
- (*easy_setopt_)(curl_, CURLOPT_PROXY, proxy_host.c_str());
- } else {
- std::cout << "SetProxy called with empty proxy host.";
- return false;
- }
- if (!proxy_userpwd.empty()) {
- (*easy_setopt_)(curl_, CURLOPT_PROXYUSERPWD, proxy_userpwd.c_str());
- } else {
- std::cout << "SetProxy called with empty proxy username/password.";
- return false;
- }
- std::cout << "Set proxy host to " << proxy_host;
- return true;
-}
-
-bool LibcurlWrapper::AddFile(const string& upload_file_path,
- const string& basename) {
- if (!init_ok_) {
- return false;
- }
- std::cout << "Adding " << upload_file_path << " to form upload.";
- // Add form file.
- (*formadd_)(&formpost_, &lastptr_,
- CURLFORM_COPYNAME, basename.c_str(),
- CURLFORM_FILE, upload_file_path.c_str(),
- CURLFORM_END);
-
- return true;
-}
-
-// Callback to get the response data from server.
-static size_t WriteCallback(void *ptr, size_t size,
- size_t nmemb, void *userp) {
- if (!userp)
- return 0;
-
- string *response = reinterpret_cast<string *>(userp);
- size_t real_size = size * nmemb;
- response->append(reinterpret_cast<char *>(ptr), real_size);
- return real_size;
-}
-
-bool LibcurlWrapper::SendRequest(const string& url,
- const std::map<string, string>& parameters,
- int* http_status_code,
- string* http_header_data,
- string* http_response_data) {
- (*easy_setopt_)(curl_, CURLOPT_URL, url.c_str());
- std::map<string, string>::const_iterator iter = parameters.begin();
- for (; iter != parameters.end(); ++iter)
- (*formadd_)(&formpost_, &lastptr_,
- CURLFORM_COPYNAME, iter->first.c_str(),
- CURLFORM_COPYCONTENTS, iter->second.c_str(),
- CURLFORM_END);
-
- (*easy_setopt_)(curl_, CURLOPT_HTTPPOST, formpost_);
- if (http_response_data != NULL) {
- http_response_data->clear();
- (*easy_setopt_)(curl_, CURLOPT_WRITEFUNCTION, WriteCallback);
- (*easy_setopt_)(curl_, CURLOPT_WRITEDATA,
- reinterpret_cast<void *>(http_response_data));
- }
- if (http_header_data != NULL) {
- http_header_data->clear();
- (*easy_setopt_)(curl_, CURLOPT_HEADERFUNCTION, WriteCallback);
- (*easy_setopt_)(curl_, CURLOPT_HEADERDATA,
- reinterpret_cast<void *>(http_header_data));
- }
-
- CURLcode err_code = CURLE_OK;
- err_code = (*easy_perform_)(curl_);
- easy_strerror_ = reinterpret_cast<const char* (*)(CURLcode)>
- (dlsym(curl_lib_, "curl_easy_strerror"));
-
- if (http_status_code != NULL) {
- (*easy_getinfo_)(curl_, CURLINFO_RESPONSE_CODE, http_status_code);
- }
-
-#ifndef NDEBUG
- if (err_code != CURLE_OK)
- fprintf(stderr, "Failed to send http request to %s, error: %s\n",
- url.c_str(),
- (*easy_strerror_)(err_code));
-#endif
- if (headerlist_ != NULL) {
- (*slist_free_all_)(headerlist_);
- }
-
- (*easy_cleanup_)(curl_);
- if (formpost_ != NULL) {
- (*formfree_)(formpost_);
- }
-
- return err_code == CURLE_OK;
-}
-
-bool LibcurlWrapper::Init() {
- if (!init_ok_) {
- std::cout << "Init_OK was not true in LibcurlWrapper::Init(), check earlier log messages";
- return false;
- }
-
- if (!SetFunctionPointers()) {
- std::cout << "Could not find function pointers";
- init_ok_ = false;
- return false;
- }
-
- curl_ = (*easy_init_)();
-
- last_curl_error_ = "No Error";
-
- if (!curl_) {
- dlclose(curl_lib_);
- std::cout << "Curl initialization failed";
- return false;
- }
-
- // Disable 100-continue header.
- char buf[] = "Expect:";
-
- headerlist_ = (*slist_append_)(headerlist_, buf);
- (*easy_setopt_)(curl_, CURLOPT_HTTPHEADER, headerlist_);
- return true;
-}
-
-#define SET_AND_CHECK_FUNCTION_POINTER(var, function_name, type) \
- var = reinterpret_cast<type>(dlsym(curl_lib_, function_name)); \
- if (!var) { \
- std::cout << "Could not find libcurl function " << function_name; \
- init_ok_ = false; \
- return false; \
- }
-
-bool LibcurlWrapper::SetFunctionPointers() {
-
- SET_AND_CHECK_FUNCTION_POINTER(easy_init_,
- "curl_easy_init",
- CURL*(*)());
-
- SET_AND_CHECK_FUNCTION_POINTER(easy_setopt_,
- "curl_easy_setopt",
- CURLcode(*)(CURL*, CURLoption, ...));
-
- SET_AND_CHECK_FUNCTION_POINTER(formadd_, "curl_formadd",
- CURLFORMcode(*)(curl_httppost**, curl_httppost**, ...));
-
- SET_AND_CHECK_FUNCTION_POINTER(slist_append_, "curl_slist_append",
- curl_slist*(*)(curl_slist*, const char*));
-
- SET_AND_CHECK_FUNCTION_POINTER(easy_perform_,
- "curl_easy_perform",
- CURLcode(*)(CURL*));
-
- SET_AND_CHECK_FUNCTION_POINTER(easy_cleanup_,
- "curl_easy_cleanup",
- void(*)(CURL*));
-
- SET_AND_CHECK_FUNCTION_POINTER(easy_getinfo_,
- "curl_easy_getinfo",
- CURLcode(*)(CURL *, CURLINFO info, ...));
-
- SET_AND_CHECK_FUNCTION_POINTER(slist_free_all_,
- "curl_slist_free_all",
- void(*)(curl_slist*));
-
- SET_AND_CHECK_FUNCTION_POINTER(formfree_,
- "curl_formfree",
- void(*)(curl_httppost*));
- return true;
-}
-
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.h b/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.h
deleted file mode 100644
index 25905ad8ff..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A wrapper for libcurl to do HTTP Uploads, to support easy mocking
-// and unit testing of the HTTPUpload class.
-
-#ifndef COMMON_LINUX_LIBCURL_WRAPPER_H_
-#define COMMON_LINUX_LIBCURL_WRAPPER_H_
-
-#include <string>
-#include <map>
-
-#include "common/using_std_string.h"
-#include "third_party/curl/curl.h"
-
-namespace google_breakpad {
-class LibcurlWrapper {
- public:
- LibcurlWrapper();
- virtual ~LibcurlWrapper();
- virtual bool Init();
- virtual bool SetProxy(const string& proxy_host,
- const string& proxy_userpwd);
- virtual bool AddFile(const string& upload_file_path,
- const string& basename);
- virtual bool SendRequest(const string& url,
- const std::map<string, string>& parameters,
- int* http_status_code,
- string* http_header_data,
- string* http_response_data);
- private:
- // This function initializes class state corresponding to function
- // pointers into the CURL library.
- bool SetFunctionPointers();
-
- bool init_ok_; // Whether init succeeded
- void* curl_lib_; // Pointer to result of dlopen() on
- // curl library
- string last_curl_error_; // The text of the last error when
- // dealing
- // with CURL.
-
- CURL *curl_; // Pointer for handle for CURL calls.
-
- CURL* (*easy_init_)(void);
-
- // Stateful pointers for calling into curl_formadd()
- struct curl_httppost *formpost_;
- struct curl_httppost *lastptr_;
- struct curl_slist *headerlist_;
-
- // Function pointers into CURL library
- CURLcode (*easy_setopt_)(CURL *, CURLoption, ...);
- CURLFORMcode (*formadd_)(struct curl_httppost **,
- struct curl_httppost **, ...);
- struct curl_slist* (*slist_append_)(struct curl_slist *, const char *);
- void (*slist_free_all_)(struct curl_slist *);
- CURLcode (*easy_perform_)(CURL *);
- const char* (*easy_strerror_)(CURLcode);
- void (*easy_cleanup_)(CURL *);
- CURLcode (*easy_getinfo_)(CURL *, CURLINFO info, ...);
- void (*formfree_)(struct curl_httppost *);
-
-};
-}
-
-#endif // COMMON_LINUX_LIBCURL_WRAPPER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.cc
deleted file mode 100644
index 08b0325e6d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.cc
+++ /dev/null
@@ -1,237 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This source file provides replacements for libc functions that we need. If
-// we call the libc functions directly we risk crashing in the dynamic linker
-// as it tries to resolve uncached PLT entries.
-
-#include "common/linux/linux_libc_support.h"
-
-#include <stddef.h>
-
-extern "C" {
-
-size_t my_strlen(const char* s) {
- size_t len = 0;
- while (*s++) len++;
- return len;
-}
-
-int my_strcmp(const char* a, const char* b) {
- for (;;) {
- if (*a < *b)
- return -1;
- else if (*a > *b)
- return 1;
- else if (*a == 0)
- return 0;
- a++;
- b++;
- }
-}
-
-int my_strncmp(const char* a, const char* b, size_t len) {
- for (size_t i = 0; i < len; ++i) {
- if (*a < *b)
- return -1;
- else if (*a > *b)
- return 1;
- else if (*a == 0)
- return 0;
- a++;
- b++;
- }
-
- return 0;
-}
-
-// Parse a non-negative integer.
-// result: (output) the resulting non-negative integer
-// s: a NUL terminated string
-// Return true iff successful.
-bool my_strtoui(int* result, const char* s) {
- if (*s == 0)
- return false;
- int r = 0;
- for (;; s++) {
- if (*s == 0)
- break;
- const int old_r = r;
- r *= 10;
- if (*s < '0' || *s > '9')
- return false;
- r += *s - '0';
- if (r < old_r)
- return false;
- }
-
- *result = r;
- return true;
-}
-
-// Return the length of the given unsigned integer when expressed in base 10.
-unsigned my_uint_len(uintmax_t i) {
- if (!i)
- return 1;
-
- int len = 0;
- while (i) {
- len++;
- i /= 10;
- }
-
- return len;
-}
-
-// Convert an unsigned integer to a string
-// output: (output) the resulting string is written here. This buffer must be
-// large enough to hold the resulting string. Call |my_uint_len| to get the
-// required length.
-// i: the unsigned integer to serialise.
-// i_len: the length of the integer in base 10 (see |my_uint_len|).
-void my_uitos(char* output, uintmax_t i, unsigned i_len) {
- for (unsigned index = i_len; index; --index, i /= 10)
- output[index - 1] = '0' + (i % 10);
-}
-
-const char* my_strchr(const char* haystack, char needle) {
- while (*haystack && *haystack != needle)
- haystack++;
- if (*haystack == needle)
- return haystack;
- return (const char*) 0;
-}
-
-const char* my_strrchr(const char* haystack, char needle) {
- const char* ret = NULL;
- while (*haystack) {
- if (*haystack == needle)
- ret = haystack;
- haystack++;
- }
- return ret;
-}
-
-void* my_memchr(const void* src, int needle, size_t src_len) {
- const unsigned char* p = (const unsigned char*)src;
- const unsigned char* p_end = p + src_len;
- for (; p < p_end; ++p) {
- if (*p == needle)
- return (void*)p;
- }
- return NULL;
-}
-
-// Read a hex value
-// result: (output) the resulting value
-// s: a string
-// Returns a pointer to the first invalid charactor.
-const char* my_read_hex_ptr(uintptr_t* result, const char* s) {
- uintptr_t r = 0;
-
- for (;; ++s) {
- if (*s >= '0' && *s <= '9') {
- r <<= 4;
- r += *s - '0';
- } else if (*s >= 'a' && *s <= 'f') {
- r <<= 4;
- r += (*s - 'a') + 10;
- } else if (*s >= 'A' && *s <= 'F') {
- r <<= 4;
- r += (*s - 'A') + 10;
- } else {
- break;
- }
- }
-
- *result = r;
- return s;
-}
-
-const char* my_read_decimal_ptr(uintptr_t* result, const char* s) {
- uintptr_t r = 0;
-
- for (;; ++s) {
- if (*s >= '0' && *s <= '9') {
- r *= 10;
- r += *s - '0';
- } else {
- break;
- }
- }
- *result = r;
- return s;
-}
-
-void my_memset(void* ip, char c, size_t len) {
- char* p = (char *) ip;
- while (len--)
- *p++ = c;
-}
-
-size_t my_strlcpy(char* s1, const char* s2, size_t len) {
- size_t pos1 = 0;
- size_t pos2 = 0;
-
- while (s2[pos2] != '\0') {
- if (pos1 + 1 < len) {
- s1[pos1] = s2[pos2];
- pos1++;
- }
- pos2++;
- }
- if (len > 0)
- s1[pos1] = '\0';
-
- return pos2;
-}
-
-size_t my_strlcat(char* s1, const char* s2, size_t len) {
- size_t pos1 = 0;
-
- while (pos1 < len && s1[pos1] != '\0')
- pos1++;
-
- if (pos1 == len)
- return pos1;
-
- return pos1 + my_strlcpy(s1 + pos1, s2, len - pos1);
-}
-
-int my_isspace(int ch) {
- // Matches the C locale.
- const char spaces[] = " \t\f\n\r\t\v";
- for (size_t i = 0; i < sizeof(spaces); i++) {
- if (ch == spaces[i])
- return 1;
- }
- return 0;
-}
-
-} // extern "C"
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.h b/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.h
deleted file mode 100644
index ec5a8d6b6b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This header provides replacements for libc functions that we need. We if
-// call the libc functions directly we risk crashing in the dynamic linker as
-// it tries to resolve uncached PLT entries.
-
-#ifndef CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_
-#define CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_
-
-#include <stdint.h>
-#include <limits.h>
-#include <sys/types.h>
-
-extern "C" {
-
-extern size_t my_strlen(const char* s);
-
-extern int my_strcmp(const char* a, const char* b);
-
-extern int my_strncmp(const char* a, const char* b, size_t len);
-
-// Parse a non-negative integer.
-// result: (output) the resulting non-negative integer
-// s: a NUL terminated string
-// Return true iff successful.
-extern bool my_strtoui(int* result, const char* s);
-
-// Return the length of the given unsigned integer when expressed in base 10.
-extern unsigned my_uint_len(uintmax_t i);
-
-// Convert an unsigned integer to a string
-// output: (output) the resulting string is written here. This buffer must be
-// large enough to hold the resulting string. Call |my_uint_len| to get the
-// required length.
-// i: the unsigned integer to serialise.
-// i_len: the length of the integer in base 10 (see |my_uint_len|).
-extern void my_uitos(char* output, uintmax_t i, unsigned i_len);
-
-extern const char* my_strchr(const char* haystack, char needle);
-
-extern const char* my_strrchr(const char* haystack, char needle);
-
-// Read a hex value
-// result: (output) the resulting value
-// s: a string
-// Returns a pointer to the first invalid charactor.
-extern const char* my_read_hex_ptr(uintptr_t* result, const char* s);
-
-extern const char* my_read_decimal_ptr(uintptr_t* result, const char* s);
-
-extern void my_memset(void* ip, char c, size_t len);
-
-extern void* my_memchr(const void* src, int c, size_t len);
-
-// The following are considered safe to use in a compromised environment.
-// Besides, this gives the compiler an opportunity to optimize their calls.
-#define my_memcpy memcpy
-#define my_memmove memmove
-#define my_memcmp memcmp
-
-extern size_t my_strlcpy(char* s1, const char* s2, size_t len);
-
-extern size_t my_strlcat(char* s1, const char* s2, size_t len);
-
-extern int my_isspace(int ch);
-
-} // extern "C"
-
-#endif // CLIENT_LINUX_LINUX_LIBC_SUPPORT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support_unittest.cc
deleted file mode 100644
index adadfed44d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/linux_libc_support_unittest.cc
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/linux_libc_support.h"
-
-namespace {
-typedef testing::Test LinuxLibcSupportTest;
-}
-
-TEST(LinuxLibcSupportTest, strlen) {
- static const char* test_data[] = { "", "a", "aa", "aaa", "aabc", NULL };
- for (unsigned i = 0; ; ++i) {
- if (!test_data[i])
- break;
- ASSERT_EQ(strlen(test_data[i]), my_strlen(test_data[i]));
- }
-}
-
-TEST(LinuxLibcSupportTest, strcmp) {
- static const char* test_data[] = {
- "", "",
- "a", "",
- "", "a",
- "a", "b",
- "a", "a",
- "ab", "aa",
- "abc", "ab",
- "abc", "abc",
- NULL,
- };
-
- for (unsigned i = 0; ; ++i) {
- if (!test_data[i*2])
- break;
- int libc_result = strcmp(test_data[i*2], test_data[i*2 + 1]);
- if (libc_result > 1)
- libc_result = 1;
- else if (libc_result < -1)
- libc_result = -1;
- ASSERT_EQ(my_strcmp(test_data[i*2], test_data[i*2 + 1]), libc_result);
- }
-}
-
-TEST(LinuxLibcSupportTest, strtoui) {
- int result;
-
- ASSERT_FALSE(my_strtoui(&result, ""));
- ASSERT_FALSE(my_strtoui(&result, "-1"));
- ASSERT_FALSE(my_strtoui(&result, "-"));
- ASSERT_FALSE(my_strtoui(&result, "a"));
- ASSERT_FALSE(my_strtoui(&result, "23472893472938472987987398472398"));
-
- ASSERT_TRUE(my_strtoui(&result, "0"));
- ASSERT_EQ(result, 0);
- ASSERT_TRUE(my_strtoui(&result, "1"));
- ASSERT_EQ(result, 1);
- ASSERT_TRUE(my_strtoui(&result, "12"));
- ASSERT_EQ(result, 12);
- ASSERT_TRUE(my_strtoui(&result, "123"));
- ASSERT_EQ(result, 123);
- ASSERT_TRUE(my_strtoui(&result, "0123"));
- ASSERT_EQ(result, 123);
-}
-
-TEST(LinuxLibcSupportTest, uint_len) {
- ASSERT_EQ(my_uint_len(0), 1U);
- ASSERT_EQ(my_uint_len(2), 1U);
- ASSERT_EQ(my_uint_len(5), 1U);
- ASSERT_EQ(my_uint_len(9), 1U);
- ASSERT_EQ(my_uint_len(10), 2U);
- ASSERT_EQ(my_uint_len(99), 2U);
- ASSERT_EQ(my_uint_len(100), 3U);
- ASSERT_EQ(my_uint_len(101), 3U);
- ASSERT_EQ(my_uint_len(1000), 4U);
- // 0xFFFFFFFFFFFFFFFF
- ASSERT_EQ(my_uint_len(18446744073709551615LLU), 20U);
-}
-
-TEST(LinuxLibcSupportTest, uitos) {
- char buf[32];
-
- my_uitos(buf, 0, 1);
- ASSERT_EQ(0, memcmp(buf, "0", 1));
-
- my_uitos(buf, 1, 1);
- ASSERT_EQ(0, memcmp(buf, "1", 1));
-
- my_uitos(buf, 10, 2);
- ASSERT_EQ(0, memcmp(buf, "10", 2));
-
- my_uitos(buf, 63, 2);
- ASSERT_EQ(0, memcmp(buf, "63", 2));
-
- my_uitos(buf, 101, 3);
- ASSERT_EQ(0, memcmp(buf, "101", 2));
-
- // 0xFFFFFFFFFFFFFFFF
- my_uitos(buf, 18446744073709551615LLU, 20);
- ASSERT_EQ(0, memcmp(buf, "18446744073709551615", 20));
-}
-
-TEST(LinuxLibcSupportTest, strchr) {
- ASSERT_EQ(NULL, my_strchr("abc", 'd'));
- ASSERT_EQ(NULL, my_strchr("", 'd'));
- ASSERT_EQ(NULL, my_strchr("efghi", 'd'));
-
- ASSERT_TRUE(my_strchr("a", 'a'));
- ASSERT_TRUE(my_strchr("abc", 'a'));
- ASSERT_TRUE(my_strchr("bcda", 'a'));
- ASSERT_TRUE(my_strchr("sdfasdf", 'a'));
-
- static const char abc3[] = "abcabcabc";
- ASSERT_EQ(abc3, my_strchr(abc3, 'a'));
-}
-
-TEST(LinuxLibcSupportTest, strrchr) {
- ASSERT_EQ(NULL, my_strrchr("abc", 'd'));
- ASSERT_EQ(NULL, my_strrchr("", 'd'));
- ASSERT_EQ(NULL, my_strrchr("efghi", 'd'));
-
- ASSERT_TRUE(my_strrchr("a", 'a'));
- ASSERT_TRUE(my_strrchr("abc", 'a'));
- ASSERT_TRUE(my_strrchr("bcda", 'a'));
- ASSERT_TRUE(my_strrchr("sdfasdf", 'a'));
-
- static const char abc3[] = "abcabcabc";
- ASSERT_EQ(abc3 + 6, my_strrchr(abc3, 'a'));
-}
-
-TEST(LinuxLibcSupportTest, memchr) {
- ASSERT_EQ(NULL, my_memchr("abc", 'd', 3));
- ASSERT_EQ(NULL, my_memchr("abcd", 'd', 3));
- ASSERT_EQ(NULL, my_memchr("a", 'a', 0));
-
- static const char abc3[] = "abcabcabc";
- ASSERT_EQ(abc3, my_memchr(abc3, 'a', 3));
- ASSERT_EQ(abc3, my_memchr(abc3, 'a', 9));
- ASSERT_EQ(abc3+1, my_memchr(abc3, 'b', 9));
- ASSERT_EQ(abc3+2, my_memchr(abc3, 'c', 9));
-}
-
-TEST(LinuxLibcSupportTest, read_hex_ptr) {
- uintptr_t result;
- const char* last;
-
- last = my_read_hex_ptr(&result, "");
- ASSERT_EQ(result, 0U);
- ASSERT_EQ(*last, 0);
-
- last = my_read_hex_ptr(&result, "0");
- ASSERT_EQ(result, 0U);
- ASSERT_EQ(*last, 0);
-
- last = my_read_hex_ptr(&result, "0123");
- ASSERT_EQ(result, 0x123U);
- ASSERT_EQ(*last, 0);
-
- last = my_read_hex_ptr(&result, "0123a");
- ASSERT_EQ(result, 0x123aU);
- ASSERT_EQ(*last, 0);
-
- last = my_read_hex_ptr(&result, "0123a-");
- ASSERT_EQ(result, 0x123aU);
- ASSERT_EQ(*last, '-');
-}
-
-TEST(LinuxLibcSupportTest, read_decimal_ptr) {
- uintptr_t result;
- const char* last;
-
- last = my_read_decimal_ptr(&result, "0");
- ASSERT_EQ(result, 0U);
- ASSERT_EQ(*last, 0);
-
- last = my_read_decimal_ptr(&result, "0123");
- ASSERT_EQ(result, 123U);
- ASSERT_EQ(*last, 0);
-
- last = my_read_decimal_ptr(&result, "1234");
- ASSERT_EQ(result, 1234U);
- ASSERT_EQ(*last, 0);
-
- last = my_read_decimal_ptr(&result, "01234-");
- ASSERT_EQ(result, 1234U);
- ASSERT_EQ(*last, '-');
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.cc
deleted file mode 100644
index 4e938269f2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// memory_mapped_file.cc: Implement google_breakpad::MemoryMappedFile.
-// See memory_mapped_file.h for details.
-
-#include "common/linux/memory_mapped_file.h"
-
-#include <fcntl.h>
-#include <sys/mman.h>
-#if defined(__ANDROID__)
-#include <sys/stat.h>
-#endif
-#include <unistd.h>
-
-#include "common/memory_range.h"
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-MemoryMappedFile::MemoryMappedFile() {}
-
-MemoryMappedFile::MemoryMappedFile(const char* path, size_t offset) {
- Map(path, offset);
-}
-
-MemoryMappedFile::~MemoryMappedFile() {
- Unmap();
-}
-
-#include <unistd.h>
-
-bool MemoryMappedFile::Map(const char* path, size_t offset) {
- Unmap();
-
- int fd = sys_open(path, O_RDONLY, 0);
- if (fd == -1) {
- return false;
- }
-
-#if defined(__x86_64__) || defined(__aarch64__) || \
- (defined(__mips__) && _MIPS_SIM == _ABI64)
-
- struct kernel_stat st;
- if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
-#else
- struct kernel_stat64 st;
- if (sys_fstat64(fd, &st) == -1 || st.st_size < 0) {
-#endif
- sys_close(fd);
- return false;
- }
-
- // Strangely file size can be negative, but we check above that it is not.
- size_t file_len = static_cast<size_t>(st.st_size);
- // If the file does not extend beyond the offset, simply use an empty
- // MemoryRange and return true. Don't bother to call mmap()
- // even though mmap() can handle an empty file on some platforms.
- if (offset >= file_len) {
- sys_close(fd);
- return true;
- }
-
- void* data = sys_mmap(NULL, file_len, PROT_READ, MAP_PRIVATE, fd, offset);
- sys_close(fd);
- if (data == MAP_FAILED) {
- return false;
- }
-
- content_.Set(data, file_len - offset);
- return true;
-}
-
-void MemoryMappedFile::Unmap() {
- if (content_.data()) {
- sys_munmap(const_cast<uint8_t*>(content_.data()), content_.length());
- content_.Set(NULL, 0);
- }
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.h b/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.h
deleted file mode 100644
index fa660cc91a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// memory_mapped_file.h: Define the google_breakpad::MemoryMappedFile
-// class, which maps a file into memory for read-only access.
-
-#ifndef COMMON_LINUX_MEMORY_MAPPED_FILE_H_
-#define COMMON_LINUX_MEMORY_MAPPED_FILE_H_
-
-#include <stddef.h>
-#include "common/basictypes.h"
-#include "common/memory_range.h"
-
-namespace google_breakpad {
-
-// A utility class for mapping a file into memory for read-only access of
-// the file content. Its implementation avoids calling into libc functions
-// by directly making system calls for open, close, mmap, and munmap.
-class MemoryMappedFile {
- public:
- MemoryMappedFile();
-
- // Constructor that calls Map() to map a file at |path| into memory.
- // If Map() fails, the object behaves as if it is default constructed.
- MemoryMappedFile(const char* path, size_t offset);
-
- ~MemoryMappedFile();
-
- // Maps a file at |path| into memory, which can then be accessed via
- // content() as a MemoryRange object or via data(), and returns true on
- // success. Mapping an empty file will succeed but with data() and size()
- // returning NULL and 0, respectively. An existing mapping is unmapped
- // before a new mapping is created.
- bool Map(const char* path, size_t offset);
-
- // Unmaps the memory for the mapped file. It's a no-op if no file is
- // mapped.
- void Unmap();
-
- // Returns a MemoryRange object that covers the memory for the mapped
- // file. The MemoryRange object is empty if no file is mapped.
- const MemoryRange& content() const { return content_; }
-
- // Returns a pointer to the beginning of the memory for the mapped file.
- // or NULL if no file is mapped or the mapped file is empty.
- const void* data() const { return content_.data(); }
-
- // Returns the size in bytes of the mapped file, or zero if no file
- // is mapped.
- size_t size() const { return content_.length(); }
-
- private:
- // Mapped file content as a MemoryRange object.
- MemoryRange content_;
-
- DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile);
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_MEMORY_MAPPED_FILE_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file_unittest.cc
deleted file mode 100644
index fad59f40cd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/memory_mapped_file_unittest.cc
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// memory_mapped_file_unittest.cc:
-// Unit tests for google_breakpad::MemoryMappedFile.
-
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/memory_mapped_file.h"
-#include "common/tests/auto_tempdir.h"
-#include "common/tests/file_utils.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::AutoTempDir;
-using google_breakpad::MemoryMappedFile;
-using google_breakpad::WriteFile;
-
-namespace {
-
-class MemoryMappedFileTest : public testing::Test {
- protected:
- void ExpectNoMappedData(const MemoryMappedFile& mapped_file) {
- EXPECT_TRUE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() == NULL);
- EXPECT_EQ(0U, mapped_file.size());
- }
-};
-
-} // namespace
-
-TEST_F(MemoryMappedFileTest, DefaultConstructor) {
- MemoryMappedFile mapped_file;
- ExpectNoMappedData(mapped_file);
-}
-
-TEST_F(MemoryMappedFileTest, UnmapWithoutMap) {
- MemoryMappedFile mapped_file;
- mapped_file.Unmap();
-}
-
-TEST_F(MemoryMappedFileTest, MapNonexistentFile) {
- {
- MemoryMappedFile mapped_file("nonexistent-file", 0);
- ExpectNoMappedData(mapped_file);
- }
- {
- MemoryMappedFile mapped_file;
- EXPECT_FALSE(mapped_file.Map("nonexistent-file", 0));
- ExpectNoMappedData(mapped_file);
- }
-}
-
-TEST_F(MemoryMappedFileTest, MapEmptyFile) {
- AutoTempDir temp_dir;
- string test_file = temp_dir.path() + "/empty_file";
- ASSERT_TRUE(WriteFile(test_file.c_str(), NULL, 0));
-
- {
- MemoryMappedFile mapped_file(test_file.c_str(), 0);
- ExpectNoMappedData(mapped_file);
- }
- {
- MemoryMappedFile mapped_file;
- EXPECT_TRUE(mapped_file.Map(test_file.c_str(), 0));
- ExpectNoMappedData(mapped_file);
- }
-}
-
-TEST_F(MemoryMappedFileTest, MapNonEmptyFile) {
- char data[256];
- size_t data_size = sizeof(data);
- for (size_t i = 0; i < data_size; ++i) {
- data[i] = i;
- }
-
- AutoTempDir temp_dir;
- string test_file = temp_dir.path() + "/test_file";
- ASSERT_TRUE(WriteFile(test_file.c_str(), data, data_size));
-
- {
- MemoryMappedFile mapped_file(test_file.c_str(), 0);
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data_size, mapped_file.size());
- EXPECT_EQ(0, memcmp(data, mapped_file.data(), data_size));
- }
- {
- MemoryMappedFile mapped_file;
- EXPECT_TRUE(mapped_file.Map(test_file.c_str(), 0));
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data_size, mapped_file.size());
- EXPECT_EQ(0, memcmp(data, mapped_file.data(), data_size));
- }
-}
-
-TEST_F(MemoryMappedFileTest, RemapAfterMap) {
- char data1[256];
- size_t data1_size = sizeof(data1);
- for (size_t i = 0; i < data1_size; ++i) {
- data1[i] = i;
- }
-
- char data2[50];
- size_t data2_size = sizeof(data2);
- for (size_t i = 0; i < data2_size; ++i) {
- data2[i] = 255 - i;
- }
-
- AutoTempDir temp_dir;
- string test_file1 = temp_dir.path() + "/test_file1";
- string test_file2 = temp_dir.path() + "/test_file2";
- ASSERT_TRUE(WriteFile(test_file1.c_str(), data1, data1_size));
- ASSERT_TRUE(WriteFile(test_file2.c_str(), data2, data2_size));
-
- {
- MemoryMappedFile mapped_file(test_file1.c_str(), 0);
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data1_size, mapped_file.size());
- EXPECT_EQ(0, memcmp(data1, mapped_file.data(), data1_size));
-
- mapped_file.Map(test_file2.c_str(), 0);
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data2_size, mapped_file.size());
- EXPECT_EQ(0, memcmp(data2, mapped_file.data(), data2_size));
- }
- {
- MemoryMappedFile mapped_file;
- EXPECT_TRUE(mapped_file.Map(test_file1.c_str(), 0));
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data1_size, mapped_file.size());
- EXPECT_EQ(0, memcmp(data1, mapped_file.data(), data1_size));
-
- mapped_file.Map(test_file2.c_str(), 0);
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data2_size, mapped_file.size());
- EXPECT_EQ(0, memcmp(data2, mapped_file.data(), data2_size));
- }
-}
-
-TEST_F(MemoryMappedFileTest, MapWithOffset) {
- // Put more data in the test file this time. Offsets can only be
- // done on page boundaries, so we need a two page file to test this.
- const int page_size = 4096;
- char data1[2 * page_size];
- size_t data1_size = sizeof(data1);
- for (size_t i = 0; i < data1_size; ++i) {
- data1[i] = i & 0x7f;
- }
-
- AutoTempDir temp_dir;
- string test_file1 = temp_dir.path() + "/test_file1";
- ASSERT_TRUE(WriteFile(test_file1.c_str(), data1, data1_size));
- {
- MemoryMappedFile mapped_file(test_file1.c_str(), page_size);
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data1_size - page_size, mapped_file.size());
- EXPECT_EQ(
- 0,
- memcmp(data1 + page_size, mapped_file.data(), data1_size - page_size));
- }
- {
- MemoryMappedFile mapped_file;
- mapped_file.Map(test_file1.c_str(), page_size);
- EXPECT_FALSE(mapped_file.content().IsEmpty());
- EXPECT_TRUE(mapped_file.data() != NULL);
- EXPECT_EQ(data1_size - page_size, mapped_file.size());
- EXPECT_EQ(
- 0,
- memcmp(data1 + page_size, mapped_file.data(), data1_size - page_size));
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
deleted file mode 100644
index 7450f6ba3f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'elfutils.cc',
- 'guid_creator.cc',
- 'linux_libc_support.cc',
- 'memory_mapped_file.cc',
- 'safe_readlink.cc',
-]
-
-# file_id.cc cannot be built in unified mode because it uses a custom DISABLE_STL_WRAPPING
-SOURCES += [
- 'file_id.cc',
-]
-
-if CONFIG['OS_TARGET'] != 'Android':
- UNIFIED_SOURCES += [
- 'http_upload.cc',
- ]
-
-HostLibrary('host_breakpad_linux_common_s')
-HOST_SOURCES += [
- 'crc32.cc',
- 'dump_symbols.cc',
- 'elf_symbols_to_module.cc',
- 'elfutils.cc',
- 'file_id.cc',
- 'guid_creator.cc',
- 'linux_libc_support.cc',
- 'memory_mapped_file.cc',
-]
-
-HOST_CXXFLAGS += [
- '-O2',
- '-g',
-]
-
-if CONFIG['OS_TARGET'] == 'Android':
- LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src/common/android/include',
- ]
-
-Library('breakpad_linux_common_s')
-
-FINAL_LIBRARY = 'xul'
-
-HOST_DEFINES['NO_STABS_SUPPORT'] = True
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
-
-if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-shadow']
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.cc
deleted file mode 100644
index 870c28af3b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// safe_readlink.cc: Implement google_breakpad::SafeReadLink.
-// See safe_readlink.h for details.
-
-#include <stddef.h>
-
-#include "third_party/lss/linux_syscall_support.h"
-
-namespace google_breakpad {
-
-bool SafeReadLink(const char* path, char* buffer, size_t buffer_size) {
- // sys_readlink() does not add a NULL byte to |buffer|. In order to return
- // a NULL-terminated string in |buffer|, |buffer_size| should be at least
- // one byte longer than the expected path length. Also, sys_readlink()
- // returns the actual path length on success, which does not count the
- // NULL byte, so |result_size| should be less than |buffer_size|.
- ssize_t result_size = sys_readlink(path, buffer, buffer_size);
- if (result_size >= 0 && static_cast<size_t>(result_size) < buffer_size) {
- buffer[result_size] = '\0';
- return true;
- }
- return false;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.h b/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.h
deleted file mode 100644
index 4ae131b580..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// safe_readlink.h: Define the google_breakpad::SafeReadLink function,
-// which wraps sys_readlink and gurantees the result is NULL-terminated.
-
-#ifndef COMMON_LINUX_SAFE_READLINK_H_
-#define COMMON_LINUX_SAFE_READLINK_H_
-
-#include <stddef.h>
-
-namespace google_breakpad {
-
-// This function wraps sys_readlink() and performs the same functionalty,
-// but guarantees |buffer| is NULL-terminated if sys_readlink() returns
-// no error. It takes the same arguments as sys_readlink(), but unlike
-// sys_readlink(), it returns true on success.
-//
-// |buffer_size| specifies the size of |buffer| in bytes. As this function
-// always NULL-terminates |buffer| on success, |buffer_size| should be
-// at least one byte longer than the expected path length (e.g. PATH_MAX,
-// which is typically defined as the maximum length of a path name
-// including the NULL byte).
-//
-// The implementation of this function calls sys_readlink() instead of
-// readlink(), it can thus be used in the context where calling to libc
-// functions is discouraged.
-bool SafeReadLink(const char* path, char* buffer, size_t buffer_size);
-
-// Same as the three-argument version of SafeReadLink() but deduces the
-// size of |buffer| if it is a char array of known size.
-template <size_t N>
-bool SafeReadLink(const char* path, char (&buffer)[N]) {
- return SafeReadLink(path, buffer, sizeof(buffer));
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_SAFE_READLINK_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink_unittest.cc
deleted file mode 100644
index d346b2a807..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/safe_readlink_unittest.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// safe_readlink_unittest.cc: Unit tests for google_breakpad::SafeReadLink.
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/safe_readlink.h"
-
-using google_breakpad::SafeReadLink;
-
-TEST(SafeReadLinkTest, ZeroBufferSize) {
- char buffer[1];
- EXPECT_FALSE(SafeReadLink("/proc/self/exe", buffer, 0));
-}
-
-TEST(SafeReadLinkTest, BufferSizeTooSmall) {
- char buffer[1];
- EXPECT_FALSE(SafeReadLink("/proc/self/exe", buffer, 1));
-}
-
-TEST(SafeReadLinkTest, BoundaryBufferSize) {
- char buffer[PATH_MAX];
- EXPECT_TRUE(SafeReadLink("/proc/self/exe", buffer, sizeof(buffer)));
- size_t path_length = strlen(buffer);
- EXPECT_LT(0U, path_length);
- EXPECT_GT(sizeof(buffer), path_length);
-
- // Buffer size equals to the expected path length plus 1 for the NULL byte.
- char buffer2[PATH_MAX];
- EXPECT_TRUE(SafeReadLink("/proc/self/exe", buffer2, path_length + 1));
- EXPECT_EQ(path_length, strlen(buffer2));
- EXPECT_EQ(0, strncmp(buffer, buffer2, PATH_MAX));
-
- // Buffer size equals to the expected path length.
- EXPECT_FALSE(SafeReadLink("/proc/self/exe", buffer, path_length));
-}
-
-TEST(SafeReadLinkTest, NonexistentPath) {
- char buffer[PATH_MAX];
- EXPECT_FALSE(SafeReadLink("nonexistent_path", buffer, sizeof(buffer)));
-}
-
-TEST(SafeReadLinkTest, NonSymbolicLinkPath) {
- char actual_path[PATH_MAX];
- EXPECT_TRUE(SafeReadLink("/proc/self/exe", actual_path, sizeof(actual_path)));
-
- char buffer[PATH_MAX];
- EXPECT_FALSE(SafeReadLink(actual_path, buffer, sizeof(buffer)));
-}
-
-TEST(SafeReadLinkTest, DeduceBufferSizeFromCharArray) {
- char buffer[PATH_MAX];
- char* buffer_pointer = buffer;
- EXPECT_TRUE(SafeReadLink("/proc/self/exe", buffer_pointer, sizeof(buffer)));
- size_t path_length = strlen(buffer);
-
- // Use the template version of SafeReadLink to deduce the buffer size
- // from the char array.
- char buffer2[PATH_MAX];
- EXPECT_TRUE(SafeReadLink("/proc/self/exe", buffer2));
- EXPECT_EQ(path_length, strlen(buffer2));
- EXPECT_EQ(0, strncmp(buffer, buffer2, PATH_MAX));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.cc
deleted file mode 100644
index bbd3181e16..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// symbol_upload.cc: implemented google_breakpad::sym_upload::Start, a helper
-// function for linux symbol upload tool.
-
-#include "common/linux/http_upload.h"
-#include "common/linux/symbol_upload.h"
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <functional>
-#include <vector>
-
-namespace google_breakpad {
-namespace sym_upload {
-
-void TokenizeByChar(const string &source_string, int c,
- std::vector<string> *results) {
- assert(results);
- string::size_type cur_pos = 0, next_pos = 0;
- while ((next_pos = source_string.find(c, cur_pos)) != string::npos) {
- if (next_pos != cur_pos)
- results->push_back(source_string.substr(cur_pos, next_pos - cur_pos));
- cur_pos = next_pos + 1;
- }
- if (cur_pos < source_string.size() && next_pos != cur_pos)
- results->push_back(source_string.substr(cur_pos));
-}
-
-//=============================================================================
-// Parse out the module line which have 5 parts.
-// MODULE <os> <cpu> <uuid> <module-name>
-bool ModuleDataForSymbolFile(const string &file,
- std::vector<string> *module_parts) {
- assert(module_parts);
- const size_t kModulePartNumber = 5;
- FILE* fp = fopen(file.c_str(), "r");
- if (fp) {
- char buffer[1024];
- if (fgets(buffer, sizeof(buffer), fp)) {
- string line(buffer);
- string::size_type line_break_pos = line.find_first_of('\n');
- if (line_break_pos == string::npos) {
- assert(0 && "The file is invalid!");
- fclose(fp);
- return false;
- }
- line.resize(line_break_pos);
- const char kDelimiter = ' ';
- TokenizeByChar(line, kDelimiter, module_parts);
- if (module_parts->size() != kModulePartNumber)
- module_parts->clear();
- }
- fclose(fp);
- }
-
- return module_parts->size() == kModulePartNumber;
-}
-
-//=============================================================================
-string CompactIdentifier(const string &uuid) {
- std::vector<string> components;
- TokenizeByChar(uuid, '-', &components);
- string result;
- for (size_t i = 0; i < components.size(); ++i)
- result += components[i];
- return result;
-}
-
-//=============================================================================
-void Start(Options *options) {
- std::map<string, string> parameters;
- options->success = false;
- std::vector<string> module_parts;
- if (!ModuleDataForSymbolFile(options->symbolsPath, &module_parts)) {
- fprintf(stderr, "Failed to parse symbol file!\n");
- return;
- }
-
- string compacted_id = CompactIdentifier(module_parts[3]);
-
- // Add parameters
- if (!options->version.empty())
- parameters["version"] = options->version;
-
- // MODULE <os> <cpu> <uuid> <module-name>
- // 0 1 2 3 4
- parameters["os"] = module_parts[1];
- parameters["cpu"] = module_parts[2];
- parameters["debug_file"] = module_parts[4];
- parameters["code_file"] = module_parts[4];
- parameters["debug_identifier"] = compacted_id;
-
- std::map<string, string> files;
- files["symbol_file"] = options->symbolsPath;
-
- string response, error;
- long response_code;
- bool success = HTTPUpload::SendRequest(options->uploadURLStr,
- parameters,
- files,
- options->proxy,
- options->proxy_user_pwd,
- "",
- &response,
- &response_code,
- &error);
-
- if (!success) {
- printf("Failed to send symbol file: %s\n", error.c_str());
- printf("Response code: %ld\n", response_code);
- printf("Response:\n");
- printf("%s\n", response.c_str());
- } else if (response_code == 0) {
- printf("Failed to send symbol file: No response code\n");
- } else if (response_code != 200) {
- printf("Failed to send symbol file: Response code %ld\n", response_code);
- printf("Response:\n");
- printf("%s\n", response.c_str());
- } else {
- printf("Successfully sent the symbol file.\n");
- }
- options->success = success;
-}
-
-} // namespace sym_upload
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.h b/toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.h
deleted file mode 100644
index 0a469692ac..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/symbol_upload.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// symbol_upload.h: helper functions for linux symbol upload tool.
-
-#ifndef COMMON_LINUX_SYMBOL_UPLOAD_H_
-#define COMMON_LINUX_SYMBOL_UPLOAD_H_
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-namespace sym_upload {
-
-typedef struct {
- string symbolsPath;
- string uploadURLStr;
- string proxy;
- string proxy_user_pwd;
- string version;
- bool success;
-} Options;
-
-// Starts upload to symbol server with options.
-void Start(Options* options);
-
-} // namespace sym_upload
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_SYMBOL_UPLOAD_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.cc
deleted file mode 100644
index 98e81dab75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-#include "common/linux/synth_elf.h"
-
-#include <assert.h>
-#include <elf.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "common/linux/elf_gnu_compat.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-namespace synth_elf {
-
-ELF::ELF(uint16_t machine,
- uint8_t file_class,
- Endianness endianness)
- : Section(endianness),
- addr_size_(file_class == ELFCLASS64 ? 8 : 4),
- program_count_(0),
- program_header_table_(endianness),
- section_count_(0),
- section_header_table_(endianness),
- section_header_strings_(endianness) {
- // Could add support for more machine types here if needed.
- assert(machine == EM_386 ||
- machine == EM_X86_64 ||
- machine == EM_ARM);
- assert(file_class == ELFCLASS32 || file_class == ELFCLASS64);
-
- start() = 0;
- // Add ELF header
- // e_ident
- // EI_MAG0...EI_MAG3
- D8(ELFMAG0);
- D8(ELFMAG1);
- D8(ELFMAG2);
- D8(ELFMAG3);
- // EI_CLASS
- D8(file_class);
- // EI_DATA
- D8(endianness == kLittleEndian ? ELFDATA2LSB : ELFDATA2MSB);
- // EI_VERSION
- D8(EV_CURRENT);
- // EI_OSABI
- D8(ELFOSABI_SYSV);
- // EI_ABIVERSION
- D8(0);
- // EI_PAD
- Append(7, 0);
- assert(Size() == EI_NIDENT);
-
- // e_type
- D16(ET_EXEC); //TODO: allow passing ET_DYN?
- // e_machine
- D16(machine);
- // e_version
- D32(EV_CURRENT);
- // e_entry
- Append(endianness, addr_size_, 0);
- // e_phoff
- Append(endianness, addr_size_, program_header_label_);
- // e_shoff
- Append(endianness, addr_size_, section_header_label_);
- // e_flags
- D32(0);
- // e_ehsize
- D16(addr_size_ == 8 ? sizeof(Elf64_Ehdr) : sizeof(Elf32_Ehdr));
- // e_phentsize
- D16(addr_size_ == 8 ? sizeof(Elf64_Phdr) : sizeof(Elf32_Phdr));
- // e_phnum
- D16(program_count_label_);
- // e_shentsize
- D16(addr_size_ == 8 ? sizeof(Elf64_Shdr) : sizeof(Elf32_Shdr));
- // e_shnum
- D16(section_count_label_);
- // e_shstrndx
- D16(section_header_string_index_);
-
- // Add an empty section for SHN_UNDEF.
- Section shn_undef;
- AddSection("", shn_undef, SHT_NULL);
-}
-
-int ELF::AddSection(const string& name, const Section& section,
- uint32_t type, uint32_t flags, uint64_t addr,
- uint32_t link, uint64_t entsize, uint64_t offset) {
- Label offset_label;
- Label string_label(section_header_strings_.Add(name));
- size_t size = section.Size();
-
- int index = section_count_;
- ++section_count_;
-
- section_header_table_
- // sh_name
- .D32(string_label)
- // sh_type
- .D32(type)
- // sh_flags
- .Append(endianness(), addr_size_, flags)
- // sh_addr
- .Append(endianness(), addr_size_, addr)
- // sh_offset
- .Append(endianness(), addr_size_, offset_label)
- // sh_size
- .Append(endianness(), addr_size_, size)
- // sh_link
- .D32(link)
- // sh_info
- .D32(0)
- // sh_addralign
- .Append(endianness(), addr_size_, 0)
- // sh_entsize
- .Append(endianness(), addr_size_, entsize);
-
- sections_.push_back(ElfSection(section, type, addr, offset, offset_label,
- size));
- return index;
-}
-
-void ELF::AppendSection(ElfSection &section) {
- // NULL and NOBITS sections have no content, so they
- // don't need to be written to the file.
- if (section.type_ == SHT_NULL) {
- section.offset_label_ = 0;
- } else if (section.type_ == SHT_NOBITS) {
- section.offset_label_ = section.offset_;
- } else {
- Mark(&section.offset_label_);
- Append(section);
- Align(4);
- }
-}
-
-void ELF::AddSegment(int start, int end, uint32_t type, uint32_t flags) {
- assert(start > 0);
- assert(size_t(start) < sections_.size());
- assert(end > 0);
- assert(size_t(end) < sections_.size());
- ++program_count_;
-
- // p_type
- program_header_table_.D32(type);
-
- if (addr_size_ == 8) {
- // p_flags
- program_header_table_.D32(flags);
- }
-
- size_t filesz = 0;
- size_t memsz = 0;
- bool prev_was_nobits = false;
- for (int i = start; i <= end; ++i) {
- size_t size = sections_[i].size_;
- if (sections_[i].type_ != SHT_NOBITS) {
- assert(!prev_was_nobits);
- // non SHT_NOBITS sections are 4-byte aligned (see AddSection)
- size = (size + 3) & ~3;
- filesz += size;
- } else {
- prev_was_nobits = true;
- }
- memsz += size;
- }
-
- program_header_table_
- // p_offset
- .Append(endianness(), addr_size_, sections_[start].offset_label_)
- // p_vaddr
- .Append(endianness(), addr_size_, sections_[start].addr_)
- // p_paddr
- .Append(endianness(), addr_size_, sections_[start].addr_)
- // p_filesz
- .Append(endianness(), addr_size_, filesz)
- // p_memsz
- .Append(endianness(), addr_size_, memsz);
-
- if (addr_size_ == 4) {
- // p_flags
- program_header_table_.D32(flags);
- }
-
- // p_align
- program_header_table_.Append(endianness(), addr_size_, 0);
-}
-
-void ELF::Finish() {
- // Add the section header string table at the end.
- section_header_string_index_ = section_count_;
- //printf(".shstrtab size: %ld\n", section_header_strings_.Size());
- AddSection(".shstrtab", section_header_strings_, SHT_STRTAB);
- //printf("section_count_: %ld, sections_.size(): %ld\n",
- // section_count_, sections_.size());
- if (program_count_) {
- Mark(&program_header_label_);
- Append(program_header_table_);
- } else {
- program_header_label_ = 0;
- }
-
- for (vector<ElfSection>::iterator it = sections_.begin();
- it < sections_.end(); ++it) {
- AppendSection(*it);
- }
- section_count_label_ = section_count_;
- program_count_label_ = program_count_;
-
- // Section header table starts here.
- Mark(&section_header_label_);
- Append(section_header_table_);
-}
-
-SymbolTable::SymbolTable(Endianness endianness,
- size_t addr_size,
- StringTable& table) : Section(endianness),
- table_(table) {
-#ifndef NDEBUG
- addr_size_ = addr_size;
-#endif
- assert(addr_size_ == 4 || addr_size_ == 8);
-}
-
-void SymbolTable::AddSymbol(const string& name, uint32_t value,
- uint32_t size, unsigned info, uint16_t shndx) {
- assert(addr_size_ == 4);
- D32(table_.Add(name));
- D32(value);
- D32(size);
- D8(info);
- D8(0); // other
- D16(shndx);
-}
-
-void SymbolTable::AddSymbol(const string& name, uint64_t value,
- uint64_t size, unsigned info, uint16_t shndx) {
- assert(addr_size_ == 8);
- D32(table_.Add(name));
- D8(info);
- D8(0); // other
- D16(shndx);
- D64(value);
- D64(size);
-}
-
-void Notes::AddNote(int type, const string &name, const uint8_t* desc_bytes,
- size_t desc_size) {
- // Elf32_Nhdr and Elf64_Nhdr are exactly the same.
- Elf32_Nhdr note_header;
- memset(&note_header, 0, sizeof(note_header));
- note_header.n_namesz = name.length() + 1;
- note_header.n_descsz = desc_size;
- note_header.n_type = type;
-
- Append(reinterpret_cast<const uint8_t*>(&note_header),
- sizeof(note_header));
- AppendCString(name);
- Align(4);
- Append(desc_bytes, desc_size);
- Align(4);
-}
-
-} // namespace synth_elf
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.h b/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.h
deleted file mode 100644
index 1d2a20ca22..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf.h
+++ /dev/null
@@ -1,197 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ted Mielczarek <ted.mielczarek@gmail.com>
-
-// synth_elf.h: Interface to synth_elf::ELF: fake ELF generator.
-
-#ifndef COMMON_LINUX_SYNTH_ELF_H_
-#define COMMON_LINUX_SYNTH_ELF_H_
-
-#include "common/test_assembler.h"
-
-#include <list>
-#include <vector>
-#include <map>
-#include <string>
-#include <utility>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-namespace synth_elf {
-
-using std::list;
-using std::vector;
-using std::map;
-using std::pair;
-using test_assembler::Endianness;
-using test_assembler::kLittleEndian;
-using test_assembler::kUnsetEndian;
-using test_assembler::Label;
-using test_assembler::Section;
-
-// String tables are common in ELF headers, so subclass Section
-// to make them easy to generate.
-class StringTable : public Section {
-public:
- StringTable(Endianness endianness = kUnsetEndian)
- : Section(endianness) {
- start() = 0;
- empty_string = Add("");
- }
-
- // Add the string s to the string table, and return
- // a label containing the offset into the string table
- // at which it was added.
- Label Add(const string& s) {
- if (strings_.find(s) != strings_.end())
- return strings_[s];
-
- Label string_label(Here());
- AppendCString(s);
- strings_[s] = string_label;
- return string_label;
- }
-
- // All StringTables contain an empty string as their first
- // entry.
- Label empty_string;
-
- // Avoid inserting duplicate strings.
- map<string,Label> strings_;
-};
-
-// A Section representing an entire ELF file.
-class ELF : public Section {
- public:
- ELF(uint16_t machine, // EM_386, etc
- uint8_t file_class, // ELFCLASS{32,64}
- Endianness endianness = kLittleEndian);
-
- // Add the Section section to the section header table and append it
- // to the file. Returns the index of the section in the section
- // header table.
- int AddSection(const string& name, const Section& section,
- uint32_t type, uint32_t flags = 0, uint64_t addr = 0,
- uint32_t link = 0, uint64_t entsize = 0, uint64_t offset = 0);
-
- // Add a segment containing from section index start to section index end.
- // The indexes must have been gotten from AddSection.
- void AddSegment(int start, int end, uint32_t type, uint32_t flags = 0);
-
- // Write out all data. GetContents may be used after this.
- void Finish();
-
- private:
- // Size of an address, in bytes.
- const size_t addr_size_;
-
- // Offset to the program header table.
- Label program_header_label_;
- // Number of entries in the program header table.
- int program_count_;
- Label program_count_label_;
- // The program header table itself.
- Section program_header_table_;
-
- // Offset to the section header table.
- Label section_header_label_;
- // Number of entries in the section header table.
- int section_count_;
- Label section_count_label_;
- // The section header table itself.
- Section section_header_table_;
-
- // Index of the section header string table in the section
- // header table.
- Label section_header_string_index_;
- // Section containing the names of section header table entries.
- StringTable section_header_strings_;
-
- // Record of an added section
- struct ElfSection : public Section {
- ElfSection(const Section& section, uint32_t type, uint32_t addr,
- uint32_t offset, Label offset_label, uint32_t size)
- : Section(section), type_(type), addr_(addr), offset_(offset)
- , offset_label_(offset_label), size_(size) {
- }
-
- uint32_t type_;
- uint32_t addr_;
- uint32_t offset_;
- Label offset_label_;
- uint32_t size_;
- };
-
- vector<ElfSection> sections_;
-
- void AppendSection(ElfSection &section);
-};
-
-// A class to build .symtab or .dynsym sections.
-class SymbolTable : public Section {
- public:
- // table is the StringTable that contains symbol names. The caller
- // must ensure that it remains alive for the life of the
- // SymbolTable.
- SymbolTable(Endianness endianness, size_t addr_size, StringTable& table);
-
- // Add an Elf32_Sym.
- void AddSymbol(const string& name, uint32_t value,
- uint32_t size, unsigned info, uint16_t shndx);
- // Add an Elf64_Sym.
- void AddSymbol(const string& name, uint64_t value,
- uint64_t size, unsigned info, uint16_t shndx);
-
- private:
-#ifndef NDEBUG
- size_t addr_size_;
-#endif
- StringTable& table_;
-};
-
-// A class for note sections
-class Notes : public Section {
-public:
- Notes(Endianness endianness)
- : Section(endianness) {
- }
-
- // Add a note.
- void AddNote(int type, const string &name, const uint8_t* desc_bytes,
- size_t desc_size);
-};
-
-} // namespace synth_elf
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_SYNTH_ELF_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf_unittest.cc
deleted file mode 100644
index 3715b6e608..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/synth_elf_unittest.cc
+++ /dev/null
@@ -1,413 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ted Mielczarek <ted.mielczarek@gmail.com>
-
-// synth_elf_unittest.cc:
-// Unittests for google_breakpad::synth_elf::ELF
-
-#include <elf.h>
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/elfutils.h"
-#include "common/linux/synth_elf.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::ElfClass32;
-using google_breakpad::ElfClass64;
-using google_breakpad::synth_elf::ELF;
-using google_breakpad::synth_elf::Notes;
-using google_breakpad::synth_elf::Section;
-using google_breakpad::synth_elf::StringTable;
-using google_breakpad::synth_elf::SymbolTable;
-using google_breakpad::test_assembler::Endianness;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using ::testing::Test;
-using ::testing::Types;
-
-class StringTableTest : public Test {
-public:
- StringTableTest() : table(kLittleEndian) {}
-
- StringTable table;
-};
-
-TEST_F(StringTableTest, Empty) {
- EXPECT_EQ(1U, table.Size());
- string contents;
- ASSERT_TRUE(table.GetContents(&contents));
- const char* kExpectedContents = "\0";
- EXPECT_EQ(0, memcmp(kExpectedContents,
- contents.c_str(),
- contents.size()));
- ASSERT_TRUE(table.empty_string.IsKnownConstant());
- EXPECT_EQ(0U, table.empty_string.Value());
-}
-
-TEST_F(StringTableTest, Basic) {
- const string s1("table fills with strings");
- const string s2("offsets preserved as labels");
- const string s3("verified with tests");
- const char* kExpectedContents =
- "\0table fills with strings\0"
- "offsets preserved as labels\0"
- "verified with tests\0";
- Label l1(table.Add(s1));
- Label l2(table.Add(s2));
- Label l3(table.Add(s3));
- string contents;
- ASSERT_TRUE(table.GetContents(&contents));
- EXPECT_EQ(0, memcmp(kExpectedContents,
- contents.c_str(),
- contents.size()));
- // empty_string is at zero, other strings start at 1.
- ASSERT_TRUE(l1.IsKnownConstant());
- EXPECT_EQ(1U, l1.Value());
- // Each string has an extra byte for a trailing null.
- EXPECT_EQ(1 + s1.length() + 1, l2.Value());
- EXPECT_EQ(1 + s1.length() + 1 + s2.length() + 1, l3.Value());
-}
-
-TEST_F(StringTableTest, Duplicates) {
- const string s1("string 1");
- const string s2("string 2");
- const string s3("");
- const char* kExpectedContents = "\0string 1\0string 2\0";
- Label l1(table.Add(s1));
- Label l2(table.Add(s2));
- // Adding strings twice should return the same Label.
- Label l3(table.Add(s3));
- Label l4(table.Add(s2));
- string contents;
- ASSERT_TRUE(table.GetContents(&contents));
- EXPECT_EQ(0, memcmp(kExpectedContents,
- contents.c_str(),
- contents.size()));
- EXPECT_EQ(0U, table.empty_string.Value());
- EXPECT_EQ(table.empty_string.Value(), l3.Value());
- EXPECT_EQ(l2.Value(), l4.Value());
-}
-
-class SymbolTableTest : public Test {};
-
-TEST_F(SymbolTableTest, Simple32) {
- StringTable table(kLittleEndian);
- SymbolTable syms(kLittleEndian, 4, table);
-
- const string kFuncName1 = "superfunc";
- const uint32_t kFuncAddr1 = 0x10001000;
- const uint32_t kFuncSize1 = 0x10;
- const string kFuncName2 = "awesomefunc";
- const uint32_t kFuncAddr2 = 0x20002000;
- const uint32_t kFuncSize2 = 0x2f;
- const string kFuncName3 = "megafunc";
- const uint32_t kFuncAddr3 = 0x30003000;
- const uint32_t kFuncSize3 = 0x3c;
-
- syms.AddSymbol(kFuncName1, kFuncAddr1, kFuncSize1,
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC),
- SHN_UNDEF + 1);
- syms.AddSymbol(kFuncName2, kFuncAddr2, kFuncSize2,
- ELF32_ST_INFO(STB_LOCAL, STT_FUNC),
- SHN_UNDEF + 2);
- syms.AddSymbol(kFuncName3, kFuncAddr3, kFuncSize3,
- ELF32_ST_INFO(STB_LOCAL, STT_FUNC),
- SHN_UNDEF + 3);
-
- const char kExpectedStringTable[] = "\0superfunc\0awesomefunc\0megafunc";
- const size_t kExpectedStringTableSize = sizeof(kExpectedStringTable);
- EXPECT_EQ(kExpectedStringTableSize, table.Size());
- string table_contents;
- table.GetContents(&table_contents);
- EXPECT_EQ(0, memcmp(kExpectedStringTable,
- table_contents.c_str(),
- table_contents.size()));
-
- const uint8_t kExpectedSymbolContents[] = {
- // Symbol 1
- 0x01, 0x00, 0x00, 0x00, // name
- 0x00, 0x10, 0x00, 0x10, // value
- 0x10, 0x00, 0x00, 0x00, // size
- ELF32_ST_INFO(STB_GLOBAL, STT_FUNC), // info
- 0x00, // other
- 0x01, 0x00, // shndx
- // Symbol 2
- 0x0B, 0x00, 0x00, 0x00, // name
- 0x00, 0x20, 0x00, 0x20, // value
- 0x2f, 0x00, 0x00, 0x00, // size
- ELF32_ST_INFO(STB_LOCAL, STT_FUNC), // info
- 0x00, // other
- 0x02, 0x00, // shndx
- // Symbol 3
- 0x17, 0x00, 0x00, 0x00, // name
- 0x00, 0x30, 0x00, 0x30, // value
- 0x3c, 0x00, 0x00, 0x00, // size
- ELF32_ST_INFO(STB_LOCAL, STT_FUNC), // info
- 0x00, // other
- 0x03, 0x00, // shndx
- };
- const size_t kExpectedSymbolSize = sizeof(kExpectedSymbolContents);
- EXPECT_EQ(kExpectedSymbolSize, syms.Size());
-
- string symbol_contents;
- syms.GetContents(&symbol_contents);
- EXPECT_EQ(0, memcmp(kExpectedSymbolContents,
- symbol_contents.c_str(),
- symbol_contents.size()));
-}
-
-template<typename ElfClass>
-class BasicElf : public Test {};
-
-// Doesn't seem worthwhile writing the tests to be endian-independent
-// when they're unlikely to ever be run on big-endian systems.
-#if defined(__i386__) || defined(__x86_64__)
-
-typedef Types<ElfClass32, ElfClass64> ElfClasses;
-
-TYPED_TEST_CASE(BasicElf, ElfClasses);
-
-TYPED_TEST(BasicElf, EmptyLE) {
- typedef typename TypeParam::Ehdr Ehdr;
- typedef typename TypeParam::Phdr Phdr;
- typedef typename TypeParam::Shdr Shdr;
- const size_t kStringTableSize = sizeof("\0.shstrtab");
- const size_t kStringTableAlign = 4 - kStringTableSize % 4;
- const size_t kExpectedSize = sizeof(Ehdr) +
- // Two sections, SHT_NULL + the section header string table.
- 2 * sizeof(Shdr) +
- kStringTableSize + kStringTableAlign;
-
- // It doesn't really matter that the machine type is right for the class.
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- elf.Finish();
- EXPECT_EQ(kExpectedSize, elf.Size());
-
- string contents;
- ASSERT_TRUE(elf.GetContents(&contents));
- ASSERT_EQ(kExpectedSize, contents.size());
- const Ehdr* header =
- reinterpret_cast<const Ehdr*>(contents.data());
- const uint8_t kIdent[] = {
- ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3,
- TypeParam::kClass, ELFDATA2LSB, EV_CURRENT, ELFOSABI_SYSV,
- 0, 0, 0, 0, 0, 0, 0, 0
- };
- EXPECT_EQ(0, memcmp(kIdent, header->e_ident, sizeof(kIdent)));
- EXPECT_EQ(ET_EXEC, header->e_type);
- EXPECT_EQ(EM_386, header->e_machine);
- EXPECT_EQ(static_cast<unsigned int>(EV_CURRENT), header->e_version);
- EXPECT_EQ(0U, header->e_entry);
- EXPECT_EQ(0U, header->e_phoff);
- EXPECT_EQ(sizeof(Ehdr) + kStringTableSize + kStringTableAlign,
- header->e_shoff);
- EXPECT_EQ(0U, header->e_flags);
- EXPECT_EQ(sizeof(Ehdr), header->e_ehsize);
- EXPECT_EQ(sizeof(Phdr), header->e_phentsize);
- EXPECT_EQ(0, header->e_phnum);
- EXPECT_EQ(sizeof(Shdr), header->e_shentsize);
- EXPECT_EQ(2, header->e_shnum);
- EXPECT_EQ(1, header->e_shstrndx);
-
- const Shdr* shdr =
- reinterpret_cast<const Shdr*>(contents.data() + header->e_shoff);
- EXPECT_EQ(0U, shdr[0].sh_name);
- EXPECT_EQ(static_cast<unsigned int>(SHT_NULL), shdr[0].sh_type);
- EXPECT_EQ(0U, shdr[0].sh_flags);
- EXPECT_EQ(0U, shdr[0].sh_addr);
- EXPECT_EQ(0U, shdr[0].sh_offset);
- EXPECT_EQ(0U, shdr[0].sh_size);
- EXPECT_EQ(0U, shdr[0].sh_link);
- EXPECT_EQ(0U, shdr[0].sh_info);
- EXPECT_EQ(0U, shdr[0].sh_addralign);
- EXPECT_EQ(0U, shdr[0].sh_entsize);
-
- EXPECT_EQ(1U, shdr[1].sh_name);
- EXPECT_EQ(static_cast<unsigned int>(SHT_STRTAB), shdr[1].sh_type);
- EXPECT_EQ(0U, shdr[1].sh_flags);
- EXPECT_EQ(0U, shdr[1].sh_addr);
- EXPECT_EQ(sizeof(Ehdr), shdr[1].sh_offset);
- EXPECT_EQ(kStringTableSize, shdr[1].sh_size);
- EXPECT_EQ(0U, shdr[1].sh_link);
- EXPECT_EQ(0U, shdr[1].sh_info);
- EXPECT_EQ(0U, shdr[1].sh_addralign);
- EXPECT_EQ(0U, shdr[1].sh_entsize);
-}
-
-TYPED_TEST(BasicElf, BasicLE) {
- typedef typename TypeParam::Ehdr Ehdr;
- typedef typename TypeParam::Phdr Phdr;
- typedef typename TypeParam::Shdr Shdr;
- const size_t kStringTableSize = sizeof("\0.text\0.bss\0.shstrtab");
- const size_t kStringTableAlign = 4 - kStringTableSize % 4;
- const size_t kExpectedSize = sizeof(Ehdr) +
- // Four sections, SHT_NULL + the section header string table +
- // 4096 bytes of the size-aligned .text section + one program header.
- sizeof(Phdr) + 4 * sizeof(Shdr) + 4096 +
- kStringTableSize + kStringTableAlign;
-
- // It doesn't really matter that the machine type is right for the class.
- ELF elf(EM_386, TypeParam::kClass, kLittleEndian);
- Section text(kLittleEndian);
- text.Append(4094, 0);
- int text_idx = elf.AddSection(".text", text, SHT_PROGBITS);
- Section bss(kLittleEndian);
- bss.Append(16, 0);
- int bss_idx = elf.AddSection(".bss", bss, SHT_NOBITS);
- elf.AddSegment(text_idx, bss_idx, PT_LOAD);
- elf.Finish();
- EXPECT_EQ(kExpectedSize, elf.Size());
-
- string contents;
- ASSERT_TRUE(elf.GetContents(&contents));
- ASSERT_EQ(kExpectedSize, contents.size());
- const Ehdr* header =
- reinterpret_cast<const Ehdr*>(contents.data());
- const uint8_t kIdent[] = {
- ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3,
- TypeParam::kClass, ELFDATA2LSB, EV_CURRENT, ELFOSABI_SYSV,
- 0, 0, 0, 0, 0, 0, 0, 0
- };
- EXPECT_EQ(0, memcmp(kIdent, header->e_ident, sizeof(kIdent)));
- EXPECT_EQ(ET_EXEC, header->e_type);
- EXPECT_EQ(EM_386, header->e_machine);
- EXPECT_EQ(static_cast<unsigned int>(EV_CURRENT), header->e_version);
- EXPECT_EQ(0U, header->e_entry);
- EXPECT_EQ(sizeof(Ehdr), header->e_phoff);
- EXPECT_EQ(sizeof(Ehdr) + sizeof(Phdr) + 4096 + kStringTableSize +
- kStringTableAlign, header->e_shoff);
- EXPECT_EQ(0U, header->e_flags);
- EXPECT_EQ(sizeof(Ehdr), header->e_ehsize);
- EXPECT_EQ(sizeof(Phdr), header->e_phentsize);
- EXPECT_EQ(1, header->e_phnum);
- EXPECT_EQ(sizeof(Shdr), header->e_shentsize);
- EXPECT_EQ(4, header->e_shnum);
- EXPECT_EQ(3, header->e_shstrndx);
-
- const Shdr* shdr =
- reinterpret_cast<const Shdr*>(contents.data() + header->e_shoff);
- EXPECT_EQ(0U, shdr[0].sh_name);
- EXPECT_EQ(static_cast<unsigned int>(SHT_NULL), shdr[0].sh_type);
- EXPECT_EQ(0U, shdr[0].sh_flags);
- EXPECT_EQ(0U, shdr[0].sh_addr);
- EXPECT_EQ(0U, shdr[0].sh_offset);
- EXPECT_EQ(0U, shdr[0].sh_size);
- EXPECT_EQ(0U, shdr[0].sh_link);
- EXPECT_EQ(0U, shdr[0].sh_info);
- EXPECT_EQ(0U, shdr[0].sh_addralign);
- EXPECT_EQ(0U, shdr[0].sh_entsize);
-
- EXPECT_EQ(1U, shdr[1].sh_name);
- EXPECT_EQ(static_cast<unsigned int>(SHT_PROGBITS), shdr[1].sh_type);
- EXPECT_EQ(0U, shdr[1].sh_flags);
- EXPECT_EQ(0U, shdr[1].sh_addr);
- EXPECT_EQ(sizeof(Ehdr) + sizeof(Phdr), shdr[1].sh_offset);
- EXPECT_EQ(4094U, shdr[1].sh_size);
- EXPECT_EQ(0U, shdr[1].sh_link);
- EXPECT_EQ(0U, shdr[1].sh_info);
- EXPECT_EQ(0U, shdr[1].sh_addralign);
- EXPECT_EQ(0U, shdr[1].sh_entsize);
-
- EXPECT_EQ(sizeof("\0.text"), shdr[2].sh_name);
- EXPECT_EQ(static_cast<unsigned int>(SHT_NOBITS), shdr[2].sh_type);
- EXPECT_EQ(0U, shdr[2].sh_flags);
- EXPECT_EQ(0U, shdr[2].sh_addr);
- EXPECT_EQ(0U, shdr[2].sh_offset);
- EXPECT_EQ(16U, shdr[2].sh_size);
- EXPECT_EQ(0U, shdr[2].sh_link);
- EXPECT_EQ(0U, shdr[2].sh_info);
- EXPECT_EQ(0U, shdr[2].sh_addralign);
- EXPECT_EQ(0U, shdr[2].sh_entsize);
-
- EXPECT_EQ(sizeof("\0.text\0.bss"), shdr[3].sh_name);
- EXPECT_EQ(static_cast<unsigned int>(SHT_STRTAB), shdr[3].sh_type);
- EXPECT_EQ(0U, shdr[3].sh_flags);
- EXPECT_EQ(0U, shdr[3].sh_addr);
- EXPECT_EQ(sizeof(Ehdr) + sizeof(Phdr) + 4096, shdr[3].sh_offset);
- EXPECT_EQ(kStringTableSize, shdr[3].sh_size);
- EXPECT_EQ(0U, shdr[3].sh_link);
- EXPECT_EQ(0U, shdr[3].sh_info);
- EXPECT_EQ(0U, shdr[3].sh_addralign);
- EXPECT_EQ(0U, shdr[3].sh_entsize);
-
- const Phdr* phdr =
- reinterpret_cast<const Phdr*>(contents.data() + header->e_phoff);
- EXPECT_EQ(static_cast<unsigned int>(PT_LOAD), phdr->p_type);
- EXPECT_EQ(sizeof(Ehdr) + sizeof(Phdr), phdr->p_offset);
- EXPECT_EQ(0U, phdr->p_vaddr);
- EXPECT_EQ(0U, phdr->p_paddr);
- EXPECT_EQ(4096U, phdr->p_filesz);
- EXPECT_EQ(4096U + 16U, phdr->p_memsz);
- EXPECT_EQ(0U, phdr->p_flags);
- EXPECT_EQ(0U, phdr->p_align);
-}
-
-class ElfNotesTest : public Test {};
-
-TEST_F(ElfNotesTest, Empty) {
- Notes notes(kLittleEndian);
- string contents;
- ASSERT_TRUE(notes.GetContents(&contents));
- EXPECT_EQ(0U, contents.size());
-}
-
-TEST_F(ElfNotesTest, Notes) {
- Notes notes(kLittleEndian);
- notes.AddNote(1, "Linux", reinterpret_cast<const uint8_t *>("\x42\x02\0\0"),
- 4);
- notes.AddNote(2, "a", reinterpret_cast<const uint8_t *>("foobar"),
- sizeof("foobar") - 1);
-
- const uint8_t kExpectedNotesContents[] = {
- // Note 1
- 0x06, 0x00, 0x00, 0x00, // name size, including terminating zero
- 0x04, 0x00, 0x00, 0x00, // desc size
- 0x01, 0x00, 0x00, 0x00, // type
- 'L', 'i', 'n', 'u', 'x', 0x00, 0x00, 0x00, // padded "Linux"
- 0x42, 0x02, 0x00, 0x00, // desc
- // Note 2
- 0x02, 0x00, 0x00, 0x00, // name size
- 0x06, 0x00, 0x00, 0x00, // desc size
- 0x02, 0x00, 0x00, 0x00, // type
- 'a', 0x00, 0x00, 0x00, // padded "a"
- 'f', 'o', 'o', 'b', 'a', 'r', 0x00, 0x00, // padded "foobar"
- };
- const size_t kExpectedNotesSize = sizeof(kExpectedNotesContents);
- EXPECT_EQ(kExpectedNotesSize, notes.Size());
-
- string notes_contents;
- ASSERT_TRUE(notes.GetContents(&notes_contents));
- EXPECT_EQ(0, memcmp(kExpectedNotesContents,
- notes_contents.data(),
- notes_contents.size()));
-}
-
-#endif // defined(__i386__) || defined(__x86_64__)
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/tests/auto_testfile.h b/toolkit/crashreporter/google-breakpad/src/common/linux/tests/auto_testfile.h
deleted file mode 100644
index 92fe017b92..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/tests/auto_testfile.h
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utility class for creating a temporary file for unit tests
-// that is deleted in the destructor.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_LINUX_TESTS_AUTO_TESTFILE
-#define GOOGLE_BREAKPAD_COMMON_LINUX_TESTS_AUTO_TESTFILE
-
-#include <unistd.h>
-#include <sys/types.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/linux/eintr_wrapper.h"
-#include "common/tests/auto_tempdir.h"
-
-namespace google_breakpad {
-
-class AutoTestFile {
- public:
- // Create a new empty test file.
- // test_prefix: (input) test-specific prefix, can't be NULL.
- explicit AutoTestFile(const char* test_prefix) {
- Init(test_prefix);
- }
-
- // Create a new test file, and fill it with initial data from a C string.
- // The terminating zero is not written.
- // test_prefix: (input) test-specific prefix, can't be NULL.
- // text: (input) initial content.
- AutoTestFile(const char* test_prefix, const char* text) {
- Init(test_prefix);
- if (fd_ >= 0)
- WriteText(text, static_cast<size_t>(strlen(text)));
- }
-
- AutoTestFile(const char* test_prefix, const char* text, size_t text_len) {
- Init(test_prefix);
- if (fd_ >= 0)
- WriteText(text, text_len);
- }
-
- // Destroy test file on scope exit.
- ~AutoTestFile() {
- if (fd_ >= 0) {
- close(fd_);
- fd_ = -1;
- }
- }
-
- // Returns true iff the test file could be created properly.
- // Useful in tests inside EXPECT_TRUE(file.IsOk());
- bool IsOk() {
- return fd_ >= 0;
- }
-
- // Returns the Posix file descriptor for the test file, or -1
- // If IsOk() returns false. Note: on Windows, this always returns -1.
- int GetFd() {
- return fd_;
- }
-
- private:
- void Init(const char* test_prefix) {
- fd_ = -1;
- char path_templ[PATH_MAX];
- int ret = snprintf(path_templ, sizeof(path_templ),
- TEMPDIR "/%s-unittest.XXXXXX",
- test_prefix);
- if (ret >= static_cast<int>(sizeof(path_templ)))
- return;
-
- fd_ = mkstemp(path_templ);
- if (fd_ < 0)
- return;
-
- unlink(path_templ);
- }
-
- void WriteText(const char* text, size_t text_len) {
- ssize_t r = HANDLE_EINTR(write(fd_, text, text_len));
- if (r != static_cast<ssize_t>(text_len)) {
- close(fd_);
- fd_ = -1;
- return;
- }
-
- lseek(fd_, 0, SEEK_SET);
- }
-
- int fd_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_COMMON_LINUX_TESTS_AUTO_TESTFILE
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.cc b/toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.cc
deleted file mode 100644
index c9491f6f29..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.cc
+++ /dev/null
@@ -1,322 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// crash_generator.cc: Implement google_breakpad::CrashGenerator.
-// See crash_generator.h for details.
-
-#include "common/linux/tests/crash_generator.h"
-
-#include <pthread.h>
-#include <signal.h>
-#include <stdio.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sys/syscall.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-#include <string>
-
-#if defined(__ANDROID__)
-#include "common/android/testing/pthread_fixes.h"
-#endif
-#include "common/linux/eintr_wrapper.h"
-#include "common/tests/auto_tempdir.h"
-#include "common/tests/file_utils.h"
-#include "common/using_std_string.h"
-
-namespace {
-
-struct ThreadData {
- pthread_t thread;
- pthread_barrier_t* barrier;
- pid_t* thread_id_ptr;
-};
-
-const char* const kProcFilesToCopy[] = {
- "auxv", "cmdline", "environ", "maps", "status"
-};
-const size_t kNumProcFilesToCopy =
- sizeof(kProcFilesToCopy) / sizeof(kProcFilesToCopy[0]);
-
-int gettid() {
- // Glibc does not provide a wrapper for this.
- return syscall(__NR_gettid);
-}
-
-int tkill(pid_t tid, int sig) {
- // Glibc does not provide a wrapper for this.
- return syscall(__NR_tkill, tid, sig);
-}
-
-// Core file size limit set to 1 MB, which is big enough for test purposes.
-const rlim_t kCoreSizeLimit = 1024 * 1024;
-
-void *thread_function(void *data) {
- ThreadData* thread_data = reinterpret_cast<ThreadData*>(data);
- volatile pid_t thread_id = gettid();
- *(thread_data->thread_id_ptr) = thread_id;
- int result = pthread_barrier_wait(thread_data->barrier);
- if (result != 0 && result != PTHREAD_BARRIER_SERIAL_THREAD) {
- perror("Failed to wait for sync barrier");
- exit(1);
- }
- while (true) {
- pthread_yield();
- }
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-CrashGenerator::CrashGenerator()
- : shared_memory_(NULL),
- shared_memory_size_(0) {
-}
-
-CrashGenerator::~CrashGenerator() {
- UnmapSharedMemory();
-}
-
-bool CrashGenerator::HasDefaultCorePattern() const {
- char buffer[8];
- ssize_t buffer_size = sizeof(buffer);
- return ReadFile("/proc/sys/kernel/core_pattern", buffer, &buffer_size) &&
- buffer_size == 5 && memcmp(buffer, "core", 4) == 0;
-}
-
-string CrashGenerator::GetCoreFilePath() const {
- return temp_dir_.path() + "/core";
-}
-
-string CrashGenerator::GetDirectoryOfProcFilesCopy() const {
- return temp_dir_.path() + "/proc";
-}
-
-pid_t CrashGenerator::GetThreadId(unsigned index) const {
- return reinterpret_cast<pid_t*>(shared_memory_)[index];
-}
-
-pid_t* CrashGenerator::GetThreadIdPointer(unsigned index) {
- return reinterpret_cast<pid_t*>(shared_memory_) + index;
-}
-
-bool CrashGenerator::MapSharedMemory(size_t memory_size) {
- if (!UnmapSharedMemory())
- return false;
-
- void* mapped_memory = mmap(0, memory_size, PROT_READ | PROT_WRITE,
- MAP_SHARED | MAP_ANONYMOUS, -1, 0);
- if (mapped_memory == MAP_FAILED) {
- perror("CrashGenerator: Failed to map shared memory");
- return false;
- }
-
- memset(mapped_memory, 0, memory_size);
- shared_memory_ = mapped_memory;
- shared_memory_size_ = memory_size;
- return true;
-}
-
-bool CrashGenerator::UnmapSharedMemory() {
- if (!shared_memory_)
- return true;
-
- if (munmap(shared_memory_, shared_memory_size_) == 0) {
- shared_memory_ = NULL;
- shared_memory_size_ = 0;
- return true;
- }
-
- perror("CrashGenerator: Failed to unmap shared memory");
- return false;
-}
-
-bool CrashGenerator::SetCoreFileSizeLimit(rlim_t limit) const {
- struct rlimit limits = { limit, limit };
- if (setrlimit(RLIMIT_CORE, &limits) == -1) {
- perror("CrashGenerator: Failed to set core file size limit");
- return false;
- }
- return true;
-}
-
-bool CrashGenerator::CreateChildCrash(
- unsigned num_threads, unsigned crash_thread, int crash_signal,
- pid_t* child_pid) {
- if (num_threads == 0 || crash_thread >= num_threads) {
- fprintf(stderr, "CrashGenerator: Invalid thread counts; num_threads=%u"
- " crash_thread=%u\n", num_threads, crash_thread);
- return false;
- }
-
- if (!MapSharedMemory(num_threads * sizeof(pid_t))) {
- perror("CrashGenerator: Unable to map shared memory");
- return false;
- }
-
- pid_t pid = fork();
- if (pid == 0) {
- if (chdir(temp_dir_.path().c_str()) == -1) {
- perror("CrashGenerator: Failed to change directory");
- exit(1);
- }
- if (SetCoreFileSizeLimit(kCoreSizeLimit)) {
- CreateThreadsInChildProcess(num_threads);
- string proc_dir = GetDirectoryOfProcFilesCopy();
- if (mkdir(proc_dir.c_str(), 0755) == -1) {
- perror("CrashGenerator: Failed to create proc directory");
- exit(1);
- }
- if (!CopyProcFiles(getpid(), proc_dir.c_str())) {
- fprintf(stderr, "CrashGenerator: Failed to copy proc files\n");
- exit(1);
- }
- // On Android the signal sometimes doesn't seem to get sent even though
- // tkill returns '0'. Retry a couple of times if the signal doesn't get
- // through on the first go:
- // https://code.google.com/p/google-breakpad/issues/detail?id=579
-#if defined(__ANDROID__)
- const int kRetries = 60;
- const unsigned int kSleepTimeInSeconds = 1;
-#else
- const int kRetries = 1;
- const unsigned int kSleepTimeInSeconds = 600;
-#endif
- for (int i = 0; i < kRetries; i++) {
- if (tkill(*GetThreadIdPointer(crash_thread), crash_signal) == -1) {
- perror("CrashGenerator: Failed to kill thread by signal");
- } else {
- // At this point, we've queued the signal for delivery, but there's no
- // guarantee when it'll be delivered. We don't want the main thread to
- // race and exit before the thread we signaled is processed. So sleep
- // long enough that we won't flake even under fairly high load.
- // TODO: See if we can't be a bit more deterministic. There doesn't
- // seem to be an API to check on signal delivery status, so we can't
- // really poll and wait for the kernel to declare the signal has been
- // delivered. If it has, and things worked, we'd be killed, so the
- // sleep length doesn't really matter.
- sleep(kSleepTimeInSeconds);
- }
- }
- } else {
- perror("CrashGenerator: Failed to set core limit");
- }
- exit(1);
- } else if (pid == -1) {
- perror("CrashGenerator: Failed to create child process");
- return false;
- }
-
- int status;
- if (HANDLE_EINTR(waitpid(pid, &status, 0)) == -1) {
- perror("CrashGenerator: Failed to wait for child process");
- return false;
- }
- if (!WIFSIGNALED(status) || WTERMSIG(status) != crash_signal) {
- fprintf(stderr, "CrashGenerator: Child process not killed by the expected signal\n"
- " exit status=0x%x pid=%u signaled=%s sig=%d expected=%d\n",
- status, pid, WIFSIGNALED(status) ? "true" : "false",
- WTERMSIG(status), crash_signal);
- return false;
- }
-
- if (child_pid)
- *child_pid = pid;
- return true;
-}
-
-bool CrashGenerator::CopyProcFiles(pid_t pid, const char* path) const {
- char from_path[PATH_MAX], to_path[PATH_MAX];
- for (size_t i = 0; i < kNumProcFilesToCopy; ++i) {
- int num_chars = snprintf(from_path, PATH_MAX, "/proc/%d/%s",
- pid, kProcFilesToCopy[i]);
- if (num_chars < 0 || num_chars >= PATH_MAX)
- return false;
-
- num_chars = snprintf(to_path, PATH_MAX, "%s/%s",
- path, kProcFilesToCopy[i]);
- if (num_chars < 0 || num_chars >= PATH_MAX)
- return false;
-
- if (!CopyFile(from_path, to_path))
- return false;
- }
- return true;
-}
-
-void CrashGenerator::CreateThreadsInChildProcess(unsigned num_threads) {
- *GetThreadIdPointer(0) = getpid();
-
- if (num_threads <= 1)
- return;
-
- // This method does not clean up any pthread resource, as the process
- // is expected to be killed anyway.
- ThreadData* thread_data = new ThreadData[num_threads];
-
- // Create detached threads so that we do not worry about pthread_join()
- // later being called or not.
- pthread_attr_t thread_attributes;
- if (pthread_attr_init(&thread_attributes) != 0 ||
- pthread_attr_setdetachstate(&thread_attributes,
- PTHREAD_CREATE_DETACHED) != 0) {
- fprintf(stderr, "CrashGenerator: Failed to initialize thread attribute\n");
- exit(1);
- }
-
- pthread_barrier_t thread_barrier;
- if (pthread_barrier_init(&thread_barrier, NULL, num_threads) != 0) {
- fprintf(stderr, "CrashGenerator: Failed to initialize thread barrier\n");
- exit(1);
- }
-
- for (unsigned i = 1; i < num_threads; ++i) {
- thread_data[i].barrier = &thread_barrier;
- thread_data[i].thread_id_ptr = GetThreadIdPointer(i);
- if (pthread_create(&thread_data[i].thread, &thread_attributes,
- thread_function, &thread_data[i]) != 0) {
- fprintf(stderr, "CrashGenerator: Failed to create thread %d\n", i);
- exit(1);
- }
- }
-
- int result = pthread_barrier_wait(&thread_barrier);
- if (result != 0 && result != PTHREAD_BARRIER_SERIAL_THREAD) {
- fprintf(stderr, "CrashGenerator: Failed to wait for thread barrier\n");
- exit(1);
- }
-
- pthread_barrier_destroy(&thread_barrier);
- pthread_attr_destroy(&thread_attributes);
- delete[] thread_data;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.h b/toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.h
deleted file mode 100644
index 7e2fcbf98a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/tests/crash_generator.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// crash_generator.h: Define the google_breakpad::CrashGenerator class,
-// which is used to generate a crash (and a core dump file) for testing.
-
-#ifndef COMMON_LINUX_TESTS_CRASH_GENERATOR_H_
-#define COMMON_LINUX_TESTS_CRASH_GENERATOR_H_
-
-#include <sys/resource.h>
-
-#include <string>
-
-#include "common/tests/auto_tempdir.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// A utility class for generating a crash (and a core dump file) for
-// testing. It creates a child process with the specified number of
-// threads, which is then termainated by the specified signal. A core
-// dump file is expected to be created upon the termination of the child
-// process, which can then be used for testing code that processes core
-// dump files.
-class CrashGenerator {
- public:
- CrashGenerator();
-
- ~CrashGenerator();
-
- // Returns true if a core dump file named 'core' will be generated in
- // the current directory for a test that produces a crash by checking
- // if /proc/sys/kernel/core_pattern has the default value 'core'.
- bool HasDefaultCorePattern() const;
-
- // Returns the expected path of the core dump file.
- string GetCoreFilePath() const;
-
- // Returns the directory of a copy of proc files of the child process.
- string GetDirectoryOfProcFilesCopy() const;
-
- // Creates a crash (and a core dump file) by creating a child process with
- // |num_threads| threads, and the terminating the child process by sending
- // a signal with number |crash_signal| to the |crash_thread|-th thread.
- // Returns true on success.
- bool CreateChildCrash(unsigned num_threads, unsigned crash_thread,
- int crash_signal, pid_t* child_pid);
-
- // Returns the thread ID of the |index|-th thread in the child process.
- // This method does not validate |index|.
- pid_t GetThreadId(unsigned index) const;
-
- private:
- // Copies the following proc files of the process with |pid| to the directory
- // at |path|: auxv, cmdline, environ, maps, status
- // The directory must have been created. Returns true on success.
- bool CopyProcFiles(pid_t pid, const char* path) const;
-
- // Creates |num_threads| threads in the child process.
- void CreateThreadsInChildProcess(unsigned num_threads);
-
- // Sets the maximum size of core dump file (both the soft and hard limit)
- // to |limit| bytes. Returns true on success.
- bool SetCoreFileSizeLimit(rlim_t limit) const;
-
- // Creates a shared memory of |memory_size| bytes for communicating thread
- // IDs between the parent and child process. Returns true on success.
- bool MapSharedMemory(size_t memory_size);
-
- // Releases any shared memory created by MapSharedMemory(). Returns true on
- // success.
- bool UnmapSharedMemory();
-
- // Returns the pointer to the thread ID of the |index|-th thread in the child
- // process. This method does not validate |index|.
- pid_t* GetThreadIdPointer(unsigned index);
-
- // Temporary directory in which a core file is generated.
- AutoTempDir temp_dir_;
-
- // Shared memory for communicating thread IDs between the parent and
- // child process.
- void* shared_memory_;
-
- // Number of bytes mapped for |shared_memory_|.
- size_t shared_memory_size_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_TESTS_CRASH_GENERATOR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig b/toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig
deleted file mode 100644
index f091369081..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/Breakpad.xcconfig
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-GCC_C_LANGUAGE_STANDARD = c99
-
-GCC_WARN_CHECK_SWITCH_STATEMENTS = YES
-// TODO(nealsid): Get the code so we can turn on the 64_TO_32 warning.
-GCC_WARN_64_TO_32_BIT_CONVERSION = NO
-GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES
-GCC_WARN_ABOUT_RETURN_TYPE = YES
-GCC_WARN_MISSING_PARENTHESES = YES
-
-// Once https://bugs.chromium.org/p/google-breakpad/issues/detail?id=697
-// is fixed this should be reenabled.
-//GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES
-GCC_WARN_ABOUT_MISSING_NEWLINE = YES
-GCC_WARN_SIGN_COMPARE = YES
-GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES
-GCC_WARN_UNDECLARED_SELECTOR = YES
-GCC_WARN_UNKNOWN_PRAGMAS = YES
-GCC_WARN_UNUSED_VARIABLE = YES
-GCC_TREAT_WARNINGS_AS_ERRORS = YES
-
-DEBUG_INFORMATION_FORMAT = dwarf-with-dsym
-
-ALWAYS_SEARCH_USER_PATHS = NO
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig b/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig
deleted file mode 100644
index 94cdd8cfca..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadDebug.xcconfig
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "Breakpad.xcconfig"
-
-GCC_OPTIMIZATION_LEVEL = 0
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig b/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig
deleted file mode 100644
index 920f277db8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/BreakpadRelease.xcconfig
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "Breakpad.xcconfig"
-
-GCC_OPTIMIZATION_LEVEL = s
-GCC_WARN_UNINITIALIZED_AUTOS = YES
-GCC_PREPROCESSOR_DEFINITIONS = $(inherited) NDEBUG
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/GTMDefines.h b/toolkit/crashreporter/google-breakpad/src/common/mac/GTMDefines.h
deleted file mode 100644
index 14ffa7e13f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/GTMDefines.h
+++ /dev/null
@@ -1,456 +0,0 @@
-//
-// GTMDefines.h
-//
-// Copyright 2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-// ============================================================================
-
-#include <AvailabilityMacros.h>
-#include <TargetConditionals.h>
-
-#ifdef __OBJC__
-#include <Foundation/NSObjCRuntime.h>
-#endif // __OBJC__
-
-#if TARGET_OS_IPHONE
-#include <Availability.h>
-#endif // TARGET_OS_IPHONE
-
-// Not all MAC_OS_X_VERSION_10_X macros defined in past SDKs
-#ifndef MAC_OS_X_VERSION_10_5
- #define MAC_OS_X_VERSION_10_5 1050
-#endif
-#ifndef MAC_OS_X_VERSION_10_6
- #define MAC_OS_X_VERSION_10_6 1060
-#endif
-#ifndef MAC_OS_X_VERSION_10_7
- #define MAC_OS_X_VERSION_10_7 1070
-#endif
-
-// Not all __IPHONE_X macros defined in past SDKs
-#ifndef __IPHONE_3_0
- #define __IPHONE_3_0 30000
-#endif
-#ifndef __IPHONE_3_1
- #define __IPHONE_3_1 30100
-#endif
-#ifndef __IPHONE_3_2
- #define __IPHONE_3_2 30200
-#endif
-#ifndef __IPHONE_4_0
- #define __IPHONE_4_0 40000
-#endif
-#ifndef __IPHONE_4_3
- #define __IPHONE_4_3 40300
-#endif
-#ifndef __IPHONE_5_0
- #define __IPHONE_5_0 50000
-#endif
-
-// ----------------------------------------------------------------------------
-// CPP symbols that can be overridden in a prefix to control how the toolbox
-// is compiled.
-// ----------------------------------------------------------------------------
-
-
-// By setting the GTM_CONTAINERS_VALIDATION_FAILED_LOG and
-// GTM_CONTAINERS_VALIDATION_FAILED_ASSERT macros you can control what happens
-// when a validation fails. If you implement your own validators, you may want
-// to control their internals using the same macros for consistency.
-#ifndef GTM_CONTAINERS_VALIDATION_FAILED_ASSERT
- #define GTM_CONTAINERS_VALIDATION_FAILED_ASSERT 0
-#endif
-
-// Give ourselves a consistent way to do inlines. Apple's macros even use
-// a few different actual definitions, so we're based off of the foundation
-// one.
-#if !defined(GTM_INLINE)
- #if (defined (__GNUC__) && (__GNUC__ == 4)) || defined (__clang__)
- #define GTM_INLINE static __inline__ __attribute__((always_inline))
- #else
- #define GTM_INLINE static __inline__
- #endif
-#endif
-
-// Give ourselves a consistent way of doing externs that links up nicely
-// when mixing objc and objc++
-#if !defined (GTM_EXTERN)
- #if defined __cplusplus
- #define GTM_EXTERN extern "C"
- #define GTM_EXTERN_C_BEGIN extern "C" {
- #define GTM_EXTERN_C_END }
- #else
- #define GTM_EXTERN extern
- #define GTM_EXTERN_C_BEGIN
- #define GTM_EXTERN_C_END
- #endif
-#endif
-
-// Give ourselves a consistent way of exporting things if we have visibility
-// set to hidden.
-#if !defined (GTM_EXPORT)
- #define GTM_EXPORT __attribute__((visibility("default")))
-#endif
-
-// Give ourselves a consistent way of declaring something as unused. This
-// doesn't use __unused because that is only supported in gcc 4.2 and greater.
-#if !defined (GTM_UNUSED)
-#define GTM_UNUSED(x) ((void)(x))
-#endif
-
-// _GTMDevLog & _GTMDevAssert
-//
-// _GTMDevLog & _GTMDevAssert are meant to be a very lightweight shell for
-// developer level errors. This implementation simply macros to NSLog/NSAssert.
-// It is not intended to be a general logging/reporting system.
-//
-// Please see http://code.google.com/p/google-toolbox-for-mac/wiki/DevLogNAssert
-// for a little more background on the usage of these macros.
-//
-// _GTMDevLog log some error/problem in debug builds
-// _GTMDevAssert assert if conditon isn't met w/in a method/function
-// in all builds.
-//
-// To replace this system, just provide different macro definitions in your
-// prefix header. Remember, any implementation you provide *must* be thread
-// safe since this could be called by anything in what ever situtation it has
-// been placed in.
-//
-
-// We only define the simple macros if nothing else has defined this.
-#ifndef _GTMDevLog
-
-#ifdef DEBUG
- #define _GTMDevLog(...) NSLog(__VA_ARGS__)
-#else
- #define _GTMDevLog(...) do { } while (0)
-#endif
-
-#endif // _GTMDevLog
-
-#ifndef _GTMDevAssert
-// we directly invoke the NSAssert handler so we can pass on the varargs
-// (NSAssert doesn't have a macro we can use that takes varargs)
-#if !defined(NS_BLOCK_ASSERTIONS)
- #define _GTMDevAssert(condition, ...) \
- do { \
- if (!(condition)) { \
- [[NSAssertionHandler currentHandler] \
- handleFailureInFunction:[NSString stringWithUTF8String:__PRETTY_FUNCTION__] \
- file:[NSString stringWithUTF8String:__FILE__] \
- lineNumber:__LINE__ \
- description:__VA_ARGS__]; \
- } \
- } while(0)
-#else // !defined(NS_BLOCK_ASSERTIONS)
- #define _GTMDevAssert(condition, ...) do { } while (0)
-#endif // !defined(NS_BLOCK_ASSERTIONS)
-
-#endif // _GTMDevAssert
-
-// _GTMCompileAssert
-// _GTMCompileAssert is an assert that is meant to fire at compile time if you
-// want to check things at compile instead of runtime. For example if you
-// want to check that a wchar is 4 bytes instead of 2 you would use
-// _GTMCompileAssert(sizeof(wchar_t) == 4, wchar_t_is_4_bytes_on_OS_X)
-// Note that the second "arg" is not in quotes, and must be a valid processor
-// symbol in it's own right (no spaces, punctuation etc).
-
-// Wrapping this in an #ifndef allows external groups to define their own
-// compile time assert scheme.
-#ifndef _GTMCompileAssert
- // We got this technique from here:
- // http://unixjunkie.blogspot.com/2007/10/better-compile-time-asserts_29.html
-
- #define _GTMCompileAssertSymbolInner(line, msg) _GTMCOMPILEASSERT ## line ## __ ## msg
- #define _GTMCompileAssertSymbol(line, msg) _GTMCompileAssertSymbolInner(line, msg)
- #define _GTMCompileAssert(test, msg) \
- typedef char _GTMCompileAssertSymbol(__LINE__, msg) [ ((test) ? 1 : -1) ]
-#endif // _GTMCompileAssert
-
-// ----------------------------------------------------------------------------
-// CPP symbols defined based on the project settings so the GTM code has
-// simple things to test against w/o scattering the knowledge of project
-// setting through all the code.
-// ----------------------------------------------------------------------------
-
-// Provide a single constant CPP symbol that all of GTM uses for ifdefing
-// iPhone code.
-#if TARGET_OS_IPHONE // iPhone SDK
- // For iPhone specific stuff
- #define GTM_IPHONE_SDK 1
- #if TARGET_IPHONE_SIMULATOR
- #define GTM_IPHONE_DEVICE 0
- #define GTM_IPHONE_SIMULATOR 1
- #else
- #define GTM_IPHONE_DEVICE 1
- #define GTM_IPHONE_SIMULATOR 0
- #endif // TARGET_IPHONE_SIMULATOR
- // By default, GTM has provided it's own unittesting support, define this
- // to use the support provided by Xcode, especially for the Xcode4 support
- // for unittesting.
- #ifndef GTM_IPHONE_USE_SENTEST
- #define GTM_IPHONE_USE_SENTEST 0
- #endif
- #define GTM_MACOS_SDK 0
-#else
- // For MacOS specific stuff
- #define GTM_MACOS_SDK 1
- #define GTM_IPHONE_SDK 0
- #define GTM_IPHONE_SIMULATOR 0
- #define GTM_IPHONE_DEVICE 0
- #define GTM_IPHONE_USE_SENTEST 0
-#endif
-
-// Some of our own availability macros
-#if GTM_MACOS_SDK
-#define GTM_AVAILABLE_ONLY_ON_IPHONE UNAVAILABLE_ATTRIBUTE
-#define GTM_AVAILABLE_ONLY_ON_MACOS
-#else
-#define GTM_AVAILABLE_ONLY_ON_IPHONE
-#define GTM_AVAILABLE_ONLY_ON_MACOS UNAVAILABLE_ATTRIBUTE
-#endif
-
-// GC was dropped by Apple, define the old constant incase anyone still keys
-// off of it.
-#ifndef GTM_SUPPORT_GC
- #define GTM_SUPPORT_GC 0
-#endif
-
-// To simplify support for 64bit (and Leopard in general), we provide the type
-// defines for non Leopard SDKs
-#if !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
- // NSInteger/NSUInteger and Max/Mins
- #ifndef NSINTEGER_DEFINED
- #if (defined(__LP64__) && __LP64__) || NS_BUILD_32_LIKE_64
- typedef long NSInteger;
- typedef unsigned long NSUInteger;
- #else
- typedef int NSInteger;
- typedef unsigned int NSUInteger;
- #endif
- #define NSIntegerMax LONG_MAX
- #define NSIntegerMin LONG_MIN
- #define NSUIntegerMax ULONG_MAX
- #define NSINTEGER_DEFINED 1
- #endif // NSINTEGER_DEFINED
- // CGFloat
- #ifndef CGFLOAT_DEFINED
- #if defined(__LP64__) && __LP64__
- // This really is an untested path (64bit on Tiger?)
- typedef double CGFloat;
- #define CGFLOAT_MIN DBL_MIN
- #define CGFLOAT_MAX DBL_MAX
- #define CGFLOAT_IS_DOUBLE 1
- #else /* !defined(__LP64__) || !__LP64__ */
- typedef float CGFloat;
- #define CGFLOAT_MIN FLT_MIN
- #define CGFLOAT_MAX FLT_MAX
- #define CGFLOAT_IS_DOUBLE 0
- #endif /* !defined(__LP64__) || !__LP64__ */
- #define CGFLOAT_DEFINED 1
- #endif // CGFLOAT_DEFINED
-#endif // MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5
-
-// Some support for advanced clang static analysis functionality
-// See http://clang-analyzer.llvm.org/annotations.html
-#ifndef __has_feature // Optional.
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
-#endif
-
-#ifndef NS_RETURNS_RETAINED
- #if __has_feature(attribute_ns_returns_retained)
- #define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
- #else
- #define NS_RETURNS_RETAINED
- #endif
-#endif
-
-#ifndef NS_RETURNS_NOT_RETAINED
- #if __has_feature(attribute_ns_returns_not_retained)
- #define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
- #else
- #define NS_RETURNS_NOT_RETAINED
- #endif
-#endif
-
-#ifndef CF_RETURNS_RETAINED
- #if __has_feature(attribute_cf_returns_retained)
- #define CF_RETURNS_RETAINED __attribute__((cf_returns_retained))
- #else
- #define CF_RETURNS_RETAINED
- #endif
-#endif
-
-#ifndef CF_RETURNS_NOT_RETAINED
- #if __has_feature(attribute_cf_returns_not_retained)
- #define CF_RETURNS_NOT_RETAINED __attribute__((cf_returns_not_retained))
- #else
- #define CF_RETURNS_NOT_RETAINED
- #endif
-#endif
-
-#ifndef NS_CONSUMED
- #if __has_feature(attribute_ns_consumed)
- #define NS_CONSUMED __attribute__((ns_consumed))
- #else
- #define NS_CONSUMED
- #endif
-#endif
-
-#ifndef CF_CONSUMED
- #if __has_feature(attribute_cf_consumed)
- #define CF_CONSUMED __attribute__((cf_consumed))
- #else
- #define CF_CONSUMED
- #endif
-#endif
-
-#ifndef NS_CONSUMES_SELF
- #if __has_feature(attribute_ns_consumes_self)
- #define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
- #else
- #define NS_CONSUMES_SELF
- #endif
-#endif
-
-// Defined on 10.6 and above.
-#ifndef NS_FORMAT_ARGUMENT
- #define NS_FORMAT_ARGUMENT(A)
-#endif
-
-// Defined on 10.6 and above.
-#ifndef NS_FORMAT_FUNCTION
- #define NS_FORMAT_FUNCTION(F,A)
-#endif
-
-// Defined on 10.6 and above.
-#ifndef CF_FORMAT_ARGUMENT
- #define CF_FORMAT_ARGUMENT(A)
-#endif
-
-// Defined on 10.6 and above.
-#ifndef CF_FORMAT_FUNCTION
- #define CF_FORMAT_FUNCTION(F,A)
-#endif
-
-#ifndef GTM_NONNULL
- #if defined(__has_attribute)
- #if __has_attribute(nonnull)
- #define GTM_NONNULL(x) __attribute__((nonnull x))
- #else
- #define GTM_NONNULL(x)
- #endif
- #else
- #define GTM_NONNULL(x)
- #endif
-#endif
-
-// Invalidates the initializer from which it's called.
-#ifndef GTMInvalidateInitializer
- #if __has_feature(objc_arc)
- #define GTMInvalidateInitializer() \
- do { \
- [self class]; /* Avoid warning of dead store to |self|. */ \
- _GTMDevAssert(NO, @"Invalid initializer."); \
- return nil; \
- } while (0)
- #else
- #define GTMInvalidateInitializer() \
- do { \
- [self release]; \
- _GTMDevAssert(NO, @"Invalid initializer."); \
- return nil; \
- } while (0)
- #endif
-#endif
-
-#ifndef GTMCFAutorelease
- #if __has_feature(objc_arc)
- #define GTMCFAutorelease(x) CFBridgingRelease(x)
- #else
- #define GTMCFAutorelease(x) ([(id)x autorelease])
- #endif
-#endif
-
-#ifdef __OBJC__
-
-// Declared here so that it can easily be used for logging tracking if
-// necessary. See GTMUnitTestDevLog.h for details.
-@class NSString;
-GTM_EXTERN void _GTMUnitTestDevLog(NSString *format, ...) NS_FORMAT_FUNCTION(1, 2);
-
-// Macro to allow you to create NSStrings out of other macros.
-// #define FOO foo
-// NSString *fooString = GTM_NSSTRINGIFY(FOO);
-#if !defined (GTM_NSSTRINGIFY)
- #define GTM_NSSTRINGIFY_INNER(x) @#x
- #define GTM_NSSTRINGIFY(x) GTM_NSSTRINGIFY_INNER(x)
-#endif
-
-// Macro to allow fast enumeration when building for 10.5 or later, and
-// reliance on NSEnumerator for 10.4. Remember, NSDictionary w/ FastEnumeration
-// does keys, so pick the right thing, nothing is done on the FastEnumeration
-// side to be sure you're getting what you wanted.
-#ifndef GTM_FOREACH_OBJECT
- #if TARGET_OS_IPHONE || !(MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_5)
- #define GTM_FOREACH_ENUMEREE(element, enumeration) \
- for (element in enumeration)
- #define GTM_FOREACH_OBJECT(element, collection) \
- for (element in collection)
- #define GTM_FOREACH_KEY(element, collection) \
- for (element in collection)
- #else
- #define GTM_FOREACH_ENUMEREE(element, enumeration) \
- for (NSEnumerator *_ ## element ## _enum = enumeration; \
- (element = [_ ## element ## _enum nextObject]) != nil; )
- #define GTM_FOREACH_OBJECT(element, collection) \
- GTM_FOREACH_ENUMEREE(element, [collection objectEnumerator])
- #define GTM_FOREACH_KEY(element, collection) \
- GTM_FOREACH_ENUMEREE(element, [collection keyEnumerator])
- #endif
-#endif
-
-// ============================================================================
-
-// To simplify support for both Leopard and Snow Leopard we declare
-// the Snow Leopard protocols that we need here.
-#if !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
-#define GTM_10_6_PROTOCOLS_DEFINED 1
-@protocol NSConnectionDelegate
-@end
-@protocol NSAnimationDelegate
-@end
-@protocol NSImageDelegate
-@end
-@protocol NSTabViewDelegate
-@end
-#endif // !defined(GTM_10_6_PROTOCOLS_DEFINED) && !(MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
-
-// GTM_SEL_STRING is for specifying selector (usually property) names to KVC
-// or KVO methods.
-// In debug it will generate warnings for undeclared selectors if
-// -Wunknown-selector is turned on.
-// In release it will have no runtime overhead.
-#ifndef GTM_SEL_STRING
- #ifdef DEBUG
- #define GTM_SEL_STRING(selName) NSStringFromSelector(@selector(selName))
- #else
- #define GTM_SEL_STRING(selName) @#selName
- #endif // DEBUG
-#endif // GTM_SEL_STRING
-
-#endif // __OBJC__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.h b/toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.h
deleted file mode 100644
index c4fd140290..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.h
+++ /dev/null
@@ -1,504 +0,0 @@
-//
-// GTMLogger.h
-//
-// Copyright 2007-2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-// Key Abstractions
-// ----------------
-//
-// This file declares multiple classes and protocols that are used by the
-// GTMLogger logging system. The 4 main abstractions used in this file are the
-// following:
-//
-// * logger (GTMLogger) - The main logging class that users interact with. It
-// has methods for logging at different levels and uses a log writer, a log
-// formatter, and a log filter to get the job done.
-//
-// * log writer (GTMLogWriter) - Writes a given string to some log file, where
-// a "log file" can be a physical file on disk, a POST over HTTP to some URL,
-// or even some in-memory structure (e.g., a ring buffer).
-//
-// * log formatter (GTMLogFormatter) - Given a format string and arguments as
-// a va_list, returns a single formatted NSString. A "formatted string" could
-// be a string with the date prepended, a string with values in a CSV format,
-// or even a string of XML.
-//
-// * log filter (GTMLogFilter) - Given a formatted log message as an NSString
-// and the level at which the message is to be logged, this class will decide
-// whether the given message should be logged or not. This is a flexible way
-// to filter out messages logged at a certain level, messages that contain
-// certain text, or filter nothing out at all. This gives the caller the
-// flexibility to dynamically enable debug logging in Release builds.
-//
-// This file also declares some classes to handle the common log writer, log
-// formatter, and log filter cases. Callers can also create their own writers,
-// formatters, and filters and they can even build them on top of the ones
-// declared here. Keep in mind that your custom writer/formatter/filter may be
-// called from multiple threads, so it must be thread-safe.
-
-#import <Foundation/Foundation.h>
-#import "GTMDefines.h"
-
-// Predeclaration of used protocols that are declared later in this file.
-@protocol GTMLogWriter, GTMLogFormatter, GTMLogFilter;
-
-// GTMLogger
-//
-// GTMLogger is the primary user-facing class for an object-oriented logging
-// system. It is built on the concept of log formatters (GTMLogFormatter), log
-// writers (GTMLogWriter), and log filters (GTMLogFilter). When a message is
-// sent to a GTMLogger to log a message, the message is formatted using the log
-// formatter, then the log filter is consulted to see if the message should be
-// logged, and if so, the message is sent to the log writer to be written out.
-//
-// GTMLogger is intended to be a flexible and thread-safe logging solution. Its
-// flexibility comes from the fact that GTMLogger instances can be customized
-// with user defined formatters, filters, and writers. And these writers,
-// filters, and formatters can be combined, stacked, and customized in arbitrary
-// ways to suit the needs at hand. For example, multiple writers can be used at
-// the same time, and a GTMLogger instance can even be used as another
-// GTMLogger's writer. This allows for arbitrarily deep logging trees.
-//
-// A standard GTMLogger uses a writer that sends messages to standard out, a
-// formatter that smacks a timestamp and a few other bits of interesting
-// information on the message, and a filter that filters out debug messages from
-// release builds. Using the standard log settings, a log message will look like
-// the following:
-//
-// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] foo=<Foo: 0x123>
-//
-// The output contains the date and time of the log message, the name of the
-// process followed by its process ID/thread ID, the log level at which the
-// message was logged (in the previous example the level was 1:
-// kGTMLoggerLevelDebug), and finally, the user-specified log message itself (in
-// this case, the log message was @"foo=%@", foo).
-//
-// Multiple instances of GTMLogger can be created, each configured their own
-// way. Though GTMLogger is not a singleton (in the GoF sense), it does provide
-// access to a shared (i.e., globally accessible) GTMLogger instance. This makes
-// it convenient for all code in a process to use the same GTMLogger instance.
-// The shared GTMLogger instance can also be configured in an arbitrary, and
-// these configuration changes will affect all code that logs through the shared
-// instance.
-
-//
-// Log Levels
-// ----------
-// GTMLogger has 3 different log levels: Debug, Info, and Error. GTMLogger
-// doesn't take any special action based on the log level; it simply forwards
-// this information on to formatters, filters, and writers, each of which may
-// optionally take action based on the level. Since log level filtering is
-// performed at runtime, log messages are typically not filtered out at compile
-// time. The exception to this rule is that calls to the GTMLoggerDebug() macro
-// *ARE* filtered out of non-DEBUG builds. This is to be backwards compatible
-// with behavior that many developers are currently used to. Note that this
-// means that GTMLoggerDebug(@"hi") will be compiled out of Release builds, but
-// [[GTMLogger sharedLogger] logDebug:@"hi"] will NOT be compiled out.
-//
-// Standard loggers are created with the GTMLogLevelFilter log filter, which
-// filters out certain log messages based on log level, and some other settings.
-//
-// In addition to the -logDebug:, -logInfo:, and -logError: methods defined on
-// GTMLogger itself, there are also C macros that make usage of the shared
-// GTMLogger instance very convenient. These macros are:
-//
-// GTMLoggerDebug(...)
-// GTMLoggerInfo(...)
-// GTMLoggerError(...)
-//
-// Again, a notable feature of these macros is that GTMLogDebug() calls *will be
-// compiled out of non-DEBUG builds*.
-//
-// Standard Loggers
-// ----------------
-// GTMLogger has the concept of "standard loggers". A standard logger is simply
-// a logger that is pre-configured with some standard/common writer, formatter,
-// and filter combination. Standard loggers are created using the creation
-// methods beginning with "standard". The alternative to a standard logger is a
-// regular logger, which will send messages to stdout, with no special
-// formatting, and no filtering.
-//
-// How do I use GTMLogger?
-// ----------------------
-// The typical way you will want to use GTMLogger is to simply use the
-// GTMLogger*() macros for logging from code. That way we can easily make
-// changes to the GTMLogger class and simply update the macros accordingly. Only
-// your application startup code (perhaps, somewhere in main()) should use the
-// GTMLogger class directly in order to configure the shared logger, which all
-// of the code using the macros will be using. Again, this is just the typical
-// situation.
-//
-// To be complete, there are cases where you may want to use GTMLogger directly,
-// or even create separate GTMLogger instances for some reason. That's fine,
-// too.
-//
-// Examples
-// --------
-// The following show some common GTMLogger use cases.
-//
-// 1. You want to log something as simply as possible. Also, this call will only
-// appear in debug builds. In non-DEBUG builds it will be completely removed.
-//
-// GTMLoggerDebug(@"foo = %@", foo);
-//
-// 2. The previous example is similar to the following. The major difference is
-// that the previous call (example 1) will be compiled out of Release builds
-// but this statement will not be compiled out.
-//
-// [[GTMLogger sharedLogger] logDebug:@"foo = %@", foo];
-//
-// 3. Send all logging output from the shared logger to a file. We do this by
-// creating an NSFileHandle for writing associated with a file, and setting
-// that file handle as the logger's writer.
-//
-// NSFileHandle *f = [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log"
-// create:YES];
-// [[GTMLogger sharedLogger] setWriter:f];
-// GTMLoggerError(@"hi"); // This will be sent to /tmp/f.log
-//
-// 4. Create a new GTMLogger that will log to a file. This example differs from
-// the previous one because here we create a new GTMLogger that is different
-// from the shared logger.
-//
-// GTMLogger *logger = [GTMLogger standardLoggerWithPath:@"/tmp/temp.log"];
-// [logger logInfo:@"hi temp log file"];
-//
-// 5. Create a logger that writes to stdout and does NOT do any formatting to
-// the log message. This might be useful, for example, when writing a help
-// screen for a command-line tool to standard output.
-//
-// GTMLogger *logger = [GTMLogger logger];
-// [logger logInfo:@"%@ version 0.1 usage", progName];
-//
-// 6. Send log output to stdout AND to a log file. The trick here is that
-// NSArrays function as composite log writers, which means when an array is
-// set as the log writer, it forwards all logging messages to all of its
-// contained GTMLogWriters.
-//
-// // Create array of GTMLogWriters
-// NSArray *writers = [NSArray arrayWithObjects:
-// [NSFileHandle fileHandleForWritingAtPath:@"/tmp/f.log" create:YES],
-// [NSFileHandle fileHandleWithStandardOutput], nil];
-//
-// GTMLogger *logger = [GTMLogger standardLogger];
-// [logger setWriter:writers];
-// [logger logInfo:@"hi"]; // Output goes to stdout and /tmp/f.log
-//
-// For futher details on log writers, formatters, and filters, see the
-// documentation below.
-//
-// NOTE: GTMLogger is application level logging. By default it does nothing
-// with _GTMDevLog/_GTMDevAssert (see GTMDefines.h). An application can choose
-// to bridge _GTMDevLog/_GTMDevAssert to GTMLogger by providing macro
-// definitions in its prefix header (see GTMDefines.h for how one would do
-// that).
-//
-@interface GTMLogger : NSObject {
- @private
- id<GTMLogWriter> writer_;
- id<GTMLogFormatter> formatter_;
- id<GTMLogFilter> filter_;
-}
-
-//
-// Accessors for the shared logger instance
-//
-
-// Returns a shared/global standard GTMLogger instance. Callers should typically
-// use this method to get a GTMLogger instance, unless they explicitly want
-// their own instance to configure for their own needs. This is the only method
-// that returns a shared instance; all the rest return new GTMLogger instances.
-+ (id)sharedLogger;
-
-// Sets the shared logger instance to |logger|. Future calls to +sharedLogger
-// will return |logger| instead.
-+ (void)setSharedLogger:(GTMLogger *)logger;
-
-//
-// Creation methods
-//
-
-// Returns a new autoreleased GTMLogger instance that will log to stdout, using
-// the GTMLogStandardFormatter, and the GTMLogLevelFilter filter.
-+ (id)standardLogger;
-
-// Same as +standardLogger, but logs to stderr.
-+ (id)standardLoggerWithStderr;
-
-// Same as +standardLogger but levels >= kGTMLoggerLevelError are routed to
-// stderr, everything else goes to stdout.
-+ (id)standardLoggerWithStdoutAndStderr;
-
-// Returns a new standard GTMLogger instance with a log writer that will
-// write to the file at |path|, and will use the GTMLogStandardFormatter and
-// GTMLogLevelFilter classes. If |path| does not exist, it will be created.
-+ (id)standardLoggerWithPath:(NSString *)path;
-
-// Returns an autoreleased GTMLogger instance that will use the specified
-// |writer|, |formatter|, and |filter|.
-+ (id)loggerWithWriter:(id<GTMLogWriter>)writer
- formatter:(id<GTMLogFormatter>)formatter
- filter:(id<GTMLogFilter>)filter;
-
-// Returns an autoreleased GTMLogger instance that logs to stdout, with the
-// basic formatter, and no filter. The returned logger differs from the logger
-// returned by +standardLogger because this one does not do any filtering and
-// does not do any special log formatting; this is the difference between a
-// "regular" logger and a "standard" logger.
-+ (id)logger;
-
-// Designated initializer. This method returns a GTMLogger initialized with the
-// specified |writer|, |formatter|, and |filter|. See the setter methods below
-// for what values will be used if nil is passed for a parameter.
-- (id)initWithWriter:(id<GTMLogWriter>)writer
- formatter:(id<GTMLogFormatter>)formatter
- filter:(id<GTMLogFilter>)filter;
-
-//
-// Logging methods
-//
-
-// Logs a message at the debug level (kGTMLoggerLevelDebug).
-- (void)logDebug:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
-// Logs a message at the info level (kGTMLoggerLevelInfo).
-- (void)logInfo:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
-// Logs a message at the error level (kGTMLoggerLevelError).
-- (void)logError:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
-// Logs a message at the assert level (kGTMLoggerLevelAssert).
-- (void)logAssert:(NSString *)fmt, ... NS_FORMAT_FUNCTION(1, 2);
-
-
-//
-// Accessors
-//
-
-// Accessor methods for the log writer. If the log writer is set to nil,
-// [NSFileHandle fileHandleWithStandardOutput] is used.
-- (id<GTMLogWriter>)writer;
-- (void)setWriter:(id<GTMLogWriter>)writer;
-
-// Accessor methods for the log formatter. If the log formatter is set to nil,
-// GTMLogBasicFormatter is used. This formatter will format log messages in a
-// plain printf style.
-- (id<GTMLogFormatter>)formatter;
-- (void)setFormatter:(id<GTMLogFormatter>)formatter;
-
-// Accessor methods for the log filter. If the log filter is set to nil,
-// GTMLogNoFilter is used, which allows all log messages through.
-- (id<GTMLogFilter>)filter;
-- (void)setFilter:(id<GTMLogFilter>)filter;
-
-@end // GTMLogger
-
-
-// Helper functions that are used by the convenience GTMLogger*() macros that
-// enable the logging of function names.
-@interface GTMLogger (GTMLoggerMacroHelpers)
-- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ...
- NS_FORMAT_FUNCTION(2, 3);
-- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ...
- NS_FORMAT_FUNCTION(2, 3);
-- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ...
- NS_FORMAT_FUNCTION(2, 3);
-- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ...
- NS_FORMAT_FUNCTION(2, 3);
-@end // GTMLoggerMacroHelpers
-
-
-// The convenience macros are only defined if they haven't already been defined.
-#ifndef GTMLoggerInfo
-
-// Convenience macros that log to the shared GTMLogger instance. These macros
-// are how users should typically log to GTMLogger. Notice that GTMLoggerDebug()
-// calls will be compiled out of non-Debug builds.
-#define GTMLoggerDebug(...) \
- [[GTMLogger sharedLogger] logFuncDebug:__func__ msg:__VA_ARGS__]
-#define GTMLoggerInfo(...) \
- [[GTMLogger sharedLogger] logFuncInfo:__func__ msg:__VA_ARGS__]
-#define GTMLoggerError(...) \
- [[GTMLogger sharedLogger] logFuncError:__func__ msg:__VA_ARGS__]
-#define GTMLoggerAssert(...) \
- [[GTMLogger sharedLogger] logFuncAssert:__func__ msg:__VA_ARGS__]
-
-// If we're not in a debug build, remove the GTMLoggerDebug statements. This
-// makes calls to GTMLoggerDebug "compile out" of Release builds
-#ifndef DEBUG
-#undef GTMLoggerDebug
-#define GTMLoggerDebug(...) do {} while(0)
-#endif
-
-#endif // !defined(GTMLoggerInfo)
-
-// Log levels.
-typedef enum {
- kGTMLoggerLevelUnknown,
- kGTMLoggerLevelDebug,
- kGTMLoggerLevelInfo,
- kGTMLoggerLevelError,
- kGTMLoggerLevelAssert,
-} GTMLoggerLevel;
-
-
-//
-// Log Writers
-//
-
-// Protocol to be implemented by a GTMLogWriter instance.
-@protocol GTMLogWriter <NSObject>
-// Writes the given log message to where the log writer is configured to write.
-- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level;
-@end // GTMLogWriter
-
-
-// Simple category on NSFileHandle that makes NSFileHandles valid log writers.
-// This is convenient because something like, say, +fileHandleWithStandardError
-// now becomes a valid log writer. Log messages are written to the file handle
-// with a newline appended.
-@interface NSFileHandle (GTMFileHandleLogWriter) <GTMLogWriter>
-// Opens the file at |path| in append mode, and creates the file with |mode|
-// if it didn't previously exist.
-+ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode;
-@end // NSFileHandle
-
-
-// This category makes NSArray a GTMLogWriter that can be composed of other
-// GTMLogWriters. This is the classic Composite GoF design pattern. When the
-// GTMLogWriter -logMessage:level: message is sent to the array, the array
-// forwards the message to all of its elements that implement the GTMLogWriter
-// protocol.
-//
-// This is useful in situations where you would like to send log output to
-// multiple log writers at the same time. Simply create an NSArray of the log
-// writers you wish to use, then set the array as the "writer" for your
-// GTMLogger instance.
-@interface NSArray (GTMArrayCompositeLogWriter) <GTMLogWriter>
-@end // GTMArrayCompositeLogWriter
-
-
-// This category adapts the GTMLogger interface so that it can be used as a log
-// writer; it's an "adapter" in the GoF Adapter pattern sense.
-//
-// This is useful when you want to configure a logger to log to a specific
-// writer with a specific formatter and/or filter. But you want to also compose
-// that with a different log writer that may have its own formatter and/or
-// filter.
-@interface GTMLogger (GTMLoggerLogWriter) <GTMLogWriter>
-@end // GTMLoggerLogWriter
-
-
-//
-// Log Formatters
-//
-
-// Protocol to be implemented by a GTMLogFormatter instance.
-@protocol GTMLogFormatter <NSObject>
-// Returns a formatted string using the format specified in |fmt| and the va
-// args specified in |args|.
-- (NSString *)stringForFunc:(NSString *)func
- withFormat:(NSString *)fmt
- valist:(va_list)args
- level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0);
-@end // GTMLogFormatter
-
-
-// A basic log formatter that formats a string the same way that NSLog (or
-// printf) would. It does not do anything fancy, nor does it add any data of its
-// own.
-@interface GTMLogBasicFormatter : NSObject <GTMLogFormatter>
-
-// Helper method for prettying C99 __func__ and GCC __PRETTY_FUNCTION__
-- (NSString *)prettyNameForFunc:(NSString *)func;
-
-@end // GTMLogBasicFormatter
-
-
-// A log formatter that formats the log string like the basic formatter, but
-// also prepends a timestamp and some basic process info to the message, as
-// shown in the following sample output.
-// 2007-12-30 10:29:24.177 myapp[4588/0xa07d0f60] [lvl=1] log mesage here
-@interface GTMLogStandardFormatter : GTMLogBasicFormatter {
- @private
- NSDateFormatter *dateFormatter_; // yyyy-MM-dd HH:mm:ss.SSS
- NSString *pname_;
- pid_t pid_;
-}
-@end // GTMLogStandardFormatter
-
-
-//
-// Log Filters
-//
-
-// Protocol to be imlemented by a GTMLogFilter instance.
-@protocol GTMLogFilter <NSObject>
-// Returns YES if |msg| at |level| should be filtered out; NO otherwise.
-- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level;
-@end // GTMLogFilter
-
-
-// A log filter that filters messages at the kGTMLoggerLevelDebug level out of
-// non-debug builds. Messages at the kGTMLoggerLevelInfo level are also filtered
-// out of non-debug builds unless GTMVerboseLogging is set in the environment or
-// the processes's defaults. Messages at the kGTMLoggerLevelError level are
-// never filtered.
-@interface GTMLogLevelFilter : NSObject <GTMLogFilter>
-@end // GTMLogLevelFilter
-
-// A simple log filter that does NOT filter anything out;
-// -filterAllowsMessage:level will always return YES. This can be a convenient
-// way to enable debug-level logging in release builds (if you so desire).
-@interface GTMLogNoFilter : NSObject <GTMLogFilter>
-@end // GTMLogNoFilter
-
-
-// Base class for custom level filters. Not for direct use, use the minimum
-// or maximum level subclasses below.
-@interface GTMLogAllowedLevelFilter : NSObject <GTMLogFilter> {
- @private
- NSIndexSet *allowedLevels_;
-}
-@end
-
-// A log filter that allows you to set a minimum log level. Messages below this
-// level will be filtered.
-@interface GTMLogMininumLevelFilter : GTMLogAllowedLevelFilter
-
-// Designated initializer, logs at levels < |level| will be filtered.
-- (id)initWithMinimumLevel:(GTMLoggerLevel)level;
-
-@end
-
-// A log filter that allows you to set a maximum log level. Messages whose level
-// exceeds this level will be filtered. This is really only useful if you have
-// a composite GTMLogger that is sending the other messages elsewhere.
-@interface GTMLogMaximumLevelFilter : GTMLogAllowedLevelFilter
-
-// Designated initializer, logs at levels > |level| will be filtered.
-- (id)initWithMaximumLevel:(GTMLoggerLevel)level;
-
-@end
-
-
-// For subclasses only
-@interface GTMLogger (PrivateMethods)
-
-- (void)logInternalFunc:(const char *)func
- format:(NSString *)fmt
- valist:(va_list)args
- level:(GTMLoggerLevel)level NS_FORMAT_FUNCTION(2, 0);
-
-@end
-
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.m b/toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.m
deleted file mode 100644
index ebc5836a25..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/GTMLogger.m
+++ /dev/null
@@ -1,611 +0,0 @@
-//
-// GTMLogger.m
-//
-// Copyright 2007-2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-#import "GTMLogger.h"
-#import <fcntl.h>
-#import <unistd.h>
-#import <stdlib.h>
-#import <pthread.h>
-
-
-#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42)
-// Some versions of GCC (4.2 and below AFAIK) aren't great about supporting
-// -Wmissing-format-attribute
-// when the function is anything more complex than foo(NSString *fmt, ...).
-// You see the error inside the function when you turn ... into va_args and
-// attempt to call another function (like vsprintf for example).
-// So we just shut off the warning for this file. We reenable it at the end.
-#pragma GCC diagnostic ignored "-Wmissing-format-attribute"
-#endif // !__clang__
-
-// Reference to the shared GTMLogger instance. This is not a singleton, it's
-// just an easy reference to one shared instance.
-static GTMLogger *gSharedLogger = nil;
-
-
-@implementation GTMLogger
-
-// Returns a pointer to the shared logger instance. If none exists, a standard
-// logger is created and returned.
-+ (id)sharedLogger {
- @synchronized(self) {
- if (gSharedLogger == nil) {
- gSharedLogger = [[self standardLogger] retain];
- }
- }
- return [[gSharedLogger retain] autorelease];
-}
-
-+ (void)setSharedLogger:(GTMLogger *)logger {
- @synchronized(self) {
- [gSharedLogger autorelease];
- gSharedLogger = [logger retain];
- }
-}
-
-+ (id)standardLogger {
- // Don't trust NSFileHandle not to throw
- @try {
- id<GTMLogWriter> writer = [NSFileHandle fileHandleWithStandardOutput];
- id<GTMLogFormatter> fr = [[[GTMLogStandardFormatter alloc] init]
- autorelease];
- id<GTMLogFilter> filter = [[[GTMLogLevelFilter alloc] init] autorelease];
- return [[[self alloc] initWithWriter:writer
- formatter:fr
- filter:filter] autorelease];
- }
- @catch (id e) {
- // Ignored
- }
- return nil;
-}
-
-+ (id)standardLoggerWithStderr {
- // Don't trust NSFileHandle not to throw
- @try {
- id me = [self standardLogger];
- [me setWriter:[NSFileHandle fileHandleWithStandardError]];
- return me;
- }
- @catch (id e) {
- // Ignored
- }
- return nil;
-}
-
-+ (id)standardLoggerWithStdoutAndStderr {
- // We're going to take advantage of the GTMLogger to GTMLogWriter adaptor
- // and create a composite logger that an outer "standard" logger can use
- // as a writer. Our inner loggers should apply no formatting since the main
- // logger does that and we want the caller to be able to change formatters
- // or add writers without knowing the inner structure of our composite.
-
- // Don't trust NSFileHandle not to throw
- @try {
- GTMLogBasicFormatter *formatter = [[[GTMLogBasicFormatter alloc] init]
- autorelease];
- GTMLogger *stdoutLogger =
- [self loggerWithWriter:[NSFileHandle fileHandleWithStandardOutput]
- formatter:formatter
- filter:[[[GTMLogMaximumLevelFilter alloc]
- initWithMaximumLevel:kGTMLoggerLevelInfo]
- autorelease]];
- GTMLogger *stderrLogger =
- [self loggerWithWriter:[NSFileHandle fileHandleWithStandardError]
- formatter:formatter
- filter:[[[GTMLogMininumLevelFilter alloc]
- initWithMinimumLevel:kGTMLoggerLevelError]
- autorelease]];
- GTMLogger *compositeWriter =
- [self loggerWithWriter:[NSArray arrayWithObjects:
- stdoutLogger, stderrLogger, nil]
- formatter:formatter
- filter:[[[GTMLogNoFilter alloc] init] autorelease]];
- GTMLogger *outerLogger = [self standardLogger];
- [outerLogger setWriter:compositeWriter];
- return outerLogger;
- }
- @catch (id e) {
- // Ignored
- }
- return nil;
-}
-
-+ (id)standardLoggerWithPath:(NSString *)path {
- @try {
- NSFileHandle *fh = [NSFileHandle fileHandleForLoggingAtPath:path mode:0644];
- if (fh == nil) return nil;
- id me = [self standardLogger];
- [me setWriter:fh];
- return me;
- }
- @catch (id e) {
- // Ignored
- }
- return nil;
-}
-
-+ (id)loggerWithWriter:(id<GTMLogWriter>)writer
- formatter:(id<GTMLogFormatter>)formatter
- filter:(id<GTMLogFilter>)filter {
- return [[[self alloc] initWithWriter:writer
- formatter:formatter
- filter:filter] autorelease];
-}
-
-+ (id)logger {
- return [[[self alloc] init] autorelease];
-}
-
-- (id)init {
- return [self initWithWriter:nil formatter:nil filter:nil];
-}
-
-- (id)initWithWriter:(id<GTMLogWriter>)writer
- formatter:(id<GTMLogFormatter>)formatter
- filter:(id<GTMLogFilter>)filter {
- if ((self = [super init])) {
- [self setWriter:writer];
- [self setFormatter:formatter];
- [self setFilter:filter];
- }
- return self;
-}
-
-- (void)dealloc {
- // Unlikely, but |writer_| may be an NSFileHandle, which can throw
- @try {
- [formatter_ release];
- [filter_ release];
- [writer_ release];
- }
- @catch (id e) {
- // Ignored
- }
- [super dealloc];
-}
-
-- (id<GTMLogWriter>)writer {
- return [[writer_ retain] autorelease];
-}
-
-- (void)setWriter:(id<GTMLogWriter>)writer {
- @synchronized(self) {
- [writer_ autorelease];
- writer_ = nil;
- if (writer == nil) {
- // Try to use stdout, but don't trust NSFileHandle
- @try {
- writer_ = [[NSFileHandle fileHandleWithStandardOutput] retain];
- }
- @catch (id e) {
- // Leave |writer_| nil
- }
- } else {
- writer_ = [writer retain];
- }
- }
-}
-
-- (id<GTMLogFormatter>)formatter {
- return [[formatter_ retain] autorelease];
-}
-
-- (void)setFormatter:(id<GTMLogFormatter>)formatter {
- @synchronized(self) {
- [formatter_ autorelease];
- formatter_ = nil;
- if (formatter == nil) {
- @try {
- formatter_ = [[GTMLogBasicFormatter alloc] init];
- }
- @catch (id e) {
- // Leave |formatter_| nil
- }
- } else {
- formatter_ = [formatter retain];
- }
- }
-}
-
-- (id<GTMLogFilter>)filter {
- return [[filter_ retain] autorelease];
-}
-
-- (void)setFilter:(id<GTMLogFilter>)filter {
- @synchronized(self) {
- [filter_ autorelease];
- filter_ = nil;
- if (filter == nil) {
- @try {
- filter_ = [[GTMLogNoFilter alloc] init];
- }
- @catch (id e) {
- // Leave |filter_| nil
- }
- } else {
- filter_ = [filter retain];
- }
- }
-}
-
-- (void)logDebug:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelDebug];
- va_end(args);
-}
-
-- (void)logInfo:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelInfo];
- va_end(args);
-}
-
-- (void)logError:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelError];
- va_end(args);
-}
-
-- (void)logAssert:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:NULL format:fmt valist:args level:kGTMLoggerLevelAssert];
- va_end(args);
-}
-
-@end // GTMLogger
-
-@implementation GTMLogger (GTMLoggerMacroHelpers)
-
-- (void)logFuncDebug:(const char *)func msg:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelDebug];
- va_end(args);
-}
-
-- (void)logFuncInfo:(const char *)func msg:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelInfo];
- va_end(args);
-}
-
-- (void)logFuncError:(const char *)func msg:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelError];
- va_end(args);
-}
-
-- (void)logFuncAssert:(const char *)func msg:(NSString *)fmt, ... {
- va_list args;
- va_start(args, fmt);
- [self logInternalFunc:func format:fmt valist:args level:kGTMLoggerLevelAssert];
- va_end(args);
-}
-
-@end // GTMLoggerMacroHelpers
-
-@implementation GTMLogger (PrivateMethods)
-
-- (void)logInternalFunc:(const char *)func
- format:(NSString *)fmt
- valist:(va_list)args
- level:(GTMLoggerLevel)level {
- // Primary point where logging happens, logging should never throw, catch
- // everything.
- @try {
- NSString *fname = func ? [NSString stringWithUTF8String:func] : nil;
- NSString *msg = [formatter_ stringForFunc:fname
- withFormat:fmt
- valist:args
- level:level];
- if (msg && [filter_ filterAllowsMessage:msg level:level])
- [writer_ logMessage:msg level:level];
- }
- @catch (id e) {
- // Ignored
- }
-}
-
-@end // PrivateMethods
-
-
-@implementation NSFileHandle (GTMFileHandleLogWriter)
-
-+ (id)fileHandleForLoggingAtPath:(NSString *)path mode:(mode_t)mode {
- int fd = -1;
- if (path) {
- int flags = O_WRONLY | O_APPEND | O_CREAT;
- fd = open([path fileSystemRepresentation], flags, mode);
- }
- if (fd == -1) return nil;
- return [[[self alloc] initWithFileDescriptor:fd
- closeOnDealloc:YES] autorelease];
-}
-
-- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level {
- @synchronized(self) {
- // Closed pipes should not generate exceptions in our caller. Catch here
- // as well [GTMLogger logInternalFunc:...] so that an exception in this
- // writer does not prevent other writers from having a chance.
- @try {
- NSString *line = [NSString stringWithFormat:@"%@\n", msg];
- [self writeData:[line dataUsingEncoding:NSUTF8StringEncoding]];
- }
- @catch (id e) {
- // Ignored
- }
- }
-}
-
-@end // GTMFileHandleLogWriter
-
-
-@implementation NSArray (GTMArrayCompositeLogWriter)
-
-- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level {
- @synchronized(self) {
- id<GTMLogWriter> child = nil;
- GTM_FOREACH_OBJECT(child, self) {
- if ([child conformsToProtocol:@protocol(GTMLogWriter)])
- [child logMessage:msg level:level];
- }
- }
-}
-
-@end // GTMArrayCompositeLogWriter
-
-
-@implementation GTMLogger (GTMLoggerLogWriter)
-
-- (void)logMessage:(NSString *)msg level:(GTMLoggerLevel)level {
- switch (level) {
- case kGTMLoggerLevelDebug:
- [self logDebug:@"%@", msg];
- break;
- case kGTMLoggerLevelInfo:
- [self logInfo:@"%@", msg];
- break;
- case kGTMLoggerLevelError:
- [self logError:@"%@", msg];
- break;
- case kGTMLoggerLevelAssert:
- [self logAssert:@"%@", msg];
- break;
- default:
- // Ignore the message.
- break;
- }
-}
-
-@end // GTMLoggerLogWriter
-
-
-@implementation GTMLogBasicFormatter
-
-- (NSString *)prettyNameForFunc:(NSString *)func {
- NSString *name = [func stringByTrimmingCharactersInSet:
- [NSCharacterSet whitespaceAndNewlineCharacterSet]];
- NSString *function = @"(unknown)";
- if ([name length]) {
- if (// Objective C __func__ and __PRETTY_FUNCTION__
- [name hasPrefix:@"-["] || [name hasPrefix:@"+["] ||
- // C++ __PRETTY_FUNCTION__ and other preadorned formats
- [name hasSuffix:@")"]) {
- function = name;
- } else {
- // Assume C99 __func__
- function = [NSString stringWithFormat:@"%@()", name];
- }
- }
- return function;
-}
-
-- (NSString *)stringForFunc:(NSString *)func
- withFormat:(NSString *)fmt
- valist:(va_list)args
- level:(GTMLoggerLevel)level {
- // Performance note: We may want to do a quick check here to see if |fmt|
- // contains a '%', and if not, simply return 'fmt'.
- if (!(fmt && args)) return nil;
- return [[[NSString alloc] initWithFormat:fmt arguments:args] autorelease];
-}
-
-@end // GTMLogBasicFormatter
-
-
-@implementation GTMLogStandardFormatter
-
-- (id)init {
- if ((self = [super init])) {
- dateFormatter_ = [[NSDateFormatter alloc] init];
- [dateFormatter_ setFormatterBehavior:NSDateFormatterBehavior10_4];
- [dateFormatter_ setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];
- pname_ = [[[NSProcessInfo processInfo] processName] copy];
- pid_ = [[NSProcessInfo processInfo] processIdentifier];
- if (!(dateFormatter_ && pname_)) {
- [self release];
- return nil;
- }
- }
- return self;
-}
-
-- (void)dealloc {
- [dateFormatter_ release];
- [pname_ release];
- [super dealloc];
-}
-
-- (NSString *)stringForFunc:(NSString *)func
- withFormat:(NSString *)fmt
- valist:(va_list)args
- level:(GTMLoggerLevel)level {
- NSString *tstamp = nil;
- @synchronized (dateFormatter_) {
- tstamp = [dateFormatter_ stringFromDate:[NSDate date]];
- }
- return [NSString stringWithFormat:@"%@ %@[%d/%p] [lvl=%d] %@ %@",
- tstamp, pname_, pid_, pthread_self(),
- level, [self prettyNameForFunc:func],
- // |super| has guard for nil |fmt| and |args|
- [super stringForFunc:func withFormat:fmt valist:args level:level]];
-}
-
-@end // GTMLogStandardFormatter
-
-
-@implementation GTMLogLevelFilter
-
-// Check the environment and the user preferences for the GTMVerboseLogging key
-// to see if verbose logging has been enabled. The environment variable will
-// override the defaults setting, so check the environment first.
-// COV_NF_START
-static BOOL IsVerboseLoggingEnabled(void) {
- static NSString *const kVerboseLoggingKey = @"GTMVerboseLogging";
- NSString *value = [[[NSProcessInfo processInfo] environment]
- objectForKey:kVerboseLoggingKey];
- if (value) {
- // Emulate [NSString boolValue] for pre-10.5
- value = [value stringByTrimmingCharactersInSet:
- [NSCharacterSet whitespaceAndNewlineCharacterSet]];
- if ([[value uppercaseString] hasPrefix:@"Y"] ||
- [[value uppercaseString] hasPrefix:@"T"] ||
- [value intValue]) {
- return YES;
- } else {
- return NO;
- }
- }
- return [[NSUserDefaults standardUserDefaults] boolForKey:kVerboseLoggingKey];
-}
-// COV_NF_END
-
-// In DEBUG builds, log everything. If we're not in a debug build we'll assume
-// that we're in a Release build.
-- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level {
-#if defined(DEBUG) && DEBUG
- return YES;
-#endif
-
- BOOL allow = YES;
-
- switch (level) {
- case kGTMLoggerLevelDebug:
- allow = NO;
- break;
- case kGTMLoggerLevelInfo:
- allow = IsVerboseLoggingEnabled();
- break;
- case kGTMLoggerLevelError:
- allow = YES;
- break;
- case kGTMLoggerLevelAssert:
- allow = YES;
- break;
- default:
- allow = YES;
- break;
- }
-
- return allow;
-}
-
-@end // GTMLogLevelFilter
-
-
-@implementation GTMLogNoFilter
-
-- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level {
- return YES; // Allow everything through
-}
-
-@end // GTMLogNoFilter
-
-
-@implementation GTMLogAllowedLevelFilter
-
-// Private designated initializer
-- (id)initWithAllowedLevels:(NSIndexSet *)levels {
- self = [super init];
- if (self != nil) {
- allowedLevels_ = [levels retain];
- // Cap min/max level
- if (!allowedLevels_ ||
- // NSIndexSet is unsigned so only check the high bound, but need to
- // check both first and last index because NSIndexSet appears to allow
- // wraparound.
- ([allowedLevels_ firstIndex] > kGTMLoggerLevelAssert) ||
- ([allowedLevels_ lastIndex] > kGTMLoggerLevelAssert)) {
- [self release];
- return nil;
- }
- }
- return self;
-}
-
-- (id)init {
- // Allow all levels in default init
- return [self initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange:
- NSMakeRange(kGTMLoggerLevelUnknown,
- (kGTMLoggerLevelAssert - kGTMLoggerLevelUnknown + 1))]];
-}
-
-- (void)dealloc {
- [allowedLevels_ release];
- [super dealloc];
-}
-
-- (BOOL)filterAllowsMessage:(NSString *)msg level:(GTMLoggerLevel)level {
- return [allowedLevels_ containsIndex:level];
-}
-
-@end // GTMLogAllowedLevelFilter
-
-
-@implementation GTMLogMininumLevelFilter
-
-- (id)initWithMinimumLevel:(GTMLoggerLevel)level {
- return [super initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange:
- NSMakeRange(level,
- (kGTMLoggerLevelAssert - level + 1))]];
-}
-
-@end // GTMLogMininumLevelFilter
-
-
-@implementation GTMLogMaximumLevelFilter
-
-- (id)initWithMaximumLevel:(GTMLoggerLevel)level {
- return [super initWithAllowedLevels:[NSIndexSet indexSetWithIndexesInRange:
- NSMakeRange(kGTMLoggerLevelUnknown, level + 1)]];
-}
-
-@end // GTMLogMaximumLevelFilter
-
-#if !defined(__clang__) && (__GNUC__*10+__GNUC_MINOR__ >= 42)
-// See comment at top of file.
-#pragma GCC diagnostic error "-Wmissing-format-attribute"
-#endif // !__clang__
-
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.h b/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.h
deleted file mode 100644
index 42e8fed390..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// HTTPMultipartUpload: A multipart/form-data HTTP uploader.
-// Each parameter pair is sent as a boundary
-// Each file is sent with a name field in addition to the filename and data
-// The data will be sent synchronously.
-
-#import <Foundation/Foundation.h>
-
-@interface HTTPMultipartUpload : NSObject {
- @protected
- NSURL *url_; // The destination URL (STRONG)
- NSDictionary *parameters_; // The key/value pairs for sending data (STRONG)
- NSMutableDictionary *files_; // Dictionary of name/file-path (STRONG)
- NSString *boundary_; // The boundary string (STRONG)
- NSHTTPURLResponse *response_; // The response from the send (STRONG)
-}
-
-- (id)initWithURL:(NSURL *)url;
-
-- (NSURL *)URL;
-
-- (void)setParameters:(NSDictionary *)parameters;
-- (NSDictionary *)parameters;
-
-- (void)addFileAtPath:(NSString *)path name:(NSString *)name;
-- (void)addFileContents:(NSData *)data name:(NSString *)name;
-- (NSDictionary *)files;
-
-// Set the data and return the response
-- (NSData *)send:(NSError **)error;
-- (NSHTTPURLResponse *)response;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m b/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m
deleted file mode 100644
index 9ac886d53e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/HTTPMultipartUpload.m
+++ /dev/null
@@ -1,269 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#import "HTTPMultipartUpload.h"
-#import "GTMDefines.h"
-
-// As -[NSString stringByAddingPercentEscapesUsingEncoding:] has been
-// deprecated with iOS 9.0 / OS X 10.11 SDKs, this function re-implements it
-// using -[NSString stringByAddingPercentEncodingWithAllowedCharacters:] when
-// using those SDKs.
-static NSString *PercentEncodeNSString(NSString *key) {
-#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && defined(__IPHONE_9_0) && \
- __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0) || \
- (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
- defined(MAC_OS_X_VERSION_10_11) && \
- MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)
- return [key stringByAddingPercentEncodingWithAllowedCharacters:
- [NSCharacterSet URLQueryAllowedCharacterSet]];
-#else
- return [key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
-#endif
-}
-
-// As -[NSURLConnection sendSynchronousRequest:returningResponse:error:] has
-// been deprecated with iOS 9.0 / OS X 10.11 SDKs, this function re-implements
-// it using -[NSURLSession dataTaskWithRequest:completionHandler:] when using
-// those SDKs.
-static NSData *SendSynchronousNSURLRequest(NSURLRequest *req,
- NSURLResponse **out_response,
- NSError **out_error) {
-#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && defined(__IPHONE_9_0) && \
- __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_9_0) || \
- (defined(MAC_OS_X_VERSION_MIN_REQUIRED) && \
- defined(MAC_OS_X_VERSION_10_11) && \
- MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_11)
- __block NSData* result = nil;
- __block NSError* error = nil;
- __block NSURLResponse* response = nil;
- dispatch_semaphore_t wait_semaphone = dispatch_semaphore_create(0);
- [[[NSURLSession sharedSession]
- dataTaskWithRequest:req
- completionHandler:^(NSData *data,
- NSURLResponse *resp,
- NSError *err) {
- if (out_error)
- error = [err retain];
- if (out_response)
- response = [resp retain];
- if (err == nil)
- result = [data retain];
- dispatch_semaphore_signal(wait_semaphone);
- }] resume];
- dispatch_semaphore_wait(wait_semaphone, DISPATCH_TIME_FOREVER);
- dispatch_release(wait_semaphone);
- if (out_error)
- *out_error = [error autorelease];
- if (out_response)
- *out_response = [response autorelease];
- return [result autorelease];
-#else
- return [NSURLConnection sendSynchronousRequest:req
- returningResponse:out_response
- error:out_error];
-#endif
-}
-@interface HTTPMultipartUpload(PrivateMethods)
-- (NSString *)multipartBoundary;
-// Each of the following methods will append the starting multipart boundary,
-// but not the ending one.
-- (NSData *)formDataForKey:(NSString *)key value:(NSString *)value;
-- (NSData *)formDataForFileContents:(NSData *)contents name:(NSString *)name;
-- (NSData *)formDataForFile:(NSString *)file name:(NSString *)name;
-@end
-
-@implementation HTTPMultipartUpload
-//=============================================================================
-#pragma mark -
-#pragma mark || Private ||
-//=============================================================================
-- (NSString *)multipartBoundary {
- // The boundary has 27 '-' characters followed by 16 hex digits
- return [NSString stringWithFormat:@"---------------------------%08X%08X",
- rand(), rand()];
-}
-
-//=============================================================================
-- (NSData *)formDataForKey:(NSString *)key value:(NSString *)value {
- NSString *escaped = PercentEncodeNSString(key);
- NSString *fmt =
- @"--%@\r\nContent-Disposition: form-data; name=\"%@\"\r\n\r\n%@\r\n";
- NSString *form = [NSString stringWithFormat:fmt, boundary_, escaped, value];
-
- return [form dataUsingEncoding:NSUTF8StringEncoding];
-}
-
-//=============================================================================
-- (NSData *)formDataForFileContents:(NSData *)contents name:(NSString *)name {
- NSMutableData *data = [NSMutableData data];
- NSString *escaped = PercentEncodeNSString(name);
- NSString *fmt = @"--%@\r\nContent-Disposition: form-data; name=\"%@\"; "
- "filename=\"minidump.dmp\"\r\nContent-Type: application/octet-stream\r\n\r\n";
- NSString *pre = [NSString stringWithFormat:fmt, boundary_, escaped];
-
- [data appendData:[pre dataUsingEncoding:NSUTF8StringEncoding]];
- [data appendData:contents];
-
- return data;
-}
-
-//=============================================================================
-- (NSData *)formDataForFile:(NSString *)file name:(NSString *)name {
- NSData *contents = [NSData dataWithContentsOfFile:file];
-
- return [self formDataForFileContents:contents name:name];
-}
-
-//=============================================================================
-#pragma mark -
-#pragma mark || Public ||
-//=============================================================================
-- (id)initWithURL:(NSURL *)url {
- if ((self = [super init])) {
- url_ = [url copy];
- boundary_ = [[self multipartBoundary] retain];
- files_ = [[NSMutableDictionary alloc] init];
- }
-
- return self;
-}
-
-//=============================================================================
-- (void)dealloc {
- [url_ release];
- [parameters_ release];
- [files_ release];
- [boundary_ release];
- [response_ release];
-
- [super dealloc];
-}
-
-//=============================================================================
-- (NSURL *)URL {
- return url_;
-}
-
-//=============================================================================
-- (void)setParameters:(NSDictionary *)parameters {
- if (parameters != parameters_) {
- [parameters_ release];
- parameters_ = [parameters copy];
- }
-}
-
-//=============================================================================
-- (NSDictionary *)parameters {
- return parameters_;
-}
-
-//=============================================================================
-- (void)addFileAtPath:(NSString *)path name:(NSString *)name {
- [files_ setObject:path forKey:name];
-}
-
-//=============================================================================
-- (void)addFileContents:(NSData *)data name:(NSString *)name {
- [files_ setObject:data forKey:name];
-}
-
-//=============================================================================
-- (NSDictionary *)files {
- return files_;
-}
-
-//=============================================================================
-- (NSData *)send:(NSError **)error {
- NSMutableURLRequest *req =
- [[NSMutableURLRequest alloc]
- initWithURL:url_ cachePolicy:NSURLRequestUseProtocolCachePolicy
- timeoutInterval:10.0 ];
-
- NSMutableData *postBody = [NSMutableData data];
-
- [req setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@",
- boundary_] forHTTPHeaderField:@"Content-type"];
-
- // Add any parameters to the message
- NSArray *parameterKeys = [parameters_ allKeys];
- NSString *key;
-
- NSInteger count = [parameterKeys count];
- for (NSInteger i = 0; i < count; ++i) {
- key = [parameterKeys objectAtIndex:i];
- [postBody appendData:[self formDataForKey:key
- value:[parameters_ objectForKey:key]]];
- }
-
- // Add any files to the message
- NSArray *fileNames = [files_ allKeys];
- count = [fileNames count];
- for (NSInteger i = 0; i < count; ++i) {
- NSString *name = [fileNames objectAtIndex:i];
- id fileOrData = [files_ objectForKey:name];
- NSData *fileData;
-
- // The object can be either the path to a file (NSString) or the contents
- // of the file (NSData).
- if ([fileOrData isKindOfClass:[NSData class]])
- fileData = [self formDataForFileContents:fileOrData name:name];
- else
- fileData = [self formDataForFile:fileOrData name:name];
-
- [postBody appendData:fileData];
- }
-
- NSString *epilogue = [NSString stringWithFormat:@"\r\n--%@--\r\n", boundary_];
- [postBody appendData:[epilogue dataUsingEncoding:NSUTF8StringEncoding]];
-
- [req setHTTPBody:postBody];
- [req setHTTPMethod:@"POST"];
-
- [response_ release];
- response_ = nil;
-
- NSData *data = nil;
- if ([[req URL] isFileURL]) {
- [[req HTTPBody] writeToURL:[req URL] options:0 error:error];
- } else {
- NSURLResponse *response = nil;
- data = SendSynchronousNSURLRequest(req, &response, error);
- response_ = (NSHTTPURLResponse *)[response retain];
- }
- [req release];
-
- return data;
-}
-
-//=============================================================================
-- (NSHTTPURLResponse *)response {
- return response_;
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h b/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h
deleted file mode 100644
index 8df9165bb3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.h
+++ /dev/null
@@ -1,301 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// MachIPC.h
-//
-// Some helpful wrappers for using Mach IPC calls
-
-#ifndef MACH_IPC_H__
-#define MACH_IPC_H__
-
-#import <mach/mach.h>
-#import <mach/message.h>
-#import <servers/bootstrap.h>
-#import <sys/types.h>
-
-#import <CoreServices/CoreServices.h>
-
-//==============================================================================
-// DISCUSSION:
-//
-// The three main classes of interest are
-//
-// MachMessage: a wrapper for a mach message of the following form
-// mach_msg_header_t
-// mach_msg_body_t
-// optional descriptors
-// optional extra message data
-//
-// MachReceiveMessage and MachSendMessage subclass MachMessage
-// and are used instead of MachMessage which is an abstract base class
-//
-// ReceivePort:
-// Represents a mach port for which we have receive rights
-//
-// MachPortSender:
-// Represents a mach port for which we have send rights
-//
-// Here's an example to receive a message on a server port:
-//
-// // This creates our named server port
-// ReceivePort receivePort("com.Google.MyService");
-//
-// MachReceiveMessage message;
-// kern_return_t result = receivePort.WaitForMessage(&message, 0);
-//
-// if (result == KERN_SUCCESS && message.GetMessageID() == 57) {
-// mach_port_t task = message.GetTranslatedPort(0);
-// mach_port_t thread = message.GetTranslatedPort(1);
-//
-// char *messageString = message.GetData();
-//
-// printf("message string = %s\n", messageString);
-// }
-//
-// Here is an example of using these classes to send a message to this port:
-//
-// // send to already named port
-// MachPortSender sender("com.Google.MyService");
-// MachSendMessage message(57); // our message ID is 57
-//
-// // add some ports to be translated for us
-// message.AddDescriptor(mach_task_self()); // our task
-// message.AddDescriptor(mach_thread_self()); // this thread
-//
-// char messageString[] = "Hello server!\n";
-// message.SetData(messageString, strlen(messageString)+1);
-//
-// kern_return_t result = sender.SendMessage(message, 1000); // timeout 1000ms
-//
-
-namespace google_breakpad {
-#define PRINT_MACH_RESULT(result_, message_) \
- printf(message_" %s (%d)\n", mach_error_string(result_), result_ );
-
-//==============================================================================
-// A wrapper class for mach_msg_port_descriptor_t (with same memory layout)
-// with convenient constructors and accessors
-class MachMsgPortDescriptor : public mach_msg_port_descriptor_t {
- public:
- // General-purpose constructor
- MachMsgPortDescriptor(mach_port_t in_name,
- mach_msg_type_name_t in_disposition) {
- name = in_name;
- pad1 = 0;
- pad2 = 0;
- disposition = in_disposition;
- type = MACH_MSG_PORT_DESCRIPTOR;
- }
-
- // For passing send rights to a port
- MachMsgPortDescriptor(mach_port_t in_name) {
- name = in_name;
- pad1 = 0;
- pad2 = 0;
- disposition = MACH_MSG_TYPE_COPY_SEND;
- type = MACH_MSG_PORT_DESCRIPTOR;
- }
-
- // Copy constructor
- MachMsgPortDescriptor(const MachMsgPortDescriptor& desc) {
- name = desc.name;
- pad1 = desc.pad1;
- pad2 = desc.pad2;
- disposition = desc.disposition;
- type = desc.type;
- }
-
- mach_port_t GetMachPort() const {
- return name;
- }
-
- mach_msg_type_name_t GetDisposition() const {
- return disposition;
- }
-
- // For convenience
- operator mach_port_t() const {
- return GetMachPort();
- }
-};
-
-//==============================================================================
-// MachMessage: a wrapper for a mach message
-// (mach_msg_header_t, mach_msg_body_t, extra data)
-//
-// This considerably simplifies the construction of a message for sending
-// and the getting at relevant data and descriptors for the receiver.
-//
-// Currently the combined size of the descriptors plus data must be
-// less than 1024. But as a benefit no memory allocation is necessary.
-//
-// TODO: could consider adding malloc() support for very large messages
-//
-// A MachMessage object is used by ReceivePort::WaitForMessage
-// and MachPortSender::SendMessage
-//
-class MachMessage {
- public:
-
- // The receiver of the message can retrieve the raw data this way
- uint8_t *GetData() {
- return GetDataLength() > 0 ? GetDataPacket()->data : NULL;
- }
-
- uint32_t GetDataLength() {
- return EndianU32_LtoN(GetDataPacket()->data_length);
- }
-
- // The message ID may be used as a code identifying the type of message
- void SetMessageID(int32_t message_id) {
- GetDataPacket()->id = EndianU32_NtoL(message_id);
- }
-
- int32_t GetMessageID() { return EndianU32_LtoN(GetDataPacket()->id); }
-
- // Adds a descriptor (typically a mach port) to be translated
- // returns true if successful, otherwise not enough space
- bool AddDescriptor(const MachMsgPortDescriptor &desc);
-
- int GetDescriptorCount() const { return body.msgh_descriptor_count; }
- MachMsgPortDescriptor *GetDescriptor(int n);
-
- // Convenience method which gets the mach port described by the descriptor
- mach_port_t GetTranslatedPort(int n);
-
- // A simple message is one with no descriptors
- bool IsSimpleMessage() const { return GetDescriptorCount() == 0; }
-
- // Sets raw data for the message (returns false if not enough space)
- bool SetData(void *data, int32_t data_length);
-
- protected:
- // Consider this an abstract base class - must create an actual instance
- // of MachReceiveMessage or MachSendMessage
-
- MachMessage() {
- memset(this, 0, sizeof(MachMessage));
- }
-
- friend class ReceivePort;
- friend class MachPortSender;
-
- // Represents raw data in our message
- struct MessageDataPacket {
- int32_t id; // little-endian
- int32_t data_length; // little-endian
- uint8_t data[1]; // actual size limited by sizeof(MachMessage)
- };
-
- MessageDataPacket* GetDataPacket();
-
- void SetDescriptorCount(int n);
- void SetDescriptor(int n, const MachMsgPortDescriptor &desc);
-
- // Returns total message size setting msgh_size in the header to this value
- mach_msg_size_t CalculateSize();
-
- mach_msg_header_t head;
- mach_msg_body_t body;
- uint8_t padding[1024]; // descriptors and data may be embedded here
-};
-
-//==============================================================================
-// MachReceiveMessage and MachSendMessage are useful to separate the idea
-// of a mach message being sent and being received, and adds increased type
-// safety:
-// ReceivePort::WaitForMessage() only accepts a MachReceiveMessage
-// MachPortSender::SendMessage() only accepts a MachSendMessage
-
-//==============================================================================
-class MachReceiveMessage : public MachMessage {
- public:
- MachReceiveMessage() : MachMessage() {};
-};
-
-//==============================================================================
-class MachSendMessage : public MachMessage {
- public:
- MachSendMessage(int32_t message_id);
-};
-
-//==============================================================================
-// Represents a mach port for which we have receive rights
-class ReceivePort {
- public:
- // Creates a new mach port for receiving messages and registers a name for it
- explicit ReceivePort(const char *receive_port_name);
-
- // Given an already existing mach port, use it. We take ownership of the
- // port and deallocate it in our destructor.
- explicit ReceivePort(mach_port_t receive_port);
-
- // Create a new mach port for receiving messages
- ReceivePort();
-
- ~ReceivePort();
-
- // Waits on the mach port until message received or timeout
- kern_return_t WaitForMessage(MachReceiveMessage *out_message,
- mach_msg_timeout_t timeout);
-
- // The underlying mach port that we wrap
- mach_port_t GetPort() const { return port_; }
-
- private:
- ReceivePort(const ReceivePort&); // disable copy c-tor
-
- mach_port_t port_;
- kern_return_t init_result_;
-};
-
-//==============================================================================
-// Represents a mach port for which we have send rights
-class MachPortSender {
- public:
- // get a port with send rights corresponding to a named registered service
- explicit MachPortSender(const char *receive_port_name);
-
-
- // Given an already existing mach port, use it.
- explicit MachPortSender(mach_port_t send_port);
-
- kern_return_t SendMessage(MachSendMessage &message,
- mach_msg_timeout_t timeout);
-
- private:
- MachPortSender(const MachPortSender&); // disable copy c-tor
-
- mach_port_t send_port_;
- kern_return_t init_result_;
-};
-
-} // namespace google_breakpad
-
-#endif // MACH_IPC_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm b/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm
deleted file mode 100644
index dc9773f77a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/MachIPC.mm
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// MachIPC.mm
-// Wrapper for mach IPC calls
-
-#import <stdio.h>
-#import "MachIPC.h"
-#include "common/mac/bootstrap_compat.h"
-
-namespace google_breakpad {
-//==============================================================================
-MachSendMessage::MachSendMessage(int32_t message_id) : MachMessage() {
- head.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
-
- // head.msgh_remote_port = ...; // filled out in MachPortSender::SendMessage()
- head.msgh_local_port = MACH_PORT_NULL;
- head.msgh_reserved = 0;
- head.msgh_id = 0;
-
- SetDescriptorCount(0); // start out with no descriptors
-
- SetMessageID(message_id);
- SetData(NULL, 0); // client may add data later
-}
-
-//==============================================================================
-// returns true if successful
-bool MachMessage::SetData(void *data,
- int32_t data_length) {
- // first check to make sure we have enough space
- size_t size = CalculateSize();
- size_t new_size = size + data_length;
-
- if (new_size > sizeof(MachMessage)) {
- return false; // not enough space
- }
-
- GetDataPacket()->data_length = EndianU32_NtoL(data_length);
- if (data) memcpy(GetDataPacket()->data, data, data_length);
-
- CalculateSize();
-
- return true;
-}
-
-//==============================================================================
-// calculates and returns the total size of the message
-// Currently, the entire message MUST fit inside of the MachMessage
-// messsage size <= sizeof(MachMessage)
-mach_msg_size_t MachMessage::CalculateSize() {
- size_t size = sizeof(mach_msg_header_t) + sizeof(mach_msg_body_t);
-
- // add space for MessageDataPacket
- int32_t alignedDataLength = (GetDataLength() + 3) & ~0x3;
- size += 2*sizeof(int32_t) + alignedDataLength;
-
- // add space for descriptors
- size += GetDescriptorCount() * sizeof(MachMsgPortDescriptor);
-
- head.msgh_size = static_cast<mach_msg_size_t>(size);
-
- return head.msgh_size;
-}
-
-//==============================================================================
-MachMessage::MessageDataPacket *MachMessage::GetDataPacket() {
- size_t desc_size = sizeof(MachMsgPortDescriptor)*GetDescriptorCount();
- MessageDataPacket *packet =
- reinterpret_cast<MessageDataPacket*>(padding + desc_size);
-
- return packet;
-}
-
-//==============================================================================
-void MachMessage::SetDescriptor(int n,
- const MachMsgPortDescriptor &desc) {
- MachMsgPortDescriptor *desc_array =
- reinterpret_cast<MachMsgPortDescriptor*>(padding);
- desc_array[n] = desc;
-}
-
-//==============================================================================
-// returns true if successful otherwise there was not enough space
-bool MachMessage::AddDescriptor(const MachMsgPortDescriptor &desc) {
- // first check to make sure we have enough space
- int size = CalculateSize();
- size_t new_size = size + sizeof(MachMsgPortDescriptor);
-
- if (new_size > sizeof(MachMessage)) {
- return false; // not enough space
- }
-
- // unfortunately, we need to move the data to allow space for the
- // new descriptor
- u_int8_t *p = reinterpret_cast<u_int8_t*>(GetDataPacket());
- bcopy(p, p+sizeof(MachMsgPortDescriptor), GetDataLength()+2*sizeof(int32_t));
-
- SetDescriptor(GetDescriptorCount(), desc);
- SetDescriptorCount(GetDescriptorCount() + 1);
-
- CalculateSize();
-
- return true;
-}
-
-//==============================================================================
-void MachMessage::SetDescriptorCount(int n) {
- body.msgh_descriptor_count = n;
-
- if (n > 0) {
- head.msgh_bits |= MACH_MSGH_BITS_COMPLEX;
- } else {
- head.msgh_bits &= ~MACH_MSGH_BITS_COMPLEX;
- }
-}
-
-//==============================================================================
-MachMsgPortDescriptor *MachMessage::GetDescriptor(int n) {
- if (n < GetDescriptorCount()) {
- MachMsgPortDescriptor *desc =
- reinterpret_cast<MachMsgPortDescriptor*>(padding);
- return desc + n;
- }
-
- return nil;
-}
-
-//==============================================================================
-mach_port_t MachMessage::GetTranslatedPort(int n) {
- if (n < GetDescriptorCount()) {
- return GetDescriptor(n)->GetMachPort();
- }
- return MACH_PORT_NULL;
-}
-
-#pragma mark -
-
-//==============================================================================
-// create a new mach port for receiving messages and register a name for it
-ReceivePort::ReceivePort(const char *receive_port_name) {
- mach_port_t current_task = mach_task_self();
-
- init_result_ = mach_port_allocate(current_task,
- MACH_PORT_RIGHT_RECEIVE,
- &port_);
-
- if (init_result_ != KERN_SUCCESS)
- return;
-
- init_result_ = mach_port_insert_right(current_task,
- port_,
- port_,
- MACH_MSG_TYPE_MAKE_SEND);
-
- if (init_result_ != KERN_SUCCESS)
- return;
-
- mach_port_t task_bootstrap_port = 0;
- init_result_ = task_get_bootstrap_port(current_task, &task_bootstrap_port);
-
- if (init_result_ != KERN_SUCCESS)
- return;
-
- init_result_ = breakpad::BootstrapRegister(
- bootstrap_port,
- const_cast<char*>(receive_port_name),
- port_);
-}
-
-//==============================================================================
-// create a new mach port for receiving messages
-ReceivePort::ReceivePort() {
- mach_port_t current_task = mach_task_self();
-
- init_result_ = mach_port_allocate(current_task,
- MACH_PORT_RIGHT_RECEIVE,
- &port_);
-
- if (init_result_ != KERN_SUCCESS)
- return;
-
- init_result_ = mach_port_insert_right(current_task,
- port_,
- port_,
- MACH_MSG_TYPE_MAKE_SEND);
-}
-
-//==============================================================================
-// Given an already existing mach port, use it. We take ownership of the
-// port and deallocate it in our destructor.
-ReceivePort::ReceivePort(mach_port_t receive_port)
- : port_(receive_port),
- init_result_(KERN_SUCCESS) {
-}
-
-//==============================================================================
-ReceivePort::~ReceivePort() {
- if (init_result_ == KERN_SUCCESS)
- mach_port_deallocate(mach_task_self(), port_);
-}
-
-//==============================================================================
-kern_return_t ReceivePort::WaitForMessage(MachReceiveMessage *out_message,
- mach_msg_timeout_t timeout) {
- if (!out_message) {
- return KERN_INVALID_ARGUMENT;
- }
-
- // return any error condition encountered in constructor
- if (init_result_ != KERN_SUCCESS)
- return init_result_;
-
- out_message->head.msgh_bits = 0;
- out_message->head.msgh_local_port = port_;
- out_message->head.msgh_remote_port = MACH_PORT_NULL;
- out_message->head.msgh_reserved = 0;
- out_message->head.msgh_id = 0;
-
- mach_msg_option_t options = MACH_RCV_MSG;
- if (timeout != MACH_MSG_TIMEOUT_NONE)
- options |= MACH_RCV_TIMEOUT;
- kern_return_t result = mach_msg(&out_message->head,
- options,
- 0,
- sizeof(MachMessage),
- port_,
- timeout, // timeout in ms
- MACH_PORT_NULL);
-
- return result;
-}
-
-#pragma mark -
-
-//==============================================================================
-// get a port with send rights corresponding to a named registered service
-MachPortSender::MachPortSender(const char *receive_port_name) {
- mach_port_t task_bootstrap_port = 0;
- init_result_ = task_get_bootstrap_port(mach_task_self(),
- &task_bootstrap_port);
-
- if (init_result_ != KERN_SUCCESS)
- return;
-
- init_result_ = bootstrap_look_up(task_bootstrap_port,
- const_cast<char*>(receive_port_name),
- &send_port_);
-}
-
-//==============================================================================
-MachPortSender::MachPortSender(mach_port_t send_port)
- : send_port_(send_port),
- init_result_(KERN_SUCCESS) {
-}
-
-//==============================================================================
-kern_return_t MachPortSender::SendMessage(MachSendMessage &message,
- mach_msg_timeout_t timeout) {
- if (message.head.msgh_size == 0) {
- return KERN_INVALID_VALUE; // just for safety -- never should occur
- };
-
- if (init_result_ != KERN_SUCCESS)
- return init_result_;
-
- message.head.msgh_remote_port = send_port_;
-
- kern_return_t result = mach_msg(&message.head,
- MACH_SEND_MSG | MACH_SEND_TIMEOUT,
- message.head.msgh_size,
- 0,
- MACH_PORT_NULL,
- timeout, // timeout in ms
- MACH_PORT_NULL);
-
- return result;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.cc
deleted file mode 100644
index 4e5f5534a5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.cc
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/mac/arch_utilities.h"
-
-#include <mach-o/arch.h>
-#include <mach-o/fat.h>
-#include <stdio.h>
-#include <string.h>
-
-#ifndef CPU_SUBTYPE_ARM_V7S
-#define CPU_SUBTYPE_ARM_V7S (static_cast<cpu_subtype_t>(11))
-#endif // CPU_SUBTYPE_ARM_V7S
-
-#ifndef CPU_TYPE_ARM64
-#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
-#endif // CPU_TYPE_ARM64
-
-#ifndef CPU_SUBTYPE_ARM64_ALL
-#define CPU_SUBTYPE_ARM64_ALL (static_cast<cpu_subtype_t>(0))
-#endif // CPU_SUBTYPE_ARM64_ALL
-
-namespace {
-
-const NXArchInfo* ArchInfo_arm64() {
- NXArchInfo* arm64 = new NXArchInfo;
- *arm64 = *NXGetArchInfoFromCpuType(CPU_TYPE_ARM,
- CPU_SUBTYPE_ARM_V7);
- arm64->name = "arm64";
- arm64->cputype = CPU_TYPE_ARM64;
- arm64->cpusubtype = CPU_SUBTYPE_ARM64_ALL;
- arm64->description = "arm 64";
- return arm64;
-}
-
-const NXArchInfo* ArchInfo_armv7s() {
- NXArchInfo* armv7s = new NXArchInfo;
- *armv7s = *NXGetArchInfoFromCpuType(CPU_TYPE_ARM,
- CPU_SUBTYPE_ARM_V7);
- armv7s->name = "armv7s";
- armv7s->cpusubtype = CPU_SUBTYPE_ARM_V7S;
- armv7s->description = "arm v7s";
- return armv7s;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-const NXArchInfo* BreakpadGetArchInfoFromName(const char* arch_name) {
- // TODO: Remove this when the OS knows about arm64.
- if (!strcmp("arm64", arch_name))
- return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM64,
- CPU_SUBTYPE_ARM64_ALL);
-
- // TODO: Remove this when the OS knows about armv7s.
- if (!strcmp("armv7s", arch_name))
- return BreakpadGetArchInfoFromCpuType(CPU_TYPE_ARM, CPU_SUBTYPE_ARM_V7S);
-
- return NXGetArchInfoFromName(arch_name);
-}
-
-const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype) {
- // TODO: Remove this when the OS knows about arm64.
- if (cpu_type == CPU_TYPE_ARM64 && cpu_subtype == CPU_SUBTYPE_ARM64_ALL) {
- static const NXArchInfo* arm64 = ArchInfo_arm64();
- return arm64;
- }
-
- // TODO: Remove this when the OS knows about armv7s.
- if (cpu_type == CPU_TYPE_ARM && cpu_subtype == CPU_SUBTYPE_ARM_V7S) {
- static const NXArchInfo* armv7s = ArchInfo_armv7s();
- return armv7s;
- }
-
- return NXGetArchInfoFromCpuType(cpu_type, cpu_subtype);
-}
-
-} // namespace google_breakpad
-
-#ifndef __APPLE__
-namespace {
-
-enum Architecture {
- kArch_i386 = 0,
- kArch_x86_64,
- kArch_arm,
- kArch_arm64,
- kArch_ppc,
- // This must be last.
- kNumArchitectures
-};
-
-// enum Architecture above and kKnownArchitectures below
-// must be kept in sync.
-const NXArchInfo kKnownArchitectures[] = {
- {
- "i386",
- CPU_TYPE_I386,
- CPU_SUBTYPE_I386_ALL,
- NX_LittleEndian,
- "Intel 80x86"
- },
- {
- "x86_64",
- CPU_TYPE_X86_64,
- CPU_SUBTYPE_X86_64_ALL,
- NX_LittleEndian,
- "Intel x86-64"
- },
- {
- "arm",
- CPU_TYPE_ARM,
- CPU_SUBTYPE_ARM_ALL,
- NX_LittleEndian,
- "ARM"
- },
- {
- "arm64",
- CPU_TYPE_ARM64,
- CPU_SUBTYPE_ARM64_ALL,
- NX_LittleEndian,
- "ARM64"
- },
- {
- "ppc",
- CPU_TYPE_POWERPC,
- CPU_SUBTYPE_POWERPC_ALL,
- NX_BigEndian,
- "PowerPC"
- }
-};
-
-} // namespace
-
-const NXArchInfo *NXGetLocalArchInfo(void) {
- Architecture arch;
-#if defined(__i386__)
- arch = kArch_i386;
-#elif defined(__x86_64__)
- arch = kArch_x86_64;
-#elif defined(__arm64)
- arch = kArch_arm64;
-#elif defined(__arm__)
- arch = kArch_arm;
-#elif defined(__powerpc__)
- arch = kArch_ppc;
-#else
- #error "Unsupported CPU architecture"
-#endif
- return &kKnownArchitectures[arch];
-}
-
-const NXArchInfo *NXGetArchInfoFromName(const char *name) {
- for (int arch = 0; arch < kNumArchitectures; ++arch) {
- if (!strcmp(name, kKnownArchitectures[arch].name)) {
- return &kKnownArchitectures[arch];
- }
- }
- return NULL;
-}
-
-const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype,
- cpu_subtype_t cpusubtype) {
- for (int arch = 0; arch < kNumArchitectures; ++arch) {
- if (kKnownArchitectures[arch].cputype == cputype) {
- return &kKnownArchitectures[arch];
- }
- }
- return NULL;
-}
-
-struct fat_arch *NXFindBestFatArch(cpu_type_t cputype,
- cpu_subtype_t cpusubtype,
- struct fat_arch *fat_archs,
- uint32_t nfat_archs) {
- for (uint32_t f = 0; f < nfat_archs; ++f) {
- if (fat_archs[f].cputype == cputype) {
- return &fat_archs[f];
- }
- }
- return NULL;
-}
-#endif // !__APPLE__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.h b/toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.h
deleted file mode 100644
index 397c1f5873..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/arch_utilities.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// arch_utilities.h: Utilities for architecture introspection for Mac platform.
-
-#ifndef COMMON_MAC_ARCH_UTILITIES_H__
-#define COMMON_MAC_ARCH_UTILITIES_H__
-
-#include <mach-o/arch.h>
-
-namespace google_breakpad {
-
-// Custom implementation of |NXGetArchInfoFromName| and
-// |NXGetArchInfoFromCpuType| that handle newer CPU on older OSes.
-const NXArchInfo* BreakpadGetArchInfoFromName(const char* arch_name);
-const NXArchInfo* BreakpadGetArchInfoFromCpuType(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype);
-
-} // namespace google_breakpad
-
-#endif // COMMON_MAC_ARCH_UTILITIES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.cc
deleted file mode 100644
index d875d95b5f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/mac/bootstrap_compat.h"
-
-namespace breakpad {
-
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-kern_return_t BootstrapRegister(mach_port_t bp,
- name_t service_name,
- mach_port_t sp) {
- return bootstrap_register(bp, service_name, sp);
-}
-#pragma GCC diagnostic warning "-Wdeprecated-declarations"
-
-} // namesapce breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.h b/toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.h
deleted file mode 100644
index 8ca7357c34..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/bootstrap_compat.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_MAC_BOOTSTRAP_COMPAT_H_
-#define COMMON_MAC_BOOTSTRAP_COMPAT_H_
-
-#include <servers/bootstrap.h>
-
-namespace breakpad {
-
-// Wrapper for bootstrap_register to avoid deprecation warnings.
-//
-// In 10.6, it's possible to call bootstrap_check_in as the one-stop-shop for
-// handling what bootstrap_register is used for. In 10.5, bootstrap_check_in
-// can't check in a service whose name has not yet been registered, despite
-// bootstrap_register being marked as deprecated in that OS release. Breakpad
-// needs to register new service names, and in 10.5, calling
-// bootstrap_register is the only way to achieve that. Attempts to call
-// bootstrap_check_in for a new service name on 10.5 will result in
-// BOOTSTRAP_UNKNOWN_SERVICE being returned rather than registration of the
-// new service name.
-kern_return_t BootstrapRegister(mach_port_t bp,
- name_t service_name,
- mach_port_t sp);
-
-} // namespace breakpad
-
-#endif // COMMON_MAC_BOOTSTRAP_COMPAT_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/byteswap.h b/toolkit/crashreporter/google-breakpad/src/common/mac/byteswap.h
deleted file mode 100644
index b7bbc0b95b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/byteswap.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jim@mozilla.com> <jimb@red-bean.com>
-
-// byteswap.h: Overloaded functions for conveniently byteswapping values.
-
-#ifndef COMMON_MAC_BYTESWAP_H_
-#define COMMON_MAC_BYTESWAP_H_
-
-#ifdef __APPLE__
-#include <libkern/OSByteOrder.h>
-
-static inline uint16_t ByteSwap(uint16_t v) { return OSSwapInt16(v); }
-static inline uint32_t ByteSwap(uint32_t v) { return OSSwapInt32(v); }
-static inline uint64_t ByteSwap(uint64_t v) { return OSSwapInt64(v); }
-static inline int16_t ByteSwap(int16_t v) { return OSSwapInt16(v); }
-static inline int32_t ByteSwap(int32_t v) { return OSSwapInt32(v); }
-static inline int64_t ByteSwap(int64_t v) { return OSSwapInt64(v); }
-
-#elif defined(__linux__)
-// For NXByteOrder
-#include <architecture/byte_order.h>
-#include <stdint.h>
-#include <endian.h>
-#include_next <byteswap.h>
-
-static inline uint16_t ByteSwap(uint16_t v) { return bswap_16(v); }
-static inline uint32_t ByteSwap(uint32_t v) { return bswap_32(v); }
-static inline uint64_t ByteSwap(uint64_t v) { return bswap_64(v); }
-static inline int16_t ByteSwap(int16_t v) { return bswap_16(v); }
-static inline int32_t ByteSwap(int32_t v) { return bswap_32(v); }
-static inline int64_t ByteSwap(int64_t v) { return bswap_64(v); }
-
-static inline NXByteOrder NXHostByteOrder() {
-#ifdef __LITTLE_ENDIAN
- return NX_LittleEndian;
-#else
- return NX_BigEndian;
-#endif
-}
-
-#endif // __APPLE__
-
-#endif // COMMON_MAC_BYTESWAP_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.cc
deleted file mode 100644
index b20a055868..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.cc
+++ /dev/null
@@ -1,646 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dump_syms.mm: Create a symbol file for use with minidumps
-
-#include "common/mac/dump_syms.h"
-
-#include <assert.h>
-#include <dirent.h>
-#include <errno.h>
-#include <libgen.h>
-#include <mach-o/arch.h>
-#include <mach-o/fat.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <ostream>
-#include <string>
-#include <vector>
-
-#include "common/dwarf/bytereader-inl.h"
-#include "common/dwarf/dwarf2reader.h"
-#include "common/dwarf_cfi_to_module.h"
-#include "common/dwarf_cu_to_module.h"
-#include "common/dwarf_line_to_module.h"
-#include "common/mac/file_id.h"
-#include "common/mac/arch_utilities.h"
-#include "common/mac/macho_reader.h"
-#include "common/module.h"
-#include "common/scoped_ptr.h"
-#include "common/stabs_reader.h"
-#include "common/stabs_to_module.h"
-#include "common/symbol_data.h"
-
-#ifndef CPU_TYPE_ARM
-#define CPU_TYPE_ARM (static_cast<cpu_type_t>(12))
-#endif // CPU_TYPE_ARM
-
-#ifndef CPU_TYPE_ARM64
-#define CPU_TYPE_ARM64 (static_cast<cpu_type_t>(16777228))
-#endif // CPU_TYPE_ARM64
-
-using dwarf2reader::ByteReader;
-using google_breakpad::DwarfCUToModule;
-using google_breakpad::DwarfLineToModule;
-using google_breakpad::FileID;
-using google_breakpad::mach_o::FatReader;
-using google_breakpad::mach_o::Section;
-using google_breakpad::mach_o::Segment;
-using google_breakpad::Module;
-using google_breakpad::StabsReader;
-using google_breakpad::StabsToModule;
-using google_breakpad::scoped_ptr;
-using std::make_pair;
-using std::pair;
-using std::string;
-using std::vector;
-
-namespace {
-// Return a vector<string> with absolute paths to all the entries
-// in directory (excluding . and ..).
-vector<string> list_directory(const string& directory) {
- vector<string> entries;
- DIR* dir = opendir(directory.c_str());
- if (!dir) {
- return entries;
- }
-
- string path = directory;
- if (path[path.length() - 1] != '/') {
- path += '/';
- }
-
- struct dirent* entry = NULL;
- while ((entry = readdir(dir))) {
- if (strcmp(entry->d_name, ".") != 0 && strcmp(entry->d_name, "..") != 0) {
- entries.push_back(path + entry->d_name);
- }
- }
-
- closedir(dir);
- return entries;
-}
-}
-
-namespace google_breakpad {
-
-bool DumpSymbols::Read(const string &filename) {
- struct stat st;
- if (stat(filename.c_str(), &st) == -1) {
- fprintf(stderr, "Could not access object file %s: %s\n",
- filename.c_str(), strerror(errno));
- return false;
- }
-
- input_pathname_ = filename;
-
- // Does this filename refer to a dSYM bundle?
- string contents_path = input_pathname_ + "/Contents/Resources/DWARF";
- if (S_ISDIR(st.st_mode) &&
- access(contents_path.c_str(), F_OK) == 0) {
- // If there's one file under Contents/Resources/DWARF then use that,
- // otherwise bail out.
- const vector<string> entries = list_directory(contents_path);
- if (entries.size() == 0) {
- fprintf(stderr, "Unable to find DWARF-bearing file in bundle: %s\n",
- input_pathname_.c_str());
- return false;
- }
- if (entries.size() > 1) {
- fprintf(stderr, "Too many DWARF files in bundle: %s\n",
- input_pathname_.c_str());
- return false;
- }
-
- object_filename_ = entries[0];
- } else {
- object_filename_ = input_pathname_;
- }
-
- // Read the file's contents into memory.
- bool read_ok = true;
- string error;
- if (stat(object_filename_.c_str(), &st) != -1) {
- FILE* f = fopen(object_filename_.c_str(), "rb");
- if (f) {
- contents_.reset(new uint8_t[st.st_size]);
- off_t total = 0;
- while (total < st.st_size && !feof(f)) {
- size_t read = fread(&contents_[0] + total, 1, st.st_size - total, f);
- if (read == 0) {
- if (ferror(f)) {
- read_ok = false;
- error = strerror(errno);
- }
- break;
- }
- total += read;
- }
- fclose(f);
- } else {
- error = strerror(errno);
- }
- }
-
- if (!read_ok) {
- fprintf(stderr, "Error reading object file: %s: %s\n",
- object_filename_.c_str(),
- error.c_str());
- return false;
- }
-
- // Get the list of object files present in the file.
- FatReader::Reporter fat_reporter(object_filename_);
- FatReader fat_reader(&fat_reporter);
- if (!fat_reader.Read(&contents_[0],
- st.st_size)) {
- return false;
- }
-
- // Get our own copy of fat_reader's object file list.
- size_t object_files_count;
- const SuperFatArch *object_files =
- fat_reader.object_files(&object_files_count);
- if (object_files_count == 0) {
- fprintf(stderr, "Fat binary file contains *no* architectures: %s\n",
- object_filename_.c_str());
- return false;
- }
- object_files_.resize(object_files_count);
- memcpy(&object_files_[0], object_files,
- sizeof(SuperFatArch) * object_files_count);
-
- return true;
-}
-
-bool DumpSymbols::SetArchitecture(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype) {
- // Find the best match for the architecture the user requested.
- const SuperFatArch *best_match = FindBestMatchForArchitecture(
- cpu_type, cpu_subtype);
- if (!best_match) return false;
-
- // Record the selected object file.
- selected_object_file_ = best_match;
- return true;
-}
-
-bool DumpSymbols::SetArchitecture(const std::string &arch_name) {
- bool arch_set = false;
- const NXArchInfo *arch_info =
- google_breakpad::BreakpadGetArchInfoFromName(arch_name.c_str());
- if (arch_info) {
- arch_set = SetArchitecture(arch_info->cputype, arch_info->cpusubtype);
- }
- return arch_set;
-}
-
-SuperFatArch* DumpSymbols::FindBestMatchForArchitecture(
- cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
- // Check if all the object files can be converted to struct fat_arch.
- bool can_convert_to_fat_arch = true;
- vector<struct fat_arch> fat_arch_vector;
- for (vector<SuperFatArch>::const_iterator it = object_files_.begin();
- it != object_files_.end();
- ++it) {
- struct fat_arch arch;
- bool success = it->ConvertToFatArch(&arch);
- if (!success) {
- can_convert_to_fat_arch = false;
- break;
- }
- fat_arch_vector.push_back(arch);
- }
-
- // If all the object files can be converted to struct fat_arch, use
- // NXFindBestFatArch.
- if (can_convert_to_fat_arch) {
- const struct fat_arch *best_match
- = NXFindBestFatArch(cpu_type, cpu_subtype, &fat_arch_vector[0],
- static_cast<uint32_t>(fat_arch_vector.size()));
-
- for (size_t i = 0; i < fat_arch_vector.size(); ++i) {
- if (best_match == &fat_arch_vector[i])
- return &object_files_[i];
- }
- assert(best_match == NULL);
- return NULL;
- }
-
- // Check for an exact match with cpu_type and cpu_subtype.
- for (vector<SuperFatArch>::iterator it = object_files_.begin();
- it != object_files_.end();
- ++it) {
- if (static_cast<cpu_type_t>(it->cputype) == cpu_type &&
- static_cast<cpu_subtype_t>(it->cpusubtype) == cpu_subtype)
- return &*it;
- }
-
- // No exact match found.
- // TODO(erikchen): If it becomes necessary, we can copy the implementation of
- // NXFindBestFatArch, located at
- // http://web.mit.edu/darwin/src/modules/cctools/libmacho/arch.c.
- fprintf(stderr, "Failed to find an exact match for an object file with cpu "
- "type: %d and cpu subtype: %d. Furthermore, at least one object file is "
- "larger than 2**32.\n", cpu_type, cpu_subtype);
- return NULL;
-}
-
-string DumpSymbols::Identifier() {
- FileID file_id(object_filename_.c_str());
- unsigned char identifier_bytes[16];
- cpu_type_t cpu_type = selected_object_file_->cputype;
- cpu_subtype_t cpu_subtype = selected_object_file_->cpusubtype;
- if (!file_id.MachoIdentifier(cpu_type, cpu_subtype, identifier_bytes)) {
- fprintf(stderr, "Unable to calculate UUID of mach-o binary %s!\n",
- object_filename_.c_str());
- return "";
- }
-
- char identifier_string[40];
- FileID::ConvertIdentifierToString(identifier_bytes, identifier_string,
- sizeof(identifier_string));
-
- string compacted(identifier_string);
- for(size_t i = compacted.find('-'); i != string::npos;
- i = compacted.find('-', i))
- compacted.erase(i, 1);
-
- return compacted;
-}
-
-// A line-to-module loader that accepts line number info parsed by
-// dwarf2reader::LineInfo and populates a Module and a line vector
-// with the results.
-class DumpSymbols::DumperLineToModule:
- public DwarfCUToModule::LineToModuleHandler {
- public:
- // Create a line-to-module converter using BYTE_READER.
- DumperLineToModule(dwarf2reader::ByteReader *byte_reader)
- : byte_reader_(byte_reader) { }
-
- void StartCompilationUnit(const string& compilation_dir) {
- compilation_dir_ = compilation_dir;
- }
-
- void ReadProgram(const uint8_t *program, uint64 length,
- Module *module, vector<Module::Line> *lines) {
- DwarfLineToModule handler(module, compilation_dir_, lines);
- dwarf2reader::LineInfo parser(program, length, byte_reader_, &handler);
- parser.Start();
- }
- private:
- string compilation_dir_;
- dwarf2reader::ByteReader *byte_reader_; // WEAK
-};
-
-bool DumpSymbols::CreateEmptyModule(scoped_ptr<Module>& module) {
- // Select an object file, if SetArchitecture hasn't been called to set one
- // explicitly.
- if (!selected_object_file_) {
- // If there's only one architecture, that's the one.
- if (object_files_.size() == 1)
- selected_object_file_ = &object_files_[0];
- else {
- // Look for an object file whose architecture matches our own.
- const NXArchInfo *local_arch = NXGetLocalArchInfo();
- if (!SetArchitecture(local_arch->cputype, local_arch->cpusubtype)) {
- fprintf(stderr, "%s: object file contains more than one"
- " architecture, none of which match the current"
- " architecture; specify an architecture explicitly"
- " with '-a ARCH' to resolve the ambiguity\n",
- object_filename_.c_str());
- return false;
- }
- }
- }
-
- assert(selected_object_file_);
-
- // Find the name of the selected file's architecture, to appear in
- // the MODULE record and in error messages.
- const NXArchInfo *selected_arch_info =
- google_breakpad::BreakpadGetArchInfoFromCpuType(
- selected_object_file_->cputype, selected_object_file_->cpusubtype);
-
- const char *selected_arch_name = selected_arch_info->name;
- if (strcmp(selected_arch_name, "i386") == 0)
- selected_arch_name = "x86";
-
- // Produce a name to use in error messages that includes the
- // filename, and the architecture, if there is more than one.
- selected_object_name_ = object_filename_;
- if (object_files_.size() > 1) {
- selected_object_name_ += ", architecture ";
- selected_object_name_ + selected_arch_name;
- }
-
- // Compute a module name, to appear in the MODULE record.
- string module_name = object_filename_;
- module_name = basename(&module_name[0]);
-
- // Choose an identifier string, to appear in the MODULE record.
- string identifier = Identifier();
- if (identifier.empty())
- return false;
- identifier += "0";
-
- // Create a module to hold the debugging information.
- module.reset(new Module(module_name,
- "mac",
- selected_arch_name,
- identifier));
- return true;
-}
-
-bool DumpSymbols::ReadDwarf(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::SectionMap &dwarf_sections,
- bool handle_inter_cu_refs) const {
- // Build a byte reader of the appropriate endianness.
- ByteReader byte_reader(macho_reader.big_endian()
- ? dwarf2reader::ENDIANNESS_BIG
- : dwarf2reader::ENDIANNESS_LITTLE);
-
- // Construct a context for this file.
- DwarfCUToModule::FileContext file_context(selected_object_name_,
- module,
- handle_inter_cu_refs);
-
- // Build a dwarf2reader::SectionMap from our mach_o::SectionMap.
- for (mach_o::SectionMap::const_iterator it = dwarf_sections.begin();
- it != dwarf_sections.end(); ++it) {
- file_context.AddSectionToSectionMap(
- it->first,
- it->second.contents.start,
- it->second.contents.Size());
- }
-
- // Find the __debug_info section.
- dwarf2reader::SectionMap::const_iterator debug_info_entry =
- file_context.section_map().find("__debug_info");
- assert(debug_info_entry != file_context.section_map().end());
- const std::pair<const uint8_t *, uint64>& debug_info_section =
- debug_info_entry->second;
- // There had better be a __debug_info section!
- if (!debug_info_section.first) {
- fprintf(stderr, "%s: __DWARF segment of file has no __debug_info section\n",
- selected_object_name_.c_str());
- return false;
- }
-
- // Build a line-to-module loader for the root handler to use.
- DumperLineToModule line_to_module(&byte_reader);
-
- // Walk the __debug_info section, one compilation unit at a time.
- uint64 debug_info_length = debug_info_section.second;
- for (uint64 offset = 0; offset < debug_info_length;) {
- // Make a handler for the root DIE that populates MODULE with the
- // debug info.
- DwarfCUToModule::WarningReporter reporter(selected_object_name_,
- offset);
- DwarfCUToModule root_handler(&file_context, &line_to_module, &reporter);
- // Make a Dwarf2Handler that drives our DIEHandler.
- dwarf2reader::DIEDispatcher die_dispatcher(&root_handler);
- // Make a DWARF parser for the compilation unit at OFFSET.
- dwarf2reader::CompilationUnit dwarf_reader(selected_object_name_,
- file_context.section_map(),
- offset,
- &byte_reader,
- &die_dispatcher);
- // Process the entire compilation unit; get the offset of the next.
- offset += dwarf_reader.Start();
- }
-
- return true;
-}
-
-bool DumpSymbols::ReadCFI(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::Section &section,
- bool eh_frame) const {
- // Find the appropriate set of register names for this file's
- // architecture.
- vector<string> register_names;
- switch (macho_reader.cpu_type()) {
- case CPU_TYPE_X86:
- register_names = DwarfCFIToModule::RegisterNames::I386();
- break;
- case CPU_TYPE_X86_64:
- register_names = DwarfCFIToModule::RegisterNames::X86_64();
- break;
- case CPU_TYPE_ARM:
- register_names = DwarfCFIToModule::RegisterNames::ARM();
- break;
- case CPU_TYPE_ARM64:
- register_names = DwarfCFIToModule::RegisterNames::ARM64();
- break;
- default: {
- const NXArchInfo *arch = google_breakpad::BreakpadGetArchInfoFromCpuType(
- macho_reader.cpu_type(), macho_reader.cpu_subtype());
- fprintf(stderr, "%s: cannot convert DWARF call frame information for ",
- selected_object_name_.c_str());
- if (arch)
- fprintf(stderr, "architecture '%s'", arch->name);
- else
- fprintf(stderr, "architecture %d,%d",
- macho_reader.cpu_type(), macho_reader.cpu_subtype());
- fprintf(stderr, " to Breakpad symbol file: no register name table\n");
- return false;
- }
- }
-
- // Find the call frame information and its size.
- const uint8_t *cfi = section.contents.start;
- size_t cfi_size = section.contents.Size();
-
- // Plug together the parser, handler, and their entourages.
- DwarfCFIToModule::Reporter module_reporter(selected_object_name_,
- section.section_name);
- DwarfCFIToModule handler(module, register_names, &module_reporter);
- dwarf2reader::ByteReader byte_reader(macho_reader.big_endian() ?
- dwarf2reader::ENDIANNESS_BIG :
- dwarf2reader::ENDIANNESS_LITTLE);
- byte_reader.SetAddressSize(macho_reader.bits_64() ? 8 : 4);
- // At the moment, according to folks at Apple and some cursory
- // investigation, Mac OS X only uses DW_EH_PE_pcrel-based pointers, so
- // this is the only base address the CFI parser will need.
- byte_reader.SetCFIDataBase(section.address, cfi);
-
- dwarf2reader::CallFrameInfo::Reporter dwarf_reporter(selected_object_name_,
- section.section_name);
- dwarf2reader::CallFrameInfo parser(cfi, cfi_size,
- &byte_reader, &handler, &dwarf_reporter,
- eh_frame);
- parser.Start();
- return true;
-}
-
-// A LoadCommandHandler that loads whatever debugging data it finds into a
-// Module.
-class DumpSymbols::LoadCommandDumper:
- public mach_o::Reader::LoadCommandHandler {
- public:
- // Create a load command dumper handling load commands from READER's
- // file, and adding data to MODULE.
- LoadCommandDumper(const DumpSymbols &dumper,
- google_breakpad::Module *module,
- const mach_o::Reader &reader,
- SymbolData symbol_data,
- bool handle_inter_cu_refs)
- : dumper_(dumper),
- module_(module),
- reader_(reader),
- symbol_data_(symbol_data),
- handle_inter_cu_refs_(handle_inter_cu_refs) { }
-
- bool SegmentCommand(const mach_o::Segment &segment);
- bool SymtabCommand(const ByteBuffer &entries, const ByteBuffer &strings);
-
- private:
- const DumpSymbols &dumper_;
- google_breakpad::Module *module_; // WEAK
- const mach_o::Reader &reader_;
- const SymbolData symbol_data_;
- const bool handle_inter_cu_refs_;
-};
-
-bool DumpSymbols::LoadCommandDumper::SegmentCommand(const Segment &segment) {
- mach_o::SectionMap section_map;
- if (!reader_.MapSegmentSections(segment, &section_map))
- return false;
-
- if (segment.name == "__TEXT") {
- module_->SetLoadAddress(segment.vmaddr);
- if (symbol_data_ != NO_CFI) {
- mach_o::SectionMap::const_iterator eh_frame =
- section_map.find("__eh_frame");
- if (eh_frame != section_map.end()) {
- // If there is a problem reading this, don't treat it as a fatal error.
- dumper_.ReadCFI(module_, reader_, eh_frame->second, true);
- }
- }
- return true;
- }
-
- if (segment.name == "__DWARF") {
- if (symbol_data_ != ONLY_CFI) {
- if (!dumper_.ReadDwarf(module_, reader_, section_map,
- handle_inter_cu_refs_)) {
- return false;
- }
- }
- if (symbol_data_ != NO_CFI) {
- mach_o::SectionMap::const_iterator debug_frame
- = section_map.find("__debug_frame");
- if (debug_frame != section_map.end()) {
- // If there is a problem reading this, don't treat it as a fatal error.
- dumper_.ReadCFI(module_, reader_, debug_frame->second, false);
- }
- }
- }
-
- return true;
-}
-
-bool DumpSymbols::LoadCommandDumper::SymtabCommand(const ByteBuffer &entries,
- const ByteBuffer &strings) {
- StabsToModule stabs_to_module(module_);
- // Mac OS X STABS are never "unitized", and the size of the 'value' field
- // matches the address size of the executable.
- StabsReader stabs_reader(entries.start, entries.Size(),
- strings.start, strings.Size(),
- reader_.big_endian(),
- reader_.bits_64() ? 8 : 4,
- true,
- &stabs_to_module);
- if (!stabs_reader.Process())
- return false;
- stabs_to_module.Finalize();
- return true;
-}
-
-bool DumpSymbols::ReadSymbolData(Module** out_module) {
- scoped_ptr<Module> module;
- if (!CreateEmptyModule(module))
- return false;
-
- // Parse the selected object file.
- mach_o::Reader::Reporter reporter(selected_object_name_);
- mach_o::Reader reader(&reporter);
- if (!reader.Read(&contents_[0]
- + selected_object_file_->offset,
- selected_object_file_->size,
- selected_object_file_->cputype,
- selected_object_file_->cpusubtype))
- return false;
-
- // Walk its load commands, and deal with whatever is there.
- LoadCommandDumper load_command_dumper(*this, module.get(), reader,
- symbol_data_, handle_inter_cu_refs_);
- if (!reader.WalkLoadCommands(&load_command_dumper))
- return false;
-
- *out_module = module.release();
-
- return true;
-}
-
-bool DumpSymbols::WriteSymbolFile(std::ostream &stream) {
- Module* module = NULL;
-
- if (ReadSymbolData(&module) && module) {
- bool res = module->Write(stream, symbol_data_);
- delete module;
- return res;
- }
-
- return false;
-}
-
-// Read the selected object file's debugging information, and write out the
-// header only to |stream|. Return true on success; if an error occurs, report
-// it and return false.
-bool DumpSymbols::WriteSymbolFileHeader(std::ostream &stream) {
- scoped_ptr<Module> module;
- if (!CreateEmptyModule(module))
- return false;
-
- return module->Write(stream, symbol_data_);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h b/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h
deleted file mode 100644
index 9463f7dc0c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/dump_syms.h
+++ /dev/null
@@ -1,196 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dump_syms.h: Declaration of google_breakpad::DumpSymbols, a class for
-// reading debugging information from Mach-O files and writing it out as a
-// Breakpad symbol file.
-
-#include <mach-o/loader.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <ostream>
-#include <string>
-#include <vector>
-
-#include "common/byte_cursor.h"
-#include "common/mac/macho_reader.h"
-#include "common/mac/super_fat_arch.h"
-#include "common/module.h"
-#include "common/scoped_ptr.h"
-#include "common/symbol_data.h"
-
-namespace google_breakpad {
-
-class DumpSymbols {
- public:
- DumpSymbols(SymbolData symbol_data, bool handle_inter_cu_refs)
- : symbol_data_(symbol_data),
- handle_inter_cu_refs_(handle_inter_cu_refs),
- input_pathname_(),
- object_filename_(),
- contents_(),
- object_files_(),
- selected_object_file_(),
- selected_object_name_() { }
- ~DumpSymbols() {
- }
-
- // Prepare to read debugging information from |filename|. |filename| may be
- // the name of a universal binary, a Mach-O file, or a dSYM bundle
- // containing either of the above. On success, return true; if there is a
- // problem reading |filename|, report it and return false.
- bool Read(const std::string &filename);
-
- // If this dumper's file includes an object file for |cpu_type| and
- // |cpu_subtype|, then select that object file for dumping, and return
- // true. Otherwise, return false, and leave this dumper's selected
- // architecture unchanged.
- //
- // By default, if this dumper's file contains only one object file, then
- // the dumper will dump those symbols; and if it contains more than one
- // object file, then the dumper will dump the object file whose
- // architecture matches that of this dumper program.
- bool SetArchitecture(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype);
-
- // If this dumper's file includes an object file for |arch_name|, then select
- // that object file for dumping, and return true. Otherwise, return false,
- // and leave this dumper's selected architecture unchanged.
- //
- // By default, if this dumper's file contains only one object file, then
- // the dumper will dump those symbols; and if it contains more than one
- // object file, then the dumper will dump the object file whose
- // architecture matches that of this dumper program.
- bool SetArchitecture(const std::string &arch_name);
-
- // Return a pointer to an array of SuperFatArch structures describing the
- // object files contained in this dumper's file. Set *|count| to the number
- // of elements in the array. The returned array is owned by this DumpSymbols
- // instance.
- //
- // If there are no available architectures, this function
- // may return NULL.
- const SuperFatArch* AvailableArchitectures(size_t *count) {
- *count = object_files_.size();
- if (object_files_.size() > 0)
- return &object_files_[0];
- return NULL;
- }
-
- // Read the selected object file's debugging information, and write it out to
- // |stream|. Return true on success; if an error occurs, report it and
- // return false.
- bool WriteSymbolFile(std::ostream &stream);
-
- // Read the selected object file's debugging information, and write out the
- // header only to |stream|. Return true on success; if an error occurs, report
- // it and return false.
- bool WriteSymbolFileHeader(std::ostream &stream);
-
- // As above, but simply return the debugging information in module
- // instead of writing it to a stream. The caller owns the resulting
- // module object and must delete it when finished.
- bool ReadSymbolData(Module** module);
-
- private:
- // Used internally.
- class DumperLineToModule;
- class LoadCommandDumper;
-
- // This method behaves similarly to NXFindBestFatArch, but it supports
- // SuperFatArch.
- SuperFatArch* FindBestMatchForArchitecture(
- cpu_type_t cpu_type, cpu_subtype_t cpu_subtype);
-
- // Return an identifier string for the file this DumpSymbols is dumping.
- std::string Identifier();
-
-
- // Creates an empty module object.
- bool CreateEmptyModule(scoped_ptr<Module>& module);
-
- // Read debugging information from |dwarf_sections|, which was taken from
- // |macho_reader|, and add it to |module|. On success, return true;
- // on failure, report the problem and return false.
- bool ReadDwarf(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::SectionMap &dwarf_sections,
- bool handle_inter_cu_refs) const;
-
- // Read DWARF CFI or .eh_frame data from |section|, belonging to
- // |macho_reader|, and record it in |module|. If |eh_frame| is true,
- // then the data is .eh_frame-format data; otherwise, it is standard DWARF
- // .debug_frame data. On success, return true; on failure, report
- // the problem and return false.
- bool ReadCFI(google_breakpad::Module *module,
- const mach_o::Reader &macho_reader,
- const mach_o::Section &section,
- bool eh_frame) const;
-
- // The selection of what type of symbol data to read/write.
- const SymbolData symbol_data_;
-
- // Whether to handle references between compilation units.
- const bool handle_inter_cu_refs_;
-
- // The name of the file or bundle whose symbols this will dump.
- // This is the path given to Read, for use in error messages.
- std::string input_pathname_;
-
- // The name of the file this DumpSymbols will actually read debugging
- // information from. Normally, this is the same as input_pathname_, but if
- // filename refers to a dSYM bundle, then this is the resource file
- // within that bundle.
- std::string object_filename_;
-
- // The complete contents of object_filename_, mapped into memory.
- scoped_array<uint8_t> contents_;
-
- // A vector of SuperFatArch structures describing the object files
- // object_filename_ contains. If object_filename_ refers to a fat binary,
- // this may have more than one element; if it refers to a Mach-O file, this
- // has exactly one element.
- vector<SuperFatArch> object_files_;
-
- // The object file in object_files_ selected to dump, or NULL if
- // SetArchitecture hasn't been called yet.
- const SuperFatArch *selected_object_file_;
-
- // A string that identifies the selected object file, for use in error
- // messages. This is usually object_filename_, but if that refers to a
- // fat binary, it includes an indication of the particular architecture
- // within that binary.
- string selected_object_name_;
-};
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc
deleted file mode 100644
index 4661d5d625..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// file_id.cc: Return a unique identifier for a file
-//
-// See file_id.h for documentation
-//
-// Author: Dan Waylonis
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common/mac/file_id.h"
-#include "common/mac/macho_id.h"
-
-using MacFileUtilities::MachoID;
-
-namespace google_breakpad {
-
-FileID::FileID(const char *path) {
- snprintf(path_, sizeof(path_), "%s", path);
-}
-
-bool FileID::FileIdentifier(unsigned char identifier[16]) {
- int fd = open(path_, O_RDONLY);
- if (fd == -1)
- return false;
-
- MD5Context md5;
- MD5Init(&md5);
-
- // Read 4k x 2 bytes at a time. This is faster than just 4k bytes, but
- // doesn't seem to be an unreasonable size for the stack.
- unsigned char buffer[4096 * 2];
- size_t buffer_size = sizeof(buffer);
- while ((buffer_size = read(fd, buffer, buffer_size) > 0)) {
- MD5Update(&md5, buffer, static_cast<unsigned>(buffer_size));
- }
-
- close(fd);
- MD5Final(identifier, &md5);
-
- return true;
-}
-
-bool FileID::MachoIdentifier(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char identifier[16]) {
- MachoID macho(path_);
-
- if (macho.UUIDCommand(cpu_type, cpu_subtype, identifier))
- return true;
-
- return macho.MD5(cpu_type, cpu_subtype, identifier);
-}
-
-// static
-void FileID::ConvertIdentifierToString(const unsigned char identifier[16],
- char *buffer, int buffer_length) {
- int buffer_idx = 0;
- for (int idx = 0; (buffer_idx < buffer_length) && (idx < 16); ++idx) {
- int hi = (identifier[idx] >> 4) & 0x0F;
- int lo = (identifier[idx]) & 0x0F;
-
- if (idx == 4 || idx == 6 || idx == 8 || idx == 10)
- buffer[buffer_idx++] = '-';
-
- buffer[buffer_idx++] =
- static_cast<char>((hi >= 10) ? ('A' + hi - 10) : ('0' + hi));
- buffer[buffer_idx++] =
- static_cast<char>((lo >= 10) ? ('A' + lo - 10) : ('0' + lo));
- }
-
- // NULL terminate
- buffer[(buffer_idx < buffer_length) ? buffer_idx : buffer_idx - 1] = 0;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.h b/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.h
deleted file mode 100644
index 1d6dfde1b0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/file_id.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// file_id.h: Return a unique identifier for a file
-//
-// Author: Dan Waylonis
-
-#ifndef COMMON_MAC_FILE_ID_H__
-#define COMMON_MAC_FILE_ID_H__
-
-#include <limits.h>
-#include <mach/machine.h>
-
-namespace google_breakpad {
-
-class FileID {
- public:
- FileID(const char *path);
- ~FileID() {};
-
- // Load the identifier for the file path specified in the constructor into
- // |identifier|. Return false if the identifier could not be created for the
- // file.
- // The current implementation will return the MD5 hash of the file's bytes.
- bool FileIdentifier(unsigned char identifier[16]);
-
- // Treat the file as a mach-o file that will contain one or more archicture.
- // Accepted values for |cpu_type| and |cpu_subtype| (e.g., CPU_TYPE_X86 or
- // CPU_TYPE_POWERPC) are listed in /usr/include/mach/machine.h.
- // If |cpu_type| is 0, then the native cpu type is used. If |cpu_subtype| is
- // CPU_SUBTYPE_MULTIPLE, the match is only done on |cpu_type|.
- // Returns false if opening the file failed or if the |cpu_type|/|cpu_subtype|
- // is not present in the file.
- // Return the unique identifier in |identifier|.
- // The current implementation will look for the (in order of priority):
- // LC_UUID, LC_ID_DYLIB, or MD5 hash of the given |cpu_type|.
- bool MachoIdentifier(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char identifier[16]);
-
- // Convert the |identifier| data to a NULL terminated string. The string will
- // be formatted as a UUID (e.g., 22F065BB-FC9C-49F7-80FE-26A7CEBD7BCE).
- // The |buffer| should be at least 37 bytes long to receive all of the data
- // and termination. Shorter buffers will contain truncated data.
- static void ConvertIdentifierToString(const unsigned char identifier[16],
- char *buffer, int buffer_length);
-
- private:
- // Storage for the path specified
- char path_[PATH_MAX];
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_MAC_FILE_ID_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.cc
deleted file mode 100644
index 245be82659..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdio.h>
-#include <sys/wait.h>
-#include <unistd.h>
-
-namespace google_breakpad {
-
-void LaunchReporter(const char *reporter_executable_path,
- const char *config_file_path) {
- const char* argv[] = { reporter_executable_path, config_file_path, NULL };
-
- // Launch the reporter
- pid_t pid = fork();
-
- if (pid == -1) {
- perror("fork");
- fprintf(stderr, "Failed to fork reporter process\n");
- return;
- }
-
- // If we're in the child, load in our new executable and run.
- // The parent will not wait for the child to complete.
- if (pid == 0) {
- execv(argv[0], (char* const*)argv);
- perror("exec");
- fprintf(stderr,
- "Failed to launch reporter process from path %s\n",
- reporter_executable_path);
- unlink(config_file_path); // launch failed - get rid of config file
- _exit(1);
- }
-
- // Wait until the Reporter child process exits.
- //
-
- // We'll use a timeout of one minute.
- int timeout_count = 60; // 60 seconds
-
- while (timeout_count-- > 0) {
- int status;
- pid_t result = waitpid(pid, &status, WNOHANG);
-
- if (result == 0) {
- // The child has not yet finished.
- sleep(1);
- } else if (result == -1) {
- // error occurred.
- break;
- } else {
- // child has finished
- break;
- }
- }
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.h b/toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.h
deleted file mode 100644
index 4531123c2d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/launch_reporter.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_MAC_LAUNCH_REPORTER_H__
-#define COMMON_MAC_LAUNCH_REPORTER_H__
-
-namespace google_breakpad {
-
-// Launch the crash dump sender app.
-// |reporter_executable_path| is the path to the sender executable.
-// |config_file_path| is the path to the config file.
-void LaunchReporter(const char *reporter_executable_path,
- const char *config_file_path);
-
-} // namespace google_breakpad
-
-#endif // COMMON_MAC_LAUNCH_REPORTER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc
deleted file mode 100644
index c396ad888d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.cc
+++ /dev/null
@@ -1,369 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// macho_id.cc: Functions to gather identifying information from a macho file
-//
-// See macho_id.h for documentation
-//
-// Author: Dan Waylonis
-
-
-#include <fcntl.h>
-#include <mach-o/loader.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "common/mac/macho_id.h"
-#include "common/mac/macho_walker.h"
-#include "common/mac/macho_utilities.h"
-
-namespace MacFileUtilities {
-
-using google_breakpad::MD5Init;
-using google_breakpad::MD5Update;
-using google_breakpad::MD5Final;
-
-MachoID::MachoID(const char *path)
- : memory_(0),
- memory_size_(0),
- crc_(0),
- md5_context_(),
- update_function_(NULL) {
- snprintf(path_, sizeof(path_), "%s", path);
-}
-
-MachoID::MachoID(const char *path, void *memory, size_t size)
- : memory_(memory),
- memory_size_(size),
- crc_(0),
- md5_context_(),
- update_function_(NULL) {
- snprintf(path_, sizeof(path_), "%s", path);
-}
-
-MachoID::~MachoID() {
-}
-
-// The CRC info is from http://en.wikipedia.org/wiki/Adler-32
-// With optimizations from http://www.zlib.net/
-
-// The largest prime smaller than 65536
-#define MOD_ADLER 65521
-// MAX_BLOCK is the largest n such that 255n(n+1)/2 + (n+1)(MAX_BLOCK-1) <= 2^32-1
-#define MAX_BLOCK 5552
-
-void MachoID::UpdateCRC(unsigned char *bytes, size_t size) {
-// Unrolled loops for summing
-#define DO1(buf,i) {sum1 += (buf)[i]; sum2 += sum1;}
-#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
-#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
-#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
-#define DO16(buf) DO8(buf,0); DO8(buf,8);
- // Split up the crc
- uint32_t sum1 = crc_ & 0xFFFF;
- uint32_t sum2 = (crc_ >> 16) & 0xFFFF;
-
- // Do large blocks
- while (size >= MAX_BLOCK) {
- size -= MAX_BLOCK;
- int block_count = MAX_BLOCK / 16;
- do {
- DO16(bytes);
- bytes += 16;
- } while (--block_count);
- sum1 %= MOD_ADLER;
- sum2 %= MOD_ADLER;
- }
-
- // Do remaining bytes
- if (size) {
- while (size >= 16) {
- size -= 16;
- DO16(bytes);
- bytes += 16;
- }
- while (size--) {
- sum1 += *bytes++;
- sum2 += sum1;
- }
- sum1 %= MOD_ADLER;
- sum2 %= MOD_ADLER;
- crc_ = (sum2 << 16) | sum1;
- }
-}
-
-void MachoID::UpdateMD5(unsigned char *bytes, size_t size) {
- MD5Update(&md5_context_, bytes, static_cast<unsigned>(size));
-}
-
-void MachoID::Update(MachoWalker *walker, off_t offset, size_t size) {
- if (!update_function_ || !size)
- return;
-
- // Read up to 4k bytes at a time
- unsigned char buffer[4096];
- size_t buffer_size;
- off_t file_offset = offset;
- while (size > 0) {
- if (size > sizeof(buffer)) {
- buffer_size = sizeof(buffer);
- size -= buffer_size;
- } else {
- buffer_size = size;
- size = 0;
- }
-
- if (!walker->ReadBytes(buffer, buffer_size, file_offset))
- return;
-
- (this->*update_function_)(buffer, buffer_size);
- file_offset += buffer_size;
- }
-}
-
-bool MachoID::UUIDCommand(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char bytes[16]) {
- struct breakpad_uuid_command uuid_cmd;
- uuid_cmd.cmd = 0;
- if (!WalkHeader(cpu_type, cpu_subtype, UUIDWalkerCB, &uuid_cmd))
- return false;
-
- // If we found the command, we'll have initialized the uuid_command
- // structure
- if (uuid_cmd.cmd == LC_UUID) {
- memcpy(bytes, uuid_cmd.uuid, sizeof(uuid_cmd.uuid));
- return true;
- }
-
- return false;
-}
-
-bool MachoID::IDCommand(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char identifier[16]) {
- struct dylib_command dylib_cmd;
- dylib_cmd.cmd = 0;
- if (!WalkHeader(cpu_type, cpu_subtype, IDWalkerCB, &dylib_cmd))
- return false;
-
- // If we found the command, we'll have initialized the dylib_command
- // structure
- if (dylib_cmd.cmd == LC_ID_DYLIB) {
- // Take the hashed filename, version, and compatability version bytes
- // to form the first 12 bytes, pad the rest with zeros
-
- // create a crude hash of the filename to generate the first 4 bytes
- identifier[0] = 0;
- identifier[1] = 0;
- identifier[2] = 0;
- identifier[3] = 0;
-
- for (int j = 0, i = (int)strlen(path_)-1; i>=0 && path_[i]!='/'; ++j, --i) {
- identifier[j%4] += path_[i];
- }
-
- identifier[4] = (dylib_cmd.dylib.current_version >> 24) & 0xFF;
- identifier[5] = (dylib_cmd.dylib.current_version >> 16) & 0xFF;
- identifier[6] = (dylib_cmd.dylib.current_version >> 8) & 0xFF;
- identifier[7] = dylib_cmd.dylib.current_version & 0xFF;
- identifier[8] = (dylib_cmd.dylib.compatibility_version >> 24) & 0xFF;
- identifier[9] = (dylib_cmd.dylib.compatibility_version >> 16) & 0xFF;
- identifier[10] = (dylib_cmd.dylib.compatibility_version >> 8) & 0xFF;
- identifier[11] = dylib_cmd.dylib.compatibility_version & 0xFF;
- identifier[12] = (cpu_type >> 24) & 0xFF;
- identifier[13] = (cpu_type >> 16) & 0xFF;
- identifier[14] = (cpu_type >> 8) & 0xFF;
- identifier[15] = cpu_type & 0xFF;
-
- return true;
- }
-
- return false;
-}
-
-uint32_t MachoID::Adler32(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
- update_function_ = &MachoID::UpdateCRC;
- crc_ = 0;
-
- if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this))
- return 0;
-
- return crc_;
-}
-
-bool MachoID::MD5(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype, unsigned char identifier[16]) {
- update_function_ = &MachoID::UpdateMD5;
-
- MD5Init(&md5_context_);
-
- if (!WalkHeader(cpu_type, cpu_subtype, WalkerCB, this))
- return false;
-
- MD5Final(identifier, &md5_context_);
- return true;
-}
-
-bool MachoID::WalkHeader(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- MachoWalker::LoadCommandCallback callback,
- void *context) {
- if (memory_) {
- MachoWalker walker(memory_, memory_size_, callback, context);
- return walker.WalkHeader(cpu_type, cpu_subtype);
- } else {
- MachoWalker walker(path_, callback, context);
- return walker.WalkHeader(cpu_type, cpu_subtype);
- }
-}
-
-// static
-bool MachoID::WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context) {
- MachoID *macho_id = (MachoID *)context;
-
- if (cmd->cmd == LC_SEGMENT) {
- struct segment_command seg;
-
- if (!walker->ReadBytes(&seg, sizeof(seg), offset))
- return false;
-
- if (swap)
- breakpad_swap_segment_command(&seg);
-
- struct mach_header_64 header;
- off_t header_offset;
-
- if (!walker->CurrentHeader(&header, &header_offset))
- return false;
-
- // Process segments that have sections:
- // (e.g., __TEXT, __DATA, __IMPORT, __OBJC)
- offset += sizeof(struct segment_command);
- struct section sec;
- for (unsigned long i = 0; i < seg.nsects; ++i) {
- if (!walker->ReadBytes(&sec, sizeof(sec), offset))
- return false;
-
- if (swap)
- breakpad_swap_section(&sec, 1);
-
- // sections of type S_ZEROFILL are "virtual" and contain no data
- // in the file itself
- if ((sec.flags & SECTION_TYPE) != S_ZEROFILL && sec.offset != 0)
- macho_id->Update(walker, header_offset + sec.offset, sec.size);
-
- offset += sizeof(struct section);
- }
- } else if (cmd->cmd == LC_SEGMENT_64) {
- struct segment_command_64 seg64;
-
- if (!walker->ReadBytes(&seg64, sizeof(seg64), offset))
- return false;
-
- if (swap)
- breakpad_swap_segment_command_64(&seg64);
-
- struct mach_header_64 header;
- off_t header_offset;
-
- if (!walker->CurrentHeader(&header, &header_offset))
- return false;
-
- // Process segments that have sections:
- // (e.g., __TEXT, __DATA, __IMPORT, __OBJC)
- offset += sizeof(struct segment_command_64);
- struct section_64 sec64;
- for (unsigned long i = 0; i < seg64.nsects; ++i) {
- if (!walker->ReadBytes(&sec64, sizeof(sec64), offset))
- return false;
-
- if (swap)
- breakpad_swap_section_64(&sec64, 1);
-
- // sections of type S_ZEROFILL are "virtual" and contain no data
- // in the file itself
- if ((sec64.flags & SECTION_TYPE) != S_ZEROFILL && sec64.offset != 0)
- macho_id->Update(walker,
- header_offset + sec64.offset,
- (size_t)sec64.size);
-
- offset += sizeof(struct section_64);
- }
- }
-
- // Continue processing
- return true;
-}
-
-// static
-bool MachoID::UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context) {
- if (cmd->cmd == LC_UUID) {
- struct breakpad_uuid_command *uuid_cmd =
- (struct breakpad_uuid_command *)context;
-
- if (!walker->ReadBytes(uuid_cmd, sizeof(struct breakpad_uuid_command),
- offset))
- return false;
-
- if (swap)
- breakpad_swap_uuid_command(uuid_cmd);
-
- return false;
- }
-
- // Continue processing
- return true;
-}
-
-// static
-bool MachoID::IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context) {
- if (cmd->cmd == LC_ID_DYLIB) {
- struct dylib_command *dylib_cmd = (struct dylib_command *)context;
-
- if (!walker->ReadBytes(dylib_cmd, sizeof(struct dylib_command), offset))
- return false;
-
- if (swap)
- breakpad_swap_dylib_command(dylib_cmd);
-
- return false;
- }
-
- // Continue processing
- return true;
-}
-
-} // namespace MacFileUtilities
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h
deleted file mode 100644
index 1037549124..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_id.h
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// macho_id.h: Functions to gather identifying information from a macho file
-//
-// Author: Dan Waylonis
-
-#ifndef COMMON_MAC_MACHO_ID_H__
-#define COMMON_MAC_MACHO_ID_H__
-
-#include <limits.h>
-#include <mach/machine.h>
-#include <mach-o/loader.h>
-
-#include "common/mac/macho_walker.h"
-#include "common/md5.h"
-
-namespace MacFileUtilities {
-
-class MachoID {
- public:
- MachoID(const char *path);
- MachoID(const char *path, void *memory, size_t size);
- ~MachoID();
-
- // For the given |cpu_type| and |cpu_subtype|, return a UUID from the LC_UUID
- // command.
- // Return false if there isn't a LC_UUID command.
- bool UUIDCommand(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char identifier[16]);
-
- // For the given |cpu_type| and |cpu_subtype|, return a UUID from the
- // LC_ID_DYLIB command.
- // Return false if there isn't a LC_ID_DYLIB command.
- bool IDCommand(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char identifier[16]);
-
- // For the given |cpu_type| and |cpu_subtype|, return the Adler32 CRC for the
- // mach-o data segment(s).
- // Return 0 on error (e.g., if the file is not a mach-o file)
- uint32_t Adler32(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype);
-
- // For the given |cpu_type|, and |cpu_subtype| return the MD5 for the mach-o
- // data segment(s).
- // Return true on success, false otherwise
- bool MD5(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- unsigned char identifier[16]);
-
- private:
- // Signature of class member function to be called with data read from file
- typedef void (MachoID::*UpdateFunction)(unsigned char *bytes, size_t size);
-
- // Update the CRC value by examining |size| |bytes| and applying the algorithm
- // to each byte.
- void UpdateCRC(unsigned char *bytes, size_t size);
-
- // Update the MD5 value by examining |size| |bytes| and applying the algorithm
- // to each byte.
- void UpdateMD5(unsigned char *bytes, size_t size);
-
- // Bottleneck for update routines
- void Update(MachoWalker *walker, off_t offset, size_t size);
-
- // Factory for the MachoWalker
- bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype,
- MachoWalker::LoadCommandCallback callback, void *context);
-
- // The callback from the MachoWalker for CRC and MD5
- static bool WalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context);
-
- // The callback from the MachoWalker for LC_UUID
- static bool UUIDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context);
-
- // The callback from the MachoWalker for LC_ID_DYLIB
- static bool IDWalkerCB(MachoWalker *walker, load_command *cmd, off_t offset,
- bool swap, void *context);
-
- // File path
- char path_[PATH_MAX];
-
- // Memory region to read from
- void *memory_;
-
- // Size of the memory region
- size_t memory_size_;
-
- // The current crc value
- uint32_t crc_;
-
- // The MD5 context
- google_breakpad::MD5Context md5_context_;
-
- // The current update to call from the Update callback
- UpdateFunction update_function_;
-};
-
-} // namespace MacFileUtilities
-
-#endif // COMMON_MAC_MACHO_ID_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc
deleted file mode 100644
index 52f3c411be..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.cc
+++ /dev/null
@@ -1,539 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// macho_reader.cc: Implementation of google_breakpad::Mach_O::FatReader and
-// google_breakpad::Mach_O::Reader. See macho_reader.h for details.
-
-#include "common/mac/macho_reader.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-// Unfortunately, CPU_TYPE_ARM is not define for 10.4.
-#if !defined(CPU_TYPE_ARM)
-#define CPU_TYPE_ARM 12
-#endif
-
-#if !defined(CPU_TYPE_ARM_64)
-#define CPU_TYPE_ARM_64 16777228
-#endif
-
-namespace google_breakpad {
-namespace mach_o {
-
-// If NDEBUG is #defined, then the 'assert' macro doesn't evaluate its
-// arguments, so you can't place expressions that do necessary work in
-// the argument of an assert. Nor can you assign the result of the
-// expression to a variable and assert that the variable's value is
-// true: you'll get unused variable warnings when NDEBUG is #defined.
-//
-// ASSERT_ALWAYS_EVAL always evaluates its argument, and asserts that
-// the result is true if NDEBUG is not #defined.
-#if defined(NDEBUG)
-#define ASSERT_ALWAYS_EVAL(x) (x)
-#else
-#define ASSERT_ALWAYS_EVAL(x) assert(x)
-#endif
-
-void FatReader::Reporter::BadHeader() {
- fprintf(stderr, "%s: file is neither a fat binary file"
- " nor a Mach-O object file\n", filename_.c_str());
-}
-
-void FatReader::Reporter::TooShort() {
- fprintf(stderr, "%s: file too short for the data it claims to contain\n",
- filename_.c_str());
-}
-
-void FatReader::Reporter::MisplacedObjectFile() {
- fprintf(stderr, "%s: file too short for the object files it claims"
- " to contain\n", filename_.c_str());
-}
-
-bool FatReader::Read(const uint8_t *buffer, size_t size) {
- buffer_.start = buffer;
- buffer_.end = buffer + size;
- ByteCursor cursor(&buffer_);
-
- // Fat binaries always use big-endian, so read the magic number in
- // that endianness. To recognize Mach-O magic numbers, which can use
- // either endianness, check for both the proper and reversed forms
- // of the magic numbers.
- cursor.set_big_endian(true);
- if (cursor >> magic_) {
- if (magic_ == FAT_MAGIC) {
- // How many object files does this fat binary contain?
- uint32_t object_files_count;
- if (!(cursor >> object_files_count)) { // nfat_arch
- reporter_->TooShort();
- return false;
- }
-
- // Read the list of object files.
- object_files_.resize(object_files_count);
- for (size_t i = 0; i < object_files_count; i++) {
- struct fat_arch objfile;
-
- // Read this object file entry, byte-swapping as appropriate.
- cursor >> objfile.cputype
- >> objfile.cpusubtype
- >> objfile.offset
- >> objfile.size
- >> objfile.align;
-
- SuperFatArch super_fat_arch(objfile);
- object_files_[i] = super_fat_arch;
-
- if (!cursor) {
- reporter_->TooShort();
- return false;
- }
- // Does the file actually have the bytes this entry refers to?
- size_t fat_size = buffer_.Size();
- if (objfile.offset > fat_size ||
- objfile.size > fat_size - objfile.offset) {
- reporter_->MisplacedObjectFile();
- return false;
- }
- }
-
- return true;
- } else if (magic_ == MH_MAGIC || magic_ == MH_MAGIC_64 ||
- magic_ == MH_CIGAM || magic_ == MH_CIGAM_64) {
- // If this is a little-endian Mach-O file, fix the cursor's endianness.
- if (magic_ == MH_CIGAM || magic_ == MH_CIGAM_64)
- cursor.set_big_endian(false);
- // Record the entire file as a single entry in the object file list.
- object_files_.resize(1);
-
- // Get the cpu type and subtype from the Mach-O header.
- if (!(cursor >> object_files_[0].cputype
- >> object_files_[0].cpusubtype)) {
- reporter_->TooShort();
- return false;
- }
-
- object_files_[0].offset = 0;
- object_files_[0].size = static_cast<uint64_t>(buffer_.Size());
- // This alignment is correct for 32 and 64-bit x86 and ppc.
- // See get_align in the lipo source for other architectures:
- // http://www.opensource.apple.com/source/cctools/cctools-773/misc/lipo.c
- object_files_[0].align = 12; // 2^12 == 4096
- return true;
- }
- }
- reporter_->BadHeader();
- return false;
-}
-
-void Reader::Reporter::BadHeader() {
- fprintf(stderr, "%s: file is not a Mach-O object file\n", filename_.c_str());
-}
-
-void Reader::Reporter::CPUTypeMismatch(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype) {
- fprintf(stderr, "%s: CPU type %d, subtype %d does not match expected"
- " type %d, subtype %d\n",
- filename_.c_str(), cpu_type, cpu_subtype,
- expected_cpu_type, expected_cpu_subtype);
-}
-
-void Reader::Reporter::HeaderTruncated() {
- fprintf(stderr, "%s: file does not contain a complete Mach-O header\n",
- filename_.c_str());
-}
-
-void Reader::Reporter::LoadCommandRegionTruncated() {
- fprintf(stderr, "%s: file too short to hold load command region"
- " given in Mach-O header\n", filename_.c_str());
-}
-
-void Reader::Reporter::LoadCommandsOverrun(size_t claimed, size_t i,
- LoadCommandType type) {
- fprintf(stderr, "%s: file's header claims there are %zu"
- " load commands, but load command #%zu",
- filename_.c_str(), claimed, i);
- if (type) fprintf(stderr, ", of type %d,", type);
- fprintf(stderr, " extends beyond the end of the load command region\n");
-}
-
-void Reader::Reporter::LoadCommandTooShort(size_t i, LoadCommandType type) {
- fprintf(stderr, "%s: the contents of load command #%zu, of type %d,"
- " extend beyond the size given in the load command's header\n",
- filename_.c_str(), i, type);
-}
-
-void Reader::Reporter::SectionsMissing(const string &name) {
- fprintf(stderr, "%s: the load command for segment '%s'"
- " is too short to hold the section headers it claims to have\n",
- filename_.c_str(), name.c_str());
-}
-
-void Reader::Reporter::MisplacedSegmentData(const string &name) {
- fprintf(stderr, "%s: the segment '%s' claims its contents lie beyond"
- " the end of the file\n", filename_.c_str(), name.c_str());
-}
-
-void Reader::Reporter::MisplacedSectionData(const string &section,
- const string &segment) {
- fprintf(stderr, "%s: the section '%s' in segment '%s'"
- " claims its contents lie outside the segment's contents\n",
- filename_.c_str(), section.c_str(), segment.c_str());
-}
-
-void Reader::Reporter::MisplacedSymbolTable() {
- fprintf(stderr, "%s: the LC_SYMTAB load command claims that the symbol"
- " table's contents are located beyond the end of the file\n",
- filename_.c_str());
-}
-
-void Reader::Reporter::UnsupportedCPUType(cpu_type_t cpu_type) {
- fprintf(stderr, "%s: CPU type %d is not supported\n",
- filename_.c_str(), cpu_type);
-}
-
-bool Reader::Read(const uint8_t *buffer,
- size_t size,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype) {
- assert(!buffer_.start);
- buffer_.start = buffer;
- buffer_.end = buffer + size;
- ByteCursor cursor(&buffer_, true);
- uint32_t magic;
- if (!(cursor >> magic)) {
- reporter_->HeaderTruncated();
- return false;
- }
-
- if (expected_cpu_type != CPU_TYPE_ANY) {
- uint32_t expected_magic;
- // validate that magic matches the expected cpu type
- switch (expected_cpu_type) {
- case CPU_TYPE_ARM:
- case CPU_TYPE_I386:
- expected_magic = MH_CIGAM;
- break;
- case CPU_TYPE_POWERPC:
- expected_magic = MH_MAGIC;
- break;
- case CPU_TYPE_ARM_64:
- case CPU_TYPE_X86_64:
- expected_magic = MH_CIGAM_64;
- break;
- case CPU_TYPE_POWERPC64:
- expected_magic = MH_MAGIC_64;
- break;
- default:
- reporter_->UnsupportedCPUType(expected_cpu_type);
- return false;
- }
-
- if (expected_magic != magic) {
- reporter_->BadHeader();
- return false;
- }
- }
-
- // Since the byte cursor is in big-endian mode, a reversed magic number
- // always indicates a little-endian file, regardless of our own endianness.
- switch (magic) {
- case MH_MAGIC: big_endian_ = true; bits_64_ = false; break;
- case MH_CIGAM: big_endian_ = false; bits_64_ = false; break;
- case MH_MAGIC_64: big_endian_ = true; bits_64_ = true; break;
- case MH_CIGAM_64: big_endian_ = false; bits_64_ = true; break;
- default:
- reporter_->BadHeader();
- return false;
- }
- cursor.set_big_endian(big_endian_);
- uint32_t commands_size, reserved;
- cursor >> cpu_type_ >> cpu_subtype_ >> file_type_ >> load_command_count_
- >> commands_size >> flags_;
- if (bits_64_)
- cursor >> reserved;
- if (!cursor) {
- reporter_->HeaderTruncated();
- return false;
- }
-
- if (expected_cpu_type != CPU_TYPE_ANY &&
- (expected_cpu_type != cpu_type_ ||
- expected_cpu_subtype != cpu_subtype_)) {
- reporter_->CPUTypeMismatch(cpu_type_, cpu_subtype_,
- expected_cpu_type, expected_cpu_subtype);
- return false;
- }
-
- cursor
- .PointTo(&load_commands_.start, commands_size)
- .PointTo(&load_commands_.end, 0);
- if (!cursor) {
- reporter_->LoadCommandRegionTruncated();
- return false;
- }
-
- return true;
-}
-
-bool Reader::WalkLoadCommands(Reader::LoadCommandHandler *handler) const {
- ByteCursor list_cursor(&load_commands_, big_endian_);
-
- for (size_t index = 0; index < load_command_count_; ++index) {
- // command refers to this load command alone, so that cursor will
- // refuse to read past the load command's end. But since we haven't
- // read the size yet, let command initially refer to the entire
- // remainder of the load command series.
- ByteBuffer command(list_cursor.here(), list_cursor.Available());
- ByteCursor cursor(&command, big_endian_);
-
- // Read the command type and size --- fields common to all commands.
- uint32_t type, size;
- if (!(cursor >> type)) {
- reporter_->LoadCommandsOverrun(load_command_count_, index, 0);
- return false;
- }
- if (!(cursor >> size) || size > command.Size()) {
- reporter_->LoadCommandsOverrun(load_command_count_, index, type);
- return false;
- }
-
- // Now that we've read the length, restrict command's range to this
- // load command only.
- command.end = command.start + size;
-
- switch (type) {
- case LC_SEGMENT:
- case LC_SEGMENT_64: {
- Segment segment;
- segment.bits_64 = (type == LC_SEGMENT_64);
- size_t word_size = segment.bits_64 ? 8 : 4;
- cursor.CString(&segment.name, 16);
- size_t file_offset, file_size;
- cursor
- .Read(word_size, false, &segment.vmaddr)
- .Read(word_size, false, &segment.vmsize)
- .Read(word_size, false, &file_offset)
- .Read(word_size, false, &file_size);
- cursor >> segment.maxprot
- >> segment.initprot
- >> segment.nsects
- >> segment.flags;
- if (!cursor) {
- reporter_->LoadCommandTooShort(index, type);
- return false;
- }
- if (file_offset > buffer_.Size() ||
- file_size > buffer_.Size() - file_offset) {
- reporter_->MisplacedSegmentData(segment.name);
- return false;
- }
- // Mach-O files in .dSYM bundles have the contents of the loaded
- // segments removed, and their file offsets and file sizes zeroed
- // out. To help us handle this special case properly, give such
- // segments' contents NULL starting and ending pointers.
- if (file_offset == 0 && file_size == 0) {
- segment.contents.start = segment.contents.end = NULL;
- } else {
- segment.contents.start = buffer_.start + file_offset;
- segment.contents.end = segment.contents.start + file_size;
- }
- // The section list occupies the remainder of this load command's space.
- segment.section_list.start = cursor.here();
- segment.section_list.end = command.end;
-
- if (!handler->SegmentCommand(segment))
- return false;
- break;
- }
-
- case LC_SYMTAB: {
- uint32_t symoff, nsyms, stroff, strsize;
- cursor >> symoff >> nsyms >> stroff >> strsize;
- if (!cursor) {
- reporter_->LoadCommandTooShort(index, type);
- return false;
- }
- // How big are the entries in the symbol table?
- // sizeof(struct nlist_64) : sizeof(struct nlist),
- // but be paranoid about alignment vs. target architecture.
- size_t symbol_size = bits_64_ ? 16 : 12;
- // How big is the entire symbol array?
- size_t symbols_size = nsyms * symbol_size;
- if (symoff > buffer_.Size() || symbols_size > buffer_.Size() - symoff ||
- stroff > buffer_.Size() || strsize > buffer_.Size() - stroff) {
- reporter_->MisplacedSymbolTable();
- return false;
- }
- ByteBuffer entries(buffer_.start + symoff, symbols_size);
- ByteBuffer names(buffer_.start + stroff, strsize);
- if (!handler->SymtabCommand(entries, names))
- return false;
- break;
- }
-
- default: {
- if (!handler->UnknownCommand(type, command))
- return false;
- break;
- }
- }
-
- list_cursor.set_here(command.end);
- }
-
- return true;
-}
-
-// A load command handler that looks for a segment of a given name.
-class Reader::SegmentFinder : public LoadCommandHandler {
- public:
- // Create a load command handler that looks for a segment named NAME,
- // and sets SEGMENT to describe it if found.
- SegmentFinder(const string &name, Segment *segment)
- : name_(name), segment_(segment), found_() { }
-
- // Return true if the traversal found the segment, false otherwise.
- bool found() const { return found_; }
-
- bool SegmentCommand(const Segment &segment) {
- if (segment.name == name_) {
- *segment_ = segment;
- found_ = true;
- return false;
- }
- return true;
- }
-
- private:
- // The name of the segment our creator is looking for.
- const string &name_;
-
- // Where we should store the segment if found. (WEAK)
- Segment *segment_;
-
- // True if we found the segment.
- bool found_;
-};
-
-bool Reader::FindSegment(const string &name, Segment *segment) const {
- SegmentFinder finder(name, segment);
- WalkLoadCommands(&finder);
- return finder.found();
-}
-
-bool Reader::WalkSegmentSections(const Segment &segment,
- SectionHandler *handler) const {
- size_t word_size = segment.bits_64 ? 8 : 4;
- ByteCursor cursor(&segment.section_list, big_endian_);
-
- for (size_t i = 0; i < segment.nsects; i++) {
- Section section;
- section.bits_64 = segment.bits_64;
- uint64_t size;
- uint32_t offset, dummy32;
- cursor
- .CString(&section.section_name, 16)
- .CString(&section.segment_name, 16)
- .Read(word_size, false, &section.address)
- .Read(word_size, false, &size)
- >> offset
- >> section.align
- >> dummy32
- >> dummy32
- >> section.flags
- >> dummy32
- >> dummy32;
- if (section.bits_64)
- cursor >> dummy32;
- if (!cursor) {
- reporter_->SectionsMissing(segment.name);
- return false;
- }
- const uint32_t section_type = section.flags & SECTION_TYPE;
- if (section_type == S_ZEROFILL || section_type == S_THREAD_LOCAL_ZEROFILL ||
- section_type == S_GB_ZEROFILL) {
- // Zero-fill sections have a size, but no contents.
- section.contents.start = section.contents.end = NULL;
- } else if (segment.contents.start == NULL &&
- segment.contents.end == NULL) {
- // Mach-O files in .dSYM bundles have the contents of the loaded
- // segments removed, and their file offsets and file sizes zeroed
- // out. However, the sections within those segments still have
- // non-zero sizes. There's no reason to call MisplacedSectionData in
- // this case; the caller may just need the section's load
- // address. But do set the contents' limits to NULL, for safety.
- section.contents.start = section.contents.end = NULL;
- } else {
- if (offset < size_t(segment.contents.start - buffer_.start) ||
- offset > size_t(segment.contents.end - buffer_.start) ||
- size > size_t(segment.contents.end - buffer_.start - offset)) {
- reporter_->MisplacedSectionData(section.section_name,
- section.segment_name);
- return false;
- }
- section.contents.start = buffer_.start + offset;
- section.contents.end = section.contents.start + size;
- }
- if (!handler->HandleSection(section))
- return false;
- }
- return true;
-}
-
-// A SectionHandler that builds a SectionMap for the sections within a
-// given segment.
-class Reader::SectionMapper: public SectionHandler {
- public:
- // Create a SectionHandler that populates MAP with an entry for
- // each section it is given.
- SectionMapper(SectionMap *map) : map_(map) { }
- bool HandleSection(const Section &section) {
- (*map_)[section.section_name] = section;
- return true;
- }
- private:
- // The map under construction. (WEAK)
- SectionMap *map_;
-};
-
-bool Reader::MapSegmentSections(const Segment &segment,
- SectionMap *section_map) const {
- section_map->clear();
- SectionMapper mapper(section_map);
- return WalkSegmentSections(segment, &mapper);
-}
-
-} // namespace mach_o
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.h
deleted file mode 100644
index 30db742db5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader.h
+++ /dev/null
@@ -1,460 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// macho_reader.h: A class for parsing Mach-O files.
-
-#ifndef BREAKPAD_COMMON_MAC_MACHO_READER_H_
-#define BREAKPAD_COMMON_MAC_MACHO_READER_H_
-
-#include <mach-o/loader.h>
-#include <mach-o/fat.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "common/byte_cursor.h"
-#include "common/mac/super_fat_arch.h"
-
-namespace google_breakpad {
-namespace mach_o {
-
-using std::map;
-using std::string;
-using std::vector;
-
-// The Mac headers don't specify particular types for these groups of
-// constants, but defining them here provides some documentation
-// value. We also give them the same width as the fields in which
-// they appear, which makes them a bit easier to use with ByteCursors.
-typedef uint32_t Magic;
-typedef uint32_t FileType;
-typedef uint32_t FileFlags;
-typedef uint32_t LoadCommandType;
-typedef uint32_t SegmentFlags;
-typedef uint32_t SectionFlags;
-
-// A parser for fat binary files, used to store universal binaries.
-// When applied to a (non-fat) Mach-O file, this behaves as if the
-// file were a fat file containing a single object file.
-class FatReader {
- public:
-
- // A class for reporting errors found while parsing fat binary files. The
- // default definitions of these methods print messages to stderr.
- class Reporter {
- public:
- // Create a reporter that attributes problems to |filename|.
- explicit Reporter(const string &filename) : filename_(filename) { }
-
- virtual ~Reporter() { }
-
- // The data does not begin with a fat binary or Mach-O magic number.
- // This is a fatal error.
- virtual void BadHeader();
-
- // The Mach-O fat binary file ends abruptly, without enough space
- // to contain an object file it claims is present.
- virtual void MisplacedObjectFile();
-
- // The file ends abruptly: either it is not large enough to hold a
- // complete header, or the header implies that contents are present
- // beyond the actual end of the file.
- virtual void TooShort();
-
- private:
- // The filename to which the reader should attribute problems.
- string filename_;
- };
-
- // Create a fat binary file reader that uses |reporter| to report problems.
- explicit FatReader(Reporter *reporter) : reporter_(reporter) { }
-
- // Read the |size| bytes at |buffer| as a fat binary file. On success,
- // return true; on failure, report the problem to reporter_ and return
- // false.
- //
- // If the data is a plain Mach-O file, rather than a fat binary file,
- // then the reader behaves as if it had found a fat binary file whose
- // single object file is the Mach-O file.
- bool Read(const uint8_t *buffer, size_t size);
-
- // Return an array of 'SuperFatArch' structures describing the
- // object files present in this fat binary file. Set |size| to the
- // number of elements in the array.
- //
- // Assuming Read returned true, the entries are validated: it is safe to
- // assume that the offsets and sizes in each SuperFatArch refer to subranges
- // of the bytes passed to Read.
- //
- // If there are no object files in this fat binary, then this
- // function can return NULL.
- //
- // The array is owned by this FatReader instance; it will be freed when
- // this FatReader is destroyed.
- //
- // This function returns a C-style array instead of a vector to make it
- // possible to use the result with OS X functions like NXFindBestFatArch,
- // so that the symbol dumper will behave consistently with other OS X
- // utilities that work with fat binaries.
- const SuperFatArch* object_files(size_t *count) const {
- *count = object_files_.size();
- if (object_files_.size() > 0)
- return &object_files_[0];
- return NULL;
- }
-
- private:
- // We use this to report problems parsing the file's contents. (WEAK)
- Reporter *reporter_;
-
- // The contents of the fat binary or Mach-O file we're parsing. We do not
- // own the storage it refers to.
- ByteBuffer buffer_;
-
- // The magic number of this binary, in host byte order.
- Magic magic_;
-
- // The list of object files in this binary.
- // object_files_.size() == fat_header.nfat_arch
- vector<SuperFatArch> object_files_;
-};
-
-// A segment in a Mach-O file. All these fields have been byte-swapped as
-// appropriate for use by the executing architecture.
-struct Segment {
- // The ByteBuffers below point into the bytes passed to the Reader that
- // created this Segment.
-
- ByteBuffer section_list; // This segment's section list.
- ByteBuffer contents; // This segment's contents.
-
- // This segment's name.
- string name;
-
- // The address at which this segment should be loaded in memory. If
- // bits_64 is false, only the bottom 32 bits of this value are valid.
- uint64_t vmaddr;
-
- // The size of this segment when loaded into memory. This may be larger
- // than contents.Size(), in which case the extra area will be
- // initialized with zeros. If bits_64 is false, only the bottom 32 bits
- // of this value are valid.
- uint64_t vmsize;
-
- // The maximum and initial VM protection of this segment's contents.
- uint32_t maxprot;
- uint32_t initprot;
-
- // The number of sections in section_list.
- uint32_t nsects;
-
- // Flags describing this segment, from SegmentFlags.
- uint32_t flags;
-
- // True if this is a 64-bit section; false if it is a 32-bit section.
- bool bits_64;
-};
-
-// A section in a Mach-O file. All these fields have been byte-swapped as
-// appropriate for use by the executing architecture.
-struct Section {
- // This section's contents. This points into the bytes passed to the
- // Reader that created this Section.
- ByteBuffer contents;
-
- // This section's name.
- string section_name; // section[_64].sectname
- // The name of the segment this section belongs to.
- string segment_name; // section[_64].segname
-
- // The address at which this section's contents should be loaded in
- // memory. If bits_64 is false, only the bottom 32 bits of this value
- // are valid.
- uint64_t address;
-
- // The contents of this section should be loaded into memory at an
- // address which is a multiple of (two raised to this power).
- uint32_t align;
-
- // Flags from SectionFlags describing the section's contents.
- uint32_t flags;
-
- // We don't support reading relocations yet.
-
- // True if this is a 64-bit section; false if it is a 32-bit section.
- bool bits_64;
-};
-
-// A map from section names to Sections.
-typedef map<string, Section> SectionMap;
-
-// A reader for a Mach-O file.
-//
-// This does not handle fat binaries; see FatReader above. FatReader
-// provides a friendly interface for parsing data that could be either a
-// fat binary or a Mach-O file.
-class Reader {
- public:
-
- // A class for reporting errors found while parsing Mach-O files. The
- // default definitions of these member functions print messages to
- // stderr.
- class Reporter {
- public:
- // Create a reporter that attributes problems to |filename|.
- explicit Reporter(const string &filename) : filename_(filename) { }
- virtual ~Reporter() { }
-
- // Reporter functions for fatal errors return void; the reader will
- // definitely return an error to its caller after calling them
-
- // The data does not begin with a Mach-O magic number, or the magic
- // number does not match the expected value for the cpu architecture.
- // This is a fatal error.
- virtual void BadHeader();
-
- // The data contained in a Mach-O fat binary (|cpu_type|, |cpu_subtype|)
- // does not match the expected CPU architecture
- // (|expected_cpu_type|, |expected_cpu_subtype|).
- virtual void CPUTypeMismatch(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype);
-
- // The file ends abruptly: either it is not large enough to hold a
- // complete header, or the header implies that contents are present
- // beyond the actual end of the file.
- virtual void HeaderTruncated();
-
- // The file's load command region, as given in the Mach-O header, is
- // too large for the file.
- virtual void LoadCommandRegionTruncated();
-
- // The file's Mach-O header claims the file contains |claimed| load
- // commands, but the I'th load command, of type |type|, extends beyond
- // the end of the load command region, as given by the Mach-O header.
- // If |type| is zero, the command's type was unreadable.
- virtual void LoadCommandsOverrun(size_t claimed, size_t i,
- LoadCommandType type);
-
- // The contents of the |i|'th load command, of type |type|, extend beyond
- // the size given in the load command's header.
- virtual void LoadCommandTooShort(size_t i, LoadCommandType type);
-
- // The LC_SEGMENT or LC_SEGMENT_64 load command for the segment named
- // |name| is too short to hold the sections that its header says it does.
- // (This more specific than LoadCommandTooShort.)
- virtual void SectionsMissing(const string &name);
-
- // The segment named |name| claims that its contents lie beyond the end
- // of the file.
- virtual void MisplacedSegmentData(const string &name);
-
- // The section named |section| in the segment named |segment| claims that
- // its contents do not lie entirely within the segment.
- virtual void MisplacedSectionData(const string &section,
- const string &segment);
-
- // The LC_SYMTAB command claims that symbol table contents are located
- // beyond the end of the file.
- virtual void MisplacedSymbolTable();
-
- // An attempt was made to read a Mach-O file of the unsupported
- // CPU architecture |cpu_type|.
- virtual void UnsupportedCPUType(cpu_type_t cpu_type);
-
- private:
- string filename_;
- };
-
- // A handler for sections parsed from a segment. The WalkSegmentSections
- // member function accepts an instance of this class, and applies it to
- // each section defined in a given segment.
- class SectionHandler {
- public:
- virtual ~SectionHandler() { }
-
- // Called to report that the segment's section list contains |section|.
- // This should return true if the iteration should continue, or false
- // if it should stop.
- virtual bool HandleSection(const Section &section) = 0;
- };
-
- // A handler for the load commands in a Mach-O file.
- class LoadCommandHandler {
- public:
- LoadCommandHandler() { }
- virtual ~LoadCommandHandler() { }
-
- // When called from WalkLoadCommands, the following handler functions
- // should return true if they wish to continue iterating over the load
- // command list, or false if they wish to stop iterating.
- //
- // When called from LoadCommandIterator::Handle or Reader::Handle,
- // these functions' return values are simply passed through to Handle's
- // caller.
- //
- // The definitions provided by this base class simply return true; the
- // default is to silently ignore sections whose member functions the
- // subclass doesn't override.
-
- // COMMAND is load command we don't recognize. We provide only the
- // command type and a ByteBuffer enclosing the command's data (If we
- // cannot parse the command type or its size, we call
- // reporter_->IncompleteLoadCommand instead.)
- virtual bool UnknownCommand(LoadCommandType type,
- const ByteBuffer &contents) {
- return true;
- }
-
- // The load command is LC_SEGMENT or LC_SEGMENT_64, defining a segment
- // with the properties given in |segment|.
- virtual bool SegmentCommand(const Segment &segment) {
- return true;
- }
-
- // The load command is LC_SYMTAB. |entries| holds the array of nlist
- // entries, and |names| holds the strings the entries refer to.
- virtual bool SymtabCommand(const ByteBuffer &entries,
- const ByteBuffer &names) {
- return true;
- }
-
- // Add handler functions for more load commands here as needed.
- };
-
- // Create a Mach-O file reader that reports problems to |reporter|.
- explicit Reader(Reporter *reporter)
- : reporter_(reporter) { }
-
- // Read the given data as a Mach-O file. The reader retains pointers
- // into the data passed, so the data should live as long as the reader
- // does. On success, return true; on failure, return false.
- //
- // At most one of these functions should be invoked once on each Reader
- // instance.
- bool Read(const uint8_t *buffer,
- size_t size,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype);
- bool Read(const ByteBuffer &buffer,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype) {
- return Read(buffer.start,
- buffer.Size(),
- expected_cpu_type,
- expected_cpu_subtype);
- }
-
- // Return this file's characteristics, as found in the Mach-O header.
- cpu_type_t cpu_type() const { return cpu_type_; }
- cpu_subtype_t cpu_subtype() const { return cpu_subtype_; }
- FileType file_type() const { return file_type_; }
- FileFlags flags() const { return flags_; }
-
- // Return true if this is a 64-bit Mach-O file, false if it is a 32-bit
- // Mach-O file.
- bool bits_64() const { return bits_64_; }
-
- // Return true if this is a big-endian Mach-O file, false if it is
- // little-endian.
- bool big_endian() const { return big_endian_; }
-
- // Apply |handler| to each load command in this Mach-O file, stopping when
- // a handler function returns false. If we encounter a malformed load
- // command, report it via reporter_ and return false. Return true if all
- // load commands were parseable and all handlers returned true.
- bool WalkLoadCommands(LoadCommandHandler *handler) const;
-
- // Set |segment| to describe the segment named |name|, if present. If
- // found, |segment|'s byte buffers refer to a subregion of the bytes
- // passed to Read. If we find the section, return true; otherwise,
- // return false.
- bool FindSegment(const string &name, Segment *segment) const;
-
- // Apply |handler| to each section defined in |segment|. If |handler| returns
- // false, stop iterating and return false. If all calls to |handler| return
- // true and we reach the end of the section list, return true.
- bool WalkSegmentSections(const Segment &segment, SectionHandler *handler)
- const;
-
- // Clear |section_map| and then populate it with a map of the sections
- // in |segment|, from section names to Section structures.
- // Each Section's contents refer to bytes in |segment|'s contents.
- // On success, return true; if a problem occurs, report it and return false.
- bool MapSegmentSections(const Segment &segment, SectionMap *section_map)
- const;
-
- private:
- // Used internally.
- class SegmentFinder;
- class SectionMapper;
-
- // We use this to report problems parsing the file's contents. (WEAK)
- Reporter *reporter_;
-
- // The contents of the Mach-O file we're parsing. We do not own the
- // storage it refers to.
- ByteBuffer buffer_;
-
- // True if this file is big-endian.
- bool big_endian_;
-
- // True if this file is a 64-bit Mach-O file.
- bool bits_64_;
-
- // This file's cpu type and subtype.
- cpu_type_t cpu_type_; // mach_header[_64].cputype
- cpu_subtype_t cpu_subtype_; // mach_header[_64].cpusubtype
-
- // This file's type.
- FileType file_type_; // mach_header[_64].filetype
-
- // The region of buffer_ occupied by load commands.
- ByteBuffer load_commands_;
-
- // The number of load commands in load_commands_.
- uint32_t load_command_count_; // mach_header[_64].ncmds
-
- // This file's header flags.
- FileFlags flags_;
-};
-
-} // namespace mach_o
-} // namespace google_breakpad
-
-#endif // BREAKPAD_COMMON_MAC_MACHO_READER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc
deleted file mode 100644
index 8ceab14bf2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_reader_unittest.cc
+++ /dev/null
@@ -1,1902 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// macho_reader_unittest.cc: Unit tests for google_breakpad::Mach_O::FatReader
-// and google_breakpad::Mach_O::Reader.
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/mac/macho_reader.h"
-#include "common/test_assembler.h"
-
-namespace mach_o = google_breakpad::mach_o;
-namespace test_assembler = google_breakpad::test_assembler;
-
-using mach_o::FatReader;
-using mach_o::FileFlags;
-using mach_o::FileType;
-using mach_o::LoadCommandType;
-using mach_o::Reader;
-using mach_o::Section;
-using mach_o::SectionMap;
-using mach_o::Segment;
-using test_assembler::Endianness;
-using test_assembler::Label;
-using test_assembler::kBigEndian;
-using test_assembler::kLittleEndian;
-using test_assembler::kUnsetEndian;
-using google_breakpad::ByteBuffer;
-using std::map;
-using std::string;
-using std::vector;
-using testing::AllOf;
-using testing::DoAll;
-using testing::Field;
-using testing::InSequence;
-using testing::Matcher;
-using testing::Return;
-using testing::SaveArg;
-using testing::Test;
-using testing::_;
-
-
-// Mock classes for the reader's various reporters and handlers.
-
-class MockFatReaderReporter: public FatReader::Reporter {
- public:
- MockFatReaderReporter(const string &filename)
- : FatReader::Reporter(filename) { }
- MOCK_METHOD0(BadHeader, void());
- MOCK_METHOD0(MisplacedObjectFile, void());
- MOCK_METHOD0(TooShort, void());
-};
-
-class MockReaderReporter: public Reader::Reporter {
- public:
- MockReaderReporter(const string &filename) : Reader::Reporter(filename) { }
- MOCK_METHOD0(BadHeader, void());
- MOCK_METHOD4(CPUTypeMismatch, void(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype));
- MOCK_METHOD0(HeaderTruncated, void());
- MOCK_METHOD0(LoadCommandRegionTruncated, void());
- MOCK_METHOD3(LoadCommandsOverrun, void(size_t claimed, size_t i,
- LoadCommandType type));
- MOCK_METHOD2(LoadCommandTooShort, void(size_t i, LoadCommandType type));
- MOCK_METHOD1(SectionsMissing, void(const string &name));
- MOCK_METHOD1(MisplacedSegmentData, void(const string &name));
- MOCK_METHOD2(MisplacedSectionData, void(const string &section,
- const string &segment));
- MOCK_METHOD0(MisplacedSymbolTable, void());
- MOCK_METHOD1(UnsupportedCPUType, void(cpu_type_t cpu_type));
-};
-
-class MockLoadCommandHandler: public Reader::LoadCommandHandler {
- public:
- MOCK_METHOD2(UnknownCommand, bool(LoadCommandType, const ByteBuffer &));
- MOCK_METHOD1(SegmentCommand, bool(const Segment &));
- MOCK_METHOD2(SymtabCommand, bool(const ByteBuffer &, const ByteBuffer &));
-};
-
-class MockSectionHandler: public Reader::SectionHandler {
- public:
- MOCK_METHOD1(HandleSection, bool(const Section &section));
-};
-
-
-// Tests for mach_o::FatReader.
-
-// Since the effect of these functions is to write to stderr, the
-// results of these tests must be inspected by hand.
-TEST(FatReaderReporter, BadHeader) {
- FatReader::Reporter reporter("filename");
- reporter.BadHeader();
-}
-
-TEST(FatReaderReporter, MisplacedObjectFile) {
- FatReader::Reporter reporter("filename");
- reporter.MisplacedObjectFile();
-}
-
-TEST(FatReaderReporter, TooShort) {
- FatReader::Reporter reporter("filename");
- reporter.TooShort();
-}
-
-TEST(MachOReaderReporter, BadHeader) {
- Reader::Reporter reporter("filename");
- reporter.BadHeader();
-}
-
-TEST(MachOReaderReporter, CPUTypeMismatch) {
- Reader::Reporter reporter("filename");
- reporter.CPUTypeMismatch(CPU_TYPE_I386, CPU_SUBTYPE_X86_ALL,
- CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_ALL);
-}
-
-TEST(MachOReaderReporter, HeaderTruncated) {
- Reader::Reporter reporter("filename");
- reporter.HeaderTruncated();
-}
-
-TEST(MachOReaderReporter, LoadCommandRegionTruncated) {
- Reader::Reporter reporter("filename");
- reporter.LoadCommandRegionTruncated();
-}
-
-TEST(MachOReaderReporter, LoadCommandsOverrun) {
- Reader::Reporter reporter("filename");
- reporter.LoadCommandsOverrun(10, 9, LC_DYSYMTAB);
- reporter.LoadCommandsOverrun(10, 9, 0);
-}
-
-TEST(MachOReaderReporter, LoadCommandTooShort) {
- Reader::Reporter reporter("filename");
- reporter.LoadCommandTooShort(11, LC_SYMTAB);
-}
-
-TEST(MachOReaderReporter, SectionsMissing) {
- Reader::Reporter reporter("filename");
- reporter.SectionsMissing("segment name");
-}
-
-TEST(MachOReaderReporter, MisplacedSegmentData) {
- Reader::Reporter reporter("filename");
- reporter.MisplacedSegmentData("segment name");
-}
-
-TEST(MachOReaderReporter, MisplacedSectionData) {
- Reader::Reporter reporter("filename");
- reporter.MisplacedSectionData("section name", "segment name");
-}
-
-TEST(MachOReaderReporter, MisplacedSymbolTable) {
- Reader::Reporter reporter("filename");
- reporter.MisplacedSymbolTable();
-}
-
-TEST(MachOReaderReporter, UnsupportedCPUType) {
- Reader::Reporter reporter("filename");
- reporter.UnsupportedCPUType(CPU_TYPE_HPPA);
-}
-
-struct FatReaderFixture {
- FatReaderFixture()
- : fat(kBigEndian),
- reporter("reporter filename"),
- reader(&reporter), object_files() {
- EXPECT_CALL(reporter, BadHeader()).Times(0);
- EXPECT_CALL(reporter, TooShort()).Times(0);
-
- // here, start, and Mark are file offsets in 'fat'.
- fat.start() = 0;
- }
- // Append a 'fat_arch' entry to 'fat', with the given field values.
- void AppendFatArch(cpu_type_t type, cpu_subtype_t subtype,
- Label offset, Label size, uint32_t align) {
- fat
- .B32(type)
- .B32(subtype)
- .B32(offset)
- .B32(size)
- .B32(align);
- }
- // Append |n| dummy 'fat_arch' entries to 'fat'. The cpu type and
- // subtype have unrealistic values.
- void AppendDummyArchEntries(int n) {
- for (int i = 0; i < n; i++)
- AppendFatArch(0xb68ad617, 0x715a0840, 0, 0, 1);
- }
- void ReadFat(bool expect_parse_success = true) {
- ASSERT_TRUE(fat.GetContents(&contents));
- fat_bytes = reinterpret_cast<const uint8_t *>(contents.data());
- if (expect_parse_success) {
- EXPECT_TRUE(reader.Read(fat_bytes, contents.size()));
- size_t fat_files_count;
- const SuperFatArch* fat_files = reader.object_files(&fat_files_count);
- object_files.resize(fat_files_count);
- for (size_t i = 0; i < fat_files_count; ++i) {
- EXPECT_TRUE(fat_files[i].ConvertToFatArch(&object_files[i]));
- }
- }
- else
- EXPECT_FALSE(reader.Read(fat_bytes, contents.size()));
- }
- test_assembler::Section fat;
- MockFatReaderReporter reporter;
- FatReader reader;
- string contents;
- const uint8_t *fat_bytes;
- vector<struct fat_arch> object_files;
-};
-
-class FatReaderTest: public FatReaderFixture, public Test { };
-
-TEST_F(FatReaderTest, BadMagic) {
- EXPECT_CALL(reporter, BadHeader()).Times(1);
- fat
- .B32(0xcafed00d) // magic number (incorrect)
- .B32(10); // number of architectures
- AppendDummyArchEntries(10);
- ReadFat(false);
-}
-
-TEST_F(FatReaderTest, HeaderTooShort) {
- EXPECT_CALL(reporter, TooShort()).Times(1);
- fat
- .B32(0xcafebabe); // magic number
- ReadFat(false);
-}
-
-TEST_F(FatReaderTest, ObjectListTooShort) {
- EXPECT_CALL(reporter, TooShort()).Times(1);
- fat
- .B32(0xcafebabe) // magic number
- .B32(10); // number of architectures
- AppendDummyArchEntries(9); // nine dummy architecture entries...
- fat // and a tenth, missing a byte at the end
- .B32(0x3d46c8fc) // cpu type
- .B32(0x8a7bfb01) // cpu subtype
- .B32(0) // offset
- .B32(0) // size
- .Append(3, '*'); // one byte short of a four-byte alignment
- ReadFat(false);
-}
-
-TEST_F(FatReaderTest, DataTooShort) {
- EXPECT_CALL(reporter, MisplacedObjectFile()).Times(1);
- Label arch_data;
- fat
- .B32(0xcafebabe) // magic number
- .B32(1); // number of architectures
- AppendFatArch(0xb4d4a366, 0x4ba4f525, arch_data, 40, 0);
- fat
- .Mark(&arch_data) // file data begins here
- .Append(30, '*'); // only 30 bytes, not 40 as header claims
- ReadFat(false);
-}
-
-TEST_F(FatReaderTest, NoObjectFiles) {
- fat
- .B32(0xcafebabe) // magic number
- .B32(0); // number of architectures
- ReadFat();
- EXPECT_EQ(0U, object_files.size());
-}
-
-TEST_F(FatReaderTest, OneObjectFile) {
- Label obj1_offset;
- fat
- .B32(0xcafebabe) // magic number
- .B32(1); // number of architectures
- // First object file list entry
- AppendFatArch(0x5e3a6e91, 0x52ccd852, obj1_offset, 0x42, 0x355b15b2);
- // First object file data
- fat
- .Mark(&obj1_offset)
- .Append(0x42, '*'); // dummy contents
- ReadFat();
- ASSERT_EQ(1U, object_files.size());
- EXPECT_EQ(0x5e3a6e91, object_files[0].cputype);
- EXPECT_EQ(0x52ccd852, object_files[0].cpusubtype);
- EXPECT_EQ(obj1_offset.Value(), object_files[0].offset);
- EXPECT_EQ(0x42U, object_files[0].size);
- EXPECT_EQ(0x355b15b2U, object_files[0].align);
-}
-
-TEST_F(FatReaderTest, ThreeObjectFiles) {
- Label obj1, obj2, obj3;
- fat
- .B32(0xcafebabe) // magic number
- .B32(3); // number of architectures
- // Three object file list entries.
- AppendFatArch(0x0cb92c30, 0x6a159a71, obj1, 0xfb4, 0x2615dbe8);
- AppendFatArch(0x0f3f1cbb, 0x6c55e90f, obj2, 0xc31, 0x83af6ffd);
- AppendFatArch(0x3717276d, 0x10ecdc84, obj3, 0x4b3, 0x035267d7);
- fat
- // First object file data
- .Mark(&obj1)
- .Append(0xfb4, '*') // dummy contents
- // Second object file data
- .Mark(&obj2)
- .Append(0xc31, '%') // dummy contents
- // Third object file data
- .Mark(&obj3)
- .Append(0x4b3, '^'); // dummy contents
-
- ReadFat();
-
- ASSERT_EQ(3U, object_files.size());
-
- // First object file.
- EXPECT_EQ(0x0cb92c30, object_files[0].cputype);
- EXPECT_EQ(0x6a159a71, object_files[0].cpusubtype);
- EXPECT_EQ(obj1.Value(), object_files[0].offset);
- EXPECT_EQ(0xfb4U, object_files[0].size);
- EXPECT_EQ(0x2615dbe8U, object_files[0].align);
-
- // Second object file.
- EXPECT_EQ(0x0f3f1cbb, object_files[1].cputype);
- EXPECT_EQ(0x6c55e90f, object_files[1].cpusubtype);
- EXPECT_EQ(obj2.Value(), object_files[1].offset);
- EXPECT_EQ(0xc31U, object_files[1].size);
- EXPECT_EQ(0x83af6ffdU, object_files[1].align);
-
- // Third object file.
- EXPECT_EQ(0x3717276d, object_files[2].cputype);
- EXPECT_EQ(0x10ecdc84, object_files[2].cpusubtype);
- EXPECT_EQ(obj3.Value(), object_files[2].offset);
- EXPECT_EQ(0x4b3U, object_files[2].size);
- EXPECT_EQ(0x035267d7U, object_files[2].align);
-}
-
-TEST_F(FatReaderTest, BigEndianMachO32) {
- fat.set_endianness(kBigEndian);
- fat
- .D32(0xfeedface) // Mach-O file magic number
- .D32(0x1a9d0518) // cpu type
- .D32(0x1b779357) // cpu subtype
- .D32(0x009df67e) // file type
- .D32(0) // no load commands
- .D32(0) // the load commands occupy no bytes
- .D32(0x21987a99); // flags
-
- ReadFat();
-
- // FatReader should treat a Mach-O file as if it were a fat binary file
- // containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files.size());
- EXPECT_EQ(0x1a9d0518, object_files[0].cputype);
- EXPECT_EQ(0x1b779357, object_files[0].cpusubtype);
- EXPECT_EQ(0U, object_files[0].offset);
- EXPECT_EQ(contents.size(), object_files[0].size);
-}
-
-TEST_F(FatReaderTest, BigEndianMachO64) {
- fat.set_endianness(kBigEndian);
- fat
- .D32(0xfeedfacf) // Mach-O 64-bit file magic number
- .D32(0x5aff8487) // cpu type
- .D32(0x4c6a57f7) // cpu subtype
- .D32(0x4392d2c8) // file type
- .D32(0) // no load commands
- .D32(0) // the load commands occupy no bytes
- .D32(0x1b033eea); // flags
-
- ReadFat();
-
- // FatReader should treat a Mach-O file as if it were a fat binary file
- // containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files.size());
- EXPECT_EQ(0x5aff8487, object_files[0].cputype);
- EXPECT_EQ(0x4c6a57f7, object_files[0].cpusubtype);
- EXPECT_EQ(0U, object_files[0].offset);
- EXPECT_EQ(contents.size(), object_files[0].size);
-}
-
-TEST_F(FatReaderTest, LittleEndianMachO32) {
- fat.set_endianness(kLittleEndian);
- fat
- .D32(0xfeedface) // Mach-O file magic number
- .D32(0x1a9d0518) // cpu type
- .D32(0x1b779357) // cpu subtype
- .D32(0x009df67e) // file type
- .D32(0) // no load commands
- .D32(0) // the load commands occupy no bytes
- .D32(0x21987a99); // flags
-
- ReadFat();
-
- // FatReader should treat a Mach-O file as if it were a fat binary file
- // containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files.size());
- EXPECT_EQ(0x1a9d0518, object_files[0].cputype);
- EXPECT_EQ(0x1b779357, object_files[0].cpusubtype);
- EXPECT_EQ(0U, object_files[0].offset);
- EXPECT_EQ(contents.size(), object_files[0].size);
-}
-
-TEST_F(FatReaderTest, LittleEndianMachO64) {
- fat.set_endianness(kLittleEndian);
- fat
- .D32(0xfeedfacf) // Mach-O 64-bit file magic number
- .D32(0x5aff8487) // cpu type
- .D32(0x4c6a57f7) // cpu subtype
- .D32(0x4392d2c8) // file type
- .D32(0) // no load commands
- .D32(0) // the load commands occupy no bytes
- .D32(0x1b033eea); // flags
-
- ReadFat();
-
- // FatReader should treat a Mach-O file as if it were a fat binary file
- // containing one object file --- the whole thing.
- ASSERT_EQ(1U, object_files.size());
- EXPECT_EQ(0x5aff8487, object_files[0].cputype);
- EXPECT_EQ(0x4c6a57f7, object_files[0].cpusubtype);
- EXPECT_EQ(0U, object_files[0].offset);
- EXPECT_EQ(contents.size(), object_files[0].size);
-}
-
-TEST_F(FatReaderTest, IncompleteMach) {
- fat.set_endianness(kLittleEndian);
- fat
- .D32(0xfeedfacf) // Mach-O 64-bit file magic number
- .D32(0x5aff8487); // cpu type
- // Truncated!
-
- EXPECT_CALL(reporter, TooShort()).WillOnce(Return());
-
- ReadFat(false);
-}
-
-
-// General mach_o::Reader tests.
-
-// Dynamically scoped configuration data.
-class WithConfiguration {
- public:
- // Establish the given parameters as the default for SizedSections
- // created within the dynamic scope of this instance.
- WithConfiguration(Endianness endianness, size_t word_size)
- : endianness_(endianness), word_size_(word_size), saved_(current_) {
- current_ = this;
- }
- ~WithConfiguration() { current_ = saved_; }
- static Endianness endianness() {
- assert(current_);
- return current_->endianness_;
- }
- static size_t word_size() {
- assert(current_);
- return current_->word_size_;
- }
-
- private:
- // The innermost WithConfiguration in whose dynamic scope we are
- // currently executing.
- static WithConfiguration *current_;
-
- // The innermost WithConfiguration whose dynamic scope encloses this
- // WithConfiguration.
- Endianness endianness_;
- size_t word_size_;
- WithConfiguration *saved_;
-};
-
-WithConfiguration *WithConfiguration::current_ = NULL;
-
-// A test_assembler::Section with a size that we can cite. The start(),
-// Here() and Mark() member functions of a SizedSection always represent
-// offsets within the overall file.
-class SizedSection: public test_assembler::Section {
- public:
- // Construct a section of the given endianness and word size.
- explicit SizedSection(Endianness endianness, size_t word_size)
- : test_assembler::Section(endianness), word_size_(word_size) {
- assert(word_size_ == 32 || word_size_ == 64);
- }
- SizedSection()
- : test_assembler::Section(WithConfiguration::endianness()),
- word_size_(WithConfiguration::word_size()) {
- assert(word_size_ == 32 || word_size_ == 64);
- }
-
- // Access/set this section's word size.
- size_t word_size() const { return word_size_; }
- void set_word_size(size_t word_size) {
- assert(word_size_ == 32 || word_size_ == 64);
- word_size_ = word_size;
- }
-
- // Return a label representing the size this section will have when it
- // is Placed in some containing section.
- Label final_size() const { return final_size_; }
-
- // Append SECTION to the end of this section, and call its Finish member.
- // Return a reference to this section.
- SizedSection &Place(SizedSection *section) {
- assert(section->endianness() == endianness());
- section->Finish();
- section->start() = Here();
- test_assembler::Section::Append(*section);
- return *this;
- }
-
- protected:
- // Mark this section's contents as complete. For plain SizedSections, we
- // set SECTION's start to its position in this section, and its final_size
- // label to its current size. Derived classes can extend this as needed
- // for their additional semantics.
- virtual void Finish() {
- final_size_ = Size();
- }
-
- // The word size for this data: either 32 or 64.
- size_t word_size_;
-
- private:
- // This section's final size, set when we are placed in some other
- // SizedSection.
- Label final_size_;
-};
-
-// A SizedSection that is loaded into memory at a particular address.
-class LoadedSection: public SizedSection {
- public:
- explicit LoadedSection(Label address = Label()) : address_(address) { }
-
- // Return a label representing this section's address.
- Label address() const { return address_; }
-
- // Placing a loaded section within a loaded section sets the relationship
- // between their addresses.
- LoadedSection &Place(LoadedSection *section) {
- section->address() = address() + Size();
- SizedSection::Place(section);
- return *this;
- }
-
- protected:
- // The address at which this section's contents will be loaded.
- Label address_;
-};
-
-// A SizedSection representing a segment load command.
-class SegmentLoadCommand: public SizedSection {
- public:
- SegmentLoadCommand() : section_count_(0) { }
-
- // Append a segment load command header with the given characteristics.
- // The load command will refer to CONTENTS, which must be Placed in the
- // file separately, at the desired position. Return a reference to this
- // section.
- SegmentLoadCommand &Header(const string &name, const LoadedSection &contents,
- uint32_t maxprot, uint32_t initprot,
- uint32_t flags) {
- assert(contents.word_size() == word_size());
- D32(word_size() == 32 ? LC_SEGMENT : LC_SEGMENT_64);
- D32(final_size());
- AppendCString(name, 16);
- Append(endianness(), word_size() / 8, contents.address());
- Append(endianness(), word_size() / 8, vmsize_);
- Append(endianness(), word_size() / 8, contents.start());
- Append(endianness(), word_size() / 8, contents.final_size());
- D32(maxprot);
- D32(initprot);
- D32(final_section_count_);
- D32(flags);
-
- content_final_size_ = contents.final_size();
-
- return *this;
- }
-
- // Return a label representing the size of this segment when loaded into
- // memory. If this label is still undefined by the time we place this
- // segment, it defaults to the final size of the segment's in-file
- // contents. Return a reference to this load command.
- Label &vmsize() { return vmsize_; }
-
- // Add a section entry with the given characteristics to this segment
- // load command. Return a reference to this. The section entry will refer
- // to CONTENTS, which must be Placed in the segment's contents
- // separately, at the desired position.
- SegmentLoadCommand &AppendSectionEntry(const string &section_name,
- const string &segment_name,
- uint32_t alignment, uint32_t flags,
- const LoadedSection &contents) {
- AppendCString(section_name, 16);
- AppendCString(segment_name, 16);
- Append(endianness(), word_size() / 8, contents.address());
- Append(endianness(), word_size() / 8, contents.final_size());
- D32(contents.start());
- D32(alignment);
- D32(0); // relocations start
- D32(0); // relocations size
- D32(flags);
- D32(0x93656b95); // reserved1
- D32(0xc35a2473); // reserved2
- if (word_size() == 64)
- D32(0x70284b95); // reserved3
-
- section_count_++;
-
- return *this;
- }
-
- protected:
- void Finish() {
- final_section_count_ = section_count_;
- if (!vmsize_.IsKnownConstant())
- vmsize_ = content_final_size_;
- SizedSection::Finish();
- }
-
- private:
- // The number of sections that have been added to this segment so far.
- size_t section_count_;
-
- // A label representing the final number of sections this segment will hold.
- Label final_section_count_;
-
- // The size of the contents for this segment present in the file.
- Label content_final_size_;
-
- // A label representing the size of this segment when loaded; this can be
- // larger than the size of its file contents, the difference being
- // zero-filled. If not set explicitly by calling set_vmsize, this is set
- // equal to the size of the contents.
- Label vmsize_;
-};
-
-// A SizedSection holding a list of Mach-O load commands.
-class LoadCommands: public SizedSection {
- public:
- LoadCommands() : command_count_(0) { }
-
- // Return a label representing the final load command count.
- Label final_command_count() const { return final_command_count_; }
-
- // Increment the command count; return a reference to this section.
- LoadCommands &CountCommand() {
- command_count_++;
- return *this;
- }
-
- // Place COMMAND, containing a load command, at the end of this section.
- // Return a reference to this section.
- LoadCommands &Place(SizedSection *section) {
- SizedSection::Place(section);
- CountCommand();
- return *this;
- }
-
- protected:
- // Mark this load command list as complete.
- void Finish() {
- SizedSection::Finish();
- final_command_count_ = command_count_;
- }
-
- private:
- // The number of load commands we have added to this file so far.
- size_t command_count_;
-
- // A label representing the final command count.
- Label final_command_count_;
-};
-
-// A SizedSection holding the contents of a Mach-O file. Within a
-// MachOFile, the start, Here, and Mark members refer to file offsets.
-class MachOFile: public SizedSection {
- public:
- MachOFile() {
- start() = 0;
- }
-
- // Create a Mach-O file header using the given characteristics and load
- // command list. This Places COMMANDS immediately after the header.
- // Return a reference to this section.
- MachOFile &Header(LoadCommands *commands,
- cpu_type_t cpu_type = CPU_TYPE_X86,
- cpu_subtype_t cpu_subtype = CPU_SUBTYPE_I386_ALL,
- FileType file_type = MH_EXECUTE,
- uint32_t file_flags = (MH_TWOLEVEL |
- MH_DYLDLINK |
- MH_NOUNDEFS)) {
- D32(word_size() == 32 ? 0xfeedface : 0xfeedfacf); // magic number
- D32(cpu_type); // cpu type
- D32(cpu_subtype); // cpu subtype
- D32(file_type); // file type
- D32(commands->final_command_count()); // number of load commands
- D32(commands->final_size()); // their size in bytes
- D32(file_flags); // flags
- if (word_size() == 64)
- D32(0x55638b90); // reserved
- Place(commands);
- return *this;
- }
-};
-
-
-struct ReaderFixture {
- ReaderFixture()
- : reporter("reporter filename"),
- reader(&reporter) {
- EXPECT_CALL(reporter, BadHeader()).Times(0);
- EXPECT_CALL(reporter, CPUTypeMismatch(_, _, _, _)).Times(0);
- EXPECT_CALL(reporter, HeaderTruncated()).Times(0);
- EXPECT_CALL(reporter, LoadCommandRegionTruncated()).Times(0);
- EXPECT_CALL(reporter, LoadCommandsOverrun(_, _, _)).Times(0);
- EXPECT_CALL(reporter, LoadCommandTooShort(_, _)).Times(0);
- EXPECT_CALL(reporter, SectionsMissing(_)).Times(0);
- EXPECT_CALL(reporter, MisplacedSegmentData(_)).Times(0);
- EXPECT_CALL(reporter, MisplacedSectionData(_, _)).Times(0);
- EXPECT_CALL(reporter, MisplacedSymbolTable()).Times(0);
- EXPECT_CALL(reporter, UnsupportedCPUType(_)).Times(0);
-
- EXPECT_CALL(load_command_handler, UnknownCommand(_, _)).Times(0);
- EXPECT_CALL(load_command_handler, SegmentCommand(_)).Times(0);
- }
-
- void ReadFile(MachOFile *file,
- bool expect_parse_success,
- cpu_type_t expected_cpu_type,
- cpu_subtype_t expected_cpu_subtype) {
- ASSERT_TRUE(file->GetContents(&file_contents));
- file_bytes = reinterpret_cast<const uint8_t *>(file_contents.data());
- if (expect_parse_success) {
- EXPECT_TRUE(reader.Read(file_bytes,
- file_contents.size(),
- expected_cpu_type,
- expected_cpu_subtype));
- } else {
- EXPECT_FALSE(reader.Read(file_bytes,
- file_contents.size(),
- expected_cpu_type,
- expected_cpu_subtype));
- }
- }
-
- string file_contents;
- const uint8_t *file_bytes;
- MockReaderReporter reporter;
- Reader reader;
- MockLoadCommandHandler load_command_handler;
- MockSectionHandler section_handler;
-};
-
-class ReaderTest: public ReaderFixture, public Test { };
-
-TEST_F(ReaderTest, BadMagic) {
- WithConfiguration config(kLittleEndian, 32);
- const cpu_type_t kCPUType = 0x46b760df;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0x67bdebe1) // Not a proper magic number.
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- EXPECT_CALL(reporter, BadHeader()).WillOnce(Return());
- ReadFile(&file, false, CPU_TYPE_ANY, kCPUSubType);
-}
-
-TEST_F(ReaderTest, MismatchedMagic) {
- WithConfiguration config(kLittleEndian, 32);
- const cpu_type_t kCPUType = CPU_TYPE_I386;
- const cpu_subtype_t kCPUSubType = CPU_SUBTYPE_X86_ALL;
- MachOFile file;
- file
- .D32(MH_CIGAM) // Right magic, but winds up wrong
- // due to bitswapping
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- EXPECT_CALL(reporter, BadHeader()).WillOnce(Return());
- ReadFile(&file, false, kCPUType, kCPUSubType);
-}
-
-TEST_F(ReaderTest, ShortMagic) {
- WithConfiguration config(kBigEndian, 32);
- MachOFile file;
- file
- .D16(0xfeed); // magic number
- // truncated!
- EXPECT_CALL(reporter, HeaderTruncated()).WillOnce(Return());
- ReadFile(&file, false, CPU_TYPE_ANY, 0);
-}
-
-TEST_F(ReaderTest, ShortHeader) {
- WithConfiguration config(kBigEndian, 32);
- const cpu_type_t kCPUType = CPU_TYPE_ANY;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0xfeedface) // magic number
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0); // they occupy no bytes
- EXPECT_CALL(reporter, HeaderTruncated()).WillOnce(Return());
- ReadFile(&file, false, CPU_TYPE_ANY, kCPUSubType);
-}
-
-TEST_F(ReaderTest, MismatchedCPU) {
- WithConfiguration config(kBigEndian, 32);
- const cpu_type_t kCPUType = CPU_TYPE_I386;
- const cpu_subtype_t kCPUSubType = CPU_SUBTYPE_X86_ALL;
- MachOFile file;
- file
- .D32(MH_MAGIC) // Right magic for PPC (once bitswapped)
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- EXPECT_CALL(reporter,
- CPUTypeMismatch(CPU_TYPE_I386, CPU_SUBTYPE_X86_ALL,
- CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_ALL))
- .WillOnce(Return());
- ReadFile(&file, false, CPU_TYPE_POWERPC, CPU_SUBTYPE_POWERPC_ALL);
-}
-
-TEST_F(ReaderTest, LittleEndian32Bit) {
- WithConfiguration config(kLittleEndian, 32);
- const cpu_type_t kCPUType = 0x46b760df;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0xfeedface) // magic number
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- ReadFile(&file, true, CPU_TYPE_ANY, kCPUSubType);
- EXPECT_FALSE(reader.bits_64());
- EXPECT_FALSE(reader.big_endian());
- EXPECT_EQ(kCPUType, reader.cpu_type());
- EXPECT_EQ(kCPUSubType, reader.cpu_subtype());
- EXPECT_EQ(FileType(0x149fc717), reader.file_type());
- EXPECT_EQ(FileFlags(0x80e71d64), reader.flags());
-}
-
-TEST_F(ReaderTest, LittleEndian64Bit) {
- WithConfiguration config(kLittleEndian, 64);
- const cpu_type_t kCPUType = 0x46b760df;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0xfeedfacf) // magic number
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- ReadFile(&file, true, CPU_TYPE_ANY, kCPUSubType);
- EXPECT_TRUE(reader.bits_64());
- EXPECT_FALSE(reader.big_endian());
- EXPECT_EQ(kCPUType, reader.cpu_type());
- EXPECT_EQ(kCPUSubType, reader.cpu_subtype());
- EXPECT_EQ(FileType(0x149fc717), reader.file_type());
- EXPECT_EQ(FileFlags(0x80e71d64), reader.flags());
-}
-
-TEST_F(ReaderTest, BigEndian32Bit) {
- WithConfiguration config(kBigEndian, 32);
- const cpu_type_t kCPUType = 0x46b760df;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0xfeedface) // magic number
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- ReadFile(&file, true, CPU_TYPE_ANY, kCPUSubType);
- EXPECT_FALSE(reader.bits_64());
- EXPECT_TRUE(reader.big_endian());
- EXPECT_EQ(kCPUType, reader.cpu_type());
- EXPECT_EQ(kCPUSubType, reader.cpu_subtype());
- EXPECT_EQ(FileType(0x149fc717), reader.file_type());
- EXPECT_EQ(FileFlags(0x80e71d64), reader.flags());
-}
-
-TEST_F(ReaderTest, BigEndian64Bit) {
- WithConfiguration config(kBigEndian, 64);
- const cpu_type_t kCPUType = 0x46b760df;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0xfeedfacf) // magic number
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(0) // no load commands
- .D32(0) // they occupy no bytes
- .D32(0x80e71d64) // flags
- .D32(0); // reserved
- ReadFile(&file, true, CPU_TYPE_ANY, kCPUSubType);
- EXPECT_TRUE(reader.bits_64());
- EXPECT_TRUE(reader.big_endian());
- EXPECT_EQ(kCPUType, reader.cpu_type());
- EXPECT_EQ(kCPUSubType, reader.cpu_subtype());
- EXPECT_EQ(FileType(0x149fc717), reader.file_type());
- EXPECT_EQ(FileFlags(0x80e71d64), reader.flags());
-}
-
-
-// Load command tests.
-
-class LoadCommand: public ReaderFixture, public Test { };
-
-TEST_F(LoadCommand, RegionTruncated) {
- WithConfiguration config(kBigEndian, 64);
- const cpu_type_t kCPUType = 0x46b760df;
- const cpu_subtype_t kCPUSubType = 0x76a0e7f7;
- MachOFile file;
- file
- .D32(0xfeedfacf) // magic number
- .D32(kCPUType) // cpu type
- .D32(kCPUSubType) // cpu subtype
- .D32(0x149fc717) // file type
- .D32(1) // one load command
- .D32(40) // occupying 40 bytes
- .D32(0x80e71d64) // flags
- .D32(0) // reserved
- .Append(20, 0); // load command region, not as long as
- // Mach-O header promised
-
- EXPECT_CALL(reporter, LoadCommandRegionTruncated()).WillOnce(Return());
-
- ReadFile(&file, false, CPU_TYPE_ANY, kCPUSubType);
-}
-
-TEST_F(LoadCommand, None) {
- WithConfiguration config(kLittleEndian, 32);
- LoadCommands load_commands;
- MachOFile file;
- file.Header(&load_commands);
-
- ReadFile(&file, true, CPU_TYPE_X86, CPU_SUBTYPE_I386_ALL);
-
- EXPECT_FALSE(reader.bits_64());
- EXPECT_FALSE(reader.big_endian());
- EXPECT_EQ(CPU_TYPE_X86, reader.cpu_type());
- EXPECT_EQ(CPU_SUBTYPE_I386_ALL, reader.cpu_subtype());
- EXPECT_EQ(static_cast<uint32_t>(MH_EXECUTE), reader.file_type());
- EXPECT_EQ(FileFlags(MH_TWOLEVEL |
- MH_DYLDLINK |
- MH_NOUNDEFS),
- FileFlags(reader.flags()));
-
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, Unknown) {
- WithConfiguration config(kBigEndian, 32);
- LoadCommands load_commands;
- load_commands
- .CountCommand()
- .D32(0x33293d4a) // unknown load command
- .D32(40) // total size in bytes
- .Append(32, '*'); // dummy data
- MachOFile file;
- file.Header(&load_commands);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_FALSE(reader.bits_64());
- EXPECT_TRUE(reader.big_endian());
- EXPECT_EQ(CPU_TYPE_X86, reader.cpu_type());
- EXPECT_EQ(CPU_SUBTYPE_I386_ALL, reader.cpu_subtype());
- EXPECT_EQ(static_cast<uint32_t>(MH_EXECUTE), reader.file_type());
- EXPECT_EQ(FileFlags(MH_TWOLEVEL |
- MH_DYLDLINK |
- MH_NOUNDEFS),
- reader.flags());
-
- ByteBuffer expected;
- expected.start = file_bytes + load_commands.start().Value();
- expected.end = expected.start + load_commands.final_size().Value();
- EXPECT_CALL(load_command_handler, UnknownCommand(0x33293d4a,
- expected))
- .WillOnce(Return(true));
-
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, TypeIncomplete) {
- WithConfiguration config(kLittleEndian, 32);
- LoadCommands load_commands;
- load_commands
- .CountCommand()
- .Append(3, 0); // load command type, incomplete
-
- MachOFile file;
- file.Header(&load_commands);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, LoadCommandsOverrun(1, 0, 0))
- .WillOnce(Return());
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, LengthIncomplete) {
- WithConfiguration config(kBigEndian, 64);
- LoadCommands load_commands;
- load_commands
- .CountCommand()
- .D32(LC_SEGMENT); // load command
- // no length
- MachOFile file;
- file.Header(&load_commands);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, LoadCommandsOverrun(1, 0, LC_SEGMENT))
- .WillOnce(Return());
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, ContentIncomplete) {
- WithConfiguration config(kLittleEndian, 64);
- LoadCommands load_commands;
- load_commands
- .CountCommand()
- .D32(LC_SEGMENT) // load command
- .D32(40) // total size in bytes
- .Append(28, '*'); // not enough dummy data
- MachOFile file;
- file.Header(&load_commands);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, LoadCommandsOverrun(1, 0, LC_SEGMENT))
- .WillOnce(Return());
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, SegmentBE32) {
- WithConfiguration config(kBigEndian, 32);
- LoadedSection segment;
- segment.address() = 0x1891139c;
- segment.Append(42, '*'); // segment contents
- SegmentLoadCommand segment_command;
- segment_command
- .Header("froon", segment, 0x94d6dd22, 0x8bdbc319, 0x990a16dd);
- segment_command.vmsize() = 0xcb76584fU;
- LoadCommands load_commands;
- load_commands.Place(&segment_command);
- MachOFile file;
- file
- .Header(&load_commands)
- .Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_CALL(load_command_handler, SegmentCommand(_))
- .WillOnce(DoAll(SaveArg<0>(&actual_segment),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- EXPECT_EQ(false, actual_segment.bits_64);
- EXPECT_EQ("froon", actual_segment.name);
- EXPECT_EQ(0x1891139cU, actual_segment.vmaddr);
- EXPECT_EQ(0xcb76584fU, actual_segment.vmsize);
- EXPECT_EQ(0x94d6dd22U, actual_segment.maxprot);
- EXPECT_EQ(0x8bdbc319U, actual_segment.initprot);
- EXPECT_EQ(0x990a16ddU, actual_segment.flags);
- EXPECT_EQ(0U, actual_segment.nsects);
- EXPECT_EQ(0U, actual_segment.section_list.Size());
- EXPECT_EQ(segment.final_size().Value(), actual_segment.contents.Size());
-}
-
-TEST_F(LoadCommand, SegmentLE32) {
- WithConfiguration config(kLittleEndian, 32);
- LoadedSection segment;
- segment.address() = 0x4b877866;
- segment.Append(42, '*'); // segment contents
- SegmentLoadCommand segment_command;
- segment_command
- .Header("sixteenprecisely", segment,
- 0x350759ed, 0x6cf5a62e, 0x990a16dd);
- segment_command.vmsize() = 0xcb76584fU;
- LoadCommands load_commands;
- load_commands.Place(&segment_command);
- MachOFile file;
- file
- .Header(&load_commands)
- .Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_CALL(load_command_handler, SegmentCommand(_))
- .WillOnce(DoAll(SaveArg<0>(&actual_segment),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- EXPECT_EQ(false, actual_segment.bits_64);
- EXPECT_EQ("sixteenprecisely", actual_segment.name);
- EXPECT_EQ(0x4b877866U, actual_segment.vmaddr);
- EXPECT_EQ(0xcb76584fU, actual_segment.vmsize);
- EXPECT_EQ(0x350759edU, actual_segment.maxprot);
- EXPECT_EQ(0x6cf5a62eU, actual_segment.initprot);
- EXPECT_EQ(0x990a16ddU, actual_segment.flags);
- EXPECT_EQ(0U, actual_segment.nsects);
- EXPECT_EQ(0U, actual_segment.section_list.Size());
- EXPECT_EQ(segment.final_size().Value(), actual_segment.contents.Size());
-}
-
-TEST_F(LoadCommand, SegmentBE64) {
- WithConfiguration config(kBigEndian, 64);
- LoadedSection segment;
- segment.address() = 0x79f484f77009e511ULL;
- segment.Append(42, '*'); // segment contents
- SegmentLoadCommand segment_command;
- segment_command
- .Header("froon", segment, 0x42b45da5, 0x8bdbc319, 0xb2335220);
- segment_command.vmsize() = 0x8d92397ce6248abaULL;
- LoadCommands load_commands;
- load_commands.Place(&segment_command);
- MachOFile file;
- file
- .Header(&load_commands)
- .Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_CALL(load_command_handler, SegmentCommand(_))
- .WillOnce(DoAll(SaveArg<0>(&actual_segment),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- EXPECT_EQ(true, actual_segment.bits_64);
- EXPECT_EQ("froon", actual_segment.name);
- EXPECT_EQ(0x79f484f77009e511ULL, actual_segment.vmaddr);
- EXPECT_EQ(0x8d92397ce6248abaULL, actual_segment.vmsize);
- EXPECT_EQ(0x42b45da5U, actual_segment.maxprot);
- EXPECT_EQ(0x8bdbc319U, actual_segment.initprot);
- EXPECT_EQ(0xb2335220U, actual_segment.flags);
- EXPECT_EQ(0U, actual_segment.nsects);
- EXPECT_EQ(0U, actual_segment.section_list.Size());
- EXPECT_EQ(segment.final_size().Value(), actual_segment.contents.Size());
-}
-
-TEST_F(LoadCommand, SegmentLE64) {
- WithConfiguration config(kLittleEndian, 64);
- LoadedSection segment;
- segment.address() = 0x50c0501dc5922d35ULL;
- segment.Append(42, '*'); // segment contents
- SegmentLoadCommand segment_command;
- segment_command
- .Header("sixteenprecisely", segment,
- 0x917c339d, 0xdbc446fa, 0xb650b563);
- segment_command.vmsize() = 0x84ae73e7c75469bfULL;
- LoadCommands load_commands;
- load_commands.Place(&segment_command);
- MachOFile file;
- file
- .Header(&load_commands)
- .Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_CALL(load_command_handler, SegmentCommand(_))
- .WillOnce(DoAll(SaveArg<0>(&actual_segment),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- EXPECT_EQ(true, actual_segment.bits_64);
- EXPECT_EQ("sixteenprecisely", actual_segment.name);
- EXPECT_EQ(0x50c0501dc5922d35ULL, actual_segment.vmaddr);
- EXPECT_EQ(0x84ae73e7c75469bfULL, actual_segment.vmsize);
- EXPECT_EQ(0x917c339dU, actual_segment.maxprot);
- EXPECT_EQ(0xdbc446faU, actual_segment.initprot);
- EXPECT_EQ(0xb650b563U, actual_segment.flags);
- EXPECT_EQ(0U, actual_segment.nsects);
- EXPECT_EQ(0U, actual_segment.section_list.Size());
- EXPECT_EQ(segment.final_size().Value(), actual_segment.contents.Size());
-}
-
-TEST_F(LoadCommand, SegmentCommandTruncated) {
- WithConfiguration config(kBigEndian, 32);
- LoadedSection segment_contents;
- segment_contents.Append(20, '*'); // lah di dah
- SizedSection command;
- command
- .D32(LC_SEGMENT) // command type
- .D32(command.final_size()) // command size
- .AppendCString("too-short", 16) // segment name
- .D32(0x9c759211) // vmaddr
- .D32(segment_contents.final_size()) // vmsize
- .D32(segment_contents.start()) // file offset
- .D32(segment_contents.final_size()) // file size
- .D32(0x56f28446) // max protection
- .D32(0xe7910dcb) // initial protection
- .D32(0) // no sections
- .Append(3, 0); // flags (one byte short!)
- LoadCommands load_commands;
- load_commands.Place(&command);
- MachOFile file;
- file
- .Header(&load_commands)
- .Place(&segment_contents);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, LoadCommandTooShort(0, LC_SEGMENT))
- .WillOnce(Return());
-
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, SegmentBadContentOffset) {
- WithConfiguration config(kLittleEndian, 32);
- // Instead of letting a Place call set the segment's file offset and size,
- // set them ourselves, to check that the parser catches invalid offsets
- // instead of handing us bogus pointers.
- LoadedSection segment;
- segment.address() = 0x4db5489c;
- segment.start() = 0x7e189e76; // beyond end of file
- segment.final_size() = 0x98b9c3ab;
- SegmentLoadCommand segment_command;
- segment_command
- .Header("notmerelyfifteen", segment, 0xcbab25ee, 0x359a20db, 0x68a3933f);
- LoadCommands load_commands;
- load_commands.Place(&segment_command);
- MachOFile file;
- file.Header(&load_commands);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, MisplacedSegmentData("notmerelyfifteen"))
- .WillOnce(Return());
-
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(LoadCommand, ThreeLoadCommands) {
- WithConfiguration config(kBigEndian, 32);
- LoadedSection seg1, seg2, seg3;
- SegmentLoadCommand cmd1, cmd2, cmd3;
-
- seg1.Append(128, '@');
- seg1.address() = 0xa7f61ef6;
- cmd1.Header("head", seg1, 0x88bf1cc7, 0x889a26a4, 0xe9b80d87);
- // Include some dummy data at the end of the load command. Since we
- // didn't claim to have any sections, the reader should ignore this. But
- // making sure the commands have different lengths ensures that we're
- // using the right command's length to advance the LoadCommandIterator.
- cmd1.Append(128, '!');
-
- seg2.Append(42, '*');
- seg2.address() = 0xc70fc909;
- cmd2.Header("thorax", seg2, 0xde7327f4, 0xfdaf771d, 0x65e74b30);
- // More dummy data at the end of the load command.
- cmd2.Append(32, '^');
-
- seg3.Append(42, '%');
- seg3.address() = 0x46b3ab05;
- cmd3.Header("abdomen", seg3, 0x7098b70d, 0x8d8d7728, 0x5131419b);
- // More dummy data at the end of the load command.
- cmd3.Append(64, '&');
-
- LoadCommands load_commands;
- load_commands.Place(&cmd1).Place(&cmd2).Place(&cmd3);
-
- MachOFile file;
- file.Header(&load_commands).Place(&seg1).Place(&seg2).Place(&seg3);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- {
- InSequence s;
- EXPECT_CALL(load_command_handler,
- SegmentCommand(Field(&Segment::name, "head")))
- .WillOnce(Return(true));
- EXPECT_CALL(load_command_handler,
- SegmentCommand(Field(&Segment::name, "thorax")))
- .WillOnce(Return(true));
- EXPECT_CALL(load_command_handler,
- SegmentCommand(Field(&Segment::name, "abdomen")))
- .WillOnce(Return(true));
- }
-
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-static inline Matcher<const Section &> MatchSection(
- Matcher<bool> bits_64,
- Matcher<const string &> section_name,
- Matcher<const string &> segment_name,
- Matcher<uint64_t> address,
- Matcher<uint32_t> alignment,
- Matcher<uint32_t> flags,
- Matcher<const ByteBuffer &> contents) {
- return AllOf(AllOf(Field(&Section::bits_64, bits_64),
- Field(&Section::section_name, section_name),
- Field(&Section::segment_name, segment_name),
- Field(&Section::address, address)),
- AllOf(Field(&Section::align, alignment),
- Field(&Section::flags, flags),
- Field(&Section::contents, contents)));
-}
-
-static inline Matcher<const Section &> MatchSection(
- Matcher<bool> bits_64,
- Matcher<const string &> section_name,
- Matcher<const string &> segment_name,
- Matcher<uint64_t> address) {
- return AllOf(Field(&Section::bits_64, bits_64),
- Field(&Section::section_name, section_name),
- Field(&Section::segment_name, segment_name),
- Field(&Section::address, address));
-}
-
-TEST_F(LoadCommand, OneSegmentTwoSections) {
- WithConfiguration config(kBigEndian, 64);
-
- // Create some sections with some data.
- LoadedSection section1, section2;
- section1.Append("buddha's hand");
- section2.Append("kumquat");
-
- // Create a segment to hold them.
- LoadedSection segment;
- segment.address() = 0xe1d0eeec;
- segment.Place(&section2).Place(&section1);
-
- SegmentLoadCommand segment_command;
- segment_command
- .Header("head", segment, 0x92c9568c, 0xa89f2627, 0x4dc7a1e2)
- .AppendSectionEntry("mandarin", "kishu", 12, 0x8cd4604bU, section1)
- .AppendSectionEntry("bergamot", "cara cara", 12, 0x98746efaU, section2);
-
- LoadCommands commands;
- commands.Place(&segment_command);
-
- MachOFile file;
- file.Header(&commands).Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_CALL(load_command_handler, SegmentCommand(_))
- .WillOnce(DoAll(SaveArg<0>(&actual_segment),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- {
- InSequence s;
- ByteBuffer contents1;
- contents1.start = file_bytes + section1.start().Value();
- contents1.end = contents1.start + section1.final_size().Value();
- EXPECT_EQ("buddha's hand",
- string(reinterpret_cast<const char *>(contents1.start),
- contents1.Size()));
- EXPECT_CALL(section_handler,
- HandleSection(MatchSection(true, "mandarin", "kishu",
- section1.address().Value(), 12,
- 0x8cd4604bU, contents1)))
- .WillOnce(Return(true));
-
- ByteBuffer contents2;
- contents2.start = file_bytes + section2.start().Value();
- contents2.end = contents2.start + section2.final_size().Value();
- EXPECT_EQ("kumquat",
- string(reinterpret_cast<const char *>(contents2.start),
- contents2.Size()));
- EXPECT_CALL(section_handler,
- HandleSection(MatchSection(true, "bergamot", "cara cara",
- section2.address().Value(), 12,
- 0x98746efaU, contents2)))
- .WillOnce(Return(true));
- }
-
- EXPECT_TRUE(reader.WalkSegmentSections(actual_segment, &section_handler));
-}
-
-TEST_F(LoadCommand, MisplacedSectionBefore) {
- WithConfiguration config(kLittleEndian, 64);
-
- // The segment.
- LoadedSection segment;
- segment.address() = 0x696d83cc;
- segment.Append(10, '0');
-
- // The contents of the following sections don't matter, because
- // we're not really going to Place them in segment; we're just going
- // to set all their labels by hand to get the (impossible)
- // configurations we want.
-
- // A section whose starting offset is before that of its section.
- LoadedSection before;
- before.Append(10, '1');
- before.start() = segment.start() - 1;
- before.address() = segment.address() - 1;
- before.final_size() = before.Size();
-
- SegmentLoadCommand command;
- command
- .Header("segment", segment, 0x173baa29, 0x8407275d, 0xed8f7057)
- .AppendSectionEntry("before", "segment", 0, 0x686c6921, before);
-
- LoadCommands commands;
- commands.Place(&command);
-
- MachOFile file;
- file.Header(&commands).Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_TRUE(reader.FindSegment("segment", &actual_segment));
-
- EXPECT_CALL(reporter, MisplacedSectionData("before", "segment"))
- .WillOnce(Return());
- EXPECT_FALSE(reader.WalkSegmentSections(actual_segment, &section_handler));
-}
-
-TEST_F(LoadCommand, MisplacedSectionAfter) {
- WithConfiguration config(kLittleEndian, 64);
-
- // The segment.
- LoadedSection segment;
- segment.address() = 0x696d83cc;
- segment.Append(10, '0');
-
- // The contents of the following sections don't matter, because
- // we're not really going to Place them in segment; we're just going
- // to set all their labels by hand to get the (impossible)
- // configurations we want.
-
- // A section whose starting offset is after the end of its section.
- LoadedSection after;
- after.Append(10, '2');
- after.start() = segment.start() + 11;
- after.address() = segment.address() + 11;
- after.final_size() = after.Size();
-
- SegmentLoadCommand command;
- command
- .Header("segment", segment, 0x173baa29, 0x8407275d, 0xed8f7057)
- .AppendSectionEntry("after", "segment", 0, 0x2ee50124, after);
-
- LoadCommands commands;
- commands.Place(&command);
-
- MachOFile file;
- file.Header(&commands).Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_TRUE(reader.FindSegment("segment", &actual_segment));
-
- EXPECT_CALL(reporter, MisplacedSectionData("after", "segment"))
- .WillOnce(Return());
- EXPECT_FALSE(reader.WalkSegmentSections(actual_segment, &section_handler));
-}
-
-TEST_F(LoadCommand, MisplacedSectionTooBig) {
- WithConfiguration config(kLittleEndian, 64);
-
- // The segment.
- LoadedSection segment;
- segment.address() = 0x696d83cc;
- segment.Append(10, '0');
-
- // The contents of the following sections don't matter, because
- // we're not really going to Place them in segment; we're just going
- // to set all their labels by hand to get the (impossible)
- // configurations we want.
-
- // A section that extends beyond the end of its section.
- LoadedSection too_big;
- too_big.Append(10, '3');
- too_big.start() = segment.start() + 1;
- too_big.address() = segment.address() + 1;
- too_big.final_size() = too_big.Size();
-
- SegmentLoadCommand command;
- command
- .Header("segment", segment, 0x173baa29, 0x8407275d, 0xed8f7057)
- .AppendSectionEntry("too big", "segment", 0, 0x8b53ae5c, too_big);
-
- LoadCommands commands;
- commands.Place(&command);
-
- MachOFile file;
- file.Header(&commands).Place(&segment);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_TRUE(reader.FindSegment("segment", &actual_segment));
-
- EXPECT_CALL(reporter, MisplacedSectionData("too big", "segment"))
- .WillOnce(Return());
- EXPECT_FALSE(reader.WalkSegmentSections(actual_segment, &section_handler));
-}
-
-
-// The segments in a .dSYM bundle's Mach-O file have their file offset
-// and size set to zero, but the sections don't. The reader shouldn't
-// report an error in this case.
-TEST_F(LoadCommand, ZappedSegment) {
- WithConfiguration config(kBigEndian, 32);
-
- // The segment.
- LoadedSection segment;
- segment.address() = 0x696d83cc;
- segment.start() = 0;
- segment.final_size() = 0;
-
- // The section.
- LoadedSection section;
- section.address() = segment.address();
- section.start() = 0;
- section.final_size() = 1000; // extends beyond its segment
-
- SegmentLoadCommand command;
- command
- .Header("zapped", segment, 0x0861a5cb, 0x68ccff67, 0x0b66255c)
- .AppendSectionEntry("twitching", "zapped", 0, 0x93b3bd42, section);
-
- LoadCommands commands;
- commands.Place(&command);
-
- MachOFile file;
- file.Header(&commands);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
- EXPECT_TRUE(reader.FindSegment("zapped", &actual_segment));
-
- ByteBuffer zapped_extent(NULL, 0);
- EXPECT_CALL(section_handler,
- HandleSection(MatchSection(false, "twitching", "zapped",
- 0x696d83cc, 0, 0x93b3bd42,
- zapped_extent)))
- .WillOnce(Return(true));
-
- EXPECT_TRUE(reader.WalkSegmentSections(actual_segment, &section_handler));
-}
-
-TEST_F(LoadCommand, MapSegmentSections) {
- WithConfiguration config(kLittleEndian, 32);
-
- // Create some sections with some data.
- LoadedSection section1, section2, section3, section4;
- section1.Append("buddha's hand");
- section2.start() = 0; // Section 2 is an S_ZEROFILL section.
- section2.final_size() = 0;
- section3.Append("shasta gold");
- section4.Append("satsuma");
-
- // Create two segments to hold them.
- LoadedSection segment1, segment2;
- segment1.address() = 0x13e6c8a9;
- segment1.Place(&section3).Place(&section1);
- segment2.set_word_size(64);
- segment2.address() = 0x04d462e2;
- segment2.Place(&section4);
- section2.address() = segment2.address() + segment2.Size();
-
- SegmentLoadCommand segment_command1, segment_command2;
- segment_command1
- .Header("head", segment1, 0x67d955a6, 0x7a61c13e, 0xe3e50c64)
- .AppendSectionEntry("mandarin", "head", 12, 0x5bb565d7, section1)
- .AppendSectionEntry("bergamot", "head", 12, 0x8620de73, section3);
- segment_command2.set_word_size(64);
- segment_command2
- .Header("thorax", segment2, 0x7aab2419, 0xe908007f, 0x17961d33)
- .AppendSectionEntry("sixteenprecisely", "thorax",
- 12, S_ZEROFILL, section2)
- .AppendSectionEntry("cara cara", "thorax", 12, 0xb6c5dd8a, section4);
-
- LoadCommands commands;
- commands.Place(&segment_command1).Place(&segment_command2);
-
- MachOFile file;
- file.Header(&commands).Place(&segment1).Place(&segment2);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment segment;
- SectionMap section_map;
-
- EXPECT_FALSE(reader.FindSegment("smoot", &segment));
-
- ASSERT_TRUE(reader.FindSegment("thorax", &segment));
- ASSERT_TRUE(reader.MapSegmentSections(segment, &section_map));
-
- EXPECT_FALSE(section_map.find("sixteenpreciselyandthensome")
- != section_map.end());
- EXPECT_FALSE(section_map.find("mandarin") != section_map.end());
- ASSERT_TRUE(section_map.find("cara cara") != section_map.end());
- EXPECT_THAT(section_map["cara cara"],
- MatchSection(true, "cara cara", "thorax", 0x04d462e2));
- ASSERT_TRUE(section_map.find("sixteenprecisely")
- != section_map.end());
- ByteBuffer sixteenprecisely_contents(NULL, 0);
- EXPECT_THAT(section_map["sixteenprecisely"],
- MatchSection(true, "sixteenprecisely", "thorax",
- 0x04d462e2 + 7, 12, S_ZEROFILL,
- sixteenprecisely_contents));
-
- ASSERT_TRUE(reader.FindSegment("head", &segment));
- ASSERT_TRUE(reader.MapSegmentSections(segment, &section_map));
-
- ASSERT_TRUE(section_map.find("mandarin") != section_map.end());
- EXPECT_THAT(section_map["mandarin"],
- MatchSection(false, "mandarin", "head", 0x13e6c8a9 + 11));
- ASSERT_TRUE(section_map.find("bergamot") != section_map.end());
- EXPECT_THAT(section_map["bergamot"],
- MatchSection(false, "bergamot", "head", 0x13e6c8a9));
-}
-
-TEST_F(LoadCommand, FindSegment) {
- WithConfiguration config(kBigEndian, 32);
-
- LoadedSection segment1, segment2, segment3;
- segment1.address() = 0xb8ae5752;
- segment1.Append("Some contents!");
- segment2.address() = 0xd6b0ce83;
- segment2.Append("Different stuff.");
- segment3.address() = 0x7374fd2a;
- segment3.Append("Further materials.");
-
- SegmentLoadCommand cmd1, cmd2, cmd3;
- cmd1.Header("first", segment1, 0xfadb6932, 0x175bf529, 0x0de790ad);
- cmd2.Header("second", segment2, 0xeef716e0, 0xe103a9d7, 0x7d38a8ef);
- cmd3.Header("third", segment3, 0xe172b39e, 0x86012f07, 0x080ac94d);
-
- LoadCommands commands;
- commands.Place(&cmd1).Place(&cmd2).Place(&cmd3);
-
- MachOFile file;
- file.Header(&commands).Place(&segment1).Place(&segment2).Place(&segment3);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- Segment actual_segment;
-
- EXPECT_FALSE(reader.FindSegment("murphy", &actual_segment));
-
- EXPECT_TRUE(reader.FindSegment("second", &actual_segment));
- EXPECT_EQ(0xd6b0ce83, actual_segment.vmaddr);
-}
-
-
-// Symtab tests.
-
-// A StringAssembler is a class for generating .stabstr sections to present
-// as input to the STABS parser.
-class StringAssembler: public SizedSection {
- public:
- // Add the string S to this StringAssembler, and return the string's
- // offset within this compilation unit's strings.
- size_t Add(const string &s) {
- size_t offset = Size();
- AppendCString(s);
- return offset;
- }
-};
-
-// A SymbolAssembler is a class for generating .stab sections to present as
-// test input for the STABS parser.
-class SymbolAssembler: public SizedSection {
- public:
- // Create a SymbolAssembler that uses StringAssembler for its strings.
- explicit SymbolAssembler(StringAssembler *string_assembler)
- : string_assembler_(string_assembler),
- entry_count_(0) { }
-
- // Append a STAB entry to the end of this section with the given
- // characteristics. NAME is the offset of this entry's name string within
- // its compilation unit's portion of the .stabstr section; this can be a
- // value generated by a StringAssembler. Return a reference to this
- // SymbolAssembler.
- SymbolAssembler &Symbol(uint8_t type, uint8_t other, Label descriptor,
- Label value, Label name) {
- D32(name);
- D8(type);
- D8(other);
- D16(descriptor);
- Append(endianness(), word_size_ / 8, value);
- entry_count_++;
- return *this;
- }
-
- // As above, but automatically add NAME to our StringAssembler.
- SymbolAssembler &Symbol(uint8_t type, uint8_t other, Label descriptor,
- Label value, const string &name) {
- return Symbol(type, other, descriptor, value, string_assembler_->Add(name));
- }
-
- private:
- // The strings for our STABS entries.
- StringAssembler *string_assembler_;
-
- // The number of entries in this compilation unit so far.
- size_t entry_count_;
-};
-
-class Symtab: public ReaderFixture, public Test { };
-
-TEST_F(Symtab, Symtab32) {
- WithConfiguration config(kLittleEndian, 32);
-
- StringAssembler strings;
- SymbolAssembler symbols(&strings);
- symbols
- .Symbol(0x52, 0x7c, 0x3470, 0x9bb02e7c, "hrududu")
- .Symbol(0x50, 0x90, 0x7520, 0x1122525d, "Frith");
-
- SizedSection symtab_command;
- symtab_command
- .D32(LC_SYMTAB) // command
- .D32(symtab_command.final_size()) // size
- .D32(symbols.start()) // file offset of symbols
- .D32(2) // symbol count
- .D32(strings.start()) // file offset of strings
- .D32(strings.final_size()); // strings size
-
- LoadCommands load_commands;
- load_commands.Place(&symtab_command);
-
- MachOFile file;
- file.Header(&load_commands).Place(&symbols).Place(&strings);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- ByteBuffer symbols_found, strings_found;
- EXPECT_CALL(load_command_handler, SymtabCommand(_, _))
- .WillOnce(DoAll(SaveArg<0>(&symbols_found),
- SaveArg<1>(&strings_found),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- EXPECT_EQ(24U, symbols_found.Size());
- EXPECT_EQ(14U, strings_found.Size());
-}
-
-TEST_F(Symtab, Symtab64) {
- WithConfiguration config(kBigEndian, 64);
-
- StringAssembler strings;
- SymbolAssembler symbols(&strings);
- symbols
- .Symbol(0xa7, 0xaf, 0x03af, 0x42f3072c74335181ULL, "foo")
- .Symbol(0xb0, 0x9a, 0x2aa7, 0x2e2d349b3d5744a0ULL, "bar");
-
- SizedSection symtab_command;
- symtab_command
- .D32(LC_SYMTAB) // command
- .D32(symtab_command.final_size()) // size
- .D32(symbols.start()) // file offset of symbols
- .D32(2) // symbol count
- .D32(strings.start()) // file offset of strings
- .D32(strings.final_size()); // strings size
-
- LoadCommands load_commands;
- load_commands.Place(&symtab_command);
-
- MachOFile file;
- file.Header(&load_commands).Place(&symbols).Place(&strings);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- ByteBuffer symbols_found, strings_found;
- EXPECT_CALL(load_command_handler, SymtabCommand(_, _))
- .WillOnce(DoAll(SaveArg<0>(&symbols_found),
- SaveArg<1>(&strings_found),
- Return(true)));
- EXPECT_TRUE(reader.WalkLoadCommands(&load_command_handler));
-
- EXPECT_EQ(32U, symbols_found.Size());
- EXPECT_EQ(8U, strings_found.Size());
-}
-
-TEST_F(Symtab, SymtabMisplacedSymbols) {
- WithConfiguration config(kBigEndian, 32);
-
- StringAssembler strings;
- SymbolAssembler symbols(&strings);
- symbols
- .Symbol(0xa7, 0xaf, 0x03af, 0x42f3072c74335181ULL, "foo")
- .Symbol(0xb0, 0x9a, 0x2aa7, 0x2e2d349b3d5744a0ULL, "bar");
-
- SizedSection symtab_command;
- symtab_command
- .D32(LC_SYMTAB) // command
- .D32(symtab_command.final_size()) // size
- .D32(symbols.start()) // file offset of symbols
- .D32(3) // symbol count (too many)
- .D32(strings.start()) // file offset of strings
- .D32(strings.final_size()); // strings size
-
- LoadCommands load_commands;
- load_commands.Place(&symtab_command);
-
- MachOFile file;
- // Put symbols at end, so the excessive length will be noticed.
- file.Header(&load_commands).Place(&strings).Place(&symbols);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, MisplacedSymbolTable()).Times(1);
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
-TEST_F(Symtab, SymtabMisplacedStrings) {
- WithConfiguration config(kLittleEndian, 32);
-
- StringAssembler strings;
- SymbolAssembler symbols(&strings);
- symbols
- .Symbol(0xa7, 0xaf, 0x03af, 0x42f3072c74335181ULL, "foo")
- .Symbol(0xb0, 0x9a, 0x2aa7, 0x2e2d349b3d5744a0ULL, "bar");
-
- SizedSection symtab_command;
- symtab_command
- .D32(LC_SYMTAB) // command
- .D32(symtab_command.final_size()) // size
- .D32(symbols.start()) // file offset of symbols
- .D32(2) // symbol count
- .D32(strings.start()) // file offset of strings
- .D32(strings.final_size() + 1); // strings size (too long)
-
- LoadCommands load_commands;
- load_commands.Place(&symtab_command);
-
- MachOFile file;
- // Put strings at end, so the excessive length will be noticed.
- file.Header(&load_commands).Place(&symbols).Place(&strings);
-
- ReadFile(&file, true, CPU_TYPE_ANY, 0);
-
- EXPECT_CALL(reporter, MisplacedSymbolTable()).Times(1);
- EXPECT_FALSE(reader.WalkLoadCommands(&load_command_handler));
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.cc
deleted file mode 100644
index f56fe768c1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// macho_utilties.cc: Utilities for dealing with mach-o files
-//
-// Author: Dave Camp
-
-#include "common/mac/byteswap.h"
-#include "common/mac/macho_utilities.h"
-
-#include <mach-o/fat.h>
-#include <mach-o/loader.h>
-
-void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc) {
- uc->cmd = ByteSwap(uc->cmd);
- uc->cmdsize = ByteSwap(uc->cmdsize);
-}
-
-void breakpad_swap_load_command(struct load_command *lc) {
- lc->cmd = ByteSwap(lc->cmd);
- lc->cmdsize = ByteSwap(lc->cmdsize);
-}
-
-void breakpad_swap_dylib_command(struct dylib_command *dc) {
- dc->cmd = ByteSwap(dc->cmd);
- dc->cmdsize = ByteSwap(dc->cmdsize);
-
- dc->dylib.name.offset = ByteSwap(dc->dylib.name.offset);
- dc->dylib.timestamp = ByteSwap(dc->dylib.timestamp);
- dc->dylib.current_version = ByteSwap(dc->dylib.current_version);
- dc->dylib.compatibility_version = ByteSwap(dc->dylib.compatibility_version);
-}
-
-void breakpad_swap_segment_command(struct segment_command *sc) {
- sc->cmd = ByteSwap(sc->cmd);
- sc->cmdsize = ByteSwap(sc->cmdsize);
-
- sc->vmaddr = ByteSwap(sc->vmaddr);
- sc->vmsize = ByteSwap(sc->vmsize);
- sc->fileoff = ByteSwap(sc->fileoff);
- sc->filesize = ByteSwap(sc->filesize);
- sc->maxprot = ByteSwap(sc->maxprot);
- sc->initprot = ByteSwap(sc->initprot);
- sc->nsects = ByteSwap(sc->nsects);
- sc->flags = ByteSwap(sc->flags);
-}
-
-void breakpad_swap_segment_command_64(struct segment_command_64 *sg) {
- sg->cmd = ByteSwap(sg->cmd);
- sg->cmdsize = ByteSwap(sg->cmdsize);
-
- sg->vmaddr = ByteSwap(sg->vmaddr);
- sg->vmsize = ByteSwap(sg->vmsize);
- sg->fileoff = ByteSwap(sg->fileoff);
- sg->filesize = ByteSwap(sg->filesize);
-
- sg->maxprot = ByteSwap(sg->maxprot);
- sg->initprot = ByteSwap(sg->initprot);
- sg->nsects = ByteSwap(sg->nsects);
- sg->flags = ByteSwap(sg->flags);
-}
-
-void breakpad_swap_fat_header(struct fat_header *fh) {
- fh->magic = ByteSwap(fh->magic);
- fh->nfat_arch = ByteSwap(fh->nfat_arch);
-}
-
-void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs) {
- for (uint32_t i = 0; i < narchs; ++i) {
- fa[i].cputype = ByteSwap(fa[i].cputype);
- fa[i].cpusubtype = ByteSwap(fa[i].cpusubtype);
- fa[i].offset = ByteSwap(fa[i].offset);
- fa[i].size = ByteSwap(fa[i].size);
- fa[i].align = ByteSwap(fa[i].align);
- }
-}
-
-void breakpad_swap_mach_header(struct mach_header *mh) {
- mh->magic = ByteSwap(mh->magic);
- mh->cputype = ByteSwap(mh->cputype);
- mh->cpusubtype = ByteSwap(mh->cpusubtype);
- mh->filetype = ByteSwap(mh->filetype);
- mh->ncmds = ByteSwap(mh->ncmds);
- mh->sizeofcmds = ByteSwap(mh->sizeofcmds);
- mh->flags = ByteSwap(mh->flags);
-}
-
-void breakpad_swap_mach_header_64(struct mach_header_64 *mh) {
- mh->magic = ByteSwap(mh->magic);
- mh->cputype = ByteSwap(mh->cputype);
- mh->cpusubtype = ByteSwap(mh->cpusubtype);
- mh->filetype = ByteSwap(mh->filetype);
- mh->ncmds = ByteSwap(mh->ncmds);
- mh->sizeofcmds = ByteSwap(mh->sizeofcmds);
- mh->flags = ByteSwap(mh->flags);
- mh->reserved = ByteSwap(mh->reserved);
-}
-
-void breakpad_swap_section(struct section *s,
- uint32_t nsects) {
- for (uint32_t i = 0; i < nsects; i++) {
- s[i].addr = ByteSwap(s[i].addr);
- s[i].size = ByteSwap(s[i].size);
-
- s[i].offset = ByteSwap(s[i].offset);
- s[i].align = ByteSwap(s[i].align);
- s[i].reloff = ByteSwap(s[i].reloff);
- s[i].nreloc = ByteSwap(s[i].nreloc);
- s[i].flags = ByteSwap(s[i].flags);
- s[i].reserved1 = ByteSwap(s[i].reserved1);
- s[i].reserved2 = ByteSwap(s[i].reserved2);
- }
-}
-
-void breakpad_swap_section_64(struct section_64 *s,
- uint32_t nsects) {
- for (uint32_t i = 0; i < nsects; i++) {
- s[i].addr = ByteSwap(s[i].addr);
- s[i].size = ByteSwap(s[i].size);
-
- s[i].offset = ByteSwap(s[i].offset);
- s[i].align = ByteSwap(s[i].align);
- s[i].reloff = ByteSwap(s[i].reloff);
- s[i].nreloc = ByteSwap(s[i].nreloc);
- s[i].flags = ByteSwap(s[i].flags);
- s[i].reserved1 = ByteSwap(s[i].reserved1);
- s[i].reserved2 = ByteSwap(s[i].reserved2);
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.h
deleted file mode 100644
index 00563a77c8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_utilities.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// macho_utilities.h: Utilities for dealing with mach-o files
-//
-// Author: Dave Camp
-
-#ifndef COMMON_MAC_MACHO_UTILITIES_H__
-#define COMMON_MAC_MACHO_UTILITIES_H__
-
-#include <mach-o/loader.h>
-#include <mach/thread_status.h>
-
-/* Some #defines and structs that aren't defined in older SDKs */
-#ifndef CPU_ARCH_ABI64
-# define CPU_ARCH_ABI64 0x01000000
-#endif
-
-#ifndef CPU_TYPE_X86
-# define CPU_TYPE_X86 CPU_TYPE_I386
-#endif
-
-#ifndef CPU_TYPE_POWERPC64
-# define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
-#endif
-
-#ifndef LC_UUID
-# define LC_UUID 0x1b /* the uuid */
-#endif
-
-// The uuid_command struct/swap routines were added during the 10.4 series.
-// Their presence isn't guaranteed.
-struct breakpad_uuid_command {
- uint32_t cmd; /* LC_UUID */
- uint32_t cmdsize; /* sizeof(struct uuid_command) */
- uint8_t uuid[16]; /* the 128-bit uuid */
-};
-
-void breakpad_swap_uuid_command(struct breakpad_uuid_command *uc);
-
-void breakpad_swap_load_command(struct load_command *lc);
-
-void breakpad_swap_dylib_command(struct dylib_command *dc);
-
-// Older SDKs defines thread_state_data_t as an int[] instead
-// of the natural_t[] it should be.
-typedef natural_t breakpad_thread_state_data_t[THREAD_STATE_MAX];
-
-void breakpad_swap_segment_command(struct segment_command *sc);
-
-// The 64-bit swap routines were added during the 10.4 series, their
-// presence isn't guaranteed.
-void breakpad_swap_segment_command_64(struct segment_command_64 *sg);
-
-void breakpad_swap_fat_header(struct fat_header *fh);
-
-void breakpad_swap_fat_arch(struct fat_arch *fa, uint32_t narchs);
-
-void breakpad_swap_mach_header(struct mach_header *mh);
-
-void breakpad_swap_mach_header_64(struct mach_header_64 *mh);
-
-void breakpad_swap_section(struct section *s,
- uint32_t nsects);
-
-void breakpad_swap_section_64(struct section_64 *s,
- uint32_t nsects);
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc
deleted file mode 100644
index 1acd86656b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.cc
+++ /dev/null
@@ -1,268 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// macho_walker.cc: Iterate over the load commands in a mach-o file
-//
-// See macho_walker.h for documentation
-//
-// Author: Dan Waylonis
-
-#include <assert.h>
-#include <fcntl.h>
-#include <mach-o/arch.h>
-#include <mach-o/fat.h>
-#include <mach-o/loader.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "common/mac/byteswap.h"
-#include "common/mac/macho_walker.h"
-#include "common/mac/macho_utilities.h"
-
-namespace MacFileUtilities {
-
-MachoWalker::MachoWalker(const char *path, LoadCommandCallback callback,
- void *context)
- : file_(-1),
- memory_(NULL),
- memory_size_(0),
- callback_(callback),
- callback_context_(context),
- current_header_(NULL),
- current_header_size_(0),
- current_header_offset_(0) {
- file_ = open(path, O_RDONLY);
-}
-
-MachoWalker::MachoWalker(void *memory, size_t size,
- LoadCommandCallback callback, void *context)
- : file_(-1),
- memory_(memory),
- memory_size_(size),
- callback_(callback),
- callback_context_(context),
- current_header_(NULL),
- current_header_size_(0),
- current_header_offset_(0) {
-}
-
-MachoWalker::~MachoWalker() {
- if (file_ != -1)
- close(file_);
-}
-
-bool MachoWalker::WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
- cpu_type_t valid_cpu_type = cpu_type;
- cpu_subtype_t valid_cpu_subtype = cpu_subtype;
- // if |cpu_type| is 0, use the native cpu type.
- if (cpu_type == 0) {
- const NXArchInfo *arch = NXGetLocalArchInfo();
- assert(arch);
- valid_cpu_type = arch->cputype;
- valid_cpu_subtype = CPU_SUBTYPE_MULTIPLE;
- }
- off_t offset;
- if (FindHeader(valid_cpu_type, valid_cpu_subtype, offset)) {
- if (cpu_type & CPU_ARCH_ABI64)
- return WalkHeader64AtOffset(offset);
-
- return WalkHeaderAtOffset(offset);
- }
-
- return false;
-}
-
-bool MachoWalker::ReadBytes(void *buffer, size_t size, off_t offset) {
- if (memory_) {
- if (offset < 0)
- return false;
- bool result = true;
- if (offset + size > memory_size_) {
- if (static_cast<size_t>(offset) >= memory_size_)
- return false;
- size = memory_size_ - static_cast<size_t>(offset);
- result = false;
- }
- memcpy(buffer, static_cast<char *>(memory_) + offset, size);
- return result;
- } else {
- return pread(file_, buffer, size, offset) == (ssize_t)size;
- }
-}
-
-bool MachoWalker::CurrentHeader(struct mach_header_64 *header, off_t *offset) {
- if (current_header_) {
- memcpy(header, current_header_, sizeof(mach_header_64));
- *offset = current_header_offset_;
- return true;
- }
-
- return false;
-}
-
-bool MachoWalker::FindHeader(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- off_t &offset) {
- // Read the magic bytes that's common amongst all mach-o files
- uint32_t magic;
- if (!ReadBytes(&magic, sizeof(magic), 0))
- return false;
-
- offset = sizeof(magic);
-
- // Figure out what type of file we've got
- bool is_fat = false;
- if (magic == FAT_MAGIC || magic == FAT_CIGAM) {
- is_fat = true;
- }
- else if (magic != MH_MAGIC && magic != MH_CIGAM && magic != MH_MAGIC_64 &&
- magic != MH_CIGAM_64) {
- return false;
- }
-
- if (!is_fat) {
- // If we don't have a fat header, check if the cpu type matches the single
- // header
- struct mach_header header;
- if (!ReadBytes(&header, sizeof(header), 0))
- return false;
-
- if (magic == MH_CIGAM || magic == MH_CIGAM_64)
- breakpad_swap_mach_header(&header);
-
- if (cpu_type != header.cputype ||
- (cpu_subtype != CPU_SUBTYPE_MULTIPLE &&
- cpu_subtype != header.cpusubtype)) {
- return false;
- }
-
- offset = 0;
- return true;
- } else {
- // Read the fat header and find an appropriate architecture
- offset = 0;
- struct fat_header fat;
- if (!ReadBytes(&fat, sizeof(fat), offset))
- return false;
-
- if (NXHostByteOrder() != NX_BigEndian)
- breakpad_swap_fat_header(&fat);
-
- offset += sizeof(fat);
-
- // Search each architecture for the desired one
- struct fat_arch arch;
- for (uint32_t i = 0; i < fat.nfat_arch; ++i) {
- if (!ReadBytes(&arch, sizeof(arch), offset))
- return false;
-
- if (NXHostByteOrder() != NX_BigEndian)
- breakpad_swap_fat_arch(&arch, 1);
-
- if (arch.cputype == cpu_type &&
- (cpu_subtype == CPU_SUBTYPE_MULTIPLE ||
- arch.cpusubtype == cpu_subtype)) {
- offset = arch.offset;
- return true;
- }
-
- offset += sizeof(arch);
- }
- }
-
- return false;
-}
-
-bool MachoWalker::WalkHeaderAtOffset(off_t offset) {
- struct mach_header header;
- if (!ReadBytes(&header, sizeof(header), offset))
- return false;
-
- bool swap = (header.magic == MH_CIGAM);
- if (swap)
- breakpad_swap_mach_header(&header);
-
- // Copy the data into the mach_header_64 structure. Since the 32-bit and
- // 64-bit only differ in the last field (reserved), this is safe to do.
- struct mach_header_64 header64;
- memcpy((void *)&header64, (const void *)&header, sizeof(header));
- header64.reserved = 0;
-
- current_header_ = &header64;
- current_header_size_ = sizeof(header); // 32-bit, not 64-bit
- current_header_offset_ = offset;
- offset += current_header_size_;
- bool result = WalkHeaderCore(offset, header.ncmds, swap);
- current_header_ = NULL;
- current_header_size_ = 0;
- current_header_offset_ = 0;
- return result;
-}
-
-bool MachoWalker::WalkHeader64AtOffset(off_t offset) {
- struct mach_header_64 header;
- if (!ReadBytes(&header, sizeof(header), offset))
- return false;
-
- bool swap = (header.magic == MH_CIGAM_64);
- if (swap)
- breakpad_swap_mach_header_64(&header);
-
- current_header_ = &header;
- current_header_size_ = sizeof(header);
- current_header_offset_ = offset;
- offset += current_header_size_;
- bool result = WalkHeaderCore(offset, header.ncmds, swap);
- current_header_ = NULL;
- current_header_size_ = 0;
- current_header_offset_ = 0;
- return result;
-}
-
-bool MachoWalker::WalkHeaderCore(off_t offset, uint32_t number_of_commands,
- bool swap) {
- for (uint32_t i = 0; i < number_of_commands; ++i) {
- struct load_command cmd;
- if (!ReadBytes(&cmd, sizeof(cmd), offset))
- return false;
-
- if (swap)
- breakpad_swap_load_command(&cmd);
-
- // Call the user callback
- if (callback_ && !callback_(this, &cmd, offset, swap, callback_context_))
- break;
-
- offset += cmd.cmdsize;
- }
-
- return true;
-}
-
-} // namespace MacFileUtilities
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h b/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h
deleted file mode 100644
index dd535814a1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/macho_walker.h
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// macho_walker.h: Iterate over the load commands in a mach-o file
-//
-// Author: Dan Waylonis
-
-#ifndef COMMON_MAC_MACHO_WALKER_H__
-#define COMMON_MAC_MACHO_WALKER_H__
-
-#include <mach/machine.h>
-#include <mach-o/loader.h>
-#include <sys/types.h>
-
-namespace MacFileUtilities {
-
-class MachoWalker {
- public:
- // A callback function executed when a new load command is read. If no
- // further processing of load commands is desired, return false. Otherwise,
- // return true.
- // |cmd| is the current command, and |offset| is the location relative to the
- // beginning of the file (not header) where the command was read. If |swap|
- // is set, then any command data (other than the returned load_command) should
- // be swapped when read
- typedef bool (*LoadCommandCallback)(MachoWalker *walker, load_command *cmd,
- off_t offset, bool swap, void *context);
-
- MachoWalker(const char *path, LoadCommandCallback callback, void *context);
- MachoWalker(void *memory, size_t size, LoadCommandCallback callback,
- void *context);
- ~MachoWalker();
-
- // Begin walking the header for |cpu_type| and |cpu_subtype|. If |cpu_type|
- // is 0, then the native cpu type is used. Otherwise, accepted values are
- // listed in /usr/include/mach/machine.h (e.g., CPU_TYPE_X86 or
- // CPU_TYPE_POWERPC). If |cpu_subtype| is CPU_SUBTYPE_MULTIPLE, the match is
- // only done on |cpu_type|.
- // Returns false if opening the file failed or if the |cpu_type|/|cpu_subtype|
- // is not present in the file.
- bool WalkHeader(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype);
-
- // Read |size| bytes from the opened file at |offset| into |buffer|
- bool ReadBytes(void *buffer, size_t size, off_t offset);
-
- // Return the current header and header offset
- bool CurrentHeader(struct mach_header_64 *header, off_t *offset);
-
- private:
- // Locate (if any) the header offset for |cpu_type| and return in |offset|.
- // Return true if found, false otherwise.
- bool FindHeader(cpu_type_t cpu_type,
- cpu_subtype_t cpu_subtype,
- off_t &offset);
-
- // Process an individual header starting at |offset| from the start of the
- // file. Return true if successful, false otherwise.
- bool WalkHeaderAtOffset(off_t offset);
- bool WalkHeader64AtOffset(off_t offset);
-
- // Bottleneck for walking the load commands
- bool WalkHeaderCore(off_t offset, uint32_t number_of_commands, bool swap);
-
- // File descriptor to the opened file
- int file_;
-
- // Memory location to read from.
- void *memory_;
-
- // Size of the memory segment we can read from.
- size_t memory_size_;
-
- // User specified callback & context
- LoadCommandCallback callback_;
- void *callback_context_;
-
- // Current header, size, and offset. The mach_header_64 is used for both
- // 32-bit and 64-bit headers because they only differ in their last field
- // (reserved). By adding the |current_header_size_| and the
- // |current_header_offset_|, you can determine the offset in the file just
- // after the header.
- struct mach_header_64 *current_header_;
- unsigned long current_header_size_;
- off_t current_header_offset_;
-
- private:
- MachoWalker(const MachoWalker &);
- MachoWalker &operator=(const MachoWalker &);
-};
-
-} // namespace MacFileUtilities
-
-#endif // COMMON_MAC_MACHO_WALKER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
deleted file mode 100644
index 6d6df28e21..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
+++ /dev/null
@@ -1,52 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'arch_utilities.cc',
- 'file_id.cc',
- 'macho_id.cc',
- 'macho_reader.cc',
- 'macho_utilities.cc',
- 'macho_walker.cc',
-]
-
-if CONFIG['HOST_OS_ARCH'] != 'Darwin':
- HOST_CXXFLAGS += [
- '-I%s/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/' % TOPSRCDIR,
- ]
-
-# This is a little weird, but we're building a host and a target lib here.
-# The host lib is used for dump_syms, and the target lib for the
-# crash reporter client. Therefore, we don't need all the srcs in both.
-if CONFIG['MOZ_CRASHREPORTER']:
- HOST_SOURCES += UNIFIED_SOURCES
- HOST_SOURCES += [
- 'dump_syms.cc',
- ]
- HOST_CXXFLAGS += [
- '-O2',
- '-g',
- '-stdlib=libc++',
- ]
- HostLibrary('host_breakpad_mac_common_s')
-
-SOURCES += [
- 'bootstrap_compat.cc',
- 'HTTPMultipartUpload.m',
- 'MachIPC.mm',
- 'string_utilities.cc',
-]
-
-Library('breakpad_mac_common_s')
-
-# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
-
-FINAL_LIBRARY = 'xul'
-
-CMFLAGS += ['-std=c99']
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h b/toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h
deleted file mode 100644
index d6d1bef971..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/scoped_task_suspend-inl.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Inline implementation of ScopedTaskSuspend, which suspends a Mach
-// task for the duration of its scope.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_
-#define GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_
-
-#include <mach/mach.h>
-
-namespace google_breakpad {
-
-class ScopedTaskSuspend {
- public:
- explicit ScopedTaskSuspend(mach_port_t target) : target_(target) {
- task_suspend(target_);
- }
-
- ~ScopedTaskSuspend() {
- task_resume(target_);
- }
-
- private:
- mach_port_t target_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_COMMON_MAC_SCOPED_TASK_SUSPEND_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc b/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc
deleted file mode 100644
index 07c0f42680..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/scoped_ptr.h"
-#include "common/mac/string_utilities.h"
-
-namespace MacStringUtils {
-
-using google_breakpad::scoped_array;
-
-std::string ConvertToString(CFStringRef str) {
- CFIndex length = CFStringGetLength(str);
- std::string result;
-
- if (!length)
- return result;
-
- CFIndex maxUTF8Length =
- CFStringGetMaximumSizeForEncoding(length, kCFStringEncodingUTF8);
- scoped_array<UInt8> buffer(new UInt8[maxUTF8Length + 1]);
- CFIndex actualUTF8Length;
- CFStringGetBytes(str, CFRangeMake(0, length), kCFStringEncodingUTF8, 0,
- false, buffer.get(), maxUTF8Length, &actualUTF8Length);
- buffer[actualUTF8Length] = 0;
- result.assign((const char *)buffer.get());
-
- return result;
-}
-
-unsigned int IntegerValueAtIndex(string &str, unsigned int idx) {
- string digits("0123456789"), temp;
- size_t start = 0;
- size_t end;
- size_t found = 0;
- unsigned int result = 0;
-
- for (; found <= idx; ++found) {
- end = str.find_first_not_of(digits, start);
-
- if (end == string::npos)
- end = str.size();
-
- temp = str.substr(start, end - start);
-
- if (found == idx) {
- result = atoi(temp.c_str());
- }
-
- start = str.find_first_of(digits, end + 1);
-
- if (start == string::npos)
- break;
- }
-
- return result;
-}
-
-} // namespace MacStringUtils
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.h b/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.h
deleted file mode 100644
index 6d89c834e7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/string_utilities.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// string_utilities.h: Utilities for strings for Mac platform
-
-#ifndef COMMON_MAC_STRING_UTILITIES_H__
-#define COMMON_MAC_STRING_UTILITIES_H__
-
-#include <CoreFoundation/CoreFoundation.h>
-
-#include <string>
-
-namespace MacStringUtils {
-
-using std::string;
-
-// Convert a CoreFoundation string into a std::string
-string ConvertToString(CFStringRef str);
-
-// Return the idx'th decimal integer in str, separated by non-decimal-digits
-// E.g., str = 10.4.8, idx = 1 -> 4
-unsigned int IntegerValueAtIndex(string &str, unsigned int idx);
-
-} // namespace MacStringUtils
-
-#endif // COMMON_MAC_STRING_UTILITIES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/super_fat_arch.h b/toolkit/crashreporter/google-breakpad/src/common/mac/super_fat_arch.h
deleted file mode 100644
index 501c8652a1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/super_fat_arch.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Erik Chen <erikchen@chromium.org>
-
-// super_fat_arch.h: A class to handle 64-bit object files. Has conversions to
-// and from struct fat_arch.
-
-#ifndef BREAKPAD_COMMON_MAC_SUPER_FAT_ARCH_H_
-#define BREAKPAD_COMMON_MAC_SUPER_FAT_ARCH_H_
-
-#include <limits>
-#include <mach-o/fat.h>
-#include <stdint.h>
-
-// Similar to struct fat_arch, except size-related parameters support
-// 64-bits.
-class SuperFatArch {
- public:
- uint32_t cputype;
- uint32_t cpusubtype;
- uint64_t offset;
- uint64_t size;
- uint64_t align;
-
- SuperFatArch() :
- cputype(0),
- cpusubtype(0),
- offset(0),
- size(0),
- align(0) {
- }
-
- explicit SuperFatArch(const struct fat_arch &arch) :
- cputype(arch.cputype),
- cpusubtype(arch.cpusubtype),
- offset(arch.offset),
- size(arch.size),
- align(arch.align) {
- }
-
- // Returns false if the conversion cannot be made.
- // If the conversion succeeds, the result is placed in |output_arch|.
- bool ConvertToFatArch(struct fat_arch* output_arch) const {
- if (offset > std::numeric_limits<uint32_t>::max())
- return false;
- if (size > std::numeric_limits<uint32_t>::max())
- return false;
- if (align > std::numeric_limits<uint32_t>::max())
- return false;
- struct fat_arch arch;
- arch.cputype = cputype;
- arch.cpusubtype = cpusubtype;
- arch.offset = offset;
- arch.size = size;
- arch.align = align;
- *output_arch = arch;
- return true;
- }
-};
-
-#endif // BREAKPAD_COMMON_MAC_SUPER_FAT_ARCH_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.h b/toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.h
deleted file mode 100644
index ce3d9022cd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.h
+++ /dev/null
@@ -1,1110 +0,0 @@
-//
-// GTMSenTestCase.h
-//
-// Copyright 2007-2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-// Portions of this file fall under the following license, marked with
-// SENTE_BEGIN - SENTE_END
-//
-// Copyright (c) 1997-2005, Sen:te (Sente SA). All rights reserved.
-//
-// Use of this source code is governed by the following license:
-//
-// Redistribution and use in source and binary forms, with or without modification,
-// are permitted provided that the following conditions are met:
-//
-// (1) Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// (2) Redistributions in binary form must reproduce the above copyright notice,
-// this list of conditions and the following disclaimer in the documentation
-// and/or other materials provided with the distribution.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-// IN NO EVENT SHALL Sente SA OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-// OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
-// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Note: this license is equivalent to the FreeBSD license.
-//
-// This notice may not be removed from this file.
-
-// Some extra test case macros that would have been convenient for SenTestingKit
-// to provide. I didn't stick GTM in front of the Macro names, so that they would
-// be easy to remember.
-
-#import "GTMDefines.h"
-
-#if (!GTM_IPHONE_SDK) || (GTM_IPHONE_USE_SENTEST)
-#import <SenTestingKit/SenTestingKit.h>
-#else
-#import <Foundation/Foundation.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined __clang__
-// gcc and gcc-llvm do not allow you to use STAssert(blah, nil) with nil
-// as a description if you have the NS_FORMAT_FUNCTION on.
-// clang however will not compile without warnings if you don't have it.
-NSString *STComposeString(NSString *, ...) NS_FORMAT_FUNCTION(1, 2);
-#else
-NSString *STComposeString(NSString *, ...);
-#endif // __clang__
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // !GTM_IPHONE_SDK || GTM_IPHONE_USE_SENTEST
-
-// Generates a failure when a1 != noErr
-// Args:
-// a1: should be either an OSErr or an OSStatus
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNoErr(a1, description, ...) \
-do { \
- @try { \
- OSStatus a1value = (a1); \
- if (a1value != noErr) { \
- NSString *_expression = [NSString stringWithFormat:@"Expected noErr, got %ld for (%s)", (long)a1value, #a1]; \
- [self failWithException:([NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == noErr fails", #a1] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when a1 != a2
-// Args:
-// a1: received value. Should be either an OSErr or an OSStatus
-// a2: expected value. Should be either an OSErr or an OSStatus
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertErr(a1, a2, description, ...) \
-do { \
- @try { \
- OSStatus a1value = (a1); \
- OSStatus a2value = (a2); \
- if (a1value != a2value) { \
- NSString *_expression = [NSString stringWithFormat:@"Expected %s(%ld) but got %ld for (%s)", #a2, (long)a2value, (long)a1value, #a1]; \
- [self failWithException:([NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s) fails", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-
-// Generates a failure when a1 is NULL
-// Args:
-// a1: should be a pointer (use STAssertNotNil for an object)
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNotNULL(a1, description, ...) \
-do { \
- @try { \
- __typeof__(a1) a1value = (a1); \
- if (a1value == (__typeof__(a1))NULL) { \
- NSString *_expression = [NSString stringWithFormat:@"((%s) != NULL)", #a1]; \
- [self failWithException:([NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != NULL fails", #a1] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when a1 is not NULL
-// Args:
-// a1: should be a pointer (use STAssertNil for an object)
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNULL(a1, description, ...) \
-do { \
- @try { \
- __typeof__(a1) a1value = (a1); \
- if (a1value != (__typeof__(a1))NULL) { \
- NSString *_expression = [NSString stringWithFormat:@"((%s) == NULL)", #a1]; \
- [self failWithException:([NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == NULL fails", #a1] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when a1 is equal to a2. This test is for C scalars,
-// structs and unions.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNotEquals(a1, a2, description, ...) \
-do { \
- @try { \
- if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"Type mismatch -- %@", STComposeString(description, ##__VA_ARGS__)]]; \
- } else { \
- __typeof__(a1) a1value = (a1); \
- __typeof__(a2) a2value = (a2); \
- NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \
- NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \
- if ([a1encoded isEqualToValue:a2encoded]) { \
- NSString *_expression = [NSString stringWithFormat:@"((%s) != (%s))", #a1, #a2]; \
- [self failWithException:([NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- }\
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when a1 is equal to a2. This test is for objects.
-// Args:
-// a1: argument 1. object.
-// a2: argument 2. object.
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNotEqualObjects(a1, a2, description, ...) \
-do { \
- @try {\
- id a1value = (a1); \
- id a2value = (a2); \
- if ( (strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \
- (strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \
- (![(id)a1value isEqual:(id)a2value]) ) continue; \
- [self failWithException:([NSException failureInEqualityBetweenObject:a1value \
- andObject:a2value \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- }\
- @catch (id anException) {\
- [self failWithException:([NSException failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- }\
-} while(0)
-
-// Generates a failure when a1 is not 'op' to a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertOperation(a1, a2, op, description, ...) \
-do { \
- @try { \
- if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"Type mismatch -- %@", STComposeString(description, ##__VA_ARGS__)]]; \
- } else { \
- __typeof__(a1) a1value = (a1); \
- __typeof__(a2) a2value = (a2); \
- if (!(a1value op a2value)) { \
- double a1DoubleValue = a1value; \
- double a2DoubleValue = a2value; \
- NSString *_expression = [NSString stringWithFormat:@"(%s (%lg) %s %s (%lg))", #a1, a1DoubleValue, #op, #a2, a2DoubleValue]; \
- [self failWithException:([NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)])]; \
- } \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException \
- failureInRaise:[NSString stringWithFormat:@"(%s) %s (%s)", #a1, #op, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when a1 is not > a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertGreaterThan(a1, a2, description, ...) \
- STAssertOperation(a1, a2, >, description, ##__VA_ARGS__)
-
-// Generates a failure when a1 is not >= a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertGreaterThanOrEqual(a1, a2, description, ...) \
- STAssertOperation(a1, a2, >=, description, ##__VA_ARGS__)
-
-// Generates a failure when a1 is not < a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertLessThan(a1, a2, description, ...) \
- STAssertOperation(a1, a2, <, description, ##__VA_ARGS__)
-
-// Generates a failure when a1 is not <= a2. This test is for C scalars.
-// Args:
-// a1: argument 1
-// a2: argument 2
-// op: operation
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertLessThanOrEqual(a1, a2, description, ...) \
- STAssertOperation(a1, a2, <=, description, ##__VA_ARGS__)
-
-// Generates a failure when string a1 is not equal to string a2. This call
-// differs from STAssertEqualObjects in that strings that are different in
-// composition (precomposed vs decomposed) will compare equal if their final
-// representation is equal.
-// ex O + umlaut decomposed is the same as O + umlaut composed.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertEqualStrings(a1, a2, description, ...) \
-do { \
- @try { \
- id a1value = (a1); \
- id a2value = (a2); \
- if (a1value == a2value) continue; \
- if ([a1value isKindOfClass:[NSString class]] && \
- [a2value isKindOfClass:[NSString class]] && \
- [a1value compare:a2value options:0] == NSOrderedSame) continue; \
- [self failWithException:[NSException failureInEqualityBetweenObject:a1value \
- andObject:a2value \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when string a1 is equal to string a2. This call
-// differs from STAssertEqualObjects in that strings that are different in
-// composition (precomposed vs decomposed) will compare equal if their final
-// representation is equal.
-// ex O + umlaut decomposed is the same as O + umlaut composed.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNotEqualStrings(a1, a2, description, ...) \
-do { \
- @try { \
- id a1value = (a1); \
- id a2value = (a2); \
- if ([a1value isKindOfClass:[NSString class]] && \
- [a2value isKindOfClass:[NSString class]] && \
- [a1value compare:a2value options:0] != NSOrderedSame) continue; \
- [self failWithException:[NSException failureInEqualityBetweenObject:a1value \
- andObject:a2value \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when c-string a1 is not equal to c-string a2.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertEqualCStrings(a1, a2, description, ...) \
-do { \
- @try { \
- const char* a1value = (a1); \
- const char* a2value = (a2); \
- if (a1value == a2value) continue; \
- if (strcmp(a1value, a2value) == 0) continue; \
- [self failWithException:[NSException failureInEqualityBetweenObject:[NSString stringWithUTF8String:a1value] \
- andObject:[NSString stringWithUTF8String:a2value] \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-// Generates a failure when c-string a1 is equal to c-string a2.
-// Args:
-// a1: string 1
-// a2: string 2
-// description: A format string as in the printf() function. Can be nil or
-// an empty string but must be present.
-// ...: A variable number of arguments to the format string. Can be absent.
-#define STAssertNotEqualCStrings(a1, a2, description, ...) \
-do { \
- @try { \
- const char* a1value = (a1); \
- const char* a2value = (a2); \
- if (strcmp(a1value, a2value) != 0) continue; \
- [self failWithException:[NSException failureInEqualityBetweenObject:[NSString stringWithUTF8String:a1value] \
- andObject:[NSString stringWithUTF8String:a2value] \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-/*" Generates a failure when a1 is not equal to a2 within + or - accuracy is false.
- This test is for GLKit types (GLKVector, GLKMatrix) where small differences
- could make these items not exactly equal. Do not use this version directly.
- Use the explicit STAssertEqualGLKVectors and STAssertEqualGLKMatrices defined
- below.
- _{a1 The GLKType on the left.}
- _{a2 The GLKType on the right.}
- _{accuracy The maximum difference between a1 and a2 for these values to be
- considered equal.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-
-#define STInternalAssertEqualGLKVectorsOrMatrices(a1, a2, accuracy, description, ...) \
-do { \
- @try { \
- if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"Type mismatch -- %@", STComposeString(description, ##__VA_ARGS__)]]; \
- } else { \
- __typeof__(a1) a1GLKValue = (a1); \
- __typeof__(a2) a2GLKValue = (a2); \
- __typeof__(accuracy) accuracyvalue = (accuracy); \
- float *a1FloatValue = ((float*)&a1GLKValue); \
- float *a2FloatValue = ((float*)&a2GLKValue); \
- for (size_t i = 0; i < sizeof(__typeof__(a1)) / sizeof(float); ++i) { \
- float a1value = a1FloatValue[i]; \
- float a2value = a2FloatValue[i]; \
- if (STAbsoluteDifference(a1value, a2value) > accuracyvalue) { \
- NSMutableArray *strings = [NSMutableArray arrayWithCapacity:sizeof(a1) / sizeof(float)]; \
- NSString *string; \
- for (size_t j = 0; j < sizeof(__typeof__(a1)) / sizeof(float); ++j) { \
- string = [NSString stringWithFormat:@"(%0.3f == %0.3f)", a1FloatValue[j], a2FloatValue[j]]; \
- [strings addObject:string]; \
- } \
- string = [strings componentsJoinedByString:@", "]; \
- NSString *desc = STComposeString(description, ##__VA_ARGS__); \
- desc = [NSString stringWithFormat:@"%@ With Accuracy %0.3f: %@", string, (float)accuracyvalue, desc]; \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", desc]]; \
- break; \
- } \
- } \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-#define STAssertEqualGLKVectors(a1, a2, accuracy, description, ...) \
- STInternalAssertEqualGLKVectorsOrMatrices(a1, a2, accuracy, description, ##__VA_ARGS__)
-
-#define STAssertEqualGLKMatrices(a1, a2, accuracy, description, ...) \
- STInternalAssertEqualGLKVectorsOrMatrices(a1, a2, accuracy, description, ##__VA_ARGS__)
-
-#define STAssertEqualGLKQuaternions(a1, a2, accuracy, description, ...) \
- STInternalAssertEqualGLKVectorsOrMatrices(a1, a2, accuracy, description, ##__VA_ARGS__)
-
-#if GTM_IPHONE_SDK && !GTM_IPHONE_USE_SENTEST
-// When not using the Xcode provided version, define everything ourselves.
-
-// SENTE_BEGIN
-/*" Generates a failure when !{ [a1 isEqualTo:a2] } is false
- (or one is nil and the other is not).
- _{a1 The object on the left.}
- _{a2 The object on the right.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertEqualObjects(a1, a2, description, ...) \
-do { \
- @try { \
- id a1value = (a1); \
- id a2value = (a2); \
- if (a1value == a2value) continue; \
- if ((strcmp(@encode(__typeof__(a1value)), @encode(id)) == 0) && \
- (strcmp(@encode(__typeof__(a2value)), @encode(id)) == 0) && \
- [(id)a1value isEqual:(id)a2value]) continue; \
- [self failWithException:[NSException failureInEqualityBetweenObject:a1value \
- andObject:a2value \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-
-/*" Generates a failure when a1 is not equal to a2. This test is for
- C scalars, structs and unions.
- _{a1 The argument on the left.}
- _{a2 The argument on the right.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertEquals(a1, a2, description, ...) \
-do { \
- @try { \
- if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"Type mismatch -- %@", STComposeString(description, ##__VA_ARGS__)]]; \
- } else { \
- __typeof__(a1) a1value = (a1); \
- __typeof__(a2) a2value = (a2); \
- NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \
- NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \
- if (![a1encoded isEqualToValue:a2encoded]) { \
- [self failWithException:[NSException failureInEqualityBetweenValue:a1encoded \
- andValue:a2encoded \
- withAccuracy:nil \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-#define STAbsoluteDifference(left,right) (MAX(left,right)-MIN(left,right))
-
-
-/*" Generates a failure when a1 is not equal to a2 within + or - accuracy is false.
- This test is for scalars such as floats and doubles where small differences
- could make these items not exactly equal, but also works for all scalars.
- _{a1 The scalar on the left.}
- _{a2 The scalar on the right.}
- _{accuracy The maximum difference between a1 and a2 for these values to be
- considered equal.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-
-#define STAssertEqualsWithAccuracy(a1, a2, accuracy, description, ...) \
-do { \
- @try { \
- if (strcmp(@encode(__typeof__(a1)), @encode(__typeof__(a2)))) { \
- [self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"Type mismatch -- %@", STComposeString(description, ##__VA_ARGS__)]]; \
- } else { \
- __typeof__(a1) a1value = (a1); \
- __typeof__(a2) a2value = (a2); \
- __typeof__(accuracy) accuracyvalue = (accuracy); \
- if (STAbsoluteDifference(a1value, a2value) > accuracyvalue) { \
- NSValue *a1encoded = [NSValue value:&a1value withObjCType:@encode(__typeof__(a1))]; \
- NSValue *a2encoded = [NSValue value:&a2value withObjCType:@encode(__typeof__(a2))]; \
- NSValue *accuracyencoded = [NSValue value:&accuracyvalue withObjCType:@encode(__typeof__(accuracy))]; \
- [self failWithException:[NSException failureInEqualityBetweenValue:a1encoded \
- andValue:a2encoded \
- withAccuracy:accuracyencoded \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == (%s)", #a1, #a2] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-
-
-/*" Generates a failure unconditionally.
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STFail(description, ...) \
-[self failWithException:[NSException failureInFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]
-
-
-
-/*" Generates a failure when a1 is not nil.
- _{a1 An object.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertNil(a1, description, ...) \
-do { \
- @try { \
- id a1value = (a1); \
- if (a1value != nil) { \
- NSString *_a1 = [NSString stringWithUTF8String:#a1]; \
- NSString *_expression = [NSString stringWithFormat:@"((%@) == nil)", _a1]; \
- [self failWithException:[NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) == nil fails", #a1] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-
-/*" Generates a failure when a1 is nil.
- _{a1 An object.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertNotNil(a1, description, ...) \
-do { \
- @try { \
- id a1value = (a1); \
- if (a1value == nil) { \
- NSString *_a1 = [NSString stringWithUTF8String:#a1]; \
- NSString *_expression = [NSString stringWithFormat:@"((%@) != nil)", _a1]; \
- [self failWithException:[NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) != nil fails", #a1] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while(0)
-
-
-/*" Generates a failure when expression evaluates to false.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertTrue(expr, description, ...) \
-do { \
- BOOL _evaluatedExpression = (expr); \
- if (!_evaluatedExpression) { \
- NSString *_expression = [NSString stringWithUTF8String:#expr]; \
- [self failWithException:[NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while (0)
-
-
-/*" Generates a failure when expression evaluates to false and in addition will
- generate error messages if an exception is encountered.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertTrueNoThrow(expr, description, ...) \
-do { \
- @try { \
- BOOL _evaluatedExpression = (expr); \
- if (!_evaluatedExpression) { \
- NSString *_expression = [NSString stringWithUTF8String:#expr]; \
- [self failWithException:[NSException failureInCondition:_expression \
- isTrue:NO \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"(%s) ", #expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while (0)
-
-
-/*" Generates a failure when the expression evaluates to true.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertFalse(expr, description, ...) \
-do { \
- BOOL _evaluatedExpression = (expr); \
- if (_evaluatedExpression) { \
- NSString *_expression = [NSString stringWithUTF8String:#expr]; \
- [self failWithException:[NSException failureInCondition:_expression \
- isTrue:YES \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while (0)
-
-
-/*" Generates a failure when the expression evaluates to true and in addition
- will generate error messages if an exception is encountered.
- _{expr The expression that is tested.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertFalseNoThrow(expr, description, ...) \
-do { \
- @try { \
- BOOL _evaluatedExpression = (expr); \
- if (_evaluatedExpression) { \
- NSString *_expression = [NSString stringWithUTF8String:#expr]; \
- [self failWithException:[NSException failureInCondition:_expression \
- isTrue:YES \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithFormat:@"!(%s) ", #expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while (0)
-
-
-/*" Generates a failure when expression does not throw an exception.
- _{expression The expression that is evaluated.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.
-"*/
-#define STAssertThrows(expr, description, ...) \
-do { \
- @try { \
- (expr); \
- } \
- @catch (id anException) { \
- continue; \
- } \
- [self failWithException:[NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:nil \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
-} while (0)
-
-
-/*" Generates a failure when expression does not throw an exception of a
- specific class.
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertThrowsSpecific(expr, specificException, description, ...) \
-do { \
- @try { \
- (expr); \
- } \
- @catch (specificException *anException) { \
- continue; \
- } \
- @catch (id anException) { \
- NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \
- [self failWithException:[NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(_descrip, ##__VA_ARGS__)]]; \
- continue; \
- } \
- NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \
- [self failWithException:[NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:nil \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(_descrip, ##__VA_ARGS__)]]; \
-} while (0)
-
-
-/*" Generates a failure when expression does not throw an exception of a
- specific class with a specific name. Useful for those frameworks like
- AppKit or Foundation that throw generic NSException w/specific names
- (NSInvalidArgumentException, etc).
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{aName The name of the specified exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-
-"*/
-#define STAssertThrowsSpecificNamed(expr, specificException, aName, description, ...) \
-do { \
- @try { \
- (expr); \
- } \
- @catch (specificException *anException) { \
- if ([aName isEqualToString:[anException name]]) continue; \
- NSString *_descrip = STComposeString(@"(Expected exception: %@ (name: %@)) %@", NSStringFromClass([specificException class]), aName, description); \
- [self failWithException: \
- [NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(_descrip, ##__VA_ARGS__)]]; \
- continue; \
- } \
- @catch (id anException) { \
- NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \
- [self failWithException: \
- [NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(_descrip, ##__VA_ARGS__)]]; \
- continue; \
- } \
- NSString *_descrip = STComposeString(@"(Expected exception: %@) %@", NSStringFromClass([specificException class]), description); \
- [self failWithException: \
- [NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:nil \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(_descrip, ##__VA_ARGS__)]]; \
-} while (0)
-
-
-/*" Generates a failure when expression does throw an exception.
- _{expression The expression that is evaluated.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertNoThrow(expr, description, ...) \
-do { \
- @try { \
- (expr); \
- } \
- @catch (id anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
-} while (0)
-
-
-/*" Generates a failure when expression does throw an exception of the specitied
- class. Any other exception is okay (i.e. does not generate a failure).
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-"*/
-#define STAssertNoThrowSpecific(expr, specificException, description, ...) \
-do { \
- @try { \
- (expr); \
- } \
- @catch (specificException *anException) { \
- [self failWithException:[NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(description, ##__VA_ARGS__)]]; \
- } \
- @catch (id anythingElse) { \
- ; \
- } \
-} while (0)
-
-
-/*" Generates a failure when expression does throw an exception of a
- specific class with a specific name. Useful for those frameworks like
- AppKit or Foundation that throw generic NSException w/specific names
- (NSInvalidArgumentException, etc).
- _{expression The expression that is evaluated.}
- _{specificException The specified class of the exception.}
- _{aName The name of the specified exception.}
- _{description A format string as in the printf() function. Can be nil or
- an empty string but must be present.}
- _{... A variable number of arguments to the format string. Can be absent.}
-
-"*/
-#define STAssertNoThrowSpecificNamed(expr, specificException, aName, description, ...) \
-do { \
- @try { \
- (expr); \
- } \
- @catch (specificException *anException) { \
- if ([aName isEqualToString:[anException name]]) { \
- NSString *_descrip = STComposeString(@"(Expected exception: %@ (name: %@)) %@", NSStringFromClass([specificException class]), aName, description); \
- [self failWithException: \
- [NSException failureInRaise:[NSString stringWithUTF8String:#expr] \
- exception:anException \
- inFile:[NSString stringWithUTF8String:__FILE__] \
- atLine:__LINE__ \
- withDescription:@"%@", STComposeString(_descrip, ##__VA_ARGS__)]]; \
- } \
- continue; \
- } \
- @catch (id anythingElse) { \
- ; \
- } \
-} while (0)
-
-
-
-@interface NSException (GTMSenTestAdditions)
-+ (NSException *)failureInFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... NS_FORMAT_FUNCTION(3, 4);
-+ (NSException *)failureInCondition:(NSString *)condition
- isTrue:(BOOL)isTrue
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... NS_FORMAT_FUNCTION(5, 6);
-+ (NSException *)failureInEqualityBetweenObject:(id)left
- andObject:(id)right
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... NS_FORMAT_FUNCTION(5, 6);
-+ (NSException *)failureInEqualityBetweenValue:(NSValue *)left
- andValue:(NSValue *)right
- withAccuracy:(NSValue *)accuracy
- inFile:(NSString *)filename
- atLine:(int) ineNumber
- withDescription:(NSString *)formatString, ... NS_FORMAT_FUNCTION(6, 7);
-+ (NSException *)failureInRaise:(NSString *)expression
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... NS_FORMAT_FUNCTION(4, 5);
-+ (NSException *)failureInRaise:(NSString *)expression
- exception:(NSException *)exception
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... NS_FORMAT_FUNCTION(5, 6);
-@end
-
-// SENTE_END
-
-@protocol SenTestCase
-+ (id)testCaseWithInvocation:(NSInvocation *)anInvocation;
-- (id)initWithInvocation:(NSInvocation *)anInvocation;
-- (void)setUp;
-- (void)invokeTest;
-- (void)tearDown;
-- (void)performTest;
-- (void)failWithException:(NSException*)exception;
-- (NSInvocation *)invocation;
-- (SEL)selector;
-+ (NSArray *)testInvocations;
-@end
-
-@interface SenTestCase : NSObject<SenTestCase> {
- @private
- NSInvocation *invocation_;
-}
-@end
-
-GTM_EXTERN NSString *const SenTestFailureException;
-
-GTM_EXTERN NSString *const SenTestFilenameKey;
-GTM_EXTERN NSString *const SenTestLineNumberKey;
-
-#endif // GTM_IPHONE_SDK && !GTM_IPHONE_USE_SENTEST
-
-// All unittest cases in GTM should inherit from GTMTestCase. It makes sure
-// to set up our logging system correctly to verify logging calls.
-// See GTMUnitTestDevLog.h for details
-@interface GTMTestCase : SenTestCase
-
-// Returns YES if this is an abstract testCase class as opposed to a concrete
-// testCase class that you want tests run against. SenTestCase is not designed
-// out of the box to handle an abstract class hierarchy descending from it with
-// some concrete subclasses. In some cases we want all the "concrete"
-// subclasses of an abstract subclass of SenTestCase to run a test, but we don't
-// want that test to be run against an instance of an abstract subclass itself.
-// By returning "YES" here, the tests defined by this class won't be run against
-// an instance of this class. As an example class hierarchy:
-//
-// FooExtensionTestCase
-// GTMTestCase <- ExtensionAbstractTestCase <
-// BarExtensionTestCase
-//
-// So FooExtensionTestCase and BarExtensionTestCase inherit from
-// ExtensionAbstractTestCase (and probably FooExtension and BarExtension inherit
-// from a class named Extension). We want the tests in ExtensionAbstractTestCase
-// to be run as part of FooExtensionTestCase and BarExtensionTestCase, but we
-// don't want them run against ExtensionAbstractTestCase. The default
-// implementation checks to see if the name of the class contains the word
-// "AbstractTest" (case sensitive).
-+ (BOOL)isAbstractTestCase;
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.m b/toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.m
deleted file mode 100644
index 162f01e97c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/testing/GTMSenTestCase.m
+++ /dev/null
@@ -1,428 +0,0 @@
-//
-// GTMSenTestCase.m
-//
-// Copyright 2007-2008 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License"); you may not
-// use this file except in compliance with the License. You may obtain a copy
-// of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-// License for the specific language governing permissions and limitations under
-// the License.
-//
-
-#import "GTMSenTestCase.h"
-
-#import <unistd.h>
-#if GTM_IPHONE_SIMULATOR
-#import <objc/message.h>
-#endif
-
-#import "GTMObjC2Runtime.h"
-#import "GTMUnitTestDevLog.h"
-
-#if GTM_IPHONE_SDK && !GTM_IPHONE_USE_SENTEST
-#import <stdarg.h>
-
-@interface NSException (GTMSenTestPrivateAdditions)
-+ (NSException *)failureInFile:(NSString *)filename
- atLine:(int)lineNumber
- reason:(NSString *)reason;
-@end
-
-@implementation NSException (GTMSenTestPrivateAdditions)
-+ (NSException *)failureInFile:(NSString *)filename
- atLine:(int)lineNumber
- reason:(NSString *)reason {
- NSDictionary *userInfo =
- [NSDictionary dictionaryWithObjectsAndKeys:
- [NSNumber numberWithInteger:lineNumber], SenTestLineNumberKey,
- filename, SenTestFilenameKey,
- nil];
-
- return [self exceptionWithName:SenTestFailureException
- reason:reason
- userInfo:userInfo];
-}
-@end
-
-@implementation NSException (GTMSenTestAdditions)
-
-+ (NSException *)failureInFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... {
-
- NSString *testDescription = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- testDescription =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
-
- NSString *reason = testDescription;
-
- return [self failureInFile:filename atLine:lineNumber reason:reason];
-}
-
-+ (NSException *)failureInCondition:(NSString *)condition
- isTrue:(BOOL)isTrue
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... {
-
- NSString *testDescription = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- testDescription =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
-
- NSString *reason = [NSString stringWithFormat:@"'%@' should be %s. %@",
- condition, isTrue ? "false" : "true", testDescription];
-
- return [self failureInFile:filename atLine:lineNumber reason:reason];
-}
-
-+ (NSException *)failureInEqualityBetweenObject:(id)left
- andObject:(id)right
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... {
-
- NSString *testDescription = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- testDescription =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
-
- NSString *reason =
- [NSString stringWithFormat:@"'%@' should be equal to '%@'. %@",
- [left description], [right description], testDescription];
-
- return [self failureInFile:filename atLine:lineNumber reason:reason];
-}
-
-+ (NSException *)failureInEqualityBetweenValue:(NSValue *)left
- andValue:(NSValue *)right
- withAccuracy:(NSValue *)accuracy
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... {
-
- NSString *testDescription = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- testDescription =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
-
- NSString *reason;
- if (accuracy) {
- reason =
- [NSString stringWithFormat:@"'%@' should be equal to '%@'. %@",
- left, right, testDescription];
- } else {
- reason =
- [NSString stringWithFormat:@"'%@' should be equal to '%@' +/-'%@'. %@",
- left, right, accuracy, testDescription];
- }
-
- return [self failureInFile:filename atLine:lineNumber reason:reason];
-}
-
-+ (NSException *)failureInRaise:(NSString *)expression
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... {
-
- NSString *testDescription = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- testDescription =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
-
- NSString *reason = [NSString stringWithFormat:@"'%@' should raise. %@",
- expression, testDescription];
-
- return [self failureInFile:filename atLine:lineNumber reason:reason];
-}
-
-+ (NSException *)failureInRaise:(NSString *)expression
- exception:(NSException *)exception
- inFile:(NSString *)filename
- atLine:(int)lineNumber
- withDescription:(NSString *)formatString, ... {
-
- NSString *testDescription = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- testDescription =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
-
- NSString *reason;
- if ([[exception name] isEqualToString:SenTestFailureException]) {
- // it's our exception, assume it has the right description on it.
- reason = [exception reason];
- } else {
- // not one of our exception, use the exceptions reason and our description
- reason = [NSString stringWithFormat:@"'%@' raised '%@'. %@",
- expression, [exception reason], testDescription];
- }
-
- return [self failureInFile:filename atLine:lineNumber reason:reason];
-}
-
-@end
-
-NSString *STComposeString(NSString *formatString, ...) {
- NSString *reason = @"";
- if (formatString) {
- va_list vl;
- va_start(vl, formatString);
- reason =
- [[[NSString alloc] initWithFormat:formatString arguments:vl] autorelease];
- va_end(vl);
- }
- return reason;
-}
-
-NSString *const SenTestFailureException = @"SenTestFailureException";
-NSString *const SenTestFilenameKey = @"SenTestFilenameKey";
-NSString *const SenTestLineNumberKey = @"SenTestLineNumberKey";
-
-@interface SenTestCase (SenTestCasePrivate)
-// our method of logging errors
-+ (void)printException:(NSException *)exception fromTestName:(NSString *)name;
-@end
-
-@implementation SenTestCase
-+ (id)testCaseWithInvocation:(NSInvocation *)anInvocation {
- return [[[self alloc] initWithInvocation:anInvocation] autorelease];
-}
-
-- (id)initWithInvocation:(NSInvocation *)anInvocation {
- if ((self = [super init])) {
- invocation_ = [anInvocation retain];
- }
- return self;
-}
-
-- (void)dealloc {
- [invocation_ release];
- [super dealloc];
-}
-
-- (void)failWithException:(NSException*)exception {
- [exception raise];
-}
-
-- (void)setUp {
-}
-
-- (void)performTest {
- @try {
- [self invokeTest];
- } @catch (NSException *exception) {
- [[self class] printException:exception
- fromTestName:NSStringFromSelector([self selector])];
- [exception raise];
- }
-}
-
-- (NSInvocation *)invocation {
- return invocation_;
-}
-
-- (SEL)selector {
- return [invocation_ selector];
-}
-
-+ (void)printException:(NSException *)exception fromTestName:(NSString *)name {
- NSDictionary *userInfo = [exception userInfo];
- NSString *filename = [userInfo objectForKey:SenTestFilenameKey];
- NSNumber *lineNumber = [userInfo objectForKey:SenTestLineNumberKey];
- NSString *className = NSStringFromClass([self class]);
- if ([filename length] == 0) {
- filename = @"Unknown.m";
- }
- fprintf(stderr, "%s:%ld: error: -[%s %s] : %s\n",
- [filename UTF8String],
- (long)[lineNumber integerValue],
- [className UTF8String],
- [name UTF8String],
- [[exception reason] UTF8String]);
- fflush(stderr);
-}
-
-- (void)invokeTest {
- NSException *e = nil;
- @try {
- // Wrap things in autorelease pools because they may
- // have an STMacro in their dealloc which may get called
- // when the pool is cleaned up
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- // We don't log exceptions here, instead we let the person that called
- // this log the exception. This ensures they are only logged once but the
- // outer layers get the exceptions to report counts, etc.
- @try {
- [self setUp];
- @try {
- NSInvocation *invocation = [self invocation];
-#if GTM_IPHONE_SIMULATOR
- // We don't call [invocation invokeWithTarget:self]; because of
- // Radar 8081169: NSInvalidArgumentException can't be caught
- // It turns out that on iOS4 (and 3.2) exceptions thrown inside an
- // [invocation invoke] on the simulator cannot be caught.
- // http://openradar.appspot.com/8081169
- objc_msgSend(self, [invocation selector]);
-#else
- [invocation invokeWithTarget:self];
-#endif
- } @catch (NSException *exception) {
- e = [exception retain];
- }
- [self tearDown];
- } @catch (NSException *exception) {
- e = [exception retain];
- }
- [pool release];
- } @catch (NSException *exception) {
- e = [exception retain];
- }
- if (e) {
- [e autorelease];
- [e raise];
- }
-}
-
-- (void)tearDown {
-}
-
-- (NSString *)description {
- // This matches the description OCUnit would return to you
- return [NSString stringWithFormat:@"-[%@ %@]", [self class],
- NSStringFromSelector([self selector])];
-}
-
-// Used for sorting methods below
-static int MethodSort(id a, id b, void *context) {
- NSInvocation *invocationA = a;
- NSInvocation *invocationB = b;
- const char *nameA = sel_getName([invocationA selector]);
- const char *nameB = sel_getName([invocationB selector]);
- return strcmp(nameA, nameB);
-}
-
-
-+ (NSArray *)testInvocations {
- NSMutableArray *invocations = nil;
- // Need to walk all the way up the parent classes collecting methods (in case
- // a test is a subclass of another test).
- Class senTestCaseClass = [SenTestCase class];
- for (Class currentClass = self;
- currentClass && (currentClass != senTestCaseClass);
- currentClass = class_getSuperclass(currentClass)) {
- unsigned int methodCount;
- Method *methods = class_copyMethodList(currentClass, &methodCount);
- if (methods) {
- // This handles disposing of methods for us even if an exception should fly.
- [NSData dataWithBytesNoCopy:methods
- length:sizeof(Method) * methodCount];
- if (!invocations) {
- invocations = [NSMutableArray arrayWithCapacity:methodCount];
- }
- for (size_t i = 0; i < methodCount; ++i) {
- Method currMethod = methods[i];
- SEL sel = method_getName(currMethod);
- char *returnType = NULL;
- const char *name = sel_getName(sel);
- // If it starts with test, takes 2 args (target and sel) and returns
- // void run it.
- if (strstr(name, "test") == name) {
- returnType = method_copyReturnType(currMethod);
- if (returnType) {
- // This handles disposing of returnType for us even if an
- // exception should fly. Length +1 for the terminator, not that
- // the length really matters here, as we never reference inside
- // the data block.
- [NSData dataWithBytesNoCopy:returnType
- length:strlen(returnType) + 1];
- }
- }
- // TODO: If a test class is a subclass of another, and they reuse the
- // same selector name (ie-subclass overrides it), this current loop
- // and test here will cause cause it to get invoked twice. To fix this
- // the selector would have to be checked against all the ones already
- // added, so it only gets done once.
- if (returnType // True if name starts with "test"
- && strcmp(returnType, @encode(void)) == 0
- && method_getNumberOfArguments(currMethod) == 2) {
- NSMethodSignature *sig = [self instanceMethodSignatureForSelector:sel];
- NSInvocation *invocation
- = [NSInvocation invocationWithMethodSignature:sig];
- [invocation setSelector:sel];
- [invocations addObject:invocation];
- }
- }
- }
- }
- // Match SenTestKit and run everything in alphbetical order.
- [invocations sortUsingFunction:MethodSort context:nil];
- return invocations;
-}
-
-@end
-
-#endif // GTM_IPHONE_SDK && !GTM_IPHONE_USE_SENTEST
-
-@implementation GTMTestCase : SenTestCase
-- (void)invokeTest {
- NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
- Class devLogClass = NSClassFromString(@"GTMUnitTestDevLog");
- if (devLogClass) {
- [devLogClass performSelector:@selector(enableTracking)];
- [devLogClass performSelector:@selector(verifyNoMoreLogsExpected)];
-
- }
- [super invokeTest];
- if (devLogClass) {
- [devLogClass performSelector:@selector(verifyNoMoreLogsExpected)];
- [devLogClass performSelector:@selector(disableTracking)];
- }
- [localPool drain];
-}
-
-+ (BOOL)isAbstractTestCase {
- NSString *name = NSStringFromClass(self);
- return [name rangeOfString:@"AbstractTest"].location != NSNotFound;
-}
-
-+ (NSArray *)testInvocations {
- NSArray *invocations = nil;
- if (![self isAbstractTestCase]) {
- invocations = [super testInvocations];
- }
- return invocations;
-}
-
-@end
diff --git a/toolkit/crashreporter/google-breakpad/src/common/md5.cc b/toolkit/crashreporter/google-breakpad/src/common/md5.cc
deleted file mode 100644
index a0d9a1bdd8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/md5.cc
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * written by Colin Plumb in 1993, no copyright is claimed.
- * This code is in the public domain; do with it what you wish.
- *
- * Equivalent code is available from RSA Data Security, Inc.
- * This code has been tested against that, and is equivalent,
- * except that you don't need to include two pages of legalese
- * with every copy.
- *
- * To compute the message digest of a chunk of bytes, declare an
- * MD5Context structure, pass it to MD5Init, call MD5Update as
- * needed on buffers full of bytes, and then call MD5Final, which
- * will fill a supplied 16-byte array with the digest.
- */
-
-#include <string.h>
-
-#include "common/md5.h"
-
-namespace google_breakpad {
-
-#ifndef WORDS_BIGENDIAN
-#define byteReverse(buf, len) /* Nothing */
-#else
-/*
- * Note: this code is harmless on little-endian machines.
- */
-static void byteReverse(unsigned char *buf, unsigned longs)
-{
- u32 t;
- do {
- t = (u32) ((unsigned) buf[3] << 8 | buf[2]) << 16 |
- ((unsigned) buf[1] << 8 | buf[0]);
- *(u32 *) buf = t;
- buf += 4;
- } while (--longs);
-}
-#endif
-
-static void MD5Transform(u32 buf[4], u32 const in[16]);
-
-/*
- * Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
- * initialization constants.
- */
-void MD5Init(struct MD5Context *ctx)
-{
- ctx->buf[0] = 0x67452301;
- ctx->buf[1] = 0xefcdab89;
- ctx->buf[2] = 0x98badcfe;
- ctx->buf[3] = 0x10325476;
-
- ctx->bits[0] = 0;
- ctx->bits[1] = 0;
-}
-
-/*
- * Update context to reflect the concatenation of another buffer full
- * of bytes.
- */
-void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len)
-{
- u32 t;
-
- /* Update bitcount */
-
- t = ctx->bits[0];
- if ((ctx->bits[0] = t + ((u32) len << 3)) < t)
- ctx->bits[1]++; /* Carry from low to high */
- ctx->bits[1] += len >> 29;
-
- t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
-
- /* Handle any leading odd-sized chunks */
-
- if (t) {
- unsigned char *p = (unsigned char *) ctx->in + t;
-
- t = 64 - t;
- if (len < t) {
- memcpy(p, buf, len);
- return;
- }
- memcpy(p, buf, t);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u32 *) ctx->in);
- buf += t;
- len -= t;
- }
- /* Process data in 64-byte chunks */
-
- while (len >= 64) {
- memcpy(ctx->in, buf, 64);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u32 *) ctx->in);
- buf += 64;
- len -= 64;
- }
-
- /* Handle any remaining bytes of data. */
-
- memcpy(ctx->in, buf, len);
-}
-
-/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
- * 1 0* (64-bit count of bits processed, MSB-first)
- */
-void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
-{
- unsigned count;
- unsigned char *p;
-
- /* Compute number of bytes mod 64 */
- count = (ctx->bits[0] >> 3) & 0x3F;
-
- /* Set the first char of padding to 0x80. This is safe since there is
- always at least one byte free */
- p = ctx->in + count;
- *p++ = 0x80;
-
- /* Bytes of padding needed to make 64 bytes */
- count = 64 - 1 - count;
-
- /* Pad out to 56 mod 64 */
- if (count < 8) {
- /* Two lots of padding: Pad the first block to 64 bytes */
- memset(p, 0, count);
- byteReverse(ctx->in, 16);
- MD5Transform(ctx->buf, (u32 *) ctx->in);
-
- /* Now fill the next block with 56 bytes */
- memset(ctx->in, 0, 56);
- } else {
- /* Pad block to 56 bytes */
- memset(p, 0, count - 8);
- }
- byteReverse(ctx->in, 14);
-
- /* Append length in bits and transform */
- ((u32 *) ctx->in)[14] = ctx->bits[0];
- ((u32 *) ctx->in)[15] = ctx->bits[1];
-
- MD5Transform(ctx->buf, (u32 *) ctx->in);
- byteReverse((unsigned char *) ctx->buf, 4);
- memcpy(digest, ctx->buf, 16);
- memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
-}
-
-/* The four core functions - F1 is optimized somewhat */
-
-/* #define F1(x, y, z) (x & y | ~x & z) */
-#define F1(x, y, z) (z ^ (x & (y ^ z)))
-#define F2(x, y, z) F1(z, x, y)
-#define F3(x, y, z) (x ^ y ^ z)
-#define F4(x, y, z) (y ^ (x | ~z))
-
-/* This is the central step in the MD5 algorithm. */
-#define MD5STEP(f, w, x, y, z, data, s) \
- ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
-
-/*
- * The core of the MD5 algorithm, this alters an existing MD5 hash to
- * reflect the addition of 16 longwords of new data. MD5Update blocks
- * the data and converts bytes into longwords for this routine.
- */
-static void MD5Transform(u32 buf[4], u32 const in[16])
-{
- u32 a, b, c, d;
-
- a = buf[0];
- b = buf[1];
- c = buf[2];
- d = buf[3];
-
- MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
- MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
- MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
- MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
- MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
- MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
- MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
- MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
- MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
- MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
- MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
- MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
- MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
- MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
- MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
- MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
-
- MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
- MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
- MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
- MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
- MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
- MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
- MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
- MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
- MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
- MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
- MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
- MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
- MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
- MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
- MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
- MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
-
- MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
- MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
- MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
- MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
- MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
- MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
- MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
- MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
- MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
- MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
- MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
- MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
- MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
- MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
- MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
- MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
-
- MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
- MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
- MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
- MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
- MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
- MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
- MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
- MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
- MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
- MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
- MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
- MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
- MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
- MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
- MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
- MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
-
- buf[0] += a;
- buf[1] += b;
- buf[2] += c;
- buf[3] += d;
-}
-
-} // namespace google_breakpad
-
diff --git a/toolkit/crashreporter/google-breakpad/src/common/md5.h b/toolkit/crashreporter/google-breakpad/src/common/md5.h
deleted file mode 100644
index 2ab0ab95ae..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/md5.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2007 Google Inc. All Rights Reserved.
-// Author: liuli@google.com (Liu Li)
-#ifndef COMMON_MD5_H__
-#define COMMON_MD5_H__
-
-#include <stdint.h>
-
-namespace google_breakpad {
-
-typedef uint32_t u32;
-typedef uint8_t u8;
-
-struct MD5Context {
- u32 buf[4];
- u32 bits[2];
- u8 in[64];
-};
-
-void MD5Init(struct MD5Context *ctx);
-
-void MD5Update(struct MD5Context *ctx, unsigned char const *buf, size_t len);
-
-void MD5Final(unsigned char digest[16], struct MD5Context *ctx);
-
-} // namespace google_breakpad
-
-#endif // COMMON_MD5_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/memory.h b/toolkit/crashreporter/google-breakpad/src/common/memory.h
deleted file mode 100644
index 9158b50c8b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/memory.h
+++ /dev/null
@@ -1,249 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MEMORY_H_
-#define GOOGLE_BREAKPAD_COMMON_MEMORY_H_
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-#include <memory>
-#include <vector>
-
-#if defined(MEMORY_SANITIZER)
-#include <sanitizer/msan_interface.h>
-#endif
-
-#ifdef __APPLE__
-#define sys_mmap mmap
-#define sys_munmap munmap
-#define MAP_ANONYMOUS MAP_ANON
-#else
-#include "third_party/lss/linux_syscall_support.h"
-#endif
-
-namespace google_breakpad {
-
-// This is very simple allocator which fetches pages from the kernel directly.
-// Thus, it can be used even when the heap may be corrupted.
-//
-// There is no free operation. The pages are only freed when the object is
-// destroyed.
-class PageAllocator {
- public:
- PageAllocator()
- : page_size_(getpagesize()),
- last_(NULL),
- current_page_(NULL),
- page_offset_(0),
- pages_allocated_(0) {
- }
-
- ~PageAllocator() {
- FreeAll();
- }
-
- void *Alloc(size_t bytes) {
- if (!bytes)
- return NULL;
-
- if (current_page_ && page_size_ - page_offset_ >= bytes) {
- uint8_t *const ret = current_page_ + page_offset_;
- page_offset_ += bytes;
- if (page_offset_ == page_size_) {
- page_offset_ = 0;
- current_page_ = NULL;
- }
-
- return ret;
- }
-
- const size_t pages =
- (bytes + sizeof(PageHeader) + page_size_ - 1) / page_size_;
- uint8_t *const ret = GetNPages(pages);
- if (!ret)
- return NULL;
-
- page_offset_ =
- (page_size_ - (page_size_ * pages - (bytes + sizeof(PageHeader)))) %
- page_size_;
- current_page_ = page_offset_ ? ret + page_size_ * (pages - 1) : NULL;
-
- return ret + sizeof(PageHeader);
- }
-
- // Checks whether the page allocator owns the passed-in pointer.
- // This method exists for testing pursposes only.
- bool OwnsPointer(const void* p) {
- for (PageHeader* header = last_; header; header = header->next) {
- const char* current = reinterpret_cast<char*>(header);
- if ((p >= current) && (p < current + header->num_pages * page_size_))
- return true;
- }
-
- return false;
- }
-
- unsigned long pages_allocated() { return pages_allocated_; }
-
- private:
- uint8_t *GetNPages(size_t num_pages) {
- void *a = sys_mmap(NULL, page_size_ * num_pages, PROT_READ | PROT_WRITE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (a == MAP_FAILED)
- return NULL;
-
-#if defined(MEMORY_SANITIZER)
- // We need to indicate to MSan that memory allocated through sys_mmap is
- // initialized, since linux_syscall_support.h doesn't have MSan hooks.
- __msan_unpoison(a, page_size_ * num_pages);
-#endif
-
- struct PageHeader *header = reinterpret_cast<PageHeader*>(a);
- header->next = last_;
- header->num_pages = num_pages;
- last_ = header;
-
- pages_allocated_ += num_pages;
-
- return reinterpret_cast<uint8_t*>(a);
- }
-
- void FreeAll() {
- PageHeader *next;
-
- for (PageHeader *cur = last_; cur; cur = next) {
- next = cur->next;
- sys_munmap(cur, cur->num_pages * page_size_);
- }
- }
-
- struct PageHeader {
- PageHeader *next; // pointer to the start of the next set of pages.
- size_t num_pages; // the number of pages in this set.
- };
-
- const size_t page_size_;
- PageHeader *last_;
- uint8_t *current_page_;
- size_t page_offset_;
- unsigned long pages_allocated_;
-};
-
-// Wrapper to use with STL containers
-template <typename T>
-struct PageStdAllocator : public std::allocator<T> {
- typedef typename std::allocator<T>::pointer pointer;
- typedef typename std::allocator<T>::size_type size_type;
-
- explicit PageStdAllocator(PageAllocator& allocator) : allocator_(allocator),
- stackdata_(NULL),
- stackdata_size_(0)
- {}
-
- template <class Other> PageStdAllocator(const PageStdAllocator<Other>& other)
- : allocator_(other.allocator_),
- stackdata_(nullptr),
- stackdata_size_(0)
- {}
-
- explicit PageStdAllocator(PageAllocator& allocator,
- pointer stackdata,
- size_type stackdata_size) : allocator_(allocator),
- stackdata_(stackdata),
- stackdata_size_(stackdata_size)
- {}
-
- inline pointer allocate(size_type n, const void* = 0) {
- const size_type size = sizeof(T) * n;
- if (size <= stackdata_size_) {
- return stackdata_;
- }
- return static_cast<pointer>(allocator_.Alloc(size));
- }
-
- inline void deallocate(pointer, size_type) {
- // The PageAllocator doesn't free.
- }
-
- template <typename U> struct rebind {
- typedef PageStdAllocator<U> other;
- };
-
- private:
- // Silly workaround for the gcc from Android's ndk (gcc 4.6), which will
- // otherwise complain that `other.allocator_` is private in the constructor
- // code.
- template<typename Other> friend struct PageStdAllocator;
-
- PageAllocator& allocator_;
- pointer stackdata_;
- size_type stackdata_size_;
-};
-
-// A wasteful vector is a std::vector, except that it allocates memory from a
-// PageAllocator. It's wasteful because, when resizing, it always allocates a
-// whole new array since the PageAllocator doesn't support realloc.
-template<class T>
-class wasteful_vector : public std::vector<T, PageStdAllocator<T> > {
- public:
- wasteful_vector(PageAllocator* allocator, unsigned size_hint = 16)
- : std::vector<T, PageStdAllocator<T> >(PageStdAllocator<T>(*allocator)) {
- std::vector<T, PageStdAllocator<T> >::reserve(size_hint);
- }
- protected:
- wasteful_vector(PageStdAllocator<T> allocator)
- : std::vector<T, PageStdAllocator<T> >(allocator) {}
-};
-
-// auto_wasteful_vector allocates space on the stack for N entries to avoid
-// using the PageAllocator for small data, while still allowing for larger data.
-template<class T, unsigned int N>
-class auto_wasteful_vector : public wasteful_vector<T> {
- T stackdata_[N];
- public:
- auto_wasteful_vector(PageAllocator* allocator)
- : wasteful_vector<T>(
- PageStdAllocator<T>(*allocator,
- &stackdata_[0],
- sizeof(stackdata_))) {
- std::vector<T, PageStdAllocator<T> >::reserve(N);
- }
-};
-
-} // namespace google_breakpad
-
-inline void* operator new(size_t nbytes,
- google_breakpad::PageAllocator& allocator) {
- return allocator.Alloc(nbytes);
-}
-
-#endif // GOOGLE_BREAKPAD_COMMON_MEMORY_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/memory_range.h b/toolkit/crashreporter/google-breakpad/src/common/memory_range.h
deleted file mode 100644
index 41dd2da622..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/memory_range.h
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// memory_range.h: Define the google_breakpad::MemoryRange class, which
-// is a lightweight wrapper with a pointer and a length to encapsulate
-// a contiguous range of memory.
-
-#ifndef COMMON_MEMORY_RANGE_H_
-#define COMMON_MEMORY_RANGE_H_
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-// A lightweight wrapper with a pointer and a length to encapsulate a
-// contiguous range of memory. It provides helper methods for checked
-// access of a subrange of the memory. Its implemementation does not
-// allocate memory or call into libc functions, and is thus safer to use
-// in a crashed environment.
-class MemoryRange {
- public:
- MemoryRange() : data_(NULL), length_(0) {}
-
- MemoryRange(const void* data, size_t length) {
- Set(data, length);
- }
-
- // Returns true if this memory range contains no data.
- bool IsEmpty() const {
- // Set() guarantees that |length_| is zero if |data_| is NULL.
- return length_ == 0;
- }
-
- // Resets to an empty range.
- void Reset() {
- data_ = NULL;
- length_ = 0;
- }
-
- // Sets this memory range to point to |data| and its length to |length|.
- void Set(const void* data, size_t length) {
- data_ = reinterpret_cast<const uint8_t*>(data);
- // Always set |length_| to zero if |data_| is NULL.
- length_ = data ? length : 0;
- }
-
- // Returns true if this range covers a subrange of |sub_length| bytes
- // at |sub_offset| bytes of this memory range, or false otherwise.
- bool Covers(size_t sub_offset, size_t sub_length) const {
- // The following checks verify that:
- // 1. sub_offset is within [ 0 .. length_ - 1 ]
- // 2. sub_offset + sub_length is within
- // [ sub_offset .. length_ ]
- return sub_offset < length_ &&
- sub_offset + sub_length >= sub_offset &&
- sub_offset + sub_length <= length_;
- }
-
- // Returns a raw data pointer to a subrange of |sub_length| bytes at
- // |sub_offset| bytes of this memory range, or NULL if the subrange
- // is out of bounds.
- const void* GetData(size_t sub_offset, size_t sub_length) const {
- return Covers(sub_offset, sub_length) ? (data_ + sub_offset) : NULL;
- }
-
- // Same as the two-argument version of GetData() but uses sizeof(DataType)
- // as the subrange length and returns an |DataType| pointer for convenience.
- template <typename DataType>
- const DataType* GetData(size_t sub_offset) const {
- return reinterpret_cast<const DataType*>(
- GetData(sub_offset, sizeof(DataType)));
- }
-
- // Returns a raw pointer to the |element_index|-th element of an array
- // of elements of length |element_size| starting at |sub_offset| bytes
- // of this memory range, or NULL if the element is out of bounds.
- const void* GetArrayElement(size_t element_offset,
- size_t element_size,
- unsigned element_index) const {
- size_t sub_offset = element_offset + element_index * element_size;
- return GetData(sub_offset, element_size);
- }
-
- // Same as the three-argument version of GetArrayElement() but deduces
- // the element size using sizeof(ElementType) and returns an |ElementType|
- // pointer for convenience.
- template <typename ElementType>
- const ElementType* GetArrayElement(size_t element_offset,
- unsigned element_index) const {
- return reinterpret_cast<const ElementType*>(
- GetArrayElement(element_offset, sizeof(ElementType), element_index));
- }
-
- // Returns a subrange of |sub_length| bytes at |sub_offset| bytes of
- // this memory range, or an empty range if the subrange is out of bounds.
- MemoryRange Subrange(size_t sub_offset, size_t sub_length) const {
- return Covers(sub_offset, sub_length) ?
- MemoryRange(data_ + sub_offset, sub_length) : MemoryRange();
- }
-
- // Returns a pointer to the beginning of this memory range.
- const uint8_t* data() const { return data_; }
-
- // Returns the length, in bytes, of this memory range.
- size_t length() const { return length_; }
-
- private:
- // Pointer to the beginning of this memory range.
- const uint8_t* data_;
-
- // Length, in bytes, of this memory range.
- size_t length_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_MEMORY_RANGE_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/memory_range_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/memory_range_unittest.cc
deleted file mode 100644
index f6cf8c8b2a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/memory_range_unittest.cc
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// memory_range_unittest.cc: Unit tests for google_breakpad::MemoryRange.
-
-#include "breakpad_googletest_includes.h"
-#include "common/memory_range.h"
-
-using google_breakpad::MemoryRange;
-using testing::Message;
-
-namespace {
-
-const uint32_t kBuffer[10] = { 0 };
-const size_t kBufferSize = sizeof(kBuffer);
-const uint8_t* kBufferPointer = reinterpret_cast<const uint8_t*>(kBuffer);
-
-// Test vectors for verifying Covers, GetData, and Subrange.
-const struct {
- bool valid;
- size_t offset;
- size_t length;
-} kSubranges[] = {
- { true, 0, 0 },
- { true, 0, 2 },
- { true, 0, kBufferSize },
- { true, 2, 0 },
- { true, 2, 4 },
- { true, 2, kBufferSize - 2 },
- { true, kBufferSize - 1, 1 },
- { false, kBufferSize, 0 },
- { false, kBufferSize, static_cast<size_t>(-1) },
- { false, kBufferSize + 1, 0 },
- { false, static_cast<size_t>(-1), 2 },
- { false, 1, kBufferSize },
- { false, kBufferSize - 1, 2 },
- { false, 0, static_cast<size_t>(-1) },
- { false, 1, static_cast<size_t>(-1) },
-};
-const size_t kNumSubranges = sizeof(kSubranges) / sizeof(kSubranges[0]);
-
-// Test vectors for verifying GetArrayElement.
-const struct {
- size_t offset;
- size_t size;
- size_t index;
- const void* const pointer;
-} kElements[] = {
- // Valid array elemenets
- { 0, 1, 0, kBufferPointer },
- { 0, 1, 1, kBufferPointer + 1 },
- { 0, 1, kBufferSize - 1, kBufferPointer + kBufferSize - 1 },
- { 0, 2, 1, kBufferPointer + 2 },
- { 0, 4, 2, kBufferPointer + 8 },
- { 0, 4, 9, kBufferPointer + 36 },
- { kBufferSize - 1, 1, 0, kBufferPointer + kBufferSize - 1 },
- // Invalid array elemenets
- { 0, 1, kBufferSize, NULL },
- { 0, 4, 10, NULL },
- { kBufferSize - 1, 1, 1, NULL },
- { kBufferSize - 1, 2, 0, NULL },
- { kBufferSize, 1, 0, NULL },
-};
-const size_t kNumElements = sizeof(kElements) / sizeof(kElements[0]);
-
-} // namespace
-
-TEST(MemoryRangeTest, DefaultConstructor) {
- MemoryRange range;
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-}
-
-TEST(MemoryRangeTest, ConstructorWithDataAndLength) {
- MemoryRange range(kBuffer, kBufferSize);
- EXPECT_EQ(kBufferPointer, range.data());
- EXPECT_EQ(kBufferSize, range.length());
-}
-
-TEST(MemoryRangeTest, Reset) {
- MemoryRange range;
- range.Reset();
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-
- range.Set(kBuffer, kBufferSize);
- EXPECT_EQ(kBufferPointer, range.data());
- EXPECT_EQ(kBufferSize, range.length());
-
- range.Reset();
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-}
-
-TEST(MemoryRangeTest, Set) {
- MemoryRange range;
- range.Set(kBuffer, kBufferSize);
- EXPECT_EQ(kBufferPointer, range.data());
- EXPECT_EQ(kBufferSize, range.length());
-
- range.Set(NULL, 0);
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-}
-
-TEST(MemoryRangeTest, SubrangeOfEmptyMemoryRange) {
- MemoryRange range;
- MemoryRange subrange = range.Subrange(0, 10);
- EXPECT_EQ(NULL, subrange.data());
- EXPECT_EQ(0U, subrange.length());
-}
-
-TEST(MemoryRangeTest, SubrangeAndGetData) {
- MemoryRange range(kBuffer, kBufferSize);
- for (size_t i = 0; i < kNumSubranges; ++i) {
- bool valid = kSubranges[i].valid;
- size_t sub_offset = kSubranges[i].offset;
- size_t sub_length = kSubranges[i].length;
- SCOPED_TRACE(Message() << "offset=" << sub_offset
- << ", length=" << sub_length);
-
- MemoryRange subrange = range.Subrange(sub_offset, sub_length);
- if (valid) {
- EXPECT_TRUE(range.Covers(sub_offset, sub_length));
- EXPECT_EQ(kBufferPointer + sub_offset,
- range.GetData(sub_offset, sub_length));
- EXPECT_EQ(kBufferPointer + sub_offset, subrange.data());
- EXPECT_EQ(sub_length, subrange.length());
- } else {
- EXPECT_FALSE(range.Covers(sub_offset, sub_length));
- EXPECT_EQ(NULL, range.GetData(sub_offset, sub_length));
- EXPECT_EQ(NULL, subrange.data());
- EXPECT_EQ(0U, subrange.length());
- }
- }
-}
-
-TEST(MemoryRangeTest, GetDataWithTemplateType) {
- MemoryRange range(kBuffer, kBufferSize);
- const char* char_pointer = range.GetData<char>(0);
- EXPECT_EQ(reinterpret_cast<const char*>(kBufferPointer), char_pointer);
- const int* int_pointer = range.GetData<int>(0);
- EXPECT_EQ(reinterpret_cast<const int*>(kBufferPointer), int_pointer);
-}
-
-TEST(MemoryRangeTest, GetArrayElement) {
- MemoryRange range(kBuffer, kBufferSize);
- for (size_t i = 0; i < kNumElements; ++i) {
- size_t element_offset = kElements[i].offset;
- size_t element_size = kElements[i].size;
- unsigned element_index = kElements[i].index;
- const void* const element_pointer = kElements[i].pointer;
- SCOPED_TRACE(Message() << "offset=" << element_offset
- << ", size=" << element_size
- << ", index=" << element_index);
- EXPECT_EQ(element_pointer, range.GetArrayElement(
- element_offset, element_size, element_index));
- }
-}
-
-TEST(MemoryRangeTest, GetArrayElmentWithTemplateType) {
- MemoryRange range(kBuffer, kBufferSize);
- const char* char_pointer = range.GetArrayElement<char>(0, 0);
- EXPECT_EQ(reinterpret_cast<const char*>(kBufferPointer), char_pointer);
- const int* int_pointer = range.GetArrayElement<int>(0, 0);
- EXPECT_EQ(reinterpret_cast<const int*>(kBufferPointer), int_pointer);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/memory_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/memory_unittest.cc
deleted file mode 100644
index 8d2494c232..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/memory_unittest.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "breakpad_googletest_includes.h"
-#include "common/memory.h"
-
-using namespace google_breakpad;
-
-namespace {
-typedef testing::Test PageAllocatorTest;
-}
-
-TEST(PageAllocatorTest, Setup) {
- PageAllocator allocator;
- EXPECT_EQ(0U, allocator.pages_allocated());
-}
-
-TEST(PageAllocatorTest, SmallObjects) {
- PageAllocator allocator;
-
- EXPECT_EQ(0U, allocator.pages_allocated());
- for (unsigned i = 1; i < 1024; ++i) {
- uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
- ASSERT_FALSE(p == NULL);
- memset(p, 0, i);
- }
-}
-
-TEST(PageAllocatorTest, LargeObject) {
- PageAllocator allocator;
-
- EXPECT_EQ(0U, allocator.pages_allocated());
- uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(10000));
- ASSERT_FALSE(p == NULL);
- EXPECT_EQ(3U, allocator.pages_allocated());
- for (unsigned i = 1; i < 10; ++i) {
- uint8_t *p = reinterpret_cast<uint8_t*>(allocator.Alloc(i));
- ASSERT_FALSE(p == NULL);
- memset(p, 0, i);
- }
-}
-
-namespace {
-typedef testing::Test WastefulVectorTest;
-}
-
-TEST(WastefulVectorTest, Setup) {
- PageAllocator allocator_;
- wasteful_vector<int> v(&allocator_);
- ASSERT_TRUE(v.empty());
- ASSERT_EQ(v.size(), 0u);
-}
-
-TEST(WastefulVectorTest, Simple) {
- PageAllocator allocator_;
- EXPECT_EQ(0U, allocator_.pages_allocated());
- wasteful_vector<unsigned> v(&allocator_);
-
- for (unsigned i = 0; i < 256; ++i) {
- v.push_back(i);
- ASSERT_EQ(i, v.back());
- ASSERT_EQ(&v.back(), &v[i]);
- }
- ASSERT_FALSE(v.empty());
- ASSERT_EQ(v.size(), 256u);
- EXPECT_EQ(1U, allocator_.pages_allocated());
- for (unsigned i = 0; i < 256; ++i)
- ASSERT_EQ(v[i], i);
-}
-
-TEST(WastefulVectorTest, UsesPageAllocator) {
- PageAllocator allocator_;
- wasteful_vector<unsigned> v(&allocator_);
- EXPECT_EQ(1U, allocator_.pages_allocated());
-
- v.push_back(1);
- ASSERT_TRUE(allocator_.OwnsPointer(&v[0]));
-}
-
-TEST(WastefulVectorTest, AutoWastefulVector) {
- PageAllocator allocator_;
- EXPECT_EQ(0U, allocator_.pages_allocated());
-
- auto_wasteful_vector<unsigned, 4> v(&allocator_);
- EXPECT_EQ(0U, allocator_.pages_allocated());
-
- v.push_back(1);
- EXPECT_EQ(0U, allocator_.pages_allocated());
- EXPECT_FALSE(allocator_.OwnsPointer(&v[0]));
-
- v.resize(4);
- EXPECT_EQ(0U, allocator_.pages_allocated());
- EXPECT_FALSE(allocator_.OwnsPointer(&v[0]));
-
- v.resize(10);
- EXPECT_EQ(1U, allocator_.pages_allocated());
- EXPECT_TRUE(allocator_.OwnsPointer(&v[0]));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/minidump_type_helper.h b/toolkit/crashreporter/google-breakpad/src/common/minidump_type_helper.h
deleted file mode 100644
index 5a7d5a6a87..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/minidump_type_helper.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_TYPE_HELPER_H_
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_TYPE_HELPER_H_
-
-#include <stdint.h>
-
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-template <size_t>
-struct MDTypeHelper;
-
-template <>
-struct MDTypeHelper<sizeof(uint32_t)> {
- typedef MDRawDebug32 MDRawDebug;
- typedef MDRawLinkMap32 MDRawLinkMap;
-};
-
-template <>
-struct MDTypeHelper<sizeof(uint64_t)> {
- typedef MDRawDebug64 MDRawDebug;
- typedef MDRawLinkMap64 MDRawLinkMap;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_TYPE_HELPER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/module.cc b/toolkit/crashreporter/google-breakpad/src/common/module.cc
deleted file mode 100644
index e701f1b59f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/module.cc
+++ /dev/null
@@ -1,348 +0,0 @@
-// Copyright (c) 2011 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// module.cc: Implement google_breakpad::Module. See module.h.
-
-#include "common/module.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <iostream>
-#include <utility>
-
-namespace google_breakpad {
-
-using std::dec;
-using std::endl;
-using std::hex;
-
-
-Module::Module(const string &name, const string &os,
- const string &architecture, const string &id,
- const string &code_id /* = "" */) :
- name_(name),
- os_(os),
- architecture_(architecture),
- id_(id),
- code_id_(code_id),
- load_address_(0) { }
-
-Module::~Module() {
- for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it)
- delete it->second;
- for (FunctionSet::iterator it = functions_.begin();
- it != functions_.end(); ++it) {
- delete *it;
- }
- for (StackFrameEntrySet::iterator it = stack_frame_entries_.begin();
- it != stack_frame_entries_.end(); ++it) {
- delete *it;
- }
- for (ExternSet::iterator it = externs_.begin(); it != externs_.end(); ++it)
- delete *it;
-}
-
-void Module::SetLoadAddress(Address address) {
- load_address_ = address;
-}
-
-void Module::AddFunction(Function *function) {
- // FUNC lines must not hold an empty name, so catch the problem early if
- // callers try to add one.
- assert(!function->name.empty());
-
- // FUNCs are better than PUBLICs as they come with sizes, so remove an extern
- // with the same address if present.
- Extern ext(function->address);
- ExternSet::iterator it_ext = externs_.find(&ext);
- if (it_ext == externs_.end() &&
- architecture_ == "arm" &&
- (function->address & 0x1) == 0) {
- // ARM THUMB functions have bit 0 set. ARM64 does not have THUMB.
- Extern arm_thumb_ext(function->address | 0x1);
- it_ext = externs_.find(&arm_thumb_ext);
- }
- if (it_ext != externs_.end()) {
- delete *it_ext;
- externs_.erase(it_ext);
- }
-#if _DEBUG
- {
- // There should be no other PUBLIC symbols that overlap with the function.
- Extern debug_ext(function->address);
- ExternSet::iterator it_debug = externs_.lower_bound(&ext);
- assert(it_debug == externs_.end() ||
- (*it_debug)->address >= function->address + function->size);
- }
-#endif
-
- std::pair<FunctionSet::iterator,bool> ret = functions_.insert(function);
- if (!ret.second && (*ret.first != function)) {
- // Free the duplicate that was not inserted because this Module
- // now owns it.
- delete function;
- }
-}
-
-void Module::AddFunctions(vector<Function *>::iterator begin,
- vector<Function *>::iterator end) {
- for (vector<Function *>::iterator it = begin; it != end; ++it)
- AddFunction(*it);
-}
-
-void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) {
- std::pair<StackFrameEntrySet::iterator,bool> ret =
- stack_frame_entries_.insert(stack_frame_entry);
- if (!ret.second) {
- // Free the duplicate that was not inserted because this Module
- // now owns it.
- delete stack_frame_entry;
- }
-}
-
-void Module::AddExtern(Extern *ext) {
- std::pair<ExternSet::iterator,bool> ret = externs_.insert(ext);
- if (!ret.second) {
- // Free the duplicate that was not inserted because this Module
- // now owns it.
- delete ext;
- }
-}
-
-void Module::GetFunctions(vector<Function *> *vec,
- vector<Function *>::iterator i) {
- vec->insert(i, functions_.begin(), functions_.end());
-}
-
-void Module::GetExterns(vector<Extern *> *vec,
- vector<Extern *>::iterator i) {
- vec->insert(i, externs_.begin(), externs_.end());
-}
-
-Module::File *Module::FindFile(const string &name) {
- // A tricky bit here. The key of each map entry needs to be a
- // pointer to the entry's File's name string. This means that we
- // can't do the initial lookup with any operation that would create
- // an empty entry for us if the name isn't found (like, say,
- // operator[] or insert do), because such a created entry's key will
- // be a pointer the string passed as our argument. Since the key of
- // a map's value type is const, we can't fix it up once we've
- // created our file. lower_bound does the lookup without doing an
- // insertion, and returns a good hint iterator to pass to insert.
- // Our "destiny" is where we belong, whether we're there or not now.
- FileByNameMap::iterator destiny = files_.lower_bound(&name);
- if (destiny == files_.end()
- || *destiny->first != name) { // Repeated string comparison, boo hoo.
- File *file = new File(name);
- file->source_id = -1;
- destiny = files_.insert(destiny,
- FileByNameMap::value_type(&file->name, file));
- }
- return destiny->second;
-}
-
-Module::File *Module::FindFile(const char *name) {
- string name_string = name;
- return FindFile(name_string);
-}
-
-Module::File *Module::FindExistingFile(const string &name) {
- FileByNameMap::iterator it = files_.find(&name);
- return (it == files_.end()) ? NULL : it->second;
-}
-
-void Module::GetFiles(vector<File *> *vec) {
- vec->clear();
- for (FileByNameMap::iterator it = files_.begin(); it != files_.end(); ++it)
- vec->push_back(it->second);
-}
-
-void Module::GetStackFrameEntries(vector<StackFrameEntry*>* vec) const {
- vec->clear();
- vec->insert(vec->begin(), stack_frame_entries_.begin(),
- stack_frame_entries_.end());
-}
-
-Module::StackFrameEntry* Module::FindStackFrameEntryByAddress(Address address) {
- StackFrameEntry search;
- search.address = address;
- StackFrameEntrySet::iterator it = stack_frame_entries_.upper_bound(&search);
-
- if (it == stack_frame_entries_.begin())
- return NULL;
-
- it--;
- if ((*it)->address <= address && address < (*it)->address + (*it)->size)
- return *it;
-
- return NULL;
-}
-
-void Module::AssignSourceIds() {
- // First, give every source file an id of -1.
- for (FileByNameMap::iterator file_it = files_.begin();
- file_it != files_.end(); ++file_it) {
- file_it->second->source_id = -1;
- }
-
- // Next, mark all files actually cited by our functions' line number
- // info, by setting each one's source id to zero.
- for (FunctionSet::const_iterator func_it = functions_.begin();
- func_it != functions_.end(); ++func_it) {
- Function *func = *func_it;
- for (vector<Line>::iterator line_it = func->lines.begin();
- line_it != func->lines.end(); ++line_it)
- line_it->file->source_id = 0;
- }
-
- // Finally, assign source ids to those files that have been marked.
- // We could have just assigned source id numbers while traversing
- // the line numbers, but doing it this way numbers the files in
- // lexicographical order by name, which is neat.
- int next_source_id = 0;
- for (FileByNameMap::iterator file_it = files_.begin();
- file_it != files_.end(); ++file_it) {
- if (!file_it->second->source_id)
- file_it->second->source_id = next_source_id++;
- }
-}
-
-bool Module::ReportError() {
- fprintf(stderr, "error writing symbol file: %s\n",
- strerror(errno));
- return false;
-}
-
-bool Module::WriteRuleMap(const RuleMap &rule_map, std::ostream &stream) {
- for (RuleMap::const_iterator it = rule_map.begin();
- it != rule_map.end(); ++it) {
- if (it != rule_map.begin())
- stream << ' ';
- stream << it->first << ": " << it->second;
- }
- return stream.good();
-}
-
-bool Module::Write(std::ostream &stream, SymbolData symbol_data) {
- stream << "MODULE " << os_ << " " << architecture_ << " "
- << id_ << " " << name_ << endl;
- if (!stream.good())
- return ReportError();
-
- if (!code_id_.empty()) {
- stream << "INFO CODE_ID " << code_id_ << endl;
- }
-
- if (symbol_data != ONLY_CFI) {
- AssignSourceIds();
-
- // Write out files.
- for (FileByNameMap::iterator file_it = files_.begin();
- file_it != files_.end(); ++file_it) {
- File *file = file_it->second;
- if (file->source_id >= 0) {
- stream << "FILE " << file->source_id << " " << file->name << endl;
- if (!stream.good())
- return ReportError();
- }
- }
-
- // Write out functions and their lines.
- for (FunctionSet::const_iterator func_it = functions_.begin();
- func_it != functions_.end(); ++func_it) {
- Function *func = *func_it;
- stream << "FUNC " << hex
- << (func->address - load_address_) << " "
- << func->size << " "
- << func->parameter_size << " "
- << func->name << dec << endl;
- if (!stream.good())
- return ReportError();
-
- for (vector<Line>::iterator line_it = func->lines.begin();
- line_it != func->lines.end(); ++line_it) {
- stream << hex
- << (line_it->address - load_address_) << " "
- << line_it->size << " "
- << dec
- << line_it->number << " "
- << line_it->file->source_id << endl;
- if (!stream.good())
- return ReportError();
- }
- }
-
- // Write out 'PUBLIC' records.
- for (ExternSet::const_iterator extern_it = externs_.begin();
- extern_it != externs_.end(); ++extern_it) {
- Extern *ext = *extern_it;
- stream << "PUBLIC " << hex
- << (ext->address - load_address_) << " 0 "
- << ext->name << dec << endl;
- }
- }
-
- if (symbol_data != NO_CFI) {
- // Write out 'STACK CFI INIT' and 'STACK CFI' records.
- StackFrameEntrySet::const_iterator frame_it;
- for (frame_it = stack_frame_entries_.begin();
- frame_it != stack_frame_entries_.end(); ++frame_it) {
- StackFrameEntry *entry = *frame_it;
- stream << "STACK CFI INIT " << hex
- << (entry->address - load_address_) << " "
- << entry->size << " " << dec;
- if (!stream.good()
- || !WriteRuleMap(entry->initial_rules, stream))
- return ReportError();
-
- stream << endl;
-
- // Write out this entry's delta rules as 'STACK CFI' records.
- for (RuleChangeMap::const_iterator delta_it = entry->rule_changes.begin();
- delta_it != entry->rule_changes.end(); ++delta_it) {
- stream << "STACK CFI " << hex
- << (delta_it->first - load_address_) << " " << dec;
- if (!stream.good()
- || !WriteRuleMap(delta_it->second, stream))
- return ReportError();
-
- stream << endl;
- }
- }
- }
-
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/module.h b/toolkit/crashreporter/google-breakpad/src/common/module.h
deleted file mode 100644
index 305f94579d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/module.h
+++ /dev/null
@@ -1,351 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// module.h: Define google_breakpad::Module. A Module holds debugging
-// information, and can write that information out as a Breakpad
-// symbol file.
-
-#ifndef COMMON_LINUX_MODULE_H__
-#define COMMON_LINUX_MODULE_H__
-
-#include <iostream>
-#include <map>
-#include <set>
-#include <string>
-#include <vector>
-
-#include "common/symbol_data.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-using std::set;
-using std::vector;
-using std::map;
-
-// A Module represents the contents of a module, and supports methods
-// for adding information produced by parsing STABS or DWARF data
-// --- possibly both from the same file --- and then writing out the
-// unified contents as a Breakpad-format symbol file.
-class Module {
- public:
- // The type of addresses and sizes in a symbol table.
- typedef uint64_t Address;
- struct File;
- struct Function;
- struct Line;
- struct Extern;
-
- // Addresses appearing in File, Function, and Line structures are
- // absolute, not relative to the the module's load address. That
- // is, if the module were loaded at its nominal load address, the
- // addresses would be correct.
-
- // A source file.
- struct File {
- explicit File(const string &name_input) : name(name_input), source_id(0) {}
-
- // The name of the source file.
- const string name;
-
- // The file's source id. The Write member function clears this
- // field and assigns source ids a fresh, so any value placed here
- // before calling Write will be lost.
- int source_id;
- };
-
- // A function.
- struct Function {
- Function(const string &name_input, const Address &address_input) :
- name(name_input), address(address_input), size(0), parameter_size(0) {}
-
- // For sorting by address. (Not style-guide compliant, but it's
- // stupid not to put this in the struct.)
- static bool CompareByAddress(const Function *x, const Function *y) {
- return x->address < y->address;
- }
-
- // The function's name.
- const string name;
-
- // The start address and length of the function's code.
- const Address address;
- Address size;
-
- // The function's parameter size.
- Address parameter_size;
-
- // Source lines belonging to this function, sorted by increasing
- // address.
- vector<Line> lines;
- };
-
- // A source line.
- struct Line {
- // For sorting by address. (Not style-guide compliant, but it's
- // stupid not to put this in the struct.)
- static bool CompareByAddress(const Module::Line &x, const Module::Line &y) {
- return x.address < y.address;
- }
-
- Address address, size; // The address and size of the line's code.
- File *file; // The source file.
- int number; // The source line number.
- };
-
- // An exported symbol.
- struct Extern {
- explicit Extern(const Address &address_input) : address(address_input) {}
- const Address address;
- string name;
- };
-
- // A map from register names to postfix expressions that recover
- // their their values. This can represent a complete set of rules to
- // follow at some address, or a set of changes to be applied to an
- // extant set of rules.
- typedef map<string, string> RuleMap;
-
- // A map from addresses to RuleMaps, representing changes that take
- // effect at given addresses.
- typedef map<Address, RuleMap> RuleChangeMap;
-
- // A range of 'STACK CFI' stack walking information. An instance of
- // this structure corresponds to a 'STACK CFI INIT' record and the
- // subsequent 'STACK CFI' records that fall within its range.
- struct StackFrameEntry {
- // The starting address and number of bytes of machine code this
- // entry covers.
- Address address, size;
-
- // The initial register recovery rules, in force at the starting
- // address.
- RuleMap initial_rules;
-
- // A map from addresses to rule changes. To find the rules in
- // force at a given address, start with initial_rules, and then
- // apply the changes given in this map for all addresses up to and
- // including the address you're interested in.
- RuleChangeMap rule_changes;
- };
-
- struct FunctionCompare {
- bool operator() (const Function *lhs,
- const Function *rhs) const {
- if (lhs->address == rhs->address)
- return lhs->name < rhs->name;
- return lhs->address < rhs->address;
- }
- };
-
- struct ExternCompare {
- bool operator() (const Extern *lhs,
- const Extern *rhs) const {
- return lhs->address < rhs->address;
- }
- };
-
- struct StackFrameEntryCompare {
- bool operator() (const StackFrameEntry* lhs,
- const StackFrameEntry* rhs) const {
- return lhs->address < rhs->address;
- }
- };
-
- // Create a new module with the given name, operating system,
- // architecture, and ID string.
- Module(const string &name, const string &os, const string &architecture,
- const string &id, const string &code_id = "");
- ~Module();
-
- // Set the module's load address to LOAD_ADDRESS; addresses given
- // for functions and lines will be written to the Breakpad symbol
- // file as offsets from this address. Construction initializes this
- // module's load address to zero: addresses written to the symbol
- // file will be the same as they appear in the Function, Line, and
- // StackFrameEntry structures.
- //
- // Note that this member function has no effect on addresses stored
- // in the data added to this module; the Write member function
- // simply subtracts off the load address from addresses before it
- // prints them. Only the last load address given before calling
- // Write is used.
- void SetLoadAddress(Address load_address);
-
- // Add FUNCTION to the module. FUNCTION's name must not be empty.
- // This module owns all Function objects added with this function:
- // destroying the module destroys them as well.
- void AddFunction(Function *function);
-
- // Add all the functions in [BEGIN,END) to the module.
- // This module owns all Function objects added with this function:
- // destroying the module destroys them as well.
- void AddFunctions(vector<Function *>::iterator begin,
- vector<Function *>::iterator end);
-
- // Add STACK_FRAME_ENTRY to the module.
- // This module owns all StackFrameEntry objects added with this
- // function: destroying the module destroys them as well.
- void AddStackFrameEntry(StackFrameEntry *stack_frame_entry);
-
- // Add PUBLIC to the module.
- // This module owns all Extern objects added with this function:
- // destroying the module destroys them as well.
- void AddExtern(Extern *ext);
-
- // If this module has a file named NAME, return a pointer to it. If
- // it has none, then create one and return a pointer to the new
- // file. This module owns all File objects created using these
- // functions; destroying the module destroys them as well.
- File *FindFile(const string &name);
- File *FindFile(const char *name);
-
- // If this module has a file named NAME, return a pointer to it.
- // Otherwise, return NULL.
- File *FindExistingFile(const string &name);
-
- // Insert pointers to the functions added to this module at I in
- // VEC. The pointed-to Functions are still owned by this module.
- // (Since this is effectively a copy of the function list, this is
- // mostly useful for testing; other uses should probably get a more
- // appropriate interface.)
- void GetFunctions(vector<Function *> *vec, vector<Function *>::iterator i);
-
- // Insert pointers to the externs added to this module at I in
- // VEC. The pointed-to Externs are still owned by this module.
- // (Since this is effectively a copy of the extern list, this is
- // mostly useful for testing; other uses should probably get a more
- // appropriate interface.)
- void GetExterns(vector<Extern *> *vec, vector<Extern *>::iterator i);
-
- // Clear VEC and fill it with pointers to the Files added to this
- // module, sorted by name. The pointed-to Files are still owned by
- // this module. (Since this is effectively a copy of the file list,
- // this is mostly useful for testing; other uses should probably get
- // a more appropriate interface.)
- void GetFiles(vector<File *> *vec);
-
- // Clear VEC and fill it with pointers to the StackFrameEntry
- // objects that have been added to this module. (Since this is
- // effectively a copy of the stack frame entry list, this is mostly
- // useful for testing; other uses should probably get
- // a more appropriate interface.)
- void GetStackFrameEntries(vector<StackFrameEntry *> *vec) const;
-
- // If this module has a StackFrameEntry whose address range covers
- // ADDRESS, return it. Otherwise return NULL.
- StackFrameEntry* FindStackFrameEntryByAddress(Address address);
-
- // Find those files in this module that are actually referred to by
- // functions' line number data, and assign them source id numbers.
- // Set the source id numbers for all other files --- unused by the
- // source line data --- to -1. We do this before writing out the
- // symbol file, at which point we omit any unused files.
- void AssignSourceIds();
-
- // Call AssignSourceIds, and write this module to STREAM in the
- // breakpad symbol format. Return true if all goes well, or false if
- // an error occurs. This method writes out:
- // - a header based on the values given to the constructor,
- // If symbol_data is not ONLY_CFI then:
- // - the source files added via FindFile,
- // - the functions added via AddFunctions, each with its lines,
- // - all public records,
- // If symbol_data is not NO_CFI then:
- // - all CFI records.
- // Addresses in the output are all relative to the load address
- // established by SetLoadAddress.
- bool Write(std::ostream &stream, SymbolData symbol_data);
-
- string name() const { return name_; }
- string os() const { return os_; }
- string architecture() const { return architecture_; }
- string identifier() const { return id_; }
- string code_identifier() const { return code_id_; }
-
- private:
- // Report an error that has occurred writing the symbol file, using
- // errno to find the appropriate cause. Return false.
- static bool ReportError();
-
- // Write RULE_MAP to STREAM, in the form appropriate for 'STACK CFI'
- // records, without a final newline. Return true if all goes well;
- // if an error occurs, return false, and leave errno set.
- static bool WriteRuleMap(const RuleMap &rule_map, std::ostream &stream);
-
- // Module header entries.
- string name_, os_, architecture_, id_, code_id_;
-
- // The module's nominal load address. Addresses for functions and
- // lines are absolute, assuming the module is loaded at this
- // address.
- Address load_address_;
-
- // Relation for maps whose keys are strings shared with some other
- // structure.
- struct CompareStringPtrs {
- bool operator()(const string *x, const string *y) const { return *x < *y; }
- };
-
- // A map from filenames to File structures. The map's keys are
- // pointers to the Files' names.
- typedef map<const string *, File *, CompareStringPtrs> FileByNameMap;
-
- // A set containing Function structures, sorted by address.
- typedef set<Function *, FunctionCompare> FunctionSet;
-
- // A set containing Extern structures, sorted by address.
- typedef set<Extern *, ExternCompare> ExternSet;
-
- // A set containing StackFrameEntry structures, sorted by address.
- typedef set<StackFrameEntry*, StackFrameEntryCompare> StackFrameEntrySet;
-
- // The module owns all the files and functions that have been added
- // to it; destroying the module frees the Files and Functions these
- // point to.
- FileByNameMap files_; // This module's source files.
- FunctionSet functions_; // This module's functions.
-
- // The module owns all the call frame info entries that have been
- // added to it.
- StackFrameEntrySet stack_frame_entries_;
-
- // The module owns all the externs that have been added to it;
- // destroying the module frees the Externs these point to.
- ExternSet externs_;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_LINUX_MODULE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc
deleted file mode 100644
index 3789f9ec5e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/module_unittest.cc
+++ /dev/null
@@ -1,616 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// module_unittest.cc: Unit tests for google_breakpad::Module.
-
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <algorithm>
-#include <sstream>
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/module.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::Module;
-using std::stringstream;
-using std::vector;
-using testing::ContainerEq;
-
-static Module::Function *generate_duplicate_function(const string &name) {
- const Module::Address DUP_ADDRESS = 0xd35402aac7a7ad5cLL;
- const Module::Address DUP_SIZE = 0x200b26e605f99071LL;
- const Module::Address DUP_PARAMETER_SIZE = 0xf14ac4fed48c4a99LL;
-
- Module::Function *function = new Module::Function(name, DUP_ADDRESS);
- function->size = DUP_SIZE;
- function->parameter_size = DUP_PARAMETER_SIZE;
- return function;
-}
-
-#define MODULE_NAME "name with spaces"
-#define MODULE_OS "os-name"
-#define MODULE_ARCH "architecture"
-#define MODULE_ID "id-string"
-#define MODULE_CODE_ID "code-id-string"
-
-TEST(Write, Header) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n",
- contents.c_str());
-}
-
-TEST(Write, HeaderCodeId) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID, MODULE_CODE_ID);
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "INFO CODE_ID code-id-string\n",
- contents.c_str());
-}
-
-TEST(Write, OneLineFunc) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- Module::File *file = m.FindFile("file_name.cc");
- Module::Function *function = new Module::Function(
- "function_name", 0xe165bf8023b9d9abLL);
- function->size = 0x1e4bb0eb1cbf5b09LL;
- function->parameter_size = 0x772beee89114358aLL;
- Module::Line line = { 0xe165bf8023b9d9abLL, 0x1e4bb0eb1cbf5b09LL,
- file, 67519080 };
- function->lines.push_back(line);
- m.AddFunction(function);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FILE 0 file_name.cc\n"
- "FUNC e165bf8023b9d9ab 1e4bb0eb1cbf5b09 772beee89114358a"
- " function_name\n"
- "e165bf8023b9d9ab 1e4bb0eb1cbf5b09 67519080 0\n",
- contents.c_str());
-}
-
-TEST(Write, RelativeLoadAddress) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Some source files. We will expect to see them in lexicographic order.
- Module::File *file1 = m.FindFile("filename-b.cc");
- Module::File *file2 = m.FindFile("filename-a.cc");
-
- // A function.
- Module::Function *function = new Module::Function(
- "A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)", 0xbec774ea5dd935f3LL);
- function->size = 0x2922088f98d3f6fcLL;
- function->parameter_size = 0xe5e9aa008bd5f0d0LL;
-
- // Some source lines. The module should not sort these.
- Module::Line line1 = { 0xbec774ea5dd935f3LL, 0x1c2be6d6c5af2611LL,
- file1, 41676901 };
- Module::Line line2 = { 0xdaf35bc123885c04LL, 0xcf621b8d324d0ebLL,
- file2, 67519080 };
- function->lines.push_back(line2);
- function->lines.push_back(line1);
-
- m.AddFunction(function);
-
- // Some stack information.
- Module::StackFrameEntry *entry = new Module::StackFrameEntry();
- entry->address = 0x30f9e5c83323973dULL;
- entry->size = 0x49fc9ca7c7c13dc2ULL;
- entry->initial_rules[".cfa"] = "he was a handsome man";
- entry->initial_rules["and"] = "what i want to know is";
- entry->rule_changes[0x30f9e5c83323973eULL]["how"] =
- "do you like your blueeyed boy";
- entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death";
- m.AddStackFrameEntry(entry);
-
- // Set the load address. Doing this after adding all the data to
- // the module must work fine.
- m.SetLoadAddress(0x2ab698b0b6407073LL);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FILE 0 filename-a.cc\n"
- "FILE 1 filename-b.cc\n"
- "FUNC 9410dc39a798c580 2922088f98d3f6fc e5e9aa008bd5f0d0"
- " A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)\n"
- "b03cc3106d47eb91 cf621b8d324d0eb 67519080 0\n"
- "9410dc39a798c580 1c2be6d6c5af2611 41676901 1\n"
- "STACK CFI INIT 6434d177ce326ca 49fc9ca7c7c13dc2"
- " .cfa: he was a handsome man"
- " and: what i want to know is\n"
- "STACK CFI 6434d177ce326cb"
- " Mister: Death"
- " how: do you like your blueeyed boy\n",
- contents.c_str());
-}
-
-TEST(Write, OmitUnusedFiles) {
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Create some source files.
- Module::File *file1 = m.FindFile("filename1");
- m.FindFile("filename2"); // not used by any line
- Module::File *file3 = m.FindFile("filename3");
-
- // Create a function.
- Module::Function *function = new Module::Function(
- "function_name", 0x9b926d464f0b9384LL);
- function->size = 0x4f524a4ba795e6a6LL;
- function->parameter_size = 0xbbe8133a6641c9b7LL;
-
- // Source files that refer to some files, but not others.
- Module::Line line1 = { 0x595fa44ebacc1086LL, 0x1e1e0191b066c5b3LL,
- file1, 137850127 };
- Module::Line line2 = { 0x401ce8c8a12d25e3LL, 0x895751c41b8d2ce2LL,
- file3, 28113549 };
- function->lines.push_back(line1);
- function->lines.push_back(line2);
- m.AddFunction(function);
-
- m.AssignSourceIds();
-
- vector<Module::File *> vec;
- m.GetFiles(&vec);
- EXPECT_EQ((size_t) 3, vec.size());
- EXPECT_STREQ("filename1", vec[0]->name.c_str());
- EXPECT_NE(-1, vec[0]->source_id);
- // Expect filename2 not to be used.
- EXPECT_STREQ("filename2", vec[1]->name.c_str());
- EXPECT_EQ(-1, vec[1]->source_id);
- EXPECT_STREQ("filename3", vec[2]->name.c_str());
- EXPECT_NE(-1, vec[2]->source_id);
-
- stringstream s;
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FILE 0 filename1\n"
- "FILE 1 filename3\n"
- "FUNC 9b926d464f0b9384 4f524a4ba795e6a6 bbe8133a6641c9b7"
- " function_name\n"
- "595fa44ebacc1086 1e1e0191b066c5b3 137850127 0\n"
- "401ce8c8a12d25e3 895751c41b8d2ce2 28113549 1\n",
- contents.c_str());
-}
-
-TEST(Write, NoCFI) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Some source files. We will expect to see them in lexicographic order.
- Module::File *file1 = m.FindFile("filename.cc");
-
- // A function.
- Module::Function *function = new Module::Function(
- "A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)", 0xbec774ea5dd935f3LL);
- function->size = 0x2922088f98d3f6fcLL;
- function->parameter_size = 0xe5e9aa008bd5f0d0LL;
-
- // Some source lines. The module should not sort these.
- Module::Line line1 = { 0xbec774ea5dd935f3LL, 0x1c2be6d6c5af2611LL,
- file1, 41676901 };
- function->lines.push_back(line1);
-
- m.AddFunction(function);
-
- // Some stack information.
- Module::StackFrameEntry *entry = new Module::StackFrameEntry();
- entry->address = 0x30f9e5c83323973dULL;
- entry->size = 0x49fc9ca7c7c13dc2ULL;
- entry->initial_rules[".cfa"] = "he was a handsome man";
- entry->initial_rules["and"] = "what i want to know is";
- entry->rule_changes[0x30f9e5c83323973eULL]["how"] =
- "do you like your blueeyed boy";
- entry->rule_changes[0x30f9e5c83323973eULL]["Mister"] = "Death";
- m.AddStackFrameEntry(entry);
-
- // Set the load address. Doing this after adding all the data to
- // the module must work fine.
- m.SetLoadAddress(0x2ab698b0b6407073LL);
-
- m.Write(s, NO_CFI);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FILE 0 filename.cc\n"
- "FUNC 9410dc39a798c580 2922088f98d3f6fc e5e9aa008bd5f0d0"
- " A_FLIBBERTIJIBBET::a_will_o_the_wisp(a clown)\n"
- "9410dc39a798c580 1c2be6d6c5af2611 41676901 0\n",
- contents.c_str());
-}
-
-TEST(Construct, AddFunctions) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Two functions.
- Module::Function *function1 = new Module::Function(
- "_without_form", 0xd35024aa7ca7da5cLL);
- function1->size = 0x200b26e605f99071LL;
- function1->parameter_size = 0xf14ac4fed48c4a99LL;
-
- Module::Function *function2 = new Module::Function(
- "_and_void", 0x2987743d0b35b13fLL);
- function2->size = 0xb369db048deb3010LL;
- function2->parameter_size = 0x938e556cb5a79988LL;
-
- // Put them in a vector.
- vector<Module::Function *> vec;
- vec.push_back(function1);
- vec.push_back(function2);
-
- m.AddFunctions(vec.begin(), vec.end());
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FUNC 2987743d0b35b13f b369db048deb3010 938e556cb5a79988"
- " _and_void\n"
- "FUNC d35024aa7ca7da5c 200b26e605f99071 f14ac4fed48c4a99"
- " _without_form\n",
- contents.c_str());
-
- // Check that m.GetFunctions returns the functions we expect.
- vec.clear();
- m.GetFunctions(&vec, vec.end());
- EXPECT_TRUE(vec.end() != find(vec.begin(), vec.end(), function1));
- EXPECT_TRUE(vec.end() != find(vec.begin(), vec.end(), function2));
- EXPECT_EQ((size_t) 2, vec.size());
-}
-
-TEST(Construct, AddFrames) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // First STACK CFI entry, with no initial rules or deltas.
- Module::StackFrameEntry *entry1 = new Module::StackFrameEntry();
- entry1->address = 0xddb5f41285aa7757ULL;
- entry1->size = 0x1486493370dc5073ULL;
- m.AddStackFrameEntry(entry1);
-
- // Second STACK CFI entry, with initial rules but no deltas.
- Module::StackFrameEntry *entry2 = new Module::StackFrameEntry();
- entry2->address = 0x8064f3af5e067e38ULL;
- entry2->size = 0x0de2a5ee55509407ULL;
- entry2->initial_rules[".cfa"] = "I think that I shall never see";
- entry2->initial_rules["stromboli"] = "a poem lovely as a tree";
- entry2->initial_rules["cannoli"] = "a tree whose hungry mouth is prest";
- m.AddStackFrameEntry(entry2);
-
- // Third STACK CFI entry, with initial rules and deltas.
- Module::StackFrameEntry *entry3 = new Module::StackFrameEntry();
- entry3->address = 0x5e8d0db0a7075c6cULL;
- entry3->size = 0x1c7edb12a7aea229ULL;
- entry3->initial_rules[".cfa"] = "Whose woods are these";
- entry3->rule_changes[0x47ceb0f63c269d7fULL]["calzone"] =
- "the village though";
- entry3->rule_changes[0x47ceb0f63c269d7fULL]["cannoli"] =
- "he will not see me stopping here";
- entry3->rule_changes[0x36682fad3763ffffULL]["stromboli"] =
- "his house is in";
- entry3->rule_changes[0x36682fad3763ffffULL][".cfa"] =
- "I think I know";
- m.AddStackFrameEntry(entry3);
-
- // Check that Write writes STACK CFI records properly.
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "STACK CFI INIT 5e8d0db0a7075c6c 1c7edb12a7aea229"
- " .cfa: Whose woods are these\n"
- "STACK CFI 36682fad3763ffff"
- " .cfa: I think I know"
- " stromboli: his house is in\n"
- "STACK CFI 47ceb0f63c269d7f"
- " calzone: the village though"
- " cannoli: he will not see me stopping here\n"
- "STACK CFI INIT 8064f3af5e067e38 de2a5ee55509407"
- " .cfa: I think that I shall never see"
- " cannoli: a tree whose hungry mouth is prest"
- " stromboli: a poem lovely as a tree\n"
- "STACK CFI INIT ddb5f41285aa7757 1486493370dc5073 \n",
- contents.c_str());
-
- // Check that GetStackFrameEntries works.
- vector<Module::StackFrameEntry *> entries;
- m.GetStackFrameEntries(&entries);
- ASSERT_EQ(3U, entries.size());
- // Check first entry.
- EXPECT_EQ(0x5e8d0db0a7075c6cULL, entries[0]->address);
- EXPECT_EQ(0x1c7edb12a7aea229ULL, entries[0]->size);
- Module::RuleMap entry1_initial;
- entry1_initial[".cfa"] = "Whose woods are these";
- EXPECT_THAT(entries[0]->initial_rules, ContainerEq(entry1_initial));
- Module::RuleChangeMap entry1_changes;
- entry1_changes[0x36682fad3763ffffULL][".cfa"] = "I think I know";
- entry1_changes[0x36682fad3763ffffULL]["stromboli"] = "his house is in";
- entry1_changes[0x47ceb0f63c269d7fULL]["calzone"] = "the village though";
- entry1_changes[0x47ceb0f63c269d7fULL]["cannoli"] =
- "he will not see me stopping here";
- EXPECT_THAT(entries[0]->rule_changes, ContainerEq(entry1_changes));
- // Check second entry.
- EXPECT_EQ(0x8064f3af5e067e38ULL, entries[1]->address);
- EXPECT_EQ(0x0de2a5ee55509407ULL, entries[1]->size);
- ASSERT_EQ(3U, entries[1]->initial_rules.size());
- Module::RuleMap entry2_initial;
- entry2_initial[".cfa"] = "I think that I shall never see";
- entry2_initial["stromboli"] = "a poem lovely as a tree";
- entry2_initial["cannoli"] = "a tree whose hungry mouth is prest";
- EXPECT_THAT(entries[1]->initial_rules, ContainerEq(entry2_initial));
- ASSERT_EQ(0U, entries[1]->rule_changes.size());
- // Check third entry.
- EXPECT_EQ(0xddb5f41285aa7757ULL, entries[2]->address);
- EXPECT_EQ(0x1486493370dc5073ULL, entries[2]->size);
- ASSERT_EQ(0U, entries[2]->initial_rules.size());
- ASSERT_EQ(0U, entries[2]->rule_changes.size());
-}
-
-TEST(Construct, UniqueFiles) {
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
- Module::File *file1 = m.FindFile("foo");
- Module::File *file2 = m.FindFile(string("bar"));
- Module::File *file3 = m.FindFile(string("foo"));
- Module::File *file4 = m.FindFile("bar");
- EXPECT_NE(file1, file2);
- EXPECT_EQ(file1, file3);
- EXPECT_EQ(file2, file4);
- EXPECT_EQ(file1, m.FindExistingFile("foo"));
- EXPECT_TRUE(m.FindExistingFile("baz") == NULL);
-}
-
-TEST(Construct, DuplicateFunctions) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Two functions.
- Module::Function *function1 = generate_duplicate_function("_without_form");
- Module::Function *function2 = generate_duplicate_function("_without_form");
-
- m.AddFunction(function1);
- m.AddFunction(function2);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FUNC d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99"
- " _without_form\n",
- contents.c_str());
-}
-
-TEST(Construct, FunctionsWithSameAddress) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Two functions.
- Module::Function *function1 = generate_duplicate_function("_without_form");
- Module::Function *function2 = generate_duplicate_function("_and_void");
-
- m.AddFunction(function1);
- m.AddFunction(function2);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
- EXPECT_STREQ("MODULE os-name architecture id-string name with spaces\n"
- "FUNC d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99"
- " _and_void\n"
- "FUNC d35402aac7a7ad5c 200b26e605f99071 f14ac4fed48c4a99"
- " _without_form\n",
- contents.c_str());
-}
-
-// Externs should be written out as PUBLIC records, sorted by
-// address.
-TEST(Construct, Externs) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Two externs.
- Module::Extern *extern1 = new Module::Extern(0xffff);
- extern1->name = "_abc";
- Module::Extern *extern2 = new Module::Extern(0xaaaa);
- extern2->name = "_xyz";
-
- m.AddExtern(extern1);
- m.AddExtern(extern2);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
-
- EXPECT_STREQ("MODULE " MODULE_OS " " MODULE_ARCH " "
- MODULE_ID " " MODULE_NAME "\n"
- "PUBLIC aaaa 0 _xyz\n"
- "PUBLIC ffff 0 _abc\n",
- contents.c_str());
-}
-
-// Externs with the same address should only keep the first entry
-// added.
-TEST(Construct, DuplicateExterns) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Two externs.
- Module::Extern *extern1 = new Module::Extern(0xffff);
- extern1->name = "_xyz";
- Module::Extern *extern2 = new Module::Extern(0xffff);
- extern2->name = "_abc";
-
- m.AddExtern(extern1);
- m.AddExtern(extern2);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
-
- EXPECT_STREQ("MODULE " MODULE_OS " " MODULE_ARCH " "
- MODULE_ID " " MODULE_NAME "\n"
- "PUBLIC ffff 0 _xyz\n",
- contents.c_str());
-}
-
-// If there exists an extern and a function at the same address, only write
-// out the FUNC entry.
-TEST(Construct, FunctionsAndExternsWithSameAddress) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // Two externs.
- Module::Extern* extern1 = new Module::Extern(0xabc0);
- extern1->name = "abc";
- Module::Extern* extern2 = new Module::Extern(0xfff0);
- extern2->name = "xyz";
-
- m.AddExtern(extern1);
- m.AddExtern(extern2);
-
- Module::Function* function = new Module::Function("_xyz", 0xfff0);
- function->size = 0x10;
- function->parameter_size = 0;
- m.AddFunction(function);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
-
- EXPECT_STREQ("MODULE " MODULE_OS " " MODULE_ARCH " "
- MODULE_ID " " MODULE_NAME "\n"
- "FUNC fff0 10 0 _xyz\n"
- "PUBLIC abc0 0 abc\n",
- contents.c_str());
-}
-
-// If there exists an extern and a function at the same address, only write
-// out the FUNC entry. For ARM THUMB, the extern that comes from the ELF
-// symbol section has bit 0 set.
-TEST(Construct, FunctionsAndThumbExternsWithSameAddress) {
- stringstream s;
- Module m(MODULE_NAME, MODULE_OS, "arm", MODULE_ID);
-
- // Two THUMB externs.
- Module::Extern* thumb_extern1 = new Module::Extern(0xabc1);
- thumb_extern1->name = "thumb_abc";
- Module::Extern* thumb_extern2 = new Module::Extern(0xfff1);
- thumb_extern2->name = "thumb_xyz";
-
- Module::Extern* arm_extern1 = new Module::Extern(0xcc00);
- arm_extern1->name = "arm_func";
-
- m.AddExtern(thumb_extern1);
- m.AddExtern(thumb_extern2);
- m.AddExtern(arm_extern1);
-
- // The corresponding function from the DWARF debug data have the actual
- // address.
- Module::Function* function = new Module::Function("_thumb_xyz", 0xfff0);
- function->size = 0x10;
- function->parameter_size = 0;
- m.AddFunction(function);
-
- m.Write(s, ALL_SYMBOL_DATA);
- string contents = s.str();
-
- EXPECT_STREQ("MODULE " MODULE_OS " arm "
- MODULE_ID " " MODULE_NAME "\n"
- "FUNC fff0 10 0 _thumb_xyz\n"
- "PUBLIC abc1 0 thumb_abc\n"
- "PUBLIC cc00 0 arm_func\n",
- contents.c_str());
-}
-
-TEST(Lookup, StackFrameEntries) {
- Module m(MODULE_NAME, MODULE_OS, MODULE_ARCH, MODULE_ID);
-
- // First STACK CFI entry, with no initial rules or deltas.
- Module::StackFrameEntry *entry1 = new Module::StackFrameEntry();
- entry1->address = 0x2000;
- entry1->size = 0x900;
- m.AddStackFrameEntry(entry1);
-
- // Second STACK CFI entry, with initial rules but no deltas.
- Module::StackFrameEntry *entry2 = new Module::StackFrameEntry();
- entry2->address = 0x3000;
- entry2->size = 0x900;
- entry2->initial_rules[".cfa"] = "I think that I shall never see";
- entry2->initial_rules["stromboli"] = "a poem lovely as a tree";
- entry2->initial_rules["cannoli"] = "a tree whose hungry mouth is prest";
- m.AddStackFrameEntry(entry2);
-
- // Third STACK CFI entry, with initial rules and deltas.
- Module::StackFrameEntry *entry3 = new Module::StackFrameEntry();
- entry3->address = 0x1000;
- entry3->size = 0x900;
- entry3->initial_rules[".cfa"] = "Whose woods are these";
- entry3->rule_changes[0x47ceb0f63c269d7fULL]["calzone"] =
- "the village though";
- entry3->rule_changes[0x47ceb0f63c269d7fULL]["cannoli"] =
- "he will not see me stopping here";
- entry3->rule_changes[0x36682fad3763ffffULL]["stromboli"] =
- "his house is in";
- entry3->rule_changes[0x36682fad3763ffffULL][".cfa"] =
- "I think I know";
- m.AddStackFrameEntry(entry3);
-
- Module::StackFrameEntry* s = m.FindStackFrameEntryByAddress(0x1000);
- EXPECT_EQ(entry3, s);
- s = m.FindStackFrameEntryByAddress(0x18FF);
- EXPECT_EQ(entry3, s);
-
- s = m.FindStackFrameEntryByAddress(0x1900);
- EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
- s = m.FindStackFrameEntryByAddress(0x1A00);
- EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
-
- s = m.FindStackFrameEntryByAddress(0x2000);
- EXPECT_EQ(entry1, s);
- s = m.FindStackFrameEntryByAddress(0x28FF);
- EXPECT_EQ(entry1, s);
-
- s = m.FindStackFrameEntryByAddress(0x3000);
- EXPECT_EQ(entry2, s);
- s = m.FindStackFrameEntryByAddress(0x38FF);
- EXPECT_EQ(entry2, s);
-
- s = m.FindStackFrameEntryByAddress(0x3900);
- EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
- s = m.FindStackFrameEntryByAddress(0x3A00);
- EXPECT_EQ((Module::StackFrameEntry*)NULL, s);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/moz.build b/toolkit/crashreporter/google-breakpad/src/common/moz.build
deleted file mode 100644
index 7bb6e9b6d6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/moz.build
+++ /dev/null
@@ -1,72 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if CONFIG['OS_ARCH'] in ('Darwin', 'Linux'):
- DIRS += ['dwarf']
-
-UNIFIED_SOURCES += [
- 'convert_UTF.c',
- 'string_conversion.cc',
-]
-
-if CONFIG['OS_ARCH'] != 'WINNT':
- UNIFIED_SOURCES += [
- 'md5.cc',
- ]
-
-if CONFIG['OS_ARCH'] == 'Linux':
- HOST_DEFINES['HAVE_A_OUT_H'] = True
-elif CONFIG['OS_ARCH'] == 'Darwin':
- HOST_DEFINES['HAVE_MACH_O_NLIST_H'] = True
- HOST_SOURCES += [
- 'stabs_reader.cc',
- 'stabs_to_module.cc',
- ]
- if CONFIG['HOST_OS_ARCH'] != 'Darwin':
- HOST_CXXFLAGS += [
- '-I%s/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/' % TOPSRCDIR,
- ]
-
-if CONFIG['OS_ARCH'] != 'WINNT':
- HOST_SOURCES += [
- 'arm_ex_reader.cc',
- 'arm_ex_to_module.cc',
- 'convert_UTF.c',
- 'dwarf_cfi_to_module.cc',
- 'dwarf_cu_to_module.cc',
- 'dwarf_line_to_module.cc',
- 'language.cc',
- 'md5.cc',
- 'module.cc',
- 'string_conversion.cc',
- ]
- if CONFIG['OS_ARCH'] == 'Darwin':
- HOST_CXXFLAGS += [
- '-stdlib=libc++',
- ]
- HOST_CXXFLAGS += [
- '-O2',
- '-g',
- ]
- HostLibrary('host_breakpad_common_s')
-
-if CONFIG['OS_TARGET'] == 'Android':
- # We don't support unifying assembly files.
- SOURCES += [
- 'android/breakpad_getcontext.S',
- ]
- LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src/common/android/include',
- ]
-
-Library('breakpad_common_s')
-
-# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
-
-FINAL_LIBRARY = 'xul'
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/common/scoped_ptr.h b/toolkit/crashreporter/google-breakpad/src/common/scoped_ptr.h
deleted file mode 100644
index d137c18681..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/scoped_ptr.h
+++ /dev/null
@@ -1,404 +0,0 @@
-// Copyright 2013 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Scopers help you manage ownership of a pointer, helping you easily manage the
-// a pointer within a scope, and automatically destroying the pointer at the
-// end of a scope. There are two main classes you will use, which correspond
-// to the operators new/delete and new[]/delete[].
-//
-// Example usage (scoped_ptr):
-// {
-// scoped_ptr<Foo> foo(new Foo("wee"));
-// } // foo goes out of scope, releasing the pointer with it.
-//
-// {
-// scoped_ptr<Foo> foo; // No pointer managed.
-// foo.reset(new Foo("wee")); // Now a pointer is managed.
-// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed.
-// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed.
-// foo->Method(); // Foo::Method() called.
-// foo.get()->Method(); // Foo::Method() called.
-// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer
-// // manages a pointer.
-// foo.reset(new Foo("wee4")); // foo manages a pointer again.
-// foo.reset(); // Foo("wee4") destroyed, foo no longer
-// // manages a pointer.
-// } // foo wasn't managing a pointer, so nothing was destroyed.
-//
-// Example usage (scoped_array):
-// {
-// scoped_array<Foo> foo(new Foo[100]);
-// foo.get()->Method(); // Foo::Method on the 0th element.
-// foo[10].Method(); // Foo::Method on the 10th element.
-// }
-
-#ifndef COMMON_SCOPED_PTR_H_
-#define COMMON_SCOPED_PTR_H_
-
-// This is an implementation designed to match the anticipated future TR2
-// implementation of the scoped_ptr class, and its closely-related brethren,
-// scoped_array, scoped_ptr_malloc.
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdlib.h>
-
-namespace google_breakpad {
-
-// A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T>
-// automatically deletes the pointer it holds (if any).
-// That is, scoped_ptr<T> owns the T object that it points to.
-// Like a T*, a scoped_ptr<T> may hold either NULL or a pointer to a T object.
-// Also like T*, scoped_ptr<T> is thread-compatible, and once you
-// dereference it, you get the threadsafety guarantees of T.
-//
-// The size of a scoped_ptr is small:
-// sizeof(scoped_ptr<C>) == sizeof(C*)
-template <class C>
-class scoped_ptr {
- public:
-
- // The element type
- typedef C element_type;
-
- // Constructor. Defaults to initializing with NULL.
- // There is no way to create an uninitialized scoped_ptr.
- // The input parameter must be allocated with new.
- explicit scoped_ptr(C* p = NULL) : ptr_(p) { }
-
- // Destructor. If there is a C object, delete it.
- // We don't need to test ptr_ == NULL because C++ does that for us.
- ~scoped_ptr() {
- enum { type_must_be_complete = sizeof(C) };
- delete ptr_;
- }
-
- // Reset. Deletes the current owned object, if any.
- // Then takes ownership of a new object, if given.
- // this->reset(this->get()) works.
- void reset(C* p = NULL) {
- if (p != ptr_) {
- enum { type_must_be_complete = sizeof(C) };
- delete ptr_;
- ptr_ = p;
- }
- }
-
- // Accessors to get the owned object.
- // operator* and operator-> will assert() if there is no current object.
- C& operator*() const {
- assert(ptr_ != NULL);
- return *ptr_;
- }
- C* operator->() const {
- assert(ptr_ != NULL);
- return ptr_;
- }
- C* get() const { return ptr_; }
-
- // Comparison operators.
- // These return whether two scoped_ptr refer to the same object, not just to
- // two different but equal objects.
- bool operator==(C* p) const { return ptr_ == p; }
- bool operator!=(C* p) const { return ptr_ != p; }
-
- // Swap two scoped pointers.
- void swap(scoped_ptr& p2) {
- C* tmp = ptr_;
- ptr_ = p2.ptr_;
- p2.ptr_ = tmp;
- }
-
- // Release a pointer.
- // The return value is the current pointer held by this object.
- // If this object holds a NULL pointer, the return value is NULL.
- // After this operation, this object will hold a NULL pointer,
- // and will not own the object any more.
- C* release() {
- C* retVal = ptr_;
- ptr_ = NULL;
- return retVal;
- }
-
- private:
- C* ptr_;
-
- // Forbid comparison of scoped_ptr types. If C2 != C, it totally doesn't
- // make sense, and if C2 == C, it still doesn't make sense because you should
- // never have the same object owned by two different scoped_ptrs.
- template <class C2> bool operator==(scoped_ptr<C2> const& p2) const;
- template <class C2> bool operator!=(scoped_ptr<C2> const& p2) const;
-
- // Disallow evil constructors
- scoped_ptr(const scoped_ptr&);
- void operator=(const scoped_ptr&);
-};
-
-// Free functions
-template <class C>
-void swap(scoped_ptr<C>& p1, scoped_ptr<C>& p2) {
- p1.swap(p2);
-}
-
-template <class C>
-bool operator==(C* p1, const scoped_ptr<C>& p2) {
- return p1 == p2.get();
-}
-
-template <class C>
-bool operator!=(C* p1, const scoped_ptr<C>& p2) {
- return p1 != p2.get();
-}
-
-// scoped_array<C> is like scoped_ptr<C>, except that the caller must allocate
-// with new [] and the destructor deletes objects with delete [].
-//
-// As with scoped_ptr<C>, a scoped_array<C> either points to an object
-// or is NULL. A scoped_array<C> owns the object that it points to.
-// scoped_array<T> is thread-compatible, and once you index into it,
-// the returned objects have only the threadsafety guarantees of T.
-//
-// Size: sizeof(scoped_array<C>) == sizeof(C*)
-template <class C>
-class scoped_array {
- public:
-
- // The element type
- typedef C element_type;
-
- // Constructor. Defaults to intializing with NULL.
- // There is no way to create an uninitialized scoped_array.
- // The input parameter must be allocated with new [].
- explicit scoped_array(C* p = NULL) : array_(p) { }
-
- // Destructor. If there is a C object, delete it.
- // We don't need to test ptr_ == NULL because C++ does that for us.
- ~scoped_array() {
- enum { type_must_be_complete = sizeof(C) };
- delete[] array_;
- }
-
- // Reset. Deletes the current owned object, if any.
- // Then takes ownership of a new object, if given.
- // this->reset(this->get()) works.
- void reset(C* p = NULL) {
- if (p != array_) {
- enum { type_must_be_complete = sizeof(C) };
- delete[] array_;
- array_ = p;
- }
- }
-
- // Get one element of the current object.
- // Will assert() if there is no current object, or index i is negative.
- C& operator[](ptrdiff_t i) const {
- assert(i >= 0);
- assert(array_ != NULL);
- return array_[i];
- }
-
- // Get a pointer to the zeroth element of the current object.
- // If there is no current object, return NULL.
- C* get() const {
- return array_;
- }
-
- // Comparison operators.
- // These return whether two scoped_array refer to the same object, not just to
- // two different but equal objects.
- bool operator==(C* p) const { return array_ == p; }
- bool operator!=(C* p) const { return array_ != p; }
-
- // Swap two scoped arrays.
- void swap(scoped_array& p2) {
- C* tmp = array_;
- array_ = p2.array_;
- p2.array_ = tmp;
- }
-
- // Release an array.
- // The return value is the current pointer held by this object.
- // If this object holds a NULL pointer, the return value is NULL.
- // After this operation, this object will hold a NULL pointer,
- // and will not own the object any more.
- C* release() {
- C* retVal = array_;
- array_ = NULL;
- return retVal;
- }
-
- private:
- C* array_;
-
- // Forbid comparison of different scoped_array types.
- template <class C2> bool operator==(scoped_array<C2> const& p2) const;
- template <class C2> bool operator!=(scoped_array<C2> const& p2) const;
-
- // Disallow evil constructors
- scoped_array(const scoped_array&);
- void operator=(const scoped_array&);
-};
-
-// Free functions
-template <class C>
-void swap(scoped_array<C>& p1, scoped_array<C>& p2) {
- p1.swap(p2);
-}
-
-template <class C>
-bool operator==(C* p1, const scoped_array<C>& p2) {
- return p1 == p2.get();
-}
-
-template <class C>
-bool operator!=(C* p1, const scoped_array<C>& p2) {
- return p1 != p2.get();
-}
-
-// This class wraps the c library function free() in a class that can be
-// passed as a template argument to scoped_ptr_malloc below.
-class ScopedPtrMallocFree {
- public:
- inline void operator()(void* x) const {
- free(x);
- }
-};
-
-// scoped_ptr_malloc<> is similar to scoped_ptr<>, but it accepts a
-// second template argument, the functor used to free the object.
-
-template<class C, class FreeProc = ScopedPtrMallocFree>
-class scoped_ptr_malloc {
- public:
-
- // The element type
- typedef C element_type;
-
- // Constructor. Defaults to initializing with NULL.
- // There is no way to create an uninitialized scoped_ptr.
- // The input parameter must be allocated with an allocator that matches the
- // Free functor. For the default Free functor, this is malloc, calloc, or
- // realloc.
- explicit scoped_ptr_malloc(C* p = NULL): ptr_(p) {}
-
- // Destructor. If there is a C object, call the Free functor.
- ~scoped_ptr_malloc() {
- reset();
- }
-
- // Reset. Calls the Free functor on the current owned object, if any.
- // Then takes ownership of a new object, if given.
- // this->reset(this->get()) works.
- void reset(C* p = NULL) {
- if (ptr_ != p) {
- FreeProc free_proc;
- free_proc(ptr_);
- ptr_ = p;
- }
- }
-
- // Get the current object.
- // operator* and operator-> will cause an assert() failure if there is
- // no current object.
- C& operator*() const {
- assert(ptr_ != NULL);
- return *ptr_;
- }
-
- C* operator->() const {
- assert(ptr_ != NULL);
- return ptr_;
- }
-
- C* get() const {
- return ptr_;
- }
-
- // Comparison operators.
- // These return whether a scoped_ptr_malloc and a plain pointer refer
- // to the same object, not just to two different but equal objects.
- // For compatibility with the boost-derived implementation, these
- // take non-const arguments.
- bool operator==(C* p) const {
- return ptr_ == p;
- }
-
- bool operator!=(C* p) const {
- return ptr_ != p;
- }
-
- // Swap two scoped pointers.
- void swap(scoped_ptr_malloc & b) {
- C* tmp = b.ptr_;
- b.ptr_ = ptr_;
- ptr_ = tmp;
- }
-
- // Release a pointer.
- // The return value is the current pointer held by this object.
- // If this object holds a NULL pointer, the return value is NULL.
- // After this operation, this object will hold a NULL pointer,
- // and will not own the object any more.
- C* release() {
- C* tmp = ptr_;
- ptr_ = NULL;
- return tmp;
- }
-
- private:
- C* ptr_;
-
- // no reason to use these: each scoped_ptr_malloc should have its own object
- template <class C2, class GP>
- bool operator==(scoped_ptr_malloc<C2, GP> const& p) const;
- template <class C2, class GP>
- bool operator!=(scoped_ptr_malloc<C2, GP> const& p) const;
-
- // Disallow evil constructors
- scoped_ptr_malloc(const scoped_ptr_malloc&);
- void operator=(const scoped_ptr_malloc&);
-};
-
-template<class C, class FP> inline
-void swap(scoped_ptr_malloc<C, FP>& a, scoped_ptr_malloc<C, FP>& b) {
- a.swap(b);
-}
-
-template<class C, class FP> inline
-bool operator==(C* p, const scoped_ptr_malloc<C, FP>& b) {
- return p == b.get();
-}
-
-template<class C, class FP> inline
-bool operator!=(C* p, const scoped_ptr_malloc<C, FP>& b) {
- return p != b.get();
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_SCOPED_PTR_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.cc b/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.cc
deleted file mode 100644
index e0a74ceeb4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/simple_string_dictionary.h"
-
-namespace google_breakpad {
-
-namespace {
-
-// In C++98 (ISO 14882), section 9.5.1 says that a union cannot have a member
-// with a non-trivial ctor, copy ctor, dtor, or assignment operator. Use this
-// property to ensure that Entry remains POD.
-union Compile_Assert {
- NonAllocatingMap<1, 1, 1>::Entry Compile_Assert__entry_must_be_pod;
-};
-
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.h b/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.h
deleted file mode 100644
index d2ab17fda5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary.h
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_SIMPLE_STRING_DICTIONARY_H_
-#define COMMON_SIMPLE_STRING_DICTIONARY_H_
-
-#include <assert.h>
-#include <string.h>
-
-#include "common/basictypes.h"
-
-namespace google_breakpad {
-
-// Opaque type for the serialized representation of a NonAllocatingMap. One is
-// created in NonAllocatingMap::Serialize and can be deserialized using one of
-// the constructors.
-struct SerializedNonAllocatingMap;
-
-// NonAllocatingMap is an implementation of a map/dictionary collection that
-// uses a fixed amount of storage, so that it does not perform any dynamic
-// allocations for its operations.
-//
-// The actual map storage (the Entry) is guaranteed to be POD, so that it can
-// be transmitted over various IPC mechanisms.
-//
-// The template parameters control the amount of storage used for the key,
-// value, and map. The KeySize and ValueSize are measured in bytes, not glyphs,
-// and includes space for a \0 byte. This gives space for KeySize-1 and
-// ValueSize-1 characters in an entry. NumEntries is the total number of
-// entries that will fit in the map.
-template <size_t KeySize, size_t ValueSize, size_t NumEntries>
-class NonAllocatingMap {
- public:
- // Constant and publicly accessible versions of the template parameters.
- static const size_t key_size = KeySize;
- static const size_t value_size = ValueSize;
- static const size_t num_entries = NumEntries;
-
- // An Entry object is a single entry in the map. If the key is a 0-length
- // NUL-terminated string, the entry is empty.
- struct Entry {
- char key[KeySize];
- char value[ValueSize];
-
- bool is_active() const {
- return key[0] != '\0';
- }
- };
-
- // An Iterator can be used to iterate over all the active entries in a
- // NonAllocatingMap.
- class Iterator {
- public:
- explicit Iterator(const NonAllocatingMap& map)
- : map_(map),
- current_(0) {
- }
-
- // Returns the next entry in the map, or NULL if at the end of the
- // collection.
- const Entry* Next() {
- while (current_ < map_.num_entries) {
- const Entry* entry = &map_.entries_[current_++];
- if (entry->is_active()) {
- return entry;
- }
- }
- return NULL;
- }
-
- private:
- const NonAllocatingMap& map_;
- size_t current_;
-
- DISALLOW_COPY_AND_ASSIGN(Iterator);
- };
-
- NonAllocatingMap() : entries_() {
- }
-
- NonAllocatingMap(const NonAllocatingMap& other) {
- *this = other;
- }
-
- NonAllocatingMap& operator=(const NonAllocatingMap& other) {
- assert(other.key_size == key_size);
- assert(other.value_size == value_size);
- assert(other.num_entries == num_entries);
- if (other.key_size == key_size && other.value_size == value_size &&
- other.num_entries == num_entries) {
- memcpy(entries_, other.entries_, sizeof(entries_));
- }
- return *this;
- }
-
- // Constructs a map from its serialized form. |map| should be the out
- // parameter from Serialize() and |size| should be its return value.
- NonAllocatingMap(const SerializedNonAllocatingMap* map, size_t size) {
- assert(size == sizeof(entries_));
- if (size == sizeof(entries_)) {
- memcpy(entries_, map, size);
- }
- }
-
- // Returns the number of active key/value pairs. The upper limit for this
- // is NumEntries.
- size_t GetCount() const {
- size_t count = 0;
- for (size_t i = 0; i < num_entries; ++i) {
- if (entries_[i].is_active()) {
- ++count;
- }
- }
- return count;
- }
-
- // Given |key|, returns its corresponding |value|. |key| must not be NULL. If
- // the key is not found, NULL is returned.
- const char* GetValueForKey(const char* key) const {
- assert(key);
- if (!key)
- return NULL;
-
- const Entry* entry = GetConstEntryForKey(key);
- if (!entry)
- return NULL;
-
- return entry->value;
- }
-
- // Stores |value| into |key|, replacing the existing value if |key| is
- // already present. |key| must not be NULL. If |value| is NULL, the key is
- // removed from the map. If there is no more space in the map, then the
- // operation silently fails.
- void SetKeyValue(const char* key, const char* value) {
- if (!value) {
- RemoveKey(key);
- return;
- }
-
- assert(key);
- if (!key)
- return;
-
- // Key must not be an empty string.
- assert(key[0] != '\0');
- if (key[0] == '\0')
- return;
-
- Entry* entry = GetEntryForKey(key);
-
- // If it does not yet exist, attempt to insert it.
- if (!entry) {
- for (size_t i = 0; i < num_entries; ++i) {
- if (!entries_[i].is_active()) {
- entry = &entries_[i];
-
- strncpy(entry->key, key, key_size);
- entry->key[key_size - 1] = '\0';
-
- break;
- }
- }
- }
-
- // If the map is out of space, entry will be NULL.
- if (!entry)
- return;
-
-#ifndef NDEBUG
- // Sanity check that the key only appears once.
- int count = 0;
- for (size_t i = 0; i < num_entries; ++i) {
- if (strncmp(entries_[i].key, key, key_size) == 0)
- ++count;
- }
- assert(count == 1);
-#endif
-
- strncpy(entry->value, value, value_size);
- entry->value[value_size - 1] = '\0';
- }
-
- // Given |key|, removes any associated value. |key| must not be NULL. If
- // the key is not found, this is a noop.
- void RemoveKey(const char* key) {
- assert(key);
- if (!key)
- return;
-
- Entry* entry = GetEntryForKey(key);
- if (entry) {
- entry->key[0] = '\0';
- entry->value[0] = '\0';
- }
-
-#ifndef NDEBUG
- assert(GetEntryForKey(key) == NULL);
-#endif
- }
-
- // Places a serialized version of the map into |map| and returns the size.
- // Both of these should be passed to the deserializing constructor. Note that
- // the serialized |map| is scoped to the lifetime of the non-serialized
- // instance of this class. The |map| can be copied across IPC boundaries.
- size_t Serialize(const SerializedNonAllocatingMap** map) const {
- *map = reinterpret_cast<const SerializedNonAllocatingMap*>(entries_);
- return sizeof(entries_);
- }
-
- private:
- const Entry* GetConstEntryForKey(const char* key) const {
- for (size_t i = 0; i < num_entries; ++i) {
- if (strncmp(key, entries_[i].key, key_size) == 0) {
- return &entries_[i];
- }
- }
- return NULL;
- }
-
- Entry* GetEntryForKey(const char* key) {
- return const_cast<Entry*>(GetConstEntryForKey(key));
- }
-
- Entry entries_[NumEntries];
-};
-
-// For historical reasons this specialized version is available with the same
-// size factors as a previous implementation.
-typedef NonAllocatingMap<256, 256, 64> SimpleStringDictionary;
-
-} // namespace google_breakpad
-
-#endif // COMMON_SIMPLE_STRING_DICTIONARY_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary_unittest.cc
deleted file mode 100644
index 34f4b9ef5d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/simple_string_dictionary_unittest.cc
+++ /dev/null
@@ -1,308 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "breakpad_googletest_includes.h"
-#include "common/simple_string_dictionary.h"
-
-namespace google_breakpad {
-
-TEST(NonAllocatingMapTest, Entry) {
- typedef NonAllocatingMap<5, 9, 15> TestMap;
- TestMap map;
-
- const TestMap::Entry* entry = TestMap::Iterator(map).Next();
- EXPECT_FALSE(entry);
-
- // Try setting a key/value and then verify.
- map.SetKeyValue("key1", "value1");
- entry = TestMap::Iterator(map).Next();
- ASSERT_TRUE(entry);
- EXPECT_STREQ(entry->key, "key1");
- EXPECT_STREQ(entry->value, "value1");
-
- // Try setting a new value.
- map.SetKeyValue("key1", "value3");
- EXPECT_STREQ(entry->value, "value3");
-
- // Make sure the key didn't change.
- EXPECT_STREQ(entry->key, "key1");
-
- // Clear the entry and verify the key and value are empty strings.
- map.RemoveKey("key1");
- EXPECT_FALSE(entry->is_active());
- EXPECT_EQ(strlen(entry->key), 0u);
- EXPECT_EQ(strlen(entry->value), 0u);
-}
-
-TEST(NonAllocatingMapTest, SimpleStringDictionary) {
- // Make a new dictionary
- SimpleStringDictionary dict;
-
- // Set three distinct values on three keys
- dict.SetKeyValue("key1", "value1");
- dict.SetKeyValue("key2", "value2");
- dict.SetKeyValue("key3", "value3");
-
- EXPECT_NE(dict.GetValueForKey("key1"), "value1");
- EXPECT_NE(dict.GetValueForKey("key2"), "value2");
- EXPECT_NE(dict.GetValueForKey("key3"), "value3");
- EXPECT_EQ(dict.GetCount(), 3u);
- // try an unknown key
- EXPECT_FALSE(dict.GetValueForKey("key4"));
-
- // Remove a key
- dict.RemoveKey("key3");
-
- // Now make sure it's not there anymore
- EXPECT_FALSE(dict.GetValueForKey("key3"));
-
- // Remove by setting value to NULL
- dict.SetKeyValue("key2", NULL);
-
- // Now make sure it's not there anymore
- EXPECT_FALSE(dict.GetValueForKey("key2"));
-}
-
-TEST(NonAllocatingMapTest, CopyAndAssign) {
- NonAllocatingMap<10, 10, 10> map;
- map.SetKeyValue("one", "a");
- map.SetKeyValue("two", "b");
- map.SetKeyValue("three", "c");
- map.RemoveKey("two");
- EXPECT_EQ(2u, map.GetCount());
-
- // Test copy.
- NonAllocatingMap<10, 10, 10> map_copy(map);
- EXPECT_EQ(2u, map_copy.GetCount());
- EXPECT_STREQ("a", map_copy.GetValueForKey("one"));
- EXPECT_STREQ("c", map_copy.GetValueForKey("three"));
- map_copy.SetKeyValue("four", "d");
- EXPECT_STREQ("d", map_copy.GetValueForKey("four"));
- EXPECT_FALSE(map.GetValueForKey("four"));
-
- // Test assign.
- NonAllocatingMap<10, 10, 10> map_assign;
- map_assign = map;
- EXPECT_EQ(2u, map_assign.GetCount());
- EXPECT_STREQ("a", map_assign.GetValueForKey("one"));
- EXPECT_STREQ("c", map_assign.GetValueForKey("three"));
- map_assign.SetKeyValue("four", "d");
- EXPECT_STREQ("d", map_assign.GetValueForKey("four"));
- EXPECT_FALSE(map.GetValueForKey("four"));
-
- map.RemoveKey("one");
- EXPECT_FALSE(map.GetValueForKey("one"));
- EXPECT_STREQ("a", map_copy.GetValueForKey("one"));
- EXPECT_STREQ("a", map_assign.GetValueForKey("one"));
-}
-
-// Add a bunch of values to the dictionary, remove some entries in the middle,
-// and then add more.
-TEST(NonAllocatingMapTest, Iterator) {
- SimpleStringDictionary* dict = new SimpleStringDictionary();
- ASSERT_TRUE(dict);
-
- char key[SimpleStringDictionary::key_size];
- char value[SimpleStringDictionary::value_size];
-
- const int kDictionaryCapacity = SimpleStringDictionary::num_entries;
- const int kPartitionIndex = kDictionaryCapacity - 5;
-
- // We assume at least this size in the tests below
- ASSERT_GE(kDictionaryCapacity, 64);
-
- // We'll keep track of the number of key/value pairs we think should
- // be in the dictionary
- int expectedDictionarySize = 0;
-
- // Set a bunch of key/value pairs like key0/value0, key1/value1, ...
- for (int i = 0; i < kPartitionIndex; ++i) {
- sprintf(key, "key%d", i);
- sprintf(value, "value%d", i);
- dict->SetKeyValue(key, value);
- }
- expectedDictionarySize = kPartitionIndex;
-
- // set a couple of the keys twice (with the same value) - should be nop
- dict->SetKeyValue("key2", "value2");
- dict->SetKeyValue("key4", "value4");
- dict->SetKeyValue("key15", "value15");
-
- // Remove some random elements in the middle
- dict->RemoveKey("key7");
- dict->RemoveKey("key18");
- dict->RemoveKey("key23");
- dict->RemoveKey("key31");
- expectedDictionarySize -= 4; // we just removed four key/value pairs
-
- // Set some more key/value pairs like key59/value59, key60/value60, ...
- for (int i = kPartitionIndex; i < kDictionaryCapacity; ++i) {
- sprintf(key, "key%d", i);
- sprintf(value, "value%d", i);
- dict->SetKeyValue(key, value);
- }
- expectedDictionarySize += kDictionaryCapacity - kPartitionIndex;
-
- // Now create an iterator on the dictionary
- SimpleStringDictionary::Iterator iter(*dict);
-
- // We then verify that it iterates through exactly the number of
- // key/value pairs we expect, and that they match one-for-one with what we
- // would expect. The ordering of the iteration does not matter...
-
- // used to keep track of number of occurrences found for key/value pairs
- int count[kDictionaryCapacity];
- memset(count, 0, sizeof(count));
-
- int totalCount = 0;
-
- const SimpleStringDictionary::Entry* entry;
- while ((entry = iter.Next())) {
- totalCount++;
-
- // Extract keyNumber from a string of the form key<keyNumber>
- int keyNumber;
- sscanf(entry->key, "key%d", &keyNumber);
-
- // Extract valueNumber from a string of the form value<valueNumber>
- int valueNumber;
- sscanf(entry->value, "value%d", &valueNumber);
-
- // The value number should equal the key number since that's how we set them
- EXPECT_EQ(keyNumber, valueNumber);
-
- // Key and value numbers should be in proper range:
- // 0 <= keyNumber < kDictionaryCapacity
- bool isKeyInGoodRange =
- (keyNumber >= 0 && keyNumber < kDictionaryCapacity);
- bool isValueInGoodRange =
- (valueNumber >= 0 && valueNumber < kDictionaryCapacity);
- EXPECT_TRUE(isKeyInGoodRange);
- EXPECT_TRUE(isValueInGoodRange);
-
- if (isKeyInGoodRange && isValueInGoodRange) {
- ++count[keyNumber];
- }
- }
-
- // Make sure each of the key/value pairs showed up exactly one time, except
- // for the ones which we removed.
- for (size_t i = 0; i < kDictionaryCapacity; ++i) {
- // Skip over key7, key18, key23, and key31, since we removed them
- if (!(i == 7 || i == 18 || i == 23 || i == 31)) {
- EXPECT_EQ(count[i], 1);
- }
- }
-
- // Make sure the number of iterations matches the expected dictionary size.
- EXPECT_EQ(totalCount, expectedDictionarySize);
-}
-
-
-TEST(NonAllocatingMapTest, AddRemove) {
- NonAllocatingMap<5, 7, 6> map;
- map.SetKeyValue("rob", "ert");
- map.SetKeyValue("mike", "pink");
- map.SetKeyValue("mark", "allays");
-
- EXPECT_EQ(3u, map.GetCount());
- EXPECT_STREQ("ert", map.GetValueForKey("rob"));
- EXPECT_STREQ("pink", map.GetValueForKey("mike"));
- EXPECT_STREQ("allays", map.GetValueForKey("mark"));
-
- map.RemoveKey("mike");
-
- EXPECT_EQ(2u, map.GetCount());
- EXPECT_FALSE(map.GetValueForKey("mike"));
-
- map.SetKeyValue("mark", "mal");
- EXPECT_EQ(2u, map.GetCount());
- EXPECT_STREQ("mal", map.GetValueForKey("mark"));
-
- map.RemoveKey("mark");
- EXPECT_EQ(1u, map.GetCount());
- EXPECT_FALSE(map.GetValueForKey("mark"));
-}
-
-TEST(NonAllocatingMapTest, Serialize) {
- typedef NonAllocatingMap<4, 5, 7> TestMap;
- TestMap map;
- map.SetKeyValue("one", "abc");
- map.SetKeyValue("two", "def");
- map.SetKeyValue("tre", "hig");
-
- EXPECT_STREQ("abc", map.GetValueForKey("one"));
- EXPECT_STREQ("def", map.GetValueForKey("two"));
- EXPECT_STREQ("hig", map.GetValueForKey("tre"));
-
- const SerializedNonAllocatingMap* serialized;
- size_t size = map.Serialize(&serialized);
-
- SerializedNonAllocatingMap* serialized_copy =
- reinterpret_cast<SerializedNonAllocatingMap*>(malloc(size));
- ASSERT_TRUE(serialized_copy);
- memcpy(serialized_copy, serialized, size);
-
- TestMap deserialized(serialized_copy, size);
- free(serialized_copy);
-
- EXPECT_EQ(3u, deserialized.GetCount());
- EXPECT_STREQ("abc", deserialized.GetValueForKey("one"));
- EXPECT_STREQ("def", deserialized.GetValueForKey("two"));
- EXPECT_STREQ("hig", deserialized.GetValueForKey("tre"));
-}
-
-// Running out of space shouldn't crash.
-TEST(NonAllocatingMapTest, OutOfSpace) {
- NonAllocatingMap<3, 2, 2> map;
- map.SetKeyValue("a", "1");
- map.SetKeyValue("b", "2");
- map.SetKeyValue("c", "3");
- EXPECT_EQ(2u, map.GetCount());
- EXPECT_FALSE(map.GetValueForKey("c"));
-}
-
-#ifndef NDEBUG
-
-TEST(NonAllocatingMapTest, NullKey) {
- NonAllocatingMap<4, 6, 6> map;
- ASSERT_DEATH(map.SetKeyValue(NULL, "hello"), "");
-
- map.SetKeyValue("hi", "there");
- ASSERT_DEATH(map.GetValueForKey(NULL), "");
- EXPECT_STREQ("there", map.GetValueForKey("hi"));
-
- ASSERT_DEATH(map.GetValueForKey(NULL), "");
- map.RemoveKey("hi");
- EXPECT_EQ(0u, map.GetCount());
-}
-
-#endif // !NDEBUG
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.cc b/toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.cc
deleted file mode 100644
index 168d0b2879..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.cc
+++ /dev/null
@@ -1,681 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <demangle.h>
-#include <fcntl.h>
-#include <gelf.h>
-#include <link.h>
-#include <sys/mman.h>
-#include <stab.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <functional>
-#include <map>
-#include <vector>
-
-#include "common/scoped_ptr.h"
-#include "common/solaris/dump_symbols.h"
-#include "common/solaris/file_id.h"
-#include "common/solaris/guid_creator.h"
-
-// This namespace contains helper functions.
-namespace {
-
-using std::make_pair;
-
-#if defined(_LP64)
-typedef Elf64_Sym Elf_Sym;
-#else
-typedef Elf32_Sym Elf_Sym;
-#endif
-
-// Symbol table entry from stabs. Sun CC specific.
-struct slist {
- // String table index.
- unsigned int n_strx;
- // Stab type.
- unsigned char n_type;
- char n_other;
- short n_desc;
- unsigned long n_value;
-};
-
-// Symbol table entry
-struct SymbolEntry {
- // Offset from the start of the file.
- GElf_Addr offset;
- // Function size.
- GElf_Word size;
-};
-
-// Infomation of a line.
-struct LineInfo {
- // Offset from start of the function.
- // Load from stab symbol.
- GElf_Off rva_to_func;
- // Offset from base of the loading binary.
- GElf_Off rva_to_base;
- // Size of the line.
- // The first line: equals to rva_to_func.
- // The other lines: the difference of rva_to_func of the line and
- // rva_to_func of the previous N_SLINE.
- uint32_t size;
- // Line number.
- uint32_t line_num;
-};
-
-// Information of a function.
-struct FuncInfo {
- // Name of the function.
- const char *name;
- // Offset from the base of the loading address.
- GElf_Off rva_to_base;
- // Virtual address of the function.
- // Load from stab symbol.
- GElf_Addr addr;
- // Size of the function.
- // Equal to rva_to_func of the last function line.
- uint32_t size;
- // Total size of stack parameters.
- uint32_t stack_param_size;
- // Line information array.
- std::vector<struct LineInfo> line_info;
-};
-
-// Information of a source file.
-struct SourceFileInfo {
- // Name of the source file.
- const char *name;
- // Starting address of the source file.
- GElf_Addr addr;
- // Id of the source file.
- int source_id;
- // Functions information.
- std::vector<struct FuncInfo> func_info;
-};
-
-struct CompareString {
- bool operator()(const char *s1, const char *s2) const {
- return strcmp(s1, s2) < 0;
- }
-};
-
-typedef std::map<const char *, struct SymbolEntry *, CompareString> SymbolMap;
-
-// Information of a symbol table.
-// This is the root of all types of symbol.
-struct SymbolInfo {
- std::vector<struct SourceFileInfo> source_file_info;
- // Symbols information.
- SymbolMap symbol_entries;
-};
-
-// Stab section name.
-const char *kStabName = ".stab";
-
-// Stab str section name.
-const char *kStabStrName = ".stabstr";
-
-// Symtab section name.
-const char *kSymtabName = ".symtab";
-
-// Strtab section name.
-const char *kStrtabName = ".strtab";
-
-// Default buffer lenght for demangle.
-const int demangleLen = 20000;
-
-// Offset to the string table.
-uint64_t stringOffset = 0;
-
-// Update the offset to the start of the string index of the next
-// object module for every N_ENDM stabs.
-inline void RecalculateOffset(struct slist* cur_list, char *stabstr) {
- while ((--cur_list)->n_strx == 0) ;
- stringOffset += cur_list->n_strx;
-
- char *temp = stabstr + stringOffset;
- while (*temp != '\0') {
- ++stringOffset;
- ++temp;
- }
- // Skip the extra '\0'
- ++stringOffset;
-}
-
-// Demangle using demangle library on Solaris.
-std::string Demangle(const char *mangled) {
- int status = 0;
- std::string str(mangled);
- char *demangled = (char *)malloc(demangleLen);
-
- if (!demangled) {
- fprintf(stderr, "no enough memory.\n");
- goto out;
- }
-
- if ((status = cplus_demangle(mangled, demangled, demangleLen)) ==
- DEMANGLE_ESPACE) {
- fprintf(stderr, "incorrect demangle.\n");
- goto out;
- }
-
- str = demangled;
- free(demangled);
-
-out:
- return str;
-}
-
-bool WriteFormat(int fd, const char *fmt, ...) {
- va_list list;
- char buffer[4096];
- ssize_t expected, written;
- va_start(list, fmt);
- vsnprintf(buffer, sizeof(buffer), fmt, list);
- expected = strlen(buffer);
- written = write(fd, buffer, strlen(buffer));
- va_end(list);
- return expected == written;
-}
-
-bool IsValidElf(const GElf_Ehdr *elf_header) {
- return memcmp(elf_header, ELFMAG, SELFMAG) == 0;
-}
-
-static bool FindSectionByName(Elf *elf, const char *name,
- int shstrndx,
- GElf_Shdr *shdr) {
- assert(name != NULL);
-
- if (strlen(name) == 0)
- return false;
-
- Elf_Scn *scn = NULL;
-
- while ((scn = elf_nextscn(elf, scn)) != NULL) {
- if (gelf_getshdr(scn, shdr) == (GElf_Shdr *)0) {
- fprintf(stderr, "failed to read section header: %s\n", elf_errmsg(0));
- return false;
- }
-
- const char *section_name = elf_strptr(elf, shstrndx, shdr->sh_name);
- if (!section_name) {
- fprintf(stderr, "Section name error: %s\n", elf_errmsg(-1));
- continue;
- }
-
- if (strcmp(section_name, name) == 0)
- return true;
- }
-
- return false;
-}
-
-// The parameter size is used for FPO-optimized code, and
-// this is all tied up with the debugging data for Windows x86.
-// Set it to 0 on Solaris.
-int LoadStackParamSize(struct slist *list,
- struct slist *list_end,
- struct FuncInfo *func_info) {
- struct slist *cur_list = list;
- int step = 1;
- while (cur_list < list_end && cur_list->n_type == N_PSYM) {
- ++cur_list;
- ++step;
- }
-
- func_info->stack_param_size = 0;
- return step;
-}
-
-int LoadLineInfo(struct slist *list,
- struct slist *list_end,
- struct FuncInfo *func_info) {
- struct slist *cur_list = list;
- do {
- // Skip non line information.
- while (cur_list < list_end && cur_list->n_type != N_SLINE) {
- // Only exit when got another function, or source file, or end stab.
- if (cur_list->n_type == N_FUN || cur_list->n_type == N_SO ||
- cur_list->n_type == N_ENDM) {
- return cur_list - list;
- }
- ++cur_list;
- }
- struct LineInfo line;
- while (cur_list < list_end && cur_list->n_type == N_SLINE) {
- line.rva_to_func = cur_list->n_value;
- // n_desc is a signed short
- line.line_num = (unsigned short)cur_list->n_desc;
- func_info->line_info.push_back(line);
- ++cur_list;
- }
- if (cur_list == list_end && cur_list->n_type == N_ENDM)
- break;
- } while (list < list_end);
-
- return cur_list - list;
-}
-
-int LoadFuncSymbols(struct slist *list,
- struct slist *list_end,
- char *stabstr,
- GElf_Word base,
- struct SourceFileInfo *source_file_info) {
- struct slist *cur_list = list;
- assert(cur_list->n_type == N_SO);
- ++cur_list;
-
- source_file_info->func_info.clear();
- while (cur_list < list_end) {
- // Go until the function symbol.
- while (cur_list < list_end && cur_list->n_type != N_FUN) {
- if (cur_list->n_type == N_SO) {
- return cur_list - list;
- }
- ++cur_list;
- if (cur_list->n_type == N_ENDM)
- RecalculateOffset(cur_list, stabstr);
- continue;
- }
- while (cur_list->n_type == N_FUN) {
- struct FuncInfo func_info;
- memset(&func_info, 0, sizeof(func_info));
- func_info.name = stabstr + cur_list->n_strx + stringOffset;
- // The n_value field is always 0 from stab generated by Sun CC.
- // TODO(Alfred): Find the correct value.
- func_info.addr = cur_list->n_value;
- ++cur_list;
- if (cur_list->n_type == N_ENDM)
- RecalculateOffset(cur_list, stabstr);
- if (cur_list->n_type != N_ESYM && cur_list->n_type != N_ISYM &&
- cur_list->n_type != N_FUN) {
- // Stack parameter size.
- cur_list += LoadStackParamSize(cur_list, list_end, &func_info);
- // Line info.
- cur_list += LoadLineInfo(cur_list, list_end, &func_info);
- }
- if (cur_list < list_end && cur_list->n_type == N_ENDM)
- RecalculateOffset(cur_list, stabstr);
- // Functions in this module should have address bigger than the module
- // starting address.
- //
- // These two values are always 0 with Sun CC.
- // TODO(Alfred): Get the correct value or remove the condition statement.
- if (func_info.addr >= source_file_info->addr) {
- source_file_info->func_info.push_back(func_info);
- }
- }
- }
- return cur_list - list;
-}
-
-// Compute size and rva information based on symbols loaded from stab section.
-bool ComputeSizeAndRVA(struct SymbolInfo *symbols) {
- std::vector<struct SourceFileInfo> *sorted_files =
- &(symbols->source_file_info);
- SymbolMap *symbol_entries = &(symbols->symbol_entries);
- for (size_t i = 0; i < sorted_files->size(); ++i) {
- struct SourceFileInfo &source_file = (*sorted_files)[i];
- std::vector<struct FuncInfo> *sorted_functions = &(source_file.func_info);
- int func_size = sorted_functions->size();
-
- for (size_t j = 0; j < func_size; ++j) {
- struct FuncInfo &func_info = (*sorted_functions)[j];
- int line_count = func_info.line_info.size();
-
- // Discard the ending part of the name.
- std::string func_name(func_info.name);
- std::string::size_type last_colon = func_name.find_first_of(':');
- if (last_colon != std::string::npos)
- func_name = func_name.substr(0, last_colon);
-
- // Fine the symbol offset from the loading address and size by name.
- SymbolMap::const_iterator it = symbol_entries->find(func_name.c_str());
- if (it->second) {
- func_info.rva_to_base = it->second->offset;
- func_info.size = (line_count == 0) ? 0 : it->second->size;
- } else {
- func_info.rva_to_base = 0;
- func_info.size = 0;
- }
-
- // Compute function and line size.
- for (size_t k = 0; k < line_count; ++k) {
- struct LineInfo &line_info = func_info.line_info[k];
-
- line_info.rva_to_base = line_info.rva_to_func + func_info.rva_to_base;
- if (k == line_count - 1) {
- line_info.size = func_info.size - line_info.rva_to_func;
- } else {
- struct LineInfo &next_line = func_info.line_info[k + 1];
- line_info.size = next_line.rva_to_func - line_info.rva_to_func;
- }
- } // for each line.
- } // for each function.
- } // for each source file.
- for (SymbolMap::iterator it = symbol_entries->begin();
- it != symbol_entries->end(); ++it) {
- free(it->second);
- }
- return true;
-}
-
-bool LoadAllSymbols(const GElf_Shdr *stab_section,
- const GElf_Shdr *stabstr_section,
- GElf_Word base,
- struct SymbolInfo *symbols) {
- if (stab_section == NULL || stabstr_section == NULL)
- return false;
-
- char *stabstr =
- reinterpret_cast<char *>(stabstr_section->sh_offset + base);
- struct slist *lists =
- reinterpret_cast<struct slist *>(stab_section->sh_offset + base);
- int nstab = stab_section->sh_size / sizeof(struct slist);
- int source_id = 0;
-
- // First pass, load all symbols from the object file.
- for (int i = 0; i < nstab; ) {
- int step = 1;
- struct slist *cur_list = lists + i;
- if (cur_list->n_type == N_SO) {
- // FUNC <address> <size> <param_stack_size> <function>
- struct SourceFileInfo source_file_info;
- source_file_info.name = stabstr + cur_list->n_strx + stringOffset;
- // The n_value field is always 0 from stab generated by Sun CC.
- // TODO(Alfred): Find the correct value.
- source_file_info.addr = cur_list->n_value;
- if (strchr(source_file_info.name, '.'))
- source_file_info.source_id = source_id++;
- else
- source_file_info.source_id = -1;
- step = LoadFuncSymbols(cur_list, lists + nstab - 1, stabstr,
- base, &source_file_info);
- symbols->source_file_info.push_back(source_file_info);
- }
- i += step;
- }
- // Second pass, compute the size of functions and lines.
- return ComputeSizeAndRVA(symbols);
-}
-
-bool LoadSymbols(Elf *elf, GElf_Ehdr *elf_header, struct SymbolInfo *symbols,
- void *obj_base) {
- GElf_Word base = reinterpret_cast<GElf_Word>(obj_base);
-
- const GElf_Shdr *sections =
- reinterpret_cast<GElf_Shdr *>(elf_header->e_shoff + base);
- GElf_Shdr stab_section;
- if (!FindSectionByName(elf, kStabName, elf_header->e_shstrndx,
- &stab_section)) {
- fprintf(stderr, "Stab section not found.\n");
- return false;
- }
- GElf_Shdr stabstr_section;
- if (!FindSectionByName(elf, kStabStrName, elf_header->e_shstrndx,
- &stabstr_section)) {
- fprintf(stderr, "Stabstr section not found.\n");
- return false;
- }
- GElf_Shdr symtab_section;
- if (!FindSectionByName(elf, kSymtabName, elf_header->e_shstrndx,
- &symtab_section)) {
- fprintf(stderr, "Symtab section not found.\n");
- return false;
- }
- GElf_Shdr strtab_section;
- if (!FindSectionByName(elf, kStrtabName, elf_header->e_shstrndx,
- &strtab_section)) {
- fprintf(stderr, "Strtab section not found.\n");
- return false;
- }
-
- Elf_Sym *symbol = (Elf_Sym *)((char *)base + symtab_section.sh_offset);
- for (int i = 0; i < symtab_section.sh_size/symtab_section.sh_entsize; ++i) {
- struct SymbolEntry *symbol_entry =
- (struct SymbolEntry *)malloc(sizeof(struct SymbolEntry));
- const char *name = reinterpret_cast<char *>(
- strtab_section.sh_offset + (GElf_Word)base + symbol->st_name);
- symbol_entry->offset = symbol->st_value;
- symbol_entry->size = symbol->st_size;
- symbols->symbol_entries.insert(make_pair(name, symbol_entry));
- ++symbol;
- }
-
-
- // Load symbols.
- return LoadAllSymbols(&stab_section, &stabstr_section, base, symbols);
-}
-
-bool WriteModuleInfo(int fd, GElf_Half arch, const std::string &obj_file) {
- const char *arch_name = NULL;
- if (arch == EM_386)
- arch_name = "x86";
- else if (arch == EM_X86_64)
- arch_name = "x86_64";
- else if (arch == EM_SPARC32PLUS)
- arch_name = "SPARC_32+";
- else {
- printf("Please add more ARCH support\n");
- return false;
- }
-
- unsigned char identifier[16];
- google_breakpad::FileID file_id(obj_file.c_str());
- if (file_id.ElfFileIdentifier(identifier)) {
- char identifier_str[40];
- file_id.ConvertIdentifierToString(identifier,
- identifier_str, sizeof(identifier_str));
- std::string filename = obj_file;
- size_t slash_pos = obj_file.find_last_of("/");
- if (slash_pos != std::string::npos)
- filename = obj_file.substr(slash_pos + 1);
- return WriteFormat(fd, "MODULE solaris %s %s %s\n", arch_name,
- identifier_str, filename.c_str());
- }
- return false;
-}
-
-bool WriteSourceFileInfo(int fd, const struct SymbolInfo &symbols) {
- for (size_t i = 0; i < symbols.source_file_info.size(); ++i) {
- if (symbols.source_file_info[i].source_id != -1) {
- const char *name = symbols.source_file_info[i].name;
- if (!WriteFormat(fd, "FILE %d %s\n",
- symbols.source_file_info[i].source_id, name))
- return false;
- }
- }
- return true;
-}
-
-bool WriteOneFunction(int fd, int source_id,
- const struct FuncInfo &func_info){
- // Discard the ending part of the name.
- std::string func_name(func_info.name);
- std::string::size_type last_colon = func_name.find_last_of(':');
- if (last_colon != std::string::npos)
- func_name = func_name.substr(0, last_colon);
- func_name = Demangle(func_name.c_str());
-
- if (func_info.size <= 0)
- return true;
-
- // rva_to_base could be unsigned long(32 bit) or unsigned long long(64 bit).
- if (WriteFormat(fd, "FUNC %llx %x %d %s\n",
- (long long)func_info.rva_to_base,
- func_info.size,
- func_info.stack_param_size,
- func_name.c_str())) {
- for (size_t i = 0; i < func_info.line_info.size(); ++i) {
- const struct LineInfo &line_info = func_info.line_info[i];
- if (line_info.line_num == 0)
- return true;
- if (!WriteFormat(fd, "%llx %x %d %d\n",
- (long long)line_info.rva_to_base,
- line_info.size,
- line_info.line_num,
- source_id))
- return false;
- }
- return true;
- }
- return false;
-}
-
-bool WriteFunctionInfo(int fd, const struct SymbolInfo &symbols) {
- for (size_t i = 0; i < symbols.source_file_info.size(); ++i) {
- const struct SourceFileInfo &file_info = symbols.source_file_info[i];
- for (size_t j = 0; j < file_info.func_info.size(); ++j) {
- const struct FuncInfo &func_info = file_info.func_info[j];
- if (!WriteOneFunction(fd, file_info.source_id, func_info))
- return false;
- }
- }
- return true;
-}
-
-bool DumpStabSymbols(int fd, const struct SymbolInfo &symbols) {
- return WriteSourceFileInfo(fd, symbols) &&
- WriteFunctionInfo(fd, symbols);
-}
-
-//
-// FDWrapper
-//
-// Wrapper class to make sure opened file is closed.
-//
-class FDWrapper {
- public:
- explicit FDWrapper(int fd) :
- fd_(fd) {
- }
- ~FDWrapper() {
- if (fd_ != -1)
- close(fd_);
- }
- int get() {
- return fd_;
- }
- int release() {
- int fd = fd_;
- fd_ = -1;
- return fd;
- }
- private:
- int fd_;
-};
-
-//
-// MmapWrapper
-//
-// Wrapper class to make sure mapped regions are unmapped.
-//
-class MmapWrapper {
- public:
- MmapWrapper(void *mapped_address, size_t mapped_size) :
- base_(mapped_address), size_(mapped_size) {
- }
- ~MmapWrapper() {
- if (base_ != NULL) {
- assert(size_ > 0);
- munmap((char *)base_, size_);
- }
- }
- void release() {
- base_ = NULL;
- size_ = 0;
- }
-
- private:
- void *base_;
- size_t size_;
-};
-
-} // namespace
-
-namespace google_breakpad {
-
-class AutoElfEnder {
- public:
- AutoElfEnder(Elf *elf) : elf_(elf) {}
- ~AutoElfEnder() { if (elf_) elf_end(elf_); }
- private:
- Elf *elf_;
-};
-
-
-bool DumpSymbols::WriteSymbolFile(const std::string &obj_file, int sym_fd) {
- if (elf_version(EV_CURRENT) == EV_NONE) {
- fprintf(stderr, "elf_version() failed: %s\n", elf_errmsg(0));
- return false;
- }
-
- int obj_fd = open(obj_file.c_str(), O_RDONLY);
- if (obj_fd < 0)
- return false;
- FDWrapper obj_fd_wrapper(obj_fd);
- struct stat st;
- if (fstat(obj_fd, &st) != 0 && st.st_size <= 0)
- return false;
- void *obj_base = mmap(NULL, st.st_size,
- PROT_READ, MAP_PRIVATE, obj_fd, 0);
- if (obj_base == MAP_FAILED)
- return false;
- MmapWrapper map_wrapper(obj_base, st.st_size);
- GElf_Ehdr elf_header;
- Elf *elf = elf_begin(obj_fd, ELF_C_READ, NULL);
- AutoElfEnder elfEnder(elf);
-
- if (gelf_getehdr(elf, &elf_header) == (GElf_Ehdr *)NULL) {
- fprintf(stderr, "failed to read elf header: %s\n", elf_errmsg(-1));
- return false;
- }
-
- if (!IsValidElf(&elf_header)) {
- fprintf(stderr, "header magic doesn't match\n");
- return false;
- }
- struct SymbolInfo symbols;
- if (!LoadSymbols(elf, &elf_header, &symbols, obj_base))
- return false;
- // Write to symbol file.
- if (WriteModuleInfo(sym_fd, elf_header.e_machine, obj_file) &&
- DumpStabSymbols(sym_fd, symbols))
- return true;
-
- return false;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.h b/toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.h
deleted file mode 100644
index 7f4baadcfc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/dump_symbols.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// dump_symbols.cc: Implements a Solaris stab debugging format dumper.
-//
-// Author: Alfred Peng
-
-#ifndef COMMON_SOLARIS_DUMP_SYMBOLS_H__
-#define COMMON_SOLARIS_DUMP_SYMBOLS_H__
-
-#include <string>
-
-namespace google_breakpad {
-
-class DumpSymbols {
- public:
- bool WriteSymbolFile(const std::string &obj_file,
- int sym_fd);
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_SOLARIS_DUMP_SYMBOLS_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.cc b/toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.cc
deleted file mode 100644
index 643a14629d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// file_id.cc: Return a unique identifier for a file
-//
-// See file_id.h for documentation
-//
-// Author: Alfred Peng
-
-#include <elf.h>
-#include <fcntl.h>
-#include <gelf.h>
-#include <sys/mman.h>
-#include <sys/ksyms.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <cassert>
-#include <cstdio>
-
-#include "common/md5.h"
-#include "common/solaris/file_id.h"
-#include "common/solaris/message_output.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-class AutoElfEnder {
- public:
- AutoElfEnder(Elf *elf) : elf_(elf) {}
- ~AutoElfEnder() { if (elf_) elf_end(elf_); }
- private:
- Elf *elf_;
-};
-
-// Find the text section in elf object file.
-// Return the section start address and the size.
-static bool FindElfTextSection(int fd, const void *elf_base,
- const void **text_start,
- int *text_size) {
- assert(text_start);
- assert(text_size);
-
- *text_start = NULL;
- *text_size = 0;
-
- if (elf_version(EV_CURRENT) == EV_NONE) {
- print_message2(2, "elf_version() failed: %s\n", elf_errmsg(0));
- return false;
- }
-
- GElf_Ehdr elf_header;
- lseek(fd, 0L, 0);
- Elf *elf = elf_begin(fd, ELF_C_READ, NULL);
- AutoElfEnder elfEnder(elf);
-
- if (gelf_getehdr(elf, &elf_header) == (GElf_Ehdr *)NULL) {
- print_message2(2, "failed to read elf header: %s\n", elf_errmsg(-1));
- return false;
- }
-
- if (elf_header.e_ident[EI_MAG0] != ELFMAG0 ||
- elf_header.e_ident[EI_MAG1] != ELFMAG1 ||
- elf_header.e_ident[EI_MAG2] != ELFMAG2 ||
- elf_header.e_ident[EI_MAG3] != ELFMAG3) {
- print_message1(2, "header magic doesn't match\n");
- return false;
- }
-
- static const char kTextSectionName[] = ".text";
- const GElf_Shdr *text_section = NULL;
- Elf_Scn *scn = NULL;
- GElf_Shdr shdr;
-
- while ((scn = elf_nextscn(elf, scn)) != NULL) {
- if (gelf_getshdr(scn, &shdr) == (GElf_Shdr *)0) {
- print_message2(2, "failed to read section header: %s\n", elf_errmsg(0));
- return false;
- }
-
- if (shdr.sh_type == SHT_PROGBITS) {
- const char *section_name = elf_strptr(elf, elf_header.e_shstrndx,
- shdr.sh_name);
- if (!section_name) {
- print_message2(2, "Section name error: %s\n", elf_errmsg(-1));
- continue;
- }
-
- if (strcmp(section_name, kTextSectionName) == 0) {
- text_section = &shdr;
- break;
- }
- }
- }
- if (text_section != NULL && text_section->sh_size > 0) {
- *text_start = (char *)elf_base + text_section->sh_offset;
- *text_size = text_section->sh_size;
- return true;
- }
-
- return false;
-}
-
-FileID::FileID(const char *path) {
- strcpy(path_, path);
-}
-
-class AutoCloser {
- public:
- AutoCloser(int fd) : fd_(fd) {}
- ~AutoCloser() { if (fd_) close(fd_); }
- private:
- int fd_;
-};
-
-bool FileID::ElfFileIdentifier(unsigned char identifier[16]) {
- int fd = 0;
- if ((fd = open(path_, O_RDONLY)) < 0)
- return false;
-
- AutoCloser autocloser(fd);
- struct stat st;
- if (fstat(fd, &st) != 0 || st.st_size <= 0)
- return false;
-
- void *base = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
- if (base == MAP_FAILED)
- return false;
-
- bool success = false;
- const void *text_section = NULL;
- int text_size = 0;
-
- if (FindElfTextSection(fd, base, &text_section, &text_size)) {
- MD5Context md5;
- MD5Init(&md5);
- MD5Update(&md5, (const unsigned char *)text_section, text_size);
- MD5Final(identifier, &md5);
- success = true;
- }
-
- munmap((char *)base, st.st_size);
- return success;
-}
-
-// static
-bool FileID::ConvertIdentifierToString(const unsigned char identifier[16],
- char *buffer, int buffer_length) {
- if (buffer_length < 34)
- return false;
-
- int buffer_idx = 0;
- for (int idx = 0; idx < 16; ++idx) {
- int hi = (identifier[idx] >> 4) & 0x0F;
- int lo = (identifier[idx]) & 0x0F;
-
- buffer[buffer_idx++] = (hi >= 10) ? 'A' + hi - 10 : '0' + hi;
- buffer[buffer_idx++] = (lo >= 10) ? 'A' + lo - 10 : '0' + lo;
- }
-
- // Add an extra "0" by the end.
- buffer[buffer_idx++] = '0';
-
- // NULL terminate
- buffer[buffer_idx] = 0;
-
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.h b/toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.h
deleted file mode 100644
index 375e857512..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/file_id.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// file_id.h: Return a unique identifier for a file
-//
-// Author: Alfred Peng
-
-#ifndef COMMON_SOLARIS_FILE_ID_H__
-#define COMMON_SOLARIS_FILE_ID_H__
-
-#include <limits.h>
-
-namespace google_breakpad {
-
-class FileID {
- public:
- FileID(const char *path);
- ~FileID() {};
-
- // Load the identifier for the elf file path specified in the constructor into
- // |identifier|. Return false if the identifier could not be created for the
- // file.
- // The current implementation will return the MD5 hash of the file's bytes.
- bool ElfFileIdentifier(unsigned char identifier[16]);
-
- // Convert the |identifier| data to a NULL terminated string. The string will
- // be formatted as a MDCVInfoPDB70 struct.
- // The |buffer| should be at least 34 bytes long to receive all of the data
- // and termination. Shorter buffers will return false.
- static bool ConvertIdentifierToString(const unsigned char identifier[16],
- char *buffer, int buffer_length);
-
- private:
- // Storage for the path specified
- char path_[PATH_MAX];
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_SOLARIS_FILE_ID_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.cc b/toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.cc
deleted file mode 100644
index e9e6c6f5d2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <cassert>
-#include <ctime>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "common/solaris/guid_creator.h"
-
-//
-// GUIDGenerator
-//
-// This class is used to generate random GUID.
-// Currently use random number to generate a GUID. This should be OK since
-// we don't expect crash to happen very offen.
-//
-class GUIDGenerator {
- public:
- GUIDGenerator() {
- srandom(time(NULL));
- }
-
- bool CreateGUID(GUID *guid) const {
- guid->data1 = random();
- guid->data2 = (uint16_t)(random());
- guid->data3 = (uint16_t)(random());
- *reinterpret_cast<uint32_t*>(&guid->data4[0]) = random();
- *reinterpret_cast<uint32_t*>(&guid->data4[4]) = random();
- return true;
- }
-};
-
-// Guid generator.
-const GUIDGenerator kGuidGenerator;
-
-bool CreateGUID(GUID *guid) {
- return kGuidGenerator.CreateGUID(guid);
-}
-
-// Parse guid to string.
-bool GUIDToString(const GUID *guid, char *buf, int buf_len) {
- // Should allow more space the the max length of GUID.
- assert(buf_len > kGUIDStringLength);
- int num = snprintf(buf, buf_len, kGUIDFormatString,
- guid->data1, guid->data2, guid->data3,
- *reinterpret_cast<const uint32_t *>(&(guid->data4[0])),
- *reinterpret_cast<const uint32_t *>(&(guid->data4[4])));
- if (num != kGUIDStringLength)
- return false;
-
- buf[num] = '\0';
- return true;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.h b/toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.h
deleted file mode 100644
index 4aee3a1c24..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/guid_creator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#ifndef COMMON_SOLARIS_GUID_CREATOR_H__
-#define COMMON_SOLARIS_GUID_CREATOR_H__
-
-#include "google_breakpad/common/minidump_format.h"
-
-typedef MDGUID GUID;
-
-// Format string for parsing GUID.
-#define kGUIDFormatString "%08x-%04x-%04x-%08x-%08x"
-// Length of GUID string. Don't count the ending '\0'.
-#define kGUIDStringLength 36
-
-// Create a guid.
-bool CreateGUID(GUID *guid);
-
-// Get the string from guid.
-bool GUIDToString(const GUID *guid, char *buf, int buf_len);
-
-#endif // COMMON_SOLARIS_GUID_CREATOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/message_output.h b/toolkit/crashreporter/google-breakpad/src/common/solaris/message_output.h
deleted file mode 100644
index 3e3b1d4652..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/message_output.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#ifndef COMMON_SOLARIS_MESSAGE_OUTPUT_H__
-#define COMMON_SOLARIS_MESSAGE_OUTPUT_H__
-
-namespace google_breakpad {
-
-const int MESSAGE_MAX = 1000;
-
-// Message output macros.
-// snprintf doesn't operate heap on Solaris, while printf and fprintf do.
-// Use snprintf here to avoid heap allocation.
-#define print_message1(std, message) \
- char buffer[MESSAGE_MAX]; \
- int len = snprintf(buffer, MESSAGE_MAX, message); \
- write(std, buffer, len)
-
-#define print_message2(std, message, para) \
- char buffer[MESSAGE_MAX]; \
- int len = snprintf(buffer, MESSAGE_MAX, message, para); \
- write(std, buffer, len);
-
-} // namespace google_breakpad
-
-#endif // COMMON_SOLARIS_MESSAGE_OUTPUT_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build b/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
deleted file mode 100644
index c91b96fc7b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'dump_symbols.cc',
- 'file_id.cc',
- 'guid_creator.cc',
-]
-
-HostLibrary('host_breakpad_solaris_common_s')
-
-Library('breakpad_solaris_common_s')
-
-# not compiling http_upload.cc currently
-# since it depends on libcurl
-HOST_SOURCES += [
- 'dump_symbols.cc',
- 'file_id.cc',
- 'guid_creator.cc',
-]
-HOST_CXXFLAGS += [
- '-O2',
- '-g',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '../..',
-]
-
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
deleted file mode 100644
index 6019fc7ee2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.cc
+++ /dev/null
@@ -1,315 +0,0 @@
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// This file implements the google_breakpad::StabsReader class.
-// See stabs_reader.h.
-
-#include "common/stabs_reader.h"
-
-#include <assert.h>
-#include <stab.h>
-#include <string.h>
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-using std::vector;
-
-namespace google_breakpad {
-
-StabsReader::EntryIterator::EntryIterator(const ByteBuffer *buffer,
- bool big_endian, size_t value_size)
- : value_size_(value_size), cursor_(buffer, big_endian) {
- // Actually, we could handle weird sizes just fine, but they're
- // probably mistakes --- expressed in bits, say.
- assert(value_size == 4 || value_size == 8);
- entry_.index = 0;
- Fetch();
-}
-
-void StabsReader::EntryIterator::Fetch() {
- cursor_
- .Read(4, false, &entry_.name_offset)
- .Read(1, false, &entry_.type)
- .Read(1, false, &entry_.other)
- .Read(2, false, &entry_.descriptor)
- .Read(value_size_, false, &entry_.value);
- entry_.at_end = !cursor_;
-}
-
-StabsReader::StabsReader(const uint8_t *stab, size_t stab_size,
- const uint8_t *stabstr, size_t stabstr_size,
- bool big_endian, size_t value_size, bool unitized,
- StabsHandler *handler)
- : entries_(stab, stab_size),
- strings_(stabstr, stabstr_size),
- iterator_(&entries_, big_endian, value_size),
- unitized_(unitized),
- handler_(handler),
- string_offset_(0),
- next_cu_string_offset_(0),
- current_source_file_(NULL) { }
-
-const char *StabsReader::SymbolString() {
- ptrdiff_t offset = string_offset_ + iterator_->name_offset;
- if (offset < 0 || (size_t) offset >= strings_.Size()) {
- handler_->Warning("symbol %d: name offset outside the string section\n",
- iterator_->index);
- // Return our null string, to keep our promise about all names being
- // taken from the string section.
- offset = 0;
- }
- return reinterpret_cast<const char *>(strings_.start + offset);
-}
-
-bool StabsReader::Process() {
- while (!iterator_->at_end) {
- if (iterator_->type == N_SO) {
- if (! ProcessCompilationUnit())
- return false;
- } else if (iterator_->type == N_UNDF && unitized_) {
- // In unitized STABS (including Linux STABS, and pretty much anything
- // else that puts STABS data in sections), at the head of each
- // compilation unit's entries there is an N_UNDF stab giving the
- // number of symbols in the compilation unit, and the number of bytes
- // that compilation unit's strings take up in the .stabstr section.
- // Each CU's strings are separate; the n_strx values are offsets
- // within the current CU's portion of the .stabstr section.
- //
- // As an optimization, the GNU linker combines all the
- // compilation units into one, with a single N_UNDF at the
- // beginning. However, other linkers, like Gold, do not perform
- // this optimization.
- string_offset_ = next_cu_string_offset_;
- next_cu_string_offset_ = iterator_->value;
- ++iterator_;
- }
-#if defined(HAVE_MACH_O_NLIST_H)
- // Export symbols in Mach-O binaries look like this.
- // This is necessary in order to be able to dump symbols
- // from OS X system libraries.
- else if ((iterator_->type & N_STAB) == 0 &&
- (iterator_->type & N_TYPE) == N_SECT) {
- ProcessExtern();
- }
-#endif
- else {
- ++iterator_;
- }
- }
- return true;
-}
-
-bool StabsReader::ProcessCompilationUnit() {
- assert(!iterator_->at_end && iterator_->type == N_SO);
-
- // There may be an N_SO entry whose name ends with a slash,
- // indicating the directory in which the compilation occurred.
- // The build directory defaults to NULL.
- const char *build_directory = NULL;
- {
- const char *name = SymbolString();
- if (name[0] && name[strlen(name) - 1] == '/') {
- build_directory = name;
- ++iterator_;
- }
- }
-
- // We expect to see an N_SO entry with a filename next, indicating
- // the start of the compilation unit.
- {
- if (iterator_->at_end || iterator_->type != N_SO)
- return true;
- const char *name = SymbolString();
- if (name[0] == '\0') {
- // This seems to be a stray end-of-compilation-unit marker;
- // consume it, but don't report the end, since we didn't see a
- // beginning.
- ++iterator_;
- return true;
- }
- current_source_file_ = name;
- }
-
- if (! handler_->StartCompilationUnit(current_source_file_,
- iterator_->value,
- build_directory))
- return false;
-
- ++iterator_;
-
- // The STABS documentation says that some compilers may emit
- // additional N_SO entries with names immediately following the
- // first, and that they should be ignored. However, the original
- // Breakpad STABS reader doesn't ignore them, so we won't either.
-
- // Process the body of the compilation unit, up to the next N_SO.
- while (!iterator_->at_end && iterator_->type != N_SO) {
- if (iterator_->type == N_FUN) {
- if (! ProcessFunction())
- return false;
- } else if (iterator_->type == N_SLINE) {
- // Mac OS X STABS place SLINE records before functions.
- Line line;
- // The value of an N_SLINE entry that appears outside a function is
- // the absolute address of the line.
- line.address = iterator_->value;
- line.filename = current_source_file_;
- // The n_desc of a N_SLINE entry is the line number. It's a
- // signed 16-bit field; line numbers from 32768 to 65535 are
- // stored as n-65536.
- line.number = (uint16_t) iterator_->descriptor;
- queued_lines_.push_back(line);
- ++iterator_;
- } else if (iterator_->type == N_SOL) {
- current_source_file_ = SymbolString();
- ++iterator_;
- } else {
- // Ignore anything else.
- ++iterator_;
- }
- }
-
- // An N_SO with an empty name indicates the end of the compilation
- // unit. Default to zero.
- uint64_t ending_address = 0;
- if (!iterator_->at_end) {
- assert(iterator_->type == N_SO);
- const char *name = SymbolString();
- if (name[0] == '\0') {
- ending_address = iterator_->value;
- ++iterator_;
- }
- }
-
- if (! handler_->EndCompilationUnit(ending_address))
- return false;
-
- queued_lines_.clear();
-
- return true;
-}
-
-bool StabsReader::ProcessFunction() {
- assert(!iterator_->at_end && iterator_->type == N_FUN);
-
- uint64_t function_address = iterator_->value;
- // The STABS string for an N_FUN entry is the name of the function,
- // followed by a colon, followed by type information for the
- // function. We want to pass the name alone to StartFunction.
- const char *stab_string = SymbolString();
- const char *name_end = strchr(stab_string, ':');
- if (! name_end)
- name_end = stab_string + strlen(stab_string);
- string name(stab_string, name_end - stab_string);
- if (! handler_->StartFunction(name, function_address))
- return false;
- ++iterator_;
-
- // If there were any SLINE records given before the function, report them now.
- for (vector<Line>::const_iterator it = queued_lines_.begin();
- it != queued_lines_.end(); it++) {
- if (!handler_->Line(it->address, it->filename, it->number))
- return false;
- }
- queued_lines_.clear();
-
- while (!iterator_->at_end) {
- if (iterator_->type == N_SO || iterator_->type == N_FUN)
- break;
- else if (iterator_->type == N_SLINE) {
- // The value of an N_SLINE entry is the offset of the line from
- // the function's start address.
- uint64_t line_address = function_address + iterator_->value;
- // The n_desc of a N_SLINE entry is the line number. It's a
- // signed 16-bit field; line numbers from 32768 to 65535 are
- // stored as n-65536.
- uint16_t line_number = iterator_->descriptor;
- if (! handler_->Line(line_address, current_source_file_, line_number))
- return false;
- ++iterator_;
- } else if (iterator_->type == N_SOL) {
- current_source_file_ = SymbolString();
- ++iterator_;
- } else
- // Ignore anything else.
- ++iterator_;
- }
-
- // We've reached the end of the function. See if we can figure out its
- // ending address.
- uint64_t ending_address = 0;
- if (!iterator_->at_end) {
- assert(iterator_->type == N_SO || iterator_->type == N_FUN);
- if (iterator_->type == N_FUN) {
- const char *symbol_name = SymbolString();
- if (symbol_name[0] == '\0') {
- // An N_FUN entry with no name is a terminator for this function;
- // its value is the function's size.
- ending_address = function_address + iterator_->value;
- ++iterator_;
- } else {
- // An N_FUN entry with a name is the next function, and we can take
- // its value as our ending address. Don't advance the iterator, as
- // we'll use this symbol to start the next function as well.
- ending_address = iterator_->value;
- }
- } else {
- // An N_SO entry could be an end-of-compilation-unit marker, or the
- // start of the next compilation unit, but in either case, its value
- // is our ending address. We don't advance the iterator;
- // ProcessCompilationUnit will decide what to do with this symbol.
- ending_address = iterator_->value;
- }
- }
-
- if (! handler_->EndFunction(ending_address))
- return false;
-
- return true;
-}
-
-bool StabsReader::ProcessExtern() {
-#if defined(HAVE_MACH_O_NLIST_H)
- assert(!iterator_->at_end &&
- (iterator_->type & N_STAB) == 0 &&
- (iterator_->type & N_TYPE) == N_SECT);
-#endif
-
- // TODO(mark): only do symbols in the text section?
- if (!handler_->Extern(SymbolString(), iterator_->value))
- return false;
-
- ++iterator_;
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h
deleted file mode 100644
index 98ee2dd53b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader.h
+++ /dev/null
@@ -1,325 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// stabs_reader.h: Define StabsReader, a parser for STABS debugging
-// information. A description of the STABS debugging format can be
-// found at:
-//
-// http://sourceware.org/gdb/current/onlinedocs/stabs_toc.html
-//
-// The comments here assume you understand the format.
-//
-// This parser can handle big-endian and little-endian data, and the symbol
-// values may be either 32 or 64 bits long. It handles both STABS in
-// sections (as used on Linux) and STABS appearing directly in an
-// a.out-like symbol table (as used in Darwin OS X Mach-O files).
-
-#ifndef COMMON_STABS_READER_H__
-#define COMMON_STABS_READER_H__
-
-#include <stddef.h>
-#include <stdint.h>
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_MACH_O_NLIST_H
-#include <mach-o/nlist.h>
-#elif defined(HAVE_A_OUT_H)
-#include <a.out.h>
-#endif
-
-#include <string>
-#include <vector>
-
-#include "common/byte_cursor.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-class StabsHandler;
-
-class StabsReader {
- public:
- // Create a reader for the STABS debug information whose .stab section is
- // being traversed by ITERATOR, and whose .stabstr section is referred to
- // by STRINGS. The reader will call the member functions of HANDLER to
- // report the information it finds, when the reader's 'Process' member
- // function is called.
- //
- // BIG_ENDIAN should be true if the entries in the .stab section are in
- // big-endian form, or false if they are in little-endian form.
- //
- // VALUE_SIZE should be either 4 or 8, indicating the size of the 'value'
- // field in each entry in bytes.
- //
- // UNITIZED should be true if the STABS data is stored in units with
- // N_UNDF headers. This is usually the case for STABS stored in sections,
- // like .stab/.stabstr, and usually not the case for STABS stored in the
- // actual symbol table; UNITIZED should be true when parsing Linux stabs,
- // false when parsing Mac OS X STABS. For details, see:
- // http://sourceware.org/gdb/current/onlinedocs/stabs/Stab-Section-Basics.html
- //
- // Note that, in ELF, the .stabstr section should be found using the
- // 'sh_link' field of the .stab section header, not by name.
- StabsReader(const uint8_t *stab, size_t stab_size,
- const uint8_t *stabstr, size_t stabstr_size,
- bool big_endian, size_t value_size, bool unitized,
- StabsHandler *handler);
-
- // Process the STABS data, calling the handler's member functions to
- // report what we find. While the handler functions return true,
- // continue to process until we reach the end of the section. If we
- // processed the entire section and all handlers returned true,
- // return true. If any handler returned false, return false.
- //
- // This is only meant to be called once per StabsReader instance;
- // resuming a prior processing pass that stopped abruptly isn't supported.
- bool Process();
-
- private:
-
- // An class for walking arrays of STABS entries. This isolates the main
- // STABS reader from the exact format (size; endianness) of the entries
- // themselves.
- class EntryIterator {
- public:
- // The contents of a STABS entry, adjusted for the host's endianness,
- // word size, 'struct nlist' layout, and so on.
- struct Entry {
- // True if this iterator has reached the end of the entry array. When
- // this is set, the other members of this structure are not valid.
- bool at_end;
-
- // The number of this entry within the list.
- size_t index;
-
- // The current entry's name offset. This is the offset within the
- // current compilation unit's strings, as establish by the N_UNDF entries.
- size_t name_offset;
-
- // The current entry's type, 'other' field, descriptor, and value.
- unsigned char type;
- unsigned char other;
- short descriptor;
- uint64_t value;
- };
-
- // Create a EntryIterator walking the entries in BUFFER. Treat the
- // entries as big-endian if BIG_ENDIAN is true, as little-endian
- // otherwise. Assume each entry has a 'value' field whose size is
- // VALUE_SIZE.
- //
- // This would not be terribly clean to extend to other format variations,
- // but it's enough to handle Linux and Mac, and we'd like STABS to die
- // anyway.
- //
- // For the record: on Linux, STABS entry values are always 32 bits,
- // regardless of the architecture address size (don't ask me why); on
- // Mac, they are 32 or 64 bits long. Oddly, the section header's entry
- // size for a Linux ELF .stab section varies according to the ELF class
- // from 12 to 20 even as the actual entries remain unchanged.
- EntryIterator(const ByteBuffer *buffer, bool big_endian, size_t value_size);
-
- // Move to the next entry. This function's behavior is undefined if
- // at_end() is true when it is called.
- EntryIterator &operator++() { Fetch(); entry_.index++; return *this; }
-
- // Dereferencing this iterator produces a reference to an Entry structure
- // that holds the current entry's values. The entry is owned by this
- // EntryIterator, and will be invalidated at the next call to operator++.
- const Entry &operator*() const { return entry_; }
- const Entry *operator->() const { return &entry_; }
-
- private:
- // Read the STABS entry at cursor_, and set entry_ appropriately.
- void Fetch();
-
- // The size of entries' value field, in bytes.
- size_t value_size_;
-
- // A byte cursor traversing buffer_.
- ByteCursor cursor_;
-
- // Values for the entry this iterator refers to.
- Entry entry_;
- };
-
- // A source line, saved to be reported later.
- struct Line {
- uint64_t address;
- const char *filename;
- int number;
- };
-
- // Return the name of the current symbol.
- const char *SymbolString();
-
- // Process a compilation unit starting at symbol_. Return true
- // to continue processing, or false to abort.
- bool ProcessCompilationUnit();
-
- // Process a function in current_source_file_ starting at symbol_.
- // Return true to continue processing, or false to abort.
- bool ProcessFunction();
-
- // Process an exported function symbol.
- // Return true to continue processing, or false to abort.
- bool ProcessExtern();
-
- // The STABS entries being parsed.
- ByteBuffer entries_;
-
- // The string section to which the entries refer.
- ByteBuffer strings_;
-
- // The iterator walking the STABS entries.
- EntryIterator iterator_;
-
- // True if the data is "unitized"; see the explanation in the comment for
- // StabsReader::StabsReader.
- bool unitized_;
-
- StabsHandler *handler_;
-
- // The offset of the current compilation unit's strings within stabstr_.
- size_t string_offset_;
-
- // The value string_offset_ should have for the next compilation unit,
- // as established by N_UNDF entries.
- size_t next_cu_string_offset_;
-
- // The current source file name.
- const char *current_source_file_;
-
- // Mac OS X STABS place SLINE records before functions; we accumulate a
- // vector of these until we see the FUN record, and then report them
- // after the StartFunction call.
- std::vector<Line> queued_lines_;
-};
-
-// Consumer-provided callback structure for the STABS reader. Clients
-// of the STABS reader provide an instance of this structure. The
-// reader then invokes the member functions of that instance to report
-// the information it finds.
-//
-// The default definitions of the member functions do nothing, and return
-// true so processing will continue.
-class StabsHandler {
- public:
- StabsHandler() { }
- virtual ~StabsHandler() { }
-
- // Some general notes about the handler callback functions:
-
- // Processing proceeds until the end of the .stabs section, or until
- // one of these functions returns false.
-
- // The addresses given are as reported in the STABS info, without
- // regard for whether the module may be loaded at different
- // addresses at different times (a shared library, say). When
- // processing STABS from an ELF shared library, the addresses given
- // all assume the library is loaded at its nominal load address.
- // They are *not* offsets from the nominal load address. If you
- // want offsets, you must subtract off the library's nominal load
- // address.
-
- // The arguments to these functions named FILENAME are all
- // references to strings stored in the .stabstr section. Because
- // both the Linux and Solaris linkers factor out duplicate strings
- // from the .stabstr section, the consumer can assume that if two
- // FILENAME values are different addresses, they represent different
- // file names.
- //
- // Thus, it's safe to use (say) std::map<char *, ...>, which does
- // string address comparisons, not string content comparisons.
- // Since all the strings are in same array of characters --- the
- // .stabstr section --- comparing their addresses produces
- // predictable, if not lexicographically meaningful, results.
-
- // Begin processing a compilation unit whose main source file is
- // named FILENAME, and whose base address is ADDRESS. If
- // BUILD_DIRECTORY is non-NULL, it is the name of the build
- // directory in which the compilation occurred.
- virtual bool StartCompilationUnit(const char *filename, uint64_t address,
- const char *build_directory) {
- return true;
- }
-
- // Finish processing the compilation unit. If ADDRESS is non-zero,
- // it is the ending address of the compilation unit. If ADDRESS is
- // zero, then the compilation unit's ending address is not
- // available, and the consumer must infer it by other means.
- virtual bool EndCompilationUnit(uint64_t address) { return true; }
-
- // Begin processing a function named NAME, whose starting address is
- // ADDRESS. This function belongs to the compilation unit that was
- // most recently started but not ended.
- //
- // Note that, unlike filenames, NAME is not a pointer into the
- // .stabstr section; this is because the name as it appears in the
- // STABS data is followed by type information. The value passed to
- // StartFunction is the function name alone.
- //
- // In languages that use name mangling, like C++, NAME is mangled.
- virtual bool StartFunction(const string &name, uint64_t address) {
- return true;
- }
-
- // Finish processing the function. If ADDRESS is non-zero, it is
- // the ending address for the function. If ADDRESS is zero, then
- // the function's ending address is not available, and the consumer
- // must infer it by other means.
- virtual bool EndFunction(uint64_t address) { return true; }
-
- // Report that the code at ADDRESS is attributable to line NUMBER of
- // the source file named FILENAME. The caller must infer the ending
- // address of the line.
- virtual bool Line(uint64_t address, const char *filename, int number) {
- return true;
- }
-
- // Report that an exported function NAME is present at ADDRESS.
- // The size of the function is unknown.
- virtual bool Extern(const string &name, uint64_t address) {
- return true;
- }
-
- // Report a warning. FORMAT is a printf-like format string,
- // specifying how to format the subsequent arguments.
- virtual void Warning(const char *format, ...) = 0;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_STABS_READER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc
deleted file mode 100644
index a84da1c4ca..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_reader_unittest.cc
+++ /dev/null
@@ -1,611 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// stabs_reader_unittest.cc: Unit tests for google_breakpad::StabsReader.
-
-#include <assert.h>
-#include <errno.h>
-#include <stab.h>
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <fstream>
-#include <iomanip>
-#include <iostream>
-#include <map>
-#include <sstream>
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/stabs_reader.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-
-using ::testing::Eq;
-using ::testing::InSequence;
-using ::testing::Return;
-using ::testing::StrEq;
-using ::testing::Test;
-using ::testing::_;
-using google_breakpad::StabsHandler;
-using google_breakpad::StabsReader;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using std::map;
-
-namespace {
-
-// A StringAssembler is a class for generating .stabstr sections to present
-// as input to the STABS parser.
-class StringAssembler: public Section {
- public:
- StringAssembler() : in_cu_(false) { StartCU(); }
-
- // Add the string S to this StringAssembler, and return the string's
- // offset within this compilation unit's strings. If S has been added
- // already, this returns the offset of its first instance.
- size_t Add(const string &s) {
- map<string, size_t>::iterator it = added_.find(s);
- if (it != added_.end())
- return it->second;
- size_t offset = Size() - cu_start_;
- AppendCString(s);
- added_[s] = offset;
- return offset;
- }
-
- // Start a fresh compilation unit string collection.
- void StartCU() {
- // Ignore duplicate calls to StartCU. Our test data don't always call
- // StartCU at all, meaning that our constructor has to take care of it,
- // meaning that tests that *do* call StartCU call it twice at the
- // beginning. This is not worth smoothing out.
- if (in_cu_) return;
-
- added_.clear();
- cu_start_ = Size();
-
- // Each compilation unit's strings start with an empty string.
- AppendCString("");
- added_[""] = 0;
-
- in_cu_ = true;
- }
-
- // Finish off the current CU's strings.
- size_t EndCU() {
- assert(in_cu_);
- in_cu_ = false;
- return Size() - cu_start_;
- }
-
- private:
- // The offset of the start of this compilation unit's strings.
- size_t cu_start_;
-
- // True if we're in a CU.
- bool in_cu_;
-
- // A map from the strings that have been added to this section to
- // their starting indices within their compilation unit.
- map<string, size_t> added_;
-};
-
-// A StabsAssembler is a class for generating .stab sections to present as
-// test input for the STABS parser.
-class StabsAssembler: public Section {
- public:
- // Create a StabsAssembler that uses StringAssembler for its strings.
- StabsAssembler(StringAssembler *string_assembler)
- : Section(string_assembler->endianness()),
- string_assembler_(string_assembler),
- value_size_(0),
- entry_count_(0),
- cu_header_(NULL) { }
- ~StabsAssembler() { assert(!cu_header_); }
-
- // Accessor and setter for value_size_.
- size_t value_size() const { return value_size_; }
- StabsAssembler &set_value_size(size_t value_size) {
- value_size_ = value_size;
- return *this;
- }
-
- // Append a STAB entry to the end of this section with the given
- // characteristics. NAME is the offset of this entry's name string within
- // its compilation unit's portion of the .stabstr section; this can be a
- // value generated by a StringAssembler. Return a reference to this
- // StabsAssembler.
- StabsAssembler &Stab(uint8_t type, uint8_t other, Label descriptor,
- Label value, Label name) {
- D32(name);
- D8(type);
- D8(other);
- D16(descriptor);
- Append(endianness(), value_size_, value);
- entry_count_++;
- return *this;
- }
-
- // As above, but automatically add NAME to our StringAssembler.
- StabsAssembler &Stab(uint8_t type, uint8_t other, Label descriptor,
- Label value, const string &name) {
- return Stab(type, other, descriptor, value, string_assembler_->Add(name));
- }
-
- // Start a compilation unit named NAME, with an N_UNDF symbol to start
- // it, and its own portion of the string section. Return a reference to
- // this StabsAssembler.
- StabsAssembler &StartCU(const string &name) {
- assert(!cu_header_);
- cu_header_ = new CUHeader;
- string_assembler_->StartCU();
- entry_count_ = 0;
- return Stab(N_UNDF, 0,
- cu_header_->final_entry_count,
- cu_header_->final_string_size,
- string_assembler_->Add(name));
- }
-
- // Close off the current compilation unit. Return a reference to this
- // StabsAssembler.
- StabsAssembler &EndCU() {
- assert(cu_header_);
- cu_header_->final_entry_count = entry_count_;
- cu_header_->final_string_size = string_assembler_->EndCU();
- delete cu_header_;
- cu_header_ = NULL;
- return *this;
- }
-
- private:
- // Data used in a compilation unit header STAB that we won't know until
- // we've finished the compilation unit.
- struct CUHeader {
- // The final number of entries this compilation unit will hold.
- Label final_entry_count;
-
- // The final size of this compilation unit's strings.
- Label final_string_size;
- };
-
- // The strings for our STABS entries.
- StringAssembler *string_assembler_;
-
- // The size of the 'value' field of stabs entries in this section.
- size_t value_size_;
-
- // The number of entries in this compilation unit so far.
- size_t entry_count_;
-
- // Header labels for this compilation unit, if we've started one but not
- // finished it.
- CUHeader *cu_header_;
-};
-
-class MockStabsReaderHandler: public StabsHandler {
- public:
- MOCK_METHOD3(StartCompilationUnit,
- bool(const char *, uint64_t, const char *));
- MOCK_METHOD1(EndCompilationUnit, bool(uint64_t));
- MOCK_METHOD2(StartFunction, bool(const string &, uint64_t));
- MOCK_METHOD1(EndFunction, bool(uint64_t));
- MOCK_METHOD3(Line, bool(uint64_t, const char *, int));
- MOCK_METHOD2(Extern, bool(const string &, uint64_t));
- void Warning(const char *format, ...) { MockWarning(format); }
- MOCK_METHOD1(MockWarning, void(const char *));
-};
-
-struct StabsFixture {
- StabsFixture() : stabs(&strings), unitized(true) { }
-
- // Create a StabsReader to parse the mock stabs data in stabs and
- // strings, and pass the parsed information to mock_handler. Use the
- // endianness and value size of stabs to parse the data. If all goes
- // well, return the result of calling the reader's Process member
- // function. Otherwise, return false.
- bool ApplyHandlerToMockStabsData() {
- string stabs_contents, stabstr_contents;
- if (!stabs.GetContents(&stabs_contents) ||
- !strings.GetContents(&stabstr_contents))
- return false;
-
- // Run the parser on the test input, passing whatever we find to HANDLER.
- StabsReader reader(
- reinterpret_cast<const uint8_t *>(stabs_contents.data()),
- stabs_contents.size(),
- reinterpret_cast<const uint8_t *>(stabstr_contents.data()),
- stabstr_contents.size(),
- stabs.endianness() == kBigEndian, stabs.value_size(), unitized,
- &mock_handler);
- return reader.Process();
- }
-
- StringAssembler strings;
- StabsAssembler stabs;
- bool unitized;
- MockStabsReaderHandler mock_handler;
-};
-
-class Stabs: public StabsFixture, public Test { };
-
-TEST_F(Stabs, MockStabsInput) {
- stabs.set_endianness(kLittleEndian);
- stabs.set_value_size(4);
- stabs
- .Stab(N_SO, 149, 40232, 0x18a2a72bU, "builddir/")
- .Stab(N_FUN, 83, 50010, 0x91a5353fU,
- "not the SO with source file name we expected ")
- .Stab(N_SO, 165, 24791, 0xfe69d23cU, "")
- .Stab(N_SO, 184, 34178, 0xca4d883aU, "builddir1/")
- .Stab(N_SO, 83, 40859, 0xd2fe5df3U, "file1.c")
- .Stab(N_LSYM, 147, 39565, 0x60d4bb8aU, "not the FUN we're looking for")
- .Stab(N_FUN, 120, 50271, 0xa049f4b1U, "fun1")
- .Stab(N_BINCL, 150, 15694, 0xef65c659U,
- "something to ignore in a FUN body")
- .Stab(N_SLINE, 147, 4967, 0xd904b3f, "")
- .Stab(N_SOL, 177, 56135, 0xbd97b1dcU, "header.h")
- .Stab(N_SLINE, 130, 24610, 0x90f145b, "")
- .Stab(N_FUN, 45, 32441, 0xbf27cf93U,
- "fun2:some stabs type info here:to trim from the name")
- .Stab(N_SLINE, 138, 39002, 0x8148b87, "")
- .Stab(N_SOL, 60, 49318, 0x1d06e025U, "file1.c")
- .Stab(N_SLINE, 29, 52163, 0x6eebbb7, "")
- .Stab(N_SO, 167, 4647, 0xd04b7448U, "")
- .Stab(N_LSYM, 58, 37837, 0xe6b14d37U, "")
- .Stab(N_SO, 152, 7810, 0x11759f10U, "file3.c")
- .Stab(N_SO, 218, 12447, 0x11cfe4b5U, "");
-
- {
- InSequence s;
-
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("file1.c"), 0xd2fe5df3U,
- StrEq("builddir1/")))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, StartFunction(StrEq("fun1"), 0xa049f4b1U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Line(0xa049f4b1U + 0xd904b3f, StrEq("file1.c"), 4967))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Line(0xa049f4b1U + 0x90f145b, StrEq("header.h"), 24610))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xbf27cf93U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, StartFunction(StrEq("fun2"), 0xbf27cf93U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Line(0xbf27cf93U + 0x8148b87, StrEq("header.h"), 39002))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Line(0xbf27cf93U + 0x6eebbb7, StrEq("file1.c"), 52163))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xd04b7448U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0xd04b7448U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, StartCompilationUnit(StrEq("file3.c"),
- 0x11759f10U, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0x11cfe4b5U))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-TEST_F(Stabs, AbruptCU) {
- stabs.set_endianness(kBigEndian);
- stabs.set_value_size(4);
- stabs.Stab(N_SO, 177, 23446, 0xbf10d5e4, "file2-1.c");
-
- {
- InSequence s;
-
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("file2-1.c"), 0xbf10d5e4, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-TEST_F(Stabs, AbruptFunction) {
- stabs.set_endianness(kLittleEndian);
- stabs.set_value_size(8);
- stabs
- .Stab(N_SO, 218, 26631, 0xb83ddf10U, "file3-1.c")
- .Stab(N_FUN, 113, 24765, 0xbbd4a145U, "fun3_1");
-
- {
- InSequence s;
-
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("file3-1.c"), 0xb83ddf10U, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, StartFunction(StrEq("fun3_1"), 0xbbd4a145U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-TEST_F(Stabs, NoCU) {
- stabs.set_endianness(kBigEndian);
- stabs.set_value_size(8);
- stabs.Stab(N_SO, 161, 25673, 0x8f676e7bU, "build-directory/");
-
- EXPECT_CALL(mock_handler, StartCompilationUnit(_, _, _))
- .Times(0);
- EXPECT_CALL(mock_handler, StartFunction(_, _))
- .Times(0);
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-TEST_F(Stabs, NoCUEnd) {
- stabs.set_endianness(kBigEndian);
- stabs.set_value_size(8);
- stabs
- .Stab(N_SO, 116, 58280, 0x2f7493c9U, "file5-1.c")
- .Stab(N_SO, 224, 23057, 0xf9f1d50fU, "file5-2.c");
-
- {
- InSequence s;
-
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("file5-1.c"), 0x2f7493c9U, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("file5-2.c"), 0xf9f1d50fU, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-// On systems that store STABS in sections, string offsets are relative to
-// the beginning of that compilation unit's strings, marked with N_UNDF
-// symbols; see the comments for StabsReader::StabsReader.
-TEST_F(Stabs, Unitized) {
- stabs.set_endianness(kBigEndian);
- stabs.set_value_size(4);
- stabs
- .StartCU("antimony")
- .Stab(N_SO, 49, 26043, 0x7e259f1aU, "antimony")
- .Stab(N_FUN, 101, 63253, 0x7fbcccaeU, "arsenic")
- .Stab(N_SO, 124, 37175, 0x80b0014cU, "")
- .EndCU()
- .StartCU("aluminum")
- .Stab(N_SO, 72, 23084, 0x86756839U, "aluminum")
- .Stab(N_FUN, 59, 3305, 0xa8e120b0U, "selenium")
- .Stab(N_SO, 178, 56949, 0xbffff983U, "")
- .EndCU();
-
- {
- InSequence s;
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("antimony"), 0x7e259f1aU, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, StartFunction(Eq("arsenic"), 0x7fbcccaeU))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0x80b0014cU))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0x80b0014cU))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("aluminum"), 0x86756839U, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, StartFunction(Eq("selenium"), 0xa8e120b0U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xbffff983U))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0xbffff983U))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-// On systems that store STABS entries in the real symbol table, the N_UNDF
-// entries have no special meaning, and shouldn't mess up the string
-// indices.
-TEST_F(Stabs, NonUnitized) {
- stabs.set_endianness(kLittleEndian);
- stabs.set_value_size(4);
- unitized = false;
- stabs
- .Stab(N_UNDF, 21, 11551, 0x9bad2b2e, "")
- .Stab(N_UNDF, 21, 11551, 0x9bad2b2e, "")
- .Stab(N_SO, 71, 45139, 0x11a97352, "Tanzania")
- .Stab(N_SO, 221, 41976, 0x21a97352, "");
-
- {
- InSequence s;
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("Tanzania"),
- 0x11a97352, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0x21a97352))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-TEST_F(Stabs, FunctionEnd) {
- stabs.set_endianness(kLittleEndian);
- stabs.set_value_size(8);
- stabs
- .Stab(N_SO, 102, 62362, 0x52a830d644cd6942ULL, "compilation unit")
- // This function is terminated by the start of the next function.
- .Stab(N_FUN, 216, 38405, 0xbb5ab70ecdd23bfeULL, "function 1")
- // This function is terminated by an explicit end-of-function stab,
- // whose value is a size in bytes.
- .Stab(N_FUN, 240, 10973, 0xc954de9b8fb3e5e2ULL, "function 2")
- .Stab(N_FUN, 14, 36749, 0xc1ab, "")
- // This function is terminated by the end of the compilation unit.
- .Stab(N_FUN, 143, 64514, 0xdff98c9a35386e1fULL, "function 3")
- .Stab(N_SO, 164, 60142, 0xfdacb856e78bbf57ULL, "");
-
- {
- InSequence s;
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("compilation unit"),
- 0x52a830d644cd6942ULL, NULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- StartFunction(Eq("function 1"), 0xbb5ab70ecdd23bfeULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xc954de9b8fb3e5e2ULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- StartFunction(Eq("function 2"), 0xc954de9b8fb3e5e2ULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xc954de9b8fb3e5e2ULL + 0xc1ab))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- StartFunction(Eq("function 3"), 0xdff98c9a35386e1fULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xfdacb856e78bbf57ULL))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0xfdacb856e78bbf57ULL))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-// On Mac OS X, SLINE records can appear before the FUN stab to which they
-// belong, and their values are absolute addresses, not offsets.
-TEST_F(Stabs, LeadingLine) {
- stabs.set_endianness(kBigEndian);
- stabs.set_value_size(4);
- stabs
- .Stab(N_SO, 179, 27357, 0x8adabc15, "build directory/")
- .Stab(N_SO, 52, 53058, 0x4c7e3bf4, "compilation unit")
- .Stab(N_SOL, 165, 12086, 0x6a797ca3, "source file name")
- .Stab(N_SLINE, 229, 20015, 0x4cb3d7e0, "")
- .Stab(N_SLINE, 89, 43802, 0x4cba8b88, "")
- .Stab(N_FUN, 251, 51639, 0xce1b98fa, "rutabaga")
- .Stab(N_FUN, 218, 16113, 0x5798, "")
- .Stab(N_SO, 52, 53058, 0xd4af4415, "");
-
- {
- InSequence s;
- EXPECT_CALL(mock_handler,
- StartCompilationUnit(StrEq("compilation unit"),
- 0x4c7e3bf4, StrEq("build directory/")))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- StartFunction(Eq("rutabaga"), 0xce1b98fa))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Line(0x4cb3d7e0, StrEq("source file name"), 20015))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Line(0x4cba8b88, StrEq("source file name"), 43802))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndFunction(0xce1b98fa + 0x5798))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler, EndCompilationUnit(0xd4af4415))
- .WillOnce(Return(true));
- }
-
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-
-#if defined(HAVE_MACH_O_NLIST_H)
-// These tests have no meaning on non-Mach-O-based systems, as
-// only Mach-O uses N_SECT to represent public symbols.
-TEST_F(Stabs, OnePublicSymbol) {
- stabs.set_endianness(kLittleEndian);
- stabs.set_value_size(4);
-
- const uint32_t kExpectedAddress = 0x9000;
- const string kExpectedFunctionName("public_function");
- stabs
- .Stab(N_SECT, 1, 0, kExpectedAddress, kExpectedFunctionName);
-
- {
- InSequence s;
- EXPECT_CALL(mock_handler,
- Extern(StrEq(kExpectedFunctionName),
- kExpectedAddress))
- .WillOnce(Return(true));
- }
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-TEST_F(Stabs, TwoPublicSymbols) {
- stabs.set_endianness(kLittleEndian);
- stabs.set_value_size(4);
-
- const uint32_t kExpectedAddress1 = 0xB0B0B0B0;
- const string kExpectedFunctionName1("public_function");
- const uint32_t kExpectedAddress2 = 0xF0F0F0F0;
- const string kExpectedFunctionName2("something else");
- stabs
- .Stab(N_SECT, 1, 0, kExpectedAddress1, kExpectedFunctionName1)
- .Stab(N_SECT, 1, 0, kExpectedAddress2, kExpectedFunctionName2);
-
- {
- InSequence s;
- EXPECT_CALL(mock_handler,
- Extern(StrEq(kExpectedFunctionName1),
- kExpectedAddress1))
- .WillOnce(Return(true));
- EXPECT_CALL(mock_handler,
- Extern(StrEq(kExpectedFunctionName2),
- kExpectedAddress2))
- .WillOnce(Return(true));
- }
- ASSERT_TRUE(ApplyHandlerToMockStabsData());
-}
-
-#endif
-
-} // anonymous namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc
deleted file mode 100644
index 0a83cf21cb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dump_stabs.cc --- implement the StabsToModule class.
-
-#include <assert.h>
-#include <cxxabi.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#include <algorithm>
-
-#include "common/stabs_to_module.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// Demangle using abi call.
-// Older GCC may not support it.
-static string Demangle(const string &mangled) {
- int status = 0;
- char *demangled = abi::__cxa_demangle(mangled.c_str(), NULL, NULL, &status);
- if (status == 0 && demangled != NULL) {
- string str(demangled);
- free(demangled);
- return str;
- }
- return string(mangled);
-}
-
-StabsToModule::~StabsToModule() {
- // Free any functions we've accumulated but not added to the module.
- for (vector<Module::Function *>::const_iterator func_it = functions_.begin();
- func_it != functions_.end(); func_it++)
- delete *func_it;
- // Free any function that we're currently within.
- delete current_function_;
-}
-
-bool StabsToModule::StartCompilationUnit(const char *name, uint64_t address,
- const char *build_directory) {
- assert(!in_compilation_unit_);
- in_compilation_unit_ = true;
- current_source_file_name_ = name;
- current_source_file_ = module_->FindFile(name);
- comp_unit_base_address_ = address;
- boundaries_.push_back(static_cast<Module::Address>(address));
- return true;
-}
-
-bool StabsToModule::EndCompilationUnit(uint64_t address) {
- assert(in_compilation_unit_);
- in_compilation_unit_ = false;
- comp_unit_base_address_ = 0;
- current_source_file_ = NULL;
- current_source_file_name_ = NULL;
- if (address)
- boundaries_.push_back(static_cast<Module::Address>(address));
- return true;
-}
-
-bool StabsToModule::StartFunction(const string &name,
- uint64_t address) {
- assert(!current_function_);
- Module::Function *f = new Module::Function(Demangle(name), address);
- f->size = 0; // We compute this in StabsToModule::Finalize().
- f->parameter_size = 0; // We don't provide this information.
- current_function_ = f;
- boundaries_.push_back(static_cast<Module::Address>(address));
- return true;
-}
-
-bool StabsToModule::EndFunction(uint64_t address) {
- assert(current_function_);
- // Functions in this compilation unit should have address bigger
- // than the compilation unit's starting address. There may be a lot
- // of duplicated entries for functions in the STABS data. We will
- // count on the Module to remove the duplicates.
- if (current_function_->address >= comp_unit_base_address_)
- functions_.push_back(current_function_);
- else
- delete current_function_;
- current_function_ = NULL;
- if (address)
- boundaries_.push_back(static_cast<Module::Address>(address));
- return true;
-}
-
-bool StabsToModule::Line(uint64_t address, const char *name, int number) {
- assert(current_function_);
- assert(current_source_file_);
- if (name != current_source_file_name_) {
- current_source_file_ = module_->FindFile(name);
- current_source_file_name_ = name;
- }
- Module::Line line;
- line.address = address;
- line.size = 0; // We compute this in StabsToModule::Finalize().
- line.file = current_source_file_;
- line.number = number;
- current_function_->lines.push_back(line);
- return true;
-}
-
-bool StabsToModule::Extern(const string &name, uint64_t address) {
- Module::Extern *ext = new Module::Extern(address);
- // Older libstdc++ demangle implementations can crash on unexpected
- // input, so be careful about what gets passed in.
- if (name.compare(0, 3, "__Z") == 0) {
- ext->name = Demangle(name.substr(1));
- } else if (name[0] == '_') {
- ext->name = name.substr(1);
- } else {
- ext->name = name;
- }
- module_->AddExtern(ext);
- return true;
-}
-
-void StabsToModule::Warning(const char *format, ...) {
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
-}
-
-void StabsToModule::Finalize() {
- // Sort our boundary list, so we can search it quickly.
- sort(boundaries_.begin(), boundaries_.end());
- // Sort all functions by address, just for neatness.
- sort(functions_.begin(), functions_.end(),
- Module::Function::CompareByAddress);
-
- for (vector<Module::Function *>::const_iterator func_it = functions_.begin();
- func_it != functions_.end();
- func_it++) {
- Module::Function *f = *func_it;
- // Compute the function f's size.
- vector<Module::Address>::const_iterator boundary
- = std::upper_bound(boundaries_.begin(), boundaries_.end(), f->address);
- if (boundary != boundaries_.end())
- f->size = *boundary - f->address;
- else
- // If this is the last function in the module, and the STABS
- // reader was unable to give us its ending address, then assign
- // it a bogus, very large value. This will happen at most once
- // per module: since we've added all functions' addresses to the
- // boundary table, only one can be the last.
- f->size = kFallbackSize;
-
- // Compute sizes for each of the function f's lines --- if it has any.
- if (!f->lines.empty()) {
- stable_sort(f->lines.begin(), f->lines.end(),
- Module::Line::CompareByAddress);
- vector<Module::Line>::iterator last_line = f->lines.end() - 1;
- for (vector<Module::Line>::iterator line_it = f->lines.begin();
- line_it != last_line; line_it++)
- line_it[0].size = line_it[1].address - line_it[0].address;
- // Compute the size of the last line from f's end address.
- last_line->size = (f->address + f->size) - last_line->address;
- }
- }
- // Now that everything has a size, add our functions to the module, and
- // dispose of our private list.
- module_->AddFunctions(functions_.begin(), functions_.end());
- functions_.clear();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.h b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.h
deleted file mode 100644
index 5e04fa7927..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module.h
+++ /dev/null
@@ -1,143 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dump_stabs.h: Define the StabsToModule class, which receives
-// STABS debugging information from a parser and adds it to a Breakpad
-// symbol file.
-
-#ifndef BREAKPAD_COMMON_STABS_TO_MODULE_H_
-#define BREAKPAD_COMMON_STABS_TO_MODULE_H_
-
-#include <stdint.h>
-
-#include <string>
-#include <vector>
-
-#include "common/module.h"
-#include "common/stabs_reader.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using std::vector;
-
-// A StabsToModule is a handler that receives parsed STABS debugging
-// information from a StabsReader, and uses that to populate
-// a Module. (All classes are in the google_breakpad namespace.) A
-// Module represents the contents of a Breakpad symbol file, and knows
-// how to write itself out as such. A StabsToModule thus acts as
-// the bridge between STABS and Breakpad data.
-// When processing Darwin Mach-O files, this also receives public linker
-// symbols, like those found in system libraries.
-class StabsToModule: public google_breakpad::StabsHandler {
- public:
- // Receive parsed debugging information from a StabsReader, and
- // store it all in MODULE.
- StabsToModule(Module *module) :
- module_(module),
- in_compilation_unit_(false),
- comp_unit_base_address_(0),
- current_function_(NULL),
- current_source_file_(NULL),
- current_source_file_name_(NULL) { }
- ~StabsToModule();
-
- // The standard StabsHandler virtual member functions.
- bool StartCompilationUnit(const char *name, uint64_t address,
- const char *build_directory);
- bool EndCompilationUnit(uint64_t address);
- bool StartFunction(const string &name, uint64_t address);
- bool EndFunction(uint64_t address);
- bool Line(uint64_t address, const char *name, int number);
- bool Extern(const string &name, uint64_t address);
- void Warning(const char *format, ...);
-
- // Do any final processing necessary to make module_ contain all the
- // data provided by the STABS reader.
- //
- // Because STABS does not provide reliable size information for
- // functions and lines, we need to make a pass over the data after
- // processing all the STABS to compute those sizes. We take care of
- // that here.
- void Finalize();
-
- private:
-
- // An arbitrary, but very large, size to use for functions whose
- // size we can't compute properly.
- static const uint64_t kFallbackSize = 0x10000000;
-
- // The module we're contributing debugging info to.
- Module *module_;
-
- // The functions we've generated so far. We don't add these to
- // module_ as we parse them. Instead, we wait until we've computed
- // their ending address, and their lines' ending addresses.
- //
- // We could just stick them in module_ from the outset, but if
- // module_ already contains data gathered from other debugging
- // formats, that would complicate the size computation.
- vector<Module::Function *> functions_;
-
- // Boundary addresses. STABS doesn't necessarily supply sizes for
- // functions and lines, so we need to compute them ourselves by
- // finding the next object.
- vector<Module::Address> boundaries_;
-
- // True if we are currently within a compilation unit: we have gotten a
- // StartCompilationUnit call, but no matching EndCompilationUnit call
- // yet. We use this for sanity checks.
- bool in_compilation_unit_;
-
- // The base address of the current compilation unit. We use this to
- // recognize functions we should omit from the symbol file. (If you
- // know the details of why we omit these, please patch this
- // comment.)
- Module::Address comp_unit_base_address_;
-
- // The function we're currently contributing lines to.
- Module::Function *current_function_;
-
- // The last Module::File we got a line number in.
- Module::File *current_source_file_;
-
- // The pointer in the .stabstr section of the name that
- // current_source_file_ is built from. This allows us to quickly
- // recognize when the current line is in the same file as the
- // previous one (which it usually is).
- const char *current_source_file_name_;
-};
-
-} // namespace google_breakpad
-
-#endif // BREAKPAD_COMMON_STABS_TO_MODULE_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc
deleted file mode 100644
index d445d1d64b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stabs_to_module_unittest.cc
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// dump_stabs_unittest.cc: Unit tests for StabsToModule.
-
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/stabs_to_module.h"
-
-using google_breakpad::Module;
-using google_breakpad::StabsToModule;
-using std::vector;
-
-TEST(StabsToModule, SimpleCU) {
- Module m("name", "os", "arch", "id");
- StabsToModule h(&m);
-
- // Feed in a simple compilation unit that defines a function with
- // one line.
- EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0x9f4d1271e50db93bLL,
- "build-directory"));
- EXPECT_TRUE(h.StartFunction("function", 0xfde4abbed390c394LL));
- EXPECT_TRUE(h.Line(0xfde4abbed390c394LL, "source-file-name", 174823314));
- EXPECT_TRUE(h.EndFunction(0xfde4abbed390c3a4LL));
- EXPECT_TRUE(h.EndCompilationUnit(0xfee4abbed390c3a4LL));
- h.Finalize();
-
- // Now check to see what has been added to the Module.
- Module::File *file = m.FindExistingFile("source-file-name");
- ASSERT_TRUE(file != NULL);
-
- vector<Module::Function *> functions;
- m.GetFunctions(&functions, functions.end());
- ASSERT_EQ((size_t) 1, functions.size());
- Module::Function *function = functions[0];
- EXPECT_STREQ("function", function->name.c_str());
- EXPECT_EQ(0xfde4abbed390c394LL, function->address);
- EXPECT_EQ(0x10U, function->size);
- EXPECT_EQ(0U, function->parameter_size);
- ASSERT_EQ((size_t) 1, function->lines.size());
- Module::Line *line = &function->lines[0];
- EXPECT_EQ(0xfde4abbed390c394LL, line->address);
- EXPECT_EQ(0x10U, line->size); // derived from EndFunction
- EXPECT_TRUE(line->file == file);
- EXPECT_EQ(174823314, line->number);
-}
-
-#ifdef __GNUC__
-// Function name mangling can vary by compiler, so only run mangled-name
-// tests on GCC for simplicity's sake.
-TEST(StabsToModule, Externs) {
- Module m("name", "os", "arch", "id");
- StabsToModule h(&m);
-
- // Feed in a few Extern symbols.
- EXPECT_TRUE(h.Extern("_foo", 0xffff));
- EXPECT_TRUE(h.Extern("__Z21dyldGlobalLockAcquirev", 0xaaaa));
- EXPECT_TRUE(h.Extern("_MorphTableGetNextMorphChain", 0x1111));
- h.Finalize();
-
- // Now check to see what has been added to the Module.
- vector<Module::Extern *> externs;
- m.GetExterns(&externs, externs.end());
- ASSERT_EQ((size_t) 3, externs.size());
- Module::Extern *extern1 = externs[0];
- EXPECT_STREQ("MorphTableGetNextMorphChain", extern1->name.c_str());
- EXPECT_EQ((Module::Address)0x1111, extern1->address);
- Module::Extern *extern2 = externs[1];
- EXPECT_STREQ("dyldGlobalLockAcquire()", extern2->name.c_str());
- EXPECT_EQ((Module::Address)0xaaaa, extern2->address);
- Module::Extern *extern3 = externs[2];
- EXPECT_STREQ("foo", extern3->name.c_str());
- EXPECT_EQ((Module::Address)0xffff, extern3->address);
-}
-#endif // __GNUC__
-
-TEST(StabsToModule, DuplicateFunctionNames) {
- Module m("name", "os", "arch", "id");
- StabsToModule h(&m);
-
- // Compilation unit with one function, mangled name.
- EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0xf2cfda36ecf7f46cLL,
- "build-directory"));
- EXPECT_TRUE(h.StartFunction("funcfoo",
- 0xf2cfda36ecf7f46dLL));
- EXPECT_TRUE(h.EndFunction(0));
- EXPECT_TRUE(h.StartFunction("funcfoo",
- 0xf2cfda36ecf7f46dLL));
- EXPECT_TRUE(h.EndFunction(0));
- EXPECT_TRUE(h.EndCompilationUnit(0));
-
- h.Finalize();
-
- // Now check to see what has been added to the Module.
- Module::File *file = m.FindExistingFile("compilation-unit");
- ASSERT_TRUE(file != NULL);
-
- vector<Module::Function *> functions;
- m.GetFunctions(&functions, functions.end());
- ASSERT_EQ(1U, functions.size());
-
- Module::Function *function = functions[0];
- EXPECT_EQ(0xf2cfda36ecf7f46dLL, function->address);
- EXPECT_LT(0U, function->size); // should have used dummy size
- EXPECT_EQ(0U, function->parameter_size);
- ASSERT_EQ(0U, function->lines.size());
-}
-
-TEST(InferSizes, LineSize) {
- Module m("name", "os", "arch", "id");
- StabsToModule h(&m);
-
- // Feed in a simple compilation unit that defines a function with
- // one line.
- EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0xb4513962eff94e92LL,
- "build-directory"));
- EXPECT_TRUE(h.StartFunction("function", 0xb4513962eff94e92LL));
- EXPECT_TRUE(h.Line(0xb4513962eff94e92LL, "source-file-name-1", 77396614));
- EXPECT_TRUE(h.Line(0xb4513963eff94e92LL, "source-file-name-2", 87660088));
- EXPECT_TRUE(h.EndFunction(0)); // unknown function end address
- EXPECT_TRUE(h.EndCompilationUnit(0)); // unknown CU end address
- EXPECT_TRUE(h.StartCompilationUnit("compilation-unit-2", 0xb4523963eff94e92LL,
- "build-directory-2")); // next boundary
- EXPECT_TRUE(h.EndCompilationUnit(0));
- h.Finalize();
-
- // Now check to see what has been added to the Module.
- Module::File *file1 = m.FindExistingFile("source-file-name-1");
- ASSERT_TRUE(file1 != NULL);
- Module::File *file2 = m.FindExistingFile("source-file-name-2");
- ASSERT_TRUE(file2 != NULL);
-
- vector<Module::Function *> functions;
- m.GetFunctions(&functions, functions.end());
- ASSERT_EQ((size_t) 1, functions.size());
-
- Module::Function *function = functions[0];
- EXPECT_STREQ("function", function->name.c_str());
- EXPECT_EQ(0xb4513962eff94e92LL, function->address);
- EXPECT_EQ(0x1000100000000ULL, function->size); // inferred from CU end
- EXPECT_EQ(0U, function->parameter_size);
- ASSERT_EQ((size_t) 2, function->lines.size());
-
- Module::Line *line1 = &function->lines[0];
- EXPECT_EQ(0xb4513962eff94e92LL, line1->address);
- EXPECT_EQ(0x100000000ULL, line1->size); // derived from EndFunction
- EXPECT_TRUE(line1->file == file1);
- EXPECT_EQ(77396614, line1->number);
-
- Module::Line *line2 = &function->lines[1];
- EXPECT_EQ(0xb4513963eff94e92LL, line2->address);
- EXPECT_EQ(0x1000000000000ULL, line2->size); // derived from EndFunction
- EXPECT_TRUE(line2->file == file2);
- EXPECT_EQ(87660088, line2->number);
-}
-
-#ifdef __GNUC__
-// Function name mangling can vary by compiler, so only run mangled-name
-// tests on GCC for simplicity's sake.
-TEST(FunctionNames, Mangled) {
- Module m("name", "os", "arch", "id");
- StabsToModule h(&m);
-
- // Compilation unit with one function, mangled name.
- EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0xf2cfda63cef7f46cLL,
- "build-directory"));
- EXPECT_TRUE(h.StartFunction("_ZNSt6vectorIySaIyEE9push_backERKy",
- 0xf2cfda63cef7f46dLL));
- EXPECT_TRUE(h.EndFunction(0));
- EXPECT_TRUE(h.EndCompilationUnit(0));
-
- h.Finalize();
-
- // Now check to see what has been added to the Module.
- Module::File *file = m.FindExistingFile("compilation-unit");
- ASSERT_TRUE(file != NULL);
-
- vector<Module::Function *> functions;
- m.GetFunctions(&functions, functions.end());
- ASSERT_EQ(1U, functions.size());
-
- Module::Function *function = functions[0];
- // This is GCC-specific, but we shouldn't be seeing STABS data anywhere
- // but Linux.
- EXPECT_STREQ("std::vector<unsigned long long, "
- "std::allocator<unsigned long long> >::"
- "push_back(unsigned long long const&)",
- function->name.c_str());
- EXPECT_EQ(0xf2cfda63cef7f46dLL, function->address);
- EXPECT_LT(0U, function->size); // should have used dummy size
- EXPECT_EQ(0U, function->parameter_size);
- ASSERT_EQ(0U, function->lines.size());
-}
-#endif // __GNUC__
-
-// The GNU toolchain can omit functions that are not used; however,
-// when it does so, it doesn't clean up the debugging information that
-// refers to them. In STABS, this results in compilation units whose
-// SO addresses are zero.
-TEST(Omitted, Function) {
- Module m("name", "os", "arch", "id");
- StabsToModule h(&m);
-
- // The StartCompilationUnit and EndCompilationUnit calls may both have an
- // address of zero if the compilation unit has had sections removed.
- EXPECT_TRUE(h.StartCompilationUnit("compilation-unit", 0, "build-directory"));
- EXPECT_TRUE(h.StartFunction("function", 0x2a133596));
- EXPECT_TRUE(h.EndFunction(0));
- EXPECT_TRUE(h.EndCompilationUnit(0));
-}
-
-// TODO --- if we actually cared about STABS. Even without these we've
-// got full coverage of non-failure source lines in dump_stabs.cc.
-
-// Line size from next line
-// Line size from function end
-// Line size from next function start
-// line size from cu end
-// line size from next cu start
-// fallback size is something plausible
-
-// function size from function end
-// function size from next function start
-// function size from cu end
-// function size from next cu start
-// fallback size is something plausible
-
-// omitting functions outside the compilation unit's address range
-// zero-line, one-line, many-line functions
diff --git a/toolkit/crashreporter/google-breakpad/src/common/stdio_wrapper.h b/toolkit/crashreporter/google-breakpad/src/common/stdio_wrapper.h
deleted file mode 100644
index a3dd50aab6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/stdio_wrapper.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2016, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_COMMON_STDIO_WRAPPER_H
-#define GOOGLE_BREAKPAD_COMMON_STDIO_WRAPPER_H
-
-#include <stdio.h>
-
-#if defined(_MSC_VER) && MSC_VER < 1900
-#include <basetsd.h>
-
-#define snprintf _snprintf
-typedef SSIZE_T ssize_t;
-#endif
-
-
-#endif // GOOGLE_BREAKPAD_COMMON_STDIO_WRAPPER_H
diff --git a/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc b/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc
deleted file mode 100644
index 9c0d623fc1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/string_conversion.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <string.h>
-
-#include "common/convert_UTF.h"
-#include "common/scoped_ptr.h"
-#include "common/string_conversion.h"
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using std::vector;
-
-void UTF8ToUTF16(const char *in, vector<uint16_t> *out) {
- size_t source_length = strlen(in);
- const UTF8 *source_ptr = reinterpret_cast<const UTF8 *>(in);
- const UTF8 *source_end_ptr = source_ptr + source_length;
- // Erase the contents and zero fill to the expected size
- out->clear();
- out->insert(out->begin(), source_length, 0);
- uint16_t *target_ptr = &(*out)[0];
- uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t);
- ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr,
- &target_ptr, target_end_ptr,
- strictConversion);
-
- // Resize to be the size of the # of converted characters + NULL
- out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0);
-}
-
-int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]) {
- const UTF8 *source_ptr = reinterpret_cast<const UTF8 *>(in);
- const UTF8 *source_end_ptr = source_ptr + sizeof(char);
- uint16_t *target_ptr = out;
- uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t);
- out[0] = out[1] = 0;
-
- // Process one character at a time
- while (1) {
- ConversionResult result = ConvertUTF8toUTF16(&source_ptr, source_end_ptr,
- &target_ptr, target_end_ptr,
- strictConversion);
-
- if (result == conversionOK)
- return static_cast<int>(source_ptr - reinterpret_cast<const UTF8 *>(in));
-
- // Add another character to the input stream and try again
- source_ptr = reinterpret_cast<const UTF8 *>(in);
- ++source_end_ptr;
-
- if (source_end_ptr > reinterpret_cast<const UTF8 *>(in) + in_length)
- break;
- }
-
- return 0;
-}
-
-void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out) {
- size_t source_length = wcslen(in);
- const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(in);
- const UTF32 *source_end_ptr = source_ptr + source_length;
- // Erase the contents and zero fill to the expected size
- out->clear();
- out->insert(out->begin(), source_length, 0);
- uint16_t *target_ptr = &(*out)[0];
- uint16_t *target_end_ptr = target_ptr + out->capacity() * sizeof(uint16_t);
- ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr,
- &target_ptr, target_end_ptr,
- strictConversion);
-
- // Resize to be the size of the # of converted characters + NULL
- out->resize(result == conversionOK ? target_ptr - &(*out)[0] + 1: 0);
-}
-
-void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]) {
- const UTF32 *source_ptr = reinterpret_cast<const UTF32 *>(&in);
- const UTF32 *source_end_ptr = source_ptr + 1;
- uint16_t *target_ptr = out;
- uint16_t *target_end_ptr = target_ptr + 2 * sizeof(uint16_t);
- out[0] = out[1] = 0;
- ConversionResult result = ConvertUTF32toUTF16(&source_ptr, source_end_ptr,
- &target_ptr, target_end_ptr,
- strictConversion);
-
- if (result != conversionOK) {
- out[0] = out[1] = 0;
- }
-}
-
-static inline uint16_t Swap(uint16_t value) {
- return (value >> 8) | static_cast<uint16_t>(value << 8);
-}
-
-string UTF16ToUTF8(const vector<uint16_t> &in, bool swap) {
- const UTF16 *source_ptr = &in[0];
- scoped_array<uint16_t> source_buffer;
-
- // If we're to swap, we need to make a local copy and swap each byte pair
- if (swap) {
- int idx = 0;
- source_buffer.reset(new uint16_t[in.size()]);
- UTF16 *source_buffer_ptr = source_buffer.get();
- for (vector<uint16_t>::const_iterator it = in.begin();
- it != in.end(); ++it, ++idx)
- source_buffer_ptr[idx] = Swap(*it);
-
- source_ptr = source_buffer.get();
- }
-
- // The maximum expansion would be 4x the size of the input string.
- const UTF16 *source_end_ptr = source_ptr + in.size();
- size_t target_capacity = in.size() * 4;
- scoped_array<UTF8> target_buffer(new UTF8[target_capacity]);
- UTF8 *target_ptr = target_buffer.get();
- UTF8 *target_end_ptr = target_ptr + target_capacity;
- ConversionResult result = ConvertUTF16toUTF8(&source_ptr, source_end_ptr,
- &target_ptr, target_end_ptr,
- strictConversion);
-
- if (result == conversionOK) {
- const char *targetPtr = reinterpret_cast<const char *>(target_buffer.get());
- return targetPtr;
- }
-
- return "";
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/string_conversion.h b/toolkit/crashreporter/google-breakpad/src/common/string_conversion.h
deleted file mode 100644
index b9ba96a2e1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/string_conversion.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// string_conversion.h: Conversion between different UTF-8/16/32 encodings.
-
-#ifndef COMMON_STRING_CONVERSION_H__
-#define COMMON_STRING_CONVERSION_H__
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-using std::vector;
-
-// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the
-// conversion failed, |out| will be zero length.
-void UTF8ToUTF16(const char *in, vector<uint16_t> *out);
-
-// Convert at least one character (up to a maximum of |in_length|) from |in|
-// to UTF-16 into |out|. Return the number of characters consumed from |in|.
-// Any unused characters in |out| will be initialized to 0. No memory will
-// be allocated by this routine.
-int UTF8ToUTF16Char(const char *in, int in_length, uint16_t out[2]);
-
-// Convert |in| to UTF-16 into |out|. Use platform byte ordering. If the
-// conversion failed, |out| will be zero length.
-void UTF32ToUTF16(const wchar_t *in, vector<uint16_t> *out);
-
-// Convert |in| to UTF-16 into |out|. Any unused characters in |out| will be
-// initialized to 0. No memory will be allocated by this routine.
-void UTF32ToUTF16Char(wchar_t in, uint16_t out[2]);
-
-// Convert |in| to UTF-8. If |swap| is true, swap bytes before converting.
-string UTF16ToUTF8(const vector<uint16_t> &in, bool swap);
-
-} // namespace google_breakpad
-
-#endif // COMMON_STRING_CONVERSION_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/common/symbol_data.h b/toolkit/crashreporter/google-breakpad/src/common/symbol_data.h
deleted file mode 100644
index 2cf15a855d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/symbol_data.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef COMMON_SYMBOL_DATA_H_
-#define COMMON_SYMBOL_DATA_H_
-
-// Control what data is used from the symbol file.
-enum SymbolData {
- ALL_SYMBOL_DATA,
- NO_CFI,
- ONLY_CFI
-};
-
-#endif // COMMON_SYMBOL_DATA_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc b/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc
deleted file mode 100644
index 1e783b45c5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/test_assembler.cc
+++ /dev/null
@@ -1,359 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// test_assembler.cc: Implementation of google_breakpad::TestAssembler.
-// See test_assembler.h for details.
-
-#include "common/test_assembler.h"
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <iterator>
-
-namespace google_breakpad {
-namespace test_assembler {
-
-using std::back_insert_iterator;
-
-Label::Label() : value_(new Binding()) { }
-Label::Label(uint64_t value) : value_(new Binding(value)) { }
-Label::Label(const Label &label) {
- value_ = label.value_;
- value_->Acquire();
-}
-Label::~Label() {
- if (value_->Release()) delete value_;
-}
-
-Label &Label::operator=(uint64_t value) {
- value_->Set(NULL, value);
- return *this;
-}
-
-Label &Label::operator=(const Label &label) {
- value_->Set(label.value_, 0);
- return *this;
-}
-
-Label Label::operator+(uint64_t addend) const {
- Label l;
- l.value_->Set(this->value_, addend);
- return l;
-}
-
-Label Label::operator-(uint64_t subtrahend) const {
- Label l;
- l.value_->Set(this->value_, -subtrahend);
- return l;
-}
-
-// When NDEBUG is #defined, assert doesn't evaluate its argument. This
-// means you can't simply use assert to check the return value of a
-// function with necessary side effects.
-//
-// ALWAYS_EVALUATE_AND_ASSERT(x) evaluates x regardless of whether
-// NDEBUG is #defined; when NDEBUG is not #defined, it further asserts
-// that x is true.
-#ifdef NDEBUG
-#define ALWAYS_EVALUATE_AND_ASSERT(x) x
-#else
-#define ALWAYS_EVALUATE_AND_ASSERT(x) assert(x)
-#endif
-
-uint64_t Label::operator-(const Label &label) const {
- uint64_t offset;
- ALWAYS_EVALUATE_AND_ASSERT(IsKnownOffsetFrom(label, &offset));
- return offset;
-}
-
-uint64_t Label::Value() const {
- uint64_t v = 0;
- ALWAYS_EVALUATE_AND_ASSERT(IsKnownConstant(&v));
- return v;
-};
-
-bool Label::IsKnownConstant(uint64_t *value_p) const {
- Binding *base;
- uint64_t addend;
- value_->Get(&base, &addend);
- if (base != NULL) return false;
- if (value_p) *value_p = addend;
- return true;
-}
-
-bool Label::IsKnownOffsetFrom(const Label &label, uint64_t *offset_p) const
-{
- Binding *label_base, *this_base;
- uint64_t label_addend, this_addend;
- label.value_->Get(&label_base, &label_addend);
- value_->Get(&this_base, &this_addend);
- // If this and label are related, Get will find their final
- // common ancestor, regardless of how indirect the relation is. This
- // comparison also handles the constant vs. constant case.
- if (this_base != label_base) return false;
- if (offset_p) *offset_p = this_addend - label_addend;
- return true;
-}
-
-Label::Binding::Binding() : base_(this), addend_(), reference_count_(1) { }
-
-Label::Binding::Binding(uint64_t addend)
- : base_(NULL), addend_(addend), reference_count_(1) { }
-
-Label::Binding::~Binding() {
- assert(reference_count_ == 0);
- if (base_ && base_ != this && base_->Release())
- delete base_;
-}
-
-void Label::Binding::Set(Binding *binding, uint64_t addend) {
- if (!base_ && !binding) {
- // We're equating two constants. This could be okay.
- assert(addend_ == addend);
- } else if (!base_) {
- // We are a known constant, but BINDING may not be, so turn the
- // tables and try to set BINDING's value instead.
- binding->Set(NULL, addend_ - addend);
- } else {
- if (binding) {
- // Find binding's final value. Since the final value is always either
- // completely unconstrained or a constant, never a reference to
- // another variable (otherwise, it wouldn't be final), this
- // guarantees we won't create cycles here, even for code like this:
- // l = m, m = n, n = l;
- uint64_t binding_addend;
- binding->Get(&binding, &binding_addend);
- addend += binding_addend;
- }
-
- // It seems likely that setting a binding to itself is a bug
- // (although I can imagine this might turn out to be helpful to
- // permit).
- assert(binding != this);
-
- if (base_ != this) {
- // Set the other bindings on our chain as well. Note that this
- // is sufficient even though binding relationships form trees:
- // All binding operations traverse their chains to the end, and
- // all bindings related to us share some tail of our chain, so
- // they will see the changes we make here.
- base_->Set(binding, addend - addend_);
- // We're not going to use base_ any more.
- if (base_->Release()) delete base_;
- }
-
- // Adopt BINDING as our base. Note that it should be correct to
- // acquire here, after the release above, even though the usual
- // reference-counting rules call for acquiring first, and then
- // releasing: the self-reference assertion above should have
- // complained if BINDING were 'this' or anywhere along our chain,
- // so we didn't release BINDING.
- if (binding) binding->Acquire();
- base_ = binding;
- addend_ = addend;
- }
-}
-
-void Label::Binding::Get(Binding **base, uint64_t *addend) {
- if (base_ && base_ != this) {
- // Recurse to find the end of our reference chain (the root of our
- // tree), and then rewrite every binding along the chain to refer
- // to it directly, adjusting addends appropriately. (This is why
- // this member function isn't this-const.)
- Binding *final_base;
- uint64_t final_addend;
- base_->Get(&final_base, &final_addend);
- if (final_base) final_base->Acquire();
- if (base_->Release()) delete base_;
- base_ = final_base;
- addend_ += final_addend;
- }
- *base = base_;
- *addend = addend_;
-}
-
-template<typename Inserter>
-static inline void InsertEndian(test_assembler::Endianness endianness,
- size_t size, uint64_t number, Inserter dest) {
- assert(size > 0);
- if (endianness == kLittleEndian) {
- for (size_t i = 0; i < size; i++) {
- *dest++ = (char) (number & 0xff);
- number >>= 8;
- }
- } else {
- assert(endianness == kBigEndian);
- // The loop condition is odd, but it's correct for size_t.
- for (size_t i = size - 1; i < size; i--)
- *dest++ = (char) ((number >> (i * 8)) & 0xff);
- }
-}
-
-Section &Section::Append(Endianness endianness, size_t size, uint64_t number) {
- InsertEndian(endianness, size, number,
- back_insert_iterator<string>(contents_));
- return *this;
-}
-
-Section &Section::Append(Endianness endianness, size_t size,
- const Label &label) {
- // If this label's value is known, there's no reason to waste an
- // entry in references_ on it.
- uint64_t value;
- if (label.IsKnownConstant(&value))
- return Append(endianness, size, value);
-
- // This will get caught when the references are resolved, but it's
- // nicer to find out earlier.
- assert(endianness != kUnsetEndian);
-
- references_.push_back(Reference(contents_.size(), endianness, size, label));
- contents_.append(size, 0);
- return *this;
-}
-
-#define ENDIANNESS_L kLittleEndian
-#define ENDIANNESS_B kBigEndian
-#define ENDIANNESS(e) ENDIANNESS_ ## e
-
-#define DEFINE_SHORT_APPEND_NUMBER_ENDIAN(e, bits) \
- Section &Section::e ## bits(uint ## bits ## _t v) { \
- InsertEndian(ENDIANNESS(e), bits / 8, v, \
- back_insert_iterator<string>(contents_)); \
- return *this; \
- }
-
-#define DEFINE_SHORT_APPEND_LABEL_ENDIAN(e, bits) \
- Section &Section::e ## bits(const Label &v) { \
- return Append(ENDIANNESS(e), bits / 8, v); \
- }
-
-// Define L16, B32, and friends.
-#define DEFINE_SHORT_APPEND_ENDIAN(e, bits) \
- DEFINE_SHORT_APPEND_NUMBER_ENDIAN(e, bits) \
- DEFINE_SHORT_APPEND_LABEL_ENDIAN(e, bits)
-
-DEFINE_SHORT_APPEND_LABEL_ENDIAN(L, 8);
-DEFINE_SHORT_APPEND_LABEL_ENDIAN(B, 8);
-DEFINE_SHORT_APPEND_ENDIAN(L, 16);
-DEFINE_SHORT_APPEND_ENDIAN(L, 32);
-DEFINE_SHORT_APPEND_ENDIAN(L, 64);
-DEFINE_SHORT_APPEND_ENDIAN(B, 16);
-DEFINE_SHORT_APPEND_ENDIAN(B, 32);
-DEFINE_SHORT_APPEND_ENDIAN(B, 64);
-
-#define DEFINE_SHORT_APPEND_NUMBER_DEFAULT(bits) \
- Section &Section::D ## bits(uint ## bits ## _t v) { \
- InsertEndian(endianness_, bits / 8, v, \
- back_insert_iterator<string>(contents_)); \
- return *this; \
- }
-#define DEFINE_SHORT_APPEND_LABEL_DEFAULT(bits) \
- Section &Section::D ## bits(const Label &v) { \
- return Append(endianness_, bits / 8, v); \
- }
-#define DEFINE_SHORT_APPEND_DEFAULT(bits) \
- DEFINE_SHORT_APPEND_NUMBER_DEFAULT(bits) \
- DEFINE_SHORT_APPEND_LABEL_DEFAULT(bits)
-
-DEFINE_SHORT_APPEND_LABEL_DEFAULT(8)
-DEFINE_SHORT_APPEND_DEFAULT(16);
-DEFINE_SHORT_APPEND_DEFAULT(32);
-DEFINE_SHORT_APPEND_DEFAULT(64);
-
-Section &Section::Append(const Section &section) {
- size_t base = contents_.size();
- contents_.append(section.contents_);
- for (vector<Reference>::const_iterator it = section.references_.begin();
- it != section.references_.end(); it++)
- references_.push_back(Reference(base + it->offset, it->endianness,
- it->size, it->label));
- return *this;
-}
-
-Section &Section::LEB128(long long value) {
- while (value < -0x40 || 0x3f < value) {
- contents_ += (value & 0x7f) | 0x80;
- if (value < 0)
- value = (value >> 7) | ~(((unsigned long long) -1) >> 7);
- else
- value = (value >> 7);
- }
- contents_ += value & 0x7f;
- return *this;
-}
-
-Section &Section::ULEB128(uint64_t value) {
- while (value > 0x7f) {
- contents_ += (value & 0x7f) | 0x80;
- value = (value >> 7);
- }
- contents_ += value;
- return *this;
-}
-
-Section &Section::Align(size_t alignment, uint8_t pad_byte) {
- // ALIGNMENT must be a power of two.
- assert(((alignment - 1) & alignment) == 0);
- size_t new_size = (contents_.size() + alignment - 1) & ~(alignment - 1);
- contents_.append(new_size - contents_.size(), pad_byte);
- assert((contents_.size() & (alignment - 1)) == 0);
- return *this;
-}
-
-void Section::Clear() {
- contents_.clear();
- references_.clear();
-}
-
-bool Section::GetContents(string *contents) {
- // For each label reference, find the label's value, and patch it into
- // the section's contents.
- for (size_t i = 0; i < references_.size(); i++) {
- Reference &r = references_[i];
- uint64_t value;
- if (!r.label.IsKnownConstant(&value)) {
- fprintf(stderr, "Undefined label #%zu at offset 0x%zx\n", i, r.offset);
- return false;
- }
- assert(r.offset < contents_.size());
- assert(contents_.size() - r.offset >= r.size);
- InsertEndian(r.endianness, r.size, value, contents_.begin() + r.offset);
- }
- contents->clear();
- std::swap(contents_, *contents);
- references_.clear();
- return true;
-}
-
-} // namespace test_assembler
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/test_assembler.h b/toolkit/crashreporter/google-breakpad/src/common/test_assembler.h
deleted file mode 100644
index 373dbebacd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/test_assembler.h
+++ /dev/null
@@ -1,484 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// test-assembler.h: interface to class for building complex binary streams.
-
-// To test the Breakpad symbol dumper and processor thoroughly, for
-// all combinations of host system and minidump processor
-// architecture, we need to be able to easily generate complex test
-// data like debugging information and minidump files.
-//
-// For example, if we want our unit tests to provide full code
-// coverage for stack walking, it may be difficult to persuade the
-// compiler to generate every possible sort of stack walking
-// information that we want to support; there are probably DWARF CFI
-// opcodes that GCC never emits. Similarly, if we want to test our
-// error handling, we will need to generate damaged minidumps or
-// debugging information that (we hope) the client or compiler will
-// never produce on its own.
-//
-// google_breakpad::TestAssembler provides a predictable and
-// (relatively) simple way to generate complex formatted data streams
-// like minidumps and CFI. Furthermore, because TestAssembler is
-// portable, developers without access to (say) Visual Studio or a
-// SPARC assembler can still work on test data for those targets.
-
-#ifndef PROCESSOR_TEST_ASSEMBLER_H_
-#define PROCESSOR_TEST_ASSEMBLER_H_
-
-#include <list>
-#include <vector>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-using std::list;
-using std::vector;
-
-namespace test_assembler {
-
-// A Label represents a value not yet known that we need to store in a
-// section. As long as all the labels a section refers to are defined
-// by the time we retrieve its contents as bytes, we can use undefined
-// labels freely in that section's construction.
-//
-// A label can be in one of three states:
-// - undefined,
-// - defined as the sum of some other label and a constant, or
-// - a constant.
-//
-// A label's value never changes, but it can accumulate constraints.
-// Adding labels and integers is permitted, and yields a label.
-// Subtracting a constant from a label is permitted, and also yields a
-// label. Subtracting two labels that have some relationship to each
-// other is permitted, and yields a constant.
-//
-// For example:
-//
-// Label a; // a's value is undefined
-// Label b; // b's value is undefined
-// {
-// Label c = a + 4; // okay, even though a's value is unknown
-// b = c + 4; // also okay; b is now a+8
-// }
-// Label d = b - 2; // okay; d == a+6, even though c is gone
-// d.Value(); // error: d's value is not yet known
-// d - a; // is 6, even though their values are not known
-// a = 12; // now b == 20, and d == 18
-// d.Value(); // 18: no longer an error
-// b.Value(); // 20
-// d = 10; // error: d is already defined.
-//
-// Label objects' lifetimes are unconstrained: notice that, in the
-// above example, even though a and b are only related through c, and
-// c goes out of scope, the assignment to a sets b's value as well. In
-// particular, it's not necessary to ensure that a Label lives beyond
-// Sections that refer to it.
-class Label {
- public:
- Label(); // An undefined label.
- Label(uint64_t value); // A label with a fixed value
- Label(const Label &value); // A label equal to another.
- ~Label();
-
- // Return this label's value; it must be known.
- //
- // Providing this as a cast operator is nifty, but the conversions
- // happen in unexpected places. In particular, ISO C++ says that
- // Label + size_t becomes ambigious, because it can't decide whether
- // to convert the Label to a uint64_t and then to a size_t, or use
- // the overloaded operator that returns a new label, even though the
- // former could fail if the label is not yet defined and the latter won't.
- uint64_t Value() const;
-
- Label &operator=(uint64_t value);
- Label &operator=(const Label &value);
- Label operator+(uint64_t addend) const;
- Label operator-(uint64_t subtrahend) const;
- uint64_t operator-(const Label &subtrahend) const;
-
- // We could also provide == and != that work on undefined, but
- // related, labels.
-
- // Return true if this label's value is known. If VALUE_P is given,
- // set *VALUE_P to the known value if returning true.
- bool IsKnownConstant(uint64_t *value_p = NULL) const;
-
- // Return true if the offset from LABEL to this label is known. If
- // OFFSET_P is given, set *OFFSET_P to the offset when returning true.
- //
- // You can think of l.KnownOffsetFrom(m, &d) as being like 'd = l-m',
- // except that it also returns a value indicating whether the
- // subtraction is possible given what we currently know of l and m.
- // It can be possible even if we don't know l and m's values. For
- // example:
- //
- // Label l, m;
- // m = l + 10;
- // l.IsKnownConstant(); // false
- // m.IsKnownConstant(); // false
- // uint64_t d;
- // l.IsKnownOffsetFrom(m, &d); // true, and sets d to -10.
- // l-m // -10
- // m-l // 10
- // m.Value() // error: m's value is not known
- bool IsKnownOffsetFrom(const Label &label, uint64_t *offset_p = NULL) const;
-
- private:
- // A label's value, or if that is not yet known, how the value is
- // related to other labels' values. A binding may be:
- // - a known constant,
- // - constrained to be equal to some other binding plus a constant, or
- // - unconstrained, and free to take on any value.
- //
- // Many labels may point to a single binding, and each binding may
- // refer to another, so bindings and labels form trees whose leaves
- // are labels, whose interior nodes (and roots) are bindings, and
- // where links point from children to parents. Bindings are
- // reference counted, allowing labels to be lightweight, copyable,
- // assignable, placed in containers, and so on.
- class Binding {
- public:
- Binding();
- Binding(uint64_t addend);
- ~Binding();
-
- // Increment our reference count.
- void Acquire() { reference_count_++; };
- // Decrement our reference count, and return true if it is zero.
- bool Release() { return --reference_count_ == 0; }
-
- // Set this binding to be equal to BINDING + ADDEND. If BINDING is
- // NULL, then set this binding to the known constant ADDEND.
- // Update every binding on this binding's chain to point directly
- // to BINDING, or to be a constant, with addends adjusted
- // appropriately.
- void Set(Binding *binding, uint64_t value);
-
- // Return what we know about the value of this binding.
- // - If this binding's value is a known constant, set BASE to
- // NULL, and set ADDEND to its value.
- // - If this binding is not a known constant but related to other
- // bindings, set BASE to the binding at the end of the relation
- // chain (which will always be unconstrained), and set ADDEND to the
- // value to add to that binding's value to get this binding's
- // value.
- // - If this binding is unconstrained, set BASE to this, and leave
- // ADDEND unchanged.
- void Get(Binding **base, uint64_t *addend);
-
- private:
- // There are three cases:
- //
- // - A binding representing a known constant value has base_ NULL,
- // and addend_ equal to the value.
- //
- // - A binding representing a completely unconstrained value has
- // base_ pointing to this; addend_ is unused.
- //
- // - A binding whose value is related to some other binding's
- // value has base_ pointing to that other binding, and addend_
- // set to the amount to add to that binding's value to get this
- // binding's value. We only represent relationships of the form
- // x = y+c.
- //
- // Thus, the bind_ links form a chain terminating in either a
- // known constant value or a completely unconstrained value. Most
- // operations on bindings do path compression: they change every
- // binding on the chain to point directly to the final value,
- // adjusting addends as appropriate.
- Binding *base_;
- uint64_t addend_;
-
- // The number of Labels and Bindings pointing to this binding.
- // (When a binding points to itself, indicating a completely
- // unconstrained binding, that doesn't count as a reference.)
- int reference_count_;
- };
-
- // This label's value.
- Binding *value_;
-};
-
-inline Label operator+(uint64_t a, const Label &l) { return l + a; }
-// Note that int-Label isn't defined, as negating a Label is not an
-// operation we support.
-
-// Conventions for representing larger numbers as sequences of bytes.
-enum Endianness {
- kBigEndian, // Big-endian: the most significant byte comes first.
- kLittleEndian, // Little-endian: the least significant byte comes first.
- kUnsetEndian, // used internally
-};
-
-// A section is a sequence of bytes, constructed by appending bytes
-// to the end. Sections have a convenient and flexible set of member
-// functions for appending data in various formats: big-endian and
-// little-endian signed and unsigned values of different sizes;
-// LEB128 and ULEB128 values (see below), and raw blocks of bytes.
-//
-// If you need to append a value to a section that is not convenient
-// to compute immediately, you can create a label, append the
-// label's value to the section, and then set the label's value
-// later, when it's convenient to do so. Once a label's value is
-// known, the section class takes care of updating all previously
-// appended references to it.
-//
-// Once all the labels to which a section refers have had their
-// values determined, you can get a copy of the section's contents
-// as a string.
-//
-// Note that there is no specified "start of section" label. This is
-// because there are typically several different meanings for "the
-// start of a section": the offset of the section within an object
-// file, the address in memory at which the section's content appear,
-// and so on. It's up to the code that uses the Section class to
-// keep track of these explicitly, as they depend on the application.
-class Section {
- public:
- Section(Endianness endianness = kUnsetEndian)
- : endianness_(endianness) { };
-
- // A base class destructor should be either public and virtual,
- // or protected and nonvirtual.
- virtual ~Section() { };
-
- // Set the default endianness of this section to ENDIANNESS. This
- // sets the behavior of the D<N> appending functions. If the
- // assembler's default endianness was set, this is the
- void set_endianness(Endianness endianness) {
- endianness_ = endianness;
- }
-
- // Return the default endianness of this section.
- Endianness endianness() const { return endianness_; }
-
- // Append the SIZE bytes at DATA or the contents of STRING to the
- // end of this section. Return a reference to this section.
- Section &Append(const uint8_t *data, size_t size) {
- contents_.append(reinterpret_cast<const char *>(data), size);
- return *this;
- };
- Section &Append(const string &data) {
- contents_.append(data);
- return *this;
- };
-
- // Append SIZE copies of BYTE to the end of this section. Return a
- // reference to this section.
- Section &Append(size_t size, uint8_t byte) {
- contents_.append(size, (char) byte);
- return *this;
- }
-
- // Append NUMBER to this section. ENDIANNESS is the endianness to
- // use to write the number. SIZE is the length of the number in
- // bytes. Return a reference to this section.
- Section &Append(Endianness endianness, size_t size, uint64_t number);
- Section &Append(Endianness endianness, size_t size, const Label &label);
-
- // Append SECTION to the end of this section. The labels SECTION
- // refers to need not be defined yet.
- //
- // Note that this has no effect on any Labels' values, or on
- // SECTION. If placing SECTION within 'this' provides new
- // constraints on existing labels' values, then it's up to the
- // caller to fiddle with those labels as needed.
- Section &Append(const Section &section);
-
- // Append the contents of DATA as a series of bytes terminated by
- // a NULL character.
- Section &AppendCString(const string &data) {
- Append(data);
- contents_ += '\0';
- return *this;
- }
-
- // Append at most SIZE bytes from DATA; if DATA is less than SIZE bytes
- // long, pad with '\0' characters.
- Section &AppendCString(const string &data, size_t size) {
- contents_.append(data, 0, size);
- if (data.size() < size)
- Append(size - data.size(), 0);
- return *this;
- }
-
- // Append VALUE or LABEL to this section, with the given bit width and
- // endianness. Return a reference to this section.
- //
- // The names of these functions have the form <ENDIANNESS><BITWIDTH>:
- // <ENDIANNESS> is either 'L' (little-endian, least significant byte first),
- // 'B' (big-endian, most significant byte first), or
- // 'D' (default, the section's default endianness)
- // <BITWIDTH> is 8, 16, 32, or 64.
- //
- // Since endianness doesn't matter for a single byte, all the
- // <BITWIDTH>=8 functions are equivalent.
- //
- // These can be used to write both signed and unsigned values, as
- // the compiler will properly sign-extend a signed value before
- // passing it to the function, at which point the function's
- // behavior is the same either way.
- Section &L8(uint8_t value) { contents_ += value; return *this; }
- Section &B8(uint8_t value) { contents_ += value; return *this; }
- Section &D8(uint8_t value) { contents_ += value; return *this; }
- Section &L16(uint16_t), &L32(uint32_t), &L64(uint64_t),
- &B16(uint16_t), &B32(uint32_t), &B64(uint64_t),
- &D16(uint16_t), &D32(uint32_t), &D64(uint64_t);
- Section &L8(const Label &label), &L16(const Label &label),
- &L32(const Label &label), &L64(const Label &label),
- &B8(const Label &label), &B16(const Label &label),
- &B32(const Label &label), &B64(const Label &label),
- &D8(const Label &label), &D16(const Label &label),
- &D32(const Label &label), &D64(const Label &label);
-
- // Append VALUE in a signed LEB128 (Little-Endian Base 128) form.
- //
- // The signed LEB128 representation of an integer N is a variable
- // number of bytes:
- //
- // - If N is between -0x40 and 0x3f, then its signed LEB128
- // representation is a single byte whose value is N.
- //
- // - Otherwise, its signed LEB128 representation is (N & 0x7f) |
- // 0x80, followed by the signed LEB128 representation of N / 128,
- // rounded towards negative infinity.
- //
- // In other words, we break VALUE into groups of seven bits, put
- // them in little-endian order, and then write them as eight-bit
- // bytes with the high bit on all but the last.
- //
- // Note that VALUE cannot be a Label (we would have to implement
- // relaxation).
- Section &LEB128(long long value);
-
- // Append VALUE in unsigned LEB128 (Little-Endian Base 128) form.
- //
- // The unsigned LEB128 representation of an integer N is a variable
- // number of bytes:
- //
- // - If N is between 0 and 0x7f, then its unsigned LEB128
- // representation is a single byte whose value is N.
- //
- // - Otherwise, its unsigned LEB128 representation is (N & 0x7f) |
- // 0x80, followed by the unsigned LEB128 representation of N /
- // 128, rounded towards negative infinity.
- //
- // Note that VALUE cannot be a Label (we would have to implement
- // relaxation).
- Section &ULEB128(uint64_t value);
-
- // Jump to the next location aligned on an ALIGNMENT-byte boundary,
- // relative to the start of the section. Fill the gap with PAD_BYTE.
- // ALIGNMENT must be a power of two. Return a reference to this
- // section.
- Section &Align(size_t alignment, uint8_t pad_byte = 0);
-
- // Clear the contents of this section.
- void Clear();
-
- // Return the current size of the section.
- size_t Size() const { return contents_.size(); }
-
- // Return a label representing the start of the section.
- //
- // It is up to the user whether this label represents the section's
- // position in an object file, the section's address in memory, or
- // what have you; some applications may need both, in which case
- // this simple-minded interface won't be enough. This class only
- // provides a single start label, for use with the Here and Mark
- // member functions.
- //
- // Ideally, we'd provide this in a subclass that actually knows more
- // about the application at hand and can provide an appropriate
- // collection of start labels. But then the appending member
- // functions like Append and D32 would return a reference to the
- // base class, not the derived class, and the chaining won't work.
- // Since the only value here is in pretty notation, that's a fatal
- // flaw.
- Label start() const { return start_; }
-
- // Return a label representing the point at which the next Appended
- // item will appear in the section, relative to start().
- Label Here() const { return start_ + Size(); }
-
- // Set *LABEL to Here, and return a reference to this section.
- Section &Mark(Label *label) { *label = Here(); return *this; }
-
- // If there are no undefined label references left in this
- // section, set CONTENTS to the contents of this section, as a
- // string, and clear this section. Return true on success, or false
- // if there were still undefined labels.
- bool GetContents(string *contents);
-
- private:
- // Used internally. A reference to a label's value.
- struct Reference {
- Reference(size_t set_offset, Endianness set_endianness, size_t set_size,
- const Label &set_label)
- : offset(set_offset), endianness(set_endianness), size(set_size),
- label(set_label) { }
-
- // The offset of the reference within the section.
- size_t offset;
-
- // The endianness of the reference.
- Endianness endianness;
-
- // The size of the reference.
- size_t size;
-
- // The label to which this is a reference.
- Label label;
- };
-
- // The default endianness of this section.
- Endianness endianness_;
-
- // The contents of the section.
- string contents_;
-
- // References to labels within those contents.
- vector<Reference> references_;
-
- // A label referring to the beginning of the section.
- Label start_;
-};
-
-} // namespace test_assembler
-} // namespace google_breakpad
-
-#endif // PROCESSOR_TEST_ASSEMBLER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc
deleted file mode 100644
index 94b5a5ce5f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/test_assembler_unittest.cc
+++ /dev/null
@@ -1,1662 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// test_assembler_unittest.cc: Unit tests for google_breakpad::TestAssembler.
-
-#include <string>
-#include <string.h>
-
-#include "breakpad_googletest_includes.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using testing::Test;
-
-TEST(ConstructLabel, Simple) {
- Label l;
-}
-
-TEST(ConstructLabel, Undefined) {
- Label l;
- EXPECT_FALSE(l.IsKnownConstant());
-}
-
-TEST(ConstructLabelDeathTest, Undefined) {
- Label l;
- ASSERT_DEATH(l.Value(), "IsKnownConstant\\(&v\\)");
-}
-
-TEST(ConstructLabel, Constant) {
- Label l(0x060b9f974eaf301eULL);
- uint64_t v;
- EXPECT_TRUE(l.IsKnownConstant(&v));
- EXPECT_EQ(v, 0x060b9f974eaf301eULL);
- EXPECT_EQ(l.Value(), 0x060b9f974eaf301eULL);
-}
-
-TEST(ConstructLabel, Copy) {
- Label l;
- Label m(l);
- uint64_t v;
- EXPECT_TRUE(l.IsKnownOffsetFrom(m, &v));
- EXPECT_EQ(0U, v);
-}
-
-// The left-hand-side of a label assignment can be either
-// unconstrained, related, or known. The right-hand-side can be any of
-// those, or an integer.
-TEST(Assignment, UnconstrainedToUnconstrained) {
- Label l, m;
- l = m;
- EXPECT_EQ(0U, l-m);
- EXPECT_TRUE(l.IsKnownOffsetFrom(m));
- uint64_t d;
- EXPECT_TRUE(l.IsKnownOffsetFrom(m, &d));
- EXPECT_EQ(0U, d);
- EXPECT_FALSE(l.IsKnownConstant());
-}
-
-TEST(Assignment, UnconstrainedToRelated) {
- Label l, m, n;
- l = n;
- l = m;
- EXPECT_EQ(0U, l-m);
- EXPECT_TRUE(l.IsKnownOffsetFrom(m));
- uint64_t d;
- EXPECT_TRUE(l.IsKnownOffsetFrom(m, &d));
- EXPECT_EQ(0U, d);
- EXPECT_FALSE(l.IsKnownConstant());
-}
-
-TEST(Assignment, UnconstrainedToKnown) {
- Label l, m;
- l = 0x8fd16e55b20a39c1ULL;
- l = m;
- EXPECT_EQ(0U, l-m);
- EXPECT_TRUE(l.IsKnownOffsetFrom(m));
- uint64_t d;
- EXPECT_TRUE(l.IsKnownOffsetFrom(m, &d));
- EXPECT_EQ(0U, d);
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x8fd16e55b20a39c1ULL, m.Value());
-}
-
-TEST(Assignment, RelatedToUnconstrained) {
- Label l, m, n;
- m = n;
- l = m;
- EXPECT_EQ(0U, l-n);
- EXPECT_TRUE(l.IsKnownOffsetFrom(n));
- uint64_t d;
- EXPECT_TRUE(l.IsKnownOffsetFrom(n, &d));
- EXPECT_EQ(0U, d);
- EXPECT_FALSE(l.IsKnownConstant());
-}
-
-TEST(Assignment, RelatedToRelated) {
- Label l, m, n, o;
- l = n;
- m = o;
- l = m;
- EXPECT_EQ(0U, n-o);
- EXPECT_TRUE(n.IsKnownOffsetFrom(o));
- uint64_t d;
- EXPECT_TRUE(n.IsKnownOffsetFrom(o, &d));
- EXPECT_EQ(0U, d);
- EXPECT_FALSE(l.IsKnownConstant());
-}
-
-TEST(Assignment, RelatedToKnown) {
- Label l, m, n;
- m = n;
- l = 0xd2011f8c82ad56f2ULL;
- l = m;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0xd2011f8c82ad56f2ULL, l.Value());
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0xd2011f8c82ad56f2ULL, m.Value());
- EXPECT_TRUE(n.IsKnownConstant());
- EXPECT_EQ(0xd2011f8c82ad56f2ULL, n.Value());
-}
-
-TEST(Assignment, KnownToUnconstrained) {
- Label l, m;
- m = 0x50b024c0d6073887ULL;
- l = m;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0x50b024c0d6073887ULL, l.Value());
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x50b024c0d6073887ULL, m.Value());
-}
-
-TEST(Assignment, KnownToRelated) {
- Label l, m, n;
- l = n;
- m = 0x5348883655c727e5ULL;
- l = m;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0x5348883655c727e5ULL, l.Value());
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x5348883655c727e5ULL, m.Value());
- EXPECT_TRUE(n.IsKnownConstant());
- EXPECT_EQ(0x5348883655c727e5ULL, n.Value());
-}
-
-TEST(Assignment, KnownToKnown) {
- Label l, m;
- l = 0x36c209c20987564eULL;
- m = 0x36c209c20987564eULL;
- l = m;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0x36c209c20987564eULL, l.Value());
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x36c209c20987564eULL, m.Value());
-}
-
-TEST(Assignment, ConstantToUnconstrained) {
- Label l;
- l = 0xc02495f4d7f5a957ULL;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0xc02495f4d7f5a957ULL, l.Value());
-}
-
-TEST(Assignment, ConstantToRelated) {
- Label l, m;
- l = m;
- l = 0x4577901cf275488dULL;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0x4577901cf275488dULL, l.Value());
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x4577901cf275488dULL, m.Value());
-}
-
-TEST(Assignment, ConstantToKnown) {
- Label l;
- l = 0xec0b9c369b7e8ea7ULL;
- l = 0xec0b9c369b7e8ea7ULL;
- EXPECT_TRUE(l.IsKnownConstant());
- EXPECT_EQ(0xec0b9c369b7e8ea7ULL, l.Value());
-}
-
-TEST(AssignmentDeathTest, Self) {
- Label l;
- ASSERT_DEATH(l = l, "binding != this");
-}
-
-TEST(AssignmentDeathTest, IndirectCycle) {
- Label l, m, n;
- l = m;
- m = n;
- ASSERT_DEATH(n = l, "binding != this");
-}
-
-TEST(AssignmentDeathTest, Cycle) {
- Label l, m, n, o;
- l = m;
- m = n;
- o = n;
- ASSERT_DEATH(o = l, "binding != this");
-}
-
-TEST(Addition, LabelConstant) {
- Label l, m;
- m = l + 0x5248d93e8bbe9497ULL;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l));
- uint64_t d;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l, &d));
- EXPECT_EQ(0x5248d93e8bbe9497ULL, d);
- EXPECT_FALSE(m.IsKnownConstant());
-}
-
-TEST(Addition, ConstantLabel) {
- Label l, m;
- m = 0xf51e94e00d6e3c84ULL + l;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l));
- uint64_t d;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l, &d));
- EXPECT_EQ(0xf51e94e00d6e3c84ULL, d);
- EXPECT_FALSE(m.IsKnownConstant());
-}
-
-TEST(Addition, KnownLabelConstant) {
- Label l, m;
- l = 0x16286307042ce0d8ULL;
- m = l + 0x3fdddd91306719d7ULL;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l));
- uint64_t d;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l, &d));
- EXPECT_EQ(0x3fdddd91306719d7ULL, d);
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x16286307042ce0d8ULL + 0x3fdddd91306719d7ULL, m.Value());
-}
-
-TEST(Addition, ConstantKnownLabel) {
- Label l, m;
- l = 0x50f62d0cdd1031deULL;
- m = 0x1b13462d8577c538ULL + l;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l));
- uint64_t d;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l, &d));
- EXPECT_EQ(0x1b13462d8577c538ULL, d);
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x50f62d0cdd1031deULL + 0x1b13462d8577c538ULL, m.Value());
-}
-
-TEST(Subtraction, LabelConstant) {
- Label l, m;
- m = l - 0x0620884d21d3138eULL;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l));
- uint64_t d;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l, &d));
- EXPECT_EQ(-0x0620884d21d3138eULL, d);
- EXPECT_FALSE(m.IsKnownConstant());
-}
-
-TEST(Subtraction, KnownLabelConstant) {
- Label l, m;
- l = 0x6237fbaf9ef7929eULL;
- m = l - 0x317730995d2ab6eeULL;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l));
- uint64_t d;
- EXPECT_TRUE(m.IsKnownOffsetFrom(l, &d));
- EXPECT_EQ(-0x317730995d2ab6eeULL, d);
- EXPECT_TRUE(m.IsKnownConstant());
- EXPECT_EQ(0x6237fbaf9ef7929eULL - 0x317730995d2ab6eeULL, m.Value());
-}
-
-TEST(SubtractionDeathTest, LabelLabel) {
- Label l, m;
- ASSERT_DEATH(l - m, "IsKnownOffsetFrom\\(label, &offset\\)");
-}
-
-TEST(Subtraction, LabelLabel) {
- Label l, m;
- l = m + 0x7fa77ec63e28a17aULL;
- EXPECT_EQ(0x7fa77ec63e28a17aULL, l - m);
- EXPECT_EQ(-0x7fa77ec63e28a17aULL, m - l);
-}
-
-TEST(IsKnownConstant, Undefined) {
- Label l;
- EXPECT_FALSE(l.IsKnownConstant());
-}
-
-TEST(IsKnownConstant, RelatedLabel) {
- Label l, m;
- l = m;
- EXPECT_FALSE(l.IsKnownConstant());
- EXPECT_FALSE(m.IsKnownConstant());
-}
-
-TEST(IsKnownConstant, Constant) {
- Label l;
- l = 0xf374b1bdd6a22576ULL;
- EXPECT_TRUE(l.IsKnownConstant());
-}
-
-TEST(IsKnownOffsetFrom, Unrelated) {
- Label l, m;
- EXPECT_FALSE(l.IsKnownOffsetFrom(m));
-}
-
-TEST(IsKnownOffsetFrom, Related) {
- Label l, m;
- l = m;
- EXPECT_TRUE(l.IsKnownOffsetFrom(m));
-}
-
-// Test the construction of chains of related labels, and the
-// propagation of values through them.
-//
-// Although the relations between labels are supposed to behave
-// symmetrically --- that is, 'a = b' should put a and b in
-// indistinguishable states --- there's a distinction made internally
-// between the target (a) and the source (b).
-//
-// So there are five test axes to cover:
-//
-// - Do we construct the chain with assignment ("Assign") or with constructors
-// ("Construct")?
-//
-// - Do we set the value of the label at the start of the chain
-// ("Start") or the label at the end ("End")?
-//
-// - Are we testing the propagation of a relationship between variable
-// values ("Relation"), or the propagation of a known constant value
-// ("Value")?
-//
-// - Do we set the value before building the chain ("Before") or after
-// the chain has been built ("After")?
-//
-// - Do we add new relationships to the end of the existing chain
-// ("Forward") or to the beginning ("Backward")?
-//
-// Of course, "Construct" and "Backward" can't be combined, which
-// eliminates eight combinations, and "Construct", "End", and "Before"
-// can't be combined, which eliminates two more, so there are are 22
-// combinations, not 32.
-
-TEST(LabelChain, AssignStartRelationBeforeForward) {
- Label a, b, c, d;
- Label x;
- a = x;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- EXPECT_EQ(0x111U, d-x);
- EXPECT_EQ(0x11U, c-x);
- EXPECT_EQ(0x1U, b-x);
- EXPECT_EQ(0U, a-x);
-}
-
-TEST(LabelChain, AssignStartRelationBeforeBackward) {
- Label a, b, c, d;
- Label x;
- a = x;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- EXPECT_EQ(0x111U, d-x);
- EXPECT_EQ(0x11U, c-x);
- EXPECT_EQ(0x1U, b-x);
- EXPECT_EQ(0U, a-x);
-}
-
-TEST(LabelChain, AssignStartRelationAfterForward) {
- Label a, b, c, d;
- Label x;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- a = x;
- EXPECT_EQ(0x111U, d-x);
- EXPECT_EQ(0x11U, c-x);
- EXPECT_EQ(0x1U, b-x);
- EXPECT_EQ(0U, a-x);
-}
-
-TEST(LabelChain, AssignStartRelationAfterBackward) {
- Label a, b, c, d;
- Label x;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- a = x;
- EXPECT_EQ(0x111U, d-x);
- EXPECT_EQ(0x11U, c-x);
- EXPECT_EQ(0x1U, b-x);
- EXPECT_EQ(0U, a-x);
-}
-
-TEST(LabelChain, AssignStartValueBeforeForward) {
- Label a, b, c, d;
- a = 0xa131200190546ac2ULL;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- EXPECT_EQ(0xa131200190546ac2ULL + 0x111U, d.Value());
- EXPECT_EQ(0xa131200190546ac2ULL + 0x11U, c.Value());
- EXPECT_EQ(0xa131200190546ac2ULL + 0x1U, b.Value());
- EXPECT_EQ(0xa131200190546ac2ULL + 0U, a.Value());
-}
-
-TEST(LabelChain, AssignStartValueBeforeBackward) {
- Label a, b, c, d;
- a = 0x8da17e1670ad4fa2ULL;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- EXPECT_EQ(0x8da17e1670ad4fa2ULL + 0x111U, d.Value());
- EXPECT_EQ(0x8da17e1670ad4fa2ULL + 0x11U, c.Value());
- EXPECT_EQ(0x8da17e1670ad4fa2ULL + 0x1U, b.Value());
- EXPECT_EQ(0x8da17e1670ad4fa2ULL + 0U, a.Value());
-}
-
-TEST(LabelChain, AssignStartValueAfterForward) {
- Label a, b, c, d;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- a = 0x99b8f51bafd41adaULL;
- EXPECT_EQ(0x99b8f51bafd41adaULL + 0x111U, d.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL + 0x11U, c.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL + 0x1U, b.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL + 0U, a.Value());
-}
-
-TEST(LabelChain, AssignStartValueAfterBackward) {
- Label a, b, c, d;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- a = 0xc86ca1d97ab5df6eULL;
- EXPECT_EQ(0xc86ca1d97ab5df6eULL + 0x111U, d.Value());
- EXPECT_EQ(0xc86ca1d97ab5df6eULL + 0x11U, c.Value());
- EXPECT_EQ(0xc86ca1d97ab5df6eULL + 0x1U, b.Value());
- EXPECT_EQ(0xc86ca1d97ab5df6eULL + 0U, a.Value());
-}
-
-TEST(LabelChain, AssignEndRelationBeforeForward) {
- Label a, b, c, d;
- Label x;
- x = d;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- EXPECT_EQ(-(uint64_t)0x111U, a-x);
- EXPECT_EQ(-(uint64_t)0x110U, b-x);
- EXPECT_EQ(-(uint64_t)0x100U, c-x);
- EXPECT_EQ(-(uint64_t)0U, d-x);
-}
-
-TEST(LabelChain, AssignEndRelationBeforeBackward) {
- Label a, b, c, d;
- Label x;
- x = d;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- EXPECT_EQ(-(uint64_t)0x111U, a-x);
- EXPECT_EQ(-(uint64_t)0x110U, b-x);
- EXPECT_EQ(-(uint64_t)0x100U, c-x);
- EXPECT_EQ(-(uint64_t)0U, d-x);
-}
-
-TEST(LabelChain, AssignEndRelationAfterForward) {
- Label a, b, c, d;
- Label x;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- x = d;
- EXPECT_EQ(-(uint64_t)0x111U, a-x);
- EXPECT_EQ(-(uint64_t)0x110U, b-x);
- EXPECT_EQ(-(uint64_t)0x100U, c-x);
- EXPECT_EQ(-(uint64_t)0x000U, d-x);
-}
-
-TEST(LabelChain, AssignEndRelationAfterBackward) {
- Label a, b, c, d;
- Label x;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- x = d;
- EXPECT_EQ(-(uint64_t)0x111U, a-x);
- EXPECT_EQ(-(uint64_t)0x110U, b-x);
- EXPECT_EQ(-(uint64_t)0x100U, c-x);
- EXPECT_EQ(-(uint64_t)0x000U, d-x);
-}
-
-TEST(LabelChain, AssignEndValueBeforeForward) {
- Label a, b, c, d;
- d = 0xa131200190546ac2ULL;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- EXPECT_EQ(0xa131200190546ac2ULL - 0x111, a.Value());
- EXPECT_EQ(0xa131200190546ac2ULL - 0x110, b.Value());
- EXPECT_EQ(0xa131200190546ac2ULL - 0x100, c.Value());
- EXPECT_EQ(0xa131200190546ac2ULL - 0x000, d.Value());
-}
-
-TEST(LabelChain, AssignEndValueBeforeBackward) {
- Label a, b, c, d;
- d = 0x8da17e1670ad4fa2ULL;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- EXPECT_EQ(0x8da17e1670ad4fa2ULL - 0x111, a.Value());
- EXPECT_EQ(0x8da17e1670ad4fa2ULL - 0x110, b.Value());
- EXPECT_EQ(0x8da17e1670ad4fa2ULL - 0x100, c.Value());
- EXPECT_EQ(0x8da17e1670ad4fa2ULL - 0x000, d.Value());
-}
-
-TEST(LabelChain, AssignEndValueAfterForward) {
- Label a, b, c, d;
- b = a + 0x1;
- c = b + 0x10;
- d = c + 0x100;
- d = 0x99b8f51bafd41adaULL;
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x111, a.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x110, b.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x100, c.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x000, d.Value());
-}
-
-TEST(LabelChain, AssignEndValueAfterBackward) {
- Label a, b, c, d;
- d = c + 0x100;
- c = b + 0x10;
- b = a + 0x1;
- d = 0xc86ca1d97ab5df6eULL;
- EXPECT_EQ(0xc86ca1d97ab5df6eULL - 0x111, a.Value());
- EXPECT_EQ(0xc86ca1d97ab5df6eULL - 0x110, b.Value());
- EXPECT_EQ(0xc86ca1d97ab5df6eULL - 0x100, c.Value());
- EXPECT_EQ(0xc86ca1d97ab5df6eULL - 0x000, d.Value());
-}
-
-TEST(LabelChain, ConstructStartRelationBeforeForward) {
- Label x;
- Label a(x);
- Label b(a + 0x1);
- Label c(b + 0x10);
- Label d(c + 0x100);
- EXPECT_EQ(0x111U, d-x);
- EXPECT_EQ(0x11U, c-x);
- EXPECT_EQ(0x1U, b-x);
- EXPECT_EQ(0U, a-x);
-}
-
-TEST(LabelChain, ConstructStartRelationAfterForward) {
- Label x;
- Label a;
- Label b(a + 0x1);
- Label c(b + 0x10);
- Label d(c + 0x100);
- a = x;
- EXPECT_EQ(0x111U, d-x);
- EXPECT_EQ(0x11U, c-x);
- EXPECT_EQ(0x1U, b-x);
- EXPECT_EQ(0U, a-x);
-}
-
-TEST(LabelChain, ConstructStartValueBeforeForward) {
- Label a(0x5d234d177d01ccc8ULL);
- Label b(a + 0x1);
- Label c(b + 0x10);
- Label d(c + 0x100);
- EXPECT_EQ(0x5d234d177d01ccc8ULL + 0x111U, d.Value());
- EXPECT_EQ(0x5d234d177d01ccc8ULL + 0x011U, c.Value());
- EXPECT_EQ(0x5d234d177d01ccc8ULL + 0x001U, b.Value());
- EXPECT_EQ(0x5d234d177d01ccc8ULL + 0x000U, a.Value());
-}
-
-TEST(LabelChain, ConstructStartValueAfterForward) {
- Label a;
- Label b(a + 0x1);
- Label c(b + 0x10);
- Label d(c + 0x100);
- a = 0xded85d54586e84fcULL;
- EXPECT_EQ(0xded85d54586e84fcULL + 0x111U, d.Value());
- EXPECT_EQ(0xded85d54586e84fcULL + 0x011U, c.Value());
- EXPECT_EQ(0xded85d54586e84fcULL + 0x001U, b.Value());
- EXPECT_EQ(0xded85d54586e84fcULL + 0x000U, a.Value());
-}
-
-TEST(LabelChain, ConstructEndRelationAfterForward) {
- Label x;
- Label a;
- Label b(a + 0x1);
- Label c(b + 0x10);
- Label d(c + 0x100);
- x = d;
- EXPECT_EQ(-(uint64_t)0x111U, a-x);
- EXPECT_EQ(-(uint64_t)0x110U, b-x);
- EXPECT_EQ(-(uint64_t)0x100U, c-x);
- EXPECT_EQ(-(uint64_t)0x000U, d-x);
-}
-
-TEST(LabelChain, ConstructEndValueAfterForward) {
- Label a;
- Label b(a + 0x1);
- Label c(b + 0x10);
- Label d(c + 0x100);
- d = 0x99b8f51bafd41adaULL;
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x111, a.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x110, b.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x100, c.Value());
- EXPECT_EQ(0x99b8f51bafd41adaULL - 0x000, d.Value());
-}
-
-TEST(LabelTree, KnownValue) {
- Label l, m, n, o, p;
- l = m;
- m = n;
- o = p;
- p = n;
- l = 0x536b5de3d468a1b5ULL;
- EXPECT_EQ(0x536b5de3d468a1b5ULL, o.Value());
-}
-
-TEST(LabelTree, Related) {
- Label l, m, n, o, p;
- l = m - 1;
- m = n - 10;
- o = p + 100;
- p = n + 1000;
- EXPECT_EQ(1111U, o - l);
-}
-
-TEST(EquationDeathTest, EqualConstants) {
- Label m = 0x0d3962f280f07d24ULL;
- Label n = 0x0d3962f280f07d24ULL;
- m = n; // no death expected
-}
-
-TEST(EquationDeathTest, EqualIndirectConstants) {
- Label m = 0xa347f1e5238fe6a1ULL;
- Label n;
- Label o = n;
- n = 0xa347f1e5238fe6a1ULL;
- n = m; // no death expected
-}
-
-TEST(EquationDeathTest, ConstantClash) {
- Label m = 0xd4cc0f4f630ec741ULL;
- Label n = 0x934cd2d8254fc3eaULL;
- ASSERT_DEATH(m = n, "addend_ == addend");
-}
-
-TEST(EquationDeathTest, IndirectConstantClash) {
- Label m = 0xd4cc0f4f630ec741ULL;
- Label n, o;
- n = o;
- o = 0xcfbe3b83ac49ce86ULL;
- ASSERT_DEATH(m = n, "addend_ == addend");
-}
-
-// Assigning to a related label may free the next Binding on its
-// chain. This test always passes; it is interesting to memory
-// checkers and coverage analysis.
-TEST(LabelReferenceCount, AssignmentFree) {
- Label l;
- {
- Label m;
- l = m;
- }
- // This should free m's Binding.
- l = 0xca8bae92f0376d4fULL;
- ASSERT_EQ(0xca8bae92f0376d4fULL, l.Value());
-}
-
-// Finding the value of a label may free the Binding it refers to. This test
-// always passes; it is interesting to memory checkers and coverage analysis.
-TEST(LabelReferenceCount, FindValueFree) {
- Label l;
- {
- Label m, n;
- l = m;
- m = n;
- n = 0x7a0b0c576672daafULL;
- // At this point, l's Binding refers to m's Binding, which refers
- // to n's binding.
- }
- // Now, l is the only reference keeping the three Bindings alive.
- // Resolving its value should free l's and m's original bindings.
- ASSERT_EQ(0x7a0b0c576672daafULL, l.Value());
-}
-
-TEST(ConstructSection, Simple) {
- Section s;
-}
-
-TEST(ConstructSection, WithEndian) {
- Section s(kBigEndian);
-}
-
-// A fixture class for TestAssembler::Section tests.
-class SectionFixture {
- public:
- Section section;
- string contents;
- static const uint8_t data[];
- static const size_t data_size;
-};
-
-const uint8_t SectionFixture::data[] = {
- 0x87, 0x4f, 0x43, 0x67, 0x30, 0xd0, 0xd4, 0x0e
-};
-
-#define I0()
-#define I1(a) { a }
-#define I2(a,b) { a,b }
-#define I3(a,b,c) { a,b,c }
-#define I4(a,b,c,d) { a,b,c,d }
-#define I5(a,b,c,d,e) { a,b,c,d,e }
-#define I6(a,b,c,d,e,f) { a,b,c,d,e,f }
-#define I7(a,b,c,d,e,f,g) { a,b,c,d,e,f,g }
-#define I8(a,b,c,d,e,f,g,h) { a,b,c,d,e,f,g,h }
-#define I9(a,b,c,d,e,f,g,h,i) { a,b,c,d,e,f,g,h,i }
-#define ASSERT_BYTES(s, b) \
- do \
- { \
- static const uint8_t expected_bytes[] = b; \
- ASSERT_EQ(sizeof(expected_bytes), s.size()); \
- ASSERT_TRUE(memcmp(s.data(), (const char *) expected_bytes, \
- sizeof(expected_bytes)) == 0); \
- } \
- while(0)
-
-class Append: public SectionFixture, public Test { };
-
-TEST_F(Append, Bytes) {
- section.Append(data, sizeof(data));
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_EQ(sizeof(data), contents.size());
- EXPECT_TRUE(0 == memcmp(contents.data(), (const char *) data, sizeof(data)));
-}
-
-TEST_F(Append, BytesTwice) {
- section.Append(data, sizeof(data));
- section.Append(data, sizeof(data));
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_EQ(2 * sizeof(data), contents.size());
- ASSERT_TRUE(0 == memcmp(contents.data(), (const char *) data, sizeof(data)));
- ASSERT_TRUE(0 == memcmp(contents.data() + sizeof(data),
- (const char *) data, sizeof(data)));
-}
-
-TEST_F(Append, String) {
- string s1 = "howdy ";
- string s2 = "there";
- section.Append(s1);
- section.Append(s2);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_STREQ(contents.c_str(), "howdy there");
-}
-
-TEST_F(Append, CString) {
- section.AppendCString("howdy");
- section.AppendCString("");
- section.AppendCString("there");
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_EQ(string("howdy\0\0there\0", 13), contents);
-}
-
-TEST_F(Append, CStringSize) {
- section.AppendCString("howdy", 3);
- section.AppendCString("there", 5);
- section.AppendCString("fred", 6);
- section.AppendCString("natalie", 0);
- section.AppendCString("", 10);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_EQ(string("howtherefred\0\0\0\0\0\0\0\0\0\0\0\0", 24), contents);
-}
-
-TEST_F(Append, RepeatedBytes) {
- section.Append((size_t) 10, '*');
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_STREQ(contents.c_str(), "**********");
-}
-
-TEST_F(Append, GeneralLE1) {
- section.Append(kLittleEndian, 1, 42);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I1(42));
-}
-
-TEST_F(Append, GeneralLE2) {
- section.Append(kLittleEndian, 2, 0x15a1);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0xa1, 0x15));
-}
-
-TEST_F(Append, GeneralLE3) {
- section.Append(kLittleEndian, 3, 0x59ae8d);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x8d, 0xae, 0x59));
-}
-
-TEST_F(Append, GeneralLE4) {
- section.Append(kLittleEndian, 4, 0x51603c56);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I4(0x56, 0x3c, 0x60, 0x51));
-}
-
-TEST_F(Append, GeneralLE5) {
- section.Append(kLittleEndian, 5, 0x385e2803b4ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0xb4, 0x03, 0x28, 0x5e, 0x38));
-}
-
-TEST_F(Append, GeneralLE6) {
- section.Append(kLittleEndian, 6, 0xc7db9534dd1fULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I6(0x1f, 0xdd, 0x34, 0x95, 0xdb, 0xc7));
-}
-
-TEST_F(Append, GeneralLE7) {
- section.Append(kLittleEndian, 7, 0x1445c9f1b843e6ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I7(0xe6, 0x43, 0xb8, 0xf1, 0xc9, 0x45, 0x14));
-}
-
-TEST_F(Append, GeneralLE8) {
- section.Append(kLittleEndian, 8, 0xaf48019dfe5c01e5ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I8(0xe5, 0x01, 0x5c, 0xfe, 0x9d, 0x01, 0x48, 0xaf));
-}
-
-TEST_F(Append, GeneralBE1) {
- section.Append(kBigEndian, 1, 0xd0ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I1(0xd0));
-}
-
-TEST_F(Append, GeneralBE2) {
- section.Append(kBigEndian, 2, 0x2e7eULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2e, 0x7e));
-}
-
-TEST_F(Append, GeneralBE3) {
- section.Append(kBigEndian, 3, 0x37dad6ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x37, 0xda, 0xd6));
-}
-
-TEST_F(Append, GeneralBE4) {
- section.Append(kBigEndian, 4, 0x715935c7ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I4(0x71, 0x59, 0x35, 0xc7));
-}
-
-TEST_F(Append, GeneralBE5) {
- section.Append(kBigEndian, 5, 0x42baeb02b7ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x42, 0xba, 0xeb, 0x02, 0xb7));
-}
-
-TEST_F(Append, GeneralBE6) {
- section.Append(kBigEndian, 6, 0xf1cdf10e7b18ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I6(0xf1, 0xcd, 0xf1, 0x0e, 0x7b, 0x18));
-}
-
-TEST_F(Append, GeneralBE7) {
- section.Append(kBigEndian, 7, 0xf50a724f0b0d20ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I7(0xf5, 0x0a, 0x72, 0x4f, 0x0b, 0x0d, 0x20));
-}
-
-TEST_F(Append, GeneralBE8) {
- section.Append(kBigEndian, 8, 0xa6b2cb5e98dc9c16ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I8(0xa6, 0xb2, 0xcb, 0x5e, 0x98, 0xdc, 0x9c, 0x16));
-}
-
-TEST_F(Append, GeneralLE1Label) {
- Label l;
- section.Append(kLittleEndian, 1, l);
- l = 42;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I1(42));
-}
-
-TEST_F(Append, GeneralLE2Label) {
- Label l;
- section.Append(kLittleEndian, 2, l);
- l = 0x15a1;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0xa1, 0x15));
-}
-
-TEST_F(Append, GeneralLE3Label) {
- Label l;
- section.Append(kLittleEndian, 3, l);
- l = 0x59ae8d;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x8d, 0xae, 0x59));
-}
-
-TEST_F(Append, GeneralLE4Label) {
- Label l;
- section.Append(kLittleEndian, 4, l);
- l = 0x51603c56;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I4(0x56, 0x3c, 0x60, 0x51));
-}
-
-TEST_F(Append, GeneralLE5Label) {
- Label l;
- section.Append(kLittleEndian, 5, l);
- l = 0x385e2803b4ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0xb4, 0x03, 0x28, 0x5e, 0x38));
-}
-
-TEST_F(Append, GeneralLE6Label) {
- Label l;
- section.Append(kLittleEndian, 6, l);
- l = 0xc7db9534dd1fULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I6(0x1f, 0xdd, 0x34, 0x95, 0xdb, 0xc7));
-}
-
-TEST_F(Append, GeneralLE7Label) {
- Label l;
- section.Append(kLittleEndian, 7, l);
- l = 0x1445c9f1b843e6ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I7(0xe6, 0x43, 0xb8, 0xf1, 0xc9, 0x45, 0x14));
-}
-
-TEST_F(Append, GeneralLE8Label) {
- Label l;
- section.Append(kLittleEndian, 8, l);
- l = 0xaf48019dfe5c01e5ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I8(0xe5, 0x01, 0x5c, 0xfe, 0x9d, 0x01, 0x48, 0xaf));
-}
-
-TEST_F(Append, GeneralBE1Label) {
- Label l;
- section.Append(kBigEndian, 1, l);
- l = 0xd0ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I1(0xd0));
-}
-
-TEST_F(Append, GeneralBE2Label) {
- Label l;
- section.Append(kBigEndian, 2, l);
- l = 0x2e7eULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2e, 0x7e));
-}
-
-TEST_F(Append, GeneralBE3Label) {
- Label l;
- section.Append(kBigEndian, 3, l);
- l = 0x37dad6ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x37, 0xda, 0xd6));
-}
-
-TEST_F(Append, GeneralBE4Label) {
- Label l;
- section.Append(kBigEndian, 4, l);
- l = 0x715935c7ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I4(0x71, 0x59, 0x35, 0xc7));
-}
-
-TEST_F(Append, GeneralBE5Label) {
- Label l;
- section.Append(kBigEndian, 5, l);
- l = 0x42baeb02b7ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x42, 0xba, 0xeb, 0x02, 0xb7));
-}
-
-TEST_F(Append, GeneralBE6Label) {
- Label l;
- section.Append(kBigEndian, 6, l);
- l = 0xf1cdf10e7b18ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I6(0xf1, 0xcd, 0xf1, 0x0e, 0x7b, 0x18));
-}
-
-TEST_F(Append, GeneralBE7Label) {
- Label l;
- section.Append(kBigEndian, 7, l);
- l = 0xf50a724f0b0d20ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I7(0xf5, 0x0a, 0x72, 0x4f, 0x0b, 0x0d, 0x20));
-}
-
-TEST_F(Append, GeneralBE8Label) {
- Label l;
- section.Append(kBigEndian, 8, l);
- l = 0xa6b2cb5e98dc9c16ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I8(0xa6, 0xb2, 0xcb, 0x5e, 0x98, 0xdc, 0x9c, 0x16));
-}
-
-TEST_F(Append, B8) {
- section.Append(1, 0x2a);
- section.B8(0xd3U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0xd3));
-}
-
-TEST_F(Append, B8Label) {
- Label l;
- section.Append(1, 0x2a);
- section.B8(l);
- l = 0x4bU;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0x4b));
-}
-
-TEST_F(Append, B16) {
- section.Append(1, 0x2a);
- section.B16(0x472aU);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x47, 0x2a));
-}
-
-TEST_F(Append, B16Label) {
- Label l;
- section.Append(1, 0x2a);
- section.B16(l);
- l = 0x55e8U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x55, 0xe8));
-}
-
-TEST_F(Append, B32) {
- section.Append(1, 0x2a);
- section.B32(0xbd412cbcU);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0xbd, 0x41, 0x2c, 0xbc));
-}
-
-TEST_F(Append, B32Label) {
- Label l;
- section.Append(1, 0x2a);
- section.B32(l);
- l = 0x208e37d5U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0x20, 0x8e, 0x37, 0xd5));
-}
-
-TEST_F(Append, B64) {
- section.Append(1, 0x2a);
- section.B64(0x3402a013111e68adULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0x34, 0x02, 0xa0, 0x13, 0x11, 0x1e, 0x68, 0xad));
-}
-
-TEST_F(Append, B64Label) {
- Label l;
- section.Append(1, 0x2a);
- section.B64(l);
- l = 0x355dbfbb4ac6d57fULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0x35, 0x5d, 0xbf, 0xbb, 0x4a, 0xc6, 0xd5, 0x7f));
-}
-
-TEST_F(Append, L8) {
- section.Append(1, 0x2a);
- section.L8(0x26U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0x26));
-}
-
-TEST_F(Append, L8Label) {
- Label l;
- section.Append(1, 0x2a);
- section.L8(l);
- l = 0xa8U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0xa8));
-}
-
-TEST_F(Append, L16) {
- section.Append(1, 0x2a);
- section.L16(0xca6dU);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x6d, 0xca));
-}
-
-TEST_F(Append, L16Label) {
- Label l;
- section.Append(1, 0x2a);
- section.L16(l);
- l = 0xd21fU;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x1f, 0xd2));
-}
-
-TEST_F(Append, L32) {
- section.Append(1, 0x2a);
- section.L32(0x558f6181U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0x81, 0x61, 0x8f, 0x55));
-}
-
-TEST_F(Append, L32Label) {
- Label l;
- section.Append(1, 0x2a);
- section.L32(l);
- l = 0x4b810f82U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0x82, 0x0f, 0x81, 0x4b));
-}
-
-TEST_F(Append, L64) {
- section.Append(1, 0x2a);
- section.L64(0x564384f7579515bfULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0xbf, 0x15, 0x95, 0x57, 0xf7, 0x84, 0x43, 0x56));
-}
-
-TEST_F(Append, L64Label) {
- Label l;
- section.Append(1, 0x2a);
- section.L64(l);
- l = 0x424b1d020667c8dbULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0xdb, 0xc8, 0x67, 0x06, 0x02, 0x1d, 0x4b, 0x42));
-}
-
-TEST_F(Append, D8Big) {
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D8(0xe6U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0xe6));
-}
-
-TEST_F(Append, D8BigLabel) {
- Label l;
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D8(l);
- l = 0xeeU;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0xee));
-}
-
-TEST_F(Append, D16Big) {
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D16(0x83b1U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x83, 0xb1));
-}
-
-TEST_F(Append, D16BigLabel) {
- Label l;
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D16(l);
- l = 0x5b55U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x5b, 0x55));
-}
-
-TEST_F(Append, D32Big) {
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D32(0xd0b0e431U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0xd0, 0xb0, 0xe4, 0x31));
-}
-
-TEST_F(Append, D32BigLabel) {
- Label l;
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D32(l);
- l = 0x312fb340U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0x31, 0x2f, 0xb3, 0x40));
-}
-
-TEST_F(Append, D64Big) {
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D64(0xb109843500dbcb16ULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0xb1, 0x09, 0x84, 0x35, 0x00, 0xdb, 0xcb, 0x16));
-}
-
-TEST_F(Append, D64BigLabel) {
- Label l;
- section.set_endianness(kBigEndian);
- section.Append(1, 0x2a);
- section.D64(l);
- l = 0x9a0d61b70f671fd7ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0x9a, 0x0d, 0x61, 0xb7, 0x0f, 0x67, 0x1f, 0xd7));
-}
-
-TEST_F(Append, D8Little) {
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D8(0x42U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0x42));
-}
-
-TEST_F(Append, D8LittleLabel) {
- Label l;
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D8(l);
- l = 0x05U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I2(0x2a, 0x05));
-}
-
-TEST_F(Append, D16Little) {
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D16(0xc5c5U);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0xc5, 0xc5));
-}
-
-TEST_F(Append, D16LittleLabel) {
- Label l;
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D16(l);
- l = 0xb620U;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I3(0x2a, 0x20, 0xb6));
-}
-
-TEST_F(Append, D32Little) {
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D32(0x1a87d0feU);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0xfe, 0xd0, 0x87, 0x1a));
-}
-
-TEST_F(Append, D32LittleLabel) {
- Label l;
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D32(l);
- l = 0xb8012d6bU;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I5(0x2a, 0x6b, 0x2d, 0x01, 0xb8));
-}
-
-TEST_F(Append, D64Little) {
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D64(0x42de75c61375a1deULL);
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0xde, 0xa1, 0x75, 0x13, 0xc6, 0x75, 0xde, 0x42));
-}
-
-TEST_F(Append, D64LittleLabel) {
- Label l;
- section.set_endianness(kLittleEndian);
- section.Append(1, 0x2a);
- section.D64(l);
- l = 0x8b3bececf3fb5312ULL;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents,
- I9(0x2a, 0x12, 0x53, 0xfb, 0xf3, 0xec, 0xec, 0x3b, 0x8b));
-}
-
-TEST_F(Append, Variety) {
- Label a, b, c, d, e, f, g, h;
- section.Append(kBigEndian, 1, a)
- .Append(kLittleEndian, 8, h)
- .Append(kBigEndian, 1, 0x8bULL)
- .Append(kLittleEndian, 8, 0x0ea56540448f4439ULL)
- .Append(kBigEndian, 2, b)
- .Append(kLittleEndian, 7, g)
- .Append(kBigEndian, 2, 0xcf15ULL)
- .Append(kLittleEndian, 7, 0x29694f04c5724aULL)
- .Append(kBigEndian, 3, c)
- .Append(kLittleEndian, 6, f)
- .Append(kBigEndian, 3, 0x8c3ffdULL)
- .Append(kLittleEndian, 6, 0x6f11ba80187aULL)
- .Append(kBigEndian, 4, d)
- .Append(kLittleEndian, 5, e)
- .Append(kBigEndian, 4, 0x2fda2472ULL)
- .Append(kLittleEndian, 5, 0x0aa02d423fULL)
- .Append(kBigEndian, 5, e)
- .Append(kLittleEndian, 4, d)
- .Append(kBigEndian, 5, 0x53ba432138ULL)
- .Append(kLittleEndian, 4, 0xf139ae60ULL)
- .Append(kBigEndian, 6, f)
- .Append(kLittleEndian, 3, c)
- .Append(kBigEndian, 6, 0x168e436af716ULL)
- .Append(kLittleEndian, 3, 0x3ef189ULL)
- .Append(kBigEndian, 7, g)
- .Append(kLittleEndian, 2, b)
- .Append(kBigEndian, 7, 0xacd4ef233e47d9ULL)
- .Append(kLittleEndian, 2, 0x5311ULL)
- .Append(kBigEndian, 8, h)
- .Append(kLittleEndian, 1, a)
- .Append(kBigEndian, 8, 0x4668d5f1c93637a1ULL)
- .Append(kLittleEndian, 1, 0x65ULL);
- a = 0x79ac9bd8aa256b35ULL;
- b = 0x22d13097ef86c91cULL;
- c = 0xf204968b0a05862fULL;
- d = 0x163177f15a0eb4ecULL;
- e = 0xbd1b0f1d977f2246ULL;
- f = 0x2b0842eee83c6461ULL;
- g = 0x92f4b928a4bf875eULL;
- h = 0x61a199a8f7286ba6ULL;
- ASSERT_EQ(8 * 18U, section.Size());
- ASSERT_TRUE(section.GetContents(&contents));
-
- static const uint8_t expected[] = {
- 0x35, 0xa6, 0x6b, 0x28, 0xf7, 0xa8, 0x99, 0xa1, 0x61,
- 0x8b, 0x39, 0x44, 0x8f, 0x44, 0x40, 0x65, 0xa5, 0x0e,
- 0xc9, 0x1c, 0x5e, 0x87, 0xbf, 0xa4, 0x28, 0xb9, 0xf4,
- 0xcf, 0x15, 0x4a, 0x72, 0xc5, 0x04, 0x4f, 0x69, 0x29,
- 0x05, 0x86, 0x2f, 0x61, 0x64, 0x3c, 0xe8, 0xee, 0x42,
- 0x8c, 0x3f, 0xfd, 0x7a, 0x18, 0x80, 0xba, 0x11, 0x6f,
- 0x5a, 0x0e, 0xb4, 0xec, 0x46, 0x22, 0x7f, 0x97, 0x1d,
- 0x2f, 0xda, 0x24, 0x72, 0x3f, 0x42, 0x2d, 0xa0, 0x0a,
- 0x1d, 0x97, 0x7f, 0x22, 0x46, 0xec, 0xb4, 0x0e, 0x5a,
- 0x53, 0xba, 0x43, 0x21, 0x38, 0x60, 0xae, 0x39, 0xf1,
- 0x42, 0xee, 0xe8, 0x3c, 0x64, 0x61, 0x2f, 0x86, 0x05,
- 0x16, 0x8e, 0x43, 0x6a, 0xf7, 0x16, 0x89, 0xf1, 0x3e,
- 0xf4, 0xb9, 0x28, 0xa4, 0xbf, 0x87, 0x5e, 0x1c, 0xc9,
- 0xac, 0xd4, 0xef, 0x23, 0x3e, 0x47, 0xd9, 0x11, 0x53,
- 0x61, 0xa1, 0x99, 0xa8, 0xf7, 0x28, 0x6b, 0xa6, 0x35,
- 0x46, 0x68, 0xd5, 0xf1, 0xc9, 0x36, 0x37, 0xa1, 0x65,
- };
-
- ASSERT_TRUE(0 == memcmp(contents.data(), expected, sizeof(expected)));
-}
-
-TEST_F(Append, Section) {
- section.Append("murder");
- {
- Section middle;
- middle.Append(" she");
- section.Append(middle);
- }
- section.Append(" wrote");
- EXPECT_EQ(16U, section.Size());
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_STREQ(contents.c_str(), "murder she wrote");
-}
-
-TEST_F(Append, SectionRefs) {
- section.Append("sugar ");
- Label l;
- {
- Section middle;
- Label m;
- middle.B32(m);
- section.Append(middle);
- m = 0x66726565;
- }
- section.Append(" jazz");
- EXPECT_EQ(15U, section.Size());
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_STREQ(contents.c_str(), "sugar free jazz");
-}
-
-TEST_F(Append, LEB128_0) {
- section.LEB128(0);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\0", 1), contents);
-}
-
-TEST_F(Append, LEB128_0x3f) {
- section.LEB128(0x3f);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x3f", 1), contents);
-}
-
-TEST_F(Append, LEB128_0x40) {
- section.LEB128(0x40);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xc0\x00", 2), contents);
-}
-
-TEST_F(Append, LEB128_0x7f) {
- section.LEB128(0x7f);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\x00", 2), contents);
-}
-
-TEST_F(Append, LEB128_0x80) {
- section.LEB128(0x80);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x01", 2), contents);
-}
-
-TEST_F(Append, LEB128_0xff) {
- section.LEB128(0xff);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\x01", 2), contents);
-}
-
-TEST_F(Append, LEB128_0x1fff) {
- section.LEB128(0x1fff);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\x3f", 2), contents);
-}
-
-TEST_F(Append, LEB128_0x2000) {
- section.LEB128(0x2000);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\xc0\x00", 3), contents);
-}
-
-TEST_F(Append, LEB128_n1) {
- section.LEB128(-1);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x7f", 1), contents);
-}
-
-TEST_F(Append, LEB128_n0x40) {
- section.LEB128(-0x40);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x40", 1), contents);
-}
-
-TEST_F(Append, LEB128_n0x41) {
- section.LEB128(-0x41);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xbf\x7f", 2), contents);
-}
-
-TEST_F(Append, LEB128_n0x7f) {
- section.LEB128(-0x7f);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x81\x7f", 2), contents);
-}
-
-TEST_F(Append, LEB128_n0x80) {
- section.LEB128(-0x80);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x7f", 2), contents);
-}
-
-TEST_F(Append, LEB128_n0x2000) {
- section.LEB128(-0x2000);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x40", 2), contents);
-}
-
-TEST_F(Append, LEB128_n0x2001) {
- section.LEB128(-0x2001);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\xbf\x7f", 3), contents);
-}
-
-TEST_F(Append,ULEB128_0) {
- section.ULEB128(0);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\0", 1), contents);
-}
-
-TEST_F(Append,ULEB128_1) {
- section.ULEB128(1);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x01", 1), contents);
-}
-
-TEST_F(Append,ULEB128_0x3f) {
- section.ULEB128(0x3f);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x3f", 1), contents);
-}
-
-TEST_F(Append,ULEB128_0x40) {
- section.ULEB128(0x40);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x40", 1), contents);
-}
-
-TEST_F(Append,ULEB128_0x7f) {
- section.ULEB128(0x7f);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x7f", 1), contents);
-}
-
-TEST_F(Append,ULEB128_0x80) {
- section.ULEB128(0x80);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x01", 2), contents);
-}
-
-TEST_F(Append,ULEB128_0xff) {
- section.ULEB128(0xff);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\x01", 2), contents);
-}
-
-TEST_F(Append,ULEB128_0x100) {
- section.ULEB128(0x100);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x02", 2), contents);
-}
-
-TEST_F(Append,ULEB128_0x1fff) {
- section.ULEB128(0x1fff);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\x3f", 2), contents);
-}
-
-TEST_F(Append,ULEB128_0x2000) {
- section.ULEB128(0x2000);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x40", 2), contents);
-}
-
-TEST_F(Append,ULEB128_0x3fff) {
- section.ULEB128(0x3fff);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xff\x7f", 2), contents);
-}
-
-TEST_F(Append,ULEB128_0x4000) {
- section.ULEB128(0x4000);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x80\x01", 3), contents);
-}
-
-TEST_F(Append,ULEB128_12857) {
- section.ULEB128(12857);
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\xb9\x64", 2), contents);
-}
-
-TEST_F(Append, LEBChain) {
- section.LEB128(-0x80).ULEB128(12857).Append("*");
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x80\x7f\xb9\x64*", 5), contents);
-}
-
-
-class GetContents: public SectionFixture, public Test { };
-
-TEST_F(GetContents, Undefined) {
- Label l;
- section.Append(kLittleEndian, 8, l);
- ASSERT_FALSE(section.GetContents(&contents));
-}
-
-TEST_F(GetContents, ClearsContents) {
- section.Append((size_t) 10, '*');
- EXPECT_EQ(10U, section.Size());
- EXPECT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(0U, section.Size());
-}
-
-TEST_F(GetContents, ClearsReferences) {
- Label l;
- section.Append(kBigEndian, 1, l);
- l = 42;
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_BYTES(contents, I1(42));
- ASSERT_TRUE(section.GetContents(&contents)); // should not die
-}
-
-class Miscellanea: public SectionFixture, public Test { };
-
-TEST_F(Miscellanea, Clear) {
- section.Append("howdy");
- Label l;
- section.L32(l);
- EXPECT_EQ(9U, section.Size());
- section.Clear();
- EXPECT_EQ(0U, section.Size());
- l = 0x8d231bf0U;
- ASSERT_TRUE(section.GetContents(&contents)); // should not die
-}
-
-TEST_F(Miscellanea, Align) {
- section.Append("*");
- EXPECT_EQ(1U, section.Size());
- section.Align(4).Append("*");
- EXPECT_EQ(5U, section.Size());
- section.Append("*").Align(2);
- EXPECT_EQ(6U, section.Size());
-}
-
-TEST_F(Miscellanea, AlignPad) {
- section.Append("*");
- EXPECT_EQ(1U, section.Size());
- section.Align(4, ' ').Append("*");
- EXPECT_EQ(5U, section.Size());
- section.Append("*").Align(2, ' ');
- EXPECT_EQ(6U, section.Size());
- ASSERT_TRUE(section.GetContents(&contents));
- ASSERT_EQ(string("* **"), contents);
-}
-
-TEST_F(Miscellanea, StartHereMark) {
- Label m;
- section.Append(42, ' ').Mark(&m).Append(13, '+');
- EXPECT_EQ(42U, m - section.start());
- EXPECT_EQ(42U + 13U, section.Here() - section.start());
- EXPECT_FALSE(section.start().IsKnownConstant());
- EXPECT_FALSE(m.IsKnownConstant());
- EXPECT_FALSE(section.Here().IsKnownConstant());
-}
-
-TEST_F(Miscellanea, Endianness) {
- section.set_endianness(kBigEndian);
- EXPECT_EQ(kBigEndian, section.endianness());
- section.set_endianness(kLittleEndian);
- EXPECT_EQ(kLittleEndian, section.endianness());
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/testdata/func-line-pairing.h b/toolkit/crashreporter/google-breakpad/src/common/testdata/func-line-pairing.h
deleted file mode 100644
index 05538f961b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/testdata/func-line-pairing.h
+++ /dev/null
@@ -1,676 +0,0 @@
-// -*- mode: c++ -*-
-
-// Test data for pairing functions and lines.
-//
-// For a pair of functions that are adjacent (10,20),(20,25) and a
-// pair that are not (10,15),(20,25), we include a test case for every
-// possible arrangement of two lines relative to those functions. We
-// include cases only for non-empty ranges, since empty functions and
-// lines are dropped before we do any pairing.
-//
-// Each test case is represented by a macro call of the form:
-//
-// PAIRING(func1_start, func1_end, func2_start, func2_end,
-// line1_start, line1_end, line2_start, line2_end,
-// func1_num_lines, func2_num_lines,
-// func1_line1_start, func1_line1_end,
-// func1_line2_start, func1_line2_end,
-// func2_line1_start, func2_line1_end,
-// func2_line2_start, func2_line2_end,
-// uncovered_funcs, uncovered_lines)
-//
-// where:
-// - funcN_{start,end} is the range of the N'th function
-// - lineN_{start,end} is the range of the N'th function
-// - funcN_num_lines is the number of source lines that should be
-// paired with the N'th function
-// - funcN_lineM_{start,end} is the range of the M'th line
-// paired with the N'th function, where 0,0 indicates that
-// there should be no such line paired
-// - uncovered_funcs is the number of functions with area that is
-// uncovered by any line, and
-// - uncovered_lines is the reverse.
-
-// func1 func2 line1 line2 num pairing1 pairing2 uncovered
-PAIRING(10, 20, 20, 25, 6, 7, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #0
-PAIRING(10, 20, 20, 25, 6, 7, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #1
-PAIRING(10, 20, 20, 25, 6, 7, 7, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #2
-PAIRING(10, 20, 20, 25, 6, 7, 7, 20, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 2) // #3
-PAIRING(10, 20, 20, 25, 6, 7, 7, 21, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 2) // #4
-PAIRING(10, 20, 20, 25, 6, 7, 7, 25, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #5
-PAIRING(10, 20, 20, 25, 6, 7, 7, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #6
-PAIRING(10, 20, 20, 25, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #7
-PAIRING(10, 20, 20, 25, 6, 7, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #8
-PAIRING(10, 20, 20, 25, 6, 7, 8, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #9
-PAIRING(10, 20, 20, 25, 6, 7, 8, 20, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 2) // #10
-PAIRING(10, 20, 20, 25, 6, 7, 8, 21, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 2) // #11
-PAIRING(10, 20, 20, 25, 6, 7, 8, 25, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #12
-PAIRING(10, 20, 20, 25, 6, 7, 8, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #13
-PAIRING(10, 20, 20, 25, 6, 7, 10, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #14
-PAIRING(10, 20, 20, 25, 6, 7, 10, 20, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 1) // #15
-PAIRING(10, 20, 20, 25, 6, 7, 10, 21, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 1) // #16
-PAIRING(10, 20, 20, 25, 6, 7, 10, 25, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 1) // #17
-PAIRING(10, 20, 20, 25, 6, 7, 10, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #18
-PAIRING(10, 20, 20, 25, 6, 7, 11, 12, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #19
-PAIRING(10, 20, 20, 25, 6, 7, 11, 20, 1, 0, 11, 20, 0, 0, 0, 0, 0, 0, 2, 1) // #20
-PAIRING(10, 20, 20, 25, 6, 7, 11, 21, 1, 1, 11, 20, 0, 0, 20, 21, 0, 0, 2, 1) // #21
-PAIRING(10, 20, 20, 25, 6, 7, 11, 25, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 1) // #22
-PAIRING(10, 20, 20, 25, 6, 7, 11, 26, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 2) // #23
-PAIRING(10, 20, 20, 25, 6, 7, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #24
-PAIRING(10, 20, 20, 25, 6, 7, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #25
-PAIRING(10, 20, 20, 25, 6, 7, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #26
-PAIRING(10, 20, 20, 25, 6, 7, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #27
-PAIRING(10, 20, 20, 25, 6, 7, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #28
-PAIRING(10, 20, 20, 25, 6, 7, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #29
-PAIRING(10, 20, 20, 25, 6, 7, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #30
-PAIRING(10, 20, 20, 25, 6, 7, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #31
-PAIRING(10, 20, 20, 25, 6, 10, 10, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #32
-PAIRING(10, 20, 20, 25, 6, 10, 10, 20, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 1) // #33
-PAIRING(10, 20, 20, 25, 6, 10, 10, 21, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 1) // #34
-PAIRING(10, 20, 20, 25, 6, 10, 10, 25, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 1) // #35
-PAIRING(10, 20, 20, 25, 6, 10, 10, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #36
-PAIRING(10, 20, 20, 25, 6, 10, 11, 12, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #37
-PAIRING(10, 20, 20, 25, 6, 10, 11, 20, 1, 0, 11, 20, 0, 0, 0, 0, 0, 0, 2, 1) // #38
-PAIRING(10, 20, 20, 25, 6, 10, 11, 21, 1, 1, 11, 20, 0, 0, 20, 21, 0, 0, 2, 1) // #39
-PAIRING(10, 20, 20, 25, 6, 10, 11, 25, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 1) // #40
-PAIRING(10, 20, 20, 25, 6, 10, 11, 26, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 2) // #41
-PAIRING(10, 20, 20, 25, 6, 10, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #42
-PAIRING(10, 20, 20, 25, 6, 10, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #43
-PAIRING(10, 20, 20, 25, 6, 10, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #44
-PAIRING(10, 20, 20, 25, 6, 10, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #45
-PAIRING(10, 20, 20, 25, 6, 10, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #46
-PAIRING(10, 20, 20, 25, 6, 10, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #47
-PAIRING(10, 20, 20, 25, 6, 10, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #48
-PAIRING(10, 20, 20, 25, 6, 10, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #49
-PAIRING(10, 20, 20, 25, 6, 11, 11, 12, 2, 0, 10, 11, 11, 12, 0, 0, 0, 0, 2, 1) // #50
-PAIRING(10, 20, 20, 25, 6, 11, 11, 20, 2, 0, 10, 11, 11, 20, 0, 0, 0, 0, 1, 1) // #51
-PAIRING(10, 20, 20, 25, 6, 11, 11, 21, 2, 1, 10, 11, 11, 20, 20, 21, 0, 0, 1, 1) // #52
-PAIRING(10, 20, 20, 25, 6, 11, 11, 25, 2, 1, 10, 11, 11, 20, 20, 25, 0, 0, 0, 1) // #53
-PAIRING(10, 20, 20, 25, 6, 11, 11, 26, 2, 1, 10, 11, 11, 20, 20, 25, 0, 0, 0, 2) // #54
-PAIRING(10, 20, 20, 25, 6, 11, 12, 13, 2, 0, 10, 11, 12, 13, 0, 0, 0, 0, 2, 1) // #55
-PAIRING(10, 20, 20, 25, 6, 11, 12, 20, 2, 0, 10, 11, 12, 20, 0, 0, 0, 0, 2, 1) // #56
-PAIRING(10, 20, 20, 25, 6, 11, 12, 21, 2, 1, 10, 11, 12, 20, 20, 21, 0, 0, 2, 1) // #57
-PAIRING(10, 20, 20, 25, 6, 11, 12, 25, 2, 1, 10, 11, 12, 20, 20, 25, 0, 0, 1, 1) // #58
-PAIRING(10, 20, 20, 25, 6, 11, 12, 26, 2, 1, 10, 11, 12, 20, 20, 25, 0, 0, 1, 2) // #59
-PAIRING(10, 20, 20, 25, 6, 11, 20, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 1) // #60
-PAIRING(10, 20, 20, 25, 6, 11, 20, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #61
-PAIRING(10, 20, 20, 25, 6, 11, 20, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 2) // #62
-PAIRING(10, 20, 20, 25, 6, 11, 21, 22, 1, 1, 10, 11, 0, 0, 21, 22, 0, 0, 2, 1) // #63
-PAIRING(10, 20, 20, 25, 6, 11, 21, 25, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 1) // #64
-PAIRING(10, 20, 20, 25, 6, 11, 21, 26, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 2) // #65
-PAIRING(10, 20, 20, 25, 6, 11, 25, 26, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #66
-PAIRING(10, 20, 20, 25, 6, 11, 26, 27, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #67
-PAIRING(10, 20, 20, 25, 6, 20, 20, 21, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 1) // #68
-PAIRING(10, 20, 20, 25, 6, 20, 20, 25, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 1) // #69
-PAIRING(10, 20, 20, 25, 6, 20, 20, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #70
-PAIRING(10, 20, 20, 25, 6, 20, 21, 22, 1, 1, 10, 20, 0, 0, 21, 22, 0, 0, 1, 1) // #71
-PAIRING(10, 20, 20, 25, 6, 20, 21, 25, 1, 1, 10, 20, 0, 0, 21, 25, 0, 0, 1, 1) // #72
-PAIRING(10, 20, 20, 25, 6, 20, 21, 26, 1, 1, 10, 20, 0, 0, 21, 25, 0, 0, 1, 2) // #73
-PAIRING(10, 20, 20, 25, 6, 20, 25, 26, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 2) // #74
-PAIRING(10, 20, 20, 25, 6, 20, 26, 27, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 2) // #75
-PAIRING(10, 20, 20, 25, 6, 21, 21, 22, 1, 2, 10, 20, 0, 0, 20, 21, 21, 22, 1, 1) // #76
-PAIRING(10, 20, 20, 25, 6, 21, 21, 25, 1, 2, 10, 20, 0, 0, 20, 21, 21, 25, 0, 1) // #77
-PAIRING(10, 20, 20, 25, 6, 21, 21, 26, 1, 2, 10, 20, 0, 0, 20, 21, 21, 25, 0, 2) // #78
-PAIRING(10, 20, 20, 25, 6, 21, 22, 23, 1, 2, 10, 20, 0, 0, 20, 21, 22, 23, 1, 1) // #79
-PAIRING(10, 20, 20, 25, 6, 21, 22, 25, 1, 2, 10, 20, 0, 0, 20, 21, 22, 25, 1, 1) // #80
-PAIRING(10, 20, 20, 25, 6, 21, 22, 26, 1, 2, 10, 20, 0, 0, 20, 21, 22, 25, 1, 2) // #81
-PAIRING(10, 20, 20, 25, 6, 21, 25, 26, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 2) // #82
-PAIRING(10, 20, 20, 25, 6, 21, 26, 27, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 2) // #83
-PAIRING(10, 20, 20, 25, 6, 25, 25, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #84
-PAIRING(10, 20, 20, 25, 6, 25, 26, 27, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #85
-PAIRING(10, 20, 20, 25, 6, 26, 26, 27, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #86
-PAIRING(10, 20, 20, 25, 6, 26, 27, 28, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #87
-PAIRING(10, 20, 20, 25, 10, 11, 11, 12, 2, 0, 10, 11, 11, 12, 0, 0, 0, 0, 2, 0) // #88
-PAIRING(10, 20, 20, 25, 10, 11, 11, 20, 2, 0, 10, 11, 11, 20, 0, 0, 0, 0, 1, 0) // #89
-PAIRING(10, 20, 20, 25, 10, 11, 11, 21, 2, 1, 10, 11, 11, 20, 20, 21, 0, 0, 1, 0) // #90
-PAIRING(10, 20, 20, 25, 10, 11, 11, 25, 2, 1, 10, 11, 11, 20, 20, 25, 0, 0, 0, 0) // #91
-PAIRING(10, 20, 20, 25, 10, 11, 11, 26, 2, 1, 10, 11, 11, 20, 20, 25, 0, 0, 0, 1) // #92
-PAIRING(10, 20, 20, 25, 10, 11, 12, 13, 2, 0, 10, 11, 12, 13, 0, 0, 0, 0, 2, 0) // #93
-PAIRING(10, 20, 20, 25, 10, 11, 12, 20, 2, 0, 10, 11, 12, 20, 0, 0, 0, 0, 2, 0) // #94
-PAIRING(10, 20, 20, 25, 10, 11, 12, 21, 2, 1, 10, 11, 12, 20, 20, 21, 0, 0, 2, 0) // #95
-PAIRING(10, 20, 20, 25, 10, 11, 12, 25, 2, 1, 10, 11, 12, 20, 20, 25, 0, 0, 1, 0) // #96
-PAIRING(10, 20, 20, 25, 10, 11, 12, 26, 2, 1, 10, 11, 12, 20, 20, 25, 0, 0, 1, 1) // #97
-PAIRING(10, 20, 20, 25, 10, 11, 20, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 0) // #98
-PAIRING(10, 20, 20, 25, 10, 11, 20, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 0) // #99
-PAIRING(10, 20, 20, 25, 10, 11, 20, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #100
-PAIRING(10, 20, 20, 25, 10, 11, 21, 22, 1, 1, 10, 11, 0, 0, 21, 22, 0, 0, 2, 0) // #101
-PAIRING(10, 20, 20, 25, 10, 11, 21, 25, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 0) // #102
-PAIRING(10, 20, 20, 25, 10, 11, 21, 26, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 1) // #103
-PAIRING(10, 20, 20, 25, 10, 11, 25, 26, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #104
-PAIRING(10, 20, 20, 25, 10, 11, 26, 27, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #105
-PAIRING(10, 20, 20, 25, 10, 20, 20, 21, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 0) // #106
-PAIRING(10, 20, 20, 25, 10, 20, 20, 25, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 0) // #107
-PAIRING(10, 20, 20, 25, 10, 20, 20, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 1) // #108
-PAIRING(10, 20, 20, 25, 10, 20, 21, 22, 1, 1, 10, 20, 0, 0, 21, 22, 0, 0, 1, 0) // #109
-PAIRING(10, 20, 20, 25, 10, 20, 21, 25, 1, 1, 10, 20, 0, 0, 21, 25, 0, 0, 1, 0) // #110
-PAIRING(10, 20, 20, 25, 10, 20, 21, 26, 1, 1, 10, 20, 0, 0, 21, 25, 0, 0, 1, 1) // #111
-PAIRING(10, 20, 20, 25, 10, 20, 25, 26, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 1) // #112
-PAIRING(10, 20, 20, 25, 10, 20, 26, 27, 1, 0, 10, 20, 0, 0, 0, 0, 0, 0, 1, 1) // #113
-PAIRING(10, 20, 20, 25, 10, 21, 21, 22, 1, 2, 10, 20, 0, 0, 20, 21, 21, 22, 1, 0) // #114
-PAIRING(10, 20, 20, 25, 10, 21, 21, 25, 1, 2, 10, 20, 0, 0, 20, 21, 21, 25, 0, 0) // #115
-PAIRING(10, 20, 20, 25, 10, 21, 21, 26, 1, 2, 10, 20, 0, 0, 20, 21, 21, 25, 0, 1) // #116
-PAIRING(10, 20, 20, 25, 10, 21, 22, 23, 1, 2, 10, 20, 0, 0, 20, 21, 22, 23, 1, 0) // #117
-PAIRING(10, 20, 20, 25, 10, 21, 22, 25, 1, 2, 10, 20, 0, 0, 20, 21, 22, 25, 1, 0) // #118
-PAIRING(10, 20, 20, 25, 10, 21, 22, 26, 1, 2, 10, 20, 0, 0, 20, 21, 22, 25, 1, 1) // #119
-PAIRING(10, 20, 20, 25, 10, 21, 25, 26, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 1) // #120
-PAIRING(10, 20, 20, 25, 10, 21, 26, 27, 1, 1, 10, 20, 0, 0, 20, 21, 0, 0, 1, 1) // #121
-PAIRING(10, 20, 20, 25, 10, 25, 25, 26, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 1) // #122
-PAIRING(10, 20, 20, 25, 10, 25, 26, 27, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 1) // #123
-PAIRING(10, 20, 20, 25, 10, 26, 26, 27, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #124
-PAIRING(10, 20, 20, 25, 10, 26, 27, 28, 1, 1, 10, 20, 0, 0, 20, 25, 0, 0, 0, 2) // #125
-PAIRING(10, 20, 20, 25, 11, 12, 12, 13, 2, 0, 11, 12, 12, 13, 0, 0, 0, 0, 2, 0) // #126
-PAIRING(10, 20, 20, 25, 11, 12, 12, 20, 2, 0, 11, 12, 12, 20, 0, 0, 0, 0, 2, 0) // #127
-PAIRING(10, 20, 20, 25, 11, 12, 12, 21, 2, 1, 11, 12, 12, 20, 20, 21, 0, 0, 2, 0) // #128
-PAIRING(10, 20, 20, 25, 11, 12, 12, 25, 2, 1, 11, 12, 12, 20, 20, 25, 0, 0, 1, 0) // #129
-PAIRING(10, 20, 20, 25, 11, 12, 12, 26, 2, 1, 11, 12, 12, 20, 20, 25, 0, 0, 1, 1) // #130
-PAIRING(10, 20, 20, 25, 11, 12, 13, 14, 2, 0, 11, 12, 13, 14, 0, 0, 0, 0, 2, 0) // #131
-PAIRING(10, 20, 20, 25, 11, 12, 13, 20, 2, 0, 11, 12, 13, 20, 0, 0, 0, 0, 2, 0) // #132
-PAIRING(10, 20, 20, 25, 11, 12, 13, 21, 2, 1, 11, 12, 13, 20, 20, 21, 0, 0, 2, 0) // #133
-PAIRING(10, 20, 20, 25, 11, 12, 13, 25, 2, 1, 11, 12, 13, 20, 20, 25, 0, 0, 1, 0) // #134
-PAIRING(10, 20, 20, 25, 11, 12, 13, 26, 2, 1, 11, 12, 13, 20, 20, 25, 0, 0, 1, 1) // #135
-PAIRING(10, 20, 20, 25, 11, 12, 20, 21, 1, 1, 11, 12, 0, 0, 20, 21, 0, 0, 2, 0) // #136
-PAIRING(10, 20, 20, 25, 11, 12, 20, 25, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 0) // #137
-PAIRING(10, 20, 20, 25, 11, 12, 20, 26, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 1) // #138
-PAIRING(10, 20, 20, 25, 11, 12, 21, 22, 1, 1, 11, 12, 0, 0, 21, 22, 0, 0, 2, 0) // #139
-PAIRING(10, 20, 20, 25, 11, 12, 21, 25, 1, 1, 11, 12, 0, 0, 21, 25, 0, 0, 2, 0) // #140
-PAIRING(10, 20, 20, 25, 11, 12, 21, 26, 1, 1, 11, 12, 0, 0, 21, 25, 0, 0, 2, 1) // #141
-PAIRING(10, 20, 20, 25, 11, 12, 25, 26, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #142
-PAIRING(10, 20, 20, 25, 11, 12, 26, 27, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #143
-PAIRING(10, 20, 20, 25, 11, 20, 20, 21, 1, 1, 11, 20, 0, 0, 20, 21, 0, 0, 2, 0) // #144
-PAIRING(10, 20, 20, 25, 11, 20, 20, 25, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 0) // #145
-PAIRING(10, 20, 20, 25, 11, 20, 20, 26, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 1) // #146
-PAIRING(10, 20, 20, 25, 11, 20, 21, 22, 1, 1, 11, 20, 0, 0, 21, 22, 0, 0, 2, 0) // #147
-PAIRING(10, 20, 20, 25, 11, 20, 21, 25, 1, 1, 11, 20, 0, 0, 21, 25, 0, 0, 2, 0) // #148
-PAIRING(10, 20, 20, 25, 11, 20, 21, 26, 1, 1, 11, 20, 0, 0, 21, 25, 0, 0, 2, 1) // #149
-PAIRING(10, 20, 20, 25, 11, 20, 25, 26, 1, 0, 11, 20, 0, 0, 0, 0, 0, 0, 2, 1) // #150
-PAIRING(10, 20, 20, 25, 11, 20, 26, 27, 1, 0, 11, 20, 0, 0, 0, 0, 0, 0, 2, 1) // #151
-PAIRING(10, 20, 20, 25, 11, 21, 21, 22, 1, 2, 11, 20, 0, 0, 20, 21, 21, 22, 2, 0) // #152
-PAIRING(10, 20, 20, 25, 11, 21, 21, 25, 1, 2, 11, 20, 0, 0, 20, 21, 21, 25, 1, 0) // #153
-PAIRING(10, 20, 20, 25, 11, 21, 21, 26, 1, 2, 11, 20, 0, 0, 20, 21, 21, 25, 1, 1) // #154
-PAIRING(10, 20, 20, 25, 11, 21, 22, 23, 1, 2, 11, 20, 0, 0, 20, 21, 22, 23, 2, 0) // #155
-PAIRING(10, 20, 20, 25, 11, 21, 22, 25, 1, 2, 11, 20, 0, 0, 20, 21, 22, 25, 2, 0) // #156
-PAIRING(10, 20, 20, 25, 11, 21, 22, 26, 1, 2, 11, 20, 0, 0, 20, 21, 22, 25, 2, 1) // #157
-PAIRING(10, 20, 20, 25, 11, 21, 25, 26, 1, 1, 11, 20, 0, 0, 20, 21, 0, 0, 2, 1) // #158
-PAIRING(10, 20, 20, 25, 11, 21, 26, 27, 1, 1, 11, 20, 0, 0, 20, 21, 0, 0, 2, 1) // #159
-PAIRING(10, 20, 20, 25, 11, 25, 25, 26, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 1) // #160
-PAIRING(10, 20, 20, 25, 11, 25, 26, 27, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 1) // #161
-PAIRING(10, 20, 20, 25, 11, 26, 26, 27, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 2) // #162
-PAIRING(10, 20, 20, 25, 11, 26, 27, 28, 1, 1, 11, 20, 0, 0, 20, 25, 0, 0, 1, 2) // #163
-PAIRING(10, 20, 20, 25, 20, 21, 21, 22, 0, 2, 0, 0, 0, 0, 20, 21, 21, 22, 2, 0) // #164
-PAIRING(10, 20, 20, 25, 20, 21, 21, 25, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 0) // #165
-PAIRING(10, 20, 20, 25, 20, 21, 21, 26, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 1) // #166
-PAIRING(10, 20, 20, 25, 20, 21, 22, 23, 0, 2, 0, 0, 0, 0, 20, 21, 22, 23, 2, 0) // #167
-PAIRING(10, 20, 20, 25, 20, 21, 22, 25, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 0) // #168
-PAIRING(10, 20, 20, 25, 20, 21, 22, 26, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 1) // #169
-PAIRING(10, 20, 20, 25, 20, 21, 25, 26, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #170
-PAIRING(10, 20, 20, 25, 20, 21, 26, 27, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #171
-PAIRING(10, 20, 20, 25, 20, 25, 25, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #172
-PAIRING(10, 20, 20, 25, 20, 25, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #173
-PAIRING(10, 20, 20, 25, 20, 26, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #174
-PAIRING(10, 20, 20, 25, 20, 26, 27, 28, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #175
-PAIRING(10, 20, 20, 25, 21, 22, 22, 23, 0, 2, 0, 0, 0, 0, 21, 22, 22, 23, 2, 0) // #176
-PAIRING(10, 20, 20, 25, 21, 22, 22, 25, 0, 2, 0, 0, 0, 0, 21, 22, 22, 25, 2, 0) // #177
-PAIRING(10, 20, 20, 25, 21, 22, 22, 26, 0, 2, 0, 0, 0, 0, 21, 22, 22, 25, 2, 1) // #178
-PAIRING(10, 20, 20, 25, 21, 22, 23, 24, 0, 2, 0, 0, 0, 0, 21, 22, 23, 24, 2, 0) // #179
-PAIRING(10, 20, 20, 25, 21, 22, 23, 25, 0, 2, 0, 0, 0, 0, 21, 22, 23, 25, 2, 0) // #180
-PAIRING(10, 20, 20, 25, 21, 22, 23, 26, 0, 2, 0, 0, 0, 0, 21, 22, 23, 25, 2, 1) // #181
-PAIRING(10, 20, 20, 25, 21, 22, 25, 26, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #182
-PAIRING(10, 20, 20, 25, 21, 22, 26, 27, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #183
-PAIRING(10, 20, 20, 25, 21, 25, 25, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #184
-PAIRING(10, 20, 20, 25, 21, 25, 26, 27, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #185
-PAIRING(10, 20, 20, 25, 21, 26, 26, 27, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #186
-PAIRING(10, 20, 20, 25, 21, 26, 27, 28, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #187
-PAIRING(10, 20, 20, 25, 25, 26, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #188
-PAIRING(10, 20, 20, 25, 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #189
-PAIRING(10, 20, 20, 25, 26, 27, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #190
-PAIRING(10, 20, 20, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #191
-PAIRING(10, 15, 20, 25, 6, 7, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #192
-PAIRING(10, 15, 20, 25, 6, 7, 7, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #193
-PAIRING(10, 15, 20, 25, 6, 7, 7, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #194
-PAIRING(10, 15, 20, 25, 6, 7, 7, 15, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #195
-PAIRING(10, 15, 20, 25, 6, 7, 7, 16, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #196
-PAIRING(10, 15, 20, 25, 6, 7, 7, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #197
-PAIRING(10, 15, 20, 25, 6, 7, 7, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #198
-PAIRING(10, 15, 20, 25, 6, 7, 7, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #199
-PAIRING(10, 15, 20, 25, 6, 7, 7, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #200
-PAIRING(10, 15, 20, 25, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #201
-PAIRING(10, 15, 20, 25, 6, 7, 8, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #202
-PAIRING(10, 15, 20, 25, 6, 7, 8, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #203
-PAIRING(10, 15, 20, 25, 6, 7, 8, 15, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #204
-PAIRING(10, 15, 20, 25, 6, 7, 8, 16, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #205
-PAIRING(10, 15, 20, 25, 6, 7, 8, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #206
-PAIRING(10, 15, 20, 25, 6, 7, 8, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #207
-PAIRING(10, 15, 20, 25, 6, 7, 8, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #208
-PAIRING(10, 15, 20, 25, 6, 7, 8, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #209
-PAIRING(10, 15, 20, 25, 6, 7, 10, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #210
-PAIRING(10, 15, 20, 25, 6, 7, 10, 15, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #211
-PAIRING(10, 15, 20, 25, 6, 7, 10, 16, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #212
-PAIRING(10, 15, 20, 25, 6, 7, 10, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #213
-PAIRING(10, 15, 20, 25, 6, 7, 10, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #214
-PAIRING(10, 15, 20, 25, 6, 7, 10, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #215
-PAIRING(10, 15, 20, 25, 6, 7, 10, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #216
-PAIRING(10, 15, 20, 25, 6, 7, 11, 12, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #217
-PAIRING(10, 15, 20, 25, 6, 7, 11, 15, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #218
-PAIRING(10, 15, 20, 25, 6, 7, 11, 16, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #219
-PAIRING(10, 15, 20, 25, 6, 7, 11, 20, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #220
-PAIRING(10, 15, 20, 25, 6, 7, 11, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 2) // #221
-PAIRING(10, 15, 20, 25, 6, 7, 11, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #222
-PAIRING(10, 15, 20, 25, 6, 7, 11, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #223
-PAIRING(10, 15, 20, 25, 6, 7, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #224
-PAIRING(10, 15, 20, 25, 6, 7, 15, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #225
-PAIRING(10, 15, 20, 25, 6, 7, 15, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #226
-PAIRING(10, 15, 20, 25, 6, 7, 15, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #227
-PAIRING(10, 15, 20, 25, 6, 7, 15, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #228
-PAIRING(10, 15, 20, 25, 6, 7, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #229
-PAIRING(10, 15, 20, 25, 6, 7, 16, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #230
-PAIRING(10, 15, 20, 25, 6, 7, 16, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #231
-PAIRING(10, 15, 20, 25, 6, 7, 16, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #232
-PAIRING(10, 15, 20, 25, 6, 7, 16, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #233
-PAIRING(10, 15, 20, 25, 6, 7, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #234
-PAIRING(10, 15, 20, 25, 6, 7, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #235
-PAIRING(10, 15, 20, 25, 6, 7, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #236
-PAIRING(10, 15, 20, 25, 6, 7, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #237
-PAIRING(10, 15, 20, 25, 6, 7, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #238
-PAIRING(10, 15, 20, 25, 6, 7, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #239
-PAIRING(10, 15, 20, 25, 6, 7, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #240
-PAIRING(10, 15, 20, 25, 6, 7, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #241
-PAIRING(10, 15, 20, 25, 6, 10, 10, 11, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #242
-PAIRING(10, 15, 20, 25, 6, 10, 10, 15, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #243
-PAIRING(10, 15, 20, 25, 6, 10, 10, 16, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #244
-PAIRING(10, 15, 20, 25, 6, 10, 10, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #245
-PAIRING(10, 15, 20, 25, 6, 10, 10, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #246
-PAIRING(10, 15, 20, 25, 6, 10, 10, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #247
-PAIRING(10, 15, 20, 25, 6, 10, 10, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #248
-PAIRING(10, 15, 20, 25, 6, 10, 11, 12, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #249
-PAIRING(10, 15, 20, 25, 6, 10, 11, 15, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #250
-PAIRING(10, 15, 20, 25, 6, 10, 11, 16, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #251
-PAIRING(10, 15, 20, 25, 6, 10, 11, 20, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #252
-PAIRING(10, 15, 20, 25, 6, 10, 11, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 2) // #253
-PAIRING(10, 15, 20, 25, 6, 10, 11, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #254
-PAIRING(10, 15, 20, 25, 6, 10, 11, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #255
-PAIRING(10, 15, 20, 25, 6, 10, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #256
-PAIRING(10, 15, 20, 25, 6, 10, 15, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #257
-PAIRING(10, 15, 20, 25, 6, 10, 15, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #258
-PAIRING(10, 15, 20, 25, 6, 10, 15, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #259
-PAIRING(10, 15, 20, 25, 6, 10, 15, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #260
-PAIRING(10, 15, 20, 25, 6, 10, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #261
-PAIRING(10, 15, 20, 25, 6, 10, 16, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #262
-PAIRING(10, 15, 20, 25, 6, 10, 16, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #263
-PAIRING(10, 15, 20, 25, 6, 10, 16, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #264
-PAIRING(10, 15, 20, 25, 6, 10, 16, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #265
-PAIRING(10, 15, 20, 25, 6, 10, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #266
-PAIRING(10, 15, 20, 25, 6, 10, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #267
-PAIRING(10, 15, 20, 25, 6, 10, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #268
-PAIRING(10, 15, 20, 25, 6, 10, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #269
-PAIRING(10, 15, 20, 25, 6, 10, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #270
-PAIRING(10, 15, 20, 25, 6, 10, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #271
-PAIRING(10, 15, 20, 25, 6, 10, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #272
-PAIRING(10, 15, 20, 25, 6, 10, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #273
-PAIRING(10, 15, 20, 25, 6, 11, 11, 12, 2, 0, 10, 11, 11, 12, 0, 0, 0, 0, 2, 1) // #274
-PAIRING(10, 15, 20, 25, 6, 11, 11, 15, 2, 0, 10, 11, 11, 15, 0, 0, 0, 0, 1, 1) // #275
-PAIRING(10, 15, 20, 25, 6, 11, 11, 16, 2, 0, 10, 11, 11, 15, 0, 0, 0, 0, 1, 2) // #276
-PAIRING(10, 15, 20, 25, 6, 11, 11, 20, 2, 0, 10, 11, 11, 15, 0, 0, 0, 0, 1, 1) // #277
-PAIRING(10, 15, 20, 25, 6, 11, 11, 21, 2, 1, 10, 11, 11, 15, 20, 21, 0, 0, 1, 2) // #278
-PAIRING(10, 15, 20, 25, 6, 11, 11, 25, 2, 1, 10, 11, 11, 15, 20, 25, 0, 0, 0, 2) // #279
-PAIRING(10, 15, 20, 25, 6, 11, 11, 26, 2, 1, 10, 11, 11, 15, 20, 25, 0, 0, 0, 2) // #280
-PAIRING(10, 15, 20, 25, 6, 11, 12, 13, 2, 0, 10, 11, 12, 13, 0, 0, 0, 0, 2, 1) // #281
-PAIRING(10, 15, 20, 25, 6, 11, 12, 15, 2, 0, 10, 11, 12, 15, 0, 0, 0, 0, 2, 1) // #282
-PAIRING(10, 15, 20, 25, 6, 11, 12, 16, 2, 0, 10, 11, 12, 15, 0, 0, 0, 0, 2, 2) // #283
-PAIRING(10, 15, 20, 25, 6, 11, 12, 20, 2, 0, 10, 11, 12, 15, 0, 0, 0, 0, 2, 1) // #284
-PAIRING(10, 15, 20, 25, 6, 11, 12, 21, 2, 1, 10, 11, 12, 15, 20, 21, 0, 0, 2, 2) // #285
-PAIRING(10, 15, 20, 25, 6, 11, 12, 25, 2, 1, 10, 11, 12, 15, 20, 25, 0, 0, 1, 2) // #286
-PAIRING(10, 15, 20, 25, 6, 11, 12, 26, 2, 1, 10, 11, 12, 15, 20, 25, 0, 0, 1, 2) // #287
-PAIRING(10, 15, 20, 25, 6, 11, 15, 16, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #288
-PAIRING(10, 15, 20, 25, 6, 11, 15, 20, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #289
-PAIRING(10, 15, 20, 25, 6, 11, 15, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 2) // #290
-PAIRING(10, 15, 20, 25, 6, 11, 15, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 2) // #291
-PAIRING(10, 15, 20, 25, 6, 11, 15, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 2) // #292
-PAIRING(10, 15, 20, 25, 6, 11, 16, 17, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #293
-PAIRING(10, 15, 20, 25, 6, 11, 16, 20, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #294
-PAIRING(10, 15, 20, 25, 6, 11, 16, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 2) // #295
-PAIRING(10, 15, 20, 25, 6, 11, 16, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 2) // #296
-PAIRING(10, 15, 20, 25, 6, 11, 16, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 2) // #297
-PAIRING(10, 15, 20, 25, 6, 11, 20, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 1) // #298
-PAIRING(10, 15, 20, 25, 6, 11, 20, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #299
-PAIRING(10, 15, 20, 25, 6, 11, 20, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 2) // #300
-PAIRING(10, 15, 20, 25, 6, 11, 21, 22, 1, 1, 10, 11, 0, 0, 21, 22, 0, 0, 2, 1) // #301
-PAIRING(10, 15, 20, 25, 6, 11, 21, 25, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 1) // #302
-PAIRING(10, 15, 20, 25, 6, 11, 21, 26, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 2) // #303
-PAIRING(10, 15, 20, 25, 6, 11, 25, 26, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #304
-PAIRING(10, 15, 20, 25, 6, 11, 26, 27, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 2) // #305
-PAIRING(10, 15, 20, 25, 6, 15, 15, 16, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #306
-PAIRING(10, 15, 20, 25, 6, 15, 15, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #307
-PAIRING(10, 15, 20, 25, 6, 15, 15, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #308
-PAIRING(10, 15, 20, 25, 6, 15, 15, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #309
-PAIRING(10, 15, 20, 25, 6, 15, 15, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #310
-PAIRING(10, 15, 20, 25, 6, 15, 16, 17, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #311
-PAIRING(10, 15, 20, 25, 6, 15, 16, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #312
-PAIRING(10, 15, 20, 25, 6, 15, 16, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #313
-PAIRING(10, 15, 20, 25, 6, 15, 16, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #314
-PAIRING(10, 15, 20, 25, 6, 15, 16, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #315
-PAIRING(10, 15, 20, 25, 6, 15, 20, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 1) // #316
-PAIRING(10, 15, 20, 25, 6, 15, 20, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #317
-PAIRING(10, 15, 20, 25, 6, 15, 20, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #318
-PAIRING(10, 15, 20, 25, 6, 15, 21, 22, 1, 1, 10, 15, 0, 0, 21, 22, 0, 0, 1, 1) // #319
-PAIRING(10, 15, 20, 25, 6, 15, 21, 25, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 1) // #320
-PAIRING(10, 15, 20, 25, 6, 15, 21, 26, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 2) // #321
-PAIRING(10, 15, 20, 25, 6, 15, 25, 26, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #322
-PAIRING(10, 15, 20, 25, 6, 15, 26, 27, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #323
-PAIRING(10, 15, 20, 25, 6, 16, 16, 17, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #324
-PAIRING(10, 15, 20, 25, 6, 16, 16, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #325
-PAIRING(10, 15, 20, 25, 6, 16, 16, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #326
-PAIRING(10, 15, 20, 25, 6, 16, 16, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #327
-PAIRING(10, 15, 20, 25, 6, 16, 16, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #328
-PAIRING(10, 15, 20, 25, 6, 16, 17, 18, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #329
-PAIRING(10, 15, 20, 25, 6, 16, 17, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #330
-PAIRING(10, 15, 20, 25, 6, 16, 17, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #331
-PAIRING(10, 15, 20, 25, 6, 16, 17, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #332
-PAIRING(10, 15, 20, 25, 6, 16, 17, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #333
-PAIRING(10, 15, 20, 25, 6, 16, 20, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 1) // #334
-PAIRING(10, 15, 20, 25, 6, 16, 20, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #335
-PAIRING(10, 15, 20, 25, 6, 16, 20, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #336
-PAIRING(10, 15, 20, 25, 6, 16, 21, 22, 1, 1, 10, 15, 0, 0, 21, 22, 0, 0, 1, 1) // #337
-PAIRING(10, 15, 20, 25, 6, 16, 21, 25, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 1) // #338
-PAIRING(10, 15, 20, 25, 6, 16, 21, 26, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 2) // #339
-PAIRING(10, 15, 20, 25, 6, 16, 25, 26, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #340
-PAIRING(10, 15, 20, 25, 6, 16, 26, 27, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #341
-PAIRING(10, 15, 20, 25, 6, 20, 20, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 1) // #342
-PAIRING(10, 15, 20, 25, 6, 20, 20, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #343
-PAIRING(10, 15, 20, 25, 6, 20, 20, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #344
-PAIRING(10, 15, 20, 25, 6, 20, 21, 22, 1, 1, 10, 15, 0, 0, 21, 22, 0, 0, 1, 1) // #345
-PAIRING(10, 15, 20, 25, 6, 20, 21, 25, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 1) // #346
-PAIRING(10, 15, 20, 25, 6, 20, 21, 26, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 2) // #347
-PAIRING(10, 15, 20, 25, 6, 20, 25, 26, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #348
-PAIRING(10, 15, 20, 25, 6, 20, 26, 27, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #349
-PAIRING(10, 15, 20, 25, 6, 21, 21, 22, 1, 2, 10, 15, 0, 0, 20, 21, 21, 22, 1, 1) // #350
-PAIRING(10, 15, 20, 25, 6, 21, 21, 25, 1, 2, 10, 15, 0, 0, 20, 21, 21, 25, 0, 1) // #351
-PAIRING(10, 15, 20, 25, 6, 21, 21, 26, 1, 2, 10, 15, 0, 0, 20, 21, 21, 25, 0, 2) // #352
-PAIRING(10, 15, 20, 25, 6, 21, 22, 23, 1, 2, 10, 15, 0, 0, 20, 21, 22, 23, 1, 1) // #353
-PAIRING(10, 15, 20, 25, 6, 21, 22, 25, 1, 2, 10, 15, 0, 0, 20, 21, 22, 25, 1, 1) // #354
-PAIRING(10, 15, 20, 25, 6, 21, 22, 26, 1, 2, 10, 15, 0, 0, 20, 21, 22, 25, 1, 2) // #355
-PAIRING(10, 15, 20, 25, 6, 21, 25, 26, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #356
-PAIRING(10, 15, 20, 25, 6, 21, 26, 27, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #357
-PAIRING(10, 15, 20, 25, 6, 25, 25, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #358
-PAIRING(10, 15, 20, 25, 6, 25, 26, 27, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #359
-PAIRING(10, 15, 20, 25, 6, 26, 26, 27, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #360
-PAIRING(10, 15, 20, 25, 6, 26, 27, 28, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #361
-PAIRING(10, 15, 20, 25, 10, 11, 11, 12, 2, 0, 10, 11, 11, 12, 0, 0, 0, 0, 2, 0) // #362
-PAIRING(10, 15, 20, 25, 10, 11, 11, 15, 2, 0, 10, 11, 11, 15, 0, 0, 0, 0, 1, 0) // #363
-PAIRING(10, 15, 20, 25, 10, 11, 11, 16, 2, 0, 10, 11, 11, 15, 0, 0, 0, 0, 1, 1) // #364
-PAIRING(10, 15, 20, 25, 10, 11, 11, 20, 2, 0, 10, 11, 11, 15, 0, 0, 0, 0, 1, 0) // #365
-PAIRING(10, 15, 20, 25, 10, 11, 11, 21, 2, 1, 10, 11, 11, 15, 20, 21, 0, 0, 1, 1) // #366
-PAIRING(10, 15, 20, 25, 10, 11, 11, 25, 2, 1, 10, 11, 11, 15, 20, 25, 0, 0, 0, 1) // #367
-PAIRING(10, 15, 20, 25, 10, 11, 11, 26, 2, 1, 10, 11, 11, 15, 20, 25, 0, 0, 0, 1) // #368
-PAIRING(10, 15, 20, 25, 10, 11, 12, 13, 2, 0, 10, 11, 12, 13, 0, 0, 0, 0, 2, 0) // #369
-PAIRING(10, 15, 20, 25, 10, 11, 12, 15, 2, 0, 10, 11, 12, 15, 0, 0, 0, 0, 2, 0) // #370
-PAIRING(10, 15, 20, 25, 10, 11, 12, 16, 2, 0, 10, 11, 12, 15, 0, 0, 0, 0, 2, 1) // #371
-PAIRING(10, 15, 20, 25, 10, 11, 12, 20, 2, 0, 10, 11, 12, 15, 0, 0, 0, 0, 2, 0) // #372
-PAIRING(10, 15, 20, 25, 10, 11, 12, 21, 2, 1, 10, 11, 12, 15, 20, 21, 0, 0, 2, 1) // #373
-PAIRING(10, 15, 20, 25, 10, 11, 12, 25, 2, 1, 10, 11, 12, 15, 20, 25, 0, 0, 1, 1) // #374
-PAIRING(10, 15, 20, 25, 10, 11, 12, 26, 2, 1, 10, 11, 12, 15, 20, 25, 0, 0, 1, 1) // #375
-PAIRING(10, 15, 20, 25, 10, 11, 15, 16, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #376
-PAIRING(10, 15, 20, 25, 10, 11, 15, 20, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #377
-PAIRING(10, 15, 20, 25, 10, 11, 15, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 1) // #378
-PAIRING(10, 15, 20, 25, 10, 11, 15, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #379
-PAIRING(10, 15, 20, 25, 10, 11, 15, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #380
-PAIRING(10, 15, 20, 25, 10, 11, 16, 17, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #381
-PAIRING(10, 15, 20, 25, 10, 11, 16, 20, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #382
-PAIRING(10, 15, 20, 25, 10, 11, 16, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 1) // #383
-PAIRING(10, 15, 20, 25, 10, 11, 16, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #384
-PAIRING(10, 15, 20, 25, 10, 11, 16, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #385
-PAIRING(10, 15, 20, 25, 10, 11, 20, 21, 1, 1, 10, 11, 0, 0, 20, 21, 0, 0, 2, 0) // #386
-PAIRING(10, 15, 20, 25, 10, 11, 20, 25, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 0) // #387
-PAIRING(10, 15, 20, 25, 10, 11, 20, 26, 1, 1, 10, 11, 0, 0, 20, 25, 0, 0, 1, 1) // #388
-PAIRING(10, 15, 20, 25, 10, 11, 21, 22, 1, 1, 10, 11, 0, 0, 21, 22, 0, 0, 2, 0) // #389
-PAIRING(10, 15, 20, 25, 10, 11, 21, 25, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 0) // #390
-PAIRING(10, 15, 20, 25, 10, 11, 21, 26, 1, 1, 10, 11, 0, 0, 21, 25, 0, 0, 2, 1) // #391
-PAIRING(10, 15, 20, 25, 10, 11, 25, 26, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #392
-PAIRING(10, 15, 20, 25, 10, 11, 26, 27, 1, 0, 10, 11, 0, 0, 0, 0, 0, 0, 2, 1) // #393
-PAIRING(10, 15, 20, 25, 10, 15, 15, 16, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #394
-PAIRING(10, 15, 20, 25, 10, 15, 15, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #395
-PAIRING(10, 15, 20, 25, 10, 15, 15, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 1) // #396
-PAIRING(10, 15, 20, 25, 10, 15, 15, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #397
-PAIRING(10, 15, 20, 25, 10, 15, 15, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #398
-PAIRING(10, 15, 20, 25, 10, 15, 16, 17, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #399
-PAIRING(10, 15, 20, 25, 10, 15, 16, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #400
-PAIRING(10, 15, 20, 25, 10, 15, 16, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 1) // #401
-PAIRING(10, 15, 20, 25, 10, 15, 16, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #402
-PAIRING(10, 15, 20, 25, 10, 15, 16, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #403
-PAIRING(10, 15, 20, 25, 10, 15, 20, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 0) // #404
-PAIRING(10, 15, 20, 25, 10, 15, 20, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 0) // #405
-PAIRING(10, 15, 20, 25, 10, 15, 20, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #406
-PAIRING(10, 15, 20, 25, 10, 15, 21, 22, 1, 1, 10, 15, 0, 0, 21, 22, 0, 0, 1, 0) // #407
-PAIRING(10, 15, 20, 25, 10, 15, 21, 25, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 0) // #408
-PAIRING(10, 15, 20, 25, 10, 15, 21, 26, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 1) // #409
-PAIRING(10, 15, 20, 25, 10, 15, 25, 26, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #410
-PAIRING(10, 15, 20, 25, 10, 15, 26, 27, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #411
-PAIRING(10, 15, 20, 25, 10, 16, 16, 17, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #412
-PAIRING(10, 15, 20, 25, 10, 16, 16, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #413
-PAIRING(10, 15, 20, 25, 10, 16, 16, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #414
-PAIRING(10, 15, 20, 25, 10, 16, 16, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #415
-PAIRING(10, 15, 20, 25, 10, 16, 16, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #416
-PAIRING(10, 15, 20, 25, 10, 16, 17, 18, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #417
-PAIRING(10, 15, 20, 25, 10, 16, 17, 20, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #418
-PAIRING(10, 15, 20, 25, 10, 16, 17, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #419
-PAIRING(10, 15, 20, 25, 10, 16, 17, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #420
-PAIRING(10, 15, 20, 25, 10, 16, 17, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #421
-PAIRING(10, 15, 20, 25, 10, 16, 20, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 1) // #422
-PAIRING(10, 15, 20, 25, 10, 16, 20, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #423
-PAIRING(10, 15, 20, 25, 10, 16, 20, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #424
-PAIRING(10, 15, 20, 25, 10, 16, 21, 22, 1, 1, 10, 15, 0, 0, 21, 22, 0, 0, 1, 1) // #425
-PAIRING(10, 15, 20, 25, 10, 16, 21, 25, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 1) // #426
-PAIRING(10, 15, 20, 25, 10, 16, 21, 26, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 2) // #427
-PAIRING(10, 15, 20, 25, 10, 16, 25, 26, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #428
-PAIRING(10, 15, 20, 25, 10, 16, 26, 27, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 2) // #429
-PAIRING(10, 15, 20, 25, 10, 20, 20, 21, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 0) // #430
-PAIRING(10, 15, 20, 25, 10, 20, 20, 25, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 0) // #431
-PAIRING(10, 15, 20, 25, 10, 20, 20, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 1) // #432
-PAIRING(10, 15, 20, 25, 10, 20, 21, 22, 1, 1, 10, 15, 0, 0, 21, 22, 0, 0, 1, 0) // #433
-PAIRING(10, 15, 20, 25, 10, 20, 21, 25, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 0) // #434
-PAIRING(10, 15, 20, 25, 10, 20, 21, 26, 1, 1, 10, 15, 0, 0, 21, 25, 0, 0, 1, 1) // #435
-PAIRING(10, 15, 20, 25, 10, 20, 25, 26, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #436
-PAIRING(10, 15, 20, 25, 10, 20, 26, 27, 1, 0, 10, 15, 0, 0, 0, 0, 0, 0, 1, 1) // #437
-PAIRING(10, 15, 20, 25, 10, 21, 21, 22, 1, 2, 10, 15, 0, 0, 20, 21, 21, 22, 1, 1) // #438
-PAIRING(10, 15, 20, 25, 10, 21, 21, 25, 1, 2, 10, 15, 0, 0, 20, 21, 21, 25, 0, 1) // #439
-PAIRING(10, 15, 20, 25, 10, 21, 21, 26, 1, 2, 10, 15, 0, 0, 20, 21, 21, 25, 0, 2) // #440
-PAIRING(10, 15, 20, 25, 10, 21, 22, 23, 1, 2, 10, 15, 0, 0, 20, 21, 22, 23, 1, 1) // #441
-PAIRING(10, 15, 20, 25, 10, 21, 22, 25, 1, 2, 10, 15, 0, 0, 20, 21, 22, 25, 1, 1) // #442
-PAIRING(10, 15, 20, 25, 10, 21, 22, 26, 1, 2, 10, 15, 0, 0, 20, 21, 22, 25, 1, 2) // #443
-PAIRING(10, 15, 20, 25, 10, 21, 25, 26, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #444
-PAIRING(10, 15, 20, 25, 10, 21, 26, 27, 1, 1, 10, 15, 0, 0, 20, 21, 0, 0, 1, 2) // #445
-PAIRING(10, 15, 20, 25, 10, 25, 25, 26, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #446
-PAIRING(10, 15, 20, 25, 10, 25, 26, 27, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #447
-PAIRING(10, 15, 20, 25, 10, 26, 26, 27, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #448
-PAIRING(10, 15, 20, 25, 10, 26, 27, 28, 1, 1, 10, 15, 0, 0, 20, 25, 0, 0, 0, 2) // #449
-PAIRING(10, 15, 20, 25, 11, 12, 12, 13, 2, 0, 11, 12, 12, 13, 0, 0, 0, 0, 2, 0) // #450
-PAIRING(10, 15, 20, 25, 11, 12, 12, 15, 2, 0, 11, 12, 12, 15, 0, 0, 0, 0, 2, 0) // #451
-PAIRING(10, 15, 20, 25, 11, 12, 12, 16, 2, 0, 11, 12, 12, 15, 0, 0, 0, 0, 2, 1) // #452
-PAIRING(10, 15, 20, 25, 11, 12, 12, 20, 2, 0, 11, 12, 12, 15, 0, 0, 0, 0, 2, 0) // #453
-PAIRING(10, 15, 20, 25, 11, 12, 12, 21, 2, 1, 11, 12, 12, 15, 20, 21, 0, 0, 2, 1) // #454
-PAIRING(10, 15, 20, 25, 11, 12, 12, 25, 2, 1, 11, 12, 12, 15, 20, 25, 0, 0, 1, 1) // #455
-PAIRING(10, 15, 20, 25, 11, 12, 12, 26, 2, 1, 11, 12, 12, 15, 20, 25, 0, 0, 1, 1) // #456
-PAIRING(10, 15, 20, 25, 11, 12, 13, 14, 2, 0, 11, 12, 13, 14, 0, 0, 0, 0, 2, 0) // #457
-PAIRING(10, 15, 20, 25, 11, 12, 13, 15, 2, 0, 11, 12, 13, 15, 0, 0, 0, 0, 2, 0) // #458
-PAIRING(10, 15, 20, 25, 11, 12, 13, 16, 2, 0, 11, 12, 13, 15, 0, 0, 0, 0, 2, 1) // #459
-PAIRING(10, 15, 20, 25, 11, 12, 13, 20, 2, 0, 11, 12, 13, 15, 0, 0, 0, 0, 2, 0) // #460
-PAIRING(10, 15, 20, 25, 11, 12, 13, 21, 2, 1, 11, 12, 13, 15, 20, 21, 0, 0, 2, 1) // #461
-PAIRING(10, 15, 20, 25, 11, 12, 13, 25, 2, 1, 11, 12, 13, 15, 20, 25, 0, 0, 1, 1) // #462
-PAIRING(10, 15, 20, 25, 11, 12, 13, 26, 2, 1, 11, 12, 13, 15, 20, 25, 0, 0, 1, 1) // #463
-PAIRING(10, 15, 20, 25, 11, 12, 15, 16, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #464
-PAIRING(10, 15, 20, 25, 11, 12, 15, 20, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #465
-PAIRING(10, 15, 20, 25, 11, 12, 15, 21, 1, 1, 11, 12, 0, 0, 20, 21, 0, 0, 2, 1) // #466
-PAIRING(10, 15, 20, 25, 11, 12, 15, 25, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 1) // #467
-PAIRING(10, 15, 20, 25, 11, 12, 15, 26, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 1) // #468
-PAIRING(10, 15, 20, 25, 11, 12, 16, 17, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #469
-PAIRING(10, 15, 20, 25, 11, 12, 16, 20, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #470
-PAIRING(10, 15, 20, 25, 11, 12, 16, 21, 1, 1, 11, 12, 0, 0, 20, 21, 0, 0, 2, 1) // #471
-PAIRING(10, 15, 20, 25, 11, 12, 16, 25, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 1) // #472
-PAIRING(10, 15, 20, 25, 11, 12, 16, 26, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 1) // #473
-PAIRING(10, 15, 20, 25, 11, 12, 20, 21, 1, 1, 11, 12, 0, 0, 20, 21, 0, 0, 2, 0) // #474
-PAIRING(10, 15, 20, 25, 11, 12, 20, 25, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 0) // #475
-PAIRING(10, 15, 20, 25, 11, 12, 20, 26, 1, 1, 11, 12, 0, 0, 20, 25, 0, 0, 1, 1) // #476
-PAIRING(10, 15, 20, 25, 11, 12, 21, 22, 1, 1, 11, 12, 0, 0, 21, 22, 0, 0, 2, 0) // #477
-PAIRING(10, 15, 20, 25, 11, 12, 21, 25, 1, 1, 11, 12, 0, 0, 21, 25, 0, 0, 2, 0) // #478
-PAIRING(10, 15, 20, 25, 11, 12, 21, 26, 1, 1, 11, 12, 0, 0, 21, 25, 0, 0, 2, 1) // #479
-PAIRING(10, 15, 20, 25, 11, 12, 25, 26, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #480
-PAIRING(10, 15, 20, 25, 11, 12, 26, 27, 1, 0, 11, 12, 0, 0, 0, 0, 0, 0, 2, 1) // #481
-PAIRING(10, 15, 20, 25, 11, 15, 15, 16, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #482
-PAIRING(10, 15, 20, 25, 11, 15, 15, 20, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #483
-PAIRING(10, 15, 20, 25, 11, 15, 15, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 1) // #484
-PAIRING(10, 15, 20, 25, 11, 15, 15, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #485
-PAIRING(10, 15, 20, 25, 11, 15, 15, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #486
-PAIRING(10, 15, 20, 25, 11, 15, 16, 17, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #487
-PAIRING(10, 15, 20, 25, 11, 15, 16, 20, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #488
-PAIRING(10, 15, 20, 25, 11, 15, 16, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 1) // #489
-PAIRING(10, 15, 20, 25, 11, 15, 16, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #490
-PAIRING(10, 15, 20, 25, 11, 15, 16, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #491
-PAIRING(10, 15, 20, 25, 11, 15, 20, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 0) // #492
-PAIRING(10, 15, 20, 25, 11, 15, 20, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 0) // #493
-PAIRING(10, 15, 20, 25, 11, 15, 20, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #494
-PAIRING(10, 15, 20, 25, 11, 15, 21, 22, 1, 1, 11, 15, 0, 0, 21, 22, 0, 0, 2, 0) // #495
-PAIRING(10, 15, 20, 25, 11, 15, 21, 25, 1, 1, 11, 15, 0, 0, 21, 25, 0, 0, 2, 0) // #496
-PAIRING(10, 15, 20, 25, 11, 15, 21, 26, 1, 1, 11, 15, 0, 0, 21, 25, 0, 0, 2, 1) // #497
-PAIRING(10, 15, 20, 25, 11, 15, 25, 26, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #498
-PAIRING(10, 15, 20, 25, 11, 15, 26, 27, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #499
-PAIRING(10, 15, 20, 25, 11, 16, 16, 17, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #500
-PAIRING(10, 15, 20, 25, 11, 16, 16, 20, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #501
-PAIRING(10, 15, 20, 25, 11, 16, 16, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 2) // #502
-PAIRING(10, 15, 20, 25, 11, 16, 16, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #503
-PAIRING(10, 15, 20, 25, 11, 16, 16, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #504
-PAIRING(10, 15, 20, 25, 11, 16, 17, 18, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #505
-PAIRING(10, 15, 20, 25, 11, 16, 17, 20, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #506
-PAIRING(10, 15, 20, 25, 11, 16, 17, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 2) // #507
-PAIRING(10, 15, 20, 25, 11, 16, 17, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #508
-PAIRING(10, 15, 20, 25, 11, 16, 17, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #509
-PAIRING(10, 15, 20, 25, 11, 16, 20, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 1) // #510
-PAIRING(10, 15, 20, 25, 11, 16, 20, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #511
-PAIRING(10, 15, 20, 25, 11, 16, 20, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #512
-PAIRING(10, 15, 20, 25, 11, 16, 21, 22, 1, 1, 11, 15, 0, 0, 21, 22, 0, 0, 2, 1) // #513
-PAIRING(10, 15, 20, 25, 11, 16, 21, 25, 1, 1, 11, 15, 0, 0, 21, 25, 0, 0, 2, 1) // #514
-PAIRING(10, 15, 20, 25, 11, 16, 21, 26, 1, 1, 11, 15, 0, 0, 21, 25, 0, 0, 2, 2) // #515
-PAIRING(10, 15, 20, 25, 11, 16, 25, 26, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #516
-PAIRING(10, 15, 20, 25, 11, 16, 26, 27, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 2) // #517
-PAIRING(10, 15, 20, 25, 11, 20, 20, 21, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 0) // #518
-PAIRING(10, 15, 20, 25, 11, 20, 20, 25, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 0) // #519
-PAIRING(10, 15, 20, 25, 11, 20, 20, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 1) // #520
-PAIRING(10, 15, 20, 25, 11, 20, 21, 22, 1, 1, 11, 15, 0, 0, 21, 22, 0, 0, 2, 0) // #521
-PAIRING(10, 15, 20, 25, 11, 20, 21, 25, 1, 1, 11, 15, 0, 0, 21, 25, 0, 0, 2, 0) // #522
-PAIRING(10, 15, 20, 25, 11, 20, 21, 26, 1, 1, 11, 15, 0, 0, 21, 25, 0, 0, 2, 1) // #523
-PAIRING(10, 15, 20, 25, 11, 20, 25, 26, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #524
-PAIRING(10, 15, 20, 25, 11, 20, 26, 27, 1, 0, 11, 15, 0, 0, 0, 0, 0, 0, 2, 1) // #525
-PAIRING(10, 15, 20, 25, 11, 21, 21, 22, 1, 2, 11, 15, 0, 0, 20, 21, 21, 22, 2, 1) // #526
-PAIRING(10, 15, 20, 25, 11, 21, 21, 25, 1, 2, 11, 15, 0, 0, 20, 21, 21, 25, 1, 1) // #527
-PAIRING(10, 15, 20, 25, 11, 21, 21, 26, 1, 2, 11, 15, 0, 0, 20, 21, 21, 25, 1, 2) // #528
-PAIRING(10, 15, 20, 25, 11, 21, 22, 23, 1, 2, 11, 15, 0, 0, 20, 21, 22, 23, 2, 1) // #529
-PAIRING(10, 15, 20, 25, 11, 21, 22, 25, 1, 2, 11, 15, 0, 0, 20, 21, 22, 25, 2, 1) // #530
-PAIRING(10, 15, 20, 25, 11, 21, 22, 26, 1, 2, 11, 15, 0, 0, 20, 21, 22, 25, 2, 2) // #531
-PAIRING(10, 15, 20, 25, 11, 21, 25, 26, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 2) // #532
-PAIRING(10, 15, 20, 25, 11, 21, 26, 27, 1, 1, 11, 15, 0, 0, 20, 21, 0, 0, 2, 2) // #533
-PAIRING(10, 15, 20, 25, 11, 25, 25, 26, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #534
-PAIRING(10, 15, 20, 25, 11, 25, 26, 27, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #535
-PAIRING(10, 15, 20, 25, 11, 26, 26, 27, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #536
-PAIRING(10, 15, 20, 25, 11, 26, 27, 28, 1, 1, 11, 15, 0, 0, 20, 25, 0, 0, 1, 2) // #537
-PAIRING(10, 15, 20, 25, 15, 16, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #538
-PAIRING(10, 15, 20, 25, 15, 16, 16, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #539
-PAIRING(10, 15, 20, 25, 15, 16, 16, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #540
-PAIRING(10, 15, 20, 25, 15, 16, 16, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #541
-PAIRING(10, 15, 20, 25, 15, 16, 16, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #542
-PAIRING(10, 15, 20, 25, 15, 16, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #543
-PAIRING(10, 15, 20, 25, 15, 16, 17, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #544
-PAIRING(10, 15, 20, 25, 15, 16, 17, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #545
-PAIRING(10, 15, 20, 25, 15, 16, 17, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #546
-PAIRING(10, 15, 20, 25, 15, 16, 17, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #547
-PAIRING(10, 15, 20, 25, 15, 16, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #548
-PAIRING(10, 15, 20, 25, 15, 16, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #549
-PAIRING(10, 15, 20, 25, 15, 16, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #550
-PAIRING(10, 15, 20, 25, 15, 16, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #551
-PAIRING(10, 15, 20, 25, 15, 16, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #552
-PAIRING(10, 15, 20, 25, 15, 16, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #553
-PAIRING(10, 15, 20, 25, 15, 16, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #554
-PAIRING(10, 15, 20, 25, 15, 16, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #555
-PAIRING(10, 15, 20, 25, 15, 20, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #556
-PAIRING(10, 15, 20, 25, 15, 20, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #557
-PAIRING(10, 15, 20, 25, 15, 20, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #558
-PAIRING(10, 15, 20, 25, 15, 20, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #559
-PAIRING(10, 15, 20, 25, 15, 20, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #560
-PAIRING(10, 15, 20, 25, 15, 20, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #561
-PAIRING(10, 15, 20, 25, 15, 20, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #562
-PAIRING(10, 15, 20, 25, 15, 20, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #563
-PAIRING(10, 15, 20, 25, 15, 21, 21, 22, 0, 2, 0, 0, 0, 0, 20, 21, 21, 22, 2, 1) // #564
-PAIRING(10, 15, 20, 25, 15, 21, 21, 25, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 1) // #565
-PAIRING(10, 15, 20, 25, 15, 21, 21, 26, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 2) // #566
-PAIRING(10, 15, 20, 25, 15, 21, 22, 23, 0, 2, 0, 0, 0, 0, 20, 21, 22, 23, 2, 1) // #567
-PAIRING(10, 15, 20, 25, 15, 21, 22, 25, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 1) // #568
-PAIRING(10, 15, 20, 25, 15, 21, 22, 26, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 2) // #569
-PAIRING(10, 15, 20, 25, 15, 21, 25, 26, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #570
-PAIRING(10, 15, 20, 25, 15, 21, 26, 27, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #571
-PAIRING(10, 15, 20, 25, 15, 25, 25, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #572
-PAIRING(10, 15, 20, 25, 15, 25, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #573
-PAIRING(10, 15, 20, 25, 15, 26, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #574
-PAIRING(10, 15, 20, 25, 15, 26, 27, 28, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #575
-PAIRING(10, 15, 20, 25, 16, 17, 17, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #576
-PAIRING(10, 15, 20, 25, 16, 17, 17, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #577
-PAIRING(10, 15, 20, 25, 16, 17, 17, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #578
-PAIRING(10, 15, 20, 25, 16, 17, 17, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #579
-PAIRING(10, 15, 20, 25, 16, 17, 17, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #580
-PAIRING(10, 15, 20, 25, 16, 17, 18, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #581
-PAIRING(10, 15, 20, 25, 16, 17, 18, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #582
-PAIRING(10, 15, 20, 25, 16, 17, 18, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #583
-PAIRING(10, 15, 20, 25, 16, 17, 18, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #584
-PAIRING(10, 15, 20, 25, 16, 17, 18, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #585
-PAIRING(10, 15, 20, 25, 16, 17, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #586
-PAIRING(10, 15, 20, 25, 16, 17, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #587
-PAIRING(10, 15, 20, 25, 16, 17, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #588
-PAIRING(10, 15, 20, 25, 16, 17, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #589
-PAIRING(10, 15, 20, 25, 16, 17, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #590
-PAIRING(10, 15, 20, 25, 16, 17, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #591
-PAIRING(10, 15, 20, 25, 16, 17, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #592
-PAIRING(10, 15, 20, 25, 16, 17, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #593
-PAIRING(10, 15, 20, 25, 16, 20, 20, 21, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #594
-PAIRING(10, 15, 20, 25, 16, 20, 20, 25, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #595
-PAIRING(10, 15, 20, 25, 16, 20, 20, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #596
-PAIRING(10, 15, 20, 25, 16, 20, 21, 22, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #597
-PAIRING(10, 15, 20, 25, 16, 20, 21, 25, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #598
-PAIRING(10, 15, 20, 25, 16, 20, 21, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #599
-PAIRING(10, 15, 20, 25, 16, 20, 25, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #600
-PAIRING(10, 15, 20, 25, 16, 20, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #601
-PAIRING(10, 15, 20, 25, 16, 21, 21, 22, 0, 2, 0, 0, 0, 0, 20, 21, 21, 22, 2, 1) // #602
-PAIRING(10, 15, 20, 25, 16, 21, 21, 25, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 1) // #603
-PAIRING(10, 15, 20, 25, 16, 21, 21, 26, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 2) // #604
-PAIRING(10, 15, 20, 25, 16, 21, 22, 23, 0, 2, 0, 0, 0, 0, 20, 21, 22, 23, 2, 1) // #605
-PAIRING(10, 15, 20, 25, 16, 21, 22, 25, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 1) // #606
-PAIRING(10, 15, 20, 25, 16, 21, 22, 26, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 2) // #607
-PAIRING(10, 15, 20, 25, 16, 21, 25, 26, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #608
-PAIRING(10, 15, 20, 25, 16, 21, 26, 27, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 2) // #609
-PAIRING(10, 15, 20, 25, 16, 25, 25, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #610
-PAIRING(10, 15, 20, 25, 16, 25, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #611
-PAIRING(10, 15, 20, 25, 16, 26, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #612
-PAIRING(10, 15, 20, 25, 16, 26, 27, 28, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #613
-PAIRING(10, 15, 20, 25, 20, 21, 21, 22, 0, 2, 0, 0, 0, 0, 20, 21, 21, 22, 2, 0) // #614
-PAIRING(10, 15, 20, 25, 20, 21, 21, 25, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 0) // #615
-PAIRING(10, 15, 20, 25, 20, 21, 21, 26, 0, 2, 0, 0, 0, 0, 20, 21, 21, 25, 1, 1) // #616
-PAIRING(10, 15, 20, 25, 20, 21, 22, 23, 0, 2, 0, 0, 0, 0, 20, 21, 22, 23, 2, 0) // #617
-PAIRING(10, 15, 20, 25, 20, 21, 22, 25, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 0) // #618
-PAIRING(10, 15, 20, 25, 20, 21, 22, 26, 0, 2, 0, 0, 0, 0, 20, 21, 22, 25, 2, 1) // #619
-PAIRING(10, 15, 20, 25, 20, 21, 25, 26, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #620
-PAIRING(10, 15, 20, 25, 20, 21, 26, 27, 0, 1, 0, 0, 0, 0, 20, 21, 0, 0, 2, 1) // #621
-PAIRING(10, 15, 20, 25, 20, 25, 25, 26, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #622
-PAIRING(10, 15, 20, 25, 20, 25, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 1) // #623
-PAIRING(10, 15, 20, 25, 20, 26, 26, 27, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #624
-PAIRING(10, 15, 20, 25, 20, 26, 27, 28, 0, 1, 0, 0, 0, 0, 20, 25, 0, 0, 1, 2) // #625
-PAIRING(10, 15, 20, 25, 21, 22, 22, 23, 0, 2, 0, 0, 0, 0, 21, 22, 22, 23, 2, 0) // #626
-PAIRING(10, 15, 20, 25, 21, 22, 22, 25, 0, 2, 0, 0, 0, 0, 21, 22, 22, 25, 2, 0) // #627
-PAIRING(10, 15, 20, 25, 21, 22, 22, 26, 0, 2, 0, 0, 0, 0, 21, 22, 22, 25, 2, 1) // #628
-PAIRING(10, 15, 20, 25, 21, 22, 23, 24, 0, 2, 0, 0, 0, 0, 21, 22, 23, 24, 2, 0) // #629
-PAIRING(10, 15, 20, 25, 21, 22, 23, 25, 0, 2, 0, 0, 0, 0, 21, 22, 23, 25, 2, 0) // #630
-PAIRING(10, 15, 20, 25, 21, 22, 23, 26, 0, 2, 0, 0, 0, 0, 21, 22, 23, 25, 2, 1) // #631
-PAIRING(10, 15, 20, 25, 21, 22, 25, 26, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #632
-PAIRING(10, 15, 20, 25, 21, 22, 26, 27, 0, 1, 0, 0, 0, 0, 21, 22, 0, 0, 2, 1) // #633
-PAIRING(10, 15, 20, 25, 21, 25, 25, 26, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #634
-PAIRING(10, 15, 20, 25, 21, 25, 26, 27, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 1) // #635
-PAIRING(10, 15, 20, 25, 21, 26, 26, 27, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #636
-PAIRING(10, 15, 20, 25, 21, 26, 27, 28, 0, 1, 0, 0, 0, 0, 21, 25, 0, 0, 2, 2) // #637
-PAIRING(10, 15, 20, 25, 25, 26, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #638
-PAIRING(10, 15, 20, 25, 25, 26, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #639
-PAIRING(10, 15, 20, 25, 26, 27, 27, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #640
-PAIRING(10, 15, 20, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2) // #641
diff --git a/toolkit/crashreporter/google-breakpad/src/common/tests/auto_tempdir.h b/toolkit/crashreporter/google-breakpad/src/common/tests/auto_tempdir.h
deleted file mode 100644
index 1df88db8bd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/tests/auto_tempdir.h
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utility class for creating a temporary directory for unit tests
-// that is deleted in the destructor.
-#ifndef GOOGLE_BREAKPAD_COMMON_TESTS_AUTO_TEMPDIR
-#define GOOGLE_BREAKPAD_COMMON_TESTS_AUTO_TEMPDIR
-
-#include <dirent.h>
-#include <sys/types.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-
-#if !defined(__ANDROID__)
-#define TEMPDIR "/tmp"
-#else
-#define TEMPDIR "/data/local/tmp"
-#include "common/android/testing/mkdtemp.h"
-#endif
-
-namespace google_breakpad {
-
-class AutoTempDir {
- public:
- AutoTempDir() {
- char temp_dir[] = TEMPDIR "/breakpad.XXXXXX";
- EXPECT_TRUE(mkdtemp(temp_dir) != NULL);
- path_.assign(temp_dir);
- }
-
- ~AutoTempDir() {
- DeleteRecursively(path_);
- }
-
- const string& path() const {
- return path_;
- }
-
- private:
- void DeleteRecursively(const string& path) {
- // First remove any files in the dir
- DIR* dir = opendir(path.c_str());
- if (!dir)
- return;
-
- dirent* entry;
- while ((entry = readdir(dir)) != NULL) {
- if (strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
- continue;
- string entry_path = path + "/" + entry->d_name;
- struct stat stats;
- EXPECT_TRUE(lstat(entry_path.c_str(), &stats) == 0);
- if (S_ISDIR(stats.st_mode))
- DeleteRecursively(entry_path);
- else
- EXPECT_TRUE(unlink(entry_path.c_str()) == 0);
- }
- EXPECT_TRUE(closedir(dir) == 0);
- EXPECT_TRUE(rmdir(path.c_str()) == 0);
- }
-
- // prevent copy construction and assignment
- AutoTempDir(const AutoTempDir&);
- AutoTempDir& operator=(const AutoTempDir&);
-
- string path_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_COMMON_TESTS_AUTO_TEMPDIR
diff --git a/toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.cc b/toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.cc
deleted file mode 100644
index 1c041777cb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// file_utils.cc: Implement utility functions for file manipulation.
-// See file_utils.h for details.
-
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include "common/linux/eintr_wrapper.h"
-#include "common/tests/file_utils.h"
-
-namespace google_breakpad {
-
-bool CopyFile(const char* from_path, const char* to_path) {
- int infile = HANDLE_EINTR(open(from_path, O_RDONLY));
- if (infile < 0) {
- perror("open");
- return false;
- }
-
- int outfile = HANDLE_EINTR(creat(to_path, 0666));
- if (outfile < 0) {
- perror("creat");
- if (IGNORE_EINTR(close(infile)) < 0) {
- perror("close");
- }
- return false;
- }
-
- char buffer[1024];
- bool result = true;
-
- while (result) {
- ssize_t bytes_read = HANDLE_EINTR(read(infile, buffer, sizeof(buffer)));
- if (bytes_read < 0) {
- perror("read");
- result = false;
- break;
- }
- if (bytes_read == 0)
- break;
- ssize_t bytes_written_per_read = 0;
- do {
- ssize_t bytes_written_partial = HANDLE_EINTR(write(
- outfile,
- &buffer[bytes_written_per_read],
- bytes_read - bytes_written_per_read));
- if (bytes_written_partial < 0) {
- perror("write");
- result = false;
- break;
- }
- bytes_written_per_read += bytes_written_partial;
- } while (bytes_written_per_read < bytes_read);
- }
-
- if (IGNORE_EINTR(close(infile)) == -1) {
- perror("close");
- result = false;
- }
- if (IGNORE_EINTR(close(outfile)) == -1) {
- perror("close");
- result = false;
- }
-
- return result;
-}
-
-bool ReadFile(const char* path, void* buffer, ssize_t* buffer_size) {
- int fd = HANDLE_EINTR(open(path, O_RDONLY));
- if (fd == -1) {
- perror("open");
- return false;
- }
-
- bool ok = true;
- if (buffer && buffer_size && *buffer_size > 0) {
- memset(buffer, 0, sizeof(*buffer_size));
- *buffer_size = HANDLE_EINTR(read(fd, buffer, *buffer_size));
- if (*buffer_size == -1) {
- perror("read");
- ok = false;
- }
- }
- if (IGNORE_EINTR(close(fd)) == -1) {
- perror("close");
- ok = false;
- }
- return ok;
-}
-
-bool WriteFile(const char* path, const void* buffer, size_t buffer_size) {
- int fd = HANDLE_EINTR(open(path, O_CREAT | O_TRUNC | O_WRONLY, S_IRWXU));
- if (fd == -1) {
- perror("open");
- return false;
- }
-
- bool ok = true;
- if (buffer) {
- size_t bytes_written_total = 0;
- ssize_t bytes_written_partial = 0;
- const char* data = reinterpret_cast<const char*>(buffer);
- while (bytes_written_total < buffer_size) {
- bytes_written_partial =
- HANDLE_EINTR(write(fd, data + bytes_written_total,
- buffer_size - bytes_written_total));
- if (bytes_written_partial < 0) {
- perror("write");
- ok = false;
- break;
- }
- bytes_written_total += bytes_written_partial;
- }
- }
- if (IGNORE_EINTR(close(fd)) == -1) {
- perror("close");
- ok = false;
- }
- return ok;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.h b/toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.h
deleted file mode 100644
index c98a9bfa8b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/tests/file_utils.h
+++ /dev/null
@@ -1,52 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// file_utils.h: Define utility functions for file manipulation, which
-// are used for testing.
-
-#ifndef COMMON_TESTS_FILE_UTILS_H_
-#define COMMON_TESTS_FILE_UTILS_H_
-
-namespace google_breakpad {
-
-// Copies a file from |from_path| to |to_path|. Returns true on success.
-bool CopyFile(const char* from_path, const char* to_path);
-
-// Reads the content of a file at |path| into |buffer|. |buffer_size| specifies
-// the size of |buffer| in bytes and returns the number of bytes read from the
-// file on success. Returns true on success.
-bool ReadFile(const char* path, void* buffer, ssize_t* buffer_size);
-
-// Writes |buffer_size| bytes of the content in |buffer| to a file at |path|.
-// Returns true on success.
-bool WriteFile(const char* path, const void* buffer, size_t buffer_size);
-
-} // namespace google_breakpad
-
-#endif // COMMON_TESTS_FILE_UTILS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/unordered.h b/toolkit/crashreporter/google-breakpad/src/common/unordered.h
deleted file mode 100644
index ec665cc026..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/unordered.h
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Include this file to use unordered_map and unordered_set. If tr1
-// or C++11 is not available, you can switch to using hash_set and
-// hash_map by defining BP_USE_HASH_SET.
-
-#ifndef COMMON_UNORDERED_H_
-#define COMMON_UNORDERED_H_
-
-#if defined(BP_USE_HASH_SET)
-#include <hash_map>
-#include <hash_set>
-
-// For hash<string>.
-#include "util/hash/hash.h"
-
-template <class T, class U, class H = __gnu_cxx::hash<T> >
-struct unordered_map : public hash_map<T, U, H> {};
-template <class T, class H = __gnu_cxx::hash<T> >
-struct unordered_set : public hash_set<T, H> {};
-
-#elif defined(_LIBCPP_VERSION) // c++11
-#include <unordered_map>
-#include <unordered_set>
-using std::unordered_map;
-using std::unordered_set;
-
-#else // Fallback to tr1::unordered
-#include <tr1/unordered_map>
-#include <tr1/unordered_set>
-using std::tr1::unordered_map;
-using std::tr1::unordered_set;
-#endif
-
-#endif // COMMON_UNORDERED_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/using_std_string.h b/toolkit/crashreporter/google-breakpad/src/common/using_std_string.h
deleted file mode 100644
index 13c1da59cc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/using_std_string.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Ivan Penkov
-
-// using_std_string.h: Allows building this code in environments where
-// global string (::string) exists.
-//
-// The problem:
-// -------------
-// Let's say you want to build this code in an environment where a global
-// string type is defined (i.e. ::string). Now, let's suppose that ::string
-// is different that std::string and you'd like to have the option to easily
-// choose between the two string types. Ideally you'd like to control which
-// string type is chosen by simply #defining an identifier.
-//
-// The solution:
-// -------------
-// #define HAS_GLOBAL_STRING somewhere in a global header file and then
-// globally replace std::string with string. Then include this header
-// file everywhere where string is used. If you want to revert back to
-// using std::string, simply remove the #define (HAS_GLOBAL_STRING).
-
-#ifndef THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_
-#define THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_
-
-#ifdef HAS_GLOBAL_STRING
- typedef ::string google_breakpad_string;
-#else
- using std::string;
- typedef std::string google_breakpad_string;
-#endif
-
-// Inicates that type google_breakpad_string is defined
-#define HAS_GOOGLE_BREAKPAD_STRING
-
-#endif // THIRD_PARTY_BREAKPAD_SRC_COMMON_USING_STD_STRING_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/common_windows.gyp b/toolkit/crashreporter/google-breakpad/src/common/windows/common_windows.gyp
deleted file mode 100644
index c98333a344..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/common_windows.gyp
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'dia_sdk',
- 'type': 'none',
- 'all_dependent_settings': {
- 'include_dirs': [
- '<(DEPTH)',
- '$(VSInstallDir)/DIA SDK/include',
- ],
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalDependencies': [
- 'diaguids.lib',
- 'imagehlp.lib',
- ],
- },
- },
- 'configurations': {
- 'x86_Base': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalLibraryDirectories':
- ['$(VSInstallDir)/DIA SDK/lib'],
- },
- },
- },
- 'x64_Base': {
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalLibraryDirectories':
- ['$(VSInstallDir)/DIA SDK/lib/amd64'],
- },
- },
- },
- },
- },
- },
- {
- 'target_name': 'common_windows_lib',
- 'type': 'static_library',
- 'sources': [
- 'dia_util.cc',
- 'dia_util.h',
- 'guid_string.cc',
- 'guid_string.h',
- 'http_upload.cc',
- 'http_upload.h',
- 'omap.cc',
- 'omap.h',
- 'omap_internal.h',
- 'pdb_source_line_writer.cc',
- 'pdb_source_line_writer.h',
- 'string_utils.cc',
- 'string_utils-inl.h',
- ],
- 'dependencies': [
- 'dia_sdk',
- ],
- },
- {
- 'target_name': 'common_windows_unittests',
- 'type': 'executable',
- 'sources': [
- 'omap_unittest.cc',
- ],
- 'dependencies': [
- '<(DEPTH)/client/windows/unittests/testing.gyp:gmock',
- '<(DEPTH)/client/windows/unittests/testing.gyp:gtest',
- 'common_windows_lib',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.cc
deleted file mode 100644
index ed8cb5b658..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/windows/dia_util.h"
-
-#include <atlbase.h>
-
-namespace google_breakpad {
-
-bool FindDebugStream(const wchar_t* name,
- IDiaSession* session,
- IDiaEnumDebugStreamData** debug_stream) {
- CComPtr<IDiaEnumDebugStreams> enum_debug_streams;
- if (FAILED(session->getEnumDebugStreams(&enum_debug_streams))) {
- fprintf(stderr, "IDiaSession::getEnumDebugStreams failed\n");
- return false;
- }
-
- CComPtr<IDiaEnumDebugStreamData> temp_debug_stream;
- ULONG fetched = 0;
- while (SUCCEEDED(enum_debug_streams->Next(1, &temp_debug_stream, &fetched)) &&
- fetched == 1) {
- CComBSTR stream_name;
- if (FAILED(temp_debug_stream->get_name(&stream_name))) {
- fprintf(stderr, "IDiaEnumDebugStreamData::get_name failed\n");
- return false;
- }
-
- // Found the stream?
- if (wcsncmp((LPWSTR)stream_name, name, stream_name.Length()) == 0) {
- *debug_stream = temp_debug_stream.Detach();
- return true;
- }
-
- temp_debug_stream.Release();
- }
-
- // No table was found.
- return false;
-}
-
-bool FindTable(REFIID iid, IDiaSession* session, void** table) {
- // Get the table enumerator.
- CComPtr<IDiaEnumTables> enum_tables;
- if (FAILED(session->getEnumTables(&enum_tables))) {
- fprintf(stderr, "IDiaSession::getEnumTables failed\n");
- return false;
- }
-
- // Iterate through the tables.
- CComPtr<IDiaTable> temp_table;
- ULONG fetched = 0;
- while (SUCCEEDED(enum_tables->Next(1, &temp_table, &fetched)) &&
- fetched == 1) {
- void* temp = NULL;
- if (SUCCEEDED(temp_table->QueryInterface(iid, &temp))) {
- *table = temp;
- return true;
- }
- temp_table.Release();
- }
-
- // The table was not found.
- return false;
-}
-
-} // namespace google_breakpad \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.h b/toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.h
deleted file mode 100644
index b9e0df2d56..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/dia_util.h
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utilities for loading debug streams and tables from a PDB file.
-
-#ifndef COMMON_WINDOWS_DIA_UTIL_H_
-#define COMMON_WINDOWS_DIA_UTIL_H_
-
-#include <Windows.h>
-#include <dia2.h>
-
-namespace google_breakpad {
-
-// Find the debug stream of the given |name| in the given |session|. Returns
-// true on success, false on error of if the stream does not exist. On success
-// the stream will be returned via |debug_stream|.
-bool FindDebugStream(const wchar_t* name,
- IDiaSession* session,
- IDiaEnumDebugStreamData** debug_stream);
-
-// Finds the first table implementing the COM interface with ID |iid| in the
-// given |session|. Returns true on success, false on error or if no such
-// table is found. On success the table will be returned via |table|.
-bool FindTable(REFIID iid, IDiaSession* session, void** table);
-
-// A templated version of FindTable. Finds the first table implementing type
-// |InterfaceType| in the given |session|. Returns true on success, false on
-// error or if no such table is found. On success the table will be returned via
-// |table|.
-template<typename InterfaceType>
-bool FindTable(IDiaSession* session, InterfaceType** table) {
- return FindTable(__uuidof(InterfaceType),
- session,
- reinterpret_cast<void**>(table));
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_WINDOWS_DIA_UTIL_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.cc
deleted file mode 100644
index b7f877e66e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// guid_string.cc: Convert GUIDs to strings.
-//
-// See guid_string.h for documentation.
-
-#include <wchar.h>
-
-#include "common/windows/string_utils-inl.h"
-
-#include "common/windows/guid_string.h"
-
-namespace google_breakpad {
-
-// static
-wstring GUIDString::GUIDToWString(GUID *guid) {
- wchar_t guid_string[37];
- swprintf(
- guid_string, sizeof(guid_string) / sizeof(guid_string[0]),
- L"%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
- guid->Data1, guid->Data2, guid->Data3,
- guid->Data4[0], guid->Data4[1], guid->Data4[2],
- guid->Data4[3], guid->Data4[4], guid->Data4[5],
- guid->Data4[6], guid->Data4[7]);
-
- // remove when VC++7.1 is no longer supported
- guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0';
-
- return wstring(guid_string);
-}
-
-// static
-wstring GUIDString::GUIDToSymbolServerWString(GUID *guid) {
- wchar_t guid_string[33];
- swprintf(
- guid_string, sizeof(guid_string) / sizeof(guid_string[0]),
- L"%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X",
- guid->Data1, guid->Data2, guid->Data3,
- guid->Data4[0], guid->Data4[1], guid->Data4[2],
- guid->Data4[3], guid->Data4[4], guid->Data4[5],
- guid->Data4[6], guid->Data4[7]);
-
- // remove when VC++7.1 is no longer supported
- guid_string[sizeof(guid_string) / sizeof(guid_string[0]) - 1] = L'\0';
-
- return wstring(guid_string);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.h b/toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.h
deleted file mode 100644
index 48a5c1d370..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/guid_string.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// guid_string.cc: Convert GUIDs to strings.
-
-#ifndef COMMON_WINDOWS_GUID_STRING_H_
-#define COMMON_WINDOWS_GUID_STRING_H_
-
-#include <guiddef.h>
-
-#include <string>
-
-namespace google_breakpad {
-
-using std::wstring;
-
-class GUIDString {
- public:
- // Converts guid to a string in the format recommended by RFC 4122 and
- // returns the string.
- static wstring GUIDToWString(GUID *guid);
-
- // Converts guid to a string formatted as uppercase hexadecimal, with
- // no separators, and returns the string. This is the format used for
- // symbol server identifiers, although identifiers have an age tacked
- // on to the string.
- static wstring GUIDToSymbolServerWString(GUID *guid);
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_WINDOWS_GUID_STRING_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.cc
deleted file mode 100644
index 7676bdc5a3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.cc
+++ /dev/null
@@ -1,420 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <assert.h>
-
-// Disable exception handler warnings.
-#pragma warning(disable:4530)
-
-#include <fstream>
-
-#include "common/windows/string_utils-inl.h"
-
-#include "common/windows/http_upload.h"
-
-namespace google_breakpad {
-
-using std::ifstream;
-using std::ios;
-
-static const wchar_t kUserAgent[] = L"Breakpad/1.0 (Windows)";
-
-// Helper class which closes an internet handle when it goes away
-class HTTPUpload::AutoInternetHandle {
- public:
- explicit AutoInternetHandle(HINTERNET handle) : handle_(handle) {}
- ~AutoInternetHandle() {
- if (handle_) {
- InternetCloseHandle(handle_);
- }
- }
-
- HINTERNET get() { return handle_; }
-
- private:
- HINTERNET handle_;
-};
-
-// static
-bool HTTPUpload::SendRequest(const wstring &url,
- const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- int *timeout,
- wstring *response_body,
- int *response_code) {
- if (response_code) {
- *response_code = 0;
- }
-
- // TODO(bryner): support non-ASCII parameter names
- if (!CheckParameters(parameters)) {
- return false;
- }
-
- // Break up the URL and make sure we can handle it
- wchar_t scheme[16], host[256], path[256];
- URL_COMPONENTS components;
- memset(&components, 0, sizeof(components));
- components.dwStructSize = sizeof(components);
- components.lpszScheme = scheme;
- components.dwSchemeLength = sizeof(scheme) / sizeof(scheme[0]);
- components.lpszHostName = host;
- components.dwHostNameLength = sizeof(host) / sizeof(host[0]);
- components.lpszUrlPath = path;
- components.dwUrlPathLength = sizeof(path) / sizeof(path[0]);
- if (!InternetCrackUrl(url.c_str(), static_cast<DWORD>(url.size()),
- 0, &components)) {
- return false;
- }
- bool secure = false;
- if (wcscmp(scheme, L"https") == 0) {
- secure = true;
- } else if (wcscmp(scheme, L"http") != 0) {
- return false;
- }
-
- AutoInternetHandle internet(InternetOpen(kUserAgent,
- INTERNET_OPEN_TYPE_PRECONFIG,
- NULL, // proxy name
- NULL, // proxy bypass
- 0)); // flags
- if (!internet.get()) {
- return false;
- }
-
- AutoInternetHandle connection(InternetConnect(internet.get(),
- host,
- components.nPort,
- NULL, // user name
- NULL, // password
- INTERNET_SERVICE_HTTP,
- 0, // flags
- NULL)); // context
- if (!connection.get()) {
- return false;
- }
-
- DWORD http_open_flags = secure ? INTERNET_FLAG_SECURE : 0;
- http_open_flags |= INTERNET_FLAG_NO_COOKIES;
- AutoInternetHandle request(HttpOpenRequest(connection.get(),
- L"POST",
- path,
- NULL, // version
- NULL, // referer
- NULL, // agent type
- http_open_flags,
- NULL)); // context
- if (!request.get()) {
- return false;
- }
-
- wstring boundary = GenerateMultipartBoundary();
- wstring content_type_header = GenerateRequestHeader(boundary);
- HttpAddRequestHeaders(request.get(),
- content_type_header.c_str(),
- static_cast<DWORD>(-1),
- HTTP_ADDREQ_FLAG_ADD);
-
- string request_body;
- if (!GenerateRequestBody(parameters, files, boundary, &request_body)) {
- return false;
- }
-
- if (timeout) {
- if (!InternetSetOption(request.get(),
- INTERNET_OPTION_SEND_TIMEOUT,
- timeout,
- sizeof(*timeout))) {
- fwprintf(stderr, L"Could not unset send timeout, continuing...\n");
- }
-
- if (!InternetSetOption(request.get(),
- INTERNET_OPTION_RECEIVE_TIMEOUT,
- timeout,
- sizeof(*timeout))) {
- fwprintf(stderr, L"Could not unset receive timeout, continuing...\n");
- }
- }
-
- if (!HttpSendRequest(request.get(), NULL, 0,
- const_cast<char *>(request_body.data()),
- static_cast<DWORD>(request_body.size()))) {
- return false;
- }
-
- // The server indicates a successful upload with HTTP status 200.
- wchar_t http_status[4];
- DWORD http_status_size = sizeof(http_status);
- if (!HttpQueryInfo(request.get(), HTTP_QUERY_STATUS_CODE,
- static_cast<LPVOID>(&http_status), &http_status_size,
- 0)) {
- return false;
- }
-
- int http_response = wcstol(http_status, NULL, 10);
- if (response_code) {
- *response_code = http_response;
- }
-
- bool result = (http_response == 200);
-
- if (result) {
- result = ReadResponse(request.get(), response_body);
- }
-
- return result;
-}
-
-// static
-bool HTTPUpload::ReadResponse(HINTERNET request, wstring *response) {
- bool has_content_length_header = false;
- wchar_t content_length[32];
- DWORD content_length_size = sizeof(content_length);
- DWORD claimed_size = 0;
- string response_body;
-
- if (HttpQueryInfo(request, HTTP_QUERY_CONTENT_LENGTH,
- static_cast<LPVOID>(&content_length),
- &content_length_size, 0)) {
- has_content_length_header = true;
- claimed_size = wcstol(content_length, NULL, 10);
- response_body.reserve(claimed_size);
- }
-
-
- DWORD bytes_available;
- DWORD total_read = 0;
- BOOL return_code;
-
- while (((return_code = InternetQueryDataAvailable(request, &bytes_available,
- 0, 0)) != 0) && bytes_available > 0) {
- vector<char> response_buffer(bytes_available);
- DWORD size_read;
-
- return_code = InternetReadFile(request,
- &response_buffer[0],
- bytes_available, &size_read);
-
- if (return_code && size_read > 0) {
- total_read += size_read;
- response_body.append(&response_buffer[0], size_read);
- } else {
- break;
- }
- }
-
- bool succeeded = return_code && (!has_content_length_header ||
- (total_read == claimed_size));
- if (succeeded && response) {
- *response = UTF8ToWide(response_body);
- }
-
- return succeeded;
-}
-
-// static
-wstring HTTPUpload::GenerateMultipartBoundary() {
- // The boundary has 27 '-' characters followed by 16 hex digits
- static const wchar_t kBoundaryPrefix[] = L"---------------------------";
- static const int kBoundaryLength = 27 + 16 + 1;
-
- // Generate some random numbers to fill out the boundary
- int r0 = rand();
- int r1 = rand();
-
- wchar_t temp[kBoundaryLength];
- swprintf(temp, kBoundaryLength, L"%s%08X%08X", kBoundaryPrefix, r0, r1);
-
- // remove when VC++7.1 is no longer supported
- temp[kBoundaryLength - 1] = L'\0';
-
- return wstring(temp);
-}
-
-// static
-wstring HTTPUpload::GenerateRequestHeader(const wstring &boundary) {
- wstring header = L"Content-Type: multipart/form-data; boundary=";
- header += boundary;
- return header;
-}
-
-// static
-bool HTTPUpload::GenerateRequestBody(const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- const wstring &boundary,
- string *request_body) {
- string boundary_str = WideToUTF8(boundary);
- if (boundary_str.empty()) {
- return false;
- }
-
- request_body->clear();
-
- // Append each of the parameter pairs as a form-data part
- for (map<wstring, wstring>::const_iterator pos = parameters.begin();
- pos != parameters.end(); ++pos) {
- request_body->append("--" + boundary_str + "\r\n");
- request_body->append("Content-Disposition: form-data; name=\"" +
- WideToUTF8(pos->first) + "\"\r\n\r\n" +
- WideToUTF8(pos->second) + "\r\n");
- }
-
- for (map<wstring, wstring>::const_iterator pos = files.begin();
- pos != files.end(); ++pos) {
- vector<char> contents;
- if (!GetFileContents(pos->second, &contents)) {
- return false;
- }
-
- // Now append the upload files as a binary (octet-stream) part
- string filename_utf8 = WideToUTF8(pos->second);
- if (filename_utf8.empty()) {
- return false;
- }
-
- string file_part_name_utf8 = WideToUTF8(pos->first);
- if (file_part_name_utf8.empty()) {
- return false;
- }
-
- request_body->append("--" + boundary_str + "\r\n");
- request_body->append("Content-Disposition: form-data; "
- "name=\"" + file_part_name_utf8 + "\"; "
- "filename=\"" + filename_utf8 + "\"\r\n");
- request_body->append("Content-Type: application/octet-stream\r\n");
- request_body->append("\r\n");
-
- if (!contents.empty()) {
- request_body->append(&(contents[0]), contents.size());
- }
- request_body->append("\r\n");
- }
- request_body->append("--" + boundary_str + "--\r\n");
- return true;
-}
-
-// static
-bool HTTPUpload::GetFileContents(const wstring &filename,
- vector<char> *contents) {
- bool rv = false;
- // The "open" method on pre-MSVC8 ifstream implementations doesn't accept a
- // wchar_t* filename, so use _wfopen directly in that case. For VC8 and
- // later, _wfopen has been deprecated in favor of _wfopen_s, which does
- // not exist in earlier versions, so let the ifstream open the file itself.
- // GCC doesn't support wide file name and opening on FILE* requires ugly
- // hacks, so fallback to multi byte file.
-#ifdef _MSC_VER
- ifstream file;
- file.open(filename.c_str(), ios::binary);
-#else // GCC
- ifstream file(WideToMBCP(filename, CP_ACP).c_str(), ios::binary);
-#endif // _MSC_VER >= 1400
- if (file.is_open()) {
- file.seekg(0, ios::end);
- std::streamoff length = file.tellg();
- // Check for loss of data when converting lenght from std::streamoff into
- // std::vector<char>::size_type
- std::vector<char>::size_type vector_size =
- static_cast<std::vector<char>::size_type>(length);
- if (static_cast<std::streamoff>(vector_size) == length) {
- contents->resize(vector_size);
- if (length != 0) {
- file.seekg(0, ios::beg);
- file.read(&((*contents)[0]), length);
- }
- rv = true;
- }
- file.close();
- }
- return rv;
-}
-
-// static
-wstring HTTPUpload::UTF8ToWide(const string &utf8) {
- if (utf8.length() == 0) {
- return wstring();
- }
-
- // compute the length of the buffer we'll need
- int charcount = MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, NULL, 0);
-
- if (charcount == 0) {
- return wstring();
- }
-
- // convert
- wchar_t* buf = new wchar_t[charcount];
- MultiByteToWideChar(CP_UTF8, 0, utf8.c_str(), -1, buf, charcount);
- wstring result(buf);
- delete[] buf;
- return result;
-}
-
-// static
-string HTTPUpload::WideToMBCP(const wstring &wide, unsigned int cp) {
- if (wide.length() == 0) {
- return string();
- }
-
- // compute the length of the buffer we'll need
- int charcount = WideCharToMultiByte(cp, 0, wide.c_str(), -1,
- NULL, 0, NULL, NULL);
- if (charcount == 0) {
- return string();
- }
-
- // convert
- char *buf = new char[charcount];
- WideCharToMultiByte(cp, 0, wide.c_str(), -1, buf, charcount,
- NULL, NULL);
-
- string result(buf);
- delete[] buf;
- return result;
-}
-
-// static
-bool HTTPUpload::CheckParameters(const map<wstring, wstring> &parameters) {
- for (map<wstring, wstring>::const_iterator pos = parameters.begin();
- pos != parameters.end(); ++pos) {
- const wstring &str = pos->first;
- if (str.size() == 0) {
- return false; // disallow empty parameter names
- }
- for (unsigned int i = 0; i < str.size(); ++i) {
- wchar_t c = str[i];
- if (c < 32 || c == '"' || c > 127) {
- return false;
- }
- }
- }
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.h b/toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.h
deleted file mode 100644
index f8d48cb1b5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/http_upload.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// HTTPUpload provides a "nice" API to send a multipart HTTP(S) POST
-// request using wininet. It currently supports requests that contain
-// a set of string parameters (key/value pairs), and a file to upload.
-
-#ifndef COMMON_WINDOWS_HTTP_UPLOAD_H_
-#define COMMON_WINDOWS_HTTP_UPLOAD_H_
-
-#pragma warning(push)
-// Disable exception handler warnings.
-#pragma warning(disable : 4530)
-
-#include <windows.h>
-#include <wininet.h>
-
-#include <map>
-#include <string>
-#include <vector>
-
-namespace google_breakpad {
-
-using std::string;
-using std::wstring;
-using std::map;
-using std::vector;
-
-class HTTPUpload {
- public:
- // Sends the given sets of parameters and files as a multipart POST
- // request to the given URL.
- // Each key in |files| is the name of the file part of the request
- // (i.e. it corresponds to the name= attribute on an <input type="file">.
- // Parameter names must contain only printable ASCII characters,
- // and may not contain a quote (") character.
- // Only HTTP(S) URLs are currently supported. Returns true on success.
- // If the request is successful and response_body is non-NULL,
- // the response body will be returned in response_body.
- // If response_code is non-NULL, it will be set to the HTTP response code
- // received (or 0 if the request failed before getting an HTTP response).
- static bool SendRequest(const wstring &url,
- const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- int *timeout,
- wstring *response_body,
- int *response_code);
-
- private:
- class AutoInternetHandle;
-
- // Retrieves the HTTP response. If NULL is passed in for response,
- // this merely checks (via the return value) that we were successfully
- // able to retrieve exactly as many bytes of content in the response as
- // were specified in the Content-Length header.
- static bool ReadResponse(HINTERNET request, wstring* response);
-
- // Generates a new multipart boundary for a POST request
- static wstring GenerateMultipartBoundary();
-
- // Generates a HTTP request header for a multipart form submit.
- static wstring GenerateRequestHeader(const wstring &boundary);
-
- // Given a set of parameters, a set of upload files, and a file part name,
- // generates a multipart request body string with these parameters
- // and minidump contents. Returns true on success.
- static bool GenerateRequestBody(const map<wstring, wstring> &parameters,
- const map<wstring, wstring> &files,
- const wstring &boundary,
- string *request_body);
-
- // Fills the supplied vector with the contents of filename.
- static bool GetFileContents(const wstring &filename, vector<char> *contents);
-
- // Converts a UTF8 string to UTF16.
- static wstring UTF8ToWide(const string &utf8);
-
- // Converts a UTF16 string to UTF8.
- static string WideToUTF8(const wstring &wide) {
- return WideToMBCP(wide, CP_UTF8);
- }
-
- // Converts a UTF16 string to specified code page.
- static string WideToMBCP(const wstring &wide, unsigned int cp);
-
- // Checks that the given list of parameters has only printable
- // ASCII characters in the parameter name, and does not contain
- // any quote (") characters. Returns true if so.
- static bool CheckParameters(const map<wstring, wstring> &parameters);
-
- // No instances of this class should be created.
- // Disallow all constructors, destructors, and operator=.
- HTTPUpload();
- explicit HTTPUpload(const HTTPUpload &);
- void operator=(const HTTPUpload &);
- ~HTTPUpload();
-};
-
-} // namespace google_breakpad
-
-#pragma warning(pop)
-
-#endif // COMMON_WINDOWS_HTTP_UPLOAD_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild b/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild
deleted file mode 100644
index 5fcdae5a35..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/objs.mozbuild
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-lobjs_common = [
- 'guid_string.cc',
- 'string_utils.cc',
-]
-
-subdir = 'toolkit/crashreporter/google-breakpad/src/common/windows'
-objs_common = [
- '/%s/%s' % (subdir, s) for s in lobjs_common
-]
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/omap.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/omap.cc
deleted file mode 100644
index 554a57c2db..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/omap.cc
+++ /dev/null
@@ -1,694 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This contains a suite of tools for transforming symbol information when
-// when that information has been extracted from a PDB containing OMAP
-// information.
-
-// OMAP information is a lightweight description of a mapping between two
-// address spaces. It consists of two streams, each of them a vector 2-tuples.
-// The OMAPTO stream contains tuples of the form
-//
-// (RVA in transformed image, RVA in original image)
-//
-// while the OMAPFROM stream contains tuples of the form
-//
-// (RVA in original image, RVA in transformed image)
-//
-// The entries in each vector are sorted by the first value of the tuple, and
-// the lengths associated with a mapping are implicit as the distance between
-// two successive addresses in the vector.
-
-// Consider a trivial 10-byte function described by the following symbol:
-//
-// Function: RVA 0x00001000, length 10, "foo"
-//
-// Now consider the same function, but with 5-bytes of instrumentation injected
-// at offset 5. The OMAP streams describing this would look like:
-//
-// OMAPTO : [ [0x00001000, 0x00001000],
-// [0x00001005, 0xFFFFFFFF],
-// [0x0000100a, 0x00001005] ]
-// OMAPFROM: [ [0x00001000, 0x00001000],
-// [0x00001005, 0x0000100a] ]
-//
-// In this case the injected code has been marked as not originating in the
-// source image, and thus it will have no symbol information at all. However,
-// the injected code may also be associated with an original address range;
-// for example, when prepending instrumentation to a basic block the
-// instrumentation can be labelled as originating from the same source BB such
-// that symbol resolution will still find the appropriate source code line
-// number. In this case the OMAP stream would look like:
-//
-// OMAPTO : [ [0x00001000, 0x00001000],
-// [0x00001005, 0x00001005],
-// [0x0000100a, 0x00001005] ]
-// OMAPFROM: [ [0x00001000, 0x00001000],
-// [0x00001005, 0x0000100a] ]
-//
-// Suppose we asked DIA to lookup the symbol at location 0x0000100a of the
-// instrumented image. It would first run this through the OMAPTO table and
-// translate that address to 0x00001005. It would then lookup the symbol
-// at that address and return the symbol for the function "foo". This is the
-// correct result.
-//
-// However, if we query DIA for the length and address of the symbol it will
-// tell us that it has length 10 and is at RVA 0x00001000. The location is
-// correct, but the length doesn't take into account the 5-bytes of injected
-// code. Symbol resolution works (starting from an instrumented address,
-// mapping to an original address, and looking up a symbol), but the symbol
-// metadata is incorrect.
-//
-// If we dump the symbols using DIA they will have their addresses
-// appropriately transformed and reflect positions in the instrumented image.
-// However, if we try to do a lookup using those symbols resolution can fail.
-// For example, the address 0x0000100a will not map to the symbol for "foo",
-// because DIA tells us it is at location 0x00001000 (correct) with length
-// 10 (incorrect). The problem is one of order of operations: in this case
-// we're attempting symbol resolution by looking up an instrumented address
-// in the table of translated symbols.
-//
-// One way to handle this is to dump the OMAP information as part of the
-// breakpad symbols. This requires the rest of the toolchain to be aware of
-// OMAP information and to use it when present prior to performing lookup. The
-// other option is to properly transform the symbols (updating length as well as
-// position) so that resolution will work as expected for translated addresses.
-// This is transparent to the rest of the toolchain.
-
-#include "common/windows/omap.h"
-
-#include <atlbase.h>
-
-#include <algorithm>
-#include <cassert>
-#include <set>
-
-#include "common/windows/dia_util.h"
-
-namespace google_breakpad {
-
-namespace {
-
-static const wchar_t kOmapToDebugStreamName[] = L"OMAPTO";
-static const wchar_t kOmapFromDebugStreamName[] = L"OMAPFROM";
-
-// Dependending on where this is used in breakpad we sometimes get min/max from
-// windef, and other times from algorithm. To get around this we simply
-// define our own min/max functions.
-template<typename T>
-const T& Min(const T& t1, const T& t2) { return t1 < t2 ? t1 : t2; }
-template<typename T>
-const T& Max(const T& t1, const T& t2) { return t1 > t2 ? t1 : t2; }
-
-// It makes things more readable to have two different OMAP types. We cast
-// normal OMAPs into these. They must be the same size as the OMAP structure
-// for this to work, hence the static asserts.
-struct OmapOrigToTran {
- DWORD rva_original;
- DWORD rva_transformed;
-};
-struct OmapTranToOrig {
- DWORD rva_transformed;
- DWORD rva_original;
-};
-static_assert(sizeof(OmapOrigToTran) == sizeof(OMAP),
- "OmapOrigToTran must have same size as OMAP.");
-static_assert(sizeof(OmapTranToOrig) == sizeof(OMAP),
- "OmapTranToOrig must have same size as OMAP.");
-typedef std::vector<OmapOrigToTran> OmapFromTable;
-typedef std::vector<OmapTranToOrig> OmapToTable;
-
-// Used for sorting and searching through a Mapping.
-bool MappedRangeOriginalLess(const MappedRange& lhs, const MappedRange& rhs) {
- if (lhs.rva_original < rhs.rva_original)
- return true;
- if (lhs.rva_original > rhs.rva_original)
- return false;
- return lhs.length < rhs.length;
-}
-bool MappedRangeMappedLess(const MappedRange& lhs, const MappedRange& rhs) {
- if (lhs.rva_transformed < rhs.rva_transformed)
- return true;
- if (lhs.rva_transformed > rhs.rva_transformed)
- return false;
- return lhs.length < rhs.length;
-}
-
-// Used for searching through the EndpointIndexMap.
-bool EndpointIndexLess(const EndpointIndex& ei1, const EndpointIndex& ei2) {
- return ei1.endpoint < ei2.endpoint;
-}
-
-// Finds the debug stream with the given |name| in the given |session|, and
-// populates |table| with its contents. Casts the data directly into OMAP
-// structs.
-bool FindAndLoadOmapTable(const wchar_t* name,
- IDiaSession* session,
- OmapTable* table) {
- assert(name != NULL);
- assert(session != NULL);
- assert(table != NULL);
-
- CComPtr<IDiaEnumDebugStreamData> stream;
- if (!FindDebugStream(name, session, &stream))
- return false;
- assert(stream.p != NULL);
-
- LONG count = 0;
- if (FAILED(stream->get_Count(&count))) {
- fprintf(stderr, "IDiaEnumDebugStreamData::get_Count failed for stream "
- "\"%ws\"\n", name);
- return false;
- }
-
- // Get the length of the stream in bytes.
- DWORD bytes_read = 0;
- ULONG count_read = 0;
- if (FAILED(stream->Next(count, 0, &bytes_read, NULL, &count_read))) {
- fprintf(stderr, "IDiaEnumDebugStreamData::Next failed while reading "
- "length of stream \"%ws\"\n", name);
- return false;
- }
-
- // Ensure it's consistent with the OMAP data type.
- DWORD bytes_expected = count * sizeof(OmapTable::value_type);
- if (count * sizeof(OmapTable::value_type) != bytes_read) {
- fprintf(stderr, "DIA debug stream \"%ws\" has an unexpected length", name);
- return false;
- }
-
- // Read the table.
- table->resize(count);
- bytes_read = 0;
- count_read = 0;
- if (FAILED(stream->Next(count, bytes_expected, &bytes_read,
- reinterpret_cast<BYTE*>(&table->at(0)),
- &count_read))) {
- fprintf(stderr, "IDiaEnumDebugStreamData::Next failed while reading "
- "data from stream \"%ws\"\n", name);
- return false;
- }
-
- return true;
-}
-
-// This determines the original image length by looking through the segment
-// table.
-bool GetOriginalImageLength(IDiaSession* session, DWORD* image_length) {
- assert(session != NULL);
- assert(image_length != NULL);
-
- CComPtr<IDiaEnumSegments> enum_segments;
- if (!FindTable(session, &enum_segments))
- return false;
- assert(enum_segments.p != NULL);
-
- DWORD temp_image_length = 0;
- CComPtr<IDiaSegment> segment;
- ULONG fetched = 0;
- while (SUCCEEDED(enum_segments->Next(1, &segment, &fetched)) &&
- fetched == 1) {
- assert(segment.p != NULL);
-
- DWORD rva = 0;
- DWORD length = 0;
- DWORD frame = 0;
- if (FAILED(segment->get_relativeVirtualAddress(&rva)) ||
- FAILED(segment->get_length(&length)) ||
- FAILED(segment->get_frame(&frame))) {
- fprintf(stderr, "Failed to get basic properties for IDiaSegment\n");
- return false;
- }
-
- if (frame > 0) {
- DWORD segment_end = rva + length;
- if (segment_end > temp_image_length)
- temp_image_length = segment_end;
- }
- segment.Release();
- }
-
- *image_length = temp_image_length;
- return true;
-}
-
-// Detects regions of the original image that have been removed in the
-// transformed image, and sets the 'removed' property on all mapped ranges
-// immediately preceding a gap. The mapped ranges must be sorted by
-// 'rva_original'.
-void FillInRemovedLengths(Mapping* mapping) {
- assert(mapping != NULL);
-
- // Find and fill gaps. We do this with two sweeps. We first sweep forward
- // looking for gaps. When we identify a gap we then sweep forward with a
- // second scan and set the 'removed' property for any intervals that
- // immediately precede the gap.
- //
- // Gaps are typically between two successive intervals, but not always:
- //
- // Range 1: ---------------
- // Range 2: -------
- // Range 3: -------------
- // Gap : ******
- //
- // In the above example the gap is between range 1 and range 3. A forward
- // sweep finds the gap, and a second forward sweep identifies that range 1
- // immediately precedes the gap and sets its 'removed' property.
-
- size_t fill = 0;
- DWORD rva_front = 0;
- for (size_t find = 0; find < mapping->size(); ++find) {
-#ifndef NDEBUG
- // We expect the mapped ranges to be sorted by 'rva_original'.
- if (find > 0) {
- assert(mapping->at(find - 1).rva_original <=
- mapping->at(find).rva_original);
- }
-#endif
-
- if (rva_front < mapping->at(find).rva_original) {
- // We've found a gap. Fill it in by setting the 'removed' property for
- // any affected intervals.
- DWORD removed = mapping->at(find).rva_original - rva_front;
- for (; fill < find; ++fill) {
- if (mapping->at(fill).rva_original + mapping->at(fill).length !=
- rva_front) {
- continue;
- }
-
- // This interval ends right where the gap starts. It needs to have its
- // 'removed' information filled in.
- mapping->at(fill).removed = removed;
- }
- }
-
- // Advance the front that indicates the covered portion of the image.
- rva_front = mapping->at(find).rva_original + mapping->at(find).length;
- }
-}
-
-// Builds a unified view of the mapping between the original and transformed
-// image space by merging OMAPTO and OMAPFROM data.
-void BuildMapping(const OmapData& omap_data, Mapping* mapping) {
- assert(mapping != NULL);
-
- mapping->clear();
-
- if (omap_data.omap_from.empty() || omap_data.omap_to.empty())
- return;
-
- // The names 'omap_to' and 'omap_from' are awfully confusing, so we make
- // ourselves more explicit here. This cast is only safe because the underlying
- // types have the exact same size.
- const OmapToTable& tran2orig =
- reinterpret_cast<const OmapToTable&>(omap_data.omap_to);
- const OmapFromTable& orig2tran = reinterpret_cast<const OmapFromTable&>(
- omap_data.omap_from);
-
- // Handle the range of data at the beginning of the image. This is not usually
- // specified by the OMAP data.
- if (tran2orig[0].rva_transformed > 0 && orig2tran[0].rva_original > 0) {
- DWORD header_transformed = tran2orig[0].rva_transformed;
- DWORD header_original = orig2tran[0].rva_original;
- DWORD header = Min(header_transformed, header_original);
-
- MappedRange mr = {};
- mr.length = header;
- mr.injected = header_transformed - header;
- mr.removed = header_original - header;
- mapping->push_back(mr);
- }
-
- // Convert the implied lengths to explicit lengths, and infer which content
- // has been injected into the transformed image. Injected content is inferred
- // as regions of the transformed address space that does not map back to
- // known valid content in the original image.
- for (size_t i = 0; i < tran2orig.size(); ++i) {
- const OmapTranToOrig& o1 = tran2orig[i];
-
- // This maps to content that is outside the original image, thus it
- // describes injected content. We can skip this entry.
- if (o1.rva_original >= omap_data.length_original)
- continue;
-
- // Calculate the length of the current OMAP entry. This is implicit as the
- // distance between successive |rva| values, capped at the end of the
- // original image.
- DWORD length = 0;
- if (i + 1 < tran2orig.size()) {
- const OmapTranToOrig& o2 = tran2orig[i + 1];
-
- // We expect the table to be sorted by rva_transformed.
- assert(o1.rva_transformed <= o2.rva_transformed);
-
- length = o2.rva_transformed - o1.rva_transformed;
- if (o1.rva_original + length > omap_data.length_original) {
- length = omap_data.length_original - o1.rva_original;
- }
- } else {
- length = omap_data.length_original - o1.rva_original;
- }
-
- // Zero-length entries don't describe anything and can be ignored.
- if (length == 0)
- continue;
-
- // Any gaps in the transformed address-space are due to injected content.
- if (!mapping->empty()) {
- MappedRange& prev_mr = mapping->back();
- prev_mr.injected += o1.rva_transformed -
- (prev_mr.rva_transformed + prev_mr.length);
- }
-
- MappedRange mr = {};
- mr.rva_original = o1.rva_original;
- mr.rva_transformed = o1.rva_transformed;
- mr.length = length;
- mapping->push_back(mr);
- }
-
- // Sort based on the original image addresses.
- std::sort(mapping->begin(), mapping->end(), MappedRangeOriginalLess);
-
- // Fill in the 'removed' lengths by looking for gaps in the coverage of the
- // original address space.
- FillInRemovedLengths(mapping);
-
- return;
-}
-
-void BuildEndpointIndexMap(ImageMap* image_map) {
- assert(image_map != NULL);
-
- if (image_map->mapping.size() == 0)
- return;
-
- const Mapping& mapping = image_map->mapping;
- EndpointIndexMap& eim = image_map->endpoint_index_map;
-
- // Get the unique set of interval endpoints.
- std::set<DWORD> endpoints;
- for (size_t i = 0; i < mapping.size(); ++i) {
- endpoints.insert(mapping[i].rva_original);
- endpoints.insert(mapping[i].rva_original +
- mapping[i].length +
- mapping[i].removed);
- }
-
- // Use the endpoints to initialize the secondary search structure for the
- // mapping.
- eim.resize(endpoints.size());
- std::set<DWORD>::const_iterator it = endpoints.begin();
- for (size_t i = 0; it != endpoints.end(); ++it, ++i) {
- eim[i].endpoint = *it;
- eim[i].index = mapping.size();
- }
-
- // For each endpoint we want the smallest index of any interval containing
- // it. We iterate over the intervals and update the indices associated with
- // each interval endpoint contained in the current interval. In the general
- // case of an arbitrary set of intervals this is O(n^2), but the structure of
- // OMAP data makes this O(n).
- for (size_t i = 0; i < mapping.size(); ++i) {
- EndpointIndex ei1 = { mapping[i].rva_original, 0 };
- EndpointIndexMap::iterator it1 = std::lower_bound(
- eim.begin(), eim.end(), ei1, EndpointIndexLess);
-
- EndpointIndex ei2 = { mapping[i].rva_original + mapping[i].length +
- mapping[i].removed, 0 };
- EndpointIndexMap::iterator it2 = std::lower_bound(
- eim.begin(), eim.end(), ei2, EndpointIndexLess);
-
- for (; it1 != it2; ++it1)
- it1->index = Min(i, it1->index);
- }
-}
-
-// Clips the given mapped range.
-void ClipMappedRangeOriginal(const AddressRange& clip_range,
- MappedRange* mapped_range) {
- assert(mapped_range != NULL);
-
- // The clipping range is entirely outside of the mapped range.
- if (clip_range.end() <= mapped_range->rva_original ||
- mapped_range->rva_original + mapped_range->length +
- mapped_range->removed <= clip_range.rva) {
- mapped_range->length = 0;
- mapped_range->injected = 0;
- mapped_range->removed = 0;
- return;
- }
-
- // Clip the left side.
- if (mapped_range->rva_original < clip_range.rva) {
- DWORD clip_left = clip_range.rva - mapped_range->rva_original;
- mapped_range->rva_original += clip_left;
- mapped_range->rva_transformed += clip_left;
-
- if (clip_left > mapped_range->length) {
- // The left clipping boundary entirely erases the content section of the
- // range.
- DWORD trim = clip_left - mapped_range->length;
- mapped_range->length = 0;
- mapped_range->injected -= Min(trim, mapped_range->injected);
- // We know that trim <= mapped_range->remove.
- mapped_range->removed -= trim;
- } else {
- // The left clipping boundary removes some, but not all, of the content.
- // As such it leaves the removed/injected component intact.
- mapped_range->length -= clip_left;
- }
- }
-
- // Clip the right side.
- DWORD end_original = mapped_range->rva_original + mapped_range->length;
- if (clip_range.end() < end_original) {
- // The right clipping boundary lands in the 'content' section of the range,
- // entirely clearing the injected/removed portion.
- DWORD clip_right = end_original - clip_range.end();
- mapped_range->length -= clip_right;
- mapped_range->injected = 0;
- mapped_range->removed = 0;
- return;
- } else {
- // The right clipping boundary is outside of the content, but may affect
- // the removed/injected portion of the range.
- DWORD end_removed = end_original + mapped_range->removed;
- if (clip_range.end() < end_removed)
- mapped_range->removed = clip_range.end() - end_original;
-
- DWORD end_injected = end_original + mapped_range->injected;
- if (clip_range.end() < end_injected)
- mapped_range->injected = clip_range.end() - end_original;
- }
-
- return;
-}
-
-} // namespace
-
-int AddressRange::Compare(const AddressRange& rhs) const {
- if (end() <= rhs.rva)
- return -1;
- if (rhs.end() <= rva)
- return 1;
- return 0;
-}
-
-bool GetOmapDataAndDisableTranslation(IDiaSession* session,
- OmapData* omap_data) {
- assert(session != NULL);
- assert(omap_data != NULL);
-
- CComPtr<IDiaAddressMap> address_map;
- if (FAILED(session->QueryInterface(&address_map))) {
- fprintf(stderr, "IDiaSession::QueryInterface(IDiaAddressMap) failed\n");
- return false;
- }
- assert(address_map.p != NULL);
-
- BOOL omap_enabled = FALSE;
- if (FAILED(address_map->get_addressMapEnabled(&omap_enabled))) {
- fprintf(stderr, "IDiaAddressMap::get_addressMapEnabled failed\n");
- return false;
- }
-
- if (!omap_enabled) {
- // We indicate the non-presence of OMAP data by returning empty tables.
- omap_data->omap_from.clear();
- omap_data->omap_to.clear();
- omap_data->length_original = 0;
- return true;
- }
-
- // OMAP data is present. Disable translation.
- if (FAILED(address_map->put_addressMapEnabled(FALSE))) {
- fprintf(stderr, "IDiaAddressMap::put_addressMapEnabled failed\n");
- return false;
- }
-
- // Read the OMAP streams.
- if (!FindAndLoadOmapTable(kOmapFromDebugStreamName,
- session,
- &omap_data->omap_from)) {
- return false;
- }
- if (!FindAndLoadOmapTable(kOmapToDebugStreamName,
- session,
- &omap_data->omap_to)) {
- return false;
- }
-
- // Get the lengths of the address spaces.
- if (!GetOriginalImageLength(session, &omap_data->length_original))
- return false;
-
- return true;
-}
-
-void BuildImageMap(const OmapData& omap_data, ImageMap* image_map) {
- assert(image_map != NULL);
-
- BuildMapping(omap_data, &image_map->mapping);
- BuildEndpointIndexMap(image_map);
-}
-
-void MapAddressRange(const ImageMap& image_map,
- const AddressRange& original_range,
- AddressRangeVector* mapped_ranges) {
- assert(mapped_ranges != NULL);
-
- const Mapping& map = image_map.mapping;
-
- // Handle the trivial case of an empty image_map. This means that there is
- // no transformation to be applied, and we can simply return the original
- // range.
- if (map.empty()) {
- mapped_ranges->push_back(original_range);
- return;
- }
-
- // If we get a query of length 0 we need to handle it by using a non-zero
- // query length.
- AddressRange query_range(original_range);
- if (query_range.length == 0)
- query_range.length = 1;
-
- // Find the range of intervals that can potentially intersect our query range.
- size_t imin = 0;
- size_t imax = 0;
- {
- // The index of the earliest possible range that can affect is us done by
- // searching through the secondary indexing structure.
- const EndpointIndexMap& eim = image_map.endpoint_index_map;
- EndpointIndex q1 = { query_range.rva, 0 };
- EndpointIndexMap::const_iterator it1 = std::lower_bound(
- eim.begin(), eim.end(), q1, EndpointIndexLess);
- if (it1 == eim.end()) {
- imin = map.size();
- } else {
- // Backup to find the interval that contains our query point.
- if (it1 != eim.begin() && query_range.rva < it1->endpoint)
- --it1;
- imin = it1->index;
- }
-
- // The first range that can't possibly intersect us is found by searching
- // through the image map directly as it is already sorted by interval start
- // point.
- MappedRange q2 = { query_range.end(), 0 };
- Mapping::const_iterator it2 = std::lower_bound(
- map.begin(), map.end(), q2, MappedRangeOriginalLess);
- imax = it2 - map.begin();
- }
-
- // Find all intervals that intersect the query range.
- Mapping temp_map;
- for (size_t i = imin; i < imax; ++i) {
- MappedRange mr = map[i];
- ClipMappedRangeOriginal(query_range, &mr);
- if (mr.length + mr.injected > 0)
- temp_map.push_back(mr);
- }
-
- // If there are no intersecting ranges then the query range has been removed
- // from the image in question.
- if (temp_map.empty())
- return;
-
- // Sort based on transformed addresses.
- std::sort(temp_map.begin(), temp_map.end(), MappedRangeMappedLess);
-
- // Zero-length queries can't actually be merged. We simply output the set of
- // unique RVAs that correspond to the query RVA.
- if (original_range.length == 0) {
- mapped_ranges->push_back(AddressRange(temp_map[0].rva_transformed, 0));
- for (size_t i = 1; i < temp_map.size(); ++i) {
- if (temp_map[i].rva_transformed > mapped_ranges->back().rva)
- mapped_ranges->push_back(AddressRange(temp_map[i].rva_transformed, 0));
- }
- return;
- }
-
- // Merge any ranges that are consecutive in the mapped image. We merge over
- // injected content if it makes ranges contiguous, but we ignore any injected
- // content at the tail end of a range. This allows us to detect symbols that
- // have been lengthened by injecting content in the middle. However, it
- // misses the case where content has been injected at the head or the tail.
- // The problem is that it doesn't know whether to attribute it to the
- // preceding or following symbol. It is up to the author of the transform to
- // output explicit OMAP info in these cases to ensure full coverage of the
- // transformed address space.
- DWORD rva_begin = temp_map[0].rva_transformed;
- DWORD rva_cur_content = rva_begin + temp_map[0].length;
- DWORD rva_cur_injected = rva_cur_content + temp_map[0].injected;
- for (size_t i = 1; i < temp_map.size(); ++i) {
- if (rva_cur_injected < temp_map[i].rva_transformed) {
- // This marks the end of a continuous range in the image. Output the
- // current range and start a new one.
- if (rva_begin < rva_cur_content) {
- mapped_ranges->push_back(
- AddressRange(rva_begin, rva_cur_content - rva_begin));
- }
- rva_begin = temp_map[i].rva_transformed;
- }
-
- rva_cur_content = temp_map[i].rva_transformed + temp_map[i].length;
- rva_cur_injected = rva_cur_content + temp_map[i].injected;
- }
-
- // Output the range in progress.
- if (rva_begin < rva_cur_content) {
- mapped_ranges->push_back(
- AddressRange(rva_begin, rva_cur_content - rva_begin));
- }
-
- return;
-}
-
-} // namespace google_breakpad \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/omap.h b/toolkit/crashreporter/google-breakpad/src/common/windows/omap.h
deleted file mode 100644
index bc293afb51..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/omap.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Provides an API for mapping symbols through OMAP information, if a PDB file
-// is augmented with it. This allows breakpad to work with addresses in
-// transformed images by transforming the symbols themselves, rather than
-// transforming addresses prior to querying symbols (the way it is typically
-// done by Windows-native tools, including the DIA).
-
-#ifndef COMMON_WINDOWS_OMAP_H_
-#define COMMON_WINDOWS_OMAP_H_
-
-#include "common/windows/omap_internal.h"
-
-namespace google_breakpad {
-
-// If the given session contains OMAP data this extracts it, populating
-// |omap_data|, and then disabling automatic translation for the session.
-// OMAP data is present in the PDB if |omap_data| is not empty. This returns
-// true on success, false otherwise.
-bool GetOmapDataAndDisableTranslation(IDiaSession* dia_session,
- OmapData* omap_data);
-
-// Given raw OMAP data builds an ImageMap. This can be used to query individual
-// image ranges using MapAddressRange.
-// |omap_data|| is the OMAP data extracted from the PDB.
-// |image_map| will be populated with a description of the image mapping. If
-// |omap_data| is empty then this will also be empty.
-void BuildImageMap(const OmapData& omap_data, ImageMap* image_map);
-
-// Given an address range in the original image space determines how exactly it
-// has been tranformed.
-// |omap_data| is the OMAP data extracted from the PDB, which must not be
-// empty.
-// |original_range| is the address range in the original image being queried.
-// |mapped_ranges| will be populated with a full description of the mapping.
-// They may be disjoint in the transformed image so a vector is needed to
-// fully represent the mapping. This will be appended to if it is not
-// empty. If |omap_data| is empty then |mapped_ranges| will simply be
-// populated with a copy of |original_range| (the identity transform).
-void MapAddressRange(const ImageMap& image_map,
- const AddressRange& original_range,
- AddressRangeVector* mapped_ranges);
-
-} // namespace google_breakpad
-
-#endif // COMMON_WINDOWS_OMAP_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/omap_internal.h b/toolkit/crashreporter/google-breakpad/src/common/windows/omap_internal.h
deleted file mode 100644
index 3f904d7a73..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/omap_internal.h
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Declares internal implementation details for functionality in omap.h and
-// omap.cc.
-
-#ifndef COMMON_WINDOWS_OMAP_INTERNAL_H_
-#define COMMON_WINDOWS_OMAP_INTERNAL_H_
-
-#include <windows.h>
-#include <dia2.h>
-
-#include <vector>
-
-namespace google_breakpad {
-
-// The OMAP struct is defined by debughlp.h, which doesn't play nicely with
-// imagehlp.h. We simply redefine it.
-struct OMAP {
- DWORD rva;
- DWORD rvaTo;
-};
-static_assert(sizeof(OMAP) == 8, "Wrong size for OMAP structure.");
-typedef std::vector<OMAP> OmapTable;
-
-// This contains the OMAP data extracted from an image.
-struct OmapData {
- // The table of OMAP entries describing the transformation from the
- // original image to the transformed image.
- OmapTable omap_from;
- // The table of OMAP entries describing the transformation from the
- // instrumented image to the original image.
- OmapTable omap_to;
- // The length of the original untransformed image.
- DWORD length_original;
-
- OmapData() : length_original(0) { }
-};
-
-// This represents a range of addresses in an image.
-struct AddressRange {
- DWORD rva;
- DWORD length;
-
- AddressRange() : rva(0), length(0) { }
- AddressRange(DWORD rva, DWORD length) : rva(rva), length(length) { }
-
- // Returns the end address of this range.
- DWORD end() const { return rva + length; }
-
- // Addreses only compare as less-than or greater-than if they are not
- // overlapping. Otherwise, they compare equal.
- int Compare(const AddressRange& rhs) const;
- bool operator<(const AddressRange& rhs) const { return Compare(rhs) == -1; }
- bool operator>(const AddressRange& rhs) const { return Compare(rhs) == 1; }
-
- // Equality operators compare exact values.
- bool operator==(const AddressRange& rhs) const {
- return rva == rhs.rva && length == rhs.length;
- }
- bool operator!=(const AddressRange& rhs) const { return !((*this) == rhs); }
-};
-
-typedef std::vector<AddressRange> AddressRangeVector;
-
-// This represents an address range in an original image, and its corresponding
-// range in the transformed image.
-struct MappedRange {
- // An address in the original image.
- DWORD rva_original;
- // The corresponding addresses in the transformed image.
- DWORD rva_transformed;
- // The length of the address range.
- DWORD length;
- // It is possible for code to be injected into a transformed image, for which
- // there is no corresponding code in the original image. If this range of
- // transformed image is immediately followed by such injected code we maintain
- // a record of its length here.
- DWORD injected;
- // It is possible for code to be removed from the original image. This happens
- // for things like padding between blocks. There is no actual content lost,
- // but the spacing between items may be lost. This keeps track of any removed
- // content immediately following the |original| range.
- DWORD removed;
-};
-// A vector of mapped ranges is used as a more useful representation of
-// OMAP data.
-typedef std::vector<MappedRange> Mapping;
-
-// Used as a secondary search structure accompanying a Mapping.
-struct EndpointIndex {
- DWORD endpoint;
- size_t index;
-};
-typedef std::vector<EndpointIndex> EndpointIndexMap;
-
-// An ImageMap is vector of mapped ranges, plus a secondary index into it for
-// doing interval searches. (An interval tree would also work, but is overkill
-// because we don't need insertion and deletion.)
-struct ImageMap {
- // This is a description of the mapping between original and transformed
- // image, sorted by addresses in the original image.
- Mapping mapping;
- // For all interval endpoints in |mapping| this stores the minimum index of
- // an interval in |mapping| that contains the endpoint. Useful for doing
- // interval intersection queries.
- EndpointIndexMap endpoint_index_map;
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_WINDOWS_OMAP_INTERNAL_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/omap_unittest.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/omap_unittest.cc
deleted file mode 100644
index 960a33f469..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/omap_unittest.cc
+++ /dev/null
@@ -1,330 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unittests for OMAP related functions.
-
-#include "common/windows/omap.h"
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace google_breakpad {
-
-// Equality operators for ContainerEq. These must be outside of the anonymous
-// namespace in order for them to be found.
-bool operator==(const MappedRange& mr1, const MappedRange& mr2) {
- return mr1.rva_original == mr2.rva_original &&
- mr1.rva_transformed == mr2.rva_transformed &&
- mr1.length == mr2.length &&
- mr1.injected == mr2.injected &&
- mr1.removed == mr2.removed;
-}
-bool operator==(const EndpointIndex& ei1, const EndpointIndex& ei2) {
- return ei1.endpoint == ei2.endpoint && ei1.index == ei2.index;
-}
-
-// Pretty printers for more meaningful error messages. Also need to be outside
-// the anonymous namespace.
-std::ostream& operator<<(std::ostream& os, const MappedRange& mr) {
- os << "MappedRange(rva_original=" << mr.rva_original
- << ", rva_transformed=" << mr.rva_transformed
- << ", length=" << mr.length
- << ", injected=" << mr.injected
- << ", removed=" << mr.removed << ")";
- return os;
-}
-std::ostream& operator<<(std::ostream& os, const EndpointIndex& ei) {
- os << "EndpointIndex(endpoint=" << ei.endpoint
- << ", index=" << ei.index << ")";
- return os;
-}
-std::ostream& operator<<(std::ostream& os, const AddressRange& ar) {
- os << "AddressRange(rva=" << ar.rva << ", length=" << ar.length << ")";
- return os;
-}
-
-namespace {
-
-OMAP CreateOmap(DWORD rva, DWORD rvaTo) {
- OMAP o = { rva, rvaTo };
- return o;
-}
-
-MappedRange CreateMappedRange(DWORD rva_original,
- DWORD rva_transformed,
- DWORD length,
- DWORD injected,
- DWORD removed) {
- MappedRange mr = { rva_original, rva_transformed, length, injected, removed };
- return mr;
-}
-
-EndpointIndex CreateEndpointIndex(DWORD endpoint, size_t index) {
- EndpointIndex ei = { endpoint, index };
- return ei;
-}
-
-// (C is removed)
-// Original : A B C D E F G H
-// Transformed: A B D F E * H1 G1 G2 H2
-// (* is injected, G is copied, H is split)
-// A is implied.
-
-// Layout of the original image.
-const AddressRange B(100, 15);
-const AddressRange C(B.end(), 10);
-const AddressRange D(C.end(), 25);
-const AddressRange E(D.end(), 10);
-const AddressRange F(E.end(), 40);
-const AddressRange G(F.end(), 3);
-const AddressRange H(G.end(), 7);
-
-// Layout of the transformed image.
-const AddressRange Bt(100, 15);
-const AddressRange Dt(Bt.end(), 20); // D is shortened.
-const AddressRange Ft(Dt.end(), F.length);
-const AddressRange Et(Ft.end(), E.length);
-const AddressRange injected(Et.end(), 5);
-const AddressRange H1t(injected.end(), 4); // H is split.
-const AddressRange G1t(H1t.end(), G.length); // G is copied.
-const AddressRange G2t(G1t.end(), G.length); // G is copied.
-const AddressRange H2t(G2t.end(), 3); // H is split.
-
-class BuildImageMapTest : public testing::Test {
- public:
- static const DWORD kInvalidAddress = 0xFFFFFFFF;
-
- void InitOmapData() {
- omap_data.length_original = H.end();
-
- // Build the OMAPTO vector (from transformed to original).
- omap_data.omap_to.push_back(CreateOmap(Bt.rva, B.rva));
- omap_data.omap_to.push_back(CreateOmap(Dt.rva, D.rva));
- omap_data.omap_to.push_back(CreateOmap(Ft.rva, F.rva));
- omap_data.omap_to.push_back(CreateOmap(Et.rva, E.rva));
- omap_data.omap_to.push_back(CreateOmap(injected.rva, kInvalidAddress));
- omap_data.omap_to.push_back(CreateOmap(H1t.rva, H.rva));
- omap_data.omap_to.push_back(CreateOmap(G1t.rva, G.rva));
- omap_data.omap_to.push_back(CreateOmap(G2t.rva, G.rva));
- omap_data.omap_to.push_back(CreateOmap(H2t.rva, H.rva + H1t.length));
- omap_data.omap_to.push_back(CreateOmap(H2t.end(), kInvalidAddress));
-
- // Build the OMAPFROM vector (from original to transformed).
- omap_data.omap_from.push_back(CreateOmap(B.rva, Bt.rva));
- omap_data.omap_from.push_back(CreateOmap(C.rva, kInvalidAddress));
- omap_data.omap_from.push_back(CreateOmap(D.rva, Dt.rva));
- omap_data.omap_from.push_back(CreateOmap(E.rva, Et.rva));
- omap_data.omap_from.push_back(CreateOmap(F.rva, Ft.rva));
- omap_data.omap_from.push_back(CreateOmap(G.rva, G1t.rva));
- omap_data.omap_from.push_back(CreateOmap(H.rva, H1t.rva));
- omap_data.omap_from.push_back(CreateOmap(H.rva + H1t.length, H2t.rva));
- omap_data.omap_from.push_back(CreateOmap(H.end(), kInvalidAddress));
- }
-
- OmapData omap_data;
-};
-
-} // namespace
-
-TEST_F(BuildImageMapTest, EmptyImageMapOnEmptyOmapData) {
- ASSERT_EQ(0u, omap_data.omap_from.size());
- ASSERT_EQ(0u, omap_data.omap_to.size());
- ASSERT_EQ(0u, omap_data.length_original);
-
- ImageMap image_map;
- BuildImageMap(omap_data, &image_map);
- EXPECT_EQ(0u, image_map.mapping.size());
- EXPECT_EQ(0u, image_map.endpoint_index_map.size());
-}
-
-TEST_F(BuildImageMapTest, ImageMapIsCorrect) {
- InitOmapData();
- ASSERT_LE(0u, omap_data.omap_from.size());
- ASSERT_LE(0u, omap_data.omap_to.size());
- ASSERT_LE(0u, omap_data.length_original);
-
- ImageMap image_map;
- BuildImageMap(omap_data, &image_map);
- EXPECT_LE(9u, image_map.mapping.size());
- EXPECT_LE(9u, image_map.endpoint_index_map.size());
-
- Mapping mapping;
- mapping.push_back(CreateMappedRange(0, 0, B.rva, 0, 0));
- // C is removed, and it originally comes immediately after B.
- mapping.push_back(CreateMappedRange(B.rva, Bt.rva, B.length, 0, C.length));
- // D is shortened by a length of 5.
- mapping.push_back(CreateMappedRange(D.rva, Dt.rva, Dt.length, 0, 5));
- // The injected content comes immediately after E in the transformed image.
- mapping.push_back(CreateMappedRange(E.rva, Et.rva, E.length, injected.length,
- 0));
- mapping.push_back(CreateMappedRange(F.rva, Ft.rva, F.length, 0, 0));
- // G is copied so creates two entries.
- mapping.push_back(CreateMappedRange(G.rva, G1t.rva, G.length, 0, 0));
- mapping.push_back(CreateMappedRange(G.rva, G2t.rva, G.length, 0, 0));
- // H is split, so create two entries.
- mapping.push_back(CreateMappedRange(H.rva, H1t.rva, H1t.length, 0, 0));
- mapping.push_back(CreateMappedRange(H.rva + H1t.length, H2t.rva, H2t.length,
- 0, 0));
- EXPECT_THAT(mapping,
- testing::ContainerEq(image_map.mapping));
-
- EndpointIndexMap endpoint_index_map;
- endpoint_index_map.push_back(CreateEndpointIndex(0, 0));
- endpoint_index_map.push_back(CreateEndpointIndex(B.rva, 1));
- endpoint_index_map.push_back(CreateEndpointIndex(D.rva, 2));
- endpoint_index_map.push_back(CreateEndpointIndex(E.rva, 3));
- endpoint_index_map.push_back(CreateEndpointIndex(F.rva, 4));
- // G is duplicated so 2 ranges map back to it, hence the skip from 5 to 7.
- endpoint_index_map.push_back(CreateEndpointIndex(G.rva, 5));
- // H is split so we expect 2 endpoints to show up attributed to it.
- endpoint_index_map.push_back(CreateEndpointIndex(H.rva, 7));
- endpoint_index_map.push_back(CreateEndpointIndex(H.rva + H1t.length, 8));
- endpoint_index_map.push_back(CreateEndpointIndex(H.end(), 9));
- EXPECT_THAT(endpoint_index_map,
- testing::ContainerEq(image_map.endpoint_index_map));
-}
-
-namespace {
-
-class MapAddressRangeTest : public BuildImageMapTest {
- public:
- typedef BuildImageMapTest Super;
- virtual void SetUp() {
- Super::SetUp();
- InitOmapData();
- BuildImageMap(omap_data, &image_map);
- }
-
- ImageMap image_map;
-
- private:
- using BuildImageMapTest::InitOmapData;
- using BuildImageMapTest::omap_data;
-};
-
-} // namespace
-
-TEST_F(MapAddressRangeTest, EmptyImageMapReturnsIdentity) {
- ImageMap im;
- AddressRangeVector mapped_ranges;
- AddressRange ar(0, 1024);
- MapAddressRange(im, ar, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
- EXPECT_EQ(ar, mapped_ranges[0]);
-}
-
-TEST_F(MapAddressRangeTest, MapOutOfImage) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, AddressRange(H.end() + 10, 10), &mapped_ranges);
- EXPECT_EQ(0u, mapped_ranges.size());
-}
-
-TEST_F(MapAddressRangeTest, MapIdentity) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, B, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(B));
-}
-
-TEST_F(MapAddressRangeTest, MapReorderedContiguous) {
- AddressRangeVector mapped_ranges;
-
- AddressRange DEF(D.rva, F.end() - D.rva);
- MapAddressRange(image_map, DEF, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
-
- AddressRange DFEt(Dt.rva, Et.end() - Dt.rva);
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(DFEt));
-}
-
-TEST_F(MapAddressRangeTest, MapEmptySingle) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, AddressRange(D.rva, 0), &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(AddressRange(Dt.rva, 0)));
-}
-
-TEST_F(MapAddressRangeTest, MapEmptyCopied) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, AddressRange(G.rva, 0), &mapped_ranges);
- EXPECT_EQ(2u, mapped_ranges.size());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(AddressRange(G1t.rva, 0),
- AddressRange(G2t.rva, 0)));
-}
-
-TEST_F(MapAddressRangeTest, MapCopiedContiguous) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, G, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(
- AddressRange(G1t.rva, G2t.end() - G1t.rva)));
-}
-
-TEST_F(MapAddressRangeTest, MapSplitDiscontiguous) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, H, &mapped_ranges);
- EXPECT_EQ(2u, mapped_ranges.size());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(H1t, H2t));
-}
-
-TEST_F(MapAddressRangeTest, MapInjected) {
- AddressRangeVector mapped_ranges;
-
- AddressRange EFGH(E.rva, H.end() - E.rva);
- MapAddressRange(image_map, EFGH, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
-
- AddressRange FEHGGHt(Ft.rva, H2t.end() - Ft.rva);
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(FEHGGHt));
-}
-
-TEST_F(MapAddressRangeTest, MapRemovedEntirely) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, C, &mapped_ranges);
- EXPECT_EQ(0u, mapped_ranges.size());
-}
-
-TEST_F(MapAddressRangeTest, MapRemovedPartly) {
- AddressRangeVector mapped_ranges;
- MapAddressRange(image_map, D, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(Dt));
-}
-
-TEST_F(MapAddressRangeTest, MapFull) {
- AddressRangeVector mapped_ranges;
-
- AddressRange AH(0, H.end());
- MapAddressRange(image_map, AH, &mapped_ranges);
- EXPECT_EQ(1u, mapped_ranges.size());
-
- AddressRange AHt(0, H2t.end());
- EXPECT_THAT(mapped_ranges, testing::ElementsAre(AHt));
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.cc
deleted file mode 100644
index 01f4ce3b75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.cc
+++ /dev/null
@@ -1,1369 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "common/windows/pdb_source_line_writer.h"
-
-#include <windows.h>
-#include <winnt.h>
-#include <atlbase.h>
-#include <dia2.h>
-#include <diacreate.h>
-#include <ImageHlp.h>
-#include <stdio.h>
-
-#include <limits>
-#include <set>
-
-#include "common/windows/dia_util.h"
-#include "common/windows/guid_string.h"
-#include "common/windows/string_utils-inl.h"
-
-// This constant may be missing from DbgHelp.h. See the documentation for
-// IDiaSymbol::get_undecoratedNameEx.
-#ifndef UNDNAME_NO_ECSU
-#define UNDNAME_NO_ECSU 0x8000 // Suppresses enum/class/struct/union.
-#endif // UNDNAME_NO_ECSU
-
-/*
- * Not defined in WinNT.h for some reason. Definitions taken from:
- * http://uninformed.org/index.cgi?v=4&a=1&p=13
- *
- */
-typedef unsigned char UBYTE;
-
-#if !defined(_WIN64)
-#define UNW_FLAG_EHANDLER 0x01
-#define UNW_FLAG_UHANDLER 0x02
-#define UNW_FLAG_CHAININFO 0x04
-#endif
-
-union UnwindCode {
- struct {
- UBYTE offset_in_prolog;
- UBYTE unwind_operation_code : 4;
- UBYTE operation_info : 4;
- };
- USHORT frame_offset;
-};
-
-enum UnwindOperationCodes {
- UWOP_PUSH_NONVOL = 0, /* info == register number */
- UWOP_ALLOC_LARGE, /* no info, alloc size in next 2 slots */
- UWOP_ALLOC_SMALL, /* info == size of allocation / 8 - 1 */
- UWOP_SET_FPREG, /* no info, FP = RSP + UNWIND_INFO.FPRegOffset*16 */
- UWOP_SAVE_NONVOL, /* info == register number, offset in next slot */
- UWOP_SAVE_NONVOL_FAR, /* info == register number, offset in next 2 slots */
- // XXX: these are missing from MSDN!
- // See: http://www.osronline.com/ddkx/kmarch/64bitamd_4rs7.htm
- UWOP_SAVE_XMM,
- UWOP_SAVE_XMM_FAR,
- UWOP_SAVE_XMM128, /* info == XMM reg number, offset in next slot */
- UWOP_SAVE_XMM128_FAR, /* info == XMM reg number, offset in next 2 slots */
- UWOP_PUSH_MACHFRAME /* info == 0: no error-code, 1: error-code */
-};
-
-// See: http://msdn.microsoft.com/en-us/library/ddssxxy8.aspx
-// Note: some fields removed as we don't use them.
-struct UnwindInfo {
- UBYTE version : 3;
- UBYTE flags : 5;
- UBYTE size_of_prolog;
- UBYTE count_of_codes;
- UBYTE frame_register : 4;
- UBYTE frame_offset : 4;
- UnwindCode unwind_code[1];
-};
-
-namespace google_breakpad {
-
-namespace {
-
-using std::vector;
-
-// A helper class to scope a PLOADED_IMAGE.
-class AutoImage {
- public:
- explicit AutoImage(PLOADED_IMAGE img) : img_(img) {}
- ~AutoImage() {
- if (img_)
- ImageUnload(img_);
- }
-
- operator PLOADED_IMAGE() { return img_; }
- PLOADED_IMAGE operator->() { return img_; }
-
- private:
- PLOADED_IMAGE img_;
-};
-
-bool CreateDiaDataSourceInstance(CComPtr<IDiaDataSource> &data_source) {
- if (SUCCEEDED(data_source.CoCreateInstance(CLSID_DiaSource))) {
- return true;
- }
-
- class DECLSPEC_UUID("B86AE24D-BF2F-4ac9-B5A2-34B14E4CE11D") DiaSource100;
- class DECLSPEC_UUID("761D3BCD-1304-41D5-94E8-EAC54E4AC172") DiaSource110;
- class DECLSPEC_UUID("3BFCEA48-620F-4B6B-81F7-B9AF75454C7D") DiaSource120;
- class DECLSPEC_UUID("E6756135-1E65-4D17-8576-610761398C3C") DiaSource140;
-
- // If the CoCreateInstance call above failed, msdia*.dll is not registered.
- // We can try loading the DLL corresponding to the #included DIA SDK, but
- // the DIA headers don't provide a version. Lets try to figure out which DIA
- // version we're compiling against by comparing CLSIDs.
- const wchar_t *msdia_dll = nullptr;
- if (CLSID_DiaSource == _uuidof(DiaSource100)) {
- msdia_dll = L"msdia100.dll";
- } else if (CLSID_DiaSource == _uuidof(DiaSource110)) {
- msdia_dll = L"msdia110.dll";
- } else if (CLSID_DiaSource == _uuidof(DiaSource120)) {
- msdia_dll = L"msdia120.dll";
- } else if (CLSID_DiaSource == _uuidof(DiaSource140)) {
- msdia_dll = L"msdia140.dll";
- }
-
- if (msdia_dll &&
- SUCCEEDED(NoRegCoCreate(msdia_dll, CLSID_DiaSource, IID_IDiaDataSource,
- reinterpret_cast<void **>(&data_source)))) {
- return true;
- }
-
- return false;
-}
-
-} // namespace
-
-PDBSourceLineWriter::PDBSourceLineWriter() : output_(NULL) {
-}
-
-PDBSourceLineWriter::~PDBSourceLineWriter() {
-}
-
-bool PDBSourceLineWriter::SetCodeFile(const wstring &exe_file) {
- if (code_file_.empty()) {
- code_file_ = exe_file;
- return true;
- }
- // Setting a different code file path is an error. It is success only if the
- // file paths are the same.
- return exe_file == code_file_;
-}
-
-bool PDBSourceLineWriter::Open(const wstring &file, FileFormat format) {
- Close();
- code_file_.clear();
-
- if (FAILED(CoInitialize(NULL))) {
- fprintf(stderr, "CoInitialize failed\n");
- return false;
- }
-
- CComPtr<IDiaDataSource> data_source;
- if (!CreateDiaDataSourceInstance(data_source)) {
- const int kGuidSize = 64;
- wchar_t classid[kGuidSize] = {0};
- StringFromGUID2(CLSID_DiaSource, classid, kGuidSize);
- fprintf(stderr, "CoCreateInstance CLSID_DiaSource %S failed "
- "(msdia*.dll unregistered?)\n", classid);
- return false;
- }
-
- switch (format) {
- case PDB_FILE:
- if (FAILED(data_source->loadDataFromPdb(file.c_str()))) {
- fprintf(stderr, "loadDataFromPdb failed for %ws\n", file.c_str());
- return false;
- }
- break;
- case EXE_FILE:
- if (FAILED(data_source->loadDataForExe(file.c_str(), NULL, NULL))) {
- fprintf(stderr, "loadDataForExe failed for %ws\n", file.c_str());
- return false;
- }
- code_file_ = file;
- break;
- case ANY_FILE:
- if (FAILED(data_source->loadDataFromPdb(file.c_str()))) {
- if (FAILED(data_source->loadDataForExe(file.c_str(), NULL, NULL))) {
- fprintf(stderr, "loadDataForPdb and loadDataFromExe failed for %ws\n",
- file.c_str());
- return false;
- }
- code_file_ = file;
- }
- break;
- default:
- fprintf(stderr, "Unknown file format\n");
- return false;
- }
-
- if (FAILED(data_source->openSession(&session_))) {
- fprintf(stderr, "openSession failed\n");
- }
-
- return true;
-}
-
-bool PDBSourceLineWriter::PrintLines(IDiaEnumLineNumbers *lines) {
- // The line number format is:
- // <rva> <line number> <source file id>
- CComPtr<IDiaLineNumber> line;
- ULONG count;
-
- while (SUCCEEDED(lines->Next(1, &line, &count)) && count == 1) {
- DWORD rva;
- if (FAILED(line->get_relativeVirtualAddress(&rva))) {
- fprintf(stderr, "failed to get line rva\n");
- return false;
- }
-
- DWORD length;
- if (FAILED(line->get_length(&length))) {
- fprintf(stderr, "failed to get line code length\n");
- return false;
- }
-
- DWORD dia_source_id;
- if (FAILED(line->get_sourceFileId(&dia_source_id))) {
- fprintf(stderr, "failed to get line source file id\n");
- return false;
- }
- // duplicate file names are coalesced to share one ID
- DWORD source_id = GetRealFileID(dia_source_id);
-
- DWORD line_num;
- if (FAILED(line->get_lineNumber(&line_num))) {
- fprintf(stderr, "failed to get line number\n");
- return false;
- }
-
- AddressRangeVector ranges;
- MapAddressRange(image_map_, AddressRange(rva, length), &ranges);
- for (size_t i = 0; i < ranges.size(); ++i) {
- fprintf(output_, "%x %x %d %d\n", ranges[i].rva, ranges[i].length,
- line_num, source_id);
- }
- line.Release();
- }
- return true;
-}
-
-bool PDBSourceLineWriter::PrintFunction(IDiaSymbol *function,
- IDiaSymbol *block) {
- // The function format is:
- // FUNC <address> <length> <param_stack_size> <function>
- DWORD rva;
- if (FAILED(block->get_relativeVirtualAddress(&rva))) {
- fprintf(stderr, "couldn't get rva\n");
- return false;
- }
-
- ULONGLONG length;
- if (FAILED(block->get_length(&length))) {
- fprintf(stderr, "failed to get function length\n");
- return false;
- }
-
- if (length == 0) {
- // Silently ignore zero-length functions, which can infrequently pop up.
- return true;
- }
-
- CComBSTR name;
- int stack_param_size;
- if (!GetSymbolFunctionName(function, &name, &stack_param_size)) {
- return false;
- }
-
- // If the decorated name didn't give the parameter size, try to
- // calculate it.
- if (stack_param_size < 0) {
- stack_param_size = GetFunctionStackParamSize(function);
- }
-
- AddressRangeVector ranges;
- MapAddressRange(image_map_, AddressRange(rva, static_cast<DWORD>(length)),
- &ranges);
- for (size_t i = 0; i < ranges.size(); ++i) {
- fprintf(output_, "FUNC %x %x %x %ws\n",
- ranges[i].rva, ranges[i].length, stack_param_size,
- name.m_str);
- }
-
- CComPtr<IDiaEnumLineNumbers> lines;
- if (FAILED(session_->findLinesByRVA(rva, DWORD(length), &lines))) {
- return false;
- }
-
- if (!PrintLines(lines)) {
- return false;
- }
- return true;
-}
-
-bool PDBSourceLineWriter::PrintSourceFiles() {
- CComPtr<IDiaSymbol> global;
- if (FAILED(session_->get_globalScope(&global))) {
- fprintf(stderr, "get_globalScope failed\n");
- return false;
- }
-
- CComPtr<IDiaEnumSymbols> compilands;
- if (FAILED(global->findChildren(SymTagCompiland, NULL,
- nsNone, &compilands))) {
- fprintf(stderr, "findChildren failed\n");
- return false;
- }
-
- CComPtr<IDiaSymbol> compiland;
- ULONG count;
- while (SUCCEEDED(compilands->Next(1, &compiland, &count)) && count == 1) {
- CComPtr<IDiaEnumSourceFiles> source_files;
- if (FAILED(session_->findFile(compiland, NULL, nsNone, &source_files))) {
- return false;
- }
- CComPtr<IDiaSourceFile> file;
- while (SUCCEEDED(source_files->Next(1, &file, &count)) && count == 1) {
- DWORD file_id;
- if (FAILED(file->get_uniqueId(&file_id))) {
- return false;
- }
-
- CComBSTR file_name;
- if (FAILED(file->get_fileName(&file_name))) {
- return false;
- }
-
- wstring file_name_string(file_name);
- if (!FileIDIsCached(file_name_string)) {
- // this is a new file name, cache it and output a FILE line.
- CacheFileID(file_name_string, file_id);
- fwprintf(output_, L"FILE %d %ws\n", file_id, file_name_string.c_str());
- } else {
- // this file name has already been seen, just save this
- // ID for later lookup.
- StoreDuplicateFileID(file_name_string, file_id);
- }
- file.Release();
- }
- compiland.Release();
- }
- return true;
-}
-
-bool PDBSourceLineWriter::PrintFunctions() {
- ULONG count = 0;
- DWORD rva = 0;
- CComPtr<IDiaSymbol> global;
- HRESULT hr;
-
- if (FAILED(session_->get_globalScope(&global))) {
- fprintf(stderr, "get_globalScope failed\n");
- return false;
- }
-
- CComPtr<IDiaEnumSymbols> symbols = NULL;
-
- // Find all function symbols first.
- std::set<DWORD> rvas;
- hr = global->findChildren(SymTagFunction, NULL, nsNone, &symbols);
-
- if (SUCCEEDED(hr)) {
- CComPtr<IDiaSymbol> symbol = NULL;
-
- while (SUCCEEDED(symbols->Next(1, &symbol, &count)) && count == 1) {
- if (SUCCEEDED(symbol->get_relativeVirtualAddress(&rva))) {
- // To maintain existing behavior of one symbol per address, place the
- // rva onto a set here to uniquify them.
- rvas.insert(rva);
- } else {
- fprintf(stderr, "get_relativeVirtualAddress failed on the symbol\n");
- return false;
- }
-
- symbol.Release();
- }
-
- symbols.Release();
- }
-
- // Find all public symbols. Store public symbols that are not also private
- // symbols for later.
- std::set<DWORD> public_only_rvas;
- hr = global->findChildren(SymTagPublicSymbol, NULL, nsNone, &symbols);
-
- if (SUCCEEDED(hr)) {
- CComPtr<IDiaSymbol> symbol = NULL;
-
- while (SUCCEEDED(symbols->Next(1, &symbol, &count)) && count == 1) {
- if (SUCCEEDED(symbol->get_relativeVirtualAddress(&rva))) {
- if (rvas.count(rva) == 0) {
- rvas.insert(rva); // Keep symbols in rva order.
- public_only_rvas.insert(rva);
- }
- } else {
- fprintf(stderr, "get_relativeVirtualAddress failed on the symbol\n");
- return false;
- }
-
- symbol.Release();
- }
-
- symbols.Release();
- }
-
- std::set<DWORD>::iterator it;
-
- // For each rva, dump the first symbol DIA knows about at the address.
- for (it = rvas.begin(); it != rvas.end(); ++it) {
- CComPtr<IDiaSymbol> symbol = NULL;
- // If the symbol is not in the public list, look for SymTagFunction. This is
- // a workaround to a bug where DIA will hang if searching for a private
- // symbol at an address where only a public symbol exists.
- // See http://connect.microsoft.com/VisualStudio/feedback/details/722366
- if (public_only_rvas.count(*it) == 0) {
- if (SUCCEEDED(session_->findSymbolByRVA(*it, SymTagFunction, &symbol))) {
- // Sometimes findSymbolByRVA returns S_OK, but NULL.
- if (symbol) {
- if (!PrintFunction(symbol, symbol))
- return false;
- symbol.Release();
- }
- } else {
- fprintf(stderr, "findSymbolByRVA SymTagFunction failed\n");
- return false;
- }
- } else if (SUCCEEDED(session_->findSymbolByRVA(*it,
- SymTagPublicSymbol,
- &symbol))) {
- // Sometimes findSymbolByRVA returns S_OK, but NULL.
- if (symbol) {
- if (!PrintCodePublicSymbol(symbol))
- return false;
- symbol.Release();
- }
- } else {
- fprintf(stderr, "findSymbolByRVA SymTagPublicSymbol failed\n");
- return false;
- }
- }
-
- // When building with PGO, the compiler can split functions into
- // "hot" and "cold" blocks, and move the "cold" blocks out to separate
- // pages, so the function can be noncontiguous. To find these blocks,
- // we have to iterate over all the compilands, and then find blocks
- // that are children of them. We can then find the lexical parents
- // of those blocks and print out an extra FUNC line for blocks
- // that are not contained in their parent functions.
- CComPtr<IDiaEnumSymbols> compilands;
- if (FAILED(global->findChildren(SymTagCompiland, NULL,
- nsNone, &compilands))) {
- fprintf(stderr, "findChildren failed on the global\n");
- return false;
- }
-
- CComPtr<IDiaSymbol> compiland;
- while (SUCCEEDED(compilands->Next(1, &compiland, &count)) && count == 1) {
- CComPtr<IDiaEnumSymbols> blocks;
- if (FAILED(compiland->findChildren(SymTagBlock, NULL,
- nsNone, &blocks))) {
- fprintf(stderr, "findChildren failed on a compiland\n");
- return false;
- }
-
- CComPtr<IDiaSymbol> block;
- while (SUCCEEDED(blocks->Next(1, &block, &count)) && count == 1) {
- // find this block's lexical parent function
- CComPtr<IDiaSymbol> parent;
- DWORD tag;
- if (SUCCEEDED(block->get_lexicalParent(&parent)) &&
- SUCCEEDED(parent->get_symTag(&tag)) &&
- tag == SymTagFunction) {
- // now get the block's offset and the function's offset and size,
- // and determine if the block is outside of the function
- DWORD func_rva, block_rva;
- ULONGLONG func_length;
- if (SUCCEEDED(block->get_relativeVirtualAddress(&block_rva)) &&
- SUCCEEDED(parent->get_relativeVirtualAddress(&func_rva)) &&
- SUCCEEDED(parent->get_length(&func_length))) {
- if (block_rva < func_rva || block_rva > (func_rva + func_length)) {
- if (!PrintFunction(parent, block)) {
- return false;
- }
- }
- }
- }
- parent.Release();
- block.Release();
- }
- blocks.Release();
- compiland.Release();
- }
-
- global.Release();
- return true;
-}
-
-#undef max
-
-bool PDBSourceLineWriter::PrintFrameDataUsingPDB() {
- // It would be nice if it were possible to output frame data alongside the
- // associated function, as is done with line numbers, but the DIA API
- // doesn't make it possible to get the frame data in that way.
-
- CComPtr<IDiaEnumFrameData> frame_data_enum;
- if (!FindTable(session_, &frame_data_enum))
- return false;
-
- DWORD last_type = std::numeric_limits<DWORD>::max();
- DWORD last_rva = std::numeric_limits<DWORD>::max();
- DWORD last_code_size = 0;
- DWORD last_prolog_size = std::numeric_limits<DWORD>::max();
-
- CComPtr<IDiaFrameData> frame_data;
- ULONG count = 0;
- while (SUCCEEDED(frame_data_enum->Next(1, &frame_data, &count)) &&
- count == 1) {
- DWORD type;
- if (FAILED(frame_data->get_type(&type)))
- return false;
-
- DWORD rva;
- if (FAILED(frame_data->get_relativeVirtualAddress(&rva)))
- return false;
-
- DWORD code_size;
- if (FAILED(frame_data->get_lengthBlock(&code_size)))
- return false;
-
- DWORD prolog_size;
- if (FAILED(frame_data->get_lengthProlog(&prolog_size)))
- return false;
-
- // parameter_size is the size of parameters passed on the stack. If any
- // parameters are not passed on the stack (such as in registers), their
- // sizes will not be included in parameter_size.
- DWORD parameter_size;
- if (FAILED(frame_data->get_lengthParams(&parameter_size)))
- return false;
-
- DWORD saved_register_size;
- if (FAILED(frame_data->get_lengthSavedRegisters(&saved_register_size)))
- return false;
-
- DWORD local_size;
- if (FAILED(frame_data->get_lengthLocals(&local_size)))
- return false;
-
- // get_maxStack can return S_FALSE, just use 0 in that case.
- DWORD max_stack_size = 0;
- if (FAILED(frame_data->get_maxStack(&max_stack_size)))
- return false;
-
- // get_programString can return S_FALSE, indicating that there is no
- // program string. In that case, check whether %ebp is used.
- HRESULT program_string_result;
- CComBSTR program_string;
- if (FAILED(program_string_result = frame_data->get_program(
- &program_string))) {
- return false;
- }
-
- // get_allocatesBasePointer can return S_FALSE, treat that as though
- // %ebp is not used.
- BOOL allocates_base_pointer = FALSE;
- if (program_string_result != S_OK) {
- if (FAILED(frame_data->get_allocatesBasePointer(
- &allocates_base_pointer))) {
- return false;
- }
- }
-
- // Only print out a line if type, rva, code_size, or prolog_size have
- // changed from the last line. It is surprisingly common (especially in
- // system library PDBs) for DIA to return a series of identical
- // IDiaFrameData objects. For kernel32.pdb from Windows XP SP2 on x86,
- // this check reduces the size of the dumped symbol file by a third.
- if (type != last_type || rva != last_rva || code_size != last_code_size ||
- prolog_size != last_prolog_size) {
- // The prolog and the code portions of the frame have to be treated
- // independently as they may have independently changed in size, or may
- // even have been split.
- // NOTE: If epilog size is ever non-zero, we have to do something
- // similar with it.
-
- // Figure out where the prolog bytes have landed.
- AddressRangeVector prolog_ranges;
- if (prolog_size > 0) {
- MapAddressRange(image_map_, AddressRange(rva, prolog_size),
- &prolog_ranges);
- }
-
- // And figure out where the code bytes have landed.
- AddressRangeVector code_ranges;
- MapAddressRange(image_map_,
- AddressRange(rva + prolog_size,
- code_size - prolog_size),
- &code_ranges);
-
- struct FrameInfo {
- DWORD rva;
- DWORD code_size;
- DWORD prolog_size;
- };
- std::vector<FrameInfo> frame_infos;
-
- // Special case: The prolog and the code bytes remain contiguous. This is
- // only done for compactness of the symbol file, and we could actually
- // be outputting independent frame info for the prolog and code portions.
- if (prolog_ranges.size() == 1 && code_ranges.size() == 1 &&
- prolog_ranges[0].end() == code_ranges[0].rva) {
- FrameInfo fi = { prolog_ranges[0].rva,
- prolog_ranges[0].length + code_ranges[0].length,
- prolog_ranges[0].length };
- frame_infos.push_back(fi);
- } else {
- // Otherwise we output the prolog and code frame info independently.
- for (size_t i = 0; i < prolog_ranges.size(); ++i) {
- FrameInfo fi = { prolog_ranges[i].rva,
- prolog_ranges[i].length,
- prolog_ranges[i].length };
- frame_infos.push_back(fi);
- }
- for (size_t i = 0; i < code_ranges.size(); ++i) {
- FrameInfo fi = { code_ranges[i].rva, code_ranges[i].length, 0 };
- frame_infos.push_back(fi);
- }
- }
-
- for (size_t i = 0; i < frame_infos.size(); ++i) {
- const FrameInfo& fi(frame_infos[i]);
- fprintf(output_, "STACK WIN %x %x %x %x %x %x %x %x %x %d ",
- type, fi.rva, fi.code_size, fi.prolog_size,
- 0 /* epilog_size */, parameter_size, saved_register_size,
- local_size, max_stack_size, program_string_result == S_OK);
- if (program_string_result == S_OK) {
- fprintf(output_, "%ws\n", program_string.m_str);
- } else {
- fprintf(output_, "%d\n", allocates_base_pointer);
- }
- }
-
- last_type = type;
- last_rva = rva;
- last_code_size = code_size;
- last_prolog_size = prolog_size;
- }
-
- frame_data.Release();
- }
-
- return true;
-}
-
-bool PDBSourceLineWriter::PrintFrameDataUsingEXE() {
- if (code_file_.empty() && !FindPEFile()) {
- fprintf(stderr, "Couldn't locate EXE or DLL file.\n");
- return false;
- }
-
- // Convert wchar to native charset because ImageLoad only takes
- // a PSTR as input.
- string code_file;
- if (!WindowsStringUtils::safe_wcstombs(code_file_, &code_file)) {
- return false;
- }
-
- AutoImage img(ImageLoad((PSTR)code_file.c_str(), NULL));
- if (!img) {
- fprintf(stderr, "Failed to load %s\n", code_file.c_str());
- return false;
- }
- PIMAGE_OPTIONAL_HEADER64 optional_header =
- &(reinterpret_cast<PIMAGE_NT_HEADERS64>(img->FileHeader))->OptionalHeader;
- if (optional_header->Magic != IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- fprintf(stderr, "Not a PE32+ image\n");
- return false;
- }
-
- // Read Exception Directory
- DWORD exception_rva = optional_header->
- DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].VirtualAddress;
- DWORD exception_size = optional_header->
- DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION].Size;
- PIMAGE_RUNTIME_FUNCTION_ENTRY funcs =
- static_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- exception_rva,
- &img->LastRvaSection));
- for (DWORD i = 0; i < exception_size / sizeof(*funcs); i++) {
- DWORD unwind_rva = funcs[i].UnwindInfoAddress;
- // handle chaining
- while (unwind_rva & 0x1) {
- unwind_rva ^= 0x1;
- PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func =
- static_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- unwind_rva,
- &img->LastRvaSection));
- unwind_rva = chained_func->UnwindInfoAddress;
- }
-
- UnwindInfo *unwind_info = static_cast<UnwindInfo *>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- unwind_rva,
- &img->LastRvaSection));
-
- DWORD stack_size = 8; // minimal stack size is 8 for RIP
- DWORD rip_offset = 8;
- do {
- for (UBYTE c = 0; c < unwind_info->count_of_codes; c++) {
- UnwindCode *unwind_code = &unwind_info->unwind_code[c];
- switch (unwind_code->unwind_operation_code) {
- case UWOP_PUSH_NONVOL: {
- stack_size += 8;
- break;
- }
- case UWOP_ALLOC_LARGE: {
- if (unwind_code->operation_info == 0) {
- c++;
- if (c < unwind_info->count_of_codes)
- stack_size += (unwind_code + 1)->frame_offset * 8;
- } else {
- c += 2;
- if (c < unwind_info->count_of_codes)
- stack_size += (unwind_code + 1)->frame_offset |
- ((unwind_code + 2)->frame_offset << 16);
- }
- break;
- }
- case UWOP_ALLOC_SMALL: {
- stack_size += unwind_code->operation_info * 8 + 8;
- break;
- }
- case UWOP_SET_FPREG:
- case UWOP_SAVE_XMM:
- case UWOP_SAVE_XMM_FAR:
- break;
- case UWOP_SAVE_NONVOL:
- case UWOP_SAVE_XMM128: {
- c++; // skip slot with offset
- break;
- }
- case UWOP_SAVE_NONVOL_FAR:
- case UWOP_SAVE_XMM128_FAR: {
- c += 2; // skip 2 slots with offset
- break;
- }
- case UWOP_PUSH_MACHFRAME: {
- if (unwind_code->operation_info) {
- stack_size += 88;
- } else {
- stack_size += 80;
- }
- rip_offset += 80;
- break;
- }
- }
- }
- if (unwind_info->flags & UNW_FLAG_CHAININFO) {
- PIMAGE_RUNTIME_FUNCTION_ENTRY chained_func =
- reinterpret_cast<PIMAGE_RUNTIME_FUNCTION_ENTRY>(
- (unwind_info->unwind_code +
- ((unwind_info->count_of_codes + 1) & ~1)));
-
- unwind_info = static_cast<UnwindInfo *>(
- ImageRvaToVa(img->FileHeader,
- img->MappedAddress,
- chained_func->UnwindInfoAddress,
- &img->LastRvaSection));
- } else {
- unwind_info = NULL;
- }
- } while (unwind_info);
- fprintf(output_, "STACK CFI INIT %x %x .cfa: $rsp .ra: .cfa %d - ^\n",
- funcs[i].BeginAddress,
- funcs[i].EndAddress - funcs[i].BeginAddress, rip_offset);
- fprintf(output_, "STACK CFI %x .cfa: $rsp %d +\n",
- funcs[i].BeginAddress, stack_size);
- }
-
- return true;
-}
-
-bool PDBSourceLineWriter::PrintFrameData() {
- PDBModuleInfo info;
- if (GetModuleInfo(&info) && info.cpu == L"x86_64") {
- return PrintFrameDataUsingEXE();
- } else {
- return PrintFrameDataUsingPDB();
- }
- return false;
-}
-
-bool PDBSourceLineWriter::PrintCodePublicSymbol(IDiaSymbol *symbol) {
- BOOL is_code;
- if (FAILED(symbol->get_code(&is_code))) {
- return false;
- }
- if (!is_code) {
- return true;
- }
-
- DWORD rva;
- if (FAILED(symbol->get_relativeVirtualAddress(&rva))) {
- return false;
- }
-
- CComBSTR name;
- int stack_param_size;
- if (!GetSymbolFunctionName(symbol, &name, &stack_param_size)) {
- return false;
- }
-
- AddressRangeVector ranges;
- MapAddressRange(image_map_, AddressRange(rva, 1), &ranges);
- for (size_t i = 0; i < ranges.size(); ++i) {
- fprintf(output_, "PUBLIC %x %x %ws\n", ranges[i].rva,
- stack_param_size > 0 ? stack_param_size : 0,
- name.m_str);
- }
- return true;
-}
-
-bool PDBSourceLineWriter::PrintPDBInfo() {
- PDBModuleInfo info;
- if (!GetModuleInfo(&info)) {
- return false;
- }
-
- // Hard-code "windows" for the OS because that's the only thing that makes
- // sense for PDB files. (This might not be strictly correct for Windows CE
- // support, but we don't care about that at the moment.)
- fprintf(output_, "MODULE windows %ws %ws %ws\n",
- info.cpu.c_str(), info.debug_identifier.c_str(),
- info.debug_file.c_str());
-
- return true;
-}
-
-bool PDBSourceLineWriter::PrintPEInfo() {
- PEModuleInfo info;
- if (!GetPEInfo(&info)) {
- return false;
- }
-
- fprintf(output_, "INFO CODE_ID %ws %ws\n",
- info.code_identifier.c_str(),
- info.code_file.c_str());
- return true;
-}
-
-// wcstol_positive_strict is sort of like wcstol, but much stricter. string
-// should be a buffer pointing to a null-terminated string containing only
-// decimal digits. If the entire string can be converted to an integer
-// without overflowing, and there are no non-digit characters before the
-// result is set to the value and this function returns true. Otherwise,
-// this function returns false. This is an alternative to the strtol, atoi,
-// and scanf families, which are not as strict about input and in some cases
-// don't provide a good way for the caller to determine if a conversion was
-// successful.
-static bool wcstol_positive_strict(wchar_t *string, int *result) {
- int value = 0;
- for (wchar_t *c = string; *c != '\0'; ++c) {
- int last_value = value;
- value *= 10;
- // Detect overflow.
- if (value / 10 != last_value || value < 0) {
- return false;
- }
- if (*c < '0' || *c > '9') {
- return false;
- }
- unsigned int c_value = *c - '0';
- last_value = value;
- value += c_value;
- // Detect overflow.
- if (value < last_value) {
- return false;
- }
- // Forbid leading zeroes unless the string is just "0".
- if (value == 0 && *(c+1) != '\0') {
- return false;
- }
- }
- *result = value;
- return true;
-}
-
-bool PDBSourceLineWriter::FindPEFile() {
- CComPtr<IDiaSymbol> global;
- if (FAILED(session_->get_globalScope(&global))) {
- fprintf(stderr, "get_globalScope failed\n");
- return false;
- }
-
- CComBSTR symbols_file;
- if (SUCCEEDED(global->get_symbolsFileName(&symbols_file))) {
- wstring file(symbols_file);
-
- // Look for an EXE or DLL file.
- const wchar_t *extensions[] = { L"exe", L"dll" };
- for (int i = 0; i < sizeof(extensions) / sizeof(extensions[0]); i++) {
- size_t dot_pos = file.find_last_of(L".");
- if (dot_pos != wstring::npos) {
- file.replace(dot_pos + 1, wstring::npos, extensions[i]);
- // Check if this file exists.
- if (GetFileAttributesW(file.c_str()) != INVALID_FILE_ATTRIBUTES) {
- code_file_ = file;
- return true;
- }
- }
- }
- }
-
- return false;
-}
-
-// static
-bool PDBSourceLineWriter::GetSymbolFunctionName(IDiaSymbol *function,
- BSTR *name,
- int *stack_param_size) {
- *stack_param_size = -1;
- const DWORD undecorate_options = UNDNAME_NO_MS_KEYWORDS |
- UNDNAME_NO_FUNCTION_RETURNS |
- UNDNAME_NO_ALLOCATION_MODEL |
- UNDNAME_NO_ALLOCATION_LANGUAGE |
- UNDNAME_NO_THISTYPE |
- UNDNAME_NO_ACCESS_SPECIFIERS |
- UNDNAME_NO_THROW_SIGNATURES |
- UNDNAME_NO_MEMBER_TYPE |
- UNDNAME_NO_RETURN_UDT_MODEL |
- UNDNAME_NO_ECSU;
-
- // Use get_undecoratedNameEx to get readable C++ names with arguments.
- if (function->get_undecoratedNameEx(undecorate_options, name) != S_OK) {
- if (function->get_name(name) != S_OK) {
- fprintf(stderr, "failed to get function name\n");
- return false;
- }
-
- // It's possible for get_name to return an empty string, so
- // special-case that.
- if (wcscmp(*name, L"") == 0) {
- SysFreeString(*name);
- // dwarf_cu_to_module.cc uses "<name omitted>", so match that.
- *name = SysAllocString(L"<name omitted>");
- return true;
- }
-
- // If a name comes from get_name because no undecorated form existed,
- // it's already formatted properly to be used as output. Don't do any
- // additional processing.
- //
- // MSVC7's DIA seems to not undecorate names in as many cases as MSVC8's.
- // This will result in calling get_name for some C++ symbols, so
- // all of the parameter and return type information may not be included in
- // the name string.
- } else {
- // C++ uses a bogus "void" argument for functions and methods that don't
- // take any parameters. Take it out of the undecorated name because it's
- // ugly and unnecessary.
- const wchar_t *replace_string = L"(void)";
- const size_t replace_length = wcslen(replace_string);
- const wchar_t *replacement_string = L"()";
- size_t length = wcslen(*name);
- if (length >= replace_length) {
- wchar_t *name_end = *name + length - replace_length;
- if (wcscmp(name_end, replace_string) == 0) {
- WindowsStringUtils::safe_wcscpy(name_end, replace_length,
- replacement_string);
- length = wcslen(*name);
- }
- }
-
- // Undecorate names used for stdcall and fastcall. These names prefix
- // the identifier with '_' (stdcall) or '@' (fastcall) and suffix it
- // with '@' followed by the number of bytes of parameters, in decimal.
- // If such a name is found, take note of the size and undecorate it.
- // Only do this for names that aren't C++, which is determined based on
- // whether the undecorated name contains any ':' or '(' characters.
- if (!wcschr(*name, ':') && !wcschr(*name, '(') &&
- (*name[0] == '_' || *name[0] == '@')) {
- wchar_t *last_at = wcsrchr(*name + 1, '@');
- if (last_at && wcstol_positive_strict(last_at + 1, stack_param_size)) {
- // If this function adheres to the fastcall convention, it accepts up
- // to the first 8 bytes of parameters in registers (%ecx and %edx).
- // We're only interested in the stack space used for parameters, so
- // so subtract 8 and don't let the size go below 0.
- if (*name[0] == '@') {
- if (*stack_param_size > 8) {
- *stack_param_size -= 8;
- } else {
- *stack_param_size = 0;
- }
- }
-
- // Undecorate the name by moving it one character to the left in its
- // buffer, and terminating it where the last '@' had been.
- WindowsStringUtils::safe_wcsncpy(*name, length,
- *name + 1, last_at - *name - 1);
- } else if (*name[0] == '_') {
- // This symbol's name is encoded according to the cdecl rules. The
- // name doesn't end in a '@' character followed by a decimal positive
- // integer, so it's not a stdcall name. Strip off the leading
- // underscore.
- WindowsStringUtils::safe_wcsncpy(*name, length, *name + 1, length);
- }
- }
- }
-
- return true;
-}
-
-// static
-int PDBSourceLineWriter::GetFunctionStackParamSize(IDiaSymbol *function) {
- // This implementation is highly x86-specific.
-
- // Gather the symbols corresponding to data.
- CComPtr<IDiaEnumSymbols> data_children;
- if (FAILED(function->findChildren(SymTagData, NULL, nsNone,
- &data_children))) {
- return 0;
- }
-
- // lowest_base is the lowest %ebp-relative byte offset used for a parameter.
- // highest_end is one greater than the highest offset (i.e. base + length).
- // Stack parameters are assumed to be contiguous, because in reality, they
- // are.
- int lowest_base = INT_MAX;
- int highest_end = INT_MIN;
-
- CComPtr<IDiaSymbol> child;
- DWORD count;
- while (SUCCEEDED(data_children->Next(1, &child, &count)) && count == 1) {
- // If any operation fails at this point, just proceed to the next child.
- // Use the next_child label instead of continue because child needs to
- // be released before it's reused. Declare constructable/destructable
- // types early to avoid gotos that cross initializations.
- CComPtr<IDiaSymbol> child_type;
-
- // DataIsObjectPtr is only used for |this|. Because |this| can be passed
- // as a stack parameter, look for it in addition to traditional
- // parameters.
- DWORD child_kind;
- if (FAILED(child->get_dataKind(&child_kind)) ||
- (child_kind != DataIsParam && child_kind != DataIsObjectPtr)) {
- goto next_child;
- }
-
- // Only concentrate on register-relative parameters. Parameters may also
- // be enregistered (passed directly in a register), but those don't
- // consume any stack space, so they're not of interest.
- DWORD child_location_type;
- if (FAILED(child->get_locationType(&child_location_type)) ||
- child_location_type != LocIsRegRel) {
- goto next_child;
- }
-
- // Of register-relative parameters, the only ones that make any sense are
- // %ebp- or %esp-relative. Note that MSVC's debugging information always
- // gives parameters as %ebp-relative even when a function doesn't use a
- // traditional frame pointer and stack parameters are accessed relative to
- // %esp, so just look for %ebp-relative parameters. If you wanted to
- // access parameters, you'd probably want to treat these %ebp-relative
- // offsets as if they were relative to %esp before a function's prolog
- // executed.
- DWORD child_register;
- if (FAILED(child->get_registerId(&child_register)) ||
- child_register != CV_REG_EBP) {
- goto next_child;
- }
-
- LONG child_register_offset;
- if (FAILED(child->get_offset(&child_register_offset))) {
- goto next_child;
- }
-
- // IDiaSymbol::get_type can succeed but still pass back a NULL value.
- if (FAILED(child->get_type(&child_type)) || !child_type) {
- goto next_child;
- }
-
- ULONGLONG child_length;
- if (FAILED(child_type->get_length(&child_length))) {
- goto next_child;
- }
-
- int child_end = child_register_offset + static_cast<ULONG>(child_length);
- if (child_register_offset < lowest_base) {
- lowest_base = child_register_offset;
- }
- if (child_end > highest_end) {
- highest_end = child_end;
- }
-
-next_child:
- child.Release();
- }
-
- int param_size = 0;
- // Make sure lowest_base isn't less than 4, because [%esp+4] is the lowest
- // possible address to find a stack parameter before executing a function's
- // prolog (see above). Some optimizations cause parameter offsets to be
- // lower than 4, but we're not concerned with those because we're only
- // looking for parameters contained in addresses higher than where the
- // return address is stored.
- if (lowest_base < 4) {
- lowest_base = 4;
- }
- if (highest_end > lowest_base) {
- // All stack parameters are pushed as at least 4-byte quantities. If the
- // last type was narrower than 4 bytes, promote it. This assumes that all
- // parameters' offsets are 4-byte-aligned, which is always the case. Only
- // worry about the last type, because we're not summing the type sizes,
- // just looking at the lowest and highest offsets.
- int remainder = highest_end % 4;
- if (remainder) {
- highest_end += 4 - remainder;
- }
-
- param_size = highest_end - lowest_base;
- }
-
- return param_size;
-}
-
-bool PDBSourceLineWriter::WriteMap(FILE *map_file) {
- output_ = map_file;
-
- // Load the OMAP information, and disable auto-translation of addresses in
- // preference of doing it ourselves.
- OmapData omap_data;
- if (!GetOmapDataAndDisableTranslation(session_, &omap_data))
- return false;
- BuildImageMap(omap_data, &image_map_);
-
- bool ret = PrintPDBInfo();
- // This is not a critical piece of the symbol file.
- PrintPEInfo();
- ret = ret &&
- PrintSourceFiles() &&
- PrintFunctions() &&
- PrintFrameData();
-
- output_ = NULL;
- return ret;
-}
-
-void PDBSourceLineWriter::Close() {
- session_.Release();
-}
-
-bool PDBSourceLineWriter::GetModuleInfo(PDBModuleInfo *info) {
- if (!info) {
- return false;
- }
-
- info->debug_file.clear();
- info->debug_identifier.clear();
- info->cpu.clear();
-
- CComPtr<IDiaSymbol> global;
- if (FAILED(session_->get_globalScope(&global))) {
- return false;
- }
-
- DWORD machine_type;
- // get_machineType can return S_FALSE.
- if (global->get_machineType(&machine_type) == S_OK) {
- // The documentation claims that get_machineType returns a value from
- // the CV_CPU_TYPE_e enumeration, but that's not the case.
- // Instead, it returns one of the IMAGE_FILE_MACHINE values as
- // defined here:
- // http://msdn.microsoft.com/en-us/library/ms680313%28VS.85%29.aspx
- switch (machine_type) {
- case IMAGE_FILE_MACHINE_I386:
- info->cpu = L"x86";
- break;
- case IMAGE_FILE_MACHINE_AMD64:
- info->cpu = L"x86_64";
- break;
- default:
- info->cpu = L"unknown";
- break;
- }
- } else {
- // Unexpected, but handle gracefully.
- info->cpu = L"unknown";
- }
-
- // DWORD* and int* are not compatible. This is clean and avoids a cast.
- DWORD age;
- if (FAILED(global->get_age(&age))) {
- return false;
- }
-
- bool uses_guid;
- if (!UsesGUID(&uses_guid)) {
- return false;
- }
-
- if (uses_guid) {
- GUID guid;
- if (FAILED(global->get_guid(&guid))) {
- return false;
- }
-
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- wchar_t age_string[9];
- swprintf(age_string, sizeof(age_string) / sizeof(age_string[0]),
- L"%x", age);
-
- // remove when VC++7.1 is no longer supported
- age_string[sizeof(age_string) / sizeof(age_string[0]) - 1] = L'\0';
-
- info->debug_identifier = GUIDString::GUIDToSymbolServerWString(&guid);
- info->debug_identifier.append(age_string);
- } else {
- DWORD signature;
- if (FAILED(global->get_signature(&signature))) {
- return false;
- }
-
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- wchar_t identifier_string[17];
- swprintf(identifier_string,
- sizeof(identifier_string) / sizeof(identifier_string[0]),
- L"%08X%x", signature, age);
-
- // remove when VC++7.1 is no longer supported
- identifier_string[sizeof(identifier_string) /
- sizeof(identifier_string[0]) - 1] = L'\0';
-
- info->debug_identifier = identifier_string;
- }
-
- CComBSTR debug_file_string;
- if (FAILED(global->get_symbolsFileName(&debug_file_string))) {
- return false;
- }
- info->debug_file =
- WindowsStringUtils::GetBaseName(wstring(debug_file_string));
-
- return true;
-}
-
-bool PDBSourceLineWriter::GetPEInfo(PEModuleInfo *info) {
- if (!info) {
- return false;
- }
-
- if (code_file_.empty() && !FindPEFile()) {
- fprintf(stderr, "Couldn't locate EXE or DLL file.\n");
- return false;
- }
-
- // Convert wchar to native charset because ImageLoad only takes
- // a PSTR as input.
- string code_file;
- if (!WindowsStringUtils::safe_wcstombs(code_file_, &code_file)) {
- return false;
- }
-
- AutoImage img(ImageLoad((PSTR)code_file.c_str(), NULL));
- if (!img) {
- fprintf(stderr, "Failed to open PE file: %s\n", code_file.c_str());
- return false;
- }
-
- info->code_file = WindowsStringUtils::GetBaseName(code_file_);
-
- // The date and time that the file was created by the linker.
- DWORD TimeDateStamp = img->FileHeader->FileHeader.TimeDateStamp;
- // The size of the file in bytes, including all headers.
- DWORD SizeOfImage = 0;
- PIMAGE_OPTIONAL_HEADER64 opt =
- &((PIMAGE_NT_HEADERS64)img->FileHeader)->OptionalHeader;
- if (opt->Magic == IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
- // 64-bit PE file.
- SizeOfImage = opt->SizeOfImage;
- } else {
- // 32-bit PE file.
- SizeOfImage = img->FileHeader->OptionalHeader.SizeOfImage;
- }
- wchar_t code_identifier[32];
- swprintf(code_identifier,
- sizeof(code_identifier) / sizeof(code_identifier[0]),
- L"%08X%X", TimeDateStamp, SizeOfImage);
- info->code_identifier = code_identifier;
-
- return true;
-}
-
-bool PDBSourceLineWriter::UsesGUID(bool *uses_guid) {
- if (!uses_guid)
- return false;
-
- CComPtr<IDiaSymbol> global;
- if (FAILED(session_->get_globalScope(&global)))
- return false;
-
- GUID guid;
- if (FAILED(global->get_guid(&guid)))
- return false;
-
- DWORD signature;
- if (FAILED(global->get_signature(&signature)))
- return false;
-
- // There are two possibilities for guid: either it's a real 128-bit GUID
- // as identified in a code module by a new-style CodeView record, or it's
- // a 32-bit signature (timestamp) as identified by an old-style record.
- // See MDCVInfoPDB70 and MDCVInfoPDB20 in minidump_format.h.
- //
- // Because DIA doesn't provide a way to directly determine whether a module
- // uses a GUID or a 32-bit signature, this code checks whether the first 32
- // bits of guid are the same as the signature, and if the rest of guid is
- // zero. If so, then with a pretty high degree of certainty, there's an
- // old-style CodeView record in use. This method will only falsely find an
- // an old-style CodeView record if a real 128-bit GUID has its first 32
- // bits set the same as the module's signature (timestamp) and the rest of
- // the GUID is set to 0. This is highly unlikely.
-
- GUID signature_guid = {signature}; // 0-initializes other members
- *uses_guid = !IsEqualGUID(guid, signature_guid);
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.h b/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.h
deleted file mode 100644
index e9e89bb279..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/pdb_source_line_writer.h
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// PDBSourceLineWriter uses a pdb file produced by Visual C++ to output
-// a line/address map for use with BasicSourceLineResolver.
-
-#ifndef COMMON_WINDOWS_PDB_SOURCE_LINE_WRITER_H_
-#define COMMON_WINDOWS_PDB_SOURCE_LINE_WRITER_H_
-
-#include <atlcomcli.h>
-
-#include <unordered_map>
-#include <string>
-
-#include "common/windows/omap.h"
-
-struct IDiaEnumLineNumbers;
-struct IDiaSession;
-struct IDiaSymbol;
-
-namespace google_breakpad {
-
-using std::wstring;
-using std::unordered_map;
-
-// A structure that carries information that identifies a pdb file.
-struct PDBModuleInfo {
- public:
- // The basename of the pdb file from which information was loaded.
- wstring debug_file;
-
- // The pdb's identifier. For recent pdb files, the identifier consists
- // of the pdb's guid, in uppercase hexadecimal form without any dashes
- // or separators, followed immediately by the pdb's age, also in
- // uppercase hexadecimal form. For older pdb files which have no guid,
- // the identifier is the pdb's 32-bit signature value, in zero-padded
- // hexadecimal form, followed immediately by the pdb's age, in lowercase
- // hexadecimal form.
- wstring debug_identifier;
-
- // A string identifying the cpu that the pdb is associated with.
- // Currently, this may be "x86" or "unknown".
- wstring cpu;
-};
-
-// A structure that carries information that identifies a PE file,
-// either an EXE or a DLL.
-struct PEModuleInfo {
- // The basename of the PE file.
- wstring code_file;
-
- // The PE file's code identifier, which consists of its timestamp
- // and file size concatenated together into a single hex string.
- // (The fields IMAGE_OPTIONAL_HEADER::SizeOfImage and
- // IMAGE_FILE_HEADER::TimeDateStamp, as defined in the ImageHlp
- // documentation.) This is not well documented, if it's documented
- // at all, but it's what symstore does and what DbgHelp supports.
- wstring code_identifier;
-};
-
-class PDBSourceLineWriter {
- public:
- enum FileFormat {
- PDB_FILE, // a .pdb file containing debug symbols
- EXE_FILE, // a .exe or .dll file
- ANY_FILE // try PDB_FILE and then EXE_FILE
- };
-
- explicit PDBSourceLineWriter();
- ~PDBSourceLineWriter();
-
- // Opens the given file. For executable files, the corresponding pdb
- // file must be available; Open will be if it is not.
- // If there is already a pdb file open, it is automatically closed.
- // Returns true on success.
- bool Open(const wstring &file, FileFormat format);
-
- // Sets the code file full path. This is optional for 32-bit modules. It is
- // also optional for 64-bit modules when there is an executable file stored
- // in the same directory as the PDB file. It is only required for 64-bit
- // modules when the executable file is not in the same location as the PDB
- // file and it must be called after Open() and before WriteMap().
- // If Open() was called for an executable file, then it is an error to call
- // SetCodeFile() with a different file path and it will return false.
- bool SetCodeFile(const wstring &exe_file);
-
- // Writes a map file from the current pdb file to the given file stream.
- // Returns true on success.
- bool WriteMap(FILE *map_file);
-
- // Closes the current pdb file and its associated resources.
- void Close();
-
- // Retrieves information about the module's debugging file. Returns
- // true on success and false on failure.
- bool GetModuleInfo(PDBModuleInfo *info);
-
- // Retrieves information about the module's PE file. Returns
- // true on success and false on failure.
- bool GetPEInfo(PEModuleInfo *info);
-
- // Sets uses_guid to true if the opened file uses a new-style CodeView
- // record with a 128-bit GUID, or false if the opened file uses an old-style
- // CodeView record. When no GUID is available, a 32-bit signature should be
- // used to identify the module instead. If the information cannot be
- // determined, this method returns false.
- bool UsesGUID(bool *uses_guid);
-
- private:
- // Outputs the line/address pairs for each line in the enumerator.
- // Returns true on success.
- bool PrintLines(IDiaEnumLineNumbers *lines);
-
- // Outputs a function address and name, followed by its source line list.
- // block can be the same object as function, or it can be a reference
- // to a code block that is lexically part of this function, but
- // resides at a separate address.
- // Returns true on success.
- bool PrintFunction(IDiaSymbol *function, IDiaSymbol *block);
-
- // Outputs all functions as described above. Returns true on success.
- bool PrintFunctions();
-
- // Outputs all of the source files in the session's pdb file.
- // Returns true on success.
- bool PrintSourceFiles();
-
- // Outputs all of the frame information necessary to construct stack
- // backtraces in the absence of frame pointers. For x86 data stored in
- // .pdb files. Returns true on success.
- bool PrintFrameDataUsingPDB();
-
- // Outputs all of the frame information necessary to construct stack
- // backtraces in the absence of frame pointers. For x64 data stored in
- // .exe, .dll files. Returns true on success.
- bool PrintFrameDataUsingEXE();
-
- // Outputs all of the frame information necessary to construct stack
- // backtraces in the absence of frame pointers. Returns true on success.
- bool PrintFrameData();
-
- // Outputs a single public symbol address and name, if the symbol corresponds
- // to a code address. Returns true on success. If symbol is does not
- // correspond to code, returns true without outputting anything.
- bool PrintCodePublicSymbol(IDiaSymbol *symbol);
-
- // Outputs a line identifying the PDB file that is being dumped, along with
- // its uuid and age.
- bool PrintPDBInfo();
-
- // Outputs a line identifying the PE file corresponding to the PDB
- // file that is being dumped, along with its code identifier,
- // which consists of its timestamp and file size.
- bool PrintPEInfo();
-
- // Returns true if this filename has already been seen,
- // and an ID is stored for it, or false if it has not.
- bool FileIDIsCached(const wstring &file) {
- return unique_files_.find(file) != unique_files_.end();
- }
-
- // Cache this filename and ID for later reuse.
- void CacheFileID(const wstring &file, DWORD id) {
- unique_files_[file] = id;
- }
-
- // Store this ID in the cache as a duplicate for this filename.
- void StoreDuplicateFileID(const wstring &file, DWORD id) {
- unordered_map<wstring, DWORD>::iterator iter = unique_files_.find(file);
- if (iter != unique_files_.end()) {
- // map this id to the previously seen one
- file_ids_[id] = iter->second;
- }
- }
-
- // Given a file's unique ID, return the ID that should be used to
- // reference it. There may be multiple files with identical filenames
- // but different unique IDs. The cache attempts to coalesce these into
- // one ID per unique filename.
- DWORD GetRealFileID(DWORD id) {
- unordered_map<DWORD, DWORD>::iterator iter = file_ids_.find(id);
- if (iter == file_ids_.end())
- return id;
- return iter->second;
- }
-
- // Find the PE file corresponding to the loaded PDB file, and
- // set the code_file_ member. Returns false on failure.
- bool FindPEFile();
-
- // Returns the function name for a symbol. If possible, the name is
- // undecorated. If the symbol's decorated form indicates the size of
- // parameters on the stack, this information is returned in stack_param_size.
- // Returns true on success. If the symbol doesn't encode parameter size
- // information, stack_param_size is set to -1.
- static bool GetSymbolFunctionName(IDiaSymbol *function, BSTR *name,
- int *stack_param_size);
-
- // Returns the number of bytes of stack space used for a function's
- // parameters. function must have the tag SymTagFunction. In the event of
- // a failure, returns 0, which is also a valid number of bytes.
- static int GetFunctionStackParamSize(IDiaSymbol *function);
-
- // The filename of the PE file corresponding to the currently-open
- // pdb file.
- wstring code_file_;
-
- // The session for the currently-open pdb file.
- CComPtr<IDiaSession> session_;
-
- // The current output file for this WriteMap invocation.
- FILE *output_;
-
- // There may be many duplicate filenames with different IDs.
- // This maps from the DIA "unique ID" to a single ID per unique
- // filename.
- unordered_map<DWORD, DWORD> file_ids_;
- // This maps unique filenames to file IDs.
- unordered_map<wstring, DWORD> unique_files_;
-
- // This is used for calculating post-transform symbol addresses and lengths.
- ImageMap image_map_;
-
- // Disallow copy ctor and operator=
- PDBSourceLineWriter(const PDBSourceLineWriter&);
- void operator=(const PDBSourceLineWriter&);
-};
-
-} // namespace google_breakpad
-
-#endif // COMMON_WINDOWS_PDB_SOURCE_LINE_WRITER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/string_utils-inl.h b/toolkit/crashreporter/google-breakpad/src/common/windows/string_utils-inl.h
deleted file mode 100644
index 9b63607268..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/string_utils-inl.h
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// string_utils-inl.h: Safer string manipulation on Windows, supporting
-// pre-MSVC8 environments.
-
-#ifndef COMMON_WINDOWS_STRING_UTILS_INL_H_
-#define COMMON_WINDOWS_STRING_UTILS_INL_H_
-
-#include <stdarg.h>
-#include <wchar.h>
-
-#include <string>
-
-// The "ll" printf format size specifier corresponding to |long long| was
-// intrudced in MSVC8. Earlier versions did not provide this size specifier,
-// but "I64" can be used to print 64-bit types. Don't use "I64" where "ll"
-// is available, in the event of oddball systems where |long long| is not
-// 64 bits wide.
-#if _MSC_VER >= 1400 // MSVC 2005/8
-#define WIN_STRING_FORMAT_LL "ll"
-#else // MSC_VER >= 1400
-#define WIN_STRING_FORMAT_LL "I64"
-#endif // MSC_VER >= 1400
-
-// A nonconforming version of swprintf, without the length argument, was
-// included with the CRT prior to MSVC8. Although a conforming version was
-// also available via an overload, it is not reliably chosen. _snwprintf
-// behaves as a standards-confirming swprintf should, so force the use of
-// _snwprintf when using older CRTs.
-#if _MSC_VER < 1400 // MSVC 2005/8
-#define swprintf _snwprintf
-#else
-// For MSVC8 and newer, swprintf_s is the recommended method. Conveniently,
-// it takes the same argument list as swprintf.
-#define swprintf swprintf_s
-#endif // MSC_VER < 1400
-
-namespace google_breakpad {
-
-using std::string;
-using std::wstring;
-
-class WindowsStringUtils {
- public:
- // Roughly equivalent to MSVC8's wcscpy_s, except pre-MSVC8, this does
- // not fail if source is longer than destination_size. The destination
- // buffer is always 0-terminated.
- static void safe_wcscpy(wchar_t *destination, size_t destination_size,
- const wchar_t *source);
-
- // Roughly equivalent to MSVC8's wcsncpy_s, except that _TRUNCATE cannot
- // be passed directly, and pre-MSVC8, this will not fail if source or count
- // are longer than destination_size. The destination buffer is always
- // 0-terminated.
- static void safe_wcsncpy(wchar_t *destination, size_t destination_size,
- const wchar_t *source, size_t count);
-
- // Performs multi-byte to wide character conversion on C++ strings, using
- // mbstowcs_s (MSVC8) or mbstowcs (pre-MSVC8). Returns false on failure,
- // without setting wcs.
- static bool safe_mbstowcs(const string &mbs, wstring *wcs);
-
- // The inverse of safe_mbstowcs.
- static bool safe_wcstombs(const wstring &wcs, string *mbs);
-
- // Returns the base name of a file, e.g. strips off the path.
- static wstring GetBaseName(const wstring &filename);
-
- private:
- // Disallow instantiation and other object-based operations.
- WindowsStringUtils();
- WindowsStringUtils(const WindowsStringUtils&);
- ~WindowsStringUtils();
- void operator=(const WindowsStringUtils&);
-};
-
-// static
-inline void WindowsStringUtils::safe_wcscpy(wchar_t *destination,
- size_t destination_size,
- const wchar_t *source) {
-#if _MSC_VER >= 1400 // MSVC 2005/8
- wcscpy_s(destination, destination_size, source);
-#else // _MSC_VER >= 1400
- // Pre-MSVC 2005/8 doesn't have wcscpy_s. Simulate it with wcsncpy.
- // wcsncpy doesn't 0-terminate the destination buffer if the source string
- // is longer than size. Ensure that the destination is 0-terminated.
- wcsncpy(destination, source, destination_size);
- if (destination && destination_size)
- destination[destination_size - 1] = 0;
-#endif // _MSC_VER >= 1400
-}
-
-// static
-inline void WindowsStringUtils::safe_wcsncpy(wchar_t *destination,
- size_t destination_size,
- const wchar_t *source,
- size_t count) {
-#if _MSC_VER >= 1400 // MSVC 2005/8
- wcsncpy_s(destination, destination_size, source, count);
-#else // _MSC_VER >= 1400
- // Pre-MSVC 2005/8 doesn't have wcsncpy_s. Simulate it with wcsncpy.
- // wcsncpy doesn't 0-terminate the destination buffer if the source string
- // is longer than size. Ensure that the destination is 0-terminated.
- if (destination_size < count)
- count = destination_size;
-
- wcsncpy(destination, source, count);
- if (destination && count)
- destination[count - 1] = 0;
-#endif // _MSC_VER >= 1400
-}
-
-} // namespace google_breakpad
-
-#endif // COMMON_WINDOWS_STRING_UTILS_INL_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/common/windows/string_utils.cc b/toolkit/crashreporter/google-breakpad/src/common/windows/string_utils.cc
deleted file mode 100644
index 272800035c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/common/windows/string_utils.cc
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <cassert>
-#include <vector>
-
-#include "common/windows/string_utils-inl.h"
-
-namespace google_breakpad {
-
-// static
-wstring WindowsStringUtils::GetBaseName(const wstring &filename) {
- wstring base_name(filename);
- size_t slash_pos = base_name.find_last_of(L"/\\");
- if (slash_pos != wstring::npos) {
- base_name.erase(0, slash_pos + 1);
- }
- return base_name;
-}
-
-// static
-bool WindowsStringUtils::safe_mbstowcs(const string &mbs, wstring *wcs) {
- assert(wcs);
-
- // First, determine the length of the destination buffer.
- size_t wcs_length;
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
- errno_t err;
- if ((err = mbstowcs_s(&wcs_length, NULL, 0, mbs.c_str(), _TRUNCATE)) != 0) {
- return false;
- }
- assert(wcs_length > 0);
-#else // _MSC_VER >= 1400
- if ((wcs_length = mbstowcs(NULL, mbs.c_str(), mbs.length())) == (size_t)-1) {
- return false;
- }
-
- // Leave space for the 0-terminator.
- ++wcs_length;
-#endif // _MSC_VER >= 1400
-
- std::vector<wchar_t> wcs_v(wcs_length);
-
- // Now, convert.
-#if _MSC_VER >= 1400 // MSVC 2005/8
- if ((err = mbstowcs_s(NULL, &wcs_v[0], wcs_length, mbs.c_str(),
- _TRUNCATE)) != 0) {
- return false;
- }
-#else // _MSC_VER >= 1400
- if (mbstowcs(&wcs_v[0], mbs.c_str(), mbs.length()) == (size_t)-1) {
- return false;
- }
-
- // Ensure presence of 0-terminator.
- wcs_v[wcs_length - 1] = '\0';
-#endif // _MSC_VER >= 1400
-
- *wcs = &wcs_v[0];
- return true;
-}
-
-// static
-bool WindowsStringUtils::safe_wcstombs(const wstring &wcs, string *mbs) {
- assert(mbs);
-
- // First, determine the length of the destination buffer.
- size_t mbs_length;
-
-#if _MSC_VER >= 1400 // MSVC 2005/8
- errno_t err;
- if ((err = wcstombs_s(&mbs_length, NULL, 0, wcs.c_str(), _TRUNCATE)) != 0) {
- return false;
- }
- assert(mbs_length > 0);
-#else // _MSC_VER >= 1400
- if ((mbs_length = wcstombs(NULL, wcs.c_str(), wcs.length())) == (size_t)-1) {
- return false;
- }
-
- // Leave space for the 0-terminator.
- ++mbs_length;
-#endif // _MSC_VER >= 1400
-
- std::vector<char> mbs_v(mbs_length);
-
- // Now, convert.
-#if _MSC_VER >= 1400 // MSVC 2005/8
- if ((err = wcstombs_s(NULL, &mbs_v[0], mbs_length, wcs.c_str(),
- _TRUNCATE)) != 0) {
- return false;
- }
-#else // _MSC_VER >= 1400
- if (wcstombs(&mbs_v[0], wcs.c_str(), wcs.length()) == (size_t)-1) {
- return false;
- }
-
- // Ensure presence of 0-terminator.
- mbs_v[mbs_length - 1] = '\0';
-#endif // _MSC_VER >= 1400
-
- *mbs = &mbs_v[0];
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/config.h.in b/toolkit/crashreporter/google-breakpad/src/config.h.in
deleted file mode 100644
index ee6a67ad95..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/config.h.in
+++ /dev/null
@@ -1,79 +0,0 @@
-/* src/config.h.in. Generated from configure.ac by autoheader. */
-
-/* Define to 1 if you have the <a.out.h> header file. */
-#undef HAVE_A_OUT_H
-
-/* define if the compiler supports basic C++11 syntax */
-#undef HAVE_CXX11
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define if you have POSIX threads libraries and header files. */
-#undef HAVE_PTHREAD
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to necessary symbol if this constant uses a non-standard name on
- your system. */
-#undef PTHREAD_CREATE_JOINABLE
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
-
-/* Enable large inode numbers on Mac OS X 10.5. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
-/* Define for large files, on AIX-style hosts. */
-#undef _LARGE_FILES
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/breakpad_types.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/breakpad_types.h
deleted file mode 100644
index d8828043ff..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/breakpad_types.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* breakpad_types.h: Precise-width types
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file ensures that types uintN_t are defined for N = 8, 16, 32, and
- * 64. Types of precise widths are crucial to the task of writing data
- * structures on one platform and reading them on another.
- *
- * Author: Mark Mentovai */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
-#define GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__
-
-#if (defined(_INTTYPES_H) || defined(_INTTYPES_H_)) && \
- !defined(__STDC_FORMAT_MACROS)
-#error "inttypes.h has already been included before this header file, but "
-#error "without __STDC_FORMAT_MACROS defined."
-#endif
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif /* __STDC_FORMAT_MACROS */
-#include <inttypes.h>
-
-typedef struct {
- uint64_t high;
- uint64_t low;
-} uint128_struct;
-
-typedef uint64_t breakpad_time_t;
-
-/* Try to get PRIx64 from inttypes.h, but if it's not defined, fall back to
- * llx, which is the format string for "long long" - this is a 64-bit
- * integral type on many systems. */
-#ifndef PRIx64
-#define PRIx64 "llx"
-#endif /* !PRIx64 */
-
-#endif /* GOOGLE_BREAKPAD_COMMON_BREAKPAD_TYPES_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_amd64.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_amd64.h
deleted file mode 100644
index 4256706d77..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_amd64.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on amd64. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by ensuring
- * ensuring that all members are aligned on their natural boundaries. In
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * These definitions may be extended to support handling minidump files
- * for other CPUs and other operating systems.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably in terms of interoperability with minidumps
- * produced by DbgHelp on Windows, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file. DbgHelp
- * on Windows is assumed to be the reference implementation; this file
- * seeks to provide a cross-platform compatible implementation. To avoid
- * collisions with the types and values defined and used by DbgHelp in the
- * event that this implementation is used on Windows, each type and value
- * defined here is given a new name, beginning with "MD". Names of the
- * equivalent types and values in the Windows Platform SDK are given in
- * comments.
- *
- * Author: Mark Mentovai
- * Change to split into its own file: Neal Sidhwaney */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__
-
-
-/*
- * AMD64 support, see WINNT.H
- */
-
-typedef struct {
- uint16_t control_word;
- uint16_t status_word;
- uint8_t tag_word;
- uint8_t reserved1;
- uint16_t error_opcode;
- uint32_t error_offset;
- uint16_t error_selector;
- uint16_t reserved2;
- uint32_t data_offset;
- uint16_t data_selector;
- uint16_t reserved3;
- uint32_t mx_csr;
- uint32_t mx_csr_mask;
- uint128_struct float_registers[8];
- uint128_struct xmm_registers[16];
- uint8_t reserved4[96];
-} MDXmmSaveArea32AMD64; /* XMM_SAVE_AREA32 */
-
-#define MD_CONTEXT_AMD64_VR_COUNT 26
-
-typedef struct {
- /*
- * Register parameter home addresses.
- */
- uint64_t p1_home;
- uint64_t p2_home;
- uint64_t p3_home;
- uint64_t p4_home;
- uint64_t p5_home;
- uint64_t p6_home;
-
- /* The next field determines the layout of the structure, and which parts
- * of it are populated */
- uint32_t context_flags;
- uint32_t mx_csr;
-
- /* The next register is included with MD_CONTEXT_AMD64_CONTROL */
- uint16_t cs;
-
- /* The next 4 registers are included with MD_CONTEXT_AMD64_SEGMENTS */
- uint16_t ds;
- uint16_t es;
- uint16_t fs;
- uint16_t gs;
-
- /* The next 2 registers are included with MD_CONTEXT_AMD64_CONTROL */
- uint16_t ss;
- uint32_t eflags;
-
- /* The next 6 registers are included with MD_CONTEXT_AMD64_DEBUG_REGISTERS */
- uint64_t dr0;
- uint64_t dr1;
- uint64_t dr2;
- uint64_t dr3;
- uint64_t dr6;
- uint64_t dr7;
-
- /* The next 4 registers are included with MD_CONTEXT_AMD64_INTEGER */
- uint64_t rax;
- uint64_t rcx;
- uint64_t rdx;
- uint64_t rbx;
-
- /* The next register is included with MD_CONTEXT_AMD64_CONTROL */
- uint64_t rsp;
-
- /* The next 11 registers are included with MD_CONTEXT_AMD64_INTEGER */
- uint64_t rbp;
- uint64_t rsi;
- uint64_t rdi;
- uint64_t r8;
- uint64_t r9;
- uint64_t r10;
- uint64_t r11;
- uint64_t r12;
- uint64_t r13;
- uint64_t r14;
- uint64_t r15;
-
- /* The next register is included with MD_CONTEXT_AMD64_CONTROL */
- uint64_t rip;
-
- /* The next set of registers are included with
- * MD_CONTEXT_AMD64_FLOATING_POINT
- */
- union {
- MDXmmSaveArea32AMD64 flt_save;
- struct {
- uint128_struct header[2];
- uint128_struct legacy[8];
- uint128_struct xmm0;
- uint128_struct xmm1;
- uint128_struct xmm2;
- uint128_struct xmm3;
- uint128_struct xmm4;
- uint128_struct xmm5;
- uint128_struct xmm6;
- uint128_struct xmm7;
- uint128_struct xmm8;
- uint128_struct xmm9;
- uint128_struct xmm10;
- uint128_struct xmm11;
- uint128_struct xmm12;
- uint128_struct xmm13;
- uint128_struct xmm14;
- uint128_struct xmm15;
- } sse_registers;
- };
-
- uint128_struct vector_register[MD_CONTEXT_AMD64_VR_COUNT];
- uint64_t vector_control;
-
- /* The next 5 registers are included with MD_CONTEXT_AMD64_DEBUG_REGISTERS */
- uint64_t debug_control;
- uint64_t last_branch_to_rip;
- uint64_t last_branch_from_rip;
- uint64_t last_exception_to_rip;
- uint64_t last_exception_from_rip;
-
-} MDRawContextAMD64; /* CONTEXT */
-
-/* For (MDRawContextAMD64).context_flags. These values indicate the type of
- * context stored in the structure. The high 24 bits identify the CPU, the
- * low 8 bits identify the type of context saved. */
-#define MD_CONTEXT_AMD64 0x00100000 /* CONTEXT_AMD64 */
-#define MD_CONTEXT_AMD64_CONTROL (MD_CONTEXT_AMD64 | 0x00000001)
- /* CONTEXT_CONTROL */
-#define MD_CONTEXT_AMD64_INTEGER (MD_CONTEXT_AMD64 | 0x00000002)
- /* CONTEXT_INTEGER */
-#define MD_CONTEXT_AMD64_SEGMENTS (MD_CONTEXT_AMD64 | 0x00000004)
- /* CONTEXT_SEGMENTS */
-#define MD_CONTEXT_AMD64_FLOATING_POINT (MD_CONTEXT_AMD64 | 0x00000008)
- /* CONTEXT_FLOATING_POINT */
-#define MD_CONTEXT_AMD64_DEBUG_REGISTERS (MD_CONTEXT_AMD64 | 0x00000010)
- /* CONTEXT_DEBUG_REGISTERS */
-#define MD_CONTEXT_AMD64_XSTATE (MD_CONTEXT_AMD64 | 0x00000040)
- /* CONTEXT_XSTATE */
-
-/* WinNT.h refers to CONTEXT_MMX_REGISTERS but doesn't appear to define it
- * I think it really means CONTEXT_FLOATING_POINT.
- */
-
-#define MD_CONTEXT_AMD64_FULL (MD_CONTEXT_AMD64_CONTROL | \
- MD_CONTEXT_AMD64_INTEGER | \
- MD_CONTEXT_AMD64_FLOATING_POINT)
- /* CONTEXT_FULL */
-
-#define MD_CONTEXT_AMD64_ALL (MD_CONTEXT_AMD64_FULL | \
- MD_CONTEXT_AMD64_SEGMENTS | \
- MD_CONTEXT_X86_DEBUG_REGISTERS)
- /* CONTEXT_ALL */
-
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_AMD64_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm.h
deleted file mode 100644
index 6a71138337..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Copyright (c) 2009, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on ARM. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by
- * ensuring that all members are aligned on their natural boundaries.
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file.
- *
- * Author: Julian Seward
- */
-
-/*
- * ARM support
- */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__
-
-#define MD_FLOATINGSAVEAREA_ARM_FPR_COUNT 32
-#define MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT 8
-
-/*
- * Note that these structures *do not* map directly to the CONTEXT
- * structure defined in WinNT.h in the Windows Mobile SDK. That structure
- * does not accomodate VFPv3, and I'm unsure if it was ever used in the
- * wild anyway, as Windows CE only seems to produce "cedumps" which
- * are not exactly minidumps.
- */
-typedef struct {
- uint64_t fpscr; /* FPU status register */
-
- /* 32 64-bit floating point registers, d0 .. d31. */
- uint64_t regs[MD_FLOATINGSAVEAREA_ARM_FPR_COUNT];
-
- /* Miscellaneous control words */
- uint32_t extra[MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT];
-} MDFloatingSaveAreaARM;
-
-#define MD_CONTEXT_ARM_GPR_COUNT 16
-
-typedef struct {
- /* The next field determines the layout of the structure, and which parts
- * of it are populated
- */
- uint32_t context_flags;
-
- /* 16 32-bit integer registers, r0 .. r15
- * Note the following fixed uses:
- * r13 is the stack pointer
- * r14 is the link register
- * r15 is the program counter
- */
- uint32_t iregs[MD_CONTEXT_ARM_GPR_COUNT];
-
- /* CPSR (flags, basically): 32 bits:
- bit 31 - N (negative)
- bit 30 - Z (zero)
- bit 29 - C (carry)
- bit 28 - V (overflow)
- bit 27 - Q (saturation flag, sticky)
- All other fields -- ignore */
- uint32_t cpsr;
-
- /* The next field is included with MD_CONTEXT_ARM_FLOATING_POINT */
- MDFloatingSaveAreaARM float_save;
-
-} MDRawContextARM;
-
-/* Indices into iregs for registers with a dedicated or conventional
- * purpose.
- */
-enum MDARMRegisterNumbers {
- MD_CONTEXT_ARM_REG_IOS_FP = 7,
- MD_CONTEXT_ARM_REG_FP = 11,
- MD_CONTEXT_ARM_REG_SP = 13,
- MD_CONTEXT_ARM_REG_LR = 14,
- MD_CONTEXT_ARM_REG_PC = 15
-};
-
-/* For (MDRawContextARM).context_flags. These values indicate the type of
- * context stored in the structure. */
-/* CONTEXT_ARM from the Windows CE 5.0 SDK. This value isn't correct
- * because this bit can be used for flags. Presumably this value was
- * never actually used in minidumps, but only in "CEDumps" which
- * are a whole parallel minidump file format for Windows CE.
- * Therefore, Breakpad defines its own value for ARM CPUs.
- */
-#define MD_CONTEXT_ARM_OLD 0x00000040
-/* This value was chosen to avoid likely conflicts with MD_CONTEXT_*
- * for other CPUs. */
-#define MD_CONTEXT_ARM 0x40000000
-#define MD_CONTEXT_ARM_INTEGER (MD_CONTEXT_ARM | 0x00000002)
-#define MD_CONTEXT_ARM_FLOATING_POINT (MD_CONTEXT_ARM | 0x00000004)
-
-#define MD_CONTEXT_ARM_FULL (MD_CONTEXT_ARM_INTEGER | \
- MD_CONTEXT_ARM_FLOATING_POINT)
-
-#define MD_CONTEXT_ARM_ALL (MD_CONTEXT_ARM_INTEGER | \
- MD_CONTEXT_ARM_FLOATING_POINT)
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm64.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm64.h
deleted file mode 100644
index 5ace0d9de4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_arm64.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/* Copyright 2013 Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on ARM. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by
- * ensuring that all members are aligned on their natural boundaries.
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file.
- *
- * Author: Colin Blundell
- */
-
-/*
- * ARM64 support
- */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__
-
-#define MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT 32
-
-typedef struct {
- uint32_t fpsr; /* FPU status register */
- uint32_t fpcr; /* FPU control register */
-
- /* 32 128-bit floating point registers, d0 .. d31. */
- uint128_struct regs[MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT];
-} MDFloatingSaveAreaARM64;
-
-#define MD_CONTEXT_ARM64_GPR_COUNT 33
-
-/* Use the same 32-bit alignment when accessing this structure from 64-bit code
- * as is used natively in 32-bit code. */
-#pragma pack(push, 4)
-
-typedef struct {
- /* The next field determines the layout of the structure, and which parts
- * of it are populated
- */
- uint64_t context_flags;
-
- /* 33 64-bit integer registers, x0 .. x31 + the PC
- * Note the following fixed uses:
- * x29 is the frame pointer
- * x30 is the link register
- * x31 is the stack pointer
- * The PC is effectively x32.
- */
- uint64_t iregs[MD_CONTEXT_ARM64_GPR_COUNT];
-
- /* CPSR (flags, basically): 32 bits:
- bit 31 - N (negative)
- bit 30 - Z (zero)
- bit 29 - C (carry)
- bit 28 - V (overflow)
- bit 27 - Q (saturation flag, sticky)
- All other fields -- ignore */
- uint32_t cpsr;
-
- /* The next field is included with MD_CONTEXT64_ARM_FLOATING_POINT */
- MDFloatingSaveAreaARM64 float_save;
-
-} MDRawContextARM64;
-
-#pragma pack(pop)
-
-/* Indices into iregs for registers with a dedicated or conventional
- * purpose.
- */
-enum MDARM64RegisterNumbers {
- MD_CONTEXT_ARM64_REG_FP = 29,
- MD_CONTEXT_ARM64_REG_LR = 30,
- MD_CONTEXT_ARM64_REG_SP = 31,
- MD_CONTEXT_ARM64_REG_PC = 32
-};
-
-/* For (MDRawContextARM64).context_flags. These values indicate the type of
- * context stored in the structure. MD_CONTEXT_ARM64 is Breakpad-defined.
- * This value was chosen to avoid likely conflicts with MD_CONTEXT_*
- * for other CPUs. */
-#define MD_CONTEXT_ARM64 0x80000000
-#define MD_CONTEXT_ARM64_INTEGER (MD_CONTEXT_ARM64 | 0x00000002)
-#define MD_CONTEXT_ARM64_FLOATING_POINT (MD_CONTEXT_ARM64 | 0x00000004)
-
-#define MD_CONTEXT_ARM64_FULL (MD_CONTEXT_ARM64_INTEGER | \
- MD_CONTEXT_ARM64_FLOATING_POINT)
-
-#define MD_CONTEXT_ARM64_ALL (MD_CONTEXT_ARM64_INTEGER | \
- MD_CONTEXT_ARM64_FLOATING_POINT)
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_ARM64_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_mips.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_mips.h
deleted file mode 100644
index f4e2b5891c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_mips.h
+++ /dev/null
@@ -1,176 +0,0 @@
-/* Copyright (c) 2013, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on MIPS. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by
- * ensuring that all members are aligned on their natural boundaries.
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file.
- *
- * Author: Chris Dearman
- */
-
-/*
- * MIPS support
- */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__
-
-#define MD_CONTEXT_MIPS_GPR_COUNT 32
-#define MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT 32
-#define MD_CONTEXT_MIPS_DSP_COUNT 3
-
-/*
- * Note that these structures *do not* map directly to the CONTEXT
- * structure defined in WinNT.h in the Windows Mobile SDK. That structure
- * does not accomodate VFPv3, and I'm unsure if it was ever used in the
- * wild anyway, as Windows CE only seems to produce "cedumps" which
- * are not exactly minidumps.
- */
-typedef struct {
- /* 32 64-bit floating point registers, f0..f31 */
- uint64_t regs[MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT];
-
- uint32_t fpcsr; /* FPU status register. */
- uint32_t fir; /* FPU implementation register. */
-} MDFloatingSaveAreaMIPS;
-
-typedef struct {
- /* The next field determines the layout of the structure, and which parts
- * of it are populated.
- */
- uint32_t context_flags;
- uint32_t _pad0;
-
- /* 32 64-bit integer registers, r0..r31.
- * Note the following fixed uses:
- * r29 is the stack pointer.
- * r31 is the return address.
- */
- uint64_t iregs[MD_CONTEXT_MIPS_GPR_COUNT];
-
- /* multiply/divide result. */
- uint64_t mdhi, mdlo;
-
- /* DSP accumulators. */
- uint32_t hi[MD_CONTEXT_MIPS_DSP_COUNT];
- uint32_t lo[MD_CONTEXT_MIPS_DSP_COUNT];
- uint32_t dsp_control;
- uint32_t _pad1;
-
- uint64_t epc;
- uint64_t badvaddr;
- uint32_t status;
- uint32_t cause;
-
- /* The next field is included with MD_CONTEXT_MIPS_FLOATING_POINT. */
- MDFloatingSaveAreaMIPS float_save;
-
-} MDRawContextMIPS;
-
-/* Indices into iregs for registers with a dedicated or conventional
- * purpose.
- */
-enum MDMIPSRegisterNumbers {
- MD_CONTEXT_MIPS_REG_S0 = 16,
- MD_CONTEXT_MIPS_REG_S1 = 17,
- MD_CONTEXT_MIPS_REG_S2 = 18,
- MD_CONTEXT_MIPS_REG_S3 = 19,
- MD_CONTEXT_MIPS_REG_S4 = 20,
- MD_CONTEXT_MIPS_REG_S5 = 21,
- MD_CONTEXT_MIPS_REG_S6 = 22,
- MD_CONTEXT_MIPS_REG_S7 = 23,
- MD_CONTEXT_MIPS_REG_GP = 28,
- MD_CONTEXT_MIPS_REG_SP = 29,
- MD_CONTEXT_MIPS_REG_FP = 30,
- MD_CONTEXT_MIPS_REG_RA = 31,
-};
-
-/* For (MDRawContextMIPS).context_flags. These values indicate the type of
- * context stored in the structure. */
-/* CONTEXT_MIPS from the Windows CE 5.0 SDK. This value isn't correct
- * because this bit can be used for flags. Presumably this value was
- * never actually used in minidumps, but only in "CEDumps" which
- * are a whole parallel minidump file format for Windows CE.
- * Therefore, Breakpad defines its own value for MIPS CPUs.
- */
-#define MD_CONTEXT_MIPS 0x00040000
-#define MD_CONTEXT_MIPS_INTEGER (MD_CONTEXT_MIPS | 0x00000002)
-#define MD_CONTEXT_MIPS_FLOATING_POINT (MD_CONTEXT_MIPS | 0x00000004)
-#define MD_CONTEXT_MIPS_DSP (MD_CONTEXT_MIPS | 0x00000008)
-
-#define MD_CONTEXT_MIPS_FULL (MD_CONTEXT_MIPS_INTEGER | \
- MD_CONTEXT_MIPS_FLOATING_POINT | \
- MD_CONTEXT_MIPS_DSP)
-
-#define MD_CONTEXT_MIPS_ALL (MD_CONTEXT_MIPS_INTEGER | \
- MD_CONTEXT_MIPS_FLOATING_POINT \
- MD_CONTEXT_MIPS_DSP)
-
-/**
- * Breakpad defines for MIPS64
- */
-#define MD_CONTEXT_MIPS64 0x00080000
-#define MD_CONTEXT_MIPS64_INTEGER (MD_CONTEXT_MIPS64 | 0x00000002)
-#define MD_CONTEXT_MIPS64_FLOATING_POINT (MD_CONTEXT_MIPS64 | 0x00000004)
-#define MD_CONTEXT_MIPS64_DSP (MD_CONTEXT_MIPS64 | 0x00000008)
-
-#define MD_CONTEXT_MIPS64_FULL (MD_CONTEXT_MIPS64_INTEGER | \
- MD_CONTEXT_MIPS64_FLOATING_POINT | \
- MD_CONTEXT_MIPS64_DSP)
-
-#define MD_CONTEXT_MIPS64_ALL (MD_CONTEXT_MIPS64_INTEGER | \
- MD_CONTEXT_MIPS64_FLOATING_POINT \
- MD_CONTEXT_MIPS64_DSP)
-
-#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_MIPS_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc.h
deleted file mode 100644
index b24cc42438..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on ppc. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by ensuring
- * ensuring that all members are aligned on their natural boundaries. In
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * These definitions may be extended to support handling minidump files
- * for other CPUs and other operating systems.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably in terms of interoperability with minidumps
- * produced by DbgHelp on Windows, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file. DbgHelp
- * on Windows is assumed to be the reference implementation; this file
- * seeks to provide a cross-platform compatible implementation. To avoid
- * collisions with the types and values defined and used by DbgHelp in the
- * event that this implementation is used on Windows, each type and value
- * defined here is given a new name, beginning with "MD". Names of the
- * equivalent types and values in the Windows Platform SDK are given in
- * comments.
- *
- * Author: Mark Mentovai
- * Change to split into its own file: Neal Sidhwaney */
-
-/*
- * Breakpad minidump extension for PowerPC support. Based on Darwin/Mac OS X'
- * mach/ppc/_types.h
- */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__
-
-#define MD_FLOATINGSAVEAREA_PPC_FPR_COUNT 32
-
-typedef struct {
- /* fpregs is a double[32] in mach/ppc/_types.h, but a uint64_t is used
- * here for precise sizing. */
- uint64_t fpregs[MD_FLOATINGSAVEAREA_PPC_FPR_COUNT];
- uint32_t fpscr_pad;
- uint32_t fpscr; /* Status/control */
-} MDFloatingSaveAreaPPC; /* Based on ppc_float_state */
-
-
-#define MD_VECTORSAVEAREA_PPC_VR_COUNT 32
-
-typedef struct {
- /* Vector registers (including vscr) are 128 bits, but mach/ppc/_types.h
- * exposes them as four 32-bit quantities. */
- uint128_struct save_vr[MD_VECTORSAVEAREA_PPC_VR_COUNT];
- uint128_struct save_vscr; /* Status/control */
- uint32_t save_pad5[4];
- uint32_t save_vrvalid; /* Indicates which vector registers are saved */
- uint32_t save_pad6[7];
-} MDVectorSaveAreaPPC; /* ppc_vector_state */
-
-
-#define MD_CONTEXT_PPC_GPR_COUNT 32
-
-/* Use the same 32-bit alignment when accessing this structure from 64-bit code
- * as is used natively in 32-bit code. #pragma pack is a MSVC extension
- * supported by gcc. */
-#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#pragma pack(4)
-#else
-#pragma pack(push, 4)
-#endif
-
-typedef struct {
- /* context_flags is not present in ppc_thread_state, but it aids
- * identification of MDRawContextPPC among other raw context types,
- * and it guarantees alignment when we get to float_save. */
- uint32_t context_flags;
-
- uint32_t srr0; /* Machine status save/restore: stores pc
- * (instruction) */
- uint32_t srr1; /* Machine status save/restore: stores msr
- * (ps, program/machine state) */
- /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is
- * used for brevity. */
- uint32_t gpr[MD_CONTEXT_PPC_GPR_COUNT];
- uint32_t cr; /* Condition */
- uint32_t xer; /* Integer (fiXed-point) exception */
- uint32_t lr; /* Link */
- uint32_t ctr; /* Count */
- uint32_t mq; /* Multiply/Quotient (PPC 601, POWER only) */
- uint32_t vrsave; /* Vector save */
-
- /* float_save and vector_save aren't present in ppc_thread_state, but
- * are represented in separate structures that still define a thread's
- * context. */
- MDFloatingSaveAreaPPC float_save;
- MDVectorSaveAreaPPC vector_save;
-} MDRawContextPPC; /* Based on ppc_thread_state */
-
-/* Indices into gpr for registers with a dedicated or conventional purpose. */
-enum MDPPCRegisterNumbers {
- MD_CONTEXT_PPC_REG_SP = 1
-};
-
-#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-#pragma pack(0)
-#else
-#pragma pack(pop)
-#endif
-
-/* For (MDRawContextPPC).context_flags. These values indicate the type of
- * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its
- * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other
- * CPUs. */
-#define MD_CONTEXT_PPC 0x20000000
-#define MD_CONTEXT_PPC_BASE (MD_CONTEXT_PPC | 0x00000001)
-#define MD_CONTEXT_PPC_FLOATING_POINT (MD_CONTEXT_PPC | 0x00000008)
-#define MD_CONTEXT_PPC_VECTOR (MD_CONTEXT_PPC | 0x00000020)
-
-#define MD_CONTEXT_PPC_FULL MD_CONTEXT_PPC_BASE
-#define MD_CONTEXT_PPC_ALL (MD_CONTEXT_PPC_FULL | \
- MD_CONTEXT_PPC_FLOATING_POINT | \
- MD_CONTEXT_PPC_VECTOR)
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc64.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc64.h
deleted file mode 100644
index 61f4193865..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_ppc64.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/* Copyright (c) 2008, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on ppc64. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by ensuring
- * ensuring that all members are aligned on their natural boundaries. In
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * These definitions may be extended to support handling minidump files
- * for other CPUs and other operating systems.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably in terms of interoperability with minidumps
- * produced by DbgHelp on Windows, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file. DbgHelp
- * on Windows is assumed to be the reference implementation; this file
- * seeks to provide a cross-platform compatible implementation. To avoid
- * collisions with the types and values defined and used by DbgHelp in the
- * event that this implementation is used on Windows, each type and value
- * defined here is given a new name, beginning with "MD". Names of the
- * equivalent types and values in the Windows Platform SDK are given in
- * comments.
- *
- * Author: Neal Sidhwaney */
-
-
-/*
- * Breakpad minidump extension for PPC64 support. Based on Darwin/Mac OS X'
- * mach/ppc/_types.h
- */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__
-
-#include "minidump_cpu_ppc.h"
-
-// these types are the same in ppc64 & ppc
-typedef MDFloatingSaveAreaPPC MDFloatingSaveAreaPPC64;
-typedef MDVectorSaveAreaPPC MDVectorSaveAreaPPC64;
-
-#define MD_CONTEXT_PPC64_GPR_COUNT MD_CONTEXT_PPC_GPR_COUNT
-
-typedef struct {
- /* context_flags is not present in ppc_thread_state, but it aids
- * identification of MDRawContextPPC among other raw context types,
- * and it guarantees alignment when we get to float_save. */
- uint64_t context_flags;
-
- uint64_t srr0; /* Machine status save/restore: stores pc
- * (instruction) */
- uint64_t srr1; /* Machine status save/restore: stores msr
- * (ps, program/machine state) */
- /* ppc_thread_state contains 32 fields, r0 .. r31. Here, an array is
- * used for brevity. */
- uint64_t gpr[MD_CONTEXT_PPC64_GPR_COUNT];
- uint64_t cr; /* Condition */
- uint64_t xer; /* Integer (fiXed-point) exception */
- uint64_t lr; /* Link */
- uint64_t ctr; /* Count */
- uint64_t vrsave; /* Vector save */
-
- /* float_save and vector_save aren't present in ppc_thread_state, but
- * are represented in separate structures that still define a thread's
- * context. */
- MDFloatingSaveAreaPPC float_save;
- MDVectorSaveAreaPPC vector_save;
-} MDRawContextPPC64; /* Based on ppc_thread_state */
-
-/* Indices into gpr for registers with a dedicated or conventional purpose. */
-enum MDPPC64RegisterNumbers {
- MD_CONTEXT_PPC64_REG_SP = 1
-};
-
-/* For (MDRawContextPPC).context_flags. These values indicate the type of
- * context stored in the structure. MD_CONTEXT_PPC is Breakpad-defined. Its
- * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other
- * CPUs. */
-#define MD_CONTEXT_PPC64 0x01000000
-#define MD_CONTEXT_PPC64_BASE (MD_CONTEXT_PPC64 | 0x00000001)
-#define MD_CONTEXT_PPC64_FLOATING_POINT (MD_CONTEXT_PPC64 | 0x00000008)
-#define MD_CONTEXT_PPC64_VECTOR (MD_CONTEXT_PPC64 | 0x00000020)
-
-#define MD_CONTEXT_PPC64_FULL MD_CONTEXT_PPC64_BASE
-#define MD_CONTEXT_PPC64_ALL (MD_CONTEXT_PPC64_FULL | \
- MD_CONTEXT_PPC64_FLOATING_POINT | \
- MD_CONTEXT_PPC64_VECTOR)
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_PPC64_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_sparc.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_sparc.h
deleted file mode 100644
index 95c08b1743..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_sparc.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on sparc. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by ensuring
- * ensuring that all members are aligned on their natural boundaries. In
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * These definitions may be extended to support handling minidump files
- * for other CPUs and other operating systems.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably in terms of interoperability with minidumps
- * produced by DbgHelp on Windows, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file. DbgHelp
- * on Windows is assumed to be the reference implementation; this file
- * seeks to provide a cross-platform compatible implementation. To avoid
- * collisions with the types and values defined and used by DbgHelp in the
- * event that this implementation is used on Windows, each type and value
- * defined here is given a new name, beginning with "MD". Names of the
- * equivalent types and values in the Windows Platform SDK are given in
- * comments.
- *
- * Author: Mark Mentovai
- * Change to split into its own file: Neal Sidhwaney */
-
-/*
- * SPARC support, see (solaris)sys/procfs_isa.h also
- */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__
-
-#define MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT 32
-
-typedef struct {
-
- /* FPU floating point regs */
- uint64_t regs[MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT];
-
- uint64_t filler;
- uint64_t fsr; /* FPU status register */
-} MDFloatingSaveAreaSPARC; /* FLOATING_SAVE_AREA */
-
-#define MD_CONTEXT_SPARC_GPR_COUNT 32
-
-typedef struct {
- /* The next field determines the layout of the structure, and which parts
- * of it are populated
- */
- uint32_t context_flags;
- uint32_t flag_pad;
- /*
- * General register access (SPARC).
- * Don't confuse definitions here with definitions in <sys/regset.h>.
- * Registers are 32 bits for ILP32, 64 bits for LP64.
- * SPARC V7/V8 is for 32bit, SPARC V9 is for 64bit
- */
-
- /* 32 Integer working registers */
-
- /* g_r[0-7] global registers(g0-g7)
- * g_r[8-15] out registers(o0-o7)
- * g_r[16-23] local registers(l0-l7)
- * g_r[24-31] in registers(i0-i7)
- */
- uint64_t g_r[MD_CONTEXT_SPARC_GPR_COUNT];
-
- /* several control registers */
-
- /* Processor State register(PSR) for SPARC V7/V8
- * Condition Code register (CCR) for SPARC V9
- */
- uint64_t ccr;
-
- uint64_t pc; /* Program Counter register (PC) */
- uint64_t npc; /* Next Program Counter register (nPC) */
- uint64_t y; /* Y register (Y) */
-
- /* Address Space Identifier register (ASI) for SPARC V9
- * WIM for SPARC V7/V8
- */
- uint64_t asi;
-
- /* Floating-Point Registers State register (FPRS) for SPARC V9
- * TBR for for SPARC V7/V8
- */
- uint64_t fprs;
-
- /* The next field is included with MD_CONTEXT_SPARC_FLOATING_POINT */
- MDFloatingSaveAreaSPARC float_save;
-
-} MDRawContextSPARC; /* CONTEXT_SPARC */
-
-/* Indices into g_r for registers with a dedicated or conventional purpose. */
-enum MDSPARCRegisterNumbers {
- MD_CONTEXT_SPARC_REG_SP = 14
-};
-
-/* For (MDRawContextSPARC).context_flags. These values indicate the type of
- * context stored in the structure. MD_CONTEXT_SPARC is Breakpad-defined. Its
- * value was chosen to avoid likely conflicts with MD_CONTEXT_* for other
- * CPUs. */
-#define MD_CONTEXT_SPARC 0x10000000
-#define MD_CONTEXT_SPARC_CONTROL (MD_CONTEXT_SPARC | 0x00000001)
-#define MD_CONTEXT_SPARC_INTEGER (MD_CONTEXT_SPARC | 0x00000002)
-#define MD_CONTEXT_SAPARC_FLOATING_POINT (MD_CONTEXT_SPARC | 0x00000004)
-#define MD_CONTEXT_SAPARC_EXTRA (MD_CONTEXT_SPARC | 0x00000008)
-
-#define MD_CONTEXT_SPARC_FULL (MD_CONTEXT_SPARC_CONTROL | \
- MD_CONTEXT_SPARC_INTEGER)
-
-#define MD_CONTEXT_SPARC_ALL (MD_CONTEXT_SPARC_FULL | \
- MD_CONTEXT_SAPARC_FLOATING_POINT | \
- MD_CONTEXT_SAPARC_EXTRA)
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_SPARC_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_x86.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_x86.h
deleted file mode 100644
index e09cb7cb52..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_cpu_x86.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * This file contains the necessary definitions to read minidump files
- * produced on x86. These files may be read on any platform provided
- * that the alignments of these structures on the processing system are
- * identical to the alignments of these structures on the producing system.
- * For this reason, precise-sized types are used. The structures defined
- * by this file have been laid out to minimize alignment problems by ensuring
- * ensuring that all members are aligned on their natural boundaries. In
- * In some cases, tail-padding may be significant when different ABIs specify
- * different tail-padding behaviors. To avoid problems when reading or
- * writing affected structures, MD_*_SIZE macros are provided where needed,
- * containing the useful size of the structures without padding.
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * These definitions may be extended to support handling minidump files
- * for other CPUs and other operating systems.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably in terms of interoperability with minidumps
- * produced by DbgHelp on Windows, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file. DbgHelp
- * on Windows is assumed to be the reference implementation; this file
- * seeks to provide a cross-platform compatible implementation. To avoid
- * collisions with the types and values defined and used by DbgHelp in the
- * event that this implementation is used on Windows, each type and value
- * defined here is given a new name, beginning with "MD". Names of the
- * equivalent types and values in the Windows Platform SDK are given in
- * comments.
- *
- * Author: Mark Mentovai */
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__
-
-#define MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE 80
- /* SIZE_OF_80387_REGISTERS */
-
-typedef struct {
- uint32_t control_word;
- uint32_t status_word;
- uint32_t tag_word;
- uint32_t error_offset;
- uint32_t error_selector;
- uint32_t data_offset;
- uint32_t data_selector;
-
- /* register_area contains eight 80-bit (x87 "long double") quantities for
- * floating-point registers %st0 (%mm0) through %st7 (%mm7). */
- uint8_t register_area[MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE];
- uint32_t cr0_npx_state;
-} MDFloatingSaveAreaX86; /* FLOATING_SAVE_AREA */
-
-
-#define MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE 512
- /* MAXIMUM_SUPPORTED_EXTENSION */
-
-typedef struct {
- /* The next field determines the layout of the structure, and which parts
- * of it are populated */
- uint32_t context_flags;
-
- /* The next 6 registers are included with MD_CONTEXT_X86_DEBUG_REGISTERS */
- uint32_t dr0;
- uint32_t dr1;
- uint32_t dr2;
- uint32_t dr3;
- uint32_t dr6;
- uint32_t dr7;
-
- /* The next field is included with MD_CONTEXT_X86_FLOATING_POINT */
- MDFloatingSaveAreaX86 float_save;
-
- /* The next 4 registers are included with MD_CONTEXT_X86_SEGMENTS */
- uint32_t gs;
- uint32_t fs;
- uint32_t es;
- uint32_t ds;
- /* The next 6 registers are included with MD_CONTEXT_X86_INTEGER */
- uint32_t edi;
- uint32_t esi;
- uint32_t ebx;
- uint32_t edx;
- uint32_t ecx;
- uint32_t eax;
-
- /* The next 6 registers are included with MD_CONTEXT_X86_CONTROL */
- uint32_t ebp;
- uint32_t eip;
- uint32_t cs; /* WinNT.h says "must be sanitized" */
- uint32_t eflags; /* WinNT.h says "must be sanitized" */
- uint32_t esp;
- uint32_t ss;
-
- /* The next field is included with MD_CONTEXT_X86_EXTENDED_REGISTERS.
- * It contains vector (MMX/SSE) registers. It it laid out in the
- * format used by the fxsave and fsrstor instructions, so it includes
- * a copy of the x87 floating-point registers as well. See FXSAVE in
- * "Intel Architecture Software Developer's Manual, Volume 2." */
- uint8_t extended_registers[
- MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE];
-} MDRawContextX86; /* CONTEXT */
-
-/* For (MDRawContextX86).context_flags. These values indicate the type of
- * context stored in the structure. The high 24 bits identify the CPU, the
- * low 8 bits identify the type of context saved. */
-#define MD_CONTEXT_X86 0x00010000
- /* CONTEXT_i386, CONTEXT_i486: identifies CPU */
-#define MD_CONTEXT_X86_CONTROL (MD_CONTEXT_X86 | 0x00000001)
- /* CONTEXT_CONTROL */
-#define MD_CONTEXT_X86_INTEGER (MD_CONTEXT_X86 | 0x00000002)
- /* CONTEXT_INTEGER */
-#define MD_CONTEXT_X86_SEGMENTS (MD_CONTEXT_X86 | 0x00000004)
- /* CONTEXT_SEGMENTS */
-#define MD_CONTEXT_X86_FLOATING_POINT (MD_CONTEXT_X86 | 0x00000008)
- /* CONTEXT_FLOATING_POINT */
-#define MD_CONTEXT_X86_DEBUG_REGISTERS (MD_CONTEXT_X86 | 0x00000010)
- /* CONTEXT_DEBUG_REGISTERS */
-#define MD_CONTEXT_X86_EXTENDED_REGISTERS (MD_CONTEXT_X86 | 0x00000020)
- /* CONTEXT_EXTENDED_REGISTERS */
-#define MD_CONTEXT_X86_XSTATE (MD_CONTEXT_X86 | 0x00000040)
- /* CONTEXT_XSTATE */
-
-#define MD_CONTEXT_X86_FULL (MD_CONTEXT_X86_CONTROL | \
- MD_CONTEXT_X86_INTEGER | \
- MD_CONTEXT_X86_SEGMENTS)
- /* CONTEXT_FULL */
-
-#define MD_CONTEXT_X86_ALL (MD_CONTEXT_X86_FULL | \
- MD_CONTEXT_X86_FLOATING_POINT | \
- MD_CONTEXT_X86_DEBUG_REGISTERS | \
- MD_CONTEXT_X86_EXTENDED_REGISTERS)
- /* CONTEXT_ALL */
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_CPU_X86_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_linux.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_linux.h
deleted file mode 100644
index 9e7e4f1e12..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_linux.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_exception_linux.h: A definition of exception codes for
- * Linux
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * Author: Mark Mentovai
- * Split into its own file: Neal Sidhwaney */
-
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-
-/* For (MDException).exception_code. These values come from bits/signum.h.
- */
-typedef enum {
- MD_EXCEPTION_CODE_LIN_SIGHUP = 1, /* Hangup (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGINT = 2, /* Interrupt (ANSI) */
- MD_EXCEPTION_CODE_LIN_SIGQUIT = 3, /* Quit (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGILL = 4, /* Illegal instruction (ANSI) */
- MD_EXCEPTION_CODE_LIN_SIGTRAP = 5, /* Trace trap (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGABRT = 6, /* Abort (ANSI) */
- MD_EXCEPTION_CODE_LIN_SIGBUS = 7, /* BUS error (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGFPE = 8, /* Floating-point exception (ANSI) */
- MD_EXCEPTION_CODE_LIN_SIGKILL = 9, /* Kill, unblockable (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGUSR1 = 10, /* User-defined signal 1 (POSIX). */
- MD_EXCEPTION_CODE_LIN_SIGSEGV = 11, /* Segmentation violation (ANSI) */
- MD_EXCEPTION_CODE_LIN_SIGUSR2 = 12, /* User-defined signal 2 (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGPIPE = 13, /* Broken pipe (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGALRM = 14, /* Alarm clock (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGTERM = 15, /* Termination (ANSI) */
- MD_EXCEPTION_CODE_LIN_SIGSTKFLT = 16, /* Stack faultd */
- MD_EXCEPTION_CODE_LIN_SIGCHLD = 17, /* Child status has changed (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGCONT = 18, /* Continue (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGSTOP = 19, /* Stop, unblockable (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGTSTP = 20, /* Keyboard stop (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGTTIN = 21, /* Background read from tty (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGTTOU = 22, /* Background write to tty (POSIX) */
- MD_EXCEPTION_CODE_LIN_SIGURG = 23,
- /* Urgent condition on socket (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGXCPU = 24, /* CPU limit exceeded (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGXFSZ = 25,
- /* File size limit exceeded (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGVTALRM = 26, /* Virtual alarm clock (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGPROF = 27, /* Profiling alarm clock (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGWINCH = 28, /* Window size change (4.3 BSD, Sun) */
- MD_EXCEPTION_CODE_LIN_SIGIO = 29, /* I/O now possible (4.2 BSD) */
- MD_EXCEPTION_CODE_LIN_SIGPWR = 30, /* Power failure restart (System V) */
- MD_EXCEPTION_CODE_LIN_SIGSYS = 31, /* Bad system call */
- MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF /* No exception,
- dump requested. */
-} MDExceptionCodeLinux;
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_LINUX_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_mac.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_mac.h
deleted file mode 100644
index 91c1c09746..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_mac.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_exception_mac.h: A definition of exception codes for Mac
- * OS X
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * Author: Mark Mentovai
- * Split into its own file: Neal Sidhwaney */
-
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_H__
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-/* For (MDException).exception_code. Breakpad minidump extension for Mac OS X
- * support. Based on Darwin/Mac OS X' mach/exception_types.h. This is
- * what Mac OS X calls an "exception", not a "code". */
-typedef enum {
- /* Exception code. The high 16 bits of exception_code contains one of
- * these values. */
- MD_EXCEPTION_MAC_BAD_ACCESS = 1, /* code can be a kern_return_t */
- /* EXC_BAD_ACCESS */
- MD_EXCEPTION_MAC_BAD_INSTRUCTION = 2, /* code is CPU-specific */
- /* EXC_BAD_INSTRUCTION */
- MD_EXCEPTION_MAC_ARITHMETIC = 3, /* code is CPU-specific */
- /* EXC_ARITHMETIC */
- MD_EXCEPTION_MAC_EMULATION = 4, /* code is CPU-specific */
- /* EXC_EMULATION */
- MD_EXCEPTION_MAC_SOFTWARE = 5,
- /* EXC_SOFTWARE */
- MD_EXCEPTION_MAC_BREAKPOINT = 6, /* code is CPU-specific */
- /* EXC_BREAKPOINT */
- MD_EXCEPTION_MAC_SYSCALL = 7,
- /* EXC_SYSCALL */
- MD_EXCEPTION_MAC_MACH_SYSCALL = 8,
- /* EXC_MACH_SYSCALL */
- MD_EXCEPTION_MAC_RPC_ALERT = 9
- /* EXC_RPC_ALERT */
-} MDExceptionMac;
-
-/* For (MDException).exception_flags. Breakpad minidump extension for Mac OS X
- * support. Based on Darwin/Mac OS X' mach/ppc/exception.h and
- * mach/i386/exception.h. This is what Mac OS X calls a "code". */
-typedef enum {
- /* With MD_EXCEPTION_BAD_ACCESS. These are relevant kern_return_t values
- * from mach/kern_return.h. */
- MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS = 1,
- /* KERN_INVALID_ADDRESS */
- MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE = 2,
- /* KERN_PROTECTION_FAILURE */
- MD_EXCEPTION_CODE_MAC_NO_ACCESS = 8,
- /* KERN_NO_ACCESS */
- MD_EXCEPTION_CODE_MAC_MEMORY_FAILURE = 9,
- /* KERN_MEMORY_FAILURE */
- MD_EXCEPTION_CODE_MAC_MEMORY_ERROR = 10,
- /* KERN_MEMORY_ERROR */
-
- /* With MD_EXCEPTION_SOFTWARE */
- MD_EXCEPTION_CODE_MAC_BAD_SYSCALL = 0x00010000, /* Mach SIGSYS */
- MD_EXCEPTION_CODE_MAC_BAD_PIPE = 0x00010001, /* Mach SIGPIPE */
- MD_EXCEPTION_CODE_MAC_ABORT = 0x00010002, /* Mach SIGABRT */
- /* Custom values */
- MD_EXCEPTION_CODE_MAC_NS_EXCEPTION = 0xDEADC0DE, /* uncaught NSException */
-
- /* With MD_EXCEPTION_MAC_BAD_ACCESS on arm */
- MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN = 0x0101, /* EXC_ARM_DA_ALIGN */
- MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG = 0x0102, /* EXC_ARM_DA_DEBUG */
-
- /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on arm */
- MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED = 1, /* EXC_ARM_UNDEFINED */
-
- /* With MD_EXCEPTION_MAC_BREAKPOINT on arm */
- MD_EXCEPTION_CODE_MAC_ARM_BREAKPOINT = 1, /* EXC_ARM_BREAKPOINT */
-
- /* With MD_EXCEPTION_MAC_BAD_ACCESS on ppc */
- MD_EXCEPTION_CODE_MAC_PPC_VM_PROT_READ = 0x0101,
- /* EXC_PPC_VM_PROT_READ */
- MD_EXCEPTION_CODE_MAC_PPC_BADSPACE = 0x0102,
- /* EXC_PPC_BADSPACE */
- MD_EXCEPTION_CODE_MAC_PPC_UNALIGNED = 0x0103,
- /* EXC_PPC_UNALIGNED */
-
- /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on ppc */
- MD_EXCEPTION_CODE_MAC_PPC_INVALID_SYSCALL = 1,
- /* EXC_PPC_INVALID_SYSCALL */
- MD_EXCEPTION_CODE_MAC_PPC_UNIMPLEMENTED_INSTRUCTION = 2,
- /* EXC_PPC_UNIPL_INST */
- MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_INSTRUCTION = 3,
- /* EXC_PPC_PRIVINST */
- MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_REGISTER = 4,
- /* EXC_PPC_PRIVREG */
- MD_EXCEPTION_CODE_MAC_PPC_TRACE = 5,
- /* EXC_PPC_TRACE */
- MD_EXCEPTION_CODE_MAC_PPC_PERFORMANCE_MONITOR = 6,
- /* EXC_PPC_PERFMON */
-
- /* With MD_EXCEPTION_MAC_ARITHMETIC on ppc */
- MD_EXCEPTION_CODE_MAC_PPC_OVERFLOW = 1,
- /* EXC_PPC_OVERFLOW */
- MD_EXCEPTION_CODE_MAC_PPC_ZERO_DIVIDE = 2,
- /* EXC_PPC_ZERO_DIVIDE */
- MD_EXCEPTION_CODE_MAC_PPC_FLOAT_INEXACT = 3,
- /* EXC_FLT_INEXACT */
- MD_EXCEPTION_CODE_MAC_PPC_FLOAT_ZERO_DIVIDE = 4,
- /* EXC_PPC_FLT_ZERO_DIVIDE */
- MD_EXCEPTION_CODE_MAC_PPC_FLOAT_UNDERFLOW = 5,
- /* EXC_PPC_FLT_UNDERFLOW */
- MD_EXCEPTION_CODE_MAC_PPC_FLOAT_OVERFLOW = 6,
- /* EXC_PPC_FLT_OVERFLOW */
- MD_EXCEPTION_CODE_MAC_PPC_FLOAT_NOT_A_NUMBER = 7,
- /* EXC_PPC_FLT_NOT_A_NUMBER */
-
- /* With MD_EXCEPTION_MAC_EMULATION on ppc */
- MD_EXCEPTION_CODE_MAC_PPC_NO_EMULATION = 8,
- /* EXC_PPC_NOEMULATION */
- MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST = 9,
- /* EXC_PPC_ALTIVECASSIST */
-
- /* With MD_EXCEPTION_MAC_SOFTWARE on ppc */
- MD_EXCEPTION_CODE_MAC_PPC_TRAP = 0x00000001, /* EXC_PPC_TRAP */
- MD_EXCEPTION_CODE_MAC_PPC_MIGRATE = 0x00010100, /* EXC_PPC_MIGRATE */
-
- /* With MD_EXCEPTION_MAC_BREAKPOINT on ppc */
- MD_EXCEPTION_CODE_MAC_PPC_BREAKPOINT = 1, /* EXC_PPC_BREAKPOINT */
-
- /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86, see also x86 interrupt
- * values below. */
- MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION = 1, /* EXC_I386_INVOP */
-
- /* With MD_EXCEPTION_MAC_ARITHMETIC on x86 */
- MD_EXCEPTION_CODE_MAC_X86_DIV = 1, /* EXC_I386_DIV */
- MD_EXCEPTION_CODE_MAC_X86_INTO = 2, /* EXC_I386_INTO */
- MD_EXCEPTION_CODE_MAC_X86_NOEXT = 3, /* EXC_I386_NOEXT */
- MD_EXCEPTION_CODE_MAC_X86_EXTOVR = 4, /* EXC_I386_EXTOVR */
- MD_EXCEPTION_CODE_MAC_X86_EXTERR = 5, /* EXC_I386_EXTERR */
- MD_EXCEPTION_CODE_MAC_X86_EMERR = 6, /* EXC_I386_EMERR */
- MD_EXCEPTION_CODE_MAC_X86_BOUND = 7, /* EXC_I386_BOUND */
- MD_EXCEPTION_CODE_MAC_X86_SSEEXTERR = 8, /* EXC_I386_SSEEXTERR */
-
- /* With MD_EXCEPTION_MAC_BREAKPOINT on x86 */
- MD_EXCEPTION_CODE_MAC_X86_SGL = 1, /* EXC_I386_SGL */
- MD_EXCEPTION_CODE_MAC_X86_BPT = 2, /* EXC_I386_BPT */
-
- /* With MD_EXCEPTION_MAC_BAD_INSTRUCTION on x86. These are the raw
- * x86 interrupt codes. Most of these are mapped to other Mach
- * exceptions and codes, are handled, or should not occur in user space.
- * A few of these will do occur with MD_EXCEPTION_MAC_BAD_INSTRUCTION. */
- /* EXC_I386_DIVERR = 0: mapped to EXC_ARITHMETIC/EXC_I386_DIV */
- /* EXC_I386_SGLSTP = 1: mapped to EXC_BREAKPOINT/EXC_I386_SGL */
- /* EXC_I386_NMIFLT = 2: should not occur in user space */
- /* EXC_I386_BPTFLT = 3: mapped to EXC_BREAKPOINT/EXC_I386_BPT */
- /* EXC_I386_INTOFLT = 4: mapped to EXC_ARITHMETIC/EXC_I386_INTO */
- /* EXC_I386_BOUNDFLT = 5: mapped to EXC_ARITHMETIC/EXC_I386_BOUND */
- /* EXC_I386_INVOPFLT = 6: mapped to EXC_BAD_INSTRUCTION/EXC_I386_INVOP */
- /* EXC_I386_NOEXTFLT = 7: should be handled by the kernel */
- /* EXC_I386_DBLFLT = 8: should be handled (if possible) by the kernel */
- /* EXC_I386_EXTOVRFLT = 9: mapped to EXC_BAD_ACCESS/(PROT_READ|PROT_EXEC) */
- MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT = 10,
- /* EXC_INVTSSFLT */
- MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT = 11,
- /* EXC_SEGNPFLT */
- MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT = 12,
- /* EXC_STKFLT */
- MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT = 13,
- /* EXC_GPFLT */
- /* EXC_I386_PGFLT = 14: should not occur in user space */
- /* EXC_I386_EXTERRFLT = 16: mapped to EXC_ARITHMETIC/EXC_I386_EXTERR */
- MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT = 17
- /* EXC_ALIGNFLT (for vector operations) */
- /* EXC_I386_ENOEXTFLT = 32: should be handled by the kernel */
- /* EXC_I386_ENDPERR = 33: should not occur */
-} MDExceptionCodeMac;
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_MAC_OSX_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_ps3.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_ps3.h
deleted file mode 100644
index adff5a6bbc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_ps3.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (c) 2013, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_exception_ps3.h: A definition of exception codes for
- * PS3 */
-
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-typedef enum {
- MD_EXCEPTION_CODE_PS3_UNKNOWN = 0,
- MD_EXCEPTION_CODE_PS3_TRAP_EXCEP = 1,
- MD_EXCEPTION_CODE_PS3_PRIV_INSTR = 2,
- MD_EXCEPTION_CODE_PS3_ILLEGAL_INSTR = 3,
- MD_EXCEPTION_CODE_PS3_INSTR_STORAGE = 4,
- MD_EXCEPTION_CODE_PS3_INSTR_SEGMENT = 5,
- MD_EXCEPTION_CODE_PS3_DATA_STORAGE = 6,
- MD_EXCEPTION_CODE_PS3_DATA_SEGMENT = 7,
- MD_EXCEPTION_CODE_PS3_FLOAT_POINT = 8,
- MD_EXCEPTION_CODE_PS3_DABR_MATCH = 9,
- MD_EXCEPTION_CODE_PS3_ALIGN_EXCEP = 10,
- MD_EXCEPTION_CODE_PS3_MEMORY_ACCESS = 11,
- MD_EXCEPTION_CODE_PS3_COPRO_ALIGN = 12,
- MD_EXCEPTION_CODE_PS3_COPRO_INVALID_COM = 13,
- MD_EXCEPTION_CODE_PS3_COPRO_ERR = 14,
- MD_EXCEPTION_CODE_PS3_COPRO_FIR = 15,
- MD_EXCEPTION_CODE_PS3_COPRO_DATA_SEGMENT = 16,
- MD_EXCEPTION_CODE_PS3_COPRO_DATA_STORAGE = 17,
- MD_EXCEPTION_CODE_PS3_COPRO_STOP_INSTR = 18,
- MD_EXCEPTION_CODE_PS3_COPRO_HALT_INSTR = 19,
- MD_EXCEPTION_CODE_PS3_COPRO_HALTINST_UNKNOWN = 20,
- MD_EXCEPTION_CODE_PS3_COPRO_MEMORY_ACCESS = 21,
- MD_EXCEPTION_CODE_PS3_GRAPHIC = 22
-} MDExceptionCodePS3;
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_PS3_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_solaris.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_solaris.h
deleted file mode 100644
index f18ddf4247..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_solaris.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_exception_solaris.h: A definition of exception codes for
- * Solaris
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * Author: Mark Mentovai
- * Split into its own file: Neal Sidhwaney */
-
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-/* For (MDException).exception_code. These values come from sys/iso/signal_iso.h
- */
-typedef enum {
- MD_EXCEPTION_CODE_SOL_SIGHUP = 1, /* Hangup */
- MD_EXCEPTION_CODE_SOL_SIGINT = 2, /* interrupt (rubout) */
- MD_EXCEPTION_CODE_SOL_SIGQUIT = 3, /* quit (ASCII FS) */
- MD_EXCEPTION_CODE_SOL_SIGILL = 4, /* illegal instruction (not reset when caught) */
- MD_EXCEPTION_CODE_SOL_SIGTRAP = 5, /* trace trap (not reset when caught) */
- MD_EXCEPTION_CODE_SOL_SIGIOT = 6, /* IOT instruction */
- MD_EXCEPTION_CODE_SOL_SIGABRT = 6, /* used by abort, replace SIGIOT in the future */
- MD_EXCEPTION_CODE_SOL_SIGEMT = 7, /* EMT instruction */
- MD_EXCEPTION_CODE_SOL_SIGFPE = 8, /* floating point exception */
- MD_EXCEPTION_CODE_SOL_SIGKILL = 9, /* kill (cannot be caught or ignored) */
- MD_EXCEPTION_CODE_SOL_SIGBUS = 10, /* bus error */
- MD_EXCEPTION_CODE_SOL_SIGSEGV = 11, /* segmentation violation */
- MD_EXCEPTION_CODE_SOL_SIGSYS = 12, /* bad argument to system call */
- MD_EXCEPTION_CODE_SOL_SIGPIPE = 13, /* write on a pipe with no one to read it */
- MD_EXCEPTION_CODE_SOL_SIGALRM = 14, /* alarm clock */
- MD_EXCEPTION_CODE_SOL_SIGTERM = 15, /* software termination signal from kill */
- MD_EXCEPTION_CODE_SOL_SIGUSR1 = 16, /* user defined signal 1 */
- MD_EXCEPTION_CODE_SOL_SIGUSR2 = 17, /* user defined signal 2 */
- MD_EXCEPTION_CODE_SOL_SIGCLD = 18, /* child status change */
- MD_EXCEPTION_CODE_SOL_SIGCHLD = 18, /* child status change alias (POSIX) */
- MD_EXCEPTION_CODE_SOL_SIGPWR = 19, /* power-fail restart */
- MD_EXCEPTION_CODE_SOL_SIGWINCH = 20, /* window size change */
- MD_EXCEPTION_CODE_SOL_SIGURG = 21, /* urgent socket condition */
- MD_EXCEPTION_CODE_SOL_SIGPOLL = 22, /* pollable event occurred */
- MD_EXCEPTION_CODE_SOL_SIGIO = 22, /* socket I/O possible (SIGPOLL alias) */
- MD_EXCEPTION_CODE_SOL_SIGSTOP = 23, /* stop (cannot be caught or ignored) */
- MD_EXCEPTION_CODE_SOL_SIGTSTP = 24, /* user stop requested from tty */
- MD_EXCEPTION_CODE_SOL_SIGCONT = 25, /* stopped process has been continued */
- MD_EXCEPTION_CODE_SOL_SIGTTIN = 26, /* background tty read attempted */
- MD_EXCEPTION_CODE_SOL_SIGTTOU = 27, /* background tty write attempted */
- MD_EXCEPTION_CODE_SOL_SIGVTALRM = 28, /* virtual timer expired */
- MD_EXCEPTION_CODE_SOL_SIGPROF = 29, /* profiling timer expired */
- MD_EXCEPTION_CODE_SOL_SIGXCPU = 30, /* exceeded cpu limit */
- MD_EXCEPTION_CODE_SOL_SIGXFSZ = 31, /* exceeded file size limit */
- MD_EXCEPTION_CODE_SOL_SIGWAITING = 32, /* reserved signal no longer used by threading code */
- MD_EXCEPTION_CODE_SOL_SIGLWP = 33, /* reserved signal no longer used by threading code */
- MD_EXCEPTION_CODE_SOL_SIGFREEZE = 34, /* special signal used by CPR */
- MD_EXCEPTION_CODE_SOL_SIGTHAW = 35, /* special signal used by CPR */
- MD_EXCEPTION_CODE_SOL_SIGCANCEL = 36, /* reserved signal for thread cancellation */
- MD_EXCEPTION_CODE_SOL_SIGLOST = 37, /* resource lost (eg, record-lock lost) */
- MD_EXCEPTION_CODE_SOL_SIGXRES = 38, /* resource control exceeded */
- MD_EXCEPTION_CODE_SOL_SIGJVM1 = 39, /* reserved signal for Java Virtual Machine */
- MD_EXCEPTION_CODE_SOL_SIGJVM2 = 40 /* reserved signal for Java Virtual Machine */
-} MDExceptionCodeSolaris;
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_SOLARIS_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_win32.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_win32.h
deleted file mode 100644
index 6fa3fba444..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_exception_win32.h
+++ /dev/null
@@ -1,2264 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_exception_win32.h: Definitions of exception codes for
- * Win32 platform
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * Author: Mark Mentovai
- * Split into its own file: Neal Sidhwaney */
-
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-
-/* For (MDException).exception_code. These values come from WinBase.h
- * and WinNT.h (names beginning with EXCEPTION_ are in WinBase.h,
- * they are STATUS_ in WinNT.h). */
-typedef enum {
- MD_EXCEPTION_CODE_WIN_CONTROL_C = 0x40010005,
- /* DBG_CONTROL_C */
- MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION = 0x80000001,
- /* EXCEPTION_GUARD_PAGE */
- MD_EXCEPTION_CODE_WIN_DATATYPE_MISALIGNMENT = 0x80000002,
- /* EXCEPTION_DATATYPE_MISALIGNMENT */
- MD_EXCEPTION_CODE_WIN_BREAKPOINT = 0x80000003,
- /* EXCEPTION_BREAKPOINT */
- MD_EXCEPTION_CODE_WIN_SINGLE_STEP = 0x80000004,
- /* EXCEPTION_SINGLE_STEP */
- MD_EXCEPTION_CODE_WIN_ACCESS_VIOLATION = 0xc0000005,
- /* EXCEPTION_ACCESS_VIOLATION */
- MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR = 0xc0000006,
- /* EXCEPTION_IN_PAGE_ERROR */
- MD_EXCEPTION_CODE_WIN_INVALID_HANDLE = 0xc0000008,
- /* EXCEPTION_INVALID_HANDLE */
- MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION = 0xc000001d,
- /* EXCEPTION_ILLEGAL_INSTRUCTION */
- MD_EXCEPTION_CODE_WIN_NONCONTINUABLE_EXCEPTION = 0xc0000025,
- /* EXCEPTION_NONCONTINUABLE_EXCEPTION */
- MD_EXCEPTION_CODE_WIN_INVALID_DISPOSITION = 0xc0000026,
- /* EXCEPTION_INVALID_DISPOSITION */
- MD_EXCEPTION_CODE_WIN_ARRAY_BOUNDS_EXCEEDED = 0xc000008c,
- /* EXCEPTION_BOUNDS_EXCEEDED */
- MD_EXCEPTION_CODE_WIN_FLOAT_DENORMAL_OPERAND = 0xc000008d,
- /* EXCEPTION_FLT_DENORMAL_OPERAND */
- MD_EXCEPTION_CODE_WIN_FLOAT_DIVIDE_BY_ZERO = 0xc000008e,
- /* EXCEPTION_FLT_DIVIDE_BY_ZERO */
- MD_EXCEPTION_CODE_WIN_FLOAT_INEXACT_RESULT = 0xc000008f,
- /* EXCEPTION_FLT_INEXACT_RESULT */
- MD_EXCEPTION_CODE_WIN_FLOAT_INVALID_OPERATION = 0xc0000090,
- /* EXCEPTION_FLT_INVALID_OPERATION */
- MD_EXCEPTION_CODE_WIN_FLOAT_OVERFLOW = 0xc0000091,
- /* EXCEPTION_FLT_OVERFLOW */
- MD_EXCEPTION_CODE_WIN_FLOAT_STACK_CHECK = 0xc0000092,
- /* EXCEPTION_FLT_STACK_CHECK */
- MD_EXCEPTION_CODE_WIN_FLOAT_UNDERFLOW = 0xc0000093,
- /* EXCEPTION_FLT_UNDERFLOW */
- MD_EXCEPTION_CODE_WIN_INTEGER_DIVIDE_BY_ZERO = 0xc0000094,
- /* EXCEPTION_INT_DIVIDE_BY_ZERO */
- MD_EXCEPTION_CODE_WIN_INTEGER_OVERFLOW = 0xc0000095,
- /* EXCEPTION_INT_OVERFLOW */
- MD_EXCEPTION_CODE_WIN_PRIVILEGED_INSTRUCTION = 0xc0000096,
- /* EXCEPTION_PRIV_INSTRUCTION */
- MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW = 0xc00000fd,
- /* EXCEPTION_STACK_OVERFLOW */
- MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK = 0xc0000194,
- /* EXCEPTION_POSSIBLE_DEADLOCK */
- MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN = 0xc0000409,
- /* STATUS_STACK_BUFFER_OVERRUN */
- MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION = 0xc0000374,
- /* STATUS_HEAP_CORRUPTION */
- MD_EXCEPTION_OUT_OF_MEMORY = 0xe0000008,
- /* Exception thrown by Chromium allocators to indicate OOM.
- See base/process/memory.h in Chromium for rationale. */
- MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION = 0xe06d7363
- /* Per http://support.microsoft.com/kb/185294,
- generated by Visual C++ compiler */
-} MDExceptionCodeWin;
-
-
-/* For (MDException).exception_information[2], when (MDException).exception_code
- * is MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR. This describes the underlying reason
- * for the error. These values come from ntstatus.h.
- *
- * The content of this enum was created from ntstatus.h in the 8.1 SDK with
- *
- * egrep '#define [A-Z_0-9]+\s+\(\(NTSTATUS\)0xC[0-9A-F]+L\)' ntstatus.h
- * | tr -d '\r'
- * | sed -r 's@#define ([A-Z_0-9]+)\s+\(\(NTSTATUS\)(0xC[0-9A-F]+)L\).*@\2 \1@'
- * | sort
- * | sed -r 's@(0xC[0-9A-F]+) ([A-Z_0-9]+)@ MD_NTSTATUS_WIN_\2 = \1,@'
- *
- * With easy copy to clipboard with
- * | xclip -selection c # on linux
- * | clip # on windows
- * | pbcopy # on mac
- *
- * and then the last comma manually removed. */
-typedef enum {
- MD_NTSTATUS_WIN_STATUS_UNSUCCESSFUL = 0xC0000001,
- MD_NTSTATUS_WIN_STATUS_NOT_IMPLEMENTED = 0xC0000002,
- MD_NTSTATUS_WIN_STATUS_INVALID_INFO_CLASS = 0xC0000003,
- MD_NTSTATUS_WIN_STATUS_INFO_LENGTH_MISMATCH = 0xC0000004,
- MD_NTSTATUS_WIN_STATUS_ACCESS_VIOLATION = 0xC0000005,
- MD_NTSTATUS_WIN_STATUS_IN_PAGE_ERROR = 0xC0000006,
- MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA = 0xC0000007,
- MD_NTSTATUS_WIN_STATUS_INVALID_HANDLE = 0xC0000008,
- MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_STACK = 0xC0000009,
- MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_PC = 0xC000000A,
- MD_NTSTATUS_WIN_STATUS_INVALID_CID = 0xC000000B,
- MD_NTSTATUS_WIN_STATUS_TIMER_NOT_CANCELED = 0xC000000C,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER = 0xC000000D,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_DEVICE = 0xC000000E,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_FILE = 0xC000000F,
- MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_REQUEST = 0xC0000010,
- MD_NTSTATUS_WIN_STATUS_END_OF_FILE = 0xC0000011,
- MD_NTSTATUS_WIN_STATUS_WRONG_VOLUME = 0xC0000012,
- MD_NTSTATUS_WIN_STATUS_NO_MEDIA_IN_DEVICE = 0xC0000013,
- MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_MEDIA = 0xC0000014,
- MD_NTSTATUS_WIN_STATUS_NONEXISTENT_SECTOR = 0xC0000015,
- MD_NTSTATUS_WIN_STATUS_MORE_PROCESSING_REQUIRED = 0xC0000016,
- MD_NTSTATUS_WIN_STATUS_NO_MEMORY = 0xC0000017,
- MD_NTSTATUS_WIN_STATUS_CONFLICTING_ADDRESSES = 0xC0000018,
- MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_VIEW = 0xC0000019,
- MD_NTSTATUS_WIN_STATUS_UNABLE_TO_FREE_VM = 0xC000001A,
- MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DELETE_SECTION = 0xC000001B,
- MD_NTSTATUS_WIN_STATUS_INVALID_SYSTEM_SERVICE = 0xC000001C,
- MD_NTSTATUS_WIN_STATUS_ILLEGAL_INSTRUCTION = 0xC000001D,
- MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_SEQUENCE = 0xC000001E,
- MD_NTSTATUS_WIN_STATUS_INVALID_VIEW_SIZE = 0xC000001F,
- MD_NTSTATUS_WIN_STATUS_INVALID_FILE_FOR_SECTION = 0xC0000020,
- MD_NTSTATUS_WIN_STATUS_ALREADY_COMMITTED = 0xC0000021,
- MD_NTSTATUS_WIN_STATUS_ACCESS_DENIED = 0xC0000022,
- MD_NTSTATUS_WIN_STATUS_BUFFER_TOO_SMALL = 0xC0000023,
- MD_NTSTATUS_WIN_STATUS_OBJECT_TYPE_MISMATCH = 0xC0000024,
- MD_NTSTATUS_WIN_STATUS_NONCONTINUABLE_EXCEPTION = 0xC0000025,
- MD_NTSTATUS_WIN_STATUS_INVALID_DISPOSITION = 0xC0000026,
- MD_NTSTATUS_WIN_STATUS_UNWIND = 0xC0000027,
- MD_NTSTATUS_WIN_STATUS_BAD_STACK = 0xC0000028,
- MD_NTSTATUS_WIN_STATUS_INVALID_UNWIND_TARGET = 0xC0000029,
- MD_NTSTATUS_WIN_STATUS_NOT_LOCKED = 0xC000002A,
- MD_NTSTATUS_WIN_STATUS_PARITY_ERROR = 0xC000002B,
- MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DECOMMIT_VM = 0xC000002C,
- MD_NTSTATUS_WIN_STATUS_NOT_COMMITTED = 0xC000002D,
- MD_NTSTATUS_WIN_STATUS_INVALID_PORT_ATTRIBUTES = 0xC000002E,
- MD_NTSTATUS_WIN_STATUS_PORT_MESSAGE_TOO_LONG = 0xC000002F,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_MIX = 0xC0000030,
- MD_NTSTATUS_WIN_STATUS_INVALID_QUOTA_LOWER = 0xC0000031,
- MD_NTSTATUS_WIN_STATUS_DISK_CORRUPT_ERROR = 0xC0000032,
- MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_INVALID = 0xC0000033,
- MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_NOT_FOUND = 0xC0000034,
- MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_COLLISION = 0xC0000035,
- MD_NTSTATUS_WIN_STATUS_PORT_DISCONNECTED = 0xC0000037,
- MD_NTSTATUS_WIN_STATUS_DEVICE_ALREADY_ATTACHED = 0xC0000038,
- MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_INVALID = 0xC0000039,
- MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_NOT_FOUND = 0xC000003A,
- MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_SYNTAX_BAD = 0xC000003B,
- MD_NTSTATUS_WIN_STATUS_DATA_OVERRUN = 0xC000003C,
- MD_NTSTATUS_WIN_STATUS_DATA_LATE_ERROR = 0xC000003D,
- MD_NTSTATUS_WIN_STATUS_DATA_ERROR = 0xC000003E,
- MD_NTSTATUS_WIN_STATUS_CRC_ERROR = 0xC000003F,
- MD_NTSTATUS_WIN_STATUS_SECTION_TOO_BIG = 0xC0000040,
- MD_NTSTATUS_WIN_STATUS_PORT_CONNECTION_REFUSED = 0xC0000041,
- MD_NTSTATUS_WIN_STATUS_INVALID_PORT_HANDLE = 0xC0000042,
- MD_NTSTATUS_WIN_STATUS_SHARING_VIOLATION = 0xC0000043,
- MD_NTSTATUS_WIN_STATUS_QUOTA_EXCEEDED = 0xC0000044,
- MD_NTSTATUS_WIN_STATUS_INVALID_PAGE_PROTECTION = 0xC0000045,
- MD_NTSTATUS_WIN_STATUS_MUTANT_NOT_OWNED = 0xC0000046,
- MD_NTSTATUS_WIN_STATUS_SEMAPHORE_LIMIT_EXCEEDED = 0xC0000047,
- MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_SET = 0xC0000048,
- MD_NTSTATUS_WIN_STATUS_SECTION_NOT_IMAGE = 0xC0000049,
- MD_NTSTATUS_WIN_STATUS_SUSPEND_COUNT_EXCEEDED = 0xC000004A,
- MD_NTSTATUS_WIN_STATUS_THREAD_IS_TERMINATING = 0xC000004B,
- MD_NTSTATUS_WIN_STATUS_BAD_WORKING_SET_LIMIT = 0xC000004C,
- MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_FILE_MAP = 0xC000004D,
- MD_NTSTATUS_WIN_STATUS_SECTION_PROTECTION = 0xC000004E,
- MD_NTSTATUS_WIN_STATUS_EAS_NOT_SUPPORTED = 0xC000004F,
- MD_NTSTATUS_WIN_STATUS_EA_TOO_LARGE = 0xC0000050,
- MD_NTSTATUS_WIN_STATUS_NONEXISTENT_EA_ENTRY = 0xC0000051,
- MD_NTSTATUS_WIN_STATUS_NO_EAS_ON_FILE = 0xC0000052,
- MD_NTSTATUS_WIN_STATUS_EA_CORRUPT_ERROR = 0xC0000053,
- MD_NTSTATUS_WIN_STATUS_FILE_LOCK_CONFLICT = 0xC0000054,
- MD_NTSTATUS_WIN_STATUS_LOCK_NOT_GRANTED = 0xC0000055,
- MD_NTSTATUS_WIN_STATUS_DELETE_PENDING = 0xC0000056,
- MD_NTSTATUS_WIN_STATUS_CTL_FILE_NOT_SUPPORTED = 0xC0000057,
- MD_NTSTATUS_WIN_STATUS_UNKNOWN_REVISION = 0xC0000058,
- MD_NTSTATUS_WIN_STATUS_REVISION_MISMATCH = 0xC0000059,
- MD_NTSTATUS_WIN_STATUS_INVALID_OWNER = 0xC000005A,
- MD_NTSTATUS_WIN_STATUS_INVALID_PRIMARY_GROUP = 0xC000005B,
- MD_NTSTATUS_WIN_STATUS_NO_IMPERSONATION_TOKEN = 0xC000005C,
- MD_NTSTATUS_WIN_STATUS_CANT_DISABLE_MANDATORY = 0xC000005D,
- MD_NTSTATUS_WIN_STATUS_NO_LOGON_SERVERS = 0xC000005E,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_LOGON_SESSION = 0xC000005F,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_PRIVILEGE = 0xC0000060,
- MD_NTSTATUS_WIN_STATUS_PRIVILEGE_NOT_HELD = 0xC0000061,
- MD_NTSTATUS_WIN_STATUS_INVALID_ACCOUNT_NAME = 0xC0000062,
- MD_NTSTATUS_WIN_STATUS_USER_EXISTS = 0xC0000063,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_USER = 0xC0000064,
- MD_NTSTATUS_WIN_STATUS_GROUP_EXISTS = 0xC0000065,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_GROUP = 0xC0000066,
- MD_NTSTATUS_WIN_STATUS_MEMBER_IN_GROUP = 0xC0000067,
- MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_GROUP = 0xC0000068,
- MD_NTSTATUS_WIN_STATUS_LAST_ADMIN = 0xC0000069,
- MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD = 0xC000006A,
- MD_NTSTATUS_WIN_STATUS_ILL_FORMED_PASSWORD = 0xC000006B,
- MD_NTSTATUS_WIN_STATUS_PASSWORD_RESTRICTION = 0xC000006C,
- MD_NTSTATUS_WIN_STATUS_LOGON_FAILURE = 0xC000006D,
- MD_NTSTATUS_WIN_STATUS_ACCOUNT_RESTRICTION = 0xC000006E,
- MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_HOURS = 0xC000006F,
- MD_NTSTATUS_WIN_STATUS_INVALID_WORKSTATION = 0xC0000070,
- MD_NTSTATUS_WIN_STATUS_PASSWORD_EXPIRED = 0xC0000071,
- MD_NTSTATUS_WIN_STATUS_ACCOUNT_DISABLED = 0xC0000072,
- MD_NTSTATUS_WIN_STATUS_NONE_MAPPED = 0xC0000073,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_LUIDS_REQUESTED = 0xC0000074,
- MD_NTSTATUS_WIN_STATUS_LUIDS_EXHAUSTED = 0xC0000075,
- MD_NTSTATUS_WIN_STATUS_INVALID_SUB_AUTHORITY = 0xC0000076,
- MD_NTSTATUS_WIN_STATUS_INVALID_ACL = 0xC0000077,
- MD_NTSTATUS_WIN_STATUS_INVALID_SID = 0xC0000078,
- MD_NTSTATUS_WIN_STATUS_INVALID_SECURITY_DESCR = 0xC0000079,
- MD_NTSTATUS_WIN_STATUS_PROCEDURE_NOT_FOUND = 0xC000007A,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_FORMAT = 0xC000007B,
- MD_NTSTATUS_WIN_STATUS_NO_TOKEN = 0xC000007C,
- MD_NTSTATUS_WIN_STATUS_BAD_INHERITANCE_ACL = 0xC000007D,
- MD_NTSTATUS_WIN_STATUS_RANGE_NOT_LOCKED = 0xC000007E,
- MD_NTSTATUS_WIN_STATUS_DISK_FULL = 0xC000007F,
- MD_NTSTATUS_WIN_STATUS_SERVER_DISABLED = 0xC0000080,
- MD_NTSTATUS_WIN_STATUS_SERVER_NOT_DISABLED = 0xC0000081,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_GUIDS_REQUESTED = 0xC0000082,
- MD_NTSTATUS_WIN_STATUS_GUIDS_EXHAUSTED = 0xC0000083,
- MD_NTSTATUS_WIN_STATUS_INVALID_ID_AUTHORITY = 0xC0000084,
- MD_NTSTATUS_WIN_STATUS_AGENTS_EXHAUSTED = 0xC0000085,
- MD_NTSTATUS_WIN_STATUS_INVALID_VOLUME_LABEL = 0xC0000086,
- MD_NTSTATUS_WIN_STATUS_SECTION_NOT_EXTENDED = 0xC0000087,
- MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_DATA = 0xC0000088,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_DATA_NOT_FOUND = 0xC0000089,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_TYPE_NOT_FOUND = 0xC000008A,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_NAME_NOT_FOUND = 0xC000008B,
- MD_NTSTATUS_WIN_STATUS_ARRAY_BOUNDS_EXCEEDED = 0xC000008C,
- MD_NTSTATUS_WIN_STATUS_FLOAT_DENORMAL_OPERAND = 0xC000008D,
- MD_NTSTATUS_WIN_STATUS_FLOAT_DIVIDE_BY_ZERO = 0xC000008E,
- MD_NTSTATUS_WIN_STATUS_FLOAT_INEXACT_RESULT = 0xC000008F,
- MD_NTSTATUS_WIN_STATUS_FLOAT_INVALID_OPERATION = 0xC0000090,
- MD_NTSTATUS_WIN_STATUS_FLOAT_OVERFLOW = 0xC0000091,
- MD_NTSTATUS_WIN_STATUS_FLOAT_STACK_CHECK = 0xC0000092,
- MD_NTSTATUS_WIN_STATUS_FLOAT_UNDERFLOW = 0xC0000093,
- MD_NTSTATUS_WIN_STATUS_INTEGER_DIVIDE_BY_ZERO = 0xC0000094,
- MD_NTSTATUS_WIN_STATUS_INTEGER_OVERFLOW = 0xC0000095,
- MD_NTSTATUS_WIN_STATUS_PRIVILEGED_INSTRUCTION = 0xC0000096,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_PAGING_FILES = 0xC0000097,
- MD_NTSTATUS_WIN_STATUS_FILE_INVALID = 0xC0000098,
- MD_NTSTATUS_WIN_STATUS_ALLOTTED_SPACE_EXCEEDED = 0xC0000099,
- MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCES = 0xC000009A,
- MD_NTSTATUS_WIN_STATUS_DFS_EXIT_PATH_FOUND = 0xC000009B,
- MD_NTSTATUS_WIN_STATUS_DEVICE_DATA_ERROR = 0xC000009C,
- MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_CONNECTED = 0xC000009D,
- MD_NTSTATUS_WIN_STATUS_DEVICE_POWER_FAILURE = 0xC000009E,
- MD_NTSTATUS_WIN_STATUS_FREE_VM_NOT_AT_BASE = 0xC000009F,
- MD_NTSTATUS_WIN_STATUS_MEMORY_NOT_ALLOCATED = 0xC00000A0,
- MD_NTSTATUS_WIN_STATUS_WORKING_SET_QUOTA = 0xC00000A1,
- MD_NTSTATUS_WIN_STATUS_MEDIA_WRITE_PROTECTED = 0xC00000A2,
- MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_READY = 0xC00000A3,
- MD_NTSTATUS_WIN_STATUS_INVALID_GROUP_ATTRIBUTES = 0xC00000A4,
- MD_NTSTATUS_WIN_STATUS_BAD_IMPERSONATION_LEVEL = 0xC00000A5,
- MD_NTSTATUS_WIN_STATUS_CANT_OPEN_ANONYMOUS = 0xC00000A6,
- MD_NTSTATUS_WIN_STATUS_BAD_VALIDATION_CLASS = 0xC00000A7,
- MD_NTSTATUS_WIN_STATUS_BAD_TOKEN_TYPE = 0xC00000A8,
- MD_NTSTATUS_WIN_STATUS_BAD_MASTER_BOOT_RECORD = 0xC00000A9,
- MD_NTSTATUS_WIN_STATUS_INSTRUCTION_MISALIGNMENT = 0xC00000AA,
- MD_NTSTATUS_WIN_STATUS_INSTANCE_NOT_AVAILABLE = 0xC00000AB,
- MD_NTSTATUS_WIN_STATUS_PIPE_NOT_AVAILABLE = 0xC00000AC,
- MD_NTSTATUS_WIN_STATUS_INVALID_PIPE_STATE = 0xC00000AD,
- MD_NTSTATUS_WIN_STATUS_PIPE_BUSY = 0xC00000AE,
- MD_NTSTATUS_WIN_STATUS_ILLEGAL_FUNCTION = 0xC00000AF,
- MD_NTSTATUS_WIN_STATUS_PIPE_DISCONNECTED = 0xC00000B0,
- MD_NTSTATUS_WIN_STATUS_PIPE_CLOSING = 0xC00000B1,
- MD_NTSTATUS_WIN_STATUS_PIPE_CONNECTED = 0xC00000B2,
- MD_NTSTATUS_WIN_STATUS_PIPE_LISTENING = 0xC00000B3,
- MD_NTSTATUS_WIN_STATUS_INVALID_READ_MODE = 0xC00000B4,
- MD_NTSTATUS_WIN_STATUS_IO_TIMEOUT = 0xC00000B5,
- MD_NTSTATUS_WIN_STATUS_FILE_FORCED_CLOSED = 0xC00000B6,
- MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STARTED = 0xC00000B7,
- MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STOPPED = 0xC00000B8,
- MD_NTSTATUS_WIN_STATUS_COULD_NOT_INTERPRET = 0xC00000B9,
- MD_NTSTATUS_WIN_STATUS_FILE_IS_A_DIRECTORY = 0xC00000BA,
- MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED = 0xC00000BB,
- MD_NTSTATUS_WIN_STATUS_REMOTE_NOT_LISTENING = 0xC00000BC,
- MD_NTSTATUS_WIN_STATUS_DUPLICATE_NAME = 0xC00000BD,
- MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_PATH = 0xC00000BE,
- MD_NTSTATUS_WIN_STATUS_NETWORK_BUSY = 0xC00000BF,
- MD_NTSTATUS_WIN_STATUS_DEVICE_DOES_NOT_EXIST = 0xC00000C0,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_COMMANDS = 0xC00000C1,
- MD_NTSTATUS_WIN_STATUS_ADAPTER_HARDWARE_ERROR = 0xC00000C2,
- MD_NTSTATUS_WIN_STATUS_INVALID_NETWORK_RESPONSE = 0xC00000C3,
- MD_NTSTATUS_WIN_STATUS_UNEXPECTED_NETWORK_ERROR = 0xC00000C4,
- MD_NTSTATUS_WIN_STATUS_BAD_REMOTE_ADAPTER = 0xC00000C5,
- MD_NTSTATUS_WIN_STATUS_PRINT_QUEUE_FULL = 0xC00000C6,
- MD_NTSTATUS_WIN_STATUS_NO_SPOOL_SPACE = 0xC00000C7,
- MD_NTSTATUS_WIN_STATUS_PRINT_CANCELLED = 0xC00000C8,
- MD_NTSTATUS_WIN_STATUS_NETWORK_NAME_DELETED = 0xC00000C9,
- MD_NTSTATUS_WIN_STATUS_NETWORK_ACCESS_DENIED = 0xC00000CA,
- MD_NTSTATUS_WIN_STATUS_BAD_DEVICE_TYPE = 0xC00000CB,
- MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_NAME = 0xC00000CC,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_NAMES = 0xC00000CD,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_SESSIONS = 0xC00000CE,
- MD_NTSTATUS_WIN_STATUS_SHARING_PAUSED = 0xC00000CF,
- MD_NTSTATUS_WIN_STATUS_REQUEST_NOT_ACCEPTED = 0xC00000D0,
- MD_NTSTATUS_WIN_STATUS_REDIRECTOR_PAUSED = 0xC00000D1,
- MD_NTSTATUS_WIN_STATUS_NET_WRITE_FAULT = 0xC00000D2,
- MD_NTSTATUS_WIN_STATUS_PROFILING_AT_LIMIT = 0xC00000D3,
- MD_NTSTATUS_WIN_STATUS_NOT_SAME_DEVICE = 0xC00000D4,
- MD_NTSTATUS_WIN_STATUS_FILE_RENAMED = 0xC00000D5,
- MD_NTSTATUS_WIN_STATUS_VIRTUAL_CIRCUIT_CLOSED = 0xC00000D6,
- MD_NTSTATUS_WIN_STATUS_NO_SECURITY_ON_OBJECT = 0xC00000D7,
- MD_NTSTATUS_WIN_STATUS_CANT_WAIT = 0xC00000D8,
- MD_NTSTATUS_WIN_STATUS_PIPE_EMPTY = 0xC00000D9,
- MD_NTSTATUS_WIN_STATUS_CANT_ACCESS_DOMAIN_INFO = 0xC00000DA,
- MD_NTSTATUS_WIN_STATUS_CANT_TERMINATE_SELF = 0xC00000DB,
- MD_NTSTATUS_WIN_STATUS_INVALID_SERVER_STATE = 0xC00000DC,
- MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_STATE = 0xC00000DD,
- MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_ROLE = 0xC00000DE,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_DOMAIN = 0xC00000DF,
- MD_NTSTATUS_WIN_STATUS_DOMAIN_EXISTS = 0xC00000E0,
- MD_NTSTATUS_WIN_STATUS_DOMAIN_LIMIT_EXCEEDED = 0xC00000E1,
- MD_NTSTATUS_WIN_STATUS_OPLOCK_NOT_GRANTED = 0xC00000E2,
- MD_NTSTATUS_WIN_STATUS_INVALID_OPLOCK_PROTOCOL = 0xC00000E3,
- MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_CORRUPTION = 0xC00000E4,
- MD_NTSTATUS_WIN_STATUS_INTERNAL_ERROR = 0xC00000E5,
- MD_NTSTATUS_WIN_STATUS_GENERIC_NOT_MAPPED = 0xC00000E6,
- MD_NTSTATUS_WIN_STATUS_BAD_DESCRIPTOR_FORMAT = 0xC00000E7,
- MD_NTSTATUS_WIN_STATUS_INVALID_USER_BUFFER = 0xC00000E8,
- MD_NTSTATUS_WIN_STATUS_UNEXPECTED_IO_ERROR = 0xC00000E9,
- MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_CREATE_ERR = 0xC00000EA,
- MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_MAP_ERROR = 0xC00000EB,
- MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_EXTEND_ERR = 0xC00000EC,
- MD_NTSTATUS_WIN_STATUS_NOT_LOGON_PROCESS = 0xC00000ED,
- MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_EXISTS = 0xC00000EE,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_1 = 0xC00000EF,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_2 = 0xC00000F0,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_3 = 0xC00000F1,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_4 = 0xC00000F2,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_5 = 0xC00000F3,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_6 = 0xC00000F4,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_7 = 0xC00000F5,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_8 = 0xC00000F6,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_9 = 0xC00000F7,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_10 = 0xC00000F8,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_11 = 0xC00000F9,
- MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_12 = 0xC00000FA,
- MD_NTSTATUS_WIN_STATUS_REDIRECTOR_NOT_STARTED = 0xC00000FB,
- MD_NTSTATUS_WIN_STATUS_REDIRECTOR_STARTED = 0xC00000FC,
- MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW = 0xC00000FD,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_PACKAGE = 0xC00000FE,
- MD_NTSTATUS_WIN_STATUS_BAD_FUNCTION_TABLE = 0xC00000FF,
- MD_NTSTATUS_WIN_STATUS_VARIABLE_NOT_FOUND = 0xC0000100,
- MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_EMPTY = 0xC0000101,
- MD_NTSTATUS_WIN_STATUS_FILE_CORRUPT_ERROR = 0xC0000102,
- MD_NTSTATUS_WIN_STATUS_NOT_A_DIRECTORY = 0xC0000103,
- MD_NTSTATUS_WIN_STATUS_BAD_LOGON_SESSION_STATE = 0xC0000104,
- MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_COLLISION = 0xC0000105,
- MD_NTSTATUS_WIN_STATUS_NAME_TOO_LONG = 0xC0000106,
- MD_NTSTATUS_WIN_STATUS_FILES_OPEN = 0xC0000107,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_IN_USE = 0xC0000108,
- MD_NTSTATUS_WIN_STATUS_MESSAGE_NOT_FOUND = 0xC0000109,
- MD_NTSTATUS_WIN_STATUS_PROCESS_IS_TERMINATING = 0xC000010A,
- MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_TYPE = 0xC000010B,
- MD_NTSTATUS_WIN_STATUS_NO_GUID_TRANSLATION = 0xC000010C,
- MD_NTSTATUS_WIN_STATUS_CANNOT_IMPERSONATE = 0xC000010D,
- MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED = 0xC000010E,
- MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_PRESENT = 0xC000010F,
- MD_NTSTATUS_WIN_STATUS_ABIOS_LID_NOT_EXIST = 0xC0000110,
- MD_NTSTATUS_WIN_STATUS_ABIOS_LID_ALREADY_OWNED = 0xC0000111,
- MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_LID_OWNER = 0xC0000112,
- MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_COMMAND = 0xC0000113,
- MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_LID = 0xC0000114,
- MD_NTSTATUS_WIN_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE = 0xC0000115,
- MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_SELECTOR = 0xC0000116,
- MD_NTSTATUS_WIN_STATUS_NO_LDT = 0xC0000117,
- MD_NTSTATUS_WIN_STATUS_INVALID_LDT_SIZE = 0xC0000118,
- MD_NTSTATUS_WIN_STATUS_INVALID_LDT_OFFSET = 0xC0000119,
- MD_NTSTATUS_WIN_STATUS_INVALID_LDT_DESCRIPTOR = 0xC000011A,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NE_FORMAT = 0xC000011B,
- MD_NTSTATUS_WIN_STATUS_RXACT_INVALID_STATE = 0xC000011C,
- MD_NTSTATUS_WIN_STATUS_RXACT_COMMIT_FAILURE = 0xC000011D,
- MD_NTSTATUS_WIN_STATUS_MAPPED_FILE_SIZE_ZERO = 0xC000011E,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_OPENED_FILES = 0xC000011F,
- MD_NTSTATUS_WIN_STATUS_CANCELLED = 0xC0000120,
- MD_NTSTATUS_WIN_STATUS_CANNOT_DELETE = 0xC0000121,
- MD_NTSTATUS_WIN_STATUS_INVALID_COMPUTER_NAME = 0xC0000122,
- MD_NTSTATUS_WIN_STATUS_FILE_DELETED = 0xC0000123,
- MD_NTSTATUS_WIN_STATUS_SPECIAL_ACCOUNT = 0xC0000124,
- MD_NTSTATUS_WIN_STATUS_SPECIAL_GROUP = 0xC0000125,
- MD_NTSTATUS_WIN_STATUS_SPECIAL_USER = 0xC0000126,
- MD_NTSTATUS_WIN_STATUS_MEMBERS_PRIMARY_GROUP = 0xC0000127,
- MD_NTSTATUS_WIN_STATUS_FILE_CLOSED = 0xC0000128,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_THREADS = 0xC0000129,
- MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_PROCESS = 0xC000012A,
- MD_NTSTATUS_WIN_STATUS_TOKEN_ALREADY_IN_USE = 0xC000012B,
- MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA_EXCEEDED = 0xC000012C,
- MD_NTSTATUS_WIN_STATUS_COMMITMENT_LIMIT = 0xC000012D,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_LE_FORMAT = 0xC000012E,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NOT_MZ = 0xC000012F,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_PROTECT = 0xC0000130,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_16 = 0xC0000131,
- MD_NTSTATUS_WIN_STATUS_LOGON_SERVER_CONFLICT = 0xC0000132,
- MD_NTSTATUS_WIN_STATUS_TIME_DIFFERENCE_AT_DC = 0xC0000133,
- MD_NTSTATUS_WIN_STATUS_SYNCHRONIZATION_REQUIRED = 0xC0000134,
- MD_NTSTATUS_WIN_STATUS_DLL_NOT_FOUND = 0xC0000135,
- MD_NTSTATUS_WIN_STATUS_OPEN_FAILED = 0xC0000136,
- MD_NTSTATUS_WIN_STATUS_IO_PRIVILEGE_FAILED = 0xC0000137,
- MD_NTSTATUS_WIN_STATUS_ORDINAL_NOT_FOUND = 0xC0000138,
- MD_NTSTATUS_WIN_STATUS_ENTRYPOINT_NOT_FOUND = 0xC0000139,
- MD_NTSTATUS_WIN_STATUS_CONTROL_C_EXIT = 0xC000013A,
- MD_NTSTATUS_WIN_STATUS_LOCAL_DISCONNECT = 0xC000013B,
- MD_NTSTATUS_WIN_STATUS_REMOTE_DISCONNECT = 0xC000013C,
- MD_NTSTATUS_WIN_STATUS_REMOTE_RESOURCES = 0xC000013D,
- MD_NTSTATUS_WIN_STATUS_LINK_FAILED = 0xC000013E,
- MD_NTSTATUS_WIN_STATUS_LINK_TIMEOUT = 0xC000013F,
- MD_NTSTATUS_WIN_STATUS_INVALID_CONNECTION = 0xC0000140,
- MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS = 0xC0000141,
- MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED = 0xC0000142,
- MD_NTSTATUS_WIN_STATUS_MISSING_SYSTEMFILE = 0xC0000143,
- MD_NTSTATUS_WIN_STATUS_UNHANDLED_EXCEPTION = 0xC0000144,
- MD_NTSTATUS_WIN_STATUS_APP_INIT_FAILURE = 0xC0000145,
- MD_NTSTATUS_WIN_STATUS_PAGEFILE_CREATE_FAILED = 0xC0000146,
- MD_NTSTATUS_WIN_STATUS_NO_PAGEFILE = 0xC0000147,
- MD_NTSTATUS_WIN_STATUS_INVALID_LEVEL = 0xC0000148,
- MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD_CORE = 0xC0000149,
- MD_NTSTATUS_WIN_STATUS_ILLEGAL_FLOAT_CONTEXT = 0xC000014A,
- MD_NTSTATUS_WIN_STATUS_PIPE_BROKEN = 0xC000014B,
- MD_NTSTATUS_WIN_STATUS_REGISTRY_CORRUPT = 0xC000014C,
- MD_NTSTATUS_WIN_STATUS_REGISTRY_IO_FAILED = 0xC000014D,
- MD_NTSTATUS_WIN_STATUS_NO_EVENT_PAIR = 0xC000014E,
- MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_VOLUME = 0xC000014F,
- MD_NTSTATUS_WIN_STATUS_SERIAL_NO_DEVICE_INITED = 0xC0000150,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_ALIAS = 0xC0000151,
- MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_ALIAS = 0xC0000152,
- MD_NTSTATUS_WIN_STATUS_MEMBER_IN_ALIAS = 0xC0000153,
- MD_NTSTATUS_WIN_STATUS_ALIAS_EXISTS = 0xC0000154,
- MD_NTSTATUS_WIN_STATUS_LOGON_NOT_GRANTED = 0xC0000155,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_SECRETS = 0xC0000156,
- MD_NTSTATUS_WIN_STATUS_SECRET_TOO_LONG = 0xC0000157,
- MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_ERROR = 0xC0000158,
- MD_NTSTATUS_WIN_STATUS_FULLSCREEN_MODE = 0xC0000159,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_CONTEXT_IDS = 0xC000015A,
- MD_NTSTATUS_WIN_STATUS_LOGON_TYPE_NOT_GRANTED = 0xC000015B,
- MD_NTSTATUS_WIN_STATUS_NOT_REGISTRY_FILE = 0xC000015C,
- MD_NTSTATUS_WIN_STATUS_NT_CROSS_ENCRYPTION_REQUIRED = 0xC000015D,
- MD_NTSTATUS_WIN_STATUS_DOMAIN_CTRLR_CONFIG_ERROR = 0xC000015E,
- MD_NTSTATUS_WIN_STATUS_FT_MISSING_MEMBER = 0xC000015F,
- MD_NTSTATUS_WIN_STATUS_ILL_FORMED_SERVICE_ENTRY = 0xC0000160,
- MD_NTSTATUS_WIN_STATUS_ILLEGAL_CHARACTER = 0xC0000161,
- MD_NTSTATUS_WIN_STATUS_UNMAPPABLE_CHARACTER = 0xC0000162,
- MD_NTSTATUS_WIN_STATUS_UNDEFINED_CHARACTER = 0xC0000163,
- MD_NTSTATUS_WIN_STATUS_FLOPPY_VOLUME = 0xC0000164,
- MD_NTSTATUS_WIN_STATUS_FLOPPY_ID_MARK_NOT_FOUND = 0xC0000165,
- MD_NTSTATUS_WIN_STATUS_FLOPPY_WRONG_CYLINDER = 0xC0000166,
- MD_NTSTATUS_WIN_STATUS_FLOPPY_UNKNOWN_ERROR = 0xC0000167,
- MD_NTSTATUS_WIN_STATUS_FLOPPY_BAD_REGISTERS = 0xC0000168,
- MD_NTSTATUS_WIN_STATUS_DISK_RECALIBRATE_FAILED = 0xC0000169,
- MD_NTSTATUS_WIN_STATUS_DISK_OPERATION_FAILED = 0xC000016A,
- MD_NTSTATUS_WIN_STATUS_DISK_RESET_FAILED = 0xC000016B,
- MD_NTSTATUS_WIN_STATUS_SHARED_IRQ_BUSY = 0xC000016C,
- MD_NTSTATUS_WIN_STATUS_FT_ORPHANING = 0xC000016D,
- MD_NTSTATUS_WIN_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT = 0xC000016E,
- MD_NTSTATUS_WIN_STATUS_PARTITION_FAILURE = 0xC0000172,
- MD_NTSTATUS_WIN_STATUS_INVALID_BLOCK_LENGTH = 0xC0000173,
- MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_PARTITIONED = 0xC0000174,
- MD_NTSTATUS_WIN_STATUS_UNABLE_TO_LOCK_MEDIA = 0xC0000175,
- MD_NTSTATUS_WIN_STATUS_UNABLE_TO_UNLOAD_MEDIA = 0xC0000176,
- MD_NTSTATUS_WIN_STATUS_EOM_OVERFLOW = 0xC0000177,
- MD_NTSTATUS_WIN_STATUS_NO_MEDIA = 0xC0000178,
- MD_NTSTATUS_WIN_STATUS_NO_SUCH_MEMBER = 0xC000017A,
- MD_NTSTATUS_WIN_STATUS_INVALID_MEMBER = 0xC000017B,
- MD_NTSTATUS_WIN_STATUS_KEY_DELETED = 0xC000017C,
- MD_NTSTATUS_WIN_STATUS_NO_LOG_SPACE = 0xC000017D,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_SIDS = 0xC000017E,
- MD_NTSTATUS_WIN_STATUS_LM_CROSS_ENCRYPTION_REQUIRED = 0xC000017F,
- MD_NTSTATUS_WIN_STATUS_KEY_HAS_CHILDREN = 0xC0000180,
- MD_NTSTATUS_WIN_STATUS_CHILD_MUST_BE_VOLATILE = 0xC0000181,
- MD_NTSTATUS_WIN_STATUS_DEVICE_CONFIGURATION_ERROR = 0xC0000182,
- MD_NTSTATUS_WIN_STATUS_DRIVER_INTERNAL_ERROR = 0xC0000183,
- MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_STATE = 0xC0000184,
- MD_NTSTATUS_WIN_STATUS_IO_DEVICE_ERROR = 0xC0000185,
- MD_NTSTATUS_WIN_STATUS_DEVICE_PROTOCOL_ERROR = 0xC0000186,
- MD_NTSTATUS_WIN_STATUS_BACKUP_CONTROLLER = 0xC0000187,
- MD_NTSTATUS_WIN_STATUS_LOG_FILE_FULL = 0xC0000188,
- MD_NTSTATUS_WIN_STATUS_TOO_LATE = 0xC0000189,
- MD_NTSTATUS_WIN_STATUS_NO_TRUST_LSA_SECRET = 0xC000018A,
- MD_NTSTATUS_WIN_STATUS_NO_TRUST_SAM_ACCOUNT = 0xC000018B,
- MD_NTSTATUS_WIN_STATUS_TRUSTED_DOMAIN_FAILURE = 0xC000018C,
- MD_NTSTATUS_WIN_STATUS_TRUSTED_RELATIONSHIP_FAILURE = 0xC000018D,
- MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CORRUPT = 0xC000018E,
- MD_NTSTATUS_WIN_STATUS_EVENTLOG_CANT_START = 0xC000018F,
- MD_NTSTATUS_WIN_STATUS_TRUST_FAILURE = 0xC0000190,
- MD_NTSTATUS_WIN_STATUS_MUTANT_LIMIT_EXCEEDED = 0xC0000191,
- MD_NTSTATUS_WIN_STATUS_NETLOGON_NOT_STARTED = 0xC0000192,
- MD_NTSTATUS_WIN_STATUS_ACCOUNT_EXPIRED = 0xC0000193,
- MD_NTSTATUS_WIN_STATUS_POSSIBLE_DEADLOCK = 0xC0000194,
- MD_NTSTATUS_WIN_STATUS_NETWORK_CREDENTIAL_CONFLICT = 0xC0000195,
- MD_NTSTATUS_WIN_STATUS_REMOTE_SESSION_LIMIT = 0xC0000196,
- MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CHANGED = 0xC0000197,
- MD_NTSTATUS_WIN_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT = 0xC0000198,
- MD_NTSTATUS_WIN_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT = 0xC0000199,
- MD_NTSTATUS_WIN_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT = 0xC000019A,
- MD_NTSTATUS_WIN_STATUS_DOMAIN_TRUST_INCONSISTENT = 0xC000019B,
- MD_NTSTATUS_WIN_STATUS_FS_DRIVER_REQUIRED = 0xC000019C,
- MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED_AS_DLL = 0xC000019D,
- MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING = 0xC000019E,
- MD_NTSTATUS_WIN_STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME = 0xC000019F,
- MD_NTSTATUS_WIN_STATUS_SECURITY_STREAM_IS_INCONSISTENT = 0xC00001A0,
- MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_RANGE = 0xC00001A1,
- MD_NTSTATUS_WIN_STATUS_INVALID_ACE_CONDITION = 0xC00001A2,
- MD_NTSTATUS_WIN_STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT = 0xC00001A3,
- MD_NTSTATUS_WIN_STATUS_NOTIFICATION_GUID_ALREADY_DEFINED = 0xC00001A4,
- MD_NTSTATUS_WIN_STATUS_INVALID_EXCEPTION_HANDLER = 0xC00001A5,
- MD_NTSTATUS_WIN_STATUS_DUPLICATE_PRIVILEGES = 0xC00001A6,
- MD_NTSTATUS_WIN_STATUS_NOT_ALLOWED_ON_SYSTEM_FILE = 0xC00001A7,
- MD_NTSTATUS_WIN_STATUS_REPAIR_NEEDED = 0xC00001A8,
- MD_NTSTATUS_WIN_STATUS_QUOTA_NOT_ENABLED = 0xC00001A9,
- MD_NTSTATUS_WIN_STATUS_NO_APPLICATION_PACKAGE = 0xC00001AA,
- MD_NTSTATUS_WIN_STATUS_NETWORK_OPEN_RESTRICTION = 0xC0000201,
- MD_NTSTATUS_WIN_STATUS_NO_USER_SESSION_KEY = 0xC0000202,
- MD_NTSTATUS_WIN_STATUS_USER_SESSION_DELETED = 0xC0000203,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_LANG_NOT_FOUND = 0xC0000204,
- MD_NTSTATUS_WIN_STATUS_INSUFF_SERVER_RESOURCES = 0xC0000205,
- MD_NTSTATUS_WIN_STATUS_INVALID_BUFFER_SIZE = 0xC0000206,
- MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_COMPONENT = 0xC0000207,
- MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_WILDCARD = 0xC0000208,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_ADDRESSES = 0xC0000209,
- MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_EXISTS = 0xC000020A,
- MD_NTSTATUS_WIN_STATUS_ADDRESS_CLOSED = 0xC000020B,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_DISCONNECTED = 0xC000020C,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_RESET = 0xC000020D,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_NODES = 0xC000020E,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_ABORTED = 0xC000020F,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_TIMED_OUT = 0xC0000210,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_RELEASE = 0xC0000211,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_MATCH = 0xC0000212,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONDED = 0xC0000213,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_ID = 0xC0000214,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_TYPE = 0xC0000215,
- MD_NTSTATUS_WIN_STATUS_NOT_SERVER_SESSION = 0xC0000216,
- MD_NTSTATUS_WIN_STATUS_NOT_CLIENT_SESSION = 0xC0000217,
- MD_NTSTATUS_WIN_STATUS_CANNOT_LOAD_REGISTRY_FILE = 0xC0000218,
- MD_NTSTATUS_WIN_STATUS_DEBUG_ATTACH_FAILED = 0xC0000219,
- MD_NTSTATUS_WIN_STATUS_SYSTEM_PROCESS_TERMINATED = 0xC000021A,
- MD_NTSTATUS_WIN_STATUS_DATA_NOT_ACCEPTED = 0xC000021B,
- MD_NTSTATUS_WIN_STATUS_NO_BROWSER_SERVERS_FOUND = 0xC000021C,
- MD_NTSTATUS_WIN_STATUS_VDM_HARD_ERROR = 0xC000021D,
- MD_NTSTATUS_WIN_STATUS_DRIVER_CANCEL_TIMEOUT = 0xC000021E,
- MD_NTSTATUS_WIN_STATUS_REPLY_MESSAGE_MISMATCH = 0xC000021F,
- MD_NTSTATUS_WIN_STATUS_MAPPED_ALIGNMENT = 0xC0000220,
- MD_NTSTATUS_WIN_STATUS_IMAGE_CHECKSUM_MISMATCH = 0xC0000221,
- MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA = 0xC0000222,
- MD_NTSTATUS_WIN_STATUS_CLIENT_SERVER_PARAMETERS_INVALID = 0xC0000223,
- MD_NTSTATUS_WIN_STATUS_PASSWORD_MUST_CHANGE = 0xC0000224,
- MD_NTSTATUS_WIN_STATUS_NOT_FOUND = 0xC0000225,
- MD_NTSTATUS_WIN_STATUS_NOT_TINY_STREAM = 0xC0000226,
- MD_NTSTATUS_WIN_STATUS_RECOVERY_FAILURE = 0xC0000227,
- MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW_READ = 0xC0000228,
- MD_NTSTATUS_WIN_STATUS_FAIL_CHECK = 0xC0000229,
- MD_NTSTATUS_WIN_STATUS_DUPLICATE_OBJECTID = 0xC000022A,
- MD_NTSTATUS_WIN_STATUS_OBJECTID_EXISTS = 0xC000022B,
- MD_NTSTATUS_WIN_STATUS_CONVERT_TO_LARGE = 0xC000022C,
- MD_NTSTATUS_WIN_STATUS_RETRY = 0xC000022D,
- MD_NTSTATUS_WIN_STATUS_FOUND_OUT_OF_SCOPE = 0xC000022E,
- MD_NTSTATUS_WIN_STATUS_ALLOCATE_BUCKET = 0xC000022F,
- MD_NTSTATUS_WIN_STATUS_PROPSET_NOT_FOUND = 0xC0000230,
- MD_NTSTATUS_WIN_STATUS_MARSHALL_OVERFLOW = 0xC0000231,
- MD_NTSTATUS_WIN_STATUS_INVALID_VARIANT = 0xC0000232,
- MD_NTSTATUS_WIN_STATUS_DOMAIN_CONTROLLER_NOT_FOUND = 0xC0000233,
- MD_NTSTATUS_WIN_STATUS_ACCOUNT_LOCKED_OUT = 0xC0000234,
- MD_NTSTATUS_WIN_STATUS_HANDLE_NOT_CLOSABLE = 0xC0000235,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_REFUSED = 0xC0000236,
- MD_NTSTATUS_WIN_STATUS_GRACEFUL_DISCONNECT = 0xC0000237,
- MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_ASSOCIATED = 0xC0000238,
- MD_NTSTATUS_WIN_STATUS_ADDRESS_NOT_ASSOCIATED = 0xC0000239,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_INVALID = 0xC000023A,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_ACTIVE = 0xC000023B,
- MD_NTSTATUS_WIN_STATUS_NETWORK_UNREACHABLE = 0xC000023C,
- MD_NTSTATUS_WIN_STATUS_HOST_UNREACHABLE = 0xC000023D,
- MD_NTSTATUS_WIN_STATUS_PROTOCOL_UNREACHABLE = 0xC000023E,
- MD_NTSTATUS_WIN_STATUS_PORT_UNREACHABLE = 0xC000023F,
- MD_NTSTATUS_WIN_STATUS_REQUEST_ABORTED = 0xC0000240,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_ABORTED = 0xC0000241,
- MD_NTSTATUS_WIN_STATUS_BAD_COMPRESSION_BUFFER = 0xC0000242,
- MD_NTSTATUS_WIN_STATUS_USER_MAPPED_FILE = 0xC0000243,
- MD_NTSTATUS_WIN_STATUS_AUDIT_FAILED = 0xC0000244,
- MD_NTSTATUS_WIN_STATUS_TIMER_RESOLUTION_NOT_SET = 0xC0000245,
- MD_NTSTATUS_WIN_STATUS_CONNECTION_COUNT_LIMIT = 0xC0000246,
- MD_NTSTATUS_WIN_STATUS_LOGIN_TIME_RESTRICTION = 0xC0000247,
- MD_NTSTATUS_WIN_STATUS_LOGIN_WKSTA_RESTRICTION = 0xC0000248,
- MD_NTSTATUS_WIN_STATUS_IMAGE_MP_UP_MISMATCH = 0xC0000249,
- MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_LOGON_INFO = 0xC0000250,
- MD_NTSTATUS_WIN_STATUS_BAD_DLL_ENTRYPOINT = 0xC0000251,
- MD_NTSTATUS_WIN_STATUS_BAD_SERVICE_ENTRYPOINT = 0xC0000252,
- MD_NTSTATUS_WIN_STATUS_LPC_REPLY_LOST = 0xC0000253,
- MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT1 = 0xC0000254,
- MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT2 = 0xC0000255,
- MD_NTSTATUS_WIN_STATUS_REGISTRY_QUOTA_LIMIT = 0xC0000256,
- MD_NTSTATUS_WIN_STATUS_PATH_NOT_COVERED = 0xC0000257,
- MD_NTSTATUS_WIN_STATUS_NO_CALLBACK_ACTIVE = 0xC0000258,
- MD_NTSTATUS_WIN_STATUS_LICENSE_QUOTA_EXCEEDED = 0xC0000259,
- MD_NTSTATUS_WIN_STATUS_PWD_TOO_SHORT = 0xC000025A,
- MD_NTSTATUS_WIN_STATUS_PWD_TOO_RECENT = 0xC000025B,
- MD_NTSTATUS_WIN_STATUS_PWD_HISTORY_CONFLICT = 0xC000025C,
- MD_NTSTATUS_WIN_STATUS_PLUGPLAY_NO_DEVICE = 0xC000025E,
- MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_COMPRESSION = 0xC000025F,
- MD_NTSTATUS_WIN_STATUS_INVALID_HW_PROFILE = 0xC0000260,
- MD_NTSTATUS_WIN_STATUS_INVALID_PLUGPLAY_DEVICE_PATH = 0xC0000261,
- MD_NTSTATUS_WIN_STATUS_DRIVER_ORDINAL_NOT_FOUND = 0xC0000262,
- MD_NTSTATUS_WIN_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND = 0xC0000263,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_NOT_OWNED = 0xC0000264,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_LINKS = 0xC0000265,
- MD_NTSTATUS_WIN_STATUS_QUOTA_LIST_INCONSISTENT = 0xC0000266,
- MD_NTSTATUS_WIN_STATUS_FILE_IS_OFFLINE = 0xC0000267,
- MD_NTSTATUS_WIN_STATUS_EVALUATION_EXPIRATION = 0xC0000268,
- MD_NTSTATUS_WIN_STATUS_ILLEGAL_DLL_RELOCATION = 0xC0000269,
- MD_NTSTATUS_WIN_STATUS_LICENSE_VIOLATION = 0xC000026A,
- MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED_LOGOFF = 0xC000026B,
- MD_NTSTATUS_WIN_STATUS_DRIVER_UNABLE_TO_LOAD = 0xC000026C,
- MD_NTSTATUS_WIN_STATUS_DFS_UNAVAILABLE = 0xC000026D,
- MD_NTSTATUS_WIN_STATUS_VOLUME_DISMOUNTED = 0xC000026E,
- MD_NTSTATUS_WIN_STATUS_WX86_INTERNAL_ERROR = 0xC000026F,
- MD_NTSTATUS_WIN_STATUS_WX86_FLOAT_STACK_CHECK = 0xC0000270,
- MD_NTSTATUS_WIN_STATUS_VALIDATE_CONTINUE = 0xC0000271,
- MD_NTSTATUS_WIN_STATUS_NO_MATCH = 0xC0000272,
- MD_NTSTATUS_WIN_STATUS_NO_MORE_MATCHES = 0xC0000273,
- MD_NTSTATUS_WIN_STATUS_NOT_A_REPARSE_POINT = 0xC0000275,
- MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_INVALID = 0xC0000276,
- MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_MISMATCH = 0xC0000277,
- MD_NTSTATUS_WIN_STATUS_IO_REPARSE_DATA_INVALID = 0xC0000278,
- MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_NOT_HANDLED = 0xC0000279,
- MD_NTSTATUS_WIN_STATUS_PWD_TOO_LONG = 0xC000027A,
- MD_NTSTATUS_WIN_STATUS_STOWED_EXCEPTION = 0xC000027B,
- MD_NTSTATUS_WIN_STATUS_REPARSE_POINT_NOT_RESOLVED = 0xC0000280,
- MD_NTSTATUS_WIN_STATUS_DIRECTORY_IS_A_REPARSE_POINT = 0xC0000281,
- MD_NTSTATUS_WIN_STATUS_RANGE_LIST_CONFLICT = 0xC0000282,
- MD_NTSTATUS_WIN_STATUS_SOURCE_ELEMENT_EMPTY = 0xC0000283,
- MD_NTSTATUS_WIN_STATUS_DESTINATION_ELEMENT_FULL = 0xC0000284,
- MD_NTSTATUS_WIN_STATUS_ILLEGAL_ELEMENT_ADDRESS = 0xC0000285,
- MD_NTSTATUS_WIN_STATUS_MAGAZINE_NOT_PRESENT = 0xC0000286,
- MD_NTSTATUS_WIN_STATUS_REINITIALIZATION_NEEDED = 0xC0000287,
- MD_NTSTATUS_WIN_STATUS_ENCRYPTION_FAILED = 0xC000028A,
- MD_NTSTATUS_WIN_STATUS_DECRYPTION_FAILED = 0xC000028B,
- MD_NTSTATUS_WIN_STATUS_RANGE_NOT_FOUND = 0xC000028C,
- MD_NTSTATUS_WIN_STATUS_NO_RECOVERY_POLICY = 0xC000028D,
- MD_NTSTATUS_WIN_STATUS_NO_EFS = 0xC000028E,
- MD_NTSTATUS_WIN_STATUS_WRONG_EFS = 0xC000028F,
- MD_NTSTATUS_WIN_STATUS_NO_USER_KEYS = 0xC0000290,
- MD_NTSTATUS_WIN_STATUS_FILE_NOT_ENCRYPTED = 0xC0000291,
- MD_NTSTATUS_WIN_STATUS_NOT_EXPORT_FORMAT = 0xC0000292,
- MD_NTSTATUS_WIN_STATUS_FILE_ENCRYPTED = 0xC0000293,
- MD_NTSTATUS_WIN_STATUS_WMI_GUID_NOT_FOUND = 0xC0000295,
- MD_NTSTATUS_WIN_STATUS_WMI_INSTANCE_NOT_FOUND = 0xC0000296,
- MD_NTSTATUS_WIN_STATUS_WMI_ITEMID_NOT_FOUND = 0xC0000297,
- MD_NTSTATUS_WIN_STATUS_WMI_TRY_AGAIN = 0xC0000298,
- MD_NTSTATUS_WIN_STATUS_SHARED_POLICY = 0xC0000299,
- MD_NTSTATUS_WIN_STATUS_POLICY_OBJECT_NOT_FOUND = 0xC000029A,
- MD_NTSTATUS_WIN_STATUS_POLICY_ONLY_IN_DS = 0xC000029B,
- MD_NTSTATUS_WIN_STATUS_VOLUME_NOT_UPGRADED = 0xC000029C,
- MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_NOT_ACTIVE = 0xC000029D,
- MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_MEDIA_ERROR = 0xC000029E,
- MD_NTSTATUS_WIN_STATUS_NO_TRACKING_SERVICE = 0xC000029F,
- MD_NTSTATUS_WIN_STATUS_SERVER_SID_MISMATCH = 0xC00002A0,
- MD_NTSTATUS_WIN_STATUS_DS_NO_ATTRIBUTE_OR_VALUE = 0xC00002A1,
- MD_NTSTATUS_WIN_STATUS_DS_INVALID_ATTRIBUTE_SYNTAX = 0xC00002A2,
- MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED = 0xC00002A3,
- MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS = 0xC00002A4,
- MD_NTSTATUS_WIN_STATUS_DS_BUSY = 0xC00002A5,
- MD_NTSTATUS_WIN_STATUS_DS_UNAVAILABLE = 0xC00002A6,
- MD_NTSTATUS_WIN_STATUS_DS_NO_RIDS_ALLOCATED = 0xC00002A7,
- MD_NTSTATUS_WIN_STATUS_DS_NO_MORE_RIDS = 0xC00002A8,
- MD_NTSTATUS_WIN_STATUS_DS_INCORRECT_ROLE_OWNER = 0xC00002A9,
- MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_INIT_ERROR = 0xC00002AA,
- MD_NTSTATUS_WIN_STATUS_DS_OBJ_CLASS_VIOLATION = 0xC00002AB,
- MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_NON_LEAF = 0xC00002AC,
- MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_RDN = 0xC00002AD,
- MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_OBJ_CLASS = 0xC00002AE,
- MD_NTSTATUS_WIN_STATUS_DS_CROSS_DOM_MOVE_FAILED = 0xC00002AF,
- MD_NTSTATUS_WIN_STATUS_DS_GC_NOT_AVAILABLE = 0xC00002B0,
- MD_NTSTATUS_WIN_STATUS_DIRECTORY_SERVICE_REQUIRED = 0xC00002B1,
- MD_NTSTATUS_WIN_STATUS_REPARSE_ATTRIBUTE_CONFLICT = 0xC00002B2,
- MD_NTSTATUS_WIN_STATUS_CANT_ENABLE_DENY_ONLY = 0xC00002B3,
- MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_FAULTS = 0xC00002B4,
- MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_TRAPS = 0xC00002B5,
- MD_NTSTATUS_WIN_STATUS_DEVICE_REMOVED = 0xC00002B6,
- MD_NTSTATUS_WIN_STATUS_JOURNAL_DELETE_IN_PROGRESS = 0xC00002B7,
- MD_NTSTATUS_WIN_STATUS_JOURNAL_NOT_ACTIVE = 0xC00002B8,
- MD_NTSTATUS_WIN_STATUS_NOINTERFACE = 0xC00002B9,
- MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_DISABLED = 0xC00002BA,
- MD_NTSTATUS_WIN_STATUS_DS_ADMIN_LIMIT_EXCEEDED = 0xC00002C1,
- MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_SLEEP = 0xC00002C2,
- MD_NTSTATUS_WIN_STATUS_MUTUAL_AUTHENTICATION_FAILED = 0xC00002C3,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_SYSTEM_FILE = 0xC00002C4,
- MD_NTSTATUS_WIN_STATUS_DATATYPE_MISALIGNMENT_ERROR = 0xC00002C5,
- MD_NTSTATUS_WIN_STATUS_WMI_READ_ONLY = 0xC00002C6,
- MD_NTSTATUS_WIN_STATUS_WMI_SET_FAILURE = 0xC00002C7,
- MD_NTSTATUS_WIN_STATUS_COMMITMENT_MINIMUM = 0xC00002C8,
- MD_NTSTATUS_WIN_STATUS_REG_NAT_CONSUMPTION = 0xC00002C9,
- MD_NTSTATUS_WIN_STATUS_TRANSPORT_FULL = 0xC00002CA,
- MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE = 0xC00002CB,
- MD_NTSTATUS_WIN_STATUS_ONLY_IF_CONNECTED = 0xC00002CC,
- MD_NTSTATUS_WIN_STATUS_DS_SENSITIVE_GROUP_VIOLATION = 0xC00002CD,
- MD_NTSTATUS_WIN_STATUS_PNP_RESTART_ENUMERATION = 0xC00002CE,
- MD_NTSTATUS_WIN_STATUS_JOURNAL_ENTRY_DELETED = 0xC00002CF,
- MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_PRIMARYGROUPID = 0xC00002D0,
- MD_NTSTATUS_WIN_STATUS_SYSTEM_IMAGE_BAD_SIGNATURE = 0xC00002D1,
- MD_NTSTATUS_WIN_STATUS_PNP_REBOOT_REQUIRED = 0xC00002D2,
- MD_NTSTATUS_WIN_STATUS_POWER_STATE_INVALID = 0xC00002D3,
- MD_NTSTATUS_WIN_STATUS_DS_INVALID_GROUP_TYPE = 0xC00002D4,
- MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN = 0xC00002D5,
- MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN = 0xC00002D6,
- MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER = 0xC00002D7,
- MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER = 0xC00002D8,
- MD_NTSTATUS_WIN_STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER = 0xC00002D9,
- MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER = 0xC00002DA,
- MD_NTSTATUS_WIN_STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER = 0xC00002DB,
- MD_NTSTATUS_WIN_STATUS_DS_HAVE_PRIMARY_MEMBERS = 0xC00002DC,
- MD_NTSTATUS_WIN_STATUS_WMI_NOT_SUPPORTED = 0xC00002DD,
- MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_POWER = 0xC00002DE,
- MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_PASSWORD = 0xC00002DF,
- MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_FLOPPY = 0xC00002E0,
- MD_NTSTATUS_WIN_STATUS_DS_CANT_START = 0xC00002E1,
- MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE = 0xC00002E2,
- MD_NTSTATUS_WIN_STATUS_SAM_INIT_FAILURE = 0xC00002E3,
- MD_NTSTATUS_WIN_STATUS_DS_GC_REQUIRED = 0xC00002E4,
- MD_NTSTATUS_WIN_STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY = 0xC00002E5,
- MD_NTSTATUS_WIN_STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS = 0xC00002E6,
- MD_NTSTATUS_WIN_STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED = 0xC00002E7,
- MD_NTSTATUS_WIN_STATUS_MULTIPLE_FAULT_VIOLATION = 0xC00002E8,
- MD_NTSTATUS_WIN_STATUS_CURRENT_DOMAIN_NOT_ALLOWED = 0xC00002E9,
- MD_NTSTATUS_WIN_STATUS_CANNOT_MAKE = 0xC00002EA,
- MD_NTSTATUS_WIN_STATUS_SYSTEM_SHUTDOWN = 0xC00002EB,
- MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE_CONSOLE = 0xC00002EC,
- MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE_CONSOLE = 0xC00002ED,
- MD_NTSTATUS_WIN_STATUS_UNFINISHED_CONTEXT_DELETED = 0xC00002EE,
- MD_NTSTATUS_WIN_STATUS_NO_TGT_REPLY = 0xC00002EF,
- MD_NTSTATUS_WIN_STATUS_OBJECTID_NOT_FOUND = 0xC00002F0,
- MD_NTSTATUS_WIN_STATUS_NO_IP_ADDRESSES = 0xC00002F1,
- MD_NTSTATUS_WIN_STATUS_WRONG_CREDENTIAL_HANDLE = 0xC00002F2,
- MD_NTSTATUS_WIN_STATUS_CRYPTO_SYSTEM_INVALID = 0xC00002F3,
- MD_NTSTATUS_WIN_STATUS_MAX_REFERRALS_EXCEEDED = 0xC00002F4,
- MD_NTSTATUS_WIN_STATUS_MUST_BE_KDC = 0xC00002F5,
- MD_NTSTATUS_WIN_STATUS_STRONG_CRYPTO_NOT_SUPPORTED = 0xC00002F6,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_PRINCIPALS = 0xC00002F7,
- MD_NTSTATUS_WIN_STATUS_NO_PA_DATA = 0xC00002F8,
- MD_NTSTATUS_WIN_STATUS_PKINIT_NAME_MISMATCH = 0xC00002F9,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_LOGON_REQUIRED = 0xC00002FA,
- MD_NTSTATUS_WIN_STATUS_KDC_INVALID_REQUEST = 0xC00002FB,
- MD_NTSTATUS_WIN_STATUS_KDC_UNABLE_TO_REFER = 0xC00002FC,
- MD_NTSTATUS_WIN_STATUS_KDC_UNKNOWN_ETYPE = 0xC00002FD,
- MD_NTSTATUS_WIN_STATUS_SHUTDOWN_IN_PROGRESS = 0xC00002FE,
- MD_NTSTATUS_WIN_STATUS_SERVER_SHUTDOWN_IN_PROGRESS = 0xC00002FF,
- MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_ON_SBS = 0xC0000300,
- MD_NTSTATUS_WIN_STATUS_WMI_GUID_DISCONNECTED = 0xC0000301,
- MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_DISABLED = 0xC0000302,
- MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_ENABLED = 0xC0000303,
- MD_NTSTATUS_WIN_STATUS_MFT_TOO_FRAGMENTED = 0xC0000304,
- MD_NTSTATUS_WIN_STATUS_COPY_PROTECTION_FAILURE = 0xC0000305,
- MD_NTSTATUS_WIN_STATUS_CSS_AUTHENTICATION_FAILURE = 0xC0000306,
- MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_PRESENT = 0xC0000307,
- MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_ESTABLISHED = 0xC0000308,
- MD_NTSTATUS_WIN_STATUS_CSS_SCRAMBLED_SECTOR = 0xC0000309,
- MD_NTSTATUS_WIN_STATUS_CSS_REGION_MISMATCH = 0xC000030A,
- MD_NTSTATUS_WIN_STATUS_CSS_RESETS_EXHAUSTED = 0xC000030B,
- MD_NTSTATUS_WIN_STATUS_PASSWORD_CHANGE_REQUIRED = 0xC000030C,
- MD_NTSTATUS_WIN_STATUS_PKINIT_FAILURE = 0xC0000320,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_SUBSYSTEM_FAILURE = 0xC0000321,
- MD_NTSTATUS_WIN_STATUS_NO_KERB_KEY = 0xC0000322,
- MD_NTSTATUS_WIN_STATUS_HOST_DOWN = 0xC0000350,
- MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_PREAUTH = 0xC0000351,
- MD_NTSTATUS_WIN_STATUS_EFS_ALG_BLOB_TOO_BIG = 0xC0000352,
- MD_NTSTATUS_WIN_STATUS_PORT_NOT_SET = 0xC0000353,
- MD_NTSTATUS_WIN_STATUS_DEBUGGER_INACTIVE = 0xC0000354,
- MD_NTSTATUS_WIN_STATUS_DS_VERSION_CHECK_FAILURE = 0xC0000355,
- MD_NTSTATUS_WIN_STATUS_AUDITING_DISABLED = 0xC0000356,
- MD_NTSTATUS_WIN_STATUS_PRENT4_MACHINE_ACCOUNT = 0xC0000357,
- MD_NTSTATUS_WIN_STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER = 0xC0000358,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_32 = 0xC0000359,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_64 = 0xC000035A,
- MD_NTSTATUS_WIN_STATUS_BAD_BINDINGS = 0xC000035B,
- MD_NTSTATUS_WIN_STATUS_NETWORK_SESSION_EXPIRED = 0xC000035C,
- MD_NTSTATUS_WIN_STATUS_APPHELP_BLOCK = 0xC000035D,
- MD_NTSTATUS_WIN_STATUS_ALL_SIDS_FILTERED = 0xC000035E,
- MD_NTSTATUS_WIN_STATUS_NOT_SAFE_MODE_DRIVER = 0xC000035F,
- MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT = 0xC0000361,
- MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PATH = 0xC0000362,
- MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER = 0xC0000363,
- MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_OTHER = 0xC0000364,
- MD_NTSTATUS_WIN_STATUS_FAILED_DRIVER_ENTRY = 0xC0000365,
- MD_NTSTATUS_WIN_STATUS_DEVICE_ENUMERATION_ERROR = 0xC0000366,
- MD_NTSTATUS_WIN_STATUS_MOUNT_POINT_NOT_RESOLVED = 0xC0000368,
- MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_OBJECT_PARAMETER = 0xC0000369,
- MD_NTSTATUS_WIN_STATUS_MCA_OCCURED = 0xC000036A,
- MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED_CRITICAL = 0xC000036B,
- MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED = 0xC000036C,
- MD_NTSTATUS_WIN_STATUS_DRIVER_DATABASE_ERROR = 0xC000036D,
- MD_NTSTATUS_WIN_STATUS_SYSTEM_HIVE_TOO_LARGE = 0xC000036E,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMPORT_OF_NON_DLL = 0xC000036F,
- MD_NTSTATUS_WIN_STATUS_NO_SECRETS = 0xC0000371,
- MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY = 0xC0000372,
- MD_NTSTATUS_WIN_STATUS_FAILED_STACK_SWITCH = 0xC0000373,
- MD_NTSTATUS_WIN_STATUS_HEAP_CORRUPTION = 0xC0000374,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_WRONG_PIN = 0xC0000380,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_BLOCKED = 0xC0000381,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED = 0xC0000382,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CARD = 0xC0000383,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEY_CONTAINER = 0xC0000384,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CERTIFICATE = 0xC0000385,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEYSET = 0xC0000386,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_IO_ERROR = 0xC0000387,
- MD_NTSTATUS_WIN_STATUS_DOWNGRADE_DETECTED = 0xC0000388,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_REVOKED = 0xC0000389,
- MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED = 0xC000038A,
- MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_C = 0xC000038B,
- MD_NTSTATUS_WIN_STATUS_PKINIT_CLIENT_FAILURE = 0xC000038C,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_EXPIRED = 0xC000038D,
- MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_PRIOR_UNLOAD = 0xC000038E,
- MD_NTSTATUS_WIN_STATUS_SMARTCARD_SILENT_CONTEXT = 0xC000038F,
- MD_NTSTATUS_WIN_STATUS_PER_USER_TRUST_QUOTA_EXCEEDED = 0xC0000401,
- MD_NTSTATUS_WIN_STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED = 0xC0000402,
- MD_NTSTATUS_WIN_STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED = 0xC0000403,
- MD_NTSTATUS_WIN_STATUS_DS_NAME_NOT_UNIQUE = 0xC0000404,
- MD_NTSTATUS_WIN_STATUS_DS_DUPLICATE_ID_FOUND = 0xC0000405,
- MD_NTSTATUS_WIN_STATUS_DS_GROUP_CONVERSION_ERROR = 0xC0000406,
- MD_NTSTATUS_WIN_STATUS_VOLSNAP_PREPARE_HIBERNATE = 0xC0000407,
- MD_NTSTATUS_WIN_STATUS_USER2USER_REQUIRED = 0xC0000408,
- MD_NTSTATUS_WIN_STATUS_STACK_BUFFER_OVERRUN = 0xC0000409,
- MD_NTSTATUS_WIN_STATUS_NO_S4U_PROT_SUPPORT = 0xC000040A,
- MD_NTSTATUS_WIN_STATUS_CROSSREALM_DELEGATION_FAILURE = 0xC000040B,
- MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_KDC = 0xC000040C,
- MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED_KDC = 0xC000040D,
- MD_NTSTATUS_WIN_STATUS_KDC_CERT_EXPIRED = 0xC000040E,
- MD_NTSTATUS_WIN_STATUS_KDC_CERT_REVOKED = 0xC000040F,
- MD_NTSTATUS_WIN_STATUS_PARAMETER_QUOTA_EXCEEDED = 0xC0000410,
- MD_NTSTATUS_WIN_STATUS_HIBERNATION_FAILURE = 0xC0000411,
- MD_NTSTATUS_WIN_STATUS_DELAY_LOAD_FAILED = 0xC0000412,
- MD_NTSTATUS_WIN_STATUS_AUTHENTICATION_FIREWALL_FAILED = 0xC0000413,
- MD_NTSTATUS_WIN_STATUS_VDM_DISALLOWED = 0xC0000414,
- MD_NTSTATUS_WIN_STATUS_HUNG_DISPLAY_DRIVER_THREAD = 0xC0000415,
- MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE = 0xC0000416,
- MD_NTSTATUS_WIN_STATUS_INVALID_CRUNTIME_PARAMETER = 0xC0000417,
- MD_NTSTATUS_WIN_STATUS_NTLM_BLOCKED = 0xC0000418,
- MD_NTSTATUS_WIN_STATUS_DS_SRC_SID_EXISTS_IN_FOREST = 0xC0000419,
- MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST = 0xC000041A,
- MD_NTSTATUS_WIN_STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST = 0xC000041B,
- MD_NTSTATUS_WIN_STATUS_INVALID_USER_PRINCIPAL_NAME = 0xC000041C,
- MD_NTSTATUS_WIN_STATUS_FATAL_USER_CALLBACK_EXCEPTION = 0xC000041D,
- MD_NTSTATUS_WIN_STATUS_ASSERTION_FAILURE = 0xC0000420,
- MD_NTSTATUS_WIN_STATUS_VERIFIER_STOP = 0xC0000421,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_POP_STACK = 0xC0000423,
- MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_DRIVER_BLOCKED = 0xC0000424,
- MD_NTSTATUS_WIN_STATUS_HIVE_UNLOADED = 0xC0000425,
- MD_NTSTATUS_WIN_STATUS_COMPRESSION_DISABLED = 0xC0000426,
- MD_NTSTATUS_WIN_STATUS_FILE_SYSTEM_LIMITATION = 0xC0000427,
- MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_HASH = 0xC0000428,
- MD_NTSTATUS_WIN_STATUS_NOT_CAPABLE = 0xC0000429,
- MD_NTSTATUS_WIN_STATUS_REQUEST_OUT_OF_SEQUENCE = 0xC000042A,
- MD_NTSTATUS_WIN_STATUS_IMPLEMENTATION_LIMIT = 0xC000042B,
- MD_NTSTATUS_WIN_STATUS_ELEVATION_REQUIRED = 0xC000042C,
- MD_NTSTATUS_WIN_STATUS_NO_SECURITY_CONTEXT = 0xC000042D,
- MD_NTSTATUS_WIN_STATUS_PKU2U_CERT_FAILURE = 0xC000042F,
- MD_NTSTATUS_WIN_STATUS_BEYOND_VDL = 0xC0000432,
- MD_NTSTATUS_WIN_STATUS_ENCOUNTERED_WRITE_IN_PROGRESS = 0xC0000433,
- MD_NTSTATUS_WIN_STATUS_PTE_CHANGED = 0xC0000434,
- MD_NTSTATUS_WIN_STATUS_PURGE_FAILED = 0xC0000435,
- MD_NTSTATUS_WIN_STATUS_CRED_REQUIRES_CONFIRMATION = 0xC0000440,
- MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE = 0xC0000441,
- MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER = 0xC0000442,
- MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE = 0xC0000443,
- MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE = 0xC0000444,
- MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_FILE_NOT_CSE = 0xC0000445,
- MD_NTSTATUS_WIN_STATUS_INVALID_LABEL = 0xC0000446,
- MD_NTSTATUS_WIN_STATUS_DRIVER_PROCESS_TERMINATED = 0xC0000450,
- MD_NTSTATUS_WIN_STATUS_AMBIGUOUS_SYSTEM_DEVICE = 0xC0000451,
- MD_NTSTATUS_WIN_STATUS_SYSTEM_DEVICE_NOT_FOUND = 0xC0000452,
- MD_NTSTATUS_WIN_STATUS_RESTART_BOOT_APPLICATION = 0xC0000453,
- MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_NVRAM_RESOURCES = 0xC0000454,
- MD_NTSTATUS_WIN_STATUS_INVALID_SESSION = 0xC0000455,
- MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_SESSION = 0xC0000456,
- MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_SESSION = 0xC0000457,
- MD_NTSTATUS_WIN_STATUS_INVALID_WEIGHT = 0xC0000458,
- MD_NTSTATUS_WIN_STATUS_REQUEST_PAUSED = 0xC0000459,
- MD_NTSTATUS_WIN_STATUS_NO_RANGES_PROCESSED = 0xC0000460,
- MD_NTSTATUS_WIN_STATUS_DISK_RESOURCES_EXHAUSTED = 0xC0000461,
- MD_NTSTATUS_WIN_STATUS_NEEDS_REMEDIATION = 0xC0000462,
- MD_NTSTATUS_WIN_STATUS_DEVICE_FEATURE_NOT_SUPPORTED = 0xC0000463,
- MD_NTSTATUS_WIN_STATUS_DEVICE_UNREACHABLE = 0xC0000464,
- MD_NTSTATUS_WIN_STATUS_INVALID_TOKEN = 0xC0000465,
- MD_NTSTATUS_WIN_STATUS_SERVER_UNAVAILABLE = 0xC0000466,
- MD_NTSTATUS_WIN_STATUS_FILE_NOT_AVAILABLE = 0xC0000467,
- MD_NTSTATUS_WIN_STATUS_DEVICE_INSUFFICIENT_RESOURCES = 0xC0000468,
- MD_NTSTATUS_WIN_STATUS_PACKAGE_UPDATING = 0xC0000469,
- MD_NTSTATUS_WIN_STATUS_NOT_READ_FROM_COPY = 0xC000046A,
- MD_NTSTATUS_WIN_STATUS_FT_WRITE_FAILURE = 0xC000046B,
- MD_NTSTATUS_WIN_STATUS_FT_DI_SCAN_REQUIRED = 0xC000046C,
- MD_NTSTATUS_WIN_STATUS_OBJECT_NOT_EXTERNALLY_BACKED = 0xC000046D,
- MD_NTSTATUS_WIN_STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN = 0xC000046E,
- MD_NTSTATUS_WIN_STATUS_DATA_CHECKSUM_ERROR = 0xC0000470,
- MD_NTSTATUS_WIN_STATUS_INTERMIXED_KERNEL_EA_OPERATION = 0xC0000471,
- MD_NTSTATUS_WIN_STATUS_TRIM_READ_ZERO_NOT_SUPPORTED = 0xC0000472,
- MD_NTSTATUS_WIN_STATUS_TOO_MANY_SEGMENT_DESCRIPTORS = 0xC0000473,
- MD_NTSTATUS_WIN_STATUS_INVALID_OFFSET_ALIGNMENT = 0xC0000474,
- MD_NTSTATUS_WIN_STATUS_INVALID_FIELD_IN_PARAMETER_LIST = 0xC0000475,
- MD_NTSTATUS_WIN_STATUS_OPERATION_IN_PROGRESS = 0xC0000476,
- MD_NTSTATUS_WIN_STATUS_INVALID_INITIATOR_TARGET_PATH = 0xC0000477,
- MD_NTSTATUS_WIN_STATUS_SCRUB_DATA_DISABLED = 0xC0000478,
- MD_NTSTATUS_WIN_STATUS_NOT_REDUNDANT_STORAGE = 0xC0000479,
- MD_NTSTATUS_WIN_STATUS_RESIDENT_FILE_NOT_SUPPORTED = 0xC000047A,
- MD_NTSTATUS_WIN_STATUS_COMPRESSED_FILE_NOT_SUPPORTED = 0xC000047B,
- MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_SUPPORTED = 0xC000047C,
- MD_NTSTATUS_WIN_STATUS_IO_OPERATION_TIMEOUT = 0xC000047D,
- MD_NTSTATUS_WIN_STATUS_SYSTEM_NEEDS_REMEDIATION = 0xC000047E,
- MD_NTSTATUS_WIN_STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN = 0xC000047F,
- MD_NTSTATUS_WIN_STATUS_SHARE_UNAVAILABLE = 0xC0000480,
- MD_NTSTATUS_WIN_STATUS_APISET_NOT_HOSTED = 0xC0000481,
- MD_NTSTATUS_WIN_STATUS_APISET_NOT_PRESENT = 0xC0000482,
- MD_NTSTATUS_WIN_STATUS_DEVICE_HARDWARE_ERROR = 0xC0000483,
- MD_NTSTATUS_WIN_STATUS_INVALID_TASK_NAME = 0xC0000500,
- MD_NTSTATUS_WIN_STATUS_INVALID_TASK_INDEX = 0xC0000501,
- MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_TASK = 0xC0000502,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_BYPASS = 0xC0000503,
- MD_NTSTATUS_WIN_STATUS_UNDEFINED_SCOPE = 0xC0000504,
- MD_NTSTATUS_WIN_STATUS_INVALID_CAP = 0xC0000505,
- MD_NTSTATUS_WIN_STATUS_NOT_GUI_PROCESS = 0xC0000506,
- MD_NTSTATUS_WIN_STATUS_FAIL_FAST_EXCEPTION = 0xC0000602,
- MD_NTSTATUS_WIN_STATUS_IMAGE_CERT_REVOKED = 0xC0000603,
- MD_NTSTATUS_WIN_STATUS_DYNAMIC_CODE_BLOCKED = 0xC0000604,
- MD_NTSTATUS_WIN_STATUS_PORT_CLOSED = 0xC0000700,
- MD_NTSTATUS_WIN_STATUS_MESSAGE_LOST = 0xC0000701,
- MD_NTSTATUS_WIN_STATUS_INVALID_MESSAGE = 0xC0000702,
- MD_NTSTATUS_WIN_STATUS_REQUEST_CANCELED = 0xC0000703,
- MD_NTSTATUS_WIN_STATUS_RECURSIVE_DISPATCH = 0xC0000704,
- MD_NTSTATUS_WIN_STATUS_LPC_RECEIVE_BUFFER_EXPECTED = 0xC0000705,
- MD_NTSTATUS_WIN_STATUS_LPC_INVALID_CONNECTION_USAGE = 0xC0000706,
- MD_NTSTATUS_WIN_STATUS_LPC_REQUESTS_NOT_ALLOWED = 0xC0000707,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_IN_USE = 0xC0000708,
- MD_NTSTATUS_WIN_STATUS_HARDWARE_MEMORY_ERROR = 0xC0000709,
- MD_NTSTATUS_WIN_STATUS_THREADPOOL_HANDLE_EXCEPTION = 0xC000070A,
- MD_NTSTATUS_WIN_STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED = 0xC000070B,
- MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED = 0xC000070C,
- MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED = 0xC000070D,
- MD_NTSTATUS_WIN_STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED = 0xC000070E,
- MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASED_DURING_OPERATION = 0xC000070F,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING = 0xC0000710,
- MD_NTSTATUS_WIN_STATUS_APC_RETURNED_WHILE_IMPERSONATING = 0xC0000711,
- MD_NTSTATUS_WIN_STATUS_PROCESS_IS_PROTECTED = 0xC0000712,
- MD_NTSTATUS_WIN_STATUS_MCA_EXCEPTION = 0xC0000713,
- MD_NTSTATUS_WIN_STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE = 0xC0000714,
- MD_NTSTATUS_WIN_STATUS_SYMLINK_CLASS_DISABLED = 0xC0000715,
- MD_NTSTATUS_WIN_STATUS_INVALID_IDN_NORMALIZATION = 0xC0000716,
- MD_NTSTATUS_WIN_STATUS_NO_UNICODE_TRANSLATION = 0xC0000717,
- MD_NTSTATUS_WIN_STATUS_ALREADY_REGISTERED = 0xC0000718,
- MD_NTSTATUS_WIN_STATUS_CONTEXT_MISMATCH = 0xC0000719,
- MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_HAS_COMPLETION_LIST = 0xC000071A,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_PRIORITY = 0xC000071B,
- MD_NTSTATUS_WIN_STATUS_INVALID_THREAD = 0xC000071C,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_TRANSACTION = 0xC000071D,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LDR_LOCK = 0xC000071E,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LANG = 0xC000071F,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_PRI_BACK = 0xC0000720,
- MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_AFFINITY = 0xC0000721,
- MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_DISABLED = 0xC0000800,
- MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_RENAME_IN_PROGRESS = 0xC0000801,
- MD_NTSTATUS_WIN_STATUS_DISK_QUOTA_EXCEEDED = 0xC0000802,
- MD_NTSTATUS_WIN_STATUS_CONTENT_BLOCKED = 0xC0000804,
- MD_NTSTATUS_WIN_STATUS_BAD_CLUSTERS = 0xC0000805,
- MD_NTSTATUS_WIN_STATUS_VOLUME_DIRTY = 0xC0000806,
- MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_UNSUCCESSFUL = 0xC0000808,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_OVERFULL = 0xC0000809,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CORRUPTED = 0xC000080A,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UNAVAILABLE = 0xC000080B,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_DELETED_FULL = 0xC000080C,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CLEARED = 0xC000080D,
- MD_NTSTATUS_WIN_STATUS_ORPHAN_NAME_EXHAUSTED = 0xC000080E,
- MD_NTSTATUS_WIN_STATUS_PROACTIVE_SCAN_IN_PROGRESS = 0xC000080F,
- MD_NTSTATUS_WIN_STATUS_ENCRYPTED_IO_NOT_POSSIBLE = 0xC0000810,
- MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UPLEVEL_RECORDS = 0xC0000811,
- MD_NTSTATUS_WIN_STATUS_FILE_CHECKED_OUT = 0xC0000901,
- MD_NTSTATUS_WIN_STATUS_CHECKOUT_REQUIRED = 0xC0000902,
- MD_NTSTATUS_WIN_STATUS_BAD_FILE_TYPE = 0xC0000903,
- MD_NTSTATUS_WIN_STATUS_FILE_TOO_LARGE = 0xC0000904,
- MD_NTSTATUS_WIN_STATUS_FORMS_AUTH_REQUIRED = 0xC0000905,
- MD_NTSTATUS_WIN_STATUS_VIRUS_INFECTED = 0xC0000906,
- MD_NTSTATUS_WIN_STATUS_VIRUS_DELETED = 0xC0000907,
- MD_NTSTATUS_WIN_STATUS_BAD_MCFG_TABLE = 0xC0000908,
- MD_NTSTATUS_WIN_STATUS_CANNOT_BREAK_OPLOCK = 0xC0000909,
- MD_NTSTATUS_WIN_STATUS_BAD_KEY = 0xC000090A,
- MD_NTSTATUS_WIN_STATUS_BAD_DATA = 0xC000090B,
- MD_NTSTATUS_WIN_STATUS_NO_KEY = 0xC000090C,
- MD_NTSTATUS_WIN_STATUS_FILE_HANDLE_REVOKED = 0xC0000910,
- MD_NTSTATUS_WIN_STATUS_WOW_ASSERTION = 0xC0009898,
- MD_NTSTATUS_WIN_STATUS_INVALID_SIGNATURE = 0xC000A000,
- MD_NTSTATUS_WIN_STATUS_HMAC_NOT_SUPPORTED = 0xC000A001,
- MD_NTSTATUS_WIN_STATUS_AUTH_TAG_MISMATCH = 0xC000A002,
- MD_NTSTATUS_WIN_STATUS_INVALID_STATE_TRANSITION = 0xC000A003,
- MD_NTSTATUS_WIN_STATUS_INVALID_KERNEL_INFO_VERSION = 0xC000A004,
- MD_NTSTATUS_WIN_STATUS_INVALID_PEP_INFO_VERSION = 0xC000A005,
- MD_NTSTATUS_WIN_STATUS_IPSEC_QUEUE_OVERFLOW = 0xC000A010,
- MD_NTSTATUS_WIN_STATUS_ND_QUEUE_OVERFLOW = 0xC000A011,
- MD_NTSTATUS_WIN_STATUS_HOPLIMIT_EXCEEDED = 0xC000A012,
- MD_NTSTATUS_WIN_STATUS_PROTOCOL_NOT_SUPPORTED = 0xC000A013,
- MD_NTSTATUS_WIN_STATUS_FASTPATH_REJECTED = 0xC000A014,
- MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED = 0xC000A080,
- MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR = 0xC000A081,
- MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR = 0xC000A082,
- MD_NTSTATUS_WIN_STATUS_XML_PARSE_ERROR = 0xC000A083,
- MD_NTSTATUS_WIN_STATUS_XMLDSIG_ERROR = 0xC000A084,
- MD_NTSTATUS_WIN_STATUS_WRONG_COMPARTMENT = 0xC000A085,
- MD_NTSTATUS_WIN_STATUS_AUTHIP_FAILURE = 0xC000A086,
- MD_NTSTATUS_WIN_STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS = 0xC000A087,
- MD_NTSTATUS_WIN_STATUS_DS_OID_NOT_FOUND = 0xC000A088,
- MD_NTSTATUS_WIN_STATUS_INCORRECT_ACCOUNT_TYPE = 0xC000A089,
- MD_NTSTATUS_WIN_STATUS_HASH_NOT_SUPPORTED = 0xC000A100,
- MD_NTSTATUS_WIN_STATUS_HASH_NOT_PRESENT = 0xC000A101,
- MD_NTSTATUS_WIN_STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED = 0xC000A121,
- MD_NTSTATUS_WIN_STATUS_GPIO_CLIENT_INFORMATION_INVALID = 0xC000A122,
- MD_NTSTATUS_WIN_STATUS_GPIO_VERSION_NOT_SUPPORTED = 0xC000A123,
- MD_NTSTATUS_WIN_STATUS_GPIO_INVALID_REGISTRATION_PACKET = 0xC000A124,
- MD_NTSTATUS_WIN_STATUS_GPIO_OPERATION_DENIED = 0xC000A125,
- MD_NTSTATUS_WIN_STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE = 0xC000A126,
- MD_NTSTATUS_WIN_STATUS_CANNOT_SWITCH_RUNLEVEL = 0xC000A141,
- MD_NTSTATUS_WIN_STATUS_INVALID_RUNLEVEL_SETTING = 0xC000A142,
- MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_TIMEOUT = 0xC000A143,
- MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT = 0xC000A145,
- MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_IN_PROGRESS = 0xC000A146,
- MD_NTSTATUS_WIN_STATUS_NOT_APPCONTAINER = 0xC000A200,
- MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_IN_APPCONTAINER = 0xC000A201,
- MD_NTSTATUS_WIN_STATUS_INVALID_PACKAGE_SID_LENGTH = 0xC000A202,
- MD_NTSTATUS_WIN_STATUS_APP_DATA_NOT_FOUND = 0xC000A281,
- MD_NTSTATUS_WIN_STATUS_APP_DATA_EXPIRED = 0xC000A282,
- MD_NTSTATUS_WIN_STATUS_APP_DATA_CORRUPT = 0xC000A283,
- MD_NTSTATUS_WIN_STATUS_APP_DATA_LIMIT_EXCEEDED = 0xC000A284,
- MD_NTSTATUS_WIN_STATUS_APP_DATA_REBOOT_REQUIRED = 0xC000A285,
- MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED = 0xC000A2A1,
- MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED = 0xC000A2A2,
- MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED = 0xC000A2A3,
- MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED = 0xC000A2A4,
- MD_NTSTATUS_WIN_DBG_NO_STATE_CHANGE = 0xC0010001,
- MD_NTSTATUS_WIN_DBG_APP_NOT_IDLE = 0xC0010002,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_BINDING = 0xC0020001,
- MD_NTSTATUS_WIN_RPC_NT_WRONG_KIND_OF_BINDING = 0xC0020002,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_BINDING = 0xC0020003,
- MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_SUPPORTED = 0xC0020004,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_RPC_PROTSEQ = 0xC0020005,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_UUID = 0xC0020006,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_ENDPOINT_FORMAT = 0xC0020007,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_NET_ADDR = 0xC0020008,
- MD_NTSTATUS_WIN_RPC_NT_NO_ENDPOINT_FOUND = 0xC0020009,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_TIMEOUT = 0xC002000A,
- MD_NTSTATUS_WIN_RPC_NT_OBJECT_NOT_FOUND = 0xC002000B,
- MD_NTSTATUS_WIN_RPC_NT_ALREADY_REGISTERED = 0xC002000C,
- MD_NTSTATUS_WIN_RPC_NT_TYPE_ALREADY_REGISTERED = 0xC002000D,
- MD_NTSTATUS_WIN_RPC_NT_ALREADY_LISTENING = 0xC002000E,
- MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS_REGISTERED = 0xC002000F,
- MD_NTSTATUS_WIN_RPC_NT_NOT_LISTENING = 0xC0020010,
- MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_MGR_TYPE = 0xC0020011,
- MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_IF = 0xC0020012,
- MD_NTSTATUS_WIN_RPC_NT_NO_BINDINGS = 0xC0020013,
- MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS = 0xC0020014,
- MD_NTSTATUS_WIN_RPC_NT_CANT_CREATE_ENDPOINT = 0xC0020015,
- MD_NTSTATUS_WIN_RPC_NT_OUT_OF_RESOURCES = 0xC0020016,
- MD_NTSTATUS_WIN_RPC_NT_SERVER_UNAVAILABLE = 0xC0020017,
- MD_NTSTATUS_WIN_RPC_NT_SERVER_TOO_BUSY = 0xC0020018,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_NETWORK_OPTIONS = 0xC0020019,
- MD_NTSTATUS_WIN_RPC_NT_NO_CALL_ACTIVE = 0xC002001A,
- MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED = 0xC002001B,
- MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED_DNE = 0xC002001C,
- MD_NTSTATUS_WIN_RPC_NT_PROTOCOL_ERROR = 0xC002001D,
- MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TRANS_SYN = 0xC002001F,
- MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TYPE = 0xC0020021,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_TAG = 0xC0020022,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_BOUND = 0xC0020023,
- MD_NTSTATUS_WIN_RPC_NT_NO_ENTRY_NAME = 0xC0020024,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_NAME_SYNTAX = 0xC0020025,
- MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_NAME_SYNTAX = 0xC0020026,
- MD_NTSTATUS_WIN_RPC_NT_UUID_NO_ADDRESS = 0xC0020028,
- MD_NTSTATUS_WIN_RPC_NT_DUPLICATE_ENDPOINT = 0xC0020029,
- MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_TYPE = 0xC002002A,
- MD_NTSTATUS_WIN_RPC_NT_MAX_CALLS_TOO_SMALL = 0xC002002B,
- MD_NTSTATUS_WIN_RPC_NT_STRING_TOO_LONG = 0xC002002C,
- MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_FOUND = 0xC002002D,
- MD_NTSTATUS_WIN_RPC_NT_PROCNUM_OUT_OF_RANGE = 0xC002002E,
- MD_NTSTATUS_WIN_RPC_NT_BINDING_HAS_NO_AUTH = 0xC002002F,
- MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_SERVICE = 0xC0020030,
- MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_LEVEL = 0xC0020031,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_AUTH_IDENTITY = 0xC0020032,
- MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHZ_SERVICE = 0xC0020033,
- MD_NTSTATUS_WIN_EPT_NT_INVALID_ENTRY = 0xC0020034,
- MD_NTSTATUS_WIN_EPT_NT_CANT_PERFORM_OP = 0xC0020035,
- MD_NTSTATUS_WIN_EPT_NT_NOT_REGISTERED = 0xC0020036,
- MD_NTSTATUS_WIN_RPC_NT_NOTHING_TO_EXPORT = 0xC0020037,
- MD_NTSTATUS_WIN_RPC_NT_INCOMPLETE_NAME = 0xC0020038,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_VERS_OPTION = 0xC0020039,
- MD_NTSTATUS_WIN_RPC_NT_NO_MORE_MEMBERS = 0xC002003A,
- MD_NTSTATUS_WIN_RPC_NT_NOT_ALL_OBJS_UNEXPORTED = 0xC002003B,
- MD_NTSTATUS_WIN_RPC_NT_INTERFACE_NOT_FOUND = 0xC002003C,
- MD_NTSTATUS_WIN_RPC_NT_ENTRY_ALREADY_EXISTS = 0xC002003D,
- MD_NTSTATUS_WIN_RPC_NT_ENTRY_NOT_FOUND = 0xC002003E,
- MD_NTSTATUS_WIN_RPC_NT_NAME_SERVICE_UNAVAILABLE = 0xC002003F,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_NAF_ID = 0xC0020040,
- MD_NTSTATUS_WIN_RPC_NT_CANNOT_SUPPORT = 0xC0020041,
- MD_NTSTATUS_WIN_RPC_NT_NO_CONTEXT_AVAILABLE = 0xC0020042,
- MD_NTSTATUS_WIN_RPC_NT_INTERNAL_ERROR = 0xC0020043,
- MD_NTSTATUS_WIN_RPC_NT_ZERO_DIVIDE = 0xC0020044,
- MD_NTSTATUS_WIN_RPC_NT_ADDRESS_ERROR = 0xC0020045,
- MD_NTSTATUS_WIN_RPC_NT_FP_DIV_ZERO = 0xC0020046,
- MD_NTSTATUS_WIN_RPC_NT_FP_UNDERFLOW = 0xC0020047,
- MD_NTSTATUS_WIN_RPC_NT_FP_OVERFLOW = 0xC0020048,
- MD_NTSTATUS_WIN_RPC_NT_CALL_IN_PROGRESS = 0xC0020049,
- MD_NTSTATUS_WIN_RPC_NT_NO_MORE_BINDINGS = 0xC002004A,
- MD_NTSTATUS_WIN_RPC_NT_GROUP_MEMBER_NOT_FOUND = 0xC002004B,
- MD_NTSTATUS_WIN_EPT_NT_CANT_CREATE = 0xC002004C,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_OBJECT = 0xC002004D,
- MD_NTSTATUS_WIN_RPC_NT_NO_INTERFACES = 0xC002004F,
- MD_NTSTATUS_WIN_RPC_NT_CALL_CANCELLED = 0xC0020050,
- MD_NTSTATUS_WIN_RPC_NT_BINDING_INCOMPLETE = 0xC0020051,
- MD_NTSTATUS_WIN_RPC_NT_COMM_FAILURE = 0xC0020052,
- MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_AUTHN_LEVEL = 0xC0020053,
- MD_NTSTATUS_WIN_RPC_NT_NO_PRINC_NAME = 0xC0020054,
- MD_NTSTATUS_WIN_RPC_NT_NOT_RPC_ERROR = 0xC0020055,
- MD_NTSTATUS_WIN_RPC_NT_SEC_PKG_ERROR = 0xC0020057,
- MD_NTSTATUS_WIN_RPC_NT_NOT_CANCELLED = 0xC0020058,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_HANDLE = 0xC0020062,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_CALL = 0xC0020063,
- MD_NTSTATUS_WIN_RPC_NT_PROXY_ACCESS_DENIED = 0xC0020064,
- MD_NTSTATUS_WIN_RPC_NT_COOKIE_AUTH_FAILED = 0xC0020065,
- MD_NTSTATUS_WIN_RPC_NT_NO_MORE_ENTRIES = 0xC0030001,
- MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_OPEN_FAIL = 0xC0030002,
- MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_SHORT_FILE = 0xC0030003,
- MD_NTSTATUS_WIN_RPC_NT_SS_IN_NULL_CONTEXT = 0xC0030004,
- MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_MISMATCH = 0xC0030005,
- MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_DAMAGED = 0xC0030006,
- MD_NTSTATUS_WIN_RPC_NT_SS_HANDLES_MISMATCH = 0xC0030007,
- MD_NTSTATUS_WIN_RPC_NT_SS_CANNOT_GET_CALL_HANDLE = 0xC0030008,
- MD_NTSTATUS_WIN_RPC_NT_NULL_REF_POINTER = 0xC0030009,
- MD_NTSTATUS_WIN_RPC_NT_ENUM_VALUE_OUT_OF_RANGE = 0xC003000A,
- MD_NTSTATUS_WIN_RPC_NT_BYTE_COUNT_TOO_SMALL = 0xC003000B,
- MD_NTSTATUS_WIN_RPC_NT_BAD_STUB_DATA = 0xC003000C,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_ES_ACTION = 0xC0030059,
- MD_NTSTATUS_WIN_RPC_NT_WRONG_ES_VERSION = 0xC003005A,
- MD_NTSTATUS_WIN_RPC_NT_WRONG_STUB_VERSION = 0xC003005B,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OBJECT = 0xC003005C,
- MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OPERATION = 0xC003005D,
- MD_NTSTATUS_WIN_RPC_NT_WRONG_PIPE_VERSION = 0xC003005E,
- MD_NTSTATUS_WIN_RPC_NT_PIPE_CLOSED = 0xC003005F,
- MD_NTSTATUS_WIN_RPC_NT_PIPE_DISCIPLINE_ERROR = 0xC0030060,
- MD_NTSTATUS_WIN_RPC_NT_PIPE_EMPTY = 0xC0030061,
- MD_NTSTATUS_WIN_STATUS_PNP_BAD_MPS_TABLE = 0xC0040035,
- MD_NTSTATUS_WIN_STATUS_PNP_TRANSLATION_FAILED = 0xC0040036,
- MD_NTSTATUS_WIN_STATUS_PNP_IRQ_TRANSLATION_FAILED = 0xC0040037,
- MD_NTSTATUS_WIN_STATUS_PNP_INVALID_ID = 0xC0040038,
- MD_NTSTATUS_WIN_STATUS_IO_REISSUE_AS_CACHED = 0xC0040039,
- MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_INVALID = 0xC00A0001,
- MD_NTSTATUS_WIN_STATUS_CTX_INVALID_PD = 0xC00A0002,
- MD_NTSTATUS_WIN_STATUS_CTX_PD_NOT_FOUND = 0xC00A0003,
- MD_NTSTATUS_WIN_STATUS_CTX_CLOSE_PENDING = 0xC00A0006,
- MD_NTSTATUS_WIN_STATUS_CTX_NO_OUTBUF = 0xC00A0007,
- MD_NTSTATUS_WIN_STATUS_CTX_MODEM_INF_NOT_FOUND = 0xC00A0008,
- MD_NTSTATUS_WIN_STATUS_CTX_INVALID_MODEMNAME = 0xC00A0009,
- MD_NTSTATUS_WIN_STATUS_CTX_RESPONSE_ERROR = 0xC00A000A,
- MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_TIMEOUT = 0xC00A000B,
- MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_CARRIER = 0xC00A000C,
- MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE = 0xC00A000D,
- MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_BUSY = 0xC00A000E,
- MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_VOICE = 0xC00A000F,
- MD_NTSTATUS_WIN_STATUS_CTX_TD_ERROR = 0xC00A0010,
- MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_CLIENT_INVALID = 0xC00A0012,
- MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_NOT_AVAILABLE = 0xC00A0013,
- MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_EXPIRED = 0xC00A0014,
- MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NOT_FOUND = 0xC00A0015,
- MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_COLLISION = 0xC00A0016,
- MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_BUSY = 0xC00A0017,
- MD_NTSTATUS_WIN_STATUS_CTX_BAD_VIDEO_MODE = 0xC00A0018,
- MD_NTSTATUS_WIN_STATUS_CTX_GRAPHICS_INVALID = 0xC00A0022,
- MD_NTSTATUS_WIN_STATUS_CTX_NOT_CONSOLE = 0xC00A0024,
- MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_QUERY_TIMEOUT = 0xC00A0026,
- MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_DISCONNECT = 0xC00A0027,
- MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_CONNECT = 0xC00A0028,
- MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DENIED = 0xC00A002A,
- MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_ACCESS_DENIED = 0xC00A002B,
- MD_NTSTATUS_WIN_STATUS_CTX_INVALID_WD = 0xC00A002E,
- MD_NTSTATUS_WIN_STATUS_CTX_WD_NOT_FOUND = 0xC00A002F,
- MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_INVALID = 0xC00A0030,
- MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DISABLED = 0xC00A0031,
- MD_NTSTATUS_WIN_STATUS_RDP_PROTOCOL_ERROR = 0xC00A0032,
- MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_NOT_SET = 0xC00A0033,
- MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_IN_USE = 0xC00A0034,
- MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE = 0xC00A0035,
- MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_NOT_RUNNING = 0xC00A0036,
- MD_NTSTATUS_WIN_STATUS_CTX_LOGON_DISABLED = 0xC00A0037,
- MD_NTSTATUS_WIN_STATUS_CTX_SECURITY_LAYER_ERROR = 0xC00A0038,
- MD_NTSTATUS_WIN_STATUS_TS_INCOMPATIBLE_SESSIONS = 0xC00A0039,
- MD_NTSTATUS_WIN_STATUS_TS_VIDEO_SUBSYSTEM_ERROR = 0xC00A003A,
- MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_FOUND = 0xC00B0001,
- MD_NTSTATUS_WIN_STATUS_MUI_INVALID_FILE = 0xC00B0002,
- MD_NTSTATUS_WIN_STATUS_MUI_INVALID_RC_CONFIG = 0xC00B0003,
- MD_NTSTATUS_WIN_STATUS_MUI_INVALID_LOCALE_NAME = 0xC00B0004,
- MD_NTSTATUS_WIN_STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME = 0xC00B0005,
- MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_LOADED = 0xC00B0006,
- MD_NTSTATUS_WIN_STATUS_RESOURCE_ENUM_USER_STOP = 0xC00B0007,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NODE = 0xC0130001,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_EXISTS = 0xC0130002,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_IN_PROGRESS = 0xC0130003,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_FOUND = 0xC0130004,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND = 0xC0130005,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_EXISTS = 0xC0130006,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_FOUND = 0xC0130007,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_EXISTS = 0xC0130008,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_NOT_FOUND = 0xC0130009,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_REQUEST = 0xC013000A,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK_PROVIDER = 0xC013000B,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_DOWN = 0xC013000C,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UNREACHABLE = 0xC013000D,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_MEMBER = 0xC013000E,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS = 0xC013000F,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK = 0xC0130010,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_NET_ADAPTERS = 0xC0130011,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UP = 0xC0130012,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_PAUSED = 0xC0130013,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_PAUSED = 0xC0130014,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_SECURITY_CONTEXT = 0xC0130015,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_INTERNAL = 0xC0130016,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_POISONED = 0xC0130017,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_NON_CSV_PATH = 0xC0130018,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL = 0xC0130019,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS = 0xC0130020,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR = 0xC0130021,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_REDIRECTED = 0xC0130022,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_NOT_REDIRECTED = 0xC0130023,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING = 0xC0130024,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS = 0xC0130025,
- MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL = 0xC0130026,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OPCODE = 0xC0140001,
- MD_NTSTATUS_WIN_STATUS_ACPI_STACK_OVERFLOW = 0xC0140002,
- MD_NTSTATUS_WIN_STATUS_ACPI_ASSERT_FAILED = 0xC0140003,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_INDEX = 0xC0140004,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGUMENT = 0xC0140005,
- MD_NTSTATUS_WIN_STATUS_ACPI_FATAL = 0xC0140006,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_SUPERNAME = 0xC0140007,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGTYPE = 0xC0140008,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OBJTYPE = 0xC0140009,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TARGETTYPE = 0xC014000A,
- MD_NTSTATUS_WIN_STATUS_ACPI_INCORRECT_ARGUMENT_COUNT = 0xC014000B,
- MD_NTSTATUS_WIN_STATUS_ACPI_ADDRESS_NOT_MAPPED = 0xC014000C,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_EVENTTYPE = 0xC014000D,
- MD_NTSTATUS_WIN_STATUS_ACPI_HANDLER_COLLISION = 0xC014000E,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_DATA = 0xC014000F,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_REGION = 0xC0140010,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ACCESS_SIZE = 0xC0140011,
- MD_NTSTATUS_WIN_STATUS_ACPI_ACQUIRE_GLOBAL_LOCK = 0xC0140012,
- MD_NTSTATUS_WIN_STATUS_ACPI_ALREADY_INITIALIZED = 0xC0140013,
- MD_NTSTATUS_WIN_STATUS_ACPI_NOT_INITIALIZED = 0xC0140014,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_MUTEX_LEVEL = 0xC0140015,
- MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNED = 0xC0140016,
- MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNER = 0xC0140017,
- MD_NTSTATUS_WIN_STATUS_ACPI_RS_ACCESS = 0xC0140018,
- MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TABLE = 0xC0140019,
- MD_NTSTATUS_WIN_STATUS_ACPI_REG_HANDLER_FAILED = 0xC0140020,
- MD_NTSTATUS_WIN_STATUS_ACPI_POWER_REQUEST_FAILED = 0xC0140021,
- MD_NTSTATUS_WIN_STATUS_SXS_SECTION_NOT_FOUND = 0xC0150001,
- MD_NTSTATUS_WIN_STATUS_SXS_CANT_GEN_ACTCTX = 0xC0150002,
- MD_NTSTATUS_WIN_STATUS_SXS_INVALID_ACTCTXDATA_FORMAT = 0xC0150003,
- MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_NOT_FOUND = 0xC0150004,
- MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_FORMAT_ERROR = 0xC0150005,
- MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_PARSE_ERROR = 0xC0150006,
- MD_NTSTATUS_WIN_STATUS_SXS_ACTIVATION_CONTEXT_DISABLED = 0xC0150007,
- MD_NTSTATUS_WIN_STATUS_SXS_KEY_NOT_FOUND = 0xC0150008,
- MD_NTSTATUS_WIN_STATUS_SXS_VERSION_CONFLICT = 0xC0150009,
- MD_NTSTATUS_WIN_STATUS_SXS_WRONG_SECTION_TYPE = 0xC015000A,
- MD_NTSTATUS_WIN_STATUS_SXS_THREAD_QUERIES_DISABLED = 0xC015000B,
- MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_MISSING = 0xC015000C,
- MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET = 0xC015000E,
- MD_NTSTATUS_WIN_STATUS_SXS_EARLY_DEACTIVATION = 0xC015000F,
- MD_NTSTATUS_WIN_STATUS_SXS_INVALID_DEACTIVATION = 0xC0150010,
- MD_NTSTATUS_WIN_STATUS_SXS_MULTIPLE_DEACTIVATION = 0xC0150011,
- MD_NTSTATUS_WIN_STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY = 0xC0150012,
- MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_TERMINATION_REQUESTED = 0xC0150013,
- MD_NTSTATUS_WIN_STATUS_SXS_CORRUPT_ACTIVATION_STACK = 0xC0150014,
- MD_NTSTATUS_WIN_STATUS_SXS_CORRUPTION = 0xC0150015,
- MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE = 0xC0150016,
- MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME = 0xC0150017,
- MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE = 0xC0150018,
- MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_PARSE_ERROR = 0xC0150019,
- MD_NTSTATUS_WIN_STATUS_SXS_COMPONENT_STORE_CORRUPT = 0xC015001A,
- MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISMATCH = 0xC015001B,
- MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT = 0xC015001C,
- MD_NTSTATUS_WIN_STATUS_SXS_IDENTITIES_DIFFERENT = 0xC015001D,
- MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT = 0xC015001E,
- MD_NTSTATUS_WIN_STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY = 0xC015001F,
- MD_NTSTATUS_WIN_STATUS_ADVANCED_INSTALLER_FAILED = 0xC0150020,
- MD_NTSTATUS_WIN_STATUS_XML_ENCODING_MISMATCH = 0xC0150021,
- MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_TOO_BIG = 0xC0150022,
- MD_NTSTATUS_WIN_STATUS_SXS_SETTING_NOT_REGISTERED = 0xC0150023,
- MD_NTSTATUS_WIN_STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE = 0xC0150024,
- MD_NTSTATUS_WIN_STATUS_SMI_PRIMITIVE_INSTALLER_FAILED = 0xC0150025,
- MD_NTSTATUS_WIN_STATUS_GENERIC_COMMAND_FAILED = 0xC0150026,
- MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISSING = 0xC0150027,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_CONFLICT = 0xC0190001,
- MD_NTSTATUS_WIN_STATUS_INVALID_TRANSACTION = 0xC0190002,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ACTIVE = 0xC0190003,
- MD_NTSTATUS_WIN_STATUS_TM_INITIALIZATION_FAILED = 0xC0190004,
- MD_NTSTATUS_WIN_STATUS_RM_NOT_ACTIVE = 0xC0190005,
- MD_NTSTATUS_WIN_STATUS_RM_METADATA_CORRUPT = 0xC0190006,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_JOINED = 0xC0190007,
- MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_RM = 0xC0190008,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE = 0xC019000A,
- MD_NTSTATUS_WIN_STATUS_LOG_RESIZE_INVALID_SIZE = 0xC019000B,
- MD_NTSTATUS_WIN_STATUS_REMOTE_FILE_VERSION_MISMATCH = 0xC019000C,
- MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_ALREADY_EXISTS = 0xC019000F,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_PROPAGATION_FAILED = 0xC0190010,
- MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_NOT_FOUND = 0xC0190011,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_SUPERIOR_EXISTS = 0xC0190012,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUEST_NOT_VALID = 0xC0190013,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_REQUESTED = 0xC0190014,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_ABORTED = 0xC0190015,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_COMMITTED = 0xC0190016,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER = 0xC0190017,
- MD_NTSTATUS_WIN_STATUS_CURRENT_TRANSACTION_NOT_VALID = 0xC0190018,
- MD_NTSTATUS_WIN_STATUS_LOG_GROWTH_FAILED = 0xC0190019,
- MD_NTSTATUS_WIN_STATUS_OBJECT_NO_LONGER_EXISTS = 0xC0190021,
- MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_FOUND = 0xC0190022,
- MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_VALID = 0xC0190023,
- MD_NTSTATUS_WIN_STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION = 0xC0190024,
- MD_NTSTATUS_WIN_STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT = 0xC0190025,
- MD_NTSTATUS_WIN_STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS = 0xC0190026,
- MD_NTSTATUS_WIN_STATUS_HANDLE_NO_LONGER_VALID = 0xC0190028,
- MD_NTSTATUS_WIN_STATUS_LOG_CORRUPTION_DETECTED = 0xC0190030,
- MD_NTSTATUS_WIN_STATUS_RM_DISCONNECTED = 0xC0190032,
- MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_SUPERIOR = 0xC0190033,
- MD_NTSTATUS_WIN_STATUS_FILE_IDENTITY_NOT_PERSISTENT = 0xC0190036,
- MD_NTSTATUS_WIN_STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY = 0xC0190037,
- MD_NTSTATUS_WIN_STATUS_CANT_CROSS_RM_BOUNDARY = 0xC0190038,
- MD_NTSTATUS_WIN_STATUS_TXF_DIR_NOT_EMPTY = 0xC0190039,
- MD_NTSTATUS_WIN_STATUS_INDOUBT_TRANSACTIONS_EXIST = 0xC019003A,
- MD_NTSTATUS_WIN_STATUS_TM_VOLATILE = 0xC019003B,
- MD_NTSTATUS_WIN_STATUS_ROLLBACK_TIMER_EXPIRED = 0xC019003C,
- MD_NTSTATUS_WIN_STATUS_TXF_ATTRIBUTE_CORRUPT = 0xC019003D,
- MD_NTSTATUS_WIN_STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION = 0xC019003E,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED = 0xC019003F,
- MD_NTSTATUS_WIN_STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE = 0xC0190040,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUIRED_PROMOTION = 0xC0190043,
- MD_NTSTATUS_WIN_STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION = 0xC0190044,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_NOT_FROZEN = 0xC0190045,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_FREEZE_IN_PROGRESS = 0xC0190046,
- MD_NTSTATUS_WIN_STATUS_NOT_SNAPSHOT_VOLUME = 0xC0190047,
- MD_NTSTATUS_WIN_STATUS_NO_SAVEPOINT_WITH_OPEN_FILES = 0xC0190048,
- MD_NTSTATUS_WIN_STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION = 0xC0190049,
- MD_NTSTATUS_WIN_STATUS_TM_IDENTITY_MISMATCH = 0xC019004A,
- MD_NTSTATUS_WIN_STATUS_FLOATED_SECTION = 0xC019004B,
- MD_NTSTATUS_WIN_STATUS_CANNOT_ACCEPT_TRANSACTED_WORK = 0xC019004C,
- MD_NTSTATUS_WIN_STATUS_CANNOT_ABORT_TRANSACTIONS = 0xC019004D,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_FOUND = 0xC019004E,
- MD_NTSTATUS_WIN_STATUS_RESOURCEMANAGER_NOT_FOUND = 0xC019004F,
- MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_FOUND = 0xC0190050,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_FOUND = 0xC0190051,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_ONLINE = 0xC0190052,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION = 0xC0190053,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ROOT = 0xC0190054,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_OBJECT_EXPIRED = 0xC0190055,
- MD_NTSTATUS_WIN_STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION = 0xC0190056,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED = 0xC0190057,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_RECORD_TOO_LONG = 0xC0190058,
- MD_NTSTATUS_WIN_STATUS_NO_LINK_TRACKING_IN_TRANSACTION = 0xC0190059,
- MD_NTSTATUS_WIN_STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION = 0xC019005A,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_INTEGRITY_VIOLATED = 0xC019005B,
- MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH = 0xC019005C,
- MD_NTSTATUS_WIN_STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT = 0xC019005D,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_MUST_WRITETHROUGH = 0xC019005E,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_SUPERIOR = 0xC019005F,
- MD_NTSTATUS_WIN_STATUS_EXPIRED_HANDLE = 0xC0190060,
- MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ENLISTED = 0xC0190061,
- MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_INVALID = 0xC01A0001,
- MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_PARITY_INVALID = 0xC01A0002,
- MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_REMAPPED = 0xC01A0003,
- MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INCOMPLETE = 0xC01A0004,
- MD_NTSTATUS_WIN_STATUS_LOG_INVALID_RANGE = 0xC01A0005,
- MD_NTSTATUS_WIN_STATUS_LOG_BLOCKS_EXHAUSTED = 0xC01A0006,
- MD_NTSTATUS_WIN_STATUS_LOG_READ_CONTEXT_INVALID = 0xC01A0007,
- MD_NTSTATUS_WIN_STATUS_LOG_RESTART_INVALID = 0xC01A0008,
- MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_VERSION = 0xC01A0009,
- MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INVALID = 0xC01A000A,
- MD_NTSTATUS_WIN_STATUS_LOG_READ_MODE_INVALID = 0xC01A000B,
- MD_NTSTATUS_WIN_STATUS_LOG_METADATA_CORRUPT = 0xC01A000D,
- MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INVALID = 0xC01A000E,
- MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INCONSISTENT = 0xC01A000F,
- MD_NTSTATUS_WIN_STATUS_LOG_RESERVATION_INVALID = 0xC01A0010,
- MD_NTSTATUS_WIN_STATUS_LOG_CANT_DELETE = 0xC01A0011,
- MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_LIMIT_EXCEEDED = 0xC01A0012,
- MD_NTSTATUS_WIN_STATUS_LOG_START_OF_LOG = 0xC01A0013,
- MD_NTSTATUS_WIN_STATUS_LOG_POLICY_ALREADY_INSTALLED = 0xC01A0014,
- MD_NTSTATUS_WIN_STATUS_LOG_POLICY_NOT_INSTALLED = 0xC01A0015,
- MD_NTSTATUS_WIN_STATUS_LOG_POLICY_INVALID = 0xC01A0016,
- MD_NTSTATUS_WIN_STATUS_LOG_POLICY_CONFLICT = 0xC01A0017,
- MD_NTSTATUS_WIN_STATUS_LOG_PINNED_ARCHIVE_TAIL = 0xC01A0018,
- MD_NTSTATUS_WIN_STATUS_LOG_RECORD_NONEXISTENT = 0xC01A0019,
- MD_NTSTATUS_WIN_STATUS_LOG_RECORDS_RESERVED_INVALID = 0xC01A001A,
- MD_NTSTATUS_WIN_STATUS_LOG_SPACE_RESERVED_INVALID = 0xC01A001B,
- MD_NTSTATUS_WIN_STATUS_LOG_TAIL_INVALID = 0xC01A001C,
- MD_NTSTATUS_WIN_STATUS_LOG_FULL = 0xC01A001D,
- MD_NTSTATUS_WIN_STATUS_LOG_MULTIPLEXED = 0xC01A001E,
- MD_NTSTATUS_WIN_STATUS_LOG_DEDICATED = 0xC01A001F,
- MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS = 0xC01A0020,
- MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_IN_PROGRESS = 0xC01A0021,
- MD_NTSTATUS_WIN_STATUS_LOG_EPHEMERAL = 0xC01A0022,
- MD_NTSTATUS_WIN_STATUS_LOG_NOT_ENOUGH_CONTAINERS = 0xC01A0023,
- MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_ALREADY_REGISTERED = 0xC01A0024,
- MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_NOT_REGISTERED = 0xC01A0025,
- MD_NTSTATUS_WIN_STATUS_LOG_FULL_HANDLER_IN_PROGRESS = 0xC01A0026,
- MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_READ_FAILED = 0xC01A0027,
- MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_WRITE_FAILED = 0xC01A0028,
- MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_OPEN_FAILED = 0xC01A0029,
- MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_STATE_INVALID = 0xC01A002A,
- MD_NTSTATUS_WIN_STATUS_LOG_STATE_INVALID = 0xC01A002B,
- MD_NTSTATUS_WIN_STATUS_LOG_PINNED = 0xC01A002C,
- MD_NTSTATUS_WIN_STATUS_LOG_METADATA_FLUSH_FAILED = 0xC01A002D,
- MD_NTSTATUS_WIN_STATUS_LOG_INCONSISTENT_SECURITY = 0xC01A002E,
- MD_NTSTATUS_WIN_STATUS_LOG_APPENDED_FLUSH_FAILED = 0xC01A002F,
- MD_NTSTATUS_WIN_STATUS_LOG_PINNED_RESERVATION = 0xC01A0030,
- MD_NTSTATUS_WIN_STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD = 0xC01B00EA,
- MD_NTSTATUS_WIN_STATUS_FLT_NO_HANDLER_DEFINED = 0xC01C0001,
- MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_DEFINED = 0xC01C0002,
- MD_NTSTATUS_WIN_STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST = 0xC01C0003,
- MD_NTSTATUS_WIN_STATUS_FLT_DISALLOW_FAST_IO = 0xC01C0004,
- MD_NTSTATUS_WIN_STATUS_FLT_INVALID_NAME_REQUEST = 0xC01C0005,
- MD_NTSTATUS_WIN_STATUS_FLT_NOT_SAFE_TO_POST_OPERATION = 0xC01C0006,
- MD_NTSTATUS_WIN_STATUS_FLT_NOT_INITIALIZED = 0xC01C0007,
- MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_READY = 0xC01C0008,
- MD_NTSTATUS_WIN_STATUS_FLT_POST_OPERATION_CLEANUP = 0xC01C0009,
- MD_NTSTATUS_WIN_STATUS_FLT_INTERNAL_ERROR = 0xC01C000A,
- MD_NTSTATUS_WIN_STATUS_FLT_DELETING_OBJECT = 0xC01C000B,
- MD_NTSTATUS_WIN_STATUS_FLT_MUST_BE_NONPAGED_POOL = 0xC01C000C,
- MD_NTSTATUS_WIN_STATUS_FLT_DUPLICATE_ENTRY = 0xC01C000D,
- MD_NTSTATUS_WIN_STATUS_FLT_CBDQ_DISABLED = 0xC01C000E,
- MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_ATTACH = 0xC01C000F,
- MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_DETACH = 0xC01C0010,
- MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_ALTITUDE_COLLISION = 0xC01C0011,
- MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NAME_COLLISION = 0xC01C0012,
- MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_FOUND = 0xC01C0013,
- MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_NOT_FOUND = 0xC01C0014,
- MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NOT_FOUND = 0xC01C0015,
- MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND = 0xC01C0016,
- MD_NTSTATUS_WIN_STATUS_FLT_INVALID_CONTEXT_REGISTRATION = 0xC01C0017,
- MD_NTSTATUS_WIN_STATUS_FLT_NAME_CACHE_MISS = 0xC01C0018,
- MD_NTSTATUS_WIN_STATUS_FLT_NO_DEVICE_OBJECT = 0xC01C0019,
- MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_ALREADY_MOUNTED = 0xC01C001A,
- MD_NTSTATUS_WIN_STATUS_FLT_ALREADY_ENLISTED = 0xC01C001B,
- MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_LINKED = 0xC01C001C,
- MD_NTSTATUS_WIN_STATUS_FLT_NO_WAITER_FOR_REPLY = 0xC01C0020,
- MD_NTSTATUS_WIN_STATUS_FLT_REGISTRATION_BUSY = 0xC01C0023,
- MD_NTSTATUS_WIN_STATUS_MONITOR_NO_DESCRIPTOR = 0xC01D0001,
- MD_NTSTATUS_WIN_STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT = 0xC01D0002,
- MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM = 0xC01D0003,
- MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK = 0xC01D0004,
- MD_NTSTATUS_WIN_STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED = 0xC01D0005,
- MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK = 0xC01D0006,
- MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK = 0xC01D0007,
- MD_NTSTATUS_WIN_STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA = 0xC01D0008,
- MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK = 0xC01D0009,
- MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_MANUFACTURE_DATE = 0xC01D000A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER = 0xC01E0000,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER = 0xC01E0001,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER = 0xC01E0002,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_WAS_RESET = 0xC01E0003,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DRIVER_MODEL = 0xC01E0004,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_MODE_CHANGED = 0xC01E0005,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_OCCLUDED = 0xC01E0006,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_DENIED = 0xC01E0007,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANNOTCOLORCONVERT = 0xC01E0008,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DRIVER_MISMATCH = 0xC01E0009,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED = 0xC01E000B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_UNOCCLUDED = 0xC01E000C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE = 0xC01E000D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED = 0xC01E000E,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDEO_MEMORY = 0xC01E0100,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_LOCK_MEMORY = 0xC01E0101,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_BUSY = 0xC01E0102,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOO_MANY_REFERENCES = 0xC01E0103,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_LATER = 0xC01E0104,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_NOW = 0xC01E0105,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_INVALID = 0xC01E0106,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE = 0xC01E0107,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED = 0xC01E0108,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION = 0xC01E0109,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE = 0xC01E0110,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION = 0xC01E0111,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CLOSED = 0xC01E0112,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE = 0xC01E0113,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE = 0xC01E0114,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE = 0xC01E0115,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST = 0xC01E0116,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE = 0xC01E0200,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY = 0xC01E0300,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED = 0xC01E0301,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED = 0xC01E0302,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN = 0xC01E0303,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE = 0xC01E0304,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET = 0xC01E0305,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED = 0xC01E0306,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET = 0xC01E0308,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET = 0xC01E0309,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_FREQUENCY = 0xC01E030A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ACTIVE_REGION = 0xC01E030B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_TOTAL_REGION = 0xC01E030C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE = 0xC01E0310,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE = 0xC01E0311,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET = 0xC01E0312,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY = 0xC01E0313,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET = 0xC01E0314,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET = 0xC01E0315,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET = 0xC01E0316,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET = 0xC01E0317,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ALREADY_IN_SET = 0xC01E0318,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH = 0xC01E0319,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY = 0xC01E031A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET = 0xC01E031B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE = 0xC01E031C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET = 0xC01E031D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET = 0xC01E031F,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_MODESET = 0xC01E0320,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET = 0xC01E0321,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE = 0xC01E0322,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN = 0xC01E0323,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE = 0xC01E0324,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION = 0xC01E0325,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES = 0xC01E0326,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY = 0xC01E0327,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE = 0xC01E0328,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET = 0xC01E0329,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET = 0xC01E032A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR = 0xC01E032B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET = 0xC01E032C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET = 0xC01E032D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE = 0xC01E032E,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE = 0xC01E032F,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_RESOURCES_NOT_RELATED = 0xC01E0330,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE = 0xC01E0331,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE = 0xC01E0332,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET = 0xC01E0333,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER = 0xC01E0334,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDPNMGR = 0xC01E0335,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_ACTIVE_VIDPN = 0xC01E0336,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY = 0xC01E0337,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NOT_CONNECTED = 0xC01E0338,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY = 0xC01E0339,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE = 0xC01E033A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE = 0xC01E033B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_STRIDE = 0xC01E033C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELFORMAT = 0xC01E033D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COLORBASIS = 0xC01E033E,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE = 0xC01E033F,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY = 0xC01E0340,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT = 0xC01E0341,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE = 0xC01E0342,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN = 0xC01E0343,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL = 0xC01E0344,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION = 0xC01E0345,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED = 0xC01E0346,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_GAMMA_RAMP = 0xC01E0347,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED = 0xC01E0348,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED = 0xC01E0349,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_NOT_IN_MODESET = 0xC01E034A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON = 0xC01E034D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE = 0xC01E034E,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE = 0xC01E034F,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS = 0xC01E0350,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING = 0xC01E0352,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED = 0xC01E0353,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS = 0xC01E0354,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT = 0xC01E0355,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM = 0xC01E0356,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN = 0xC01E0357,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT = 0xC01E0358,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED = 0xC01E0359,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION = 0xC01E035A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_CLIENT_TYPE = 0xC01E035B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET = 0xC01E035C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED = 0xC01E0400,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED = 0xC01E0401,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER = 0xC01E0430,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED = 0xC01E0431,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED = 0xC01E0432,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY = 0xC01E0433,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED = 0xC01E0434,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON = 0xC01E0435,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE = 0xC01E0436,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER = 0xC01E0438,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED = 0xC01E043B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NOT_SUPPORTED = 0xC01E0500,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_COPP_NOT_SUPPORTED = 0xC01E0501,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_UAB_NOT_SUPPORTED = 0xC01E0502,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS = 0xC01E0503,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST = 0xC01E0505,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INTERNAL_ERROR = 0xC01E050B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_HANDLE = 0xC01E050C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH = 0xC01E050E,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED = 0xC01E050F,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED = 0xC01E0510,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_HFS_FAILED = 0xC01E0511,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_SRM = 0xC01E0512,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP = 0xC01E0513,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP = 0xC01E0514,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA = 0xC01E0515,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET = 0xC01E0516,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH = 0xC01E0517,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE = 0xC01E0518,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS = 0xC01E051A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS = 0xC01E051C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST = 0xC01E051D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR = 0xC01E051E,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS = 0xC01E051F,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED = 0xC01E0520,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST = 0xC01E0521,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_NOT_SUPPORTED = 0xC01E0580,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST = 0xC01E0581,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA = 0xC01E0582,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA = 0xC01E0583,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED = 0xC01E0584,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_DATA = 0xC01E0585,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE = 0xC01E0586,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING = 0xC01E0587,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MCA_INTERNAL_ERROR = 0xC01E0588,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND = 0xC01E0589,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH = 0xC01E058A,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM = 0xC01E058B,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE = 0xC01E058C,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS = 0xC01E058D,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED = 0xC01E05E0,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME = 0xC01E05E1,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP = 0xC01E05E2,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED = 0xC01E05E3,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_POINTER = 0xC01E05E4,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE = 0xC01E05E5,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL = 0xC01E05E6,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_INTERNAL_ERROR = 0xC01E05E7,
- MD_NTSTATUS_WIN_STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS = 0xC01E05E8,
- MD_NTSTATUS_WIN_STATUS_FVE_LOCKED_VOLUME = 0xC0210000,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_ENCRYPTED = 0xC0210001,
- MD_NTSTATUS_WIN_STATUS_FVE_BAD_INFORMATION = 0xC0210002,
- MD_NTSTATUS_WIN_STATUS_FVE_TOO_SMALL = 0xC0210003,
- MD_NTSTATUS_WIN_STATUS_FVE_FAILED_WRONG_FS = 0xC0210004,
- MD_NTSTATUS_WIN_STATUS_FVE_BAD_PARTITION_SIZE = 0xC0210005,
- MD_NTSTATUS_WIN_STATUS_FVE_FS_NOT_EXTENDED = 0xC0210006,
- MD_NTSTATUS_WIN_STATUS_FVE_FS_MOUNTED = 0xC0210007,
- MD_NTSTATUS_WIN_STATUS_FVE_NO_LICENSE = 0xC0210008,
- MD_NTSTATUS_WIN_STATUS_FVE_ACTION_NOT_ALLOWED = 0xC0210009,
- MD_NTSTATUS_WIN_STATUS_FVE_BAD_DATA = 0xC021000A,
- MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_NOT_BOUND = 0xC021000B,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_DATA_VOLUME = 0xC021000C,
- MD_NTSTATUS_WIN_STATUS_FVE_CONV_READ_ERROR = 0xC021000D,
- MD_NTSTATUS_WIN_STATUS_FVE_CONV_WRITE_ERROR = 0xC021000E,
- MD_NTSTATUS_WIN_STATUS_FVE_OVERLAPPED_UPDATE = 0xC021000F,
- MD_NTSTATUS_WIN_STATUS_FVE_FAILED_SECTOR_SIZE = 0xC0210010,
- MD_NTSTATUS_WIN_STATUS_FVE_FAILED_AUTHENTICATION = 0xC0210011,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_OS_VOLUME = 0xC0210012,
- MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NOT_FOUND = 0xC0210013,
- MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_INVALID = 0xC0210014,
- MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NO_VMK = 0xC0210015,
- MD_NTSTATUS_WIN_STATUS_FVE_TPM_DISABLED = 0xC0210016,
- MD_NTSTATUS_WIN_STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO = 0xC0210017,
- MD_NTSTATUS_WIN_STATUS_FVE_TPM_INVALID_PCR = 0xC0210018,
- MD_NTSTATUS_WIN_STATUS_FVE_TPM_NO_VMK = 0xC0210019,
- MD_NTSTATUS_WIN_STATUS_FVE_PIN_INVALID = 0xC021001A,
- MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_APPLICATION = 0xC021001B,
- MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_CONFIG = 0xC021001C,
- MD_NTSTATUS_WIN_STATUS_FVE_DEBUGGER_ENABLED = 0xC021001D,
- MD_NTSTATUS_WIN_STATUS_FVE_DRY_RUN_FAILED = 0xC021001E,
- MD_NTSTATUS_WIN_STATUS_FVE_BAD_METADATA_POINTER = 0xC021001F,
- MD_NTSTATUS_WIN_STATUS_FVE_OLD_METADATA_COPY = 0xC0210020,
- MD_NTSTATUS_WIN_STATUS_FVE_REBOOT_REQUIRED = 0xC0210021,
- MD_NTSTATUS_WIN_STATUS_FVE_RAW_ACCESS = 0xC0210022,
- MD_NTSTATUS_WIN_STATUS_FVE_RAW_BLOCKED = 0xC0210023,
- MD_NTSTATUS_WIN_STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY = 0xC0210024,
- MD_NTSTATUS_WIN_STATUS_FVE_MOR_FAILED = 0xC0210025,
- MD_NTSTATUS_WIN_STATUS_FVE_NO_FEATURE_LICENSE = 0xC0210026,
- MD_NTSTATUS_WIN_STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED = 0xC0210027,
- MD_NTSTATUS_WIN_STATUS_FVE_CONV_RECOVERY_FAILED = 0xC0210028,
- MD_NTSTATUS_WIN_STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG = 0xC0210029,
- MD_NTSTATUS_WIN_STATUS_FVE_INVALID_DATUM_TYPE = 0xC021002A,
- MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_TOO_SMALL = 0xC0210030,
- MD_NTSTATUS_WIN_STATUS_FVE_ENH_PIN_INVALID = 0xC0210031,
- MD_NTSTATUS_WIN_STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE = 0xC0210032,
- MD_NTSTATUS_WIN_STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE = 0xC0210033,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK = 0xC0210034,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CLUSTER = 0xC0210035,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING = 0xC0210036,
- MD_NTSTATUS_WIN_STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE = 0xC0210037,
- MD_NTSTATUS_WIN_STATUS_FVE_EDRIVE_DRY_RUN_FAILED = 0xC0210038,
- MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_DISABLED = 0xC0210039,
- MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_CONFIG_CHANGE = 0xC021003A,
- MD_NTSTATUS_WIN_STATUS_FVE_DEVICE_LOCKEDOUT = 0xC021003B,
- MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT = 0xC021003C,
- MD_NTSTATUS_WIN_STATUS_FVE_NOT_DE_VOLUME = 0xC021003D,
- MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_DISABLED = 0xC021003E,
- MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED = 0xC021003F,
- MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOT_FOUND = 0xC0220001,
- MD_NTSTATUS_WIN_STATUS_FWP_CONDITION_NOT_FOUND = 0xC0220002,
- MD_NTSTATUS_WIN_STATUS_FWP_FILTER_NOT_FOUND = 0xC0220003,
- MD_NTSTATUS_WIN_STATUS_FWP_LAYER_NOT_FOUND = 0xC0220004,
- MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_NOT_FOUND = 0xC0220005,
- MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND = 0xC0220006,
- MD_NTSTATUS_WIN_STATUS_FWP_SUBLAYER_NOT_FOUND = 0xC0220007,
- MD_NTSTATUS_WIN_STATUS_FWP_NOT_FOUND = 0xC0220008,
- MD_NTSTATUS_WIN_STATUS_FWP_ALREADY_EXISTS = 0xC0220009,
- MD_NTSTATUS_WIN_STATUS_FWP_IN_USE = 0xC022000A,
- MD_NTSTATUS_WIN_STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS = 0xC022000B,
- MD_NTSTATUS_WIN_STATUS_FWP_WRONG_SESSION = 0xC022000C,
- MD_NTSTATUS_WIN_STATUS_FWP_NO_TXN_IN_PROGRESS = 0xC022000D,
- MD_NTSTATUS_WIN_STATUS_FWP_TXN_IN_PROGRESS = 0xC022000E,
- MD_NTSTATUS_WIN_STATUS_FWP_TXN_ABORTED = 0xC022000F,
- MD_NTSTATUS_WIN_STATUS_FWP_SESSION_ABORTED = 0xC0220010,
- MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_TXN = 0xC0220011,
- MD_NTSTATUS_WIN_STATUS_FWP_TIMEOUT = 0xC0220012,
- MD_NTSTATUS_WIN_STATUS_FWP_NET_EVENTS_DISABLED = 0xC0220013,
- MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_LAYER = 0xC0220014,
- MD_NTSTATUS_WIN_STATUS_FWP_KM_CLIENTS_ONLY = 0xC0220015,
- MD_NTSTATUS_WIN_STATUS_FWP_LIFETIME_MISMATCH = 0xC0220016,
- MD_NTSTATUS_WIN_STATUS_FWP_BUILTIN_OBJECT = 0xC0220017,
- MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_CALLOUTS = 0xC0220018,
- MD_NTSTATUS_WIN_STATUS_FWP_NOTIFICATION_DROPPED = 0xC0220019,
- MD_NTSTATUS_WIN_STATUS_FWP_TRAFFIC_MISMATCH = 0xC022001A,
- MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_SA_STATE = 0xC022001B,
- MD_NTSTATUS_WIN_STATUS_FWP_NULL_POINTER = 0xC022001C,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ENUMERATOR = 0xC022001D,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_FLAGS = 0xC022001E,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_NET_MASK = 0xC022001F,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_RANGE = 0xC0220020,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_INTERVAL = 0xC0220021,
- MD_NTSTATUS_WIN_STATUS_FWP_ZERO_LENGTH_ARRAY = 0xC0220022,
- MD_NTSTATUS_WIN_STATUS_FWP_NULL_DISPLAY_NAME = 0xC0220023,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ACTION_TYPE = 0xC0220024,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_WEIGHT = 0xC0220025,
- MD_NTSTATUS_WIN_STATUS_FWP_MATCH_TYPE_MISMATCH = 0xC0220026,
- MD_NTSTATUS_WIN_STATUS_FWP_TYPE_MISMATCH = 0xC0220027,
- MD_NTSTATUS_WIN_STATUS_FWP_OUT_OF_BOUNDS = 0xC0220028,
- MD_NTSTATUS_WIN_STATUS_FWP_RESERVED = 0xC0220029,
- MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_CONDITION = 0xC022002A,
- MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_KEYMOD = 0xC022002B,
- MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER = 0xC022002C,
- MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER = 0xC022002D,
- MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER = 0xC022002E,
- MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT = 0xC022002F,
- MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_AUTH_METHOD = 0xC0220030,
- MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_DH_GROUP = 0xC0220031,
- MD_NTSTATUS_WIN_STATUS_FWP_EM_NOT_SUPPORTED = 0xC0220032,
- MD_NTSTATUS_WIN_STATUS_FWP_NEVER_MATCH = 0xC0220033,
- MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_MISMATCH = 0xC0220034,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_PARAMETER = 0xC0220035,
- MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_SUBLAYERS = 0xC0220036,
- MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOTIFICATION_FAILED = 0xC0220037,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_AUTH_TRANSFORM = 0xC0220038,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_CIPHER_TRANSFORM = 0xC0220039,
- MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM = 0xC022003A,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TRANSFORM_COMBINATION = 0xC022003B,
- MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_AUTH_METHOD = 0xC022003C,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TUNNEL_ENDPOINT = 0xC022003D,
- MD_NTSTATUS_WIN_STATUS_FWP_L2_DRIVER_NOT_READY = 0xC022003E,
- MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED = 0xC022003F,
- MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL = 0xC0220040,
- MD_NTSTATUS_WIN_STATUS_FWP_CONNECTIONS_DISABLED = 0xC0220041,
- MD_NTSTATUS_WIN_STATUS_FWP_INVALID_DNS_NAME = 0xC0220042,
- MD_NTSTATUS_WIN_STATUS_FWP_STILL_ON = 0xC0220043,
- MD_NTSTATUS_WIN_STATUS_FWP_IKEEXT_NOT_RUNNING = 0xC0220044,
- MD_NTSTATUS_WIN_STATUS_FWP_TCPIP_NOT_READY = 0xC0220100,
- MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_CLOSING = 0xC0220101,
- MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_STALE = 0xC0220102,
- MD_NTSTATUS_WIN_STATUS_FWP_CANNOT_PEND = 0xC0220103,
- MD_NTSTATUS_WIN_STATUS_FWP_DROP_NOICMP = 0xC0220104,
- MD_NTSTATUS_WIN_STATUS_NDIS_CLOSING = 0xC0230002,
- MD_NTSTATUS_WIN_STATUS_NDIS_BAD_VERSION = 0xC0230004,
- MD_NTSTATUS_WIN_STATUS_NDIS_BAD_CHARACTERISTICS = 0xC0230005,
- MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_FOUND = 0xC0230006,
- MD_NTSTATUS_WIN_STATUS_NDIS_OPEN_FAILED = 0xC0230007,
- MD_NTSTATUS_WIN_STATUS_NDIS_DEVICE_FAILED = 0xC0230008,
- MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_FULL = 0xC0230009,
- MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_EXISTS = 0xC023000A,
- MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_NOT_FOUND = 0xC023000B,
- MD_NTSTATUS_WIN_STATUS_NDIS_REQUEST_ABORTED = 0xC023000C,
- MD_NTSTATUS_WIN_STATUS_NDIS_RESET_IN_PROGRESS = 0xC023000D,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PACKET = 0xC023000F,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DEVICE_REQUEST = 0xC0230010,
- MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_READY = 0xC0230011,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_LENGTH = 0xC0230014,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DATA = 0xC0230015,
- MD_NTSTATUS_WIN_STATUS_NDIS_BUFFER_TOO_SHORT = 0xC0230016,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_OID = 0xC0230017,
- MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_REMOVED = 0xC0230018,
- MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_MEDIA = 0xC0230019,
- MD_NTSTATUS_WIN_STATUS_NDIS_GROUP_ADDRESS_IN_USE = 0xC023001A,
- MD_NTSTATUS_WIN_STATUS_NDIS_FILE_NOT_FOUND = 0xC023001B,
- MD_NTSTATUS_WIN_STATUS_NDIS_ERROR_READING_FILE = 0xC023001C,
- MD_NTSTATUS_WIN_STATUS_NDIS_ALREADY_MAPPED = 0xC023001D,
- MD_NTSTATUS_WIN_STATUS_NDIS_RESOURCE_CONFLICT = 0xC023001E,
- MD_NTSTATUS_WIN_STATUS_NDIS_MEDIA_DISCONNECTED = 0xC023001F,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_ADDRESS = 0xC0230022,
- MD_NTSTATUS_WIN_STATUS_NDIS_PAUSED = 0xC023002A,
- MD_NTSTATUS_WIN_STATUS_NDIS_INTERFACE_NOT_FOUND = 0xC023002B,
- MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_REVISION = 0xC023002C,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT = 0xC023002D,
- MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT_STATE = 0xC023002E,
- MD_NTSTATUS_WIN_STATUS_NDIS_LOW_POWER_STATE = 0xC023002F,
- MD_NTSTATUS_WIN_STATUS_NDIS_REINIT_REQUIRED = 0xC0230030,
- MD_NTSTATUS_WIN_STATUS_NDIS_NOT_SUPPORTED = 0xC02300BB,
- MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_POLICY = 0xC023100F,
- MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED = 0xC0231012,
- MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_PATH_REJECTED = 0xC0231013,
- MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED = 0xC0232000,
- MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_MEDIA_IN_USE = 0xC0232001,
- MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_POWER_STATE_INVALID = 0xC0232002,
- MD_NTSTATUS_WIN_STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL = 0xC0232003,
- MD_NTSTATUS_WIN_STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL = 0xC0232004,
- MD_NTSTATUS_WIN_STATUS_TPM_ERROR_MASK = 0xC0290000,
- MD_NTSTATUS_WIN_STATUS_TPM_AUTHFAIL = 0xC0290001,
- MD_NTSTATUS_WIN_STATUS_TPM_BADINDEX = 0xC0290002,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAMETER = 0xC0290003,
- MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAILURE = 0xC0290004,
- MD_NTSTATUS_WIN_STATUS_TPM_CLEAR_DISABLED = 0xC0290005,
- MD_NTSTATUS_WIN_STATUS_TPM_DEACTIVATED = 0xC0290006,
- MD_NTSTATUS_WIN_STATUS_TPM_DISABLED = 0xC0290007,
- MD_NTSTATUS_WIN_STATUS_TPM_DISABLED_CMD = 0xC0290008,
- MD_NTSTATUS_WIN_STATUS_TPM_FAIL = 0xC0290009,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_ORDINAL = 0xC029000A,
- MD_NTSTATUS_WIN_STATUS_TPM_INSTALL_DISABLED = 0xC029000B,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYHANDLE = 0xC029000C,
- MD_NTSTATUS_WIN_STATUS_TPM_KEYNOTFOUND = 0xC029000D,
- MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_ENC = 0xC029000E,
- MD_NTSTATUS_WIN_STATUS_TPM_MIGRATEFAIL = 0xC029000F,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_PCR_INFO = 0xC0290010,
- MD_NTSTATUS_WIN_STATUS_TPM_NOSPACE = 0xC0290011,
- MD_NTSTATUS_WIN_STATUS_TPM_NOSRK = 0xC0290012,
- MD_NTSTATUS_WIN_STATUS_TPM_NOTSEALED_BLOB = 0xC0290013,
- MD_NTSTATUS_WIN_STATUS_TPM_OWNER_SET = 0xC0290014,
- MD_NTSTATUS_WIN_STATUS_TPM_RESOURCES = 0xC0290015,
- MD_NTSTATUS_WIN_STATUS_TPM_SHORTRANDOM = 0xC0290016,
- MD_NTSTATUS_WIN_STATUS_TPM_SIZE = 0xC0290017,
- MD_NTSTATUS_WIN_STATUS_TPM_WRONGPCRVAL = 0xC0290018,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAM_SIZE = 0xC0290019,
- MD_NTSTATUS_WIN_STATUS_TPM_SHA_THREAD = 0xC029001A,
- MD_NTSTATUS_WIN_STATUS_TPM_SHA_ERROR = 0xC029001B,
- MD_NTSTATUS_WIN_STATUS_TPM_FAILEDSELFTEST = 0xC029001C,
- MD_NTSTATUS_WIN_STATUS_TPM_AUTH2FAIL = 0xC029001D,
- MD_NTSTATUS_WIN_STATUS_TPM_BADTAG = 0xC029001E,
- MD_NTSTATUS_WIN_STATUS_TPM_IOERROR = 0xC029001F,
- MD_NTSTATUS_WIN_STATUS_TPM_ENCRYPT_ERROR = 0xC0290020,
- MD_NTSTATUS_WIN_STATUS_TPM_DECRYPT_ERROR = 0xC0290021,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_AUTHHANDLE = 0xC0290022,
- MD_NTSTATUS_WIN_STATUS_TPM_NO_ENDORSEMENT = 0xC0290023,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYUSAGE = 0xC0290024,
- MD_NTSTATUS_WIN_STATUS_TPM_WRONG_ENTITYTYPE = 0xC0290025,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_POSTINIT = 0xC0290026,
- MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_SIG = 0xC0290027,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_KEY_PROPERTY = 0xC0290028,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_MIGRATION = 0xC0290029,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_SCHEME = 0xC029002A,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_DATASIZE = 0xC029002B,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_MODE = 0xC029002C,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_PRESENCE = 0xC029002D,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_VERSION = 0xC029002E,
- MD_NTSTATUS_WIN_STATUS_TPM_NO_WRAP_TRANSPORT = 0xC029002F,
- MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_UNSUCCESSFUL = 0xC0290030,
- MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_SUCCESSFUL = 0xC0290031,
- MD_NTSTATUS_WIN_STATUS_TPM_NOTRESETABLE = 0xC0290032,
- MD_NTSTATUS_WIN_STATUS_TPM_NOTLOCAL = 0xC0290033,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_TYPE = 0xC0290034,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_RESOURCE = 0xC0290035,
- MD_NTSTATUS_WIN_STATUS_TPM_NOTFIPS = 0xC0290036,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_FAMILY = 0xC0290037,
- MD_NTSTATUS_WIN_STATUS_TPM_NO_NV_PERMISSION = 0xC0290038,
- MD_NTSTATUS_WIN_STATUS_TPM_REQUIRES_SIGN = 0xC0290039,
- MD_NTSTATUS_WIN_STATUS_TPM_KEY_NOTSUPPORTED = 0xC029003A,
- MD_NTSTATUS_WIN_STATUS_TPM_AUTH_CONFLICT = 0xC029003B,
- MD_NTSTATUS_WIN_STATUS_TPM_AREA_LOCKED = 0xC029003C,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_LOCALITY = 0xC029003D,
- MD_NTSTATUS_WIN_STATUS_TPM_READ_ONLY = 0xC029003E,
- MD_NTSTATUS_WIN_STATUS_TPM_PER_NOWRITE = 0xC029003F,
- MD_NTSTATUS_WIN_STATUS_TPM_FAMILYCOUNT = 0xC0290040,
- MD_NTSTATUS_WIN_STATUS_TPM_WRITE_LOCKED = 0xC0290041,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_ATTRIBUTES = 0xC0290042,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_STRUCTURE = 0xC0290043,
- MD_NTSTATUS_WIN_STATUS_TPM_KEY_OWNER_CONTROL = 0xC0290044,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_COUNTER = 0xC0290045,
- MD_NTSTATUS_WIN_STATUS_TPM_NOT_FULLWRITE = 0xC0290046,
- MD_NTSTATUS_WIN_STATUS_TPM_CONTEXT_GAP = 0xC0290047,
- MD_NTSTATUS_WIN_STATUS_TPM_MAXNVWRITES = 0xC0290048,
- MD_NTSTATUS_WIN_STATUS_TPM_NOOPERATOR = 0xC0290049,
- MD_NTSTATUS_WIN_STATUS_TPM_RESOURCEMISSING = 0xC029004A,
- MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_LOCK = 0xC029004B,
- MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_FAMILY = 0xC029004C,
- MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_ADMIN = 0xC029004D,
- MD_NTSTATUS_WIN_STATUS_TPM_TRANSPORT_NOTEXCLUSIVE = 0xC029004E,
- MD_NTSTATUS_WIN_STATUS_TPM_OWNER_CONTROL = 0xC029004F,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_RESOURCES = 0xC0290050,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA0 = 0xC0290051,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA1 = 0xC0290052,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_SETTINGS = 0xC0290053,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_TPM_SETTINGS = 0xC0290054,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_STAGE = 0xC0290055,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_VALIDITY = 0xC0290056,
- MD_NTSTATUS_WIN_STATUS_TPM_DAA_WRONG_W = 0xC0290057,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_HANDLE = 0xC0290058,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_DELEGATE = 0xC0290059,
- MD_NTSTATUS_WIN_STATUS_TPM_BADCONTEXT = 0xC029005A,
- MD_NTSTATUS_WIN_STATUS_TPM_TOOMANYCONTEXTS = 0xC029005B,
- MD_NTSTATUS_WIN_STATUS_TPM_MA_TICKET_SIGNATURE = 0xC029005C,
- MD_NTSTATUS_WIN_STATUS_TPM_MA_DESTINATION = 0xC029005D,
- MD_NTSTATUS_WIN_STATUS_TPM_MA_SOURCE = 0xC029005E,
- MD_NTSTATUS_WIN_STATUS_TPM_MA_AUTHORITY = 0xC029005F,
- MD_NTSTATUS_WIN_STATUS_TPM_PERMANENTEK = 0xC0290061,
- MD_NTSTATUS_WIN_STATUS_TPM_BAD_SIGNATURE = 0xC0290062,
- MD_NTSTATUS_WIN_STATUS_TPM_NOCONTEXTSPACE = 0xC0290063,
- MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_BLOCKED = 0xC0290400,
- MD_NTSTATUS_WIN_STATUS_TPM_INVALID_HANDLE = 0xC0290401,
- MD_NTSTATUS_WIN_STATUS_TPM_DUPLICATE_VHANDLE = 0xC0290402,
- MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_BLOCKED = 0xC0290403,
- MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED = 0xC0290404,
- MD_NTSTATUS_WIN_STATUS_TPM_RETRY = 0xC0290800,
- MD_NTSTATUS_WIN_STATUS_TPM_NEEDS_SELFTEST = 0xC0290801,
- MD_NTSTATUS_WIN_STATUS_TPM_DOING_SELFTEST = 0xC0290802,
- MD_NTSTATUS_WIN_STATUS_TPM_DEFEND_LOCK_RUNNING = 0xC0290803,
- MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_CANCELED = 0xC0291001,
- MD_NTSTATUS_WIN_STATUS_TPM_TOO_MANY_CONTEXTS = 0xC0291002,
- MD_NTSTATUS_WIN_STATUS_TPM_NOT_FOUND = 0xC0291003,
- MD_NTSTATUS_WIN_STATUS_TPM_ACCESS_DENIED = 0xC0291004,
- MD_NTSTATUS_WIN_STATUS_TPM_INSUFFICIENT_BUFFER = 0xC0291005,
- MD_NTSTATUS_WIN_STATUS_TPM_PPI_FUNCTION_UNSUPPORTED = 0xC0291006,
- MD_NTSTATUS_WIN_STATUS_PCP_ERROR_MASK = 0xC0292000,
- MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_READY = 0xC0292001,
- MD_NTSTATUS_WIN_STATUS_PCP_INVALID_HANDLE = 0xC0292002,
- MD_NTSTATUS_WIN_STATUS_PCP_INVALID_PARAMETER = 0xC0292003,
- MD_NTSTATUS_WIN_STATUS_PCP_FLAG_NOT_SUPPORTED = 0xC0292004,
- MD_NTSTATUS_WIN_STATUS_PCP_NOT_SUPPORTED = 0xC0292005,
- MD_NTSTATUS_WIN_STATUS_PCP_BUFFER_TOO_SMALL = 0xC0292006,
- MD_NTSTATUS_WIN_STATUS_PCP_INTERNAL_ERROR = 0xC0292007,
- MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_FAILED = 0xC0292008,
- MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_IGNORED = 0xC0292009,
- MD_NTSTATUS_WIN_STATUS_PCP_POLICY_NOT_FOUND = 0xC029200A,
- MD_NTSTATUS_WIN_STATUS_PCP_PROFILE_NOT_FOUND = 0xC029200B,
- MD_NTSTATUS_WIN_STATUS_PCP_VALIDATION_FAILED = 0xC029200C,
- MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_FOUND = 0xC029200D,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_CODE = 0xC0350002,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_INPUT = 0xC0350003,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_ALIGNMENT = 0xC0350004,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARAMETER = 0xC0350005,
- MD_NTSTATUS_WIN_STATUS_HV_ACCESS_DENIED = 0xC0350006,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_STATE = 0xC0350007,
- MD_NTSTATUS_WIN_STATUS_HV_OPERATION_DENIED = 0xC0350008,
- MD_NTSTATUS_WIN_STATUS_HV_UNKNOWN_PROPERTY = 0xC0350009,
- MD_NTSTATUS_WIN_STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE = 0xC035000A,
- MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_MEMORY = 0xC035000B,
- MD_NTSTATUS_WIN_STATUS_HV_PARTITION_TOO_DEEP = 0xC035000C,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_ID = 0xC035000D,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_VP_INDEX = 0xC035000E,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_PORT_ID = 0xC0350011,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_CONNECTION_ID = 0xC0350012,
- MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFERS = 0xC0350013,
- MD_NTSTATUS_WIN_STATUS_HV_NOT_ACKNOWLEDGED = 0xC0350014,
- MD_NTSTATUS_WIN_STATUS_HV_ACKNOWLEDGED = 0xC0350016,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_SAVE_RESTORE_STATE = 0xC0350017,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_SYNIC_STATE = 0xC0350018,
- MD_NTSTATUS_WIN_STATUS_HV_OBJECT_IN_USE = 0xC0350019,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO = 0xC035001A,
- MD_NTSTATUS_WIN_STATUS_HV_NO_DATA = 0xC035001B,
- MD_NTSTATUS_WIN_STATUS_HV_INACTIVE = 0xC035001C,
- MD_NTSTATUS_WIN_STATUS_HV_NO_RESOURCES = 0xC035001D,
- MD_NTSTATUS_WIN_STATUS_HV_FEATURE_UNAVAILABLE = 0xC035001E,
- MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFER = 0xC0350033,
- MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS = 0xC0350038,
- MD_NTSTATUS_WIN_STATUS_HV_INVALID_LP_INDEX = 0xC0350041,
- MD_NTSTATUS_WIN_STATUS_HV_NOT_PRESENT = 0xC0351000,
- MD_NTSTATUS_WIN_STATUS_IPSEC_BAD_SPI = 0xC0360001,
- MD_NTSTATUS_WIN_STATUS_IPSEC_SA_LIFETIME_EXPIRED = 0xC0360002,
- MD_NTSTATUS_WIN_STATUS_IPSEC_WRONG_SA = 0xC0360003,
- MD_NTSTATUS_WIN_STATUS_IPSEC_REPLAY_CHECK_FAILED = 0xC0360004,
- MD_NTSTATUS_WIN_STATUS_IPSEC_INVALID_PACKET = 0xC0360005,
- MD_NTSTATUS_WIN_STATUS_IPSEC_INTEGRITY_CHECK_FAILED = 0xC0360006,
- MD_NTSTATUS_WIN_STATUS_IPSEC_CLEAR_TEXT_DROP = 0xC0360007,
- MD_NTSTATUS_WIN_STATUS_IPSEC_AUTH_FIREWALL_DROP = 0xC0360008,
- MD_NTSTATUS_WIN_STATUS_IPSEC_THROTTLE_DROP = 0xC0360009,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_BLOCK = 0xC0368000,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_RECEIVED_MULTICAST = 0xC0368001,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_INVALID_PACKET = 0xC0368002,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED = 0xC0368003,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_ENTRIES = 0xC0368004,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED = 0xC0368005,
- MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES = 0xC0368006,
- MD_NTSTATUS_WIN_STATUS_VID_DUPLICATE_HANDLER = 0xC0370001,
- MD_NTSTATUS_WIN_STATUS_VID_TOO_MANY_HANDLERS = 0xC0370002,
- MD_NTSTATUS_WIN_STATUS_VID_QUEUE_FULL = 0xC0370003,
- MD_NTSTATUS_WIN_STATUS_VID_HANDLER_NOT_PRESENT = 0xC0370004,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_OBJECT_NAME = 0xC0370005,
- MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_TOO_LONG = 0xC0370006,
- MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG = 0xC0370007,
- MD_NTSTATUS_WIN_STATUS_VID_PARTITION_ALREADY_EXISTS = 0xC0370008,
- MD_NTSTATUS_WIN_STATUS_VID_PARTITION_DOES_NOT_EXIST = 0xC0370009,
- MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_NOT_FOUND = 0xC037000A,
- MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS = 0xC037000B,
- MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT = 0xC037000C,
- MD_NTSTATUS_WIN_STATUS_VID_MB_STILL_REFERENCED = 0xC037000D,
- MD_NTSTATUS_WIN_STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED = 0xC037000E,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_SETTINGS = 0xC037000F,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_NODE_INDEX = 0xC0370010,
- MD_NTSTATUS_WIN_STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED = 0xC0370011,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE = 0xC0370012,
- MD_NTSTATUS_WIN_STATUS_VID_PAGE_RANGE_OVERFLOW = 0xC0370013,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE = 0xC0370014,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_GPA_RANGE_HANDLE = 0xC0370015,
- MD_NTSTATUS_WIN_STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE = 0xC0370016,
- MD_NTSTATUS_WIN_STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED = 0xC0370017,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_PPM_HANDLE = 0xC0370018,
- MD_NTSTATUS_WIN_STATUS_VID_MBPS_ARE_LOCKED = 0xC0370019,
- MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_CLOSED = 0xC037001A,
- MD_NTSTATUS_WIN_STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED = 0xC037001B,
- MD_NTSTATUS_WIN_STATUS_VID_STOP_PENDING = 0xC037001C,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_PROCESSOR_STATE = 0xC037001D,
- MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT = 0xC037001E,
- MD_NTSTATUS_WIN_STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED = 0xC037001F,
- MD_NTSTATUS_WIN_STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET = 0xC0370020,
- MD_NTSTATUS_WIN_STATUS_VID_MMIO_RANGE_DESTROYED = 0xC0370021,
- MD_NTSTATUS_WIN_STATUS_VID_INVALID_CHILD_GPA_PAGE_SET = 0xC0370022,
- MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED = 0xC0370023,
- MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL = 0xC0370024,
- MD_NTSTATUS_WIN_STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE = 0xC0370025,
- MD_NTSTATUS_WIN_STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT = 0xC0370026,
- MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_CORRUPT = 0xC0370027,
- MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM = 0xC0370028,
- MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_INCOMPATIBLE = 0xC0370029,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DATABASE_FULL = 0xC0380001,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED = 0xC0380002,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC = 0xC0380003,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED = 0xC0380004,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME = 0xC0380005,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DUPLICATE = 0xC0380006,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DYNAMIC = 0xC0380007,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_ID_INVALID = 0xC0380008,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_INVALID = 0xC0380009,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAST_VOTER = 0xC038000A,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_INVALID = 0xC038000B,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS = 0xC038000C,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED = 0xC038000D,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL = 0xC038000E,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS = 0xC038000F,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS = 0xC0380010,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_MISSING = 0xC0380011,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_EMPTY = 0xC0380012,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE = 0xC0380013,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_REVECTORING_FAILED = 0xC0380014,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID = 0xC0380015,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SET_NOT_CONTAINED = 0xC0380016,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS = 0xC0380017,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES = 0xC0380018,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED = 0xC0380019,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_ALREADY_USED = 0xC038001A,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS = 0xC038001B,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION = 0xC038001C,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED = 0xC038001D,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION = 0xC038001E,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH = 0xC038001F,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED = 0xC0380020,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID = 0xC0380021,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS = 0xC0380022,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_IN_SYNC = 0xC0380023,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE = 0xC0380024,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_INVALID = 0xC0380025,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_MISSING = 0xC0380026,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_NOT_DETACHED = 0xC0380027,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_REGENERATING = 0xC0380028,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_ALL_DISKS_FAILED = 0xC0380029,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_REGISTERED_USERS = 0xC038002A,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_SUCH_USER = 0xC038002B,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NOTIFICATION_RESET = 0xC038002C,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID = 0xC038002D,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID = 0xC038002E,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_DUPLICATE = 0xC038002F,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_ID_INVALID = 0xC0380030,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_INVALID = 0xC0380031,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_NAME_INVALID = 0xC0380032,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_OFFLINE = 0xC0380033,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_HAS_QUORUM = 0xC0380034,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_WITHOUT_QUORUM = 0xC0380035,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_STYLE_INVALID = 0xC0380036,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_UPDATE_FAILED = 0xC0380037,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_IN_SYNC = 0xC0380038,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_DUPLICATE = 0xC0380039,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_INVALID = 0xC038003A,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_LAST_ACTIVE = 0xC038003B,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_MISSING = 0xC038003C,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_REGENERATING = 0xC038003D,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_TYPE_INVALID = 0xC038003E,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_RAID5 = 0xC038003F,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE = 0xC0380040,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_STRUCTURE_SIZE_INVALID = 0xC0380041,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS = 0xC0380042,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_TRANSACTION_IN_PROGRESS = 0xC0380043,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE = 0xC0380044,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK = 0xC0380045,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_ID_INVALID = 0xC0380046,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_INVALID = 0xC0380047,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE = 0xC0380048,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_MIRRORED = 0xC0380049,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_RETAINED = 0xC038004A,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_OFFLINE = 0xC038004B,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_RETAINED = 0xC038004C,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID = 0xC038004D,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE = 0xC038004E,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_BAD_BOOT_DISK = 0xC038004F,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_OFFLINE = 0xC0380050,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_ONLINE = 0xC0380051,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NOT_PRIMARY_PACK = 0xC0380052,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED = 0xC0380053,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID = 0xC0380054,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID = 0xC0380055,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_MIRRORED = 0xC0380056,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED = 0xC0380057,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_VALID_LOG_COPIES = 0xC0380058,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_PRIMARY_PACK_PRESENT = 0xC0380059,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID = 0xC038005A,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_MIRROR_NOT_SUPPORTED = 0xC038005B,
- MD_NTSTATUS_WIN_STATUS_VOLMGR_RAID5_NOT_SUPPORTED = 0xC038005C,
- MD_NTSTATUS_WIN_STATUS_BCD_TOO_MANY_ELEMENTS = 0xC0390002,
- MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_MISSING = 0xC03A0001,
- MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH = 0xC03A0002,
- MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CORRUPT = 0xC03A0003,
- MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNKNOWN = 0xC03A0004,
- MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNSUPPORTED_VERSION = 0xC03A0005,
- MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH = 0xC03A0006,
- MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION = 0xC03A0007,
- MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CORRUPT = 0xC03A0008,
- MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_FAILURE = 0xC03A0009,
- MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT = 0xC03A000A,
- MD_NTSTATUS_WIN_STATUS_VHD_INVALID_BLOCK_SIZE = 0xC03A000B,
- MD_NTSTATUS_WIN_STATUS_VHD_BITMAP_MISMATCH = 0xC03A000C,
- MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_NOT_FOUND = 0xC03A000D,
- MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_ID_MISMATCH = 0xC03A000E,
- MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH = 0xC03A000F,
- MD_NTSTATUS_WIN_STATUS_VHD_METADATA_READ_FAILURE = 0xC03A0010,
- MD_NTSTATUS_WIN_STATUS_VHD_METADATA_WRITE_FAILURE = 0xC03A0011,
- MD_NTSTATUS_WIN_STATUS_VHD_INVALID_SIZE = 0xC03A0012,
- MD_NTSTATUS_WIN_STATUS_VHD_INVALID_FILE_SIZE = 0xC03A0013,
- MD_NTSTATUS_WIN_STATUS_VIRTDISK_PROVIDER_NOT_FOUND = 0xC03A0014,
- MD_NTSTATUS_WIN_STATUS_VIRTDISK_NOT_VIRTUAL_DISK = 0xC03A0015,
- MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_ACCESS_DENIED = 0xC03A0016,
- MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH = 0xC03A0017,
- MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED = 0xC03A0018,
- MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT = 0xC03A0019,
- MD_NTSTATUS_WIN_STATUS_VIRTUAL_DISK_LIMITATION = 0xC03A001A,
- MD_NTSTATUS_WIN_STATUS_VHD_INVALID_TYPE = 0xC03A001B,
- MD_NTSTATUS_WIN_STATUS_VHD_INVALID_STATE = 0xC03A001C,
- MD_NTSTATUS_WIN_STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE = 0xC03A001D,
- MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ALREADY_OWNED = 0xC03A001E,
- MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE = 0xC03A001F,
- MD_NTSTATUS_WIN_STATUS_CTLOG_TRACKING_NOT_INITIALIZED = 0xC03A0020,
- MD_NTSTATUS_WIN_STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE = 0xC03A0021,
- MD_NTSTATUS_WIN_STATUS_CTLOG_VHD_CHANGED_OFFLINE = 0xC03A0022,
- MD_NTSTATUS_WIN_STATUS_CTLOG_INVALID_TRACKING_STATE = 0xC03A0023,
- MD_NTSTATUS_WIN_STATUS_CTLOG_INCONSISTENT_TRACKING_FILE = 0xC03A0024,
- MD_NTSTATUS_WIN_STATUS_VHD_METADATA_FULL = 0xC03A0028,
- MD_NTSTATUS_WIN_STATUS_RKF_KEY_NOT_FOUND = 0xC0400001,
- MD_NTSTATUS_WIN_STATUS_RKF_DUPLICATE_KEY = 0xC0400002,
- MD_NTSTATUS_WIN_STATUS_RKF_BLOB_FULL = 0xC0400003,
- MD_NTSTATUS_WIN_STATUS_RKF_STORE_FULL = 0xC0400004,
- MD_NTSTATUS_WIN_STATUS_RKF_FILE_BLOCKED = 0xC0400005,
- MD_NTSTATUS_WIN_STATUS_RKF_ACTIVE_KEY = 0xC0400006,
- MD_NTSTATUS_WIN_STATUS_RDBSS_RESTART_OPERATION = 0xC0410001,
- MD_NTSTATUS_WIN_STATUS_RDBSS_CONTINUE_OPERATION = 0xC0410002,
- MD_NTSTATUS_WIN_STATUS_RDBSS_POST_OPERATION = 0xC0410003,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_HANDLE = 0xC0420001,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_READ_NOT_PERMITTED = 0xC0420002,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_WRITE_NOT_PERMITTED = 0xC0420003,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_PDU = 0xC0420004,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION = 0xC0420005,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED = 0xC0420006,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_OFFSET = 0xC0420007,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION = 0xC0420008,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_PREPARE_QUEUE_FULL = 0xC0420009,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND = 0xC042000A,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG = 0xC042000B,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0xC042000C,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH = 0xC042000D,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNLIKELY = 0xC042000E,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION = 0xC042000F,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE = 0xC0420010,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_RESOURCES = 0xC0420011,
- MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNKNOWN_ERROR = 0xC0421000,
- MD_NTSTATUS_WIN_STATUS_SECUREBOOT_ROLLBACK_DETECTED = 0xC0430001,
- MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_VIOLATION = 0xC0430002,
- MD_NTSTATUS_WIN_STATUS_SECUREBOOT_INVALID_POLICY = 0xC0430003,
- MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND = 0xC0430004,
- MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_NOT_SIGNED = 0xC0430005,
- MD_NTSTATUS_WIN_STATUS_SECUREBOOT_FILE_REPLACED = 0xC0430007,
- MD_NTSTATUS_WIN_STATUS_AUDIO_ENGINE_NODE_NOT_FOUND = 0xC0440001,
- MD_NTSTATUS_WIN_STATUS_HDAUDIO_EMPTY_CONNECTION_LIST = 0xC0440002,
- MD_NTSTATUS_WIN_STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED = 0xC0440003,
- MD_NTSTATUS_WIN_STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED = 0xC0440004,
- MD_NTSTATUS_WIN_STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY = 0xC0440005,
- MD_NTSTATUS_WIN_STATUS_VOLSNAP_BOOTFILE_NOT_VALID = 0xC0500003,
- MD_NTSTATUS_WIN_STATUS_IO_PREEMPTED = 0xC0510001,
- MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_STORED = 0xC05C0000,
- MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_NOT_AVAILABLE = 0xC05CFF00,
- MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE = 0xC05CFF01,
- MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED = 0xC05CFF02,
- MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED = 0xC05CFF03,
- MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED = 0xC05CFF04,
- MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED = 0xC05CFF05,
- MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED = 0xC05CFF06,
- MD_NTSTATUS_WIN_STATUS_SVHDX_RESERVATION_CONFLICT = 0xC05CFF07,
- MD_NTSTATUS_WIN_STATUS_SVHDX_WRONG_FILE_TYPE = 0xC05CFF08,
- MD_NTSTATUS_WIN_STATUS_SVHDX_VERSION_MISMATCH = 0xC05CFF09,
- MD_NTSTATUS_WIN_STATUS_VHD_SHARED = 0xC05CFF0A,
- MD_NTSTATUS_WIN_STATUS_SPACES_RESILIENCY_TYPE_INVALID = 0xC0E70003,
- MD_NTSTATUS_WIN_STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID = 0xC0E70004,
- MD_NTSTATUS_WIN_STATUS_SPACES_INTERLEAVE_LENGTH_INVALID = 0xC0E70009,
- MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID = 0xC0E7000A,
- MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES = 0xC0E7000B
-} MDNTStatusCodeWin;
-
-// These constants are defined in the MSDN documentation of
-// the EXCEPTION_RECORD structure.
-typedef enum {
- MD_ACCESS_VIOLATION_WIN_READ = 0,
- MD_ACCESS_VIOLATION_WIN_WRITE = 1,
- MD_ACCESS_VIOLATION_WIN_EXEC = 8
-} MDAccessViolationTypeWin;
-
-// These constants are defined in the MSDN documentation of
-// the EXCEPTION_RECORD structure.
-typedef enum {
- MD_IN_PAGE_ERROR_WIN_READ = 0,
- MD_IN_PAGE_ERROR_WIN_WRITE = 1,
- MD_IN_PAGE_ERROR_WIN_EXEC = 8
-} MDInPageErrorTypeWin;
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_EXCEPTION_WIN32_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_format.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_format.h
deleted file mode 100644
index 251e503df9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_format.h
+++ /dev/null
@@ -1,1045 +0,0 @@
-/* Copyright (c) 2006, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-/* minidump_format.h: A cross-platform reimplementation of minidump-related
- * portions of DbgHelp.h from the Windows Platform SDK.
- *
- * (This is C99 source, please don't corrupt it with C++.)
- *
- * Structures that are defined by Microsoft to contain a zero-length array
- * are instead defined here to contain an array with one element, as
- * zero-length arrays are forbidden by standard C and C++. In these cases,
- * *_minsize constants are provided to be used in place of sizeof. For a
- * cleaner interface to these sizes when using C++, see minidump_size.h.
- *
- * These structures are also sufficient to populate minidump files.
- *
- * These definitions may be extended to support handling minidump files
- * for other CPUs and other operating systems.
- *
- * Because precise data type sizes are crucial for this implementation to
- * function properly and portably in terms of interoperability with minidumps
- * produced by DbgHelp on Windows, a set of primitive types with known sizes
- * are used as the basis of each structure defined by this file. DbgHelp
- * on Windows is assumed to be the reference implementation; this file
- * seeks to provide a cross-platform compatible implementation. To avoid
- * collisions with the types and values defined and used by DbgHelp in the
- * event that this implementation is used on Windows, each type and value
- * defined here is given a new name, beginning with "MD". Names of the
- * equivalent types and values in the Windows Platform SDK are given in
- * comments.
- *
- * Author: Mark Mentovai */
-
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__
-
-#include <stddef.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-
-#if defined(_MSC_VER)
-/* Disable "zero-sized array in struct/union" warnings when compiling in
- * MSVC. DbgHelp.h does this too. */
-#pragma warning(push)
-#pragma warning(disable:4200)
-#endif /* _MSC_VER */
-
-
-/*
- * guiddef.h
- */
-
-typedef struct {
- uint32_t data1;
- uint16_t data2;
- uint16_t data3;
- uint8_t data4[8];
-} MDGUID; /* GUID */
-
-
-/*
- * WinNT.h
- */
-
-/* Non-x86 CPU identifiers found in the high 24 bits of
- * (MDRawContext*).context_flags. These aren't used by Breakpad, but are
- * defined here for reference, to avoid assigning values that conflict
- * (although some values already conflict). */
-#define MD_CONTEXT_IA64 0x00080000 /* CONTEXT_IA64 */
-/* Additional values from winnt.h in the Windows CE 5.0 SDK: */
-#define MD_CONTEXT_SHX 0x000000c0 /* CONTEXT_SH4 (Super-H, includes SH3) */
-#define MD_CONTEXT_ALPHA 0x00020000 /* CONTEXT_ALPHA */
-
-/* As of Windows 7 SP1, the number of flag bits has increased to
- * include 0x40 (CONTEXT_XSTATE):
- * http://msdn.microsoft.com/en-us/library/hh134238%28v=vs.85%29.aspx */
-#define MD_CONTEXT_CPU_MASK 0xffffff00
-
-
-/* This is a base type for MDRawContextX86 and MDRawContextPPC. This
- * structure should never be allocated directly. The actual structure type
- * can be determined by examining the context_flags field. */
-typedef struct {
- uint32_t context_flags;
-} MDRawContextBase;
-
-#include "minidump_cpu_amd64.h"
-#include "minidump_cpu_arm.h"
-#include "minidump_cpu_arm64.h"
-#include "minidump_cpu_mips.h"
-#include "minidump_cpu_ppc.h"
-#include "minidump_cpu_ppc64.h"
-#include "minidump_cpu_sparc.h"
-#include "minidump_cpu_x86.h"
-
-/*
- * WinVer.h
- */
-
-
-typedef struct {
- uint32_t signature;
- uint32_t struct_version;
- uint32_t file_version_hi;
- uint32_t file_version_lo;
- uint32_t product_version_hi;
- uint32_t product_version_lo;
- uint32_t file_flags_mask; /* Identifies valid bits in fileFlags */
- uint32_t file_flags;
- uint32_t file_os;
- uint32_t file_type;
- uint32_t file_subtype;
- uint32_t file_date_hi;
- uint32_t file_date_lo;
-} MDVSFixedFileInfo; /* VS_FIXEDFILEINFO */
-
-/* For (MDVSFixedFileInfo).signature */
-#define MD_VSFIXEDFILEINFO_SIGNATURE 0xfeef04bd
- /* VS_FFI_SIGNATURE */
-
-/* For (MDVSFixedFileInfo).version */
-#define MD_VSFIXEDFILEINFO_VERSION 0x00010000
- /* VS_FFI_STRUCVERSION */
-
-/* For (MDVSFixedFileInfo).file_flags_mask and
- * (MDVSFixedFileInfo).file_flags */
-#define MD_VSFIXEDFILEINFO_FILE_FLAGS_DEBUG 0x00000001
- /* VS_FF_DEBUG */
-#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PRERELEASE 0x00000002
- /* VS_FF_PRERELEASE */
-#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PATCHED 0x00000004
- /* VS_FF_PATCHED */
-#define MD_VSFIXEDFILEINFO_FILE_FLAGS_PRIVATEBUILD 0x00000008
- /* VS_FF_PRIVATEBUILD */
-#define MD_VSFIXEDFILEINFO_FILE_FLAGS_INFOINFERRED 0x00000010
- /* VS_FF_INFOINFERRED */
-#define MD_VSFIXEDFILEINFO_FILE_FLAGS_SPECIALBUILD 0x00000020
- /* VS_FF_SPECIALBUILD */
-
-/* For (MDVSFixedFileInfo).file_os: high 16 bits */
-#define MD_VSFIXEDFILEINFO_FILE_OS_UNKNOWN 0 /* VOS_UNKNOWN */
-#define MD_VSFIXEDFILEINFO_FILE_OS_DOS (1 << 16) /* VOS_DOS */
-#define MD_VSFIXEDFILEINFO_FILE_OS_OS216 (2 << 16) /* VOS_OS216 */
-#define MD_VSFIXEDFILEINFO_FILE_OS_OS232 (3 << 16) /* VOS_OS232 */
-#define MD_VSFIXEDFILEINFO_FILE_OS_NT (4 << 16) /* VOS_NT */
-#define MD_VSFIXEDFILEINFO_FILE_OS_WINCE (5 << 16) /* VOS_WINCE */
-/* Low 16 bits */
-#define MD_VSFIXEDFILEINFO_FILE_OS__BASE 0 /* VOS__BASE */
-#define MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS16 1 /* VOS__WINDOWS16 */
-#define MD_VSFIXEDFILEINFO_FILE_OS__PM16 2 /* VOS__PM16 */
-#define MD_VSFIXEDFILEINFO_FILE_OS__PM32 3 /* VOS__PM32 */
-#define MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS32 4 /* VOS__WINDOWS32 */
-
-/* For (MDVSFixedFileInfo).file_type */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_UNKNOWN 0 /* VFT_UNKNOWN */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_APP 1 /* VFT_APP */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_DLL 2 /* VFT_DLL */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_DRV 3 /* VFT_DLL */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_FONT 4 /* VFT_FONT */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_VXD 5 /* VFT_VXD */
-#define MD_VSFIXEDFILEINFO_FILE_TYPE_STATIC_LIB 7 /* VFT_STATIC_LIB */
-
-/* For (MDVSFixedFileInfo).file_subtype */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_UNKNOWN 0
- /* VFT2_UNKNOWN */
-/* with file_type = MD_VSFIXEDFILEINFO_FILETYPE_DRV */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_PRINTER 1
- /* VFT2_DRV_PRINTER */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_KEYBOARD 2
- /* VFT2_DRV_KEYBOARD */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_LANGUAGE 3
- /* VFT2_DRV_LANGUAGE */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_DISPLAY 4
- /* VFT2_DRV_DISPLAY */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_MOUSE 5
- /* VFT2_DRV_MOUSE */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_NETWORK 6
- /* VFT2_DRV_NETWORK */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_SYSTEM 7
- /* VFT2_DRV_SYSTEM */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_INSTALLABLE 8
- /* VFT2_DRV_INSTALLABLE */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_SOUND 9
- /* VFT2_DRV_SOUND */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_COMM 10
- /* VFT2_DRV_COMM */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_INPUTMETHOD 11
- /* VFT2_DRV_INPUTMETHOD */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_DRV_VERSIONED_PRINTER 12
- /* VFT2_DRV_VERSIONED_PRINTER */
-/* with file_type = MD_VSFIXEDFILEINFO_FILETYPE_FONT */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_RASTER 1
- /* VFT2_FONT_RASTER */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_VECTOR 2
- /* VFT2_FONT_VECTOR */
-#define MD_VSFIXEDFILEINFO_FILE_SUBTYPE_FONT_TRUETYPE 3
- /* VFT2_FONT_TRUETYPE */
-
-
-/*
- * DbgHelp.h
- */
-
-
-/* An MDRVA is an offset into the minidump file. The beginning of the
- * MDRawHeader is at offset 0. */
-typedef uint32_t MDRVA; /* RVA */
-
-typedef struct {
- uint32_t data_size;
- MDRVA rva;
-} MDLocationDescriptor; /* MINIDUMP_LOCATION_DESCRIPTOR */
-
-
-typedef struct {
- /* The base address of the memory range on the host that produced the
- * minidump. */
- uint64_t start_of_memory_range;
-
- MDLocationDescriptor memory;
-} MDMemoryDescriptor; /* MINIDUMP_MEMORY_DESCRIPTOR */
-
-
-typedef struct {
- uint32_t signature;
- uint32_t version;
- uint32_t stream_count;
- MDRVA stream_directory_rva; /* A |stream_count|-sized array of
- * MDRawDirectory structures. */
- uint32_t checksum; /* Can be 0. In fact, that's all that's
- * been found in minidump files. */
- uint32_t time_date_stamp; /* time_t */
- uint64_t flags;
-} MDRawHeader; /* MINIDUMP_HEADER */
-
-/* For (MDRawHeader).signature and (MDRawHeader).version. Note that only the
- * low 16 bits of (MDRawHeader).version are MD_HEADER_VERSION. Per the
- * documentation, the high 16 bits are implementation-specific. */
-#define MD_HEADER_SIGNATURE 0x504d444d /* 'PMDM' */
- /* MINIDUMP_SIGNATURE */
-#define MD_HEADER_VERSION 0x0000a793 /* 42899 */
- /* MINIDUMP_VERSION */
-
-/* For (MDRawHeader).flags: */
-typedef enum {
- /* MD_NORMAL is the standard type of minidump. It includes full
- * streams for the thread list, module list, exception, system info,
- * and miscellaneous info. A memory list stream is also present,
- * pointing to the same stack memory contained in the thread list,
- * as well as a 256-byte region around the instruction address that
- * was executing when the exception occurred. Stack memory is from
- * 4 bytes below a thread's stack pointer up to the top of the
- * memory region encompassing the stack. */
- MD_NORMAL = 0x00000000,
- MD_WITH_DATA_SEGS = 0x00000001,
- MD_WITH_FULL_MEMORY = 0x00000002,
- MD_WITH_HANDLE_DATA = 0x00000004,
- MD_FILTER_MEMORY = 0x00000008,
- MD_SCAN_MEMORY = 0x00000010,
- MD_WITH_UNLOADED_MODULES = 0x00000020,
- MD_WITH_INDIRECTLY_REFERENCED_MEMORY = 0x00000040,
- MD_FILTER_MODULE_PATHS = 0x00000080,
- MD_WITH_PROCESS_THREAD_DATA = 0x00000100,
- MD_WITH_PRIVATE_READ_WRITE_MEMORY = 0x00000200,
- MD_WITHOUT_OPTIONAL_DATA = 0x00000400,
- MD_WITH_FULL_MEMORY_INFO = 0x00000800,
- MD_WITH_THREAD_INFO = 0x00001000,
- MD_WITH_CODE_SEGS = 0x00002000,
- MD_WITHOUT_AUXILLIARY_SEGS = 0x00004000,
- MD_WITH_FULL_AUXILLIARY_STATE = 0x00008000,
- MD_WITH_PRIVATE_WRITE_COPY_MEMORY = 0x00010000,
- MD_IGNORE_INACCESSIBLE_MEMORY = 0x00020000,
- MD_WITH_TOKEN_INFORMATION = 0x00040000
-} MDType; /* MINIDUMP_TYPE */
-
-
-typedef struct {
- uint32_t stream_type;
- MDLocationDescriptor location;
-} MDRawDirectory; /* MINIDUMP_DIRECTORY */
-
-/* For (MDRawDirectory).stream_type */
-typedef enum {
- MD_UNUSED_STREAM = 0,
- MD_RESERVED_STREAM_0 = 1,
- MD_RESERVED_STREAM_1 = 2,
- MD_THREAD_LIST_STREAM = 3, /* MDRawThreadList */
- MD_MODULE_LIST_STREAM = 4, /* MDRawModuleList */
- MD_MEMORY_LIST_STREAM = 5, /* MDRawMemoryList */
- MD_EXCEPTION_STREAM = 6, /* MDRawExceptionStream */
- MD_SYSTEM_INFO_STREAM = 7, /* MDRawSystemInfo */
- MD_THREAD_EX_LIST_STREAM = 8,
- MD_MEMORY_64_LIST_STREAM = 9,
- MD_COMMENT_STREAM_A = 10,
- MD_COMMENT_STREAM_W = 11,
- MD_HANDLE_DATA_STREAM = 12,
- MD_FUNCTION_TABLE_STREAM = 13,
- MD_UNLOADED_MODULE_LIST_STREAM = 14,
- MD_MISC_INFO_STREAM = 15, /* MDRawMiscInfo */
- MD_MEMORY_INFO_LIST_STREAM = 16, /* MDRawMemoryInfoList */
- MD_THREAD_INFO_LIST_STREAM = 17,
- MD_HANDLE_OPERATION_LIST_STREAM = 18,
- MD_TOKEN_STREAM = 19,
- MD_JAVASCRIPT_DATA_STREAM = 20,
- MD_SYSTEM_MEMORY_INFO_STREAM = 21,
- MD_PROCESS_VM_COUNTERS_STREAM = 22,
- MD_LAST_RESERVED_STREAM = 0x0000ffff,
-
- /* Breakpad extension types. 0x4767 = "Gg" */
- MD_BREAKPAD_INFO_STREAM = 0x47670001, /* MDRawBreakpadInfo */
- MD_ASSERTION_INFO_STREAM = 0x47670002, /* MDRawAssertionInfo */
- /* These are additional minidump stream values which are specific to
- * the linux breakpad implementation. */
- MD_LINUX_CPU_INFO = 0x47670003, /* /proc/cpuinfo */
- MD_LINUX_PROC_STATUS = 0x47670004, /* /proc/$x/status */
- MD_LINUX_LSB_RELEASE = 0x47670005, /* /etc/lsb-release */
- MD_LINUX_CMD_LINE = 0x47670006, /* /proc/$x/cmdline */
- MD_LINUX_ENVIRON = 0x47670007, /* /proc/$x/environ */
- MD_LINUX_AUXV = 0x47670008, /* /proc/$x/auxv */
- MD_LINUX_MAPS = 0x47670009, /* /proc/$x/maps */
- MD_LINUX_DSO_DEBUG = 0x4767000A /* MDRawDebug{32,64} */
-} MDStreamType; /* MINIDUMP_STREAM_TYPE */
-
-
-typedef struct {
- uint32_t length; /* Length of buffer in bytes (not characters),
- * excluding 0-terminator */
- uint16_t buffer[1]; /* UTF-16-encoded, 0-terminated */
-} MDString; /* MINIDUMP_STRING */
-
-static const size_t MDString_minsize = offsetof(MDString, buffer[0]);
-
-
-typedef struct {
- uint32_t thread_id;
- uint32_t suspend_count;
- uint32_t priority_class;
- uint32_t priority;
- uint64_t teb; /* Thread environment block */
- MDMemoryDescriptor stack;
- MDLocationDescriptor thread_context; /* MDRawContext[CPU] */
-} MDRawThread; /* MINIDUMP_THREAD */
-
-
-typedef struct {
- uint32_t number_of_threads;
- MDRawThread threads[1];
-} MDRawThreadList; /* MINIDUMP_THREAD_LIST */
-
-static const size_t MDRawThreadList_minsize = offsetof(MDRawThreadList,
- threads[0]);
-
-
-typedef struct {
- uint64_t base_of_image;
- uint32_t size_of_image;
- uint32_t checksum; /* 0 if unknown */
- uint32_t time_date_stamp; /* time_t */
- MDRVA module_name_rva; /* MDString, pathname or filename */
- MDVSFixedFileInfo version_info;
-
- /* The next field stores a CodeView record and is populated when a module's
- * debug information resides in a PDB file. It identifies the PDB file. */
- MDLocationDescriptor cv_record;
-
- /* The next field is populated when a module's debug information resides
- * in a DBG file. It identifies the DBG file. This field is effectively
- * obsolete with modules built by recent toolchains. */
- MDLocationDescriptor misc_record;
-
- /* Alignment problem: reserved0 and reserved1 are defined by the platform
- * SDK as 64-bit quantities. However, that results in a structure whose
- * alignment is unpredictable on different CPUs and ABIs. If the ABI
- * specifies full alignment of 64-bit quantities in structures (as ppc
- * does), there will be padding between miscRecord and reserved0. If
- * 64-bit quantities can be aligned on 32-bit boundaries (as on x86),
- * this padding will not exist. (Note that the structure up to this point
- * contains 1 64-bit member followed by 21 32-bit members.)
- * As a workaround, reserved0 and reserved1 are instead defined here as
- * four 32-bit quantities. This should be harmless, as there are
- * currently no known uses for these fields. */
- uint32_t reserved0[2];
- uint32_t reserved1[2];
-} MDRawModule; /* MINIDUMP_MODULE */
-
-/* The inclusion of a 64-bit type in MINIDUMP_MODULE forces the struct to
- * be tail-padded out to a multiple of 64 bits under some ABIs (such as PPC).
- * This doesn't occur on systems that don't tail-pad in this manner. Define
- * this macro to be the usable size of the MDRawModule struct, and use it in
- * place of sizeof(MDRawModule). */
-#define MD_MODULE_SIZE 108
-
-
-/* (MDRawModule).cv_record can reference MDCVInfoPDB20 or MDCVInfoPDB70.
- * Ref.: http://www.debuginfo.com/articles/debuginfomatch.html
- * MDCVInfoPDB70 is the expected structure type with recent toolchains. */
-
-typedef struct {
- uint32_t signature;
- uint32_t offset; /* Offset to debug data (expect 0 in minidump) */
-} MDCVHeader;
-
-typedef struct {
- MDCVHeader cv_header;
- uint32_t signature; /* time_t debug information created */
- uint32_t age; /* revision of PDB file */
- uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file */
-} MDCVInfoPDB20;
-
-static const size_t MDCVInfoPDB20_minsize = offsetof(MDCVInfoPDB20,
- pdb_file_name[0]);
-
-#define MD_CVINFOPDB20_SIGNATURE 0x3031424e /* cvHeader.signature = '01BN' */
-
-typedef struct {
- uint32_t cv_signature;
- MDGUID signature; /* GUID, identifies PDB file */
- uint32_t age; /* Identifies incremental changes to PDB file */
- uint8_t pdb_file_name[1]; /* Pathname or filename of PDB file,
- * 0-terminated 8-bit character data (UTF-8?) */
-} MDCVInfoPDB70;
-
-static const size_t MDCVInfoPDB70_minsize = offsetof(MDCVInfoPDB70,
- pdb_file_name[0]);
-
-#define MD_CVINFOPDB70_SIGNATURE 0x53445352 /* cvSignature = 'SDSR' */
-
-/*
- * Modern ELF toolchains insert a "build id" into the ELF headers that
- * usually contains a hash of some ELF headers + sections to uniquely
- * identify a binary.
- *
- * https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Developer_Guide/compiling-build-id.html
- * https://sourceware.org/binutils/docs-2.26/ld/Options.html#index-g_t_002d_002dbuild_002did-292
- */
-typedef struct {
- uint32_t cv_signature;
- uint8_t build_id[1]; /* Bytes of build id from GNU_BUILD_ID ELF note.
- * This is variable-length, but usually 20 bytes
- * as the binutils ld default is a SHA-1 hash. */
-} MDCVInfoELF;
-
-static const size_t MDCVInfoELF_minsize = offsetof(MDCVInfoELF,
- build_id[0]);
-
-#define MD_CVINFOELF_SIGNATURE 0x4270454c /* cvSignature = 'BpEL' */
-
-/* In addition to the two CodeView record formats above, used for linking
- * to external pdb files, it is possible for debugging data to be carried
- * directly in the CodeView record itself. These signature values will
- * be found in the first 4 bytes of the CodeView record. Additional values
- * not commonly experienced in the wild are given by "Microsoft Symbol and
- * Type Information", http://www.x86.org/ftp/manuals/tools/sym.pdf, section
- * 7.2. An in-depth description of the CodeView 4.1 format is given by
- * "Undocumented Windows 2000 Secrets", Windows 2000 Debugging Support/
- * Microsoft Symbol File Internals/CodeView Subsections,
- * http://www.rawol.com/features/undocumented/sbs-w2k-1-windows-2000-debugging-support.pdf
- */
-#define MD_CVINFOCV41_SIGNATURE 0x3930424e /* '90BN', CodeView 4.10. */
-#define MD_CVINFOCV50_SIGNATURE 0x3131424e /* '11BN', CodeView 5.0,
- * MS C7-format (/Z7). */
-
-#define MD_CVINFOUNKNOWN_SIGNATURE 0xffffffff /* An unlikely value. */
-
-/* (MDRawModule).miscRecord can reference MDImageDebugMisc. The Windows
- * structure is actually defined in WinNT.h. This structure is effectively
- * obsolete with modules built by recent toolchains. */
-
-typedef struct {
- uint32_t data_type; /* IMAGE_DEBUG_TYPE_*, not defined here because
- * this debug record type is mostly obsolete. */
- uint32_t length; /* Length of entire MDImageDebugMisc structure */
- uint8_t unicode; /* True if data is multibyte */
- uint8_t reserved[3];
- uint8_t data[1];
-} MDImageDebugMisc; /* IMAGE_DEBUG_MISC */
-
-static const size_t MDImageDebugMisc_minsize = offsetof(MDImageDebugMisc,
- data[0]);
-
-
-typedef struct {
- uint32_t number_of_modules;
- MDRawModule modules[1];
-} MDRawModuleList; /* MINIDUMP_MODULE_LIST */
-
-static const size_t MDRawModuleList_minsize = offsetof(MDRawModuleList,
- modules[0]);
-
-
-typedef struct {
- uint32_t number_of_memory_ranges;
- MDMemoryDescriptor memory_ranges[1];
-} MDRawMemoryList; /* MINIDUMP_MEMORY_LIST */
-
-static const size_t MDRawMemoryList_minsize = offsetof(MDRawMemoryList,
- memory_ranges[0]);
-
-
-#define MD_EXCEPTION_MAXIMUM_PARAMETERS 15
-
-typedef struct {
- uint32_t exception_code; /* Windows: MDExceptionCodeWin,
- * Mac OS X: MDExceptionMac,
- * Linux: MDExceptionCodeLinux. */
- uint32_t exception_flags; /* Windows: 1 if noncontinuable,
- Mac OS X: MDExceptionCodeMac. */
- uint64_t exception_record; /* Address (in the minidump-producing host's
- * memory) of another MDException, for
- * nested exceptions. */
- uint64_t exception_address; /* The address that caused the exception.
- * Mac OS X: exception subcode (which is
- * typically the address). */
- uint32_t number_parameters; /* Number of valid elements in
- * exception_information. */
- uint32_t __align;
- uint64_t exception_information[MD_EXCEPTION_MAXIMUM_PARAMETERS];
-} MDException; /* MINIDUMP_EXCEPTION */
-
-#include "minidump_exception_linux.h"
-#include "minidump_exception_mac.h"
-#include "minidump_exception_ps3.h"
-#include "minidump_exception_solaris.h"
-#include "minidump_exception_win32.h"
-
-typedef struct {
- uint32_t thread_id; /* Thread in which the exception
- * occurred. Corresponds to
- * (MDRawThread).thread_id. */
- uint32_t __align;
- MDException exception_record;
- MDLocationDescriptor thread_context; /* MDRawContext[CPU] */
-} MDRawExceptionStream; /* MINIDUMP_EXCEPTION_STREAM */
-
-
-typedef union {
- struct {
- uint32_t vendor_id[3]; /* cpuid 0: ebx, edx, ecx */
- uint32_t version_information; /* cpuid 1: eax */
- uint32_t feature_information; /* cpuid 1: edx */
- uint32_t amd_extended_cpu_features; /* cpuid 0x80000001, ebx */
- } x86_cpu_info;
- struct {
- uint32_t cpuid;
- uint32_t elf_hwcaps; /* linux specific, 0 otherwise */
- } arm_cpu_info;
- struct {
- uint64_t processor_features[2];
- } other_cpu_info;
-} MDCPUInformation; /* CPU_INFORMATION */
-
-/* For (MDCPUInformation).arm_cpu_info.elf_hwcaps.
- * This matches the Linux kernel definitions from <asm/hwcaps.h> */
-typedef enum {
- MD_CPU_ARM_ELF_HWCAP_SWP = (1 << 0),
- MD_CPU_ARM_ELF_HWCAP_HALF = (1 << 1),
- MD_CPU_ARM_ELF_HWCAP_THUMB = (1 << 2),
- MD_CPU_ARM_ELF_HWCAP_26BIT = (1 << 3),
- MD_CPU_ARM_ELF_HWCAP_FAST_MULT = (1 << 4),
- MD_CPU_ARM_ELF_HWCAP_FPA = (1 << 5),
- MD_CPU_ARM_ELF_HWCAP_VFP = (1 << 6),
- MD_CPU_ARM_ELF_HWCAP_EDSP = (1 << 7),
- MD_CPU_ARM_ELF_HWCAP_JAVA = (1 << 8),
- MD_CPU_ARM_ELF_HWCAP_IWMMXT = (1 << 9),
- MD_CPU_ARM_ELF_HWCAP_CRUNCH = (1 << 10),
- MD_CPU_ARM_ELF_HWCAP_THUMBEE = (1 << 11),
- MD_CPU_ARM_ELF_HWCAP_NEON = (1 << 12),
- MD_CPU_ARM_ELF_HWCAP_VFPv3 = (1 << 13),
- MD_CPU_ARM_ELF_HWCAP_VFPv3D16 = (1 << 14),
- MD_CPU_ARM_ELF_HWCAP_TLS = (1 << 15),
- MD_CPU_ARM_ELF_HWCAP_VFPv4 = (1 << 16),
- MD_CPU_ARM_ELF_HWCAP_IDIVA = (1 << 17),
- MD_CPU_ARM_ELF_HWCAP_IDIVT = (1 << 18),
-} MDCPUInformationARMElfHwCaps;
-
-typedef struct {
- /* The next 3 fields and numberOfProcessors are from the SYSTEM_INFO
- * structure as returned by GetSystemInfo */
- uint16_t processor_architecture;
- uint16_t processor_level; /* x86: 5 = 586, 6 = 686, ... */
- /* ARM: 6 = ARMv6, 7 = ARMv7 ... */
- uint16_t processor_revision; /* x86: 0xMMSS, where MM=model,
- * SS=stepping */
- /* ARM: 0 */
-
- uint8_t number_of_processors;
- uint8_t product_type; /* Windows: VER_NT_* from WinNT.h */
-
- /* The next 5 fields are from the OSVERSIONINFO structure as returned
- * by GetVersionEx */
- uint32_t major_version;
- uint32_t minor_version;
- uint32_t build_number;
- uint32_t platform_id;
- MDRVA csd_version_rva; /* MDString further identifying the
- * host OS.
- * Windows: name of the installed OS
- * service pack.
- * Mac OS X: the Apple OS build number
- * (sw_vers -buildVersion).
- * Linux: uname -srvmo */
-
- uint16_t suite_mask; /* Windows: VER_SUITE_* from WinNT.h */
- uint16_t reserved2;
-
- MDCPUInformation cpu;
-} MDRawSystemInfo; /* MINIDUMP_SYSTEM_INFO */
-
-/* For (MDRawSystemInfo).processor_architecture: */
-typedef enum {
- MD_CPU_ARCHITECTURE_X86 = 0, /* PROCESSOR_ARCHITECTURE_INTEL */
- MD_CPU_ARCHITECTURE_MIPS = 1, /* PROCESSOR_ARCHITECTURE_MIPS */
- MD_CPU_ARCHITECTURE_ALPHA = 2, /* PROCESSOR_ARCHITECTURE_ALPHA */
- MD_CPU_ARCHITECTURE_PPC = 3, /* PROCESSOR_ARCHITECTURE_PPC */
- MD_CPU_ARCHITECTURE_SHX = 4, /* PROCESSOR_ARCHITECTURE_SHX
- * (Super-H) */
- MD_CPU_ARCHITECTURE_ARM = 5, /* PROCESSOR_ARCHITECTURE_ARM */
- MD_CPU_ARCHITECTURE_IA64 = 6, /* PROCESSOR_ARCHITECTURE_IA64 */
- MD_CPU_ARCHITECTURE_ALPHA64 = 7, /* PROCESSOR_ARCHITECTURE_ALPHA64 */
- MD_CPU_ARCHITECTURE_MSIL = 8, /* PROCESSOR_ARCHITECTURE_MSIL
- * (Microsoft Intermediate Language) */
- MD_CPU_ARCHITECTURE_AMD64 = 9, /* PROCESSOR_ARCHITECTURE_AMD64 */
- MD_CPU_ARCHITECTURE_X86_WIN64 = 10,
- /* PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 (WoW64) */
- MD_CPU_ARCHITECTURE_SPARC = 0x8001, /* Breakpad-defined value for SPARC */
- MD_CPU_ARCHITECTURE_PPC64 = 0x8002, /* Breakpad-defined value for PPC64 */
- MD_CPU_ARCHITECTURE_ARM64 = 0x8003, /* Breakpad-defined value for ARM64 */
- MD_CPU_ARCHITECTURE_MIPS64 = 0x8004, /* Breakpad-defined value for MIPS64 */
- MD_CPU_ARCHITECTURE_UNKNOWN = 0xffff /* PROCESSOR_ARCHITECTURE_UNKNOWN */
-} MDCPUArchitecture;
-
-/* For (MDRawSystemInfo).platform_id: */
-typedef enum {
- MD_OS_WIN32S = 0, /* VER_PLATFORM_WIN32s (Windows 3.1) */
- MD_OS_WIN32_WINDOWS = 1, /* VER_PLATFORM_WIN32_WINDOWS (Windows 95-98-Me) */
- MD_OS_WIN32_NT = 2, /* VER_PLATFORM_WIN32_NT (Windows NT, 2000+) */
- MD_OS_WIN32_CE = 3, /* VER_PLATFORM_WIN32_CE, VER_PLATFORM_WIN32_HH
- * (Windows CE, Windows Mobile, "Handheld") */
-
- /* The following values are Breakpad-defined. */
- MD_OS_UNIX = 0x8000, /* Generic Unix-ish */
- MD_OS_MAC_OS_X = 0x8101, /* Mac OS X/Darwin */
- MD_OS_IOS = 0x8102, /* iOS */
- MD_OS_LINUX = 0x8201, /* Linux */
- MD_OS_SOLARIS = 0x8202, /* Solaris */
- MD_OS_ANDROID = 0x8203, /* Android */
- MD_OS_PS3 = 0x8204, /* PS3 */
- MD_OS_NACL = 0x8205 /* Native Client (NaCl) */
-} MDOSPlatform;
-
-typedef struct {
- uint16_t year;
- uint16_t month;
- uint16_t day_of_week;
- uint16_t day;
- uint16_t hour;
- uint16_t minute;
- uint16_t second;
- uint16_t milliseconds;
-} MDSystemTime; /* SYSTEMTIME */
-
-typedef struct {
- /* Required field. The bias is the difference, in minutes, between
- * Coordinated Universal Time (UTC) and local time.
- * Formula: UTC = local time + bias */
- int32_t bias;
- /* A description for standard time. For example, "EST" could indicate Eastern
- * Standard Time. In practice this contains the full time zone names. This
- * string can be empty. */
- uint16_t standard_name[32]; /* UTF-16-encoded, 0-terminated */
- /* A MDSystemTime structure that contains a date and local time when the
- * transition from daylight saving time to standard time occurs on this
- * operating system. If the time zone does not support daylight saving time,
- * the month member in the MDSystemTime structure is zero. */
- MDSystemTime standard_date;
- /* The bias value to be used during local time translations that occur during
- * standard time. */
- int32_t standard_bias;
- /* A description for daylight saving time. For example, "PDT" could indicate
- * Pacific Daylight Time. In practice this contains the full time zone names.
- * This string can be empty. */
- uint16_t daylight_name[32]; /* UTF-16-encoded, 0-terminated */
- /* A MDSystemTime structure that contains a date and local time when the
- * transition from standard time to daylight saving time occurs on this
- * operating system. If the time zone does not support daylight saving time,
- * the month member in the MDSystemTime structure is zero.*/
- MDSystemTime daylight_date;
- /* The bias value to be used during local time translations that occur during
- * daylight saving time. */
- int32_t daylight_bias;
-} MDTimeZoneInformation; /* TIME_ZONE_INFORMATION */
-
-/* MAX_PATH from windef.h */
-#define MD_MAX_PATH 260
-
-/* For MDXStateConfigFeatureMscInfo.features */
-typedef struct {
- uint32_t offset;
- uint32_t size;
-} MDXStateFeature;
-
-/* For MDXStateConfigFeatureMscInfo.enabled_features from winnt.h */
-typedef enum {
- MD_XSTATE_LEGACY_FLOATING_POINT = 0, /* XSTATE_LEGACY_FLOATING_POINT */
- MD_XSTATE_LEGACY_SSE = 1, /* XSTATE_LEGACY_SSE */
- MD_XSTATE_GSSE = 2, /* XSTATE_GSSE */
- MD_XSTATE_AVX = MD_XSTATE_GSSE, /* XSTATE_AVX */
- MD_XSTATE_MPX_BNDREGS = 3, /* XSTATE_MPX_BNDREGS */
- MD_XSTATE_MPX_BNDCSR = 4, /* XSTATE_MPX_BNDCSR */
- MD_XSTATE_AVX512_KMASK = 5, /* XSTATE_AVX512_KMASK */
- MD_XSTATE_AVX512_ZMM_H = 6, /* XSTATE_AVX512_ZMM_H */
- MD_XSTATE_AVX512_ZMM = 7, /* XSTATE_AVX512_ZMM */
- MD_XSTATE_IPT = 8, /* XSTATE_IPT */
- MD_XSTATE_LWP = 62 /* XSTATE_LWP */
-} MDXStateFeatureFlag;
-
-/* MAXIMUM_XSTATE_FEATURES from winnt.h */
-#define MD_MAXIMUM_XSTATE_FEATURES 64
-
-/* For MDRawMiscInfo.xstate_data */
-typedef struct {
- uint32_t size_of_info;
- uint32_t context_size;
- /* An entry in the features array is valid only if the corresponding bit in
- * the enabled_features flag is set. */
- uint64_t enabled_features;
- MDXStateFeature features[MD_MAXIMUM_XSTATE_FEATURES];
-} MDXStateConfigFeatureMscInfo;
-
-
-/* The miscellaneous information stream contains a variety
- * of small pieces of information. A member is valid if
- * it's within the available size and its corresponding
- * bit is set. */
-typedef struct {
- uint32_t size_of_info; /* Length of entire MDRawMiscInfo structure. */
- uint32_t flags1;
-
- /* The next field is only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_PROCESS_ID. */
- uint32_t process_id;
-
- /* The next 3 fields are only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_PROCESS_TIMES. */
- uint32_t process_create_time; /* time_t process started */
- uint32_t process_user_time; /* seconds of user CPU time */
- uint32_t process_kernel_time; /* seconds of kernel CPU time */
-
- /* The following fields are not present in MINIDUMP_MISC_INFO but are
- * in MINIDUMP_MISC_INFO_2. When this struct is populated, these values
- * may not be set. Use flags1 and size_of_info to determine whether these
- * values are present. These are only valid when flags1 contains
- * MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO. */
- uint32_t processor_max_mhz;
- uint32_t processor_current_mhz;
- uint32_t processor_mhz_limit;
- uint32_t processor_max_idle_state;
- uint32_t processor_current_idle_state;
-
- /* The following fields are not present in MINIDUMP_MISC_INFO_2 but are
- * in MINIDUMP_MISC_INFO_3. When this struct is populated, these values
- * may not be set. Use flags1 and size_of_info to determine whether these
- * values are present. */
-
- /* The following field is only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY. */
- uint32_t process_integrity_level;
-
- /* The following field is only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS. */
- uint32_t process_execute_flags;
-
- /* The following field is only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_PROTECTED_PROCESS. */
- uint32_t protected_process;
-
- /* The following 2 fields are only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_TIMEZONE. */
- uint32_t time_zone_id;
- MDTimeZoneInformation time_zone;
-
- /* The following fields are not present in MINIDUMP_MISC_INFO_3 but are
- * in MINIDUMP_MISC_INFO_4. When this struct is populated, these values
- * may not be set. Use flags1 and size_of_info to determine whether these
- * values are present. */
-
- /* The following 2 fields are only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_BUILDSTRING. */
- uint16_t build_string[MD_MAX_PATH]; /* UTF-16-encoded, 0-terminated */
- uint16_t dbg_bld_str[40]; /* UTF-16-encoded, 0-terminated */
-
- /* The following fields are not present in MINIDUMP_MISC_INFO_4 but are
- * in MINIDUMP_MISC_INFO_5. When this struct is populated, these values
- * may not be set. Use flags1 and size_of_info to determine whether these
- * values are present. */
-
- /* The following field has its own flags for establishing the validity of
- * the structure's contents.*/
- MDXStateConfigFeatureMscInfo xstate_data;
-
- /* The following field is only valid if flags1 contains
- * MD_MISCINFO_FLAGS1_PROCESS_COOKIE. */
- uint32_t process_cookie;
-} MDRawMiscInfo; /* MINIDUMP_MISC_INFO, MINIDUMP_MISC_INFO_2,
- * MINIDUMP_MISC_INFO_3, MINIDUMP_MISC_INFO_4,
- * MINIDUMP_MISC_INFO_5, MINIDUMP_MISC_INFO_N */
-
-static const size_t MD_MISCINFO_SIZE =
- offsetof(MDRawMiscInfo, processor_max_mhz);
-static const size_t MD_MISCINFO2_SIZE =
- offsetof(MDRawMiscInfo, process_integrity_level);
-static const size_t MD_MISCINFO3_SIZE =
- offsetof(MDRawMiscInfo, build_string[0]);
-static const size_t MD_MISCINFO4_SIZE =
- offsetof(MDRawMiscInfo, xstate_data);
-/* Version 5 of the MDRawMiscInfo structure is not a multiple of 8 in size and
- * yet it contains some 8-bytes sized fields. This causes many compilers to
- * round the structure size up to a multiple of 8 by adding padding at the end.
- * The following hack is thus required for matching the proper on-disk size. */
-static const size_t MD_MISCINFO5_SIZE =
- offsetof(MDRawMiscInfo, process_cookie) + sizeof(uint32_t);
-
-/* For (MDRawMiscInfo).flags1. These values indicate which fields in the
- * MDRawMiscInfoStructure are valid. */
-typedef enum {
- MD_MISCINFO_FLAGS1_PROCESS_ID = 0x00000001,
- /* MINIDUMP_MISC1_PROCESS_ID */
- MD_MISCINFO_FLAGS1_PROCESS_TIMES = 0x00000002,
- /* MINIDUMP_MISC1_PROCESS_TIMES */
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO = 0x00000004,
- /* MINIDUMP_MISC1_PROCESSOR_POWER_INFO */
- MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY = 0x00000010,
- /* MINIDUMP_MISC3_PROCESS_INTEGRITY */
- MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS = 0x00000020,
- /* MINIDUMP_MISC3_PROCESS_EXECUTE_FLAGS */
- MD_MISCINFO_FLAGS1_TIMEZONE = 0x00000040,
- /* MINIDUMP_MISC3_TIMEZONE */
- MD_MISCINFO_FLAGS1_PROTECTED_PROCESS = 0x00000080,
- /* MINIDUMP_MISC3_PROTECTED_PROCESS */
- MD_MISCINFO_FLAGS1_BUILDSTRING = 0x00000100,
- /* MINIDUMP_MISC4_BUILDSTRING */
- MD_MISCINFO_FLAGS1_PROCESS_COOKIE = 0x00000200,
- /* MINIDUMP_MISC5_PROCESS_COOKIE */
-} MDMiscInfoFlags1;
-
-/*
- * Around DbgHelp version 6.0, the style of new LIST structures changed
- * from including an array of length 1 at the end of the struct to
- * represent the variable-length data to including explicit
- * "size of header", "size of entry" and "number of entries" fields
- * in the header, presumably to allow backwards-compatibly-extending
- * the structures in the future. The actual list entries follow the
- * header data directly in this case.
- */
-
-typedef struct {
- uint32_t size_of_header; /* sizeof(MDRawMemoryInfoList) */
- uint32_t size_of_entry; /* sizeof(MDRawMemoryInfo) */
- uint64_t number_of_entries;
-} MDRawMemoryInfoList; /* MINIDUMP_MEMORY_INFO_LIST */
-
-typedef struct {
- uint64_t base_address; /* Base address of a region of pages */
- uint64_t allocation_base; /* Base address of a range of pages
- * within this region. */
- uint32_t allocation_protection; /* Memory protection when this region
- * was originally allocated:
- * MDMemoryProtection */
- uint32_t __alignment1;
- uint64_t region_size;
- uint32_t state; /* MDMemoryState */
- uint32_t protection; /* MDMemoryProtection */
- uint32_t type; /* MDMemoryType */
- uint32_t __alignment2;
-} MDRawMemoryInfo; /* MINIDUMP_MEMORY_INFO */
-
-/* For (MDRawMemoryInfo).state */
-typedef enum {
- MD_MEMORY_STATE_COMMIT = 0x1000, /* physical storage has been allocated */
- MD_MEMORY_STATE_RESERVE = 0x2000, /* reserved, but no physical storage */
- MD_MEMORY_STATE_FREE = 0x10000 /* available to be allocated */
-} MDMemoryState;
-
-/* For (MDRawMemoryInfo).allocation_protection and .protection */
-typedef enum {
- MD_MEMORY_PROTECT_NOACCESS = 0x01, /* PAGE_NOACCESS */
- MD_MEMORY_PROTECT_READONLY = 0x02, /* PAGE_READONLY */
- MD_MEMORY_PROTECT_READWRITE = 0x04, /* PAGE_READWRITE */
- MD_MEMORY_PROTECT_WRITECOPY = 0x08, /* PAGE_WRITECOPY */
- MD_MEMORY_PROTECT_EXECUTE = 0x10, /* PAGE_EXECUTE */
- MD_MEMORY_PROTECT_EXECUTE_READ = 0x20, /* PAGE_EXECUTE_READ */
- MD_MEMORY_PROTECT_EXECUTE_READWRITE = 0x40, /* PAGE_EXECUTE_READWRITE */
- MD_MEMORY_PROTECT_EXECUTE_WRITECOPY = 0x80, /* PAGE_EXECUTE_WRITECOPY */
- /* These options can be combined with the previous flags. */
- MD_MEMORY_PROTECT_GUARD = 0x100, /* PAGE_GUARD */
- MD_MEMORY_PROTECT_NOCACHE = 0x200, /* PAGE_NOCACHE */
- MD_MEMORY_PROTECT_WRITECOMBINE = 0x400, /* PAGE_WRITECOMBINE */
-} MDMemoryProtection;
-
-/* Used to mask the mutually exclusive options from the combinable flags. */
-const uint32_t MD_MEMORY_PROTECTION_ACCESS_MASK = 0xFF;
-
-/* For (MDRawMemoryInfo).type */
-typedef enum {
- MD_MEMORY_TYPE_PRIVATE = 0x20000, /* not shared by other processes */
- MD_MEMORY_TYPE_MAPPED = 0x40000, /* mapped into the view of a section */
- MD_MEMORY_TYPE_IMAGE = 0x1000000 /* mapped into the view of an image */
-} MDMemoryType;
-
-/*
- * Breakpad extension types
- */
-
-
-typedef struct {
- /* validity is a bitmask with values from MDBreakpadInfoValidity, indicating
- * which of the other fields in the structure are valid. */
- uint32_t validity;
-
- /* Thread ID of the handler thread. dump_thread_id should correspond to
- * the thread_id of an MDRawThread in the minidump's MDRawThreadList if
- * a dedicated thread in that list was used to produce the minidump. If
- * the MDRawThreadList does not contain a dedicated thread used to produce
- * the minidump, this field should be set to 0 and the validity field
- * must not contain MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID. */
- uint32_t dump_thread_id;
-
- /* Thread ID of the thread that requested the minidump be produced. As
- * with dump_thread_id, requesting_thread_id should correspond to the
- * thread_id of an MDRawThread in the minidump's MDRawThreadList. For
- * minidumps produced as a result of an exception, requesting_thread_id
- * will be the same as the MDRawExceptionStream's thread_id field. For
- * minidumps produced "manually" at the program's request,
- * requesting_thread_id will indicate which thread caused the dump to be
- * written. If the minidump was produced at the request of something
- * other than a thread in the MDRawThreadList, this field should be set
- * to 0 and the validity field must not contain
- * MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID. */
- uint32_t requesting_thread_id;
-} MDRawBreakpadInfo;
-
-/* For (MDRawBreakpadInfo).validity: */
-typedef enum {
- /* When set, the dump_thread_id field is valid. */
- MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID = 1 << 0,
-
- /* When set, the requesting_thread_id field is valid. */
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID = 1 << 1
-} MDBreakpadInfoValidity;
-
-typedef struct {
- /* expression, function, and file are 0-terminated UTF-16 strings. They
- * may be truncated if necessary, but should always be 0-terminated when
- * written to a file.
- * Fixed-length strings are used because MiniDumpWriteDump doesn't offer
- * a way for user streams to point to arbitrary RVAs for strings. */
- uint16_t expression[128]; /* Assertion that failed... */
- uint16_t function[128]; /* ...within this function... */
- uint16_t file[128]; /* ...in this file... */
- uint32_t line; /* ...at this line. */
- uint32_t type;
-} MDRawAssertionInfo;
-
-/* For (MDRawAssertionInfo).type: */
-typedef enum {
- MD_ASSERTION_INFO_TYPE_UNKNOWN = 0,
-
- /* Used for assertions that would be raised by the MSVC CRT but are
- * directed to an invalid parameter handler instead. */
- MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER,
-
- /* Used for assertions that would be raised by the MSVC CRT but are
- * directed to a pure virtual call handler instead. */
- MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL
-} MDAssertionInfoData;
-
-/* These structs are used to store the DSO debug data in Linux minidumps,
- * which is necessary for converting minidumps to usable coredumps.
- * Because of a historical accident, several fields are variably encoded
- * according to client word size, so tools potentially need to support both. */
-
-typedef struct {
- uint32_t addr;
- MDRVA name;
- uint32_t ld;
-} MDRawLinkMap32;
-
-typedef struct {
- uint32_t version;
- MDRVA map; /* array of MDRawLinkMap32 */
- uint32_t dso_count;
- uint32_t brk;
- uint32_t ldbase;
- uint32_t dynamic;
-} MDRawDebug32;
-
-typedef struct {
- uint64_t addr;
- MDRVA name;
- uint64_t ld;
-} MDRawLinkMap64;
-
-typedef struct {
- uint32_t version;
- MDRVA map; /* array of MDRawLinkMap64 */
- uint32_t dso_count;
- uint64_t brk;
- uint64_t ldbase;
- uint64_t dynamic;
-} MDRawDebug64;
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif /* _MSC_VER */
-
-
-#endif /* GOOGLE_BREAKPAD_COMMON_MINIDUMP_FORMAT_H__ */
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_size.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_size.h
deleted file mode 100644
index fae57923cc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/common/minidump_size.h
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
-
-// minidump_size.h: Provides a C++ template for programmatic access to
-// the sizes of various types defined in minidump_format.h.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__
-#define GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__
-
-#include <sys/types.h>
-
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-template<typename T>
-class minidump_size {
- public:
- static size_t size() { return sizeof(T); }
-};
-
-// Explicit specializations for variable-length types. The size returned
-// for these should be the size for an object without its variable-length
-// section.
-
-template<>
-class minidump_size<MDString> {
- public:
- static size_t size() { return MDString_minsize; }
-};
-
-template<>
-class minidump_size<MDRawThreadList> {
- public:
- static size_t size() { return MDRawThreadList_minsize; }
-};
-
-template<>
-class minidump_size<MDCVInfoPDB20> {
- public:
- static size_t size() { return MDCVInfoPDB20_minsize; }
-};
-
-template<>
-class minidump_size<MDCVInfoPDB70> {
- public:
- static size_t size() { return MDCVInfoPDB70_minsize; }
-};
-
-template<>
-class minidump_size<MDCVInfoELF> {
- public:
- static size_t size() { return MDCVInfoELF_minsize; }
-};
-
-template<>
-class minidump_size<MDImageDebugMisc> {
- public:
- static size_t size() { return MDImageDebugMisc_minsize; }
-};
-
-template<>
-class minidump_size<MDRawModuleList> {
- public:
- static size_t size() { return MDRawModuleList_minsize; }
-};
-
-template<>
-class minidump_size<MDRawMemoryList> {
- public:
- static size_t size() { return MDRawMemoryList_minsize; }
-};
-
-// Explicit specialization for MDRawModule, for which sizeof may include
-// tail-padding on some architectures but not others.
-
-template<>
-class minidump_size<MDRawModule> {
- public:
- static size_t size() { return MD_MODULE_SIZE; }
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_COMMON_MINIDUMP_SIZE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/basic_source_line_resolver.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/basic_source_line_resolver.h
deleted file mode 100644
index 6bb6d8639a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/basic_source_line_resolver.h
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// basic_source_line_resolver.h: BasicSourceLineResolver is derived from
-// SourceLineResolverBase, and is a concrete implementation of
-// SourceLineResolverInterface, using address map files produced by a
-// compatible writer, e.g. PDBSourceLineWriter.
-//
-// see "processor/source_line_resolver_base.h"
-// and "source_line_resolver_interface.h" for more documentation.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__
-
-#include <map>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/source_line_resolver_base.h"
-
-namespace google_breakpad {
-
-using std::map;
-
-class BasicSourceLineResolver : public SourceLineResolverBase {
- public:
- BasicSourceLineResolver();
- virtual ~BasicSourceLineResolver() { }
-
- using SourceLineResolverBase::LoadModule;
- using SourceLineResolverBase::LoadModuleUsingMapBuffer;
- using SourceLineResolverBase::LoadModuleUsingMemoryBuffer;
- using SourceLineResolverBase::ShouldDeleteMemoryBufferAfterLoadModule;
- using SourceLineResolverBase::UnloadModule;
- using SourceLineResolverBase::HasModule;
- using SourceLineResolverBase::IsModuleCorrupt;
- using SourceLineResolverBase::FillSourceLineInfo;
- using SourceLineResolverBase::FindWindowsFrameInfo;
- using SourceLineResolverBase::FindCFIFrameInfo;
-
- private:
- // friend declarations:
- friend class BasicModuleFactory;
- friend class ModuleComparer;
- friend class ModuleSerializer;
- template<class> friend class SimpleSerializer;
-
- // Function derives from SourceLineResolverBase::Function.
- struct Function;
- // Module implements SourceLineResolverBase::Module interface.
- class Module;
-
- // Disallow unwanted copy ctor and assignment operator
- BasicSourceLineResolver(const BasicSourceLineResolver&);
- void operator=(const BasicSourceLineResolver&);
-};
-
-// Helper class, containing useful methods for parsing of Breakpad symbol files.
-class SymbolParseHelper {
- public:
- // Parses a |file_line| declaration. Returns true on success.
- // Format: FILE <id> <filename>.
- // Notice, that this method modifies the input |file_line| which is why it
- // can't be const. On success, <id>, and <filename> are stored in |*index|,
- // and |*filename|. No allocation is done, |*filename| simply points inside
- // |file_line|.
- static bool ParseFile(char *file_line, // in
- long *index, // out
- char **filename); // out
-
- // Parses a |function_line| declaration. Returns true on success.
- // Format: FUNC <address> <size> <stack_param_size> <name>.
- // Notice, that this method modifies the input |function_line| which is why it
- // can't be const. On success, <address>, <size>, <stack_param_size>, and
- // <name> are stored in |*address|, |*size|, |*stack_param_size|, and |*name|.
- // No allocation is done, |*name| simply points inside |function_line|.
- static bool ParseFunction(char *function_line, // in
- uint64_t *address, // out
- uint64_t *size, // out
- long *stack_param_size, // out
- char **name); // out
-
- // Parses a |line| declaration. Returns true on success.
- // Format: <address> <size> <line number> <source file id>
- // Notice, that this method modifies the input |function_line| which is why
- // it can't be const. On success, <address>, <size>, <line number>, and
- // <source file id> are stored in |*address|, |*size|, |*line_number|, and
- // |*source_file|.
- static bool ParseLine(char *line_line, // in
- uint64_t *address, // out
- uint64_t *size, // out
- long *line_number, // out
- long *source_file); // out
-
- // Parses a |public_line| declaration. Returns true on success.
- // Format: PUBLIC <address> <stack_param_size> <name>
- // Notice, that this method modifies the input |function_line| which is why
- // it can't be const. On success, <address>, <stack_param_size>, <name>
- // are stored in |*address|, |*stack_param_size|, and |*name|.
- // No allocation is done, |*name| simply points inside |public_line|.
- static bool ParsePublicSymbol(char *public_line, // in
- uint64_t *address, // out
- long *stack_param_size, // out
- char **name); // out
-
- private:
- // Used for success checks after strtoull and strtol.
- static bool IsValidAfterNumber(char *after_number);
-
- // Only allow static methods.
- SymbolParseHelper();
- SymbolParseHelper(const SymbolParseHelper&);
- void operator=(const SymbolParseHelper&);
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/call_stack.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/call_stack.h
deleted file mode 100644
index c59142315b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/call_stack.h
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// call_stack.h: A call stack comprised of stack frames.
-//
-// This class manages a vector of stack frames. It is used instead of
-// exposing the vector directly to allow the CallStack to own StackFrame
-// pointers without having to publicly export the linked_ptr class. A
-// CallStack must be composed of pointers instead of objects to allow for
-// CPU-specific StackFrame subclasses.
-//
-// By convention, the stack frame at index 0 is the innermost callee frame,
-// and the frame at the highest index in a call stack is the outermost
-// caller. CallStack only allows stacks to be built by pushing frames,
-// beginning with the innermost callee frame.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_CALL_STACK_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_CALL_STACK_H__
-
-#include <cstdint>
-#include <vector>
-
-namespace google_breakpad {
-
-using std::vector;
-
-struct StackFrame;
-template<typename T> class linked_ptr;
-
-class CallStack {
- public:
- CallStack() { Clear(); }
- ~CallStack();
-
- // Resets the CallStack to its initial empty state
- void Clear();
-
- const vector<StackFrame*>* frames() const { return &frames_; }
-
- // Set the TID associated with this call stack.
- void set_tid(uint32_t tid) { tid_ = tid; }
-
- uint32_t tid() const { return tid_; }
-
- private:
- // Stackwalker is responsible for building the frames_ vector.
- friend class Stackwalker;
-
- // Storage for pushed frames.
- vector<StackFrame*> frames_;
-
- // The TID associated with this call stack. Default to 0 if it's not
- // available.
- uint32_t tid_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCSSOR_CALL_STACK_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_module.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_module.h
deleted file mode 100644
index b139907c44..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_module.h
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// code_module.h: Carries information about code modules that are loaded
-// into a process.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULE_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULE_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-class CodeModule {
- public:
- virtual ~CodeModule() {}
-
- // The base address of this code module as it was loaded by the process.
- // (uint64_t)-1 on error.
- virtual uint64_t base_address() const = 0;
-
- // The size of the code module. 0 on error.
- virtual uint64_t size() const = 0;
-
- // The path or file name that the code module was loaded from. Empty on
- // error.
- virtual string code_file() const = 0;
-
- // An identifying string used to discriminate between multiple versions and
- // builds of the same code module. This may contain a uuid, timestamp,
- // version number, or any combination of this or other information, in an
- // implementation-defined format. Empty on error.
- virtual string code_identifier() const = 0;
-
- // The filename containing debugging information associated with the code
- // module. If debugging information is stored in a file separate from the
- // code module itself (as is the case when .pdb or .dSYM files are used),
- // this will be different from code_file. If debugging information is
- // stored in the code module itself (possibly prior to stripping), this
- // will be the same as code_file. Empty on error.
- virtual string debug_file() const = 0;
-
- // An identifying string similar to code_identifier, but identifies a
- // specific version and build of the associated debug file. This may be
- // the same as code_identifier when the debug_file and code_file are
- // identical or when the same identifier is used to identify distinct
- // debug and code files.
- virtual string debug_identifier() const = 0;
-
- // A human-readable representation of the code module's version. Empty on
- // error.
- virtual string version() const = 0;
-
- // Creates a new copy of this CodeModule object, which the caller takes
- // ownership of. The new CodeModule may be of a different concrete class
- // than the CodeModule being copied, but will behave identically to the
- // copied CodeModule as far as the CodeModule interface is concerned.
- virtual CodeModule* Copy() const = 0;
-
- // Getter and setter for shrink_down_delta. This is used when the address
- // range for a module is shrunk down due to address range conflicts with
- // other modules. The base_address and size fields are not updated and they
- // should always reflect the original values (reported in the minidump).
- virtual uint64_t shrink_down_delta() const = 0;
- virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) = 0;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_modules.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_modules.h
deleted file mode 100644
index 509137cbbe..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/code_modules.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// code_modules.h: Contains all of the CodeModule objects that were loaded
-// into a single process.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULES_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULES_H__
-
-#include <stddef.h>
-
-#include <vector>
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "processor/linked_ptr.h"
-
-namespace google_breakpad {
-
-class CodeModule;
-
-class CodeModules {
- public:
- virtual ~CodeModules() {}
-
- // The number of contained CodeModule objects.
- virtual unsigned int module_count() const = 0;
-
- // Random access to modules. Returns the module whose code is present
- // at the address indicated by |address|. If no module is present at this
- // address, returns NULL. Ownership of the returned CodeModule is retained
- // by the CodeModules object; pointers returned by this method are valid for
- // comparison with pointers returned by the other Get methods.
- virtual const CodeModule* GetModuleForAddress(uint64_t address) const = 0;
-
- // Returns the module corresponding to the main executable. If there is
- // no main executable, returns NULL. Ownership of the returned CodeModule
- // is retained by the CodeModules object; pointers returned by this method
- // are valid for comparison with pointers returned by the other Get
- // methods.
- virtual const CodeModule* GetMainModule() const = 0;
-
- // Sequential access to modules. A sequence number of 0 corresponds to the
- // module residing lowest in memory. If the sequence number is out of
- // range, returns NULL. Ownership of the returned CodeModule is retained
- // by the CodeModules object; pointers returned by this method are valid for
- // comparison with pointers returned by the other Get methods.
- virtual const CodeModule* GetModuleAtSequence(
- unsigned int sequence) const = 0;
-
- // Sequential access to modules. This is similar to GetModuleAtSequence,
- // except no ordering requirement is enforced. A CodeModules implementation
- // may return CodeModule objects from GetModuleAtIndex in any order it
- // wishes, provided that the order remain the same throughout the life of
- // the CodeModules object. Typically, GetModuleAtIndex would be used by
- // a caller to enumerate all CodeModule objects quickly when the enumeration
- // does not require any ordering. If the index argument is out of range,
- // returns NULL. Ownership of the returned CodeModule is retained by
- // the CodeModules object; pointers returned by this method are valid for
- // comparison with pointers returned by the other Get methods.
- virtual const CodeModule* GetModuleAtIndex(unsigned int index) const = 0;
-
- // Creates a new copy of this CodeModules object, which the caller takes
- // ownership of. The new object will also contain copies of the existing
- // object's child CodeModule objects. The new CodeModules object may be of
- // a different concrete class than the object being copied, but will behave
- // identically to the copied object as far as the CodeModules and CodeModule
- // interfaces are concerned, except that the order that GetModuleAtIndex
- // returns objects in may differ between a copy and the original CodeModules
- // object.
- virtual const CodeModules* Copy() const = 0;
-
- // Returns a vector of all modules which address ranges needed to be shrunk
- // down due to address range conflicts with other modules.
- virtual std::vector<linked_ptr<const CodeModule> >
- GetShrunkRangeModules() const = 0;
-
- // Returns true, if module address range shrink is enabled.
- virtual bool IsModuleShrinkEnabled() const = 0;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_CODE_MODULES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_context.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_context.h
deleted file mode 100644
index df80bf7ef7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_context.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (c) 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dump_context.h: A (mini/micro) dump CPU-specific context.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_DUMP_CONTEXT_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_DUMP_CONTEXT_H__
-
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/dump_object.h"
-
-namespace google_breakpad {
-
-// DumpContext carries a CPU-specific MDRawContext structure, which contains CPU
-// context such as register states.
-class DumpContext : public DumpObject {
- public:
- virtual ~DumpContext();
-
- // Returns an MD_CONTEXT_* value such as MD_CONTEXT_X86 or MD_CONTEXT_PPC
- // identifying the CPU type that the context was collected from. The
- // returned value will identify the CPU only, and will have any other
- // MD_CONTEXT_* bits masked out. Returns 0 on failure.
- uint32_t GetContextCPU() const;
-
- // Return the raw value of |context_flags_|
- uint32_t GetContextFlags() const;
-
- // Returns raw CPU-specific context data for the named CPU type. If the
- // context data does not match the CPU type or does not exist, returns NULL.
- const MDRawContextAMD64* GetContextAMD64() const;
- const MDRawContextARM* GetContextARM() const;
- const MDRawContextARM64* GetContextARM64() const;
- const MDRawContextMIPS* GetContextMIPS() const;
- const MDRawContextPPC* GetContextPPC() const;
- const MDRawContextPPC64* GetContextPPC64() const;
- const MDRawContextSPARC* GetContextSPARC() const;
- const MDRawContextX86* GetContextX86() const;
-
- // A convenience method to get the instruction pointer out of the
- // MDRawContext, since it varies per-CPU architecture.
- bool GetInstructionPointer(uint64_t* ip) const;
-
- // Similar to the GetInstructionPointer method, this method gets the stack
- // pointer for all CPU architectures.
- bool GetStackPointer(uint64_t* sp) const;
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- protected:
- DumpContext();
-
- // Sets row CPU-specific context data for the names CPU type.
- void SetContextFlags(uint32_t context_flags);
- void SetContextX86(MDRawContextX86* x86);
- void SetContextPPC(MDRawContextPPC* ppc);
- void SetContextPPC64(MDRawContextPPC64* ppc64);
- void SetContextAMD64(MDRawContextAMD64* amd64);
- void SetContextSPARC(MDRawContextSPARC* ctx_sparc);
- void SetContextARM(MDRawContextARM* arm);
- void SetContextARM64(MDRawContextARM64* arm64);
- void SetContextMIPS(MDRawContextMIPS* ctx_mips);
-
- // Free the CPU-specific context structure.
- void FreeContext();
-
- private:
- // The CPU-specific context structure.
- union {
- MDRawContextBase* base;
- MDRawContextX86* x86;
- MDRawContextPPC* ppc;
- MDRawContextPPC64* ppc64;
- MDRawContextAMD64* amd64;
- // on Solaris SPARC, sparc is defined as a numeric constant,
- // so variables can NOT be named as sparc
- MDRawContextSPARC* ctx_sparc;
- MDRawContextARM* arm;
- MDRawContextARM64* arm64;
- MDRawContextMIPS* ctx_mips;
- } context_;
-
- // Store this separately because of the weirdo AMD64 context
- uint32_t context_flags_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_DUMP_CONTEXT_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_object.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_object.h
deleted file mode 100644
index 112f687f4c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/dump_object.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dump_object.h: A base class for all mini/micro dump object.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_DUMP_OBJECT_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_DUMP_OBJECT_H__
-
-namespace google_breakpad {
-
-// DumpObject is the base of various mini/micro dump's objects.
-class DumpObject {
- public:
- DumpObject();
-
- bool valid() const { return valid_; }
-
- protected:
- // DumpObjects are not valid when created. When a subclass populates its own
- // fields, it can set valid_ to true. Accessors and mutators may wish to
- // consider or alter the valid_ state as they interact with objects.
- bool valid_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_DUMP_OBJECT_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/exploitability.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/exploitability.h
deleted file mode 100644
index 014413c944..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/exploitability.h
+++ /dev/null
@@ -1,82 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exploitability_engine.h: Generic exploitability engine.
-//
-// The Exploitability class is an abstract base class providing common
-// generic methods that apply to exploitability engines for specific platforms.
-// Specific implementations will extend this class by providing run
-// methods to fill in the exploitability_ enumeration of the ProcessState
-// for a crash.
-//
-// Author: Cris Neckar
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_H_
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/process_state.h"
-
-namespace google_breakpad {
-
-class Exploitability {
- public:
- virtual ~Exploitability() {}
-
- static Exploitability *ExploitabilityForPlatform(Minidump *dump,
- ProcessState *process_state);
-
- // The boolean parameter signals whether the exploitability engine is
- // enabled to call out to objdump for disassembly. This is disabled by
- // default. It is used to check the identity of the instruction that
- // caused the program to crash. This should not be enabled if there are
- // portability concerns.
- static Exploitability *ExploitabilityForPlatform(Minidump *dump,
- ProcessState *process_state,
- bool enable_objdump);
-
- ExploitabilityRating CheckExploitability();
- bool AddressIsAscii(uint64_t);
-
- protected:
- Exploitability(Minidump *dump,
- ProcessState *process_state);
-
- Minidump *dump_;
- ProcessState *process_state_;
- SystemInfo *system_info_;
-
- private:
- virtual ExploitabilityRating CheckPlatformExploitability() = 0;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/fast_source_line_resolver.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/fast_source_line_resolver.h
deleted file mode 100644
index fdf9107766..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/fast_source_line_resolver.h
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// fast_source_line_resolver.h: FastSourceLineResolver is derived from
-// SourceLineResolverBase, and is a concrete implementation of
-// SourceLineResolverInterface.
-//
-// FastSourceLineResolver is a sibling class of BasicSourceLineResolver. The
-// difference is FastSourceLineResolver loads a serialized memory chunk of data
-// which can be used directly a Module without parsing or copying of underlying
-// data. Therefore loading a symbol in FastSourceLineResolver is much faster
-// and more memory-efficient than BasicSourceLineResolver.
-//
-// See "source_line_resolver_base.h" and
-// "google_breakpad/source_line_resolver_interface.h" for more reference.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_FAST_SOURCE_LINE_RESOLVER_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_FAST_SOURCE_LINE_RESOLVER_H__
-
-#include <map>
-#include <string>
-
-#include "google_breakpad/processor/source_line_resolver_base.h"
-
-namespace google_breakpad {
-
-using std::map;
-
-class FastSourceLineResolver : public SourceLineResolverBase {
- public:
- FastSourceLineResolver();
- virtual ~FastSourceLineResolver() { }
-
- using SourceLineResolverBase::FillSourceLineInfo;
- using SourceLineResolverBase::FindCFIFrameInfo;
- using SourceLineResolverBase::FindWindowsFrameInfo;
- using SourceLineResolverBase::HasModule;
- using SourceLineResolverBase::IsModuleCorrupt;
- using SourceLineResolverBase::LoadModule;
- using SourceLineResolverBase::LoadModuleUsingMapBuffer;
- using SourceLineResolverBase::LoadModuleUsingMemoryBuffer;
- using SourceLineResolverBase::UnloadModule;
-
- private:
- // Friend declarations.
- friend class ModuleComparer;
- friend class ModuleSerializer;
- friend class FastModuleFactory;
-
- // Nested types that will derive from corresponding nested types defined in
- // SourceLineResolverBase.
- struct Line;
- struct Function;
- struct PublicSymbol;
- class Module;
-
- // Deserialize raw memory data to construct a WindowsFrameInfo object.
- static WindowsFrameInfo CopyWFI(const char *raw_memory);
-
- // FastSourceLineResolver requires the memory buffer stays alive during the
- // lifetime of a corresponding module, therefore it needs to redefine this
- // virtual method.
- virtual bool ShouldDeleteMemoryBufferAfterLoadModule();
-
- // Disallow unwanted copy ctor and assignment operator
- FastSourceLineResolver(const FastSourceLineResolver&);
- void operator=(const FastSourceLineResolver&);
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_FAST_SOURCE_LINE_RESOLVER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/memory_region.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/memory_region.h
deleted file mode 100644
index 30f88df490..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/memory_region.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// memory_region.h: Access to memory regions.
-//
-// A MemoryRegion provides virtual access to a range of memory. It is an
-// abstraction allowing the actual source of memory to be independent of
-// methods which need to access a virtual memory space.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_MEMORY_REGION_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_MEMORY_REGION_H__
-
-
-#include "google_breakpad/common/breakpad_types.h"
-
-
-namespace google_breakpad {
-
-
-class MemoryRegion {
- public:
- virtual ~MemoryRegion() {}
-
- // The base address of this memory region.
- virtual uint64_t GetBase() const = 0;
-
- // The size of this memory region.
- virtual uint32_t GetSize() const = 0;
-
- // Access to data of various sizes within the memory region. address
- // is a pointer to read, and it must lie within the memory region as
- // defined by its base address and size. The location pointed to by
- // value is set to the value at address. Byte-swapping is performed
- // if necessary so that the value is appropriate for the running
- // program. Returns true on success. Fails and returns false if address
- // is out of the region's bounds (after considering the width of value),
- // or for other types of errors.
- virtual bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const = 0;
- virtual bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const = 0;
- virtual bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const = 0;
- virtual bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const = 0;
-
- // Print a human-readable representation of the object to stdout.
- virtual void Print() const = 0;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_MEMORY_REGION_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump.h
deleted file mode 100644
index 0e2cb74944..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump.h
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// microdump.h: A microdump reader. Microdump is a minified variant of a
-// minidump (see minidump.h for documentation) which contains the minimum
-// amount of information required to get a stack trace for the crashing thread.
-// The information contained in a microdump is:
-// - the crashing thread stack
-// - system information (os type / version)
-// - cpu context (state of the registers)
-// - list of mmaps
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_H__
-
-#include <string>
-#include <vector>
-
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/dump_context.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/basic_code_modules.h"
-
-namespace google_breakpad {
-
-// MicrodumpModuleList contains all of the loaded code modules for a process
-// in the form of MicrodumpModules. It maintains a vector of these modules
-// and provides access to a code module corresponding to a specific address.
-class MicrodumpModules : public BasicCodeModules {
- public:
- // Takes over ownership of |module|.
- void Add(const CodeModule* module);
-
- // Enables/disables module address range shrink.
- void SetEnableModuleShrink(bool is_enabled);
-};
-
-// MicrodumpContext carries a CPU-specific context.
-// See dump_context.h for documentation.
-class MicrodumpContext : public DumpContext {
- public:
- virtual void SetContextARM(MDRawContextARM* arm);
- virtual void SetContextARM64(MDRawContextARM64* arm64);
- virtual void SetContextX86(MDRawContextX86* x86);
- virtual void SetContextMIPS(MDRawContextMIPS* mips32);
- virtual void SetContextMIPS64(MDRawContextMIPS* mips64);
-};
-
-// This class provides access to microdump memory regions.
-// See memory_region.h for documentation.
-class MicrodumpMemoryRegion : public MemoryRegion {
- public:
- MicrodumpMemoryRegion();
- virtual ~MicrodumpMemoryRegion() {}
-
- // Set this region's address and contents. If we have placed an
- // instance of this class in a test fixture class, individual tests
- // can use this to provide the region's contents.
- void Init(uint64_t base_address, const std::vector<uint8_t>& contents);
-
- virtual uint64_t GetBase() const;
- virtual uint32_t GetSize() const;
-
- virtual bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const;
- virtual bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const;
- virtual bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const;
- virtual bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const;
-
- // Print a human-readable representation of the object to stdout.
- virtual void Print() const;
-
- private:
- // Fetch a little-endian value from ADDRESS in contents_ whose size
- // is BYTES, and store it in *VALUE. Returns true on success.
- template<typename ValueType>
- bool GetMemoryLittleEndian(uint64_t address, ValueType* value) const;
-
- uint64_t base_address_;
- std::vector<uint8_t> contents_;
-};
-
-// Microdump is the user's interface to a microdump file. It provides access to
-// the microdump's context, memory regions and modules.
-class Microdump {
- public:
- explicit Microdump(const string& contents);
- virtual ~Microdump() {}
-
- DumpContext* GetContext() { return context_.get(); }
- MicrodumpMemoryRegion* GetMemory() { return stack_region_.get(); }
- MicrodumpModules* GetModules() { return modules_.get(); }
- SystemInfo* GetSystemInfo() { return system_info_.get(); }
-
- private:
- scoped_ptr<MicrodumpContext> context_;
- scoped_ptr<MicrodumpMemoryRegion> stack_region_;
- scoped_ptr<MicrodumpModules> modules_;
- scoped_ptr<SystemInfo> system_info_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_H__
-
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump_processor.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump_processor.h
deleted file mode 100644
index 1322a01c76..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/microdump_processor.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The processor for microdump (a reduced dump containing only the state of the
-// crashing thread). See crbug.com/410294 for more info and design docs.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_PROCESSOR_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_PROCESSOR_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/process_result.h"
-
-namespace google_breakpad {
-
-class ProcessState;
-class StackFrameSymbolizer;
-
-class MicrodumpProcessor {
- public:
- // Initializes the MicrodumpProcessor with a stack frame symbolizer.
- // Does not take ownership of frame_symbolizer, which must NOT be NULL.
- explicit MicrodumpProcessor(StackFrameSymbolizer* frame_symbolizer);
-
- virtual ~MicrodumpProcessor();
-
- // Processes the microdump contents and fills process_state with the result.
- google_breakpad::ProcessResult Process(const string& microdump_contents,
- ProcessState* process_state);
- private:
- StackFrameSymbolizer* frame_symbolizer_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_MICRODUMP_PROCESSOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump.h
deleted file mode 100644
index c8c3cd4815..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump.h
+++ /dev/null
@@ -1,1171 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump.h: A minidump reader.
-//
-// The basic structure of this module tracks the structure of the minidump
-// file itself. At the top level, a minidump file is represented by a
-// Minidump object. Like most other classes in this module, Minidump
-// provides a Read method that initializes the object with information from
-// the file. Most of the classes in this file are wrappers around the
-// "raw" structures found in the minidump file itself, and defined in
-// minidump_format.h. For example, each thread is represented by a
-// MinidumpThread object, whose parameters are specified in an MDRawThread
-// structure. A properly byte-swapped MDRawThread can be obtained from a
-// MinidumpThread easily by calling its thread() method.
-//
-// Most of the module lazily reads only the portion of the minidump file
-// necessary to fulfill the user's request. Calling Minidump::Read
-// only reads the minidump's directory. The thread list is not read until
-// it is needed, and even once it's read, the memory regions for each
-// thread's stack aren't read until they're needed. This strategy avoids
-// unnecessary file input, and allocating memory for data in which the user
-// has no interest. Note that although memory allocations for a typical
-// minidump file are not particularly large, it is possible for legitimate
-// minidumps to be sizable. A full-memory minidump, for example, contains
-// a snapshot of the entire mapped memory space. Even a normal minidump,
-// with stack memory only, can be large if, for example, the dump was
-// generated in response to a crash that occurred due to an infinite-
-// recursion bug that caused the stack's limits to be exceeded. Finally,
-// some users of this library will unfortunately find themselves in the
-// position of having to process potentially-hostile minidumps that might
-// attempt to cause problems by forcing the minidump processor to over-
-// allocate memory.
-//
-// Memory management in this module is based on a strict
-// you-don't-own-anything policy. The only object owned by the user is
-// the top-level Minidump object, the creation and destruction of which
-// must be the user's own responsibility. All other objects obtained
-// through interaction with this module are ultimately owned by the
-// Minidump object, and will be freed upon the Minidump object's destruction.
-// Because memory regions can potentially involve large allocations, a
-// FreeMemory method is provided by MinidumpMemoryRegion, allowing the user
-// to release data when it is no longer needed. Use of this method is
-// optional but recommended. If freed data is later required, it will
-// be read back in from the minidump file again.
-//
-// There is one exception to this memory management policy:
-// Minidump::ReadString will return a string object to the user, and the user
-// is responsible for its deletion.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__
-
-#include <stdint.h>
-
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-
-#include <iostream>
-#include <map>
-#include <string>
-#include <vector>
-
-#include "common/basictypes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/dump_context.h"
-#include "google_breakpad/processor/dump_object.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/proc_maps_linux.h"
-
-
-namespace google_breakpad {
-
-
-using std::map;
-using std::vector;
-
-
-class Minidump;
-template<typename AddressType, typename EntryType> class RangeMap;
-
-
-// MinidumpObject is the base of all Minidump* objects except for Minidump
-// itself.
-class MinidumpObject : public DumpObject {
- public:
- virtual ~MinidumpObject() {}
-
- protected:
- explicit MinidumpObject(Minidump* minidump);
-
- // Refers to the Minidump object that is the ultimate parent of this
- // Some MinidumpObjects are owned by other MinidumpObjects, but at the
- // root of the ownership tree is always a Minidump. The Minidump object
- // is kept here for access to its seeking and reading facilities, and
- // for access to data about the minidump file itself, such as whether
- // it should be byte-swapped.
- Minidump* minidump_;
-};
-
-
-// This class exists primarily to provide a virtual destructor in a base
-// class common to all objects that might be stored in
-// Minidump::mStreamObjects. Some object types will never be stored in
-// Minidump::mStreamObjects, but are represented as streams and adhere to the
-// same interface, and may be derived from this class.
-class MinidumpStream : public MinidumpObject {
- public:
- virtual ~MinidumpStream() {}
-
- protected:
- explicit MinidumpStream(Minidump* minidump);
-
- private:
- // Populate (and validate) the MinidumpStream. minidump_ is expected
- // to be positioned at the beginning of the stream, so that the next
- // read from the minidump will be at the beginning of the stream.
- // expected_size should be set to the stream's length as contained in
- // the MDRawDirectory record or other identifying record. A class
- // that implements MinidumpStream can compare expected_size to a
- // known size as an integrity check.
- virtual bool Read(uint32_t expected_size) = 0;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpStream);
-};
-
-
-// MinidumpContext carries a CPU-specific MDRawContext structure, which
-// contains CPU context such as register states. Each thread has its
-// own context, and the exception record, if present, also has its own
-// context. Note that if the exception record is present, the context it
-// refers to is probably what the user wants to use for the exception
-// thread, instead of that thread's own context. The exception thread's
-// context (as opposed to the exception record's context) will contain
-// context for the exception handler (which performs minidump generation),
-// and not the context that caused the exception (which is probably what the
-// user wants).
-class MinidumpContext : public DumpContext {
- public:
- virtual ~MinidumpContext();
-
- protected:
- explicit MinidumpContext(Minidump* minidump);
-
- private:
- friend class MinidumpThread;
- friend class MinidumpException;
-
- bool Read(uint32_t expected_size);
-
- // If the minidump contains a SYSTEM_INFO_STREAM, makes sure that the
- // system info stream gives an appropriate CPU type matching the context
- // CPU type in context_cpu_type. Returns false if the CPU type does not
- // match. Returns true if the CPU type matches or if the minidump does
- // not contain a system info stream.
- bool CheckAgainstSystemInfo(uint32_t context_cpu_type);
-
- // Refers to the Minidump object that is the ultimate parent of this
- // Some MinidumpObjects are owned by other MinidumpObjects, but at the
- // root of the ownership tree is always a Minidump. The Minidump object
- // is kept here for access to its seeking and reading facilities, and
- // for access to data about the minidump file itself, such as whether
- // it should be byte-swapped.
- Minidump* minidump_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpContext);
-};
-
-
-// MinidumpMemoryRegion does not wrap any MDRaw structure, and only contains
-// a reference to an MDMemoryDescriptor. This object is intended to wrap
-// portions of a minidump file that contain memory dumps. In normal
-// minidumps, each MinidumpThread owns a MinidumpMemoryRegion corresponding
-// to the thread's stack memory. MinidumpMemoryList also gives access to
-// memory regions in its list as MinidumpMemoryRegions. This class
-// adheres to MemoryRegion so that it may be used as a data provider to
-// the Stackwalker family of classes.
-class MinidumpMemoryRegion : public MinidumpObject,
- public MemoryRegion {
- public:
- virtual ~MinidumpMemoryRegion();
-
- static void set_max_bytes(uint32_t max_bytes) { max_bytes_ = max_bytes; }
- static uint32_t max_bytes() { return max_bytes_; }
-
- // Returns a pointer to the base of the memory region. Returns the
- // cached value if available, otherwise, reads the minidump file and
- // caches the memory region.
- const uint8_t* GetMemory() const;
-
- // The address of the base of the memory region.
- uint64_t GetBase() const;
-
- // The size, in bytes, of the memory region.
- uint32_t GetSize() const;
-
- // Frees the cached memory region, if cached.
- void FreeMemory();
-
- // Obtains the value of memory at the pointer specified by address.
- bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const;
- bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const;
- bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const;
- bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const;
-
- // Print a human-readable representation of the object to stdout.
- void Print() const;
-
- protected:
- explicit MinidumpMemoryRegion(Minidump* minidump);
-
- private:
- friend class MinidumpThread;
- friend class MinidumpMemoryList;
-
- // Identify the base address and size of the memory region, and the
- // location it may be found in the minidump file.
- void SetDescriptor(MDMemoryDescriptor* descriptor);
-
- // Implementation for GetMemoryAtAddress
- template<typename T> bool GetMemoryAtAddressInternal(uint64_t address,
- T* value) const;
-
- // The largest memory region that will be read from a minidump. The
- // default is 1MB.
- static uint32_t max_bytes_;
-
- // Base address and size of the memory region, and its position in the
- // minidump file.
- MDMemoryDescriptor* descriptor_;
-
- // Cached memory.
- mutable vector<uint8_t>* memory_;
-};
-
-
-// MinidumpThread contains information about a thread of execution,
-// including a snapshot of the thread's stack and CPU context. For
-// the thread that caused an exception, the context carried by
-// MinidumpException is probably desired instead of the CPU context
-// provided here.
-// Note that a MinidumpThread may be valid() even if it does not
-// contain a memory region or context.
-class MinidumpThread : public MinidumpObject {
- public:
- virtual ~MinidumpThread();
-
- const MDRawThread* thread() const { return valid_ ? &thread_ : NULL; }
- // GetMemory may return NULL even if the MinidumpThread is valid,
- // if the thread memory cannot be read.
- virtual MinidumpMemoryRegion* GetMemory();
- // GetContext may return NULL even if the MinidumpThread is valid.
- virtual MinidumpContext* GetContext();
-
- // The thread ID is used to determine if a thread is the exception thread,
- // so a special getter is provided to retrieve this data from the
- // MDRawThread structure. Returns false if the thread ID cannot be
- // determined.
- virtual bool GetThreadID(uint32_t *thread_id) const;
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- // Returns the start address of the thread stack memory region. Returns 0 if
- // MinidumpThread is invalid. Note that this method can be called even when
- // the thread memory cannot be read and GetMemory returns NULL.
- virtual uint64_t GetStartOfStackMemoryRange() const;
-
- protected:
- explicit MinidumpThread(Minidump* minidump);
-
- private:
- // These objects are managed by MinidumpThreadList.
- friend class MinidumpThreadList;
-
- // This works like MinidumpStream::Read, but is driven by
- // MinidumpThreadList. No size checking is done, because
- // MinidumpThreadList handles that directly.
- bool Read();
-
- MDRawThread thread_;
- MinidumpMemoryRegion* memory_;
- MinidumpContext* context_;
-};
-
-
-// MinidumpThreadList contains all of the threads (as MinidumpThreads) in
-// a process.
-class MinidumpThreadList : public MinidumpStream {
- public:
- virtual ~MinidumpThreadList();
-
- static void set_max_threads(uint32_t max_threads) {
- max_threads_ = max_threads;
- }
- static uint32_t max_threads() { return max_threads_; }
-
- virtual unsigned int thread_count() const {
- return valid_ ? thread_count_ : 0;
- }
-
- // Sequential access to threads.
- virtual MinidumpThread* GetThreadAtIndex(unsigned int index) const;
-
- // Random access to threads.
- MinidumpThread* GetThreadByID(uint32_t thread_id);
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- protected:
- explicit MinidumpThreadList(Minidump* aMinidump);
-
- private:
- friend class Minidump;
-
- typedef map<uint32_t, MinidumpThread*> IDToThreadMap;
- typedef vector<MinidumpThread> MinidumpThreads;
-
- static const uint32_t kStreamType = MD_THREAD_LIST_STREAM;
-
- bool Read(uint32_t aExpectedSize);
-
- // The largest number of threads that will be read from a minidump. The
- // default is 256.
- static uint32_t max_threads_;
-
- // Access to threads using the thread ID as the key.
- IDToThreadMap id_to_thread_map_;
-
- // The list of threads.
- MinidumpThreads* threads_;
- uint32_t thread_count_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList);
-};
-
-
-// MinidumpModule wraps MDRawModule, which contains information about loaded
-// code modules. Access is provided to various data referenced indirectly
-// by MDRawModule, such as the module's name and a specification for where
-// to locate debugging information for the module.
-class MinidumpModule : public MinidumpObject,
- public CodeModule {
- public:
- virtual ~MinidumpModule();
-
- static void set_max_cv_bytes(uint32_t max_cv_bytes) {
- max_cv_bytes_ = max_cv_bytes;
- }
- static uint32_t max_cv_bytes() { return max_cv_bytes_; }
-
- static void set_max_misc_bytes(uint32_t max_misc_bytes) {
- max_misc_bytes_ = max_misc_bytes;
- }
- static uint32_t max_misc_bytes() { return max_misc_bytes_; }
-
- const MDRawModule* module() const { return valid_ ? &module_ : NULL; }
-
- // CodeModule implementation
- virtual uint64_t base_address() const {
- return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1);
- }
- virtual uint64_t size() const { return valid_ ? module_.size_of_image : 0; }
- virtual string code_file() const;
- virtual string code_identifier() const;
- virtual string debug_file() const;
- virtual string debug_identifier() const;
- virtual string version() const;
- virtual CodeModule* Copy() const;
-
- // Getter and setter for shrink_down_delta. This is used when the address
- // range for a module is shrunk down due to address range conflicts with
- // other modules. The base_address and size fields are not updated and they
- // should always reflect the original values (reported in the minidump).
- virtual uint64_t shrink_down_delta() const;
- virtual void SetShrinkDownDelta(uint64_t shrink_down_delta);
-
- // The CodeView record, which contains information to locate the module's
- // debugging information (pdb). This is returned as uint8_t* because
- // the data can be of types MDCVInfoPDB20* or MDCVInfoPDB70*, or it may be
- // of a type unknown to Breakpad, in which case the raw data will still be
- // returned but no byte-swapping will have been performed. Check the
- // record's signature in the first four bytes to differentiate between
- // the various types. Current toolchains generate modules which carry
- // MDCVInfoPDB70 by default. Returns a pointer to the CodeView record on
- // success, and NULL on failure. On success, the optional |size| argument
- // is set to the size of the CodeView record.
- const uint8_t* GetCVRecord(uint32_t* size);
-
- // The miscellaneous debug record, which is obsolete. Current toolchains
- // do not generate this type of debugging information (dbg), and this
- // field is not expected to be present. Returns a pointer to the debugging
- // record on success, and NULL on failure. On success, the optional |size|
- // argument is set to the size of the debugging record.
- const MDImageDebugMisc* GetMiscRecord(uint32_t* size);
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- // These objects are managed by MinidumpModuleList.
- friend class MinidumpModuleList;
-
- explicit MinidumpModule(Minidump* minidump);
-
- // This works like MinidumpStream::Read, but is driven by
- // MinidumpModuleList. No size checking is done, because
- // MinidumpModuleList handles that directly.
- bool Read();
-
- // Reads indirectly-referenced data, including the module name, CodeView
- // record, and miscellaneous debugging record. This is necessary to allow
- // MinidumpModuleList to fully construct MinidumpModule objects without
- // requiring seeks to read a contiguous set of MinidumpModule objects.
- // All auxiliary data should be available when Read is called, in order to
- // allow the CodeModule getters to be const methods.
- bool ReadAuxiliaryData();
-
- // The largest number of bytes that will be read from a minidump for a
- // CodeView record or miscellaneous debugging record, respectively. The
- // default for each is 1024.
- static uint32_t max_cv_bytes_;
- static uint32_t max_misc_bytes_;
-
- // True after a successful Read. This is different from valid_, which is
- // not set true until ReadAuxiliaryData also completes successfully.
- // module_valid_ is only used by ReadAuxiliaryData and the functions it
- // calls to determine whether the object is ready for auxiliary data to
- // be read.
- bool module_valid_;
-
- // True if debug info was read from the module. Certain modules
- // may contain debug records in formats we don't support,
- // so we can just set this to false to ignore them.
- bool has_debug_info_;
-
- MDRawModule module_;
-
- // Cached module name.
- const string* name_;
-
- // Cached CodeView record - this is MDCVInfoPDB20 or (likely)
- // MDCVInfoPDB70, or possibly something else entirely. Stored as a uint8_t
- // because the structure contains a variable-sized string and its exact
- // size cannot be known until it is processed.
- vector<uint8_t>* cv_record_;
-
- // If cv_record_ is present, cv_record_signature_ contains a copy of the
- // CodeView record's first four bytes, for ease of determinining the
- // type of structure that cv_record_ contains.
- uint32_t cv_record_signature_;
-
- // Cached MDImageDebugMisc (usually not present), stored as uint8_t
- // because the structure contains a variable-sized string and its exact
- // size cannot be known until it is processed.
- vector<uint8_t>* misc_record_;
-};
-
-
-// MinidumpModuleList contains all of the loaded code modules for a process
-// in the form of MinidumpModules. It maintains a map of these modules
-// so that it may easily provide a code module corresponding to a specific
-// address.
-class MinidumpModuleList : public MinidumpStream,
- public CodeModules {
- public:
- virtual ~MinidumpModuleList();
-
- static void set_max_modules(uint32_t max_modules) {
- max_modules_ = max_modules;
- }
- static uint32_t max_modules() { return max_modules_; }
-
- // CodeModules implementation.
- virtual unsigned int module_count() const {
- return valid_ ? module_count_ : 0;
- }
- virtual const MinidumpModule* GetModuleForAddress(uint64_t address) const;
- virtual const MinidumpModule* GetMainModule() const;
- virtual const MinidumpModule* GetModuleAtSequence(
- unsigned int sequence) const;
- virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const;
- virtual const CodeModules* Copy() const;
-
- // Returns a vector of all modules which address ranges needed to be shrunk
- // down due to address range conflicts with other modules.
- virtual vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const;
-
- // Returns true, if module address range shrink is enabled.
- virtual bool IsModuleShrinkEnabled() const;
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- protected:
- explicit MinidumpModuleList(Minidump* minidump);
-
- private:
- friend class Minidump;
-
- typedef vector<MinidumpModule> MinidumpModules;
-
- static const uint32_t kStreamType = MD_MODULE_LIST_STREAM;
-
- bool Read(uint32_t expected_size);
-
- // The largest number of modules that will be read from a minidump. The
- // default is 1024.
- static uint32_t max_modules_;
-
- // Access to modules using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
-
- MinidumpModules *modules_;
- uint32_t module_count_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList);
-};
-
-
-// MinidumpMemoryList corresponds to a minidump's MEMORY_LIST_STREAM stream,
-// which references the snapshots of all of the memory regions contained
-// within the minidump. For a normal minidump, this includes stack memory
-// (also referenced by each MinidumpThread, in fact, the MDMemoryDescriptors
-// here and in MDRawThread both point to exactly the same data in a
-// minidump file, conserving space), as well as a 256-byte snapshot of memory
-// surrounding the instruction pointer in the case of an exception. Other
-// types of minidumps may contain significantly more memory regions. Full-
-// memory minidumps contain all of a process' mapped memory.
-class MinidumpMemoryList : public MinidumpStream {
- public:
- virtual ~MinidumpMemoryList();
-
- static void set_max_regions(uint32_t max_regions) {
- max_regions_ = max_regions;
- }
- static uint32_t max_regions() { return max_regions_; }
-
- unsigned int region_count() const { return valid_ ? region_count_ : 0; }
-
- // Sequential access to memory regions.
- MinidumpMemoryRegion* GetMemoryRegionAtIndex(unsigned int index);
-
- // Random access to memory regions. Returns the region encompassing
- // the address identified by address.
- virtual MinidumpMemoryRegion* GetMemoryRegionForAddress(uint64_t address);
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- friend class Minidump;
- friend class MockMinidumpMemoryList;
-
- typedef vector<MDMemoryDescriptor> MemoryDescriptors;
- typedef vector<MinidumpMemoryRegion> MemoryRegions;
-
- static const uint32_t kStreamType = MD_MEMORY_LIST_STREAM;
-
- explicit MinidumpMemoryList(Minidump* minidump);
-
- bool Read(uint32_t expected_size);
-
- // The largest number of memory regions that will be read from a minidump.
- // The default is 256.
- static uint32_t max_regions_;
-
- // Access to memory regions using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
-
- // The list of descriptors. This is maintained separately from the list
- // of regions, because MemoryRegion doesn't own its MemoryDescriptor, it
- // maintains a pointer to it. descriptors_ provides the storage for this
- // purpose.
- MemoryDescriptors *descriptors_;
-
- // The list of regions.
- MemoryRegions *regions_;
- uint32_t region_count_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList);
-};
-
-
-// MinidumpException wraps MDRawExceptionStream, which contains information
-// about the exception that caused the minidump to be generated, if the
-// minidump was generated in an exception handler called as a result of an
-// exception. It also provides access to a MinidumpContext object, which
-// contains the CPU context for the exception thread at the time the exception
-// occurred.
-class MinidumpException : public MinidumpStream {
- public:
- virtual ~MinidumpException();
-
- const MDRawExceptionStream* exception() const {
- return valid_ ? &exception_ : NULL;
- }
-
- // The thread ID is used to determine if a thread is the exception thread,
- // so a special getter is provided to retrieve this data from the
- // MDRawExceptionStream structure. Returns false if the thread ID cannot
- // be determined.
- bool GetThreadID(uint32_t *thread_id) const;
-
- MinidumpContext* GetContext();
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- friend class Minidump;
-
- static const uint32_t kStreamType = MD_EXCEPTION_STREAM;
-
- explicit MinidumpException(Minidump* minidump);
-
- bool Read(uint32_t expected_size);
-
- MDRawExceptionStream exception_;
- MinidumpContext* context_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpException);
-};
-
-// MinidumpAssertion wraps MDRawAssertionInfo, which contains information
-// about an assertion that caused the minidump to be generated.
-class MinidumpAssertion : public MinidumpStream {
- public:
- virtual ~MinidumpAssertion();
-
- const MDRawAssertionInfo* assertion() const {
- return valid_ ? &assertion_ : NULL;
- }
-
- string expression() const {
- return valid_ ? expression_ : "";
- }
-
- string function() const {
- return valid_ ? function_ : "";
- }
-
- string file() const {
- return valid_ ? file_ : "";
- }
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- friend class Minidump;
-
- static const uint32_t kStreamType = MD_ASSERTION_INFO_STREAM;
-
- explicit MinidumpAssertion(Minidump* minidump);
-
- bool Read(uint32_t expected_size);
-
- MDRawAssertionInfo assertion_;
- string expression_;
- string function_;
- string file_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpAssertion);
-};
-
-
-// MinidumpSystemInfo wraps MDRawSystemInfo and provides information about
-// the system on which the minidump was generated. See also MinidumpMiscInfo.
-class MinidumpSystemInfo : public MinidumpStream {
- public:
- virtual ~MinidumpSystemInfo();
-
- const MDRawSystemInfo* system_info() const {
- return valid_ ? &system_info_ : NULL;
- }
-
- // GetOS and GetCPU return textual representations of the operating system
- // and CPU that produced the minidump. Unlike most other Minidump* methods,
- // they return string objects, not weak pointers. Defined values for
- // GetOS() are "mac", "windows", and "linux". Defined values for GetCPU
- // are "x86" and "ppc". These methods return an empty string when their
- // values are unknown.
- string GetOS();
- string GetCPU();
-
- // I don't know what CSD stands for, but this field is documented as
- // returning a textual representation of the OS service pack. On other
- // platforms, this provides additional information about an OS version
- // level beyond major.minor.micro. Returns NULL if unknown.
- const string* GetCSDVersion();
-
- // If a CPU vendor string can be determined, returns a pointer to it,
- // otherwise, returns NULL. CPU vendor strings can be determined from
- // x86 CPUs with CPUID 0.
- const string* GetCPUVendor();
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- protected:
- explicit MinidumpSystemInfo(Minidump* minidump);
- MDRawSystemInfo system_info_;
-
- // Textual representation of the OS service pack, for minidumps produced
- // by MiniDumpWriteDump on Windows.
- const string* csd_version_;
-
- private:
- friend class Minidump;
-
- static const uint32_t kStreamType = MD_SYSTEM_INFO_STREAM;
-
- bool Read(uint32_t expected_size);
-
- // A string identifying the CPU vendor, if known.
- const string* cpu_vendor_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfo);
-};
-
-
-// MinidumpMiscInfo wraps MDRawMiscInfo and provides information about
-// the process that generated the minidump, and optionally additional system
-// information. See also MinidumpSystemInfo.
-class MinidumpMiscInfo : public MinidumpStream {
- public:
- const MDRawMiscInfo* misc_info() const {
- return valid_ ? &misc_info_ : NULL;
- }
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- friend class Minidump;
- friend class TestMinidumpMiscInfo;
-
- static const uint32_t kStreamType = MD_MISC_INFO_STREAM;
-
- explicit MinidumpMiscInfo(Minidump* minidump_);
-
- bool Read(uint32_t expected_size_);
-
- MDRawMiscInfo misc_info_;
-
- // Populated by Read. Contains the converted strings from the corresponding
- // UTF-16 fields in misc_info_
- string standard_name_;
- string daylight_name_;
- string build_string_;
- string dbg_bld_str_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfo);
-};
-
-
-// MinidumpBreakpadInfo wraps MDRawBreakpadInfo, which is an optional stream in
-// a minidump that provides additional information about the process state
-// at the time the minidump was generated.
-class MinidumpBreakpadInfo : public MinidumpStream {
- public:
- const MDRawBreakpadInfo* breakpad_info() const {
- return valid_ ? &breakpad_info_ : NULL;
- }
-
- // These thread IDs are used to determine if threads deserve special
- // treatment, so special getters are provided to retrieve this data from
- // the MDRawBreakpadInfo structure. The getters return false if the thread
- // IDs cannot be determined.
- bool GetDumpThreadID(uint32_t *thread_id) const;
- bool GetRequestingThreadID(uint32_t *thread_id) const;
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- friend class Minidump;
-
- static const uint32_t kStreamType = MD_BREAKPAD_INFO_STREAM;
-
- explicit MinidumpBreakpadInfo(Minidump* minidump_);
-
- bool Read(uint32_t expected_size_);
-
- MDRawBreakpadInfo breakpad_info_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpBreakpadInfo);
-};
-
-// MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information
-// about mapped memory regions in a process, including their ranges
-// and protection.
-class MinidumpMemoryInfo : public MinidumpObject {
- public:
- const MDRawMemoryInfo* info() const { return valid_ ? &memory_info_ : NULL; }
-
- // The address of the base of the memory region.
- uint64_t GetBase() const { return valid_ ? memory_info_.base_address : 0; }
-
- // The size, in bytes, of the memory region.
- uint64_t GetSize() const { return valid_ ? memory_info_.region_size : 0; }
-
- // Return true if the memory protection allows execution.
- bool IsExecutable() const;
-
- // Return true if the memory protection allows writing.
- bool IsWritable() const;
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- // These objects are managed by MinidumpMemoryInfoList.
- friend class MinidumpMemoryInfoList;
-
- explicit MinidumpMemoryInfo(Minidump* minidump_);
-
- // This works like MinidumpStream::Read, but is driven by
- // MinidumpMemoryInfoList. No size checking is done, because
- // MinidumpMemoryInfoList handles that directly.
- bool Read();
-
- MDRawMemoryInfo memory_info_;
-};
-
-// MinidumpMemoryInfoList contains a list of information about
-// mapped memory regions for a process in the form of MDRawMemoryInfo.
-// It maintains a map of these structures so that it may easily provide
-// info corresponding to a specific address.
-class MinidumpMemoryInfoList : public MinidumpStream {
- public:
- virtual ~MinidumpMemoryInfoList();
-
- unsigned int info_count() const { return valid_ ? info_count_ : 0; }
-
- const MinidumpMemoryInfo* GetMemoryInfoForAddress(uint64_t address) const;
- const MinidumpMemoryInfo* GetMemoryInfoAtIndex(unsigned int index) const;
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- private:
- friend class Minidump;
-
- typedef vector<MinidumpMemoryInfo> MinidumpMemoryInfos;
-
- static const uint32_t kStreamType = MD_MEMORY_INFO_LIST_STREAM;
-
- explicit MinidumpMemoryInfoList(Minidump* minidump_);
-
- bool Read(uint32_t expected_size);
-
- // Access to memory info using addresses as the key.
- RangeMap<uint64_t, unsigned int> *range_map_;
-
- MinidumpMemoryInfos* infos_;
- uint32_t info_count_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoList);
-};
-
-// MinidumpLinuxMaps wraps information about a single mapped memory region
-// from /proc/self/maps.
-class MinidumpLinuxMaps : public MinidumpObject {
- public:
- // The memory address of the base of the mapped region.
- uint64_t GetBase() const { return valid_ ? region_.start : 0; }
- // The size of the mapped region.
- uint64_t GetSize() const { return valid_ ? region_.end - region_.start : 0; }
-
- // The permissions of the mapped region.
- bool IsReadable() const {
- return valid_ ? region_.permissions & MappedMemoryRegion::READ : false;
- }
- bool IsWriteable() const {
- return valid_ ? region_.permissions & MappedMemoryRegion::WRITE : false;
- }
- bool IsExecutable() const {
- return valid_ ? region_.permissions & MappedMemoryRegion::EXECUTE : false;
- }
- bool IsPrivate() const {
- return valid_ ? region_.permissions & MappedMemoryRegion::PRIVATE : false;
- }
-
- // The offset of the mapped region.
- uint64_t GetOffset() const { return valid_ ? region_.offset : 0; }
-
- // The major device number.
- uint8_t GetMajorDevice() const { return valid_ ? region_.major_device : 0; }
- // The minor device number.
- uint8_t GetMinorDevice() const { return valid_ ? region_.minor_device : 0; }
-
- // The inode of the mapped region.
- uint64_t GetInode() const { return valid_ ? region_.inode : 0; }
-
- // The pathname of the mapped region.
- const string GetPathname() const { return valid_ ? region_.path : ""; }
-
- // Print the contents of this mapping.
- void Print() const;
-
- private:
- // These objects are managed by MinidumpLinuxMapsList.
- friend class MinidumpLinuxMapsList;
-
- // This caller owns the pointer.
- explicit MinidumpLinuxMaps(Minidump *minidump);
-
- // The memory region struct that this class wraps.
- MappedMemoryRegion region_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMaps);
-};
-
-// MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS
-// stream, which contains the contents of /prod/self/maps, which contains
-// the mapped memory regions and their access permissions.
-class MinidumpLinuxMapsList : public MinidumpStream {
- public:
- virtual ~MinidumpLinuxMapsList();
-
- // Get number of mappings.
- unsigned int get_maps_count() const { return valid_ ? maps_count_ : 0; }
-
- // Get mapping at the given memory address. The caller owns the pointer.
- const MinidumpLinuxMaps *GetLinuxMapsForAddress(uint64_t address) const;
- // Get mapping at the given index. The caller owns the pointer.
- const MinidumpLinuxMaps *GetLinuxMapsAtIndex(unsigned int index) const;
-
- // Print the contents of /proc/self/maps to stdout.
- void Print() const;
-
- private:
- friend class Minidump;
-
- typedef vector<MinidumpLinuxMaps *> MinidumpLinuxMappings;
-
- static const uint32_t kStreamType = MD_LINUX_MAPS;
-
- // The caller owns the pointer.
- explicit MinidumpLinuxMapsList(Minidump *minidump);
-
- // Read and load the contents of the process mapping data.
- // The stream should have data in the form of /proc/self/maps.
- // This method returns whether the stream was read successfully.
- bool Read(uint32_t expected_size);
-
- // The list of individual mappings.
- MinidumpLinuxMappings *maps_;
- // The number of mappings.
- uint32_t maps_count_;
-
- DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMapsList);
-};
-
-// Minidump is the user's interface to a minidump file. It wraps MDRawHeader
-// and provides access to the minidump's top-level stream directory.
-class Minidump {
- public:
- // path is the pathname of a file containing the minidump.
- explicit Minidump(const string& path);
- // input is an istream wrapping minidump data. Minidump holds a
- // weak pointer to input, and the caller must ensure that the stream
- // is valid as long as the Minidump object is.
- explicit Minidump(std::istream& input);
-
- virtual ~Minidump();
-
- // path may be empty if the minidump was not opened from a file
- virtual string path() const {
- return path_;
- }
- static void set_max_streams(uint32_t max_streams) {
- max_streams_ = max_streams;
- }
- static uint32_t max_streams() { return max_streams_; }
-
- static void set_max_string_length(uint32_t max_string_length) {
- max_string_length_ = max_string_length;
- }
- static uint32_t max_string_length() { return max_string_length_; }
-
- virtual const MDRawHeader* header() const { return valid_ ? &header_ : NULL; }
-
- // Reads the CPU information from the system info stream and generates the
- // appropriate CPU flags. The returned context_cpu_flags are the same as
- // if the CPU type bits were set in the context_flags of a context record.
- // On success, context_cpu_flags will have the flags that identify the CPU.
- // If a system info stream is missing, context_cpu_flags will be 0.
- // Returns true if the current position in the stream was not changed.
- // Returns false when the current location in the stream was changed and the
- // attempt to restore the original position failed.
- bool GetContextCPUFlagsFromSystemInfo(uint32_t* context_cpu_flags);
-
- // Reads the minidump file's header and top-level stream directory.
- // The minidump is expected to be positioned at the beginning of the
- // header. Read() sets up the stream list and map, and validates the
- // Minidump object.
- virtual bool Read();
-
- // The next set of methods are stubs that call GetStream. They exist to
- // force code generation of the templatized API within the module, and
- // to avoid exposing an ugly API (GetStream needs to accept a garbage
- // parameter).
- virtual MinidumpThreadList* GetThreadList();
- virtual MinidumpModuleList* GetModuleList();
- virtual MinidumpMemoryList* GetMemoryList();
- virtual MinidumpException* GetException();
- virtual MinidumpAssertion* GetAssertion();
- virtual MinidumpSystemInfo* GetSystemInfo();
- virtual MinidumpMiscInfo* GetMiscInfo();
- virtual MinidumpBreakpadInfo* GetBreakpadInfo();
- virtual MinidumpMemoryInfoList* GetMemoryInfoList();
-
- // The next method also calls GetStream, but is exclusive for Linux dumps.
- virtual MinidumpLinuxMapsList *GetLinuxMapsList();
-
- // The next set of methods are provided for users who wish to access
- // data in minidump files directly, while leveraging the rest of
- // this class and related classes to handle the basic minidump
- // structure and known stream types.
-
- unsigned int GetDirectoryEntryCount() const {
- return valid_ ? header_.stream_count : 0;
- }
- const MDRawDirectory* GetDirectoryEntryAtIndex(unsigned int index) const;
-
- // The next 2 methods are lower-level I/O routines. They use fd_.
-
- // Reads count bytes from the minidump at the current position into
- // the storage area pointed to by bytes. bytes must be of sufficient
- // size. After the read, the file position is advanced by count.
- bool ReadBytes(void* bytes, size_t count);
-
- // Sets the position of the minidump file to offset.
- bool SeekSet(off_t offset);
-
- // Returns the current position of the minidump file.
- off_t Tell();
-
- // The next 2 methods are medium-level I/O routines.
-
- // ReadString returns a string which is owned by the caller! offset
- // specifies the offset that a length-encoded string is stored at in the
- // minidump file.
- string* ReadString(off_t offset);
-
- // SeekToStreamType positions the file at the beginning of a stream
- // identified by stream_type, and informs the caller of the stream's
- // length by setting *stream_length. Because stream_map maps each stream
- // type to only one stream in the file, this might mislead the user into
- // thinking that the stream that this seeks to is the only stream with
- // type stream_type. That can't happen for streams that these classes
- // deal with directly, because they're only supposed to be present in the
- // file singly, and that's verified when stream_map_ is built. Users who
- // are looking for other stream types should be aware of this
- // possibility, and consider using GetDirectoryEntryAtIndex (possibly
- // with GetDirectoryEntryCount) if expecting multiple streams of the same
- // type in a single minidump file.
- bool SeekToStreamType(uint32_t stream_type, uint32_t* stream_length);
-
- bool swap() const { return valid_ ? swap_ : false; }
-
- // Print a human-readable representation of the object to stdout.
- void Print();
-
- // Is the OS Android.
- bool IsAndroid();
-
- private:
- // MinidumpStreamInfo is used in the MinidumpStreamMap. It lets
- // the Minidump object locate interesting streams quickly, and
- // provides a convenient place to stash MinidumpStream objects.
- struct MinidumpStreamInfo {
- MinidumpStreamInfo() : stream_index(0), stream(NULL) {}
- ~MinidumpStreamInfo() { delete stream; }
-
- // Index into the MinidumpDirectoryEntries vector
- unsigned int stream_index;
-
- // Pointer to the stream if cached, or NULL if not yet populated
- MinidumpStream* stream;
- };
-
- typedef vector<MDRawDirectory> MinidumpDirectoryEntries;
- typedef map<uint32_t, MinidumpStreamInfo> MinidumpStreamMap;
-
- template<typename T> T* GetStream(T** stream);
-
- // Opens the minidump file, or if already open, seeks to the beginning.
- bool Open();
-
- // The largest number of top-level streams that will be read from a minidump.
- // Note that streams are only read (and only consume memory) as needed,
- // when directed by the caller. The default is 128.
- static uint32_t max_streams_;
-
- // The maximum length of a UTF-16 string that will be read from a minidump
- // in 16-bit words. The default is 1024. UTF-16 strings are converted
- // to UTF-8 when stored in memory, and each UTF-16 word will be represented
- // by as many as 3 bytes in UTF-8.
- static unsigned int max_string_length_;
-
- MDRawHeader header_;
-
- // The list of streams.
- MinidumpDirectoryEntries* directory_;
-
- // Access to streams using the stream type as the key.
- MinidumpStreamMap* stream_map_;
-
- // The pathname of the minidump file to process, set in the constructor.
- // This may be empty if the minidump was opened directly from a stream.
- const string path_;
-
- // The stream for all file I/O. Used by ReadBytes and SeekSet.
- // Set based on the path in Open, or directly in the constructor.
- std::istream* stream_;
-
- // swap_ is true if the minidump file should be byte-swapped. If the
- // minidump was produced by a CPU that is other-endian than the CPU
- // processing the minidump, this will be true. If the two CPUs are
- // same-endian, this will be false.
- bool swap_;
-
- // Validity of the Minidump structure, false immediately after
- // construction or after a failed Read(); true following a successful
- // Read().
- bool valid_;
-
- DISALLOW_COPY_AND_ASSIGN(Minidump);
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump_processor.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump_processor.h
deleted file mode 100644
index 387115ef71..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/minidump_processor.h
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_PROCESSOR_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_PROCESSOR_H__
-
-#include <assert.h>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/process_result.h"
-
-namespace google_breakpad {
-
-class Minidump;
-class ProcessState;
-class StackFrameSymbolizer;
-class SourceLineResolverInterface;
-class SymbolSupplier;
-struct SystemInfo;
-
-class MinidumpProcessor {
- public:
- // Initializes this MinidumpProcessor. supplier should be an
- // implementation of the SymbolSupplier abstract base class.
- MinidumpProcessor(SymbolSupplier* supplier,
- SourceLineResolverInterface* resolver);
-
- // Initializes the MinidumpProcessor with the option of
- // enabling the exploitability framework to analyze dumps
- // for probable security relevance.
- MinidumpProcessor(SymbolSupplier* supplier,
- SourceLineResolverInterface* resolver,
- bool enable_exploitability);
-
- // Initializes the MinidumpProcessor with source line resolver helper, and
- // the option of enabling the exploitability framework to analyze dumps
- // for probable security relevance.
- // Does not take ownership of resolver_helper, which must NOT be NULL.
- MinidumpProcessor(StackFrameSymbolizer* stack_frame_symbolizer,
- bool enable_exploitability);
-
- ~MinidumpProcessor();
-
- // Processes the minidump file and fills process_state with the result.
- ProcessResult Process(const string &minidump_file,
- ProcessState* process_state);
-
- // Processes the minidump structure and fills process_state with the
- // result.
- ProcessResult Process(Minidump* minidump,
- ProcessState* process_state);
- // Populates the cpu_* fields of the |info| parameter with textual
- // representations of the CPU type that the minidump in |dump| was
- // produced on. Returns false if this information is not available in
- // the minidump.
- static bool GetCPUInfo(Minidump* dump, SystemInfo* info);
-
- // Populates the os_* fields of the |info| parameter with textual
- // representations of the operating system that the minidump in |dump|
- // was produced on. Returns false if this information is not available in
- // the minidump.
- static bool GetOSInfo(Minidump* dump, SystemInfo* info);
-
- // Populates the |process_create_time| parameter with the create time of the
- // crashed process. Returns false if this information is not available in
- // the minidump |dump|.
- static bool GetProcessCreateTime(Minidump* dump,
- uint32_t* process_create_time);
-
- // Returns a textual representation of the reason that a crash occurred,
- // if the minidump in dump was produced as a result of a crash. Returns
- // an empty string if this information cannot be determined. If address
- // is non-NULL, it will be set to contain the address that caused the
- // exception, if this information is available. This will be a code
- // address when the crash was caused by problems such as illegal
- // instructions or divisions by zero, or a data address when the crash
- // was caused by a memory access violation.
- static string GetCrashReason(Minidump* dump, uint64_t* address);
-
- // This function returns true if the passed-in error code is
- // something unrecoverable(i.e. retry should not happen). For
- // instance, if the minidump is corrupt, then it makes no sense to
- // retry as we won't be able to glean additional information.
- // However, as an example of the other case, the symbol supplier can
- // return an error code indicating it was 'interrupted', which can
- // happen of the symbols are fetched from a remote store, and a
- // retry might be successful later on.
- // You should not call this method with PROCESS_OK! Test for
- // that separately before calling this.
- static bool IsErrorUnrecoverable(ProcessResult p) {
- assert(p != PROCESS_OK);
- return (p != PROCESS_SYMBOL_SUPPLIER_INTERRUPTED);
- }
-
- // Returns a textual representation of an assertion included
- // in the minidump. Returns an empty string if this information
- // does not exist or cannot be determined.
- static string GetAssertion(Minidump* dump);
-
- void set_enable_objdump(bool enabled) { enable_objdump_ = enabled; }
-
- private:
- StackFrameSymbolizer* frame_symbolizer_;
- // Indicate whether resolver_helper_ is owned by this instance.
- bool own_frame_symbolizer_;
-
- // This flag enables the exploitability scanner which attempts to
- // guess how likely it is that the crash represents an exploitable
- // memory corruption issue.
- bool enable_exploitability_;
-
- // This flag permits the exploitability scanner to shell out to objdump
- // for purposes of disassembly.
- bool enable_objdump_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_MINIDUMP_PROCESSOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/proc_maps_linux.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/proc_maps_linux.h
deleted file mode 100644
index b8e6eb926a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/proc_maps_linux.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef BASE_DEBUG_PROC_MAPS_LINUX_H_
-#define BASE_DEBUG_PROC_MAPS_LINUX_H_
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-// Describes a region of mapped memory and the path of the file mapped.
-struct MappedMemoryRegion {
- enum Permission {
- READ = 1 << 0,
- WRITE = 1 << 1,
- EXECUTE = 1 << 2,
- PRIVATE = 1 << 3, // If set, region is private, otherwise it is shared.
- };
-
- // The address range [start,end) of mapped memory.
- uint64_t start;
- uint64_t end;
-
- // Byte offset into |path| of the range mapped into memory.
- uint64_t offset;
-
- // Bitmask of read/write/execute/private/shared permissions.
- uint8_t permissions;
-
- // Major and minor devices.
- uint8_t major_device;
- uint8_t minor_device;
-
- // Value of the inode.
- uint64_t inode;
-
- // Name of the file mapped into memory.
- //
- // NOTE: path names aren't guaranteed to point at valid files. For example,
- // "[heap]" and "[stack]" are used to represent the location of the process'
- // heap and stack, respectively.
- string path;
-
- // The line from /proc/<pid>/maps that this struct represents.
- string line;
-};
-
-// Parses /proc/<pid>/maps input data and stores in |regions|. Returns true
-// and updates |regions| if and only if all of |input| was successfully parsed.
-bool ParseProcMaps(const std::string& input,
- std::vector<MappedMemoryRegion>* regions);
-
-} // namespace google_breakpad
-
-#endif // BASE_DEBUG_PROC_MAPS_LINUX_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_result.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_result.h
deleted file mode 100644
index 15c7213e9b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_result.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_PROCESS_RESULT_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_PROCESS_RESULT_H__
-
-namespace google_breakpad {
-
-// Return type for MinidumpProcessor or MicrodumpProcessor's Process()
-enum ProcessResult {
- PROCESS_OK, // The dump was processed
- // successfully.
-
- PROCESS_ERROR_MINIDUMP_NOT_FOUND, // The minidump file was not
- // found.
-
- PROCESS_ERROR_NO_MINIDUMP_HEADER, // The minidump file had no
- // header.
-
- PROCESS_ERROR_NO_THREAD_LIST, // The minidump file has no
- // thread list.
-
- PROCESS_ERROR_GETTING_THREAD, // There was an error getting one
- // thread's data from th dump.
-
- PROCESS_ERROR_GETTING_THREAD_ID, // There was an error getting a
- // thread id from the thread's
- // data.
-
- PROCESS_ERROR_DUPLICATE_REQUESTING_THREADS, // There was more than one
- // requesting thread.
-
- PROCESS_SYMBOL_SUPPLIER_INTERRUPTED // The dump processing was
- // interrupted by the
- // SymbolSupplier(not fatal).
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_PROCESS_RESULT_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_state.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_state.h
deleted file mode 100644
index 9f12b0c699..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/process_state.h
+++ /dev/null
@@ -1,198 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// process_state.h: A snapshot of a process, in a fully-digested state.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_PROCESS_STATE_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_PROCESS_STATE_H__
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/linked_ptr.h"
-
-namespace google_breakpad {
-
-using std::vector;
-
-class CallStack;
-class CodeModules;
-
-enum ExploitabilityRating {
- EXPLOITABILITY_HIGH, // The crash likely represents
- // a exploitable memory corruption
- // vulnerability.
-
- EXPLOITABILITY_MEDIUM, // The crash appears to corrupt
- // memory in a way which may be
- // exploitable in some situations.
-
- EXPLOITABLITY_MEDIUM = EXPLOITABILITY_MEDIUM, // an old misspelling
-
- EXPLOITABILITY_LOW, // The crash either does not corrupt
- // memory directly or control over
- // the affected data is limited. The
- // issue may still be exploitable
- // on certain platforms or situations.
-
- EXPLOITABILITY_INTERESTING, // The crash does not appear to be
- // directly exploitable. However it
- // represents a condition which should
- // be further analyzed.
-
- EXPLOITABILITY_NONE, // The crash does not appear to represent
- // an exploitable condition.
-
- EXPLOITABILITY_NOT_ANALYZED, // The crash was not analyzed for
- // exploitability because the engine
- // was disabled.
-
- EXPLOITABILITY_ERR_NOENGINE, // The supplied minidump's platform does
- // not have a exploitability engine
- // associated with it.
-
- EXPLOITABILITY_ERR_PROCESSING // An error occured within the
- // exploitability engine and no rating
- // was calculated.
-};
-
-class ProcessState {
- public:
- ProcessState() : modules_(NULL) { Clear(); }
- ~ProcessState();
-
- // Resets the ProcessState to its default values
- void Clear();
-
- // Accessors. See the data declarations below.
- uint32_t time_date_stamp() const { return time_date_stamp_; }
- uint32_t process_create_time() const { return process_create_time_; }
- bool crashed() const { return crashed_; }
- string crash_reason() const { return crash_reason_; }
- uint64_t crash_address() const { return crash_address_; }
- string assertion() const { return assertion_; }
- int requesting_thread() const { return requesting_thread_; }
- const vector<CallStack*>* threads() const { return &threads_; }
- const vector<MemoryRegion*>* thread_memory_regions() const {
- return &thread_memory_regions_;
- }
- const SystemInfo* system_info() const { return &system_info_; }
- const CodeModules* modules() const { return modules_; }
- const vector<linked_ptr<const CodeModule> >* shrunk_range_modules() const {
- return &shrunk_range_modules_;
- }
- const vector<const CodeModule*>* modules_without_symbols() const {
- return &modules_without_symbols_;
- }
- const vector<const CodeModule*>* modules_with_corrupt_symbols() const {
- return &modules_with_corrupt_symbols_;
- }
- ExploitabilityRating exploitability() const { return exploitability_; }
-
- private:
- // MinidumpProcessor and MicrodumpProcessor are responsible for building
- // ProcessState objects.
- friend class MinidumpProcessor;
- friend class MicrodumpProcessor;
-
- // The time-date stamp of the minidump (time_t format)
- uint32_t time_date_stamp_;
-
- // The time-date stamp when the process was created (time_t format)
- uint32_t process_create_time_;
-
- // True if the process crashed, false if the dump was produced outside
- // of an exception handler.
- bool crashed_;
-
- // If the process crashed, the type of crash. OS- and possibly CPU-
- // specific. For example, "EXCEPTION_ACCESS_VIOLATION" (Windows),
- // "EXC_BAD_ACCESS / KERN_INVALID_ADDRESS" (Mac OS X), "SIGSEGV"
- // (other Unix).
- string crash_reason_;
-
- // If the process crashed, and if crash_reason implicates memory,
- // the memory address that caused the crash. For data access errors,
- // this will be the data address that caused the fault. For code errors,
- // this will be the address of the instruction that caused the fault.
- uint64_t crash_address_;
-
- // If there was an assertion that was hit, a textual representation
- // of that assertion, possibly including the file and line at which
- // it occurred.
- string assertion_;
-
- // The index of the thread that requested a dump be written in the
- // threads vector. If a dump was produced as a result of a crash, this
- // will point to the thread that crashed. If the dump was produced as
- // by user code without crashing, and the dump contains extended Breakpad
- // information, this will point to the thread that requested the dump.
- // If the dump was not produced as a result of an exception and no
- // extended Breakpad information is present, this field will be set to -1,
- // indicating that the dump thread is not available.
- int requesting_thread_;
-
- // Stacks for each thread (except possibly the exception handler
- // thread) at the time of the crash.
- vector<CallStack*> threads_;
- vector<MemoryRegion*> thread_memory_regions_;
-
- // OS and CPU information.
- SystemInfo system_info_;
-
- // The modules that were loaded into the process represented by the
- // ProcessState.
- const CodeModules *modules_;
-
- // The modules which virtual address ranges were shrunk down due to
- // virtual address conflicts.
- vector<linked_ptr<const CodeModule> > shrunk_range_modules_;
-
- // The modules that didn't have symbols when the report was processed.
- vector<const CodeModule*> modules_without_symbols_;
-
- // The modules that had corrupt symbols when the report was processed.
- vector<const CodeModule*> modules_with_corrupt_symbols_;
-
- // The exploitability rating as determined by the exploitability
- // engine. When the exploitability engine is not enabled this
- // defaults to EXPLOITABILITY_NOT_ANALYZED.
- ExploitabilityRating exploitability_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_PROCESS_STATE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_base.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_base.h
deleted file mode 100644
index c720b0c325..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_base.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// source_line_resolver_base.h: SourceLineResolverBase, an (incomplete)
-// implementation of SourceLineResolverInterface. It serves as a common base
-// class for concrete implementations: FastSourceLineResolver and
-// BasicSourceLineResolver. It is designed for refactoring that removes
-// code redundancy in the two concrete source line resolver classes.
-//
-// See "google_breakpad/processor/source_line_resolver_interface.h" for more
-// documentation.
-
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__
-
-#include <map>
-#include <set>
-#include <string>
-
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-
-namespace google_breakpad {
-
-using std::map;
-using std::set;
-
-// Forward declaration.
-// ModuleFactory is a simple factory interface for creating a Module instance
-// at run-time.
-class ModuleFactory;
-
-class SourceLineResolverBase : public SourceLineResolverInterface {
- public:
- // Read the symbol_data from a file with given file_name.
- // The part of code was originally in BasicSourceLineResolver::Module's
- // LoadMap() method.
- // Place dynamically allocated heap buffer in symbol_data. Caller has the
- // ownership of the buffer, and should call delete [] to free the buffer.
- static bool ReadSymbolFile(const string &file_name,
- char **symbol_data,
- size_t *symbol_data_size);
-
- protected:
- // Users are not allowed create SourceLineResolverBase instance directly.
- SourceLineResolverBase(ModuleFactory *module_factory);
- virtual ~SourceLineResolverBase();
-
- // Virtual methods inherited from SourceLineResolverInterface.
- virtual bool LoadModule(const CodeModule *module, const string &map_file);
- virtual bool LoadModuleUsingMapBuffer(const CodeModule *module,
- const string &map_buffer);
- virtual bool LoadModuleUsingMemoryBuffer(const CodeModule *module,
- char *memory_buffer,
- size_t memory_buffer_size);
- virtual bool ShouldDeleteMemoryBufferAfterLoadModule();
- virtual void UnloadModule(const CodeModule *module);
- virtual bool HasModule(const CodeModule *module);
- virtual bool IsModuleCorrupt(const CodeModule *module);
- virtual void FillSourceLineInfo(StackFrame *frame);
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame);
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame);
-
- // Nested structs and classes.
- struct Line;
- struct Function;
- struct PublicSymbol;
- struct CompareString {
- bool operator()(const string &s1, const string &s2) const;
- };
- // Module is an interface for an in-memory symbol file.
- class Module;
- class AutoFileCloser;
-
- // All of the modules that are loaded.
- typedef map<string, Module*, CompareString> ModuleMap;
- ModuleMap *modules_;
-
- // The loaded modules that were detecting to be corrupt during load.
- typedef set<string, CompareString> ModuleSet;
- ModuleSet *corrupt_modules_;
-
- // All of heap-allocated buffers that are owned locally by resolver.
- typedef std::map<string, char*, CompareString> MemoryMap;
- MemoryMap *memory_buffers_;
-
- // Creates a concrete module at run-time.
- ModuleFactory *module_factory_;
-
- private:
- // ModuleFactory needs to have access to protected type Module.
- friend class ModuleFactory;
-
- // Disallow unwanted copy ctor and assignment operator
- SourceLineResolverBase(const SourceLineResolverBase&);
- void operator=(const SourceLineResolverBase&);
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_BASE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_interface.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_interface.h
deleted file mode 100644
index a694bf2ea1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/source_line_resolver_interface.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Abstract interface to return function/file/line info for a memory address.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/code_module.h"
-
-namespace google_breakpad {
-
-struct StackFrame;
-struct WindowsFrameInfo;
-class CFIFrameInfo;
-
-class SourceLineResolverInterface {
- public:
- typedef uint64_t MemAddr;
-
- virtual ~SourceLineResolverInterface() {}
-
- // Adds a module to this resolver, returning true on success.
- //
- // module should have at least the code_file, debug_file,
- // and debug_identifier members populated.
- //
- // map_file should contain line/address mappings for this module.
- virtual bool LoadModule(const CodeModule *module,
- const string &map_file) = 0;
- // Same as above, but takes the contents of a pre-read map buffer
- virtual bool LoadModuleUsingMapBuffer(const CodeModule *module,
- const string &map_buffer) = 0;
-
- // Add an interface to load symbol using C-String data instead of string.
- // This is useful in the optimization design for avoiding unnecessary copying
- // of symbol data, in order to improve memory efficiency.
- // LoadModuleUsingMemoryBuffer() does NOT take ownership of memory_buffer.
- // LoadModuleUsingMemoryBuffer() null terminates the passed in buffer, if
- // the last character is not a null terminator.
- virtual bool LoadModuleUsingMemoryBuffer(const CodeModule *module,
- char *memory_buffer,
- size_t memory_buffer_size) = 0;
-
- // Return true if the memory buffer should be deleted immediately after
- // LoadModuleUsingMemoryBuffer(). Return false if the memory buffer has to be
- // alive during the lifetime of the corresponding Module.
- virtual bool ShouldDeleteMemoryBufferAfterLoadModule() = 0;
-
- // Request that the specified module be unloaded from this resolver.
- // A resolver may choose to ignore such a request.
- virtual void UnloadModule(const CodeModule *module) = 0;
-
- // Returns true if the module has been loaded.
- virtual bool HasModule(const CodeModule *module) = 0;
-
- // Returns true if the module has been loaded and it is corrupt.
- virtual bool IsModuleCorrupt(const CodeModule *module) = 0;
-
- // Fills in the function_base, function_name, source_file_name,
- // and source_line fields of the StackFrame. The instruction and
- // module_name fields must already be filled in.
- virtual void FillSourceLineInfo(StackFrame *frame) = 0;
-
- // If Windows stack walking information is available covering
- // FRAME's instruction address, return a WindowsFrameInfo structure
- // describing it. If the information is not available, returns NULL.
- // A NULL return value does not indicate an error. The caller takes
- // ownership of any returned WindowsFrameInfo object.
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) = 0;
-
- // If CFI stack walking information is available covering ADDRESS,
- // return a CFIFrameInfo structure describing it. If the information
- // is not available, return NULL. The caller takes ownership of any
- // returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) = 0;
-
- protected:
- // SourceLineResolverInterface cannot be instantiated except by subclasses
- SourceLineResolverInterface() {}
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_SOURCE_LINE_RESOLVER_INTERFACE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame.h
deleted file mode 100644
index b55eb9c756..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame.h
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-class CodeModule;
-
-struct StackFrame {
- // Indicates how well the instruction pointer derived during
- // stack walking is trusted. Since the stack walker can resort to
- // stack scanning, it can wind up with dubious frames.
- // In rough order of "trust metric".
- enum FrameTrust {
- FRAME_TRUST_NONE, // Unknown
- FRAME_TRUST_SCAN, // Scanned the stack, found this
- FRAME_TRUST_CFI_SCAN, // Found while scanning stack using call frame info
- FRAME_TRUST_FP, // Derived from frame pointer
- FRAME_TRUST_CFI, // Derived from call frame info
- FRAME_TRUST_PREWALKED, // Explicitly provided by some external stack walker.
- FRAME_TRUST_CONTEXT // Given as instruction pointer in a context
- };
-
- StackFrame()
- : instruction(),
- module(NULL),
- function_name(),
- function_base(),
- source_file_name(),
- source_line(),
- source_line_base(),
- trust(FRAME_TRUST_NONE) {}
- virtual ~StackFrame() {}
-
- // Return a string describing how this stack frame was found
- // by the stackwalker.
- string trust_description() const {
- switch (trust) {
- case StackFrame::FRAME_TRUST_CONTEXT:
- return "given as instruction pointer in context";
- case StackFrame::FRAME_TRUST_PREWALKED:
- return "recovered by external stack walker";
- case StackFrame::FRAME_TRUST_CFI:
- return "call frame info";
- case StackFrame::FRAME_TRUST_CFI_SCAN:
- return "call frame info with scanning";
- case StackFrame::FRAME_TRUST_FP:
- return "previous frame's frame pointer";
- case StackFrame::FRAME_TRUST_SCAN:
- return "stack scanning";
- default:
- return "unknown";
- }
- };
-
- // Return the actual return address, as saved on the stack or in a
- // register. See the comments for 'instruction', below, for details.
- virtual uint64_t ReturnAddress() const { return instruction; }
-
- // The program counter location as an absolute virtual address.
- //
- // - For the innermost called frame in a stack, this will be an exact
- // program counter or instruction pointer value.
- //
- // - For all other frames, this address is within the instruction that
- // caused execution to branch to this frame's callee (although it may
- // not point to the exact beginning of that instruction). This ensures
- // that, when we look up the source code location for this frame, we
- // get the source location of the call, not of the point at which
- // control will resume when the call returns, which may be on the next
- // line. (If the compiler knows the callee never returns, it may even
- // place the call instruction at the very end of the caller's machine
- // code, such that the "return address" (which will never be used)
- // immediately after the call instruction is in an entirely different
- // function, perhaps even from a different source file.)
- //
- // On some architectures, the return address as saved on the stack or in
- // a register is fine for looking up the point of the call. On others, it
- // requires adjustment. ReturnAddress returns the address as saved by the
- // machine.
- uint64_t instruction;
-
- // The module in which the instruction resides.
- const CodeModule *module;
-
- // The function name, may be omitted if debug symbols are not available.
- string function_name;
-
- // The start address of the function, may be omitted if debug symbols
- // are not available.
- uint64_t function_base;
-
- // The source file name, may be omitted if debug symbols are not available.
- string source_file_name;
-
- // The (1-based) source line number, may be omitted if debug symbols are
- // not available.
- int source_line;
-
- // The start address of the source line, may be omitted if debug symbols
- // are not available.
- uint64_t source_line_base;
-
- // Amount of trust the stack walker has in the instruction pointer
- // of this frame.
- FrameTrust trust;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_cpu.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_cpu.h
deleted file mode 100644
index dc5d8ae673..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_cpu.h
+++ /dev/null
@@ -1,405 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stack_frame_cpu.h: CPU-specific StackFrame extensions.
-//
-// These types extend the StackFrame structure to carry CPU-specific register
-// state. They are defined in this header instead of stack_frame.h to
-// avoid the need to include minidump_format.h when only the generic
-// StackFrame type is needed.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_CPU_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_CPU_H__
-
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stack_frame.h"
-
-namespace google_breakpad {
-
-struct WindowsFrameInfo;
-class CFIFrameInfo;
-
-struct StackFrameX86 : public StackFrame {
- // ContextValidity has one entry for each relevant hardware pointer
- // register (%eip and %esp) and one entry for each general-purpose
- // register. It's worthwhile having validity flags for caller-saves
- // registers: they are valid in the youngest frame, and such a frame
- // might save a callee-saves register in a caller-saves register, but
- // SimpleCFIWalker won't touch registers unless they're marked as valid.
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_EIP = 1 << 0,
- CONTEXT_VALID_ESP = 1 << 1,
- CONTEXT_VALID_EBP = 1 << 2,
- CONTEXT_VALID_EAX = 1 << 3,
- CONTEXT_VALID_EBX = 1 << 4,
- CONTEXT_VALID_ECX = 1 << 5,
- CONTEXT_VALID_EDX = 1 << 6,
- CONTEXT_VALID_ESI = 1 << 7,
- CONTEXT_VALID_EDI = 1 << 8,
- CONTEXT_VALID_ALL = -1
- };
-
- StackFrameX86()
- : context(),
- context_validity(CONTEXT_VALID_NONE),
- windows_frame_info(NULL),
- cfi_frame_info(NULL) {}
- ~StackFrameX86();
-
- // Overriden to return the return address as saved on the stack.
- virtual uint64_t ReturnAddress() const;
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, the values of nonvolatile registers may be
- // present, given sufficient debugging information. Refer to
- // context_validity.
- MDRawContextX86 context;
-
- // context_validity is actually ContextValidity, but int is used because
- // the OR operator doesn't work well with enumerated types. This indicates
- // which fields in context are valid.
- int context_validity;
-
- // Any stack walking information we found describing this.instruction.
- // These may be NULL if there is no such information for that address.
- WindowsFrameInfo *windows_frame_info;
- CFIFrameInfo *cfi_frame_info;
-};
-
-struct StackFramePPC : public StackFrame {
- // ContextValidity should eventually contain entries for the validity of
- // other nonvolatile (callee-save) registers as in
- // StackFrameX86::ContextValidity, but the ppc stackwalker doesn't currently
- // locate registers other than the ones listed here.
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_SRR0 = 1 << 0,
- CONTEXT_VALID_GPR1 = 1 << 1,
- CONTEXT_VALID_ALL = -1
- };
-
- StackFramePPC() : context(), context_validity(CONTEXT_VALID_NONE) {}
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, the values of nonvolatile registers may be
- // present, given sufficient debugging information. Refer to
- // context_validity.
- MDRawContextPPC context;
-
- // context_validity is actually ContextValidity, but int is used because
- // the OR operator doesn't work well with enumerated types. This indicates
- // which fields in context are valid.
- int context_validity;
-};
-
-struct StackFramePPC64 : public StackFrame {
- // ContextValidity should eventually contain entries for the validity of
- // other nonvolatile (callee-save) registers as in
- // StackFrameX86::ContextValidity, but the ppc stackwalker doesn't currently
- // locate registers other than the ones listed here.
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_SRR0 = 1 << 0,
- CONTEXT_VALID_GPR1 = 1 << 1,
- CONTEXT_VALID_ALL = -1
- };
-
- StackFramePPC64() : context(), context_validity(CONTEXT_VALID_NONE) {}
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, the values of nonvolatile registers may be
- // present, given sufficient debugging information. Refer to
- // context_validity.
- MDRawContextPPC64 context;
-
- // context_validity is actually ContextValidity, but int is used because
- // the OR operator doesn't work well with enumerated types. This indicates
- // which fields in context are valid.
- int context_validity;
-};
-
-struct StackFrameAMD64 : public StackFrame {
- // ContextValidity has one entry for each register that we might be able
- // to recover.
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_RAX = 1 << 0,
- CONTEXT_VALID_RDX = 1 << 1,
- CONTEXT_VALID_RCX = 1 << 2,
- CONTEXT_VALID_RBX = 1 << 3,
- CONTEXT_VALID_RSI = 1 << 4,
- CONTEXT_VALID_RDI = 1 << 5,
- CONTEXT_VALID_RBP = 1 << 6,
- CONTEXT_VALID_RSP = 1 << 7,
- CONTEXT_VALID_R8 = 1 << 8,
- CONTEXT_VALID_R9 = 1 << 9,
- CONTEXT_VALID_R10 = 1 << 10,
- CONTEXT_VALID_R11 = 1 << 11,
- CONTEXT_VALID_R12 = 1 << 12,
- CONTEXT_VALID_R13 = 1 << 13,
- CONTEXT_VALID_R14 = 1 << 14,
- CONTEXT_VALID_R15 = 1 << 15,
- CONTEXT_VALID_RIP = 1 << 16,
- CONTEXT_VALID_ALL = -1
- };
-
- StackFrameAMD64() : context(), context_validity(CONTEXT_VALID_NONE) {}
-
- // Overriden to return the return address as saved on the stack.
- virtual uint64_t ReturnAddress() const;
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, which registers are present depends on what
- // debugging information we had available. Refer to context_validity.
- MDRawContextAMD64 context;
-
- // For each register in context whose value has been recovered, we set
- // the corresponding CONTEXT_VALID_ bit in context_validity.
- //
- // context_validity's type should actually be ContextValidity, but
- // we use int instead because the bitwise inclusive or operator
- // yields an int when applied to enum values, and C++ doesn't
- // silently convert from ints to enums.
- int context_validity;
-};
-
-struct StackFrameSPARC : public StackFrame {
- // to be confirmed
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_PC = 1 << 0,
- CONTEXT_VALID_SP = 1 << 1,
- CONTEXT_VALID_FP = 1 << 2,
- CONTEXT_VALID_ALL = -1
- };
-
- StackFrameSPARC() : context(), context_validity(CONTEXT_VALID_NONE) {}
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, the values of nonvolatile registers may be
- // present, given sufficient debugging information. Refer to
- // context_validity.
- MDRawContextSPARC context;
-
- // context_validity is actually ContextValidity, but int is used because
- // the OR operator doesn't work well with enumerated types. This indicates
- // which fields in context are valid.
- int context_validity;
-};
-
-struct StackFrameARM : public StackFrame {
- // A flag for each register we might know.
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_R0 = 1 << 0,
- CONTEXT_VALID_R1 = 1 << 1,
- CONTEXT_VALID_R2 = 1 << 2,
- CONTEXT_VALID_R3 = 1 << 3,
- CONTEXT_VALID_R4 = 1 << 4,
- CONTEXT_VALID_R5 = 1 << 5,
- CONTEXT_VALID_R6 = 1 << 6,
- CONTEXT_VALID_R7 = 1 << 7,
- CONTEXT_VALID_R8 = 1 << 8,
- CONTEXT_VALID_R9 = 1 << 9,
- CONTEXT_VALID_R10 = 1 << 10,
- CONTEXT_VALID_R11 = 1 << 11,
- CONTEXT_VALID_R12 = 1 << 12,
- CONTEXT_VALID_R13 = 1 << 13,
- CONTEXT_VALID_R14 = 1 << 14,
- CONTEXT_VALID_R15 = 1 << 15,
- CONTEXT_VALID_ALL = ~CONTEXT_VALID_NONE,
-
- // Aliases for registers with dedicated or conventional roles.
- CONTEXT_VALID_FP = CONTEXT_VALID_R11,
- CONTEXT_VALID_SP = CONTEXT_VALID_R13,
- CONTEXT_VALID_LR = CONTEXT_VALID_R14,
- CONTEXT_VALID_PC = CONTEXT_VALID_R15
- };
-
- StackFrameARM() : context(), context_validity(CONTEXT_VALID_NONE) {}
-
- // Return the ContextValidity flag for register rN.
- static ContextValidity RegisterValidFlag(int n) {
- return ContextValidity(1 << n);
- }
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, the values of nonvolatile registers may be
- // present, given sufficient debugging information. Refer to
- // context_validity.
- MDRawContextARM context;
-
- // For each register in context whose value has been recovered, we set
- // the corresponding CONTEXT_VALID_ bit in context_validity.
- //
- // context_validity's type should actually be ContextValidity, but
- // we use int instead because the bitwise inclusive or operator
- // yields an int when applied to enum values, and C++ doesn't
- // silently convert from ints to enums.
- int context_validity;
-};
-
-struct StackFrameARM64 : public StackFrame {
- // A flag for each register we might know. Note that we can't use an enum
- // here as there are 33 values to represent.
- static const uint64_t CONTEXT_VALID_NONE = 0;
- static const uint64_t CONTEXT_VALID_X0 = 1ULL << 0;
- static const uint64_t CONTEXT_VALID_X1 = 1ULL << 1;
- static const uint64_t CONTEXT_VALID_X2 = 1ULL << 2;
- static const uint64_t CONTEXT_VALID_X3 = 1ULL << 3;
- static const uint64_t CONTEXT_VALID_X4 = 1ULL << 4;
- static const uint64_t CONTEXT_VALID_X5 = 1ULL << 5;
- static const uint64_t CONTEXT_VALID_X6 = 1ULL << 6;
- static const uint64_t CONTEXT_VALID_X7 = 1ULL << 7;
- static const uint64_t CONTEXT_VALID_X8 = 1ULL << 8;
- static const uint64_t CONTEXT_VALID_X9 = 1ULL << 9;
- static const uint64_t CONTEXT_VALID_X10 = 1ULL << 10;
- static const uint64_t CONTEXT_VALID_X11 = 1ULL << 11;
- static const uint64_t CONTEXT_VALID_X12 = 1ULL << 12;
- static const uint64_t CONTEXT_VALID_X13 = 1ULL << 13;
- static const uint64_t CONTEXT_VALID_X14 = 1ULL << 14;
- static const uint64_t CONTEXT_VALID_X15 = 1ULL << 15;
- static const uint64_t CONTEXT_VALID_X16 = 1ULL << 16;
- static const uint64_t CONTEXT_VALID_X17 = 1ULL << 17;
- static const uint64_t CONTEXT_VALID_X18 = 1ULL << 18;
- static const uint64_t CONTEXT_VALID_X19 = 1ULL << 19;
- static const uint64_t CONTEXT_VALID_X20 = 1ULL << 20;
- static const uint64_t CONTEXT_VALID_X21 = 1ULL << 21;
- static const uint64_t CONTEXT_VALID_X22 = 1ULL << 22;
- static const uint64_t CONTEXT_VALID_X23 = 1ULL << 23;
- static const uint64_t CONTEXT_VALID_X24 = 1ULL << 24;
- static const uint64_t CONTEXT_VALID_X25 = 1ULL << 25;
- static const uint64_t CONTEXT_VALID_X26 = 1ULL << 26;
- static const uint64_t CONTEXT_VALID_X27 = 1ULL << 27;
- static const uint64_t CONTEXT_VALID_X28 = 1ULL << 28;
- static const uint64_t CONTEXT_VALID_X29 = 1ULL << 29;
- static const uint64_t CONTEXT_VALID_X30 = 1ULL << 30;
- static const uint64_t CONTEXT_VALID_X31 = 1ULL << 31;
- static const uint64_t CONTEXT_VALID_X32 = 1ULL << 32;
- static const uint64_t CONTEXT_VALID_ALL = ~CONTEXT_VALID_NONE;
-
- // Aliases for registers with dedicated or conventional roles.
- static const uint64_t CONTEXT_VALID_FP = CONTEXT_VALID_X29;
- static const uint64_t CONTEXT_VALID_LR = CONTEXT_VALID_X30;
- static const uint64_t CONTEXT_VALID_SP = CONTEXT_VALID_X31;
- static const uint64_t CONTEXT_VALID_PC = CONTEXT_VALID_X32;
-
- StackFrameARM64() : context(),
- context_validity(CONTEXT_VALID_NONE) {}
-
- // Return the validity flag for register xN.
- static uint64_t RegisterValidFlag(int n) {
- return 1ULL << n;
- }
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, the values of nonvolatile registers may be
- // present, given sufficient debugging information. Refer to
- // context_validity.
- MDRawContextARM64 context;
-
- // For each register in context whose value has been recovered, we set
- // the corresponding CONTEXT_VALID_ bit in context_validity.
- uint64_t context_validity;
-};
-
-struct StackFrameMIPS : public StackFrame {
- // MIPS callee save registers for o32 ABI (32bit registers) are:
- // 1. $s0-$s7,
- // 2. $sp, $fp
- // 3. $f20-$f31
- //
- // The register structure is available at
- // http://en.wikipedia.org/wiki/MIPS_architecture#Compiler_register_usage
-
-#define INDEX_MIPS_REG_S0 MD_CONTEXT_MIPS_REG_S0 // 16
-#define INDEX_MIPS_REG_S7 MD_CONTEXT_MIPS_REG_S7 // 23
-#define INDEX_MIPS_REG_GP MD_CONTEXT_MIPS_REG_GP // 28
-#define INDEX_MIPS_REG_RA MD_CONTEXT_MIPS_REG_RA // 31
-#define INDEX_MIPS_REG_PC 34
-#define SHIFT_MIPS_REG_S0 0
-#define SHIFT_MIPS_REG_GP 8
-#define SHIFT_MIPS_REG_PC 12
-
- enum ContextValidity {
- CONTEXT_VALID_NONE = 0,
- CONTEXT_VALID_S0 = 1 << 0, // $16
- CONTEXT_VALID_S1 = 1 << 1, // $17
- CONTEXT_VALID_S2 = 1 << 2, // $18
- CONTEXT_VALID_S3 = 1 << 3, // $19
- CONTEXT_VALID_S4 = 1 << 4, // $20
- CONTEXT_VALID_S5 = 1 << 5, // $21
- CONTEXT_VALID_S6 = 1 << 6, // $22
- CONTEXT_VALID_S7 = 1 << 7, // $23
- // GP is not calee-save for o32 abi.
- CONTEXT_VALID_GP = 1 << 8, // $28
- CONTEXT_VALID_SP = 1 << 9, // $29
- CONTEXT_VALID_FP = 1 << 10, // $30
- CONTEXT_VALID_RA = 1 << 11, // $31
- CONTEXT_VALID_PC = 1 << 12, // $34
- CONTEXT_VALID_ALL = ~CONTEXT_VALID_NONE
- };
-
- // Return the ContextValidity flag for register rN.
- static ContextValidity RegisterValidFlag(int n) {
- if (n >= INDEX_MIPS_REG_S0 && n <= INDEX_MIPS_REG_S7)
- return ContextValidity(1 << (n - INDEX_MIPS_REG_S0 + SHIFT_MIPS_REG_S0));
- else if (n >= INDEX_MIPS_REG_GP && n <= INDEX_MIPS_REG_RA)
- return ContextValidity(1 << (n - INDEX_MIPS_REG_GP + SHIFT_MIPS_REG_GP));
- else if (n == INDEX_MIPS_REG_PC)
- return ContextValidity(1 << SHIFT_MIPS_REG_PC);
-
- return CONTEXT_VALID_NONE;
- }
-
- StackFrameMIPS() : context(), context_validity(CONTEXT_VALID_NONE) {}
-
- // Register state. This is only fully valid for the topmost frame in a
- // stack. In other frames, which registers are present depends on what
- // debugging information were available. Refer to 'context_validity' below.
- MDRawContextMIPS context;
-
- // For each register in context whose value has been recovered,
- // the corresponding CONTEXT_VALID_ bit in 'context_validity' is set.
- //
- // context_validity's type should actually be ContextValidity, but
- // type int is used instead because the bitwise inclusive or operator
- // yields an int when applied to enum values, and C++ doesn't
- // silently convert from ints to enums.
- int context_validity;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_CPU_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_symbolizer.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_symbolizer.h
deleted file mode 100644
index 074907cb14..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stack_frame_symbolizer.h
+++ /dev/null
@@ -1,108 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2012 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Helper class that encapsulates the logic of how symbol supplier interacts
-// with source line resolver to fill stack frame information.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__
-
-#include <set>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/code_module.h"
-
-namespace google_breakpad {
-class CFIFrameInfo;
-class CodeModules;
-class SymbolSupplier;
-class SourceLineResolverInterface;
-struct StackFrame;
-struct SystemInfo;
-struct WindowsFrameInfo;
-
-class StackFrameSymbolizer {
- public:
- enum SymbolizerResult {
- // Symbol data was found and successfully loaded in resolver.
- // This does NOT guarantee source line info is found within symbol file.
- kNoError,
- // This indicates non-critical error, such as, no code module found for
- // frame's instruction, no symbol file, or resolver failed to load symbol.
- kError,
- // This indicates error for which stack walk should be interrupted
- // and retried in future.
- kInterrupt,
- // Symbol data was found and loaded in resolver however some corruptions
- // were detected.
- kWarningCorruptSymbols,
- };
-
- StackFrameSymbolizer(SymbolSupplier* supplier,
- SourceLineResolverInterface* resolver);
-
- virtual ~StackFrameSymbolizer() { }
-
- // Encapsulate the step of resolving source line info for a stack frame.
- // "frame" must not be NULL.
- virtual SymbolizerResult FillSourceLineInfo(const CodeModules* modules,
- const SystemInfo* system_info,
- StackFrame* stack_frame);
-
- virtual WindowsFrameInfo* FindWindowsFrameInfo(const StackFrame* frame);
-
- virtual CFIFrameInfo* FindCFIFrameInfo(const StackFrame* frame);
-
- // Reset internal (locally owned) data as if the helper is re-instantiated.
- // A typical case is to call Reset() after processing an individual report
- // before start to process next one, in order to reset internal information
- // about missing symbols found so far.
- virtual void Reset() { no_symbol_modules_.clear(); }
-
- // Returns true if there is valid implementation for stack symbolization.
- virtual bool HasImplementation() { return resolver_ && supplier_; }
-
- SourceLineResolverInterface* resolver() { return resolver_; }
- SymbolSupplier* supplier() { return supplier_; }
-
- protected:
- SymbolSupplier* supplier_;
- SourceLineResolverInterface* resolver_;
- // A list of modules known to have symbols missing. This helps avoid
- // repeated lookups for the missing symbols within one minidump.
- std::set<string> no_symbol_modules_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_STACK_FRAME_SYMBOLIZER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stackwalker.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stackwalker.h
deleted file mode 100644
index a1bd3e7fe8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/stackwalker.h
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker.h: Generic stackwalker.
-//
-// The Stackwalker class is an abstract base class providing common generic
-// methods that apply to stacks from all systems. Specific implementations
-// will extend this class by providing GetContextFrame and GetCallerFrame
-// methods to fill in system-specific data in a StackFrame structure.
-// Stackwalker assembles these StackFrame strucutres into a CallStack.
-//
-// Author: Mark Mentovai
-
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_STACKWALKER_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_STACKWALKER_H__
-
-#include <set>
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-
-namespace google_breakpad {
-
-class CallStack;
-class DumpContext;
-class StackFrameSymbolizer;
-
-using std::set;
-using std::vector;
-
-class Stackwalker {
- public:
- virtual ~Stackwalker() {}
-
- // Populates the given CallStack by calling GetContextFrame and
- // GetCallerFrame. The frames are further processed to fill all available
- // data. Returns true if the stackwalk completed, or false if it was
- // interrupted by SymbolSupplier::GetSymbolFile().
- // Upon return, |modules_without_symbols| will be populated with pointers to
- // the code modules (CodeModule*) that DON'T have symbols.
- // |modules_with_corrupt_symbols| will be populated with pointers to the
- // modules which have corrupt symbols. |modules_without_symbols| and
- // |modules_with_corrupt_symbols| DO NOT take ownership of the code modules.
- // The lifetime of these code modules is the same as the lifetime of the
- // CodeModules passed to the StackWalker constructor (which currently
- // happens to be the lifetime of the Breakpad's ProcessingState object).
- // There is a check for duplicate modules so no duplicates are expected.
- bool Walk(CallStack* stack,
- vector<const CodeModule*>* modules_without_symbols,
- vector<const CodeModule*>* modules_with_corrupt_symbols);
-
- // Returns a new concrete subclass suitable for the CPU that a stack was
- // generated on, according to the CPU type indicated by the context
- // argument. If no suitable concrete subclass exists, returns NULL.
- static Stackwalker* StackwalkerForCPU(
- const SystemInfo* system_info,
- DumpContext* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper);
-
- static void set_max_frames(uint32_t max_frames) {
- max_frames_ = max_frames;
- max_frames_set_ = true;
- }
- static uint32_t max_frames() { return max_frames_; }
-
- static void set_max_frames_scanned(uint32_t max_frames_scanned) {
- max_frames_scanned_ = max_frames_scanned;
- }
-
- protected:
- // system_info identifies the operating system, NULL or empty if unknown.
- // memory identifies a MemoryRegion that provides the stack memory
- // for the stack to walk. modules, if non-NULL, is a CodeModules
- // object that is used to look up which code module each stack frame is
- // associated with. frame_symbolizer is a StackFrameSymbolizer object that
- // encapsulates the logic of how source line resolver interacts with symbol
- // supplier to symbolize stack frame and look up caller frame information
- // (see stack_frame_symbolizer.h).
- // frame_symbolizer MUST NOT be NULL (asserted).
- Stackwalker(const SystemInfo* system_info,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- // This can be used to filter out potential return addresses when
- // the stack walker resorts to stack scanning.
- // Returns true if any of:
- // * This address is within a loaded module, but we don't have symbols
- // for that module.
- // * This address is within a loaded module for which we have symbols,
- // and falls inside a function in that module.
- // Returns false otherwise.
- bool InstructionAddressSeemsValid(uint64_t address);
-
- // The default number of words to search through on the stack
- // for a return address.
- static const int kRASearchWords;
-
- template<typename InstructionType>
- bool ScanForReturnAddress(InstructionType location_start,
- InstructionType* location_found,
- InstructionType* ip_found,
- bool is_context_frame) {
- // When searching for the caller of the context frame,
- // allow the scanner to look farther down the stack.
- const int search_words = is_context_frame ?
- kRASearchWords * 4 :
- kRASearchWords;
-
- return ScanForReturnAddress(location_start, location_found, ip_found,
- search_words);
- }
-
- // Scan the stack starting at location_start, looking for an address
- // that looks like a valid instruction pointer. Addresses must
- // 1) be contained in the current stack memory
- // 2) pass the checks in InstructionAddressSeemsValid
- //
- // Returns true if a valid-looking instruction pointer was found.
- // When returning true, sets location_found to the address at which
- // the value was found, and ip_found to the value contained at that
- // location in memory.
- template<typename InstructionType>
- bool ScanForReturnAddress(InstructionType location_start,
- InstructionType* location_found,
- InstructionType* ip_found,
- int searchwords) {
- for (InstructionType location = location_start;
- location <= location_start + searchwords * sizeof(InstructionType);
- location += sizeof(InstructionType)) {
- InstructionType ip;
- if (!memory_->GetMemoryAtAddress(location, &ip))
- break;
-
- if (modules_ && modules_->GetModuleForAddress(ip) &&
- InstructionAddressSeemsValid(ip)) {
- *ip_found = ip;
- *location_found = location;
- return true;
- }
- }
- // nothing found
- return false;
- }
-
- // Information about the system that produced the minidump. Subclasses
- // and the SymbolSupplier may find this information useful.
- const SystemInfo* system_info_;
-
- // The stack memory to walk. Subclasses will require this region to
- // get information from the stack.
- MemoryRegion* memory_;
-
- // A list of modules, for populating each StackFrame's module information.
- // This field is optional and may be NULL.
- const CodeModules* modules_;
-
- protected:
- // The StackFrameSymbolizer implementation.
- StackFrameSymbolizer* frame_symbolizer_;
-
- private:
- // Obtains the context frame, the innermost called procedure in a stack
- // trace. Returns NULL on failure. GetContextFrame allocates a new
- // StackFrame (or StackFrame subclass), ownership of which is taken by
- // the caller.
- virtual StackFrame* GetContextFrame() = 0;
-
- // Obtains a caller frame. Each call to GetCallerFrame should return the
- // frame that called the last frame returned by GetContextFrame or
- // GetCallerFrame. To aid this purpose, stack contains the CallStack
- // made of frames that have already been walked. GetCallerFrame should
- // return NULL on failure or when there are no more caller frames (when
- // the end of the stack has been reached). GetCallerFrame allocates a new
- // StackFrame (or StackFrame subclass), ownership of which is taken by
- // the caller. |stack_scan_allowed| controls whether stack scanning is
- // an allowable frame-recovery method, since it is desirable to be able to
- // disable stack scanning in performance-critical use cases.
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) = 0;
-
- // The maximum number of frames Stackwalker will walk through.
- // This defaults to 1024 to prevent infinite loops.
- static uint32_t max_frames_;
-
- // Keep track of whether max_frames_ has been set by the user, since
- // it affects whether or not an error message is printed in the case
- // where an unwind got stopped by the limit.
- static bool max_frames_set_;
-
- // The maximum number of stack-scanned and otherwise untrustworthy
- // frames allowed. Stack-scanning can be expensive, so the option to
- // disable or limit it is helpful in cases where unwind performance is
- // important. This defaults to 1024, the same as max_frames_.
- static uint32_t max_frames_scanned_;
-};
-
-} // namespace google_breakpad
-
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_STACKWALKER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/symbol_supplier.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/symbol_supplier.h
deleted file mode 100644
index a042081f3b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/symbol_supplier.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The caller may implement the SymbolSupplier abstract base class
-// to provide symbols for a given module.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_SYMBOL_SUPPLIER_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_SYMBOL_SUPPLIER_H__
-
-#include <string>
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-class CodeModule;
-struct SystemInfo;
-
-class SymbolSupplier {
- public:
- // Result type for GetSymbolFile
- enum SymbolResult {
- // no symbols were found, but continue processing
- NOT_FOUND,
-
- // symbols were found, and the path has been placed in symbol_file
- FOUND,
-
- // stops processing the minidump immediately
- INTERRUPT
- };
-
- virtual ~SymbolSupplier() {}
-
- // Retrieves the symbol file for the given CodeModule, placing the
- // path in symbol_file if successful. system_info contains strings
- // identifying the operating system and CPU; SymbolSupplier may use
- // to help locate the symbol file. system_info may be NULL or its
- // fields may be empty if these values are unknown. symbol_file
- // must be a pointer to a valid string
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file) = 0;
- // Same as above, except also places symbol data into symbol_data.
- // If symbol_data is NULL, the data is not returned.
- // TODO(nealsid) Once we have symbol data caching behavior implemented
- // investigate making all symbol suppliers implement all methods,
- // and make this pure virtual
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) = 0;
-
- // Same as above, except allocates data buffer on heap and then places the
- // symbol data into the buffer as C-string.
- // SymbolSupplier is responsible for deleting the data buffer. After the call
- // to GetCStringSymbolData(), the caller should call FreeSymbolData(const
- // Module *module) once the data buffer is no longer needed.
- // If symbol_data is not NULL, symbol supplier won't return FOUND unless it
- // returns a valid buffer in symbol_data, e.g., returns INTERRUPT on memory
- // allocation failure.
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) = 0;
-
- // Frees the data buffer allocated for the module in GetCStringSymbolData.
- virtual void FreeSymbolData(const CodeModule *module) = 0;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_SYMBOL_SUPPLIER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/system_info.h b/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/system_info.h
deleted file mode 100644
index 8d2f60be48..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/google_breakpad/processor/system_info.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// system_info.h: Information about the system that was running a program
-// when a crash report was produced.
-//
-// Author: Mark Mentovai
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
-#define GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-struct SystemInfo {
- public:
- SystemInfo() : os(), os_short(), os_version(), cpu(), cpu_info(),
- cpu_count(0), gl_version(), gl_vendor(), gl_renderer() {}
-
- // Resets the SystemInfo object to its default values.
- void Clear() {
- os.clear();
- os_short.clear();
- os_version.clear();
- cpu.clear();
- cpu_info.clear();
- cpu_count = 0;
- gl_version.clear();
- gl_vendor.clear();
- gl_renderer.clear();
- }
-
- // A string identifying the operating system, such as "Windows NT",
- // "Mac OS X", or "Linux". If the information is present in the dump but
- // its value is unknown, this field will contain a numeric value. If
- // the information is not present in the dump, this field will be empty.
- string os;
-
- // A short form of the os string, using lowercase letters and no spaces,
- // suitable for use in a filesystem. Possible values include "windows",
- // "mac", "linux" and "nacl". Empty if the information is not present
- // in the dump or if the OS given by the dump is unknown. The values
- // stored in this field should match those used by
- // MinidumpSystemInfo::GetOS.
- string os_short;
-
- // A string identifying the version of the operating system, such as
- // "5.1.2600 Service Pack 2" or "10.4.8 8L2127". If the dump does not
- // contain this information, this field will be empty.
- string os_version;
-
- // A string identifying the basic CPU family, such as "x86" or "ppc".
- // If this information is present in the dump but its value is unknown,
- // this field will contain a numeric value. If the information is not
- // present in the dump, this field will be empty. The values stored in
- // this field should match those used by MinidumpSystemInfo::GetCPU.
- string cpu;
-
- // A string further identifying the specific CPU, such as
- // "GenuineIntel level 6 model 13 stepping 8". If the information is not
- // present in the dump, or additional identifying information is not
- // defined for the CPU family, this field will be empty.
- string cpu_info;
-
- // The number of processors in the system. Will be greater than one for
- // multi-core systems.
- int cpu_count;
-
- // The GPU information. Currently only populated in microdumps.
- string gl_version;
- string gl_vendor;
- string gl_renderer;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_SYSTEM_INFO_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/address_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/address_map-inl.h
deleted file mode 100644
index 251c44781a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/address_map-inl.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// address_map-inl.h: Address map implementation.
-//
-// See address_map.h for documentation.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_ADDRESS_MAP_INL_H__
-#define PROCESSOR_ADDRESS_MAP_INL_H__
-
-#include "processor/address_map.h"
-
-#include <assert.h>
-
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename AddressType, typename EntryType>
-bool AddressMap<AddressType, EntryType>::Store(const AddressType &address,
- const EntryType &entry) {
- // Ensure that the specified address doesn't conflict with something already
- // in the map.
- if (map_.find(address) != map_.end()) {
- BPLOG(INFO) << "Store failed, address " << HexString(address) <<
- " is already present";
- return false;
- }
-
- map_.insert(MapValue(address, entry));
- return true;
-}
-
-template<typename AddressType, typename EntryType>
-bool AddressMap<AddressType, EntryType>::Retrieve(
- const AddressType &address,
- EntryType *entry, AddressType *entry_address) const {
- BPLOG_IF(ERROR, !entry) << "AddressMap::Retrieve requires |entry|";
- assert(entry);
-
- // upper_bound gives the first element whose key is greater than address,
- // but we want the first element whose key is less than or equal to address.
- // Decrement the iterator to get there, but not if the upper_bound already
- // points to the beginning of the map - in that case, address is lower than
- // the lowest stored key, so return false.
- MapConstIterator iterator = map_.upper_bound(address);
- if (iterator == map_.begin())
- return false;
- --iterator;
-
- *entry = iterator->second;
- if (entry_address)
- *entry_address = iterator->first;
-
- return true;
-}
-
-template<typename AddressType, typename EntryType>
-void AddressMap<AddressType, EntryType>::Clear() {
- map_.clear();
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_ADDRESS_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/address_map.h b/toolkit/crashreporter/google-breakpad/src/processor/address_map.h
deleted file mode 100644
index 2972cbb9f8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/address_map.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// address_map.h: Address maps.
-//
-// An address map contains a set of objects keyed by address. Objects are
-// retrieved from the map by returning the object with the highest key less
-// than or equal to the lookup key.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_ADDRESS_MAP_H__
-#define PROCESSOR_ADDRESS_MAP_H__
-
-#include <map>
-
-namespace google_breakpad {
-
-// Forward declarations (for later friend declarations).
-template<class, class> class AddressMapSerializer;
-
-template<typename AddressType, typename EntryType>
-class AddressMap {
- public:
- AddressMap() : map_() {}
-
- // Inserts an entry into the map. Returns false without storing the entry
- // if an entry is already stored in the map at the same address as specified
- // by the address argument.
- bool Store(const AddressType &address, const EntryType &entry);
-
- // Locates the entry stored at the highest address less than or equal to
- // the address argument. If there is no such range, returns false. The
- // entry is returned in entry, which is a required argument. If
- // entry_address is not NULL, it will be set to the address that the entry
- // was stored at.
- bool Retrieve(const AddressType &address,
- EntryType *entry, AddressType *entry_address) const;
-
- // Empties the address map, restoring it to the same state as when it was
- // initially created.
- void Clear();
-
- private:
- friend class AddressMapSerializer<AddressType, EntryType>;
- friend class ModuleComparer;
-
- // Convenience types.
- typedef std::map<AddressType, EntryType> AddressToEntryMap;
- typedef typename AddressToEntryMap::const_iterator MapConstIterator;
- typedef typename AddressToEntryMap::value_type MapValue;
-
- // Maps the address of each entry to an EntryType.
- AddressToEntryMap map_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_ADDRESS_MAP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/address_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/address_map_unittest.cc
deleted file mode 100644
index 9b4095b16c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/address_map_unittest.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// address_map_unittest.cc: Unit tests for AddressMap.
-//
-// Author: Mark Mentovai
-
-#include <limits.h>
-#include <stdio.h>
-
-#include "processor/address_map-inl.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-
-#define ASSERT_TRUE(condition) \
- if (!(condition)) { \
- fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \
- return false; \
- }
-
-#define ASSERT_FALSE(condition) ASSERT_TRUE(!(condition))
-
-#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2))
-
-namespace {
-
-using google_breakpad::AddressMap;
-using google_breakpad::linked_ptr;
-
-// A CountedObject holds an int. A global (not thread safe!) count of
-// allocated CountedObjects is maintained to help test memory management.
-class CountedObject {
- public:
- explicit CountedObject(int id) : id_(id) { ++count_; }
- ~CountedObject() { --count_; }
-
- static int count() { return count_; }
- int id() const { return id_; }
-
- private:
- static int count_;
- int id_;
-};
-
-int CountedObject::count_;
-
-typedef int AddressType;
-typedef AddressMap< AddressType, linked_ptr<CountedObject> > TestMap;
-
-static bool DoAddressMapTest() {
- ASSERT_EQ(CountedObject::count(), 0);
-
- TestMap test_map;
- linked_ptr<CountedObject> entry;
- AddressType address;
-
- // Check that a new map is truly empty.
- ASSERT_FALSE(test_map.Retrieve(0, &entry, &address));
- ASSERT_FALSE(test_map.Retrieve(INT_MIN, &entry, &address));
- ASSERT_FALSE(test_map.Retrieve(INT_MAX, &entry, &address));
-
- // Check that Clear clears the map without leaking.
- ASSERT_EQ(CountedObject::count(), 0);
- ASSERT_TRUE(test_map.Store(1,
- linked_ptr<CountedObject>(new CountedObject(0))));
- ASSERT_TRUE(test_map.Retrieve(1, &entry, &address));
- ASSERT_EQ(CountedObject::count(), 1);
- test_map.Clear();
- ASSERT_EQ(CountedObject::count(), 1); // still holding entry in this scope
-
- // Check that a cleared map is truly empty.
- ASSERT_FALSE(test_map.Retrieve(0, &entry, &address));
- ASSERT_FALSE(test_map.Retrieve(INT_MIN, &entry, &address));
- ASSERT_FALSE(test_map.Retrieve(INT_MAX, &entry, &address));
-
- // Check a single-element map.
- ASSERT_TRUE(test_map.Store(10,
- linked_ptr<CountedObject>(new CountedObject(1))));
- ASSERT_FALSE(test_map.Retrieve(9, &entry, &address));
- ASSERT_TRUE(test_map.Retrieve(10, &entry, &address));
- ASSERT_EQ(CountedObject::count(), 1);
- ASSERT_EQ(entry->id(), 1);
- ASSERT_EQ(address, 10);
- ASSERT_TRUE(test_map.Retrieve(11, &entry, &address));
- ASSERT_TRUE(test_map.Retrieve(11, &entry, NULL)); // NULL ok here
-
- // Add some more elements.
- ASSERT_TRUE(test_map.Store(5,
- linked_ptr<CountedObject>(new CountedObject(2))));
- ASSERT_EQ(CountedObject::count(), 2);
- ASSERT_TRUE(test_map.Store(20,
- linked_ptr<CountedObject>(new CountedObject(3))));
- ASSERT_TRUE(test_map.Store(15,
- linked_ptr<CountedObject>(new CountedObject(4))));
- ASSERT_FALSE(test_map.Store(10,
- linked_ptr<CountedObject>(new CountedObject(5)))); // already in map
- ASSERT_TRUE(test_map.Store(16,
- linked_ptr<CountedObject>(new CountedObject(6))));
- ASSERT_TRUE(test_map.Store(14,
- linked_ptr<CountedObject>(new CountedObject(7))));
-
- // Nothing was stored with a key under 5. Don't use ASSERT inside loops
- // because it won't show exactly which key/entry/address failed.
- for (AddressType key = 0; key < 5; ++key) {
- if (test_map.Retrieve(key, &entry, &address)) {
- fprintf(stderr,
- "FAIL: retrieve %d expected false observed true @ %s:%d\n",
- key, __FILE__, __LINE__);
- return false;
- }
- }
-
- // Check everything that was stored.
- const int id_verify[] = { 0, 0, 0, 0, 0, // unused
- 2, 2, 2, 2, 2, // 5 - 9
- 1, 1, 1, 1, 7, // 10 - 14
- 4, 6, 6, 6, 6, // 15 - 19
- 3, 3, 3, 3, 3, // 20 - 24
- 3, 3, 3, 3, 3 }; // 25 - 29
- const AddressType address_verify[] = { 0, 0, 0, 0, 0, // unused
- 5, 5, 5, 5, 5, // 5 - 9
- 10, 10, 10, 10, 14, // 10 - 14
- 15, 16, 16, 16, 16, // 15 - 19
- 20, 20, 20, 20, 20, // 20 - 24
- 20, 20, 20, 20, 20 }; // 25 - 29
-
- for (AddressType key = 5; key < 30; ++key) {
- if (!test_map.Retrieve(key, &entry, &address)) {
- fprintf(stderr,
- "FAIL: retrieve %d expected true observed false @ %s:%d\n",
- key, __FILE__, __LINE__);
- return false;
- }
- if (entry->id() != id_verify[key]) {
- fprintf(stderr,
- "FAIL: retrieve %d expected entry %d observed %d @ %s:%d\n",
- key, id_verify[key], entry->id(), __FILE__, __LINE__);
- return false;
- }
- if (address != address_verify[key]) {
- fprintf(stderr,
- "FAIL: retrieve %d expected address %d observed %d @ %s:%d\n",
- key, address_verify[key], address, __FILE__, __LINE__);
- return false;
- }
- }
-
- // The stored objects should still be in the map.
- ASSERT_EQ(CountedObject::count(), 6);
-
- return true;
-}
-
-static bool RunTests() {
- if (!DoAddressMapTest())
- return false;
-
- // Leak check.
- ASSERT_EQ(CountedObject::count(), 0);
-
- return true;
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- return RunTests() ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/basic_code_module.h b/toolkit/crashreporter/google-breakpad/src/processor/basic_code_module.h
deleted file mode 100644
index 0f7b3e4316..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/basic_code_module.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// basic_code_module.h: Carries information about code modules that are loaded
-// into a process.
-//
-// This is a basic concrete implementation of CodeModule. It cannot be
-// instantiated directly, only based on other objects that implement
-// the CodeModule interface. It exists to provide a CodeModule implementation
-// a place to store information when the life of the original object (such as
-// a MinidumpModule) cannot be guaranteed.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_BASIC_CODE_MODULE_H__
-#define PROCESSOR_BASIC_CODE_MODULE_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/code_module.h"
-
-namespace google_breakpad {
-
-class BasicCodeModule : public CodeModule {
- public:
- // Creates a new BasicCodeModule given any existing CodeModule
- // implementation. This is useful to make a copy of the data relevant to
- // the CodeModule interface without requiring all of the resources that
- // other CodeModule implementations may require.
- explicit BasicCodeModule(const CodeModule *that)
- : base_address_(that->base_address()),
- size_(that->size()),
- shrink_down_delta_(that->shrink_down_delta()),
- code_file_(that->code_file()),
- code_identifier_(that->code_identifier()),
- debug_file_(that->debug_file()),
- debug_identifier_(that->debug_identifier()),
- version_(that->version()) {}
-
- BasicCodeModule(uint64_t base_address, uint64_t size,
- const string &code_file,
- const string &code_identifier,
- const string &debug_file,
- const string &debug_identifier,
- const string &version)
- : base_address_(base_address),
- size_(size),
- shrink_down_delta_(0),
- code_file_(code_file),
- code_identifier_(code_identifier),
- debug_file_(debug_file),
- debug_identifier_(debug_identifier),
- version_(version)
- {}
- virtual ~BasicCodeModule() {}
-
- // See code_module.h for descriptions of these methods and the associated
- // members.
- virtual uint64_t base_address() const { return base_address_; }
- virtual uint64_t size() const { return size_; }
- virtual uint64_t shrink_down_delta() const { return shrink_down_delta_; }
- virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {
- shrink_down_delta_ = shrink_down_delta;
- }
- virtual string code_file() const { return code_file_; }
- virtual string code_identifier() const { return code_identifier_; }
- virtual string debug_file() const { return debug_file_; }
- virtual string debug_identifier() const { return debug_identifier_; }
- virtual string version() const { return version_; }
- virtual CodeModule* Copy() const { return new BasicCodeModule(this); }
-
- private:
- uint64_t base_address_;
- uint64_t size_;
- uint64_t shrink_down_delta_;
- string code_file_;
- string code_identifier_;
- string debug_file_;
- string debug_identifier_;
- string version_;
-
- // Disallow copy constructor and assignment operator.
- BasicCodeModule(const BasicCodeModule &that);
- void operator=(const BasicCodeModule &that);
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_BASIC_CODE_MODULE_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.cc b/toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.cc
deleted file mode 100644
index 48d971677c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// basic_code_modules.cc: Contains all of the CodeModule objects that
-// were loaded into a single process.
-//
-// See basic_code_modules.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "processor/basic_code_modules.h"
-
-#include <assert.h>
-
-#include <vector>
-
-#include "google_breakpad/processor/code_module.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-#include "processor/range_map-inl.h"
-
-namespace google_breakpad {
-
-using std::vector;
-
-BasicCodeModules::BasicCodeModules(const CodeModules *that)
- : main_address_(0), map_() {
- BPLOG_IF(ERROR, !that) << "BasicCodeModules::BasicCodeModules requires "
- "|that|";
- assert(that);
-
- map_.SetEnableShrinkDown(that->IsModuleShrinkEnabled());
-
- const CodeModule *main_module = that->GetMainModule();
- if (main_module)
- main_address_ = main_module->base_address();
-
- unsigned int count = that->module_count();
- for (unsigned int i = 0; i < count; ++i) {
- // Make a copy of the module and insert it into the map. Use
- // GetModuleAtIndex because ordering is unimportant when slurping the
- // entire list, and GetModuleAtIndex may be faster than
- // GetModuleAtSequence.
- linked_ptr<const CodeModule> module(that->GetModuleAtIndex(i)->Copy());
- if (!map_.StoreRange(module->base_address(), module->size(), module)) {
- BPLOG(ERROR) << "Module " << module->code_file()
- << " could not be stored";
- }
- }
-
- // Report modules with shrunk ranges.
- for (unsigned int i = 0; i < count; ++i) {
- linked_ptr<const CodeModule> module(that->GetModuleAtIndex(i)->Copy());
- uint64_t delta = 0;
- if (map_.RetrieveRange(module->base_address() + module->size() - 1,
- &module, NULL /* base */, &delta, NULL /* size */) &&
- delta > 0) {
- BPLOG(INFO) << "The range for module " << module->code_file()
- << " was shrunk down by " << HexString(delta) << " bytes.";
- linked_ptr<CodeModule> shrunk_range_module(module->Copy());
- shrunk_range_module->SetShrinkDownDelta(delta);
- shrunk_range_modules_.push_back(shrunk_range_module);
- }
- }
-
- // TODO(ivanpe): Report modules with conflicting ranges. The list of such
- // modules should be copied from |that|.
-}
-
-BasicCodeModules::BasicCodeModules() : main_address_(0), map_() { }
-
-BasicCodeModules::~BasicCodeModules() {
-}
-
-unsigned int BasicCodeModules::module_count() const {
- return map_.GetCount();
-}
-
-const CodeModule* BasicCodeModules::GetModuleForAddress(
- uint64_t address) const {
- linked_ptr<const CodeModule> module;
- if (!map_.RetrieveRange(address, &module, NULL /* base */, NULL /* delta */,
- NULL /* size */)) {
- BPLOG(INFO) << "No module at " << HexString(address);
- return NULL;
- }
-
- return module.get();
-}
-
-const CodeModule* BasicCodeModules::GetMainModule() const {
- return GetModuleForAddress(main_address_);
-}
-
-const CodeModule* BasicCodeModules::GetModuleAtSequence(
- unsigned int sequence) const {
- linked_ptr<const CodeModule> module;
- if (!map_.RetrieveRangeAtIndex(sequence, &module, NULL /* base */,
- NULL /* delta */, NULL /* size */)) {
- BPLOG(ERROR) << "RetrieveRangeAtIndex failed for sequence " << sequence;
- return NULL;
- }
-
- return module.get();
-}
-
-const CodeModule* BasicCodeModules::GetModuleAtIndex(
- unsigned int index) const {
- // This class stores everything in a RangeMap, without any more-efficient
- // way to walk the list of CodeModule objects. Implement GetModuleAtIndex
- // using GetModuleAtSequence, which meets all of the requirements, and
- // in addition, guarantees ordering.
- return GetModuleAtSequence(index);
-}
-
-const CodeModules* BasicCodeModules::Copy() const {
- return new BasicCodeModules(this);
-}
-
-vector<linked_ptr<const CodeModule> >
-BasicCodeModules::GetShrunkRangeModules() const {
- return shrunk_range_modules_;
-}
-
-bool BasicCodeModules::IsModuleShrinkEnabled() const {
- return map_.IsShrinkDownEnabled();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.h b/toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.h
deleted file mode 100644
index 50f8a03d81..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/basic_code_modules.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// basic_code_modules.h: Contains all of the CodeModule objects that
-// were loaded into a single process.
-//
-// This is a basic concrete implementation of CodeModules. It cannot be
-// instantiated directly, only based on other objects that implement
-// the CodeModules interface. It exists to provide a CodeModules
-// implementation a place to store information when the life of the original
-// object (such as a MinidumpModuleList) cannot be guaranteed.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_BASIC_CODE_MODULES_H__
-#define PROCESSOR_BASIC_CODE_MODULES_H__
-
-#include <stddef.h>
-
-#include <vector>
-
-#include "google_breakpad/processor/code_modules.h"
-#include "processor/linked_ptr.h"
-#include "processor/range_map.h"
-
-namespace google_breakpad {
-
-class BasicCodeModules : public CodeModules {
- public:
- // Creates a new BasicCodeModules object given any existing CodeModules
- // implementation. This is useful to make a copy of the data relevant to
- // the CodeModules and CodeModule interfaces without requiring all of the
- // resources that other implementations may require. A copy will be
- // made of each contained CodeModule using CodeModule::Copy.
- explicit BasicCodeModules(const CodeModules *that);
-
- virtual ~BasicCodeModules();
-
- // See code_modules.h for descriptions of these methods.
- virtual unsigned int module_count() const;
- virtual const CodeModule* GetModuleForAddress(uint64_t address) const;
- virtual const CodeModule* GetMainModule() const;
- virtual const CodeModule* GetModuleAtSequence(unsigned int sequence) const;
- virtual const CodeModule* GetModuleAtIndex(unsigned int index) const;
- virtual const CodeModules* Copy() const;
- virtual std::vector<linked_ptr<const CodeModule> >
- GetShrunkRangeModules() const;
- virtual bool IsModuleShrinkEnabled() const;
-
- protected:
- BasicCodeModules();
-
- // The base address of the main module.
- uint64_t main_address_;
-
- // The map used to contain each CodeModule, keyed by each CodeModule's
- // address range.
- RangeMap<uint64_t, linked_ptr<const CodeModule> > map_;
-
- // A vector of all CodeModules that were shrunk downs due to
- // address range conflicts.
- std::vector<linked_ptr<const CodeModule> > shrunk_range_modules_;
-
- private:
- // Disallow copy constructor and assignment operator.
- BasicCodeModules(const BasicCodeModules &that);
- void operator=(const BasicCodeModules &that);
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_BASIC_CODE_MODULES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver.cc b/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver.cc
deleted file mode 100644
index aa66e15995..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver.cc
+++ /dev/null
@@ -1,612 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// basic_source_line_resolver.cc: BasicSourceLineResolver implementation.
-//
-// See basic_source_line_resolver.h and basic_source_line_resolver_types.h
-// for documentation.
-
-#include <assert.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <limits>
-#include <map>
-#include <utility>
-#include <vector>
-
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "processor/basic_source_line_resolver_types.h"
-#include "processor/module_factory.h"
-
-#include "processor/tokenize.h"
-
-using std::map;
-using std::vector;
-using std::make_pair;
-
-namespace google_breakpad {
-
-#ifdef _WIN32
-#ifdef _MSC_VER
-#define strtok_r strtok_s
-#endif
-#define strtoull _strtoui64
-#endif
-
-static const char *kWhitespace = " \r\n";
-static const int kMaxErrorsPrinted = 5;
-static const int kMaxErrorsBeforeBailing = 100;
-
-BasicSourceLineResolver::BasicSourceLineResolver() :
- SourceLineResolverBase(new BasicModuleFactory) { }
-
-// static
-void BasicSourceLineResolver::Module::LogParseError(
- const string &message,
- int line_number,
- int *num_errors) {
- if (++(*num_errors) <= kMaxErrorsPrinted) {
- if (line_number > 0) {
- BPLOG(ERROR) << "Line " << line_number << ": " << message;
- } else {
- BPLOG(ERROR) << message;
- }
- }
-}
-
-bool BasicSourceLineResolver::Module::LoadMapFromMemory(
- char *memory_buffer,
- size_t memory_buffer_size) {
- linked_ptr<Function> cur_func;
- int line_number = 0;
- int num_errors = 0;
- char *save_ptr;
-
- // If the length is 0, we can still pretend we have a symbol file. This is
- // for scenarios that want to test symbol lookup, but don't necessarily care
- // if certain modules do not have any information, like system libraries.
- if (memory_buffer_size == 0) {
- return true;
- }
-
- // Make sure the last character is null terminator.
- size_t last_null_terminator = memory_buffer_size - 1;
- if (memory_buffer[last_null_terminator] != '\0') {
- memory_buffer[last_null_terminator] = '\0';
- }
-
- // Skip any null terminators at the end of the memory buffer, and make sure
- // there are no other null terminators in the middle of the memory buffer.
- bool has_null_terminator_in_the_middle = false;
- while (last_null_terminator > 0 &&
- memory_buffer[last_null_terminator - 1] == '\0') {
- last_null_terminator--;
- }
- for (size_t i = 0; i < last_null_terminator; i++) {
- if (memory_buffer[i] == '\0') {
- memory_buffer[i] = '_';
- has_null_terminator_in_the_middle = true;
- }
- }
- if (has_null_terminator_in_the_middle) {
- LogParseError(
- "Null terminator is not expected in the middle of the symbol data",
- line_number,
- &num_errors);
- }
-
- char *buffer;
- buffer = strtok_r(memory_buffer, "\r\n", &save_ptr);
-
- while (buffer != NULL) {
- ++line_number;
-
- if (strncmp(buffer, "FILE ", 5) == 0) {
- if (!ParseFile(buffer)) {
- LogParseError("ParseFile on buffer failed", line_number, &num_errors);
- }
- } else if (strncmp(buffer, "STACK ", 6) == 0) {
- if (!ParseStackInfo(buffer)) {
- LogParseError("ParseStackInfo failed", line_number, &num_errors);
- }
- } else if (strncmp(buffer, "FUNC ", 5) == 0) {
- cur_func.reset(ParseFunction(buffer));
- if (!cur_func.get()) {
- LogParseError("ParseFunction failed", line_number, &num_errors);
- } else {
- // StoreRange will fail if the function has an invalid address or size.
- // We'll silently ignore this, the function and any corresponding lines
- // will be destroyed when cur_func is released.
- functions_.StoreRange(cur_func->address, cur_func->size, cur_func);
- }
- } else if (strncmp(buffer, "PUBLIC ", 7) == 0) {
- // Clear cur_func: public symbols don't contain line number information.
- cur_func.reset();
-
- if (!ParsePublicSymbol(buffer)) {
- LogParseError("ParsePublicSymbol failed", line_number, &num_errors);
- }
- } else if (strncmp(buffer, "MODULE ", 7) == 0) {
- // Ignore these. They're not of any use to BasicSourceLineResolver,
- // which is fed modules by a SymbolSupplier. These lines are present to
- // aid other tools in properly placing symbol files so that they can
- // be accessed by a SymbolSupplier.
- //
- // MODULE <guid> <age> <filename>
- } else if (strncmp(buffer, "INFO ", 5) == 0) {
- // Ignore these as well, they're similarly just for housekeeping.
- //
- // INFO CODE_ID <code id> <filename>
- } else {
- if (!cur_func.get()) {
- LogParseError("Found source line data without a function",
- line_number, &num_errors);
- } else {
- Line *line = ParseLine(buffer);
- if (!line) {
- LogParseError("ParseLine failed", line_number, &num_errors);
- } else {
- cur_func->lines.StoreRange(line->address, line->size,
- linked_ptr<Line>(line));
- }
- }
- }
- if (num_errors > kMaxErrorsBeforeBailing) {
- break;
- }
- buffer = strtok_r(NULL, "\r\n", &save_ptr);
- }
- is_corrupt_ = num_errors > 0;
- return true;
-}
-
-void BasicSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
- MemAddr address = frame->instruction - frame->module->base_address();
-
- // First, look for a FUNC record that covers address. Use
- // RetrieveNearestRange instead of RetrieveRange so that, if there
- // is no such function, we can use the next function to bound the
- // extent of the PUBLIC symbol we find, below. This does mean we
- // need to check that address indeed falls within the function we
- // find; do the range comparison in an overflow-friendly way.
- linked_ptr<Function> func;
- linked_ptr<PublicSymbol> public_symbol;
- MemAddr function_base;
- MemAddr function_size;
- MemAddr public_address;
- if (functions_.RetrieveNearestRange(address, &func, &function_base,
- NULL /* delta */, &function_size) &&
- address >= function_base && address - function_base < function_size) {
- frame->function_name = func->name;
- frame->function_base = frame->module->base_address() + function_base;
-
- linked_ptr<Line> line;
- MemAddr line_base;
- if (func->lines.RetrieveRange(address, &line, &line_base, NULL /* delta */,
- NULL /* size */)) {
- FileMap::const_iterator it = files_.find(line->source_file_id);
- if (it != files_.end()) {
- frame->source_file_name = files_.find(line->source_file_id)->second;
- }
- frame->source_line = line->line;
- frame->source_line_base = frame->module->base_address() + line_base;
- }
- } else if (public_symbols_.Retrieve(address,
- &public_symbol, &public_address) &&
- (!func.get() || public_address > function_base)) {
- frame->function_name = public_symbol->name;
- frame->function_base = frame->module->base_address() + public_address;
- }
-}
-
-WindowsFrameInfo *BasicSourceLineResolver::Module::FindWindowsFrameInfo(
- const StackFrame *frame) const {
- MemAddr address = frame->instruction - frame->module->base_address();
- scoped_ptr<WindowsFrameInfo> result(new WindowsFrameInfo());
-
- // We only know about WindowsFrameInfo::STACK_INFO_FRAME_DATA and
- // WindowsFrameInfo::STACK_INFO_FPO. Prefer them in this order.
- // WindowsFrameInfo::STACK_INFO_FRAME_DATA is the newer type that
- // includes its own program string.
- // WindowsFrameInfo::STACK_INFO_FPO is the older type
- // corresponding to the FPO_DATA struct. See stackwalker_x86.cc.
- linked_ptr<WindowsFrameInfo> frame_info;
- if ((windows_frame_info_[WindowsFrameInfo::STACK_INFO_FRAME_DATA]
- .RetrieveRange(address, &frame_info))
- || (windows_frame_info_[WindowsFrameInfo::STACK_INFO_FPO]
- .RetrieveRange(address, &frame_info))) {
- result->CopyFrom(*frame_info.get());
- return result.release();
- }
-
- // Even without a relevant STACK line, many functions contain
- // information about how much space their parameters consume on the
- // stack. Use RetrieveNearestRange instead of RetrieveRange, so that
- // we can use the function to bound the extent of the PUBLIC symbol,
- // below. However, this does mean we need to check that ADDRESS
- // falls within the retrieved function's range; do the range
- // comparison in an overflow-friendly way.
- linked_ptr<Function> function;
- MemAddr function_base, function_size;
- if (functions_.RetrieveNearestRange(address, &function, &function_base,
- NULL /* delta */, &function_size) &&
- address >= function_base && address - function_base < function_size) {
- result->parameter_size = function->parameter_size;
- result->valid |= WindowsFrameInfo::VALID_PARAMETER_SIZE;
- return result.release();
- }
-
- // PUBLIC symbols might have a parameter size. Use the function we
- // found above to limit the range the public symbol covers.
- linked_ptr<PublicSymbol> public_symbol;
- MemAddr public_address;
- if (public_symbols_.Retrieve(address, &public_symbol, &public_address) &&
- (!function.get() || public_address > function_base)) {
- result->parameter_size = public_symbol->parameter_size;
- }
-
- return NULL;
-}
-
-CFIFrameInfo *BasicSourceLineResolver::Module::FindCFIFrameInfo(
- const StackFrame *frame) const {
- MemAddr address = frame->instruction - frame->module->base_address();
- MemAddr initial_base, initial_size;
- string initial_rules;
-
- // Find the initial rule whose range covers this address. That
- // provides an initial set of register recovery rules. Then, walk
- // forward from the initial rule's starting address to frame's
- // instruction address, applying delta rules.
- if (!cfi_initial_rules_.RetrieveRange(address, &initial_rules, &initial_base,
- NULL /* delta */, &initial_size)) {
- return NULL;
- }
-
- // Create a frame info structure, and populate it with the rules from
- // the STACK CFI INIT record.
- scoped_ptr<CFIFrameInfo> rules(new CFIFrameInfo());
- if (!ParseCFIRuleSet(initial_rules, rules.get()))
- return NULL;
-
- // Find the first delta rule that falls within the initial rule's range.
- map<MemAddr, string>::const_iterator delta =
- cfi_delta_rules_.lower_bound(initial_base);
-
- // Apply delta rules up to and including the frame's address.
- while (delta != cfi_delta_rules_.end() && delta->first <= address) {
- ParseCFIRuleSet(delta->second, rules.get());
- delta++;
- }
-
- return rules.release();
-}
-
-bool BasicSourceLineResolver::Module::ParseFile(char *file_line) {
- long index;
- char *filename;
- if (SymbolParseHelper::ParseFile(file_line, &index, &filename)) {
- files_.insert(make_pair(index, string(filename)));
- return true;
- }
- return false;
-}
-
-BasicSourceLineResolver::Function*
-BasicSourceLineResolver::Module::ParseFunction(char *function_line) {
- uint64_t address;
- uint64_t size;
- long stack_param_size;
- char *name;
- if (SymbolParseHelper::ParseFunction(function_line, &address, &size,
- &stack_param_size, &name)) {
- return new Function(name, address, size, stack_param_size);
- }
- return NULL;
-}
-
-BasicSourceLineResolver::Line* BasicSourceLineResolver::Module::ParseLine(
- char *line_line) {
- uint64_t address;
- uint64_t size;
- long line_number;
- long source_file;
-
- if (SymbolParseHelper::ParseLine(line_line, &address, &size, &line_number,
- &source_file)) {
- return new Line(address, size, source_file, line_number);
- }
- return NULL;
-}
-
-bool BasicSourceLineResolver::Module::ParsePublicSymbol(char *public_line) {
- uint64_t address;
- long stack_param_size;
- char *name;
-
- if (SymbolParseHelper::ParsePublicSymbol(public_line, &address,
- &stack_param_size, &name)) {
- // A few public symbols show up with an address of 0. This has been seen
- // in the dumped output of ntdll.pdb for symbols such as _CIlog, _CIpow,
- // RtlDescribeChunkLZNT1, and RtlReserveChunkLZNT1. They would conflict
- // with one another if they were allowed into the public_symbols_ map,
- // but since the address is obviously invalid, gracefully accept them
- // as input without putting them into the map.
- if (address == 0) {
- return true;
- }
-
- linked_ptr<PublicSymbol> symbol(new PublicSymbol(name, address,
- stack_param_size));
- return public_symbols_.Store(address, symbol);
- }
- return false;
-}
-
-bool BasicSourceLineResolver::Module::ParseStackInfo(char *stack_info_line) {
- // Skip "STACK " prefix.
- stack_info_line += 6;
-
- // Find the token indicating what sort of stack frame walking
- // information this is.
- while (*stack_info_line == ' ')
- stack_info_line++;
- const char *platform = stack_info_line;
- while (!strchr(kWhitespace, *stack_info_line))
- stack_info_line++;
- *stack_info_line++ = '\0';
-
- // MSVC stack frame info.
- if (strcmp(platform, "WIN") == 0) {
- int type = 0;
- uint64_t rva, code_size;
- linked_ptr<WindowsFrameInfo>
- stack_frame_info(WindowsFrameInfo::ParseFromString(stack_info_line,
- type,
- rva,
- code_size));
- if (stack_frame_info == NULL)
- return false;
-
- // TODO(mmentovai): I wanted to use StoreRange's return value as this
- // method's return value, but MSVC infrequently outputs stack info that
- // violates the containment rules. This happens with a section of code
- // in strncpy_s in test_app.cc (testdata/minidump2). There, problem looks
- // like this:
- // STACK WIN 4 4242 1a a 0 ... (STACK WIN 4 base size prolog 0 ...)
- // STACK WIN 4 4243 2e 9 0 ...
- // ContainedRangeMap treats these two blocks as conflicting. In reality,
- // when the prolog lengths are taken into account, the actual code of
- // these blocks doesn't conflict. However, we can't take the prolog lengths
- // into account directly here because we'd wind up with a different set
- // of range conflicts when MSVC outputs stack info like this:
- // STACK WIN 4 1040 73 33 0 ...
- // STACK WIN 4 105a 59 19 0 ...
- // because in both of these entries, the beginning of the code after the
- // prolog is at 0x1073, and the last byte of contained code is at 0x10b2.
- // Perhaps we could get away with storing ranges by rva + prolog_size
- // if ContainedRangeMap were modified to allow replacement of
- // already-stored values.
-
- windows_frame_info_[type].StoreRange(rva, code_size, stack_frame_info);
- return true;
- } else if (strcmp(platform, "CFI") == 0) {
- // DWARF CFI stack frame info
- return ParseCFIFrameInfo(stack_info_line);
- } else {
- // Something unrecognized.
- return false;
- }
-}
-
-bool BasicSourceLineResolver::Module::ParseCFIFrameInfo(
- char *stack_info_line) {
- char *cursor;
-
- // Is this an INIT record or a delta record?
- char *init_or_address = strtok_r(stack_info_line, " \r\n", &cursor);
- if (!init_or_address)
- return false;
-
- if (strcmp(init_or_address, "INIT") == 0) {
- // This record has the form "STACK INIT <address> <size> <rules...>".
- char *address_field = strtok_r(NULL, " \r\n", &cursor);
- if (!address_field) return false;
-
- char *size_field = strtok_r(NULL, " \r\n", &cursor);
- if (!size_field) return false;
-
- char *initial_rules = strtok_r(NULL, "\r\n", &cursor);
- if (!initial_rules) return false;
-
- MemAddr address = strtoul(address_field, NULL, 16);
- MemAddr size = strtoul(size_field, NULL, 16);
- cfi_initial_rules_.StoreRange(address, size, initial_rules);
- return true;
- }
-
- // This record has the form "STACK <address> <rules...>".
- char *address_field = init_or_address;
- char *delta_rules = strtok_r(NULL, "\r\n", &cursor);
- if (!delta_rules) return false;
- MemAddr address = strtoul(address_field, NULL, 16);
- cfi_delta_rules_[address] = delta_rules;
- return true;
-}
-
-// static
-bool SymbolParseHelper::ParseFile(char *file_line, long *index,
- char **filename) {
- // FILE <id> <filename>
- assert(strncmp(file_line, "FILE ", 5) == 0);
- file_line += 5; // skip prefix
-
- vector<char*> tokens;
- if (!Tokenize(file_line, kWhitespace, 2, &tokens)) {
- return false;
- }
-
- char *after_number;
- *index = strtol(tokens[0], &after_number, 10);
- if (!IsValidAfterNumber(after_number) || *index < 0 ||
- *index == std::numeric_limits<long>::max()) {
- return false;
- }
-
- *filename = tokens[1];
- if (!*filename) {
- return false;
- }
-
- return true;
-}
-
-// static
-bool SymbolParseHelper::ParseFunction(char *function_line, uint64_t *address,
- uint64_t *size, long *stack_param_size,
- char **name) {
- // FUNC <address> <size> <stack_param_size> <name>
- assert(strncmp(function_line, "FUNC ", 5) == 0);
- function_line += 5; // skip prefix
-
- vector<char*> tokens;
- if (!Tokenize(function_line, kWhitespace, 4, &tokens)) {
- return false;
- }
-
- char *after_number;
- *address = strtoull(tokens[0], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *address == std::numeric_limits<unsigned long long>::max()) {
- return false;
- }
- *size = strtoull(tokens[1], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *size == std::numeric_limits<unsigned long long>::max()) {
- return false;
- }
- *stack_param_size = strtol(tokens[2], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *stack_param_size == std::numeric_limits<long>::max() ||
- *stack_param_size < 0) {
- return false;
- }
- *name = tokens[3];
-
- return true;
-}
-
-// static
-bool SymbolParseHelper::ParseLine(char *line_line, uint64_t *address,
- uint64_t *size, long *line_number,
- long *source_file) {
- // <address> <size> <line number> <source file id>
- vector<char*> tokens;
- if (!Tokenize(line_line, kWhitespace, 4, &tokens)) {
- return false;
- }
-
- char *after_number;
- *address = strtoull(tokens[0], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *address == std::numeric_limits<unsigned long long>::max()) {
- return false;
- }
- *size = strtoull(tokens[1], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *size == std::numeric_limits<unsigned long long>::max()) {
- return false;
- }
- *line_number = strtol(tokens[2], &after_number, 10);
- if (!IsValidAfterNumber(after_number) ||
- *line_number == std::numeric_limits<long>::max()) {
- return false;
- }
- *source_file = strtol(tokens[3], &after_number, 10);
- if (!IsValidAfterNumber(after_number) || *source_file < 0 ||
- *source_file == std::numeric_limits<long>::max()) {
- return false;
- }
-
- // Valid line numbers normally start from 1, however there are functions that
- // are associated with a source file but not associated with any line number
- // (block helper function) and for such functions the symbol file contains 0
- // for the line numbers. Hence, 0 should be treated as a valid line number.
- // For more information on block helper functions, please, take a look at:
- // http://clang.llvm.org/docs/Block-ABI-Apple.html
- if (*line_number < 0) {
- return false;
- }
-
- return true;
-}
-
-// static
-bool SymbolParseHelper::ParsePublicSymbol(char *public_line,
- uint64_t *address,
- long *stack_param_size,
- char **name) {
- // PUBLIC <address> <stack_param_size> <name>
- assert(strncmp(public_line, "PUBLIC ", 7) == 0);
- public_line += 7; // skip prefix
-
- vector<char*> tokens;
- if (!Tokenize(public_line, kWhitespace, 3, &tokens)) {
- return false;
- }
-
- char *after_number;
- *address = strtoull(tokens[0], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *address == std::numeric_limits<unsigned long long>::max()) {
- return false;
- }
- *stack_param_size = strtol(tokens[1], &after_number, 16);
- if (!IsValidAfterNumber(after_number) ||
- *stack_param_size == std::numeric_limits<long>::max() ||
- *stack_param_size < 0) {
- return false;
- }
- *name = tokens[2];
-
- return true;
-}
-
-// static
-bool SymbolParseHelper::IsValidAfterNumber(char *after_number) {
- if (after_number != NULL && strchr(kWhitespace, *after_number) != NULL) {
- return true;
- }
- return false;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_types.h b/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_types.h
deleted file mode 100644
index a022bc0dbb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_types.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// basic_source_line_types.h: definition of nested classes/structs in
-// BasicSourceLineResolver. It moves the definitions out of
-// basic_source_line_resolver.cc, so that other classes could have access
-// to these private nested types without including basic_source_line_resolver.cc
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__
-#define PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__
-
-#include <map>
-#include <string>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "processor/source_line_resolver_base_types.h"
-
-#include "processor/address_map-inl.h"
-#include "processor/range_map-inl.h"
-#include "processor/contained_range_map-inl.h"
-
-#include "processor/linked_ptr.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/windows_frame_info.h"
-
-namespace google_breakpad {
-
-struct
-BasicSourceLineResolver::Function : public SourceLineResolverBase::Function {
- Function(const string &function_name,
- MemAddr function_address,
- MemAddr code_size,
- int set_parameter_size) : Base(function_name,
- function_address,
- code_size,
- set_parameter_size),
- lines() { }
- RangeMap< MemAddr, linked_ptr<Line> > lines;
- private:
- typedef SourceLineResolverBase::Function Base;
-};
-
-
-class BasicSourceLineResolver::Module : public SourceLineResolverBase::Module {
- public:
- explicit Module(const string &name) : name_(name), is_corrupt_(false) { }
- virtual ~Module() { }
-
- // Loads a map from the given buffer in char* type.
- // Does NOT have ownership of memory_buffer.
- // The passed in |memory buffer| is of size |memory_buffer_size|. If it is
- // not null terminated, LoadMapFromMemory() will null terminate it by
- // modifying the passed in buffer.
- virtual bool LoadMapFromMemory(char *memory_buffer,
- size_t memory_buffer_size);
-
- // Tells whether the loaded symbol data is corrupt. Return value is
- // undefined, if the symbol data hasn't been loaded yet.
- virtual bool IsCorrupt() const { return is_corrupt_; }
-
- // Looks up the given relative address, and fills the StackFrame struct
- // with the result.
- virtual void LookupAddress(StackFrame *frame) const;
-
- // If Windows stack walking information is available covering ADDRESS,
- // return a WindowsFrameInfo structure describing it. If the information
- // is not available, returns NULL. A NULL return value does not indicate
- // an error. The caller takes ownership of any returned WindowsFrameInfo
- // object.
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) const;
-
- // If CFI stack walking information is available covering ADDRESS,
- // return a CFIFrameInfo structure describing it. If the information
- // is not available, return NULL. The caller takes ownership of any
- // returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const;
-
- private:
- // Friend declarations.
- friend class BasicSourceLineResolver;
- friend class ModuleComparer;
- friend class ModuleSerializer;
-
- typedef std::map<int, string> FileMap;
-
- // Logs parse errors. |*num_errors| is increased every time LogParseError is
- // called.
- static void LogParseError(
- const string &message,
- int line_number,
- int *num_errors);
-
- // Parses a file declaration
- bool ParseFile(char *file_line);
-
- // Parses a function declaration, returning a new Function object.
- Function* ParseFunction(char *function_line);
-
- // Parses a line declaration, returning a new Line object.
- Line* ParseLine(char *line_line);
-
- // Parses a PUBLIC symbol declaration, storing it in public_symbols_.
- // Returns false if an error occurs.
- bool ParsePublicSymbol(char *public_line);
-
- // Parses a STACK WIN or STACK CFI frame info declaration, storing
- // it in the appropriate table.
- bool ParseStackInfo(char *stack_info_line);
-
- // Parses a STACK CFI record, storing it in cfi_frame_info_.
- bool ParseCFIFrameInfo(char *stack_info_line);
-
- string name_;
- FileMap files_;
- RangeMap< MemAddr, linked_ptr<Function> > functions_;
- AddressMap< MemAddr, linked_ptr<PublicSymbol> > public_symbols_;
- bool is_corrupt_;
-
- // Each element in the array is a ContainedRangeMap for a type
- // listed in WindowsFrameInfoTypes. These are split by type because
- // there may be overlaps between maps of different types, but some
- // information is only available as certain types.
- ContainedRangeMap< MemAddr, linked_ptr<WindowsFrameInfo> >
- windows_frame_info_[WindowsFrameInfo::STACK_INFO_LAST];
-
- // DWARF CFI stack walking data. The Module stores the initial rule sets
- // and rule deltas as strings, just as they appear in the symbol file:
- // although the file may contain hundreds of thousands of STACK CFI
- // records, walking a stack will only ever use a few of them, so it's
- // best to delay parsing a record until it's actually needed.
-
- // STACK CFI INIT records: for each range, an initial set of register
- // recovery rules. The RangeMap's itself gives the starting and ending
- // addresses.
- RangeMap<MemAddr, string> cfi_initial_rules_;
-
- // STACK CFI records: at a given address, the changes to the register
- // recovery rules that take effect at that address. The map key is the
- // starting address; the ending address is the key of the next entry in
- // this map, or the end of the range as given by the cfi_initial_rules_
- // entry (which FindCFIFrameInfo looks up first).
- std::map<MemAddr, string> cfi_delta_rules_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_BASIC_SOURCE_LINE_RESOLVER_TYPES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_unittest.cc
deleted file mode 100644
index a75044c74b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/basic_source_line_resolver_unittest.cc
+++ /dev/null
@@ -1,682 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-#include "processor/windows_frame_info.h"
-#include "processor/cfi_frame_info.h"
-
-namespace {
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CFIFrameInfo;
-using google_breakpad::CodeModule;
-using google_breakpad::MemoryRegion;
-using google_breakpad::StackFrame;
-using google_breakpad::WindowsFrameInfo;
-using google_breakpad::linked_ptr;
-using google_breakpad::scoped_ptr;
-using google_breakpad::SymbolParseHelper;
-
-class TestCodeModule : public CodeModule {
- public:
- TestCodeModule(string code_file) : code_file_(code_file) {}
- virtual ~TestCodeModule() {}
-
- virtual uint64_t base_address() const { return 0; }
- virtual uint64_t size() const { return 0xb000; }
- virtual string code_file() const { return code_file_; }
- virtual string code_identifier() const { return ""; }
- virtual string debug_file() const { return ""; }
- virtual string debug_identifier() const { return ""; }
- virtual string version() const { return ""; }
- virtual CodeModule* Copy() const {
- return new TestCodeModule(code_file_);
- }
- virtual uint64_t shrink_down_delta() const { return 0; }
- virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
-
- private:
- string code_file_;
-};
-
-// A mock memory region object, for use by the STACK CFI tests.
-class MockMemoryRegion: public MemoryRegion {
- uint64_t GetBase() const { return 0x10000; }
- uint32_t GetSize() const { return 0x01000; }
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
- *value = address & 0xff;
- return true;
- }
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
- *value = address & 0xffff;
- return true;
- }
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
- switch (address) {
- case 0x10008: *value = 0x98ecadc3; break; // saved %ebx
- case 0x1000c: *value = 0x878f7524; break; // saved %esi
- case 0x10010: *value = 0x6312f9a5; break; // saved %edi
- case 0x10014: *value = 0x10038; break; // caller's %ebp
- case 0x10018: *value = 0xf6438648; break; // return address
- default: *value = 0xdeadbeef; break; // junk
- }
- return true;
- }
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
- *value = address;
- return true;
- }
- void Print() const {
- assert(false);
- }
-};
-
-// Verify that, for every association in ACTUAL, EXPECTED has the same
-// association. (That is, ACTUAL's associations should be a subset of
-// EXPECTED's.) Also verify that ACTUAL has associations for ".ra" and
-// ".cfa".
-static bool VerifyRegisters(
- const char *file, int line,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &expected,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &actual) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator a;
- a = actual.find(".cfa");
- if (a == actual.end())
- return false;
- a = actual.find(".ra");
- if (a == actual.end())
- return false;
- for (a = actual.begin(); a != actual.end(); a++) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator e =
- expected.find(a->first);
- if (e == expected.end()) {
- fprintf(stderr, "%s:%d: unexpected register '%s' recovered, value 0x%x\n",
- file, line, a->first.c_str(), a->second);
- return false;
- }
- if (e->second != a->second) {
- fprintf(stderr,
- "%s:%d: register '%s' recovered value was 0x%x, expected 0x%x\n",
- file, line, a->first.c_str(), a->second, e->second);
- return false;
- }
- // Don't complain if this doesn't recover all registers. Although
- // the DWARF spec says that unmentioned registers are undefined,
- // GCC uses omission to mean that they are unchanged.
- }
- return true;
-}
-
-
-static bool VerifyEmpty(const StackFrame &frame) {
- if (frame.function_name.empty() &&
- frame.source_file_name.empty() &&
- frame.source_line == 0)
- return true;
- return false;
-}
-
-static void ClearSourceLineInfo(StackFrame *frame) {
- frame->function_name.clear();
- frame->module = NULL;
- frame->source_file_name.clear();
- frame->source_line = 0;
-}
-
-class TestBasicSourceLineResolver : public ::testing::Test {
-public:
- void SetUp() {
- testdata_dir = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata";
- }
-
- BasicSourceLineResolver resolver;
- string testdata_dir;
-};
-
-TEST_F(TestBasicSourceLineResolver, TestLoadAndResolve)
-{
- TestCodeModule module1("module1");
- ASSERT_TRUE(resolver.LoadModule(&module1, testdata_dir + "/module1.out"));
- ASSERT_TRUE(resolver.HasModule(&module1));
- TestCodeModule module2("module2");
- ASSERT_TRUE(resolver.LoadModule(&module2, testdata_dir + "/module2.out"));
- ASSERT_TRUE(resolver.HasModule(&module2));
-
-
- StackFrame frame;
- scoped_ptr<WindowsFrameInfo> windows_frame_info;
- scoped_ptr<CFIFrameInfo> cfi_frame_info;
- frame.instruction = 0x1000;
- frame.module = NULL;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_FALSE(frame.module);
- ASSERT_TRUE(frame.function_name.empty());
- ASSERT_EQ(frame.function_base, 0U);
- ASSERT_TRUE(frame.source_file_name.empty());
- ASSERT_EQ(frame.source_line, 0);
- ASSERT_EQ(frame.source_line_base, 0U);
-
- frame.module = &module1;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function1_1");
- ASSERT_TRUE(frame.module);
- ASSERT_EQ(frame.module->code_file(), "module1");
- ASSERT_EQ(frame.function_base, 0x1000U);
- ASSERT_EQ(frame.source_file_name, "file1_1.cc");
- ASSERT_EQ(frame.source_line, 44);
- ASSERT_EQ(frame.source_line_base, 0x1000U);
- windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA);
- ASSERT_FALSE(windows_frame_info->allocates_base_pointer);
- ASSERT_EQ(windows_frame_info->program_string,
- "$eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =");
-
- ClearSourceLineInfo(&frame);
- frame.instruction = 0x800;
- frame.module = &module1;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_TRUE(VerifyEmpty(frame));
- windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame));
- ASSERT_FALSE(windows_frame_info.get());
-
- frame.instruction = 0x1280;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function1_3");
- ASSERT_TRUE(frame.source_file_name.empty());
- ASSERT_EQ(frame.source_line, 0);
- windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_UNKNOWN);
- ASSERT_FALSE(windows_frame_info->allocates_base_pointer);
- ASSERT_TRUE(windows_frame_info->program_string.empty());
-
- frame.instruction = 0x1380;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function1_4");
- ASSERT_TRUE(frame.source_file_name.empty());
- ASSERT_EQ(frame.source_line, 0);
- windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame));
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA);
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_FALSE(windows_frame_info->allocates_base_pointer);
- ASSERT_FALSE(windows_frame_info->program_string.empty());
-
- frame.instruction = 0x2000;
- windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame));
- ASSERT_FALSE(windows_frame_info.get());
-
- // module1 has STACK CFI records covering 3d40..3def;
- // module2 has STACK CFI records covering 3df0..3e9f;
- // check that FindCFIFrameInfo doesn't claim to find any outside those ranges.
- frame.instruction = 0x3d3f;
- frame.module = &module1;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_FALSE(cfi_frame_info.get());
-
- frame.instruction = 0x3e9f;
- frame.module = &module1;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_FALSE(cfi_frame_info.get());
-
- CFIFrameInfo::RegisterValueMap<uint32_t> current_registers;
- CFIFrameInfo::RegisterValueMap<uint32_t> caller_registers;
- CFIFrameInfo::RegisterValueMap<uint32_t> expected_caller_registers;
- MockMemoryRegion memory;
-
- // Regardless of which instruction evaluation takes place at, it
- // should produce the same values for the caller's registers.
- expected_caller_registers[".cfa"] = 0x1001c;
- expected_caller_registers[".ra"] = 0xf6438648;
- expected_caller_registers["$ebp"] = 0x10038;
- expected_caller_registers["$ebx"] = 0x98ecadc3;
- expected_caller_registers["$esi"] = 0x878f7524;
- expected_caller_registers["$edi"] = 0x6312f9a5;
-
- frame.instruction = 0x3d40;
- frame.module = &module1;
- current_registers.clear();
- current_registers["$esp"] = 0x10018;
- current_registers["$ebp"] = 0x10038;
- current_registers["$ebx"] = 0x98ecadc3;
- current_registers["$esi"] = 0x878f7524;
- current_registers["$edi"] = 0x6312f9a5;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- ASSERT_TRUE(VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers));
-
- frame.instruction = 0x3d41;
- current_registers["$esp"] = 0x10014;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- ASSERT_TRUE(VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers));
-
- frame.instruction = 0x3d43;
- current_registers["$ebp"] = 0x10014;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x3d54;
- current_registers["$ebx"] = 0x6864f054U;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x3d5a;
- current_registers["$esi"] = 0x6285f79aU;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x3d84;
- current_registers["$edi"] = 0x64061449U;
- cfi_frame_info.reset(resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x2900;
- frame.module = &module1;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, string("PublicSymbol"));
-
- frame.instruction = 0x4000;
- frame.module = &module1;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, string("LargeFunction"));
-
- frame.instruction = 0x2181;
- frame.module = &module2;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function2_2");
- ASSERT_EQ(frame.function_base, 0x2170U);
- ASSERT_TRUE(frame.module);
- ASSERT_EQ(frame.module->code_file(), "module2");
- ASSERT_EQ(frame.source_file_name, "file2_2.cc");
- ASSERT_EQ(frame.source_line, 21);
- ASSERT_EQ(frame.source_line_base, 0x2180U);
- windows_frame_info.reset(resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA);
- ASSERT_EQ(windows_frame_info->prolog_size, 1U);
-
- frame.instruction = 0x216f;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Public2_1");
-
- ClearSourceLineInfo(&frame);
- frame.instruction = 0x219f;
- frame.module = &module2;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_TRUE(frame.function_name.empty());
-
- frame.instruction = 0x21a0;
- frame.module = &module2;
- resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Public2_2");
-}
-
-TEST_F(TestBasicSourceLineResolver, TestInvalidLoads)
-{
- TestCodeModule module3("module3");
- ASSERT_TRUE(resolver.LoadModule(&module3,
- testdata_dir + "/module3_bad.out"));
- ASSERT_TRUE(resolver.HasModule(&module3));
- ASSERT_TRUE(resolver.IsModuleCorrupt(&module3));
- TestCodeModule module4("module4");
- ASSERT_TRUE(resolver.LoadModule(&module4,
- testdata_dir + "/module4_bad.out"));
- ASSERT_TRUE(resolver.HasModule(&module4));
- ASSERT_TRUE(resolver.IsModuleCorrupt(&module4));
- TestCodeModule module5("module5");
- ASSERT_FALSE(resolver.LoadModule(&module5,
- testdata_dir + "/invalid-filename"));
- ASSERT_FALSE(resolver.HasModule(&module5));
- TestCodeModule invalidmodule("invalid-module");
- ASSERT_FALSE(resolver.HasModule(&invalidmodule));
-}
-
-TEST_F(TestBasicSourceLineResolver, TestUnload)
-{
- TestCodeModule module1("module1");
- ASSERT_FALSE(resolver.HasModule(&module1));
- ASSERT_TRUE(resolver.LoadModule(&module1, testdata_dir + "/module1.out"));
- ASSERT_TRUE(resolver.HasModule(&module1));
- resolver.UnloadModule(&module1);
- ASSERT_FALSE(resolver.HasModule(&module1));
- ASSERT_TRUE(resolver.LoadModule(&module1, testdata_dir + "/module1.out"));
- ASSERT_TRUE(resolver.HasModule(&module1));
-}
-
-// Test parsing of valid FILE lines. The format is:
-// FILE <id> <filename>
-TEST(SymbolParseHelper, ParseFileValid) {
- long index;
- char *filename;
-
- char kTestLine[] = "FILE 1 file name";
- ASSERT_TRUE(SymbolParseHelper::ParseFile(kTestLine, &index, &filename));
- EXPECT_EQ(1, index);
- EXPECT_EQ("file name", string(filename));
-
- // 0 is a valid index.
- char kTestLine1[] = "FILE 0 file name";
- ASSERT_TRUE(SymbolParseHelper::ParseFile(kTestLine1, &index, &filename));
- EXPECT_EQ(0, index);
- EXPECT_EQ("file name", string(filename));
-}
-
-// Test parsing of invalid FILE lines. The format is:
-// FILE <id> <filename>
-TEST(SymbolParseHelper, ParseFileInvalid) {
- long index;
- char *filename;
-
- // Test missing file name.
- char kTestLine[] = "FILE 1 ";
- ASSERT_FALSE(SymbolParseHelper::ParseFile(kTestLine, &index, &filename));
-
- // Test bad index.
- char kTestLine1[] = "FILE x1 file name";
- ASSERT_FALSE(SymbolParseHelper::ParseFile(kTestLine1, &index, &filename));
-
- // Test large index.
- char kTestLine2[] = "FILE 123123123123123123123123 file name";
- ASSERT_FALSE(SymbolParseHelper::ParseFile(kTestLine2, &index, &filename));
-
- // Test negative index.
- char kTestLine3[] = "FILE -2 file name";
- ASSERT_FALSE(SymbolParseHelper::ParseFile(kTestLine3, &index, &filename));
-}
-
-// Test parsing of valid FUNC lines. The format is:
-// FUNC <address> <size> <stack_param_size> <name>
-TEST(SymbolParseHelper, ParseFunctionValid) {
- uint64_t address;
- uint64_t size;
- long stack_param_size;
- char *name;
-
- char kTestLine[] = "FUNC 1 2 3 function name";
- ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine, &address, &size,
- &stack_param_size, &name));
- EXPECT_EQ(1ULL, address);
- EXPECT_EQ(2ULL, size);
- EXPECT_EQ(3, stack_param_size);
- EXPECT_EQ("function name", string(name));
-
- // Test hex address, size, and param size.
- char kTestLine1[] = "FUNC a1 a2 a3 function name";
- ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine1, &address, &size,
- &stack_param_size, &name));
- EXPECT_EQ(0xa1ULL, address);
- EXPECT_EQ(0xa2ULL, size);
- EXPECT_EQ(0xa3, stack_param_size);
- EXPECT_EQ("function name", string(name));
-
- char kTestLine2[] = "FUNC 0 0 0 function name";
- ASSERT_TRUE(SymbolParseHelper::ParseFunction(kTestLine2, &address, &size,
- &stack_param_size, &name));
- EXPECT_EQ(0ULL, address);
- EXPECT_EQ(0ULL, size);
- EXPECT_EQ(0, stack_param_size);
- EXPECT_EQ("function name", string(name));
-}
-
-// Test parsing of invalid FUNC lines. The format is:
-// FUNC <address> <size> <stack_param_size> <name>
-TEST(SymbolParseHelper, ParseFunctionInvalid) {
- uint64_t address;
- uint64_t size;
- long stack_param_size;
- char *name;
-
- // Test missing function name.
- char kTestLine[] = "FUNC 1 2 3 ";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine, &address, &size,
- &stack_param_size, &name));
- // Test bad address.
- char kTestLine1[] = "FUNC 1z 2 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine1, &address, &size,
- &stack_param_size, &name));
- // Test large address.
- char kTestLine2[] = "FUNC 123123123123123123123123123 2 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine2, &address, &size,
- &stack_param_size, &name));
- // Test bad size.
- char kTestLine3[] = "FUNC 1 z2 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine3, &address, &size,
- &stack_param_size, &name));
- // Test large size.
- char kTestLine4[] = "FUNC 1 231231231231231231231231232 3 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine4, &address, &size,
- &stack_param_size, &name));
- // Test bad param size.
- char kTestLine5[] = "FUNC 1 2 3z function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine5, &address, &size,
- &stack_param_size, &name));
- // Test large param size.
- char kTestLine6[] = "FUNC 1 2 312312312312312312312312323 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine6, &address, &size,
- &stack_param_size, &name));
- // Negative param size.
- char kTestLine7[] = "FUNC 1 2 -5 function name";
- ASSERT_FALSE(SymbolParseHelper::ParseFunction(kTestLine7, &address, &size,
- &stack_param_size, &name));
-}
-
-// Test parsing of valid lines. The format is:
-// <address> <size> <line number> <source file id>
-TEST(SymbolParseHelper, ParseLineValid) {
- uint64_t address;
- uint64_t size;
- long line_number;
- long source_file;
-
- char kTestLine[] = "1 2 3 4";
- ASSERT_TRUE(SymbolParseHelper::ParseLine(kTestLine, &address, &size,
- &line_number, &source_file));
- EXPECT_EQ(1ULL, address);
- EXPECT_EQ(2ULL, size);
- EXPECT_EQ(3, line_number);
- EXPECT_EQ(4, source_file);
-
- // Test hex size and address.
- char kTestLine1[] = "a1 a2 3 4 // some comment";
- ASSERT_TRUE(SymbolParseHelper::ParseLine(kTestLine1, &address, &size,
- &line_number, &source_file));
- EXPECT_EQ(0xa1ULL, address);
- EXPECT_EQ(0xa2ULL, size);
- EXPECT_EQ(3, line_number);
- EXPECT_EQ(4, source_file);
-
- // 0 is a valid line number.
- char kTestLine2[] = "a1 a2 0 4 // some comment";
- ASSERT_TRUE(SymbolParseHelper::ParseLine(kTestLine2, &address, &size,
- &line_number, &source_file));
- EXPECT_EQ(0xa1ULL, address);
- EXPECT_EQ(0xa2ULL, size);
- EXPECT_EQ(0, line_number);
- EXPECT_EQ(4, source_file);
-}
-
-// Test parsing of invalid lines. The format is:
-// <address> <size> <line number> <source file id>
-TEST(SymbolParseHelper, ParseLineInvalid) {
- uint64_t address;
- uint64_t size;
- long line_number;
- long source_file;
-
- // Test missing source file id.
- char kTestLine[] = "1 2 3";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine, &address, &size,
- &line_number, &source_file));
- // Test bad address.
- char kTestLine1[] = "1z 2 3 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine1, &address, &size,
- &line_number, &source_file));
- // Test large address.
- char kTestLine2[] = "123123123123123123123123 2 3 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine2, &address, &size,
- &line_number, &source_file));
- // Test bad size.
- char kTestLine3[] = "1 z2 3 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine3, &address, &size,
- &line_number, &source_file));
- // Test large size.
- char kTestLine4[] = "1 123123123123123123123123 3 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine4, &address, &size,
- &line_number, &source_file));
- // Test bad line number.
- char kTestLine5[] = "1 2 z3 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine5, &address, &size,
- &line_number, &source_file));
- // Test negative line number.
- char kTestLine6[] = "1 2 -1 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine6, &address, &size,
- &line_number, &source_file));
- // Test large line number.
- char kTestLine7[] = "1 2 123123123123123123123 4";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine7, &address, &size,
- &line_number, &source_file));
- // Test bad source file id.
- char kTestLine8[] = "1 2 3 f";
- ASSERT_FALSE(SymbolParseHelper::ParseLine(kTestLine8, &address, &size,
- &line_number, &source_file));
-}
-
-// Test parsing of valid PUBLIC lines. The format is:
-// PUBLIC <address> <stack_param_size> <name>
-TEST(SymbolParseHelper, ParsePublicSymbolValid) {
- uint64_t address;
- long stack_param_size;
- char *name;
-
- char kTestLine[] = "PUBLIC 1 2 3";
- ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &address,
- &stack_param_size, &name));
- EXPECT_EQ(1ULL, address);
- EXPECT_EQ(2, stack_param_size);
- EXPECT_EQ("3", string(name));
-
- // Test hex size and address.
- char kTestLine1[] = "PUBLIC a1 a2 function name";
- ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine1, &address,
- &stack_param_size, &name));
- EXPECT_EQ(0xa1ULL, address);
- EXPECT_EQ(0xa2, stack_param_size);
- EXPECT_EQ("function name", string(name));
-
- // Test 0 is a valid address.
- char kTestLine2[] = "PUBLIC 0 a2 function name";
- ASSERT_TRUE(SymbolParseHelper::ParsePublicSymbol(kTestLine2, &address,
- &stack_param_size, &name));
- EXPECT_EQ(0ULL, address);
- EXPECT_EQ(0xa2, stack_param_size);
- EXPECT_EQ("function name", string(name));
-}
-
-// Test parsing of invalid PUBLIC lines. The format is:
-// PUBLIC <address> <stack_param_size> <name>
-TEST(SymbolParseHelper, ParsePublicSymbolInvalid) {
- uint64_t address;
- long stack_param_size;
- char *name;
-
- // Test missing source function name.
- char kTestLine[] = "PUBLIC 1 2 ";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine, &address,
- &stack_param_size, &name));
- // Test bad address.
- char kTestLine1[] = "PUBLIC 1z 2 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine1, &address,
- &stack_param_size, &name));
- // Test large address.
- char kTestLine2[] = "PUBLIC 123123123123123123123123 2 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine2, &address,
- &stack_param_size, &name));
- // Test bad param stack size.
- char kTestLine3[] = "PUBLIC 1 z2 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine3, &address,
- &stack_param_size, &name));
- // Test large param stack size.
- char kTestLine4[] = "PUBLIC 1 123123123123123123123123123 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine4, &address,
- &stack_param_size, &name));
- // Test negative param stack size.
- char kTestLine5[] = "PUBLIC 1 -5 3";
- ASSERT_FALSE(SymbolParseHelper::ParsePublicSymbol(kTestLine5, &address,
- &stack_param_size, &name));
-}
-
-} // namespace
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/call_stack.cc b/toolkit/crashreporter/google-breakpad/src/processor/call_stack.cc
deleted file mode 100644
index 925f084690..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/call_stack.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// call_stack.cc: A call stack comprised of stack frames.
-//
-// See call_stack.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/stack_frame.h"
-
-namespace google_breakpad {
-
-CallStack::~CallStack() {
- Clear();
-}
-
-void CallStack::Clear() {
- for (vector<StackFrame *>::const_iterator iterator = frames_.begin();
- iterator != frames_.end();
- ++iterator) {
- delete *iterator;
- }
- tid_ = 0;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info-inl.h
deleted file mode 100644
index 7e7af0af93..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info-inl.h
+++ /dev/null
@@ -1,119 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// cfi_frame_info-inl.h: Definitions for cfi_frame_info.h inlined functions.
-
-#ifndef PROCESSOR_CFI_FRAME_INFO_INL_H_
-#define PROCESSOR_CFI_FRAME_INFO_INL_H_
-
-#include <string.h>
-
-namespace google_breakpad {
-
-template <typename RegisterType, class RawContextType>
-bool SimpleCFIWalker<RegisterType, RawContextType>::FindCallerRegisters(
- const MemoryRegion &memory,
- const CFIFrameInfo &cfi_frame_info,
- const RawContextType &callee_context,
- int callee_validity,
- RawContextType *caller_context,
- int *caller_validity) const {
- typedef CFIFrameInfo::RegisterValueMap<RegisterType> ValueMap;
- ValueMap callee_registers;
- ValueMap caller_registers;
- // Just for brevity.
- typename ValueMap::const_iterator caller_none = caller_registers.end();
-
- // Populate callee_registers with register values from callee_context.
- for (size_t i = 0; i < map_size_; i++) {
- const RegisterSet &r = register_map_[i];
- if (callee_validity & r.validity_flag)
- callee_registers[r.name] = callee_context.*r.context_member;
- }
-
- // Apply the rules, and see what register values they yield.
- if (!cfi_frame_info.FindCallerRegs<RegisterType>(callee_registers, memory,
- &caller_registers))
- return false;
-
- // Populate *caller_context with the values the rules placed in
- // caller_registers.
- memset(caller_context, 0xda, sizeof(*caller_context));
- *caller_validity = 0;
- for (size_t i = 0; i < map_size_; i++) {
- const RegisterSet &r = register_map_[i];
- typename ValueMap::const_iterator caller_entry;
-
- // Did the rules provide a value for this register by its name?
- caller_entry = caller_registers.find(r.name);
- if (caller_entry != caller_none) {
- caller_context->*r.context_member = caller_entry->second;
- *caller_validity |= r.validity_flag;
- continue;
- }
-
- // Did the rules provide a value for this register under its
- // alternate name?
- if (r.alternate_name) {
- caller_entry = caller_registers.find(r.alternate_name);
- if (caller_entry != caller_none) {
- caller_context->*r.context_member = caller_entry->second;
- *caller_validity |= r.validity_flag;
- continue;
- }
- }
-
- // Is this a callee-saves register? The walker assumes that these
- // still hold the caller's value if the CFI doesn't mention them.
- //
- // Note that other frame walkers may fail to recover callee-saves
- // registers; for example, the x86 "traditional" strategy only
- // recovers %eip, %esp, and %ebp, even though %ebx, %esi, and %edi
- // are callee-saves, too. It is not correct to blindly set the
- // valid bit for all callee-saves registers, without first
- // checking its validity bit in the callee.
- if (r.callee_saves && (callee_validity & r.validity_flag) != 0) {
- caller_context->*r.context_member = callee_context.*r.context_member;
- *caller_validity |= r.validity_flag;
- continue;
- }
-
- // Otherwise, the register's value is unknown.
- }
-
- return true;
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_CFI_FRAME_INFO_INL_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.cc b/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.cc
deleted file mode 100644
index 0c4af7ba84..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.cc
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// cfi_frame_info.cc: Implementation of CFIFrameInfo class.
-// See cfi_frame_info.h for details.
-
-#include "processor/cfi_frame_info.h"
-
-#include <string.h>
-
-#include <sstream>
-
-#include "common/scoped_ptr.h"
-#include "processor/postfix_evaluator-inl.h"
-
-namespace google_breakpad {
-
-#ifdef _MSC_VER
-#define strtok_r strtok_s
-#endif
-
-template<typename V>
-bool CFIFrameInfo::FindCallerRegs(const RegisterValueMap<V> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<V> *caller_registers) const {
- // If there are not rules for both .ra and .cfa in effect at this address,
- // don't use this CFI data for stack walking.
- if (cfa_rule_.empty() || ra_rule_.empty())
- return false;
-
- RegisterValueMap<V> working;
- PostfixEvaluator<V> evaluator(&working, &memory);
-
- caller_registers->clear();
-
- // First, compute the CFA.
- V cfa;
- working = registers;
- if (!evaluator.EvaluateForValue(cfa_rule_, &cfa))
- return false;
-
- // Then, compute the return address.
- V ra;
- working = registers;
- working[".cfa"] = cfa;
- if (!evaluator.EvaluateForValue(ra_rule_, &ra))
- return false;
-
- // Now, compute values for all the registers register_rules_ mentions.
- for (RuleMap::const_iterator it = register_rules_.begin();
- it != register_rules_.end(); it++) {
- V value;
- working = registers;
- working[".cfa"] = cfa;
- if (!evaluator.EvaluateForValue(it->second, &value))
- return false;
- (*caller_registers)[it->first] = value;
- }
-
- (*caller_registers)[".ra"] = ra;
- (*caller_registers)[".cfa"] = cfa;
-
- return true;
-}
-
-// Explicit instantiations for 32-bit and 64-bit architectures.
-template bool CFIFrameInfo::FindCallerRegs<uint32_t>(
- const RegisterValueMap<uint32_t> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<uint32_t> *caller_registers) const;
-template bool CFIFrameInfo::FindCallerRegs<uint64_t>(
- const RegisterValueMap<uint64_t> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<uint64_t> *caller_registers) const;
-
-string CFIFrameInfo::Serialize() const {
- std::ostringstream stream;
-
- if (!cfa_rule_.empty()) {
- stream << ".cfa: " << cfa_rule_;
- }
- if (!ra_rule_.empty()) {
- if (static_cast<std::streamoff>(stream.tellp()) != 0)
- stream << " ";
- stream << ".ra: " << ra_rule_;
- }
- for (RuleMap::const_iterator iter = register_rules_.begin();
- iter != register_rules_.end();
- ++iter) {
- if (static_cast<std::streamoff>(stream.tellp()) != 0)
- stream << " ";
- stream << iter->first << ": " << iter->second;
- }
-
- return stream.str();
-}
-
-bool CFIRuleParser::Parse(const string &rule_set) {
- size_t rule_set_len = rule_set.size();
- scoped_array<char> working_copy(new char[rule_set_len + 1]);
- memcpy(working_copy.get(), rule_set.data(), rule_set_len);
- working_copy[rule_set_len] = '\0';
-
- name_.clear();
- expression_.clear();
-
- char *cursor;
- static const char token_breaks[] = " \t\r\n";
- char *token = strtok_r(working_copy.get(), token_breaks, &cursor);
-
- for (;;) {
- // End of rule set?
- if (!token) return Report();
-
- // Register/pseudoregister name?
- size_t token_len = strlen(token);
- if (token_len >= 1 && token[token_len - 1] == ':') {
- // Names can't be empty.
- if (token_len < 2) return false;
- // If there is any pending content, report it.
- if (!name_.empty() || !expression_.empty()) {
- if (!Report()) return false;
- }
- name_.assign(token, token_len - 1);
- expression_.clear();
- } else {
- // Another expression component.
- assert(token_len > 0); // strtok_r guarantees this, I think.
- if (!expression_.empty())
- expression_ += ' ';
- expression_ += token;
- }
- token = strtok_r(NULL, token_breaks, &cursor);
- }
-}
-
-bool CFIRuleParser::Report() {
- if (name_.empty() || expression_.empty()) return false;
- if (name_ == ".cfa") handler_->CFARule(expression_);
- else if (name_ == ".ra") handler_->RARule(expression_);
- else handler_->RegisterRule(name_, expression_);
- return true;
-}
-
-void CFIFrameInfoParseHandler::CFARule(const string &expression) {
- frame_info_->SetCFARule(expression);
-}
-
-void CFIFrameInfoParseHandler::RARule(const string &expression) {
- frame_info_->SetRARule(expression);
-}
-
-void CFIFrameInfoParseHandler::RegisterRule(const string &name,
- const string &expression) {
- frame_info_->SetRegisterRule(name, expression);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.h b/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.h
deleted file mode 100644
index 90a1b3d74a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info.h
+++ /dev/null
@@ -1,275 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// cfi_frame_info.h: Define the CFIFrameInfo class, which holds the
-// set of 'STACK CFI'-derived register recovery rules that apply at a
-// given instruction.
-
-#ifndef PROCESSOR_CFI_FRAME_INFO_H_
-#define PROCESSOR_CFI_FRAME_INFO_H_
-
-#include <map>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-using std::map;
-
-class MemoryRegion;
-
-// A set of rules for recovering the calling frame's registers'
-// values, when the PC is at a given address in the current frame's
-// function. See the description of 'STACK CFI' records at:
-//
-// https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
-//
-// To prepare an instance of CFIFrameInfo for use at a given
-// instruction, first populate it with the rules from the 'STACK CFI
-// INIT' record that covers that instruction, and then apply the
-// changes given by the 'STACK CFI' records up to our instruction's
-// address. Then, use the FindCallerRegs member function to apply the
-// rules to the callee frame's register values, yielding the caller
-// frame's register values.
-class CFIFrameInfo {
- public:
- // A map from register names onto values.
- template<typename ValueType> class RegisterValueMap:
- public map<string, ValueType> { };
-
- // Set the expression for computing a call frame address, return
- // address, or register's value. At least the CFA rule and the RA
- // rule must be set before calling FindCallerRegs.
- void SetCFARule(const string &expression) { cfa_rule_ = expression; }
- void SetRARule(const string &expression) { ra_rule_ = expression; }
- void SetRegisterRule(const string &register_name, const string &expression) {
- register_rules_[register_name] = expression;
- }
-
- // Compute the values of the calling frame's registers, according to
- // this rule set. Use ValueType in expression evaluation; this
- // should be uint32_t on machines with 32-bit addresses, or
- // uint64_t on machines with 64-bit addresses.
- //
- // Return true on success, false otherwise.
- //
- // MEMORY provides access to the contents of the stack. REGISTERS is
- // a dictionary mapping the names of registers whose values are
- // known in the current frame to their values. CALLER_REGISTERS is
- // populated with the values of the recoverable registers in the
- // frame that called the current frame.
- //
- // In addition, CALLER_REGISTERS[".ra"] will be the return address,
- // and CALLER_REGISTERS[".cfa"] will be the call frame address.
- // These may be helpful in computing the caller's PC and stack
- // pointer, if their values are not explicitly specified.
- template<typename ValueType>
- bool FindCallerRegs(const RegisterValueMap<ValueType> &registers,
- const MemoryRegion &memory,
- RegisterValueMap<ValueType> *caller_registers) const;
-
- // Serialize the rules in this object into a string in the format
- // of STACK CFI records.
- string Serialize() const;
-
- private:
-
- // A map from register names onto evaluation rules.
- typedef map<string, string> RuleMap;
-
- // In this type, a "postfix expression" is an expression of the sort
- // interpreted by google_breakpad::PostfixEvaluator.
-
- // A postfix expression for computing the current frame's CFA (call
- // frame address). The CFA is a reference address for the frame that
- // remains unchanged throughout the frame's lifetime. You should
- // evaluate this expression with a dictionary initially populated
- // with the values of the current frame's known registers.
- string cfa_rule_;
-
- // The following expressions should be evaluated with a dictionary
- // initially populated with the values of the current frame's known
- // registers, and with ".cfa" set to the result of evaluating the
- // cfa_rule expression, above.
-
- // A postfix expression for computing the current frame's return
- // address.
- string ra_rule_;
-
- // For a register named REG, rules[REG] is a postfix expression
- // which leaves the value of REG in the calling frame on the top of
- // the stack. You should evaluate this expression
- RuleMap register_rules_;
-};
-
-// A parser for STACK CFI-style rule sets.
-// This may seem bureaucratic: there's no legitimate run-time reason
-// to use a parser/handler pattern for this, as it's not a likely
-// reuse boundary. But doing so makes finer-grained unit testing
-// possible.
-class CFIRuleParser {
- public:
-
- class Handler {
- public:
- Handler() { }
- virtual ~Handler() { }
-
- // The input specifies EXPRESSION as the CFA/RA computation rule.
- virtual void CFARule(const string &expression) = 0;
- virtual void RARule(const string &expression) = 0;
-
- // The input specifies EXPRESSION as the recovery rule for register NAME.
- virtual void RegisterRule(const string &name, const string &expression) = 0;
- };
-
- // Construct a parser which feeds its results to HANDLER.
- CFIRuleParser(Handler *handler) : handler_(handler) { }
-
- // Parse RULE_SET as a set of CFA computation and RA/register
- // recovery rules, as appearing in STACK CFI records. Report the
- // results of parsing by making the appropriate calls to handler_.
- // Return true if parsing was successful, false otherwise.
- bool Parse(const string &rule_set);
-
- private:
- // Report any accumulated rule to handler_
- bool Report();
-
- // The handler to which the parser reports its findings.
- Handler *handler_;
-
- // Working data.
- string name_, expression_;
-};
-
-// A handler for rule set parsing that populates a CFIFrameInfo with
-// the results.
-class CFIFrameInfoParseHandler: public CFIRuleParser::Handler {
- public:
- // Populate FRAME_INFO with the results of parsing.
- CFIFrameInfoParseHandler(CFIFrameInfo *frame_info)
- : frame_info_(frame_info) { }
-
- void CFARule(const string &expression);
- void RARule(const string &expression);
- void RegisterRule(const string &name, const string &expression);
-
- private:
- CFIFrameInfo *frame_info_;
-};
-
-// A utility class template for simple 'STACK CFI'-driven stack walkers.
-// Given a CFIFrameInfo instance, a table describing the architecture's
-// register set, and a context holding the last frame's registers, an
-// instance of this class can populate a new context with the caller's
-// registers.
-//
-// This class template doesn't use any internal knowledge of CFIFrameInfo
-// or the other stack walking structures; it just uses the public interface
-// of CFIFrameInfo to do the usual things. But the logic it handles should
-// be common to many different architectures' stack walkers, so wrapping it
-// up in a class should allow the walkers to share code.
-//
-// RegisterType should be the type of this architecture's registers, either
-// uint32_t or uint64_t. RawContextType should be the raw context
-// structure type for this architecture.
-template <typename RegisterType, class RawContextType>
-class SimpleCFIWalker {
- public:
- // A structure describing one architecture register.
- struct RegisterSet {
- // The register name, as it appears in STACK CFI rules.
- const char *name;
-
- // An alternate name that the register's value might be found
- // under in a register value dictionary, or NULL. When generating
- // names, prefer NAME to this value. It's common to list ".cfa" as
- // an alternative name for the stack pointer, and ".ra" as an
- // alternative name for the instruction pointer.
- const char *alternate_name;
-
- // True if the callee is expected to preserve the value of this
- // register. If this flag is true for some register R, and the STACK
- // CFI records provide no rule to recover R, then SimpleCFIWalker
- // assumes that the callee has not changed R's value, and the caller's
- // value for R is that currently in the callee's context.
- bool callee_saves;
-
- // The ContextValidity flag representing the register's presence.
- int validity_flag;
-
- // A pointer to the RawContextType member that holds the
- // register's value.
- RegisterType RawContextType::*context_member;
- };
-
- // Create a simple CFI-based frame walker, given a description of the
- // architecture's register set. REGISTER_MAP is an array of
- // RegisterSet structures; MAP_SIZE is the number of elements in the
- // array.
- SimpleCFIWalker(const RegisterSet *register_map, size_t map_size)
- : register_map_(register_map), map_size_(map_size) { }
-
- // Compute the calling frame's raw context given the callee's raw
- // context.
- //
- // Given:
- //
- // - MEMORY, holding the stack's contents,
- // - CFI_FRAME_INFO, describing the called function,
- // - CALLEE_CONTEXT, holding the called frame's registers, and
- // - CALLEE_VALIDITY, indicating which registers in CALLEE_CONTEXT are valid,
- //
- // fill in CALLER_CONTEXT with the caller's register values, and set
- // CALLER_VALIDITY to indicate which registers are valid in
- // CALLER_CONTEXT. Return true on success, or false on failure.
- bool FindCallerRegisters(const MemoryRegion &memory,
- const CFIFrameInfo &cfi_frame_info,
- const RawContextType &callee_context,
- int callee_validity,
- RawContextType *caller_context,
- int *caller_validity) const;
-
- private:
- const RegisterSet *register_map_;
- size_t map_size_;
-};
-
-} // namespace google_breakpad
-
-#include "cfi_frame_info-inl.h"
-
-#endif // PROCESSOR_CFI_FRAME_INFO_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info_unittest.cc
deleted file mode 100644
index 542b28492e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/cfi_frame_info_unittest.cc
+++ /dev/null
@@ -1,546 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// cfi_frame_info_unittest.cc: Unit tests for CFIFrameInfo,
-// CFIRuleParser, CFIFrameInfoParseHandler, and SimpleCFIWalker.
-
-#include <string.h>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "processor/cfi_frame_info.h"
-#include "google_breakpad/processor/memory_region.h"
-
-using google_breakpad::CFIFrameInfo;
-using google_breakpad::CFIFrameInfoParseHandler;
-using google_breakpad::CFIRuleParser;
-using google_breakpad::MemoryRegion;
-using google_breakpad::SimpleCFIWalker;
-using testing::_;
-using testing::A;
-using testing::AtMost;
-using testing::DoAll;
-using testing::Return;
-using testing::SetArgumentPointee;
-using testing::Test;
-
-class MockMemoryRegion: public MemoryRegion {
- public:
- MOCK_CONST_METHOD0(GetBase, uint64_t());
- MOCK_CONST_METHOD0(GetSize, uint32_t());
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint8_t *));
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint16_t *));
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint32_t *));
- MOCK_CONST_METHOD2(GetMemoryAtAddress, bool(uint64_t, uint64_t *));
- MOCK_CONST_METHOD0(Print, void());
-};
-
-// Handy definitions for all tests.
-struct CFIFixture {
-
- // Set up the mock memory object to expect no references.
- void ExpectNoMemoryReferences() {
- EXPECT_CALL(memory, GetBase()).Times(0);
- EXPECT_CALL(memory, GetSize()).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint8_t *>())).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint16_t *>())).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint32_t *>())).Times(0);
- EXPECT_CALL(memory, GetMemoryAtAddress(_, A<uint64_t *>())).Times(0);
- }
-
- CFIFrameInfo cfi;
- MockMemoryRegion memory;
- CFIFrameInfo::RegisterValueMap<uint64_t> registers, caller_registers;
-};
-
-class Simple: public CFIFixture, public Test { };
-
-// FindCallerRegs should fail if no .cfa rule is provided.
-TEST_F(Simple, NoCFA) {
- ExpectNoMemoryReferences();
-
- cfi.SetRARule("0");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(".ra: 0", cfi.Serialize());
-}
-
-// FindCallerRegs should fail if no .ra rule is provided.
-TEST_F(Simple, NoRA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("0");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(".cfa: 0", cfi.Serialize());
-}
-
-TEST_F(Simple, SetCFAAndRARule) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("330903416631436410");
- cfi.SetRARule("5870666104170902211");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(2U, caller_registers.size());
- ASSERT_EQ(330903416631436410ULL, caller_registers[".cfa"]);
- ASSERT_EQ(5870666104170902211ULL, caller_registers[".ra"]);
-
- ASSERT_EQ(".cfa: 330903416631436410 .ra: 5870666104170902211",
- cfi.Serialize());
-}
-
-TEST_F(Simple, SetManyRules) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("$temp1 68737028 = $temp2 61072337 = $temp1 $temp2 -");
- cfi.SetRARule(".cfa 99804755 +");
- cfi.SetRegisterRule("register1", ".cfa 54370437 *");
- cfi.SetRegisterRule("vodkathumbscrewingly", "24076308 .cfa +");
- cfi.SetRegisterRule("pubvexingfjordschmaltzy", ".cfa 29801007 -");
- cfi.SetRegisterRule("uncopyrightables", "92642917 .cfa /");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(6U, caller_registers.size());
- ASSERT_EQ(7664691U, caller_registers[".cfa"]);
- ASSERT_EQ(107469446U, caller_registers[".ra"]);
- ASSERT_EQ(416732599139967ULL, caller_registers["register1"]);
- ASSERT_EQ(31740999U, caller_registers["vodkathumbscrewingly"]);
- ASSERT_EQ(-22136316ULL, caller_registers["pubvexingfjordschmaltzy"]);
- ASSERT_EQ(12U, caller_registers["uncopyrightables"]);
- ASSERT_EQ(".cfa: $temp1 68737028 = $temp2 61072337 = $temp1 $temp2 - "
- ".ra: .cfa 99804755 + "
- "pubvexingfjordschmaltzy: .cfa 29801007 - "
- "register1: .cfa 54370437 * "
- "uncopyrightables: 92642917 .cfa / "
- "vodkathumbscrewingly: 24076308 .cfa +",
- cfi.Serialize());
-}
-
-TEST_F(Simple, RulesOverride) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("330903416631436410");
- cfi.SetRARule("5870666104170902211");
- cfi.SetCFARule("2828089117179001");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(2U, caller_registers.size());
- ASSERT_EQ(2828089117179001ULL, caller_registers[".cfa"]);
- ASSERT_EQ(5870666104170902211ULL, caller_registers[".ra"]);
- ASSERT_EQ(".cfa: 2828089117179001 .ra: 5870666104170902211",
- cfi.Serialize());
-}
-
-class Scope: public CFIFixture, public Test { };
-
-// There should be no value for .cfa in scope when evaluating the CFA rule.
-TEST_F(Scope, CFALacksCFA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule(".cfa");
- cfi.SetRARule("0");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
-}
-
-// There should be no value for .ra in scope when evaluating the CFA rule.
-TEST_F(Scope, CFALacksRA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule(".ra");
- cfi.SetRARule("0");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
-}
-
-// The current frame's registers should be in scope when evaluating
-// the CFA rule.
-TEST_F(Scope, CFASeesCurrentRegs) {
- ExpectNoMemoryReferences();
-
- registers[".baraminology"] = 0x06a7bc63e4f13893ULL;
- registers[".ornithorhynchus"] = 0x5e0bf850bafce9d2ULL;
- cfi.SetCFARule(".baraminology .ornithorhynchus +");
- cfi.SetRARule("0");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(2U, caller_registers.size());
- ASSERT_EQ(0x06a7bc63e4f13893ULL + 0x5e0bf850bafce9d2ULL,
- caller_registers[".cfa"]);
-}
-
-// .cfa should be in scope in the return address expression.
-TEST_F(Scope, RASeesCFA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("48364076");
- cfi.SetRARule(".cfa");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(2U, caller_registers.size());
- ASSERT_EQ(48364076U, caller_registers[".ra"]);
-}
-
-// There should be no value for .ra in scope when evaluating the CFA rule.
-TEST_F(Scope, RALacksRA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("0");
- cfi.SetRARule(".ra");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
-}
-
-// The current frame's registers should be in scope in the return
-// address expression.
-TEST_F(Scope, RASeesCurrentRegs) {
- ExpectNoMemoryReferences();
-
- registers["noachian"] = 0x54dc4a5d8e5eb503ULL;
- cfi.SetCFARule("10359370");
- cfi.SetRARule("noachian");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(2U, caller_registers.size());
- ASSERT_EQ(0x54dc4a5d8e5eb503ULL, caller_registers[".ra"]);
-}
-
-// .cfa should be in scope for register rules.
-TEST_F(Scope, RegistersSeeCFA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("6515179");
- cfi.SetRARule(".cfa");
- cfi.SetRegisterRule("rogerian", ".cfa");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(3U, caller_registers.size());
- ASSERT_EQ(6515179U, caller_registers["rogerian"]);
-}
-
-// The return address should not be in scope for register rules.
-TEST_F(Scope, RegsLackRA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("42740329");
- cfi.SetRARule("27045204");
- cfi.SetRegisterRule("$r1", ".ra");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
-}
-
-// Register rules can see the current frame's register values.
-TEST_F(Scope, RegsSeeRegs) {
- ExpectNoMemoryReferences();
-
- registers["$r1"] = 0x6ed3582c4bedb9adULL;
- registers["$r2"] = 0xd27d9e742b8df6d0ULL;
- cfi.SetCFARule("88239303");
- cfi.SetRARule("30503835");
- cfi.SetRegisterRule("$r1", "$r1 42175211 = $r2");
- cfi.SetRegisterRule("$r2", "$r2 21357221 = $r1");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(4U, caller_registers.size());
- ASSERT_EQ(0xd27d9e742b8df6d0ULL, caller_registers["$r1"]);
- ASSERT_EQ(0x6ed3582c4bedb9adULL, caller_registers["$r2"]);
-}
-
-// Each rule's temporaries are separate.
-TEST_F(Scope, SeparateTempsRA) {
- ExpectNoMemoryReferences();
-
- cfi.SetCFARule("$temp1 76569129 = $temp1");
- cfi.SetRARule("0");
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
-
- cfi.SetCFARule("$temp1 76569129 = $temp1");
- cfi.SetRARule("$temp1");
- ASSERT_FALSE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
-}
-
-class MockCFIRuleParserHandler: public CFIRuleParser::Handler {
- public:
- MOCK_METHOD1(CFARule, void(const string &));
- MOCK_METHOD1(RARule, void(const string &));
- MOCK_METHOD2(RegisterRule, void(const string &, const string &));
-};
-
-// A fixture class for testing CFIRuleParser.
-class CFIParserFixture {
- public:
- CFIParserFixture() : parser(&mock_handler) {
- // Expect no parsing results to be reported to mock_handler. Individual
- // tests can override this.
- EXPECT_CALL(mock_handler, CFARule(_)).Times(0);
- EXPECT_CALL(mock_handler, RARule(_)).Times(0);
- EXPECT_CALL(mock_handler, RegisterRule(_, _)).Times(0);
- }
-
- MockCFIRuleParserHandler mock_handler;
- CFIRuleParser parser;
-};
-
-class Parser: public CFIParserFixture, public Test { };
-
-TEST_F(Parser, Empty) {
- EXPECT_FALSE(parser.Parse(""));
-}
-
-TEST_F(Parser, LoneColon) {
- EXPECT_FALSE(parser.Parse(":"));
-}
-
-TEST_F(Parser, CFANoExpr) {
- EXPECT_FALSE(parser.Parse(".cfa:"));
-}
-
-TEST_F(Parser, CFANoColonNoExpr) {
- EXPECT_FALSE(parser.Parse(".cfa"));
-}
-
-TEST_F(Parser, RANoExpr) {
- EXPECT_FALSE(parser.Parse(".ra:"));
-}
-
-TEST_F(Parser, RANoColonNoExpr) {
- EXPECT_FALSE(parser.Parse(".ra"));
-}
-
-TEST_F(Parser, RegNoExpr) {
- EXPECT_FALSE(parser.Parse("reg:"));
-}
-
-TEST_F(Parser, NoName) {
- EXPECT_FALSE(parser.Parse("expr"));
-}
-
-TEST_F(Parser, NoNameTwo) {
- EXPECT_FALSE(parser.Parse("expr1 expr2"));
-}
-
-TEST_F(Parser, StartsWithExpr) {
- EXPECT_FALSE(parser.Parse("expr1 reg: expr2"));
-}
-
-TEST_F(Parser, CFA) {
- EXPECT_CALL(mock_handler, CFARule("spleen")).WillOnce(Return());
- EXPECT_TRUE(parser.Parse(".cfa: spleen"));
-}
-
-TEST_F(Parser, RA) {
- EXPECT_CALL(mock_handler, RARule("notoriety")).WillOnce(Return());
- EXPECT_TRUE(parser.Parse(".ra: notoriety"));
-}
-
-TEST_F(Parser, Reg) {
- EXPECT_CALL(mock_handler, RegisterRule("nemo", "mellifluous"))
- .WillOnce(Return());
- EXPECT_TRUE(parser.Parse("nemo: mellifluous"));
-}
-
-TEST_F(Parser, CFARARegs) {
- EXPECT_CALL(mock_handler, CFARule("cfa expression")).WillOnce(Return());
- EXPECT_CALL(mock_handler, RARule("ra expression")).WillOnce(Return());
- EXPECT_CALL(mock_handler, RegisterRule("galba", "praetorian"))
- .WillOnce(Return());
- EXPECT_CALL(mock_handler, RegisterRule("otho", "vitellius"))
- .WillOnce(Return());
- EXPECT_TRUE(parser.Parse(".cfa: cfa expression .ra: ra expression "
- "galba: praetorian otho: vitellius"));
-}
-
-TEST_F(Parser, Whitespace) {
- EXPECT_CALL(mock_handler, RegisterRule("r1", "r1 expression"))
- .WillOnce(Return());
- EXPECT_CALL(mock_handler, RegisterRule("r2", "r2 expression"))
- .WillOnce(Return());
- EXPECT_TRUE(parser.Parse(" r1:\tr1\nexpression \tr2:\t\rr2\r\n "
- "expression \n"));
-}
-
-TEST_F(Parser, WhitespaceLoneColon) {
- EXPECT_FALSE(parser.Parse(" \n:\t "));
-}
-
-TEST_F(Parser, EmptyName) {
- EXPECT_CALL(mock_handler, RegisterRule("reg", _))
- .Times(AtMost(1))
- .WillRepeatedly(Return());
- EXPECT_FALSE(parser.Parse("reg: expr1 : expr2"));
-}
-
-TEST_F(Parser, RuleLoneColon) {
- EXPECT_CALL(mock_handler, RegisterRule("r1", "expr"))
- .Times(AtMost(1))
- .WillRepeatedly(Return());
- EXPECT_FALSE(parser.Parse(" r1: expr :"));
-}
-
-TEST_F(Parser, RegNoExprRule) {
- EXPECT_CALL(mock_handler, RegisterRule("r1", "expr"))
- .Times(AtMost(1))
- .WillRepeatedly(Return());
- EXPECT_FALSE(parser.Parse("r0: r1: expr"));
-}
-
-class ParseHandlerFixture: public CFIFixture {
- public:
- ParseHandlerFixture() : CFIFixture(), handler(&cfi) { }
- CFIFrameInfoParseHandler handler;
-};
-
-class ParseHandler: public ParseHandlerFixture, public Test { };
-
-TEST_F(ParseHandler, CFARARule) {
- handler.CFARule("reg-for-cfa");
- handler.RARule("reg-for-ra");
- registers["reg-for-cfa"] = 0x268a9a4a3821a797ULL;
- registers["reg-for-ra"] = 0x6301b475b8b91c02ULL;
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(0x268a9a4a3821a797ULL, caller_registers[".cfa"]);
- ASSERT_EQ(0x6301b475b8b91c02ULL, caller_registers[".ra"]);
-}
-
-TEST_F(ParseHandler, RegisterRules) {
- handler.CFARule("reg-for-cfa");
- handler.RARule("reg-for-ra");
- handler.RegisterRule("reg1", "reg-for-reg1");
- handler.RegisterRule("reg2", "reg-for-reg2");
- registers["reg-for-cfa"] = 0x268a9a4a3821a797ULL;
- registers["reg-for-ra"] = 0x6301b475b8b91c02ULL;
- registers["reg-for-reg1"] = 0x06cde8e2ff062481ULL;
- registers["reg-for-reg2"] = 0xff0c4f76403173e2ULL;
- ASSERT_TRUE(cfi.FindCallerRegs<uint64_t>(registers, memory,
- &caller_registers));
- ASSERT_EQ(0x268a9a4a3821a797ULL, caller_registers[".cfa"]);
- ASSERT_EQ(0x6301b475b8b91c02ULL, caller_registers[".ra"]);
- ASSERT_EQ(0x06cde8e2ff062481ULL, caller_registers["reg1"]);
- ASSERT_EQ(0xff0c4f76403173e2ULL, caller_registers["reg2"]);
-}
-
-struct SimpleCFIWalkerFixture {
- struct RawContext {
- uint64_t r0, r1, r2, r3, r4, sp, pc;
- };
- enum Validity {
- R0_VALID = 0x01,
- R1_VALID = 0x02,
- R2_VALID = 0x04,
- R3_VALID = 0x08,
- R4_VALID = 0x10,
- SP_VALID = 0x20,
- PC_VALID = 0x40
- };
- typedef SimpleCFIWalker<uint64_t, RawContext> CFIWalker;
-
- SimpleCFIWalkerFixture()
- : walker(register_map,
- sizeof(register_map) / sizeof(register_map[0])) { }
-
- static CFIWalker::RegisterSet register_map[7];
- CFIFrameInfo call_frame_info;
- CFIWalker walker;
- MockMemoryRegion memory;
- RawContext callee_context, caller_context;
-};
-
-SimpleCFIWalkerFixture::CFIWalker::RegisterSet
-SimpleCFIWalkerFixture::register_map[7] = {
- { "r0", NULL, true, R0_VALID, &RawContext::r0 },
- { "r1", NULL, true, R1_VALID, &RawContext::r1 },
- { "r2", NULL, false, R2_VALID, &RawContext::r2 },
- { "r3", NULL, false, R3_VALID, &RawContext::r3 },
- { "r4", NULL, true, R4_VALID, &RawContext::r4 },
- { "sp", ".cfa", true, SP_VALID, &RawContext::sp },
- { "pc", ".ra", true, PC_VALID, &RawContext::pc },
-};
-
-class SimpleWalker: public SimpleCFIWalkerFixture, public Test { };
-
-TEST_F(SimpleWalker, Walk) {
- // Stack_top is the current stack pointer, pointing to the lowest
- // address of a frame that looks like this (all 64-bit words):
- //
- // sp -> saved r0
- // garbage
- // return address
- // cfa ->
- //
- // r0 has been saved on the stack.
- // r1 has been saved in r2.
- // r2 and r3 are not recoverable.
- // r4 is not recoverable, even though it is a callee-saves register.
- // Some earlier frame's unwinder must have failed to recover it.
-
- uint64_t stack_top = 0x83254944b20d5512ULL;
-
- // Saved r0.
- EXPECT_CALL(memory,
- GetMemoryAtAddress(stack_top, A<uint64_t *>()))
- .WillRepeatedly(DoAll(SetArgumentPointee<1>(0xdc1975eba8602302ULL),
- Return(true)));
- // Saved return address.
- EXPECT_CALL(memory,
- GetMemoryAtAddress(stack_top + 16, A<uint64_t *>()))
- .WillRepeatedly(DoAll(SetArgumentPointee<1>(0xba5ad6d9acce28deULL),
- Return(true)));
-
- call_frame_info.SetCFARule("sp 24 +");
- call_frame_info.SetRARule(".cfa 8 - ^");
- call_frame_info.SetRegisterRule("r0", ".cfa 24 - ^");
- call_frame_info.SetRegisterRule("r1", "r2");
-
- callee_context.r0 = 0x94e030ca79edd119ULL;
- callee_context.r1 = 0x937b4d7e95ce52d9ULL;
- callee_context.r2 = 0x5fe0027416b8b62aULL; // caller's r1
- // callee_context.r3 is not valid in callee.
- // callee_context.r4 is not valid in callee.
- callee_context.sp = stack_top;
- callee_context.pc = 0x25b21b224311d280ULL;
- int callee_validity = R0_VALID | R1_VALID | R2_VALID | SP_VALID | PC_VALID;
-
- memset(&caller_context, 0, sizeof(caller_context));
-
- int caller_validity;
- EXPECT_TRUE(walker.FindCallerRegisters(memory, call_frame_info,
- callee_context, callee_validity,
- &caller_context, &caller_validity));
- EXPECT_EQ(R0_VALID | R1_VALID | SP_VALID | PC_VALID, caller_validity);
- EXPECT_EQ(0xdc1975eba8602302ULL, caller_context.r0);
- EXPECT_EQ(0x5fe0027416b8b62aULL, caller_context.r1);
- EXPECT_EQ(stack_top + 24, caller_context.sp);
- EXPECT_EQ(0xba5ad6d9acce28deULL, caller_context.pc);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map-inl.h
deleted file mode 100644
index 4c0ad41f94..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map-inl.h
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// contained_range_map-inl.h: Hierarchically-organized range map implementation.
-//
-// See contained_range_map.h for documentation.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_CONTAINED_RANGE_MAP_INL_H__
-#define PROCESSOR_CONTAINED_RANGE_MAP_INL_H__
-
-#include "processor/contained_range_map.h"
-
-#include <assert.h>
-
-#include "processor/logging.h"
-
-
-namespace google_breakpad {
-
-
-template<typename AddressType, typename EntryType>
-ContainedRangeMap<AddressType, EntryType>::~ContainedRangeMap() {
- // Clear frees the children pointed to by the map, and frees the map itself.
- Clear();
-}
-
-
-template<typename AddressType, typename EntryType>
-bool ContainedRangeMap<AddressType, EntryType>::StoreRange(
- const AddressType &base, const AddressType &size, const EntryType &entry) {
- AddressType high = base + size - 1;
-
- // Check for undersize or overflow.
- if (size <= 0 || high < base) {
- //TODO(nealsid) We are commenting this out in order to prevent
- // excessive logging. We plan to move to better logging as this
- // failure happens quite often and is expected(see comment in
- // basic_source_line_resolver.cc:671).
- // BPLOG(INFO) << "StoreRange failed, " << HexString(base) << "+"
- // << HexString(size) << ", " << HexString(high);
- return false;
- }
-
- if (!map_)
- map_ = new AddressToRangeMap();
-
- MapIterator iterator_base = map_->lower_bound(base);
- MapIterator iterator_high = map_->lower_bound(high);
- MapIterator iterator_end = map_->end();
-
- if (iterator_base == iterator_high && iterator_base != iterator_end &&
- base >= iterator_base->second->base_) {
- // The new range is entirely within an existing child range.
-
- // If the new range's geometry is exactly equal to an existing child
- // range's, it violates the containment rules, and an attempt to store
- // it must fail. iterator_base->first contains the key, which was the
- // containing child's high address.
- if (iterator_base->second->base_ == base && iterator_base->first == high) {
- // TODO(nealsid): See the TODO above on why this is commented out.
-// BPLOG(INFO) << "StoreRange failed, identical range is already "
-// "present: " << HexString(base) << "+" << HexString(size);
- return false;
- }
-
- // Pass the new range on to the child to attempt to store.
- return iterator_base->second->StoreRange(base, size, entry);
- }
-
- // iterator_high might refer to an irrelevant range: one whose base address
- // is higher than the new range's high address. Set contains_high to true
- // only if iterator_high refers to a range that is at least partially
- // within the new range.
- bool contains_high = iterator_high != iterator_end &&
- high >= iterator_high->second->base_;
-
- // If the new range encompasses any existing child ranges, it must do so
- // fully. Partial containment isn't allowed.
- if ((iterator_base != iterator_end && base > iterator_base->second->base_) ||
- (contains_high && high < iterator_high->first)) {
- // TODO(mmentovai): Some symbol files will trip this check frequently
- // on STACK lines. Too many messages will be produced. These are more
- // suitable for a DEBUG channel than an INFO channel.
- // BPLOG(INFO) << "StoreRange failed, new range partially contains "
- // "existing range: " << HexString(base) << "+" <<
- // HexString(size);
- return false;
- }
-
- // When copying and erasing contained ranges, the "end" iterator needs to
- // point one past the last item of the range to copy. If contains_high is
- // false, the iterator's already in the right place; the increment is safe
- // because contains_high can't be true if iterator_high == iterator_end.
- if (contains_high)
- ++iterator_high;
-
- // Optimization: if the iterators are equal, no child ranges would be
- // moved. Create the new child range with a NULL map to conserve space
- // in leaf nodes, of which there will be many.
- AddressToRangeMap *child_map = NULL;
-
- if (iterator_base != iterator_high) {
- // The children of this range that are contained by the new range must
- // be transferred over to the new range. Create the new child range map
- // and copy the pointers to range maps it should contain into it.
- child_map = new AddressToRangeMap(iterator_base, iterator_high);
-
- // Remove the copied child pointers from this range's map of children.
- map_->erase(iterator_base, iterator_high);
- }
-
- // Store the new range in the map by its high address. Any children that
- // the new child range contains were formerly children of this range but
- // are now this range's grandchildren. Ownership of these is transferred
- // to the new child range.
- map_->insert(MapValue(high,
- new ContainedRangeMap(base, entry, child_map)));
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-bool ContainedRangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, EntryType *entry) const {
- BPLOG_IF(ERROR, !entry) << "ContainedRangeMap::RetrieveRange requires "
- "|entry|";
- assert(entry);
-
- // If nothing was ever stored, then there's nothing to retrieve.
- if (!map_)
- return false;
-
- // Get an iterator to the child range whose high address is equal to or
- // greater than the supplied address. If the supplied address is higher
- // than all of the high addresses in the range, then this range does not
- // contain a child at address, so return false. If the supplied address
- // is lower than the base address of the child range, then it is not within
- // the child range, so return false.
- MapConstIterator iterator = map_->lower_bound(address);
- if (iterator == map_->end() || address < iterator->second->base_)
- return false;
-
- // The child in iterator->second contains the specified address. Find out
- // if it has a more-specific descendant that also contains it. If it does,
- // it will set |entry| appropriately. If not, set |entry| to the child.
- if (!iterator->second->RetrieveRange(address, entry))
- *entry = iterator->second->entry_;
-
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-void ContainedRangeMap<AddressType, EntryType>::Clear() {
- if (map_) {
- MapConstIterator end = map_->end();
- for (MapConstIterator child = map_->begin(); child != end; ++child)
- delete child->second;
-
- delete map_;
- map_ = NULL;
- }
-}
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_CONTAINED_RANGE_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map.h b/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map.h
deleted file mode 100644
index 1015ae8cfd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map.h
+++ /dev/null
@@ -1,150 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// contained_range_map.h: Hierarchically-organized range maps.
-//
-// A contained range map is similar to a standard range map, except it allows
-// objects to be organized hierarchically. A contained range map allows
-// objects to contain other objects. It is not sensitive to the order that
-// objects are added to the map: larger, more general, containing objects
-// may be added either before or after smaller, more specific, contained
-// ones.
-//
-// Contained range maps guarantee that each object may only contain smaller
-// objects than itself, and that a parent object may only contain child
-// objects located entirely within the parent's address space. Attempts
-// to introduce objects (via StoreRange) that violate these rules will fail.
-// Retrieval (via RetrieveRange) always returns the most specific (smallest)
-// object that contains the address being queried. Note that while it is
-// not possible to insert two objects into a map that have exactly the same
-// geometry (base address and size), it is possible to completely mask a
-// larger object by inserting smaller objects that entirely fill the larger
-// object's address space.
-//
-// Internally, contained range maps are implemented as a tree. Each tree
-// node except for the root node describes an object in the map. Each node
-// maintains its list of children in a map similar to a standard range map,
-// keyed by the highest address that each child occupies. Each node's
-// children occupy address ranges entirely within the node. The root node
-// is the only node directly accessible to the user, and represents the
-// entire address space.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_CONTAINED_RANGE_MAP_H__
-#define PROCESSOR_CONTAINED_RANGE_MAP_H__
-
-
-#include <map>
-
-
-namespace google_breakpad {
-
-// Forward declarations (for later friend declarations of specialized template).
-template<class, class> class ContainedRangeMapSerializer;
-
-template<typename AddressType, typename EntryType>
-class ContainedRangeMap {
- public:
- // The default constructor creates a ContainedRangeMap with no geometry
- // and no entry, and as such is only suitable for the root node of a
- // ContainedRangeMap tree.
- ContainedRangeMap() : base_(), entry_(), map_(NULL) {}
-
- ~ContainedRangeMap();
-
- // Inserts a range into the map. If the new range is encompassed by
- // an existing child range, the new range is passed into the child range's
- // StoreRange method. If the new range encompasses any existing child
- // ranges, those child ranges are moved to the new range, becoming
- // grandchildren of this ContainedRangeMap. Returns false for a
- // parameter error, or if the ContainedRangeMap hierarchy guarantees
- // would be violated.
- bool StoreRange(const AddressType &base,
- const AddressType &size,
- const EntryType &entry);
-
- // Retrieves the most specific (smallest) descendant range encompassing
- // the specified address. This method will only return entries held by
- // child ranges, and not the entry contained by |this|. This is necessary
- // to support a sparsely-populated root range. If no descendant range
- // encompasses the address, returns false.
- bool RetrieveRange(const AddressType &address, EntryType *entry) const;
-
- // Removes all children. Note that Clear only removes descendants,
- // leaving the node on which it is called intact. Because the only
- // meaningful things contained by a root node are descendants, this
- // is sufficient to restore an entire ContainedRangeMap to its initial
- // empty state when called on the root node.
- void Clear();
-
- private:
- friend class ContainedRangeMapSerializer<AddressType, EntryType>;
- friend class ModuleComparer;
-
- // AddressToRangeMap stores pointers. This makes reparenting simpler in
- // StoreRange, because it doesn't need to copy entire objects.
- typedef std::map<AddressType, ContainedRangeMap *> AddressToRangeMap;
- typedef typename AddressToRangeMap::const_iterator MapConstIterator;
- typedef typename AddressToRangeMap::iterator MapIterator;
- typedef typename AddressToRangeMap::value_type MapValue;
-
- // Creates a new ContainedRangeMap with the specified base address, entry,
- // and initial child map, which may be NULL. This is only used internally
- // by ContainedRangeMap when it creates a new child.
- ContainedRangeMap(const AddressType &base, const EntryType &entry,
- AddressToRangeMap *map)
- : base_(base), entry_(entry), map_(map) {}
-
- // The base address of this range. The high address does not need to
- // be stored, because it is used as the key to an object in its parent's
- // map, and all ContainedRangeMaps except for the root range are contained
- // within maps. The root range does not actually contain an entry, so its
- // base_ field is meaningless, and the fact that it has no parent and thus
- // no key is unimportant. For this reason, the base_ field should only be
- // is accessed on child ContainedRangeMap objects, and never on |this|.
- const AddressType base_;
-
- // The entry corresponding to this range. The root range does not
- // actually contain an entry, so its entry_ field is meaningless. For
- // this reason, the entry_ field should only be accessed on child
- // ContainedRangeMap objects, and never on |this|.
- const EntryType entry_;
-
- // The map containing child ranges, keyed by each child range's high
- // address. This is a pointer to avoid allocating map structures for
- // leaf nodes, where they are not needed.
- AddressToRangeMap *map_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_CONTAINED_RANGE_MAP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map_unittest.cc
deleted file mode 100644
index e5910da0d5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/contained_range_map_unittest.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// contained_range_map_unittest.cc: Unit tests for ContainedRangeMap
-//
-// Author: Mark Mentovai
-
-#include <stdio.h>
-
-#include "processor/contained_range_map-inl.h"
-
-#include "processor/logging.h"
-
-
-#define ASSERT_TRUE(condition) \
- if (!(condition)) { \
- fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \
- return false; \
- }
-
-#define ASSERT_FALSE(condition) ASSERT_TRUE(!(condition))
-
-
-namespace {
-
-
-using google_breakpad::ContainedRangeMap;
-
-
-static bool RunTests() {
- ContainedRangeMap<unsigned int, int> crm;
-
- // First, do the StoreRange tests. This validates the containment
- // rules.
- ASSERT_TRUE (crm.StoreRange(10, 10, 1));
- ASSERT_FALSE(crm.StoreRange(10, 10, 2)); // exactly equal to 1
- ASSERT_FALSE(crm.StoreRange(11, 10, 3)); // begins inside 1 and extends up
- ASSERT_FALSE(crm.StoreRange( 9, 10, 4)); // begins below 1 and ends inside
- ASSERT_TRUE (crm.StoreRange(11, 9, 5)); // contained by existing
- ASSERT_TRUE (crm.StoreRange(12, 7, 6));
- ASSERT_TRUE (crm.StoreRange( 9, 12, 7)); // contains existing
- ASSERT_TRUE (crm.StoreRange( 9, 13, 8));
- ASSERT_TRUE (crm.StoreRange( 8, 14, 9));
- ASSERT_TRUE (crm.StoreRange(30, 3, 10));
- ASSERT_TRUE (crm.StoreRange(33, 3, 11));
- ASSERT_TRUE (crm.StoreRange(30, 6, 12)); // storable but totally masked
- ASSERT_TRUE (crm.StoreRange(40, 8, 13)); // will be totally masked
- ASSERT_TRUE (crm.StoreRange(40, 4, 14));
- ASSERT_TRUE (crm.StoreRange(44, 4, 15));
- ASSERT_FALSE(crm.StoreRange(32, 10, 16)); // begins in #10, ends in #14
- ASSERT_FALSE(crm.StoreRange(50, 0, 17)); // zero length
- ASSERT_TRUE (crm.StoreRange(50, 10, 18));
- ASSERT_TRUE (crm.StoreRange(50, 1, 19));
- ASSERT_TRUE (crm.StoreRange(59, 1, 20));
- ASSERT_TRUE (crm.StoreRange(60, 1, 21));
- ASSERT_TRUE (crm.StoreRange(69, 1, 22));
- ASSERT_TRUE (crm.StoreRange(60, 10, 23));
- ASSERT_TRUE (crm.StoreRange(68, 1, 24));
- ASSERT_TRUE (crm.StoreRange(61, 1, 25));
- ASSERT_TRUE (crm.StoreRange(61, 8, 26));
- ASSERT_FALSE(crm.StoreRange(59, 9, 27));
- ASSERT_FALSE(crm.StoreRange(59, 10, 28));
- ASSERT_FALSE(crm.StoreRange(59, 11, 29));
- ASSERT_TRUE (crm.StoreRange(70, 10, 30));
- ASSERT_TRUE (crm.StoreRange(74, 2, 31));
- ASSERT_TRUE (crm.StoreRange(77, 2, 32));
- ASSERT_FALSE(crm.StoreRange(72, 6, 33));
- ASSERT_TRUE (crm.StoreRange(80, 3, 34));
- ASSERT_TRUE (crm.StoreRange(81, 1, 35));
- ASSERT_TRUE (crm.StoreRange(82, 1, 36));
- ASSERT_TRUE (crm.StoreRange(83, 3, 37));
- ASSERT_TRUE (crm.StoreRange(84, 1, 38));
- ASSERT_TRUE (crm.StoreRange(83, 1, 39));
- ASSERT_TRUE (crm.StoreRange(86, 5, 40));
- ASSERT_TRUE (crm.StoreRange(88, 1, 41));
- ASSERT_TRUE (crm.StoreRange(90, 1, 42));
- ASSERT_TRUE (crm.StoreRange(86, 1, 43));
- ASSERT_TRUE (crm.StoreRange(87, 1, 44));
- ASSERT_TRUE (crm.StoreRange(89, 1, 45));
- ASSERT_TRUE (crm.StoreRange(87, 4, 46));
- ASSERT_TRUE (crm.StoreRange(87, 3, 47));
- ASSERT_FALSE(crm.StoreRange(86, 2, 48));
-
- // Each element in test_data contains the expected result when calling
- // RetrieveRange on an address.
- const int test_data[] = {
- 0, // 0
- 0, // 1
- 0, // 2
- 0, // 3
- 0, // 4
- 0, // 5
- 0, // 6
- 0, // 7
- 9, // 8
- 7, // 9
- 1, // 10
- 5, // 11
- 6, // 12
- 6, // 13
- 6, // 14
- 6, // 15
- 6, // 16
- 6, // 17
- 6, // 18
- 5, // 19
- 7, // 20
- 8, // 21
- 0, // 22
- 0, // 23
- 0, // 24
- 0, // 25
- 0, // 26
- 0, // 27
- 0, // 28
- 0, // 29
- 10, // 30
- 10, // 31
- 10, // 32
- 11, // 33
- 11, // 34
- 11, // 35
- 0, // 36
- 0, // 37
- 0, // 38
- 0, // 39
- 14, // 40
- 14, // 41
- 14, // 42
- 14, // 43
- 15, // 44
- 15, // 45
- 15, // 46
- 15, // 47
- 0, // 48
- 0, // 49
- 19, // 50
- 18, // 51
- 18, // 52
- 18, // 53
- 18, // 54
- 18, // 55
- 18, // 56
- 18, // 57
- 18, // 58
- 20, // 59
- 21, // 60
- 25, // 61
- 26, // 62
- 26, // 63
- 26, // 64
- 26, // 65
- 26, // 66
- 26, // 67
- 24, // 68
- 22, // 69
- 30, // 70
- 30, // 71
- 30, // 72
- 30, // 73
- 31, // 74
- 31, // 75
- 30, // 76
- 32, // 77
- 32, // 78
- 30, // 79
- 34, // 80
- 35, // 81
- 36, // 82
- 39, // 83
- 38, // 84
- 37, // 85
- 43, // 86
- 44, // 87
- 41, // 88
- 45, // 89
- 42, // 90
- 0, // 91
- 0, // 92
- 0, // 93
- 0, // 94
- 0, // 95
- 0, // 96
- 0, // 97
- 0, // 98
- 0 // 99
- };
- unsigned int test_high = sizeof(test_data) / sizeof(int);
-
- // Now, do the RetrieveRange tests. This further validates that the
- // objects were stored properly and that retrieval returns the correct
- // object.
- // If GENERATE_TEST_DATA is defined, instead of the retrieval tests, a
- // new test_data array will be printed. Exercise caution when doing this.
- // Be sure to verify the results manually!
-#ifdef GENERATE_TEST_DATA
- printf(" const int test_data[] = {\n");
-#endif // GENERATE_TEST_DATA
-
- for (unsigned int address = 0; address < test_high; ++address) {
- int value;
- if (!crm.RetrieveRange(address, &value))
- value = 0;
-
-#ifndef GENERATE_TEST_DATA
- // Don't use ASSERT inside the loop because it won't show the failed
- // |address|, and the line number will always be the same. That makes
- // it difficult to figure out which test failed.
- if (value != test_data[address]) {
- fprintf(stderr, "FAIL: retrieve %d expected %d observed %d @ %s:%d\n",
- address, test_data[address], value, __FILE__, __LINE__);
- return false;
- }
-#else // !GENERATE_TEST_DATA
- printf(" %d%c%s // %d\n", value,
- address == test_high - 1 ? ' ' : ',',
- value < 10 ? " " : "",
- address);
-#endif // !GENERATE_TEST_DATA
- }
-
-#ifdef GENERATE_TEST_DATA
- printf(" };\n");
-#endif // GENERATE_TEST_DATA
-
- return true;
-}
-
-
-} // namespace
-
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- return RunTests() ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.cc b/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.cc
deleted file mode 100644
index 559022404f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// disassembler_x86.cc: simple x86 disassembler.
-//
-// Provides single step disassembly of x86 bytecode and flags instructions
-// that utilize known bad register values.
-//
-// Author: Cris Neckar
-
-#include "processor/disassembler_x86.h"
-
-#include <string.h>
-
-namespace google_breakpad {
-
-DisassemblerX86::DisassemblerX86(const uint8_t *bytecode,
- uint32_t size,
- uint32_t virtual_address) :
- bytecode_(bytecode),
- size_(size),
- virtual_address_(virtual_address),
- current_byte_offset_(0),
- current_inst_offset_(0),
- instr_valid_(false),
- register_valid_(false),
- pushed_bad_value_(false),
- end_of_block_(false),
- flags_(0) {
- libdis::x86_init(libdis::opt_none, NULL, NULL);
-}
-
-DisassemblerX86::~DisassemblerX86() {
- if (instr_valid_)
- libdis::x86_oplist_free(&current_instr_);
-
- libdis::x86_cleanup();
-}
-
-uint32_t DisassemblerX86::NextInstruction() {
- if (instr_valid_)
- libdis::x86_oplist_free(&current_instr_);
-
- if (current_byte_offset_ >= size_) {
- instr_valid_ = false;
- return 0;
- }
- uint32_t instr_size = 0;
- instr_size = libdis::x86_disasm((unsigned char *)bytecode_, size_,
- virtual_address_, current_byte_offset_,
- &current_instr_);
- if (instr_size == 0) {
- instr_valid_ = false;
- return 0;
- }
-
- current_byte_offset_ += instr_size;
- current_inst_offset_++;
- instr_valid_ = libdis::x86_insn_is_valid(&current_instr_);
- if (!instr_valid_)
- return 0;
-
- if (current_instr_.type == libdis::insn_return)
- end_of_block_ = true;
- libdis::x86_op_t *src = libdis::x86_get_src_operand(&current_instr_);
- libdis::x86_op_t *dest = libdis::x86_get_dest_operand(&current_instr_);
-
- if (register_valid_) {
- switch (current_instr_.group) {
- // Flag branches based off of bad registers and calls that occur
- // after pushing bad values.
- case libdis::insn_controlflow:
- switch (current_instr_.type) {
- case libdis::insn_jmp:
- case libdis::insn_jcc:
- case libdis::insn_call:
- case libdis::insn_callcc:
- if (dest) {
- switch (dest->type) {
- case libdis::op_expression:
- if (dest->data.expression.base.id == bad_register_.id)
- flags_ |= DISX86_BAD_BRANCH_TARGET;
- break;
- case libdis::op_register:
- if (dest->data.reg.id == bad_register_.id)
- flags_ |= DISX86_BAD_BRANCH_TARGET;
- break;
- default:
- if (pushed_bad_value_ &&
- (current_instr_.type == libdis::insn_call ||
- current_instr_.type == libdis::insn_callcc))
- flags_ |= DISX86_BAD_ARGUMENT_PASSED;
- break;
- }
- }
- break;
- default:
- break;
- }
- break;
-
- // Flag block data operations that use bad registers for src or dest.
- case libdis::insn_string:
- if (dest && dest->type == libdis::op_expression &&
- dest->data.expression.base.id == bad_register_.id)
- flags_ |= DISX86_BAD_BLOCK_WRITE;
- if (src && src->type == libdis::op_expression &&
- src->data.expression.base.id == bad_register_.id)
- flags_ |= DISX86_BAD_BLOCK_READ;
- break;
-
- // Flag comparisons based on bad data.
- case libdis::insn_comparison:
- if ((dest && dest->type == libdis::op_expression &&
- dest->data.expression.base.id == bad_register_.id) ||
- (src && src->type == libdis::op_expression &&
- src->data.expression.base.id == bad_register_.id) ||
- (dest && dest->type == libdis::op_register &&
- dest->data.reg.id == bad_register_.id) ||
- (src && src->type == libdis::op_register &&
- src->data.reg.id == bad_register_.id))
- flags_ |= DISX86_BAD_COMPARISON;
- break;
-
- // Flag any other instruction which derefs a bad register for
- // src or dest.
- default:
- if (dest && dest->type == libdis::op_expression &&
- dest->data.expression.base.id == bad_register_.id)
- flags_ |= DISX86_BAD_WRITE;
- if (src && src->type == libdis::op_expression &&
- src->data.expression.base.id == bad_register_.id)
- flags_ |= DISX86_BAD_READ;
- break;
- }
- }
-
- // When a register is marked as tainted check if it is pushed.
- // TODO(cdn): may also want to check for MOVs into EBP offsets.
- if (register_valid_ && dest && current_instr_.type == libdis::insn_push) {
- switch (dest->type) {
- case libdis::op_expression:
- if (dest->data.expression.base.id == bad_register_.id ||
- dest->data.expression.index.id == bad_register_.id)
- pushed_bad_value_ = true;
- break;
- case libdis::op_register:
- if (dest->data.reg.id == bad_register_.id)
- pushed_bad_value_ = true;
- break;
- default:
- break;
- }
- }
-
- // Check if a tainted register value is clobbered.
- // For conditional MOVs and XCHGs assume that
- // there is a hit.
- if (register_valid_) {
- switch (current_instr_.type) {
- case libdis::insn_xor:
- if (src && src->type == libdis::op_register &&
- dest && dest->type == libdis::op_register &&
- src->data.reg.id == bad_register_.id &&
- src->data.reg.id == dest->data.reg.id)
- register_valid_ = false;
- break;
- case libdis::insn_pop:
- case libdis::insn_mov:
- case libdis::insn_movcc:
- if (dest && dest->type == libdis::op_register &&
- dest->data.reg.id == bad_register_.id)
- register_valid_ = false;
- break;
- case libdis::insn_popregs:
- register_valid_ = false;
- break;
- case libdis::insn_xchg:
- case libdis::insn_xchgcc:
- if (dest && dest->type == libdis::op_register &&
- src && src->type == libdis::op_register) {
- if (dest->data.reg.id == bad_register_.id)
- memcpy(&bad_register_, &src->data.reg, sizeof(libdis::x86_reg_t));
- else if (src->data.reg.id == bad_register_.id)
- memcpy(&bad_register_, &dest->data.reg, sizeof(libdis::x86_reg_t));
- }
- break;
- default:
- break;
- }
- }
-
- return instr_size;
-}
-
-bool DisassemblerX86::setBadRead() {
- if (!instr_valid_)
- return false;
-
- libdis::x86_op_t *operand = libdis::x86_get_src_operand(&current_instr_);
- if (!operand || operand->type != libdis::op_expression)
- return false;
-
- memcpy(&bad_register_, &operand->data.expression.base,
- sizeof(libdis::x86_reg_t));
- register_valid_ = true;
- return true;
-}
-
-bool DisassemblerX86::setBadWrite() {
- if (!instr_valid_)
- return false;
-
- libdis::x86_op_t *operand = libdis::x86_get_dest_operand(&current_instr_);
- if (!operand || operand->type != libdis::op_expression)
- return false;
-
- memcpy(&bad_register_, &operand->data.expression.base,
- sizeof(libdis::x86_reg_t));
- register_valid_ = true;
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.h b/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.h
deleted file mode 100644
index 7106941072..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// disassembler_x86.h: Basic x86 bytecode disassembler
-//
-// Provides a simple disassembler which wraps libdisasm. This allows simple
-// tests to be run against bytecode to test for various properties.
-//
-// Author: Cris Neckar
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_DISASSEMBLER_X86_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_DISASSEMBLER_X86_H_
-
-#include <stddef.h>
-#include <sys/types.h>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace libdis {
-#include "third_party/libdisasm/libdis.h"
-}
-
-namespace google_breakpad {
-
-enum {
- DISX86_NONE = 0x0,
- DISX86_BAD_BRANCH_TARGET = 0x1,
- DISX86_BAD_ARGUMENT_PASSED = 0x2,
- DISX86_BAD_WRITE = 0x4,
- DISX86_BAD_BLOCK_WRITE = 0x8,
- DISX86_BAD_READ = 0x10,
- DISX86_BAD_BLOCK_READ = 0x20,
- DISX86_BAD_COMPARISON = 0x40
-};
-
-class DisassemblerX86 {
- public:
- // TODO(cdn): Modify this class to take a MemoryRegion instead of just
- // a raw buffer. This will make it easier to use this on arbitrary
- // minidumps without first copying out the code segment.
- DisassemblerX86(const uint8_t *bytecode, uint32_t, uint32_t);
- ~DisassemblerX86();
-
- // This walks to the next instruction in the memory region and
- // sets flags based on the type of instruction and previous state
- // including any registers marked as bad through setBadRead()
- // or setBadWrite(). This method can be called in a loop to
- // disassemble until the end of a region.
- uint32_t NextInstruction();
-
- // Indicates whether the current disassembled instruction was valid.
- bool currentInstructionValid() { return instr_valid_; }
-
- // Returns the current instruction as defined in libdis.h,
- // or NULL if the current instruction is not valid.
- const libdis::x86_insn_t* currentInstruction() {
- return instr_valid_ ? &current_instr_ : NULL;
- }
-
- // Returns the type of the current instruction as defined in libdis.h.
- libdis::x86_insn_group currentInstructionGroup() {
- return current_instr_.group;
- }
-
- // Indicates whether a return instruction has been encountered.
- bool endOfBlock() { return end_of_block_; }
-
- // The flags set so far for the disassembly.
- uint16_t flags() { return flags_; }
-
- // This sets an indicator that the register used to determine
- // src or dest for the current instruction is tainted. These can
- // be used after examining the current instruction to indicate,
- // for example that a bad read or write occurred and the pointer
- // stored in the register is currently invalid.
- bool setBadRead();
- bool setBadWrite();
-
- protected:
- const uint8_t *bytecode_;
- uint32_t size_;
- uint32_t virtual_address_;
- uint32_t current_byte_offset_;
- uint32_t current_inst_offset_;
-
- bool instr_valid_;
- libdis::x86_insn_t current_instr_;
-
- // TODO(cdn): Maybe also track an expression's index register.
- // ex: mov eax, [ebx + ecx]; ebx is base, ecx is index.
- bool register_valid_;
- libdis::x86_reg_t bad_register_;
-
- bool pushed_bad_value_;
- bool end_of_block_;
-
- uint16_t flags_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_DISASSEMBLER_X86_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86_unittest.cc
deleted file mode 100644
index 352905f20d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/disassembler_x86_unittest.cc
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
-
-#include <unistd.h>
-
-#include "breakpad_googletest_includes.h"
-#include "processor/disassembler_x86.h"
-#include "third_party/libdisasm/libdis.h"
-
-namespace {
-
-using google_breakpad::DisassemblerX86;
-
-unsigned char just_return[] = "\xc3"; // retn
-
-unsigned char invalid_instruction[] = "\x00"; // invalid
-
-unsigned char read_eax_jmp_eax[] =
- "\x8b\x18" // mov ebx, [eax];
- "\x33\xc9" // xor ebx, ebx;
- "\xff\x20" // jmp eax;
- "\xc3"; // retn;
-
-unsigned char write_eax_arg_to_call[] =
- "\x89\xa8\x00\x02\x00\x00" // mov [eax+200], ebp;
- "\xc1\xeb\x02" // shr ebx, 2;
- "\x50" // push eax;
- "\xe8\xd1\x24\x77\x88" // call something;
- "\xc3"; // retn;
-
-unsigned char read_edi_stosb[] =
- "\x8b\x07" // mov eax, [edi];
- "\x8b\xc8" // mov ecx, eax;
- "\xf3\xaa" // rep stosb;
- "\xc3"; // retn;
-
-unsigned char read_clobber_write[] =
- "\x03\x18" // add ebx, [eax];
- "\x8b\xc1" // mov eax, ecx;
- "\x89\x10" // mov [eax], edx;
- "\xc3"; // retn;
-
-unsigned char read_xchg_write[] =
- "\x03\x18" // add ebx, [eax];
- "\x91" // xchg eax, ecx;
- "\x89\x18" // mov [eax], ebx;
- "\x89\x11" // mov [ecx], edx;
- "\xc3"; // retn;
-
-unsigned char read_cmp[] =
- "\x03\x18" // add ebx, [eax];
- "\x83\xf8\x00" // cmp eax, 0;
- "\x74\x04" // je +4;
- "\xc3"; // retn;
-
-TEST(DisassemblerX86Test, SimpleReturnInstruction) {
- DisassemblerX86 dis(just_return, sizeof(just_return)-1, 0);
- EXPECT_EQ(1U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_TRUE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_controlflow, dis.currentInstructionGroup());
- const libdis::x86_insn_t* instruction = dis.currentInstruction();
- EXPECT_EQ(libdis::insn_controlflow, instruction->group);
- EXPECT_EQ(libdis::insn_return, instruction->type);
- EXPECT_EQ(0U, dis.NextInstruction());
- EXPECT_FALSE(dis.currentInstructionValid());
- EXPECT_EQ(NULL, dis.currentInstruction());
-}
-
-TEST(DisassemblerX86Test, SimpleInvalidInstruction) {
- DisassemblerX86 dis(invalid_instruction, sizeof(invalid_instruction)-1, 0);
- EXPECT_EQ(0U, dis.NextInstruction());
- EXPECT_FALSE(dis.currentInstructionValid());
-}
-
-TEST(DisassemblerX86Test, BadReadLeadsToBranch) {
- DisassemblerX86 dis(read_eax_jmp_eax, sizeof(read_eax_jmp_eax)-1, 0);
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_TRUE(dis.setBadRead());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_logic, dis.currentInstructionGroup());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(google_breakpad::DISX86_BAD_BRANCH_TARGET, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_controlflow, dis.currentInstructionGroup());
-}
-
-TEST(DisassemblerX86Test, BadWriteLeadsToPushedArg) {
- DisassemblerX86 dis(write_eax_arg_to_call,
- sizeof(write_eax_arg_to_call)-1, 0);
- EXPECT_EQ(6U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_TRUE(dis.setBadWrite());
- EXPECT_EQ(3U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_arithmetic, dis.currentInstructionGroup());
- EXPECT_EQ(1U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(5U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(google_breakpad::DISX86_BAD_ARGUMENT_PASSED, dis.flags());
- EXPECT_EQ(libdis::insn_controlflow, dis.currentInstructionGroup());
- EXPECT_FALSE(dis.endOfBlock());
-}
-
-
-TEST(DisassemblerX86Test, BadReadLeadsToBlockWrite) {
- DisassemblerX86 dis(read_edi_stosb, sizeof(read_edi_stosb)-1, 0);
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_TRUE(dis.setBadRead());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(google_breakpad::DISX86_BAD_BLOCK_WRITE, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_string, dis.currentInstructionGroup());
-}
-
-TEST(DisassemblerX86Test, BadReadClobberThenWrite) {
- DisassemblerX86 dis(read_clobber_write, sizeof(read_clobber_write)-1, 0);
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_arithmetic, dis.currentInstructionGroup());
- EXPECT_TRUE(dis.setBadRead());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
-}
-
-TEST(DisassemblerX86Test, BadReadXCHGThenWrite) {
- DisassemblerX86 dis(read_xchg_write, sizeof(read_xchg_write)-1, 0);
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_arithmetic, dis.currentInstructionGroup());
- EXPECT_TRUE(dis.setBadRead());
- EXPECT_EQ(1U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(google_breakpad::DISX86_BAD_WRITE, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_move, dis.currentInstructionGroup());
-}
-
-TEST(DisassemblerX86Test, BadReadThenCMP) {
- DisassemblerX86 dis(read_cmp, sizeof(read_cmp)-1, 0);
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(0U, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_arithmetic, dis.currentInstructionGroup());
- EXPECT_TRUE(dis.setBadRead());
- EXPECT_EQ(3U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(google_breakpad::DISX86_BAD_COMPARISON, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_comparison, dis.currentInstructionGroup());
- EXPECT_EQ(2U, dis.NextInstruction());
- EXPECT_TRUE(dis.currentInstructionValid());
- EXPECT_EQ(google_breakpad::DISX86_BAD_COMPARISON, dis.flags());
- EXPECT_FALSE(dis.endOfBlock());
- EXPECT_EQ(libdis::insn_controlflow, dis.currentInstructionGroup());
-}
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/dump_context.cc b/toolkit/crashreporter/google-breakpad/src/processor/dump_context.cc
deleted file mode 100644
index 762d4fe21d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/dump_context.cc
+++ /dev/null
@@ -1,659 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dump_context.cc: A (mini/micro)dump context.
-//
-// See dump_context.h for documentation.
-
-#include "google_breakpad/processor/dump_context.h"
-
-#include <assert.h>
-
-#ifdef _WIN32
-#include <io.h>
-#else // _WIN32
-#include <unistd.h>
-#endif // _WIN32
-
-#include "common/stdio_wrapper.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-DumpContext::DumpContext() : context_(),
- context_flags_(0) { }
-
-DumpContext::~DumpContext() {
- FreeContext();
-}
-
-uint32_t DumpContext::GetContextCPU() const {
- if (!valid_) {
- // Don't log a message, GetContextCPU can be legitimately called with
- // valid_ false by FreeContext, which is called by Read.
- return 0;
- }
-
- return context_flags_ & MD_CONTEXT_CPU_MASK;
-}
-
-uint32_t DumpContext::GetContextFlags() const {
- return context_flags_;
-}
-
-const MDRawContextX86* DumpContext::GetContextX86() const {
- if (GetContextCPU() != MD_CONTEXT_X86) {
- BPLOG(ERROR) << "DumpContext cannot get x86 context";
- return NULL;
- }
-
- return context_.x86;
-}
-
-const MDRawContextPPC* DumpContext::GetContextPPC() const {
- if (GetContextCPU() != MD_CONTEXT_PPC) {
- BPLOG(ERROR) << "DumpContext cannot get ppc context";
- return NULL;
- }
-
- return context_.ppc;
-}
-
-const MDRawContextPPC64* DumpContext::GetContextPPC64() const {
- if (GetContextCPU() != MD_CONTEXT_PPC64) {
- BPLOG(ERROR) << "DumpContext cannot get ppc64 context";
- return NULL;
- }
-
- return context_.ppc64;
-}
-
-const MDRawContextAMD64* DumpContext::GetContextAMD64() const {
- if (GetContextCPU() != MD_CONTEXT_AMD64) {
- BPLOG(ERROR) << "DumpContext cannot get amd64 context";
- return NULL;
- }
-
- return context_.amd64;
-}
-
-const MDRawContextSPARC* DumpContext::GetContextSPARC() const {
- if (GetContextCPU() != MD_CONTEXT_SPARC) {
- BPLOG(ERROR) << "DumpContext cannot get sparc context";
- return NULL;
- }
-
- return context_.ctx_sparc;
-}
-
-const MDRawContextARM* DumpContext::GetContextARM() const {
- if (GetContextCPU() != MD_CONTEXT_ARM) {
- BPLOG(ERROR) << "DumpContext cannot get arm context";
- return NULL;
- }
-
- return context_.arm;
-}
-
-const MDRawContextARM64* DumpContext::GetContextARM64() const {
- if (GetContextCPU() != MD_CONTEXT_ARM64) {
- BPLOG(ERROR) << "DumpContext cannot get arm64 context";
- return NULL;
- }
-
- return context_.arm64;
-}
-
-const MDRawContextMIPS* DumpContext::GetContextMIPS() const {
- if ((GetContextCPU() != MD_CONTEXT_MIPS) &&
- (GetContextCPU() != MD_CONTEXT_MIPS64)) {
- BPLOG(ERROR) << "DumpContext cannot get MIPS context";
- return NULL;
- }
-
- return context_.ctx_mips;
-}
-
-bool DumpContext::GetInstructionPointer(uint64_t* ip) const {
- BPLOG_IF(ERROR, !ip) << "DumpContext::GetInstructionPointer requires |ip|";
- assert(ip);
- *ip = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid DumpContext for GetInstructionPointer";
- return false;
- }
-
- switch (GetContextCPU()) {
- case MD_CONTEXT_AMD64:
- *ip = GetContextAMD64()->rip;
- break;
- case MD_CONTEXT_ARM:
- *ip = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_PC];
- break;
- case MD_CONTEXT_ARM64:
- *ip = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_PC];
- break;
- case MD_CONTEXT_PPC:
- *ip = GetContextPPC()->srr0;
- break;
- case MD_CONTEXT_PPC64:
- *ip = GetContextPPC64()->srr0;
- break;
- case MD_CONTEXT_SPARC:
- *ip = GetContextSPARC()->pc;
- break;
- case MD_CONTEXT_X86:
- *ip = GetContextX86()->eip;
- break;
- case MD_CONTEXT_MIPS:
- case MD_CONTEXT_MIPS64:
- *ip = GetContextMIPS()->epc;
- break;
- default:
- // This should never happen.
- BPLOG(ERROR) << "Unknown CPU architecture in GetInstructionPointer";
- return false;
- }
- return true;
-}
-
-bool DumpContext::GetStackPointer(uint64_t* sp) const {
- BPLOG_IF(ERROR, !sp) << "DumpContext::GetStackPointer requires |sp|";
- assert(sp);
- *sp = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid DumpContext for GetStackPointer";
- return false;
- }
-
- switch (GetContextCPU()) {
- case MD_CONTEXT_AMD64:
- *sp = GetContextAMD64()->rsp;
- break;
- case MD_CONTEXT_ARM:
- *sp = GetContextARM()->iregs[MD_CONTEXT_ARM_REG_SP];
- break;
- case MD_CONTEXT_ARM64:
- *sp = GetContextARM64()->iregs[MD_CONTEXT_ARM64_REG_SP];
- break;
- case MD_CONTEXT_PPC:
- *sp = GetContextPPC()->gpr[MD_CONTEXT_PPC_REG_SP];
- break;
- case MD_CONTEXT_PPC64:
- *sp = GetContextPPC64()->gpr[MD_CONTEXT_PPC64_REG_SP];
- break;
- case MD_CONTEXT_SPARC:
- *sp = GetContextSPARC()->g_r[MD_CONTEXT_SPARC_REG_SP];
- break;
- case MD_CONTEXT_X86:
- *sp = GetContextX86()->esp;
- break;
- case MD_CONTEXT_MIPS:
- case MD_CONTEXT_MIPS64:
- *sp = GetContextMIPS()->iregs[MD_CONTEXT_MIPS_REG_SP];
- break;
- default:
- // This should never happen.
- BPLOG(ERROR) << "Unknown CPU architecture in GetStackPointer";
- return false;
- }
- return true;
-}
-
-void DumpContext::SetContextFlags(uint32_t context_flags) {
- context_flags_ = context_flags;
-}
-
-void DumpContext::SetContextX86(MDRawContextX86* x86) {
- context_.x86 = x86;
-}
-
-void DumpContext::SetContextPPC(MDRawContextPPC* ppc) {
- context_.ppc = ppc;
-}
-
-void DumpContext::SetContextPPC64(MDRawContextPPC64* ppc64) {
- context_.ppc64 = ppc64;
-}
-
-void DumpContext::SetContextAMD64(MDRawContextAMD64* amd64) {
- context_.amd64 = amd64;
-}
-
-void DumpContext::SetContextSPARC(MDRawContextSPARC* ctx_sparc) {
- context_.ctx_sparc = ctx_sparc;
-}
-
-void DumpContext::SetContextARM(MDRawContextARM* arm) {
- context_.arm = arm;
-}
-
-void DumpContext::SetContextARM64(MDRawContextARM64* arm64) {
- context_.arm64 = arm64;
-}
-
-void DumpContext::SetContextMIPS(MDRawContextMIPS* ctx_mips) {
- context_.ctx_mips = ctx_mips;
-}
-
-void DumpContext::FreeContext() {
- switch (GetContextCPU()) {
- case MD_CONTEXT_X86:
- delete context_.x86;
- break;
-
- case MD_CONTEXT_PPC:
- delete context_.ppc;
- break;
-
- case MD_CONTEXT_PPC64:
- delete context_.ppc64;
- break;
-
- case MD_CONTEXT_AMD64:
- delete context_.amd64;
- break;
-
- case MD_CONTEXT_SPARC:
- delete context_.ctx_sparc;
- break;
-
- case MD_CONTEXT_ARM:
- delete context_.arm;
- break;
-
- case MD_CONTEXT_ARM64:
- delete context_.arm64;
- break;
-
- case MD_CONTEXT_MIPS:
- case MD_CONTEXT_MIPS64:
- delete context_.ctx_mips;
- break;
-
- default:
- // There is no context record (valid_ is false) or there's a
- // context record for an unknown CPU (shouldn't happen, only known
- // records are stored by Read).
- break;
- }
-
- context_flags_ = 0;
- context_.base = NULL;
-}
-
-void DumpContext::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "DumpContext cannot print invalid data";
- return;
- }
-
- switch (GetContextCPU()) {
- case MD_CONTEXT_X86: {
- const MDRawContextX86* context_x86 = GetContextX86();
- printf("MDRawContextX86\n");
- printf(" context_flags = 0x%x\n",
- context_x86->context_flags);
- printf(" dr0 = 0x%x\n", context_x86->dr0);
- printf(" dr1 = 0x%x\n", context_x86->dr1);
- printf(" dr2 = 0x%x\n", context_x86->dr2);
- printf(" dr3 = 0x%x\n", context_x86->dr3);
- printf(" dr6 = 0x%x\n", context_x86->dr6);
- printf(" dr7 = 0x%x\n", context_x86->dr7);
- printf(" float_save.control_word = 0x%x\n",
- context_x86->float_save.control_word);
- printf(" float_save.status_word = 0x%x\n",
- context_x86->float_save.status_word);
- printf(" float_save.tag_word = 0x%x\n",
- context_x86->float_save.tag_word);
- printf(" float_save.error_offset = 0x%x\n",
- context_x86->float_save.error_offset);
- printf(" float_save.error_selector = 0x%x\n",
- context_x86->float_save.error_selector);
- printf(" float_save.data_offset = 0x%x\n",
- context_x86->float_save.data_offset);
- printf(" float_save.data_selector = 0x%x\n",
- context_x86->float_save.data_selector);
- printf(" float_save.register_area[%2d] = 0x",
- MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE);
- for (unsigned int register_index = 0;
- register_index < MD_FLOATINGSAVEAREA_X86_REGISTERAREA_SIZE;
- ++register_index) {
- printf("%02x", context_x86->float_save.register_area[register_index]);
- }
- printf("\n");
- printf(" float_save.cr0_npx_state = 0x%x\n",
- context_x86->float_save.cr0_npx_state);
- printf(" gs = 0x%x\n", context_x86->gs);
- printf(" fs = 0x%x\n", context_x86->fs);
- printf(" es = 0x%x\n", context_x86->es);
- printf(" ds = 0x%x\n", context_x86->ds);
- printf(" edi = 0x%x\n", context_x86->edi);
- printf(" esi = 0x%x\n", context_x86->esi);
- printf(" ebx = 0x%x\n", context_x86->ebx);
- printf(" edx = 0x%x\n", context_x86->edx);
- printf(" ecx = 0x%x\n", context_x86->ecx);
- printf(" eax = 0x%x\n", context_x86->eax);
- printf(" ebp = 0x%x\n", context_x86->ebp);
- printf(" eip = 0x%x\n", context_x86->eip);
- printf(" cs = 0x%x\n", context_x86->cs);
- printf(" eflags = 0x%x\n", context_x86->eflags);
- printf(" esp = 0x%x\n", context_x86->esp);
- printf(" ss = 0x%x\n", context_x86->ss);
- printf(" extended_registers[%3d] = 0x",
- MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE);
- for (unsigned int register_index = 0;
- register_index < MD_CONTEXT_X86_EXTENDED_REGISTERS_SIZE;
- ++register_index) {
- printf("%02x", context_x86->extended_registers[register_index]);
- }
- printf("\n\n");
-
- break;
- }
-
- case MD_CONTEXT_PPC: {
- const MDRawContextPPC* context_ppc = GetContextPPC();
- printf("MDRawContextPPC\n");
- printf(" context_flags = 0x%x\n",
- context_ppc->context_flags);
- printf(" srr0 = 0x%x\n", context_ppc->srr0);
- printf(" srr1 = 0x%x\n", context_ppc->srr1);
- for (unsigned int gpr_index = 0;
- gpr_index < MD_CONTEXT_PPC_GPR_COUNT;
- ++gpr_index) {
- printf(" gpr[%2d] = 0x%x\n",
- gpr_index, context_ppc->gpr[gpr_index]);
- }
- printf(" cr = 0x%x\n", context_ppc->cr);
- printf(" xer = 0x%x\n", context_ppc->xer);
- printf(" lr = 0x%x\n", context_ppc->lr);
- printf(" ctr = 0x%x\n", context_ppc->ctr);
- printf(" mq = 0x%x\n", context_ppc->mq);
- printf(" vrsave = 0x%x\n", context_ppc->vrsave);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT;
- ++fpr_index) {
- printf(" float_save.fpregs[%2d] = 0x%" PRIx64 "\n",
- fpr_index, context_ppc->float_save.fpregs[fpr_index]);
- }
- printf(" float_save.fpscr = 0x%x\n",
- context_ppc->float_save.fpscr);
- // TODO(mmentovai): print the 128-bit quantities in
- // context_ppc->vector_save. This isn't done yet because printf
- // doesn't support 128-bit quantities, and printing them using
- // PRIx64 as two 64-bit quantities requires knowledge of the CPU's
- // byte ordering.
- printf(" vector_save.save_vrvalid = 0x%x\n",
- context_ppc->vector_save.save_vrvalid);
- printf("\n");
-
- break;
- }
-
- case MD_CONTEXT_PPC64: {
- const MDRawContextPPC64* context_ppc64 = GetContextPPC64();
- printf("MDRawContextPPC64\n");
- printf(" context_flags = 0x%" PRIx64 "\n",
- context_ppc64->context_flags);
- printf(" srr0 = 0x%" PRIx64 "\n",
- context_ppc64->srr0);
- printf(" srr1 = 0x%" PRIx64 "\n",
- context_ppc64->srr1);
- for (unsigned int gpr_index = 0;
- gpr_index < MD_CONTEXT_PPC64_GPR_COUNT;
- ++gpr_index) {
- printf(" gpr[%2d] = 0x%" PRIx64 "\n",
- gpr_index, context_ppc64->gpr[gpr_index]);
- }
- printf(" cr = 0x%" PRIx64 "\n", context_ppc64->cr);
- printf(" xer = 0x%" PRIx64 "\n",
- context_ppc64->xer);
- printf(" lr = 0x%" PRIx64 "\n", context_ppc64->lr);
- printf(" ctr = 0x%" PRIx64 "\n",
- context_ppc64->ctr);
- printf(" vrsave = 0x%" PRIx64 "\n",
- context_ppc64->vrsave);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT;
- ++fpr_index) {
- printf(" float_save.fpregs[%2d] = 0x%" PRIx64 "\n",
- fpr_index, context_ppc64->float_save.fpregs[fpr_index]);
- }
- printf(" float_save.fpscr = 0x%x\n",
- context_ppc64->float_save.fpscr);
- // TODO(mmentovai): print the 128-bit quantities in
- // context_ppc64->vector_save. This isn't done yet because printf
- // doesn't support 128-bit quantities, and printing them using
- // PRIx64 as two 64-bit quantities requires knowledge of the CPU's
- // byte ordering.
- printf(" vector_save.save_vrvalid = 0x%x\n",
- context_ppc64->vector_save.save_vrvalid);
- printf("\n");
-
- break;
- }
-
- case MD_CONTEXT_AMD64: {
- const MDRawContextAMD64* context_amd64 = GetContextAMD64();
- printf("MDRawContextAMD64\n");
- printf(" p1_home = 0x%" PRIx64 "\n",
- context_amd64->p1_home);
- printf(" p2_home = 0x%" PRIx64 "\n",
- context_amd64->p2_home);
- printf(" p3_home = 0x%" PRIx64 "\n",
- context_amd64->p3_home);
- printf(" p4_home = 0x%" PRIx64 "\n",
- context_amd64->p4_home);
- printf(" p5_home = 0x%" PRIx64 "\n",
- context_amd64->p5_home);
- printf(" p6_home = 0x%" PRIx64 "\n",
- context_amd64->p6_home);
- printf(" context_flags = 0x%x\n",
- context_amd64->context_flags);
- printf(" mx_csr = 0x%x\n",
- context_amd64->mx_csr);
- printf(" cs = 0x%x\n", context_amd64->cs);
- printf(" ds = 0x%x\n", context_amd64->ds);
- printf(" es = 0x%x\n", context_amd64->es);
- printf(" fs = 0x%x\n", context_amd64->fs);
- printf(" gs = 0x%x\n", context_amd64->gs);
- printf(" ss = 0x%x\n", context_amd64->ss);
- printf(" eflags = 0x%x\n", context_amd64->eflags);
- printf(" dr0 = 0x%" PRIx64 "\n", context_amd64->dr0);
- printf(" dr1 = 0x%" PRIx64 "\n", context_amd64->dr1);
- printf(" dr2 = 0x%" PRIx64 "\n", context_amd64->dr2);
- printf(" dr3 = 0x%" PRIx64 "\n", context_amd64->dr3);
- printf(" dr6 = 0x%" PRIx64 "\n", context_amd64->dr6);
- printf(" dr7 = 0x%" PRIx64 "\n", context_amd64->dr7);
- printf(" rax = 0x%" PRIx64 "\n", context_amd64->rax);
- printf(" rcx = 0x%" PRIx64 "\n", context_amd64->rcx);
- printf(" rdx = 0x%" PRIx64 "\n", context_amd64->rdx);
- printf(" rbx = 0x%" PRIx64 "\n", context_amd64->rbx);
- printf(" rsp = 0x%" PRIx64 "\n", context_amd64->rsp);
- printf(" rbp = 0x%" PRIx64 "\n", context_amd64->rbp);
- printf(" rsi = 0x%" PRIx64 "\n", context_amd64->rsi);
- printf(" rdi = 0x%" PRIx64 "\n", context_amd64->rdi);
- printf(" r8 = 0x%" PRIx64 "\n", context_amd64->r8);
- printf(" r9 = 0x%" PRIx64 "\n", context_amd64->r9);
- printf(" r10 = 0x%" PRIx64 "\n", context_amd64->r10);
- printf(" r11 = 0x%" PRIx64 "\n", context_amd64->r11);
- printf(" r12 = 0x%" PRIx64 "\n", context_amd64->r12);
- printf(" r13 = 0x%" PRIx64 "\n", context_amd64->r13);
- printf(" r14 = 0x%" PRIx64 "\n", context_amd64->r14);
- printf(" r15 = 0x%" PRIx64 "\n", context_amd64->r15);
- printf(" rip = 0x%" PRIx64 "\n", context_amd64->rip);
- // TODO: print xmm, vector, debug registers
- printf("\n");
- break;
- }
-
- case MD_CONTEXT_SPARC: {
- const MDRawContextSPARC* context_sparc = GetContextSPARC();
- printf("MDRawContextSPARC\n");
- printf(" context_flags = 0x%x\n",
- context_sparc->context_flags);
- for (unsigned int g_r_index = 0;
- g_r_index < MD_CONTEXT_SPARC_GPR_COUNT;
- ++g_r_index) {
- printf(" g_r[%2d] = 0x%" PRIx64 "\n",
- g_r_index, context_sparc->g_r[g_r_index]);
- }
- printf(" ccr = 0x%" PRIx64 "\n", context_sparc->ccr);
- printf(" pc = 0x%" PRIx64 "\n", context_sparc->pc);
- printf(" npc = 0x%" PRIx64 "\n", context_sparc->npc);
- printf(" y = 0x%" PRIx64 "\n", context_sparc->y);
- printf(" asi = 0x%" PRIx64 "\n", context_sparc->asi);
- printf(" fprs = 0x%" PRIx64 "\n", context_sparc->fprs);
-
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT;
- ++fpr_index) {
- printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n",
- fpr_index, context_sparc->float_save.regs[fpr_index]);
- }
- printf(" float_save.filler = 0x%" PRIx64 "\n",
- context_sparc->float_save.filler);
- printf(" float_save.fsr = 0x%" PRIx64 "\n",
- context_sparc->float_save.fsr);
- break;
- }
-
- case MD_CONTEXT_ARM: {
- const MDRawContextARM* context_arm = GetContextARM();
- printf("MDRawContextARM\n");
- printf(" context_flags = 0x%x\n",
- context_arm->context_flags);
- for (unsigned int ireg_index = 0;
- ireg_index < MD_CONTEXT_ARM_GPR_COUNT;
- ++ireg_index) {
- printf(" iregs[%2d] = 0x%x\n",
- ireg_index, context_arm->iregs[ireg_index]);
- }
- printf(" cpsr = 0x%x\n", context_arm->cpsr);
- printf(" float_save.fpscr = 0x%" PRIx64 "\n",
- context_arm->float_save.fpscr);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_ARM_FPR_COUNT;
- ++fpr_index) {
- printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n",
- fpr_index, context_arm->float_save.regs[fpr_index]);
- }
- for (unsigned int fpe_index = 0;
- fpe_index < MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT;
- ++fpe_index) {
- printf(" float_save.extra[%2d] = 0x%" PRIx32 "\n",
- fpe_index, context_arm->float_save.extra[fpe_index]);
- }
-
- break;
- }
-
- case MD_CONTEXT_ARM64: {
- const MDRawContextARM64* context_arm64 = GetContextARM64();
- printf("MDRawContextARM64\n");
- printf(" context_flags = 0x%" PRIx64 "\n",
- context_arm64->context_flags);
- for (unsigned int ireg_index = 0;
- ireg_index < MD_CONTEXT_ARM64_GPR_COUNT;
- ++ireg_index) {
- printf(" iregs[%2d] = 0x%" PRIx64 "\n",
- ireg_index, context_arm64->iregs[ireg_index]);
- }
- printf(" cpsr = 0x%x\n", context_arm64->cpsr);
- printf(" float_save.fpsr = 0x%x\n", context_arm64->float_save.fpsr);
- printf(" float_save.fpcr = 0x%x\n", context_arm64->float_save.fpcr);
-
- for (unsigned int freg_index = 0;
- freg_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT;
- ++freg_index) {
- uint128_struct fp_value = context_arm64->float_save.regs[freg_index];
- printf(" float_save.regs[%2d] = 0x%" PRIx64 "%" PRIx64 "\n",
- freg_index, fp_value.high, fp_value.low);
- }
- break;
- }
-
- case MD_CONTEXT_MIPS:
- case MD_CONTEXT_MIPS64: {
- const MDRawContextMIPS* context_mips = GetContextMIPS();
- printf("MDRawContextMIPS\n");
- printf(" context_flags = 0x%x\n",
- context_mips->context_flags);
- for (int ireg_index = 0;
- ireg_index < MD_CONTEXT_MIPS_GPR_COUNT;
- ++ireg_index) {
- printf(" iregs[%2d] = 0x%" PRIx64 "\n",
- ireg_index, context_mips->iregs[ireg_index]);
- }
- printf(" mdhi = 0x%" PRIx64 "\n",
- context_mips->mdhi);
- printf(" mdlo = 0x%" PRIx64 "\n",
- context_mips->mdhi);
- for (int dsp_index = 0;
- dsp_index < MD_CONTEXT_MIPS_DSP_COUNT;
- ++dsp_index) {
- printf(" hi[%1d] = 0x%" PRIx32 "\n",
- dsp_index, context_mips->hi[dsp_index]);
- printf(" lo[%1d] = 0x%" PRIx32 "\n",
- dsp_index, context_mips->lo[dsp_index]);
- }
- printf(" dsp_control = 0x%" PRIx32 "\n",
- context_mips->dsp_control);
- printf(" epc = 0x%" PRIx64 "\n",
- context_mips->epc);
- printf(" badvaddr = 0x%" PRIx64 "\n",
- context_mips->badvaddr);
- printf(" status = 0x%" PRIx32 "\n",
- context_mips->status);
- printf(" cause = 0x%" PRIx32 "\n",
- context_mips->cause);
-
- for (int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT;
- ++fpr_index) {
- printf(" float_save.regs[%2d] = 0x%" PRIx64 "\n",
- fpr_index, context_mips->float_save.regs[fpr_index]);
- }
- printf(" float_save.fpcsr = 0x%" PRIx32 "\n",
- context_mips->float_save.fpcsr);
- printf(" float_save.fir = 0x%" PRIx32 "\n",
- context_mips->float_save.fir);
- break;
- }
-
- default: {
- break;
- }
- }
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/dump_object.cc b/toolkit/crashreporter/google-breakpad/src/processor/dump_object.cc
deleted file mode 100644
index 2c82b200b8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/dump_object.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dump_object.cc: A base class for all mini/micro dump object.
-
-#include "google_breakpad/processor/dump_object.h"
-
-namespace google_breakpad {
-
-DumpObject::DumpObject() : valid_(false) {
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/exploitability.cc b/toolkit/crashreporter/google-breakpad/src/processor/exploitability.cc
deleted file mode 100644
index 6ee1e96222..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/exploitability.cc
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exploitability_engine.cc: Generic exploitability engine.
-//
-// See exploitable_engine.h for documentation.
-//
-// Author: Cris Neckar
-
-
-#include <cassert>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/exploitability.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/process_state.h"
-#include "processor/exploitability_linux.h"
-#include "processor/exploitability_win.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-Exploitability::Exploitability(Minidump *dump,
- ProcessState *process_state)
- : dump_(dump),
- process_state_(process_state) {}
-
-ExploitabilityRating Exploitability::CheckExploitability() {
- return CheckPlatformExploitability();
-}
-
-Exploitability *Exploitability::ExploitabilityForPlatform(
- Minidump *dump,
- ProcessState *process_state) {
- return ExploitabilityForPlatform(dump, process_state, false);
-}
-
-Exploitability *Exploitability::ExploitabilityForPlatform(
- Minidump *dump,
- ProcessState *process_state,
- bool enable_objdump) {
- Exploitability *platform_exploitability = NULL;
- MinidumpSystemInfo *minidump_system_info = dump->GetSystemInfo();
- if (!minidump_system_info)
- return NULL;
-
- const MDRawSystemInfo *raw_system_info =
- minidump_system_info->system_info();
- if (!raw_system_info)
- return NULL;
-
- switch (raw_system_info->platform_id) {
- case MD_OS_WIN32_NT:
- case MD_OS_WIN32_WINDOWS: {
- platform_exploitability = new ExploitabilityWin(dump, process_state);
- break;
- }
- case MD_OS_LINUX: {
- platform_exploitability = new ExploitabilityLinux(dump,
- process_state,
- enable_objdump);
- break;
- }
- case MD_OS_MAC_OS_X:
- case MD_OS_IOS:
- case MD_OS_UNIX:
- case MD_OS_SOLARIS:
- case MD_OS_ANDROID:
- case MD_OS_PS3:
- default: {
- platform_exploitability = NULL;
- break;
- }
- }
-
- BPLOG_IF(ERROR, !platform_exploitability) <<
- "No Exploitability module for platform: " <<
- process_state->system_info()->os;
- return platform_exploitability;
-}
-
-bool Exploitability::AddressIsAscii(uint64_t address) {
- for (int i = 0; i < 8; i++) {
- uint8_t byte = (address >> (8*i)) & 0xff;
- if ((byte >= ' ' && byte <= '~') || byte == 0)
- continue;
- return false;
- }
- return true;
-}
-
-} // namespace google_breakpad
-
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.cc b/toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.cc
deleted file mode 100644
index 63056c438e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.cc
+++ /dev/null
@@ -1,625 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exploitability_linux.cc: Linux specific exploitability engine.
-//
-// Provides a guess at the exploitability of the crash for the Linux
-// platform given a minidump and process_state.
-//
-// Author: Matthew Riley
-
-#include "processor/exploitability_linux.h"
-
-#ifndef _WIN32
-#include <regex.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <sstream>
-#include <iterator>
-#endif // _WIN32
-
-#include "google_breakpad/common/minidump_exception_linux.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/logging.h"
-
-namespace {
-
-// Prefixes for memory mapping names.
-constexpr char kHeapPrefix[] = "[heap";
-constexpr char kStackPrefix[] = "[stack";
-
-// This function in libc is called if the program was compiled with
-// -fstack-protector and a function's stack canary changes.
-constexpr char kStackCheckFailureFunction[] = "__stack_chk_fail";
-
-// This function in libc is called if the program was compiled with
-// -D_FORTIFY_SOURCE=2, a function like strcpy() is called, and the runtime
-// can determine that the call would overflow the target buffer.
-constexpr char kBoundsCheckFailureFunction[] = "__chk_fail";
-
-#ifndef _WIN32
-const unsigned int MAX_INSTRUCTION_LEN = 15;
-const unsigned int MAX_OBJDUMP_BUFFER_LEN = 4096;
-#endif // _WIN32
-
-} // namespace
-
-namespace google_breakpad {
-
-ExploitabilityLinux::ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state)
- : Exploitability(dump, process_state),
- enable_objdump_(false) { }
-
-ExploitabilityLinux::ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state,
- bool enable_objdump)
- : Exploitability(dump, process_state),
- enable_objdump_(enable_objdump) { }
-
-
-ExploitabilityRating ExploitabilityLinux::CheckPlatformExploitability() {
- // Check the crashing thread for functions suggesting a buffer overflow or
- // stack smash.
- if (process_state_->requesting_thread() != -1) {
- CallStack* crashing_thread =
- process_state_->threads()->at(process_state_->requesting_thread());
- const vector<StackFrame*>& crashing_thread_frames =
- *crashing_thread->frames();
- for (size_t i = 0; i < crashing_thread_frames.size(); ++i) {
- if (crashing_thread_frames[i]->function_name ==
- kStackCheckFailureFunction) {
- return EXPLOITABILITY_HIGH;
- }
-
- if (crashing_thread_frames[i]->function_name ==
- kBoundsCheckFailureFunction) {
- return EXPLOITABILITY_HIGH;
- }
- }
- }
-
- // Getting exception data. (It should exist for all minidumps.)
- MinidumpException *exception = dump_->GetException();
- if (exception == NULL) {
- BPLOG(INFO) << "No exception record.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
- const MDRawExceptionStream *raw_exception_stream = exception->exception();
- if (raw_exception_stream == NULL) {
- BPLOG(INFO) << "No raw exception stream.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- // Checking for benign exceptions that caused the crash.
- if (this->BenignCrashTrigger(raw_exception_stream)) {
- return EXPLOITABILITY_NONE;
- }
-
- // Check if the instruction pointer is in a valid instruction region
- // by finding if it maps to an executable part of memory.
- uint64_t instruction_ptr = 0;
- uint64_t stack_ptr = 0;
-
- const MinidumpContext *context = exception->GetContext();
- if (context == NULL) {
- BPLOG(INFO) << "No exception context.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- // Getting the instruction pointer.
- if (!context->GetInstructionPointer(&instruction_ptr)) {
- BPLOG(INFO) << "Failed to retrieve instruction pointer.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- // Getting the stack pointer.
- if (!context->GetStackPointer(&stack_ptr)) {
- BPLOG(INFO) << "Failed to retrieve stack pointer.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- // Checking for the instruction pointer in a valid instruction region,
- // a misplaced stack pointer, and an executable stack or heap.
- if (!this->InstructionPointerInCode(instruction_ptr) ||
- this->StackPointerOffStack(stack_ptr) ||
- this->ExecutableStackOrHeap()) {
- return EXPLOITABILITY_HIGH;
- }
-
- // Check for write to read only memory or invalid memory, shelling out
- // to objdump is enabled.
- if (enable_objdump_ && this->EndedOnIllegalWrite(instruction_ptr)) {
- return EXPLOITABILITY_HIGH;
- }
-
- // There was no strong evidence suggesting exploitability, but the minidump
- // does not appear totally benign either.
- return EXPLOITABILITY_INTERESTING;
-}
-
-bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) {
-#ifdef _WIN32
- BPLOG(INFO) << "MinGW does not support fork and exec. Terminating method.";
-#else
- // Get memory region containing instruction pointer.
- MinidumpMemoryList *memory_list = dump_->GetMemoryList();
- MinidumpMemoryRegion *memory_region =
- memory_list ?
- memory_list->GetMemoryRegionForAddress(instruction_ptr) : NULL;
- if (!memory_region) {
- BPLOG(INFO) << "No memory region around instruction pointer.";
- return false;
- }
-
- // Get exception data to find architecture.
- string architecture = "";
- MinidumpException *exception = dump_->GetException();
- // This should never evaluate to true, since this should not be reachable
- // without checking for exception data earlier.
- if (!exception) {
- BPLOG(INFO) << "No exception data.";
- return false;
- }
- const MDRawExceptionStream *raw_exception_stream = exception->exception();
- const MinidumpContext *context = exception->GetContext();
- // This should not evaluate to true, for the same reason mentioned above.
- if (!raw_exception_stream || !context) {
- BPLOG(INFO) << "No exception or architecture data.";
- return false;
- }
- // Check architecture and set architecture variable to corresponding flag
- // in objdump.
- switch (context->GetContextCPU()) {
- case MD_CONTEXT_X86:
- architecture = "i386";
- break;
- case MD_CONTEXT_AMD64:
- architecture = "i386:x86-64";
- break;
- default:
- // Unsupported architecture. Note that ARM architectures are not
- // supported because objdump does not support ARM.
- return false;
- break;
- }
-
- // Get memory region around instruction pointer and the number of bytes
- // before and after the instruction pointer in the memory region.
- const uint8_t *raw_memory = memory_region->GetMemory();
- const uint64_t base = memory_region->GetBase();
- if (base > instruction_ptr) {
- BPLOG(ERROR) << "Memory region base value exceeds instruction pointer.";
- return false;
- }
- const uint64_t offset = instruction_ptr - base;
- if (memory_region->GetSize() < MAX_INSTRUCTION_LEN + offset) {
- BPLOG(INFO) << "Not enough bytes left to guarantee complete instruction.";
- return false;
- }
-
- // Convert bytes into objdump output.
- char objdump_output_buffer[MAX_OBJDUMP_BUFFER_LEN] = {0};
- DisassembleBytes(architecture,
- raw_memory + offset,
- MAX_OBJDUMP_BUFFER_LEN,
- objdump_output_buffer);
-
- string line;
- if (!GetObjdumpInstructionLine(objdump_output_buffer, &line)) {
- return false;
- }
-
- // Convert objdump instruction line into the operation and operands.
- string instruction = "";
- string dest = "";
- string src = "";
- TokenizeObjdumpInstruction(line, &instruction, &dest, &src);
-
- // Check if the operation is a write to memory. First, the instruction
- // must one that can write to memory. Second, the write destination
- // must be a spot in memory rather than a register. Since there are no
- // symbols from objdump, the destination will be enclosed by brackets.
- if (dest.size() > 2 && dest.at(0) == '[' && dest.at(dest.size() - 1) == ']' &&
- (!instruction.compare("mov") || !instruction.compare("inc") ||
- !instruction.compare("dec") || !instruction.compare("and") ||
- !instruction.compare("or") || !instruction.compare("xor") ||
- !instruction.compare("not") || !instruction.compare("neg") ||
- !instruction.compare("add") || !instruction.compare("sub") ||
- !instruction.compare("shl") || !instruction.compare("shr"))) {
- // Strip away enclosing brackets from the destination address.
- dest = dest.substr(1, dest.size() - 2);
- uint64_t write_address = 0;
- CalculateAddress(dest, *context, &write_address);
-
- // If the program crashed as a result of a write, the destination of
- // the write must have been an address that did not permit writing.
- // However, if the address is under 4k, due to program protections,
- // the crash does not suggest exploitability for writes with such a
- // low target address.
- return write_address > 4096;
- }
-#endif // _WIN32
- return false;
-}
-
-#ifndef _WIN32
-bool ExploitabilityLinux::CalculateAddress(const string &address_expression,
- const DumpContext &context,
- uint64_t *write_address) {
- // The destination should be the format reg+a or reg-a, where reg
- // is a register and a is a hexadecimal constant. Although more complex
- // expressions can make valid instructions, objdump's disassembly outputs
- // it in this simpler format.
- // TODO(liuandrew): Handle more complex formats, should they arise.
-
- if (!write_address) {
- BPLOG(ERROR) << "Null parameter.";
- return false;
- }
-
- // Clone parameter into a non-const string.
- string expression = address_expression;
-
- // Parse out the constant that is added to the address (if it exists).
- size_t delim = expression.find('+');
- bool positive_add_constant = true;
- // Check if constant is subtracted instead of added.
- if (delim == string::npos) {
- positive_add_constant = false;
- delim = expression.find('-');
- }
- uint32_t add_constant = 0;
- // Save constant and remove it from the expression.
- if (delim != string::npos) {
- if (!sscanf(expression.substr(delim + 1).c_str(), "%x", &add_constant)) {
- BPLOG(ERROR) << "Failed to scan constant.";
- return false;
- }
- expression = expression.substr(0, delim);
- }
-
- // Set the the write address to the corresponding register.
- // TODO(liuandrew): Add support for partial registers, such as
- // the rax/eax/ax/ah/al chain.
- switch (context.GetContextCPU()) {
- case MD_CONTEXT_X86:
- if (!expression.compare("eax")) {
- *write_address = context.GetContextX86()->eax;
- } else if (!expression.compare("ebx")) {
- *write_address = context.GetContextX86()->ebx;
- } else if (!expression.compare("ecx")) {
- *write_address = context.GetContextX86()->ecx;
- } else if (!expression.compare("edx")) {
- *write_address = context.GetContextX86()->edx;
- } else if (!expression.compare("edi")) {
- *write_address = context.GetContextX86()->edi;
- } else if (!expression.compare("esi")) {
- *write_address = context.GetContextX86()->esi;
- } else if (!expression.compare("ebp")) {
- *write_address = context.GetContextX86()->ebp;
- } else if (!expression.compare("esp")) {
- *write_address = context.GetContextX86()->esp;
- } else if (!expression.compare("eip")) {
- *write_address = context.GetContextX86()->eip;
- } else {
- BPLOG(ERROR) << "Unsupported register";
- return false;
- }
- break;
- case MD_CONTEXT_AMD64:
- if (!expression.compare("rax")) {
- *write_address = context.GetContextAMD64()->rax;
- } else if (!expression.compare("rbx")) {
- *write_address = context.GetContextAMD64()->rbx;
- } else if (!expression.compare("rcx")) {
- *write_address = context.GetContextAMD64()->rcx;
- } else if (!expression.compare("rdx")) {
- *write_address = context.GetContextAMD64()->rdx;
- } else if (!expression.compare("rdi")) {
- *write_address = context.GetContextAMD64()->rdi;
- } else if (!expression.compare("rsi")) {
- *write_address = context.GetContextAMD64()->rsi;
- } else if (!expression.compare("rbp")) {
- *write_address = context.GetContextAMD64()->rbp;
- } else if (!expression.compare("rsp")) {
- *write_address = context.GetContextAMD64()->rsp;
- } else if (!expression.compare("rip")) {
- *write_address = context.GetContextAMD64()->rip;
- } else if (!expression.compare("r8")) {
- *write_address = context.GetContextAMD64()->r8;
- } else if (!expression.compare("r9")) {
- *write_address = context.GetContextAMD64()->r9;
- } else if (!expression.compare("r10")) {
- *write_address = context.GetContextAMD64()->r10;
- } else if (!expression.compare("r11")) {
- *write_address = context.GetContextAMD64()->r11;
- } else if (!expression.compare("r12")) {
- *write_address = context.GetContextAMD64()->r12;
- } else if (!expression.compare("r13")) {
- *write_address = context.GetContextAMD64()->r13;
- } else if (!expression.compare("r14")) {
- *write_address = context.GetContextAMD64()->r14;
- } else if (!expression.compare("r15")) {
- *write_address = context.GetContextAMD64()->r15;
- } else {
- BPLOG(ERROR) << "Unsupported register";
- return false;
- }
- break;
- default:
- // This should not occur since the same switch condition
- // should have terminated this method.
- return false;
- break;
- }
-
- // Add or subtract constant from write address (if applicable).
- *write_address =
- positive_add_constant ?
- *write_address + add_constant : *write_address - add_constant;
-
- return true;
-}
-
-// static
-bool ExploitabilityLinux::GetObjdumpInstructionLine(
- const char *objdump_output_buffer,
- string *instruction_line) {
- // Put buffer data into stream to output line-by-line.
- std::stringstream objdump_stream;
- objdump_stream.str(string(objdump_output_buffer));
-
- // Pipe each output line into the string until the string contains the first
- // instruction from objdump. All lines before the "<.data>:" section are
- // skipped. Loop until the line shows the first instruction or there are no
- // lines left.
- bool data_section_seen = false;
- do {
- if (!getline(objdump_stream, *instruction_line)) {
- BPLOG(INFO) << "Objdump instructions not found";
- return false;
- }
- if (instruction_line->find("<.data>:") != string::npos) {
- data_section_seen = true;
- }
- } while (!data_section_seen || instruction_line->find("0:") == string::npos);
- // This first instruction contains the above substring.
-
- return true;
-}
-
-bool ExploitabilityLinux::TokenizeObjdumpInstruction(const string &line,
- string *operation,
- string *dest,
- string *src) {
- if (!operation || !dest || !src) {
- BPLOG(ERROR) << "Null parameters passed.";
- return false;
- }
-
- // Set all pointer values to empty strings.
- *operation = "";
- *dest = "";
- *src = "";
-
- // Tokenize the objdump line.
- vector<string> tokens;
- std::istringstream line_stream(line);
- copy(std::istream_iterator<string>(line_stream),
- std::istream_iterator<string>(),
- std::back_inserter(tokens));
-
- // Regex for the data in hex form. Each byte is two hex digits.
- regex_t regex;
- regcomp(&regex, "^[[:xdigit:]]{2}$", REG_EXTENDED | REG_NOSUB);
-
- // Find and set the location of the operator. The operator appears
- // directly after the chain of bytes that define the instruction. The
- // operands will be the last token, given that the instruction has operands.
- // If not, the operator is the last token. The loop skips the first token
- // because the first token is the instruction number (namely "0:").
- string operands = "";
- for (size_t i = 1; i < tokens.size(); i++) {
- // Check if current token no longer is in byte format.
- if (regexec(&regex, tokens[i].c_str(), 0, NULL, 0)) {
- // instruction = tokens[i];
- *operation = tokens[i];
- // If the operator is the last token, there are no operands.
- if (i != tokens.size() - 1) {
- operands = tokens[tokens.size() - 1];
- }
- break;
- }
- }
- regfree(&regex);
-
- if (operation->empty()) {
- BPLOG(ERROR) << "Failed to parse out operation from objdump instruction.";
- return false;
- }
-
- // Split operands into source and destination (if applicable).
- if (!operands.empty()) {
- size_t delim = operands.find(',');
- if (delim == string::npos) {
- *dest = operands;
- } else {
- *dest = operands.substr(0, delim);
- *src = operands.substr(delim + 1);
- }
- }
- return true;
-}
-
-bool ExploitabilityLinux::DisassembleBytes(const string &architecture,
- const uint8_t *raw_bytes,
- const unsigned int buffer_len,
- char *objdump_output_buffer) {
- if (!raw_bytes || !objdump_output_buffer) {
- BPLOG(ERROR) << "Bad input parameters.";
- return false;
- }
-
- // Write raw bytes around instruction pointer to a temporary file to
- // pass as an argument to objdump.
- char raw_bytes_tmpfile[] = "/tmp/breakpad_mem_region-raw_bytes-XXXXXX";
- int raw_bytes_fd = mkstemp(raw_bytes_tmpfile);
- if (raw_bytes_fd < 0) {
- BPLOG(ERROR) << "Failed to create tempfile.";
- unlink(raw_bytes_tmpfile);
- return false;
- }
- if (write(raw_bytes_fd, raw_bytes, MAX_INSTRUCTION_LEN)
- != MAX_INSTRUCTION_LEN) {
- BPLOG(ERROR) << "Writing of raw bytes failed.";
- unlink(raw_bytes_tmpfile);
- return false;
- }
-
- char cmd[1024] = {0};
- snprintf(cmd,
- 1024,
- "objdump -D -b binary -M intel -m %s %s",
- architecture.c_str(),
- raw_bytes_tmpfile);
- FILE *objdump_fp = popen(cmd, "r");
- if (!objdump_fp) {
- fclose(objdump_fp);
- unlink(raw_bytes_tmpfile);
- BPLOG(ERROR) << "Failed to call objdump.";
- return false;
- }
- if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) {
- fclose(objdump_fp);
- unlink(raw_bytes_tmpfile);
- BPLOG(ERROR) << "Failed to read objdump output.";
- return false;
- }
- fclose(objdump_fp);
- unlink(raw_bytes_tmpfile);
- return true;
-}
-#endif // _WIN32
-
-bool ExploitabilityLinux::StackPointerOffStack(uint64_t stack_ptr) {
- MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
- // Inconclusive if there are no mappings available.
- if (!linux_maps_list) {
- return false;
- }
- const MinidumpLinuxMaps *linux_maps =
- linux_maps_list->GetLinuxMapsForAddress(stack_ptr);
- // Checks if the stack pointer maps to a valid mapping and if the mapping
- // is not the stack. If the mapping has no name, it is inconclusive whether
- // it is off the stack.
- return !linux_maps || (linux_maps->GetPathname().compare("") &&
- linux_maps->GetPathname().compare(
- 0, strlen(kStackPrefix), kStackPrefix));
-}
-
-bool ExploitabilityLinux::ExecutableStackOrHeap() {
- MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
- if (linux_maps_list) {
- for (size_t i = 0; i < linux_maps_list->get_maps_count(); i++) {
- const MinidumpLinuxMaps *linux_maps =
- linux_maps_list->GetLinuxMapsAtIndex(i);
- // Check for executable stack or heap for each mapping.
- if (linux_maps && (!linux_maps->GetPathname().compare(
- 0, strlen(kStackPrefix), kStackPrefix) ||
- !linux_maps->GetPathname().compare(
- 0, strlen(kHeapPrefix), kHeapPrefix)) &&
- linux_maps->IsExecutable()) {
- return true;
- }
- }
- }
- return false;
-}
-
-bool ExploitabilityLinux::InstructionPointerInCode(uint64_t instruction_ptr) {
- // Get Linux memory mapping from /proc/self/maps. Checking whether the
- // region the instruction pointer is in has executable permission can tell
- // whether it is in a valid code region. If there is no mapping for the
- // instruction pointer, it is indicative that the instruction pointer is
- // not within a module, which implies that it is outside a valid area.
- MinidumpLinuxMapsList *linux_maps_list = dump_->GetLinuxMapsList();
- const MinidumpLinuxMaps *linux_maps =
- linux_maps_list ?
- linux_maps_list->GetLinuxMapsForAddress(instruction_ptr) : NULL;
- return linux_maps ? linux_maps->IsExecutable() : false;
-}
-
-bool ExploitabilityLinux::BenignCrashTrigger(const MDRawExceptionStream
- *raw_exception_stream) {
- // Check the cause of crash.
- // If the exception of the crash is a benign exception,
- // it is probably not exploitable.
- switch (raw_exception_stream->exception_record.exception_code) {
- case MD_EXCEPTION_CODE_LIN_SIGHUP:
- case MD_EXCEPTION_CODE_LIN_SIGINT:
- case MD_EXCEPTION_CODE_LIN_SIGQUIT:
- case MD_EXCEPTION_CODE_LIN_SIGTRAP:
- case MD_EXCEPTION_CODE_LIN_SIGABRT:
- case MD_EXCEPTION_CODE_LIN_SIGFPE:
- case MD_EXCEPTION_CODE_LIN_SIGKILL:
- case MD_EXCEPTION_CODE_LIN_SIGUSR1:
- case MD_EXCEPTION_CODE_LIN_SIGUSR2:
- case MD_EXCEPTION_CODE_LIN_SIGPIPE:
- case MD_EXCEPTION_CODE_LIN_SIGALRM:
- case MD_EXCEPTION_CODE_LIN_SIGTERM:
- case MD_EXCEPTION_CODE_LIN_SIGCHLD:
- case MD_EXCEPTION_CODE_LIN_SIGCONT:
- case MD_EXCEPTION_CODE_LIN_SIGSTOP:
- case MD_EXCEPTION_CODE_LIN_SIGTSTP:
- case MD_EXCEPTION_CODE_LIN_SIGTTIN:
- case MD_EXCEPTION_CODE_LIN_SIGTTOU:
- case MD_EXCEPTION_CODE_LIN_SIGURG:
- case MD_EXCEPTION_CODE_LIN_SIGXCPU:
- case MD_EXCEPTION_CODE_LIN_SIGXFSZ:
- case MD_EXCEPTION_CODE_LIN_SIGVTALRM:
- case MD_EXCEPTION_CODE_LIN_SIGPROF:
- case MD_EXCEPTION_CODE_LIN_SIGWINCH:
- case MD_EXCEPTION_CODE_LIN_SIGIO:
- case MD_EXCEPTION_CODE_LIN_SIGPWR:
- case MD_EXCEPTION_CODE_LIN_SIGSYS:
- case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED:
- return true;
- break;
- default:
- return false;
- break;
- }
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.h b/toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.h
deleted file mode 100644
index e3ff13b6e0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_linux.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exploitability_linux.h: Linux specific exploitability engine.
-//
-// Provides a guess at the exploitability of the crash for the Linux
-// platform given a minidump and process_state.
-//
-// Author: Matthew Riley
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_LINUX_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_LINUX_H_
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/exploitability.h"
-
-namespace google_breakpad {
-
-class ExploitabilityLinux : public Exploitability {
- public:
- ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state);
-
- // Parameters are the minidump to analyze, the object representing process
- // state, and whether to enable objdump disassembly.
- // Enabling objdump will allow exploitability analysis to call out to
- // objdump for diassembly. It is used to check the identity of the
- // instruction that caused the program to crash. If there are any
- // portability concerns, this should not be enabled.
- ExploitabilityLinux(Minidump *dump,
- ProcessState *process_state,
- bool enable_objdump);
-
- virtual ExploitabilityRating CheckPlatformExploitability();
-
- private:
- friend class ExploitabilityLinuxTest;
-
- // Takes the address of the instruction pointer and returns
- // whether the instruction pointer lies in a valid instruction region.
- bool InstructionPointerInCode(uint64_t instruction_ptr);
-
- // Checks the exception that triggered the creation of the
- // minidump and reports whether the exception suggests no exploitability.
- bool BenignCrashTrigger(const MDRawExceptionStream *raw_exception_stream);
-
- // This method checks if the crash occurred during a write to read-only or
- // invalid memory. It does so by checking if the instruction at the
- // instruction pointer is a write instruction, and if the target of the
- // instruction is at a spot in memory that prohibits writes.
- bool EndedOnIllegalWrite(uint64_t instruction_ptr);
-
-#ifndef _WIN32
- // Disassembles raw bytes via objdump and pipes the output into the provided
- // buffer, given the desired architecture, the file from which objdump will
- // read, and the buffer length. The method returns whether the disassembly
- // was a success, and the caller owns all pointers.
- static bool DisassembleBytes(const string &architecture,
- const uint8_t *raw_bytes,
- const unsigned int MAX_OBJDUMP_BUFFER_LEN,
- char *objdump_output_buffer);
-
- // Parses the objdump output given in |objdump_output_buffer| and extracts
- // the line of the first instruction into |instruction_line|. Returns true
- // when the instruction line is successfully extracted.
- static bool GetObjdumpInstructionLine(
- const char *objdump_output_buffer,
- string *instruction_line);
-
- // Tokenizes out the operation and operands from a line of instruction
- // disassembled by objdump. This method modifies the pointers to match the
- // tokens of the instruction, and returns if the tokenizing was a success.
- // The caller owns all pointers.
- static bool TokenizeObjdumpInstruction(const string &line,
- string *operation,
- string *dest,
- string *src);
-
- // Calculates the effective address of an expression in the form reg+a or
- // reg-a, where 'reg' is a register and 'a' is a constant, and writes the
- // result in the pointer. The method returns whether the calculation was
- // a success. The caller owns the pointer.
- static bool CalculateAddress(const string &address_expression,
- const DumpContext &context,
- uint64_t *write_address);
-#endif // _WIN32
-
- // Checks if the stack pointer points to a memory mapping that is not
- // labelled as the stack.
- bool StackPointerOffStack(uint64_t stack_ptr);
-
- // Checks if the stack or heap are marked executable according
- // to the memory mappings.
- bool ExecutableStackOrHeap();
-
- // Whether this exploitability engine is permitted to shell out to objdump
- // to disassemble raw bytes.
- bool enable_objdump_;
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_LINUX_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/exploitability_unittest.cc
deleted file mode 100644
index 528ee5f213..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_unittest.cc
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
-
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/minidump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#ifndef _WIN32
-#include "processor/exploitability_linux.h"
-#endif // _WIN32
-#include "processor/simple_symbol_supplier.h"
-
-#ifndef _WIN32
-namespace google_breakpad {
-
-class ExploitabilityLinuxTest : public ExploitabilityLinux {
- public:
- using ExploitabilityLinux::CalculateAddress;
- using ExploitabilityLinux::DisassembleBytes;
- using ExploitabilityLinux::GetObjdumpInstructionLine;
- using ExploitabilityLinux::TokenizeObjdumpInstruction;
-};
-
-class ExploitabilityLinuxTestMinidumpContext : public MinidumpContext {
- public:
- explicit ExploitabilityLinuxTestMinidumpContext(
- const MDRawContextAMD64& context) : MinidumpContext(NULL) {
- valid_ = true;
- SetContextAMD64(new MDRawContextAMD64(context));
- SetContextFlags(MD_CONTEXT_AMD64);
- }
-};
-
-} // namespace google_breakpad
-#endif // _WIN32
-
-namespace {
-
-using google_breakpad::BasicSourceLineResolver;
-#ifndef _WIN32
-using google_breakpad::ExploitabilityLinuxTest;
-using google_breakpad::ExploitabilityLinuxTestMinidumpContext;
-#endif // _WIN32
-using google_breakpad::MinidumpProcessor;
-using google_breakpad::ProcessState;
-using google_breakpad::SimpleSymbolSupplier;
-
-string TestDataDir() {
- return string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata";
-}
-
-// Find the given dump file in <srcdir>/src/processor/testdata, process it,
-// and get the exploitability rating. Returns EXPLOITABILITY_ERR_PROCESSING
-// if the crash dump can't be processed.
-google_breakpad::ExploitabilityRating
-ExploitabilityFor(const string& filename) {
- SimpleSymbolSupplier supplier(TestDataDir() + "/symbols");
- BasicSourceLineResolver resolver;
- MinidumpProcessor processor(&supplier, &resolver, true);
- processor.set_enable_objdump(true);
- ProcessState state;
-
- string minidump_file = TestDataDir() + "/" + filename;
-
- if (processor.Process(minidump_file, &state) !=
- google_breakpad::PROCESS_OK) {
- return google_breakpad::EXPLOITABILITY_ERR_PROCESSING;
- }
-
- return state.exploitability();
-}
-
-TEST(ExploitabilityTest, TestWindowsEngine) {
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_read_av.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_read_av_block_write.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_read_av_clobber_write.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_read_av_conditional.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_read_av_then_jmp.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_read_av_xchg_write.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_write_av.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("ascii_write_av_arg_to_call.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
- ExploitabilityFor("null_read_av.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
- ExploitabilityFor("null_write_av.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
- ExploitabilityFor("stack_exhaustion.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("exec_av_on_stack.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_MEDIUM,
- ExploitabilityFor("write_av_non_null.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
- ExploitabilityFor("read_av_non_null.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
- ExploitabilityFor("read_av_clobber_write.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_LOW,
- ExploitabilityFor("read_av_conditional.dmp"));
-}
-
-TEST(ExploitabilityTest, TestLinuxEngine) {
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_null_read_av.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_overflow.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_stacksmash.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
- ExploitabilityFor("linux_divide_by_zero.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_null_dereference.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_jmp_to_0.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_outside_module.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NONE,
- ExploitabilityFor("linux_raise_sigabrt.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_inside_module_exe_region1.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_inside_module_exe_region2.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_stack_pointer_in_stack.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_stack_pointer_in_stack_alt_name.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_stack_pointer_in_module.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_executable_stack.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_executable_heap.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_jmp_to_module_not_exe_region.dmp"));
-#ifndef _WIN32
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_write_to_nonwritable_module.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_write_to_nonwritable_region_math.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_write_to_outside_module.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_HIGH,
- ExploitabilityFor("linux_write_to_outside_module_via_math.dmp"));
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_INTERESTING,
- ExploitabilityFor("linux_write_to_under_4k.dmp"));
-#endif // _WIN32
-}
-
-#ifndef _WIN32
-TEST(ExploitabilityLinuxUtilsTest, DisassembleBytesTest) {
- ASSERT_FALSE(ExploitabilityLinuxTest::DisassembleBytes("", NULL, 5, NULL));
- uint8_t bytes[6] = {0xc7, 0x0, 0x5, 0x0, 0x0, 0x0};
- char buffer[1024] = {0};
- ASSERT_TRUE(ExploitabilityLinuxTest::DisassembleBytes("i386:x86-64",
- bytes,
- 1024,
- buffer));
- std::stringstream objdump_stream;
- objdump_stream.str(string(buffer));
- string line = "";
- while (line.find("<.data>") == string::npos)
- getline(objdump_stream, line);
- getline(objdump_stream, line);
- ASSERT_EQ(line, " 0:\tc7 00 05 00 00 00 \tmov DWORD PTR [rax],0x5");
-}
-
-TEST(ExploitabilityLinuxUtilsTest, GetObjdumpInstructionLine) {
- string disassebly =
- "\n"
- "/tmp/breakpad_mem_region-raw_bytes-tMmMo0: file format binary\n"
- "// Trying to confuse the parser 0:\n"
- "\n"
- "Disassembly of section .data:\n"
- "\n"
- "0000000000000000 <.data>:\n"
- " 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1\n"
- " 6:\t5d \tpop rbp\n"
- " 7:\tc3 \tret \n"
- " 8:\t55 \tpush rbp\n"
- " 9:\t48 89 e5 \tmov rbp,rsp\n"
- " c:\t53 \tpush rbx\n"
- " d:\t48 \trex.W\n"
- " e:\t81 \t.byte 0x81\n";
- string line;
- EXPECT_TRUE(ExploitabilityLinuxTest::GetObjdumpInstructionLine(
- disassebly.c_str(), &line));
- EXPECT_EQ(" 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1", line);
-
- // There is no "0:" after "<.data>:". Expected to return false.
- disassebly =
- "\n"
- "/tmp/breakpad_mem_region-raw_bytes-tMmMo0: file format binary\n"
- "// Trying to confuse the parser 0:\n"
- "\n"
- "Disassembly of section .data:\n"
- "\n"
- " 0:\tc7 00 01 00 00 00 \tmov DWORD PTR [rax],0x1\n"
- " 6:\t5d \tpop rbp\n"
- " 7:\tc3 \tret \n"
- " 8:\t55 \tpush rbp\n"
- " 9:\t48 89 e5 \tmov rbp,rsp\n"
- " d:\t48 \trex.W\n"
- "0000000000000000 <.data>:\n"
- " c:\t53 \tpush rbx\n";
- EXPECT_FALSE(ExploitabilityLinuxTest::GetObjdumpInstructionLine(
- disassebly.c_str(), &line));
-}
-
-TEST(ExploitabilityLinuxUtilsTest, TokenizeObjdumpInstructionTest) {
- ASSERT_FALSE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction("",
- NULL,
- NULL,
- NULL));
- string line = "0: c7 00 05 00 00 00 mov DWORD PTR [rax],0x5";
- string operation = "";
- string dest = "";
- string src = "";
- ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line,
- &operation,
- &dest,
- &src));
- ASSERT_EQ(operation, "mov");
- ASSERT_EQ(dest, "[rax]");
- ASSERT_EQ(src, "0x5");
- line = "0: c3 ret";
- ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line,
- &operation,
- &dest,
- &src));
- ASSERT_EQ(operation, "ret");
- ASSERT_EQ(dest, "");
- ASSERT_EQ(src, "");
- line = "0: 5f pop rdi";
- ASSERT_TRUE(ExploitabilityLinuxTest::TokenizeObjdumpInstruction(line,
- &operation,
- &dest,
- &src));
- ASSERT_EQ(operation, "pop");
- ASSERT_EQ(dest, "rdi");
- ASSERT_EQ(src, "");
-}
-
-TEST(ExploitabilityLinuxUtilsTest, CalculateAddressTest) {
- MDRawContextAMD64 raw_context;
- raw_context.rdx = 12345;
- ExploitabilityLinuxTestMinidumpContext context(raw_context);
- ASSERT_EQ(context.GetContextAMD64()->rdx, 12345U);
- ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("", context, NULL));
- uint64_t write_address = 0;
- ASSERT_TRUE(ExploitabilityLinuxTest::CalculateAddress("rdx-0x4D2",
- context,
- &write_address));
- ASSERT_EQ(write_address, 11111U);
- ASSERT_TRUE(ExploitabilityLinuxTest::CalculateAddress("rdx+0x4D2",
- context,
- &write_address));
- ASSERT_EQ(write_address, 13579U);
- ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("rdx+rax",
- context,
- &write_address));
- ASSERT_FALSE(ExploitabilityLinuxTest::CalculateAddress("0x3482+0x4D2",
- context,
- &write_address));
-}
-#endif // _WIN32
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.cc b/toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.cc
deleted file mode 100644
index a1f8703a6e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.cc
+++ /dev/null
@@ -1,283 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exploitability_win.cc: Windows specific exploitability engine.
-//
-// Provides a guess at the exploitability of the crash for the Windows
-// platform given a minidump and process_state.
-//
-// Author: Cris Neckar
-
-#include <vector>
-
-#include "processor/exploitability_win.h"
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/common/minidump_exception_win32.h"
-#include "google_breakpad/processor/minidump.h"
-#include "processor/disassembler_x86.h"
-#include "processor/logging.h"
-
-#include "third_party/libdisasm/libdis.h"
-
-namespace google_breakpad {
-
-// The cutoff that we use to judge if and address is likely an offset
-// from various interesting addresses.
-static const uint64_t kProbableNullOffset = 4096;
-static const uint64_t kProbableStackOffset = 8192;
-
-// The various cutoffs for the different ratings.
-static const size_t kHighCutoff = 100;
-static const size_t kMediumCutoff = 80;
-static const size_t kLowCutoff = 50;
-static const size_t kInterestingCutoff = 25;
-
-// Predefined incremental values for conditional weighting.
-static const size_t kTinyBump = 5;
-static const size_t kSmallBump = 20;
-static const size_t kMediumBump = 50;
-static const size_t kLargeBump = 70;
-static const size_t kHugeBump = 90;
-
-// The maximum number of bytes to disassemble past the program counter.
-static const size_t kDisassembleBytesBeyondPC = 2048;
-
-ExploitabilityWin::ExploitabilityWin(Minidump *dump,
- ProcessState *process_state)
- : Exploitability(dump, process_state) { }
-
-ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() {
- MinidumpException *exception = dump_->GetException();
- if (!exception) {
- BPLOG(INFO) << "Minidump does not have exception record.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- const MDRawExceptionStream *raw_exception = exception->exception();
- if (!raw_exception) {
- BPLOG(INFO) << "Could not obtain raw exception info.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- const MinidumpContext *context = exception->GetContext();
- if (!context) {
- BPLOG(INFO) << "Could not obtain exception context.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- MinidumpMemoryList *memory_list = dump_->GetMemoryList();
- bool memory_available = true;
- if (!memory_list) {
- BPLOG(INFO) << "Minidump memory segments not available.";
- memory_available = false;
- }
- uint64_t address = process_state_->crash_address();
- uint32_t exception_code = raw_exception->exception_record.exception_code;
-
- uint32_t exploitability_weight = 0;
-
- uint64_t stack_ptr = 0;
- uint64_t instruction_ptr = 0;
-
- // Getting the instruction pointer.
- if (!context->GetInstructionPointer(&instruction_ptr)) {
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- // Getting the stack pointer.
- if (!context->GetStackPointer(&stack_ptr)) {
- return EXPLOITABILITY_ERR_PROCESSING;
- }
-
- // Check if we are executing on the stack.
- if (instruction_ptr <= (stack_ptr + kProbableStackOffset) &&
- instruction_ptr >= (stack_ptr - kProbableStackOffset))
- exploitability_weight += kHugeBump;
-
- switch (exception_code) {
- // This is almost certainly recursion.
- case MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW:
- exploitability_weight += kTinyBump;
- break;
-
- // These exceptions tend to be benign and we can generally ignore them.
- case MD_EXCEPTION_CODE_WIN_INTEGER_DIVIDE_BY_ZERO:
- case MD_EXCEPTION_CODE_WIN_INTEGER_OVERFLOW:
- case MD_EXCEPTION_CODE_WIN_FLOAT_DIVIDE_BY_ZERO:
- case MD_EXCEPTION_CODE_WIN_FLOAT_INEXACT_RESULT:
- case MD_EXCEPTION_CODE_WIN_FLOAT_OVERFLOW:
- case MD_EXCEPTION_CODE_WIN_FLOAT_UNDERFLOW:
- case MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR:
- exploitability_weight += kTinyBump;
- break;
-
- // These exceptions will typically mean that we have jumped where we
- // shouldn't.
- case MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION:
- case MD_EXCEPTION_CODE_WIN_FLOAT_INVALID_OPERATION:
- case MD_EXCEPTION_CODE_WIN_PRIVILEGED_INSTRUCTION:
- exploitability_weight += kLargeBump;
- break;
-
- // These represent bugs in exception handlers.
- case MD_EXCEPTION_CODE_WIN_INVALID_DISPOSITION:
- case MD_EXCEPTION_CODE_WIN_NONCONTINUABLE_EXCEPTION:
- exploitability_weight += kSmallBump;
- break;
-
- case MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION:
- case MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN:
- exploitability_weight += kHugeBump;
- break;
-
- case MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION:
- exploitability_weight += kLargeBump;
- break;
-
- case MD_EXCEPTION_CODE_WIN_ACCESS_VIOLATION:
- bool near_null = (address <= kProbableNullOffset);
- bool bad_read = false;
- bool bad_write = false;
- if (raw_exception->exception_record.number_parameters >= 1) {
- MDAccessViolationTypeWin av_type =
- static_cast<MDAccessViolationTypeWin>
- (raw_exception->exception_record.exception_information[0]);
- switch (av_type) {
- case MD_ACCESS_VIOLATION_WIN_READ:
- bad_read = true;
- if (near_null)
- exploitability_weight += kSmallBump;
- else
- exploitability_weight += kMediumBump;
- break;
- case MD_ACCESS_VIOLATION_WIN_WRITE:
- bad_write = true;
- if (near_null)
- exploitability_weight += kSmallBump;
- else
- exploitability_weight += kHugeBump;
- break;
- case MD_ACCESS_VIOLATION_WIN_EXEC:
- if (near_null)
- exploitability_weight += kSmallBump;
- else
- exploitability_weight += kHugeBump;
- break;
- default:
- BPLOG(INFO) << "Unrecognized access violation type.";
- return EXPLOITABILITY_ERR_PROCESSING;
- break;
- }
- MinidumpMemoryRegion *instruction_region = 0;
- if (memory_available) {
- instruction_region =
- memory_list->GetMemoryRegionForAddress(instruction_ptr);
- }
- if (!near_null && instruction_region &&
- context->GetContextCPU() == MD_CONTEXT_X86 &&
- (bad_read || bad_write)) {
- // Perform checks related to memory around instruction pointer.
- uint32_t memory_offset =
- instruction_ptr - instruction_region->GetBase();
- uint32_t available_memory =
- instruction_region->GetSize() - memory_offset;
- available_memory = available_memory > kDisassembleBytesBeyondPC ?
- kDisassembleBytesBeyondPC : available_memory;
- if (available_memory) {
- const uint8_t *raw_memory =
- instruction_region->GetMemory() + memory_offset;
- DisassemblerX86 disassembler(raw_memory,
- available_memory,
- instruction_ptr);
- disassembler.NextInstruction();
- if (bad_read)
- disassembler.setBadRead();
- else
- disassembler.setBadWrite();
- if (disassembler.currentInstructionValid()) {
- // Check if the faulting instruction falls into one of
- // several interesting groups.
- switch (disassembler.currentInstructionGroup()) {
- case libdis::insn_controlflow:
- exploitability_weight += kLargeBump;
- break;
- case libdis::insn_string:
- exploitability_weight += kHugeBump;
- break;
- default:
- break;
- }
- // Loop the disassembler through the code and check if it
- // IDed any interesting conditions in the near future.
- // Multiple flags may be set so treat each equally.
- while (disassembler.NextInstruction() &&
- disassembler.currentInstructionValid() &&
- !disassembler.endOfBlock())
- continue;
- if (disassembler.flags() & DISX86_BAD_BRANCH_TARGET)
- exploitability_weight += kLargeBump;
- if (disassembler.flags() & DISX86_BAD_ARGUMENT_PASSED)
- exploitability_weight += kTinyBump;
- if (disassembler.flags() & DISX86_BAD_WRITE)
- exploitability_weight += kMediumBump;
- if (disassembler.flags() & DISX86_BAD_BLOCK_WRITE)
- exploitability_weight += kMediumBump;
- if (disassembler.flags() & DISX86_BAD_READ)
- exploitability_weight += kTinyBump;
- if (disassembler.flags() & DISX86_BAD_BLOCK_READ)
- exploitability_weight += kTinyBump;
- if (disassembler.flags() & DISX86_BAD_COMPARISON)
- exploitability_weight += kTinyBump;
- }
- }
- }
- if (!near_null && AddressIsAscii(address))
- exploitability_weight += kMediumBump;
- } else {
- BPLOG(INFO) << "Access violation type parameter missing.";
- return EXPLOITABILITY_ERR_PROCESSING;
- }
- }
-
- // Based on the calculated weight we return a simplified classification.
- BPLOG(INFO) << "Calculated exploitability weight: " << exploitability_weight;
- if (exploitability_weight >= kHighCutoff)
- return EXPLOITABILITY_HIGH;
- if (exploitability_weight >= kMediumCutoff)
- return EXPLOITABLITY_MEDIUM;
- if (exploitability_weight >= kLowCutoff)
- return EXPLOITABILITY_LOW;
- if (exploitability_weight >= kInterestingCutoff)
- return EXPLOITABILITY_INTERESTING;
-
- return EXPLOITABILITY_NONE;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.h b/toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.h
deleted file mode 100644
index 4e08aef030..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/exploitability_win.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// exploitability_win.h: Windows specific exploitability engine.
-//
-// Provides a guess at the exploitability of the crash for the Windows
-// platform given a minidump and process_state.
-//
-// Author: Cris Neckar
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_WIN_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_WIN_H_
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/exploitability.h"
-
-namespace google_breakpad {
-
-class ExploitabilityWin : public Exploitability {
- public:
- ExploitabilityWin(Minidump *dump,
- ProcessState *process_state);
-
- virtual ExploitabilityRating CheckPlatformExploitability();
-};
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_EXPLOITABILITY_WIN_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver.cc b/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver.cc
deleted file mode 100644
index 4a3d000714..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver.cc
+++ /dev/null
@@ -1,275 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// fast_source_line_resolver.cc: FastSourceLineResolver is a concrete class that
-// implements SourceLineResolverInterface. Both FastSourceLineResolver and
-// BasicSourceLineResolver inherit from SourceLineResolverBase class to reduce
-// code redundancy.
-//
-// See fast_source_line_resolver.h and fast_source_line_resolver_types.h
-// for more documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include "google_breakpad/processor/fast_source_line_resolver.h"
-#include "processor/fast_source_line_resolver_types.h"
-
-#include <map>
-#include <string>
-#include <utility>
-
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "processor/module_factory.h"
-#include "processor/simple_serializer-inl.h"
-
-using std::map;
-using std::make_pair;
-
-namespace google_breakpad {
-
-FastSourceLineResolver::FastSourceLineResolver()
- : SourceLineResolverBase(new FastModuleFactory) { }
-
-bool FastSourceLineResolver::ShouldDeleteMemoryBufferAfterLoadModule() {
- return false;
-}
-
-void FastSourceLineResolver::Module::LookupAddress(StackFrame *frame) const {
- MemAddr address = frame->instruction - frame->module->base_address();
-
- // First, look for a FUNC record that covers address. Use
- // RetrieveNearestRange instead of RetrieveRange so that, if there
- // is no such function, we can use the next function to bound the
- // extent of the PUBLIC symbol we find, below. This does mean we
- // need to check that address indeed falls within the function we
- // find; do the range comparison in an overflow-friendly way.
- scoped_ptr<Function> func(new Function);
- const Function* func_ptr = 0;
- scoped_ptr<PublicSymbol> public_symbol(new PublicSymbol);
- const PublicSymbol* public_symbol_ptr = 0;
- MemAddr function_base;
- MemAddr function_size;
- MemAddr public_address;
-
- if (functions_.RetrieveNearestRange(address, func_ptr,
- &function_base, &function_size) &&
- address >= function_base && address - function_base < function_size) {
- func.get()->CopyFrom(func_ptr);
- frame->function_name = func->name;
- frame->function_base = frame->module->base_address() + function_base;
-
- scoped_ptr<Line> line(new Line);
- const Line* line_ptr = 0;
- MemAddr line_base;
- if (func->lines.RetrieveRange(address, line_ptr, &line_base, NULL)) {
- line.get()->CopyFrom(line_ptr);
- FileMap::iterator it = files_.find(line->source_file_id);
- if (it != files_.end()) {
- frame->source_file_name =
- files_.find(line->source_file_id).GetValuePtr();
- }
- frame->source_line = line->line;
- frame->source_line_base = frame->module->base_address() + line_base;
- }
- } else if (public_symbols_.Retrieve(address,
- public_symbol_ptr, &public_address) &&
- (!func_ptr || public_address > function_base)) {
- public_symbol.get()->CopyFrom(public_symbol_ptr);
- frame->function_name = public_symbol->name;
- frame->function_base = frame->module->base_address() + public_address;
- }
-}
-
-// WFI: WindowsFrameInfo.
-// Returns a WFI object reading from a raw memory chunk of data
-WindowsFrameInfo FastSourceLineResolver::CopyWFI(const char *raw) {
- const WindowsFrameInfo::StackInfoTypes type =
- static_cast<const WindowsFrameInfo::StackInfoTypes>(
- *reinterpret_cast<const int32_t*>(raw));
-
- // The first 8 bytes of int data are unused.
- // They correspond to "StackInfoTypes type_;" and "int valid;"
- // data member of WFI.
- const uint32_t *para_uint32 = reinterpret_cast<const uint32_t*>(
- raw + 2 * sizeof(int32_t));
-
- uint32_t prolog_size = para_uint32[0];;
- uint32_t epilog_size = para_uint32[1];
- uint32_t parameter_size = para_uint32[2];
- uint32_t saved_register_size = para_uint32[3];
- uint32_t local_size = para_uint32[4];
- uint32_t max_stack_size = para_uint32[5];
- const char *boolean = reinterpret_cast<const char*>(para_uint32 + 6);
- bool allocates_base_pointer = (*boolean != 0);
- string program_string = boolean + 1;
-
- return WindowsFrameInfo(type,
- prolog_size,
- epilog_size,
- parameter_size,
- saved_register_size,
- local_size,
- max_stack_size,
- allocates_base_pointer,
- program_string);
-}
-
-// Loads a map from the given buffer in char* type.
-// Does NOT take ownership of mem_buffer.
-// In addition, treat mem_buffer as const char*.
-bool FastSourceLineResolver::Module::LoadMapFromMemory(
- char *memory_buffer,
- size_t memory_buffer_size) {
- if (!memory_buffer) return false;
-
- // Read the "is_corrupt" flag.
- const char *mem_buffer = memory_buffer;
- mem_buffer = SimpleSerializer<bool>::Read(mem_buffer, &is_corrupt_);
-
- const uint32_t *map_sizes = reinterpret_cast<const uint32_t*>(mem_buffer);
-
- unsigned int header_size = kNumberMaps_ * sizeof(unsigned int);
-
- // offsets[]: an array of offset addresses (with respect to mem_buffer),
- // for each "Static***Map" component of Module.
- // "Static***Map": static version of std::map or map wrapper, i.e., StaticMap,
- // StaticAddressMap, StaticContainedRangeMap, and StaticRangeMap.
- unsigned int offsets[kNumberMaps_];
- offsets[0] = header_size;
- for (int i = 1; i < kNumberMaps_; ++i) {
- offsets[i] = offsets[i - 1] + map_sizes[i - 1];
- }
-
- // Use pointers to construct Static*Map data members in Module:
- int map_id = 0;
- files_ = StaticMap<int, char>(mem_buffer + offsets[map_id++]);
- functions_ =
- StaticRangeMap<MemAddr, Function>(mem_buffer + offsets[map_id++]);
- public_symbols_ =
- StaticAddressMap<MemAddr, PublicSymbol>(mem_buffer + offsets[map_id++]);
- for (int i = 0; i < WindowsFrameInfo::STACK_INFO_LAST; ++i)
- windows_frame_info_[i] =
- StaticContainedRangeMap<MemAddr, char>(mem_buffer + offsets[map_id++]);
-
- cfi_initial_rules_ =
- StaticRangeMap<MemAddr, char>(mem_buffer + offsets[map_id++]);
- cfi_delta_rules_ = StaticMap<MemAddr, char>(mem_buffer + offsets[map_id++]);
-
- return true;
-}
-
-WindowsFrameInfo *FastSourceLineResolver::Module::FindWindowsFrameInfo(
- const StackFrame *frame) const {
- MemAddr address = frame->instruction - frame->module->base_address();
- scoped_ptr<WindowsFrameInfo> result(new WindowsFrameInfo());
-
- // We only know about WindowsFrameInfo::STACK_INFO_FRAME_DATA and
- // WindowsFrameInfo::STACK_INFO_FPO. Prefer them in this order.
- // WindowsFrameInfo::STACK_INFO_FRAME_DATA is the newer type that
- // includes its own program string.
- // WindowsFrameInfo::STACK_INFO_FPO is the older type
- // corresponding to the FPO_DATA struct. See stackwalker_x86.cc.
- const char* frame_info_ptr;
- if ((windows_frame_info_[WindowsFrameInfo::STACK_INFO_FRAME_DATA]
- .RetrieveRange(address, frame_info_ptr))
- || (windows_frame_info_[WindowsFrameInfo::STACK_INFO_FPO]
- .RetrieveRange(address, frame_info_ptr))) {
- result->CopyFrom(CopyWFI(frame_info_ptr));
- return result.release();
- }
-
- // Even without a relevant STACK line, many functions contain
- // information about how much space their parameters consume on the
- // stack. Use RetrieveNearestRange instead of RetrieveRange, so that
- // we can use the function to bound the extent of the PUBLIC symbol,
- // below. However, this does mean we need to check that ADDRESS
- // falls within the retrieved function's range; do the range
- // comparison in an overflow-friendly way.
- scoped_ptr<Function> function(new Function);
- const Function* function_ptr = 0;
- MemAddr function_base, function_size;
- if (functions_.RetrieveNearestRange(address, function_ptr,
- &function_base, &function_size) &&
- address >= function_base && address - function_base < function_size) {
- function.get()->CopyFrom(function_ptr);
- result->parameter_size = function->parameter_size;
- result->valid |= WindowsFrameInfo::VALID_PARAMETER_SIZE;
- return result.release();
- }
-
- // PUBLIC symbols might have a parameter size. Use the function we
- // found above to limit the range the public symbol covers.
- scoped_ptr<PublicSymbol> public_symbol(new PublicSymbol);
- const PublicSymbol* public_symbol_ptr = 0;
- MemAddr public_address;
- if (public_symbols_.Retrieve(address, public_symbol_ptr, &public_address) &&
- (!function_ptr || public_address > function_base)) {
- public_symbol.get()->CopyFrom(public_symbol_ptr);
- result->parameter_size = public_symbol->parameter_size;
- }
-
- return NULL;
-}
-
-CFIFrameInfo *FastSourceLineResolver::Module::FindCFIFrameInfo(
- const StackFrame *frame) const {
- MemAddr address = frame->instruction - frame->module->base_address();
- MemAddr initial_base, initial_size;
- const char* initial_rules = NULL;
-
- // Find the initial rule whose range covers this address. That
- // provides an initial set of register recovery rules. Then, walk
- // forward from the initial rule's starting address to frame's
- // instruction address, applying delta rules.
- if (!cfi_initial_rules_.RetrieveRange(address, initial_rules,
- &initial_base, &initial_size)) {
- return NULL;
- }
-
- // Create a frame info structure, and populate it with the rules from
- // the STACK CFI INIT record.
- scoped_ptr<CFIFrameInfo> rules(new CFIFrameInfo());
- if (!ParseCFIRuleSet(initial_rules, rules.get()))
- return NULL;
-
- // Find the first delta rule that falls within the initial rule's range.
- StaticMap<MemAddr, char>::iterator delta =
- cfi_delta_rules_.lower_bound(initial_base);
-
- // Apply delta rules up to and including the frame's address.
- while (delta != cfi_delta_rules_.end() && delta.GetKey() <= address) {
- ParseCFIRuleSet(delta.GetValuePtr(), rules.get());
- delta++;
- }
-
- return rules.release();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_types.h b/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_types.h
deleted file mode 100644
index 2c010470f5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_types.h
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// fast_source_line_resolver_types.h: definition of nested classes/structs in
-// FastSourceLineResolver. It moves the definitions out of
-// fast_source_line_resolver.cc, so that other classes could have access
-// to these private nested types without including fast_source_line_resolver.cc
-//
-// Author: lambxsy@google.com (Siyang Xie)
-
-#ifndef PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__
-#define PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__
-
-#include "google_breakpad/processor/fast_source_line_resolver.h"
-#include "processor/source_line_resolver_base_types.h"
-
-#include <map>
-#include <string>
-
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/static_address_map-inl.h"
-#include "processor/static_contained_range_map-inl.h"
-#include "processor/static_map.h"
-#include "processor/static_range_map-inl.h"
-#include "processor/windows_frame_info.h"
-
-namespace google_breakpad {
-
-struct FastSourceLineResolver::Line : public SourceLineResolverBase::Line {
- void CopyFrom(const Line *line_ptr) {
- const char *raw = reinterpret_cast<const char*>(line_ptr);
- CopyFrom(raw);
- }
-
- // De-serialize the memory data of a Line.
- void CopyFrom(const char *raw) {
- address = *(reinterpret_cast<const MemAddr*>(raw));
- size = *(reinterpret_cast<const MemAddr*>(raw + sizeof(address)));
- source_file_id = *(reinterpret_cast<const int32_t *>(
- raw + 2 * sizeof(address)));
- line = *(reinterpret_cast<const int32_t*>(
- raw + 2 * sizeof(address) + sizeof(source_file_id)));
- }
-};
-
-struct FastSourceLineResolver::Function :
-public SourceLineResolverBase::Function {
- void CopyFrom(const Function *func_ptr) {
- const char *raw = reinterpret_cast<const char*>(func_ptr);
- CopyFrom(raw);
- }
-
- // De-serialize the memory data of a Function.
- void CopyFrom(const char *raw) {
- size_t name_size = strlen(raw) + 1;
- name = raw;
- address = *(reinterpret_cast<const MemAddr*>(raw + name_size));
- size = *(reinterpret_cast<const MemAddr*>(
- raw + name_size + sizeof(MemAddr)));
- parameter_size = *(reinterpret_cast<const int32_t*>(
- raw + name_size + 2 * sizeof(MemAddr)));
- lines = StaticRangeMap<MemAddr, Line>(
- raw + name_size + 2 * sizeof(MemAddr) + sizeof(int32_t));
- }
-
- StaticRangeMap<MemAddr, Line> lines;
-};
-
-struct FastSourceLineResolver::PublicSymbol :
-public SourceLineResolverBase::PublicSymbol {
- void CopyFrom(const PublicSymbol *public_symbol_ptr) {
- const char *raw = reinterpret_cast<const char*>(public_symbol_ptr);
- CopyFrom(raw);
- }
-
- // De-serialize the memory data of a PublicSymbol.
- void CopyFrom(const char *raw) {
- size_t name_size = strlen(raw) + 1;
- name = raw;
- address = *(reinterpret_cast<const MemAddr*>(raw + name_size));
- parameter_size = *(reinterpret_cast<const int32_t*>(
- raw + name_size + sizeof(MemAddr)));
- }
-};
-
-class FastSourceLineResolver::Module: public SourceLineResolverBase::Module {
- public:
- explicit Module(const string &name) : name_(name), is_corrupt_(false) { }
- virtual ~Module() { }
-
- // Looks up the given relative address, and fills the StackFrame struct
- // with the result.
- virtual void LookupAddress(StackFrame *frame) const;
-
- // Loads a map from the given buffer in char* type.
- virtual bool LoadMapFromMemory(char *memory_buffer,
- size_t memory_buffer_size);
-
- // Tells whether the loaded symbol data is corrupt. Return value is
- // undefined, if the symbol data hasn't been loaded yet.
- virtual bool IsCorrupt() const { return is_corrupt_; }
-
- // If Windows stack walking information is available covering ADDRESS,
- // return a WindowsFrameInfo structure describing it. If the information
- // is not available, returns NULL. A NULL return value does not indicate
- // an error. The caller takes ownership of any returned WindowsFrameInfo
- // object.
- virtual WindowsFrameInfo *FindWindowsFrameInfo(const StackFrame *frame) const;
-
- // If CFI stack walking information is available covering ADDRESS,
- // return a CFIFrameInfo structure describing it. If the information
- // is not available, return NULL. The caller takes ownership of any
- // returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const;
-
- // Number of serialized map components of Module.
- static const int kNumberMaps_ = 5 + WindowsFrameInfo::STACK_INFO_LAST;
-
- private:
- friend class FastSourceLineResolver;
- friend class ModuleComparer;
- typedef StaticMap<int, char> FileMap;
-
- string name_;
- StaticMap<int, char> files_;
- StaticRangeMap<MemAddr, Function> functions_;
- StaticAddressMap<MemAddr, PublicSymbol> public_symbols_;
- bool is_corrupt_;
-
- // Each element in the array is a ContainedRangeMap for a type
- // listed in WindowsFrameInfoTypes. These are split by type because
- // there may be overlaps between maps of different types, but some
- // information is only available as certain types.
- StaticContainedRangeMap<MemAddr, char>
- windows_frame_info_[WindowsFrameInfo::STACK_INFO_LAST];
-
- // DWARF CFI stack walking data. The Module stores the initial rule sets
- // and rule deltas as strings, just as they appear in the symbol file:
- // although the file may contain hundreds of thousands of STACK CFI
- // records, walking a stack will only ever use a few of them, so it's
- // best to delay parsing a record until it's actually needed.
- //
- // STACK CFI INIT records: for each range, an initial set of register
- // recovery rules. The RangeMap's itself gives the starting and ending
- // addresses.
- StaticRangeMap<MemAddr, char> cfi_initial_rules_;
-
- // STACK CFI records: at a given address, the changes to the register
- // recovery rules that take effect at that address. The map key is the
- // starting address; the ending address is the key of the next entry in
- // this map, or the end of the range as given by the cfi_initial_rules_
- // entry (which FindCFIFrameInfo looks up first).
- StaticMap<MemAddr, char> cfi_delta_rules_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_FAST_SOURCE_LINE_RESOLVER_TYPES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_unittest.cc
deleted file mode 100644
index c7215228e9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/fast_source_line_resolver_unittest.cc
+++ /dev/null
@@ -1,491 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// fast_source_line_resolver_unittest.cc: Unit tests for FastSourceLineResolver.
-// Two different approaches for testing fast source line resolver:
-// First, use the same unit test data for basic source line resolver.
-// Second, read data from symbol files, load them as basic modules, and then
-// serialize them and load the serialized data as fast modules. Then compare
-// modules to assure the fast module contains exactly the same data as
-// basic module.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <sstream>
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "processor/logging.h"
-#include "processor/module_serializer.h"
-#include "processor/module_comparer.h"
-
-namespace {
-
-using google_breakpad::SourceLineResolverBase;
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::FastSourceLineResolver;
-using google_breakpad::ModuleSerializer;
-using google_breakpad::ModuleComparer;
-using google_breakpad::CFIFrameInfo;
-using google_breakpad::CodeModule;
-using google_breakpad::MemoryRegion;
-using google_breakpad::StackFrame;
-using google_breakpad::WindowsFrameInfo;
-using google_breakpad::linked_ptr;
-using google_breakpad::scoped_ptr;
-
-class TestCodeModule : public CodeModule {
- public:
- explicit TestCodeModule(string code_file) : code_file_(code_file) {}
- virtual ~TestCodeModule() {}
-
- virtual uint64_t base_address() const { return 0; }
- virtual uint64_t size() const { return 0xb000; }
- virtual string code_file() const { return code_file_; }
- virtual string code_identifier() const { return ""; }
- virtual string debug_file() const { return ""; }
- virtual string debug_identifier() const { return ""; }
- virtual string version() const { return ""; }
- virtual CodeModule* Copy() const {
- return new TestCodeModule(code_file_);
- }
- virtual uint64_t shrink_down_delta() const { return 0; }
- virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
-
- private:
- string code_file_;
-};
-
-// A mock memory region object, for use by the STACK CFI tests.
-class MockMemoryRegion: public MemoryRegion {
- uint64_t GetBase() const { return 0x10000; }
- uint32_t GetSize() const { return 0x01000; }
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
- *value = address & 0xff;
- return true;
- }
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
- *value = address & 0xffff;
- return true;
- }
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
- switch (address) {
- case 0x10008: *value = 0x98ecadc3; break; // saved %ebx
- case 0x1000c: *value = 0x878f7524; break; // saved %esi
- case 0x10010: *value = 0x6312f9a5; break; // saved %edi
- case 0x10014: *value = 0x10038; break; // caller's %ebp
- case 0x10018: *value = 0xf6438648; break; // return address
- default: *value = 0xdeadbeef; break; // junk
- }
- return true;
- }
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
- *value = address;
- return true;
- }
- void Print() const {
- assert(false);
- }
-};
-
-// Verify that, for every association in ACTUAL, EXPECTED has the same
-// association. (That is, ACTUAL's associations should be a subset of
-// EXPECTED's.) Also verify that ACTUAL has associations for ".ra" and
-// ".cfa".
-static bool VerifyRegisters(
- const char *file, int line,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &expected,
- const CFIFrameInfo::RegisterValueMap<uint32_t> &actual) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator a;
- a = actual.find(".cfa");
- if (a == actual.end())
- return false;
- a = actual.find(".ra");
- if (a == actual.end())
- return false;
- for (a = actual.begin(); a != actual.end(); a++) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator e =
- expected.find(a->first);
- if (e == expected.end()) {
- fprintf(stderr, "%s:%d: unexpected register '%s' recovered, value 0x%x\n",
- file, line, a->first.c_str(), a->second);
- return false;
- }
- if (e->second != a->second) {
- fprintf(stderr,
- "%s:%d: register '%s' recovered value was 0x%x, expected 0x%x\n",
- file, line, a->first.c_str(), a->second, e->second);
- return false;
- }
- // Don't complain if this doesn't recover all registers. Although
- // the DWARF spec says that unmentioned registers are undefined,
- // GCC uses omission to mean that they are unchanged.
- }
- return true;
-}
-
-static bool VerifyEmpty(const StackFrame &frame) {
- if (frame.function_name.empty() &&
- frame.source_file_name.empty() &&
- frame.source_line == 0)
- return true;
- return false;
-}
-
-static void ClearSourceLineInfo(StackFrame *frame) {
- frame->function_name.clear();
- frame->module = NULL;
- frame->source_file_name.clear();
- frame->source_line = 0;
-}
-
-class TestFastSourceLineResolver : public ::testing::Test {
- public:
- void SetUp() {
- testdata_dir = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata";
- }
-
- string symbol_file(int file_index) {
- std::stringstream ss;
- ss << testdata_dir << "/module" << file_index << ".out";
- return ss.str();
- }
-
- ModuleSerializer serializer;
- BasicSourceLineResolver basic_resolver;
- FastSourceLineResolver fast_resolver;
- ModuleComparer module_comparer;
-
- string testdata_dir;
-};
-
-// Test adapted from basic_source_line_resolver_unittest.
-TEST_F(TestFastSourceLineResolver, TestLoadAndResolve) {
- TestCodeModule module1("module1");
- ASSERT_TRUE(basic_resolver.LoadModule(&module1, symbol_file(1)));
- ASSERT_TRUE(basic_resolver.HasModule(&module1));
- // Convert module1 to fast_module:
- ASSERT_TRUE(serializer.ConvertOneModule(
- module1.code_file(), &basic_resolver, &fast_resolver));
- ASSERT_TRUE(fast_resolver.HasModule(&module1));
-
- TestCodeModule module2("module2");
- ASSERT_TRUE(basic_resolver.LoadModule(&module2, symbol_file(2)));
- ASSERT_TRUE(basic_resolver.HasModule(&module2));
- // Convert module2 to fast_module:
- ASSERT_TRUE(serializer.ConvertOneModule(
- module2.code_file(), &basic_resolver, &fast_resolver));
- ASSERT_TRUE(fast_resolver.HasModule(&module2));
-
- StackFrame frame;
- scoped_ptr<WindowsFrameInfo> windows_frame_info;
- scoped_ptr<CFIFrameInfo> cfi_frame_info;
- frame.instruction = 0x1000;
- frame.module = NULL;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_FALSE(frame.module);
- ASSERT_TRUE(frame.function_name.empty());
- ASSERT_EQ(frame.function_base, 0U);
- ASSERT_TRUE(frame.source_file_name.empty());
- ASSERT_EQ(frame.source_line, 0);
- ASSERT_EQ(frame.source_line_base, 0U);
-
- frame.module = &module1;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function1_1");
- ASSERT_TRUE(frame.module);
- ASSERT_EQ(frame.module->code_file(), "module1");
- ASSERT_EQ(frame.function_base, 0x1000U);
- ASSERT_EQ(frame.source_file_name, "file1_1.cc");
- ASSERT_EQ(frame.source_line, 44);
- ASSERT_EQ(frame.source_line_base, 0x1000U);
- windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_FALSE(windows_frame_info->allocates_base_pointer);
- ASSERT_EQ(windows_frame_info->program_string,
- "$eip 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =");
-
- ClearSourceLineInfo(&frame);
- frame.instruction = 0x800;
- frame.module = &module1;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_TRUE(VerifyEmpty(frame));
- windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame));
- ASSERT_FALSE(windows_frame_info.get());
-
- frame.instruction = 0x1280;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function1_3");
- ASSERT_TRUE(frame.source_file_name.empty());
- ASSERT_EQ(frame.source_line, 0);
- windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_UNKNOWN);
- ASSERT_FALSE(windows_frame_info->allocates_base_pointer);
- ASSERT_TRUE(windows_frame_info->program_string.empty());
-
- frame.instruction = 0x1380;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function1_4");
- ASSERT_TRUE(frame.source_file_name.empty());
- ASSERT_EQ(frame.source_line, 0);
- windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA);
- ASSERT_FALSE(windows_frame_info->allocates_base_pointer);
- ASSERT_FALSE(windows_frame_info->program_string.empty());
-
- frame.instruction = 0x2000;
- windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame));
- ASSERT_FALSE(windows_frame_info.get());
-
- // module1 has STACK CFI records covering 3d40..3def;
- // module2 has STACK CFI records covering 3df0..3e9f;
- // check that FindCFIFrameInfo doesn't claim to find any outside those ranges.
- frame.instruction = 0x3d3f;
- frame.module = &module1;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_FALSE(cfi_frame_info.get());
-
- frame.instruction = 0x3e9f;
- frame.module = &module1;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_FALSE(cfi_frame_info.get());
-
- CFIFrameInfo::RegisterValueMap<uint32_t> current_registers;
- CFIFrameInfo::RegisterValueMap<uint32_t> caller_registers;
- CFIFrameInfo::RegisterValueMap<uint32_t> expected_caller_registers;
- MockMemoryRegion memory;
-
- // Regardless of which instruction evaluation takes place at, it
- // should produce the same values for the caller's registers.
- expected_caller_registers[".cfa"] = 0x1001c;
- expected_caller_registers[".ra"] = 0xf6438648;
- expected_caller_registers["$ebp"] = 0x10038;
- expected_caller_registers["$ebx"] = 0x98ecadc3;
- expected_caller_registers["$esi"] = 0x878f7524;
- expected_caller_registers["$edi"] = 0x6312f9a5;
-
- frame.instruction = 0x3d40;
- frame.module = &module1;
- current_registers.clear();
- current_registers["$esp"] = 0x10018;
- current_registers["$ebp"] = 0x10038;
- current_registers["$ebx"] = 0x98ecadc3;
- current_registers["$esi"] = 0x878f7524;
- current_registers["$edi"] = 0x6312f9a5;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- ASSERT_TRUE(VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers));
-
- frame.instruction = 0x3d41;
- current_registers["$esp"] = 0x10014;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- ASSERT_TRUE(VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers));
-
- frame.instruction = 0x3d43;
- current_registers["$ebp"] = 0x10014;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x3d54;
- current_registers["$ebx"] = 0x6864f054U;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x3d5a;
- current_registers["$esi"] = 0x6285f79aU;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x3d84;
- current_registers["$edi"] = 0x64061449U;
- cfi_frame_info.reset(fast_resolver.FindCFIFrameInfo(&frame));
- ASSERT_TRUE(cfi_frame_info.get());
- ASSERT_TRUE(cfi_frame_info.get()
- ->FindCallerRegs<uint32_t>(current_registers, memory,
- &caller_registers));
- VerifyRegisters(__FILE__, __LINE__,
- expected_caller_registers, caller_registers);
-
- frame.instruction = 0x2900;
- frame.module = &module1;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, string("PublicSymbol"));
-
- frame.instruction = 0x4000;
- frame.module = &module1;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, string("LargeFunction"));
-
- frame.instruction = 0x2181;
- frame.module = &module2;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Function2_2");
- ASSERT_EQ(frame.function_base, 0x2170U);
- ASSERT_TRUE(frame.module);
- ASSERT_EQ(frame.module->code_file(), "module2");
- ASSERT_EQ(frame.source_file_name, "file2_2.cc");
- ASSERT_EQ(frame.source_line, 21);
- ASSERT_EQ(frame.source_line_base, 0x2180U);
- windows_frame_info.reset(fast_resolver.FindWindowsFrameInfo(&frame));
- ASSERT_TRUE(windows_frame_info.get());
- ASSERT_EQ(windows_frame_info->type_, WindowsFrameInfo::STACK_INFO_FRAME_DATA);
- ASSERT_EQ(windows_frame_info->prolog_size, 1U);
-
- frame.instruction = 0x216f;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Public2_1");
-
- ClearSourceLineInfo(&frame);
- frame.instruction = 0x219f;
- frame.module = &module2;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_TRUE(frame.function_name.empty());
-
- frame.instruction = 0x21a0;
- frame.module = &module2;
- fast_resolver.FillSourceLineInfo(&frame);
- ASSERT_EQ(frame.function_name, "Public2_2");
-}
-
-TEST_F(TestFastSourceLineResolver, TestInvalidLoads) {
- TestCodeModule module3("module3");
- ASSERT_TRUE(basic_resolver.LoadModule(&module3,
- testdata_dir + "/module3_bad.out"));
- ASSERT_TRUE(basic_resolver.HasModule(&module3));
- ASSERT_TRUE(basic_resolver.IsModuleCorrupt(&module3));
- // Convert module3 to fast_module:
- ASSERT_TRUE(serializer.ConvertOneModule(module3.code_file(),
- &basic_resolver,
- &fast_resolver));
- ASSERT_TRUE(fast_resolver.HasModule(&module3));
- ASSERT_TRUE(fast_resolver.IsModuleCorrupt(&module3));
-
- TestCodeModule module4("module4");
- ASSERT_TRUE(basic_resolver.LoadModule(&module4,
- testdata_dir + "/module4_bad.out"));
- ASSERT_TRUE(basic_resolver.HasModule(&module4));
- ASSERT_TRUE(basic_resolver.IsModuleCorrupt(&module4));
- // Convert module4 to fast_module:
- ASSERT_TRUE(serializer.ConvertOneModule(module4.code_file(),
- &basic_resolver,
- &fast_resolver));
- ASSERT_TRUE(fast_resolver.HasModule(&module4));
- ASSERT_TRUE(fast_resolver.IsModuleCorrupt(&module4));
-
- TestCodeModule module5("module5");
- ASSERT_FALSE(fast_resolver.LoadModule(&module5,
- testdata_dir + "/invalid-filename"));
- ASSERT_FALSE(fast_resolver.HasModule(&module5));
-
- TestCodeModule invalidmodule("invalid-module");
- ASSERT_FALSE(fast_resolver.HasModule(&invalidmodule));
-}
-
-TEST_F(TestFastSourceLineResolver, TestUnload) {
- TestCodeModule module1("module1");
- ASSERT_FALSE(basic_resolver.HasModule(&module1));
-
- ASSERT_TRUE(basic_resolver.LoadModule(&module1, symbol_file(1)));
- ASSERT_TRUE(basic_resolver.HasModule(&module1));
- // Convert module1 to fast_module.
- ASSERT_TRUE(serializer.ConvertOneModule(module1.code_file(),
- &basic_resolver,
- &fast_resolver));
- ASSERT_TRUE(fast_resolver.HasModule(&module1));
- basic_resolver.UnloadModule(&module1);
- fast_resolver.UnloadModule(&module1);
- ASSERT_FALSE(fast_resolver.HasModule(&module1));
-
- ASSERT_TRUE(basic_resolver.LoadModule(&module1, symbol_file(1)));
- ASSERT_TRUE(basic_resolver.HasModule(&module1));
- // Convert module1 to fast_module.
- ASSERT_TRUE(serializer.ConvertOneModule(module1.code_file(),
- &basic_resolver,
- &fast_resolver));
- ASSERT_TRUE(fast_resolver.HasModule(&module1));
-}
-
-TEST_F(TestFastSourceLineResolver, CompareModule) {
- char *symbol_data;
- size_t symbol_data_size;
- string symbol_data_string;
- string filename;
-
- for (int module_index = 0; module_index < 3; ++module_index) {
- std::stringstream ss;
- ss << testdata_dir << "/module" << module_index << ".out";
- filename = ss.str();
- ASSERT_TRUE(SourceLineResolverBase::ReadSymbolFile(
- symbol_file(module_index), &symbol_data, &symbol_data_size));
- symbol_data_string.assign(symbol_data, symbol_data_size);
- delete [] symbol_data;
- ASSERT_TRUE(module_comparer.Compare(symbol_data_string));
- }
-}
-
-} // namespace
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/linked_ptr.h b/toolkit/crashreporter/google-breakpad/src/processor/linked_ptr.h
deleted file mode 100644
index 72fbba84a9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/linked_ptr.h
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A "smart" pointer type with reference tracking. Every pointer to a
-// particular object is kept on a circular linked list. When the last pointer
-// to an object is destroyed or reassigned, the object is deleted.
-//
-// Used properly, this deletes the object when the last reference goes away.
-// There are several caveats:
-// - Like all reference counting schemes, cycles lead to leaks.
-// - Each smart pointer is actually two pointers (8 bytes instead of 4).
-// - Every time a pointer is assigned, the entire list of pointers to that
-// object is traversed. This class is therefore NOT SUITABLE when there
-// will often be more than two or three pointers to a particular object.
-// - References are only tracked as long as linked_ptr<> objects are copied.
-// If a linked_ptr<> is converted to a raw pointer and back, BAD THINGS
-// will happen (double deletion).
-//
-// A good use of this class is storing object references in STL containers.
-// You can safely put linked_ptr<> in a vector<>.
-// Other uses may not be as good.
-//
-// Note: If you use an incomplete type with linked_ptr<>, the class
-// *containing* linked_ptr<> must have a constructor and destructor (even
-// if they do nothing!).
-
-#ifndef PROCESSOR_LINKED_PTR_H__
-#define PROCESSOR_LINKED_PTR_H__
-
-namespace google_breakpad {
-
-// This is used internally by all instances of linked_ptr<>. It needs to be
-// a non-template class because different types of linked_ptr<> can refer to
-// the same object (linked_ptr<Superclass>(obj) vs linked_ptr<Subclass>(obj)).
-// So, it needs to be possible for different types of linked_ptr to participate
-// in the same circular linked list, so we need a single class type here.
-//
-// DO NOT USE THIS CLASS DIRECTLY YOURSELF. Use linked_ptr<T>.
-class linked_ptr_internal {
- public:
- // Create a new circle that includes only this instance.
- void join_new() {
- next_ = this;
- }
-
- // Join an existing circle.
- void join(linked_ptr_internal const* ptr) {
- linked_ptr_internal const* p = ptr;
- while (p->next_ != ptr) p = p->next_;
- p->next_ = this;
- next_ = ptr;
- }
-
- // Leave whatever circle we're part of. Returns true iff we were the
- // last member of the circle. Once this is done, you can join() another.
- bool depart() {
- if (next_ == this) return true;
- linked_ptr_internal const* p = next_;
- while (p->next_ != this) p = p->next_;
- p->next_ = next_;
- return false;
- }
-
- private:
- mutable linked_ptr_internal const* next_;
-};
-
-template <typename T>
-class linked_ptr {
- public:
- typedef T element_type;
-
- // Take over ownership of a raw pointer. This should happen as soon as
- // possible after the object is created.
- explicit linked_ptr(T* ptr = NULL) { capture(ptr); }
- ~linked_ptr() { depart(); }
-
- // Copy an existing linked_ptr<>, adding ourselves to the list of references.
- template <typename U> linked_ptr(linked_ptr<U> const& ptr) { copy(&ptr); }
- linked_ptr(linked_ptr const& ptr) { copy(&ptr); }
-
- // Assignment releases the old value and acquires the new.
- template <typename U> linked_ptr& operator=(linked_ptr<U> const& ptr) {
- depart();
- copy(&ptr);
- return *this;
- }
-
- linked_ptr& operator=(linked_ptr const& ptr) {
- if (&ptr != this) {
- depart();
- copy(&ptr);
- }
- return *this;
- }
-
- // Smart pointer members.
- void reset(T* ptr = NULL) { depart(); capture(ptr); }
- T* get() const { return value_; }
- T* operator->() const { return value_; }
- T& operator*() const { return *value_; }
- // Release ownership of the pointed object and returns it.
- // Sole ownership by this linked_ptr object is required.
- T* release() {
- link_.depart();
- T* v = value_;
- value_ = NULL;
- return v;
- }
-
- bool operator==(T* p) const { return value_ == p; }
- bool operator!=(T* p) const { return value_ != p; }
- template <typename U>
- bool operator==(linked_ptr<U> const& ptr) const {
- return value_ == ptr.get();
- }
- template <typename U>
- bool operator!=(linked_ptr<U> const& ptr) const {
- return value_ != ptr.get();
- }
-
- private:
- template <typename U>
- friend class linked_ptr;
-
- T* value_;
- linked_ptr_internal link_;
-
- void depart() {
- if (link_.depart()) delete value_;
- }
-
- void capture(T* ptr) {
- value_ = ptr;
- link_.join_new();
- }
-
- template <typename U> void copy(linked_ptr<U> const* ptr) {
- value_ = ptr->get();
- if (value_)
- link_.join(&ptr->link_);
- else
- link_.join_new();
- }
-};
-
-template<typename T> inline
-bool operator==(T* ptr, const linked_ptr<T>& x) {
- return ptr == x.get();
-}
-
-template<typename T> inline
-bool operator!=(T* ptr, const linked_ptr<T>& x) {
- return ptr != x.get();
-}
-
-// A function to convert T* into linked_ptr<T>
-// Doing e.g. make_linked_ptr(new FooBarBaz<type>(arg)) is a shorter notation
-// for linked_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
-template <typename T>
-linked_ptr<T> make_linked_ptr(T* ptr) {
- return linked_ptr<T>(ptr);
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_LINKED_PTR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/logging.cc b/toolkit/crashreporter/google-breakpad/src/processor/logging.cc
deleted file mode 100644
index c1eebbc223..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/logging.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// logging.cc: Breakpad logging
-//
-// See logging.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include <assert.h>
-#include <errno.h>
-#include <string.h>
-#include <time.h>
-
-#include <string>
-
-#include "common/stdio_wrapper.h"
-#include "common/using_std_string.h"
-#include "processor/logging.h"
-#include "processor/pathname_stripper.h"
-
-namespace google_breakpad {
-
-LogStream::LogStream(std::ostream &stream, Severity severity,
- const char *file, int line)
- : stream_(stream) {
- time_t clock;
- time(&clock);
- struct tm tm_struct;
-#ifdef _WIN32
- localtime_s(&tm_struct, &clock);
-#else
- localtime_r(&clock, &tm_struct);
-#endif
- char time_string[20];
- strftime(time_string, sizeof(time_string), "%Y-%m-%d %H:%M:%S", &tm_struct);
-
- const char *severity_string = "UNKNOWN_SEVERITY";
- switch (severity) {
- case SEVERITY_INFO:
- severity_string = "INFO";
- break;
- case SEVERITY_ERROR:
- severity_string = "ERROR";
- break;
- }
-
- stream_ << time_string << ": " << PathnameStripper::File(file) << ":" <<
- line << ": " << severity_string << ": ";
-}
-
-LogStream::~LogStream() {
- stream_ << std::endl;
-}
-
-string HexString(uint32_t number) {
- char buffer[11];
- snprintf(buffer, sizeof(buffer), "0x%x", number);
- return string(buffer);
-}
-
-string HexString(uint64_t number) {
- char buffer[19];
- snprintf(buffer, sizeof(buffer), "0x%" PRIx64, number);
- return string(buffer);
-}
-
-string HexString(int number) {
- char buffer[19];
- snprintf(buffer, sizeof(buffer), "0x%x", number);
- return string(buffer);
-}
-
-int ErrnoString(string *error_string) {
- assert(error_string);
-
- // strerror isn't necessarily thread-safe. strerror_r would be preferrable,
- // but GNU libc uses a nonstandard strerror_r by default, which returns a
- // char* (rather than an int success indicator) and doesn't necessarily
- // use the supplied buffer.
- error_string->assign(strerror(errno));
- return errno;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/logging.h b/toolkit/crashreporter/google-breakpad/src/processor/logging.h
deleted file mode 100644
index 406fb67cf6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/logging.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// logging.h: Breakpad logging
-//
-// Breakpad itself uses Breakpad logging with statements of the form:
-// BPLOG(severity) << "message";
-// severity may be INFO, ERROR, or other values defined in this file.
-//
-// BPLOG is an overridable macro so that users can customize Breakpad's
-// logging. Left at the default, logging messages are sent to stderr along
-// with a timestamp and the source code location that produced a message.
-// The streams may be changed by redefining BPLOG_*_STREAM, the logging
-// behavior may be changed by redefining BPLOG_*, and the entire logging
-// system may be overridden by redefining BPLOG(severity). These
-// redefinitions may be passed to the preprocessor as a command-line flag
-// (-D).
-//
-// If an additional header is required to override Breakpad logging, it can
-// be specified by the BP_LOGGING_INCLUDE macro. If defined, this header
-// will #include the header specified by that macro.
-//
-// If any initialization is needed before logging, it can be performed by
-// a function called through the BPLOG_INIT macro. Each main function of
-// an executable program in the Breakpad processor library calls
-// BPLOG_INIT(&argc, &argv); before any logging can be performed; define
-// BPLOG_INIT appropriately if initialization is required.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_LOGGING_H__
-#define PROCESSOR_LOGGING_H__
-
-#include <iostream>
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-
-#ifdef BP_LOGGING_INCLUDE
-#include BP_LOGGING_INCLUDE
-#endif // BP_LOGGING_INCLUDE
-
-#ifndef THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_
-namespace base_logging {
-
-// The open-source copy of logging.h has diverged from Google's internal copy
-// (temporarily, at least). To support the transition to structured logging
-// a definition for base_logging::LogMessage is needed, which is a ostream-
-// like object for streaming arguments to construct a log message.
-typedef std::ostream LogMessage;
-
-} // namespace base_logging
-#endif // THIRD_PARTY_BREAKPAD_GOOGLE_GLUE_LOGGING_H_
-
-namespace google_breakpad {
-
-// These are defined in Microsoft headers.
-#ifdef SEVERITY_ERROR
-#undef SEVERITY_ERROR
-#endif
-
-#ifdef ERROR
-#undef ERROR
-#endif
-
-class LogStream {
- public:
- enum Severity {
- SEVERITY_INFO,
- SEVERITY_ERROR
- };
-
- // Begin logging a message to the stream identified by |stream|, at the
- // indicated severity. The file and line parameters should be set so as to
- // identify the line of source code that is producing a message.
- LogStream(std::ostream &stream, Severity severity,
- const char *file, int line);
-
- // Finish logging by printing a newline and flushing the output stream.
- ~LogStream();
-
- template<typename T> std::ostream& operator<<(const T &t) {
- return stream_ << t;
- }
-
- private:
- std::ostream &stream_;
-
- // Disallow copy constructor and assignment operator
- explicit LogStream(const LogStream &that);
- void operator=(const LogStream &that);
-};
-
-// This class is used to explicitly ignore values in the conditional logging
-// macros. This avoids compiler warnings like "value computed is not used"
-// and "statement has no effect".
-class LogMessageVoidify {
- public:
- LogMessageVoidify() {}
-
- // This has to be an operator with a precedence lower than << but higher
- // than ?:
- void operator&(base_logging::LogMessage &) {}
-};
-
-// Returns number formatted as a hexadecimal string, such as "0x7b".
-string HexString(uint32_t number);
-string HexString(uint64_t number);
-string HexString(int number);
-
-// Returns the error code as set in the global errno variable, and sets
-// error_string, a required argument, to a string describing that error
-// code.
-int ErrnoString(string *error_string);
-
-} // namespace google_breakpad
-
-#ifndef BPLOG_INIT
-#define BPLOG_INIT(pargc, pargv)
-#endif // BPLOG_INIT
-
-#define BPLOG_LAZY_STREAM(stream, condition) \
- !(condition) ? (void) 0 : \
- google_breakpad::LogMessageVoidify() & (BPLOG_ ## stream)
-
-#ifndef BPLOG_MINIMUM_SEVERITY
-#define BPLOG_MINIMUM_SEVERITY SEVERITY_INFO
-#endif
-
-#define BPLOG_LOG_IS_ON(severity) \
- ((google_breakpad::LogStream::SEVERITY_ ## severity) >= \
- (google_breakpad::LogStream::BPLOG_MINIMUM_SEVERITY))
-
-#ifndef BPLOG
-#define BPLOG(severity) BPLOG_LAZY_STREAM(severity, BPLOG_LOG_IS_ON(severity))
-#endif // BPLOG
-
-#ifndef BPLOG_INFO
-#ifndef BPLOG_INFO_STREAM
-#define BPLOG_INFO_STREAM std::clog
-#endif // BPLOG_INFO_STREAM
-#define BPLOG_INFO google_breakpad::LogStream(BPLOG_INFO_STREAM, \
- google_breakpad::LogStream::SEVERITY_INFO, \
- __FILE__, __LINE__)
-#endif // BPLOG_INFO
-
-#ifndef BPLOG_ERROR
-#ifndef BPLOG_ERROR_STREAM
-#define BPLOG_ERROR_STREAM std::cerr
-#endif // BPLOG_ERROR_STREAM
-#define BPLOG_ERROR google_breakpad::LogStream(BPLOG_ERROR_STREAM, \
- google_breakpad::LogStream::SEVERITY_ERROR, \
- __FILE__, __LINE__)
-#endif // BPLOG_ERROR
-
-#define BPLOG_IF(severity, condition) \
- BPLOG_LAZY_STREAM(severity, ((condition) && BPLOG_LOG_IS_ON(severity)))
-
-#endif // PROCESSOR_LOGGING_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/map_serializers-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/map_serializers-inl.h
deleted file mode 100644
index 61c7bbd7c8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/map_serializers-inl.h
+++ /dev/null
@@ -1,266 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// map_serializers_inl.h: implementation for serializing std::map and its
-// wrapper classes.
-//
-// See map_serializers.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_MAP_SERIALIZERS_INL_H__
-#define PROCESSOR_MAP_SERIALIZERS_INL_H__
-
-#include <map>
-#include <string>
-
-#include "processor/map_serializers.h"
-#include "processor/simple_serializer.h"
-
-#include "processor/address_map-inl.h"
-#include "processor/range_map-inl.h"
-#include "processor/contained_range_map-inl.h"
-
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename Key, typename Value>
-size_t StdMapSerializer<Key, Value>::SizeOf(
- const std::map<Key, Value> &m) const {
- size_t size = 0;
- size_t header_size = (1 + m.size()) * sizeof(uint32_t);
- size += header_size;
-
- typename std::map<Key, Value>::const_iterator iter;
- for (iter = m.begin(); iter != m.end(); ++iter) {
- size += key_serializer_.SizeOf(iter->first);
- size += value_serializer_.SizeOf(iter->second);
- }
- return size;
-}
-
-template<typename Key, typename Value>
-char *StdMapSerializer<Key, Value>::Write(const std::map<Key, Value> &m,
- char *dest) const {
- if (!dest) {
- BPLOG(ERROR) << "StdMapSerializer failed: write to NULL address.";
- return NULL;
- }
- char *start_address = dest;
-
- // Write header:
- // Number of nodes.
- dest = SimpleSerializer<uint32_t>::Write(m.size(), dest);
- // Nodes offsets.
- uint32_t *offsets = reinterpret_cast<uint32_t*>(dest);
- dest += sizeof(uint32_t) * m.size();
-
- char *key_address = dest;
- dest += sizeof(Key) * m.size();
-
- // Traverse map.
- typename std::map<Key, Value>::const_iterator iter;
- int index = 0;
- for (iter = m.begin(); iter != m.end(); ++iter, ++index) {
- offsets[index] = static_cast<uint32_t>(dest - start_address);
- key_address = key_serializer_.Write(iter->first, key_address);
- dest = value_serializer_.Write(iter->second, dest);
- }
- return dest;
-}
-
-template<typename Key, typename Value>
-char *StdMapSerializer<Key, Value>::Serialize(
- const std::map<Key, Value> &m, unsigned int *size) const {
- // Compute size of memory to be allocated.
- unsigned int size_to_alloc = SizeOf(m);
- // Allocate memory.
- char *serialized_data = new char[size_to_alloc];
- if (!serialized_data) {
- BPLOG(INFO) << "StdMapSerializer memory allocation failed.";
- if (size) *size = 0;
- return NULL;
- }
- // Write serialized data into memory.
- Write(m, serialized_data);
-
- if (size) *size = size_to_alloc;
- return serialized_data;
-}
-
-template<typename Address, typename Entry>
-size_t RangeMapSerializer<Address, Entry>::SizeOf(
- const RangeMap<Address, Entry> &m) const {
- size_t size = 0;
- size_t header_size = (1 + m.map_.size()) * sizeof(uint32_t);
- size += header_size;
-
- typename std::map<Address, Range>::const_iterator iter;
- for (iter = m.map_.begin(); iter != m.map_.end(); ++iter) {
- // Size of key (high address).
- size += address_serializer_.SizeOf(iter->first);
- // Size of base (low address).
- size += address_serializer_.SizeOf(iter->second.base());
- // Size of entry.
- size += entry_serializer_.SizeOf(iter->second.entry());
- }
- return size;
-}
-
-template<typename Address, typename Entry>
-char *RangeMapSerializer<Address, Entry>::Write(
- const RangeMap<Address, Entry> &m, char *dest) const {
- if (!dest) {
- BPLOG(ERROR) << "RangeMapSerializer failed: write to NULL address.";
- return NULL;
- }
- char *start_address = dest;
-
- // Write header:
- // Number of nodes.
- dest = SimpleSerializer<uint32_t>::Write(m.map_.size(), dest);
- // Nodes offsets.
- uint32_t *offsets = reinterpret_cast<uint32_t*>(dest);
- dest += sizeof(uint32_t) * m.map_.size();
-
- char *key_address = dest;
- dest += sizeof(Address) * m.map_.size();
-
- // Traverse map.
- typename std::map<Address, Range>::const_iterator iter;
- int index = 0;
- for (iter = m.map_.begin(); iter != m.map_.end(); ++iter, ++index) {
- offsets[index] = static_cast<uint32_t>(dest - start_address);
- key_address = address_serializer_.Write(iter->first, key_address);
- dest = address_serializer_.Write(iter->second.base(), dest);
- dest = entry_serializer_.Write(iter->second.entry(), dest);
- }
- return dest;
-}
-
-template<typename Address, typename Entry>
-char *RangeMapSerializer<Address, Entry>::Serialize(
- const RangeMap<Address, Entry> &m, unsigned int *size) const {
- // Compute size of memory to be allocated.
- unsigned int size_to_alloc = SizeOf(m);
- // Allocate memory.
- char *serialized_data = new char[size_to_alloc];
- if (!serialized_data) {
- BPLOG(INFO) << "RangeMapSerializer memory allocation failed.";
- if (size) *size = 0;
- return NULL;
- }
-
- // Write serialized data into memory.
- Write(m, serialized_data);
-
- if (size) *size = size_to_alloc;
- return serialized_data;
-}
-
-
-template<class AddrType, class EntryType>
-size_t ContainedRangeMapSerializer<AddrType, EntryType>::SizeOf(
- const ContainedRangeMap<AddrType, EntryType> *m) const {
- size_t size = 0;
- size_t header_size = addr_serializer_.SizeOf(m->base_)
- + entry_serializer_.SizeOf(m->entry_)
- + sizeof(uint32_t);
- size += header_size;
- // In case m.map_ == NULL, we treat it as an empty map:
- size += sizeof(uint32_t);
- if (m->map_) {
- size += m->map_->size() * sizeof(uint32_t);
- typename Map::const_iterator iter;
- for (iter = m->map_->begin(); iter != m->map_->end(); ++iter) {
- size += addr_serializer_.SizeOf(iter->first);
- // Recursive calculation of size:
- size += SizeOf(iter->second);
- }
- }
- return size;
-}
-
-template<class AddrType, class EntryType>
-char *ContainedRangeMapSerializer<AddrType, EntryType>::Write(
- const ContainedRangeMap<AddrType, EntryType> *m, char *dest) const {
- if (!dest) {
- BPLOG(ERROR) << "StdMapSerializer failed: write to NULL address.";
- return NULL;
- }
- dest = addr_serializer_.Write(m->base_, dest);
- dest = SimpleSerializer<uint32_t>::Write(entry_serializer_.SizeOf(m->entry_),
- dest);
- dest = entry_serializer_.Write(m->entry_, dest);
-
- // Write map<<AddrType, ContainedRangeMap*>:
- char *map_address = dest;
- if (m->map_ == NULL) {
- dest = SimpleSerializer<uint32_t>::Write(0, dest);
- } else {
- dest = SimpleSerializer<uint32_t>::Write(m->map_->size(), dest);
- uint32_t *offsets = reinterpret_cast<uint32_t*>(dest);
- dest += sizeof(uint32_t) * m->map_->size();
-
- char *key_address = dest;
- dest += sizeof(AddrType) * m->map_->size();
-
- // Traverse map.
- typename Map::const_iterator iter;
- int index = 0;
- for (iter = m->map_->begin(); iter != m->map_->end(); ++iter, ++index) {
- offsets[index] = static_cast<uint32_t>(dest - map_address);
- key_address = addr_serializer_.Write(iter->first, key_address);
- // Recursively write.
- dest = Write(iter->second, dest);
- }
- }
- return dest;
-}
-
-template<class AddrType, class EntryType>
-char *ContainedRangeMapSerializer<AddrType, EntryType>::Serialize(
- const ContainedRangeMap<AddrType, EntryType> *m, unsigned int *size) const {
- unsigned int size_to_alloc = SizeOf(m);
- // Allocating memory.
- char *serialized_data = new char[size_to_alloc];
- if (!serialized_data) {
- BPLOG(INFO) << "ContainedRangeMapSerializer memory allocation failed.";
- if (size) *size = 0;
- return NULL;
- }
- Write(m, serialized_data);
- if (size) *size = size_to_alloc;
- return serialized_data;
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_MAP_SERIALIZERS_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/map_serializers.h b/toolkit/crashreporter/google-breakpad/src/processor/map_serializers.h
deleted file mode 100644
index a0b9d3fd67..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/map_serializers.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// map_serializers.h: defines templates for serializing std::map and its
-// wrappers: AddressMap, RangeMap, and ContainedRangeMap.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-
-#ifndef PROCESSOR_MAP_SERIALIZERS_H__
-#define PROCESSOR_MAP_SERIALIZERS_H__
-
-#include <map>
-#include <string>
-
-#include "processor/simple_serializer.h"
-
-#include "processor/address_map-inl.h"
-#include "processor/range_map-inl.h"
-#include "processor/contained_range_map-inl.h"
-
-namespace google_breakpad {
-
-// StdMapSerializer allocates memory and serializes an std::map instance into a
-// chunk of memory data.
-template<typename Key, typename Value>
-class StdMapSerializer {
- public:
- // Calculate the memory size of serialized data.
- size_t SizeOf(const std::map<Key, Value> &m) const;
-
- // Writes the serialized data to memory with start address = dest,
- // and returns the "end" of data, i.e., return the address follow the final
- // byte of data.
- // NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const std::map<Key, Value> &m, char* dest) const;
-
- // Serializes a std::map object into a chunk of memory data with format
- // described in "StaticMap.h" comment.
- // Returns a pointer to the serialized data. If size != NULL, *size is set
- // to the size of serialized data, i.e., SizeOf(m).
- // Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const std::map<Key, Value> &m, unsigned int *size) const;
-
- private:
- SimpleSerializer<Key> key_serializer_;
- SimpleSerializer<Value> value_serializer_;
-};
-
-// AddressMapSerializer allocates memory and serializes an AddressMap into a
-// chunk of memory data.
-template<typename Addr, typename Entry>
-class AddressMapSerializer {
- public:
- // Calculate the memory size of serialized data.
- size_t SizeOf(const AddressMap<Addr, Entry> &m) const {
- return std_map_serializer_.SizeOf(m.map_);
- }
-
- // Write the serialized data to specified memory location. Return the "end"
- // of data, i.e., return the address after the final byte of data.
- // NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const AddressMap<Addr, Entry> &m, char *dest) const {
- return std_map_serializer_.Write(m.map_, dest);
- }
-
- // Serializes an AddressMap object into a chunk of memory data.
- // Returns a pointer to the serialized data. If size != NULL, *size is set
- // to the size of serialized data, i.e., SizeOf(m).
- // Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const AddressMap<Addr, Entry> &m, unsigned int *size) const {
- return std_map_serializer_.Serialize(m.map_, size);
- }
-
- private:
- // AddressMapSerializer is a simple wrapper of StdMapSerializer, just as
- // AddressMap is a simple wrapper of std::map.
- StdMapSerializer<Addr, Entry> std_map_serializer_;
-};
-
-// RangeMapSerializer allocates memory and serializes a RangeMap instance into a
-// chunk of memory data.
-template<typename Address, typename Entry>
-class RangeMapSerializer {
- public:
- // Calculate the memory size of serialized data.
- size_t SizeOf(const RangeMap<Address, Entry> &m) const;
-
- // Write the serialized data to specified memory location. Return the "end"
- // of data, i.e., return the address after the final byte of data.
- // NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const RangeMap<Address, Entry> &m, char* dest) const;
-
- // Serializes a RangeMap object into a chunk of memory data.
- // Returns a pointer to the serialized data. If size != NULL, *size is set
- // to the size of serialized data, i.e., SizeOf(m).
- // Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const RangeMap<Address, Entry> &m, unsigned int *size) const;
-
- private:
- // Convenient type name for Range.
- typedef typename RangeMap<Address, Entry>::Range Range;
-
- // Serializer for RangeMap's key and Range::base_.
- SimpleSerializer<Address> address_serializer_;
- // Serializer for RangeMap::Range::entry_.
- SimpleSerializer<Entry> entry_serializer_;
-};
-
-// ContainedRangeMapSerializer allocates memory and serializes a
-// ContainedRangeMap instance into a chunk of memory data.
-template<class AddrType, class EntryType>
-class ContainedRangeMapSerializer {
- public:
- // Calculate the memory size of serialized data.
- size_t SizeOf(const ContainedRangeMap<AddrType, EntryType> *m) const;
-
- // Write the serialized data to specified memory location. Return the "end"
- // of data, i.e., return the address after the final byte of data.
- // NOTE: caller has to allocate enough memory before invoke Write() method.
- char* Write(const ContainedRangeMap<AddrType, EntryType> *m,
- char* dest) const;
-
- // Serializes a ContainedRangeMap object into a chunk of memory data.
- // Returns a pointer to the serialized data. If size != NULL, *size is set
- // to the size of serialized data, i.e., SizeOf(m).
- // Caller has the ownership of memory allocated as "new char[]".
- char* Serialize(const ContainedRangeMap<AddrType, EntryType> *m,
- unsigned int *size) const;
-
- private:
- // Convenient type name for the underlying map type.
- typedef std::map<AddrType, ContainedRangeMap<AddrType, EntryType>*> Map;
-
- // Serializer for addresses and entries stored in ContainedRangeMap.
- SimpleSerializer<AddrType> addr_serializer_;
- SimpleSerializer<EntryType> entry_serializer_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_MAP_SERIALIZERS_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/map_serializers_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/map_serializers_unittest.cc
deleted file mode 100644
index 0d872ec2e2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/map_serializers_unittest.cc
+++ /dev/null
@@ -1,386 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// map_serializers_unittest.cc: Unit tests for std::map serializer and
-// std::map wrapper serializers.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include <climits>
-#include <map>
-#include <string>
-#include <utility>
-#include <iostream>
-#include <sstream>
-
-#include "breakpad_googletest_includes.h"
-#include "map_serializers-inl.h"
-
-#include "processor/address_map-inl.h"
-#include "processor/range_map-inl.h"
-#include "processor/contained_range_map-inl.h"
-
-typedef int32_t AddrType;
-typedef int32_t EntryType;
-
-class TestStdMapSerializer : public ::testing::Test {
- protected:
- void SetUp() {
- serialized_size_ = 0;
- serialized_data_ = NULL;
- }
-
- void TearDown() {
- delete [] serialized_data_;
- }
-
- std::map<AddrType, EntryType> std_map_;
- google_breakpad::StdMapSerializer<AddrType, EntryType> serializer_;
- uint32_t serialized_size_;
- char *serialized_data_;
-};
-
-TEST_F(TestStdMapSerializer, EmptyMapTestCase) {
- const int32_t correct_data[] = { 0 };
- uint32_t correct_size = sizeof(correct_data);
-
- // std_map_ is empty.
- serialized_data_ = serializer_.Serialize(std_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestStdMapSerializer, MapWithTwoElementsTestCase) {
- const int32_t correct_data[] = {
- // # of nodes
- 2,
- // Offsets
- 20, 24,
- // Keys
- 1, 3,
- // Values
- 2, 6
- };
- uint32_t correct_size = sizeof(correct_data);
-
- std_map_.insert(std::make_pair(1, 2));
- std_map_.insert(std::make_pair(3, 6));
-
- serialized_data_ = serializer_.Serialize(std_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestStdMapSerializer, MapWithFiveElementsTestCase) {
- const int32_t correct_data[] = {
- // # of nodes
- 5,
- // Offsets
- 44, 48, 52, 56, 60,
- // Keys
- 1, 2, 3, 4, 5,
- // Values
- 11, 12, 13, 14, 15
- };
- uint32_t correct_size = sizeof(correct_data);
-
- for (int i = 1; i < 6; ++i)
- std_map_.insert(std::make_pair(i, 10 + i));
-
- serialized_data_ = serializer_.Serialize(std_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-class TestAddressMapSerializer : public ::testing::Test {
- protected:
- void SetUp() {
- serialized_size_ = 0;
- serialized_data_ = 0;
- }
-
- void TearDown() {
- delete [] serialized_data_;
- }
-
- google_breakpad::AddressMap<AddrType, EntryType> address_map_;
- google_breakpad::AddressMapSerializer<AddrType, EntryType> serializer_;
- uint32_t serialized_size_;
- char *serialized_data_;
-};
-
-TEST_F(TestAddressMapSerializer, EmptyMapTestCase) {
- const int32_t correct_data[] = { 0 };
- uint32_t correct_size = sizeof(correct_data);
-
- // std_map_ is empty.
- serialized_data_ = serializer_.Serialize(address_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestAddressMapSerializer, MapWithTwoElementsTestCase) {
- const int32_t correct_data[] = {
- // # of nodes
- 2,
- // Offsets
- 20, 24,
- // Keys
- 1, 3,
- // Values
- 2, 6
- };
- uint32_t correct_size = sizeof(correct_data);
-
- address_map_.Store(1, 2);
- address_map_.Store(3, 6);
-
- serialized_data_ = serializer_.Serialize(address_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestAddressMapSerializer, MapWithFourElementsTestCase) {
- const int32_t correct_data[] = {
- // # of nodes
- 4,
- // Offsets
- 36, 40, 44, 48,
- // Keys
- -6, -4, 8, 123,
- // Values
- 2, 3, 5, 8
- };
- uint32_t correct_size = sizeof(correct_data);
-
- address_map_.Store(-6, 2);
- address_map_.Store(-4, 3);
- address_map_.Store(8, 5);
- address_map_.Store(123, 8);
-
- serialized_data_ = serializer_.Serialize(address_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-
-class TestRangeMapSerializer : public ::testing::Test {
- protected:
- void SetUp() {
- serialized_size_ = 0;
- serialized_data_ = 0;
- }
-
- void TearDown() {
- delete [] serialized_data_;
- }
-
- google_breakpad::RangeMap<AddrType, EntryType> range_map_;
- google_breakpad::RangeMapSerializer<AddrType, EntryType> serializer_;
- uint32_t serialized_size_;
- char *serialized_data_;
-};
-
-TEST_F(TestRangeMapSerializer, EmptyMapTestCase) {
- const int32_t correct_data[] = { 0 };
- uint32_t correct_size = sizeof(correct_data);
-
- // range_map_ is empty.
- serialized_data_ = serializer_.Serialize(range_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestRangeMapSerializer, MapWithOneRangeTestCase) {
- const int32_t correct_data[] = {
- // # of nodes
- 1,
- // Offsets
- 12,
- // Keys: high address
- 10,
- // Values: (low address, entry) pairs
- 1, 6
- };
- uint32_t correct_size = sizeof(correct_data);
-
- range_map_.StoreRange(1, 10, 6);
-
- serialized_data_ = serializer_.Serialize(range_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestRangeMapSerializer, MapWithThreeRangesTestCase) {
- const int32_t correct_data[] = {
- // # of nodes
- 3,
- // Offsets
- 28, 36, 44,
- // Keys: high address
- 5, 9, 20,
- // Values: (low address, entry) pairs
- 2, 1, 6, 2, 10, 3
- };
- uint32_t correct_size = sizeof(correct_data);
-
- ASSERT_TRUE(range_map_.StoreRange(2, 4, 1));
- ASSERT_TRUE(range_map_.StoreRange(6, 4, 2));
- ASSERT_TRUE(range_map_.StoreRange(10, 11, 3));
-
- serialized_data_ = serializer_.Serialize(range_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-
-class TestContainedRangeMapSerializer : public ::testing::Test {
- protected:
- void SetUp() {
- serialized_size_ = 0;
- serialized_data_ = 0;
- }
-
- void TearDown() {
- delete [] serialized_data_;
- }
-
- google_breakpad::ContainedRangeMap<AddrType, EntryType> crm_map_;
- google_breakpad::ContainedRangeMapSerializer<AddrType, EntryType> serializer_;
- uint32_t serialized_size_;
- char *serialized_data_;
-};
-
-TEST_F(TestContainedRangeMapSerializer, EmptyMapTestCase) {
- const int32_t correct_data[] = {
- 0, // base address of root
- 4, // size of entry
- 0, // entry stored at root
- 0 // empty map stored at root
- };
- uint32_t correct_size = sizeof(correct_data);
-
- // crm_map_ is empty.
- serialized_data_ = serializer_.Serialize(&crm_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestContainedRangeMapSerializer, MapWithOneRangeTestCase) {
- const int32_t correct_data[] = {
- 0, // base address of root
- 4, // size of entry
- 0, // entry stored at root
- // Map stored at root node:
- 1, // # of nodes
- 12, // offset
- 9, // key
- // value: a child ContainedRangeMap
- 3, // base address of child CRM
- 4, // size of entry
- -1, // entry stored in child CRM
- 0 // empty sub-map stored in child CRM
- };
- uint32_t correct_size = sizeof(correct_data);
-
- crm_map_.StoreRange(3, 7, -1);
-
- serialized_data_ = serializer_.Serialize(&crm_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-TEST_F(TestContainedRangeMapSerializer, MapWithTwoLevelsTestCase) {
- // Tree structure of ranges:
- // root level 0
- // |
- // map
- // / \ level 1: child1, child2
- // 2~8 10~20
- // | |
- // map map
- // / \ |
- // 3~4 6~7 16-20 level 2: grandchild1, grandchild2, grandchild3
-
- const int32_t correct_data[] = {
- // root: base, entry_size, entry
- 0, 4, 0,
- // root's map: # of nodes, offset1, offset2, key1, key2
- 2, 20, 84, 8, 20,
- // child1: base, entry_size, entry:
- 2, 4, -1,
- // child1's map: # of nodes, offset1, offset2, key1, key2
- 2, 20, 36, 4, 7,
- // grandchild1: base, entry_size, entry, empty_map
- 3, 4, -1, 0,
- // grandchild2: base, entry_size, entry, empty_map
- 6, 4, -1, 0,
- // child2: base, entry_size, entry:
- 10, 4, -1,
- // child2's map: # of nodes, offset1, key1
- 1, 12, 20,
- // grandchild3: base, entry_size, entry, empty_map
- 16, 4, -1, 0
- };
- uint32_t correct_size = sizeof(correct_data);
-
- // Store child1.
- ASSERT_TRUE(crm_map_.StoreRange(2, 7, -1));
- // Store child2.
- ASSERT_TRUE(crm_map_.StoreRange(10, 11, -1));
- // Store grandchild1.
- ASSERT_TRUE(crm_map_.StoreRange(3, 2, -1));
- // Store grandchild2.
- ASSERT_TRUE(crm_map_.StoreRange(6, 2, -1));
- // Store grandchild3.
- ASSERT_TRUE(crm_map_.StoreRange(16, 5, -1));
-
- serialized_data_ = serializer_.Serialize(&crm_map_, &serialized_size_);
-
- EXPECT_EQ(correct_size, serialized_size_);
- EXPECT_EQ(memcmp(correct_data, serialized_data_, correct_size), 0);
-}
-
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump.cc b/toolkit/crashreporter/google-breakpad/src/processor/microdump.cc
deleted file mode 100644
index 4af62f56f0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump.cc
+++ /dev/null
@@ -1,385 +0,0 @@
-// Copyright (c) 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// microdump.cc: A microdump reader.
-//
-// See microdump.h for documentation.
-
-#include "google_breakpad/processor/microdump.h"
-
-#include <stdio.h>
-#include <string.h>
-
-#include <memory>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "google_breakpad/common/minidump_cpu_arm.h"
-#include "google_breakpad/processor/code_module.h"
-#include "processor/basic_code_module.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-#include "processor/range_map-inl.h"
-
-namespace {
-static const char kGoogleBreakpadKey[] = "google-breakpad";
-static const char kMicrodumpBegin[] = "-----BEGIN BREAKPAD MICRODUMP-----";
-static const char kMicrodumpEnd[] = "-----END BREAKPAD MICRODUMP-----";
-static const char kOsKey[] = ": O ";
-static const char kCpuKey[] = ": C ";
-static const char kGpuKey[] = ": G ";
-static const char kMmapKey[] = ": M ";
-static const char kStackKey[] = ": S ";
-static const char kStackFirstLineKey[] = ": S 0 ";
-static const char kArmArchitecture[] = "arm";
-static const char kArm64Architecture[] = "arm64";
-static const char kX86Architecture[] = "x86";
-static const char kMipsArchitecture[] = "mips";
-static const char kMips64Architecture[] = "mips64";
-static const char kGpuUnknown[] = "UNKNOWN";
-
-template<typename T>
-T HexStrToL(const string& str) {
- uint64_t res = 0;
- std::istringstream ss(str);
- ss >> std::hex >> res;
- return static_cast<T>(res);
-}
-
-std::vector<uint8_t> ParseHexBuf(const string& str) {
- std::vector<uint8_t> buf;
- for (size_t i = 0; i < str.length(); i += 2) {
- buf.push_back(HexStrToL<uint8_t>(str.substr(i, 2)));
- }
- return buf;
-}
-
-bool GetLine(std::istringstream* istream, string* str) {
- if (std::getline(*istream, *str)) {
- // Trim any trailing newline from the end of the line. Allows us
- // to seamlessly handle both Windows/DOS and Unix formatted input. The
- // adb tool generally writes logcat dumps in Windows/DOS format.
- if (!str->empty() && str->at(str->size() - 1) == '\r') {
- str->erase(str->size() - 1);
- }
- return true;
- }
- return false;
-}
-
-} // namespace
-
-namespace google_breakpad {
-
-//
-// MicrodumpModules
-//
-
-void MicrodumpModules::Add(const CodeModule* module) {
- linked_ptr<const CodeModule> module_ptr(module);
- if (!map_.StoreRange(module->base_address(), module->size(), module_ptr)) {
- BPLOG(ERROR) << "Module " << module->code_file() <<
- " could not be stored";
- }
-}
-
-void MicrodumpModules::SetEnableModuleShrink(bool is_enabled) {
- map_.SetEnableShrinkDown(is_enabled);
-}
-
-//
-// MicrodumpContext
-//
-
-void MicrodumpContext::SetContextARM(MDRawContextARM* arm) {
- DumpContext::SetContextFlags(MD_CONTEXT_ARM);
- DumpContext::SetContextARM(arm);
- valid_ = true;
-}
-
-void MicrodumpContext::SetContextARM64(MDRawContextARM64* arm64) {
- DumpContext::SetContextFlags(MD_CONTEXT_ARM64);
- DumpContext::SetContextARM64(arm64);
- valid_ = true;
-}
-
-void MicrodumpContext::SetContextX86(MDRawContextX86* x86) {
- DumpContext::SetContextFlags(MD_CONTEXT_X86);
- DumpContext::SetContextX86(x86);
- valid_ = true;
-}
-
-void MicrodumpContext::SetContextMIPS(MDRawContextMIPS* mips32) {
- DumpContext::SetContextFlags(MD_CONTEXT_MIPS);
- DumpContext::SetContextMIPS(mips32);
- valid_ = true;
-}
-
-void MicrodumpContext::SetContextMIPS64(MDRawContextMIPS* mips64) {
- DumpContext::SetContextFlags(MD_CONTEXT_MIPS64);
- DumpContext::SetContextMIPS(mips64);
- valid_ = true;
-}
-
-
-//
-// MicrodumpMemoryRegion
-//
-
-MicrodumpMemoryRegion::MicrodumpMemoryRegion() : base_address_(0) { }
-
-void MicrodumpMemoryRegion::Init(uint64_t base_address,
- const std::vector<uint8_t>& contents) {
- base_address_ = base_address;
- contents_ = contents;
-}
-
-uint64_t MicrodumpMemoryRegion::GetBase() const { return base_address_; }
-
-uint32_t MicrodumpMemoryRegion::GetSize() const { return contents_.size(); }
-
-bool MicrodumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint8_t* value) const {
- return GetMemoryLittleEndian(address, value);
-}
-
-bool MicrodumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint16_t* value) const {
- return GetMemoryLittleEndian(address, value);
-}
-
-bool MicrodumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint32_t* value) const {
- return GetMemoryLittleEndian(address, value);
-}
-
-bool MicrodumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint64_t* value) const {
- return GetMemoryLittleEndian(address, value);
-}
-
-template<typename ValueType>
-bool MicrodumpMemoryRegion::GetMemoryLittleEndian(uint64_t address,
- ValueType* value) const {
- if (address < base_address_ ||
- address - base_address_ + sizeof(ValueType) > contents_.size())
- return false;
- ValueType v = 0;
- uint64_t start = address - base_address_;
- // The loop condition is odd, but it's correct for size_t.
- for (size_t i = sizeof(ValueType) - 1; i < sizeof(ValueType); i--)
- v = (v << 8) | static_cast<uint8_t>(contents_[start + i]);
- *value = v;
- return true;
-}
-
-void MicrodumpMemoryRegion::Print() const {
- // Not reached, just needed to honor the base class contract.
- assert(false);
-}
-
-//
-// Microdump
-//
-Microdump::Microdump(const string& contents)
- : context_(new MicrodumpContext()),
- stack_region_(new MicrodumpMemoryRegion()),
- modules_(new MicrodumpModules()),
- system_info_(new SystemInfo()) {
- assert(!contents.empty());
-
- bool in_microdump = false;
- string line;
- uint64_t stack_start = 0;
- std::vector<uint8_t> stack_content;
- string arch;
-
- std::istringstream stream(contents);
- while (GetLine(&stream, &line)) {
- if (line.find(kGoogleBreakpadKey) == string::npos) {
- continue;
- }
- if (line.find(kMicrodumpBegin) != string::npos) {
- in_microdump = true;
- continue;
- }
- if (!in_microdump) {
- continue;
- }
- if (line.find(kMicrodumpEnd) != string::npos) {
- break;
- }
-
- size_t pos;
- if ((pos = line.find(kOsKey)) != string::npos) {
- string os_str(line, pos + strlen(kOsKey));
- std::istringstream os_tokens(os_str);
- string os_id;
- string num_cpus;
- string os_version;
- // This reflect the actual HW arch and might not match the arch emulated
- // for the execution (e.g., running a 32-bit binary on a 64-bit cpu).
- string hw_arch;
-
- os_tokens >> os_id;
- os_tokens >> arch;
- os_tokens >> num_cpus;
- os_tokens >> hw_arch;
- GetLine(&os_tokens, &os_version);
- os_version.erase(0, 1); // remove leading space.
-
- system_info_->cpu = arch;
- system_info_->cpu_count = HexStrToL<uint8_t>(num_cpus);
- system_info_->os_version = os_version;
-
- if (os_id == "L") {
- system_info_->os = "Linux";
- system_info_->os_short = "linux";
- } else if (os_id == "A") {
- system_info_->os = "Android";
- system_info_->os_short = "android";
- modules_->SetEnableModuleShrink(true);
- }
-
- // OS line also contains release and version for future use.
- } else if ((pos = line.find(kStackKey)) != string::npos) {
- if (line.find(kStackFirstLineKey) != string::npos) {
- // The first line of the stack (S 0 stack header) provides the value of
- // the stack pointer, the start address of the stack being dumped and
- // the length of the stack. We could use it in future to double check
- // that we received all the stack as expected.
- continue;
- }
- string stack_str(line, pos + strlen(kStackKey));
- std::istringstream stack_tokens(stack_str);
- string start_addr_str;
- string raw_content;
- stack_tokens >> start_addr_str;
- stack_tokens >> raw_content;
- uint64_t start_addr = HexStrToL<uint64_t>(start_addr_str);
-
- if (stack_start != 0) {
- // Verify that the stack chunks in the microdump are contiguous.
- assert(start_addr == stack_start + stack_content.size());
- } else {
- stack_start = start_addr;
- }
- std::vector<uint8_t> chunk = ParseHexBuf(raw_content);
- stack_content.insert(stack_content.end(), chunk.begin(), chunk.end());
-
- } else if ((pos = line.find(kCpuKey)) != string::npos) {
- string cpu_state_str(line, pos + strlen(kCpuKey));
- std::vector<uint8_t> cpu_state_raw = ParseHexBuf(cpu_state_str);
- if (strcmp(arch.c_str(), kArmArchitecture) == 0) {
- if (cpu_state_raw.size() != sizeof(MDRawContextARM)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
- << " bytes instead of " << sizeof(MDRawContextARM)
- << std::endl;
- continue;
- }
- MDRawContextARM* arm = new MDRawContextARM();
- memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
- context_->SetContextARM(arm);
- } else if (strcmp(arch.c_str(), kArm64Architecture) == 0) {
- if (cpu_state_raw.size() != sizeof(MDRawContextARM64)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
- << " bytes instead of " << sizeof(MDRawContextARM64)
- << std::endl;
- continue;
- }
- MDRawContextARM64* arm = new MDRawContextARM64();
- memcpy(arm, &cpu_state_raw[0], cpu_state_raw.size());
- context_->SetContextARM64(arm);
- } else if (strcmp(arch.c_str(), kX86Architecture) == 0) {
- if (cpu_state_raw.size() != sizeof(MDRawContextX86)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
- << " bytes instead of " << sizeof(MDRawContextX86)
- << std::endl;
- continue;
- }
- MDRawContextX86* x86 = new MDRawContextX86();
- memcpy(x86, &cpu_state_raw[0], cpu_state_raw.size());
- context_->SetContextX86(x86);
- } else if (strcmp(arch.c_str(), kMipsArchitecture) == 0) {
- if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
- << " bytes instead of " << sizeof(MDRawContextMIPS)
- << std::endl;
- continue;
- }
- MDRawContextMIPS* mips32 = new MDRawContextMIPS();
- memcpy(mips32, &cpu_state_raw[0], cpu_state_raw.size());
- context_->SetContextMIPS(mips32);
- } else if (strcmp(arch.c_str(), kMips64Architecture) == 0) {
- if (cpu_state_raw.size() != sizeof(MDRawContextMIPS)) {
- std::cerr << "Malformed CPU context. Got " << cpu_state_raw.size()
- << " bytes instead of " << sizeof(MDRawContextMIPS)
- << std::endl;
- continue;
- }
- MDRawContextMIPS* mips64 = new MDRawContextMIPS();
- memcpy(mips64, &cpu_state_raw[0], cpu_state_raw.size());
- context_->SetContextMIPS64(mips64);
- } else {
- std::cerr << "Unsupported architecture: " << arch << std::endl;
- }
- } else if ((pos = line.find(kGpuKey)) != string::npos) {
- string gpu_str(line, pos + strlen(kGpuKey));
- if (strcmp(gpu_str.c_str(), kGpuUnknown) != 0) {
- std::istringstream gpu_tokens(gpu_str);
- std::getline(gpu_tokens, system_info_->gl_version, '|');
- std::getline(gpu_tokens, system_info_->gl_vendor, '|');
- std::getline(gpu_tokens, system_info_->gl_renderer, '|');
- }
- } else if ((pos = line.find(kMmapKey)) != string::npos) {
- string mmap_line(line, pos + strlen(kMmapKey));
- std::istringstream mmap_tokens(mmap_line);
- string addr, offset, size, identifier, filename;
- mmap_tokens >> addr;
- mmap_tokens >> offset;
- mmap_tokens >> size;
- mmap_tokens >> identifier;
- mmap_tokens >> filename;
-
- modules_->Add(new BasicCodeModule(
- HexStrToL<uint64_t>(addr), // base_address
- HexStrToL<uint64_t>(size), // size
- filename, // code_file
- identifier, // code_identifier
- filename, // debug_file
- identifier, // debug_identifier
- "")); // version
- }
- }
- stack_region_->Init(stack_start, stack_content);
-}
-
-} // namespace google_breakpad
-
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump_processor.cc b/toolkit/crashreporter/google-breakpad/src/processor/microdump_processor.cc
deleted file mode 100644
index 366e3f30aa..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump_processor.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// microdump_processor.cc: A microdump processor.
-//
-// See microdump_processor.h for documentation.
-
-#include "google_breakpad/processor/microdump_processor.h"
-
-#include <assert.h>
-
-#include <string>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/microdump.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stackwalker.h"
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-MicrodumpProcessor::MicrodumpProcessor(StackFrameSymbolizer* frame_symbolizer)
- : frame_symbolizer_(frame_symbolizer) {
- assert(frame_symbolizer);
-}
-
-MicrodumpProcessor::~MicrodumpProcessor() {}
-
-ProcessResult MicrodumpProcessor::Process(const string &microdump_contents,
- ProcessState* process_state) {
- assert(process_state);
-
- process_state->Clear();
-
- if (microdump_contents.empty()) {
- BPLOG(ERROR) << "Microdump is empty.";
- return PROCESS_ERROR_MINIDUMP_NOT_FOUND;
- }
-
- Microdump microdump(microdump_contents);
- process_state->modules_ = microdump.GetModules()->Copy();
- scoped_ptr<Stackwalker> stackwalker(
- Stackwalker::StackwalkerForCPU(
- &process_state->system_info_,
- microdump.GetContext(),
- microdump.GetMemory(),
- process_state->modules_,
- frame_symbolizer_));
-
- scoped_ptr<CallStack> stack(new CallStack());
- if (stackwalker.get()) {
- if (!stackwalker->Walk(stack.get(),
- &process_state->modules_without_symbols_,
- &process_state->modules_with_corrupt_symbols_)) {
- BPLOG(INFO) << "Processing was interrupted.";
- return PROCESS_SYMBOL_SUPPLIER_INTERRUPTED;
- }
- } else {
- BPLOG(ERROR) << "No stackwalker found for microdump.";
- return PROCESS_ERROR_NO_THREAD_LIST;
- }
-
- process_state->threads_.push_back(stack.release());
- process_state->thread_memory_regions_.push_back(microdump.GetMemory());
- process_state->crashed_ = true;
- process_state->requesting_thread_ = 0;
- process_state->system_info_ = *microdump.GetSystemInfo();
-
- return PROCESS_OK;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump_processor_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/microdump_processor_unittest.cc
deleted file mode 100644
index af897f7dac..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump_processor_unittest.cc
+++ /dev/null
@@ -1,273 +0,0 @@
-// Copyright (c) 2014, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit test for MicrodumpProcessor.
-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/microdump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-#include "processor/simple_symbol_supplier.h"
-#include "processor/stackwalker_unittest_utils.h"
-
-namespace {
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::MicrodumpProcessor;
-using google_breakpad::ProcessState;
-using google_breakpad::SimpleSymbolSupplier;
-using google_breakpad::StackFrameSymbolizer;
-
-class MicrodumpProcessorTest : public ::testing::Test {
- public:
- MicrodumpProcessorTest()
- : files_path_(string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/") {
- }
-
- void ReadFile(const string& file_name, string* file_contents) {
- assert(file_contents);
- std::ifstream file_stream(file_name.c_str(), std::ios::in);
- ASSERT_TRUE(file_stream.good());
- std::vector<char> bytes;
- file_stream.seekg(0, std::ios_base::end);
- ASSERT_TRUE(file_stream.good());
- bytes.resize(file_stream.tellg());
- file_stream.seekg(0, std::ios_base::beg);
- ASSERT_TRUE(file_stream.good());
- file_stream.read(&bytes[0], bytes.size());
- ASSERT_TRUE(file_stream.good());
- *file_contents = string(&bytes[0], bytes.size());
- }
-
- google_breakpad::ProcessResult ProcessMicrodump(
- const string& symbols_file,
- const string& microdump_contents,
- ProcessState* state) {
- SimpleSymbolSupplier supplier(symbols_file);
- BasicSourceLineResolver resolver;
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- MicrodumpProcessor processor(&frame_symbolizer);
-
- return processor.Process(microdump_contents, state);
- }
-
- void AnalyzeDump(const string& microdump_file_name, bool omit_symbols,
- int expected_cpu_count, ProcessState* state) {
- string symbols_file = omit_symbols ? "" : files_path_ + "symbols/microdump";
- string microdump_file_path = files_path_ + microdump_file_name;
- string microdump_contents;
- ReadFile(microdump_file_path, &microdump_contents);
-
- google_breakpad::ProcessResult result =
- ProcessMicrodump(symbols_file, microdump_contents, state);
-
- ASSERT_EQ(google_breakpad::PROCESS_OK, result);
- ASSERT_TRUE(state->crashed());
- ASSERT_EQ(0, state->requesting_thread());
- ASSERT_EQ(1U, state->threads()->size());
-
- ASSERT_EQ(expected_cpu_count, state->system_info()->cpu_count);
- ASSERT_EQ("android", state->system_info()->os_short);
- ASSERT_EQ("Android", state->system_info()->os);
- }
-
- string files_path_;
-};
-
-TEST_F(MicrodumpProcessorTest, TestProcess_Empty) {
- ProcessState state;
- google_breakpad::ProcessResult result =
- ProcessMicrodump("", "", &state);
- ASSERT_EQ(google_breakpad::PROCESS_ERROR_MINIDUMP_NOT_FOUND, result);
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcess_Invalid) {
- ProcessState state;
- google_breakpad::ProcessResult result =
- ProcessMicrodump("", "This is not a valid microdump", &state);
- ASSERT_EQ(google_breakpad::PROCESS_ERROR_NO_THREAD_LIST, result);
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcess_MissingSymbols) {
- ProcessState state;
- AnalyzeDump("microdump-arm64.dmp", true /* omit_symbols */,
- 2 /* expected_cpu_count */, &state);
-
- ASSERT_EQ(8U, state.modules()->module_count());
- ASSERT_EQ("arm64", state.system_info()->cpu);
- ASSERT_EQ("OS 64 VERSION INFO", state.system_info()->os_version);
- ASSERT_EQ(1U, state.threads()->size());
- ASSERT_EQ(12U, state.threads()->at(0)->frames()->size());
-
- ASSERT_EQ("",
- state.threads()->at(0)->frames()->at(0)->function_name);
- ASSERT_EQ("",
- state.threads()->at(0)->frames()->at(3)->function_name);
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcess_UnsupportedArch) {
- string microdump_contents =
- "W/google-breakpad(26491): -----BEGIN BREAKPAD MICRODUMP-----\n"
- "W/google-breakpad(26491): O A \"unsupported-arch\"\n"
- "W/google-breakpad(26491): S 0 A48BD840 A48BD000 00002000\n";
-
- ProcessState state;
-
- google_breakpad::ProcessResult result =
- ProcessMicrodump("", microdump_contents, &state);
-
- ASSERT_EQ(google_breakpad::PROCESS_ERROR_NO_THREAD_LIST, result);
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcessArm) {
- ProcessState state;
- AnalyzeDump("microdump-arm.dmp", false /* omit_symbols */,
- 2 /* expected_cpu_count*/, &state);
-
- ASSERT_EQ(6U, state.modules()->module_count());
- ASSERT_EQ("arm", state.system_info()->cpu);
- ASSERT_EQ("OpenGL ES 3.0 V@104.0 AU@ (GIT@Id3510ff6dc)",
- state.system_info()->gl_version);
- ASSERT_EQ("Qualcomm", state.system_info()->gl_vendor);
- ASSERT_EQ("Adreno (TM) 330", state.system_info()->gl_renderer);
- ASSERT_EQ("OS VERSION INFO", state.system_info()->os_version);
- ASSERT_EQ(8U, state.threads()->at(0)->frames()->size());
- ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",
- state.threads()->at(0)->frames()->at(0)->function_name);
- ASSERT_EQ("testing::Test::Run",
- state.threads()->at(0)->frames()->at(1)->function_name);
- ASSERT_EQ("main",
- state.threads()->at(0)->frames()->at(6)->function_name);
- ASSERT_EQ("breakpad_unittests",
- state.threads()->at(0)->frames()->at(6)->module->code_file());
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcessArm64) {
- ProcessState state;
- AnalyzeDump("microdump-arm64.dmp", false /* omit_symbols */,
- 2 /* expected_cpu_count*/, &state);
-
- ASSERT_EQ(8U, state.modules()->module_count());
- ASSERT_EQ("arm64", state.system_info()->cpu);
- ASSERT_EQ("OS 64 VERSION INFO", state.system_info()->os_version);
- ASSERT_EQ(9U, state.threads()->at(0)->frames()->size());
- ASSERT_EQ("MicrodumpWriterTest_Setup_Test::TestBody",
- state.threads()->at(0)->frames()->at(0)->function_name);
- ASSERT_EQ("testing::Test::Run",
- state.threads()->at(0)->frames()->at(2)->function_name);
- ASSERT_EQ("main",
- state.threads()->at(0)->frames()->at(7)->function_name);
- ASSERT_EQ("breakpad_unittests",
- state.threads()->at(0)->frames()->at(7)->module->code_file());
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcessX86) {
- ProcessState state;
- AnalyzeDump("microdump-x86.dmp", false /* omit_symbols */,
- 4 /* expected_cpu_count */, &state);
-
- ASSERT_EQ(124U, state.modules()->module_count());
- ASSERT_EQ("x86", state.system_info()->cpu);
- ASSERT_EQ("asus/WW_Z00A/Z00A:5.0/LRX21V/2.19.40.22_20150627_5104_user:user/"
- "release-keys", state.system_info()->os_version);
- ASSERT_EQ(56U, state.threads()->at(0)->frames()->size());
- ASSERT_EQ("libc.so",
- state.threads()->at(0)->frames()->at(0)->module->debug_file());
- // TODO(mmandlis): Get symbols for the test X86 microdump and test function
- // names.
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcessMultiple) {
- ProcessState state;
- AnalyzeDump("microdump-multiple.dmp", false /* omit_symbols */,
- 6 /* expected_cpu_count */, &state);
- ASSERT_EQ(156U, state.modules()->module_count());
- ASSERT_EQ("arm", state.system_info()->cpu);
- ASSERT_EQ("lge/p1_tmo_us/p1:6.0/MRA58K/1603210524c8d:user/release-keys",
- state.system_info()->os_version);
- ASSERT_EQ(5U, state.threads()->at(0)->frames()->size());
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcessMips) {
- ProcessState state;
- AnalyzeDump("microdump-mips32.dmp", false /* omit_symbols */,
- 2 /* expected_cpu_count */, &state);
-
- ASSERT_EQ(7U, state.modules()->module_count());
- ASSERT_EQ("mips", state.system_info()->cpu);
- ASSERT_EQ("3.0.8-g893bf16 #7 SMP PREEMPT Fri Jul 10 15:20:59 PDT 2015",
- state.system_info()->os_version);
- ASSERT_EQ(4U, state.threads()->at(0)->frames()->size());
-
- ASSERT_EQ("blaTest",
- state.threads()->at(0)->frames()->at(0)->function_name);
- ASSERT_EQ("Crash",
- state.threads()->at(0)->frames()->at(1)->function_name);
- ASSERT_EQ("main",
- state.threads()->at(0)->frames()->at(2)->function_name);
- ASSERT_EQ("crash_example",
- state.threads()->at(0)->frames()->at(0)->module->debug_file());
-}
-
-TEST_F(MicrodumpProcessorTest, TestProcessMips64) {
- ProcessState state;
- AnalyzeDump("microdump-mips64.dmp", false /* omit_symbols */,
- 1 /* expected_cpu_count */, &state);
-
- ASSERT_EQ(8U, state.modules()->module_count());
- ASSERT_EQ("mips64", state.system_info()->cpu);
- ASSERT_EQ("3.10.0-gf185e20 #112 PREEMPT Mon Oct 5 11:12:49 PDT 2015",
- state.system_info()->os_version);
- ASSERT_EQ(4U, state.threads()->at(0)->frames()->size());
-
- ASSERT_EQ("blaTest",
- state.threads()->at(0)->frames()->at(0)->function_name);
- ASSERT_EQ("Crash",
- state.threads()->at(0)->frames()->at(1)->function_name);
- ASSERT_EQ("main",
- state.threads()->at(0)->frames()->at(2)->function_name);
- ASSERT_EQ("crash_example",
- state.threads()->at(0)->frames()->at(0)->module->debug_file());
-}
-
-} // namespace
-
-int main(int argc, char* argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk.cc b/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk.cc
deleted file mode 100644
index 7ea80495a6..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (c) 2014 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// microdump_stackwalk.cc: Process a microdump with MicrodumpProcessor, printing
-// the results, including stack traces.
-
-#include <stdio.h>
-#include <string.h>
-
-#include <fstream>
-#include <string>
-#include <vector>
-
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/microdump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-#include "processor/logging.h"
-#include "processor/simple_symbol_supplier.h"
-#include "processor/stackwalk_common.h"
-
-
-namespace {
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::MicrodumpProcessor;
-using google_breakpad::ProcessResult;
-using google_breakpad::ProcessState;
-using google_breakpad::scoped_ptr;
-using google_breakpad::SimpleSymbolSupplier;
-using google_breakpad::StackFrameSymbolizer;
-
-// Processes |microdump_file| using MicrodumpProcessor. |symbol_path|, if
-// non-empty, is the base directory of a symbol storage area, laid out in
-// the format required by SimpleSymbolSupplier. If such a storage area
-// is specified, it is made available for use by the MicrodumpProcessor.
-//
-// Returns the value of MicrodumpProcessor::Process. If processing succeeds,
-// prints identifying OS and CPU information from the microdump, crash
-// information and call stacks for the crashing thread.
-// All information is printed to stdout.
-int PrintMicrodumpProcess(const char* microdump_file,
- const std::vector<string>& symbol_paths,
- bool machine_readable) {
- std::ifstream file_stream(microdump_file);
- std::vector<char> bytes;
- file_stream.seekg(0, std::ios_base::end);
- bytes.resize(file_stream.tellg());
- file_stream.seekg(0, std::ios_base::beg);
- file_stream.read(&bytes[0], bytes.size());
- string microdump_content(&bytes[0], bytes.size());
-
- scoped_ptr<SimpleSymbolSupplier> symbol_supplier;
- if (!symbol_paths.empty()) {
- symbol_supplier.reset(new SimpleSymbolSupplier(symbol_paths));
- }
-
- BasicSourceLineResolver resolver;
- StackFrameSymbolizer frame_symbolizer(symbol_supplier.get(), &resolver);
- ProcessState process_state;
- MicrodumpProcessor microdump_processor(&frame_symbolizer);
- ProcessResult res = microdump_processor.Process(microdump_content,
- &process_state);
-
- if (res == google_breakpad::PROCESS_OK) {
- if (machine_readable) {
- PrintProcessStateMachineReadable(process_state);
- } else {
- PrintProcessState(process_state, false, &resolver);
- }
- return 0;
- }
-
- BPLOG(ERROR) << "MicrodumpProcessor::Process failed (code = " << res << ")";
- return 1;
-}
-
-void usage(const char *program_name) {
- fprintf(stderr, "usage: %s [-m] <microdump-file> [symbol-path ...]\n"
- " -m : Output in machine-readable format\n",
- program_name);
-}
-
-} // namespace
-
-int main(int argc, char** argv) {
- BPLOG_INIT(&argc, &argv);
-
- if (argc < 2) {
- usage(argv[0]);
- return 1;
- }
-
- const char* microdump_file;
- bool machine_readable;
- int symbol_path_arg;
-
- if (strcmp(argv[1], "-m") == 0) {
- if (argc < 3) {
- usage(argv[0]);
- return 1;
- }
-
- machine_readable = true;
- microdump_file = argv[2];
- symbol_path_arg = 3;
- } else {
- machine_readable = false;
- microdump_file = argv[1];
- symbol_path_arg = 2;
- }
-
- // extra arguments are symbol paths
- std::vector<string> symbol_paths;
- if (argc > symbol_path_arg) {
- for (int argi = symbol_path_arg; argi < argc; ++argi)
- symbol_paths.push_back(argv[argi]);
- }
-
- return PrintMicrodumpProcess(microdump_file,
- symbol_paths,
- machine_readable);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_machine_readable_test b/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_machine_readable_test
deleted file mode 100755
index fadec26456..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_machine_readable_test
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2014, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-source "${0%/*}/microdump_stackwalk_test_vars" # for MICRODUMP_SUPPORTED_ARCHS.
-testdata_dir=$srcdir/src/processor/testdata
-
-set -e # Bail out with an error if any of the commands below fails.
-for ARCH in $MICRODUMP_SUPPORTED_ARCHS; do
- echo "Testing microdump_stackwalk -m for arch $ARCH"
- ./src/processor/microdump_stackwalk -m $testdata_dir/microdump-${ARCH}.dmp \
- $testdata_dir/symbols/microdump | \
- tr -d '\015' | \
- diff -u $testdata_dir/microdump.stackwalk.machine_readable-${ARCH}.out -
-done
-exit 0
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test b/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test
deleted file mode 100755
index 5a1f3d59fc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2014, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-source "${0%/*}/microdump_stackwalk_test_vars" # for MICRODUMP_SUPPORTED_ARCHS.
-testdata_dir=$srcdir/src/processor/testdata
-
-set -e # Bail out with an error if any of the commands below fails.
-for ARCH in $MICRODUMP_SUPPORTED_ARCHS; do
- echo "Testing microdump_stackwalk for arch $ARCH"
- ./src/processor/microdump_stackwalk $testdata_dir/microdump-${ARCH}.dmp \
- $testdata_dir/symbols/microdump | \
- tr -d '\015' | \
- diff -u $testdata_dir/microdump.stackwalk-${ARCH}.out -
-done
-exit 0
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test_vars b/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test_vars
deleted file mode 100644
index a8b0e0df5a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/microdump_stackwalk_test_vars
+++ /dev/null
@@ -1 +0,0 @@
-MICRODUMP_SUPPORTED_ARCHS="arm arm64"
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump.cc
deleted file mode 100644
index 1e1d386df9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump.cc
+++ /dev/null
@@ -1,4989 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump.cc: A minidump reader.
-//
-// See minidump.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "google_breakpad/processor/minidump.h"
-
-#include <assert.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <string.h>
-#include <time.h>
-
-#ifdef _WIN32
-#include <io.h>
-#else // _WIN32
-#include <unistd.h>
-#endif // _WIN32
-
-#include <algorithm>
-#include <fstream>
-#include <iostream>
-#include <limits>
-#include <map>
-#include <vector>
-
-#include "processor/range_map-inl.h"
-
-#include "common/scoped_ptr.h"
-#include "common/stdio_wrapper.h"
-#include "google_breakpad/processor/dump_context.h"
-#include "processor/basic_code_module.h"
-#include "processor/basic_code_modules.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-
-using std::istream;
-using std::ifstream;
-using std::numeric_limits;
-using std::vector;
-
-// Returns true iff |context_size| matches exactly one of the sizes of the
-// various MDRawContext* types.
-// TODO(blundell): This function can be removed once
-// http://code.google.com/p/google-breakpad/issues/detail?id=550 is fixed.
-static bool IsContextSizeUnique(uint32_t context_size) {
- int num_matching_contexts = 0;
- if (context_size == sizeof(MDRawContextX86))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextPPC))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextPPC64))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextAMD64))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextSPARC))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextARM))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextARM64))
- num_matching_contexts++;
- if (context_size == sizeof(MDRawContextMIPS))
- num_matching_contexts++;
- return num_matching_contexts == 1;
-}
-
-//
-// Swapping routines
-//
-// Inlining these doesn't increase code size significantly, and it saves
-// a whole lot of unnecessary jumping back and forth.
-//
-
-
-// Swapping an 8-bit quantity is a no-op. This function is only provided
-// to account for certain templatized operations that require swapping for
-// wider types but handle uint8_t too
-// (MinidumpMemoryRegion::GetMemoryAtAddressInternal).
-static inline void Swap(uint8_t* value) {
-}
-
-
-// Optimization: don't need to AND the furthest right shift, because we're
-// shifting an unsigned quantity. The standard requires zero-filling in this
-// case. If the quantities were signed, a bitmask whould be needed for this
-// right shift to avoid an arithmetic shift (which retains the sign bit).
-// The furthest left shift never needs to be ANDed bitmask.
-
-
-static inline void Swap(uint16_t* value) {
- *value = (*value >> 8) |
- (*value << 8);
-}
-
-
-static inline void Swap(uint32_t* value) {
- *value = (*value >> 24) |
- ((*value >> 8) & 0x0000ff00) |
- ((*value << 8) & 0x00ff0000) |
- (*value << 24);
-}
-
-
-static inline void Swap(uint64_t* value) {
- uint32_t* value32 = reinterpret_cast<uint32_t*>(value);
- Swap(&value32[0]);
- Swap(&value32[1]);
- uint32_t temp = value32[0];
- value32[0] = value32[1];
- value32[1] = temp;
-}
-
-
-// Given a pointer to a 128-bit int in the minidump data, set the "low"
-// and "high" fields appropriately.
-static void Normalize128(uint128_struct* value, bool is_big_endian) {
- // The struct format is [high, low], so if the format is big-endian,
- // the most significant bytes will already be in the high field.
- if (!is_big_endian) {
- uint64_t temp = value->low;
- value->low = value->high;
- value->high = temp;
- }
-}
-
-// This just swaps each int64 half of the 128-bit value.
-// The value should also be normalized by calling Normalize128().
-static void Swap(uint128_struct* value) {
- Swap(&value->low);
- Swap(&value->high);
-}
-
-// Swapping signed integers
-static inline void Swap(int32_t* value) {
- Swap(reinterpret_cast<uint32_t*>(value));
-}
-
-static inline void Swap(MDLocationDescriptor* location_descriptor) {
- Swap(&location_descriptor->data_size);
- Swap(&location_descriptor->rva);
-}
-
-
-static inline void Swap(MDMemoryDescriptor* memory_descriptor) {
- Swap(&memory_descriptor->start_of_memory_range);
- Swap(&memory_descriptor->memory);
-}
-
-
-static inline void Swap(MDGUID* guid) {
- Swap(&guid->data1);
- Swap(&guid->data2);
- Swap(&guid->data3);
- // Don't swap guid->data4[] because it contains 8-bit quantities.
-}
-
-static inline void Swap(MDSystemTime* system_time) {
- Swap(&system_time->year);
- Swap(&system_time->month);
- Swap(&system_time->day_of_week);
- Swap(&system_time->day);
- Swap(&system_time->hour);
- Swap(&system_time->minute);
- Swap(&system_time->second);
- Swap(&system_time->milliseconds);
-}
-
-static inline void Swap(MDXStateFeature* xstate_feature) {
- Swap(&xstate_feature->offset);
- Swap(&xstate_feature->size);
-}
-
-static inline void Swap(MDXStateConfigFeatureMscInfo* xstate_feature_info) {
- Swap(&xstate_feature_info->size_of_info);
- Swap(&xstate_feature_info->context_size);
- Swap(&xstate_feature_info->enabled_features);
-
- for (size_t i = 0; i < MD_MAXIMUM_XSTATE_FEATURES; i++) {
- Swap(&xstate_feature_info->features[i]);
- }
-}
-
-static inline void Swap(uint16_t* data, size_t size_in_bytes) {
- size_t data_length = size_in_bytes / sizeof(data[0]);
- for (size_t i = 0; i < data_length; i++) {
- Swap(&data[i]);
- }
-}
-
-//
-// Character conversion routines
-//
-
-
-// Standard wide-character conversion routines depend on the system's own
-// idea of what width a wide character should be: some use 16 bits, and
-// some use 32 bits. For the purposes of a minidump, wide strings are
-// always represented with 16-bit UTF-16 chracters. iconv isn't available
-// everywhere, and its interface varies where it is available. iconv also
-// deals purely with char* pointers, so in addition to considering the swap
-// parameter, a converter that uses iconv would also need to take the host
-// CPU's endianness into consideration. It doesn't seems worth the trouble
-// of making it a dependency when we don't care about anything but UTF-16.
-static string* UTF16ToUTF8(const vector<uint16_t>& in,
- bool swap) {
- scoped_ptr<string> out(new string());
-
- // Set the string's initial capacity to the number of UTF-16 characters,
- // because the UTF-8 representation will always be at least this long.
- // If the UTF-8 representation is longer, the string will grow dynamically.
- out->reserve(in.size());
-
- for (vector<uint16_t>::const_iterator iterator = in.begin();
- iterator != in.end();
- ++iterator) {
- // Get a 16-bit value from the input
- uint16_t in_word = *iterator;
- if (swap)
- Swap(&in_word);
-
- // Convert the input value (in_word) into a Unicode code point (unichar).
- uint32_t unichar;
- if (in_word >= 0xdc00 && in_word <= 0xdcff) {
- BPLOG(ERROR) << "UTF16ToUTF8 found low surrogate " <<
- HexString(in_word) << " without high";
- return NULL;
- } else if (in_word >= 0xd800 && in_word <= 0xdbff) {
- // High surrogate.
- unichar = (in_word - 0xd7c0) << 10;
- if (++iterator == in.end()) {
- BPLOG(ERROR) << "UTF16ToUTF8 found high surrogate " <<
- HexString(in_word) << " at end of string";
- return NULL;
- }
- uint32_t high_word = in_word;
- in_word = *iterator;
- if (in_word < 0xdc00 || in_word > 0xdcff) {
- BPLOG(ERROR) << "UTF16ToUTF8 found high surrogate " <<
- HexString(high_word) << " without low " <<
- HexString(in_word);
- return NULL;
- }
- unichar |= in_word & 0x03ff;
- } else {
- // The ordinary case, a single non-surrogate Unicode character encoded
- // as a single 16-bit value.
- unichar = in_word;
- }
-
- // Convert the Unicode code point (unichar) into its UTF-8 representation,
- // appending it to the out string.
- if (unichar < 0x80) {
- (*out) += static_cast<char>(unichar);
- } else if (unichar < 0x800) {
- (*out) += 0xc0 | static_cast<char>(unichar >> 6);
- (*out) += 0x80 | static_cast<char>(unichar & 0x3f);
- } else if (unichar < 0x10000) {
- (*out) += 0xe0 | static_cast<char>(unichar >> 12);
- (*out) += 0x80 | static_cast<char>((unichar >> 6) & 0x3f);
- (*out) += 0x80 | static_cast<char>(unichar & 0x3f);
- } else if (unichar < 0x200000) {
- (*out) += 0xf0 | static_cast<char>(unichar >> 18);
- (*out) += 0x80 | static_cast<char>((unichar >> 12) & 0x3f);
- (*out) += 0x80 | static_cast<char>((unichar >> 6) & 0x3f);
- (*out) += 0x80 | static_cast<char>(unichar & 0x3f);
- } else {
- BPLOG(ERROR) << "UTF16ToUTF8 cannot represent high value " <<
- HexString(unichar) << " in UTF-8";
- return NULL;
- }
- }
-
- return out.release();
-}
-
-// Return the smaller of the number of code units in the UTF-16 string,
-// not including the terminating null word, or maxlen.
-static size_t UTF16codeunits(const uint16_t *string, size_t maxlen) {
- size_t count = 0;
- while (count < maxlen && string[count] != 0)
- count++;
- return count;
-}
-
-static inline void Swap(MDTimeZoneInformation* time_zone) {
- Swap(&time_zone->bias);
- // Skip time_zone->standard_name. No need to swap UTF-16 fields.
- // The swap will be done as part of the conversion to UTF-8.
- Swap(&time_zone->standard_date);
- Swap(&time_zone->standard_bias);
- // Skip time_zone->daylight_name. No need to swap UTF-16 fields.
- // The swap will be done as part of the conversion to UTF-8.
- Swap(&time_zone->daylight_date);
- Swap(&time_zone->daylight_bias);
-}
-
-static void ConvertUTF16BufferToUTF8String(const uint16_t* utf16_data,
- size_t max_length_in_bytes,
- string* utf8_result,
- bool swap) {
- // Since there is no explicit byte length for each string, use
- // UTF16codeunits to calculate word length, then derive byte
- // length from that.
- size_t max_word_length = max_length_in_bytes / sizeof(utf16_data[0]);
- size_t word_length = UTF16codeunits(utf16_data, max_word_length);
- if (word_length > 0) {
- size_t byte_length = word_length * sizeof(utf16_data[0]);
- vector<uint16_t> utf16_vector(word_length);
- memcpy(&utf16_vector[0], &utf16_data[0], byte_length);
- scoped_ptr<string> temp(UTF16ToUTF8(utf16_vector, swap));
- if (temp.get()) {
- utf8_result->assign(*temp);
- }
- } else {
- utf8_result->clear();
- }
-}
-
-
-// For fields that may or may not be valid, PrintValueOrInvalid will print the
-// string "(invalid)" if the field is not valid, and will print the value if
-// the field is valid. The value is printed as hexadecimal or decimal.
-
-enum NumberFormat {
- kNumberFormatDecimal,
- kNumberFormatHexadecimal,
-};
-
-static void PrintValueOrInvalid(bool valid,
- NumberFormat number_format,
- uint32_t value) {
- if (!valid) {
- printf("(invalid)\n");
- } else if (number_format == kNumberFormatDecimal) {
- printf("%d\n", value);
- } else {
- printf("0x%x\n", value);
- }
-}
-
-// Converts a time_t to a string showing the time in UTC.
-string TimeTToUTCString(time_t tt) {
- struct tm timestruct;
-#ifdef _WIN32
- gmtime_s(&timestruct, &tt);
-#else
- gmtime_r(&tt, &timestruct);
-#endif
-
- char timestr[20];
- int rv = strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct);
- if (rv == 0) {
- return string();
- }
-
- return string(timestr);
-}
-
-
-//
-// MinidumpObject
-//
-
-
-MinidumpObject::MinidumpObject(Minidump* minidump)
- : DumpObject(),
- minidump_(minidump) {
-}
-
-
-//
-// MinidumpStream
-//
-
-
-MinidumpStream::MinidumpStream(Minidump* minidump)
- : MinidumpObject(minidump) {
-}
-
-
-//
-// MinidumpContext
-//
-
-
-MinidumpContext::MinidumpContext(Minidump* minidump)
- : DumpContext(),
- minidump_(minidump) {
-}
-
-MinidumpContext::~MinidumpContext() {
-}
-
-bool MinidumpContext::Read(uint32_t expected_size) {
- valid_ = false;
-
- // Certain raw context types are currently assumed to have unique sizes.
- if (!IsContextSizeUnique(sizeof(MDRawContextAMD64))) {
- BPLOG(ERROR) << "sizeof(MDRawContextAMD64) cannot match the size of any "
- << "other raw context";
- return false;
- }
- if (!IsContextSizeUnique(sizeof(MDRawContextPPC64))) {
- BPLOG(ERROR) << "sizeof(MDRawContextPPC64) cannot match the size of any "
- << "other raw context";
- return false;
- }
- if (!IsContextSizeUnique(sizeof(MDRawContextARM64))) {
- BPLOG(ERROR) << "sizeof(MDRawContextARM64) cannot match the size of any "
- << "other raw context";
- return false;
- }
-
- FreeContext();
-
- // First, figure out what type of CPU this context structure is for.
- // For some reason, the AMD64 Context doesn't have context_flags
- // at the beginning of the structure, so special case it here.
- if (expected_size == sizeof(MDRawContextAMD64)) {
- BPLOG(INFO) << "MinidumpContext: looks like AMD64 context";
-
- scoped_ptr<MDRawContextAMD64> context_amd64(new MDRawContextAMD64());
- if (!minidump_->ReadBytes(context_amd64.get(),
- sizeof(MDRawContextAMD64))) {
- BPLOG(ERROR) << "MinidumpContext could not read amd64 context";
- return false;
- }
-
- if (minidump_->swap())
- Swap(&context_amd64->context_flags);
-
- uint32_t cpu_type = context_amd64->context_flags & MD_CONTEXT_CPU_MASK;
- if (cpu_type == 0) {
- if (minidump_->GetContextCPUFlagsFromSystemInfo(&cpu_type)) {
- context_amd64->context_flags |= cpu_type;
- } else {
- BPLOG(ERROR) << "Failed to preserve the current stream position";
- return false;
- }
- }
-
- if (cpu_type != MD_CONTEXT_AMD64) {
- // TODO: Fall through to switch below.
- // http://code.google.com/p/google-breakpad/issues/detail?id=550
- BPLOG(ERROR) << "MinidumpContext not actually amd64 context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext amd64 does not match system info";
- return false;
- }
-
- // Normalize the 128-bit types in the dump.
- // Since this is AMD64, by definition, the values are little-endian.
- for (unsigned int vr_index = 0;
- vr_index < MD_CONTEXT_AMD64_VR_COUNT;
- ++vr_index)
- Normalize128(&context_amd64->vector_register[vr_index], false);
-
- if (minidump_->swap()) {
- Swap(&context_amd64->p1_home);
- Swap(&context_amd64->p2_home);
- Swap(&context_amd64->p3_home);
- Swap(&context_amd64->p4_home);
- Swap(&context_amd64->p5_home);
- Swap(&context_amd64->p6_home);
- // context_flags is already swapped
- Swap(&context_amd64->mx_csr);
- Swap(&context_amd64->cs);
- Swap(&context_amd64->ds);
- Swap(&context_amd64->es);
- Swap(&context_amd64->fs);
- Swap(&context_amd64->ss);
- Swap(&context_amd64->eflags);
- Swap(&context_amd64->dr0);
- Swap(&context_amd64->dr1);
- Swap(&context_amd64->dr2);
- Swap(&context_amd64->dr3);
- Swap(&context_amd64->dr6);
- Swap(&context_amd64->dr7);
- Swap(&context_amd64->rax);
- Swap(&context_amd64->rcx);
- Swap(&context_amd64->rdx);
- Swap(&context_amd64->rbx);
- Swap(&context_amd64->rsp);
- Swap(&context_amd64->rbp);
- Swap(&context_amd64->rsi);
- Swap(&context_amd64->rdi);
- Swap(&context_amd64->r8);
- Swap(&context_amd64->r9);
- Swap(&context_amd64->r10);
- Swap(&context_amd64->r11);
- Swap(&context_amd64->r12);
- Swap(&context_amd64->r13);
- Swap(&context_amd64->r14);
- Swap(&context_amd64->r15);
- Swap(&context_amd64->rip);
- // FIXME: I'm not sure what actually determines
- // which member of the union {flt_save, sse_registers}
- // is valid. We're not currently using either,
- // but it would be good to have them swapped properly.
-
- for (unsigned int vr_index = 0;
- vr_index < MD_CONTEXT_AMD64_VR_COUNT;
- ++vr_index)
- Swap(&context_amd64->vector_register[vr_index]);
- Swap(&context_amd64->vector_control);
- Swap(&context_amd64->debug_control);
- Swap(&context_amd64->last_branch_to_rip);
- Swap(&context_amd64->last_branch_from_rip);
- Swap(&context_amd64->last_exception_to_rip);
- Swap(&context_amd64->last_exception_from_rip);
- }
-
- SetContextFlags(context_amd64->context_flags);
-
- SetContextAMD64(context_amd64.release());
- } else if (expected_size == sizeof(MDRawContextPPC64)) {
- // |context_flags| of MDRawContextPPC64 is 64 bits, but other MDRawContext
- // in the else case have 32 bits |context_flags|, so special case it here.
- uint64_t context_flags;
- if (!minidump_->ReadBytes(&context_flags, sizeof(context_flags))) {
- BPLOG(ERROR) << "MinidumpContext could not read context flags";
- return false;
- }
- if (minidump_->swap())
- Swap(&context_flags);
-
- uint32_t cpu_type = context_flags & MD_CONTEXT_CPU_MASK;
- scoped_ptr<MDRawContextPPC64> context_ppc64(new MDRawContextPPC64());
-
- if (cpu_type == 0) {
- if (minidump_->GetContextCPUFlagsFromSystemInfo(&cpu_type)) {
- context_ppc64->context_flags |= cpu_type;
- } else {
- BPLOG(ERROR) << "Failed to preserve the current stream position";
- return false;
- }
- }
-
- if (cpu_type != MD_CONTEXT_PPC64) {
- // TODO: Fall through to switch below.
- // http://code.google.com/p/google-breakpad/issues/detail?id=550
- BPLOG(ERROR) << "MinidumpContext not actually ppc64 context";
- return false;
- }
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_ppc64->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_ppc64->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_ppc64.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextPPC64) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read ppc64 context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext ppc64 does not match system info";
- return false;
- }
- if (minidump_->swap()) {
- // context_ppc64->context_flags was already swapped.
- Swap(&context_ppc64->srr0);
- Swap(&context_ppc64->srr1);
- for (unsigned int gpr_index = 0;
- gpr_index < MD_CONTEXT_PPC64_GPR_COUNT;
- ++gpr_index) {
- Swap(&context_ppc64->gpr[gpr_index]);
- }
- Swap(&context_ppc64->cr);
- Swap(&context_ppc64->xer);
- Swap(&context_ppc64->lr);
- Swap(&context_ppc64->ctr);
- Swap(&context_ppc64->vrsave);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT;
- ++fpr_index) {
- Swap(&context_ppc64->float_save.fpregs[fpr_index]);
- }
- // Don't swap context_ppc64->float_save.fpscr_pad because it is only
- // used for padding.
- Swap(&context_ppc64->float_save.fpscr);
- for (unsigned int vr_index = 0;
- vr_index < MD_VECTORSAVEAREA_PPC_VR_COUNT;
- ++vr_index) {
- Normalize128(&context_ppc64->vector_save.save_vr[vr_index], true);
- Swap(&context_ppc64->vector_save.save_vr[vr_index]);
- }
- Swap(&context_ppc64->vector_save.save_vscr);
- // Don't swap the padding fields in vector_save.
- Swap(&context_ppc64->vector_save.save_vrvalid);
- }
-
- SetContextFlags(static_cast<uint32_t>(context_ppc64->context_flags));
-
- // Check for data loss when converting context flags from uint64_t into
- // uint32_t
- if (static_cast<uint64_t>(GetContextFlags()) !=
- context_ppc64->context_flags) {
- BPLOG(ERROR) << "Data loss detected when converting PPC64 context_flags";
- return false;
- }
-
- SetContextPPC64(context_ppc64.release());
- } else if (expected_size == sizeof(MDRawContextARM64)) {
- // |context_flags| of MDRawContextARM64 is 64 bits, but other MDRawContext
- // in the else case have 32 bits |context_flags|, so special case it here.
- uint64_t context_flags;
-
- BPLOG(INFO) << "MinidumpContext: looks like ARM64 context";
-
- if (!minidump_->ReadBytes(&context_flags, sizeof(context_flags))) {
- BPLOG(ERROR) << "MinidumpContext could not read context flags";
- return false;
- }
- if (minidump_->swap())
- Swap(&context_flags);
-
- scoped_ptr<MDRawContextARM64> context_arm64(new MDRawContextARM64());
-
- uint32_t cpu_type = context_flags & MD_CONTEXT_CPU_MASK;
- if (cpu_type == 0) {
- if (minidump_->GetContextCPUFlagsFromSystemInfo(&cpu_type)) {
- context_arm64->context_flags |= cpu_type;
- } else {
- BPLOG(ERROR) << "Failed to preserve the current stream position";
- return false;
- }
- }
-
- if (cpu_type != MD_CONTEXT_ARM64) {
- // TODO: Fall through to switch below.
- // http://code.google.com/p/google-breakpad/issues/detail?id=550
- BPLOG(ERROR) << "MinidumpContext not actually arm64 context";
- return false;
- }
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_arm64->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_arm64->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_arm64.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextARM64) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read arm64 context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext arm64 does not match system info";
- return false;
- }
-
- if (minidump_->swap()) {
- // context_arm64->context_flags was already swapped.
- for (unsigned int ireg_index = 0;
- ireg_index < MD_CONTEXT_ARM64_GPR_COUNT;
- ++ireg_index) {
- Swap(&context_arm64->iregs[ireg_index]);
- }
- Swap(&context_arm64->cpsr);
- Swap(&context_arm64->float_save.fpsr);
- Swap(&context_arm64->float_save.fpcr);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_ARM64_FPR_COUNT;
- ++fpr_index) {
- // While ARM64 is bi-endian, iOS (currently the only platform
- // for which ARM64 support has been brought up) uses ARM64 exclusively
- // in little-endian mode.
- Normalize128(&context_arm64->float_save.regs[fpr_index], false);
- Swap(&context_arm64->float_save.regs[fpr_index]);
- }
- }
- SetContextFlags(static_cast<uint32_t>(context_arm64->context_flags));
-
- // Check for data loss when converting context flags from uint64_t into
- // uint32_t
- if (static_cast<uint64_t>(GetContextFlags()) !=
- context_arm64->context_flags) {
- BPLOG(ERROR) << "Data loss detected when converting ARM64 context_flags";
- return false;
- }
-
- SetContextARM64(context_arm64.release());
- } else {
- uint32_t context_flags;
- if (!minidump_->ReadBytes(&context_flags, sizeof(context_flags))) {
- BPLOG(ERROR) << "MinidumpContext could not read context flags";
- return false;
- }
- if (minidump_->swap())
- Swap(&context_flags);
-
- uint32_t cpu_type = context_flags & MD_CONTEXT_CPU_MASK;
- if (cpu_type == 0) {
- // Unfortunately the flag for MD_CONTEXT_ARM that was taken
- // from a Windows CE SDK header conflicts in practice with
- // the CONTEXT_XSTATE flag. MD_CONTEXT_ARM has been renumbered,
- // but handle dumps with the legacy value gracefully here.
- if (context_flags & MD_CONTEXT_ARM_OLD) {
- context_flags |= MD_CONTEXT_ARM;
- context_flags &= ~MD_CONTEXT_ARM_OLD;
- cpu_type = MD_CONTEXT_ARM;
- }
- }
-
- if (cpu_type == 0) {
- if (minidump_->GetContextCPUFlagsFromSystemInfo(&cpu_type)) {
- context_flags |= cpu_type;
- } else {
- BPLOG(ERROR) << "Failed to preserve the current stream position";
- return false;
- }
- }
-
- // Allocate the context structure for the correct CPU and fill it. The
- // casts are slightly unorthodox, but it seems better to do that than to
- // maintain a separate pointer for each type of CPU context structure
- // when only one of them will be used.
- switch (cpu_type) {
- case MD_CONTEXT_X86: {
- if (expected_size != sizeof(MDRawContextX86)) {
- BPLOG(ERROR) << "MinidumpContext x86 size mismatch, " <<
- expected_size << " != " << sizeof(MDRawContextX86);
- return false;
- }
-
- scoped_ptr<MDRawContextX86> context_x86(new MDRawContextX86());
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_x86->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_x86->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_x86.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextX86) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read x86 context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext x86 does not match system info";
- return false;
- }
-
- if (minidump_->swap()) {
- // context_x86->context_flags was already swapped.
- Swap(&context_x86->dr0);
- Swap(&context_x86->dr1);
- Swap(&context_x86->dr2);
- Swap(&context_x86->dr3);
- Swap(&context_x86->dr6);
- Swap(&context_x86->dr7);
- Swap(&context_x86->float_save.control_word);
- Swap(&context_x86->float_save.status_word);
- Swap(&context_x86->float_save.tag_word);
- Swap(&context_x86->float_save.error_offset);
- Swap(&context_x86->float_save.error_selector);
- Swap(&context_x86->float_save.data_offset);
- Swap(&context_x86->float_save.data_selector);
- // context_x86->float_save.register_area[] contains 8-bit quantities
- // and does not need to be swapped.
- Swap(&context_x86->float_save.cr0_npx_state);
- Swap(&context_x86->gs);
- Swap(&context_x86->fs);
- Swap(&context_x86->es);
- Swap(&context_x86->ds);
- Swap(&context_x86->edi);
- Swap(&context_x86->esi);
- Swap(&context_x86->ebx);
- Swap(&context_x86->edx);
- Swap(&context_x86->ecx);
- Swap(&context_x86->eax);
- Swap(&context_x86->ebp);
- Swap(&context_x86->eip);
- Swap(&context_x86->cs);
- Swap(&context_x86->eflags);
- Swap(&context_x86->esp);
- Swap(&context_x86->ss);
- // context_x86->extended_registers[] contains 8-bit quantities and
- // does not need to be swapped.
- }
-
- SetContextX86(context_x86.release());
-
- break;
- }
-
- case MD_CONTEXT_PPC: {
- if (expected_size != sizeof(MDRawContextPPC)) {
- BPLOG(ERROR) << "MinidumpContext ppc size mismatch, " <<
- expected_size << " != " << sizeof(MDRawContextPPC);
- return false;
- }
-
- scoped_ptr<MDRawContextPPC> context_ppc(new MDRawContextPPC());
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_ppc->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_ppc->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_ppc.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextPPC) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read ppc context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext ppc does not match system info";
- return false;
- }
-
- // Normalize the 128-bit types in the dump.
- // Since this is PowerPC, by definition, the values are big-endian.
- for (unsigned int vr_index = 0;
- vr_index < MD_VECTORSAVEAREA_PPC_VR_COUNT;
- ++vr_index) {
- Normalize128(&context_ppc->vector_save.save_vr[vr_index], true);
- }
-
- if (minidump_->swap()) {
- // context_ppc->context_flags was already swapped.
- Swap(&context_ppc->srr0);
- Swap(&context_ppc->srr1);
- for (unsigned int gpr_index = 0;
- gpr_index < MD_CONTEXT_PPC_GPR_COUNT;
- ++gpr_index) {
- Swap(&context_ppc->gpr[gpr_index]);
- }
- Swap(&context_ppc->cr);
- Swap(&context_ppc->xer);
- Swap(&context_ppc->lr);
- Swap(&context_ppc->ctr);
- Swap(&context_ppc->mq);
- Swap(&context_ppc->vrsave);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_PPC_FPR_COUNT;
- ++fpr_index) {
- Swap(&context_ppc->float_save.fpregs[fpr_index]);
- }
- // Don't swap context_ppc->float_save.fpscr_pad because it is only
- // used for padding.
- Swap(&context_ppc->float_save.fpscr);
- for (unsigned int vr_index = 0;
- vr_index < MD_VECTORSAVEAREA_PPC_VR_COUNT;
- ++vr_index) {
- Swap(&context_ppc->vector_save.save_vr[vr_index]);
- }
- Swap(&context_ppc->vector_save.save_vscr);
- // Don't swap the padding fields in vector_save.
- Swap(&context_ppc->vector_save.save_vrvalid);
- }
-
- SetContextPPC(context_ppc.release());
-
- break;
- }
-
- case MD_CONTEXT_SPARC: {
- if (expected_size != sizeof(MDRawContextSPARC)) {
- BPLOG(ERROR) << "MinidumpContext sparc size mismatch, " <<
- expected_size << " != " << sizeof(MDRawContextSPARC);
- return false;
- }
-
- scoped_ptr<MDRawContextSPARC> context_sparc(new MDRawContextSPARC());
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_sparc->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_sparc->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_sparc.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextSPARC) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read sparc context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext sparc does not match system info";
- return false;
- }
-
- if (minidump_->swap()) {
- // context_sparc->context_flags was already swapped.
- for (unsigned int gpr_index = 0;
- gpr_index < MD_CONTEXT_SPARC_GPR_COUNT;
- ++gpr_index) {
- Swap(&context_sparc->g_r[gpr_index]);
- }
- Swap(&context_sparc->ccr);
- Swap(&context_sparc->pc);
- Swap(&context_sparc->npc);
- Swap(&context_sparc->y);
- Swap(&context_sparc->asi);
- Swap(&context_sparc->fprs);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_SPARC_FPR_COUNT;
- ++fpr_index) {
- Swap(&context_sparc->float_save.regs[fpr_index]);
- }
- Swap(&context_sparc->float_save.filler);
- Swap(&context_sparc->float_save.fsr);
- }
- SetContextSPARC(context_sparc.release());
-
- break;
- }
-
- case MD_CONTEXT_ARM: {
- if (expected_size != sizeof(MDRawContextARM)) {
- BPLOG(ERROR) << "MinidumpContext arm size mismatch, " <<
- expected_size << " != " << sizeof(MDRawContextARM);
- return false;
- }
-
- scoped_ptr<MDRawContextARM> context_arm(new MDRawContextARM());
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_arm->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_arm->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_arm.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextARM) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read arm context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext arm does not match system info";
- return false;
- }
-
- if (minidump_->swap()) {
- // context_arm->context_flags was already swapped.
- for (unsigned int ireg_index = 0;
- ireg_index < MD_CONTEXT_ARM_GPR_COUNT;
- ++ireg_index) {
- Swap(&context_arm->iregs[ireg_index]);
- }
- Swap(&context_arm->cpsr);
- Swap(&context_arm->float_save.fpscr);
- for (unsigned int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_ARM_FPR_COUNT;
- ++fpr_index) {
- Swap(&context_arm->float_save.regs[fpr_index]);
- }
- for (unsigned int fpe_index = 0;
- fpe_index < MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT;
- ++fpe_index) {
- Swap(&context_arm->float_save.extra[fpe_index]);
- }
- }
- SetContextARM(context_arm.release());
-
- break;
- }
-
- case MD_CONTEXT_MIPS:
- case MD_CONTEXT_MIPS64: {
- if (expected_size != sizeof(MDRawContextMIPS)) {
- BPLOG(ERROR) << "MinidumpContext MIPS size mismatch, "
- << expected_size
- << " != "
- << sizeof(MDRawContextMIPS);
- return false;
- }
-
- scoped_ptr<MDRawContextMIPS> context_mips(new MDRawContextMIPS());
-
- // Set the context_flags member, which has already been read, and
- // read the rest of the structure beginning with the first member
- // after context_flags.
- context_mips->context_flags = context_flags;
-
- size_t flags_size = sizeof(context_mips->context_flags);
- uint8_t* context_after_flags =
- reinterpret_cast<uint8_t*>(context_mips.get()) + flags_size;
- if (!minidump_->ReadBytes(context_after_flags,
- sizeof(MDRawContextMIPS) - flags_size)) {
- BPLOG(ERROR) << "MinidumpContext could not read MIPS context";
- return false;
- }
-
- // Do this after reading the entire MDRawContext structure because
- // GetSystemInfo may seek minidump to a new position.
- if (!CheckAgainstSystemInfo(cpu_type)) {
- BPLOG(ERROR) << "MinidumpContext MIPS does not match system info";
- return false;
- }
-
- if (minidump_->swap()) {
- // context_mips->context_flags was already swapped.
- for (int ireg_index = 0;
- ireg_index < MD_CONTEXT_MIPS_GPR_COUNT;
- ++ireg_index) {
- Swap(&context_mips->iregs[ireg_index]);
- }
- Swap(&context_mips->mdhi);
- Swap(&context_mips->mdlo);
- for (int dsp_index = 0;
- dsp_index < MD_CONTEXT_MIPS_DSP_COUNT;
- ++dsp_index) {
- Swap(&context_mips->hi[dsp_index]);
- Swap(&context_mips->lo[dsp_index]);
- }
- Swap(&context_mips->dsp_control);
- Swap(&context_mips->epc);
- Swap(&context_mips->badvaddr);
- Swap(&context_mips->status);
- Swap(&context_mips->cause);
- for (int fpr_index = 0;
- fpr_index < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT;
- ++fpr_index) {
- Swap(&context_mips->float_save.regs[fpr_index]);
- }
- Swap(&context_mips->float_save.fpcsr);
- Swap(&context_mips->float_save.fir);
- }
- SetContextMIPS(context_mips.release());
-
- break;
- }
-
- default: {
- // Unknown context type - Don't log as an error yet. Let the
- // caller work that out.
- BPLOG(INFO) << "MinidumpContext unknown context type " <<
- HexString(cpu_type);
- return false;
- break;
- }
- }
- SetContextFlags(context_flags);
- }
-
- valid_ = true;
- return true;
-}
-
-bool MinidumpContext::CheckAgainstSystemInfo(uint32_t context_cpu_type) {
- // It's OK if the minidump doesn't contain an MD_SYSTEM_INFO_STREAM,
- // as this function just implements a sanity check.
- MinidumpSystemInfo* system_info = minidump_->GetSystemInfo();
- if (!system_info) {
- BPLOG(INFO) << "MinidumpContext could not be compared against "
- "MinidumpSystemInfo";
- return true;
- }
-
- // If there is an MD_SYSTEM_INFO_STREAM, it should contain valid system info.
- const MDRawSystemInfo* raw_system_info = system_info->system_info();
- if (!raw_system_info) {
- BPLOG(INFO) << "MinidumpContext could not be compared against "
- "MDRawSystemInfo";
- return false;
- }
-
- MDCPUArchitecture system_info_cpu_type = static_cast<MDCPUArchitecture>(
- raw_system_info->processor_architecture);
-
- // Compare the CPU type of the context record to the CPU type in the
- // minidump's system info stream.
- bool return_value = false;
- switch (context_cpu_type) {
- case MD_CONTEXT_X86:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_X86 ||
- system_info_cpu_type == MD_CPU_ARCHITECTURE_X86_WIN64 ||
- system_info_cpu_type == MD_CPU_ARCHITECTURE_AMD64) {
- return_value = true;
- }
- break;
-
- case MD_CONTEXT_PPC:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_PPC)
- return_value = true;
- break;
-
- case MD_CONTEXT_PPC64:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_PPC64)
- return_value = true;
- break;
-
- case MD_CONTEXT_AMD64:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_AMD64)
- return_value = true;
- break;
-
- case MD_CONTEXT_SPARC:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_SPARC)
- return_value = true;
- break;
-
- case MD_CONTEXT_ARM:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_ARM)
- return_value = true;
- break;
-
- case MD_CONTEXT_ARM64:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_ARM64)
- return_value = true;
- break;
-
- case MD_CONTEXT_MIPS:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_MIPS)
- return_value = true;
- break;
-
- case MD_CONTEXT_MIPS64:
- if (system_info_cpu_type == MD_CPU_ARCHITECTURE_MIPS64)
- return_value = true;
- break;
- }
-
- BPLOG_IF(ERROR, !return_value) << "MinidumpContext CPU " <<
- HexString(context_cpu_type) <<
- " wrong for MinidumpSystemInfo CPU " <<
- HexString(system_info_cpu_type);
-
- return return_value;
-}
-
-
-//
-// MinidumpMemoryRegion
-//
-
-
-uint32_t MinidumpMemoryRegion::max_bytes_ = 2 * 1024 * 1024; // 2MB
-
-
-MinidumpMemoryRegion::MinidumpMemoryRegion(Minidump* minidump)
- : MinidumpObject(minidump),
- descriptor_(NULL),
- memory_(NULL) {
-}
-
-
-MinidumpMemoryRegion::~MinidumpMemoryRegion() {
- delete memory_;
-}
-
-
-void MinidumpMemoryRegion::SetDescriptor(MDMemoryDescriptor* descriptor) {
- descriptor_ = descriptor;
- valid_ = descriptor &&
- descriptor_->memory.data_size <=
- numeric_limits<uint64_t>::max() -
- descriptor_->start_of_memory_range;
-}
-
-
-const uint8_t* MinidumpMemoryRegion::GetMemory() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for GetMemory";
- return NULL;
- }
-
- if (!memory_) {
- if (descriptor_->memory.data_size == 0) {
- BPLOG(ERROR) << "MinidumpMemoryRegion is empty";
- return NULL;
- }
-
- if (!minidump_->SeekSet(descriptor_->memory.rva)) {
- BPLOG(ERROR) << "MinidumpMemoryRegion could not seek to memory region";
- return NULL;
- }
-
- if (descriptor_->memory.data_size > max_bytes_) {
- BPLOG(ERROR) << "MinidumpMemoryRegion size " <<
- descriptor_->memory.data_size << " exceeds maximum " <<
- max_bytes_;
- return NULL;
- }
-
- scoped_ptr< vector<uint8_t> > memory(
- new vector<uint8_t>(descriptor_->memory.data_size));
-
- if (!minidump_->ReadBytes(&(*memory)[0], descriptor_->memory.data_size)) {
- BPLOG(ERROR) << "MinidumpMemoryRegion could not read memory region";
- return NULL;
- }
-
- memory_ = memory.release();
- }
-
- return &(*memory_)[0];
-}
-
-
-uint64_t MinidumpMemoryRegion::GetBase() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for GetBase";
- return static_cast<uint64_t>(-1);
- }
-
- return descriptor_->start_of_memory_range;
-}
-
-
-uint32_t MinidumpMemoryRegion::GetSize() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for GetSize";
- return 0;
- }
-
- return descriptor_->memory.data_size;
-}
-
-
-void MinidumpMemoryRegion::FreeMemory() {
- delete memory_;
- memory_ = NULL;
-}
-
-
-template<typename T>
-bool MinidumpMemoryRegion::GetMemoryAtAddressInternal(uint64_t address,
- T* value) const {
- BPLOG_IF(ERROR, !value) << "MinidumpMemoryRegion::GetMemoryAtAddressInternal "
- "requires |value|";
- assert(value);
- *value = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryRegion for "
- "GetMemoryAtAddressInternal";
- return false;
- }
-
- // Common failure case
- if (address < descriptor_->start_of_memory_range ||
- sizeof(T) > numeric_limits<uint64_t>::max() - address ||
- address + sizeof(T) > descriptor_->start_of_memory_range +
- descriptor_->memory.data_size) {
- BPLOG(INFO) << "MinidumpMemoryRegion request out of range: " <<
- HexString(address) << "+" << sizeof(T) << "/" <<
- HexString(descriptor_->start_of_memory_range) << "+" <<
- HexString(descriptor_->memory.data_size);
- return false;
- }
-
- const uint8_t* memory = GetMemory();
- if (!memory) {
- // GetMemory already logged a perfectly good message.
- return false;
- }
-
- // If the CPU requires memory accesses to be aligned, this can crash.
- // x86 and ppc are able to cope, though.
- *value = *reinterpret_cast<const T*>(
- &memory[address - descriptor_->start_of_memory_range]);
-
- if (minidump_->swap())
- Swap(value);
-
- return true;
-}
-
-
-bool MinidumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint8_t* value) const {
- return GetMemoryAtAddressInternal(address, value);
-}
-
-
-bool MinidumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint16_t* value) const {
- return GetMemoryAtAddressInternal(address, value);
-}
-
-
-bool MinidumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint32_t* value) const {
- return GetMemoryAtAddressInternal(address, value);
-}
-
-
-bool MinidumpMemoryRegion::GetMemoryAtAddress(uint64_t address,
- uint64_t* value) const {
- return GetMemoryAtAddressInternal(address, value);
-}
-
-
-void MinidumpMemoryRegion::Print() const {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpMemoryRegion cannot print invalid data";
- return;
- }
-
- const uint8_t* memory = GetMemory();
- if (memory) {
- printf("0x");
- for (unsigned int byte_index = 0;
- byte_index < descriptor_->memory.data_size;
- byte_index++) {
- printf("%02x", memory[byte_index]);
- }
- printf("\n");
- } else {
- printf("No memory\n");
- }
-}
-
-
-//
-// MinidumpThread
-//
-
-
-MinidumpThread::MinidumpThread(Minidump* minidump)
- : MinidumpObject(minidump),
- thread_(),
- memory_(NULL),
- context_(NULL) {
-}
-
-
-MinidumpThread::~MinidumpThread() {
- delete memory_;
- delete context_;
-}
-
-
-bool MinidumpThread::Read() {
- // Invalidate cached data.
- delete memory_;
- memory_ = NULL;
- delete context_;
- context_ = NULL;
-
- valid_ = false;
-
- if (!minidump_->ReadBytes(&thread_, sizeof(thread_))) {
- BPLOG(ERROR) << "MinidumpThread cannot read thread";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&thread_.thread_id);
- Swap(&thread_.suspend_count);
- Swap(&thread_.priority_class);
- Swap(&thread_.priority);
- Swap(&thread_.teb);
- Swap(&thread_.stack);
- Swap(&thread_.thread_context);
- }
-
- // Check for base + size overflow or undersize.
- if (thread_.stack.memory.rva == 0 ||
- thread_.stack.memory.data_size == 0 ||
- thread_.stack.memory.data_size > numeric_limits<uint64_t>::max() -
- thread_.stack.start_of_memory_range) {
- // This is ok, but log an error anyway.
- BPLOG(ERROR) << "MinidumpThread has a memory region problem, " <<
- HexString(thread_.stack.start_of_memory_range) << "+" <<
- HexString(thread_.stack.memory.data_size) <<
- ", RVA 0x" << HexString(thread_.stack.memory.rva);
- } else {
- memory_ = new MinidumpMemoryRegion(minidump_);
- memory_->SetDescriptor(&thread_.stack);
- }
-
- valid_ = true;
- return true;
-}
-
-uint64_t MinidumpThread::GetStartOfStackMemoryRange() const {
- if (!valid_) {
- BPLOG(ERROR) << "GetStartOfStackMemoryRange: Invalid MinidumpThread";
- return 0;
- }
-
- return thread_.stack.start_of_memory_range;
-}
-
-MinidumpMemoryRegion* MinidumpThread::GetMemory() {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpThread for GetMemory";
- return NULL;
- }
-
- return memory_;
-}
-
-
-MinidumpContext* MinidumpThread::GetContext() {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpThread for GetContext";
- return NULL;
- }
-
- if (!context_) {
- if (!minidump_->SeekSet(thread_.thread_context.rva)) {
- BPLOG(ERROR) << "MinidumpThread cannot seek to context";
- return NULL;
- }
-
- scoped_ptr<MinidumpContext> context(new MinidumpContext(minidump_));
-
- if (!context->Read(thread_.thread_context.data_size)) {
- BPLOG(ERROR) << "MinidumpThread cannot read context";
- return NULL;
- }
-
- context_ = context.release();
- }
-
- return context_;
-}
-
-
-bool MinidumpThread::GetThreadID(uint32_t *thread_id) const {
- BPLOG_IF(ERROR, !thread_id) << "MinidumpThread::GetThreadID requires "
- "|thread_id|";
- assert(thread_id);
- *thread_id = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpThread for GetThreadID";
- return false;
- }
-
- *thread_id = thread_.thread_id;
- return true;
-}
-
-
-void MinidumpThread::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpThread cannot print invalid data";
- return;
- }
-
- printf("MDRawThread\n");
- printf(" thread_id = 0x%x\n", thread_.thread_id);
- printf(" suspend_count = %d\n", thread_.suspend_count);
- printf(" priority_class = 0x%x\n", thread_.priority_class);
- printf(" priority = 0x%x\n", thread_.priority);
- printf(" teb = 0x%" PRIx64 "\n", thread_.teb);
- printf(" stack.start_of_memory_range = 0x%" PRIx64 "\n",
- thread_.stack.start_of_memory_range);
- printf(" stack.memory.data_size = 0x%x\n",
- thread_.stack.memory.data_size);
- printf(" stack.memory.rva = 0x%x\n", thread_.stack.memory.rva);
- printf(" thread_context.data_size = 0x%x\n",
- thread_.thread_context.data_size);
- printf(" thread_context.rva = 0x%x\n",
- thread_.thread_context.rva);
-
- MinidumpContext* context = GetContext();
- if (context) {
- printf("\n");
- context->Print();
- } else {
- printf(" (no context)\n");
- printf("\n");
- }
-
- MinidumpMemoryRegion* memory = GetMemory();
- if (memory) {
- printf("Stack\n");
- memory->Print();
- } else {
- printf("No stack\n");
- }
- printf("\n");
-}
-
-
-//
-// MinidumpThreadList
-//
-
-
-uint32_t MinidumpThreadList::max_threads_ = 4096;
-
-
-MinidumpThreadList::MinidumpThreadList(Minidump* minidump)
- : MinidumpStream(minidump),
- id_to_thread_map_(),
- threads_(NULL),
- thread_count_(0) {
-}
-
-
-MinidumpThreadList::~MinidumpThreadList() {
- delete threads_;
-}
-
-
-bool MinidumpThreadList::Read(uint32_t expected_size) {
- // Invalidate cached data.
- id_to_thread_map_.clear();
- delete threads_;
- threads_ = NULL;
- thread_count_ = 0;
-
- valid_ = false;
-
- uint32_t thread_count;
- if (expected_size < sizeof(thread_count)) {
- BPLOG(ERROR) << "MinidumpThreadList count size mismatch, " <<
- expected_size << " < " << sizeof(thread_count);
- return false;
- }
- if (!minidump_->ReadBytes(&thread_count, sizeof(thread_count))) {
- BPLOG(ERROR) << "MinidumpThreadList cannot read thread count";
- return false;
- }
-
- if (minidump_->swap())
- Swap(&thread_count);
-
- if (thread_count > numeric_limits<uint32_t>::max() / sizeof(MDRawThread)) {
- BPLOG(ERROR) << "MinidumpThreadList thread count " << thread_count <<
- " would cause multiplication overflow";
- return false;
- }
-
- if (expected_size != sizeof(thread_count) +
- thread_count * sizeof(MDRawThread)) {
- // may be padded with 4 bytes on 64bit ABIs for alignment
- if (expected_size == sizeof(thread_count) + 4 +
- thread_count * sizeof(MDRawThread)) {
- uint32_t useless;
- if (!minidump_->ReadBytes(&useless, 4)) {
- BPLOG(ERROR) << "MinidumpThreadList cannot read threadlist padded "
- "bytes";
- return false;
- }
- } else {
- BPLOG(ERROR) << "MinidumpThreadList size mismatch, " << expected_size <<
- " != " << sizeof(thread_count) +
- thread_count * sizeof(MDRawThread);
- return false;
- }
- }
-
-
- if (thread_count > max_threads_) {
- BPLOG(ERROR) << "MinidumpThreadList count " << thread_count <<
- " exceeds maximum " << max_threads_;
- return false;
- }
-
- if (thread_count != 0) {
- scoped_ptr<MinidumpThreads> threads(
- new MinidumpThreads(thread_count, MinidumpThread(minidump_)));
-
- for (unsigned int thread_index = 0;
- thread_index < thread_count;
- ++thread_index) {
- MinidumpThread* thread = &(*threads)[thread_index];
-
- // Assume that the file offset is correct after the last read.
- if (!thread->Read()) {
- BPLOG(ERROR) << "MinidumpThreadList cannot read thread " <<
- thread_index << "/" << thread_count;
- return false;
- }
-
- uint32_t thread_id;
- if (!thread->GetThreadID(&thread_id)) {
- BPLOG(ERROR) << "MinidumpThreadList cannot get thread ID for thread " <<
- thread_index << "/" << thread_count;
- return false;
- }
-
- if (GetThreadByID(thread_id)) {
- // Another thread with this ID is already in the list. Data error.
- BPLOG(ERROR) << "MinidumpThreadList found multiple threads with ID " <<
- HexString(thread_id) << " at thread " <<
- thread_index << "/" << thread_count;
- return false;
- }
- id_to_thread_map_[thread_id] = thread;
- }
-
- threads_ = threads.release();
- }
-
- thread_count_ = thread_count;
-
- valid_ = true;
- return true;
-}
-
-
-MinidumpThread* MinidumpThreadList::GetThreadAtIndex(unsigned int index)
- const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpThreadList for GetThreadAtIndex";
- return NULL;
- }
-
- if (index >= thread_count_) {
- BPLOG(ERROR) << "MinidumpThreadList index out of range: " <<
- index << "/" << thread_count_;
- return NULL;
- }
-
- return &(*threads_)[index];
-}
-
-
-MinidumpThread* MinidumpThreadList::GetThreadByID(uint32_t thread_id) {
- // Don't check valid_. Read calls this method before everything is
- // validated. It is safe to not check valid_ here.
- return id_to_thread_map_[thread_id];
-}
-
-
-void MinidumpThreadList::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpThreadList cannot print invalid data";
- return;
- }
-
- printf("MinidumpThreadList\n");
- printf(" thread_count = %d\n", thread_count_);
- printf("\n");
-
- for (unsigned int thread_index = 0;
- thread_index < thread_count_;
- ++thread_index) {
- printf("thread[%d]\n", thread_index);
-
- (*threads_)[thread_index].Print();
- }
-}
-
-
-//
-// MinidumpModule
-//
-
-
-uint32_t MinidumpModule::max_cv_bytes_ = 32768;
-uint32_t MinidumpModule::max_misc_bytes_ = 32768;
-
-
-MinidumpModule::MinidumpModule(Minidump* minidump)
- : MinidumpObject(minidump),
- module_valid_(false),
- has_debug_info_(false),
- module_(),
- name_(NULL),
- cv_record_(NULL),
- cv_record_signature_(MD_CVINFOUNKNOWN_SIGNATURE),
- misc_record_(NULL) {
-}
-
-
-MinidumpModule::~MinidumpModule() {
- delete name_;
- delete cv_record_;
- delete misc_record_;
-}
-
-
-bool MinidumpModule::Read() {
- // Invalidate cached data.
- delete name_;
- name_ = NULL;
- delete cv_record_;
- cv_record_ = NULL;
- cv_record_signature_ = MD_CVINFOUNKNOWN_SIGNATURE;
- delete misc_record_;
- misc_record_ = NULL;
-
- module_valid_ = false;
- has_debug_info_ = false;
- valid_ = false;
-
- if (!minidump_->ReadBytes(&module_, MD_MODULE_SIZE)) {
- BPLOG(ERROR) << "MinidumpModule cannot read module";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&module_.base_of_image);
- Swap(&module_.size_of_image);
- Swap(&module_.checksum);
- Swap(&module_.time_date_stamp);
- Swap(&module_.module_name_rva);
- Swap(&module_.version_info.signature);
- Swap(&module_.version_info.struct_version);
- Swap(&module_.version_info.file_version_hi);
- Swap(&module_.version_info.file_version_lo);
- Swap(&module_.version_info.product_version_hi);
- Swap(&module_.version_info.product_version_lo);
- Swap(&module_.version_info.file_flags_mask);
- Swap(&module_.version_info.file_flags);
- Swap(&module_.version_info.file_os);
- Swap(&module_.version_info.file_type);
- Swap(&module_.version_info.file_subtype);
- Swap(&module_.version_info.file_date_hi);
- Swap(&module_.version_info.file_date_lo);
- Swap(&module_.cv_record);
- Swap(&module_.misc_record);
- // Don't swap reserved fields because their contents are unknown (as
- // are their proper widths).
- }
-
- // Check for base + size overflow or undersize.
- if (module_.size_of_image == 0 ||
- module_.size_of_image >
- numeric_limits<uint64_t>::max() - module_.base_of_image) {
- BPLOG(ERROR) << "MinidumpModule has a module problem, " <<
- HexString(module_.base_of_image) << "+" <<
- HexString(module_.size_of_image);
- return false;
- }
-
- module_valid_ = true;
- return true;
-}
-
-
-bool MinidumpModule::ReadAuxiliaryData() {
- if (!module_valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for ReadAuxiliaryData";
- return false;
- }
-
- // Each module must have a name.
- name_ = minidump_->ReadString(module_.module_name_rva);
- if (!name_) {
- BPLOG(ERROR) << "MinidumpModule could not read name";
- return false;
- }
-
- // At this point, we have enough info for the module to be valid.
- valid_ = true;
-
- // CodeView and miscellaneous debug records are only required if the
- // module indicates that they exist.
- if (module_.cv_record.data_size && !GetCVRecord(NULL)) {
- BPLOG(ERROR) << "MinidumpModule has no CodeView record, "
- "but one was expected";
- return false;
- }
-
- if (module_.misc_record.data_size && !GetMiscRecord(NULL)) {
- BPLOG(ERROR) << "MinidumpModule has no miscellaneous debug record, "
- "but one was expected";
- return false;
- }
-
- has_debug_info_ = true;
- return true;
-}
-
-
-string MinidumpModule::code_file() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for code_file";
- return "";
- }
-
- return *name_;
-}
-
-
-string MinidumpModule::code_identifier() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for code_identifier";
- return "";
- }
-
- if (!has_debug_info_)
- return "";
-
- MinidumpSystemInfo *minidump_system_info = minidump_->GetSystemInfo();
- if (!minidump_system_info) {
- BPLOG(ERROR) << "MinidumpModule code_identifier requires "
- "MinidumpSystemInfo";
- return "";
- }
-
- const MDRawSystemInfo *raw_system_info = minidump_system_info->system_info();
- if (!raw_system_info) {
- BPLOG(ERROR) << "MinidumpModule code_identifier requires MDRawSystemInfo";
- return "";
- }
-
- string identifier;
-
- switch (raw_system_info->platform_id) {
- case MD_OS_WIN32_NT:
- case MD_OS_WIN32_WINDOWS: {
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- char identifier_string[17];
- snprintf(identifier_string, sizeof(identifier_string), "%08X%x",
- module_.time_date_stamp, module_.size_of_image);
- identifier = identifier_string;
- break;
- }
-
- case MD_OS_ANDROID:
- case MD_OS_LINUX: {
- // If ELF CodeView data is present, return the debug id.
- if (cv_record_ && cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
- const MDCVInfoELF* cv_record_elf =
- reinterpret_cast<const MDCVInfoELF*>(&(*cv_record_)[0]);
- assert(cv_record_elf->cv_signature == MD_CVINFOELF_SIGNATURE);
-
- for (unsigned int build_id_index = 0;
- build_id_index < (cv_record_->size() - MDCVInfoELF_minsize);
- ++build_id_index) {
- char hexbyte[3];
- snprintf(hexbyte, sizeof(hexbyte), "%02x",
- cv_record_elf->build_id[build_id_index]);
- identifier += hexbyte;
- }
- break;
- }
- // Otherwise fall through to the case below.
- }
-
- case MD_OS_MAC_OS_X:
- case MD_OS_IOS:
- case MD_OS_SOLARIS:
- case MD_OS_NACL:
- case MD_OS_PS3: {
- // TODO(mmentovai): support uuid extension if present, otherwise fall
- // back to version (from LC_ID_DYLIB?), otherwise fall back to something
- // else.
- identifier = "id";
- break;
- }
-
- default: {
- // Without knowing what OS generated the dump, we can't generate a good
- // identifier. Return an empty string, signalling failure.
- BPLOG(ERROR) << "MinidumpModule code_identifier requires known platform, "
- "found " << HexString(raw_system_info->platform_id);
- break;
- }
- }
-
- return identifier;
-}
-
-
-string MinidumpModule::debug_file() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for debug_file";
- return "";
- }
-
- if (!has_debug_info_)
- return "";
-
- string file;
- // Prefer the CodeView record if present.
- if (cv_record_) {
- if (cv_record_signature_ == MD_CVINFOPDB70_SIGNATURE) {
- // It's actually an MDCVInfoPDB70 structure.
- const MDCVInfoPDB70* cv_record_70 =
- reinterpret_cast<const MDCVInfoPDB70*>(&(*cv_record_)[0]);
- assert(cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE);
-
- // GetCVRecord guarantees pdb_file_name is null-terminated.
- file = reinterpret_cast<const char*>(cv_record_70->pdb_file_name);
- } else if (cv_record_signature_ == MD_CVINFOPDB20_SIGNATURE) {
- // It's actually an MDCVInfoPDB20 structure.
- const MDCVInfoPDB20* cv_record_20 =
- reinterpret_cast<const MDCVInfoPDB20*>(&(*cv_record_)[0]);
- assert(cv_record_20->cv_header.signature == MD_CVINFOPDB20_SIGNATURE);
-
- // GetCVRecord guarantees pdb_file_name is null-terminated.
- file = reinterpret_cast<const char*>(cv_record_20->pdb_file_name);
- } else if (cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
- // It's actually an MDCVInfoELF structure.
- assert(reinterpret_cast<const MDCVInfoELF*>(&(*cv_record_)[0])->
- cv_signature == MD_CVINFOELF_SIGNATURE);
-
- // For MDCVInfoELF, the debug file is the code file.
- file = *name_;
- }
-
- // If there's a CodeView record but it doesn't match a known signature,
- // try the miscellaneous record.
- }
-
- if (file.empty()) {
- // No usable CodeView record. Try the miscellaneous debug record.
- if (misc_record_) {
- const MDImageDebugMisc* misc_record =
- reinterpret_cast<const MDImageDebugMisc *>(&(*misc_record_)[0]);
- if (!misc_record->unicode) {
- // If it's not Unicode, just stuff it into the string. It's unclear
- // if misc_record->data is 0-terminated, so use an explicit size.
- file = string(
- reinterpret_cast<const char*>(misc_record->data),
- module_.misc_record.data_size - MDImageDebugMisc_minsize);
- } else {
- // There's a misc_record but it encodes the debug filename in UTF-16.
- // (Actually, because miscellaneous records are so old, it's probably
- // UCS-2.) Convert it to UTF-8 for congruity with the other strings
- // that this method (and all other methods in the Minidump family)
- // return.
-
- unsigned int bytes =
- module_.misc_record.data_size - MDImageDebugMisc_minsize;
- if (bytes % 2 == 0) {
- unsigned int utf16_words = bytes / 2;
-
- // UTF16ToUTF8 expects a vector<uint16_t>, so create a temporary one
- // and copy the UTF-16 data into it.
- vector<uint16_t> string_utf16(utf16_words);
- if (utf16_words)
- memcpy(&string_utf16[0], &misc_record->data, bytes);
-
- // GetMiscRecord already byte-swapped the data[] field if it contains
- // UTF-16, so pass false as the swap argument.
- scoped_ptr<string> new_file(UTF16ToUTF8(string_utf16, false));
- file = *new_file;
- }
- }
- }
- }
-
- // Relatively common case
- BPLOG_IF(INFO, file.empty()) << "MinidumpModule could not determine "
- "debug_file for " << *name_;
-
- return file;
-}
-
-static string guid_and_age_to_debug_id(const MDGUID& guid,
- uint32_t age) {
- char identifier_string[41];
- snprintf(identifier_string, sizeof(identifier_string),
- "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%x",
- guid.data1,
- guid.data2,
- guid.data3,
- guid.data4[0],
- guid.data4[1],
- guid.data4[2],
- guid.data4[3],
- guid.data4[4],
- guid.data4[5],
- guid.data4[6],
- guid.data4[7],
- age);
- return identifier_string;
-}
-
-string MinidumpModule::debug_identifier() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for debug_identifier";
- return "";
- }
-
- if (!has_debug_info_)
- return "";
-
- string identifier;
-
- // Use the CodeView record if present.
- if (cv_record_) {
- if (cv_record_signature_ == MD_CVINFOPDB70_SIGNATURE) {
- // It's actually an MDCVInfoPDB70 structure.
- const MDCVInfoPDB70* cv_record_70 =
- reinterpret_cast<const MDCVInfoPDB70*>(&(*cv_record_)[0]);
- assert(cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE);
-
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- identifier = guid_and_age_to_debug_id(cv_record_70->signature,
- cv_record_70->age);
- } else if (cv_record_signature_ == MD_CVINFOPDB20_SIGNATURE) {
- // It's actually an MDCVInfoPDB20 structure.
- const MDCVInfoPDB20* cv_record_20 =
- reinterpret_cast<const MDCVInfoPDB20*>(&(*cv_record_)[0]);
- assert(cv_record_20->cv_header.signature == MD_CVINFOPDB20_SIGNATURE);
-
- // Use the same format that the MS symbol server uses in filesystem
- // hierarchies.
- char identifier_string[17];
- snprintf(identifier_string, sizeof(identifier_string),
- "%08X%x", cv_record_20->signature, cv_record_20->age);
- identifier = identifier_string;
- } else if (cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
- // It's actually an MDCVInfoELF structure.
- const MDCVInfoELF* cv_record_elf =
- reinterpret_cast<const MDCVInfoELF*>(&(*cv_record_)[0]);
- assert(cv_record_elf->cv_signature == MD_CVINFOELF_SIGNATURE);
-
- // For backwards-compatibility, stuff as many bytes as will fit into
- // a MDGUID and use the MS symbol server format as MDCVInfoPDB70 does
- // with age = 0. Historically Breakpad would do this during dump
- // writing to fit the build id data into a MDCVInfoPDB70 struct.
- // The full build id is available by calling code_identifier.
- MDGUID guid = {0};
- memcpy(&guid, &cv_record_elf->build_id,
- std::min(cv_record_->size() - MDCVInfoELF_minsize,
- sizeof(MDGUID)));
- identifier = guid_and_age_to_debug_id(guid, 0);
- }
- }
-
- // TODO(mmentovai): if there's no usable CodeView record, there might be a
- // miscellaneous debug record. It only carries a filename, though, and no
- // identifier. I'm not sure what the right thing to do for the identifier
- // is in that case, but I don't expect to find many modules without a
- // CodeView record (or some other Breakpad extension structure in place of
- // a CodeView record). Treat it as an error (empty identifier) for now.
-
- // TODO(mmentovai): on the Mac, provide fallbacks as in code_identifier().
-
- // Relatively common case
- BPLOG_IF(INFO, identifier.empty()) << "MinidumpModule could not determine "
- "debug_identifier for " << *name_;
-
- return identifier;
-}
-
-
-string MinidumpModule::version() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for version";
- return "";
- }
-
- string version;
-
- if (module_.version_info.signature == MD_VSFIXEDFILEINFO_SIGNATURE &&
- module_.version_info.struct_version & MD_VSFIXEDFILEINFO_VERSION) {
- char version_string[24];
- snprintf(version_string, sizeof(version_string), "%u.%u.%u.%u",
- module_.version_info.file_version_hi >> 16,
- module_.version_info.file_version_hi & 0xffff,
- module_.version_info.file_version_lo >> 16,
- module_.version_info.file_version_lo & 0xffff);
- version = version_string;
- }
-
- // TODO(mmentovai): possibly support other struct types in place of
- // the one used with MD_VSFIXEDFILEINFO_SIGNATURE. We can possibly use
- // a different structure that better represents versioning facilities on
- // Mac OS X and Linux, instead of forcing them to adhere to the dotted
- // quad of 16-bit ints that Windows uses.
-
- BPLOG_IF(INFO, version.empty()) << "MinidumpModule could not determine "
- "version for " << *name_;
-
- return version;
-}
-
-
-CodeModule* MinidumpModule::Copy() const {
- return new BasicCodeModule(this);
-}
-
-
-uint64_t MinidumpModule::shrink_down_delta() const {
- return 0;
-}
-
-void MinidumpModule::SetShrinkDownDelta(uint64_t shrink_down_delta) {
- // Not implemented
- assert(false);
-}
-
-
-const uint8_t* MinidumpModule::GetCVRecord(uint32_t* size) {
- if (!module_valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for GetCVRecord";
- return NULL;
- }
-
- if (!cv_record_) {
- // This just guards against 0-sized CodeView records; more specific checks
- // are used when the signature is checked against various structure types.
- if (module_.cv_record.data_size == 0) {
- return NULL;
- }
-
- if (!minidump_->SeekSet(module_.cv_record.rva)) {
- BPLOG(ERROR) << "MinidumpModule could not seek to CodeView record";
- return NULL;
- }
-
- if (module_.cv_record.data_size > max_cv_bytes_) {
- BPLOG(ERROR) << "MinidumpModule CodeView record size " <<
- module_.cv_record.data_size << " exceeds maximum " <<
- max_cv_bytes_;
- return NULL;
- }
-
- // Allocating something that will be accessed as MDCVInfoPDB70 or
- // MDCVInfoPDB20 but is allocated as uint8_t[] can cause alignment
- // problems. x86 and ppc are able to cope, though. This allocation
- // style is needed because the MDCVInfoPDB70 or MDCVInfoPDB20 are
- // variable-sized due to their pdb_file_name fields; these structures
- // are not MDCVInfoPDB70_minsize or MDCVInfoPDB20_minsize and treating
- // them as such would result in incomplete structures or overruns.
- scoped_ptr< vector<uint8_t> > cv_record(
- new vector<uint8_t>(module_.cv_record.data_size));
-
- if (!minidump_->ReadBytes(&(*cv_record)[0], module_.cv_record.data_size)) {
- BPLOG(ERROR) << "MinidumpModule could not read CodeView record";
- return NULL;
- }
-
- uint32_t signature = MD_CVINFOUNKNOWN_SIGNATURE;
- if (module_.cv_record.data_size > sizeof(signature)) {
- MDCVInfoPDB70* cv_record_signature =
- reinterpret_cast<MDCVInfoPDB70*>(&(*cv_record)[0]);
- signature = cv_record_signature->cv_signature;
- if (minidump_->swap())
- Swap(&signature);
- }
-
- if (signature == MD_CVINFOPDB70_SIGNATURE) {
- // Now that the structure type is known, recheck the size.
- if (MDCVInfoPDB70_minsize > module_.cv_record.data_size) {
- BPLOG(ERROR) << "MinidumpModule CodeView7 record size mismatch, " <<
- MDCVInfoPDB70_minsize << " > " <<
- module_.cv_record.data_size;
- return NULL;
- }
-
- if (minidump_->swap()) {
- MDCVInfoPDB70* cv_record_70 =
- reinterpret_cast<MDCVInfoPDB70*>(&(*cv_record)[0]);
- Swap(&cv_record_70->cv_signature);
- Swap(&cv_record_70->signature);
- Swap(&cv_record_70->age);
- // Don't swap cv_record_70.pdb_file_name because it's an array of 8-bit
- // quantities. (It's a path, is it UTF-8?)
- }
-
- // The last field of either structure is null-terminated 8-bit character
- // data. Ensure that it's null-terminated.
- if ((*cv_record)[module_.cv_record.data_size - 1] != '\0') {
- BPLOG(ERROR) << "MinidumpModule CodeView7 record string is not "
- "0-terminated";
- return NULL;
- }
- } else if (signature == MD_CVINFOPDB20_SIGNATURE) {
- // Now that the structure type is known, recheck the size.
- if (MDCVInfoPDB20_minsize > module_.cv_record.data_size) {
- BPLOG(ERROR) << "MinidumpModule CodeView2 record size mismatch, " <<
- MDCVInfoPDB20_minsize << " > " <<
- module_.cv_record.data_size;
- return NULL;
- }
- if (minidump_->swap()) {
- MDCVInfoPDB20* cv_record_20 =
- reinterpret_cast<MDCVInfoPDB20*>(&(*cv_record)[0]);
- Swap(&cv_record_20->cv_header.signature);
- Swap(&cv_record_20->cv_header.offset);
- Swap(&cv_record_20->signature);
- Swap(&cv_record_20->age);
- // Don't swap cv_record_20.pdb_file_name because it's an array of 8-bit
- // quantities. (It's a path, is it UTF-8?)
- }
-
- // The last field of either structure is null-terminated 8-bit character
- // data. Ensure that it's null-terminated.
- if ((*cv_record)[module_.cv_record.data_size - 1] != '\0') {
- BPLOG(ERROR) << "MindumpModule CodeView2 record string is not "
- "0-terminated";
- return NULL;
- }
- } else if (signature == MD_CVINFOELF_SIGNATURE) {
- // Now that the structure type is known, recheck the size.
- if (MDCVInfoELF_minsize > module_.cv_record.data_size) {
- BPLOG(ERROR) << "MinidumpModule CodeViewELF record size mismatch, " <<
- MDCVInfoELF_minsize << " > " <<
- module_.cv_record.data_size;
- return NULL;
- }
- // There's nothing to swap in CVInfoELF, it's just raw bytes.
- }
-
- // If the signature doesn't match something above, it's not something
- // that Breakpad can presently handle directly. Because some modules in
- // the wild contain such CodeView records as MD_CVINFOCV50_SIGNATURE,
- // don't bail out here - allow the data to be returned to the user,
- // although byte-swapping can't be done.
-
- // Store the vector type because that's how storage was allocated, but
- // return it casted to uint8_t*.
- cv_record_ = cv_record.release();
- cv_record_signature_ = signature;
- }
-
- if (size)
- *size = module_.cv_record.data_size;
-
- return &(*cv_record_)[0];
-}
-
-
-const MDImageDebugMisc* MinidumpModule::GetMiscRecord(uint32_t* size) {
- if (!module_valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModule for GetMiscRecord";
- return NULL;
- }
-
- if (!misc_record_) {
- if (module_.misc_record.data_size == 0) {
- return NULL;
- }
-
- if (MDImageDebugMisc_minsize > module_.misc_record.data_size) {
- BPLOG(ERROR) << "MinidumpModule miscellaneous debugging record "
- "size mismatch, " << MDImageDebugMisc_minsize << " > " <<
- module_.misc_record.data_size;
- return NULL;
- }
-
- if (!minidump_->SeekSet(module_.misc_record.rva)) {
- BPLOG(ERROR) << "MinidumpModule could not seek to miscellaneous "
- "debugging record";
- return NULL;
- }
-
- if (module_.misc_record.data_size > max_misc_bytes_) {
- BPLOG(ERROR) << "MinidumpModule miscellaneous debugging record size " <<
- module_.misc_record.data_size << " exceeds maximum " <<
- max_misc_bytes_;
- return NULL;
- }
-
- // Allocating something that will be accessed as MDImageDebugMisc but
- // is allocated as uint8_t[] can cause alignment problems. x86 and
- // ppc are able to cope, though. This allocation style is needed
- // because the MDImageDebugMisc is variable-sized due to its data field;
- // this structure is not MDImageDebugMisc_minsize and treating it as such
- // would result in an incomplete structure or an overrun.
- scoped_ptr< vector<uint8_t> > misc_record_mem(
- new vector<uint8_t>(module_.misc_record.data_size));
- MDImageDebugMisc* misc_record =
- reinterpret_cast<MDImageDebugMisc*>(&(*misc_record_mem)[0]);
-
- if (!minidump_->ReadBytes(misc_record, module_.misc_record.data_size)) {
- BPLOG(ERROR) << "MinidumpModule could not read miscellaneous debugging "
- "record";
- return NULL;
- }
-
- if (minidump_->swap()) {
- Swap(&misc_record->data_type);
- Swap(&misc_record->length);
- // Don't swap misc_record.unicode because it's an 8-bit quantity.
- // Don't swap the reserved fields for the same reason, and because
- // they don't contain any valid data.
- if (misc_record->unicode) {
- // There is a potential alignment problem, but shouldn't be a problem
- // in practice due to the layout of MDImageDebugMisc.
- uint16_t* data16 = reinterpret_cast<uint16_t*>(&(misc_record->data));
- unsigned int dataBytes = module_.misc_record.data_size -
- MDImageDebugMisc_minsize;
- Swap(data16, dataBytes);
- }
- }
-
- if (module_.misc_record.data_size != misc_record->length) {
- BPLOG(ERROR) << "MinidumpModule miscellaneous debugging record data "
- "size mismatch, " << module_.misc_record.data_size <<
- " != " << misc_record->length;
- return NULL;
- }
-
- // Store the vector type because that's how storage was allocated, but
- // return it casted to MDImageDebugMisc*.
- misc_record_ = misc_record_mem.release();
- }
-
- if (size)
- *size = module_.misc_record.data_size;
-
- return reinterpret_cast<MDImageDebugMisc*>(&(*misc_record_)[0]);
-}
-
-
-void MinidumpModule::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpModule cannot print invalid data";
- return;
- }
-
- printf("MDRawModule\n");
- printf(" base_of_image = 0x%" PRIx64 "\n",
- module_.base_of_image);
- printf(" size_of_image = 0x%x\n",
- module_.size_of_image);
- printf(" checksum = 0x%x\n",
- module_.checksum);
- printf(" time_date_stamp = 0x%x %s\n",
- module_.time_date_stamp,
- TimeTToUTCString(module_.time_date_stamp).c_str());
- printf(" module_name_rva = 0x%x\n",
- module_.module_name_rva);
- printf(" version_info.signature = 0x%x\n",
- module_.version_info.signature);
- printf(" version_info.struct_version = 0x%x\n",
- module_.version_info.struct_version);
- printf(" version_info.file_version = 0x%x:0x%x\n",
- module_.version_info.file_version_hi,
- module_.version_info.file_version_lo);
- printf(" version_info.product_version = 0x%x:0x%x\n",
- module_.version_info.product_version_hi,
- module_.version_info.product_version_lo);
- printf(" version_info.file_flags_mask = 0x%x\n",
- module_.version_info.file_flags_mask);
- printf(" version_info.file_flags = 0x%x\n",
- module_.version_info.file_flags);
- printf(" version_info.file_os = 0x%x\n",
- module_.version_info.file_os);
- printf(" version_info.file_type = 0x%x\n",
- module_.version_info.file_type);
- printf(" version_info.file_subtype = 0x%x\n",
- module_.version_info.file_subtype);
- printf(" version_info.file_date = 0x%x:0x%x\n",
- module_.version_info.file_date_hi,
- module_.version_info.file_date_lo);
- printf(" cv_record.data_size = %d\n",
- module_.cv_record.data_size);
- printf(" cv_record.rva = 0x%x\n",
- module_.cv_record.rva);
- printf(" misc_record.data_size = %d\n",
- module_.misc_record.data_size);
- printf(" misc_record.rva = 0x%x\n",
- module_.misc_record.rva);
-
- printf(" (code_file) = \"%s\"\n", code_file().c_str());
- printf(" (code_identifier) = \"%s\"\n",
- code_identifier().c_str());
-
- uint32_t cv_record_size;
- const uint8_t *cv_record = GetCVRecord(&cv_record_size);
- if (cv_record) {
- if (cv_record_signature_ == MD_CVINFOPDB70_SIGNATURE) {
- const MDCVInfoPDB70* cv_record_70 =
- reinterpret_cast<const MDCVInfoPDB70*>(cv_record);
- assert(cv_record_70->cv_signature == MD_CVINFOPDB70_SIGNATURE);
-
- printf(" (cv_record).cv_signature = 0x%x\n",
- cv_record_70->cv_signature);
- printf(" (cv_record).signature = %08x-%04x-%04x-%02x%02x-",
- cv_record_70->signature.data1,
- cv_record_70->signature.data2,
- cv_record_70->signature.data3,
- cv_record_70->signature.data4[0],
- cv_record_70->signature.data4[1]);
- for (unsigned int guidIndex = 2;
- guidIndex < 8;
- ++guidIndex) {
- printf("%02x", cv_record_70->signature.data4[guidIndex]);
- }
- printf("\n");
- printf(" (cv_record).age = %d\n",
- cv_record_70->age);
- printf(" (cv_record).pdb_file_name = \"%s\"\n",
- cv_record_70->pdb_file_name);
- } else if (cv_record_signature_ == MD_CVINFOPDB20_SIGNATURE) {
- const MDCVInfoPDB20* cv_record_20 =
- reinterpret_cast<const MDCVInfoPDB20*>(cv_record);
- assert(cv_record_20->cv_header.signature == MD_CVINFOPDB20_SIGNATURE);
-
- printf(" (cv_record).cv_header.signature = 0x%x\n",
- cv_record_20->cv_header.signature);
- printf(" (cv_record).cv_header.offset = 0x%x\n",
- cv_record_20->cv_header.offset);
- printf(" (cv_record).signature = 0x%x %s\n",
- cv_record_20->signature,
- TimeTToUTCString(cv_record_20->signature).c_str());
- printf(" (cv_record).age = %d\n",
- cv_record_20->age);
- printf(" (cv_record).pdb_file_name = \"%s\"\n",
- cv_record_20->pdb_file_name);
- } else if (cv_record_signature_ == MD_CVINFOELF_SIGNATURE) {
- const MDCVInfoELF* cv_record_elf =
- reinterpret_cast<const MDCVInfoELF*>(cv_record);
- assert(cv_record_elf->cv_signature == MD_CVINFOELF_SIGNATURE);
-
- printf(" (cv_record).cv_signature = 0x%x\n",
- cv_record_elf->cv_signature);
- printf(" (cv_record).build_id = ");
- for (unsigned int build_id_index = 0;
- build_id_index < (cv_record_size - MDCVInfoELF_minsize);
- ++build_id_index) {
- printf("%02x", cv_record_elf->build_id[build_id_index]);
- }
- printf("\n");
- } else {
- printf(" (cv_record) = ");
- for (unsigned int cv_byte_index = 0;
- cv_byte_index < cv_record_size;
- ++cv_byte_index) {
- printf("%02x", cv_record[cv_byte_index]);
- }
- printf("\n");
- }
- } else {
- printf(" (cv_record) = (null)\n");
- }
-
- const MDImageDebugMisc* misc_record = GetMiscRecord(NULL);
- if (misc_record) {
- printf(" (misc_record).data_type = 0x%x\n",
- misc_record->data_type);
- printf(" (misc_record).length = 0x%x\n",
- misc_record->length);
- printf(" (misc_record).unicode = %d\n",
- misc_record->unicode);
- if (misc_record->unicode) {
- string misc_record_data_utf8;
- ConvertUTF16BufferToUTF8String(
- reinterpret_cast<const uint16_t*>(misc_record->data),
- misc_record->length - offsetof(MDImageDebugMisc, data),
- &misc_record_data_utf8,
- false); // already swapped
- printf(" (misc_record).data = \"%s\"\n",
- misc_record_data_utf8.c_str());
- } else {
- printf(" (misc_record).data = \"%s\"\n",
- misc_record->data);
- }
- } else {
- printf(" (misc_record) = (null)\n");
- }
-
- printf(" (debug_file) = \"%s\"\n", debug_file().c_str());
- printf(" (debug_identifier) = \"%s\"\n",
- debug_identifier().c_str());
- printf(" (version) = \"%s\"\n", version().c_str());
- printf("\n");
-}
-
-
-//
-// MinidumpModuleList
-//
-
-
-uint32_t MinidumpModuleList::max_modules_ = 1024;
-
-
-MinidumpModuleList::MinidumpModuleList(Minidump* minidump)
- : MinidumpStream(minidump),
- range_map_(new RangeMap<uint64_t, unsigned int>()),
- modules_(NULL),
- module_count_(0) {
- range_map_->SetEnableShrinkDown(minidump_->IsAndroid());
-}
-
-
-MinidumpModuleList::~MinidumpModuleList() {
- delete range_map_;
- delete modules_;
-}
-
-
-bool MinidumpModuleList::Read(uint32_t expected_size) {
- // Invalidate cached data.
- range_map_->Clear();
- delete modules_;
- modules_ = NULL;
- module_count_ = 0;
-
- valid_ = false;
-
- uint32_t module_count;
- if (expected_size < sizeof(module_count)) {
- BPLOG(ERROR) << "MinidumpModuleList count size mismatch, " <<
- expected_size << " < " << sizeof(module_count);
- return false;
- }
- if (!minidump_->ReadBytes(&module_count, sizeof(module_count))) {
- BPLOG(ERROR) << "MinidumpModuleList could not read module count";
- return false;
- }
-
- if (minidump_->swap())
- Swap(&module_count);
-
- if (module_count > numeric_limits<uint32_t>::max() / MD_MODULE_SIZE) {
- BPLOG(ERROR) << "MinidumpModuleList module count " << module_count <<
- " would cause multiplication overflow";
- return false;
- }
-
- if (expected_size != sizeof(module_count) +
- module_count * MD_MODULE_SIZE) {
- // may be padded with 4 bytes on 64bit ABIs for alignment
- if (expected_size == sizeof(module_count) + 4 +
- module_count * MD_MODULE_SIZE) {
- uint32_t useless;
- if (!minidump_->ReadBytes(&useless, 4)) {
- BPLOG(ERROR) << "MinidumpModuleList cannot read modulelist padded "
- "bytes";
- return false;
- }
- } else {
- BPLOG(ERROR) << "MinidumpModuleList size mismatch, " << expected_size <<
- " != " << sizeof(module_count) +
- module_count * MD_MODULE_SIZE;
- return false;
- }
- }
-
- if (module_count > max_modules_) {
- BPLOG(ERROR) << "MinidumpModuleList count " << module_count_ <<
- " exceeds maximum " << max_modules_;
- return false;
- }
-
- if (module_count != 0) {
- scoped_ptr<MinidumpModules> modules(
- new MinidumpModules(module_count, MinidumpModule(minidump_)));
-
- for (unsigned int module_index = 0;
- module_index < module_count;
- ++module_index) {
- MinidumpModule* module = &(*modules)[module_index];
-
- // Assume that the file offset is correct after the last read.
- if (!module->Read()) {
- BPLOG(ERROR) << "MinidumpModuleList could not read module " <<
- module_index << "/" << module_count;
- return false;
- }
- }
-
- // Loop through the module list once more to read additional data and
- // build the range map. This is done in a second pass because
- // MinidumpModule::ReadAuxiliaryData seeks around, and if it were
- // included in the loop above, additional seeks would be needed where
- // none are now to read contiguous data.
- uint64_t last_end_address = 0;
- for (unsigned int module_index = 0;
- module_index < module_count;
- ++module_index) {
- MinidumpModule* module = &(*modules)[module_index];
-
- // ReadAuxiliaryData fails if any data that the module indicates should
- // exist is missing, but we treat some such cases as valid anyway. See
- // issue #222: if a debugging record is of a format that's too large to
- // handle, it shouldn't render the entire dump invalid. Check module
- // validity before giving up.
- if (!module->ReadAuxiliaryData() && !module->valid()) {
- BPLOG(ERROR) << "MinidumpModuleList could not read required module "
- "auxiliary data for module " <<
- module_index << "/" << module_count;
- return false;
- }
-
- // It is safe to use module->code_file() after successfully calling
- // module->ReadAuxiliaryData or noting that the module is valid.
-
- uint64_t base_address = module->base_address();
- uint64_t module_size = module->size();
- if (base_address == static_cast<uint64_t>(-1)) {
- BPLOG(ERROR) << "MinidumpModuleList found bad base address "
- "for module " << module_index << "/" << module_count <<
- ", " << module->code_file();
- return false;
- }
-
- if (!range_map_->StoreRange(base_address, module_size, module_index)) {
- // Android's shared memory implementation /dev/ashmem can contain
- // duplicate entries for JITted code, so ignore these.
- // TODO(wfh): Remove this code when Android is fixed.
- // See https://crbug.com/439531
- const string kDevAshmem("/dev/ashmem/");
- if (module->code_file().compare(
- 0, kDevAshmem.length(), kDevAshmem) != 0) {
- if (base_address < last_end_address) {
- // If failed due to apparent range overlap the cause may be
- // the client correction applied for Android packed relocations.
- // If this is the case, back out the client correction and retry.
- module_size -= last_end_address - base_address;
- base_address = last_end_address;
- if (!range_map_->StoreRange(base_address,
- module_size, module_index)) {
- BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
- module_index << "/" << module_count << ", " <<
- module->code_file() << ", " <<
- HexString(base_address) << "+" <<
- HexString(module_size) << ", after adjusting";
- return false;
- }
- } else {
- BPLOG(ERROR) << "MinidumpModuleList could not store module " <<
- module_index << "/" << module_count << ", " <<
- module->code_file() << ", " <<
- HexString(base_address) << "+" <<
- HexString(module_size);
- return false;
- }
- } else {
- BPLOG(INFO) << "MinidumpModuleList ignoring overlapping module " <<
- module_index << "/" << module_count << ", " <<
- module->code_file() << ", " <<
- HexString(base_address) << "+" <<
- HexString(module_size);
- }
- }
- last_end_address = base_address + module_size;
- }
-
- modules_ = modules.release();
- }
-
- module_count_ = module_count;
-
- valid_ = true;
- return true;
-}
-
-
-const MinidumpModule* MinidumpModuleList::GetModuleForAddress(
- uint64_t address) const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModuleList for GetModuleForAddress";
- return NULL;
- }
-
- unsigned int module_index;
- if (!range_map_->RetrieveRange(address, &module_index, NULL /* base */,
- NULL /* delta */, NULL /* size */)) {
- BPLOG(INFO) << "MinidumpModuleList has no module at " <<
- HexString(address);
- return NULL;
- }
-
- return GetModuleAtIndex(module_index);
-}
-
-
-const MinidumpModule* MinidumpModuleList::GetMainModule() const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModuleList for GetMainModule";
- return NULL;
- }
-
- // The main code module is the first one present in a minidump file's
- // MDRawModuleList.
- return GetModuleAtIndex(0);
-}
-
-
-const MinidumpModule* MinidumpModuleList::GetModuleAtSequence(
- unsigned int sequence) const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModuleList for GetModuleAtSequence";
- return NULL;
- }
-
- if (sequence >= module_count_) {
- BPLOG(ERROR) << "MinidumpModuleList sequence out of range: " <<
- sequence << "/" << module_count_;
- return NULL;
- }
-
- unsigned int module_index;
- if (!range_map_->RetrieveRangeAtIndex(sequence, &module_index,
- NULL /* base */, NULL /* delta */,
- NULL /* size */)) {
- BPLOG(ERROR) << "MinidumpModuleList has no module at sequence " << sequence;
- return NULL;
- }
-
- return GetModuleAtIndex(module_index);
-}
-
-
-const MinidumpModule* MinidumpModuleList::GetModuleAtIndex(
- unsigned int index) const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpModuleList for GetModuleAtIndex";
- return NULL;
- }
-
- if (index >= module_count_) {
- BPLOG(ERROR) << "MinidumpModuleList index out of range: " <<
- index << "/" << module_count_;
- return NULL;
- }
-
- return &(*modules_)[index];
-}
-
-
-const CodeModules* MinidumpModuleList::Copy() const {
- return new BasicCodeModules(this);
-}
-
-vector<linked_ptr<const CodeModule> >
-MinidumpModuleList::GetShrunkRangeModules() const {
- return vector<linked_ptr<const CodeModule> >();
-}
-
-bool MinidumpModuleList::IsModuleShrinkEnabled() const {
- return range_map_->IsShrinkDownEnabled();
-}
-
-void MinidumpModuleList::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpModuleList cannot print invalid data";
- return;
- }
-
- printf("MinidumpModuleList\n");
- printf(" module_count = %d\n", module_count_);
- printf("\n");
-
- for (unsigned int module_index = 0;
- module_index < module_count_;
- ++module_index) {
- printf("module[%d]\n", module_index);
-
- (*modules_)[module_index].Print();
- }
-}
-
-
-//
-// MinidumpMemoryList
-//
-
-
-uint32_t MinidumpMemoryList::max_regions_ = 4096;
-
-
-MinidumpMemoryList::MinidumpMemoryList(Minidump* minidump)
- : MinidumpStream(minidump),
- range_map_(new RangeMap<uint64_t, unsigned int>()),
- descriptors_(NULL),
- regions_(NULL),
- region_count_(0) {
-}
-
-
-MinidumpMemoryList::~MinidumpMemoryList() {
- delete range_map_;
- delete descriptors_;
- delete regions_;
-}
-
-
-bool MinidumpMemoryList::Read(uint32_t expected_size) {
- // Invalidate cached data.
- delete descriptors_;
- descriptors_ = NULL;
- delete regions_;
- regions_ = NULL;
- range_map_->Clear();
- region_count_ = 0;
-
- valid_ = false;
-
- uint32_t region_count;
- if (expected_size < sizeof(region_count)) {
- BPLOG(ERROR) << "MinidumpMemoryList count size mismatch, " <<
- expected_size << " < " << sizeof(region_count);
- return false;
- }
- if (!minidump_->ReadBytes(&region_count, sizeof(region_count))) {
- BPLOG(ERROR) << "MinidumpMemoryList could not read memory region count";
- return false;
- }
-
- if (minidump_->swap())
- Swap(&region_count);
-
- if (region_count >
- numeric_limits<uint32_t>::max() / sizeof(MDMemoryDescriptor)) {
- BPLOG(ERROR) << "MinidumpMemoryList region count " << region_count <<
- " would cause multiplication overflow";
- return false;
- }
-
- if (expected_size != sizeof(region_count) +
- region_count * sizeof(MDMemoryDescriptor)) {
- // may be padded with 4 bytes on 64bit ABIs for alignment
- if (expected_size == sizeof(region_count) + 4 +
- region_count * sizeof(MDMemoryDescriptor)) {
- uint32_t useless;
- if (!minidump_->ReadBytes(&useless, 4)) {
- BPLOG(ERROR) << "MinidumpMemoryList cannot read memorylist padded "
- "bytes";
- return false;
- }
- } else {
- BPLOG(ERROR) << "MinidumpMemoryList size mismatch, " << expected_size <<
- " != " << sizeof(region_count) +
- region_count * sizeof(MDMemoryDescriptor);
- return false;
- }
- }
-
- if (region_count > max_regions_) {
- BPLOG(ERROR) << "MinidumpMemoryList count " << region_count <<
- " exceeds maximum " << max_regions_;
- return false;
- }
-
- if (region_count != 0) {
- scoped_ptr<MemoryDescriptors> descriptors(
- new MemoryDescriptors(region_count));
-
- // Read the entire array in one fell swoop, instead of reading one entry
- // at a time in the loop.
- if (!minidump_->ReadBytes(&(*descriptors)[0],
- sizeof(MDMemoryDescriptor) * region_count)) {
- BPLOG(ERROR) << "MinidumpMemoryList could not read memory region list";
- return false;
- }
-
- scoped_ptr<MemoryRegions> regions(
- new MemoryRegions(region_count, MinidumpMemoryRegion(minidump_)));
-
- for (unsigned int region_index = 0;
- region_index < region_count;
- ++region_index) {
- MDMemoryDescriptor* descriptor = &(*descriptors)[region_index];
-
- if (minidump_->swap())
- Swap(descriptor);
-
- uint64_t base_address = descriptor->start_of_memory_range;
- uint32_t region_size = descriptor->memory.data_size;
-
- // Check for base + size overflow or undersize.
- if (region_size == 0 ||
- region_size > numeric_limits<uint64_t>::max() - base_address) {
- BPLOG(ERROR) << "MinidumpMemoryList has a memory region problem, " <<
- " region " << region_index << "/" << region_count <<
- ", " << HexString(base_address) << "+" <<
- HexString(region_size);
- return false;
- }
-
- if (!range_map_->StoreRange(base_address, region_size, region_index)) {
- BPLOG(ERROR) << "MinidumpMemoryList could not store memory region " <<
- region_index << "/" << region_count << ", " <<
- HexString(base_address) << "+" <<
- HexString(region_size);
- return false;
- }
-
- (*regions)[region_index].SetDescriptor(descriptor);
- }
-
- descriptors_ = descriptors.release();
- regions_ = regions.release();
- }
-
- region_count_ = region_count;
-
- valid_ = true;
- return true;
-}
-
-
-MinidumpMemoryRegion* MinidumpMemoryList::GetMemoryRegionAtIndex(
- unsigned int index) {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryList for GetMemoryRegionAtIndex";
- return NULL;
- }
-
- if (index >= region_count_) {
- BPLOG(ERROR) << "MinidumpMemoryList index out of range: " <<
- index << "/" << region_count_;
- return NULL;
- }
-
- return &(*regions_)[index];
-}
-
-
-MinidumpMemoryRegion* MinidumpMemoryList::GetMemoryRegionForAddress(
- uint64_t address) {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryList for GetMemoryRegionForAddress";
- return NULL;
- }
-
- unsigned int region_index;
- if (!range_map_->RetrieveRange(address, &region_index, NULL /* base */,
- NULL /* delta */, NULL /* size */)) {
- BPLOG(INFO) << "MinidumpMemoryList has no memory region at " <<
- HexString(address);
- return NULL;
- }
-
- return GetMemoryRegionAtIndex(region_index);
-}
-
-
-void MinidumpMemoryList::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpMemoryList cannot print invalid data";
- return;
- }
-
- printf("MinidumpMemoryList\n");
- printf(" region_count = %d\n", region_count_);
- printf("\n");
-
- for (unsigned int region_index = 0;
- region_index < region_count_;
- ++region_index) {
- MDMemoryDescriptor* descriptor = &(*descriptors_)[region_index];
- printf("region[%d]\n", region_index);
- printf("MDMemoryDescriptor\n");
- printf(" start_of_memory_range = 0x%" PRIx64 "\n",
- descriptor->start_of_memory_range);
- printf(" memory.data_size = 0x%x\n", descriptor->memory.data_size);
- printf(" memory.rva = 0x%x\n", descriptor->memory.rva);
- MinidumpMemoryRegion* region = GetMemoryRegionAtIndex(region_index);
- if (region) {
- printf("Memory\n");
- region->Print();
- } else {
- printf("No memory\n");
- }
- printf("\n");
- }
-}
-
-
-//
-// MinidumpException
-//
-
-
-MinidumpException::MinidumpException(Minidump* minidump)
- : MinidumpStream(minidump),
- exception_(),
- context_(NULL) {
-}
-
-
-MinidumpException::~MinidumpException() {
- delete context_;
-}
-
-
-bool MinidumpException::Read(uint32_t expected_size) {
- // Invalidate cached data.
- delete context_;
- context_ = NULL;
-
- valid_ = false;
-
- if (expected_size != sizeof(exception_)) {
- BPLOG(ERROR) << "MinidumpException size mismatch, " << expected_size <<
- " != " << sizeof(exception_);
- return false;
- }
-
- if (!minidump_->ReadBytes(&exception_, sizeof(exception_))) {
- BPLOG(ERROR) << "MinidumpException cannot read exception";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&exception_.thread_id);
- // exception_.__align is for alignment only and does not need to be
- // swapped.
- Swap(&exception_.exception_record.exception_code);
- Swap(&exception_.exception_record.exception_flags);
- Swap(&exception_.exception_record.exception_record);
- Swap(&exception_.exception_record.exception_address);
- Swap(&exception_.exception_record.number_parameters);
- // exception_.exception_record.__align is for alignment only and does not
- // need to be swapped.
- for (unsigned int parameter_index = 0;
- parameter_index < MD_EXCEPTION_MAXIMUM_PARAMETERS;
- ++parameter_index) {
- Swap(&exception_.exception_record.exception_information[parameter_index]);
- }
- Swap(&exception_.thread_context);
- }
-
- valid_ = true;
- return true;
-}
-
-
-bool MinidumpException::GetThreadID(uint32_t *thread_id) const {
- BPLOG_IF(ERROR, !thread_id) << "MinidumpException::GetThreadID requires "
- "|thread_id|";
- assert(thread_id);
- *thread_id = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpException for GetThreadID";
- return false;
- }
-
- *thread_id = exception_.thread_id;
- return true;
-}
-
-
-MinidumpContext* MinidumpException::GetContext() {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpException for GetContext";
- return NULL;
- }
-
- if (!context_) {
- if (!minidump_->SeekSet(exception_.thread_context.rva)) {
- BPLOG(ERROR) << "MinidumpException cannot seek to context";
- return NULL;
- }
-
- scoped_ptr<MinidumpContext> context(new MinidumpContext(minidump_));
-
- // Don't log as an error if we can still fall back on the thread's context
- // (which must be possible if we got this far.)
- if (!context->Read(exception_.thread_context.data_size)) {
- BPLOG(INFO) << "MinidumpException cannot read context";
- return NULL;
- }
-
- context_ = context.release();
- }
-
- return context_;
-}
-
-
-void MinidumpException::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpException cannot print invalid data";
- return;
- }
-
- printf("MDException\n");
- printf(" thread_id = 0x%x\n",
- exception_.thread_id);
- printf(" exception_record.exception_code = 0x%x\n",
- exception_.exception_record.exception_code);
- printf(" exception_record.exception_flags = 0x%x\n",
- exception_.exception_record.exception_flags);
- printf(" exception_record.exception_record = 0x%" PRIx64 "\n",
- exception_.exception_record.exception_record);
- printf(" exception_record.exception_address = 0x%" PRIx64 "\n",
- exception_.exception_record.exception_address);
- printf(" exception_record.number_parameters = %d\n",
- exception_.exception_record.number_parameters);
- for (unsigned int parameterIndex = 0;
- parameterIndex < exception_.exception_record.number_parameters;
- ++parameterIndex) {
- printf(" exception_record.exception_information[%2d] = 0x%" PRIx64 "\n",
- parameterIndex,
- exception_.exception_record.exception_information[parameterIndex]);
- }
- printf(" thread_context.data_size = %d\n",
- exception_.thread_context.data_size);
- printf(" thread_context.rva = 0x%x\n",
- exception_.thread_context.rva);
- MinidumpContext* context = GetContext();
- if (context) {
- printf("\n");
- context->Print();
- } else {
- printf(" (no context)\n");
- printf("\n");
- }
-}
-
-//
-// MinidumpAssertion
-//
-
-
-MinidumpAssertion::MinidumpAssertion(Minidump* minidump)
- : MinidumpStream(minidump),
- assertion_(),
- expression_(),
- function_(),
- file_() {
-}
-
-
-MinidumpAssertion::~MinidumpAssertion() {
-}
-
-
-bool MinidumpAssertion::Read(uint32_t expected_size) {
- // Invalidate cached data.
- valid_ = false;
-
- if (expected_size != sizeof(assertion_)) {
- BPLOG(ERROR) << "MinidumpAssertion size mismatch, " << expected_size <<
- " != " << sizeof(assertion_);
- return false;
- }
-
- if (!minidump_->ReadBytes(&assertion_, sizeof(assertion_))) {
- BPLOG(ERROR) << "MinidumpAssertion cannot read assertion";
- return false;
- }
-
- // Each of {expression, function, file} is a UTF-16 string,
- // we'll convert them to UTF-8 for ease of use.
- ConvertUTF16BufferToUTF8String(assertion_.expression,
- sizeof(assertion_.expression), &expression_,
- minidump_->swap());
- ConvertUTF16BufferToUTF8String(assertion_.function,
- sizeof(assertion_.function), &function_,
- minidump_->swap());
- ConvertUTF16BufferToUTF8String(assertion_.file, sizeof(assertion_.file),
- &file_, minidump_->swap());
-
- if (minidump_->swap()) {
- Swap(&assertion_.line);
- Swap(&assertion_.type);
- }
-
- valid_ = true;
- return true;
-}
-
-void MinidumpAssertion::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpAssertion cannot print invalid data";
- return;
- }
-
- printf("MDAssertion\n");
- printf(" expression = %s\n",
- expression_.c_str());
- printf(" function = %s\n",
- function_.c_str());
- printf(" file = %s\n",
- file_.c_str());
- printf(" line = %u\n",
- assertion_.line);
- printf(" type = %u\n",
- assertion_.type);
- printf("\n");
-}
-
-//
-// MinidumpSystemInfo
-//
-
-
-MinidumpSystemInfo::MinidumpSystemInfo(Minidump* minidump)
- : MinidumpStream(minidump),
- system_info_(),
- csd_version_(NULL),
- cpu_vendor_(NULL) {
-}
-
-
-MinidumpSystemInfo::~MinidumpSystemInfo() {
- delete csd_version_;
- delete cpu_vendor_;
-}
-
-
-bool MinidumpSystemInfo::Read(uint32_t expected_size) {
- // Invalidate cached data.
- delete csd_version_;
- csd_version_ = NULL;
- delete cpu_vendor_;
- cpu_vendor_ = NULL;
-
- valid_ = false;
-
- if (expected_size != sizeof(system_info_)) {
- BPLOG(ERROR) << "MinidumpSystemInfo size mismatch, " << expected_size <<
- " != " << sizeof(system_info_);
- return false;
- }
-
- if (!minidump_->ReadBytes(&system_info_, sizeof(system_info_))) {
- BPLOG(ERROR) << "MinidumpSystemInfo cannot read system info";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&system_info_.processor_architecture);
- Swap(&system_info_.processor_level);
- Swap(&system_info_.processor_revision);
- // number_of_processors and product_type are 8-bit quantities and need no
- // swapping.
- Swap(&system_info_.major_version);
- Swap(&system_info_.minor_version);
- Swap(&system_info_.build_number);
- Swap(&system_info_.platform_id);
- Swap(&system_info_.csd_version_rva);
- Swap(&system_info_.suite_mask);
- // Don't swap the reserved2 field because its contents are unknown.
-
- if (system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86 ||
- system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86_WIN64) {
- for (unsigned int i = 0; i < 3; ++i)
- Swap(&system_info_.cpu.x86_cpu_info.vendor_id[i]);
- Swap(&system_info_.cpu.x86_cpu_info.version_information);
- Swap(&system_info_.cpu.x86_cpu_info.feature_information);
- Swap(&system_info_.cpu.x86_cpu_info.amd_extended_cpu_features);
- } else {
- for (unsigned int i = 0; i < 2; ++i)
- Swap(&system_info_.cpu.other_cpu_info.processor_features[i]);
- }
- }
-
- valid_ = true;
- return true;
-}
-
-
-string MinidumpSystemInfo::GetOS() {
- string os;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpSystemInfo for GetOS";
- return os;
- }
-
- switch (system_info_.platform_id) {
- case MD_OS_WIN32_NT:
- case MD_OS_WIN32_WINDOWS:
- os = "windows";
- break;
-
- case MD_OS_MAC_OS_X:
- os = "mac";
- break;
-
- case MD_OS_IOS:
- os = "ios";
- break;
-
- case MD_OS_LINUX:
- os = "linux";
- break;
-
- case MD_OS_SOLARIS:
- os = "solaris";
- break;
-
- case MD_OS_ANDROID:
- os = "android";
- break;
-
- case MD_OS_PS3:
- os = "ps3";
- break;
-
- case MD_OS_NACL:
- os = "nacl";
- break;
-
- default:
- BPLOG(ERROR) << "MinidumpSystemInfo unknown OS for platform " <<
- HexString(system_info_.platform_id);
- break;
- }
-
- return os;
-}
-
-
-string MinidumpSystemInfo::GetCPU() {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpSystemInfo for GetCPU";
- return "";
- }
-
- string cpu;
-
- switch (system_info_.processor_architecture) {
- case MD_CPU_ARCHITECTURE_X86:
- case MD_CPU_ARCHITECTURE_X86_WIN64:
- cpu = "x86";
- break;
-
- case MD_CPU_ARCHITECTURE_AMD64:
- cpu = "x86-64";
- break;
-
- case MD_CPU_ARCHITECTURE_PPC:
- cpu = "ppc";
- break;
-
- case MD_CPU_ARCHITECTURE_PPC64:
- cpu = "ppc64";
- break;
-
- case MD_CPU_ARCHITECTURE_SPARC:
- cpu = "sparc";
- break;
-
- case MD_CPU_ARCHITECTURE_ARM:
- cpu = "arm";
- break;
-
- case MD_CPU_ARCHITECTURE_ARM64:
- cpu = "arm64";
- break;
-
- default:
- BPLOG(ERROR) << "MinidumpSystemInfo unknown CPU for architecture " <<
- HexString(system_info_.processor_architecture);
- break;
- }
-
- return cpu;
-}
-
-
-const string* MinidumpSystemInfo::GetCSDVersion() {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpSystemInfo for GetCSDVersion";
- return NULL;
- }
-
- if (!csd_version_)
- csd_version_ = minidump_->ReadString(system_info_.csd_version_rva);
-
- BPLOG_IF(ERROR, !csd_version_) << "MinidumpSystemInfo could not read "
- "CSD version";
-
- return csd_version_;
-}
-
-
-const string* MinidumpSystemInfo::GetCPUVendor() {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpSystemInfo for GetCPUVendor";
- return NULL;
- }
-
- // CPU vendor information can only be determined from x86 minidumps.
- if (!cpu_vendor_ &&
- (system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86 ||
- system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86_WIN64)) {
- char cpu_vendor_string[13];
- snprintf(cpu_vendor_string, sizeof(cpu_vendor_string),
- "%c%c%c%c%c%c%c%c%c%c%c%c",
- system_info_.cpu.x86_cpu_info.vendor_id[0] & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[0] >> 8) & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[0] >> 16) & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[0] >> 24) & 0xff,
- system_info_.cpu.x86_cpu_info.vendor_id[1] & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[1] >> 8) & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[1] >> 16) & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[1] >> 24) & 0xff,
- system_info_.cpu.x86_cpu_info.vendor_id[2] & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[2] >> 8) & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[2] >> 16) & 0xff,
- (system_info_.cpu.x86_cpu_info.vendor_id[2] >> 24) & 0xff);
- cpu_vendor_ = new string(cpu_vendor_string);
- }
-
- return cpu_vendor_;
-}
-
-
-void MinidumpSystemInfo::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpSystemInfo cannot print invalid data";
- return;
- }
-
- printf("MDRawSystemInfo\n");
- printf(" processor_architecture = 0x%x\n",
- system_info_.processor_architecture);
- printf(" processor_level = %d\n",
- system_info_.processor_level);
- printf(" processor_revision = 0x%x\n",
- system_info_.processor_revision);
- printf(" number_of_processors = %d\n",
- system_info_.number_of_processors);
- printf(" product_type = %d\n",
- system_info_.product_type);
- printf(" major_version = %d\n",
- system_info_.major_version);
- printf(" minor_version = %d\n",
- system_info_.minor_version);
- printf(" build_number = %d\n",
- system_info_.build_number);
- printf(" platform_id = 0x%x\n",
- system_info_.platform_id);
- printf(" csd_version_rva = 0x%x\n",
- system_info_.csd_version_rva);
- printf(" suite_mask = 0x%x\n",
- system_info_.suite_mask);
- if (system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86 ||
- system_info_.processor_architecture == MD_CPU_ARCHITECTURE_X86_WIN64) {
- printf(" cpu.x86_cpu_info (valid):\n");
- } else {
- printf(" cpu.x86_cpu_info (invalid):\n");
- }
- for (unsigned int i = 0; i < 3; ++i) {
- printf(" cpu.x86_cpu_info.vendor_id[%d] = 0x%x\n",
- i, system_info_.cpu.x86_cpu_info.vendor_id[i]);
- }
- printf(" cpu.x86_cpu_info.version_information = 0x%x\n",
- system_info_.cpu.x86_cpu_info.version_information);
- printf(" cpu.x86_cpu_info.feature_information = 0x%x\n",
- system_info_.cpu.x86_cpu_info.feature_information);
- printf(" cpu.x86_cpu_info.amd_extended_cpu_features = 0x%x\n",
- system_info_.cpu.x86_cpu_info.amd_extended_cpu_features);
- if (system_info_.processor_architecture != MD_CPU_ARCHITECTURE_X86 &&
- system_info_.processor_architecture != MD_CPU_ARCHITECTURE_X86_WIN64) {
- printf(" cpu.other_cpu_info (valid):\n");
- for (unsigned int i = 0; i < 2; ++i) {
- printf(" cpu.other_cpu_info.processor_features[%d] = 0x%" PRIx64 "\n",
- i, system_info_.cpu.other_cpu_info.processor_features[i]);
- }
- }
- const string* csd_version = GetCSDVersion();
- if (csd_version) {
- printf(" (csd_version) = \"%s\"\n",
- csd_version->c_str());
- } else {
- printf(" (csd_version) = (null)\n");
- }
- const string* cpu_vendor = GetCPUVendor();
- if (cpu_vendor) {
- printf(" (cpu_vendor) = \"%s\"\n",
- cpu_vendor->c_str());
- } else {
- printf(" (cpu_vendor) = (null)\n");
- }
- printf("\n");
-}
-
-
-//
-// MinidumpMiscInfo
-//
-
-
-MinidumpMiscInfo::MinidumpMiscInfo(Minidump* minidump)
- : MinidumpStream(minidump),
- misc_info_() {
-}
-
-
-bool MinidumpMiscInfo::Read(uint32_t expected_size) {
- valid_ = false;
-
- size_t padding = 0;
- if (expected_size != MD_MISCINFO_SIZE &&
- expected_size != MD_MISCINFO2_SIZE &&
- expected_size != MD_MISCINFO3_SIZE &&
- expected_size != MD_MISCINFO4_SIZE &&
- expected_size != MD_MISCINFO5_SIZE) {
- if (expected_size > MD_MISCINFO5_SIZE) {
- // Only read the part of the misc info structure we know how to handle
- BPLOG(INFO) << "MinidumpMiscInfo size larger than expected "
- << expected_size << ", skipping over the unknown part";
- padding = expected_size - MD_MISCINFO5_SIZE;
- expected_size = MD_MISCINFO5_SIZE;
- } else {
- BPLOG(ERROR) << "MinidumpMiscInfo size mismatch, " << expected_size
- << " != " << MD_MISCINFO_SIZE << ", " << MD_MISCINFO2_SIZE
- << ", " << MD_MISCINFO3_SIZE << ", " << MD_MISCINFO4_SIZE
- << ", " << MD_MISCINFO5_SIZE << ")";
- return false;
- }
- }
-
- if (!minidump_->ReadBytes(&misc_info_, expected_size)) {
- BPLOG(ERROR) << "MinidumpMiscInfo cannot read miscellaneous info";
- return false;
- }
-
- if (padding != 0) {
- off_t saved_position = minidump_->Tell();
- if (saved_position == -1) {
- BPLOG(ERROR) << "MinidumpMiscInfo could not tell the current position";
- return false;
- }
-
- if (!minidump_->SeekSet(saved_position + padding)) {
- BPLOG(ERROR) << "MinidumpMiscInfo could not seek past the miscellaneous "
- << "info structure";
- return false;
- }
- }
-
- if (minidump_->swap()) {
- // Swap version 1 fields
- Swap(&misc_info_.size_of_info);
- Swap(&misc_info_.flags1);
- Swap(&misc_info_.process_id);
- Swap(&misc_info_.process_create_time);
- Swap(&misc_info_.process_user_time);
- Swap(&misc_info_.process_kernel_time);
- if (misc_info_.size_of_info > MD_MISCINFO_SIZE) {
- // Swap version 2 fields
- Swap(&misc_info_.processor_max_mhz);
- Swap(&misc_info_.processor_current_mhz);
- Swap(&misc_info_.processor_mhz_limit);
- Swap(&misc_info_.processor_max_idle_state);
- Swap(&misc_info_.processor_current_idle_state);
- }
- if (misc_info_.size_of_info > MD_MISCINFO2_SIZE) {
- // Swap version 3 fields
- Swap(&misc_info_.process_integrity_level);
- Swap(&misc_info_.process_execute_flags);
- Swap(&misc_info_.protected_process);
- Swap(&misc_info_.time_zone_id);
- Swap(&misc_info_.time_zone);
- }
- if (misc_info_.size_of_info > MD_MISCINFO3_SIZE) {
- // Swap version 4 fields.
- // Do not swap UTF-16 strings. The swap is done as part of the
- // conversion to UTF-8 (code follows below).
- }
- if (misc_info_.size_of_info > MD_MISCINFO4_SIZE) {
- // Swap version 5 fields
- Swap(&misc_info_.xstate_data);
- Swap(&misc_info_.process_cookie);
- }
- }
-
- if (expected_size + padding != misc_info_.size_of_info) {
- BPLOG(ERROR) << "MinidumpMiscInfo size mismatch, " <<
- expected_size << " != " << misc_info_.size_of_info;
- return false;
- }
-
- // Convert UTF-16 strings
- if (misc_info_.size_of_info > MD_MISCINFO2_SIZE) {
- // Convert UTF-16 strings in version 3 fields
- ConvertUTF16BufferToUTF8String(misc_info_.time_zone.standard_name,
- sizeof(misc_info_.time_zone.standard_name),
- &standard_name_, minidump_->swap());
- ConvertUTF16BufferToUTF8String(misc_info_.time_zone.daylight_name,
- sizeof(misc_info_.time_zone.daylight_name),
- &daylight_name_, minidump_->swap());
- }
- if (misc_info_.size_of_info > MD_MISCINFO3_SIZE) {
- // Convert UTF-16 strings in version 4 fields
- ConvertUTF16BufferToUTF8String(misc_info_.build_string,
- sizeof(misc_info_.build_string),
- &build_string_, minidump_->swap());
- ConvertUTF16BufferToUTF8String(misc_info_.dbg_bld_str,
- sizeof(misc_info_.dbg_bld_str),
- &dbg_bld_str_, minidump_->swap());
- }
-
- valid_ = true;
- return true;
-}
-
-
-void MinidumpMiscInfo::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpMiscInfo cannot print invalid data";
- return;
- }
-
- printf("MDRawMiscInfo\n");
- // Print version 1 fields
- printf(" size_of_info = %d\n", misc_info_.size_of_info);
- printf(" flags1 = 0x%x\n", misc_info_.flags1);
- printf(" process_id = ");
- PrintValueOrInvalid(misc_info_.flags1 & MD_MISCINFO_FLAGS1_PROCESS_ID,
- kNumberFormatDecimal, misc_info_.process_id);
- if (misc_info_.flags1 & MD_MISCINFO_FLAGS1_PROCESS_TIMES) {
- printf(" process_create_time = 0x%x %s\n",
- misc_info_.process_create_time,
- TimeTToUTCString(misc_info_.process_create_time).c_str());
- } else {
- printf(" process_create_time = (invalid)\n");
- }
- printf(" process_user_time = ");
- PrintValueOrInvalid(misc_info_.flags1 & MD_MISCINFO_FLAGS1_PROCESS_TIMES,
- kNumberFormatDecimal, misc_info_.process_user_time);
- printf(" process_kernel_time = ");
- PrintValueOrInvalid(misc_info_.flags1 & MD_MISCINFO_FLAGS1_PROCESS_TIMES,
- kNumberFormatDecimal, misc_info_.process_kernel_time);
- if (misc_info_.size_of_info > MD_MISCINFO_SIZE) {
- // Print version 2 fields
- printf(" processor_max_mhz = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO,
- kNumberFormatDecimal, misc_info_.processor_max_mhz);
- printf(" processor_current_mhz = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO,
- kNumberFormatDecimal, misc_info_.processor_current_mhz);
- printf(" processor_mhz_limit = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO,
- kNumberFormatDecimal, misc_info_.processor_mhz_limit);
- printf(" processor_max_idle_state = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO,
- kNumberFormatDecimal,
- misc_info_.processor_max_idle_state);
- printf(" processor_current_idle_state = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESSOR_POWER_INFO,
- kNumberFormatDecimal,
- misc_info_.processor_current_idle_state);
- }
- if (misc_info_.size_of_info > MD_MISCINFO2_SIZE) {
- // Print version 3 fields
- printf(" process_integrity_level = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESS_INTEGRITY,
- kNumberFormatHexadecimal,
- misc_info_.process_integrity_level);
- printf(" process_execute_flags = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROCESS_EXECUTE_FLAGS,
- kNumberFormatHexadecimal,
- misc_info_.process_execute_flags);
- printf(" protected_process = ");
- PrintValueOrInvalid(misc_info_.flags1 &
- MD_MISCINFO_FLAGS1_PROTECTED_PROCESS,
- kNumberFormatDecimal, misc_info_.protected_process);
- printf(" time_zone_id = ");
- PrintValueOrInvalid(misc_info_.flags1 & MD_MISCINFO_FLAGS1_TIMEZONE,
- kNumberFormatDecimal, misc_info_.time_zone_id);
- if (misc_info_.flags1 & MD_MISCINFO_FLAGS1_TIMEZONE) {
- printf(" time_zone.bias = %d\n",
- misc_info_.time_zone.bias);
- printf(" time_zone.standard_name = %s\n", standard_name_.c_str());
- printf(" time_zone.standard_date = "
- "%04d-%02d-%02d (%d) %02d:%02d:%02d.%03d\n",
- misc_info_.time_zone.standard_date.year,
- misc_info_.time_zone.standard_date.month,
- misc_info_.time_zone.standard_date.day,
- misc_info_.time_zone.standard_date.day_of_week,
- misc_info_.time_zone.standard_date.hour,
- misc_info_.time_zone.standard_date.minute,
- misc_info_.time_zone.standard_date.second,
- misc_info_.time_zone.standard_date.milliseconds);
- printf(" time_zone.standard_bias = %d\n",
- misc_info_.time_zone.standard_bias);
- printf(" time_zone.daylight_name = %s\n", daylight_name_.c_str());
- printf(" time_zone.daylight_date = "
- "%04d-%02d-%02d (%d) %02d:%02d:%02d.%03d\n",
- misc_info_.time_zone.daylight_date.year,
- misc_info_.time_zone.daylight_date.month,
- misc_info_.time_zone.daylight_date.day,
- misc_info_.time_zone.daylight_date.day_of_week,
- misc_info_.time_zone.daylight_date.hour,
- misc_info_.time_zone.daylight_date.minute,
- misc_info_.time_zone.daylight_date.second,
- misc_info_.time_zone.daylight_date.milliseconds);
- printf(" time_zone.daylight_bias = %d\n",
- misc_info_.time_zone.daylight_bias);
- } else {
- printf(" time_zone.bias = (invalid)\n");
- printf(" time_zone.standard_name = (invalid)\n");
- printf(" time_zone.standard_date = (invalid)\n");
- printf(" time_zone.standard_bias = (invalid)\n");
- printf(" time_zone.daylight_name = (invalid)\n");
- printf(" time_zone.daylight_date = (invalid)\n");
- printf(" time_zone.daylight_bias = (invalid)\n");
- }
- }
- if (misc_info_.size_of_info > MD_MISCINFO3_SIZE) {
- // Print version 4 fields
- if (misc_info_.flags1 & MD_MISCINFO_FLAGS1_BUILDSTRING) {
- printf(" build_string = %s\n", build_string_.c_str());
- printf(" dbg_bld_str = %s\n", dbg_bld_str_.c_str());
- } else {
- printf(" build_string = (invalid)\n");
- printf(" dbg_bld_str = (invalid)\n");
- }
- }
- if (misc_info_.size_of_info > MD_MISCINFO4_SIZE) {
- // Print version 5 fields
- if (misc_info_.flags1 & MD_MISCINFO_FLAGS1_PROCESS_COOKIE) {
- printf(" xstate_data.size_of_info = %d\n",
- misc_info_.xstate_data.size_of_info);
- printf(" xstate_data.context_size = %d\n",
- misc_info_.xstate_data.context_size);
- printf(" xstate_data.enabled_features = 0x%" PRIx64 "\n",
- misc_info_.xstate_data.enabled_features);
- for (size_t i = 0; i < MD_MAXIMUM_XSTATE_FEATURES; i++) {
- if (misc_info_.xstate_data.enabled_features & (1 << i)) {
- printf(" xstate_data.features[%02zu] = { %d, %d }\n", i,
- misc_info_.xstate_data.features[i].offset,
- misc_info_.xstate_data.features[i].size);
- }
- }
- if (misc_info_.xstate_data.enabled_features == 0) {
- printf(" xstate_data.features[] = (empty)\n");
- }
- printf(" process_cookie = %d\n",
- misc_info_.process_cookie);
- } else {
- printf(" xstate_data.size_of_info = (invalid)\n");
- printf(" xstate_data.context_size = (invalid)\n");
- printf(" xstate_data.enabled_features = (invalid)\n");
- printf(" xstate_data.features[] = (invalid)\n");
- printf(" process_cookie = (invalid)\n");
- }
- }
- printf("\n");
-}
-
-
-//
-// MinidumpBreakpadInfo
-//
-
-
-MinidumpBreakpadInfo::MinidumpBreakpadInfo(Minidump* minidump)
- : MinidumpStream(minidump),
- breakpad_info_() {
-}
-
-
-bool MinidumpBreakpadInfo::Read(uint32_t expected_size) {
- valid_ = false;
-
- if (expected_size != sizeof(breakpad_info_)) {
- BPLOG(ERROR) << "MinidumpBreakpadInfo size mismatch, " << expected_size <<
- " != " << sizeof(breakpad_info_);
- return false;
- }
-
- if (!minidump_->ReadBytes(&breakpad_info_, sizeof(breakpad_info_))) {
- BPLOG(ERROR) << "MinidumpBreakpadInfo cannot read Breakpad info";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&breakpad_info_.validity);
- Swap(&breakpad_info_.dump_thread_id);
- Swap(&breakpad_info_.requesting_thread_id);
- }
-
- valid_ = true;
- return true;
-}
-
-
-bool MinidumpBreakpadInfo::GetDumpThreadID(uint32_t *thread_id) const {
- BPLOG_IF(ERROR, !thread_id) << "MinidumpBreakpadInfo::GetDumpThreadID "
- "requires |thread_id|";
- assert(thread_id);
- *thread_id = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpBreakpadInfo for GetDumpThreadID";
- return false;
- }
-
- if (!(breakpad_info_.validity & MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID)) {
- BPLOG(INFO) << "MinidumpBreakpadInfo has no dump thread";
- return false;
- }
-
- *thread_id = breakpad_info_.dump_thread_id;
- return true;
-}
-
-
-bool MinidumpBreakpadInfo::GetRequestingThreadID(uint32_t *thread_id)
- const {
- BPLOG_IF(ERROR, !thread_id) << "MinidumpBreakpadInfo::GetRequestingThreadID "
- "requires |thread_id|";
- assert(thread_id);
- *thread_id = 0;
-
- if (!thread_id || !valid_) {
- BPLOG(ERROR) << "Invalid MinidumpBreakpadInfo for GetRequestingThreadID";
- return false;
- }
-
- if (!(breakpad_info_.validity &
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID)) {
- BPLOG(INFO) << "MinidumpBreakpadInfo has no requesting thread";
- return false;
- }
-
- *thread_id = breakpad_info_.requesting_thread_id;
- return true;
-}
-
-
-void MinidumpBreakpadInfo::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpBreakpadInfo cannot print invalid data";
- return;
- }
-
- printf("MDRawBreakpadInfo\n");
- printf(" validity = 0x%x\n", breakpad_info_.validity);
- printf(" dump_thread_id = ");
- PrintValueOrInvalid(breakpad_info_.validity &
- MD_BREAKPAD_INFO_VALID_DUMP_THREAD_ID,
- kNumberFormatHexadecimal, breakpad_info_.dump_thread_id);
- printf(" requesting_thread_id = ");
- PrintValueOrInvalid(breakpad_info_.validity &
- MD_BREAKPAD_INFO_VALID_REQUESTING_THREAD_ID,
- kNumberFormatHexadecimal,
- breakpad_info_.requesting_thread_id);
-
- printf("\n");
-}
-
-
-//
-// MinidumpMemoryInfo
-//
-
-
-MinidumpMemoryInfo::MinidumpMemoryInfo(Minidump* minidump)
- : MinidumpObject(minidump),
- memory_info_() {
-}
-
-
-bool MinidumpMemoryInfo::IsExecutable() const {
- uint32_t protection =
- memory_info_.protection & MD_MEMORY_PROTECTION_ACCESS_MASK;
- return protection == MD_MEMORY_PROTECT_EXECUTE ||
- protection == MD_MEMORY_PROTECT_EXECUTE_READ ||
- protection == MD_MEMORY_PROTECT_EXECUTE_READWRITE;
-}
-
-
-bool MinidumpMemoryInfo::IsWritable() const {
- uint32_t protection =
- memory_info_.protection & MD_MEMORY_PROTECTION_ACCESS_MASK;
- return protection == MD_MEMORY_PROTECT_READWRITE ||
- protection == MD_MEMORY_PROTECT_WRITECOPY ||
- protection == MD_MEMORY_PROTECT_EXECUTE_READWRITE ||
- protection == MD_MEMORY_PROTECT_EXECUTE_WRITECOPY;
-}
-
-
-bool MinidumpMemoryInfo::Read() {
- valid_ = false;
-
- if (!minidump_->ReadBytes(&memory_info_, sizeof(memory_info_))) {
- BPLOG(ERROR) << "MinidumpMemoryInfo cannot read memory info";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&memory_info_.base_address);
- Swap(&memory_info_.allocation_base);
- Swap(&memory_info_.allocation_protection);
- Swap(&memory_info_.region_size);
- Swap(&memory_info_.state);
- Swap(&memory_info_.protection);
- Swap(&memory_info_.type);
- }
-
- // Check for base + size overflow or undersize.
- if (memory_info_.region_size == 0 ||
- memory_info_.region_size > numeric_limits<uint64_t>::max() -
- memory_info_.base_address) {
- BPLOG(ERROR) << "MinidumpMemoryInfo has a memory region problem, " <<
- HexString(memory_info_.base_address) << "+" <<
- HexString(memory_info_.region_size);
- return false;
- }
-
- valid_ = true;
- return true;
-}
-
-
-void MinidumpMemoryInfo::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpMemoryInfo cannot print invalid data";
- return;
- }
-
- printf("MDRawMemoryInfo\n");
- printf(" base_address = 0x%" PRIx64 "\n",
- memory_info_.base_address);
- printf(" allocation_base = 0x%" PRIx64 "\n",
- memory_info_.allocation_base);
- printf(" allocation_protection = 0x%x\n",
- memory_info_.allocation_protection);
- printf(" region_size = 0x%" PRIx64 "\n", memory_info_.region_size);
- printf(" state = 0x%x\n", memory_info_.state);
- printf(" protection = 0x%x\n", memory_info_.protection);
- printf(" type = 0x%x\n", memory_info_.type);
-}
-
-
-//
-// MinidumpMemoryInfoList
-//
-
-
-MinidumpMemoryInfoList::MinidumpMemoryInfoList(Minidump* minidump)
- : MinidumpStream(minidump),
- range_map_(new RangeMap<uint64_t, unsigned int>()),
- infos_(NULL),
- info_count_(0) {
-}
-
-
-MinidumpMemoryInfoList::~MinidumpMemoryInfoList() {
- delete range_map_;
- delete infos_;
-}
-
-
-bool MinidumpMemoryInfoList::Read(uint32_t expected_size) {
- // Invalidate cached data.
- delete infos_;
- infos_ = NULL;
- range_map_->Clear();
- info_count_ = 0;
-
- valid_ = false;
-
- MDRawMemoryInfoList header;
- if (expected_size < sizeof(MDRawMemoryInfoList)) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList header size mismatch, " <<
- expected_size << " < " << sizeof(MDRawMemoryInfoList);
- return false;
- }
- if (!minidump_->ReadBytes(&header, sizeof(header))) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList could not read header";
- return false;
- }
-
- if (minidump_->swap()) {
- Swap(&header.size_of_header);
- Swap(&header.size_of_entry);
- Swap(&header.number_of_entries);
- }
-
- // Sanity check that the header is the expected size.
- // TODO(ted): could possibly handle this more gracefully, assuming
- // that future versions of the structs would be backwards-compatible.
- if (header.size_of_header != sizeof(MDRawMemoryInfoList)) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList header size mismatch, " <<
- header.size_of_header << " != " <<
- sizeof(MDRawMemoryInfoList);
- return false;
- }
-
- // Sanity check that the entries are the expected size.
- if (header.size_of_entry != sizeof(MDRawMemoryInfo)) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList entry size mismatch, " <<
- header.size_of_entry << " != " <<
- sizeof(MDRawMemoryInfo);
- return false;
- }
-
- if (header.number_of_entries >
- numeric_limits<uint32_t>::max() / sizeof(MDRawMemoryInfo)) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList info count " <<
- header.number_of_entries <<
- " would cause multiplication overflow";
- return false;
- }
-
- if (expected_size != sizeof(MDRawMemoryInfoList) +
- header.number_of_entries * sizeof(MDRawMemoryInfo)) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList size mismatch, " << expected_size <<
- " != " << sizeof(MDRawMemoryInfoList) +
- header.number_of_entries * sizeof(MDRawMemoryInfo);
- return false;
- }
-
- // Check for data loss when converting header.number_of_entries from
- // uint64_t into MinidumpMemoryInfos::size_type (uint32_t)
- MinidumpMemoryInfos::size_type header_number_of_entries =
- static_cast<unsigned int>(header.number_of_entries);
- if (static_cast<uint64_t>(header_number_of_entries) !=
- header.number_of_entries) {
- BPLOG(ERROR) << "Data loss detected when converting "
- "the header's number_of_entries";
- return false;
- }
-
- if (header.number_of_entries != 0) {
- scoped_ptr<MinidumpMemoryInfos> infos(
- new MinidumpMemoryInfos(header_number_of_entries,
- MinidumpMemoryInfo(minidump_)));
-
- for (unsigned int index = 0;
- index < header.number_of_entries;
- ++index) {
- MinidumpMemoryInfo* info = &(*infos)[index];
-
- // Assume that the file offset is correct after the last read.
- if (!info->Read()) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList cannot read info " <<
- index << "/" << header.number_of_entries;
- return false;
- }
-
- uint64_t base_address = info->GetBase();
- uint64_t region_size = info->GetSize();
-
- if (!range_map_->StoreRange(base_address, region_size, index)) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList could not store"
- " memory region " <<
- index << "/" << header.number_of_entries << ", " <<
- HexString(base_address) << "+" <<
- HexString(region_size);
- return false;
- }
- }
-
- infos_ = infos.release();
- }
-
- info_count_ = header_number_of_entries;
-
- valid_ = true;
- return true;
-}
-
-
-const MinidumpMemoryInfo* MinidumpMemoryInfoList::GetMemoryInfoAtIndex(
- unsigned int index) const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryInfoList for GetMemoryInfoAtIndex";
- return NULL;
- }
-
- if (index >= info_count_) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList index out of range: " <<
- index << "/" << info_count_;
- return NULL;
- }
-
- return &(*infos_)[index];
-}
-
-
-const MinidumpMemoryInfo* MinidumpMemoryInfoList::GetMemoryInfoForAddress(
- uint64_t address) const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid MinidumpMemoryInfoList for"
- " GetMemoryInfoForAddress";
- return NULL;
- }
-
- unsigned int info_index;
- if (!range_map_->RetrieveRange(address, &info_index, NULL /* base */,
- NULL /* delta */, NULL /* size */)) {
- BPLOG(INFO) << "MinidumpMemoryInfoList has no memory info at " <<
- HexString(address);
- return NULL;
- }
-
- return GetMemoryInfoAtIndex(info_index);
-}
-
-
-void MinidumpMemoryInfoList::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpMemoryInfoList cannot print invalid data";
- return;
- }
-
- printf("MinidumpMemoryInfoList\n");
- printf(" info_count = %d\n", info_count_);
- printf("\n");
-
- for (unsigned int info_index = 0;
- info_index < info_count_;
- ++info_index) {
- printf("info[%d]\n", info_index);
- (*infos_)[info_index].Print();
- printf("\n");
- }
-}
-
-//
-// MinidumpLinuxMaps
-//
-
-MinidumpLinuxMaps::MinidumpLinuxMaps(Minidump *minidump)
- : MinidumpObject(minidump) {
-}
-
-void MinidumpLinuxMaps::Print() const {
- if (!valid_) {
- BPLOG(ERROR) << "MinidumpLinuxMaps cannot print invalid data";
- return;
- }
- std::cout << region_.line << std::endl;
-}
-
-//
-// MinidumpLinuxMapsList
-//
-
-MinidumpLinuxMapsList::MinidumpLinuxMapsList(Minidump *minidump)
- : MinidumpStream(minidump),
- maps_(NULL),
- maps_count_(0) {
-}
-
-MinidumpLinuxMapsList::~MinidumpLinuxMapsList() {
- if (maps_) {
- for (unsigned int i = 0; i < maps_->size(); i++) {
- delete (*maps_)[i];
- }
- delete maps_;
- }
-}
-
-const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsForAddress(
- uint64_t address) const {
- if (!valid_ || (maps_ == NULL)) {
- BPLOG(ERROR) << "Invalid MinidumpLinuxMapsList for GetLinuxMapsForAddress";
- return NULL;
- }
-
- // Search every memory mapping.
- for (unsigned int index = 0; index < maps_count_; index++) {
- // Check if address is within bounds of the current memory region.
- if ((*maps_)[index]->GetBase() <= address &&
- (*maps_)[index]->GetBase() + (*maps_)[index]->GetSize() > address) {
- return (*maps_)[index];
- }
- }
-
- // No mapping encloses the memory address.
- BPLOG(ERROR) << "MinidumpLinuxMapsList has no mapping at "
- << HexString(address);
- return NULL;
-}
-
-const MinidumpLinuxMaps *MinidumpLinuxMapsList::GetLinuxMapsAtIndex(
- unsigned int index) const {
- if (!valid_ || (maps_ == NULL)) {
- BPLOG(ERROR) << "Invalid MinidumpLinuxMapsList for GetLinuxMapsAtIndex";
- return NULL;
- }
-
- // Index out of bounds.
- if (index >= maps_count_ || (maps_ == NULL)) {
- BPLOG(ERROR) << "MinidumpLinuxMapsList index of out range: "
- << index
- << "/"
- << maps_count_;
- return NULL;
- }
- return (*maps_)[index];
-}
-
-bool MinidumpLinuxMapsList::Read(uint32_t expected_size) {
- // Invalidate cached data.
- if (maps_) {
- for (unsigned int i = 0; i < maps_->size(); i++) {
- delete (*maps_)[i];
- }
- delete maps_;
- }
- maps_ = NULL;
- maps_count_ = 0;
-
- valid_ = false;
-
- // Load and check expected stream length.
- uint32_t length = 0;
- if (!minidump_->SeekToStreamType(MD_LINUX_MAPS, &length)) {
- BPLOG(ERROR) << "MinidumpLinuxMapsList stream type not found";
- return false;
- }
- if (expected_size != length) {
- BPLOG(ERROR) << "MinidumpLinuxMapsList size mismatch: "
- << expected_size
- << " != "
- << length;
- return false;
- }
-
- // Create a vector to read stream data. The vector needs to have
- // at least enough capacity to read all the data.
- vector<char> mapping_bytes(length);
- if (!minidump_->ReadBytes(&mapping_bytes[0], length)) {
- BPLOG(ERROR) << "MinidumpLinuxMapsList failed to read bytes";
- return false;
- }
- string map_string(mapping_bytes.begin(), mapping_bytes.end());
- vector<MappedMemoryRegion> all_regions;
-
- // Parse string into mapping data.
- if (!ParseProcMaps(map_string, &all_regions)) {
- return false;
- }
-
- scoped_ptr<MinidumpLinuxMappings> maps(new MinidumpLinuxMappings());
-
- // Push mapping data into wrapper classes.
- for (size_t i = 0; i < all_regions.size(); i++) {
- scoped_ptr<MinidumpLinuxMaps> ele(new MinidumpLinuxMaps(minidump_));
- ele->region_ = all_regions[i];
- ele->valid_ = true;
- maps->push_back(ele.release());
- }
-
- // Set instance variables.
- maps_ = maps.release();
- maps_count_ = maps_->size();
- valid_ = true;
- return true;
-}
-
-void MinidumpLinuxMapsList::Print() const {
- if (!valid_ || (maps_ == NULL)) {
- BPLOG(ERROR) << "MinidumpLinuxMapsList cannot print valid data";
- return;
- }
- for (size_t i = 0; i < maps_->size(); i++) {
- (*maps_)[i]->Print();
- }
-}
-
-//
-// Minidump
-//
-
-
-uint32_t Minidump::max_streams_ = 128;
-unsigned int Minidump::max_string_length_ = 1024;
-
-
-Minidump::Minidump(const string& path)
- : header_(),
- directory_(NULL),
- stream_map_(new MinidumpStreamMap()),
- path_(path),
- stream_(NULL),
- swap_(false),
- valid_(false) {
-}
-
-Minidump::Minidump(istream& stream)
- : header_(),
- directory_(NULL),
- stream_map_(new MinidumpStreamMap()),
- path_(),
- stream_(&stream),
- swap_(false),
- valid_(false) {
-}
-
-Minidump::~Minidump() {
- if (stream_) {
- BPLOG(INFO) << "Minidump closing minidump";
- }
- if (!path_.empty()) {
- delete stream_;
- }
- delete directory_;
- delete stream_map_;
-}
-
-
-bool Minidump::Open() {
- if (stream_ != NULL) {
- BPLOG(INFO) << "Minidump reopening minidump " << path_;
-
- // The file is already open. Seek to the beginning, which is the position
- // the file would be at if it were opened anew.
- return SeekSet(0);
- }
-
- stream_ = new ifstream(path_.c_str(), std::ios::in | std::ios::binary);
- if (!stream_ || !stream_->good()) {
- string error_string;
- int error_code = ErrnoString(&error_string);
- BPLOG(ERROR) << "Minidump could not open minidump " << path_ <<
- ", error " << error_code << ": " << error_string;
- return false;
- }
-
- BPLOG(INFO) << "Minidump opened minidump " << path_;
- return true;
-}
-
-bool Minidump::GetContextCPUFlagsFromSystemInfo(uint32_t *context_cpu_flags) {
- // Initialize output parameters
- *context_cpu_flags = 0;
-
- // Save the current stream position
- off_t saved_position = Tell();
- if (saved_position == -1) {
- // Failed to save the current stream position.
- // Returns true because the current position of the stream is preserved.
- return true;
- }
-
- const MDRawSystemInfo* system_info =
- GetSystemInfo() ? GetSystemInfo()->system_info() : NULL;
-
- if (system_info != NULL) {
- switch (system_info->processor_architecture) {
- case MD_CPU_ARCHITECTURE_X86:
- *context_cpu_flags = MD_CONTEXT_X86;
- break;
- case MD_CPU_ARCHITECTURE_MIPS:
- *context_cpu_flags = MD_CONTEXT_MIPS;
- break;
- case MD_CPU_ARCHITECTURE_MIPS64:
- *context_cpu_flags = MD_CONTEXT_MIPS64;
- break;
- case MD_CPU_ARCHITECTURE_ALPHA:
- *context_cpu_flags = MD_CONTEXT_ALPHA;
- break;
- case MD_CPU_ARCHITECTURE_PPC:
- *context_cpu_flags = MD_CONTEXT_PPC;
- break;
- case MD_CPU_ARCHITECTURE_PPC64:
- *context_cpu_flags = MD_CONTEXT_PPC64;
- break;
- case MD_CPU_ARCHITECTURE_SHX:
- *context_cpu_flags = MD_CONTEXT_SHX;
- break;
- case MD_CPU_ARCHITECTURE_ARM:
- *context_cpu_flags = MD_CONTEXT_ARM;
- break;
- case MD_CPU_ARCHITECTURE_ARM64:
- *context_cpu_flags = MD_CONTEXT_ARM64;
- break;
- case MD_CPU_ARCHITECTURE_IA64:
- *context_cpu_flags = MD_CONTEXT_IA64;
- break;
- case MD_CPU_ARCHITECTURE_ALPHA64:
- *context_cpu_flags = 0;
- break;
- case MD_CPU_ARCHITECTURE_MSIL:
- *context_cpu_flags = 0;
- break;
- case MD_CPU_ARCHITECTURE_AMD64:
- *context_cpu_flags = MD_CONTEXT_AMD64;
- break;
- case MD_CPU_ARCHITECTURE_X86_WIN64:
- *context_cpu_flags = 0;
- break;
- case MD_CPU_ARCHITECTURE_SPARC:
- *context_cpu_flags = MD_CONTEXT_SPARC;
- break;
- case MD_CPU_ARCHITECTURE_UNKNOWN:
- *context_cpu_flags = 0;
- break;
- default:
- *context_cpu_flags = 0;
- break;
- }
- }
-
- // Restore position and return
- return SeekSet(saved_position);
-}
-
-
-bool Minidump::Read() {
- // Invalidate cached data.
- delete directory_;
- directory_ = NULL;
- stream_map_->clear();
-
- valid_ = false;
-
- if (!Open()) {
- BPLOG(ERROR) << "Minidump cannot open minidump";
- return false;
- }
-
- if (!ReadBytes(&header_, sizeof(MDRawHeader))) {
- BPLOG(ERROR) << "Minidump cannot read header";
- return false;
- }
-
- if (header_.signature != MD_HEADER_SIGNATURE) {
- // The file may be byte-swapped. Under the present architecture, these
- // classes don't know or need to know what CPU (or endianness) the
- // minidump was produced on in order to parse it. Use the signature as
- // a byte order marker.
- uint32_t signature_swapped = header_.signature;
- Swap(&signature_swapped);
- if (signature_swapped != MD_HEADER_SIGNATURE) {
- // This isn't a minidump or a byte-swapped minidump.
- BPLOG(ERROR) << "Minidump header signature mismatch: (" <<
- HexString(header_.signature) << ", " <<
- HexString(signature_swapped) << ") != " <<
- HexString(MD_HEADER_SIGNATURE);
- return false;
- }
- swap_ = true;
- } else {
- // The file is not byte-swapped. Set swap_ false (it may have been true
- // if the object is being reused?)
- swap_ = false;
- }
-
- BPLOG(INFO) << "Minidump " << (swap_ ? "" : "not ") <<
- "byte-swapping minidump";
-
- if (swap_) {
- Swap(&header_.signature);
- Swap(&header_.version);
- Swap(&header_.stream_count);
- Swap(&header_.stream_directory_rva);
- Swap(&header_.checksum);
- Swap(&header_.time_date_stamp);
- Swap(&header_.flags);
- }
-
- // Version check. The high 16 bits of header_.version contain something
- // else "implementation specific."
- if ((header_.version & 0x0000ffff) != MD_HEADER_VERSION) {
- BPLOG(ERROR) << "Minidump version mismatch: " <<
- HexString(header_.version & 0x0000ffff) << " != " <<
- HexString(MD_HEADER_VERSION);
- return false;
- }
-
- if (!SeekSet(header_.stream_directory_rva)) {
- BPLOG(ERROR) << "Minidump cannot seek to stream directory";
- return false;
- }
-
- if (header_.stream_count > max_streams_) {
- BPLOG(ERROR) << "Minidump stream count " << header_.stream_count <<
- " exceeds maximum " << max_streams_;
- return false;
- }
-
- if (header_.stream_count != 0) {
- scoped_ptr<MinidumpDirectoryEntries> directory(
- new MinidumpDirectoryEntries(header_.stream_count));
-
- // Read the entire array in one fell swoop, instead of reading one entry
- // at a time in the loop.
- if (!ReadBytes(&(*directory)[0],
- sizeof(MDRawDirectory) * header_.stream_count)) {
- BPLOG(ERROR) << "Minidump cannot read stream directory";
- return false;
- }
-
- for (unsigned int stream_index = 0;
- stream_index < header_.stream_count;
- ++stream_index) {
- MDRawDirectory* directory_entry = &(*directory)[stream_index];
-
- if (swap_) {
- Swap(&directory_entry->stream_type);
- Swap(&directory_entry->location);
- }
-
- // Initialize the stream_map_ map, which speeds locating a stream by
- // type.
- unsigned int stream_type = directory_entry->stream_type;
- switch (stream_type) {
- case MD_THREAD_LIST_STREAM:
- case MD_MODULE_LIST_STREAM:
- case MD_MEMORY_LIST_STREAM:
- case MD_EXCEPTION_STREAM:
- case MD_SYSTEM_INFO_STREAM:
- case MD_MISC_INFO_STREAM:
- case MD_BREAKPAD_INFO_STREAM: {
- if (stream_map_->find(stream_type) != stream_map_->end()) {
- // Another stream with this type was already found. A minidump
- // file should contain at most one of each of these stream types.
- BPLOG(ERROR) << "Minidump found multiple streams of type " <<
- stream_type << ", but can only deal with one";
- return false;
- }
- // Fall through to default
- }
-
- default: {
- // Overwrites for stream types other than those above, but it's
- // expected to be the user's burden in that case.
- (*stream_map_)[stream_type].stream_index = stream_index;
- }
- }
- }
-
- directory_ = directory.release();
- }
-
- valid_ = true;
- return true;
-}
-
-
-MinidumpThreadList* Minidump::GetThreadList() {
- MinidumpThreadList* thread_list;
- return GetStream(&thread_list);
-}
-
-
-MinidumpModuleList* Minidump::GetModuleList() {
- MinidumpModuleList* module_list;
- return GetStream(&module_list);
-}
-
-
-MinidumpMemoryList* Minidump::GetMemoryList() {
- MinidumpMemoryList* memory_list;
- return GetStream(&memory_list);
-}
-
-
-MinidumpException* Minidump::GetException() {
- MinidumpException* exception;
- return GetStream(&exception);
-}
-
-MinidumpAssertion* Minidump::GetAssertion() {
- MinidumpAssertion* assertion;
- return GetStream(&assertion);
-}
-
-
-MinidumpSystemInfo* Minidump::GetSystemInfo() {
- MinidumpSystemInfo* system_info;
- return GetStream(&system_info);
-}
-
-
-MinidumpMiscInfo* Minidump::GetMiscInfo() {
- MinidumpMiscInfo* misc_info;
- return GetStream(&misc_info);
-}
-
-
-MinidumpBreakpadInfo* Minidump::GetBreakpadInfo() {
- MinidumpBreakpadInfo* breakpad_info;
- return GetStream(&breakpad_info);
-}
-
-MinidumpMemoryInfoList* Minidump::GetMemoryInfoList() {
- MinidumpMemoryInfoList* memory_info_list;
- return GetStream(&memory_info_list);
-}
-
-MinidumpLinuxMapsList *Minidump::GetLinuxMapsList() {
- MinidumpLinuxMapsList *linux_maps_list;
- return GetStream(&linux_maps_list);
-}
-
-bool Minidump::IsAndroid() {
- // Save the current stream position
- off_t saved_position = Tell();
- if (saved_position == -1) {
- return false;
- }
- const MDRawSystemInfo* system_info =
- GetSystemInfo() ? GetSystemInfo()->system_info() : NULL;
-
- // Restore position and return
- if (!SeekSet(saved_position)) {
- BPLOG(ERROR) << "Couldn't seek back to saved position";
- return false;
- }
-
- return system_info && system_info->platform_id == MD_OS_ANDROID;
-}
-
-static const char* get_stream_name(uint32_t stream_type) {
- switch (stream_type) {
- case MD_UNUSED_STREAM:
- return "MD_UNUSED_STREAM";
- case MD_RESERVED_STREAM_0:
- return "MD_RESERVED_STREAM_0";
- case MD_RESERVED_STREAM_1:
- return "MD_RESERVED_STREAM_1";
- case MD_THREAD_LIST_STREAM:
- return "MD_THREAD_LIST_STREAM";
- case MD_MODULE_LIST_STREAM:
- return "MD_MODULE_LIST_STREAM";
- case MD_MEMORY_LIST_STREAM:
- return "MD_MEMORY_LIST_STREAM";
- case MD_EXCEPTION_STREAM:
- return "MD_EXCEPTION_STREAM";
- case MD_SYSTEM_INFO_STREAM:
- return "MD_SYSTEM_INFO_STREAM";
- case MD_THREAD_EX_LIST_STREAM:
- return "MD_THREAD_EX_LIST_STREAM";
- case MD_MEMORY_64_LIST_STREAM:
- return "MD_MEMORY_64_LIST_STREAM";
- case MD_COMMENT_STREAM_A:
- return "MD_COMMENT_STREAM_A";
- case MD_COMMENT_STREAM_W:
- return "MD_COMMENT_STREAM_W";
- case MD_HANDLE_DATA_STREAM:
- return "MD_HANDLE_DATA_STREAM";
- case MD_FUNCTION_TABLE_STREAM:
- return "MD_FUNCTION_TABLE_STREAM";
- case MD_UNLOADED_MODULE_LIST_STREAM:
- return "MD_UNLOADED_MODULE_LIST_STREAM";
- case MD_MISC_INFO_STREAM:
- return "MD_MISC_INFO_STREAM";
- case MD_MEMORY_INFO_LIST_STREAM:
- return "MD_MEMORY_INFO_LIST_STREAM";
- case MD_THREAD_INFO_LIST_STREAM:
- return "MD_THREAD_INFO_LIST_STREAM";
- case MD_HANDLE_OPERATION_LIST_STREAM:
- return "MD_HANDLE_OPERATION_LIST_STREAM";
- case MD_TOKEN_STREAM:
- return "MD_TOKEN_STREAM";
- case MD_JAVASCRIPT_DATA_STREAM:
- return "MD_JAVASCRIPT_DATA_STREAM";
- case MD_SYSTEM_MEMORY_INFO_STREAM:
- return "MD_SYSTEM_MEMORY_INFO_STREAM";
- case MD_PROCESS_VM_COUNTERS_STREAM:
- return "MD_PROCESS_VM_COUNTERS_STREAM";
- case MD_LAST_RESERVED_STREAM:
- return "MD_LAST_RESERVED_STREAM";
- case MD_BREAKPAD_INFO_STREAM:
- return "MD_BREAKPAD_INFO_STREAM";
- case MD_ASSERTION_INFO_STREAM:
- return "MD_ASSERTION_INFO_STREAM";
- case MD_LINUX_CPU_INFO:
- return "MD_LINUX_CPU_INFO";
- case MD_LINUX_PROC_STATUS:
- return "MD_LINUX_PROC_STATUS";
- case MD_LINUX_LSB_RELEASE:
- return "MD_LINUX_LSB_RELEASE";
- case MD_LINUX_CMD_LINE:
- return "MD_LINUX_CMD_LINE";
- case MD_LINUX_ENVIRON:
- return "MD_LINUX_ENVIRON";
- case MD_LINUX_AUXV:
- return "MD_LINUX_AUXV";
- case MD_LINUX_MAPS:
- return "MD_LINUX_MAPS";
- case MD_LINUX_DSO_DEBUG:
- return "MD_LINUX_DSO_DEBUG";
- default:
- return "unknown";
- }
-}
-
-void Minidump::Print() {
- if (!valid_) {
- BPLOG(ERROR) << "Minidump cannot print invalid data";
- return;
- }
-
- printf("MDRawHeader\n");
- printf(" signature = 0x%x\n", header_.signature);
- printf(" version = 0x%x\n", header_.version);
- printf(" stream_count = %d\n", header_.stream_count);
- printf(" stream_directory_rva = 0x%x\n", header_.stream_directory_rva);
- printf(" checksum = 0x%x\n", header_.checksum);
- printf(" time_date_stamp = 0x%x %s\n",
- header_.time_date_stamp,
- TimeTToUTCString(header_.time_date_stamp).c_str());
- printf(" flags = 0x%" PRIx64 "\n", header_.flags);
- printf("\n");
-
- for (unsigned int stream_index = 0;
- stream_index < header_.stream_count;
- ++stream_index) {
- MDRawDirectory* directory_entry = &(*directory_)[stream_index];
-
- printf("mDirectory[%d]\n", stream_index);
- printf("MDRawDirectory\n");
- printf(" stream_type = 0x%x (%s)\n", directory_entry->stream_type,
- get_stream_name(directory_entry->stream_type));
- printf(" location.data_size = %d\n",
- directory_entry->location.data_size);
- printf(" location.rva = 0x%x\n", directory_entry->location.rva);
- printf("\n");
- }
-
- printf("Streams:\n");
- for (MinidumpStreamMap::const_iterator iterator = stream_map_->begin();
- iterator != stream_map_->end();
- ++iterator) {
- uint32_t stream_type = iterator->first;
- const MinidumpStreamInfo& info = iterator->second;
- printf(" stream type 0x%x (%s) at index %d\n", stream_type,
- get_stream_name(stream_type),
- info.stream_index);
- }
- printf("\n");
-}
-
-
-const MDRawDirectory* Minidump::GetDirectoryEntryAtIndex(unsigned int index)
- const {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid Minidump for GetDirectoryEntryAtIndex";
- return NULL;
- }
-
- if (index >= header_.stream_count) {
- BPLOG(ERROR) << "Minidump stream directory index out of range: " <<
- index << "/" << header_.stream_count;
- return NULL;
- }
-
- return &(*directory_)[index];
-}
-
-
-bool Minidump::ReadBytes(void* bytes, size_t count) {
- // Can't check valid_ because Read needs to call this method before
- // validity can be determined.
- if (!stream_) {
- return false;
- }
- stream_->read(static_cast<char*>(bytes), count);
- std::streamsize bytes_read = stream_->gcount();
- if (bytes_read == -1) {
- string error_string;
- int error_code = ErrnoString(&error_string);
- BPLOG(ERROR) << "ReadBytes: error " << error_code << ": " << error_string;
- return false;
- }
-
- // Convert to size_t and check for data loss
- size_t bytes_read_converted = static_cast<size_t>(bytes_read);
- if (static_cast<std::streamsize>(bytes_read_converted) != bytes_read) {
- BPLOG(ERROR) << "ReadBytes: conversion data loss detected when converting "
- << bytes_read << " to " << bytes_read_converted;
- return false;
- }
-
- if (bytes_read_converted != count) {
- BPLOG(ERROR) << "ReadBytes: read " << bytes_read_converted << "/" << count;
- return false;
- }
-
- return true;
-}
-
-
-bool Minidump::SeekSet(off_t offset) {
- // Can't check valid_ because Read needs to call this method before
- // validity can be determined.
- if (!stream_) {
- return false;
- }
- stream_->seekg(offset, std::ios_base::beg);
- if (!stream_->good()) {
- string error_string;
- int error_code = ErrnoString(&error_string);
- BPLOG(ERROR) << "SeekSet: error " << error_code << ": " << error_string;
- return false;
- }
- return true;
-}
-
-off_t Minidump::Tell() {
- if (!valid_ || !stream_) {
- return (off_t)-1;
- }
-
- // Check for conversion data loss
- std::streamoff std_streamoff = stream_->tellg();
- off_t rv = static_cast<off_t>(std_streamoff);
- if (static_cast<std::streamoff>(rv) == std_streamoff) {
- return rv;
- } else {
- BPLOG(ERROR) << "Data loss detected";
- return (off_t)-1;
- }
-}
-
-
-string* Minidump::ReadString(off_t offset) {
- if (!valid_) {
- BPLOG(ERROR) << "Invalid Minidump for ReadString";
- return NULL;
- }
- if (!SeekSet(offset)) {
- BPLOG(ERROR) << "ReadString could not seek to string at offset " << offset;
- return NULL;
- }
-
- uint32_t bytes;
- if (!ReadBytes(&bytes, sizeof(bytes))) {
- BPLOG(ERROR) << "ReadString could not read string size at offset " <<
- offset;
- return NULL;
- }
- if (swap_)
- Swap(&bytes);
-
- if (bytes % 2 != 0) {
- BPLOG(ERROR) << "ReadString found odd-sized " << bytes <<
- "-byte string at offset " << offset;
- return NULL;
- }
- unsigned int utf16_words = bytes / 2;
-
- if (utf16_words > max_string_length_) {
- BPLOG(ERROR) << "ReadString string length " << utf16_words <<
- " exceeds maximum " << max_string_length_ <<
- " at offset " << offset;
- return NULL;
- }
-
- vector<uint16_t> string_utf16(utf16_words);
-
- if (utf16_words) {
- if (!ReadBytes(&string_utf16[0], bytes)) {
- BPLOG(ERROR) << "ReadString could not read " << bytes <<
- "-byte string at offset " << offset;
- return NULL;
- }
- }
-
- return UTF16ToUTF8(string_utf16, swap_);
-}
-
-
-bool Minidump::SeekToStreamType(uint32_t stream_type,
- uint32_t* stream_length) {
- BPLOG_IF(ERROR, !stream_length) << "Minidump::SeekToStreamType requires "
- "|stream_length|";
- assert(stream_length);
- *stream_length = 0;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid Mindump for SeekToStreamType";
- return false;
- }
-
- MinidumpStreamMap::const_iterator iterator = stream_map_->find(stream_type);
- if (iterator == stream_map_->end()) {
- // This stream type didn't exist in the directory.
- BPLOG(INFO) << "SeekToStreamType: type " << stream_type << " not present";
- return false;
- }
-
- const MinidumpStreamInfo& info = iterator->second;
- if (info.stream_index >= header_.stream_count) {
- BPLOG(ERROR) << "SeekToStreamType: type " << stream_type <<
- " out of range: " <<
- info.stream_index << "/" << header_.stream_count;
- return false;
- }
-
- MDRawDirectory* directory_entry = &(*directory_)[info.stream_index];
- if (!SeekSet(directory_entry->location.rva)) {
- BPLOG(ERROR) << "SeekToStreamType could not seek to stream type " <<
- stream_type;
- return false;
- }
-
- *stream_length = directory_entry->location.data_size;
-
- return true;
-}
-
-
-template<typename T>
-T* Minidump::GetStream(T** stream) {
- // stream is a garbage parameter that's present only to account for C++'s
- // inability to overload a method based solely on its return type.
-
- const uint32_t stream_type = T::kStreamType;
-
- BPLOG_IF(ERROR, !stream) << "Minidump::GetStream type " << stream_type <<
- " requires |stream|";
- assert(stream);
- *stream = NULL;
-
- if (!valid_) {
- BPLOG(ERROR) << "Invalid Minidump for GetStream type " << stream_type;
- return NULL;
- }
-
- MinidumpStreamMap::iterator iterator = stream_map_->find(stream_type);
- if (iterator == stream_map_->end()) {
- // This stream type didn't exist in the directory.
- BPLOG(INFO) << "GetStream: type " << stream_type << " not present";
- return NULL;
- }
-
- // Get a pointer so that the stored stream field can be altered.
- MinidumpStreamInfo* info = &iterator->second;
-
- if (info->stream) {
- // This cast is safe because info.stream is only populated by this
- // method, and there is a direct correlation between T and stream_type.
- *stream = static_cast<T*>(info->stream);
- return *stream;
- }
-
- uint32_t stream_length;
- if (!SeekToStreamType(stream_type, &stream_length)) {
- BPLOG(ERROR) << "GetStream could not seek to stream type " << stream_type;
- return NULL;
- }
-
- scoped_ptr<T> new_stream(new T(this));
-
- if (!new_stream->Read(stream_length)) {
- BPLOG(ERROR) << "GetStream could not read stream type " << stream_type;
- return NULL;
- }
-
- *stream = new_stream.release();
- info->stream = *stream;
- return *stream;
-}
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_dump.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump_dump.cc
deleted file mode 100644
index 343f044288..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_dump.cc
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_dump.cc: Print the contents of a minidump file in somewhat
-// readable text.
-//
-// Author: Mark Mentovai
-
-#include <stdio.h>
-#include <string.h>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/minidump.h"
-#include "processor/logging.h"
-
-namespace {
-
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpThreadList;
-using google_breakpad::MinidumpModuleList;
-using google_breakpad::MinidumpMemoryInfoList;
-using google_breakpad::MinidumpMemoryList;
-using google_breakpad::MinidumpException;
-using google_breakpad::MinidumpAssertion;
-using google_breakpad::MinidumpSystemInfo;
-using google_breakpad::MinidumpMiscInfo;
-using google_breakpad::MinidumpBreakpadInfo;
-
-static void DumpRawStream(Minidump *minidump,
- uint32_t stream_type,
- const char *stream_name,
- int *errors) {
- uint32_t length = 0;
- if (!minidump->SeekToStreamType(stream_type, &length)) {
- return;
- }
-
- printf("Stream %s:\n", stream_name);
-
- if (length == 0) {
- printf("\n");
- return;
- }
- std::vector<char> contents(length);
- if (!minidump->ReadBytes(&contents[0], length)) {
- ++*errors;
- BPLOG(ERROR) << "minidump.ReadBytes failed";
- return;
- }
- size_t current_offset = 0;
- while (current_offset < length) {
- size_t remaining = length - current_offset;
- // Printf requires an int and direct casting from size_t results
- // in compatibility warnings.
- uint32_t int_remaining = remaining;
- printf("%.*s", int_remaining, &contents[current_offset]);
- char *next_null = reinterpret_cast<char *>(
- memchr(&contents[current_offset], 0, remaining));
- if (next_null == NULL)
- break;
- printf("\\0\n");
- size_t null_offset = next_null - &contents[0];
- current_offset = null_offset + 1;
- }
- printf("\n\n");
-}
-
-static bool PrintMinidumpDump(const char *minidump_file) {
- Minidump minidump(minidump_file);
- if (!minidump.Read()) {
- BPLOG(ERROR) << "minidump.Read() failed";
- return false;
- }
- minidump.Print();
-
- int errors = 0;
-
- MinidumpThreadList *thread_list = minidump.GetThreadList();
- if (!thread_list) {
- ++errors;
- BPLOG(ERROR) << "minidump.GetThreadList() failed";
- } else {
- thread_list->Print();
- }
-
- MinidumpModuleList *module_list = minidump.GetModuleList();
- if (!module_list) {
- ++errors;
- BPLOG(ERROR) << "minidump.GetModuleList() failed";
- } else {
- module_list->Print();
- }
-
- MinidumpMemoryList *memory_list = minidump.GetMemoryList();
- if (!memory_list) {
- ++errors;
- BPLOG(ERROR) << "minidump.GetMemoryList() failed";
- } else {
- memory_list->Print();
- }
-
- MinidumpException *exception = minidump.GetException();
- if (!exception) {
- BPLOG(INFO) << "minidump.GetException() failed";
- } else {
- exception->Print();
- }
-
- MinidumpAssertion *assertion = minidump.GetAssertion();
- if (!assertion) {
- BPLOG(INFO) << "minidump.GetAssertion() failed";
- } else {
- assertion->Print();
- }
-
- MinidumpSystemInfo *system_info = minidump.GetSystemInfo();
- if (!system_info) {
- ++errors;
- BPLOG(ERROR) << "minidump.GetSystemInfo() failed";
- } else {
- system_info->Print();
- }
-
- MinidumpMiscInfo *misc_info = minidump.GetMiscInfo();
- if (!misc_info) {
- ++errors;
- BPLOG(ERROR) << "minidump.GetMiscInfo() failed";
- } else {
- misc_info->Print();
- }
-
- MinidumpBreakpadInfo *breakpad_info = minidump.GetBreakpadInfo();
- if (!breakpad_info) {
- // Breakpad info is optional, so don't treat this as an error.
- BPLOG(INFO) << "minidump.GetBreakpadInfo() failed";
- } else {
- breakpad_info->Print();
- }
-
- MinidumpMemoryInfoList *memory_info_list = minidump.GetMemoryInfoList();
- if (!memory_info_list) {
- ++errors;
- BPLOG(ERROR) << "minidump.GetMemoryInfoList() failed";
- } else {
- memory_info_list->Print();
- }
-
- DumpRawStream(&minidump,
- MD_LINUX_CMD_LINE,
- "MD_LINUX_CMD_LINE",
- &errors);
- DumpRawStream(&minidump,
- MD_LINUX_ENVIRON,
- "MD_LINUX_ENVIRON",
- &errors);
- DumpRawStream(&minidump,
- MD_LINUX_LSB_RELEASE,
- "MD_LINUX_LSB_RELEASE",
- &errors);
- DumpRawStream(&minidump,
- MD_LINUX_PROC_STATUS,
- "MD_LINUX_PROC_STATUS",
- &errors);
- DumpRawStream(&minidump,
- MD_LINUX_CPU_INFO,
- "MD_LINUX_CPU_INFO",
- &errors);
- DumpRawStream(&minidump,
- MD_LINUX_MAPS,
- "MD_LINUX_MAPS",
- &errors);
-
- return errors == 0;
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- if (argc != 2) {
- fprintf(stderr, "usage: %s <file>\n", argv[0]);
- return 1;
- }
-
- return PrintMinidumpDump(argv[1]) ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_dump_test b/toolkit/crashreporter/google-breakpad/src/processor/minidump_dump_test
deleted file mode 100755
index fb62ace735..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_dump_test
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-testdata_dir=$srcdir/src/processor/testdata
-./src/processor/minidump_dump $testdata_dir/minidump2.dmp | \
- tr -d '\015' | \
- diff -u $testdata_dir/minidump2.dump.out -
-exit $?
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc
deleted file mode 100644
index 33b4a1284b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_processor.cc
+++ /dev/null
@@ -1,1577 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "google_breakpad/processor/minidump_processor.h"
-
-#include <assert.h>
-
-#include <string>
-
-#include "common/scoped_ptr.h"
-#include "common/stdio_wrapper.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/exploitability.h"
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_x86.h"
-#include "processor/symbolic_constants_win.h"
-
-namespace google_breakpad {
-
-MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
- SourceLineResolverInterface *resolver)
- : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
- own_frame_symbolizer_(true),
- enable_exploitability_(false),
- enable_objdump_(false) {
-}
-
-MinidumpProcessor::MinidumpProcessor(SymbolSupplier *supplier,
- SourceLineResolverInterface *resolver,
- bool enable_exploitability)
- : frame_symbolizer_(new StackFrameSymbolizer(supplier, resolver)),
- own_frame_symbolizer_(true),
- enable_exploitability_(enable_exploitability),
- enable_objdump_(false) {
-}
-
-MinidumpProcessor::MinidumpProcessor(StackFrameSymbolizer *frame_symbolizer,
- bool enable_exploitability)
- : frame_symbolizer_(frame_symbolizer),
- own_frame_symbolizer_(false),
- enable_exploitability_(enable_exploitability),
- enable_objdump_(false) {
- assert(frame_symbolizer_);
-}
-
-MinidumpProcessor::~MinidumpProcessor() {
- if (own_frame_symbolizer_) delete frame_symbolizer_;
-}
-
-ProcessResult MinidumpProcessor::Process(
- Minidump *dump, ProcessState *process_state) {
- assert(dump);
- assert(process_state);
-
- process_state->Clear();
-
- const MDRawHeader *header = dump->header();
- if (!header) {
- BPLOG(ERROR) << "Minidump " << dump->path() << " has no header";
- return PROCESS_ERROR_NO_MINIDUMP_HEADER;
- }
- process_state->time_date_stamp_ = header->time_date_stamp;
-
- bool has_process_create_time =
- GetProcessCreateTime(dump, &process_state->process_create_time_);
-
- bool has_cpu_info = GetCPUInfo(dump, &process_state->system_info_);
- bool has_os_info = GetOSInfo(dump, &process_state->system_info_);
-
- uint32_t dump_thread_id = 0;
- bool has_dump_thread = false;
- uint32_t requesting_thread_id = 0;
- bool has_requesting_thread = false;
-
- MinidumpBreakpadInfo *breakpad_info = dump->GetBreakpadInfo();
- if (breakpad_info) {
- has_dump_thread = breakpad_info->GetDumpThreadID(&dump_thread_id);
- has_requesting_thread =
- breakpad_info->GetRequestingThreadID(&requesting_thread_id);
- }
-
- MinidumpException *exception = dump->GetException();
- if (exception) {
- process_state->crashed_ = true;
- has_requesting_thread = exception->GetThreadID(&requesting_thread_id);
-
- process_state->crash_reason_ = GetCrashReason(
- dump, &process_state->crash_address_);
- }
-
- // This will just return an empty string if it doesn't exist.
- process_state->assertion_ = GetAssertion(dump);
-
- MinidumpModuleList *module_list = dump->GetModuleList();
-
- // Put a copy of the module list into ProcessState object. This is not
- // necessarily a MinidumpModuleList, but it adheres to the CodeModules
- // interface, which is all that ProcessState needs to expose.
- if (module_list) {
- process_state->modules_ = module_list->Copy();
- process_state->shrunk_range_modules_ =
- process_state->modules_->GetShrunkRangeModules();
- for (unsigned int i = 0;
- i < process_state->shrunk_range_modules_.size();
- i++) {
- linked_ptr<const CodeModule> module =
- process_state->shrunk_range_modules_[i];
- BPLOG(INFO) << "The range for module " << module->code_file()
- << " was shrunk down by " << HexString(
- module->shrink_down_delta()) << " bytes. ";
- }
- }
-
- MinidumpMemoryList *memory_list = dump->GetMemoryList();
- if (memory_list) {
- BPLOG(INFO) << "Found " << memory_list->region_count()
- << " memory regions.";
- }
-
- MinidumpThreadList *threads = dump->GetThreadList();
- if (!threads) {
- BPLOG(ERROR) << "Minidump " << dump->path() << " has no thread list";
- return PROCESS_ERROR_NO_THREAD_LIST;
- }
-
- BPLOG(INFO) << "Minidump " << dump->path() << " has " <<
- (has_cpu_info ? "" : "no ") << "CPU info, " <<
- (has_os_info ? "" : "no ") << "OS info, " <<
- (breakpad_info != NULL ? "" : "no ") << "Breakpad info, " <<
- (exception != NULL ? "" : "no ") << "exception, " <<
- (module_list != NULL ? "" : "no ") << "module list, " <<
- (threads != NULL ? "" : "no ") << "thread list, " <<
- (has_dump_thread ? "" : "no ") << "dump thread, " <<
- (has_requesting_thread ? "" : "no ") << "requesting thread, and " <<
- (has_process_create_time ? "" : "no ") << "process create time";
-
- bool interrupted = false;
- bool found_requesting_thread = false;
- unsigned int thread_count = threads->thread_count();
-
- // Reset frame_symbolizer_ at the beginning of stackwalk for each minidump.
- frame_symbolizer_->Reset();
-
- for (unsigned int thread_index = 0;
- thread_index < thread_count;
- ++thread_index) {
- char thread_string_buffer[64];
- snprintf(thread_string_buffer, sizeof(thread_string_buffer), "%d/%d",
- thread_index, thread_count);
- string thread_string = dump->path() + ":" + thread_string_buffer;
-
- MinidumpThread *thread = threads->GetThreadAtIndex(thread_index);
- if (!thread) {
- BPLOG(ERROR) << "Could not get thread for " << thread_string;
- return PROCESS_ERROR_GETTING_THREAD;
- }
-
- uint32_t thread_id;
- if (!thread->GetThreadID(&thread_id)) {
- BPLOG(ERROR) << "Could not get thread ID for " << thread_string;
- return PROCESS_ERROR_GETTING_THREAD_ID;
- }
-
- thread_string += " id " + HexString(thread_id);
- BPLOG(INFO) << "Looking at thread " << thread_string;
-
- // If this thread is the thread that produced the minidump, don't process
- // it. Because of the problems associated with a thread producing a
- // dump of itself (when both its context and its stack are in flux),
- // processing that stack wouldn't provide much useful data.
- if (has_dump_thread && thread_id == dump_thread_id) {
- continue;
- }
-
- MinidumpContext *context = thread->GetContext();
-
- if (has_requesting_thread && thread_id == requesting_thread_id) {
- if (found_requesting_thread) {
- // There can't be more than one requesting thread.
- BPLOG(ERROR) << "Duplicate requesting thread: " << thread_string;
- return PROCESS_ERROR_DUPLICATE_REQUESTING_THREADS;
- }
-
- // Use processed_state->threads_.size() instead of thread_index.
- // thread_index points to the thread index in the minidump, which
- // might be greater than the thread index in the threads vector if
- // any of the minidump's threads are skipped and not placed into the
- // processed threads vector. The thread vector's current size will
- // be the index of the current thread when it's pushed into the
- // vector.
- process_state->requesting_thread_ = process_state->threads_.size();
-
- found_requesting_thread = true;
-
- if (process_state->crashed_) {
- // Use the exception record's context for the crashed thread, instead
- // of the thread's own context. For the crashed thread, the thread's
- // own context is the state inside the exception handler. Using it
- // would not result in the expected stack trace from the time of the
- // crash. If the exception context is invalid, however, we fall back
- // on the thread context.
- MinidumpContext *ctx = exception->GetContext();
- context = ctx ? ctx : thread->GetContext();
- }
- }
-
- // If the memory region for the stack cannot be read using the RVA stored
- // in the memory descriptor inside MINIDUMP_THREAD, try to locate and use
- // a memory region (containing the stack) from the minidump memory list.
- MinidumpMemoryRegion *thread_memory = thread->GetMemory();
- if (!thread_memory && memory_list) {
- uint64_t start_stack_memory_range = thread->GetStartOfStackMemoryRange();
- if (start_stack_memory_range) {
- thread_memory = memory_list->GetMemoryRegionForAddress(
- start_stack_memory_range);
- }
- }
- if (!thread_memory) {
- BPLOG(ERROR) << "No memory region for " << thread_string;
- }
-
- // Use process_state->modules_ instead of module_list, because the
- // |modules| argument will be used to populate the |module| fields in
- // the returned StackFrame objects, which will be placed into the
- // returned ProcessState object. module_list's lifetime is only as
- // long as the Minidump object: it will be deleted when this function
- // returns. process_state->modules_ is owned by the ProcessState object
- // (just like the StackFrame objects), and is much more suitable for this
- // task.
- scoped_ptr<Stackwalker> stackwalker(
- Stackwalker::StackwalkerForCPU(process_state->system_info(),
- context,
- thread_memory,
- process_state->modules_,
- frame_symbolizer_));
-
- scoped_ptr<CallStack> stack(new CallStack());
- if (stackwalker.get()) {
- if (!stackwalker->Walk(stack.get(),
- &process_state->modules_without_symbols_,
- &process_state->modules_with_corrupt_symbols_)) {
- BPLOG(INFO) << "Stackwalker interrupt (missing symbols?) at "
- << thread_string;
- interrupted = true;
- }
- } else {
- // Threads with missing CPU contexts will hit this, but
- // don't abort processing the rest of the dump just for
- // one bad thread.
- BPLOG(ERROR) << "No stackwalker for " << thread_string;
- }
- stack->set_tid(thread_id);
- process_state->threads_.push_back(stack.release());
- process_state->thread_memory_regions_.push_back(thread_memory);
- }
-
- if (interrupted) {
- BPLOG(INFO) << "Processing interrupted for " << dump->path();
- return PROCESS_SYMBOL_SUPPLIER_INTERRUPTED;
- }
-
- // If a requesting thread was indicated, it must be present.
- if (has_requesting_thread && !found_requesting_thread) {
- // Don't mark as an error, but invalidate the requesting thread
- BPLOG(ERROR) << "Minidump indicated requesting thread " <<
- HexString(requesting_thread_id) << ", not found in " <<
- dump->path();
- process_state->requesting_thread_ = -1;
- }
-
- // Exploitability defaults to EXPLOITABILITY_NOT_ANALYZED
- process_state->exploitability_ = EXPLOITABILITY_NOT_ANALYZED;
-
- // If an exploitability run was requested we perform the platform specific
- // rating.
- if (enable_exploitability_) {
- scoped_ptr<Exploitability> exploitability(
- Exploitability::ExploitabilityForPlatform(dump,
- process_state,
- enable_objdump_));
- // The engine will be null if the platform is not supported
- if (exploitability != NULL) {
- process_state->exploitability_ = exploitability->CheckExploitability();
- } else {
- process_state->exploitability_ = EXPLOITABILITY_ERR_NOENGINE;
- }
- }
-
- BPLOG(INFO) << "Processed " << dump->path();
- return PROCESS_OK;
-}
-
-ProcessResult MinidumpProcessor::Process(
- const string &minidump_file, ProcessState *process_state) {
- BPLOG(INFO) << "Processing minidump in file " << minidump_file;
-
- Minidump dump(minidump_file);
- if (!dump.Read()) {
- BPLOG(ERROR) << "Minidump " << dump.path() << " could not be read";
- return PROCESS_ERROR_MINIDUMP_NOT_FOUND;
- }
-
- return Process(&dump, process_state);
-}
-
-// Returns the MDRawSystemInfo from a minidump, or NULL if system info is
-// not available from the minidump. If system_info is non-NULL, it is used
-// to pass back the MinidumpSystemInfo object.
-static const MDRawSystemInfo* GetSystemInfo(Minidump *dump,
- MinidumpSystemInfo **system_info) {
- MinidumpSystemInfo *minidump_system_info = dump->GetSystemInfo();
- if (!minidump_system_info)
- return NULL;
-
- if (system_info)
- *system_info = minidump_system_info;
-
- return minidump_system_info->system_info();
-}
-
-// Extract CPU info string from ARM-specific MDRawSystemInfo structure.
-// raw_info: pointer to source MDRawSystemInfo.
-// cpu_info: address of target string, cpu info text will be appended to it.
-static void GetARMCpuInfo(const MDRawSystemInfo* raw_info,
- string* cpu_info) {
- assert(raw_info != NULL && cpu_info != NULL);
-
- // Write ARM architecture version.
- char cpu_string[32];
- snprintf(cpu_string, sizeof(cpu_string), "ARMv%d",
- raw_info->processor_level);
- cpu_info->append(cpu_string);
-
- // There is no good list of implementer id values, but the following
- // pages provide some help:
- // http://comments.gmane.org/gmane.linux.linaro.devel/6903
- // http://forum.xda-developers.com/archive/index.php/t-480226.html
- const struct {
- uint32_t id;
- const char* name;
- } vendors[] = {
- { 0x41, "ARM" },
- { 0x51, "Qualcomm" },
- { 0x56, "Marvell" },
- { 0x69, "Intel/Marvell" },
- };
- const struct {
- uint32_t id;
- const char* name;
- } parts[] = {
- { 0x4100c050, "Cortex-A5" },
- { 0x4100c080, "Cortex-A8" },
- { 0x4100c090, "Cortex-A9" },
- { 0x4100c0f0, "Cortex-A15" },
- { 0x4100c140, "Cortex-R4" },
- { 0x4100c150, "Cortex-R5" },
- { 0x4100b360, "ARM1136" },
- { 0x4100b560, "ARM1156" },
- { 0x4100b760, "ARM1176" },
- { 0x4100b020, "ARM11-MPCore" },
- { 0x41009260, "ARM926" },
- { 0x41009460, "ARM946" },
- { 0x41009660, "ARM966" },
- { 0x510006f0, "Krait" },
- { 0x510000f0, "Scorpion" },
- };
-
- const struct {
- uint32_t hwcap;
- const char* name;
- } features[] = {
- { MD_CPU_ARM_ELF_HWCAP_SWP, "swp" },
- { MD_CPU_ARM_ELF_HWCAP_HALF, "half" },
- { MD_CPU_ARM_ELF_HWCAP_THUMB, "thumb" },
- { MD_CPU_ARM_ELF_HWCAP_26BIT, "26bit" },
- { MD_CPU_ARM_ELF_HWCAP_FAST_MULT, "fastmult" },
- { MD_CPU_ARM_ELF_HWCAP_FPA, "fpa" },
- { MD_CPU_ARM_ELF_HWCAP_VFP, "vfpv2" },
- { MD_CPU_ARM_ELF_HWCAP_EDSP, "edsp" },
- { MD_CPU_ARM_ELF_HWCAP_JAVA, "java" },
- { MD_CPU_ARM_ELF_HWCAP_IWMMXT, "iwmmxt" },
- { MD_CPU_ARM_ELF_HWCAP_CRUNCH, "crunch" },
- { MD_CPU_ARM_ELF_HWCAP_THUMBEE, "thumbee" },
- { MD_CPU_ARM_ELF_HWCAP_NEON, "neon" },
- { MD_CPU_ARM_ELF_HWCAP_VFPv3, "vfpv3" },
- { MD_CPU_ARM_ELF_HWCAP_VFPv3D16, "vfpv3d16" },
- { MD_CPU_ARM_ELF_HWCAP_TLS, "tls" },
- { MD_CPU_ARM_ELF_HWCAP_VFPv4, "vfpv4" },
- { MD_CPU_ARM_ELF_HWCAP_IDIVA, "idiva" },
- { MD_CPU_ARM_ELF_HWCAP_IDIVT, "idivt" },
- };
-
- uint32_t cpuid = raw_info->cpu.arm_cpu_info.cpuid;
- if (cpuid != 0) {
- // Extract vendor name from CPUID
- const char* vendor = NULL;
- uint32_t vendor_id = (cpuid >> 24) & 0xff;
- for (size_t i = 0; i < sizeof(vendors)/sizeof(vendors[0]); ++i) {
- if (vendors[i].id == vendor_id) {
- vendor = vendors[i].name;
- break;
- }
- }
- cpu_info->append(" ");
- if (vendor) {
- cpu_info->append(vendor);
- } else {
- snprintf(cpu_string, sizeof(cpu_string), "vendor(0x%x)", vendor_id);
- cpu_info->append(cpu_string);
- }
-
- // Extract part name from CPUID
- uint32_t part_id = (cpuid & 0xff00fff0);
- const char* part = NULL;
- for (size_t i = 0; i < sizeof(parts)/sizeof(parts[0]); ++i) {
- if (parts[i].id == part_id) {
- part = parts[i].name;
- break;
- }
- }
- cpu_info->append(" ");
- if (part != NULL) {
- cpu_info->append(part);
- } else {
- snprintf(cpu_string, sizeof(cpu_string), "part(0x%x)", part_id);
- cpu_info->append(cpu_string);
- }
- }
- uint32_t elf_hwcaps = raw_info->cpu.arm_cpu_info.elf_hwcaps;
- if (elf_hwcaps != 0) {
- cpu_info->append(" features: ");
- const char* comma = "";
- for (size_t i = 0; i < sizeof(features)/sizeof(features[0]); ++i) {
- if (elf_hwcaps & features[i].hwcap) {
- cpu_info->append(comma);
- cpu_info->append(features[i].name);
- comma = ",";
- }
- }
- }
-}
-
-// static
-bool MinidumpProcessor::GetCPUInfo(Minidump *dump, SystemInfo *info) {
- assert(dump);
- assert(info);
-
- info->cpu.clear();
- info->cpu_info.clear();
-
- MinidumpSystemInfo *system_info;
- const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, &system_info);
- if (!raw_system_info)
- return false;
-
- switch (raw_system_info->processor_architecture) {
- case MD_CPU_ARCHITECTURE_X86:
- case MD_CPU_ARCHITECTURE_AMD64: {
- if (raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_X86)
- info->cpu = "x86";
- else
- info->cpu = "amd64";
-
- const string *cpu_vendor = system_info->GetCPUVendor();
- if (cpu_vendor) {
- info->cpu_info = *cpu_vendor;
- info->cpu_info.append(" ");
- }
-
- char x86_info[36];
- snprintf(x86_info, sizeof(x86_info), "family %u model %u stepping %u",
- raw_system_info->processor_level,
- raw_system_info->processor_revision >> 8,
- raw_system_info->processor_revision & 0xff);
- info->cpu_info.append(x86_info);
- break;
- }
-
- case MD_CPU_ARCHITECTURE_PPC: {
- info->cpu = "ppc";
- break;
- }
-
- case MD_CPU_ARCHITECTURE_PPC64: {
- info->cpu = "ppc64";
- break;
- }
-
- case MD_CPU_ARCHITECTURE_SPARC: {
- info->cpu = "sparc";
- break;
- }
-
- case MD_CPU_ARCHITECTURE_ARM: {
- info->cpu = "arm";
- GetARMCpuInfo(raw_system_info, &info->cpu_info);
- break;
- }
-
- case MD_CPU_ARCHITECTURE_ARM64: {
- info->cpu = "arm64";
- break;
- }
-
- case MD_CPU_ARCHITECTURE_MIPS: {
- info->cpu = "mips";
- break;
- }
- case MD_CPU_ARCHITECTURE_MIPS64: {
- info->cpu = "mips64";
- break;
- }
-
- default: {
- // Assign the numeric architecture ID into the CPU string.
- char cpu_string[7];
- snprintf(cpu_string, sizeof(cpu_string), "0x%04x",
- raw_system_info->processor_architecture);
- info->cpu = cpu_string;
- break;
- }
- }
-
- info->cpu_count = raw_system_info->number_of_processors;
-
- return true;
-}
-
-// static
-bool MinidumpProcessor::GetOSInfo(Minidump *dump, SystemInfo *info) {
- assert(dump);
- assert(info);
-
- info->os.clear();
- info->os_short.clear();
- info->os_version.clear();
-
- MinidumpSystemInfo *system_info;
- const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, &system_info);
- if (!raw_system_info)
- return false;
-
- info->os_short = system_info->GetOS();
-
- switch (raw_system_info->platform_id) {
- case MD_OS_WIN32_NT: {
- info->os = "Windows NT";
- break;
- }
-
- case MD_OS_WIN32_WINDOWS: {
- info->os = "Windows";
- break;
- }
-
- case MD_OS_MAC_OS_X: {
- info->os = "Mac OS X";
- break;
- }
-
- case MD_OS_IOS: {
- info->os = "iOS";
- break;
- }
-
- case MD_OS_LINUX: {
- info->os = "Linux";
- break;
- }
-
- case MD_OS_SOLARIS: {
- info->os = "Solaris";
- break;
- }
-
- case MD_OS_ANDROID: {
- info->os = "Android";
- break;
- }
-
- case MD_OS_PS3: {
- info->os = "PS3";
- break;
- }
-
- case MD_OS_NACL: {
- info->os = "NaCl";
- break;
- }
-
- default: {
- // Assign the numeric platform ID into the OS string.
- char os_string[11];
- snprintf(os_string, sizeof(os_string), "0x%08x",
- raw_system_info->platform_id);
- info->os = os_string;
- break;
- }
- }
-
- char os_version_string[33];
- snprintf(os_version_string, sizeof(os_version_string), "%u.%u.%u",
- raw_system_info->major_version,
- raw_system_info->minor_version,
- raw_system_info->build_number);
- info->os_version = os_version_string;
-
- const string *csd_version = system_info->GetCSDVersion();
- if (csd_version) {
- info->os_version.append(" ");
- info->os_version.append(*csd_version);
- }
-
- return true;
-}
-
-// static
-bool MinidumpProcessor::GetProcessCreateTime(Minidump* dump,
- uint32_t* process_create_time) {
- assert(dump);
- assert(process_create_time);
-
- *process_create_time = 0;
-
- MinidumpMiscInfo* minidump_misc_info = dump->GetMiscInfo();
- if (!minidump_misc_info) {
- return false;
- }
-
- const MDRawMiscInfo* md_raw_misc_info = minidump_misc_info->misc_info();
- if (!md_raw_misc_info) {
- return false;
- }
-
- if (!(md_raw_misc_info->flags1 & MD_MISCINFO_FLAGS1_PROCESS_TIMES)) {
- return false;
- }
-
- *process_create_time = md_raw_misc_info->process_create_time;
- return true;
-}
-
-// static
-string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
- MinidumpException *exception = dump->GetException();
- if (!exception)
- return "";
-
- const MDRawExceptionStream *raw_exception = exception->exception();
- if (!raw_exception)
- return "";
-
- if (address)
- *address = raw_exception->exception_record.exception_address;
-
- // The reason value is OS-specific and possibly CPU-specific. Set up
- // sensible numeric defaults for the reason string in case we can't
- // map the codes to a string (because there's no system info, or because
- // it's an unrecognized platform, or because it's an unrecognized code.)
- char reason_string[24];
- uint32_t exception_code = raw_exception->exception_record.exception_code;
- uint32_t exception_flags = raw_exception->exception_record.exception_flags;
- snprintf(reason_string, sizeof(reason_string), "0x%08x / 0x%08x",
- exception_code, exception_flags);
- string reason = reason_string;
-
- const MDRawSystemInfo *raw_system_info = GetSystemInfo(dump, NULL);
- if (!raw_system_info)
- return reason;
-
- switch (raw_system_info->platform_id) {
- case MD_OS_MAC_OS_X:
- case MD_OS_IOS: {
- char flags_string[11];
- snprintf(flags_string, sizeof(flags_string), "0x%08x", exception_flags);
- switch (exception_code) {
- case MD_EXCEPTION_MAC_BAD_ACCESS:
- reason = "EXC_BAD_ACCESS / ";
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_INVALID_ADDRESS:
- reason.append("KERN_INVALID_ADDRESS");
- break;
- case MD_EXCEPTION_CODE_MAC_PROTECTION_FAILURE:
- reason.append("KERN_PROTECTION_FAILURE");
- break;
- case MD_EXCEPTION_CODE_MAC_NO_ACCESS:
- reason.append("KERN_NO_ACCESS");
- break;
- case MD_EXCEPTION_CODE_MAC_MEMORY_FAILURE:
- reason.append("KERN_MEMORY_FAILURE");
- break;
- case MD_EXCEPTION_CODE_MAC_MEMORY_ERROR:
- reason.append("KERN_MEMORY_ERROR");
- break;
- default:
- // arm and ppc overlap
- if (raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_ARM ||
- raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_ARM64) {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
- reason.append("EXC_ARM_DA_ALIGN");
- break;
- case MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG:
- reason.append("EXC_ARM_DA_DEBUG");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- } else if (raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_PPC) {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_PPC_VM_PROT_READ:
- reason.append("EXC_PPC_VM_PROT_READ");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_BADSPACE:
- reason.append("EXC_PPC_BADSPACE");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_UNALIGNED:
- reason.append("EXC_PPC_UNALIGNED");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- } else if (raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_X86 ||
- raw_system_info->processor_architecture ==
- MD_CPU_ARCHITECTURE_AMD64) {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT:
- reason.append("EXC_I386_GPFLT");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- } else {
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- }
- break;
- }
- break;
- case MD_EXCEPTION_MAC_BAD_INSTRUCTION:
- reason = "EXC_BAD_INSTRUCTION / ";
- switch (raw_system_info->processor_architecture) {
- case MD_CPU_ARCHITECTURE_ARM:
- case MD_CPU_ARCHITECTURE_ARM64: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_ARM_UNDEFINED:
- reason.append("EXC_ARM_UNDEFINED");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- case MD_CPU_ARCHITECTURE_PPC: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_PPC_INVALID_SYSCALL:
- reason.append("EXC_PPC_INVALID_SYSCALL");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_UNIMPLEMENTED_INSTRUCTION:
- reason.append("EXC_PPC_UNIPL_INST");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_INSTRUCTION:
- reason.append("EXC_PPC_PRIVINST");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_PRIVILEGED_REGISTER:
- reason.append("EXC_PPC_PRIVREG");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_TRACE:
- reason.append("EXC_PPC_TRACE");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_PERFORMANCE_MONITOR:
- reason.append("EXC_PPC_PERFMON");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- case MD_CPU_ARCHITECTURE_AMD64:
- case MD_CPU_ARCHITECTURE_X86: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_X86_INVALID_OPERATION:
- reason.append("EXC_I386_INVOP");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_INVALID_TASK_STATE_SEGMENT:
- reason.append("EXC_I386_INVTSSFLT");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_SEGMENT_NOT_PRESENT:
- reason.append("EXC_I386_SEGNPFLT");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_STACK_FAULT:
- reason.append("EXC_I386_STKFLT");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_GENERAL_PROTECTION_FAULT:
- reason.append("EXC_I386_GPFLT");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_ALIGNMENT_FAULT:
- reason.append("EXC_I386_ALIGNFLT");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- case MD_EXCEPTION_MAC_ARITHMETIC:
- reason = "EXC_ARITHMETIC / ";
- switch (raw_system_info->processor_architecture) {
- case MD_CPU_ARCHITECTURE_PPC: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_PPC_OVERFLOW:
- reason.append("EXC_PPC_OVERFLOW");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_ZERO_DIVIDE:
- reason.append("EXC_PPC_ZERO_DIVIDE");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_INEXACT:
- reason.append("EXC_FLT_INEXACT");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_ZERO_DIVIDE:
- reason.append("EXC_PPC_FLT_ZERO_DIVIDE");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_UNDERFLOW:
- reason.append("EXC_PPC_FLT_UNDERFLOW");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_OVERFLOW:
- reason.append("EXC_PPC_FLT_OVERFLOW");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_FLOAT_NOT_A_NUMBER:
- reason.append("EXC_PPC_FLT_NOT_A_NUMBER");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_NO_EMULATION:
- reason.append("EXC_PPC_NOEMULATION");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST:
- reason.append("EXC_PPC_ALTIVECASSIST");
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- case MD_CPU_ARCHITECTURE_AMD64:
- case MD_CPU_ARCHITECTURE_X86: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_X86_DIV:
- reason.append("EXC_I386_DIV");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_INTO:
- reason.append("EXC_I386_INTO");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_NOEXT:
- reason.append("EXC_I386_NOEXT");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_EXTOVR:
- reason.append("EXC_I386_EXTOVR");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_EXTERR:
- reason.append("EXC_I386_EXTERR");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_EMERR:
- reason.append("EXC_I386_EMERR");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_BOUND:
- reason.append("EXC_I386_BOUND");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_SSEEXTERR:
- reason.append("EXC_I386_SSEEXTERR");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- case MD_EXCEPTION_MAC_EMULATION:
- reason = "EXC_EMULATION / ";
- reason.append(flags_string);
- break;
- case MD_EXCEPTION_MAC_SOFTWARE:
- reason = "EXC_SOFTWARE / ";
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_ABORT:
- reason.append("SIGABRT");
- break;
- case MD_EXCEPTION_CODE_MAC_NS_EXCEPTION:
- reason.append("UNCAUGHT_NS_EXCEPTION");
- break;
- // These are ppc only but shouldn't be a problem as they're
- // unused on x86
- case MD_EXCEPTION_CODE_MAC_PPC_TRAP:
- reason.append("EXC_PPC_TRAP");
- break;
- case MD_EXCEPTION_CODE_MAC_PPC_MIGRATE:
- reason.append("EXC_PPC_MIGRATE");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- case MD_EXCEPTION_MAC_BREAKPOINT:
- reason = "EXC_BREAKPOINT / ";
- switch (raw_system_info->processor_architecture) {
- case MD_CPU_ARCHITECTURE_ARM:
- case MD_CPU_ARCHITECTURE_ARM64: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_ARM_DA_ALIGN:
- reason.append("EXC_ARM_DA_ALIGN");
- break;
- case MD_EXCEPTION_CODE_MAC_ARM_DA_DEBUG:
- reason.append("EXC_ARM_DA_DEBUG");
- break;
- case MD_EXCEPTION_CODE_MAC_ARM_BREAKPOINT:
- reason.append("EXC_ARM_BREAKPOINT");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- case MD_CPU_ARCHITECTURE_PPC: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_PPC_BREAKPOINT:
- reason.append("EXC_PPC_BREAKPOINT");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- case MD_CPU_ARCHITECTURE_AMD64:
- case MD_CPU_ARCHITECTURE_X86: {
- switch (exception_flags) {
- case MD_EXCEPTION_CODE_MAC_X86_SGL:
- reason.append("EXC_I386_SGL");
- break;
- case MD_EXCEPTION_CODE_MAC_X86_BPT:
- reason.append("EXC_I386_BPT");
- break;
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
- default:
- reason.append(flags_string);
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- case MD_EXCEPTION_MAC_SYSCALL:
- reason = "EXC_SYSCALL / ";
- reason.append(flags_string);
- break;
- case MD_EXCEPTION_MAC_MACH_SYSCALL:
- reason = "EXC_MACH_SYSCALL / ";
- reason.append(flags_string);
- break;
- case MD_EXCEPTION_MAC_RPC_ALERT:
- reason = "EXC_RPC_ALERT / ";
- reason.append(flags_string);
- break;
- }
- break;
- }
-
- case MD_OS_WIN32_NT:
- case MD_OS_WIN32_WINDOWS: {
- switch (exception_code) {
- case MD_EXCEPTION_CODE_WIN_CONTROL_C:
- reason = "DBG_CONTROL_C";
- break;
- case MD_EXCEPTION_CODE_WIN_GUARD_PAGE_VIOLATION:
- reason = "EXCEPTION_GUARD_PAGE";
- break;
- case MD_EXCEPTION_CODE_WIN_DATATYPE_MISALIGNMENT:
- reason = "EXCEPTION_DATATYPE_MISALIGNMENT";
- break;
- case MD_EXCEPTION_CODE_WIN_BREAKPOINT:
- reason = "EXCEPTION_BREAKPOINT";
- break;
- case MD_EXCEPTION_CODE_WIN_SINGLE_STEP:
- reason = "EXCEPTION_SINGLE_STEP";
- break;
- case MD_EXCEPTION_CODE_WIN_ACCESS_VIOLATION:
- // For EXCEPTION_ACCESS_VIOLATION, Windows puts the address that
- // caused the fault in exception_information[1].
- // exception_information[0] is 0 if the violation was caused by
- // an attempt to read data, 1 if it was an attempt to write data,
- // and 8 if this was a data execution violation.
- // This information is useful in addition to the code address, which
- // will be present in the crash thread's instruction field anyway.
- if (raw_exception->exception_record.number_parameters >= 1) {
- MDAccessViolationTypeWin av_type =
- static_cast<MDAccessViolationTypeWin>
- (raw_exception->exception_record.exception_information[0]);
- switch (av_type) {
- case MD_ACCESS_VIOLATION_WIN_READ:
- reason = "EXCEPTION_ACCESS_VIOLATION_READ";
- break;
- case MD_ACCESS_VIOLATION_WIN_WRITE:
- reason = "EXCEPTION_ACCESS_VIOLATION_WRITE";
- break;
- case MD_ACCESS_VIOLATION_WIN_EXEC:
- reason = "EXCEPTION_ACCESS_VIOLATION_EXEC";
- break;
- default:
- reason = "EXCEPTION_ACCESS_VIOLATION";
- break;
- }
- } else {
- reason = "EXCEPTION_ACCESS_VIOLATION";
- }
- if (address &&
- raw_exception->exception_record.number_parameters >= 2) {
- *address =
- raw_exception->exception_record.exception_information[1];
- }
- break;
- case MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR:
- // For EXCEPTION_IN_PAGE_ERROR, Windows puts the address that
- // caused the fault in exception_information[1].
- // exception_information[0] is 0 if the violation was caused by
- // an attempt to read data, 1 if it was an attempt to write data,
- // and 8 if this was a data execution violation.
- // exception_information[2] contains the underlying NTSTATUS code,
- // which is the explanation for why this error occured.
- // This information is useful in addition to the code address, which
- // will be present in the crash thread's instruction field anyway.
- if (raw_exception->exception_record.number_parameters >= 1) {
- MDInPageErrorTypeWin av_type =
- static_cast<MDInPageErrorTypeWin>
- (raw_exception->exception_record.exception_information[0]);
- switch (av_type) {
- case MD_IN_PAGE_ERROR_WIN_READ:
- reason = "EXCEPTION_IN_PAGE_ERROR_READ";
- break;
- case MD_IN_PAGE_ERROR_WIN_WRITE:
- reason = "EXCEPTION_IN_PAGE_ERROR_WRITE";
- break;
- case MD_IN_PAGE_ERROR_WIN_EXEC:
- reason = "EXCEPTION_IN_PAGE_ERROR_EXEC";
- break;
- default:
- reason = "EXCEPTION_IN_PAGE_ERROR";
- break;
- }
- } else {
- reason = "EXCEPTION_IN_PAGE_ERROR";
- }
- if (address &&
- raw_exception->exception_record.number_parameters >= 2) {
- *address =
- raw_exception->exception_record.exception_information[1];
- }
- if (raw_exception->exception_record.number_parameters >= 3) {
- uint32_t ntstatus =
- static_cast<uint32_t>
- (raw_exception->exception_record.exception_information[2]);
- reason.append(" / ");
- reason.append(NTStatusToString(ntstatus));
- }
- break;
- case MD_EXCEPTION_CODE_WIN_INVALID_HANDLE:
- reason = "EXCEPTION_INVALID_HANDLE";
- break;
- case MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION:
- reason = "EXCEPTION_ILLEGAL_INSTRUCTION";
- break;
- case MD_EXCEPTION_CODE_WIN_NONCONTINUABLE_EXCEPTION:
- reason = "EXCEPTION_NONCONTINUABLE_EXCEPTION";
- break;
- case MD_EXCEPTION_CODE_WIN_INVALID_DISPOSITION:
- reason = "EXCEPTION_INVALID_DISPOSITION";
- break;
- case MD_EXCEPTION_CODE_WIN_ARRAY_BOUNDS_EXCEEDED:
- reason = "EXCEPTION_BOUNDS_EXCEEDED";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_DENORMAL_OPERAND:
- reason = "EXCEPTION_FLT_DENORMAL_OPERAND";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_DIVIDE_BY_ZERO:
- reason = "EXCEPTION_FLT_DIVIDE_BY_ZERO";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_INEXACT_RESULT:
- reason = "EXCEPTION_FLT_INEXACT_RESULT";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_INVALID_OPERATION:
- reason = "EXCEPTION_FLT_INVALID_OPERATION";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_OVERFLOW:
- reason = "EXCEPTION_FLT_OVERFLOW";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_STACK_CHECK:
- reason = "EXCEPTION_FLT_STACK_CHECK";
- break;
- case MD_EXCEPTION_CODE_WIN_FLOAT_UNDERFLOW:
- reason = "EXCEPTION_FLT_UNDERFLOW";
- break;
- case MD_EXCEPTION_CODE_WIN_INTEGER_DIVIDE_BY_ZERO:
- reason = "EXCEPTION_INT_DIVIDE_BY_ZERO";
- break;
- case MD_EXCEPTION_CODE_WIN_INTEGER_OVERFLOW:
- reason = "EXCEPTION_INT_OVERFLOW";
- break;
- case MD_EXCEPTION_CODE_WIN_PRIVILEGED_INSTRUCTION:
- reason = "EXCEPTION_PRIV_INSTRUCTION";
- break;
- case MD_EXCEPTION_CODE_WIN_STACK_OVERFLOW:
- reason = "EXCEPTION_STACK_OVERFLOW";
- break;
- case MD_EXCEPTION_CODE_WIN_POSSIBLE_DEADLOCK:
- reason = "EXCEPTION_POSSIBLE_DEADLOCK";
- break;
- case MD_EXCEPTION_CODE_WIN_STACK_BUFFER_OVERRUN:
- reason = "EXCEPTION_STACK_BUFFER_OVERRUN";
- break;
- case MD_EXCEPTION_CODE_WIN_HEAP_CORRUPTION:
- reason = "EXCEPTION_HEAP_CORRUPTION";
- break;
- case MD_EXCEPTION_OUT_OF_MEMORY:
- reason = "Out of Memory";
- break;
- case MD_EXCEPTION_CODE_WIN_UNHANDLED_CPP_EXCEPTION:
- reason = "Unhandled C++ Exception";
- break;
- default:
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
-
- case MD_OS_ANDROID:
- case MD_OS_LINUX: {
- switch (exception_code) {
- case MD_EXCEPTION_CODE_LIN_SIGHUP:
- reason = "SIGHUP";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGINT:
- reason = "SIGINT";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGQUIT:
- reason = "SIGQUIT";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGILL:
- reason = "SIGILL";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGTRAP:
- reason = "SIGTRAP";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGABRT:
- reason = "SIGABRT";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGBUS:
- reason = "SIGBUS";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGFPE:
- reason = "SIGFPE";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGKILL:
- reason = "SIGKILL";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGUSR1:
- reason = "SIGUSR1";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGSEGV:
- reason = "SIGSEGV";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGUSR2:
- reason = "SIGUSR2";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGPIPE:
- reason = "SIGPIPE";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGALRM:
- reason = "SIGALRM";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGTERM:
- reason = "SIGTERM";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGSTKFLT:
- reason = "SIGSTKFLT";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGCHLD:
- reason = "SIGCHLD";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGCONT:
- reason = "SIGCONT";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGSTOP:
- reason = "SIGSTOP";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGTSTP:
- reason = "SIGTSTP";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGTTIN:
- reason = "SIGTTIN";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGTTOU:
- reason = "SIGTTOU";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGURG:
- reason = "SIGURG";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGXCPU:
- reason = "SIGXCPU";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGXFSZ:
- reason = "SIGXFSZ";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGVTALRM:
- reason = "SIGVTALRM";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGPROF:
- reason = "SIGPROF";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGWINCH:
- reason = "SIGWINCH";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGIO:
- reason = "SIGIO";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGPWR:
- reason = "SIGPWR";
- break;
- case MD_EXCEPTION_CODE_LIN_SIGSYS:
- reason = "SIGSYS";
- break;
- case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED:
- reason = "DUMP_REQUESTED";
- break;
- default:
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
-
- case MD_OS_SOLARIS: {
- switch (exception_code) {
- case MD_EXCEPTION_CODE_SOL_SIGHUP:
- reason = "SIGHUP";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGINT:
- reason = "SIGINT";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGQUIT:
- reason = "SIGQUIT";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGILL:
- reason = "SIGILL";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGTRAP:
- reason = "SIGTRAP";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGIOT:
- reason = "SIGIOT | SIGABRT";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGEMT:
- reason = "SIGEMT";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGFPE:
- reason = "SIGFPE";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGKILL:
- reason = "SIGKILL";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGBUS:
- reason = "SIGBUS";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGSEGV:
- reason = "SIGSEGV";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGSYS:
- reason = "SIGSYS";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGPIPE:
- reason = "SIGPIPE";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGALRM:
- reason = "SIGALRM";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGTERM:
- reason = "SIGTERM";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGUSR1:
- reason = "SIGUSR1";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGUSR2:
- reason = "SIGUSR2";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGCLD:
- reason = "SIGCLD | SIGCHLD";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGPWR:
- reason = "SIGPWR";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGWINCH:
- reason = "SIGWINCH";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGURG:
- reason = "SIGURG";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGPOLL:
- reason = "SIGPOLL | SIGIO";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGSTOP:
- reason = "SIGSTOP";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGTSTP:
- reason = "SIGTSTP";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGCONT:
- reason = "SIGCONT";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGTTIN:
- reason = "SIGTTIN";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGTTOU:
- reason = "SIGTTOU";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGVTALRM:
- reason = "SIGVTALRM";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGPROF:
- reason = "SIGPROF";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGXCPU:
- reason = "SIGXCPU";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGXFSZ:
- reason = "SIGXFSZ";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGWAITING:
- reason = "SIGWAITING";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGLWP:
- reason = "SIGLWP";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGFREEZE:
- reason = "SIGFREEZE";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGTHAW:
- reason = "SIGTHAW";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGCANCEL:
- reason = "SIGCANCEL";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGLOST:
- reason = "SIGLOST";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGXRES:
- reason = "SIGXRES";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGJVM1:
- reason = "SIGJVM1";
- break;
- case MD_EXCEPTION_CODE_SOL_SIGJVM2:
- reason = "SIGJVM2";
- break;
- default:
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- break;
- }
-
- case MD_OS_PS3: {
- switch (exception_code) {
- case MD_EXCEPTION_CODE_PS3_UNKNOWN:
- reason = "UNKNOWN";
- break;
- case MD_EXCEPTION_CODE_PS3_TRAP_EXCEP:
- reason = "TRAP_EXCEP";
- break;
- case MD_EXCEPTION_CODE_PS3_PRIV_INSTR:
- reason = "PRIV_INSTR";
- break;
- case MD_EXCEPTION_CODE_PS3_ILLEGAL_INSTR:
- reason = "ILLEGAL_INSTR";
- break;
- case MD_EXCEPTION_CODE_PS3_INSTR_STORAGE:
- reason = "INSTR_STORAGE";
- break;
- case MD_EXCEPTION_CODE_PS3_INSTR_SEGMENT:
- reason = "INSTR_SEGMENT";
- break;
- case MD_EXCEPTION_CODE_PS3_DATA_STORAGE:
- reason = "DATA_STORAGE";
- break;
- case MD_EXCEPTION_CODE_PS3_DATA_SEGMENT:
- reason = "DATA_SEGMENT";
- break;
- case MD_EXCEPTION_CODE_PS3_FLOAT_POINT:
- reason = "FLOAT_POINT";
- break;
- case MD_EXCEPTION_CODE_PS3_DABR_MATCH:
- reason = "DABR_MATCH";
- break;
- case MD_EXCEPTION_CODE_PS3_ALIGN_EXCEP:
- reason = "ALIGN_EXCEP";
- break;
- case MD_EXCEPTION_CODE_PS3_MEMORY_ACCESS:
- reason = "MEMORY_ACCESS";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_ALIGN:
- reason = "COPRO_ALIGN";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_INVALID_COM:
- reason = "COPRO_INVALID_COM";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_ERR:
- reason = "COPRO_ERR";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_FIR:
- reason = "COPRO_FIR";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_DATA_SEGMENT:
- reason = "COPRO_DATA_SEGMENT";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_DATA_STORAGE:
- reason = "COPRO_DATA_STORAGE";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_STOP_INSTR:
- reason = "COPRO_STOP_INSTR";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_HALT_INSTR:
- reason = "COPRO_HALT_INSTR";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_HALTINST_UNKNOWN:
- reason = "COPRO_HALTINSTR_UNKNOWN";
- break;
- case MD_EXCEPTION_CODE_PS3_COPRO_MEMORY_ACCESS:
- reason = "COPRO_MEMORY_ACCESS";
- break;
- case MD_EXCEPTION_CODE_PS3_GRAPHIC:
- reason = "GRAPHIC";
- break;
- default:
- BPLOG(INFO) << "Unknown exception reason "<< reason;
- break;
- }
- break;
- }
-
- default: {
- BPLOG(INFO) << "Unknown exception reason " << reason;
- break;
- }
- }
-
- return reason;
-}
-
-// static
-string MinidumpProcessor::GetAssertion(Minidump *dump) {
- MinidumpAssertion *assertion = dump->GetAssertion();
- if (!assertion)
- return "";
-
- const MDRawAssertionInfo *raw_assertion = assertion->assertion();
- if (!raw_assertion)
- return "";
-
- string assertion_string;
- switch (raw_assertion->type) {
- case MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER:
- assertion_string = "Invalid parameter passed to library function";
- break;
- case MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL:
- assertion_string = "Pure virtual function called";
- break;
- default: {
- char assertion_type[32];
- snprintf(assertion_type, sizeof(assertion_type),
- "0x%08x", raw_assertion->type);
- assertion_string = "Unknown assertion type ";
- assertion_string += assertion_type;
- break;
- }
- }
-
- string expression = assertion->expression();
- if (!expression.empty()) {
- assertion_string.append(" " + expression);
- }
-
- string function = assertion->function();
- if (!function.empty()) {
- assertion_string.append(" in function " + function);
- }
-
- string file = assertion->file();
- if (!file.empty()) {
- assertion_string.append(", in file " + file);
- }
-
- if (raw_assertion->line != 0) {
- char assertion_line[32];
- snprintf(assertion_line, sizeof(assertion_line), "%u", raw_assertion->line);
- assertion_string.append(" at line ");
- assertion_string.append(assertion_line);
- }
-
- return assertion_string;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_processor_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump_processor_unittest.cc
deleted file mode 100644
index d43c1fc97a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_processor_unittest.cc
+++ /dev/null
@@ -1,645 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit test for MinidumpProcessor. Uses a pre-generated minidump and
-// corresponding symbol file, and checks the stack frames for correctness.
-
-#include <stdlib.h>
-
-#include <string>
-#include <iostream>
-#include <fstream>
-#include <map>
-#include <utility>
-
-#include "breakpad_googletest_includes.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/minidump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/symbol_supplier.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_unittest_utils.h"
-
-using std::map;
-
-namespace google_breakpad {
-class MockMinidump : public Minidump {
- public:
- MockMinidump() : Minidump("") {
- }
-
- MOCK_METHOD0(Read, bool());
- MOCK_CONST_METHOD0(path, string());
- MOCK_CONST_METHOD0(header, const MDRawHeader*());
- MOCK_METHOD0(GetThreadList, MinidumpThreadList*());
- MOCK_METHOD0(GetSystemInfo, MinidumpSystemInfo*());
- MOCK_METHOD0(GetMiscInfo, MinidumpMiscInfo*());
- MOCK_METHOD0(GetBreakpadInfo, MinidumpBreakpadInfo*());
- MOCK_METHOD0(GetException, MinidumpException*());
- MOCK_METHOD0(GetAssertion, MinidumpAssertion*());
- MOCK_METHOD0(GetModuleList, MinidumpModuleList*());
- MOCK_METHOD0(GetMemoryList, MinidumpMemoryList*());
-};
-
-class MockMinidumpThreadList : public MinidumpThreadList {
- public:
- MockMinidumpThreadList() : MinidumpThreadList(NULL) {}
-
- MOCK_CONST_METHOD0(thread_count, unsigned int());
- MOCK_CONST_METHOD1(GetThreadAtIndex, MinidumpThread*(unsigned int));
-};
-
-class MockMinidumpMemoryList : public MinidumpMemoryList {
- public:
- MockMinidumpMemoryList() : MinidumpMemoryList(NULL) {}
-
- MOCK_METHOD1(GetMemoryRegionForAddress, MinidumpMemoryRegion*(uint64_t));
-};
-
-class MockMinidumpThread : public MinidumpThread {
- public:
- MockMinidumpThread() : MinidumpThread(NULL) {}
-
- MOCK_CONST_METHOD1(GetThreadID, bool(uint32_t*));
- MOCK_METHOD0(GetContext, MinidumpContext*());
- MOCK_METHOD0(GetMemory, MinidumpMemoryRegion*());
- MOCK_CONST_METHOD0(GetStartOfStackMemoryRange, uint64_t());
-};
-
-// This is crappy, but MinidumpProcessor really does want a
-// MinidumpMemoryRegion.
-class MockMinidumpMemoryRegion : public MinidumpMemoryRegion {
- public:
- MockMinidumpMemoryRegion(uint64_t base, const string& contents) :
- MinidumpMemoryRegion(NULL) {
- region_.Init(base, contents);
- }
-
- uint64_t GetBase() const { return region_.GetBase(); }
- uint32_t GetSize() const { return region_.GetSize(); }
-
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
- return region_.GetMemoryAtAddress(address, value);
- }
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
- return region_.GetMemoryAtAddress(address, value);
- }
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
- return region_.GetMemoryAtAddress(address, value);
- }
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
- return region_.GetMemoryAtAddress(address, value);
- }
-
- MockMemoryRegion region_;
-};
-
-// A test miscelaneous info stream, just returns values from the
-// MDRawMiscInfo fed to it.
-class TestMinidumpMiscInfo : public MinidumpMiscInfo {
- public:
- explicit TestMinidumpMiscInfo(const MDRawMiscInfo& misc_info) :
- MinidumpMiscInfo(NULL) {
- valid_ = true;
- misc_info_ = misc_info;
- }
-};
-
-} // namespace google_breakpad
-
-namespace {
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::MinidumpContext;
-using google_breakpad::MinidumpMemoryRegion;
-using google_breakpad::MinidumpMiscInfo;
-using google_breakpad::MinidumpProcessor;
-using google_breakpad::MinidumpSystemInfo;
-using google_breakpad::MinidumpThreadList;
-using google_breakpad::MinidumpThread;
-using google_breakpad::MockMinidump;
-using google_breakpad::MockMinidumpMemoryList;
-using google_breakpad::MockMinidumpMemoryRegion;
-using google_breakpad::MockMinidumpThread;
-using google_breakpad::MockMinidumpThreadList;
-using google_breakpad::ProcessState;
-using google_breakpad::scoped_ptr;
-using google_breakpad::SymbolSupplier;
-using google_breakpad::SystemInfo;
-using ::testing::_;
-using ::testing::AnyNumber;
-using ::testing::DoAll;
-using ::testing::Mock;
-using ::testing::Ne;
-using ::testing::Property;
-using ::testing::Return;
-using ::testing::SetArgumentPointee;
-
-static const char *kSystemInfoOS = "Windows NT";
-static const char *kSystemInfoOSShort = "windows";
-static const char *kSystemInfoOSVersion = "5.1.2600 Service Pack 2";
-static const char *kSystemInfoCPU = "x86";
-static const char *kSystemInfoCPUInfo =
- "GenuineIntel family 6 model 13 stepping 8";
-
-#define ASSERT_TRUE_ABORT(cond) \
- if (!(cond)) { \
- fprintf(stderr, "FAILED: %s at %s:%d\n", #cond, __FILE__, __LINE__); \
- abort(); \
- }
-
-#define ASSERT_EQ_ABORT(e1, e2) ASSERT_TRUE_ABORT((e1) == (e2))
-
-class TestSymbolSupplier : public SymbolSupplier {
- public:
- TestSymbolSupplier() : interrupt_(false) {}
-
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file);
-
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data);
-
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size);
-
- virtual void FreeSymbolData(const CodeModule *module);
-
- // When set to true, causes the SymbolSupplier to return INTERRUPT
- void set_interrupt(bool interrupt) { interrupt_ = interrupt; }
-
- private:
- bool interrupt_;
- map<string, char *> memory_buffers_;
-};
-
-SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file) {
- ASSERT_TRUE_ABORT(module);
- ASSERT_TRUE_ABORT(system_info);
- ASSERT_EQ_ABORT(system_info->cpu, kSystemInfoCPU);
- ASSERT_EQ_ABORT(system_info->cpu_info, kSystemInfoCPUInfo);
- ASSERT_EQ_ABORT(system_info->os, kSystemInfoOS);
- ASSERT_EQ_ABORT(system_info->os_short, kSystemInfoOSShort);
- ASSERT_EQ_ABORT(system_info->os_version, kSystemInfoOSVersion);
-
- if (interrupt_) {
- return INTERRUPT;
- }
-
- if (module && module->code_file() == "c:\\test_app.exe") {
- *symbol_file = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/symbols/test_app.pdb/" +
- module->debug_identifier() +
- "/test_app.sym";
- return FOUND;
- }
-
- return NOT_FOUND;
-}
-
-SymbolSupplier::SymbolResult TestSymbolSupplier::GetSymbolFile(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) {
- SymbolSupplier::SymbolResult s = GetSymbolFile(module, system_info,
- symbol_file);
- if (s == FOUND) {
- std::ifstream in(symbol_file->c_str());
- std::getline(in, *symbol_data, string::traits_type::to_char_type(
- string::traits_type::eof()));
- in.close();
- }
-
- return s;
-}
-
-SymbolSupplier::SymbolResult TestSymbolSupplier::GetCStringSymbolData(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) {
- string symbol_data_string;
- SymbolSupplier::SymbolResult s = GetSymbolFile(module,
- system_info,
- symbol_file,
- &symbol_data_string);
- if (s == FOUND) {
- *symbol_data_size = symbol_data_string.size() + 1;
- *symbol_data = new char[*symbol_data_size];
- if (*symbol_data == NULL) {
- BPLOG(ERROR) << "Memory allocation failed for module: "
- << module->code_file() << " size: " << *symbol_data_size;
- return INTERRUPT;
- }
- memcpy(*symbol_data, symbol_data_string.c_str(), symbol_data_string.size());
- (*symbol_data)[symbol_data_string.size()] = '\0';
- memory_buffers_.insert(make_pair(module->code_file(), *symbol_data));
- }
-
- return s;
-}
-
-void TestSymbolSupplier::FreeSymbolData(const CodeModule *module) {
- map<string, char *>::iterator it = memory_buffers_.find(module->code_file());
- if (it != memory_buffers_.end()) {
- delete [] it->second;
- memory_buffers_.erase(it);
- }
-}
-
-// A test system info stream, just returns values from the
-// MDRawSystemInfo fed to it.
-class TestMinidumpSystemInfo : public MinidumpSystemInfo {
- public:
- explicit TestMinidumpSystemInfo(MDRawSystemInfo info) :
- MinidumpSystemInfo(NULL) {
- valid_ = true;
- system_info_ = info;
- csd_version_ = new string("");
- }
-};
-
-// A test minidump context, just returns the MDRawContextX86
-// fed to it.
-class TestMinidumpContext : public MinidumpContext {
- public:
- explicit TestMinidumpContext(const MDRawContextX86& context) :
- MinidumpContext(NULL) {
- valid_ = true;
- SetContextX86(new MDRawContextX86(context));
- SetContextFlags(MD_CONTEXT_X86);
- }
-};
-
-class MinidumpProcessorTest : public ::testing::Test {
-};
-
-TEST_F(MinidumpProcessorTest, TestCorruptMinidumps) {
- MockMinidump dump;
- TestSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- MinidumpProcessor processor(&supplier, &resolver);
- ProcessState state;
-
- EXPECT_EQ(processor.Process("nonexistent minidump", &state),
- google_breakpad::PROCESS_ERROR_MINIDUMP_NOT_FOUND);
-
- EXPECT_CALL(dump, path()).WillRepeatedly(Return("mock minidump"));
- EXPECT_CALL(dump, Read()).WillRepeatedly(Return(true));
-
- MDRawHeader fakeHeader;
- fakeHeader.time_date_stamp = 0;
- EXPECT_CALL(dump, header()).
- WillOnce(Return(reinterpret_cast<MDRawHeader*>(NULL))).
- WillRepeatedly(Return(&fakeHeader));
-
- EXPECT_EQ(processor.Process(&dump, &state),
- google_breakpad::PROCESS_ERROR_NO_MINIDUMP_HEADER);
-
- EXPECT_CALL(dump, GetThreadList()).
- WillOnce(Return(reinterpret_cast<MinidumpThreadList*>(NULL)));
- EXPECT_CALL(dump, GetSystemInfo()).
- WillRepeatedly(Return(reinterpret_cast<MinidumpSystemInfo*>(NULL)));
-
- EXPECT_EQ(processor.Process(&dump, &state),
- google_breakpad::PROCESS_ERROR_NO_THREAD_LIST);
-}
-
-// This test case verifies that the symbol supplier is only consulted
-// once per minidump per module.
-TEST_F(MinidumpProcessorTest, TestSymbolSupplierLookupCounts) {
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- MinidumpProcessor processor(&supplier, &resolver);
-
- string minidump_file = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/minidump2.dmp";
- ProcessState state;
- EXPECT_CALL(supplier, GetCStringSymbolData(
- Property(&google_breakpad::CodeModule::code_file,
- "c:\\test_app.exe"),
- _, _, _, _)).WillOnce(Return(SymbolSupplier::NOT_FOUND));
- EXPECT_CALL(supplier, GetCStringSymbolData(
- Property(&google_breakpad::CodeModule::code_file,
- Ne("c:\\test_app.exe")),
- _, _, _, _)).WillRepeatedly(Return(SymbolSupplier::NOT_FOUND));
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
- ASSERT_EQ(processor.Process(minidump_file, &state),
- google_breakpad::PROCESS_OK);
-
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&supplier));
-
- // We need to verify that across minidumps, the processor will refetch
- // symbol files, even with the same symbol supplier.
- EXPECT_CALL(supplier, GetCStringSymbolData(
- Property(&google_breakpad::CodeModule::code_file,
- "c:\\test_app.exe"),
- _, _, _, _)).WillOnce(Return(SymbolSupplier::NOT_FOUND));
- EXPECT_CALL(supplier, GetCStringSymbolData(
- Property(&google_breakpad::CodeModule::code_file,
- Ne("c:\\test_app.exe")),
- _, _, _, _)).WillRepeatedly(Return(SymbolSupplier::NOT_FOUND));
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
- ASSERT_EQ(processor.Process(minidump_file, &state),
- google_breakpad::PROCESS_OK);
-}
-
-TEST_F(MinidumpProcessorTest, TestBasicProcessing) {
- TestSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- MinidumpProcessor processor(&supplier, &resolver);
-
- string minidump_file = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/minidump2.dmp";
-
- ProcessState state;
- ASSERT_EQ(processor.Process(minidump_file, &state),
- google_breakpad::PROCESS_OK);
- ASSERT_EQ(state.system_info()->os, kSystemInfoOS);
- ASSERT_EQ(state.system_info()->os_short, kSystemInfoOSShort);
- ASSERT_EQ(state.system_info()->os_version, kSystemInfoOSVersion);
- ASSERT_EQ(state.system_info()->cpu, kSystemInfoCPU);
- ASSERT_EQ(state.system_info()->cpu_info, kSystemInfoCPUInfo);
- ASSERT_TRUE(state.crashed());
- ASSERT_EQ(state.crash_reason(), "EXCEPTION_ACCESS_VIOLATION_WRITE");
- ASSERT_EQ(state.crash_address(), 0x45U);
- ASSERT_EQ(state.threads()->size(), size_t(1));
- EXPECT_EQ((*state.threads())[0]->tid(), 3060U);
- ASSERT_EQ(state.requesting_thread(), 0);
- EXPECT_EQ(1171480435U, state.time_date_stamp());
- EXPECT_EQ(1171480435U, state.process_create_time());
-
- CallStack *stack = state.threads()->at(0);
- ASSERT_TRUE(stack);
- ASSERT_EQ(stack->frames()->size(), 4U);
-
- ASSERT_TRUE(stack->frames()->at(0)->module);
- ASSERT_EQ(stack->frames()->at(0)->module->base_address(), 0x400000U);
- ASSERT_EQ(stack->frames()->at(0)->module->code_file(), "c:\\test_app.exe");
- ASSERT_EQ(stack->frames()->at(0)->function_name,
- "`anonymous namespace'::CrashFunction");
- ASSERT_EQ(stack->frames()->at(0)->source_file_name, "c:\\test_app.cc");
- ASSERT_EQ(stack->frames()->at(0)->source_line, 58);
-
- ASSERT_TRUE(stack->frames()->at(1)->module);
- ASSERT_EQ(stack->frames()->at(1)->module->base_address(), 0x400000U);
- ASSERT_EQ(stack->frames()->at(1)->module->code_file(), "c:\\test_app.exe");
- ASSERT_EQ(stack->frames()->at(1)->function_name, "main");
- ASSERT_EQ(stack->frames()->at(1)->source_file_name, "c:\\test_app.cc");
- ASSERT_EQ(stack->frames()->at(1)->source_line, 65);
-
- // This comes from the CRT
- ASSERT_TRUE(stack->frames()->at(2)->module);
- ASSERT_EQ(stack->frames()->at(2)->module->base_address(), 0x400000U);
- ASSERT_EQ(stack->frames()->at(2)->module->code_file(), "c:\\test_app.exe");
- ASSERT_EQ(stack->frames()->at(2)->function_name, "__tmainCRTStartup");
- ASSERT_EQ(stack->frames()->at(2)->source_file_name,
- "f:\\sp\\vctools\\crt_bld\\self_x86\\crt\\src\\crt0.c");
- ASSERT_EQ(stack->frames()->at(2)->source_line, 327);
-
- // No debug info available for kernel32.dll
- ASSERT_TRUE(stack->frames()->at(3)->module);
- ASSERT_EQ(stack->frames()->at(3)->module->base_address(), 0x7c800000U);
- ASSERT_EQ(stack->frames()->at(3)->module->code_file(),
- "C:\\WINDOWS\\system32\\kernel32.dll");
- ASSERT_TRUE(stack->frames()->at(3)->function_name.empty());
- ASSERT_TRUE(stack->frames()->at(3)->source_file_name.empty());
- ASSERT_EQ(stack->frames()->at(3)->source_line, 0);
-
- ASSERT_EQ(state.modules()->module_count(), 13U);
- ASSERT_TRUE(state.modules()->GetMainModule());
- ASSERT_EQ(state.modules()->GetMainModule()->code_file(), "c:\\test_app.exe");
- ASSERT_FALSE(state.modules()->GetModuleForAddress(0));
- ASSERT_EQ(state.modules()->GetMainModule(),
- state.modules()->GetModuleForAddress(0x400000));
- ASSERT_EQ(state.modules()->GetModuleForAddress(0x7c801234)->debug_file(),
- "kernel32.pdb");
- ASSERT_EQ(state.modules()->GetModuleForAddress(0x77d43210)->version(),
- "5.1.2600.2622");
-
- // Test that disabled exploitability engine defaults to
- // EXPLOITABILITY_NOT_ANALYZED.
- ASSERT_EQ(google_breakpad::EXPLOITABILITY_NOT_ANALYZED,
- state.exploitability());
-
- // Test that the symbol supplier can interrupt processing
- state.Clear();
- supplier.set_interrupt(true);
- ASSERT_EQ(processor.Process(minidump_file, &state),
- google_breakpad::PROCESS_SYMBOL_SUPPLIER_INTERRUPTED);
-}
-
-TEST_F(MinidumpProcessorTest, TestThreadMissingMemory) {
- MockMinidump dump;
- EXPECT_CALL(dump, path()).WillRepeatedly(Return("mock minidump"));
- EXPECT_CALL(dump, Read()).WillRepeatedly(Return(true));
-
- MDRawHeader fake_header;
- fake_header.time_date_stamp = 0;
- EXPECT_CALL(dump, header()).WillRepeatedly(Return(&fake_header));
-
- MDRawSystemInfo raw_system_info;
- memset(&raw_system_info, 0, sizeof(raw_system_info));
- raw_system_info.processor_architecture = MD_CPU_ARCHITECTURE_X86;
- raw_system_info.platform_id = MD_OS_WIN32_NT;
- TestMinidumpSystemInfo dump_system_info(raw_system_info);
-
- EXPECT_CALL(dump, GetSystemInfo()).
- WillRepeatedly(Return(&dump_system_info));
-
- MockMinidumpThreadList thread_list;
- EXPECT_CALL(dump, GetThreadList()).
- WillOnce(Return(&thread_list));
-
- MockMinidumpMemoryList memory_list;
- EXPECT_CALL(dump, GetMemoryList()).
- WillOnce(Return(&memory_list));
-
- // Return a thread missing stack memory.
- MockMinidumpThread no_memory_thread;
- EXPECT_CALL(no_memory_thread, GetThreadID(_)).
- WillRepeatedly(DoAll(SetArgumentPointee<0>(1),
- Return(true)));
- EXPECT_CALL(no_memory_thread, GetMemory()).
- WillRepeatedly(Return(reinterpret_cast<MinidumpMemoryRegion*>(NULL)));
-
- const uint64_t kTestStartOfMemoryRange = 0x1234;
- EXPECT_CALL(no_memory_thread, GetStartOfStackMemoryRange()).
- WillRepeatedly(Return(kTestStartOfMemoryRange));
- EXPECT_CALL(memory_list, GetMemoryRegionForAddress(kTestStartOfMemoryRange)).
- WillRepeatedly(Return(reinterpret_cast<MinidumpMemoryRegion*>(NULL)));
-
- MDRawContextX86 no_memory_thread_raw_context;
- memset(&no_memory_thread_raw_context, 0,
- sizeof(no_memory_thread_raw_context));
- no_memory_thread_raw_context.context_flags = MD_CONTEXT_X86_FULL;
- const uint32_t kExpectedEIP = 0xabcd1234;
- no_memory_thread_raw_context.eip = kExpectedEIP;
- TestMinidumpContext no_memory_thread_context(no_memory_thread_raw_context);
- EXPECT_CALL(no_memory_thread, GetContext()).
- WillRepeatedly(Return(&no_memory_thread_context));
-
- EXPECT_CALL(thread_list, thread_count()).
- WillRepeatedly(Return(1));
- EXPECT_CALL(thread_list, GetThreadAtIndex(0)).
- WillOnce(Return(&no_memory_thread));
-
- MinidumpProcessor processor(reinterpret_cast<SymbolSupplier*>(NULL), NULL);
- ProcessState state;
- EXPECT_EQ(processor.Process(&dump, &state),
- google_breakpad::PROCESS_OK);
-
- // Should have a single thread with a single frame in it.
- ASSERT_EQ(1U, state.threads()->size());
- ASSERT_EQ(1U, state.threads()->at(0)->frames()->size());
- ASSERT_EQ(kExpectedEIP, state.threads()->at(0)->frames()->at(0)->instruction);
-}
-
-TEST_F(MinidumpProcessorTest, GetProcessCreateTime) {
- const uint32_t kProcessCreateTime = 2000;
- const uint32_t kTimeDateStamp = 5000;
- MockMinidump dump;
- EXPECT_CALL(dump, path()).WillRepeatedly(Return("mock minidump"));
- EXPECT_CALL(dump, Read()).WillRepeatedly(Return(true));
-
- // Set time of crash.
- MDRawHeader fake_header;
- fake_header.time_date_stamp = kTimeDateStamp;
- EXPECT_CALL(dump, header()).WillRepeatedly(Return(&fake_header));
-
- // Set process create time.
- MDRawMiscInfo raw_misc_info;
- memset(&raw_misc_info, 0, sizeof(raw_misc_info));
- raw_misc_info.process_create_time = kProcessCreateTime;
- raw_misc_info.flags1 |= MD_MISCINFO_FLAGS1_PROCESS_TIMES;
- google_breakpad::TestMinidumpMiscInfo dump_misc_info(raw_misc_info);
- EXPECT_CALL(dump, GetMiscInfo()).WillRepeatedly(Return(&dump_misc_info));
-
- // No threads
- MockMinidumpThreadList thread_list;
- EXPECT_CALL(dump, GetThreadList()).WillOnce(Return(&thread_list));
- EXPECT_CALL(thread_list, thread_count()).WillRepeatedly(Return(0));
-
- MinidumpProcessor processor(reinterpret_cast<SymbolSupplier*>(NULL), NULL);
- ProcessState state;
- EXPECT_EQ(google_breakpad::PROCESS_OK, processor.Process(&dump, &state));
-
- // Verify the time stamps.
- ASSERT_EQ(kTimeDateStamp, state.time_date_stamp());
- ASSERT_EQ(kProcessCreateTime, state.process_create_time());
-}
-
-TEST_F(MinidumpProcessorTest, TestThreadMissingContext) {
- MockMinidump dump;
- EXPECT_CALL(dump, path()).WillRepeatedly(Return("mock minidump"));
- EXPECT_CALL(dump, Read()).WillRepeatedly(Return(true));
-
- MDRawHeader fake_header;
- fake_header.time_date_stamp = 0;
- EXPECT_CALL(dump, header()).WillRepeatedly(Return(&fake_header));
-
- MDRawSystemInfo raw_system_info;
- memset(&raw_system_info, 0, sizeof(raw_system_info));
- raw_system_info.processor_architecture = MD_CPU_ARCHITECTURE_X86;
- raw_system_info.platform_id = MD_OS_WIN32_NT;
- TestMinidumpSystemInfo dump_system_info(raw_system_info);
-
- EXPECT_CALL(dump, GetSystemInfo()).
- WillRepeatedly(Return(&dump_system_info));
-
- MockMinidumpThreadList thread_list;
- EXPECT_CALL(dump, GetThreadList()).
- WillOnce(Return(&thread_list));
-
- MockMinidumpMemoryList memory_list;
- EXPECT_CALL(dump, GetMemoryList()).
- WillOnce(Return(&memory_list));
-
- // Return a thread missing a thread context.
- MockMinidumpThread no_context_thread;
- EXPECT_CALL(no_context_thread, GetThreadID(_)).
- WillRepeatedly(DoAll(SetArgumentPointee<0>(1),
- Return(true)));
- EXPECT_CALL(no_context_thread, GetContext()).
- WillRepeatedly(Return(reinterpret_cast<MinidumpContext*>(NULL)));
-
- // The memory contents don't really matter here, since it won't be used.
- MockMinidumpMemoryRegion no_context_thread_memory(0x1234, "xxx");
- EXPECT_CALL(no_context_thread, GetMemory()).
- WillRepeatedly(Return(&no_context_thread_memory));
- EXPECT_CALL(no_context_thread, GetStartOfStackMemoryRange()).
- Times(0);
- EXPECT_CALL(memory_list, GetMemoryRegionForAddress(_)).
- Times(0);
-
- EXPECT_CALL(thread_list, thread_count()).
- WillRepeatedly(Return(1));
- EXPECT_CALL(thread_list, GetThreadAtIndex(0)).
- WillOnce(Return(&no_context_thread));
-
- MinidumpProcessor processor(reinterpret_cast<SymbolSupplier*>(NULL), NULL);
- ProcessState state;
- EXPECT_EQ(processor.Process(&dump, &state),
- google_breakpad::PROCESS_OK);
-
- // Should have a single thread with zero frames.
- ASSERT_EQ(1U, state.threads()->size());
- ASSERT_EQ(0U, state.threads()->at(0)->frames()->size());
-}
-
-} // namespace
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk.cc
deleted file mode 100644
index 8f83969fef..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_stackwalk.cc: Process a minidump with MinidumpProcessor, printing
-// the results, including stack traces.
-//
-// Author: Mark Mentovai
-
-#include <stdio.h>
-#include <string.h>
-
-#include <string>
-#include <vector>
-
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/minidump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#include "processor/logging.h"
-#include "processor/simple_symbol_supplier.h"
-#include "processor/stackwalk_common.h"
-
-
-namespace {
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpProcessor;
-using google_breakpad::ProcessState;
-using google_breakpad::SimpleSymbolSupplier;
-using google_breakpad::scoped_ptr;
-
-// Processes |minidump_file| using MinidumpProcessor. |symbol_path|, if
-// non-empty, is the base directory of a symbol storage area, laid out in
-// the format required by SimpleSymbolSupplier. If such a storage area
-// is specified, it is made available for use by the MinidumpProcessor.
-//
-// Returns the value of MinidumpProcessor::Process. If processing succeeds,
-// prints identifying OS and CPU information from the minidump, crash
-// information if the minidump was produced as a result of a crash, and
-// call stacks for each thread contained in the minidump. All information
-// is printed to stdout.
-bool PrintMinidumpProcess(const string &minidump_file,
- const std::vector<string> &symbol_paths,
- bool machine_readable,
- bool output_stack_contents) {
- scoped_ptr<SimpleSymbolSupplier> symbol_supplier;
- if (!symbol_paths.empty()) {
- // TODO(mmentovai): check existence of symbol_path if specified?
- symbol_supplier.reset(new SimpleSymbolSupplier(symbol_paths));
- }
-
- BasicSourceLineResolver resolver;
- MinidumpProcessor minidump_processor(symbol_supplier.get(), &resolver);
-
- // Process the minidump.
- Minidump dump(minidump_file);
- if (!dump.Read()) {
- BPLOG(ERROR) << "Minidump " << dump.path() << " could not be read";
- return false;
- }
- ProcessState process_state;
- if (minidump_processor.Process(&dump, &process_state) !=
- google_breakpad::PROCESS_OK) {
- BPLOG(ERROR) << "MinidumpProcessor::Process failed";
- return false;
- }
-
- if (machine_readable) {
- PrintProcessStateMachineReadable(process_state);
- } else {
- PrintProcessState(process_state, output_stack_contents, &resolver);
- }
-
- return true;
-}
-
-void usage(const char *program_name) {
- fprintf(stderr, "usage: %s [-m|-s] <minidump-file> [symbol-path ...]\n"
- " -m : Output in machine-readable format\n"
- " -s : Output stack contents\n",
- program_name);
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- if (argc < 2) {
- usage(argv[0]);
- return 1;
- }
-
- const char *minidump_file;
- bool machine_readable = false;
- bool output_stack_contents = false;
- int symbol_path_arg;
-
- if (strcmp(argv[1], "-m") == 0) {
- if (argc < 3) {
- usage(argv[0]);
- return 1;
- }
-
- machine_readable = true;
- minidump_file = argv[2];
- symbol_path_arg = 3;
- } else if (strcmp(argv[1], "-s") == 0) {
- if (argc < 3) {
- usage(argv[0]);
- return 1;
- }
-
- output_stack_contents = true;
- minidump_file = argv[2];
- symbol_path_arg = 3;
- } else {
- minidump_file = argv[1];
- symbol_path_arg = 2;
- }
-
- // extra arguments are symbol paths
- std::vector<string> symbol_paths;
- if (argc > symbol_path_arg) {
- for (int argi = symbol_path_arg; argi < argc; ++argi)
- symbol_paths.push_back(argv[argi]);
- }
-
- return PrintMinidumpProcess(minidump_file,
- symbol_paths,
- machine_readable,
- output_stack_contents) ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_machine_readable_test b/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_machine_readable_test
deleted file mode 100755
index 2aadb2412f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_machine_readable_test
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2007, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-testdata_dir=$srcdir/src/processor/testdata
-./src/processor/minidump_stackwalk -m $testdata_dir/minidump2.dmp \
- $testdata_dir/symbols | \
- tr -d '\015' | \
- diff -u $testdata_dir/minidump2.stackwalk.machine_readable.out -
-exit $?
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_test b/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_test
deleted file mode 100755
index f97902791e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_stackwalk_test
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-testdata_dir=$srcdir/src/processor/testdata
-./src/processor/minidump_stackwalk $testdata_dir/minidump2.dmp \
- $testdata_dir/symbols | \
- tr -d '\015' | \
- diff -u $testdata_dir/minidump2.stackwalk.out -
-exit $?
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc
deleted file mode 100644
index d29e9f4e5e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/minidump_unittest.cc
+++ /dev/null
@@ -1,1521 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit test for Minidump. Uses a pre-generated minidump and
-// verifies that certain streams are correct.
-
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <stdlib.h>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/minidump.h"
-#include "processor/logging.h"
-#include "processor/synth_minidump.h"
-
-namespace {
-
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpContext;
-using google_breakpad::MinidumpException;
-using google_breakpad::MinidumpMemoryInfo;
-using google_breakpad::MinidumpMemoryInfoList;
-using google_breakpad::MinidumpMemoryList;
-using google_breakpad::MinidumpMemoryRegion;
-using google_breakpad::MinidumpModule;
-using google_breakpad::MinidumpModuleList;
-using google_breakpad::MinidumpSystemInfo;
-using google_breakpad::MinidumpThread;
-using google_breakpad::MinidumpThreadList;
-using google_breakpad::SynthMinidump::Context;
-using google_breakpad::SynthMinidump::Dump;
-using google_breakpad::SynthMinidump::Exception;
-using google_breakpad::SynthMinidump::Memory;
-using google_breakpad::SynthMinidump::Module;
-using google_breakpad::SynthMinidump::Section;
-using google_breakpad::SynthMinidump::Stream;
-using google_breakpad::SynthMinidump::String;
-using google_breakpad::SynthMinidump::SystemInfo;
-using google_breakpad::SynthMinidump::Thread;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using std::ifstream;
-using std::istringstream;
-using std::vector;
-using ::testing::Return;
-
-class MinidumpTest : public ::testing::Test {
-public:
- void SetUp() {
- minidump_file_ = string(getenv("srcdir") ? getenv("srcdir") : ".") +
- "/src/processor/testdata/minidump2.dmp";
- }
- string minidump_file_;
-};
-
-TEST_F(MinidumpTest, TestMinidumpFromFile) {
- Minidump minidump(minidump_file_);
- ASSERT_EQ(minidump.path(), minidump_file_);
- ASSERT_TRUE(minidump.Read());
- const MDRawHeader* header = minidump.header();
- ASSERT_NE(header, (MDRawHeader*)NULL);
- ASSERT_EQ(header->signature, uint32_t(MD_HEADER_SIGNATURE));
-
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
- ASSERT_TRUE(md_module_list != NULL);
- const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
- ASSERT_TRUE(md_module != NULL);
- ASSERT_EQ("c:\\test_app.exe", md_module->code_file());
- ASSERT_EQ("c:\\test_app.pdb", md_module->debug_file());
- ASSERT_EQ("45D35F6C2d000", md_module->code_identifier());
- ASSERT_EQ("5A9832E5287241C1838ED98914E9B7FF1", md_module->debug_identifier());
-}
-
-TEST_F(MinidumpTest, TestMinidumpFromStream) {
- // read minidump contents into memory, construct a stringstream around them
- ifstream file_stream(minidump_file_.c_str(), std::ios::in);
- ASSERT_TRUE(file_stream.good());
- vector<char> bytes;
- file_stream.seekg(0, std::ios_base::end);
- ASSERT_TRUE(file_stream.good());
- bytes.resize(file_stream.tellg());
- file_stream.seekg(0, std::ios_base::beg);
- ASSERT_TRUE(file_stream.good());
- file_stream.read(&bytes[0], bytes.size());
- ASSERT_TRUE(file_stream.good());
- string str(&bytes[0], bytes.size());
- istringstream stream(str);
- ASSERT_TRUE(stream.good());
-
- // now read minidump from stringstream
- Minidump minidump(stream);
- ASSERT_EQ(minidump.path(), "");
- ASSERT_TRUE(minidump.Read());
- const MDRawHeader* header = minidump.header();
- ASSERT_NE(header, (MDRawHeader*)NULL);
- ASSERT_EQ(header->signature, uint32_t(MD_HEADER_SIGNATURE));
- //TODO: add more checks here
-}
-
-TEST(Dump, ReadBackEmpty) {
- Dump dump(0);
- dump.Finish();
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream stream(contents);
- Minidump minidump(stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(0U, minidump.GetDirectoryEntryCount());
-}
-
-TEST(Dump, ReadBackEmptyBigEndian) {
- Dump big_minidump(0, kBigEndian);
- big_minidump.Finish();
- string contents;
- ASSERT_TRUE(big_minidump.GetContents(&contents));
- istringstream stream(contents);
- Minidump minidump(stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(0U, minidump.GetDirectoryEntryCount());
-}
-
-TEST(Dump, OneStream) {
- Dump dump(0, kBigEndian);
- Stream stream(dump, 0xfbb7fa2bU);
- stream.Append("stream contents");
- dump.Add(&stream);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
- ASSERT_TRUE(dir != NULL);
- EXPECT_EQ(0xfbb7fa2bU, dir->stream_type);
-
- uint32_t stream_length;
- ASSERT_TRUE(minidump.SeekToStreamType(0xfbb7fa2bU, &stream_length));
- ASSERT_EQ(15U, stream_length);
- char stream_contents[15];
- ASSERT_TRUE(minidump.ReadBytes(stream_contents, sizeof(stream_contents)));
- EXPECT_EQ(string("stream contents"),
- string(stream_contents, sizeof(stream_contents)));
-
- EXPECT_FALSE(minidump.GetThreadList());
- EXPECT_FALSE(minidump.GetModuleList());
- EXPECT_FALSE(minidump.GetMemoryList());
- EXPECT_FALSE(minidump.GetException());
- EXPECT_FALSE(minidump.GetAssertion());
- EXPECT_FALSE(minidump.GetSystemInfo());
- EXPECT_FALSE(minidump.GetMiscInfo());
- EXPECT_FALSE(minidump.GetBreakpadInfo());
-}
-
-TEST(Dump, OneMemory) {
- Dump dump(0, kBigEndian);
- Memory memory(dump, 0x309d68010bd21b2cULL);
- memory.Append("memory contents");
- dump.Add(&memory);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
- ASSERT_TRUE(dir != NULL);
- EXPECT_EQ((uint32_t) MD_MEMORY_LIST_STREAM, dir->stream_type);
-
- MinidumpMemoryList *memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(memory_list != NULL);
- ASSERT_EQ(1U, memory_list->region_count());
-
- MinidumpMemoryRegion *region1 = memory_list->GetMemoryRegionAtIndex(0);
- ASSERT_EQ(0x309d68010bd21b2cULL, region1->GetBase());
- ASSERT_EQ(15U, region1->GetSize());
- const uint8_t *region1_bytes = region1->GetMemory();
- ASSERT_TRUE(memcmp("memory contents", region1_bytes, 15) == 0);
-}
-
-// One thread --- and its requisite entourage.
-TEST(Dump, OneThread) {
- Dump dump(0, kLittleEndian);
- Memory stack(dump, 0x2326a0fa);
- stack.Append("stack for thread");
-
- MDRawContextX86 raw_context;
- const uint32_t kExpectedEIP = 0x6913f540;
- raw_context.context_flags = MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL;
- raw_context.edi = 0x3ecba80d;
- raw_context.esi = 0x382583b9;
- raw_context.ebx = 0x7fccc03f;
- raw_context.edx = 0xf62f8ec2;
- raw_context.ecx = 0x46a6a6a8;
- raw_context.eax = 0x6a5025e2;
- raw_context.ebp = 0xd9fabb4a;
- raw_context.eip = kExpectedEIP;
- raw_context.cs = 0xbffe6eda;
- raw_context.eflags = 0xb2ce1e2d;
- raw_context.esp = 0x659caaa4;
- raw_context.ss = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Thread thread(dump, 0xa898f11b, stack, context,
- 0x9e39439f, 0x4abfc15f, 0xe499898a, 0x0d43e939dcfd0372ULL);
-
- dump.Add(&stack);
- dump.Add(&context);
- dump.Add(&thread);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- MinidumpMemoryList *md_memory_list = minidump.GetMemoryList();
- ASSERT_TRUE(md_memory_list != NULL);
- ASSERT_EQ(1U, md_memory_list->region_count());
-
- MinidumpMemoryRegion *md_region = md_memory_list->GetMemoryRegionAtIndex(0);
- ASSERT_EQ(0x2326a0faU, md_region->GetBase());
- ASSERT_EQ(16U, md_region->GetSize());
- const uint8_t *region_bytes = md_region->GetMemory();
- ASSERT_TRUE(memcmp("stack for thread", region_bytes, 16) == 0);
-
- MinidumpThreadList *thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list != NULL);
- ASSERT_EQ(1U, thread_list->thread_count());
-
- MinidumpThread *md_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(md_thread != NULL);
- uint32_t thread_id;
- ASSERT_TRUE(md_thread->GetThreadID(&thread_id));
- ASSERT_EQ(0xa898f11bU, thread_id);
- MinidumpMemoryRegion *md_stack = md_thread->GetMemory();
- ASSERT_TRUE(md_stack != NULL);
- ASSERT_EQ(0x2326a0faU, md_stack->GetBase());
- ASSERT_EQ(16U, md_stack->GetSize());
- const uint8_t *md_stack_bytes = md_stack->GetMemory();
- ASSERT_TRUE(memcmp("stack for thread", md_stack_bytes, 16) == 0);
-
- MinidumpContext *md_context = md_thread->GetContext();
- ASSERT_TRUE(md_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
-
- uint64_t eip;
- ASSERT_TRUE(md_context->GetInstructionPointer(&eip));
- EXPECT_EQ(kExpectedEIP, eip);
-
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
- ASSERT_TRUE(md_raw_context != NULL);
- ASSERT_EQ((uint32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),
- (md_raw_context->context_flags
- & (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL)));
- EXPECT_EQ(0x3ecba80dU, raw_context.edi);
- EXPECT_EQ(0x382583b9U, raw_context.esi);
- EXPECT_EQ(0x7fccc03fU, raw_context.ebx);
- EXPECT_EQ(0xf62f8ec2U, raw_context.edx);
- EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);
- EXPECT_EQ(0x6a5025e2U, raw_context.eax);
- EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);
- EXPECT_EQ(kExpectedEIP, raw_context.eip);
- EXPECT_EQ(0xbffe6edaU, raw_context.cs);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);
- EXPECT_EQ(0x659caaa4U, raw_context.esp);
- EXPECT_EQ(0x2e951ef7U, raw_context.ss);
-}
-
-TEST(Dump, ThreadMissingMemory) {
- Dump dump(0, kLittleEndian);
- Memory stack(dump, 0x2326a0fa);
- // Stack has no contents.
-
- MDRawContextX86 raw_context;
- memset(&raw_context, 0, sizeof(raw_context));
- raw_context.context_flags = MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL;
- Context context(dump, raw_context);
-
- Thread thread(dump, 0xa898f11b, stack, context,
- 0x9e39439f, 0x4abfc15f, 0xe499898a, 0x0d43e939dcfd0372ULL);
-
- dump.Add(&stack);
- dump.Add(&context);
- dump.Add(&thread);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- // This should succeed even though the thread has no stack memory.
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list != NULL);
- ASSERT_EQ(1U, thread_list->thread_count());
-
- MinidumpThread* md_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(md_thread != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_thread->GetThreadID(&thread_id));
- ASSERT_EQ(0xa898f11bU, thread_id);
-
- MinidumpContext* md_context = md_thread->GetContext();
- ASSERT_NE(reinterpret_cast<MinidumpContext*>(NULL), md_context);
-
- MinidumpMemoryRegion* md_stack = md_thread->GetMemory();
- ASSERT_EQ(reinterpret_cast<MinidumpMemoryRegion*>(NULL), md_stack);
-}
-
-TEST(Dump, ThreadMissingContext) {
- Dump dump(0, kLittleEndian);
- Memory stack(dump, 0x2326a0fa);
- stack.Append("stack for thread");
-
- // Context is empty.
- Context context(dump);
-
- Thread thread(dump, 0xa898f11b, stack, context,
- 0x9e39439f, 0x4abfc15f, 0xe499898a, 0x0d43e939dcfd0372ULL);
-
- dump.Add(&stack);
- dump.Add(&context);
- dump.Add(&thread);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- // This should succeed even though the thread has no stack memory.
- MinidumpThreadList* thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list != NULL);
- ASSERT_EQ(1U, thread_list->thread_count());
-
- MinidumpThread* md_thread = thread_list->GetThreadAtIndex(0);
- ASSERT_TRUE(md_thread != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_thread->GetThreadID(&thread_id));
- ASSERT_EQ(0xa898f11bU, thread_id);
- MinidumpMemoryRegion* md_stack = md_thread->GetMemory();
- ASSERT_NE(reinterpret_cast<MinidumpMemoryRegion*>(NULL), md_stack);
-
- MinidumpContext* md_context = md_thread->GetContext();
- ASSERT_EQ(reinterpret_cast<MinidumpContext*>(NULL), md_context);
-}
-
-static const MDVSFixedFileInfo fixed_file_info = {
- 0xb2fba33a, // signature
- 0x33d7a728, // struct_version
- 0x31afcb20, // file_version_hi
- 0xe51cdab1, // file_version_lo
- 0xd1ea6907, // product_version_hi
- 0x03032857, // product_version_lo
- 0x11bf71d7, // file_flags_mask
- 0x5fb8cdbf, // file_flags
- 0xe45d0d5d, // file_os
- 0x107d9562, // file_type
- 0x5a8844d4, // file_subtype
- 0xa8d30b20, // file_date_hi
- 0x651c3e4e // file_date_lo
-};
-
-TEST(Dump, OneModule) {
- Dump dump(0, kBigEndian);
- String module_name(dump, "single module");
- Section cv_info(dump);
- cv_info
- .D32(MD_CVINFOPDB70_SIGNATURE) // signature
- // signature, a MDGUID
- .D32(0xabcd1234)
- .D16(0xf00d)
- .D16(0xbeef)
- .Append("\x01\x02\x03\x04\x05\x06\x07\x08")
- .D32(1) // age
- .AppendCString("c:\\foo\\file.pdb"); // pdb_file_name
-
- String csd_version(dump, "Windows 9000");
- SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);
-
- Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
- module_name,
- 0xb1054d2a,
- 0x34571371,
- fixed_file_info, // from synth_minidump_unittest_data.h
- &cv_info, nullptr);
-
- dump.Add(&module);
- dump.Add(&module_name);
- dump.Add(&cv_info);
- dump.Add(&system_info);
- dump.Add(&csd_version);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(1);
- ASSERT_TRUE(dir != NULL);
- EXPECT_EQ((uint32_t) MD_MODULE_LIST_STREAM, dir->stream_type);
-
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
- ASSERT_TRUE(md_module_list != NULL);
- ASSERT_EQ(1U, md_module_list->module_count());
-
- const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
- ASSERT_TRUE(md_module != NULL);
- ASSERT_EQ(0xa90206ca83eb2852ULL, md_module->base_address());
- ASSERT_EQ(0xada542bd, md_module->size());
- ASSERT_EQ("single module", md_module->code_file());
- ASSERT_EQ("c:\\foo\\file.pdb", md_module->debug_file());
- // time_date_stamp and size_of_image concatenated
- ASSERT_EQ("B1054D2Aada542bd", md_module->code_identifier());
- ASSERT_EQ("ABCD1234F00DBEEF01020304050607081", md_module->debug_identifier());
-
- const MDRawModule *md_raw_module = md_module->module();
- ASSERT_TRUE(md_raw_module != NULL);
- ASSERT_EQ(0xb1054d2aU, md_raw_module->time_date_stamp);
- ASSERT_EQ(0x34571371U, md_raw_module->checksum);
- ASSERT_TRUE(memcmp(&md_raw_module->version_info, &fixed_file_info,
- sizeof(fixed_file_info)) == 0);
-}
-
-// Test that a module with a MDCVInfoELF CV record is handled properly.
-TEST(Dump, OneModuleCVELF) {
- Dump dump(0, kLittleEndian);
- String module_name(dump, "elf module");
- Section cv_info(dump);
- cv_info
- .D32(MD_CVINFOELF_SIGNATURE) // signature
- // build_id
- .Append("\x5f\xa9\xcd\xb4\x10\x53\xdf\x1b\x86\xfa\xb7\x33\xb4\xdf"
- "\x37\x38\xce\xa3\x4a\x87");
-
- const MDRawSystemInfo linux_x86 = {
- MD_CPU_ARCHITECTURE_X86, // processor_architecture
- 6, // processor_level
- 0xd08, // processor_revision
- 1, // number_of_processors
- 0, // product_type
- 0, // major_version
- 0, // minor_version
- 0, // build_number
- MD_OS_LINUX, // platform_id
- 0xdeadbeef, // csd_version_rva
- 0x100, // suite_mask
- 0, // reserved2
- { // cpu
- { // x86_cpu_info
- { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
- 0x6d8, // version_information
- 0xafe9fbff, // feature_information
- 0xffffffff // amd_extended_cpu_features
- }
- }
- };
- String csd_version(dump, "Literally Linux");
- SystemInfo system_info(dump, linux_x86, csd_version);
-
- Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
- module_name,
- 0xb1054d2a,
- 0x34571371,
- fixed_file_info, // from synth_minidump_unittest_data.h
- &cv_info, nullptr);
-
- dump.Add(&module);
- dump.Add(&module_name);
- dump.Add(&cv_info);
- dump.Add(&system_info);
- dump.Add(&csd_version);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
-
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
- ASSERT_TRUE(md_module_list != NULL);
- ASSERT_EQ(1U, md_module_list->module_count());
-
- const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
- ASSERT_TRUE(md_module != NULL);
- ASSERT_EQ(0xa90206ca83eb2852ULL, md_module->base_address());
- ASSERT_EQ(0xada542bd, md_module->size());
- ASSERT_EQ("elf module", md_module->code_file());
- // debug_file == code_file
- ASSERT_EQ("elf module", md_module->debug_file());
- // just the build_id, directly
- ASSERT_EQ("5fa9cdb41053df1b86fab733b4df3738cea34a87",
- md_module->code_identifier());
- // build_id truncted to GUID length and treated as such, with zero
- // age appended
- ASSERT_EQ("B4CDA95F53101BDF86FAB733B4DF37380", md_module->debug_identifier());
-
- const MDRawModule *md_raw_module = md_module->module();
- ASSERT_TRUE(md_raw_module != NULL);
- ASSERT_EQ(0xb1054d2aU, md_raw_module->time_date_stamp);
- ASSERT_EQ(0x34571371U, md_raw_module->checksum);
- ASSERT_TRUE(memcmp(&md_raw_module->version_info, &fixed_file_info,
- sizeof(fixed_file_info)) == 0);
-}
-
-// Test that a build_id that's shorter than a GUID is handled properly.
-TEST(Dump, CVELFShort) {
- Dump dump(0, kLittleEndian);
- String module_name(dump, "elf module");
- Section cv_info(dump);
- cv_info
- .D32(MD_CVINFOELF_SIGNATURE) // signature
- // build_id, shorter than a GUID
- .Append("\x5f\xa9\xcd\xb4");
-
- const MDRawSystemInfo linux_x86 = {
- MD_CPU_ARCHITECTURE_X86, // processor_architecture
- 6, // processor_level
- 0xd08, // processor_revision
- 1, // number_of_processors
- 0, // product_type
- 0, // major_version
- 0, // minor_version
- 0, // build_number
- MD_OS_LINUX, // platform_id
- 0xdeadbeef, // csd_version_rva
- 0x100, // suite_mask
- 0, // reserved2
- { // cpu
- { // x86_cpu_info
- { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
- 0x6d8, // version_information
- 0xafe9fbff, // feature_information
- 0xffffffff // amd_extended_cpu_features
- }
- }
- };
- String csd_version(dump, "Literally Linux");
- SystemInfo system_info(dump, linux_x86, csd_version);
-
- Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
- module_name,
- 0xb1054d2a,
- 0x34571371,
- fixed_file_info, // from synth_minidump_unittest_data.h
- &cv_info, nullptr);
-
- dump.Add(&module);
- dump.Add(&module_name);
- dump.Add(&cv_info);
- dump.Add(&system_info);
- dump.Add(&csd_version);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
- ASSERT_TRUE(md_module_list != NULL);
- ASSERT_EQ(1U, md_module_list->module_count());
-
- const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
- ASSERT_TRUE(md_module != NULL);
- // just the build_id, directly
- ASSERT_EQ("5fa9cdb4", md_module->code_identifier());
- // build_id expanded to GUID length and treated as such, with zero
- // age appended
- ASSERT_EQ("B4CDA95F0000000000000000000000000", md_module->debug_identifier());
-}
-
-// Test that a build_id that's very long is handled properly.
-TEST(Dump, CVELFLong) {
- Dump dump(0, kLittleEndian);
- String module_name(dump, "elf module");
- Section cv_info(dump);
- cv_info
- .D32(MD_CVINFOELF_SIGNATURE) // signature
- // build_id, lots of bytes
- .Append("\x5f\xa9\xcd\xb4\x10\x53\xdf\x1b\x86\xfa\xb7\x33\xb4\xdf"
- "\x37\x38\xce\xa3\x4a\x87\x01\x02\x03\x04\x05\x06\x07\x08"
- "\x09\x0a\x0b\x0c\x0d\x0e\x0f");
-
-
- const MDRawSystemInfo linux_x86 = {
- MD_CPU_ARCHITECTURE_X86, // processor_architecture
- 6, // processor_level
- 0xd08, // processor_revision
- 1, // number_of_processors
- 0, // product_type
- 0, // major_version
- 0, // minor_version
- 0, // build_number
- MD_OS_LINUX, // platform_id
- 0xdeadbeef, // csd_version_rva
- 0x100, // suite_mask
- 0, // reserved2
- { // cpu
- { // x86_cpu_info
- { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
- 0x6d8, // version_information
- 0xafe9fbff, // feature_information
- 0xffffffff // amd_extended_cpu_features
- }
- }
- };
- String csd_version(dump, "Literally Linux");
- SystemInfo system_info(dump, linux_x86, csd_version);
-
- Module module(dump, 0xa90206ca83eb2852ULL, 0xada542bd,
- module_name,
- 0xb1054d2a,
- 0x34571371,
- fixed_file_info, // from synth_minidump_unittest_data.h
- &cv_info, nullptr);
-
- dump.Add(&module);
- dump.Add(&module_name);
- dump.Add(&cv_info);
- dump.Add(&system_info);
- dump.Add(&csd_version);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
- ASSERT_TRUE(md_module_list != NULL);
- ASSERT_EQ(1U, md_module_list->module_count());
-
- const MinidumpModule *md_module = md_module_list->GetModuleAtIndex(0);
- ASSERT_TRUE(md_module != NULL);
- // just the build_id, directly
- ASSERT_EQ(
- "5fa9cdb41053df1b86fab733b4df3738cea34a870102030405060708090a0b0c0d0e0f",
- md_module->code_identifier());
- // build_id truncated to GUID length and treated as such, with zero
- // age appended.
- ASSERT_EQ("B4CDA95F53101BDF86FAB733B4DF37380", md_module->debug_identifier());
-}
-
-TEST(Dump, OneSystemInfo) {
- Dump dump(0, kLittleEndian);
- String csd_version(dump, "Petulant Pierogi");
- SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);
-
- dump.Add(&system_info);
- dump.Add(&csd_version);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
- ASSERT_TRUE(dir != NULL);
- EXPECT_EQ((uint32_t) MD_SYSTEM_INFO_STREAM, dir->stream_type);
-
- MinidumpSystemInfo *md_system_info = minidump.GetSystemInfo();
- ASSERT_TRUE(md_system_info != NULL);
- ASSERT_EQ("windows", md_system_info->GetOS());
- ASSERT_EQ("x86", md_system_info->GetCPU());
- ASSERT_EQ("Petulant Pierogi", *md_system_info->GetCSDVersion());
- ASSERT_EQ("GenuineIntel", *md_system_info->GetCPUVendor());
-}
-
-TEST(Dump, BigDump) {
- Dump dump(0, kLittleEndian);
-
- // A SystemInfo stream.
- String csd_version(dump, "Munificent Macaque");
- SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);
- dump.Add(&csd_version);
- dump.Add(&system_info);
-
- // Five threads!
- Memory stack0(dump, 0x70b9ebfc);
- stack0.Append("stack for thread zero");
- MDRawContextX86 raw_context0;
- raw_context0.context_flags = MD_CONTEXT_X86_INTEGER;
- raw_context0.eip = 0xaf0709e4;
- Context context0(dump, raw_context0);
- Thread thread0(dump, 0xbbef4432, stack0, context0,
- 0xd0377e7b, 0xdb8eb0cf, 0xd73bc314, 0x09d357bac7f9a163ULL);
- dump.Add(&stack0);
- dump.Add(&context0);
- dump.Add(&thread0);
-
- Memory stack1(dump, 0xf988cc45);
- stack1.Append("stack for thread one");
- MDRawContextX86 raw_context1;
- raw_context1.context_flags = MD_CONTEXT_X86_INTEGER;
- raw_context1.eip = 0xe4f56f81;
- Context context1(dump, raw_context1);
- Thread thread1(dump, 0x657c3f58, stack1, context1,
- 0xa68fa182, 0x6f3cf8dd, 0xe3a78ccf, 0x78cc84775e4534bbULL);
- dump.Add(&stack1);
- dump.Add(&context1);
- dump.Add(&thread1);
-
- Memory stack2(dump, 0xc8a92e7c);
- stack2.Append("stack for thread two");
- MDRawContextX86 raw_context2;
- raw_context2.context_flags = MD_CONTEXT_X86_INTEGER;
- raw_context2.eip = 0xb336a438;
- Context context2(dump, raw_context2);
- Thread thread2(dump, 0xdf4b8a71, stack2, context2,
- 0x674c26b6, 0x445d7120, 0x7e700c56, 0xd89bf778e7793e17ULL);
- dump.Add(&stack2);
- dump.Add(&context2);
- dump.Add(&thread2);
-
- Memory stack3(dump, 0x36d08e08);
- stack3.Append("stack for thread three");
- MDRawContextX86 raw_context3;
- raw_context3.context_flags = MD_CONTEXT_X86_INTEGER;
- raw_context3.eip = 0xdf99a60c;
- Context context3(dump, raw_context3);
- Thread thread3(dump, 0x86e6c341, stack3, context3,
- 0x32dc5c55, 0x17a2aba8, 0xe0cc75e7, 0xa46393994dae83aeULL);
- dump.Add(&stack3);
- dump.Add(&context3);
- dump.Add(&thread3);
-
- Memory stack4(dump, 0x1e0ab4fa);
- stack4.Append("stack for thread four");
- MDRawContextX86 raw_context4;
- raw_context4.context_flags = MD_CONTEXT_X86_INTEGER;
- raw_context4.eip = 0xaa646267;
- Context context4(dump, raw_context4);
- Thread thread4(dump, 0x261a28d4, stack4, context4,
- 0x6ebd389e, 0xa0cd4759, 0x30168846, 0x164f650a0cf39d35ULL);
- dump.Add(&stack4);
- dump.Add(&context4);
- dump.Add(&thread4);
-
- // Three modules!
- String module1_name(dump, "module one");
- Module module1(dump, 0xeb77da57b5d4cbdaULL, 0x83cd5a37, module1_name);
- dump.Add(&module1_name);
- dump.Add(&module1);
-
- String module2_name(dump, "module two");
- Module module2(dump, 0x8675884adfe5ac90ULL, 0xb11e4ea3, module2_name);
- dump.Add(&module2_name);
- dump.Add(&module2);
-
- String module3_name(dump, "module three");
- Module module3(dump, 0x95fc1544da321b6cULL, 0x7c2bf081, module3_name);
- dump.Add(&module3_name);
- dump.Add(&module3);
-
- // Add one more memory region, on top of the five stacks.
- Memory memory5(dump, 0x61979e828040e564ULL);
- memory5.Append("contents of memory 5");
- dump.Add(&memory5);
-
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(4U, minidump.GetDirectoryEntryCount());
-
- // Check the threads.
- MinidumpThreadList *thread_list = minidump.GetThreadList();
- ASSERT_TRUE(thread_list != NULL);
- ASSERT_EQ(5U, thread_list->thread_count());
- uint32_t thread_id;
- ASSERT_TRUE(thread_list->GetThreadAtIndex(0)->GetThreadID(&thread_id));
- ASSERT_EQ(0xbbef4432U, thread_id);
- ASSERT_EQ(0x70b9ebfcU,
- thread_list->GetThreadAtIndex(0)->GetMemory()->GetBase());
- ASSERT_EQ(0xaf0709e4U,
- thread_list->GetThreadAtIndex(0)->GetContext()->GetContextX86()
- ->eip);
-
- ASSERT_TRUE(thread_list->GetThreadAtIndex(1)->GetThreadID(&thread_id));
- ASSERT_EQ(0x657c3f58U, thread_id);
- ASSERT_EQ(0xf988cc45U,
- thread_list->GetThreadAtIndex(1)->GetMemory()->GetBase());
- ASSERT_EQ(0xe4f56f81U,
- thread_list->GetThreadAtIndex(1)->GetContext()->GetContextX86()
- ->eip);
-
- ASSERT_TRUE(thread_list->GetThreadAtIndex(2)->GetThreadID(&thread_id));
- ASSERT_EQ(0xdf4b8a71U, thread_id);
- ASSERT_EQ(0xc8a92e7cU,
- thread_list->GetThreadAtIndex(2)->GetMemory()->GetBase());
- ASSERT_EQ(0xb336a438U,
- thread_list->GetThreadAtIndex(2)->GetContext()->GetContextX86()
- ->eip);
-
- ASSERT_TRUE(thread_list->GetThreadAtIndex(3)->GetThreadID(&thread_id));
- ASSERT_EQ(0x86e6c341U, thread_id);
- ASSERT_EQ(0x36d08e08U,
- thread_list->GetThreadAtIndex(3)->GetMemory()->GetBase());
- ASSERT_EQ(0xdf99a60cU,
- thread_list->GetThreadAtIndex(3)->GetContext()->GetContextX86()
- ->eip);
-
- ASSERT_TRUE(thread_list->GetThreadAtIndex(4)->GetThreadID(&thread_id));
- ASSERT_EQ(0x261a28d4U, thread_id);
- ASSERT_EQ(0x1e0ab4faU,
- thread_list->GetThreadAtIndex(4)->GetMemory()->GetBase());
- ASSERT_EQ(0xaa646267U,
- thread_list->GetThreadAtIndex(4)->GetContext()->GetContextX86()
- ->eip);
-
- // Check the modules.
- MinidumpModuleList *md_module_list = minidump.GetModuleList();
- ASSERT_TRUE(md_module_list != NULL);
- ASSERT_EQ(3U, md_module_list->module_count());
- EXPECT_EQ(0xeb77da57b5d4cbdaULL,
- md_module_list->GetModuleAtIndex(0)->base_address());
- EXPECT_EQ(0x8675884adfe5ac90ULL,
- md_module_list->GetModuleAtIndex(1)->base_address());
- EXPECT_EQ(0x95fc1544da321b6cULL,
- md_module_list->GetModuleAtIndex(2)->base_address());
-}
-
-TEST(Dump, OneMemoryInfo) {
- Dump dump(0, kBigEndian);
- Stream stream(dump, MD_MEMORY_INFO_LIST_STREAM);
-
- // Add the MDRawMemoryInfoList header.
- const uint64_t kNumberOfEntries = 1;
- stream.D32(sizeof(MDRawMemoryInfoList)) // size_of_header
- .D32(sizeof(MDRawMemoryInfo)) // size_of_entry
- .D64(kNumberOfEntries); // number_of_entries
-
-
- // Now add a MDRawMemoryInfo entry.
- const uint64_t kBaseAddress = 0x1000;
- const uint64_t kRegionSize = 0x2000;
- stream.D64(kBaseAddress) // base_address
- .D64(kBaseAddress) // allocation_base
- .D32(MD_MEMORY_PROTECT_EXECUTE_READWRITE) // allocation_protection
- .D32(0) // __alignment1
- .D64(kRegionSize) // region_size
- .D32(MD_MEMORY_STATE_COMMIT) // state
- .D32(MD_MEMORY_PROTECT_EXECUTE_READWRITE) // protection
- .D32(MD_MEMORY_TYPE_PRIVATE) // type
- .D32(0); // __alignment2
-
- dump.Add(&stream);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- const MDRawDirectory *dir = minidump.GetDirectoryEntryAtIndex(0);
- ASSERT_TRUE(dir != NULL);
- EXPECT_EQ((uint32_t) MD_MEMORY_INFO_LIST_STREAM, dir->stream_type);
-
- MinidumpMemoryInfoList *info_list = minidump.GetMemoryInfoList();
- ASSERT_TRUE(info_list != NULL);
- ASSERT_EQ(1U, info_list->info_count());
-
- const MinidumpMemoryInfo *info1 = info_list->GetMemoryInfoAtIndex(0);
- ASSERT_EQ(kBaseAddress, info1->GetBase());
- ASSERT_EQ(kRegionSize, info1->GetSize());
- ASSERT_TRUE(info1->IsExecutable());
- ASSERT_TRUE(info1->IsWritable());
-
- // Should get back the same memory region here.
- const MinidumpMemoryInfo *info2 =
- info_list->GetMemoryInfoForAddress(kBaseAddress + kRegionSize / 2);
- ASSERT_EQ(kBaseAddress, info2->GetBase());
- ASSERT_EQ(kRegionSize, info2->GetSize());
-}
-
-TEST(Dump, OneExceptionX86) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextX86 raw_context;
- raw_context.context_flags = MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL;
- raw_context.edi = 0x3ecba80d;
- raw_context.esi = 0x382583b9;
- raw_context.ebx = 0x7fccc03f;
- raw_context.edx = 0xf62f8ec2;
- raw_context.ecx = 0x46a6a6a8;
- raw_context.eax = 0x6a5025e2;
- raw_context.ebp = 0xd9fabb4a;
- raw_context.eip = 0x6913f540;
- raw_context.cs = 0xbffe6eda;
- raw_context.eflags = 0xb2ce1e2d;
- raw_context.esp = 0x659caaa4;
- raw_context.ss = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
-
- dump.Add(&context);
- dump.Add(&exception);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
- raw_exception->exception_record.exception_address);
-
- MinidumpContext *md_context = md_exception->GetContext();
- ASSERT_TRUE(md_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
- ASSERT_TRUE(md_raw_context != NULL);
- ASSERT_EQ((uint32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),
- (md_raw_context->context_flags
- & (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL)));
- EXPECT_EQ(0x3ecba80dU, raw_context.edi);
- EXPECT_EQ(0x382583b9U, raw_context.esi);
- EXPECT_EQ(0x7fccc03fU, raw_context.ebx);
- EXPECT_EQ(0xf62f8ec2U, raw_context.edx);
- EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);
- EXPECT_EQ(0x6a5025e2U, raw_context.eax);
- EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);
- EXPECT_EQ(0x6913f540U, raw_context.eip);
- EXPECT_EQ(0xbffe6edaU, raw_context.cs);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);
- EXPECT_EQ(0x659caaa4U, raw_context.esp);
- EXPECT_EQ(0x2e951ef7U, raw_context.ss);
-}
-
-TEST(Dump, OneExceptionX86XState) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextX86 raw_context;
- raw_context.context_flags = MD_CONTEXT_X86_INTEGER |
- MD_CONTEXT_X86_CONTROL | MD_CONTEXT_X86_XSTATE;
- raw_context.edi = 0x3ecba80d;
- raw_context.esi = 0x382583b9;
- raw_context.ebx = 0x7fccc03f;
- raw_context.edx = 0xf62f8ec2;
- raw_context.ecx = 0x46a6a6a8;
- raw_context.eax = 0x6a5025e2;
- raw_context.ebp = 0xd9fabb4a;
- raw_context.eip = 0x6913f540;
- raw_context.cs = 0xbffe6eda;
- raw_context.eflags = 0xb2ce1e2d;
- raw_context.esp = 0x659caaa4;
- raw_context.ss = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
-
- dump.Add(&context);
- dump.Add(&exception);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
- raw_exception->exception_record.exception_address);
-
- MinidumpContext *md_context = md_exception->GetContext();
- ASSERT_TRUE(md_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
- ASSERT_TRUE(md_raw_context != NULL);
- ASSERT_EQ((uint32_t) (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL),
- (md_raw_context->context_flags
- & (MD_CONTEXT_X86_INTEGER | MD_CONTEXT_X86_CONTROL)));
- EXPECT_EQ(0x3ecba80dU, raw_context.edi);
- EXPECT_EQ(0x382583b9U, raw_context.esi);
- EXPECT_EQ(0x7fccc03fU, raw_context.ebx);
- EXPECT_EQ(0xf62f8ec2U, raw_context.edx);
- EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);
- EXPECT_EQ(0x6a5025e2U, raw_context.eax);
- EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);
- EXPECT_EQ(0x6913f540U, raw_context.eip);
- EXPECT_EQ(0xbffe6edaU, raw_context.cs);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);
- EXPECT_EQ(0x659caaa4U, raw_context.esp);
- EXPECT_EQ(0x2e951ef7U, raw_context.ss);
-}
-
-// Testing that the CPU type can be loaded from a system info stream when
-// the CPU flags are missing from the context_flags of an exception record
-TEST(Dump, OneExceptionX86NoCPUFlags) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextX86 raw_context;
- // Intentionally not setting CPU type in the context_flags
- raw_context.context_flags = 0;
- raw_context.edi = 0x3ecba80d;
- raw_context.esi = 0x382583b9;
- raw_context.ebx = 0x7fccc03f;
- raw_context.edx = 0xf62f8ec2;
- raw_context.ecx = 0x46a6a6a8;
- raw_context.eax = 0x6a5025e2;
- raw_context.ebp = 0xd9fabb4a;
- raw_context.eip = 0x6913f540;
- raw_context.cs = 0xbffe6eda;
- raw_context.eflags = 0xb2ce1e2d;
- raw_context.esp = 0x659caaa4;
- raw_context.ss = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
-
- dump.Add(&context);
- dump.Add(&exception);
-
- // Add system info. This is needed as an alternative source for CPU type
- // information. Note, that the CPU flags were intentionally skipped from
- // the context_flags and this alternative source is required.
- String csd_version(dump, "Service Pack 2");
- SystemInfo system_info(dump, SystemInfo::windows_x86, csd_version);
- dump.Add(&system_info);
- dump.Add(&csd_version);
-
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(2U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
- raw_exception->exception_record.exception_address);
-
- MinidumpContext *md_context = md_exception->GetContext();
- ASSERT_TRUE(md_context != NULL);
-
- ASSERT_EQ((uint32_t) MD_CONTEXT_X86, md_context->GetContextCPU());
- const MDRawContextX86 *md_raw_context = md_context->GetContextX86();
- ASSERT_TRUE(md_raw_context != NULL);
-
- // Even though the CPU flags were missing from the context_flags, the
- // GetContext call above is expected to load the missing CPU flags from the
- // system info stream and set the CPU type bits in context_flags.
- ASSERT_EQ((uint32_t) (MD_CONTEXT_X86), md_raw_context->context_flags);
-
- EXPECT_EQ(0x3ecba80dU, raw_context.edi);
- EXPECT_EQ(0x382583b9U, raw_context.esi);
- EXPECT_EQ(0x7fccc03fU, raw_context.ebx);
- EXPECT_EQ(0xf62f8ec2U, raw_context.edx);
- EXPECT_EQ(0x46a6a6a8U, raw_context.ecx);
- EXPECT_EQ(0x6a5025e2U, raw_context.eax);
- EXPECT_EQ(0xd9fabb4aU, raw_context.ebp);
- EXPECT_EQ(0x6913f540U, raw_context.eip);
- EXPECT_EQ(0xbffe6edaU, raw_context.cs);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.eflags);
- EXPECT_EQ(0x659caaa4U, raw_context.esp);
- EXPECT_EQ(0x2e951ef7U, raw_context.ss);
-}
-
-// This test covers a scenario where a dump contains an exception but the
-// context record of the exception is missing the CPU type information in its
-// context_flags. The dump has no system info stream so it is imposible to
-// deduce the CPU type, hence the context record is unusable.
-TEST(Dump, OneExceptionX86NoCPUFlagsNoSystemInfo) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextX86 raw_context;
- // Intentionally not setting CPU type in the context_flags
- raw_context.context_flags = 0;
- raw_context.edi = 0x3ecba80d;
- raw_context.esi = 0x382583b9;
- raw_context.ebx = 0x7fccc03f;
- raw_context.edx = 0xf62f8ec2;
- raw_context.ecx = 0x46a6a6a8;
- raw_context.eax = 0x6a5025e2;
- raw_context.ebp = 0xd9fabb4a;
- raw_context.eip = 0x6913f540;
- raw_context.cs = 0xbffe6eda;
- raw_context.eflags = 0xb2ce1e2d;
- raw_context.esp = 0x659caaa4;
- raw_context.ss = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
-
- dump.Add(&context);
- dump.Add(&exception);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
- raw_exception->exception_record.exception_address);
-
- // The context record of the exception is unusable because the context_flags
- // don't have CPU type information and at the same time the minidump lacks
- // system info stream so it is impossible to deduce the CPU type.
- MinidumpContext *md_context = md_exception->GetContext();
- ASSERT_EQ(NULL, md_context);
-}
-
-TEST(Dump, OneExceptionARM) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextARM raw_context;
- raw_context.context_flags = MD_CONTEXT_ARM_INTEGER;
- raw_context.iregs[0] = 0x3ecba80d;
- raw_context.iregs[1] = 0x382583b9;
- raw_context.iregs[2] = 0x7fccc03f;
- raw_context.iregs[3] = 0xf62f8ec2;
- raw_context.iregs[4] = 0x46a6a6a8;
- raw_context.iregs[5] = 0x6a5025e2;
- raw_context.iregs[6] = 0xd9fabb4a;
- raw_context.iregs[7] = 0x6913f540;
- raw_context.iregs[8] = 0xbffe6eda;
- raw_context.iregs[9] = 0xb2ce1e2d;
- raw_context.iregs[10] = 0x659caaa4;
- raw_context.iregs[11] = 0xf0e0d0c0;
- raw_context.iregs[12] = 0xa9b8c7d6;
- raw_context.iregs[13] = 0x12345678;
- raw_context.iregs[14] = 0xabcd1234;
- raw_context.iregs[15] = 0x10203040;
- raw_context.cpsr = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
-
- dump.Add(&context);
- dump.Add(&exception);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
- raw_exception->exception_record.exception_address);
-
- MinidumpContext *md_context = md_exception->GetContext();
- ASSERT_TRUE(md_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_ARM, md_context->GetContextCPU());
- const MDRawContextARM *md_raw_context = md_context->GetContextARM();
- ASSERT_TRUE(md_raw_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_ARM_INTEGER,
- (md_raw_context->context_flags
- & MD_CONTEXT_ARM_INTEGER));
- EXPECT_EQ(0x3ecba80dU, raw_context.iregs[0]);
- EXPECT_EQ(0x382583b9U, raw_context.iregs[1]);
- EXPECT_EQ(0x7fccc03fU, raw_context.iregs[2]);
- EXPECT_EQ(0xf62f8ec2U, raw_context.iregs[3]);
- EXPECT_EQ(0x46a6a6a8U, raw_context.iregs[4]);
- EXPECT_EQ(0x6a5025e2U, raw_context.iregs[5]);
- EXPECT_EQ(0xd9fabb4aU, raw_context.iregs[6]);
- EXPECT_EQ(0x6913f540U, raw_context.iregs[7]);
- EXPECT_EQ(0xbffe6edaU, raw_context.iregs[8]);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.iregs[9]);
- EXPECT_EQ(0x659caaa4U, raw_context.iregs[10]);
- EXPECT_EQ(0xf0e0d0c0U, raw_context.iregs[11]);
- EXPECT_EQ(0xa9b8c7d6U, raw_context.iregs[12]);
- EXPECT_EQ(0x12345678U, raw_context.iregs[13]);
- EXPECT_EQ(0xabcd1234U, raw_context.iregs[14]);
- EXPECT_EQ(0x10203040U, raw_context.iregs[15]);
- EXPECT_EQ(0x2e951ef7U, raw_context.cpsr);
-}
-
-TEST(Dump, OneExceptionARMOldFlags) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextARM raw_context;
- // MD_CONTEXT_ARM_INTEGER, but with _OLD
- raw_context.context_flags = MD_CONTEXT_ARM_OLD | 0x00000002;
- raw_context.iregs[0] = 0x3ecba80d;
- raw_context.iregs[1] = 0x382583b9;
- raw_context.iregs[2] = 0x7fccc03f;
- raw_context.iregs[3] = 0xf62f8ec2;
- raw_context.iregs[4] = 0x46a6a6a8;
- raw_context.iregs[5] = 0x6a5025e2;
- raw_context.iregs[6] = 0xd9fabb4a;
- raw_context.iregs[7] = 0x6913f540;
- raw_context.iregs[8] = 0xbffe6eda;
- raw_context.iregs[9] = 0xb2ce1e2d;
- raw_context.iregs[10] = 0x659caaa4;
- raw_context.iregs[11] = 0xf0e0d0c0;
- raw_context.iregs[12] = 0xa9b8c7d6;
- raw_context.iregs[13] = 0x12345678;
- raw_context.iregs[14] = 0xabcd1234;
- raw_context.iregs[15] = 0x10203040;
- raw_context.cpsr = 0x2e951ef7;
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
-
- dump.Add(&context);
- dump.Add(&exception);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9c9d9e9f9ULL,
- raw_exception->exception_record.exception_address);
-
- MinidumpContext *md_context = md_exception->GetContext();
- ASSERT_TRUE(md_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_ARM, md_context->GetContextCPU());
- const MDRawContextARM *md_raw_context = md_context->GetContextARM();
- ASSERT_TRUE(md_raw_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_ARM_INTEGER,
- (md_raw_context->context_flags
- & MD_CONTEXT_ARM_INTEGER));
- EXPECT_EQ(0x3ecba80dU, raw_context.iregs[0]);
- EXPECT_EQ(0x382583b9U, raw_context.iregs[1]);
- EXPECT_EQ(0x7fccc03fU, raw_context.iregs[2]);
- EXPECT_EQ(0xf62f8ec2U, raw_context.iregs[3]);
- EXPECT_EQ(0x46a6a6a8U, raw_context.iregs[4]);
- EXPECT_EQ(0x6a5025e2U, raw_context.iregs[5]);
- EXPECT_EQ(0xd9fabb4aU, raw_context.iregs[6]);
- EXPECT_EQ(0x6913f540U, raw_context.iregs[7]);
- EXPECT_EQ(0xbffe6edaU, raw_context.iregs[8]);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.iregs[9]);
- EXPECT_EQ(0x659caaa4U, raw_context.iregs[10]);
- EXPECT_EQ(0xf0e0d0c0U, raw_context.iregs[11]);
- EXPECT_EQ(0xa9b8c7d6U, raw_context.iregs[12]);
- EXPECT_EQ(0x12345678U, raw_context.iregs[13]);
- EXPECT_EQ(0xabcd1234U, raw_context.iregs[14]);
- EXPECT_EQ(0x10203040U, raw_context.iregs[15]);
- EXPECT_EQ(0x2e951ef7U, raw_context.cpsr);
-}
-
-TEST(Dump, OneExceptionMIPS) {
- Dump dump(0, kLittleEndian);
-
- MDRawContextMIPS raw_context;
- raw_context.context_flags = MD_CONTEXT_MIPS_INTEGER;
- raw_context.iregs[0] = 0x3ecba80d;
- raw_context.iregs[1] = 0x382583b9;
- raw_context.iregs[2] = 0x7fccc03f;
- raw_context.iregs[3] = 0xf62f8ec2;
- raw_context.iregs[4] = 0x46a6a6a8;
- raw_context.iregs[5] = 0x6a5025e2;
- raw_context.iregs[6] = 0xd9fabb4a;
- raw_context.iregs[7] = 0x6913f540;
- raw_context.iregs[8] = 0xbffe6eda;
- raw_context.iregs[9] = 0xb2ce1e2d;
- raw_context.iregs[10] = 0x659caaa4;
- raw_context.iregs[11] = 0xf0e0d0c0;
- raw_context.iregs[12] = 0xa9b8c7d6;
- raw_context.iregs[13] = 0x12345678;
- raw_context.iregs[14] = 0xabcd1234;
- raw_context.iregs[15] = 0x10203040;
- raw_context.iregs[16] = 0xa80d3ecb;
- raw_context.iregs[17] = 0x83b93825;
- raw_context.iregs[18] = 0xc03f7fcc;
- raw_context.iregs[19] = 0x8ec2f62f;
- raw_context.iregs[20] = 0xa6a846a6;
- raw_context.iregs[21] = 0x25e26a50;
- raw_context.iregs[22] = 0xbb4ad9fa;
- raw_context.iregs[23] = 0xf5406913;
- raw_context.iregs[24] = 0x6edabffe;
- raw_context.iregs[25] = 0x1e2db2ce;
- raw_context.iregs[26] = 0xaaa4659c;
- raw_context.iregs[27] = 0xd0c0f0e0;
- raw_context.iregs[28] = 0xc7d6a9b8;
- raw_context.iregs[29] = 0x56781234;
- raw_context.iregs[30] = 0x1234abcd;
- raw_context.iregs[31] = 0x30401020;
-
- Context context(dump, raw_context);
-
- Exception exception(dump, context,
- 0x1234abcd, // Thread id.
- 0xdcba4321, // Exception code.
- 0xf0e0d0c0, // Exception flags.
- 0x0919a9b9); // Exception address.
-
- dump.Add(&context);
- dump.Add(&exception);
- dump.Finish();
-
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
-
- istringstream minidump_stream(contents);
- Minidump minidump(minidump_stream);
- ASSERT_TRUE(minidump.Read());
- ASSERT_EQ(1U, minidump.GetDirectoryEntryCount());
-
- MinidumpException *md_exception = minidump.GetException();
- ASSERT_TRUE(md_exception != NULL);
-
- uint32_t thread_id;
- ASSERT_TRUE(md_exception->GetThreadID(&thread_id));
- ASSERT_EQ(0x1234abcdU, thread_id);
-
- const MDRawExceptionStream* raw_exception = md_exception->exception();
- ASSERT_TRUE(raw_exception != NULL);
- EXPECT_EQ(0xdcba4321, raw_exception->exception_record.exception_code);
- EXPECT_EQ(0xf0e0d0c0, raw_exception->exception_record.exception_flags);
- EXPECT_EQ(0x0919a9b9U,
- raw_exception->exception_record.exception_address);
-
- MinidumpContext* md_context = md_exception->GetContext();
- ASSERT_TRUE(md_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_MIPS, md_context->GetContextCPU());
- const MDRawContextMIPS* md_raw_context = md_context->GetContextMIPS();
- ASSERT_TRUE(md_raw_context != NULL);
- ASSERT_EQ((uint32_t) MD_CONTEXT_MIPS_INTEGER,
- (md_raw_context->context_flags & MD_CONTEXT_MIPS_INTEGER));
- EXPECT_EQ(0x3ecba80dU, raw_context.iregs[0]);
- EXPECT_EQ(0x382583b9U, raw_context.iregs[1]);
- EXPECT_EQ(0x7fccc03fU, raw_context.iregs[2]);
- EXPECT_EQ(0xf62f8ec2U, raw_context.iregs[3]);
- EXPECT_EQ(0x46a6a6a8U, raw_context.iregs[4]);
- EXPECT_EQ(0x6a5025e2U, raw_context.iregs[5]);
- EXPECT_EQ(0xd9fabb4aU, raw_context.iregs[6]);
- EXPECT_EQ(0x6913f540U, raw_context.iregs[7]);
- EXPECT_EQ(0xbffe6edaU, raw_context.iregs[8]);
- EXPECT_EQ(0xb2ce1e2dU, raw_context.iregs[9]);
- EXPECT_EQ(0x659caaa4U, raw_context.iregs[10]);
- EXPECT_EQ(0xf0e0d0c0U, raw_context.iregs[11]);
- EXPECT_EQ(0xa9b8c7d6U, raw_context.iregs[12]);
- EXPECT_EQ(0x12345678U, raw_context.iregs[13]);
- EXPECT_EQ(0xabcd1234U, raw_context.iregs[14]);
- EXPECT_EQ(0x10203040U, raw_context.iregs[15]);
- EXPECT_EQ(0xa80d3ecbU, raw_context.iregs[16]);
- EXPECT_EQ(0x83b93825U, raw_context.iregs[17]);
- EXPECT_EQ(0xc03f7fccU, raw_context.iregs[18]);
- EXPECT_EQ(0x8ec2f62fU, raw_context.iregs[19]);
- EXPECT_EQ(0xa6a846a6U, raw_context.iregs[20]);
- EXPECT_EQ(0x25e26a50U, raw_context.iregs[21]);
- EXPECT_EQ(0xbb4ad9faU, raw_context.iregs[22]);
- EXPECT_EQ(0xf5406913U, raw_context.iregs[23]);
- EXPECT_EQ(0x6edabffeU, raw_context.iregs[24]);
- EXPECT_EQ(0x1e2db2ceU, raw_context.iregs[25]);
- EXPECT_EQ(0xaaa4659cU, raw_context.iregs[26]);
- EXPECT_EQ(0xd0c0f0e0U, raw_context.iregs[27]);
- EXPECT_EQ(0xc7d6a9b8U, raw_context.iregs[28]);
- EXPECT_EQ(0x56781234U, raw_context.iregs[29]);
- EXPECT_EQ(0x1234abcdU, raw_context.iregs[30]);
- EXPECT_EQ(0x30401020U, raw_context.iregs[31]);
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/module_comparer.cc b/toolkit/crashreporter/google-breakpad/src/processor/module_comparer.cc
deleted file mode 100644
index 025ab883a3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/module_comparer.cc
+++ /dev/null
@@ -1,302 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// module_comparer.cc: ModuleComparer implementation.
-// See module_comparer.h for documentation.
-//
-// Author: lambxsy@google.com (Siyang Xie)
-
-#include "processor/module_comparer.h"
-
-#include <map>
-#include <string>
-
-#include "common/scoped_ptr.h"
-#include "processor/basic_code_module.h"
-#include "processor/logging.h"
-
-#define ASSERT_TRUE(condition) \
- if (!(condition)) { \
- BPLOG(ERROR) << "FAIL: " << #condition << " @ " \
- << __FILE__ << ":" << __LINE__; \
- return false; \
- }
-
-#define ASSERT_FALSE(condition) ASSERT_TRUE(!(condition))
-
-namespace google_breakpad {
-
-bool ModuleComparer::Compare(const string &symbol_data) {
- scoped_ptr<BasicModule> basic_module(new BasicModule("test_module"));
- scoped_ptr<FastModule> fast_module(new FastModule("test_module"));
-
- // Load symbol data into basic_module
- scoped_array<char> buffer(new char[symbol_data.size() + 1]);
- memcpy(buffer.get(), symbol_data.c_str(), symbol_data.size());
- buffer.get()[symbol_data.size()] = '\0';
- ASSERT_TRUE(basic_module->LoadMapFromMemory(buffer.get(),
- symbol_data.size() + 1));
- buffer.reset();
-
- // Serialize BasicSourceLineResolver::Module.
- unsigned int serialized_size = 0;
- scoped_array<char> serialized_data(
- serializer_.Serialize(*(basic_module.get()), &serialized_size));
- ASSERT_TRUE(serialized_data.get());
- BPLOG(INFO) << "Serialized size = " << serialized_size << " Bytes";
-
- // Load FastSourceLineResolver::Module using serialized data.
- ASSERT_TRUE(fast_module->LoadMapFromMemory(serialized_data.get(),
- serialized_size));
- ASSERT_TRUE(fast_module->IsCorrupt() == basic_module->IsCorrupt());
-
- // Compare FastSourceLineResolver::Module with
- // BasicSourceLineResolver::Module.
- ASSERT_TRUE(CompareModule(basic_module.get(), fast_module.get()));
-
- return true;
-}
-
-// Traversal the content of module and do comparison
-bool ModuleComparer::CompareModule(const BasicModule *basic_module,
- const FastModule *fast_module) const {
- // Compare name_.
- ASSERT_TRUE(basic_module->name_ == fast_module->name_);
-
- // Compare files_:
- {
- BasicModule::FileMap::const_iterator iter1 = basic_module->files_.begin();
- FastModule::FileMap::iterator iter2 = fast_module->files_.begin();
- while (iter1 != basic_module->files_.end()
- && iter2 != fast_module->files_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- string tmp(iter2.GetValuePtr());
- ASSERT_TRUE(iter1->second == tmp);
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_module->files_.end());
- ASSERT_TRUE(iter2 == fast_module->files_.end());
- }
-
- // Compare functions_:
- {
- RangeMap<MemAddr, linked_ptr<BasicFunc> >::MapConstIterator iter1;
- StaticRangeMap<MemAddr, FastFunc>::MapConstIterator iter2;
- iter1 = basic_module->functions_.map_.begin();
- iter2 = fast_module->functions_.map_.begin();
- while (iter1 != basic_module->functions_.map_.end()
- && iter2 != fast_module->functions_.map_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- ASSERT_TRUE(iter1->second.base() == iter2.GetValuePtr()->base());
- ASSERT_TRUE(CompareFunction(
- iter1->second.entry().get(), iter2.GetValuePtr()->entryptr()));
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_module->functions_.map_.end());
- ASSERT_TRUE(iter2 == fast_module->functions_.map_.end());
- }
-
- // Compare public_symbols_:
- {
- AddressMap<MemAddr, linked_ptr<BasicPubSymbol> >::MapConstIterator iter1;
- StaticAddressMap<MemAddr, FastPubSymbol>::MapConstIterator iter2;
- iter1 = basic_module->public_symbols_.map_.begin();
- iter2 = fast_module->public_symbols_.map_.begin();
- while (iter1 != basic_module->public_symbols_.map_.end()
- && iter2 != fast_module->public_symbols_.map_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- ASSERT_TRUE(ComparePubSymbol(
- iter1->second.get(), iter2.GetValuePtr()));
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_module->public_symbols_.map_.end());
- ASSERT_TRUE(iter2 == fast_module->public_symbols_.map_.end());
- }
-
- // Compare windows_frame_info_[]:
- for (int i = 0; i < WindowsFrameInfo::STACK_INFO_LAST; ++i) {
- ASSERT_TRUE(CompareCRM(&(basic_module->windows_frame_info_[i]),
- &(fast_module->windows_frame_info_[i])));
- }
-
- // Compare cfi_initial_rules_:
- {
- RangeMap<MemAddr, string>::MapConstIterator iter1;
- StaticRangeMap<MemAddr, char>::MapConstIterator iter2;
- iter1 = basic_module->cfi_initial_rules_.map_.begin();
- iter2 = fast_module->cfi_initial_rules_.map_.begin();
- while (iter1 != basic_module->cfi_initial_rules_.map_.end()
- && iter2 != fast_module->cfi_initial_rules_.map_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- ASSERT_TRUE(iter1->second.base() == iter2.GetValuePtr()->base());
- string tmp(iter2.GetValuePtr()->entryptr());
- ASSERT_TRUE(iter1->second.entry() == tmp);
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_module->cfi_initial_rules_.map_.end());
- ASSERT_TRUE(iter2 == fast_module->cfi_initial_rules_.map_.end());
- }
-
- // Compare cfi_delta_rules_:
- {
- map<MemAddr, string>::const_iterator iter1;
- StaticMap<MemAddr, char>::iterator iter2;
- iter1 = basic_module->cfi_delta_rules_.begin();
- iter2 = fast_module->cfi_delta_rules_.begin();
- while (iter1 != basic_module->cfi_delta_rules_.end()
- && iter2 != fast_module->cfi_delta_rules_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- string tmp(iter2.GetValuePtr());
- ASSERT_TRUE(iter1->second == tmp);
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_module->cfi_delta_rules_.end());
- ASSERT_TRUE(iter2 == fast_module->cfi_delta_rules_.end());
- }
-
- return true;
-}
-
-bool ModuleComparer::CompareFunction(const BasicFunc *basic_func,
- const FastFunc *fast_func_raw) const {
- FastFunc* fast_func = new FastFunc();
- fast_func->CopyFrom(fast_func_raw);
- ASSERT_TRUE(basic_func->name == fast_func->name);
- ASSERT_TRUE(basic_func->address == fast_func->address);
- ASSERT_TRUE(basic_func->size == fast_func->size);
-
- // compare range map of lines:
- RangeMap<MemAddr, linked_ptr<BasicLine> >::MapConstIterator iter1;
- StaticRangeMap<MemAddr, FastLine>::MapConstIterator iter2;
- iter1 = basic_func->lines.map_.begin();
- iter2 = fast_func->lines.map_.begin();
- while (iter1 != basic_func->lines.map_.end()
- && iter2 != fast_func->lines.map_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- ASSERT_TRUE(iter1->second.base() == iter2.GetValuePtr()->base());
- ASSERT_TRUE(CompareLine(iter1->second.entry().get(),
- iter2.GetValuePtr()->entryptr()));
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_func->lines.map_.end());
- ASSERT_TRUE(iter2 == fast_func->lines.map_.end());
-
- delete fast_func;
- return true;
-}
-
-bool ModuleComparer::CompareLine(const BasicLine *basic_line,
- const FastLine *fast_line_raw) const {
- FastLine *fast_line = new FastLine;
- fast_line->CopyFrom(fast_line_raw);
-
- ASSERT_TRUE(basic_line->address == fast_line->address);
- ASSERT_TRUE(basic_line->size == fast_line->size);
- ASSERT_TRUE(basic_line->source_file_id == fast_line->source_file_id);
- ASSERT_TRUE(basic_line->line == fast_line->line);
-
- delete fast_line;
- return true;
-}
-
-bool ModuleComparer::ComparePubSymbol(const BasicPubSymbol* basic_ps,
- const FastPubSymbol* fastps_raw) const {
- FastPubSymbol *fast_ps = new FastPubSymbol;
- fast_ps->CopyFrom(fastps_raw);
- ASSERT_TRUE(basic_ps->name == fast_ps->name);
- ASSERT_TRUE(basic_ps->address == fast_ps->address);
- ASSERT_TRUE(basic_ps->parameter_size == fast_ps->parameter_size);
- delete fast_ps;
- return true;
-}
-
-bool ModuleComparer::CompareWFI(const WindowsFrameInfo& wfi1,
- const WindowsFrameInfo& wfi2) const {
- ASSERT_TRUE(wfi1.type_ == wfi2.type_);
- ASSERT_TRUE(wfi1.valid == wfi2.valid);
- ASSERT_TRUE(wfi1.prolog_size == wfi2.prolog_size);
- ASSERT_TRUE(wfi1.epilog_size == wfi2.epilog_size);
- ASSERT_TRUE(wfi1.parameter_size == wfi2.parameter_size);
- ASSERT_TRUE(wfi1.saved_register_size == wfi2.saved_register_size);
- ASSERT_TRUE(wfi1.local_size == wfi2.local_size);
- ASSERT_TRUE(wfi1.max_stack_size == wfi2.max_stack_size);
- ASSERT_TRUE(wfi1.allocates_base_pointer == wfi2.allocates_base_pointer);
- ASSERT_TRUE(wfi1.program_string == wfi2.program_string);
- return true;
-}
-
-// Compare ContainedRangeMap
-bool ModuleComparer::CompareCRM(
- const ContainedRangeMap<MemAddr, linked_ptr<WFI> >* basic_crm,
- const StaticContainedRangeMap<MemAddr, char>* fast_crm) const {
- ASSERT_TRUE(basic_crm->base_ == fast_crm->base_);
-
- if (!basic_crm->entry_.get() || !fast_crm->entry_ptr_) {
- // empty entry:
- ASSERT_TRUE(!basic_crm->entry_.get() && !fast_crm->entry_ptr_);
- } else {
- WFI newwfi;
- newwfi.CopyFrom(fast_resolver_->CopyWFI(fast_crm->entry_ptr_));
- ASSERT_TRUE(CompareWFI(*(basic_crm->entry_.get()), newwfi));
- }
-
- if ((!basic_crm->map_ || basic_crm->map_->empty())
- || fast_crm->map_.empty()) {
- ASSERT_TRUE((!basic_crm->map_ || basic_crm->map_->empty())
- && fast_crm->map_.empty());
- } else {
- ContainedRangeMap<MemAddr, linked_ptr<WFI> >::MapConstIterator iter1;
- StaticContainedRangeMap<MemAddr, char>::MapConstIterator iter2;
- iter1 = basic_crm->map_->begin();
- iter2 = fast_crm->map_.begin();
- while (iter1 != basic_crm->map_->end()
- && iter2 != fast_crm->map_.end()) {
- ASSERT_TRUE(iter1->first == iter2.GetKey());
- StaticContainedRangeMap<MemAddr, char> *child =
- new StaticContainedRangeMap<MemAddr, char>(
- reinterpret_cast<const char*>(iter2.GetValuePtr()));
- ASSERT_TRUE(CompareCRM(iter1->second, child));
- delete child;
- ++iter1;
- ++iter2;
- }
- ASSERT_TRUE(iter1 == basic_crm->map_->end());
- ASSERT_TRUE(iter2 == fast_crm->map_.end());
- }
-
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/module_comparer.h b/toolkit/crashreporter/google-breakpad/src/processor/module_comparer.h
deleted file mode 100644
index fcbd51775f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/module_comparer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// module_comparer.h: ModuleComparer reads a string format of symbol file, and
-// loads the symbol into both BasicSourceLineResolver::Module and
-// FastSourceLineResolve::Module. It then traverses both Modules and compare
-// the content of data to verify the correctness of new fast module.
-// ModuleCompare class is a tool to verify correctness of a loaded
-// FastSourceLineResolver::Module instance, i.e., in-memory representation of
-// parsed symbol. ModuleComparer class should be used for testing purpose only,
-// e.g., in fast_source_line_resolver_unittest.
-//
-// Author: lambxsy@google.com (Siyang Xie)
-
-#ifndef PROCESSOR_MODULE_COMPARER_H__
-#define PROCESSOR_MODULE_COMPARER_H__
-
-#include <string>
-
-#include "processor/basic_source_line_resolver_types.h"
-#include "processor/fast_source_line_resolver_types.h"
-#include "processor/module_serializer.h"
-#include "processor/windows_frame_info.h"
-
-namespace google_breakpad {
-
-class ModuleComparer {
- public:
- ModuleComparer(): fast_resolver_(new FastSourceLineResolver),
- basic_resolver_(new BasicSourceLineResolver) { }
- ~ModuleComparer() {
- delete fast_resolver_;
- delete basic_resolver_;
- }
-
- // BasicSourceLineResolver loads its module using the symbol data,
- // ModuleSerializer serialize the loaded module into a memory chunk,
- // FastSourceLineResolver loads its module using the serialized memory chunk,
- // Then, traverse both modules together and compare underlying data
- // return true if both modules contain exactly same data.
- bool Compare(const string &symbol_data);
-
- private:
- typedef BasicSourceLineResolver::Module BasicModule;
- typedef FastSourceLineResolver::Module FastModule;
- typedef BasicSourceLineResolver::Function BasicFunc;
- typedef FastSourceLineResolver::Function FastFunc;
- typedef BasicSourceLineResolver::Line BasicLine;
- typedef FastSourceLineResolver::Line FastLine;
- typedef BasicSourceLineResolver::PublicSymbol BasicPubSymbol;
- typedef FastSourceLineResolver::PublicSymbol FastPubSymbol;
- typedef WindowsFrameInfo WFI;
-
- bool CompareModule(const BasicModule *oldmodule,
- const FastModule *newmodule) const;
- bool CompareFunction(const BasicFunc *oldfunc, const FastFunc *newfunc) const;
- bool CompareLine(const BasicLine *oldline, const FastLine *newline) const;
- bool ComparePubSymbol(const BasicPubSymbol*, const FastPubSymbol*) const;
- bool CompareWFI(const WindowsFrameInfo&, const WindowsFrameInfo&) const;
-
- // Compare ContainedRangeMap
- bool CompareCRM(const ContainedRangeMap<MemAddr, linked_ptr<WFI> >*,
- const StaticContainedRangeMap<MemAddr, char>*) const;
-
- FastSourceLineResolver *fast_resolver_;
- BasicSourceLineResolver *basic_resolver_;
- ModuleSerializer serializer_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_MODULE_COMPARER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/module_factory.h b/toolkit/crashreporter/google-breakpad/src/processor/module_factory.h
deleted file mode 100644
index 7aa7caa59d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/module_factory.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// module_factory.h: ModuleFactory a factory that provides
-// an interface for creating a Module and deferring instantiation to subclasses
-// BasicModuleFactory and FastModuleFactory.
-
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_MODULE_FACTORY_H__
-#define PROCESSOR_MODULE_FACTORY_H__
-
-#include "processor/basic_source_line_resolver_types.h"
-#include "processor/fast_source_line_resolver_types.h"
-#include "processor/source_line_resolver_base_types.h"
-
-namespace google_breakpad {
-
-class ModuleFactory {
- public:
- virtual ~ModuleFactory() { };
- virtual SourceLineResolverBase::Module* CreateModule(
- const string &name) const = 0;
-};
-
-class BasicModuleFactory : public ModuleFactory {
- public:
- virtual ~BasicModuleFactory() { }
- virtual BasicSourceLineResolver::Module* CreateModule(
- const string &name) const {
- return new BasicSourceLineResolver::Module(name);
- }
-};
-
-class FastModuleFactory : public ModuleFactory {
- public:
- virtual ~FastModuleFactory() { }
- virtual FastSourceLineResolver::Module* CreateModule(
- const string &name) const {
- return new FastSourceLineResolver::Module(name);
- }
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_MODULE_FACTORY_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/module_serializer.cc b/toolkit/crashreporter/google-breakpad/src/processor/module_serializer.cc
deleted file mode 100644
index 6ac60c1fcf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/module_serializer.cc
+++ /dev/null
@@ -1,207 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// module_serializer.cc: ModuleSerializer implementation.
-//
-// See module_serializer.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include "processor/module_serializer.h"
-
-#include <map>
-#include <string>
-
-#include "processor/basic_code_module.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-// Definition of static member variable in SimplerSerializer<Funcion>, which
-// is declared in file "simple_serializer-inl.h"
-RangeMapSerializer< MemAddr, linked_ptr<BasicSourceLineResolver::Line> >
-SimpleSerializer<BasicSourceLineResolver::Function>::range_map_serializer_;
-
-size_t ModuleSerializer::SizeOf(const BasicSourceLineResolver::Module &module) {
- size_t total_size_alloc_ = 0;
-
- // Size of the "is_corrupt" flag.
- total_size_alloc_ += SimpleSerializer<bool>::SizeOf(module.is_corrupt_);
-
- // Compute memory size for each map component in Module class.
- int map_index = 0;
- map_sizes_[map_index++] = files_serializer_.SizeOf(module.files_);
- map_sizes_[map_index++] = functions_serializer_.SizeOf(module.functions_);
- map_sizes_[map_index++] = pubsym_serializer_.SizeOf(module.public_symbols_);
- for (int i = 0; i < WindowsFrameInfo::STACK_INFO_LAST; ++i)
- map_sizes_[map_index++] =
- wfi_serializer_.SizeOf(&(module.windows_frame_info_[i]));
- map_sizes_[map_index++] = cfi_init_rules_serializer_.SizeOf(
- module.cfi_initial_rules_);
- map_sizes_[map_index++] = cfi_delta_rules_serializer_.SizeOf(
- module.cfi_delta_rules_);
-
- // Header size.
- total_size_alloc_ += kNumberMaps_ * sizeof(uint32_t);
-
- for (int i = 0; i < kNumberMaps_; ++i) {
- total_size_alloc_ += map_sizes_[i];
- }
-
- // Extra one byte for null terminator for C-string copy safety.
- total_size_alloc_ += SimpleSerializer<char>::SizeOf(0);
-
- return total_size_alloc_;
-}
-
-char *ModuleSerializer::Write(const BasicSourceLineResolver::Module &module,
- char *dest) {
- // Write the is_corrupt flag.
- dest = SimpleSerializer<bool>::Write(module.is_corrupt_, dest);
- // Write header.
- memcpy(dest, map_sizes_, kNumberMaps_ * sizeof(uint32_t));
- dest += kNumberMaps_ * sizeof(uint32_t);
- // Write each map.
- dest = files_serializer_.Write(module.files_, dest);
- dest = functions_serializer_.Write(module.functions_, dest);
- dest = pubsym_serializer_.Write(module.public_symbols_, dest);
- for (int i = 0; i < WindowsFrameInfo::STACK_INFO_LAST; ++i)
- dest = wfi_serializer_.Write(&(module.windows_frame_info_[i]), dest);
- dest = cfi_init_rules_serializer_.Write(module.cfi_initial_rules_, dest);
- dest = cfi_delta_rules_serializer_.Write(module.cfi_delta_rules_, dest);
- // Write a null terminator.
- dest = SimpleSerializer<char>::Write(0, dest);
- return dest;
-}
-
-char* ModuleSerializer::Serialize(
- const BasicSourceLineResolver::Module &module, unsigned int *size) {
- // Compute size of memory to allocate.
- unsigned int size_to_alloc = SizeOf(module);
-
- // Allocate memory for serialized data.
- char *serialized_data = new char[size_to_alloc];
- if (!serialized_data) {
- BPLOG(ERROR) << "ModuleSerializer: memory allocation failed, "
- << "size to alloc: " << size_to_alloc;
- if (size) *size = 0;
- return NULL;
- }
-
- // Write serialized data to allocated memory chunk.
- char *end_address = Write(module, serialized_data);
- // Verify the allocated memory size is equal to the size of data been written.
- unsigned int size_written =
- static_cast<unsigned int>(end_address - serialized_data);
- if (size_to_alloc != size_written) {
- BPLOG(ERROR) << "size_to_alloc differs from size_written: "
- << size_to_alloc << " vs " << size_written;
- }
-
- // Set size and return the start address of memory chunk.
- if (size)
- *size = size_to_alloc;
- return serialized_data;
-}
-
-bool ModuleSerializer::SerializeModuleAndLoadIntoFastResolver(
- const BasicSourceLineResolver::ModuleMap::const_iterator &iter,
- FastSourceLineResolver *fast_resolver) {
- BPLOG(INFO) << "Converting symbol " << iter->first.c_str();
-
- // Cast SourceLineResolverBase::Module* to BasicSourceLineResolver::Module*.
- BasicSourceLineResolver::Module* basic_module =
- dynamic_cast<BasicSourceLineResolver::Module*>(iter->second);
-
- unsigned int size = 0;
- scoped_array<char> symbol_data(Serialize(*basic_module, &size));
- if (!symbol_data.get()) {
- BPLOG(ERROR) << "Serialization failed for module: " << basic_module->name_;
- return false;
- }
- BPLOG(INFO) << "Serialized Symbol Size " << size;
-
- // Copy the data into string.
- // Must pass string to LoadModuleUsingMapBuffer(), instead of passing char* to
- // LoadModuleUsingMemoryBuffer(), becaused of data ownership/lifetime issue.
- string symbol_data_string(symbol_data.get(), size);
- symbol_data.reset();
-
- scoped_ptr<CodeModule> code_module(
- new BasicCodeModule(0, 0, iter->first, "", "", "", ""));
-
- return fast_resolver->LoadModuleUsingMapBuffer(code_module.get(),
- symbol_data_string);
-}
-
-void ModuleSerializer::ConvertAllModules(
- const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver) {
- // Check for NULL pointer.
- if (!basic_resolver || !fast_resolver)
- return;
-
- // Traverse module list in basic resolver.
- BasicSourceLineResolver::ModuleMap::const_iterator iter;
- iter = basic_resolver->modules_->begin();
- for (; iter != basic_resolver->modules_->end(); ++iter)
- SerializeModuleAndLoadIntoFastResolver(iter, fast_resolver);
-}
-
-bool ModuleSerializer::ConvertOneModule(
- const string &moduleid,
- const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver) {
- // Check for NULL pointer.
- if (!basic_resolver || !fast_resolver)
- return false;
-
- BasicSourceLineResolver::ModuleMap::const_iterator iter;
- iter = basic_resolver->modules_->find(moduleid);
- if (iter == basic_resolver->modules_->end())
- return false;
-
- return SerializeModuleAndLoadIntoFastResolver(iter, fast_resolver);
-}
-
-char* ModuleSerializer::SerializeSymbolFileData(
- const string &symbol_data, unsigned int *size) {
- scoped_ptr<BasicSourceLineResolver::Module> module(
- new BasicSourceLineResolver::Module("no name"));
- scoped_array<char> buffer(new char[symbol_data.size() + 1]);
- memcpy(buffer.get(), symbol_data.c_str(), symbol_data.size());
- buffer.get()[symbol_data.size()] = '\0';
- if (!module->LoadMapFromMemory(buffer.get(), symbol_data.size() + 1)) {
- return NULL;
- }
- buffer.reset(NULL);
- return Serialize(*(module.get()), size);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/module_serializer.h b/toolkit/crashreporter/google-breakpad/src/processor/module_serializer.h
deleted file mode 100644
index effb009162..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/module_serializer.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// module_serializer.h: ModuleSerializer serializes a loaded symbol,
-// i.e., a loaded BasicSouceLineResolver::Module instance, into a memory
-// chunk of data. The serialized data can be read and loaded by
-// FastSourceLineResolver without CPU & memory-intensive parsing.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_MODULE_SERIALIZER_H__
-#define PROCESSOR_MODULE_SERIALIZER_H__
-
-#include <map>
-#include <string>
-
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/fast_source_line_resolver.h"
-#include "processor/basic_source_line_resolver_types.h"
-#include "processor/fast_source_line_resolver_types.h"
-#include "processor/linked_ptr.h"
-#include "processor/map_serializers-inl.h"
-#include "processor/simple_serializer-inl.h"
-#include "processor/windows_frame_info.h"
-
-namespace google_breakpad {
-
-// ModuleSerializer serializes a loaded BasicSourceLineResolver::Module into a
-// chunk of memory data. ModuleSerializer also provides interface to compute
-// memory size of the serialized data, write serialized data directly into
-// memory, convert ASCII format symbol data into serialized binary data, and
-// convert loaded BasicSourceLineResolver::Module into
-// FastSourceLineResolver::Module.
-class ModuleSerializer {
- public:
- // Compute the size of memory required to serialize a module. Return the
- // total size needed for serialization.
- size_t SizeOf(const BasicSourceLineResolver::Module &module);
-
- // Write a module into an allocated memory chunk with required size.
- // Return the "end" of data, i.e., the address after the final byte of data.
- char* Write(const BasicSourceLineResolver::Module &module, char *dest);
-
- // Serializes a loaded Module object into a chunk of memory data and returns
- // the address of memory chunk. If size != NULL, *size is set to the memory
- // size allocated for the serialized data.
- // Caller takes the ownership of the memory chunk (allocated on heap), and
- // owner should call delete [] to free the memory after use.
- char* Serialize(const BasicSourceLineResolver::Module &module,
- unsigned int *size = NULL);
-
- // Given the string format symbol_data, produces a chunk of serialized data.
- // Caller takes ownership of the serialized data (on heap), and owner should
- // call delete [] to free the memory after use.
- char* SerializeSymbolFileData(const string &symbol_data,
- unsigned int *size = NULL);
-
- // Serializes one loaded module with given moduleid in the basic source line
- // resolver, and loads the serialized data into the fast source line resolver.
- // Return false if the basic source line doesn't have a module with the given
- // moduleid.
- bool ConvertOneModule(const string &moduleid,
- const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver);
-
- // Serializes all the loaded modules in a basic source line resolver, and
- // loads the serialized data into a fast source line resolver.
- void ConvertAllModules(const BasicSourceLineResolver *basic_resolver,
- FastSourceLineResolver *fast_resolver);
-
- private:
- // Convenient type names.
- typedef BasicSourceLineResolver::Line Line;
- typedef BasicSourceLineResolver::Function Function;
- typedef BasicSourceLineResolver::PublicSymbol PublicSymbol;
-
- // Internal implementation for ConvertOneModule and ConvertAllModules methods.
- bool SerializeModuleAndLoadIntoFastResolver(
- const BasicSourceLineResolver::ModuleMap::const_iterator &iter,
- FastSourceLineResolver *fast_resolver);
-
- // Number of Maps that Module class contains.
- static const int32_t kNumberMaps_ =
- FastSourceLineResolver::Module::kNumberMaps_;
-
- // Memory sizes required to serialize map components in Module.
- uint32_t map_sizes_[kNumberMaps_];
-
- // Serializers for each individual map component in Module class.
- StdMapSerializer<int, string> files_serializer_;
- RangeMapSerializer<MemAddr, linked_ptr<Function> > functions_serializer_;
- AddressMapSerializer<MemAddr, linked_ptr<PublicSymbol> > pubsym_serializer_;
- ContainedRangeMapSerializer<MemAddr,
- linked_ptr<WindowsFrameInfo> > wfi_serializer_;
- RangeMapSerializer<MemAddr, string> cfi_init_rules_serializer_;
- StdMapSerializer<MemAddr, string> cfi_delta_rules_serializer_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_MODULE_SERIALIZER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/moz.build b/toolkit/crashreporter/google-breakpad/src/processor/moz.build
deleted file mode 100644
index 1a2fac39eb..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/moz.build
+++ /dev/null
@@ -1,66 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- '../third_party/libdisasm/ia32_invariant.c',
- 'disassembler_x86.cc',
- 'exploitability_win.cc',
-]
-
-UNIFIED_SOURCES += [
- '../third_party/libdisasm/ia32_implicit.c',
- '../third_party/libdisasm/ia32_insn.c',
- '../third_party/libdisasm/ia32_modrm.c',
- '../third_party/libdisasm/ia32_opcode_tables.c',
- '../third_party/libdisasm/ia32_operand.c',
- '../third_party/libdisasm/ia32_reg.c',
- '../third_party/libdisasm/ia32_settings.c',
- '../third_party/libdisasm/x86_disasm.c',
- '../third_party/libdisasm/x86_imm.c',
- '../third_party/libdisasm/x86_insn.c',
- '../third_party/libdisasm/x86_misc.c',
- '../third_party/libdisasm/x86_operand_list.c',
- 'basic_code_modules.cc',
- 'basic_source_line_resolver.cc',
- 'call_stack.cc',
- 'cfi_frame_info.cc',
- 'dump_context.cc',
- 'dump_object.cc',
- 'exploitability.cc',
- 'exploitability_linux.cc',
- 'logging.cc',
- 'minidump.cc',
- 'minidump_processor.cc',
- 'pathname_stripper.cc',
- 'proc_maps_linux.cc',
- 'process_state.cc',
- 'source_line_resolver_base.cc',
- 'stack_frame_symbolizer.cc',
- 'stackwalk_common.cc',
- 'stackwalker.cc',
- 'stackwalker_amd64.cc',
- 'stackwalker_arm.cc',
- 'stackwalker_arm64.cc',
- 'stackwalker_mips.cc',
- 'stackwalker_ppc.cc',
- 'stackwalker_ppc64.cc',
- 'stackwalker_sparc.cc',
- 'stackwalker_x86.cc',
- 'symbolic_constants_win.cc',
- 'tokenize.cc',
-]
-
-DEFINES['BPLOG_MINIMUM_SEVERITY'] = 'SEVERITY_ERROR'
-
-Library('breakpad_processor')
-
-# Don't use the STL wrappers in the crashreporter clients
-DISABLE_STL_WRAPPING = True
-
-# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.cc b/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.cc
deleted file mode 100644
index 839287bdba..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// pathname_stripper.cc: Manipulates pathnames into their component parts.
-//
-// See pathname_stripper.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "processor/pathname_stripper.h"
-
-namespace google_breakpad {
-
-// static
-string PathnameStripper::File(const string &path) {
- string::size_type slash = path.rfind('/');
- string::size_type backslash = path.rfind('\\');
-
- string::size_type file_start = 0;
- if (slash != string::npos &&
- (backslash == string::npos || slash > backslash)) {
- file_start = slash + 1;
- } else if (backslash != string::npos) {
- file_start = backslash + 1;
- }
-
- return path.substr(file_start);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.h b/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.h
deleted file mode 100644
index 423ca0d05a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// pathname_stripper.h: Manipulates pathnames into their component parts.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_PATHNAME_STRIPPER_H__
-#define PROCESSOR_PATHNAME_STRIPPER_H__
-
-#include <string>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-class PathnameStripper {
- public:
- // Given path, a pathname with components separated by slashes (/) or
- // backslashes (\), returns the trailing component, without any separator.
- // If path ends in a separator character, returns an empty string.
- static string File(const string &path);
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_PATHNAME_STRIPPER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper_unittest.cc
deleted file mode 100644
index 1bff4cb017..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/pathname_stripper_unittest.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <stdio.h>
-
-#include "processor/pathname_stripper.h"
-#include "processor/logging.h"
-
-#define ASSERT_TRUE(condition) \
- if (!(condition)) { \
- fprintf(stderr, "FAIL: %s @ %s:%d\n", #condition, __FILE__, __LINE__); \
- return false; \
- }
-
-#define ASSERT_EQ(e1, e2) ASSERT_TRUE((e1) == (e2))
-
-namespace {
-
-using google_breakpad::PathnameStripper;
-
-static bool RunTests() {
- ASSERT_EQ(PathnameStripper::File("/dir/file"), "file");
- ASSERT_EQ(PathnameStripper::File("\\dir\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("/dir\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("\\dir/file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir/file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir/\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir\\/file"), "file");
- ASSERT_EQ(PathnameStripper::File("file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir/"), "");
- ASSERT_EQ(PathnameStripper::File("dir\\"), "");
- ASSERT_EQ(PathnameStripper::File("dir/dir/"), "");
- ASSERT_EQ(PathnameStripper::File("dir\\dir\\"), "");
- ASSERT_EQ(PathnameStripper::File("dir1/dir2/file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir1\\dir2\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir1/dir2\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir1\\dir2/file"), "file");
- ASSERT_EQ(PathnameStripper::File(""), "");
- ASSERT_EQ(PathnameStripper::File("1"), "1");
- ASSERT_EQ(PathnameStripper::File("1/2"), "2");
- ASSERT_EQ(PathnameStripper::File("1\\2"), "2");
- ASSERT_EQ(PathnameStripper::File("/1/2"), "2");
- ASSERT_EQ(PathnameStripper::File("\\1\\2"), "2");
- ASSERT_EQ(PathnameStripper::File("dir//file"), "file");
- ASSERT_EQ(PathnameStripper::File("dir\\\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("/dir//file"), "file");
- ASSERT_EQ(PathnameStripper::File("\\dir\\\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("c:\\dir\\file"), "file");
- ASSERT_EQ(PathnameStripper::File("c:\\dir\\file.ext"), "file.ext");
-
- return true;
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- return RunTests() ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator-inl.h
deleted file mode 100644
index d7dbeac205..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator-inl.h
+++ /dev/null
@@ -1,363 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// postfix_evaluator-inl.h: Postfix (reverse Polish) notation expression
-// evaluator.
-//
-// Documentation in postfix_evaluator.h.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_POSTFIX_EVALUATOR_INL_H__
-#define PROCESSOR_POSTFIX_EVALUATOR_INL_H__
-
-#include "processor/postfix_evaluator.h"
-
-#include <stdio.h>
-
-#include <sstream>
-
-#include "google_breakpad/processor/memory_region.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-using std::istringstream;
-using std::ostringstream;
-
-
-// A small class used in Evaluate to make sure to clean up the stack
-// before returning failure.
-class AutoStackClearer {
- public:
- explicit AutoStackClearer(vector<string> *stack) : stack_(stack) {}
- ~AutoStackClearer() { stack_->clear(); }
-
- private:
- vector<string> *stack_;
-};
-
-
-template<typename ValueType>
-bool PostfixEvaluator<ValueType>::EvaluateToken(
- const string &token,
- const string &expression,
- DictionaryValidityType *assigned) {
- // There are enough binary operations that do exactly the same thing
- // (other than the specific operation, of course) that it makes sense
- // to share as much code as possible.
- enum BinaryOperation {
- BINARY_OP_NONE = 0,
- BINARY_OP_ADD,
- BINARY_OP_SUBTRACT,
- BINARY_OP_MULTIPLY,
- BINARY_OP_DIVIDE_QUOTIENT,
- BINARY_OP_DIVIDE_MODULUS,
- BINARY_OP_ALIGN
- };
-
- BinaryOperation operation = BINARY_OP_NONE;
- if (token == "+")
- operation = BINARY_OP_ADD;
- else if (token == "-")
- operation = BINARY_OP_SUBTRACT;
- else if (token == "*")
- operation = BINARY_OP_MULTIPLY;
- else if (token == "/")
- operation = BINARY_OP_DIVIDE_QUOTIENT;
- else if (token == "%")
- operation = BINARY_OP_DIVIDE_MODULUS;
- else if (token == "@")
- operation = BINARY_OP_ALIGN;
-
- if (operation != BINARY_OP_NONE) {
- // Get the operands.
- ValueType operand1 = ValueType();
- ValueType operand2 = ValueType();
- if (!PopValues(&operand1, &operand2)) {
- BPLOG(ERROR) << "Could not PopValues to get two values for binary "
- "operation " << token << ": " << expression;
- return false;
- }
-
- // Perform the operation.
- ValueType result;
- switch (operation) {
- case BINARY_OP_ADD:
- result = operand1 + operand2;
- break;
- case BINARY_OP_SUBTRACT:
- result = operand1 - operand2;
- break;
- case BINARY_OP_MULTIPLY:
- result = operand1 * operand2;
- break;
- case BINARY_OP_DIVIDE_QUOTIENT:
- result = operand1 / operand2;
- break;
- case BINARY_OP_DIVIDE_MODULUS:
- result = operand1 % operand2;
- break;
- case BINARY_OP_ALIGN:
- result =
- operand1 & (static_cast<ValueType>(-1) ^ (operand2 - 1));
- break;
- case BINARY_OP_NONE:
- // This will not happen, but compilers will want a default or
- // BINARY_OP_NONE case.
- BPLOG(ERROR) << "Not reached!";
- return false;
- break;
- }
-
- // Save the result.
- PushValue(result);
- } else if (token == "^") {
- // ^ for unary dereference. Can't dereference without memory.
- if (!memory_) {
- BPLOG(ERROR) << "Attempt to dereference without memory: " <<
- expression;
- return false;
- }
-
- ValueType address;
- if (!PopValue(&address)) {
- BPLOG(ERROR) << "Could not PopValue to get value to derefence: " <<
- expression;
- return false;
- }
-
- ValueType value;
- if (!memory_->GetMemoryAtAddress(address, &value)) {
- BPLOG(ERROR) << "Could not dereference memory at address " <<
- HexString(address) << ": " << expression;
- return false;
- }
-
- PushValue(value);
- } else if (token == "=") {
- // = for assignment.
- ValueType value;
- if (!PopValue(&value)) {
- BPLOG(INFO) << "Could not PopValue to get value to assign: " <<
- expression;
- return false;
- }
-
- // Assignment is only meaningful when assigning into an identifier.
- // The identifier must name a variable, not a constant. Variables
- // begin with '$'.
- string identifier;
- if (PopValueOrIdentifier(NULL, &identifier) != POP_RESULT_IDENTIFIER) {
- BPLOG(ERROR) << "PopValueOrIdentifier returned a value, but an "
- "identifier is needed to assign " <<
- HexString(value) << ": " << expression;
- return false;
- }
- if (identifier.empty() || identifier[0] != '$') {
- BPLOG(ERROR) << "Can't assign " << HexString(value) << " to " <<
- identifier << ": " << expression;
- return false;
- }
-
- (*dictionary_)[identifier] = value;
- if (assigned)
- (*assigned)[identifier] = true;
- } else {
- // The token is not an operator, it's a literal value or an identifier.
- // Push it onto the stack as-is. Use push_back instead of PushValue
- // because PushValue pushes ValueType as a string, but token is already
- // a string.
- stack_.push_back(token);
- }
- return true;
-}
-
-template<typename ValueType>
-bool PostfixEvaluator<ValueType>::EvaluateInternal(
- const string &expression,
- DictionaryValidityType *assigned) {
- // Tokenize, splitting on whitespace.
- istringstream stream(expression);
- string token;
- while (stream >> token) {
- // Normally, tokens are whitespace-separated, but occasionally, the
- // assignment operator is smashed up against the next token, i.e.
- // $T0 $ebp 128 + =$eip $T0 4 + ^ =$ebp $T0 ^ =
- // This has been observed in program strings produced by MSVS 2010 in LTO
- // mode.
- if (token.size() > 1 && token[0] == '=') {
- if (!EvaluateToken("=", expression, assigned)) {
- return false;
- }
-
- if (!EvaluateToken(token.substr(1), expression, assigned)) {
- return false;
- }
- } else if (!EvaluateToken(token, expression, assigned)) {
- return false;
- }
- }
-
- return true;
-}
-
-template<typename ValueType>
-bool PostfixEvaluator<ValueType>::Evaluate(const string &expression,
- DictionaryValidityType *assigned) {
- // Ensure that the stack is cleared before returning.
- AutoStackClearer clearer(&stack_);
-
- if (!EvaluateInternal(expression, assigned))
- return false;
-
- // If there's anything left on the stack, it indicates incomplete execution.
- // This is a failure case. If the stack is empty, evalution was complete
- // and successful.
- if (stack_.empty())
- return true;
-
- BPLOG(ERROR) << "Incomplete execution: " << expression;
- return false;
-}
-
-template<typename ValueType>
-bool PostfixEvaluator<ValueType>::EvaluateForValue(const string &expression,
- ValueType *result) {
- // Ensure that the stack is cleared before returning.
- AutoStackClearer clearer(&stack_);
-
- if (!EvaluateInternal(expression, NULL))
- return false;
-
- // A successful execution should leave exactly one value on the stack.
- if (stack_.size() != 1) {
- BPLOG(ERROR) << "Expression yielded bad number of results: "
- << "'" << expression << "'";
- return false;
- }
-
- return PopValue(result);
-}
-
-template<typename ValueType>
-typename PostfixEvaluator<ValueType>::PopResult
-PostfixEvaluator<ValueType>::PopValueOrIdentifier(
- ValueType *value, string *identifier) {
- // There needs to be at least one element on the stack to pop.
- if (!stack_.size())
- return POP_RESULT_FAIL;
-
- string token = stack_.back();
- stack_.pop_back();
-
- // First, try to treat the value as a literal. Literals may have leading
- // '-' sign, and the entire remaining string must be parseable as
- // ValueType. If this isn't possible, it can't be a literal, so treat it
- // as an identifier instead.
- //
- // Some versions of the libstdc++, the GNU standard C++ library, have
- // stream extractors for unsigned integer values that permit a leading
- // '-' sign (6.0.13); others do not (6.0.9). Since we require it, we
- // handle it explicitly here.
- istringstream token_stream(token);
- ValueType literal = ValueType();
- bool negative;
- if (token_stream.peek() == '-') {
- negative = true;
- token_stream.get();
- } else {
- negative = false;
- }
- if (token_stream >> literal && token_stream.peek() == EOF) {
- if (value) {
- *value = literal;
- }
- if (negative)
- *value = -*value;
- return POP_RESULT_VALUE;
- } else {
- if (identifier) {
- *identifier = token;
- }
- return POP_RESULT_IDENTIFIER;
- }
-}
-
-
-template<typename ValueType>
-bool PostfixEvaluator<ValueType>::PopValue(ValueType *value) {
- ValueType literal = ValueType();
- string token;
- PopResult result;
- if ((result = PopValueOrIdentifier(&literal, &token)) == POP_RESULT_FAIL) {
- return false;
- } else if (result == POP_RESULT_VALUE) {
- // This is the easy case.
- *value = literal;
- } else { // result == POP_RESULT_IDENTIFIER
- // There was an identifier at the top of the stack. Resolve it to a
- // value by looking it up in the dictionary.
- typename DictionaryType::const_iterator iterator =
- dictionary_->find(token);
- if (iterator == dictionary_->end()) {
- // The identifier wasn't found in the dictionary. Don't imply any
- // default value, just fail.
- BPLOG(INFO) << "Identifier " << token << " not in dictionary";
- return false;
- }
-
- *value = iterator->second;
- }
-
- return true;
-}
-
-
-template<typename ValueType>
-bool PostfixEvaluator<ValueType>::PopValues(ValueType *value1,
- ValueType *value2) {
- return PopValue(value2) && PopValue(value1);
-}
-
-
-template<typename ValueType>
-void PostfixEvaluator<ValueType>::PushValue(const ValueType &value) {
- ostringstream token_stream;
- token_stream << value;
- stack_.push_back(token_stream.str());
-}
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_POSTFIX_EVALUATOR_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator.h b/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator.h
deleted file mode 100644
index 94b66190d5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator.h
+++ /dev/null
@@ -1,179 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// postfix_evaluator.h: Postfix (reverse Polish) notation expression evaluator.
-//
-// PostfixEvaluator evaluates an expression, using the expression itself
-// in postfix (reverse Polish) notation and a dictionary mapping constants
-// and variables to their values. The evaluator supports standard
-// arithmetic operations, assignment into variables, and when an optional
-// MemoryRange is provided, dereferencing. (Any unary key-to-value operation
-// may be used with a MemoryRange implementation that returns the appropriate
-// values, but PostfixEvaluator was written with dereferencing in mind.)
-//
-// The expression language is simple. Expressions are supplied as strings,
-// with operands and operators delimited by whitespace. Operands may be
-// either literal values suitable for ValueType, or constants or variables,
-// which reference the dictionary. The supported binary operators are +
-// (addition), - (subtraction), * (multiplication), / (quotient of division),
-// % (modulus of division), and @ (data alignment). The alignment operator (@)
-// accepts a value and an alignment size, and produces a result that is a
-// multiple of the alignment size by truncating the input value.
-// The unary ^ (dereference) operator is also provided. These operators
-// allow any operand to be either a literal value, constant, or variable.
-// Assignment (=) of any type of operand into a variable is also supported.
-//
-// The dictionary is provided as a map with string keys. Keys beginning
-// with the '$' character are treated as variables. All other keys are
-// treated as constants. Any results must be assigned into variables in the
-// dictionary. These variables do not need to exist prior to calling
-// Evaluate, unless used in an expression prior to being assigned to. The
-// internal stack state is not made available after evaluation, and any
-// values remaining on the stack are treated as evidence of incomplete
-// execution and cause the evaluator to indicate failure.
-//
-// PostfixEvaluator is intended to support evaluation of "program strings"
-// obtained from MSVC frame data debugging information in pdb files as
-// returned by the DIA APIs.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_POSTFIX_EVALUATOR_H__
-#define PROCESSOR_POSTFIX_EVALUATOR_H__
-
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-using std::map;
-using std::vector;
-
-class MemoryRegion;
-
-template<typename ValueType>
-class PostfixEvaluator {
- public:
- typedef map<string, ValueType> DictionaryType;
- typedef map<string, bool> DictionaryValidityType;
-
- // Create a PostfixEvaluator object that may be used (with Evaluate) on
- // one or more expressions. PostfixEvaluator does not take ownership of
- // either argument. |memory| may be NULL, in which case dereferencing
- // (^) will not be supported. |dictionary| may be NULL, but evaluation
- // will fail in that case unless set_dictionary is used before calling
- // Evaluate.
- PostfixEvaluator(DictionaryType *dictionary, const MemoryRegion *memory)
- : dictionary_(dictionary), memory_(memory), stack_() {}
-
- // Evaluate the expression, starting with an empty stack. The results of
- // execution will be stored in one (or more) variables in the dictionary.
- // Returns false if any failures occur during execution, leaving
- // variables in the dictionary in an indeterminate state. If assigned is
- // non-NULL, any keys set in the dictionary as a result of evaluation
- // will also be set to true in assigned, providing a way to determine if
- // an expression modifies any of its input variables.
- bool Evaluate(const string &expression, DictionaryValidityType *assigned);
-
- // Like Evaluate, but provides the value left on the stack to the
- // caller. If evaluation succeeds and leaves exactly one value on
- // the stack, pop that value, store it in *result, and return true.
- // Otherwise, return false.
- bool EvaluateForValue(const string &expression, ValueType *result);
-
- DictionaryType* dictionary() const { return dictionary_; }
-
- // Reset the dictionary. PostfixEvaluator does not take ownership.
- void set_dictionary(DictionaryType *dictionary) {dictionary_ = dictionary; }
-
- private:
- // Return values for PopValueOrIdentifier
- enum PopResult {
- POP_RESULT_FAIL = 0,
- POP_RESULT_VALUE,
- POP_RESULT_IDENTIFIER
- };
-
- // Retrieves the topmost literal value, constant, or variable from the
- // stack. Returns POP_RESULT_VALUE if the topmost entry is a literal
- // value, and sets |value| accordingly. Returns POP_RESULT_IDENTIFIER
- // if the topmost entry is a constant or variable identifier, and sets
- // |identifier| accordingly. Returns POP_RESULT_FAIL on failure, such
- // as when the stack is empty.
- PopResult PopValueOrIdentifier(ValueType *value, string *identifier);
-
- // Retrieves the topmost value on the stack. If the topmost entry is
- // an identifier, the dictionary is queried for the identifier's value.
- // Returns false on failure, such as when the stack is empty or when
- // a nonexistent identifier is named.
- bool PopValue(ValueType *value);
-
- // Retrieves the top two values on the stack, in the style of PopValue.
- // value2 is popped before value1, so that value1 corresponds to the
- // entry that was pushed prior to value2. Returns false on failure.
- bool PopValues(ValueType *value1, ValueType *value2);
-
- // Pushes a new value onto the stack.
- void PushValue(const ValueType &value);
-
- // Evaluate expression, updating *assigned if it is non-zero. Return
- // true if evaluation completes successfully. Do not clear the stack
- // upon successful evaluation.
- bool EvaluateInternal(const string &expression,
- DictionaryValidityType *assigned);
-
- bool EvaluateToken(const string &token,
- const string &expression,
- DictionaryValidityType *assigned);
-
- // The dictionary mapping constant and variable identifiers (strings) to
- // values. Keys beginning with '$' are treated as variable names, and
- // PostfixEvaluator is free to create and modify these keys. Weak pointer.
- DictionaryType *dictionary_;
-
- // If non-NULL, the MemoryRegion used for dereference (^) operations.
- // If NULL, dereferencing is unsupported and will fail. Weak pointer.
- const MemoryRegion *memory_;
-
- // The stack contains state information as execution progresses. Values
- // are pushed on to it as the expression string is read and as operations
- // yield values; values are popped when used as operands to operators.
- vector<string> stack_;
-};
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_POSTFIX_EVALUATOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator_unittest.cc
deleted file mode 100644
index f118982849..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/postfix_evaluator_unittest.cc
+++ /dev/null
@@ -1,403 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// postfix_evaluator_unittest.cc: Unit tests for PostfixEvaluator.
-//
-// Author: Mark Mentovai
-
-#include <assert.h>
-#include <stdio.h>
-
-#include <map>
-#include <string>
-
-#include "processor/postfix_evaluator-inl.h"
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "processor/logging.h"
-
-
-namespace {
-
-
-using std::map;
-using google_breakpad::MemoryRegion;
-using google_breakpad::PostfixEvaluator;
-
-
-// FakeMemoryRegion is used to test PostfixEvaluator's dereference (^)
-// operator. The result of dereferencing a value is one greater than
-// the value.
-class FakeMemoryRegion : public MemoryRegion {
- public:
- virtual uint64_t GetBase() const { return 0; }
- virtual uint32_t GetSize() const { return 0; }
- virtual bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
- *value = address + 1;
- return true;
- }
- virtual bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
- *value = address + 1;
- return true;
- }
- virtual bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
- *value = address + 1;
- return true;
- }
- virtual bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
- *value = address + 1;
- return true;
- }
- virtual void Print() const {
- assert(false);
- }
-};
-
-
-struct EvaluateTest {
- // Expression passed to PostfixEvaluator::Evaluate.
- const string expression;
-
- // True if the expression is expected to be evaluable, false if evaluation
- // is expected to fail.
- bool evaluable;
-};
-
-
-struct EvaluateTestSet {
- // The dictionary used for all tests in the set.
- PostfixEvaluator<unsigned int>::DictionaryType *dictionary;
-
- // The list of tests.
- const EvaluateTest *evaluate_tests;
-
- // The number of tests.
- unsigned int evaluate_test_count;
-
- // Identifiers and their expected values upon completion of the Evaluate
- // tests in the set.
- map<string, unsigned int> *validate_data;
-};
-
-
-struct EvaluateForValueTest {
- // Expression passed to PostfixEvaluator::Evaluate.
- const string expression;
-
- // True if the expression is expected to be evaluable, false if evaluation
- // is expected to fail.
- bool evaluable;
-
- // If evaluable, the value we expect it to yield.
- unsigned int value;
-};
-
-static bool RunTests() {
- // The first test set checks the basic operations and failure modes.
- PostfixEvaluator<unsigned int>::DictionaryType dictionary_0;
- const EvaluateTest evaluate_tests_0[] = {
- { "$rAdd 2 2 + =", true }, // $rAdd = 2 + 2 = 4
- { "$rAdd $rAdd 2 + =", true }, // $rAdd = $rAdd + 2 = 6
- { "$rAdd 2 $rAdd + =", true }, // $rAdd = 2 + $rAdd = 8
- { "99", false }, // put some junk on the stack...
- { "$rAdd2 2 2 + =", true }, // ...and make sure things still work
- { "$rAdd2\t2\n2 + =", true }, // same but with different whitespace
- { "$rAdd2 2 2 + = ", true }, // trailing whitespace
- { " $rAdd2 2 2 + =", true }, // leading whitespace
- { "$rAdd2 2 2 + =", true }, // extra whitespace
- { "$T0 2 = +", false }, // too few operands for add
- { "2 + =", false }, // too few operands for add
- { "2 +", false }, // too few operands for add
- { "+", false }, // too few operands for add
- { "^", false }, // too few operands for dereference
- { "=", false }, // too few operands for assignment
- { "2 =", false }, // too few operands for assignment
- { "2 2 + =", false }, // too few operands for assignment
- { "2 2 =", false }, // can't assign into a literal
- { "k 2 =", false }, // can't assign into a constant
- { "2", false }, // leftover data on stack
- { "2 2 +", false }, // leftover data on stack
- { "$rAdd", false }, // leftover data on stack
- { "0 $T1 0 0 + =", false }, // leftover data on stack
- { "$T2 $T2 2 + =", false }, // can't operate on an undefined value
- { "$rMul 9 6 * =", true }, // $rMul = 9 * 6 = 54
- { "$rSub 9 6 - =", true }, // $rSub = 9 - 6 = 3
- { "$rDivQ 9 6 / =", true }, // $rDivQ = 9 / 6 = 1
- { "$rDivM 9 6 % =", true }, // $rDivM = 9 % 6 = 3
- { "$rDeref 9 ^ =", true }, // $rDeref = ^9 = 10 (FakeMemoryRegion)
- { "$rAlign 36 8 @ =", true }, // $rAlign = 36 @ 8
- { "$rAdd3 2 2 + =$rMul2 9 6 * =", true } // smashed-equals tokenization
- };
- map<string, unsigned int> validate_data_0;
- validate_data_0["$rAdd"] = 8;
- validate_data_0["$rAdd2"] = 4;
- validate_data_0["$rSub"] = 3;
- validate_data_0["$rMul"] = 54;
- validate_data_0["$rDivQ"] = 1;
- validate_data_0["$rDivM"] = 3;
- validate_data_0["$rDeref"] = 10;
- validate_data_0["$rAlign"] = 32;
- validate_data_0["$rAdd3"] = 4;
- validate_data_0["$rMul2"] = 54;
-
- // The second test set simulates a couple of MSVC program strings.
- // The data is fudged a little bit because the tests use FakeMemoryRegion
- // instead of a real stack snapshot, but the program strings are real and
- // the implementation doesn't know or care that the data is not real.
- PostfixEvaluator<unsigned int>::DictionaryType dictionary_1;
- dictionary_1["$ebp"] = 0xbfff0010;
- dictionary_1["$eip"] = 0x10000000;
- dictionary_1["$esp"] = 0xbfff0000;
- dictionary_1[".cbSavedRegs"] = 4;
- dictionary_1[".cbParams"] = 4;
- dictionary_1[".raSearchStart"] = 0xbfff0020;
- const EvaluateTest evaluate_tests_1[] = {
- { "$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = "
- "$L $T0 .cbSavedRegs - = $P $T0 8 + .cbParams + =", true },
- // Intermediate state: $T0 = 0xbfff0010, $eip = 0xbfff0015,
- // $ebp = 0xbfff0011, $esp = 0xbfff0018,
- // $L = 0xbfff000c, $P = 0xbfff001c
- { "$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = "
- "$L $T0 .cbSavedRegs - = $P $T0 8 + .cbParams + = $ebx $T0 28 - ^ =",
- true },
- // Intermediate state: $T0 = 0xbfff0011, $eip = 0xbfff0016,
- // $ebp = 0xbfff0012, $esp = 0xbfff0019,
- // $L = 0xbfff000d, $P = 0xbfff001d,
- // $ebx = 0xbffefff6
- { "$T0 $ebp = $T2 $esp = $T1 .raSearchStart = $eip $T1 ^ = $ebp $T0 = "
- "$esp $T1 4 + = $L $T0 .cbSavedRegs - = $P $T1 4 + .cbParams + = "
- "$ebx $T0 28 - ^ =",
- true }
- };
- map<string, unsigned int> validate_data_1;
- validate_data_1["$T0"] = 0xbfff0012;
- validate_data_1["$T1"] = 0xbfff0020;
- validate_data_1["$T2"] = 0xbfff0019;
- validate_data_1["$eip"] = 0xbfff0021;
- validate_data_1["$ebp"] = 0xbfff0012;
- validate_data_1["$esp"] = 0xbfff0024;
- validate_data_1["$L"] = 0xbfff000e;
- validate_data_1["$P"] = 0xbfff0028;
- validate_data_1["$ebx"] = 0xbffefff7;
- validate_data_1[".cbSavedRegs"] = 4;
- validate_data_1[".cbParams"] = 4;
-
- EvaluateTestSet evaluate_test_sets[] = {
- { &dictionary_0, evaluate_tests_0,
- sizeof(evaluate_tests_0) / sizeof(EvaluateTest), &validate_data_0 },
- { &dictionary_1, evaluate_tests_1,
- sizeof(evaluate_tests_1) / sizeof(EvaluateTest), &validate_data_1 },
- };
-
- unsigned int evaluate_test_set_count = sizeof(evaluate_test_sets) /
- sizeof(EvaluateTestSet);
-
- FakeMemoryRegion fake_memory;
- PostfixEvaluator<unsigned int> postfix_evaluator =
- PostfixEvaluator<unsigned int>(NULL, &fake_memory);
-
- for (unsigned int evaluate_test_set_index = 0;
- evaluate_test_set_index < evaluate_test_set_count;
- ++evaluate_test_set_index) {
- EvaluateTestSet *evaluate_test_set =
- &evaluate_test_sets[evaluate_test_set_index];
- const EvaluateTest *evaluate_tests = evaluate_test_set->evaluate_tests;
- unsigned int evaluate_test_count = evaluate_test_set->evaluate_test_count;
-
- // The same dictionary will be used for each test in the set. Earlier
- // tests can affect the state of the dictionary for later tests.
- postfix_evaluator.set_dictionary(evaluate_test_set->dictionary);
-
- // Use a new validity dictionary for each test set.
- PostfixEvaluator<unsigned int>::DictionaryValidityType assigned;
-
- for (unsigned int evaluate_test_index = 0;
- evaluate_test_index < evaluate_test_count;
- ++evaluate_test_index) {
- const EvaluateTest *evaluate_test = &evaluate_tests[evaluate_test_index];
-
- // Do the test.
- bool result = postfix_evaluator.Evaluate(evaluate_test->expression,
- &assigned);
- if (result != evaluate_test->evaluable) {
- fprintf(stderr, "FAIL: evaluate set %d/%d, test %d/%d, "
- "expression \"%s\", expected %s, observed %s\n",
- evaluate_test_set_index, evaluate_test_set_count,
- evaluate_test_index, evaluate_test_count,
- evaluate_test->expression.c_str(),
- evaluate_test->evaluable ? "evaluable" : "not evaluable",
- result ? "evaluted" : "not evaluated");
- return false;
- }
- }
-
- // Validate the results.
- for (map<string, unsigned int>::const_iterator validate_iterator =
- evaluate_test_set->validate_data->begin();
- validate_iterator != evaluate_test_set->validate_data->end();
- ++validate_iterator) {
- const string identifier = validate_iterator->first;
- unsigned int expected_value = validate_iterator->second;
-
- map<string, unsigned int>::const_iterator dictionary_iterator =
- evaluate_test_set->dictionary->find(identifier);
-
- // The identifier must exist in the dictionary.
- if (dictionary_iterator == evaluate_test_set->dictionary->end()) {
- fprintf(stderr, "FAIL: evaluate test set %d/%d, "
- "validate identifier \"%s\", "
- "expected %d, observed not found\n",
- evaluate_test_set_index, evaluate_test_set_count,
- identifier.c_str(), expected_value);
- return false;
- }
-
- // The value in the dictionary must be the same as the expected value.
- unsigned int observed_value = dictionary_iterator->second;
- if (expected_value != observed_value) {
- fprintf(stderr, "FAIL: evaluate test set %d/%d, "
- "validate identifier \"%s\", "
- "expected %d, observed %d\n",
- evaluate_test_set_index, evaluate_test_set_count,
- identifier.c_str(), expected_value, observed_value);
- return false;
- }
-
- // The value must be set in the "assigned" dictionary if it was a
- // variable. It must not have been assigned if it was a constant.
- bool expected_assigned = identifier[0] == '$';
- bool observed_assigned = false;
- PostfixEvaluator<unsigned int>::DictionaryValidityType::const_iterator
- iterator_assigned = assigned.find(identifier);
- if (iterator_assigned != assigned.end()) {
- observed_assigned = iterator_assigned->second;
- }
- if (expected_assigned != observed_assigned) {
- fprintf(stderr, "FAIL: evaluate test set %d/%d, "
- "validate assignment of \"%s\", "
- "expected %d, observed %d\n",
- evaluate_test_set_index, evaluate_test_set_count,
- identifier.c_str(), expected_assigned, observed_assigned);
- return false;
- }
- }
- }
-
- // EvaluateForValue tests.
- PostfixEvaluator<unsigned int>::DictionaryType dictionary_2;
- dictionary_2["$ebp"] = 0xbfff0010;
- dictionary_2["$eip"] = 0x10000000;
- dictionary_2["$esp"] = 0xbfff0000;
- dictionary_2[".cbSavedRegs"] = 4;
- dictionary_2[".cbParams"] = 4;
- dictionary_2[".raSearchStart"] = 0xbfff0020;
- const EvaluateForValueTest evaluate_for_value_tests_2[] = {
- { "28907223", true, 28907223 }, // simple constant
- { "89854293 40010015 +", true, 89854293 + 40010015 }, // arithmetic
- { "-870245 8769343 +", true, 7899098 }, // negative constants
- { "$ebp $esp - $eip +", true, 0x10000010 }, // variable references
- { "18929794 34015074", false, 0 }, // too many values
- { "$ebp $ebp 4 - =", false, 0 }, // too few values
- { "$new $eip = $new", true, 0x10000000 }, // make new variable
- { "$new 4 +", true, 0x10000004 }, // see prior assignments
- { ".cfa 42 = 10", false, 0 } // can't set constants
- };
- const int evaluate_for_value_tests_2_size
- = (sizeof (evaluate_for_value_tests_2)
- / sizeof (evaluate_for_value_tests_2[0]));
- map<string, unsigned int> validate_data_2;
- validate_data_2["$eip"] = 0x10000000;
- validate_data_2["$ebp"] = 0xbfff000c;
- validate_data_2["$esp"] = 0xbfff0000;
- validate_data_2["$new"] = 0x10000000;
- validate_data_2[".cbSavedRegs"] = 4;
- validate_data_2[".cbParams"] = 4;
- validate_data_2[".raSearchStart"] = 0xbfff0020;
-
- postfix_evaluator.set_dictionary(&dictionary_2);
- for (int i = 0; i < evaluate_for_value_tests_2_size; i++) {
- const EvaluateForValueTest *test = &evaluate_for_value_tests_2[i];
- unsigned int result;
- if (postfix_evaluator.EvaluateForValue(test->expression, &result)
- != test->evaluable) {
- fprintf(stderr, "FAIL: evaluate for value test %d, "
- "expected evaluation to %s, but it %s\n",
- i, test->evaluable ? "succeed" : "fail",
- test->evaluable ? "failed" : "succeeded");
- return false;
- }
- if (test->evaluable && result != test->value) {
- fprintf(stderr, "FAIL: evaluate for value test %d, "
- "expected value to be 0x%x, but it was 0x%x\n",
- i, test->value, result);
- return false;
- }
- }
-
- for (map<string, unsigned int>::iterator v = validate_data_2.begin();
- v != validate_data_2.end(); v++) {
- map<string, unsigned int>::iterator a = dictionary_2.find(v->first);
- if (a == dictionary_2.end()) {
- fprintf(stderr, "FAIL: evaluate for value dictionary check: "
- "expected dict[\"%s\"] to be 0x%x, but it was unset\n",
- v->first.c_str(), v->second);
- return false;
- } else if (a->second != v->second) {
- fprintf(stderr, "FAIL: evaluate for value dictionary check: "
- "expected dict[\"%s\"] to be 0x%x, but it was 0x%x\n",
- v->first.c_str(), v->second, a->second);
- return false;
- }
- dictionary_2.erase(a);
- }
-
- map<string, unsigned int>::iterator remaining = dictionary_2.begin();
- if (remaining != dictionary_2.end()) {
- fprintf(stderr, "FAIL: evaluation of test expressions put unexpected "
- "values in dictionary:\n");
- for (; remaining != dictionary_2.end(); remaining++)
- fprintf(stderr, " dict[\"%s\"] == 0x%x\n",
- remaining->first.c_str(), remaining->second);
- return false;
- }
-
- return true;
-}
-
-
-} // namespace
-
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- return RunTests() ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc b/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc
deleted file mode 100644
index 3c0dea25d2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux.cc
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef __STDC_FORMAT_MACROS
-#define __STDC_FORMAT_MACROS
-#endif
-
-#include "google_breakpad/processor/proc_maps_linux.h"
-
-#include <fcntl.h>
-#include <inttypes.h>
-#include <stdio.h>
-
-#include "common/using_std_string.h"
-#include "processor/logging.h"
-
-#if defined(OS_ANDROID) && !defined(__LP64__)
-// In 32-bit mode, Bionic's inttypes.h defines PRI/SCNxPTR as an
-// unsigned long int, which is incompatible with Bionic's stdint.h
-// defining uintptr_t as an unsigned int:
-// https://code.google.com/p/android/issues/detail?id=57218
-#undef SCNxPTR
-#define SCNxPTR "x"
-#endif
-
-namespace google_breakpad {
-
-bool ParseProcMaps(const string& input,
- std::vector<MappedMemoryRegion>* regions_out) {
- std::vector<MappedMemoryRegion> regions;
-
- // This isn't async safe nor terribly efficient, but it doesn't need to be at
- // this point in time.
-
- // Split the string by newlines.
- std::vector<string> lines;
- string l = "";
- for (size_t i = 0; i < input.size(); i++) {
- if (input[i] != '\n' && input[i] != '\r') {
- l.push_back(input[i]);
- } else if (l.size() > 0) {
- lines.push_back(l);
- l.clear();
- }
- }
- if (l.size() > 0) {
- BPLOG(ERROR) << "Input doesn't end in newline";
- return false;
- }
-
- for (size_t i = 0; i < lines.size(); ++i) {
- MappedMemoryRegion region;
- const char* line = lines[i].c_str();
- char permissions[5] = {'\0'}; // Ensure NUL-terminated string.
- int path_index = 0;
-
- // Sample format from man 5 proc:
- //
- // address perms offset dev inode pathname
- // 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm
- //
- // The final %n term captures the offset in the input string, which is used
- // to determine the path name. It *does not* increment the return value.
- // Refer to man 3 sscanf for details.
- if (sscanf(line, "%" SCNx64 "-%" SCNx64 " %4c %" SCNx64" %hhx:%hhx %"
- SCNd64 " %n", &region.start, &region.end, permissions,
- &region.offset, &region.major_device, &region.minor_device,
- &region.inode, &path_index) < 7) {
- BPLOG(ERROR) << "sscanf failed for line: " << line;
- return false;
- }
-
- region.permissions = 0;
-
- if (permissions[0] == 'r')
- region.permissions |= MappedMemoryRegion::READ;
- else if (permissions[0] != '-')
- return false;
-
- if (permissions[1] == 'w')
- region.permissions |= MappedMemoryRegion::WRITE;
- else if (permissions[1] != '-')
- return false;
-
- if (permissions[2] == 'x')
- region.permissions |= MappedMemoryRegion::EXECUTE;
- else if (permissions[2] != '-')
- return false;
-
- if (permissions[3] == 'p')
- region.permissions |= MappedMemoryRegion::PRIVATE;
- else if (permissions[3] != 's' && permissions[3] != 'S') // Shared memory.
- return false;
-
- // Pushing then assigning saves us a string copy.
- regions.push_back(region);
- regions.back().path.assign(line + path_index);
- regions.back().line.assign(line);
- }
-
- regions_out->swap(regions);
- return true;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux_unittest.cc
deleted file mode 100644
index 466f23455e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/proc_maps_linux_unittest.cc
+++ /dev/null
@@ -1,251 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/proc_maps_linux.h"
-
-namespace {
-
-TEST(ProcMapsTest, Empty) {
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- EXPECT_TRUE(ParseProcMaps("", &regions));
- EXPECT_EQ(0u, regions.size());
-}
-
-TEST(ProcMapsTest, NoSpaces) {
- static const char kNoSpaces[] =
- "00400000-0040b000 r-xp 00002200 fc:00 794418 /bin/cat\n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kNoSpaces, &regions));
- ASSERT_EQ(1u, regions.size());
-
- EXPECT_EQ(0x00400000u, regions[0].start);
- EXPECT_EQ(0x0040b000u, regions[0].end);
- EXPECT_EQ(0x00002200u, regions[0].offset);
- EXPECT_EQ("/bin/cat", regions[0].path);
-}
-
-TEST(ProcMapsTest, Spaces) {
- static const char kSpaces[] =
- "00400000-0040b000 r-xp 00002200 fc:00 794418 /bin/space cat\n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kSpaces, &regions));
- ASSERT_EQ(1u, regions.size());
-
- EXPECT_EQ(0x00400000u, regions[0].start);
- EXPECT_EQ(0x0040b000u, regions[0].end);
- EXPECT_EQ(0x00002200u, regions[0].offset);
- EXPECT_EQ("/bin/space cat", regions[0].path);
-}
-
-TEST(ProcMapsTest, NoNewline) {
- static const char kNoSpaces[] =
- "00400000-0040b000 r-xp 00002200 fc:00 794418 /bin/cat";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_FALSE(ParseProcMaps(kNoSpaces, &regions));
-}
-
-TEST(ProcMapsTest, NoPath) {
- static const char kNoPath[] =
- "00400000-0040b000 rw-p 00000000 00:00 0 \n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kNoPath, &regions));
- ASSERT_EQ(1u, regions.size());
-
- EXPECT_EQ(0x00400000u, regions[0].start);
- EXPECT_EQ(0x0040b000u, regions[0].end);
- EXPECT_EQ(0x00000000u, regions[0].offset);
- EXPECT_EQ("", regions[0].path);
-}
-
-TEST(ProcMapsTest, Heap) {
- static const char kHeap[] =
- "022ac000-022cd000 rw-p 00000000 00:00 0 [heap]\n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kHeap, &regions));
- ASSERT_EQ(1u, regions.size());
-
- EXPECT_EQ(0x022ac000u, regions[0].start);
- EXPECT_EQ(0x022cd000u, regions[0].end);
- EXPECT_EQ(0x00000000u, regions[0].offset);
- EXPECT_EQ("[heap]", regions[0].path);
-}
-
-#if defined(ARCH_CPU_32_BITS)
-TEST(ProcMapsTest, Stack32) {
- static const char kStack[] =
- "beb04000-beb25000 rw-p 00000000 00:00 0 [stack]\n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kStack, &regions));
- ASSERT_EQ(1u, regions.size());
-
- EXPECT_EQ(0xbeb04000u, regions[0].start);
- EXPECT_EQ(0xbeb25000u, regions[0].end);
- EXPECT_EQ(0x00000000u, regions[0].offset);
- EXPECT_EQ("[stack]", regions[0].path);
-}
-#elif defined(ARCH_CPU_64_BITS)
-TEST(ProcMapsTest, Stack64) {
- static const char kStack[] =
- "7fff69c5b000-7fff69c7d000 rw-p 00000000 00:00 0 [stack]\n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kStack, &regions));
- ASSERT_EQ(1u, regions.size());
-
- EXPECT_EQ(0x7fff69c5b000u, regions[0].start);
- EXPECT_EQ(0x7fff69c7d000u, regions[0].end);
- EXPECT_EQ(0x00000000u, regions[0].offset);
- EXPECT_EQ("[stack]", regions[0].path);
-}
-#endif
-
-TEST(ProcMapsTest, Multiple) {
- static const char kMultiple[] =
- "00400000-0040b000 r-xp 00000000 fc:00 794418 /bin/cat\n"
- "0060a000-0060b000 r--p 0000a000 fc:00 794418 /bin/cat\n"
- "0060b000-0060c000 rw-p 0000b000 fc:00 794418 /bin/cat\n";
-
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- ASSERT_TRUE(ParseProcMaps(kMultiple, &regions));
- ASSERT_EQ(3u, regions.size());
-
- EXPECT_EQ(0x00400000u, regions[0].start);
- EXPECT_EQ(0x0040b000u, regions[0].end);
- EXPECT_EQ(0x00000000u, regions[0].offset);
- EXPECT_EQ("/bin/cat", regions[0].path);
-
- EXPECT_EQ(0x0060a000u, regions[1].start);
- EXPECT_EQ(0x0060b000u, regions[1].end);
- EXPECT_EQ(0x0000a000u, regions[1].offset);
- EXPECT_EQ("/bin/cat", regions[1].path);
-
- EXPECT_EQ(0x0060b000u, regions[2].start);
- EXPECT_EQ(0x0060c000u, regions[2].end);
- EXPECT_EQ(0x0000b000u, regions[2].offset);
- EXPECT_EQ("/bin/cat", regions[2].path);
-}
-
-TEST(ProcMapsTest, Permissions) {
- static struct {
- const char* input;
- uint8_t permissions;
- } kTestCases[] = {
- {"00400000-0040b000 ---s 00000000 fc:00 794418 /bin/cat\n", 0},
- {"00400000-0040b000 ---S 00000000 fc:00 794418 /bin/cat\n", 0},
- {"00400000-0040b000 r--s 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::READ},
- {"00400000-0040b000 -w-s 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::WRITE},
- {"00400000-0040b000 --xs 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::EXECUTE},
- {"00400000-0040b000 rwxs 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::READ
- | google_breakpad::MappedMemoryRegion::WRITE
- | google_breakpad::MappedMemoryRegion::EXECUTE},
- {"00400000-0040b000 ---p 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::PRIVATE},
- {"00400000-0040b000 r--p 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::READ
- | google_breakpad::MappedMemoryRegion::PRIVATE},
- {"00400000-0040b000 -w-p 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::WRITE
- | google_breakpad::MappedMemoryRegion::PRIVATE},
- {"00400000-0040b000 --xp 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::EXECUTE
- | google_breakpad::MappedMemoryRegion::PRIVATE},
- {"00400000-0040b000 rwxp 00000000 fc:00 794418 /bin/cat\n",
- google_breakpad::MappedMemoryRegion::READ
- | google_breakpad::MappedMemoryRegion::WRITE
- | google_breakpad::MappedMemoryRegion::EXECUTE
- | google_breakpad::MappedMemoryRegion::PRIVATE},
- };
-
- for (size_t i = 0; i < sizeof(kTestCases) / sizeof(kTestCases[0]); ++i) {
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- EXPECT_TRUE(ParseProcMaps(kTestCases[i].input, &regions));
- EXPECT_EQ(1u, regions.size());
- if (regions.empty())
- continue;
- EXPECT_EQ(kTestCases[i].permissions, regions[0].permissions);
- }
-}
-
-TEST(ProcMapsTest, MissingFields) {
- static const char* kTestCases[] = {
- "00400000\n", // Missing end + beyond.
- "00400000-0040b000\n", // Missing perms + beyond.
- "00400000-0040b000 r-xp\n", // Missing offset + beyond.
- "00400000-0040b000 r-xp 00000000\n", // Missing device + beyond.
- "00400000-0040b000 r-xp 00000000 fc:00\n", // Missing inode + beyond.
- "00400000-0040b000 00000000 fc:00 794418 /bin/cat\n", // Missing perms.
- "00400000-0040b000 r-xp fc:00 794418 /bin/cat\n", // Missing offset.
- "00400000-0040b000 r-xp 00000000 fc:00 /bin/cat\n", // Missing inode.
- "00400000 r-xp 00000000 fc:00 794418 /bin/cat\n", // Missing end.
- "-0040b000 r-xp 00000000 fc:00 794418 /bin/cat\n", // Missing start.
- "00400000-0040b000 r-xp 00000000 794418 /bin/cat\n", // Missing device.
- };
-
- for (size_t i = 0; i < sizeof(kTestCases) / sizeof(kTestCases[0]); ++i) {
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- EXPECT_FALSE(ParseProcMaps(kTestCases[i], &regions));
- }
-}
-
-TEST(ProcMapsTest, InvalidInput) {
- static const char* kTestCases[] = {
- "thisisal-0040b000 rwxp 00000000 fc:00 794418 /bin/cat\n",
- "0040000d-linvalid rwxp 00000000 fc:00 794418 /bin/cat\n",
- "00400000-0040b000 inpu 00000000 fc:00 794418 /bin/cat\n",
- "00400000-0040b000 rwxp tforproc fc:00 794418 /bin/cat\n",
- "00400000-0040b000 rwxp 00000000 ma:ps 794418 /bin/cat\n",
- "00400000-0040b000 rwxp 00000000 fc:00 parse! /bin/cat\n",
- };
-
- for (size_t i = 0; i < sizeof(kTestCases) / sizeof(kTestCases[0]); ++i) {
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- EXPECT_FALSE(ParseProcMaps(kTestCases[i], &regions));
- }
-}
-
-TEST(ProcMapsTest, ParseProcMapsEmptyString) {
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- EXPECT_TRUE(ParseProcMaps("", &regions));
- EXPECT_EQ(0ULL, regions.size());
-}
-
-// Testing a couple of remotely possible weird things in the input:
-// - Line ending with \r\n or \n\r.
-// - File name contains quotes.
-// - File name has whitespaces.
-TEST(ProcMapsTest, ParseProcMapsWeirdCorrectInput) {
- std::vector<google_breakpad::MappedMemoryRegion> regions;
- const string kContents =
- "00400000-0040b000 r-xp 00000000 fc:00 2106562 "
- " /bin/cat\r\n"
- "7f53b7dad000-7f53b7f62000 r-xp 00000000 fc:00 263011 "
- " /lib/x86_64-linux-gnu/libc-2.15.so\n\r"
- "7f53b816d000-7f53b818f000 r-xp 00000000 fc:00 264284 "
- " /lib/x86_64-linux-gnu/ld-2.15.so\n"
- "7fff9c7ff000-7fff9c800000 r-xp 00000000 00:00 0 "
- " \"vd so\"\n"
- "ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 "
- " [vsys call]\n";
- EXPECT_TRUE(ParseProcMaps(kContents, &regions));
- EXPECT_EQ(5ULL, regions.size());
- EXPECT_EQ("/bin/cat", regions[0].path);
- EXPECT_EQ("/lib/x86_64-linux-gnu/libc-2.15.so", regions[1].path);
- EXPECT_EQ("/lib/x86_64-linux-gnu/ld-2.15.so", regions[2].path);
- EXPECT_EQ("\"vd so\"", regions[3].path);
- EXPECT_EQ("[vsys call]", regions[4].path);
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/process_state.cc b/toolkit/crashreporter/google-breakpad/src/processor/process_state.cc
deleted file mode 100644
index 5a5cd7f629..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/process_state.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// process_state.cc: A snapshot of a process, in a fully-digested state.
-//
-// See process_state.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_modules.h"
-
-namespace google_breakpad {
-
-ProcessState::~ProcessState() {
- Clear();
-}
-
-void ProcessState::Clear() {
- time_date_stamp_ = 0;
- process_create_time_ = 0;
- crashed_ = false;
- crash_reason_.clear();
- crash_address_ = 0;
- assertion_.clear();
- requesting_thread_ = -1;
- for (vector<CallStack *>::const_iterator iterator = threads_.begin();
- iterator != threads_.end();
- ++iterator) {
- delete *iterator;
- }
- threads_.clear();
- system_info_.Clear();
- // modules_without_symbols_ and modules_with_corrupt_symbols_ DO NOT own
- // the underlying CodeModule pointers. Just clear the vectors.
- modules_without_symbols_.clear();
- modules_with_corrupt_symbols_.clear();
- delete modules_;
- modules_ = NULL;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/processor.gyp b/toolkit/crashreporter/google-breakpad/src/processor/processor.gyp
deleted file mode 100644
index 083a3237f2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/processor.gyp
+++ /dev/null
@@ -1,184 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../build/common.gypi',
- 'processor_tools.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'processor',
- 'type': 'static_library',
- 'sources': [
- 'address_map-inl.h',
- 'address_map.h',
- 'basic_code_module.h',
- 'basic_code_modules.cc',
- 'basic_code_modules.h',
- 'basic_source_line_resolver.cc',
- 'basic_source_line_resolver_types.h',
- 'call_stack.cc',
- 'cfi_frame_info-inl.h',
- 'cfi_frame_info.cc',
- 'cfi_frame_info.h',
- 'contained_range_map-inl.h',
- 'contained_range_map.h',
- 'disassembler_x86.cc',
- 'disassembler_x86.h',
- 'dump_context.cc',
- 'dump_object.cc',
- 'exploitability.cc',
- 'exploitability_linux.cc',
- 'exploitability_linux.h',
- 'exploitability_win.cc',
- 'exploitability_win.h',
- 'fast_source_line_resolver.cc',
- 'fast_source_line_resolver_types.h',
- 'linked_ptr.h',
- 'logging.cc',
- 'logging.h',
- 'map_serializers-inl.h',
- 'map_serializers.h',
- 'microdump_processor.cc',
- 'minidump.cc',
- 'minidump_processor.cc',
- 'module_comparer.cc',
- 'module_comparer.h',
- 'module_factory.h',
- 'module_serializer.cc',
- 'module_serializer.h',
- 'pathname_stripper.cc',
- 'pathname_stripper.h',
- 'postfix_evaluator-inl.h',
- 'postfix_evaluator.h',
- 'proc_maps_linux.cc',
- 'process_state.cc',
- 'range_map-inl.h',
- 'range_map.h',
- 'simple_serializer-inl.h',
- 'simple_serializer.h',
- 'simple_symbol_supplier.cc',
- 'simple_symbol_supplier.h',
- 'source_line_resolver_base.cc',
- 'source_line_resolver_base_types.h',
- 'stack_frame_cpu.cc',
- 'stack_frame_symbolizer.cc',
- 'stackwalk_common.cc',
- 'stackwalk_common.h',
- 'stackwalker.cc',
- 'stackwalker_address_list.cc',
- 'stackwalker_address_list.h',
- 'stackwalker_amd64.cc',
- 'stackwalker_amd64.h',
- 'stackwalker_arm.cc',
- 'stackwalker_arm.h',
- 'stackwalker_arm64.cc',
- 'stackwalker_arm64.h',
- 'stackwalker_mips.cc',
- 'stackwalker_mips.h',
- 'stackwalker_ppc.cc',
- 'stackwalker_ppc.h',
- 'stackwalker_ppc64.cc',
- 'stackwalker_ppc64.h',
- 'stackwalker_selftest.cc',
- 'stackwalker_sparc.cc',
- 'stackwalker_sparc.h',
- 'stackwalker_x86.cc',
- 'stackwalker_x86.h',
- 'static_address_map-inl.h',
- 'static_address_map.h',
- 'static_contained_range_map-inl.h',
- 'static_contained_range_map.h',
- 'static_map-inl.h',
- 'static_map.h',
- 'static_map_iterator-inl.h',
- 'static_map_iterator.h',
- 'static_range_map-inl.h',
- 'static_range_map.h',
- 'symbolic_constants_win.cc',
- 'symbolic_constants_win.h',
- 'synth_minidump.cc',
- 'synth_minidump.h',
- 'tokenize.cc',
- 'tokenize.h',
- 'windows_frame_info.h',
- ],
- 'include_dirs': [
- '..',
- ],
- 'dependencies': [
- '../common/common.gyp:common',
- '../third_party/libdisasm/libdisasm.gyp:libdisasm',
- ],
- },
- {
- 'target_name': 'processor_unittests',
- 'type': 'executable',
- 'sources': [
- 'address_map_unittest.cc',
- 'basic_source_line_resolver_unittest.cc',
- 'cfi_frame_info_unittest.cc',
- 'contained_range_map_unittest.cc',
- 'disassembler_x86_unittest.cc',
- 'exploitability_unittest.cc',
- 'fast_source_line_resolver_unittest.cc',
- 'map_serializers_unittest.cc',
- 'microdump_processor_unittest.cc',
- 'minidump_processor_unittest.cc',
- 'minidump_unittest.cc',
- 'pathname_stripper_unittest.cc',
- 'postfix_evaluator_unittest.cc',
- 'range_map_shrink_down_unittest.cc',
- 'range_map_unittest.cc',
- 'stackwalker_address_list_unittest.cc',
- 'stackwalker_amd64_unittest.cc',
- 'stackwalker_arm64_unittest.cc',
- 'stackwalker_arm_unittest.cc',
- 'stackwalker_mips_unittest.cc',
- 'stackwalker_mips64_unittest.cc',
- 'stackwalker_unittest_utils.h',
- 'stackwalker_x86_unittest.cc',
- 'static_address_map_unittest.cc',
- 'static_contained_range_map_unittest.cc',
- 'static_map_unittest.cc',
- 'static_range_map_unittest.cc',
- 'synth_minidump_unittest.cc',
- 'synth_minidump_unittest_data.h',
- ],
- 'include_dirs': [
- '..',
- ],
- 'dependencies': [
- 'processor',
- '../build/testing.gypi:gmock',
- '../build/testing.gypi:gtest',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/processor_tools.gypi b/toolkit/crashreporter/google-breakpad/src/processor/processor_tools.gypi
deleted file mode 100644
index ecb450d602..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/processor_tools.gypi
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'target_defaults': {
- 'include_dirs': [
- '..',
- ],
- },
- 'targets': [
- {
- 'target_name': 'minidump_dump',
- 'type': 'executable',
- 'sources': [
- 'minidump_dump.cc',
- ],
- 'dependencies': [
- 'processor',
- ],
- },
- {
- 'target_name': 'minidump_stackwalk',
- 'type': 'executable',
- 'sources': [
- 'minidump_stackwalk.cc',
- ],
- 'dependencies': [
- 'processor',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/proto/README b/toolkit/crashreporter/google-breakpad/src/processor/proto/README
deleted file mode 100644
index df37b6f39e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/proto/README
+++ /dev/null
@@ -1,20 +0,0 @@
-If you wish to use these protobufs, you must generate their source files
-using protoc from the protobuf project (http://code.google.com/p/protobuf/).
-
------
-Troubleshooting for Protobuf:
-
-Install:
-If you are getting permission errors install, make sure you are not trying to
-install from an NFS.
-
-
-Running protoc:
-protoc: error while loading shared libraries: libprotobuf.so.0: cannot open
-shared object file: No such file or directory
-
-The issue is that Ubuntu 8.04 doesn't include /usr/local/lib in
-library paths.
-
-To fix it for your current terminal session, just type in
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/proto/process_state.proto b/toolkit/crashreporter/google-breakpad/src/processor/proto/process_state.proto
deleted file mode 100644
index d3e02dc3f4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/proto/process_state.proto
+++ /dev/null
@@ -1,210 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// process_state_proto.proto: A client proto representation of a process,
-// in a fully-digested state.
-//
-// Derived from earlier struct and class based models of a client-side
-// processed minidump found under src/google_breakpad/processor. The
-// file process_state.h holds the top level representation of this model,
-// supported by additional classes. We've added a proto representation
-// to ease serialization and parsing for server-side storage of crash
-// reports processed on the client.
-//
-// Author: Jess Gray
-
-syntax = "proto2";
-
-package google_breakpad;
-
-// A proto representation of a process, in a fully-digested state.
-// See src/google_breakpad/processor/process_state.h
-message ProcessStateProto {
- // Next value: 14
-
- // The time-date stamp of the original minidump (time_t format)
- optional int64 time_date_stamp = 1;
-
- // The time-date stamp when the process was created (time_t format)
- optional int64 process_create_time = 13;
-
- message Crash {
- // The type of crash. OS- and possibly CPU- specific. For example,
- // "EXCEPTION_ACCESS_VIOLATION" (Windows), "EXC_BAD_ACCESS /
- // KERN_INVALID_ADDRESS" (Mac OS X), "SIGSEGV" (other Unix).
- required string reason = 1;
-
- // If crash_reason implicates memory, the memory address that caused the
- // crash. For data access errors, this will be the data address that
- // caused the fault. For code errors, this will be the address of the
- // instruction that caused the fault.
- required int64 address = 2;
- }
- optional Crash crash = 2;
-
-
- // If there was an assertion that was hit, a textual representation
- // of that assertion, possibly including the file and line at which
- // it occurred.
- optional string assertion = 3;
-
- // The index of the thread that requested a dump be written in the
- // threads vector. If a dump was produced as a result of a crash, this
- // will point to the thread that crashed. If the dump was produced as
- // by user code without crashing, and the dump contains extended Breakpad
- // information, this will point to the thread that requested the dump.
- optional int32 requesting_thread = 4;
-
- message Thread {
- // Stack for the given thread
- repeated StackFrame frames = 1;
- }
-
- // Stacks for each thread (except possibly the exception handler
- // thread) at the time of the crash.
- repeated Thread threads = 5;
-
- // The modules that were loaded into the process represented by the
- // ProcessState.
- repeated CodeModule modules = 6;
-
- // System Info: OS and CPU
-
- // A string identifying the operating system, such as "Windows NT",
- // "Mac OS X", or "Linux". If the information is present in the dump but
- // its value is unknown, this field will contain a numeric value. If
- // the information is not present in the dump, this field will be empty.
- optional string os = 7;
-
- // A short form of the os string, using lowercase letters and no spaces,
- // suitable for use in a filesystem. Possible values are "windows",
- // "mac", and "linux". Empty if the information is not present in the dump
- // or if the OS given by the dump is unknown. The values stored in this
- // field should match those used by MinidumpSystemInfo::GetOS.
- optional string os_short = 8;
-
- // A string identifying the version of the operating system, such as
- // "5.1.2600 Service Pack 2" or "10.4.8 8L2127". If the dump does not
- // contain this information, this field will be empty.
- optional string os_version = 9;
-
- // A string identifying the basic CPU family, such as "x86" or "ppc".
- // If this information is present in the dump but its value is unknown,
- // this field will contain a numeric value. If the information is not
- // present in the dump, this field will be empty. The values stored in
- // this field should match those used by MinidumpSystemInfo::GetCPU.
- optional string cpu = 10;
-
- // A string further identifying the specific CPU, such as
- // "GenuineIntel level 6 model 13 stepping 8". If the information is not
- // present in the dump, or additional identifying information is not
- // defined for the CPU family, this field will be empty.
- optional string cpu_info = 11;
-
- // The number of processors in the system. Will be greater than one for
- // multi-core systems.
- optional int32 cpu_count = 12;
-
- // Leave the ability to add the raw minidump to this representation
-}
-
-
-// Represents a single frame in a stack
-// See src/google_breakpad/processor/code_module.h
-message StackFrame {
- // Next value: 8
-
- // The program counter location as an absolute virtual address. For the
- // innermost called frame in a stack, this will be an exact program counter
- // or instruction pointer value. For all other frames, this will be within
- // the instruction that caused execution to branch to a called function,
- // but may not necessarily point to the exact beginning of that instruction.
- required int64 instruction = 1;
-
- // The module in which the instruction resides.
- optional CodeModule module = 2;
-
- // The function name, may be omitted if debug symbols are not available.
- optional string function_name = 3;
-
- // The start address of the function, may be omitted if debug symbols
- // are not available.
- optional int64 function_base = 4;
-
- // The source file name, may be omitted if debug symbols are not available.
- optional string source_file_name = 5;
-
- // The (1-based) source line number, may be omitted if debug symbols are
- // not available.
- optional int32 source_line = 6;
-
- // The start address of the source line, may be omitted if debug symbols
- // are not available.
- optional int64 source_line_base = 7;
-}
-
-
-// Carries information about code modules that are loaded into a process.
-// See src/google_breakpad/processor/code_module.h
-message CodeModule {
- // Next value: 8
-
- // The base address of this code module as it was loaded by the process.
- optional int64 base_address = 1;
-
- // The size of the code module.
- optional int64 size = 2;
-
- // The path or file name that the code module was loaded from.
- optional string code_file = 3;
-
- // An identifying string used to discriminate between multiple versions and
- // builds of the same code module. This may contain a uuid, timestamp,
- // version number, or any combination of this or other information, in an
- // implementation-defined format.
- optional string code_identifier = 4;
-
- // The filename containing debugging information associated with the code
- // module. If debugging information is stored in a file separate from the
- // code module itself (as is the case when .pdb or .dSYM files are used),
- // this will be different from code_file. If debugging information is
- // stored in the code module itself (possibly prior to stripping), this
- // will be the same as code_file.
- optional string debug_file = 5;
-
- // An identifying string similar to code_identifier, but identifies a
- // specific version and build of the associated debug file. This may be
- // the same as code_identifier when the debug_file and code_file are
- // identical or when the same identifier is used to identify distinct
- // debug and code files.
- optional string debug_identifier = 6;
-
- // A human-readable representation of the code module's version.
- optional string version = 7;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/range_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/range_map-inl.h
deleted file mode 100644
index 9fe74c5029..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/range_map-inl.h
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// range_map-inl.h: Range map implementation.
-//
-// See range_map.h for documentation.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_RANGE_MAP_INL_H__
-#define PROCESSOR_RANGE_MAP_INL_H__
-
-
-#include <assert.h>
-
-#include "processor/range_map.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-
-
-namespace google_breakpad {
-
-template<typename AddressType, typename EntryType>
-void RangeMap<AddressType, EntryType>::SetEnableShrinkDown(
- bool enable_shrink_down) {
- enable_shrink_down_ = enable_shrink_down;
-}
-
-template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::IsShrinkDownEnabled() const {
- return enable_shrink_down_;
-}
-
-template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::StoreRange(const AddressType &base,
- const AddressType &size,
- const EntryType &entry) {
- return StoreRangeInternal(base, 0 /* delta */, size, entry);
-}
-
-template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::StoreRangeInternal(
- const AddressType &base, const AddressType &delta,
- const AddressType &size, const EntryType &entry) {
- AddressType high = base + (size - 1);
-
- // Check for undersize or overflow.
- if (size <= 0 || high < base) {
- // The processor will hit this case too frequently with common symbol
- // files in the size == 0 case, which is more suited to a DEBUG channel.
- // Filter those out since there's no DEBUG channel at the moment.
- BPLOG_IF(INFO, size != 0) << "StoreRangeInternal failed, "
- << HexString(base) << "+" << HexString(size)
- << ", " << HexString(high)
- << ", delta: " << HexString(delta);
- return false;
- }
-
- // Ensure that this range does not overlap with another one already in the
- // map.
- MapConstIterator iterator_base = map_.lower_bound(base);
- MapConstIterator iterator_high = map_.lower_bound(high);
-
- if (iterator_base != iterator_high) {
- // Some other range begins in the space used by this range. It may be
- // contained within the space used by this range, or it may extend lower.
- // If enable_shrink_down_ is true, shrink the current range down, otherwise
- // this is an error.
- if (enable_shrink_down_) {
- AddressType additional_delta = iterator_base->first - base + 1;
- return StoreRangeInternal(base + additional_delta,
- delta + additional_delta,
- size - additional_delta, entry);
- } else {
- // The processor hits this case too frequently with common symbol files.
- // This is most appropriate for a DEBUG channel, but since none exists
- // now simply comment out this logging.
- // AddressType other_base = iterator_base->second.base();
- // AddressType other_size = iterator_base->first - other_base + 1;
- // BPLOG(INFO) << "StoreRangeInternal failed, an existing range is "
- // << "overlapping with the new range: new "
- // << HexString(base) << "+" << HexString(size)
- // << ", existing " << HexString(other_base) << "+"
- // << HexString(other_size);
- return false;
- }
- }
-
- if (iterator_high != map_.end()) {
- if (iterator_high->second.base() <= high) {
- // The range above this one overlaps with this one. It may fully
- // contain this range, or it may begin within this range and extend
- // higher. If enable_shrink_down_ is true, shrink the other range down,
- // otherwise this is an error.
- if (enable_shrink_down_ && iterator_high->first > high) {
- // Shrink the other range down.
- AddressType other_high = iterator_high->first;
- AddressType additional_delta =
- high - iterator_high->second.base() + 1;
- EntryType other_entry;
- AddressType other_base = AddressType();
- AddressType other_size = AddressType();
- AddressType other_delta = AddressType();
- RetrieveRange(other_high, &other_entry, &other_base, &other_delta,
- &other_size);
- map_.erase(iterator_high);
- map_.insert(MapValue(other_high,
- Range(other_base + additional_delta,
- other_delta + additional_delta,
- other_entry)));
- // Retry to store this range.
- return StoreRangeInternal(base, delta, size, entry);
- } else {
- // The processor hits this case too frequently with common symbol files.
- // This is most appropriate for a DEBUG channel, but since none exists
- // now simply comment out this logging.
- //
- // AddressType other_base = iterator_high->second.base();
- // AddressType other_size = iterator_high->first - other_base + 1;
- // BPLOG(INFO) << "StoreRangeInternal failed, an existing range "
- // << "contains or extends higher than the new range: new "
- // << HexString(base) << "+" << HexString(size)
- // << ", existing " << HexString(other_base) << "+"
- // << HexString(other_size);
- return false;
- }
- }
- }
-
- // Store the range in the map by its high address, so that lower_bound can
- // be used to quickly locate a range by address.
- map_.insert(MapValue(high, Range(base, delta, entry)));
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, EntryType *entry, AddressType *entry_base,
- AddressType *entry_delta, AddressType *entry_size) const {
- BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveRange requires |entry|";
- assert(entry);
-
- MapConstIterator iterator = map_.lower_bound(address);
- if (iterator == map_.end())
- return false;
-
- // The map is keyed by the high address of each range, so |address| is
- // guaranteed to be lower than the range's high address. If |range| is
- // not directly preceded by another range, it's possible for address to
- // be below the range's low address, though. When that happens, address
- // references something not within any range, so return false.
- if (address < iterator->second.base())
- return false;
-
- *entry = iterator->second.entry();
- if (entry_base)
- *entry_base = iterator->second.base();
- if (entry_delta)
- *entry_delta = iterator->second.delta();
- if (entry_size)
- *entry_size = iterator->first - iterator->second.base() + 1;
-
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::RetrieveNearestRange(
- const AddressType &address, EntryType *entry, AddressType *entry_base,
- AddressType *entry_delta, AddressType *entry_size) const {
- BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveNearestRange requires |entry|";
- assert(entry);
-
- // If address is within a range, RetrieveRange can handle it.
- if (RetrieveRange(address, entry, entry_base, entry_delta, entry_size))
- return true;
-
- // upper_bound gives the first element whose key is greater than address,
- // but we want the first element whose key is less than or equal to address.
- // Decrement the iterator to get there, but not if the upper_bound already
- // points to the beginning of the map - in that case, address is lower than
- // the lowest stored key, so return false.
- MapConstIterator iterator = map_.upper_bound(address);
- if (iterator == map_.begin())
- return false;
- --iterator;
-
- *entry = iterator->second.entry();
- if (entry_base)
- *entry_base = iterator->second.base();
- if (entry_delta)
- *entry_delta = iterator->second.delta();
- if (entry_size)
- *entry_size = iterator->first - iterator->second.base() + 1;
-
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-bool RangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
- int index, EntryType *entry, AddressType *entry_base,
- AddressType *entry_delta, AddressType *entry_size) const {
- BPLOG_IF(ERROR, !entry) << "RangeMap::RetrieveRangeAtIndex requires |entry|";
- assert(entry);
-
- if (index >= GetCount()) {
- BPLOG(ERROR) << "Index out of range: " << index << "/" << GetCount();
- return false;
- }
-
- // Walk through the map. Although it's ordered, it's not a vector, so it
- // can't be addressed directly by index.
- MapConstIterator iterator = map_.begin();
- for (int this_index = 0; this_index < index; ++this_index)
- ++iterator;
-
- *entry = iterator->second.entry();
- if (entry_base)
- *entry_base = iterator->second.base();
- if (entry_delta)
- *entry_delta = iterator->second.delta();
- if (entry_size)
- *entry_size = iterator->first - iterator->second.base() + 1;
-
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-int RangeMap<AddressType, EntryType>::GetCount() const {
- return map_.size();
-}
-
-
-template<typename AddressType, typename EntryType>
-void RangeMap<AddressType, EntryType>::Clear() {
- map_.clear();
-}
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_RANGE_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/range_map.h b/toolkit/crashreporter/google-breakpad/src/processor/range_map.h
deleted file mode 100644
index d90a67327f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/range_map.h
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// range_map.h: Range maps.
-//
-// A range map associates a range of addresses with a specific object. This
-// is useful when certain objects of variable size are located within an
-// address space. The range map makes it simple to determine which object is
-// associated with a specific address, which may be any address within the
-// range associated with an object.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_RANGE_MAP_H__
-#define PROCESSOR_RANGE_MAP_H__
-
-
-#include <map>
-
-
-namespace google_breakpad {
-
-// Forward declarations (for later friend declarations of specialized template).
-template<class, class> class RangeMapSerializer;
-
-template<typename AddressType, typename EntryType>
-class RangeMap {
- public:
- RangeMap() : enable_shrink_down_(false), map_() {}
-
- // |enable_shrink_down| tells whether overlapping ranges can be shrunk down.
- // If true, then adding a new range that overlaps with an existing one can
- // be a successful operation. The range which ends at the higher address
- // will be shrunk down by moving its start position to a higher address so
- // that it does not overlap anymore.
- void SetEnableShrinkDown(bool enable_shrink_down);
- bool IsShrinkDownEnabled() const;
-
- // Inserts a range into the map. Returns false for a parameter error,
- // or if the location of the range would conflict with a range already
- // stored in the map. If enable_shrink_down is true and there is an overlap
- // between the current range and some other range (already in the map),
- // shrink down the range which ends at a higher address.
- bool StoreRange(const AddressType &base, const AddressType &size,
- const EntryType &entry);
-
- // Locates the range encompassing the supplied address. If there is no such
- // range, returns false. entry_base, entry_delta, and entry_size, if
- // non-NULL, are set to the base, delta, and size of the entry's range.
- // A positive entry delta (> 0) indicates that there was an overlap and the
- // entry was shrunk down (original start address was increased by delta).
- bool RetrieveRange(const AddressType &address, EntryType *entry,
- AddressType *entry_base, AddressType *entry_delta,
- AddressType *entry_size) const;
-
- // Locates the range encompassing the supplied address, if one exists.
- // If no range encompasses the supplied address, locates the nearest range
- // to the supplied address that is lower than the address. Returns false
- // if no range meets these criteria. entry_base, entry_delta, and entry_size,
- // if non-NULL, are set to the base, delta, and size of the entry's range.
- // A positive entry delta (> 0) indicates that there was an overlap and the
- // entry was shrunk down (original start address was increased by delta).
- bool RetrieveNearestRange(const AddressType &address, EntryType *entry,
- AddressType *entry_base, AddressType *entry_delta,
- AddressType *entry_size) const;
-
- // Treating all ranges as a list ordered by the address spaces that they
- // occupy, locates the range at the index specified by index. Returns
- // false if index is larger than the number of ranges stored. entry_base,
- // entry_delta, and entry_size, if non-NULL, are set to the base, delta, and
- // size of the entry's range.
- // A positive entry delta (> 0) indicates that there was an overlap and the
- // entry was shrunk down (original start address was increased by delta).
- //
- // RetrieveRangeAtIndex is not optimized for speedy operation.
- bool RetrieveRangeAtIndex(int index, EntryType *entry,
- AddressType *entry_base, AddressType *entry_delta,
- AddressType *entry_size) const;
-
- // Returns the number of ranges stored in the RangeMap.
- int GetCount() const;
-
- // Empties the range map, restoring it to the state it was when it was
- // initially created.
- void Clear();
-
- private:
- // Friend declarations.
- friend class ModuleComparer;
- friend class RangeMapSerializer<AddressType, EntryType>;
-
- // Same a StoreRange() with the only exception that the |delta| can be
- // passed in.
- bool StoreRangeInternal(const AddressType &base, const AddressType &delta,
- const AddressType &size, const EntryType &entry);
-
- class Range {
- public:
- Range(const AddressType &base, const AddressType &delta,
- const EntryType &entry)
- : base_(base), delta_(delta), entry_(entry) {}
-
- AddressType base() const { return base_; }
- AddressType delta() const { return delta_; }
- EntryType entry() const { return entry_; }
-
- private:
- // The base address of the range. The high address does not need to
- // be stored, because RangeMap uses it as the key to the map.
- const AddressType base_;
-
- // The delta when the range is shrunk down.
- const AddressType delta_;
-
- // The entry corresponding to a range.
- const EntryType entry_;
- };
-
- // Convenience types.
- typedef std::map<AddressType, Range> AddressToRangeMap;
- typedef typename AddressToRangeMap::const_iterator MapConstIterator;
- typedef typename AddressToRangeMap::value_type MapValue;
-
- // Whether overlapping ranges can be shrunk down.
- bool enable_shrink_down_;
-
- // Maps the high address of each range to a EntryType.
- AddressToRangeMap map_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_RANGE_MAP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/range_map_shrink_down_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/range_map_shrink_down_unittest.cc
deleted file mode 100644
index 8dd0e709b1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/range_map_shrink_down_unittest.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-// Copyright (c) 2016, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
-
-// range_map_shrink_down_unittest.cc: Unit tests for RangeMap that specifically
-// test shrink down when ranges overlap.
-//
-// Author: Ivan Penkov
-
-#include <limits.h>
-#include <stdio.h>
-
-#include "processor/range_map-inl.h"
-
-#include "breakpad_googletest_includes.h"
-#include "common/scoped_ptr.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-
-namespace {
-
-using google_breakpad::linked_ptr;
-using google_breakpad::scoped_ptr;
-using google_breakpad::RangeMap;
-
-// A CountedObject holds an int. A global (not thread safe!) count of
-// allocated CountedObjects is maintained to help test memory management.
-class CountedObject {
- public:
- explicit CountedObject(int id) : id_(id) { ++count_; }
- ~CountedObject() { --count_; }
-
- static int count() { return count_; }
- int id() const { return id_; }
-
- private:
- static int count_;
- int id_;
-};
-
-int CountedObject::count_;
-
-typedef int AddressType;
-typedef RangeMap<AddressType, linked_ptr<CountedObject>> TestMap;
-
-// Same range cannot be stored wice.
-TEST(RangeMap, TestShinkDown_SameRange) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
- object_1));
-
- // Same range cannot be stored wice.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_FALSE(range_map.StoreRange(0 /* base address */, 100 /* size */,
- object_2));
-}
-
-// If a range is completely contained by another range, then the larger range
-// should be shrinked down.
-TEST(RangeMap, TestShinkDown_CompletelyContained) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- // Larger range is added first.
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
- object_1));
- // Smaller (contained) range is added second.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 80 /* size */,
- object_2));
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The first range contains the second, so the first range should have been
- // shrunk to [90, 99]. Range [0, 9] should be free.
- EXPECT_FALSE(range_map.RetrieveRange(0, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_FALSE(range_map.RetrieveRange(9, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_TRUE(range_map.RetrieveRange(90, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(90, retrieved_base);
- EXPECT_EQ(90, retrieved_delta);
- EXPECT_EQ(10, retrieved_size);
- // Validate the properties of the smaller range (should be untouched).
- EXPECT_TRUE(range_map.RetrieveRange(10, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(10, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(80, retrieved_size);
-}
-
-// Same as the previous test, however the larger range is added second.
-TEST(RangeMap, TestShinkDown_CompletelyContained_LargerAddedSecond) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- // Smaller (contained) range is added first.
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 80 /* size */,
- object_1));
- // Larger range is added second.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
- object_2));
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The second range contains the first, so the second range should have been
- // shrunk to [90, 99]. Range [0, 9] should be free.
- EXPECT_FALSE(range_map.RetrieveRange(0, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_FALSE(range_map.RetrieveRange(9, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_TRUE(range_map.RetrieveRange(90, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(90, retrieved_base);
- EXPECT_EQ(90, retrieved_delta);
- EXPECT_EQ(10, retrieved_size);
- // Validate the properties of the smaller range (should be untouched).
- EXPECT_TRUE(range_map.RetrieveRange(10, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(10, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(80, retrieved_size);
-}
-
-TEST(RangeMap, TestShinkDown_PartialOverlap_AtBeginning) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
- object_1));
-
- // Partial overlap at the beginning of the new range.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(90 /* base address */, 110 /* size */,
- object_2));
-
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The second range is supposed to be shrunk down so the following address
- // should resize in the first range.
- EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(0, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(100, retrieved_size);
- // Validate the properties of the shrunk down range.
- EXPECT_TRUE(range_map.RetrieveRange(100, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(100, retrieved_base);
- EXPECT_EQ(10, retrieved_delta);
- EXPECT_EQ(100, retrieved_size);
-}
-
-TEST(RangeMap, TestShinkDown_PartialOverlap_AtEnd) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(50 /* base address */, 50 /* size */,
- object_1));
-
- // Partial overlap at the end of the new range.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 70 /* size */,
- object_2));
-
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The first range is supposed to be shrunk down so the following address
- // should resize in the first range.
- EXPECT_TRUE(range_map.RetrieveRange(69, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(0, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(70, retrieved_size);
- // Validate the properties of the shrunk down range.
- EXPECT_TRUE(range_map.RetrieveRange(70, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(70, retrieved_base);
- EXPECT_EQ(20, retrieved_delta);
- EXPECT_EQ(30, retrieved_size);
-}
-
-// A new range is overlapped at both ends. The new range and the range
-// that overlaps at the end should be shrink. The range that overlaps at the
-// beginning should be left untouched.
-TEST(RangeMap, TestShinkDown_OverlapAtBothEnds) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- // This should overlap object_3 at the beginning.
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 100 /* size */,
- object_1));
-
- // This should overlap object_3 at the end.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(100 /* base address */, 100 /* size */,
- object_2));
-
- // This should be overlapped on both ends by object_1 and object_2.
- linked_ptr<CountedObject> object_3(new CountedObject(3));
- EXPECT_TRUE(range_map.StoreRange(50 /* base address */, 100 /* size */,
- object_3));
-
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The first range should be intact.
- EXPECT_TRUE(range_map.RetrieveRange(0, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(0, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(100, retrieved_size);
- // The second range should be shrunk down by 50.
- EXPECT_TRUE(range_map.RetrieveRange(150, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(150, retrieved_base);
- EXPECT_EQ(50, retrieved_delta);
- EXPECT_EQ(50, retrieved_size);
- // The third range (in the middle) should be shrunk down by 50.
- EXPECT_TRUE(range_map.RetrieveRange(100, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(3, object->id());
- EXPECT_EQ(100, retrieved_base);
- EXPECT_EQ(50, retrieved_delta);
- EXPECT_EQ(50, retrieved_size);
-}
-
-TEST(RangeMap, TestShinkDown_MultipleConflicts) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- // This should overlap with object_3.
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 90 /* size */,
- object_1));
-
- // This should also overlap with object_3 but after object_1.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(100 /* base address */, 100 /* size */,
- object_2));
-
- // This should be overlapped on both object_1 and object_2. Since
- // object_3 ends with the higher address it must be shrunk.
- linked_ptr<CountedObject> object_3(new CountedObject(3));
- EXPECT_TRUE(range_map.StoreRange(0 /* base address */, 300 /* size */,
- object_3));
-
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The first range should be intact.
- EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(10, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(90, retrieved_size);
- // The second range should be intact.
- EXPECT_TRUE(range_map.RetrieveRange(199, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(100, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(100, retrieved_size);
- // The third range should be shrunk down by 200.
- EXPECT_TRUE(range_map.RetrieveRange(299, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(3, object->id());
- EXPECT_EQ(200, retrieved_base);
- EXPECT_EQ(200, retrieved_delta);
- EXPECT_EQ(100, retrieved_size);
-}
-
-// Adding two ranges without overlap should succeed and the ranges should
-// be left intact.
-TEST(RangeMap, TestShinkDown_NoConflicts) {
- TestMap range_map;
- range_map.SetEnableShrinkDown(true);
- // Adding range 1.
- linked_ptr<CountedObject> object_1(new CountedObject(1));
- EXPECT_TRUE(range_map.StoreRange(10 /* base address */, 90 /* size */,
- object_1));
-
- // Adding range 2 - no overlap with range 1.
- linked_ptr<CountedObject> object_2(new CountedObject(2));
- EXPECT_TRUE(range_map.StoreRange(110 /* base address */, 90 /* size */,
- object_2));
-
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_delta = AddressType();
- AddressType retrieved_size = AddressType();
- // The first range should be intact.
- EXPECT_TRUE(range_map.RetrieveRange(99, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(1, object->id());
- EXPECT_EQ(10, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(90, retrieved_size);
- // The second range should be intact.
- EXPECT_TRUE(range_map.RetrieveRange(199, &object, &retrieved_base,
- &retrieved_delta, &retrieved_size));
- EXPECT_EQ(2, object->id());
- EXPECT_EQ(110, retrieved_base);
- EXPECT_EQ(0, retrieved_delta);
- EXPECT_EQ(90, retrieved_size);
-}
-
-} // namespace
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/range_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/range_map_unittest.cc
deleted file mode 100644
index 31b89e5de3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/range_map_unittest.cc
+++ /dev/null
@@ -1,559 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// range_map_unittest.cc: Unit tests for RangeMap
-//
-// Author: Mark Mentovai
-
-
-#include <limits.h>
-#include <stdio.h>
-
-#include "processor/range_map-inl.h"
-
-#include "common/scoped_ptr.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-
-namespace {
-
-
-using google_breakpad::linked_ptr;
-using google_breakpad::scoped_ptr;
-using google_breakpad::RangeMap;
-
-
-// A CountedObject holds an int. A global (not thread safe!) count of
-// allocated CountedObjects is maintained to help test memory management.
-class CountedObject {
- public:
- explicit CountedObject(int id) : id_(id) { ++count_; }
- ~CountedObject() { --count_; }
-
- static int count() { return count_; }
- int id() const { return id_; }
-
- private:
- static int count_;
- int id_;
-};
-
-int CountedObject::count_;
-
-
-typedef int AddressType;
-typedef RangeMap< AddressType, linked_ptr<CountedObject> > TestMap;
-
-
-// RangeTest contains data to use for store and retrieve tests. See
-// RunTests for descriptions of the tests.
-struct RangeTest {
- // Base address to use for test
- AddressType address;
-
- // Size of range to use for test
- AddressType size;
-
- // Unique ID of range - unstorable ranges must have unique IDs too
- int id;
-
- // Whether this range is expected to be stored successfully or not
- bool expect_storable;
-};
-
-
-// A RangeTestSet encompasses multiple RangeTests, which are run in
-// sequence on the same RangeMap.
-struct RangeTestSet {
- // An array of RangeTests
- const RangeTest *range_tests;
-
- // The number of tests in the set
- unsigned int range_test_count;
-};
-
-
-// StoreTest uses the data in a RangeTest and calls StoreRange on the
-// test RangeMap. It returns true if the expected result occurred, and
-// false if something else happened.
-static bool StoreTest(TestMap *range_map, const RangeTest *range_test) {
- linked_ptr<CountedObject> object(new CountedObject(range_test->id));
- bool stored = range_map->StoreRange(range_test->address,
- range_test->size,
- object);
-
- if (stored != range_test->expect_storable) {
- fprintf(stderr, "FAILED: "
- "StoreRange id %d, expected %s, observed %s\n",
- range_test->id,
- range_test->expect_storable ? "storable" : "not storable",
- stored ? "stored" : "not stored");
- return false;
- }
-
- return true;
-}
-
-
-// RetrieveTest uses the data in RangeTest and calls RetrieveRange on the
-// test RangeMap. If it retrieves the expected value (which can be no
-// map entry at the specified range,) it returns true, otherwise, it returns
-// false. RetrieveTest will check the values around the base address and
-// the high address of a range to guard against off-by-one errors.
-static bool RetrieveTest(TestMap *range_map, const RangeTest *range_test) {
- for (unsigned int side = 0; side <= 1; ++side) {
- // When side == 0, check the low side (base address) of each range.
- // When side == 1, check the high side (base + size) of each range.
-
- // Check one-less and one-greater than the target address in addition
- // to the target address itself.
-
- // If the size of the range is only 1, don't check one greater than
- // the base or one less than the high - for a successfully stored
- // range, these tests would erroneously fail because the range is too
- // small.
- AddressType low_offset = -1;
- AddressType high_offset = 1;
- if (range_test->size == 1) {
- if (!side) // When checking the low side,
- high_offset = 0; // don't check one over the target.
- else // When checking the high side,
- low_offset = 0; // don't check one under the target.
- }
-
- for (AddressType offset = low_offset; offset <= high_offset; ++offset) {
- AddressType address =
- offset +
- (!side ? range_test->address :
- range_test->address + range_test->size - 1);
-
- bool expected_result = false; // This is correct for tests not stored.
- if (range_test->expect_storable) {
- if (offset == 0) // When checking the target address,
- expected_result = true; // test should always succeed.
- else if (offset == -1) // When checking one below the target,
- expected_result = side; // should fail low and succeed high.
- else // When checking one above the target,
- expected_result = !side; // should succeed low and fail high.
- }
-
- linked_ptr<CountedObject> object;
- AddressType retrieved_base = AddressType();
- AddressType retrieved_size = AddressType();
- AddressType retrieved_delta = AddressType();
- bool retrieved = range_map->RetrieveRange(address, &object,
- &retrieved_base,
- &retrieved_delta,
- &retrieved_size);
-
- bool observed_result = retrieved && object->id() == range_test->id;
-
- if (observed_result != expected_result) {
- fprintf(stderr, "FAILED: "
- "RetrieveRange id %d, side %d, offset %d, "
- "expected %s, observed %s\n",
- range_test->id,
- side,
- offset,
- expected_result ? "true" : "false",
- observed_result ? "true" : "false");
- return false;
- }
-
- // If a range was successfully retrieved, check that the returned
- // bounds match the range as stored.
- if (observed_result == true &&
- (retrieved_base != range_test->address ||
- retrieved_size != range_test->size)) {
- fprintf(stderr, "FAILED: "
- "RetrieveRange id %d, side %d, offset %d, "
- "expected base/size %d/%d, observed %d/%d\n",
- range_test->id,
- side,
- offset,
- range_test->address, range_test->size,
- retrieved_base, retrieved_size);
- return false;
- }
-
- // Now, check RetrieveNearestRange. The nearest range is always
- // expected to be different from the test range when checking one
- // less than the low side.
- bool expected_nearest = range_test->expect_storable;
- if (!side && offset < 0)
- expected_nearest = false;
-
- linked_ptr<CountedObject> nearest_object;
- AddressType nearest_base = AddressType();
- AddressType nearest_delta = AddressType();
- AddressType nearest_size = AddressType();
- bool retrieved_nearest = range_map->RetrieveNearestRange(address,
- &nearest_object,
- &nearest_base,
- &nearest_delta,
- &nearest_size);
-
- // When checking one greater than the high side, RetrieveNearestRange
- // should usually return the test range. When a different range begins
- // at that address, though, then RetrieveNearestRange should return the
- // range at the address instead of the test range.
- if (side && offset > 0 && nearest_base == address) {
- expected_nearest = false;
- }
-
- bool observed_nearest = retrieved_nearest &&
- nearest_object->id() == range_test->id;
-
- if (observed_nearest != expected_nearest) {
- fprintf(stderr, "FAILED: "
- "RetrieveNearestRange id %d, side %d, offset %d, "
- "expected %s, observed %s\n",
- range_test->id,
- side,
- offset,
- expected_nearest ? "true" : "false",
- observed_nearest ? "true" : "false");
- return false;
- }
-
- // If a range was successfully retrieved, check that the returned
- // bounds match the range as stored.
- if (expected_nearest &&
- (nearest_base != range_test->address ||
- nearest_size != range_test->size)) {
- fprintf(stderr, "FAILED: "
- "RetrieveNearestRange id %d, side %d, offset %d, "
- "expected base/size %d/%d, observed %d/%d\n",
- range_test->id,
- side,
- offset,
- range_test->address, range_test->size,
- nearest_base, nearest_size);
- return false;
- }
- }
- }
-
- return true;
-}
-
-
-// Test RetrieveRangeAtIndex, which is supposed to return objects in order
-// according to their addresses. This test is performed by looping through
-// the map, calling RetrieveRangeAtIndex for all possible indices in sequence,
-// and verifying that each call returns a different object than the previous
-// call, and that ranges are returned with increasing base addresses. Returns
-// false if the test fails.
-static bool RetrieveIndexTest(TestMap *range_map, int set) {
- linked_ptr<CountedObject> object;
- CountedObject *last_object = NULL;
- AddressType last_base = 0;
-
- int object_count = range_map->GetCount();
- for (int object_index = 0; object_index < object_count; ++object_index) {
- AddressType base;
- if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base,
- NULL /* delta */, NULL /* size */)) {
- fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d, "
- "expected success, observed failure\n",
- set, object_index);
- return false;
- }
-
- if (!object.get()) {
- fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d, "
- "expected object, observed NULL\n",
- set, object_index);
- return false;
- }
-
- // It's impossible to do these comparisons unless there's a previous
- // object to compare against.
- if (last_object) {
- // The object must be different from the last one.
- if (object->id() == last_object->id()) {
- fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d, "
- "expected different objects, observed same objects (%d)\n",
- set, object_index, object->id());
- return false;
- }
-
- // Each object must have a base greater than the previous object's base.
- if (base <= last_base) {
- fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d, "
- "expected different bases, observed same bases (%d)\n",
- set, object_index, base);
- return false;
- }
- }
-
- last_object = object.get();
- last_base = base;
- }
-
- // Make sure that RetrieveRangeAtIndex doesn't allow lookups at indices that
- // are too high.
- if (range_map->RetrieveRangeAtIndex(object_count, &object, NULL /* base */,
- NULL /* delta */, NULL /* size */)) {
- fprintf(stderr, "FAILED: RetrieveRangeAtIndex set %d index %d (too large), "
- "expected failure, observed success\n",
- set, object_count);
- return false;
- }
-
- return true;
-}
-
-// Additional RetriveAtIndex test to expose the bug in RetrieveRangeAtIndex().
-// Bug info: RetrieveRangeAtIndex() previously retrieves the high address of
-// entry, however, it is supposed to retrieve the base address of entry as
-// stated in the comment in range_map.h.
-static bool RetriveAtIndexTest2() {
- scoped_ptr<TestMap> range_map(new TestMap());
-
- // Store ranges with base address = 2 * object_id:
- const int range_size = 2;
- for (int object_id = 0; object_id < 100; ++object_id) {
- linked_ptr<CountedObject> object(new CountedObject(object_id));
- int base_address = 2 * object_id;
- range_map->StoreRange(base_address, range_size, object);
- }
-
- linked_ptr<CountedObject> object;
- int object_count = range_map->GetCount();
- for (int object_index = 0; object_index < object_count; ++object_index) {
- AddressType base;
- if (!range_map->RetrieveRangeAtIndex(object_index, &object, &base,
- NULL /* delta */, NULL /* size */)) {
- fprintf(stderr, "FAILED: RetrieveAtIndexTest2 index %d, "
- "expected success, observed failure\n", object_index);
- return false;
- }
-
- int expected_base = 2 * object->id();
- if (base != expected_base) {
- fprintf(stderr, "FAILED: RetriveAtIndexTest2 index %d, "
- "expected base %d, observed base %d",
- object_index, expected_base, base);
- return false;
- }
- }
-
- return true;
-}
-
-
-// RunTests runs a series of test sets.
-static bool RunTests() {
- // These tests will be run sequentially. The first set of tests exercises
- // most functions of RangeTest, and verifies all of the bounds-checking.
- const RangeTest range_tests_0[] = {
- { INT_MIN, 16, 1, true }, // lowest possible range
- { -2, 5, 2, true }, // a range through zero
- { INT_MAX - 9, 11, 3, false }, // tests anti-overflow
- { INT_MAX - 9, 10, 4, true }, // highest possible range
- { 5, 0, 5, false }, // tests anti-zero-size
- { 5, 1, 6, true }, // smallest possible range
- { -20, 15, 7, true }, // entirely negative
-
- { 10, 10, 10, true }, // causes the following tests to fail
- { 9, 10, 11, false }, // one-less base, one-less high
- { 9, 11, 12, false }, // one-less base, identical high
- { 9, 12, 13, false }, // completely contains existing
- { 10, 9, 14, false }, // identical base, one-less high
- { 10, 10, 15, false }, // exactly identical to existing range
- { 10, 11, 16, false }, // identical base, one-greater high
- { 11, 8, 17, false }, // contained completely within
- { 11, 9, 18, false }, // one-greater base, identical high
- { 11, 10, 19, false }, // one-greater base, one-greater high
- { 9, 2, 20, false }, // overlaps bottom by one
- { 10, 1, 21, false }, // overlaps bottom by one, contained
- { 19, 1, 22, false }, // overlaps top by one, contained
- { 19, 2, 23, false }, // overlaps top by one
-
- { 9, 1, 24, true }, // directly below without overlap
- { 20, 1, 25, true }, // directly above without overlap
-
- { 6, 3, 26, true }, // exactly between two ranges, gapless
- { 7, 3, 27, false }, // tries to span two ranges
- { 7, 5, 28, false }, // tries to span three ranges
- { 4, 20, 29, false }, // tries to contain several ranges
-
- { 30, 50, 30, true },
- { 90, 25, 31, true },
- { 35, 65, 32, false }, // tries to span two noncontiguous
- { 120, 10000, 33, true }, // > 8-bit
- { 20000, 20000, 34, true }, // > 8-bit
- { 0x10001, 0x10001, 35, true }, // > 16-bit
-
- { 27, -1, 36, false } // tests high < base
- };
-
- // Attempt to fill the entire space. The entire space must be filled with
- // three stores because AddressType is signed for these tests, so RangeMap
- // treats the size as signed and rejects sizes that appear to be negative.
- // Even if these tests were run as unsigned, two stores would be needed
- // to fill the space because the entire size of the space could only be
- // described by using one more bit than would be present in AddressType.
- const RangeTest range_tests_1[] = {
- { INT_MIN, INT_MAX, 50, true }, // From INT_MIN to -2, inclusive
- { -1, 2, 51, true }, // From -1 to 0, inclusive
- { 1, INT_MAX, 52, true }, // From 1 to INT_MAX, inclusive
- { INT_MIN, INT_MAX, 53, false }, // Can't fill the space twice
- { -1, 2, 54, false },
- { 1, INT_MAX, 55, false },
- { -3, 6, 56, false }, // -3 to 2, inclusive - spans 3 ranges
- };
-
- // A light round of testing to verify that RetrieveRange does the right
- // the right thing at the extremities of the range when nothing is stored
- // there. Checks are forced without storing anything at the extremities
- // by setting size = 0.
- const RangeTest range_tests_2[] = {
- { INT_MIN, 0, 100, false }, // makes RetrieveRange check low end
- { -1, 3, 101, true },
- { INT_MAX, 0, 102, false }, // makes RetrieveRange check high end
- };
-
- // Similar to the previous test set, but with a couple of ranges closer
- // to the extremities.
- const RangeTest range_tests_3[] = {
- { INT_MIN + 1, 1, 110, true },
- { INT_MAX - 1, 1, 111, true },
- { INT_MIN, 0, 112, false }, // makes RetrieveRange check low end
- { INT_MAX, 0, 113, false } // makes RetrieveRange check high end
- };
-
- // The range map is cleared between sets of tests listed here.
- const RangeTestSet range_test_sets[] = {
- { range_tests_0, sizeof(range_tests_0) / sizeof(RangeTest) },
- { range_tests_1, sizeof(range_tests_1) / sizeof(RangeTest) },
- { range_tests_2, sizeof(range_tests_2) / sizeof(RangeTest) },
- { range_tests_3, sizeof(range_tests_3) / sizeof(RangeTest) },
- { range_tests_0, sizeof(range_tests_0) / sizeof(RangeTest) } // Run again
- };
-
- // Maintain the range map in a pointer so that deletion can be meaningfully
- // tested.
- scoped_ptr<TestMap> range_map(new TestMap());
-
- // Run all of the test sets in sequence.
- unsigned int range_test_set_count = sizeof(range_test_sets) /
- sizeof(RangeTestSet);
- for (unsigned int range_test_set_index = 0;
- range_test_set_index < range_test_set_count;
- ++range_test_set_index) {
- const RangeTest *range_tests =
- range_test_sets[range_test_set_index].range_tests;
- unsigned int range_test_count =
- range_test_sets[range_test_set_index].range_test_count;
-
- // Run the StoreRange test, which validates StoreRange and initializes
- // the RangeMap with data for the RetrieveRange test.
- int stored_count = 0; // The number of ranges successfully stored
- for (unsigned int range_test_index = 0;
- range_test_index < range_test_count;
- ++range_test_index) {
- const RangeTest *range_test = &range_tests[range_test_index];
- if (!StoreTest(range_map.get(), range_test))
- return false;
-
- if (range_test->expect_storable)
- ++stored_count;
- }
-
- // There should be exactly one CountedObject for everything successfully
- // stored in the RangeMap.
- if (CountedObject::count() != stored_count) {
- fprintf(stderr, "FAILED: "
- "stored object counts don't match, expected %d, observed %d\n",
- stored_count,
- CountedObject::count());
-
- return false;
- }
-
- // The RangeMap's own count of objects should also match.
- if (range_map->GetCount() != stored_count) {
- fprintf(stderr, "FAILED: stored object count doesn't match GetCount, "
- "expected %d, observed %d\n",
- stored_count, range_map->GetCount());
-
- return false;
- }
-
- // Run the RetrieveRange test
- for (unsigned int range_test_index = 0;
- range_test_index < range_test_count;
- ++range_test_index) {
- const RangeTest *range_test = &range_tests[range_test_index];
- if (!RetrieveTest(range_map.get(), range_test))
- return false;
- }
-
- if (!RetrieveIndexTest(range_map.get(), range_test_set_index))
- return false;
-
- // Clear the map between test sets. If this is the final test set,
- // delete the map instead to test destruction.
- if (range_test_set_index < range_test_set_count - 1)
- range_map->Clear();
- else
- range_map.reset();
-
- // Test that all stored objects are freed when the RangeMap is cleared
- // or deleted.
- if (CountedObject::count() != 0) {
- fprintf(stderr, "FAILED: "
- "did not free all objects after %s, %d still allocated\n",
- range_test_set_index < range_test_set_count - 1 ? "clear"
- : "delete",
- CountedObject::count());
-
- return false;
- }
- }
-
- if (!RetriveAtIndexTest2()) {
- fprintf(stderr, "FAILED: did not pass RetrieveAtIndexTest2()\n");
- return false;
- }
-
- return true;
-}
-
-
-} // namespace
-
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- return RunTests() ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/simple_serializer-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/simple_serializer-inl.h
deleted file mode 100644
index 606bb3cead..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/simple_serializer-inl.h
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// simple_serializer-inl.h: template specializations for following types:
-// bool, const char *(C-string), string,
-// Line, Function, PublicSymbol, WindowsFrameInfo and their linked pointers.
-//
-// See simple_serializer.h for moredocumentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_SIMPLE_SERIALIZER_INL_H__
-#define PROCESSOR_SIMPLE_SERIALIZER_INL_H__
-
-#include <string>
-
-#include "processor/simple_serializer.h"
-#include "map_serializers-inl.h"
-
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "processor/basic_source_line_resolver_types.h"
-#include "processor/linked_ptr.h"
-#include "processor/windows_frame_info.h"
-
-namespace google_breakpad {
-
-// Specializations of SimpleSerializer: bool
-template<>
-class SimpleSerializer<bool> {
- public:
- static size_t SizeOf(bool boolean) { return 1; }
-
- static char *Write(bool boolean, char *dest) {
- *dest = static_cast<char>(boolean? 255 : 0);
- return ++dest;
- }
-
- static const char *Read(const char *source, bool *value) {
- *value = ((*source) == 0 ? false : true);
- return ++source;
- }
-};
-
-// Specializations of SimpleSerializer: string
-template<>
-class SimpleSerializer<string> {
- public:
- static size_t SizeOf(const string &str) { return str.size() + 1; }
-
- static char *Write(const string &str, char *dest) {
- strcpy(dest, str.c_str());
- return dest + SizeOf(str);
- }
-};
-
-// Specializations of SimpleSerializer: C-string
-template<>
-class SimpleSerializer<const char*> {
- public:
- static size_t SizeOf(const char *cstring) {
- return strlen(cstring) + 1;
- }
-
- static char *Write(const char *cstring, char *dest) {
- strcpy(dest, cstring);
- return dest + SizeOf(cstring);
- }
-};
-
-// Specializations of SimpleSerializer: Line
-template<>
-class SimpleSerializer<BasicSourceLineResolver::Line> {
- typedef BasicSourceLineResolver::Line Line;
- public:
- static size_t SizeOf(const Line &line) {
- return SimpleSerializer<MemAddr>::SizeOf(line.address)
- + SimpleSerializer<MemAddr>::SizeOf(line.size)
- + SimpleSerializer<int32_t>::SizeOf(line.source_file_id)
- + SimpleSerializer<int32_t>::SizeOf(line.line);
- }
- static char *Write(const Line &line, char *dest) {
- dest = SimpleSerializer<MemAddr>::Write(line.address, dest);
- dest = SimpleSerializer<MemAddr>::Write(line.size, dest);
- dest = SimpleSerializer<int32_t>::Write(line.source_file_id, dest);
- dest = SimpleSerializer<int32_t>::Write(line.line, dest);
- return dest;
- }
-};
-
-// Specializations of SimpleSerializer: PublicSymbol
-template<>
-class SimpleSerializer<BasicSourceLineResolver::PublicSymbol> {
- typedef BasicSourceLineResolver::PublicSymbol PublicSymbol;
- public:
- static size_t SizeOf(const PublicSymbol &pubsymbol) {
- return SimpleSerializer<string>::SizeOf(pubsymbol.name)
- + SimpleSerializer<MemAddr>::SizeOf(pubsymbol.address)
- + SimpleSerializer<int32_t>::SizeOf(pubsymbol.parameter_size);
- }
- static char *Write(const PublicSymbol &pubsymbol, char *dest) {
- dest = SimpleSerializer<string>::Write(pubsymbol.name, dest);
- dest = SimpleSerializer<MemAddr>::Write(pubsymbol.address, dest);
- dest = SimpleSerializer<int32_t>::Write(pubsymbol.parameter_size, dest);
- return dest;
- }
-};
-
-// Specializations of SimpleSerializer: WindowsFrameInfo
-template<>
-class SimpleSerializer<WindowsFrameInfo> {
- public:
- static size_t SizeOf(const WindowsFrameInfo &wfi) {
- unsigned int size = 0;
- size += sizeof(int32_t); // wfi.type_
- size += SimpleSerializer<int32_t>::SizeOf(wfi.valid);
- size += SimpleSerializer<uint32_t>::SizeOf(wfi.prolog_size);
- size += SimpleSerializer<uint32_t>::SizeOf(wfi.epilog_size);
- size += SimpleSerializer<uint32_t>::SizeOf(wfi.parameter_size);
- size += SimpleSerializer<uint32_t>::SizeOf(wfi.saved_register_size);
- size += SimpleSerializer<uint32_t>::SizeOf(wfi.local_size);
- size += SimpleSerializer<uint32_t>::SizeOf(wfi.max_stack_size);
- size += SimpleSerializer<bool>::SizeOf(wfi.allocates_base_pointer);
- size += SimpleSerializer<string>::SizeOf(wfi.program_string);
- return size;
- }
- static char *Write(const WindowsFrameInfo &wfi, char *dest) {
- dest = SimpleSerializer<int32_t>::Write(
- static_cast<const int32_t>(wfi.type_), dest);
- dest = SimpleSerializer<int32_t>::Write(wfi.valid, dest);
- dest = SimpleSerializer<uint32_t>::Write(wfi.prolog_size, dest);
- dest = SimpleSerializer<uint32_t>::Write(wfi.epilog_size, dest);
- dest = SimpleSerializer<uint32_t>::Write(wfi.parameter_size, dest);
- dest = SimpleSerializer<uint32_t>::Write(wfi.saved_register_size, dest);
- dest = SimpleSerializer<uint32_t>::Write(wfi.local_size, dest);
- dest = SimpleSerializer<uint32_t>::Write(wfi.max_stack_size, dest);
- dest = SimpleSerializer<bool>::Write(wfi.allocates_base_pointer, dest);
- return SimpleSerializer<string>::Write(wfi.program_string, dest);
- }
-};
-
-// Specializations of SimpleSerializer: Linked_ptr version of
-// Line, Function, PublicSymbol, WindowsFrameInfo.
-template<>
-class SimpleSerializer< linked_ptr<BasicSourceLineResolver::Line> > {
- typedef BasicSourceLineResolver::Line Line;
- public:
- static size_t SizeOf(const linked_ptr<Line> &lineptr) {
- if (lineptr.get() == NULL) return 0;
- return SimpleSerializer<Line>::SizeOf(*(lineptr.get()));
- }
- static char *Write(const linked_ptr<Line> &lineptr, char *dest) {
- if (lineptr.get())
- dest = SimpleSerializer<Line>::Write(*(lineptr.get()), dest);
- return dest;
- }
-};
-
-template<>
-class SimpleSerializer<BasicSourceLineResolver::Function> {
- // Convenient type names.
- typedef BasicSourceLineResolver::Function Function;
- typedef BasicSourceLineResolver::Line Line;
- public:
- static size_t SizeOf(const Function &func) {
- unsigned int size = 0;
- size += SimpleSerializer<string>::SizeOf(func.name);
- size += SimpleSerializer<MemAddr>::SizeOf(func.address);
- size += SimpleSerializer<MemAddr>::SizeOf(func.size);
- size += SimpleSerializer<int32_t>::SizeOf(func.parameter_size);
- size += range_map_serializer_.SizeOf(func.lines);
- return size;
- }
-
- static char *Write(const Function &func, char *dest) {
- dest = SimpleSerializer<string>::Write(func.name, dest);
- dest = SimpleSerializer<MemAddr>::Write(func.address, dest);
- dest = SimpleSerializer<MemAddr>::Write(func.size, dest);
- dest = SimpleSerializer<int32_t>::Write(func.parameter_size, dest);
- dest = range_map_serializer_.Write(func.lines, dest);
- return dest;
- }
- private:
- // This static member is defined in module_serializer.cc.
- static RangeMapSerializer< MemAddr, linked_ptr<Line> > range_map_serializer_;
-};
-
-template<>
-class SimpleSerializer< linked_ptr<BasicSourceLineResolver::Function> > {
- typedef BasicSourceLineResolver::Function Function;
- public:
- static size_t SizeOf(const linked_ptr<Function> &func) {
- if (!func.get()) return 0;
- return SimpleSerializer<Function>::SizeOf(*(func.get()));
- }
-
- static char *Write(const linked_ptr<Function> &func, char *dest) {
- if (func.get())
- dest = SimpleSerializer<Function>::Write(*(func.get()), dest);
- return dest;
- }
-};
-
-template<>
-class SimpleSerializer< linked_ptr<BasicSourceLineResolver::PublicSymbol> > {
- typedef BasicSourceLineResolver::PublicSymbol PublicSymbol;
- public:
- static size_t SizeOf(const linked_ptr<PublicSymbol> &pubsymbol) {
- if (pubsymbol.get() == NULL) return 0;
- return SimpleSerializer<PublicSymbol>::SizeOf(*(pubsymbol.get()));
- }
- static char *Write(const linked_ptr<PublicSymbol> &pubsymbol, char *dest) {
- if (pubsymbol.get())
- dest = SimpleSerializer<PublicSymbol>::Write(*(pubsymbol.get()), dest);
- return dest;
- }
-};
-
-template<>
-class SimpleSerializer< linked_ptr<WindowsFrameInfo> > {
- public:
- static size_t SizeOf(const linked_ptr<WindowsFrameInfo> &wfi) {
- if (wfi.get() == NULL) return 0;
- return SimpleSerializer<WindowsFrameInfo>::SizeOf(*(wfi.get()));
- }
- static char *Write(const linked_ptr<WindowsFrameInfo> &wfi, char *dest) {
- if (wfi.get())
- dest = SimpleSerializer<WindowsFrameInfo>::Write(*(wfi.get()), dest);
- return dest;
- }
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_SIMPLE_SERIALIZER_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/simple_serializer.h b/toolkit/crashreporter/google-breakpad/src/processor/simple_serializer.h
deleted file mode 100644
index 275f51ce36..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/simple_serializer.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// simple_serializer.h: SimpleSerializer is a template for calculating size and
-// writing to specific memory location for objects of primitive types, C-style
-// string, string, breakpad types/structs etc.
-// All specializations of SimpleSerializer template are defined in the
-// "simple_serializer-inl.h" file.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_SIMPLE_SERIALIZER_H__
-#define PROCESSOR_SIMPLE_SERIALIZER_H__
-
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-typedef uint64_t MemAddr;
-
-// Default implementation of SimpleSerializer template.
-// Specializations are defined in "simple_serializer-inl.h".
-template<class Type> class SimpleSerializer {
- public:
- // Calculate and return the size of the 'item'.
- static size_t SizeOf(const Type &item) { return sizeof(item); }
- // Write 'item' to memory location 'dest', and return to the "end" address of
- // data written, i.e., the address after the final byte written.
- static char *Write(const Type &item, char *dest) {
- new (dest) Type(item);
- return dest + SizeOf(item);
- }
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_SIMPLE_SERIALIZER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.cc b/toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.cc
deleted file mode 100644
index bc5ebb687b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// simple_symbol_supplier.cc: A simple SymbolSupplier implementation
-//
-// See simple_symbol_supplier.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "processor/simple_symbol_supplier.h"
-
-#include <assert.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#include <algorithm>
-#include <iostream>
-#include <fstream>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/logging.h"
-#include "processor/pathname_stripper.h"
-
-namespace google_breakpad {
-
-static bool file_exists(const string &file_name) {
- struct stat sb;
- return stat(file_name.c_str(), &sb) == 0;
-}
-
-SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
- const CodeModule *module, const SystemInfo *system_info,
- string *symbol_file) {
- BPLOG_IF(ERROR, !symbol_file) << "SimpleSymbolSupplier::GetSymbolFile "
- "requires |symbol_file|";
- assert(symbol_file);
- symbol_file->clear();
-
- for (unsigned int path_index = 0; path_index < paths_.size(); ++path_index) {
- SymbolResult result;
- if ((result = GetSymbolFileAtPathFromRoot(module, system_info,
- paths_[path_index],
- symbol_file)) != NOT_FOUND) {
- return result;
- }
- }
- return NOT_FOUND;
-}
-
-SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFile(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) {
- assert(symbol_data);
- symbol_data->clear();
-
- SymbolSupplier::SymbolResult s = GetSymbolFile(module, system_info,
- symbol_file);
- if (s == FOUND) {
- std::ifstream in(symbol_file->c_str());
- std::getline(in, *symbol_data, string::traits_type::to_char_type(
- string::traits_type::eof()));
- in.close();
- }
- return s;
-}
-
-SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetCStringSymbolData(
- const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) {
- assert(symbol_data);
- assert(symbol_data_size);
-
- string symbol_data_string;
- SymbolSupplier::SymbolResult s =
- GetSymbolFile(module, system_info, symbol_file, &symbol_data_string);
-
- if (s == FOUND) {
- *symbol_data_size = symbol_data_string.size() + 1;
- *symbol_data = new char[*symbol_data_size];
- if (*symbol_data == NULL) {
- BPLOG(ERROR) << "Memory allocation for size " << *symbol_data_size
- << " failed";
- return INTERRUPT;
- }
- memcpy(*symbol_data, symbol_data_string.c_str(), symbol_data_string.size());
- (*symbol_data)[symbol_data_string.size()] = '\0';
- memory_buffers_.insert(make_pair(module->code_file(), *symbol_data));
- }
- return s;
-}
-
-void SimpleSymbolSupplier::FreeSymbolData(const CodeModule *module) {
- if (!module) {
- BPLOG(INFO) << "Cannot free symbol data buffer for NULL module";
- return;
- }
-
- map<string, char *>::iterator it = memory_buffers_.find(module->code_file());
- if (it == memory_buffers_.end()) {
- BPLOG(INFO) << "Cannot find symbol data buffer for module "
- << module->code_file();
- return;
- }
- delete [] it->second;
- memory_buffers_.erase(it);
-}
-
-SymbolSupplier::SymbolResult SimpleSymbolSupplier::GetSymbolFileAtPathFromRoot(
- const CodeModule *module, const SystemInfo *system_info,
- const string &root_path, string *symbol_file) {
- BPLOG_IF(ERROR, !symbol_file) << "SimpleSymbolSupplier::GetSymbolFileAtPath "
- "requires |symbol_file|";
- assert(symbol_file);
- symbol_file->clear();
-
- if (!module)
- return NOT_FOUND;
-
- // Start with the base path.
- string path = root_path;
-
- // Append the debug (pdb) file name as a directory name.
- path.append("/");
- string debug_file_name = PathnameStripper::File(module->debug_file());
- if (debug_file_name.empty()) {
- BPLOG(ERROR) << "Can't construct symbol file path without debug_file "
- "(code_file = " <<
- PathnameStripper::File(module->code_file()) << ")";
- return NOT_FOUND;
- }
- path.append(debug_file_name);
-
- // Append the identifier as a directory name.
- path.append("/");
- string identifier = module->debug_identifier();
- if (identifier.empty()) {
- BPLOG(ERROR) << "Can't construct symbol file path without debug_identifier "
- "(code_file = " <<
- PathnameStripper::File(module->code_file()) <<
- ", debug_file = " << debug_file_name << ")";
- return NOT_FOUND;
- }
- path.append(identifier);
-
- // Transform the debug file name into one ending in .sym. If the existing
- // name ends in .pdb, strip the .pdb. Otherwise, add .sym to the non-.pdb
- // name.
- path.append("/");
- string debug_file_extension;
- if (debug_file_name.size() > 4)
- debug_file_extension = debug_file_name.substr(debug_file_name.size() - 4);
- std::transform(debug_file_extension.begin(), debug_file_extension.end(),
- debug_file_extension.begin(), tolower);
- if (debug_file_extension == ".pdb") {
- path.append(debug_file_name.substr(0, debug_file_name.size() - 4));
- } else {
- path.append(debug_file_name);
- }
- path.append(".sym");
-
- if (!file_exists(path)) {
- BPLOG(INFO) << "No symbol file at " << path;
- return NOT_FOUND;
- }
-
- *symbol_file = path;
- return FOUND;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.h b/toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.h
deleted file mode 100644
index 0cde85cdcd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/simple_symbol_supplier.h
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// simple_symbol_supplier.h: A simple SymbolSupplier implementation
-//
-// SimpleSymbolSupplier is a straightforward implementation of SymbolSupplier
-// that stores symbol files in a filesystem tree. A SimpleSymbolSupplier is
-// created with one or more base directories, which are the root paths for all
-// symbol files. Each symbol file contained therein has a directory entry in
-// the base directory with a name identical to the corresponding debugging
-// file (pdb). Within each of these directories, there are subdirectories
-// named for the debugging file's identifier. For recent pdb files, this is
-// a concatenation of the pdb's uuid and age, presented in hexadecimal form,
-// without any dashes or separators. The uuid is in uppercase hexadecimal
-// and the age is in lowercase hexadecimal. Within that subdirectory,
-// SimpleSymbolSupplier expects to find the symbol file, which is named
-// identically to the debug file, but with a .sym extension. If the original
-// debug file had a name ending in .pdb, the .pdb extension will be replaced
-// with .sym. This sample hierarchy is rooted at the "symbols" base
-// directory:
-//
-// symbols
-// symbols/test_app.pdb
-// symbols/test_app.pdb/63FE4780728D49379B9D7BB6460CB42A1
-// symbols/test_app.pdb/63FE4780728D49379B9D7BB6460CB42A1/test_app.sym
-// symbols/kernel32.pdb
-// symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542
-// symbols/kernel32.pdb/BCE8785C57B44245A669896B6A19B9542/kernel32.sym
-//
-// In this case, the uuid of test_app.pdb is
-// 63fe4780-728d-4937-9b9d-7bb6460cb42a and its age is 1.
-//
-// This scheme was chosen to be roughly analogous to the way that
-// symbol files may be accessed from Microsoft Symbol Server. A hierarchy
-// used for Microsoft Symbol Server storage is usable as a hierarchy for
-// SimpleSymbolServer, provided that the pdb files are transformed to dumped
-// format using a tool such as dump_syms, and given a .sym extension.
-//
-// SimpleSymbolSupplier will iterate over all root paths searching for
-// a symbol file existing in that path.
-//
-// SimpleSymbolSupplier supports any debugging file which can be identified
-// by a CodeModule object's debug_file and debug_identifier accessors. The
-// expected ultimate source of these CodeModule objects are MinidumpModule
-// objects; it is this class that is responsible for assigning appropriate
-// values for debug_file and debug_identifier.
-//
-// Author: Mark Mentovai
-
-#ifndef PROCESSOR_SIMPLE_SYMBOL_SUPPLIER_H__
-#define PROCESSOR_SIMPLE_SYMBOL_SUPPLIER_H__
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/symbol_supplier.h"
-
-namespace google_breakpad {
-
-using std::map;
-using std::vector;
-
-class CodeModule;
-
-class SimpleSymbolSupplier : public SymbolSupplier {
- public:
- // Creates a new SimpleSymbolSupplier, using path as the root path where
- // symbols are stored.
- explicit SimpleSymbolSupplier(const string &path) : paths_(1, path) {}
-
- // Creates a new SimpleSymbolSupplier, using paths as a list of root
- // paths where symbols may be stored.
- explicit SimpleSymbolSupplier(const vector<string> &paths) : paths_(paths) {}
-
- virtual ~SimpleSymbolSupplier() {}
-
- // Returns the path to the symbol file for the given module. See the
- // description above.
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file);
-
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data);
-
- // Allocates data buffer on heap and writes symbol data into buffer.
- // Symbol supplier ALWAYS takes ownership of the data buffer.
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size);
-
- // Free the data buffer allocated in the above GetCStringSymbolData();
- virtual void FreeSymbolData(const CodeModule *module);
-
- protected:
- SymbolResult GetSymbolFileAtPathFromRoot(const CodeModule *module,
- const SystemInfo *system_info,
- const string &root_path,
- string *symbol_file);
-
- private:
- map<string, char *> memory_buffers_;
- vector<string> paths_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_SIMPLE_SYMBOL_SUPPLIER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base.cc b/toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base.cc
deleted file mode 100644
index 6eff1f9918..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base.cc
+++ /dev/null
@@ -1,341 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// source_line_resolver_base.cc: Implementation of SourceLineResolverBase.
-//
-// See source_line_resolver_base.h and source_line_resolver_base_types.h for
-// more documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-
-#include <map>
-#include <utility>
-
-#include "google_breakpad/processor/source_line_resolver_base.h"
-#include "processor/source_line_resolver_base_types.h"
-#include "processor/module_factory.h"
-
-using std::map;
-using std::make_pair;
-
-namespace google_breakpad {
-
-SourceLineResolverBase::SourceLineResolverBase(
- ModuleFactory *module_factory)
- : modules_(new ModuleMap),
- corrupt_modules_(new ModuleSet),
- memory_buffers_(new MemoryMap),
- module_factory_(module_factory) {
-}
-
-SourceLineResolverBase::~SourceLineResolverBase() {
- ModuleMap::iterator it;
- // Iterate through ModuleMap and delete all loaded modules.
- for (it = modules_->begin(); it != modules_->end(); ++it) {
- // Delete individual module.
- delete it->second;
- }
- // Delete the map of modules.
- delete modules_;
- modules_ = NULL;
-
- // Delete the set of corrupt modules.
- delete corrupt_modules_;
- corrupt_modules_ = NULL;
-
- MemoryMap::iterator iter = memory_buffers_->begin();
- for (; iter != memory_buffers_->end(); ++iter) {
- delete [] iter->second;
- }
- // Delete the map of memory buffers.
- delete memory_buffers_;
- memory_buffers_ = NULL;
-
- delete module_factory_;
- module_factory_ = NULL;
-}
-
-bool SourceLineResolverBase::ReadSymbolFile(const string &map_file,
- char **symbol_data,
- size_t *symbol_data_size) {
- if (symbol_data == NULL || symbol_data_size == NULL) {
- BPLOG(ERROR) << "Could not Read file into Null memory pointer";
- return false;
- }
-
- struct stat buf;
- int error_code = stat(map_file.c_str(), &buf);
- if (error_code == -1) {
- string error_string;
- error_code = ErrnoString(&error_string);
- BPLOG(ERROR) << "Could not open " << map_file <<
- ", error " << error_code << ": " << error_string;
- return false;
- }
-
- off_t file_size = buf.st_size;
-
- // Allocate memory for file contents, plus a null terminator
- // since we may use strtok() on the contents.
- *symbol_data_size = file_size + 1;
- *symbol_data = new char[file_size + 1];
-
- if (*symbol_data == NULL) {
- BPLOG(ERROR) << "Could not allocate memory for " << map_file;
- return false;
- }
-
- BPLOG(INFO) << "Opening " << map_file;
-
- FILE *f = fopen(map_file.c_str(), "rt");
- if (!f) {
- string error_string;
- error_code = ErrnoString(&error_string);
- BPLOG(ERROR) << "Could not open " << map_file <<
- ", error " << error_code << ": " << error_string;
- delete [] (*symbol_data);
- *symbol_data = NULL;
- return false;
- }
-
- AutoFileCloser closer(f);
-
- int items_read = 0;
-
- items_read = fread(*symbol_data, 1, file_size, f);
-
- if (items_read != file_size) {
- string error_string;
- error_code = ErrnoString(&error_string);
- BPLOG(ERROR) << "Could not slurp " << map_file <<
- ", error " << error_code << ": " << error_string;
- delete [] (*symbol_data);
- *symbol_data = NULL;
- return false;
- }
-
- (*symbol_data)[file_size] = '\0';
- return true;
-}
-
-bool SourceLineResolverBase::LoadModule(const CodeModule *module,
- const string &map_file) {
- if (module == NULL)
- return false;
-
- // Make sure we don't already have a module with the given name.
- if (modules_->find(module->code_file()) != modules_->end()) {
- BPLOG(INFO) << "Symbols for module " << module->code_file()
- << " already loaded";
- return false;
- }
-
- BPLOG(INFO) << "Loading symbols for module " << module->code_file()
- << " from " << map_file;
-
- char *memory_buffer;
- size_t memory_buffer_size;
- if (!ReadSymbolFile(map_file, &memory_buffer, &memory_buffer_size))
- return false;
-
- BPLOG(INFO) << "Read symbol file " << map_file << " succeeded";
-
- bool load_result = LoadModuleUsingMemoryBuffer(module, memory_buffer,
- memory_buffer_size);
-
- if (load_result && !ShouldDeleteMemoryBufferAfterLoadModule()) {
- // memory_buffer has to stay alive as long as the module.
- memory_buffers_->insert(make_pair(module->code_file(), memory_buffer));
- } else {
- delete [] memory_buffer;
- }
-
- return load_result;
-}
-
-bool SourceLineResolverBase::LoadModuleUsingMapBuffer(
- const CodeModule *module, const string &map_buffer) {
- if (module == NULL)
- return false;
-
- // Make sure we don't already have a module with the given name.
- if (modules_->find(module->code_file()) != modules_->end()) {
- BPLOG(INFO) << "Symbols for module " << module->code_file()
- << " already loaded";
- return false;
- }
-
- size_t memory_buffer_size = map_buffer.size() + 1;
- char *memory_buffer = new char[memory_buffer_size];
- if (memory_buffer == NULL) {
- BPLOG(ERROR) << "Could not allocate memory for " << module->code_file();
- return false;
- }
-
- // Can't use strcpy, as the data may contain '\0's before the end.
- memcpy(memory_buffer, map_buffer.c_str(), map_buffer.size());
- memory_buffer[map_buffer.size()] = '\0';
-
- bool load_result = LoadModuleUsingMemoryBuffer(module, memory_buffer,
- memory_buffer_size);
-
- if (load_result && !ShouldDeleteMemoryBufferAfterLoadModule()) {
- // memory_buffer has to stay alive as long as the module.
- memory_buffers_->insert(make_pair(module->code_file(), memory_buffer));
- } else {
- delete [] memory_buffer;
- }
-
- return load_result;
-}
-
-bool SourceLineResolverBase::LoadModuleUsingMemoryBuffer(
- const CodeModule *module,
- char *memory_buffer,
- size_t memory_buffer_size) {
- if (!module)
- return false;
-
- // Make sure we don't already have a module with the given name.
- if (modules_->find(module->code_file()) != modules_->end()) {
- BPLOG(INFO) << "Symbols for module " << module->code_file()
- << " already loaded";
- return false;
- }
-
- BPLOG(INFO) << "Loading symbols for module " << module->code_file()
- << " from memory buffer";
-
- Module *basic_module = module_factory_->CreateModule(module->code_file());
-
- // Ownership of memory is NOT transfered to Module::LoadMapFromMemory().
- if (!basic_module->LoadMapFromMemory(memory_buffer, memory_buffer_size)) {
- BPLOG(ERROR) << "Too many error while parsing symbol data for module "
- << module->code_file();
- // Returning false from here would be an indication that the symbols for
- // this module are missing which would be wrong. Intentionally fall through
- // and add the module to both the modules_ and the corrupt_modules_ lists.
- assert(basic_module->IsCorrupt());
- }
-
- modules_->insert(make_pair(module->code_file(), basic_module));
- if (basic_module->IsCorrupt()) {
- corrupt_modules_->insert(module->code_file());
- }
- return true;
-}
-
-bool SourceLineResolverBase::ShouldDeleteMemoryBufferAfterLoadModule() {
- return true;
-}
-
-void SourceLineResolverBase::UnloadModule(const CodeModule *code_module) {
- if (!code_module)
- return;
-
- ModuleMap::iterator mod_iter = modules_->find(code_module->code_file());
- if (mod_iter != modules_->end()) {
- Module *symbol_module = mod_iter->second;
- delete symbol_module;
- corrupt_modules_->erase(mod_iter->first);
- modules_->erase(mod_iter);
- }
-
- if (ShouldDeleteMemoryBufferAfterLoadModule()) {
- // No-op. Because we never store any memory buffers.
- } else {
- // There may be a buffer stored locally, we need to find and delete it.
- MemoryMap::iterator iter = memory_buffers_->find(code_module->code_file());
- if (iter != memory_buffers_->end()) {
- delete [] iter->second;
- memory_buffers_->erase(iter);
- }
- }
-}
-
-bool SourceLineResolverBase::HasModule(const CodeModule *module) {
- if (!module)
- return false;
- return modules_->find(module->code_file()) != modules_->end();
-}
-
-bool SourceLineResolverBase::IsModuleCorrupt(const CodeModule *module) {
- if (!module)
- return false;
- return corrupt_modules_->find(module->code_file()) != corrupt_modules_->end();
-}
-
-void SourceLineResolverBase::FillSourceLineInfo(StackFrame *frame) {
- if (frame->module) {
- ModuleMap::const_iterator it = modules_->find(frame->module->code_file());
- if (it != modules_->end()) {
- it->second->LookupAddress(frame);
- }
- }
-}
-
-WindowsFrameInfo *SourceLineResolverBase::FindWindowsFrameInfo(
- const StackFrame *frame) {
- if (frame->module) {
- ModuleMap::const_iterator it = modules_->find(frame->module->code_file());
- if (it != modules_->end()) {
- return it->second->FindWindowsFrameInfo(frame);
- }
- }
- return NULL;
-}
-
-CFIFrameInfo *SourceLineResolverBase::FindCFIFrameInfo(
- const StackFrame *frame) {
- if (frame->module) {
- ModuleMap::const_iterator it = modules_->find(frame->module->code_file());
- if (it != modules_->end()) {
- return it->second->FindCFIFrameInfo(frame);
- }
- }
- return NULL;
-}
-
-bool SourceLineResolverBase::CompareString::operator()(
- const string &s1, const string &s2) const {
- return strcmp(s1.c_str(), s2.c_str()) < 0;
-}
-
-bool SourceLineResolverBase::Module::ParseCFIRuleSet(
- const string &rule_set, CFIFrameInfo *frame_info) const {
- CFIFrameInfoParseHandler handler(frame_info);
- CFIRuleParser parser(&handler);
- return parser.Parse(rule_set);
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base_types.h b/toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base_types.h
deleted file mode 100644
index 4a9dfb3ced..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/source_line_resolver_base_types.h
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// source_line_resolver_base_types.h: definition of nested classes/structs in
-// SourceLineResolverBase. It moves the definitions out of
-// source_line_resolver_base.cc, so that other classes may have access
-// to these private nested types without including source_line_resolver_base.cc
-// In addition, Module is defined as a pure abstract class to be implemented by
-// each concrete source line resolver class.
-//
-// See source_line_resolver_base.h for more documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include <stdio.h>
-
-#include <map>
-#include <string>
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/source_line_resolver_base.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/windows_frame_info.h"
-
-#ifndef PROCESSOR_SOURCE_LINE_RESOLVER_BASE_TYPES_H__
-#define PROCESSOR_SOURCE_LINE_RESOLVER_BASE_TYPES_H__
-
-namespace google_breakpad {
-
-class SourceLineResolverBase::AutoFileCloser {
- public:
- explicit AutoFileCloser(FILE *file) : file_(file) {}
- ~AutoFileCloser() {
- if (file_)
- fclose(file_);
- }
-
- private:
- FILE *file_;
-};
-
-struct SourceLineResolverBase::Line {
- Line() { }
- Line(MemAddr addr, MemAddr code_size, int file_id, int source_line)
- : address(addr)
- , size(code_size)
- , source_file_id(file_id)
- , line(source_line) { }
-
- MemAddr address;
- MemAddr size;
- int32_t source_file_id;
- int32_t line;
-};
-
-struct SourceLineResolverBase::Function {
- Function() { }
- Function(const string &function_name,
- MemAddr function_address,
- MemAddr code_size,
- int set_parameter_size)
- : name(function_name), address(function_address), size(code_size),
- parameter_size(set_parameter_size) { }
-
- string name;
- MemAddr address;
- MemAddr size;
-
- // The size of parameters passed to this function on the stack.
- int32_t parameter_size;
-};
-
-struct SourceLineResolverBase::PublicSymbol {
- PublicSymbol() { }
- PublicSymbol(const string& set_name,
- MemAddr set_address,
- int set_parameter_size)
- : name(set_name),
- address(set_address),
- parameter_size(set_parameter_size) {}
-
- string name;
- MemAddr address;
-
- // If the public symbol is used as a function entry point, parameter_size
- // is set to the size of the parameters passed to the funciton on the
- // stack, if known.
- int32_t parameter_size;
-};
-
-class SourceLineResolverBase::Module {
- public:
- virtual ~Module() { };
- // Loads a map from the given buffer in char* type.
- // Does NOT take ownership of memory_buffer (the caller, source line resolver,
- // is the owner of memory_buffer).
- // The passed in |memory buffer| is of size |memory_buffer_size|. If it is
- // not null terminated, LoadMapFromMemory will null terminate it by modifying
- // the passed in buffer.
- virtual bool LoadMapFromMemory(char *memory_buffer,
- size_t memory_buffer_size) = 0;
-
- // Tells whether the loaded symbol data is corrupt. Return value is
- // undefined, if the symbol data hasn't been loaded yet.
- virtual bool IsCorrupt() const = 0;
-
- // Looks up the given relative address, and fills the StackFrame struct
- // with the result.
- virtual void LookupAddress(StackFrame *frame) const = 0;
-
- // If Windows stack walking information is available covering ADDRESS,
- // return a WindowsFrameInfo structure describing it. If the information
- // is not available, returns NULL. A NULL return value does not indicate
- // an error. The caller takes ownership of any returned WindowsFrameInfo
- // object.
- virtual WindowsFrameInfo *
- FindWindowsFrameInfo(const StackFrame *frame) const = 0;
-
- // If CFI stack walking information is available covering ADDRESS,
- // return a CFIFrameInfo structure describing it. If the information
- // is not available, return NULL. The caller takes ownership of any
- // returned CFIFrameInfo object.
- virtual CFIFrameInfo *FindCFIFrameInfo(const StackFrame *frame) const = 0;
- protected:
- virtual bool ParseCFIRuleSet(const string &rule_set,
- CFIFrameInfo *frame_info) const;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_SOURCE_LINE_RESOLVER_BASE_TYPES_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stack_frame_cpu.cc b/toolkit/crashreporter/google-breakpad/src/processor/stack_frame_cpu.cc
deleted file mode 100644
index 6175dc7f26..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stack_frame_cpu.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stack_frame_cpu.h: CPU-specific StackFrame extensions.
-//
-// See google_breakpad/processor/stack_frame_cpu.h for documentation.
-//
-// Author: Colin Blundell
-
-#include "google_breakpad/processor/stack_frame_cpu.h"
-
-namespace google_breakpad {
-
-const uint64_t StackFrameARM64::CONTEXT_VALID_X0;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X1;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X2;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X3;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X4;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X5;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X6;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X7;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X8;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X9;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X10;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X11;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X12;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X13;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X14;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X15;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X16;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X17;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X18;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X19;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X20;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X21;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X22;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X23;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X24;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X25;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X26;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X27;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X28;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X29;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X30;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X31;
-const uint64_t StackFrameARM64::CONTEXT_VALID_X32;
-const uint64_t StackFrameARM64::CONTEXT_VALID_FP;
-const uint64_t StackFrameARM64::CONTEXT_VALID_LR;
-const uint64_t StackFrameARM64::CONTEXT_VALID_SP;
-const uint64_t StackFrameARM64::CONTEXT_VALID_PC;
-const uint64_t StackFrameARM64::CONTEXT_VALID_ALL;
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stack_frame_symbolizer.cc b/toolkit/crashreporter/google-breakpad/src/processor/stack_frame_symbolizer.cc
deleted file mode 100644
index 5c8dbe5e13..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stack_frame_symbolizer.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright (c) 2012 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Implementation of StackFrameSymbolizer, which encapsulates the logic of how
-// SourceLineResolverInterface interacts with SymbolSupplier to fill source
-// line information in a stack frame, and also looks up WindowsFrameInfo or
-// CFIFrameInfo for a stack frame.
-
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-
-#include <assert.h>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/symbol_supplier.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-StackFrameSymbolizer::StackFrameSymbolizer(
- SymbolSupplier* supplier,
- SourceLineResolverInterface* resolver) : supplier_(supplier),
- resolver_(resolver) { }
-
-StackFrameSymbolizer::SymbolizerResult StackFrameSymbolizer::FillSourceLineInfo(
- const CodeModules* modules,
- const SystemInfo* system_info,
- StackFrame* frame) {
- assert(frame);
-
- if (!modules) return kError;
- const CodeModule* module = modules->GetModuleForAddress(frame->instruction);
- if (!module) return kError;
- frame->module = module;
-
- if (!resolver_) return kError; // no resolver.
- // If module is known to have missing symbol file, return.
- if (no_symbol_modules_.find(module->code_file()) !=
- no_symbol_modules_.end()) {
- return kError;
- }
-
- // If module is already loaded, go ahead to fill source line info and return.
- if (resolver_->HasModule(frame->module)) {
- resolver_->FillSourceLineInfo(frame);
- return resolver_->IsModuleCorrupt(frame->module) ?
- kWarningCorruptSymbols : kNoError;
- }
-
- // Module needs to fetch symbol file. First check to see if supplier exists.
- if (!supplier_) {
- return kError;
- }
-
- // Start fetching symbol from supplier.
- string symbol_file;
- char* symbol_data = NULL;
- size_t symbol_data_size;
- SymbolSupplier::SymbolResult symbol_result = supplier_->GetCStringSymbolData(
- module, system_info, &symbol_file, &symbol_data, &symbol_data_size);
-
- switch (symbol_result) {
- case SymbolSupplier::FOUND: {
- bool load_success = resolver_->LoadModuleUsingMemoryBuffer(
- frame->module,
- symbol_data,
- symbol_data_size);
- if (resolver_->ShouldDeleteMemoryBufferAfterLoadModule()) {
- supplier_->FreeSymbolData(module);
- }
-
- if (load_success) {
- resolver_->FillSourceLineInfo(frame);
- return resolver_->IsModuleCorrupt(frame->module) ?
- kWarningCorruptSymbols : kNoError;
- } else {
- BPLOG(ERROR) << "Failed to load symbol file in resolver.";
- no_symbol_modules_.insert(module->code_file());
- return kError;
- }
- }
-
- case SymbolSupplier::NOT_FOUND:
- no_symbol_modules_.insert(module->code_file());
- return kError;
-
- case SymbolSupplier::INTERRUPT:
- return kInterrupt;
-
- default:
- BPLOG(ERROR) << "Unknown SymbolResult enum: " << symbol_result;
- return kError;
- }
- return kError;
-}
-
-WindowsFrameInfo* StackFrameSymbolizer::FindWindowsFrameInfo(
- const StackFrame* frame) {
- return resolver_ ? resolver_->FindWindowsFrameInfo(frame) : NULL;
-}
-
-CFIFrameInfo* StackFrameSymbolizer::FindCFIFrameInfo(
- const StackFrame* frame) {
- return resolver_ ? resolver_->FindCFIFrameInfo(frame) : NULL;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.cc
deleted file mode 100644
index 704039f348..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.cc
+++ /dev/null
@@ -1,950 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalk_common.cc: Module shared by the {micro,mini}dump_stackwalck
-// executables to print the content of dumps (w/ stack traces) on the console.
-//
-// Author: Mark Mentovai
-
-#include "processor/stackwalk_common.h"
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <string>
-#include <vector>
-
-#include "common/stdio_wrapper.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/logging.h"
-#include "processor/pathname_stripper.h"
-
-namespace google_breakpad {
-
-namespace {
-
-using std::vector;
-
-// Separator character for machine readable output.
-static const char kOutputSeparator = '|';
-
-// PrintRegister prints a register's name and value to stdout. It will
-// print four registers on a line. For the first register in a set,
-// pass 0 for |start_col|. For registers in a set, pass the most recent
-// return value of PrintRegister.
-// The caller is responsible for printing the final newline after a set
-// of registers is completely printed, regardless of the number of calls
-// to PrintRegister.
-static const int kMaxWidth = 80; // optimize for an 80-column terminal
-static int PrintRegister(const char *name, uint32_t value, int start_col) {
- char buffer[64];
- snprintf(buffer, sizeof(buffer), " %5s = 0x%08x", name, value);
-
- if (start_col + static_cast<ssize_t>(strlen(buffer)) > kMaxWidth) {
- start_col = 0;
- printf("\n ");
- }
- fputs(buffer, stdout);
-
- return start_col + strlen(buffer);
-}
-
-// PrintRegister64 does the same thing, but for 64-bit registers.
-static int PrintRegister64(const char *name, uint64_t value, int start_col) {
- char buffer[64];
- snprintf(buffer, sizeof(buffer), " %5s = 0x%016" PRIx64 , name, value);
-
- if (start_col + static_cast<ssize_t>(strlen(buffer)) > kMaxWidth) {
- start_col = 0;
- printf("\n ");
- }
- fputs(buffer, stdout);
-
- return start_col + strlen(buffer);
-}
-
-// StripSeparator takes a string |original| and returns a copy
-// of the string with all occurences of |kOutputSeparator| removed.
-static string StripSeparator(const string &original) {
- string result = original;
- string::size_type position = 0;
- while ((position = result.find(kOutputSeparator, position)) != string::npos) {
- result.erase(position, 1);
- }
- position = 0;
- while ((position = result.find('\n', position)) != string::npos) {
- result.erase(position, 1);
- }
- return result;
-}
-
-// PrintStackContents prints the stack contents of the current frame to stdout.
-static void PrintStackContents(const string &indent,
- const StackFrame *frame,
- const StackFrame *prev_frame,
- const string &cpu,
- const MemoryRegion *memory,
- const CodeModules* modules,
- SourceLineResolverInterface *resolver) {
- // Find stack range.
- int word_length = 0;
- uint64_t stack_begin = 0, stack_end = 0;
- if (cpu == "x86") {
- word_length = 4;
- const StackFrameX86 *frame_x86 = static_cast<const StackFrameX86*>(frame);
- const StackFrameX86 *prev_frame_x86 =
- static_cast<const StackFrameX86*>(prev_frame);
- if ((frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP) &&
- (prev_frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP)) {
- stack_begin = frame_x86->context.esp;
- stack_end = prev_frame_x86->context.esp;
- }
- } else if (cpu == "amd64") {
- word_length = 8;
- const StackFrameAMD64 *frame_amd64 =
- static_cast<const StackFrameAMD64*>(frame);
- const StackFrameAMD64 *prev_frame_amd64 =
- static_cast<const StackFrameAMD64*>(prev_frame);
- if ((frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RSP) &&
- (prev_frame_amd64->context_validity &
- StackFrameAMD64::CONTEXT_VALID_RSP)) {
- stack_begin = frame_amd64->context.rsp;
- stack_end = prev_frame_amd64->context.rsp;
- }
- } else if (cpu == "arm") {
- word_length = 4;
- const StackFrameARM *frame_arm = static_cast<const StackFrameARM*>(frame);
- const StackFrameARM *prev_frame_arm =
- static_cast<const StackFrameARM*>(prev_frame);
- if ((frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP) &&
- (prev_frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP)) {
- stack_begin = frame_arm->context.iregs[13];
- stack_end = prev_frame_arm->context.iregs[13];
- }
- } else if (cpu == "arm64") {
- word_length = 8;
- const StackFrameARM64 *frame_arm64 =
- static_cast<const StackFrameARM64*>(frame);
- const StackFrameARM64 *prev_frame_arm64 =
- static_cast<const StackFrameARM64*>(prev_frame);
- if ((frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_SP) &&
- (prev_frame_arm64->context_validity &
- StackFrameARM64::CONTEXT_VALID_SP)) {
- stack_begin = frame_arm64->context.iregs[31];
- stack_end = prev_frame_arm64->context.iregs[31];
- }
- }
- if (!word_length || !stack_begin || !stack_end)
- return;
-
- // Print stack contents.
- printf("\n%sStack contents:", indent.c_str());
- for(uint64_t address = stack_begin; address < stack_end; ) {
- // Print the start address of this row.
- if (word_length == 4)
- printf("\n%s %08x", indent.c_str(), static_cast<uint32_t>(address));
- else
- printf("\n%s %016" PRIx64, indent.c_str(), address);
-
- // Print data in hex.
- const int kBytesPerRow = 16;
- string data_as_string;
- for (int i = 0; i < kBytesPerRow; ++i, ++address) {
- uint8_t value = 0;
- if (address < stack_end &&
- memory->GetMemoryAtAddress(address, &value)) {
- printf(" %02x", value);
- data_as_string.push_back(isprint(value) ? value : '.');
- } else {
- printf(" ");
- data_as_string.push_back(' ');
- }
- }
- // Print data as string.
- printf(" %s", data_as_string.c_str());
- }
-
- // Try to find instruction pointers from stack.
- printf("\n%sPossible instruction pointers:\n", indent.c_str());
- for (uint64_t address = stack_begin; address < stack_end;
- address += word_length) {
- StackFrame pointee_frame;
-
- // Read a word (possible instruction pointer) from stack.
- if (word_length == 4) {
- uint32_t data32 = 0;
- memory->GetMemoryAtAddress(address, &data32);
- pointee_frame.instruction = data32;
- } else {
- uint64_t data64 = 0;
- memory->GetMemoryAtAddress(address, &data64);
- pointee_frame.instruction = data64;
- }
- pointee_frame.module =
- modules->GetModuleForAddress(pointee_frame.instruction);
-
- // Try to look up the function name.
- if (pointee_frame.module)
- resolver->FillSourceLineInfo(&pointee_frame);
-
- // Print function name.
- if (!pointee_frame.function_name.empty()) {
- if (word_length == 4) {
- printf("%s *(0x%08x) = 0x%08x", indent.c_str(),
- static_cast<uint32_t>(address),
- static_cast<uint32_t>(pointee_frame.instruction));
- } else {
- printf("%s *(0x%016" PRIx64 ") = 0x%016" PRIx64,
- indent.c_str(), address, pointee_frame.instruction);
- }
- printf(" <%s> [%s : %d + 0x%" PRIx64 "]\n",
- pointee_frame.function_name.c_str(),
- PathnameStripper::File(pointee_frame.source_file_name).c_str(),
- pointee_frame.source_line,
- pointee_frame.instruction - pointee_frame.source_line_base);
- }
- }
- printf("\n");
-}
-
-// PrintStack prints the call stack in |stack| to stdout, in a reasonably
-// useful form. Module, function, and source file names are displayed if
-// they are available. The code offset to the base code address of the
-// source line, function, or module is printed, preferring them in that
-// order. If no source line, function, or module information is available,
-// an absolute code offset is printed.
-//
-// If |cpu| is a recognized CPU name, relevant register state for each stack
-// frame printed is also output, if available.
-static void PrintStack(const CallStack *stack,
- const string &cpu,
- bool output_stack_contents,
- const MemoryRegion* memory,
- const CodeModules* modules,
- SourceLineResolverInterface* resolver) {
- int frame_count = stack->frames()->size();
- if (frame_count == 0) {
- printf(" <no frames>\n");
- }
- for (int frame_index = 0; frame_index < frame_count; ++frame_index) {
- const StackFrame *frame = stack->frames()->at(frame_index);
- printf("%2d ", frame_index);
-
- uint64_t instruction_address = frame->ReturnAddress();
-
- if (frame->module) {
- printf("%s", PathnameStripper::File(frame->module->code_file()).c_str());
- if (!frame->function_name.empty()) {
- printf("!%s", frame->function_name.c_str());
- if (!frame->source_file_name.empty()) {
- string source_file = PathnameStripper::File(frame->source_file_name);
- printf(" [%s : %d + 0x%" PRIx64 "]",
- source_file.c_str(),
- frame->source_line,
- instruction_address - frame->source_line_base);
- } else {
- printf(" + 0x%" PRIx64, instruction_address - frame->function_base);
- }
- } else {
- printf(" + 0x%" PRIx64,
- instruction_address - frame->module->base_address());
- }
- } else {
- printf("0x%" PRIx64, instruction_address);
- }
- printf("\n ");
-
- int sequence = 0;
- if (cpu == "x86") {
- const StackFrameX86 *frame_x86 =
- reinterpret_cast<const StackFrameX86*>(frame);
-
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EIP)
- sequence = PrintRegister("eip", frame_x86->context.eip, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP)
- sequence = PrintRegister("esp", frame_x86->context.esp, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBP)
- sequence = PrintRegister("ebp", frame_x86->context.ebp, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBX)
- sequence = PrintRegister("ebx", frame_x86->context.ebx, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESI)
- sequence = PrintRegister("esi", frame_x86->context.esi, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EDI)
- sequence = PrintRegister("edi", frame_x86->context.edi, sequence);
- if (frame_x86->context_validity == StackFrameX86::CONTEXT_VALID_ALL) {
- sequence = PrintRegister("eax", frame_x86->context.eax, sequence);
- sequence = PrintRegister("ecx", frame_x86->context.ecx, sequence);
- sequence = PrintRegister("edx", frame_x86->context.edx, sequence);
- sequence = PrintRegister("efl", frame_x86->context.eflags, sequence);
- }
- } else if (cpu == "ppc") {
- const StackFramePPC *frame_ppc =
- reinterpret_cast<const StackFramePPC*>(frame);
-
- if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_SRR0)
- sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence);
- if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_GPR1)
- sequence = PrintRegister("r1", frame_ppc->context.gpr[1], sequence);
- } else if (cpu == "amd64") {
- const StackFrameAMD64 *frame_amd64 =
- reinterpret_cast<const StackFrameAMD64*>(frame);
-
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RAX)
- sequence = PrintRegister64("rax", frame_amd64->context.rax, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RDX)
- sequence = PrintRegister64("rdx", frame_amd64->context.rdx, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RCX)
- sequence = PrintRegister64("rcx", frame_amd64->context.rcx, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RBX)
- sequence = PrintRegister64("rbx", frame_amd64->context.rbx, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RSI)
- sequence = PrintRegister64("rsi", frame_amd64->context.rsi, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RDI)
- sequence = PrintRegister64("rdi", frame_amd64->context.rdi, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RBP)
- sequence = PrintRegister64("rbp", frame_amd64->context.rbp, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RSP)
- sequence = PrintRegister64("rsp", frame_amd64->context.rsp, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R8)
- sequence = PrintRegister64("r8", frame_amd64->context.r8, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R9)
- sequence = PrintRegister64("r9", frame_amd64->context.r9, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R10)
- sequence = PrintRegister64("r10", frame_amd64->context.r10, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R11)
- sequence = PrintRegister64("r11", frame_amd64->context.r11, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R12)
- sequence = PrintRegister64("r12", frame_amd64->context.r12, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R13)
- sequence = PrintRegister64("r13", frame_amd64->context.r13, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R14)
- sequence = PrintRegister64("r14", frame_amd64->context.r14, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_R15)
- sequence = PrintRegister64("r15", frame_amd64->context.r15, sequence);
- if (frame_amd64->context_validity & StackFrameAMD64::CONTEXT_VALID_RIP)
- sequence = PrintRegister64("rip", frame_amd64->context.rip, sequence);
- } else if (cpu == "sparc") {
- const StackFrameSPARC *frame_sparc =
- reinterpret_cast<const StackFrameSPARC*>(frame);
-
- if (frame_sparc->context_validity & StackFrameSPARC::CONTEXT_VALID_SP)
- sequence = PrintRegister("sp", frame_sparc->context.g_r[14], sequence);
- if (frame_sparc->context_validity & StackFrameSPARC::CONTEXT_VALID_FP)
- sequence = PrintRegister("fp", frame_sparc->context.g_r[30], sequence);
- if (frame_sparc->context_validity & StackFrameSPARC::CONTEXT_VALID_PC)
- sequence = PrintRegister("pc", frame_sparc->context.pc, sequence);
- } else if (cpu == "arm") {
- const StackFrameARM *frame_arm =
- reinterpret_cast<const StackFrameARM*>(frame);
-
- // Argument registers (caller-saves), which will likely only be valid
- // for the youngest frame.
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R0)
- sequence = PrintRegister("r0", frame_arm->context.iregs[0], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R1)
- sequence = PrintRegister("r1", frame_arm->context.iregs[1], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R2)
- sequence = PrintRegister("r2", frame_arm->context.iregs[2], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R3)
- sequence = PrintRegister("r3", frame_arm->context.iregs[3], sequence);
-
- // General-purpose callee-saves registers.
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R4)
- sequence = PrintRegister("r4", frame_arm->context.iregs[4], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R5)
- sequence = PrintRegister("r5", frame_arm->context.iregs[5], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R6)
- sequence = PrintRegister("r6", frame_arm->context.iregs[6], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R7)
- sequence = PrintRegister("r7", frame_arm->context.iregs[7], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R8)
- sequence = PrintRegister("r8", frame_arm->context.iregs[8], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R9)
- sequence = PrintRegister("r9", frame_arm->context.iregs[9], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R10)
- sequence = PrintRegister("r10", frame_arm->context.iregs[10], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_R12)
- sequence = PrintRegister("r12", frame_arm->context.iregs[12], sequence);
-
- // Registers with a dedicated or conventional purpose.
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_FP)
- sequence = PrintRegister("fp", frame_arm->context.iregs[11], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_SP)
- sequence = PrintRegister("sp", frame_arm->context.iregs[13], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_LR)
- sequence = PrintRegister("lr", frame_arm->context.iregs[14], sequence);
- if (frame_arm->context_validity & StackFrameARM::CONTEXT_VALID_PC)
- sequence = PrintRegister("pc", frame_arm->context.iregs[15], sequence);
- } else if (cpu == "arm64") {
- const StackFrameARM64 *frame_arm64 =
- reinterpret_cast<const StackFrameARM64*>(frame);
-
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X0) {
- sequence =
- PrintRegister64("x0", frame_arm64->context.iregs[0], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X1) {
- sequence =
- PrintRegister64("x1", frame_arm64->context.iregs[1], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X2) {
- sequence =
- PrintRegister64("x2", frame_arm64->context.iregs[2], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X3) {
- sequence =
- PrintRegister64("x3", frame_arm64->context.iregs[3], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X4) {
- sequence =
- PrintRegister64("x4", frame_arm64->context.iregs[4], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X5) {
- sequence =
- PrintRegister64("x5", frame_arm64->context.iregs[5], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X6) {
- sequence =
- PrintRegister64("x6", frame_arm64->context.iregs[6], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X7) {
- sequence =
- PrintRegister64("x7", frame_arm64->context.iregs[7], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X8) {
- sequence =
- PrintRegister64("x8", frame_arm64->context.iregs[8], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X9) {
- sequence =
- PrintRegister64("x9", frame_arm64->context.iregs[9], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X10) {
- sequence =
- PrintRegister64("x10", frame_arm64->context.iregs[10], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X11) {
- sequence =
- PrintRegister64("x11", frame_arm64->context.iregs[11], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X12) {
- sequence =
- PrintRegister64("x12", frame_arm64->context.iregs[12], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X13) {
- sequence =
- PrintRegister64("x13", frame_arm64->context.iregs[13], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X14) {
- sequence =
- PrintRegister64("x14", frame_arm64->context.iregs[14], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X15) {
- sequence =
- PrintRegister64("x15", frame_arm64->context.iregs[15], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X16) {
- sequence =
- PrintRegister64("x16", frame_arm64->context.iregs[16], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X17) {
- sequence =
- PrintRegister64("x17", frame_arm64->context.iregs[17], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X18) {
- sequence =
- PrintRegister64("x18", frame_arm64->context.iregs[18], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X19) {
- sequence =
- PrintRegister64("x19", frame_arm64->context.iregs[19], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X20) {
- sequence =
- PrintRegister64("x20", frame_arm64->context.iregs[20], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X21) {
- sequence =
- PrintRegister64("x21", frame_arm64->context.iregs[21], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X22) {
- sequence =
- PrintRegister64("x22", frame_arm64->context.iregs[22], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X23) {
- sequence =
- PrintRegister64("x23", frame_arm64->context.iregs[23], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X24) {
- sequence =
- PrintRegister64("x24", frame_arm64->context.iregs[24], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X25) {
- sequence =
- PrintRegister64("x25", frame_arm64->context.iregs[25], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X26) {
- sequence =
- PrintRegister64("x26", frame_arm64->context.iregs[26], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X27) {
- sequence =
- PrintRegister64("x27", frame_arm64->context.iregs[27], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_X28) {
- sequence =
- PrintRegister64("x28", frame_arm64->context.iregs[28], sequence);
- }
-
- // Registers with a dedicated or conventional purpose.
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_FP) {
- sequence =
- PrintRegister64("fp", frame_arm64->context.iregs[29], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_LR) {
- sequence =
- PrintRegister64("lr", frame_arm64->context.iregs[30], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_SP) {
- sequence =
- PrintRegister64("sp", frame_arm64->context.iregs[31], sequence);
- }
- if (frame_arm64->context_validity & StackFrameARM64::CONTEXT_VALID_PC) {
- sequence =
- PrintRegister64("pc", frame_arm64->context.iregs[32], sequence);
- }
- } else if ((cpu == "mips") || (cpu == "mips64")) {
- const StackFrameMIPS* frame_mips =
- reinterpret_cast<const StackFrameMIPS*>(frame);
-
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_GP)
- sequence = PrintRegister64("gp",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_GP],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_SP)
- sequence = PrintRegister64("sp",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_SP],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_FP)
- sequence = PrintRegister64("fp",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_FP],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_RA)
- sequence = PrintRegister64("ra",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_RA],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_PC)
- sequence = PrintRegister64("pc", frame_mips->context.epc, sequence);
-
- // Save registers s0-s7
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S0)
- sequence = PrintRegister64("s0",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S0],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S1)
- sequence = PrintRegister64("s1",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S1],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S2)
- sequence = PrintRegister64("s2",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S2],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S3)
- sequence = PrintRegister64("s3",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S3],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S4)
- sequence = PrintRegister64("s4",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S4],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S5)
- sequence = PrintRegister64("s5",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S5],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S6)
- sequence = PrintRegister64("s6",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S6],
- sequence);
- if (frame_mips->context_validity & StackFrameMIPS::CONTEXT_VALID_S7)
- sequence = PrintRegister64("s7",
- frame_mips->context.iregs[MD_CONTEXT_MIPS_REG_S7],
- sequence);
- }
- printf("\n Found by: %s\n", frame->trust_description().c_str());
-
- // Print stack contents.
- if (output_stack_contents && frame_index + 1 < frame_count) {
- const string indent(" ");
- PrintStackContents(indent, frame, stack->frames()->at(frame_index + 1),
- cpu, memory, modules, resolver);
- }
- }
-}
-
-// PrintStackMachineReadable prints the call stack in |stack| to stdout,
-// in the following machine readable pipe-delimited text format:
-// thread number|frame number|module|function|source file|line|offset
-//
-// Module, function, source file, and source line may all be empty
-// depending on availability. The code offset follows the same rules as
-// PrintStack above.
-static void PrintStackMachineReadable(int thread_num, const CallStack *stack) {
- int frame_count = stack->frames()->size();
- for (int frame_index = 0; frame_index < frame_count; ++frame_index) {
- const StackFrame *frame = stack->frames()->at(frame_index);
- printf("%d%c%d%c", thread_num, kOutputSeparator, frame_index,
- kOutputSeparator);
-
- uint64_t instruction_address = frame->ReturnAddress();
-
- if (frame->module) {
- assert(!frame->module->code_file().empty());
- printf("%s", StripSeparator(PathnameStripper::File(
- frame->module->code_file())).c_str());
- if (!frame->function_name.empty()) {
- printf("%c%s", kOutputSeparator,
- StripSeparator(frame->function_name).c_str());
- if (!frame->source_file_name.empty()) {
- printf("%c%s%c%d%c0x%" PRIx64,
- kOutputSeparator,
- StripSeparator(frame->source_file_name).c_str(),
- kOutputSeparator,
- frame->source_line,
- kOutputSeparator,
- instruction_address - frame->source_line_base);
- } else {
- printf("%c%c%c0x%" PRIx64,
- kOutputSeparator, // empty source file
- kOutputSeparator, // empty source line
- kOutputSeparator,
- instruction_address - frame->function_base);
- }
- } else {
- printf("%c%c%c%c0x%" PRIx64,
- kOutputSeparator, // empty function name
- kOutputSeparator, // empty source file
- kOutputSeparator, // empty source line
- kOutputSeparator,
- instruction_address - frame->module->base_address());
- }
- } else {
- // the printf before this prints a trailing separator for module name
- printf("%c%c%c%c0x%" PRIx64,
- kOutputSeparator, // empty function name
- kOutputSeparator, // empty source file
- kOutputSeparator, // empty source line
- kOutputSeparator,
- instruction_address);
- }
- printf("\n");
- }
-}
-
-// ContainsModule checks whether a given |module| is in the vector
-// |modules_without_symbols|.
-static bool ContainsModule(
- const vector<const CodeModule*> *modules,
- const CodeModule *module) {
- assert(modules);
- assert(module);
- vector<const CodeModule*>::const_iterator iter;
- for (iter = modules->begin(); iter != modules->end(); ++iter) {
- if (module->debug_file().compare((*iter)->debug_file()) == 0 &&
- module->debug_identifier().compare((*iter)->debug_identifier()) == 0) {
- return true;
- }
- }
- return false;
-}
-
-// PrintModule prints a single |module| to stdout.
-// |modules_without_symbols| should contain the list of modules that were
-// confirmed to be missing their symbols during the stack walk.
-static void PrintModule(
- const CodeModule *module,
- const vector<const CodeModule*> *modules_without_symbols,
- const vector<const CodeModule*> *modules_with_corrupt_symbols,
- uint64_t main_address) {
- string symbol_issues;
- if (ContainsModule(modules_without_symbols, module)) {
- symbol_issues = " (WARNING: No symbols, " +
- PathnameStripper::File(module->debug_file()) + ", " +
- module->debug_identifier() + ")";
- } else if (ContainsModule(modules_with_corrupt_symbols, module)) {
- symbol_issues = " (WARNING: Corrupt symbols, " +
- PathnameStripper::File(module->debug_file()) + ", " +
- module->debug_identifier() + ")";
- }
- uint64_t base_address = module->base_address();
- printf("0x%08" PRIx64 " - 0x%08" PRIx64 " %s %s%s%s\n",
- base_address, base_address + module->size() - 1,
- PathnameStripper::File(module->code_file()).c_str(),
- module->version().empty() ? "???" : module->version().c_str(),
- main_address != 0 && base_address == main_address ? " (main)" : "",
- symbol_issues.c_str());
-}
-
-// PrintModules prints the list of all loaded |modules| to stdout.
-// |modules_without_symbols| should contain the list of modules that were
-// confirmed to be missing their symbols during the stack walk.
-static void PrintModules(
- const CodeModules *modules,
- const vector<const CodeModule*> *modules_without_symbols,
- const vector<const CodeModule*> *modules_with_corrupt_symbols) {
- if (!modules)
- return;
-
- printf("\n");
- printf("Loaded modules:\n");
-
- uint64_t main_address = 0;
- const CodeModule *main_module = modules->GetMainModule();
- if (main_module) {
- main_address = main_module->base_address();
- }
-
- unsigned int module_count = modules->module_count();
- for (unsigned int module_sequence = 0;
- module_sequence < module_count;
- ++module_sequence) {
- const CodeModule *module = modules->GetModuleAtSequence(module_sequence);
- PrintModule(module, modules_without_symbols, modules_with_corrupt_symbols,
- main_address);
- }
-}
-
-// PrintModulesMachineReadable outputs a list of loaded modules,
-// one per line, in the following machine-readable pipe-delimited
-// text format:
-// Module|{Module Filename}|{Version}|{Debug Filename}|{Debug Identifier}|
-// {Base Address}|{Max Address}|{Main}
-static void PrintModulesMachineReadable(const CodeModules *modules) {
- if (!modules)
- return;
-
- uint64_t main_address = 0;
- const CodeModule *main_module = modules->GetMainModule();
- if (main_module) {
- main_address = main_module->base_address();
- }
-
- unsigned int module_count = modules->module_count();
- for (unsigned int module_sequence = 0;
- module_sequence < module_count;
- ++module_sequence) {
- const CodeModule *module = modules->GetModuleAtSequence(module_sequence);
- uint64_t base_address = module->base_address();
- printf("Module%c%s%c%s%c%s%c%s%c0x%08" PRIx64 "%c0x%08" PRIx64 "%c%d\n",
- kOutputSeparator,
- StripSeparator(PathnameStripper::File(module->code_file())).c_str(),
- kOutputSeparator, StripSeparator(module->version()).c_str(),
- kOutputSeparator,
- StripSeparator(PathnameStripper::File(module->debug_file())).c_str(),
- kOutputSeparator,
- StripSeparator(module->debug_identifier()).c_str(),
- kOutputSeparator, base_address,
- kOutputSeparator, base_address + module->size() - 1,
- kOutputSeparator,
- main_module != NULL && base_address == main_address ? 1 : 0);
- }
-}
-
-} // namespace
-
-void PrintProcessState(const ProcessState& process_state,
- bool output_stack_contents,
- SourceLineResolverInterface* resolver) {
- // Print OS and CPU information.
- string cpu = process_state.system_info()->cpu;
- string cpu_info = process_state.system_info()->cpu_info;
- printf("Operating system: %s\n", process_state.system_info()->os.c_str());
- printf(" %s\n",
- process_state.system_info()->os_version.c_str());
- printf("CPU: %s\n", cpu.c_str());
- if (!cpu_info.empty()) {
- // This field is optional.
- printf(" %s\n", cpu_info.c_str());
- }
- printf(" %d CPU%s\n",
- process_state.system_info()->cpu_count,
- process_state.system_info()->cpu_count != 1 ? "s" : "");
- printf("\n");
-
- // Print GPU information
- string gl_version = process_state.system_info()->gl_version;
- string gl_vendor = process_state.system_info()->gl_vendor;
- string gl_renderer = process_state.system_info()->gl_renderer;
- printf("GPU:");
- if (!gl_version.empty() || !gl_vendor.empty() || !gl_renderer.empty()) {
- printf(" %s\n", gl_version.c_str());
- printf(" %s\n", gl_vendor.c_str());
- printf(" %s\n", gl_renderer.c_str());
- } else {
- printf(" UNKNOWN\n");
- }
- printf("\n");
-
- // Print crash information.
- if (process_state.crashed()) {
- printf("Crash reason: %s\n", process_state.crash_reason().c_str());
- printf("Crash address: 0x%" PRIx64 "\n", process_state.crash_address());
- } else {
- printf("No crash\n");
- }
-
- string assertion = process_state.assertion();
- if (!assertion.empty()) {
- printf("Assertion: %s\n", assertion.c_str());
- }
-
- // Compute process uptime if the process creation and crash times are
- // available in the dump.
- if (process_state.time_date_stamp() != 0 &&
- process_state.process_create_time() != 0 &&
- process_state.time_date_stamp() >= process_state.process_create_time()) {
- printf("Process uptime: %d seconds\n",
- process_state.time_date_stamp() -
- process_state.process_create_time());
- } else {
- printf("Process uptime: not available\n");
- }
-
- // If the thread that requested the dump is known, print it first.
- int requesting_thread = process_state.requesting_thread();
- if (requesting_thread != -1) {
- printf("\n");
- printf("Thread %d (%s)\n",
- requesting_thread,
- process_state.crashed() ? "crashed" :
- "requested dump, did not crash");
- PrintStack(process_state.threads()->at(requesting_thread), cpu,
- output_stack_contents,
- process_state.thread_memory_regions()->at(requesting_thread),
- process_state.modules(), resolver);
- }
-
- // Print all of the threads in the dump.
- int thread_count = process_state.threads()->size();
- for (int thread_index = 0; thread_index < thread_count; ++thread_index) {
- if (thread_index != requesting_thread) {
- // Don't print the crash thread again, it was already printed.
- printf("\n");
- printf("Thread %d\n", thread_index);
- PrintStack(process_state.threads()->at(thread_index), cpu,
- output_stack_contents,
- process_state.thread_memory_regions()->at(thread_index),
- process_state.modules(), resolver);
- }
- }
-
- PrintModules(process_state.modules(),
- process_state.modules_without_symbols(),
- process_state.modules_with_corrupt_symbols());
-}
-
-void PrintProcessStateMachineReadable(const ProcessState& process_state) {
- // Print OS and CPU information.
- // OS|{OS Name}|{OS Version}
- // CPU|{CPU Name}|{CPU Info}|{Number of CPUs}
- // GPU|{GPU version}|{GPU vendor}|{GPU renderer}
- printf("OS%c%s%c%s\n", kOutputSeparator,
- StripSeparator(process_state.system_info()->os).c_str(),
- kOutputSeparator,
- StripSeparator(process_state.system_info()->os_version).c_str());
- printf("CPU%c%s%c%s%c%d\n", kOutputSeparator,
- StripSeparator(process_state.system_info()->cpu).c_str(),
- kOutputSeparator,
- // this may be empty
- StripSeparator(process_state.system_info()->cpu_info).c_str(),
- kOutputSeparator,
- process_state.system_info()->cpu_count);
- printf("GPU%c%s%c%s%c%s\n", kOutputSeparator,
- StripSeparator(process_state.system_info()->gl_version).c_str(),
- kOutputSeparator,
- StripSeparator(process_state.system_info()->gl_vendor).c_str(),
- kOutputSeparator,
- StripSeparator(process_state.system_info()->gl_renderer).c_str());
-
- int requesting_thread = process_state.requesting_thread();
-
- // Print crash information.
- // Crash|{Crash Reason}|{Crash Address}|{Crashed Thread}
- printf("Crash%c", kOutputSeparator);
- if (process_state.crashed()) {
- printf("%s%c0x%" PRIx64 "%c",
- StripSeparator(process_state.crash_reason()).c_str(),
- kOutputSeparator, process_state.crash_address(), kOutputSeparator);
- } else {
- // print assertion info, if available, in place of crash reason,
- // instead of the unhelpful "No crash"
- string assertion = process_state.assertion();
- if (!assertion.empty()) {
- printf("%s%c%c", StripSeparator(assertion).c_str(),
- kOutputSeparator, kOutputSeparator);
- } else {
- printf("No crash%c%c", kOutputSeparator, kOutputSeparator);
- }
- }
-
- if (requesting_thread != -1) {
- printf("%d\n", requesting_thread);
- } else {
- printf("\n");
- }
-
- PrintModulesMachineReadable(process_state.modules());
-
- // blank line to indicate start of threads
- printf("\n");
-
- // If the thread that requested the dump is known, print it first.
- if (requesting_thread != -1) {
- PrintStackMachineReadable(requesting_thread,
- process_state.threads()->at(requesting_thread));
- }
-
- // Print all of the threads in the dump.
- int thread_count = process_state.threads()->size();
- for (int thread_index = 0; thread_index < thread_count; ++thread_index) {
- if (thread_index != requesting_thread) {
- // Don't print the crash thread again, it was already printed.
- PrintStackMachineReadable(thread_index,
- process_state.threads()->at(thread_index));
- }
- }
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.h
deleted file mode 100644
index a74f7b6da1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalk_common.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalk_common.cc: Module shared by the {micro,mini}dump_stackwalck
-// executables to print the content of dumps (w/ stack traces) on the console.
-
-
-#ifndef PROCESSOR_STACKWALK_COMMON_H__
-#define PROCESSOR_STACKWALK_COMMON_H__
-
-namespace google_breakpad {
-
-class ProcessState;
-class SourceLineResolverInterface;
-
-void PrintProcessStateMachineReadable(const ProcessState& process_state);
-void PrintProcessState(const ProcessState& process_state,
- bool output_stack_contents,
- SourceLineResolverInterface* resolver);
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STACKWALK_COMMON_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker.cc
deleted file mode 100644
index 98cb0b5be8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker.cc
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker.cc: Generic stackwalker.
-//
-// See stackwalker.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include "google_breakpad/processor/stackwalker.h"
-
-#include <assert.h>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/dump_context.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/stack_frame_symbolizer.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/linked_ptr.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_ppc.h"
-#include "processor/stackwalker_ppc64.h"
-#include "processor/stackwalker_sparc.h"
-#include "processor/stackwalker_x86.h"
-#include "processor/stackwalker_amd64.h"
-#include "processor/stackwalker_arm.h"
-#include "processor/stackwalker_arm64.h"
-#include "processor/stackwalker_mips.h"
-
-namespace google_breakpad {
-
-const int Stackwalker::kRASearchWords = 40;
-
-uint32_t Stackwalker::max_frames_ = 1024;
-bool Stackwalker::max_frames_set_ = false;
-
-uint32_t Stackwalker::max_frames_scanned_ = 1024;
-
-Stackwalker::Stackwalker(const SystemInfo* system_info,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer)
- : system_info_(system_info),
- memory_(memory),
- modules_(modules),
- frame_symbolizer_(frame_symbolizer) {
- assert(frame_symbolizer_);
-}
-
-void InsertSpecialAttentionModule(
- StackFrameSymbolizer::SymbolizerResult symbolizer_result,
- const CodeModule* module,
- vector<const CodeModule*>* modules) {
- if (!module) {
- return;
- }
- assert(symbolizer_result == StackFrameSymbolizer::kError ||
- symbolizer_result == StackFrameSymbolizer::kWarningCorruptSymbols);
- bool found = false;
- vector<const CodeModule*>::iterator iter;
- for (iter = modules->begin(); iter != modules->end(); ++iter) {
- if (*iter == module) {
- found = true;
- break;
- }
- }
- if (!found) {
- BPLOG(INFO) << ((symbolizer_result == StackFrameSymbolizer::kError) ?
- "Couldn't load symbols for: " :
- "Detected corrupt symbols for: ")
- << module->debug_file() << "|" << module->debug_identifier();
- modules->push_back(module);
- }
-}
-
-bool Stackwalker::Walk(
- CallStack* stack,
- vector<const CodeModule*>* modules_without_symbols,
- vector<const CodeModule*>* modules_with_corrupt_symbols) {
- BPLOG_IF(ERROR, !stack) << "Stackwalker::Walk requires |stack|";
- assert(stack);
- stack->Clear();
-
- BPLOG_IF(ERROR, !modules_without_symbols) << "Stackwalker::Walk requires "
- << "|modules_without_symbols|";
- BPLOG_IF(ERROR, !modules_without_symbols) << "Stackwalker::Walk requires "
- << "|modules_with_corrupt_symbols|";
- assert(modules_without_symbols);
- assert(modules_with_corrupt_symbols);
-
- // Begin with the context frame, and keep getting callers until there are
- // no more.
-
- // Keep track of the number of scanned or otherwise dubious frames seen
- // so far, as the caller may have set a limit.
- uint32_t scanned_frames = 0;
-
- // Take ownership of the pointer returned by GetContextFrame.
- scoped_ptr<StackFrame> frame(GetContextFrame());
-
- while (frame.get()) {
- // frame already contains a good frame with properly set instruction and
- // frame_pointer fields. The frame structure comes from either the
- // context frame (above) or a caller frame (below).
-
- // Resolve the module information, if a module map was provided.
- StackFrameSymbolizer::SymbolizerResult symbolizer_result =
- frame_symbolizer_->FillSourceLineInfo(modules_, system_info_,
- frame.get());
- switch (symbolizer_result) {
- case StackFrameSymbolizer::kInterrupt:
- BPLOG(INFO) << "Stack walk is interrupted.";
- return false;
- break;
- case StackFrameSymbolizer::kError:
- InsertSpecialAttentionModule(symbolizer_result, frame->module,
- modules_without_symbols);
- break;
- case StackFrameSymbolizer::kWarningCorruptSymbols:
- InsertSpecialAttentionModule(symbolizer_result, frame->module,
- modules_with_corrupt_symbols);
- break;
- case StackFrameSymbolizer::kNoError:
- break;
- default:
- assert(false);
- break;
- }
-
- // Keep track of the number of dubious frames so far.
- switch (frame.get()->trust) {
- case StackFrame::FRAME_TRUST_NONE:
- case StackFrame::FRAME_TRUST_SCAN:
- case StackFrame::FRAME_TRUST_CFI_SCAN:
- scanned_frames++;
- break;
- default:
- break;
- }
-
- // Add the frame to the call stack. Relinquish the ownership claim
- // over the frame, because the stack now owns it.
- stack->frames_.push_back(frame.release());
- if (stack->frames_.size() > max_frames_) {
- // Only emit an error message in the case where the limit
- // reached is the default limit, not set by the user.
- if (!max_frames_set_)
- BPLOG(ERROR) << "The stack is over " << max_frames_ << " frames.";
- break;
- }
-
- // Get the next frame and take ownership.
- bool stack_scan_allowed = scanned_frames < max_frames_scanned_;
- frame.reset(GetCallerFrame(stack, stack_scan_allowed));
- }
-
- return true;
-}
-
-
-// static
-Stackwalker* Stackwalker::StackwalkerForCPU(
- const SystemInfo* system_info,
- DumpContext* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer) {
- if (!context) {
- BPLOG(ERROR) << "Can't choose a stackwalker implementation without context";
- return NULL;
- }
-
- Stackwalker* cpu_stackwalker = NULL;
-
- uint32_t cpu = context->GetContextCPU();
- switch (cpu) {
- case MD_CONTEXT_X86:
- cpu_stackwalker = new StackwalkerX86(system_info,
- context->GetContextX86(),
- memory, modules, frame_symbolizer);
- break;
-
- case MD_CONTEXT_PPC:
- cpu_stackwalker = new StackwalkerPPC(system_info,
- context->GetContextPPC(),
- memory, modules, frame_symbolizer);
- break;
-
- case MD_CONTEXT_PPC64:
- cpu_stackwalker = new StackwalkerPPC64(system_info,
- context->GetContextPPC64(),
- memory, modules, frame_symbolizer);
- break;
-
- case MD_CONTEXT_AMD64:
- cpu_stackwalker = new StackwalkerAMD64(system_info,
- context->GetContextAMD64(),
- memory, modules, frame_symbolizer);
- break;
-
- case MD_CONTEXT_SPARC:
- cpu_stackwalker = new StackwalkerSPARC(system_info,
- context->GetContextSPARC(),
- memory, modules, frame_symbolizer);
- break;
-
- case MD_CONTEXT_MIPS:
- case MD_CONTEXT_MIPS64:
- cpu_stackwalker = new StackwalkerMIPS(system_info,
- context->GetContextMIPS(),
- memory, modules, frame_symbolizer);
- break;
-
- case MD_CONTEXT_ARM:
- {
- int fp_register = -1;
- if (system_info->os_short == "ios")
- fp_register = MD_CONTEXT_ARM_REG_IOS_FP;
- cpu_stackwalker = new StackwalkerARM(system_info,
- context->GetContextARM(),
- fp_register, memory, modules,
- frame_symbolizer);
- break;
- }
-
- case MD_CONTEXT_ARM64:
- cpu_stackwalker = new StackwalkerARM64(system_info,
- context->GetContextARM64(),
- memory, modules,
- frame_symbolizer);
- break;
- }
-
- BPLOG_IF(ERROR, !cpu_stackwalker) << "Unknown CPU type " << HexString(cpu) <<
- ", can't choose a stackwalker "
- "implementation";
- return cpu_stackwalker;
-}
-
-bool Stackwalker::InstructionAddressSeemsValid(uint64_t address) {
- StackFrame frame;
- frame.instruction = address;
- StackFrameSymbolizer::SymbolizerResult symbolizer_result =
- frame_symbolizer_->FillSourceLineInfo(modules_, system_info_, &frame);
-
- if (!frame.module) {
- // not inside any loaded module
- return false;
- }
-
- if (!frame_symbolizer_->HasImplementation()) {
- // No valid implementation to symbolize stack frame, but the address is
- // within a known module.
- return true;
- }
-
- if (symbolizer_result != StackFrameSymbolizer::kNoError &&
- symbolizer_result != StackFrameSymbolizer::kWarningCorruptSymbols) {
- // Some error occurred during symbolization, but the address is within a
- // known module
- return true;
- }
-
- return !frame.function_name.empty();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.cc
deleted file mode 100644
index e81fec282c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_address_list.cc: a pseudo stack walker.
-//
-// See stackwalker_address_list.h for documentation.
-//
-// Author: Chris Hamilton <chrisha@chromium.org>
-
-#include <assert.h>
-
-#include <vector>
-
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_address_list.h"
-
-namespace google_breakpad {
-
-StackwalkerAddressList::StackwalkerAddressList(
- const uint64_t* frames,
- size_t frame_count,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer)
- : Stackwalker(NULL, NULL, modules, frame_symbolizer),
- frames_(frames),
- frame_count_(frame_count) {
- assert(frames);
- assert(frame_symbolizer);
-}
-
-StackFrame* StackwalkerAddressList::GetContextFrame() {
- if (frame_count_ == 0)
- return NULL;
-
- StackFrame* frame = new StackFrame();
- frame->instruction = frames_[0];
- frame->trust = StackFrame::FRAME_TRUST_PREWALKED;
- return frame;
-}
-
-StackFrame* StackwalkerAddressList::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!stack) {
- BPLOG(ERROR) << "Can't get caller frame without stack";
- return NULL;
- }
-
- size_t frame_index = stack->frames()->size();
-
- // There are no more frames to fetch.
- if (frame_index >= frame_count_)
- return NULL;
-
- // All frames have the highest level of trust because they were
- // explicitly provided.
- StackFrame* frame = new StackFrame();
- frame->instruction = frames_[frame_index];
- frame->trust = StackFrame::FRAME_TRUST_PREWALKED;
- return frame;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.h
deleted file mode 100644
index 0f8c989efd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_address_list.h: a pseudo stackwalker.
-//
-// Doesn't actually walk a stack, rather initializes a CallStack given an
-// explicit list of already walked return addresses.
-//
-// Author: Chris Hamilton <chrisha@chromium.org>
-
-#ifndef PROCESSOR_STACKWALKER_ADDRESS_LIST_H_
-#define PROCESSOR_STACKWALKER_ADDRESS_LIST_H_
-
-#include "common/basictypes.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/stackwalker.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerAddressList : public Stackwalker {
- public:
- // Initializes this stack walker with an explicit set of frame addresses.
- // |modules| and |frame_symbolizer| are passed directly through to the base
- // Stackwalker constructor.
- StackwalkerAddressList(const uint64_t* frames,
- size_t frame_count,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // Implementation of Stackwalker.
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- const uint64_t* frames_;
- size_t frame_count_;
-
- DISALLOW_COPY_AND_ASSIGN(StackwalkerAddressList);
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STACKWALKER_ADDRESS_LIST_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list_unittest.cc
deleted file mode 100644
index ab4e9c0880..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_address_list_unittest.cc
+++ /dev/null
@@ -1,197 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_address_list_unittest.cc: Unit tests for the
-// StackwalkerAddressList class.
-//
-// Author: Chris Hamilton <chrisha@chromium.org>
-
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/stackwalker_unittest_utils.h"
-#include "processor/stackwalker_address_list.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::StackFrameSymbolizer;
-using google_breakpad::StackFrame;
-using google_breakpad::Stackwalker;
-using google_breakpad::StackwalkerAddressList;
-using std::vector;
-using testing::_;
-using testing::AnyNumber;
-using testing::Return;
-using testing::SetArgumentPointee;
-
-#define arraysize(f) (sizeof(f) / sizeof(*f))
-
-// Addresses and sizes of a couple dummy modules.
-uint64_t kModule1Base = 0x40000000;
-uint64_t kModule1Size = 0x10000;
-uint64_t kModule2Base = 0x50000000;
-uint64_t kModule2Size = 0x10000;
-
-// A handful of addresses that lie within the modules above.
-const uint64_t kDummyFrames[] = {
- 0x50003000, 0x50002000, 0x50001000, 0x40002000, 0x40001000 };
-
-class StackwalkerAddressListTest : public testing::Test {
- public:
- StackwalkerAddressListTest()
- : // Give the two modules reasonable standard locations and names
- // for tests to play with.
- module1(kModule1Base, kModule1Size, "module1", "version1"),
- module2(kModule2Base, kModule2Size, "module2", "version2") {
- // Create some modules with some stock debugging information.
- modules.Add(&module1);
- modules.Add(&module2);
-
- // By default, none of the modules have symbol info; call
- // SetModuleSymbols to override this.
- EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
- .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
-
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
- }
-
- // Set the Breakpad symbol information that supplier should return for
- // MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &info) {
- size_t buffer_size;
- char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
- EXPECT_CALL(supplier, GetCStringSymbolData(module, NULL, _, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
- SetArgumentPointee<4>(buffer_size),
- Return(MockSymbolSupplier::FOUND)));
- }
-
- void CheckCallStack(const CallStack& call_stack) {
- const std::vector<StackFrame*>* frames = call_stack.frames();
- ASSERT_EQ(arraysize(kDummyFrames), frames->size());
- for (size_t i = 0; i < arraysize(kDummyFrames); ++i) {
- ASSERT_EQ(kDummyFrames[i], frames->at(i)->instruction);
- ASSERT_EQ(StackFrame::FRAME_TRUST_PREWALKED, frames->at(i)->trust);
- }
- ASSERT_EQ(static_cast<const CodeModule*>(&module2), frames->at(0)->module);
- ASSERT_EQ(static_cast<const CodeModule*>(&module2), frames->at(1)->module);
- ASSERT_EQ(static_cast<const CodeModule*>(&module2), frames->at(2)->module);
- ASSERT_EQ(static_cast<const CodeModule*>(&module1), frames->at(3)->module);
- ASSERT_EQ(static_cast<const CodeModule*>(&module1), frames->at(4)->module);
- }
-
- MockCodeModule module1;
- MockCodeModule module2;
- MockCodeModules modules;
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
-};
-
-TEST_F(StackwalkerAddressListTest, ScanWithoutSymbols) {
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAddressList walker(kDummyFrames, arraysize(kDummyFrames),
- &modules, &frame_symbolizer);
-
- CallStack call_stack;
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
-
- // The stack starts in module2, so we expect that to be the first module
- // found without symbols.
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module2", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module1", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0u, modules_with_corrupt_symbols.size());
-
- ASSERT_NO_FATAL_FAILURE(CheckCallStack(call_stack));
-}
-
-TEST_F(StackwalkerAddressListTest, ScanWithSymbols) {
- // File : FILE number(dex) name
- // Function: FUNC address(hex) size(hex) parameter_size(hex) name
- // Line : address(hex) size(hex) line(dec) filenum(dec)
- SetModuleSymbols(&module2,
- "FILE 1 module2.cc\n"
- "FUNC 3000 100 10 mod2func3\n"
- "3000 10 1 1\n"
- "FUNC 2000 200 10 mod2func2\n"
- "FUNC 1000 300 10 mod2func1\n");
- SetModuleSymbols(&module1,
- "FUNC 2000 200 10 mod1func2\n"
- "FUNC 1000 300 10 mod1func1\n");
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAddressList walker(kDummyFrames, arraysize(kDummyFrames),
- &modules, &frame_symbolizer);
-
- CallStack call_stack;
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
-
- ASSERT_EQ(0u, modules_without_symbols.size());
- ASSERT_EQ(0u, modules_with_corrupt_symbols.size());
-
- ASSERT_NO_FATAL_FAILURE(CheckCallStack(call_stack));
-
- const std::vector<StackFrame*>* frames = call_stack.frames();
-
- // We have full file/line information for the first function call.
- ASSERT_EQ("mod2func3", frames->at(0)->function_name);
- ASSERT_EQ(0x50003000u, frames->at(0)->function_base);
- ASSERT_EQ("module2.cc", frames->at(0)->source_file_name);
- ASSERT_EQ(1, frames->at(0)->source_line);
- ASSERT_EQ(0x50003000u, frames->at(0)->source_line_base);
-
- ASSERT_EQ("mod2func2", frames->at(1)->function_name);
- ASSERT_EQ(0x50002000u, frames->at(1)->function_base);
-
- ASSERT_EQ("mod2func1", frames->at(2)->function_name);
- ASSERT_EQ(0x50001000u, frames->at(2)->function_base);
-
- ASSERT_EQ("mod1func2", frames->at(3)->function_name);
- ASSERT_EQ(0x40002000u, frames->at(3)->function_base);
-
- ASSERT_EQ("mod1func1", frames->at(4)->function_name);
- ASSERT_EQ(0x40001000u, frames->at(4)->function_base);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.cc
deleted file mode 100644
index 440724a1e3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.cc
+++ /dev/null
@@ -1,340 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_amd64.cc: amd64-specific stackwalker.
-//
-// See stackwalker_amd64.h for documentation.
-//
-// Author: Mark Mentovai, Ted Mielczarek
-
-#include <assert.h>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_amd64.h"
-
-namespace google_breakpad {
-
-
-const StackwalkerAMD64::CFIWalker::RegisterSet
-StackwalkerAMD64::cfi_register_map_[] = {
- // It may seem like $rip and $rsp are callee-saves, because the callee is
- // responsible for having them restored upon return. But the callee_saves
- // flags here really means that the walker should assume they're
- // unchanged if the CFI doesn't mention them --- clearly wrong for $rip
- // and $rsp.
- { "$rax", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_RAX, &MDRawContextAMD64::rax },
- { "$rdx", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_RDX, &MDRawContextAMD64::rdx },
- { "$rcx", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_RCX, &MDRawContextAMD64::rcx },
- { "$rbx", NULL, true,
- StackFrameAMD64::CONTEXT_VALID_RBX, &MDRawContextAMD64::rbx },
- { "$rsi", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_RSI, &MDRawContextAMD64::rsi },
- { "$rdi", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_RDI, &MDRawContextAMD64::rdi },
- { "$rbp", NULL, true,
- StackFrameAMD64::CONTEXT_VALID_RBP, &MDRawContextAMD64::rbp },
- { "$rsp", ".cfa", false,
- StackFrameAMD64::CONTEXT_VALID_RSP, &MDRawContextAMD64::rsp },
- { "$r8", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_R8, &MDRawContextAMD64::r8 },
- { "$r9", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_R9, &MDRawContextAMD64::r9 },
- { "$r10", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_R10, &MDRawContextAMD64::r10 },
- { "$r11", NULL, false,
- StackFrameAMD64::CONTEXT_VALID_R11, &MDRawContextAMD64::r11 },
- { "$r12", NULL, true,
- StackFrameAMD64::CONTEXT_VALID_R12, &MDRawContextAMD64::r12 },
- { "$r13", NULL, true,
- StackFrameAMD64::CONTEXT_VALID_R13, &MDRawContextAMD64::r13 },
- { "$r14", NULL, true,
- StackFrameAMD64::CONTEXT_VALID_R14, &MDRawContextAMD64::r14 },
- { "$r15", NULL, true,
- StackFrameAMD64::CONTEXT_VALID_R15, &MDRawContextAMD64::r15 },
- { "$rip", ".ra", false,
- StackFrameAMD64::CONTEXT_VALID_RIP, &MDRawContextAMD64::rip },
-};
-
-StackwalkerAMD64::StackwalkerAMD64(const SystemInfo* system_info,
- const MDRawContextAMD64* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context),
- cfi_walker_(cfi_register_map_,
- (sizeof(cfi_register_map_) / sizeof(cfi_register_map_[0]))) {
-}
-
-uint64_t StackFrameAMD64::ReturnAddress() const {
- assert(context_validity & StackFrameAMD64::CONTEXT_VALID_RIP);
- return context.rip;
-}
-
-StackFrame* StackwalkerAMD64::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFrameAMD64* frame = new StackFrameAMD64();
-
- // The instruction pointer is stored directly in a register, so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = StackFrameAMD64::CONTEXT_VALID_ALL;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.rip;
-
- return frame;
-}
-
-StackFrameAMD64* StackwalkerAMD64::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info) {
- StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
-
- scoped_ptr<StackFrameAMD64> frame(new StackFrameAMD64());
- if (!cfi_walker_
- .FindCallerRegisters(*memory_, *cfi_frame_info,
- last_frame->context, last_frame->context_validity,
- &frame->context, &frame->context_validity))
- return NULL;
-
- // Make sure we recovered all the essentials.
- static const int essentials = (StackFrameAMD64::CONTEXT_VALID_RIP
- | StackFrameAMD64::CONTEXT_VALID_RSP);
- if ((frame->context_validity & essentials) != essentials)
- return NULL;
-
- frame->trust = StackFrame::FRAME_TRUST_CFI;
- return frame.release();
-}
-
-bool StackwalkerAMD64::IsEndOfStack(uint64_t caller_rip, uint64_t caller_rsp,
- uint64_t callee_rsp) {
- // Treat an instruction address of 0 as end-of-stack.
- if (caller_rip == 0) {
- return true;
- }
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (caller_rsp < callee_rsp) {
- return true;
- }
-
- return false;
-}
-
-// Returns true if `ptr` is not in x86-64 canonical form.
-// https://en.wikipedia.org/wiki/X86-64#Virtual_address_space_details
-static bool is_non_canonical(uint64_t ptr) {
- return ptr > 0x7FFFFFFFFFFF && ptr < 0xFFFF800000000000;
-}
-
-StackFrameAMD64* StackwalkerAMD64::GetCallerByFramePointerRecovery(
- const vector<StackFrame*>& frames) {
- StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
- uint64_t last_rsp = last_frame->context.rsp;
- uint64_t last_rbp = last_frame->context.rbp;
-
- // Assume the presence of a frame pointer. This is not mandated by the
- // AMD64 ABI, c.f. section 3.2.2 footnote 7, though it is typical for
- // compilers to still preserve the frame pointer and not treat %rbp as a
- // general purpose register.
- //
- // With this assumption, the CALL instruction pushes the return address
- // onto the stack and sets %rip to the procedure to enter. The procedure
- // then establishes the stack frame with a prologue that PUSHes the current
- // %rbp onto the stack, MOVes the current %rsp to %rbp, and then allocates
- // space for any local variables. Using this procedure linking information,
- // it is possible to locate frame information for the callee:
- //
- // %caller_rsp = *(%callee_rbp + 16)
- // %caller_rip = *(%callee_rbp + 8)
- // %caller_rbp = *(%callee_rbp)
-
- // If rbp is not 8-byte aligned it can't be a frame pointer.
- if (last_rbp % 8 != 0) {
- return NULL;
- }
-
- uint64_t caller_rip, caller_rbp;
- if (memory_->GetMemoryAtAddress(last_rbp + 8, &caller_rip) &&
- memory_->GetMemoryAtAddress(last_rbp, &caller_rbp)) {
- uint64_t caller_rsp = last_rbp + 16;
-
- // If the recovered rip is not a canonical address it can't be
- // the return address, so rbp must not have been a frame pointer.
- if (is_non_canonical(caller_rip)) {
- return NULL;
- }
-
- // Simple sanity check that the stack is growing downwards as expected.
- if (IsEndOfStack(caller_rip, caller_rsp, last_rsp) ||
- caller_rbp < last_rbp) {
- // Reached end-of-stack or stack is not growing downwards.
- return NULL;
- }
-
- StackFrameAMD64* frame = new StackFrameAMD64();
- frame->trust = StackFrame::FRAME_TRUST_FP;
- frame->context = last_frame->context;
- frame->context.rip = caller_rip;
- frame->context.rsp = caller_rsp;
- frame->context.rbp = caller_rbp;
- frame->context_validity = StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP;
- return frame;
- }
-
- return NULL;
-}
-
-StackFrameAMD64* StackwalkerAMD64::GetCallerByStackScan(
- const vector<StackFrame*> &frames) {
- StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
- uint64_t last_rsp = last_frame->context.rsp;
- uint64_t caller_rip_address, caller_rip;
-
- if (!ScanForReturnAddress(last_rsp, &caller_rip_address, &caller_rip,
- frames.size() == 1 /* is_context_frame */)) {
- // No plausible return address was found.
- return NULL;
- }
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameAMD64* frame = new StackFrameAMD64();
-
- frame->trust = StackFrame::FRAME_TRUST_SCAN;
- frame->context = last_frame->context;
- frame->context.rip = caller_rip;
- // The caller's %rsp is directly underneath the return address pushed by
- // the call.
- frame->context.rsp = caller_rip_address + 8;
- frame->context_validity = StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP;
-
- // Other unwinders give up if they don't have an %rbp value, so see if we
- // can pass some plausible value on.
- if (last_frame->context_validity & StackFrameAMD64::CONTEXT_VALID_RBP) {
- // Functions typically push their caller's %rbp immediately upon entry,
- // and then set %rbp to point to that. So if the callee's %rbp is
- // pointing to the first word below the alleged return address, presume
- // that the caller's %rbp is saved there.
- if (caller_rip_address - 8 == last_frame->context.rbp) {
- uint64_t caller_rbp = 0;
- if (memory_->GetMemoryAtAddress(last_frame->context.rbp, &caller_rbp) &&
- caller_rbp > caller_rip_address) {
- frame->context.rbp = caller_rbp;
- frame->context_validity |= StackFrameAMD64::CONTEXT_VALID_RBP;
- }
- } else if (last_frame->context.rbp >= caller_rip_address + 8) {
- // If the callee's %rbp is plausible as a value for the caller's
- // %rbp, presume that the callee left it unchanged.
- frame->context.rbp = last_frame->context.rbp;
- frame->context_validity |= StackFrameAMD64::CONTEXT_VALID_RBP;
- }
- }
-
- return frame;
-}
-
-StackFrame* StackwalkerAMD64::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- const vector<StackFrame*> &frames = *stack->frames();
- StackFrameAMD64* last_frame = static_cast<StackFrameAMD64*>(frames.back());
- scoped_ptr<StackFrameAMD64> new_frame;
-
- // If we have DWARF CFI information, use it.
- scoped_ptr<CFIFrameInfo> cfi_frame_info(
- frame_symbolizer_->FindCFIFrameInfo(last_frame));
- if (cfi_frame_info.get())
- new_frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
-
- // If CFI was not available or failed, try using frame pointer recovery.
- if (!new_frame.get()) {
- new_frame.reset(GetCallerByFramePointerRecovery(frames));
- }
-
- // If all else fails, fall back to stack scanning.
- if (stack_scan_allowed && !new_frame.get()) {
- new_frame.reset(GetCallerByStackScan(frames));
- }
-
- // If nothing worked, tell the caller.
- if (!new_frame.get())
- return NULL;
-
- if (system_info_->os_short == "nacl") {
- // Apply constraints from Native Client's x86-64 sandbox. These
- // registers have the 4GB-aligned sandbox base address (from r15)
- // added to them, and only the bottom 32 bits are relevant for
- // stack walking.
- new_frame->context.rip = static_cast<uint32_t>(new_frame->context.rip);
- new_frame->context.rsp = static_cast<uint32_t>(new_frame->context.rsp);
- new_frame->context.rbp = static_cast<uint32_t>(new_frame->context.rbp);
- }
-
- if (IsEndOfStack(new_frame->context.rip, new_frame->context.rsp,
- last_frame->context.rsp)) {
- // Reached end-of-stack.
- return NULL;
- }
-
- // new_frame->context.rip is the return address, which is the instruction
- // after the CALL that caused us to arrive at the callee. Set
- // new_frame->instruction to one less than that, so it points within the
- // CALL instruction. See StackFrame::instruction for details, and
- // StackFrameAMD64::ReturnAddress.
- new_frame->instruction = new_frame->context.rip - 1;
-
- return new_frame.release();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.h
deleted file mode 100644
index 67c4551048..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_amd64.h: amd64-specific stackwalker.
-//
-// Provides stack frames given amd64 register context and a memory region
-// corresponding to a amd64 stack.
-//
-// Author: Mark Mentovai, Ted Mielczarek
-
-
-#ifndef PROCESSOR_STACKWALKER_AMD64_H__
-#define PROCESSOR_STACKWALKER_AMD64_H__
-
-#include <vector>
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/cfi_frame_info.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerAMD64 : public Stackwalker {
- public:
- // context is a amd64 context object that gives access to amd64-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerAMD64(const SystemInfo* system_info,
- const MDRawContextAMD64* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // A STACK CFI-driven frame walker for the AMD64
- typedef SimpleCFIWalker<uint64_t, MDRawContextAMD64> CFIWalker;
-
- // Implementation of Stackwalker, using amd64 context (stack pointer in %rsp,
- // stack base in %rbp) and stack conventions (saved stack pointer at 0(%rbp))
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Use cfi_frame_info (derived from STACK CFI records) to construct
- // the frame that called frames.back(). The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameAMD64* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info);
-
- // Checks whether end-of-stack is reached. An instruction address of 0 is an
- // end-of-stack marker. If the stack pointer of the caller is at a lower
- // address than the stack pointer of the callee, then that's clearly incorrect
- // and it is treated as end-of-stack to enforce progress and avoid infinite
- // loops.
- bool IsEndOfStack(uint64_t caller_rip, uint64_t caller_rsp,
- uint64_t callee_rsp);
-
- // Assumes a traditional frame layout where the frame pointer has not been
- // omitted. The expectation is that caller's %rbp is pushed to the stack
- // after the return address of the callee, and that the callee's %rsp can
- // be used to find the pushed %rbp.
- // Caller owns the returned frame object. Returns NULL on failure.
- StackFrameAMD64* GetCallerByFramePointerRecovery(
- const vector<StackFrame*>& frames);
-
- // Scan the stack for plausible return addresses. The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameAMD64* GetCallerByStackScan(const vector<StackFrame*> &frames);
-
- // Stores the CPU context corresponding to the innermost stack frame to
- // be returned by GetContextFrame.
- const MDRawContextAMD64* context_;
-
- // Our register map, for cfi_walker_.
- static const CFIWalker::RegisterSet cfi_register_map_[];
-
- // Our CFI frame walker.
- const CFIWalker cfi_walker_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_AMD64_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc
deleted file mode 100644
index 935bef866b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_amd64_unittest.cc
+++ /dev/null
@@ -1,932 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// stackwalker_amd64_unittest.cc: Unit tests for StackwalkerAMD64 class.
-
-#include <string.h>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/stackwalker_unittest_utils.h"
-#include "processor/stackwalker_amd64.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::StackFrameSymbolizer;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFrameAMD64;
-using google_breakpad::Stackwalker;
-using google_breakpad::StackwalkerAMD64;
-using google_breakpad::SystemInfo;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using std::vector;
-using testing::_;
-using testing::AnyNumber;
-using testing::Return;
-using testing::SetArgumentPointee;
-using testing::Test;
-
-class StackwalkerAMD64Fixture {
- public:
- StackwalkerAMD64Fixture()
- : stack_section(kLittleEndian),
- // Give the two modules reasonable standard locations and names
- // for tests to play with.
- module1(0x00007400c0000000ULL, 0x10000, "module1", "version1"),
- module2(0x00007500b0000000ULL, 0x10000, "module2", "version2") {
- // Identify the system as a Linux system.
- system_info.os = "Linux";
- system_info.os_short = "linux";
- system_info.os_version = "Horrendous Hippo";
- system_info.cpu = "x86";
- system_info.cpu_info = "";
-
- // Put distinctive values in the raw CPU context.
- BrandContext(&raw_context);
-
- // Create some modules with some stock debugging information.
- modules.Add(&module1);
- modules.Add(&module2);
-
- // By default, none of the modules have symbol info; call
- // SetModuleSymbols to override this.
- EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
- .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
-
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
-
- // Reset max_frames_scanned since it's static.
- Stackwalker::set_max_frames_scanned(1024);
- }
-
- // Set the Breakpad symbol information that supplier should return for
- // MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &info) {
- size_t buffer_size;
- char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
- EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
- SetArgumentPointee<4>(buffer_size),
- Return(MockSymbolSupplier::FOUND)));
- }
-
- // Populate stack_region with the contents of stack_section. Use
- // stack_section.start() as the region's starting address.
- void RegionFromSection() {
- string contents;
- ASSERT_TRUE(stack_section.GetContents(&contents));
- stack_region.Init(stack_section.start().Value(), contents);
- }
-
- // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
- void BrandContext(MDRawContextAMD64 *raw_context) {
- uint8_t x = 173;
- for (size_t i = 0; i < sizeof(*raw_context); i++)
- reinterpret_cast<uint8_t *>(raw_context)[i] = (x += 17);
- }
-
- SystemInfo system_info;
- MDRawContextAMD64 raw_context;
- Section stack_section;
- MockMemoryRegion stack_region;
- MockCodeModule module1;
- MockCodeModule module2;
- MockCodeModules modules;
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- CallStack call_stack;
- const vector<StackFrame *> *frames;
-};
-
-class GetContextFrame: public StackwalkerAMD64Fixture, public Test { };
-
-class SanityCheck: public StackwalkerAMD64Fixture, public Test { };
-
-TEST_F(SanityCheck, NoResolver) {
- // There should be no references to the stack in this walk: we don't
- // provide any call frame information, so trying to reconstruct the
- // context frame's caller should fail. So there's no need for us to
- // provide stack contents.
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = 0x8000000080000000ULL;
-
- StackFrameSymbolizer frame_symbolizer(NULL, NULL);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- // This should succeed even without a resolver or supplier.
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_GE(1U, frames->size());
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-TEST_F(GetContextFrame, Simple) {
- // There should be no references to the stack in this walk: we don't
- // provide any call frame information, so trying to reconstruct the
- // context frame's caller should fail. So there's no need for us to
- // provide stack contents.
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = 0x8000000080000000ULL;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_GE(1U, frames->size());
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-// The stackwalker should be able to produce the context frame even
-// without stack memory present.
-TEST_F(GetContextFrame, NoStackMemory) {
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = 0x8000000080000000ULL;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, NULL, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_GE(1U, frames->size());
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetCallerFrame: public StackwalkerAMD64Fixture, public Test { };
-
-TEST_F(GetCallerFrame, ScanWithoutSymbols) {
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- // Force scanning through three frames to ensure that the
- // stack pointer is set properly in scan-recovered frames.
- stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address1 = 0x00007500b0000100ULL;
- uint64_t return_address2 = 0x00007500b0000900ULL;
- Label frame1_sp, frame2_sp, frame1_rbp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x00007400b0000000ULL) // junk that's not
- .D64(0x00007500d0000000ULL) // a return address
-
- .D64(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D64(0x00007400b0000000ULL) // more junk
- .D64(0x00007500d0000000ULL)
-
- .Mark(&frame1_rbp)
- .D64(stack_section.start()) // This is in the right place to be
- // a saved rbp, but it's bogus, so
- // we shouldn't report it.
-
- .D64(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
-
- RegionFromSection();
-
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = frame1_rbp.Value();
- raw_context.rsp = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.rip);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
- EXPECT_EQ(frame1_rbp.Value(), frame1->context.rbp);
-
- StackFrameAMD64 *frame2 = static_cast<StackFrameAMD64 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP),
- frame2->context_validity);
- EXPECT_EQ(return_address2, frame2->context.rip);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.rsp);
-}
-
-TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
- // During stack scanning, if a potential return address
- // is located within a loaded module that has symbols,
- // it is only considered a valid return address if it
- // lies within a function's bounds.
- stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address = 0x00007500b0000110ULL;
- Label frame1_sp, frame1_rbp;
-
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x00007400b0000000ULL) // junk that's not
- .D64(0x00007500b0000000ULL) // a return address
-
- .D64(0x00007400c0001000ULL) // a couple of plausible addresses
- .D64(0x00007500b000aaaaULL) // that are not within functions
-
- .D64(return_address) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(32, 0) // end of stack
- .Mark(&frame1_rbp);
- RegionFromSection();
-
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = frame1_rbp.Value();
- raw_context.rsp = stack_section.start().Value();
-
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 100 400 10 platypus\n");
- SetModuleSymbols(&module2,
- // The calling frame's function.
- "FUNC 100 400 10 echidna\n");
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ("platypus", frame0->function_name);
- EXPECT_EQ(0x00007400c0000100ULL, frame0->function_base);
-
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP),
- frame1->context_validity);
- EXPECT_EQ(return_address, frame1->context.rip);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
- EXPECT_EQ(frame1_rbp.Value(), frame1->context.rbp);
- EXPECT_EQ("echidna", frame1->function_name);
- EXPECT_EQ(0x00007500b0000100ULL, frame1->function_base);
-}
-
-// StackwalkerAMD64::GetCallerByFramePointerRecovery should never return an
-// instruction pointer of 0 because IP of 0 is an end of stack marker and the
-// stack walk may be terminated prematurely. Instead it should return NULL
-// so that the stack walking code can proceed to stack scanning.
-TEST_F(GetCallerFrame, GetCallerByFramePointerRecovery) {
- MockCodeModule user32_dll(0x00007ff9cb8a0000ULL, 0x14E000, "user32.dll",
- "version1");
- SetModuleSymbols(&user32_dll, // user32.dll
- "PUBLIC fa60 0 DispatchMessageWorker\n"
- "PUBLIC fee0 0 UserCallWinProcCheckWow\n"
- "PUBLIC 1cdb0 0 _fnHkINLPMSG\n"
- "STACK CFI INIT fa60 340 .cfa: $rsp .ra: .cfa 8 - ^\n"
- "STACK CFI fa60 .cfa: $rsp 128 +\n"
- "STACK CFI INIT fee0 49f .cfa: $rsp .ra: .cfa 8 - ^\n"
- "STACK CFI fee0 .cfa: $rsp 240 +\n"
- "STACK CFI INIT 1cdb0 9f .cfa: $rsp .ra: .cfa 8 - ^\n"
- "STACK CFI 1cdb0 .cfa: $rsp 80 +\n");
-
- // Create some modules with some stock debugging information.
- MockCodeModules local_modules;
- local_modules.Add(&user32_dll);
-
- Label frame0_rsp;
- Label frame0_rbp;
- Label frame1_rsp;
- Label frame2_rsp;
-
- stack_section.start() = 0x00000099abf0f238ULL;
- stack_section
- .Mark(&frame0_rsp)
- .D64(0x00007ff9cb8b00dcULL)
- .Mark(&frame1_rsp)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000001ULL)
- .D64(0x00000099abf0f308ULL)
- .D64(0x00007ff9cb8bce3aULL) // Stack residue from execution of
- // user32!_fnHkINLPMSG+0x8a
- .D64(0x000000000000c2e0ULL)
- .D64(0x00000099abf0f328ULL)
- .D64(0x0000000100000001ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x00007ff9ccad53e4ULL)
- .D64(0x0000000000000048ULL)
- .D64(0x0000000000000001ULL)
- .D64(0x00000099abf0f5e0ULL)
- .D64(0x00000099b61f7388ULL)
- .D64(0x0000000000000030ULL)
- .D64(0xffffff66540f0a1fULL)
- .D64(0xffffff6649e08c77ULL)
- .D64(0x00007ff9cb8affb4ULL) // Return address in
- // user32!UserCallWinProcCheckWow+0xd4
- .D64(0x0000000000000000ULL)
- .D64(0x00000099abf0f368ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x0000000000000000ULL)
- .D64(0x00000099a8150fd8ULL)
- .D64(0x00000099abf0f3e8ULL)
- .D64(0x00007ff9cb8afc07ULL) // Return address in
- // user32!DispatchMessageWorker+0x1a7
- .Mark(&frame2_rsp)
- .Append(256, 0)
- .Mark(&frame0_rbp) // The following are expected by
- // GetCallerByFramePointerRecovery.
- .D64(0xfffffffffffffffeULL) // %caller_rbp = *(%callee_rbp)
- .D64(0x0000000000000000ULL) // %caller_rip = *(%callee_rbp + 8)
- .D64(0x00000099a3e31040ULL) // %caller_rsp = *(%callee_rbp + 16)
- .Append(256, 0);
-
- RegionFromSection();
- raw_context.rip = 0x00000099a8150fd8ULL; // IP in context frame is guarbage
- raw_context.rsp = frame0_rsp.Value();
- raw_context.rbp = frame0_rbp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region,
- &local_modules, &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
-
- ASSERT_EQ(3U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame->context_validity);
- EXPECT_EQ("", frame->function_name);
- EXPECT_EQ(0x00000099a8150fd8ULL, frame->instruction);
- EXPECT_EQ(0x00000099a8150fd8ULL, frame->context.rip);
- EXPECT_EQ(frame0_rsp.Value(), frame->context.rsp);
- EXPECT_EQ(frame0_rbp.Value(), frame->context.rbp);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP),
- frame->context_validity);
- EXPECT_EQ("UserCallWinProcCheckWow", frame->function_name);
- EXPECT_EQ(140710838468828ULL, frame->instruction + 1);
- EXPECT_EQ(140710838468828ULL, frame->context.rip);
- EXPECT_EQ(frame1_rsp.Value(), frame->context.rsp);
- EXPECT_EQ(&user32_dll, frame->module);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameAMD64 *frame = static_cast<StackFrameAMD64 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP),
- frame->context_validity);
- EXPECT_EQ("DispatchMessageWorker", frame->function_name);
- EXPECT_EQ(140710838467591ULL, frame->instruction + 1);
- EXPECT_EQ(140710838467591ULL, frame->context.rip);
- EXPECT_EQ(frame2_rsp.Value(), frame->context.rsp);
- EXPECT_EQ(&user32_dll, frame->module);
- }
-}
-
-// Don't use frame pointer recovery if %rbp is not 8-byte aligned, which
-// indicates that it's not being used as a frame pointer.
-TEST_F(GetCallerFrame, FramePointerNotAligned) {
- stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address1 = 0x00007500b0000100ULL;
- Label frame0_rbp, not_frame1_rbp, frame1_sp;
- stack_section
- // frame 0
- .Align(8, 0)
- .Append(2, 0) // mis-align the frame pointer
- .Mark(&frame0_rbp)
- .D64(not_frame1_rbp) // not the previous frame pointer
- .D64(0x00007500b0000a00ULL) // plausible but wrong return address
- .Align(8, 0)
- .D64(return_address1) // return address
- // frame 1
- .Mark(&frame1_sp)
- .Mark(&not_frame1_rbp)
- .Append(32, 0); // end of stack
-
-
- RegionFromSection();
-
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = frame0_rbp.Value();
- raw_context.rsp = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.rip);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
-}
-
-// Don't use frame pointer recovery if the recovered %rip is not
-// a canonical x86-64 address.
-TEST_F(GetCallerFrame, NonCanonicalInstructionPointerFromFramePointer) {
- stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address1 = 0x00007500b0000100ULL;
- Label frame0_rbp, frame1_sp, not_frame1_bp;
- stack_section
- // frame 0
- .Align(8, 0)
- .Mark(&frame0_rbp)
- .D64(not_frame1_bp) // some junk on the stack
- .D64(0xDADADADADADADADA) // not the return address
- .D64(return_address1) // return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0)
- .Mark(&not_frame1_bp)
- .Append(32, 0); // end of stack
-
-
- RegionFromSection();
-
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = frame0_rbp.Value();
- raw_context.rsp = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.rip);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
-}
-
-// Test that set_max_frames_scanned prevents using stack scanning
-// to find caller frames.
-TEST_F(GetCallerFrame, ScanningNotAllowed) {
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address1 = 0x00007500b0000100ULL;
- uint64_t return_address2 = 0x00007500b0000900ULL;
- Label frame1_sp, frame2_sp, frame1_rbp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x00007400b0000000ULL) // junk that's not
- .D64(0x00007500d0000000ULL) // a return address
-
- .D64(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D64(0x00007400b0000000ULL) // more junk
- .D64(0x00007500d0000000ULL)
-
- .Mark(&frame1_rbp)
- .D64(stack_section.start()) // This is in the right place to be
- // a saved rbp, but it's bogus, so
- // we shouldn't report it.
-
- .D64(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
-
- RegionFromSection();
-
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = frame1_rbp.Value();
- raw_context.rsp = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- Stackwalker::set_max_frames_scanned(0);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-}
-
-TEST_F(GetCallerFrame, CallerPushedRBP) {
- // Functions typically push their %rbp upon entry and set %rbp pointing
- // there. If stackwalking finds a plausible address for the next frame's
- // %rbp directly below the return address, assume that it is indeed the
- // next frame's %rbp.
- stack_section.start() = 0x8000000080000000ULL;
- uint64_t return_address = 0x00007500b0000110ULL;
- Label frame0_rbp, frame1_sp, frame1_rbp;
-
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x00007400b0000000ULL) // junk that's not
- .D64(0x00007500b0000000ULL) // a return address
-
- .D64(0x00007400c0001000ULL) // a couple of plausible addresses
- .D64(0x00007500b000aaaaULL) // that are not within functions
-
- .Mark(&frame0_rbp)
- .D64(frame1_rbp) // caller-pushed %rbp
- .D64(return_address) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(32, 0) // body of frame1
- .Mark(&frame1_rbp); // end of stack
- RegionFromSection();
-
- raw_context.rip = 0x00007400c0000200ULL;
- raw_context.rbp = frame0_rbp.Value();
- raw_context.rsp = stack_section.start().Value();
-
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 100 400 10 sasquatch\n");
- SetModuleSymbols(&module2,
- // The calling frame's function.
- "FUNC 100 400 10 yeti\n");
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(frame0_rbp.Value(), frame0->context.rbp);
- EXPECT_EQ("sasquatch", frame0->function_name);
- EXPECT_EQ(0x00007400c0000100ULL, frame0->function_base);
-
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP),
- frame1->context_validity);
- EXPECT_EQ(return_address, frame1->context.rip);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.rsp);
- EXPECT_EQ(frame1_rbp.Value(), frame1->context.rbp);
- EXPECT_EQ("yeti", frame1->function_name);
- EXPECT_EQ(0x00007500b0000100ULL, frame1->function_base);
-}
-
-struct CFIFixture: public StackwalkerAMD64Fixture {
- CFIFixture() {
- // Provide a bunch of STACK CFI records; we'll walk to the caller
- // from every point in this series, expecting to find the same set
- // of register values.
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 4000 1000 10 enchiridion\n"
- // Initially, just a return address.
- "STACK CFI INIT 4000 100 .cfa: $rsp 8 + .ra: .cfa 8 - ^\n"
- // Push %rbx.
- "STACK CFI 4001 .cfa: $rsp 16 + $rbx: .cfa 16 - ^\n"
- // Save %r12 in %rbx. Weird, but permitted.
- "STACK CFI 4002 $r12: $rbx\n"
- // Allocate frame space, and save %r13.
- "STACK CFI 4003 .cfa: $rsp 40 + $r13: .cfa 32 - ^\n"
- // Put the return address in %r13.
- "STACK CFI 4005 .ra: $r13\n"
- // Save %rbp, and use it as a frame pointer.
- "STACK CFI 4006 .cfa: $rbp 16 + $rbp: .cfa 24 - ^\n"
-
- // The calling function.
- "FUNC 5000 1000 10 epictetus\n"
- // Mark it as end of stack.
- "STACK CFI INIT 5000 1000 .cfa: $rsp .ra 0\n");
-
- // Provide some distinctive values for the caller's registers.
- expected.rsp = 0x8000000080000000ULL;
- expected.rip = 0x00007400c0005510ULL;
- expected.rbp = 0x68995b1de4700266ULL;
- expected.rbx = 0x5a5beeb38de23be8ULL;
- expected.r12 = 0xed1b02e8cc0fc79cULL;
- expected.r13 = 0x1d20ad8acacbe930ULL;
- expected.r14 = 0xe94cffc2f7adaa28ULL;
- expected.r15 = 0xb638d17d8da413b5ULL;
-
- // By default, registers are unchanged.
- raw_context = expected;
- }
-
- // Walk the stack, using stack_section as the contents of the stack
- // and raw_context as the current register values. (Set
- // raw_context.rsp to the stack's starting address.) Expect two
- // stack frames; in the older frame, expect the callee-saves
- // registers to have values matching those in 'expected'.
- void CheckWalk() {
- RegionFromSection();
- raw_context.rsp = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerAMD64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameAMD64 *frame0 = static_cast<StackFrameAMD64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameAMD64::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ("enchiridion", frame0->function_name);
- EXPECT_EQ(0x00007400c0004000ULL, frame0->function_base);
-
- StackFrameAMD64 *frame1 = static_cast<StackFrameAMD64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameAMD64::CONTEXT_VALID_RIP |
- StackFrameAMD64::CONTEXT_VALID_RSP |
- StackFrameAMD64::CONTEXT_VALID_RBP |
- StackFrameAMD64::CONTEXT_VALID_RBX |
- StackFrameAMD64::CONTEXT_VALID_R12 |
- StackFrameAMD64::CONTEXT_VALID_R13 |
- StackFrameAMD64::CONTEXT_VALID_R14 |
- StackFrameAMD64::CONTEXT_VALID_R15),
- frame1->context_validity);
- EXPECT_EQ(expected.rip, frame1->context.rip);
- EXPECT_EQ(expected.rsp, frame1->context.rsp);
- EXPECT_EQ(expected.rbp, frame1->context.rbp);
- EXPECT_EQ(expected.rbx, frame1->context.rbx);
- EXPECT_EQ(expected.r12, frame1->context.r12);
- EXPECT_EQ(expected.r13, frame1->context.r13);
- EXPECT_EQ(expected.r14, frame1->context.r14);
- EXPECT_EQ(expected.r15, frame1->context.r15);
- EXPECT_EQ("epictetus", frame1->function_name);
- }
-
- // The values we expect to find for the caller's registers.
- MDRawContextAMD64 expected;
-};
-
-class CFI: public CFIFixture, public Test { };
-
-TEST_F(CFI, At4000) {
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x00007400c0005510ULL) // return address
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004000ULL;
- CheckWalk();
-}
-
-TEST_F(CFI, At4001) {
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x00007400c0005510ULL) // return address
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004001ULL;
- raw_context.rbx = 0xbe0487d2f9eafe29ULL; // callee's (distinct) %rbx value
- CheckWalk();
-}
-
-TEST_F(CFI, At4002) {
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x00007400c0005510ULL) // return address
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004002ULL;
- raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
- raw_context.r12 = 0xb0118de918a4bceaULL; // callee's (distinct) %r12 value
- CheckWalk();
-}
-
-TEST_F(CFI, At4003) {
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x0e023828dffd4d81ULL) // garbage
- .D64(0x1d20ad8acacbe930ULL) // saved %r13
- .D64(0x319e68b49e3ace0fULL) // garbage
- .D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x00007400c0005510ULL) // return address
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004003ULL;
- raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
- raw_context.r12 = 0x89d04fa804c87a43ULL; // callee's (distinct) %r12
- raw_context.r13 = 0x5118e02cbdb24b03ULL; // callee's (distinct) %r13
- CheckWalk();
-}
-
-// The results here should be the same as those at module offset 0x4003.
-TEST_F(CFI, At4004) {
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x0e023828dffd4d81ULL) // garbage
- .D64(0x1d20ad8acacbe930ULL) // saved %r13
- .D64(0x319e68b49e3ace0fULL) // garbage
- .D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0x00007400c0005510ULL) // return address
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004004ULL;
- raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
- raw_context.r12 = 0x89d04fa804c87a43ULL; // callee's (distinct) %r12
- raw_context.r13 = 0x5118e02cbdb24b03ULL; // callee's (distinct) %r13
- CheckWalk();
-}
-
-TEST_F(CFI, At4005) {
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x4b516dd035745953ULL) // garbage
- .D64(0x1d20ad8acacbe930ULL) // saved %r13
- .D64(0xa6d445e16ae3d872ULL) // garbage
- .D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0xaa95fa054aedfbaeULL) // garbage
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004005ULL;
- raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
- raw_context.r12 = 0x46b1b8868891b34aULL; // callee's %r12
- raw_context.r13 = 0x00007400c0005510ULL; // return address
- CheckWalk();
-}
-
-TEST_F(CFI, At4006) {
- Label frame0_rbp;
- Label frame1_rsp = expected.rsp;
- stack_section
- .D64(0x043c6dfceb91aa34ULL) // garbage
- .D64(0x1d20ad8acacbe930ULL) // saved %r13
- .D64(0x68995b1de4700266ULL) // saved %rbp
- .Mark(&frame0_rbp) // frame pointer points here
- .D64(0x5a5beeb38de23be8ULL) // saved %rbx
- .D64(0xf015ee516ad89eabULL) // garbage
- .Mark(&frame1_rsp); // This effectively sets stack_section.start().
- raw_context.rip = 0x00007400c0004006ULL;
- raw_context.rbp = frame0_rbp.Value();
- raw_context.rbx = 0xed1b02e8cc0fc79cULL; // saved %r12
- raw_context.r12 = 0x26e007b341acfebdULL; // callee's %r12
- raw_context.r13 = 0x00007400c0005510ULL; // return address
- CheckWalk();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.cc
deleted file mode 100644
index e4fc58697d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.cc
+++ /dev/null
@@ -1,296 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_arm.cc: arm-specific stackwalker.
-//
-// See stackwalker_arm.h for documentation.
-//
-// Author: Mark Mentovai, Ted Mielczarek, Jim Blandy
-
-#include <vector>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_arm.h"
-
-namespace google_breakpad {
-
-
-StackwalkerARM::StackwalkerARM(const SystemInfo* system_info,
- const MDRawContextARM* context,
- int fp_register,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context), fp_register_(fp_register),
- context_frame_validity_(StackFrameARM::CONTEXT_VALID_ALL) { }
-
-
-StackFrame* StackwalkerARM::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFrameARM* frame = new StackFrameARM();
-
- // The instruction pointer is stored directly in a register (r15), so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = context_frame_validity_;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.iregs[MD_CONTEXT_ARM_REG_PC];
-
- return frame;
-}
-
-StackFrameARM* StackwalkerARM::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info) {
- StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
-
- static const char* register_names[] = {
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "sp", "lr", "pc",
- "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7",
- "fps", "cpsr",
- NULL
- };
-
- // Populate a dictionary with the valid register values in last_frame.
- CFIFrameInfo::RegisterValueMap<uint32_t> callee_registers;
- for (int i = 0; register_names[i]; i++)
- if (last_frame->context_validity & StackFrameARM::RegisterValidFlag(i))
- callee_registers[register_names[i]] = last_frame->context.iregs[i];
-
- // Use the STACK CFI data to recover the caller's register values.
- CFIFrameInfo::RegisterValueMap<uint32_t> caller_registers;
- if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
- &caller_registers))
- return NULL;
-
- // Construct a new stack frame given the values the CFI recovered.
- scoped_ptr<StackFrameARM> frame(new StackFrameARM());
- for (int i = 0; register_names[i]; i++) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::iterator entry =
- caller_registers.find(register_names[i]);
- if (entry != caller_registers.end()) {
- // We recovered the value of this register; fill the context with the
- // value from caller_registers.
- frame->context_validity |= StackFrameARM::RegisterValidFlag(i);
- frame->context.iregs[i] = entry->second;
- } else if (4 <= i && i <= 11 && (last_frame->context_validity &
- StackFrameARM::RegisterValidFlag(i))) {
- // If the STACK CFI data doesn't mention some callee-saves register, and
- // it is valid in the callee, assume the callee has not yet changed it.
- // Registers r4 through r11 are callee-saves, according to the Procedure
- // Call Standard for the ARM Architecture, which the Linux ABI follows.
- frame->context_validity |= StackFrameARM::RegisterValidFlag(i);
- frame->context.iregs[i] = last_frame->context.iregs[i];
- }
- }
- // If the CFI doesn't recover the PC explicitly, then use .ra.
- if (!(frame->context_validity & StackFrameARM::CONTEXT_VALID_PC)) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::iterator entry =
- caller_registers.find(".ra");
- if (entry != caller_registers.end()) {
- if (fp_register_ == -1) {
- frame->context_validity |= StackFrameARM::CONTEXT_VALID_PC;
- frame->context.iregs[MD_CONTEXT_ARM_REG_PC] = entry->second;
- } else {
- // The CFI updated the link register and not the program counter.
- // Handle getting the program counter from the link register.
- frame->context_validity |= StackFrameARM::CONTEXT_VALID_PC;
- frame->context_validity |= StackFrameARM::CONTEXT_VALID_LR;
- frame->context.iregs[MD_CONTEXT_ARM_REG_LR] = entry->second;
- frame->context.iregs[MD_CONTEXT_ARM_REG_PC] =
- last_frame->context.iregs[MD_CONTEXT_ARM_REG_LR];
- }
- }
- }
- // If the CFI doesn't recover the SP explicitly, then use .cfa.
- if (!(frame->context_validity & StackFrameARM::CONTEXT_VALID_SP)) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::iterator entry =
- caller_registers.find(".cfa");
- if (entry != caller_registers.end()) {
- frame->context_validity |= StackFrameARM::CONTEXT_VALID_SP;
- frame->context.iregs[MD_CONTEXT_ARM_REG_SP] = entry->second;
- }
- }
-
- // If we didn't recover the PC and the SP, then the frame isn't very useful.
- static const int essentials = (StackFrameARM::CONTEXT_VALID_SP
- | StackFrameARM::CONTEXT_VALID_PC);
- if ((frame->context_validity & essentials) != essentials)
- return NULL;
-
- frame->trust = StackFrame::FRAME_TRUST_CFI;
- return frame.release();
-}
-
-StackFrameARM* StackwalkerARM::GetCallerByStackScan(
- const vector<StackFrame*> &frames) {
- StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
- uint32_t last_sp = last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP];
- uint32_t caller_sp, caller_pc;
-
- if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc,
- frames.size() == 1 /* is_context_frame */)) {
- // No plausible return address was found.
- return NULL;
- }
-
- // ScanForReturnAddress found a reasonable return address. Advance
- // %sp to the location above the one where the return address was
- // found.
- caller_sp += 4;
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameARM* frame = new StackFrameARM();
-
- frame->trust = StackFrame::FRAME_TRUST_SCAN;
- frame->context = last_frame->context;
- frame->context.iregs[MD_CONTEXT_ARM_REG_PC] = caller_pc;
- frame->context.iregs[MD_CONTEXT_ARM_REG_SP] = caller_sp;
- frame->context_validity = StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_SP;
-
- return frame;
-}
-
-StackFrameARM* StackwalkerARM::GetCallerByFramePointer(
- const vector<StackFrame*> &frames) {
- StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
-
- if (!(last_frame->context_validity &
- StackFrameARM::RegisterValidFlag(fp_register_))) {
- return NULL;
- }
-
- uint32_t last_fp = last_frame->context.iregs[fp_register_];
-
- uint32_t caller_fp = 0;
- if (last_fp && !memory_->GetMemoryAtAddress(last_fp, &caller_fp)) {
- BPLOG(ERROR) << "Unable to read caller_fp from last_fp: 0x"
- << std::hex << last_fp;
- return NULL;
- }
-
- uint32_t caller_lr = 0;
- if (last_fp && !memory_->GetMemoryAtAddress(last_fp + 4, &caller_lr)) {
- BPLOG(ERROR) << "Unable to read caller_lr from last_fp + 4: 0x"
- << std::hex << (last_fp + 4);
- return NULL;
- }
-
- uint32_t caller_sp = last_fp ? last_fp + 8 :
- last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP];
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameARM* frame = new StackFrameARM();
-
- frame->trust = StackFrame::FRAME_TRUST_FP;
- frame->context = last_frame->context;
- frame->context.iregs[fp_register_] = caller_fp;
- frame->context.iregs[MD_CONTEXT_ARM_REG_SP] = caller_sp;
- frame->context.iregs[MD_CONTEXT_ARM_REG_PC] =
- last_frame->context.iregs[MD_CONTEXT_ARM_REG_LR];
- frame->context.iregs[MD_CONTEXT_ARM_REG_LR] = caller_lr;
- frame->context_validity = StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_LR |
- StackFrameARM::RegisterValidFlag(fp_register_) |
- StackFrameARM::CONTEXT_VALID_SP;
- return frame;
-}
-
-StackFrame* StackwalkerARM::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- const vector<StackFrame*> &frames = *stack->frames();
- StackFrameARM* last_frame = static_cast<StackFrameARM*>(frames.back());
- scoped_ptr<StackFrameARM> frame;
-
- // See if there is DWARF call frame information covering this address.
- scoped_ptr<CFIFrameInfo> cfi_frame_info(
- frame_symbolizer_->FindCFIFrameInfo(last_frame));
- if (cfi_frame_info.get())
- frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
-
- // If CFI failed, or there wasn't CFI available, fall back
- // to frame pointer, if this is configured.
- if (fp_register_ >= 0 && !frame.get())
- frame.reset(GetCallerByFramePointer(frames));
-
- // If everuthing failed, fall back to stack scanning.
- if (stack_scan_allowed && !frame.get())
- frame.reset(GetCallerByStackScan(frames));
-
- // If nothing worked, tell the caller.
- if (!frame.get())
- return NULL;
-
-
- // An instruction address of zero marks the end of the stack.
- if (frame->context.iregs[MD_CONTEXT_ARM_REG_PC] == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (frame->context.iregs[MD_CONTEXT_ARM_REG_SP]
- < last_frame->context.iregs[MD_CONTEXT_ARM_REG_SP])
- return NULL;
-
- // The new frame's context's PC is the return address, which is one
- // instruction past the instruction that caused us to arrive at the
- // callee. Set new_frame->instruction to one less than the PC. This won't
- // reference the beginning of the call instruction, but it's at least
- // within it, which is sufficient to get the source line information to
- // match up with the line that contains the function call. Callers that
- // require the exact return address value may access
- // frame->context.iregs[MD_CONTEXT_ARM_REG_PC].
- frame->instruction = frame->context.iregs[MD_CONTEXT_ARM_REG_PC] - 2;
-
- return frame.release();
-}
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.h
deleted file mode 100644
index 9081a40cd0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm.h
+++ /dev/null
@@ -1,107 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_arm.h: arm-specific stackwalker.
-//
-// Provides stack frames given arm register context and a memory region
-// corresponding to an arm stack.
-//
-// Author: Mark Mentovai, Ted Mielczarek
-
-
-#ifndef PROCESSOR_STACKWALKER_ARM_H__
-#define PROCESSOR_STACKWALKER_ARM_H__
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerARM : public Stackwalker {
- public:
- // context is an arm context object that gives access to arm-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerARM(const SystemInfo* system_info,
- const MDRawContextARM* context,
- int fp_register,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- // Change the context validity mask of the frame returned by
- // GetContextFrame to VALID. This is only for use by unit tests; the
- // default behavior is correct for all application code.
- void SetContextFrameValidity(int valid) { context_frame_validity_ = valid; }
-
- private:
- // Implementation of Stackwalker, using arm context and stack conventions.
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Use cfi_frame_info (derived from STACK CFI records) to construct
- // the frame that called frames.back(). The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameARM* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info);
-
- // Use the frame pointer. The caller takes ownership of the returned frame.
- // Return NULL on failure.
- StackFrameARM* GetCallerByFramePointer(const vector<StackFrame*> &frames);
-
- // Scan the stack for plausible return addresses. The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameARM* GetCallerByStackScan(const vector<StackFrame*> &frames);
-
- // Stores the CPU context corresponding to the youngest stack frame, to
- // be returned by GetContextFrame.
- const MDRawContextARM* context_;
-
- // The register to use a as frame pointer. The value is -1 if frame pointer
- // cannot be used.
- int fp_register_;
-
- // Validity mask for youngest stack frame. This is always
- // CONTEXT_VALID_ALL in real use; it is only changeable for the sake of
- // unit tests.
- int context_frame_validity_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_ARM_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.cc
deleted file mode 100644
index 31119a97e1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.cc
+++ /dev/null
@@ -1,278 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_arm64.cc: arm64-specific stackwalker.
-//
-// See stackwalker_arm64.h for documentation.
-//
-// Author: Mark Mentovai, Ted Mielczarek, Jim Blandy, Colin Blundell
-
-#include <vector>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_arm64.h"
-
-namespace google_breakpad {
-
-
-StackwalkerARM64::StackwalkerARM64(const SystemInfo* system_info,
- const MDRawContextARM64* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context),
- context_frame_validity_(StackFrameARM64::CONTEXT_VALID_ALL) { }
-
-
-StackFrame* StackwalkerARM64::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFrameARM64* frame = new StackFrameARM64();
-
- // The instruction pointer is stored directly in a register (x32), so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = context_frame_validity_;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.iregs[MD_CONTEXT_ARM64_REG_PC];
-
- return frame;
-}
-
-StackFrameARM64* StackwalkerARM64::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info) {
- StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
-
- static const char* register_names[] = {
- "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
- "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15",
- "x16", "x17", "x18", "x19", "x20", "x21", "x22", "x23",
- "x24", "x25", "x26", "x27", "x28", "x29", "x30", "sp",
- "pc", NULL
- };
-
- // Populate a dictionary with the valid register values in last_frame.
- CFIFrameInfo::RegisterValueMap<uint64_t> callee_registers;
- for (int i = 0; register_names[i]; i++) {
- if (last_frame->context_validity & StackFrameARM64::RegisterValidFlag(i))
- callee_registers[register_names[i]] = last_frame->context.iregs[i];
- }
-
- // Use the STACK CFI data to recover the caller's register values.
- CFIFrameInfo::RegisterValueMap<uint64_t> caller_registers;
- if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
- &caller_registers)) {
- return NULL;
- }
- // Construct a new stack frame given the values the CFI recovered.
- scoped_ptr<StackFrameARM64> frame(new StackFrameARM64());
- for (int i = 0; register_names[i]; i++) {
- CFIFrameInfo::RegisterValueMap<uint64_t>::iterator entry =
- caller_registers.find(register_names[i]);
- if (entry != caller_registers.end()) {
- // We recovered the value of this register; fill the context with the
- // value from caller_registers.
- frame->context_validity |= StackFrameARM64::RegisterValidFlag(i);
- frame->context.iregs[i] = entry->second;
- } else if (19 <= i && i <= 29 && (last_frame->context_validity &
- StackFrameARM64::RegisterValidFlag(i))) {
- // If the STACK CFI data doesn't mention some callee-saves register, and
- // it is valid in the callee, assume the callee has not yet changed it.
- // Registers r19 through r29 are callee-saves, according to the Procedure
- // Call Standard for the ARM AARCH64 Architecture, which the Linux ABI
- // follows.
- frame->context_validity |= StackFrameARM64::RegisterValidFlag(i);
- frame->context.iregs[i] = last_frame->context.iregs[i];
- }
- }
- // If the CFI doesn't recover the PC explicitly, then use .ra.
- if (!(frame->context_validity & StackFrameARM64::CONTEXT_VALID_PC)) {
- CFIFrameInfo::RegisterValueMap<uint64_t>::iterator entry =
- caller_registers.find(".ra");
- if (entry != caller_registers.end()) {
- frame->context_validity |= StackFrameARM64::CONTEXT_VALID_PC;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] = entry->second;
- }
- }
- // If the CFI doesn't recover the SP explicitly, then use .cfa.
- if (!(frame->context_validity & StackFrameARM64::CONTEXT_VALID_SP)) {
- CFIFrameInfo::RegisterValueMap<uint64_t>::iterator entry =
- caller_registers.find(".cfa");
- if (entry != caller_registers.end()) {
- frame->context_validity |= StackFrameARM64::CONTEXT_VALID_SP;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_SP] = entry->second;
- }
- }
-
- // If we didn't recover the PC and the SP, then the frame isn't very useful.
- static const uint64_t essentials = (StackFrameARM64::CONTEXT_VALID_SP
- | StackFrameARM64::CONTEXT_VALID_PC);
- if ((frame->context_validity & essentials) != essentials)
- return NULL;
-
- frame->trust = StackFrame::FRAME_TRUST_CFI;
- return frame.release();
-}
-
-StackFrameARM64* StackwalkerARM64::GetCallerByStackScan(
- const vector<StackFrame*> &frames) {
- StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
- uint64_t last_sp = last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP];
- uint64_t caller_sp, caller_pc;
-
- if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc,
- frames.size() == 1 /* is_context_frame */)) {
- // No plausible return address was found.
- return NULL;
- }
-
- // ScanForReturnAddress found a reasonable return address. Advance
- // %sp to the location above the one where the return address was
- // found.
- caller_sp += 8;
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameARM64* frame = new StackFrameARM64();
-
- frame->trust = StackFrame::FRAME_TRUST_SCAN;
- frame->context = last_frame->context;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] = caller_pc;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_SP] = caller_sp;
- frame->context_validity = StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_SP;
-
- return frame;
-}
-
-StackFrameARM64* StackwalkerARM64::GetCallerByFramePointer(
- const vector<StackFrame*> &frames) {
- StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
-
- uint64_t last_fp = last_frame->context.iregs[MD_CONTEXT_ARM64_REG_FP];
-
- uint64_t caller_fp = 0;
- if (last_fp && !memory_->GetMemoryAtAddress(last_fp, &caller_fp)) {
- BPLOG(ERROR) << "Unable to read caller_fp from last_fp: 0x"
- << std::hex << last_fp;
- return NULL;
- }
-
- uint64_t caller_lr = 0;
- if (last_fp && !memory_->GetMemoryAtAddress(last_fp + 8, &caller_lr)) {
- BPLOG(ERROR) << "Unable to read caller_lr from last_fp + 8: 0x"
- << std::hex << (last_fp + 8);
- return NULL;
- }
-
- uint64_t caller_sp = last_fp ? last_fp + 16 :
- last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP];
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameARM64* frame = new StackFrameARM64();
-
- frame->trust = StackFrame::FRAME_TRUST_FP;
- frame->context = last_frame->context;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_FP] = caller_fp;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_SP] = caller_sp;
- frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] =
- last_frame->context.iregs[MD_CONTEXT_ARM64_REG_LR];
- frame->context.iregs[MD_CONTEXT_ARM64_REG_LR] = caller_lr;
- frame->context_validity = StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_LR |
- StackFrameARM64::CONTEXT_VALID_FP |
- StackFrameARM64::CONTEXT_VALID_SP;
- return frame;
-}
-
-StackFrame* StackwalkerARM64::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- const vector<StackFrame*> &frames = *stack->frames();
- StackFrameARM64* last_frame = static_cast<StackFrameARM64*>(frames.back());
- scoped_ptr<StackFrameARM64> frame;
-
- // See if there is DWARF call frame information covering this address.
- scoped_ptr<CFIFrameInfo> cfi_frame_info(
- frame_symbolizer_->FindCFIFrameInfo(last_frame));
- if (cfi_frame_info.get())
- frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
-
- // If CFI failed, or there wasn't CFI available, fall back to frame pointer.
- if (!frame.get())
- frame.reset(GetCallerByFramePointer(frames));
-
- // If everything failed, fall back to stack scanning.
- if (stack_scan_allowed && !frame.get())
- frame.reset(GetCallerByStackScan(frames));
-
- // If nothing worked, tell the caller.
- if (!frame.get())
- return NULL;
-
- // An instruction address of zero marks the end of the stack.
- if (frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (frame->context.iregs[MD_CONTEXT_ARM64_REG_SP]
- < last_frame->context.iregs[MD_CONTEXT_ARM64_REG_SP])
- return NULL;
-
- // The new frame's context's PC is the return address, which is one
- // instruction past the instruction that caused us to arrive at the callee.
- // ARM64 instructions have a uniform 4-byte encoding, so subtracting 4 off
- // the return address gets back to the beginning of the call instruction.
- // Callers that require the exact return address value may access
- // frame->context.iregs[MD_CONTEXT_ARM64_REG_PC].
- frame->instruction = frame->context.iregs[MD_CONTEXT_ARM64_REG_PC] - 4;
-
- return frame.release();
-}
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.h
deleted file mode 100644
index 121e824672..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_arm64.h: arm64-specific stackwalker.
-//
-// Provides stack frames given arm64 register context and a memory region
-// corresponding to an arm64 stack.
-//
-// Author: Mark Mentovai, Ted Mielczarek, Colin Blundell
-
-
-#ifndef PROCESSOR_STACKWALKER_ARM64_H__
-#define PROCESSOR_STACKWALKER_ARM64_H__
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerARM64 : public Stackwalker {
- public:
- // context is an arm64 context object that gives access to arm64-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerARM64(const SystemInfo* system_info,
- const MDRawContextARM64* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- // Change the context validity mask of the frame returned by
- // GetContextFrame to VALID. This is only for use by unit tests; the
- // default behavior is correct for all application code.
- void SetContextFrameValidity(uint64_t valid) {
- context_frame_validity_ = valid;
- }
-
- private:
- // Implementation of Stackwalker, using arm64 context and stack conventions.
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Use cfi_frame_info (derived from STACK CFI records) to construct
- // the frame that called frames.back(). The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameARM64* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info);
-
- // Use the frame pointer. The caller takes ownership of the returned frame.
- // Return NULL on failure.
- StackFrameARM64* GetCallerByFramePointer(const vector<StackFrame*> &frames);
-
- // Scan the stack for plausible return addresses. The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameARM64* GetCallerByStackScan(const vector<StackFrame*> &frames);
-
- // Stores the CPU context corresponding to the youngest stack frame, to
- // be returned by GetContextFrame.
- const MDRawContextARM64* context_;
-
- // Validity mask for youngest stack frame. This is always
- // CONTEXT_VALID_ALL in real use; it is only changeable for the sake of
- // unit tests.
- uint64_t context_frame_validity_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_ARM64_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64_unittest.cc
deleted file mode 100644
index f9d18cea01..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm64_unittest.cc
+++ /dev/null
@@ -1,880 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// stackwalker_arm64_unittest.cc: Unit tests for StackwalkerARM64 class.
-
-#include <string.h>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/stackwalker_unittest_utils.h"
-#include "processor/stackwalker_arm64.h"
-#include "processor/windows_frame_info.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::StackFrameSymbolizer;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFrameARM64;
-using google_breakpad::Stackwalker;
-using google_breakpad::StackwalkerARM64;
-using google_breakpad::SystemInfo;
-using google_breakpad::WindowsFrameInfo;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using std::vector;
-using testing::_;
-using testing::AnyNumber;
-using testing::Return;
-using testing::SetArgumentPointee;
-using testing::Test;
-
-class StackwalkerARM64Fixture {
- public:
- StackwalkerARM64Fixture()
- : stack_section(kLittleEndian),
- // Give the two modules reasonable standard locations and names
- // for tests to play with.
- module1(0x40000000, 0x10000, "module1", "version1"),
- module2(0x50000000, 0x10000, "module2", "version2") {
- // Identify the system as an iOS system.
- system_info.os = "iOS";
- system_info.os_short = "ios";
- system_info.cpu = "arm64";
- system_info.cpu_info = "";
-
- // Put distinctive values in the raw CPU context.
- BrandContext(&raw_context);
-
- // Create some modules with some stock debugging information.
- modules.Add(&module1);
- modules.Add(&module2);
-
- // By default, none of the modules have symbol info; call
- // SetModuleSymbols to override this.
- EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
- .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
-
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
-
- // Reset max_frames_scanned since it's static.
- Stackwalker::set_max_frames_scanned(1024);
- }
-
- // Set the Breakpad symbol information that supplier should return for
- // MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &info) {
- size_t buffer_size;
- char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
- EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
- SetArgumentPointee<4>(buffer_size),
- Return(MockSymbolSupplier::FOUND)));
- }
-
- // Populate stack_region with the contents of stack_section. Use
- // stack_section.start() as the region's starting address.
- void RegionFromSection() {
- string contents;
- ASSERT_TRUE(stack_section.GetContents(&contents));
- stack_region.Init(stack_section.start().Value(), contents);
- }
-
- // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
- void BrandContext(MDRawContextARM64 *raw_context) {
- uint8_t x = 173;
- for (size_t i = 0; i < sizeof(*raw_context); i++)
- reinterpret_cast<uint8_t *>(raw_context)[i] = (x += 17);
- }
-
- SystemInfo system_info;
- MDRawContextARM64 raw_context;
- Section stack_section;
- MockMemoryRegion stack_region;
- MockCodeModule module1;
- MockCodeModule module2;
- MockCodeModules modules;
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- CallStack call_stack;
- const vector<StackFrame *> *frames;
-};
-
-class SanityCheck: public StackwalkerARM64Fixture, public Test { };
-
-TEST_F(SanityCheck, NoResolver) {
- // Since the context's frame pointer is garbage, the stack walk will end after
- // the first frame.
- StackFrameSymbolizer frame_symbolizer(NULL, NULL);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- // This should succeed even without a resolver or supplier.
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
- StackFrameARM64 *frame = static_cast<StackFrameARM64 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetContextFrame: public StackwalkerARM64Fixture, public Test { };
-
-// The stackwalker should be able to produce the context frame even
-// without stack memory present.
-TEST_F(GetContextFrame, NoStackMemory) {
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, NULL, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
- StackFrameARM64 *frame = static_cast<StackFrameARM64 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetCallerFrame: public StackwalkerARM64Fixture, public Test { };
-
-TEST_F(GetCallerFrame, ScanWithoutSymbols) {
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- // Force scanning through three frames to ensure that the
- // stack pointer is set properly in scan-recovered frames.
- stack_section.start() = 0x80000000;
- uint64_t return_address1 = 0x50000100;
- uint64_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x40090000) // junk that's not
- .D64(0x60000000) // a return address
-
- .D64(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D64(0xF0000000) // more junk
- .D64(0x0000000D)
-
- .D64(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(64, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
- frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
-
- StackFrameARM64 *frame2 = static_cast<StackFrameARM64 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
- ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_SP),
- frame2->context_validity);
- EXPECT_EQ(return_address2, frame2->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
-}
-
-TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
- // During stack scanning, if a potential return address
- // is located within a loaded module that has symbols,
- // it is only considered a valid return address if it
- // lies within a function's bounds.
- stack_section.start() = 0x80000000;
- uint64_t return_address = 0x50000200;
- Label frame1_sp;
-
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x40090000) // junk that's not
- .D64(0x60000000) // a return address
-
- .D64(0x40001000) // a couple of plausible addresses
- .D64(0x5000F000) // that are not within functions
-
- .D64(return_address) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(64, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x40000200;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = stack_section.start().Value();
-
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 100 400 10 monotreme\n");
- SetModuleSymbols(&module2,
- // The calling frame's function.
- "FUNC 100 400 10 marsupial\n");
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
- frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- EXPECT_EQ("monotreme", frame0->function_name);
- EXPECT_EQ(0x40000100ULL, frame0->function_base);
-
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address, frame1->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
- EXPECT_EQ("marsupial", frame1->function_name);
- EXPECT_EQ(0x50000100ULL, frame1->function_base);
-}
-
-TEST_F(GetCallerFrame, ScanFirstFrame) {
- // If the stackwalker resorts to stack scanning, it will scan much
- // farther to find the caller of the context frame.
- stack_section.start() = 0x80000000;
- uint64_t return_address1 = 0x50000100;
- uint64_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(32, 0) // space
-
- .D64(0x40090000) // junk that's not
- .D64(0x60000000) // a return address
-
- .Append(96, 0) // more space
-
- .D64(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(32, 0) // space
-
- .D64(0xF0000000) // more junk
- .D64(0x0000000D)
-
- .Append(336, 0) // more space
-
- .D64(return_address2) // actual return address
- // (won't be found)
- // frame 2
- .Mark(&frame2_sp)
- .Append(64, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
- frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
-}
-
-// Test that set_max_frames_scanned prevents using stack scanning
-// to find caller frames.
-TEST_F(GetCallerFrame, ScanningNotAllowed) {
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- stack_section.start() = 0x80000000;
- uint64_t return_address1 = 0x50000100;
- uint64_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D64(0x40090000) // junk that's not
- .D64(0x60000000) // a return address
-
- .D64(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D64(0xF0000000) // more junk
- .D64(0x0000000D)
-
- .D64(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(64, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- Stackwalker::set_max_frames_scanned(0);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
- frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-}
-
-class GetFramesByFramePointer: public StackwalkerARM64Fixture, public Test { };
-
-TEST_F(GetFramesByFramePointer, OnlyFramePointer) {
- stack_section.start() = 0x80000000;
- uint64_t return_address1 = 0x50000100;
- uint64_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- Label frame1_fp, frame2_fp;
- stack_section
- // frame 0
- .Append(64, 0) // Whatever values on the stack.
- .D64(0x0000000D) // junk that's not
- .D64(0xF0000000) // a return address.
-
- .Mark(&frame1_fp) // Next fp will point to the next value.
- .D64(frame2_fp) // Save current frame pointer.
- .D64(return_address2) // Save current link register.
- .Mark(&frame1_sp)
-
- // frame 1
- .Append(64, 0) // Whatever values on the stack.
- .D64(0x0000000D) // junk that's not
- .D64(0xF0000000) // a return address.
-
- .Mark(&frame2_fp)
- .D64(0)
- .D64(0)
- .Mark(&frame2_sp)
-
- // frame 2
- .Append(64, 0) // Whatever values on the stack.
- .D64(0x0000000D) // junk that's not
- .D64(0xF0000000); // a return address.
- RegionFromSection();
-
-
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_LR] = return_address1;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_FP] = frame1_fp.Value();
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context,
- &stack_region, &modules, &frame_symbolizer);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM64::CONTEXT_VALID_ALL,
- frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
- ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_LR |
- StackFrameARM64::CONTEXT_VALID_FP |
- StackFrameARM64::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(return_address2, frame1->context.iregs[MD_CONTEXT_ARM64_REG_LR]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
- EXPECT_EQ(frame2_fp.Value(),
- frame1->context.iregs[MD_CONTEXT_ARM64_REG_FP]);
-
- StackFrameARM64 *frame2 = static_cast<StackFrameARM64 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame2->trust);
- ASSERT_EQ((StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_LR |
- StackFrameARM64::CONTEXT_VALID_FP |
- StackFrameARM64::CONTEXT_VALID_SP),
- frame2->context_validity);
- EXPECT_EQ(return_address2, frame2->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(0U, frame2->context.iregs[MD_CONTEXT_ARM64_REG_LR]);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
- EXPECT_EQ(0U, frame2->context.iregs[MD_CONTEXT_ARM64_REG_FP]);
-}
-
-struct CFIFixture: public StackwalkerARM64Fixture {
- CFIFixture() {
- // Provide a bunch of STACK CFI records; we'll walk to the caller
- // from every point in this series, expecting to find the same set
- // of register values.
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 4000 1000 10 enchiridion\n"
- // Initially, nothing has been pushed on the stack,
- // and the return address is still in the link
- // register (x30).
- "STACK CFI INIT 4000 100 .cfa: sp 0 + .ra: x30\n"
- // Push x19, x20, the frame pointer and the link register.
- "STACK CFI 4001 .cfa: sp 32 + .ra: .cfa -8 + ^"
- " x19: .cfa -32 + ^ x20: .cfa -24 + ^ "
- " x29: .cfa -16 + ^\n"
- // Save x19..x22 in x0..x3: verify that we populate
- // the youngest frame with all the values we have.
- "STACK CFI 4002 x19: x0 x20: x1 x21: x2 x22: x3\n"
- // Restore x19..x22. Save the non-callee-saves register x1.
- "STACK CFI 4003 .cfa: sp 40 + x1: .cfa 40 - ^"
- " x19: x19 x20: x20 x21: x21 x22: x22\n"
- // Move the .cfa back eight bytes, to point at the return
- // address, and restore the sp explicitly.
- "STACK CFI 4005 .cfa: sp 32 + x1: .cfa 32 - ^"
- " x29: .cfa 8 - ^ .ra: .cfa ^ sp: .cfa 8 +\n"
- // Recover the PC explicitly from a new stack slot;
- // provide garbage for the .ra.
- "STACK CFI 4006 .cfa: sp 40 + pc: .cfa 40 - ^\n"
-
- // The calling function.
- "FUNC 5000 1000 10 epictetus\n"
- // Mark it as end of stack.
- "STACK CFI INIT 5000 1000 .cfa: 0 .ra: 0\n"
-
- // A function whose CFI makes the stack pointer
- // go backwards.
- "FUNC 6000 1000 20 palinal\n"
- "STACK CFI INIT 6000 1000 .cfa: sp 8 - .ra: x30\n"
-
- // A function with CFI expressions that can't be
- // evaluated.
- "FUNC 7000 1000 20 rhetorical\n"
- "STACK CFI INIT 7000 1000 .cfa: moot .ra: ambiguous\n");
-
- // Provide some distinctive values for the caller's registers.
- expected.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040005510L;
- expected.iregs[MD_CONTEXT_ARM64_REG_SP] = 0x0000000080000000L;
- expected.iregs[19] = 0x5e68b5d5b5d55e68L;
- expected.iregs[20] = 0x34f3ebd1ebd134f3L;
- expected.iregs[21] = 0x74bca31ea31e74bcL;
- expected.iregs[22] = 0x16b32dcb2dcb16b3L;
- expected.iregs[23] = 0x21372ada2ada2137L;
- expected.iregs[24] = 0x557dbbbbbbbb557dL;
- expected.iregs[25] = 0x8ca748bf48bf8ca7L;
- expected.iregs[26] = 0x21f0ab46ab4621f0L;
- expected.iregs[27] = 0x146732b732b71467L;
- expected.iregs[28] = 0xa673645fa673645fL;
- expected.iregs[MD_CONTEXT_ARM64_REG_FP] = 0xe11081128112e110L;
-
- // Expect CFI to recover all callee-saves registers. Since CFI is the
- // only stack frame construction technique we have, aside from the
- // context frame itself, there's no way for us to have a set of valid
- // registers smaller than this.
- expected_validity = (StackFrameARM64::CONTEXT_VALID_PC |
- StackFrameARM64::CONTEXT_VALID_SP |
- StackFrameARM64::CONTEXT_VALID_X19 |
- StackFrameARM64::CONTEXT_VALID_X20 |
- StackFrameARM64::CONTEXT_VALID_X21 |
- StackFrameARM64::CONTEXT_VALID_X22 |
- StackFrameARM64::CONTEXT_VALID_X23 |
- StackFrameARM64::CONTEXT_VALID_X24 |
- StackFrameARM64::CONTEXT_VALID_X25 |
- StackFrameARM64::CONTEXT_VALID_X26 |
- StackFrameARM64::CONTEXT_VALID_X27 |
- StackFrameARM64::CONTEXT_VALID_X28 |
- StackFrameARM64::CONTEXT_VALID_FP);
-
- // By default, context frames provide all registers, as normal.
- context_frame_validity = StackFrameARM64::CONTEXT_VALID_ALL;
-
- // By default, registers are unchanged.
- raw_context = expected;
- }
-
- // Walk the stack, using stack_section as the contents of the stack
- // and raw_context as the current register values. (Set the stack
- // pointer to the stack's starting address.) Expect two stack
- // frames; in the older frame, expect the callee-saves registers to
- // have values matching those in 'expected'.
- void CheckWalk() {
- RegionFromSection();
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region,
- &modules, &frame_symbolizer);
- walker.SetContextFrameValidity(context_frame_validity);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameARM64 *frame0 = static_cast<StackFrameARM64 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(context_frame_validity, frame0->context_validity);
- EXPECT_EQ("enchiridion", frame0->function_name);
- EXPECT_EQ(0x0000000040004000UL, frame0->function_base);
-
- StackFrameARM64 *frame1 = static_cast<StackFrameARM64 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ(expected_validity, frame1->context_validity);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X1)
- EXPECT_EQ(expected.iregs[1], frame1->context.iregs[1]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X19)
- EXPECT_EQ(expected.iregs[19], frame1->context.iregs[19]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X20)
- EXPECT_EQ(expected.iregs[20], frame1->context.iregs[20]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X21)
- EXPECT_EQ(expected.iregs[21], frame1->context.iregs[21]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X22)
- EXPECT_EQ(expected.iregs[22], frame1->context.iregs[22]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X23)
- EXPECT_EQ(expected.iregs[23], frame1->context.iregs[23]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X24)
- EXPECT_EQ(expected.iregs[24], frame1->context.iregs[24]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X25)
- EXPECT_EQ(expected.iregs[25], frame1->context.iregs[25]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X26)
- EXPECT_EQ(expected.iregs[26], frame1->context.iregs[26]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X27)
- EXPECT_EQ(expected.iregs[27], frame1->context.iregs[27]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_X28)
- EXPECT_EQ(expected.iregs[28], frame1->context.iregs[28]);
- if (expected_validity & StackFrameARM64::CONTEXT_VALID_FP)
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM64_REG_FP],
- frame1->context.iregs[MD_CONTEXT_ARM64_REG_FP]);
-
- // We would never have gotten a frame in the first place if the SP
- // and PC weren't valid or ->instruction weren't set.
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM64_REG_SP],
- frame1->context.iregs[MD_CONTEXT_ARM64_REG_SP]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM64_REG_PC],
- frame1->context.iregs[MD_CONTEXT_ARM64_REG_PC]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM64_REG_PC],
- frame1->instruction + 4);
- EXPECT_EQ("epictetus", frame1->function_name);
- }
-
- // The values we expect to find for the caller's registers.
- MDRawContextARM64 expected;
-
- // The validity mask for expected.
- uint64_t expected_validity;
-
- // The validity mask to impose on the context frame.
- uint64_t context_frame_validity;
-};
-
-class CFI: public CFIFixture, public Test { };
-
-TEST_F(CFI, At4000) {
- stack_section.start() = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004000L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_LR] = 0x0000000040005510L;
- CheckWalk();
-}
-
-TEST_F(CFI, At4001) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0x5e68b5d5b5d55e68L) // saved x19
- .D64(0x34f3ebd1ebd134f3L) // saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0x0000000040005510L) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004001L;
- // distinct callee x19, x20 and fp
- raw_context.iregs[19] = 0xadc9f635a635adc9L;
- raw_context.iregs[20] = 0x623135ac35ac6231L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_FP] = 0x5fc4be14be145fc4L;
- CheckWalk();
-}
-
-// As above, but unwind from a context that has only the PC and SP.
-TEST_F(CFI, At4001LimitedValidity) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0x5e68b5d5b5d55e68L) // saved x19
- .D64(0x34f3ebd1ebd134f3L) // saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0x0000000040005510L) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- context_frame_validity =
- StackFrameARM64::CONTEXT_VALID_PC | StackFrameARM64::CONTEXT_VALID_SP;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004001L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_FP] = 0x5fc4be14be145fc4L;
-
- expected_validity = (StackFrameARM64::CONTEXT_VALID_PC
- | StackFrameARM64::CONTEXT_VALID_SP
- | StackFrameARM64::CONTEXT_VALID_FP
- | StackFrameARM64::CONTEXT_VALID_X19
- | StackFrameARM64::CONTEXT_VALID_X20);
- CheckWalk();
-}
-
-TEST_F(CFI, At4002) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0xff3dfb81fb81ff3dL) // no longer saved x19
- .D64(0x34f3ebd1ebd134f3L) // no longer saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0x0000000040005510L) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004002L;
- raw_context.iregs[0] = 0x5e68b5d5b5d55e68L; // saved x19
- raw_context.iregs[1] = 0x34f3ebd1ebd134f3L; // saved x20
- raw_context.iregs[2] = 0x74bca31ea31e74bcL; // saved x21
- raw_context.iregs[3] = 0x16b32dcb2dcb16b3L; // saved x22
- raw_context.iregs[19] = 0xadc9f635a635adc9L; // distinct callee x19
- raw_context.iregs[20] = 0x623135ac35ac6231L; // distinct callee x20
- raw_context.iregs[21] = 0xac4543564356ac45L; // distinct callee x21
- raw_context.iregs[22] = 0x2561562f562f2561L; // distinct callee x22
- // distinct callee fp
- raw_context.iregs[MD_CONTEXT_ARM64_REG_FP] = 0x5fc4be14be145fc4L;
- CheckWalk();
-}
-
-TEST_F(CFI, At4003) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0xdd5a48c848c8dd5aL) // saved x1 (even though it's not callee-saves)
- .D64(0xff3dfb81fb81ff3dL) // no longer saved x19
- .D64(0x34f3ebd1ebd134f3L) // no longer saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0x0000000040005510L) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004003L;
- // distinct callee x1 and fp
- raw_context.iregs[1] = 0xfb756319fb756319L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_FP] = 0x5fc4be14be145fc4L;
- // caller's x1
- expected.iregs[1] = 0xdd5a48c848c8dd5aL;
- expected_validity |= StackFrameARM64::CONTEXT_VALID_X1;
- CheckWalk();
-}
-
-// We have no new rule at module offset 0x4004, so the results here should
-// be the same as those at module offset 0x4003.
-TEST_F(CFI, At4004) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0xdd5a48c848c8dd5aL) // saved x1 (even though it's not callee-saves)
- .D64(0xff3dfb81fb81ff3dL) // no longer saved x19
- .D64(0x34f3ebd1ebd134f3L) // no longer saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0x0000000040005510L) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004004L;
- // distinct callee x1 and fp
- raw_context.iregs[1] = 0xfb756319fb756319L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_FP] = 0x5fc4be14be145fc4L;
- // caller's x1
- expected.iregs[1] = 0xdd5a48c848c8dd5aL;
- expected_validity |= StackFrameARM64::CONTEXT_VALID_X1;
- CheckWalk();
-}
-
-// Here we move the .cfa, but provide an explicit rule to recover the SP,
-// so again there should be no change in the registers recovered.
-TEST_F(CFI, At4005) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0xdd5a48c848c8dd5aL) // saved x1 (even though it's not callee-saves)
- .D64(0xff3dfb81fb81ff3dL) // no longer saved x19
- .D64(0x34f3ebd1ebd134f3L) // no longer saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0x0000000040005510L) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004005L;
- raw_context.iregs[1] = 0xfb756319fb756319L; // distinct callee x1
- expected.iregs[1] = 0xdd5a48c848c8dd5aL; // caller's x1
- expected_validity |= StackFrameARM64::CONTEXT_VALID_X1;
- CheckWalk();
-}
-
-// Here we provide an explicit rule for the PC, and have the saved .ra be
-// bogus.
-TEST_F(CFI, At4006) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM64_REG_SP];
- stack_section
- .D64(0x0000000040005510L) // saved pc
- .D64(0xdd5a48c848c8dd5aL) // saved x1 (even though it's not callee-saves)
- .D64(0xff3dfb81fb81ff3dL) // no longer saved x19
- .D64(0x34f3ebd1ebd134f3L) // no longer saved x20
- .D64(0xe11081128112e110L) // saved fp
- .D64(0xf8d157835783f8d1L) // .ra rule recovers this, which is garbage
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040004006L;
- raw_context.iregs[1] = 0xfb756319fb756319L; // distinct callee x1
- expected.iregs[1] = 0xdd5a48c848c8dd5aL; // caller's x1
- expected_validity |= StackFrameARM64::CONTEXT_VALID_X1;
- CheckWalk();
-}
-
-// Check that we reject rules that would cause the stack pointer to
-// move in the wrong direction.
-TEST_F(CFI, RejectBackwards) {
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040006000L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = 0x0000000080000000L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_LR] = 0x0000000040005510L;
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-}
-
-// Check that we reject rules whose expressions' evaluation fails.
-TEST_F(CFI, RejectBadExpressions) {
- raw_context.iregs[MD_CONTEXT_ARM64_REG_PC] = 0x0000000040007000L;
- raw_context.iregs[MD_CONTEXT_ARM64_REG_SP] = 0x0000000080000000L;
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM64 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc
deleted file mode 100644
index 8a0fd5e95b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_arm_unittest.cc
+++ /dev/null
@@ -1,974 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// stackwalker_arm_unittest.cc: Unit tests for StackwalkerARM class.
-
-#include <string.h>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/stackwalker_unittest_utils.h"
-#include "processor/stackwalker_arm.h"
-#include "processor/windows_frame_info.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::StackFrameSymbolizer;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFrameARM;
-using google_breakpad::Stackwalker;
-using google_breakpad::StackwalkerARM;
-using google_breakpad::SystemInfo;
-using google_breakpad::WindowsFrameInfo;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using std::vector;
-using testing::_;
-using testing::AnyNumber;
-using testing::Return;
-using testing::SetArgumentPointee;
-using testing::Test;
-
-class StackwalkerARMFixture {
- public:
- StackwalkerARMFixture()
- : stack_section(kLittleEndian),
- // Give the two modules reasonable standard locations and names
- // for tests to play with.
- module1(0x40000000, 0x10000, "module1", "version1"),
- module2(0x50000000, 0x10000, "module2", "version2") {
- // Identify the system as a Linux system.
- system_info.os = "Linux";
- system_info.os_short = "linux";
- system_info.os_version = "Lugubrious Labrador";
- system_info.cpu = "arm";
- system_info.cpu_info = "";
-
- // Put distinctive values in the raw CPU context.
- BrandContext(&raw_context);
-
- // Create some modules with some stock debugging information.
- modules.Add(&module1);
- modules.Add(&module2);
-
- // By default, none of the modules have symbol info; call
- // SetModuleSymbols to override this.
- EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
- .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
-
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
-
- // Reset max_frames_scanned since it's static.
- Stackwalker::set_max_frames_scanned(1024);
- }
-
- // Set the Breakpad symbol information that supplier should return for
- // MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &info) {
- size_t buffer_size;
- char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
- EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
- SetArgumentPointee<4>(buffer_size),
- Return(MockSymbolSupplier::FOUND)));
- }
-
- // Populate stack_region with the contents of stack_section. Use
- // stack_section.start() as the region's starting address.
- void RegionFromSection() {
- string contents;
- ASSERT_TRUE(stack_section.GetContents(&contents));
- stack_region.Init(stack_section.start().Value(), contents);
- }
-
- // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
- void BrandContext(MDRawContextARM *raw_context) {
- uint8_t x = 173;
- for (size_t i = 0; i < sizeof(*raw_context); i++)
- reinterpret_cast<uint8_t *>(raw_context)[i] = (x += 17);
- }
-
- SystemInfo system_info;
- MDRawContextARM raw_context;
- Section stack_section;
- MockMemoryRegion stack_region;
- MockCodeModule module1;
- MockCodeModule module2;
- MockCodeModules modules;
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- CallStack call_stack;
- const vector<StackFrame *> *frames;
-};
-
-class SanityCheck: public StackwalkerARMFixture, public Test { };
-
-TEST_F(SanityCheck, NoResolver) {
- // Since we have no call frame information, and all unwinding
- // requires call frame information, the stack walk will end after
- // the first frame.
- StackFrameSymbolizer frame_symbolizer(NULL, NULL);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- // This should succeed even without a resolver or supplier.
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame = static_cast<StackFrameARM *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetContextFrame: public StackwalkerARMFixture, public Test { };
-
-TEST_F(GetContextFrame, Simple) {
- // Since we have no call frame information, and all unwinding
- // requires call frame information, the stack walk will end after
- // the first frame.
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame = static_cast<StackFrameARM *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-// The stackwalker should be able to produce the context frame even
-// without stack memory present.
-TEST_F(GetContextFrame, NoStackMemory) {
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, NULL, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
- StackFrameARM *frame = static_cast<StackFrameARM *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetCallerFrame: public StackwalkerARMFixture, public Test { };
-
-TEST_F(GetCallerFrame, ScanWithoutSymbols) {
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- // Force scanning through three frames to ensure that the
- // stack pointer is set properly in scan-recovered frames.
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x50000100;
- uint32_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D32(0x40090000) // junk that's not
- .D32(0x60000000) // a return address
-
- .D32(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D32(0xF0000000) // more junk
- .D32(0x0000000D)
-
- .D32(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
-
- StackFrameARM *frame2 = static_cast<StackFrameARM *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_SP),
- frame2->context_validity);
- EXPECT_EQ(return_address2, frame2->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_ARM_REG_SP]);
-}
-
-TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
- // During stack scanning, if a potential return address
- // is located within a loaded module that has symbols,
- // it is only considered a valid return address if it
- // lies within a function's bounds.
- stack_section.start() = 0x80000000;
- uint32_t return_address = 0x50000200;
- Label frame1_sp;
-
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D32(0x40090000) // junk that's not
- .D32(0x60000000) // a return address
-
- .D32(0x40001000) // a couple of plausible addresses
- .D32(0x5000F000) // that are not within functions
-
- .D32(return_address) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40000200;
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 100 400 10 monotreme\n");
- SetModuleSymbols(&module2,
- // The calling frame's function.
- "FUNC 100 400 10 marsupial\n");
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- EXPECT_EQ("monotreme", frame0->function_name);
- EXPECT_EQ(0x40000100U, frame0->function_base);
-
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address, frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- EXPECT_EQ("marsupial", frame1->function_name);
- EXPECT_EQ(0x50000100U, frame1->function_base);
-}
-
-TEST_F(GetCallerFrame, ScanFirstFrame) {
- // If the stackwalker resorts to stack scanning, it will scan much
- // farther to find the caller of the context frame.
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x50000100;
- uint32_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(32, 0) // space
-
- .D32(0x40090000) // junk that's not
- .D32(0x60000000) // a return address
-
- .Append(96, 0) // more space
-
- .D32(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(32, 0) // space
-
- .D32(0xF0000000) // more junk
- .D32(0x0000000D)
-
- .Append(136, 0) // more space
-
- .D32(return_address2) // actual return address
- // (won't be found)
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
-}
-
-// Test that set_max_frames_scanned prevents using stack scanning
-// to find caller frames.
-TEST_F(GetCallerFrame, ScanningNotAllowed) {
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x50000100;
- uint32_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D32(0x40090000) // junk that's not
- .D32(0x60000000) // a return address
-
- .D32(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D32(0xF0000000) // more junk
- .D32(0x0000000D)
-
- .D32(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- Stackwalker::set_max_frames_scanned(0);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-}
-
-struct CFIFixture: public StackwalkerARMFixture {
- CFIFixture() {
- // Provide a bunch of STACK CFI records; we'll walk to the caller
- // from every point in this series, expecting to find the same set
- // of register values.
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 4000 1000 10 enchiridion\n"
- // Initially, nothing has been pushed on the stack,
- // and the return address is still in the link register.
- "STACK CFI INIT 4000 100 .cfa: sp .ra: lr\n"
- // Push r4, the frame pointer, and the link register.
- "STACK CFI 4001 .cfa: sp 12 + r4: .cfa 12 - ^"
- " r11: .cfa 8 - ^ .ra: .cfa 4 - ^\n"
- // Save r4..r7 in r0..r3: verify that we populate
- // the youngest frame with all the values we have.
- "STACK CFI 4002 r4: r0 r5: r1 r6: r2 r7: r3\n"
- // Restore r4..r7. Save the non-callee-saves register r1.
- "STACK CFI 4003 .cfa: sp 16 + r1: .cfa 16 - ^"
- " r4: r4 r5: r5 r6: r6 r7: r7\n"
- // Move the .cfa back four bytes, to point at the return
- // address, and restore the sp explicitly.
- "STACK CFI 4005 .cfa: sp 12 + r1: .cfa 12 - ^"
- " r11: .cfa 4 - ^ .ra: .cfa ^ sp: .cfa 4 +\n"
- // Recover the PC explicitly from a new stack slot;
- // provide garbage for the .ra.
- "STACK CFI 4006 .cfa: sp 16 + pc: .cfa 16 - ^\n"
-
- // The calling function.
- "FUNC 5000 1000 10 epictetus\n"
- // Mark it as end of stack.
- "STACK CFI INIT 5000 1000 .cfa: 0 .ra: 0\n"
-
- // A function whose CFI makes the stack pointer
- // go backwards.
- "FUNC 6000 1000 20 palinal\n"
- "STACK CFI INIT 6000 1000 .cfa: sp 4 - .ra: lr\n"
-
- // A function with CFI expressions that can't be
- // evaluated.
- "FUNC 7000 1000 20 rhetorical\n"
- "STACK CFI INIT 7000 1000 .cfa: moot .ra: ambiguous\n");
-
- // Provide some distinctive values for the caller's registers.
- expected.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40005510;
- expected.iregs[MD_CONTEXT_ARM_REG_SP] = 0x80000000;
- expected.iregs[4] = 0xb5d55e68;
- expected.iregs[5] = 0xebd134f3;
- expected.iregs[6] = 0xa31e74bc;
- expected.iregs[7] = 0x2dcb16b3;
- expected.iregs[8] = 0x2ada2137;
- expected.iregs[9] = 0xbbbb557d;
- expected.iregs[10] = 0x48bf8ca7;
- expected.iregs[MD_CONTEXT_ARM_REG_FP] = 0x8112e110;
-
- // Expect CFI to recover all callee-saves registers. Since CFI is the
- // only stack frame construction technique we have, aside from the
- // context frame itself, there's no way for us to have a set of valid
- // registers smaller than this.
- expected_validity = (StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_SP |
- StackFrameARM::CONTEXT_VALID_R4 |
- StackFrameARM::CONTEXT_VALID_R5 |
- StackFrameARM::CONTEXT_VALID_R6 |
- StackFrameARM::CONTEXT_VALID_R7 |
- StackFrameARM::CONTEXT_VALID_R8 |
- StackFrameARM::CONTEXT_VALID_R9 |
- StackFrameARM::CONTEXT_VALID_R10 |
- StackFrameARM::CONTEXT_VALID_FP);
-
- // By default, context frames provide all registers, as normal.
- context_frame_validity = StackFrameARM::CONTEXT_VALID_ALL;
-
- // By default, registers are unchanged.
- raw_context = expected;
- }
-
- // Walk the stack, using stack_section as the contents of the stack
- // and raw_context as the current register values. (Set the stack
- // pointer to the stack's starting address.) Expect two stack
- // frames; in the older frame, expect the callee-saves registers to
- // have values matching those in 'expected'.
- void CheckWalk() {
- RegionFromSection();
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region,
- &modules, &frame_symbolizer);
- walker.SetContextFrameValidity(context_frame_validity);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(context_frame_validity, frame0->context_validity);
- EXPECT_EQ("enchiridion", frame0->function_name);
- EXPECT_EQ(0x40004000U, frame0->function_base);
-
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ(expected_validity, frame1->context_validity);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R1)
- EXPECT_EQ(expected.iregs[1], frame1->context.iregs[1]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R4)
- EXPECT_EQ(expected.iregs[4], frame1->context.iregs[4]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R5)
- EXPECT_EQ(expected.iregs[5], frame1->context.iregs[5]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R6)
- EXPECT_EQ(expected.iregs[6], frame1->context.iregs[6]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R7)
- EXPECT_EQ(expected.iregs[7], frame1->context.iregs[7]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R8)
- EXPECT_EQ(expected.iregs[8], frame1->context.iregs[8]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R9)
- EXPECT_EQ(expected.iregs[9], frame1->context.iregs[9]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_R10)
- EXPECT_EQ(expected.iregs[10], frame1->context.iregs[10]);
- if (expected_validity & StackFrameARM::CONTEXT_VALID_FP)
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM_REG_FP],
- frame1->context.iregs[MD_CONTEXT_ARM_REG_FP]);
-
- // We would never have gotten a frame in the first place if the SP
- // and PC weren't valid or ->instruction weren't set.
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM_REG_SP],
- frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM_REG_PC],
- frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_ARM_REG_PC],
- frame1->instruction + 2);
- EXPECT_EQ("epictetus", frame1->function_name);
- }
-
- // The values we expect to find for the caller's registers.
- MDRawContextARM expected;
-
- // The validity mask for expected.
- int expected_validity;
-
- // The validity mask to impose on the context frame.
- int context_frame_validity;
-};
-
-class CFI: public CFIFixture, public Test { };
-
-TEST_F(CFI, At4000) {
- stack_section.start() = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004000;
- raw_context.iregs[MD_CONTEXT_ARM_REG_LR] = 0x40005510;
- CheckWalk();
-}
-
-TEST_F(CFI, At4001) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0xb5d55e68) // saved r4
- .D32(0x8112e110) // saved fp
- .D32(0x40005510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004001;
- raw_context.iregs[4] = 0x635adc9f; // distinct callee r4
- raw_context.iregs[MD_CONTEXT_ARM_REG_FP] = 0xbe145fc4; // distinct callee fp
- CheckWalk();
-}
-
-// As above, but unwind from a context that has only the PC and SP.
-TEST_F(CFI, At4001LimitedValidity) {
- context_frame_validity =
- StackFrameARM::CONTEXT_VALID_PC | StackFrameARM::CONTEXT_VALID_SP;
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004001;
- raw_context.iregs[MD_CONTEXT_ARM_REG_FP] = 0xbe145fc4; // distinct callee fp
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0xb5d55e68) // saved r4
- .D32(0x8112e110) // saved fp
- .D32(0x40005510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- expected_validity = (StackFrameARM::CONTEXT_VALID_PC
- | StackFrameARM::CONTEXT_VALID_SP
- | StackFrameARM::CONTEXT_VALID_FP
- | StackFrameARM::CONTEXT_VALID_R4);
- CheckWalk();
-}
-
-TEST_F(CFI, At4002) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0xfb81ff3d) // no longer saved r4
- .D32(0x8112e110) // saved fp
- .D32(0x40005510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004002;
- raw_context.iregs[0] = 0xb5d55e68; // saved r4
- raw_context.iregs[1] = 0xebd134f3; // saved r5
- raw_context.iregs[2] = 0xa31e74bc; // saved r6
- raw_context.iregs[3] = 0x2dcb16b3; // saved r7
- raw_context.iregs[4] = 0xfdd35466; // distinct callee r4
- raw_context.iregs[5] = 0xf18c946c; // distinct callee r5
- raw_context.iregs[6] = 0xac2079e8; // distinct callee r6
- raw_context.iregs[7] = 0xa449829f; // distinct callee r7
- raw_context.iregs[MD_CONTEXT_ARM_REG_FP] = 0xbe145fc4; // distinct callee fp
- CheckWalk();
-}
-
-TEST_F(CFI, At4003) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0x48c8dd5a) // saved r1 (even though it's not callee-saves)
- .D32(0xcb78040e) // no longer saved r4
- .D32(0x8112e110) // saved fp
- .D32(0x40005510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004003;
- raw_context.iregs[1] = 0xfb756319; // distinct callee r1
- raw_context.iregs[MD_CONTEXT_ARM_REG_FP] = 0x0a2857ea; // distinct callee fp
- expected.iregs[1] = 0x48c8dd5a; // caller's r1
- expected_validity |= StackFrameARM::CONTEXT_VALID_R1;
- CheckWalk();
-}
-
-// We have no new rule at module offset 0x4004, so the results here should
-// be the same as those at module offset 0x4003.
-TEST_F(CFI, At4004) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0x48c8dd5a) // saved r1 (even though it's not callee-saves)
- .D32(0xcb78040e) // no longer saved r4
- .D32(0x8112e110) // saved fp
- .D32(0x40005510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004004;
- raw_context.iregs[1] = 0xfb756319; // distinct callee r1
- expected.iregs[1] = 0x48c8dd5a; // caller's r1
- expected_validity |= StackFrameARM::CONTEXT_VALID_R1;
- CheckWalk();
-}
-
-// Here we move the .cfa, but provide an explicit rule to recover the SP,
-// so again there should be no change in the registers recovered.
-TEST_F(CFI, At4005) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0x48c8dd5a) // saved r1 (even though it's not callee-saves)
- .D32(0xf013f841) // no longer saved r4
- .D32(0x8112e110) // saved fp
- .D32(0x40005510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004005;
- raw_context.iregs[1] = 0xfb756319; // distinct callee r1
- expected.iregs[1] = 0x48c8dd5a; // caller's r1
- expected_validity |= StackFrameARM::CONTEXT_VALID_R1;
- CheckWalk();
-}
-
-// Here we provide an explicit rule for the PC, and have the saved .ra be
-// bogus.
-TEST_F(CFI, At4006) {
- Label frame1_sp = expected.iregs[MD_CONTEXT_ARM_REG_SP];
- stack_section
- .D32(0x40005510) // saved pc
- .D32(0x48c8dd5a) // saved r1 (even though it's not callee-saves)
- .D32(0xf013f841) // no longer saved r4
- .D32(0x8112e110) // saved fp
- .D32(0xf8d15783) // .ra rule recovers this, which is garbage
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40004006;
- raw_context.iregs[1] = 0xfb756319; // callee's r1, different from caller's
- expected.iregs[1] = 0x48c8dd5a; // caller's r1
- expected_validity |= StackFrameARM::CONTEXT_VALID_R1;
- CheckWalk();
-}
-
-// Check that we reject rules that would cause the stack pointer to
-// move in the wrong direction.
-TEST_F(CFI, RejectBackwards) {
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40006000;
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = 0x80000000;
- raw_context.iregs[MD_CONTEXT_ARM_REG_LR] = 0x40005510;
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-}
-
-// Check that we reject rules whose expressions' evaluation fails.
-TEST_F(CFI, RejectBadExpressions) {
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40007000;
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = 0x80000000;
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, -1, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-}
-
-class StackwalkerARMFixtureIOS : public StackwalkerARMFixture {
- public:
- StackwalkerARMFixtureIOS() {
- system_info.os = "iOS";
- system_info.os_short = "ios";
- }
-};
-
-class GetFramesByFramePointer: public StackwalkerARMFixtureIOS, public Test { };
-
-TEST_F(GetFramesByFramePointer, OnlyFramePointer) {
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x50000100;
- uint32_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- Label frame1_fp, frame2_fp;
- stack_section
- // frame 0
- .Append(32, 0) // Whatever values on the stack.
- .D32(0x0000000D) // junk that's not
- .D32(0xF0000000) // a return address.
-
- .Mark(&frame1_fp) // Next fp will point to the next value.
- .D32(frame2_fp) // Save current frame pointer.
- .D32(return_address2) // Save current link register.
- .Mark(&frame1_sp)
-
- // frame 1
- .Append(32, 0) // Whatever values on the stack.
- .D32(0x0000000D) // junk that's not
- .D32(0xF0000000) // a return address.
-
- .Mark(&frame2_fp)
- .D32(0)
- .D32(0)
- .Mark(&frame2_sp)
-
- // frame 2
- .Append(32, 0) // Whatever values on the stack.
- .D32(0x0000000D) // junk that's not
- .D32(0xF0000000); // a return address.
- RegionFromSection();
-
-
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x40005510;
- raw_context.iregs[MD_CONTEXT_ARM_REG_LR] = return_address1;
- raw_context.iregs[MD_CONTEXT_ARM_REG_IOS_FP] = frame1_fp.Value();
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, MD_CONTEXT_ARM_REG_IOS_FP,
- &stack_region, &modules, &frame_symbolizer);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_LR |
- StackFrameARM::RegisterValidFlag(MD_CONTEXT_ARM_REG_IOS_FP) |
- StackFrameARM::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(return_address2, frame1->context.iregs[MD_CONTEXT_ARM_REG_LR]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- EXPECT_EQ(frame2_fp.Value(),
- frame1->context.iregs[MD_CONTEXT_ARM_REG_IOS_FP]);
-
- StackFrameARM *frame2 = static_cast<StackFrameARM *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame2->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_LR |
- StackFrameARM::RegisterValidFlag(MD_CONTEXT_ARM_REG_IOS_FP) |
- StackFrameARM::CONTEXT_VALID_SP),
- frame2->context_validity);
- EXPECT_EQ(return_address2, frame2->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(0U, frame2->context.iregs[MD_CONTEXT_ARM_REG_LR]);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- EXPECT_EQ(0U, frame2->context.iregs[MD_CONTEXT_ARM_REG_IOS_FP]);
-}
-
-TEST_F(GetFramesByFramePointer, FramePointerAndCFI) {
- // Provide the standatd STACK CFI records that is obtained when exmining an
- // executable produced by XCode.
- SetModuleSymbols(&module1,
- // Adding a function in CFI.
- "FUNC 4000 1000 10 enchiridion\n"
-
- "STACK CFI INIT 4000 100 .cfa: sp 0 + .ra: lr\n"
- "STACK CFI 4001 .cfa: sp 8 + .ra: .cfa -4 + ^"
- " r7: .cfa -8 + ^\n"
- "STACK CFI 4002 .cfa: r7 8 +\n"
- );
-
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x40004010;
- uint32_t return_address2 = 0x50000900;
- Label frame1_sp, frame2_sp;
- Label frame1_fp, frame2_fp;
- stack_section
- // frame 0
- .Append(32, 0) // Whatever values on the stack.
- .D32(0x0000000D) // junk that's not
- .D32(0xF0000000) // a return address.
-
- .Mark(&frame1_fp) // Next fp will point to the next value.
- .D32(frame2_fp) // Save current frame pointer.
- .D32(return_address2) // Save current link register.
- .Mark(&frame1_sp)
-
- // frame 1
- .Append(32, 0) // Whatever values on the stack.
- .D32(0x0000000D) // junk that's not
- .D32(0xF0000000) // a return address.
-
- .Mark(&frame2_fp)
- .D32(0)
- .D32(0)
- .Mark(&frame2_sp)
-
- // frame 2
- .Append(32, 0) // Whatever values on the stack.
- .D32(0x0000000D) // junk that's not
- .D32(0xF0000000); // a return address.
- RegionFromSection();
-
-
- raw_context.iregs[MD_CONTEXT_ARM_REG_PC] = 0x50000400;
- raw_context.iregs[MD_CONTEXT_ARM_REG_LR] = return_address1;
- raw_context.iregs[MD_CONTEXT_ARM_REG_IOS_FP] = frame1_fp.Value();
- raw_context.iregs[MD_CONTEXT_ARM_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerARM walker(&system_info, &raw_context, MD_CONTEXT_ARM_REG_IOS_FP,
- &stack_region, &modules, &frame_symbolizer);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module2", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameARM *frame0 = static_cast<StackFrameARM *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameARM::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameARM *frame1 = static_cast<StackFrameARM *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_LR |
- StackFrameARM::RegisterValidFlag(MD_CONTEXT_ARM_REG_IOS_FP) |
- StackFrameARM::CONTEXT_VALID_SP),
- frame1->context_validity);
- EXPECT_EQ(return_address1, frame1->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(return_address2, frame1->context.iregs[MD_CONTEXT_ARM_REG_LR]);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- EXPECT_EQ(frame2_fp.Value(),
- frame1->context.iregs[MD_CONTEXT_ARM_REG_IOS_FP]);
- EXPECT_EQ("enchiridion", frame1->function_name);
- EXPECT_EQ(0x40004000U, frame1->function_base);
-
-
- StackFrameARM *frame2 = static_cast<StackFrameARM *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
- ASSERT_EQ((StackFrameARM::CONTEXT_VALID_PC |
- StackFrameARM::CONTEXT_VALID_LR |
- StackFrameARM::RegisterValidFlag(MD_CONTEXT_ARM_REG_IOS_FP) |
- StackFrameARM::CONTEXT_VALID_SP),
- frame2->context_validity);
- EXPECT_EQ(return_address2, frame2->context.iregs[MD_CONTEXT_ARM_REG_PC]);
- EXPECT_EQ(0U, frame2->context.iregs[MD_CONTEXT_ARM_REG_LR]);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_ARM_REG_SP]);
- EXPECT_EQ(0U, frame2->context.iregs[MD_CONTEXT_ARM_REG_IOS_FP]);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.cc
deleted file mode 100644
index db55d460c0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.cc
+++ /dev/null
@@ -1,448 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_mips.cc: MIPS-specific stackwalker.
-//
-// See stackwalker_mips.h for documentation.
-//
-// Author: Tata Elxsi
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/cfi_frame_info.h"
-#include "processor/logging.h"
-#include "processor/postfix_evaluator-inl.h"
-#include "processor/stackwalker_mips.h"
-#include "processor/windows_frame_info.h"
-#include "google_breakpad/common/minidump_cpu_mips.h"
-
-namespace google_breakpad {
-
-StackwalkerMIPS::StackwalkerMIPS(const SystemInfo* system_info,
- const MDRawContextMIPS* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
-: Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context) {
- if (context_->context_flags & MD_CONTEXT_MIPS64 ) {
- if ((memory_ && memory_->GetBase() + memory_->GetSize() - 1)
- > 0xffffffffffffffff) {
- BPLOG(ERROR) << "Memory out of range for stackwalking mips64: "
- << HexString(memory_->GetBase())
- << "+"
- << HexString(memory_->GetSize());
- memory_ = NULL;
- }
- } else {
- if ((memory_ && memory_->GetBase() + memory_->GetSize() - 1) > 0xffffffff) {
- BPLOG(ERROR) << "Memory out of range for stackwalking mips32: "
- << HexString(memory_->GetBase())
- << "+"
- << HexString(memory_->GetSize());
- memory_ = NULL;
- }
- }
-}
-
-StackFrame* StackwalkerMIPS::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context.";
- return NULL;
- }
-
- StackFrameMIPS* frame = new StackFrameMIPS();
-
- // The instruction pointer is stored directly in a register, so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = StackFrameMIPS::CONTEXT_VALID_ALL;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.epc;
-
- return frame;
-}
-
-// Register names for mips.
-static const char* const kRegisterNames[] = {
- "$zero", "$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3", "$to", "$t1",
- "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$s0", "$s1", "$s2", "$s3",
- "$s4", "$s5", "$s6", "$s7", "$t8", "$t9", "$k0", "$k1", "$gp", "$sp",
- "$fp", "$ra", NULL
- // TODO(gordanac): add float point save registers
-};
-
-StackFrameMIPS* StackwalkerMIPS::GetCallerByCFIFrameInfo(
- const vector<StackFrame*>& frames,
- CFIFrameInfo* cfi_frame_info) {
- StackFrameMIPS* last_frame = static_cast<StackFrameMIPS*>(frames.back());
-
- if (context_->context_flags & MD_CONTEXT_MIPS) {
- uint32_t sp = 0, pc = 0;
-
- // Populate a dictionary with the valid register values in last_frame.
- CFIFrameInfo::RegisterValueMap<uint32_t> callee_registers;
- // Use the STACK CFI data to recover the caller's register values.
- CFIFrameInfo::RegisterValueMap<uint32_t> caller_registers;
-
- for (int i = 0; kRegisterNames[i]; ++i) {
- caller_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
- callee_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
- }
-
- if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
- &caller_registers)) {
- return NULL;
- }
-
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator entry =
- caller_registers.find(".cfa");
-
- if (entry != caller_registers.end()) {
- sp = entry->second;
- caller_registers["$sp"] = entry->second;
- }
-
- entry = caller_registers.find(".ra");
- if (entry != caller_registers.end()) {
- caller_registers["$ra"] = entry->second;
- pc = entry->second - 2 * sizeof(pc);
- }
- caller_registers["$pc"] = pc;
- // Construct a new stack frame given the values the CFI recovered.
- scoped_ptr<StackFrameMIPS> frame(new StackFrameMIPS());
-
- for (int i = 0; kRegisterNames[i]; ++i) {
- CFIFrameInfo::RegisterValueMap<uint32_t>::const_iterator caller_entry =
- caller_registers.find(kRegisterNames[i]);
-
- if (caller_entry != caller_registers.end()) {
- // The value of this register is recovered; fill the context with the
- // value from caller_registers.
- frame->context.iregs[i] = caller_entry->second;
- frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
- } else if (((i >= INDEX_MIPS_REG_S0 && i <= INDEX_MIPS_REG_S7) ||
- (i > INDEX_MIPS_REG_GP && i < INDEX_MIPS_REG_RA)) &&
- (last_frame->context_validity &
- StackFrameMIPS::RegisterValidFlag(i))) {
- // If the STACK CFI data doesn't mention some callee-save register, and
- // it is valid in the callee, assume the callee has not yet changed it.
- // Calee-save registers according to the MIPS o32 ABI specification are:
- // $s0 to $s7
- // $sp, $s8
- frame->context.iregs[i] = last_frame->context.iregs[i];
- frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
- }
- }
-
- frame->context.epc = caller_registers["$pc"];
- frame->instruction = caller_registers["$pc"];
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] = caller_registers["$ra"];
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
-
- frame->trust = StackFrame::FRAME_TRUST_CFI;
-
- return frame.release();
- } else {
- uint64_t sp = 0, pc = 0;
-
- // Populate a dictionary with the valid register values in last_frame.
- CFIFrameInfo::RegisterValueMap<uint64_t> callee_registers;
- // Use the STACK CFI data to recover the caller's register values.
- CFIFrameInfo::RegisterValueMap<uint64_t> caller_registers;
-
- for (int i = 0; kRegisterNames[i]; ++i) {
- caller_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
- callee_registers[kRegisterNames[i]] = last_frame->context.iregs[i];
- }
-
- if (!cfi_frame_info->FindCallerRegs(callee_registers, *memory_,
- &caller_registers)) {
- return NULL;
- }
-
- CFIFrameInfo::RegisterValueMap<uint64_t>::const_iterator entry =
- caller_registers.find(".cfa");
-
- if (entry != caller_registers.end()) {
- sp = entry->second;
- caller_registers["$sp"] = entry->second;
- }
-
- entry = caller_registers.find(".ra");
- if (entry != caller_registers.end()) {
- caller_registers["$ra"] = entry->second;
- pc = entry->second - 2 * sizeof(pc);
- }
- caller_registers["$pc"] = pc;
- // Construct a new stack frame given the values the CFI recovered.
- scoped_ptr<StackFrameMIPS> frame(new StackFrameMIPS());
-
- for (int i = 0; kRegisterNames[i]; ++i) {
- CFIFrameInfo::RegisterValueMap<uint64_t>::const_iterator caller_entry =
- caller_registers.find(kRegisterNames[i]);
-
- if (caller_entry != caller_registers.end()) {
- // The value of this register is recovered; fill the context with the
- // value from caller_registers.
- frame->context.iregs[i] = caller_entry->second;
- frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
- } else if (((i >= INDEX_MIPS_REG_S0 && i <= INDEX_MIPS_REG_S7) ||
- (i >= INDEX_MIPS_REG_GP && i < INDEX_MIPS_REG_RA)) &&
- (last_frame->context_validity &
- StackFrameMIPS::RegisterValidFlag(i))) {
- // If the STACK CFI data doesn't mention some callee-save register, and
- // it is valid in the callee, assume the callee has not yet changed it.
- // Calee-save registers according to the MIPS o32 ABI specification are:
- // $s0 to $s7
- // $sp, $s8
- frame->context.iregs[i] = last_frame->context.iregs[i];
- frame->context_validity |= StackFrameMIPS::RegisterValidFlag(i);
- }
- }
-
- frame->context.epc = caller_registers["$pc"];
- frame->instruction = caller_registers["$pc"];
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] = caller_registers["$ra"];
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
-
- frame->trust = StackFrame::FRAME_TRUST_CFI;
-
- return frame.release();
- }
-}
-
-StackFrame* StackwalkerMIPS::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- const vector<StackFrame*>& frames = *stack->frames();
- StackFrameMIPS* last_frame = static_cast<StackFrameMIPS*>(frames.back());
- scoped_ptr<StackFrameMIPS> new_frame;
-
- // See if there is DWARF call frame information covering this address.
- scoped_ptr<CFIFrameInfo> cfi_frame_info(
- frame_symbolizer_->FindCFIFrameInfo(last_frame));
- if (cfi_frame_info.get())
- new_frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info.get()));
-
- // If caller frame is not found in CFI try analyzing the stack.
- if (stack_scan_allowed && !new_frame.get()) {
- new_frame.reset(GetCallerByStackScan(frames));
- }
-
- // If nothing worked, tell the caller.
- if (!new_frame.get()) {
- return NULL;
- }
-
- // Treat an instruction address of 0 as end-of-stack.
- if (new_frame->context.epc == 0) {
- return NULL;
- }
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (new_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] <=
- last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP]) {
- return NULL;
- }
-
- return new_frame.release();
-}
-
-StackFrameMIPS* StackwalkerMIPS::GetCallerByStackScan(
- const vector<StackFrame*>& frames) {
- const uint32_t kMaxFrameStackSize = 1024;
- const uint32_t kMinArgsOnStack = 4;
-
- StackFrameMIPS* last_frame = static_cast<StackFrameMIPS*>(frames.back());
-
- if (context_->context_flags & MD_CONTEXT_MIPS) {
- uint32_t last_sp = last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP];
- uint32_t caller_pc, caller_sp, caller_fp;
-
- // Return address cannot be obtained directly.
- // Force stackwalking.
-
- // We cannot use frame pointer to get the return address.
- // We'll scan the stack for a
- // return address. This can happen if last_frame is executing code
- // for a module for which we don't have symbols.
- int count = kMaxFrameStackSize / sizeof(caller_pc);
-
- if (frames.size() > 1) {
- // In case of mips32 ABI stack frame of a nonleaf function
- // must have minimum stack frame assigned for 4 arguments (4 words).
- // Move stack pointer for 4 words to avoid reporting non-existing frames
- // for all frames except the topmost one.
- // There is no way of knowing if topmost frame belongs to a leaf or
- // a nonleaf function.
- last_sp += kMinArgsOnStack * sizeof(caller_pc);
- // Adjust 'count' so that return address is scanned only in limits
- // of one stack frame.
- count -= kMinArgsOnStack;
- }
-
- do {
- // Scanning for return address from stack pointer of the last frame.
- if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, count)) {
- // If we can't find an instruction pointer even with stack scanning,
- // give up.
- BPLOG(ERROR) << " ScanForReturnAddress failed ";
- return NULL;
- }
- // Get $fp stored in the stack frame.
- if (!memory_->GetMemoryAtAddress(caller_sp - sizeof(caller_pc),
- &caller_fp)) {
- BPLOG(INFO) << " GetMemoryAtAddress for fp failed " ;
- return NULL;
- }
-
- count = count - (caller_sp - last_sp) / sizeof(caller_pc);
- // Now scan the next address in the stack.
- last_sp = caller_sp + sizeof(caller_pc);
- } while ((caller_fp - caller_sp >= kMaxFrameStackSize) && count > 0);
-
- if (!count) {
- BPLOG(INFO) << " No frame found " ;
- return NULL;
- }
-
- // ScanForReturnAddress found a reasonable return address. Advance
- // $sp to the location above the one where the return address was
- // found.
- caller_sp += sizeof(caller_pc);
- // caller_pc is actually containing $ra value;
- // $pc is two instructions before $ra,
- // so the caller_pc needs to be decremented accordingly.
- caller_pc -= 2 * sizeof(caller_pc);
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameMIPS* frame = new StackFrameMIPS();
- frame->trust = StackFrame::FRAME_TRUST_SCAN;
- frame->context = last_frame->context;
- frame->context.epc = caller_pc;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
- frame->instruction = caller_pc;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] = caller_sp;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_SP;
- frame->context.iregs[MD_CONTEXT_MIPS_REG_FP] = caller_fp;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_FP;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] =
- caller_pc + 2 * sizeof(caller_pc);
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
-
- return frame;
- } else {
- uint64_t last_sp = last_frame->context.iregs[MD_CONTEXT_MIPS_REG_SP];
- uint64_t caller_pc, caller_sp, caller_fp;
-
- // Return address cannot be obtained directly.
- // Force stackwalking.
-
- // We cannot use frame pointer to get the return address.
- // We'll scan the stack for a
- // return address. This can happen if last_frame is executing code
- // for a module for which we don't have symbols.
- int count = kMaxFrameStackSize / sizeof(caller_pc);
-
- do {
- // Scanning for return address from stack pointer of the last frame.
- if (!ScanForReturnAddress(last_sp, &caller_sp, &caller_pc, count)) {
- // If we can't find an instruction pointer even with stack scanning,
- // give up.
- BPLOG(ERROR) << " ScanForReturnAddress failed ";
- return NULL;
- }
- // Get $fp stored in the stack frame.
- if (!memory_->GetMemoryAtAddress(caller_sp - sizeof(caller_pc),
- &caller_fp)) {
- BPLOG(INFO) << " GetMemoryAtAddress for fp failed " ;
- return NULL;
- }
-
- count = count - (caller_sp - last_sp) / sizeof(caller_pc);
- // Now scan the next address in the stack.
- last_sp = caller_sp + sizeof(caller_pc);
- } while ((caller_fp - caller_sp >= kMaxFrameStackSize) && count > 0);
-
- if (!count) {
- BPLOG(INFO) << " No frame found " ;
- return NULL;
- }
-
- // ScanForReturnAddress found a reasonable return address. Advance
- // $sp to the location above the one where the return address was
- // found.
- caller_sp += sizeof(caller_pc);
- // caller_pc is actually containing $ra value;
- // $pc is two instructions before $ra,
- // so the caller_pc needs to be decremented accordingly.
- caller_pc -= 2 * sizeof(caller_pc);
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameMIPS* frame = new StackFrameMIPS();
- frame->trust = StackFrame::FRAME_TRUST_SCAN;
- frame->context = last_frame->context;
- frame->context.epc = caller_pc;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_PC;
- frame->instruction = caller_pc;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_SP] = caller_sp;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_SP;
- frame->context.iregs[MD_CONTEXT_MIPS_REG_FP] = caller_fp;
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_FP;
-
- frame->context.iregs[MD_CONTEXT_MIPS_REG_RA] =
- caller_pc + 2 * sizeof(caller_pc);
- frame->context_validity |= StackFrameMIPS::CONTEXT_VALID_RA;
-
- return frame;
- }
-}
-
-} // namespace google_breakpad
-
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.h
deleted file mode 100644
index 5f97791fb7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_mips.h: MIPS-specific stackwalker.
-//
-// Provides stack frames given MIPS register context and a memory region
-// corresponding to a MIPSstack.
-//
-// Author: Tata Elxsi
-
-#ifndef PROCESSOR_STACKWALKER_MIPS_H__
-#define PROCESSOR_STACKWALKER_MIPS_H__
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/cfi_frame_info.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerMIPS : public Stackwalker {
- public:
- // Context is a MIPS context object that gives access to mips-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly
- // through to the base Stackwalker constructor.
- StackwalkerMIPS(const SystemInfo* system_info,
- const MDRawContextMIPS* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // Implementation of Stackwalker, using mips context and stack conventions.
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Use cfi_frame_info (derived from STACK CFI records) to construct
- // the frame that called frames.back(). The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameMIPS* GetCallerByCFIFrameInfo(const vector<StackFrame*>& frames,
- CFIFrameInfo* cfi_frame_info);
-
- // Scan the stack for plausible return address and frame pointer pair.
- // The caller takes ownership of the returned frame. Return NULL on failure.
- StackFrameMIPS* GetCallerByStackScan(const vector<StackFrame*>& frames);
-
- // Stores the CPU context corresponding to the innermost stack frame to
- // be returned by GetContextFrame.
- const MDRawContextMIPS* context_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STACKWALKER_MIPS_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips_unittest.cc
deleted file mode 100644
index 5398c2b330..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_mips_unittest.cc
+++ /dev/null
@@ -1,707 +0,0 @@
-// Copyright (c) 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Gordana Cmiljanovic <gordana.cmiljanovic@imgtec.com>
-
-// stackwalker_mips_unittest.cc: Unit tests for StackwalkerMIPS class.
-
-#include <string.h>
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/stackwalker_unittest_utils.h"
-#include "processor/stackwalker_mips.h"
-#include "processor/windows_frame_info.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::StackFrameSymbolizer;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFrameMIPS;
-using google_breakpad::Stackwalker;
-using google_breakpad::StackwalkerMIPS;
-using google_breakpad::SystemInfo;
-using google_breakpad::WindowsFrameInfo;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using std::vector;
-using testing::_;
-using testing::AnyNumber;
-using testing::Return;
-using testing::SetArgumentPointee;
-using testing::Test;
-
-class StackwalkerMIPSFixture {
- public:
- StackwalkerMIPSFixture()
- : stack_section(kLittleEndian),
- // Give the two modules reasonable standard locations and names
- // for tests to play with.
- module1(0x00400000, 0x10000, "module1", "version1"),
- module2(0x00500000, 0x10000, "module2", "version2") {
- // Identify the system as a Linux system.
- system_info.os = "Linux";
- system_info.os_short = "linux";
- system_info.os_version = "Observant Opossum"; // Jealous Jellyfish
- system_info.cpu = "mips";
- system_info.cpu_info = "";
-
- // Put distinctive values in the raw CPU context.
- BrandContext(&raw_context);
-
- // Create some modules with some stock debugging information.
- modules.Add(&module1);
- modules.Add(&module2);
-
- // By default, none of the modules have symbol info; call
- // SetModuleSymbols to override this.
- EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
- .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
-
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
-
- // Reset max_frames_scanned since it's static.
- Stackwalker::set_max_frames_scanned(1024);
- }
-
- // Set the Breakpad symbol information that supplier should return for
- // MODULE to INFO.
- void SetModuleSymbols(MockCodeModule* module, const string& info) {
- size_t buffer_size;
- char* buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
- EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
- SetArgumentPointee<4>(buffer_size),
- Return(MockSymbolSupplier::FOUND)));
- }
-
- // Populate stack_region with the contents of stack_section. Use
- // stack_section.start() as the region's starting address.
- void RegionFromSection() {
- string contents;
- ASSERT_TRUE(stack_section.GetContents(&contents));
- stack_region.Init(stack_section.start().Value(), contents);
- }
-
- // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
- void BrandContext(MDRawContextMIPS* raw_context) {
- uint8_t x = 173;
- for (size_t i = 0; i < sizeof(*raw_context); ++i)
- reinterpret_cast<uint8_t*>(raw_context)[i] = (x += 17);
- }
-
- SystemInfo system_info;
- MDRawContextMIPS raw_context;
- Section stack_section;
- MockMemoryRegion stack_region;
- MockCodeModule module1;
- MockCodeModule module2;
- MockCodeModules modules;
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- CallStack call_stack;
- const vector<StackFrame*>* frames;
-};
-
-class SanityCheck: public StackwalkerMIPSFixture, public Test { };
-
-TEST_F(SanityCheck, NoResolver) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- stack_section.start() = 0x80000000;
- stack_section.D32(0).D32(0x0);
- RegionFromSection();
- raw_context.epc = 0x00400020;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
-
- StackFrameSymbolizer frame_symbolizer(NULL, NULL);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- // This should succeed, even without a resolver or supplier.
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
- StackFrameMIPS* frame = static_cast<StackFrameMIPS*>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetContextFrame: public StackwalkerMIPSFixture, public Test { };
-
-TEST_F(GetContextFrame, Simple) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- stack_section.start() = 0x80000000;
- stack_section.D32(0).D32(0x0);
- RegionFromSection();
- raw_context.epc = 0x00400020;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- StackFrameMIPS* frame = static_cast<StackFrameMIPS*>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-// The stackwalker should be able to produce the context frame even
-// without stack memory present.
-TEST_F(GetContextFrame, NoStackMemory) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- raw_context.epc = 0x00400020;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, NULL, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- StackFrameMIPS* frame = static_cast<StackFrameMIPS*>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetCallerFrame: public StackwalkerMIPSFixture, public Test { };
-
-TEST_F(GetCallerFrame, ScanWithoutSymbols) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- // When the stack walker resorts to scanning the stack,
- // only addresses located within loaded modules are
- // considered valid return addresses.
- // Force scanning through three frames to ensure that the
- // stack pointer is set properly in scan-recovered frames.
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x00400100;
- uint32_t return_address2 = 0x00400900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D32(0x00490000) // junk that's not
- .D32(0x00600000) // a return address
-
- .D32(frame1_sp) // stack pointer
- .D32(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(16, 0) // space
-
- .D32(0xF0000000) // more junk
- .D32(0x0000000D)
-
- .D32(frame2_sp) // stack pointer
- .D32(return_address2) // actual return address
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.epc = 0x00405510;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
- raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address1;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
- StackFrameMIPS::CONTEXT_VALID_SP |
- StackFrameMIPS::CONTEXT_VALID_FP |
- StackFrameMIPS::CONTEXT_VALID_RA),
- frame1->context_validity);
- EXPECT_EQ(return_address1 - 2 * sizeof(return_address1), frame1->context.epc);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
-
- StackFrameMIPS* frame2 = static_cast<StackFrameMIPS*>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame2->trust);
- ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
- StackFrameMIPS::CONTEXT_VALID_SP |
- StackFrameMIPS::CONTEXT_VALID_FP |
- StackFrameMIPS::CONTEXT_VALID_RA),
- frame2->context_validity);
- EXPECT_EQ(return_address2 - 2 * sizeof(return_address2), frame2->context.epc);
- EXPECT_EQ(frame2_sp.Value(), frame2->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
-}
-
-TEST_F(GetCallerFrame, ScanWithFunctionSymbols) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- // During stack scanning, if a potential return address
- // is located within a loaded module that has symbols,
- // it is only considered a valid return address if it
- // lies within a function's bounds.
- stack_section.start() = 0x80000000;
- uint32_t return_address = 0x00500200;
- Label frame1_sp;
- stack_section
- // frame 0
- .Append(16, 0) // space
-
- .D32(0x00490000) // junk that's not
- .D32(0x00600000) // a return address
-
- .D32(0x00401000) // a couple of plausible addresses
- .D32(0x0050F000) // that are not within functions
-
- .D32(frame1_sp) // stack pointer
- .D32(return_address) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.epc = 0x00400200;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
- raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address;
-
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 100 400 10 monotreme\n");
- SetModuleSymbols(&module2,
- // The calling frame's function.
- "FUNC 100 400 10 marsupial\n");
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
- EXPECT_EQ("monotreme", frame0->function_name);
- EXPECT_EQ(0x00400100U, frame0->function_base);
-
- StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
- StackFrameMIPS::CONTEXT_VALID_SP |
- StackFrameMIPS::CONTEXT_VALID_FP |
- StackFrameMIPS::CONTEXT_VALID_RA),
- frame1->context_validity);
- EXPECT_EQ(return_address - 2 * sizeof(return_address), frame1->context.epc);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
- EXPECT_EQ("marsupial", frame1->function_name);
- EXPECT_EQ(0x00500100U, frame1->function_base);
-}
-
-TEST_F(GetCallerFrame, CheckStackFrameSizeLimit) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- // If the stackwalker resorts to stack scanning, it will scan only
- // 1024 bytes of stack which correspondes to maximum size of stack frame.
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x00500100;
- uint32_t return_address2 = 0x00500900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(32, 0) // space
-
- .D32(0x00490000) // junk that's not
- .D32(0x00600000) // a return address
-
- .Append(96, 0) // more space
-
- .D32(frame1_sp) // stack pointer
- .D32(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(128 * 4, 0) // space
-
- .D32(0x00F00000) // more junk
- .D32(0x0000000D)
-
- .Append(128 * 4, 0) // more space
-
- .D32(frame2_sp) // stack pointer
- .D32(return_address2) // actual return address
- // (won't be found)
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.epc = 0x00405510;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
- raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address1;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(2U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ("module2", modules_without_symbols[1]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-
- StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameMIPS::CONTEXT_VALID_PC |
- StackFrameMIPS::CONTEXT_VALID_SP |
- StackFrameMIPS::CONTEXT_VALID_FP |
- StackFrameMIPS::CONTEXT_VALID_RA),
- frame1->context_validity);
- EXPECT_EQ(return_address1 - 2 * sizeof(return_address1), frame1->context.epc);
- EXPECT_EQ(frame1_sp.Value(), frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
-}
-
-// Test that set_max_frames_scanned prevents using stack scanning
-// to find caller frames.
-TEST_F(GetCallerFrame, ScanningNotAllowed) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- // When the stack walker resorts to scanning the stack,
- // only fixed number of frames are allowed to be scanned out from stack
- stack_section.start() = 0x80000000;
- uint32_t return_address1 = 0x00500100;
- uint32_t return_address2 = 0x00500900;
- Label frame1_sp, frame2_sp;
- stack_section
- // frame 0
- .Append(32, 0) // space
-
- .D32(0x00490000) // junk that's not
- .D32(0x00600000) // a return address
-
- .Append(96, 0) // more space
-
- .D32(frame1_sp) // stack pointer
- .D32(return_address1) // actual return address
- // frame 1
- .Mark(&frame1_sp)
- .Append(128 * 4, 0) // space
-
- .D32(0x00F00000) // more junk
- .D32(0x0000000D)
-
- .Append(128 * 4, 0) // more space
-
- .D32(frame2_sp) // stack pointer
- .D32(return_address2) // actual return address
- // (won't be found)
- // frame 2
- .Mark(&frame2_sp)
- .Append(32, 0); // end of stack
- RegionFromSection();
-
- raw_context.epc = 0x00405510;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
- raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = return_address1;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- Stackwalker::set_max_frames_scanned(0);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-
- StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0, memcmp(&raw_context, &frame0->context, sizeof(raw_context)));
-}
-
-struct CFIFixture: public StackwalkerMIPSFixture {
- CFIFixture() {
- // Provide some STACK CFI records;
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 4000 1000 0 enchiridion\n"
- // Initially, nothing has been pushed on the stack,
- // and the return address is still in the $ra register.
- "STACK CFI INIT 4000 1000 .cfa: $sp 0 + .ra: $ra\n"
- // Move stack pointer.
- "STACK CFI 4004 .cfa: $sp 32 +\n"
- // store $fp and ra
- "STACK CFI 4008 $fp: .cfa -8 + ^ .ra: .cfa -4 + ^\n"
- // restore $fp
- "STACK CFI 400c .cfa: $fp 32 +\n"
- // restore $sp
- "STACK CFI 4018 .cfa: $sp 32 +\n"
-
- "STACK CFI 4020 $fp: $fp .cfa: $sp 0 + .ra: .ra\n"
-
- // The calling function.
- "FUNC 5000 1000 0 epictetus\n"
- // Initially, nothing has been pushed on the stack,
- // and the return address is still in the $ra register.
- "STACK CFI INIT 5000 1000 .cfa: $sp .ra: $ra\n"
- // Mark it as end of stack.
- "STACK CFI INIT 5000 8 .cfa: $sp 0 + .ra: $ra\n"
-
- // A function whose CFI makes the stack pointer
- // go backwards.
- "FUNC 6000 1000 20 palinal\n"
- "STACK CFI INIT 6000 1000 .cfa: $sp 4 - .ra: $ra\n"
-
- // A function with CFI expressions that can't be
- // evaluated.
- "FUNC 7000 1000 20 rhetorical\n"
- "STACK CFI INIT 7000 1000 .cfa: moot .ra: ambiguous\n"
- );
-
- // Provide some distinctive values for the caller's registers.
- expected.epc = 0x00405508;
- expected.iregs[MD_CONTEXT_MIPS_REG_S0] = 0x0;
- expected.iregs[MD_CONTEXT_MIPS_REG_S1] = 0x1;
- expected.iregs[MD_CONTEXT_MIPS_REG_S2] = 0x2;
- expected.iregs[MD_CONTEXT_MIPS_REG_S3] = 0x3;
- expected.iregs[MD_CONTEXT_MIPS_REG_S4] = 0x4;
- expected.iregs[MD_CONTEXT_MIPS_REG_S5] = 0x5;
- expected.iregs[MD_CONTEXT_MIPS_REG_S6] = 0x6;
- expected.iregs[MD_CONTEXT_MIPS_REG_S7] = 0x7;
- expected.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
- expected.iregs[MD_CONTEXT_MIPS_REG_FP] = 0x80000000;
- expected.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
-
- // Expect CFI to recover all callee-save registers. Since CFI is the
- // only stack frame construction technique we have, aside from the
- // context frame itself, there's no way for us to have a set of valid
- // registers smaller than this.
- expected_validity = (StackFrameMIPS::CONTEXT_VALID_PC |
- StackFrameMIPS::CONTEXT_VALID_S0 |
- StackFrameMIPS::CONTEXT_VALID_S1 |
- StackFrameMIPS::CONTEXT_VALID_S2 |
- StackFrameMIPS::CONTEXT_VALID_S3 |
- StackFrameMIPS::CONTEXT_VALID_S4 |
- StackFrameMIPS::CONTEXT_VALID_S5 |
- StackFrameMIPS::CONTEXT_VALID_S6 |
- StackFrameMIPS::CONTEXT_VALID_S7 |
- StackFrameMIPS::CONTEXT_VALID_SP |
- StackFrameMIPS::CONTEXT_VALID_FP |
- StackFrameMIPS::CONTEXT_VALID_RA);
-
- // By default, context frames provide all registers, as normal.
- context_frame_validity = StackFrameMIPS::CONTEXT_VALID_ALL;
-
- // By default, registers are unchanged.
- raw_context = expected;
- }
-
- // Walk the stack, using stack_section as the contents of the stack
- // and raw_context as the current register values. (Set the stack
- // pointer to the stack's starting address.) Expect two stack
- // frames; in the older frame, expect the callee-saves registers to
- // have values matching those in 'expected'.
- void CheckWalk() {
- RegionFromSection();
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region,
- &modules, &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- StackFrameMIPS* frame0 = static_cast<StackFrameMIPS*>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameMIPS::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ("enchiridion", frame0->function_name);
- EXPECT_EQ(0x00404000U, frame0->function_base);
-
- StackFrameMIPS* frame1 = static_cast<StackFrameMIPS*>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ(expected_validity, frame1->context_validity);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S0],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S0]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S1],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S1]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S2],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S2]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S3],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S3]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S4],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S4]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S5],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S5]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S6],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S6]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_S7],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_S7]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_FP],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_FP]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_RA],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_RA]);
- EXPECT_EQ(expected.iregs[MD_CONTEXT_MIPS_REG_SP],
- frame1->context.iregs[MD_CONTEXT_MIPS_REG_SP]);
- EXPECT_EQ(expected.epc, frame1->context.epc);
- EXPECT_EQ(expected.epc, frame1->instruction);
- EXPECT_EQ("epictetus", frame1->function_name);
- EXPECT_EQ(0x00405000U, frame1->function_base);
- }
-
- // The values we expect to find for the caller's registers.
- MDRawContextMIPS expected;
-
- // The validity mask for expected.
- int expected_validity;
-
- // The validity mask to impose on the context frame.
- int context_frame_validity;
-};
-
-class CFI: public CFIFixture, public Test { };
-
-// TODO(gordanac): add CFI tests
-
-TEST_F(CFI, At4004) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- Label frame1_sp = expected.iregs[MD_CONTEXT_MIPS_REG_SP];
- stack_section
- // frame0
- .Append(24, 0) // space
- .D32(frame1_sp) // stack pointer
- .D32(0x00405510) // return address
- .Mark(&frame1_sp); // This effectively sets stack_section.start().
- raw_context.epc = 0x00404004;
- CheckWalk();
-}
-
-// Check that we reject rules that would cause the stack pointer to
-// move in the wrong direction.
-TEST_F(CFI, RejectBackwards) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- raw_context.epc = 0x40005000;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-}
-
-// Check that we reject rules whose expressions' evaluation fails.
-TEST_F(CFI, RejectBadExpressions) {
- raw_context.context_flags = raw_context.context_flags | MD_CONTEXT_MIPS_FULL;
- raw_context.epc = 0x00407000;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_SP] = 0x80000000;
- raw_context.iregs[MD_CONTEXT_MIPS_REG_RA] = 0x00405510;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerMIPS walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.cc
deleted file mode 100644
index 7e2088440b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_ppc.cc: ppc-specific stackwalker.
-//
-// See stackwalker_ppc.h for documentation.
-//
-// Author: Mark Mentovai
-
-
-#include "processor/stackwalker_ppc.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-
-StackwalkerPPC::StackwalkerPPC(const SystemInfo* system_info,
- const MDRawContextPPC* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context) {
- if (memory_ && memory_->GetBase() + memory_->GetSize() - 1 > 0xffffffff) {
- // This implementation only covers 32-bit ppc CPUs. The limits of the
- // supplied stack are invalid. Mark memory_ = NULL, which will cause
- // stackwalking to fail.
- BPLOG(ERROR) << "Memory out of range for stackwalking: " <<
- HexString(memory_->GetBase()) << "+" <<
- HexString(memory_->GetSize());
- memory_ = NULL;
- }
-}
-
-
-StackFrame* StackwalkerPPC::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFramePPC* frame = new StackFramePPC();
-
- // The instruction pointer is stored directly in a register, so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = StackFramePPC::CONTEXT_VALID_ALL;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.srr0;
-
- return frame;
-}
-
-
-StackFrame* StackwalkerPPC::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- // The instruction pointers for previous frames are saved on the stack.
- // The typical ppc calling convention is for the called procedure to store
- // its return address in the calling procedure's stack frame at 8(%r1),
- // and to allocate its own stack frame by decrementing %r1 (the stack
- // pointer) and saving the old value of %r1 at 0(%r1). Because the ppc has
- // no hardware stack, there is no distinction between the stack pointer and
- // frame pointer, and what is typically thought of as the frame pointer on
- // an x86 is usually referred to as the stack pointer on a ppc.
-
- StackFramePPC* last_frame = static_cast<StackFramePPC*>(
- stack->frames()->back());
-
- // A caller frame must reside higher in memory than its callee frames.
- // Anything else is an error, or an indication that we've reached the
- // end of the stack.
- uint32_t stack_pointer;
- if (!memory_->GetMemoryAtAddress(last_frame->context.gpr[1],
- &stack_pointer) ||
- stack_pointer <= last_frame->context.gpr[1]) {
- return NULL;
- }
-
- // Mac OS X/Darwin gives 1 as the return address from the bottom-most
- // frame in a stack (a thread's entry point). I haven't found any
- // documentation on this, but 0 or 1 would be bogus return addresses,
- // so check for them here and return false (end of stack) when they're
- // hit to avoid having a phantom frame.
- uint32_t instruction;
- if (!memory_->GetMemoryAtAddress(stack_pointer + 8, &instruction) ||
- instruction <= 1) {
- return NULL;
- }
-
- StackFramePPC* frame = new StackFramePPC();
-
- frame->context = last_frame->context;
- frame->context.srr0 = instruction;
- frame->context.gpr[1] = stack_pointer;
- frame->context_validity = StackFramePPC::CONTEXT_VALID_SRR0 |
- StackFramePPC::CONTEXT_VALID_GPR1;
- frame->trust = StackFrame::FRAME_TRUST_FP;
-
- // frame->context.srr0 is the return address, which is one instruction
- // past the branch that caused us to arrive at the callee. Set
- // frame_ppc->instruction to four less than that. Since all ppc
- // instructions are 4 bytes wide, this is the address of the branch
- // instruction. This allows source line information to match up with the
- // line that contains a function call. Callers that require the exact
- // return address value may access the context.srr0 field of StackFramePPC.
- frame->instruction = frame->context.srr0 - 4;
-
- return frame;
-}
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.h
deleted file mode 100644
index 012e5c32f9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_ppc.h: ppc-specific stackwalker.
-//
-// Provides stack frames given ppc register context and a memory region
-// corresponding to a ppc stack.
-//
-// Author: Mark Mentovai
-
-
-#ifndef PROCESSOR_STACKWALKER_PPC_H__
-#define PROCESSOR_STACKWALKER_PPC_H__
-
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerPPC : public Stackwalker {
- public:
- // context is a ppc context object that gives access to ppc-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerPPC(const SystemInfo* system_info,
- const MDRawContextPPC* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // Implementation of Stackwalker, using ppc context (stack pointer in %r1,
- // saved program counter in %srr0) and stack conventions (saved stack
- // pointer at 0(%r1), return address at 8(0(%r1)).
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Stores the CPU context corresponding to the innermost stack frame to
- // be returned by GetContextFrame.
- const MDRawContextPPC* context_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_PPC_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.cc
deleted file mode 100644
index 51c71fe561..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_ppc64.cc: ppc64-specific stackwalker.
-//
-// See stackwalker_ppc64.h for documentation.
-
-
-#include "processor/stackwalker_ppc64.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/logging.h"
-
-#include <stdio.h>
-
-namespace google_breakpad {
-
-
-StackwalkerPPC64::StackwalkerPPC64(const SystemInfo* system_info,
- const MDRawContextPPC64* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context) {
-}
-
-
-StackFrame* StackwalkerPPC64::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFramePPC64* frame = new StackFramePPC64();
-
- // The instruction pointer is stored directly in a register, so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = StackFramePPC64::CONTEXT_VALID_ALL;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.srr0;
-
- return frame;
-}
-
-
-StackFrame* StackwalkerPPC64::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- // The instruction pointers for previous frames are saved on the stack.
- // The typical ppc64 calling convention is for the called procedure to store
- // its return address in the calling procedure's stack frame at 8(%r1),
- // and to allocate its own stack frame by decrementing %r1 (the stack
- // pointer) and saving the old value of %r1 at 0(%r1). Because the ppc64 has
- // no hardware stack, there is no distinction between the stack pointer and
- // frame pointer, and what is typically thought of as the frame pointer on
- // an x86 is usually referred to as the stack pointer on a ppc64.
-
- StackFramePPC64* last_frame = static_cast<StackFramePPC64*>(
- stack->frames()->back());
-
- // A caller frame must reside higher in memory than its callee frames.
- // Anything else is an error, or an indication that we've reached the
- // end of the stack.
- uint64_t stack_pointer;
- if (!memory_->GetMemoryAtAddress(last_frame->context.gpr[1],
- &stack_pointer) ||
- stack_pointer <= last_frame->context.gpr[1]) {
- return NULL;
- }
-
- // Mac OS X/Darwin gives 1 as the return address from the bottom-most
- // frame in a stack (a thread's entry point). I haven't found any
- // documentation on this, but 0 or 1 would be bogus return addresses,
- // so check for them here and return false (end of stack) when they're
- // hit to avoid having a phantom frame.
- uint64_t instruction;
- if (!memory_->GetMemoryAtAddress(stack_pointer + 16, &instruction) ||
- instruction <= 1) {
- return NULL;
- }
-
- StackFramePPC64* frame = new StackFramePPC64();
-
- frame->context = last_frame->context;
- frame->context.srr0 = instruction;
- frame->context.gpr[1] = stack_pointer;
- frame->context_validity = StackFramePPC64::CONTEXT_VALID_SRR0 |
- StackFramePPC64::CONTEXT_VALID_GPR1;
- frame->trust = StackFrame::FRAME_TRUST_FP;
-
- // frame->context.srr0 is the return address, which is one instruction
- // past the branch that caused us to arrive at the callee. Set
- // frame_ppc64->instruction to eight less than that. Since all ppc64
- // instructions are 8 bytes wide, this is the address of the branch
- // instruction. This allows source line information to match up with the
- // line that contains a function call. Callers that require the exact
- // return address value may access the context.srr0 field of StackFramePPC64.
- frame->instruction = frame->context.srr0 - 8;
-
- return frame;
-}
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.h
deleted file mode 100644
index a406343af4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_ppc64.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright (c) 2013 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_ppc64.h: ppc-specific stackwalker.
-//
-// Provides stack frames given ppc64 register context and a memory region
-// corresponding to a ppc64 stack.
-
-
-#ifndef PROCESSOR_STACKWALKER_PPC64_H__
-#define PROCESSOR_STACKWALKER_PPC64_H__
-
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerPPC64 : public Stackwalker {
- public:
- // context is a ppc64 context object that gives access to ppc64-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerPPC64(const SystemInfo* system_info,
- const MDRawContextPPC64* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // Implementation of Stackwalker, using ppc64 context (stack pointer in %r1,
- // saved program counter in %srr0) and stack conventions (saved stack
- // pointer at 0(%r1), return address at 8(0(%r1)).
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Stores the CPU context corresponding to the innermost stack frame to
- // be returned by GetContextFrame.
- const MDRawContextPPC64* context_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_PPC64_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest.cc
deleted file mode 100644
index f692d4c4c0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest.cc
+++ /dev/null
@@ -1,433 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_selftest.cc: Tests StackwalkerX86 or StackwalkerPPC using the
-// running process' stack as test data, if running on an x86 or ppc and
-// compiled with gcc. This test is not enabled in the "make check" suite
-// by default, because certain optimizations interfere with its proper
-// operation. To turn it on, configure with --enable-selftest.
-//
-// Optimizations that cause problems:
-// - stack frame reuse. The Recursor function here calls itself with
-// |return Recursor|. When the caller's frame is reused, it will cause
-// CountCallerFrames to correctly return the same number of frames
-// in both the caller and callee. This is considered an unexpected
-// condition in the test, which expects a callee to have one more
-// caller frame in the stack than its caller.
-// - frame pointer omission. Even with a stackwalker that understands
-// this optimization, the code to harness debug information currently
-// only exists to retrieve it from minidumps, not the current process.
-//
-// This test can also serve as a developmental and debugging aid if
-// PRINT_STACKS is defined.
-//
-// Author: Mark Mentovai
-
-#include <assert.h>
-
-#include "processor/logging.h"
-
-#if defined(__i386) && !defined(__i386__)
-#define __i386__
-#endif
-#if defined(__sparc) && !defined(__sparc__)
-#define __sparc__
-#endif
-
-#if (defined(__SUNPRO_CC) || defined(__GNUC__)) && \
- (defined(__i386__) || defined(__ppc__) || defined(__sparc__))
-
-
-#include <stdio.h>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::MemoryRegion;
-using google_breakpad::scoped_ptr;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFramePPC;
-using google_breakpad::StackFrameX86;
-using google_breakpad::StackFrameSPARC;
-
-#if defined(__i386__)
-#include "processor/stackwalker_x86.h"
-using google_breakpad::StackwalkerX86;
-#elif defined(__ppc__)
-#include "processor/stackwalker_ppc.h"
-using google_breakpad::StackwalkerPPC;
-#elif defined(__sparc__)
-#include "processor/stackwalker_sparc.h"
-using google_breakpad::StackwalkerSPARC;
-#endif // __i386__ || __ppc__ || __sparc__
-
-#define RECURSION_DEPTH 100
-
-
-// A simple MemoryRegion subclass that provides direct access to this
-// process' memory space by pointer.
-class SelfMemoryRegion : public MemoryRegion {
- public:
- virtual uint64_t GetBase() const { return 0; }
- virtual uint32_t GetSize() const { return 0xffffffff; }
-
- bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const {
- return GetMemoryAtAddressInternal(address, value); }
- bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const {
- return GetMemoryAtAddressInternal(address, value); }
- bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const {
- return GetMemoryAtAddressInternal(address, value); }
- bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const {
- return GetMemoryAtAddressInternal(address, value); }
- void Print() const {
- assert(false);
- }
-
- private:
- template<typename T> bool GetMemoryAtAddressInternal(uint64_t address,
- T* value) {
- // Without knowing what addresses are actually mapped, just assume that
- // everything low is not mapped. This helps the stackwalker catch the
- // end of a stack when it tries to dereference a null or low pointer
- // in an attempt to find the caller frame. Other unmapped accesses will
- // cause the program to crash, but that would properly be a test failure.
- if (address < 0x100)
- return false;
-
- uint8_t* memory = 0;
- *value = *reinterpret_cast<const T*>(&memory[address]);
- return true;
- }
-};
-
-
-#if defined(__GNUC__)
-
-
-#if defined(__i386__)
-
-// GetEBP returns the current value of the %ebp register. Because it's
-// implemented as a function, %ebp itself contains GetEBP's frame pointer
-// and not the caller's frame pointer. Dereference %ebp to obtain the
-// caller's frame pointer, which the compiler-generated preamble stored
-// on the stack (provided frame pointers are not being omitted.) Because
-// this function depends on the compiler-generated preamble, inlining is
-// disabled.
-static uint32_t GetEBP() __attribute__((noinline));
-static uint32_t GetEBP() {
- uint32_t ebp;
- __asm__ __volatile__(
- "movl (%%ebp), %0"
- : "=a" (ebp)
- );
- return ebp;
-}
-
-
-// The caller's %esp is 8 higher than the value of %ebp in this function,
-// assuming that it's not inlined and that the standard prolog is used.
-// The CALL instruction places a 4-byte return address on the stack above
-// the caller's %esp, and this function's prolog will save the caller's %ebp
-// on the stack as well, for another 4 bytes, before storing %esp in %ebp.
-static uint32_t GetESP() __attribute__((noinline));
-static uint32_t GetESP() {
- uint32_t ebp;
- __asm__ __volatile__(
- "movl %%ebp, %0"
- : "=a" (ebp)
- );
- return ebp + 8;
-}
-
-
-// GetEIP returns the instruction pointer identifying the next instruction
-// to execute after GetEIP returns. It obtains this information from the
-// stack, where it was placed by the call instruction that called GetEIP.
-// This function depends on frame pointers not being omitted. It is possible
-// to write a pure asm version of this routine that has no compiler-generated
-// preamble and uses %esp instead of %ebp; that would function in the
-// absence of frame pointers. However, the simpler approach is used here
-// because GetEBP and stackwalking necessarily depends on access to frame
-// pointers. Because this function depends on a call instruction and the
-// compiler-generated preamble, inlining is disabled.
-static uint32_t GetEIP() __attribute__((noinline));
-static uint32_t GetEIP() {
- uint32_t eip;
- __asm__ __volatile__(
- "movl 4(%%ebp), %0"
- : "=a" (eip)
- );
- return eip;
-}
-
-
-#elif defined(__ppc__)
-
-
-// GetSP returns the current value of the %r1 register, which by convention,
-// is the stack pointer on ppc. Because it's implemented as a function,
-// %r1 itself contains GetSP's own stack pointer and not the caller's stack
-// pointer. Dereference %r1 to obtain the caller's stack pointer, which the
-// compiler-generated prolog stored on the stack. Because this function
-// depends on the compiler-generated prolog, inlining is disabled.
-static uint32_t GetSP() __attribute__((noinline));
-static uint32_t GetSP() {
- uint32_t sp;
- __asm__ __volatile__(
- "lwz %0, 0(r1)"
- : "=r" (sp)
- );
- return sp;
-}
-
-
-// GetPC returns the program counter identifying the next instruction to
-// execute after GetPC returns. It obtains this information from the
-// link register, where it was placed by the branch instruction that called
-// GetPC. Because this function depends on the caller's use of a branch
-// instruction, inlining is disabled.
-static uint32_t GetPC() __attribute__((noinline));
-static uint32_t GetPC() {
- uint32_t lr;
- __asm__ __volatile__(
- "mflr %0"
- : "=r" (lr)
- );
- return lr;
-}
-
-
-#elif defined(__sparc__)
-
-
-// GetSP returns the current value of the %sp/%o6/%g_r[14] register, which
-// by convention, is the stack pointer on sparc. Because it's implemented
-// as a function, %sp itself contains GetSP's own stack pointer and not
-// the caller's stack pointer. Dereference to obtain the caller's stack
-// pointer, which the compiler-generated prolog stored on the stack.
-// Because this function depends on the compiler-generated prolog, inlining
-// is disabled.
-static uint32_t GetSP() __attribute__((noinline));
-static uint32_t GetSP() {
- uint32_t sp;
- __asm__ __volatile__(
- "mov %%fp, %0"
- : "=r" (sp)
- );
- return sp;
-}
-
-// GetFP returns the current value of the %fp register. Because it's
-// implemented as a function, %fp itself contains GetFP's frame pointer
-// and not the caller's frame pointer. Dereference %fp to obtain the
-// caller's frame pointer, which the compiler-generated preamble stored
-// on the stack (provided frame pointers are not being omitted.) Because
-// this function depends on the compiler-generated preamble, inlining is
-// disabled.
-static uint32_t GetFP() __attribute__((noinline));
-static uint32_t GetFP() {
- uint32_t fp;
- __asm__ __volatile__(
- "ld [%%fp+56], %0"
- : "=r" (fp)
- );
- return fp;
-}
-
-// GetPC returns the program counter identifying the next instruction to
-// execute after GetPC returns. It obtains this information from the
-// link register, where it was placed by the branch instruction that called
-// GetPC. Because this function depends on the caller's use of a branch
-// instruction, inlining is disabled.
-static uint32_t GetPC() __attribute__((noinline));
-static uint32_t GetPC() {
- uint32_t pc;
- __asm__ __volatile__(
- "mov %%i7, %0"
- : "=r" (pc)
- );
- return pc + 8;
-}
-
-#endif // __i386__ || __ppc__ || __sparc__
-
-#elif defined(__SUNPRO_CC)
-
-#if defined(__i386__)
-extern "C" {
-extern uint32_t GetEIP();
-extern uint32_t GetEBP();
-extern uint32_t GetESP();
-}
-#elif defined(__sparc__)
-extern "C" {
-extern uint32_t GetPC();
-extern uint32_t GetFP();
-extern uint32_t GetSP();
-}
-#endif // __i386__ || __sparc__
-
-#endif // __GNUC__ || __SUNPRO_CC
-
-// CountCallerFrames returns the number of stack frames beneath the function
-// that called CountCallerFrames. Because this function's return value
-// is dependent on the size of the stack beneath it, inlining is disabled,
-// and any function that calls this should not be inlined either.
-#if defined(__GNUC__)
-static unsigned int CountCallerFrames() __attribute__((noinline));
-#elif defined(__SUNPRO_CC)
-static unsigned int CountCallerFrames();
-#endif
-static unsigned int CountCallerFrames() {
- SelfMemoryRegion memory;
- BasicSourceLineResolver resolver;
-
-#if defined(__i386__)
- MDRawContextX86 context = MDRawContextX86();
- context.eip = GetEIP();
- context.ebp = GetEBP();
- context.esp = GetESP();
-
- StackwalkerX86 stackwalker = StackwalkerX86(NULL, &context, &memory, NULL,
- NULL, &resolver);
-#elif defined(__ppc__)
- MDRawContextPPC context = MDRawContextPPC();
- context.srr0 = GetPC();
- context.gpr[1] = GetSP();
-
- StackwalkerPPC stackwalker = StackwalkerPPC(NULL, &context, &memory, NULL,
- NULL, &resolver);
-#elif defined(__sparc__)
- MDRawContextSPARC context = MDRawContextSPARC();
- context.pc = GetPC();
- context.g_r[14] = GetSP();
- context.g_r[30] = GetFP();
-
- StackwalkerSPARC stackwalker = StackwalkerSPARC(NULL, &context, &memory,
- NULL, NULL, &resolver);
-#endif // __i386__ || __ppc__ || __sparc__
-
- CallStack stack;
- vector<const CodeModule*> modules_without_symbols;
- stackwalker.Walk(&stack, &modules_without_symbols);
-
-#ifdef PRINT_STACKS
- printf("\n");
- for (unsigned int frame_index = 0;
- frame_index < stack.frames()->size();
- ++frame_index) {
- StackFrame *frame = stack.frames()->at(frame_index);
- printf("frame %-3d instruction = 0x%08" PRIx64,
- frame_index, frame->instruction);
-#if defined(__i386__)
- StackFrameX86 *frame_x86 = reinterpret_cast<StackFrameX86*>(frame);
- printf(" esp = 0x%08x ebp = 0x%08x\n",
- frame_x86->context.esp, frame_x86->context.ebp);
-#elif defined(__ppc__)
- StackFramePPC *frame_ppc = reinterpret_cast<StackFramePPC*>(frame);
- printf(" gpr[1] = 0x%08x\n", frame_ppc->context.gpr[1]);
-#elif defined(__sparc__)
- StackFrameSPARC *frame_sparc = reinterpret_cast<StackFrameSPARC*>(frame);
- printf(" sp = 0x%08x fp = 0x%08x\n",
- frame_sparc->context.g_r[14], frame_sparc->context.g_r[30]);
-#endif // __i386__ || __ppc__ || __sparc__
- }
-#endif // PRINT_STACKS
-
- // Subtract 1 because the caller wants the number of frames beneath
- // itself. Because the caller called us, subract two for our frame and its
- // frame, which are included in stack.size().
- return stack.frames()->size() - 2;
-}
-
-
-// Recursor verifies that the number stack frames beneath itself is one more
-// than the number of stack frames beneath its parent. When depth frames
-// have been reached, Recursor stops checking and returns success. If the
-// frame count check fails at any depth, Recursor will stop and return false.
-// Because this calls CountCallerFrames, inlining is disabled.
-#if defined(__GNUC__)
-static bool Recursor(unsigned int depth, unsigned int parent_callers)
- __attribute__((noinline));
-#elif defined(__SUNPRO_CC)
-static bool Recursor(unsigned int depth, unsigned int parent_callers);
-#endif
-static bool Recursor(unsigned int depth, unsigned int parent_callers) {
- unsigned int callers = CountCallerFrames();
- if (callers != parent_callers + 1)
- return false;
-
- if (depth)
- return Recursor(depth - 1, callers);
-
- // depth == 0
- return true;
-}
-
-
-// Because this calls CountCallerFrames, inlining is disabled - but because
-// it's main (and nobody calls it other than the entry point), it wouldn't
-// be inlined anyway.
-#if defined(__GNUC__)
-int main(int argc, char** argv) __attribute__((noinline));
-#elif defined(__SUNPRO_CC)
-int main(int argc, char** argv);
-#endif
-int main(int argc, char** argv) {
- BPLOG_INIT(&argc, &argv);
-
- return Recursor(RECURSION_DEPTH, CountCallerFrames()) ? 0 : 1;
-}
-
-
-#else
-// Not i386 or ppc or sparc? We can only test stacks we know how to walk.
-
-
-int main(int argc, char **argv) {
- BPLOG_INIT(&argc, &argv);
-
- // "make check" interprets an exit status of 77 to mean that the test is
- // not supported.
- BPLOG(ERROR) << "Selftest not supported here";
- return 77;
-}
-
-
-#endif // (__GNUC__ || __SUNPRO_CC) && (__i386__ || __ppc__ || __sparc__)
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest_sol.s b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest_sol.s
deleted file mode 100644
index 648b0499a1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_selftest_sol.s
+++ /dev/null
@@ -1,111 +0,0 @@
-/* Copyright (c) 2007, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* stackwalker_selftest_sol.s
- * On Solaris, the recommeded compiler is CC, so we can not use gcc inline
- * asm, use this method instead.
- *
- * How to compile: as -P -L -D_ASM -D_STDC -K PIC -o \
- * src/processor/stackwalker_selftest_sol.o \
- * src/processor/stackwalker_selftest_sol.s
- *
- * Author: Michael Shang
- */
-
-#include <sys/asm_linkage.h>
-
-#if defined(__i386)
-
-
-ENTRY(GetEBP)
- pushl %ebp
- movl %esp,%ebp
- subl $0x00000004,%esp
- movl 0x00000000(%ebp),%eax
- movl %eax,0xfffffffc(%ebp)
- movl 0xfffffffc(%ebp),%eax
- leave
- ret
-SET_SIZE(GetEBP)
-
-ENTRY(GetEIP)
- pushl %ebp
- movl %esp,%ebp
- subl $0x00000004,%esp
- movl 0x00000004(%ebp),%eax
- movl %eax,0xfffffffc(%ebp)
- movl 0xfffffffc(%ebp),%eax
- leave
- ret
-SET_SIZE(GetEIP)
-
-ENTRY(GetESP)
- pushl %ebp
- movl %esp,%ebp
- subl $0x00000004,%esp
- movl %ebp,%eax
- movl %eax,0xfffffffc(%ebp)
- movl 0xfffffffc(%ebp),%eax
- addl $0x00000008,%eax
- leave
- ret
-SET_SIZE(GetESP)
-
-
-#elif defined(__sparc)
-
-
-ENTRY(GetPC)
- save %sp, -120, %sp
- mov %i7, %i4
- inccc 8, %i4
- mov %i4, %i0
- ret
- restore
-SET_SIZE(GetPC)
-
-ENTRY(GetSP)
- save %sp, -120, %sp
- mov %fp, %i4
- mov %i4, %i0
- ret
- restore
-SET_SIZE(GetSP)
-
-ENTRY(GetFP)
- save %sp, -120, %sp
- ld [%fp + 56], %g1
- mov %g1, %i0
- ret
- restore
-SET_SIZE(GetFP)
-
-
-#endif // __i386 || __sparc
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc
deleted file mode 100644
index ff2ea75a80..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_sparc.cc: sparc-specific stackwalker.
-//
-// See stackwalker_sparc.h for documentation.
-//
-// Author: Michael Shang
-
-
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/logging.h"
-#include "processor/stackwalker_sparc.h"
-
-namespace google_breakpad {
-
-
-StackwalkerSPARC::StackwalkerSPARC(const SystemInfo* system_info,
- const MDRawContextSPARC* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context) {
-}
-
-
-StackFrame* StackwalkerSPARC::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFrameSPARC* frame = new StackFrameSPARC();
-
- // The instruction pointer is stored directly in a register, so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = StackFrameSPARC::CONTEXT_VALID_ALL;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.pc;
-
- return frame;
-}
-
-
-StackFrame* StackwalkerSPARC::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- StackFrameSPARC* last_frame = static_cast<StackFrameSPARC*>(
- stack->frames()->back());
-
- // new: caller
- // old: callee
- // %fp, %i6 and g_r[30] is the same, see minidump_format.h
- // %sp, %o6 and g_r[14] is the same, see minidump_format.h
- // %sp_new = %fp_old
- // %fp_new = *(%fp_old + 32 + 32 - 8), where the callee's %i6
- // %pc_new = *(%fp_old + 32 + 32 - 4) + 8
- // which is callee's %i7 plus 8
-
- // A caller frame must reside higher in memory than its callee frames.
- // Anything else is an error, or an indication that we've reached the
- // end of the stack.
- uint64_t stack_pointer = last_frame->context.g_r[30];
- if (stack_pointer <= last_frame->context.g_r[14]) {
- return NULL;
- }
-
- uint32_t instruction;
- if (!memory_->GetMemoryAtAddress(stack_pointer + 60,
- &instruction) || instruction <= 1) {
- return NULL;
- }
-
- uint32_t stack_base;
- if (!memory_->GetMemoryAtAddress(stack_pointer + 56,
- &stack_base) || stack_base <= 1) {
- return NULL;
- }
-
- StackFrameSPARC* frame = new StackFrameSPARC();
-
- frame->context = last_frame->context;
- frame->context.g_r[14] = stack_pointer;
- frame->context.g_r[30] = stack_base;
-
- // frame->context.pc is the return address, which is 2 instruction
- // past the branch that caused us to arrive at the callee, which are
- // a CALL instruction then a NOP instruction.
- // frame_ppc->instruction to 8 less than that. Since all sparc
- // instructions are 4 bytes wide, this is the address of the branch
- // instruction. This allows source line information to match up with the
- // line that contains a function call. Callers that require the exact
- // return address value may access the %i7/g_r[31] field of StackFrameSPARC.
- frame->context.pc = instruction + 8;
- frame->instruction = instruction;
- frame->context_validity = StackFrameSPARC::CONTEXT_VALID_PC |
- StackFrameSPARC::CONTEXT_VALID_SP |
- StackFrameSPARC::CONTEXT_VALID_FP;
- frame->trust = StackFrame::FRAME_TRUST_FP;
-
- return frame;
-}
-
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.h
deleted file mode 100644
index e8f2a38887..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_sparc.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_sparc.h: sparc-specific stackwalker.
-//
-// Provides stack frames given sparc register context and a memory region
-// corresponding to an sparc stack.
-//
-// Author: Michael Shang
-
-
-#ifndef PROCESSOR_STACKWALKER_SPARC_H__
-#define PROCESSOR_STACKWALKER_SPARC_H__
-
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-class StackwalkerSPARC : public Stackwalker {
- public:
- // context is a sparc context object that gives access to sparc-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerSPARC(const SystemInfo* system_info,
- const MDRawContextSPARC* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // Implementation of Stackwalker, using sparc context (%fp, %sp, %pc) and
- // stack conventions
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Stores the CPU context corresponding to the innermost stack frame to
- // be returned by GetContextFrame.
- const MDRawContextSPARC* context_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_SPARC_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_unittest_utils.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_unittest_utils.h
deleted file mode 100644
index ee22a8fe1c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_unittest_utils.h
+++ /dev/null
@@ -1,224 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// Mock classes for writing stackwalker tests, shared amongst architectures.
-
-#ifndef PROCESSOR_STACKWALKER_UNITTEST_UTILS_H_
-#define PROCESSOR_STACKWALKER_UNITTEST_UTILS_H_
-
-#include <assert.h>
-#include <stdlib.h>
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/symbol_supplier.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/linked_ptr.h"
-
-class MockMemoryRegion: public google_breakpad::MemoryRegion {
- public:
- MockMemoryRegion(): base_address_(0) { }
-
- // Set this region's address and contents. If we have placed an
- // instance of this class in a test fixture class, individual tests
- // can use this to provide the region's contents.
- void Init(uint64_t base_address, const string &contents) {
- base_address_ = base_address;
- contents_ = contents;
- }
-
- uint64_t GetBase() const { return base_address_; }
- uint32_t GetSize() const { return contents_.size(); }
-
- bool GetMemoryAtAddress(uint64_t address, uint8_t *value) const {
- return GetMemoryLittleEndian(address, value);
- }
- bool GetMemoryAtAddress(uint64_t address, uint16_t *value) const {
- return GetMemoryLittleEndian(address, value);
- }
- bool GetMemoryAtAddress(uint64_t address, uint32_t *value) const {
- return GetMemoryLittleEndian(address, value);
- }
- bool GetMemoryAtAddress(uint64_t address, uint64_t *value) const {
- return GetMemoryLittleEndian(address, value);
- }
- void Print() const {
- assert(false);
- }
-
- private:
- // Fetch a little-endian value from ADDRESS in contents_ whose size
- // is BYTES, and store it in *VALUE. Return true on success.
- template<typename ValueType>
- bool GetMemoryLittleEndian(uint64_t address, ValueType *value) const {
- if (address < base_address_ ||
- address - base_address_ + sizeof(ValueType) > contents_.size())
- return false;
- ValueType v = 0;
- int start = address - base_address_;
- // The loop condition is odd, but it's correct for size_t.
- for (size_t i = sizeof(ValueType) - 1; i < sizeof(ValueType); i--)
- v = (v << 8) | static_cast<unsigned char>(contents_[start + i]);
- *value = v;
- return true;
- }
-
- uint64_t base_address_;
- string contents_;
-};
-
-class MockCodeModule: public google_breakpad::CodeModule {
- public:
- MockCodeModule(uint64_t base_address, uint64_t size,
- const string &code_file, const string &version)
- : base_address_(base_address), size_(size), code_file_(code_file) { }
-
- uint64_t base_address() const { return base_address_; }
- uint64_t size() const { return size_; }
- string code_file() const { return code_file_; }
- string code_identifier() const { return code_file_; }
- string debug_file() const { return code_file_; }
- string debug_identifier() const { return code_file_; }
- string version() const { return version_; }
- google_breakpad::CodeModule *Copy() const {
- abort(); // Tests won't use this.
- }
- virtual uint64_t shrink_down_delta() const { return 0; }
- virtual void SetShrinkDownDelta(uint64_t shrink_down_delta) {}
-
- private:
- uint64_t base_address_;
- uint64_t size_;
- string code_file_;
- string version_;
-};
-
-class MockCodeModules: public google_breakpad::CodeModules {
- public:
- typedef google_breakpad::CodeModule CodeModule;
- typedef google_breakpad::CodeModules CodeModules;
-
- void Add(const MockCodeModule *module) {
- modules_.push_back(module);
- }
-
- unsigned int module_count() const { return modules_.size(); }
-
- const CodeModule *GetModuleForAddress(uint64_t address) const {
- for (ModuleVector::const_iterator i = modules_.begin();
- i != modules_.end(); i++) {
- const MockCodeModule *module = *i;
- if (module->base_address() <= address &&
- address - module->base_address() < module->size())
- return module;
- }
- return NULL;
- };
-
- const CodeModule *GetMainModule() const { return modules_[0]; }
-
- const CodeModule *GetModuleAtSequence(unsigned int sequence) const {
- return modules_.at(sequence);
- }
-
- const CodeModule *GetModuleAtIndex(unsigned int index) const {
- return modules_.at(index);
- }
-
- CodeModules *Copy() const { abort(); } // Tests won't use this
-
- virtual std::vector<google_breakpad::linked_ptr<const CodeModule> >
- GetShrunkRangeModules() const {
- return std::vector<google_breakpad::linked_ptr<const CodeModule> >();
- }
-
- // Returns true, if module address range shrink is enabled.
- bool IsModuleShrinkEnabled() const {
- return false;
- }
-
- private:
- typedef std::vector<const MockCodeModule *> ModuleVector;
- ModuleVector modules_;
-};
-
-class MockSymbolSupplier: public google_breakpad::SymbolSupplier {
- public:
- typedef google_breakpad::CodeModule CodeModule;
- typedef google_breakpad::SystemInfo SystemInfo;
- MOCK_METHOD3(GetSymbolFile, SymbolResult(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file));
- MOCK_METHOD4(GetSymbolFile, SymbolResult(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data));
- MOCK_METHOD5(GetCStringSymbolData, SymbolResult(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size));
- MOCK_METHOD1(FreeSymbolData, void(const CodeModule *module));
-
- // Copies the passed string contents into a newly allocated buffer.
- // The newly allocated buffer will be freed during destruction.
- char* CopySymbolDataAndOwnTheCopy(const std::string &info,
- size_t *symbol_data_size) {
- *symbol_data_size = info.size() + 1;
- char *symbol_data = new char[*symbol_data_size];
- memcpy(symbol_data, info.c_str(), info.size());
- symbol_data[info.size()] = '\0';
- symbol_data_to_free_.push_back(symbol_data);
- return symbol_data;
- }
-
- virtual ~MockSymbolSupplier() {
- for (SymbolDataVector::const_iterator i = symbol_data_to_free_.begin();
- i != symbol_data_to_free_.end(); i++) {
- char* symbol_data = *i;
- delete [] symbol_data;
- }
- }
-
- private:
- // List of symbol data to be freed upon destruction
- typedef std::vector<char*> SymbolDataVector;
- SymbolDataVector symbol_data_to_free_;
-};
-
-#endif // PROCESSOR_STACKWALKER_UNITTEST_UTILS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.cc
deleted file mode 100644
index 29d98e4b8a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.cc
+++ /dev/null
@@ -1,672 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_x86.cc: x86-specific stackwalker.
-//
-// See stackwalker_x86.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include <assert.h>
-#include <string>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/memory_region.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/logging.h"
-#include "processor/postfix_evaluator-inl.h"
-#include "processor/stackwalker_x86.h"
-#include "processor/windows_frame_info.h"
-#include "processor/cfi_frame_info.h"
-
-namespace google_breakpad {
-
-// Max reasonable size for a single x86 frame is 128 KB. This value is used in
-// a heuristic for recovering of the EBP chain after a scan for return address.
-// This value is based on a stack frame size histogram built for a set of
-// popular third party libraries which suggests that 99.5% of all frames are
-// smaller than 128 KB.
-static const uint32_t kMaxReasonableGapBetweenFrames = 128 * 1024;
-
-const StackwalkerX86::CFIWalker::RegisterSet
-StackwalkerX86::cfi_register_map_[] = {
- // It may seem like $eip and $esp are callee-saves, because (with Unix or
- // cdecl calling conventions) the callee is responsible for having them
- // restored upon return. But the callee_saves flags here really means
- // that the walker should assume they're unchanged if the CFI doesn't
- // mention them, which is clearly wrong for $eip and $esp.
- { "$eip", ".ra", false,
- StackFrameX86::CONTEXT_VALID_EIP, &MDRawContextX86::eip },
- { "$esp", ".cfa", false,
- StackFrameX86::CONTEXT_VALID_ESP, &MDRawContextX86::esp },
- { "$ebp", NULL, true,
- StackFrameX86::CONTEXT_VALID_EBP, &MDRawContextX86::ebp },
- { "$eax", NULL, false,
- StackFrameX86::CONTEXT_VALID_EAX, &MDRawContextX86::eax },
- { "$ebx", NULL, true,
- StackFrameX86::CONTEXT_VALID_EBX, &MDRawContextX86::ebx },
- { "$ecx", NULL, false,
- StackFrameX86::CONTEXT_VALID_ECX, &MDRawContextX86::ecx },
- { "$edx", NULL, false,
- StackFrameX86::CONTEXT_VALID_EDX, &MDRawContextX86::edx },
- { "$esi", NULL, true,
- StackFrameX86::CONTEXT_VALID_ESI, &MDRawContextX86::esi },
- { "$edi", NULL, true,
- StackFrameX86::CONTEXT_VALID_EDI, &MDRawContextX86::edi },
-};
-
-StackwalkerX86::StackwalkerX86(const SystemInfo* system_info,
- const MDRawContextX86* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* resolver_helper)
- : Stackwalker(system_info, memory, modules, resolver_helper),
- context_(context),
- cfi_walker_(cfi_register_map_,
- (sizeof(cfi_register_map_) / sizeof(cfi_register_map_[0]))) {
- if (memory_ && memory_->GetBase() + memory_->GetSize() - 1 > 0xffffffff) {
- // The x86 is a 32-bit CPU, the limits of the supplied stack are invalid.
- // Mark memory_ = NULL, which will cause stackwalking to fail.
- BPLOG(ERROR) << "Memory out of range for stackwalking: " <<
- HexString(memory_->GetBase()) << "+" <<
- HexString(memory_->GetSize());
- memory_ = NULL;
- }
-}
-
-StackFrameX86::~StackFrameX86() {
- if (windows_frame_info)
- delete windows_frame_info;
- windows_frame_info = NULL;
- if (cfi_frame_info)
- delete cfi_frame_info;
- cfi_frame_info = NULL;
-}
-
-uint64_t StackFrameX86::ReturnAddress() const {
- assert(context_validity & StackFrameX86::CONTEXT_VALID_EIP);
- return context.eip;
-}
-
-StackFrame* StackwalkerX86::GetContextFrame() {
- if (!context_) {
- BPLOG(ERROR) << "Can't get context frame without context";
- return NULL;
- }
-
- StackFrameX86* frame = new StackFrameX86();
-
- // The instruction pointer is stored directly in a register, so pull it
- // straight out of the CPU context structure.
- frame->context = *context_;
- frame->context_validity = StackFrameX86::CONTEXT_VALID_ALL;
- frame->trust = StackFrame::FRAME_TRUST_CONTEXT;
- frame->instruction = frame->context.eip;
-
- return frame;
-}
-
-StackFrameX86* StackwalkerX86::GetCallerByWindowsFrameInfo(
- const vector<StackFrame*> &frames,
- WindowsFrameInfo* last_frame_info,
- bool stack_scan_allowed) {
- StackFrame::FrameTrust trust = StackFrame::FRAME_TRUST_NONE;
-
- StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
-
- // Save the stack walking info we found, in case we need it later to
- // find the callee of the frame we're constructing now.
- last_frame->windows_frame_info = last_frame_info;
-
- // This function only covers the full STACK WIN case. If
- // last_frame_info is VALID_PARAMETER_SIZE-only, then we should
- // assume the traditional frame format or use some other strategy.
- if (last_frame_info->valid != WindowsFrameInfo::VALID_ALL)
- return NULL;
-
- // This stackwalker sets each frame's %esp to its value immediately prior
- // to the CALL into the callee. This means that %esp points to the last
- // callee argument pushed onto the stack, which may not be where %esp points
- // after the callee returns. Specifically, the value is correct for the
- // cdecl calling convention, but not other conventions. The cdecl
- // convention requires a caller to pop its callee's arguments from the
- // stack after the callee returns. This is usually accomplished by adding
- // the known size of the arguments to %esp. Other calling conventions,
- // including stdcall, thiscall, and fastcall, require the callee to pop any
- // parameters stored on the stack before returning. This is usually
- // accomplished by using the RET n instruction, which pops n bytes off
- // the stack after popping the return address.
- //
- // Because each frame's %esp will point to a location on the stack after
- // callee arguments have been PUSHed, when locating things in a stack frame
- // relative to %esp, the size of the arguments to the callee need to be
- // taken into account. This seems a little bit unclean, but it's better
- // than the alternative, which would need to take these same things into
- // account, but only for cdecl functions. With this implementation, we get
- // to be agnostic about each function's calling convention. Furthermore,
- // this is how Windows debugging tools work, so it means that the %esp
- // values produced by this stackwalker directly correspond to the %esp
- // values you'll see there.
- //
- // If the last frame has no callee (because it's the context frame), just
- // set the callee parameter size to 0: the stack pointer can't point to
- // callee arguments because there's no callee. This is correct as long
- // as the context wasn't captured while arguments were being pushed for
- // a function call. Note that there may be functions whose parameter sizes
- // are unknown, 0 is also used in that case. When that happens, it should
- // be possible to walk to the next frame without reference to %esp.
-
- uint32_t last_frame_callee_parameter_size = 0;
- int frames_already_walked = frames.size();
- if (frames_already_walked >= 2) {
- const StackFrameX86* last_frame_callee
- = static_cast<StackFrameX86*>(frames[frames_already_walked - 2]);
- WindowsFrameInfo* last_frame_callee_info
- = last_frame_callee->windows_frame_info;
- if (last_frame_callee_info &&
- (last_frame_callee_info->valid
- & WindowsFrameInfo::VALID_PARAMETER_SIZE)) {
- last_frame_callee_parameter_size =
- last_frame_callee_info->parameter_size;
- }
- }
-
- // Set up the dictionary for the PostfixEvaluator. %ebp and %esp are used
- // in each program string, and their previous values are known, so set them
- // here.
- PostfixEvaluator<uint32_t>::DictionaryType dictionary;
- // Provide the current register values.
- dictionary["$ebp"] = last_frame->context.ebp;
- dictionary["$esp"] = last_frame->context.esp;
- // Provide constants from the debug info for last_frame and its callee.
- // .cbCalleeParams is a Breakpad extension that allows us to use the
- // PostfixEvaluator engine when certain types of debugging information
- // are present without having to write the constants into the program
- // string as literals.
- dictionary[".cbCalleeParams"] = last_frame_callee_parameter_size;
- dictionary[".cbSavedRegs"] = last_frame_info->saved_register_size;
- dictionary[".cbLocals"] = last_frame_info->local_size;
-
- uint32_t raSearchStart = last_frame->context.esp +
- last_frame_callee_parameter_size +
- last_frame_info->local_size +
- last_frame_info->saved_register_size;
-
- uint32_t raSearchStartOld = raSearchStart;
- uint32_t found = 0; // dummy value
- // Scan up to three words above the calculated search value, in case
- // the stack was aligned to a quadword boundary.
- //
- // TODO(ivan.penkov): Consider cleaning up the scan for return address that
- // follows. The purpose of this scan is to adjust the .raSearchStart
- // calculation (which is based on register %esp) in the cases where register
- // %esp may have been aligned (up to a quadword). There are two problems
- // with this approach:
- // 1) In practice, 64 byte boundary alignment is seen which clearly can not
- // be handled by a three word scan.
- // 2) A search for a return address is "guesswork" by definition because
- // the results will be different depending on what is left on the stack
- // from previous executions.
- // So, basically, the results from this scan should be ignored if other means
- // for calculation of the value of .raSearchStart are available.
- if (ScanForReturnAddress(raSearchStart, &raSearchStart, &found, 3) &&
- last_frame->trust == StackFrame::FRAME_TRUST_CONTEXT &&
- last_frame->windows_frame_info != NULL &&
- last_frame_info->type_ == WindowsFrameInfo::STACK_INFO_FPO &&
- raSearchStartOld == raSearchStart &&
- found == last_frame->context.eip) {
- // The context frame represents an FPO-optimized Windows system call.
- // On the top of the stack we have a pointer to the current instruction.
- // This means that the callee has returned but the return address is still
- // on the top of the stack which is very atypical situaltion.
- // Skip one slot from the stack and do another scan in order to get the
- // actual return address.
- raSearchStart += 4;
- ScanForReturnAddress(raSearchStart, &raSearchStart, &found, 3);
- }
-
- dictionary[".cbParams"] = last_frame_info->parameter_size;
-
- // Decide what type of program string to use. The program string is in
- // postfix notation and will be passed to PostfixEvaluator::Evaluate.
- // Given the dictionary and the program string, it is possible to compute
- // the return address and the values of other registers in the calling
- // function. Because of bugs described below, the stack may need to be
- // scanned for these values. The results of program string evaluation
- // will be used to determine whether to scan for better values.
- string program_string;
- bool recover_ebp = true;
-
- trust = StackFrame::FRAME_TRUST_CFI;
- if (!last_frame_info->program_string.empty()) {
- // The FPO data has its own program string, which will tell us how to
- // get to the caller frame, and may even fill in the values of
- // nonvolatile registers and provide pointers to local variables and
- // parameters. In some cases, particularly with program strings that use
- // .raSearchStart, the stack may need to be scanned afterward.
- program_string = last_frame_info->program_string;
- } else if (last_frame_info->allocates_base_pointer) {
- // The function corresponding to the last frame doesn't use the frame
- // pointer for conventional purposes, but it does allocate a new
- // frame pointer and use it for its own purposes. Its callee's
- // information is still accessed relative to %esp, and the previous
- // value of %ebp can be recovered from a location in its stack frame,
- // within the saved-register area.
- //
- // Functions that fall into this category use the %ebp register for
- // a purpose other than the frame pointer. They restore the caller's
- // %ebp before returning. These functions create their stack frame
- // after a CALL by decrementing the stack pointer in an amount
- // sufficient to store local variables, and then PUSHing saved
- // registers onto the stack. Arguments to a callee function, if any,
- // are PUSHed after that. Walking up to the caller, therefore,
- // can be done solely with calculations relative to the stack pointer
- // (%esp). The return address is recovered from the memory location
- // above the known sizes of the callee's parameters, saved registers,
- // and locals. The caller's stack pointer (the value of %esp when
- // the caller executed CALL) is the location immediately above the
- // saved return address. The saved value of %ebp to be restored for
- // the caller is at a known location in the saved-register area of
- // the stack frame.
- //
- // For this type of frame, MSVC 14 (from Visual Studio 8/2005) in
- // link-time code generation mode (/LTCG and /GL) can generate erroneous
- // debugging data. The reported size of saved registers can be 0,
- // which is clearly an error because these frames must, at the very
- // least, save %ebp. For this reason, in addition to those given above
- // about the use of .raSearchStart, the stack may need to be scanned
- // for a better return address and a better frame pointer after the
- // program string is evaluated.
- //
- // %eip_new = *(%esp_old + callee_params + saved_regs + locals)
- // %ebp_new = *(%esp_old + callee_params + saved_regs - 8)
- // %esp_new = %esp_old + callee_params + saved_regs + locals + 4
- program_string = "$eip .raSearchStart ^ = "
- "$ebp $esp .cbCalleeParams + .cbSavedRegs + 8 - ^ = "
- "$esp .raSearchStart 4 + =";
- } else {
- // The function corresponding to the last frame doesn't use %ebp at
- // all. The callee frame is located relative to %esp.
- //
- // The called procedure's instruction pointer and stack pointer are
- // recovered in the same way as the case above, except that no
- // frame pointer (%ebp) is used at all, so it is not saved anywhere
- // in the callee's stack frame and does not need to be recovered.
- // Because %ebp wasn't used in the callee, whatever value it has
- // is the value that it had in the caller, so it can be carried
- // straight through without bringing its validity into question.
- //
- // Because of the use of .raSearchStart, the stack will possibly be
- // examined to locate a better return address after program string
- // evaluation. The stack will not be examined to locate a saved
- // %ebp value, because these frames do not save (or use) %ebp.
- //
- // %eip_new = *(%esp_old + callee_params + saved_regs + locals)
- // %esp_new = %esp_old + callee_params + saved_regs + locals + 4
- // %ebp_new = %ebp_old
- program_string = "$eip .raSearchStart ^ = "
- "$esp .raSearchStart 4 + =";
- recover_ebp = false;
- }
-
- // Check for alignment operators in the program string. If alignment
- // operators are found, then current %ebp must be valid and it is the only
- // reliable data point that can be used for getting to the previous frame.
- // E.g. the .raSearchStart calculation (above) is based on %esp and since
- // %esp was aligned in the current frame (which is a lossy operation) the
- // calculated value of .raSearchStart cannot be correct and should not be
- // used. Instead .raSearchStart must be calculated based on %ebp.
- // The code that follows assumes that .raSearchStart is supposed to point
- // at the saved return address (ebp + 4).
- // For some more details on this topic, take a look at the following thread:
- // https://groups.google.com/forum/#!topic/google-breakpad-dev/ZP1FA9B1JjM
- if ((StackFrameX86::CONTEXT_VALID_EBP & last_frame->context_validity) != 0 &&
- program_string.find('@') != string::npos) {
- raSearchStart = last_frame->context.ebp + 4;
- }
-
- // The difference between raSearch and raSearchStart is unknown,
- // but making them the same seems to work well in practice.
- dictionary[".raSearchStart"] = raSearchStart;
- dictionary[".raSearch"] = raSearchStart;
-
- // Now crank it out, making sure that the program string set at least the
- // two required variables.
- PostfixEvaluator<uint32_t> evaluator =
- PostfixEvaluator<uint32_t>(&dictionary, memory_);
- PostfixEvaluator<uint32_t>::DictionaryValidityType dictionary_validity;
- if (!evaluator.Evaluate(program_string, &dictionary_validity) ||
- dictionary_validity.find("$eip") == dictionary_validity.end() ||
- dictionary_validity.find("$esp") == dictionary_validity.end()) {
- // Program string evaluation failed. It may be that %eip is not somewhere
- // with stack frame info, and %ebp is pointing to non-stack memory, so
- // our evaluation couldn't succeed. We'll scan the stack for a return
- // address. This can happen if the stack is in a module for which
- // we don't have symbols, and that module is compiled without a
- // frame pointer.
- uint32_t location_start = last_frame->context.esp;
- uint32_t location, eip;
- if (!stack_scan_allowed
- || !ScanForReturnAddress(location_start, &location, &eip,
- frames.size() == 1 /* is_context_frame */)) {
- // if we can't find an instruction pointer even with stack scanning,
- // give up.
- return NULL;
- }
-
- // This seems like a reasonable return address. Since program string
- // evaluation failed, use it and set %esp to the location above the
- // one where the return address was found.
- dictionary["$eip"] = eip;
- dictionary["$esp"] = location + 4;
- trust = StackFrame::FRAME_TRUST_SCAN;
- }
-
- // Since this stack frame did not use %ebp in a traditional way,
- // locating the return address isn't entirely deterministic. In that
- // case, the stack can be scanned to locate the return address.
- //
- // However, if program string evaluation resulted in both %eip and
- // %ebp values of 0, trust that the end of the stack has been
- // reached and don't scan for anything else.
- if (dictionary["$eip"] != 0 || dictionary["$ebp"] != 0) {
- int offset = 0;
-
- // This scan can only be done if a CodeModules object is available, to
- // check that candidate return addresses are in fact inside a module.
- //
- // TODO(mmentovai): This ignores dynamically-generated code. One possible
- // solution is to check the minidump's memory map to see if the candidate
- // %eip value comes from a mapped executable page, although this would
- // require dumps that contain MINIDUMP_MEMORY_INFO, which the Breakpad
- // client doesn't currently write (it would need to call MiniDumpWriteDump
- // with the MiniDumpWithFullMemoryInfo type bit set). Even given this
- // ability, older OSes (pre-XP SP2) and CPUs (pre-P4) don't enforce
- // an independent execute privilege on memory pages.
-
- uint32_t eip = dictionary["$eip"];
- if (modules_ && !modules_->GetModuleForAddress(eip)) {
- // The instruction pointer at .raSearchStart was invalid, so start
- // looking one 32-bit word above that location.
- uint32_t location_start = dictionary[".raSearchStart"] + 4;
- uint32_t location;
- if (stack_scan_allowed
- && ScanForReturnAddress(location_start, &location, &eip,
- frames.size() == 1 /* is_context_frame */)) {
- // This is a better return address that what program string
- // evaluation found. Use it, and set %esp to the location above the
- // one where the return address was found.
- dictionary["$eip"] = eip;
- dictionary["$esp"] = location + 4;
- offset = location - location_start;
- trust = StackFrame::FRAME_TRUST_CFI_SCAN;
- }
- }
-
- if (recover_ebp) {
- // When trying to recover the previous value of the frame pointer (%ebp),
- // start looking at the lowest possible address in the saved-register
- // area, and look at the entire saved register area, increased by the
- // size of |offset| to account for additional data that may be on the
- // stack. The scan is performed from the highest possible address to
- // the lowest, because the expectation is that the function's prolog
- // would have saved %ebp early.
- uint32_t ebp = dictionary["$ebp"];
-
- // When a scan for return address is used, it is possible to skip one or
- // more frames (when return address is not in a known module). One
- // indication for skipped frames is when the value of %ebp is lower than
- // the location of the return address on the stack
- bool has_skipped_frames =
- (trust != StackFrame::FRAME_TRUST_CFI && ebp <= raSearchStart + offset);
-
- uint32_t value; // throwaway variable to check pointer validity
- if (has_skipped_frames || !memory_->GetMemoryAtAddress(ebp, &value)) {
- int fp_search_bytes = last_frame_info->saved_register_size + offset;
- uint32_t location_end = last_frame->context.esp +
- last_frame_callee_parameter_size;
-
- for (uint32_t location = location_end + fp_search_bytes;
- location >= location_end;
- location -= 4) {
- if (!memory_->GetMemoryAtAddress(location, &ebp))
- break;
-
- if (memory_->GetMemoryAtAddress(ebp, &value)) {
- // The candidate value is a pointer to the same memory region
- // (the stack). Prefer it as a recovered %ebp result.
- dictionary["$ebp"] = ebp;
- break;
- }
- }
- }
- }
- }
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameX86* frame = new StackFrameX86();
-
- frame->trust = trust;
- frame->context = last_frame->context;
- frame->context.eip = dictionary["$eip"];
- frame->context.esp = dictionary["$esp"];
- frame->context.ebp = dictionary["$ebp"];
- frame->context_validity = StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP;
-
- // These are nonvolatile (callee-save) registers, and the program string
- // may have filled them in.
- if (dictionary_validity.find("$ebx") != dictionary_validity.end()) {
- frame->context.ebx = dictionary["$ebx"];
- frame->context_validity |= StackFrameX86::CONTEXT_VALID_EBX;
- }
- if (dictionary_validity.find("$esi") != dictionary_validity.end()) {
- frame->context.esi = dictionary["$esi"];
- frame->context_validity |= StackFrameX86::CONTEXT_VALID_ESI;
- }
- if (dictionary_validity.find("$edi") != dictionary_validity.end()) {
- frame->context.edi = dictionary["$edi"];
- frame->context_validity |= StackFrameX86::CONTEXT_VALID_EDI;
- }
-
- return frame;
-}
-
-StackFrameX86* StackwalkerX86::GetCallerByCFIFrameInfo(
- const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info) {
- StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
- last_frame->cfi_frame_info = cfi_frame_info;
-
- scoped_ptr<StackFrameX86> frame(new StackFrameX86());
- if (!cfi_walker_
- .FindCallerRegisters(*memory_, *cfi_frame_info,
- last_frame->context, last_frame->context_validity,
- &frame->context, &frame->context_validity))
- return NULL;
-
- // Make sure we recovered all the essentials.
- static const int essentials = (StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP);
- if ((frame->context_validity & essentials) != essentials)
- return NULL;
-
- frame->trust = StackFrame::FRAME_TRUST_CFI;
-
- return frame.release();
-}
-
-StackFrameX86* StackwalkerX86::GetCallerByEBPAtBase(
- const vector<StackFrame*> &frames,
- bool stack_scan_allowed) {
- StackFrame::FrameTrust trust;
- StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
- uint32_t last_esp = last_frame->context.esp;
- uint32_t last_ebp = last_frame->context.ebp;
-
- // Assume that the standard %ebp-using x86 calling convention is in
- // use.
- //
- // The typical x86 calling convention, when frame pointers are present,
- // is for the calling procedure to use CALL, which pushes the return
- // address onto the stack and sets the instruction pointer (%eip) to
- // the entry point of the called routine. The called routine then
- // PUSHes the calling routine's frame pointer (%ebp) onto the stack
- // before copying the stack pointer (%esp) to the frame pointer (%ebp).
- // Therefore, the calling procedure's frame pointer is always available
- // by dereferencing the called procedure's frame pointer, and the return
- // address is always available at the memory location immediately above
- // the address pointed to by the called procedure's frame pointer. The
- // calling procedure's stack pointer (%esp) is 8 higher than the value
- // of the called procedure's frame pointer at the time the calling
- // procedure made the CALL: 4 bytes for the return address pushed by the
- // CALL itself, and 4 bytes for the callee's PUSH of the caller's frame
- // pointer.
- //
- // %eip_new = *(%ebp_old + 4)
- // %esp_new = %ebp_old + 8
- // %ebp_new = *(%ebp_old)
-
- uint32_t caller_eip, caller_esp, caller_ebp;
-
- if (memory_->GetMemoryAtAddress(last_ebp + 4, &caller_eip) &&
- memory_->GetMemoryAtAddress(last_ebp, &caller_ebp)) {
- caller_esp = last_ebp + 8;
- trust = StackFrame::FRAME_TRUST_FP;
- } else {
- // We couldn't read the memory %ebp refers to. It may be that %ebp
- // is pointing to non-stack memory. We'll scan the stack for a
- // return address. This can happen if last_frame is executing code
- // for a module for which we don't have symbols, and that module
- // is compiled without a frame pointer.
- if (!stack_scan_allowed
- || !ScanForReturnAddress(last_esp, &caller_esp, &caller_eip,
- frames.size() == 1 /* is_context_frame */)) {
- // if we can't find an instruction pointer even with stack scanning,
- // give up.
- return NULL;
- }
-
- // ScanForReturnAddress found a reasonable return address. Advance %esp to
- // the location immediately above the one where the return address was
- // found.
- caller_esp += 4;
- // Try to restore the %ebp chain. The caller %ebp should be stored at a
- // location immediately below the one where the return address was found.
- // A valid caller %ebp must be greater than the address where it is stored
- // and the gap between the two adjacent frames should be reasonable.
- uint32_t restored_ebp_chain = caller_esp - 8;
- if (!memory_->GetMemoryAtAddress(restored_ebp_chain, &caller_ebp) ||
- caller_ebp <= restored_ebp_chain ||
- caller_ebp - restored_ebp_chain > kMaxReasonableGapBetweenFrames) {
- // The restored %ebp chain doesn't appear to be valid.
- // Assume that %ebp is unchanged.
- caller_ebp = last_ebp;
- }
-
- trust = StackFrame::FRAME_TRUST_SCAN;
- }
-
- // Create a new stack frame (ownership will be transferred to the caller)
- // and fill it in.
- StackFrameX86* frame = new StackFrameX86();
-
- frame->trust = trust;
- frame->context = last_frame->context;
- frame->context.eip = caller_eip;
- frame->context.esp = caller_esp;
- frame->context.ebp = caller_ebp;
- frame->context_validity = StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP;
-
- return frame;
-}
-
-StackFrame* StackwalkerX86::GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed) {
- if (!memory_ || !stack) {
- BPLOG(ERROR) << "Can't get caller frame without memory or stack";
- return NULL;
- }
-
- const vector<StackFrame*> &frames = *stack->frames();
- StackFrameX86* last_frame = static_cast<StackFrameX86*>(frames.back());
- scoped_ptr<StackFrameX86> new_frame;
-
- // If the resolver has Windows stack walking information, use that.
- WindowsFrameInfo* windows_frame_info
- = frame_symbolizer_->FindWindowsFrameInfo(last_frame);
- if (windows_frame_info)
- new_frame.reset(GetCallerByWindowsFrameInfo(frames, windows_frame_info,
- stack_scan_allowed));
-
- // If the resolver has DWARF CFI information, use that.
- if (!new_frame.get()) {
- CFIFrameInfo* cfi_frame_info =
- frame_symbolizer_->FindCFIFrameInfo(last_frame);
- if (cfi_frame_info)
- new_frame.reset(GetCallerByCFIFrameInfo(frames, cfi_frame_info));
- }
-
- // Otherwise, hope that the program was using a traditional frame structure.
- if (!new_frame.get())
- new_frame.reset(GetCallerByEBPAtBase(frames, stack_scan_allowed));
-
- // If nothing worked, tell the caller.
- if (!new_frame.get())
- return NULL;
-
- // Treat an instruction address of 0 as end-of-stack.
- if (new_frame->context.eip == 0)
- return NULL;
-
- // If the new stack pointer is at a lower address than the old, then
- // that's clearly incorrect. Treat this as end-of-stack to enforce
- // progress and avoid infinite loops.
- if (new_frame->context.esp <= last_frame->context.esp)
- return NULL;
-
- // new_frame->context.eip is the return address, which is the instruction
- // after the CALL that caused us to arrive at the callee. Set
- // new_frame->instruction to one less than that, so it points within the
- // CALL instruction. See StackFrame::instruction for details, and
- // StackFrameAMD64::ReturnAddress.
- new_frame->instruction = new_frame->context.eip - 1;
-
- return new_frame.release();
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.h b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.h
deleted file mode 100644
index 0659a13bf4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// stackwalker_x86.h: x86-specific stackwalker.
-//
-// Provides stack frames given x86 register context and a memory region
-// corresponding to an x86 stack.
-//
-// Author: Mark Mentovai
-
-
-#ifndef PROCESSOR_STACKWALKER_X86_H__
-#define PROCESSOR_STACKWALKER_X86_H__
-
-#include <vector>
-
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/stackwalker.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/cfi_frame_info.h"
-
-namespace google_breakpad {
-
-class CodeModules;
-
-
-class StackwalkerX86 : public Stackwalker {
- public:
- // context is an x86 context object that gives access to x86-specific
- // register state corresponding to the innermost called frame to be
- // included in the stack. The other arguments are passed directly through
- // to the base Stackwalker constructor.
- StackwalkerX86(const SystemInfo* system_info,
- const MDRawContextX86* context,
- MemoryRegion* memory,
- const CodeModules* modules,
- StackFrameSymbolizer* frame_symbolizer);
-
- private:
- // A STACK CFI-driven frame walker for the X86.
- typedef SimpleCFIWalker<uint32_t, MDRawContextX86> CFIWalker;
-
- // Implementation of Stackwalker, using x86 context (%ebp, %esp, %eip) and
- // stack conventions (saved %ebp at [%ebp], saved %eip at 4[%ebp], or
- // alternate conventions as guided by any WindowsFrameInfo available for the
- // code in question.).
- virtual StackFrame* GetContextFrame();
- virtual StackFrame* GetCallerFrame(const CallStack* stack,
- bool stack_scan_allowed);
-
- // Use windows_frame_info (derived from STACK WIN and FUNC records)
- // to construct the frame that called frames.back(). The caller
- // takes ownership of the returned frame. Return NULL on failure.
- StackFrameX86* GetCallerByWindowsFrameInfo(
- const vector<StackFrame*> &frames,
- WindowsFrameInfo* windows_frame_info,
- bool stack_scan_allowed);
-
- // Use cfi_frame_info (derived from STACK CFI records) to construct
- // the frame that called frames.back(). The caller takes ownership
- // of the returned frame. Return NULL on failure.
- StackFrameX86* GetCallerByCFIFrameInfo(const vector<StackFrame*> &frames,
- CFIFrameInfo* cfi_frame_info);
-
- // Assuming a traditional frame layout --- where the caller's %ebp
- // has been pushed just after the return address and the callee's
- // %ebp points to the saved %ebp --- construct the frame that called
- // frames.back(). The caller takes ownership of the returned frame.
- // Return NULL on failure.
- StackFrameX86* GetCallerByEBPAtBase(const vector<StackFrame*> &frames,
- bool stack_scan_allowed);
-
- // Stores the CPU context corresponding to the innermost stack frame to
- // be returned by GetContextFrame.
- const MDRawContextX86* context_;
-
- // Our register map, for cfi_walker_.
- static const CFIWalker::RegisterSet cfi_register_map_[];
-
- // Our CFI frame walker.
- const CFIWalker cfi_walker_;
-};
-
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STACKWALKER_X86_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc
deleted file mode 100644
index d4c61c8c4e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/stackwalker_x86_unittest.cc
+++ /dev/null
@@ -1,2128 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// stackwalker_x86_unittest.cc: Unit tests for StackwalkerX86 class.
-
-#include <string>
-#include <vector>
-
-#include "breakpad_googletest_includes.h"
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/source_line_resolver_interface.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "processor/stackwalker_unittest_utils.h"
-#include "processor/stackwalker_x86.h"
-#include "processor/windows_frame_info.h"
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::StackFrameSymbolizer;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFrameX86;
-using google_breakpad::Stackwalker;
-using google_breakpad::StackwalkerX86;
-using google_breakpad::SystemInfo;
-using google_breakpad::WindowsFrameInfo;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-using google_breakpad::test_assembler::Section;
-using std::vector;
-using testing::_;
-using testing::AnyNumber;
-using testing::Return;
-using testing::SetArgumentPointee;
-using testing::Test;
-
-class StackwalkerX86Fixture {
- public:
- StackwalkerX86Fixture()
- : stack_section(kLittleEndian),
- // Give the two modules reasonable standard locations and names
- // for tests to play with.
- module1(0x40000000, 0x10000, "module1", "version1"),
- module2(0x50000000, 0x10000, "module2", "version2"),
- module3(0x771d0000, 0x180000, "module3", "version3"),
- module4(0x75f90000, 0x46000, "module4", "version4"),
- module5(0x75730000, 0x110000, "module5", "version5"),
- module6(0x647f0000, 0x1ba8000, "module6", "version6") {
- // Identify the system as a Linux system.
- system_info.os = "Linux";
- system_info.os_short = "linux";
- system_info.os_version = "Salacious Skink";
- system_info.cpu = "x86";
- system_info.cpu_info = "";
-
- // Put distinctive values in the raw CPU context.
- BrandContext(&raw_context);
-
- // Create some modules with some stock debugging information.
- modules.Add(&module1);
- modules.Add(&module2);
- modules.Add(&module3);
- modules.Add(&module4);
- modules.Add(&module5);
- modules.Add(&module6);
-
- // By default, none of the modules have symbol info; call
- // SetModuleSymbols to override this.
- EXPECT_CALL(supplier, GetCStringSymbolData(_, _, _, _, _))
- .WillRepeatedly(Return(MockSymbolSupplier::NOT_FOUND));
-
- // Avoid GMOCK WARNING "Uninteresting mock function call - returning
- // directly" for FreeSymbolData().
- EXPECT_CALL(supplier, FreeSymbolData(_)).Times(AnyNumber());
-
- // Reset max_frames_scanned since it's static.
- Stackwalker::set_max_frames_scanned(1024);
- }
-
- // Set the Breakpad symbol information that supplier should return for
- // MODULE to INFO.
- void SetModuleSymbols(MockCodeModule *module, const string &info) {
- size_t buffer_size;
- char *buffer = supplier.CopySymbolDataAndOwnTheCopy(info, &buffer_size);
- EXPECT_CALL(supplier, GetCStringSymbolData(module, &system_info, _, _, _))
- .WillRepeatedly(DoAll(SetArgumentPointee<3>(buffer),
- SetArgumentPointee<4>(buffer_size),
- Return(MockSymbolSupplier::FOUND)));
- }
-
- // Populate stack_region with the contents of stack_section. Use
- // stack_section.start() as the region's starting address.
- void RegionFromSection() {
- string contents;
- ASSERT_TRUE(stack_section.GetContents(&contents));
- stack_region.Init(stack_section.start().Value(), contents);
- }
-
- // Fill RAW_CONTEXT with pseudo-random data, for round-trip checking.
- void BrandContext(MDRawContextX86 *raw_context) {
- uint8_t x = 173;
- for (size_t i = 0; i < sizeof(*raw_context); i++)
- reinterpret_cast<uint8_t *>(raw_context)[i] = (x += 17);
- }
-
- SystemInfo system_info;
- MDRawContextX86 raw_context;
- Section stack_section;
- MockMemoryRegion stack_region;
- MockCodeModule module1;
- MockCodeModule module2;
- MockCodeModule module3;
- MockCodeModule module4;
- MockCodeModule module5;
- MockCodeModule module6;
- MockCodeModules modules;
- MockSymbolSupplier supplier;
- BasicSourceLineResolver resolver;
- CallStack call_stack;
- const vector<StackFrame *> *frames;
-};
-
-class SanityCheck: public StackwalkerX86Fixture, public Test { };
-
-TEST_F(SanityCheck, NoResolver) {
- stack_section.start() = 0x80000000;
- stack_section.D32(0).D32(0); // end-of-stack marker
- RegionFromSection();
- raw_context.eip = 0x40000200;
- raw_context.ebp = 0x80000000;
-
- StackFrameSymbolizer frame_symbolizer(NULL, NULL);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- // This should succeed, even without a resolver or supplier.
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetContextFrame: public StackwalkerX86Fixture, public Test { };
-
-TEST_F(GetContextFrame, Simple) {
- stack_section.start() = 0x80000000;
- stack_section.D32(0).D32(0); // end-of-stack marker
- RegionFromSection();
- raw_context.eip = 0x40000200;
- raw_context.ebp = 0x80000000;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-// The stackwalker should be able to produce the context frame even
-// without stack memory present.
-TEST_F(GetContextFrame, NoStackMemory) {
- raw_context.eip = 0x40000200;
- raw_context.ebp = 0x80000000;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, NULL, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
- // Check that the values from the original raw context made it
- // through to the context in the stack frame.
- EXPECT_EQ(0, memcmp(&raw_context, &frame->context, sizeof(raw_context)));
-}
-
-class GetCallerFrame: public StackwalkerX86Fixture, public Test {
- protected:
- void IPAddressIsNotInKnownModuleTestImpl(bool has_corrupt_symbols);
-};
-
-// Walk a traditional frame. A traditional frame saves the caller's
-// %ebp just below the return address, and has its own %ebp pointing
-// at the saved %ebp.
-TEST_F(GetCallerFrame, Traditional) {
- stack_section.start() = 0x80000000;
- Label frame0_ebp, frame1_ebp;
- stack_section
- .Append(12, 0) // frame 0: space
- .Mark(&frame0_ebp) // frame 0 %ebp points here
- .D32(frame1_ebp) // frame 0: saved %ebp
- .D32(0x40008679) // frame 0: return address
- .Append(8, 0) // frame 1: space
- .Mark(&frame1_ebp) // frame 1 %ebp points here
- .D32(0) // frame 1: saved %ebp (stack end)
- .D32(0); // frame 1: return address (stack end)
- RegionFromSection();
- raw_context.eip = 0x4000c7a5;
- raw_context.esp = stack_section.start().Value();
- raw_context.ebp = frame0_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- EXPECT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000c7a5U, frame0->instruction);
- EXPECT_EQ(0x4000c7a5U, frame0->context.eip);
- EXPECT_EQ(frame0_ebp.Value(), frame0->context.ebp);
- EXPECT_EQ(NULL, frame0->windows_frame_info);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x40008679U, frame1->instruction + 1);
- EXPECT_EQ(0x40008679U, frame1->context.eip);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// Walk a traditional frame, but use a bogus %ebp value, forcing a scan
-// of the stack for something that looks like a return address.
-TEST_F(GetCallerFrame, TraditionalScan) {
- stack_section.start() = 0x80000000;
- Label frame1_ebp;
- Label frame1_esp;
- stack_section
- // frame 0
- .D32(0xf065dc76) // locals area:
- .D32(0x46ee2167) // garbage that doesn't look like
- .D32(0xbab023ec) // a return address
- .D32(frame1_ebp) // saved %ebp (%ebp fails to point here, forcing scan)
- .D32(0x4000129d) // return address
- // frame 1
- .Mark(&frame1_esp)
- .Append(8, 0) // space
- .Mark(&frame1_ebp) // %ebp points here
- .D32(0) // saved %ebp (stack end)
- .D32(0); // return address (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4000f49d;
- raw_context.esp = stack_section.start().Value();
- // Make the frame pointer bogus, to make the stackwalker scan the stack
- // for something that looks like a return address.
- raw_context.ebp = 0xd43eed6e;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000f49dU, frame0->instruction);
- EXPECT_EQ(0x4000f49dU, frame0->context.eip);
- EXPECT_EQ(stack_section.start().Value(), frame0->context.esp);
- EXPECT_EQ(0xd43eed6eU, frame0->context.ebp);
- EXPECT_EQ(NULL, frame0->windows_frame_info);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x4000129dU, frame1->instruction + 1);
- EXPECT_EQ(0x4000129dU, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// Force scanning for a return address a long way down the stack
-TEST_F(GetCallerFrame, TraditionalScanLongWay) {
- stack_section.start() = 0x80000000;
- Label frame1_ebp;
- Label frame1_esp;
- stack_section
- // frame 0
- .D32(0xf065dc76) // locals area:
- .D32(0x46ee2167) // garbage that doesn't look like
- .D32(0xbab023ec) // a return address
- .Append(20 * 4, 0) // a bunch of space
- .D32(frame1_ebp) // saved %ebp (%ebp fails to point here, forcing scan)
- .D32(0x4000129d) // return address
- // frame 1
- .Mark(&frame1_esp)
- .Append(8, 0) // space
- .Mark(&frame1_ebp) // %ebp points here
- .D32(0) // saved %ebp (stack end)
- .D32(0); // return address (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4000f49d;
- raw_context.esp = stack_section.start().Value();
- // Make the frame pointer bogus, to make the stackwalker scan the stack
- // for something that looks like a return address.
- raw_context.ebp = 0xd43eed6e;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000f49dU, frame0->instruction);
- EXPECT_EQ(0x4000f49dU, frame0->context.eip);
- EXPECT_EQ(stack_section.start().Value(), frame0->context.esp);
- EXPECT_EQ(0xd43eed6eU, frame0->context.ebp);
- EXPECT_EQ(NULL, frame0->windows_frame_info);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x4000129dU, frame1->instruction + 1);
- EXPECT_EQ(0x4000129dU, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// Test that set_max_frames_scanned prevents using stack scanning
-// to find caller frames.
-TEST_F(GetCallerFrame, ScanningNotAllowed) {
- stack_section.start() = 0x80000000;
- Label frame1_ebp;
- stack_section
- // frame 0
- .D32(0xf065dc76) // locals area:
- .D32(0x46ee2167) // garbage that doesn't look like
- .D32(0xbab023ec) // a return address
- .D32(frame1_ebp) // saved %ebp (%ebp fails to point here, forcing scan)
- .D32(0x4000129d) // return address
- // frame 1
- .Append(8, 0) // space
- .Mark(&frame1_ebp) // %ebp points here
- .D32(0) // saved %ebp (stack end)
- .D32(0); // return address (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4000f49d;
- raw_context.esp = stack_section.start().Value();
- // Make the frame pointer bogus, to make the stackwalker scan the stack
- // for something that looks like a return address.
- raw_context.ebp = 0xd43eed6e;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- Stackwalker::set_max_frames_scanned(0);
-
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module1", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(1U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000f49dU, frame0->instruction);
- EXPECT_EQ(0x4000f49dU, frame0->context.eip);
- EXPECT_EQ(stack_section.start().Value(), frame0->context.esp);
- EXPECT_EQ(0xd43eed6eU, frame0->context.ebp);
- EXPECT_EQ(NULL, frame0->windows_frame_info);
- }
-}
-
-// Use Windows frame data (a "STACK WIN 4" record, from a
-// FrameTypeFrameData DIA record) to walk a stack frame.
-TEST_F(GetCallerFrame, WindowsFrameData) {
- SetModuleSymbols(&module1,
- "STACK WIN 4 aa85 176 0 0 4 10 4 0 1"
- " $T2 $esp .cbSavedRegs + ="
- " $T0 .raSearchStart ="
- " $eip $T0 ^ ="
- " $esp $T0 4 + ="
- " $ebx $T2 4 - ^ ="
- " $edi $T2 8 - ^ ="
- " $esi $T2 12 - ^ ="
- " $ebp $T2 16 - ^ =\n");
- Label frame1_esp, frame1_ebp;
- stack_section.start() = 0x80000000;
- stack_section
- // frame 0
- .D32(frame1_ebp) // saved regs: %ebp
- .D32(0xa7120d1a) // %esi
- .D32(0x630891be) // %edi
- .D32(0x9068a878) // %ebx
- .D32(0xa08ea45f) // locals: unused
- .D32(0x40001350) // return address
- // frame 1
- .Mark(&frame1_esp)
- .Append(12, 0) // empty space
- .Mark(&frame1_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4000aa85;
- raw_context.esp = stack_section.start().Value();
- raw_context.ebp = 0xf052c1de; // should not be needed to walk frame
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000aa85U, frame0->instruction);
- EXPECT_EQ(0x4000aa85U, frame0->context.eip);
- EXPECT_EQ(stack_section.start().Value(), frame0->context.esp);
- EXPECT_EQ(0xf052c1deU, frame0->context.ebp);
- EXPECT_TRUE(frame0->windows_frame_info != NULL);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP
- | StackFrameX86::CONTEXT_VALID_EBX
- | StackFrameX86::CONTEXT_VALID_ESI
- | StackFrameX86::CONTEXT_VALID_EDI),
- frame1->context_validity);
- EXPECT_EQ(0x40001350U, frame1->instruction + 1);
- EXPECT_EQ(0x40001350U, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(0x9068a878U, frame1->context.ebx);
- EXPECT_EQ(0xa7120d1aU, frame1->context.esi);
- EXPECT_EQ(0x630891beU, frame1->context.edi);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// Use Windows frame data (a "STACK WIN 4" record, from a
-// FrameTypeFrameData DIA record) to walk a stack frame where the stack
-// is aligned and we must search
-TEST_F(GetCallerFrame, WindowsFrameDataAligned) {
- SetModuleSymbols(&module1,
- "STACK WIN 4 aa85 176 0 0 4 4 8 0 1"
- " $T1 .raSearch ="
- " $T0 $T1 4 - 8 @ ="
- " $ebp $T1 4 - ^ ="
- " $eip $T1 ^ ="
- " $esp $T1 4 + =");
- Label frame0_esp, frame0_ebp;
- Label frame1_esp, frame1_ebp;
- stack_section.start() = 0x80000000;
- stack_section
- // frame 0
- .Mark(&frame0_esp)
- .D32(0x0ffa0ffa) // unused saved register
- .D32(0xdeaddead) // locals
- .D32(0xbeefbeef)
- .D32(0) // 8-byte alignment
- .Mark(&frame0_ebp)
- .D32(frame1_ebp) // saved %ebp
- .D32(0x5000129d) // return address
- // frame 1
- .Mark(&frame1_esp)
- .D32(0x1) // parameter
- .Mark(&frame1_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4000aa85;
- raw_context.esp = frame0_esp.Value();
- raw_context.ebp = frame0_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(1U, modules_without_symbols.size());
- ASSERT_EQ("module2", modules_without_symbols[0]->debug_file());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000aa85U, frame0->instruction);
- EXPECT_EQ(0x4000aa85U, frame0->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame0->context.esp);
- EXPECT_EQ(frame0_ebp.Value(), frame0->context.ebp);
- EXPECT_TRUE(frame0->windows_frame_info != NULL);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x5000129dU, frame1->instruction + 1);
- EXPECT_EQ(0x5000129dU, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// Use Windows frame data (a "STACK WIN 4" record, from a
-// FrameTypeFrameData DIA record) to walk a frame, and depend on the
-// parameter size from the callee as well.
-TEST_F(GetCallerFrame, WindowsFrameDataParameterSize) {
- SetModuleSymbols(&module1, "FUNC 1000 100 c module1::wheedle\n");
- SetModuleSymbols(&module2,
- // Note bogus parameter size in FUNC record; the stack walker
- // should prefer the STACK WIN record, and see '4' below.
- "FUNC aa85 176 beef module2::whine\n"
- "STACK WIN 4 aa85 176 0 0 4 10 4 0 1"
- " $T2 $esp .cbLocals + .cbSavedRegs + ="
- " $T0 .raSearchStart ="
- " $eip $T0 ^ ="
- " $esp $T0 4 + ="
- " $ebp $T0 20 - ^ ="
- " $ebx $T0 8 - ^ =\n");
- Label frame0_esp, frame0_ebp;
- Label frame1_esp;
- Label frame2_esp, frame2_ebp;
- stack_section.start() = 0x80000000;
- stack_section
- // frame 0, in module1::wheedle. Traditional frame.
- .Mark(&frame0_esp)
- .Append(16, 0) // frame space
- .Mark(&frame0_ebp)
- .D32(0x6fa902e0) // saved %ebp. Not a frame pointer.
- .D32(0x5000aa95) // return address, in module2::whine
- // frame 1, in module2::whine. FrameData frame.
- .Mark(&frame1_esp)
- .D32(0xbaa0cb7a) // argument 3 passed to module1::wheedle
- .D32(0xbdc92f9f) // argument 2
- .D32(0x0b1d8442) // argument 1
- .D32(frame2_ebp) // saved %ebp
- .D32(0xb1b90a15) // unused
- .D32(0xf18e072d) // unused
- .D32(0x2558c7f3) // saved %ebx
- .D32(0x0365e25e) // unused
- .D32(0x2a179e38) // return address; $T0 points here
- // frame 2, in no module
- .Mark(&frame2_esp)
- .Append(12, 0) // empty space
- .Mark(&frame2_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x40001004; // in module1::wheedle
- raw_context.esp = stack_section.start().Value();
- raw_context.ebp = frame0_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(3U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x40001004U, frame0->instruction);
- EXPECT_EQ(0x40001004U, frame0->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame0->context.esp);
- EXPECT_EQ(frame0_ebp.Value(), frame0->context.ebp);
- EXPECT_EQ(&module1, frame0->module);
- EXPECT_EQ("module1::wheedle", frame0->function_name);
- EXPECT_EQ(0x40001000U, frame0->function_base);
- // The FUNC record for module1::wheedle should have produced a
- // WindowsFrameInfo structure with only the parameter size valid.
- ASSERT_TRUE(frame0->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_PARAMETER_SIZE,
- frame0->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_UNKNOWN,
- frame0->windows_frame_info->type_);
- EXPECT_EQ(12U, frame0->windows_frame_info->parameter_size);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_FP, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x5000aa95U, frame1->instruction + 1);
- EXPECT_EQ(0x5000aa95U, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(0x6fa902e0U, frame1->context.ebp);
- EXPECT_EQ(&module2, frame1->module);
- EXPECT_EQ("module2::whine", frame1->function_name);
- EXPECT_EQ(0x5000aa85U, frame1->function_base);
- ASSERT_TRUE(frame1->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame1->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame1->windows_frame_info->type_);
- // This should not see the 0xbeef parameter size from the FUNC
- // record, but should instead see the STACK WIN record.
- EXPECT_EQ(4U, frame1->windows_frame_info->parameter_size);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame2 = static_cast<StackFrameX86 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP
- | StackFrameX86::CONTEXT_VALID_EBX),
- frame2->context_validity);
- EXPECT_EQ(0x2a179e38U, frame2->instruction + 1);
- EXPECT_EQ(0x2a179e38U, frame2->context.eip);
- EXPECT_EQ(frame2_esp.Value(), frame2->context.esp);
- EXPECT_EQ(frame2_ebp.Value(), frame2->context.ebp);
- EXPECT_EQ(0x2558c7f3U, frame2->context.ebx);
- EXPECT_EQ(NULL, frame2->module);
- EXPECT_EQ(NULL, frame2->windows_frame_info);
- }
-}
-
-// Use Windows frame data (a "STACK WIN 4" record, from a
-// FrameTypeFrameData DIA record) to walk a stack frame, where the
-// expression fails to yield both an $eip and an $ebp value, and the stack
-// walker must scan.
-TEST_F(GetCallerFrame, WindowsFrameDataScan) {
- SetModuleSymbols(&module1,
- "STACK WIN 4 c8c 111 0 0 4 10 4 0 1 bad program string\n");
- // Mark frame 1's PC as the end of the stack.
- SetModuleSymbols(&module2,
- "FUNC 7c38 accf 0 module2::function\n"
- "STACK WIN 4 7c38 accf 0 0 4 10 4 0 1 $eip 0 = $ebp 0 =\n");
- Label frame1_esp;
- stack_section.start() = 0x80000000;
- stack_section
- // frame 0
- .Append(16, 0x2a) // unused, garbage
- .D32(0x50007ce9) // return address
- // frame 1
- .Mark(&frame1_esp)
- .Append(8, 0); // empty space
-
- RegionFromSection();
- raw_context.eip = 0x40000c9c;
- raw_context.esp = stack_section.start().Value();
- raw_context.ebp = 0x2ae314cd; // should not be needed to walk frame
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x40000c9cU, frame0->instruction);
- EXPECT_EQ(0x40000c9cU, frame0->context.eip);
- EXPECT_EQ(stack_section.start().Value(), frame0->context.esp);
- EXPECT_EQ(0x2ae314cdU, frame0->context.ebp);
- EXPECT_TRUE(frame0->windows_frame_info != NULL);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- // I'd argue that CONTEXT_VALID_EBP shouldn't be here, since the walker
- // does not actually fetch the EBP after a scan (forcing the next frame
- // to be scanned as well). But let's grandfather the existing behavior in
- // for now.
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x50007ce9U, frame1->instruction + 1);
- EXPECT_EQ(0x50007ce9U, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_TRUE(frame1->windows_frame_info != NULL);
- }
-}
-
-// Use Windows frame data (a "STACK WIN 4" record, from a
-// FrameTypeFrameData DIA record) to walk a stack frame, where the
-// expression yields an $eip that falls outside of any module, and the
-// stack walker must scan.
-TEST_F(GetCallerFrame, WindowsFrameDataBadEIPScan) {
- SetModuleSymbols(&module1,
- "STACK WIN 4 6e6 e7 0 0 0 8 4 0 1"
- // A traditional frame, actually.
- " $eip $ebp 4 + ^ = $esp $ebp 8 + = $ebp $ebp ^ =\n");
- // Mark frame 1's PC as the end of the stack.
- SetModuleSymbols(&module2,
- "FUNC cfdb 8406 0 module2::function\n"
- "STACK WIN 4 cfdb 8406 0 0 0 0 0 0 1 $eip 0 = $ebp 0 =\n");
- stack_section.start() = 0x80000000;
-
- // In this stack, the context's %ebp is pointing at the wrong place, so
- // the stack walker needs to scan to find the return address, and then
- // scan again to find the caller's saved %ebp.
- Label frame0_ebp, frame1_ebp, frame1_esp;
- stack_section
- // frame 0
- .Append(8, 0x2a) // garbage
- .Mark(&frame0_ebp) // frame 0 %ebp points here, but should point
- // at *** below
- // The STACK WIN record says that the following two values are
- // frame 1's saved %ebp and return address, but the %ebp is wrong;
- // they're garbage. The stack walker will scan for the right values.
- .D32(0x3d937b2b) // alleged to be frame 1's saved %ebp
- .D32(0x17847f5b) // alleged to be frame 1's return address
- .D32(frame1_ebp) // frame 1's real saved %ebp; scan will find
- .D32(0x2b2b2b2b) // first word of realigned register save area
- // *** frame 0 %ebp ought to be pointing here
- .D32(0x2c2c2c2c) // realigned locals area
- .D32(0x5000d000) // frame 1's real saved %eip; scan will find
- // Frame 1, in module2::function. The STACK WIN record describes
- // this as the oldest frame, without referring to its contents, so
- // we needn't to provide any actual data here.
- .Mark(&frame1_esp)
- .Mark(&frame1_ebp) // frame 1 %ebp points here
- // A dummy value for frame 1's %ebp to point at. The scan recognizes the
- // saved %ebp because it points to a valid word in the stack memory region.
- .D32(0x2d2d2d2d);
-
- RegionFromSection();
- raw_context.eip = 0x40000700;
- raw_context.esp = stack_section.start().Value();
- raw_context.ebp = frame0_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x40000700U, frame0->instruction);
- EXPECT_EQ(0x40000700U, frame0->context.eip);
- EXPECT_EQ(stack_section.start().Value(), frame0->context.esp);
- EXPECT_EQ(frame0_ebp.Value(), frame0->context.ebp);
- EXPECT_TRUE(frame0->windows_frame_info != NULL);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI_SCAN, frame1->trust);
- // I'd argue that CONTEXT_VALID_EBP shouldn't be here, since the
- // walker does not actually fetch the EBP after a scan (forcing the
- // next frame to be scanned as well). But let's grandfather the existing
- // behavior in for now.
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x5000d000U, frame1->instruction + 1);
- EXPECT_EQ(0x5000d000U, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_TRUE(frame1->windows_frame_info != NULL);
- }
-}
-
-// Use Windows FrameTypeFPO data to walk a stack frame for a function that
-// does not modify %ebp from the value it had in the caller.
-TEST_F(GetCallerFrame, WindowsFPOUnchangedEBP) {
- SetModuleSymbols(&module1,
- // Note bogus parameter size in FUNC record; the walker
- // should prefer the STACK WIN record, and see the '8' below.
- "FUNC e8a8 100 feeb module1::discombobulated\n"
- "STACK WIN 0 e8a8 100 0 0 8 4 10 0 0 0\n");
- Label frame0_esp;
- Label frame1_esp, frame1_ebp;
- stack_section.start() = 0x80000000;
- stack_section
- // frame 0, in module1::wheedle. FrameTypeFPO (STACK WIN 0) frame.
- .Mark(&frame0_esp)
- // no outgoing parameters; this is the youngest frame.
- .D32(0x7c521352) // four bytes of saved registers
- .Append(0x10, 0x42) // local area
- .D32(0x40009b5b) // return address, in module1, no function
- // frame 1, in module1, no function.
- .Mark(&frame1_esp)
- .D32(0xf60ea7fc) // junk
- .Mark(&frame1_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4000e8b8; // in module1::whine
- raw_context.esp = stack_section.start().Value();
- // Frame pointer unchanged from caller.
- raw_context.ebp = frame1_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x4000e8b8U, frame0->instruction);
- EXPECT_EQ(0x4000e8b8U, frame0->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame0->context.esp);
- // unchanged from caller
- EXPECT_EQ(frame1_ebp.Value(), frame0->context.ebp);
- EXPECT_EQ(&module1, frame0->module);
- EXPECT_EQ("module1::discombobulated", frame0->function_name);
- EXPECT_EQ(0x4000e8a8U, frame0->function_base);
- // The STACK WIN record for module1::discombobulated should have
- // produced a fully populated WindowsFrameInfo structure.
- ASSERT_TRUE(frame0->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame0->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FPO,
- frame0->windows_frame_info->type_);
- EXPECT_EQ(0x10U, frame0->windows_frame_info->local_size);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x40009b5bU, frame1->instruction + 1);
- EXPECT_EQ(0x40009b5bU, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(&module1, frame1->module);
- EXPECT_EQ("", frame1->function_name);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// Use Windows FrameTypeFPO data to walk a stack frame for a function
-// that uses %ebp for its own purposes, saving the value it had in the
-// caller in the standard place in the saved register area.
-TEST_F(GetCallerFrame, WindowsFPOUsedEBP) {
- SetModuleSymbols(&module1,
- // Note bogus parameter size in FUNC record; the walker
- // should prefer the STACK WIN record, and see the '8' below.
- "FUNC 9aa8 e6 abbe module1::RaisedByTheAliens\n"
- "STACK WIN 0 9aa8 e6 a 0 10 8 4 0 0 1\n");
- Label frame0_esp;
- Label frame1_esp, frame1_ebp;
- stack_section.start() = 0x80000000;
- stack_section
- // frame 0, in module1::wheedle. FrameTypeFPO (STACK WIN 0) frame.
- .Mark(&frame0_esp)
- // no outgoing parameters; this is the youngest frame.
- .D32(frame1_ebp) // saved register area: saved %ebp
- .D32(0xb68bd5f9) // saved register area: something else
- .D32(0xd25d05fc) // local area
- .D32(0x4000debe) // return address, in module1, no function
- // frame 1, in module1, no function.
- .Mark(&frame1_esp)
- .D32(0xf0c9a974) // junk
- .Mark(&frame1_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x40009ab8; // in module1::RaisedByTheAliens
- raw_context.esp = stack_section.start().Value();
- // RaisedByTheAliens uses %ebp for its own mysterious purposes.
- raw_context.ebp = 0xecbdd1a5;
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x40009ab8U, frame0->instruction);
- EXPECT_EQ(0x40009ab8U, frame0->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame0->context.esp);
- EXPECT_EQ(0xecbdd1a5, frame0->context.ebp);
- EXPECT_EQ(&module1, frame0->module);
- EXPECT_EQ("module1::RaisedByTheAliens", frame0->function_name);
- EXPECT_EQ(0x40009aa8U, frame0->function_base);
- // The STACK WIN record for module1::RaisedByTheAliens should have
- // produced a fully populated WindowsFrameInfo structure.
- ASSERT_TRUE(frame0->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame0->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FPO,
- frame0->windows_frame_info->type_);
- EXPECT_EQ("", frame0->windows_frame_info->program_string);
- EXPECT_TRUE(frame0->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x4000debeU, frame1->instruction + 1);
- EXPECT_EQ(0x4000debeU, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(&module1, frame1->module);
- EXPECT_EQ("", frame1->function_name);
- EXPECT_EQ(NULL, frame1->windows_frame_info);
- }
-}
-
-// This is a regression unit test which covers a bug which has to do with
-// FPO-optimized Windows system call stubs in the context frame. There is
-// a more recent Windows system call dispatch mechanism which differs from
-// the one which is being tested here. The newer system call dispatch
-// mechanism creates an extra context frame (KiFastSystemCallRet).
-TEST_F(GetCallerFrame, WindowsFPOSystemCall) {
- SetModuleSymbols(&module3, // ntdll.dll
- "PUBLIC 1f8ac c ZwWaitForSingleObject\n"
- "STACK WIN 0 1f8ac 1b 0 0 c 0 0 0 0 0\n");
- SetModuleSymbols(&module4, // kernelbase.dll
- "PUBLIC 109f9 c WaitForSingleObjectEx\n"
- "PUBLIC 36590 0 _except_handler4\n"
- "STACK WIN 4 109f9 df c 0 c c 48 0 1 $T0 $ebp = $eip "
- "$T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L "
- "$T0 .cbSavedRegs - = $P $T0 8 + .cbParams + =\n"
- "STACK WIN 4 36590 154 17 0 10 0 14 0 1 $T0 $ebp = $eip "
- "$T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L $T0 "
- ".cbSavedRegs - = $P $T0 8 + .cbParams + =\n");
- SetModuleSymbols(&module5, // kernel32.dll
- "PUBLIC 11136 8 WaitForSingleObject\n"
- "PUBLIC 11151 c WaitForSingleObjectExImplementation\n"
- "STACK WIN 4 11136 16 5 0 8 0 0 0 1 $T0 $ebp = $eip "
- "$T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L "
- "$T0 .cbSavedRegs - = $P $T0 8 + .cbParams + =\n"
- "STACK WIN 4 11151 7a 5 0 c 0 0 0 1 $T0 $ebp = $eip "
- "$T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L "
- "$T0 .cbSavedRegs - = $P $T0 8 + .cbParams + =\n");
- SetModuleSymbols(&module6, // chrome.dll
- "FILE 7038 some_file_name.h\n"
- "FILE 839776 some_file_name.cc\n"
- "FUNC 217fda 17 4 function_217fda\n"
- "217fda 4 102 839776\n"
- "FUNC 217ff1 a 4 function_217ff1\n"
- "217ff1 0 594 7038\n"
- "217ff1 a 596 7038\n"
- "STACK WIN 0 217ff1 a 0 0 4 0 0 0 0 0\n");
-
- Label frame0_esp, frame1_esp;
- Label frame1_ebp, frame2_ebp, frame3_ebp;
- stack_section.start() = 0x002ff290;
- stack_section
- .Mark(&frame0_esp)
- .D32(0x771ef8c1) // EIP in frame 0 (system call)
- .D32(0x75fa0a91) // return address of frame 0
- .Mark(&frame1_esp)
- .D32(0x000017b0) // args to child
- .D32(0x00000000)
- .D32(0x002ff2d8)
- .D32(0x88014a2e)
- .D32(0x002ff364)
- .D32(0x000017b0)
- .D32(0x00000000)
- .D32(0x00000024)
- .D32(0x00000001)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x9e3b9800)
- .D32(0xfffffff7)
- .D32(0x00000000)
- .D32(0x002ff2a4)
- .D32(0x64a07ff1) // random value to be confused with a return address
- .D32(0x002ff8dc)
- .D32(0x75fc6590) // random value to be confused with a return address
- .D32(0xfdd2c6ea)
- .D32(0x00000000)
- .Mark(&frame1_ebp)
- .D32(frame2_ebp) // Child EBP
- .D32(0x75741194) // return address of frame 1
- .D32(0x000017b0) // args to child
- .D32(0x0036ee80)
- .D32(0x00000000)
- .D32(0x65bc7d14)
- .Mark(&frame2_ebp)
- .D32(frame3_ebp) // Child EBP
- .D32(0x75741148) // return address of frame 2
- .D32(0x000017b0) // args to child
- .D32(0x0036ee80)
- .D32(0x00000000)
- .Mark(&frame3_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x771ef8c1; // in ntdll::ZwWaitForSingleObject
- raw_context.esp = stack_section.start().Value();
- ASSERT_TRUE(raw_context.esp == frame0_esp.Value());
- raw_context.ebp = frame1_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
-
- ASSERT_EQ(4U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x771ef8c1U, frame0->instruction);
- EXPECT_EQ(0x771ef8c1U, frame0->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame0->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame0->context.ebp);
- EXPECT_EQ(&module3, frame0->module);
- EXPECT_EQ("ZwWaitForSingleObject", frame0->function_name);
- // The STACK WIN record for module3!ZwWaitForSingleObject should have
- // produced a fully populated WindowsFrameInfo structure.
- ASSERT_TRUE(frame0->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame0->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FPO,
- frame0->windows_frame_info->type_);
- EXPECT_EQ("", frame0->windows_frame_info->program_string);
- EXPECT_FALSE(frame0->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP
- | StackFrameX86::CONTEXT_VALID_ESP
- | StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x75fa0a91U, frame1->instruction + 1);
- EXPECT_EQ(0x75fa0a91U, frame1->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(&module4, frame1->module);
- EXPECT_EQ("WaitForSingleObjectEx", frame1->function_name);
- // The STACK WIN record for module4!WaitForSingleObjectEx should have
- // produced a fully populated WindowsFrameInfo structure.
- ASSERT_TRUE(frame1->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame1->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame1->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L "
- "$T0 .cbSavedRegs - = $P $T0 8 + .cbParams + =",
- frame1->windows_frame_info->program_string);
- EXPECT_FALSE(frame1->windows_frame_info->allocates_base_pointer);
- }
-}
-
-// Scan the stack for a better return address and potentially skip frames
-// when the calculated return address is not in a known module. Note, that
-// the span of this scan is somewhat arbitrarily limited to 160 search words
-// for the context frame and 40 search words (pointers) for the other frames:
-// const int kRASearchWords = 40;
-// This means that frames can be skipped only when their size is relatively
-// small: smaller than 4 * kRASearchWords * sizeof(InstructionType)
-TEST_F(GetCallerFrame, ReturnAddressIsNotInKnownModule) {
- MockCodeModule msvcrt_dll(0x77be0000, 0x58000, "msvcrt.dll", "version1");
- SetModuleSymbols(&msvcrt_dll, // msvcrt.dll
- "PUBLIC 38180 0 wcsstr\n"
- "STACK WIN 4 38180 61 10 0 8 0 0 0 1 $T0 $ebp = $eip $T0 "
- "4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L $T0 .cbSavedRegs "
- "- = $P $T0 4 + .cbParams + =\n");
-
- MockCodeModule kernel32_dll(0x7c800000, 0x103000, "kernel32.dll", "version1");
- SetModuleSymbols(&kernel32_dll, // kernel32.dll
- "PUBLIC efda 8 FindNextFileW\n"
- "STACK WIN 4 efda 1bb c 0 8 8 3c 0 1 $T0 $ebp = $eip $T0 "
- "4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L $T0 .cbSavedRegs "
- "- = $P $T0 4 + .cbParams + =\n");
-
- MockCodeModule chrome_dll(0x1c30000, 0x28C8000, "chrome.dll", "version1");
- SetModuleSymbols(&chrome_dll, // chrome.dll
- "FUNC e3cff 4af 0 file_util::FileEnumerator::Next()\n"
- "e3cff 1a 711 2505\n"
- "STACK WIN 4 e3cff 4af 20 0 4 c 94 0 1 $T1 .raSearch = "
- "$T0 $T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp "
- "$T1 4 + = $20 $T0 152 - ^ = $23 $T0 156 - ^ = $24 "
- "$T0 160 - ^ =\n");
-
- // Create some modules with some stock debugging information.
- MockCodeModules local_modules;
- local_modules.Add(&msvcrt_dll);
- local_modules.Add(&kernel32_dll);
- local_modules.Add(&chrome_dll);
-
- Label frame0_esp;
- Label frame0_ebp;
- Label frame1_ebp;
- Label frame2_ebp;
- Label frame3_ebp;
-
- stack_section.start() = 0x0932f2d0;
- stack_section
- .Mark(&frame0_esp)
- .D32(0x0764e000)
- .D32(0x0764e068)
- .Mark(&frame0_ebp)
- .D32(frame1_ebp) // Child EBP
- .D32(0x001767a0) // return address of frame 0
- // Not in known module
- .D32(0x0764e0c6)
- .D32(0x001bb1b8)
- .D32(0x0764e068)
- .D32(0x00000003)
- .D32(0x0764e068)
- .D32(0x00000003)
- .D32(0x07578828)
- .D32(0x0764e000)
- .D32(0x00000000)
- .D32(0x001c0010)
- .D32(0x0764e0c6)
- .Mark(&frame1_ebp)
- .D32(frame2_ebp) // Child EBP
- .D32(0x7c80f10f) // return address of frame 1
- // inside kernel32!FindNextFileW
- .D32(0x000008f8)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x0932f34c)
- .D32(0x0764e000)
- .D32(0x00001000)
- .D32(0x00000000)
- .D32(0x00000001)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x0932f6a8)
- .D32(0x00000000)
- .D32(0x0932f6d8)
- .D32(0x00000000)
- .D32(0x000000d6)
- .D32(0x0764e000)
- .D32(0x7ff9a000)
- .D32(0x0932f3fc)
- .D32(0x00000001)
- .D32(0x00000001)
- .D32(0x07578828)
- .D32(0x0000002e)
- .D32(0x0932f340)
- .D32(0x0932eef4)
- .D32(0x0932ffdc)
- .D32(0x7c839ad8)
- .D32(0x7c80f0d8)
- .D32(0x00000000)
- .Mark(&frame2_ebp)
- .D32(frame3_ebp) // Child EBP
- .D32(0x01d13f91) // return address of frame 2
- // inside chrome_dll!file_util::FileEnumerator::Next
- .D32(0x07578828)
- .D32(0x0932f6ac)
- .D32(0x0932f9c4)
- .D32(0x0932f9b4)
- .D32(0x00000000)
- .D32(0x00000003)
- .D32(0x0932f978)
- .D32(0x01094330)
- .D32(0x00000000)
- .D32(0x00000001)
- .D32(0x01094330)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x07f30000)
- .D32(0x01c3ba17)
- .D32(0x08bab840)
- .D32(0x07f31580)
- .D32(0x00000000)
- .D32(0x00000007)
- .D32(0x0932f940)
- .D32(0x0000002e)
- .D32(0x0932f40c)
- .D32(0x01d13b53)
- .D32(0x0932f958)
- .D32(0x00000001)
- .D32(0x00000007)
- .D32(0x0932f940)
- .D32(0x0000002e)
- .D32(0x00000000)
- .D32(0x0932f6ac)
- .D32(0x01e13ef0)
- .D32(0x00000001)
- .D32(0x00000007)
- .D32(0x0932f958)
- .D32(0x08bab840)
- .D32(0x0932f9b4)
- .D32(0x00000000)
- .D32(0x0932f9b4)
- .D32(0x000000a7)
- .D32(0x000000a7)
- .D32(0x0932f998)
- .D32(0x579627a2)
- .Mark(&frame3_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x77c181cd; // inside msvcrt!wcsstr
- raw_context.esp = frame0_esp.Value();
- raw_context.ebp = frame0_ebp.Value();
- // sanity
- ASSERT_TRUE(raw_context.esp == stack_section.start().Value());
- ASSERT_TRUE(raw_context.ebp == stack_section.start().Value() + 8);
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region,
- &local_modules, &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
-
- ASSERT_EQ(3U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(0x77c181cdU, frame0->instruction);
- EXPECT_EQ(0x77c181cdU, frame0->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame0->context.esp);
- EXPECT_EQ(frame0_ebp.Value(), frame0->context.ebp);
- EXPECT_EQ(&msvcrt_dll, frame0->module);
- EXPECT_EQ("wcsstr", frame0->function_name);
- ASSERT_TRUE(frame0->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame0->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame0->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 "
- "4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L $T0 .cbSavedRegs "
- "- = $P $T0 4 + .cbParams + =",
- frame0->windows_frame_info->program_string);
- // It has program string, so allocates_base_pointer is not expected
- EXPECT_FALSE(frame0->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(0x7c80f10fU, frame1->instruction + 1);
- EXPECT_EQ(0x7c80f10fU, frame1->context.eip);
- // frame 1 was skipped, so intead of frame1_ebp compare with frame2_ebp.
- EXPECT_EQ(frame2_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(&kernel32_dll, frame1->module);
- EXPECT_EQ("FindNextFileW", frame1->function_name);
- ASSERT_TRUE(frame1->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame1->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame1->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 "
- "4 + ^ = $ebp $T0 ^ = $esp $T0 8 + = $L $T0 .cbSavedRegs "
- "- = $P $T0 4 + .cbParams + =",
- frame1->windows_frame_info->program_string);
- EXPECT_FALSE(frame1->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame2 = static_cast<StackFrameX86 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame2->context_validity);
- EXPECT_EQ(0x01d13f91U, frame2->instruction + 1);
- EXPECT_EQ(0x01d13f91U, frame2->context.eip);
- // frame 1 was skipped, so intead of frame2_ebp compare with frame3_ebp.
- EXPECT_EQ(frame3_ebp.Value(), frame2->context.ebp);
- EXPECT_EQ(&chrome_dll, frame2->module);
- EXPECT_EQ("file_util::FileEnumerator::Next()", frame2->function_name);
- ASSERT_TRUE(frame2->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame2->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame2->windows_frame_info->type_);
- EXPECT_EQ("$T1 .raSearch = "
- "$T0 $T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp "
- "$T1 4 + = $20 $T0 152 - ^ = $23 $T0 156 - ^ = $24 "
- "$T0 160 - ^ =",
- frame2->windows_frame_info->program_string);
- EXPECT_FALSE(frame2->windows_frame_info->allocates_base_pointer);
- }
-}
-
-// Test the .raSearchStart/.raSearch calculation when alignment operators are
-// used in the program string. The current %ebp must be valid and it is the
-// only reliable data point that can be used for that calculation.
-TEST_F(GetCallerFrame, HandleAlignmentInProgramString) {
- MockCodeModule chrome_dll(0x59630000, 0x19e3000, "chrome.dll", "version1");
- SetModuleSymbols(&chrome_dll, // chrome.dll
- "FUNC 56422 50c 8 base::MessageLoop::RunTask"
- "(base::PendingTask const &)\n"
- "56422 e 458 4589\n"
- "STACK WIN 4 56422 50c 11 0 8 c ac 0 1 $T1 .raSearch = $T0 "
- "$T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + = "
- "$20 $T0 176 - ^ = $23 $T0 180 - ^ = $24 $T0 184 - ^ =\n"
- "FUNC 55d34 34a 0 base::MessageLoop::DoWork()\n"
- "55d34 11 596 4589\n"
- "STACK WIN 4 55d34 34a 19 0 0 c 134 0 1 $T1 .raSearch = "
- "$T0 $T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp "
- "$T1 4 + = $20 $T0 312 - ^ = $23 $T0 316 - ^ = $24 $T0 "
- "320 - ^ =\n"
- "FUNC 55c39 fb 0 base::MessagePumpForIO::DoRunLoop()\n"
- "55c39 d 518 19962\n"
- "STACK WIN 4 55c39 fb d 0 0 c 34 0 1 $T1 .raSearch = $T0 "
- "$T1 4 - 64 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + "
- "= $20 $T0 56 - ^ = $23 $T0 60 - ^ = $24 $T0 64 - ^ =\n"
- "FUNC 55bf0 49 4 base::MessagePumpWin::Run(base::"
- "MessagePump::Delegate *)\n"
- "55bf0 49 48 4724\n"
- "STACK WIN 4 55bf0 49 c 0 4 0 10 0 1 $T0 $ebp = $eip $T0 4 "
- "+ ^ = $ebp $T0 ^ = $esp $T0 8 + =\n"
- "FUNC 165d de 4 malloc\n"
- "165d 6 119 54\n"
- "STACK WIN 4 165d de d 0 4 8 0 0 1 $T1 .raSearch = $T0 "
- "$T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 "
- "+ = $23 $T0 4 - ^ = $24 $T0 8 - ^ =\n"
- "FUNC 55ac9 79 0 base::MessageLoop::RunInternal()\n"
- "55ac9 d 427 4589\n"
- "STACK WIN 4 55ac9 79 d 0 0 8 10 0 1 $T1 .raSearch = $T0 "
- "$T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + = "
- "$23 $T0 20 - ^ = $24 $T0 24 - ^ =\n");
-
- // Create some modules with some stock debugging information.
- MockCodeModules local_modules;
- local_modules.Add(&chrome_dll);
-
- Label frame0_esp;
- Label frame0_ebp;
- Label frame1_esp;
- Label frame1_ebp;
- Label frame2_esp;
- Label frame2_ebp;
- Label frame3_esp;
- Label frame3_ebp;
-
- stack_section.start() = 0x046bfc80;
- stack_section
- .D32(0)
- .Mark(&frame0_esp)
- .D32(0x01e235a0)
- .D32(0x00000000)
- .D32(0x01e9f580)
- .D32(0x01e9f580)
- .D32(0x00000020)
- .D32(0x00000000)
- .D32(0x00463674)
- .D32(0x00000020)
- .D32(0x00000000)
- .D32(0x046bfcd8)
- .D32(0x046bfcd8)
- .D32(0x0001204b)
- .D32(0x00000000)
- .D32(0xfdddb523)
- .D32(0x00000000)
- .D32(0x00000007)
- .D32(0x00000040)
- .D32(0x00000000)
- .D32(0x59631693) // chrome_59630000!malloc+0x36
- .D32(0x01e9f580)
- .D32(0x01e9f580)
- .D32(0x046bfcf8)
- .D32(0x77da6704) // ntdll!NtSetIoCompletion+0xc
- .D32(0x046bfd4c)
- .D32(0x59685bec) // chrome_59630000!base::MessageLoop::StartHistogrammer..
- .D32(0x01e235a0)
-
- .Mark(&frame0_ebp)
- .D32(frame1_ebp) // Child EBP .D32(0x046bfd0c)
- .D32(0x59685c2e) // Return address in
- // chrome_59630000!base::MessagePumpWin::Run+0x3e
- .Mark(&frame1_esp)
- .D32(0x01e75a90)
- .D32(0x046bfd4c)
- .D32(0x01e75a90)
- .D32(0x00000000)
- .D32(0x00000300)
- .D32(0x00000001)
-
- .Mark(&frame1_ebp)
- .D32(frame2_ebp) // Child EBP .D32(0x046bfd30)
- .D32(0x59685b3c) // Return address in
- // chrome_59630000!base::MessageLoop::RunInternal+0x73
- .Mark(&frame2_esp)
- .D32(0x01e75a90)
- .D32(0x00000000)
- .D32(0x046bfd4c)
- .D32(0x59658123) // chrome_59630000!std::deque..
- .D32(0x046bfda0)
- .D32(0x01e79d70)
- .D32(0x046bfda0)
-
- .Mark(&frame2_ebp) // .D32(0x046bfd40)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x59685c46; // Context frame in
- // base::MessagePumpForIO::DoRunLoop
- raw_context.esp = frame0_esp.Value();
- raw_context.ebp = frame0_ebp.Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region,
- &local_modules, &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
-
- ASSERT_EQ(3U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame->context_validity);
- EXPECT_EQ("base::MessagePumpForIO::DoRunLoop()", frame->function_name);
- EXPECT_EQ(0x59685c46U, frame->instruction);
- EXPECT_EQ(0x59685c46U, frame->context.eip);
- EXPECT_EQ(frame0_esp.Value(), frame->context.esp);
- EXPECT_EQ(frame0_ebp.Value(), frame->context.ebp);
- EXPECT_EQ(&chrome_dll, frame->module);
- ASSERT_TRUE(frame->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame->windows_frame_info->type_);
- EXPECT_EQ("$T1 .raSearch = $T0 "
- "$T1 4 - 64 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + "
- "= $20 $T0 56 - ^ = $23 $T0 60 - ^ = $24 $T0 64 - ^ =",
- frame->windows_frame_info->program_string);
- EXPECT_FALSE(frame->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame->context_validity);
- EXPECT_EQ("base::MessagePumpWin::Run(base::MessagePump::Delegate *)",
- frame->function_name);
- EXPECT_EQ(1500011566U, frame->instruction + 1);
- EXPECT_EQ(1500011566U, frame->context.eip);
- EXPECT_EQ(frame1_esp.Value(), frame->context.esp);
- EXPECT_EQ(frame1_ebp.Value(), frame->context.ebp);
- EXPECT_EQ(&chrome_dll, frame->module);
- ASSERT_TRUE(frame->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =",
- frame->windows_frame_info->program_string);
- EXPECT_FALSE(frame->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame = static_cast<StackFrameX86 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame->context_validity);
- EXPECT_EQ("base::MessageLoop::RunInternal()", frame->function_name);
- EXPECT_EQ(1500011324U, frame->instruction + 1);
- EXPECT_EQ(1500011324U, frame->context.eip);
- EXPECT_EQ(frame2_esp.Value(), frame->context.esp);
- EXPECT_EQ(frame2_ebp.Value(), frame->context.ebp);
- EXPECT_EQ(&chrome_dll, frame->module);
- ASSERT_TRUE(frame->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame->windows_frame_info->type_);
- EXPECT_EQ("$T1 .raSearch = $T0 "
- "$T1 4 - 8 @ = $ebp $T1 4 - ^ = $eip $T1 ^ = $esp $T1 4 + = "
- "$23 $T0 20 - ^ = $24 $T0 24 - ^ =",
- frame->windows_frame_info->program_string);
- EXPECT_FALSE(frame->windows_frame_info->allocates_base_pointer);
- }
-}
-
-// Scan the stack for a return address and potentially skip frames when the
-// current IP address is not in a known module. Note, that that the span of
-// this scan is limited to 120 search words for the context frame and 30
-// search words (pointers) for the other frames:
-// const int kRASearchWords = 30;
-void GetCallerFrame::IPAddressIsNotInKnownModuleTestImpl(
- bool has_corrupt_symbols) {
- MockCodeModule remoting_core_dll(0x54080000, 0x501000, "remoting_core.dll",
- "version1");
- string symbols_func_section =
- "FUNC 137214 17d 10 PK11_Verify\n"
- "FUNC 15c834 37 14 nsc_ECDSAVerifyStub\n"
- "FUNC 1611d3 91 14 NSC_Verify\n"
- "FUNC 162ff7 60 4 sftk_SessionFromHandle\n";
- string symbols_stack_section =
- "STACK WIN 4 137214 17d 9 0 10 0 10 0 1 $T0 $ebp = "
- "$eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =\n"
- "STACK WIN 4 15c834 37 6 0 14 0 18 0 1 $T0 $ebp = "
- "$eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =\n"
- "STACK WIN 4 1611d3 91 7 0 14 0 8 0 1 $T0 $ebp = "
- "$eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =\n"
- "STACK WIN 4 162ff7 60 5 0 4 0 0 0 1 $T0 $ebp = "
- "$eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =\n";
-
- string symbols = symbols_func_section;
- if (has_corrupt_symbols) {
- symbols.append(string(1, '\0')); // null terminator in the middle
- symbols.append("\n");
- symbols.append("FUNC 1234\n" // invalid FUNC records
- "FUNNC 1234\n"
- "STACK WIN 4 1234 234 23 " // invalid STACK record
- "23423423 234 23 234 234 "
- "234 23 234 23 234 234 "
- "234 234 234\n");
- }
- symbols.append(symbols_stack_section);
- SetModuleSymbols(&remoting_core_dll, symbols);
-
- // Create some modules with some stock debugging information.
- MockCodeModules local_modules;
- local_modules.Add(&remoting_core_dll);
-
- Label frame0_esp;
- Label frame0_ebp;
- Label frame1_ebp;
- Label frame1_esp;
- Label frame2_ebp;
- Label frame2_esp;
- Label frame3_ebp;
- Label frame3_esp;
- Label bogus_stack_location_1;
- Label bogus_stack_location_2;
- Label bogus_stack_location_3;
-
- stack_section.start() = 0x01a3ea28;
- stack_section
- .Mark(&frame0_esp)
- .D32(bogus_stack_location_2)
- .D32(bogus_stack_location_1)
- .D32(0x042478e4)
- .D32(bogus_stack_location_2)
- .D32(0x00000000)
- .D32(0x041f0420)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000001)
- .D32(0x00b7e0d0)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000001)
- .D32(0x00b7f570)
- .Mark(&bogus_stack_location_1)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000008)
- .D32(0x04289530)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000008)
- .D32(0x00b7e910)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000008)
- .D32(0x00b7d998)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000008)
- .D32(0x00b7dec0)
- .Mark(&bogus_stack_location_2)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000008)
- .D32(0x04289428)
- .D32(0x00000000)
- .D32(0x00000040)
- .D32(0x00000008)
- .D32(0x00b7f258)
- .Mark(&bogus_stack_location_3)
- .D32(0x00000000)
- .D32(0x041f3560)
- .D32(0x00000041)
- .D32(0x00000020)
- .D32(0xffffffff)
- .Mark(&frame0_ebp)
- .D32(frame1_ebp) // Child %ebp
- .D32(0x541dc866) // return address of frame 0
- // inside remoting_core!nsc_ECDSAVerifyStub+0x32
- .Mark(&frame1_esp)
- .D32(0x04247860)
- .D32(0x01a3eaec)
- .D32(0x01a3eaf8)
- .D32(0x541e304f) // remoting_core!sftk_SessionFromHandle+0x58
- .D32(0x0404c620)
- .D32(0x00000040)
- .D32(0x01a3eb2c)
- .D32(0x01a3ec08)
- .D32(0x00000014)
- .Mark(&frame1_ebp)
- .D32(frame2_ebp) // Child %ebp
- .D32(0x541e1234) // return address of frame 1
- // inside remoting_core!NSC_Verify+0x61
- .Mark(&frame2_esp)
- .D32(0x04247858)
- .D32(0x0404c620)
- .D32(0x00000040)
- .D32(0x01a3ec08)
- .D32(0x00000014)
- .D32(0x01000005)
- .D32(0x00b2f7a0)
- .D32(0x041f0420)
- .D32(0x041f3650)
- .Mark(&frame2_ebp)
- .D32(frame3_ebp) // Child %ebp
- .D32(0x541b734d) // return address of frame 1
- // inside remoting_core!PK11_Verify+0x139
- .Mark(&frame3_esp)
- .D32(0x01000005)
- .D32(0x01a3ec08)
- .D32(0x00000014)
- .D32(0x0404c620)
- .D32(0x00000040)
- .D32(0x04073e00)
- .D32(0x04073e00)
- .D32(0x04247050)
- .D32(0x00001041)
- .D32(0x00000000)
- .D32(0x00000000)
- .D32(0x00000000)
- .Mark(&frame3_ebp)
- .D32(0) // saved %ebp (stack end)
- .D32(0); // saved %eip (stack end)
-
- RegionFromSection();
- raw_context.eip = 0x4247860; // IP address not in known module
- raw_context.ebp = 0x5420362d; // bogus
- raw_context.esp = frame0_esp.Value();
-
- // sanity
- ASSERT_TRUE(raw_context.esp == stack_section.start().Value());
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region,
- &local_modules, &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- if (has_corrupt_symbols) {
- ASSERT_EQ(1U, modules_with_corrupt_symbols.size());
- ASSERT_EQ("remoting_core.dll",
- modules_with_corrupt_symbols[0]->debug_file());
- } else {
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- }
- frames = call_stack.frames();
-
- ASSERT_EQ(4U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ(raw_context.eip, frame0->context.eip);
- EXPECT_EQ(raw_context.ebp, frame0->context.ebp);
- EXPECT_EQ(raw_context.esp, frame0->context.esp);
- EXPECT_EQ(NULL, frame0->module); // IP not in known module
- EXPECT_EQ("", frame0->function_name);
- ASSERT_EQ(NULL, frame0->windows_frame_info);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_SCAN, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame1->context_validity);
- EXPECT_EQ(frame1_ebp.Value(), frame1->context.ebp);
- EXPECT_EQ(frame1_esp.Value(), frame1->context.esp);
- EXPECT_EQ(&remoting_core_dll, frame1->module);
- EXPECT_EQ("nsc_ECDSAVerifyStub", frame1->function_name);
- ASSERT_TRUE(frame1->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame1->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame1->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =",
- frame1->windows_frame_info->program_string);
- EXPECT_FALSE(frame1->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame2 = static_cast<StackFrameX86 *>(frames->at(2));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame2->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame2->context_validity);
- EXPECT_EQ(frame2_ebp.Value(), frame2->context.ebp);
- EXPECT_EQ(frame2_esp.Value(), frame2->context.esp);
- EXPECT_EQ(&remoting_core_dll, frame2->module);
- EXPECT_EQ("NSC_Verify", frame2->function_name);
- ASSERT_TRUE(frame2->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame2->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame2->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =",
- frame2->windows_frame_info->program_string);
- EXPECT_FALSE(frame2->windows_frame_info->allocates_base_pointer);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame3 = static_cast<StackFrameX86 *>(frames->at(3));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame3->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP),
- frame3->context_validity);
- EXPECT_EQ(frame3_ebp.Value(), frame3->context.ebp);
- EXPECT_EQ(frame3_esp.Value(), frame3->context.esp);
- EXPECT_EQ(&remoting_core_dll, frame3->module);
- EXPECT_EQ("PK11_Verify", frame3->function_name);
- ASSERT_TRUE(frame3->windows_frame_info != NULL);
- EXPECT_EQ(WindowsFrameInfo::VALID_ALL, frame3->windows_frame_info->valid);
- EXPECT_EQ(WindowsFrameInfo::STACK_INFO_FRAME_DATA,
- frame3->windows_frame_info->type_);
- EXPECT_EQ("$T0 $ebp = $eip $T0 4 + ^ = $ebp $T0 ^ = $esp $T0 8 + =",
- frame3->windows_frame_info->program_string);
- EXPECT_FALSE(frame3->windows_frame_info->allocates_base_pointer);
- }
-}
-
-// Runs IPAddressIsNotInKnownModule test with good symbols
-TEST_F(GetCallerFrame, IPAddressIsNotInKnownModule) {
- IPAddressIsNotInKnownModuleTestImpl(false /* has_corrupt_modules */);
-}
-
-// Runs IPAddressIsNotInKnownModule test with corrupt symbols
-TEST_F(GetCallerFrame, IPAddressIsNotInKnownModule_CorruptSymbols) {
- IPAddressIsNotInKnownModuleTestImpl(true /* has_corrupt_modules */);
-}
-
-struct CFIFixture: public StackwalkerX86Fixture {
- CFIFixture() {
- // Provide a bunch of STACK CFI records; individual tests walk to the
- // caller from every point in this series, expecting to find the same
- // set of register values.
- SetModuleSymbols(&module1,
- // The youngest frame's function.
- "FUNC 4000 1000 10 enchiridion\n"
- // Initially, just a return address.
- "STACK CFI INIT 4000 100 .cfa: $esp 4 + .ra: .cfa 4 - ^\n"
- // Push %ebx.
- "STACK CFI 4001 .cfa: $esp 8 + $ebx: .cfa 8 - ^\n"
- // Move %esi into %ebx. Weird, but permitted.
- "STACK CFI 4002 $esi: $ebx\n"
- // Allocate frame space, and save %edi.
- "STACK CFI 4003 .cfa: $esp 20 + $edi: .cfa 16 - ^\n"
- // Put the return address in %edi.
- "STACK CFI 4005 .ra: $edi\n"
- // Save %ebp, and use it as a frame pointer.
- "STACK CFI 4006 .cfa: $ebp 8 + $ebp: .cfa 12 - ^\n"
-
- // The calling function.
- "FUNC 5000 1000 10 epictetus\n"
- // Mark it as end of stack.
- "STACK CFI INIT 5000 1000 .cfa: $esp .ra 0\n");
-
- // Provide some distinctive values for the caller's registers.
- expected.esp = 0x80000000;
- expected.eip = 0x40005510;
- expected.ebp = 0xc0d4aab9;
- expected.ebx = 0x60f20ce6;
- expected.esi = 0x53d1379d;
- expected.edi = 0xafbae234;
-
- // By default, registers are unchanged.
- raw_context = expected;
- }
-
- // Walk the stack, using stack_section as the contents of the stack
- // and raw_context as the current register values. (Set
- // raw_context.esp to the stack's starting address.) Expect two
- // stack frames; in the older frame, expect the callee-saves
- // registers to have values matching those in 'expected'.
- void CheckWalk() {
- RegionFromSection();
- raw_context.esp = stack_section.start().Value();
-
- StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
- StackwalkerX86 walker(&system_info, &raw_context, &stack_region, &modules,
- &frame_symbolizer);
- vector<const CodeModule*> modules_without_symbols;
- vector<const CodeModule*> modules_with_corrupt_symbols;
- ASSERT_TRUE(walker.Walk(&call_stack, &modules_without_symbols,
- &modules_with_corrupt_symbols));
- ASSERT_EQ(0U, modules_without_symbols.size());
- ASSERT_EQ(0U, modules_with_corrupt_symbols.size());
- frames = call_stack.frames();
- ASSERT_EQ(2U, frames->size());
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame0 = static_cast<StackFrameX86 *>(frames->at(0));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CONTEXT, frame0->trust);
- ASSERT_EQ(StackFrameX86::CONTEXT_VALID_ALL, frame0->context_validity);
- EXPECT_EQ("enchiridion", frame0->function_name);
- EXPECT_EQ(0x40004000U, frame0->function_base);
- ASSERT_TRUE(frame0->windows_frame_info != NULL);
- ASSERT_EQ(WindowsFrameInfo::VALID_PARAMETER_SIZE,
- frame0->windows_frame_info->valid);
- ASSERT_TRUE(frame0->cfi_frame_info != NULL);
- }
-
- { // To avoid reusing locals by mistake
- StackFrameX86 *frame1 = static_cast<StackFrameX86 *>(frames->at(1));
- EXPECT_EQ(StackFrame::FRAME_TRUST_CFI, frame1->trust);
- ASSERT_EQ((StackFrameX86::CONTEXT_VALID_EIP |
- StackFrameX86::CONTEXT_VALID_ESP |
- StackFrameX86::CONTEXT_VALID_EBP |
- StackFrameX86::CONTEXT_VALID_EBX |
- StackFrameX86::CONTEXT_VALID_ESI |
- StackFrameX86::CONTEXT_VALID_EDI),
- frame1->context_validity);
- EXPECT_EQ(expected.eip, frame1->context.eip);
- EXPECT_EQ(expected.esp, frame1->context.esp);
- EXPECT_EQ(expected.ebp, frame1->context.ebp);
- EXPECT_EQ(expected.ebx, frame1->context.ebx);
- EXPECT_EQ(expected.esi, frame1->context.esi);
- EXPECT_EQ(expected.edi, frame1->context.edi);
- EXPECT_EQ("epictetus", frame1->function_name);
- }
- }
-
- // The values the stack walker should find for the caller's registers.
- MDRawContextX86 expected;
-};
-
-class CFI: public CFIFixture, public Test { };
-
-TEST_F(CFI, At4000) {
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0x40005510) // return address
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004000;
- CheckWalk();
-}
-
-TEST_F(CFI, At4001) {
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0x60f20ce6) // saved %ebx
- .D32(0x40005510) // return address
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004001;
- raw_context.ebx = 0x91aa9a8b; // callee's %ebx value
- CheckWalk();
-}
-
-TEST_F(CFI, At4002) {
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0x60f20ce6) // saved %ebx
- .D32(0x40005510) // return address
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004002;
- raw_context.ebx = 0x53d1379d; // saved %esi
- raw_context.esi = 0xa5c790ed; // callee's %esi value
- CheckWalk();
-}
-
-TEST_F(CFI, At4003) {
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0x56ec3db7) // garbage
- .D32(0xafbae234) // saved %edi
- .D32(0x53d67131) // garbage
- .D32(0x60f20ce6) // saved %ebx
- .D32(0x40005510) // return address
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004003;
- raw_context.ebx = 0x53d1379d; // saved %esi
- raw_context.esi = 0xa97f229d; // callee's %esi
- raw_context.edi = 0xb05cc997; // callee's %edi
- CheckWalk();
-}
-
-// The results here should be the same as those at module offset
-// 0x4003.
-TEST_F(CFI, At4004) {
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0xe29782c2) // garbage
- .D32(0xafbae234) // saved %edi
- .D32(0x5ba29ce9) // garbage
- .D32(0x60f20ce6) // saved %ebx
- .D32(0x40005510) // return address
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004004;
- raw_context.ebx = 0x53d1379d; // saved %esi
- raw_context.esi = 0x0fb7dc4e; // callee's %esi
- raw_context.edi = 0x993b4280; // callee's %edi
- CheckWalk();
-}
-
-TEST_F(CFI, At4005) {
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0xe29782c2) // garbage
- .D32(0xafbae234) // saved %edi
- .D32(0x5ba29ce9) // garbage
- .D32(0x60f20ce6) // saved %ebx
- .D32(0x8036cc02) // garbage
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004005;
- raw_context.ebx = 0x53d1379d; // saved %esi
- raw_context.esi = 0x0fb7dc4e; // callee's %esi
- raw_context.edi = 0x40005510; // return address
- CheckWalk();
-}
-
-TEST_F(CFI, At4006) {
- Label frame0_ebp;
- Label frame1_esp = expected.esp;
- stack_section
- .D32(0xdcdd25cd) // garbage
- .D32(0xafbae234) // saved %edi
- .D32(0xc0d4aab9) // saved %ebp
- .Mark(&frame0_ebp) // frame pointer points here
- .D32(0x60f20ce6) // saved %ebx
- .D32(0x8036cc02) // garbage
- .Mark(&frame1_esp); // This effectively sets stack_section.start().
- raw_context.eip = 0x40004006;
- raw_context.ebp = frame0_ebp.Value();
- raw_context.ebx = 0x53d1379d; // saved %esi
- raw_context.esi = 0x743833c9; // callee's %esi
- raw_context.edi = 0x40005510; // return address
- CheckWalk();
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_address_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/static_address_map-inl.h
deleted file mode 100644
index 67e07976e0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_address_map-inl.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_address_map-inl.h: StaticAddressMap implementation.
-//
-// See static_address_map.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_ADDRESS_MAP_INL_H__
-#define PROCESSOR_STATIC_ADDRESS_MAP_INL_H__
-
-#include "processor/static_address_map.h"
-
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename AddressType, typename EntryType>
-bool StaticAddressMap<AddressType, EntryType>::Retrieve(
- const AddressType &address,
- const EntryType *&entry, AddressType *entry_address) const {
-
- // upper_bound gives the first element whose key is greater than address,
- // but we want the first element whose key is less than or equal to address.
- // Decrement the iterator to get there, but not if the upper_bound already
- // points to the beginning of the map - in that case, address is lower than
- // the lowest stored key, so return false.
-
- MapConstIterator iterator = map_.upper_bound(address);
- if (iterator == map_.begin())
- return false;
- --iterator;
-
- entry = iterator.GetValuePtr();
- // Make sure AddressType is a copyable basic type
- if (entry_address)
- *entry_address = iterator.GetKey();
-
- return true;
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_ADDRESS_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_address_map.h b/toolkit/crashreporter/google-breakpad/src/processor/static_address_map.h
deleted file mode 100644
index 6bafc66750..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_address_map.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_address_map.h: StaticAddressMap.
-//
-// StaticAddressMap is a wrapper class of StaticMap, just as AddressMap wraps
-// std::map. StaticAddressMap provides read-only Retrieve() operation, similar
-// as AddressMap. However, the difference between StaticAddressMap and
-// AddressMap is that StaticAddressMap does not support dynamic operation
-// Store() due to the static nature of the underlying StaticMap.
-//
-// See address_map.h for reference.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_ADDRESS_MAP_H__
-#define PROCESSOR_STATIC_ADDRESS_MAP_H__
-
-#include "processor/static_map-inl.h"
-
-namespace google_breakpad {
-
-// AddressType MUST be a basic type, e.g.: integer types etc
-// EntryType could be a complex type, so we retrieve its pointer instead.
-template<typename AddressType, typename EntryType>
-class StaticAddressMap {
- public:
- StaticAddressMap(): map_() { }
- explicit StaticAddressMap(const char *map_data): map_(map_data) { }
-
- // Locates the entry stored at the highest address less than or equal to
- // the address argument. If there is no such range, returns false. The
- // entry is returned in entry, which is a required argument. If
- // entry_address is not NULL, it will be set to the address that the entry
- // was stored at.
- bool Retrieve(const AddressType &address,
- const EntryType *&entry, AddressType *entry_address) const;
-
- private:
- friend class ModuleComparer;
- // Convenience types.
- typedef StaticAddressMap* SelfPtr;
- typedef StaticMap<AddressType, EntryType> AddressToEntryMap;
- typedef typename AddressToEntryMap::const_iterator MapConstIterator;
-
- AddressToEntryMap map_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_ADDRESS_MAP_H__
-
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_address_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/static_address_map_unittest.cc
deleted file mode 100644
index 12c735cff0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_address_map_unittest.cc
+++ /dev/null
@@ -1,236 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_address_map_unittest.cc: Unit tests for StaticAddressMap.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include <climits>
-#include <cstdlib>
-#include <ctime>
-#include <string>
-#include <iostream>
-#include <sstream>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "processor/address_map-inl.h"
-#include "processor/static_address_map-inl.h"
-#include "processor/simple_serializer-inl.h"
-#include "map_serializers-inl.h"
-
-typedef google_breakpad::StaticAddressMap<int, char> TestMap;
-typedef google_breakpad::AddressMap<int, string> AddrMap;
-
-class TestStaticAddressMap : public ::testing::Test {
- protected:
- void SetUp() {
- for (int testcase = 0; testcase < kNumberTestCases; ++testcase) {
- testdata[testcase] = new int[testsize[testcase]];
- }
-
- // Test data set0: NULL (empty map)
-
- // Test data set1: single element.
- testdata[1][0] = 10;
-
- // Test data set2: six elements.
- const int tempdata[] = {5, 10, 14, 15, 16, 20};
- for (int i = 0; i < testsize[2]; ++i)
- testdata[2][i] = tempdata[i];
-
- // Test data set3:
- srand(time(NULL));
- for (int i = 0; i < testsize[3]; ++i)
- testdata[3][i] = rand();
-
- // Setup maps.
- std::stringstream sstream;
- for (int testcase = 0; testcase < kNumberTestCases; ++testcase) {
- for (int data_item = 0; data_item < testsize[testcase]; ++data_item) {
- sstream.clear();
- sstream << "test " << testdata[testcase][data_item];
- addr_map[testcase].Store(testdata[testcase][data_item], sstream.str());
- }
- map_data[testcase] = serializer.Serialize(addr_map[testcase], NULL);
- test_map[testcase] = TestMap(map_data[testcase]);
- }
- }
-
- void TearDown() {
- for (int i = 0; i < kNumberTestCases; ++i) {
- delete [] map_data[i];
- delete [] testdata[i];
- }
- }
-
- void CompareRetrieveResult(int testcase, int target) {
- int address;
- int address_test;
- string entry;
- string entry_test;
- const char *entry_cstring = NULL;
- bool found;
- bool found_test;
-
- found = addr_map[testcase].Retrieve(target, &entry, &address);
- found_test =
- test_map[testcase].Retrieve(target, entry_cstring, &address_test);
-
- ASSERT_EQ(found, found_test);
-
- if (found && found_test) {
- ASSERT_EQ(address, address_test);
- entry_test = entry_cstring;
- ASSERT_EQ(entry, entry_test);
- }
- }
-
- void RetrieveTester(int testcase) {
- int target;
- target = INT_MIN;
- CompareRetrieveResult(testcase, target);
- target = INT_MAX;
- CompareRetrieveResult(testcase, target);
-
- srand(time(0));
- for (int data_item = 0; data_item < testsize[testcase]; ++data_item) {
- // Retrive (aka, search) for target address and compare results from
- // AddressMap and StaticAddressMap.
-
- // First, assign the search target to be one of original testdata that is
- // known to exist in the map.
- target = testdata[testcase][data_item];
- CompareRetrieveResult(testcase, target);
- // Then, add +2 / -1 bias to target value, in order to test searching for
- // a target address not stored in the map.
- target -= 1;
- CompareRetrieveResult(testcase, target);
- target += 3;
- CompareRetrieveResult(testcase, target);
- // Repeatedly test searching for random target addresses.
- target = rand();
- CompareRetrieveResult(testcase, target);
- }
- }
-
- // Test data sets:
- static const int kNumberTestCases = 4;
- static const int testsize[];
- int *testdata[kNumberTestCases];
-
- AddrMap addr_map[kNumberTestCases];
- TestMap test_map[kNumberTestCases];
- char *map_data[kNumberTestCases];
- google_breakpad::AddressMapSerializer<int, string> serializer;
-};
-
-const int TestStaticAddressMap::testsize[] = {0, 1, 6, 1000};
-
-TEST_F(TestStaticAddressMap, TestEmptyMap) {
- int testcase = 0;
- int target;
- target = INT_MIN;
- CompareRetrieveResult(testcase, target);
- target = INT_MAX;
- CompareRetrieveResult(testcase, target);
- for (int data_item = 0; data_item < testsize[testcase]; ++data_item) {
- target = testdata[testcase][data_item];
- CompareRetrieveResult(testcase, target);
- target -= 1;
- CompareRetrieveResult(testcase, target);
- target += 3;
- CompareRetrieveResult(testcase, target);
- target = rand();
- CompareRetrieveResult(testcase, target);
- }
-}
-
-TEST_F(TestStaticAddressMap, TestOneElementMap) {
- int testcase = 1;
- int target;
- target = INT_MIN;
- CompareRetrieveResult(testcase, target);
- target = INT_MAX;
- CompareRetrieveResult(testcase, target);
- for (int data_item = 0; data_item < testsize[testcase]; ++data_item) {
- target = testdata[testcase][data_item];
- CompareRetrieveResult(testcase, target);
- target -= 1;
- CompareRetrieveResult(testcase, target);
- target += 3;
- CompareRetrieveResult(testcase, target);
- target = rand();
- CompareRetrieveResult(testcase, target);
- }
-}
-
-TEST_F(TestStaticAddressMap, TestSixElementsMap) {
- int testcase = 2;
- int target;
- target = INT_MIN;
- CompareRetrieveResult(testcase, target);
- target = INT_MAX;
- CompareRetrieveResult(testcase, target);
- for (int data_item = 0; data_item < testsize[testcase]; ++data_item) {
- target = testdata[testcase][data_item];
- CompareRetrieveResult(testcase, target);
- target -= 1;
- CompareRetrieveResult(testcase, target);
- target += 3;
- CompareRetrieveResult(testcase, target);
- target = rand();
- CompareRetrieveResult(testcase, target);
- }
-}
-
-TEST_F(TestStaticAddressMap, Test1000RandomElementsMap) {
- int testcase = 3;
- int target;
- target = INT_MIN;
- CompareRetrieveResult(testcase, target);
- target = INT_MAX;
- CompareRetrieveResult(testcase, target);
- for (int data_item = 0; data_item < testsize[testcase]; ++data_item) {
- target = testdata[testcase][data_item];
- CompareRetrieveResult(testcase, target);
- target -= 1;
- CompareRetrieveResult(testcase, target);
- target += 3;
- CompareRetrieveResult(testcase, target);
- target = rand();
- CompareRetrieveResult(testcase, target);
- }
-}
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map-inl.h
deleted file mode 100644
index 777c762184..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map-inl.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_contained_range_map-inl.h: Hierarchically-organized range map,
-// i.e., StaticContainedRangeMap implementation.
-//
-// See static_contained_range_map.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__
-#define PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__
-
-#include "processor/static_contained_range_map.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename AddressType, typename EntryType>
-StaticContainedRangeMap<AddressType, EntryType>::StaticContainedRangeMap(
- const char *base)
- : base_(*(reinterpret_cast<const AddressType*>(base))),
- entry_size_(*(reinterpret_cast<const uint32_t*>(base + sizeof(base_)))),
- entry_ptr_(reinterpret_cast<const EntryType *>(
- base + sizeof(base_) + sizeof(entry_size_))),
- map_(base + sizeof(base_) + sizeof(entry_size_) + entry_size_) {
- if (entry_size_ == 0)
- entry_ptr_ = NULL;
-}
-
-
-template<typename AddressType, typename EntryType>
-bool StaticContainedRangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, const EntryType *&entry) const {
-
- // Get an iterator to the child range whose high address is equal to or
- // greater than the supplied address. If the supplied address is higher
- // than all of the high addresses in the range, then this range does not
- // contain a child at address, so return false. If the supplied address
- // is lower than the base address of the child range, then it is not within
- // the child range, so return false.
- MapConstIterator iterator = map_.lower_bound(address);
-
- if (iterator == map_.end())
- return false;
-
- const char *memory_child =
- reinterpret_cast<const char*>(iterator.GetValuePtr());
-
- StaticContainedRangeMap child_map(memory_child);
-
- if (address < child_map.base_)
- return false;
-
- // The child in iterator->second contains the specified address. Find out
- // if it has a more-specific descendant that also contains it. If it does,
- // it will set |entry| appropriately. If not, set |entry| to the child.
- if (!child_map.RetrieveRange(address, entry))
- entry = child_map.entry_ptr_;
-
- return true;
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_CONTAINED_RANGE_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map.h b/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map.h
deleted file mode 100644
index 6a9b8b7b6d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_contained_range_map.h: StaticContainedRangeMap.
-//
-// StaticContainedRangeMap is similar to ContainedRangeMap. However,
-// StaticContainedRangeMap wraps a StaticMap instead of std::map, and does not
-// support dynamic operations like StoreRange(...).
-// StaticContainedRangeMap provides same RetrieveRange(...) interfaces as
-// ContainedRangeMap.
-//
-// Please see contained_range_map.h for more documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_CONTAINED_RANGE_MAP_H__
-#define PROCESSOR_STATIC_CONTAINED_RANGE_MAP_H__
-
-#include "processor/static_map-inl.h"
-
-namespace google_breakpad {
-
-template<typename AddressType, typename EntryType>
-class StaticContainedRangeMap {
- public:
- StaticContainedRangeMap(): base_(), entry_size_(), entry_ptr_(), map_() { }
- explicit StaticContainedRangeMap(const char *base);
-
- // Retrieves the most specific (smallest) descendant range encompassing
- // the specified address. This method will only return entries held by
- // child ranges, and not the entry contained by |this|. This is necessary
- // to support a sparsely-populated root range. If no descendant range
- // encompasses the address, returns false.
- bool RetrieveRange(const AddressType &address, const EntryType *&entry) const;
-
- private:
- friend class ModuleComparer;
- // AddressToRangeMap stores pointers. This makes reparenting simpler in
- // StoreRange, because it doesn't need to copy entire objects.
- typedef StaticContainedRangeMap* SelfPtr;
- typedef
- StaticMap<AddressType, StaticContainedRangeMap> AddressToRangeMap;
- typedef typename AddressToRangeMap::const_iterator MapConstIterator;
-
- // The base address of this range. The high address does not need to
- // be stored, because it is used as the key to an object in its parent's
- // map, and all ContainedRangeMaps except for the root range are contained
- // within maps. The root range does not actually contain an entry, so its
- // base_ field is meaningless, and the fact that it has no parent and thus
- // no key is unimportant. For this reason, the base_ field should only be
- // is accessed on child ContainedRangeMap objects, and never on |this|.
- AddressType base_;
-
- // The entry corresponding to this range. The root range does not
- // actually contain an entry, so its entry_ field is meaningless. For
- // this reason, the entry_ field should only be accessed on child
- // ContainedRangeMap objects, and never on |this|.
- uint32_t entry_size_;
- const EntryType *entry_ptr_;
-
- // The map containing child ranges, keyed by each child range's high
- // address. This is a pointer to avoid allocating map structures for
- // leaf nodes, where they are not needed.
- AddressToRangeMap map_;
-};
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STATIC_CONTAINED_RANGE_MAP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map_unittest.cc
deleted file mode 100644
index 4ee47578e2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_contained_range_map_unittest.cc
+++ /dev/null
@@ -1,320 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_contained_range_map_unittest.cc: Unit tests for
-// StaticContainedRangeMap.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include "breakpad_googletest_includes.h"
-#include "common/scoped_ptr.h"
-#include "processor/contained_range_map-inl.h"
-#include "processor/static_contained_range_map-inl.h"
-#include "processor/simple_serializer-inl.h"
-#include "processor/map_serializers-inl.h"
-#include "processor/logging.h"
-
-namespace {
-
-typedef google_breakpad::ContainedRangeMap<unsigned int, int> CRMMap;
-typedef google_breakpad::StaticContainedRangeMap<unsigned int, int> TestMap;
-
-// Each element in test_data contains the expected result when calling
-// RetrieveRange on an address.
-const int test_data[] = {
- 0, // 0
- 0, // 1
- 0, // 2
- 0, // 3
- 0, // 4
- 0, // 5
- 0, // 6
- 0, // 7
- 9, // 8
- 7, // 9
- 1, // 10
- 5, // 11
- 6, // 12
- 6, // 13
- 6, // 14
- 6, // 15
- 6, // 16
- 6, // 17
- 6, // 18
- 5, // 19
- 7, // 20
- 8, // 21
- 0, // 22
- 0, // 23
- 0, // 24
- 0, // 25
- 0, // 26
- 0, // 27
- 0, // 28
- 0, // 29
- 10, // 30
- 10, // 31
- 10, // 32
- 11, // 33
- 11, // 34
- 11, // 35
- 0, // 36
- 0, // 37
- 0, // 38
- 0, // 39
- 14, // 40
- 14, // 41
- 14, // 42
- 14, // 43
- 15, // 44
- 15, // 45
- 15, // 46
- 15, // 47
- 0, // 48
- 0, // 49
- 19, // 50
- 18, // 51
- 18, // 52
- 18, // 53
- 18, // 54
- 18, // 55
- 18, // 56
- 18, // 57
- 18, // 58
- 20, // 59
- 21, // 60
- 25, // 61
- 26, // 62
- 26, // 63
- 26, // 64
- 26, // 65
- 26, // 66
- 26, // 67
- 24, // 68
- 22, // 69
- 30, // 70
- 30, // 71
- 30, // 72
- 30, // 73
- 31, // 74
- 31, // 75
- 30, // 76
- 32, // 77
- 32, // 78
- 30, // 79
- 34, // 80
- 35, // 81
- 36, // 82
- 39, // 83
- 38, // 84
- 37, // 85
- 43, // 86
- 44, // 87
- 41, // 88
- 45, // 89
- 42, // 90
- 0, // 91
- 0, // 92
- 0, // 93
- 0, // 94
- 0, // 95
- 0, // 96
- 0, // 97
- 0, // 98
- 0 // 99
-};
-
-} // namespace
-
-namespace google_breakpad {
-
-class TestStaticCRMMap : public ::testing::Test {
- protected:
- void SetUp();
-
- // A referrence map for testing StaticCRMMap.
- google_breakpad::ContainedRangeMap<unsigned int, int> crm_map_;
-
- // Static version of crm_map using serialized data of crm_map.
- // The goal of testing is to make sure TestMap provides same results for
- // lookup operation(s) as CRMMap does.
- google_breakpad::StaticContainedRangeMap<unsigned int, int> test_map_;
-
- google_breakpad::ContainedRangeMapSerializer<unsigned int, int> serializer_;
-
- scoped_array<char> serialized_data_;
-};
-
-void TestStaticCRMMap::SetUp() {
- // First, do the StoreRange tests. This validates the containment
- // rules.
- // We confirm the referrence map correctly stores data during setup.
- ASSERT_TRUE (crm_map_.StoreRange(10, 10, 1));
- ASSERT_FALSE(crm_map_.StoreRange(10, 10, 2)); // exactly equal to 1
- ASSERT_FALSE(crm_map_.StoreRange(11, 10, 3)); // begins inside 1 and extends up
- ASSERT_FALSE(crm_map_.StoreRange( 9, 10, 4)); // begins below 1 and ends inside
- ASSERT_TRUE (crm_map_.StoreRange(11, 9, 5)); // contained by existing
- ASSERT_TRUE (crm_map_.StoreRange(12, 7, 6));
- ASSERT_TRUE (crm_map_.StoreRange( 9, 12, 7)); // contains existing
- ASSERT_TRUE (crm_map_.StoreRange( 9, 13, 8));
- ASSERT_TRUE (crm_map_.StoreRange( 8, 14, 9));
- ASSERT_TRUE (crm_map_.StoreRange(30, 3, 10));
- ASSERT_TRUE (crm_map_.StoreRange(33, 3, 11));
- ASSERT_TRUE (crm_map_.StoreRange(30, 6, 12)); // storable but totally masked
- ASSERT_TRUE (crm_map_.StoreRange(40, 8, 13)); // will be totally masked
- ASSERT_TRUE (crm_map_.StoreRange(40, 4, 14));
- ASSERT_TRUE (crm_map_.StoreRange(44, 4, 15));
- ASSERT_FALSE(crm_map_.StoreRange(32, 10, 16)); // begins in #10, ends in #14
- ASSERT_FALSE(crm_map_.StoreRange(50, 0, 17)); // zero length
- ASSERT_TRUE (crm_map_.StoreRange(50, 10, 18));
- ASSERT_TRUE (crm_map_.StoreRange(50, 1, 19));
- ASSERT_TRUE (crm_map_.StoreRange(59, 1, 20));
- ASSERT_TRUE (crm_map_.StoreRange(60, 1, 21));
- ASSERT_TRUE (crm_map_.StoreRange(69, 1, 22));
- ASSERT_TRUE (crm_map_.StoreRange(60, 10, 23));
- ASSERT_TRUE (crm_map_.StoreRange(68, 1, 24));
- ASSERT_TRUE (crm_map_.StoreRange(61, 1, 25));
- ASSERT_TRUE (crm_map_.StoreRange(61, 8, 26));
- ASSERT_FALSE(crm_map_.StoreRange(59, 9, 27));
- ASSERT_FALSE(crm_map_.StoreRange(59, 10, 28));
- ASSERT_FALSE(crm_map_.StoreRange(59, 11, 29));
- ASSERT_TRUE (crm_map_.StoreRange(70, 10, 30));
- ASSERT_TRUE (crm_map_.StoreRange(74, 2, 31));
- ASSERT_TRUE (crm_map_.StoreRange(77, 2, 32));
- ASSERT_FALSE(crm_map_.StoreRange(72, 6, 33));
- ASSERT_TRUE (crm_map_.StoreRange(80, 3, 34));
- ASSERT_TRUE (crm_map_.StoreRange(81, 1, 35));
- ASSERT_TRUE (crm_map_.StoreRange(82, 1, 36));
- ASSERT_TRUE (crm_map_.StoreRange(83, 3, 37));
- ASSERT_TRUE (crm_map_.StoreRange(84, 1, 38));
- ASSERT_TRUE (crm_map_.StoreRange(83, 1, 39));
- ASSERT_TRUE (crm_map_.StoreRange(86, 5, 40));
- ASSERT_TRUE (crm_map_.StoreRange(88, 1, 41));
- ASSERT_TRUE (crm_map_.StoreRange(90, 1, 42));
- ASSERT_TRUE (crm_map_.StoreRange(86, 1, 43));
- ASSERT_TRUE (crm_map_.StoreRange(87, 1, 44));
- ASSERT_TRUE (crm_map_.StoreRange(89, 1, 45));
- ASSERT_TRUE (crm_map_.StoreRange(87, 4, 46));
- ASSERT_TRUE (crm_map_.StoreRange(87, 3, 47));
- ASSERT_FALSE(crm_map_.StoreRange(86, 2, 48));
-
- // Serialize crm_map to generate serialized data.
- unsigned int size;
- serialized_data_.reset(serializer_.Serialize(&crm_map_, &size));
- BPLOG(INFO) << "Serialized data size: " << size << " Bytes.";
-
- // Construct test_map_ from serialized data.
- test_map_ = TestMap(serialized_data_.get());
-}
-
-TEST_F(TestStaticCRMMap, TestEmptyMap) {
- CRMMap empty_crm_map;
-
- unsigned int size;
- scoped_array<char> serialized_data;
- serialized_data.reset(serializer_.Serialize(&empty_crm_map, &size));
- scoped_ptr<TestMap> test_map(new TestMap(serialized_data.get()));
-
- const unsigned int kCorrectSizeForEmptyMap = 16;
- ASSERT_EQ(kCorrectSizeForEmptyMap, size);
-
- const int *entry_test;
- ASSERT_FALSE(test_map->RetrieveRange(-1, entry_test));
- ASSERT_FALSE(test_map->RetrieveRange(0, entry_test));
- ASSERT_FALSE(test_map->RetrieveRange(10, entry_test));
-}
-
-TEST_F(TestStaticCRMMap, TestSingleElementMap) {
- CRMMap crm_map;
- // Test on one element:
- int entry = 1;
- crm_map.StoreRange(10, 10, entry);
-
- unsigned int size;
- scoped_array<char> serialized_data;
- serialized_data.reset(serializer_.Serialize(&crm_map, &size));
- scoped_ptr<TestMap> test_map(new TestMap(serialized_data.get()));
-
- const unsigned int kCorrectSizeForSingleElementMap = 40;
- ASSERT_EQ(kCorrectSizeForSingleElementMap, size);
-
- const int *entry_test;
- ASSERT_FALSE(test_map->RetrieveRange(-1, entry_test));
- ASSERT_FALSE(test_map->RetrieveRange(0, entry_test));
- ASSERT_TRUE(test_map->RetrieveRange(10, entry_test));
- ASSERT_EQ(*entry_test, entry);
- ASSERT_TRUE(test_map->RetrieveRange(13, entry_test));
- ASSERT_EQ(*entry_test, entry);
-}
-
-TEST_F(TestStaticCRMMap, RunTestData) {
- unsigned int test_high = sizeof(test_data) / sizeof(test_data[0]);
-
- // Now, do the RetrieveRange tests. This further validates that the
- // objects were stored properly and that retrieval returns the correct
- // object.
- // If GENERATE_TEST_DATA is defined, instead of the retrieval tests, a
- // new test_data array will be printed. Exercise caution when doing this.
- // Be sure to verify the results manually!
-#ifdef GENERATE_TEST_DATA
- printf(" const int test_data[] = {\n");
-#endif // GENERATE_TEST_DATA
-
- for (unsigned int address = 0; address < test_high; ++address) {
- const int *entryptr;
- int value = 0;
- if (test_map_.RetrieveRange(address, entryptr))
- value = *entryptr;
-
-#ifndef GENERATE_TEST_DATA
- // Don't use ASSERT inside the loop because it won't show the failed
- // |address|, and the line number will always be the same. That makes
- // it difficult to figure out which test failed.
- EXPECT_EQ(value, test_data[address]) << "FAIL: retrieve address "
- << address;
-#else // !GENERATE_TEST_DATA
- printf(" %d%c%s // %d\n", value,
- address == test_high - 1 ? ' ' : ',',
- value < 10 ? " " : "",
- address);
-#endif // !GENERATE_TEST_DATA
- }
-
-#ifdef GENERATE_TEST_DATA
- printf(" };\n");
-#endif // GENERATE_TEST_DATA
-}
-
-} // namespace google_breakpad
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/static_map-inl.h
deleted file mode 100644
index e6aac6aba4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_map-inl.h
+++ /dev/null
@@ -1,176 +0,0 @@
-// Copyright 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_map-inl.h: StaticMap implementation.
-//
-// See static_map.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-
-#ifndef PROCESSOR_STATIC_MAP_INL_H__
-#define PROCESSOR_STATIC_MAP_INL_H__
-
-#include "processor/static_map.h"
-#include "processor/static_map_iterator-inl.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename Key, typename Value, typename Compare>
-StaticMap<Key, Value, Compare>::StaticMap(const char* raw_data)
- : raw_data_(raw_data),
- compare_() {
- // First 4 Bytes store the number of nodes.
- num_nodes_ = *(reinterpret_cast<const uint32_t*>(raw_data_));
-
- offsets_ = reinterpret_cast<const uint32_t*>(
- raw_data_ + sizeof(num_nodes_));
-
- keys_ = reinterpret_cast<const Key*>(
- raw_data_ + (1 + num_nodes_) * sizeof(uint32_t));
-}
-
-// find(), lower_bound() and upper_bound() implement binary search algorithm.
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>
-StaticMap<Key, Value, Compare>::find(const Key &key) const {
- int begin = 0;
- int end = num_nodes_;
- int middle;
- int compare_result;
- while (begin < end) {
- middle = begin + (end - begin) / 2;
- compare_result = compare_(key, GetKeyAtIndex(middle));
- if (compare_result == 0)
- return IteratorAtIndex(middle);
- if (compare_result < 0) {
- end = middle;
- } else {
- begin = middle + 1;
- }
- }
- return this->end();
-}
-
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>
-StaticMap<Key, Value, Compare>::lower_bound(const Key &key) const {
- int begin = 0;
- int end = num_nodes_;
- int middle;
- int comp_result;
- while (begin < end) {
- middle = begin + (end - begin) / 2;
- comp_result = compare_(key, GetKeyAtIndex(middle));
- if (comp_result == 0)
- return IteratorAtIndex(middle);
- if (comp_result < 0) {
- end = middle;
- } else {
- begin = middle + 1;
- }
- }
- return IteratorAtIndex(begin);
-}
-
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>
-StaticMap<Key, Value, Compare>::upper_bound(const Key &key) const {
- int begin = 0;
- int end = num_nodes_;
- int middle;
- int compare_result;
- while (begin < end) {
- middle = begin + (end - begin) / 2;
- compare_result = compare_(key, GetKeyAtIndex(middle));
- if (compare_result == 0)
- return IteratorAtIndex(middle + 1);
- if (compare_result < 0) {
- end = middle;
- } else {
- begin = middle + 1;
- }
- }
- return IteratorAtIndex(begin);
-}
-
-template<typename Key, typename Value, typename Compare>
-bool StaticMap<Key, Value, Compare>::ValidateInMemoryStructure() const {
- // check the number of nodes is non-negative:
- if (!raw_data_) return false;
- int32_t num_nodes = *(reinterpret_cast<const int32_t*>(raw_data_));
- if (num_nodes < 0) {
- BPLOG(INFO) << "StaticMap check failed: negative number of nodes";
- return false;
- }
-
- int node_index = 0;
- if (num_nodes_) {
- uint64_t first_offset = sizeof(int32_t) * (num_nodes_ + 1)
- + sizeof(Key) * num_nodes_;
- // Num_nodes_ is too large.
- if (first_offset > 0xffffffffUL) {
- BPLOG(INFO) << "StaticMap check failed: size exceeds limit";
- return false;
- }
- if (offsets_[node_index] != static_cast<uint32_t>(first_offset)) {
- BPLOG(INFO) << "StaticMap check failed: first node offset is incorrect";
- return false;
- }
- }
-
- for (node_index = 1; node_index < num_nodes_; ++node_index) {
- // Check offsets[i] is strictly increasing:
- if (offsets_[node_index] <= offsets_[node_index - 1]) {
- BPLOG(INFO) << "StaticMap check failed: node offsets non-increasing";
- return false;
- }
- // Check Key[i] is strictly increasing as no duplicate keys are allowed.
- if (compare_(GetKeyAtIndex(node_index),
- GetKeyAtIndex(node_index - 1)) <= 0) {
- BPLOG(INFO) << "StaticMap check failed: node keys non-increasing";
- return false;
- }
- }
- return true;
-}
-
-template<typename Key, typename Value, typename Compare>
-const Key StaticMap<Key, Value, Compare>::GetKeyAtIndex(int index) const {
- if (index < 0 || index >= num_nodes_) {
- BPLOG(ERROR) << "Key index out of range error";
- // Key type is required to be primitive type. Return 0 if index is invalid.
- return 0;
- }
- return keys_[index];
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_map.h b/toolkit/crashreporter/google-breakpad/src/processor/static_map.h
deleted file mode 100644
index 9723ab2a84..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_map.h
+++ /dev/null
@@ -1,144 +0,0 @@
-// Copyright 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_map.h: StaticMap.
-//
-// StaticMap provides lookup interfaces and iterators similar as stl::map's.
-// These lookup operations are purely Read-Only, thus memory
-// allocation & deallocation is mostly avoided (intentionally).
-//
-// The chunk of memory should contain data with pre-defined pattern:
-// **************** header ***************
-// uint32 (4 bytes): number of nodes
-// uint32 (4 bytes): address offset of node1's mapped_value
-// uint32 (4 bytes): address offset of node2's mapped_value
-// ...
-// uint32 (4 bytes): address offset of nodeN's mapped_value
-//
-// ************* Key array ************
-// (X bytes): node1's key
-// (X bytes): node2's key
-// ...
-// (X bytes): nodeN's key
-//
-// ************* Value array **********
-// (? bytes): node1's mapped_value
-// (? bytes): node2's mapped_value
-// ...
-// (? bytes): nodeN's mapped_value
-//
-// REQUIREMENT: Key type MUST be primitive type or pointers so that:
-// X = sizeof(typename Key);
-//
-// Note: since address offset is stored as uint32, user should keep in mind that
-// StaticMap only supports up to 4GB size of memory data.
-
-// Author: Siyang Xie (lambxsy@google.com)
-
-
-#ifndef PROCESSOR_STATIC_MAP_H__
-#define PROCESSOR_STATIC_MAP_H__
-
-#include "processor/static_map_iterator-inl.h"
-
-namespace google_breakpad {
-
-// Default functor to compare keys.
-template<typename Key>
-class DefaultCompare {
- public:
- int operator()(const Key &k1, const Key &k2) const {
- if (k1 < k2) return -1;
- if (k1 == k2) return 0;
- return 1;
- }
-};
-
-template<typename Key, typename Value, typename Compare = DefaultCompare<Key> >
-class StaticMap {
- public:
- typedef StaticMapIterator<Key, Value, Compare> iterator;
- typedef StaticMapIterator<Key, Value, Compare> const_iterator;
-
- StaticMap() : raw_data_(0),
- num_nodes_(0),
- offsets_(0),
- compare_() { }
-
- explicit StaticMap(const char* raw_data);
-
- inline bool empty() const { return num_nodes_ == 0; }
- inline unsigned int size() const { return num_nodes_; }
-
- // Return iterators.
- inline iterator begin() const { return IteratorAtIndex(0); }
- inline iterator last() const { return IteratorAtIndex(num_nodes_ - 1); }
- inline iterator end() const { return IteratorAtIndex(num_nodes_); }
- inline iterator IteratorAtIndex(int index) const {
- return iterator(raw_data_, index);
- }
-
- // Lookup operations.
- iterator find(const Key &k) const;
-
- // lower_bound(k) searches in a sorted range for the first element that has a
- // key not less than the argument k.
- iterator lower_bound(const Key &k) const;
-
- // upper_bound(k) searches in a sorted range for the first element that has a
- // key greater than the argument k.
- iterator upper_bound(const Key &k) const;
-
- // Checks if the underlying memory data conforms to the predefined pattern:
- // first check the number of nodes is non-negative,
- // then check both offsets and keys are strictly increasing (sorted).
- bool ValidateInMemoryStructure() const;
-
- private:
- const Key GetKeyAtIndex(int i) const;
-
- // Start address of a raw memory chunk with serialized data.
- const char* raw_data_;
-
- // Number of nodes in the static map.
- int32_t num_nodes_;
-
- // Array of offset addresses for stored values.
- // For example:
- // address_of_i-th_node_value = raw_data_ + offsets_[i]
- const uint32_t* offsets_;
-
- // keys_[i] = key of i_th node
- const Key* keys_;
-
- Compare compare_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_MAP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator-inl.h
deleted file mode 100644
index 7a7db5ad93..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator-inl.h
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_map_iterator-inl.h: StaticMapIterator implementation.
-//
-// See static_map_iterator.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_MAP_ITERATOR_INL_H__
-#define PROCESSOR_STATIC_MAP_ITERATOR_INL_H__
-
-#include "processor/static_map_iterator.h"
-
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>::StaticMapIterator(const char* base,
- const int &index):
- index_(index), base_(base) {
- // See static_map.h for documentation on
- // bytes format of serialized StaticMap data.
- num_nodes_ = *(reinterpret_cast<const int32_t*>(base_));
- offsets_ = reinterpret_cast<const uint32_t*>(base_ + sizeof(num_nodes_));
- keys_ = reinterpret_cast<const Key*>(
- base_ + (1 + num_nodes_) * sizeof(num_nodes_));
-}
-
-// Increment & Decrement operators:
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>&
-StaticMapIterator<Key, Value, Compare>::operator++() {
- if (!IsValid()) {
- BPLOG(ERROR) << "operator++ on invalid iterator";
- return *this;
- }
- if (++index_ > num_nodes_) index_ = num_nodes_;
- return *this;
-}
-
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>
-StaticMapIterator<Key, Value, Compare>::operator++(int postfix_operator) {
- if (!IsValid()) {
- BPLOG(ERROR) << "operator++ on invalid iterator";
- return *this;
- }
- StaticMapIterator<Key, Value, Compare> tmp = *this;
- if (++index_ > num_nodes_) index_ = num_nodes_;
- return tmp;
-}
-
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>&
-StaticMapIterator<Key, Value, Compare>::operator--() {
- if (!IsValid()) {
- BPLOG(ERROR) << "operator++ on invalid iterator";
- return *this;
- }
-
- if (--index_ < 0) index_ = 0;
- return *this;
-}
-
-template<typename Key, typename Value, typename Compare>
-StaticMapIterator<Key, Value, Compare>
-StaticMapIterator<Key, Value, Compare>::operator--(int postfix_operator) {
- if (!IsValid()) {
- BPLOG(ERROR) << "operator++ on invalid iterator";
- return *this;
- }
- StaticMapIterator<Key, Value, Compare> tmp = *this;
-
- if (--index_ < 0) index_ = 0;
- return tmp;
-}
-
-template<typename Key, typename Value, typename Compare>
-const Key* StaticMapIterator<Key, Value, Compare>::GetKeyPtr() const {
- if (!IsValid()) {
- BPLOG(ERROR) << "call GetKeyPtr() on invalid iterator";
- return NULL;
- }
- return &(keys_[index_]);
-}
-
-template<typename Key, typename Value, typename Compare>
-const char* StaticMapIterator<Key, Value, Compare>::GetValueRawPtr() const {
- if (!IsValid()) {
- BPLOG(ERROR) << "call GetValuePtr() on invalid iterator";
- return NULL;
- }
- return base_ + offsets_[index_];
-}
-
-template<typename Key, typename Value, typename Compare>
-bool StaticMapIterator<Key, Value, Compare>::operator==(
- const StaticMapIterator<Key, Value, Compare>& x) const {
- return base_ == x.base_ && index_ == x.index_;
-}
-
-template<typename Key, typename Value, typename Compare>
-bool StaticMapIterator<Key, Value, Compare>::operator!=(
- const StaticMapIterator<Key, Value, Compare>& x) const {
- // Only need to compare base_ and index_.
- // Other data members are auxiliary.
- return base_ != x.base_ || index_ != x.index_;
-}
-
-template<typename Key, typename Value, typename Compare>
-bool StaticMapIterator<Key, Value, Compare>::IsValid() const {
- if (!base_ || index_ < 0 || index_ > num_nodes_)
- return false;
-
- return true;
-}
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_MAP_ITERATOR_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator.h b/toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator.h
deleted file mode 100644
index 1af8fff454..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_map_iterator.h
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright 2010 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_map_iterator.h: StaticMapIterator template class declaration.
-//
-// StaticMapIterator provides increment and decrement operators to iterate
-// through a StaticMap map. It does not provide *, -> operators, user should
-// use GetKeyPtr(), GetKey(), GetValuePtr() interfaces to retrieve data or
-// pointer to data. StaticMapIterator is essentially a const_iterator.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-
-#ifndef PROCESSOR_STATIC_MAP_ITERATOR_H__
-#define PROCESSOR_STATIC_MAP_ITERATOR_H__
-
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-// Forward declaration.
-template<typename Key, typename Value, typename Compare> class StaticMap;
-
-// StaticMapIterator does not support operator*() or operator->(),
-// User should use GetKey(), GetKeyPtr(), GetValuePtr() instead;
-template<typename Key, typename Value, typename Compare>
-class StaticMapIterator {
- public:
- // Constructors.
- StaticMapIterator(): index_(-1), base_(NULL) { }
-
- // Increment & Decrement operators:
- StaticMapIterator& operator++();
- StaticMapIterator operator++(int post_fix_operator);
-
- StaticMapIterator& operator--();
- StaticMapIterator operator--(int post_fix_operator);
-
- // Interface for retrieving data / pointer to data.
- const Key* GetKeyPtr() const;
-
- // Run time error will occur if GetKey() is called on an invalid iterator.
- inline const Key GetKey() const { return *GetKeyPtr(); }
-
- // return a raw memory pointer that points to the start address of value.
- const char* GetValueRawPtr() const;
-
- // return a reinterpret-casted pointer to the value.
- inline const Value* GetValuePtr() const {
- return reinterpret_cast<const Value*>(GetValueRawPtr());
- }
-
- bool operator==(const StaticMapIterator& x) const;
- bool operator!=(const StaticMapIterator& x) const;
-
- // Check if this iterator is valid.
- // If iterator is invalid, user is forbidden to use ++/-- operator
- // or interfaces for retrieving data / pointer to data.
- bool IsValid() const;
-
- private:
- friend class StaticMap<Key, Value, Compare>;
-
- // Only StaticMap can call this constructor.
- explicit StaticMapIterator(const char* base, const int32_t &index);
-
- // Index of node that the iterator is pointing to.
- int32_t index_;
-
- // Beginning address of the serialized map data.
- const char* base_;
-
- // Number of nodes in the map. Use it to identify end() iterator.
- int32_t num_nodes_;
-
- // offsets_ is an array of offset addresses of mapped values.
- // For example:
- // address_of_i-th_node_value = base_ + offsets_[i]
- const uint32_t* offsets_;
-
- // keys_[i] = key of i_th node.
- const Key* keys_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_MAP_ITERATOR_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/static_map_unittest.cc
deleted file mode 100644
index 393d43d5c5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_map_unittest.cc
+++ /dev/null
@@ -1,386 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_map_unittest.cc: Unit tests for StaticMap.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include <climits>
-#include <map>
-
-#include "breakpad_googletest_includes.h"
-#include "processor/static_map-inl.h"
-
-
-typedef int ValueType;
-typedef int KeyType;
-typedef google_breakpad::StaticMap< KeyType, ValueType > TestMap;
-typedef std::map< KeyType, ValueType > StdMap;
-
-template<typename Key, typename Value>
-class SimpleMapSerializer {
- public:
- static char* Serialize(const std::map<Key, Value> &stdmap,
- unsigned int* size = NULL) {
- unsigned int size_per_node =
- sizeof(uint32_t) + sizeof(Key) + sizeof(Value);
- unsigned int memsize = sizeof(int32_t) + size_per_node * stdmap.size();
- if (size) *size = memsize;
-
- // Allocate memory for serialized data:
- char* mem = reinterpret_cast<char*>(operator new(memsize));
- char* address = mem;
-
- // Writer the number of nodes:
- new (address) uint32_t(static_cast<uint32_t>(stdmap.size()));
- address += sizeof(uint32_t);
-
- // Nodes' offset:
- uint32_t* offsets = reinterpret_cast<uint32_t*>(address);
- address += sizeof(uint32_t) * stdmap.size();
-
- // Keys:
- Key* keys = reinterpret_cast<Key*>(address);
- address += sizeof(Key) * stdmap.size();
-
- // Traversing map:
- typename std::map<Key, Value>::const_iterator iter = stdmap.begin();
- for (int index = 0; iter != stdmap.end(); ++iter, ++index) {
- offsets[index] = static_cast<unsigned int>(address - mem);
- keys[index] = iter->first;
- new (address) Value(iter->second);
- address += sizeof(Value);
- }
- return mem;
- }
-};
-
-
-class TestInvalidMap : public ::testing::Test {
- protected:
- void SetUp() {
- memset(data, 0, kMemorySize);
- }
-
- // 40 Bytes memory can hold a StaticMap with up to 3 nodes.
- static const int kMemorySize = 40;
- char data[kMemorySize];
- TestMap test_map;
-};
-
-TEST_F(TestInvalidMap, TestNegativeNumberNodes) {
- memset(data, 0xff, sizeof(uint32_t)); // Set the number of nodes = -1
- test_map = TestMap(data);
- ASSERT_FALSE(test_map.ValidateInMemoryStructure());
-}
-
-TEST_F(TestInvalidMap, TestWrongOffsets) {
- uint32_t* header = reinterpret_cast<uint32_t*>(data);
- const uint32_t kNumNodes = 2;
- const uint32_t kHeaderOffset =
- sizeof(uint32_t) + kNumNodes * (sizeof(uint32_t) + sizeof(KeyType));
-
- header[0] = kNumNodes;
- header[1] = kHeaderOffset + 3; // Wrong offset for first node
- test_map = TestMap(data);
- ASSERT_FALSE(test_map.ValidateInMemoryStructure());
-
- header[1] = kHeaderOffset; // Correct offset for first node
- header[2] = kHeaderOffset - 1; // Wrong offset for second node
- test_map = TestMap(data);
- ASSERT_FALSE(test_map.ValidateInMemoryStructure());
-}
-
-TEST_F(TestInvalidMap, TestUnSortedKeys) {
- uint32_t* header = reinterpret_cast<uint32_t*>(data);
- const uint32_t kNumNodes = 2;
- const uint32_t kHeaderOffset =
- sizeof(uint32_t) + kNumNodes * (sizeof(uint32_t) + sizeof(KeyType));
- header[0] = kNumNodes;
- header[1] = kHeaderOffset;
- header[2] = kHeaderOffset + sizeof(ValueType);
-
- KeyType* keys = reinterpret_cast<KeyType*>(
- data + (kNumNodes + 1) * sizeof(uint32_t));
- // Set keys in non-increasing order.
- keys[0] = 10;
- keys[1] = 7;
- test_map = TestMap(data);
- ASSERT_FALSE(test_map.ValidateInMemoryStructure());
-}
-
-
-class TestValidMap : public ::testing::Test {
- protected:
- void SetUp() {
- int testcase = 0;
-
- // Empty map.
- map_data[testcase] =
- serializer.Serialize(std_map[testcase], &size[testcase]);
- test_map[testcase] = TestMap(map_data[testcase]);
- ++testcase;
-
- // Single element.
- std_map[testcase].insert(std::make_pair(2, 8));
- map_data[testcase] =
- serializer.Serialize(std_map[testcase], &size[testcase]);
- test_map[testcase] = TestMap(map_data[testcase]);
- ++testcase;
-
- // 100 elements.
- for (int i = 0; i < 100; ++i)
- std_map[testcase].insert(std::make_pair(i, 2 * i));
- map_data[testcase] =
- serializer.Serialize(std_map[testcase], &size[testcase]);
- test_map[testcase] = TestMap(map_data[testcase]);
- ++testcase;
-
- // 1000 random elements.
- for (int i = 0; i < 1000; ++i)
- std_map[testcase].insert(std::make_pair(rand(), rand()));
- map_data[testcase] =
- serializer.Serialize(std_map[testcase], &size[testcase]);
- test_map[testcase] = TestMap(map_data[testcase]);
-
- // Set correct size of memory allocation for each test case.
- unsigned int size_per_node =
- sizeof(uint32_t) + sizeof(KeyType) + sizeof(ValueType);
- for (testcase = 0; testcase < kNumberTestCases; ++testcase) {
- correct_size[testcase] =
- sizeof(uint32_t) + std_map[testcase].size() * size_per_node;
- }
- }
-
- void TearDown() {
- for (int i = 0;i < kNumberTestCases; ++i)
- ::operator delete(map_data[i]);
- }
-
-
- void IteratorTester(int test_case) {
- // scan through:
- iter_test = test_map[test_case].begin();
- iter_std = std_map[test_case].begin();
-
- for (; iter_test != test_map[test_case].end() &&
- iter_std != std_map[test_case].end();
- ++iter_test, ++iter_std) {
- ASSERT_EQ(iter_test.GetKey(), iter_std->first);
- ASSERT_EQ(*(iter_test.GetValuePtr()), iter_std->second);
- }
- ASSERT_TRUE(iter_test == test_map[test_case].end()
- && iter_std == std_map[test_case].end());
-
- // Boundary testcase.
- if (!std_map[test_case].empty()) {
- // rear boundary case:
- iter_test = test_map[test_case].end();
- iter_std = std_map[test_case].end();
- --iter_std;
- --iter_test;
- ASSERT_EQ(iter_test.GetKey(), iter_std->first);
- ASSERT_EQ(*(iter_test.GetValuePtr()), iter_std->second);
-
- ++iter_test;
- ++iter_std;
- ASSERT_TRUE(iter_test == test_map[test_case].end());
-
- --iter_test;
- --iter_std;
- ASSERT_TRUE(iter_test != test_map[test_case].end());
- ASSERT_TRUE(iter_test == test_map[test_case].last());
- ASSERT_EQ(iter_test.GetKey(), iter_std->first);
- ASSERT_EQ(*(iter_test.GetValuePtr()), iter_std->second);
-
- // front boundary case:
- iter_test = test_map[test_case].begin();
- --iter_test;
- ASSERT_TRUE(iter_test == test_map[test_case].begin());
- }
- }
-
- void CompareLookupResult(int test_case) {
- bool found1 = (iter_test != test_map[test_case].end());
- bool found2 = (iter_std != std_map[test_case].end());
- ASSERT_EQ(found1, found2);
-
- if (found1 && found2) {
- ASSERT_EQ(iter_test.GetKey(), iter_std->first);
- ASSERT_EQ(*(iter_test.GetValuePtr()), iter_std->second);
- }
- }
-
- void FindTester(int test_case, const KeyType &key) {
- iter_test = test_map[test_case].find(key);
- iter_std = std_map[test_case].find(key);
- CompareLookupResult(test_case);
- }
-
- void LowerBoundTester(int test_case, const KeyType &key) {
- iter_test = test_map[test_case].lower_bound(key);
- iter_std = std_map[test_case].lower_bound(key);
- CompareLookupResult(test_case);
- }
-
- void UpperBoundTester(int test_case, const KeyType &key) {
- iter_test = test_map[test_case].upper_bound(key);
- iter_std = std_map[test_case].upper_bound(key);
- CompareLookupResult(test_case);
- }
-
- void LookupTester(int test_case) {
- StdMap::const_iterator iter;
- // Test find():
- for (iter = std_map[test_case].begin();
- iter != std_map[test_case].end();
- ++iter) {
- FindTester(test_case, iter->first);
- FindTester(test_case, iter->first + 1);
- FindTester(test_case, iter->first - 1);
- }
- FindTester(test_case, INT_MIN);
- FindTester(test_case, INT_MAX);
- // random test:
- for (int i = 0; i < rand()%5000 + 5000; ++i)
- FindTester(test_case, rand());
-
- // Test lower_bound():
- for (iter = std_map[test_case].begin();
- iter != std_map[test_case].end();
- ++iter) {
- LowerBoundTester(test_case, iter->first);
- LowerBoundTester(test_case, iter->first + 1);
- LowerBoundTester(test_case, iter->first - 1);
- }
- LowerBoundTester(test_case, INT_MIN);
- LowerBoundTester(test_case, INT_MAX);
- // random test:
- for (int i = 0; i < rand()%5000 + 5000; ++i)
- LowerBoundTester(test_case, rand());
-
- // Test upper_bound():
- for (iter = std_map[test_case].begin();
- iter != std_map[test_case].end();
- ++iter) {
- UpperBoundTester(test_case, iter->first);
- UpperBoundTester(test_case, iter->first + 1);
- UpperBoundTester(test_case, iter->first - 1);
- }
- UpperBoundTester(test_case, INT_MIN);
- UpperBoundTester(test_case, INT_MAX);
- // random test:
- for (int i = 0; i < rand()%5000 + 5000; ++i)
- UpperBoundTester(test_case, rand());
- }
-
- static const int kNumberTestCases = 4;
- StdMap std_map[kNumberTestCases];
- TestMap test_map[kNumberTestCases];
- TestMap::const_iterator iter_test;
- StdMap::const_iterator iter_std;
- char* map_data[kNumberTestCases];
- unsigned int size[kNumberTestCases];
- unsigned int correct_size[kNumberTestCases];
- SimpleMapSerializer<KeyType, ValueType> serializer;
-};
-
-TEST_F(TestValidMap, TestEmptyMap) {
- int test_case = 0;
- // Assert memory size allocated during serialization is correct.
- ASSERT_EQ(correct_size[test_case], size[test_case]);
-
- // Sanity check of serialized data:
- ASSERT_TRUE(test_map[test_case].ValidateInMemoryStructure());
- ASSERT_EQ(std_map[test_case].empty(), test_map[test_case].empty());
- ASSERT_EQ(std_map[test_case].size(), test_map[test_case].size());
-
- // Test Iterator.
- IteratorTester(test_case);
-
- // Test lookup operations.
- LookupTester(test_case);
-}
-
-TEST_F(TestValidMap, TestSingleElement) {
- int test_case = 1;
- // Assert memory size allocated during serialization is correct.
- ASSERT_EQ(correct_size[test_case], size[test_case]);
-
- // Sanity check of serialized data:
- ASSERT_TRUE(test_map[test_case].ValidateInMemoryStructure());
- ASSERT_EQ(std_map[test_case].empty(), test_map[test_case].empty());
- ASSERT_EQ(std_map[test_case].size(), test_map[test_case].size());
-
- // Test Iterator.
- IteratorTester(test_case);
-
- // Test lookup operations.
- LookupTester(test_case);
-}
-
-TEST_F(TestValidMap, Test100Elements) {
- int test_case = 2;
- // Assert memory size allocated during serialization is correct.
- ASSERT_EQ(correct_size[test_case], size[test_case]);
-
- // Sanity check of serialized data:
- ASSERT_TRUE(test_map[test_case].ValidateInMemoryStructure());
- ASSERT_EQ(std_map[test_case].empty(), test_map[test_case].empty());
- ASSERT_EQ(std_map[test_case].size(), test_map[test_case].size());
-
- // Test Iterator.
- IteratorTester(test_case);
-
- // Test lookup operations.
- LookupTester(test_case);
-}
-
-TEST_F(TestValidMap, Test1000RandomElements) {
- int test_case = 3;
- // Assert memory size allocated during serialization is correct.
- ASSERT_EQ(correct_size[test_case], size[test_case]);
-
- // Sanity check of serialized data:
- ASSERT_TRUE(test_map[test_case].ValidateInMemoryStructure());
- ASSERT_EQ(std_map[test_case].empty(), test_map[test_case].empty());
- ASSERT_EQ(std_map[test_case].size(), test_map[test_case].size());
-
- // Test Iterator.
- IteratorTester(test_case);
-
- // Test lookup operations.
- LookupTester(test_case);
-}
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_range_map-inl.h b/toolkit/crashreporter/google-breakpad/src/processor/static_range_map-inl.h
deleted file mode 100644
index f6cef1a9ee..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_range_map-inl.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_range_map-inl.h: StaticRangeMap implementation.
-//
-// See static_range_map.h for documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_RANGE_MAP_INL_H__
-#define PROCESSOR_STATIC_RANGE_MAP_INL_H__
-
-#include "processor/static_range_map.h"
-#include "processor/logging.h"
-
-namespace google_breakpad {
-
-template<typename AddressType, typename EntryType>
-bool StaticRangeMap<AddressType, EntryType>::RetrieveRange(
- const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const {
- MapConstIterator iterator = map_.lower_bound(address);
- if (iterator == map_.end())
- return false;
-
- // The map is keyed by the high address of each range, so |address| is
- // guaranteed to be lower than the range's high address. If |range| is
- // not directly preceded by another range, it's possible for address to
- // be below the range's low address, though. When that happens, address
- // references something not within any range, so return false.
-
- const Range *range = iterator.GetValuePtr();
-
- // Make sure AddressType and EntryType are copyable basic types
- // e.g.: integer types, pointers etc
- if (address < range->base())
- return false;
-
- entry = range->entryptr();
- if (entry_base)
- *entry_base = range->base();
- if (entry_size)
- *entry_size = iterator.GetKey() - range->base() + 1;
-
- return true;
-}
-
-
-template<typename AddressType, typename EntryType>
-bool StaticRangeMap<AddressType, EntryType>::RetrieveNearestRange(
- const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const {
- // If address is within a range, RetrieveRange can handle it.
- if (RetrieveRange(address, entry, entry_base, entry_size))
- return true;
-
- // upper_bound gives the first element whose key is greater than address,
- // but we want the first element whose key is less than or equal to address.
- // Decrement the iterator to get there, but not if the upper_bound already
- // points to the beginning of the map - in that case, address is lower than
- // the lowest stored key, so return false.
-
- MapConstIterator iterator = map_.upper_bound(address);
- if (iterator == map_.begin())
- return false;
- --iterator;
-
- const Range *range = iterator.GetValuePtr();
- entry = range->entryptr();
- if (entry_base)
- *entry_base = range->base();
- if (entry_size)
- *entry_size = iterator.GetKey() - range->base() + 1;
-
- return true;
-}
-
-template<typename AddressType, typename EntryType>
-bool StaticRangeMap<AddressType, EntryType>::RetrieveRangeAtIndex(
- int index, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const {
-
- if (index >= GetCount()) {
- BPLOG(ERROR) << "Index out of range: " << index << "/" << GetCount();
- return false;
- }
-
- MapConstIterator iterator = map_.IteratorAtIndex(index);
-
- const Range *range = iterator.GetValuePtr();
-
- entry = range->entryptr();
- if (entry_base)
- *entry_base = range->base();
- if (entry_size)
- *entry_size = iterator.GetKey() - range->base() + 1;
-
- return true;
-}
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_STATIC_RANGE_MAP_INL_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_range_map.h b/toolkit/crashreporter/google-breakpad/src/processor/static_range_map.h
deleted file mode 100644
index 91aabb0324..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_range_map.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// static_range_map.h: StaticRangeMap.
-//
-// StaticRangeMap is similar as RangeMap. However, StaticRangeMap wraps a
-// StaticMap instead of std::map, and does not support dynamic operations like
-// StoreRange(...). StaticRangeMap provides same Retrieve*() interfaces as
-// RangeMap. Please see range_map.h for more documentation.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#ifndef PROCESSOR_STATIC_RANGE_MAP_H__
-#define PROCESSOR_STATIC_RANGE_MAP_H__
-
-
-#include "processor/static_map-inl.h"
-
-namespace google_breakpad {
-
-// AddressType is basic type, e.g.: integer types, pointers etc
-// EntryType could be a complex type, so we retrieve its pointer instead.
-template<typename AddressType, typename EntryType>
-class StaticRangeMap {
- public:
- StaticRangeMap(): map_() { }
- explicit StaticRangeMap(const char *memory): map_(memory) { }
-
- // Locates the range encompassing the supplied address. If there is
- // no such range, returns false. entry_base and entry_size, if non-NULL,
- // are set to the base and size of the entry's range.
- bool RetrieveRange(const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size) const;
-
- // Locates the range encompassing the supplied address, if one exists.
- // If no range encompasses the supplied address, locates the nearest range
- // to the supplied address that is lower than the address. Returns false
- // if no range meets these criteria. entry_base and entry_size, if
- // non-NULL, are set to the base and size of the entry's range.
- bool RetrieveNearestRange(const AddressType &address, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size)
- const;
-
- // Treating all ranges as a list ordered by the address spaces that they
- // occupy, locates the range at the index specified by index. Returns
- // false if index is larger than the number of ranges stored. entry_base
- // and entry_size, if non-NULL, are set to the base and size of the entry's
- // range.
- //
- // RetrieveRangeAtIndex is not optimized for speedy operation.
- bool RetrieveRangeAtIndex(int index, const EntryType *&entry,
- AddressType *entry_base, AddressType *entry_size)
- const;
-
- // Returns the number of ranges stored in the RangeMap.
- inline int GetCount() const { return map_.size(); }
-
- private:
- friend class ModuleComparer;
- class Range {
- public:
- AddressType base() const {
- return *(reinterpret_cast<const AddressType*>(this));
- }
- const EntryType* entryptr() const {
- return reinterpret_cast<const EntryType*>(this + sizeof(AddressType));
- }
- };
-
- // Convenience types.
- typedef StaticRangeMap* SelfPtr;
- typedef StaticMap<AddressType, Range> AddressToRangeMap;
- typedef typename AddressToRangeMap::const_iterator MapConstIterator;
-
- AddressToRangeMap map_;
-};
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_STATIC_RANGE_MAP_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/static_range_map_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/static_range_map_unittest.cc
deleted file mode 100644
index 2821736224..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/static_range_map_unittest.cc
+++ /dev/null
@@ -1,421 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// static_range_map_unittest.cc: Unit tests for StaticRangeMap.
-//
-// Author: Siyang Xie (lambxsy@google.com)
-
-#include "breakpad_googletest_includes.h"
-#include "common/scoped_ptr.h"
-#include "processor/range_map-inl.h"
-#include "processor/static_range_map-inl.h"
-#include "processor/simple_serializer-inl.h"
-#include "processor/map_serializers-inl.h"
-#include "processor/logging.h"
-
-
-namespace {
-// Types used for testing.
-typedef int AddressType;
-typedef int EntryType;
-typedef google_breakpad::StaticRangeMap< AddressType, EntryType > TestMap;
-typedef google_breakpad::RangeMap< AddressType, EntryType > RMap;
-
-// RangeTest contains data to use for store and retrieve tests. See
-// RunTests for descriptions of the tests.
-struct RangeTest {
- // Base address to use for test
- AddressType address;
-
- // Size of range to use for test
- AddressType size;
-
- // Unique ID of range - unstorable ranges must have unique IDs too
- EntryType id;
-
- // Whether this range is expected to be stored successfully or not
- bool expect_storable;
-};
-
-// A RangeTestSet encompasses multiple RangeTests, which are run in
-// sequence on the same RangeMap.
-struct RangeTestSet {
- // An array of RangeTests
- const RangeTest* range_tests;
-
- // The number of tests in the set
- unsigned int range_test_count;
-};
-
-// These tests will be run sequentially. The first set of tests exercises
-// most functions of RangeTest, and verifies all of the bounds-checking.
-const RangeTest range_tests_0[] = {
- { INT_MIN, 16, 1, true }, // lowest possible range
- { -2, 5, 2, true }, // a range through zero
- { INT_MAX - 9, 11, 3, false }, // tests anti-overflow
- { INT_MAX - 9, 10, 4, true }, // highest possible range
- { 5, 0, 5, false }, // tests anti-zero-size
- { 5, 1, 6, true }, // smallest possible range
- { -20, 15, 7, true }, // entirely negative
-
- { 10, 10, 10, true }, // causes the following tests to fail
- { 9, 10, 11, false }, // one-less base, one-less high
- { 9, 11, 12, false }, // one-less base, identical high
- { 9, 12, 13, false }, // completely contains existing
- { 10, 9, 14, false }, // identical base, one-less high
- { 10, 10, 15, false }, // exactly identical to existing range
- { 10, 11, 16, false }, // identical base, one-greater high
- { 11, 8, 17, false }, // contained completely within
- { 11, 9, 18, false }, // one-greater base, identical high
- { 11, 10, 19, false }, // one-greater base, one-greater high
- { 9, 2, 20, false }, // overlaps bottom by one
- { 10, 1, 21, false }, // overlaps bottom by one, contained
- { 19, 1, 22, false }, // overlaps top by one, contained
- { 19, 2, 23, false }, // overlaps top by one
-
- { 9, 1, 24, true }, // directly below without overlap
- { 20, 1, 25, true }, // directly above without overlap
-
- { 6, 3, 26, true }, // exactly between two ranges, gapless
- { 7, 3, 27, false }, // tries to span two ranges
- { 7, 5, 28, false }, // tries to span three ranges
- { 4, 20, 29, false }, // tries to contain several ranges
-
- { 30, 50, 30, true },
- { 90, 25, 31, true },
- { 35, 65, 32, false }, // tries to span two noncontiguous
- { 120, 10000, 33, true }, // > 8-bit
- { 20000, 20000, 34, true }, // > 8-bit
- { 0x10001, 0x10001, 35, true }, // > 16-bit
-
- { 27, -1, 36, false } // tests high < base
-};
-
-// Attempt to fill the entire space. The entire space must be filled with
-// three stores because AddressType is signed for these tests, so RangeMap
-// treats the size as signed and rejects sizes that appear to be negative.
-// Even if these tests were run as unsigned, two stores would be needed
-// to fill the space because the entire size of the space could only be
-// described by using one more bit than would be present in AddressType.
-const RangeTest range_tests_1[] = {
- { INT_MIN, INT_MAX, 50, true }, // From INT_MIN to -2, inclusive
- { -1, 2, 51, true }, // From -1 to 0, inclusive
- { 1, INT_MAX, 52, true }, // From 1 to INT_MAX, inclusive
- { INT_MIN, INT_MAX, 53, false }, // Can't fill the space twice
- { -1, 2, 54, false },
- { 1, INT_MAX, 55, false },
- { -3, 6, 56, false }, // -3 to 2, inclusive - spans 3 ranges
-};
-
-// A light round of testing to verify that RetrieveRange does the right
-// the right thing at the extremities of the range when nothing is stored
-// there. Checks are forced without storing anything at the extremities
-// by setting size = 0.
-const RangeTest range_tests_2[] = {
- { INT_MIN, 0, 100, false }, // makes RetrieveRange check low end
- { -1, 3, 101, true },
- { INT_MAX, 0, 102, false }, // makes RetrieveRange check high end
-};
-
-// Similar to the previous test set, but with a couple of ranges closer
-// to the extremities.
-const RangeTest range_tests_3[] = {
- { INT_MIN + 1, 1, 110, true },
- { INT_MAX - 1, 1, 111, true },
- { INT_MIN, 0, 112, false }, // makes RetrieveRange check low end
- { INT_MAX, 0, 113, false } // makes RetrieveRange check high end
-};
-
-// The range map is cleared between sets of tests listed here.
-const RangeTestSet range_test_sets[] = {
- { range_tests_0, sizeof(range_tests_0) / sizeof(RangeTest) },
- { range_tests_1, sizeof(range_tests_1) / sizeof(RangeTest) },
- { range_tests_2, sizeof(range_tests_2) / sizeof(RangeTest) },
- { range_tests_3, sizeof(range_tests_3) / sizeof(RangeTest) },
- { range_tests_0, sizeof(range_tests_0) / sizeof(RangeTest) } // Run again
-};
-
-} // namespace
-
-namespace google_breakpad {
-class TestStaticRangeMap : public ::testing::Test {
- protected:
- void SetUp() {
- kTestCasesCount_ = sizeof(range_test_sets) / sizeof(RangeTestSet);
- }
-
- // StoreTest uses the data in a RangeTest and calls StoreRange on the
- // test RangeMap. It returns true if the expected result occurred, and
- // false if something else happened.
- void StoreTest(RMap* range_map, const RangeTest* range_test);
-
- // RetrieveTest uses the data in RangeTest and calls RetrieveRange on the
- // test RangeMap. If it retrieves the expected value (which can be no
- // map entry at the specified range,) it returns true, otherwise, it returns
- // false. RetrieveTest will check the values around the base address and
- // the high address of a range to guard against off-by-one errors.
- void RetrieveTest(TestMap* range_map, const RangeTest* range_test);
-
- // Test RetrieveRangeAtIndex, which is supposed to return objects in order
- // according to their addresses. This test is performed by looping through
- // the map, calling RetrieveRangeAtIndex for all possible indices in sequence,
- // and verifying that each call returns a different object than the previous
- // call, and that ranges are returned with increasing base addresses. Returns
- // false if the test fails.
- void RetrieveIndexTest(const TestMap* range_map, int set);
-
- void RunTestCase(int test_case);
-
- unsigned int kTestCasesCount_;
- RangeMapSerializer<AddressType, EntryType> serializer_;
-};
-
-void TestStaticRangeMap::StoreTest(RMap* range_map,
- const RangeTest* range_test) {
- bool stored = range_map->StoreRange(range_test->address,
- range_test->size,
- range_test->id);
- EXPECT_EQ(stored, range_test->expect_storable)
- << "StoreRange id " << range_test->id << "FAILED";
-}
-
-void TestStaticRangeMap::RetrieveTest(TestMap* range_map,
- const RangeTest* range_test) {
- for (unsigned int side = 0; side <= 1; ++side) {
- // When side == 0, check the low side (base address) of each range.
- // When side == 1, check the high side (base + size) of each range.
-
- // Check one-less and one-greater than the target address in addition
- // to the target address itself.
-
- // If the size of the range is only 1, don't check one greater than
- // the base or one less than the high - for a successfully stored
- // range, these tests would erroneously fail because the range is too
- // small.
- AddressType low_offset = -1;
- AddressType high_offset = 1;
- if (range_test->size == 1) {
- if (!side) // When checking the low side,
- high_offset = 0; // don't check one over the target.
- else // When checking the high side,
- low_offset = 0; // don't check one under the target.
- }
-
- for (AddressType offset = low_offset; offset <= high_offset; ++offset) {
- AddressType address =
- offset +
- (!side ? range_test->address :
- range_test->address + range_test->size - 1);
-
- bool expected_result = false; // This is correct for tests not stored.
- if (range_test->expect_storable) {
- if (offset == 0) // When checking the target address,
- expected_result = true; // test should always succeed.
- else if (offset == -1) // When checking one below the target,
- expected_result = side; // should fail low and succeed high.
- else // When checking one above the target,
- expected_result = !side; // should succeed low and fail high.
- }
-
- const EntryType* id;
- AddressType retrieved_base;
- AddressType retrieved_size;
- bool retrieved = range_map->RetrieveRange(address, id,
- &retrieved_base,
- &retrieved_size);
-
- bool observed_result = retrieved && *id == range_test->id;
- EXPECT_EQ(observed_result, expected_result)
- << "RetrieveRange id " << range_test->id
- << ", side " << side << ", offset " << offset << " FAILED.";
-
- // If a range was successfully retrieved, check that the returned
- // bounds match the range as stored.
- if (observed_result == true) {
- EXPECT_EQ(retrieved_base, range_test->address)
- << "RetrieveRange id " << range_test->id
- << ", side " << side << ", offset " << offset << " FAILED.";
- EXPECT_EQ(retrieved_size, range_test->size)
- << "RetrieveRange id " << range_test->id
- << ", side " << side << ", offset " << offset << " FAILED.";
- }
-
- // Now, check RetrieveNearestRange. The nearest range is always
- // expected to be different from the test range when checking one
- // less than the low side.
- bool expected_nearest = range_test->expect_storable;
- if (!side && offset < 0)
- expected_nearest = false;
-
- AddressType nearest_base;
- AddressType nearest_size;
- bool retrieved_nearest = range_map->RetrieveNearestRange(address,
- id,
- &nearest_base,
- &nearest_size);
-
- // When checking one greater than the high side, RetrieveNearestRange
- // should usually return the test range. When a different range begins
- // at that address, though, then RetrieveNearestRange should return the
- // range at the address instead of the test range.
- if (side && offset > 0 && nearest_base == address) {
- expected_nearest = false;
- }
-
- bool observed_nearest = retrieved_nearest &&
- *id == range_test->id;
-
- EXPECT_EQ(observed_nearest, expected_nearest)
- << "RetrieveRange id " << range_test->id
- << ", side " << side << ", offset " << offset << " FAILED.";
-
- // If a range was successfully retrieved, check that the returned
- // bounds match the range as stored.
- if (expected_nearest ==true) {
- EXPECT_EQ(nearest_base, range_test->address)
- << "RetrieveRange id " << range_test->id
- << ", side " << side << ", offset " << offset << " FAILED.";
- EXPECT_EQ(nearest_size, range_test->size)
- << "RetrieveRange id " << range_test->id
- << ", side " << side << ", offset " << offset << " FAILED.";
- }
- }
- }
-}
-
-void TestStaticRangeMap::RetrieveIndexTest(const TestMap* range_map, int set) {
- AddressType last_base = 0;
- const EntryType* last_entry = 0;
- const EntryType* entry;
- int object_count = range_map->GetCount();
- for (int object_index = 0; object_index < object_count; ++object_index) {
- AddressType base;
- ASSERT_TRUE(range_map->RetrieveRangeAtIndex(object_index,
- entry,
- &base,
- NULL))
- << "FAILED: RetrieveRangeAtIndex set " << set
- << " index " << object_index;
-
- ASSERT_TRUE(entry) << "FAILED: RetrieveRangeAtIndex set " << set
- << " index " << object_index;
-
- // It's impossible to do these comparisons unless there's a previous
- // object to compare against.
- if (last_entry) {
- // The object must be different from the last_entry one.
- EXPECT_NE(*entry, *last_entry) << "FAILED: RetrieveRangeAtIndex set "
- << set << " index " << object_index;
- // Each object must have a base greater than the previous object's base.
- EXPECT_GT(base, last_base) << "FAILED: RetrieveRangeAtIndex set " << set
- << " index " << object_index;
- }
- last_entry = entry;
- last_base = base;
- }
-
- // Make sure that RetrieveRangeAtIndex doesn't allow lookups at indices that
- // are too high.
- ASSERT_FALSE(range_map->RetrieveRangeAtIndex(
- object_count, entry, NULL, NULL)) << "FAILED: RetrieveRangeAtIndex set "
- << set << " index " << object_count
- << " (too large)";
-}
-
-// RunTests runs a series of test sets.
-void TestStaticRangeMap::RunTestCase(int test_case) {
- // Maintain the range map in a pointer so that deletion can be meaningfully
- // tested.
- scoped_ptr<RMap> rmap(new RMap());
-
- const RangeTest* range_tests = range_test_sets[test_case].range_tests;
- unsigned int range_test_count = range_test_sets[test_case].range_test_count;
-
- // Run the StoreRange test, which validates StoreRange and initializes
- // the RangeMap with data for the RetrieveRange test.
- int stored_count = 0; // The number of ranges successfully stored
- for (unsigned int range_test_index = 0;
- range_test_index < range_test_count;
- ++range_test_index) {
- const RangeTest* range_test = &range_tests[range_test_index];
- StoreTest(rmap.get(), range_test);
-
- if (range_test->expect_storable)
- ++stored_count;
- }
-
- scoped_array<char> memaddr(serializer_.Serialize(*rmap, NULL));
- scoped_ptr<TestMap> static_range_map(new TestMap(memaddr.get()));
-
- // The RangeMap's own count of objects should also match.
- EXPECT_EQ(static_range_map->GetCount(), stored_count);
-
- // Run the RetrieveRange test
- for (unsigned int range_test_index = 0;
- range_test_index < range_test_count;
- ++range_test_index) {
- const RangeTest* range_test = &range_tests[range_test_index];
- RetrieveTest(static_range_map.get(), range_test);
- }
-
- RetrieveIndexTest(static_range_map.get(), test_case);
-}
-
-TEST_F(TestStaticRangeMap, TestCase0) {
- int test_case = 0;
- RunTestCase(test_case);
-}
-
-TEST_F(TestStaticRangeMap, TestCase1) {
- int test_case = 1;
- RunTestCase(test_case);
-}
-
-TEST_F(TestStaticRangeMap, TestCase2) {
- int test_case = 2;
- RunTestCase(test_case);
-}
-
-TEST_F(TestStaticRangeMap, TestCase3) {
- int test_case = 3;
- RunTestCase(test_case);
-}
-
-TEST_F(TestStaticRangeMap, RunTestCase0Again) {
- int test_case = 0;
- RunTestCase(test_case);
-}
-
-} // namespace google_breakpad
-
-int main(int argc, char *argv[]) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.cc b/toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.cc
deleted file mode 100644
index a6ee26a260..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.cc
+++ /dev/null
@@ -1,6418 +0,0 @@
-// Copyright (c) 2015 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ntstatus_reason_win.h: Windows NTSTATUS code to string.
-//
-// Provides a means to convert NTSTATUS codes to strings.
-//
-// Author: Ben Wagner
-
-#include <string>
-
-#include "common/stdio_wrapper.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_exception_win32.h"
-#include "processor/symbolic_constants_win.h"
-
-namespace google_breakpad {
-
-string NTStatusToString(uint32_t ntstatus) {
- string reason;
- // The content of this switch was created from ntstatus.h in the 8.1 SDK with
- //
- // egrep '#define [A-Z_0-9]+\s+\(\(NTSTATUS\)0xC[0-9A-F]+L\)' ntstatus.h
- // | tr -d '\r'
- // | sed -r 's@#define ([A-Z_0-9]+)\s+\(\(NTSTATUS\)(0xC[0-9A-F]+)L\).*@\2 \1@'
- // | sort
- // | sed -r 's@(0xC[0-9A-F]+) ([A-Z_0-9]+)@ case MD_NTSTATUS_WIN_\2:\n reason = "\2";\n break;@'
- //
- // With easy copy to clipboard with
- // | xclip -selection c # on linux
- // | clip # on windows
- // | pbcopy # on mac
- //
- // and then the default case added.
- switch (ntstatus) {
- case MD_NTSTATUS_WIN_STATUS_UNSUCCESSFUL:
- reason = "STATUS_UNSUCCESSFUL";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_IMPLEMENTED:
- reason = "STATUS_NOT_IMPLEMENTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_INFO_CLASS:
- reason = "STATUS_INVALID_INFO_CLASS";
- break;
- case MD_NTSTATUS_WIN_STATUS_INFO_LENGTH_MISMATCH:
- reason = "STATUS_INFO_LENGTH_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_VIOLATION:
- reason = "STATUS_ACCESS_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_IN_PAGE_ERROR:
- reason = "STATUS_IN_PAGE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA:
- reason = "STATUS_PAGEFILE_QUOTA";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_HANDLE:
- reason = "STATUS_INVALID_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_STACK:
- reason = "STATUS_BAD_INITIAL_STACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_INITIAL_PC:
- reason = "STATUS_BAD_INITIAL_PC";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_CID:
- reason = "STATUS_INVALID_CID";
- break;
- case MD_NTSTATUS_WIN_STATUS_TIMER_NOT_CANCELED:
- reason = "STATUS_TIMER_NOT_CANCELED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER:
- reason = "STATUS_INVALID_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_DEVICE:
- reason = "STATUS_NO_SUCH_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_FILE:
- reason = "STATUS_NO_SUCH_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_REQUEST:
- reason = "STATUS_INVALID_DEVICE_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_END_OF_FILE:
- reason = "STATUS_END_OF_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_WRONG_VOLUME:
- reason = "STATUS_WRONG_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_MEDIA_IN_DEVICE:
- reason = "STATUS_NO_MEDIA_IN_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_MEDIA:
- reason = "STATUS_UNRECOGNIZED_MEDIA";
- break;
- case MD_NTSTATUS_WIN_STATUS_NONEXISTENT_SECTOR:
- reason = "STATUS_NONEXISTENT_SECTOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_MORE_PROCESSING_REQUIRED:
- reason = "STATUS_MORE_PROCESSING_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_MEMORY:
- reason = "STATUS_NO_MEMORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONFLICTING_ADDRESSES:
- reason = "STATUS_CONFLICTING_ADDRESSES";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_VIEW:
- reason = "STATUS_NOT_MAPPED_VIEW";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNABLE_TO_FREE_VM:
- reason = "STATUS_UNABLE_TO_FREE_VM";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DELETE_SECTION:
- reason = "STATUS_UNABLE_TO_DELETE_SECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SYSTEM_SERVICE:
- reason = "STATUS_INVALID_SYSTEM_SERVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILLEGAL_INSTRUCTION:
- reason = "STATUS_ILLEGAL_INSTRUCTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_SEQUENCE:
- reason = "STATUS_INVALID_LOCK_SEQUENCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_VIEW_SIZE:
- reason = "STATUS_INVALID_VIEW_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_FILE_FOR_SECTION:
- reason = "STATUS_INVALID_FILE_FOR_SECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALREADY_COMMITTED:
- reason = "STATUS_ALREADY_COMMITTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_DENIED:
- reason = "STATUS_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BUFFER_TOO_SMALL:
- reason = "STATUS_BUFFER_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_TYPE_MISMATCH:
- reason = "STATUS_OBJECT_TYPE_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_NONCONTINUABLE_EXCEPTION:
- reason = "STATUS_NONCONTINUABLE_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_DISPOSITION:
- reason = "STATUS_INVALID_DISPOSITION";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNWIND:
- reason = "STATUS_UNWIND";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_STACK:
- reason = "STATUS_BAD_STACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_UNWIND_TARGET:
- reason = "STATUS_INVALID_UNWIND_TARGET";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_LOCKED:
- reason = "STATUS_NOT_LOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PARITY_ERROR:
- reason = "STATUS_PARITY_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNABLE_TO_DECOMMIT_VM:
- reason = "STATUS_UNABLE_TO_DECOMMIT_VM";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_COMMITTED:
- reason = "STATUS_NOT_COMMITTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PORT_ATTRIBUTES:
- reason = "STATUS_INVALID_PORT_ATTRIBUTES";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_MESSAGE_TOO_LONG:
- reason = "STATUS_PORT_MESSAGE_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_MIX:
- reason = "STATUS_INVALID_PARAMETER_MIX";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_QUOTA_LOWER:
- reason = "STATUS_INVALID_QUOTA_LOWER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_CORRUPT_ERROR:
- reason = "STATUS_DISK_CORRUPT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_INVALID:
- reason = "STATUS_OBJECT_NAME_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_NOT_FOUND:
- reason = "STATUS_OBJECT_NAME_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_NAME_COLLISION:
- reason = "STATUS_OBJECT_NAME_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_DISCONNECTED:
- reason = "STATUS_PORT_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_ALREADY_ATTACHED:
- reason = "STATUS_DEVICE_ALREADY_ATTACHED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_INVALID:
- reason = "STATUS_OBJECT_PATH_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_NOT_FOUND:
- reason = "STATUS_OBJECT_PATH_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_PATH_SYNTAX_BAD:
- reason = "STATUS_OBJECT_PATH_SYNTAX_BAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_DATA_OVERRUN:
- reason = "STATUS_DATA_OVERRUN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DATA_LATE_ERROR:
- reason = "STATUS_DATA_LATE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DATA_ERROR:
- reason = "STATUS_DATA_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_CRC_ERROR:
- reason = "STATUS_CRC_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECTION_TOO_BIG:
- reason = "STATUS_SECTION_TOO_BIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_CONNECTION_REFUSED:
- reason = "STATUS_PORT_CONNECTION_REFUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PORT_HANDLE:
- reason = "STATUS_INVALID_PORT_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHARING_VIOLATION:
- reason = "STATUS_SHARING_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_QUOTA_EXCEEDED:
- reason = "STATUS_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PAGE_PROTECTION:
- reason = "STATUS_INVALID_PAGE_PROTECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUTANT_NOT_OWNED:
- reason = "STATUS_MUTANT_NOT_OWNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SEMAPHORE_LIMIT_EXCEEDED:
- reason = "STATUS_SEMAPHORE_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_SET:
- reason = "STATUS_PORT_ALREADY_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECTION_NOT_IMAGE:
- reason = "STATUS_SECTION_NOT_IMAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SUSPEND_COUNT_EXCEEDED:
- reason = "STATUS_SUSPEND_COUNT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREAD_IS_TERMINATING:
- reason = "STATUS_THREAD_IS_TERMINATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_WORKING_SET_LIMIT:
- reason = "STATUS_BAD_WORKING_SET_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_FILE_MAP:
- reason = "STATUS_INCOMPATIBLE_FILE_MAP";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECTION_PROTECTION:
- reason = "STATUS_SECTION_PROTECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_EAS_NOT_SUPPORTED:
- reason = "STATUS_EAS_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_EA_TOO_LARGE:
- reason = "STATUS_EA_TOO_LARGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NONEXISTENT_EA_ENTRY:
- reason = "STATUS_NONEXISTENT_EA_ENTRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_EAS_ON_FILE:
- reason = "STATUS_NO_EAS_ON_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_EA_CORRUPT_ERROR:
- reason = "STATUS_EA_CORRUPT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_LOCK_CONFLICT:
- reason = "STATUS_FILE_LOCK_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOCK_NOT_GRANTED:
- reason = "STATUS_LOCK_NOT_GRANTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DELETE_PENDING:
- reason = "STATUS_DELETE_PENDING";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTL_FILE_NOT_SUPPORTED:
- reason = "STATUS_CTL_FILE_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNKNOWN_REVISION:
- reason = "STATUS_UNKNOWN_REVISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_REVISION_MISMATCH:
- reason = "STATUS_REVISION_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_OWNER:
- reason = "STATUS_INVALID_OWNER";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PRIMARY_GROUP:
- reason = "STATUS_INVALID_PRIMARY_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_IMPERSONATION_TOKEN:
- reason = "STATUS_NO_IMPERSONATION_TOKEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_DISABLE_MANDATORY:
- reason = "STATUS_CANT_DISABLE_MANDATORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_LOGON_SERVERS:
- reason = "STATUS_NO_LOGON_SERVERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_LOGON_SESSION:
- reason = "STATUS_NO_SUCH_LOGON_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_PRIVILEGE:
- reason = "STATUS_NO_SUCH_PRIVILEGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PRIVILEGE_NOT_HELD:
- reason = "STATUS_PRIVILEGE_NOT_HELD";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ACCOUNT_NAME:
- reason = "STATUS_INVALID_ACCOUNT_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_USER_EXISTS:
- reason = "STATUS_USER_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_USER:
- reason = "STATUS_NO_SUCH_USER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GROUP_EXISTS:
- reason = "STATUS_GROUP_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_GROUP:
- reason = "STATUS_NO_SUCH_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEMBER_IN_GROUP:
- reason = "STATUS_MEMBER_IN_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_GROUP:
- reason = "STATUS_MEMBER_NOT_IN_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_LAST_ADMIN:
- reason = "STATUS_LAST_ADMIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD:
- reason = "STATUS_WRONG_PASSWORD";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILL_FORMED_PASSWORD:
- reason = "STATUS_ILL_FORMED_PASSWORD";
- break;
- case MD_NTSTATUS_WIN_STATUS_PASSWORD_RESTRICTION:
- reason = "STATUS_PASSWORD_RESTRICTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGON_FAILURE:
- reason = "STATUS_LOGON_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCOUNT_RESTRICTION:
- reason = "STATUS_ACCOUNT_RESTRICTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_HOURS:
- reason = "STATUS_INVALID_LOGON_HOURS";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_WORKSTATION:
- reason = "STATUS_INVALID_WORKSTATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_PASSWORD_EXPIRED:
- reason = "STATUS_PASSWORD_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCOUNT_DISABLED:
- reason = "STATUS_ACCOUNT_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NONE_MAPPED:
- reason = "STATUS_NONE_MAPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_LUIDS_REQUESTED:
- reason = "STATUS_TOO_MANY_LUIDS_REQUESTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LUIDS_EXHAUSTED:
- reason = "STATUS_LUIDS_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SUB_AUTHORITY:
- reason = "STATUS_INVALID_SUB_AUTHORITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ACL:
- reason = "STATUS_INVALID_ACL";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SID:
- reason = "STATUS_INVALID_SID";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SECURITY_DESCR:
- reason = "STATUS_INVALID_SECURITY_DESCR";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROCEDURE_NOT_FOUND:
- reason = "STATUS_PROCEDURE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_FORMAT:
- reason = "STATUS_INVALID_IMAGE_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_TOKEN:
- reason = "STATUS_NO_TOKEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_INHERITANCE_ACL:
- reason = "STATUS_BAD_INHERITANCE_ACL";
- break;
- case MD_NTSTATUS_WIN_STATUS_RANGE_NOT_LOCKED:
- reason = "STATUS_RANGE_NOT_LOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_FULL:
- reason = "STATUS_DISK_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_SERVER_DISABLED:
- reason = "STATUS_SERVER_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SERVER_NOT_DISABLED:
- reason = "STATUS_SERVER_NOT_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_GUIDS_REQUESTED:
- reason = "STATUS_TOO_MANY_GUIDS_REQUESTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GUIDS_EXHAUSTED:
- reason = "STATUS_GUIDS_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ID_AUTHORITY:
- reason = "STATUS_INVALID_ID_AUTHORITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_AGENTS_EXHAUSTED:
- reason = "STATUS_AGENTS_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_VOLUME_LABEL:
- reason = "STATUS_INVALID_VOLUME_LABEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECTION_NOT_EXTENDED:
- reason = "STATUS_SECTION_NOT_EXTENDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_MAPPED_DATA:
- reason = "STATUS_NOT_MAPPED_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_DATA_NOT_FOUND:
- reason = "STATUS_RESOURCE_DATA_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_TYPE_NOT_FOUND:
- reason = "STATUS_RESOURCE_TYPE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_NAME_NOT_FOUND:
- reason = "STATUS_RESOURCE_NAME_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_ARRAY_BOUNDS_EXCEEDED:
- reason = "STATUS_ARRAY_BOUNDS_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_DENORMAL_OPERAND:
- reason = "STATUS_FLOAT_DENORMAL_OPERAND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_DIVIDE_BY_ZERO:
- reason = "STATUS_FLOAT_DIVIDE_BY_ZERO";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_INEXACT_RESULT:
- reason = "STATUS_FLOAT_INEXACT_RESULT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_INVALID_OPERATION:
- reason = "STATUS_FLOAT_INVALID_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_OVERFLOW:
- reason = "STATUS_FLOAT_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_STACK_CHECK:
- reason = "STATUS_FLOAT_STACK_CHECK";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_UNDERFLOW:
- reason = "STATUS_FLOAT_UNDERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_INTEGER_DIVIDE_BY_ZERO:
- reason = "STATUS_INTEGER_DIVIDE_BY_ZERO";
- break;
- case MD_NTSTATUS_WIN_STATUS_INTEGER_OVERFLOW:
- reason = "STATUS_INTEGER_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_PRIVILEGED_INSTRUCTION:
- reason = "STATUS_PRIVILEGED_INSTRUCTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_PAGING_FILES:
- reason = "STATUS_TOO_MANY_PAGING_FILES";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_INVALID:
- reason = "STATUS_FILE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALLOTTED_SPACE_EXCEEDED:
- reason = "STATUS_ALLOTTED_SPACE_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCES:
- reason = "STATUS_INSUFFICIENT_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_DFS_EXIT_PATH_FOUND:
- reason = "STATUS_DFS_EXIT_PATH_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_DATA_ERROR:
- reason = "STATUS_DEVICE_DATA_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_CONNECTED:
- reason = "STATUS_DEVICE_NOT_CONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_POWER_FAILURE:
- reason = "STATUS_DEVICE_POWER_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FREE_VM_NOT_AT_BASE:
- reason = "STATUS_FREE_VM_NOT_AT_BASE";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEMORY_NOT_ALLOCATED:
- reason = "STATUS_MEMORY_NOT_ALLOCATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_WORKING_SET_QUOTA:
- reason = "STATUS_WORKING_SET_QUOTA";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEDIA_WRITE_PROTECTED:
- reason = "STATUS_MEDIA_WRITE_PROTECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_READY:
- reason = "STATUS_DEVICE_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_GROUP_ATTRIBUTES:
- reason = "STATUS_INVALID_GROUP_ATTRIBUTES";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_IMPERSONATION_LEVEL:
- reason = "STATUS_BAD_IMPERSONATION_LEVEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_OPEN_ANONYMOUS:
- reason = "STATUS_CANT_OPEN_ANONYMOUS";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_VALIDATION_CLASS:
- reason = "STATUS_BAD_VALIDATION_CLASS";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_TOKEN_TYPE:
- reason = "STATUS_BAD_TOKEN_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_MASTER_BOOT_RECORD:
- reason = "STATUS_BAD_MASTER_BOOT_RECORD";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSTRUCTION_MISALIGNMENT:
- reason = "STATUS_INSTRUCTION_MISALIGNMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSTANCE_NOT_AVAILABLE:
- reason = "STATUS_INSTANCE_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_NOT_AVAILABLE:
- reason = "STATUS_PIPE_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PIPE_STATE:
- reason = "STATUS_INVALID_PIPE_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_BUSY:
- reason = "STATUS_PIPE_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILLEGAL_FUNCTION:
- reason = "STATUS_ILLEGAL_FUNCTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_DISCONNECTED:
- reason = "STATUS_PIPE_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_CLOSING:
- reason = "STATUS_PIPE_CLOSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_CONNECTED:
- reason = "STATUS_PIPE_CONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_LISTENING:
- reason = "STATUS_PIPE_LISTENING";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_READ_MODE:
- reason = "STATUS_INVALID_READ_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_TIMEOUT:
- reason = "STATUS_IO_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_FORCED_CLOSED:
- reason = "STATUS_FILE_FORCED_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STARTED:
- reason = "STATUS_PROFILING_NOT_STARTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROFILING_NOT_STOPPED:
- reason = "STATUS_PROFILING_NOT_STOPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_COULD_NOT_INTERPRET:
- reason = "STATUS_COULD_NOT_INTERPRET";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_IS_A_DIRECTORY:
- reason = "STATUS_FILE_IS_A_DIRECTORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED:
- reason = "STATUS_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_NOT_LISTENING:
- reason = "STATUS_REMOTE_NOT_LISTENING";
- break;
- case MD_NTSTATUS_WIN_STATUS_DUPLICATE_NAME:
- reason = "STATUS_DUPLICATE_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_PATH:
- reason = "STATUS_BAD_NETWORK_PATH";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_BUSY:
- reason = "STATUS_NETWORK_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_DOES_NOT_EXIST:
- reason = "STATUS_DEVICE_DOES_NOT_EXIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_COMMANDS:
- reason = "STATUS_TOO_MANY_COMMANDS";
- break;
- case MD_NTSTATUS_WIN_STATUS_ADAPTER_HARDWARE_ERROR:
- reason = "STATUS_ADAPTER_HARDWARE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_NETWORK_RESPONSE:
- reason = "STATUS_INVALID_NETWORK_RESPONSE";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNEXPECTED_NETWORK_ERROR:
- reason = "STATUS_UNEXPECTED_NETWORK_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_REMOTE_ADAPTER:
- reason = "STATUS_BAD_REMOTE_ADAPTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_PRINT_QUEUE_FULL:
- reason = "STATUS_PRINT_QUEUE_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SPOOL_SPACE:
- reason = "STATUS_NO_SPOOL_SPACE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PRINT_CANCELLED:
- reason = "STATUS_PRINT_CANCELLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_NAME_DELETED:
- reason = "STATUS_NETWORK_NAME_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_ACCESS_DENIED:
- reason = "STATUS_NETWORK_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_DEVICE_TYPE:
- reason = "STATUS_BAD_DEVICE_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_NETWORK_NAME:
- reason = "STATUS_BAD_NETWORK_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_NAMES:
- reason = "STATUS_TOO_MANY_NAMES";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_SESSIONS:
- reason = "STATUS_TOO_MANY_SESSIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHARING_PAUSED:
- reason = "STATUS_SHARING_PAUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REQUEST_NOT_ACCEPTED:
- reason = "STATUS_REQUEST_NOT_ACCEPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REDIRECTOR_PAUSED:
- reason = "STATUS_REDIRECTOR_PAUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NET_WRITE_FAULT:
- reason = "STATUS_NET_WRITE_FAULT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROFILING_AT_LIMIT:
- reason = "STATUS_PROFILING_AT_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SAME_DEVICE:
- reason = "STATUS_NOT_SAME_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_RENAMED:
- reason = "STATUS_FILE_RENAMED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTUAL_CIRCUIT_CLOSED:
- reason = "STATUS_VIRTUAL_CIRCUIT_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SECURITY_ON_OBJECT:
- reason = "STATUS_NO_SECURITY_ON_OBJECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_WAIT:
- reason = "STATUS_CANT_WAIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_EMPTY:
- reason = "STATUS_PIPE_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_ACCESS_DOMAIN_INFO:
- reason = "STATUS_CANT_ACCESS_DOMAIN_INFO";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_TERMINATE_SELF:
- reason = "STATUS_CANT_TERMINATE_SELF";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SERVER_STATE:
- reason = "STATUS_INVALID_SERVER_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_STATE:
- reason = "STATUS_INVALID_DOMAIN_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_DOMAIN_ROLE:
- reason = "STATUS_INVALID_DOMAIN_ROLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_DOMAIN:
- reason = "STATUS_NO_SUCH_DOMAIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DOMAIN_EXISTS:
- reason = "STATUS_DOMAIN_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DOMAIN_LIMIT_EXCEEDED:
- reason = "STATUS_DOMAIN_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OPLOCK_NOT_GRANTED:
- reason = "STATUS_OPLOCK_NOT_GRANTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_OPLOCK_PROTOCOL:
- reason = "STATUS_INVALID_OPLOCK_PROTOCOL";
- break;
- case MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_CORRUPTION:
- reason = "STATUS_INTERNAL_DB_CORRUPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INTERNAL_ERROR:
- reason = "STATUS_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GENERIC_NOT_MAPPED:
- reason = "STATUS_GENERIC_NOT_MAPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_DESCRIPTOR_FORMAT:
- reason = "STATUS_BAD_DESCRIPTOR_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_USER_BUFFER:
- reason = "STATUS_INVALID_USER_BUFFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNEXPECTED_IO_ERROR:
- reason = "STATUS_UNEXPECTED_IO_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_CREATE_ERR:
- reason = "STATUS_UNEXPECTED_MM_CREATE_ERR";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_MAP_ERROR:
- reason = "STATUS_UNEXPECTED_MM_MAP_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNEXPECTED_MM_EXTEND_ERR:
- reason = "STATUS_UNEXPECTED_MM_EXTEND_ERR";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_LOGON_PROCESS:
- reason = "STATUS_NOT_LOGON_PROCESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_EXISTS:
- reason = "STATUS_LOGON_SESSION_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_1:
- reason = "STATUS_INVALID_PARAMETER_1";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_2:
- reason = "STATUS_INVALID_PARAMETER_2";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_3:
- reason = "STATUS_INVALID_PARAMETER_3";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_4:
- reason = "STATUS_INVALID_PARAMETER_4";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_5:
- reason = "STATUS_INVALID_PARAMETER_5";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_6:
- reason = "STATUS_INVALID_PARAMETER_6";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_7:
- reason = "STATUS_INVALID_PARAMETER_7";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_8:
- reason = "STATUS_INVALID_PARAMETER_8";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_9:
- reason = "STATUS_INVALID_PARAMETER_9";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_10:
- reason = "STATUS_INVALID_PARAMETER_10";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_11:
- reason = "STATUS_INVALID_PARAMETER_11";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PARAMETER_12:
- reason = "STATUS_INVALID_PARAMETER_12";
- break;
- case MD_NTSTATUS_WIN_STATUS_REDIRECTOR_NOT_STARTED:
- reason = "STATUS_REDIRECTOR_NOT_STARTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REDIRECTOR_STARTED:
- reason = "STATUS_REDIRECTOR_STARTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW:
- reason = "STATUS_STACK_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_PACKAGE:
- reason = "STATUS_NO_SUCH_PACKAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_FUNCTION_TABLE:
- reason = "STATUS_BAD_FUNCTION_TABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VARIABLE_NOT_FOUND:
- reason = "STATUS_VARIABLE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_EMPTY:
- reason = "STATUS_DIRECTORY_NOT_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_CORRUPT_ERROR:
- reason = "STATUS_FILE_CORRUPT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_A_DIRECTORY:
- reason = "STATUS_NOT_A_DIRECTORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_LOGON_SESSION_STATE:
- reason = "STATUS_BAD_LOGON_SESSION_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGON_SESSION_COLLISION:
- reason = "STATUS_LOGON_SESSION_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NAME_TOO_LONG:
- reason = "STATUS_NAME_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILES_OPEN:
- reason = "STATUS_FILES_OPEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_IN_USE:
- reason = "STATUS_CONNECTION_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_MESSAGE_NOT_FOUND:
- reason = "STATUS_MESSAGE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROCESS_IS_TERMINATING:
- reason = "STATUS_PROCESS_IS_TERMINATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LOGON_TYPE:
- reason = "STATUS_INVALID_LOGON_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_GUID_TRANSLATION:
- reason = "STATUS_NO_GUID_TRANSLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_IMPERSONATE:
- reason = "STATUS_CANNOT_IMPERSONATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED:
- reason = "STATUS_IMAGE_ALREADY_LOADED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_PRESENT:
- reason = "STATUS_ABIOS_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_LID_NOT_EXIST:
- reason = "STATUS_ABIOS_LID_NOT_EXIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_LID_ALREADY_OWNED:
- reason = "STATUS_ABIOS_LID_ALREADY_OWNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_NOT_LID_OWNER:
- reason = "STATUS_ABIOS_NOT_LID_OWNER";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_COMMAND:
- reason = "STATUS_ABIOS_INVALID_COMMAND";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_LID:
- reason = "STATUS_ABIOS_INVALID_LID";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_SELECTOR_NOT_AVAILABLE:
- reason = "STATUS_ABIOS_SELECTOR_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ABIOS_INVALID_SELECTOR:
- reason = "STATUS_ABIOS_INVALID_SELECTOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_LDT:
- reason = "STATUS_NO_LDT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LDT_SIZE:
- reason = "STATUS_INVALID_LDT_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LDT_OFFSET:
- reason = "STATUS_INVALID_LDT_OFFSET";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LDT_DESCRIPTOR:
- reason = "STATUS_INVALID_LDT_DESCRIPTOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NE_FORMAT:
- reason = "STATUS_INVALID_IMAGE_NE_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_RXACT_INVALID_STATE:
- reason = "STATUS_RXACT_INVALID_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_RXACT_COMMIT_FAILURE:
- reason = "STATUS_RXACT_COMMIT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_MAPPED_FILE_SIZE_ZERO:
- reason = "STATUS_MAPPED_FILE_SIZE_ZERO";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_OPENED_FILES:
- reason = "STATUS_TOO_MANY_OPENED_FILES";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANCELLED:
- reason = "STATUS_CANCELLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_DELETE:
- reason = "STATUS_CANNOT_DELETE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_COMPUTER_NAME:
- reason = "STATUS_INVALID_COMPUTER_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_DELETED:
- reason = "STATUS_FILE_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPECIAL_ACCOUNT:
- reason = "STATUS_SPECIAL_ACCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPECIAL_GROUP:
- reason = "STATUS_SPECIAL_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPECIAL_USER:
- reason = "STATUS_SPECIAL_USER";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEMBERS_PRIMARY_GROUP:
- reason = "STATUS_MEMBERS_PRIMARY_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_CLOSED:
- reason = "STATUS_FILE_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_THREADS:
- reason = "STATUS_TOO_MANY_THREADS";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_PROCESS:
- reason = "STATUS_THREAD_NOT_IN_PROCESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOKEN_ALREADY_IN_USE:
- reason = "STATUS_TOKEN_ALREADY_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PAGEFILE_QUOTA_EXCEEDED:
- reason = "STATUS_PAGEFILE_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_COMMITMENT_LIMIT:
- reason = "STATUS_COMMITMENT_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_LE_FORMAT:
- reason = "STATUS_INVALID_IMAGE_LE_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_NOT_MZ:
- reason = "STATUS_INVALID_IMAGE_NOT_MZ";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_PROTECT:
- reason = "STATUS_INVALID_IMAGE_PROTECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_16:
- reason = "STATUS_INVALID_IMAGE_WIN_16";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGON_SERVER_CONFLICT:
- reason = "STATUS_LOGON_SERVER_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TIME_DIFFERENCE_AT_DC:
- reason = "STATUS_TIME_DIFFERENCE_AT_DC";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYNCHRONIZATION_REQUIRED:
- reason = "STATUS_SYNCHRONIZATION_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DLL_NOT_FOUND:
- reason = "STATUS_DLL_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_OPEN_FAILED:
- reason = "STATUS_OPEN_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_PRIVILEGE_FAILED:
- reason = "STATUS_IO_PRIVILEGE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ORDINAL_NOT_FOUND:
- reason = "STATUS_ORDINAL_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_ENTRYPOINT_NOT_FOUND:
- reason = "STATUS_ENTRYPOINT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONTROL_C_EXIT:
- reason = "STATUS_CONTROL_C_EXIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOCAL_DISCONNECT:
- reason = "STATUS_LOCAL_DISCONNECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_DISCONNECT:
- reason = "STATUS_REMOTE_DISCONNECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_RESOURCES:
- reason = "STATUS_REMOTE_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_LINK_FAILED:
- reason = "STATUS_LINK_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LINK_TIMEOUT:
- reason = "STATUS_LINK_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_CONNECTION:
- reason = "STATUS_INVALID_CONNECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS:
- reason = "STATUS_INVALID_ADDRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED:
- reason = "STATUS_DLL_INIT_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MISSING_SYSTEMFILE:
- reason = "STATUS_MISSING_SYSTEMFILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNHANDLED_EXCEPTION:
- reason = "STATUS_UNHANDLED_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_APP_INIT_FAILURE:
- reason = "STATUS_APP_INIT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PAGEFILE_CREATE_FAILED:
- reason = "STATUS_PAGEFILE_CREATE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_PAGEFILE:
- reason = "STATUS_NO_PAGEFILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LEVEL:
- reason = "STATUS_INVALID_LEVEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_WRONG_PASSWORD_CORE:
- reason = "STATUS_WRONG_PASSWORD_CORE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILLEGAL_FLOAT_CONTEXT:
- reason = "STATUS_ILLEGAL_FLOAT_CONTEXT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PIPE_BROKEN:
- reason = "STATUS_PIPE_BROKEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_REGISTRY_CORRUPT:
- reason = "STATUS_REGISTRY_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REGISTRY_IO_FAILED:
- reason = "STATUS_REGISTRY_IO_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_EVENT_PAIR:
- reason = "STATUS_NO_EVENT_PAIR";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNRECOGNIZED_VOLUME:
- reason = "STATUS_UNRECOGNIZED_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_SERIAL_NO_DEVICE_INITED:
- reason = "STATUS_SERIAL_NO_DEVICE_INITED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_ALIAS:
- reason = "STATUS_NO_SUCH_ALIAS";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEMBER_NOT_IN_ALIAS:
- reason = "STATUS_MEMBER_NOT_IN_ALIAS";
- break;
- case MD_NTSTATUS_WIN_STATUS_MEMBER_IN_ALIAS:
- reason = "STATUS_MEMBER_IN_ALIAS";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALIAS_EXISTS:
- reason = "STATUS_ALIAS_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGON_NOT_GRANTED:
- reason = "STATUS_LOGON_NOT_GRANTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_SECRETS:
- reason = "STATUS_TOO_MANY_SECRETS";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECRET_TOO_LONG:
- reason = "STATUS_SECRET_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_INTERNAL_DB_ERROR:
- reason = "STATUS_INTERNAL_DB_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FULLSCREEN_MODE:
- reason = "STATUS_FULLSCREEN_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_CONTEXT_IDS:
- reason = "STATUS_TOO_MANY_CONTEXT_IDS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGON_TYPE_NOT_GRANTED:
- reason = "STATUS_LOGON_TYPE_NOT_GRANTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_REGISTRY_FILE:
- reason = "STATUS_NOT_REGISTRY_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NT_CROSS_ENCRYPTION_REQUIRED:
- reason = "STATUS_NT_CROSS_ENCRYPTION_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DOMAIN_CTRLR_CONFIG_ERROR:
- reason = "STATUS_DOMAIN_CTRLR_CONFIG_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FT_MISSING_MEMBER:
- reason = "STATUS_FT_MISSING_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILL_FORMED_SERVICE_ENTRY:
- reason = "STATUS_ILL_FORMED_SERVICE_ENTRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILLEGAL_CHARACTER:
- reason = "STATUS_ILLEGAL_CHARACTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNMAPPABLE_CHARACTER:
- reason = "STATUS_UNMAPPABLE_CHARACTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNDEFINED_CHARACTER:
- reason = "STATUS_UNDEFINED_CHARACTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOPPY_VOLUME:
- reason = "STATUS_FLOPPY_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOPPY_ID_MARK_NOT_FOUND:
- reason = "STATUS_FLOPPY_ID_MARK_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOPPY_WRONG_CYLINDER:
- reason = "STATUS_FLOPPY_WRONG_CYLINDER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOPPY_UNKNOWN_ERROR:
- reason = "STATUS_FLOPPY_UNKNOWN_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOPPY_BAD_REGISTERS:
- reason = "STATUS_FLOPPY_BAD_REGISTERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_RECALIBRATE_FAILED:
- reason = "STATUS_DISK_RECALIBRATE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_OPERATION_FAILED:
- reason = "STATUS_DISK_OPERATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_RESET_FAILED:
- reason = "STATUS_DISK_RESET_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHARED_IRQ_BUSY:
- reason = "STATUS_SHARED_IRQ_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FT_ORPHANING:
- reason = "STATUS_FT_ORPHANING";
- break;
- case MD_NTSTATUS_WIN_STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT:
- reason = "STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PARTITION_FAILURE:
- reason = "STATUS_PARTITION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_BLOCK_LENGTH:
- reason = "STATUS_INVALID_BLOCK_LENGTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_NOT_PARTITIONED:
- reason = "STATUS_DEVICE_NOT_PARTITIONED";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNABLE_TO_LOCK_MEDIA:
- reason = "STATUS_UNABLE_TO_LOCK_MEDIA";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNABLE_TO_UNLOAD_MEDIA:
- reason = "STATUS_UNABLE_TO_UNLOAD_MEDIA";
- break;
- case MD_NTSTATUS_WIN_STATUS_EOM_OVERFLOW:
- reason = "STATUS_EOM_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_MEDIA:
- reason = "STATUS_NO_MEDIA";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SUCH_MEMBER:
- reason = "STATUS_NO_SUCH_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_MEMBER:
- reason = "STATUS_INVALID_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_KEY_DELETED:
- reason = "STATUS_KEY_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_LOG_SPACE:
- reason = "STATUS_NO_LOG_SPACE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_SIDS:
- reason = "STATUS_TOO_MANY_SIDS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LM_CROSS_ENCRYPTION_REQUIRED:
- reason = "STATUS_LM_CROSS_ENCRYPTION_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_KEY_HAS_CHILDREN:
- reason = "STATUS_KEY_HAS_CHILDREN";
- break;
- case MD_NTSTATUS_WIN_STATUS_CHILD_MUST_BE_VOLATILE:
- reason = "STATUS_CHILD_MUST_BE_VOLATILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_CONFIGURATION_ERROR:
- reason = "STATUS_DEVICE_CONFIGURATION_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_INTERNAL_ERROR:
- reason = "STATUS_DRIVER_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_STATE:
- reason = "STATUS_INVALID_DEVICE_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_DEVICE_ERROR:
- reason = "STATUS_IO_DEVICE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_PROTOCOL_ERROR:
- reason = "STATUS_DEVICE_PROTOCOL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_BACKUP_CONTROLLER:
- reason = "STATUS_BACKUP_CONTROLLER";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_FILE_FULL:
- reason = "STATUS_LOG_FILE_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_LATE:
- reason = "STATUS_TOO_LATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_TRUST_LSA_SECRET:
- reason = "STATUS_NO_TRUST_LSA_SECRET";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_TRUST_SAM_ACCOUNT:
- reason = "STATUS_NO_TRUST_SAM_ACCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRUSTED_DOMAIN_FAILURE:
- reason = "STATUS_TRUSTED_DOMAIN_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRUSTED_RELATIONSHIP_FAILURE:
- reason = "STATUS_TRUSTED_RELATIONSHIP_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CORRUPT:
- reason = "STATUS_EVENTLOG_FILE_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_EVENTLOG_CANT_START:
- reason = "STATUS_EVENTLOG_CANT_START";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRUST_FAILURE:
- reason = "STATUS_TRUST_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUTANT_LIMIT_EXCEEDED:
- reason = "STATUS_MUTANT_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETLOGON_NOT_STARTED:
- reason = "STATUS_NETLOGON_NOT_STARTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCOUNT_EXPIRED:
- reason = "STATUS_ACCOUNT_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_POSSIBLE_DEADLOCK:
- reason = "STATUS_POSSIBLE_DEADLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_CREDENTIAL_CONFLICT:
- reason = "STATUS_NETWORK_CREDENTIAL_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_SESSION_LIMIT:
- reason = "STATUS_REMOTE_SESSION_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_EVENTLOG_FILE_CHANGED:
- reason = "STATUS_EVENTLOG_FILE_CHANGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT:
- reason = "STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT:
- reason = "STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOLOGON_SERVER_TRUST_ACCOUNT:
- reason = "STATUS_NOLOGON_SERVER_TRUST_ACCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_DOMAIN_TRUST_INCONSISTENT:
- reason = "STATUS_DOMAIN_TRUST_INCONSISTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FS_DRIVER_REQUIRED:
- reason = "STATUS_FS_DRIVER_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMAGE_ALREADY_LOADED_AS_DLL:
- reason = "STATUS_IMAGE_ALREADY_LOADED_AS_DLL";
- break;
- case MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING:
- reason = "STATUS_INCOMPATIBLE_WITH_GLOBAL_SHORT_NAME_REGISTRY_SETTING";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME:
- reason = "STATUS_SHORT_NAMES_NOT_ENABLED_ON_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECURITY_STREAM_IS_INCONSISTENT:
- reason = "STATUS_SECURITY_STREAM_IS_INCONSISTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LOCK_RANGE:
- reason = "STATUS_INVALID_LOCK_RANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ACE_CONDITION:
- reason = "STATUS_INVALID_ACE_CONDITION";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT:
- reason = "STATUS_IMAGE_SUBSYSTEM_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOTIFICATION_GUID_ALREADY_DEFINED:
- reason = "STATUS_NOTIFICATION_GUID_ALREADY_DEFINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_EXCEPTION_HANDLER:
- reason = "STATUS_INVALID_EXCEPTION_HANDLER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DUPLICATE_PRIVILEGES:
- reason = "STATUS_DUPLICATE_PRIVILEGES";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_ALLOWED_ON_SYSTEM_FILE:
- reason = "STATUS_NOT_ALLOWED_ON_SYSTEM_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REPAIR_NEEDED:
- reason = "STATUS_REPAIR_NEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_QUOTA_NOT_ENABLED:
- reason = "STATUS_QUOTA_NOT_ENABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_APPLICATION_PACKAGE:
- reason = "STATUS_NO_APPLICATION_PACKAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_OPEN_RESTRICTION:
- reason = "STATUS_NETWORK_OPEN_RESTRICTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_USER_SESSION_KEY:
- reason = "STATUS_NO_USER_SESSION_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_USER_SESSION_DELETED:
- reason = "STATUS_USER_SESSION_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_LANG_NOT_FOUND:
- reason = "STATUS_RESOURCE_LANG_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSUFF_SERVER_RESOURCES:
- reason = "STATUS_INSUFF_SERVER_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_BUFFER_SIZE:
- reason = "STATUS_INVALID_BUFFER_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_COMPONENT:
- reason = "STATUS_INVALID_ADDRESS_COMPONENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_ADDRESS_WILDCARD:
- reason = "STATUS_INVALID_ADDRESS_WILDCARD";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_ADDRESSES:
- reason = "STATUS_TOO_MANY_ADDRESSES";
- break;
- case MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_EXISTS:
- reason = "STATUS_ADDRESS_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_ADDRESS_CLOSED:
- reason = "STATUS_ADDRESS_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_DISCONNECTED:
- reason = "STATUS_CONNECTION_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_RESET:
- reason = "STATUS_CONNECTION_RESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_NODES:
- reason = "STATUS_TOO_MANY_NODES";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_ABORTED:
- reason = "STATUS_TRANSACTION_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_TIMED_OUT:
- reason = "STATUS_TRANSACTION_TIMED_OUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_RELEASE:
- reason = "STATUS_TRANSACTION_NO_RELEASE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_MATCH:
- reason = "STATUS_TRANSACTION_NO_MATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONDED:
- reason = "STATUS_TRANSACTION_RESPONDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_ID:
- reason = "STATUS_TRANSACTION_INVALID_ID";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_TYPE:
- reason = "STATUS_TRANSACTION_INVALID_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SERVER_SESSION:
- reason = "STATUS_NOT_SERVER_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_CLIENT_SESSION:
- reason = "STATUS_NOT_CLIENT_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_LOAD_REGISTRY_FILE:
- reason = "STATUS_CANNOT_LOAD_REGISTRY_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEBUG_ATTACH_FAILED:
- reason = "STATUS_DEBUG_ATTACH_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYSTEM_PROCESS_TERMINATED:
- reason = "STATUS_SYSTEM_PROCESS_TERMINATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DATA_NOT_ACCEPTED:
- reason = "STATUS_DATA_NOT_ACCEPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_BROWSER_SERVERS_FOUND:
- reason = "STATUS_NO_BROWSER_SERVERS_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_VDM_HARD_ERROR:
- reason = "STATUS_VDM_HARD_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_CANCEL_TIMEOUT:
- reason = "STATUS_DRIVER_CANCEL_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REPLY_MESSAGE_MISMATCH:
- reason = "STATUS_REPLY_MESSAGE_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_MAPPED_ALIGNMENT:
- reason = "STATUS_MAPPED_ALIGNMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMAGE_CHECKSUM_MISMATCH:
- reason = "STATUS_IMAGE_CHECKSUM_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA:
- reason = "STATUS_LOST_WRITEBEHIND_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLIENT_SERVER_PARAMETERS_INVALID:
- reason = "STATUS_CLIENT_SERVER_PARAMETERS_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_PASSWORD_MUST_CHANGE:
- reason = "STATUS_PASSWORD_MUST_CHANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_FOUND:
- reason = "STATUS_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_TINY_STREAM:
- reason = "STATUS_NOT_TINY_STREAM";
- break;
- case MD_NTSTATUS_WIN_STATUS_RECOVERY_FAILURE:
- reason = "STATUS_RECOVERY_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_STACK_OVERFLOW_READ:
- reason = "STATUS_STACK_OVERFLOW_READ";
- break;
- case MD_NTSTATUS_WIN_STATUS_FAIL_CHECK:
- reason = "STATUS_FAIL_CHECK";
- break;
- case MD_NTSTATUS_WIN_STATUS_DUPLICATE_OBJECTID:
- reason = "STATUS_DUPLICATE_OBJECTID";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECTID_EXISTS:
- reason = "STATUS_OBJECTID_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONVERT_TO_LARGE:
- reason = "STATUS_CONVERT_TO_LARGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_RETRY:
- reason = "STATUS_RETRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FOUND_OUT_OF_SCOPE:
- reason = "STATUS_FOUND_OUT_OF_SCOPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALLOCATE_BUCKET:
- reason = "STATUS_ALLOCATE_BUCKET";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROPSET_NOT_FOUND:
- reason = "STATUS_PROPSET_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_MARSHALL_OVERFLOW:
- reason = "STATUS_MARSHALL_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_VARIANT:
- reason = "STATUS_INVALID_VARIANT";
- break;
- case MD_NTSTATUS_WIN_STATUS_DOMAIN_CONTROLLER_NOT_FOUND:
- reason = "STATUS_DOMAIN_CONTROLLER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCOUNT_LOCKED_OUT:
- reason = "STATUS_ACCOUNT_LOCKED_OUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_HANDLE_NOT_CLOSABLE:
- reason = "STATUS_HANDLE_NOT_CLOSABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_REFUSED:
- reason = "STATUS_CONNECTION_REFUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRACEFUL_DISCONNECT:
- reason = "STATUS_GRACEFUL_DISCONNECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_ADDRESS_ALREADY_ASSOCIATED:
- reason = "STATUS_ADDRESS_ALREADY_ASSOCIATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ADDRESS_NOT_ASSOCIATED:
- reason = "STATUS_ADDRESS_NOT_ASSOCIATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_INVALID:
- reason = "STATUS_CONNECTION_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_ACTIVE:
- reason = "STATUS_CONNECTION_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_UNREACHABLE:
- reason = "STATUS_NETWORK_UNREACHABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HOST_UNREACHABLE:
- reason = "STATUS_HOST_UNREACHABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROTOCOL_UNREACHABLE:
- reason = "STATUS_PROTOCOL_UNREACHABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_UNREACHABLE:
- reason = "STATUS_PORT_UNREACHABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REQUEST_ABORTED:
- reason = "STATUS_REQUEST_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_ABORTED:
- reason = "STATUS_CONNECTION_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_COMPRESSION_BUFFER:
- reason = "STATUS_BAD_COMPRESSION_BUFFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_USER_MAPPED_FILE:
- reason = "STATUS_USER_MAPPED_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_AUDIT_FAILED:
- reason = "STATUS_AUDIT_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TIMER_RESOLUTION_NOT_SET:
- reason = "STATUS_TIMER_RESOLUTION_NOT_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONNECTION_COUNT_LIMIT:
- reason = "STATUS_CONNECTION_COUNT_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGIN_TIME_RESTRICTION:
- reason = "STATUS_LOGIN_TIME_RESTRICTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOGIN_WKSTA_RESTRICTION:
- reason = "STATUS_LOGIN_WKSTA_RESTRICTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMAGE_MP_UP_MISMATCH:
- reason = "STATUS_IMAGE_MP_UP_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_LOGON_INFO:
- reason = "STATUS_INSUFFICIENT_LOGON_INFO";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_DLL_ENTRYPOINT:
- reason = "STATUS_BAD_DLL_ENTRYPOINT";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_SERVICE_ENTRYPOINT:
- reason = "STATUS_BAD_SERVICE_ENTRYPOINT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LPC_REPLY_LOST:
- reason = "STATUS_LPC_REPLY_LOST";
- break;
- case MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT1:
- reason = "STATUS_IP_ADDRESS_CONFLICT1";
- break;
- case MD_NTSTATUS_WIN_STATUS_IP_ADDRESS_CONFLICT2:
- reason = "STATUS_IP_ADDRESS_CONFLICT2";
- break;
- case MD_NTSTATUS_WIN_STATUS_REGISTRY_QUOTA_LIMIT:
- reason = "STATUS_REGISTRY_QUOTA_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PATH_NOT_COVERED:
- reason = "STATUS_PATH_NOT_COVERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_CALLBACK_ACTIVE:
- reason = "STATUS_NO_CALLBACK_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LICENSE_QUOTA_EXCEEDED:
- reason = "STATUS_LICENSE_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PWD_TOO_SHORT:
- reason = "STATUS_PWD_TOO_SHORT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PWD_TOO_RECENT:
- reason = "STATUS_PWD_TOO_RECENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PWD_HISTORY_CONFLICT:
- reason = "STATUS_PWD_HISTORY_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PLUGPLAY_NO_DEVICE:
- reason = "STATUS_PLUGPLAY_NO_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_COMPRESSION:
- reason = "STATUS_UNSUPPORTED_COMPRESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_HW_PROFILE:
- reason = "STATUS_INVALID_HW_PROFILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PLUGPLAY_DEVICE_PATH:
- reason = "STATUS_INVALID_PLUGPLAY_DEVICE_PATH";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_ORDINAL_NOT_FOUND:
- reason = "STATUS_DRIVER_ORDINAL_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_ENTRYPOINT_NOT_FOUND:
- reason = "STATUS_DRIVER_ENTRYPOINT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_NOT_OWNED:
- reason = "STATUS_RESOURCE_NOT_OWNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_LINKS:
- reason = "STATUS_TOO_MANY_LINKS";
- break;
- case MD_NTSTATUS_WIN_STATUS_QUOTA_LIST_INCONSISTENT:
- reason = "STATUS_QUOTA_LIST_INCONSISTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_IS_OFFLINE:
- reason = "STATUS_FILE_IS_OFFLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_EVALUATION_EXPIRATION:
- reason = "STATUS_EVALUATION_EXPIRATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILLEGAL_DLL_RELOCATION:
- reason = "STATUS_ILLEGAL_DLL_RELOCATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_LICENSE_VIOLATION:
- reason = "STATUS_LICENSE_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_DLL_INIT_FAILED_LOGOFF:
- reason = "STATUS_DLL_INIT_FAILED_LOGOFF";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_UNABLE_TO_LOAD:
- reason = "STATUS_DRIVER_UNABLE_TO_LOAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_DFS_UNAVAILABLE:
- reason = "STATUS_DFS_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLUME_DISMOUNTED:
- reason = "STATUS_VOLUME_DISMOUNTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_WX86_INTERNAL_ERROR:
- reason = "STATUS_WX86_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_WX86_FLOAT_STACK_CHECK:
- reason = "STATUS_WX86_FLOAT_STACK_CHECK";
- break;
- case MD_NTSTATUS_WIN_STATUS_VALIDATE_CONTINUE:
- reason = "STATUS_VALIDATE_CONTINUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_MATCH:
- reason = "STATUS_NO_MATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_MORE_MATCHES:
- reason = "STATUS_NO_MORE_MATCHES";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_A_REPARSE_POINT:
- reason = "STATUS_NOT_A_REPARSE_POINT";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_INVALID:
- reason = "STATUS_IO_REPARSE_TAG_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_MISMATCH:
- reason = "STATUS_IO_REPARSE_TAG_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_REPARSE_DATA_INVALID:
- reason = "STATUS_IO_REPARSE_DATA_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_REPARSE_TAG_NOT_HANDLED:
- reason = "STATUS_IO_REPARSE_TAG_NOT_HANDLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PWD_TOO_LONG:
- reason = "STATUS_PWD_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_STOWED_EXCEPTION:
- reason = "STATUS_STOWED_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_REPARSE_POINT_NOT_RESOLVED:
- reason = "STATUS_REPARSE_POINT_NOT_RESOLVED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DIRECTORY_IS_A_REPARSE_POINT:
- reason = "STATUS_DIRECTORY_IS_A_REPARSE_POINT";
- break;
- case MD_NTSTATUS_WIN_STATUS_RANGE_LIST_CONFLICT:
- reason = "STATUS_RANGE_LIST_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SOURCE_ELEMENT_EMPTY:
- reason = "STATUS_SOURCE_ELEMENT_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DESTINATION_ELEMENT_FULL:
- reason = "STATUS_DESTINATION_ELEMENT_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_ILLEGAL_ELEMENT_ADDRESS:
- reason = "STATUS_ILLEGAL_ELEMENT_ADDRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_MAGAZINE_NOT_PRESENT:
- reason = "STATUS_MAGAZINE_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REINITIALIZATION_NEEDED:
- reason = "STATUS_REINITIALIZATION_NEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ENCRYPTION_FAILED:
- reason = "STATUS_ENCRYPTION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DECRYPTION_FAILED:
- reason = "STATUS_DECRYPTION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RANGE_NOT_FOUND:
- reason = "STATUS_RANGE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_RECOVERY_POLICY:
- reason = "STATUS_NO_RECOVERY_POLICY";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_EFS:
- reason = "STATUS_NO_EFS";
- break;
- case MD_NTSTATUS_WIN_STATUS_WRONG_EFS:
- reason = "STATUS_WRONG_EFS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_USER_KEYS:
- reason = "STATUS_NO_USER_KEYS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_NOT_ENCRYPTED:
- reason = "STATUS_FILE_NOT_ENCRYPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_EXPORT_FORMAT:
- reason = "STATUS_NOT_EXPORT_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_ENCRYPTED:
- reason = "STATUS_FILE_ENCRYPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_GUID_NOT_FOUND:
- reason = "STATUS_WMI_GUID_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_INSTANCE_NOT_FOUND:
- reason = "STATUS_WMI_INSTANCE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_ITEMID_NOT_FOUND:
- reason = "STATUS_WMI_ITEMID_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_TRY_AGAIN:
- reason = "STATUS_WMI_TRY_AGAIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHARED_POLICY:
- reason = "STATUS_SHARED_POLICY";
- break;
- case MD_NTSTATUS_WIN_STATUS_POLICY_OBJECT_NOT_FOUND:
- reason = "STATUS_POLICY_OBJECT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_POLICY_ONLY_IN_DS:
- reason = "STATUS_POLICY_ONLY_IN_DS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLUME_NOT_UPGRADED:
- reason = "STATUS_VOLUME_NOT_UPGRADED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_NOT_ACTIVE:
- reason = "STATUS_REMOTE_STORAGE_NOT_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_STORAGE_MEDIA_ERROR:
- reason = "STATUS_REMOTE_STORAGE_MEDIA_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_TRACKING_SERVICE:
- reason = "STATUS_NO_TRACKING_SERVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SERVER_SID_MISMATCH:
- reason = "STATUS_SERVER_SID_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NO_ATTRIBUTE_OR_VALUE:
- reason = "STATUS_DS_NO_ATTRIBUTE_OR_VALUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_INVALID_ATTRIBUTE_SYNTAX:
- reason = "STATUS_DS_INVALID_ATTRIBUTE_SYNTAX";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED:
- reason = "STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS:
- reason = "STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_BUSY:
- reason = "STATUS_DS_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_UNAVAILABLE:
- reason = "STATUS_DS_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NO_RIDS_ALLOCATED:
- reason = "STATUS_DS_NO_RIDS_ALLOCATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NO_MORE_RIDS:
- reason = "STATUS_DS_NO_MORE_RIDS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_INCORRECT_ROLE_OWNER:
- reason = "STATUS_DS_INCORRECT_ROLE_OWNER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_INIT_ERROR:
- reason = "STATUS_DS_RIDMGR_INIT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_OBJ_CLASS_VIOLATION:
- reason = "STATUS_DS_OBJ_CLASS_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_NON_LEAF:
- reason = "STATUS_DS_CANT_ON_NON_LEAF";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_CANT_ON_RDN:
- reason = "STATUS_DS_CANT_ON_RDN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_OBJ_CLASS:
- reason = "STATUS_DS_CANT_MOD_OBJ_CLASS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_CROSS_DOM_MOVE_FAILED:
- reason = "STATUS_DS_CROSS_DOM_MOVE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_GC_NOT_AVAILABLE:
- reason = "STATUS_DS_GC_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DIRECTORY_SERVICE_REQUIRED:
- reason = "STATUS_DIRECTORY_SERVICE_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REPARSE_ATTRIBUTE_CONFLICT:
- reason = "STATUS_REPARSE_ATTRIBUTE_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_ENABLE_DENY_ONLY:
- reason = "STATUS_CANT_ENABLE_DENY_ONLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_FAULTS:
- reason = "STATUS_FLOAT_MULTIPLE_FAULTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOAT_MULTIPLE_TRAPS:
- reason = "STATUS_FLOAT_MULTIPLE_TRAPS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_REMOVED:
- reason = "STATUS_DEVICE_REMOVED";
- break;
- case MD_NTSTATUS_WIN_STATUS_JOURNAL_DELETE_IN_PROGRESS:
- reason = "STATUS_JOURNAL_DELETE_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_JOURNAL_NOT_ACTIVE:
- reason = "STATUS_JOURNAL_NOT_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOINTERFACE:
- reason = "STATUS_NOINTERFACE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_RIDMGR_DISABLED:
- reason = "STATUS_DS_RIDMGR_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_ADMIN_LIMIT_EXCEEDED:
- reason = "STATUS_DS_ADMIN_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_SLEEP:
- reason = "STATUS_DRIVER_FAILED_SLEEP";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUTUAL_AUTHENTICATION_FAILED:
- reason = "STATUS_MUTUAL_AUTHENTICATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_SYSTEM_FILE:
- reason = "STATUS_CORRUPT_SYSTEM_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DATATYPE_MISALIGNMENT_ERROR:
- reason = "STATUS_DATATYPE_MISALIGNMENT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_READ_ONLY:
- reason = "STATUS_WMI_READ_ONLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_SET_FAILURE:
- reason = "STATUS_WMI_SET_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_COMMITMENT_MINIMUM:
- reason = "STATUS_COMMITMENT_MINIMUM";
- break;
- case MD_NTSTATUS_WIN_STATUS_REG_NAT_CONSUMPTION:
- reason = "STATUS_REG_NAT_CONSUMPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSPORT_FULL:
- reason = "STATUS_TRANSPORT_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE:
- reason = "STATUS_DS_SAM_INIT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ONLY_IF_CONNECTED:
- reason = "STATUS_ONLY_IF_CONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_SENSITIVE_GROUP_VIOLATION:
- reason = "STATUS_DS_SENSITIVE_GROUP_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_PNP_RESTART_ENUMERATION:
- reason = "STATUS_PNP_RESTART_ENUMERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_JOURNAL_ENTRY_DELETED:
- reason = "STATUS_JOURNAL_ENTRY_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_CANT_MOD_PRIMARYGROUPID:
- reason = "STATUS_DS_CANT_MOD_PRIMARYGROUPID";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYSTEM_IMAGE_BAD_SIGNATURE:
- reason = "STATUS_SYSTEM_IMAGE_BAD_SIGNATURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PNP_REBOOT_REQUIRED:
- reason = "STATUS_PNP_REBOOT_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_POWER_STATE_INVALID:
- reason = "STATUS_POWER_STATE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_INVALID_GROUP_TYPE:
- reason = "STATUS_DS_INVALID_GROUP_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN:
- reason = "STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN:
- reason = "STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER:
- reason = "STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER:
- reason = "STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER:
- reason = "STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER:
- reason = "STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER:
- reason = "STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_HAVE_PRIMARY_MEMBERS:
- reason = "STATUS_DS_HAVE_PRIMARY_MEMBERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_NOT_SUPPORTED:
- reason = "STATUS_WMI_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_POWER:
- reason = "STATUS_INSUFFICIENT_POWER";
- break;
- case MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_PASSWORD:
- reason = "STATUS_SAM_NEED_BOOTKEY_PASSWORD";
- break;
- case MD_NTSTATUS_WIN_STATUS_SAM_NEED_BOOTKEY_FLOPPY:
- reason = "STATUS_SAM_NEED_BOOTKEY_FLOPPY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_CANT_START:
- reason = "STATUS_DS_CANT_START";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE:
- reason = "STATUS_DS_INIT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SAM_INIT_FAILURE:
- reason = "STATUS_SAM_INIT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_GC_REQUIRED:
- reason = "STATUS_DS_GC_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY:
- reason = "STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS:
- reason = "STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED:
- reason = "STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MULTIPLE_FAULT_VIOLATION:
- reason = "STATUS_MULTIPLE_FAULT_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CURRENT_DOMAIN_NOT_ALLOWED:
- reason = "STATUS_CURRENT_DOMAIN_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_MAKE:
- reason = "STATUS_CANNOT_MAKE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYSTEM_SHUTDOWN:
- reason = "STATUS_SYSTEM_SHUTDOWN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_INIT_FAILURE_CONSOLE:
- reason = "STATUS_DS_INIT_FAILURE_CONSOLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_SAM_INIT_FAILURE_CONSOLE:
- reason = "STATUS_DS_SAM_INIT_FAILURE_CONSOLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNFINISHED_CONTEXT_DELETED:
- reason = "STATUS_UNFINISHED_CONTEXT_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_TGT_REPLY:
- reason = "STATUS_NO_TGT_REPLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECTID_NOT_FOUND:
- reason = "STATUS_OBJECTID_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_IP_ADDRESSES:
- reason = "STATUS_NO_IP_ADDRESSES";
- break;
- case MD_NTSTATUS_WIN_STATUS_WRONG_CREDENTIAL_HANDLE:
- reason = "STATUS_WRONG_CREDENTIAL_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CRYPTO_SYSTEM_INVALID:
- reason = "STATUS_CRYPTO_SYSTEM_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_MAX_REFERRALS_EXCEEDED:
- reason = "STATUS_MAX_REFERRALS_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUST_BE_KDC:
- reason = "STATUS_MUST_BE_KDC";
- break;
- case MD_NTSTATUS_WIN_STATUS_STRONG_CRYPTO_NOT_SUPPORTED:
- reason = "STATUS_STRONG_CRYPTO_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_PRINCIPALS:
- reason = "STATUS_TOO_MANY_PRINCIPALS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_PA_DATA:
- reason = "STATUS_NO_PA_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_PKINIT_NAME_MISMATCH:
- reason = "STATUS_PKINIT_NAME_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_LOGON_REQUIRED:
- reason = "STATUS_SMARTCARD_LOGON_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_KDC_INVALID_REQUEST:
- reason = "STATUS_KDC_INVALID_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_KDC_UNABLE_TO_REFER:
- reason = "STATUS_KDC_UNABLE_TO_REFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_KDC_UNKNOWN_ETYPE:
- reason = "STATUS_KDC_UNKNOWN_ETYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHUTDOWN_IN_PROGRESS:
- reason = "STATUS_SHUTDOWN_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_SERVER_SHUTDOWN_IN_PROGRESS:
- reason = "STATUS_SERVER_SHUTDOWN_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_ON_SBS:
- reason = "STATUS_NOT_SUPPORTED_ON_SBS";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_GUID_DISCONNECTED:
- reason = "STATUS_WMI_GUID_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_DISABLED:
- reason = "STATUS_WMI_ALREADY_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_WMI_ALREADY_ENABLED:
- reason = "STATUS_WMI_ALREADY_ENABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MFT_TOO_FRAGMENTED:
- reason = "STATUS_MFT_TOO_FRAGMENTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_COPY_PROTECTION_FAILURE:
- reason = "STATUS_COPY_PROTECTION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CSS_AUTHENTICATION_FAILURE:
- reason = "STATUS_CSS_AUTHENTICATION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_PRESENT:
- reason = "STATUS_CSS_KEY_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CSS_KEY_NOT_ESTABLISHED:
- reason = "STATUS_CSS_KEY_NOT_ESTABLISHED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CSS_SCRAMBLED_SECTOR:
- reason = "STATUS_CSS_SCRAMBLED_SECTOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_CSS_REGION_MISMATCH:
- reason = "STATUS_CSS_REGION_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_CSS_RESETS_EXHAUSTED:
- reason = "STATUS_CSS_RESETS_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PASSWORD_CHANGE_REQUIRED:
- reason = "STATUS_PASSWORD_CHANGE_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PKINIT_FAILURE:
- reason = "STATUS_PKINIT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_SUBSYSTEM_FAILURE:
- reason = "STATUS_SMARTCARD_SUBSYSTEM_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_KERB_KEY:
- reason = "STATUS_NO_KERB_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_HOST_DOWN:
- reason = "STATUS_HOST_DOWN";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNSUPPORTED_PREAUTH:
- reason = "STATUS_UNSUPPORTED_PREAUTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_EFS_ALG_BLOB_TOO_BIG:
- reason = "STATUS_EFS_ALG_BLOB_TOO_BIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_NOT_SET:
- reason = "STATUS_PORT_NOT_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEBUGGER_INACTIVE:
- reason = "STATUS_DEBUGGER_INACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_VERSION_CHECK_FAILURE:
- reason = "STATUS_DS_VERSION_CHECK_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_AUDITING_DISABLED:
- reason = "STATUS_AUDITING_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PRENT4_MACHINE_ACCOUNT:
- reason = "STATUS_PRENT4_MACHINE_ACCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER:
- reason = "STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_32:
- reason = "STATUS_INVALID_IMAGE_WIN_32";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_WIN_64:
- reason = "STATUS_INVALID_IMAGE_WIN_64";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_BINDINGS:
- reason = "STATUS_BAD_BINDINGS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NETWORK_SESSION_EXPIRED:
- reason = "STATUS_NETWORK_SESSION_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_APPHELP_BLOCK:
- reason = "STATUS_APPHELP_BLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALL_SIDS_FILTERED:
- reason = "STATUS_ALL_SIDS_FILTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SAFE_MODE_DRIVER:
- reason = "STATUS_NOT_SAFE_MODE_DRIVER";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT:
- reason = "STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PATH:
- reason = "STATUS_ACCESS_DISABLED_BY_POLICY_PATH";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER:
- reason = "STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_BY_POLICY_OTHER:
- reason = "STATUS_ACCESS_DISABLED_BY_POLICY_OTHER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FAILED_DRIVER_ENTRY:
- reason = "STATUS_FAILED_DRIVER_ENTRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_ENUMERATION_ERROR:
- reason = "STATUS_DEVICE_ENUMERATION_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_MOUNT_POINT_NOT_RESOLVED:
- reason = "STATUS_MOUNT_POINT_NOT_RESOLVED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_DEVICE_OBJECT_PARAMETER:
- reason = "STATUS_INVALID_DEVICE_OBJECT_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_MCA_OCCURED:
- reason = "STATUS_MCA_OCCURED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED_CRITICAL:
- reason = "STATUS_DRIVER_BLOCKED_CRITICAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_BLOCKED:
- reason = "STATUS_DRIVER_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_DATABASE_ERROR:
- reason = "STATUS_DRIVER_DATABASE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYSTEM_HIVE_TOO_LARGE:
- reason = "STATUS_SYSTEM_HIVE_TOO_LARGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMPORT_OF_NON_DLL:
- reason = "STATUS_INVALID_IMPORT_OF_NON_DLL";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SECRETS:
- reason = "STATUS_NO_SECRETS";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY:
- reason = "STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FAILED_STACK_SWITCH:
- reason = "STATUS_FAILED_STACK_SWITCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_HEAP_CORRUPTION:
- reason = "STATUS_HEAP_CORRUPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_WRONG_PIN:
- reason = "STATUS_SMARTCARD_WRONG_PIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_BLOCKED:
- reason = "STATUS_SMARTCARD_CARD_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED:
- reason = "STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CARD:
- reason = "STATUS_SMARTCARD_NO_CARD";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEY_CONTAINER:
- reason = "STATUS_SMARTCARD_NO_KEY_CONTAINER";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_CERTIFICATE:
- reason = "STATUS_SMARTCARD_NO_CERTIFICATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_NO_KEYSET:
- reason = "STATUS_SMARTCARD_NO_KEYSET";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_IO_ERROR:
- reason = "STATUS_SMARTCARD_IO_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_DOWNGRADE_DETECTED:
- reason = "STATUS_DOWNGRADE_DETECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_REVOKED:
- reason = "STATUS_SMARTCARD_CERT_REVOKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED:
- reason = "STATUS_ISSUING_CA_UNTRUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_C:
- reason = "STATUS_REVOCATION_OFFLINE_C";
- break;
- case MD_NTSTATUS_WIN_STATUS_PKINIT_CLIENT_FAILURE:
- reason = "STATUS_PKINIT_CLIENT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_CERT_EXPIRED:
- reason = "STATUS_SMARTCARD_CERT_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_FAILED_PRIOR_UNLOAD:
- reason = "STATUS_DRIVER_FAILED_PRIOR_UNLOAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMARTCARD_SILENT_CONTEXT:
- reason = "STATUS_SMARTCARD_SILENT_CONTEXT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PER_USER_TRUST_QUOTA_EXCEEDED:
- reason = "STATUS_PER_USER_TRUST_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED:
- reason = "STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED:
- reason = "STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_NAME_NOT_UNIQUE:
- reason = "STATUS_DS_NAME_NOT_UNIQUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_DUPLICATE_ID_FOUND:
- reason = "STATUS_DS_DUPLICATE_ID_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_GROUP_CONVERSION_ERROR:
- reason = "STATUS_DS_GROUP_CONVERSION_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLSNAP_PREPARE_HIBERNATE:
- reason = "STATUS_VOLSNAP_PREPARE_HIBERNATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_USER2USER_REQUIRED:
- reason = "STATUS_USER2USER_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_STACK_BUFFER_OVERRUN:
- reason = "STATUS_STACK_BUFFER_OVERRUN";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_S4U_PROT_SUPPORT:
- reason = "STATUS_NO_S4U_PROT_SUPPORT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CROSSREALM_DELEGATION_FAILURE:
- reason = "STATUS_CROSSREALM_DELEGATION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REVOCATION_OFFLINE_KDC:
- reason = "STATUS_REVOCATION_OFFLINE_KDC";
- break;
- case MD_NTSTATUS_WIN_STATUS_ISSUING_CA_UNTRUSTED_KDC:
- reason = "STATUS_ISSUING_CA_UNTRUSTED_KDC";
- break;
- case MD_NTSTATUS_WIN_STATUS_KDC_CERT_EXPIRED:
- reason = "STATUS_KDC_CERT_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_KDC_CERT_REVOKED:
- reason = "STATUS_KDC_CERT_REVOKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PARAMETER_QUOTA_EXCEEDED:
- reason = "STATUS_PARAMETER_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HIBERNATION_FAILURE:
- reason = "STATUS_HIBERNATION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DELAY_LOAD_FAILED:
- reason = "STATUS_DELAY_LOAD_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_AUTHENTICATION_FIREWALL_FAILED:
- reason = "STATUS_AUTHENTICATION_FIREWALL_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VDM_DISALLOWED:
- reason = "STATUS_VDM_DISALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HUNG_DISPLAY_DRIVER_THREAD:
- reason = "STATUS_HUNG_DISPLAY_DRIVER_THREAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE:
- reason = "STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_CRUNTIME_PARAMETER:
- reason = "STATUS_INVALID_CRUNTIME_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_NTLM_BLOCKED:
- reason = "STATUS_NTLM_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_SRC_SID_EXISTS_IN_FOREST:
- reason = "STATUS_DS_SRC_SID_EXISTS_IN_FOREST";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST:
- reason = "STATUS_DS_DOMAIN_NAME_EXISTS_IN_FOREST";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST:
- reason = "STATUS_DS_FLAT_NAME_EXISTS_IN_FOREST";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_USER_PRINCIPAL_NAME:
- reason = "STATUS_INVALID_USER_PRINCIPAL_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FATAL_USER_CALLBACK_EXCEPTION:
- reason = "STATUS_FATAL_USER_CALLBACK_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_ASSERTION_FAILURE:
- reason = "STATUS_ASSERTION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VERIFIER_STOP:
- reason = "STATUS_VERIFIER_STOP";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_POP_STACK:
- reason = "STATUS_CALLBACK_POP_STACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_INCOMPATIBLE_DRIVER_BLOCKED:
- reason = "STATUS_INCOMPATIBLE_DRIVER_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HIVE_UNLOADED:
- reason = "STATUS_HIVE_UNLOADED";
- break;
- case MD_NTSTATUS_WIN_STATUS_COMPRESSION_DISABLED:
- reason = "STATUS_COMPRESSION_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_SYSTEM_LIMITATION:
- reason = "STATUS_FILE_SYSTEM_LIMITATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IMAGE_HASH:
- reason = "STATUS_INVALID_IMAGE_HASH";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_CAPABLE:
- reason = "STATUS_NOT_CAPABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REQUEST_OUT_OF_SEQUENCE:
- reason = "STATUS_REQUEST_OUT_OF_SEQUENCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMPLEMENTATION_LIMIT:
- reason = "STATUS_IMPLEMENTATION_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_ELEVATION_REQUIRED:
- reason = "STATUS_ELEVATION_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SECURITY_CONTEXT:
- reason = "STATUS_NO_SECURITY_CONTEXT";
- break;
- case MD_NTSTATUS_WIN_STATUS_PKU2U_CERT_FAILURE:
- reason = "STATUS_PKU2U_CERT_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BEYOND_VDL:
- reason = "STATUS_BEYOND_VDL";
- break;
- case MD_NTSTATUS_WIN_STATUS_ENCOUNTERED_WRITE_IN_PROGRESS:
- reason = "STATUS_ENCOUNTERED_WRITE_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_PTE_CHANGED:
- reason = "STATUS_PTE_CHANGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PURGE_FAILED:
- reason = "STATUS_PURGE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CRED_REQUIRES_CONFIRMATION:
- reason = "STATUS_CRED_REQUIRES_CONFIRMATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE:
- reason = "STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER:
- reason = "STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER";
- break;
- case MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE:
- reason = "STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE:
- reason = "STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CS_ENCRYPTION_FILE_NOT_CSE:
- reason = "STATUS_CS_ENCRYPTION_FILE_NOT_CSE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_LABEL:
- reason = "STATUS_INVALID_LABEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_DRIVER_PROCESS_TERMINATED:
- reason = "STATUS_DRIVER_PROCESS_TERMINATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_AMBIGUOUS_SYSTEM_DEVICE:
- reason = "STATUS_AMBIGUOUS_SYSTEM_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYSTEM_DEVICE_NOT_FOUND:
- reason = "STATUS_SYSTEM_DEVICE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESTART_BOOT_APPLICATION:
- reason = "STATUS_RESTART_BOOT_APPLICATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INSUFFICIENT_NVRAM_RESOURCES:
- reason = "STATUS_INSUFFICIENT_NVRAM_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SESSION:
- reason = "STATUS_INVALID_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_SESSION:
- reason = "STATUS_THREAD_ALREADY_IN_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREAD_NOT_IN_SESSION:
- reason = "STATUS_THREAD_NOT_IN_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_WEIGHT:
- reason = "STATUS_INVALID_WEIGHT";
- break;
- case MD_NTSTATUS_WIN_STATUS_REQUEST_PAUSED:
- reason = "STATUS_REQUEST_PAUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_RANGES_PROCESSED:
- reason = "STATUS_NO_RANGES_PROCESSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_RESOURCES_EXHAUSTED:
- reason = "STATUS_DISK_RESOURCES_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NEEDS_REMEDIATION:
- reason = "STATUS_NEEDS_REMEDIATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_FEATURE_NOT_SUPPORTED:
- reason = "STATUS_DEVICE_FEATURE_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_UNREACHABLE:
- reason = "STATUS_DEVICE_UNREACHABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_TOKEN:
- reason = "STATUS_INVALID_TOKEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_SERVER_UNAVAILABLE:
- reason = "STATUS_SERVER_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_NOT_AVAILABLE:
- reason = "STATUS_FILE_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_INSUFFICIENT_RESOURCES:
- reason = "STATUS_DEVICE_INSUFFICIENT_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_PACKAGE_UPDATING:
- reason = "STATUS_PACKAGE_UPDATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_READ_FROM_COPY:
- reason = "STATUS_NOT_READ_FROM_COPY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FT_WRITE_FAILURE:
- reason = "STATUS_FT_WRITE_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FT_DI_SCAN_REQUIRED:
- reason = "STATUS_FT_DI_SCAN_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_NOT_EXTERNALLY_BACKED:
- reason = "STATUS_OBJECT_NOT_EXTERNALLY_BACKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN:
- reason = "STATUS_EXTERNAL_BACKING_PROVIDER_UNKNOWN";
- break;
- case MD_NTSTATUS_WIN_STATUS_DATA_CHECKSUM_ERROR:
- reason = "STATUS_DATA_CHECKSUM_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_INTERMIXED_KERNEL_EA_OPERATION:
- reason = "STATUS_INTERMIXED_KERNEL_EA_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRIM_READ_ZERO_NOT_SUPPORTED:
- reason = "STATUS_TRIM_READ_ZERO_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TOO_MANY_SEGMENT_DESCRIPTORS:
- reason = "STATUS_TOO_MANY_SEGMENT_DESCRIPTORS";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_OFFSET_ALIGNMENT:
- reason = "STATUS_INVALID_OFFSET_ALIGNMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_FIELD_IN_PARAMETER_LIST:
- reason = "STATUS_INVALID_FIELD_IN_PARAMETER_LIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_OPERATION_IN_PROGRESS:
- reason = "STATUS_OPERATION_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_INITIATOR_TARGET_PATH:
- reason = "STATUS_INVALID_INITIATOR_TARGET_PATH";
- break;
- case MD_NTSTATUS_WIN_STATUS_SCRUB_DATA_DISABLED:
- reason = "STATUS_SCRUB_DATA_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_REDUNDANT_STORAGE:
- reason = "STATUS_NOT_REDUNDANT_STORAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESIDENT_FILE_NOT_SUPPORTED:
- reason = "STATUS_RESIDENT_FILE_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_COMPRESSED_FILE_NOT_SUPPORTED:
- reason = "STATUS_COMPRESSED_FILE_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_SUPPORTED:
- reason = "STATUS_DIRECTORY_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_OPERATION_TIMEOUT:
- reason = "STATUS_IO_OPERATION_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYSTEM_NEEDS_REMEDIATION:
- reason = "STATUS_SYSTEM_NEEDS_REMEDIATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN:
- reason = "STATUS_APPX_INTEGRITY_FAILURE_CLR_NGEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_SHARE_UNAVAILABLE:
- reason = "STATUS_SHARE_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_APISET_NOT_HOSTED:
- reason = "STATUS_APISET_NOT_HOSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_APISET_NOT_PRESENT:
- reason = "STATUS_APISET_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_DEVICE_HARDWARE_ERROR:
- reason = "STATUS_DEVICE_HARDWARE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_TASK_NAME:
- reason = "STATUS_INVALID_TASK_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_TASK_INDEX:
- reason = "STATUS_INVALID_TASK_INDEX";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREAD_ALREADY_IN_TASK:
- reason = "STATUS_THREAD_ALREADY_IN_TASK";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_BYPASS:
- reason = "STATUS_CALLBACK_BYPASS";
- break;
- case MD_NTSTATUS_WIN_STATUS_UNDEFINED_SCOPE:
- reason = "STATUS_UNDEFINED_SCOPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_CAP:
- reason = "STATUS_INVALID_CAP";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_GUI_PROCESS:
- reason = "STATUS_NOT_GUI_PROCESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FAIL_FAST_EXCEPTION:
- reason = "STATUS_FAIL_FAST_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_IMAGE_CERT_REVOKED:
- reason = "STATUS_IMAGE_CERT_REVOKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DYNAMIC_CODE_BLOCKED:
- reason = "STATUS_DYNAMIC_CODE_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_CLOSED:
- reason = "STATUS_PORT_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MESSAGE_LOST:
- reason = "STATUS_MESSAGE_LOST";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_MESSAGE:
- reason = "STATUS_INVALID_MESSAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REQUEST_CANCELED:
- reason = "STATUS_REQUEST_CANCELED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RECURSIVE_DISPATCH:
- reason = "STATUS_RECURSIVE_DISPATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_LPC_RECEIVE_BUFFER_EXPECTED:
- reason = "STATUS_LPC_RECEIVE_BUFFER_EXPECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LPC_INVALID_CONNECTION_USAGE:
- reason = "STATUS_LPC_INVALID_CONNECTION_USAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LPC_REQUESTS_NOT_ALLOWED:
- reason = "STATUS_LPC_REQUESTS_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_IN_USE:
- reason = "STATUS_RESOURCE_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HARDWARE_MEMORY_ERROR:
- reason = "STATUS_HARDWARE_MEMORY_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREADPOOL_HANDLE_EXCEPTION:
- reason = "STATUS_THREADPOOL_HANDLE_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED:
- reason = "STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED:
- reason = "STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED:
- reason = "STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED:
- reason = "STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_THREADPOOL_RELEASED_DURING_OPERATION:
- reason = "STATUS_THREADPOOL_RELEASED_DURING_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING:
- reason = "STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_APC_RETURNED_WHILE_IMPERSONATING:
- reason = "STATUS_APC_RETURNED_WHILE_IMPERSONATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROCESS_IS_PROTECTED:
- reason = "STATUS_PROCESS_IS_PROTECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MCA_EXCEPTION:
- reason = "STATUS_MCA_EXCEPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE:
- reason = "STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SYMLINK_CLASS_DISABLED:
- reason = "STATUS_SYMLINK_CLASS_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_IDN_NORMALIZATION:
- reason = "STATUS_INVALID_IDN_NORMALIZATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_UNICODE_TRANSLATION:
- reason = "STATUS_NO_UNICODE_TRANSLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_ALREADY_REGISTERED:
- reason = "STATUS_ALREADY_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONTEXT_MISMATCH:
- reason = "STATUS_CONTEXT_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_PORT_ALREADY_HAS_COMPLETION_LIST:
- reason = "STATUS_PORT_ALREADY_HAS_COMPLETION_LIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_PRIORITY:
- reason = "STATUS_CALLBACK_RETURNED_THREAD_PRIORITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_THREAD:
- reason = "STATUS_INVALID_THREAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_TRANSACTION:
- reason = "STATUS_CALLBACK_RETURNED_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LDR_LOCK:
- reason = "STATUS_CALLBACK_RETURNED_LDR_LOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_LANG:
- reason = "STATUS_CALLBACK_RETURNED_LANG";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_PRI_BACK:
- reason = "STATUS_CALLBACK_RETURNED_PRI_BACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_CALLBACK_RETURNED_THREAD_AFFINITY:
- reason = "STATUS_CALLBACK_RETURNED_THREAD_AFFINITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_DISABLED:
- reason = "STATUS_DISK_REPAIR_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_DOMAIN_RENAME_IN_PROGRESS:
- reason = "STATUS_DS_DOMAIN_RENAME_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_QUOTA_EXCEEDED:
- reason = "STATUS_DISK_QUOTA_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CONTENT_BLOCKED:
- reason = "STATUS_CONTENT_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_CLUSTERS:
- reason = "STATUS_BAD_CLUSTERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLUME_DIRTY:
- reason = "STATUS_VOLUME_DIRTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_DISK_REPAIR_UNSUCCESSFUL:
- reason = "STATUS_DISK_REPAIR_UNSUCCESSFUL";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_OVERFULL:
- reason = "STATUS_CORRUPT_LOG_OVERFULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CORRUPTED:
- reason = "STATUS_CORRUPT_LOG_CORRUPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UNAVAILABLE:
- reason = "STATUS_CORRUPT_LOG_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_DELETED_FULL:
- reason = "STATUS_CORRUPT_LOG_DELETED_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_CLEARED:
- reason = "STATUS_CORRUPT_LOG_CLEARED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ORPHAN_NAME_EXHAUSTED:
- reason = "STATUS_ORPHAN_NAME_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROACTIVE_SCAN_IN_PROGRESS:
- reason = "STATUS_PROACTIVE_SCAN_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_ENCRYPTED_IO_NOT_POSSIBLE:
- reason = "STATUS_ENCRYPTED_IO_NOT_POSSIBLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CORRUPT_LOG_UPLEVEL_RECORDS:
- reason = "STATUS_CORRUPT_LOG_UPLEVEL_RECORDS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_CHECKED_OUT:
- reason = "STATUS_FILE_CHECKED_OUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CHECKOUT_REQUIRED:
- reason = "STATUS_CHECKOUT_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_FILE_TYPE:
- reason = "STATUS_BAD_FILE_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_TOO_LARGE:
- reason = "STATUS_FILE_TOO_LARGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FORMS_AUTH_REQUIRED:
- reason = "STATUS_FORMS_AUTH_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRUS_INFECTED:
- reason = "STATUS_VIRUS_INFECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRUS_DELETED:
- reason = "STATUS_VIRUS_DELETED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_MCFG_TABLE:
- reason = "STATUS_BAD_MCFG_TABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_BREAK_OPLOCK:
- reason = "STATUS_CANNOT_BREAK_OPLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_KEY:
- reason = "STATUS_BAD_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_BAD_DATA:
- reason = "STATUS_BAD_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_KEY:
- reason = "STATUS_NO_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_HANDLE_REVOKED:
- reason = "STATUS_FILE_HANDLE_REVOKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_WOW_ASSERTION:
- reason = "STATUS_WOW_ASSERTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_SIGNATURE:
- reason = "STATUS_INVALID_SIGNATURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HMAC_NOT_SUPPORTED:
- reason = "STATUS_HMAC_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_AUTH_TAG_MISMATCH:
- reason = "STATUS_AUTH_TAG_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_STATE_TRANSITION:
- reason = "STATUS_INVALID_STATE_TRANSITION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_KERNEL_INFO_VERSION:
- reason = "STATUS_INVALID_KERNEL_INFO_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PEP_INFO_VERSION:
- reason = "STATUS_INVALID_PEP_INFO_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_QUEUE_OVERFLOW:
- reason = "STATUS_IPSEC_QUEUE_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_ND_QUEUE_OVERFLOW:
- reason = "STATUS_ND_QUEUE_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_HOPLIMIT_EXCEEDED:
- reason = "STATUS_HOPLIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PROTOCOL_NOT_SUPPORTED:
- reason = "STATUS_PROTOCOL_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FASTPATH_REJECTED:
- reason = "STATUS_FASTPATH_REJECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED:
- reason = "STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR:
- reason = "STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR:
- reason = "STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_XML_PARSE_ERROR:
- reason = "STATUS_XML_PARSE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_XMLDSIG_ERROR:
- reason = "STATUS_XMLDSIG_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_WRONG_COMPARTMENT:
- reason = "STATUS_WRONG_COMPARTMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_AUTHIP_FAILURE:
- reason = "STATUS_AUTHIP_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS:
- reason = "STATUS_DS_OID_MAPPED_GROUP_CANT_HAVE_MEMBERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_DS_OID_NOT_FOUND:
- reason = "STATUS_DS_OID_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_INCORRECT_ACCOUNT_TYPE:
- reason = "STATUS_INCORRECT_ACCOUNT_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HASH_NOT_SUPPORTED:
- reason = "STATUS_HASH_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HASH_NOT_PRESENT:
- reason = "STATUS_HASH_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED:
- reason = "STATUS_SECONDARY_IC_PROVIDER_NOT_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GPIO_CLIENT_INFORMATION_INVALID:
- reason = "STATUS_GPIO_CLIENT_INFORMATION_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_GPIO_VERSION_NOT_SUPPORTED:
- reason = "STATUS_GPIO_VERSION_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GPIO_INVALID_REGISTRATION_PACKET:
- reason = "STATUS_GPIO_INVALID_REGISTRATION_PACKET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GPIO_OPERATION_DENIED:
- reason = "STATUS_GPIO_OPERATION_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE:
- reason = "STATUS_GPIO_INCOMPATIBLE_CONNECT_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_SWITCH_RUNLEVEL:
- reason = "STATUS_CANNOT_SWITCH_RUNLEVEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_RUNLEVEL_SETTING:
- reason = "STATUS_INVALID_RUNLEVEL_SETTING";
- break;
- case MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_TIMEOUT:
- reason = "STATUS_RUNLEVEL_SWITCH_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT:
- reason = "STATUS_RUNLEVEL_SWITCH_AGENT_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_RUNLEVEL_SWITCH_IN_PROGRESS:
- reason = "STATUS_RUNLEVEL_SWITCH_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_APPCONTAINER:
- reason = "STATUS_NOT_APPCONTAINER";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SUPPORTED_IN_APPCONTAINER:
- reason = "STATUS_NOT_SUPPORTED_IN_APPCONTAINER";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_PACKAGE_SID_LENGTH:
- reason = "STATUS_INVALID_PACKAGE_SID_LENGTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_APP_DATA_NOT_FOUND:
- reason = "STATUS_APP_DATA_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_APP_DATA_EXPIRED:
- reason = "STATUS_APP_DATA_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_APP_DATA_CORRUPT:
- reason = "STATUS_APP_DATA_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_APP_DATA_LIMIT_EXCEEDED:
- reason = "STATUS_APP_DATA_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_APP_DATA_REBOOT_REQUIRED:
- reason = "STATUS_APP_DATA_REBOOT_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED:
- reason = "STATUS_OFFLOAD_READ_FLT_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED:
- reason = "STATUS_OFFLOAD_WRITE_FLT_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED:
- reason = "STATUS_OFFLOAD_READ_FILE_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED:
- reason = "STATUS_OFFLOAD_WRITE_FILE_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_DBG_NO_STATE_CHANGE:
- reason = "DBG_NO_STATE_CHANGE";
- break;
- case MD_NTSTATUS_WIN_DBG_APP_NOT_IDLE:
- reason = "DBG_APP_NOT_IDLE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_BINDING:
- reason = "RPC_NT_INVALID_STRING_BINDING";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_WRONG_KIND_OF_BINDING:
- reason = "RPC_NT_WRONG_KIND_OF_BINDING";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_BINDING:
- reason = "RPC_NT_INVALID_BINDING";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_SUPPORTED:
- reason = "RPC_NT_PROTSEQ_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_RPC_PROTSEQ:
- reason = "RPC_NT_INVALID_RPC_PROTSEQ";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_STRING_UUID:
- reason = "RPC_NT_INVALID_STRING_UUID";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_ENDPOINT_FORMAT:
- reason = "RPC_NT_INVALID_ENDPOINT_FORMAT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_NET_ADDR:
- reason = "RPC_NT_INVALID_NET_ADDR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_ENDPOINT_FOUND:
- reason = "RPC_NT_NO_ENDPOINT_FOUND";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_TIMEOUT:
- reason = "RPC_NT_INVALID_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_OBJECT_NOT_FOUND:
- reason = "RPC_NT_OBJECT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ALREADY_REGISTERED:
- reason = "RPC_NT_ALREADY_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_TYPE_ALREADY_REGISTERED:
- reason = "RPC_NT_TYPE_ALREADY_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ALREADY_LISTENING:
- reason = "RPC_NT_ALREADY_LISTENING";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS_REGISTERED:
- reason = "RPC_NT_NO_PROTSEQS_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NOT_LISTENING:
- reason = "RPC_NT_NOT_LISTENING";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_MGR_TYPE:
- reason = "RPC_NT_UNKNOWN_MGR_TYPE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_IF:
- reason = "RPC_NT_UNKNOWN_IF";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_BINDINGS:
- reason = "RPC_NT_NO_BINDINGS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_PROTSEQS:
- reason = "RPC_NT_NO_PROTSEQS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_CANT_CREATE_ENDPOINT:
- reason = "RPC_NT_CANT_CREATE_ENDPOINT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_OUT_OF_RESOURCES:
- reason = "RPC_NT_OUT_OF_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SERVER_UNAVAILABLE:
- reason = "RPC_NT_SERVER_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SERVER_TOO_BUSY:
- reason = "RPC_NT_SERVER_TOO_BUSY";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_NETWORK_OPTIONS:
- reason = "RPC_NT_INVALID_NETWORK_OPTIONS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_CALL_ACTIVE:
- reason = "RPC_NT_NO_CALL_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED:
- reason = "RPC_NT_CALL_FAILED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_CALL_FAILED_DNE:
- reason = "RPC_NT_CALL_FAILED_DNE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PROTOCOL_ERROR:
- reason = "RPC_NT_PROTOCOL_ERROR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TRANS_SYN:
- reason = "RPC_NT_UNSUPPORTED_TRANS_SYN";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_TYPE:
- reason = "RPC_NT_UNSUPPORTED_TYPE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_TAG:
- reason = "RPC_NT_INVALID_TAG";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_BOUND:
- reason = "RPC_NT_INVALID_BOUND";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_ENTRY_NAME:
- reason = "RPC_NT_NO_ENTRY_NAME";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_NAME_SYNTAX:
- reason = "RPC_NT_INVALID_NAME_SYNTAX";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_NAME_SYNTAX:
- reason = "RPC_NT_UNSUPPORTED_NAME_SYNTAX";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UUID_NO_ADDRESS:
- reason = "RPC_NT_UUID_NO_ADDRESS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_DUPLICATE_ENDPOINT:
- reason = "RPC_NT_DUPLICATE_ENDPOINT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_TYPE:
- reason = "RPC_NT_UNKNOWN_AUTHN_TYPE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_MAX_CALLS_TOO_SMALL:
- reason = "RPC_NT_MAX_CALLS_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_STRING_TOO_LONG:
- reason = "RPC_NT_STRING_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PROTSEQ_NOT_FOUND:
- reason = "RPC_NT_PROTSEQ_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PROCNUM_OUT_OF_RANGE:
- reason = "RPC_NT_PROCNUM_OUT_OF_RANGE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_BINDING_HAS_NO_AUTH:
- reason = "RPC_NT_BINDING_HAS_NO_AUTH";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_SERVICE:
- reason = "RPC_NT_UNKNOWN_AUTHN_SERVICE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHN_LEVEL:
- reason = "RPC_NT_UNKNOWN_AUTHN_LEVEL";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_AUTH_IDENTITY:
- reason = "RPC_NT_INVALID_AUTH_IDENTITY";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNKNOWN_AUTHZ_SERVICE:
- reason = "RPC_NT_UNKNOWN_AUTHZ_SERVICE";
- break;
- case MD_NTSTATUS_WIN_EPT_NT_INVALID_ENTRY:
- reason = "EPT_NT_INVALID_ENTRY";
- break;
- case MD_NTSTATUS_WIN_EPT_NT_CANT_PERFORM_OP:
- reason = "EPT_NT_CANT_PERFORM_OP";
- break;
- case MD_NTSTATUS_WIN_EPT_NT_NOT_REGISTERED:
- reason = "EPT_NT_NOT_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NOTHING_TO_EXPORT:
- reason = "RPC_NT_NOTHING_TO_EXPORT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INCOMPLETE_NAME:
- reason = "RPC_NT_INCOMPLETE_NAME";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_VERS_OPTION:
- reason = "RPC_NT_INVALID_VERS_OPTION";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_MORE_MEMBERS:
- reason = "RPC_NT_NO_MORE_MEMBERS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NOT_ALL_OBJS_UNEXPORTED:
- reason = "RPC_NT_NOT_ALL_OBJS_UNEXPORTED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INTERFACE_NOT_FOUND:
- reason = "RPC_NT_INTERFACE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ENTRY_ALREADY_EXISTS:
- reason = "RPC_NT_ENTRY_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ENTRY_NOT_FOUND:
- reason = "RPC_NT_ENTRY_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NAME_SERVICE_UNAVAILABLE:
- reason = "RPC_NT_NAME_SERVICE_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_NAF_ID:
- reason = "RPC_NT_INVALID_NAF_ID";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_CANNOT_SUPPORT:
- reason = "RPC_NT_CANNOT_SUPPORT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_CONTEXT_AVAILABLE:
- reason = "RPC_NT_NO_CONTEXT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INTERNAL_ERROR:
- reason = "RPC_NT_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ZERO_DIVIDE:
- reason = "RPC_NT_ZERO_DIVIDE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ADDRESS_ERROR:
- reason = "RPC_NT_ADDRESS_ERROR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_FP_DIV_ZERO:
- reason = "RPC_NT_FP_DIV_ZERO";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_FP_UNDERFLOW:
- reason = "RPC_NT_FP_UNDERFLOW";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_FP_OVERFLOW:
- reason = "RPC_NT_FP_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_CALL_IN_PROGRESS:
- reason = "RPC_NT_CALL_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_MORE_BINDINGS:
- reason = "RPC_NT_NO_MORE_BINDINGS";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_GROUP_MEMBER_NOT_FOUND:
- reason = "RPC_NT_GROUP_MEMBER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_EPT_NT_CANT_CREATE:
- reason = "EPT_NT_CANT_CREATE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_OBJECT:
- reason = "RPC_NT_INVALID_OBJECT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_INTERFACES:
- reason = "RPC_NT_NO_INTERFACES";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_CALL_CANCELLED:
- reason = "RPC_NT_CALL_CANCELLED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_BINDING_INCOMPLETE:
- reason = "RPC_NT_BINDING_INCOMPLETE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_COMM_FAILURE:
- reason = "RPC_NT_COMM_FAILURE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_UNSUPPORTED_AUTHN_LEVEL:
- reason = "RPC_NT_UNSUPPORTED_AUTHN_LEVEL";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_PRINC_NAME:
- reason = "RPC_NT_NO_PRINC_NAME";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NOT_RPC_ERROR:
- reason = "RPC_NT_NOT_RPC_ERROR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SEC_PKG_ERROR:
- reason = "RPC_NT_SEC_PKG_ERROR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NOT_CANCELLED:
- reason = "RPC_NT_NOT_CANCELLED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_HANDLE:
- reason = "RPC_NT_INVALID_ASYNC_HANDLE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_ASYNC_CALL:
- reason = "RPC_NT_INVALID_ASYNC_CALL";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PROXY_ACCESS_DENIED:
- reason = "RPC_NT_PROXY_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_COOKIE_AUTH_FAILED:
- reason = "RPC_NT_COOKIE_AUTH_FAILED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NO_MORE_ENTRIES:
- reason = "RPC_NT_NO_MORE_ENTRIES";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_OPEN_FAIL:
- reason = "RPC_NT_SS_CHAR_TRANS_OPEN_FAIL";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_CHAR_TRANS_SHORT_FILE:
- reason = "RPC_NT_SS_CHAR_TRANS_SHORT_FILE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_IN_NULL_CONTEXT:
- reason = "RPC_NT_SS_IN_NULL_CONTEXT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_MISMATCH:
- reason = "RPC_NT_SS_CONTEXT_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_CONTEXT_DAMAGED:
- reason = "RPC_NT_SS_CONTEXT_DAMAGED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_HANDLES_MISMATCH:
- reason = "RPC_NT_SS_HANDLES_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_SS_CANNOT_GET_CALL_HANDLE:
- reason = "RPC_NT_SS_CANNOT_GET_CALL_HANDLE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_NULL_REF_POINTER:
- reason = "RPC_NT_NULL_REF_POINTER";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_ENUM_VALUE_OUT_OF_RANGE:
- reason = "RPC_NT_ENUM_VALUE_OUT_OF_RANGE";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_BYTE_COUNT_TOO_SMALL:
- reason = "RPC_NT_BYTE_COUNT_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_BAD_STUB_DATA:
- reason = "RPC_NT_BAD_STUB_DATA";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_ES_ACTION:
- reason = "RPC_NT_INVALID_ES_ACTION";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_WRONG_ES_VERSION:
- reason = "RPC_NT_WRONG_ES_VERSION";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_WRONG_STUB_VERSION:
- reason = "RPC_NT_WRONG_STUB_VERSION";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OBJECT:
- reason = "RPC_NT_INVALID_PIPE_OBJECT";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_INVALID_PIPE_OPERATION:
- reason = "RPC_NT_INVALID_PIPE_OPERATION";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_WRONG_PIPE_VERSION:
- reason = "RPC_NT_WRONG_PIPE_VERSION";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PIPE_CLOSED:
- reason = "RPC_NT_PIPE_CLOSED";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PIPE_DISCIPLINE_ERROR:
- reason = "RPC_NT_PIPE_DISCIPLINE_ERROR";
- break;
- case MD_NTSTATUS_WIN_RPC_NT_PIPE_EMPTY:
- reason = "RPC_NT_PIPE_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_PNP_BAD_MPS_TABLE:
- reason = "STATUS_PNP_BAD_MPS_TABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PNP_TRANSLATION_FAILED:
- reason = "STATUS_PNP_TRANSLATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PNP_IRQ_TRANSLATION_FAILED:
- reason = "STATUS_PNP_IRQ_TRANSLATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PNP_INVALID_ID:
- reason = "STATUS_PNP_INVALID_ID";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_REISSUE_AS_CACHED:
- reason = "STATUS_IO_REISSUE_AS_CACHED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_INVALID:
- reason = "STATUS_CTX_WINSTATION_NAME_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_INVALID_PD:
- reason = "STATUS_CTX_INVALID_PD";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_PD_NOT_FOUND:
- reason = "STATUS_CTX_PD_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_CLOSE_PENDING:
- reason = "STATUS_CTX_CLOSE_PENDING";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_NO_OUTBUF:
- reason = "STATUS_CTX_NO_OUTBUF";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_MODEM_INF_NOT_FOUND:
- reason = "STATUS_CTX_MODEM_INF_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_INVALID_MODEMNAME:
- reason = "STATUS_CTX_INVALID_MODEMNAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_RESPONSE_ERROR:
- reason = "STATUS_CTX_RESPONSE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_TIMEOUT:
- reason = "STATUS_CTX_MODEM_RESPONSE_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_CARRIER:
- reason = "STATUS_CTX_MODEM_RESPONSE_NO_CARRIER";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE:
- reason = "STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_BUSY:
- reason = "STATUS_CTX_MODEM_RESPONSE_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_MODEM_RESPONSE_VOICE:
- reason = "STATUS_CTX_MODEM_RESPONSE_VOICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_TD_ERROR:
- reason = "STATUS_CTX_TD_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_CLIENT_INVALID:
- reason = "STATUS_CTX_LICENSE_CLIENT_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_NOT_AVAILABLE:
- reason = "STATUS_CTX_LICENSE_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_LICENSE_EXPIRED:
- reason = "STATUS_CTX_LICENSE_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NOT_FOUND:
- reason = "STATUS_CTX_WINSTATION_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_NAME_COLLISION:
- reason = "STATUS_CTX_WINSTATION_NAME_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_BUSY:
- reason = "STATUS_CTX_WINSTATION_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_BAD_VIDEO_MODE:
- reason = "STATUS_CTX_BAD_VIDEO_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_GRAPHICS_INVALID:
- reason = "STATUS_CTX_GRAPHICS_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_NOT_CONSOLE:
- reason = "STATUS_CTX_NOT_CONSOLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_QUERY_TIMEOUT:
- reason = "STATUS_CTX_CLIENT_QUERY_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_DISCONNECT:
- reason = "STATUS_CTX_CONSOLE_DISCONNECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_CONSOLE_CONNECT:
- reason = "STATUS_CTX_CONSOLE_CONNECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DENIED:
- reason = "STATUS_CTX_SHADOW_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_WINSTATION_ACCESS_DENIED:
- reason = "STATUS_CTX_WINSTATION_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_INVALID_WD:
- reason = "STATUS_CTX_INVALID_WD";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_WD_NOT_FOUND:
- reason = "STATUS_CTX_WD_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_INVALID:
- reason = "STATUS_CTX_SHADOW_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_DISABLED:
- reason = "STATUS_CTX_SHADOW_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RDP_PROTOCOL_ERROR:
- reason = "STATUS_RDP_PROTOCOL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_NOT_SET:
- reason = "STATUS_CTX_CLIENT_LICENSE_NOT_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_CLIENT_LICENSE_IN_USE:
- reason = "STATUS_CTX_CLIENT_LICENSE_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE:
- reason = "STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_SHADOW_NOT_RUNNING:
- reason = "STATUS_CTX_SHADOW_NOT_RUNNING";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_LOGON_DISABLED:
- reason = "STATUS_CTX_LOGON_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTX_SECURITY_LAYER_ERROR:
- reason = "STATUS_CTX_SECURITY_LAYER_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_TS_INCOMPATIBLE_SESSIONS:
- reason = "STATUS_TS_INCOMPATIBLE_SESSIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TS_VIDEO_SUBSYSTEM_ERROR:
- reason = "STATUS_TS_VIDEO_SUBSYSTEM_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_FOUND:
- reason = "STATUS_MUI_FILE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUI_INVALID_FILE:
- reason = "STATUS_MUI_INVALID_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUI_INVALID_RC_CONFIG:
- reason = "STATUS_MUI_INVALID_RC_CONFIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUI_INVALID_LOCALE_NAME:
- reason = "STATUS_MUI_INVALID_LOCALE_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME:
- reason = "STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_MUI_FILE_NOT_LOADED:
- reason = "STATUS_MUI_FILE_NOT_LOADED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCE_ENUM_USER_STOP:
- reason = "STATUS_RESOURCE_ENUM_USER_STOP";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NODE:
- reason = "STATUS_CLUSTER_INVALID_NODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_EXISTS:
- reason = "STATUS_CLUSTER_NODE_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_IN_PROGRESS:
- reason = "STATUS_CLUSTER_JOIN_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_FOUND:
- reason = "STATUS_CLUSTER_NODE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND:
- reason = "STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_EXISTS:
- reason = "STATUS_CLUSTER_NETWORK_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_FOUND:
- reason = "STATUS_CLUSTER_NETWORK_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_EXISTS:
- reason = "STATUS_CLUSTER_NETINTERFACE_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NETINTERFACE_NOT_FOUND:
- reason = "STATUS_CLUSTER_NETINTERFACE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_REQUEST:
- reason = "STATUS_CLUSTER_INVALID_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK_PROVIDER:
- reason = "STATUS_CLUSTER_INVALID_NETWORK_PROVIDER";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_DOWN:
- reason = "STATUS_CLUSTER_NODE_DOWN";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UNREACHABLE:
- reason = "STATUS_CLUSTER_NODE_UNREACHABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_MEMBER:
- reason = "STATUS_CLUSTER_NODE_NOT_MEMBER";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS:
- reason = "STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_INVALID_NETWORK:
- reason = "STATUS_CLUSTER_INVALID_NETWORK";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_NET_ADAPTERS:
- reason = "STATUS_CLUSTER_NO_NET_ADAPTERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_UP:
- reason = "STATUS_CLUSTER_NODE_UP";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_PAUSED:
- reason = "STATUS_CLUSTER_NODE_PAUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NODE_NOT_PAUSED:
- reason = "STATUS_CLUSTER_NODE_NOT_PAUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NO_SECURITY_CONTEXT:
- reason = "STATUS_CLUSTER_NO_SECURITY_CONTEXT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NETWORK_NOT_INTERNAL:
- reason = "STATUS_CLUSTER_NETWORK_NOT_INTERNAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_POISONED:
- reason = "STATUS_CLUSTER_POISONED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_NON_CSV_PATH:
- reason = "STATUS_CLUSTER_NON_CSV_PATH";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL:
- reason = "STATUS_CLUSTER_CSV_VOLUME_NOT_LOCAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS:
- reason = "STATUS_CLUSTER_CSV_READ_OPLOCK_BREAK_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR:
- reason = "STATUS_CLUSTER_CSV_AUTO_PAUSE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_REDIRECTED:
- reason = "STATUS_CLUSTER_CSV_REDIRECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_NOT_REDIRECTED:
- reason = "STATUS_CLUSTER_CSV_NOT_REDIRECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING:
- reason = "STATUS_CLUSTER_CSV_VOLUME_DRAINING";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS:
- reason = "STATUS_CLUSTER_CSV_SNAPSHOT_CREATION_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL:
- reason = "STATUS_CLUSTER_CSV_VOLUME_DRAINING_SUCCEEDED_DOWNLEVEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OPCODE:
- reason = "STATUS_ACPI_INVALID_OPCODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_STACK_OVERFLOW:
- reason = "STATUS_ACPI_STACK_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_ASSERT_FAILED:
- reason = "STATUS_ACPI_ASSERT_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_INDEX:
- reason = "STATUS_ACPI_INVALID_INDEX";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGUMENT:
- reason = "STATUS_ACPI_INVALID_ARGUMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_FATAL:
- reason = "STATUS_ACPI_FATAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_SUPERNAME:
- reason = "STATUS_ACPI_INVALID_SUPERNAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ARGTYPE:
- reason = "STATUS_ACPI_INVALID_ARGTYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_OBJTYPE:
- reason = "STATUS_ACPI_INVALID_OBJTYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TARGETTYPE:
- reason = "STATUS_ACPI_INVALID_TARGETTYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INCORRECT_ARGUMENT_COUNT:
- reason = "STATUS_ACPI_INCORRECT_ARGUMENT_COUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_ADDRESS_NOT_MAPPED:
- reason = "STATUS_ACPI_ADDRESS_NOT_MAPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_EVENTTYPE:
- reason = "STATUS_ACPI_INVALID_EVENTTYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_HANDLER_COLLISION:
- reason = "STATUS_ACPI_HANDLER_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_DATA:
- reason = "STATUS_ACPI_INVALID_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_REGION:
- reason = "STATUS_ACPI_INVALID_REGION";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_ACCESS_SIZE:
- reason = "STATUS_ACPI_INVALID_ACCESS_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_ACQUIRE_GLOBAL_LOCK:
- reason = "STATUS_ACPI_ACQUIRE_GLOBAL_LOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_ALREADY_INITIALIZED:
- reason = "STATUS_ACPI_ALREADY_INITIALIZED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_NOT_INITIALIZED:
- reason = "STATUS_ACPI_NOT_INITIALIZED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_MUTEX_LEVEL:
- reason = "STATUS_ACPI_INVALID_MUTEX_LEVEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNED:
- reason = "STATUS_ACPI_MUTEX_NOT_OWNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_MUTEX_NOT_OWNER:
- reason = "STATUS_ACPI_MUTEX_NOT_OWNER";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_RS_ACCESS:
- reason = "STATUS_ACPI_RS_ACCESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_INVALID_TABLE:
- reason = "STATUS_ACPI_INVALID_TABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_REG_HANDLER_FAILED:
- reason = "STATUS_ACPI_REG_HANDLER_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ACPI_POWER_REQUEST_FAILED:
- reason = "STATUS_ACPI_POWER_REQUEST_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_SECTION_NOT_FOUND:
- reason = "STATUS_SXS_SECTION_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_CANT_GEN_ACTCTX:
- reason = "STATUS_SXS_CANT_GEN_ACTCTX";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_INVALID_ACTCTXDATA_FORMAT:
- reason = "STATUS_SXS_INVALID_ACTCTXDATA_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_NOT_FOUND:
- reason = "STATUS_SXS_ASSEMBLY_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_FORMAT_ERROR:
- reason = "STATUS_SXS_MANIFEST_FORMAT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_PARSE_ERROR:
- reason = "STATUS_SXS_MANIFEST_PARSE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_ACTIVATION_CONTEXT_DISABLED:
- reason = "STATUS_SXS_ACTIVATION_CONTEXT_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_KEY_NOT_FOUND:
- reason = "STATUS_SXS_KEY_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_VERSION_CONFLICT:
- reason = "STATUS_SXS_VERSION_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_WRONG_SECTION_TYPE:
- reason = "STATUS_SXS_WRONG_SECTION_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_THREAD_QUERIES_DISABLED:
- reason = "STATUS_SXS_THREAD_QUERIES_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_MISSING:
- reason = "STATUS_SXS_ASSEMBLY_MISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET:
- reason = "STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_EARLY_DEACTIVATION:
- reason = "STATUS_SXS_EARLY_DEACTIVATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_INVALID_DEACTIVATION:
- reason = "STATUS_SXS_INVALID_DEACTIVATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_MULTIPLE_DEACTIVATION:
- reason = "STATUS_SXS_MULTIPLE_DEACTIVATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY:
- reason = "STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_PROCESS_TERMINATION_REQUESTED:
- reason = "STATUS_SXS_PROCESS_TERMINATION_REQUESTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_CORRUPT_ACTIVATION_STACK:
- reason = "STATUS_SXS_CORRUPT_ACTIVATION_STACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_CORRUPTION:
- reason = "STATUS_SXS_CORRUPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE:
- reason = "STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME:
- reason = "STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE:
- reason = "STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_IDENTITY_PARSE_ERROR:
- reason = "STATUS_SXS_IDENTITY_PARSE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_COMPONENT_STORE_CORRUPT:
- reason = "STATUS_SXS_COMPONENT_STORE_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISMATCH:
- reason = "STATUS_SXS_FILE_HASH_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT:
- reason = "STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_IDENTITIES_DIFFERENT:
- reason = "STATUS_SXS_IDENTITIES_DIFFERENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT:
- reason = "STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY:
- reason = "STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_ADVANCED_INSTALLER_FAILED:
- reason = "STATUS_ADVANCED_INSTALLER_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_XML_ENCODING_MISMATCH:
- reason = "STATUS_XML_ENCODING_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_MANIFEST_TOO_BIG:
- reason = "STATUS_SXS_MANIFEST_TOO_BIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_SETTING_NOT_REGISTERED:
- reason = "STATUS_SXS_SETTING_NOT_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE:
- reason = "STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SMI_PRIMITIVE_INSTALLER_FAILED:
- reason = "STATUS_SMI_PRIMITIVE_INSTALLER_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GENERIC_COMMAND_FAILED:
- reason = "STATUS_GENERIC_COMMAND_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SXS_FILE_HASH_MISSING:
- reason = "STATUS_SXS_FILE_HASH_MISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_CONFLICT:
- reason = "STATUS_TRANSACTIONAL_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_INVALID_TRANSACTION:
- reason = "STATUS_INVALID_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ACTIVE:
- reason = "STATUS_TRANSACTION_NOT_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TM_INITIALIZATION_FAILED:
- reason = "STATUS_TM_INITIALIZATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RM_NOT_ACTIVE:
- reason = "STATUS_RM_NOT_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_RM_METADATA_CORRUPT:
- reason = "STATUS_RM_METADATA_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_JOINED:
- reason = "STATUS_TRANSACTION_NOT_JOINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_DIRECTORY_NOT_RM:
- reason = "STATUS_DIRECTORY_NOT_RM";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE:
- reason = "STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_RESIZE_INVALID_SIZE:
- reason = "STATUS_LOG_RESIZE_INVALID_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_REMOTE_FILE_VERSION_MISMATCH:
- reason = "STATUS_REMOTE_FILE_VERSION_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_ALREADY_EXISTS:
- reason = "STATUS_CRM_PROTOCOL_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_PROPAGATION_FAILED:
- reason = "STATUS_TRANSACTION_PROPAGATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CRM_PROTOCOL_NOT_FOUND:
- reason = "STATUS_CRM_PROTOCOL_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_SUPERIOR_EXISTS:
- reason = "STATUS_TRANSACTION_SUPERIOR_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUEST_NOT_VALID:
- reason = "STATUS_TRANSACTION_REQUEST_NOT_VALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_REQUESTED:
- reason = "STATUS_TRANSACTION_NOT_REQUESTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_ABORTED:
- reason = "STATUS_TRANSACTION_ALREADY_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_ALREADY_COMMITTED:
- reason = "STATUS_TRANSACTION_ALREADY_COMMITTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER:
- reason = "STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_CURRENT_TRANSACTION_NOT_VALID:
- reason = "STATUS_CURRENT_TRANSACTION_NOT_VALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_GROWTH_FAILED:
- reason = "STATUS_LOG_GROWTH_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_OBJECT_NO_LONGER_EXISTS:
- reason = "STATUS_OBJECT_NO_LONGER_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_FOUND:
- reason = "STATUS_STREAM_MINIVERSION_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_STREAM_MINIVERSION_NOT_VALID:
- reason = "STATUS_STREAM_MINIVERSION_NOT_VALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION:
- reason = "STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT:
- reason = "STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS:
- reason = "STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_HANDLE_NO_LONGER_VALID:
- reason = "STATUS_HANDLE_NO_LONGER_VALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CORRUPTION_DETECTED:
- reason = "STATUS_LOG_CORRUPTION_DETECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RM_DISCONNECTED:
- reason = "STATUS_RM_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_SUPERIOR:
- reason = "STATUS_ENLISTMENT_NOT_SUPERIOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FILE_IDENTITY_NOT_PERSISTENT:
- reason = "STATUS_FILE_IDENTITY_NOT_PERSISTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY:
- reason = "STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANT_CROSS_RM_BOUNDARY:
- reason = "STATUS_CANT_CROSS_RM_BOUNDARY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TXF_DIR_NOT_EMPTY:
- reason = "STATUS_TXF_DIR_NOT_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_INDOUBT_TRANSACTIONS_EXIST:
- reason = "STATUS_INDOUBT_TRANSACTIONS_EXIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_TM_VOLATILE:
- reason = "STATUS_TM_VOLATILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_ROLLBACK_TIMER_EXPIRED:
- reason = "STATUS_ROLLBACK_TIMER_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TXF_ATTRIBUTE_CORRUPT:
- reason = "STATUS_TXF_ATTRIBUTE_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION:
- reason = "STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED:
- reason = "STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE:
- reason = "STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_REQUIRED_PROMOTION:
- reason = "STATUS_TRANSACTION_REQUIRED_PROMOTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION:
- reason = "STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONS_NOT_FROZEN:
- reason = "STATUS_TRANSACTIONS_NOT_FROZEN";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_FREEZE_IN_PROGRESS:
- reason = "STATUS_TRANSACTION_FREEZE_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NOT_SNAPSHOT_VOLUME:
- reason = "STATUS_NOT_SNAPSHOT_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_SAVEPOINT_WITH_OPEN_FILES:
- reason = "STATUS_NO_SAVEPOINT_WITH_OPEN_FILES";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION:
- reason = "STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TM_IDENTITY_MISMATCH:
- reason = "STATUS_TM_IDENTITY_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLOATED_SECTION:
- reason = "STATUS_FLOATED_SECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_ACCEPT_TRANSACTED_WORK:
- reason = "STATUS_CANNOT_ACCEPT_TRANSACTED_WORK";
- break;
- case MD_NTSTATUS_WIN_STATUS_CANNOT_ABORT_TRANSACTIONS:
- reason = "STATUS_CANNOT_ABORT_TRANSACTIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_FOUND:
- reason = "STATUS_TRANSACTION_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_RESOURCEMANAGER_NOT_FOUND:
- reason = "STATUS_RESOURCEMANAGER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_ENLISTMENT_NOT_FOUND:
- reason = "STATUS_ENLISTMENT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_FOUND:
- reason = "STATUS_TRANSACTIONMANAGER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_NOT_ONLINE:
- reason = "STATUS_TRANSACTIONMANAGER_NOT_ONLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION:
- reason = "STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ROOT:
- reason = "STATUS_TRANSACTION_NOT_ROOT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_OBJECT_EXPIRED:
- reason = "STATUS_TRANSACTION_OBJECT_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION:
- reason = "STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED:
- reason = "STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_RECORD_TOO_LONG:
- reason = "STATUS_TRANSACTION_RECORD_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_NO_LINK_TRACKING_IN_TRANSACTION:
- reason = "STATUS_NO_LINK_TRACKING_IN_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION:
- reason = "STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_INTEGRITY_VIOLATED:
- reason = "STATUS_TRANSACTION_INTEGRITY_VIOLATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH:
- reason = "STATUS_TRANSACTIONMANAGER_IDENTITY_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT:
- reason = "STATUS_RM_CANNOT_BE_FROZEN_FOR_SNAPSHOT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_MUST_WRITETHROUGH:
- reason = "STATUS_TRANSACTION_MUST_WRITETHROUGH";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NO_SUPERIOR:
- reason = "STATUS_TRANSACTION_NO_SUPERIOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_EXPIRED_HANDLE:
- reason = "STATUS_EXPIRED_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TRANSACTION_NOT_ENLISTED:
- reason = "STATUS_TRANSACTION_NOT_ENLISTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_INVALID:
- reason = "STATUS_LOG_SECTOR_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_PARITY_INVALID:
- reason = "STATUS_LOG_SECTOR_PARITY_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_SECTOR_REMAPPED:
- reason = "STATUS_LOG_SECTOR_REMAPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INCOMPLETE:
- reason = "STATUS_LOG_BLOCK_INCOMPLETE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_INVALID_RANGE:
- reason = "STATUS_LOG_INVALID_RANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_BLOCKS_EXHAUSTED:
- reason = "STATUS_LOG_BLOCKS_EXHAUSTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_READ_CONTEXT_INVALID:
- reason = "STATUS_LOG_READ_CONTEXT_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_RESTART_INVALID:
- reason = "STATUS_LOG_RESTART_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_VERSION:
- reason = "STATUS_LOG_BLOCK_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_BLOCK_INVALID:
- reason = "STATUS_LOG_BLOCK_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_READ_MODE_INVALID:
- reason = "STATUS_LOG_READ_MODE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_METADATA_CORRUPT:
- reason = "STATUS_LOG_METADATA_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INVALID:
- reason = "STATUS_LOG_METADATA_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_METADATA_INCONSISTENT:
- reason = "STATUS_LOG_METADATA_INCONSISTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_RESERVATION_INVALID:
- reason = "STATUS_LOG_RESERVATION_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CANT_DELETE:
- reason = "STATUS_LOG_CANT_DELETE";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_LIMIT_EXCEEDED:
- reason = "STATUS_LOG_CONTAINER_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_START_OF_LOG:
- reason = "STATUS_LOG_START_OF_LOG";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_POLICY_ALREADY_INSTALLED:
- reason = "STATUS_LOG_POLICY_ALREADY_INSTALLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_POLICY_NOT_INSTALLED:
- reason = "STATUS_LOG_POLICY_NOT_INSTALLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_POLICY_INVALID:
- reason = "STATUS_LOG_POLICY_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_POLICY_CONFLICT:
- reason = "STATUS_LOG_POLICY_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_PINNED_ARCHIVE_TAIL:
- reason = "STATUS_LOG_PINNED_ARCHIVE_TAIL";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_RECORD_NONEXISTENT:
- reason = "STATUS_LOG_RECORD_NONEXISTENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_RECORDS_RESERVED_INVALID:
- reason = "STATUS_LOG_RECORDS_RESERVED_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_SPACE_RESERVED_INVALID:
- reason = "STATUS_LOG_SPACE_RESERVED_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_TAIL_INVALID:
- reason = "STATUS_LOG_TAIL_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_FULL:
- reason = "STATUS_LOG_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_MULTIPLEXED:
- reason = "STATUS_LOG_MULTIPLEXED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_DEDICATED:
- reason = "STATUS_LOG_DEDICATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS:
- reason = "STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_ARCHIVE_IN_PROGRESS:
- reason = "STATUS_LOG_ARCHIVE_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_EPHEMERAL:
- reason = "STATUS_LOG_EPHEMERAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_NOT_ENOUGH_CONTAINERS:
- reason = "STATUS_LOG_NOT_ENOUGH_CONTAINERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_ALREADY_REGISTERED:
- reason = "STATUS_LOG_CLIENT_ALREADY_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CLIENT_NOT_REGISTERED:
- reason = "STATUS_LOG_CLIENT_NOT_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_FULL_HANDLER_IN_PROGRESS:
- reason = "STATUS_LOG_FULL_HANDLER_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_READ_FAILED:
- reason = "STATUS_LOG_CONTAINER_READ_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_WRITE_FAILED:
- reason = "STATUS_LOG_CONTAINER_WRITE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_OPEN_FAILED:
- reason = "STATUS_LOG_CONTAINER_OPEN_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_CONTAINER_STATE_INVALID:
- reason = "STATUS_LOG_CONTAINER_STATE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_STATE_INVALID:
- reason = "STATUS_LOG_STATE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_PINNED:
- reason = "STATUS_LOG_PINNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_METADATA_FLUSH_FAILED:
- reason = "STATUS_LOG_METADATA_FLUSH_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_INCONSISTENT_SECURITY:
- reason = "STATUS_LOG_INCONSISTENT_SECURITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_APPENDED_FLUSH_FAILED:
- reason = "STATUS_LOG_APPENDED_FLUSH_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_LOG_PINNED_RESERVATION:
- reason = "STATUS_LOG_PINNED_RESERVATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD:
- reason = "STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_NO_HANDLER_DEFINED:
- reason = "STATUS_FLT_NO_HANDLER_DEFINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_DEFINED:
- reason = "STATUS_FLT_CONTEXT_ALREADY_DEFINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST:
- reason = "STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_DISALLOW_FAST_IO:
- reason = "STATUS_FLT_DISALLOW_FAST_IO";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INVALID_NAME_REQUEST:
- reason = "STATUS_FLT_INVALID_NAME_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_NOT_SAFE_TO_POST_OPERATION:
- reason = "STATUS_FLT_NOT_SAFE_TO_POST_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_NOT_INITIALIZED:
- reason = "STATUS_FLT_NOT_INITIALIZED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_READY:
- reason = "STATUS_FLT_FILTER_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_POST_OPERATION_CLEANUP:
- reason = "STATUS_FLT_POST_OPERATION_CLEANUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INTERNAL_ERROR:
- reason = "STATUS_FLT_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_DELETING_OBJECT:
- reason = "STATUS_FLT_DELETING_OBJECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_MUST_BE_NONPAGED_POOL:
- reason = "STATUS_FLT_MUST_BE_NONPAGED_POOL";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_DUPLICATE_ENTRY:
- reason = "STATUS_FLT_DUPLICATE_ENTRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_CBDQ_DISABLED:
- reason = "STATUS_FLT_CBDQ_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_ATTACH:
- reason = "STATUS_FLT_DO_NOT_ATTACH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_DO_NOT_DETACH:
- reason = "STATUS_FLT_DO_NOT_DETACH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_ALTITUDE_COLLISION:
- reason = "STATUS_FLT_INSTANCE_ALTITUDE_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NAME_COLLISION:
- reason = "STATUS_FLT_INSTANCE_NAME_COLLISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_FILTER_NOT_FOUND:
- reason = "STATUS_FLT_FILTER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_NOT_FOUND:
- reason = "STATUS_FLT_VOLUME_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INSTANCE_NOT_FOUND:
- reason = "STATUS_FLT_INSTANCE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND:
- reason = "STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_INVALID_CONTEXT_REGISTRATION:
- reason = "STATUS_FLT_INVALID_CONTEXT_REGISTRATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_NAME_CACHE_MISS:
- reason = "STATUS_FLT_NAME_CACHE_MISS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_NO_DEVICE_OBJECT:
- reason = "STATUS_FLT_NO_DEVICE_OBJECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_VOLUME_ALREADY_MOUNTED:
- reason = "STATUS_FLT_VOLUME_ALREADY_MOUNTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_ALREADY_ENLISTED:
- reason = "STATUS_FLT_ALREADY_ENLISTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_CONTEXT_ALREADY_LINKED:
- reason = "STATUS_FLT_CONTEXT_ALREADY_LINKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_NO_WAITER_FOR_REPLY:
- reason = "STATUS_FLT_NO_WAITER_FOR_REPLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FLT_REGISTRATION_BUSY:
- reason = "STATUS_FLT_REGISTRATION_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_NO_DESCRIPTOR:
- reason = "STATUS_MONITOR_NO_DESCRIPTOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT:
- reason = "STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM:
- reason = "STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK:
- reason = "STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED:
- reason = "STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK:
- reason = "STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK:
- reason = "STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA:
- reason = "STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK:
- reason = "STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_MONITOR_INVALID_MANUFACTURE_DATE:
- reason = "STATUS_MONITOR_INVALID_MANUFACTURE_DATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER:
- reason = "STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER:
- reason = "STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER:
- reason = "STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_WAS_RESET:
- reason = "STATUS_GRAPHICS_ADAPTER_WAS_RESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_DRIVER_MODEL:
- reason = "STATUS_GRAPHICS_INVALID_DRIVER_MODEL";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_MODE_CHANGED:
- reason = "STATUS_GRAPHICS_PRESENT_MODE_CHANGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_OCCLUDED:
- reason = "STATUS_GRAPHICS_PRESENT_OCCLUDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_DENIED:
- reason = "STATUS_GRAPHICS_PRESENT_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANNOTCOLORCONVERT:
- reason = "STATUS_GRAPHICS_CANNOTCOLORCONVERT";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DRIVER_MISMATCH:
- reason = "STATUS_GRAPHICS_DRIVER_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED:
- reason = "STATUS_GRAPHICS_PRESENT_REDIRECTION_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PRESENT_UNOCCLUDED:
- reason = "STATUS_GRAPHICS_PRESENT_UNOCCLUDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE:
- reason = "STATUS_GRAPHICS_WINDOWDC_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED:
- reason = "STATUS_GRAPHICS_WINDOWLESS_PRESENT_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDEO_MEMORY:
- reason = "STATUS_GRAPHICS_NO_VIDEO_MEMORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_LOCK_MEMORY:
- reason = "STATUS_GRAPHICS_CANT_LOCK_MEMORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_BUSY:
- reason = "STATUS_GRAPHICS_ALLOCATION_BUSY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOO_MANY_REFERENCES:
- reason = "STATUS_GRAPHICS_TOO_MANY_REFERENCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_LATER:
- reason = "STATUS_GRAPHICS_TRY_AGAIN_LATER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TRY_AGAIN_NOW:
- reason = "STATUS_GRAPHICS_TRY_AGAIN_NOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_INVALID:
- reason = "STATUS_GRAPHICS_ALLOCATION_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE:
- reason = "STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED:
- reason = "STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION:
- reason = "STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE:
- reason = "STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION:
- reason = "STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CLOSED:
- reason = "STATUS_GRAPHICS_ALLOCATION_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE:
- reason = "STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE:
- reason = "STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE:
- reason = "STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST:
- reason = "STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE:
- reason = "STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE:
- reason = "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET:
- reason = "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_FREQUENCY:
- reason = "STATUS_GRAPHICS_INVALID_FREQUENCY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_ACTIVE_REGION:
- reason = "STATUS_GRAPHICS_INVALID_ACTIVE_REGION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_TOTAL_REGION:
- reason = "STATUS_GRAPHICS_INVALID_TOTAL_REGION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE:
- reason = "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE:
- reason = "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET:
- reason = "STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET:
- reason = "STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET:
- reason = "STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET:
- reason = "STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET:
- reason = "STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ALREADY_IN_SET:
- reason = "STATUS_GRAPHICS_TARGET_ALREADY_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET:
- reason = "STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE:
- reason = "STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET:
- reason = "STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET:
- reason = "STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_MODESET:
- reason = "STATUS_GRAPHICS_STALE_MODESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET:
- reason = "STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE:
- reason = "STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN:
- reason = "STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE:
- reason = "STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION:
- reason = "STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES:
- reason = "STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE:
- reason = "STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET:
- reason = "STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET:
- reason = "STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR:
- reason = "STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET:
- reason = "STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET:
- reason = "STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE:
- reason = "STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_RESOURCES_NOT_RELATED:
- reason = "STATUS_GRAPHICS_RESOURCES_NOT_RELATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE:
- reason = "STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE:
- reason = "STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET:
- reason = "STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER:
- reason = "STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_VIDPNMGR:
- reason = "STATUS_GRAPHICS_NO_VIDPNMGR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_ACTIVE_VIDPN:
- reason = "STATUS_GRAPHICS_NO_ACTIVE_VIDPN";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NOT_CONNECTED:
- reason = "STATUS_GRAPHICS_MONITOR_NOT_CONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE:
- reason = "STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE:
- reason = "STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_STRIDE:
- reason = "STATUS_GRAPHICS_INVALID_STRIDE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELFORMAT:
- reason = "STATUS_GRAPHICS_INVALID_PIXELFORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COLORBASIS:
- reason = "STATUS_GRAPHICS_INVALID_COLORBASIS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE:
- reason = "STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY:
- reason = "STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT:
- reason = "STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE:
- reason = "STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN:
- reason = "STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL:
- reason = "STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION:
- reason = "STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_GAMMA_RAMP:
- reason = "STATUS_GRAPHICS_INVALID_GAMMA_RAMP";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MODE_NOT_IN_MODESET:
- reason = "STATUS_GRAPHICS_MODE_NOT_IN_MODESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON:
- reason = "STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE:
- reason = "STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE:
- reason = "STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS:
- reason = "STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING:
- reason = "STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED:
- reason = "STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS:
- reason = "STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT:
- reason = "STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM:
- reason = "STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN:
- reason = "STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT:
- reason = "STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED:
- reason = "STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION:
- reason = "STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_CLIENT_TYPE:
- reason = "STATUS_GRAPHICS_INVALID_CLIENT_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET:
- reason = "STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED:
- reason = "STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER:
- reason = "STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED:
- reason = "STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED:
- reason = "STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY:
- reason = "STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED:
- reason = "STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON:
- reason = "STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE:
- reason = "STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER:
- reason = "STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED:
- reason = "STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_OPM_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_COPP_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_COPP_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_UAB_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_UAB_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS:
- reason = "STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST:
- reason = "STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INTERNAL_ERROR:
- reason = "STATUS_GRAPHICS_OPM_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_HANDLE:
- reason = "STATUS_GRAPHICS_OPM_INVALID_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH:
- reason = "STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED:
- reason = "STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED:
- reason = "STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PVP_HFS_FAILED:
- reason = "STATUS_GRAPHICS_PVP_HFS_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_SRM:
- reason = "STATUS_GRAPHICS_OPM_INVALID_SRM";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP:
- reason = "STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP:
- reason = "STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA:
- reason = "STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET:
- reason = "STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH:
- reason = "STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE:
- reason = "STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS:
- reason = "STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS:
- reason = "STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST:
- reason = "STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR:
- reason = "STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS:
- reason = "STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST:
- reason = "STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_I2C_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST:
- reason = "STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA:
- reason = "STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA:
- reason = "STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_DATA:
- reason = "STATUS_GRAPHICS_DDCCI_INVALID_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE:
- reason = "STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING:
- reason = "STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MCA_INTERNAL_ERROR:
- reason = "STATUS_GRAPHICS_MCA_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND:
- reason = "STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH:
- reason = "STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM:
- reason = "STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE:
- reason = "STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS:
- reason = "STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED:
- reason = "STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME:
- reason = "STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP:
- reason = "STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED:
- reason = "STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INVALID_POINTER:
- reason = "STATUS_GRAPHICS_INVALID_POINTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE:
- reason = "STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL:
- reason = "STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_INTERNAL_ERROR:
- reason = "STATUS_GRAPHICS_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS:
- reason = "STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_LOCKED_VOLUME:
- reason = "STATUS_FVE_LOCKED_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_ENCRYPTED:
- reason = "STATUS_FVE_NOT_ENCRYPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_BAD_INFORMATION:
- reason = "STATUS_FVE_BAD_INFORMATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_TOO_SMALL:
- reason = "STATUS_FVE_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_FAILED_WRONG_FS:
- reason = "STATUS_FVE_FAILED_WRONG_FS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_BAD_PARTITION_SIZE:
- reason = "STATUS_FVE_BAD_PARTITION_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_FS_NOT_EXTENDED:
- reason = "STATUS_FVE_FS_NOT_EXTENDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_FS_MOUNTED:
- reason = "STATUS_FVE_FS_MOUNTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NO_LICENSE:
- reason = "STATUS_FVE_NO_LICENSE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_ACTION_NOT_ALLOWED:
- reason = "STATUS_FVE_ACTION_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_BAD_DATA:
- reason = "STATUS_FVE_BAD_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_NOT_BOUND:
- reason = "STATUS_FVE_VOLUME_NOT_BOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_DATA_VOLUME:
- reason = "STATUS_FVE_NOT_DATA_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_CONV_READ_ERROR:
- reason = "STATUS_FVE_CONV_READ_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_CONV_WRITE_ERROR:
- reason = "STATUS_FVE_CONV_WRITE_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_OVERLAPPED_UPDATE:
- reason = "STATUS_FVE_OVERLAPPED_UPDATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_FAILED_SECTOR_SIZE:
- reason = "STATUS_FVE_FAILED_SECTOR_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_FAILED_AUTHENTICATION:
- reason = "STATUS_FVE_FAILED_AUTHENTICATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_OS_VOLUME:
- reason = "STATUS_FVE_NOT_OS_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NOT_FOUND:
- reason = "STATUS_FVE_KEYFILE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_INVALID:
- reason = "STATUS_FVE_KEYFILE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_KEYFILE_NO_VMK:
- reason = "STATUS_FVE_KEYFILE_NO_VMK";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_TPM_DISABLED:
- reason = "STATUS_FVE_TPM_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO:
- reason = "STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_TPM_INVALID_PCR:
- reason = "STATUS_FVE_TPM_INVALID_PCR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_TPM_NO_VMK:
- reason = "STATUS_FVE_TPM_NO_VMK";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_PIN_INVALID:
- reason = "STATUS_FVE_PIN_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_APPLICATION:
- reason = "STATUS_FVE_AUTH_INVALID_APPLICATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_AUTH_INVALID_CONFIG:
- reason = "STATUS_FVE_AUTH_INVALID_CONFIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_DEBUGGER_ENABLED:
- reason = "STATUS_FVE_DEBUGGER_ENABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_DRY_RUN_FAILED:
- reason = "STATUS_FVE_DRY_RUN_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_BAD_METADATA_POINTER:
- reason = "STATUS_FVE_BAD_METADATA_POINTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_OLD_METADATA_COPY:
- reason = "STATUS_FVE_OLD_METADATA_COPY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_REBOOT_REQUIRED:
- reason = "STATUS_FVE_REBOOT_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_RAW_ACCESS:
- reason = "STATUS_FVE_RAW_ACCESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_RAW_BLOCKED:
- reason = "STATUS_FVE_RAW_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY:
- reason = "STATUS_FVE_NO_AUTOUNLOCK_MASTER_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_MOR_FAILED:
- reason = "STATUS_FVE_MOR_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NO_FEATURE_LICENSE:
- reason = "STATUS_FVE_NO_FEATURE_LICENSE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED:
- reason = "STATUS_FVE_POLICY_USER_DISABLE_RDV_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_CONV_RECOVERY_FAILED:
- reason = "STATUS_FVE_CONV_RECOVERY_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG:
- reason = "STATUS_FVE_VIRTUALIZED_SPACE_TOO_BIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_INVALID_DATUM_TYPE:
- reason = "STATUS_FVE_INVALID_DATUM_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_TOO_SMALL:
- reason = "STATUS_FVE_VOLUME_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_ENH_PIN_INVALID:
- reason = "STATUS_FVE_ENH_PIN_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE:
- reason = "STATUS_FVE_FULL_ENCRYPTION_NOT_ALLOWED_ON_TP_STORAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE:
- reason = "STATUS_FVE_WIPE_NOT_ALLOWED_ON_TP_STORAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK:
- reason = "STATUS_FVE_NOT_ALLOWED_ON_CSV_STACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_ON_CLUSTER:
- reason = "STATUS_FVE_NOT_ALLOWED_ON_CLUSTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING:
- reason = "STATUS_FVE_NOT_ALLOWED_TO_UPGRADE_WHILE_CONVERTING";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE:
- reason = "STATUS_FVE_WIPE_CANCEL_NOT_APPLICABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_EDRIVE_DRY_RUN_FAILED:
- reason = "STATUS_FVE_EDRIVE_DRY_RUN_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_DISABLED:
- reason = "STATUS_FVE_SECUREBOOT_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_SECUREBOOT_CONFIG_CHANGE:
- reason = "STATUS_FVE_SECUREBOOT_CONFIG_CHANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_DEVICE_LOCKEDOUT:
- reason = "STATUS_FVE_DEVICE_LOCKEDOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT:
- reason = "STATUS_FVE_VOLUME_EXTEND_PREVENTS_EOW_DECRYPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_NOT_DE_VOLUME:
- reason = "STATUS_FVE_NOT_DE_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_DISABLED:
- reason = "STATUS_FVE_PROTECTION_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED:
- reason = "STATUS_FVE_PROTECTION_CANNOT_BE_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOT_FOUND:
- reason = "STATUS_FWP_CALLOUT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CONDITION_NOT_FOUND:
- reason = "STATUS_FWP_CONDITION_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_FILTER_NOT_FOUND:
- reason = "STATUS_FWP_FILTER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_LAYER_NOT_FOUND:
- reason = "STATUS_FWP_LAYER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_NOT_FOUND:
- reason = "STATUS_FWP_PROVIDER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND:
- reason = "STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_SUBLAYER_NOT_FOUND:
- reason = "STATUS_FWP_SUBLAYER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NOT_FOUND:
- reason = "STATUS_FWP_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_ALREADY_EXISTS:
- reason = "STATUS_FWP_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_IN_USE:
- reason = "STATUS_FWP_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS:
- reason = "STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_WRONG_SESSION:
- reason = "STATUS_FWP_WRONG_SESSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NO_TXN_IN_PROGRESS:
- reason = "STATUS_FWP_NO_TXN_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TXN_IN_PROGRESS:
- reason = "STATUS_FWP_TXN_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TXN_ABORTED:
- reason = "STATUS_FWP_TXN_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_SESSION_ABORTED:
- reason = "STATUS_FWP_SESSION_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_TXN:
- reason = "STATUS_FWP_INCOMPATIBLE_TXN";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TIMEOUT:
- reason = "STATUS_FWP_TIMEOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NET_EVENTS_DISABLED:
- reason = "STATUS_FWP_NET_EVENTS_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_LAYER:
- reason = "STATUS_FWP_INCOMPATIBLE_LAYER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_KM_CLIENTS_ONLY:
- reason = "STATUS_FWP_KM_CLIENTS_ONLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_LIFETIME_MISMATCH:
- reason = "STATUS_FWP_LIFETIME_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_BUILTIN_OBJECT:
- reason = "STATUS_FWP_BUILTIN_OBJECT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_CALLOUTS:
- reason = "STATUS_FWP_TOO_MANY_CALLOUTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NOTIFICATION_DROPPED:
- reason = "STATUS_FWP_NOTIFICATION_DROPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TRAFFIC_MISMATCH:
- reason = "STATUS_FWP_TRAFFIC_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_SA_STATE:
- reason = "STATUS_FWP_INCOMPATIBLE_SA_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NULL_POINTER:
- reason = "STATUS_FWP_NULL_POINTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ENUMERATOR:
- reason = "STATUS_FWP_INVALID_ENUMERATOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_FLAGS:
- reason = "STATUS_FWP_INVALID_FLAGS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_NET_MASK:
- reason = "STATUS_FWP_INVALID_NET_MASK";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_RANGE:
- reason = "STATUS_FWP_INVALID_RANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_INTERVAL:
- reason = "STATUS_FWP_INVALID_INTERVAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_ZERO_LENGTH_ARRAY:
- reason = "STATUS_FWP_ZERO_LENGTH_ARRAY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NULL_DISPLAY_NAME:
- reason = "STATUS_FWP_NULL_DISPLAY_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_ACTION_TYPE:
- reason = "STATUS_FWP_INVALID_ACTION_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_WEIGHT:
- reason = "STATUS_FWP_INVALID_WEIGHT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_MATCH_TYPE_MISMATCH:
- reason = "STATUS_FWP_MATCH_TYPE_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TYPE_MISMATCH:
- reason = "STATUS_FWP_TYPE_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_OUT_OF_BOUNDS:
- reason = "STATUS_FWP_OUT_OF_BOUNDS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_RESERVED:
- reason = "STATUS_FWP_RESERVED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_CONDITION:
- reason = "STATUS_FWP_DUPLICATE_CONDITION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_KEYMOD:
- reason = "STATUS_FWP_DUPLICATE_KEYMOD";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER:
- reason = "STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER:
- reason = "STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER:
- reason = "STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT:
- reason = "STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_AUTH_METHOD:
- reason = "STATUS_FWP_INCOMPATIBLE_AUTH_METHOD";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_DH_GROUP:
- reason = "STATUS_FWP_INCOMPATIBLE_DH_GROUP";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_EM_NOT_SUPPORTED:
- reason = "STATUS_FWP_EM_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_NEVER_MATCH:
- reason = "STATUS_FWP_NEVER_MATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_PROVIDER_CONTEXT_MISMATCH:
- reason = "STATUS_FWP_PROVIDER_CONTEXT_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_PARAMETER:
- reason = "STATUS_FWP_INVALID_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TOO_MANY_SUBLAYERS:
- reason = "STATUS_FWP_TOO_MANY_SUBLAYERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CALLOUT_NOTIFICATION_FAILED:
- reason = "STATUS_FWP_CALLOUT_NOTIFICATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_AUTH_TRANSFORM:
- reason = "STATUS_FWP_INVALID_AUTH_TRANSFORM";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_CIPHER_TRANSFORM:
- reason = "STATUS_FWP_INVALID_CIPHER_TRANSFORM";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM:
- reason = "STATUS_FWP_INCOMPATIBLE_CIPHER_TRANSFORM";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TRANSFORM_COMBINATION:
- reason = "STATUS_FWP_INVALID_TRANSFORM_COMBINATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_DUPLICATE_AUTH_METHOD:
- reason = "STATUS_FWP_DUPLICATE_AUTH_METHOD";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_TUNNEL_ENDPOINT:
- reason = "STATUS_FWP_INVALID_TUNNEL_ENDPOINT";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_L2_DRIVER_NOT_READY:
- reason = "STATUS_FWP_L2_DRIVER_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED:
- reason = "STATUS_FWP_KEY_DICTATOR_ALREADY_REGISTERED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL:
- reason = "STATUS_FWP_KEY_DICTATION_INVALID_KEYING_MATERIAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CONNECTIONS_DISABLED:
- reason = "STATUS_FWP_CONNECTIONS_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INVALID_DNS_NAME:
- reason = "STATUS_FWP_INVALID_DNS_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_STILL_ON:
- reason = "STATUS_FWP_STILL_ON";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_IKEEXT_NOT_RUNNING:
- reason = "STATUS_FWP_IKEEXT_NOT_RUNNING";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_TCPIP_NOT_READY:
- reason = "STATUS_FWP_TCPIP_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_CLOSING:
- reason = "STATUS_FWP_INJECT_HANDLE_CLOSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_INJECT_HANDLE_STALE:
- reason = "STATUS_FWP_INJECT_HANDLE_STALE";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_CANNOT_PEND:
- reason = "STATUS_FWP_CANNOT_PEND";
- break;
- case MD_NTSTATUS_WIN_STATUS_FWP_DROP_NOICMP:
- reason = "STATUS_FWP_DROP_NOICMP";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_CLOSING:
- reason = "STATUS_NDIS_CLOSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_BAD_VERSION:
- reason = "STATUS_NDIS_BAD_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_BAD_CHARACTERISTICS:
- reason = "STATUS_NDIS_BAD_CHARACTERISTICS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_FOUND:
- reason = "STATUS_NDIS_ADAPTER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_OPEN_FAILED:
- reason = "STATUS_NDIS_OPEN_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_DEVICE_FAILED:
- reason = "STATUS_NDIS_DEVICE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_FULL:
- reason = "STATUS_NDIS_MULTICAST_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_EXISTS:
- reason = "STATUS_NDIS_MULTICAST_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_MULTICAST_NOT_FOUND:
- reason = "STATUS_NDIS_MULTICAST_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_REQUEST_ABORTED:
- reason = "STATUS_NDIS_REQUEST_ABORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_RESET_IN_PROGRESS:
- reason = "STATUS_NDIS_RESET_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PACKET:
- reason = "STATUS_NDIS_INVALID_PACKET";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DEVICE_REQUEST:
- reason = "STATUS_NDIS_INVALID_DEVICE_REQUEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_NOT_READY:
- reason = "STATUS_NDIS_ADAPTER_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_LENGTH:
- reason = "STATUS_NDIS_INVALID_LENGTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_DATA:
- reason = "STATUS_NDIS_INVALID_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_BUFFER_TOO_SHORT:
- reason = "STATUS_NDIS_BUFFER_TOO_SHORT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_OID:
- reason = "STATUS_NDIS_INVALID_OID";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_ADAPTER_REMOVED:
- reason = "STATUS_NDIS_ADAPTER_REMOVED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_MEDIA:
- reason = "STATUS_NDIS_UNSUPPORTED_MEDIA";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_GROUP_ADDRESS_IN_USE:
- reason = "STATUS_NDIS_GROUP_ADDRESS_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_FILE_NOT_FOUND:
- reason = "STATUS_NDIS_FILE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_ERROR_READING_FILE:
- reason = "STATUS_NDIS_ERROR_READING_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_ALREADY_MAPPED:
- reason = "STATUS_NDIS_ALREADY_MAPPED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_RESOURCE_CONFLICT:
- reason = "STATUS_NDIS_RESOURCE_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_MEDIA_DISCONNECTED:
- reason = "STATUS_NDIS_MEDIA_DISCONNECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_ADDRESS:
- reason = "STATUS_NDIS_INVALID_ADDRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_PAUSED:
- reason = "STATUS_NDIS_PAUSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INTERFACE_NOT_FOUND:
- reason = "STATUS_NDIS_INTERFACE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_UNSUPPORTED_REVISION:
- reason = "STATUS_NDIS_UNSUPPORTED_REVISION";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT:
- reason = "STATUS_NDIS_INVALID_PORT";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_INVALID_PORT_STATE:
- reason = "STATUS_NDIS_INVALID_PORT_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_LOW_POWER_STATE:
- reason = "STATUS_NDIS_LOW_POWER_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_REINIT_REQUIRED:
- reason = "STATUS_NDIS_REINIT_REQUIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_NOT_SUPPORTED:
- reason = "STATUS_NDIS_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_POLICY:
- reason = "STATUS_NDIS_OFFLOAD_POLICY";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED:
- reason = "STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_OFFLOAD_PATH_REJECTED:
- reason = "STATUS_NDIS_OFFLOAD_PATH_REJECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED:
- reason = "STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_MEDIA_IN_USE:
- reason = "STATUS_NDIS_DOT11_MEDIA_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_DOT11_POWER_STATE_INVALID:
- reason = "STATUS_NDIS_DOT11_POWER_STATE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL:
- reason = "STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL:
- reason = "STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_ERROR_MASK:
- reason = "STATUS_TPM_ERROR_MASK";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AUTHFAIL:
- reason = "STATUS_TPM_AUTHFAIL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BADINDEX:
- reason = "STATUS_TPM_BADINDEX";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAMETER:
- reason = "STATUS_TPM_BAD_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAILURE:
- reason = "STATUS_TPM_AUDITFAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_CLEAR_DISABLED:
- reason = "STATUS_TPM_CLEAR_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DEACTIVATED:
- reason = "STATUS_TPM_DEACTIVATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DISABLED:
- reason = "STATUS_TPM_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DISABLED_CMD:
- reason = "STATUS_TPM_DISABLED_CMD";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_FAIL:
- reason = "STATUS_TPM_FAIL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_ORDINAL:
- reason = "STATUS_TPM_BAD_ORDINAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INSTALL_DISABLED:
- reason = "STATUS_TPM_INSTALL_DISABLED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYHANDLE:
- reason = "STATUS_TPM_INVALID_KEYHANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_KEYNOTFOUND:
- reason = "STATUS_TPM_KEYNOTFOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_ENC:
- reason = "STATUS_TPM_INAPPROPRIATE_ENC";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_MIGRATEFAIL:
- reason = "STATUS_TPM_MIGRATEFAIL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_PCR_INFO:
- reason = "STATUS_TPM_INVALID_PCR_INFO";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOSPACE:
- reason = "STATUS_TPM_NOSPACE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOSRK:
- reason = "STATUS_TPM_NOSRK";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOTSEALED_BLOB:
- reason = "STATUS_TPM_NOTSEALED_BLOB";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_OWNER_SET:
- reason = "STATUS_TPM_OWNER_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_RESOURCES:
- reason = "STATUS_TPM_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_SHORTRANDOM:
- reason = "STATUS_TPM_SHORTRANDOM";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_SIZE:
- reason = "STATUS_TPM_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_WRONGPCRVAL:
- reason = "STATUS_TPM_WRONGPCRVAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_PARAM_SIZE:
- reason = "STATUS_TPM_BAD_PARAM_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_SHA_THREAD:
- reason = "STATUS_TPM_SHA_THREAD";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_SHA_ERROR:
- reason = "STATUS_TPM_SHA_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_FAILEDSELFTEST:
- reason = "STATUS_TPM_FAILEDSELFTEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AUTH2FAIL:
- reason = "STATUS_TPM_AUTH2FAIL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BADTAG:
- reason = "STATUS_TPM_BADTAG";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_IOERROR:
- reason = "STATUS_TPM_IOERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_ENCRYPT_ERROR:
- reason = "STATUS_TPM_ENCRYPT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DECRYPT_ERROR:
- reason = "STATUS_TPM_DECRYPT_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_AUTHHANDLE:
- reason = "STATUS_TPM_INVALID_AUTHHANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NO_ENDORSEMENT:
- reason = "STATUS_TPM_NO_ENDORSEMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_KEYUSAGE:
- reason = "STATUS_TPM_INVALID_KEYUSAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_WRONG_ENTITYTYPE:
- reason = "STATUS_TPM_WRONG_ENTITYTYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_POSTINIT:
- reason = "STATUS_TPM_INVALID_POSTINIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INAPPROPRIATE_SIG:
- reason = "STATUS_TPM_INAPPROPRIATE_SIG";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_KEY_PROPERTY:
- reason = "STATUS_TPM_BAD_KEY_PROPERTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_MIGRATION:
- reason = "STATUS_TPM_BAD_MIGRATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_SCHEME:
- reason = "STATUS_TPM_BAD_SCHEME";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_DATASIZE:
- reason = "STATUS_TPM_BAD_DATASIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_MODE:
- reason = "STATUS_TPM_BAD_MODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_PRESENCE:
- reason = "STATUS_TPM_BAD_PRESENCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_VERSION:
- reason = "STATUS_TPM_BAD_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NO_WRAP_TRANSPORT:
- reason = "STATUS_TPM_NO_WRAP_TRANSPORT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_UNSUCCESSFUL:
- reason = "STATUS_TPM_AUDITFAIL_UNSUCCESSFUL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AUDITFAIL_SUCCESSFUL:
- reason = "STATUS_TPM_AUDITFAIL_SUCCESSFUL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOTRESETABLE:
- reason = "STATUS_TPM_NOTRESETABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOTLOCAL:
- reason = "STATUS_TPM_NOTLOCAL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_TYPE:
- reason = "STATUS_TPM_BAD_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_RESOURCE:
- reason = "STATUS_TPM_INVALID_RESOURCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOTFIPS:
- reason = "STATUS_TPM_NOTFIPS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_FAMILY:
- reason = "STATUS_TPM_INVALID_FAMILY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NO_NV_PERMISSION:
- reason = "STATUS_TPM_NO_NV_PERMISSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_REQUIRES_SIGN:
- reason = "STATUS_TPM_REQUIRES_SIGN";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_KEY_NOTSUPPORTED:
- reason = "STATUS_TPM_KEY_NOTSUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AUTH_CONFLICT:
- reason = "STATUS_TPM_AUTH_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_AREA_LOCKED:
- reason = "STATUS_TPM_AREA_LOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_LOCALITY:
- reason = "STATUS_TPM_BAD_LOCALITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_READ_ONLY:
- reason = "STATUS_TPM_READ_ONLY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_PER_NOWRITE:
- reason = "STATUS_TPM_PER_NOWRITE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_FAMILYCOUNT:
- reason = "STATUS_TPM_FAMILYCOUNT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_WRITE_LOCKED:
- reason = "STATUS_TPM_WRITE_LOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_ATTRIBUTES:
- reason = "STATUS_TPM_BAD_ATTRIBUTES";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_STRUCTURE:
- reason = "STATUS_TPM_INVALID_STRUCTURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_KEY_OWNER_CONTROL:
- reason = "STATUS_TPM_KEY_OWNER_CONTROL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_COUNTER:
- reason = "STATUS_TPM_BAD_COUNTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOT_FULLWRITE:
- reason = "STATUS_TPM_NOT_FULLWRITE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_CONTEXT_GAP:
- reason = "STATUS_TPM_CONTEXT_GAP";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_MAXNVWRITES:
- reason = "STATUS_TPM_MAXNVWRITES";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOOPERATOR:
- reason = "STATUS_TPM_NOOPERATOR";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_RESOURCEMISSING:
- reason = "STATUS_TPM_RESOURCEMISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_LOCK:
- reason = "STATUS_TPM_DELEGATE_LOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_FAMILY:
- reason = "STATUS_TPM_DELEGATE_FAMILY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DELEGATE_ADMIN:
- reason = "STATUS_TPM_DELEGATE_ADMIN";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_TRANSPORT_NOTEXCLUSIVE:
- reason = "STATUS_TPM_TRANSPORT_NOTEXCLUSIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_OWNER_CONTROL:
- reason = "STATUS_TPM_OWNER_CONTROL";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_RESOURCES:
- reason = "STATUS_TPM_DAA_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA0:
- reason = "STATUS_TPM_DAA_INPUT_DATA0";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_INPUT_DATA1:
- reason = "STATUS_TPM_DAA_INPUT_DATA1";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_SETTINGS:
- reason = "STATUS_TPM_DAA_ISSUER_SETTINGS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_TPM_SETTINGS:
- reason = "STATUS_TPM_DAA_TPM_SETTINGS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_STAGE:
- reason = "STATUS_TPM_DAA_STAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_ISSUER_VALIDITY:
- reason = "STATUS_TPM_DAA_ISSUER_VALIDITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DAA_WRONG_W:
- reason = "STATUS_TPM_DAA_WRONG_W";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_HANDLE:
- reason = "STATUS_TPM_BAD_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_DELEGATE:
- reason = "STATUS_TPM_BAD_DELEGATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BADCONTEXT:
- reason = "STATUS_TPM_BADCONTEXT";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_TOOMANYCONTEXTS:
- reason = "STATUS_TPM_TOOMANYCONTEXTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_MA_TICKET_SIGNATURE:
- reason = "STATUS_TPM_MA_TICKET_SIGNATURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_MA_DESTINATION:
- reason = "STATUS_TPM_MA_DESTINATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_MA_SOURCE:
- reason = "STATUS_TPM_MA_SOURCE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_MA_AUTHORITY:
- reason = "STATUS_TPM_MA_AUTHORITY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_PERMANENTEK:
- reason = "STATUS_TPM_PERMANENTEK";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_BAD_SIGNATURE:
- reason = "STATUS_TPM_BAD_SIGNATURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOCONTEXTSPACE:
- reason = "STATUS_TPM_NOCONTEXTSPACE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_BLOCKED:
- reason = "STATUS_TPM_COMMAND_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INVALID_HANDLE:
- reason = "STATUS_TPM_INVALID_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DUPLICATE_VHANDLE:
- reason = "STATUS_TPM_DUPLICATE_VHANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_BLOCKED:
- reason = "STATUS_TPM_EMBEDDED_COMMAND_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED:
- reason = "STATUS_TPM_EMBEDDED_COMMAND_UNSUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_RETRY:
- reason = "STATUS_TPM_RETRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NEEDS_SELFTEST:
- reason = "STATUS_TPM_NEEDS_SELFTEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DOING_SELFTEST:
- reason = "STATUS_TPM_DOING_SELFTEST";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_DEFEND_LOCK_RUNNING:
- reason = "STATUS_TPM_DEFEND_LOCK_RUNNING";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_COMMAND_CANCELED:
- reason = "STATUS_TPM_COMMAND_CANCELED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_TOO_MANY_CONTEXTS:
- reason = "STATUS_TPM_TOO_MANY_CONTEXTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_NOT_FOUND:
- reason = "STATUS_TPM_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_ACCESS_DENIED:
- reason = "STATUS_TPM_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_INSUFFICIENT_BUFFER:
- reason = "STATUS_TPM_INSUFFICIENT_BUFFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_TPM_PPI_FUNCTION_UNSUPPORTED:
- reason = "STATUS_TPM_PPI_FUNCTION_UNSUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_ERROR_MASK:
- reason = "STATUS_PCP_ERROR_MASK";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_READY:
- reason = "STATUS_PCP_DEVICE_NOT_READY";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_INVALID_HANDLE:
- reason = "STATUS_PCP_INVALID_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_INVALID_PARAMETER:
- reason = "STATUS_PCP_INVALID_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_FLAG_NOT_SUPPORTED:
- reason = "STATUS_PCP_FLAG_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_NOT_SUPPORTED:
- reason = "STATUS_PCP_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_BUFFER_TOO_SMALL:
- reason = "STATUS_PCP_BUFFER_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_INTERNAL_ERROR:
- reason = "STATUS_PCP_INTERNAL_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_FAILED:
- reason = "STATUS_PCP_AUTHENTICATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_AUTHENTICATION_IGNORED:
- reason = "STATUS_PCP_AUTHENTICATION_IGNORED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_POLICY_NOT_FOUND:
- reason = "STATUS_PCP_POLICY_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_PROFILE_NOT_FOUND:
- reason = "STATUS_PCP_PROFILE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_VALIDATION_FAILED:
- reason = "STATUS_PCP_VALIDATION_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_PCP_DEVICE_NOT_FOUND:
- reason = "STATUS_PCP_DEVICE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_CODE:
- reason = "STATUS_HV_INVALID_HYPERCALL_CODE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_HYPERCALL_INPUT:
- reason = "STATUS_HV_INVALID_HYPERCALL_INPUT";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_ALIGNMENT:
- reason = "STATUS_HV_INVALID_ALIGNMENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARAMETER:
- reason = "STATUS_HV_INVALID_PARAMETER";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_ACCESS_DENIED:
- reason = "STATUS_HV_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_STATE:
- reason = "STATUS_HV_INVALID_PARTITION_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_OPERATION_DENIED:
- reason = "STATUS_HV_OPERATION_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_UNKNOWN_PROPERTY:
- reason = "STATUS_HV_UNKNOWN_PROPERTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE:
- reason = "STATUS_HV_PROPERTY_VALUE_OUT_OF_RANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_MEMORY:
- reason = "STATUS_HV_INSUFFICIENT_MEMORY";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_PARTITION_TOO_DEEP:
- reason = "STATUS_HV_PARTITION_TOO_DEEP";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_PARTITION_ID:
- reason = "STATUS_HV_INVALID_PARTITION_ID";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_VP_INDEX:
- reason = "STATUS_HV_INVALID_VP_INDEX";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_PORT_ID:
- reason = "STATUS_HV_INVALID_PORT_ID";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_CONNECTION_ID:
- reason = "STATUS_HV_INVALID_CONNECTION_ID";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFERS:
- reason = "STATUS_HV_INSUFFICIENT_BUFFERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_NOT_ACKNOWLEDGED:
- reason = "STATUS_HV_NOT_ACKNOWLEDGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_ACKNOWLEDGED:
- reason = "STATUS_HV_ACKNOWLEDGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_SAVE_RESTORE_STATE:
- reason = "STATUS_HV_INVALID_SAVE_RESTORE_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_SYNIC_STATE:
- reason = "STATUS_HV_INVALID_SYNIC_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_OBJECT_IN_USE:
- reason = "STATUS_HV_OBJECT_IN_USE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO:
- reason = "STATUS_HV_INVALID_PROXIMITY_DOMAIN_INFO";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_NO_DATA:
- reason = "STATUS_HV_NO_DATA";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INACTIVE:
- reason = "STATUS_HV_INACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_NO_RESOURCES:
- reason = "STATUS_HV_NO_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_FEATURE_UNAVAILABLE:
- reason = "STATUS_HV_FEATURE_UNAVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_BUFFER:
- reason = "STATUS_HV_INSUFFICIENT_BUFFER";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS:
- reason = "STATUS_HV_INSUFFICIENT_DEVICE_DOMAINS";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_INVALID_LP_INDEX:
- reason = "STATUS_HV_INVALID_LP_INDEX";
- break;
- case MD_NTSTATUS_WIN_STATUS_HV_NOT_PRESENT:
- reason = "STATUS_HV_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_BAD_SPI:
- reason = "STATUS_IPSEC_BAD_SPI";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_SA_LIFETIME_EXPIRED:
- reason = "STATUS_IPSEC_SA_LIFETIME_EXPIRED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_WRONG_SA:
- reason = "STATUS_IPSEC_WRONG_SA";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_REPLAY_CHECK_FAILED:
- reason = "STATUS_IPSEC_REPLAY_CHECK_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_INVALID_PACKET:
- reason = "STATUS_IPSEC_INVALID_PACKET";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_INTEGRITY_CHECK_FAILED:
- reason = "STATUS_IPSEC_INTEGRITY_CHECK_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_CLEAR_TEXT_DROP:
- reason = "STATUS_IPSEC_CLEAR_TEXT_DROP";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_AUTH_FIREWALL_DROP:
- reason = "STATUS_IPSEC_AUTH_FIREWALL_DROP";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_THROTTLE_DROP:
- reason = "STATUS_IPSEC_THROTTLE_DROP";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_BLOCK:
- reason = "STATUS_IPSEC_DOSP_BLOCK";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_RECEIVED_MULTICAST:
- reason = "STATUS_IPSEC_DOSP_RECEIVED_MULTICAST";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_INVALID_PACKET:
- reason = "STATUS_IPSEC_DOSP_INVALID_PACKET";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED:
- reason = "STATUS_IPSEC_DOSP_STATE_LOOKUP_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_ENTRIES:
- reason = "STATUS_IPSEC_DOSP_MAX_ENTRIES";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED:
- reason = "STATUS_IPSEC_DOSP_KEYMOD_NOT_ALLOWED";
- break;
- case MD_NTSTATUS_WIN_STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES:
- reason = "STATUS_IPSEC_DOSP_MAX_PER_IP_RATELIMIT_QUEUES";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_DUPLICATE_HANDLER:
- reason = "STATUS_VID_DUPLICATE_HANDLER";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_TOO_MANY_HANDLERS:
- reason = "STATUS_VID_TOO_MANY_HANDLERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_QUEUE_FULL:
- reason = "STATUS_VID_QUEUE_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_HANDLER_NOT_PRESENT:
- reason = "STATUS_VID_HANDLER_NOT_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_OBJECT_NAME:
- reason = "STATUS_VID_INVALID_OBJECT_NAME";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_TOO_LONG:
- reason = "STATUS_VID_PARTITION_NAME_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG:
- reason = "STATUS_VID_MESSAGE_QUEUE_NAME_TOO_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_PARTITION_ALREADY_EXISTS:
- reason = "STATUS_VID_PARTITION_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_PARTITION_DOES_NOT_EXIST:
- reason = "STATUS_VID_PARTITION_DOES_NOT_EXIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_PARTITION_NAME_NOT_FOUND:
- reason = "STATUS_VID_PARTITION_NAME_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS:
- reason = "STATUS_VID_MESSAGE_QUEUE_ALREADY_EXISTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT:
- reason = "STATUS_VID_EXCEEDED_MBP_ENTRY_MAP_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MB_STILL_REFERENCED:
- reason = "STATUS_VID_MB_STILL_REFERENCED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED:
- reason = "STATUS_VID_CHILD_GPA_PAGE_SET_CORRUPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_SETTINGS:
- reason = "STATUS_VID_INVALID_NUMA_SETTINGS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_NUMA_NODE_INDEX:
- reason = "STATUS_VID_INVALID_NUMA_NODE_INDEX";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED:
- reason = "STATUS_VID_NOTIFICATION_QUEUE_ALREADY_ASSOCIATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE:
- reason = "STATUS_VID_INVALID_MEMORY_BLOCK_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_PAGE_RANGE_OVERFLOW:
- reason = "STATUS_VID_PAGE_RANGE_OVERFLOW";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE:
- reason = "STATUS_VID_INVALID_MESSAGE_QUEUE_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_GPA_RANGE_HANDLE:
- reason = "STATUS_VID_INVALID_GPA_RANGE_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE:
- reason = "STATUS_VID_NO_MEMORY_BLOCK_NOTIFICATION_QUEUE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED:
- reason = "STATUS_VID_MEMORY_BLOCK_LOCK_COUNT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_PPM_HANDLE:
- reason = "STATUS_VID_INVALID_PPM_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MBPS_ARE_LOCKED:
- reason = "STATUS_VID_MBPS_ARE_LOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MESSAGE_QUEUE_CLOSED:
- reason = "STATUS_VID_MESSAGE_QUEUE_CLOSED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED:
- reason = "STATUS_VID_VIRTUAL_PROCESSOR_LIMIT_EXCEEDED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_STOP_PENDING:
- reason = "STATUS_VID_STOP_PENDING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_PROCESSOR_STATE:
- reason = "STATUS_VID_INVALID_PROCESSOR_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT:
- reason = "STATUS_VID_EXCEEDED_KM_CONTEXT_COUNT_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED:
- reason = "STATUS_VID_KM_INTERFACE_ALREADY_INITIALIZED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET:
- reason = "STATUS_VID_MB_PROPERTY_ALREADY_SET_RESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MMIO_RANGE_DESTROYED:
- reason = "STATUS_VID_MMIO_RANGE_DESTROYED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_INVALID_CHILD_GPA_PAGE_SET:
- reason = "STATUS_VID_INVALID_CHILD_GPA_PAGE_SET";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED:
- reason = "STATUS_VID_RESERVE_PAGE_SET_IS_BEING_USED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL:
- reason = "STATUS_VID_RESERVE_PAGE_SET_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE:
- reason = "STATUS_VID_MBP_ALREADY_LOCKED_USING_RESERVED_PAGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT:
- reason = "STATUS_VID_MBP_COUNT_EXCEEDED_LIMIT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_CORRUPT:
- reason = "STATUS_VID_SAVED_STATE_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM:
- reason = "STATUS_VID_SAVED_STATE_UNRECOGNIZED_ITEM";
- break;
- case MD_NTSTATUS_WIN_STATUS_VID_SAVED_STATE_INCOMPATIBLE:
- reason = "STATUS_VID_SAVED_STATE_INCOMPATIBLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DATABASE_FULL:
- reason = "STATUS_VOLMGR_DATABASE_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED:
- reason = "STATUS_VOLMGR_DISK_CONFIGURATION_CORRUPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC:
- reason = "STATUS_VOLMGR_DISK_CONFIGURATION_NOT_IN_SYNC";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED:
- reason = "STATUS_VOLMGR_PACK_CONFIG_UPDATE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME:
- reason = "STATUS_VOLMGR_DISK_CONTAINS_NON_SIMPLE_VOLUME";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DUPLICATE:
- reason = "STATUS_VOLMGR_DISK_DUPLICATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_DYNAMIC:
- reason = "STATUS_VOLMGR_DISK_DYNAMIC";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_ID_INVALID:
- reason = "STATUS_VOLMGR_DISK_ID_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_INVALID:
- reason = "STATUS_VOLMGR_DISK_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAST_VOTER:
- reason = "STATUS_VOLMGR_DISK_LAST_VOTER";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_INVALID:
- reason = "STATUS_VOLMGR_DISK_LAYOUT_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS:
- reason = "STATUS_VOLMGR_DISK_LAYOUT_NON_BASIC_BETWEEN_BASIC_PARTITIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED:
- reason = "STATUS_VOLMGR_DISK_LAYOUT_NOT_CYLINDER_ALIGNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL:
- reason = "STATUS_VOLMGR_DISK_LAYOUT_PARTITIONS_TOO_SMALL";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS:
- reason = "STATUS_VOLMGR_DISK_LAYOUT_PRIMARY_BETWEEN_LOGICAL_PARTITIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS:
- reason = "STATUS_VOLMGR_DISK_LAYOUT_TOO_MANY_PARTITIONS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_MISSING:
- reason = "STATUS_VOLMGR_DISK_MISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_EMPTY:
- reason = "STATUS_VOLMGR_DISK_NOT_EMPTY";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE:
- reason = "STATUS_VOLMGR_DISK_NOT_ENOUGH_SPACE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_REVECTORING_FAILED:
- reason = "STATUS_VOLMGR_DISK_REVECTORING_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID:
- reason = "STATUS_VOLMGR_DISK_SECTOR_SIZE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_SET_NOT_CONTAINED:
- reason = "STATUS_VOLMGR_DISK_SET_NOT_CONTAINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS:
- reason = "STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_MEMBERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES:
- reason = "STATUS_VOLMGR_DISK_USED_BY_MULTIPLE_PLEXES";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED:
- reason = "STATUS_VOLMGR_DYNAMIC_DISK_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_ALREADY_USED:
- reason = "STATUS_VOLMGR_EXTENT_ALREADY_USED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS:
- reason = "STATUS_VOLMGR_EXTENT_NOT_CONTIGUOUS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION:
- reason = "STATUS_VOLMGR_EXTENT_NOT_IN_PUBLIC_REGION";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED:
- reason = "STATUS_VOLMGR_EXTENT_NOT_SECTOR_ALIGNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION:
- reason = "STATUS_VOLMGR_EXTENT_OVERLAPS_EBR_PARTITION";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH:
- reason = "STATUS_VOLMGR_EXTENT_VOLUME_LENGTHS_DO_NOT_MATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED:
- reason = "STATUS_VOLMGR_FAULT_TOLERANT_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID:
- reason = "STATUS_VOLMGR_INTERLEAVE_LENGTH_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS:
- reason = "STATUS_VOLMGR_MAXIMUM_REGISTERED_USERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_IN_SYNC:
- reason = "STATUS_VOLMGR_MEMBER_IN_SYNC";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE:
- reason = "STATUS_VOLMGR_MEMBER_INDEX_DUPLICATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_INDEX_INVALID:
- reason = "STATUS_VOLMGR_MEMBER_INDEX_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_MISSING:
- reason = "STATUS_VOLMGR_MEMBER_MISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_NOT_DETACHED:
- reason = "STATUS_VOLMGR_MEMBER_NOT_DETACHED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MEMBER_REGENERATING:
- reason = "STATUS_VOLMGR_MEMBER_REGENERATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_ALL_DISKS_FAILED:
- reason = "STATUS_VOLMGR_ALL_DISKS_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_REGISTERED_USERS:
- reason = "STATUS_VOLMGR_NO_REGISTERED_USERS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_SUCH_USER:
- reason = "STATUS_VOLMGR_NO_SUCH_USER";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NOTIFICATION_RESET:
- reason = "STATUS_VOLMGR_NOTIFICATION_RESET";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID:
- reason = "STATUS_VOLMGR_NUMBER_OF_MEMBERS_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID:
- reason = "STATUS_VOLMGR_NUMBER_OF_PLEXES_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_DUPLICATE:
- reason = "STATUS_VOLMGR_PACK_DUPLICATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_ID_INVALID:
- reason = "STATUS_VOLMGR_PACK_ID_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_INVALID:
- reason = "STATUS_VOLMGR_PACK_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_NAME_INVALID:
- reason = "STATUS_VOLMGR_PACK_NAME_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_OFFLINE:
- reason = "STATUS_VOLMGR_PACK_OFFLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_HAS_QUORUM:
- reason = "STATUS_VOLMGR_PACK_HAS_QUORUM";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_WITHOUT_QUORUM:
- reason = "STATUS_VOLMGR_PACK_WITHOUT_QUORUM";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_STYLE_INVALID:
- reason = "STATUS_VOLMGR_PARTITION_STYLE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PARTITION_UPDATE_FAILED:
- reason = "STATUS_VOLMGR_PARTITION_UPDATE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_IN_SYNC:
- reason = "STATUS_VOLMGR_PLEX_IN_SYNC";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_DUPLICATE:
- reason = "STATUS_VOLMGR_PLEX_INDEX_DUPLICATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_INDEX_INVALID:
- reason = "STATUS_VOLMGR_PLEX_INDEX_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_LAST_ACTIVE:
- reason = "STATUS_VOLMGR_PLEX_LAST_ACTIVE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_MISSING:
- reason = "STATUS_VOLMGR_PLEX_MISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_REGENERATING:
- reason = "STATUS_VOLMGR_PLEX_REGENERATING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_TYPE_INVALID:
- reason = "STATUS_VOLMGR_PLEX_TYPE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_RAID5:
- reason = "STATUS_VOLMGR_PLEX_NOT_RAID5";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE:
- reason = "STATUS_VOLMGR_PLEX_NOT_SIMPLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_STRUCTURE_SIZE_INVALID:
- reason = "STATUS_VOLMGR_STRUCTURE_SIZE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS:
- reason = "STATUS_VOLMGR_TOO_MANY_NOTIFICATION_REQUESTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_TRANSACTION_IN_PROGRESS:
- reason = "STATUS_VOLMGR_TRANSACTION_IN_PROGRESS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE:
- reason = "STATUS_VOLMGR_UNEXPECTED_DISK_LAYOUT_CHANGE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK:
- reason = "STATUS_VOLMGR_VOLUME_CONTAINS_MISSING_DISK";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_ID_INVALID:
- reason = "STATUS_VOLMGR_VOLUME_ID_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_INVALID:
- reason = "STATUS_VOLMGR_VOLUME_LENGTH_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE:
- reason = "STATUS_VOLMGR_VOLUME_LENGTH_NOT_SECTOR_SIZE_MULTIPLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_MIRRORED:
- reason = "STATUS_VOLMGR_VOLUME_NOT_MIRRORED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_NOT_RETAINED:
- reason = "STATUS_VOLMGR_VOLUME_NOT_RETAINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_OFFLINE:
- reason = "STATUS_VOLMGR_VOLUME_OFFLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_RETAINED:
- reason = "STATUS_VOLMGR_VOLUME_RETAINED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID:
- reason = "STATUS_VOLMGR_NUMBER_OF_EXTENTS_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE:
- reason = "STATUS_VOLMGR_DIFFERENT_SECTOR_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_BAD_BOOT_DISK:
- reason = "STATUS_VOLMGR_BAD_BOOT_DISK";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_OFFLINE:
- reason = "STATUS_VOLMGR_PACK_CONFIG_OFFLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_CONFIG_ONLINE:
- reason = "STATUS_VOLMGR_PACK_CONFIG_ONLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NOT_PRIMARY_PACK:
- reason = "STATUS_VOLMGR_NOT_PRIMARY_PACK";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED:
- reason = "STATUS_VOLMGR_PACK_LOG_UPDATE_FAILED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID:
- reason = "STATUS_VOLMGR_NUMBER_OF_DISKS_IN_PLEX_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID:
- reason = "STATUS_VOLMGR_NUMBER_OF_DISKS_IN_MEMBER_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_VOLUME_MIRRORED:
- reason = "STATUS_VOLMGR_VOLUME_MIRRORED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED:
- reason = "STATUS_VOLMGR_PLEX_NOT_SIMPLE_SPANNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NO_VALID_LOG_COPIES:
- reason = "STATUS_VOLMGR_NO_VALID_LOG_COPIES";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_PRIMARY_PACK_PRESENT:
- reason = "STATUS_VOLMGR_PRIMARY_PACK_PRESENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID:
- reason = "STATUS_VOLMGR_NUMBER_OF_DISKS_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_MIRROR_NOT_SUPPORTED:
- reason = "STATUS_VOLMGR_MIRROR_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLMGR_RAID5_NOT_SUPPORTED:
- reason = "STATUS_VOLMGR_RAID5_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BCD_TOO_MANY_ELEMENTS:
- reason = "STATUS_BCD_TOO_MANY_ELEMENTS";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_MISSING:
- reason = "STATUS_VHD_DRIVE_FOOTER_MISSING";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH:
- reason = "STATUS_VHD_DRIVE_FOOTER_CHECKSUM_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_DRIVE_FOOTER_CORRUPT:
- reason = "STATUS_VHD_DRIVE_FOOTER_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNKNOWN:
- reason = "STATUS_VHD_FORMAT_UNKNOWN";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_FORMAT_UNSUPPORTED_VERSION:
- reason = "STATUS_VHD_FORMAT_UNSUPPORTED_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH:
- reason = "STATUS_VHD_SPARSE_HEADER_CHECKSUM_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION:
- reason = "STATUS_VHD_SPARSE_HEADER_UNSUPPORTED_VERSION";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_SPARSE_HEADER_CORRUPT:
- reason = "STATUS_VHD_SPARSE_HEADER_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_FAILURE:
- reason = "STATUS_VHD_BLOCK_ALLOCATION_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT:
- reason = "STATUS_VHD_BLOCK_ALLOCATION_TABLE_CORRUPT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_INVALID_BLOCK_SIZE:
- reason = "STATUS_VHD_INVALID_BLOCK_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_BITMAP_MISMATCH:
- reason = "STATUS_VHD_BITMAP_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_NOT_FOUND:
- reason = "STATUS_VHD_PARENT_VHD_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_ID_MISMATCH:
- reason = "STATUS_VHD_CHILD_PARENT_ID_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH:
- reason = "STATUS_VHD_CHILD_PARENT_TIMESTAMP_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_METADATA_READ_FAILURE:
- reason = "STATUS_VHD_METADATA_READ_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_METADATA_WRITE_FAILURE:
- reason = "STATUS_VHD_METADATA_WRITE_FAILURE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_INVALID_SIZE:
- reason = "STATUS_VHD_INVALID_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_INVALID_FILE_SIZE:
- reason = "STATUS_VHD_INVALID_FILE_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTDISK_PROVIDER_NOT_FOUND:
- reason = "STATUS_VIRTDISK_PROVIDER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTDISK_NOT_VIRTUAL_DISK:
- reason = "STATUS_VIRTDISK_NOT_VIRTUAL_DISK";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_PARENT_VHD_ACCESS_DENIED:
- reason = "STATUS_VHD_PARENT_VHD_ACCESS_DENIED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH:
- reason = "STATUS_VHD_CHILD_PARENT_SIZE_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED:
- reason = "STATUS_VHD_DIFFERENCING_CHAIN_CYCLE_DETECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT:
- reason = "STATUS_VHD_DIFFERENCING_CHAIN_ERROR_IN_PARENT";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTUAL_DISK_LIMITATION:
- reason = "STATUS_VIRTUAL_DISK_LIMITATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_INVALID_TYPE:
- reason = "STATUS_VHD_INVALID_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_INVALID_STATE:
- reason = "STATUS_VHD_INVALID_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE:
- reason = "STATUS_VIRTDISK_UNSUPPORTED_DISK_SECTOR_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ALREADY_OWNED:
- reason = "STATUS_VIRTDISK_DISK_ALREADY_OWNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE:
- reason = "STATUS_VIRTDISK_DISK_ONLINE_AND_WRITABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTLOG_TRACKING_NOT_INITIALIZED:
- reason = "STATUS_CTLOG_TRACKING_NOT_INITIALIZED";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE:
- reason = "STATUS_CTLOG_LOGFILE_SIZE_EXCEEDED_MAXSIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTLOG_VHD_CHANGED_OFFLINE:
- reason = "STATUS_CTLOG_VHD_CHANGED_OFFLINE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTLOG_INVALID_TRACKING_STATE:
- reason = "STATUS_CTLOG_INVALID_TRACKING_STATE";
- break;
- case MD_NTSTATUS_WIN_STATUS_CTLOG_INCONSISTENT_TRACKING_FILE:
- reason = "STATUS_CTLOG_INCONSISTENT_TRACKING_FILE";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_METADATA_FULL:
- reason = "STATUS_VHD_METADATA_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_RKF_KEY_NOT_FOUND:
- reason = "STATUS_RKF_KEY_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_RKF_DUPLICATE_KEY:
- reason = "STATUS_RKF_DUPLICATE_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_RKF_BLOB_FULL:
- reason = "STATUS_RKF_BLOB_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_RKF_STORE_FULL:
- reason = "STATUS_RKF_STORE_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_RKF_FILE_BLOCKED:
- reason = "STATUS_RKF_FILE_BLOCKED";
- break;
- case MD_NTSTATUS_WIN_STATUS_RKF_ACTIVE_KEY:
- reason = "STATUS_RKF_ACTIVE_KEY";
- break;
- case MD_NTSTATUS_WIN_STATUS_RDBSS_RESTART_OPERATION:
- reason = "STATUS_RDBSS_RESTART_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_RDBSS_CONTINUE_OPERATION:
- reason = "STATUS_RDBSS_CONTINUE_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_RDBSS_POST_OPERATION:
- reason = "STATUS_RDBSS_POST_OPERATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_HANDLE:
- reason = "STATUS_BTH_ATT_INVALID_HANDLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_READ_NOT_PERMITTED:
- reason = "STATUS_BTH_ATT_READ_NOT_PERMITTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_WRITE_NOT_PERMITTED:
- reason = "STATUS_BTH_ATT_WRITE_NOT_PERMITTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_PDU:
- reason = "STATUS_BTH_ATT_INVALID_PDU";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION:
- reason = "STATUS_BTH_ATT_INSUFFICIENT_AUTHENTICATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED:
- reason = "STATUS_BTH_ATT_REQUEST_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_OFFSET:
- reason = "STATUS_BTH_ATT_INVALID_OFFSET";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION:
- reason = "STATUS_BTH_ATT_INSUFFICIENT_AUTHORIZATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_PREPARE_QUEUE_FULL:
- reason = "STATUS_BTH_ATT_PREPARE_QUEUE_FULL";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND:
- reason = "STATUS_BTH_ATT_ATTRIBUTE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG:
- reason = "STATUS_BTH_ATT_ATTRIBUTE_NOT_LONG";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE:
- reason = "STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION_KEY_SIZE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH:
- reason = "STATUS_BTH_ATT_INVALID_ATTRIBUTE_VALUE_LENGTH";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNLIKELY:
- reason = "STATUS_BTH_ATT_UNLIKELY";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION:
- reason = "STATUS_BTH_ATT_INSUFFICIENT_ENCRYPTION";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE:
- reason = "STATUS_BTH_ATT_UNSUPPORTED_GROUP_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_INSUFFICIENT_RESOURCES:
- reason = "STATUS_BTH_ATT_INSUFFICIENT_RESOURCES";
- break;
- case MD_NTSTATUS_WIN_STATUS_BTH_ATT_UNKNOWN_ERROR:
- reason = "STATUS_BTH_ATT_UNKNOWN_ERROR";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECUREBOOT_ROLLBACK_DETECTED:
- reason = "STATUS_SECUREBOOT_ROLLBACK_DETECTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_VIOLATION:
- reason = "STATUS_SECUREBOOT_POLICY_VIOLATION";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECUREBOOT_INVALID_POLICY:
- reason = "STATUS_SECUREBOOT_INVALID_POLICY";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND:
- reason = "STATUS_SECUREBOOT_POLICY_PUBLISHER_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECUREBOOT_POLICY_NOT_SIGNED:
- reason = "STATUS_SECUREBOOT_POLICY_NOT_SIGNED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SECUREBOOT_FILE_REPLACED:
- reason = "STATUS_SECUREBOOT_FILE_REPLACED";
- break;
- case MD_NTSTATUS_WIN_STATUS_AUDIO_ENGINE_NODE_NOT_FOUND:
- reason = "STATUS_AUDIO_ENGINE_NODE_NOT_FOUND";
- break;
- case MD_NTSTATUS_WIN_STATUS_HDAUDIO_EMPTY_CONNECTION_LIST:
- reason = "STATUS_HDAUDIO_EMPTY_CONNECTION_LIST";
- break;
- case MD_NTSTATUS_WIN_STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED:
- reason = "STATUS_HDAUDIO_CONNECTION_LIST_NOT_SUPPORTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED:
- reason = "STATUS_HDAUDIO_NO_LOGICAL_DEVICES_CREATED";
- break;
- case MD_NTSTATUS_WIN_STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY:
- reason = "STATUS_HDAUDIO_NULL_LINKED_LIST_ENTRY";
- break;
- case MD_NTSTATUS_WIN_STATUS_VOLSNAP_BOOTFILE_NOT_VALID:
- reason = "STATUS_VOLSNAP_BOOTFILE_NOT_VALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_IO_PREEMPTED:
- reason = "STATUS_IO_PREEMPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_STORED:
- reason = "STATUS_SVHDX_ERROR_STORED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_ERROR_NOT_AVAILABLE:
- reason = "STATUS_SVHDX_ERROR_NOT_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE:
- reason = "STATUS_SVHDX_UNIT_ATTENTION_AVAILABLE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED:
- reason = "STATUS_SVHDX_UNIT_ATTENTION_CAPACITY_DATA_CHANGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED:
- reason = "STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_PREEMPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED:
- reason = "STATUS_SVHDX_UNIT_ATTENTION_RESERVATIONS_RELEASED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED:
- reason = "STATUS_SVHDX_UNIT_ATTENTION_REGISTRATIONS_PREEMPTED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED:
- reason = "STATUS_SVHDX_UNIT_ATTENTION_OPERATING_DEFINITION_CHANGED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_RESERVATION_CONFLICT:
- reason = "STATUS_SVHDX_RESERVATION_CONFLICT";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_WRONG_FILE_TYPE:
- reason = "STATUS_SVHDX_WRONG_FILE_TYPE";
- break;
- case MD_NTSTATUS_WIN_STATUS_SVHDX_VERSION_MISMATCH:
- reason = "STATUS_SVHDX_VERSION_MISMATCH";
- break;
- case MD_NTSTATUS_WIN_STATUS_VHD_SHARED:
- reason = "STATUS_VHD_SHARED";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPACES_RESILIENCY_TYPE_INVALID:
- reason = "STATUS_SPACES_RESILIENCY_TYPE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID:
- reason = "STATUS_SPACES_DRIVE_SECTOR_SIZE_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPACES_INTERLEAVE_LENGTH_INVALID:
- reason = "STATUS_SPACES_INTERLEAVE_LENGTH_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID:
- reason = "STATUS_SPACES_NUMBER_OF_COLUMNS_INVALID";
- break;
- case MD_NTSTATUS_WIN_STATUS_SPACES_NOT_ENOUGH_DRIVES:
- reason = "STATUS_SPACES_NOT_ENOUGH_DRIVES";
- break;
- default: {
- char reason_string[11];
- snprintf(reason_string, sizeof(reason_string), "0x%08x", ntstatus);
- reason = reason_string;
- break;
- }
- }
- return reason;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.h b/toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.h
deleted file mode 100644
index c05c91698c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/symbolic_constants_win.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2015 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ntstatus_reason_win.h: Windows NTSTATUS code to string.
-//
-// Provides a means to convert NTSTATUS codes to strings.
-//
-// Author: Ben Wagner
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_SYMBOLIC_CONSTANTS_WIN_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_SYMBOLIC_CONSTANTS_WIN_H_
-
-#include <string>
-
-#include "google_breakpad/common/breakpad_types.h"
-
-namespace google_breakpad {
-
-/* Converts a NTSTATUS code to a reason string. */
-std::string NTStatusToString(uint32_t ntstatus);
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_SYMBOLIC_CONSTANTS_WIN_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc
deleted file mode 100644
index 2cfbb08886..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.cc
+++ /dev/null
@@ -1,391 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// synth_minidump.cc: Implementation of SynthMinidump. See synth_minidump.h
-
-#include "processor/synth_minidump.h"
-
-namespace google_breakpad {
-
-namespace SynthMinidump {
-
-Section::Section(const Dump &dump)
- : test_assembler::Section(dump.endianness()) { }
-
-void Section::CiteLocationIn(test_assembler::Section *section) const {
- if (this)
- (*section).D32(size_).D32(file_offset_);
- else
- (*section).D32(0).D32(0);
-}
-
-void Stream::CiteStreamIn(test_assembler::Section *section) const {
- section->D32(type_);
- CiteLocationIn(section);
-}
-
-SystemInfo::SystemInfo(const Dump &dump,
- const MDRawSystemInfo &system_info,
- const String &csd_version)
- : Stream(dump, MD_SYSTEM_INFO_STREAM) {
- D16(system_info.processor_architecture);
- D16(system_info.processor_level);
- D16(system_info.processor_revision);
- D8(system_info.number_of_processors);
- D8(system_info.product_type);
- D32(system_info.major_version);
- D32(system_info.minor_version);
- D32(system_info.build_number);
- D32(system_info.platform_id);
- csd_version.CiteStringIn(this);
- D16(system_info.suite_mask);
- D16(system_info.reserved2); // Well, why not?
-
- // MDCPUInformation cpu;
- if (system_info.processor_architecture == MD_CPU_ARCHITECTURE_X86) {
- D32(system_info.cpu.x86_cpu_info.vendor_id[0]);
- D32(system_info.cpu.x86_cpu_info.vendor_id[1]);
- D32(system_info.cpu.x86_cpu_info.vendor_id[2]);
- D32(system_info.cpu.x86_cpu_info.version_information);
- D32(system_info.cpu.x86_cpu_info.feature_information);
- D32(system_info.cpu.x86_cpu_info.amd_extended_cpu_features);
- } else if (system_info.processor_architecture == MD_CPU_ARCHITECTURE_ARM) {
- D32(system_info.cpu.arm_cpu_info.cpuid);
- D32(system_info.cpu.arm_cpu_info.elf_hwcaps);
- } else {
- D64(system_info.cpu.other_cpu_info.processor_features[0]);
- D64(system_info.cpu.other_cpu_info.processor_features[1]);
- }
-}
-
-const MDRawSystemInfo SystemInfo::windows_x86 = {
- MD_CPU_ARCHITECTURE_X86, // processor_architecture
- 6, // processor_level
- 0xd08, // processor_revision
- 1, // number_of_processors
- 1, // product_type
- 5, // major_version
- 1, // minor_version
- 2600, // build_number
- 2, // platform_id
- 0xdeadbeef, // csd_version_rva
- 0x100, // suite_mask
- 0, // reserved2
- { // cpu
- { // x86_cpu_info
- { 0x756e6547, 0x49656e69, 0x6c65746e }, // vendor_id
- 0x6d8, // version_information
- 0xafe9fbff, // feature_information
- 0xffffffff // amd_extended_cpu_features
- }
- }
-};
-
-const string SystemInfo::windows_x86_csd_version = "Service Pack 2";
-
-String::String(const Dump &dump, const string &contents) : Section(dump) {
- D32(contents.size() * 2);
- for (string::const_iterator i = contents.begin(); i != contents.end(); i++)
- D16(*i);
-}
-
-void String::CiteStringIn(test_assembler::Section *section) const {
- section->D32(file_offset_);
-}
-
-void Memory::CiteMemoryIn(test_assembler::Section *section) const {
- section->D64(address_);
- CiteLocationIn(section);
-}
-
-Context::Context(const Dump &dump, const MDRawContextX86 &context)
- : Section(dump) {
- // The caller should have properly set the CPU type flag.
- // The high 24 bits identify the CPU. Note that context records with no CPU
- // type information can be valid (e.g. produced by ::RtlCaptureContext).
- assert(((context.context_flags & MD_CONTEXT_CPU_MASK) == 0) ||
- (context.context_flags & MD_CONTEXT_X86));
- // It doesn't make sense to store x86 registers in big-endian form.
- assert(dump.endianness() == kLittleEndian);
- D32(context.context_flags);
- D32(context.dr0);
- D32(context.dr1);
- D32(context.dr2);
- D32(context.dr3);
- D32(context.dr6);
- D32(context.dr7);
- D32(context.float_save.control_word);
- D32(context.float_save.status_word);
- D32(context.float_save.tag_word);
- D32(context.float_save.error_offset);
- D32(context.float_save.error_selector);
- D32(context.float_save.data_offset);
- D32(context.float_save.data_selector);
- // context.float_save.register_area[] contains 8-bit quantities and
- // does not need to be swapped.
- Append(context.float_save.register_area,
- sizeof(context.float_save.register_area));
- D32(context.float_save.cr0_npx_state);
- D32(context.gs);
- D32(context.fs);
- D32(context.es);
- D32(context.ds);
- D32(context.edi);
- D32(context.esi);
- D32(context.ebx);
- D32(context.edx);
- D32(context.ecx);
- D32(context.eax);
- D32(context.ebp);
- D32(context.eip);
- D32(context.cs);
- D32(context.eflags);
- D32(context.esp);
- D32(context.ss);
- // context.extended_registers[] contains 8-bit quantities and does
- // not need to be swapped.
- Append(context.extended_registers, sizeof(context.extended_registers));
- assert(Size() == sizeof(MDRawContextX86));
-}
-
-Context::Context(const Dump &dump, const MDRawContextARM &context)
- : Section(dump) {
- // The caller should have properly set the CPU type flag.
- assert((context.context_flags & MD_CONTEXT_ARM) ||
- (context.context_flags & MD_CONTEXT_ARM_OLD));
- // It doesn't make sense to store ARM registers in big-endian form.
- assert(dump.endianness() == kLittleEndian);
- D32(context.context_flags);
- for (int i = 0; i < MD_CONTEXT_ARM_GPR_COUNT; ++i)
- D32(context.iregs[i]);
- D32(context.cpsr);
- D64(context.float_save.fpscr);
- for (int i = 0; i < MD_FLOATINGSAVEAREA_ARM_FPR_COUNT; ++i)
- D64(context.float_save.regs[i]);
- for (int i = 0; i < MD_FLOATINGSAVEAREA_ARM_FPEXTRA_COUNT; ++i)
- D32(context.float_save.extra[i]);
- assert(Size() == sizeof(MDRawContextARM));
-}
-
-Context::Context(const Dump &dump, const MDRawContextMIPS &context)
- : Section(dump) {
- // The caller should have properly set the CPU type flag.
- assert(context.context_flags & MD_CONTEXT_MIPS);
- D32(context.context_flags);
- D32(context._pad0);
-
- for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
- D64(context.iregs[i]);
-
- D64(context.mdhi);
- D64(context.mdlo);
-
- for (int i = 0; i < MD_CONTEXT_MIPS_DSP_COUNT; ++i)
- D32(context.hi[i]);
-
- for (int i = 0; i < MD_CONTEXT_MIPS_DSP_COUNT; ++i)
- D32(context.lo[i]);
-
- D32(context.dsp_control);
- D32(context._pad1);
-
- D64(context.epc);
- D64(context.badvaddr);
- D32(context.status);
- D32(context.cause);
-
- for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i)
- D64(context.float_save.regs[i]);
-
- D32(context.float_save.fpcsr);
- D32(context.float_save.fir);
-
- assert(Size() == sizeof(MDRawContextMIPS));
-}
-
-Thread::Thread(const Dump &dump,
- uint32_t thread_id, const Memory &stack, const Context &context,
- uint32_t suspend_count, uint32_t priority_class,
- uint32_t priority, uint64_t teb) : Section(dump) {
- D32(thread_id);
- D32(suspend_count);
- D32(priority_class);
- D32(priority);
- D64(teb);
- stack.CiteMemoryIn(this);
- context.CiteLocationIn(this);
- assert(Size() == sizeof(MDRawThread));
-}
-
-Module::Module(const Dump &dump,
- uint64_t base_of_image,
- uint32_t size_of_image,
- const String &name,
- uint32_t time_date_stamp,
- uint32_t checksum,
- const MDVSFixedFileInfo &version_info,
- const Section *cv_record,
- const Section *misc_record) : Section(dump) {
- D64(base_of_image);
- D32(size_of_image);
- D32(checksum);
- D32(time_date_stamp);
- name.CiteStringIn(this);
- D32(version_info.signature);
- D32(version_info.struct_version);
- D32(version_info.file_version_hi);
- D32(version_info.file_version_lo);
- D32(version_info.product_version_hi);
- D32(version_info.product_version_lo);
- D32(version_info.file_flags_mask);
- D32(version_info.file_flags);
- D32(version_info.file_os);
- D32(version_info.file_type);
- D32(version_info.file_subtype);
- D32(version_info.file_date_hi);
- D32(version_info.file_date_lo);
- cv_record->CiteLocationIn(this);
- misc_record->CiteLocationIn(this);
- D64(0).D64(0);
-}
-
-const MDVSFixedFileInfo Module::stock_version_info = {
- MD_VSFIXEDFILEINFO_SIGNATURE, // signature
- MD_VSFIXEDFILEINFO_VERSION, // struct_version
- 0x11111111, // file_version_hi
- 0x22222222, // file_version_lo
- 0x33333333, // product_version_hi
- 0x44444444, // product_version_lo
- MD_VSFIXEDFILEINFO_FILE_FLAGS_DEBUG, // file_flags_mask
- MD_VSFIXEDFILEINFO_FILE_FLAGS_DEBUG, // file_flags
- MD_VSFIXEDFILEINFO_FILE_OS_NT | MD_VSFIXEDFILEINFO_FILE_OS__WINDOWS32,
- // file_os
- MD_VSFIXEDFILEINFO_FILE_TYPE_APP, // file_type
- MD_VSFIXEDFILEINFO_FILE_SUBTYPE_UNKNOWN, // file_subtype
- 0, // file_date_hi
- 0 // file_date_lo
-};
-
-Exception::Exception(const Dump &dump,
- const Context &context,
- uint32_t thread_id,
- uint32_t exception_code,
- uint32_t exception_flags,
- uint64_t exception_address)
- : Stream(dump, MD_EXCEPTION_STREAM) {
- D32(thread_id);
- D32(0); // __align
- D32(exception_code);
- D32(exception_flags);
- D64(0); // exception_record
- D64(exception_address);
- D32(0); // number_parameters
- D32(0); // __align
- for (int i = 0; i < MD_EXCEPTION_MAXIMUM_PARAMETERS; ++i)
- D64(0); // exception_information
- context.CiteLocationIn(this);
- assert(Size() == sizeof(MDRawExceptionStream));
-}
-
-Dump::Dump(uint64_t flags,
- Endianness endianness,
- uint32_t version,
- uint32_t date_time_stamp)
- : test_assembler::Section(endianness),
- file_start_(0),
- stream_directory_(*this),
- stream_count_(0),
- thread_list_(*this, MD_THREAD_LIST_STREAM),
- module_list_(*this, MD_MODULE_LIST_STREAM),
- memory_list_(*this, MD_MEMORY_LIST_STREAM)
- {
- D32(MD_HEADER_SIGNATURE);
- D32(version);
- D32(stream_count_label_);
- D32(stream_directory_rva_);
- D32(0);
- D32(date_time_stamp);
- D64(flags);
- assert(Size() == sizeof(MDRawHeader));
-}
-
-Dump &Dump::Add(SynthMinidump::Section *section) {
- section->Finish(file_start_ + Size());
- Append(*section);
- return *this;
-}
-
-Dump &Dump::Add(Stream *stream) {
- Add(static_cast<SynthMinidump::Section *>(stream));
- stream->CiteStreamIn(&stream_directory_);
- stream_count_++;
- return *this;
-}
-
-Dump &Dump::Add(Memory *memory) {
- // Add the memory contents themselves to the file.
- Add(static_cast<SynthMinidump::Section *>(memory));
-
- // The memory list is a list of MDMemoryDescriptors, not of actual
- // memory elements. Produce a descriptor, and add that to the list.
- SynthMinidump::Section descriptor(*this);
- memory->CiteMemoryIn(&descriptor);
- memory_list_.Add(&descriptor);
- return *this;
-}
-
-Dump &Dump::Add(Thread *thread) {
- thread_list_.Add(thread);
- return *this;
-}
-
-Dump &Dump::Add(Module *module) {
- module_list_.Add(module);
- return *this;
-}
-
-void Dump::Finish() {
- if (!thread_list_.Empty()) Add(&thread_list_);
- if (!module_list_.Empty()) Add(&module_list_);
- if (!memory_list_.Empty()) Add(&memory_list_);
-
- // Create the stream directory. We don't use
- // stream_directory_.Finish here, because the stream directory isn't
- // cited using a location descriptor; rather, the Minidump header
- // has the stream count and MDRVA.
- stream_count_label_ = stream_count_;
- stream_directory_rva_ = file_start_ + Size();
- Append(static_cast<test_assembler::Section &>(stream_directory_));
-}
-
-} // namespace SynthMinidump
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h
deleted file mode 100644
index 8dac8784e5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump.h
+++ /dev/null
@@ -1,372 +0,0 @@
-// -*- mode: C++ -*-
-
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// synth_minidump.h: Interface to SynthMinidump: fake minidump generator.
-//
-// We treat a minidump file as the concatenation of a bunch of
-// test_assembler::Sections. The file header, stream directory,
-// streams, memory regions, strings, and so on --- each is a Section
-// that eventually gets appended to the minidump. Dump, Memory,
-// Context, Thread, and so on all inherit from test_assembler::Section.
-// For example:
-//
-// using google_breakpad::test_assembler::kLittleEndian;
-// using google_breakpad::SynthMinidump::Context;
-// using google_breakpad::SynthMinidump::Dump;
-// using google_breakpad::SynthMinidump::Memory;
-// using google_breakpad::SynthMinidump::Thread;
-//
-// Dump minidump(MD_NORMAL, kLittleEndian);
-//
-// Memory stack1(minidump, 0x569eb0a9);
-// ... build contents of stack1 with test_assembler::Section functions ...
-//
-// MDRawContextX86 x86_context1;
-// x86_context1.context_flags = MD_CONTEXT_X86;
-// x86_context1.eip = 0x7c90eb94;
-// x86_context1.esp = 0x569eb0a9;
-// x86_context1.ebp = x86_context1.esp + something appropriate;
-// Context context1(minidump, x86_context1);
-//
-// Thread thread1(minidump, 0xe4a4821d, stack1, context1);
-//
-// minidump.Add(&stack1);
-// minidump.Add(&context1);
-// minidump.Add(&thread1);
-// minidump.Finish();
-//
-// string contents;
-// EXPECT_TRUE(minidump.GetContents(&contents));
-// // contents now holds the bytes of a minidump file
-//
-// Because the test_assembler classes let us write Label references to
-// sections before the Labels' values are known, this gives us
-// flexibility in how we put the dump together: minidump pieces can
-// hold the file offsets of other minidump pieces before the
-// referents' positions have been decided. As long as everything has
-// been placed by the time we call dump.GetContents to obtain the
-// bytes, all the Labels' values will be known, and everything will
-// get patched up appropriately.
-//
-// The dump.Add(thing) functions append THINGS's contents to the
-// minidump, but they also do two other things:
-//
-// - dump.Add(thing) invokes thing->Finish, which tells *thing the
-// offset within the file at which it was placed, and allows *thing
-// to do any final content generation.
-//
-// - If THING is something which should receive an entry in some sort
-// of list or directory, then dump.Add(THING) automatically creates
-// the appropriate directory or list entry. Streams must appear in
-// the stream directory; memory ranges should be listed in the
-// memory list; threads should be placed in the thread list; and so
-// on.
-//
-// By convention, Section subclass constructors that take references
-// to other Sections do not take care of 'Add'ing their arguments to
-// the dump. For example, although the Thread constructor takes
-// references to a Memory and a Context, it does not add them to the
-// dump on the caller's behalf. Rather, the caller is responsible for
-// 'Add'ing every section they create. This allows Sections to be
-// cited from more than one place; for example, Memory ranges are
-// cited both from Thread objects (as their stack contents) and by the
-// memory list stream.
-//
-// If you forget to Add some Section, the Dump::GetContents call will
-// fail, as the test_assembler::Labels used to cite the Section's
-// contents from elsewhere will still be undefined.
-#ifndef PROCESSOR_SYNTH_MINIDUMP_H_
-#define PROCESSOR_SYNTH_MINIDUMP_H_
-
-#include <assert.h>
-
-#include <iostream>
-#include <string>
-
-#include "common/test_assembler.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-namespace SynthMinidump {
-
-using test_assembler::Endianness;
-using test_assembler::kBigEndian;
-using test_assembler::kLittleEndian;
-using test_assembler::kUnsetEndian;
-using test_assembler::Label;
-
-class Dump;
-class Memory;
-class String;
-
-// A test_assembler::Section which will be appended to a minidump.
-class Section: public test_assembler::Section {
- public:
- explicit Section(const Dump &dump);
-
- // Append an MDLocationDescriptor referring to this section to SECTION.
- // If 'this' is NULL, append a descriptor with a zero length and MDRVA.
- //
- // (I couldn't find the language in the C++ standard that says that
- // invoking member functions of a NULL pointer to a class type is
- // bad, if such language exists. Having this function handle NULL
- // 'this' is convenient, but if it causes trouble, it's not hard to
- // do differently.)
- void CiteLocationIn(test_assembler::Section *section) const;
-
- // Note that this section's contents are complete, and that it has
- // been placed in the minidump file at OFFSET. The 'Add' member
- // functions call the Finish member function of the object being
- // added for you; if you are 'Add'ing this section, you needn't Finish it.
- virtual void Finish(const Label &offset) {
- file_offset_ = offset; size_ = Size();
- }
-
- protected:
- // This section's size and offset within the minidump file.
- Label file_offset_, size_;
-};
-
-// A stream within a minidump file. 'Add'ing a stream to a minidump
-// creates an entry for it in the minidump's stream directory.
-class Stream: public Section {
- public:
- // Create a stream of type TYPE. You can append whatever contents
- // you like to this stream using the test_assembler::Section methods.
- Stream(const Dump &dump, uint32_t type) : Section(dump), type_(type) { }
-
- // Append an MDRawDirectory referring to this stream to SECTION.
- void CiteStreamIn(test_assembler::Section *section) const;
-
- private:
- // The type of this stream.
- uint32_t type_;
-};
-
-class SystemInfo: public Stream {
- public:
- // Create an MD_SYSTEM_INFO_STREAM stream belonging to DUMP holding
- // an MDRawSystem info structure initialized with the values from
- // SYSTEM_INFO, except that the csd_version field is replaced with
- // the file offset of the string CSD_VERSION, which can be 'Add'ed
- // to the dump at the desired location.
- //
- // Remember that you are still responsible for 'Add'ing CSD_VERSION
- // to the dump yourself.
- SystemInfo(const Dump &dump,
- const MDRawSystemInfo &system_info,
- const String &csd_version);
-
- // Stock MDRawSystemInfo information and associated strings, for
- // writing tests.
- static const MDRawSystemInfo windows_x86;
- static const string windows_x86_csd_version;
-};
-
-// An MDString: a string preceded by a 32-bit length.
-class String: public Section {
- public:
- String(const Dump &dump, const string &value);
-
- // Append an MDRVA referring to this string to SECTION.
- void CiteStringIn(test_assembler::Section *section) const;
-};
-
-// A range of memory contents. 'Add'ing a memory range to a minidump
-// creates n entry for it in the minidump's memory list. By
-// convention, the 'start', 'Here', and 'Mark' member functions refer
-// to memory addresses.
-class Memory: public Section {
- public:
- Memory(const Dump &dump, uint64_t address)
- : Section(dump), address_(address) { start() = address; }
-
- // Append an MDMemoryDescriptor referring to this memory range to SECTION.
- void CiteMemoryIn(test_assembler::Section *section) const;
-
- private:
- // The process address from which these memory contents were taken.
- // Shouldn't this be a Label?
- uint64_t address_;
-};
-
-class Context: public Section {
- public:
- // Create a context belonging to DUMP whose contents are a copy of CONTEXT.
- Context(const Dump &dump, const MDRawContextX86 &context);
- Context(const Dump &dump, const MDRawContextARM &context);
- Context(const Dump &dump, const MDRawContextMIPS &context);
- // Add an empty context to the dump.
- Context(const Dump &dump) : Section(dump) {}
- // Add constructors for other architectures here. Remember to byteswap.
-};
-
-class Thread: public Section {
- public:
- // Create a thread belonging to DUMP with the given values, citing
- // STACK and CONTEXT (which you must Add to the dump separately).
- Thread(const Dump &dump,
- uint32_t thread_id,
- const Memory &stack,
- const Context &context,
- uint32_t suspend_count = 0,
- uint32_t priority_class = 0,
- uint32_t priority = 0,
- uint64_t teb = 0);
-};
-
-class Module: public Section {
- public:
- // Create a module with the given values. Note that CV_RECORD and
- // MISC_RECORD can be NULL, in which case the corresponding location
- // descriptior in the minidump will have a length of zero.
- Module(const Dump &dump,
- uint64_t base_of_image,
- uint32_t size_of_image,
- const String &name,
- uint32_t time_date_stamp = 1262805309,
- uint32_t checksum = 0,
- const MDVSFixedFileInfo &version_info = Module::stock_version_info,
- const Section *cv_record = NULL,
- const Section *misc_record = NULL);
-
- private:
- // A standard MDVSFixedFileInfo structure to use as a default for
- // minidumps. There's no reason to make users write out all this crap
- // over and over.
- static const MDVSFixedFileInfo stock_version_info;
-};
-
-class Exception : public Stream {
-public:
- Exception(const Dump &dump,
- const Context &context,
- uint32_t thread_id = 0,
- uint32_t exception_code = 0,
- uint32_t exception_flags = 0,
- uint64_t exception_address = 0);
-};
-
-// A list of entries starting with a 32-bit count, like a memory list
-// or a thread list.
-template<typename Element>
-class List: public Stream {
- public:
- List(const Dump &dump, uint32_t type) : Stream(dump, type), count_(0) {
- D32(count_label_);
- }
-
- // Add ELEMENT to this list.
- void Add(Element *element) {
- element->Finish(file_offset_ + Size());
- Append(*element);
- count_++;
- }
-
- // Return true if this List is empty, false otherwise.
- bool Empty() { return count_ == 0; }
-
- // Finish up the contents of this section, mark it as having been
- // placed at OFFSET.
- virtual void Finish(const Label &offset) {
- Stream::Finish(offset);
- count_label_ = count_;
- }
-
- private:
- size_t count_;
- Label count_label_;
-};
-
-class Dump: public test_assembler::Section {
- public:
-
- // Create a test_assembler::Section containing a minidump file whose
- // header uses the given values. ENDIANNESS determines the
- // endianness of the signature; we set this section's default
- // endianness by this.
- Dump(uint64_t flags,
- Endianness endianness = kLittleEndian,
- uint32_t version = MD_HEADER_VERSION,
- uint32_t date_time_stamp = 1262805309);
-
- // The following functions call OBJECT->Finish(), and append the
- // contents of OBJECT to this minidump. They also record OBJECT in
- // whatever directory or list is appropriate for its type. The
- // stream directory, memory list, thread list, and module list are
- // accumulated this way.
- Dump &Add(SynthMinidump::Section *object); // simply append data
- Dump &Add(Stream *object); // append, record in stream directory
- Dump &Add(Memory *object); // append, record in memory list
- Dump &Add(Thread *object); // append, record in thread list
- Dump &Add(Module *object); // append, record in module list
-
- // Complete the construction of the minidump, given the Add calls
- // we've seen up to this point. After this call, this Dump's
- // contents are complete, all labels should be defined if everything
- // Cited has been Added, and you may call GetContents on it.
- void Finish();
-
- private:
- // A label representing the start of the minidump file.
- Label file_start_;
-
- // The stream directory. We construct this incrementally from
- // Add(Stream *) calls.
- SynthMinidump::Section stream_directory_; // The directory's contents.
- size_t stream_count_; // The number of streams so far.
- Label stream_count_label_; // Cited in file header.
- Label stream_directory_rva_; // The directory's file offset.
-
- // This minidump's thread list. We construct this incrementally from
- // Add(Thread *) calls.
- List<Thread> thread_list_;
-
- // This minidump's module list. We construct this incrementally from
- // Add(Module *) calls.
- List<Module> module_list_;
-
- // This minidump's memory list. We construct this incrementally from
- // Add(Memory *) calls. This is actually a list of MDMemoryDescriptors,
- // not memory ranges --- thus the odd type.
- List<SynthMinidump::Section> memory_list_;
-};
-
-} // namespace SynthMinidump
-
-} // namespace google_breakpad
-
-#endif // PROCESSOR_SYNTH_MINIDUMP_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc
deleted file mode 100644
index 8835b44933..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest.cc
+++ /dev/null
@@ -1,336 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// synth_minidump_unittest.cc: Unit tests for google_breakpad::SynthMinidump
-// classes.
-
-#include <sstream>
-#include <string>
-
-#include "breakpad_googletest_includes.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "processor/synth_minidump.h"
-#include "processor/synth_minidump_unittest_data.h"
-
-using google_breakpad::SynthMinidump::Context;
-using google_breakpad::SynthMinidump::Dump;
-using google_breakpad::SynthMinidump::Exception;
-using google_breakpad::SynthMinidump::List;
-using google_breakpad::SynthMinidump::Memory;
-using google_breakpad::SynthMinidump::Module;
-using google_breakpad::SynthMinidump::Section;
-using google_breakpad::SynthMinidump::Stream;
-using google_breakpad::SynthMinidump::String;
-using google_breakpad::SynthMinidump::SystemInfo;
-using google_breakpad::test_assembler::kBigEndian;
-using google_breakpad::test_assembler::kLittleEndian;
-using google_breakpad::test_assembler::Label;
-
-TEST(Section, Simple) {
- Dump dump(0);
- Section section(dump);
- section.L32(0x12345678);
- section.Finish(0);
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("\x78\x56\x34\x12", 4), contents);
-}
-
-TEST(Section, CiteLocationIn) {
- Dump dump(0, kBigEndian);
- Section section1(dump), section2(dump);
- section1.Append("order");
- section2.Append("mayhem");
- section2.Finish(0x32287ec2);
- section2.CiteLocationIn(&section1);
- string contents;
- ASSERT_TRUE(section1.GetContents(&contents));
- string expected("order\0\0\0\x06\x32\x28\x7e\xc2", 13);
- EXPECT_EQ(expected, contents);
-}
-
-TEST(Stream, CiteStreamIn) {
- Dump dump(0, kLittleEndian);
- Stream stream(dump, 0x40cae2b3);
- Section section(dump);
- stream.Append("stream contents");
- section.Append("section contents");
- stream.Finish(0x41424344);
- stream.CiteStreamIn(&section);
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
- string expected("section contents"
- "\xb3\xe2\xca\x40"
- "\x0f\0\0\0"
- "\x44\x43\x42\x41",
- 16 + 4 + 4 + 4);
- EXPECT_EQ(expected, contents);
-}
-
-TEST(Memory, CiteMemoryIn) {
- Dump dump(0, kBigEndian);
- Memory memory(dump, 0x76d010874ab019f9ULL);
- Section section(dump);
- memory.Append("memory contents");
- section.Append("section contents");
- memory.Finish(0x51525354);
- memory.CiteMemoryIn(&section);
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
- string expected("section contents"
- "\x76\xd0\x10\x87\x4a\xb0\x19\xf9"
- "\0\0\0\x0f"
- "\x51\x52\x53\x54",
- 16 + 8 + 4 + 4);
- EXPECT_EQ(contents, expected);
-}
-
-TEST(Memory, Here) {
- Dump dump(0, kBigEndian);
- Memory memory(dump, 0x89979731eb060ed4ULL);
- memory.Append(1729, 42);
- Label l = memory.Here();
- ASSERT_EQ(0x89979731eb060ed4ULL + 1729, l.Value());
-}
-
-TEST(Context, X86) {
- Dump dump(0, kLittleEndian);
- assert(x86_raw_context.context_flags & MD_CONTEXT_X86);
- Context context(dump, x86_raw_context);
- string contents;
- ASSERT_TRUE(context.GetContents(&contents));
- EXPECT_EQ(sizeof(x86_expected_contents), contents.size());
- EXPECT_TRUE(memcmp(contents.data(), x86_expected_contents, contents.size())
- == 0);
-}
-
-TEST(Context, ARM) {
- Dump dump(0, kLittleEndian);
- assert(arm_raw_context.context_flags & MD_CONTEXT_ARM);
- Context context(dump, arm_raw_context);
- string contents;
- ASSERT_TRUE(context.GetContents(&contents));
- EXPECT_EQ(sizeof(arm_expected_contents), contents.size());
- EXPECT_TRUE(memcmp(contents.data(), arm_expected_contents, contents.size())
- == 0);
-}
-
-TEST(ContextDeathTest, X86BadFlags) {
- Dump dump(0, kLittleEndian);
- MDRawContextX86 raw;
- raw.context_flags = MD_CONTEXT_AMD64;
- ASSERT_DEATH(Context context(dump, raw);,
- "context\\.context_flags & (0x[0-9a-f]+|MD_CONTEXT_X86)");
-}
-
-TEST(ContextDeathTest, X86BadEndianness) {
- Dump dump(0, kBigEndian);
- MDRawContextX86 raw;
- raw.context_flags = MD_CONTEXT_X86;
- ASSERT_DEATH(Context context(dump, raw);,
- "dump\\.endianness\\(\\) == kLittleEndian");
-}
-
-TEST(Thread, Simple) {
- Dump dump(0, kLittleEndian);
- Context context(dump, x86_raw_context);
- context.Finish(0x8665da0c);
- Memory stack(dump, 0xaad55a93cc3c0efcULL);
- stack.Append("stack contents");
- stack.Finish(0xe08cdbd1);
- google_breakpad::SynthMinidump::Thread thread(
- dump, 0x3d7ec360, stack, context,
- 0x3593f44d, // suspend count
- 0xab352b82, // priority class
- 0x2753d838, // priority
- 0xeb2de4be3f29e3e9ULL); // thread environment block
- string contents;
- ASSERT_TRUE(thread.GetContents(&contents));
- static const uint8_t expected_bytes[] = {
- 0x60, 0xc3, 0x7e, 0x3d, // thread id
- 0x4d, 0xf4, 0x93, 0x35, // suspend count
- 0x82, 0x2b, 0x35, 0xab, // priority class
- 0x38, 0xd8, 0x53, 0x27, // priority
- 0xe9, 0xe3, 0x29, 0x3f, 0xbe, 0xe4, 0x2d, 0xeb, // thread environment block
- 0xfc, 0x0e, 0x3c, 0xcc, 0x93, 0x5a, 0xd5, 0xaa, // stack address
- 0x0e, 0x00, 0x00, 0x00, // stack size
- 0xd1, 0xdb, 0x8c, 0xe0, // stack MDRVA
- 0xcc, 0x02, 0x00, 0x00, // context size
- 0x0c, 0xda, 0x65, 0x86 // context MDRVA
- };
- EXPECT_EQ(sizeof(expected_bytes), contents.size());
- EXPECT_TRUE(memcmp(contents.data(), expected_bytes, contents.size()) == 0);
-}
-
-TEST(Exception, Simple) {
- Dump dump(0, kLittleEndian);
- Context context(dump, x86_raw_context);
- context.Finish(0x8665da0c);
-
- Exception exception(dump, context,
- 0x1234abcd, // thread id
- 0xdcba4321, // exception code
- 0xf0e0d0c0, // exception flags
- 0x0919a9b9c9d9e9f9ULL); // exception address
- string contents;
- ASSERT_TRUE(exception.GetContents(&contents));
- static const uint8_t expected_bytes[] = {
- 0xcd, 0xab, 0x34, 0x12, // thread id
- 0x00, 0x00, 0x00, 0x00, // __align
- 0x21, 0x43, 0xba, 0xdc, // exception code
- 0xc0, 0xd0, 0xe0, 0xf0, // exception flags
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception record
- 0xf9, 0xe9, 0xd9, 0xc9, 0xb9, 0xa9, 0x19, 0x09, // exception address
- 0x00, 0x00, 0x00, 0x00, // number parameters
- 0x00, 0x00, 0x00, 0x00, // __align
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // exception_information
- 0xcc, 0x02, 0x00, 0x00, // context size
- 0x0c, 0xda, 0x65, 0x86 // context MDRVA
- };
- EXPECT_EQ(sizeof(expected_bytes), contents.size());
- EXPECT_TRUE(memcmp(contents.data(), expected_bytes, contents.size()) == 0);
-}
-
-TEST(String, Simple) {
- Dump dump(0, kBigEndian);
- String s(dump, "All mimsy were the borogoves");
- string contents;
- ASSERT_TRUE(s.GetContents(&contents));
- static const char expected[] =
- "\x00\x00\x00\x38\0A\0l\0l\0 \0m\0i\0m\0s\0y\0 \0w\0e\0r\0e"
- "\0 \0t\0h\0e\0 \0b\0o\0r\0o\0g\0o\0v\0e\0s";
- string expected_string(expected, sizeof(expected) - 1);
- EXPECT_EQ(expected_string, contents);
-}
-
-TEST(String, CiteStringIn) {
- Dump dump(0, kLittleEndian);
- String s(dump, "and the mome wraths outgrabe");
- Section section(dump);
- section.Append("initial");
- s.CiteStringIn(&section);
- s.Finish(0xdc2bb469);
- string contents;
- ASSERT_TRUE(section.GetContents(&contents));
- EXPECT_EQ(string("initial\x69\xb4\x2b\xdc", 7 + 4), contents);
-}
-
-TEST(List, Empty) {
- Dump dump(0, kBigEndian);
- List<Section> list(dump, 0x2442779c);
- EXPECT_TRUE(list.Empty());
- list.Finish(0x84e09808);
- string contents;
- ASSERT_TRUE(list.GetContents(&contents));
- EXPECT_EQ(string("\0\0\0\0", 4), contents);
-}
-
-TEST(List, Two) {
- Dump dump(0, kBigEndian);
- List<Section> list(dump, 0x26c9f498);
- Section section1(dump);
- section1.Append("section one contents");
- EXPECT_TRUE(list.Empty());
- list.Add(&section1);
- EXPECT_FALSE(list.Empty());
- Section section2(dump);
- section2.Append("section two contents");
- list.Add(&section2);
- list.Finish(0x1e5bb60e);
- string contents;
- ASSERT_TRUE(list.GetContents(&contents));
- EXPECT_EQ(string("\0\0\0\x02section one contentssection two contents", 44),
- contents);
-}
-
-TEST(Dump, Header) {
- Dump dump(0x9f738b33685cc84cULL, kLittleEndian, 0xb3817faf, 0x2c741c0a);
- dump.Finish();
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- ASSERT_EQ(string("\x4d\x44\x4d\x50" // signature
- "\xaf\x7f\x81\xb3" // version
- "\0\0\0\0" // stream count
- "\x20\0\0\0" // directory RVA (could be anything)
- "\0\0\0\0" // checksum
- "\x0a\x1c\x74\x2c" // time_date_stamp
- "\x4c\xc8\x5c\x68\x33\x8b\x73\x9f", // flags
- 32),
- contents);
-}
-
-TEST(Dump, HeaderBigEndian) {
- Dump dump(0x206ce3cc6fb8e0f0ULL, kBigEndian, 0x161693e2, 0x35667744);
- dump.Finish();
- string contents;
- ASSERT_TRUE(dump.GetContents(&contents));
- ASSERT_EQ(string("\x50\x4d\x44\x4d" // signature
- "\x16\x16\x93\xe2" // version
- "\0\0\0\0" // stream count
- "\0\0\0\x20" // directory RVA (could be anything)
- "\0\0\0\0" // checksum
- "\x35\x66\x77\x44" // time_date_stamp
- "\x20\x6c\xe3\xcc\x6f\xb8\xe0\xf0", // flags
- 32),
- contents);
-}
-
-TEST(Dump, OneSection) {
- Dump dump(0, kLittleEndian);
- Section section(dump);
- section.Append("section contents");
- dump.Add(&section);
- dump.Finish();
- string dump_contents;
- // Just check for undefined labels; don't worry about the contents.
- ASSERT_TRUE(dump.GetContents(&dump_contents));
-
- Section referencing_section(dump);
- section.CiteLocationIn(&referencing_section);
- string contents;
- ASSERT_TRUE(referencing_section.GetContents(&contents));
- ASSERT_EQ(string("\x10\0\0\0\x20\0\0\0", 8), contents);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest_data.h b/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest_data.h
deleted file mode 100644
index 3403372e6c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/synth_minidump_unittest_data.h
+++ /dev/null
@@ -1,418 +0,0 @@
-// -*- mode: C++ -*-
-
-// Not copyrightable: random test data.
-// synth_minidump_unittest_data.h: verbose test data for SynthMinidump tests.
-
-#ifndef PROCESSOR_SYNTH_MINIDUMP_UNITTEST_DATA_H_
-#define PROCESSOR_SYNTH_MINIDUMP_UNITTEST_DATA_H_
-
-#include "google_breakpad/common/minidump_format.h"
-
-static const MDRawContextX86 x86_raw_context = {
- 0xded5d71b, // context_flags
- 0x9fdb432e, // dr0
- 0x26b7a81a, // dr1
- 0xcac7e348, // dr2
- 0xcf99ec09, // dr3
- 0x7dc8c2cd, // dr6
- 0x21deb880, // dr7
-
- // float_save
- {
- 0x8a5d2bb0, // control_word
- 0x0286c4c9, // status_word
- 0xf1feea21, // tag_word
- 0xb2d40576, // error_offset
- 0x48146cde, // error_selector
- 0x983f9b21, // data_offset
- 0x475be12c, // data_selector
-
- // register_area
- {
- 0xd9, 0x04, 0x20, 0x6b, 0x88, 0x3a, 0x3f, 0xd5,
- 0x59, 0x7a, 0xa9, 0xeb, 0xd0, 0x5c, 0xdf, 0xfe,
- 0xad, 0xdd, 0x4a, 0x8b, 0x10, 0xcc, 0x9a, 0x33,
- 0xcb, 0xb6, 0xf7, 0x86, 0xcd, 0x69, 0x25, 0xae,
- 0x25, 0xe5, 0x7a, 0xa1, 0x8f, 0xb2, 0x84, 0xd9,
- 0xf7, 0x2d, 0x8a, 0xa1, 0x80, 0x81, 0x7f, 0x67,
- 0x07, 0xa8, 0x23, 0xf1, 0x8c, 0xdc, 0xd8, 0x04,
- 0x8b, 0x9d, 0xb1, 0xcd, 0x61, 0x0c, 0x9c, 0x69,
- 0xc7, 0x8d, 0x17, 0xb6, 0xe5, 0x0b, 0x94, 0xf7,
- 0x78, 0x9b, 0x63, 0x49, 0xba, 0xfc, 0x08, 0x4d
- },
-
- 0x84c53a90, // cr0_npx_state
- },
-
- 0x79f71e76, // gs
- 0x8107bd25, // fs
- 0x452d2921, // es
- 0x87ec2875, // ds
- 0xf8bb73f5, // edi
- 0xa63ebb88, // esi
- 0x95d35ebe, // ebx
- 0x17aa2456, // edx
- 0x135fa208, // ecx
- 0x500615e6, // eax
- 0x66d14205, // ebp
- 0x000719a5, // eip
- 0x477b481b, // cs
- 0x8684dfba, // eflags
- 0xe33ccddf, // esp
- 0xc0e65d33, // ss
-
- // extended_registers
- {
- 0x68, 0x63, 0xdf, 0x50, 0xf7, 0x3b, 0xe8, 0xe5,
- 0xcb, 0xd6, 0x66, 0x60, 0xe5, 0xa3, 0x58, 0xb3,
- 0x6f, 0x34, 0xca, 0x02, 0x9b, 0x5f, 0xd0, 0x41,
- 0xbd, 0xc5, 0x2d, 0xf8, 0xff, 0x15, 0xa2, 0xd0,
- 0xe3, 0x2b, 0x3b, 0x8a, 0x9f, 0xc3, 0x9e, 0x28,
- 0x0a, 0xc2, 0xac, 0x3b, 0x67, 0x37, 0x01, 0xfd,
- 0xc3, 0xaf, 0x60, 0xf6, 0x2c, 0x4f, 0xa9, 0x52,
- 0x92, 0xe5, 0x28, 0xde, 0x34, 0xb6, 0x2e, 0x44,
- 0x15, 0xa4, 0xb6, 0xe4, 0xc9, 0x1a, 0x14, 0xb9,
- 0x51, 0x33, 0x3c, 0xe0, 0xc7, 0x94, 0xf0, 0xf7,
- 0x78, 0xdd, 0xe5, 0xca, 0xb7, 0xa6, 0xe0, 0x14,
- 0xa6, 0x03, 0xab, 0x77, 0xad, 0xbd, 0xd2, 0x53,
- 0x3d, 0x07, 0xe7, 0xaf, 0x90, 0x44, 0x71, 0xbe,
- 0x0c, 0xdf, 0x2b, 0x97, 0x40, 0x48, 0xd5, 0xf9,
- 0x62, 0x03, 0x91, 0x84, 0xd6, 0xdd, 0x29, 0x97,
- 0x35, 0x02, 0xfb, 0x59, 0x97, 0xb0, 0xec, 0xa9,
- 0x39, 0x6f, 0x81, 0x71, 0x2a, 0xf0, 0xe7, 0x2c,
- 0x4e, 0x93, 0x90, 0xcb, 0x67, 0x69, 0xde, 0xd7,
- 0x68, 0x3b, 0x0f, 0x69, 0xa8, 0xf4, 0xa8, 0x83,
- 0x42, 0x80, 0x47, 0x65, 0x7a, 0xc9, 0x19, 0x5d,
- 0xcb, 0x43, 0xa5, 0xff, 0xf8, 0x9e, 0x62, 0xf4,
- 0xe2, 0x6c, 0xcc, 0x17, 0x55, 0x7c, 0x0d, 0x5c,
- 0x8d, 0x16, 0x01, 0xd7, 0x3a, 0x0c, 0xf4, 0x7f,
- 0x71, 0xdc, 0x48, 0xe9, 0x4b, 0xfe, 0x1a, 0xd0,
- 0x04, 0x15, 0x33, 0xec, 0x78, 0xc6, 0x7e, 0xde,
- 0x7c, 0x23, 0x18, 0x8d, 0x8f, 0xc2, 0x74, 0xc1,
- 0x48, 0xcd, 0x5d, 0xee, 0xee, 0x81, 0x9e, 0x49,
- 0x47, 0x8a, 0xf8, 0x61, 0xa3, 0x9c, 0x81, 0x96,
- 0xbe, 0x2b, 0x5e, 0xbc, 0xcd, 0x34, 0x0a, 0x2a,
- 0x3b, 0x8b, 0x7d, 0xa1, 0xf2, 0x8d, 0xb4, 0x51,
- 0x9e, 0x14, 0x78, 0xa3, 0x58, 0x65, 0x2d, 0xd6,
- 0x50, 0x40, 0x36, 0x32, 0x31, 0xd4, 0x3e, 0xc2,
- 0xe0, 0x87, 0x1c, 0x05, 0x95, 0x80, 0x84, 0x24,
- 0x08, 0x6f, 0x5b, 0xc7, 0xe1, 0x1d, 0xd5, 0xa3,
- 0x94, 0x44, 0xa1, 0x7c, 0xd8, 0x4b, 0x86, 0xd2,
- 0xc6, 0xa9, 0xf3, 0xe2, 0x4d, 0x6e, 0x1f, 0x0e,
- 0xf2, 0xf5, 0x71, 0xf9, 0x71, 0x05, 0x24, 0xc9,
- 0xc1, 0xe8, 0x91, 0x42, 0x61, 0x86, 0x57, 0x68,
- 0xd9, 0xc9, 0x1d, 0xd5, 0x5a, 0xe9, 0xba, 0xe6,
- 0x15, 0x8f, 0x87, 0xbd, 0x62, 0x56, 0xed, 0xda,
- 0xc2, 0xa5, 0xd5, 0x39, 0xac, 0x05, 0x10, 0x14,
- 0x4a, 0xe7, 0xe7, 0x3c, 0x3f, 0xb7, 0xbb, 0xed,
- 0x01, 0x6e, 0xcd, 0xee, 0x81, 0xb4, 0x62, 0xf4,
- 0x62, 0x16, 0xff, 0x20, 0xb4, 0xf0, 0xbc, 0xff,
- 0x7d, 0xd9, 0xcf, 0x95, 0x30, 0x27, 0xe0, 0x2f,
- 0x98, 0x53, 0x80, 0x15, 0x13, 0xef, 0x44, 0x58,
- 0x12, 0x16, 0xdb, 0x11, 0xef, 0x73, 0x51, 0xcd,
- 0x42, 0x3f, 0x98, 0x6c, 0xc9, 0x68, 0xc3, 0xf4,
- 0x5b, 0x0f, 0x5d, 0x77, 0xed, 0xdf, 0x0f, 0xff,
- 0xb8, 0x69, 0x98, 0x50, 0x77, 0x7a, 0xe8, 0x90,
- 0x27, 0x46, 0x10, 0xd2, 0xb5, 0x00, 0x3b, 0x36,
- 0x43, 0x6d, 0x67, 0x41, 0x20, 0x3a, 0x32, 0xe0,
- 0x2e, 0x5a, 0xfb, 0x4e, 0x4f, 0xa4, 0xf7, 0xc2,
- 0xe6, 0x81, 0x1a, 0x51, 0xa8, 0x7c, 0xd4, 0x60,
- 0x7c, 0x45, 0xe2, 0xba, 0x5b, 0x42, 0xf3, 0xbf,
- 0x28, 0xaa, 0xf2, 0x90, 0xe4, 0x94, 0xdd, 0xaa,
- 0x22, 0xd3, 0x71, 0x33, 0xa1, 0x01, 0x43, 0x0e,
- 0xfa, 0x46, 0xd2, 0x6e, 0x55, 0x5e, 0x49, 0xeb,
- 0x94, 0xf0, 0xb0, 0xb1, 0x2e, 0xf2, 0x3d, 0x6c,
- 0x00, 0x5e, 0x01, 0x56, 0x3b, 0xfd, 0x5b, 0xa1,
- 0x2f, 0x63, 0x1d, 0xbf, 0xf9, 0xd8, 0x13, 0xf7,
- 0x4d, 0xb7, 0x1e, 0x3d, 0x98, 0xd2, 0xee, 0xb8,
- 0x48, 0xc8, 0x5b, 0x91, 0x0f, 0x54, 0x9e, 0x26,
- 0xb2, 0xc7, 0x3a, 0x6c, 0x8a, 0x35, 0xe1, 0xba
- }
-};
-
-static const uint8_t x86_expected_contents[] = {
- 0x1b, 0xd7, 0xd5, 0xde,
- 0x2e, 0x43, 0xdb, 0x9f,
- 0x1a, 0xa8, 0xb7, 0x26,
- 0x48, 0xe3, 0xc7, 0xca,
- 0x09, 0xec, 0x99, 0xcf,
- 0xcd, 0xc2, 0xc8, 0x7d,
- 0x80, 0xb8, 0xde, 0x21,
- 0xb0, 0x2b, 0x5d, 0x8a,
- 0xc9, 0xc4, 0x86, 0x02,
- 0x21, 0xea, 0xfe, 0xf1,
- 0x76, 0x05, 0xd4, 0xb2,
- 0xde, 0x6c, 0x14, 0x48,
- 0x21, 0x9b, 0x3f, 0x98,
- 0x2c, 0xe1, 0x5b, 0x47,
-
- // float_save.register_area --- unswapped
- 0xd9, 0x04, 0x20, 0x6b, 0x88, 0x3a, 0x3f, 0xd5,
- 0x59, 0x7a, 0xa9, 0xeb, 0xd0, 0x5c, 0xdf, 0xfe,
- 0xad, 0xdd, 0x4a, 0x8b, 0x10, 0xcc, 0x9a, 0x33,
- 0xcb, 0xb6, 0xf7, 0x86, 0xcd, 0x69, 0x25, 0xae,
- 0x25, 0xe5, 0x7a, 0xa1, 0x8f, 0xb2, 0x84, 0xd9,
- 0xf7, 0x2d, 0x8a, 0xa1, 0x80, 0x81, 0x7f, 0x67,
- 0x07, 0xa8, 0x23, 0xf1, 0x8c, 0xdc, 0xd8, 0x04,
- 0x8b, 0x9d, 0xb1, 0xcd, 0x61, 0x0c, 0x9c, 0x69,
- 0xc7, 0x8d, 0x17, 0xb6, 0xe5, 0x0b, 0x94, 0xf7,
- 0x78, 0x9b, 0x63, 0x49, 0xba, 0xfc, 0x08, 0x4d,
-
- 0x90, 0x3a, 0xc5, 0x84,
- 0x76, 0x1e, 0xf7, 0x79,
- 0x25, 0xbd, 0x07, 0x81,
- 0x21, 0x29, 0x2d, 0x45,
- 0x75, 0x28, 0xec, 0x87,
- 0xf5, 0x73, 0xbb, 0xf8,
- 0x88, 0xbb, 0x3e, 0xa6,
- 0xbe, 0x5e, 0xd3, 0x95,
- 0x56, 0x24, 0xaa, 0x17,
- 0x08, 0xa2, 0x5f, 0x13,
- 0xe6, 0x15, 0x06, 0x50,
- 0x05, 0x42, 0xd1, 0x66,
- 0xa5, 0x19, 0x07, 0x00,
- 0x1b, 0x48, 0x7b, 0x47,
- 0xba, 0xdf, 0x84, 0x86,
- 0xdf, 0xcd, 0x3c, 0xe3,
- 0x33, 0x5d, 0xe6, 0xc0,
-
- // extended_registers --- unswapped
- 0x68, 0x63, 0xdf, 0x50, 0xf7, 0x3b, 0xe8, 0xe5,
- 0xcb, 0xd6, 0x66, 0x60, 0xe5, 0xa3, 0x58, 0xb3,
- 0x6f, 0x34, 0xca, 0x02, 0x9b, 0x5f, 0xd0, 0x41,
- 0xbd, 0xc5, 0x2d, 0xf8, 0xff, 0x15, 0xa2, 0xd0,
- 0xe3, 0x2b, 0x3b, 0x8a, 0x9f, 0xc3, 0x9e, 0x28,
- 0x0a, 0xc2, 0xac, 0x3b, 0x67, 0x37, 0x01, 0xfd,
- 0xc3, 0xaf, 0x60, 0xf6, 0x2c, 0x4f, 0xa9, 0x52,
- 0x92, 0xe5, 0x28, 0xde, 0x34, 0xb6, 0x2e, 0x44,
- 0x15, 0xa4, 0xb6, 0xe4, 0xc9, 0x1a, 0x14, 0xb9,
- 0x51, 0x33, 0x3c, 0xe0, 0xc7, 0x94, 0xf0, 0xf7,
- 0x78, 0xdd, 0xe5, 0xca, 0xb7, 0xa6, 0xe0, 0x14,
- 0xa6, 0x03, 0xab, 0x77, 0xad, 0xbd, 0xd2, 0x53,
- 0x3d, 0x07, 0xe7, 0xaf, 0x90, 0x44, 0x71, 0xbe,
- 0x0c, 0xdf, 0x2b, 0x97, 0x40, 0x48, 0xd5, 0xf9,
- 0x62, 0x03, 0x91, 0x84, 0xd6, 0xdd, 0x29, 0x97,
- 0x35, 0x02, 0xfb, 0x59, 0x97, 0xb0, 0xec, 0xa9,
- 0x39, 0x6f, 0x81, 0x71, 0x2a, 0xf0, 0xe7, 0x2c,
- 0x4e, 0x93, 0x90, 0xcb, 0x67, 0x69, 0xde, 0xd7,
- 0x68, 0x3b, 0x0f, 0x69, 0xa8, 0xf4, 0xa8, 0x83,
- 0x42, 0x80, 0x47, 0x65, 0x7a, 0xc9, 0x19, 0x5d,
- 0xcb, 0x43, 0xa5, 0xff, 0xf8, 0x9e, 0x62, 0xf4,
- 0xe2, 0x6c, 0xcc, 0x17, 0x55, 0x7c, 0x0d, 0x5c,
- 0x8d, 0x16, 0x01, 0xd7, 0x3a, 0x0c, 0xf4, 0x7f,
- 0x71, 0xdc, 0x48, 0xe9, 0x4b, 0xfe, 0x1a, 0xd0,
- 0x04, 0x15, 0x33, 0xec, 0x78, 0xc6, 0x7e, 0xde,
- 0x7c, 0x23, 0x18, 0x8d, 0x8f, 0xc2, 0x74, 0xc1,
- 0x48, 0xcd, 0x5d, 0xee, 0xee, 0x81, 0x9e, 0x49,
- 0x47, 0x8a, 0xf8, 0x61, 0xa3, 0x9c, 0x81, 0x96,
- 0xbe, 0x2b, 0x5e, 0xbc, 0xcd, 0x34, 0x0a, 0x2a,
- 0x3b, 0x8b, 0x7d, 0xa1, 0xf2, 0x8d, 0xb4, 0x51,
- 0x9e, 0x14, 0x78, 0xa3, 0x58, 0x65, 0x2d, 0xd6,
- 0x50, 0x40, 0x36, 0x32, 0x31, 0xd4, 0x3e, 0xc2,
- 0xe0, 0x87, 0x1c, 0x05, 0x95, 0x80, 0x84, 0x24,
- 0x08, 0x6f, 0x5b, 0xc7, 0xe1, 0x1d, 0xd5, 0xa3,
- 0x94, 0x44, 0xa1, 0x7c, 0xd8, 0x4b, 0x86, 0xd2,
- 0xc6, 0xa9, 0xf3, 0xe2, 0x4d, 0x6e, 0x1f, 0x0e,
- 0xf2, 0xf5, 0x71, 0xf9, 0x71, 0x05, 0x24, 0xc9,
- 0xc1, 0xe8, 0x91, 0x42, 0x61, 0x86, 0x57, 0x68,
- 0xd9, 0xc9, 0x1d, 0xd5, 0x5a, 0xe9, 0xba, 0xe6,
- 0x15, 0x8f, 0x87, 0xbd, 0x62, 0x56, 0xed, 0xda,
- 0xc2, 0xa5, 0xd5, 0x39, 0xac, 0x05, 0x10, 0x14,
- 0x4a, 0xe7, 0xe7, 0x3c, 0x3f, 0xb7, 0xbb, 0xed,
- 0x01, 0x6e, 0xcd, 0xee, 0x81, 0xb4, 0x62, 0xf4,
- 0x62, 0x16, 0xff, 0x20, 0xb4, 0xf0, 0xbc, 0xff,
- 0x7d, 0xd9, 0xcf, 0x95, 0x30, 0x27, 0xe0, 0x2f,
- 0x98, 0x53, 0x80, 0x15, 0x13, 0xef, 0x44, 0x58,
- 0x12, 0x16, 0xdb, 0x11, 0xef, 0x73, 0x51, 0xcd,
- 0x42, 0x3f, 0x98, 0x6c, 0xc9, 0x68, 0xc3, 0xf4,
- 0x5b, 0x0f, 0x5d, 0x77, 0xed, 0xdf, 0x0f, 0xff,
- 0xb8, 0x69, 0x98, 0x50, 0x77, 0x7a, 0xe8, 0x90,
- 0x27, 0x46, 0x10, 0xd2, 0xb5, 0x00, 0x3b, 0x36,
- 0x43, 0x6d, 0x67, 0x41, 0x20, 0x3a, 0x32, 0xe0,
- 0x2e, 0x5a, 0xfb, 0x4e, 0x4f, 0xa4, 0xf7, 0xc2,
- 0xe6, 0x81, 0x1a, 0x51, 0xa8, 0x7c, 0xd4, 0x60,
- 0x7c, 0x45, 0xe2, 0xba, 0x5b, 0x42, 0xf3, 0xbf,
- 0x28, 0xaa, 0xf2, 0x90, 0xe4, 0x94, 0xdd, 0xaa,
- 0x22, 0xd3, 0x71, 0x33, 0xa1, 0x01, 0x43, 0x0e,
- 0xfa, 0x46, 0xd2, 0x6e, 0x55, 0x5e, 0x49, 0xeb,
- 0x94, 0xf0, 0xb0, 0xb1, 0x2e, 0xf2, 0x3d, 0x6c,
- 0x00, 0x5e, 0x01, 0x56, 0x3b, 0xfd, 0x5b, 0xa1,
- 0x2f, 0x63, 0x1d, 0xbf, 0xf9, 0xd8, 0x13, 0xf7,
- 0x4d, 0xb7, 0x1e, 0x3d, 0x98, 0xd2, 0xee, 0xb8,
- 0x48, 0xc8, 0x5b, 0x91, 0x0f, 0x54, 0x9e, 0x26,
- 0xb2, 0xc7, 0x3a, 0x6c, 0x8a, 0x35, 0xe1, 0xba
-};
-
-static const MDRawContextARM arm_raw_context = {
- // context_flags
- 0x591b9e6a,
- // iregs
- {
- 0xa21594de,
- 0x820d8a25,
- 0xc4e133b2,
- 0x173a1c02,
- 0x105fb175,
- 0xe871793f,
- 0x5def70b3,
- 0xcee3a623,
- 0x7b3aa9b8,
- 0x52518537,
- 0x627012c5,
- 0x22723dcc,
- 0x16fcc971,
- 0x20988bcb,
- 0xf1ab806b,
- 0x99d5fc03,
- },
- // cpsr
- 0xb70df511,
- // float_save
- {
- // fpscr
- 0xa1e1f7ce1077e6b5ULL,
- // regs
- {
- 0xbcb8d002eed7fbdeULL,
- 0x4dd26a43b96ae97fULL,
- 0x8eec22db8b31741cULL,
- 0xfd634bd7c5ad66a0ULL,
- 0x1681da0daeb3debeULL,
- 0x474a32bdf72d0b71ULL,
- 0xcaf464f8b1044834ULL,
- 0xcaa6592ae5c7582aULL,
- 0x4ee46889d877c3dbULL,
- 0xf8930cf301645cf5ULL,
- 0x4da7e9ebba27f7c7ULL,
- 0x69a7b02761944da3ULL,
- 0x2cda2b2e78195c06ULL,
- 0x66b227ab9b460a42ULL,
- 0x7e77e49e52ee0849ULL,
- 0xd62cd9663e76f255ULL,
- 0xe9370f082451514bULL,
- 0x50a1c674dd1b6029ULL,
- 0x405db4575829eac4ULL,
- 0x67b948764649eee7ULL,
- 0x93731885419229d4ULL,
- 0xdb0338bad72a4ce7ULL,
- 0xa0a451f996fca4c8ULL,
- 0xb4508ea668400a45ULL,
- 0xbff28c5c7a142423ULL,
- 0x4f31b42b96f3a431ULL,
- 0x2ce6789d4ea1ff37ULL,
- 0xfa150b52e4f82a3cULL,
- 0xe9ec40449e6ed4f3ULL,
- 0x5ceca87836fe2251ULL,
- 0x66f50de463ee238cULL,
- 0x42823efcd59ab511ULL,
- },
- // extra
- {
- 0xe9e14cd2,
- 0x865bb640,
- 0x9f3f0b3e,
- 0x94a71c52,
- 0x3c012f19,
- 0x6436637c,
- 0x46ccedcb,
- 0x7b341be7,
- }
- }
-};
-
-static const uint8_t arm_expected_contents[] = {
- 0x6a, 0x9e, 0x1b, 0x59,
- 0xde, 0x94, 0x15, 0xa2,
- 0x25, 0x8a, 0x0d, 0x82,
- 0xb2, 0x33, 0xe1, 0xc4,
- 0x02, 0x1c, 0x3a, 0x17,
- 0x75, 0xb1, 0x5f, 0x10,
- 0x3f, 0x79, 0x71, 0xe8,
- 0xb3, 0x70, 0xef, 0x5d,
- 0x23, 0xa6, 0xe3, 0xce,
- 0xb8, 0xa9, 0x3a, 0x7b,
- 0x37, 0x85, 0x51, 0x52,
- 0xc5, 0x12, 0x70, 0x62,
- 0xcc, 0x3d, 0x72, 0x22,
- 0x71, 0xc9, 0xfc, 0x16,
- 0xcb, 0x8b, 0x98, 0x20,
- 0x6b, 0x80, 0xab, 0xf1,
- 0x03, 0xfc, 0xd5, 0x99,
- 0x11, 0xf5, 0x0d, 0xb7,
- 0xb5, 0xe6, 0x77, 0x10,
- 0xce, 0xf7, 0xe1, 0xa1,
- 0xde, 0xfb, 0xd7, 0xee,
- 0x02, 0xd0, 0xb8, 0xbc,
- 0x7f, 0xe9, 0x6a, 0xb9,
- 0x43, 0x6a, 0xd2, 0x4d,
- 0x1c, 0x74, 0x31, 0x8b,
- 0xdb, 0x22, 0xec, 0x8e,
- 0xa0, 0x66, 0xad, 0xc5,
- 0xd7, 0x4b, 0x63, 0xfd,
- 0xbe, 0xde, 0xb3, 0xae,
- 0x0d, 0xda, 0x81, 0x16,
- 0x71, 0x0b, 0x2d, 0xf7,
- 0xbd, 0x32, 0x4a, 0x47,
- 0x34, 0x48, 0x04, 0xb1,
- 0xf8, 0x64, 0xf4, 0xca,
- 0x2a, 0x58, 0xc7, 0xe5,
- 0x2a, 0x59, 0xa6, 0xca,
- 0xdb, 0xc3, 0x77, 0xd8,
- 0x89, 0x68, 0xe4, 0x4e,
- 0xf5, 0x5c, 0x64, 0x01,
- 0xf3, 0x0c, 0x93, 0xf8,
- 0xc7, 0xf7, 0x27, 0xba,
- 0xeb, 0xe9, 0xa7, 0x4d,
- 0xa3, 0x4d, 0x94, 0x61,
- 0x27, 0xb0, 0xa7, 0x69,
- 0x06, 0x5c, 0x19, 0x78,
- 0x2e, 0x2b, 0xda, 0x2c,
- 0x42, 0x0a, 0x46, 0x9b,
- 0xab, 0x27, 0xb2, 0x66,
- 0x49, 0x08, 0xee, 0x52,
- 0x9e, 0xe4, 0x77, 0x7e,
- 0x55, 0xf2, 0x76, 0x3e,
- 0x66, 0xd9, 0x2c, 0xd6,
- 0x4b, 0x51, 0x51, 0x24,
- 0x08, 0x0f, 0x37, 0xe9,
- 0x29, 0x60, 0x1b, 0xdd,
- 0x74, 0xc6, 0xa1, 0x50,
- 0xc4, 0xea, 0x29, 0x58,
- 0x57, 0xb4, 0x5d, 0x40,
- 0xe7, 0xee, 0x49, 0x46,
- 0x76, 0x48, 0xb9, 0x67,
- 0xd4, 0x29, 0x92, 0x41,
- 0x85, 0x18, 0x73, 0x93,
- 0xe7, 0x4c, 0x2a, 0xd7,
- 0xba, 0x38, 0x03, 0xdb,
- 0xc8, 0xa4, 0xfc, 0x96,
- 0xf9, 0x51, 0xa4, 0xa0,
- 0x45, 0x0a, 0x40, 0x68,
- 0xa6, 0x8e, 0x50, 0xb4,
- 0x23, 0x24, 0x14, 0x7a,
- 0x5c, 0x8c, 0xf2, 0xbf,
- 0x31, 0xa4, 0xf3, 0x96,
- 0x2b, 0xb4, 0x31, 0x4f,
- 0x37, 0xff, 0xa1, 0x4e,
- 0x9d, 0x78, 0xe6, 0x2c,
- 0x3c, 0x2a, 0xf8, 0xe4,
- 0x52, 0x0b, 0x15, 0xfa,
- 0xf3, 0xd4, 0x6e, 0x9e,
- 0x44, 0x40, 0xec, 0xe9,
- 0x51, 0x22, 0xfe, 0x36,
- 0x78, 0xa8, 0xec, 0x5c,
- 0x8c, 0x23, 0xee, 0x63,
- 0xe4, 0x0d, 0xf5, 0x66,
- 0x11, 0xb5, 0x9a, 0xd5,
- 0xfc, 0x3e, 0x82, 0x42,
- 0xd2, 0x4c, 0xe1, 0xe9,
- 0x40, 0xb6, 0x5b, 0x86,
- 0x3e, 0x0b, 0x3f, 0x9f,
- 0x52, 0x1c, 0xa7, 0x94,
- 0x19, 0x2f, 0x01, 0x3c,
- 0x7c, 0x63, 0x36, 0x64,
- 0xcb, 0xed, 0xcc, 0x46,
- 0xe7, 0x1b, 0x34, 0x7b
-};
-
-#endif // PROCESSOR_SYNTH_MINIDUMP_UNITTEST_DATA_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/tokenize.cc b/toolkit/crashreporter/google-breakpad/src/processor/tokenize.cc
deleted file mode 100644
index 8fce87a224..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/tokenize.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <string.h>
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-#ifdef _MSC_VER
-#define strtok_r strtok_s
-#endif
-
-using std::vector;
-
-bool Tokenize(char *line,
- const char *separators,
- int max_tokens,
- vector<char*> *tokens) {
- tokens->clear();
- tokens->reserve(max_tokens);
-
- int remaining = max_tokens;
-
- // Split tokens on the separator character.
- // strip them out before exhausting max_tokens.
- char *save_ptr;
- char *token = strtok_r(line, separators, &save_ptr);
- while (token && --remaining > 0) {
- tokens->push_back(token);
- if (remaining > 1)
- token = strtok_r(NULL, separators, &save_ptr);
- }
-
- // If there's anything left, just add it as a single token.
- if (remaining == 0 && (token = strtok_r(NULL, "\r\n", &save_ptr))) {
- tokens->push_back(token);
- }
-
- return tokens->size() == static_cast<unsigned int>(max_tokens);
-}
-
-void StringToVector(const string &str, vector<char> &vec) {
- vec.resize(str.length() + 1);
- std::copy(str.begin(), str.end(),
- vec.begin());
- vec[str.length()] = '\0';
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/tokenize.h b/toolkit/crashreporter/google-breakpad/src/processor/tokenize.h
deleted file mode 100644
index 9ff571d5c5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/tokenize.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Implements a Tokenize function for splitting up strings.
-
-#ifndef GOOGLE_BREAKPAD_PROCESSOR_TOKENIZE_H_
-#define GOOGLE_BREAKPAD_PROCESSOR_TOKENIZE_H_
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-
-namespace google_breakpad {
-
-// Splits line into at most max_tokens tokens, separated by any of the
-// characters in separators and placing them in the tokens vector.
-// line is a 0-terminated string that optionally ends with a newline
-// character or combination, which will be removed.
-// If more tokens than max_tokens are present, the final token is placed
-// into the vector without splitting it up at all. This modifies line as
-// a side effect. Returns true if exactly max_tokens tokens are returned,
-// and false if fewer are returned. This is not considered a failure of
-// Tokenize, but may be treated as a failure if the caller expects an
-// exact, as opposed to maximum, number of tokens.
-
-bool Tokenize(char *line,
- const char *separators,
- int max_tokens,
- std::vector<char*> *tokens);
-// For convenience, since you need a char* to pass to Tokenize.
-// You can call StringToVector on a string, and use &vec[0].
-void StringToVector(const string &str, std::vector<char> &vec);
-
-} // namespace google_breakpad
-
-#endif // GOOGLE_BREAKPAD_PROCESSOR_TOKENIZE_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/processor/windows_frame_info.h b/toolkit/crashreporter/google-breakpad/src/processor/windows_frame_info.h
deleted file mode 100644
index f96e0a438c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/processor/windows_frame_info.h
+++ /dev/null
@@ -1,209 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// windows_frame_info.h: Holds debugging information about a stack frame.
-//
-// This structure is specific to Windows debugging information obtained
-// from pdb files using the DIA API.
-//
-// Author: Mark Mentovai
-
-
-#ifndef PROCESSOR_WINDOWS_FRAME_INFO_H__
-#define PROCESSOR_WINDOWS_FRAME_INFO_H__
-
-#include <string.h>
-#include <stdlib.h>
-
-#include <string>
-#include <vector>
-
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "processor/logging.h"
-#include "processor/tokenize.h"
-
-namespace google_breakpad {
-
-#ifdef _WIN32
-#define strtoull _strtoui64
-#endif
-
-struct WindowsFrameInfo {
- public:
- enum Validity {
- VALID_NONE = 0,
- VALID_PARAMETER_SIZE = 1,
- VALID_ALL = -1
- };
-
- // The types for stack_info_. This is equivalent to MS DIA's
- // StackFrameTypeEnum. Each identifies a different type of frame
- // information, although all are represented in the symbol file in the
- // same format. These are used as indices to the stack_info_ array.
- enum StackInfoTypes {
- STACK_INFO_FPO = 0,
- STACK_INFO_TRAP, // not used here
- STACK_INFO_TSS, // not used here
- STACK_INFO_STANDARD,
- STACK_INFO_FRAME_DATA,
- STACK_INFO_LAST, // must be the last sequentially-numbered item
- STACK_INFO_UNKNOWN = -1
- };
-
- WindowsFrameInfo() : type_(STACK_INFO_UNKNOWN),
- valid(VALID_NONE),
- prolog_size(0),
- epilog_size(0),
- parameter_size(0),
- saved_register_size(0),
- local_size(0),
- max_stack_size(0),
- allocates_base_pointer(0),
- program_string() {}
-
- WindowsFrameInfo(StackInfoTypes type,
- uint32_t set_prolog_size,
- uint32_t set_epilog_size,
- uint32_t set_parameter_size,
- uint32_t set_saved_register_size,
- uint32_t set_local_size,
- uint32_t set_max_stack_size,
- int set_allocates_base_pointer,
- const string set_program_string)
- : type_(type),
- valid(VALID_ALL),
- prolog_size(set_prolog_size),
- epilog_size(set_epilog_size),
- parameter_size(set_parameter_size),
- saved_register_size(set_saved_register_size),
- local_size(set_local_size),
- max_stack_size(set_max_stack_size),
- allocates_base_pointer(set_allocates_base_pointer),
- program_string(set_program_string) {}
-
- // Parse a textual serialization of a WindowsFrameInfo object from
- // a string. Returns NULL if parsing fails, or a new object
- // otherwise. type, rva and code_size are present in the STACK line,
- // but not the StackFrameInfo structure, so return them as outparams.
- static WindowsFrameInfo *ParseFromString(const string string,
- int &type,
- uint64_t &rva,
- uint64_t &code_size) {
- // The format of a STACK WIN record is documented at:
- //
- // https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
-
- std::vector<char> buffer;
- StringToVector(string, buffer);
- std::vector<char*> tokens;
- if (!Tokenize(&buffer[0], " \r\n", 11, &tokens))
- return NULL;
-
- type = strtol(tokens[0], NULL, 16);
- if (type < 0 || type > STACK_INFO_LAST - 1)
- return NULL;
-
- rva = strtoull(tokens[1], NULL, 16);
- code_size = strtoull(tokens[2], NULL, 16);
- uint32_t prolog_size = strtoul(tokens[3], NULL, 16);
- uint32_t epilog_size = strtoul(tokens[4], NULL, 16);
- uint32_t parameter_size = strtoul(tokens[5], NULL, 16);
- uint32_t saved_register_size = strtoul(tokens[6], NULL, 16);
- uint32_t local_size = strtoul(tokens[7], NULL, 16);
- uint32_t max_stack_size = strtoul(tokens[8], NULL, 16);
- int has_program_string = strtoul(tokens[9], NULL, 16);
-
- const char *program_string = "";
- int allocates_base_pointer = 0;
- if (has_program_string) {
- program_string = tokens[10];
- } else {
- allocates_base_pointer = strtoul(tokens[10], NULL, 16);
- }
-
- return new WindowsFrameInfo(static_cast<StackInfoTypes>(type),
- prolog_size,
- epilog_size,
- parameter_size,
- saved_register_size,
- local_size,
- max_stack_size,
- allocates_base_pointer,
- program_string);
- }
-
- // CopyFrom makes "this" WindowsFrameInfo object identical to "that".
- void CopyFrom(const WindowsFrameInfo &that) {
- type_ = that.type_;
- valid = that.valid;
- prolog_size = that.prolog_size;
- epilog_size = that.epilog_size;
- parameter_size = that.parameter_size;
- saved_register_size = that.saved_register_size;
- local_size = that.local_size;
- max_stack_size = that.max_stack_size;
- allocates_base_pointer = that.allocates_base_pointer;
- program_string = that.program_string;
- }
-
- // Clears the WindowsFrameInfo object so that users will see it as though
- // it contains no information.
- void Clear() {
- type_ = STACK_INFO_UNKNOWN;
- valid = VALID_NONE;
- program_string.erase();
- }
-
- StackInfoTypes type_;
-
- // Identifies which fields in the structure are valid. This is of
- // type Validity, but it is defined as an int because it's not
- // possible to OR values into an enumerated type. Users must check
- // this field before using any other.
- int valid;
-
- // These values come from IDiaFrameData.
- uint32_t prolog_size;
- uint32_t epilog_size;
- uint32_t parameter_size;
- uint32_t saved_register_size;
- uint32_t local_size;
- uint32_t max_stack_size;
-
- // Only one of allocates_base_pointer or program_string will be valid.
- // If program_string is empty, use allocates_base_pointer.
- bool allocates_base_pointer;
- string program_string;
-};
-
-} // namespace google_breakpad
-
-
-#endif // PROCESSOR_WINDOWS_FRAME_INFO_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/COPYING b/toolkit/crashreporter/google-breakpad/src/third_party/curl/COPYING
deleted file mode 100644
index 610fbdb07f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/COPYING
+++ /dev/null
@@ -1,22 +0,0 @@
-COPYRIGHT AND PERMISSION NOTICE
-
-Copyright (c) 1996 - 2011, Daniel Stenberg, <daniel@haxx.se>.
-
-All rights reserved.
-
-Permission to use, copy, modify, and distribute this software for any purpose
-with or without fee is hereby granted, provided that the above copyright
-notice and this permission notice appear in all copies.
-
-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 OF THIRD PARTY RIGHTS. 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.
-
-Except as contained in this notice, the name of a copyright holder shall not
-be used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization of the copyright holder.
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curl.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/curl.h
deleted file mode 100644
index 0d80936f75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curl.h
+++ /dev/null
@@ -1,1936 +0,0 @@
-#ifndef __CURL_CURL_H
-#define __CURL_CURL_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: curl.h,v 1.396 2009-10-16 13:30:31 yangtse Exp $
- ***************************************************************************/
-
-/*
- * If you have libcurl problems, all docs and details are found here:
- * http://curl.haxx.se/libcurl/
- *
- * curl-library mailing list subscription and unsubscription web interface:
- * http://cool.haxx.se/mailman/listinfo/curl-library/
- */
-
-/*
- * Leading 'curl' path on the 'curlbuild.h' include statement is
- * required to properly allow building outside of the source tree,
- * due to the fact that in this case 'curlbuild.h' is generated in
- * a subdirectory of the build tree while 'curl.h actually remains
- * in a subdirectory of the source tree.
- */
-
-#include "third_party/curl/curlver.h" /* libcurl version defines */
-#include "third_party/curl/curlbuild.h" /* libcurl build definitions */
-#include "third_party/curl/curlrules.h" /* libcurl rules enforcement */
-
-/*
- * Define WIN32 when build target is Win32 API
- */
-
-#if (defined(_WIN32) || defined(__WIN32__)) && \
- !defined(WIN32) && !defined(__SYMBIAN32__)
-#define WIN32
-#endif
-
-#include <stdio.h>
-#include <limits.h>
-
-/* The include stuff here below is mainly for time_t! */
-#include <sys/types.h>
-#include <time.h>
-
-#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
- !defined(__CYGWIN__) || defined(__MINGW32__)
-#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
-/* The check above prevents the winsock2 inclusion if winsock.h already was
- included, since they can't co-exist without problems */
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#endif
-#else
-
-/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
- libc5-based Linux systems. Only include it on system that are known to
- require it! */
-#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
- defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
- defined(__ANDROID__)
-#include <sys/select.h>
-#endif
-
-#ifndef _WIN32_WCE
-#include <sys/socket.h>
-#endif
-#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
-#include <sys/time.h>
-#endif
-#include <sys/types.h>
-#endif
-
-#ifdef __BEOS__
-#include <support/SupportDefs.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void CURL;
-
-/*
- * Decorate exportable functions for Win32 and Symbian OS DLL linking.
- * This avoids using a .def file for building libcurl.dll.
- */
-#if (defined(WIN32) || defined(_WIN32) || defined(__SYMBIAN32__)) && \
- !defined(CURL_STATICLIB)
-#if defined(BUILDING_LIBCURL)
-#define CURL_EXTERN __declspec(dllexport)
-#else
-#define CURL_EXTERN __declspec(dllimport)
-#endif
-#else
-
-#ifdef CURL_HIDDEN_SYMBOLS
-/*
- * This definition is used to make external definitions visible in the
- * shared library when symbols are hidden by default. It makes no
- * difference when compiling applications whether this is set or not,
- * only when compiling the library.
- */
-#define CURL_EXTERN CURL_EXTERN_SYMBOL
-#else
-#define CURL_EXTERN
-#endif
-#endif
-
-#ifndef curl_socket_typedef
-/* socket typedef */
-#ifdef WIN32
-typedef SOCKET curl_socket_t;
-#define CURL_SOCKET_BAD INVALID_SOCKET
-#else
-typedef int curl_socket_t;
-#define CURL_SOCKET_BAD -1
-#endif
-#define curl_socket_typedef
-#endif /* curl_socket_typedef */
-
-struct curl_httppost {
- struct curl_httppost *next; /* next entry in the list */
- char *name; /* pointer to allocated name */
- long namelength; /* length of name length */
- char *contents; /* pointer to allocated data contents */
- long contentslength; /* length of contents field */
- char *buffer; /* pointer to allocated buffer contents */
- long bufferlength; /* length of buffer field */
- char *contenttype; /* Content-Type */
- struct curl_slist* contentheader; /* list of extra headers for this form */
- struct curl_httppost *more; /* if one field name has more than one
- file, this link should link to following
- files */
- long flags; /* as defined below */
-#define HTTPPOST_FILENAME (1<<0) /* specified content is a file name */
-#define HTTPPOST_READFILE (1<<1) /* specified content is a file name */
-#define HTTPPOST_PTRNAME (1<<2) /* name is only stored pointer
- do not free in formfree */
-#define HTTPPOST_PTRCONTENTS (1<<3) /* contents is only stored pointer
- do not free in formfree */
-#define HTTPPOST_BUFFER (1<<4) /* upload file from buffer */
-#define HTTPPOST_PTRBUFFER (1<<5) /* upload file from pointer contents */
-#define HTTPPOST_CALLBACK (1<<6) /* upload file contents by using the
- regular read callback to get the data
- and pass the given pointer as custom
- pointer */
-
- char *showfilename; /* The file name to show. If not set, the
- actual file name will be used (if this
- is a file part) */
- void *userp; /* custom pointer used for
- HTTPPOST_CALLBACK posts */
-};
-
-typedef int (*curl_progress_callback)(void *clientp,
- double dltotal,
- double dlnow,
- double ultotal,
- double ulnow);
-
-#ifndef CURL_MAX_WRITE_SIZE
- /* Tests have proven that 20K is a very bad buffer size for uploads on
- Windows, while 16K for some odd reason performed a lot better.
- We do the ifndef check to allow this value to easier be changed at build
- time for those who feel adventurous. */
-#define CURL_MAX_WRITE_SIZE 16384
-#endif
-
-#ifndef CURL_MAX_HTTP_HEADER
-/* The only reason to have a max limit for this is to avoid the risk of a bad
- server feeding libcurl with a never-ending header that will cause reallocs
- infinitely */
-#define CURL_MAX_HTTP_HEADER (100*1024)
-#endif
-
-
-/* This is a magic return code for the write callback that, when returned,
- will signal libcurl to pause receiving on the current transfer. */
-#define CURL_WRITEFUNC_PAUSE 0x10000001
-typedef size_t (*curl_write_callback)(char *buffer,
- size_t size,
- size_t nitems,
- void *outstream);
-
-/* These are the return codes for the seek callbacks */
-#define CURL_SEEKFUNC_OK 0
-#define CURL_SEEKFUNC_FAIL 1 /* fail the entire transfer */
-#define CURL_SEEKFUNC_CANTSEEK 2 /* tell libcurl seeking can't be done, so
- libcurl might try other means instead */
-typedef int (*curl_seek_callback)(void *instream,
- curl_off_t offset,
- int origin); /* 'whence' */
-
-/* This is a return code for the read callback that, when returned, will
- signal libcurl to immediately abort the current transfer. */
-#define CURL_READFUNC_ABORT 0x10000000
-/* This is a return code for the read callback that, when returned, will
- signal libcurl to pause sending data on the current transfer. */
-#define CURL_READFUNC_PAUSE 0x10000001
-
-typedef size_t (*curl_read_callback)(char *buffer,
- size_t size,
- size_t nitems,
- void *instream);
-
-typedef enum {
- CURLSOCKTYPE_IPCXN, /* socket created for a specific IP connection */
- CURLSOCKTYPE_LAST /* never use */
-} curlsocktype;
-
-typedef int (*curl_sockopt_callback)(void *clientp,
- curl_socket_t curlfd,
- curlsocktype purpose);
-
-struct curl_sockaddr {
- int family;
- int socktype;
- int protocol;
- unsigned int addrlen; /* addrlen was a socklen_t type before 7.18.0 but it
- turned really ugly and painful on the systems that
- lack this type */
- struct sockaddr addr;
-};
-
-typedef curl_socket_t
-(*curl_opensocket_callback)(void *clientp,
- curlsocktype purpose,
- struct curl_sockaddr *address);
-
-#ifndef CURL_NO_OLDIES
- /* not used since 7.10.8, will be removed in a future release */
-typedef int (*curl_passwd_callback)(void *clientp,
- const char *prompt,
- char *buffer,
- int buflen);
-#endif
-
-typedef enum {
- CURLIOE_OK, /* I/O operation successful */
- CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
- CURLIOE_FAILRESTART, /* failed to restart the read */
- CURLIOE_LAST /* never use */
-} curlioerr;
-
-typedef enum {
- CURLIOCMD_NOP, /* no operation */
- CURLIOCMD_RESTARTREAD, /* restart the read stream from start */
- CURLIOCMD_LAST /* never use */
-} curliocmd;
-
-typedef curlioerr (*curl_ioctl_callback)(CURL *handle,
- int cmd,
- void *clientp);
-
-/*
- * The following typedef's are signatures of malloc, free, realloc, strdup and
- * calloc respectively. Function pointers of these types can be passed to the
- * curl_global_init_mem() function to set user defined memory management
- * callback routines.
- */
-typedef void *(*curl_malloc_callback)(size_t size);
-typedef void (*curl_free_callback)(void *ptr);
-typedef void *(*curl_realloc_callback)(void *ptr, size_t size);
-typedef char *(*curl_strdup_callback)(const char *str);
-typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size);
-
-/* the kind of data that is passed to information_callback*/
-typedef enum {
- CURLINFO_TEXT = 0,
- CURLINFO_HEADER_IN, /* 1 */
- CURLINFO_HEADER_OUT, /* 2 */
- CURLINFO_DATA_IN, /* 3 */
- CURLINFO_DATA_OUT, /* 4 */
- CURLINFO_SSL_DATA_IN, /* 5 */
- CURLINFO_SSL_DATA_OUT, /* 6 */
- CURLINFO_END
-} curl_infotype;
-
-typedef int (*curl_debug_callback)
- (CURL *handle, /* the handle/transfer this concerns */
- curl_infotype type, /* what kind of data */
- char *data, /* points to the data */
- size_t size, /* size of the data pointed to */
- void *userptr); /* whatever the user please */
-
-/* All possible error codes from all sorts of curl functions. Future versions
- may return other values, stay prepared.
-
- Always add new return codes last. Never *EVER* remove any. The return
- codes must remain the same!
- */
-
-typedef enum {
- CURLE_OK = 0,
- CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
- CURLE_FAILED_INIT, /* 2 */
- CURLE_URL_MALFORMAT, /* 3 */
- CURLE_OBSOLETE4, /* 4 - NOT USED */
- CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
- CURLE_COULDNT_RESOLVE_HOST, /* 6 */
- CURLE_COULDNT_CONNECT, /* 7 */
- CURLE_FTP_WEIRD_SERVER_REPLY, /* 8 */
- CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
- due to lack of access - when login fails
- this is not returned. */
- CURLE_OBSOLETE10, /* 10 - NOT USED */
- CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
- CURLE_OBSOLETE12, /* 12 - NOT USED */
- CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
- CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
- CURLE_FTP_CANT_GET_HOST, /* 15 */
- CURLE_OBSOLETE16, /* 16 - NOT USED */
- CURLE_FTP_COULDNT_SET_TYPE, /* 17 */
- CURLE_PARTIAL_FILE, /* 18 */
- CURLE_FTP_COULDNT_RETR_FILE, /* 19 */
- CURLE_OBSOLETE20, /* 20 - NOT USED */
- CURLE_QUOTE_ERROR, /* 21 - quote command failure */
- CURLE_HTTP_RETURNED_ERROR, /* 22 */
- CURLE_WRITE_ERROR, /* 23 */
- CURLE_OBSOLETE24, /* 24 - NOT USED */
- CURLE_UPLOAD_FAILED, /* 25 - failed upload "command" */
- CURLE_READ_ERROR, /* 26 - couldn't open/read from file */
- CURLE_OUT_OF_MEMORY, /* 27 */
- /* Note: CURLE_OUT_OF_MEMORY may sometimes indicate a conversion error
- instead of a memory allocation error if CURL_DOES_CONVERSIONS
- is defined
- */
- CURLE_OPERATION_TIMEDOUT, /* 28 - the timeout time was reached */
- CURLE_OBSOLETE29, /* 29 - NOT USED */
- CURLE_FTP_PORT_FAILED, /* 30 - FTP PORT operation failed */
- CURLE_FTP_COULDNT_USE_REST, /* 31 - the REST command failed */
- CURLE_OBSOLETE32, /* 32 - NOT USED */
- CURLE_RANGE_ERROR, /* 33 - RANGE "command" didn't work */
- CURLE_HTTP_POST_ERROR, /* 34 */
- CURLE_SSL_CONNECT_ERROR, /* 35 - wrong when connecting with SSL */
- CURLE_BAD_DOWNLOAD_RESUME, /* 36 - couldn't resume download */
- CURLE_FILE_COULDNT_READ_FILE, /* 37 */
- CURLE_LDAP_CANNOT_BIND, /* 38 */
- CURLE_LDAP_SEARCH_FAILED, /* 39 */
- CURLE_OBSOLETE40, /* 40 - NOT USED */
- CURLE_FUNCTION_NOT_FOUND, /* 41 */
- CURLE_ABORTED_BY_CALLBACK, /* 42 */
- CURLE_BAD_FUNCTION_ARGUMENT, /* 43 */
- CURLE_OBSOLETE44, /* 44 - NOT USED */
- CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
- CURLE_OBSOLETE46, /* 46 - NOT USED */
- CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
- CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
- CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
- CURLE_OBSOLETE50, /* 50 - NOT USED */
- CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
- wasn't verified fine */
- CURLE_GOT_NOTHING, /* 52 - when this is a specific error */
- CURLE_SSL_ENGINE_NOTFOUND, /* 53 - SSL crypto engine not found */
- CURLE_SSL_ENGINE_SETFAILED, /* 54 - can not set SSL crypto engine as
- default */
- CURLE_SEND_ERROR, /* 55 - failed sending network data */
- CURLE_RECV_ERROR, /* 56 - failure in receiving network data */
- CURLE_OBSOLETE57, /* 57 - NOT IN USE */
- CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
- CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
- CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
- CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
- CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
- CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
- CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
- CURLE_SEND_FAIL_REWIND, /* 65 - Sending the data requires a rewind
- that failed */
- CURLE_SSL_ENGINE_INITFAILED, /* 66 - failed to initialise ENGINE */
- CURLE_LOGIN_DENIED, /* 67 - user, password or similar was not
- accepted and we failed to login */
- CURLE_TFTP_NOTFOUND, /* 68 - file not found on server */
- CURLE_TFTP_PERM, /* 69 - permission problem on server */
- CURLE_REMOTE_DISK_FULL, /* 70 - out of disk space on server */
- CURLE_TFTP_ILLEGAL, /* 71 - Illegal TFTP operation */
- CURLE_TFTP_UNKNOWNID, /* 72 - Unknown transfer ID */
- CURLE_REMOTE_FILE_EXISTS, /* 73 - File already exists */
- CURLE_TFTP_NOSUCHUSER, /* 74 - No such user */
- CURLE_CONV_FAILED, /* 75 - conversion failed */
- CURLE_CONV_REQD, /* 76 - caller must register conversion
- callbacks using curl_easy_setopt options
- CURLOPT_CONV_FROM_NETWORK_FUNCTION,
- CURLOPT_CONV_TO_NETWORK_FUNCTION, and
- CURLOPT_CONV_FROM_UTF8_FUNCTION */
- CURLE_SSL_CACERT_BADFILE, /* 77 - could not load CACERT file, missing
- or wrong format */
- CURLE_REMOTE_FILE_NOT_FOUND, /* 78 - remote file not found */
- CURLE_SSH, /* 79 - error from the SSH layer, somewhat
- generic so the error message will be of
- interest when this has happened */
-
- CURLE_SSL_SHUTDOWN_FAILED, /* 80 - Failed to shut down the SSL
- connection */
- CURLE_AGAIN, /* 81 - socket is not ready for send/recv,
- wait till it's ready and try again (Added
- in 7.18.2) */
- CURLE_SSL_CRL_BADFILE, /* 82 - could not load CRL file, missing or
- wrong format (Added in 7.19.0) */
- CURLE_SSL_ISSUER_ERROR, /* 83 - Issuer check failed. (Added in
- 7.19.0) */
- CURL_LAST /* never use! */
-} CURLcode;
-
-#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
- the obsolete stuff removed! */
-
-/* Backwards compatibility with older names */
-
-/* The following were added in 7.17.1 */
-/* These are scheduled to disappear by 2009 */
-#define CURLE_SSL_PEER_CERTIFICATE CURLE_PEER_FAILED_VERIFICATION
-
-/* The following were added in 7.17.0 */
-/* These are scheduled to disappear by 2009 */
-#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */
-#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
-#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
-#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
-#define CURLE_FTP_CANT_RECONNECT CURLE_OBSOLETE16
-#define CURLE_FTP_COULDNT_GET_SIZE CURLE_OBSOLETE32
-#define CURLE_FTP_COULDNT_SET_ASCII CURLE_OBSOLETE29
-#define CURLE_FTP_WEIRD_USER_REPLY CURLE_OBSOLETE12
-#define CURLE_FTP_WRITE_ERROR CURLE_OBSOLETE20
-#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
-#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
-#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
-#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4
-
-#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
-#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
-#define CURLE_FTP_QUOTE_ERROR CURLE_QUOTE_ERROR
-#define CURLE_TFTP_DISKFULL CURLE_REMOTE_DISK_FULL
-#define CURLE_TFTP_EXISTS CURLE_REMOTE_FILE_EXISTS
-#define CURLE_HTTP_RANGE_ERROR CURLE_RANGE_ERROR
-#define CURLE_FTP_SSL_FAILED CURLE_USE_SSL_FAILED
-
-/* The following were added earlier */
-
-#define CURLE_OPERATION_TIMEOUTED CURLE_OPERATION_TIMEDOUT
-
-#define CURLE_HTTP_NOT_FOUND CURLE_HTTP_RETURNED_ERROR
-#define CURLE_HTTP_PORT_FAILED CURLE_INTERFACE_FAILED
-#define CURLE_FTP_COULDNT_STOR_FILE CURLE_UPLOAD_FAILED
-
-#define CURLE_FTP_PARTIAL_FILE CURLE_PARTIAL_FILE
-#define CURLE_FTP_BAD_DOWNLOAD_RESUME CURLE_BAD_DOWNLOAD_RESUME
-
-/* This was the error code 50 in 7.7.3 and a few earlier versions, this
- is no longer used by libcurl but is instead #defined here only to not
- make programs break */
-#define CURLE_ALREADY_COMPLETE 99999
-
-#endif /*!CURL_NO_OLDIES*/
-
-/* This prototype applies to all conversion callbacks */
-typedef CURLcode (*curl_conv_callback)(char *buffer, size_t length);
-
-typedef CURLcode (*curl_ssl_ctx_callback)(CURL *curl, /* easy handle */
- void *ssl_ctx, /* actually an
- OpenSSL SSL_CTX */
- void *userptr);
-
-typedef enum {
- CURLPROXY_HTTP = 0, /* added in 7.10, new in 7.19.4 default is to use
- CONNECT HTTP/1.1 */
- CURLPROXY_HTTP_1_0 = 1, /* added in 7.19.4, force to use CONNECT
- HTTP/1.0 */
- CURLPROXY_SOCKS4 = 4, /* support added in 7.15.2, enum existed already
- in 7.10 */
- CURLPROXY_SOCKS5 = 5, /* added in 7.10 */
- CURLPROXY_SOCKS4A = 6, /* added in 7.18.0 */
- CURLPROXY_SOCKS5_HOSTNAME = 7 /* Use the SOCKS5 protocol but pass along the
- host name rather than the IP address. added
- in 7.18.0 */
-} curl_proxytype; /* this enum was added in 7.10 */
-
-#define CURLAUTH_NONE 0 /* nothing */
-#define CURLAUTH_BASIC (1<<0) /* Basic (default) */
-#define CURLAUTH_DIGEST (1<<1) /* Digest */
-#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
-#define CURLAUTH_NTLM (1<<3) /* NTLM */
-#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
-#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
-#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
-
-#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
-#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
-#define CURLSSH_AUTH_PUBLICKEY (1<<0) /* public/private key files */
-#define CURLSSH_AUTH_PASSWORD (1<<1) /* password */
-#define CURLSSH_AUTH_HOST (1<<2) /* host key files */
-#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
-#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
-
-#define CURL_ERROR_SIZE 256
-
-struct curl_khkey {
- const char *key; /* points to a zero-terminated string encoded with base64
- if len is zero, otherwise to the "raw" data */
- size_t len;
- enum type {
- CURLKHTYPE_UNKNOWN,
- CURLKHTYPE_RSA1,
- CURLKHTYPE_RSA,
- CURLKHTYPE_DSS
- } keytype;
-};
-
-/* this is the set of return values expected from the curl_sshkeycallback
- callback */
-enum curl_khstat {
- CURLKHSTAT_FINE_ADD_TO_FILE,
- CURLKHSTAT_FINE,
- CURLKHSTAT_REJECT, /* reject the connection, return an error */
- CURLKHSTAT_DEFER, /* do not accept it, but we can't answer right now so
- this causes a CURLE_DEFER error but otherwise the
- connection will be left intact etc */
- CURLKHSTAT_LAST /* not for use, only a marker for last-in-list */
-};
-
-/* this is the set of status codes pass in to the callback */
-enum curl_khmatch {
- CURLKHMATCH_OK, /* match */
- CURLKHMATCH_MISMATCH, /* host found, key mismatch! */
- CURLKHMATCH_MISSING, /* no matching host/key found */
- CURLKHMATCH_LAST /* not for use, only a marker for last-in-list */
-};
-
-typedef int
- (*curl_sshkeycallback) (CURL *easy, /* easy handle */
- const struct curl_khkey *knownkey, /* known */
- const struct curl_khkey *foundkey, /* found */
- enum curl_khmatch, /* libcurl's view on the keys */
- void *clientp); /* custom pointer passed from app */
-
-/* parameter for the CURLOPT_USE_SSL option */
-typedef enum {
- CURLUSESSL_NONE, /* do not attempt to use SSL */
- CURLUSESSL_TRY, /* try using SSL, proceed anyway otherwise */
- CURLUSESSL_CONTROL, /* SSL for the control connection or fail */
- CURLUSESSL_ALL, /* SSL for all communication or fail */
- CURLUSESSL_LAST /* not an option, never use */
-} curl_usessl;
-
-#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
- the obsolete stuff removed! */
-
-/* Backwards compatibility with older names */
-/* These are scheduled to disappear by 2009 */
-
-#define CURLFTPSSL_NONE CURLUSESSL_NONE
-#define CURLFTPSSL_TRY CURLUSESSL_TRY
-#define CURLFTPSSL_CONTROL CURLUSESSL_CONTROL
-#define CURLFTPSSL_ALL CURLUSESSL_ALL
-#define CURLFTPSSL_LAST CURLUSESSL_LAST
-#define curl_ftpssl curl_usessl
-#endif /*!CURL_NO_OLDIES*/
-
-/* parameter for the CURLOPT_FTP_SSL_CCC option */
-typedef enum {
- CURLFTPSSL_CCC_NONE, /* do not send CCC */
- CURLFTPSSL_CCC_PASSIVE, /* Let the server initiate the shutdown */
- CURLFTPSSL_CCC_ACTIVE, /* Initiate the shutdown */
- CURLFTPSSL_CCC_LAST /* not an option, never use */
-} curl_ftpccc;
-
-/* parameter for the CURLOPT_FTPSSLAUTH option */
-typedef enum {
- CURLFTPAUTH_DEFAULT, /* let libcurl decide */
- CURLFTPAUTH_SSL, /* use "AUTH SSL" */
- CURLFTPAUTH_TLS, /* use "AUTH TLS" */
- CURLFTPAUTH_LAST /* not an option, never use */
-} curl_ftpauth;
-
-/* parameter for the CURLOPT_FTP_CREATE_MISSING_DIRS option */
-typedef enum {
- CURLFTP_CREATE_DIR_NONE, /* do NOT create missing dirs! */
- CURLFTP_CREATE_DIR, /* (FTP/SFTP) if CWD fails, try MKD and then CWD
- again if MKD succeeded, for SFTP this does
- similar magic */
- CURLFTP_CREATE_DIR_RETRY, /* (FTP only) if CWD fails, try MKD and then CWD
- again even if MKD failed! */
- CURLFTP_CREATE_DIR_LAST /* not an option, never use */
-} curl_ftpcreatedir;
-
-/* parameter for the CURLOPT_FTP_FILEMETHOD option */
-typedef enum {
- CURLFTPMETHOD_DEFAULT, /* let libcurl pick */
- CURLFTPMETHOD_MULTICWD, /* single CWD operation for each path part */
- CURLFTPMETHOD_NOCWD, /* no CWD at all */
- CURLFTPMETHOD_SINGLECWD, /* one CWD to full dir, then work on file */
- CURLFTPMETHOD_LAST /* not an option, never use */
-} curl_ftpmethod;
-
-/* CURLPROTO_ defines are for the CURLOPT_*PROTOCOLS options */
-#define CURLPROTO_HTTP (1<<0)
-#define CURLPROTO_HTTPS (1<<1)
-#define CURLPROTO_FTP (1<<2)
-#define CURLPROTO_FTPS (1<<3)
-#define CURLPROTO_SCP (1<<4)
-#define CURLPROTO_SFTP (1<<5)
-#define CURLPROTO_TELNET (1<<6)
-#define CURLPROTO_LDAP (1<<7)
-#define CURLPROTO_LDAPS (1<<8)
-#define CURLPROTO_DICT (1<<9)
-#define CURLPROTO_FILE (1<<10)
-#define CURLPROTO_TFTP (1<<11)
-#define CURLPROTO_ALL (~0) /* enable everything */
-
-/* long may be 32 or 64 bits, but we should never depend on anything else
- but 32 */
-#define CURLOPTTYPE_LONG 0
-#define CURLOPTTYPE_OBJECTPOINT 10000
-#define CURLOPTTYPE_FUNCTIONPOINT 20000
-#define CURLOPTTYPE_OFF_T 30000
-
-/* name is uppercase CURLOPT_<name>,
- type is one of the defined CURLOPTTYPE_<type>
- number is unique identifier */
-#ifdef CINIT
-#undef CINIT
-#endif
-
-#ifdef CURL_ISOCPP
-#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG CURLOPTTYPE_LONG
-#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLOPT_/**/name = type + number
-#endif
-
-/*
- * This macro-mania below setups the CURLOPT_[what] enum, to be used with
- * curl_easy_setopt(). The first argument in the CINIT() macro is the [what]
- * word.
- */
-
-typedef enum {
- /* This is the FILE * or void * the regular output should be written to. */
- CINIT(FILE, OBJECTPOINT, 1),
-
- /* The full URL to get/put */
- CINIT(URL, OBJECTPOINT, 2),
-
- /* Port number to connect to, if other than default. */
- CINIT(PORT, LONG, 3),
-
- /* Name of proxy to use. */
- CINIT(PROXY, OBJECTPOINT, 4),
-
- /* "name:password" to use when fetching. */
- CINIT(USERPWD, OBJECTPOINT, 5),
-
- /* "name:password" to use with proxy. */
- CINIT(PROXYUSERPWD, OBJECTPOINT, 6),
-
- /* Range to get, specified as an ASCII string. */
- CINIT(RANGE, OBJECTPOINT, 7),
-
- /* not used */
-
- /* Specified file stream to upload from (use as input): */
- CINIT(INFILE, OBJECTPOINT, 9),
-
- /* Buffer to receive error messages in, must be at least CURL_ERROR_SIZE
- * bytes big. If this is not used, error messages go to stderr instead: */
- CINIT(ERRORBUFFER, OBJECTPOINT, 10),
-
- /* Function that will be called to store the output (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(WRITEFUNCTION, FUNCTIONPOINT, 11),
-
- /* Function that will be called to read the input (instead of fread). The
- * parameters will use fread() syntax, make sure to follow them. */
- CINIT(READFUNCTION, FUNCTIONPOINT, 12),
-
- /* Time-out the read operation after this amount of seconds */
- CINIT(TIMEOUT, LONG, 13),
-
- /* If the CURLOPT_INFILE is used, this can be used to inform libcurl about
- * how large the file being sent really is. That allows better error
- * checking and better verifies that the upload was successful. -1 means
- * unknown size.
- *
- * For large file support, there is also a _LARGE version of the key
- * which takes an off_t type, allowing platforms with larger off_t
- * sizes to handle larger files. See below for INFILESIZE_LARGE.
- */
- CINIT(INFILESIZE, LONG, 14),
-
- /* POST static input fields. */
- CINIT(POSTFIELDS, OBJECTPOINT, 15),
-
- /* Set the referrer page (needed by some CGIs) */
- CINIT(REFERER, OBJECTPOINT, 16),
-
- /* Set the FTP PORT string (interface name, named or numerical IP address)
- Use i.e '-' to use default address. */
- CINIT(FTPPORT, OBJECTPOINT, 17),
-
- /* Set the User-Agent string (examined by some CGIs) */
- CINIT(USERAGENT, OBJECTPOINT, 18),
-
- /* If the download receives less than "low speed limit" bytes/second
- * during "low speed time" seconds, the operations is aborted.
- * You could i.e if you have a pretty high speed connection, abort if
- * it is less than 2000 bytes/sec during 20 seconds.
- */
-
- /* Set the "low speed limit" */
- CINIT(LOW_SPEED_LIMIT, LONG, 19),
-
- /* Set the "low speed time" */
- CINIT(LOW_SPEED_TIME, LONG, 20),
-
- /* Set the continuation offset.
- *
- * Note there is also a _LARGE version of this key which uses
- * off_t types, allowing for large file offsets on platforms which
- * use larger-than-32-bit off_t's. Look below for RESUME_FROM_LARGE.
- */
- CINIT(RESUME_FROM, LONG, 21),
-
- /* Set cookie in request: */
- CINIT(COOKIE, OBJECTPOINT, 22),
-
- /* This points to a linked list of headers, struct curl_slist kind */
- CINIT(HTTPHEADER, OBJECTPOINT, 23),
-
- /* This points to a linked list of post entries, struct curl_httppost */
- CINIT(HTTPPOST, OBJECTPOINT, 24),
-
- /* name of the file keeping your private SSL-certificate */
- CINIT(SSLCERT, OBJECTPOINT, 25),
-
- /* password for the SSL or SSH private key */
- CINIT(KEYPASSWD, OBJECTPOINT, 26),
-
- /* send TYPE parameter? */
- CINIT(CRLF, LONG, 27),
-
- /* send linked-list of QUOTE commands */
- CINIT(QUOTE, OBJECTPOINT, 28),
-
- /* send FILE * or void * to store headers to, if you use a callback it
- is simply passed to the callback unmodified */
- CINIT(WRITEHEADER, OBJECTPOINT, 29),
-
- /* point to a file to read the initial cookies from, also enables
- "cookie awareness" */
- CINIT(COOKIEFILE, OBJECTPOINT, 31),
-
- /* What version to specifically try to use.
- See CURL_SSLVERSION defines below. */
- CINIT(SSLVERSION, LONG, 32),
-
- /* What kind of HTTP time condition to use, see defines */
- CINIT(TIMECONDITION, LONG, 33),
-
- /* Time to use with the above condition. Specified in number of seconds
- since 1 Jan 1970 */
- CINIT(TIMEVALUE, LONG, 34),
-
- /* 35 = OBSOLETE */
-
- /* Custom request, for customizing the get command like
- HTTP: DELETE, TRACE and others
- FTP: to use a different list command
- */
- CINIT(CUSTOMREQUEST, OBJECTPOINT, 36),
-
- /* HTTP request, for odd commands like DELETE, TRACE and others */
- CINIT(STDERR, OBJECTPOINT, 37),
-
- /* 38 is not used */
-
- /* send linked-list of post-transfer QUOTE commands */
- CINIT(POSTQUOTE, OBJECTPOINT, 39),
-
- /* Pass a pointer to string of the output using full variable-replacement
- as described elsewhere. */
- CINIT(WRITEINFO, OBJECTPOINT, 40),
-
- CINIT(VERBOSE, LONG, 41), /* talk a lot */
- CINIT(HEADER, LONG, 42), /* throw the header out too */
- CINIT(NOPROGRESS, LONG, 43), /* shut off the progress meter */
- CINIT(NOBODY, LONG, 44), /* use HEAD to get http document */
- CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
- CINIT(UPLOAD, LONG, 46), /* this is an upload */
- CINIT(POST, LONG, 47), /* HTTP POST method */
- CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
-
- CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
-
- /* Specify whether to read the user+password from the .netrc or the URL.
- * This must be one of the CURL_NETRC_* enums below. */
- CINIT(NETRC, LONG, 51),
-
- CINIT(FOLLOWLOCATION, LONG, 52), /* use Location: Luke! */
-
- CINIT(TRANSFERTEXT, LONG, 53), /* transfer data in text/ASCII format */
- CINIT(PUT, LONG, 54), /* HTTP PUT */
-
- /* 55 = OBSOLETE */
-
- /* Function that will be called instead of the internal progress display
- * function. This function should be defined as the curl_progress_callback
- * prototype defines. */
- CINIT(PROGRESSFUNCTION, FUNCTIONPOINT, 56),
-
- /* Data passed to the progress callback */
- CINIT(PROGRESSDATA, OBJECTPOINT, 57),
-
- /* We want the referrer field set automatically when following locations */
- CINIT(AUTOREFERER, LONG, 58),
-
- /* Port of the proxy, can be set in the proxy string as well with:
- "[host]:[port]" */
- CINIT(PROXYPORT, LONG, 59),
-
- /* size of the POST input data, if strlen() is not good to use */
- CINIT(POSTFIELDSIZE, LONG, 60),
-
- /* tunnel non-http operations through a HTTP proxy */
- CINIT(HTTPPROXYTUNNEL, LONG, 61),
-
- /* Set the interface string to use as outgoing network interface */
- CINIT(INTERFACE, OBJECTPOINT, 62),
-
- /* Set the krb4/5 security level, this also enables krb4/5 awareness. This
- * is a string, 'clear', 'safe', 'confidential' or 'private'. If the string
- * is set but doesn't match one of these, 'private' will be used. */
- CINIT(KRBLEVEL, OBJECTPOINT, 63),
-
- /* Set if we should verify the peer in ssl handshake, set 1 to verify. */
- CINIT(SSL_VERIFYPEER, LONG, 64),
-
- /* The CApath or CAfile used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAINFO, OBJECTPOINT, 65),
-
- /* 66 = OBSOLETE */
- /* 67 = OBSOLETE */
-
- /* Maximum number of http redirects to follow */
- CINIT(MAXREDIRS, LONG, 68),
-
- /* Pass a long set to 1 to get the date of the requested document (if
- possible)! Pass a zero to shut it off. */
- CINIT(FILETIME, LONG, 69),
-
- /* This points to a linked list of telnet options */
- CINIT(TELNETOPTIONS, OBJECTPOINT, 70),
-
- /* Max amount of cached alive connections */
- CINIT(MAXCONNECTS, LONG, 71),
-
- /* What policy to use when closing connections when the cache is filled
- up */
- CINIT(CLOSEPOLICY, LONG, 72),
-
- /* 73 = OBSOLETE */
-
- /* Set to explicitly use a new connection for the upcoming transfer.
- Do not use this unless you're absolutely sure of this, as it makes the
- operation slower and is less friendly for the network. */
- CINIT(FRESH_CONNECT, LONG, 74),
-
- /* Set to explicitly forbid the upcoming transfer's connection to be re-used
- when done. Do not use this unless you're absolutely sure of this, as it
- makes the operation slower and is less friendly for the network. */
- CINIT(FORBID_REUSE, LONG, 75),
-
- /* Set to a file name that contains random data for libcurl to use to
- seed the random engine when doing SSL connects. */
- CINIT(RANDOM_FILE, OBJECTPOINT, 76),
-
- /* Set to the Entropy Gathering Daemon socket pathname */
- CINIT(EGDSOCKET, OBJECTPOINT, 77),
-
- /* Time-out connect operations after this amount of seconds, if connects
- are OK within this time, then fine... This only aborts the connect
- phase. [Only works on unix-style/SIGALRM operating systems] */
- CINIT(CONNECTTIMEOUT, LONG, 78),
-
- /* Function that will be called to store headers (instead of fwrite). The
- * parameters will use fwrite() syntax, make sure to follow them. */
- CINIT(HEADERFUNCTION, FUNCTIONPOINT, 79),
-
- /* Set this to force the HTTP request to get back to GET. Only really usable
- if POST, PUT or a custom request have been used first.
- */
- CINIT(HTTPGET, LONG, 80),
-
- /* Set if we should verify the Common name from the peer certificate in ssl
- * handshake, set 1 to check existence, 2 to ensure that it matches the
- * provided hostname. */
- CINIT(SSL_VERIFYHOST, LONG, 81),
-
- /* Specify which file name to write all known cookies in after completed
- operation. Set file name to "-" (dash) to make it go to stdout. */
- CINIT(COOKIEJAR, OBJECTPOINT, 82),
-
- /* Specify which SSL ciphers to use */
- CINIT(SSL_CIPHER_LIST, OBJECTPOINT, 83),
-
- /* Specify which HTTP version to use! This must be set to one of the
- CURL_HTTP_VERSION* enums set below. */
- CINIT(HTTP_VERSION, LONG, 84),
-
- /* Specifically switch on or off the FTP engine's use of the EPSV command. By
- default, that one will always be attempted before the more traditional
- PASV command. */
- CINIT(FTP_USE_EPSV, LONG, 85),
-
- /* type of the file keeping your SSL-certificate ("DER", "PEM", "ENG") */
- CINIT(SSLCERTTYPE, OBJECTPOINT, 86),
-
- /* name of the file keeping your private SSL-key */
- CINIT(SSLKEY, OBJECTPOINT, 87),
-
- /* type of the file keeping your private SSL-key ("DER", "PEM", "ENG") */
- CINIT(SSLKEYTYPE, OBJECTPOINT, 88),
-
- /* crypto engine for the SSL-sub system */
- CINIT(SSLENGINE, OBJECTPOINT, 89),
-
- /* set the crypto engine for the SSL-sub system as default
- the param has no meaning...
- */
- CINIT(SSLENGINE_DEFAULT, LONG, 90),
-
- /* Non-zero value means to use the global dns cache */
- CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
-
- /* DNS cache timeout */
- CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
-
- /* send linked-list of pre-transfer QUOTE commands */
- CINIT(PREQUOTE, OBJECTPOINT, 93),
-
- /* set the debug function */
- CINIT(DEBUGFUNCTION, FUNCTIONPOINT, 94),
-
- /* set the data for the debug function */
- CINIT(DEBUGDATA, OBJECTPOINT, 95),
-
- /* mark this as start of a cookie session */
- CINIT(COOKIESESSION, LONG, 96),
-
- /* The CApath directory used to validate the peer certificate
- this option is used only if SSL_VERIFYPEER is true */
- CINIT(CAPATH, OBJECTPOINT, 97),
-
- /* Instruct libcurl to use a smaller receive buffer */
- CINIT(BUFFERSIZE, LONG, 98),
-
- /* Instruct libcurl to not use any signal/alarm handlers, even when using
- timeouts. This option is useful for multi-threaded applications.
- See libcurl-the-guide for more background information. */
- CINIT(NOSIGNAL, LONG, 99),
-
- /* Provide a CURLShare for mutexing non-ts data */
- CINIT(SHARE, OBJECTPOINT, 100),
-
- /* indicates type of proxy. accepted values are CURLPROXY_HTTP (default),
- CURLPROXY_SOCKS4, CURLPROXY_SOCKS4A and CURLPROXY_SOCKS5. */
- CINIT(PROXYTYPE, LONG, 101),
-
- /* Set the Accept-Encoding string. Use this to tell a server you would like
- the response to be compressed. */
- CINIT(ENCODING, OBJECTPOINT, 102),
-
- /* Set pointer to private data */
- CINIT(PRIVATE, OBJECTPOINT, 103),
-
- /* Set aliases for HTTP 200 in the HTTP Response header */
- CINIT(HTTP200ALIASES, OBJECTPOINT, 104),
-
- /* Continue to send authentication (user+password) when following locations,
- even when hostname changed. This can potentially send off the name
- and password to whatever host the server decides. */
- CINIT(UNRESTRICTED_AUTH, LONG, 105),
-
- /* Specifically switch on or off the FTP engine's use of the EPRT command ( it
- also disables the LPRT attempt). By default, those ones will always be
- attempted before the good old traditional PORT command. */
- CINIT(FTP_USE_EPRT, LONG, 106),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_USERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(HTTPAUTH, LONG, 107),
-
- /* Set the ssl context callback function, currently only for OpenSSL ssl_ctx
- in second argument. The function must be matching the
- curl_ssl_ctx_callback proto. */
- CINIT(SSL_CTX_FUNCTION, FUNCTIONPOINT, 108),
-
- /* Set the userdata for the ssl context callback function's third
- argument */
- CINIT(SSL_CTX_DATA, OBJECTPOINT, 109),
-
- /* FTP Option that causes missing dirs to be created on the remote server.
- In 7.19.4 we introduced the convenience enums for this option using the
- CURLFTP_CREATE_DIR prefix.
- */
- CINIT(FTP_CREATE_MISSING_DIRS, LONG, 110),
-
- /* Set this to a bitmask value to enable the particular authentications
- methods you like. Use this in combination with CURLOPT_PROXYUSERPWD.
- Note that setting multiple bits may cause extra network round-trips. */
- CINIT(PROXYAUTH, LONG, 111),
-
- /* FTP option that changes the timeout, in seconds, associated with
- getting a response. This is different from transfer timeout time and
- essentially places a demand on the FTP server to acknowledge commands
- in a timely manner. */
- CINIT(FTP_RESPONSE_TIMEOUT, LONG, 112),
-
- /* Set this option to one of the CURL_IPRESOLVE_* defines (see below) to
- tell libcurl to resolve names to those IP versions only. This only has
- affect on systems with support for more than one, i.e IPv4 _and_ IPv6. */
- CINIT(IPRESOLVE, LONG, 113),
-
- /* Set this option to limit the size of a file that will be downloaded from
- an HTTP or FTP server.
-
- Note there is also _LARGE version which adds large file support for
- platforms which have larger off_t sizes. See MAXFILESIZE_LARGE below. */
- CINIT(MAXFILESIZE, LONG, 114),
-
- /* See the comment for INFILESIZE above, but in short, specifies
- * the size of the file being uploaded. -1 means unknown.
- */
- CINIT(INFILESIZE_LARGE, OFF_T, 115),
-
- /* Sets the continuation offset. There is also a LONG version of this;
- * look above for RESUME_FROM.
- */
- CINIT(RESUME_FROM_LARGE, OFF_T, 116),
-
- /* Sets the maximum size of data that will be downloaded from
- * an HTTP or FTP server. See MAXFILESIZE above for the LONG version.
- */
- CINIT(MAXFILESIZE_LARGE, OFF_T, 117),
-
- /* Set this option to the file name of your .netrc file you want libcurl
- to parse (using the CURLOPT_NETRC option). If not set, libcurl will do
- a poor attempt to find the user's home directory and check for a .netrc
- file in there. */
- CINIT(NETRC_FILE, OBJECTPOINT, 118),
-
- /* Enable SSL/TLS for FTP, pick one of:
- CURLFTPSSL_TRY - try using SSL, proceed anyway otherwise
- CURLFTPSSL_CONTROL - SSL for the control connection or fail
- CURLFTPSSL_ALL - SSL for all communication or fail
- */
- CINIT(USE_SSL, LONG, 119),
-
- /* The _LARGE version of the standard POSTFIELDSIZE option */
- CINIT(POSTFIELDSIZE_LARGE, OFF_T, 120),
-
- /* Enable/disable the TCP Nagle algorithm */
- CINIT(TCP_NODELAY, LONG, 121),
-
- /* 122 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 123 OBSOLETE. Gone in 7.16.0 */
- /* 124 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 125 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 126 OBSOLETE, used in 7.12.3. Gone in 7.13.0 */
- /* 127 OBSOLETE. Gone in 7.16.0 */
- /* 128 OBSOLETE. Gone in 7.16.0 */
-
- /* When FTP over SSL/TLS is selected (with CURLOPT_USE_SSL), this option
- can be used to change libcurl's default action which is to first try
- "AUTH SSL" and then "AUTH TLS" in this order, and proceed when a OK
- response has been received.
-
- Available parameters are:
- CURLFTPAUTH_DEFAULT - let libcurl decide
- CURLFTPAUTH_SSL - try "AUTH SSL" first, then TLS
- CURLFTPAUTH_TLS - try "AUTH TLS" first, then SSL
- */
- CINIT(FTPSSLAUTH, LONG, 129),
-
- CINIT(IOCTLFUNCTION, FUNCTIONPOINT, 130),
- CINIT(IOCTLDATA, OBJECTPOINT, 131),
-
- /* 132 OBSOLETE. Gone in 7.16.0 */
- /* 133 OBSOLETE. Gone in 7.16.0 */
-
- /* zero terminated string for pass on to the FTP server when asked for
- "account" info */
- CINIT(FTP_ACCOUNT, OBJECTPOINT, 134),
-
- /* feed cookies into cookie engine */
- CINIT(COOKIELIST, OBJECTPOINT, 135),
-
- /* ignore Content-Length */
- CINIT(IGNORE_CONTENT_LENGTH, LONG, 136),
-
- /* Set to non-zero to skip the IP address received in a 227 PASV FTP server
- response. Typically used for FTP-SSL purposes but is not restricted to
- that. libcurl will then instead use the same IP address it used for the
- control connection. */
- CINIT(FTP_SKIP_PASV_IP, LONG, 137),
-
- /* Select "file method" to use when doing FTP, see the curl_ftpmethod
- above. */
- CINIT(FTP_FILEMETHOD, LONG, 138),
-
- /* Local port number to bind the socket to */
- CINIT(LOCALPORT, LONG, 139),
-
- /* Number of ports to try, including the first one set with LOCALPORT.
- Thus, setting it to 1 will make no additional attempts but the first.
- */
- CINIT(LOCALPORTRANGE, LONG, 140),
-
- /* no transfer, set up connection and let application use the socket by
- extracting it with CURLINFO_LASTSOCKET */
- CINIT(CONNECT_ONLY, LONG, 141),
-
- /* Function that will be called to convert from the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_FROM_NETWORK_FUNCTION, FUNCTIONPOINT, 142),
-
- /* Function that will be called to convert to the
- network encoding (instead of using the iconv calls in libcurl) */
- CINIT(CONV_TO_NETWORK_FUNCTION, FUNCTIONPOINT, 143),
-
- /* Function that will be called to convert from UTF8
- (instead of using the iconv calls in libcurl)
- Note that this is used only for SSL certificate processing */
- CINIT(CONV_FROM_UTF8_FUNCTION, FUNCTIONPOINT, 144),
-
- /* if the connection proceeds too quickly then need to slow it down */
- /* limit-rate: maximum number of bytes per second to send or receive */
- CINIT(MAX_SEND_SPEED_LARGE, OFF_T, 145),
- CINIT(MAX_RECV_SPEED_LARGE, OFF_T, 146),
-
- /* Pointer to command string to send if USER/PASS fails. */
- CINIT(FTP_ALTERNATIVE_TO_USER, OBJECTPOINT, 147),
-
- /* callback function for setting socket options */
- CINIT(SOCKOPTFUNCTION, FUNCTIONPOINT, 148),
- CINIT(SOCKOPTDATA, OBJECTPOINT, 149),
-
- /* set to 0 to disable session ID re-use for this transfer, default is
- enabled (== 1) */
- CINIT(SSL_SESSIONID_CACHE, LONG, 150),
-
- /* allowed SSH authentication methods */
- CINIT(SSH_AUTH_TYPES, LONG, 151),
-
- /* Used by scp/sftp to do public/private key authentication */
- CINIT(SSH_PUBLIC_KEYFILE, OBJECTPOINT, 152),
- CINIT(SSH_PRIVATE_KEYFILE, OBJECTPOINT, 153),
-
- /* Send CCC (Clear Command Channel) after authentication */
- CINIT(FTP_SSL_CCC, LONG, 154),
-
- /* Same as TIMEOUT and CONNECTTIMEOUT, but with ms resolution */
- CINIT(TIMEOUT_MS, LONG, 155),
- CINIT(CONNECTTIMEOUT_MS, LONG, 156),
-
- /* set to zero to disable the libcurl's decoding and thus pass the raw body
- data to the application even when it is encoded/compressed */
- CINIT(HTTP_TRANSFER_DECODING, LONG, 157),
- CINIT(HTTP_CONTENT_DECODING, LONG, 158),
-
- /* Permission used when creating new files and directories on the remote
- server for protocols that support it, SFTP/SCP/FILE */
- CINIT(NEW_FILE_PERMS, LONG, 159),
- CINIT(NEW_DIRECTORY_PERMS, LONG, 160),
-
- /* Set the behaviour of POST when redirecting. Values must be set to one
- of CURL_REDIR* defines below. This used to be called CURLOPT_POST301 */
- CINIT(POSTREDIR, LONG, 161),
-
- /* used by scp/sftp to verify the host's public key */
- CINIT(SSH_HOST_PUBLIC_KEY_MD5, OBJECTPOINT, 162),
-
- /* Callback function for opening socket (instead of socket(2)). Optionally,
- callback is able change the address or refuse to connect returning
- CURL_SOCKET_BAD. The callback should have type
- curl_opensocket_callback */
- CINIT(OPENSOCKETFUNCTION, FUNCTIONPOINT, 163),
- CINIT(OPENSOCKETDATA, OBJECTPOINT, 164),
-
- /* POST volatile input fields. */
- CINIT(COPYPOSTFIELDS, OBJECTPOINT, 165),
-
- /* set transfer mode (;type=<a|i>) when doing FTP via an HTTP proxy */
- CINIT(PROXY_TRANSFER_MODE, LONG, 166),
-
- /* Callback function for seeking in the input stream */
- CINIT(SEEKFUNCTION, FUNCTIONPOINT, 167),
- CINIT(SEEKDATA, OBJECTPOINT, 168),
-
- /* CRL file */
- CINIT(CRLFILE, OBJECTPOINT, 169),
-
- /* Issuer certificate */
- CINIT(ISSUERCERT, OBJECTPOINT, 170),
-
- /* (IPv6) Address scope */
- CINIT(ADDRESS_SCOPE, LONG, 171),
-
- /* Collect certificate chain info and allow it to get retrievable with
- CURLINFO_CERTINFO after the transfer is complete. (Unfortunately) only
- working with OpenSSL-powered builds. */
- CINIT(CERTINFO, LONG, 172),
-
- /* "name" and "pwd" to use when fetching. */
- CINIT(USERNAME, OBJECTPOINT, 173),
- CINIT(PASSWORD, OBJECTPOINT, 174),
-
- /* "name" and "pwd" to use with Proxy when fetching. */
- CINIT(PROXYUSERNAME, OBJECTPOINT, 175),
- CINIT(PROXYPASSWORD, OBJECTPOINT, 176),
-
- /* Comma separated list of hostnames defining no-proxy zones. These should
- match both hostnames directly, and hostnames within a domain. For
- example, local.com will match local.com and www.local.com, but NOT
- notlocal.com or www.notlocal.com. For compatibility with other
- implementations of this, .local.com will be considered to be the same as
- local.com. A single * is the only valid wildcard, and effectively
- disables the use of proxy. */
- CINIT(NOPROXY, OBJECTPOINT, 177),
-
- /* block size for TFTP transfers */
- CINIT(TFTP_BLKSIZE, LONG, 178),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_SERVICE, OBJECTPOINT, 179),
-
- /* Socks Service */
- CINIT(SOCKS5_GSSAPI_NEC, LONG, 180),
-
- /* set the bitmask for the protocols that are allowed to be used for the
- transfer, which thus helps the app which takes URLs from users or other
- external inputs and want to restrict what protocol(s) to deal
- with. Defaults to CURLPROTO_ALL. */
- CINIT(PROTOCOLS, LONG, 181),
-
- /* set the bitmask for the protocols that libcurl is allowed to follow to,
- as a subset of the CURLOPT_PROTOCOLS ones. That means the protocol needs
- to be set in both bitmasks to be allowed to get redirected to. Defaults
- to all protocols except FILE and SCP. */
- CINIT(REDIR_PROTOCOLS, LONG, 182),
-
- /* set the SSH knownhost file name to use */
- CINIT(SSH_KNOWNHOSTS, OBJECTPOINT, 183),
-
- /* set the SSH host key callback, must point to a curl_sshkeycallback
- function */
- CINIT(SSH_KEYFUNCTION, FUNCTIONPOINT, 184),
-
- /* set the SSH host key callback custom pointer */
- CINIT(SSH_KEYDATA, OBJECTPOINT, 185),
-
- CURLOPT_LASTENTRY /* the last unused */
-} CURLoption;
-
-#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
- the obsolete stuff removed! */
-
-/* Backwards compatibility with older names */
-/* These are scheduled to disappear by 2011 */
-
-/* This was added in version 7.19.1 */
-#define CURLOPT_POST301 CURLOPT_POSTREDIR
-
-/* These are scheduled to disappear by 2009 */
-
-/* The following were added in 7.17.0 */
-#define CURLOPT_SSLKEYPASSWD CURLOPT_KEYPASSWD
-#define CURLOPT_FTPAPPEND CURLOPT_APPEND
-#define CURLOPT_FTPLISTONLY CURLOPT_DIRLISTONLY
-#define CURLOPT_FTP_SSL CURLOPT_USE_SSL
-
-/* The following were added earlier */
-
-#define CURLOPT_SSLCERTPASSWD CURLOPT_KEYPASSWD
-#define CURLOPT_KRB4LEVEL CURLOPT_KRBLEVEL
-
-#else
-/* This is set if CURL_NO_OLDIES is defined at compile-time */
-#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
-#endif
-
-
- /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
- name resolves addresses using more than one IP protocol version, this
- option might be handy to force libcurl to use a specific IP version. */
-#define CURL_IPRESOLVE_WHATEVER 0 /* default, resolves addresses to all IP
- versions that your system allows */
-#define CURL_IPRESOLVE_V4 1 /* resolve to ipv4 addresses */
-#define CURL_IPRESOLVE_V6 2 /* resolve to ipv6 addresses */
-
- /* three convenient "aliases" that follow the name scheme better */
-#define CURLOPT_WRITEDATA CURLOPT_FILE
-#define CURLOPT_READDATA CURLOPT_INFILE
-#define CURLOPT_HEADERDATA CURLOPT_WRITEHEADER
-
- /* These enums are for use with the CURLOPT_HTTP_VERSION option. */
-enum {
- CURL_HTTP_VERSION_NONE, /* setting this means we don't care, and that we'd
- like the library to choose the best possible
- for us! */
- CURL_HTTP_VERSION_1_0, /* please use HTTP 1.0 in the request */
- CURL_HTTP_VERSION_1_1, /* please use HTTP 1.1 in the request */
-
- CURL_HTTP_VERSION_LAST /* *ILLEGAL* http version */
-};
-
- /* These enums are for use with the CURLOPT_NETRC option. */
-enum CURL_NETRC_OPTION {
- CURL_NETRC_IGNORED, /* The .netrc will never be read.
- * This is the default. */
- CURL_NETRC_OPTIONAL, /* A user:password in the URL will be preferred
- * to one in the .netrc. */
- CURL_NETRC_REQUIRED, /* A user:password in the URL will be ignored.
- * Unless one is set programmatically, the .netrc
- * will be queried. */
- CURL_NETRC_LAST
-};
-
-enum {
- CURL_SSLVERSION_DEFAULT,
- CURL_SSLVERSION_TLSv1,
- CURL_SSLVERSION_SSLv2,
- CURL_SSLVERSION_SSLv3,
-
- CURL_SSLVERSION_LAST /* never use, keep last */
-};
-
-/* symbols to use with CURLOPT_POSTREDIR.
- CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
- CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
-
-#define CURL_REDIR_GET_ALL 0
-#define CURL_REDIR_POST_301 1
-#define CURL_REDIR_POST_302 2
-#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
-
-typedef enum {
- CURL_TIMECOND_NONE,
-
- CURL_TIMECOND_IFMODSINCE,
- CURL_TIMECOND_IFUNMODSINCE,
- CURL_TIMECOND_LASTMOD,
-
- CURL_TIMECOND_LAST
-} curl_TimeCond;
-
-
-/* curl_strequal() and curl_strnequal() are subject for removal in a future
- libcurl, see lib/README.curlx for details */
-CURL_EXTERN int (curl_strequal)(const char *s1, const char *s2);
-CURL_EXTERN int (curl_strnequal)(const char *s1, const char *s2, size_t n);
-
-/* name is uppercase CURLFORM_<name> */
-#ifdef CFINIT
-#undef CFINIT
-#endif
-
-#ifdef CURL_ISOCPP
-#define CFINIT(name) CURLFORM_ ## name
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define CFINIT(name) CURLFORM_/**/name
-#endif
-
-typedef enum {
- CFINIT(NOTHING), /********* the first one is unused ************/
-
- /* */
- CFINIT(COPYNAME),
- CFINIT(PTRNAME),
- CFINIT(NAMELENGTH),
- CFINIT(COPYCONTENTS),
- CFINIT(PTRCONTENTS),
- CFINIT(CONTENTSLENGTH),
- CFINIT(FILECONTENT),
- CFINIT(ARRAY),
- CFINIT(OBSOLETE),
- CFINIT(FILE),
-
- CFINIT(BUFFER),
- CFINIT(BUFFERPTR),
- CFINIT(BUFFERLENGTH),
-
- CFINIT(CONTENTTYPE),
- CFINIT(CONTENTHEADER),
- CFINIT(FILENAME),
- CFINIT(END),
- CFINIT(OBSOLETE2),
-
- CFINIT(STREAM),
-
- CURLFORM_LASTENTRY /* the last unused */
-} CURLformoption;
-
-#undef CFINIT /* done */
-
-/* structure to be used as parameter for CURLFORM_ARRAY */
-struct curl_forms {
- CURLformoption option;
- const char *value;
-};
-
-/* use this for multipart formpost building */
-/* Returns code for curl_formadd()
- *
- * Returns:
- * CURL_FORMADD_OK on success
- * CURL_FORMADD_MEMORY if the FormInfo allocation fails
- * CURL_FORMADD_OPTION_TWICE if one option is given twice for one Form
- * CURL_FORMADD_NULL if a null pointer was given for a char
- * CURL_FORMADD_MEMORY if the allocation of a FormInfo struct failed
- * CURL_FORMADD_UNKNOWN_OPTION if an unknown option was used
- * CURL_FORMADD_INCOMPLETE if the some FormInfo is not complete (or error)
- * CURL_FORMADD_MEMORY if a curl_httppost struct cannot be allocated
- * CURL_FORMADD_MEMORY if some allocation for string copying failed.
- * CURL_FORMADD_ILLEGAL_ARRAY if an illegal option is used in an array
- *
- ***************************************************************************/
-typedef enum {
- CURL_FORMADD_OK, /* first, no error */
-
- CURL_FORMADD_MEMORY,
- CURL_FORMADD_OPTION_TWICE,
- CURL_FORMADD_NULL,
- CURL_FORMADD_UNKNOWN_OPTION,
- CURL_FORMADD_INCOMPLETE,
- CURL_FORMADD_ILLEGAL_ARRAY,
- CURL_FORMADD_DISABLED, /* libcurl was built with this disabled */
-
- CURL_FORMADD_LAST /* last */
-} CURLFORMcode;
-
-/*
- * NAME curl_formadd()
- *
- * DESCRIPTION
- *
- * Pretty advanced function for building multi-part formposts. Each invoke
- * adds one part that together construct a full post. Then use
- * CURLOPT_HTTPPOST to send it off to libcurl.
- */
-CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
- struct curl_httppost **last_post,
- ...);
-
-/*
- * callback function for curl_formget()
- * The void *arg pointer will be the one passed as second argument to
- * curl_formget().
- * The character buffer passed to it must not be freed.
- * Should return the buffer length passed to it as the argument "len" on
- * success.
- */
-typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
-
-/*
- * NAME curl_formget()
- *
- * DESCRIPTION
- *
- * Serialize a curl_httppost struct built with curl_formadd().
- * Accepts a void pointer as second argument which will be passed to
- * the curl_formget_callback function.
- * Returns 0 on success.
- */
-CURL_EXTERN int curl_formget(struct curl_httppost *form, void *arg,
- curl_formget_callback append);
-/*
- * NAME curl_formfree()
- *
- * DESCRIPTION
- *
- * Free a multipart formpost previously built with curl_formadd().
- */
-CURL_EXTERN void curl_formfree(struct curl_httppost *form);
-
-/*
- * NAME curl_getenv()
- *
- * DESCRIPTION
- *
- * Returns a malloc()'ed string that MUST be curl_free()ed after usage is
- * complete. DEPRECATED - see lib/README.curlx
- */
-CURL_EXTERN char *curl_getenv(const char *variable);
-
-/*
- * NAME curl_version()
- *
- * DESCRIPTION
- *
- * Returns a static ascii string of the libcurl version.
- */
-CURL_EXTERN char *curl_version(void);
-
-/*
- * NAME curl_easy_escape()
- *
- * DESCRIPTION
- *
- * Escapes URL strings (converts all letters consider illegal in URLs to their
- * %XX versions). This function returns a new allocated string or NULL if an
- * error occurred.
- */
-CURL_EXTERN char *curl_easy_escape(CURL *handle,
- const char *string,
- int length);
-
-/* the previous version: */
-CURL_EXTERN char *curl_escape(const char *string,
- int length);
-
-
-/*
- * NAME curl_easy_unescape()
- *
- * DESCRIPTION
- *
- * Unescapes URL encoding in strings (converts all %XX codes to their 8bit
- * versions). This function returns a new allocated string or NULL if an error
- * occurred.
- * Conversion Note: On non-ASCII platforms the ASCII %XX codes are
- * converted into the host encoding.
- */
-CURL_EXTERN char *curl_easy_unescape(CURL *handle,
- const char *string,
- int length,
- int *outlength);
-
-/* the previous version */
-CURL_EXTERN char *curl_unescape(const char *string,
- int length);
-
-/*
- * NAME curl_free()
- *
- * DESCRIPTION
- *
- * Provided for de-allocation in the same translation unit that did the
- * allocation. Added in libcurl 7.10
- */
-CURL_EXTERN void curl_free(void *p);
-
-/*
- * NAME curl_global_init()
- *
- * DESCRIPTION
- *
- * curl_global_init() should be invoked exactly once for each application that
- * uses libcurl and before any call of other libcurl functions.
- *
- * This function is not thread-safe!
- */
-CURL_EXTERN CURLcode curl_global_init(long flags);
-
-/*
- * NAME curl_global_init_mem()
- *
- * DESCRIPTION
- *
- * curl_global_init() or curl_global_init_mem() should be invoked exactly once
- * for each application that uses libcurl. This function can be used to
- * initialize libcurl and set user defined memory management callback
- * functions. Users can implement memory management routines to check for
- * memory leaks, check for mis-use of the curl library etc. User registered
- * callback routines with be invoked by this library instead of the system
- * memory management routines like malloc, free etc.
- */
-CURL_EXTERN CURLcode curl_global_init_mem(long flags,
- curl_malloc_callback m,
- curl_free_callback f,
- curl_realloc_callback r,
- curl_strdup_callback s,
- curl_calloc_callback c);
-
-/*
- * NAME curl_global_cleanup()
- *
- * DESCRIPTION
- *
- * curl_global_cleanup() should be invoked exactly once for each application
- * that uses libcurl
- */
-CURL_EXTERN void curl_global_cleanup(void);
-
-/* linked-list structure for the CURLOPT_QUOTE option (and other) */
-struct curl_slist {
- char *data;
- struct curl_slist *next;
-};
-
-/*
- * NAME curl_slist_append()
- *
- * DESCRIPTION
- *
- * Appends a string to a linked list. If no list exists, it will be created
- * first. Returns the new list, after appending.
- */
-CURL_EXTERN struct curl_slist *curl_slist_append(struct curl_slist *,
- const char *);
-
-/*
- * NAME curl_slist_free_all()
- *
- * DESCRIPTION
- *
- * free a previously built curl_slist.
- */
-CURL_EXTERN void curl_slist_free_all(struct curl_slist *);
-
-/*
- * NAME curl_getdate()
- *
- * DESCRIPTION
- *
- * Returns the time, in seconds since 1 Jan 1970 of the time string given in
- * the first argument. The time argument in the second parameter is unused
- * and should be set to NULL.
- */
-CURL_EXTERN time_t curl_getdate(const char *p, const time_t *unused);
-
-/* info about the certificate chain, only for OpenSSL builds. Asked
- for with CURLOPT_CERTINFO / CURLINFO_CERTINFO */
-struct curl_certinfo {
- int num_of_certs; /* number of certificates with information */
- struct curl_slist **certinfo; /* for each index in this array, there's a
- linked list with textual information in the
- format "name: value" */
-};
-
-#define CURLINFO_STRING 0x100000
-#define CURLINFO_LONG 0x200000
-#define CURLINFO_DOUBLE 0x300000
-#define CURLINFO_SLIST 0x400000
-#define CURLINFO_MASK 0x0fffff
-#define CURLINFO_TYPEMASK 0xf00000
-
-typedef enum {
- CURLINFO_NONE, /* first, never use this */
- CURLINFO_EFFECTIVE_URL = CURLINFO_STRING + 1,
- CURLINFO_RESPONSE_CODE = CURLINFO_LONG + 2,
- CURLINFO_TOTAL_TIME = CURLINFO_DOUBLE + 3,
- CURLINFO_NAMELOOKUP_TIME = CURLINFO_DOUBLE + 4,
- CURLINFO_CONNECT_TIME = CURLINFO_DOUBLE + 5,
- CURLINFO_PRETRANSFER_TIME = CURLINFO_DOUBLE + 6,
- CURLINFO_SIZE_UPLOAD = CURLINFO_DOUBLE + 7,
- CURLINFO_SIZE_DOWNLOAD = CURLINFO_DOUBLE + 8,
- CURLINFO_SPEED_DOWNLOAD = CURLINFO_DOUBLE + 9,
- CURLINFO_SPEED_UPLOAD = CURLINFO_DOUBLE + 10,
- CURLINFO_HEADER_SIZE = CURLINFO_LONG + 11,
- CURLINFO_REQUEST_SIZE = CURLINFO_LONG + 12,
- CURLINFO_SSL_VERIFYRESULT = CURLINFO_LONG + 13,
- CURLINFO_FILETIME = CURLINFO_LONG + 14,
- CURLINFO_CONTENT_LENGTH_DOWNLOAD = CURLINFO_DOUBLE + 15,
- CURLINFO_CONTENT_LENGTH_UPLOAD = CURLINFO_DOUBLE + 16,
- CURLINFO_STARTTRANSFER_TIME = CURLINFO_DOUBLE + 17,
- CURLINFO_CONTENT_TYPE = CURLINFO_STRING + 18,
- CURLINFO_REDIRECT_TIME = CURLINFO_DOUBLE + 19,
- CURLINFO_REDIRECT_COUNT = CURLINFO_LONG + 20,
- CURLINFO_PRIVATE = CURLINFO_STRING + 21,
- CURLINFO_HTTP_CONNECTCODE = CURLINFO_LONG + 22,
- CURLINFO_HTTPAUTH_AVAIL = CURLINFO_LONG + 23,
- CURLINFO_PROXYAUTH_AVAIL = CURLINFO_LONG + 24,
- CURLINFO_OS_ERRNO = CURLINFO_LONG + 25,
- CURLINFO_NUM_CONNECTS = CURLINFO_LONG + 26,
- CURLINFO_SSL_ENGINES = CURLINFO_SLIST + 27,
- CURLINFO_COOKIELIST = CURLINFO_SLIST + 28,
- CURLINFO_LASTSOCKET = CURLINFO_LONG + 29,
- CURLINFO_FTP_ENTRY_PATH = CURLINFO_STRING + 30,
- CURLINFO_REDIRECT_URL = CURLINFO_STRING + 31,
- CURLINFO_PRIMARY_IP = CURLINFO_STRING + 32,
- CURLINFO_APPCONNECT_TIME = CURLINFO_DOUBLE + 33,
- CURLINFO_CERTINFO = CURLINFO_SLIST + 34,
- CURLINFO_CONDITION_UNMET = CURLINFO_LONG + 35,
- /* Fill in new entries below here! */
-
- CURLINFO_LASTONE = 35
-} CURLINFO;
-
-/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as
- CURLINFO_HTTP_CODE */
-#define CURLINFO_HTTP_CODE CURLINFO_RESPONSE_CODE
-
-typedef enum {
- CURLCLOSEPOLICY_NONE, /* first, never use this */
-
- CURLCLOSEPOLICY_OLDEST,
- CURLCLOSEPOLICY_LEAST_RECENTLY_USED,
- CURLCLOSEPOLICY_LEAST_TRAFFIC,
- CURLCLOSEPOLICY_SLOWEST,
- CURLCLOSEPOLICY_CALLBACK,
-
- CURLCLOSEPOLICY_LAST /* last, never use this */
-} curl_closepolicy;
-
-#define CURL_GLOBAL_SSL (1<<0)
-#define CURL_GLOBAL_WIN32 (1<<1)
-#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
-#define CURL_GLOBAL_NOTHING 0
-#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
-
-
-/*****************************************************************************
- * Setup defines, protos etc for the sharing stuff.
- */
-
-/* Different data locks for a single share */
-typedef enum {
- CURL_LOCK_DATA_NONE = 0,
- /* CURL_LOCK_DATA_SHARE is used internally to say that
- * the locking is just made to change the internal state of the share
- * itself.
- */
- CURL_LOCK_DATA_SHARE,
- CURL_LOCK_DATA_COOKIE,
- CURL_LOCK_DATA_DNS,
- CURL_LOCK_DATA_SSL_SESSION,
- CURL_LOCK_DATA_CONNECT,
- CURL_LOCK_DATA_LAST
-} curl_lock_data;
-
-/* Different lock access types */
-typedef enum {
- CURL_LOCK_ACCESS_NONE = 0, /* unspecified action */
- CURL_LOCK_ACCESS_SHARED = 1, /* for read perhaps */
- CURL_LOCK_ACCESS_SINGLE = 2, /* for write perhaps */
- CURL_LOCK_ACCESS_LAST /* never use */
-} curl_lock_access;
-
-typedef void (*curl_lock_function)(CURL *handle,
- curl_lock_data data,
- curl_lock_access locktype,
- void *userptr);
-typedef void (*curl_unlock_function)(CURL *handle,
- curl_lock_data data,
- void *userptr);
-
-typedef void CURLSH;
-
-typedef enum {
- CURLSHE_OK, /* all is fine */
- CURLSHE_BAD_OPTION, /* 1 */
- CURLSHE_IN_USE, /* 2 */
- CURLSHE_INVALID, /* 3 */
- CURLSHE_NOMEM, /* out of memory */
- CURLSHE_LAST /* never use */
-} CURLSHcode;
-
-typedef enum {
- CURLSHOPT_NONE, /* don't use */
- CURLSHOPT_SHARE, /* specify a data type to share */
- CURLSHOPT_UNSHARE, /* specify which data type to stop sharing */
- CURLSHOPT_LOCKFUNC, /* pass in a 'curl_lock_function' pointer */
- CURLSHOPT_UNLOCKFUNC, /* pass in a 'curl_unlock_function' pointer */
- CURLSHOPT_USERDATA, /* pass in a user data pointer used in the lock/unlock
- callback functions */
- CURLSHOPT_LAST /* never use */
-} CURLSHoption;
-
-CURL_EXTERN CURLSH *curl_share_init(void);
-CURL_EXTERN CURLSHcode curl_share_setopt(CURLSH *, CURLSHoption option, ...);
-CURL_EXTERN CURLSHcode curl_share_cleanup(CURLSH *);
-
-/****************************************************************************
- * Structures for querying information about the curl library at runtime.
- */
-
-typedef enum {
- CURLVERSION_FIRST,
- CURLVERSION_SECOND,
- CURLVERSION_THIRD,
- CURLVERSION_FOURTH,
- CURLVERSION_LAST /* never actually use this */
-} CURLversion;
-
-/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
- basically all programs ever that want to get version information. It is
- meant to be a built-in version number for what kind of struct the caller
- expects. If the struct ever changes, we redefine the NOW to another enum
- from above. */
-#define CURLVERSION_NOW CURLVERSION_FOURTH
-
-typedef struct {
- CURLversion age; /* age of the returned struct */
- const char *version; /* LIBCURL_VERSION */
- unsigned int version_num; /* LIBCURL_VERSION_NUM */
- const char *host; /* OS/host/cpu/machine when configured */
- int features; /* bitmask, see defines below */
- const char *ssl_version; /* human readable string */
- long ssl_version_num; /* not used anymore, always 0 */
- const char *libz_version; /* human readable string */
- /* protocols is terminated by an entry with a NULL protoname */
- const char * const *protocols;
-
- /* The fields below this were added in CURLVERSION_SECOND */
- const char *ares;
- int ares_num;
-
- /* This field was added in CURLVERSION_THIRD */
- const char *libidn;
-
- /* These field were added in CURLVERSION_FOURTH */
-
- /* Same as '_libiconv_version' if built with HAVE_ICONV */
- int iconv_ver_num;
-
- const char *libssh_version; /* human readable string */
-
-} curl_version_info_data;
-
-#define CURL_VERSION_IPV6 (1<<0) /* IPv6-enabled */
-#define CURL_VERSION_KERBEROS4 (1<<1) /* kerberos auth is supported */
-#define CURL_VERSION_SSL (1<<2) /* SSL options are present */
-#define CURL_VERSION_LIBZ (1<<3) /* libz features are present */
-#define CURL_VERSION_NTLM (1<<4) /* NTLM auth is supported */
-#define CURL_VERSION_GSSNEGOTIATE (1<<5) /* Negotiate auth support */
-#define CURL_VERSION_DEBUG (1<<6) /* built with debug capabilities */
-#define CURL_VERSION_ASYNCHDNS (1<<7) /* asynchronous dns resolves */
-#define CURL_VERSION_SPNEGO (1<<8) /* SPNEGO auth */
-#define CURL_VERSION_LARGEFILE (1<<9) /* supports files bigger than 2GB */
-#define CURL_VERSION_IDN (1<<10) /* International Domain Names support */
-#define CURL_VERSION_SSPI (1<<11) /* SSPI is supported */
-#define CURL_VERSION_CONV (1<<12) /* character conversions supported */
-#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
-
-/*
- * NAME curl_version_info()
- *
- * DESCRIPTION
- *
- * This function returns a pointer to a static copy of the version info
- * struct. See above.
- */
-CURL_EXTERN curl_version_info_data *curl_version_info(CURLversion);
-
-/*
- * NAME curl_easy_strerror()
- *
- * DESCRIPTION
- *
- * The curl_easy_strerror function may be used to turn a CURLcode value
- * into the equivalent human readable error string. This is useful
- * for printing meaningful error messages.
- */
-CURL_EXTERN const char *curl_easy_strerror(CURLcode);
-
-/*
- * NAME curl_share_strerror()
- *
- * DESCRIPTION
- *
- * The curl_share_strerror function may be used to turn a CURLSHcode value
- * into the equivalent human readable error string. This is useful
- * for printing meaningful error messages.
- */
-CURL_EXTERN const char *curl_share_strerror(CURLSHcode);
-
-/*
- * NAME curl_easy_pause()
- *
- * DESCRIPTION
- *
- * The curl_easy_pause function pauses or unpauses transfers. Select the new
- * state by setting the bitmask, use the convenience defines below.
- *
- */
-CURL_EXTERN CURLcode curl_easy_pause(CURL *handle, int bitmask);
-
-#define CURLPAUSE_RECV (1<<0)
-#define CURLPAUSE_RECV_CONT (0)
-
-#define CURLPAUSE_SEND (1<<2)
-#define CURLPAUSE_SEND_CONT (0)
-
-#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
-#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
-
-#ifdef __cplusplus
-}
-#endif
-
-/* unfortunately, the easy.h and multi.h include files need options and info
- stuff before they can be included! */
-#include "easy.h" /* nothing in curl is fun without the easy stuff */
-#include "multi.h"
-
-/* the typechecker doesn't work in C++ (yet) */
-#if defined(__GNUC__) && defined(__GNUC_MINOR__) && \
- ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) && \
- !defined(__cplusplus) && !defined(CURL_DISABLE_TYPECHECK)
-#include "typecheck-gcc.h"
-#else
-#if defined(__STDC__) && (__STDC__ >= 1)
-/* This preprocessor magic that replaces a call with the exact same call is
- only done to make sure application authors pass exactly three arguments
- to these functions. */
-#define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
-#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
-#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
-#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
-#endif /* __STDC__ >= 1 */
-#endif /* gcc >= 4.3 && !__cplusplus */
-
-#endif /* __CURL_CURL_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlbuild.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlbuild.h
deleted file mode 100644
index b0a53e6c98..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlbuild.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */
-#ifndef __CURL_CURLBUILD_H
-#define __CURL_CURLBUILD_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: curlbuild.h.in,v 1.8 2009-04-29 15:15:38 yangtse Exp $
- ***************************************************************************/
-
-/* ================================================================ */
-/* NOTES FOR CONFIGURE CAPABLE SYSTEMS */
-/* ================================================================ */
-
-/*
- * NOTE 1:
- * -------
- *
- * Nothing in this file is intended to be modified or adjusted by the
- * curl library user nor by the curl library builder.
- *
- * If you think that something actually needs to be changed, adjusted
- * or fixed in this file, then, report it on the libcurl development
- * mailing list: http://cool.haxx.se/mailman/listinfo/curl-library/
- *
- * This header file shall only export symbols which are 'curl' or 'CURL'
- * prefixed, otherwise public name space would be polluted.
- *
- * NOTE 2:
- * -------
- *
- * Right now you might be staring at file include/curl/curlbuild.h.in or
- * at file include/curl/curlbuild.h, this is due to the following reason:
- *
- * On systems capable of running the configure script, the configure process
- * will overwrite the distributed include/curl/curlbuild.h file with one that
- * is suitable and specific to the library being configured and built, which
- * is generated from the include/curl/curlbuild.h.in template file.
- *
- */
-
-/* ================================================================ */
-/* DEFINITION OF THESE SYMBOLS SHALL NOT TAKE PLACE ANYWHERE ELSE */
-/* ================================================================ */
-
-#ifdef CURL_SIZEOF_LONG
-# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
-#endif
-
-#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
-# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
-#endif
-
-#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
-# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
-#endif
-
-#ifdef CURL_TYPEOF_CURL_OFF_T
-# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
-#endif
-
-#ifdef CURL_FORMAT_CURL_OFF_T
-# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
-#endif
-
-#ifdef CURL_FORMAT_CURL_OFF_TU
-# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
-#endif
-
-#ifdef CURL_FORMAT_OFF_T
-# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
-#endif
-
-#ifdef CURL_SIZEOF_CURL_OFF_T
-# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
-#endif
-
-#ifdef CURL_SUFFIX_CURL_OFF_T
-# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
-#endif
-
-#ifdef CURL_SUFFIX_CURL_OFF_TU
-# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
-#endif
-
-/* ================================================================ */
-/* EXTERNAL INTERFACE SETTINGS FOR CONFIGURE CAPABLE SYSTEMS ONLY */
-/* ================================================================ */
-
-/* Configure process defines this to 1 when it finds out that system */
-/* header file ws2tcpip.h must be included by the external interface. */
-/* #undef CURL_PULL_WS2TCPIP_H */
-#ifdef CURL_PULL_WS2TCPIP_H
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-# endif
-# include <windows.h>
-# include <winsock2.h>
-# include <ws2tcpip.h>
-#endif
-
-/* Configure process defines this to 1 when it finds out that system */
-/* header file sys/types.h must be included by the external interface. */
-#define CURL_PULL_SYS_TYPES_H 1
-#ifdef CURL_PULL_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-/* Configure process defines this to 1 when it finds out that system */
-/* header file stdint.h must be included by the external interface. */
-/* #undef CURL_PULL_STDINT_H */
-#ifdef CURL_PULL_STDINT_H
-# include <stdint.h>
-#endif
-
-/* Configure process defines this to 1 when it finds out that system */
-/* header file inttypes.h must be included by the external interface. */
-/* #undef CURL_PULL_INTTYPES_H */
-#ifdef CURL_PULL_INTTYPES_H
-# include <inttypes.h>
-#endif
-
-/* Configure process defines this to 1 when it finds out that system */
-/* header file sys/socket.h must be included by the external interface. */
-#define CURL_PULL_SYS_SOCKET_H 1
-#ifdef CURL_PULL_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
-/* The size of `long', as computed by sizeof. */
-#if defined(_M_X64) || (defined(__x86_64__) && !defined(__ILP32__)) || \
- defined(__aarch64__) || (defined(__mips__) && _MIPS_SIM == _ABI64)
-#define CURL_SIZEOF_LONG 8
-#else
-#define CURL_SIZEOF_LONG 4
-#endif
-
-/* Integral data type used for curl_socklen_t. */
-#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
-
-/* The size of `curl_socklen_t', as computed by sizeof. */
-#define CURL_SIZEOF_CURL_SOCKLEN_T 4
-
-/* Data type definition of curl_socklen_t. */
-typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
-
-/* Signed integral data type used for curl_off_t. */
-#if defined(_M_X64) || (defined(__x86_64__) && !defined(__ILP32__)) || \
- defined(__aarch64__)
-#define CURL_TYPEOF_CURL_OFF_T long
-#else
-#define CURL_TYPEOF_CURL_OFF_T int64_t
-#endif
-
-/* Data type definition of curl_off_t. */
-typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
-
-/* curl_off_t formatting string directive without "%" conversion specifier. */
-#define CURL_FORMAT_CURL_OFF_T "ld"
-
-/* unsigned curl_off_t formatting string without "%" conversion specifier. */
-#define CURL_FORMAT_CURL_OFF_TU "lu"
-
-/* curl_off_t formatting string directive with "%" conversion specifier. */
-#define CURL_FORMAT_OFF_T "%ld"
-
-/* The size of `curl_off_t', as computed by sizeof. */
-#define CURL_SIZEOF_CURL_OFF_T 8
-
-/* curl_off_t constant suffix. */
-#define CURL_SUFFIX_CURL_OFF_T L
-
-/* unsigned curl_off_t constant suffix. */
-#define CURL_SUFFIX_CURL_OFF_TU UL
-
-#endif /* __CURL_CURLBUILD_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlrules.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlrules.h
deleted file mode 100644
index abac4397d2..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlrules.h
+++ /dev/null
@@ -1,249 +0,0 @@
-#ifndef __CURL_CURLRULES_H
-#define __CURL_CURLRULES_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: curlrules.h,v 1.7 2009-10-27 16:56:20 yangtse Exp $
- ***************************************************************************/
-
-/* ================================================================ */
-/* COMPILE TIME SANITY CHECKS */
-/* ================================================================ */
-
-/*
- * NOTE 1:
- * -------
- *
- * All checks done in this file are intentionally placed in a public
- * header file which is pulled by curl/curl.h when an application is
- * being built using an already built libcurl library. Additionally
- * this file is also included and used when building the library.
- *
- * If compilation fails on this file it is certainly sure that the
- * problem is elsewhere. It could be a problem in the curlbuild.h
- * header file, or simply that you are using different compilation
- * settings than those used to build the library.
- *
- * Nothing in this file is intended to be modified or adjusted by the
- * curl library user nor by the curl library builder.
- *
- * Do not deactivate any check, these are done to make sure that the
- * library is properly built and used.
- *
- * You can find further help on the libcurl development mailing list:
- * http://cool.haxx.se/mailman/listinfo/curl-library/
- *
- * NOTE 2
- * ------
- *
- * Some of the following compile time checks are based on the fact
- * that the dimension of a constant array can not be a negative one.
- * In this way if the compile time verification fails, the compilation
- * will fail issuing an error. The error description wording is compiler
- * dependent but it will be quite similar to one of the following:
- *
- * "negative subscript or subscript is too large"
- * "array must have at least one element"
- * "-1 is an illegal array size"
- * "size of array is negative"
- *
- * If you are building an application which tries to use an already
- * built libcurl library and you are getting this kind of errors on
- * this file, it is a clear indication that there is a mismatch between
- * how the library was built and how you are trying to use it for your
- * application. Your already compiled or binary library provider is the
- * only one who can give you the details you need to properly use it.
- */
-
-/*
- * Verify that some macros are actually defined.
- */
-
-#ifndef CURL_SIZEOF_LONG
-# error "CURL_SIZEOF_LONG definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
-#endif
-
-#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
-# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
-#endif
-
-#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
-# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
-#endif
-
-#ifndef CURL_TYPEOF_CURL_OFF_T
-# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
-#endif
-
-#ifndef CURL_FORMAT_CURL_OFF_T
-# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
-#endif
-
-#ifndef CURL_FORMAT_CURL_OFF_TU
-# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
-#endif
-
-#ifndef CURL_FORMAT_OFF_T
-# error "CURL_FORMAT_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
-#endif
-
-#ifndef CURL_SIZEOF_CURL_OFF_T
-# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
-#endif
-
-#ifndef CURL_SUFFIX_CURL_OFF_T
-# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
-#endif
-
-#ifndef CURL_SUFFIX_CURL_OFF_TU
-# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
- Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
-#endif
-
-/*
- * Macros private to this header file.
- */
-
-#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
-
-#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
-
-/*
- * Verify that the size previously defined and expected for long
- * is the same as the one reported by sizeof() at compile time.
- */
-
-typedef char
- __curl_rule_01__
- [CurlchkszEQ(long, CURL_SIZEOF_LONG)];
-
-/*
- * Verify that the size previously defined and expected for
- * curl_off_t is actually the the same as the one reported
- * by sizeof() at compile time.
- */
-
-typedef char
- __curl_rule_02__
- [CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
-
-/*
- * Verify at compile time that the size of curl_off_t as reported
- * by sizeof() is greater or equal than the one reported for long
- * for the current compilation.
- */
-
-typedef char
- __curl_rule_03__
- [CurlchkszGE(curl_off_t, long)];
-
-/*
- * Verify that the size previously defined and expected for
- * curl_socklen_t is actually the the same as the one reported
- * by sizeof() at compile time.
- */
-
-typedef char
- __curl_rule_04__
- [CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
-
-/*
- * Verify at compile time that the size of curl_socklen_t as reported
- * by sizeof() is greater or equal than the one reported for int for
- * the current compilation.
- */
-
-typedef char
- __curl_rule_05__
- [CurlchkszGE(curl_socklen_t, int)];
-
-/* ================================================================ */
-/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
-/* ================================================================ */
-
-/*
- * CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
- * these to be visible and exported by the external libcurl interface API,
- * while also making them visible to the library internals, simply including
- * setup.h, without actually needing to include curl.h internally.
- * If some day this section would grow big enough, all this should be moved
- * to its own header file.
- */
-
-/*
- * Figure out if we can use the ## preprocessor operator, which is supported
- * by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
- * or __cplusplus so we need to carefully check for them too.
- */
-
-#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
- defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
- defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
- defined(__ILEC400__)
- /* This compiler is believed to have an ISO compatible preprocessor */
-#define CURL_ISOCPP
-#else
- /* This compiler is believed NOT to have an ISO compatible preprocessor */
-#undef CURL_ISOCPP
-#endif
-
-/*
- * Macros for minimum-width signed and unsigned curl_off_t integer constants.
- */
-
-#ifdef CURL_ISOCPP
-# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val ## Suffix
-#else
-# define __CURL_OFF_T_C_HELPER2(Val,Suffix) Val/**/Suffix
-#endif
-#define __CURL_OFF_T_C_HELPER1(Val,Suffix) __CURL_OFF_T_C_HELPER2(Val,Suffix)
-#define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_T)
-#define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HELPER1(Val,CURL_SUFFIX_CURL_OFF_TU)
-
-/*
- * Get rid of macros private to this header file.
- */
-
-#undef CurlchkszEQ
-#undef CurlchkszGE
-
-/*
- * Get rid of macros not intended to exist beyond this point.
- */
-
-#undef CURL_PULL_WS2TCPIP_H
-#undef CURL_PULL_SYS_TYPES_H
-#undef CURL_PULL_SYS_SOCKET_H
-#undef CURL_PULL_STDINT_H
-#undef CURL_PULL_INTTYPES_H
-
-#undef CURL_TYPEOF_CURL_SOCKLEN_T
-#undef CURL_TYPEOF_CURL_OFF_T
-
-#endif /* __CURL_CURLRULES_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlver.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlver.h
deleted file mode 100644
index afa85c15ad..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/curlver.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef __CURL_CURLVER_H
-#define __CURL_CURLVER_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: curlver.h,v 1.48 2009-08-12 11:24:52 bagder Exp $
- ***************************************************************************/
-
-/* This header file contains nothing but libcurl version info, generated by
- a script at release-time. This was made its own header file in 7.11.2 */
-
-/* This is the global package copyright */
-#define LIBCURL_COPYRIGHT "1996 - 2009 Daniel Stenberg, <daniel@haxx.se>."
-
-/* This is the version number of the libcurl package from which this header
- file origins: */
-#define LIBCURL_VERSION "7.19.7"
-
-/* The numeric version number is also available "in parts" by using these
- defines: */
-#define LIBCURL_VERSION_MAJOR 7
-#define LIBCURL_VERSION_MINOR 19
-#define LIBCURL_VERSION_PATCH 7
-
-/* This is the numeric version of the libcurl version number, meant for easier
- parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
- always follow this syntax:
-
- 0xXXYYZZ
-
- Where XX, YY and ZZ are the main version, release and patch numbers in
- hexadecimal (using 8 bits each). All three numbers are always represented
- using two digits. 1.2 would appear as "0x010200" while version 9.11.7
- appears as "0x090b07".
-
- This 6-digit (24 bits) hexadecimal number does not show pre-release number,
- and it is always a greater number in a more recent release. It makes
- comparisons with greater than and less than work.
-*/
-#define LIBCURL_VERSION_NUM 0x071307
-
-/*
- * This is the date and time when the full source package was created. The
- * timestamp is not stored in CVS, as the timestamp is properly set in the
- * tarballs by the maketgz script.
- *
- * The format of the date should follow this template:
- *
- * "Mon Feb 12 11:35:33 UTC 2007"
- */
-#define LIBCURL_TIMESTAMP "Wed Nov 4 12:34:59 UTC 2009"
-
-#endif /* __CURL_CURLVER_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/easy.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/easy.h
deleted file mode 100644
index 40449c3ec8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/easy.h
+++ /dev/null
@@ -1,103 +0,0 @@
-#ifndef __CURL_EASY_H
-#define __CURL_EASY_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: easy.h,v 1.14 2008-05-12 21:43:28 bagder Exp $
- ***************************************************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-CURL_EXTERN CURL *curl_easy_init(void);
-CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
-CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
-CURL_EXTERN void curl_easy_cleanup(CURL *curl);
-
-/*
- * NAME curl_easy_getinfo()
- *
- * DESCRIPTION
- *
- * Request internal information from the curl session with this function. The
- * third argument MUST be a pointer to a long, a pointer to a char * or a
- * pointer to a double (as the documentation describes elsewhere). The data
- * pointed to will be filled in accordingly and can be relied upon only if the
- * function returns CURLE_OK. This function is intended to get used *AFTER* a
- * performed transfer, all results from this function are undefined until the
- * transfer is completed.
- */
-CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
-
-
-/*
- * NAME curl_easy_duphandle()
- *
- * DESCRIPTION
- *
- * Creates a new curl session handle with the same options set for the handle
- * passed in. Duplicating a handle could only be a matter of cloning data and
- * options, internal state info and things like persistant connections cannot
- * be transfered. It is useful in multithreaded applications when you can run
- * curl_easy_duphandle() for each new thread to avoid a series of identical
- * curl_easy_setopt() invokes in every thread.
- */
-CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
-
-/*
- * NAME curl_easy_reset()
- *
- * DESCRIPTION
- *
- * Re-initializes a CURL handle to the default values. This puts back the
- * handle to the same state as it was in when it was just created.
- *
- * It does keep: live connections, the Session ID cache, the DNS cache and the
- * cookies.
- */
-CURL_EXTERN void curl_easy_reset(CURL *curl);
-
-/*
- * NAME curl_easy_recv()
- *
- * DESCRIPTION
- *
- * Receives data from the connected socket. Use after successful
- * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
- */
-CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
- size_t *n);
-
-/*
- * NAME curl_easy_send()
- *
- * DESCRIPTION
- *
- * Sends data over the connected socket. Use after successful
- * curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
- */
-CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
- size_t buflen, size_t *n);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/mprintf.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/mprintf.h
deleted file mode 100644
index d7202de170..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/mprintf.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef __CURL_MPRINTF_H
-#define __CURL_MPRINTF_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: mprintf.h,v 1.16 2008-05-20 10:21:50 patrickm Exp $
- ***************************************************************************/
-
-#include <stdarg.h>
-#include <stdio.h> /* needed for FILE */
-
-#include "curl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-CURL_EXTERN int curl_mprintf(const char *format, ...);
-CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
-CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
-CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
- const char *format, ...);
-CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
-CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
-CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
-CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
- const char *format, va_list args);
-CURL_EXTERN char *curl_maprintf(const char *format, ...);
-CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
-
-#ifdef _MPRINTF_REPLACE
-# undef printf
-# undef fprintf
-# undef sprintf
-# undef vsprintf
-# undef snprintf
-# undef vprintf
-# undef vfprintf
-# undef vsnprintf
-# undef aprintf
-# undef vaprintf
-# define printf curl_mprintf
-# define fprintf curl_mfprintf
-#ifdef CURLDEBUG
-/* When built with CURLDEBUG we define away the sprintf() functions since we
- don't want internal code to be using them */
-# define sprintf sprintf_was_used
-# define vsprintf vsprintf_was_used
-#else
-# define sprintf curl_msprintf
-# define vsprintf curl_mvsprintf
-#endif
-# define snprintf curl_msnprintf
-# define vprintf curl_mvprintf
-# define vfprintf curl_mvfprintf
-# define vsnprintf curl_mvsnprintf
-# define aprintf curl_maprintf
-# define vaprintf curl_mvaprintf
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CURL_MPRINTF_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/multi.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/multi.h
deleted file mode 100644
index 153f7721c9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/multi.h
+++ /dev/null
@@ -1,346 +0,0 @@
-#ifndef __CURL_MULTI_H
-#define __CURL_MULTI_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: multi.h,v 1.45 2008-05-20 10:21:50 patrickm Exp $
- ***************************************************************************/
-/*
- This is an "external" header file. Don't give away any internals here!
-
- GOALS
-
- o Enable a "pull" interface. The application that uses libcurl decides where
- and when to ask libcurl to get/send data.
-
- o Enable multiple simultaneous transfers in the same thread without making it
- complicated for the application.
-
- o Enable the application to select() on its own file descriptors and curl's
- file descriptors simultaneous easily.
-
-*/
-
-/*
- * This header file should not really need to include "curl.h" since curl.h
- * itself includes this file and we expect user applications to do #include
- * <curl/curl.h> without the need for especially including multi.h.
- *
- * For some reason we added this include here at one point, and rather than to
- * break existing (wrongly written) libcurl applications, we leave it as-is
- * but with this warning attached.
- */
-#include "curl.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void CURLM;
-
-typedef enum {
- CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
- curl_multi_socket*() soon */
- CURLM_OK,
- CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
- CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
- CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
- CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
- CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
- CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
- CURLM_LAST
-} CURLMcode;
-
-/* just to make code nicer when using curl_multi_socket() you can now check
- for CURLM_CALL_MULTI_SOCKET too in the same style it works for
- curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
-#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
-
-typedef enum {
- CURLMSG_NONE, /* first, not used */
- CURLMSG_DONE, /* This easy handle has completed. 'result' contains
- the CURLcode of the transfer */
- CURLMSG_LAST /* last, not used */
-} CURLMSG;
-
-struct CURLMsg {
- CURLMSG msg; /* what this message means */
- CURL *easy_handle; /* the handle it concerns */
- union {
- void *whatever; /* message-specific data */
- CURLcode result; /* return code for transfer */
- } data;
-};
-typedef struct CURLMsg CURLMsg;
-
-/*
- * Name: curl_multi_init()
- *
- * Desc: inititalize multi-style curl usage
- *
- * Returns: a new CURLM handle to use in all 'curl_multi' functions.
- */
-CURL_EXTERN CURLM *curl_multi_init(void);
-
-/*
- * Name: curl_multi_add_handle()
- *
- * Desc: add a standard curl handle to the multi stack
- *
- * Returns: CURLMcode type, general multi error code.
- */
-CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_remove_handle()
- *
- * Desc: removes a curl handle from the multi stack again
- *
- * Returns: CURLMcode type, general multi error code.
- */
-CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
- CURL *curl_handle);
-
- /*
- * Name: curl_multi_fdset()
- *
- * Desc: Ask curl for its fd_set sets. The app can use these to select() or
- * poll() on. We want curl_multi_perform() called as soon as one of
- * them are ready.
- *
- * Returns: CURLMcode type, general multi error code.
- */
-CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
- fd_set *read_fd_set,
- fd_set *write_fd_set,
- fd_set *exc_fd_set,
- int *max_fd);
-
- /*
- * Name: curl_multi_perform()
- *
- * Desc: When the app thinks there's data available for curl it calls this
- * function to read/write whatever there is right now. This returns
- * as soon as the reads and writes are done. This function does not
- * require that there actually is data available for reading or that
- * data can be written, it can be called just in case. It returns
- * the number of handles that still transfer data in the second
- * argument's integer-pointer.
- *
- * Returns: CURLMcode type, general multi error code. *NOTE* that this only
- * returns errors etc regarding the whole multi stack. There might
- * still have occurred problems on invidual transfers even when this
- * returns OK.
- */
-CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
- int *running_handles);
-
- /*
- * Name: curl_multi_cleanup()
- *
- * Desc: Cleans up and removes a whole multi stack. It does not free or
- * touch any individual easy handles in any way. We need to define
- * in what state those handles will be if this function is called
- * in the middle of a transfer.
- *
- * Returns: CURLMcode type, general multi error code.
- */
-CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
-
-/*
- * Name: curl_multi_info_read()
- *
- * Desc: Ask the multi handle if there's any messages/informationals from
- * the individual transfers. Messages include informationals such as
- * error code from the transfer or just the fact that a transfer is
- * completed. More details on these should be written down as well.
- *
- * Repeated calls to this function will return a new struct each
- * time, until a special "end of msgs" struct is returned as a signal
- * that there is no more to get at this point.
- *
- * The data the returned pointer points to will not survive calling
- * curl_multi_cleanup().
- *
- * The 'CURLMsg' struct is meant to be very simple and only contain
- * very basic informations. If more involved information is wanted,
- * we will provide the particular "transfer handle" in that struct
- * and that should/could/would be used in subsequent
- * curl_easy_getinfo() calls (or similar). The point being that we
- * must never expose complex structs to applications, as then we'll
- * undoubtably get backwards compatibility problems in the future.
- *
- * Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
- * of structs. It also writes the number of messages left in the
- * queue (after this read) in the integer the second argument points
- * to.
- */
-CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
- int *msgs_in_queue);
-
-/*
- * Name: curl_multi_strerror()
- *
- * Desc: The curl_multi_strerror function may be used to turn a CURLMcode
- * value into the equivalent human readable error string. This is
- * useful for printing meaningful error messages.
- *
- * Returns: A pointer to a zero-terminated error message.
- */
-CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
-
-/*
- * Name: curl_multi_socket() and
- * curl_multi_socket_all()
- *
- * Desc: An alternative version of curl_multi_perform() that allows the
- * application to pass in one of the file descriptors that have been
- * detected to have "action" on them and let libcurl perform.
- * See man page for details.
- */
-#define CURL_POLL_NONE 0
-#define CURL_POLL_IN 1
-#define CURL_POLL_OUT 2
-#define CURL_POLL_INOUT 3
-#define CURL_POLL_REMOVE 4
-
-#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
-
-#define CURL_CSELECT_IN 0x01
-#define CURL_CSELECT_OUT 0x02
-#define CURL_CSELECT_ERR 0x04
-
-typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
- curl_socket_t s, /* socket */
- int what, /* see above */
- void *userp, /* private callback
- pointer */
- void *socketp); /* private socket
- pointer */
-/*
- * Name: curl_multi_timer_callback
- *
- * Desc: Called by libcurl whenever the library detects a change in the
- * maximum number of milliseconds the app is allowed to wait before
- * curl_multi_socket() or curl_multi_perform() must be called
- * (to allow libcurl's timed events to take place).
- *
- * Returns: The callback should return zero.
- */
-typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
- long timeout_ms, /* see above */
- void *userp); /* private callback
- pointer */
-
-CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
- int *running_handles);
-
-CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
- curl_socket_t s,
- int ev_bitmask,
- int *running_handles);
-
-CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
- int *running_handles);
-
-#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
-/* This macro below was added in 7.16.3 to push users who recompile to use
- the new curl_multi_socket_action() instead of the old curl_multi_socket()
-*/
-#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
-#endif
-
-/*
- * Name: curl_multi_timeout()
- *
- * Desc: Returns the maximum number of milliseconds the app is allowed to
- * wait before curl_multi_socket() or curl_multi_perform() must be
- * called (to allow libcurl's timed events to take place).
- *
- * Returns: CURLM error code.
- */
-CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
- long *milliseconds);
-
-#undef CINIT /* re-using the same name as in curl.h */
-
-#ifdef CURL_ISOCPP
-#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
-#else
-/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
-#define LONG CURLOPTTYPE_LONG
-#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
-#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
-#define OFF_T CURLOPTTYPE_OFF_T
-#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
-#endif
-
-typedef enum {
- /* This is the socket callback function pointer */
- CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
-
- /* This is the argument passed to the socket callback */
- CINIT(SOCKETDATA, OBJECTPOINT, 2),
-
- /* set to 1 to enable pipelining for this multi handle */
- CINIT(PIPELINING, LONG, 3),
-
- /* This is the timer callback function pointer */
- CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
-
- /* This is the argument passed to the timer callback */
- CINIT(TIMERDATA, OBJECTPOINT, 5),
-
- /* maximum number of entries in the connection cache */
- CINIT(MAXCONNECTS, LONG, 6),
-
- CURLMOPT_LASTENTRY /* the last unused */
-} CURLMoption;
-
-
-/*
- * Name: curl_multi_setopt()
- *
- * Desc: Sets options for the multi handle.
- *
- * Returns: CURLM error code.
- */
-CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
- CURLMoption option, ...);
-
-
-/*
- * Name: curl_multi_assign()
- *
- * Desc: This function sets an association in the multi handle between the
- * given socket and a private pointer of the application. This is
- * (only) useful for curl_multi_socket uses.
- *
- * Returns: CURLM error code.
- */
-CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
- curl_socket_t sockfd, void *sockp);
-
-#ifdef __cplusplus
-} /* end of extern "C" */
-#endif
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/stdcheaders.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/stdcheaders.h
deleted file mode 100644
index f739d7f9aa..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/stdcheaders.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef __STDC_HEADERS_H
-#define __STDC_HEADERS_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: stdcheaders.h,v 1.9 2009-05-18 12:25:45 yangtse Exp $
- ***************************************************************************/
-
-#include <sys/types.h>
-
-size_t fread (void *, size_t, size_t, FILE *);
-size_t fwrite (const void *, size_t, size_t, FILE *);
-
-int strcasecmp(const char *, const char *);
-int strncasecmp(const char *, const char *, size_t);
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/typecheck-gcc.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/typecheck-gcc.h
deleted file mode 100644
index 9788305819..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/typecheck-gcc.h
+++ /dev/null
@@ -1,551 +0,0 @@
-#ifndef __CURL_TYPECHECK_GCC_H
-#define __CURL_TYPECHECK_GCC_H
-/***************************************************************************
- * _ _ ____ _
- * Project ___| | | | _ \| |
- * / __| | | | |_) | |
- * | (__| |_| | _ <| |___
- * \___|\___/|_| \_\_____|
- *
- * Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
- *
- * This software is licensed as described in the file COPYING, which
- * you should have received as part of this distribution. The terms
- * are also available at http://curl.haxx.se/docs/copyright.html.
- *
- * You may opt to use, copy, modify, merge, publish, distribute and/or sell
- * copies of the Software, and permit persons to whom the Software is
- * furnished to do so, under the terms of the COPYING file.
- *
- * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- * KIND, either express or implied.
- *
- * $Id: typecheck-gcc.h,v 1.9 2009-01-25 23:26:31 bagder Exp $
- ***************************************************************************/
-
-/* wraps curl_easy_setopt() with typechecking */
-
-/* To add a new kind of warning, add an
- * if(_curl_is_sometype_option(_curl_opt) && ! _curl_is_sometype(value))
- * _curl_easy_setopt_err_sometype();
- * block and define _curl_is_sometype_option, _curl_is_sometype and
- * _curl_easy_setopt_err_sometype below
- *
- * To add an option that uses the same type as an existing option, you'll just
- * need to extend the appropriate _curl_*_option macro
- */
-#define curl_easy_setopt(handle, option, value) \
-__extension__ ({ \
- __typeof__ (option) _curl_opt = option; \
- if (__builtin_constant_p(_curl_opt)) { \
- if (_curl_is_long_option(_curl_opt) && !_curl_is_long(value)) \
- _curl_easy_setopt_err_long(); \
- if (_curl_is_off_t_option(_curl_opt) && !_curl_is_off_t(value)) \
- _curl_easy_setopt_err_curl_off_t(); \
- if (_curl_is_string_option(_curl_opt) && !_curl_is_string(value)) \
- _curl_easy_setopt_err_string(); \
- if (_curl_is_write_cb_option(_curl_opt) && !_curl_is_write_cb(value)) \
- _curl_easy_setopt_err_write_callback(); \
- if ((_curl_opt) == CURLOPT_READFUNCTION && !_curl_is_read_cb(value)) \
- _curl_easy_setopt_err_read_cb(); \
- if ((_curl_opt) == CURLOPT_IOCTLFUNCTION && !_curl_is_ioctl_cb(value)) \
- _curl_easy_setopt_err_ioctl_cb(); \
- if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION && !_curl_is_sockopt_cb(value))\
- _curl_easy_setopt_err_sockopt_cb(); \
- if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION && \
- !_curl_is_opensocket_cb(value)) \
- _curl_easy_setopt_err_opensocket_cb(); \
- if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION && \
- !_curl_is_progress_cb(value)) \
- _curl_easy_setopt_err_progress_cb(); \
- if ((_curl_opt) == CURLOPT_DEBUGFUNCTION && !_curl_is_debug_cb(value)) \
- _curl_easy_setopt_err_debug_cb(); \
- if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION && \
- !_curl_is_ssl_ctx_cb(value)) \
- _curl_easy_setopt_err_ssl_ctx_cb(); \
- if (_curl_is_conv_cb_option(_curl_opt) && !_curl_is_conv_cb(value)) \
- _curl_easy_setopt_err_conv_cb(); \
- if ((_curl_opt) == CURLOPT_SEEKFUNCTION && !_curl_is_seek_cb(value)) \
- _curl_easy_setopt_err_seek_cb(); \
- if (_curl_is_cb_data_option(_curl_opt) && !_curl_is_cb_data(value)) \
- _curl_easy_setopt_err_cb_data(); \
- if ((_curl_opt) == CURLOPT_ERRORBUFFER && !_curl_is_error_buffer(value)) \
- _curl_easy_setopt_err_error_buffer(); \
- if ((_curl_opt) == CURLOPT_STDERR && !_curl_is_FILE(value)) \
- _curl_easy_setopt_err_FILE(); \
- if (_curl_is_postfields_option(_curl_opt) && !_curl_is_postfields(value)) \
- _curl_easy_setopt_err_postfields(); \
- if ((_curl_opt) == CURLOPT_HTTPPOST && \
- !_curl_is_arr((value), struct curl_httppost)) \
- _curl_easy_setopt_err_curl_httpost(); \
- if (_curl_is_slist_option(_curl_opt) && \
- !_curl_is_arr((value), struct curl_slist)) \
- _curl_easy_setopt_err_curl_slist(); \
- if ((_curl_opt) == CURLOPT_SHARE && !_curl_is_ptr((value), CURLSH)) \
- _curl_easy_setopt_err_CURLSH(); \
- } \
- curl_easy_setopt(handle, _curl_opt, value); \
-})
-
-/* wraps curl_easy_getinfo() with typechecking */
-/* FIXME: don't allow const pointers */
-#define curl_easy_getinfo(handle, info, arg) \
-__extension__ ({ \
- __typeof__ (info) _curl_info = info; \
- if (__builtin_constant_p(_curl_info)) { \
- if (_curl_is_string_info(_curl_info) && !_curl_is_arr((arg), char *)) \
- _curl_easy_getinfo_err_string(); \
- if (_curl_is_long_info(_curl_info) && !_curl_is_arr((arg), long)) \
- _curl_easy_getinfo_err_long(); \
- if (_curl_is_double_info(_curl_info) && !_curl_is_arr((arg), double)) \
- _curl_easy_getinfo_err_double(); \
- if (_curl_is_slist_info(_curl_info) && \
- !_curl_is_arr((arg), struct curl_slist *)) \
- _curl_easy_getinfo_err_curl_slist(); \
- } \
- curl_easy_getinfo(handle, _curl_info, arg); \
-})
-
-/* TODO: typechecking for curl_share_setopt() and curl_multi_setopt(),
- * for now just make sure that the functions are called with three
- * arguments
- */
-#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
-#define curl_multi_setopt(handle,opt,param) curl_multi_setopt(handle,opt,param)
-
-
-/* the actual warnings, triggered by calling the _curl_easy_setopt_err*
- * functions */
-
-/* To define a new warning, use _CURL_WARNING(identifier, "message") */
-#define _CURL_WARNING(id, message) \
- static void __attribute__((warning(message))) __attribute__((unused)) \
- __attribute__((noinline)) id(void) { __asm__(""); }
-
-_CURL_WARNING(_curl_easy_setopt_err_long,
- "curl_easy_setopt expects a long argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
- "curl_easy_setopt expects a curl_off_t argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_string,
- "curl_easy_setopt expects a string (char* or char[]) argument for this option"
- )
-_CURL_WARNING(_curl_easy_setopt_err_write_callback,
- "curl_easy_setopt expects a curl_write_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_read_cb,
- "curl_easy_setopt expects a curl_read_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
- "curl_easy_setopt expects a curl_ioctl_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
- "curl_easy_setopt expects a curl_sockopt_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
- "curl_easy_setopt expects a curl_opensocket_callback argument for this option"
- )
-_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
- "curl_easy_setopt expects a curl_progress_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_debug_cb,
- "curl_easy_setopt expects a curl_debug_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_ssl_ctx_cb,
- "curl_easy_setopt expects a curl_ssl_ctx_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_conv_cb,
- "curl_easy_setopt expects a curl_conv_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
- "curl_easy_setopt expects a curl_seek_callback argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_cb_data,
- "curl_easy_setopt expects a private data pointer as argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
- "curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_FILE,
- "curl_easy_setopt expects a FILE* argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_postfields,
- "curl_easy_setopt expects a void* or char* argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_httpost,
- "curl_easy_setopt expects a struct curl_httppost* argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_curl_slist,
- "curl_easy_setopt expects a struct curl_slist* argument for this option")
-_CURL_WARNING(_curl_easy_setopt_err_CURLSH,
- "curl_easy_setopt expects a CURLSH* argument for this option")
-
-_CURL_WARNING(_curl_easy_getinfo_err_string,
- "curl_easy_getinfo expects a pointer to char * for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_long,
- "curl_easy_getinfo expects a pointer to long for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_double,
- "curl_easy_getinfo expects a pointer to double for this info")
-_CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
- "curl_easy_getinfo expects a pointer to struct curl_slist * for this info")
-
-/* groups of curl_easy_setops options that take the same type of argument */
-
-/* To add a new option to one of the groups, just add
- * (option) == CURLOPT_SOMETHING
- * to the or-expression. If the option takes a long or curl_off_t, you don't
- * have to do anything
- */
-
-/* evaluates to true if option takes a long argument */
-#define _curl_is_long_option(option) \
- (0 < (option) && (option) < CURLOPTTYPE_OBJECTPOINT)
-
-#define _curl_is_off_t_option(option) \
- ((option) > CURLOPTTYPE_OFF_T)
-
-/* evaluates to true if option takes a char* argument */
-#define _curl_is_string_option(option) \
- ((option) == CURLOPT_URL || \
- (option) == CURLOPT_PROXY || \
- (option) == CURLOPT_INTERFACE || \
- (option) == CURLOPT_NETRC_FILE || \
- (option) == CURLOPT_USERPWD || \
- (option) == CURLOPT_USERNAME || \
- (option) == CURLOPT_PASSWORD || \
- (option) == CURLOPT_PROXYUSERPWD || \
- (option) == CURLOPT_PROXYUSERNAME || \
- (option) == CURLOPT_PROXYPASSWORD || \
- (option) == CURLOPT_NOPROXY || \
- (option) == CURLOPT_ENCODING || \
- (option) == CURLOPT_REFERER || \
- (option) == CURLOPT_USERAGENT || \
- (option) == CURLOPT_COOKIE || \
- (option) == CURLOPT_COOKIEFILE || \
- (option) == CURLOPT_COOKIEJAR || \
- (option) == CURLOPT_COOKIELIST || \
- (option) == CURLOPT_FTPPORT || \
- (option) == CURLOPT_FTP_ALTERNATIVE_TO_USER || \
- (option) == CURLOPT_FTP_ACCOUNT || \
- (option) == CURLOPT_RANGE || \
- (option) == CURLOPT_CUSTOMREQUEST || \
- (option) == CURLOPT_SSLCERT || \
- (option) == CURLOPT_SSLCERTTYPE || \
- (option) == CURLOPT_SSLKEY || \
- (option) == CURLOPT_SSLKEYTYPE || \
- (option) == CURLOPT_KEYPASSWD || \
- (option) == CURLOPT_SSLENGINE || \
- (option) == CURLOPT_CAINFO || \
- (option) == CURLOPT_CAPATH || \
- (option) == CURLOPT_RANDOM_FILE || \
- (option) == CURLOPT_EGDSOCKET || \
- (option) == CURLOPT_SSL_CIPHER_LIST || \
- (option) == CURLOPT_KRBLEVEL || \
- (option) == CURLOPT_SSH_HOST_PUBLIC_KEY_MD5 || \
- (option) == CURLOPT_SSH_PUBLIC_KEYFILE || \
- (option) == CURLOPT_SSH_PRIVATE_KEYFILE || \
- (option) == CURLOPT_CRLFILE || \
- (option) == CURLOPT_ISSUERCERT || \
- 0)
-
-/* evaluates to true if option takes a curl_write_callback argument */
-#define _curl_is_write_cb_option(option) \
- ((option) == CURLOPT_HEADERFUNCTION || \
- (option) == CURLOPT_WRITEFUNCTION)
-
-/* evaluates to true if option takes a curl_conv_callback argument */
-#define _curl_is_conv_cb_option(option) \
- ((option) == CURLOPT_CONV_TO_NETWORK_FUNCTION || \
- (option) == CURLOPT_CONV_FROM_NETWORK_FUNCTION || \
- (option) == CURLOPT_CONV_FROM_UTF8_FUNCTION)
-
-/* evaluates to true if option takes a data argument to pass to a callback */
-#define _curl_is_cb_data_option(option) \
- ((option) == CURLOPT_WRITEDATA || \
- (option) == CURLOPT_READDATA || \
- (option) == CURLOPT_IOCTLDATA || \
- (option) == CURLOPT_SOCKOPTDATA || \
- (option) == CURLOPT_OPENSOCKETDATA || \
- (option) == CURLOPT_PROGRESSDATA || \
- (option) == CURLOPT_WRITEHEADER || \
- (option) == CURLOPT_DEBUGDATA || \
- (option) == CURLOPT_SSL_CTX_DATA || \
- (option) == CURLOPT_SEEKDATA || \
- (option) == CURLOPT_PRIVATE || \
- 0)
-
-/* evaluates to true if option takes a POST data argument (void* or char*) */
-#define _curl_is_postfields_option(option) \
- ((option) == CURLOPT_POSTFIELDS || \
- (option) == CURLOPT_COPYPOSTFIELDS || \
- 0)
-
-/* evaluates to true if option takes a struct curl_slist * argument */
-#define _curl_is_slist_option(option) \
- ((option) == CURLOPT_HTTPHEADER || \
- (option) == CURLOPT_HTTP200ALIASES || \
- (option) == CURLOPT_QUOTE || \
- (option) == CURLOPT_POSTQUOTE || \
- (option) == CURLOPT_PREQUOTE || \
- (option) == CURLOPT_TELNETOPTIONS || \
- 0)
-
-/* groups of curl_easy_getinfo infos that take the same type of argument */
-
-/* evaluates to true if info expects a pointer to char * argument */
-#define _curl_is_string_info(info) \
- (CURLINFO_STRING < (info) && (info) < CURLINFO_LONG)
-
-/* evaluates to true if info expects a pointer to long argument */
-#define _curl_is_long_info(info) \
- (CURLINFO_LONG < (info) && (info) < CURLINFO_DOUBLE)
-
-/* evaluates to true if info expects a pointer to double argument */
-#define _curl_is_double_info(info) \
- (CURLINFO_DOUBLE < (info) && (info) < CURLINFO_SLIST)
-
-/* true if info expects a pointer to struct curl_slist * argument */
-#define _curl_is_slist_info(info) \
- (CURLINFO_SLIST < (info))
-
-
-/* typecheck helpers -- check whether given expression has requested type*/
-
-/* For pointers, you can use the _curl_is_ptr/_curl_is_arr macros,
- * otherwise define a new macro. Search for __builtin_types_compatible_p
- * in the GCC manual.
- * NOTE: these macros MUST NOT EVALUATE their arguments! The argument is
- * the actual expression passed to the curl_easy_setopt macro. This
- * means that you can only apply the sizeof and __typeof__ operators, no
- * == or whatsoever.
- */
-
-/* XXX: should evaluate to true iff expr is a pointer */
-#define _curl_is_any_ptr(expr) \
- (sizeof(expr) == sizeof(void*))
-
-/* evaluates to true if expr is NULL */
-/* XXX: must not evaluate expr, so this check is not accurate */
-#define _curl_is_NULL(expr) \
- (__builtin_types_compatible_p(__typeof__(expr), __typeof__(NULL)))
-
-/* evaluates to true if expr is type*, const type* or NULL */
-#define _curl_is_ptr(expr, type) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), type *) || \
- __builtin_types_compatible_p(__typeof__(expr), const type *))
-
-/* evaluates to true if expr is one of type[], type*, NULL or const type* */
-#define _curl_is_arr(expr, type) \
- (_curl_is_ptr((expr), type) || \
- __builtin_types_compatible_p(__typeof__(expr), type []))
-
-/* evaluates to true if expr is a string */
-#define _curl_is_string(expr) \
- (_curl_is_arr((expr), char) || \
- _curl_is_arr((expr), signed char) || \
- _curl_is_arr((expr), unsigned char))
-
-/* evaluates to true if expr is a long (no matter the signedness)
- * XXX: for now, int is also accepted (and therefore short and char, which
- * are promoted to int when passed to a variadic function) */
-#define _curl_is_long(expr) \
- (__builtin_types_compatible_p(__typeof__(expr), long) || \
- __builtin_types_compatible_p(__typeof__(expr), signed long) || \
- __builtin_types_compatible_p(__typeof__(expr), unsigned long) || \
- __builtin_types_compatible_p(__typeof__(expr), int) || \
- __builtin_types_compatible_p(__typeof__(expr), signed int) || \
- __builtin_types_compatible_p(__typeof__(expr), unsigned int) || \
- __builtin_types_compatible_p(__typeof__(expr), short) || \
- __builtin_types_compatible_p(__typeof__(expr), signed short) || \
- __builtin_types_compatible_p(__typeof__(expr), unsigned short) || \
- __builtin_types_compatible_p(__typeof__(expr), char) || \
- __builtin_types_compatible_p(__typeof__(expr), signed char) || \
- __builtin_types_compatible_p(__typeof__(expr), unsigned char))
-
-/* evaluates to true if expr is of type curl_off_t */
-#define _curl_is_off_t(expr) \
- (__builtin_types_compatible_p(__typeof__(expr), curl_off_t))
-
-/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
-/* XXX: also check size of an char[] array? */
-#define _curl_is_error_buffer(expr) \
- (__builtin_types_compatible_p(__typeof__(expr), char *) || \
- __builtin_types_compatible_p(__typeof__(expr), char[]))
-
-/* evaluates to true if expr is of type (const) void* or (const) FILE* */
-#if 0
-#define _curl_is_cb_data(expr) \
- (_curl_is_ptr((expr), void) || \
- _curl_is_ptr((expr), FILE))
-#else /* be less strict */
-#define _curl_is_cb_data(expr) \
- _curl_is_any_ptr(expr)
-#endif
-
-/* evaluates to true if expr is of type FILE* */
-#define _curl_is_FILE(expr) \
- (__builtin_types_compatible_p(__typeof__(expr), FILE *))
-
-/* evaluates to true if expr can be passed as POST data (void* or char*) */
-#define _curl_is_postfields(expr) \
- (_curl_is_ptr((expr), void) || \
- _curl_is_arr((expr), char))
-
-/* FIXME: the whole callback checking is messy...
- * The idea is to tolerate char vs. void and const vs. not const
- * pointers in arguments at least
- */
-/* helper: __builtin_types_compatible_p distinguishes between functions and
- * function pointers, hide it */
-#define _curl_callback_compatible(func, type) \
- (__builtin_types_compatible_p(__typeof__(func), type) || \
- __builtin_types_compatible_p(__typeof__(func), type*))
-
-/* evaluates to true if expr is of type curl_read_callback or "similar" */
-#define _curl_is_read_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), __typeof__(fread)) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_read_callback) || \
- _curl_callback_compatible((expr), _curl_read_callback1) || \
- _curl_callback_compatible((expr), _curl_read_callback2) || \
- _curl_callback_compatible((expr), _curl_read_callback3) || \
- _curl_callback_compatible((expr), _curl_read_callback4) || \
- _curl_callback_compatible((expr), _curl_read_callback5) || \
- _curl_callback_compatible((expr), _curl_read_callback6))
-typedef size_t (_curl_read_callback1)(char *, size_t, size_t, void*);
-typedef size_t (_curl_read_callback2)(char *, size_t, size_t, const void*);
-typedef size_t (_curl_read_callback3)(char *, size_t, size_t, FILE*);
-typedef size_t (_curl_read_callback4)(void *, size_t, size_t, void*);
-typedef size_t (_curl_read_callback5)(void *, size_t, size_t, const void*);
-typedef size_t (_curl_read_callback6)(void *, size_t, size_t, FILE*);
-
-/* evaluates to true if expr is of type curl_write_callback or "similar" */
-#define _curl_is_write_cb(expr) \
- (_curl_is_read_cb(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), __typeof__(fwrite)) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_write_callback) || \
- _curl_callback_compatible((expr), _curl_write_callback1) || \
- _curl_callback_compatible((expr), _curl_write_callback2) || \
- _curl_callback_compatible((expr), _curl_write_callback3) || \
- _curl_callback_compatible((expr), _curl_write_callback4) || \
- _curl_callback_compatible((expr), _curl_write_callback5) || \
- _curl_callback_compatible((expr), _curl_write_callback6))
-typedef size_t (_curl_write_callback1)(const char *, size_t, size_t, void*);
-typedef size_t (_curl_write_callback2)(const char *, size_t, size_t,
- const void*);
-typedef size_t (_curl_write_callback3)(const char *, size_t, size_t, FILE*);
-typedef size_t (_curl_write_callback4)(const void *, size_t, size_t, void*);
-typedef size_t (_curl_write_callback5)(const void *, size_t, size_t,
- const void*);
-typedef size_t (_curl_write_callback6)(const void *, size_t, size_t, FILE*);
-
-/* evaluates to true if expr is of type curl_ioctl_callback or "similar" */
-#define _curl_is_ioctl_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_ioctl_callback) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback1) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback2) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback3) || \
- _curl_callback_compatible((expr), _curl_ioctl_callback4))
-typedef curlioerr (_curl_ioctl_callback1)(CURL *, int, void*);
-typedef curlioerr (_curl_ioctl_callback2)(CURL *, int, const void*);
-typedef curlioerr (_curl_ioctl_callback3)(CURL *, curliocmd, void*);
-typedef curlioerr (_curl_ioctl_callback4)(CURL *, curliocmd, const void*);
-
-/* evaluates to true if expr is of type curl_sockopt_callback or "similar" */
-#define _curl_is_sockopt_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_sockopt_callback) || \
- _curl_callback_compatible((expr), _curl_sockopt_callback1) || \
- _curl_callback_compatible((expr), _curl_sockopt_callback2))
-typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
-typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
- curlsocktype);
-
-/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */
-#define _curl_is_opensocket_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
- _curl_callback_compatible((expr), _curl_opensocket_callback1) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback2) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback3) || \
- _curl_callback_compatible((expr), _curl_opensocket_callback4))
-typedef curl_socket_t (_curl_opensocket_callback1)
- (void *, curlsocktype, struct curl_sockaddr *);
-typedef curl_socket_t (_curl_opensocket_callback2)
- (void *, curlsocktype, const struct curl_sockaddr *);
-typedef curl_socket_t (_curl_opensocket_callback3)
- (const void *, curlsocktype, struct curl_sockaddr *);
-typedef curl_socket_t (_curl_opensocket_callback4)
- (const void *, curlsocktype, const struct curl_sockaddr *);
-
-/* evaluates to true if expr is of type curl_progress_callback or "similar" */
-#define _curl_is_progress_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_progress_callback) || \
- _curl_callback_compatible((expr), _curl_progress_callback1) || \
- _curl_callback_compatible((expr), _curl_progress_callback2))
-typedef int (_curl_progress_callback1)(void *,
- double, double, double, double);
-typedef int (_curl_progress_callback2)(const void *,
- double, double, double, double);
-
-/* evaluates to true if expr is of type curl_debug_callback or "similar" */
-#define _curl_is_debug_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_debug_callback) || \
- _curl_callback_compatible((expr), _curl_debug_callback1) || \
- _curl_callback_compatible((expr), _curl_debug_callback2) || \
- _curl_callback_compatible((expr), _curl_debug_callback3) || \
- _curl_callback_compatible((expr), _curl_debug_callback4))
-typedef int (_curl_debug_callback1) (CURL *,
- curl_infotype, char *, size_t, void *);
-typedef int (_curl_debug_callback2) (CURL *,
- curl_infotype, char *, size_t, const void *);
-typedef int (_curl_debug_callback3) (CURL *,
- curl_infotype, const char *, size_t, void *);
-typedef int (_curl_debug_callback4) (CURL *,
- curl_infotype, const char *, size_t, const void *);
-
-/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
-/* this is getting even messier... */
-#define _curl_is_ssl_ctx_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_ssl_ctx_callback) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback1) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback2) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback3) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback4) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback5) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback6) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback7) || \
- _curl_callback_compatible((expr), _curl_ssl_ctx_callback8))
-typedef CURLcode (_curl_ssl_ctx_callback1)(CURL *, void *, void *);
-typedef CURLcode (_curl_ssl_ctx_callback2)(CURL *, void *, const void *);
-typedef CURLcode (_curl_ssl_ctx_callback3)(CURL *, const void *, void *);
-typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
-#ifdef HEADER_SSL_H
-/* hack: if we included OpenSSL's ssl.h, we know about SSL_CTX
- * this will of course break if we're included before OpenSSL headers...
- */
-typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
-typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
-typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
-typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *);
-#else
-typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
-typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;
-typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback7;
-typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback8;
-#endif
-
-/* evaluates to true if expr is of type curl_conv_callback or "similar" */
-#define _curl_is_conv_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_conv_callback) || \
- _curl_callback_compatible((expr), _curl_conv_callback1) || \
- _curl_callback_compatible((expr), _curl_conv_callback2) || \
- _curl_callback_compatible((expr), _curl_conv_callback3) || \
- _curl_callback_compatible((expr), _curl_conv_callback4))
-typedef CURLcode (*_curl_conv_callback1)(char *, size_t length);
-typedef CURLcode (*_curl_conv_callback2)(const char *, size_t length);
-typedef CURLcode (*_curl_conv_callback3)(void *, size_t length);
-typedef CURLcode (*_curl_conv_callback4)(const void *, size_t length);
-
-/* evaluates to true if expr is of type curl_seek_callback or "similar" */
-#define _curl_is_seek_cb(expr) \
- (_curl_is_NULL(expr) || \
- __builtin_types_compatible_p(__typeof__(expr), curl_seek_callback) || \
- _curl_callback_compatible((expr), _curl_seek_callback1) || \
- _curl_callback_compatible((expr), _curl_seek_callback2))
-typedef CURLcode (*_curl_seek_callback1)(void *, curl_off_t, int);
-typedef CURLcode (*_curl_seek_callback2)(const void *, curl_off_t, int);
-
-
-#endif /* __CURL_TYPECHECK_GCC_H */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/curl/types.h b/toolkit/crashreporter/google-breakpad/src/third_party/curl/types.h
deleted file mode 100644
index d37d6ae9e1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/curl/types.h
+++ /dev/null
@@ -1 +0,0 @@
-/* not used */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/Makefile.am b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/Makefile.am
deleted file mode 100644
index bd3129e1ad..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/Makefile.am
+++ /dev/null
@@ -1,43 +0,0 @@
-include_HEADERS = libdis.h
-lib_LTLIBRARIES = libdisasm.la
-libdisasm_la_SOURCES = \
- ia32_implicit.c \
- ia32_implicit.h \
- ia32_insn.c \
- ia32_insn.h \
- ia32_invariant.c \
- ia32_invariant.h \
- ia32_modrm.c \
- ia32_modrm.h \
- ia32_opcode_tables.c \
- ia32_opcode_tables.h \
- ia32_operand.c \
- ia32_operand.h \
- ia32_reg.c \
- ia32_reg.h \
- ia32_settings.c \
- ia32_settings.h \
- libdis.h \
- qword.h \
- x86_disasm.c \
- x86_format.c \
- x86_imm.c \
- x86_imm.h \
- x86_insn.c \
- x86_misc.c \
- x86_operand_list.c \
- x86_operand_list.h
-
-# Cheat to get non-autoconf swig into tarball,
-# even if it doesn't build by default.
-EXTRA_DIST = \
-swig/Makefile \
-swig/libdisasm.i \
-swig/libdisasm_oop.i \
-swig/python/Makefile-swig \
-swig/perl/Makefile-swig \
-swig/perl/Makefile.PL \
-swig/ruby/Makefile-swig \
-swig/ruby/extconf.rb \
-swig/tcl/Makefile-swig \
-swig/README
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/TODO b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/TODO
deleted file mode 100644
index 148addf9b8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/TODO
+++ /dev/null
@@ -1,43 +0,0 @@
-x86_format.c
-------------
-intel: jmpf -> jmp, callf -> call
-att: jmpf -> ljmp, callf -> lcall
-
-opcode table
-------------
-finish typing instructions
-fix flag clear/set/toggle types
-
-ix64 stuff
-----------
-document output file formats in web page
-features doc: register aliases, implicit operands, stack mods,
-ring0 flags, eflags, cpu model/isa
-
-ia32_handle_* implementation
-
-fix operand 0F C2
-CMPPS
-
-* sysenter, sysexit as CALL types -- preceded by MSR writes
-* SYSENTER/SYSEXIT stack : overwrites SS, ESP
-* stos, cmps, scas, movs, ins, outs, lods -> OP_PTR
-* OP_SIZE in implicit operands
-* use OP_SIZE to choose reg sizes!
-
-DONE?? :
-implicit operands: provide action ?
-e.g. add/inc for stach, write, etc
-replace table numbers in opcodes.dat with
-#defines for table names
-
-replace 0 with INSN_INVALID [or maybe FF for imnvalid and 00 for Not Applicable */
-no wait that is only for prefix tables -- n/p
-
-if ( prefx) only use if insn != invalid
-
-these should cover all the wacky disasm exceptions
-
-for the rep one we can chet, match only a 0x90
-
-todo: privilege | ring
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.c
deleted file mode 100644
index 8b075d2ee0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.c
+++ /dev/null
@@ -1,422 +0,0 @@
-#include <stdlib.h>
-
-#include "ia32_implicit.h"
-#include "ia32_insn.h"
-#include "ia32_reg.h"
-#include "x86_operand_list.h"
-
-/* Conventions: Register operands which are aliases of another register
- * operand (e.g. AX in one operand and AL in another) assume that the
- * operands are different registers and that alias tracking will resolve
- * data flow. This means that something like
- * mov ax, al
- * would have 'write only' access for AX and 'read only' access for AL,
- * even though both AL and AX are read and written */
-typedef struct {
- uint32_t type;
- uint32_t operand;
-} op_implicit_list_t;
-
-static op_implicit_list_t list_aaa[] =
- /* 37 : AAA : rw AL */
- /* 3F : AAS : rw AL */
- {{ OP_R | OP_W, REG_BYTE_OFFSET }, {0}}; /* aaa */
-
-static op_implicit_list_t list_aad[] =
- /* D5 0A, D5 (ib) : AAD : rw AX */
- /* D4 0A, D4 (ib) : AAM : rw AX */
- {{ OP_R | OP_W, REG_WORD_OFFSET }, {0}}; /* aad */
-
-static op_implicit_list_t list_call[] =
- /* E8, FF, 9A, FF : CALL : rw ESP, rw EIP */
- /* C2, C3, CA, CB : RET : rw ESP, rw EIP */
- {{ OP_R | OP_W, REG_EIP_INDEX },
- { OP_R | OP_W, REG_ESP_INDEX }, {0}}; /* call, ret */
-
-static op_implicit_list_t list_cbw[] =
- /* 98 : CBW : r AL, rw AX */
- {{ OP_R | OP_W, REG_WORD_OFFSET },
- { OP_R, REG_BYTE_OFFSET}, {0}}; /* cbw */
-
-static op_implicit_list_t list_cwde[] =
- /* 98 : CWDE : r AX, rw EAX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET },
- { OP_R, REG_WORD_OFFSET }, {0}}; /* cwde */
-
-static op_implicit_list_t list_clts[] =
- /* 0F 06 : CLTS : rw CR0 */
- {{ OP_R | OP_W, REG_CTRL_OFFSET}, {0}}; /* clts */
-
-static op_implicit_list_t list_cmpxchg[] =
- /* 0F B0 : CMPXCHG : rw AL */
- {{ OP_R | OP_W, REG_BYTE_OFFSET }, {0}}; /* cmpxchg */
-
-static op_implicit_list_t list_cmpxchgb[] =
- /* 0F B1 : CMPXCHG : rw EAX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET }, {0}}; /* cmpxchg */
-
-static op_implicit_list_t list_cmpxchg8b[] =
- /* 0F C7 : CMPXCHG8B : rw EDX, rw EAX, r ECX, r EBX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET },
- { OP_R | OP_W, REG_DWORD_OFFSET + 2 },
- { OP_R, REG_DWORD_OFFSET + 1 },
- { OP_R, REG_DWORD_OFFSET + 3 }, {0}}; /* cmpxchg8b */
-
-static op_implicit_list_t list_cpuid[] =
- /* 0F A2 : CPUID : rw EAX, w EBX, w ECX, w EDX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET },
- { OP_W, REG_DWORD_OFFSET + 1 },
- { OP_W, REG_DWORD_OFFSET + 2 },
- { OP_W, REG_DWORD_OFFSET + 3 }, {0}}; /* cpuid */
-
-static op_implicit_list_t list_cwd[] =
- /* 99 : CWD/CWQ : rw EAX, w EDX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET },
- { OP_W, REG_DWORD_OFFSET + 2 }, {0}}; /* cwd */
-
-static op_implicit_list_t list_daa[] =
- /* 27 : DAA : rw AL */
- /* 2F : DAS : rw AL */
- {{ OP_R | OP_W, REG_BYTE_OFFSET }, {0}}; /* daa */
-
-static op_implicit_list_t list_idiv[] =
- /* F6 : DIV, IDIV : r AX, w AL, w AH */
- /* FIXED: first op was EAX, not Aw. TODO: verify! */
- {{ OP_R, REG_WORD_OFFSET },
- { OP_W, REG_BYTE_OFFSET },
- { OP_W, REG_BYTE_OFFSET + 4 }, {0}}; /* div */
-
-static op_implicit_list_t list_div[] =
- /* F7 : DIV, IDIV : rw EDX, rw EAX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET + 2 },
- { OP_R | OP_W, REG_DWORD_OFFSET }, {0}}; /* div */
-
-static op_implicit_list_t list_enter[] =
- /* C8 : ENTER : rw ESP w EBP */
- {{ OP_R | OP_W, REG_DWORD_OFFSET + 4 },
- { OP_R, REG_DWORD_OFFSET + 5 }, {0}}; /* enter */
-
-static op_implicit_list_t list_f2xm1[] =
- /* D9 F0 : F2XM1 : rw ST(0) */
- /* D9 E1 : FABS : rw ST(0) */
- /* D9 E0 : FCHS : rw ST(0) */
- /* D9 FF : FCOS : rw ST(0)*/
- /* D8, DA : FDIV : rw ST(0) */
- /* D8, DA : FDIVR : rw ST(0) */
- /* D9 F2 : FPTAN : rw ST(0) */
- /* D9 FC : FRNDINT : rw ST(0) */
- /* D9 FB : FSINCOS : rw ST(0) */
- /* D9 FE : FSIN : rw ST(0) */
- /* D9 FA : FSQRT : rw ST(0) */
- /* D9 F4 : FXTRACT : rw ST(0) */
- {{ OP_R | OP_W, REG_FPU_OFFSET }, {0}}; /* f2xm1 */
-
-static op_implicit_list_t list_fcom[] =
- /* D8, DC, DE D9 : FCOM : r ST(0) */
- /* DE, DA : FICOM : r ST(0) */
- /* DF, D8 : FIST : r ST(0) */
- /* D9 E4 : FTST : r ST(0) */
- /* D9 E5 : FXAM : r ST(0) */
- {{ OP_R, REG_FPU_OFFSET }, {0}}; /* fcom */
-
-static op_implicit_list_t list_fpatan[] =
- /* D9 F3 : FPATAN : r ST(0), rw ST(1) */
- {{ OP_R, REG_FPU_OFFSET }, {0}}; /* fpatan */
-
-static op_implicit_list_t list_fprem[] =
- /* D9 F8, D9 F5 : FPREM : rw ST(0) r ST(1) */
- /* D9 FD : FSCALE : rw ST(0), r ST(1) */
- {{ OP_R | OP_W, REG_FPU_OFFSET },
- { OP_R, REG_FPU_OFFSET + 1 }, {0}}; /* fprem */
-
-static op_implicit_list_t list_faddp[] =
- /* DE C1 : FADDP : r ST(0), rw ST(1) */
- /* DE E9 : FSUBP : r ST(0), rw ST(1) */
- /* D9 F1 : FYL2X : r ST(0), rw ST(1) */
- /* D9 F9 : FYL2XP1 : r ST(0), rw ST(1) */
- {{ OP_R, REG_FPU_OFFSET },
- { OP_R | OP_W, REG_FPU_OFFSET + 1 }, {0}}; /* faddp */
-
-static op_implicit_list_t list_fucompp[] =
- /* DA E9 : FUCOMPP : r ST(0), r ST(1) */
- {{ OP_R, REG_FPU_OFFSET },
- { OP_R, REG_FPU_OFFSET + 1 }, {0}}; /* fucompp */
-
-static op_implicit_list_t list_imul[] =
- /* F6 : IMUL : r AL, w AX */
- /* F6 : MUL : r AL, w AX */
- {{ OP_R, REG_BYTE_OFFSET },
- { OP_W, REG_WORD_OFFSET }, {0}}; /* imul */
-
-static op_implicit_list_t list_mul[] =
- /* F7 : IMUL : rw EAX, w EDX */
- /* F7 : MUL : rw EAX, w EDX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET },
- { OP_W, REG_DWORD_OFFSET + 2 }, {0}}; /* imul */
-
-static op_implicit_list_t list_lahf[] =
- /* 9F : LAHF : r EFLAGS, w AH */
- {{ OP_R, REG_FLAGS_INDEX },
- { OP_W, REG_BYTE_OFFSET + 4 }, {0}}; /* lahf */
-
-static op_implicit_list_t list_ldmxcsr[] =
- /* 0F AE : LDMXCSR : w MXCSR SSE Control Status Reg */
- {{ OP_W, REG_MXCSG_INDEX }, {0}}; /* ldmxcsr */
-
-static op_implicit_list_t list_leave[] =
- /* C9 : LEAVE : rw ESP, w EBP */
- {{ OP_R | OP_W, REG_ESP_INDEX },
- { OP_W, REG_DWORD_OFFSET + 5 }, {0}}; /* leave */
-
-static op_implicit_list_t list_lgdt[] =
- /* 0F 01 : LGDT : w GDTR */
- {{ OP_W, REG_GDTR_INDEX }, {0}}; /* lgdt */
-
-static op_implicit_list_t list_lidt[] =
- /* 0F 01 : LIDT : w IDTR */
- {{ OP_W, REG_IDTR_INDEX }, {0}}; /* lidt */
-
-static op_implicit_list_t list_lldt[] =
- /* 0F 00 : LLDT : w LDTR */
- {{ OP_W, REG_LDTR_INDEX }, {0}}; /* lldt */
-
-static op_implicit_list_t list_lmsw[] =
- /* 0F 01 : LMSW : w CR0 */
- {{ OP_W, REG_CTRL_OFFSET }, {0}}; /* lmsw */
-
-static op_implicit_list_t list_loop[] =
- /* E0, E1, E2 : LOOP : rw ECX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET + 1 }, {0}};/* loop */
-
-static op_implicit_list_t list_ltr[] =
- /* 0F 00 : LTR : w Task Register */
- {{ OP_W, REG_TR_INDEX }, {0}}; /* ltr */
-
-static op_implicit_list_t list_pop[] =
- /* 8F, 58, 1F, 07, 17, 0F A1, 0F A9 : POP : rw ESP */
- /* FF, 50, 6A, 68, 0E, 16, 1E, 06, 0F A0, 0F A8 : PUSH : rw ESP */
- {{ OP_R | OP_W, REG_ESP_INDEX }, {0}}; /* pop, push */
-
-static op_implicit_list_t list_popad[] =
- /* 61 : POPAD : rw esp, w edi esi ebp ebx edx ecx eax */
- {{ OP_R | OP_W, REG_ESP_INDEX },
- { OP_W, REG_DWORD_OFFSET + 7 },
- { OP_W, REG_DWORD_OFFSET + 6 },
- { OP_W, REG_DWORD_OFFSET + 5 },
- { OP_W, REG_DWORD_OFFSET + 3 },
- { OP_W, REG_DWORD_OFFSET + 2 },
- { OP_W, REG_DWORD_OFFSET + 1 },
- { OP_W, REG_DWORD_OFFSET }, {0}}; /* popad */
-
-static op_implicit_list_t list_popfd[] =
- /* 9D : POPFD : rw esp, w eflags */
- {{ OP_R | OP_W, REG_ESP_INDEX },
- { OP_W, REG_FLAGS_INDEX }, {0}}; /* popfd */
-
-static op_implicit_list_t list_pushad[] =
- /* FF, 50, 6A, 68, 0E, 16, 1E, 06, 0F A0, 0F A8 : PUSH : rw ESP */
- /* 60 : PUSHAD : rw esp, r eax ecx edx ebx esp ebp esi edi */
- {{ OP_R | OP_W, REG_ESP_INDEX },
- { OP_R, REG_DWORD_OFFSET },
- { OP_R, REG_DWORD_OFFSET + 1 },
- { OP_R, REG_DWORD_OFFSET + 2 },
- { OP_R, REG_DWORD_OFFSET + 3 },
- { OP_R, REG_DWORD_OFFSET + 5 },
- { OP_R, REG_DWORD_OFFSET + 6 },
- { OP_R, REG_DWORD_OFFSET + 7 }, {0}}; /* pushad */
-
-static op_implicit_list_t list_pushfd[] =
- /* 9C : PUSHFD : rw esp, r eflags */
- {{ OP_R | OP_W, REG_ESP_INDEX },
- { OP_R, REG_FLAGS_INDEX }, {0}}; /* pushfd */
-
-static op_implicit_list_t list_rdmsr[] =
- /* 0F 32 : RDMSR : r ECX, w EDX, w EAX */
- {{ OP_R, REG_DWORD_OFFSET + 1 },
- { OP_W, REG_DWORD_OFFSET + 2 },
- { OP_W, REG_DWORD_OFFSET }, {0}}; /* rdmsr */
-
-static op_implicit_list_t list_rdpmc[] =
- /* 0F 33 : RDPMC : r ECX, w EDX, w EAX */
- {{ OP_R, REG_DWORD_OFFSET + 1 },
- { OP_W, REG_DWORD_OFFSET + 2 },
- { OP_W, REG_DWORD_OFFSET }, {0}}; /* rdpmc */
-
-static op_implicit_list_t list_rdtsc[] =
- /* 0F 31 : RDTSC : rw EDX, rw EAX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET + 2 },
- { OP_R | OP_W, REG_DWORD_OFFSET }, {0}}; /* rdtsc */
-
-static op_implicit_list_t list_rep[] =
- /* F3, F2 ... : REP : rw ECX */
- {{ OP_R | OP_W, REG_DWORD_OFFSET + 1 }, {0}};/* rep */
-
-static op_implicit_list_t list_rsm[] =
- /* 0F AA : RSM : r CR4, r CR0 */
- {{ OP_R, REG_CTRL_OFFSET + 4 },
- { OP_R, REG_CTRL_OFFSET }, {0}}; /* rsm */
-
-static op_implicit_list_t list_sahf[] =
- /* 9E : SAHF : r ah, rw eflags (set SF ZF AF PF CF) */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* sahf */
-
-static op_implicit_list_t list_sgdt[] =
- /* 0F : SGDT : r gdtr */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* sgdt */
-
-static op_implicit_list_t list_sidt[] =
- /* 0F : SIDT : r idtr */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* sidt */
-
-static op_implicit_list_t list_sldt[] =
- /* 0F : SLDT : r ldtr */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* sldt */
-
-static op_implicit_list_t list_smsw[] =
- /* 0F : SMSW : r CR0 */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* smsw */
-
-static op_implicit_list_t list_stmxcsr[] =
- /* 0F AE : STMXCSR : r MXCSR */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* stmxcsr */
-
-static op_implicit_list_t list_str[] =
- /* 0F 00 : STR : r TR (task register) */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* str */
-
-static op_implicit_list_t list_sysenter[] =
- /* 0F 34 : SYSENTER : w cs, w eip, w ss, w esp, r CR0, w eflags
- * r sysenter_cs_msr, sysenter_esp_msr, sysenter_eip_msr */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* sysenter */
-
-static op_implicit_list_t list_sysexit[] =
- /* 0F 35 : SYSEXIT : r edx, r ecx, w cs, w eip, w ss, w esp
- * r sysenter_cs_msr */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* sysexit */
-
-static op_implicit_list_t list_wrmsr[] =
- /* 0F 30 : WRMST : r edx, r eax, r ecx */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* wrmsr */
-
-static op_implicit_list_t list_xlat[] =
- /* D7 : XLAT : rw al r ebx (ptr) */
- /* TODO: finish this! */
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* xlat */
-/* TODO:
- * monitor 0f 01 c8 eax OP_R ecx OP_R edx OP_R
- * mwait 0f 01 c9 eax OP_R ecx OP_R
- */
-static op_implicit_list_t list_monitor[] =
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* monitor */
-static op_implicit_list_t list_mwait[] =
- {{ OP_R, REG_DWORD_OFFSET }, {0}}; /* mwait */
-
-op_implicit_list_t *op_implicit_list[] = {
- /* This is a list of implicit operands which are read/written by
- * various x86 instructions. Note that modifications to the stack
- * register are mentioned here, but that additional information on
- * the effect an instruction has on the stack is contained in the
- * x86_insn_t 'stack_mod' and 'stack_mod_val' fields. Use of the
- * eflags register, i.e. setting, clearing, and testing flags, is
- * not recorded here but rather in the flags_set and flags_tested
- * fields of the x86_insn_t.*/
- NULL,
- list_aaa, list_aad, list_call, list_cbw, /* 1 - 4 */
- list_cwde, list_clts, list_cmpxchg, list_cmpxchgb, /* 5 - 8 */
- list_cmpxchg8b, list_cpuid, list_cwd, list_daa, /* 9 - 12 */
- list_idiv, list_div, list_enter, list_f2xm1, /* 13 - 16 */
- list_fcom, list_fpatan, list_fprem, list_faddp, /* 17 - 20 */
- list_fucompp, list_imul, list_mul, list_lahf, /* 21 - 24 */
- list_ldmxcsr, list_leave, list_lgdt, list_lidt, /* 25 - 28 */
- list_lldt, list_lmsw, list_loop, list_ltr, /* 29 - 32 */
- list_pop, list_popad, list_popfd, list_pushad, /* 33 - 36 */
- list_pushfd, list_rdmsr, list_rdpmc, list_rdtsc, /* 37 - 40 */
- /* NOTE: 'REP' is a hack since it is a prefix: if its position
- * in the table changes, then change IDX_IMPLICIT_REP in the .h */
- list_rep, list_rsm, list_sahf, list_sgdt, /* 41 - 44 */
- list_sidt, list_sldt, list_smsw, list_stmxcsr, /* 45 - 48 */
- list_str, list_sysenter, list_sysexit, list_wrmsr, /* 49 - 52 */
- list_xlat, list_monitor, list_mwait, /* 53 - 55*/
- NULL /* end of list */
- };
-
-#define LAST_IMPL_IDX 55
-
-static void handle_impl_reg( x86_op_t *op, uint32_t val ) {
- x86_reg_t *reg = &op->data.reg;
- op->type = op_register;
- ia32_handle_register( reg, (unsigned int) val );
- switch (reg->size) {
- case 1:
- op->datatype = op_byte; break;
- case 2:
- op->datatype = op_word; break;
- case 4:
- op->datatype = op_dword; break;
- case 8:
- op->datatype = op_qword; break;
- case 10:
- op->datatype = op_extreal; break;
- case 16:
- op->datatype = op_dqword; break;
- }
- return;
-}
-
-/* 'impl_idx' is the value from the opcode table: between 1 and LAST_IMPL_IDX */
-/* returns number of operands added */
-unsigned int ia32_insn_implicit_ops( x86_insn_t *insn, unsigned int impl_idx ) {
- op_implicit_list_t *list;
- x86_op_t *op;
- unsigned int num = 0;
-
- if (! impl_idx || impl_idx > LAST_IMPL_IDX ) {
- return 0;
- }
-
- for ( list = op_implicit_list[impl_idx]; list->type; list++, num++ ) {
- enum x86_op_access access = (enum x86_op_access) OP_PERM(list->type);
- enum x86_op_flags flags = (enum x86_op_flags) (OP_FLAGS(list->type) >> 12);
-
- op = NULL;
- /* In some cases (MUL), EAX is an implicit operand hardcoded in
- * the instruction without being explicitly listed in assembly.
- * For this situation, find the hardcoded operand and add the
- * implied flag rather than adding a new implicit operand. */
- x86_oplist_t * existing;
- if (ia32_true_register_id(list->operand) == REG_DWORD_OFFSET) {
- for ( existing = insn->operands; existing; existing = existing->next ) {
- if (existing->op.type == op_register &&
- existing->op.data.reg.id == list->operand) {
- op = &existing->op;
- break;
- }
- }
- }
- if (!op) {
- op = x86_operand_new( insn );
- /* all implicit operands are registers */
- handle_impl_reg( op, list->operand );
- /* decrement the 'explicit count' incremented by default in
- * x86_operand_new */
- insn->explicit_count = insn->explicit_count -1;
- }
- if (!op) {
- return num; /* gah! return early */
- }
- op->access |= access;
- op->flags |= flags;
- op->flags |= op_implied;
- }
-
- return num;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.h
deleted file mode 100644
index 0002b28b9b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_implicit.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef IA32_IMPLICIT_H
-#define IA32_IMPLICIT_H
-
-#include "libdis.h"
-
-/* OK, this is a hack to deal with prefixes having implicit operands...
- * thought I had removed all the old hackishness ;( */
-
-#define IDX_IMPLICIT_REP 41 /* change this if the table changes! */
-
-unsigned int ia32_insn_implicit_ops( x86_insn_t *insn, unsigned int impl_idx );
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.c
deleted file mode 100644
index cc277608bf..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.c
+++ /dev/null
@@ -1,623 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "qword.h"
-
-#include "ia32_insn.h"
-#include "ia32_opcode_tables.h"
-
-#include "ia32_reg.h"
-#include "ia32_operand.h"
-#include "ia32_implicit.h"
-#include "ia32_settings.h"
-
-#include "libdis.h"
-
-extern ia32_table_desc_t ia32_tables[];
-extern ia32_settings_t ia32_settings;
-
-#define IS_SP( op ) (op->type == op_register && \
- (op->data.reg.id == REG_ESP_INDEX || \
- op->data.reg.alias == REG_ESP_INDEX) )
-#define IS_IMM( op ) (op->type == op_immediate )
-
-#ifdef WIN32
-# define INLINE
-#else
-# define INLINE inline
-#endif
-
-/* for calculating stack modification based on an operand */
-static INLINE int32_t long_from_operand( x86_op_t *op ) {
-
- if (! IS_IMM(op) ) {
- return 0L;
- }
-
- switch ( op->datatype ) {
- case op_byte:
- return (int32_t) op->data.sbyte;
- case op_word:
- return (int32_t) op->data.sword;
- case op_qword:
- return (int32_t) op->data.sqword;
- case op_dword:
- return op->data.sdword;
- default:
- /* these are not used in stack insn */
- break;
- }
-
- return 0L;
-}
-
-
-/* determine what this insn does to the stack */
-static void ia32_stack_mod(x86_insn_t *insn) {
- x86_op_t *dest, *src = NULL;
-
- if (! insn || ! insn->operands ) {
- return;
- }
-
- dest = &insn->operands->op;
- if ( dest ) {
- src = &insn->operands->next->op;
- }
-
- insn->stack_mod = 0;
- insn->stack_mod_val = 0;
-
- switch ( insn->type ) {
- case insn_call:
- case insn_callcc:
- insn->stack_mod = 1;
- insn->stack_mod_val = insn->addr_size * -1;
- break;
- case insn_push:
- insn->stack_mod = 1;
- insn->stack_mod_val = insn->addr_size * -1;
- break;
- case insn_return:
- insn->stack_mod = 1;
- insn->stack_mod_val = insn->addr_size;
- case insn_int: case insn_intcc:
- case insn_iret:
- break;
- case insn_pop:
- insn->stack_mod = 1;
- if (! IS_SP( dest ) ) {
- insn->stack_mod_val = insn->op_size;
- } /* else we don't know the stack change in a pop esp */
- break;
- case insn_enter:
- insn->stack_mod = 1;
- insn->stack_mod_val = 0; /* TODO : FIX */
- break;
- case insn_leave:
- insn->stack_mod = 1;
- insn->stack_mod_val = 0; /* TODO : FIX */
- break;
- case insn_pushregs:
- insn->stack_mod = 1;
- insn->stack_mod_val = 0; /* TODO : FIX */
- break;
- case insn_popregs:
- insn->stack_mod = 1;
- insn->stack_mod_val = 0; /* TODO : FIX */
- break;
- case insn_pushflags:
- insn->stack_mod = 1;
- insn->stack_mod_val = 0; /* TODO : FIX */
- break;
- case insn_popflags:
- insn->stack_mod = 1;
- insn->stack_mod_val = 0; /* TODO : FIX */
- break;
- case insn_add:
- if ( IS_SP( dest ) ) {
- insn->stack_mod = 1;
- insn->stack_mod_val = long_from_operand( src );
- }
- break;
- case insn_sub:
- if ( IS_SP( dest ) ) {
- insn->stack_mod = 1;
- insn->stack_mod_val = long_from_operand( src );
- insn->stack_mod_val *= -1;
- }
- break;
- case insn_inc:
- if ( IS_SP( dest ) ) {
- insn->stack_mod = 1;
- insn->stack_mod_val = 1;
- }
- break;
- case insn_dec:
- if ( IS_SP( dest ) ) {
- insn->stack_mod = 1;
- insn->stack_mod_val = 1;
- }
- break;
- case insn_mov: case insn_movcc:
- case insn_xchg: case insn_xchgcc:
- case insn_mul: case insn_div:
- case insn_shl: case insn_shr:
- case insn_rol: case insn_ror:
- case insn_and: case insn_or:
- case insn_not: case insn_neg:
- case insn_xor:
- if ( IS_SP( dest ) ) {
- insn->stack_mod = 1;
- }
- break;
- default:
- break;
- }
- if (! strcmp("enter", insn->mnemonic) ) {
- insn->stack_mod = 1;
- } else if (! strcmp("leave", insn->mnemonic) ) {
- insn->stack_mod = 1;
- }
-
- /* for mov, etc we return 0 -- unknown stack mod */
-
- return;
-}
-
-/* get the cpu details for this insn from cpu flags int */
-static void ia32_handle_cpu( x86_insn_t *insn, unsigned int cpu ) {
- insn->cpu = (enum x86_insn_cpu) CPU_MODEL(cpu);
- insn->isa = (enum x86_insn_isa) (ISA_SUBSET(cpu)) >> 16;
- return;
-}
-
-/* handle mnemonic type and group */
-static void ia32_handle_mnemtype(x86_insn_t *insn, unsigned int mnemtype) {
- unsigned int type = mnemtype & ~INS_FLAG_MASK;
- insn->group = (enum x86_insn_group) (INS_GROUP(type)) >> 12;
- insn->type = (enum x86_insn_type) INS_TYPE(type);
-
- return;
-}
-
-static void ia32_handle_notes(x86_insn_t *insn, unsigned int notes) {
- insn->note = (enum x86_insn_note) notes;
- return;
-}
-
-static void ia32_handle_eflags( x86_insn_t *insn, unsigned int eflags) {
- unsigned int flags;
-
- /* handle flags effected */
- flags = INS_FLAGS_TEST(eflags);
- /* handle weird OR cases */
- /* these are either JLE (ZF | SF<>OF) or JBE (CF | ZF) */
- if (flags & INS_TEST_OR) {
- flags &= ~INS_TEST_OR;
- if ( flags & INS_TEST_ZERO ) {
- flags &= ~INS_TEST_ZERO;
- if ( flags & INS_TEST_CARRY ) {
- flags &= ~INS_TEST_CARRY ;
- flags |= (int)insn_carry_or_zero_set;
- } else if ( flags & INS_TEST_SFNEOF ) {
- flags &= ~INS_TEST_SFNEOF;
- flags |= (int)insn_zero_set_or_sign_ne_oflow;
- }
- }
- }
- insn->flags_tested = (enum x86_flag_status) flags;
-
- insn->flags_set = (enum x86_flag_status) INS_FLAGS_SET(eflags) >> 16;
-
- return;
-}
-
-static void ia32_handle_prefix( x86_insn_t *insn, unsigned int prefixes ) {
-
- insn->prefix = (enum x86_insn_prefix) prefixes & PREFIX_MASK; // >> 20;
- if (! (insn->prefix & PREFIX_PRINT_MASK) ) {
- /* no printable prefixes */
- insn->prefix = insn_no_prefix;
- }
-
- /* concat all prefix strings */
- if ( (unsigned int)insn->prefix & PREFIX_LOCK ) {
- strncat(insn->prefix_string, "lock ", 32 -
- strlen(insn->prefix_string));
- }
-
- if ( (unsigned int)insn->prefix & PREFIX_REPNZ ) {
- strncat(insn->prefix_string, "repnz ", 32 -
- strlen(insn->prefix_string));
- } else if ( (unsigned int)insn->prefix & PREFIX_REPZ ) {
- strncat(insn->prefix_string, "repz ", 32 -
- strlen(insn->prefix_string));
- }
-
- return;
-}
-
-
-static void reg_32_to_16( x86_op_t *op, x86_insn_t *insn, void *arg ) {
-
- /* if this is a 32-bit register and it is a general register ... */
- if ( op->type == op_register && op->data.reg.size == 4 &&
- (op->data.reg.type & reg_gen) ) {
- /* WORD registers are 8 indices off from DWORD registers */
- ia32_handle_register( &(op->data.reg),
- op->data.reg.id + 8 );
- }
-}
-
-static void handle_insn_metadata( x86_insn_t *insn, ia32_insn_t *raw_insn ) {
- ia32_handle_mnemtype( insn, raw_insn->mnem_flag );
- ia32_handle_notes( insn, raw_insn->notes );
- ia32_handle_eflags( insn, raw_insn->flags_effected );
- ia32_handle_cpu( insn, raw_insn->cpu );
- ia32_stack_mod( insn );
-}
-
-static size_t ia32_decode_insn( unsigned char *buf, size_t buf_len,
- ia32_insn_t *raw_insn, x86_insn_t *insn,
- unsigned int prefixes ) {
- size_t size, op_size;
- unsigned char modrm;
-
- /* this should never happen, but just in case... */
- if ( raw_insn->mnem_flag == INS_INVALID ) {
- return 0;
- }
-
- if (ia32_settings.options & opt_16_bit) {
- insn->op_size = ( prefixes & PREFIX_OP_SIZE ) ? 4 : 2;
- insn->addr_size = ( prefixes & PREFIX_ADDR_SIZE ) ? 4 : 2;
- } else {
- insn->op_size = ( prefixes & PREFIX_OP_SIZE ) ? 2 : 4;
- insn->addr_size = ( prefixes & PREFIX_ADDR_SIZE ) ? 2 : 4;
- }
-
-
- /* ++++ 1. Copy mnemonic and mnemonic-flags to CODE struct */
- if ((ia32_settings.options & opt_att_mnemonics) && raw_insn->mnemonic_att[0]) {
- strncpy( insn->mnemonic, raw_insn->mnemonic_att, 16 );
- }
- else {
- strncpy( insn->mnemonic, raw_insn->mnemonic, 16 );
- }
- ia32_handle_prefix( insn, prefixes );
-
- handle_insn_metadata( insn, raw_insn );
-
- /* prefetch the next byte in case it is a modr/m byte -- saves
- * worrying about whether the 'mod/rm' operand or the 'reg' operand
- * occurs first */
- modrm = GET_BYTE( buf, buf_len );
-
- /* ++++ 2. Decode Explicit Operands */
- /* Intel uses up to 3 explicit operands in its instructions;
- * the first is 'dest', the second is 'src', and the third
- * is an additional source value (usually an immediate value,
- * e.g. in the MUL instructions). These three explicit operands
- * are encoded in the opcode tables, even if they are not used
- * by the instruction. Additional implicit operands are stored
- * in a supplemental table and are handled later. */
-
- op_size = ia32_decode_operand( buf, buf_len, insn, raw_insn->dest,
- raw_insn->dest_flag, prefixes, modrm );
- /* advance buffer, increase size if necessary */
- buf += op_size;
- buf_len -= op_size;
- size = op_size;
-
- op_size = ia32_decode_operand( buf, buf_len, insn, raw_insn->src,
- raw_insn->src_flag, prefixes, modrm );
- buf += op_size;
- buf_len -= op_size;
- size += op_size;
-
- op_size = ia32_decode_operand( buf, buf_len, insn, raw_insn->aux,
- raw_insn->aux_flag, prefixes, modrm );
- size += op_size;
-
-
- /* ++++ 3. Decode Implicit Operands */
- /* apply implicit operands */
- ia32_insn_implicit_ops( insn, raw_insn->implicit_ops );
- /* we have one small inelegant hack here, to deal with
- * the two prefixes that have implicit operands. If Intel
- * adds more, we'll change the algorithm to suit :) */
- if ( (prefixes & PREFIX_REPZ) || (prefixes & PREFIX_REPNZ) ) {
- ia32_insn_implicit_ops( insn, IDX_IMPLICIT_REP );
- }
-
-
- /* 16-bit hack: foreach operand, if 32-bit reg, make 16-bit reg */
- if ( insn->op_size == 2 ) {
- x86_operand_foreach( insn, reg_32_to_16, NULL, op_any );
- }
-
- return size;
-}
-
-
-/* convenience routine */
-#define USES_MOD_RM(flag) \
- (flag == ADDRMETH_E || flag == ADDRMETH_M || flag == ADDRMETH_Q || \
- flag == ADDRMETH_W || flag == ADDRMETH_R)
-
-static int uses_modrm_flag( unsigned int flag ) {
- unsigned int meth;
- if ( flag == ARG_NONE ) {
- return 0;
- }
- meth = (flag & ADDRMETH_MASK);
- if ( USES_MOD_RM(meth) ) {
- return 1;
- }
-
- return 0;
-}
-
-/* This routine performs the actual byte-by-byte opcode table lookup.
- * Originally it was pretty simple: get a byte, adjust it to a proper
- * index into the table, then check the table row at that index to
- * determine what to do next. But is anything that simple with Intel?
- * This is now a huge, convoluted mess, mostly of bitter comments. */
-/* buf: pointer to next byte to read from stream
- * buf_len: length of buf
- * table: index of table to use for lookups
- * raw_insn: output pointer that receives opcode definition
- * prefixes: output integer that is encoded with prefixes in insn
- * returns : number of bytes consumed from stream during lookup */
-size_t ia32_table_lookup( unsigned char *buf, size_t buf_len,
- unsigned int table, ia32_insn_t **raw_insn,
- unsigned int *prefixes ) {
- unsigned char *next, op = buf[0]; /* byte value -- 'opcode' */
- size_t size = 1, sub_size = 0, next_len;
- ia32_table_desc_t *table_desc;
- unsigned int subtable, prefix = 0, recurse_table = 0;
-
- table_desc = &ia32_tables[table];
-
- op = GET_BYTE( buf, buf_len );
-
- if ( table_desc->type == tbl_fpu && op > table_desc->maxlim) {
- /* one of the fucking FPU tables out of the 00-BH range */
- /* OK,. this is a bit of a hack -- the proper way would
- * have been to use subtables in the 00-BF FPU opcode tables,
- * but that is rather wasteful of space... */
- table_desc = &ia32_tables[table +1];
- }
-
- /* PERFORM TABLE LOOKUP */
-
- /* ModR/M trick: shift extension bits into lowest bits of byte */
- /* Note: non-ModR/M tables have a shift value of 0 */
- op >>= table_desc->shift;
-
- /* ModR/M trick: mask out high bits to turn extension into an index */
- /* Note: non-ModR/M tables have a mask value of 0xFF */
- op &= table_desc->mask;
-
-
- /* Sparse table trick: check that byte is <= max value */
- /* Note: full (256-entry) tables have a maxlim of 155 */
- if ( op > table_desc->maxlim ) {
- /* this is a partial table, truncated at the tail,
- and op is out of range! */
- return INVALID_INSN;
- }
-
- /* Sparse table trick: check that byte is >= min value */
- /* Note: full (256-entry) tables have a minlim of 0 */
- if ( table_desc->minlim > op ) {
- /* this is a partial table, truncated at the head,
- and op is out of range! */
- return INVALID_INSN;
- }
- /* adjust op to be an offset from table index 0 */
- op -= table_desc->minlim;
-
- /* Yay! 'op' is now fully adjusted to be an index into 'table' */
- *raw_insn = &(table_desc->table[op]);
- //printf("BYTE %X TABLE %d OP %X\n", buf[0], table, op );
-
- if ( (*raw_insn)->mnem_flag & INS_FLAG_PREFIX ) {
- prefix = (*raw_insn)->mnem_flag & PREFIX_MASK;
- }
-
-
- /* handle escape to a multibyte/coproc/extension/etc table */
- /* NOTE: if insn is a prefix and has a subtable, then we
- * only recurse if this is the first prefix byte --
- * that is, if *prefixes is 0.
- * NOTE also that suffix tables are handled later */
- subtable = (*raw_insn)->table;
-
- if ( subtable && ia32_tables[subtable].type != tbl_suffix &&
- (! prefix || ! *prefixes) ) {
-
- if ( ia32_tables[subtable].type == tbl_ext_ext ||
- ia32_tables[subtable].type == tbl_fpu_ext ) {
- /* opcode extension: reuse current byte in buffer */
- next = buf;
- next_len = buf_len;
- } else {
- /* "normal" opcode: advance to next byte in buffer */
- if ( buf_len > 1 ) {
- next = &buf[1];
- next_len = buf_len - 1;
- }
- else {
- // buffer is truncated
- return INVALID_INSN;
- }
- }
- /* we encountered a multibyte opcode: recurse using the
- * table specified in the opcode definition */
- sub_size = ia32_table_lookup( next, next_len, subtable,
- raw_insn, prefixes );
-
- /* SSE/prefix hack: if the original opcode def was a
- * prefix that specified a subtable, and the subtable
- * lookup returned a valid insn, then we have encountered
- * an SSE opcode definition; otherwise, we pretend we
- * never did the subtable lookup, and deal with the
- * prefix normally later */
- if ( prefix && ( sub_size == INVALID_INSN ||
- INS_TYPE((*raw_insn)->mnem_flag) == INS_INVALID ) ) {
- /* this is a prefix, not an SSE insn :
- * lookup next byte in main table,
- * subsize will be reset during the
- * main table lookup */
- recurse_table = 1;
- } else {
- /* this is either a subtable (two-byte) insn
- * or an invalid insn: either way, set prefix
- * to NULL and end the opcode lookup */
- prefix = 0;
- // short-circuit lookup on invalid insn
- if (sub_size == INVALID_INSN) return INVALID_INSN;
- }
- } else if ( prefix ) {
- recurse_table = 1;
- }
-
- /* by default, we assume that we have the opcode definition,
- * and there is no need to recurse on the same table, but
- * if we do then a prefix was encountered... */
- if ( recurse_table ) {
- /* this must have been a prefix: use the same table for
- * lookup of the next byte */
- sub_size = ia32_table_lookup( &buf[1], buf_len - 1, table,
- raw_insn, prefixes );
-
- // short-circuit lookup on invalid insn
- if (sub_size == INVALID_INSN) return INVALID_INSN;
-
- /* a bit of a hack for branch hints */
- if ( prefix & BRANCH_HINT_MASK ) {
- if ( INS_GROUP((*raw_insn)->mnem_flag) == INS_EXEC ) {
- /* segment override prefixes are invalid for
- * all branch instructions, so delete them */
- prefix &= ~PREFIX_REG_MASK;
- } else {
- prefix &= ~BRANCH_HINT_MASK;
- }
- }
-
- /* apply prefix to instruction */
-
- /* TODO: implement something enforcing prefix groups */
- (*prefixes) |= prefix;
- }
-
- /* if this lookup was in a ModR/M table, then an opcode byte is
- * NOT consumed: subtract accordingly. NOTE that if none of the
- * operands used the ModR/M, then we need to consume the byte
- * here, but ONLY in the 'top-level' opcode extension table */
-
- if ( table_desc->type == tbl_ext_ext ) {
- /* extensions-to-extensions never consume a byte */
- --size;
- } else if ( (table_desc->type == tbl_extension ||
- table_desc->type == tbl_fpu ||
- table_desc->type == tbl_fpu_ext ) &&
- /* extensions that have an operand encoded in ModR/M
- * never consume a byte */
- (uses_modrm_flag((*raw_insn)->dest_flag) ||
- uses_modrm_flag((*raw_insn)->src_flag) ) ) {
- --size;
- }
-
- size += sub_size;
-
- return size;
-}
-
-static size_t handle_insn_suffix( unsigned char *buf, size_t buf_len,
- ia32_insn_t *raw_insn, x86_insn_t * insn ) {
- ia32_insn_t *sfx_insn;
- size_t size;
- unsigned int prefixes = 0;
-
- size = ia32_table_lookup( buf, buf_len, raw_insn->table, &sfx_insn,
- &prefixes );
- if (size == INVALID_INSN || sfx_insn->mnem_flag == INS_INVALID ) {
- return 0;
- }
-
- strncpy( insn->mnemonic, sfx_insn->mnemonic, 16 );
- handle_insn_metadata( insn, sfx_insn );
-
- return 1;
-}
-
-/* invalid instructions are handled by returning 0 [error] from the
- * function, setting the size of the insn to 1 byte, and copying
- * the byte at the start of the invalid insn into the x86_insn_t.
- * if the caller is saving the x86_insn_t for invalid instructions,
- * instead of discarding them, this will maintain a consistent
- * address space in the x86_insn_ts */
-
-/* this function is called by the controlling disassembler, so its name and
- * calling convention cannot be changed */
-/* buf points to the loc of the current opcode (start of the
- * instruction) in the instruction stream. The instruction
- * stream is assumed to be a buffer of bytes read directly
- * from the file for the purpose of disassembly; a mem-mapped
- * file is ideal for * this.
- * insn points to a code structure to be filled by instr_decode
- * returns the size of the decoded instruction in bytes */
-size_t ia32_disasm_addr( unsigned char * buf, size_t buf_len,
- x86_insn_t *insn ) {
- ia32_insn_t *raw_insn = NULL;
- unsigned int prefixes = 0;
- size_t size, sfx_size;
-
- if ( (ia32_settings.options & opt_ignore_nulls) && buf_len > 3 &&
- !buf[0] && !buf[1] && !buf[2] && !buf[3]) {
- /* IF IGNORE_NULLS is set AND
- * first 4 bytes in the intruction stream are NULL
- * THEN return 0 (END_OF_DISASSEMBLY) */
- /* TODO: set errno */
- MAKE_INVALID( insn, buf );
- return 0; /* 4 00 bytes in a row? This isn't code! */
- }
-
- /* Perform recursive table lookup starting with main table (0) */
- size = ia32_table_lookup(buf, buf_len, idx_Main, &raw_insn, &prefixes);
- if ( size == INVALID_INSN || size > buf_len || raw_insn->mnem_flag == INS_INVALID ) {
- MAKE_INVALID( insn, buf );
- /* TODO: set errno */
- return 0;
- }
-
- /* We now have the opcode itself figured out: we can decode
- * the rest of the instruction. */
- size += ia32_decode_insn( &buf[size], buf_len - size, raw_insn, insn,
- prefixes );
- if ( raw_insn->mnem_flag & INS_FLAG_SUFFIX ) {
- /* AMD 3DNow! suffix -- get proper operand type here */
- sfx_size = handle_insn_suffix( &buf[size], buf_len - size,
- raw_insn, insn );
- if (! sfx_size ) {
- /* TODO: set errno */
- MAKE_INVALID( insn, buf );
- return 0;
- }
-
- size += sfx_size;
- }
-
- if (! size ) {
- /* invalid insn */
- MAKE_INVALID( insn, buf );
- return 0;
- }
-
-
- insn->size = size;
- return size; /* return size of instruction in bytes */
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.h
deleted file mode 100644
index d3f36c3b20..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_insn.h
+++ /dev/null
@@ -1,506 +0,0 @@
-#ifndef IA32_INSN_H
-#define IA32_INSN_H
-/* this file contains the structure of opcode definitions and the
- * constants they use */
-
-#include <sys/types.h>
-#include "libdis.h"
-
-
-#define GET_BYTE( buf, buf_len ) buf_len ? *buf : 0
-
-#define OP_SIZE_16 1
-#define OP_SIZE_32 2
-#define ADDR_SIZE_16 4
-#define ADDR_SIZE_32 8
-
-#define MAX_INSTRUCTION_SIZE 20
-
-/* invalid instructions are handled by returning 0 [error] from the
- * function, setting the size of the insn to 1 byte, and copying
- * the byte at the start of the invalid insn into the x86_insn_t.
- * if the caller is saving the x86_insn_t for invalid instructions,
- * instead of discarding them, this will maintain a consistent
- * address space in the x86_insn_ts */
-
-#define INVALID_INSN ((size_t) -1) /* return value for invalid insn */
-#define MAKE_INVALID( i, buf ) \
- strcpy( i->mnemonic, "invalid" ); \
- x86_oplist_free( i ); \
- i->size = 1; \
- i->group = insn_none; \
- i->type = insn_invalid; \
- memcpy( i->bytes, buf, 1 );
-
-
-size_t ia32_disasm_addr( unsigned char * buf, size_t buf_len,
- x86_insn_t *insn);
-
-
-/* --------------------------------------------------------- Table Lookup */
-/* IA32 Instruction defintion for ia32_opcodes.c */
-typedef struct {
- unsigned int table; /* escape to this sub-table */
- unsigned int mnem_flag; /* Flags referring to mnemonic */
- unsigned int notes; /* Notes for this instruction */
- unsigned int dest_flag, src_flag, aux_flag; /* and for specific operands */
- unsigned int cpu; /* minimumCPU [AND with clocks?? */
- char mnemonic[16]; /* buffers for building instruction */
- char mnemonic_att[16]; /* at&t style mnemonic name */
- int32_t dest;
- int32_t src;
- int32_t aux;
- unsigned int flags_effected;
- unsigned int implicit_ops; /* implicit operands */
-} ia32_insn_t;
-
-
-
-/* --------------------------------------------------------- Prefixes */
-/* Prefix Flags */
-/* Prefixes, same order as in the manual */
-/* had to reverse the values of the first three as they were entered into
- * libdis.h incorrectly. */
-#define PREFIX_LOCK 0x0004
-#define PREFIX_REPNZ 0x0002
-#define PREFIX_REPZ 0x0001
-#define PREFIX_OP_SIZE 0x0010
-#define PREFIX_ADDR_SIZE 0x0020
-#define PREFIX_CS 0x0100
-#define PREFIX_SS 0x0200
-#define PREFIX_DS 0x0300
-#define PREFIX_ES 0x0400
-#define PREFIX_FS 0x0500
-#define PREFIX_GS 0x0600
-#define PREFIX_TAKEN 0x1000 /* branch taken */
-#define PREFIX_NOTTAKEN 0x2000 /* branch not taken */
-#define PREFIX_REG_MASK 0x0F00
-#define BRANCH_HINT_MASK 0x3000
-#define PREFIX_PRINT_MASK 0x000F /* printable prefixes */
-#define PREFIX_MASK 0xFFFF
-
-/* ---------------------------------------------------------- CPU Type */
-
-#define cpu_8086 0x0001
-#define cpu_80286 0x0002
-#define cpu_80386 0x0003
-#define cpu_80387 0x0004 /* originally these were a co-proc */
-#define cpu_80486 0x0005
-#define cpu_PENTIUM 0x0006
-#define cpu_PENTPRO 0x0007
-#define cpu_PENTIUM2 0x0008
-#define cpu_PENTIUM3 0x0009
-#define cpu_PENTIUM4 0x000A
-#define cpu_K6 0x0010
-#define cpu_K7 0x0020
-#define cpu_ATHLON 0x0030
-#define CPU_MODEL_MASK 0xFFFF
-#define CPU_MODEL(cpu) (cpu & CPU_MODEL_MASK)
-/* intel instruction subsets */
-#define isa_GP 0x10000 /* General Purpose Instructions */
-#define isa_FPU 0x20000 /* FPU instructions */
-#define isa_FPUMGT 0x30000 /* FPU/SIMD Management */
-#define isa_MMX 0x40000 /* MMX */
-#define isa_SSE1 0x50000 /* SSE */
-#define isa_SSE2 0x60000 /* SSE 2 */
-#define isa_SSE3 0x70000 /* SSE 3 */
-#define isa_3DNOW 0x80000 /* AMD 3d Now */
-#define isa_SYS 0x90000 /* System Instructions */
-#define ISA_SUBSET_MASK 0xFFFF0000
-#define ISA_SUBSET(isa) (isa & ISA_SUBSET_MASK)
-
-
-/* ------------------------------------------------------ Operand Decoding */
-#define ARG_NONE 0
-
-/* Using a mask allows us to store info such as OP_SIGNED in the
- * operand flags field */
-#define OPFLAGS_MASK 0x0000FFFF
-
-/* Operand Addressing Methods, per intel manual */
-#define ADDRMETH_MASK 0x00FF0000
-
-/* note: for instructions with implied operands, use no ADDRMETH */
-#define ADDRMETH_A 0x00010000
-#define ADDRMETH_C 0x00020000
-#define ADDRMETH_D 0x00030000
-#define ADDRMETH_E 0x00040000
-#define ADDRMETH_F 0x00050000
-#define ADDRMETH_G 0x00060000
-#define ADDRMETH_I 0x00070000
-#define ADDRMETH_J 0x00080000
-#define ADDRMETH_M 0x00090000
-#define ADDRMETH_O 0x000A0000
-#define ADDRMETH_P 0x000B0000
-#define ADDRMETH_Q 0x000C0000
-#define ADDRMETH_R 0x000D0000
-#define ADDRMETH_S 0x000E0000
-#define ADDRMETH_T 0x000F0000
-#define ADDRMETH_V 0x00100000
-#define ADDRMETH_W 0x00110000
-#define ADDRMETH_X 0x00120000
-#define ADDRMETH_Y 0x00130000
-#define ADDRMETH_RR 0x00140000 /* gen reg hard-coded in opcode */
-#define ADDRMETH_RS 0x00150000 /* seg reg hard-coded in opcode */
-#define ADDRMETH_RT 0x00160000 /* test reg hard-coded in opcode */
-#define ADDRMETH_RF 0x00170000 /* fpu reg hard-coded in opcode */
-#define ADDRMETH_II 0x00180000 /* immediate hard-coded in opcode */
-#define ADDRMETH_PP 0x00190000 /* mm reg ONLY in modr/m field */
-#define ADDRMETH_VV 0x001A0000 /* xmm reg ONLY in mod/rm field */
-
-/* Operand Types, per intel manual */
-#define OPTYPE_MASK 0xFF000000
-
-#define OPTYPE_a 0x01000000 /* BOUND: h:h or w:w */
-#define OPTYPE_b 0x02000000 /* byte */
-#define OPTYPE_c 0x03000000 /* byte or word */
-#define OPTYPE_d 0x04000000 /* word */
-#define OPTYPE_dq 0x05000000 /* qword */
-#define OPTYPE_p 0x06000000 /* 16:16 or 16:32 pointer */
-#define OPTYPE_pi 0x07000000 /* dword MMX reg */
-#define OPTYPE_ps 0x08000000 /* 128-bit single fp */
-#define OPTYPE_q 0x09000000 /* dword */
-#define OPTYPE_s 0x0A000000 /* 6-byte descriptor */
-#define OPTYPE_ss 0x0B000000 /* scalar of 128-bit single fp */
-#define OPTYPE_si 0x0C000000 /* word general register */
-#define OPTYPE_v 0x0D000000 /* hword or word */
-#define OPTYPE_w 0x0E000000 /* hword */
-#define OPTYPE_m 0x0F000000 /* to handle LEA */
-#define OPTYPE_none 0xFF000000 /* no valid operand size, INVLPG */
-
-/* custom ones for FPU instructions */
-#define OPTYPE_fs 0x10000000 /* pointer to single-real*/
-#define OPTYPE_fd 0x20000000 /* pointer to double real */
-#define OPTYPE_fe 0x30000000 /* pointer to extended real */
-#define OPTYPE_fb 0x40000000 /* pointer to packed BCD */
-#define OPTYPE_fv 0x50000000 /* pointer to FPU env: 14|28-bytes */
-#define OPTYPE_ft 0x60000000 /* pointer to FPU state: 94|108-bytes */
-#define OPTYPE_fx 0x70000000 /* pointer to FPU regs: 512 bites */
-#define OPTYPE_fp 0x80000000 /* general fpu register: dbl ext */
-
-/* SSE2 operand types */
-#define OPTYPE_sd 0x90000000 /* scalar of 128-bit double fp */
-#define OPTYPE_pd 0xA0000000 /* 128-bit double fp */
-
-
-
-/* ---------------------------------------------- Opcode Table Descriptions */
-/* the table type describes how to handle byte/size increments before
- * and after lookup. Some tables re-use the current byte, others
- * consume a byte only if the ModR/M encodes no operands, etc */
-enum ia32_tbl_type_id {
- tbl_opcode = 0, /* standard opcode table: no surprises */
- tbl_prefix, /* Prefix Override, e.g. 66/F2/F3 */
- tbl_suffix, /* 3D Now style */
- tbl_extension, /* ModR/M extension: 00-FF -> 00-07 */
- tbl_ext_ext, /* extension of modr/m using R/M field */
- tbl_fpu, /* fpu table: 00-BF -> 00-0F */
- tbl_fpu_ext /* fpu extension : C0-FF -> 00-1F */
- };
-
-/* How it works:
- * Bytes are 'consumed' if the next table lookup requires that the byte
- * pointer be advanced in the instruction stream. 'Does not consume' means
- * that, when the lookup function recurses, the same byte it re-used in the
- * new table. It also means that size is not decremented, for example when
- * a ModR/M byte is used. Note that tbl_extension (ModR/M) instructions that
- * do not increase the size of an insn with their operands have a forced
- 3 size increase in the lookup algo. Weird, yes, confusing, yes, welcome
- * to the Intel ISA. Another note: tbl_prefix is used as an override, so an
- * empty insn in a prefix table causes the instruction in the original table
- * to be used, rather than an invalid insn being generated.
- * tbl_opcode uses current byte and consumes it
- * tbl_prefix uses current byte but does not consume it
- * tbl_suffix uses and consumes last byte in insn
- * tbl_extension uses current byte but does not consume it
- * tbl_ext_ext uses current byte but does not consume it
- * tbl_fpu uses current byte and consumes it
- * tbl_fpu_ext uses current byte but does not consume it
- */
-
-/* Convenience struct for opcode tables : these will be stored in a
- * 'table of tables' so we can use a table index instead of a pointer */
-typedef struct { /* Assembly instruction tables */
- ia32_insn_t *table; /* Pointer to table of instruction encodings */
- enum ia32_tbl_type_id type;
- unsigned char shift; /* amount to shift modrm byte */
- unsigned char mask; /* bit mask for look up */
- unsigned char minlim,maxlim; /* limits on min/max entries. */
-} ia32_table_desc_t;
-
-
-/* ---------------------------------------------- 'Cooked' Operand Type Info */
-/* Permissions: */
-#define OP_R 0x001 /* operand is READ */
-#define OP_W 0x002 /* operand is WRITTEN */
-#define OP_RW 0x003 /* (OP_R|OP_W): convenience macro */
-#define OP_X 0x004 /* operand is EXECUTED */
-
-#define OP_PERM_MASK 0x0000007 /* perms are NOT mutually exclusive */
-#define OP_PERM( type ) (type & OP_PERM_MASK)
-
-/* Flags */
-#define OP_SIGNED 0x010 /* operand is signed */
-
-#define OP_FLAG_MASK 0x0F0 /* mods are NOT mutually exclusive */
-#define OP_FLAGS( type ) (type & OP_FLAG_MASK)
-
-#define OP_REG_MASK 0x0000FFFF /* lower WORD is register ID */
-#define OP_REGTBL_MASK 0xFFFF0000 /* higher word is register type [gen/dbg] */
-#define OP_REGID( type ) (type & OP_REG_MASK)
-#define OP_REGTYPE( type ) (type & OP_REGTBL_MASK)
-
-/* ------------------------------------------'Cooked' Instruction Type Info */
-/* high-bit opcode types/insn meta-types */
-#define INS_FLAG_PREFIX 0x10000000 /* insn is a prefix */
-#define INS_FLAG_SUFFIX 0x20000000 /* followed by a suffix byte */
-#define INS_FLAG_MASK 0xFF000000
-
-/* insn notes */
-#define INS_NOTE_RING0 0x00000001 /* insn is privileged */
-#define INS_NOTE_SMM 0x00000002 /* Sys Mgt Mode only */
-#define INS_NOTE_SERIAL 0x00000004 /* serializes */
-#define INS_NOTE_NONSWAP 0x00000008 /* insn is not swapped in att format */ // could be separate field?
-#define INS_NOTE_NOSUFFIX 0x00000010 /* insn has no size suffix in att format */ // could be separate field?
-//#define INS_NOTE_NMI
-
-#define INS_INVALID 0
-
-/* instruction groups */
-#define INS_EXEC 0x1000
-#define INS_ARITH 0x2000
-#define INS_LOGIC 0x3000
-#define INS_STACK 0x4000
-#define INS_COND 0x5000
-#define INS_LOAD 0x6000
-#define INS_ARRAY 0x7000
-#define INS_BIT 0x8000
-#define INS_FLAG 0x9000
-#define INS_FPU 0xA000
-#define INS_TRAPS 0xD000
-#define INS_SYSTEM 0xE000
-#define INS_OTHER 0xF000
-
-#define INS_GROUP_MASK 0xF000
-#define INS_GROUP( type ) ( type & INS_GROUP_MASK )
-
-/* INS_EXEC group */
-#define INS_BRANCH (INS_EXEC | 0x01) /* Unconditional branch */
-#define INS_BRANCHCC (INS_EXEC | 0x02) /* Conditional branch */
-#define INS_CALL (INS_EXEC | 0x03) /* Jump to subroutine */
-#define INS_CALLCC (INS_EXEC | 0x04) /* Jump to subroutine */
-#define INS_RET (INS_EXEC | 0x05) /* Return from subroutine */
-
-/* INS_ARITH group */
-#define INS_ADD (INS_ARITH | 0x01)
-#define INS_SUB (INS_ARITH | 0x02)
-#define INS_MUL (INS_ARITH | 0x03)
-#define INS_DIV (INS_ARITH | 0x04)
-#define INS_INC (INS_ARITH | 0x05) /* increment */
-#define INS_DEC (INS_ARITH | 0x06) /* decrement */
-#define INS_SHL (INS_ARITH | 0x07) /* shift right */
-#define INS_SHR (INS_ARITH | 0x08) /* shift left */
-#define INS_ROL (INS_ARITH | 0x09) /* rotate left */
-#define INS_ROR (INS_ARITH | 0x0A) /* rotate right */
-#define INS_MIN (INS_ARITH | 0x0B) /* min func */
-#define INS_MAX (INS_ARITH | 0x0C) /* max func */
-#define INS_AVG (INS_ARITH | 0x0D) /* avg func */
-#define INS_FLR (INS_ARITH | 0x0E) /* floor func */
-#define INS_CEIL (INS_ARITH | 0x0F) /* ceiling func */
-
-/* INS_LOGIC group */
-#define INS_AND (INS_LOGIC | 0x01)
-#define INS_OR (INS_LOGIC | 0x02)
-#define INS_XOR (INS_LOGIC | 0x03)
-#define INS_NOT (INS_LOGIC | 0x04)
-#define INS_NEG (INS_LOGIC | 0x05)
-#define INS_NAND (INS_LOGIC | 0x06)
-
-/* INS_STACK group */
-#define INS_PUSH (INS_STACK | 0x01)
-#define INS_POP (INS_STACK | 0x02)
-#define INS_PUSHREGS (INS_STACK | 0x03) /* push register context */
-#define INS_POPREGS (INS_STACK | 0x04) /* pop register context */
-#define INS_PUSHFLAGS (INS_STACK | 0x05) /* push all flags */
-#define INS_POPFLAGS (INS_STACK | 0x06) /* pop all flags */
-#define INS_ENTER (INS_STACK | 0x07) /* enter stack frame */
-#define INS_LEAVE (INS_STACK | 0x08) /* leave stack frame */
-
-/* INS_COND group */
-#define INS_TEST (INS_COND | 0x01)
-#define INS_CMP (INS_COND | 0x02)
-
-/* INS_LOAD group */
-#define INS_MOV (INS_LOAD | 0x01)
-#define INS_MOVCC (INS_LOAD | 0x02)
-#define INS_XCHG (INS_LOAD | 0x03)
-#define INS_XCHGCC (INS_LOAD | 0x04)
-#define INS_CONV (INS_LOAD | 0x05) /* move and convert type */
-
-/* INS_ARRAY group */
-#define INS_STRCMP (INS_ARRAY | 0x01)
-#define INS_STRLOAD (INS_ARRAY | 0x02)
-#define INS_STRMOV (INS_ARRAY | 0x03)
-#define INS_STRSTOR (INS_ARRAY | 0x04)
-#define INS_XLAT (INS_ARRAY | 0x05)
-
-/* INS_BIT group */
-#define INS_BITTEST (INS_BIT | 0x01)
-#define INS_BITSET (INS_BIT | 0x02)
-#define INS_BITCLR (INS_BIT | 0x03)
-
-/* INS_FLAG group */
-#define INS_CLEARCF (INS_FLAG | 0x01) /* clear Carry flag */
-#define INS_CLEARZF (INS_FLAG | 0x02) /* clear Zero flag */
-#define INS_CLEAROF (INS_FLAG | 0x03) /* clear Overflow flag */
-#define INS_CLEARDF (INS_FLAG | 0x04) /* clear Direction flag */
-#define INS_CLEARSF (INS_FLAG | 0x05) /* clear Sign flag */
-#define INS_CLEARPF (INS_FLAG | 0x06) /* clear Parity flag */
-#define INS_SETCF (INS_FLAG | 0x07)
-#define INS_SETZF (INS_FLAG | 0x08)
-#define INS_SETOF (INS_FLAG | 0x09)
-#define INS_SETDF (INS_FLAG | 0x0A)
-#define INS_SETSF (INS_FLAG | 0x0B)
-#define INS_SETPF (INS_FLAG | 0x0C)
-#define INS_TOGCF (INS_FLAG | 0x10) /* toggle */
-#define INS_TOGZF (INS_FLAG | 0x20)
-#define INS_TOGOF (INS_FLAG | 0x30)
-#define INS_TOGDF (INS_FLAG | 0x40)
-#define INS_TOGSF (INS_FLAG | 0x50)
-#define INS_TOGPF (INS_FLAG | 0x60)
-
-/* INS_FPU */
-#define INS_FMOV (INS_FPU | 0x1)
-#define INS_FMOVCC (INS_FPU | 0x2)
-#define INS_FNEG (INS_FPU | 0x3)
-#define INS_FABS (INS_FPU | 0x4)
-#define INS_FADD (INS_FPU | 0x5)
-#define INS_FSUB (INS_FPU | 0x6)
-#define INS_FMUL (INS_FPU | 0x7)
-#define INS_FDIV (INS_FPU | 0x8)
-#define INS_FSQRT (INS_FPU | 0x9)
-#define INS_FCMP (INS_FPU | 0xA)
-#define INS_FCOS (INS_FPU | 0xC) /* cosine */
-#define INS_FLDPI (INS_FPU | 0xD) /* load pi */
-#define INS_FLDZ (INS_FPU | 0xE) /* load 0 */
-#define INS_FTAN (INS_FPU | 0xF) /* tanget */
-#define INS_FSINE (INS_FPU | 0x10) /* sine */
-#define INS_FSYS (INS_FPU | 0x20) /* misc */
-
-/* INS_TRAP */
-#define INS_TRAP (INS_TRAPS | 0x01) /* generate trap */
-#define INS_TRAPCC (INS_TRAPS | 0x02) /* conditional trap gen */
-#define INS_TRET (INS_TRAPS | 0x03) /* return from trap */
-#define INS_BOUNDS (INS_TRAPS | 0x04) /* gen bounds trap */
-#define INS_DEBUG (INS_TRAPS | 0x05) /* gen breakpoint trap */
-#define INS_TRACE (INS_TRAPS | 0x06) /* gen single step trap */
-#define INS_INVALIDOP (INS_TRAPS | 0x07) /* gen invalid insn */
-#define INS_OFLOW (INS_TRAPS | 0x08) /* gen overflow trap */
-#define INS_ICEBP (INS_TRAPS | 0x09) /* ICE breakpoint */
-
-/* INS_SYSTEM */
-#define INS_HALT (INS_SYSTEM | 0x01) /* halt machine */
-#define INS_IN (INS_SYSTEM | 0x02) /* input form port */
-#define INS_OUT (INS_SYSTEM | 0x03) /* output to port */
-#define INS_CPUID (INS_SYSTEM | 0x04) /* identify cpu */
-
-/* INS_OTHER */
-#define INS_NOP (INS_OTHER | 0x01)
-#define INS_BCDCONV (INS_OTHER | 0x02) /* convert to/from BCD */
-#define INS_SZCONV (INS_OTHER | 0x03) /* convert size of operand */
-#define INS_SALC (INS_OTHER | 0x04) /* set %al on carry */
-#define INS_UNKNOWN (INS_OTHER | 0x05)
-
-
-#define INS_TYPE_MASK 0xFFFF
-#define INS_TYPE( type ) ( type & INS_TYPE_MASK )
-
- /* flags effected by instruction */
-#define INS_TEST_CARRY 0x01 /* carry */
-#define INS_TEST_ZERO 0x02 /* zero/equal */
-#define INS_TEST_OFLOW 0x04 /* overflow */
-#define INS_TEST_DIR 0x08 /* direction */
-#define INS_TEST_SIGN 0x10 /* negative */
-#define INS_TEST_PARITY 0x20 /* parity */
-#define INS_TEST_OR 0x40 /* used in jle */
-#define INS_TEST_NCARRY 0x100 /* ! carry */
-#define INS_TEST_NZERO 0x200 /* ! zero */
-#define INS_TEST_NOFLOW 0x400 /* ! oflow */
-#define INS_TEST_NDIR 0x800 /* ! dir */
-#define INS_TEST_NSIGN 0x100 /* ! sign */
-#define INS_TEST_NPARITY 0x2000 /* ! parity */
-/* SF == OF */
-#define INS_TEST_SFEQOF 0x4000
-/* SF != OF */
-#define INS_TEST_SFNEOF 0x8000
-
-#define INS_TEST_ALL INS_TEST_CARRY | INS_TEST_ZERO | \
- INS_TEST_OFLOW | INS_TEST_SIGN | \
- INS_TEST_PARITY
-
-#define INS_SET_CARRY 0x010000 /* carry */
-#define INS_SET_ZERO 0x020000 /* zero/equal */
-#define INS_SET_OFLOW 0x040000 /* overflow */
-#define INS_SET_DIR 0x080000 /* direction */
-#define INS_SET_SIGN 0x100000 /* negative */
-#define INS_SET_PARITY 0x200000 /* parity */
-#define INS_SET_NCARRY 0x1000000
-#define INS_SET_NZERO 0x2000000
-#define INS_SET_NOFLOW 0x4000000
-#define INS_SET_NDIR 0x8000000
-#define INS_SET_NSIGN 0x10000000
-#define INS_SET_NPARITY 0x20000000
-#define INS_SET_SFEQOF 0x40000000
-#define INS_SET_SFNEOF 0x80000000
-
-#define INS_SET_ALL INS_SET_CARRY | INS_SET_ZERO | \
- INS_SET_OFLOW | INS_SET_SIGN | \
- INS_SET_PARITY
-
-#define INS_TEST_MASK 0x0000FFFF
-#define INS_FLAGS_TEST(x) (x & INS_TEST_MASK)
-#define INS_SET_MASK 0xFFFF0000
-#define INS_FLAGS_SET(x) (x & INS_SET_MASK)
-
-#if 0
-/* TODO: actually start using these */
-#define X86_PAIR_NP 1 /* not pairable; execs in U */
-#define X86_PAIR_PU 2 /* pairable in U pipe */
-#define X86_PAIR_PV 3 /* pairable in V pipe */
-#define X86_PAIR_UV 4 /* pairable in UV pipe */
-#define X86_PAIR_FX 5 /* pairable with FXCH */
-
-#define X86_EXEC_PORT_0 1
-#define X86_EXEC_PORT_1 2
-#define X86_EXEC_PORT_2 4
-#define X86_EXEC_PORT_3 8
-#define X86_EXEC_PORT_4 16
-
-#define X86_EXEC_UNITS
-
-typedef struct { /* representation of an insn during decoding */
- uint32_t flags; /* runtime settings */
- /* instruction prefixes and other foolishness */
- uint32_t prefix; /* encoding of prefix */
- char prefix_str[16]; /* mnemonics for prefix */
- uint32_t branch_hint; /* gah! */
- unsigned int cpu_ver; /* TODO: cpu version */
- unsigned int clocks; /* TODO: clock cycles: min/max */
- unsigned char last_prefix;
- /* runtime intruction decoding helpers */
- unsigned char mode; /* 16, 32, 64 */
- unsigned char gen_regs; /* offset of default general reg set */
- unsigned char sz_operand; /* operand size for insn */
- unsigned char sz_address; /* address size for insn */
- unsigned char uops; /* uops per insn */
- unsigned char pairing; /* np,pu,pv.lv */
- unsigned char exec_unit;
- unsigned char exec_port;
- unsigned char latency;
-} ia32_info_t;
-#define MODE_32 0 /* default */
-#define MODE_16 1
-#define MODE_64 2
-#endif
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.c
deleted file mode 100644
index 68ec153d27..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.c
+++ /dev/null
@@ -1,313 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-
-#include "ia32_invariant.h"
-#include "ia32_insn.h"
-#include "ia32_settings.h"
-
-extern ia32_table_desc_t *ia32_tables;
-extern ia32_settings_t ia32_settings;
-
-extern size_t ia32_table_lookup( unsigned char *buf, size_t buf_len,
- unsigned int table, ia32_insn_t **raw_insn,
- unsigned int *prefixes );
-
-
-/* -------------------------------- ModR/M, SIB */
-/* Convenience flags */
-#define MODRM_EA 1 /* ModR/M is an effective addr */
-#define MODRM_reg 2 /* ModR/M is a register */
-
-/* ModR/M flags */
-#define MODRM_RM_SIB 0x04 /* R/M == 100 */
-#define MODRM_RM_NOREG 0x05 /* R/B == 101 */
-/* if (MODRM.MOD_NODISP && MODRM.RM_NOREG) then just disp32 */
-#define MODRM_MOD_NODISP 0x00 /* mod == 00 */
-#define MODRM_MOD_DISP8 0x01 /* mod == 01 */
-#define MODRM_MOD_DISP32 0x02 /* mod == 10 */
-#define MODRM_MOD_NOEA 0x03 /* mod == 11 */
-/* 16-bit modrm flags */
-#define MOD16_MOD_NODISP 0
-#define MOD16_MOD_DISP8 1
-#define MOD16_MOD_DISP16 2
-#define MOD16_MOD_REG 3
-
-#define MOD16_RM_BXSI 0
-#define MOD16_RM_BXDI 1
-#define MOD16_RM_BPSI 2
-#define MOD16_RM_BPDI 3
-#define MOD16_RM_SI 4
-#define MOD16_RM_DI 5
-#define MOD16_RM_BP 6
-#define MOD16_RM_BX 7
-
-/* SIB flags */
-#define SIB_INDEX_NONE 0x04
-#define SIB_BASE_EBP 0x05
-#define SIB_SCALE_NOBASE 0x00
-
-/* Convenience struct for modR/M bitfield */
-struct modRM_byte {
- unsigned int mod : 2;
- unsigned int reg : 3;
- unsigned int rm : 3;
-};
-
-/* Convenience struct for SIB bitfield */
-struct SIB_byte {
- unsigned int scale : 2;
- unsigned int index : 3;
- unsigned int base : 3;
-};
-
-#ifdef WIN32
-static void byte_decode(unsigned char b, struct modRM_byte *modrm) {
-#else
-static inline void byte_decode(unsigned char b, struct modRM_byte *modrm) {
-#endif
- /* generic bitfield-packing routine */
-
- modrm->mod = b >> 6; /* top 2 bits */
- modrm->reg = (b & 56) >> 3; /* middle 3 bits */
- modrm->rm = b & 7; /* bottom 3 bits */
-}
-static int ia32_invariant_modrm( unsigned char *in, unsigned char *out,
- unsigned int mode_16, x86_invariant_op_t *op) {
- struct modRM_byte modrm;
- struct SIB_byte sib;
- unsigned char *c, *cin;
- unsigned short *s;
- unsigned int *i;
- int size = 0; /* modrm byte is already counted */
-
-
- byte_decode(*in, &modrm); /* get bitfields */
-
- out[0] = in[0]; /* save modrm byte */
- cin = &in[1];
- c = &out[1];
- s = (unsigned short *)&out[1];
- i = (unsigned int *)&out[1];
-
- op->type = op_expression;
- op->flags |= op_pointer;
- if ( ! mode_16 && modrm.rm == MODRM_RM_SIB &&
- modrm.mod != MODRM_MOD_NOEA ) {
- size ++;
- byte_decode(*cin, (struct modRM_byte *)(void*)&sib);
-
- out[1] = in[1]; /* save sib byte */
- cin = &in[2];
- c = &out[2];
- s = (unsigned short *)&out[2];
- i = (unsigned int *)&out[2];
-
- if ( sib.base == SIB_BASE_EBP && ! modrm.mod ) {
- /* disp 32 is variant! */
- memset( i, X86_WILDCARD_BYTE, 4 );
- size += 4;
- }
- }
-
- if (! modrm.mod && modrm.rm == 101) {
- if ( mode_16 ) { /* straight RVA in disp */
- memset( s, X86_WILDCARD_BYTE, 2 );
- size += 2;
- } else {
- memset( i, X86_WILDCARD_BYTE, 2 );
- size += 4;
- }
- } else if (modrm.mod && modrm.mod < 3) {
- if (modrm.mod == MODRM_MOD_DISP8) { /* offset in disp */
- *c = *cin;
- size += 1;
- } else if ( mode_16 ) {
- *s = (* ((unsigned short *) cin));
- size += 2;
- } else {
- *i = (*((unsigned int *) cin));
- size += 4;
- }
- } else if ( modrm.mod == 3 ) {
- op->type = op_register;
- op->flags &= ~op_pointer;
- }
-
- return (size);
-}
-
-
-static int ia32_decode_invariant( unsigned char *buf, size_t buf_len,
- ia32_insn_t *t, unsigned char *out,
- unsigned int prefixes, x86_invariant_t *inv) {
-
- unsigned int addr_size, op_size, mode_16;
- unsigned int op_flags[3] = { t->dest_flag, t->src_flag, t->aux_flag };
- int x, type, bytes = 0, size = 0, modrm = 0;
-
- /* set addressing mode */
- if (ia32_settings.options & opt_16_bit) {
- op_size = ( prefixes & PREFIX_OP_SIZE ) ? 4 : 2;
- addr_size = ( prefixes & PREFIX_ADDR_SIZE ) ? 4 : 2;
- mode_16 = ( prefixes & PREFIX_ADDR_SIZE ) ? 0 : 1;
- } else {
- op_size = ( prefixes & PREFIX_OP_SIZE ) ? 2 : 4;
- addr_size = ( prefixes & PREFIX_ADDR_SIZE ) ? 2 : 4;
- mode_16 = ( prefixes & PREFIX_ADDR_SIZE ) ? 1 : 0;
- }
-
- for (x = 0; x < 3; x++) {
- inv->operands[x].access = (enum x86_op_access)
- OP_PERM(op_flags[x]);
- inv->operands[x].flags = (enum x86_op_flags)
- (OP_FLAGS(op_flags[x]) >> 12);
-
- switch (op_flags[x] & OPTYPE_MASK) {
- case OPTYPE_c:
- size = (op_size == 4) ? 2 : 1;
- break;
- case OPTYPE_a: case OPTYPE_v:
- size = (op_size == 4) ? 4 : 2;
- break;
- case OPTYPE_p:
- size = (op_size == 4) ? 6 : 4;
- break;
- case OPTYPE_b:
- size = 1;
- break;
- case OPTYPE_w:
- size = 2;
- break;
- case OPTYPE_d: case OPTYPE_fs: case OPTYPE_fd:
- case OPTYPE_fe: case OPTYPE_fb: case OPTYPE_fv:
- case OPTYPE_si: case OPTYPE_fx:
- size = 4;
- break;
- case OPTYPE_s:
- size = 6;
- break;
- case OPTYPE_q: case OPTYPE_pi:
- size = 8;
- break;
- case OPTYPE_dq: case OPTYPE_ps: case OPTYPE_ss:
- case OPTYPE_pd: case OPTYPE_sd:
- size = 16;
- break;
- case OPTYPE_m:
- size = (addr_size == 4) ? 4 : 2;
- break;
- default:
- break;
- }
-
- type = op_flags[x] & ADDRMETH_MASK;
- switch (type) {
- case ADDRMETH_E: case ADDRMETH_M: case ADDRMETH_Q:
- case ADDRMETH_R: case ADDRMETH_W:
- modrm = 1;
- bytes += ia32_invariant_modrm( buf, out,
- mode_16, &inv->operands[x]);
- break;
- case ADDRMETH_C: case ADDRMETH_D: case ADDRMETH_G:
- case ADDRMETH_P: case ADDRMETH_S: case ADDRMETH_T:
- case ADDRMETH_V:
- inv->operands[x].type = op_register;
- modrm = 1;
- break;
- case ADDRMETH_A: case ADDRMETH_O:
- /* pad with xF4's */
- memset( &out[bytes + modrm], X86_WILDCARD_BYTE,
- size );
- bytes += size;
- inv->operands[x].type = op_offset;
- if ( type == ADDRMETH_O ) {
- inv->operands[x].flags |= op_signed |
- op_pointer;
- }
- break;
- case ADDRMETH_I: case ADDRMETH_J:
- /* grab imm value */
- if ((op_flags[x] & OPTYPE_MASK) == OPTYPE_v) {
- /* assume this is an address */
- memset( &out[bytes + modrm],
- X86_WILDCARD_BYTE, size );
- } else {
- memcpy( &out[bytes + modrm],
- &buf[bytes + modrm], size );
- }
-
- bytes += size;
- if ( type == ADDRMETH_J ) {
- if ( size == 1 ) {
- inv->operands[x].type =
- op_relative_near;
- } else {
- inv->operands[x].type =
- op_relative_far;
- }
- inv->operands[x].flags |= op_signed;
- } else {
- inv->operands[x].type = op_immediate;
- }
- break;
- case ADDRMETH_F:
- inv->operands[x].type = op_register;
- break;
- case ADDRMETH_X:
- inv->operands[x].flags |= op_signed |
- op_pointer | op_ds_seg | op_string;
- break;
- case ADDRMETH_Y:
- inv->operands[x].flags |= op_signed |
- op_pointer | op_es_seg | op_string;
- break;
- case ADDRMETH_RR:
- inv->operands[x].type = op_register;
- break;
- case ADDRMETH_II:
- inv->operands[x].type = op_immediate;
- break;
- default:
- inv->operands[x].type = op_unused;
- break;
- }
- }
-
- return (bytes + modrm);
-}
-
-size_t ia32_disasm_invariant( unsigned char * buf, size_t buf_len,
- x86_invariant_t *inv ) {
- ia32_insn_t *raw_insn = NULL;
- unsigned int prefixes;
- unsigned int type;
- size_t size;
-
- /* Perform recursive table lookup starting with main table (0) */
- size = ia32_table_lookup( buf, buf_len, 0, &raw_insn, &prefixes );
- if ( size == INVALID_INSN || size > buf_len ) {
- /* TODO: set errno */
- return 0;
- }
-
- /* copy opcode bytes to buffer */
- memcpy( inv->bytes, buf, size );
-
- /* set mnemonic type and group */
- type = raw_insn->mnem_flag & ~INS_FLAG_MASK;
- inv->group = (enum x86_insn_group) (INS_GROUP(type)) >> 12;
- inv->type = (enum x86_insn_type) INS_TYPE(type);
-
- /* handle operands */
- size += ia32_decode_invariant( buf + size, buf_len - size, raw_insn,
- &buf[size - 1], prefixes, inv );
-
- inv->size = size;
-
- return size; /* return size of instruction in bytes */
-}
-
-size_t ia32_disasm_size( unsigned char *buf, size_t buf_len ) {
- x86_invariant_t inv = { {0} };
- return( ia32_disasm_invariant( buf, buf_len, &inv ) );
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.h
deleted file mode 100644
index e1cea60e9d..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_invariant.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef IA32_INVARIANT_H
-#define IA32_INVARIANT_H
-
-#include "libdis.h"
-
-size_t ia32_disasm_invariant( unsigned char *buf, size_t buf_len,
- x86_invariant_t *inv);
-
-size_t ia32_disasm_size( unsigned char *buf, size_t buf_len );
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.c
deleted file mode 100644
index b0fe2ed3d3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.c
+++ /dev/null
@@ -1,310 +0,0 @@
-#include "ia32_modrm.h"
-#include "ia32_reg.h"
-#include "x86_imm.h"
-
-/* NOTE: when decoding ModR/M and SIB, we have to add 1 to all register
- * values obtained from decoding the ModR/M or SIB byte, since they
- * are encoded with eAX = 0 and the tables in ia32_reg.c use eAX = 1.
- * ADDENDUM: this is only the case when the register value is used
- * directly as an index into the register table, not when it is added to
- * a genregs offset. */
-
-/* -------------------------------- ModR/M, SIB */
-/* ModR/M flags */
-#define MODRM_RM_SIB 0x04 /* R/M == 100 */
-#define MODRM_RM_NOREG 0x05 /* R/B == 101 */
-
-/* if (MODRM.MOD_NODISP && MODRM.RM_NOREG) then just disp32 */
-#define MODRM_MOD_NODISP 0x00 /* mod == 00 */
-#define MODRM_MOD_DISP8 0x01 /* mod == 01 */
-#define MODRM_MOD_DISP32 0x02 /* mod == 10 */
-#define MODRM_MOD_NOEA 0x03 /* mod == 11 */
-
-/* 16-bit modrm flags */
-#define MOD16_MOD_NODISP 0
-#define MOD16_MOD_DISP8 1
-#define MOD16_MOD_DISP16 2
-#define MOD16_MOD_REG 3
-
-#define MOD16_RM_BXSI 0
-#define MOD16_RM_BXDI 1
-#define MOD16_RM_BPSI 2
-#define MOD16_RM_BPDI 3
-#define MOD16_RM_SI 4
-#define MOD16_RM_DI 5
-#define MOD16_RM_BP 6
-#define MOD16_RM_BX 7
-
-/* SIB flags */
-#define SIB_INDEX_NONE 0x04
-#define SIB_BASE_EBP 0x05
-#define SIB_SCALE_NOBASE 0x00
-
-/* Convenience struct for modR/M bitfield */
-struct modRM_byte {
- unsigned int mod : 2;
- unsigned int reg : 3;
- unsigned int rm : 3;
-};
-
-/* Convenience struct for SIB bitfield */
-struct SIB_byte {
- unsigned int scale : 2;
- unsigned int index : 3;
- unsigned int base : 3;
-};
-
-
-#if 0
-int modrm_rm[] = {0,1,2,3,MODRM_RM_SIB,MODRM_MOD_DISP32,6,7};
-int modrm_reg[] = {0, 1, 2, 3, 4, 5, 6, 7};
-int modrm_mod[] = {0, MODRM_MOD_DISP8, MODRM_MOD_DISP32, MODRM_MOD_NOEA};
-int sib_scl[] = {0, 2, 4, 8};
-int sib_idx[] = {0, 1, 2, 3, SIB_INDEX_NONE, 5, 6, 7 };
-int sib_bas[] = {0, 1, 2, 3, 4, SIB_SCALE_NOBASE, 6, 7 };
-#endif
-
-/* this is needed to replace x86_imm_signsized() which does not sign-extend
- * to dest */
-static unsigned int imm32_signsized( unsigned char *buf, size_t buf_len,
- int32_t *dest, unsigned int size ) {
- if ( size > buf_len ) {
- return 0;
- }
-
- switch (size) {
- case 1:
- *dest = *((signed char *) buf);
- break;
- case 2:
- *dest = *((signed short *) buf);
- break;
- case 4:
- default:
- *dest = *((signed int *) buf);
- break;
- }
-
- return size;
-}
-
-
-
-static void byte_decode(unsigned char b, struct modRM_byte *modrm) {
- /* generic bitfield-packing routine */
-
- modrm->mod = b >> 6; /* top 2 bits */
- modrm->reg = (b & 56) >> 3; /* middle 3 bits */
- modrm->rm = b & 7; /* bottom 3 bits */
-}
-
-
-static size_t sib_decode( unsigned char *buf, size_t buf_len, x86_ea_t *ea,
- unsigned int mod ) {
- /* set Address Expression fields (scale, index, base, disp)
- * according to the contents of the SIB byte.
- * b points to the SIB byte in the instruction-stream buffer; the
- * byte after b[0] is therefore the byte after the SIB
- * returns number of bytes 'used', including the SIB byte */
- size_t size = 1; /* start at 1 for SIB byte */
- struct SIB_byte sib;
-
- if ( buf_len < 1 ) {
- return 0;
- }
-
- byte_decode( *buf, (struct modRM_byte *)(void*)&sib ); /* get bit-fields */
-
- if ( sib.base == SIB_BASE_EBP && ! mod ) { /* if base == 101 (ebp) */
- /* IF BASE == EBP, deal with exception */
- /* IF (ModR/M did not create a Disp */
- /* ... create a 32-bit Displacement */
- imm32_signsized( &buf[1], buf_len, &ea->disp, sizeof(int32_t));
- ea->disp_size = sizeof(int32_t);
- ea->disp_sign = (ea->disp < 0) ? 1 : 0;
- size += 4; /* add sizeof disp to count */
-
- } else {
- /* ELSE BASE refers to a General Register */
- ia32_handle_register( &ea->base, sib.base + 1 );
- }
-
- /* set scale to 1, 2, 4, 8 */
- ea->scale = 1 << sib.scale;
-
- if (sib.index != SIB_INDEX_NONE) {
- /* IF INDEX is not 'ESP' (100) */
- ia32_handle_register( &ea->index, sib.index + 1 );
- }
-
- return (size); /* return number of bytes processed */
-}
-
-static size_t modrm_decode16( unsigned char *buf, unsigned int buf_len,
- x86_op_t *op, struct modRM_byte *modrm ) {
- /* 16-bit mode: hackish, but not as hackish as 32-bit mode ;) */
- size_t size = 1; /* # of bytes decoded [1 for modR/M byte] */
- x86_ea_t * ea = &op->data.expression;
-
- switch( modrm->rm ) {
- case MOD16_RM_BXSI:
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 3);
- ia32_handle_register(&ea->index, REG_WORD_OFFSET + 6);
- break;
- case MOD16_RM_BXDI:
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 3);
- ia32_handle_register(&ea->index, REG_WORD_OFFSET + 7);
- case MOD16_RM_BPSI:
- op->flags |= op_ss_seg;
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 5);
- ia32_handle_register(&ea->index, REG_WORD_OFFSET + 6);
- break;
- case MOD16_RM_BPDI:
- op->flags |= op_ss_seg;
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 5);
- ia32_handle_register(&ea->index, REG_WORD_OFFSET + 7);
- break;
- case MOD16_RM_SI:
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 6);
- break;
- case MOD16_RM_DI:
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 7);
- break;
- case MOD16_RM_BP:
- if ( modrm->mod != MOD16_MOD_NODISP ) {
- op->flags |= op_ss_seg;
- ia32_handle_register(&ea->base,
- REG_WORD_OFFSET + 5);
- }
- break;
- case MOD16_RM_BX:
- ia32_handle_register(&ea->base, REG_WORD_OFFSET + 3);
- break;
- }
-
- /* move to byte after ModR/M */
- ++buf;
- --buf_len;
-
- if ( modrm->mod == MOD16_MOD_DISP8 ) {
- imm32_signsized( buf, buf_len, &ea->disp, sizeof(char) );
- ea->disp_sign = (ea->disp < 0) ? 1 : 0;
- ea->disp_size = sizeof(char);
- size += sizeof(char);
- } else if ( modrm->mod == MOD16_MOD_DISP16 ) {
- imm32_signsized( buf, buf_len, &ea->disp, sizeof(short) );
- ea->disp_sign = (ea->disp < 0) ? 1 : 0;
- ea->disp_size = sizeof(short);
- size += sizeof(short);
- }
-
- return size;
-}
-
-/* TODO : Mark index modes
- Use addressing mode flags to imply arrays (index), structure (disp),
- two-dimensional arrays [disp + index], classes [ea reg], and so on.
-*/
-size_t ia32_modrm_decode( unsigned char *buf, unsigned int buf_len,
- x86_op_t *op, x86_insn_t *insn, size_t gen_regs ) {
- /* create address expression and/or fill operand based on value of
- * ModR/M byte. Calls sib_decode as appropriate.
- * flags specifies whether Reg or mod+R/M fields are being decoded
- * returns the number of bytes in the instruction, including modR/M */
- struct modRM_byte modrm;
- size_t size = 1; /* # of bytes decoded [1 for modR/M byte] */
- x86_ea_t * ea;
-
-
- byte_decode(*buf, &modrm); /* get bitfields */
-
- /* first, handle the case where the mod field is a register only */
- if ( modrm.mod == MODRM_MOD_NOEA ) {
- op->type = op_register;
- ia32_handle_register(&op->data.reg, modrm.rm + gen_regs);
- /* increase insn size by 1 for modrm byte */
- return 1;
- }
-
- /* then deal with cases where there is an effective address */
- ea = &op->data.expression;
- op->type = op_expression;
- op->flags |= op_pointer;
-
- if ( insn->addr_size == 2 ) {
- /* gah! 16 bit mode! */
- return modrm_decode16( buf, buf_len, op, &modrm);
- }
-
- /* move to byte after ModR/M */
- ++buf;
- --buf_len;
-
- if (modrm.mod == MODRM_MOD_NODISP) { /* if mod == 00 */
-
- /* IF MOD == No displacement, just Indirect Register */
- if (modrm.rm == MODRM_RM_NOREG) { /* if r/m == 101 */
- /* IF RM == No Register, just Displacement */
- /* This is an Intel Moronic Exception TM */
- imm32_signsized( buf, buf_len, &ea->disp,
- sizeof(int32_t) );
- ea->disp_size = sizeof(int32_t);
- ea->disp_sign = (ea->disp < 0) ? 1 : 0;
- size += 4; /* add sizeof disp to count */
-
- } else if (modrm.rm == MODRM_RM_SIB) { /* if r/m == 100 */
- /* ELSE IF an SIB byte is present */
- /* TODO: check for 0 retval */
- size += sib_decode( buf, buf_len, ea, modrm.mod);
- /* move to byte after SIB for displacement */
- ++buf;
- --buf_len;
- } else { /* modR/M specifies base register */
- /* ELSE RM encodes a general register */
- ia32_handle_register( &ea->base, modrm.rm + 1 );
- }
- } else { /* mod is 01 or 10 */
- if (modrm.rm == MODRM_RM_SIB) { /* rm == 100 */
- /* IF base is an AddrExpr specified by an SIB byte */
- /* TODO: check for 0 retval */
- size += sib_decode( buf, buf_len, ea, modrm.mod);
- /* move to byte after SIB for displacement */
- ++buf;
- --buf_len;
- } else {
- /* ELSE base is a general register */
- ia32_handle_register( &ea->base, modrm.rm + 1 );
- }
-
- /* ELSE mod + r/m specify a disp##[base] or disp##(SIB) */
- if (modrm.mod == MODRM_MOD_DISP8) { /* mod == 01 */
- /* If this is an 8-bit displacement */
- imm32_signsized( buf, buf_len, &ea->disp,
- sizeof(char));
- ea->disp_size = sizeof(char);
- ea->disp_sign = (ea->disp < 0) ? 1 : 0;
- size += 1; /* add sizeof disp to count */
-
- } else {
- /* Displacement is dependent on address size */
- imm32_signsized( buf, buf_len, &ea->disp,
- insn->addr_size);
- ea->disp_size = insn->addr_size;
- ea->disp_sign = (ea->disp < 0) ? 1 : 0;
- size += 4;
- }
- }
-
- return size; /* number of bytes found in instruction */
-}
-
-void ia32_reg_decode( unsigned char byte, x86_op_t *op, size_t gen_regs ) {
- struct modRM_byte modrm;
- byte_decode( byte, &modrm ); /* get bitfields */
-
- /* set operand to register ID */
- op->type = op_register;
- ia32_handle_register(&op->data.reg, modrm.reg + gen_regs);
-
- return;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.h
deleted file mode 100644
index 765cb0833b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_modrm.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef IA32_MODRM_H
-#define IA32_MODRM_H
-
-#include "libdis.h"
-#include "ia32_insn.h"
-
-size_t ia32_modrm_decode( unsigned char *buf, unsigned int buf_len,
- x86_op_t *op, x86_insn_t *insn,
- size_t gen_regs );
-
-void ia32_reg_decode( unsigned char byte, x86_op_t *op, size_t gen_regs );
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.c
deleted file mode 100644
index ef97c7a351..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.c
+++ /dev/null
@@ -1,2939 +0,0 @@
-#include "ia32_insn.h"
-
-#include "ia32_reg.h"
-
-#include "ia32_opcode_tables.h"
-
-static ia32_insn_t tbl_Main[] = { /* One-byte Opcodes */
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_G | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_G | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_PUSH, 0, ADDRMETH_RS | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 0, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RS | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 0, 0, 0, 0 , 33 },
- { 0, INS_OR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_G | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_G | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_PUSH, 0, ADDRMETH_RS | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 1, 0, 0, 0 , 33 },
- { idx_0F, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
-/* 0x10 */
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_ADD, 0, ADDRMETH_G | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_ADD, 0, ADDRMETH_G | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_ADD, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_ADD, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_PUSH, 0, ADDRMETH_RS | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 2, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RS | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 2, 0, 0, 0 , 33 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_G | OPTYPE_b | OP_W | OP_SIGNED | OP_R, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_RR | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_RR | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_PUSH, 0, ADDRMETH_RS | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 3, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RS | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 3, 0, 0, 0 , 33 },
-/* 0x20 */
- { 0, INS_AND, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_AND, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_AND, 0, ADDRMETH_G | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_AND, 0, ADDRMETH_G | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_AND, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_AND, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_ES, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BCDCONV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "daa", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_CARRY|INS_SET_PARITY|INS_TEST_CARRY, 12 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_G | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_RR | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_RR | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_CS | PREFIX_NOTTAKEN, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BCDCONV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "das", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_CARRY|INS_SET_PARITY|INS_TEST_CARRY, 0 },
-/* 0x30 */
- { 0, INS_XOR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_G | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_G | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_SS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BCDCONV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "aaa", "", 0, 0, 0, INS_SET_CARRY, 1 },
- { 0, INS_CMP, 0, ADDRMETH_E | OPTYPE_b | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_G | OPTYPE_b | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_RR | OPTYPE_b | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_DS | PREFIX_TAKEN, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BCDCONV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "aas", "", 0, 0, 0, INS_SET_CARRY, 0 },
-/* 0x40 */
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 1, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 2, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 3, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 4, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 5, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 6, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_INC, 0, ADDRMETH_RR | OPTYPE_v | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 7, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 1, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 2, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 3, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 4, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 5, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 6, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 7, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
-/* 0x50 */
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 0, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 1, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 2, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 3, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 4, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 5, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 6, 0, 0, 0 , 33 },
- { 0, INS_PUSH, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 7, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 0, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 1, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 2, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 3, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 4, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 5, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 6, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 7, 0, 0, 0 , 33 },
-/* 0x60 */
- { 0, INS_PUSHREGS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pusha", "", 0, 0, 0, 0 , 36 },
- { 0, INS_POPREGS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "popa", "", 0, 0, 0, 0 , 34 },
- { 0, INS_BOUNDS, INS_NOTE_NONSWAP, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_M | OPTYPE_a | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bound", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_R | OP_W, ADDRMETH_G | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "arpl", "", 0, 0, 0, INS_SET_ZERO, 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_FS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_GS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_66, INS_FLAG_PREFIX | PREFIX_OP_SIZE, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_FLAG_PREFIX | PREFIX_ADDR_SIZE, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_PUSH, 0, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 0, 0, 0, 0 , 33 },
- { 0, INS_MUL, 0, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_R | OP_W, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, cpu_80386 | isa_GP, "imul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, 0 },
- { 0, INS_PUSH, 0, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 0, 0, 0, 0 , 33 },
- { 0, INS_MUL, 0, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_R | OP_W, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, cpu_80386 | isa_GP, "imul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, 0 },
- { 0, INS_IN, 0, ADDRMETH_Y | OPTYPE_b | OP_W, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ins", "", 0, 2, 0, 0 , 0 },
- { 0, INS_IN, 0, ADDRMETH_Y | OPTYPE_v | OP_W, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ins", "", 0, 2, 0, 0 , 0 },
- { 0, INS_OUT, 0, ADDRMETH_RR | OPTYPE_b | OP_R, ADDRMETH_X | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "outs", "", 2, 0, 0, 0 , 0 },
- { 0, INS_OUT, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ADDRMETH_X | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "outs", "", 2, 0, 0, 0 , 0 },
-/* 0x70 */
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jo", "", 0, 0, 0, INS_TEST_OFLOW, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jno", "", 0, 0, 0, INS_TEST_NOFLOW, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jc", "", 0, 0, 0, INS_TEST_CARRY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jnc", "", 0, 0, 0, INS_TEST_NCARRY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jz", "", 0, 0, 0, INS_TEST_ZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jnz", "", 0, 0, 0, INS_TEST_NZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jbe", "", 0, 0, 0, INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "ja", "", 0, 0, 0, INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "js", "", 0, 0, 0, INS_TEST_SIGN, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jns", "", 0, 0, 0, INS_TEST_NSIGN, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jpe", "", 0, 0, 0, INS_TEST_PARITY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jpo", "", 0, 0, 0, INS_TEST_NPARITY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jl", "", 0, 0, 0, INS_TEST_SFNEOF, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jge", "", 0, 0, 0, INS_TEST_SFEQOF, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jle", "", 0, 0, 0, INS_TEST_ZERO|INS_TEST_OR|INS_TEST_SFNEOF, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jg", "", 0, 0, 0, INS_TEST_NZERO|INS_TEST_SFEQOF, 0 },
-/* 0x80 */
- { idx_80, 0, 0, ADDRMETH_E | OPTYPE_b, ADDRMETH_I | OPTYPE_b, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_81, 0, 0, ADDRMETH_E | OPTYPE_v, ADDRMETH_I | OPTYPE_v, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_82, 0, 0, ADDRMETH_E | OPTYPE_b, ADDRMETH_I | OPTYPE_b, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_83, 0, 0, ADDRMETH_E | OPTYPE_v, ADDRMETH_I | OPTYPE_b, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_TEST, 0, ADDRMETH_E | OPTYPE_b | OP_R, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_TEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XCHG, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_E | OPTYPE_b | OP_W, ADDRMETH_G | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_E | OPTYPE_v | OP_W, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_b | OP_W, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_E | OPTYPE_w | OP_W, ADDRMETH_S | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_M | OPTYPE_m | OP_R, ARG_NONE, cpu_80386 | isa_GP, "lea", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_S | OPTYPE_w | OP_W, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_POP, 0, ADDRMETH_E | OPTYPE_v | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 0, 0, 0, 0 , 33 },
-/* 0x90 */
- { 0, INS_NOP, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "nop", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 1, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 2, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 3, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 4, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 5, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 6, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xchg", "", 0, 7, 0, 0 , 0 },
- { 0, INS_SZCONV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "cwde", "", 0, 0, 0, 0 , 5 },
- { 0, INS_SZCONV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "cdq", "", 0, 0, 0, 0 , 11 },
- { 0, INS_CALL, 0, ADDRMETH_A | OPTYPE_p | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "callf", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "wait", "", 0, 0, 0, 0 , 0 },
- { 0, INS_PUSHFLAGS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pushf", "", 0, 0, 0, 0 , 37 },
- { 0, INS_POPFLAGS, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "popf", "", 0, 0, 0, 0 , 35 },
- { 0, INS_MOV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sahf", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 43 },
- { 0, INS_MOV, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lahf", "", 0, 0, 0, 0 , 24 },
-/* 0xa0 */
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_O | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_O | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_O | OPTYPE_b | OP_W, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_O | OPTYPE_v | OP_W, ADDRMETH_RR | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRMOV, 0, ADDRMETH_Y | OPTYPE_b | OP_W, ADDRMETH_X | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "movs", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRMOV, 0, ADDRMETH_Y | OPTYPE_v | OP_W, ADDRMETH_X | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "movs", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRCMP, 0, ADDRMETH_Y | OPTYPE_b | OP_R, ADDRMETH_X | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRCMP, 0, ADDRMETH_X | OPTYPE_v | OP_R, ADDRMETH_Y | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_TEST, 0, ADDRMETH_RR | OPTYPE_b | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_TEST, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_STRSTOR, 0, ADDRMETH_Y | OPTYPE_b | OP_W, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "stos", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRSTOR, 0, ADDRMETH_Y | OPTYPE_v | OP_W, ADDRMETH_RR | OPTYPE_v |OP_R, ARG_NONE, cpu_80386 | isa_GP, "stos", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRLOAD, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_X| OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "lods", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRLOAD, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_X| OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "lods", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRCMP, 0, ADDRMETH_RR | OPTYPE_b | OP_R, ADDRMETH_Y | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "scas", "", 0, 0, 0, 0 , 0 },
- { 0, INS_STRCMP, 0, ADDRMETH_RR | OPTYPE_v | OP_R, ADDRMETH_Y | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "scas", "", 0, 0, 0, 0 , 0 },
-/* 0xb0 */
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 1, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 2, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 3, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 4, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 5, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 6, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 7, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 1, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 2, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 3, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 4, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 5, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 6, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 7, 0, 0, 0 , 0 },
-/* 0xc0 */
- { idx_C0, 0, 0, ADDRMETH_E | OPTYPE_b, ADDRMETH_I | OPTYPE_b, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_C1, 0, 0, ADDRMETH_E | OPTYPE_v, ADDRMETH_I | OPTYPE_b, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_RET, 0, ADDRMETH_I | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "ret", "", 0, 0, 0, 0 , 3 },
- { 0, INS_RET, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "ret", "", 0, 0, 0, 0 , 3 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_M | OPTYPE_p | OP_R, ARG_NONE, cpu_80386 | isa_GP, "les", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_M | OPTYPE_p | OP_R, ARG_NONE, cpu_80386 | isa_GP, "lds", "", 0, 0, 0, 0 , 0 },
- { idx_C6, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_C7, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ENTER, INS_NOTE_NONSWAP, ADDRMETH_I | OPTYPE_w | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "enter", "", 0, 0, 0, 0 , 15 },
- { 0, INS_LEAVE, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "leave", "", 0, 0, 0, 0 , 26 },
- { 0, INS_RET, 0, ADDRMETH_I | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "retf", "lret", 0, 0, 0, 0 , 3 },
- { 0, INS_RET, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "retf", "lret", 0, 0, 0, 0 , 3 },
- { 0, INS_DEBUG, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "int3", "", 0, 0, 0, 0 , 0 },
- { 0, INS_TRAP, 0, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "int", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OFLOW, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "into", "", 0, 0, 0, INS_TEST_OFLOW, 0 },
- { 0, INS_TRET, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "iret", "", 0, 0, 0, INS_SET_ALL|INS_SET_DIR, 0 },
-/* 0xd0 */
- { idx_D0, 0, 0, ADDRMETH_E | OPTYPE_b, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 1, 0, 0 , 0 },
- { idx_D1, 0, 0, ADDRMETH_E | OPTYPE_v, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 1, 0, 0 , 0 },
- { idx_D2, 0, 0, ADDRMETH_E | OPTYPE_b, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 1, 0, 0 , 0 },
- { idx_D3, 0, 0, ADDRMETH_E | OPTYPE_v, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 1, 0, 0 , 0 },
- { 0, INS_BCDCONV, 0, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "aam", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_BCDCONV, 0, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "aad", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 2 },
- { 0, INS_SALC, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "salc", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XLAT, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "xlat", "", 0, 0, 0, 0 , 53 },
- { idx_D8, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_D9, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_DA, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_DB, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_DC, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_DD, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_DE, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_DF, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
-/* 0xe0 */
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "loopnz", "", 0, 0, 0, INS_TEST_NZERO, 31 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "loopz", "", 0, 0, 0, INS_TEST_ZERO, 31 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "loop", "", 0, 0, 0, 0 , 31 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_b | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jcxz", "", 0, 0, 0, 0 , 31 },
- { 0, INS_IN, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "in", "", 0, 0, 0, 0 , 0 },
- { 0, INS_IN, 0, ADDRMETH_RR | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "in", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OUT, 0, ADDRMETH_I | OPTYPE_b | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "out", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OUT, 0, ADDRMETH_I | OPTYPE_b | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "out", "", 0, 0, 0, 0 , 0 },
- { 0, INS_CALL, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "call", "", 0, 0, 0, 0 , 3 },
- { 0, INS_BRANCH, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jmp", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BRANCH, 0, ADDRMETH_A | OPTYPE_p | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jmp", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BRANCH, 0, ADDRMETH_J | OPTYPE_b | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jmp", "", 0, 0, 0, 0 , 0 },
- { 0, INS_IN, 0, ADDRMETH_RR | OPTYPE_b| OP_W, ADDRMETH_RR | OPTYPE_w| OP_R, ARG_NONE, cpu_80386 | isa_GP, "in", "", 0, 2, 0, 0 , 0 },
- { 0, INS_IN, 0, ADDRMETH_RR | OPTYPE_v | OP_W, ADDRMETH_RR | OPTYPE_w| OP_R, ARG_NONE, cpu_80386 | isa_GP, "in", "", 0, 2, 0, 0 , 0 },
- { 0, INS_OUT, 0, ADDRMETH_RR | OPTYPE_w| OP_R, ADDRMETH_RR | OPTYPE_b| OP_R, ARG_NONE, cpu_80386 | isa_GP, "out", "", 2, 0, 0, 0 , 0 },
- { 0, INS_OUT, 0, ADDRMETH_RR | OPTYPE_w| OP_R, ADDRMETH_RR | OPTYPE_v| OP_R, ARG_NONE, cpu_80386 | isa_GP, "out", "", 2, 0, 0, 0 , 0 },
-/* 0xf0 */
- { 0, INS_FLAG_PREFIX | PREFIX_LOCK, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ICEBP, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "icebp", "", 0, 0, 0, 0 , 0 },
- { idx_F2, INS_FLAG_PREFIX | PREFIX_REPNZ, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_F3, INS_FLAG_PREFIX | PREFIX_REPZ, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_HALT, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "hlt", "", 0, 0, 0, 0 , 0 },
- { 0, INS_TOGCF, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "cmc", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { idx_F6, 0, 0, ADDRMETH_E | OPTYPE_b, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_F7, 0, 0, ADDRMETH_E | OPTYPE_v, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_CLEARCF, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "clc", "", 0, 0, 0, INS_SET_NCARRY, 0 },
- { 0, INS_SETCF, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "stc", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "cli", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sti", "", 0, 0, 0, 0 , 0 },
- { 0, INS_CLEARDF, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "cld", "", 0, 0, 0, INS_SET_NDIR, 0 },
- { 0, INS_SETDF, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "std", "", 0, 0, 0, INS_SET_DIR, 0 },
- { idx_FE, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_FF, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_66[] = { /* SIMD 66 one-byte Opcodes */
- { idx_660F, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_F2[] = { /* SIMD F2 one-byte Opcodes */
- { idx_F20F, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_F3[] = { /* SIMD F3 one-byte Opcodes */
- { idx_F30F, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pause", "", 0, 0, 0, 0, 0 }
-};
-
-
-static ia32_insn_t tbl_0F[] = { /* Two-byte Opcodes */
- { idx_0F00, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { idx_0F01, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "lar", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "lsl", "", 0, 0, 0, INS_SET_ZERO, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "clts", "", 0, 0, 0, 0 , 6 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "invd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "wbinvd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_UNKNOWN, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTPRO | isa_GP, "ud2", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "prefetch", "", 0, 0, 0, 0, 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "femms", "", 0, 0, 0, 0, 0 },
- { idx_0F0F, INS_FLAG_SUFFIX, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movups", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_W | OPTYPE_ps | OP_W, ADDRMETH_V | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movups", "", 0, 0, 0, 0 , 0 },
- { idx_0F12, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movlps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "unpcklps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "unpckhps", "", 0, 0, 0, 0 , 0 },
- { idx_0F16, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_q | OP_W, ADDRMETH_V | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movhps", "", 0, 0, 0, 0 , 0 },
- { idx_0F18, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_R | OPTYPE_d | OP_W, ADDRMETH_C | OPTYPE_d | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_R | OPTYPE_d | OP_W, ADDRMETH_D | OPTYPE_d | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_C | OPTYPE_d | OP_W, ADDRMETH_R | OPTYPE_d | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_D | OPTYPE_d | OP_W, ADDRMETH_R | OPTYPE_d | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_R | OPTYPE_d | OP_W, ADDRMETH_T | OPTYPE_d | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_T | OPTYPE_d | OP_W, ADDRMETH_R | OPTYPE_d | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movaps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_W | OPTYPE_ps | OP_W, ADDRMETH_V | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movaps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "cvtpi2ps", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_W | OPTYPE_ps | OP_W, ADDRMETH_V | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movntps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "cvttps2pi", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_P | OPTYPE_q | OP_W , ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "cvtps2pi", "", 0, 0, 0, 0, 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_ss | OP_W, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "ucomiss", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ss | OP_W, ARG_NONE, cpu_PENTIUM2 | isa_GP, "comiss", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "wrmsr", "", 0, 0, 0, 0 , 52 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "rdtsc", "", 0, 0, 0, 0 , 40 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "rdmsr", "", 0, 0, 0, 0 , 38 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTPRO | isa_GP, "rdpmc", "", 0, 0, 0, 0 , 39 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "sysenter", "", 0, 0, 0, 0 , 50 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "sysexit", "", 0, 0, 0, 0 , 51 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovo", "", 0, 0, 0, INS_TEST_OFLOW, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovno", "", 0, 0, 0, INS_TEST_NOFLOW, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovc", "", 0, 0, 0, INS_TEST_CARRY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovnc", "", 0, 0, 0, INS_TEST_NCARRY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovz", "", 0, 0, 0, INS_TEST_ZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovnz", "", 0, 0, 0, INS_TEST_NZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovbe", "", 0, 0, 0, INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmova", "", 0, 0, 0, INS_TEST_NZERO|INS_TEST_NCARRY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovs", "", 0, 0, 0, INS_TEST_SIGN, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovns", "", 0, 0, 0, INS_TEST_NSIGN, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovp", "", 0, 0, 0, INS_TEST_PARITY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovnp", "", 0, 0, 0, INS_TEST_NPARITY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovl", "", 0, 0, 0, INS_TEST_SFNEOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovge", "", 0, 0, 0, INS_TEST_SFEQOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovle", "", 0, 0, 0, INS_TEST_ZERO|INS_TEST_OR|INS_TEST_SFNEOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "cmovg", "", 0, 0, 0, INS_TEST_NZERO|INS_TEST_SFEQOF, 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_d | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movmskps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "sqrtps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "rsqrtps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "rcpps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_AND, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "andps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_AND, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "andnps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OR, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "orps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XOR, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "xorps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "addps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MUL, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "mulps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_pd, ADDRMETH_W | OPTYPE_q, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtps2pd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtdq2ps", "", 0, 0, 0, 0, 0 },
- { 0, INS_SUB, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "subps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "minps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_DIV, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "divps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "maxps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "punpcklbw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "punpcklwd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "punpckldq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "packsswb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pcmpgtb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pcmpgtw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pcmpgtd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "packuswb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "punpckhbw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "punpckhwd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "punpckhdq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "packssdw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_P | OPTYPE_d | OP_W, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "movd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "movq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM2 | isa_GP, "pshufw", "", 0, 0, 0, 0, 0 },
- { idx_0F71, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "", "", 0, 0, 0, 0 , 0 },
- { idx_0F72, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "", "", 0, 0, 0, 0 , 0 },
- { idx_0F73, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pcmpeqb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_CMP, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pcmpeqw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_CMP, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pcmpeqd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "emms", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_E | OPTYPE_d | OP_W, ADDRMETH_P | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "movd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_Q | OPTYPE_q | OP_W, ADDRMETH_P | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "movq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jo", "", 0, 0, 0, INS_TEST_OFLOW, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jno", "", 0, 0, 0, INS_TEST_NOFLOW, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jc", "", 0, 0, 0, INS_TEST_CARRY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jnc", "", 0, 0, 0, INS_TEST_NCARRY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jz", "", 0, 0, 0, INS_TEST_ZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jnz", "", 0, 0, 0, INS_TEST_NZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jbe", "", 0, 0, 0, INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "ja", "", 0, 0, 0, INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "js", "", 0, 0, 0, INS_TEST_SIGN, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jns", "", 0, 0, 0, INS_TEST_NSIGN, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jpe", "", 0, 0, 0, INS_TEST_PARITY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jpo", "", 0, 0, 0, INS_TEST_NPARITY, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jl", "", 0, 0, 0, INS_TEST_SFNEOF, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jge", "", 0, 0, 0, INS_TEST_SFEQOF, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jle", "", 0, 0, 0, INS_TEST_ZERO|INS_TEST_OR|INS_TEST_SFNEOF, 0 },
- { 0, INS_BRANCHCC, 0, ADDRMETH_J | OPTYPE_v | OP_X | OP_SIGNED, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jg", "", 0, 0, 0, INS_TEST_NZERO|INS_TEST_SFEQOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "seto", "", 0, 0, 0, INS_TEST_OFLOW, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setno", "", 0, 0, 0, INS_TEST_OFLOW, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setc", "", 0, 0, 0, INS_TEST_CARRY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setnc", "", 0, 0, 0, INS_TEST_NCARRY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setz", "", 0, 0, 0, INS_TEST_ZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setnz", "", 0, 0, 0, INS_TEST_NZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setbe", "", 0, 0, 0, INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "seta", "", 0, 0, 0, INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sets", "", 0, 0, 0, INS_TEST_SIGN, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setns", "", 0, 0, 0, INS_TEST_NSIGN, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setpe", "", 0, 0, 0, INS_TEST_PARITY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setpo", "", 0, 0, 0, INS_TEST_NPARITY, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setl", "", 0, 0, 0, INS_TEST_SFNEOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setge", "", 0, 0, 0, INS_TEST_SFEQOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setle", "", 0, 0, 0, INS_TEST_ZERO|INS_TEST_OR|INS_TEST_SFNEOF, 0 },
- { 0, INS_MOVCC, 0, ADDRMETH_E | OPTYPE_b | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "setg", "", 0, 0, 0, INS_TEST_NZERO|INS_TEST_SFEQOF, 0 },
- { 0, INS_PUSH, 0, ADDRMETH_RS | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 4, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RS | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 4, 0, 0, 0 , 33 },
- { 0, INS_CPUID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "cpuid", "", 0, 0, 0, 0 , 10 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bt", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_80386 | isa_GP, "shld", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- //{ 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_I | OP_R | OPTYPE_b | ADDRMETH_RR, cpu_80386 | isa_GP, "shld", "", 0, 0, 1, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_RR | OP_R | OPTYPE_b, cpu_80386 | isa_GP, "shld", "", 0, 0, 1, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_PUSH, 0, ADDRMETH_RS | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 5, 0, 0, 0 , 33 },
- { 0, INS_POP, 0, ADDRMETH_RS | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "pop", "", 5, 0, 0, 0 , 33 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "rsm", "", 0, 0, 0, INS_SET_ALL|INS_SET_DIR, 42 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bts", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_80386 | isa_GP, "shrd", "", 0, 0, 0, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ADDRMETH_RR | OP_R | OPTYPE_b , cpu_80386 | isa_GP, "shrd", "", 0, 0, 1, INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { idx_0FAE, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MUL, 0, ADDRMETH_G | OPTYPE_v | OP_SIGNED | OP_R | OP_W, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "imul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, },
- { 0, INS_XCHGCC, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_W, ARG_NONE, cpu_80486 | isa_GP, "cmpxchg", "", 0, 0, 0, INS_SET_ALL, 8 },
- { 0, INS_XCHGCC, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_W, ARG_NONE, cpu_80486 | isa_GP, "cmpxchg", "", 0, 0, 0, INS_SET_ALL, 7 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_M | OPTYPE_p | OP_W, ARG_NONE, cpu_80386 | isa_GP, "lss", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "btr", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_M | OPTYPE_p | OP_W, ARG_NONE, cpu_80386 | isa_GP, "lfs", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_M | OPTYPE_p | OP_W, ARG_NONE, cpu_80386 | isa_GP, "lgs", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "movzx", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "movzx", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_UNKNOWN, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "ud1", "", 0, 0, 0, 0 , 0 },
- { idx_0FBA, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_G | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "btc", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_G | OPTYPE_v | OP_R | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bsf", "", 0, 0, 0, INS_SET_ZERO, 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_G | OPTYPE_v | OP_R | OP_W, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bsr", "", 0, 0, 0, INS_SET_ZERO, 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "movsx", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_G | OPTYPE_v | OP_W, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, cpu_80386 | isa_GP, "movsx", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_G | OPTYPE_b | OP_W, ARG_NONE, cpu_80486 | isa_GP, "xadd", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_G | OPTYPE_v | OP_W, ARG_NONE, cpu_80486 | isa_GP, "xadd", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "cmpps", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_M | OPTYPE_d | OP_W, ADDRMETH_G | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movnti", "", 0, 0, 0, 0, 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_E | OPTYPE_d | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM2 | isa_GP, "pinsrw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_G | OPTYPE_d | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM2 | isa_GP, "pextrw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_ps | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM2 | isa_GP, "shufps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHGCC, 0, ADDRMETH_M | OPTYPE_q | OP_R | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "cmpxchg8b", "", 0, 0, 0, 0, 9 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 1, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 2, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 3, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 4, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 5, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 6, 0, 0, 0 , 0 },
- { 0, INS_XCHG, 0, ADDRMETH_RR | OPTYPE_d | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "bswap", "", 7, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrlw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrld", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrlq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddq", "", 0, 0, 0, 0, 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pmullw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_G | OPTYPE_d | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pmovmskb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubusb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubusw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pminub", "", 0, 0, 0, 0 , 0 },
- { 0, INS_AND, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pand", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddusb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddusw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pmaxub", "", 0, 0, 0, 0 , 0 },
- { 0, INS_AND, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pandn", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pavgb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psraw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrad", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pavgw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MUL, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pmulhuw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MUL, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pmulhw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_W | OPTYPE_q | OP_W, ADDRMETH_V | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movntq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubsb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubsw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pminsw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OR, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "por", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddsb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddsw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "pmaxsw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XOR, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pxor", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psllw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pslld", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psllq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MUL, 0, ADDRMETH_P | OPTYPE_q | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmuludq", "", 0, 0, 0, 0, 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pmaddwd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "psadbw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_P | OPTYPE_pi | OP_W, ADDRMETH_Q | OPTYPE_pi | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "maskmovq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psubd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_q | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubq", "", 0, 0, 0, 0, 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddb", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "paddd", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_660F[] = { /* SIMD 66 Two-byte Opcodes */
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movupd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_W | OPTYPE_pd | OP_R, ADDRMETH_V | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movupd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_V | OPTYPE_q | OP_R, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movlpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_M | OPTYPE_q | OP_R, ADDRMETH_V | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movlpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "unpcklpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "unpckhpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_V | OPTYPE_q | OP_R, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movhpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_M | OPTYPE_q | OP_R, ADDRMETH_V | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movhpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movapd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MOV, 0, ADDRMETH_W | OPTYPE_pd | OP_R, ADDRMETH_V | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movapd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtpi2pd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_M | OPTYPE_pd | OP_R, ADDRMETH_V | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movntpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_P | OPTYPE_q | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvttpd2pi", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_P | OPTYPE_q | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtpd2pi", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "ucomisd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "comisd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movmskpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_FSQRT, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "sqrtpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_AND, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "andpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_AND, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "andnpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_OR, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "orpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_XOR, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "xorpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_ADD, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "addpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_MUL, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "mulpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtpd2ps", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtps2dq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "subpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "minpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "divpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "maxpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpcklbw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpcklwd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpckldq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "packsswb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pcmpgtb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pcmpgtw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pcmpgtd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "packuswb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpckhbw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpckhwd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpckhdq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "packssdw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpcklqdq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "punpckhqdq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_d | OP_R, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movdqa", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "pshufd", "", 0, 0, 0, 0, 0 },
- { idx_660F71, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { idx_660F72, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { idx_660F73, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pcmpeqb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pcmpeqw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pcmpeqd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "haddpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "hsubpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_E | OPTYPE_d | OP_R, ADDRMETH_V | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_W | OPTYPE_dq | OP_R, ADDRMETH_V | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movdqa", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "cmppd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_w | OP_R, ADDRMETH_E | OPTYPE_d | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "pinsrw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_w | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "pextrw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "shufpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "addsubpd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psrlw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psrld", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psrlq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmullw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_W | OPTYPE_q | OP_R, ADDRMETH_V | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmovmskb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubusb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubusw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pminub", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pand", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddusb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddusw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmaxub", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pandn", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pavgb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psraw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psrad", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pavgw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmulhuw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmulhw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvttpd2dq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_M | OPTYPE_dq | OP_R, ADDRMETH_V | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movntdq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubsb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubsw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pminsw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "por", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddsb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddsw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmaxsw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pxor", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psllw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pslld", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psllq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmuludq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "pmaddwd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psadbw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "maskmovdqu", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "psubq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddb", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddw", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "paddd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 }
-};
-
-
-static ia32_insn_t tbl_F20F[] = { /* SIMD F2 Two-byte Opcodes */
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_W | OPTYPE_sd | OP_R, ADDRMETH_V | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_q | OP_R, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movddup", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtsi2sd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvttsd2si", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtsd2si", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "sqrtsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "addsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "mulsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtsd2ss", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "subsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "minsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "divsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "maxsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "pshuflw", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "haddps", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "hsubps", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_sd | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "cmpsd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "addsubps", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_P | OPTYPE_q | OP_R, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movdq2q", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_pd | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtpd2dq", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_M | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "lddqu", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 }
-};
-
-
-static ia32_insn_t tbl_F30F[] = { /* SIMD F3 Two-byte Opcodes */
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_W | OPTYPE_ss | OP_R, ADDRMETH_V | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movsldup", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ps | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movshdup", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtsi2ss", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvttss2si", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_G | OPTYPE_d | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtss2si", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "sqrtss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "rsqrtss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "rcpss", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "addss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "mulss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_sd | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtss2sd", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_ps | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvttps2dq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "subss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "minss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "divss", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "maxss", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movdqu", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_W | OPTYPE_dq | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "pshufhw", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_q | OP_R, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movq", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_W | OPTYPE_dq | OP_R, ADDRMETH_V | OPTYPE_dq | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movdqu", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_ss | OP_R, ADDRMETH_W | OPTYPE_ss | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, cpu_PENTIUM4 | isa_GP, "cmpss", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_dq | OP_R, ADDRMETH_Q | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "movq2dq", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_UNKNOWN, 0, ADDRMETH_V | OPTYPE_pd | OP_R, ADDRMETH_W | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM4 | isa_GP, "cvtdq2pd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "", "", 0, 0, 0, 0, 0 }
-};
-
-
-static ia32_insn_t tbl_0F00[] = { /* Group 6 */
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sldt", "", 0, 0, 0, 0 , 46 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "str", "", 0, 0, 0, 0 , 49 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lldt", "", 0, 0, 0, 0 , 29 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "ltr", "", 0, 0, 0, 0 , 32 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "verr", "", 0, 0, 0, INS_SET_ZERO, 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "verw", "", 0, 0, 0, INS_SET_ZERO, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0F01[] = { /* Group 7 */
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sgdt", "", 0, 0, 0, 0 , 44 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sidt", "", 0, 0, 0, 0 , 45 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lgdt", "", 0, 0, 0, 0 , 27 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lidt", "", 0, 0, 0, 0 , 28 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "smsw", "", 0, 0, 0, 0 , 47 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lmsw", "", 0, 0, 0, 0 , 30 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_none | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "invlpg", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sgdt", "", 0, 0, 0, 0 , 44 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sidt", "", 0, 0, 0, 0 , 45 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lgdt", "", 0, 0, 0, 0 , 27 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lidt", "", 0, 0, 0, 0 , 28 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "smsw", "", 0, 0, 0, 0 , 47 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lmsw", "", 0, 0, 0, 0 , 30 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_none | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "invlpg", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sgdt", "", 0, 0, 0, 0 , 44 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "sidt", "", 0, 0, 0, 0 , 45 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lgdt", "", 0, 0, 0, 0 , 27 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_s | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lidt", "", 0, 0, 0, 0 , 28 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "smsw", "", 0, 0, 0, 0 , 47 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lmsw", "", 0, 0, 0, 0 , 30 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_none | OP_R, ARG_NONE, ARG_NONE, cpu_80486 | isa_GP, "invlpg", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { idx_0F0111, 0, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "smsw", "", 0, 0, 0, 0 , 47 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_w | OP_W, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "lmsw", "", 0, 0, 0, 0 , 30 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0F0111[] = { /* Monitor/MWait opcode */
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "monitor", "", 0, 0, 0, 0, 54 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "mwait", "", 0, 0, 0, 0, 55 }
-};
-
-
-static ia32_insn_t tbl_0F12[] = { /* Movlps Opcode */
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movlps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movlps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, INS_NOTE_NOSUFFIX, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movlps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_ps | OP_R | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R , ARG_NONE, cpu_PENTIUM4 | isa_GP, "movhlps", "", 0, 0, 0, 0, 0 }
-};
-
-
-static ia32_insn_t tbl_0F16[] = { /* Movhps Opcode */
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movhps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movhps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_V | OPTYPE_q | OP_W, ADDRMETH_M | OPTYPE_q | OP_R, ARG_NONE, cpu_PENTIUM2 | isa_GP, "movhps", "", 0, 0, 0, 0 , 0 },
- { 0, INS_MOV, 0, ADDRMETH_V | OPTYPE_ps | OP_R | OP_W, ADDRMETH_W | OPTYPE_ps | OP_R , ARG_NONE, cpu_PENTIUM4 | isa_GP, "movlhps", "", 0, 0, 0, 0, 0 }
-};
-
-
-static ia32_insn_t tbl_0F18[] = { /* Group 16 */
- { 0, INS_SYSTEM, 0, OP_W | OPTYPE_b | ADDRMETH_M, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetchnta", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht0", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht1", "", 1, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht2", "", 2, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, OP_W | OPTYPE_b | ADDRMETH_M, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetchnta", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht0", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht1", "", 1, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht2", "", 2, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, OP_W | OPTYPE_b | ADDRMETH_M, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetchnta", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht0", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht1", "", 1, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_RT | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2 | isa_GP, "prefetcht2", "", 2, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0F71[] = { /* Group 12 */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrlw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psraw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psllw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_660F71[] = { /* Group 12 SSE */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrlw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psraw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psllw", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0F72[] = { /* Group 13 */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrld", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrad", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pslld", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_660F72[] = { /* Group 13 SSE */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrld", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrad", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pslld", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0F73[] = { /* Group 14 */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrlq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_P | OPTYPE_q | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psllq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_660F73[] = { /* Group 14 SSE */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrlq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psrldq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "psllq", "", 0, 0, 0, 0 , 0 },
- { 0, INS_OTHER, 0, ADDRMETH_W | OPTYPE_dq | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_PENTIUM | isa_MMX, "pslldq", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0FAE[] = { /* Group 15 */
- { 0, INS_FPU, 0, ADDRMETH_E | OPTYPE_fx | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "fxsave", "", 0, 0, 0, 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_E | OPTYPE_fx | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "fxrstor", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM2, "ldmxcsr", "", 0, 0, 0, 0 , 25 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2, "stmxcsr", "", 0, 0, 0 , 0, 48 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "clflush", "", 0, 0, 0, 0, 0 },
- { 0, INS_FPU, 0, ADDRMETH_E | OPTYPE_fx | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "fxsave", "", 0, 0, 0, 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_E | OPTYPE_fx | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "fxrstor", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM2, "ldmxcsr", "", 0, 0, 0, 0 , 25 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2, "stmxcsr", "", 0, 0, 0 , 0, 48 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "clflush", "", 0, 0, 0, 0, 0 },
- { 0, INS_FPU, 0, ADDRMETH_E | OPTYPE_fx | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "fxsave", "", 0, 0, 0, 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_E | OPTYPE_fx | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_MMX, "fxrstor", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_d | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM2, "ldmxcsr", "", 0, 0, 0, 0 , 25 },
- { 0, INS_SYSTEM, 0, ADDRMETH_E | OPTYPE_d | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM2, "stmxcsr", "", 0, 0, 0 , 0, 48 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ADDRMETH_M | OPTYPE_b | OP_R, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "clflush", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "lfence", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "mfence", "", 0, 0, 0, 0 , 0 },
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "sfence", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0FBA[] = { /* Group 8 */
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bt", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "bts", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "btr", "", 0, 0, 0, INS_SET_CARRY, 0 },
- { 0, INS_BITTEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "btc", "", 0, 0, 0 , INS_SET_CARRY, 0 }
-};
-
-
-static ia32_insn_t tbl_0FC7[] = { /* Group 9 */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHGCC, 0, ADDRMETH_M | OPTYPE_q | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "cmpxch8b", "", 0, 0, 0 , 0 , 9 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHGCC, 0, ADDRMETH_M | OPTYPE_q | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "cmpxch8b", "", 0, 0, 0 , 0 , 9 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "", "", 0, 0, 0, 0 , 0 },
- { 0, INS_XCHGCC, 0, ADDRMETH_M | OPTYPE_q | OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM | isa_GP, "cmpxch8b", "", 0, 0, 0 , 0 , 9 }
-};
-
-
-static ia32_insn_t tbl_0FB9[] = { /* Group 10 */
- { 0, INS_SYSTEM, 0, ARG_NONE, ARG_NONE, ARG_NONE, 0, "fxsave", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_C6[] = { /* Group 11a */
- { 0, INS_MOV, 0, ADDRMETH_E | OPTYPE_b | OP_W, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_C7[] = { /* Group 11b */
- { 0, INS_MOV, 0, ADDRMETH_E | OPTYPE_v | OP_W, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mov", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_80[] = { /* Group 1a */
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_AND, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_E | OPTYPE_b | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_81[] = { /* Group 1b */
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_AND, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_82[] = { /* Group 1c */
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_AND, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_E | OPTYPE_b | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_83[] = { /* Group 1d */
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "add", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_OR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "or", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_ADD, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "adc", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sbb", "", 0, 0, 0, INS_SET_ALL|INS_TEST_CARRY, 0 },
- { 0, INS_AND, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "and", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SUB, 0, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sub", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_XOR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "xor", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_CMP, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "cmp", "", 0, 0, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_C0[] = { /* Group 2a */
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rol", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ror", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcl", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcr", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shl", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shr", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sal", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sar", "", 0, 0, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_C1[] = { /* Group 2b */
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rol", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ror", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcl", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcr", "", 0, 0, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shl", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shr", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sal", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_I | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sar", "", 0, 0, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_D0[] = { /* Group 2c */
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rol", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ror", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcl", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcr", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shl", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shr", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sal", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_II | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sar", "", 0, 1, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_D1[] = { /* Group 2d */
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rol", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ror", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcl", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcr", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shl", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shr", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sal", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_II | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sar", "", 0, 1, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_D2[] = { /* Group 2e */
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rol", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ror", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcl", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcr", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shl", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shr", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sal", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sar", "", 0, 1, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_D3[] = { /* Group 2f */
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rol", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "ror", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW, 0 },
- { 0, INS_ROL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcl", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_ROR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "rcr", "", 0, 1, 0, INS_SET_CARRY|INS_SET_OFLOW|INS_TEST_CARRY, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shl", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "shr", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHL, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sal", "", 0, 1, 0, INS_SET_ALL, 0 },
- { 0, INS_SHR, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ADDRMETH_RR | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "sar", "", 0, 1, 0 , INS_SET_ALL, 0 }
-};
-
-
-static ia32_insn_t tbl_F6[] = { /* Group 3a */
- { 0, INS_TEST, 0, ADDRMETH_E | OPTYPE_b | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_TEST, 0, ADDRMETH_E | OPTYPE_b | OP_R, ADDRMETH_I | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_NOT, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "not", "", 0, 0, 0, 0 , 0 },
- { 0, INS_NEG, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "neg", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_MUL, 0, OPTYPE_b | ADDRMETH_RR | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, 22 },
- { 0, INS_MUL, 0, OPTYPE_b | ADDRMETH_RR | OP_W | OP_SIGNED | OP_R, ADDRMETH_E | OPTYPE_b | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "imul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, 22 },
- { 0, INS_DIV, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "div", "", 0, 0, 0, 0 , 13 },
- { 0, INS_DIV, 0, ADDRMETH_RR | OPTYPE_b | OP_W | OP_R, ADDRMETH_E | OPTYPE_b | OP_R, ARG_NONE, cpu_80386 | isa_GP, "idiv", "", 0, 0, 0 , 0 , 13 }
-};
-
-
-static ia32_insn_t tbl_F7[] = { /* Group 3b */
- { 0, INS_TEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_TEST, 0, ADDRMETH_E | OPTYPE_v | OP_R, ADDRMETH_I | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "test", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_NOT, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "not", "", 0, 0, 0, 0 , 0 },
- { 0, INS_NEG, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "neg", "", 0, 0, 0, INS_SET_ALL, 0 },
- { 0, INS_MUL, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "mul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, 23 },
- { 0, INS_MUL, 0, ADDRMETH_RR | OPTYPE_v | OP_SIGNED | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_SIGNED | OP_R, ARG_NONE, cpu_80386 | isa_GP, "imul", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_CARRY, 23 },
- { 0, INS_DIV, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "div", "", 0, 0, 0, 0 , 14 },
- { 0, INS_DIV, 0, ADDRMETH_RR | OPTYPE_v | OP_W | OP_R, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, cpu_80386 | isa_GP, "idiv", "", 0, 0, 0, 0 , 14 }
-};
-
-
-static ia32_insn_t tbl_FE[] = { /* Group 4 */
- { 0, INS_INC, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_E | OPTYPE_b | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 0, 0, 0 , INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 }
-};
-
-
-static ia32_insn_t tbl_FF[] = { /* Group 5 */
- { 0, INS_INC, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "inc", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_DEC, 0, ADDRMETH_E | OPTYPE_v | OP_W | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "dec", "", 0, 0, 0, INS_SET_OFLOW|INS_SET_SIGN|INS_SET_ZERO|INS_SET_PARITY, 0 },
- { 0, INS_CALL, 0, ADDRMETH_E | OPTYPE_v | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "call", "", 0, 0, 0, 0 , 3 },
- { 0, INS_CALL, 0, ADDRMETH_M | OPTYPE_p | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "call", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BRANCH, 0, ADDRMETH_E | OPTYPE_v | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jmp", "", 0, 0, 0, 0 , 0 },
- { 0, INS_BRANCH, 0, ADDRMETH_M | OPTYPE_p | OP_X, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "jmp", "", 0, 0, 0, 0 , 0 },
- { 0, INS_PUSH, 0, ADDRMETH_E | OPTYPE_v | OP_R, ARG_NONE, ARG_NONE, cpu_80386 | isa_GP, "push", "", 0, 0, 0, 0 , 33 }
-};
-
-
-static ia32_insn_t tbl_D8[] = { /* FPU D8 */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_D8C0[] = { /* FPU D8 C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 1, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 2, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 3, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 4, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 5, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 6, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 7, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 1, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 2, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 3, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 4, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 5, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 6, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 7, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 7, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_D9[] = { /* FPU D9 */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fs|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fv|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldenv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldcw", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fv|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnstenv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnstcw", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_D9C0[] = { /* FPU D9 C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fxch", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnop", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fchs", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fabs", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ftst", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fxam", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fld1", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldl2t", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldl2e", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldpi", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldlg2", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldln2", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fldz", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "f2xm1", "", 0, 0, 0 , 0 , 16 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fyl2x", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fptan", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fpatan", "", 0, 0, 0 , 0 , 18 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fxtract", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fprem1", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fdecstp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fincstp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fprem", "", 0, 0, 0 , 0 , 19 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fyl2xp1", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsqrt", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsincos", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "frndint", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fscale", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsin", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fcos", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DA[] = { /* FPU DA */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fiadd", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fimul", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ficom", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ficomp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fisub", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fisubr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fidiv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fidivr", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DAC0[] = { /* FPU DA C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 0, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 1, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 2, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 3, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 4, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 5, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 6, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovb", "", 0, 7, 0 , INS_TEST_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 0, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 1, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 2, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 3, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 4, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 5, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 6, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmove", "", 0, 7, 0 , INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 0, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 1, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 2, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 3, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 4, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 5, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 6, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovbe", "", 0, 7, 0 , INS_TEST_CARRY|INS_TEST_OR|INS_TEST_ZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 0, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 1, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 2, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 3, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 4, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 5, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 6, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcmovu", "", 0, 7, 0 , INS_TEST_PARITY, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fucompp", "", 0, 0, 0 , 0 , 21 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DB[] = { /* FPU DB */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fild", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "fisttp", "", 0, 0, 0, 0, 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fist", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_d|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fistp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fe|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fe|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DBC0[] = { /* FPU DB C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 0, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 1, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 2, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 3, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 4, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 5, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 6, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnb", "", 0, 7, 0 , INS_TEST_NCARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 0, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 1, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 2, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 3, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 4, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 5, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 6, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovne", "", 0, 7, 0 , INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 0, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 1, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 2, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 3, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 4, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 5, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 6, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnbe", "", 0, 7, 0 , INS_TEST_NCARRY|INS_TEST_NZERO, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 0, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 1, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 2, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 3, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 4, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 5, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 6, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcmovnu", "", 0, 7, 0 , INS_TEST_NPARITY, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnclex", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fninit", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomi", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0, },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 1, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 2, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 3, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 4, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 5, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 6, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_PENTPRO | isa_GP, "fcomi", "", 0, 7, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DC[] = { /* FPU DC */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fcom", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 17 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fcomp", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DCC0[] = { /* FPU DC C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fadd", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmul", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubr", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsub", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivr", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdiv", "", 7, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DD[] = { /* FPU DD */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fld", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_q|OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "fisttp", "", 0, 0, 0, 0, 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fd|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_ft|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "frstor", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_ft|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnsave", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnstsw", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DDC0[] = { /* FPU DD C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ffree", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fst", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fstp", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucom", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomp", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DE[] = { /* FPU DE */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fiadd", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fimul", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ficom", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "ficomp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fisub", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fisubr", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fidiv", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fidivr", "", 0, 0, 0, 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DEC0[] = { /* FPU DE C0 */
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 0, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 1, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 2, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 3, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 4, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 5, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 6, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "faddp", "", 7, 0, 0 , 0 , 20 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fmulp", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fcompp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubrp", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fsubp", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivrp", "", 7, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 1, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 2, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 3, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 4, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 5, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 6, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fdivp", "", 7, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DF[] = { /* FPU DF */
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fild", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_PENTIUM4 | isa_GP, "fisttp", "", 0, 0, 0, 0, 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fist", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_w|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fistp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fb|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fbld", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_q|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fild", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_fb|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fbstp", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_M|OPTYPE_q|OP_W, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fistp", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_DFC0[] = { /* FPU DF C0 */
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RR | OPTYPE_w | OP_R, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "fnstsw", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 1, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 2, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 3, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 4, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 5, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 6, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fucomip", "", 0, 7, 0 , 0 , 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 0, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 1, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 2, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 3, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 4, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 5, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 6, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_FPU, 0, ADDRMETH_RF | OPTYPE_fp | OP_W, ADDRMETH_RF | OPTYPE_fp | OP_R, ARG_NONE, cpu_80387 | isa_FPU, "fcomip", "", 0, 7, 0 , INS_SET_ZERO|INS_SET_PARITY|INS_SET_CARRY, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_80387 | isa_FPU, "", "", 0, 0, 0 , 0 , 0 }
-};
-
-
-static ia32_insn_t tbl_0F0F[] = { /* 3D Now! 0F Suffix */
- /* 00 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_CONV, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pi2fd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 10 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_CONV, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pf2id", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 20 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 30 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 40 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 50 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 60 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 70 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- /* 80 */ { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_CMP, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfcmpge", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_MIN, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfmin", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfrcp", "", 0, 0, 0, 0, 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfrsqrt", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfsub", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfadd", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_CMP, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfcmpgt", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_MAX, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfmax", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfrcpit1", "", 0, 0, 0, 0, 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfrsqit1", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_SUB, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfsubr", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_ADD, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfacc", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_CMP, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfcmpeq", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_MUL, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfmul", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_ARITH, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pfrcpit2", "", 0, 0, 0, 0, 0 },
- { 0, INS_MUL, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pmulhrw", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_INVALID, 0, ARG_NONE, ARG_NONE, ARG_NONE, cpu_K6 | isa_3DNOW, "", "", 0, 0, 0, 0, 0 },
- { 0, INS_AVG, 0, ADDRMETH_P | OPTYPE_pi | OP_R | OP_W, ADDRMETH_Q | OPTYPE_q |OP_R, ARG_NONE, cpu_K6 | isa_3DNOW, "pavgusb", "", 0, 0, 0, 0, 0 }
-};
-
-
-
-/* ================== Table of Opcode Tables ================== */
-ia32_table_desc_t ia32_tables[] = {
- /* table, prefix table, type, shift, mask, min, max */
- { tbl_Main, tbl_opcode, 0x00, 0xFF, 0x00, 0xFF },
- { tbl_66, tbl_prefix, 0x00, 0xFF, 0x0F, 0x0F },
- { tbl_F2, tbl_prefix, 0x00, 0xFF, 0x0F, 0x0F },
- { tbl_F3, tbl_prefix, 0x00, 0xFF, 0x0F, 0x90 },
- { tbl_0F, tbl_opcode, 0x00, 0xFF, 0x00, 0xFF },
- /* 5 */
- { tbl_660F, tbl_prefix, 0x00, 0xFF, 0x10, 0xFF },
- { tbl_F20F, tbl_prefix, 0x00, 0xFF, 0x10, 0xFF },
- { tbl_F30F, tbl_prefix, 0x00, 0xFF, 0x10, 0xFF },
- { tbl_0F00, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_0F01, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- /* 10 */
- { tbl_0F0111, tbl_ext_ext, 0x00, 0x01, 0x00, 0x01 },
- { tbl_0F12, tbl_extension, 0x06, 0x03, 0x00, 0x03 },
- { tbl_0F16, tbl_extension, 0x06, 0x03, 0x00, 0x03 },
- { tbl_0F18, tbl_extension, 0x03, 0x1F, 0x00, 0x13 },
- { tbl_0F71, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- /* 15 */
- { tbl_660F71, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- { tbl_0F72, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- { tbl_660F72, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- { tbl_0F73, tbl_extension, 0x00, 0x00, 0x00, 0x00 },
- { tbl_660F73, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- /* 20 */
- { tbl_0FAE, tbl_extension, 0x03, 0x1F, 0x00, 0x1F },
- { tbl_0FBA, tbl_extension, 0x03, 0x07, 0x04, 0x07 },
- { tbl_0FC7, tbl_extension, 0x03, 0x1F, 0x00, 0x11 },
- { tbl_0FB9, tbl_extension, 0x03, 0x07, 0x00, 0x00 },
- { tbl_C6, tbl_extension, 0x03, 0x07, 0x00, 0x00 },
- /* 25 */
- { tbl_C7, tbl_extension, 0x03, 0x07, 0x00, 0x00 },
- { tbl_80, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_81, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_82, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_83, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- /* 30 */
- { tbl_C0, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_C1, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_D0, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_D1, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_D2, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- /* 35 */
- { tbl_D3, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_F6, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_F7, tbl_extension, 0x03, 0x07, 0x00, 0x07 },
- { tbl_FE, tbl_extension, 0x03, 0x07, 0x00, 0x01 },
- { tbl_FF, tbl_extension, 0x03, 0x07, 0x00, 0x06 },
- /* 40 */
- { tbl_D8, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- { tbl_D8C0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_D9, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- { tbl_D9C0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_DA, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- /* 45 */
- { tbl_DAC0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_DB, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- { tbl_DBC0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_DC, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- { tbl_DCC0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- /* 50 */
- { tbl_DD, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- { tbl_DDC0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_DE, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- { tbl_DEC0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_DF, tbl_fpu, 0x03, 0x07, 0x00, 0xBF },
- /* 55 */
- { tbl_DFC0, tbl_fpu_ext, 0x00, 0xFF, 0xC0, 0xFF },
- { tbl_0F0F, tbl_suffix, 0x00, 0xFF, 0x00, 0xBF }
-};
-/* ia32_opcode_tables.h */
-/* Table index constants:
-#define idx_Main 0
-#define idx_66 1
-#define idx_F2 2
-#define idx_F3 3
-#define idx_0F 4
-#define idx_660F 5
-#define idx_F20F 6
-#define idx_F30F 7
-#define idx_0F00 8
-#define idx_0F01 9
-#define idx_0F0111 10
-#define idx_0F12 11
-#define idx_0F16 12
-#define idx_0F18 13
-#define idx_0F71 14
-#define idx_660F71 15
-#define idx_0F72 16
-#define idx_660F72 17
-#define idx_0F73 18
-#define idx_660F73 19
-#define idx_0FAE 20
-#define idx_0FBA 21
-#define idx_0FC7 22
-#define idx_0FB9 23
-#define idx_C6 24
-#define idx_C7 25
-#define idx_80 26
-#define idx_81 27
-#define idx_82 28
-#define idx_83 29
-#define idx_C0 30
-#define idx_C1 31
-#define idx_D0 32
-#define idx_D1 33
-#define idx_D2 34
-#define idx_D3 35
-#define idx_F6 36
-#define idx_F7 37
-#define idx_FE 38
-#define idx_FF 39
-#define idx_D8 40
-#define idx_D8C0 41
-#define idx_D9 42
-#define idx_D9C0 43
-#define idx_DA 44
-#define idx_DAC0 45
-#define idx_DB 46
-#define idx_DBC0 47
-#define idx_DC 48
-#define idx_DCC0 49
-#define idx_DD 50
-#define idx_DDC0 51
-#define idx_DE 52
-#define idx_DEC0 53
-#define idx_DF 54
-#define idx_DFC0 55
-#define idx_0F0F 56
-*/
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.h
deleted file mode 100644
index bbd4fae9ab..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_opcode_tables.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#define idx_Main 0
-#define idx_66 1
-#define idx_F2 2
-#define idx_F3 3
-#define idx_0F 4
-#define idx_660F 5
-#define idx_F20F 6
-#define idx_F30F 7
-#define idx_0F00 8
-#define idx_0F01 9
-#define idx_0F0111 10
-#define idx_0F12 11
-#define idx_0F16 12
-#define idx_0F18 13
-#define idx_0F71 14
-#define idx_660F71 15
-#define idx_0F72 16
-#define idx_660F72 17
-#define idx_0F73 18
-#define idx_660F73 19
-#define idx_0FAE 20
-#define idx_0FBA 21
-#define idx_0FC7 22
-#define idx_0FB9 23
-#define idx_C6 24
-#define idx_C7 25
-#define idx_80 26
-#define idx_81 27
-#define idx_82 28
-#define idx_83 29
-#define idx_C0 30
-#define idx_C1 31
-#define idx_D0 32
-#define idx_D1 33
-#define idx_D2 34
-#define idx_D3 35
-#define idx_F6 36
-#define idx_F7 37
-#define idx_FE 38
-#define idx_FF 39
-#define idx_D8 40
-#define idx_D8C0 41
-#define idx_D9 42
-#define idx_D9C0 43
-#define idx_DA 44
-#define idx_DAC0 45
-#define idx_DB 46
-#define idx_DBC0 47
-#define idx_DC 48
-#define idx_DCC0 49
-#define idx_DD 50
-#define idx_DDC0 51
-#define idx_DE 52
-#define idx_DEC0 53
-#define idx_DF 54
-#define idx_DFC0 55
-#define idx_0F0F 56
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.c
deleted file mode 100644
index 8e7f16a0c0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.c
+++ /dev/null
@@ -1,425 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libdis.h"
-#include "ia32_insn.h"
-#include "ia32_operand.h"
-#include "ia32_modrm.h"
-#include "ia32_reg.h"
-#include "x86_imm.h"
-#include "x86_operand_list.h"
-
-
-
-/* apply segment override to memory operand in insn */
-static void apply_seg( x86_op_t *op, unsigned int prefixes ) {
- if (! prefixes ) return;
-
- /* apply overrides from prefix */
- switch ( prefixes & PREFIX_REG_MASK ) {
- case PREFIX_CS:
- op->flags |= op_cs_seg; break;
- case PREFIX_SS:
- op->flags |= op_ss_seg; break;
- case PREFIX_DS:
- op->flags |= op_ds_seg; break;
- case PREFIX_ES:
- op->flags |= op_es_seg; break;
- case PREFIX_FS:
- op->flags |= op_fs_seg; break;
- case PREFIX_GS:
- op->flags |= op_gs_seg; break;
- }
-
- return;
-}
-
-static size_t decode_operand_value( unsigned char *buf, size_t buf_len,
- x86_op_t *op, x86_insn_t *insn,
- unsigned int addr_meth, size_t op_size,
- unsigned int op_value, unsigned char modrm,
- size_t gen_regs ) {
- size_t size = 0;
-
- /* ++ Do Operand Addressing Method / Decode operand ++ */
- switch (addr_meth) {
- /* This sets the operand Size based on the Intel Opcode Map
- * (Vol 2, Appendix A). Letter encodings are from section
- * A.1.1, 'Codes for Addressing Method' */
-
- /* ---------------------- Addressing Method -------------- */
- /* Note that decoding mod ModR/M operand adjusts the size of
- * the instruction, but decoding the reg operand does not.
- * This should not cause any problems, as every 'reg' operand
- * has an associated 'mod' operand.
- * Goddamn-Intel-Note:
- * Some Intel addressing methods [M, R] specify that modR/M
- * byte may only refer to a memory address/may only refer to
- * a register -- however Intel provides no clues on what to do
- * if, say, the modR/M for an M opcode decodes to a register
- * rather than a memory address ... returning 0 is out of the
- * question, as this would be an Immediate or a RelOffset, so
- * instead these modR/Ms are decoded with total disregard to
- * the M, R constraints. */
-
- /* MODRM -- mod operand. sets size to at least 1! */
- case ADDRMETH_E: /* ModR/M present, Gen reg or memory */
- size = ia32_modrm_decode( buf, buf_len, op, insn,
- gen_regs );
- break;
- case ADDRMETH_M: /* ModR/M only refers to memory */
- size = ia32_modrm_decode( buf, buf_len, op, insn,
- gen_regs );
- break;
- case ADDRMETH_Q: /* ModR/M present, MMX or Memory */
- size = ia32_modrm_decode( buf, buf_len, op, insn,
- REG_MMX_OFFSET );
- break;
- case ADDRMETH_R: /* ModR/M mod == gen reg */
- size = ia32_modrm_decode( buf, buf_len, op, insn,
- gen_regs );
- break;
- case ADDRMETH_W: /* ModR/M present, mem or SIMD reg */
- size = ia32_modrm_decode( buf, buf_len, op, insn,
- REG_SIMD_OFFSET );
- break;
-
- /* MODRM -- reg operand. does not effect size! */
- case ADDRMETH_C: /* ModR/M reg == control reg */
- ia32_reg_decode( modrm, op, REG_CTRL_OFFSET );
- break;
- case ADDRMETH_D: /* ModR/M reg == debug reg */
- ia32_reg_decode( modrm, op, REG_DEBUG_OFFSET );
- break;
- case ADDRMETH_G: /* ModR/M reg == gen-purpose reg */
- ia32_reg_decode( modrm, op, gen_regs );
- break;
- case ADDRMETH_P: /* ModR/M reg == qword MMX reg */
- ia32_reg_decode( modrm, op, REG_MMX_OFFSET );
- break;
- case ADDRMETH_S: /* ModR/M reg == segment reg */
- ia32_reg_decode( modrm, op, REG_SEG_OFFSET );
- break;
- case ADDRMETH_T: /* ModR/M reg == test reg */
- ia32_reg_decode( modrm, op, REG_TEST_OFFSET );
- break;
- case ADDRMETH_V: /* ModR/M reg == SIMD reg */
- ia32_reg_decode( modrm, op, REG_SIMD_OFFSET );
- break;
-
- /* No MODRM : note these set operand type explicitly */
- case ADDRMETH_A: /* No modR/M -- direct addr */
- op->type = op_absolute;
-
- /* segment:offset address used in far calls */
- x86_imm_sized( buf, buf_len,
- &op->data.absolute.segment, 2 );
- if ( insn->addr_size == 4 ) {
- x86_imm_sized( buf, buf_len,
- &op->data.absolute.offset.off32, 4 );
- size = 6;
- } else {
- x86_imm_sized( buf, buf_len,
- &op->data.absolute.offset.off16, 2 );
- size = 4;
- }
-
- break;
- case ADDRMETH_I: /* Immediate val */
- op->type = op_immediate;
- /* if it ever becomes legal to have imm as dest and
- * there is a src ModR/M operand, we are screwed! */
- if ( op->flags & op_signed ) {
- x86_imm_signsized(buf, buf_len, &op->data.byte,
- op_size);
- } else {
- x86_imm_sized(buf, buf_len, &op->data.byte,
- op_size);
- }
- size = op_size;
- break;
- case ADDRMETH_J: /* Rel offset to add to IP [jmp] */
- /* this fills op->data.near_offset or
- op->data.far_offset depending on the size of
- the operand */
- op->flags |= op_signed;
- if ( op_size == 1 ) {
- /* one-byte near offset */
- op->type = op_relative_near;
- x86_imm_signsized(buf, buf_len,
- &op->data.relative_near, 1);
- } else {
- /* far offset...is this truly signed? */
- op->type = op_relative_far;
- x86_imm_signsized(buf, buf_len,
- &op->data.relative_far, op_size );
- }
- size = op_size;
- break;
- case ADDRMETH_O: /* No ModR/M; op is word/dword offset */
- /* NOTE: these are actually RVAs not offsets to seg!! */
- /* note bene: 'O' ADDR_METH uses addr_size to
- determine operand size */
- op->type = op_offset;
- op->flags |= op_pointer;
- x86_imm_sized( buf, buf_len, &op->data.offset,
- insn->addr_size );
-
- size = insn->addr_size;
- break;
-
- /* Hard-coded: these are specified in the insn definition */
- case ADDRMETH_F: /* EFLAGS register */
- op->type = op_register;
- op->flags |= op_hardcode;
- ia32_handle_register( &op->data.reg, REG_FLAGS_INDEX );
- break;
- case ADDRMETH_X: /* Memory addressed by DS:SI [string] */
- op->type = op_expression;
- op->flags |= op_hardcode;
- op->flags |= op_ds_seg | op_pointer | op_string;
- ia32_handle_register( &op->data.expression.base,
- REG_DWORD_OFFSET + 6 );
- break;
- case ADDRMETH_Y: /* Memory addressed by ES:DI [string] */
- op->type = op_expression;
- op->flags |= op_hardcode;
- op->flags |= op_es_seg | op_pointer | op_string;
- ia32_handle_register( &op->data.expression.base,
- REG_DWORD_OFFSET + 7 );
- break;
- case ADDRMETH_RR: /* Gen Register hard-coded in opcode */
- op->type = op_register;
- op->flags |= op_hardcode;
- ia32_handle_register( &op->data.reg,
- op_value + gen_regs );
- break;
- case ADDRMETH_RS: /* Seg Register hard-coded in opcode */
- op->type = op_register;
- op->flags |= op_hardcode;
- ia32_handle_register( &op->data.reg,
- op_value + REG_SEG_OFFSET );
- break;
- case ADDRMETH_RF: /* FPU Register hard-coded in opcode */
- op->type = op_register;
- op->flags |= op_hardcode;
- ia32_handle_register( &op->data.reg,
- op_value + REG_FPU_OFFSET );
- break;
- case ADDRMETH_RT: /* TST Register hard-coded in opcode */
- op->type = op_register;
- op->flags |= op_hardcode;
- ia32_handle_register( &op->data.reg,
- op_value + REG_TEST_OFFSET );
- break;
- case ADDRMETH_II: /* Immediate hard-coded in opcode */
- op->type = op_immediate;
- op->data.dword = op_value;
- op->flags |= op_hardcode;
- break;
-
- case 0: /* Operand is not used */
- default:
- /* ignore -- operand not used in this insn */
- op->type = op_unused; /* this shouldn't happen! */
- break;
- }
-
- return size;
-}
-
-static size_t decode_operand_size( unsigned int op_type, x86_insn_t *insn,
- x86_op_t *op ){
- size_t size;
-
- /* ++ Do Operand Type ++ */
- switch (op_type) {
- /* This sets the operand Size based on the Intel Opcode Map
- * (Vol 2, Appendix A). Letter encodings are from section
- * A.1.2, 'Codes for Operand Type' */
- /* NOTE: in this routines, 'size' refers to the size
- * of the operand in the raw (encoded) instruction;
- * 'datatype' stores the actual size and datatype
- * of the operand */
-
- /* ------------------------ Operand Type ----------------- */
- case OPTYPE_c: /* byte or word [op size attr] */
- size = (insn->op_size == 4) ? 2 : 1;
- op->datatype = (size == 4) ? op_word : op_byte;
- break;
- case OPTYPE_a: /* 2 word or 2 dword [op size attr] */
- /* pointer to a 16:16 or 32:32 BOUNDS operand */
- size = (insn->op_size == 4) ? 8 : 4;
- op->datatype = (size == 4) ? op_bounds32 : op_bounds16;
- break;
- case OPTYPE_v: /* word or dword [op size attr] */
- size = (insn->op_size == 4) ? 4 : 2;
- op->datatype = (size == 4) ? op_dword : op_word;
- break;
- case OPTYPE_p: /* 32/48-bit ptr [op size attr] */
- /* technically these flags are not accurate: the
- * value s a 16:16 pointer or a 16:32 pointer, where
- * the first '16' is a segment */
- size = (insn->addr_size == 4) ? 6 : 4;
- op->datatype = (size == 4) ? op_descr32 : op_descr16;
- break;
- case OPTYPE_b: /* byte, ignore op-size */
- size = 1;
- op->datatype = op_byte;
- break;
- case OPTYPE_w: /* word, ignore op-size */
- size = 2;
- op->datatype = op_word;
- break;
- case OPTYPE_d: /* dword , ignore op-size */
- size = 4;
- op->datatype = op_dword;
- break;
- case OPTYPE_s: /* 6-byte psuedo-descriptor */
- /* ptr to 6-byte value which is 32:16 in 32-bit
- * mode, or 8:24:16 in 16-bit mode. The high byte
- * is ignored in 16-bit mode. */
- size = 6;
- op->datatype = (insn->addr_size == 4) ?
- op_pdescr32 : op_pdescr16;
- break;
- case OPTYPE_q: /* qword, ignore op-size */
- size = 8;
- op->datatype = op_qword;
- break;
- case OPTYPE_dq: /* d-qword, ignore op-size */
- size = 16;
- op->datatype = op_dqword;
- break;
- case OPTYPE_ps: /* 128-bit FP data */
- size = 16;
- /* really this is 4 packed SP FP values */
- op->datatype = op_ssimd;
- break;
- case OPTYPE_pd: /* 128-bit FP data */
- size = 16;
- /* really this is 2 packed DP FP values */
- op->datatype = op_dsimd;
- break;
- case OPTYPE_ss: /* Scalar elem of 128-bit FP data */
- size = 16;
- /* this only looks at the low dword (4 bytes)
- * of the xmmm register passed as a param.
- * This is a 16-byte register where only 4 bytes
- * are used in the insn. Painful, ain't it? */
- op->datatype = op_sssimd;
- break;
- case OPTYPE_sd: /* Scalar elem of 128-bit FP data */
- size = 16;
- /* this only looks at the low qword (8 bytes)
- * of the xmmm register passed as a param.
- * This is a 16-byte register where only 8 bytes
- * are used in the insn. Painful, again... */
- op->datatype = op_sdsimd;
- break;
- case OPTYPE_pi: /* qword mmx register */
- size = 8;
- op->datatype = op_qword;
- break;
- case OPTYPE_si: /* dword integer register */
- size = 4;
- op->datatype = op_dword;
- break;
- case OPTYPE_fs: /* single-real */
- size = 4;
- op->datatype = op_sreal;
- break;
- case OPTYPE_fd: /* double real */
- size = 8;
- op->datatype = op_dreal;
- break;
- case OPTYPE_fe: /* extended real */
- size = 10;
- op->datatype = op_extreal;
- break;
- case OPTYPE_fb: /* packed BCD */
- size = 10;
- op->datatype = op_bcd;
- break;
- case OPTYPE_fv: /* pointer to FPU env: 14 or 28-bytes */
- size = (insn->addr_size == 4)? 28 : 14;
- op->datatype = (size == 28)? op_fpuenv32: op_fpuenv16;
- break;
- case OPTYPE_ft: /* pointer to FPU env: 94 or 108 bytes */
- size = (insn->addr_size == 4)? 108 : 94;
- op->datatype = (size == 108)?
- op_fpustate32: op_fpustate16;
- break;
- case OPTYPE_fx: /* 512-byte register stack */
- size = 512;
- op->datatype = op_fpregset;
- break;
- case OPTYPE_fp: /* floating point register */
- size = 10; /* double extended precision */
- op->datatype = op_fpreg;
- break;
- case OPTYPE_m: /* fake operand type used for "lea Gv, M" */
- size = insn->addr_size;
- op->datatype = (size == 4) ? op_dword : op_word;
- break;
- case OPTYPE_none: /* handle weird instructions that have no encoding but use a dword datatype, like invlpg */
- size = 0;
- op->datatype = op_none;
- break;
- case 0:
- default:
- size = insn->op_size;
- op->datatype = (size == 4) ? op_dword : op_word;
- break;
- }
- return size;
-}
-
-size_t ia32_decode_operand( unsigned char *buf, size_t buf_len,
- x86_insn_t *insn, unsigned int raw_op,
- unsigned int raw_flags, unsigned int prefixes,
- unsigned char modrm ) {
- unsigned int addr_meth, op_type, op_size, gen_regs;
- x86_op_t *op;
- size_t size;
-
- /* ++ Yank optype and addr mode out of operand flags */
- addr_meth = raw_flags & ADDRMETH_MASK;
- op_type = raw_flags & OPTYPE_MASK;
-
- if ( raw_flags == ARG_NONE ) {
- /* operand is not used in this instruction */
- return 0;
- }
-
- /* allocate a new operand */
- op = x86_operand_new( insn );
-
- /* ++ Copy flags from opcode table to x86_insn_t */
- op->access = (enum x86_op_access) OP_PERM(raw_flags);
- op->flags = (enum x86_op_flags) (OP_FLAGS(raw_flags) >> 12);
-
- /* Get size (for decoding) and datatype of operand */
- op_size = decode_operand_size(op_type, insn, op);
-
- /* override default register set based on Operand Type */
- /* this allows mixing of 8, 16, and 32 bit regs in insn */
- if (op_size == 1) {
- gen_regs = REG_BYTE_OFFSET;
- } else if (op_size == 2) {
- gen_regs = REG_WORD_OFFSET;
- } else {
- gen_regs = REG_DWORD_OFFSET;
- }
-
- size = decode_operand_value( buf, buf_len, op, insn, addr_meth,
- op_size, raw_op, modrm, gen_regs );
-
- /* if operand is an address, apply any segment override prefixes */
- if ( op->type == op_expression || op->type == op_offset ) {
- apply_seg(op, prefixes);
- }
-
- return size; /* return number of bytes in instruction */
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.h
deleted file mode 100644
index 08c3074cd7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_operand.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef IA32_OPERAND_H
-#define IA32_OPERAND_H
-
-#include "libdis.h"
-#include "ia32_insn.h"
-
-size_t ia32_decode_operand( unsigned char *buf, size_t buf_len,
- x86_insn_t *insn, unsigned int raw_op,
- unsigned int raw_flags, unsigned int prefixes,
- unsigned char modrm );
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.c
deleted file mode 100644
index f270c1f346..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.c
+++ /dev/null
@@ -1,234 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-
-#include "ia32_reg.h"
-#include "ia32_insn.h"
-
-#define NUM_X86_REGS 92
-
-/* register sizes */
-#define REG_DWORD_SIZE 4
-#define REG_WORD_SIZE 2
-#define REG_BYTE_SIZE 1
-#define REG_MMX_SIZE 8
-#define REG_SIMD_SIZE 16
-#define REG_DEBUG_SIZE 4
-#define REG_CTRL_SIZE 4
-#define REG_TEST_SIZE 4
-#define REG_SEG_SIZE 2
-#define REG_FPU_SIZE 10
-#define REG_FLAGS_SIZE 4
-#define REG_FPCTRL_SIZE 2
-#define REG_FPSTATUS_SIZE 2
-#define REG_FPTAG_SIZE 2
-#define REG_EIP_SIZE 4
-#define REG_IP_SIZE 2
-
-/* REGISTER ALIAS TABLE:
- *
- * NOTE: the MMX register mapping is fixed to the physical registers
- * used by the FPU. The floating FP stack does not effect the location
- * of the MMX registers, so this aliasing is not 100% accurate.
- * */
-static struct {
- unsigned char alias; /* id of register this is an alias for */
- unsigned char shift; /* # of bits register must be shifted */
-} ia32_reg_aliases[] = {
- { 0,0 },
- { REG_DWORD_OFFSET, 0 }, /* al : 1 */
- { REG_DWORD_OFFSET, 8 }, /* ah : 2 */
- { REG_DWORD_OFFSET, 0 }, /* ax : 3 */
- { REG_DWORD_OFFSET + 1, 0 }, /* cl : 4 */
- { REG_DWORD_OFFSET + 1, 8 }, /* ch : 5 */
- { REG_DWORD_OFFSET + 1, 0 }, /* cx : 6 */
- { REG_DWORD_OFFSET + 2, 0 }, /* dl : 7 */
- { REG_DWORD_OFFSET + 2, 8 }, /* dh : 8 */
- { REG_DWORD_OFFSET + 2, 0 }, /* dx : 9 */
- { REG_DWORD_OFFSET + 3, 0 }, /* bl : 10 */
- { REG_DWORD_OFFSET + 3, 8 }, /* bh : 11 */
- { REG_DWORD_OFFSET + 3, 0 }, /* bx : 12 */
- { REG_DWORD_OFFSET + 4, 0 }, /* sp : 13 */
- { REG_DWORD_OFFSET + 5, 0 }, /* bp : 14 */
- { REG_DWORD_OFFSET + 6, 0 }, /* si : 15 */
- { REG_DWORD_OFFSET + 7, 0 }, /* di : 16 */
- { REG_EIP_INDEX, 0 }, /* ip : 17 */
- { REG_FPU_OFFSET, 0 }, /* mm0 : 18 */
- { REG_FPU_OFFSET + 1, 0 }, /* mm1 : 19 */
- { REG_FPU_OFFSET + 2, 0 }, /* mm2 : 20 */
- { REG_FPU_OFFSET + 3, 0 }, /* mm3 : 21 */
- { REG_FPU_OFFSET + 4, 0 }, /* mm4 : 22 */
- { REG_FPU_OFFSET + 5, 0 }, /* mm5 : 23 */
- { REG_FPU_OFFSET + 6, 0 }, /* mm6 : 24 */
- { REG_FPU_OFFSET + 7, 0 } /* mm7 : 25 */
- };
-
-/* REGISTER TABLE: size, type, and name of every register in the
- * CPU. Does not include MSRs since the are, after all,
- * model specific. */
-static struct {
- unsigned int size;
- enum x86_reg_type type;
- unsigned int alias;
- char mnemonic[8];
-} ia32_reg_table[NUM_X86_REGS + 2] = {
- { 0, 0, 0, "" },
- /* REG_DWORD_OFFSET */
- { REG_DWORD_SIZE, reg_gen | reg_ret, 0, "eax" },
- { REG_DWORD_SIZE, reg_gen | reg_count, 0, "ecx" },
- { REG_DWORD_SIZE, reg_gen, 0, "edx" },
- { REG_DWORD_SIZE, reg_gen, 0, "ebx" },
- /* REG_ESP_INDEX */
- { REG_DWORD_SIZE, reg_gen | reg_sp, 0, "esp" },
- { REG_DWORD_SIZE, reg_gen | reg_fp, 0, "ebp" },
- { REG_DWORD_SIZE, reg_gen | reg_src, 0, "esi" },
- { REG_DWORD_SIZE, reg_gen | reg_dest, 0, "edi" },
- /* REG_WORD_OFFSET */
- { REG_WORD_SIZE, reg_gen | reg_ret, 3, "ax" },
- { REG_WORD_SIZE, reg_gen | reg_count, 6, "cx" },
- { REG_WORD_SIZE, reg_gen, 9, "dx" },
- { REG_WORD_SIZE, reg_gen, 12, "bx" },
- { REG_WORD_SIZE, reg_gen | reg_sp, 13, "sp" },
- { REG_WORD_SIZE, reg_gen | reg_fp, 14, "bp" },
- { REG_WORD_SIZE, reg_gen | reg_src, 15, "si" },
- { REG_WORD_SIZE, reg_gen | reg_dest, 16, "di" },
- /* REG_BYTE_OFFSET */
- { REG_BYTE_SIZE, reg_gen, 1, "al" },
- { REG_BYTE_SIZE, reg_gen, 4, "cl" },
- { REG_BYTE_SIZE, reg_gen, 7, "dl" },
- { REG_BYTE_SIZE, reg_gen, 10, "bl" },
- { REG_BYTE_SIZE, reg_gen, 2, "ah" },
- { REG_BYTE_SIZE, reg_gen, 5, "ch" },
- { REG_BYTE_SIZE, reg_gen, 8, "dh" },
- { REG_BYTE_SIZE, reg_gen, 11, "bh" },
- /* REG_MMX_OFFSET */
- { REG_MMX_SIZE, reg_simd, 18, "mm0" },
- { REG_MMX_SIZE, reg_simd, 19, "mm1" },
- { REG_MMX_SIZE, reg_simd, 20, "mm2" },
- { REG_MMX_SIZE, reg_simd, 21, "mm3" },
- { REG_MMX_SIZE, reg_simd, 22, "mm4" },
- { REG_MMX_SIZE, reg_simd, 23, "mm5" },
- { REG_MMX_SIZE, reg_simd, 24, "mm6" },
- { REG_MMX_SIZE, reg_simd, 25, "mm7" },
- /* REG_SIMD_OFFSET */
- { REG_SIMD_SIZE, reg_simd, 0, "xmm0" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm1" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm2" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm3" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm4" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm5" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm6" },
- { REG_SIMD_SIZE, reg_simd, 0, "xmm7" },
- /* REG_DEBUG_OFFSET */
- { REG_DEBUG_SIZE, reg_sys, 0, "dr0" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr1" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr2" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr3" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr4" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr5" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr6" },
- { REG_DEBUG_SIZE, reg_sys, 0, "dr7" },
- /* REG_CTRL_OFFSET */
- { REG_CTRL_SIZE, reg_sys, 0, "cr0" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr1" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr2" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr3" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr4" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr5" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr6" },
- { REG_CTRL_SIZE, reg_sys, 0, "cr7" },
- /* REG_TEST_OFFSET */
- { REG_TEST_SIZE, reg_sys, 0, "tr0" },
- { REG_TEST_SIZE, reg_sys, 0, "tr1" },
- { REG_TEST_SIZE, reg_sys, 0, "tr2" },
- { REG_TEST_SIZE, reg_sys, 0, "tr3" },
- { REG_TEST_SIZE, reg_sys, 0, "tr4" },
- { REG_TEST_SIZE, reg_sys, 0, "tr5" },
- { REG_TEST_SIZE, reg_sys, 0, "tr6" },
- { REG_TEST_SIZE, reg_sys, 0, "tr7" },
- /* REG_SEG_OFFSET */
- { REG_SEG_SIZE, reg_seg, 0, "es" },
- { REG_SEG_SIZE, reg_seg, 0, "cs" },
- { REG_SEG_SIZE, reg_seg, 0, "ss" },
- { REG_SEG_SIZE, reg_seg, 0, "ds" },
- { REG_SEG_SIZE, reg_seg, 0, "fs" },
- { REG_SEG_SIZE, reg_seg, 0, "gs" },
- /* REG_LDTR_INDEX */
- { REG_DWORD_SIZE, reg_sys, 0, "ldtr" },
- /* REG_GDTR_INDEX */
- { REG_DWORD_SIZE, reg_sys, 0, "gdtr" },
- /* REG_FPU_OFFSET */
- { REG_FPU_SIZE, reg_fpu, 0, "st(0)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(1)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(2)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(3)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(4)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(5)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(6)" },
- { REG_FPU_SIZE, reg_fpu, 0, "st(7)" },
- /* REG_FLAGS_INDEX : 81 */
- { REG_FLAGS_SIZE, reg_cond, 0, "eflags" },
- /* REG_FPCTRL_INDEX : 82*/
- { REG_FPCTRL_SIZE, reg_fpu | reg_sys, 0, "fpctrl" },
- /* REG_FPSTATUS_INDEX : 83*/
- { REG_FPSTATUS_SIZE, reg_fpu | reg_sys, 0, "fpstat" },
- /* REG_FPTAG_INDEX : 84 */
- { REG_FPTAG_SIZE, reg_fpu | reg_sys, 0, "fptag" },
- /* REG_EIP_INDEX : 85 */
- { REG_EIP_SIZE, reg_pc, 0, "eip" },
- /* REG_IP_INDEX : 86 */
- { REG_IP_SIZE, reg_pc, 17, "ip" },
- /* REG_IDTR_INDEX : 87 */
- { REG_DWORD_SIZE, reg_sys, 0, "idtr" },
- /* REG_MXCSG_INDEX : SSE Control Reg : 88 */
- { REG_DWORD_SIZE, reg_sys | reg_simd, 0, "mxcsr" },
- /* REG_TR_INDEX : Task Register : 89 */
- { 16 + 64, reg_sys, 0, "tr" },
- /* REG_CSMSR_INDEX : SYSENTER_CS_MSR : 90 */
- { REG_DWORD_SIZE, reg_sys, 0, "cs_msr" },
- /* REG_ESPMSR_INDEX : SYSENTER_ESP_MSR : 91 */
- { REG_DWORD_SIZE, reg_sys, 0, "esp_msr" },
- /* REG_EIPMSR_INDEX : SYSENTER_EIP_MSR : 92 */
- { REG_DWORD_SIZE, reg_sys, 0, "eip_msr" },
- { 0 }
- };
-
-
-static size_t sz_regtable = NUM_X86_REGS + 1;
-
-
-void ia32_handle_register( x86_reg_t *reg, size_t id ) {
- unsigned int alias;
- if (! id || id > sz_regtable ) {
- return;
- }
-
- memset( reg, 0, sizeof(x86_reg_t) );
-
- strncpy( reg->name, ia32_reg_table[id].mnemonic, MAX_REGNAME );
-
- reg->type = ia32_reg_table[id].type;
- reg->size = ia32_reg_table[id].size;
-
- alias = ia32_reg_table[id].alias;
- if ( alias ) {
- reg->alias = ia32_reg_aliases[alias].alias;
- reg->shift = ia32_reg_aliases[alias].shift;
- }
- reg->id = id;
-
- return;
-}
-
-size_t ia32_true_register_id( size_t id ) {
- size_t reg;
-
- if (! id || id > sz_regtable ) {
- return 0;
- }
-
- reg = id;
- if (ia32_reg_table[reg].alias) {
- reg = ia32_reg_aliases[ia32_reg_table[reg].alias].alias;
- }
- return reg;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.h
deleted file mode 100644
index fbbc77a178..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_reg.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#ifndef IA32_REG_H
-#define IA32_REG_H
-
-#include <sys/types.h> /* for size_t */
-#include "libdis.h" /* for x86_reg_t */
-
-/* NOTE these are used in opcode tables for hard-coded registers */
-#define REG_DWORD_OFFSET 1 /* 0 + 1 */
-#define REG_ECX_INDEX 2 /* 0 + 1 + 1 */
-#define REG_ESP_INDEX 5 /* 0 + 4 + 1 */
-#define REG_EBP_INDEX 6 /* 0 + 5 + 1 */
-#define REG_ESI_INDEX 7 /* 0 + 6 + 1 */
-#define REG_EDI_INDEX 8 /* 0 + 7 + 1 */
-#define REG_WORD_OFFSET 9 /* 1 * 8 + 1 */
-#define REG_BYTE_OFFSET 17 /* 2 * 8 + 1 */
-#define REG_MMX_OFFSET 25 /* 3 * 8 + 1 */
-#define REG_SIMD_OFFSET 33 /* 4 * 8 + 1 */
-#define REG_DEBUG_OFFSET 41 /* 5 * 8 + 1 */
-#define REG_CTRL_OFFSET 49 /* 6 * 8 + 1 */
-#define REG_TEST_OFFSET 57 /* 7 * 8 + 1 */
-#define REG_SEG_OFFSET 65 /* 8 * 8 + 1 */
-#define REG_LDTR_INDEX 71 /* 8 * 8 + 1 + 1 */
-#define REG_GDTR_INDEX 72 /* 8 * 8 + 2 + 1 */
-#define REG_FPU_OFFSET 73 /* 9 * 8 + 1 */
-#define REG_FLAGS_INDEX 81 /* 10 * 8 + 1 */
-#define REG_FPCTRL_INDEX 82 /* 10 * 8 + 1 + 1 */
-#define REG_FPSTATUS_INDEX 83 /* 10 * 8 + 2 + 1 */
-#define REG_FPTAG_INDEX 84 /* 10 * 8 + 3 + 1 */
-#define REG_EIP_INDEX 85 /* 10 * 8 + 4 + 1 */
-#define REG_IP_INDEX 86 /* 10 * 8 + 5 + 1 */
-#define REG_IDTR_INDEX 87 /* 10 * 8 + 6 + 1 */
-#define REG_MXCSG_INDEX 88 /* 10 * 8 + 7 + 1 */
-#define REG_TR_INDEX 89 /* 10 * 8 + 8 + 1 */
-#define REG_CSMSR_INDEX 90 /* 10 * 8 + 9 + 1 */
-#define REG_ESPMSR_INDEX 91 /* 10 * 8 + 10 + 1 */
-#define REG_EIPMSR_INDEX 92 /* 10 * 8 + 11 + 1 */
-
-void ia32_handle_register( x86_reg_t *reg, size_t id );
-size_t ia32_true_register_id( size_t id );
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.c
deleted file mode 100644
index b578e34488..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.c
+++ /dev/null
@@ -1,13 +0,0 @@
-#include "libdis.h"
-#include "ia32_settings.h"
-#include "ia32_reg.h"
-#include "ia32_insn.h"
-
-ia32_settings_t ia32_settings = {
- 1, 0xF4,
- MAX_INSTRUCTION_SIZE,
- 4, 4, 8, 4, 8,
- REG_ESP_INDEX, REG_EBP_INDEX, REG_EIP_INDEX, REG_FLAGS_INDEX,
- REG_DWORD_OFFSET, REG_SEG_OFFSET, REG_FPU_OFFSET,
- opt_none
-};
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.h
deleted file mode 100644
index 769c0e9fa0..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/ia32_settings.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef IA32_SETTINGS_H
-#define IA32_SETTINGS_H
-
-#include "libdis.h"
-
-typedef struct {
- /* options */
- unsigned char endian, /* 0 = big, 1 = little */
- wc_byte, /* wildcard byte */
- max_insn, /* max insn size */
- sz_addr, /* default address size */
- sz_oper, /* default operand size */
- sz_byte, /* # bits in byte */
- sz_word, /* # bytes in machine word */
- sz_dword; /* # bytes in machine dword */
- unsigned int id_sp_reg, /* id of stack pointer */
- id_fp_reg, /* id of frame pointer */
- id_ip_reg, /* id of instruction pointer */
- id_flag_reg, /* id of flags register */
- offset_gen_regs, /* start of general regs */
- offset_seg_regs, /* start of segment regs */
- offset_fpu_regs; /* start of floating point regs */
- /* user-controlled settings */
- enum x86_options options;
-} ia32_settings_t;
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdis.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdis.h
deleted file mode 100644
index 83a88612a3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdis.h
+++ /dev/null
@@ -1,832 +0,0 @@
-#ifndef LIBDISASM_H
-#define LIBDISASM_H
-
-#include <stdint.h>
-
-/* 'NEW" types
- * __________________________________________________________________________*/
-#ifndef LIBDISASM_QWORD_H /* do not interfere with qword.h */
- #define LIBDISASM_QWORD_H
- #ifdef _MSC_VER
- typedef __int64 qword_t;
- #else
- typedef int64_t qword_t;
- #endif
-#endif
-
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* 'NEW" x86 API
- * __________________________________________________________________________*/
-
-
-/* ========================================= Error Reporting */
-/* REPORT CODES
- * These are passed to a reporter function passed at initialization.
- * Each code determines the type of the argument passed to the reporter;
- * this allows the report to recover from errors, or just log them.
- */
-enum x86_report_codes {
- report_disasm_bounds, /* RVA OUT OF BOUNDS : The disassembler could
- not disassemble the supplied RVA as it is
- out of the range of the buffer. The
- application should store the address and
- attempt to determine what section of the
- binary it is in, then disassemble the
- address from the bytes in that section.
- data: uint32_t rva */
- report_insn_bounds, /* INSTRUCTION OUT OF BOUNDS: The disassembler
- could not disassemble the instruction as
- the instruction would require bytes beyond
- the end of the current buffer. This usually
- indicated garbage bytes at the end of a
- buffer, or an incorrectly-sized buffer.
- data: uint32_t rva */
- report_invalid_insn, /* INVALID INSTRUCTION: The disassembler could
- not disassemble the instruction as it has an
- invalid combination of opcodes and operands.
- This will stop automated disassembly; the
- application can restart the disassembly
- after the invalid instruction.
- data: uint32_t rva */
- report_unknown
-};
-
-/* 'arg' is optional arbitrary data provided by the code passing the
- * callback -- for example, it could be 'this' or 'self' in OOP code.
- * 'code' is provided by libdisasm, it is one of the above
- * 'data' is provided by libdisasm and is context-specific, per the enums */
-typedef void (*DISASM_REPORTER)( enum x86_report_codes code,
- void *data, void *arg );
-
-
-/* x86_report_error : Call the register reporter to report an error */
-void x86_report_error( enum x86_report_codes code, void *data );
-
-/* ========================================= Libdisasm Management Routines */
-enum x86_options { /* these can be ORed together */
- opt_none= 0,
- opt_ignore_nulls=1, /* ignore sequences of > 4 NULL bytes */
- opt_16_bit=2, /* 16-bit/DOS disassembly */
- opt_att_mnemonics=4, /* use AT&T syntax names for alternate opcode mnemonics */
-};
-
-/* management routines */
-/* 'arg' is caller-specific data which is passed as the first argument
- * to the reporter callback routine */
-int x86_init( enum x86_options options, DISASM_REPORTER reporter, void *arg);
-void x86_set_reporter( DISASM_REPORTER reporter, void *arg);
-void x86_set_options( enum x86_options options );
-enum x86_options x86_get_options( void );
-int x86_cleanup(void);
-
-
-/* ========================================= Instruction Representation */
-/* these defines are only intended for use in the array decl's */
-#define MAX_REGNAME 8
-
-#define MAX_PREFIX_STR 32
-#define MAX_MNEM_STR 16
-#define MAX_INSN_SIZE 20 /* same as in i386.h */
-#define MAX_OP_STRING 32 /* max possible operand size in string form */
-#define MAX_OP_RAW_STRING 64 /* max possible operand size in raw form */
-#define MAX_OP_XML_STRING 256 /* max possible operand size in xml form */
-#define MAX_NUM_OPERANDS 8 /* max # implicit and explicit operands */
-/* in these, the '2 *' is arbitrary: the max # of operands should require
- * more space than the rest of the insn */
-#define MAX_INSN_STRING 512 /* 2 * 8 * MAX_OP_STRING */
-#define MAX_INSN_RAW_STRING 1024 /* 2 * 8 * MAX_OP_RAW_STRING */
-#define MAX_INSN_XML_STRING 4096 /* 2 * 8 * MAX_OP_XML_STRING */
-
-enum x86_reg_type { /* NOTE: these may be ORed together */
- reg_gen = 0x00001, /* general purpose */
- reg_in = 0x00002, /* incoming args, ala RISC */
- reg_out = 0x00004, /* args to calls, ala RISC */
- reg_local = 0x00008, /* local vars, ala RISC */
- reg_fpu = 0x00010, /* FPU data register */
- reg_seg = 0x00020, /* segment register */
- reg_simd = 0x00040, /* SIMD/MMX reg */
- reg_sys = 0x00080, /* restricted/system register */
- reg_sp = 0x00100, /* stack pointer */
- reg_fp = 0x00200, /* frame pointer */
- reg_pc = 0x00400, /* program counter */
- reg_retaddr = 0x00800, /* return addr for func */
- reg_cond = 0x01000, /* condition code / flags */
- reg_zero = 0x02000, /* zero register, ala RISC */
- reg_ret = 0x04000, /* return value */
- reg_src = 0x10000, /* array/rep source */
- reg_dest = 0x20000, /* array/rep destination */
- reg_count = 0x40000 /* array/rep/loop counter */
-};
-
-/* x86_reg_t : an X86 CPU register */
-typedef struct {
- char name[MAX_REGNAME];
- enum x86_reg_type type; /* what register is used for */
- unsigned int size; /* size of register in bytes */
- unsigned int id; /* register ID #, for quick compares */
- unsigned int alias; /* ID of reg this is an alias for */
- unsigned int shift; /* amount to shift aliased reg by */
-} x86_reg_t;
-
-/* x86_ea_t : an X86 effective address (address expression) */
-typedef struct {
- unsigned int scale; /* scale factor */
- x86_reg_t index, base; /* index, base registers */
- int32_t disp; /* displacement */
- char disp_sign; /* is negative? 1/0 */
- char disp_size; /* 0, 1, 2, 4 */
-} x86_ea_t;
-
-/* x86_absolute_t : an X86 segment:offset address (descriptor) */
-typedef struct {
- unsigned short segment; /* loaded directly into CS */
- union {
- unsigned short off16; /* loaded directly into IP */
- uint32_t off32; /* loaded directly into EIP */
- } offset;
-} x86_absolute_t;
-
-enum x86_op_type { /* mutually exclusive */
- op_unused = 0, /* empty/unused operand: should never occur */
- op_register = 1, /* CPU register */
- op_immediate = 2, /* Immediate Value */
- op_relative_near = 3, /* Relative offset from IP */
- op_relative_far = 4, /* Relative offset from IP */
- op_absolute = 5, /* Absolute address (ptr16:32) */
- op_expression = 6, /* Address expression (scale/index/base/disp) */
- op_offset = 7, /* Offset from start of segment (m32) */
- op_unknown
-};
-
-#define x86_optype_is_address( optype ) \
- ( optype == op_absolute || optype == op_offset )
-#define x86_optype_is_relative( optype ) \
- ( optype == op_relative_near || optype == op_relative_far )
-#define x86_optype_is_memory( optype ) \
- ( optype > op_immediate && optype < op_unknown )
-
-enum x86_op_datatype { /* these use Intel's lame terminology */
- op_byte = 1, /* 1 byte integer */
- op_word = 2, /* 2 byte integer */
- op_dword = 3, /* 4 byte integer */
- op_qword = 4, /* 8 byte integer */
- op_dqword = 5, /* 16 byte integer */
- op_sreal = 6, /* 4 byte real (single real) */
- op_dreal = 7, /* 8 byte real (double real) */
- op_extreal = 8, /* 10 byte real (extended real) */
- op_bcd = 9, /* 10 byte binary-coded decimal */
- op_ssimd = 10, /* 16 byte : 4 packed single FP (SIMD, MMX) */
- op_dsimd = 11, /* 16 byte : 2 packed double FP (SIMD, MMX) */
- op_sssimd = 12, /* 4 byte : scalar single FP (SIMD, MMX) */
- op_sdsimd = 13, /* 8 byte : scalar double FP (SIMD, MMX) */
- op_descr32 = 14, /* 6 byte Intel descriptor 2:4 */
- op_descr16 = 15, /* 4 byte Intel descriptor 2:2 */
- op_pdescr32 = 16, /* 6 byte Intel pseudo-descriptor 32:16 */
- op_pdescr16 = 17, /* 6 byte Intel pseudo-descriptor 8:24:16 */
- op_bounds16 = 18, /* signed 16:16 lower:upper bounds */
- op_bounds32 = 19, /* signed 32:32 lower:upper bounds */
- op_fpuenv16 = 20, /* 14 byte FPU control/environment data */
- op_fpuenv32 = 21, /* 28 byte FPU control/environment data */
- op_fpustate16 = 22, /* 94 byte FPU state (env & reg stack) */
- op_fpustate32 = 23, /* 108 byte FPU state (env & reg stack) */
- op_fpregset = 24, /* 512 bytes: register set */
- op_fpreg = 25, /* FPU register */
- op_none = 0xFF, /* operand without a datatype (INVLPG) */
-};
-
-enum x86_op_access { /* ORed together */
- op_read = 1,
- op_write = 2,
- op_execute = 4
-};
-
-enum x86_op_flags { /* ORed together, but segs are mutually exclusive */
- op_signed = 1, /* signed integer */
- op_string = 2, /* possible string or array */
- op_constant = 4, /* symbolic constant */
- op_pointer = 8, /* operand points to a memory address */
- op_sysref = 0x010, /* operand is a syscall number */
- op_implied = 0x020, /* operand is implicit in the insn */
- op_hardcode = 0x40, /* operand is hardcoded in insn definition */
- /* NOTE: an 'implied' operand is one which can be considered a side
- * effect of the insn, e.g. %esp being modified by PUSH or POP. A
- * 'hard-coded' operand is one which is specified in the instruction
- * definition, e.g. %es:%edi in MOVSB or 1 in ROL Eb, 1. The difference
- * is that hard-coded operands are printed by disassemblers and are
- * required to re-assemble, while implicit operands are invisible. */
- op_es_seg = 0x100, /* ES segment override */
- op_cs_seg = 0x200, /* CS segment override */
- op_ss_seg = 0x300, /* SS segment override */
- op_ds_seg = 0x400, /* DS segment override */
- op_fs_seg = 0x500, /* FS segment override */
- op_gs_seg = 0x600 /* GS segment override */
-};
-
-/* x86_op_t : an X86 instruction operand */
-typedef struct {
- enum x86_op_type type; /* operand type */
- enum x86_op_datatype datatype; /* operand size */
- enum x86_op_access access; /* operand access [RWX] */
- enum x86_op_flags flags; /* misc flags */
- union {
- /* sizeof will have to work on these union members! */
- /* immediate values */
- char sbyte;
- short sword;
- int32_t sdword;
- qword_t sqword;
- unsigned char byte;
- unsigned short word;
- uint32_t dword;
- qword_t qword;
- float sreal;
- double dreal;
- /* misc large/non-native types */
- unsigned char extreal[10];
- unsigned char bcd[10];
- qword_t dqword[2];
- unsigned char simd[16];
- unsigned char fpuenv[28];
- /* offset from segment */
- uint32_t offset;
- /* ID of CPU register */
- x86_reg_t reg;
- /* offsets from current insn */
- char relative_near;
- int32_t relative_far;
- /* segment:offset */
- x86_absolute_t absolute;
- /* effective address [expression] */
- x86_ea_t expression;
- } data;
- /* this is needed to make formatting operands more sane */
- void * insn; /* pointer to x86_insn_t owning operand */
-} x86_op_t;
-
-/* Linked list of x86_op_t; provided for manual traversal of the operand
- * list in an insn. Users wishing to add operands to this list, e.g. to add
- * implicit operands, should use x86_operand_new in x86_operand_list.h */
-typedef struct x86_operand_list {
- x86_op_t op;
- struct x86_operand_list *next;
-} x86_oplist_t;
-
-enum x86_insn_group {
- insn_none = 0, /* invalid instruction */
- insn_controlflow = 1,
- insn_arithmetic = 2,
- insn_logic = 3,
- insn_stack = 4,
- insn_comparison = 5,
- insn_move = 6,
- insn_string = 7,
- insn_bit_manip = 8,
- insn_flag_manip = 9,
- insn_fpu = 10,
- insn_interrupt = 13,
- insn_system = 14,
- insn_other = 15
-};
-
-enum x86_insn_type {
- insn_invalid = 0, /* invalid instruction */
- /* insn_controlflow */
- insn_jmp = 0x1001,
- insn_jcc = 0x1002,
- insn_call = 0x1003,
- insn_callcc = 0x1004,
- insn_return = 0x1005,
- /* insn_arithmetic */
- insn_add = 0x2001,
- insn_sub = 0x2002,
- insn_mul = 0x2003,
- insn_div = 0x2004,
- insn_inc = 0x2005,
- insn_dec = 0x2006,
- insn_shl = 0x2007,
- insn_shr = 0x2008,
- insn_rol = 0x2009,
- insn_ror = 0x200A,
- /* insn_logic */
- insn_and = 0x3001,
- insn_or = 0x3002,
- insn_xor = 0x3003,
- insn_not = 0x3004,
- insn_neg = 0x3005,
- /* insn_stack */
- insn_push = 0x4001,
- insn_pop = 0x4002,
- insn_pushregs = 0x4003,
- insn_popregs = 0x4004,
- insn_pushflags = 0x4005,
- insn_popflags = 0x4006,
- insn_enter = 0x4007,
- insn_leave = 0x4008,
- /* insn_comparison */
- insn_test = 0x5001,
- insn_cmp = 0x5002,
- /* insn_move */
- insn_mov = 0x6001, /* move */
- insn_movcc = 0x6002, /* conditional move */
- insn_xchg = 0x6003, /* exchange */
- insn_xchgcc = 0x6004, /* conditional exchange */
- /* insn_string */
- insn_strcmp = 0x7001,
- insn_strload = 0x7002,
- insn_strmov = 0x7003,
- insn_strstore = 0x7004,
- insn_translate = 0x7005, /* xlat */
- /* insn_bit_manip */
- insn_bittest = 0x8001,
- insn_bitset = 0x8002,
- insn_bitclear = 0x8003,
- /* insn_flag_manip */
- insn_clear_carry = 0x9001,
- insn_clear_zero = 0x9002,
- insn_clear_oflow = 0x9003,
- insn_clear_dir = 0x9004,
- insn_clear_sign = 0x9005,
- insn_clear_parity = 0x9006,
- insn_set_carry = 0x9007,
- insn_set_zero = 0x9008,
- insn_set_oflow = 0x9009,
- insn_set_dir = 0x900A,
- insn_set_sign = 0x900B,
- insn_set_parity = 0x900C,
- insn_tog_carry = 0x9010,
- insn_tog_zero = 0x9020,
- insn_tog_oflow = 0x9030,
- insn_tog_dir = 0x9040,
- insn_tog_sign = 0x9050,
- insn_tog_parity = 0x9060,
- /* insn_fpu */
- insn_fmov = 0xA001,
- insn_fmovcc = 0xA002,
- insn_fneg = 0xA003,
- insn_fabs = 0xA004,
- insn_fadd = 0xA005,
- insn_fsub = 0xA006,
- insn_fmul = 0xA007,
- insn_fdiv = 0xA008,
- insn_fsqrt = 0xA009,
- insn_fcmp = 0xA00A,
- insn_fcos = 0xA00C,
- insn_fldpi = 0xA00D,
- insn_fldz = 0xA00E,
- insn_ftan = 0xA00F,
- insn_fsine = 0xA010,
- insn_fsys = 0xA020,
- /* insn_interrupt */
- insn_int = 0xD001,
- insn_intcc = 0xD002, /* not present in x86 ISA */
- insn_iret = 0xD003,
- insn_bound = 0xD004,
- insn_debug = 0xD005,
- insn_trace = 0xD006,
- insn_invalid_op = 0xD007,
- insn_oflow = 0xD008,
- /* insn_system */
- insn_halt = 0xE001,
- insn_in = 0xE002, /* input from port/bus */
- insn_out = 0xE003, /* output to port/bus */
- insn_cpuid = 0xE004,
- /* insn_other */
- insn_nop = 0xF001,
- insn_bcdconv = 0xF002, /* convert to or from BCD */
- insn_szconv = 0xF003 /* change size of operand */
-};
-
-/* These flags specify special characteristics of the instruction, such as
- * whether the inatruction is privileged or whether it serializes the
- * pipeline.
- * NOTE : These may not be accurate for all instructions; updates to the
- * opcode tables have not been completed. */
-enum x86_insn_note {
- insn_note_ring0 = 1, /* Only available in ring 0 */
- insn_note_smm = 2, /* "" in System Management Mode */
- insn_note_serial = 4, /* Serializing instruction */
- insn_note_nonswap = 8, /* Does not swap arguments in att-style formatting */
- insn_note_nosuffix = 16, /* Does not have size suffix in att-style formatting */
-};
-
-/* This specifies what effects the instruction has on the %eflags register */
-enum x86_flag_status {
- insn_carry_set = 0x1, /* CF */
- insn_zero_set = 0x2, /* ZF */
- insn_oflow_set = 0x4, /* OF */
- insn_dir_set = 0x8, /* DF */
- insn_sign_set = 0x10, /* SF */
- insn_parity_set = 0x20, /* PF */
- insn_carry_or_zero_set = 0x40,
- insn_zero_set_or_sign_ne_oflow = 0x80,
- insn_carry_clear = 0x100,
- insn_zero_clear = 0x200,
- insn_oflow_clear = 0x400,
- insn_dir_clear = 0x800,
- insn_sign_clear = 0x1000,
- insn_parity_clear = 0x2000,
- insn_sign_eq_oflow = 0x4000,
- insn_sign_ne_oflow = 0x8000
-};
-
-/* The CPU model in which the insturction first appeared; this can be used
- * to mask out instructions appearing in earlier or later models or to
- * check the portability of a binary.
- * NOTE : These may not be accurate for all instructions; updates to the
- * opcode tables have not been completed. */
-enum x86_insn_cpu {
- cpu_8086 = 1, /* Intel */
- cpu_80286 = 2,
- cpu_80386 = 3,
- cpu_80387 = 4,
- cpu_80486 = 5,
- cpu_pentium = 6,
- cpu_pentiumpro = 7,
- cpu_pentium2 = 8,
- cpu_pentium3 = 9,
- cpu_pentium4 = 10,
- cpu_k6 = 16, /* AMD */
- cpu_k7 = 32,
- cpu_athlon = 48
-};
-
-/* CPU ISA subsets: These are derived from the Instruction Groups in
- * Intel Vol 1 Chapter 5; they represent subsets of the IA32 ISA but
- * do not reflect the 'type' of the instruction in the same way that
- * x86_insn_group does. In short, these are AMD/Intel's somewhat useless
- * designations.
- * NOTE : These may not be accurate for all instructions; updates to the
- * opcode tables have not been completed. */
-enum x86_insn_isa {
- isa_gp = 1, /* general purpose */
- isa_fp = 2, /* floating point */
- isa_fpumgt = 3, /* FPU/SIMD management */
- isa_mmx = 4, /* Intel MMX */
- isa_sse1 = 5, /* Intel SSE SIMD */
- isa_sse2 = 6, /* Intel SSE2 SIMD */
- isa_sse3 = 7, /* Intel SSE3 SIMD */
- isa_3dnow = 8, /* AMD 3DNow! SIMD */
- isa_sys = 9 /* system instructions */
-};
-
-enum x86_insn_prefix {
- insn_no_prefix = 0,
- insn_rep_zero = 1, /* REPZ and REPE */
- insn_rep_notzero = 2, /* REPNZ and REPNZ */
- insn_lock = 4 /* LOCK: */
-};
-
-/* TODO: maybe provide insn_new/free(), and have disasm return new insn_t */
-/* x86_insn_t : an X86 instruction */
-typedef struct {
- /* information about the instruction */
- uint32_t addr; /* load address */
- uint32_t offset; /* offset into file/buffer */
- enum x86_insn_group group; /* meta-type, e.g. INS_EXEC */
- enum x86_insn_type type; /* type, e.g. INS_BRANCH */
- enum x86_insn_note note; /* note, e.g. RING0 */
- unsigned char bytes[MAX_INSN_SIZE];
- unsigned char size; /* size of insn in bytes */
- /* 16/32-bit mode settings */
- unsigned char addr_size; /* default address size : 2 or 4 */
- unsigned char op_size; /* default operand size : 2 or 4 */
- /* CPU/instruction set */
- enum x86_insn_cpu cpu;
- enum x86_insn_isa isa;
- /* flags */
- enum x86_flag_status flags_set; /* flags set or tested by insn */
- enum x86_flag_status flags_tested;
- /* stack */
- unsigned char stack_mod; /* 0 or 1 : is the stack modified? */
- int32_t stack_mod_val; /* val stack is modified by if known */
-
- /* the instruction proper */
- enum x86_insn_prefix prefix; /* prefixes ORed together */
- char prefix_string[MAX_PREFIX_STR]; /* prefixes [might be truncated] */
- char mnemonic[MAX_MNEM_STR];
- x86_oplist_t *operands; /* list of explicit/implicit operands */
- size_t operand_count; /* total number of operands */
- size_t explicit_count; /* number of explicit operands */
- /* convenience fields for user */
- void *block; /* code block containing this insn */
- void *function; /* function containing this insn */
- int tag; /* tag the insn as seen/processed */
-} x86_insn_t;
-
-
-/* returns 0 if an instruction is invalid, 1 if valid */
-int x86_insn_is_valid( x86_insn_t *insn );
-
-/* DISASSEMBLY ROUTINES
- * Canonical order of arguments is
- * (buf, buf_len, buf_rva, offset, len, insn, func, arg, resolve_func)
- * ...but of course all of these are not used at the same time.
- */
-
-
-/* Function prototype for caller-supplied callback routine
- * These callbacks are intended to process 'insn' further, e.g. by
- * adding it to a linked list, database, etc */
-typedef void (*DISASM_CALLBACK)( x86_insn_t *insn, void * arg );
-
-/* Function prototype for caller-supplied address resolver.
- * This routine is used to determine the rva to disassemble next, given
- * the 'dest' operand of a jump/call. This allows the caller to resolve
- * jump/call targets stored in a register or on the stack, and also allows
- * the caller to prevent endless loops by checking if an address has
- * already been disassembled. If an address cannot be resolved from the
- * operand, or if the address has already been disassembled, this routine
- * should return -1; in all other cases the RVA to be disassembled next
- * should be returned. */
-typedef int32_t (*DISASM_RESOLVER)( x86_op_t *op, x86_insn_t * current_insn,
- void *arg );
-
-
-/* x86_disasm: Disassemble a single instruction from a buffer of bytes.
- * Returns size of instruction in bytes.
- * Caller is responsible for calling x86_oplist_free() on
- * a reused "insn" to avoid leaking memory when calling this
- * function repeatedly.
- * buf : Buffer of bytes to disassemble
- * buf_len : Length of the buffer
- * buf_rva : Load address of the start of the buffer
- * offset : Offset in buffer to disassemble
- * insn : Structure to fill with disassembled instruction
- */
-unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len,
- uint32_t buf_rva, unsigned int offset,
- x86_insn_t * insn );
-
-/* x86_disasm_range: Sequential disassembly of a range of bytes in a buffer,
- * invoking a callback function each time an instruction
- * is successfully disassembled. The 'range' refers to the
- * bytes between 'offset' and 'offset + len' in the buffer;
- * 'len' is assumed to be less than the length of the buffer.
- * Returns number of instructions processed.
- * buf : Buffer of bytes to disassemble (e.g. .text section)
- * buf_rva : Load address of buffer (e.g. ELF Virtual Address)
- * offset : Offset in buffer to start disassembly at
- * len : Number of bytes to disassemble
- * func : Callback function to invoke (may be NULL)
- * arg : Arbitrary data to pass to callback (may be NULL)
- */
-unsigned int x86_disasm_range( unsigned char *buf, uint32_t buf_rva,
- unsigned int offset, unsigned int len,
- DISASM_CALLBACK func, void *arg );
-
-/* x86_disasm_forward: Flow-of-execution disassembly of the bytes in a buffer,
- * invoking a callback function each time an instruction
- * is successfully disassembled.
- * buf : Buffer to disassemble (e.g. .text section)
- * buf_len : Number of bytes in buffer
- * buf_rva : Load address of buffer (e.g. ELF Virtual Address)
- * offset : Offset in buffer to start disassembly at (e.g. entry point)
- * func : Callback function to invoke (may be NULL)
- * arg : Arbitrary data to pass to callback (may be NULL)
- * resolver: Caller-supplied address resolver. If no resolver is
- * supplied, a default internal one is used -- however the
- * internal resolver does NOT catch loops and could end up
- * disassembling forever..
- * r_arg : Arbitrary data to pass to resolver (may be NULL)
- */
-unsigned int x86_disasm_forward( unsigned char *buf, unsigned int buf_len,
- uint32_t buf_rva, unsigned int offset,
- DISASM_CALLBACK func, void *arg,
- DISASM_RESOLVER resolver, void *r_arg );
-
-/* Instruction operands: these are stored as a list of explicit and
- * implicit operands. It is recommended that the 'foreach' routines
- * be used to when examining operands for purposes of data flow analysis */
-
-/* Operand FOREACH callback: 'arg' is an abritrary parameter passed to the
- * foreach routine, 'insn' is the x86_insn_t whose operands are being
- * iterated over, and 'op' is the current x86_op_t */
-typedef void (*x86_operand_fn)(x86_op_t *op, x86_insn_t *insn, void *arg);
-
-/* FOREACH types: these are used to limit the foreach results to
- * operands which match a certain "type" (implicit or explicit)
- * or which are accessed in certain ways (e.g. read or write). Note
- * that this operates on the operand list of single instruction, so
- * specifying the 'real' operand type (register, memory, etc) is not
- * useful. Note also that by definition Execute Access implies Read
- * Access and implies Not Write Access.
- * The "type" (implicit or explicit) and the access method can
- * be ORed together, e.g. op_wo | op_explicit */
-enum x86_op_foreach_type {
- op_any = 0, /* ALL operands (explicit, implicit, rwx) */
- op_dest = 1, /* operands with Write access */
- op_src = 2, /* operands with Read access */
- op_ro = 3, /* operands with Read but not Write access */
- op_wo = 4, /* operands with Write but not Read access */
- op_xo = 5, /* operands with Execute access */
- op_rw = 6, /* operands with Read AND Write access */
- op_implicit = 0x10, /* operands that are implied by the opcode */
- op_explicit = 0x20 /* operands that are not side-effects */
-};
-
-
-/* free the operand list associated with an instruction -- useful for
- * preventing memory leaks when free()ing an x86_insn_t */
-void x86_oplist_free( x86_insn_t *insn );
-
-/* Operand foreach: invokes 'func' with 'insn' and 'arg' as arguments. The
- * 'type' parameter is used to select only operands matching specific
- * criteria. */
-int x86_operand_foreach( x86_insn_t *insn, x86_operand_fn func, void *arg,
- enum x86_op_foreach_type type);
-
-/* convenience routine: returns count of operands matching 'type' */
-size_t x86_operand_count( x86_insn_t *insn, enum x86_op_foreach_type type );
-
-/* accessor functions for the operands */
-x86_op_t * x86_operand_1st( x86_insn_t *insn );
-x86_op_t * x86_operand_2nd( x86_insn_t *insn );
-x86_op_t * x86_operand_3rd( x86_insn_t *insn );
-
-/* these allow libdisasm 2.0 accessor functions to still be used */
-#define x86_get_dest_operand( insn ) x86_operand_1st( insn )
-#define x86_get_src_operand( insn ) x86_operand_2nd( insn )
-#define x86_get_imm_operand( insn ) x86_operand_3rd( insn )
-
-/* get size of operand data in bytes */
-unsigned int x86_operand_size( x86_op_t *op );
-
-/* Operand Convenience Routines: the following three routines are common
- * operations on operands, intended to ease the burden of the programmer. */
-
-/* Get Address: return the value of an offset operand, or the offset of
- * a segment:offset absolute address */
-uint32_t x86_get_address( x86_insn_t *insn );
-
-/* Get Relative Offset: return as a sign-extended int32_t the near or far
- * relative offset operand, or 0 if there is none. There can be only one
- * relaive offset operand in an instruction. */
-int32_t x86_get_rel_offset( x86_insn_t *insn );
-
-/* Get Branch Target: return the x86_op_t containing the target of
- * a jump or call operand, or NULL if there is no branch target.
- * Internally, a 'branch target' is defined as any operand with
- * Execute Access set. There can be only one branch target per instruction. */
-x86_op_t * x86_get_branch_target( x86_insn_t *insn );
-
-/* Get Immediate: return the x86_op_t containing the immediate operand
- * for this instruction, or NULL if there is no immediate operand. There
- * can be only one immediate operand per instruction */
-x86_op_t * x86_get_imm( x86_insn_t *insn );
-
-/* Get Raw Immediate Data: returns a pointer to the immediate data encoded
- * in the instruction. This is useful for large data types [>32 bits] currently
- * not supported by libdisasm, or for determining if the disassembler
- * screwed up the conversion of the immediate data. Note that 'imm' in this
- * context refers to immediate data encoded at the end of an instruction as
- * detailed in the Intel Manual Vol II Chapter 2; it does not refer to the
- * 'op_imm' operand (the third operand in instructions like 'mul' */
-unsigned char * x86_get_raw_imm( x86_insn_t *insn );
-
-
-/* More accessor fuctions, this time for user-defined info... */
-/* set the address (usually RVA) of the insn */
-void x86_set_insn_addr( x86_insn_t *insn, uint32_t addr );
-
-/* set the offset (usually offset into file) of the insn */
-void x86_set_insn_offset( x86_insn_t *insn, unsigned int offset );
-
-/* set a pointer to the function owning the instruction. The
- * type of 'func' is user-defined; libdisasm does not use the func field. */
-void x86_set_insn_function( x86_insn_t *insn, void * func );
-
-/* set a pointer to the block of code owning the instruction. The
- * type of 'block' is user-defined; libdisasm does not use the block field. */
-void x86_set_insn_block( x86_insn_t *insn, void * block );
-
-/* instruction tagging: these routines allow the programmer to mark
- * instructions as "seen" in a DFS, for example. libdisasm does not use
- * the tag field.*/
-/* set insn->tag to 1 */
-void x86_tag_insn( x86_insn_t *insn );
-/* set insn->tag to 0 */
-void x86_untag_insn( x86_insn_t *insn );
-/* return insn->tag */
-int x86_insn_is_tagged( x86_insn_t *insn );
-
-
-/* Disassembly formats:
- * AT&T is standard AS/GAS-style: "mnemonic\tsrc, dest, imm"
- * Intel is standard MASM/NASM/TASM: "mnemonic\tdest,src, imm"
- * Native is tab-delimited: "RVA\tbytes\tmnemonic\tdest\tsrc\timm"
- * XML is your typical <insn> ... </insn>
- * Raw is addr|offset|size|bytes|prefix... see libdisasm_formats.7
- */
-enum x86_asm_format {
- unknown_syntax = 0, /* never use! */
- native_syntax, /* header: 35 bytes */
- intel_syntax, /* header: 23 bytes */
- att_syntax, /* header: 23 bytes */
- xml_syntax, /* header: 679 bytes */
- raw_syntax /* header: 172 bytes */
-};
-
-/* format (sprintf) an operand into 'buf' using specified syntax */
-int x86_format_operand(x86_op_t *op, char *buf, int len,
- enum x86_asm_format format);
-
-/* format (sprintf) an instruction mnemonic into 'buf' using specified syntax */
-int x86_format_mnemonic(x86_insn_t *insn, char *buf, int len,
- enum x86_asm_format format);
-
-/* format (sprintf) an instruction into 'buf' using specified syntax;
- * this includes formatting all operands */
-int x86_format_insn(x86_insn_t *insn, char *buf, int len, enum x86_asm_format);
-
-/* fill 'buf' with a description of the format's syntax */
-int x86_format_header( char *buf, int len, enum x86_asm_format format);
-
-/* Endianness of an x86 CPU : 0 is big, 1 is little; always returns 1 */
-unsigned int x86_endian(void);
-
-/* Default address and operand size in bytes */
-unsigned int x86_addr_size(void);
-unsigned int x86_op_size(void);
-
-/* Size of a machine word in bytes */
-unsigned int x86_word_size(void);
-
-/* maximum size of a code instruction */
-#define x86_max_inst_size(x) x86_max_insn_size(x)
-unsigned int x86_max_insn_size(void);
-
-/* register IDs of Stack, Frame, Instruction pointer and Flags register */
-unsigned int x86_sp_reg(void);
-unsigned int x86_fp_reg(void);
-unsigned int x86_ip_reg(void);
-unsigned int x86_flag_reg(void);
-
-/* fill 'reg' struct with details of register 'id' */
-void x86_reg_from_id( unsigned int id, x86_reg_t * reg );
-
-/* convenience macro demonstrating how to get an aliased register; proto is
- * void x86_get_aliased_reg( x86_reg_t *alias_reg, x86_reg_t *output_reg )
- * where 'alias_reg' is a reg operand and 'output_reg' is filled with the
- * register that the operand is an alias for */
-#define x86_get_aliased_reg( alias_reg, output_reg ) \
- x86_reg_from_id( alias_reg->alias, output_reg )
-
-
-/* ================================== Invariant Instruction Representation */
-/* Invariant instructions are used for generating binary signatures;
- * the instruction is modified so that all variant bytes in an instruction
- * are replaced with a wildcard byte.
- *
- * A 'variant byte' is one that is expected to be modified by either the
- * static or the dynamic linker: for example, an address encoded in an
- * instruction.
- *
- * By comparing the invariant representation of one instruction [or of a
- * sequence of instructions] with the invariant representation of another,
- * one determine whether the two invariant representations are from the same
- * relocatable object [.o] file. Thus one can use binary signatures [which
- * are just sequences of invariant instruction representations] to look for
- * library routines which have been statically-linked into a binary.
- *
- * The invariant routines are faster and smaller than the disassembly
- * routines; they can be used to determine the size of an instruction
- * without all of the overhead of a full instruction disassembly.
- */
-
-/* This byte is used to replace variant bytes */
-#define X86_WILDCARD_BYTE 0xF4
-
-typedef struct {
- enum x86_op_type type; /* operand type */
- enum x86_op_datatype datatype; /* operand size */
- enum x86_op_access access; /* operand access [RWX] */
- enum x86_op_flags flags; /* misc flags */
-} x86_invariant_op_t;
-
-typedef struct {
- unsigned char bytes[64]; /* invariant representation */
- unsigned int size; /* number of bytes in insn */
- enum x86_insn_group group; /* meta-type, e.g. INS_EXEC */
- enum x86_insn_type type; /* type, e.g. INS_BRANCH */
- x86_invariant_op_t operands[3]; /* operands: dest, src, imm */
-} x86_invariant_t;
-
-
-/* return a version of the instruction with the variant bytes masked out */
-size_t x86_invariant_disasm( unsigned char *buf, int buf_len,
- x86_invariant_t *inv );
-/* return the size in bytes of the intruction pointed to by 'buf';
- * this used x86_invariant_disasm since it faster than x86_disasm */
-size_t x86_size_disasm( unsigned char *buf, unsigned int buf_len );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdisasm.gyp b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdisasm.gyp
deleted file mode 100644
index 5c8dc45867..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/libdisasm.gyp
+++ /dev/null
@@ -1,67 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'libdisasm',
- 'type': 'static_library',
- 'sources': [
- 'ia32_implicit.c',
- 'ia32_implicit.h',
- 'ia32_insn.c',
- 'ia32_insn.h',
- 'ia32_invariant.c',
- 'ia32_invariant.h',
- 'ia32_modrm.c',
- 'ia32_modrm.h',
- 'ia32_opcode_tables.c',
- 'ia32_opcode_tables.h',
- 'ia32_operand.c',
- 'ia32_operand.h',
- 'ia32_reg.c',
- 'ia32_reg.h',
- 'ia32_settings.c',
- 'ia32_settings.h',
- 'libdis.h',
- 'qword.h',
- 'x86_disasm.c',
- 'x86_format.c',
- 'x86_imm.c',
- 'x86_imm.h',
- 'x86_insn.c',
- 'x86_misc.c',
- 'x86_operand_list.c',
- 'x86_operand_list.h',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/qword.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/qword.h
deleted file mode 100644
index 5f0e803c93..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/qword.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef LIBDISASM_QWORD_H
-#define LIBDISASM_QWORD_H
-
-#include <stdint.h>
-
-/* platform independent data types */
-
-#ifdef _MSC_VER
- typedef __int64 qword_t;
-#else
- typedef int64_t qword_t;
-#endif
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/Makefile b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/Makefile
deleted file mode 100644
index 44ef486b6a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/Makefile
+++ /dev/null
@@ -1,70 +0,0 @@
-# change these values if you need to
-SWIG = swig # apt-get install swig !
-GCC = gcc
-
-CC_FLAGS = -c -fPIC
-LD_FLAGS = -shared -L../.. -ldisasm
-
-BASE_NAME = x86disasm
-
-export INTERFACE_FILE BASE_NAME SWIG GCC CC_FLAGS LD_FLAGS
-
-#====================================================
-# TARGETS
-
-all: swig
-dummy: swig swig-python swig-ruby swig-perl swig-tcl install uninstall clean
-
-swig: swig-python swig-perl
-# swig-rub swig-tcl
-
-swig-python:
- cd python && make -f Makefile-swig
-
-swig-ruby:
- cd ruby && make -f Makefile-swig
-
-swig-perl:
- cd perl && make -f Makefile-swig
-
-swig-tcl:
- cd tcl && make -f Makefile-swig
-
-# ==================================================================
-install: install-python install-perl
-# install-ruby install-tcl
-
-install-python:
- cd python && sudo make -f Makefile-swig install
-
-install-ruby:
- cd ruby && sudo make -f Makefile-swig install
-
-install-perl:
- cd perl && sudo make -f Makefile-swig install
-
-install-tcl:
- cd tcl && sudo make -f Makefile-swig install
-
-# ==================================================================
-uninstall: uninstall-python
-#uninstall-ruby uninstall-perl uninstall-tcl
-
-uninstall-python:
- cd python && sudo make -f Makefile-swig uninstall
-
-uninstall-ruby:
- cd ruby && sudo make -f Makefile-swig uninstall
-
-uninstall-perl:
- cd perl && sudo make -f Makefile-swig uninstall
-
-uninstall-tcl:
- cd tcl && sudo make -f Makefile-swig uninstall
-
-# ==================================================================
-clean:
- cd python && make -f Makefile-swig clean
- cd ruby && make -f Makefile-swig clean
- cd perl && make -f Makefile-swig clean
- cd tcl && make -f Makefile-swig clean
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/README b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/README
deleted file mode 100644
index a9fa79ec2c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/README
+++ /dev/null
@@ -1,128 +0,0 @@
- Libdisasm SWIG README
-
-The SWIG utility (www.swig.org) can be used to generate
-
-
-Building SWIG Modules
----------------------
-
- make
- make install
-
-Make and Install both build Python, Perl, Ruby, and Tcl modules. If you
-do not have one of these languages installed, comment out the relevant
-target in the main Makefile.
-
-Install uses 'sudo' to put files in the correct locations; if you
-do not have sudo installed, change the install targets.
-
-The Module API
---------------
-
-The OOP API
------------
-
-
-The Python Module
------------------
-
-To test that the module loads:
-
- bash# python
- >>> import x86disasm
- >>> x86disasm.version_string()
- '0.21-pre'
- >>>^D
- bash#
-
- >>> import x86disasm
- >>> import array
- >>> disasm = x86disasm.X86_Disasm( )
- >>> tgt = open( "/tmp/a.out", "rb" )
- >>> tgt.seek( 0, 2 )
- >>> size = tgt.tell()
- >>> tgt.seek( 0, 0 )
- >>> buf = array.array( 'B' )
- >>> buf.fromfile( tgt, size )
- >>> tgt.close()
- >>> data = x86disasm.byteArray( size )
- >>> for i in range( size ):
- ... data[i] = buf.pop(0)
- ...
- >>> del buf
- >>> del tgt
- >>> insn = disasm.disasm( data, size - 1, 0, 0 )
- >>> insn.format( x86disasm.att_syntax )
- 'jg\t0x00000047'
- >>> insn.format( x86disasm.raw_syntax )
- '0x00000000|0x00000000|2|7F 45 |||controlflow|jcc|jg|80386|General Purpose|||zero_clear sign_eq_oflow |0|0|relative|sbyte|00000047|'
- >>> ops = insn.operand_list()
- >>> node = ops.first()
- >>> while node is not None:
- ... s = node.op.format(x86disasm.raw_syntax)
- ... print s
- ... node = ops.next()
- ...
- relative|sbyte|00000047|
-
-
-
-
-
-
-The Perl Module
----------------
-
-To test that the module loads:
-
- bash# perl
- use x86disasm;
- print x86disasm::version_string() . "\n";
- ^D
- 0.21-pre
- bash#
-
-The Ruby Module
----------------
-
-To test that the module loads:
-
- bash# irb
- irb(main):001:0> require 'x86disasm'
- => true
- irb(main):002:0> X86disasm.version_string()
- => "0.21-pre"
- irb(main):003:0> x = X86disasm::X86_Disasm.new
- => #<X86disasm::X86_Disasm:0xb7d624a4>
- irb(main):004:0> x.max_register_string()
- => 8
- irb(main):003:0> ^D
- bash#
-
-The Tcl Module
----------------
-
-To test that the module loads:
-
- bash# tclsh
- % load /usr/lib/tcl8.3/x86disasm.so X86disasm
- % version_string
- 0.21-pre
- % ^D
- bash#
-
- % x86_init 0 NULL NULL
- OR
- % x86disasm dis
- _486b0708_p_x86disasm
- % puts "[dis cget -last_error]"
- 0
-
-
-
-
-The Interface Files
--------------------
-
- libdisasm.i -- interface file without shadow classes
- libdisasm_oop.i -- interface file with shadow classes
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm.i b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm.i
deleted file mode 100644
index ec12041755..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm.i
+++ /dev/null
@@ -1,508 +0,0 @@
-%module x86disasm
-%{
-#include "../../libdis.h"
-#include "../../../config.h"
-%}
-
-%rename(version_string) x86_version_string;
-%include "../../libdis.h"
-#include "../../../config.h"
-
-%inline %{
- const char * x86_version_string( void ) {
- return PACKAGE_VERSION;
- }
-%}
-
-%rename(report_codes) x86_report_codes;
-%rename(report_error) x86_report_error;
-%rename(options) x86_options;
-%rename(init) x86_init;
-%rename(set_reporter) x86_set_reporter;
-%rename(set_options) x86_set_options;
-%rename(options) x86_get_options;
-%rename(cleanup) x86_cleanup;
-%rename(reg_type) x86_reg_type;
-%rename(reg) x86_reg_t;
-%rename(eaddr) x86_ea_t;
-%rename(op_type) x86_op_type;
-%rename(optype_is_address) x86_optype_is_address;
-%rename(optype_is_relative) x86_optype_is_relative;
-%rename(op_datatype) x86_op_datatype;
-%rename(op_access) x86_op_access;
-%rename(op_flags) x86_op_flags;
-%rename(operand) x86_op_t;
-%rename(insn_group) x86_insn_group;
-%rename(insn_type) x86_insn_type;
-%rename(insn_note) x86_insn_note ;
-%rename(flag_status) x86_flag_status;
-%rename(insn_cpu) x86_insn_cpu ;
-%rename(insn_isa) x86_insn_isa ;
-%rename(insn_prefix) x86_insn_prefix ;
-%rename(insn) x86_insn_t;
-%rename(insn_is_valid) x86_insn_is_valid;
-%rename(i_disasm) x86_disasm;
-%rename(i_disasm_range) x86_disasm_range;
-%rename(i_disasm_forward) x86_disasm_forward;
-%rename(insn_operand_count) x86_operand_count;
-%rename(insn_operand_1st) x86_operand_1st;
-%rename(insn_operand_2nd) x86_operand_2nd;
-%rename(insn_operand_3rd) x86_operand_3rd;
-%rename(insn_dest_operand) x86_get_dest_operand;
-%rename(insn_src_operand) x86_get_src_operand;
-%rename(insn_imm_operand) x86_get_imm_operand;
-%rename(operand_size) x86_operand_size;
-%rename(insn_rel_offset) x86_get_rel_offset;
-%rename(insn_branch_target) x86_get_branch_target;
-%rename(insn_imm) x86_get_imm;
-%rename(insn_raw_imm) x86_get_raw_imm;
-%rename(insn_set_addr) x86_set_insn_addr;
-%rename(insn_set_offset) x86_set_insn_offset;
-%rename(insn_set_function) x86_set_insn_function;
-%rename(insn_set_block) x86_set_insn_block;
-%rename(insn_tag) x86_tag_insn;
-%rename(insn_untag) x86_untag_insn;
-%rename(insn_is_tagged) x86_insn_is_tagged;
-%rename(asm_format) x86_asm_format;
-%rename(operand_format) x86_format_operand;
-%rename(insn_format_mnemonic) x86_format_mnemonic;
-%rename(insn_format) x86_format_insn;
-%rename(header_format) x86_format_header;
-%rename(endian) x86_endian;
-%rename(size_default_address) x86_addr_size;
-%rename(size_default_operand) x86_op_size;
-%rename(size_machine_word) x86_word_size;
-%rename(size_max_insn) x86_max_insn_size;
-%rename(reg_sp) x86_sp_reg;
-%rename(reg_fp) x86_fp_reg;
-%rename(reg_ip) x86_ip_reg;
-%rename(reg_from_id) x86_reg_from_id;
-%rename(reg_from_alias) x86_get_aliased_reg;
-%rename(invariant_op) x86_invariant_op_t;
-%rename(invariant) x86_invariant_t;
-%rename(disasm_invariant) x86_invariant_disasm;
-%rename(disasm_size) x86_size_disasm;
-
-%include "carrays.i"
-
-%array_class( unsigned char, byteArray );
-
-
-%apply (unsigned char *STRING, int LENGTH) {
- (unsigned char *buf, size_t buf_len)
-};
-
-
-%newobject x86_op_copy;
-%inline %{
- x86_op_t * x86_op_copy( x86_op_t * src ) {
- x86_op_t *op;
-
- if (! src ) {
- return NULL;
- }
-
- op = (x86_op_t *) calloc( sizeof(x86_op_t), 1 );
- if ( op ) {
- memcpy( op, src, sizeof(x86_op_t) );
- }
-
- return op;
- }
-
- typedef struct x86_op_list_node {
- x86_op_t *op;
- struct x86_op_list_node *next, *prev;
- } x86_op_list_node;
-
- typedef struct x86_op_list {
- size_t count;
- x86_op_list_node *head, *tail, *curr;
- } x86_op_list;
-
- x86_op_list * x86_op_list_new () {
- x86_op_list *list = (x86_op_list *)
- calloc( sizeof(x86_op_list), 1 );
- list->count = 0;
- return list;
- }
-
- void x86_op_list_free(x86_op_list *list) {
- x86_op_list_node *node, *next;
-
- node = list->head;
- while ( node ) {
- next = node->next;
- /* free( node->insn ); */
- free( node );
- node = next;
- }
-
- free( list );
- }
-
- x86_op_list_node * x86_op_list_first(x86_op_list *list) {
- return list->head;
- }
-
- x86_op_list_node * x86_op_list_last(x86_op_list *list) {
- return list->tail;
- }
-
- x86_op_list_node * x86_op_list_next(x86_op_list *list) {
- if (! list->curr ) {
- list->curr = list->head;
- return list->head;
- }
-
- list->curr = list->curr->next;
- return list->curr;
- }
-
- x86_op_list_node * x86_op_list_prev(x86_op_list *list) {
- if (! list->curr ) {
- list->curr = list->tail;
- return list->tail;
- }
-
- list->curr = list->curr->prev;
- return list->curr;
- }
-
-%}
-
-%newobject x86_op_list_append;
-
-%inline %{
- void x86_op_list_append( x86_op_list * list, x86_op_t *op ) {
- x86_op_list_node *node = (x86_op_list_node *)
- calloc( sizeof(x86_op_list_node) , 1 );
- if (! node ) {
- return;
- }
-
- list->count++;
- if ( ! list->tail ) {
- list->head = list->tail = node;
- } else {
- list->tail->next = node;
- node->prev = list->tail;
- list->tail = node;
- }
-
- node->op = x86_op_copy( op );
- }
-
- x86_oplist_t * x86_op_list_node_copy( x86_oplist_t * list ) {
- x86_oplist_t *ptr;
- ptr = (x86_oplist_t *) calloc( sizeof(x86_oplist_t), 1 );
- if ( ptr ) {
- memcpy( &ptr->op, &list->op, sizeof(x86_op_t) );
- }
-
- return ptr;
- }
-
- x86_insn_t * x86_insn_new() {
- x86_insn_t *insn = (x86_insn_t *)
- calloc( sizeof(x86_insn_t), 1 );
- return insn;
- }
-
- void x86_insn_free( x86_insn_t *insn ) {
- x86_oplist_free( insn );
- free( insn );
- }
-%}
-
-%newobject x86_insn_copy;
-
-%inline %{
- x86_insn_t * x86_insn_copy( x86_insn_t *src) {
- x86_oplist_t *ptr, *list, *last = NULL;
- x86_insn_t *insn = (x86_insn_t *)
- calloc( sizeof(x86_insn_t), 1 );
-
- if ( insn ) {
- memcpy( insn, src, sizeof(x86_insn_t) );
- insn->operands = NULL;
- insn->block = NULL;
- insn->function = NULL;
-
- /* copy operand list */
- for ( list = src->operands; list; list = list->next ) {
- ptr = x86_op_list_node_copy( list );
-
- if (! ptr ) {
- continue;
- }
-
- if ( insn->operands ) {
- last->next = ptr;
- } else {
- insn->operands = ptr;
- }
- last = ptr;
- }
- }
-
- return insn;
- }
-
- x86_op_list * x86_insn_op_list( x86_insn_t *insn ) {
- x86_oplist_t *list = insn->operands;
- x86_op_list *op_list = x86_op_list_new();
-
- for ( list = insn->operands; list; list = list->next ) {
- x86_op_list_append( op_list, &list->op );
- }
-
- return op_list;
- }
-
- typedef struct x86_insn_list_node {
- x86_insn_t *insn;
- struct x86_insn_list_node *next, *prev;
- } x86_insn_list_node;
-
- typedef struct x86_insn_list {
- size_t count;
- x86_insn_list_node *head, *tail, *curr;
- } x86_insn_list;
-
-%}
-
-%newobject x86_insn_list_new;
-
-%inline %{
- x86_insn_list * x86_insn_list_new () {
- x86_insn_list *list = (x86_insn_list *)
- calloc( sizeof(x86_insn_list), 1 );
- list->count = 0;
- return list;
- }
-
- void x86_insn_list_free( x86_insn_list * list ) {
- x86_insn_list_node *node, *next;
-
- if (! list ) {
- return;
- }
-
- node = list->head;
- while ( node ) {
- next = node->next;
- /* free( node->insn ); */
- free( node );
- node = next;
- }
-
- free( list );
- }
-
- x86_insn_list_node * x86_insn_list_first( x86_insn_list *list ) {
- if (! list ) {
- return NULL;
- }
- return list->head;
- }
-
- x86_insn_list_node * x86_insn_list_last( x86_insn_list *list ) {
- if (! list ) {
- return NULL;
- }
- return list->tail;
- }
-
- x86_insn_list_node * x86_insn_list_next( x86_insn_list *list ) {
- if (! list ) {
- return NULL;
- }
- if (! list->curr ) {
- list->curr = list->head;
- return list->head;
- }
-
- list->curr = list->curr->next;
- return list->curr;
- }
-
- x86_insn_list_node * x86_insn_list_prev( x86_insn_list *list ) {
- if (! list ) {
- return NULL;
- }
- if (! list->curr ) {
- list->curr = list->tail;
- return list->tail;
- }
-
- list->curr = list->curr->prev;
- return list->curr;
- }
-
-%}
-
-%newobject x86_insn_list_append;
-
-%inline %{
- void x86_insn_list_append( x86_insn_list *list, x86_insn_t *insn ) {
- x86_insn_list_node *node;
- if (! list ) {
- return;
- }
-
- node = (x86_insn_list_node *)
- calloc( sizeof(x86_insn_list_node) , 1 );
-
- if (! node ) {
- return;
- }
-
- list->count++;
- if ( ! list->tail ) {
- list->head = list->tail = node;
- } else {
- list->tail->next = node;
- node->prev = list->tail;
- list->tail = node;
- }
-
- node->insn = x86_insn_copy( insn );
- }
-
- typedef struct {
- enum x86_report_codes last_error;
- void * last_error_data;
- void * disasm_callback;
- void * disasm_resolver;
- } x86disasm;
-
- void x86_default_reporter( enum x86_report_codes code,
- void *data, void *arg ) {
- x86disasm *dis = (x86disasm *) arg;
- if ( dis ) {
- dis->last_error = code;
- dis->last_error_data = data;
- }
- }
-
- void x86_default_callback( x86_insn_t *insn, void *arg ) {
- x86_insn_list *list = (x86_insn_list *) arg;
- if ( list ) {
- x86_insn_list_append( list, insn );
- }
- }
-
- /* TODO: resolver stack, maybe a callback */
- long x86_default_resolver( x86_op_t *op, x86_insn_t *insn, void *arg ) {
- x86disasm *dis = (x86disasm *) arg;
- if ( dis ) {
- //return dis->resolver( op, insn );
- return 0;
- }
-
- return 0;
- }
-
-
-%}
-
-%newobject x86disasm_new;
-
-%inline %{
- x86disasm * x86disasm_new ( enum x86_options options ) {
- x86disasm * dis = (x86disasm *)
- calloc( sizeof( x86disasm ), 1 );
- x86_init( options, x86_default_reporter, dis );
- return dis;
- }
-
- void x86disasm_free( x86disasm * dis ) {
- x86_cleanup();
- free( dis );
- }
-%}
-
-%newobject x86_disasm;
-
-%inline %{
- x86_insn_t * disasm( unsigned char *buf, size_t buf_len,
- unsigned long buf_rva, unsigned int offset ) {
- x86_insn_t *insn = calloc( sizeof( x86_insn_t ), 1 );
- x86_disasm( buf, buf_len, buf_rva, offset, insn );
- return insn;
- }
-
- int disasm_range( unsigned char *buf, size_t buf_len,
- unsigned long buf_rva, unsigned int offset,
- unsigned int len ) {
-
- x86_insn_list *list = x86_insn_list_new();
-
- if ( len > buf_len ) {
- len = buf_len;
- }
-
- return x86_disasm_range( buf, buf_rva, offset, len,
- x86_default_callback, list );
- }
-
- int disasm_forward( unsigned char *buf, size_t buf_len,
- unsigned long buf_rva, unsigned int offset ) {
- x86_insn_list *list = x86_insn_list_new();
-
- /* use default resolver: damn SWIG callbacks! */
- return x86_disasm_forward( buf, buf_len, buf_rva, offset,
- x86_default_callback, list,
- x86_default_resolver, NULL );
- }
-
- size_t disasm_invariant( unsigned char *buf, size_t buf_len,
- x86_invariant_t *inv ) {
- return x86_invariant_disasm( buf, buf_len, inv );
- }
-
- size_t disasm_size( unsigned char *buf, size_t buf_len ) {
- return x86_size_disasm( buf, buf_len );
- }
-
- int x86_max_operand_string( enum x86_asm_format format ) {
- switch ( format ) {
- case xml_syntax:
- return MAX_OP_XML_STRING;
- break;
- case raw_syntax:
- return MAX_OP_RAW_STRING;
- break;
- case native_syntax:
- case intel_syntax:
- case att_syntax:
- case unknown_syntax:
- default:
- return MAX_OP_STRING;
- break;
- }
- }
-
-
- int x86_max_insn_string( enum x86_asm_format format ) {
- switch ( format ) {
- case xml_syntax:
- return MAX_INSN_XML_STRING;
- break;
- case raw_syntax:
- return MAX_INSN_RAW_STRING;
- break;
- case native_syntax:
- case intel_syntax:
- case att_syntax:
- case unknown_syntax:
- default:
- return MAX_INSN_STRING;
- break;
- }
- }
-
- int x86_max_num_operands( ) { return MAX_NUM_OPERANDS; }
-%}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm_oop.i b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm_oop.i
deleted file mode 100644
index 973a47e27b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/libdisasm_oop.i
+++ /dev/null
@@ -1,1114 +0,0 @@
-%module x86disasm
-%{
-#ifdef _MSC_VER
- typedef __int64 qword;
-#else
- typedef long long qword;
-#endif
-
-#include <sys/types.h>
-
-#define MAX_REGNAME 8
-#define MAX_PREFIX_STR 32
-#define MAX_MNEM_STR 16
-#define MAX_INSN_SIZE 20
-#define MAX_OP_STRING 32
-#define MAX_OP_RAW_STRING 64
-#define MAX_OP_XML_STRING 256
-#define MAX_NUM_OPERANDS 8
-#define MAX_INSN_STRING 512
-#define MAX_INSN_RAW_STRING 1024
-#define MAX_INSN_XML_STRING 4096
-
-#include "../../../config.h"
-
-
-const char * version_string( void ) {
- return PACKAGE_VERSION;
-}
-
-%}
-
-const char * version_string( void );
-
-%rename(X86_Register) x86_reg_t;
-%rename(X86_EAddr) x86_ea_t;
-%rename(X86_Operand) x86_op_t;
-//%rename(X86_OpList) x86_oplist_t;
-%rename(X86_Insn) x86_insn_t;
-%rename(X86_InvOperand) x86_invariant_op_t;
-%rename(X86_Invariant) x86_invariant_t;
-
-%include "carrays.i"
-
-%array_class( unsigned char, byteArray );
-
-
-%apply (unsigned char *STRING, int LENGTH) {
- (unsigned char *buf, size_t buf_len)
-};
-
-
-%inline %{
-
-
-enum x86_asm_format {
- unknown_syntax = 0, /* never use! */
- native_syntax, /* header: 35 bytes */
- intel_syntax, /* header: 23 bytes */
- att_syntax, /* header: 23 bytes */
- xml_syntax, /* header: 679 bytes */
- raw_syntax /* header: 172 bytes */
-};
-%}
-
-/* ================================================================== */
-/* operand class */
-%inline %{
- enum x86_reg_type {
- reg_gen = 0x00001, reg_in = 0x00002,
- reg_out = 0x00004, reg_local = 0x00008,
- reg_fpu = 0x00010, reg_seg = 0x00020,
- reg_simd = 0x00040, reg_sys = 0x00080,
- reg_sp = 0x00100, reg_fp = 0x00200,
- reg_pc = 0x00400, reg_retaddr = 0x00800,
- reg_cond = 0x01000, reg_zero = 0x02000,
- reg_ret = 0x04000, reg_src = 0x10000,
- reg_dest = 0x20000, reg_count = 0x40000
- };
-
- typedef struct {
- char name[MAX_REGNAME];
- enum x86_reg_type type;
- unsigned int size;
- unsigned int id;
- unsigned int alias;
- unsigned int shift;
- } x86_reg_t;
-
- void x86_reg_from_id( unsigned int id, x86_reg_t * reg );
-
- typedef struct {
- unsigned int scale;
- x86_reg_t index, base;
- long disp;
- char disp_sign;
- char disp_size;
- } x86_ea_t;
-
- enum x86_op_type {
- op_unused = 0,
- op_register = 1,
- op_immediate = 2,
- op_relative_near = 3,
- op_relative_far = 4,
- op_absolute = 5,
- op_expression = 6,
- op_offset = 7,
- op_unknown
- };
-
- enum x86_op_datatype {
- op_byte = 1, op_word = 2,
- op_dword = 3, op_qword = 4,
- op_dqword = 5, op_sreal = 6,
- op_dreal = 7, op_extreal = 8,
- op_bcd = 9, op_ssimd = 10,
- op_dsimd = 11, op_sssimd = 12,
- op_sdsimd = 13, op_descr32 = 14,
- op_descr16 = 15, op_pdescr32 = 16,
- op_pdescr16 = 17, op_fpuenv = 18,
- op_fpregset = 19,
- };
-
- enum x86_op_access {
- op_read = 1,
- op_write = 2,
- op_execute = 4
- };
-
- enum x86_op_flags {
- op_signed = 1, op_string = 2,
- op_constant = 4, op_pointer = 8,
- op_sysref = 0x010, op_implied = 0x020,
- op_hardcode = 0x40, op_es_seg = 0x100,
- op_cs_seg = 0x200, op_ss_seg = 0x300,
- op_ds_seg = 0x400, op_fs_seg = 0x500,
- op_gs_seg = 0x600
- };
-
- typedef struct {
- enum x86_op_type type;
- enum x86_op_datatype datatype;
- enum x86_op_access access;
- enum x86_op_flags flags;
- union {
- char sbyte;
- short sword;
- long sdword;
- qword sqword;
- unsigned char byte;
- unsigned short word;
- unsigned long dword;
- qword qword;
- float sreal;
- double dreal;
- unsigned char extreal[10];
- unsigned char bcd[10];
- qword dqword[2];
- unsigned char simd[16];
- unsigned char fpuenv[28];
- void * address;
- unsigned long offset;
- x86_reg_t reg;
- char relative_near;
- long relative_far;
- x86_ea_t expression;
- } data;
- void * insn;
- } x86_op_t;
-
- unsigned int x86_operand_size( x86_op_t *op );
-
- int x86_format_operand(x86_op_t *op, char *buf, int len,
- enum x86_asm_format format);
-%}
-
-%extend x86_reg_t{
- x86_reg_t * aliased_reg( ) {
- x86_reg_t * reg = (x86_reg_t * )
- calloc( sizeof(x86_reg_t), 1 );
- x86_reg_from_id( self->id, reg );
- return reg;
- }
-}
-
-%extend x86_op_t{
- size_t size() {
- return x86_operand_size( self );
- }
- char * format( enum x86_asm_format format ) {
- char *buf, *str;
- size_t len;
-
- switch ( format ) {
- case xml_syntax:
- len = MAX_OP_XML_STRING;
- break;
- case raw_syntax:
- len = MAX_OP_RAW_STRING;
- break;
- case native_syntax:
- case intel_syntax:
- case att_syntax:
- case unknown_syntax:
- default:
- len = MAX_OP_STRING;
- break;
- }
-
- buf = (char * ) calloc( len + 1, 1 );
- x86_format_operand( self, buf, len, format );
-
- /* drop buffer down to a reasonable size */
- str = strdup( buf );
- free(buf);
- return str;
- }
-
- int is_address( ) {
- if ( self->type == op_absolute ||
- self->type == op_offset ) {
- return 1;
- }
-
- return 0;
- }
-
- int is_relative( ) {
- if ( self->type == op_relative_near ||
- self->type == op_relative_far ) {
- return 1;
- }
-
- return 0;
- }
-
- %newobject copy;
- x86_op_t * copy() {
- x86_op_t *op = (x86_op_t *) calloc( sizeof(x86_op_t), 1 );
-
- if ( op ) {
- memcpy( op, self, sizeof(x86_op_t) );
- }
-
- return op;
- }
-}
-
-/* ================================================================== */
-/* operand list class */
-%inline %{
- typedef struct X86_OpListNode {
- x86_op_t *op;
- struct X86_OpListNode *next, *prev;
- } X86_OpListNode;
-
- typedef struct X86_OpList {
- size_t count;
- X86_OpListNode *head, *tail, *curr;
- } X86_OpList;
-%}
-
-%extend X86_OpList {
- X86_OpList () {
- X86_OpList *list = (X86_OpList *)
- calloc( sizeof(X86_OpList), 1 );
- list->count = 0;
- return list;
- }
-
- ~X86_OpList() {
- X86_OpListNode *node, *next;
-
- node = self->head;
- while ( node ) {
- next = node->next;
- /* free( node->insn ); */
- free( node );
- node = next;
- }
-
- free( self );
- }
-
- X86_OpListNode * first() {
- self->curr = self->head;
- return self->head;
- }
-
- X86_OpListNode * last() {
- self->curr = self->tail;
- return self->tail;
- }
-
- X86_OpListNode * next() {
- if (! self->curr ) {
- self->curr = self->head;
- return self->head;
- }
-
- self->curr = self->curr->next;
- return self->curr;
- }
-
- X86_OpListNode * prev() {
- if (! self->curr ) {
- self->curr = self->tail;
- return self->tail;
- }
-
- self->curr = self->curr->prev;
- return self->curr;
- }
-
- %newobject append;
- void append( x86_op_t *op ) {
- X86_OpListNode *node = (X86_OpListNode *)
- calloc( sizeof(X86_OpListNode) , 1 );
- if (! node ) {
- return;
- }
-
- self->count++;
- if ( ! self->tail ) {
- self->head = self->tail = node;
- } else {
- self->tail->next = node;
- node->prev = self->tail;
- self->tail = node;
- }
-
- node->op = x86_op_t_copy( op );
- }
-}
-
-%inline %{
- typedef struct x86_operand_list {
- x86_op_t op;
- struct x86_operand_list *next;
- } x86_oplist_t;
-%}
-
-%extend x86_oplist_t {
- %newobject x86_oplist_node_copy;
-}
-
-/* ================================================================== */
-/* instruction class */
-%inline %{
- x86_oplist_t * x86_oplist_node_copy( x86_oplist_t * list ) {
- x86_oplist_t *ptr;
- ptr = (x86_oplist_t *) calloc( sizeof(x86_oplist_t), 1 );
- if ( ptr ) {
- memcpy( &ptr->op, &list->op, sizeof(x86_op_t) );
- }
-
- return ptr;
- }
-
- enum x86_insn_group {
- insn_none = 0, insn_controlflow = 1,
- insn_arithmetic = 2, insn_logic = 3,
- insn_stack = 4, insn_comparison = 5,
- insn_move = 6, insn_string = 7,
- insn_bit_manip = 8, insn_flag_manip = 9,
- insn_fpu = 10, insn_interrupt = 13,
- insn_system = 14, insn_other = 15
- };
-
- enum x86_insn_type {
- insn_invalid = 0, insn_jmp = 0x1001,
- insn_jcc = 0x1002, insn_call = 0x1003,
- insn_callcc = 0x1004, insn_return = 0x1005,
- insn_add = 0x2001, insn_sub = 0x2002,
- insn_mul = 0x2003, insn_div = 0x2004,
- insn_inc = 0x2005, insn_dec = 0x2006,
- insn_shl = 0x2007, insn_shr = 0x2008,
- insn_rol = 0x2009, insn_ror = 0x200A,
- insn_and = 0x3001, insn_or = 0x3002,
- insn_xor = 0x3003, insn_not = 0x3004,
- insn_neg = 0x3005, insn_push = 0x4001,
- insn_pop = 0x4002, insn_pushregs = 0x4003,
- insn_popregs = 0x4004, insn_pushflags = 0x4005,
- insn_popflags = 0x4006, insn_enter = 0x4007,
- insn_leave = 0x4008, insn_test = 0x5001,
- insn_cmp = 0x5002, insn_mov = 0x6001,
- insn_movcc = 0x6002, insn_xchg = 0x6003,
- insn_xchgcc = 0x6004, insn_strcmp = 0x7001,
- insn_strload = 0x7002, insn_strmov = 0x7003,
- insn_strstore = 0x7004, insn_translate = 0x7005,
- insn_bittest = 0x8001, insn_bitset = 0x8002,
- insn_bitclear = 0x8003, insn_clear_carry = 0x9001,
- insn_clear_zero = 0x9002, insn_clear_oflow = 0x9003,
- insn_clear_dir = 0x9004, insn_clear_sign = 0x9005,
- insn_clear_parity = 0x9006, insn_set_carry = 0x9007,
- insn_set_zero = 0x9008, insn_set_oflow = 0x9009,
- insn_set_dir = 0x900A, insn_set_sign = 0x900B,
- insn_set_parity = 0x900C, insn_tog_carry = 0x9010,
- insn_tog_zero = 0x9020, insn_tog_oflow = 0x9030,
- insn_tog_dir = 0x9040, insn_tog_sign = 0x9050,
- insn_tog_parity = 0x9060, insn_fmov = 0xA001,
- insn_fmovcc = 0xA002, insn_fneg = 0xA003,
- insn_fabs = 0xA004, insn_fadd = 0xA005,
- insn_fsub = 0xA006, insn_fmul = 0xA007,
- insn_fdiv = 0xA008, insn_fsqrt = 0xA009,
- insn_fcmp = 0xA00A, insn_fcos = 0xA00C,
- insn_fldpi = 0xA00D, insn_fldz = 0xA00E,
- insn_ftan = 0xA00F, insn_fsine = 0xA010,
- insn_fsys = 0xA020, insn_int = 0xD001,
- insn_intcc = 0xD002, insn_iret = 0xD003,
- insn_bound = 0xD004, insn_debug = 0xD005,
- insn_trace = 0xD006, insn_invalid_op = 0xD007,
- insn_oflow = 0xD008, insn_halt = 0xE001,
- insn_in = 0xE002, insn_out = 0xE003,
- insn_cpuid = 0xE004, insn_nop = 0xF001,
- insn_bcdconv = 0xF002, insn_szconv = 0xF003
- };
-
- enum x86_insn_note {
- insn_note_ring0 = 1,
- insn_note_smm = 2,
- insn_note_serial = 4
- };
-
- enum x86_flag_status {
- insn_carry_set = 0x1,
- insn_zero_set = 0x2,
- insn_oflow_set = 0x4,
- insn_dir_set = 0x8,
- insn_sign_set = 0x10,
- insn_parity_set = 0x20,
- insn_carry_or_zero_set = 0x40,
- insn_zero_set_or_sign_ne_oflow = 0x80,
- insn_carry_clear = 0x100,
- insn_zero_clear = 0x200,
- insn_oflow_clear = 0x400,
- insn_dir_clear = 0x800,
- insn_sign_clear = 0x1000,
- insn_parity_clear = 0x2000,
- insn_sign_eq_oflow = 0x4000,
- insn_sign_ne_oflow = 0x8000
- };
-
- enum x86_insn_cpu {
- cpu_8086 = 1, cpu_80286 = 2,
- cpu_80386 = 3, cpu_80387 = 4,
- cpu_80486 = 5, cpu_pentium = 6,
- cpu_pentiumpro = 7, cpu_pentium2 = 8,
- cpu_pentium3 = 9, cpu_pentium4 = 10,
- cpu_k6 = 16, cpu_k7 = 32,
- cpu_athlon = 48
- };
-
- enum x86_insn_isa {
- isa_gp = 1, isa_fp = 2,
- isa_fpumgt = 3, isa_mmx = 4,
- isa_sse1 = 5, isa_sse2 = 6,
- isa_sse3 = 7, isa_3dnow = 8,
- isa_sys = 9
- };
-
- enum x86_insn_prefix {
- insn_no_prefix = 0,
- insn_rep_zero = 1,
- insn_rep_notzero = 2,
- insn_lock = 4
- };
-
-
- typedef struct {
- unsigned long addr;
- unsigned long offset;
- enum x86_insn_group group;
- enum x86_insn_type type;
- enum x86_insn_note note;
- unsigned char bytes[MAX_INSN_SIZE];
- unsigned char size;
- unsigned char addr_size;
- unsigned char op_size;
- enum x86_insn_cpu cpu;
- enum x86_insn_isa isa;
- enum x86_flag_status flags_set;
- enum x86_flag_status flags_tested;
- unsigned char stack_mod;
- long stack_mod_val;
- enum x86_insn_prefix prefix;
- char prefix_string[MAX_PREFIX_STR];
- char mnemonic[MAX_MNEM_STR];
- x86_oplist_t *operands;
- size_t operand_count;
- size_t explicit_count;
- void *block;
- void *function;
- int tag;
- } x86_insn_t;
-
- typedef void (*x86_operand_fn)(x86_op_t *op, x86_insn_t *insn,
- void *arg);
-
- enum x86_op_foreach_type {
- op_any = 0,
- op_dest = 1,
- op_src = 2,
- op_ro = 3,
- op_wo = 4,
- op_xo = 5,
- op_rw = 6,
- op_implicit = 0x10,
- op_explicit = 0x20
- };
-
- size_t x86_operand_count( x86_insn_t *insn,
- enum x86_op_foreach_type type );
- x86_op_t * x86_operand_1st( x86_insn_t *insn );
- x86_op_t * x86_operand_2nd( x86_insn_t *insn );
- x86_op_t * x86_operand_3rd( x86_insn_t *insn );
- long x86_get_rel_offset( x86_insn_t *insn );
- x86_op_t * x86_get_branch_target( x86_insn_t *insn );
- x86_op_t * x86_get_imm( x86_insn_t *insn );
- unsigned char * x86_get_raw_imm( x86_insn_t *insn );
- void x86_set_insn_addr( x86_insn_t *insn, unsigned long addr );
- int x86_format_mnemonic(x86_insn_t *insn, char *buf, int len,
- enum x86_asm_format format);
- int x86_format_insn(x86_insn_t *insn, char *buf, int len,
- enum x86_asm_format);
- void x86_oplist_free( x86_insn_t *insn );
- int x86_insn_is_valid( x86_insn_t *insn );
-%}
-
-%extend x86_insn_t {
- x86_insn_t() {
- x86_insn_t *insn = (x86_insn_t *)
- calloc( sizeof(x86_insn_t), 1 );
- return insn;
- }
- ~x86_insn_t() {
- x86_oplist_free( self );
- free( self );
- }
-
- int is_valid( ) {
- return x86_insn_is_valid( self );
- }
-
- x86_op_t * operand_1st() {
- return x86_operand_1st( self );
- }
-
- x86_op_t * operand_2nd() {
- return x86_operand_2nd( self );
- }
-
- x86_op_t * operand_3rd() {
- return x86_operand_3rd( self );
- }
-
- x86_op_t * operand_dest() {
- return x86_operand_1st( self );
- }
-
- x86_op_t * operand_src() {
- return x86_operand_2nd( self );
- }
-
- size_t num_operands( enum x86_op_foreach_type type ) {
- return x86_operand_count( self, type );
- }
-
- long rel_offset() {
- return x86_get_rel_offset( self );
- }
-
- x86_op_t * branch_target() {
- return x86_get_branch_target( self );
- }
-
- x86_op_t * imm() {
- return x86_get_imm( self );
- }
-
- unsigned char * raw_imm() {
- return x86_get_raw_imm( self );
- }
-
- %newobject format;
- char * format( enum x86_asm_format format ) {
- char *buf, *str;
- size_t len;
-
- switch ( format ) {
- case xml_syntax:
- len = MAX_INSN_XML_STRING;
- break;
- case raw_syntax:
- len = MAX_INSN_RAW_STRING;
- break;
- case native_syntax:
- case intel_syntax:
- case att_syntax:
- case unknown_syntax:
- default:
- len = MAX_INSN_STRING;
- break;
- }
-
- buf = (char * ) calloc( len + 1, 1 );
- x86_format_insn( self, buf, len, format );
-
- /* drop buffer down to a reasonable size */
- str = strdup( buf );
- free(buf);
- return str;
- }
-
- %newobject format_mnemonic;
- char * format_mnemonic( enum x86_asm_format format ) {
- char *buf, *str;
- size_t len = MAX_MNEM_STR + MAX_PREFIX_STR + 4;
-
- buf = (char * ) calloc( len, 1 );
- x86_format_mnemonic( self, buf, len, format );
-
- /* drop buffer down to a reasonable size */
- str = strdup( buf );
- free(buf);
-
- return str;
- }
-
- %newobject copy;
- x86_insn_t * copy() {
- x86_oplist_t *ptr, *list, *last = NULL;
- x86_insn_t *insn = (x86_insn_t *)
- calloc( sizeof(x86_insn_t), 1 );
-
- if ( insn ) {
- memcpy( insn, self, sizeof(x86_insn_t) );
- insn->operands = NULL;
- insn->block = NULL;
- insn->function = NULL;
-
- /* copy operand list */
- for ( list = self->operands; list; list = list->next ) {
- ptr = x86_oplist_node_copy( list );
-
- if (! ptr ) {
- continue;
- }
-
- if ( insn->operands ) {
- last->next = ptr;
- } else {
- insn->operands = ptr;
- }
- last = ptr;
- }
- }
-
- return insn;
- }
-
- X86_OpList * operand_list( ) {
- x86_oplist_t *list = self->operands;
- X86_OpList *op_list = new_X86_OpList();
-
- for ( list = self->operands; list; list = list->next ) {
- X86_OpList_append( op_list, &list->op );
- }
-
- return op_list;
- }
-}
-
-/* ================================================================== */
-/* invariant instruction class */
-%inline %{
- #define X86_WILDCARD_BYTE 0xF4
-
- typedef struct {
- enum x86_op_type type;
- enum x86_op_datatype datatype;
- enum x86_op_access access;
- enum x86_op_flags flags;
- } x86_invariant_op_t;
-
- typedef struct {
- unsigned char bytes[64];
- unsigned int size;
- enum x86_insn_group group;
- enum x86_insn_type type;
- x86_invariant_op_t operands[3];
- } x86_invariant_t;
-%}
-
-%extend x86_invariant_t {
-
- x86_invariant_t() {
- x86_invariant_t *inv = (x86_invariant_t *)
- calloc( sizeof(x86_invariant_t), 1 );
- return inv;
- }
-
- ~x86_invariant_t() {
- free( self );
- }
-}
-
-/* ================================================================== */
-/* instruction list class */
-%inline %{
- typedef struct X86_InsnListNode {
- x86_insn_t *insn;
- struct X86_InsnListNode *next, *prev;
- } X86_InsnListNode;
-
- typedef struct X86_InsnList {
- size_t count;
- X86_InsnListNode *head, *tail, *curr;
- } X86_InsnList;
-%}
-
-%extend X86_InsnList {
- X86_InsnList () {
- X86_InsnList *list = (X86_InsnList *)
- calloc( sizeof(X86_InsnList), 1 );
- list->count = 0;
- return list;
- }
-
- ~X86_InsnList() {
- X86_InsnListNode *node, *next;
-
- node = self->head;
- while ( node ) {
- next = node->next;
- /* free( node->insn ); */
- free( node );
- node = next;
- }
-
- free( self );
- }
-
- X86_InsnListNode * first() { return self->head; }
-
- X86_InsnListNode * last() { return self->tail; }
-
- X86_InsnListNode * next() {
- if (! self->curr ) {
- self->curr = self->head;
- return self->head;
- }
-
- self->curr = self->curr->next;
- return self->curr;
- }
-
- X86_InsnListNode * prev() {
- if (! self->curr ) {
- self->curr = self->tail;
- return self->tail;
- }
-
- self->curr = self->curr->prev;
- return self->curr;
- }
-
- %newobject append;
- void append( x86_insn_t *insn ) {
- X86_InsnListNode *node = (X86_InsnListNode *)
- calloc( sizeof(X86_InsnListNode) , 1 );
- if (! node ) {
- return;
- }
-
- self->count++;
- if ( ! self->tail ) {
- self->head = self->tail = node;
- } else {
- self->tail->next = node;
- node->prev = self->tail;
- self->tail = node;
- }
-
- node->insn = x86_insn_t_copy( insn );
- }
-}
-
-/* ================================================================== */
-/* address table class */
-/* slight TODO */
-
-/* ================================================================== */
-/* Main disassembler class */
-%inline %{
-
- enum x86_options {
- opt_none= 0,
- opt_ignore_nulls=1,
- opt_16_bit=2
- };
- enum x86_report_codes {
- report_disasm_bounds,
- report_insn_bounds,
- report_invalid_insn,
- report_unknown
- };
-
-
- typedef struct {
- enum x86_report_codes last_error;
- void * last_error_data;
- void * disasm_callback;
- void * disasm_resolver;
- } X86_Disasm;
-
- typedef void (*DISASM_REPORTER)( enum x86_report_codes code,
- void *data, void *arg );
- typedef void (*DISASM_CALLBACK)( x86_insn_t *insn, void * arg );
- typedef long (*DISASM_RESOLVER)( x86_op_t *op,
- x86_insn_t * current_insn,
- void *arg );
-
- void x86_report_error( enum x86_report_codes code, void *data );
- int x86_init( enum x86_options options, DISASM_REPORTER reporter,
- void *arg);
- void x86_set_reporter( DISASM_REPORTER reporter, void *arg);
- void x86_set_options( enum x86_options options );
- enum x86_options x86_get_options( void );
- int x86_cleanup(void);
- int x86_format_header( char *buf, int len, enum x86_asm_format format);
- unsigned int x86_endian(void);
- unsigned int x86_addr_size(void);
- unsigned int x86_op_size(void);
- unsigned int x86_word_size(void);
- unsigned int x86_max_insn_size(void);
- unsigned int x86_sp_reg(void);
- unsigned int x86_fp_reg(void);
- unsigned int x86_ip_reg(void);
- size_t x86_invariant_disasm( unsigned char *buf, int buf_len,
- x86_invariant_t *inv );
- size_t x86_size_disasm( unsigned char *buf, unsigned int buf_len );
- int x86_disasm( unsigned char *buf, unsigned int buf_len,
- unsigned long buf_rva, unsigned int offset,
- x86_insn_t * insn );
- int x86_disasm_range( unsigned char *buf, unsigned long buf_rva,
- unsigned int offset, unsigned int len,
- DISASM_CALLBACK func, void *arg );
- int x86_disasm_forward( unsigned char *buf, unsigned int buf_len,
- unsigned long buf_rva, unsigned int offset,
- DISASM_CALLBACK func, void *arg,
- DISASM_RESOLVER resolver, void *r_arg );
-
- void x86_default_reporter( enum x86_report_codes code,
- void *data, void *arg ) {
- X86_Disasm *dis = (X86_Disasm *) arg;
- if ( dis ) {
- dis->last_error = code;
- dis->last_error_data = data;
- }
- }
-
- void x86_default_callback( x86_insn_t *insn, void *arg ) {
- X86_InsnList *list = (X86_InsnList *) arg;
- if ( list ) {
- X86_InsnList_append( list, insn );
- }
- }
-
- /* TODO: resolver stack, maybe a callback */
- long x86_default_resolver( x86_op_t *op, x86_insn_t *insn, void *arg ) {
- X86_Disasm *dis = (X86_Disasm *) arg;
- if ( dis ) {
- //return dis->resolver( op, insn );
- return 0;
- }
-
- return 0;
- }
-
-%}
-
-%extend X86_Disasm {
-
- X86_Disasm( ) {
- X86_Disasm * dis = (X86_Disasm *)
- calloc( sizeof( X86_Disasm ), 1 );
- x86_init( opt_none, x86_default_reporter, dis );
- return dis;
- }
-
- X86_Disasm( enum x86_options options ) {
- X86_Disasm * dis = (X86_Disasm *)
- calloc( sizeof( X86_Disasm ), 1 );
- x86_init( options, x86_default_reporter, dis );
- return dis;
- }
-
- X86_Disasm( enum x86_options options, DISASM_REPORTER reporter ) {
- X86_Disasm * dis = (X86_Disasm *)
- calloc( sizeof( X86_Disasm ), 1 );
- x86_init( options, reporter, NULL );
- return dis;
- }
-
- X86_Disasm( enum x86_options options, DISASM_REPORTER reporter,
- void * arg ) {
- X86_Disasm * dis = (X86_Disasm *)
- calloc( sizeof( X86_Disasm ), 1 );
- x86_init( options, reporter, arg );
- return dis;
- }
-
- ~X86_Disasm() {
- x86_cleanup();
- free( self );
- }
-
- void set_options( enum x86_options options ) {
- return x86_set_options( options );
- }
-
- enum x86_options options() {
- return x86_get_options();
- }
-
- void set_callback( void * callback ) {
- self->disasm_callback = callback;
- }
-
- void set_resolver( void * callback ) {
- self->disasm_resolver = callback;
- }
-
- void report_error( enum x86_report_codes code ) {
- x86_report_error( code, NULL );
- }
-
- %newobject disasm;
- x86_insn_t * disasm( unsigned char *buf, size_t buf_len,
- unsigned long buf_rva, unsigned int offset ) {
- x86_insn_t *insn = calloc( sizeof( x86_insn_t ), 1 );
- x86_disasm( buf, buf_len, buf_rva, offset, insn );
- return insn;
- }
-
- int disasm_range( unsigned char *buf, size_t buf_len,
- unsigned long buf_rva, unsigned int offset,
- unsigned int len ) {
-
- X86_InsnList *list = new_X86_InsnList();
-
- if ( len > buf_len ) {
- len = buf_len;
- }
-
- return x86_disasm_range( buf, buf_rva, offset, len,
- x86_default_callback, list );
- }
-
- int disasm_forward( unsigned char *buf, size_t buf_len,
- unsigned long buf_rva, unsigned int offset ) {
- X86_InsnList *list = new_X86_InsnList();
-
- /* use default resolver: damn SWIG callbacks! */
- return x86_disasm_forward( buf, buf_len, buf_rva, offset,
- x86_default_callback, list,
- x86_default_resolver, NULL );
- }
-
- size_t disasm_invariant( unsigned char *buf, size_t buf_len,
- x86_invariant_t *inv ) {
- return x86_invariant_disasm( buf, buf_len, inv );
- }
-
- size_t disasm_size( unsigned char *buf, size_t buf_len ) {
- return x86_size_disasm( buf, buf_len );
- }
-
- %newobject format_header;
- char * format_header( enum x86_asm_format format) {
- char *buf, *str;
- size_t len;
-
- switch ( format ) {
- /* these were obtained from x86_format.c */
- case xml_syntax:
- len = 679; break;
- case raw_syntax:
- len = 172; break;
- case native_syntax:
- len = 35; break;
- case intel_syntax:
- len = 23; break;
- case att_syntax:
- len = 23; break;
- case unknown_syntax:
- default:
- len = 23; break;
- }
-
- buf = (char * ) calloc( len + 1, 1 );
- x86_format_header( buf, len, format );
-
- return buf;
- }
-
- unsigned int endian() {
- return x86_endian();
- }
-
- unsigned int addr_size() {
- return x86_addr_size();
- }
-
- unsigned int op_size() {
- return x86_op_size();
- }
-
- unsigned int word_size() {
- return x86_word_size();
- }
-
- unsigned int max_insn_size() {
- return x86_max_insn_size();
- }
-
- unsigned int sp_reg() {
- return x86_sp_reg();
- }
-
- unsigned int fp_reg() {
- return x86_fp_reg();
- }
-
- unsigned int ip_reg() {
- return x86_ip_reg();
- }
-
- %newobject reg_from_id;
- x86_reg_t * reg_from_id( unsigned int id ) {
- x86_reg_t * reg = calloc( sizeof(x86_reg_t), 1 );
- x86_reg_from_id( id, reg );
- return reg;
- }
-
- unsigned char wildcard_byte() { return X86_WILDCARD_BYTE; }
-
- int max_register_string() { return MAX_REGNAME; }
-
- int max_prefix_string() { return MAX_PREFIX_STR; }
-
- int max_mnemonic_string() { return MAX_MNEM_STR; }
-
- int max_operand_string( enum x86_asm_format format ) {
- switch ( format ) {
- case xml_syntax:
- return MAX_OP_XML_STRING;
- break;
- case raw_syntax:
- return MAX_OP_RAW_STRING;
- break;
- case native_syntax:
- case intel_syntax:
- case att_syntax:
- case unknown_syntax:
- default:
- return MAX_OP_STRING;
- break;
- }
- }
-
-
- int max_insn_string( enum x86_asm_format format ) {
- switch ( format ) {
- case xml_syntax:
- return MAX_INSN_XML_STRING;
- break;
- case raw_syntax:
- return MAX_INSN_RAW_STRING;
- break;
- case native_syntax:
- case intel_syntax:
- case att_syntax:
- case unknown_syntax:
- default:
- return MAX_INSN_STRING;
- break;
- }
- }
-
- int max_num_operands( ) { return MAX_NUM_OPERANDS; }
-}
-
-/* python callback, per the manual */
-/*%typemap(python,in) PyObject *pyfunc {
- if (!PyCallable_Check($source)) {
- PyErr_SetString(PyExc_TypeError, "Need a callable object!");
- return NULL;
- }
- $target = $source;
-}*/
-
-/* python FILE * callback, per the manual */
-/*
-%typemap(python,in) FILE * {
- if (!PyFile_Check($source)) {
- PyErr_SetString(PyExc_TypeError, "Need a file!");
- return NULL;
- }
- $target = PyFile_AsFile($source);
-}*/
-
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile-swig b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile-swig
deleted file mode 100644
index 9f3a645733..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile-swig
+++ /dev/null
@@ -1,65 +0,0 @@
-ifndef BASE_NAME
-BASE_NAME = x86disasm
-endif
-
-ifndef SWIG
-SWIG = swig # apt-get install swig !
-endif
-
-ifndef GCC
-GCC = gcc
-endif
-
-ifndef CC_FLAGS
-CC_FLAGS = -c -fPIC
-endif
-
-ifndef LD_FLAGS
-LD_FLAGS = -shared -L.. -ldisasm
-endif
-
-INTERFACE_FILE = libdisasm_oop.i
-
-SWIG_INTERFACE = ../$(INTERFACE_FILE)
-
-# PERL rules
-PERL_MOD = blib/arch/auto/$(BASE_NAME)/$(BASE_NAME).so
-PERL_SHADOW = $(BASE_NAME)_wrap.c
-PERL_SWIG = $(BASE_NAME).pl
-PERL_OBJ = $(BASE_NAME)_wrap.o
-PERL_INC = `perl -e 'use Config; print $$Config{archlib};'`/CORE
-PERL_CC_FLAGS = `perl -e 'use Config; print $$Config{ccflags};'`
-
-#====================================================
-# TARGETS
-
-all: swig-perl
-
-dummy: swig-perl install uninstall clean
-
-swig-perl: $(PERL_MOD)
-
-$(PERL_MOD): $(PERL_OBJ)
- perl Makefile.PL
- make
- #$(GCC) $(LD_FLAGS) $(PERL_OBJ) -o $@
-
-$(PERL_OBJ): $(PERL_SHADOW)
- $(GCC) $(CC_FLAGS) $(PERL_CC_FLAGS) -I$(PERL_INC) -o $@ $<
-
-$(PERL_SHADOW): $(SWIG_INTERFACE)
- swig -perl -shadow -o $(PERL_SHADOW) -outdir . $<
-
-# ==================================================================
-install: $(PERL_MOD)
- make install
-
-# ==================================================================
-uninstall:
-
-# ==================================================================
-clean:
- rm $(PERL_MOD) $(PERL_OBJ)
- rm $(PERL_SHADOW)
- rm -rf Makefile blib pm_to_blib
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile.PL b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile.PL
deleted file mode 100644
index 6e625df182..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/perl/Makefile.PL
+++ /dev/null
@@ -1,7 +0,0 @@
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
- 'NAME' => 'x86disasm',
- 'LIBS' => ['-ldisasm'],
- 'OBJECT' => 'x86disasm_wrap.o'
-);
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/python/Makefile-swig b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/python/Makefile-swig
deleted file mode 100644
index 544681a13a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/python/Makefile-swig
+++ /dev/null
@@ -1,64 +0,0 @@
-ifndef BASE_NAME
-BASE_NAME = x86disasm
-endif
-
-ifndef SWIG
-SWIG = swig # apt-get install swig !
-endif
-
-ifndef GCC
-GCC = gcc
-endif
-
-ifndef CC_FLAGS
-CC_FLAGS = -c -fPIC
-endif
-
-ifndef LD_FLAGS
-LD_FLAGS = -shared -L.. -ldisasm
-endif
-
-INTERFACE_FILE = libdisasm_oop.i
-
-SWIG_INTERFACE = ../$(INTERFACE_FILE)
-
-# PYTHON rules
-PYTHON_MOD = $(BASE_NAME)-python.so
-PYTHON_SHADOW = $(BASE_NAME)_wrap.c
-PYTHON_SWIG = $(BASE_NAME).py
-PYTHON_OBJ = $(BASE_NAME)_wrap.o
-PYTHON_INC = `/bin/echo -e 'import sys\nprint sys.prefix + "/include/python" + sys.version[:3]' | python`
-PYTHON_LIB = `/bin/echo -e 'import sys\nprint sys.prefix + "/lib/python" + sys.version[:3]' | python`
-PYTHON_DEST = $(PYTHON_LIB)/lib-dynload/_$(BASE_NAME).so
-
-#====================================================
-# TARGETS
-
-all: swig-python
-
-dummy: swig-python install uninstall clean
-
-swig-python: $(PYTHON_MOD)
-
-$(PYTHON_MOD): $(PYTHON_OBJ)
- $(GCC) $(LD_FLAGS) $(PYTHON_OBJ) -o $@
-
-$(PYTHON_OBJ): $(PYTHON_SHADOW)
- $(GCC) $(CC_FLAGS) -I$(PYTHON_INC) -I.. -o $@ $<
-
-$(PYTHON_SHADOW): $(SWIG_INTERFACE)
- swig -python -shadow -o $(PYTHON_SHADOW) -outdir . $<
-
-# ==================================================================
-install: $(PYTHON_MOD)
- sudo cp $(PYTHON_MOD) $(PYTHON_DEST)
- sudo cp $(PYTHON_SWIG) $(PYTHON_LIB)
-
-# ==================================================================
-uninstall:
-
-# ==================================================================
-clean:
- rm $(PYTHON_MOD) $(PYTHON_SWIG) $(PYTHON_OBJ)
- rm $(PYTHON_SHADOW)
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/Makefile-swig b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/Makefile-swig
deleted file mode 100644
index ee4800232c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/Makefile-swig
+++ /dev/null
@@ -1,68 +0,0 @@
-ifndef BASE_NAME
-BASE_NAME = x86disasm
-endif
-
-ifndef SWIG
-SWIG = swig # apt-get install swig !
-endif
-
-ifndef GCC
-GCC = gcc
-endif
-
-ifndef CC_FLAGS
-CC_FLAGS = -c -fPIC
-endif
-
-ifndef LD_FLAGS
-LD_FLAGS = -shared -L../.. -ldisasm
-endif
-
-LIBDISASM_DIR = ../..
-
-INTERFACE_FILE = libdisasm_oop.i
-
-SWIG_INTERFACE = ../$(INTERFACE_FILE)
-
-# RUBY rules
-RUBY_MAKEFILE = Makefile
-RUBY_MOD = $(BASE_NAME).so
-RUBY_SHADOW = $(BASE_NAME)_wrap.c
-#RUBY_SWIG = $(BASE_NAME).rb
-RUBY_OBJ = $(BASE_NAME)_wrap.o
-RUBY_INC = `ruby -e 'puts $$:.join("\n")' | tail -2 | head -1`
-#RUBY_LIB =
-#RUBY_DEST =
-
-#====================================================
-# TARGETS
-
-all: swig-ruby
-
-dummy: swig-ruby install uninstall clean
-
-swig-ruby: $(RUBY_MOD)
-
-$(RUBY_MOD): $(RUBY_MAKEFILE)
- make
-
-$(RUBY_MAKEFILE): $(RUBY_OBJ)
- ruby extconf.rb
-
-$(RUBY_OBJ):$(RUBY_SHADOW)
- $(GCC) $(CC_FLAGS) -I$(RUBY_INC) -I.. -o $@ $<
-
-$(RUBY_SHADOW): $(SWIG_INTERFACE)
- swig -ruby -o $(RUBY_SHADOW) -outdir . $<
-
-# ==================================================================
-install: $(RUBY_MOD)
- make install
-
-# ==================================================================
-uninstall:
-
-# ==================================================================
-clean:
- make clean || true
- rm $(RUBY_SHADOW) $(RUBY_MAKEFILE) $(RUBY_MOD) $(RUBY_OBJ)
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/extconf.rb b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/extconf.rb
deleted file mode 100644
index 4e74326435..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/ruby/extconf.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'mkmf'
-find_library('disasm', 'x86_init', "/usr/local/lib", "../..")
-create_makefile('x86disasm')
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/tcl/Makefile-swig b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/tcl/Makefile-swig
deleted file mode 100644
index 5145a82935..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/swig/tcl/Makefile-swig
+++ /dev/null
@@ -1,63 +0,0 @@
-ifndef BASE_NAME
-BASE_NAME = x86disasm
-endif
-
-ifndef SWIG
-SWIG = swig # apt-get install swig !
-endif
-
-ifndef GCC
-GCC = gcc
-endif
-
-ifndef CC_FLAGS
-CC_FLAGS = -c -fPIC
-endif
-
-ifndef LD_FLAGS
-LD_FLAGS = -shared -L../.. -ldisasm
-endif
-
-INTERFACE_FILE = libdisasm.i
-
-SWIG_INTERFACE = ../$(INTERFACE_FILE)
-
-# TCL rules
-TCL_VERSION = 8.3
-TCL_MOD = $(BASE_NAME)-tcl.so
-TCL_SHADOW = $(BASE_NAME)_wrap.c
-TCL_OBJ = $(BASE_NAME)_wrap.o
-TCL_INC = /usr/include/tcl$(TCL_VERSION)
-TCL_LIB = /usr/lib/tcl$(TCL_VERSION)
-TCL_DEST = $(TCL_LIB)/$(BASE_NAME).so
-
-#====================================================
-# TARGETS
-
-all: swig-tcl
-
-dummy: swig-tcl install uninstall clean
-
-swig-tcl: $(TCL_MOD)
-
-$(TCL_MOD): $(TCL_OBJ)
- $(GCC) $(LD_FLAGS) $(TCL_OBJ) -o $@
-
-$(TCL_OBJ): $(TCL_SHADOW)
- $(GCC) $(CC_FLAGS) -I$(TCL_INC) -I.. -o $@ $<
-
-$(TCL_SHADOW): $(SWIG_INTERFACE)
- swig -tcl -o $(TCL_SHADOW) -outdir . $<
-
-# ==================================================================
-install: $(TCL_MOD)
- sudo cp $(TCL_MOD) $(TCL_DEST)
-
-# ==================================================================
-uninstall:
-
-# ==================================================================
-clean:
- rm $(TCL_MOD) $(TCL_SWIG) $(TCL_OBJ)
- rm $(TCL_SHADOW)
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_disasm.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_disasm.c
deleted file mode 100644
index 1b82f4e667..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_disasm.c
+++ /dev/null
@@ -1,210 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libdis.h"
-#include "ia32_insn.h"
-#include "ia32_invariant.h"
-#include "x86_operand_list.h"
-
-
-#ifdef _MSC_VER
- #define snprintf _snprintf
- #define inline __inline
-#endif
-
-unsigned int x86_disasm( unsigned char *buf, unsigned int buf_len,
- uint32_t buf_rva, unsigned int offset,
- x86_insn_t *insn ){
- int len, size;
- unsigned char bytes[MAX_INSTRUCTION_SIZE];
-
- if ( ! buf || ! insn || ! buf_len ) {
- /* caller screwed up somehow */
- return 0;
- }
-
-
- /* ensure we are all NULLed up */
- memset( insn, 0, sizeof(x86_insn_t) );
- insn->addr = buf_rva + offset;
- insn->offset = offset;
- /* default to invalid insn */
- insn->type = insn_invalid;
- insn->group = insn_none;
-
- if ( offset >= buf_len ) {
- /* another caller screwup ;) */
- x86_report_error(report_disasm_bounds, (void*)(long)(buf_rva+offset));
- return 0;
- }
-
- len = buf_len - offset;
-
- /* copy enough bytes for disassembly into buffer : this
- * helps prevent buffer overruns at the end of a file */
- memset( bytes, 0, MAX_INSTRUCTION_SIZE );
- memcpy( bytes, &buf[offset], (len < MAX_INSTRUCTION_SIZE) ? len :
- MAX_INSTRUCTION_SIZE );
-
- /* actually do the disassembly */
- /* TODO: allow switching when more disassemblers are added */
- size = ia32_disasm_addr( bytes, len, insn);
-
- /* check and see if we had an invalid instruction */
- if (! size ) {
- x86_report_error(report_invalid_insn, (void*)(long)(buf_rva+offset));
- return 0;
- }
-
- /* check if we overran the end of the buffer */
- if ( size > len ) {
- x86_report_error( report_insn_bounds, (void*)(long)(buf_rva + offset));
- MAKE_INVALID( insn, bytes );
- return 0;
- }
-
- /* fill bytes field of insn */
- memcpy( insn->bytes, bytes, size );
-
- return size;
-}
-
-unsigned int x86_disasm_range( unsigned char *buf, uint32_t buf_rva,
- unsigned int offset, unsigned int len,
- DISASM_CALLBACK func, void *arg ) {
- x86_insn_t insn;
- unsigned int buf_len, size, count = 0, bytes = 0;
-
- /* buf_len is implied by the arguments */
- buf_len = len + offset;
-
- while ( bytes < len ) {
- size = x86_disasm( buf, buf_len, buf_rva, offset + bytes,
- &insn );
- if ( size ) {
- /* invoke callback if it exists */
- if ( func ) {
- (*func)( &insn, arg );
- }
- bytes += size;
- count ++;
- } else {
- /* error */
- bytes++; /* try next byte */
- }
-
- x86_oplist_free( &insn );
- }
-
- return( count );
-}
-
-static inline int follow_insn_dest( x86_insn_t *insn ) {
- if ( insn->type == insn_jmp || insn->type == insn_jcc ||
- insn->type == insn_call || insn->type == insn_callcc ) {
- return(1);
- }
- return(0);
-}
-
-static inline int insn_doesnt_return( x86_insn_t *insn ) {
- return( (insn->type == insn_jmp || insn->type == insn_return) ? 1: 0 );
-}
-
-static int32_t internal_resolver( x86_op_t *op, x86_insn_t *insn ){
- int32_t next_addr = -1;
- if ( x86_optype_is_address(op->type) ) {
- next_addr = op->data.sdword;
- } else if ( op->type == op_relative_near ) {
- next_addr = insn->addr + insn->size + op->data.relative_near;
- } else if ( op->type == op_relative_far ) {
- next_addr = insn->addr + insn->size + op->data.relative_far;
- }
- return( next_addr );
-}
-
-unsigned int x86_disasm_forward( unsigned char *buf, unsigned int buf_len,
- uint32_t buf_rva, unsigned int offset,
- DISASM_CALLBACK func, void *arg,
- DISASM_RESOLVER resolver, void *r_arg ){
- x86_insn_t insn;
- x86_op_t *op;
- int32_t next_addr;
- uint32_t next_offset;
- unsigned int size, count = 0, bytes = 0, cont = 1;
-
- while ( cont && bytes < buf_len ) {
- size = x86_disasm( buf, buf_len, buf_rva, offset + bytes,
- &insn );
-
- if ( size ) {
- /* invoke callback if it exists */
- if ( func ) {
- (*func)( &insn, arg );
- }
- bytes += size;
- count ++;
- } else {
- /* error */
- bytes++; /* try next byte */
- }
-
- if ( follow_insn_dest(&insn) ) {
- op = x86_get_dest_operand( &insn );
- next_addr = -1;
-
- /* if caller supplied a resolver, use it to determine
- * the address to disassemble */
- if ( resolver ) {
- next_addr = resolver(op, &insn, r_arg);
- } else {
- next_addr = internal_resolver(op, &insn);
- }
-
- if (next_addr != -1 ) {
- next_offset = next_addr - buf_rva;
- /* if offset is in this buffer... */
- if ( (uint32_t)next_addr >= buf_rva &&
- next_offset < buf_len ) {
- /* go ahead and disassemble */
- count += x86_disasm_forward( buf,
- buf_len,
- buf_rva,
- next_offset,
- func, arg,
- resolver, r_arg );
- } else {
- /* report unresolved address */
- x86_report_error( report_disasm_bounds,
- (void*)(long)next_addr );
- }
- }
- } /* end follow_insn */
-
- if ( insn_doesnt_return(&insn) ) {
- /* stop disassembling */
- cont = 0;
- }
-
- x86_oplist_free( &insn );
- }
- return( count );
-}
-
-/* invariant instruction representation */
-size_t x86_invariant_disasm( unsigned char *buf, int buf_len,
- x86_invariant_t *inv ){
- if (! buf || ! buf_len || ! inv ) {
- return(0);
- }
-
- return ia32_disasm_invariant(buf, buf_len, inv);
-}
-size_t x86_size_disasm( unsigned char *buf, unsigned int buf_len ) {
- if (! buf || ! buf_len ) {
- return(0);
- }
-
- return ia32_disasm_size(buf, buf_len);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_format.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_format.c
deleted file mode 100644
index 0ec960dc8f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_format.c
+++ /dev/null
@@ -1,1430 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libdis.h"
-#include <inttypes.h>
-
-#ifdef _MSC_VER
- #define snprintf _snprintf
- #define inline __inline
-#endif
-
-
-/*
- * concatenation macros. STRNCATF concatenates a format string, buf
- * only with one argument.
- */
-#define STRNCAT( buf, str, len ) do { \
- int _i = strlen(str), _blen = strlen(buf), _len = len - 1; \
- if ( len ) { \
- strncat( buf, str, _len ); \
- if ( _len <= _i ) { \
- buf[_blen+_len] = '\0'; \
- len = 0; \
- } else { \
- len -= _i; \
- } \
- } \
-} while( 0 )
-
-#define STRNCATF( buf, fmt, data, len ) do { \
- char _tmp[MAX_OP_STRING]; \
- \
- snprintf( _tmp, sizeof _tmp, fmt, data ); \
- STRNCAT( buf, _tmp, len ); \
-} while( 0 )
-
-
-#define PRINT_DISPLACEMENT( ea ) do { \
- if ( ea->disp_size && ea->disp ) { \
- if ( ea->disp_sign ) { \
- STRNCATF( buf, "-0x%" PRIX32, -ea->disp, len ); \
- } else { \
- STRNCATF( buf, "0x%" PRIX32, ea->disp, len ); \
- } \
- } \
-} while( 0 )
-
-static const char *prefix_strings[] = {
- "", /* no prefix */
- "repz ", /* the trailing spaces make it easy to prepend to mnemonic */
- "repnz ",
- "lock ",
- "branch delay " /* unused in x86 */
-};
-
-static int format_insn_prefix_str( enum x86_insn_prefix prefix, char *buf,
- int len ) {
-
- int len_orig = len;
-
- /* concat all prefix strings */
- if ( prefix & 1 ) { STRNCAT( buf, prefix_strings[1], len ); }
- if ( prefix & 2 ) { STRNCAT( buf, prefix_strings[2], len ); }
- if ( prefix & 4 ) { STRNCAT( buf, prefix_strings[3], len ); }
- if ( prefix & 8 ) { STRNCAT( buf, prefix_strings[4], len ); }
-
- /* return the number of characters added */
- return (len_orig - len);
-}
-
-/*
- * sprint's an operand's data to string str.
- */
-static void get_operand_data_str( x86_op_t *op, char *str, int len ){
-
- if ( op->flags & op_signed ) {
- switch ( op->datatype ) {
- case op_byte:
- snprintf( str, len, "%" PRId8, op->data.sbyte );
- return;
- case op_word:
- snprintf( str, len, "%" PRId16, op->data.sword );
- return;
- case op_qword:
- snprintf( str, len, "%" PRId64, op->data.sqword );
- return;
- default:
- snprintf( str, len, "%" PRId32, op->data.sdword );
- return;
- }
- }
-
- //else
- switch ( op->datatype ) {
- case op_byte:
- snprintf( str, len, "0x%02" PRIX8, op->data.byte );
- return;
- case op_word:
- snprintf( str, len, "0x%04" PRIX16, op->data.word );
- return;
- case op_qword:
- snprintf( str, len, "0x%08" PRIX64,op->data.sqword );
- return;
- default:
- snprintf( str, len, "0x%08" PRIX32, op->data.dword );
- return;
- }
-}
-
-/*
- * sprints register types to a string. the register types can be ORed
- * together.
- */
-static void get_operand_regtype_str( int regtype, char *str, int len )
-{
- static struct {
- const char *name;
- int value;
- } operand_regtypes[] = {
- {"reg_gen" , 0x00001},
- {"reg_in" , 0x00002},
- {"reg_out" , 0x00004},
- {"reg_local" , 0x00008},
- {"reg_fpu" , 0x00010},
- {"reg_seg" , 0x00020},
- {"reg_simd" , 0x00040},
- {"reg_sys" , 0x00080},
- {"reg_sp" , 0x00100},
- {"reg_fp" , 0x00200},
- {"reg_pc" , 0x00400},
- {"reg_retaddr", 0x00800},
- {"reg_cond" , 0x01000},
- {"reg_zero" , 0x02000},
- {"reg_ret" , 0x04000},
- {"reg_src" , 0x10000},
- {"reg_dest" , 0x20000},
- {"reg_count" , 0x40000},
- {NULL, 0}, //end
- };
-
- unsigned int i;
-
- memset( str, 0, len );
-
- //go thru every type in the enum
- for ( i = 0; operand_regtypes[i].name; i++ ) {
- //skip if type is not set
- if(! (regtype & operand_regtypes[i].value) )
- continue;
-
- //not the first time around
- if( str[0] ) {
- STRNCAT( str, " ", len );
- }
-
- STRNCAT(str, operand_regtypes[i].name, len );
- }
-}
-
-static int format_expr( x86_ea_t *ea, char *buf, int len,
- enum x86_asm_format format ) {
- char str[MAX_OP_STRING];
-
- if ( format == att_syntax ) {
- if (ea->base.name[0] || ea->index.name[0] || ea->scale) {
- PRINT_DISPLACEMENT(ea);
- STRNCAT( buf, "(", len );
-
- if ( ea->base.name[0]) {
- STRNCATF( buf, "%%%s", ea->base.name, len );
- }
- if ( ea->index.name[0]) {
- STRNCATF( buf, ",%%%s", ea->index.name, len );
- if ( ea->scale > 1 ) {
- STRNCATF( buf, ",%d", ea->scale, len );
- }
- }
- /* handle the syntactic exception */
- if ( ! ea->base.name[0] &&
- ! ea->index.name[0] ) {
- STRNCATF( buf, ",%d", ea->scale, len );
- }
-
- STRNCAT( buf, ")", len );
- } else
- STRNCATF( buf, "0x%" PRIX32, ea->disp, len );
-
- } else if ( format == xml_syntax ){
-
- if ( ea->base.name[0]) {
- STRNCAT (buf, "\t\t\t<base>\n", len);
-
- get_operand_regtype_str (ea->base.type, str,
- sizeof str);
- STRNCAT (buf, "\t\t\t\t<register ", len);
- STRNCATF (buf, "name=\"%s\" ", ea->base.name, len);
- STRNCATF (buf, "type=\"%s\" ", str, len);
- STRNCATF (buf, "size=%d/>\n", ea->base.size, len);
-
- STRNCAT (buf, "\t\t\t</base>\n", len);
- }
-
- if ( ea->index.name[0]) {
- STRNCAT (buf, "\t\t\t<index>\n", len);
-
- get_operand_regtype_str (ea->index.type, str,
- sizeof str);
-
- STRNCAT (buf, "\t\t\t\t<register ", len);
- STRNCATF (buf, "name=\"%s\" ", ea->index.name, len);
- STRNCATF (buf, "type=\"%s\" ", str, len);
- STRNCATF (buf, "size=%d/>\n", ea->index.size, len);
-
- STRNCAT (buf, "\t\t\t</index>\n", len);
- }
-
- //scale
- STRNCAT (buf, "\t\t\t<scale>\n", len);
- STRNCAT (buf, "\t\t\t\t<immediate ", len);
- STRNCATF (buf, "value=\"%d\"/>\n", ea->scale, len);
- STRNCAT (buf, "\t\t\t</scale>\n", len);
-
- if ( ea->disp_size ) {
-
- STRNCAT (buf, "\t\t\t<displacement>\n", len);
-
- if ( ea->disp_size > 1 && ! ea->disp_sign ) {
- STRNCAT (buf, "\t\t\t\t<address ", len);
- STRNCATF (buf, "value=\"0x%" PRIX32 "\"/>\n", ea->disp,
- len);
- } else {
- STRNCAT (buf, "\t\t\t\t<immediate ", len);
- STRNCATF (buf, "value=%" PRId32 "/>\n", ea->disp, len);
- }
-
- STRNCAT (buf, "\t\t\t</displacement>\n", len);
- }
-
- } else if ( format == raw_syntax ) {
-
- PRINT_DISPLACEMENT(ea);
- STRNCAT( buf, "(", len );
-
- STRNCATF( buf, "%s,", ea->base.name, len );
- STRNCATF( buf, "%s,", ea->index.name, len );
- STRNCATF( buf, "%d", ea->scale, len );
- STRNCAT( buf, ")", len );
-
- } else {
-
- STRNCAT( buf, "[", len );
-
- if ( ea->base.name[0] ) {
- STRNCAT( buf, ea->base.name, len );
- if ( ea->index.name[0] ||
- (ea->disp_size && ! ea->disp_sign) ) {
- STRNCAT( buf, "+", len );
- }
- }
- if ( ea->index.name[0] ) {
- STRNCAT( buf, ea->index.name, len );
- if ( ea->scale > 1 )
- {
- STRNCATF( buf, "*%" PRId32, ea->scale, len );
- }
- if ( ea->disp_size && ! ea->disp_sign )
- {
- STRNCAT( buf, "+", len );
- }
- }
-
- if ( ea->disp_size || (! ea->index.name[0] &&
- ! ea->base.name[0] ) )
- {
- PRINT_DISPLACEMENT(ea);
- }
-
- STRNCAT( buf, "]", len );
- }
-
- return( strlen(buf) );
-}
-
-static int format_seg( x86_op_t *op, char *buf, int len,
- enum x86_asm_format format ) {
- int len_orig = len;
- const char *reg = "";
-
- if (! op || ! buf || ! len || ! op->flags) {
- return(0);
- }
- if ( op->type != op_offset && op->type != op_expression ){
- return(0);
- }
- if (! ((int) op->flags & 0xF00) ) {
- return(0);
- }
-
- switch (op->flags & 0xF00) {
- case op_es_seg: reg = "es"; break;
- case op_cs_seg: reg = "cs"; break;
- case op_ss_seg: reg = "ss"; break;
- case op_ds_seg: reg = "ds"; break;
- case op_fs_seg: reg = "fs"; break;
- case op_gs_seg: reg = "gs"; break;
- default:
- break;
- }
-
- if (! reg[0] ) {
- return( 0 );
- }
-
- switch( format ) {
- case xml_syntax:
- STRNCAT( buf, "\t\t\t<segment ", len );
- STRNCATF( buf, "value=\"%s\"/>\n", reg, len );
- break;
- case att_syntax:
- STRNCATF( buf, "%%%s:", reg, len );
- break;
-
- default:
- STRNCATF( buf, "%s:", reg, len );
- break;
- }
-
- return( len_orig - len ); /* return length of appended string */
-}
-
-static const char *get_operand_datatype_str( x86_op_t *op ){
-
- static const char *types[] = {
- "sbyte", /* 0 */
- "sword",
- "sqword",
- "sdword",
- "sdqword", /* 4 */
- "byte",
- "word",
- "qword",
- "dword", /* 8 */
- "dqword",
- "sreal",
- "dreal",
- "extreal", /* 12 */
- "bcd",
- "ssimd",
- "dsimd",
- "sssimd", /* 16 */
- "sdsimd",
- "descr32",
- "descr16",
- "pdescr32", /* 20 */
- "pdescr16",
- "bounds16",
- "bounds32",
- "fpu_env16",
- "fpu_env32", /* 25 */
- "fpu_state16",
- "fpu_state32",
- "fp_reg_set"
- };
-
- /* handle signed values first */
- if ( op->flags & op_signed ) {
- switch (op->datatype) {
- case op_byte: return types[0];
- case op_word: return types[1];
- case op_qword: return types[2];
- case op_dqword: return types[4];
- default: return types[3];
- }
- }
-
- switch (op->datatype) {
- case op_byte: return types[5];
- case op_word: return types[6];
- case op_qword: return types[7];
- case op_dqword: return types[9];
- case op_sreal: return types[10];
- case op_dreal: return types[11];
- case op_extreal: return types[12];
- case op_bcd: return types[13];
- case op_ssimd: return types[14];
- case op_dsimd: return types[15];
- case op_sssimd: return types[16];
- case op_sdsimd: return types[17];
- case op_descr32: return types[18];
- case op_descr16: return types[19];
- case op_pdescr32: return types[20];
- case op_pdescr16: return types[21];
- case op_bounds16: return types[22];
- case op_bounds32: return types[23];
- case op_fpustate16: return types[24];
- case op_fpustate32: return types[25];
- case op_fpuenv16: return types[26];
- case op_fpuenv32: return types[27];
- case op_fpregset: return types[28];
- default: return types[8];
- }
-}
-
-static int format_insn_eflags_str( enum x86_flag_status flags, char *buf,
- int len) {
-
- static struct {
- const char *name;
- int value;
- } insn_flags[] = {
- { "carry_set ", 0x0001 },
- { "zero_set ", 0x0002 },
- { "oflow_set ", 0x0004 },
- { "dir_set ", 0x0008 },
- { "sign_set ", 0x0010 },
- { "parity_set ", 0x0020 },
- { "carry_or_zero_set ", 0x0040 },
- { "zero_set_or_sign_ne_oflow ", 0x0080 },
- { "carry_clear ", 0x0100 },
- { "zero_clear ", 0x0200 },
- { "oflow_clear ", 0x0400 },
- { "dir_clear ", 0x0800 },
- { "sign_clear ", 0x1000 },
- { "parity_clear ", 0x2000 },
- { "sign_eq_oflow ", 0x4000 },
- { "sign_ne_oflow ", 0x8000 },
- { NULL, 0x0000 }, //end
- };
-
- unsigned int i;
- int len_orig = len;
-
- for (i = 0; insn_flags[i].name; i++) {
- if (! (flags & insn_flags[i].value) )
- continue;
-
- STRNCAT( buf, insn_flags[i].name, len );
- }
-
- return( len_orig - len );
-}
-
-static const char *get_insn_group_str( enum x86_insn_group gp ) {
-
- static const char *types[] = {
- "", // 0
- "controlflow",// 1
- "arithmetic", // 2
- "logic", // 3
- "stack", // 4
- "comparison", // 5
- "move", // 6
- "string", // 7
- "bit_manip", // 8
- "flag_manip", // 9
- "fpu", // 10
- "", // 11
- "", // 12
- "interrupt", // 13
- "system", // 14
- "other", // 15
- };
-
- if ( gp > sizeof (types)/sizeof(types[0]) )
- return "";
-
- return types[gp];
-}
-
-static const char *get_insn_type_str( enum x86_insn_type type ) {
-
- static struct {
- const char *name;
- int value;
- } types[] = {
- /* insn_controlflow */
- { "jmp", 0x1001 },
- { "jcc", 0x1002 },
- { "call", 0x1003 },
- { "callcc", 0x1004 },
- { "return", 0x1005 },
- { "loop", 0x1006 },
- /* insn_arithmetic */
- { "add", 0x2001 },
- { "sub", 0x2002 },
- { "mul", 0x2003 },
- { "div", 0x2004 },
- { "inc", 0x2005 },
- { "dec", 0x2006 },
- { "shl", 0x2007 },
- { "shr", 0x2008 },
- { "rol", 0x2009 },
- { "ror", 0x200A },
- /* insn_logic */
- { "and", 0x3001 },
- { "or", 0x3002 },
- { "xor", 0x3003 },
- { "not", 0x3004 },
- { "neg", 0x3005 },
- /* insn_stack */
- { "push", 0x4001 },
- { "pop", 0x4002 },
- { "pushregs", 0x4003 },
- { "popregs", 0x4004 },
- { "pushflags", 0x4005 },
- { "popflags", 0x4006 },
- { "enter", 0x4007 },
- { "leave", 0x4008 },
- /* insn_comparison */
- { "test", 0x5001 },
- { "cmp", 0x5002 },
- /* insn_move */
- { "mov", 0x6001 }, /* move */
- { "movcc", 0x6002 }, /* conditional move */
- { "xchg", 0x6003 }, /* exchange */
- { "xchgcc", 0x6004 }, /* conditional exchange */
- /* insn_string */
- { "strcmp", 0x7001 },
- { "strload", 0x7002 },
- { "strmov", 0x7003 },
- { "strstore", 0x7004 },
- { "translate", 0x7005 }, /* xlat */
- /* insn_bit_manip */
- { "bittest", 0x8001 },
- { "bitset", 0x8002 },
- { "bitclear", 0x8003 },
- /* insn_flag_manip */
- { "clear_carry", 0x9001 },
- { "clear_zero", 0x9002 },
- { "clear_oflow", 0x9003 },
- { "clear_dir", 0x9004 },
- { "clear_sign", 0x9005 },
- { "clear_parity", 0x9006 },
- { "set_carry", 0x9007 },
- { "set_zero", 0x9008 },
- { "set_oflow", 0x9009 },
- { "set_dir", 0x900A },
- { "set_sign", 0x900B },
- { "set_parity", 0x900C },
- { "tog_carry", 0x9010 },
- { "tog_zero", 0x9020 },
- { "tog_oflow", 0x9030 },
- { "tog_dir", 0x9040 },
- { "tog_sign", 0x9050 },
- { "tog_parity", 0x9060 },
- /* insn_fpu */
- { "fmov", 0xA001 },
- { "fmovcc", 0xA002 },
- { "fneg", 0xA003 },
- { "fabs", 0xA004 },
- { "fadd", 0xA005 },
- { "fsub", 0xA006 },
- { "fmul", 0xA007 },
- { "fdiv", 0xA008 },
- { "fsqrt", 0xA009 },
- { "fcmp", 0xA00A },
- { "fcos", 0xA00C },
- { "fldpi", 0xA00D },
- { "fldz", 0xA00E },
- { "ftan", 0xA00F },
- { "fsine", 0xA010 },
- { "fsys", 0xA020 },
- /* insn_interrupt */
- { "int", 0xD001 },
- { "intcc", 0xD002 }, /* not present in x86 ISA */
- { "iret", 0xD003 },
- { "bound", 0xD004 },
- { "debug", 0xD005 },
- { "trace", 0xD006 },
- { "invalid_op", 0xD007 },
- { "oflow", 0xD008 },
- /* insn_system */
- { "halt", 0xE001 },
- { "in", 0xE002 }, /* input from port/bus */
- { "out", 0xE003 }, /* output to port/bus */
- { "cpuid", 0xE004 },
- /* insn_other */
- { "nop", 0xF001 },
- { "bcdconv", 0xF002 }, /* convert to or from BCD */
- { "szconv", 0xF003 }, /* change size of operand */
- { NULL, 0 }, //end
- };
-
- unsigned int i;
-
- //go thru every type in the enum
- for ( i = 0; types[i].name; i++ ) {
- if ( types[i].value == type )
- return types[i].name;
- }
-
- return "";
-}
-
-static const char *get_insn_cpu_str( enum x86_insn_cpu cpu ) {
- static const char *intel[] = {
- "", // 0
- "8086", // 1
- "80286", // 2
- "80386", // 3
- "80387", // 4
- "80486", // 5
- "Pentium", // 6
- "Pentium Pro", // 7
- "Pentium 2", // 8
- "Pentium 3", // 9
- "Pentium 4" // 10
- };
-
- if ( cpu < sizeof(intel)/sizeof(intel[0]) ) {
- return intel[cpu];
- } else if ( cpu == 16 ) {
- return "K6";
- } else if ( cpu == 32 ) {
- return "K7";
- } else if ( cpu == 48 ) {
- return "Athlon";
- }
-
- return "";
-}
-
-static const char *get_insn_isa_str( enum x86_insn_isa isa ) {
- static const char *subset[] = {
- NULL, // 0
- "General Purpose", // 1
- "Floating Point", // 2
- "FPU Management", // 3
- "MMX", // 4
- "SSE", // 5
- "SSE2", // 6
- "SSE3", // 7
- "3DNow!", // 8
- "System" // 9
- };
-
- if ( isa > sizeof (subset)/sizeof(subset[0]) ) {
- return "";
- }
-
- return subset[isa];
-}
-
-static int format_operand_att( x86_op_t *op, x86_insn_t *insn, char *buf,
- int len){
-
- char str[MAX_OP_STRING];
-
- memset (str, 0, sizeof str);
-
- switch ( op->type ) {
- case op_register:
- STRNCATF( buf, "%%%s", op->data.reg.name, len );
- break;
-
- case op_immediate:
- get_operand_data_str( op, str, sizeof str );
- STRNCATF( buf, "$%s", str, len );
- break;
-
- case op_relative_near:
- STRNCATF( buf, "0x%08X",
- (unsigned int)(op->data.sbyte +
- insn->addr + insn->size), len );
- break;
-
- case op_relative_far:
- if (op->datatype == op_word) {
- STRNCATF( buf, "0x%08X",
- (unsigned int)(op->data.sword +
- insn->addr + insn->size), len );
- } else {
- STRNCATF( buf, "0x%08X",
- (unsigned int)(op->data.sdword +
- insn->addr + insn->size), len );
- }
- break;
-
- case op_absolute:
- /* ATT uses the syntax $section, $offset */
- STRNCATF( buf, "$0x%04" PRIX16 ", ", op->data.absolute.segment,
- len );
- if (op->datatype == op_descr16) {
- STRNCATF( buf, "$0x%04" PRIX16,
- op->data.absolute.offset.off16, len );
- } else {
- STRNCATF( buf, "$0x%08" PRIX32,
- op->data.absolute.offset.off32, len );
- }
- break;
- case op_offset:
- /* ATT requires a '*' before JMP/CALL ops */
- if (insn->type == insn_jmp || insn->type == insn_call)
- STRNCAT( buf, "*", len );
-
- len -= format_seg( op, buf, len, att_syntax );
- STRNCATF( buf, "0x%08" PRIX32, op->data.sdword, len );
- break;
-
- case op_expression:
- /* ATT requires a '*' before JMP/CALL ops */
- if (insn->type == insn_jmp || insn->type == insn_call)
- STRNCAT( buf, "*", len );
-
- len -= format_seg( op, buf, len, att_syntax );
- len -= format_expr( &op->data.expression, buf, len,
- att_syntax );
- break;
- case op_unused:
- case op_unknown:
- /* return 0-truncated buffer */
- break;
- }
-
- return ( strlen( buf ) );
-}
-
-static int format_operand_native( x86_op_t *op, x86_insn_t *insn, char *buf,
- int len){
-
- char str[MAX_OP_STRING];
-
- switch (op->type) {
- case op_register:
- STRNCAT( buf, op->data.reg.name, len );
- break;
-
- case op_immediate:
- get_operand_data_str( op, str, sizeof str );
- STRNCAT( buf, str, len );
- break;
-
- case op_relative_near:
- STRNCATF( buf, "0x%08" PRIX32,
- (unsigned int)(op->data.sbyte +
- insn->addr + insn->size), len );
- break;
-
- case op_relative_far:
- if ( op->datatype == op_word ) {
- STRNCATF( buf, "0x%08" PRIX32,
- (unsigned int)(op->data.sword +
- insn->addr + insn->size), len );
- break;
- } else {
- STRNCATF( buf, "0x%08" PRIX32, op->data.sdword +
- insn->addr + insn->size, len );
- }
- break;
-
- case op_absolute:
- STRNCATF( buf, "$0x%04" PRIX16 ":", op->data.absolute.segment,
- len );
- if (op->datatype == op_descr16) {
- STRNCATF( buf, "0x%04" PRIX16,
- op->data.absolute.offset.off16, len );
- } else {
- STRNCATF( buf, "0x%08" PRIX32,
- op->data.absolute.offset.off32, len );
- }
- break;
-
- case op_offset:
- len -= format_seg( op, buf, len, native_syntax );
- STRNCATF( buf, "[0x%08" PRIX32 "]", op->data.sdword, len );
- break;
-
- case op_expression:
- len -= format_seg( op, buf, len, native_syntax );
- len -= format_expr( &op->data.expression, buf, len,
- native_syntax );
- break;
- case op_unused:
- case op_unknown:
- /* return 0-truncated buffer */
- break;
- }
-
- return( strlen( buf ) );
-}
-
-static int format_operand_xml( x86_op_t *op, x86_insn_t *insn, char *buf,
- int len){
-
- char str[MAX_OP_STRING] = "\0";
-
- switch (op->type) {
- case op_register:
-
- get_operand_regtype_str( op->data.reg.type, str,
- sizeof str );
-
- STRNCAT( buf, "\t\t<register ", len );
- STRNCATF( buf, "name=\"%s\" ", op->data.reg.name, len );
- STRNCATF( buf, "type=\"%s\" ", str, len );
- STRNCATF( buf, "size=%d/>\n", op->data.reg.size, len );
- break;
-
- case op_immediate:
-
- get_operand_data_str( op, str, sizeof str );
-
- STRNCAT( buf, "\t\t<immediate ", len );
- STRNCATF( buf, "type=\"%s\" ",
- get_operand_datatype_str (op), len );
- STRNCATF( buf, "value=\"%s\"/>\n", str, len );
- break;
-
- case op_relative_near:
- STRNCAT( buf, "\t\t<relative_offset ", len );
-
- STRNCATF( buf, "value=\"0x%08" PRIX32 "\"/>\n",
- (unsigned int)(op->data.sbyte +
- insn->addr + insn->size), len );
- break;
-
- case op_relative_far:
- STRNCAT( buf, "\t\t<relative_offset ", len );
-
- if (op->datatype == op_word) {
- STRNCATF( buf, "value=\"0x%08" PRIX32 "\"/>\n",
- (unsigned int)(op->data.sword +
- insn->addr + insn->size), len);
- break;
- } else {
-
- STRNCATF( buf, "value=\"0x%08" PRIX32 "\"/>\n",
- op->data.sdword + insn->addr + insn->size,
- len );
- }
- break;
-
- case op_absolute:
-
- STRNCATF( buf,
- "\t\t<absolute_address segment=\"0x%04" PRIX16 "\"",
- op->data.absolute.segment, len );
-
- if (op->datatype == op_descr16) {
- STRNCATF( buf, "offset=\"0x%04" PRIX16 "\">",
- op->data.absolute.offset.off16, len );
- } else {
- STRNCATF( buf, "offset=\"0x%08" PRIX32 "\">",
- op->data.absolute.offset.off32, len );
- }
-
- STRNCAT( buf, "\t\t</absolute_address>\n", len );
- break;
-
- case op_expression:
-
-
- STRNCAT( buf, "\t\t<address_expression>\n", len );
-
- len -= format_seg( op, buf, len, xml_syntax );
- len -= format_expr( &op->data.expression, buf, len,
- xml_syntax );
-
- STRNCAT( buf, "\t\t</address_expression>\n", len );
- break;
-
- case op_offset:
-
- STRNCAT( buf, "\t\t<segment_offset>\n", len );
-
- len -= format_seg( op, buf, len, xml_syntax );
-
- STRNCAT( buf, "\t\t\t<address ", len);
- STRNCATF( buf, "value=\"0x%08" PRIX32 "\"/>\n",
- op->data.sdword, len );
- STRNCAT( buf, "\t\t</segment_offset>\n", len );
- break;
-
- case op_unused:
- case op_unknown:
- /* return 0-truncated buffer */
- break;
- }
-
- return( strlen( buf ) );
-}
-
-static int format_operand_raw( x86_op_t *op, x86_insn_t *insn, char *buf,
- int len){
-
- char str[MAX_OP_RAW_STRING];
- const char *datatype = get_operand_datatype_str(op);
-
- switch (op->type) {
- case op_register:
-
- get_operand_regtype_str( op->data.reg.type, str,
- sizeof str );
-
- STRNCAT( buf, "reg|", len );
- STRNCATF( buf, "%s|", datatype, len );
- STRNCATF( buf, "%s:", op->data.reg.name, len );
- STRNCATF( buf, "%s:", str, len );
- STRNCATF( buf, "%d|", op->data.reg.size, len );
- break;
-
- case op_immediate:
-
- get_operand_data_str( op, str, sizeof str );
-
- STRNCAT( buf, "immediate|", len );
- STRNCATF( buf, "%s|", datatype, len );
- STRNCATF( buf, "%s|", str, len );
- break;
-
- case op_relative_near:
- /* NOTE: in raw format, we print the
- * relative offset, not the actual
- * address of the jump target */
-
- STRNCAT( buf, "relative|", len );
- STRNCATF( buf, "%s|", datatype, len );
- STRNCATF( buf, "%" PRId8 "|", op->data.sbyte, len );
- break;
-
- case op_relative_far:
-
- STRNCAT( buf, "relative|", len );
- STRNCATF( buf, "%s|", datatype, len );
-
- if (op->datatype == op_word) {
- STRNCATF( buf, "%" PRId16 "|", op->data.sword, len);
- break;
- } else {
- STRNCATF( buf, "%" PRId32 "|", op->data.sdword, len );
- }
- break;
-
- case op_absolute:
-
- STRNCAT( buf, "absolute_address|", len );
- STRNCATF( buf, "%s|", datatype, len );
-
- STRNCATF( buf, "$0x%04" PRIX16 ":", op->data.absolute.segment,
- len );
- if (op->datatype == op_descr16) {
- STRNCATF( buf, "0x%04" PRIX16 "|",
- op->data.absolute.offset.off16, len );
- } else {
- STRNCATF( buf, "0x%08" PRIX32 "|",
- op->data.absolute.offset.off32, len );
- }
-
- break;
-
- case op_expression:
-
- STRNCAT( buf, "address_expression|", len );
- STRNCATF( buf, "%s|", datatype, len );
-
- len -= format_seg( op, buf, len, native_syntax );
- len -= format_expr( &op->data.expression, buf, len,
- raw_syntax );
-
- STRNCAT( buf, "|", len );
- break;
-
- case op_offset:
-
- STRNCAT( buf, "segment_offset|", len );
- STRNCATF( buf, "%s|", datatype, len );
-
- len -= format_seg( op, buf, len, xml_syntax );
-
- STRNCATF( buf, "%08" PRIX32 "|", op->data.sdword, len );
- break;
-
- case op_unused:
- case op_unknown:
- /* return 0-truncated buffer */
- break;
- }
-
- return( strlen( buf ) );
-}
-
-int x86_format_operand( x86_op_t *op, char *buf, int len,
- enum x86_asm_format format ){
- x86_insn_t *insn;
-
- if ( ! op || ! buf || len < 1 ) {
- return(0);
- }
-
- /* insn is stored in x86_op_t since .21-pre3 */
- insn = (x86_insn_t *) op->insn;
-
- memset( buf, 0, len );
-
- switch ( format ) {
- case att_syntax:
- return format_operand_att( op, insn, buf, len );
- case xml_syntax:
- return format_operand_xml( op, insn, buf, len );
- case raw_syntax:
- return format_operand_raw( op, insn, buf, len );
- case native_syntax:
- case intel_syntax:
- default:
- return format_operand_native( op, insn, buf, len );
- }
-}
-
-#define is_imm_jmp(op) (op->type == op_absolute || \
- op->type == op_immediate || \
- op->type == op_offset)
-#define is_memory_op(op) (op->type == op_absolute || \
- op->type == op_expression || \
- op->type == op_offset)
-
-static int format_att_mnemonic( x86_insn_t *insn, char *buf, int len) {
- int size = 0;
- const char *suffix;
-
- if (! insn || ! buf || ! len )
- return(0);
-
- memset( buf, 0, len );
-
- /* do long jump/call prefix */
- if ( insn->type == insn_jmp || insn->type == insn_call ) {
- if (! is_imm_jmp( x86_operand_1st(insn) ) ||
- (x86_operand_1st(insn))->datatype != op_byte ) {
- /* far jump/call, use "l" prefix */
- STRNCAT( buf, "l", len );
- }
- STRNCAT( buf, insn->mnemonic, len );
-
- return ( strlen( buf ) );
- }
-
- /* do mnemonic */
- STRNCAT( buf, insn->mnemonic, len );
-
- /* do suffixes for memory operands */
- if (!(insn->note & insn_note_nosuffix) &&
- (insn->group == insn_arithmetic ||
- insn->group == insn_logic ||
- insn->group == insn_move ||
- insn->group == insn_stack ||
- insn->group == insn_string ||
- insn->group == insn_comparison ||
- insn->type == insn_in ||
- insn->type == insn_out
- )) {
- if ( x86_operand_count( insn, op_explicit ) > 0 &&
- is_memory_op( x86_operand_1st(insn) ) ){
- size = x86_operand_size( x86_operand_1st( insn ) );
- } else if ( x86_operand_count( insn, op_explicit ) > 1 &&
- is_memory_op( x86_operand_2nd(insn) ) ){
- size = x86_operand_size( x86_operand_2nd( insn ) );
- }
- }
-
- if ( size == 1 ) suffix = "b";
- else if ( size == 2 ) suffix = "w";
- else if ( size == 4 ) suffix = "l";
- else if ( size == 8 ) suffix = "q";
- else suffix = "";
-
- STRNCAT( buf, suffix, len );
- return ( strlen( buf ) );
-}
-
-int x86_format_mnemonic(x86_insn_t *insn, char *buf, int len,
- enum x86_asm_format format){
- char str[MAX_OP_STRING];
-
- memset( buf, 0, len );
- STRNCAT( buf, insn->prefix_string, len );
- if ( format == att_syntax ) {
- format_att_mnemonic( insn, str, sizeof str );
- STRNCAT( buf, str, len );
- } else {
- STRNCAT( buf, insn->mnemonic, len );
- }
-
- return( strlen( buf ) );
-}
-
-struct op_string { char *buf; size_t len; };
-
-static void format_op_raw( x86_op_t *op, x86_insn_t *insn, void *arg ) {
- struct op_string * opstr = (struct op_string *) arg;
-
- format_operand_raw(op, insn, opstr->buf, opstr->len);
-}
-
-static int format_insn_note(x86_insn_t *insn, char *buf, int len){
- char note[32] = {0};
- int len_orig = len, note_len = 32;
-
- if ( insn->note & insn_note_ring0 ) {
- STRNCATF( note, "%s", "Ring0 ", note_len );
- }
- if ( insn->note & insn_note_smm ) {
- STRNCATF( note, "%s", "SMM ", note_len );
- }
- if ( insn->note & insn_note_serial ) {
- STRNCATF(note, "%s", "Serialize ", note_len );
- }
- STRNCATF( buf, "%s|", note, len );
-
- return( len_orig - len );
-}
-
-static int format_raw_insn( x86_insn_t *insn, char *buf, int len ){
- struct op_string opstr = { buf, len };
- int i;
-
- /* RAW style:
- * ADDRESS|OFFSET|SIZE|BYTES|
- * PREFIX|PREFIX_STRING|GROUP|TYPE|NOTES|
- * MNEMONIC|CPU|ISA|FLAGS_SET|FLAGS_TESTED|
- * STACK_MOD|STACK_MOD_VAL
- * [|OP_TYPE|OP_DATATYPE|OP_ACCESS|OP_FLAGS|OP]*
- *
- * Register values are encoded as:
- * NAME:TYPE:SIZE
- *
- * Effective addresses are encoded as:
- * disp(base_reg,index_reg,scale)
- */
- STRNCATF( buf, "0x%08" PRIX32 "|", insn->addr , len );
- STRNCATF( buf, "0x%08" PRIX32 "|", insn->offset, len );
- STRNCATF( buf, "%d|" , insn->size , len );
-
- /* print bytes */
- for ( i = 0; i < insn->size; i++ ) {
- STRNCATF( buf, "%02X ", insn->bytes[i], len );
- }
- STRNCAT( buf, "|", len );
-
- len -= format_insn_prefix_str( insn->prefix, buf, len );
- STRNCATF( buf, "|%s|", insn->prefix_string , len );
- STRNCATF( buf, "%s|", get_insn_group_str( insn->group ), len );
- STRNCATF( buf, "%s|", get_insn_type_str( insn->type ) , len );
- STRNCATF( buf, "%s|", insn->mnemonic , len );
- STRNCATF( buf, "%s|", get_insn_cpu_str( insn->cpu ) , len );
- STRNCATF( buf, "%s|", get_insn_isa_str( insn->isa ) , len );
-
- /* insn note */
- len -= format_insn_note( insn, buf, len );
-
- len -= format_insn_eflags_str( insn->flags_set, buf, len );
- STRNCAT( buf, "|", len );
- len -= format_insn_eflags_str( insn->flags_tested, buf, len );
- STRNCAT( buf, "|", len );
- STRNCATF( buf, "%d|", insn->stack_mod, len );
- STRNCATF( buf, "%" PRId32 "|", insn->stack_mod_val, len );
-
- opstr.len = len;
- x86_operand_foreach( insn, format_op_raw, &opstr, op_any );
-
- return( strlen (buf) );
-}
-
-static int format_xml_insn( x86_insn_t *insn, char *buf, int len ) {
- char str[MAX_OP_XML_STRING];
- int i;
-
- STRNCAT( buf, "<x86_insn>\n", len );
-
- STRNCATF( buf, "\t<address rva=\"0x%08" PRIX32 "\" ", insn->addr, len );
- STRNCATF( buf, "offset=\"0x%08" PRIX32 "\" ", insn->offset, len );
- STRNCATF( buf, "size=%d bytes=\"", insn->size, len );
-
- for ( i = 0; i < insn->size; i++ ) {
- STRNCATF( buf, "%02X ", insn->bytes[i], len );
- }
- STRNCAT( buf, "\"/>\n", len );
-
- STRNCAT( buf, "\t<prefix type=\"", len );
- len -= format_insn_prefix_str( insn->prefix, buf, len );
- STRNCATF( buf, "\" string=\"%s\"/>\n", insn->prefix_string, len );
-
- STRNCATF( buf, "\t<mnemonic group=\"%s\" ",
- get_insn_group_str (insn->group), len );
- STRNCATF( buf, "type=\"%s\" ", get_insn_type_str (insn->type), len );
- STRNCATF( buf, "string=\"%s\"/>\n", insn->mnemonic, len );
-
- STRNCAT( buf, "\t<flags type=set>\n", len );
- STRNCAT( buf, "\t\t<flag name=\"", len );
- len -= format_insn_eflags_str( insn->flags_set, buf, len );
- STRNCAT( buf, "\"/>\n\t</flags>\n", len );
-
-
- STRNCAT( buf, "\t<flags type=tested>\n", len );
- STRNCAT( buf, "\t\t<flag name=\"", len );
- len -= format_insn_eflags_str( insn->flags_tested, buf, len );
- STRNCAT( buf, "\"/>\n\t</flags>\n", len );
-
- if ( x86_operand_1st( insn ) ) {
- x86_format_operand( x86_operand_1st(insn), str,
- sizeof str, xml_syntax);
- STRNCAT( buf, "\t<operand name=dest>\n", len );
- STRNCAT( buf, str, len );
- STRNCAT( buf, "\t</operand>\n", len );
- }
-
- if ( x86_operand_2nd( insn ) ) {
- x86_format_operand( x86_operand_2nd( insn ), str,
- sizeof str, xml_syntax);
- STRNCAT( buf, "\t<operand name=src>\n", len );
- STRNCAT( buf, str, len );
- STRNCAT( buf, "\t</operand>\n", len );
- }
-
- if ( x86_operand_3rd( insn ) ) {
- x86_format_operand( x86_operand_3rd(insn), str,
- sizeof str, xml_syntax);
- STRNCAT( buf, "\t<operand name=imm>\n", len );
- STRNCAT( buf, str, len );
- STRNCAT( buf, "\t</operand>\n", len );
- }
-
- STRNCAT( buf, "</x86_insn>\n", len );
-
- return strlen (buf);
-}
-
-int x86_format_header( char *buf, int len, enum x86_asm_format format ) {
- switch (format) {
- case att_syntax:
- snprintf( buf, len, "MNEMONIC\tSRC, DEST, IMM" );
- break;
- case intel_syntax:
- snprintf( buf, len, "MNEMONIC\tDEST, SRC, IMM" );
- break;
- case native_syntax:
- snprintf( buf, len, "ADDRESS\tBYTES\tMNEMONIC\t"
- "DEST\tSRC\tIMM" );
- break;
- case raw_syntax:
- snprintf( buf, len, "ADDRESS|OFFSET|SIZE|BYTES|"
- "PREFIX|PREFIX_STRING|GROUP|TYPE|NOTES|"
- "MNEMONIC|CPU|ISA|FLAGS_SET|FLAGS_TESTED|"
- "STACK_MOD|STACK_MOD_VAL"
- "[|OP_TYPE|OP_DATATYPE|OP_ACCESS|OP_FLAGS|OP]*"
- );
- break;
- case xml_syntax:
- snprintf( buf, len,
- "<x86_insn>"
- "<address rva= offset= size= bytes=/>"
- "<prefix type= string=/>"
- "<mnemonic group= type= string= "
- "cpu= isa= note= />"
- "<flags type=set>"
- "<flag name=>"
- "</flags>"
- "<stack_mod val= >"
- "<flags type=tested>"
- "<flag name=>"
- "</flags>"
- "<operand name=>"
- "<register name= type= size=/>"
- "<immediate type= value=/>"
- "<relative_offset value=/>"
- "<absolute_address value=>"
- "<segment value=/>"
- "</absolute_address>"
- "<address_expression>"
- "<segment value=/>"
- "<base>"
- "<register name= type= size=/>"
- "</base>"
- "<index>"
- "<register name= type= size=/>"
- "</index>"
- "<scale>"
- "<immediate value=/>"
- "</scale>"
- "<displacement>"
- "<immediate value=/>"
- "<address value=/>"
- "</displacement>"
- "</address_expression>"
- "<segment_offset>"
- "<address value=/>"
- "</segment_offset>"
- "</operand>"
- "</x86_insn>"
- );
- break;
- case unknown_syntax:
- if ( len ) {
- buf[0] = '\0';
- }
- break;
- }
-
- return( strlen(buf) );
-}
-
-int x86_format_insn( x86_insn_t *insn, char *buf, int len,
- enum x86_asm_format format ){
- char str[MAX_OP_STRING];
- x86_op_t *src, *dst;
- int i;
-
- memset(buf, 0, len);
- if ( format == intel_syntax ) {
- /* INTEL STYLE: mnemonic dest, src, imm */
- STRNCAT( buf, insn->prefix_string, len );
- STRNCAT( buf, insn->mnemonic, len );
- STRNCAT( buf, "\t", len );
-
- /* dest */
- if ( (dst = x86_operand_1st( insn )) && !(dst->flags & op_implied) ) {
- x86_format_operand( dst, str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- }
-
- /* src */
- if ( (src = x86_operand_2nd( insn )) ) {
- if ( !(dst->flags & op_implied) ) {
- STRNCAT( buf, ", ", len );
- }
- x86_format_operand( src, str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- }
-
- /* imm */
- if ( x86_operand_3rd( insn )) {
- STRNCAT( buf, ", ", len );
- x86_format_operand( x86_operand_3rd( insn ),
- str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- }
-
- } else if ( format == att_syntax ) {
- /* ATT STYLE: mnemonic src, dest, imm */
- STRNCAT( buf, insn->prefix_string, len );
- format_att_mnemonic(insn, str, MAX_OP_STRING);
- STRNCATF( buf, "%s\t", str, len);
-
-
- /* not sure which is correct? sometimes GNU as requires
- * an imm as the first operand, sometimes as the third... */
- /* imm */
- if ( x86_operand_3rd( insn ) ) {
- x86_format_operand(x86_operand_3rd( insn ),
- str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- /* there is always 'dest' operand if there is 'src' */
- STRNCAT( buf, ", ", len );
- }
-
- if ( (insn->note & insn_note_nonswap ) == 0 ) {
- /* regular AT&T style swap */
- src = x86_operand_2nd( insn );
- dst = x86_operand_1st( insn );
- }
- else {
- /* special-case instructions */
- src = x86_operand_1st( insn );
- dst = x86_operand_2nd( insn );
- }
-
- /* src */
- if ( src ) {
- x86_format_operand(src, str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- /* there is always 'dest' operand if there is 'src' */
- if ( dst && !(dst->flags & op_implied) ) {
- STRNCAT( buf, ", ", len );
- }
- }
-
- /* dest */
- if ( dst && !(dst->flags & op_implied) ) {
- x86_format_operand( dst, str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- }
-
-
- } else if ( format == raw_syntax ) {
- format_raw_insn( insn, buf, len );
- } else if ( format == xml_syntax ) {
- format_xml_insn( insn, buf, len );
- } else { /* default to native */
- /* NATIVE style: RVA\tBYTES\tMNEMONIC\tOPERANDS */
- /* print address */
- STRNCATF( buf, "%08" PRIX32 "\t", insn->addr, len );
-
- /* print bytes */
- for ( i = 0; i < insn->size; i++ ) {
- STRNCATF( buf, "%02X ", insn->bytes[i], len );
- }
-
- STRNCAT( buf, "\t", len );
-
- /* print mnemonic */
- STRNCAT( buf, insn->prefix_string, len );
- STRNCAT( buf, insn->mnemonic, len );
- STRNCAT( buf, "\t", len );
-
- /* print operands */
- /* dest */
- if ( x86_operand_1st( insn ) ) {
- x86_format_operand( x86_operand_1st( insn ),
- str, MAX_OP_STRING, format);
- STRNCATF( buf, "%s\t", str, len );
- }
-
- /* src */
- if ( x86_operand_2nd( insn ) ) {
- x86_format_operand(x86_operand_2nd( insn ),
- str, MAX_OP_STRING, format);
- STRNCATF( buf, "%s\t", str, len );
- }
-
- /* imm */
- if ( x86_operand_3rd( insn )) {
- x86_format_operand( x86_operand_3rd( insn ),
- str, MAX_OP_STRING, format);
- STRNCAT( buf, str, len );
- }
- }
-
- return( strlen( buf ) );
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.c
deleted file mode 100644
index cd59bfc9ab..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.c
+++ /dev/null
@@ -1,70 +0,0 @@
-#include "qword.h"
-#include "x86_imm.h"
-
-#include <stdio.h>
-
-unsigned int x86_imm_signsized( unsigned char * buf, size_t buf_len,
- void *dest, unsigned int size ) {
- signed char *cp = (signed char *) dest;
- signed short *sp = (signed short *) dest;
- int32_t *lp = (int32_t *) dest;
- qword_t *qp = (qword_t *) dest;
-
- if ( size > buf_len ) {
- return 0;
- }
-
- /* Copy 'size' bytes from *buf to *op
- * return number of bytes copied */
- switch (size) {
- case 1: /* BYTE */
- *cp = *((signed char *) buf);
- break;
- case 2: /* WORD */
- *sp = *((signed short *) buf);
- break;
- case 6:
- case 8: /* QWORD */
- *qp = *((qword_t *) buf);
- break;
- case 4: /* DWORD */
- default:
- *lp = *((int32_t *) buf);
- break;
- }
- return (size);
-}
-
-unsigned int x86_imm_sized( unsigned char * buf, size_t buf_len, void *dest,
- unsigned int size ) {
- unsigned char *cp = (unsigned char *) dest;
- unsigned short *sp = (unsigned short *) dest;
- uint32_t *lp = (uint32_t *) dest;
- qword_t *qp = (qword_t *) dest;
-
- if ( size > buf_len ) {
- return 0;
- }
-
- /* Copy 'size' bytes from *buf to *op
- * return number of bytes copied */
- switch (size) {
- case 1: /* BYTE */
- *cp = *((unsigned char *) buf);
- break;
- case 2: /* WORD */
- *sp = *((unsigned short *) buf);
- break;
- case 6:
- case 8: /* QWORD */
- *qp = *((qword_t *) buf);
- break;
- case 4: /* DWORD */
- default:
- *lp = *((uint32_t *) buf);
- break;
- }
-
- return (size);
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.h
deleted file mode 100644
index fa35ff2de4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_imm.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#ifndef x86_IMM_H
-#define x86_IMM_H
-
-#include "./qword.h"
-#include <sys/types.h>
-
-#ifdef WIN32
-#include <windows.h>
-#endif
-
-/* these are in the global x86 namespace but are not a part of the
- * official API */
-unsigned int x86_imm_sized( unsigned char *buf, size_t buf_len, void *dest,
- unsigned int size );
-
-unsigned int x86_imm_signsized( unsigned char *buf, size_t buf_len, void *dest,
- unsigned int size );
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_insn.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_insn.c
deleted file mode 100644
index 5649b89fb8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_insn.c
+++ /dev/null
@@ -1,182 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libdis.h"
-
-#ifdef _MSC_VER
- #define snprintf _snprintf
- #define inline __inline
-#endif
-
-int x86_insn_is_valid( x86_insn_t *insn ) {
- if ( insn && insn->type != insn_invalid && insn->size > 0 ) {
- return 1;
- }
-
- return 0;
-}
-
-uint32_t x86_get_address( x86_insn_t *insn ) {
- x86_oplist_t *op_lst;
- if (! insn || ! insn->operands ) {
- return 0;
- }
-
- for (op_lst = insn->operands; op_lst; op_lst = op_lst->next ) {
- if ( op_lst->op.type == op_offset ) {
- return op_lst->op.data.offset;
- } else if ( op_lst->op.type == op_absolute ) {
- if ( op_lst->op.datatype == op_descr16 ) {
- return (uint32_t)
- op_lst->op.data.absolute.offset.off16;
- }
- return op_lst->op.data.absolute.offset.off32;
- }
- }
-
- return 0;
-}
-
-int32_t x86_get_rel_offset( x86_insn_t *insn ) {
- x86_oplist_t *op_lst;
- if (! insn || ! insn->operands ) {
- return 0;
- }
-
- for (op_lst = insn->operands; op_lst; op_lst = op_lst->next ) {
- if ( op_lst->op.type == op_relative_near ) {
- return (int32_t) op_lst->op.data.relative_near;
- } else if ( op_lst->op.type == op_relative_far ) {
- return op_lst->op.data.relative_far;
- }
- }
-
- return 0;
-}
-
-x86_op_t * x86_get_branch_target( x86_insn_t *insn ) {
- x86_oplist_t *op_lst;
- if (! insn || ! insn->operands ) {
- return NULL;
- }
-
- for (op_lst = insn->operands; op_lst; op_lst = op_lst->next ) {
- if ( op_lst->op.access & op_execute ) {
- return &(op_lst->op);
- }
- }
-
- return NULL;
-}
-x86_op_t * x86_get_imm( x86_insn_t *insn ) {
- x86_oplist_t *op_lst;
- if (! insn || ! insn->operands ) {
- return NULL;
- }
-
- for (op_lst = insn->operands; op_lst; op_lst = op_lst->next ) {
- if ( op_lst->op.type == op_immediate ) {
- return &(op_lst->op);
- }
- }
-
- return NULL;
-}
-
-#define IS_PROPER_IMM( x ) \
- x->op.type == op_immediate && ! (x->op.flags & op_hardcode)
-
-
-/* if there is an immediate value in the instruction, return a pointer to
- * it */
-unsigned char * x86_get_raw_imm( x86_insn_t *insn ) {
- int size, offset;
- x86_op_t *op = NULL;
-
- if (! insn || ! insn->operands ) {
- return(NULL);
- }
-
- /* a bit inelegant, but oh well... */
- if ( IS_PROPER_IMM( insn->operands ) ) {
- op = &insn->operands->op;
- } else if ( insn->operands->next ) {
- if ( IS_PROPER_IMM( insn->operands->next ) ) {
- op = &insn->operands->next->op;
- } else if ( insn->operands->next->next &&
- IS_PROPER_IMM( insn->operands->next->next ) ) {
- op = &insn->operands->next->next->op;
- }
- }
-
- if (! op ) {
- return( NULL );
- }
-
- /* immediate data is at the end of the insn */
- size = x86_operand_size( op );
- offset = insn->size - size;
- return( &insn->bytes[offset] );
-}
-
-
-unsigned int x86_operand_size( x86_op_t *op ) {
- switch (op->datatype ) {
- case op_byte: return 1;
- case op_word: return 2;
- case op_dword: return 4;
- case op_qword: return 8;
- case op_dqword: return 16;
- case op_sreal: return 4;
- case op_dreal: return 8;
- case op_extreal: return 10;
- case op_bcd: return 10;
- case op_ssimd: return 16;
- case op_dsimd: return 16;
- case op_sssimd: return 4;
- case op_sdsimd: return 8;
- case op_descr32: return 6;
- case op_descr16: return 4;
- case op_pdescr32: return 6;
- case op_pdescr16: return 6;
- case op_bounds16: return 4;
- case op_bounds32: return 8;
- case op_fpuenv16: return 14;
- case op_fpuenv32: return 28;
- case op_fpustate16: return 94;
- case op_fpustate32: return 108;
- case op_fpregset: return 512;
- case op_fpreg: return 10;
- case op_none: return 0;
- }
- return(4); /* default size */
-}
-
-void x86_set_insn_addr( x86_insn_t *insn, uint32_t addr ) {
- if ( insn ) insn->addr = addr;
-}
-
-void x86_set_insn_offset( x86_insn_t *insn, unsigned int offset ){
- if ( insn ) insn->offset = offset;
-}
-
-void x86_set_insn_function( x86_insn_t *insn, void * func ){
- if ( insn ) insn->function = func;
-}
-
-void x86_set_insn_block( x86_insn_t *insn, void * block ){
- if ( insn ) insn->block = block;
-}
-
-void x86_tag_insn( x86_insn_t *insn ){
- if ( insn ) insn->tag = 1;
-}
-
-void x86_untag_insn( x86_insn_t *insn ){
- if ( insn ) insn->tag = 0;
-}
-
-int x86_insn_is_tagged( x86_insn_t *insn ){
- return insn->tag;
-}
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_misc.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_misc.c
deleted file mode 100644
index 3d2dd0ae8b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_misc.c
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "libdis.h"
-#include "ia32_insn.h"
-#include "ia32_reg.h" /* for ia32_reg wrapper */
-#include "ia32_settings.h"
-extern ia32_settings_t ia32_settings;
-
-#ifdef _MSC_VER
- #define snprintf _snprintf
- #define inline __inline
-#endif
-
-
-/* =========================================================== INIT/TERM */
-static DISASM_REPORTER __x86_reporter_func = NULL;
-static void * __x86_reporter_arg = NULL;
-
-int x86_init( enum x86_options options, DISASM_REPORTER reporter, void * arg )
-{
- ia32_settings.options = options;
- __x86_reporter_func = reporter;
- __x86_reporter_arg = arg;
-
- return 1;
-}
-
-void x86_set_reporter( DISASM_REPORTER reporter, void * arg ) {
- __x86_reporter_func = reporter;
- __x86_reporter_arg = arg;
-}
-
-void x86_set_options( enum x86_options options ){
- ia32_settings.options = options;
-}
-
-enum x86_options x86_get_options( void ) {
- return ia32_settings.options;
-}
-
-int x86_cleanup( void )
-{
- return 1;
-}
-
-/* =========================================================== ERRORS */
-void x86_report_error( enum x86_report_codes code, void *data ) {
- if ( __x86_reporter_func ) {
- (*__x86_reporter_func)(code, data, __x86_reporter_arg);
- }
-}
-
-
-/* =========================================================== MISC */
-unsigned int x86_endian(void) { return ia32_settings.endian; }
-unsigned int x86_addr_size(void) { return ia32_settings.sz_addr; }
-unsigned int x86_op_size(void) { return ia32_settings.sz_oper; }
-unsigned int x86_word_size(void) { return ia32_settings.sz_word; }
-unsigned int x86_max_insn_size(void) { return ia32_settings.max_insn; }
-unsigned int x86_sp_reg(void) { return ia32_settings.id_sp_reg; }
-unsigned int x86_fp_reg(void) { return ia32_settings.id_fp_reg; }
-unsigned int x86_ip_reg(void) { return ia32_settings.id_ip_reg; }
-unsigned int x86_flag_reg(void) { return ia32_settings.id_flag_reg; }
-
-/* wrapper function to hide the IA32 register fn */
-void x86_reg_from_id( unsigned int id, x86_reg_t * reg ) {
- ia32_handle_register( reg, id );
- return;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.c b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.c
deleted file mode 100644
index 95409e0698..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.c
+++ /dev/null
@@ -1,191 +0,0 @@
-#include <stdlib.h>
-#include "libdis.h"
-
-
-static void x86_oplist_append( x86_insn_t *insn, x86_oplist_t *op ) {
- x86_oplist_t *list;
-
- if (! insn ) {
- return;
- }
-
- list = insn->operands;
- if (! list ) {
- insn->operand_count = 1;
- /* Note that we have no way of knowing if this is an
- * exlicit operand or not, since the caller fills
- * the x86_op_t after we return. We increase the
- * explicit count automatically, and ia32_insn_implicit_ops
- * decrements it */
- insn->explicit_count = 1;
- insn->operands = op;
- return;
- }
-
- /* get to end of list */
- for ( ; list->next; list = list->next )
- ;
-
- insn->operand_count = insn->operand_count + 1;
- insn->explicit_count = insn->explicit_count + 1;
- list->next = op;
-
- return;
-}
-
-x86_op_t * x86_operand_new( x86_insn_t *insn ) {
- x86_oplist_t *op;
-
- if (! insn ) {
- return(NULL);
- }
- op = calloc( sizeof(x86_oplist_t), 1 );
- op->op.insn = insn;
- x86_oplist_append( insn, op );
- return( &(op->op) );
-}
-
-void x86_oplist_free( x86_insn_t *insn ) {
- x86_oplist_t *op, *list;
-
- if (! insn ) {
- return;
- }
-
- for ( list = insn->operands; list; ) {
- op = list;
- list = list->next;
- free(op);
- }
-
- insn->operands = NULL;
- insn->operand_count = 0;
- insn->explicit_count = 0;
-
- return;
-}
-
-/* ================================================== LIBDISASM API */
-/* these could probably just be #defines, but that means exposing the
- enum... yet one more confusing thing in the API */
-int x86_operand_foreach( x86_insn_t *insn, x86_operand_fn func, void *arg,
- enum x86_op_foreach_type type ){
- x86_oplist_t *list;
- char explicit = 1, implicit = 1;
-
- if (! insn || ! func ) {
- return 0;
- }
-
- /* note: explicit and implicit can be ORed together to
- * allow an "all" limited by access type, even though the
- * user is stupid to do this since it is default behavior :) */
- if ( (type & op_explicit) && ! (type & op_implicit) ) {
- implicit = 0;
- }
- if ( (type & op_implicit) && ! (type & op_explicit) ) {
- explicit = 0;
- }
-
- type = type & 0x0F; /* mask out explicit/implicit operands */
-
- for ( list = insn->operands; list; list = list->next ) {
- if (! implicit && (list->op.flags & op_implied) ) {
- /* operand is implicit */
- continue;
- }
-
- if (! explicit && ! (list->op.flags & op_implied) ) {
- /* operand is not implicit */
- continue;
- }
-
- switch ( type ) {
- case op_any:
- break;
- case op_dest:
- if (! (list->op.access & op_write) ) {
- continue;
- }
- break;
- case op_src:
- if (! (list->op.access & op_read) ) {
- continue;
- }
- break;
- case op_ro:
- if (! (list->op.access & op_read) ||
- (list->op.access & op_write ) ) {
- continue;
- }
- break;
- case op_wo:
- if (! (list->op.access & op_write) ||
- (list->op.access & op_read ) ) {
- continue;
- }
- break;
- case op_xo:
- if (! (list->op.access & op_execute) ) {
- continue;
- }
- break;
- case op_rw:
- if (! (list->op.access & op_write) ||
- ! (list->op.access & op_read ) ) {
- continue;
- }
- break;
- case op_implicit: case op_explicit: /* make gcc happy */
- break;
- }
- /* any non-continue ends up here: invoke the callback */
- (*func)( &list->op, insn, arg );
- }
-
- return 1;
-}
-
-static void count_operand( x86_op_t *op, x86_insn_t *insn, void *arg ) {
- size_t * count = (size_t *) arg;
- *count = *count + 1;
-}
-
-size_t x86_operand_count( x86_insn_t *insn, enum x86_op_foreach_type type ) {
- size_t count = 0;
-
- /* save us a list traversal for common counts... */
- if ( type == op_any ) {
- return insn->operand_count;
- } else if ( type == op_explicit ) {
- return insn->explicit_count;
- }
-
- x86_operand_foreach( insn, count_operand, &count, type );
- return count;
-}
-
-/* accessor functions */
-x86_op_t * x86_operand_1st( x86_insn_t *insn ) {
- if (! insn->explicit_count ) {
- return NULL;
- }
-
- return &(insn->operands->op);
-}
-
-x86_op_t * x86_operand_2nd( x86_insn_t *insn ) {
- if ( insn->explicit_count < 2 ) {
- return NULL;
- }
-
- return &(insn->operands->next->op);
-}
-
-x86_op_t * x86_operand_3rd( x86_insn_t *insn ) {
- if ( insn->explicit_count < 3 ) {
- return NULL;
- }
-
- return &(insn->operands->next->next->op);
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.h b/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.h
deleted file mode 100644
index 53668658ec..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/libdisasm/x86_operand_list.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef X86_OPERAND_LIST_H
-#define X86_OPERAND_LIST_H
-#include "libdis.h"
-
-
-x86_op_t * x86_operand_new( x86_insn_t *insn );
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags.h b/toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags.h
deleted file mode 100644
index 08a3b637e1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags.h
+++ /dev/null
@@ -1,533 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ---
-// Author: Ray Sidney
-// Revamped and reorganized by Craig Silverstein
-//
-// This is the file that should be included by any file which declares
-// or defines a command line flag or wants to parse command line flags
-// or print a program usage message (which will include information about
-// flags). Executive summary, in the form of an example foo.cc file:
-//
-// #include "foo.h" // foo.h has a line "DECLARE_int32(start);"
-//
-// DEFINE_int32(end, 1000, "The last record to read");
-// DECLARE_bool(verbose); // some other file has a DEFINE_bool(verbose, ...)
-//
-// void MyFunc() {
-// if (FLAGS_verbose) printf("Records %d-%d\n", FLAGS_start, FLAGS_end);
-// }
-//
-// Then, at the command-line:
-// ./foo --noverbose --start=5 --end=100
-//
-// For more details, see
-// doc/gflags.html
-//
-// --- A note about thread-safety:
-//
-// We describe many functions in this routine as being thread-hostile,
-// thread-compatible, or thread-safe. Here are the meanings we use:
-//
-// thread-safe: it is safe for multiple threads to call this routine
-// (or, when referring to a class, methods of this class)
-// concurrently.
-// thread-hostile: it is not safe for multiple threads to call this
-// routine (or methods of this class) concurrently. In gflags,
-// most thread-hostile routines are intended to be called early in,
-// or even before, main() -- that is, before threads are spawned.
-// thread-compatible: it is safe for multiple threads to read from
-// this variable (when applied to variables), or to call const
-// methods of this class (when applied to classes), as long as no
-// other thread is writing to the variable or calling non-const
-// methods of this class.
-
-#ifndef GOOGLE_GFLAGS_H_
-#define GOOGLE_GFLAGS_H_
-
-#include <string>
-#include <vector>
-
-// We care a lot about number of bits things take up. Unfortunately,
-// systems define their bit-specific ints in a lot of different ways.
-// We use our own way, and have a typedef to get there.
-// Note: these commands below may look like "#if 1" or "#if 0", but
-// that's because they were constructed that way at ./configure time.
-// Look at gflags.h.in to see how they're calculated (based on your config).
-#if 1
-#include <stdint.h> // the normal place uint16_t is defined
-#endif
-#if 1
-#include <sys/types.h> // the normal place u_int16_t is defined
-#endif
-#if 1
-#include <inttypes.h> // a third place for uint16_t or u_int16_t
-#endif
-
-namespace google {
-
-#if 1 // the C99 format
-typedef int32_t int32;
-typedef uint32_t uint32;
-typedef int64_t int64;
-typedef uint64_t uint64;
-#elif 1 // the BSD format
-typedef int32_t int32;
-typedef u_int32_t uint32;
-typedef int64_t int64;
-typedef u_int64_t uint64;
-#elif 0 // the windows (vc7) format
-typedef __int32 int32;
-typedef unsigned __int32 uint32;
-typedef __int64 int64;
-typedef unsigned __int64 uint64;
-#else
-#error Do not know how to define a 32-bit integer quantity on your system
-#endif
-
-// --------------------------------------------------------------------
-// To actually define a flag in a file, use DEFINE_bool,
-// DEFINE_string, etc. at the bottom of this file. You may also find
-// it useful to register a validator with the flag. This ensures that
-// when the flag is parsed from the commandline, or is later set via
-// SetCommandLineOption, we call the validation function.
-//
-// The validation function should return true if the flag value is valid, and
-// false otherwise. If the function returns false for the new setting of the
-// flag, the flag will retain its current value. If it returns false for the
-// default value, InitGoogle will die.
-//
-// This function is safe to call at global construct time (as in the
-// example below).
-//
-// Example use:
-// static bool ValidatePort(const char* flagname, int32 value) {
-// if (value > 0 && value < 32768) // value is ok
-// return true;
-// printf("Invalid value for --%s: %d\n", flagname, (int)value);
-// return false;
-// }
-// DEFINE_int32(port, 0, "What port to listen on");
-// static bool dummy = RegisterFlagValidator(&FLAGS_port, &ValidatePort);
-
-// Returns true if successfully registered, false if not (because the
-// first argument doesn't point to a command-line flag, or because a
-// validator is already registered for this flag).
-bool RegisterFlagValidator(const bool* flag,
- bool (*validate_fn)(const char*, bool));
-bool RegisterFlagValidator(const int32* flag,
- bool (*validate_fn)(const char*, int32));
-bool RegisterFlagValidator(const int64* flag,
- bool (*validate_fn)(const char*, int64));
-bool RegisterFlagValidator(const uint64* flag,
- bool (*validate_fn)(const char*, uint64));
-bool RegisterFlagValidator(const double* flag,
- bool (*validate_fn)(const char*, double));
-bool RegisterFlagValidator(const std::string* flag,
- bool (*validate_fn)(const char*, const std::string&));
-
-
-// --------------------------------------------------------------------
-// These methods are the best way to get access to info about the
-// list of commandline flags. Note that these routines are pretty slow.
-// GetAllFlags: mostly-complete info about the list, sorted by file.
-// ShowUsageWithFlags: pretty-prints the list to stdout (what --help does)
-// ShowUsageWithFlagsRestrict: limit to filenames with restrict as a substr
-//
-// In addition to accessing flags, you can also access argv[0] (the program
-// name) and argv (the entire commandline), which we sock away a copy of.
-// These variables are static, so you should only set them once.
-
-struct CommandLineFlagInfo {
- std::string name; // the name of the flag
- std::string type; // the type of the flag: int32, etc
- std::string description; // the "help text" associated with the flag
- std::string current_value; // the current value, as a string
- std::string default_value; // the default value, as a string
- std::string filename; // 'cleaned' version of filename holding the flag
- bool has_validator_fn; // true if RegisterFlagValidator called on flag
- bool is_default; // true if the flag has default value
-};
-
-extern void GetAllFlags(std::vector<CommandLineFlagInfo>* OUTPUT);
-// These two are actually defined in commandlineflags_reporting.cc.
-extern void ShowUsageWithFlags(const char *argv0); // what --help does
-extern void ShowUsageWithFlagsRestrict(const char *argv0, const char *restrict);
-
-// Create a descriptive string for a flag.
-// Goes to some trouble to make pretty line breaks.
-extern std::string DescribeOneFlag(const CommandLineFlagInfo& flag);
-
-// Thread-hostile; meant to be called before any threads are spawned.
-extern void SetArgv(int argc, const char** argv);
-// The following functions are thread-safe as long as SetArgv() is
-// only called before any threads start.
-extern const std::vector<std::string>& GetArgvs(); // all of argv as a vector
-extern const char* GetArgv(); // all of argv as a string
-extern const char* GetArgv0(); // only argv0
-extern uint32 GetArgvSum(); // simple checksum of argv
-extern const char* ProgramInvocationName(); // argv0, or "UNKNOWN" if not set
-extern const char* ProgramInvocationShortName(); // basename(argv0)
-// ProgramUsage() is thread-safe as long as SetUsageMessage() is only
-// called before any threads start.
-extern const char* ProgramUsage(); // string set by SetUsageMessage()
-
-
-// --------------------------------------------------------------------
-// Normally you access commandline flags by just saying "if (FLAGS_foo)"
-// or whatever, and set them by calling "FLAGS_foo = bar" (or, more
-// commonly, via the DEFINE_foo macro). But if you need a bit more
-// control, we have programmatic ways to get/set the flags as well.
-// These programmatic ways to access flags are thread-safe, but direct
-// access is only thread-compatible.
-
-// Return true iff the flagname was found.
-// OUTPUT is set to the flag's value, or unchanged if we return false.
-extern bool GetCommandLineOption(const char* name, std::string* OUTPUT);
-
-// Return true iff the flagname was found. OUTPUT is set to the flag's
-// CommandLineFlagInfo or unchanged if we return false.
-extern bool GetCommandLineFlagInfo(const char* name,
- CommandLineFlagInfo* OUTPUT);
-
-// Return the CommandLineFlagInfo of the flagname. exit() if name not found.
-// Example usage, to check if a flag's value is currently the default value:
-// if (GetCommandLineFlagInfoOrDie("foo").is_default) ...
-extern CommandLineFlagInfo GetCommandLineFlagInfoOrDie(const char* name);
-
-enum FlagSettingMode {
- // update the flag's value (can call this multiple times).
- SET_FLAGS_VALUE,
- // update the flag's value, but *only if* it has not yet been updated
- // with SET_FLAGS_VALUE, SET_FLAG_IF_DEFAULT, or "FLAGS_xxx = nondef".
- SET_FLAG_IF_DEFAULT,
- // set the flag's default value to this. If the flag has not yet updated
- // yet (via SET_FLAGS_VALUE, SET_FLAG_IF_DEFAULT, or "FLAGS_xxx = nondef")
- // change the flag's current value to the new default value as well.
- SET_FLAGS_DEFAULT
-};
-
-// Set a particular flag ("command line option"). Returns a string
-// describing the new value that the option has been set to. The
-// return value API is not well-specified, so basically just depend on
-// it to be empty if the setting failed for some reason -- the name is
-// not a valid flag name, or the value is not a valid value -- and
-// non-empty else.
-
-// SetCommandLineOption uses set_mode == SET_FLAGS_VALUE (the common case)
-extern std::string SetCommandLineOption(const char* name, const char* value);
-extern std::string SetCommandLineOptionWithMode(const char* name, const char* value,
- FlagSettingMode set_mode);
-
-
-// --------------------------------------------------------------------
-// Saves the states (value, default value, whether the user has set
-// the flag, registered validators, etc) of all flags, and restores
-// them when the FlagSaver is destroyed. This is very useful in
-// tests, say, when you want to let your tests change the flags, but
-// make sure that they get reverted to the original states when your
-// test is complete.
-//
-// Example usage:
-// void TestFoo() {
-// FlagSaver s1;
-// FLAG_foo = false;
-// FLAG_bar = "some value";
-//
-// // test happens here. You can return at any time
-// // without worrying about restoring the FLAG values.
-// }
-//
-// Note: This class is marked with __attribute__((unused)) because all the
-// work is done in the constructor and destructor, so in the standard
-// usage example above, the compiler would complain that it's an
-// unused variable.
-//
-// This class is thread-safe.
-
-class FlagSaver {
- public:
- FlagSaver();
- ~FlagSaver();
-
- private:
- class FlagSaverImpl* impl_; // we use pimpl here to keep API steady
-
- FlagSaver(const FlagSaver&); // no copying!
- void operator=(const FlagSaver&);
-} __attribute__ ((unused));
-
-// --------------------------------------------------------------------
-// Some deprecated or hopefully-soon-to-be-deprecated functions.
-
-// This is often used for logging. TODO(csilvers): figure out a better way
-extern std::string CommandlineFlagsIntoString();
-// Usually where this is used, a FlagSaver should be used instead.
-extern bool ReadFlagsFromString(const std::string& flagfilecontents,
- const char* prog_name,
- bool errors_are_fatal); // uses SET_FLAGS_VALUE
-
-// These let you manually implement --flagfile functionality.
-// DEPRECATED.
-extern bool AppendFlagsIntoFile(const std::string& filename, const char* prog_name);
-extern bool SaveCommandFlags(); // actually defined in google.cc !
-extern bool ReadFromFlagsFile(const std::string& filename, const char* prog_name,
- bool errors_are_fatal); // uses SET_FLAGS_VALUE
-
-
-// --------------------------------------------------------------------
-// Useful routines for initializing flags from the environment.
-// In each case, if 'varname' does not exist in the environment
-// return defval. If 'varname' does exist but is not valid
-// (e.g., not a number for an int32 flag), abort with an error.
-// Otherwise, return the value. NOTE: for booleans, for true use
-// 't' or 'T' or 'true' or '1', for false 'f' or 'F' or 'false' or '0'.
-
-extern bool BoolFromEnv(const char *varname, bool defval);
-extern int32 Int32FromEnv(const char *varname, int32 defval);
-extern int64 Int64FromEnv(const char *varname, int64 defval);
-extern uint64 Uint64FromEnv(const char *varname, uint64 defval);
-extern double DoubleFromEnv(const char *varname, double defval);
-extern const char *StringFromEnv(const char *varname, const char *defval);
-
-
-// --------------------------------------------------------------------
-// The next two functions parse commandlineflags from main():
-
-// Set the "usage" message for this program. For example:
-// string usage("This program does nothing. Sample usage:\n");
-// usage += argv[0] + " <uselessarg1> <uselessarg2>";
-// SetUsageMessage(usage);
-// Do not include commandline flags in the usage: we do that for you!
-// Thread-hostile; meant to be called before any threads are spawned.
-extern void SetUsageMessage(const std::string& usage);
-
-// Looks for flags in argv and parses them. Rearranges argv to put
-// flags first, or removes them entirely if remove_flags is true.
-// If a flag is defined more than once in the command line or flag
-// file, the last definition is used.
-// See top-of-file for more details on this function.
-#ifndef SWIG // In swig, use ParseCommandLineFlagsScript() instead.
-extern uint32 ParseCommandLineFlags(int *argc, char*** argv,
- bool remove_flags);
-#endif
-
-
-// Calls to ParseCommandLineNonHelpFlags and then to
-// HandleCommandLineHelpFlags can be used instead of a call to
-// ParseCommandLineFlags during initialization, in order to allow for
-// changing default values for some FLAGS (via
-// e.g. SetCommandLineOptionWithMode calls) between the time of
-// command line parsing and the time of dumping help information for
-// the flags as a result of command line parsing.
-// If a flag is defined more than once in the command line or flag
-// file, the last definition is used.
-extern uint32 ParseCommandLineNonHelpFlags(int *argc, char*** argv,
- bool remove_flags);
-// This is actually defined in commandlineflags_reporting.cc.
-// This function is misnamed (it also handles --version, etc.), but
-// it's too late to change that now. :-(
-extern void HandleCommandLineHelpFlags(); // in commandlineflags_reporting.cc
-
-// Allow command line reparsing. Disables the error normally
-// generated when an unknown flag is found, since it may be found in a
-// later parse. Thread-hostile; meant to be called before any threads
-// are spawned.
-extern void AllowCommandLineReparsing();
-
-// Reparse the flags that have not yet been recognized.
-// Only flags registered since the last parse will be recognized.
-// Any flag value must be provided as part of the argument using "=",
-// not as a separate command line argument that follows the flag argument.
-// Intended for handling flags from dynamically loaded libraries,
-// since their flags are not registered until they are loaded.
-extern uint32 ReparseCommandLineNonHelpFlags();
-
-
-// --------------------------------------------------------------------
-// Now come the command line flag declaration/definition macros that
-// will actually be used. They're kind of hairy. A major reason
-// for this is initialization: we want people to be able to access
-// variables in global constructors and have that not crash, even if
-// their global constructor runs before the global constructor here.
-// (Obviously, we can't guarantee the flags will have the correct
-// default value in that case, but at least accessing them is safe.)
-// The only way to do that is have flags point to a static buffer.
-// So we make one, using a union to ensure proper alignment, and
-// then use placement-new to actually set up the flag with the
-// correct default value. In the same vein, we have to worry about
-// flag access in global destructors, so FlagRegisterer has to be
-// careful never to destroy the flag-values it constructs.
-//
-// Note that when we define a flag variable FLAGS_<name>, we also
-// preemptively define a junk variable, FLAGS_no<name>. This is to
-// cause a link-time error if someone tries to define 2 flags with
-// names like "logging" and "nologging". We do this because a bool
-// flag FLAG can be set from the command line to true with a "-FLAG"
-// argument, and to false with a "-noFLAG" argument, and so this can
-// potentially avert confusion.
-//
-// We also put flags into their own namespace. It is purposefully
-// named in an opaque way that people should have trouble typing
-// directly. The idea is that DEFINE puts the flag in the weird
-// namespace, and DECLARE imports the flag from there into the current
-// namespace. The net result is to force people to use DECLARE to get
-// access to a flag, rather than saying "extern bool FLAGS_whatever;"
-// or some such instead. We want this so we can put extra
-// functionality (like sanity-checking) in DECLARE if we want, and
-// make sure it is picked up everywhere.
-//
-// We also put the type of the variable in the namespace, so that
-// people can't DECLARE_int32 something that they DEFINE_bool'd
-// elsewhere.
-
-class FlagRegisterer {
- public:
- FlagRegisterer(const char* name, const char* type,
- const char* help, const char* filename,
- void* current_storage, void* defvalue_storage);
-};
-
-extern bool FlagsTypeWarn(const char *name);
-
-// If your application #defines STRIP_FLAG_HELP to a non-zero value
-// before #including this file, we remove the help message from the
-// binary file. This can reduce the size of the resulting binary
-// somewhat, and may also be useful for security reasons.
-
-extern const char kStrippedFlagHelp[];
-
-}
-
-#ifndef SWIG // In swig, ignore the main flag declarations
-
-#if defined(STRIP_FLAG_HELP) && STRIP_FLAG_HELP > 0
-// Need this construct to avoid the 'defined but not used' warning.
-#define MAYBE_STRIPPED_HELP(txt) (false ? (txt) : kStrippedFlagHelp)
-#else
-#define MAYBE_STRIPPED_HELP(txt) txt
-#endif
-
-// Each command-line flag has two variables associated with it: one
-// with the current value, and one with the default value. However,
-// we have a third variable, which is where value is assigned; it's a
-// constant. This guarantees that FLAG_##value is initialized at
-// static initialization time (e.g. before program-start) rather than
-// than global construction time (which is after program-start but
-// before main), at least when 'value' is a compile-time constant. We
-// use a small trick for the "default value" variable, and call it
-// FLAGS_no<name>. This serves the second purpose of assuring a
-// compile error if someone tries to define a flag named no<name>
-// which is illegal (--foo and --nofoo both affect the "foo" flag).
-#define DEFINE_VARIABLE(type, shorttype, name, value, help) \
- namespace fL##shorttype { \
- static const type FLAGS_nono##name = value; \
- type FLAGS_##name = FLAGS_nono##name; \
- type FLAGS_no##name = FLAGS_nono##name; \
- static ::google::FlagRegisterer o_##name( \
- #name, #type, MAYBE_STRIPPED_HELP(help), __FILE__, \
- &FLAGS_##name, &FLAGS_no##name); \
- } \
- using fL##shorttype::FLAGS_##name
-
-#define DECLARE_VARIABLE(type, shorttype, name) \
- namespace fL##shorttype { \
- extern type FLAGS_##name; \
- } \
- using fL##shorttype::FLAGS_##name
-
-// For DEFINE_bool, we want to do the extra check that the passed-in
-// value is actually a bool, and not a string or something that can be
-// coerced to a bool. These declarations (no definition needed!) will
-// help us do that, and never evaluate From, which is important.
-// We'll use 'sizeof(IsBool(val))' to distinguish. This code requires
-// that the compiler have different sizes for bool & double. Since
-// this is not guaranteed by the standard, we check it with a
-// compile-time assert (msg[-1] will give a compile-time error).
-namespace fLB {
-struct CompileAssert {};
-typedef CompileAssert expected_sizeof_double_neq_sizeof_bool[
- (sizeof(double) != sizeof(bool)) ? 1 : -1];
-template<typename From> double IsBoolFlag(const From& from);
-bool IsBoolFlag(bool from);
-} // namespace fLB
-
-#define DECLARE_bool(name) DECLARE_VARIABLE(bool,B, name)
-#define DEFINE_bool(name,val,txt) \
- namespace fLB { \
- typedef CompileAssert FLAG_##name##_value_is_not_a_bool[ \
- (sizeof(::fLB::IsBoolFlag(val)) != sizeof(double)) ? 1 : -1]; \
- } \
- DEFINE_VARIABLE(bool,B, name, val, txt)
-
-#define DECLARE_int32(name) DECLARE_VARIABLE(::google::int32,I, name)
-#define DEFINE_int32(name,val,txt) DEFINE_VARIABLE(::google::int32,I, name, val, txt)
-
-#define DECLARE_int64(name) DECLARE_VARIABLE(::google::int64,I64, name)
-#define DEFINE_int64(name,val,txt) DEFINE_VARIABLE(::google::int64,I64, name, val, txt)
-
-#define DECLARE_uint64(name) DECLARE_VARIABLE(::google::uint64,U64, name)
-#define DEFINE_uint64(name,val,txt) DEFINE_VARIABLE(::google::uint64,U64, name, val, txt)
-
-#define DECLARE_double(name) DECLARE_VARIABLE(double,D, name)
-#define DEFINE_double(name,val,txt) DEFINE_VARIABLE(double,D, name, val, txt)
-
-// Strings are trickier, because they're not a POD, so we can't
-// construct them at static-initialization time (instead they get
-// constructed at global-constructor time, which is much later). To
-// try to avoid crashes in that case, we use a char buffer to store
-// the string, which we can static-initialize, and then placement-new
-// into it later. It's not perfect, but the best we can do.
-#define DECLARE_string(name) namespace fLS { extern std::string& FLAGS_##name; } \
- using fLS::FLAGS_##name
-
-// We need to define a var named FLAGS_no##name so people don't define
-// --string and --nostring. And we need a temporary place to put val
-// so we don't have to evaluate it twice. Two great needs that go
-// great together!
-// The weird 'using' + 'extern' inside the fLS namespace is to work around
-// an unknown compiler bug/issue with the gcc 4.2.1 on SUSE 10. See
-// http://code.google.com/p/google-gflags/issues/detail?id=20
-#define DEFINE_string(name, val, txt) \
- namespace fLS { \
- static union { void* align; char s[sizeof(std::string)]; } s_##name[2]; \
- const std::string* const FLAGS_no##name = new (s_##name[0].s) std::string(val); \
- static ::google::FlagRegisterer o_##name( \
- #name, "string", MAYBE_STRIPPED_HELP(txt), __FILE__, \
- s_##name[0].s, new (s_##name[1].s) std::string(*FLAGS_no##name)); \
- extern std::string& FLAGS_##name; \
- using fLS::FLAGS_##name; \
- std::string& FLAGS_##name = *(reinterpret_cast<std::string*>(s_##name[0].s)); \
- } \
- using fLS::FLAGS_##name
-
-#endif // SWIG
-
-#endif // GOOGLE_GFLAGS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags_completions.h b/toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags_completions.h
deleted file mode 100644
index 9d9ce7a5f7..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/linux/include/gflags/gflags_completions.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// ---
-// Author: Dave Nicponski
-//
-// Implement helpful bash-style command line flag completions
-//
-// ** Functional API:
-// HandleCommandLineCompletions() should be called early during
-// program startup, but after command line flag code has been
-// initialized, such as the beginning of HandleCommandLineHelpFlags().
-// It checks the value of the flag --tab_completion_word. If this
-// flag is empty, nothing happens here. If it contains a string,
-// however, then HandleCommandLineCompletions() will hijack the
-// process, attempting to identify the intention behind this
-// completion. Regardless of the outcome of this deduction, the
-// process will be terminated, similar to --helpshort flag
-// handling.
-//
-// ** Overview of Bash completions:
-// Bash can be told to programatically determine completions for the
-// current 'cursor word'. It does this by (in this case) invoking a
-// command with some additional arguments identifying the command
-// being executed, the word being completed, and the previous word
-// (if any). Bash then expects a sequence of output lines to be
-// printed to stdout. If these lines all contain a common prefix
-// longer than the cursor word, bash will replace the cursor word
-// with that common prefix, and display nothing. If there isn't such
-// a common prefix, bash will display the lines in pages using 'more'.
-//
-// ** Strategy taken for command line completions:
-// If we can deduce either the exact flag intended, or a common flag
-// prefix, we'll output exactly that. Otherwise, if information
-// must be displayed to the user, we'll take the opportunity to add
-// some helpful information beyond just the flag name (specifically,
-// we'll include the default flag value and as much of the flag's
-// description as can fit on a single terminal line width, as specified
-// by the flag --tab_completion_columns). Furthermore, we'll try to
-// make bash order the output such that the most useful or relevent
-// flags are the most likely to be shown at the top.
-//
-// ** Additional features:
-// To assist in finding that one really useful flag, substring matching
-// was implemented. Before pressing a <TAB> to get completion for the
-// current word, you can append one or more '?' to the flag to do
-// substring matching. Here's the semantics:
-// --foo<TAB> Show me all flags with names prefixed by 'foo'
-// --foo?<TAB> Show me all flags with 'foo' somewhere in the name
-// --foo??<TAB> Same as prior case, but also search in module
-// definition path for 'foo'
-// --foo???<TAB> Same as prior case, but also search in flag
-// descriptions for 'foo'
-// Finally, we'll trim the output to a relatively small number of
-// flags to keep bash quiet about the verbosity of output. If one
-// really wanted to see all possible matches, appending a '+' to the
-// search word will force the exhaustive list of matches to be printed.
-//
-// ** How to have bash accept completions from a binary:
-// Bash requires that it be informed about each command that programmatic
-// completion should be enabled for. Example addition to a .bashrc
-// file would be (your path to gflags_completions.sh file may differ):
-
-/*
-$ complete -o bashdefault -o default -o nospace -C \
- '/usr/local/bin/gflags_completions.sh --tab_completion_columns $COLUMNS' \
- time env binary_name another_binary [...]
-*/
-
-// This would allow the following to work:
-// $ /path/to/binary_name --vmodule<TAB>
-// Or:
-// $ ./bin/path/another_binary --gfs_u<TAB>
-// (etc)
-//
-// Sadly, it appears that bash gives no easy way to force this behavior for
-// all commands. That's where the "time" in the above example comes in.
-// If you haven't specifically added a command to the list of completion
-// supported commands, you can still get completions by prefixing the
-// entire command with "env".
-// $ env /some/brand/new/binary --vmod<TAB>
-// Assuming that "binary" is a newly compiled binary, this should still
-// produce the expected completion output.
-
-
-#ifndef GOOGLE_GFLAGS_COMPLETIONS_H_
-#define GOOGLE_GFLAGS_COMPLETIONS_H_
-
-namespace google {
-
-void HandleCommandLineCompletions(void);
-
-}
-
-#endif // GOOGLE_GFLAGS_COMPLETIONS_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/lss/codereview.settings b/toolkit/crashreporter/google-breakpad/src/third_party/lss/codereview.settings
deleted file mode 100644
index b3eb38787c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/codereview.settings
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file is used by gcl to get repository specific information.
-CODE_REVIEW_SERVER: codereview.chromium.org
-CC_LIST: chromium-reviews@chromium.org,markus@chromium.org,mseaborn@chromium.org
-VIEW_VC: https://chromium.googlesource.com/linux-syscall-support/+/
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h b/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
deleted file mode 100644
index 06b64e2eea..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/lss/linux_syscall_support.h
+++ /dev/null
@@ -1,4496 +0,0 @@
-/* Copyright (c) 2005-2011, Google Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- * * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ---
- * Author: Markus Gutschke
- */
-
-/* This file includes Linux-specific support functions common to the
- * coredumper and the thread lister; primarily, this is a collection
- * of direct system calls, and a couple of symbols missing from
- * standard header files.
- * There are a few options that the including file can set to control
- * the behavior of this file:
- *
- * SYS_CPLUSPLUS:
- * The entire header file will normally be wrapped in 'extern "C" { }",
- * making it suitable for compilation as both C and C++ source. If you
- * do not want to do this, you can set the SYS_CPLUSPLUS macro to inhibit
- * the wrapping. N.B. doing so will suppress inclusion of all prerequisite
- * system header files, too. It is the caller's responsibility to provide
- * the necessary definitions.
- *
- * SYS_ERRNO:
- * All system calls will update "errno" unless overriden by setting the
- * SYS_ERRNO macro prior to including this file. SYS_ERRNO should be
- * an l-value.
- *
- * SYS_INLINE:
- * New symbols will be defined "static inline", unless overridden by
- * the SYS_INLINE macro.
- *
- * SYS_LINUX_SYSCALL_SUPPORT_H
- * This macro is used to avoid multiple inclusions of this header file.
- * If you need to include this file more than once, make sure to
- * unset SYS_LINUX_SYSCALL_SUPPORT_H before each inclusion.
- *
- * SYS_PREFIX:
- * New system calls will have a prefix of "sys_" unless overridden by
- * the SYS_PREFIX macro. Valid values for this macro are [0..9] which
- * results in prefixes "sys[0..9]_". It is also possible to set this
- * macro to -1, which avoids all prefixes.
- *
- * SYS_SYSCALL_ENTRYPOINT:
- * Some applications (such as sandboxes that filter system calls), need
- * to be able to run custom-code each time a system call is made. If this
- * macro is defined, it expands to the name of a "common" symbol. If
- * this symbol is assigned a non-NULL pointer value, it is used as the
- * address of the system call entrypoint.
- * A pointer to this symbol can be obtained by calling
- * get_syscall_entrypoint()
- *
- * This file defines a few internal symbols that all start with "LSS_".
- * Do not access these symbols from outside this file. They are not part
- * of the supported API.
- */
-#ifndef SYS_LINUX_SYSCALL_SUPPORT_H
-#define SYS_LINUX_SYSCALL_SUPPORT_H
-
-/* We currently only support x86-32, x86-64, ARM, MIPS, PPC, s390 and s390x
- * on Linux.
- * Porting to other related platforms should not be difficult.
- */
-#if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) || \
- defined(__mips__) || defined(__PPC__) || defined(__ARM_EABI__) || \
- defined(__aarch64__) || defined(__s390__)) \
- && (defined(__linux) || defined(__ANDROID__))
-
-#ifndef SYS_CPLUSPLUS
-#ifdef __cplusplus
-/* Some system header files in older versions of gcc neglect to properly
- * handle being included from C++. As it appears to be harmless to have
- * multiple nested 'extern "C"' blocks, just add another one here.
- */
-extern "C" {
-#endif
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sched.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <string.h>
-#include <sys/ptrace.h>
-#include <sys/resource.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-#include <linux/unistd.h>
-#include <endian.h>
-
-#ifdef __mips__
-/* Include definitions of the ABI currently in use. */
-#ifdef __ANDROID__
-/* Android doesn't have sgidefs.h, but does have asm/sgidefs.h,
- * which has the definitions we need.
- */
-#include <asm/sgidefs.h>
-#else
-#include <sgidefs.h>
-#endif
-#endif
-#endif
-
-/* The Android NDK's <sys/stat.h> #defines these macros as aliases
- * to their non-64 counterparts. To avoid naming conflict, remove them. */
-#ifdef __ANDROID__
- /* These are restored by the corresponding #pragma pop_macro near
- * the end of this file. */
-# pragma push_macro("stat64")
-# pragma push_macro("fstat64")
-# pragma push_macro("lstat64")
-# undef stat64
-# undef fstat64
-# undef lstat64
-#endif
-
-/* As glibc often provides subtly incompatible data structures (and implicit
- * wrapper functions that convert them), we provide our own kernel data
- * structures for use by the system calls.
- * These structures have been developed by using Linux 2.6.23 headers for
- * reference. Note though, we do not care about exact API compatibility
- * with the kernel, and in fact the kernel often does not have a single
- * API that works across architectures. Instead, we try to mimic the glibc
- * API where reasonable, and only guarantee ABI compatibility with the
- * kernel headers.
- * Most notably, here are a few changes that were made to the structures
- * defined by kernel headers:
- *
- * - we only define structures, but not symbolic names for kernel data
- * types. For the latter, we directly use the native C datatype
- * (i.e. "unsigned" instead of "mode_t").
- * - in a few cases, it is possible to define identical structures for
- * both 32bit (e.g. i386) and 64bit (e.g. x86-64) platforms by
- * standardizing on the 64bit version of the data types. In particular,
- * this means that we use "unsigned" where the 32bit headers say
- * "unsigned long".
- * - overall, we try to minimize the number of cases where we need to
- * conditionally define different structures.
- * - the "struct kernel_sigaction" class of structures have been
- * modified to more closely mimic glibc's API by introducing an
- * anonymous union for the function pointer.
- * - a small number of field names had to have an underscore appended to
- * them, because glibc defines a global macro by the same name.
- */
-
-/* include/linux/dirent.h */
-struct kernel_dirent64 {
- unsigned long long d_ino;
- long long d_off;
- unsigned short d_reclen;
- unsigned char d_type;
- char d_name[256];
-};
-
-/* include/linux/dirent.h */
-#if defined(__aarch64__)
-// aarch64 only defines dirent64, just uses that for dirent too.
-#define kernel_dirent kernel_dirent64
-#else
-struct kernel_dirent {
- long d_ino;
- long d_off;
- unsigned short d_reclen;
- char d_name[256];
-};
-#endif
-
-/* include/linux/uio.h */
-struct kernel_iovec {
- void *iov_base;
- unsigned long iov_len;
-};
-
-/* include/linux/socket.h */
-struct kernel_msghdr {
- void *msg_name;
- int msg_namelen;
- struct kernel_iovec*msg_iov;
- unsigned long msg_iovlen;
- void *msg_control;
- unsigned long msg_controllen;
- unsigned msg_flags;
-};
-
-/* include/asm-generic/poll.h */
-struct kernel_pollfd {
- int fd;
- short events;
- short revents;
-};
-
-/* include/linux/resource.h */
-struct kernel_rlimit {
- unsigned long rlim_cur;
- unsigned long rlim_max;
-};
-
-/* include/linux/time.h */
-struct kernel_timespec {
- long tv_sec;
- long tv_nsec;
-};
-
-/* include/linux/time.h */
-struct kernel_timeval {
- long tv_sec;
- long tv_usec;
-};
-
-/* include/linux/resource.h */
-struct kernel_rusage {
- struct kernel_timeval ru_utime;
- struct kernel_timeval ru_stime;
- long ru_maxrss;
- long ru_ixrss;
- long ru_idrss;
- long ru_isrss;
- long ru_minflt;
- long ru_majflt;
- long ru_nswap;
- long ru_inblock;
- long ru_oublock;
- long ru_msgsnd;
- long ru_msgrcv;
- long ru_nsignals;
- long ru_nvcsw;
- long ru_nivcsw;
-};
-
-#if defined(__i386__) || defined(__ARM_EABI__) || defined(__ARM_ARCH_3__) \
- || defined(__PPC__) || (defined(__s390__) && !defined(__s390x__))
-
-/* include/asm-{arm,i386,mips,ppc}/signal.h */
-struct kernel_old_sigaction {
- union {
- void (*sa_handler_)(int);
- void (*sa_sigaction_)(int, siginfo_t *, void *);
- };
- unsigned long sa_mask;
- unsigned long sa_flags;
- void (*sa_restorer)(void);
-} __attribute__((packed,aligned(4)));
-#elif (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32)
- #define kernel_old_sigaction kernel_sigaction
-#elif defined(__aarch64__)
- // No kernel_old_sigaction defined for arm64.
-#endif
-
-/* Some kernel functions (e.g. sigaction() in 2.6.23) require that the
- * exactly match the size of the signal set, even though the API was
- * intended to be extensible. We define our own KERNEL_NSIG to deal with
- * this.
- * Please note that glibc provides signals [1.._NSIG-1], whereas the
- * kernel (and this header) provides the range [1..KERNEL_NSIG]. The
- * actual number of signals is obviously the same, but the constants
- * differ by one.
- */
-#ifdef __mips__
-#define KERNEL_NSIG 128
-#else
-#define KERNEL_NSIG 64
-#endif
-
-/* include/asm-{arm,aarch64,i386,mips,x86_64}/signal.h */
-struct kernel_sigset_t {
- unsigned long sig[(KERNEL_NSIG + 8*sizeof(unsigned long) - 1)/
- (8*sizeof(unsigned long))];
-};
-
-/* include/asm-{arm,i386,mips,x86_64,ppc}/signal.h */
-struct kernel_sigaction {
-#ifdef __mips__
- unsigned long sa_flags;
- union {
- void (*sa_handler_)(int);
- void (*sa_sigaction_)(int, siginfo_t *, void *);
- };
- struct kernel_sigset_t sa_mask;
-#else
- union {
- void (*sa_handler_)(int);
- void (*sa_sigaction_)(int, siginfo_t *, void *);
- };
- unsigned long sa_flags;
- void (*sa_restorer)(void);
- struct kernel_sigset_t sa_mask;
-#endif
-};
-
-/* include/linux/socket.h */
-struct kernel_sockaddr {
- unsigned short sa_family;
- char sa_data[14];
-};
-
-/* include/asm-{arm,aarch64,i386,mips,ppc,s390}/stat.h */
-#ifdef __mips__
-#if _MIPS_SIM == _MIPS_SIM_ABI64
-struct kernel_stat {
-#else
-struct kernel_stat64 {
-#endif
- unsigned st_dev;
- unsigned __pad0[3];
- unsigned long long st_ino;
- unsigned st_mode;
- unsigned st_nlink;
- unsigned st_uid;
- unsigned st_gid;
- unsigned st_rdev;
- unsigned __pad1[3];
- long long st_size;
- unsigned st_atime_;
- unsigned st_atime_nsec_;
- unsigned st_mtime_;
- unsigned st_mtime_nsec_;
- unsigned st_ctime_;
- unsigned st_ctime_nsec_;
- unsigned st_blksize;
- unsigned __pad2;
- unsigned long long st_blocks;
-};
-#elif defined __PPC__
-struct kernel_stat64 {
- unsigned long long st_dev;
- unsigned long long st_ino;
- unsigned st_mode;
- unsigned st_nlink;
- unsigned st_uid;
- unsigned st_gid;
- unsigned long long st_rdev;
- unsigned short int __pad2;
- long long st_size;
- long st_blksize;
- long long st_blocks;
- long st_atime_;
- unsigned long st_atime_nsec_;
- long st_mtime_;
- unsigned long st_mtime_nsec_;
- long st_ctime_;
- unsigned long st_ctime_nsec_;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-#else
-struct kernel_stat64 {
- unsigned long long st_dev;
- unsigned char __pad0[4];
- unsigned __st_ino;
- unsigned st_mode;
- unsigned st_nlink;
- unsigned st_uid;
- unsigned st_gid;
- unsigned long long st_rdev;
- unsigned char __pad3[4];
- long long st_size;
- unsigned st_blksize;
- unsigned long long st_blocks;
- unsigned st_atime_;
- unsigned st_atime_nsec_;
- unsigned st_mtime_;
- unsigned st_mtime_nsec_;
- unsigned st_ctime_;
- unsigned st_ctime_nsec_;
- unsigned long long st_ino;
-};
-#endif
-
-/* include/asm-{arm,aarch64,i386,mips,x86_64,ppc,s390}/stat.h */
-#if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
-struct kernel_stat {
- /* The kernel headers suggest that st_dev and st_rdev should be 32bit
- * quantities encoding 12bit major and 20bit minor numbers in an interleaved
- * format. In reality, we do not see useful data in the top bits. So,
- * we'll leave the padding in here, until we find a better solution.
- */
- unsigned short st_dev;
- short pad1;
- unsigned st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- short pad2;
- unsigned st_size;
- unsigned st_blksize;
- unsigned st_blocks;
- unsigned st_atime_;
- unsigned st_atime_nsec_;
- unsigned st_mtime_;
- unsigned st_mtime_nsec_;
- unsigned st_ctime_;
- unsigned st_ctime_nsec_;
- unsigned __unused4;
- unsigned __unused5;
-};
-#elif defined(__x86_64__)
-struct kernel_stat {
- uint64_t st_dev;
- uint64_t st_ino;
- uint64_t st_nlink;
- unsigned st_mode;
- unsigned st_uid;
- unsigned st_gid;
- unsigned __pad0;
- uint64_t st_rdev;
- int64_t st_size;
- int64_t st_blksize;
- int64_t st_blocks;
- uint64_t st_atime_;
- uint64_t st_atime_nsec_;
- uint64_t st_mtime_;
- uint64_t st_mtime_nsec_;
- uint64_t st_ctime_;
- uint64_t st_ctime_nsec_;
- int64_t __unused4[3];
-};
-#elif defined(__PPC__)
-struct kernel_stat {
- unsigned st_dev;
- unsigned long st_ino; // ino_t
- unsigned long st_mode; // mode_t
- unsigned short st_nlink; // nlink_t
- unsigned st_uid; // uid_t
- unsigned st_gid; // gid_t
- unsigned st_rdev;
- long st_size; // off_t
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime_;
- unsigned long st_atime_nsec_;
- unsigned long st_mtime_;
- unsigned long st_mtime_nsec_;
- unsigned long st_ctime_;
- unsigned long st_ctime_nsec_;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-#elif (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64)
-struct kernel_stat {
- unsigned st_dev;
- int st_pad1[3];
- unsigned st_ino;
- unsigned st_mode;
- unsigned st_nlink;
- unsigned st_uid;
- unsigned st_gid;
- unsigned st_rdev;
- int st_pad2[2];
- long st_size;
- int st_pad3;
- long st_atime_;
- long st_atime_nsec_;
- long st_mtime_;
- long st_mtime_nsec_;
- long st_ctime_;
- long st_ctime_nsec_;
- int st_blksize;
- int st_blocks;
- int st_pad4[14];
-};
-#elif defined(__aarch64__)
-struct kernel_stat {
- unsigned long st_dev;
- unsigned long st_ino;
- unsigned int st_mode;
- unsigned int st_nlink;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned long st_rdev;
- unsigned long __pad1;
- long st_size;
- int st_blksize;
- int __pad2;
- long st_blocks;
- long st_atime_;
- unsigned long st_atime_nsec_;
- long st_mtime_;
- unsigned long st_mtime_nsec_;
- long st_ctime_;
- unsigned long st_ctime_nsec_;
- unsigned int __unused4;
- unsigned int __unused5;
-};
-#elif defined(__s390x__)
-struct kernel_stat {
- unsigned long st_dev;
- unsigned long st_ino;
- unsigned long st_nlink;
- unsigned int st_mode;
- unsigned int st_uid;
- unsigned int st_gid;
- unsigned int __pad1;
- unsigned long st_rdev;
- unsigned long st_size;
- unsigned long st_atime_;
- unsigned long st_atime_nsec_;
- unsigned long st_mtime_;
- unsigned long st_mtime_nsec_;
- unsigned long st_ctime_;
- unsigned long st_ctime_nsec_;
- unsigned long st_blksize;
- long st_blocks;
- unsigned long __unused[3];
-};
-#elif defined(__s390__)
-struct kernel_stat {
- unsigned short st_dev;
- unsigned short __pad1;
- unsigned long st_ino;
- unsigned short st_mode;
- unsigned short st_nlink;
- unsigned short st_uid;
- unsigned short st_gid;
- unsigned short st_rdev;
- unsigned short __pad2;
- unsigned long st_size;
- unsigned long st_blksize;
- unsigned long st_blocks;
- unsigned long st_atime_;
- unsigned long st_atime_nsec_;
- unsigned long st_mtime_;
- unsigned long st_mtime_nsec_;
- unsigned long st_ctime_;
- unsigned long st_ctime_nsec_;
- unsigned long __unused4;
- unsigned long __unused5;
-};
-#endif
-
-/* include/asm-{arm,aarch64,i386,mips,x86_64,ppc,s390}/statfs.h */
-#ifdef __mips__
-#if _MIPS_SIM != _MIPS_SIM_ABI64
-struct kernel_statfs64 {
- unsigned long f_type;
- unsigned long f_bsize;
- unsigned long f_frsize;
- unsigned long __pad;
- unsigned long long f_blocks;
- unsigned long long f_bfree;
- unsigned long long f_files;
- unsigned long long f_ffree;
- unsigned long long f_bavail;
- struct { int val[2]; } f_fsid;
- unsigned long f_namelen;
- unsigned long f_spare[6];
-};
-#endif
-#elif defined(__s390__)
-/* See also arch/s390/include/asm/compat.h */
-struct kernel_statfs64 {
- unsigned int f_type;
- unsigned int f_bsize;
- unsigned long long f_blocks;
- unsigned long long f_bfree;
- unsigned long long f_bavail;
- unsigned long long f_files;
- unsigned long long f_ffree;
- struct { int val[2]; } f_fsid;
- unsigned int f_namelen;
- unsigned int f_frsize;
- unsigned int f_flags;
- unsigned int f_spare[4];
-};
-#elif !defined(__x86_64__)
-struct kernel_statfs64 {
- unsigned long f_type;
- unsigned long f_bsize;
- unsigned long long f_blocks;
- unsigned long long f_bfree;
- unsigned long long f_bavail;
- unsigned long long f_files;
- unsigned long long f_ffree;
- struct { int val[2]; } f_fsid;
- unsigned long f_namelen;
- unsigned long f_frsize;
- unsigned long f_spare[5];
-};
-#endif
-
-/* include/asm-{arm,i386,mips,x86_64,ppc,generic,s390}/statfs.h */
-#ifdef __mips__
-struct kernel_statfs {
- long f_type;
- long f_bsize;
- long f_frsize;
- long f_blocks;
- long f_bfree;
- long f_files;
- long f_ffree;
- long f_bavail;
- struct { int val[2]; } f_fsid;
- long f_namelen;
- long f_spare[6];
-};
-#elif defined(__x86_64__)
-struct kernel_statfs {
- /* x86_64 actually defines all these fields as signed, whereas all other */
- /* platforms define them as unsigned. Leaving them at unsigned should not */
- /* cause any problems. Make sure these are 64-bit even on x32. */
- uint64_t f_type;
- uint64_t f_bsize;
- uint64_t f_blocks;
- uint64_t f_bfree;
- uint64_t f_bavail;
- uint64_t f_files;
- uint64_t f_ffree;
- struct { int val[2]; } f_fsid;
- uint64_t f_namelen;
- uint64_t f_frsize;
- uint64_t f_spare[5];
-};
-#elif defined(__s390__)
-struct kernel_statfs {
- unsigned int f_type;
- unsigned int f_bsize;
- unsigned long f_blocks;
- unsigned long f_bfree;
- unsigned long f_bavail;
- unsigned long f_files;
- unsigned long f_ffree;
- struct { int val[2]; } f_fsid;
- unsigned int f_namelen;
- unsigned int f_frsize;
- unsigned int f_flags;
- unsigned int f_spare[4];
-};
-#else
-struct kernel_statfs {
- unsigned long f_type;
- unsigned long f_bsize;
- unsigned long f_blocks;
- unsigned long f_bfree;
- unsigned long f_bavail;
- unsigned long f_files;
- unsigned long f_ffree;
- struct { int val[2]; } f_fsid;
- unsigned long f_namelen;
- unsigned long f_frsize;
- unsigned long f_spare[5];
-};
-#endif
-
-
-/* Definitions missing from the standard header files */
-#ifndef O_DIRECTORY
-#if defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || defined(__aarch64__)
-#define O_DIRECTORY 0040000
-#else
-#define O_DIRECTORY 0200000
-#endif
-#endif
-#ifndef NT_PRXFPREG
-#define NT_PRXFPREG 0x46e62b7f
-#endif
-#ifndef PTRACE_GETFPXREGS
-#define PTRACE_GETFPXREGS ((enum __ptrace_request)18)
-#endif
-#ifndef PR_GET_DUMPABLE
-#define PR_GET_DUMPABLE 3
-#endif
-#ifndef PR_SET_DUMPABLE
-#define PR_SET_DUMPABLE 4
-#endif
-#ifndef PR_GET_SECCOMP
-#define PR_GET_SECCOMP 21
-#endif
-#ifndef PR_SET_SECCOMP
-#define PR_SET_SECCOMP 22
-#endif
-#ifndef AT_FDCWD
-#define AT_FDCWD (-100)
-#endif
-#ifndef AT_SYMLINK_NOFOLLOW
-#define AT_SYMLINK_NOFOLLOW 0x100
-#endif
-#ifndef AT_REMOVEDIR
-#define AT_REMOVEDIR 0x200
-#endif
-#ifndef MREMAP_FIXED
-#define MREMAP_FIXED 2
-#endif
-#ifndef SA_RESTORER
-#define SA_RESTORER 0x04000000
-#endif
-#ifndef CPUCLOCK_PROF
-#define CPUCLOCK_PROF 0
-#endif
-#ifndef CPUCLOCK_VIRT
-#define CPUCLOCK_VIRT 1
-#endif
-#ifndef CPUCLOCK_SCHED
-#define CPUCLOCK_SCHED 2
-#endif
-#ifndef CPUCLOCK_PERTHREAD_MASK
-#define CPUCLOCK_PERTHREAD_MASK 4
-#endif
-#ifndef MAKE_PROCESS_CPUCLOCK
-#define MAKE_PROCESS_CPUCLOCK(pid, clock) \
- ((~(int)(pid) << 3) | (int)(clock))
-#endif
-#ifndef MAKE_THREAD_CPUCLOCK
-#define MAKE_THREAD_CPUCLOCK(tid, clock) \
- ((~(int)(tid) << 3) | (int)((clock) | CPUCLOCK_PERTHREAD_MASK))
-#endif
-
-#ifndef FUTEX_WAIT
-#define FUTEX_WAIT 0
-#endif
-#ifndef FUTEX_WAKE
-#define FUTEX_WAKE 1
-#endif
-#ifndef FUTEX_FD
-#define FUTEX_FD 2
-#endif
-#ifndef FUTEX_REQUEUE
-#define FUTEX_REQUEUE 3
-#endif
-#ifndef FUTEX_CMP_REQUEUE
-#define FUTEX_CMP_REQUEUE 4
-#endif
-#ifndef FUTEX_WAKE_OP
-#define FUTEX_WAKE_OP 5
-#endif
-#ifndef FUTEX_LOCK_PI
-#define FUTEX_LOCK_PI 6
-#endif
-#ifndef FUTEX_UNLOCK_PI
-#define FUTEX_UNLOCK_PI 7
-#endif
-#ifndef FUTEX_TRYLOCK_PI
-#define FUTEX_TRYLOCK_PI 8
-#endif
-#ifndef FUTEX_PRIVATE_FLAG
-#define FUTEX_PRIVATE_FLAG 128
-#endif
-#ifndef FUTEX_CMD_MASK
-#define FUTEX_CMD_MASK ~FUTEX_PRIVATE_FLAG
-#endif
-#ifndef FUTEX_WAIT_PRIVATE
-#define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_WAKE_PRIVATE
-#define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_REQUEUE_PRIVATE
-#define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_CMP_REQUEUE_PRIVATE
-#define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_WAKE_OP_PRIVATE
-#define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_LOCK_PI_PRIVATE
-#define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_UNLOCK_PI_PRIVATE
-#define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)
-#endif
-#ifndef FUTEX_TRYLOCK_PI_PRIVATE
-#define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)
-#endif
-
-
-#if defined(__x86_64__)
-#ifndef ARCH_SET_GS
-#define ARCH_SET_GS 0x1001
-#endif
-#ifndef ARCH_GET_GS
-#define ARCH_GET_GS 0x1004
-#endif
-#endif
-
-#if defined(__i386__)
-#ifndef __NR_quotactl
-#define __NR_quotactl 131
-#endif
-#ifndef __NR_setresuid
-#define __NR_setresuid 164
-#define __NR_getresuid 165
-#define __NR_setresgid 170
-#define __NR_getresgid 171
-#endif
-#ifndef __NR_rt_sigaction
-#define __NR_rt_sigreturn 173
-#define __NR_rt_sigaction 174
-#define __NR_rt_sigprocmask 175
-#define __NR_rt_sigpending 176
-#define __NR_rt_sigsuspend 179
-#endif
-#ifndef __NR_pread64
-#define __NR_pread64 180
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 181
-#endif
-#ifndef __NR_ugetrlimit
-#define __NR_ugetrlimit 191
-#endif
-#ifndef __NR_stat64
-#define __NR_stat64 195
-#endif
-#ifndef __NR_fstat64
-#define __NR_fstat64 197
-#endif
-#ifndef __NR_setresuid32
-#define __NR_setresuid32 208
-#define __NR_getresuid32 209
-#define __NR_setresgid32 210
-#define __NR_getresgid32 211
-#endif
-#ifndef __NR_setfsuid32
-#define __NR_setfsuid32 215
-#define __NR_setfsgid32 216
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 220
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid 224
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead 225
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr 226
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr 227
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr 229
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr 230
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr 232
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr 233
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill 238
-#endif
-#ifndef __NR_futex
-#define __NR_futex 240
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 241
-#define __NR_sched_getaffinity 242
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address 258
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime 265
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres 266
-#endif
-#ifndef __NR_statfs64
-#define __NR_statfs64 268
-#endif
-#ifndef __NR_fstatfs64
-#define __NR_fstatfs64 269
-#endif
-#ifndef __NR_fadvise64_64
-#define __NR_fadvise64_64 272
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set 289
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get 290
-#endif
-#ifndef __NR_openat
-#define __NR_openat 295
-#endif
-#ifndef __NR_fstatat64
-#define __NR_fstatat64 300
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat 301
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages 317
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu 318
-#endif
-#ifndef __NR_fallocate
-#define __NR_fallocate 324
-#endif
-/* End of i386 definitions */
-#elif defined(__ARM_ARCH_3__) || defined(__ARM_EABI__)
-#ifndef __NR_setresuid
-#define __NR_setresuid (__NR_SYSCALL_BASE + 164)
-#define __NR_getresuid (__NR_SYSCALL_BASE + 165)
-#define __NR_setresgid (__NR_SYSCALL_BASE + 170)
-#define __NR_getresgid (__NR_SYSCALL_BASE + 171)
-#endif
-#ifndef __NR_rt_sigaction
-#define __NR_rt_sigreturn (__NR_SYSCALL_BASE + 173)
-#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174)
-#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175)
-#define __NR_rt_sigpending (__NR_SYSCALL_BASE + 176)
-#define __NR_rt_sigsuspend (__NR_SYSCALL_BASE + 179)
-#endif
-#ifndef __NR_pread64
-#define __NR_pread64 (__NR_SYSCALL_BASE + 180)
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 (__NR_SYSCALL_BASE + 181)
-#endif
-#ifndef __NR_ugetrlimit
-#define __NR_ugetrlimit (__NR_SYSCALL_BASE + 191)
-#endif
-#ifndef __NR_stat64
-#define __NR_stat64 (__NR_SYSCALL_BASE + 195)
-#endif
-#ifndef __NR_fstat64
-#define __NR_fstat64 (__NR_SYSCALL_BASE + 197)
-#endif
-#ifndef __NR_setresuid32
-#define __NR_setresuid32 (__NR_SYSCALL_BASE + 208)
-#define __NR_getresuid32 (__NR_SYSCALL_BASE + 209)
-#define __NR_setresgid32 (__NR_SYSCALL_BASE + 210)
-#define __NR_getresgid32 (__NR_SYSCALL_BASE + 211)
-#endif
-#ifndef __NR_setfsuid32
-#define __NR_setfsuid32 (__NR_SYSCALL_BASE + 215)
-#define __NR_setfsgid32 (__NR_SYSCALL_BASE + 216)
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 (__NR_SYSCALL_BASE + 217)
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid (__NR_SYSCALL_BASE + 224)
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead (__NR_SYSCALL_BASE + 225)
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr (__NR_SYSCALL_BASE + 226)
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr (__NR_SYSCALL_BASE + 227)
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr (__NR_SYSCALL_BASE + 229)
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr (__NR_SYSCALL_BASE + 230)
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr (__NR_SYSCALL_BASE + 232)
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr (__NR_SYSCALL_BASE + 233)
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill (__NR_SYSCALL_BASE + 238)
-#endif
-#ifndef __NR_futex
-#define __NR_futex (__NR_SYSCALL_BASE + 240)
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity (__NR_SYSCALL_BASE + 241)
-#define __NR_sched_getaffinity (__NR_SYSCALL_BASE + 242)
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address (__NR_SYSCALL_BASE + 256)
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime (__NR_SYSCALL_BASE + 263)
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres (__NR_SYSCALL_BASE + 264)
-#endif
-#ifndef __NR_statfs64
-#define __NR_statfs64 (__NR_SYSCALL_BASE + 266)
-#endif
-#ifndef __NR_fstatfs64
-#define __NR_fstatfs64 (__NR_SYSCALL_BASE + 267)
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314)
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315)
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages (__NR_SYSCALL_BASE + 344)
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu (__NR_SYSCALL_BASE + 345)
-#endif
-/* End of ARM 3/EABI definitions */
-#elif defined(__aarch64__)
-#ifndef __NR_setxattr
-#define __NR_setxattr 5
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr 6
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr 8
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr 9
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr 11
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr 12
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set 30
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get 31
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat 35
-#endif
-#ifndef __NR_fallocate
-#define __NR_fallocate 47
-#endif
-#ifndef __NR_openat
-#define __NR_openat 56
-#endif
-#ifndef __NR_quotactl
-#define __NR_quotactl 60
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 61
-#endif
-#ifndef __NR_getdents
-#define __NR_getdents __NR_getdents64
-#endif
-#ifndef __NR_pread64
-#define __NR_pread64 67
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 68
-#endif
-#ifndef __NR_ppoll
-#define __NR_ppoll 73
-#endif
-#ifndef __NR_readlinkat
-#define __NR_readlinkat 78
-#endif
-#ifndef __NR_newfstatat
-#define __NR_newfstatat 79
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address 96
-#endif
-#ifndef __NR_futex
-#define __NR_futex 98
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime 113
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres 114
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 122
-#define __NR_sched_getaffinity 123
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill 130
-#endif
-#ifndef __NR_setresuid
-#define __NR_setresuid 147
-#define __NR_getresuid 148
-#define __NR_setresgid 149
-#define __NR_getresgid 150
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid 178
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead 213
-#endif
-#ifndef __NR_fadvise64
-#define __NR_fadvise64 223
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages 239
-#endif
-/* End of aarch64 definitions */
-#elif defined(__x86_64__)
-#ifndef __NR_pread64
-#define __NR_pread64 17
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 18
-#endif
-#ifndef __NR_setresuid
-#define __NR_setresuid 117
-#define __NR_getresuid 118
-#define __NR_setresgid 119
-#define __NR_getresgid 120
-#endif
-#ifndef __NR_quotactl
-#define __NR_quotactl 179
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid 186
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead 187
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr 188
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr 189
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr 191
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr 192
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr 194
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr 195
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill 200
-#endif
-#ifndef __NR_futex
-#define __NR_futex 202
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 203
-#define __NR_sched_getaffinity 204
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 217
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address 218
-#endif
-#ifndef __NR_fadvise64
-#define __NR_fadvise64 221
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime 228
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres 229
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set 251
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get 252
-#endif
-#ifndef __NR_openat
-#define __NR_openat 257
-#endif
-#ifndef __NR_newfstatat
-#define __NR_newfstatat 262
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat 263
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages 279
-#endif
-#ifndef __NR_fallocate
-#define __NR_fallocate 285
-#endif
-/* End of x86-64 definitions */
-#elif defined(__mips__)
-#if _MIPS_SIM == _MIPS_SIM_ABI32
-#ifndef __NR_setresuid
-#define __NR_setresuid (__NR_Linux + 185)
-#define __NR_getresuid (__NR_Linux + 186)
-#define __NR_setresgid (__NR_Linux + 190)
-#define __NR_getresgid (__NR_Linux + 191)
-#endif
-#ifndef __NR_rt_sigaction
-#define __NR_rt_sigreturn (__NR_Linux + 193)
-#define __NR_rt_sigaction (__NR_Linux + 194)
-#define __NR_rt_sigprocmask (__NR_Linux + 195)
-#define __NR_rt_sigpending (__NR_Linux + 196)
-#define __NR_rt_sigsuspend (__NR_Linux + 199)
-#endif
-#ifndef __NR_pread64
-#define __NR_pread64 (__NR_Linux + 200)
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 (__NR_Linux + 201)
-#endif
-#ifndef __NR_stat64
-#define __NR_stat64 (__NR_Linux + 213)
-#endif
-#ifndef __NR_fstat64
-#define __NR_fstat64 (__NR_Linux + 215)
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 (__NR_Linux + 219)
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid (__NR_Linux + 222)
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead (__NR_Linux + 223)
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr (__NR_Linux + 224)
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr (__NR_Linux + 225)
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr (__NR_Linux + 227)
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr (__NR_Linux + 228)
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr (__NR_Linux + 230)
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr (__NR_Linux + 231)
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill (__NR_Linux + 236)
-#endif
-#ifndef __NR_futex
-#define __NR_futex (__NR_Linux + 238)
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity (__NR_Linux + 239)
-#define __NR_sched_getaffinity (__NR_Linux + 240)
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address (__NR_Linux + 252)
-#endif
-#ifndef __NR_statfs64
-#define __NR_statfs64 (__NR_Linux + 255)
-#endif
-#ifndef __NR_fstatfs64
-#define __NR_fstatfs64 (__NR_Linux + 256)
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime (__NR_Linux + 263)
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres (__NR_Linux + 264)
-#endif
-#ifndef __NR_openat
-#define __NR_openat (__NR_Linux + 288)
-#endif
-#ifndef __NR_fstatat
-#define __NR_fstatat (__NR_Linux + 293)
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat (__NR_Linux + 294)
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages (__NR_Linux + 308)
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu (__NR_Linux + 312)
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set (__NR_Linux + 314)
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get (__NR_Linux + 315)
-#endif
-/* End of MIPS (old 32bit API) definitions */
-#elif _MIPS_SIM == _MIPS_SIM_ABI64
-#ifndef __NR_pread64
-#define __NR_pread64 (__NR_Linux + 16)
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 (__NR_Linux + 17)
-#endif
-#ifndef __NR_setresuid
-#define __NR_setresuid (__NR_Linux + 115)
-#define __NR_getresuid (__NR_Linux + 116)
-#define __NR_setresgid (__NR_Linux + 117)
-#define __NR_getresgid (__NR_Linux + 118)
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid (__NR_Linux + 178)
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead (__NR_Linux + 179)
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr (__NR_Linux + 180)
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr (__NR_Linux + 181)
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr (__NR_Linux + 183)
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr (__NR_Linux + 184)
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr (__NR_Linux + 186)
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr (__NR_Linux + 187)
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill (__NR_Linux + 192)
-#endif
-#ifndef __NR_futex
-#define __NR_futex (__NR_Linux + 194)
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity (__NR_Linux + 195)
-#define __NR_sched_getaffinity (__NR_Linux + 196)
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address (__NR_Linux + 212)
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime (__NR_Linux + 222)
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres (__NR_Linux + 223)
-#endif
-#ifndef __NR_openat
-#define __NR_openat (__NR_Linux + 247)
-#endif
-#ifndef __NR_fstatat
-#define __NR_fstatat (__NR_Linux + 252)
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat (__NR_Linux + 253)
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages (__NR_Linux + 267)
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu (__NR_Linux + 271)
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set (__NR_Linux + 273)
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get (__NR_Linux + 274)
-#endif
-/* End of MIPS (64bit API) definitions */
-#else
-#ifndef __NR_setresuid
-#define __NR_setresuid (__NR_Linux + 115)
-#define __NR_getresuid (__NR_Linux + 116)
-#define __NR_setresgid (__NR_Linux + 117)
-#define __NR_getresgid (__NR_Linux + 118)
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid (__NR_Linux + 178)
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead (__NR_Linux + 179)
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr (__NR_Linux + 180)
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr (__NR_Linux + 181)
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr (__NR_Linux + 183)
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr (__NR_Linux + 184)
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr (__NR_Linux + 186)
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr (__NR_Linux + 187)
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill (__NR_Linux + 192)
-#endif
-#ifndef __NR_futex
-#define __NR_futex (__NR_Linux + 194)
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity (__NR_Linux + 195)
-#define __NR_sched_getaffinity (__NR_Linux + 196)
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address (__NR_Linux + 213)
-#endif
-#ifndef __NR_statfs64
-#define __NR_statfs64 (__NR_Linux + 217)
-#endif
-#ifndef __NR_fstatfs64
-#define __NR_fstatfs64 (__NR_Linux + 218)
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime (__NR_Linux + 226)
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres (__NR_Linux + 227)
-#endif
-#ifndef __NR_openat
-#define __NR_openat (__NR_Linux + 251)
-#endif
-#ifndef __NR_fstatat
-#define __NR_fstatat (__NR_Linux + 256)
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat (__NR_Linux + 257)
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages (__NR_Linux + 271)
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu (__NR_Linux + 275)
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set (__NR_Linux + 277)
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get (__NR_Linux + 278)
-#endif
-/* End of MIPS (new 32bit API) definitions */
-#endif
-/* End of MIPS definitions */
-#elif defined(__PPC__)
-#ifndef __NR_setfsuid
-#define __NR_setfsuid 138
-#define __NR_setfsgid 139
-#endif
-#ifndef __NR_setresuid
-#define __NR_setresuid 164
-#define __NR_getresuid 165
-#define __NR_setresgid 169
-#define __NR_getresgid 170
-#endif
-#ifndef __NR_rt_sigaction
-#define __NR_rt_sigreturn 172
-#define __NR_rt_sigaction 173
-#define __NR_rt_sigprocmask 174
-#define __NR_rt_sigpending 175
-#define __NR_rt_sigsuspend 178
-#endif
-#ifndef __NR_pread64
-#define __NR_pread64 179
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 180
-#endif
-#ifndef __NR_ugetrlimit
-#define __NR_ugetrlimit 190
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead 191
-#endif
-#ifndef __NR_stat64
-#define __NR_stat64 195
-#endif
-#ifndef __NR_fstat64
-#define __NR_fstat64 197
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 202
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid 207
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill 208
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr 209
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr 210
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr 212
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr 213
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr 215
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr 216
-#endif
-#ifndef __NR_futex
-#define __NR_futex 221
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 222
-#define __NR_sched_getaffinity 223
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address 232
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime 246
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres 247
-#endif
-#ifndef __NR_statfs64
-#define __NR_statfs64 252
-#endif
-#ifndef __NR_fstatfs64
-#define __NR_fstatfs64 253
-#endif
-#ifndef __NR_fadvise64_64
-#define __NR_fadvise64_64 254
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set 273
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get 274
-#endif
-#ifndef __NR_openat
-#define __NR_openat 286
-#endif
-#ifndef __NR_fstatat64
-#define __NR_fstatat64 291
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat 292
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages 301
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu 302
-#endif
-/* End of powerpc defininitions */
-#elif defined(__s390__)
-#ifndef __NR_quotactl
-#define __NR_quotactl 131
-#endif
-#ifndef __NR_rt_sigreturn
-#define __NR_rt_sigreturn 173
-#endif
-#ifndef __NR_rt_sigaction
-#define __NR_rt_sigaction 174
-#endif
-#ifndef __NR_rt_sigprocmask
-#define __NR_rt_sigprocmask 175
-#endif
-#ifndef __NR_rt_sigpending
-#define __NR_rt_sigpending 176
-#endif
-#ifndef __NR_rt_sigsuspend
-#define __NR_rt_sigsuspend 179
-#endif
-#ifndef __NR_pread64
-#define __NR_pread64 180
-#endif
-#ifndef __NR_pwrite64
-#define __NR_pwrite64 181
-#endif
-#ifndef __NR_getdents64
-#define __NR_getdents64 220
-#endif
-#ifndef __NR_readahead
-#define __NR_readahead 222
-#endif
-#ifndef __NR_setxattr
-#define __NR_setxattr 224
-#endif
-#ifndef __NR_lsetxattr
-#define __NR_lsetxattr 225
-#endif
-#ifndef __NR_getxattr
-#define __NR_getxattr 227
-#endif
-#ifndef __NR_lgetxattr
-#define __NR_lgetxattr 228
-#endif
-#ifndef __NR_listxattr
-#define __NR_listxattr 230
-#endif
-#ifndef __NR_llistxattr
-#define __NR_llistxattr 231
-#endif
-#ifndef __NR_gettid
-#define __NR_gettid 236
-#endif
-#ifndef __NR_tkill
-#define __NR_tkill 237
-#endif
-#ifndef __NR_futex
-#define __NR_futex 238
-#endif
-#ifndef __NR_sched_setaffinity
-#define __NR_sched_setaffinity 239
-#endif
-#ifndef __NR_sched_getaffinity
-#define __NR_sched_getaffinity 240
-#endif
-#ifndef __NR_set_tid_address
-#define __NR_set_tid_address 252
-#endif
-#ifndef __NR_clock_gettime
-#define __NR_clock_gettime 260
-#endif
-#ifndef __NR_clock_getres
-#define __NR_clock_getres 261
-#endif
-#ifndef __NR_statfs64
-#define __NR_statfs64 265
-#endif
-#ifndef __NR_fstatfs64
-#define __NR_fstatfs64 266
-#endif
-#ifndef __NR_ioprio_set
-#define __NR_ioprio_set 282
-#endif
-#ifndef __NR_ioprio_get
-#define __NR_ioprio_get 283
-#endif
-#ifndef __NR_openat
-#define __NR_openat 288
-#endif
-#ifndef __NR_unlinkat
-#define __NR_unlinkat 294
-#endif
-#ifndef __NR_move_pages
-#define __NR_move_pages 310
-#endif
-#ifndef __NR_getcpu
-#define __NR_getcpu 311
-#endif
-#ifndef __NR_fallocate
-#define __NR_fallocate 314
-#endif
-/* Some syscalls are named/numbered differently between s390 and s390x. */
-#ifdef __s390x__
-# ifndef __NR_getrlimit
-# define __NR_getrlimit 191
-# endif
-# ifndef __NR_setresuid
-# define __NR_setresuid 208
-# endif
-# ifndef __NR_getresuid
-# define __NR_getresuid 209
-# endif
-# ifndef __NR_setresgid
-# define __NR_setresgid 210
-# endif
-# ifndef __NR_getresgid
-# define __NR_getresgid 211
-# endif
-# ifndef __NR_setfsuid
-# define __NR_setfsuid 215
-# endif
-# ifndef __NR_setfsgid
-# define __NR_setfsgid 216
-# endif
-# ifndef __NR_fadvise64
-# define __NR_fadvise64 253
-# endif
-# ifndef __NR_newfstatat
-# define __NR_newfstatat 293
-# endif
-#else /* __s390x__ */
-# ifndef __NR_getrlimit
-# define __NR_getrlimit 76
-# endif
-# ifndef __NR_setfsuid
-# define __NR_setfsuid 138
-# endif
-# ifndef __NR_setfsgid
-# define __NR_setfsgid 139
-# endif
-# ifndef __NR_setresuid
-# define __NR_setresuid 164
-# endif
-# ifndef __NR_getresuid
-# define __NR_getresuid 165
-# endif
-# ifndef __NR_setresgid
-# define __NR_setresgid 170
-# endif
-# ifndef __NR_getresgid
-# define __NR_getresgid 171
-# endif
-# ifndef __NR_ugetrlimit
-# define __NR_ugetrlimit 191
-# endif
-# ifndef __NR_mmap2
-# define __NR_mmap2 192
-# endif
-# ifndef __NR_setresuid32
-# define __NR_setresuid32 208
-# endif
-# ifndef __NR_getresuid32
-# define __NR_getresuid32 209
-# endif
-# ifndef __NR_setresgid32
-# define __NR_setresgid32 210
-# endif
-# ifndef __NR_getresgid32
-# define __NR_getresgid32 211
-# endif
-# ifndef __NR_setfsuid32
-# define __NR_setfsuid32 215
-# endif
-# ifndef __NR_setfsgid32
-# define __NR_setfsgid32 216
-# endif
-# ifndef __NR_fadvise64_64
-# define __NR_fadvise64_64 264
-# endif
-# ifndef __NR_fstatat64
-# define __NR_fstatat64 293
-# endif
-#endif /* __s390__ */
-/* End of s390/s390x definitions */
-#endif
-
-
-/* After forking, we must make sure to only call system calls. */
-#if defined(__BOUNDED_POINTERS__)
- #error "Need to port invocations of syscalls for bounded ptrs"
-#else
- /* The core dumper and the thread lister get executed after threads
- * have been suspended. As a consequence, we cannot call any functions
- * that acquire locks. Unfortunately, libc wraps most system calls
- * (e.g. in order to implement pthread_atfork, and to make calls
- * cancellable), which means we cannot call these functions. Instead,
- * we have to call syscall() directly.
- */
- #undef LSS_ERRNO
- #ifdef SYS_ERRNO
- /* Allow the including file to override the location of errno. This can
- * be useful when using clone() with the CLONE_VM option.
- */
- #define LSS_ERRNO SYS_ERRNO
- #else
- #define LSS_ERRNO errno
- #endif
-
- #undef LSS_INLINE
- #ifdef SYS_INLINE
- #define LSS_INLINE SYS_INLINE
- #else
- #define LSS_INLINE static inline
- #endif
-
- /* Allow the including file to override the prefix used for all new
- * system calls. By default, it will be set to "sys_".
- */
- #undef LSS_NAME
- #ifndef SYS_PREFIX
- #define LSS_NAME(name) sys_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX < 0
- #define LSS_NAME(name) name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 0
- #define LSS_NAME(name) sys0_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 1
- #define LSS_NAME(name) sys1_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 2
- #define LSS_NAME(name) sys2_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 3
- #define LSS_NAME(name) sys3_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 4
- #define LSS_NAME(name) sys4_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 5
- #define LSS_NAME(name) sys5_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 6
- #define LSS_NAME(name) sys6_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 7
- #define LSS_NAME(name) sys7_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 8
- #define LSS_NAME(name) sys8_##name
- #elif defined(SYS_PREFIX) && SYS_PREFIX == 9
- #define LSS_NAME(name) sys9_##name
- #endif
-
- #undef LSS_RETURN
- #if (defined(__i386__) || defined(__x86_64__) || defined(__ARM_ARCH_3__) \
- || defined(__ARM_EABI__) || defined(__aarch64__) || defined(__s390__))
- /* Failing system calls return a negative result in the range of
- * -1..-4095. These are "errno" values with the sign inverted.
- */
- #define LSS_RETURN(type, res) \
- do { \
- if ((unsigned long)(res) >= (unsigned long)(-4095)) { \
- LSS_ERRNO = -(res); \
- res = -1; \
- } \
- return (type) (res); \
- } while (0)
- #elif defined(__mips__)
- /* On MIPS, failing system calls return -1, and set errno in a
- * separate CPU register.
- */
- #define LSS_RETURN(type, res, err) \
- do { \
- if (err) { \
- unsigned long __errnovalue = (res); \
- LSS_ERRNO = __errnovalue; \
- res = -1; \
- } \
- return (type) (res); \
- } while (0)
- #elif defined(__PPC__)
- /* On PPC, failing system calls return -1, and set errno in a
- * separate CPU register. See linux/unistd.h.
- */
- #define LSS_RETURN(type, res, err) \
- do { \
- if (err & 0x10000000 ) { \
- LSS_ERRNO = (res); \
- res = -1; \
- } \
- return (type) (res); \
- } while (0)
- #endif
- #if defined(__i386__)
- /* In PIC mode (e.g. when building shared libraries), gcc for i386
- * reserves ebx. Unfortunately, most distribution ship with implementations
- * of _syscallX() which clobber ebx.
- * Also, most definitions of _syscallX() neglect to mark "memory" as being
- * clobbered. This causes problems with compilers, that do a better job
- * at optimizing across __asm__ calls.
- * So, we just have to redefine all of the _syscallX() macros.
- */
- #undef LSS_ENTRYPOINT
- #ifdef SYS_SYSCALL_ENTRYPOINT
- static inline void (**LSS_NAME(get_syscall_entrypoint)(void))(void) {
- void (**entrypoint)(void);
- asm volatile(".bss\n"
- ".align 8\n"
- ".globl " SYS_SYSCALL_ENTRYPOINT "\n"
- ".common " SYS_SYSCALL_ENTRYPOINT ",8,8\n"
- ".previous\n"
- /* This logically does 'lea "SYS_SYSCALL_ENTRYPOINT", %0' */
- "call 0f\n"
- "0:pop %0\n"
- "add $_GLOBAL_OFFSET_TABLE_+[.-0b], %0\n"
- "mov " SYS_SYSCALL_ENTRYPOINT "@GOT(%0), %0\n"
- : "=r"(entrypoint));
- return entrypoint;
- }
-
- #define LSS_ENTRYPOINT ".bss\n" \
- ".align 8\n" \
- ".globl " SYS_SYSCALL_ENTRYPOINT "\n" \
- ".common " SYS_SYSCALL_ENTRYPOINT ",8,8\n" \
- ".previous\n" \
- /* Check the SYS_SYSCALL_ENTRYPOINT vector */ \
- "push %%eax\n" \
- "call 10000f\n" \
- "10000:pop %%eax\n" \
- "add $_GLOBAL_OFFSET_TABLE_+[.-10000b], %%eax\n" \
- "mov " SYS_SYSCALL_ENTRYPOINT \
- "@GOT(%%eax), %%eax\n" \
- "mov 0(%%eax), %%eax\n" \
- "test %%eax, %%eax\n" \
- "jz 10002f\n" \
- "push %%eax\n" \
- "call 10001f\n" \
- "10001:pop %%eax\n" \
- "add $(10003f-10001b), %%eax\n" \
- "xchg 4(%%esp), %%eax\n" \
- "ret\n" \
- "10002:pop %%eax\n" \
- "int $0x80\n" \
- "10003:\n"
- #else
- #define LSS_ENTRYPOINT "int $0x80\n"
- #endif
- #undef LSS_BODY
- #define LSS_BODY(type,args...) \
- long __res; \
- __asm__ __volatile__("push %%ebx\n" \
- "movl %2,%%ebx\n" \
- LSS_ENTRYPOINT \
- "pop %%ebx" \
- args \
- : "esp", "memory"); \
- LSS_RETURN(type,__res)
- #undef _syscall0
- #define _syscall0(type,name) \
- type LSS_NAME(name)(void) { \
- long __res; \
- __asm__ volatile(LSS_ENTRYPOINT \
- : "=a" (__res) \
- : "0" (__NR_##name) \
- : "esp", "memory"); \
- LSS_RETURN(type,__res); \
- }
- #undef _syscall1
- #define _syscall1(type,name,type1,arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_BODY(type, \
- : "=a" (__res) \
- : "0" (__NR_##name), "ri" ((long)(arg1))); \
- }
- #undef _syscall2
- #define _syscall2(type,name,type1,arg1,type2,arg2) \
- type LSS_NAME(name)(type1 arg1,type2 arg2) { \
- LSS_BODY(type, \
- : "=a" (__res) \
- : "0" (__NR_##name),"ri" ((long)(arg1)), "c" ((long)(arg2))); \
- }
- #undef _syscall3
- #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
- type LSS_NAME(name)(type1 arg1,type2 arg2,type3 arg3) { \
- LSS_BODY(type, \
- : "=a" (__res) \
- : "0" (__NR_##name), "ri" ((long)(arg1)), "c" ((long)(arg2)), \
- "d" ((long)(arg3))); \
- }
- #undef _syscall4
- #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_BODY(type, \
- : "=a" (__res) \
- : "0" (__NR_##name), "ri" ((long)(arg1)), "c" ((long)(arg2)), \
- "d" ((long)(arg3)),"S" ((long)(arg4))); \
- }
- #undef _syscall5
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- long __res; \
- __asm__ __volatile__("push %%ebx\n" \
- "movl %2,%%ebx\n" \
- "movl %1,%%eax\n" \
- LSS_ENTRYPOINT \
- "pop %%ebx" \
- : "=a" (__res) \
- : "i" (__NR_##name), "ri" ((long)(arg1)), \
- "c" ((long)(arg2)), "d" ((long)(arg3)), \
- "S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
- LSS_RETURN(type,__res); \
- }
- #undef _syscall6
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- long __res; \
- struct { long __a1; long __a6; } __s = { (long)arg1, (long) arg6 }; \
- __asm__ __volatile__("push %%ebp\n" \
- "push %%ebx\n" \
- "movl 4(%2),%%ebp\n" \
- "movl 0(%2), %%ebx\n" \
- "movl %1,%%eax\n" \
- LSS_ENTRYPOINT \
- "pop %%ebx\n" \
- "pop %%ebp" \
- : "=a" (__res) \
- : "i" (__NR_##name), "0" ((long)(&__s)), \
- "c" ((long)(arg2)), "d" ((long)(arg3)), \
- "S" ((long)(arg4)), "D" ((long)(arg5)) \
- : "esp", "memory"); \
- LSS_RETURN(type,__res); \
- }
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- long __res;
- __asm__ __volatile__(/* if (fn == NULL)
- * return -EINVAL;
- */
- "movl %3,%%ecx\n"
- "jecxz 1f\n"
-
- /* if (child_stack == NULL)
- * return -EINVAL;
- */
- "movl %4,%%ecx\n"
- "jecxz 1f\n"
-
- /* Set up alignment of the child stack:
- * child_stack = (child_stack & ~0xF) - 20;
- */
- "andl $-16,%%ecx\n"
- "subl $20,%%ecx\n"
-
- /* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- "movl %6,%%eax\n"
- "movl %%eax,4(%%ecx)\n"
- "movl %3,%%eax\n"
- "movl %%eax,(%%ecx)\n"
-
- /* %eax = syscall(%eax = __NR_clone,
- * %ebx = flags,
- * %ecx = child_stack,
- * %edx = parent_tidptr,
- * %esi = newtls,
- * %edi = child_tidptr)
- * Also, make sure that %ebx gets preserved as it is
- * used in PIC mode.
- */
- "movl %8,%%esi\n"
- "movl %7,%%edx\n"
- "movl %5,%%eax\n"
- "movl %9,%%edi\n"
- "pushl %%ebx\n"
- "movl %%eax,%%ebx\n"
- "movl %2,%%eax\n"
- LSS_ENTRYPOINT
-
- /* In the parent: restore %ebx
- * In the child: move "fn" into %ebx
- */
- "popl %%ebx\n"
-
- /* if (%eax != 0)
- * return %eax;
- */
- "test %%eax,%%eax\n"
- "jnz 1f\n"
-
- /* In the child, now. Terminate frame pointer chain.
- */
- "movl $0,%%ebp\n"
-
- /* Call "fn". "arg" is already on the stack.
- */
- "call *%%ebx\n"
-
- /* Call _exit(%ebx). Unfortunately older versions
- * of gcc restrict the number of arguments that can
- * be passed to asm(). So, we need to hard-code the
- * system call number.
- */
- "movl %%eax,%%ebx\n"
- "movl $1,%%eax\n"
- LSS_ENTRYPOINT
-
- /* Return to parent.
- */
- "1:\n"
- : "=a" (__res)
- : "0"(-EINVAL), "i"(__NR_clone),
- "m"(fn), "m"(child_stack), "m"(flags), "m"(arg),
- "m"(parent_tidptr), "m"(newtls), "m"(child_tidptr)
- : "esp", "memory", "ecx", "edx", "esi", "edi");
- LSS_RETURN(int, __res);
- }
-
- LSS_INLINE _syscall1(int, set_thread_area, void *, u)
- LSS_INLINE _syscall1(int, get_thread_area, void *, u)
-
- LSS_INLINE void (*LSS_NAME(restore_rt)(void))(void) {
- /* On i386, the kernel does not know how to return from a signal
- * handler. Instead, it relies on user space to provide a
- * restorer function that calls the {rt_,}sigreturn() system call.
- * Unfortunately, we cannot just reference the glibc version of this
- * function, as glibc goes out of its way to make it inaccessible.
- */
- void (*res)(void);
- __asm__ __volatile__("call 2f\n"
- "0:.align 16\n"
- "1:movl %1,%%eax\n"
- LSS_ENTRYPOINT
- "2:popl %0\n"
- "addl $(1b-0b),%0\n"
- : "=a" (res)
- : "i" (__NR_rt_sigreturn));
- return res;
- }
- LSS_INLINE void (*LSS_NAME(restore)(void))(void) {
- /* On i386, the kernel does not know how to return from a signal
- * handler. Instead, it relies on user space to provide a
- * restorer function that calls the {rt_,}sigreturn() system call.
- * Unfortunately, we cannot just reference the glibc version of this
- * function, as glibc goes out of its way to make it inaccessible.
- */
- void (*res)(void);
- __asm__ __volatile__("call 2f\n"
- "0:.align 16\n"
- "1:pop %%eax\n"
- "movl %1,%%eax\n"
- LSS_ENTRYPOINT
- "2:popl %0\n"
- "addl $(1b-0b),%0\n"
- : "=a" (res)
- : "i" (__NR_sigreturn));
- return res;
- }
- #elif defined(__x86_64__)
- /* There are no known problems with any of the _syscallX() macros
- * currently shipping for x86_64, but we still need to be able to define
- * our own version so that we can override the location of the errno
- * location (e.g. when using the clone() system call with the CLONE_VM
- * option).
- */
- #undef LSS_ENTRYPOINT
- #ifdef SYS_SYSCALL_ENTRYPOINT
- static inline void (**LSS_NAME(get_syscall_entrypoint)(void))(void) {
- void (**entrypoint)(void);
- asm volatile(".bss\n"
- ".align 8\n"
- ".globl " SYS_SYSCALL_ENTRYPOINT "\n"
- ".common " SYS_SYSCALL_ENTRYPOINT ",8,8\n"
- ".previous\n"
- "mov " SYS_SYSCALL_ENTRYPOINT "@GOTPCREL(%%rip), %0\n"
- : "=r"(entrypoint));
- return entrypoint;
- }
-
- #define LSS_ENTRYPOINT \
- ".bss\n" \
- ".align 8\n" \
- ".globl " SYS_SYSCALL_ENTRYPOINT "\n" \
- ".common " SYS_SYSCALL_ENTRYPOINT ",8,8\n" \
- ".previous\n" \
- "mov " SYS_SYSCALL_ENTRYPOINT "@GOTPCREL(%%rip), %%rcx\n" \
- "mov 0(%%rcx), %%rcx\n" \
- "test %%rcx, %%rcx\n" \
- "jz 10001f\n" \
- "call *%%rcx\n" \
- "jmp 10002f\n" \
- "10001:syscall\n" \
- "10002:\n"
-
- #else
- #define LSS_ENTRYPOINT "syscall\n"
- #endif
-
- /* The x32 ABI has 32 bit longs, but the syscall interface is 64 bit.
- * We need to explicitly cast to an unsigned 64 bit type to avoid implicit
- * sign extension. We can't cast pointers directly because those are
- * 32 bits, and gcc will dump ugly warnings about casting from a pointer
- * to an integer of a different size.
- */
- #undef LSS_SYSCALL_ARG
- #define LSS_SYSCALL_ARG(a) ((uint64_t)(uintptr_t)(a))
- #undef _LSS_RETURN
- #define _LSS_RETURN(type, res, cast) \
- do { \
- if ((uint64_t)(res) >= (uint64_t)(-4095)) { \
- LSS_ERRNO = -(res); \
- res = -1; \
- } \
- return (type)(cast)(res); \
- } while (0)
- #undef LSS_RETURN
- #define LSS_RETURN(type, res) _LSS_RETURN(type, res, uintptr_t)
-
- #undef _LSS_BODY
- #define _LSS_BODY(nr, type, name, cast, ...) \
- long long __res; \
- __asm__ __volatile__(LSS_BODY_ASM##nr LSS_ENTRYPOINT \
- : "=a" (__res) \
- : "0" (__NR_##name) LSS_BODY_ARG##nr(__VA_ARGS__) \
- : LSS_BODY_CLOBBER##nr "r11", "rcx", "memory"); \
- _LSS_RETURN(type, __res, cast)
- #undef LSS_BODY
- #define LSS_BODY(nr, type, name, args...) \
- _LSS_BODY(nr, type, name, uintptr_t, ## args)
-
- #undef LSS_BODY_ASM0
- #undef LSS_BODY_ASM1
- #undef LSS_BODY_ASM2
- #undef LSS_BODY_ASM3
- #undef LSS_BODY_ASM4
- #undef LSS_BODY_ASM5
- #undef LSS_BODY_ASM6
- #define LSS_BODY_ASM0
- #define LSS_BODY_ASM1 LSS_BODY_ASM0
- #define LSS_BODY_ASM2 LSS_BODY_ASM1
- #define LSS_BODY_ASM3 LSS_BODY_ASM2
- #define LSS_BODY_ASM4 LSS_BODY_ASM3 "movq %5,%%r10;"
- #define LSS_BODY_ASM5 LSS_BODY_ASM4 "movq %6,%%r8;"
- #define LSS_BODY_ASM6 LSS_BODY_ASM5 "movq %7,%%r9;"
-
- #undef LSS_BODY_CLOBBER0
- #undef LSS_BODY_CLOBBER1
- #undef LSS_BODY_CLOBBER2
- #undef LSS_BODY_CLOBBER3
- #undef LSS_BODY_CLOBBER4
- #undef LSS_BODY_CLOBBER5
- #undef LSS_BODY_CLOBBER6
- #define LSS_BODY_CLOBBER0
- #define LSS_BODY_CLOBBER1 LSS_BODY_CLOBBER0
- #define LSS_BODY_CLOBBER2 LSS_BODY_CLOBBER1
- #define LSS_BODY_CLOBBER3 LSS_BODY_CLOBBER2
- #define LSS_BODY_CLOBBER4 LSS_BODY_CLOBBER3 "r10",
- #define LSS_BODY_CLOBBER5 LSS_BODY_CLOBBER4 "r8",
- #define LSS_BODY_CLOBBER6 LSS_BODY_CLOBBER5 "r9",
-
- #undef LSS_BODY_ARG0
- #undef LSS_BODY_ARG1
- #undef LSS_BODY_ARG2
- #undef LSS_BODY_ARG3
- #undef LSS_BODY_ARG4
- #undef LSS_BODY_ARG5
- #undef LSS_BODY_ARG6
- #define LSS_BODY_ARG0()
- #define LSS_BODY_ARG1(arg1) \
- LSS_BODY_ARG0(), "D" (arg1)
- #define LSS_BODY_ARG2(arg1, arg2) \
- LSS_BODY_ARG1(arg1), "S" (arg2)
- #define LSS_BODY_ARG3(arg1, arg2, arg3) \
- LSS_BODY_ARG2(arg1, arg2), "d" (arg3)
- #define LSS_BODY_ARG4(arg1, arg2, arg3, arg4) \
- LSS_BODY_ARG3(arg1, arg2, arg3), "r" (arg4)
- #define LSS_BODY_ARG5(arg1, arg2, arg3, arg4, arg5) \
- LSS_BODY_ARG4(arg1, arg2, arg3, arg4), "r" (arg5)
- #define LSS_BODY_ARG6(arg1, arg2, arg3, arg4, arg5, arg6) \
- LSS_BODY_ARG5(arg1, arg2, arg3, arg4, arg5), "r" (arg6)
-
- #undef _syscall0
- #define _syscall0(type,name) \
- type LSS_NAME(name)(void) { \
- LSS_BODY(0, type, name); \
- }
- #undef _syscall1
- #define _syscall1(type,name,type1,arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_BODY(1, type, name, LSS_SYSCALL_ARG(arg1)); \
- }
- #undef _syscall2
- #define _syscall2(type,name,type1,arg1,type2,arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- LSS_BODY(2, type, name, LSS_SYSCALL_ARG(arg1), LSS_SYSCALL_ARG(arg2));\
- }
- #undef _syscall3
- #define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- LSS_BODY(3, type, name, LSS_SYSCALL_ARG(arg1), LSS_SYSCALL_ARG(arg2), \
- LSS_SYSCALL_ARG(arg3)); \
- }
- #undef _syscall4
- #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_BODY(4, type, name, LSS_SYSCALL_ARG(arg1), LSS_SYSCALL_ARG(arg2), \
- LSS_SYSCALL_ARG(arg3), LSS_SYSCALL_ARG(arg4));\
- }
- #undef _syscall5
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_BODY(5, type, name, LSS_SYSCALL_ARG(arg1), LSS_SYSCALL_ARG(arg2), \
- LSS_SYSCALL_ARG(arg3), LSS_SYSCALL_ARG(arg4), \
- LSS_SYSCALL_ARG(arg5)); \
- }
- #undef _syscall6
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- LSS_BODY(6, type, name, LSS_SYSCALL_ARG(arg1), LSS_SYSCALL_ARG(arg2), \
- LSS_SYSCALL_ARG(arg3), LSS_SYSCALL_ARG(arg4), \
- LSS_SYSCALL_ARG(arg5), LSS_SYSCALL_ARG(arg6));\
- }
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- long long __res;
- {
- __asm__ __volatile__(/* if (fn == NULL)
- * return -EINVAL;
- */
- "testq %4,%4\n"
- "jz 1f\n"
-
- /* if (child_stack == NULL)
- * return -EINVAL;
- */
- "testq %5,%5\n"
- "jz 1f\n"
-
- /* childstack -= 2*sizeof(void *);
- */
- "subq $16,%5\n"
-
- /* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- "movq %7,8(%5)\n"
- "movq %4,0(%5)\n"
-
- /* %rax = syscall(%rax = __NR_clone,
- * %rdi = flags,
- * %rsi = child_stack,
- * %rdx = parent_tidptr,
- * %r8 = new_tls,
- * %r10 = child_tidptr)
- */
- "movq %2,%%rax\n"
- "movq %9,%%r8\n"
- "movq %10,%%r10\n"
- LSS_ENTRYPOINT
-
- /* if (%rax != 0)
- * return;
- */
- "testq %%rax,%%rax\n"
- "jnz 1f\n"
-
- /* In the child. Terminate frame pointer chain.
- */
- "xorq %%rbp,%%rbp\n"
-
- /* Call "fn(arg)".
- */
- "popq %%rax\n"
- "popq %%rdi\n"
- "call *%%rax\n"
-
- /* Call _exit(%ebx).
- */
- "movq %%rax,%%rdi\n"
- "movq %3,%%rax\n"
- LSS_ENTRYPOINT
-
- /* Return to parent.
- */
- "1:\n"
- : "=a" (__res)
- : "0"(-EINVAL), "i"(__NR_clone), "i"(__NR_exit),
- "r"(LSS_SYSCALL_ARG(fn)),
- "S"(LSS_SYSCALL_ARG(child_stack)),
- "D"(LSS_SYSCALL_ARG(flags)),
- "r"(LSS_SYSCALL_ARG(arg)),
- "d"(LSS_SYSCALL_ARG(parent_tidptr)),
- "r"(LSS_SYSCALL_ARG(newtls)),
- "r"(LSS_SYSCALL_ARG(child_tidptr))
- : "rsp", "memory", "r8", "r10", "r11", "rcx");
- }
- LSS_RETURN(int, __res);
- }
- LSS_INLINE _syscall2(int, arch_prctl, int, c, void *, a)
-
- LSS_INLINE void (*LSS_NAME(restore_rt)(void))(void) {
- /* On x86-64, the kernel does not know how to return from
- * a signal handler. Instead, it relies on user space to provide a
- * restorer function that calls the rt_sigreturn() system call.
- * Unfortunately, we cannot just reference the glibc version of this
- * function, as glibc goes out of its way to make it inaccessible.
- */
- long long res;
- __asm__ __volatile__("jmp 2f\n"
- ".align 16\n"
- "1:movq %1,%%rax\n"
- LSS_ENTRYPOINT
- "2:leaq 1b(%%rip),%0\n"
- : "=r" (res)
- : "i" (__NR_rt_sigreturn));
- return (void (*)(void))(uintptr_t)res;
- }
- #elif defined(__ARM_ARCH_3__)
- /* Most definitions of _syscallX() neglect to mark "memory" as being
- * clobbered. This causes problems with compilers, that do a better job
- * at optimizing across __asm__ calls.
- * So, we just have to redefine all of the _syscallX() macros.
- */
- #undef LSS_REG
- #define LSS_REG(r,a) register long __r##r __asm__("r"#r) = (long)a
- #undef LSS_BODY
- #define LSS_BODY(type,name,args...) \
- register long __res_r0 __asm__("r0"); \
- long __res; \
- __asm__ __volatile__ (__syscall(name) \
- : "=r"(__res_r0) : args : "lr", "memory"); \
- __res = __res_r0; \
- LSS_RETURN(type, __res)
- #undef _syscall0
- #define _syscall0(type, name) \
- type LSS_NAME(name)(void) { \
- LSS_BODY(type, name); \
- }
- #undef _syscall1
- #define _syscall1(type, name, type1, arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_REG(0, arg1); LSS_BODY(type, name, "r"(__r0)); \
- }
- #undef _syscall2
- #define _syscall2(type, name, type1, arg1, type2, arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1)); \
- }
- #undef _syscall3
- #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2)); \
- }
- #undef _syscall4
- #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3)); \
- }
- #undef _syscall5
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); LSS_REG(4, arg5); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \
- "r"(__r4)); \
- }
- #undef _syscall6
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); LSS_REG(4, arg5); LSS_REG(5, arg6); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \
- "r"(__r4), "r"(__r5)); \
- }
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- long __res;
- {
- register int __flags __asm__("r0") = flags;
- register void *__stack __asm__("r1") = child_stack;
- register void *__ptid __asm__("r2") = parent_tidptr;
- register void *__tls __asm__("r3") = newtls;
- register int *__ctid __asm__("r4") = child_tidptr;
- __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL)
- * return -EINVAL;
- */
- "cmp %2,#0\n"
- "cmpne %3,#0\n"
- "moveq %0,%1\n"
- "beq 1f\n"
-
- /* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- "str %5,[%3,#-4]!\n"
- "str %2,[%3,#-4]!\n"
-
- /* %r0 = syscall(%r0 = flags,
- * %r1 = child_stack,
- * %r2 = parent_tidptr,
- * %r3 = newtls,
- * %r4 = child_tidptr)
- */
- __syscall(clone)"\n"
-
- /* if (%r0 != 0)
- * return %r0;
- */
- "movs %0,r0\n"
- "bne 1f\n"
-
- /* In the child, now. Call "fn(arg)".
- */
- "ldr r0,[sp, #4]\n"
- "mov lr,pc\n"
- "ldr pc,[sp]\n"
-
- /* Call _exit(%r0).
- */
- __syscall(exit)"\n"
- "1:\n"
- : "=r" (__res)
- : "i"(-EINVAL),
- "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
- "r"(__ptid), "r"(__tls), "r"(__ctid)
- : "cc", "lr", "memory");
- }
- LSS_RETURN(int, __res);
- }
- #elif defined(__ARM_EABI__)
- /* Most definitions of _syscallX() neglect to mark "memory" as being
- * clobbered. This causes problems with compilers, that do a better job
- * at optimizing across __asm__ calls.
- * So, we just have to redefine all fo the _syscallX() macros.
- */
- #undef LSS_REG
- #define LSS_REG(r,a) register long __r##r __asm__("r"#r) = (long)a
- #undef LSS_BODY
- #define LSS_BODY(type,name,args...) \
- register long __res_r0 __asm__("r0"); \
- long __res; \
- __asm__ __volatile__ ("push {r7}\n" \
- "mov r7, %1\n" \
- "swi 0x0\n" \
- "pop {r7}\n" \
- : "=r"(__res_r0) \
- : "i"(__NR_##name) , ## args \
- : "lr", "memory"); \
- __res = __res_r0; \
- LSS_RETURN(type, __res)
- #undef _syscall0
- #define _syscall0(type, name) \
- type LSS_NAME(name)(void) { \
- LSS_BODY(type, name); \
- }
- #undef _syscall1
- #define _syscall1(type, name, type1, arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_REG(0, arg1); LSS_BODY(type, name, "r"(__r0)); \
- }
- #undef _syscall2
- #define _syscall2(type, name, type1, arg1, type2, arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1)); \
- }
- #undef _syscall3
- #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2)); \
- }
- #undef _syscall4
- #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3)); \
- }
- #undef _syscall5
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); LSS_REG(4, arg5); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \
- "r"(__r4)); \
- }
- #undef _syscall6
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); LSS_REG(4, arg5); LSS_REG(5, arg6); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \
- "r"(__r4), "r"(__r5)); \
- }
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- long __res;
- {
- register int __flags __asm__("r0") = flags;
- register void *__stack __asm__("r1") = child_stack;
- register void *__ptid __asm__("r2") = parent_tidptr;
- register void *__tls __asm__("r3") = newtls;
- register int *__ctid __asm__("r4") = child_tidptr;
- __asm__ __volatile__(/* if (fn == NULL || child_stack == NULL)
- * return -EINVAL;
- */
- "cmp %2,#0\n"
- "it ne\n"
- "cmpne %3,#0\n"
- "it eq\n"
- "moveq %0,%1\n"
- "beq 1f\n"
-
- /* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- "str %5,[%3,#-4]!\n"
- "str %2,[%3,#-4]!\n"
-
- /* %r0 = syscall(%r0 = flags,
- * %r1 = child_stack,
- * %r2 = parent_tidptr,
- * %r3 = newtls,
- * %r4 = child_tidptr)
- */
- "mov r7, %9\n"
- "swi 0x0\n"
-
- /* if (%r0 != 0)
- * return %r0;
- */
- "movs %0,r0\n"
- "bne 1f\n"
-
- /* In the child, now. Call "fn(arg)".
- */
- "ldr r0,[sp, #4]\n"
-
- /* When compiling for Thumb-2 the "MOV LR,PC" here
- * won't work because it loads PC+4 into LR,
- * whereas the LDR is a 4-byte instruction.
- * This results in the child thread always
- * crashing with an "Illegal Instruction" when it
- * returned into the middle of the LDR instruction
- * The instruction sequence used instead was
- * recommended by
- * "https://wiki.edubuntu.org/ARM/Thumb2PortingHowto#Quick_Reference".
- */
- #ifdef __thumb2__
- "ldr r7,[sp]\n"
- "blx r7\n"
- #else
- "mov lr,pc\n"
- "ldr pc,[sp]\n"
- #endif
-
- /* Call _exit(%r0).
- */
- "mov r7, %10\n"
- "swi 0x0\n"
- "1:\n"
- : "=r" (__res)
- : "i"(-EINVAL),
- "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
- "r"(__ptid), "r"(__tls), "r"(__ctid),
- "i"(__NR_clone), "i"(__NR_exit)
- : "cc", "r7", "lr", "memory");
- }
- LSS_RETURN(int, __res);
- }
- #elif defined(__aarch64__)
- /* Most definitions of _syscallX() neglect to mark "memory" as being
- * clobbered. This causes problems with compilers, that do a better job
- * at optimizing across __asm__ calls.
- * So, we just have to redefine all of the _syscallX() macros.
- */
- #undef LSS_REG
- #define LSS_REG(r,a) register int64_t __r##r __asm__("x"#r) = (int64_t)a
- #undef LSS_BODY
- #define LSS_BODY(type,name,args...) \
- register int64_t __res_x0 __asm__("x0"); \
- int64_t __res; \
- __asm__ __volatile__ ("mov x8, %1\n" \
- "svc 0x0\n" \
- : "=r"(__res_x0) \
- : "i"(__NR_##name) , ## args \
- : "x8", "memory"); \
- __res = __res_x0; \
- LSS_RETURN(type, __res)
- #undef _syscall0
- #define _syscall0(type, name) \
- type LSS_NAME(name)(void) { \
- LSS_BODY(type, name); \
- }
- #undef _syscall1
- #define _syscall1(type, name, type1, arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_REG(0, arg1); LSS_BODY(type, name, "r"(__r0)); \
- }
- #undef _syscall2
- #define _syscall2(type, name, type1, arg1, type2, arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1)); \
- }
- #undef _syscall3
- #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2)); \
- }
- #undef _syscall4
- #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3)); \
- }
- #undef _syscall5
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); LSS_REG(4, arg5); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \
- "r"(__r4)); \
- }
- #undef _syscall6
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- LSS_REG(0, arg1); LSS_REG(1, arg2); LSS_REG(2, arg3); \
- LSS_REG(3, arg4); LSS_REG(4, arg5); LSS_REG(5, arg6); \
- LSS_BODY(type, name, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3), \
- "r"(__r4), "r"(__r5)); \
- }
-
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- int64_t __res;
- {
- register uint64_t __flags __asm__("x0") = flags;
- register void *__stack __asm__("x1") = child_stack;
- register void *__ptid __asm__("x2") = parent_tidptr;
- register void *__tls __asm__("x3") = newtls;
- register int *__ctid __asm__("x4") = child_tidptr;
- __asm__ __volatile__(/* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- "stp %1, %4, [%2, #-16]!\n"
-
- /* %x0 = syscall(%x0 = flags,
- * %x1 = child_stack,
- * %x2 = parent_tidptr,
- * %x3 = newtls,
- * %x4 = child_tidptr)
- */
- "mov x8, %8\n"
- "svc 0x0\n"
-
- /* if (%r0 != 0)
- * return %r0;
- */
- "mov %0, x0\n"
- "cbnz x0, 1f\n"
-
- /* In the child, now. Call "fn(arg)".
- */
- "ldp x1, x0, [sp], #16\n"
- "blr x1\n"
-
- /* Call _exit(%r0).
- */
- "mov x8, %9\n"
- "svc 0x0\n"
- "1:\n"
- : "=r" (__res)
- : "r"(fn), "r"(__stack), "r"(__flags), "r"(arg),
- "r"(__ptid), "r"(__tls), "r"(__ctid),
- "i"(__NR_clone), "i"(__NR_exit)
- : "cc", "x8", "memory");
- }
- LSS_RETURN(int, __res);
- }
- #elif defined(__mips__)
- #undef LSS_REG
- #define LSS_REG(r,a) register unsigned long __r##r __asm__("$"#r) = \
- (unsigned long)(a)
- #undef LSS_BODY
- #undef LSS_SYSCALL_CLOBBERS
- #if _MIPS_SIM == _MIPS_SIM_ABI32
- #define LSS_SYSCALL_CLOBBERS "$1", "$3", "$8", "$9", "$10", \
- "$11", "$12", "$13", "$14", "$15", \
- "$24", "$25", "hi", "lo", "memory"
- #else
- #define LSS_SYSCALL_CLOBBERS "$1", "$3", "$10", "$11", "$12", \
- "$13", "$14", "$15", "$24", "$25", \
- "hi", "lo", "memory"
- #endif
- #define LSS_BODY(type,name,r7,...) \
- register unsigned long __v0 __asm__("$2") = __NR_##name; \
- __asm__ __volatile__ ("syscall\n" \
- : "=r"(__v0), r7 (__r7) \
- : "0"(__v0), ##__VA_ARGS__ \
- : LSS_SYSCALL_CLOBBERS); \
- LSS_RETURN(type, __v0, __r7)
- #undef _syscall0
- #define _syscall0(type, name) \
- type LSS_NAME(name)(void) { \
- register unsigned long __r7 __asm__("$7"); \
- LSS_BODY(type, name, "=r"); \
- }
- #undef _syscall1
- #define _syscall1(type, name, type1, arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- register unsigned long __r7 __asm__("$7"); \
- LSS_REG(4, arg1); LSS_BODY(type, name, "=r", "r"(__r4)); \
- }
- #undef _syscall2
- #define _syscall2(type, name, type1, arg1, type2, arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- register unsigned long __r7 __asm__("$7"); \
- LSS_REG(4, arg1); LSS_REG(5, arg2); \
- LSS_BODY(type, name, "=r", "r"(__r4), "r"(__r5)); \
- }
- #undef _syscall3
- #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- register unsigned long __r7 __asm__("$7"); \
- LSS_REG(4, arg1); LSS_REG(5, arg2); LSS_REG(6, arg3); \
- LSS_BODY(type, name, "=r", "r"(__r4), "r"(__r5), "r"(__r6)); \
- }
- #undef _syscall4
- #define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_REG(4, arg1); LSS_REG(5, arg2); LSS_REG(6, arg3); \
- LSS_REG(7, arg4); \
- LSS_BODY(type, name, "+r", "r"(__r4), "r"(__r5), "r"(__r6)); \
- }
- #undef _syscall5
- #if _MIPS_SIM == _MIPS_SIM_ABI32
- /* The old 32bit MIPS system call API passes the fifth and sixth argument
- * on the stack, whereas the new APIs use registers "r8" and "r9".
- */
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_REG(4, arg1); LSS_REG(5, arg2); LSS_REG(6, arg3); \
- LSS_REG(7, arg4); \
- register unsigned long __v0 __asm__("$2") = __NR_##name; \
- __asm__ __volatile__ (".set noreorder\n" \
- "subu $29, 32\n" \
- "sw %5, 16($29)\n" \
- "syscall\n" \
- "addiu $29, 32\n" \
- ".set reorder\n" \
- : "+r"(__v0), "+r" (__r7) \
- : "r"(__r4), "r"(__r5), \
- "r"(__r6), "r" ((unsigned long)arg5) \
- : "$8", "$9", "$10", "$11", "$12", \
- "$13", "$14", "$15", "$24", "$25", \
- "memory"); \
- LSS_RETURN(type, __v0, __r7); \
- }
- #else
- #define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_REG(4, arg1); LSS_REG(5, arg2); LSS_REG(6, arg3); \
- LSS_REG(7, arg4); LSS_REG(8, arg5); \
- LSS_BODY(type, name, "+r", "r"(__r4), "r"(__r5), "r"(__r6), \
- "r"(__r8)); \
- }
- #endif
- #undef _syscall6
- #if _MIPS_SIM == _MIPS_SIM_ABI32
- /* The old 32bit MIPS system call API passes the fifth and sixth argument
- * on the stack, whereas the new APIs use registers "r8" and "r9".
- */
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- LSS_REG(4, arg1); LSS_REG(5, arg2); LSS_REG(6, arg3); \
- LSS_REG(7, arg4); \
- register unsigned long __v0 __asm__("$2") = __NR_##name; \
- __asm__ __volatile__ (".set noreorder\n" \
- "subu $29, 32\n" \
- "sw %5, 16($29)\n" \
- "sw %6, 20($29)\n" \
- "syscall\n" \
- "addiu $29, 32\n" \
- ".set reorder\n" \
- : "+r"(__v0), "+r" (__r7) \
- : "r"(__r4), "r"(__r5), \
- "r"(__r6), "r" ((unsigned long)arg5), \
- "r" ((unsigned long)arg6) \
- : "$8", "$9", "$10", "$11", "$12", \
- "$13", "$14", "$15", "$24", "$25", \
- "memory"); \
- LSS_RETURN(type, __v0, __r7); \
- }
- #else
- #define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
- type5,arg5,type6,arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5,type6 arg6) { \
- LSS_REG(4, arg1); LSS_REG(5, arg2); LSS_REG(6, arg3); \
- LSS_REG(7, arg4); LSS_REG(8, arg5); LSS_REG(9, arg6); \
- LSS_BODY(type, name, "+r", "r"(__r4), "r"(__r5), "r"(__r6), \
- "r"(__r8), "r"(__r9)); \
- }
- #endif
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- register unsigned long __v0 __asm__("$2") = -EINVAL;
- register unsigned long __r7 __asm__("$7") = (unsigned long)newtls;
- {
- register int __flags __asm__("$4") = flags;
- register void *__stack __asm__("$5") = child_stack;
- register void *__ptid __asm__("$6") = parent_tidptr;
- register int *__ctid __asm__("$8") = child_tidptr;
- __asm__ __volatile__(
- #if _MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32
- "subu $29,24\n"
- #elif _MIPS_SIM == _MIPS_SIM_NABI32
- "sub $29,16\n"
- #else
- "dsubu $29,16\n"
- #endif
-
- /* if (fn == NULL || child_stack == NULL)
- * return -EINVAL;
- */
- "beqz %4,1f\n"
- "beqz %5,1f\n"
-
- /* Push "arg" and "fn" onto the stack that will be
- * used by the child.
- */
- #if _MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32
- "subu %5,32\n"
- "sw %4,0(%5)\n"
- "sw %7,4(%5)\n"
- #elif _MIPS_SIM == _MIPS_SIM_NABI32
- "sub %5,32\n"
- "sw %4,0(%5)\n"
- "sw %7,8(%5)\n"
- #else
- "dsubu %5,32\n"
- "sd %4,0(%5)\n"
- "sd %7,8(%5)\n"
- #endif
-
- /* $7 = syscall($4 = flags,
- * $5 = child_stack,
- * $6 = parent_tidptr,
- * $7 = newtls,
- * $8 = child_tidptr)
- */
- "li $2,%2\n"
- "syscall\n"
-
- /* if ($7 != 0)
- * return $2;
- */
- "bnez $7,1f\n"
- "bnez $2,1f\n"
-
- /* In the child, now. Call "fn(arg)".
- */
- #if _MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32
- "lw $25,0($29)\n"
- "lw $4,4($29)\n"
- #elif _MIPS_SIM == _MIPS_SIM_NABI32
- "lw $25,0($29)\n"
- "lw $4,8($29)\n"
- #else
- "ld $25,0($29)\n"
- "ld $4,8($29)\n"
- #endif
- "jalr $25\n"
-
- /* Call _exit($2)
- */
- "move $4,$2\n"
- "li $2,%3\n"
- "syscall\n"
-
- "1:\n"
- #if _MIPS_SIM == _MIPS_SIM_ABI32 && _MIPS_SZPTR == 32
- "addu $29, 24\n"
- #elif _MIPS_SIM == _MIPS_SIM_NABI32
- "add $29, 16\n"
- #else
- "daddu $29,16\n"
- #endif
- : "+r" (__v0), "+r" (__r7)
- : "i"(__NR_clone), "i"(__NR_exit), "r"(fn),
- "r"(__stack), "r"(__flags), "r"(arg),
- "r"(__ptid), "r"(__ctid)
- : "$9", "$10", "$11", "$12", "$13", "$14", "$15",
- "$24", "$25", "memory");
- }
- LSS_RETURN(int, __v0, __r7);
- }
- #elif defined (__PPC__)
- #undef LSS_LOADARGS_0
- #define LSS_LOADARGS_0(name, dummy...) \
- __sc_0 = __NR_##name
- #undef LSS_LOADARGS_1
- #define LSS_LOADARGS_1(name, arg1) \
- LSS_LOADARGS_0(name); \
- __sc_3 = (unsigned long) (arg1)
- #undef LSS_LOADARGS_2
- #define LSS_LOADARGS_2(name, arg1, arg2) \
- LSS_LOADARGS_1(name, arg1); \
- __sc_4 = (unsigned long) (arg2)
- #undef LSS_LOADARGS_3
- #define LSS_LOADARGS_3(name, arg1, arg2, arg3) \
- LSS_LOADARGS_2(name, arg1, arg2); \
- __sc_5 = (unsigned long) (arg3)
- #undef LSS_LOADARGS_4
- #define LSS_LOADARGS_4(name, arg1, arg2, arg3, arg4) \
- LSS_LOADARGS_3(name, arg1, arg2, arg3); \
- __sc_6 = (unsigned long) (arg4)
- #undef LSS_LOADARGS_5
- #define LSS_LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5) \
- LSS_LOADARGS_4(name, arg1, arg2, arg3, arg4); \
- __sc_7 = (unsigned long) (arg5)
- #undef LSS_LOADARGS_6
- #define LSS_LOADARGS_6(name, arg1, arg2, arg3, arg4, arg5, arg6) \
- LSS_LOADARGS_5(name, arg1, arg2, arg3, arg4, arg5); \
- __sc_8 = (unsigned long) (arg6)
- #undef LSS_ASMINPUT_0
- #define LSS_ASMINPUT_0 "0" (__sc_0)
- #undef LSS_ASMINPUT_1
- #define LSS_ASMINPUT_1 LSS_ASMINPUT_0, "1" (__sc_3)
- #undef LSS_ASMINPUT_2
- #define LSS_ASMINPUT_2 LSS_ASMINPUT_1, "2" (__sc_4)
- #undef LSS_ASMINPUT_3
- #define LSS_ASMINPUT_3 LSS_ASMINPUT_2, "3" (__sc_5)
- #undef LSS_ASMINPUT_4
- #define LSS_ASMINPUT_4 LSS_ASMINPUT_3, "4" (__sc_6)
- #undef LSS_ASMINPUT_5
- #define LSS_ASMINPUT_5 LSS_ASMINPUT_4, "5" (__sc_7)
- #undef LSS_ASMINPUT_6
- #define LSS_ASMINPUT_6 LSS_ASMINPUT_5, "6" (__sc_8)
- #undef LSS_BODY
- #define LSS_BODY(nr, type, name, args...) \
- long __sc_ret, __sc_err; \
- { \
- register unsigned long __sc_0 __asm__ ("r0"); \
- register unsigned long __sc_3 __asm__ ("r3"); \
- register unsigned long __sc_4 __asm__ ("r4"); \
- register unsigned long __sc_5 __asm__ ("r5"); \
- register unsigned long __sc_6 __asm__ ("r6"); \
- register unsigned long __sc_7 __asm__ ("r7"); \
- register unsigned long __sc_8 __asm__ ("r8"); \
- \
- LSS_LOADARGS_##nr(name, args); \
- __asm__ __volatile__ \
- ("sc\n\t" \
- "mfcr %0" \
- : "=&r" (__sc_0), \
- "=&r" (__sc_3), "=&r" (__sc_4), \
- "=&r" (__sc_5), "=&r" (__sc_6), \
- "=&r" (__sc_7), "=&r" (__sc_8) \
- : LSS_ASMINPUT_##nr \
- : "cr0", "ctr", "memory", \
- "r9", "r10", "r11", "r12"); \
- __sc_ret = __sc_3; \
- __sc_err = __sc_0; \
- } \
- LSS_RETURN(type, __sc_ret, __sc_err)
- #undef _syscall0
- #define _syscall0(type, name) \
- type LSS_NAME(name)(void) { \
- LSS_BODY(0, type, name); \
- }
- #undef _syscall1
- #define _syscall1(type, name, type1, arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_BODY(1, type, name, arg1); \
- }
- #undef _syscall2
- #define _syscall2(type, name, type1, arg1, type2, arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- LSS_BODY(2, type, name, arg1, arg2); \
- }
- #undef _syscall3
- #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- LSS_BODY(3, type, name, arg1, arg2, arg3); \
- }
- #undef _syscall4
- #define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, \
- type4, arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4) { \
- LSS_BODY(4, type, name, arg1, arg2, arg3, arg4); \
- }
- #undef _syscall5
- #define _syscall5(type, name, type1, arg1, type2, arg2, type3, arg3, \
- type4, arg4, type5, arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5) { \
- LSS_BODY(5, type, name, arg1, arg2, arg3, arg4, arg5); \
- }
- #undef _syscall6
- #define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3, \
- type4, arg4, type5, arg5, type6, arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, type4 arg4, \
- type5 arg5, type6 arg6) { \
- LSS_BODY(6, type, name, arg1, arg2, arg3, arg4, arg5, arg6); \
- }
- /* clone function adapted from glibc 2.3.6 clone.S */
- /* TODO(csilvers): consider wrapping some args up in a struct, like we
- * do for i386's _syscall6, so we can compile successfully on gcc 2.95
- */
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- long __ret, __err;
- {
- register int (*__fn)(void *) __asm__ ("r8") = fn;
- register void *__cstack __asm__ ("r4") = child_stack;
- register int __flags __asm__ ("r3") = flags;
- register void * __arg __asm__ ("r9") = arg;
- register int * __ptidptr __asm__ ("r5") = parent_tidptr;
- register void * __newtls __asm__ ("r6") = newtls;
- register int * __ctidptr __asm__ ("r7") = child_tidptr;
- __asm__ __volatile__(
- /* check for fn == NULL
- * and child_stack == NULL
- */
- "cmpwi cr0, %6, 0\n\t"
- "cmpwi cr1, %7, 0\n\t"
- "cror cr0*4+eq, cr1*4+eq, cr0*4+eq\n\t"
- "beq- cr0, 1f\n\t"
-
- /* set up stack frame for child */
- "clrrwi %7, %7, 4\n\t"
- "li 0, 0\n\t"
- "stwu 0, -16(%7)\n\t"
-
- /* fn, arg, child_stack are saved across the syscall: r28-30 */
- "mr 28, %6\n\t"
- "mr 29, %7\n\t"
- "mr 27, %9\n\t"
-
- /* syscall */
- "li 0, %4\n\t"
- /* flags already in r3
- * child_stack already in r4
- * ptidptr already in r5
- * newtls already in r6
- * ctidptr already in r7
- */
- "sc\n\t"
-
- /* Test if syscall was successful */
- "cmpwi cr1, 3, 0\n\t"
- "crandc cr1*4+eq, cr1*4+eq, cr0*4+so\n\t"
- "bne- cr1, 1f\n\t"
-
- /* Do the function call */
- "mtctr 28\n\t"
- "mr 3, 27\n\t"
- "bctrl\n\t"
-
- /* Call _exit(r3) */
- "li 0, %5\n\t"
- "sc\n\t"
-
- /* Return to parent */
- "1:\n"
- "mfcr %1\n\t"
- "mr %0, 3\n\t"
- : "=r" (__ret), "=r" (__err)
- : "0" (-1), "1" (EINVAL),
- "i" (__NR_clone), "i" (__NR_exit),
- "r" (__fn), "r" (__cstack), "r" (__flags),
- "r" (__arg), "r" (__ptidptr), "r" (__newtls),
- "r" (__ctidptr)
- : "cr0", "cr1", "memory", "ctr",
- "r0", "r29", "r27", "r28");
- }
- LSS_RETURN(int, __ret, __err);
- }
- #elif defined(__s390__)
- #undef LSS_REG
- #define LSS_REG(r, a) register unsigned long __r##r __asm__("r"#r) = (unsigned long) a
- #undef LSS_BODY
- #define LSS_BODY(type, name, args...) \
- register unsigned long __nr __asm__("r1") \
- = (unsigned long)(__NR_##name); \
- register long __res_r2 __asm__("r2"); \
- long __res; \
- __asm__ __volatile__ \
- ("svc 0\n\t" \
- : "=d"(__res_r2) \
- : "d"(__nr), ## args \
- : "memory"); \
- __res = __res_r2; \
- LSS_RETURN(type, __res)
- #undef _syscall0
- #define _syscall0(type, name) \
- type LSS_NAME(name)(void) { \
- LSS_BODY(type, name); \
- }
- #undef _syscall1
- #define _syscall1(type, name, type1, arg1) \
- type LSS_NAME(name)(type1 arg1) { \
- LSS_REG(2, arg1); \
- LSS_BODY(type, name, "0"(__r2)); \
- }
- #undef _syscall2
- #define _syscall2(type, name, type1, arg1, type2, arg2) \
- type LSS_NAME(name)(type1 arg1, type2 arg2) { \
- LSS_REG(2, arg1); LSS_REG(3, arg2); \
- LSS_BODY(type, name, "0"(__r2), "d"(__r3)); \
- }
- #undef _syscall3
- #define _syscall3(type, name, type1, arg1, type2, arg2, type3, arg3) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3) { \
- LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
- LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4)); \
- }
- #undef _syscall4
- #define _syscall4(type, name, type1, arg1, type2, arg2, type3, arg3, \
- type4, arg4) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, \
- type4 arg4) { \
- LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
- LSS_REG(5, arg4); \
- LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4), \
- "d"(__r5)); \
- }
- #undef _syscall5
- #define _syscall5(type, name, type1, arg1, type2, arg2, type3, arg3, \
- type4, arg4, type5, arg5) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, \
- type4 arg4, type5 arg5) { \
- LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
- LSS_REG(5, arg4); LSS_REG(6, arg5); \
- LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4), \
- "d"(__r5), "d"(__r6)); \
- }
- #undef _syscall6
- #define _syscall6(type, name, type1, arg1, type2, arg2, type3, arg3, \
- type4, arg4, type5, arg5, type6, arg6) \
- type LSS_NAME(name)(type1 arg1, type2 arg2, type3 arg3, \
- type4 arg4, type5 arg5, type6 arg6) { \
- LSS_REG(2, arg1); LSS_REG(3, arg2); LSS_REG(4, arg3); \
- LSS_REG(5, arg4); LSS_REG(6, arg5); LSS_REG(7, arg6); \
- LSS_BODY(type, name, "0"(__r2), "d"(__r3), "d"(__r4), \
- "d"(__r5), "d"(__r6), "d"(__r7)); \
- }
- LSS_INLINE int LSS_NAME(clone)(int (*fn)(void *), void *child_stack,
- int flags, void *arg, int *parent_tidptr,
- void *newtls, int *child_tidptr) {
- long __ret;
- {
- register int (*__fn)(void *) __asm__ ("r1") = fn;
- register void *__cstack __asm__ ("r2") = child_stack;
- register int __flags __asm__ ("r3") = flags;
- register void *__arg __asm__ ("r0") = arg;
- register int *__ptidptr __asm__ ("r4") = parent_tidptr;
- register void *__newtls __asm__ ("r6") = newtls;
- register int *__ctidptr __asm__ ("r5") = child_tidptr;
- __asm__ __volatile__ (
- #ifndef __s390x__
- /* arg already in r0 */
- "ltr %4, %4\n\t" /* check fn, which is already in r1 */
- "jz 1f\n\t" /* NULL function pointer, return -EINVAL */
- "ltr %5, %5\n\t" /* check child_stack, which is already in r2 */
- "jz 1f\n\t" /* NULL stack pointer, return -EINVAL */
- /* flags already in r3 */
- /* parent_tidptr already in r4 */
- /* child_tidptr already in r5 */
- /* newtls already in r6 */
- "svc %2\n\t" /* invoke clone syscall */
- "ltr %0,%%r2\n\t" /* load return code into __ret and test */
- "jnz 1f\n\t" /* return to parent if non-zero */
- /* start child thread */
- "lr %%r2, %7\n\t" /* set first parameter to void *arg */
- "ahi %%r15, -96\n\t" /* make room on the stack for the save area */
- "xc 0(4,%%r15), 0(%%r15)\n\t"
- "basr %%r14, %4\n\t" /* jump to fn */
- "svc %3\n" /* invoke exit syscall */
- "1:\n"
- #else
- /* arg already in r0 */
- "ltgr %4, %4\n\t" /* check fn, which is already in r1 */
- "jz 1f\n\t" /* NULL function pointer, return -EINVAL */
- "ltgr %5, %5\n\t" /* check child_stack, which is already in r2 */
- "jz 1f\n\t" /* NULL stack pointer, return -EINVAL */
- /* flags already in r3 */
- /* parent_tidptr already in r4 */
- /* child_tidptr already in r5 */
- /* newtls already in r6 */
- "svc %2\n\t" /* invoke clone syscall */
- "ltgr %0, %%r2\n\t" /* load return code into __ret and test */
- "jnz 1f\n\t" /* return to parent if non-zero */
- /* start child thread */
- "lgr %%r2, %7\n\t" /* set first parameter to void *arg */
- "aghi %%r15, -160\n\t" /* make room on the stack for the save area */
- "xc 0(8,%%r15), 0(%%r15)\n\t"
- "basr %%r14, %4\n\t" /* jump to fn */
- "svc %3\n" /* invoke exit syscall */
- "1:\n"
- #endif
- : "=r" (__ret)
- : "0" (-EINVAL), "i" (__NR_clone), "i" (__NR_exit),
- "d" (__fn), "d" (__cstack), "d" (__flags), "d" (__arg),
- "d" (__ptidptr), "d" (__newtls), "d" (__ctidptr)
- : "cc", "r14", "memory"
- );
- }
- LSS_RETURN(int, __ret);
- }
- #endif
- #define __NR__exit __NR_exit
- #define __NR__gettid __NR_gettid
- #define __NR__mremap __NR_mremap
- LSS_INLINE _syscall1(void *, brk, void *, e)
- LSS_INLINE _syscall1(int, chdir, const char *,p)
- LSS_INLINE _syscall1(int, close, int, f)
- LSS_INLINE _syscall2(int, clock_getres, int, c,
- struct kernel_timespec*, t)
- LSS_INLINE _syscall2(int, clock_gettime, int, c,
- struct kernel_timespec*, t)
- LSS_INLINE _syscall1(int, dup, int, f)
- #if !defined(__aarch64__)
- // The dup2 syscall has been deprecated on aarch64. We polyfill it below.
- LSS_INLINE _syscall2(int, dup2, int, s,
- int, d)
- #endif
- LSS_INLINE _syscall3(int, execve, const char*, f,
- const char*const*,a,const char*const*, e)
- LSS_INLINE _syscall1(int, _exit, int, e)
- LSS_INLINE _syscall1(int, exit_group, int, e)
- LSS_INLINE _syscall3(int, fcntl, int, f,
- int, c, long, a)
- #if !defined(__aarch64__)
- // The fork syscall has been deprecated on aarch64. We polyfill it below.
- LSS_INLINE _syscall0(pid_t, fork)
- #endif
- LSS_INLINE _syscall2(int, fstat, int, f,
- struct kernel_stat*, b)
- LSS_INLINE _syscall2(int, fstatfs, int, f,
- struct kernel_statfs*, b)
- #if defined(__x86_64__)
- /* Need to make sure off_t isn't truncated to 32-bits under x32. */
- LSS_INLINE int LSS_NAME(ftruncate)(int f, off_t l) {
- LSS_BODY(2, int, ftruncate, LSS_SYSCALL_ARG(f), (uint64_t)(l));
- }
- #else
- LSS_INLINE _syscall2(int, ftruncate, int, f,
- off_t, l)
- #endif
- LSS_INLINE _syscall4(int, futex, int*, a,
- int, o, int, v,
- struct kernel_timespec*, t)
- LSS_INLINE _syscall3(int, getdents, int, f,
- struct kernel_dirent*, d, int, c)
- LSS_INLINE _syscall3(int, getdents64, int, f,
- struct kernel_dirent64*, d, int, c)
- LSS_INLINE _syscall0(gid_t, getegid)
- LSS_INLINE _syscall0(uid_t, geteuid)
- #if !defined(__aarch64__)
- // The getgprp syscall has been deprecated on aarch64.
- LSS_INLINE _syscall0(pid_t, getpgrp)
- #endif
- LSS_INLINE _syscall0(pid_t, getpid)
- LSS_INLINE _syscall0(pid_t, getppid)
- LSS_INLINE _syscall2(int, getpriority, int, a,
- int, b)
- LSS_INLINE _syscall3(int, getresgid, gid_t *, r,
- gid_t *, e, gid_t *, s)
- LSS_INLINE _syscall3(int, getresuid, uid_t *, r,
- uid_t *, e, uid_t *, s)
-#if !defined(__ARM_EABI__)
- LSS_INLINE _syscall2(int, getrlimit, int, r,
- struct kernel_rlimit*, l)
-#endif
- LSS_INLINE _syscall1(pid_t, getsid, pid_t, p)
- LSS_INLINE _syscall0(pid_t, _gettid)
- LSS_INLINE _syscall2(pid_t, gettimeofday, struct kernel_timeval*, t,
- void*, tz)
- LSS_INLINE _syscall5(int, setxattr, const char *,p,
- const char *, n, const void *,v,
- size_t, s, int, f)
- LSS_INLINE _syscall5(int, lsetxattr, const char *,p,
- const char *, n, const void *,v,
- size_t, s, int, f)
- LSS_INLINE _syscall4(ssize_t, getxattr, const char *,p,
- const char *, n, void *, v, size_t, s)
- LSS_INLINE _syscall4(ssize_t, lgetxattr, const char *,p,
- const char *, n, void *, v, size_t, s)
- LSS_INLINE _syscall3(ssize_t, listxattr, const char *,p,
- char *, l, size_t, s)
- LSS_INLINE _syscall3(ssize_t, llistxattr, const char *,p,
- char *, l, size_t, s)
- LSS_INLINE _syscall3(int, ioctl, int, d,
- int, r, void *, a)
- LSS_INLINE _syscall2(int, ioprio_get, int, which,
- int, who)
- LSS_INLINE _syscall3(int, ioprio_set, int, which,
- int, who, int, ioprio)
- LSS_INLINE _syscall2(int, kill, pid_t, p,
- int, s)
- #if defined(__x86_64__)
- /* Need to make sure off_t isn't truncated to 32-bits under x32. */
- LSS_INLINE off_t LSS_NAME(lseek)(int f, off_t o, int w) {
- _LSS_BODY(3, off_t, lseek, off_t, LSS_SYSCALL_ARG(f), (uint64_t)(o),
- LSS_SYSCALL_ARG(w));
- }
- #else
- LSS_INLINE _syscall3(off_t, lseek, int, f,
- off_t, o, int, w)
- #endif
- LSS_INLINE _syscall2(int, munmap, void*, s,
- size_t, l)
- LSS_INLINE _syscall6(long, move_pages, pid_t, p,
- unsigned long, n, void **,g, int *, d,
- int *, s, int, f)
- LSS_INLINE _syscall3(int, mprotect, const void *,a,
- size_t, l, int, p)
- LSS_INLINE _syscall5(void*, _mremap, void*, o,
- size_t, os, size_t, ns,
- unsigned long, f, void *, a)
- #if !defined(__aarch64__)
- // The open and poll syscalls have been deprecated on aarch64. We polyfill
- // them below.
- LSS_INLINE _syscall3(int, open, const char*, p,
- int, f, int, m)
- LSS_INLINE _syscall3(int, poll, struct kernel_pollfd*, u,
- unsigned int, n, int, t)
- #endif
- LSS_INLINE _syscall5(int, prctl, int, option,
- unsigned long, arg2,
- unsigned long, arg3,
- unsigned long, arg4,
- unsigned long, arg5)
- LSS_INLINE _syscall4(long, ptrace, int, r,
- pid_t, p, void *, a, void *, d)
- #if defined(__NR_quotactl)
- // Defined on x86_64 / i386 only
- LSS_INLINE _syscall4(int, quotactl, int, cmd, const char *, special,
- int, id, caddr_t, addr)
- #endif
- LSS_INLINE _syscall3(ssize_t, read, int, f,
- void *, b, size_t, c)
- #if !defined(__aarch64__)
- // The readlink syscall has been deprecated on aarch64. We polyfill below.
- LSS_INLINE _syscall3(int, readlink, const char*, p,
- char*, b, size_t, s)
- #endif
- LSS_INLINE _syscall4(int, rt_sigaction, int, s,
- const struct kernel_sigaction*, a,
- struct kernel_sigaction*, o, size_t, c)
- LSS_INLINE _syscall2(int, rt_sigpending, struct kernel_sigset_t *, s,
- size_t, c)
- LSS_INLINE _syscall4(int, rt_sigprocmask, int, h,
- const struct kernel_sigset_t*, s,
- struct kernel_sigset_t*, o, size_t, c)
- LSS_INLINE _syscall2(int, rt_sigsuspend,
- const struct kernel_sigset_t*, s, size_t, c)
- LSS_INLINE _syscall3(int, sched_getaffinity,pid_t, p,
- unsigned int, l, unsigned long *, m)
- LSS_INLINE _syscall3(int, sched_setaffinity,pid_t, p,
- unsigned int, l, unsigned long *, m)
- LSS_INLINE _syscall0(int, sched_yield)
- LSS_INLINE _syscall1(long, set_tid_address, int *, t)
- LSS_INLINE _syscall1(int, setfsgid, gid_t, g)
- LSS_INLINE _syscall1(int, setfsuid, uid_t, u)
- LSS_INLINE _syscall1(int, setuid, uid_t, u)
- LSS_INLINE _syscall1(int, setgid, gid_t, g)
- LSS_INLINE _syscall2(int, setpgid, pid_t, p,
- pid_t, g)
- LSS_INLINE _syscall3(int, setpriority, int, a,
- int, b, int, p)
- LSS_INLINE _syscall3(int, setresgid, gid_t, r,
- gid_t, e, gid_t, s)
- LSS_INLINE _syscall3(int, setresuid, uid_t, r,
- uid_t, e, uid_t, s)
- LSS_INLINE _syscall2(int, setrlimit, int, r,
- const struct kernel_rlimit*, l)
- LSS_INLINE _syscall0(pid_t, setsid)
- LSS_INLINE _syscall2(int, sigaltstack, const stack_t*, s,
- const stack_t*, o)
- #if defined(__NR_sigreturn)
- LSS_INLINE _syscall1(int, sigreturn, unsigned long, u)
- #endif
- #if !defined(__aarch64__)
- // The stat syscall has been deprecated on aarch64. We polyfill it below.
- LSS_INLINE _syscall2(int, stat, const char*, f,
- struct kernel_stat*, b)
- #endif
- LSS_INLINE _syscall2(int, statfs, const char*, f,
- struct kernel_statfs*, b)
- LSS_INLINE _syscall3(int, tgkill, pid_t, p,
- pid_t, t, int, s)
- LSS_INLINE _syscall2(int, tkill, pid_t, p,
- int, s)
- #if !defined(__aarch64__)
- // The unlink syscall has been deprecated on aarch64. We polyfill it below.
- LSS_INLINE _syscall1(int, unlink, const char*, f)
- #endif
- LSS_INLINE _syscall3(ssize_t, write, int, f,
- const void *, b, size_t, c)
- LSS_INLINE _syscall3(ssize_t, writev, int, f,
- const struct kernel_iovec*, v, size_t, c)
- #if defined(__NR_getcpu)
- LSS_INLINE _syscall3(long, getcpu, unsigned *, cpu,
- unsigned *, node, void *, unused)
- #endif
- #if defined(__x86_64__) || \
- (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32)
- LSS_INLINE _syscall3(int, recvmsg, int, s,
- struct kernel_msghdr*, m, int, f)
- LSS_INLINE _syscall3(int, sendmsg, int, s,
- const struct kernel_msghdr*, m, int, f)
- LSS_INLINE _syscall6(int, sendto, int, s,
- const void*, m, size_t, l,
- int, f,
- const struct kernel_sockaddr*, a, int, t)
- LSS_INLINE _syscall2(int, shutdown, int, s,
- int, h)
- LSS_INLINE _syscall3(int, socket, int, d,
- int, t, int, p)
- LSS_INLINE _syscall4(int, socketpair, int, d,
- int, t, int, p, int*, s)
- #endif
- #if defined(__NR_fadvise64)
- #if defined(__x86_64__)
- /* Need to make sure loff_t isn't truncated to 32-bits under x32. */
- LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset, loff_t len,
- int advice) {
- LSS_BODY(4, int, fadvise64, LSS_SYSCALL_ARG(fd), (uint64_t)(offset),
- (uint64_t)(len), LSS_SYSCALL_ARG(advice));
- }
- #else
- LSS_INLINE _syscall4(int, fadvise64,
- int, fd, loff_t, offset, loff_t, len, int, advice)
- #endif
- #elif defined(__i386__)
- #define __NR__fadvise64_64 __NR_fadvise64_64
- LSS_INLINE _syscall6(int, _fadvise64_64, int, fd,
- unsigned, offset_lo, unsigned, offset_hi,
- unsigned, len_lo, unsigned, len_hi,
- int, advice)
-
- LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset,
- loff_t len, int advice) {
- return LSS_NAME(_fadvise64_64)(fd,
- (unsigned)offset, (unsigned)(offset >>32),
- (unsigned)len, (unsigned)(len >> 32),
- advice);
- }
-
- #elif defined(__s390__) && !defined(__s390x__)
- #define __NR__fadvise64_64 __NR_fadvise64_64
- struct kernel_fadvise64_64_args {
- int fd;
- long long offset;
- long long len;
- int advice;
- };
-
- LSS_INLINE _syscall1(int, _fadvise64_64,
- struct kernel_fadvise64_64_args *args)
-
- LSS_INLINE int LSS_NAME(fadvise64)(int fd, loff_t offset,
- loff_t len, int advice) {
- struct kernel_fadvise64_64_args args = { fd, offset, len, advice };
- return LSS_NAME(_fadvise64_64)(&args);
- }
- #endif
- #if defined(__NR_fallocate)
- #if defined(__x86_64__)
- /* Need to make sure loff_t isn't truncated to 32-bits under x32. */
- LSS_INLINE int LSS_NAME(fallocate)(int f, int mode, loff_t offset,
- loff_t len) {
- LSS_BODY(4, int, fallocate, LSS_SYSCALL_ARG(f), LSS_SYSCALL_ARG(mode),
- (uint64_t)(offset), (uint64_t)(len));
- }
- #elif defined(__i386__) || (defined(__s390__) && !defined(__s390x__))
- #define __NR__fallocate __NR_fallocate
- LSS_INLINE _syscall6(int, _fallocate, int, fd,
- int, mode,
- unsigned, offset_lo, unsigned, offset_hi,
- unsigned, len_lo, unsigned, len_hi)
-
- LSS_INLINE int LSS_NAME(fallocate)(int fd, int mode,
- loff_t offset, loff_t len) {
- union { loff_t off; unsigned w[2]; } o = { offset }, l = { len };
- return LSS_NAME(_fallocate)(fd, mode, o.w[0], o.w[1], l.w[0], l.w[1]);
- }
- #else
- LSS_INLINE _syscall4(int, fallocate,
- int, f, int, mode, loff_t, offset, loff_t, len)
- #endif
- #endif
- #if defined(__x86_64__) || defined(__s390x__)
- LSS_INLINE int LSS_NAME(getresgid32)(gid_t *rgid,
- gid_t *egid,
- gid_t *sgid) {
- return LSS_NAME(getresgid)(rgid, egid, sgid);
- }
-
- LSS_INLINE int LSS_NAME(getresuid32)(uid_t *ruid,
- uid_t *euid,
- uid_t *suid) {
- return LSS_NAME(getresuid)(ruid, euid, suid);
- }
- LSS_INLINE _syscall4(int, newfstatat, int, d,
- const char *, p,
- struct kernel_stat*, b, int, f)
-
- LSS_INLINE int LSS_NAME(setfsgid32)(gid_t gid) {
- return LSS_NAME(setfsgid)(gid);
- }
-
- LSS_INLINE int LSS_NAME(setfsuid32)(uid_t uid) {
- return LSS_NAME(setfsuid)(uid);
- }
-
- LSS_INLINE int LSS_NAME(setresgid32)(gid_t rgid, gid_t egid, gid_t sgid) {
- return LSS_NAME(setresgid)(rgid, egid, sgid);
- }
-
- LSS_INLINE int LSS_NAME(setresuid32)(uid_t ruid, uid_t euid, uid_t suid) {
- return LSS_NAME(setresuid)(ruid, euid, suid);
- }
-
- LSS_INLINE int LSS_NAME(sigaction)(int signum,
- const struct kernel_sigaction *act,
- struct kernel_sigaction *oldact) {
- #if defined(__x86_64__)
- /* On x86_64, the kernel requires us to always set our own
- * SA_RESTORER in order to be able to return from a signal handler.
- * This function must have a "magic" signature that the "gdb"
- * (and maybe the kernel?) can recognize.
- */
- if (act != NULL && !(act->sa_flags & SA_RESTORER)) {
- struct kernel_sigaction a = *act;
- a.sa_flags |= SA_RESTORER;
- a.sa_restorer = LSS_NAME(restore_rt)();
- return LSS_NAME(rt_sigaction)(signum, &a, oldact,
- (KERNEL_NSIG+7)/8);
- } else
- #endif
- return LSS_NAME(rt_sigaction)(signum, act, oldact,
- (KERNEL_NSIG+7)/8);
- }
-
- LSS_INLINE int LSS_NAME(sigpending)(struct kernel_sigset_t *set) {
- return LSS_NAME(rt_sigpending)(set, (KERNEL_NSIG+7)/8);
- }
-
- LSS_INLINE int LSS_NAME(sigprocmask)(int how,
- const struct kernel_sigset_t *set,
- struct kernel_sigset_t *oldset) {
- return LSS_NAME(rt_sigprocmask)(how, set, oldset, (KERNEL_NSIG+7)/8);
- }
-
- LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) {
- return LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8);
- }
- #endif
- #if defined(__x86_64__) || defined(__ARM_ARCH_3__) || \
- defined(__ARM_EABI__) || defined(__aarch64__) || \
- (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI32) || \
- defined(__s390__)
- LSS_INLINE _syscall4(pid_t, wait4, pid_t, p,
- int*, s, int, o,
- struct kernel_rusage*, r)
-
- LSS_INLINE pid_t LSS_NAME(waitpid)(pid_t pid, int *status, int options){
- return LSS_NAME(wait4)(pid, status, options, 0);
- }
- #endif
- #if defined(__NR_openat)
- LSS_INLINE _syscall4(int, openat, int, d, const char *, p, int, f, int, m)
- #endif
- #if defined(__NR_unlinkat)
- LSS_INLINE _syscall3(int, unlinkat, int, d, const char *, p, int, f)
- #endif
- #if defined(__i386__) || defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
- (defined(__s390__) && !defined(__s390x__))
- #define __NR__getresgid32 __NR_getresgid32
- #define __NR__getresuid32 __NR_getresuid32
- #define __NR__setfsgid32 __NR_setfsgid32
- #define __NR__setfsuid32 __NR_setfsuid32
- #define __NR__setresgid32 __NR_setresgid32
- #define __NR__setresuid32 __NR_setresuid32
-#if defined(__ARM_EABI__)
- LSS_INLINE _syscall2(int, ugetrlimit, int, r,
- struct kernel_rlimit*, l)
-#endif
- LSS_INLINE _syscall3(int, _getresgid32, gid_t *, r,
- gid_t *, e, gid_t *, s)
- LSS_INLINE _syscall3(int, _getresuid32, uid_t *, r,
- uid_t *, e, uid_t *, s)
- LSS_INLINE _syscall1(int, _setfsgid32, gid_t, f)
- LSS_INLINE _syscall1(int, _setfsuid32, uid_t, f)
- LSS_INLINE _syscall3(int, _setresgid32, gid_t, r,
- gid_t, e, gid_t, s)
- LSS_INLINE _syscall3(int, _setresuid32, uid_t, r,
- uid_t, e, uid_t, s)
-
- LSS_INLINE int LSS_NAME(getresgid32)(gid_t *rgid,
- gid_t *egid,
- gid_t *sgid) {
- int rc;
- if ((rc = LSS_NAME(_getresgid32)(rgid, egid, sgid)) < 0 &&
- LSS_ERRNO == ENOSYS) {
- if ((rgid == NULL) || (egid == NULL) || (sgid == NULL)) {
- return EFAULT;
- }
- // Clear the high bits first, since getresgid only sets 16 bits
- *rgid = *egid = *sgid = 0;
- rc = LSS_NAME(getresgid)(rgid, egid, sgid);
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(getresuid32)(uid_t *ruid,
- uid_t *euid,
- uid_t *suid) {
- int rc;
- if ((rc = LSS_NAME(_getresuid32)(ruid, euid, suid)) < 0 &&
- LSS_ERRNO == ENOSYS) {
- if ((ruid == NULL) || (euid == NULL) || (suid == NULL)) {
- return EFAULT;
- }
- // Clear the high bits first, since getresuid only sets 16 bits
- *ruid = *euid = *suid = 0;
- rc = LSS_NAME(getresuid)(ruid, euid, suid);
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(setfsgid32)(gid_t gid) {
- int rc;
- if ((rc = LSS_NAME(_setfsgid32)(gid)) < 0 &&
- LSS_ERRNO == ENOSYS) {
- if ((unsigned int)gid & ~0xFFFFu) {
- rc = EINVAL;
- } else {
- rc = LSS_NAME(setfsgid)(gid);
- }
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(setfsuid32)(uid_t uid) {
- int rc;
- if ((rc = LSS_NAME(_setfsuid32)(uid)) < 0 &&
- LSS_ERRNO == ENOSYS) {
- if ((unsigned int)uid & ~0xFFFFu) {
- rc = EINVAL;
- } else {
- rc = LSS_NAME(setfsuid)(uid);
- }
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(setresgid32)(gid_t rgid, gid_t egid, gid_t sgid) {
- int rc;
- if ((rc = LSS_NAME(_setresgid32)(rgid, egid, sgid)) < 0 &&
- LSS_ERRNO == ENOSYS) {
- if ((unsigned int)rgid & ~0xFFFFu ||
- (unsigned int)egid & ~0xFFFFu ||
- (unsigned int)sgid & ~0xFFFFu) {
- rc = EINVAL;
- } else {
- rc = LSS_NAME(setresgid)(rgid, egid, sgid);
- }
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(setresuid32)(uid_t ruid, uid_t euid, uid_t suid) {
- int rc;
- if ((rc = LSS_NAME(_setresuid32)(ruid, euid, suid)) < 0 &&
- LSS_ERRNO == ENOSYS) {
- if ((unsigned int)ruid & ~0xFFFFu ||
- (unsigned int)euid & ~0xFFFFu ||
- (unsigned int)suid & ~0xFFFFu) {
- rc = EINVAL;
- } else {
- rc = LSS_NAME(setresuid)(ruid, euid, suid);
- }
- }
- return rc;
- }
- #endif
- LSS_INLINE int LSS_NAME(sigemptyset)(struct kernel_sigset_t *set) {
- memset(&set->sig, 0, sizeof(set->sig));
- return 0;
- }
-
- LSS_INLINE int LSS_NAME(sigfillset)(struct kernel_sigset_t *set) {
- memset(&set->sig, -1, sizeof(set->sig));
- return 0;
- }
-
- LSS_INLINE int LSS_NAME(sigaddset)(struct kernel_sigset_t *set,
- int signum) {
- if (signum < 1 || signum > (int)(8*sizeof(set->sig))) {
- LSS_ERRNO = EINVAL;
- return -1;
- } else {
- set->sig[(signum - 1)/(8*sizeof(set->sig[0]))]
- |= 1UL << ((signum - 1) % (8*sizeof(set->sig[0])));
- return 0;
- }
- }
-
- LSS_INLINE int LSS_NAME(sigdelset)(struct kernel_sigset_t *set,
- int signum) {
- if (signum < 1 || signum > (int)(8*sizeof(set->sig))) {
- LSS_ERRNO = EINVAL;
- return -1;
- } else {
- set->sig[(signum - 1)/(8*sizeof(set->sig[0]))]
- &= ~(1UL << ((signum - 1) % (8*sizeof(set->sig[0]))));
- return 0;
- }
- }
-
- LSS_INLINE int LSS_NAME(sigismember)(struct kernel_sigset_t *set,
- int signum) {
- if (signum < 1 || signum > (int)(8*sizeof(set->sig))) {
- LSS_ERRNO = EINVAL;
- return -1;
- } else {
- return !!(set->sig[(signum - 1)/(8*sizeof(set->sig[0]))] &
- (1UL << ((signum - 1) % (8*sizeof(set->sig[0])))));
- }
- }
- #if defined(__i386__) || \
- defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
- defined(__PPC__) || \
- (defined(__s390__) && !defined(__s390x__))
- #define __NR__sigaction __NR_sigaction
- #define __NR__sigpending __NR_sigpending
- #define __NR__sigprocmask __NR_sigprocmask
- #define __NR__sigsuspend __NR_sigsuspend
- #define __NR__socketcall __NR_socketcall
- LSS_INLINE _syscall2(int, fstat64, int, f,
- struct kernel_stat64 *, b)
- LSS_INLINE _syscall5(int, _llseek, uint, fd,
- unsigned long, hi, unsigned long, lo,
- loff_t *, res, uint, wh)
-#if defined(__s390__) && !defined(__s390x__)
- /* On s390, mmap2() arguments are passed in memory. */
- LSS_INLINE void* LSS_NAME(_mmap2)(void *s, size_t l, int p, int f, int d,
- off_t o) {
- unsigned long buf[6] = { (unsigned long) s, (unsigned long) l,
- (unsigned long) p, (unsigned long) f,
- (unsigned long) d, (unsigned long) o };
- LSS_REG(2, buf);
- LSS_BODY(void*, mmap2, "0"(__r2));
- }
-#else
- #define __NR__mmap2 __NR_mmap2
- LSS_INLINE _syscall6(void*, _mmap2, void*, s,
- size_t, l, int, p,
- int, f, int, d,
- off_t, o)
-#endif
- LSS_INLINE _syscall3(int, _sigaction, int, s,
- const struct kernel_old_sigaction*, a,
- struct kernel_old_sigaction*, o)
- LSS_INLINE _syscall1(int, _sigpending, unsigned long*, s)
- LSS_INLINE _syscall3(int, _sigprocmask, int, h,
- const unsigned long*, s,
- unsigned long*, o)
- #ifdef __PPC__
- LSS_INLINE _syscall1(int, _sigsuspend, unsigned long, s)
- #else
- LSS_INLINE _syscall3(int, _sigsuspend, const void*, a,
- int, b,
- unsigned long, s)
- #endif
- LSS_INLINE _syscall2(int, stat64, const char *, p,
- struct kernel_stat64 *, b)
-
- LSS_INLINE int LSS_NAME(sigaction)(int signum,
- const struct kernel_sigaction *act,
- struct kernel_sigaction *oldact) {
- int old_errno = LSS_ERRNO;
- int rc;
- struct kernel_sigaction a;
- if (act != NULL) {
- a = *act;
- #ifdef __i386__
- /* On i386, the kernel requires us to always set our own
- * SA_RESTORER when using realtime signals. Otherwise, it does not
- * know how to return from a signal handler. This function must have
- * a "magic" signature that the "gdb" (and maybe the kernel?) can
- * recognize.
- * Apparently, a SA_RESTORER is implicitly set by the kernel, when
- * using non-realtime signals.
- *
- * TODO: Test whether ARM needs a restorer
- */
- if (!(a.sa_flags & SA_RESTORER)) {
- a.sa_flags |= SA_RESTORER;
- a.sa_restorer = (a.sa_flags & SA_SIGINFO)
- ? LSS_NAME(restore_rt)() : LSS_NAME(restore)();
- }
- #endif
- }
- rc = LSS_NAME(rt_sigaction)(signum, act ? &a : act, oldact,
- (KERNEL_NSIG+7)/8);
- if (rc < 0 && LSS_ERRNO == ENOSYS) {
- struct kernel_old_sigaction oa, ooa, *ptr_a = &oa, *ptr_oa = &ooa;
- if (!act) {
- ptr_a = NULL;
- } else {
- oa.sa_handler_ = act->sa_handler_;
- memcpy(&oa.sa_mask, &act->sa_mask, sizeof(oa.sa_mask));
- #ifndef __mips__
- oa.sa_restorer = act->sa_restorer;
- #endif
- oa.sa_flags = act->sa_flags;
- }
- if (!oldact) {
- ptr_oa = NULL;
- }
- LSS_ERRNO = old_errno;
- rc = LSS_NAME(_sigaction)(signum, ptr_a, ptr_oa);
- if (rc == 0 && oldact) {
- if (act) {
- memcpy(oldact, act, sizeof(*act));
- } else {
- memset(oldact, 0, sizeof(*oldact));
- }
- oldact->sa_handler_ = ptr_oa->sa_handler_;
- oldact->sa_flags = ptr_oa->sa_flags;
- memcpy(&oldact->sa_mask, &ptr_oa->sa_mask, sizeof(ptr_oa->sa_mask));
- #ifndef __mips__
- oldact->sa_restorer = ptr_oa->sa_restorer;
- #endif
- }
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(sigpending)(struct kernel_sigset_t *set) {
- int old_errno = LSS_ERRNO;
- int rc = LSS_NAME(rt_sigpending)(set, (KERNEL_NSIG+7)/8);
- if (rc < 0 && LSS_ERRNO == ENOSYS) {
- LSS_ERRNO = old_errno;
- LSS_NAME(sigemptyset)(set);
- rc = LSS_NAME(_sigpending)(&set->sig[0]);
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(sigprocmask)(int how,
- const struct kernel_sigset_t *set,
- struct kernel_sigset_t *oldset) {
- int olderrno = LSS_ERRNO;
- int rc = LSS_NAME(rt_sigprocmask)(how, set, oldset, (KERNEL_NSIG+7)/8);
- if (rc < 0 && LSS_ERRNO == ENOSYS) {
- LSS_ERRNO = olderrno;
- if (oldset) {
- LSS_NAME(sigemptyset)(oldset);
- }
- rc = LSS_NAME(_sigprocmask)(how,
- set ? &set->sig[0] : NULL,
- oldset ? &oldset->sig[0] : NULL);
- }
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(sigsuspend)(const struct kernel_sigset_t *set) {
- int olderrno = LSS_ERRNO;
- int rc = LSS_NAME(rt_sigsuspend)(set, (KERNEL_NSIG+7)/8);
- if (rc < 0 && LSS_ERRNO == ENOSYS) {
- LSS_ERRNO = olderrno;
- rc = LSS_NAME(_sigsuspend)(
- #ifndef __PPC__
- set, 0,
- #endif
- set->sig[0]);
- }
- return rc;
- }
- #endif
- #if defined(__i386__) || \
- defined(__ARM_ARCH_3__) || defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
- defined(__PPC__) || \
- (defined(__s390__) && !defined(__s390x__))
- /* On these architectures, implement mmap() with mmap2(). */
- LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
- int64_t o) {
- if (o % 4096) {
- LSS_ERRNO = EINVAL;
- return (void *) -1;
- }
- return LSS_NAME(_mmap2)(s, l, p, f, d, (o / 4096));
- }
- #elif defined(__s390x__)
- /* On s390x, mmap() arguments are passed in memory. */
- LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
- int64_t o) {
- unsigned long buf[6] = { (unsigned long) s, (unsigned long) l,
- (unsigned long) p, (unsigned long) f,
- (unsigned long) d, (unsigned long) o };
- LSS_REG(2, buf);
- LSS_BODY(void*, mmap, "0"(__r2));
- }
- #elif defined(__x86_64__)
- /* Need to make sure __off64_t isn't truncated to 32-bits under x32. */
- LSS_INLINE void* LSS_NAME(mmap)(void *s, size_t l, int p, int f, int d,
- int64_t o) {
- LSS_BODY(6, void*, mmap, LSS_SYSCALL_ARG(s), LSS_SYSCALL_ARG(l),
- LSS_SYSCALL_ARG(p), LSS_SYSCALL_ARG(f),
- LSS_SYSCALL_ARG(d), (uint64_t)(o));
- }
- #else
- /* Remaining 64-bit architectures. */
- LSS_INLINE _syscall6(void*, mmap, void*, addr, size_t, length, int, prot,
- int, flags, int, fd, int64_t, offset)
- #endif
- #if defined(__PPC__)
- #undef LSS_SC_LOADARGS_0
- #define LSS_SC_LOADARGS_0(dummy...)
- #undef LSS_SC_LOADARGS_1
- #define LSS_SC_LOADARGS_1(arg1) \
- __sc_4 = (unsigned long) (arg1)
- #undef LSS_SC_LOADARGS_2
- #define LSS_SC_LOADARGS_2(arg1, arg2) \
- LSS_SC_LOADARGS_1(arg1); \
- __sc_5 = (unsigned long) (arg2)
- #undef LSS_SC_LOADARGS_3
- #define LSS_SC_LOADARGS_3(arg1, arg2, arg3) \
- LSS_SC_LOADARGS_2(arg1, arg2); \
- __sc_6 = (unsigned long) (arg3)
- #undef LSS_SC_LOADARGS_4
- #define LSS_SC_LOADARGS_4(arg1, arg2, arg3, arg4) \
- LSS_SC_LOADARGS_3(arg1, arg2, arg3); \
- __sc_7 = (unsigned long) (arg4)
- #undef LSS_SC_LOADARGS_5
- #define LSS_SC_LOADARGS_5(arg1, arg2, arg3, arg4, arg5) \
- LSS_SC_LOADARGS_4(arg1, arg2, arg3, arg4); \
- __sc_8 = (unsigned long) (arg5)
- #undef LSS_SC_BODY
- #define LSS_SC_BODY(nr, type, opt, args...) \
- long __sc_ret, __sc_err; \
- { \
- register unsigned long __sc_0 __asm__ ("r0") = __NR_socketcall; \
- register unsigned long __sc_3 __asm__ ("r3") = opt; \
- register unsigned long __sc_4 __asm__ ("r4"); \
- register unsigned long __sc_5 __asm__ ("r5"); \
- register unsigned long __sc_6 __asm__ ("r6"); \
- register unsigned long __sc_7 __asm__ ("r7"); \
- register unsigned long __sc_8 __asm__ ("r8"); \
- LSS_SC_LOADARGS_##nr(args); \
- __asm__ __volatile__ \
- ("stwu 1, -48(1)\n\t" \
- "stw 4, 20(1)\n\t" \
- "stw 5, 24(1)\n\t" \
- "stw 6, 28(1)\n\t" \
- "stw 7, 32(1)\n\t" \
- "stw 8, 36(1)\n\t" \
- "addi 4, 1, 20\n\t" \
- "sc\n\t" \
- "mfcr %0" \
- : "=&r" (__sc_0), \
- "=&r" (__sc_3), "=&r" (__sc_4), \
- "=&r" (__sc_5), "=&r" (__sc_6), \
- "=&r" (__sc_7), "=&r" (__sc_8) \
- : LSS_ASMINPUT_##nr \
- : "cr0", "ctr", "memory"); \
- __sc_ret = __sc_3; \
- __sc_err = __sc_0; \
- } \
- LSS_RETURN(type, __sc_ret, __sc_err)
-
- LSS_INLINE ssize_t LSS_NAME(recvmsg)(int s,struct kernel_msghdr *msg,
- int flags){
- LSS_SC_BODY(3, ssize_t, 17, s, msg, flags);
- }
-
- LSS_INLINE ssize_t LSS_NAME(sendmsg)(int s,
- const struct kernel_msghdr *msg,
- int flags) {
- LSS_SC_BODY(3, ssize_t, 16, s, msg, flags);
- }
-
- // TODO(csilvers): why is this ifdef'ed out?
-#if 0
- LSS_INLINE ssize_t LSS_NAME(sendto)(int s, const void *buf, size_t len,
- int flags,
- const struct kernel_sockaddr *to,
- unsigned int tolen) {
- LSS_BODY(6, ssize_t, 11, s, buf, len, flags, to, tolen);
- }
-#endif
-
- LSS_INLINE int LSS_NAME(shutdown)(int s, int how) {
- LSS_SC_BODY(2, int, 13, s, how);
- }
-
- LSS_INLINE int LSS_NAME(socket)(int domain, int type, int protocol) {
- LSS_SC_BODY(3, int, 1, domain, type, protocol);
- }
-
- LSS_INLINE int LSS_NAME(socketpair)(int d, int type, int protocol,
- int sv[2]) {
- LSS_SC_BODY(4, int, 8, d, type, protocol, sv);
- }
- #endif
- #if defined(__ARM_EABI__) || defined (__aarch64__)
- LSS_INLINE _syscall3(ssize_t, recvmsg, int, s, struct kernel_msghdr*, msg,
- int, flags)
- LSS_INLINE _syscall3(ssize_t, sendmsg, int, s, const struct kernel_msghdr*,
- msg, int, flags)
- LSS_INLINE _syscall6(ssize_t, sendto, int, s, const void*, buf, size_t,len,
- int, flags, const struct kernel_sockaddr*, to,
- unsigned int, tolen)
- LSS_INLINE _syscall2(int, shutdown, int, s, int, how)
- LSS_INLINE _syscall3(int, socket, int, domain, int, type, int, protocol)
- LSS_INLINE _syscall4(int, socketpair, int, d, int, type, int, protocol,
- int*, sv)
- #endif
- #if defined(__i386__) || defined(__ARM_ARCH_3__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32) || \
- defined(__s390__)
- #define __NR__socketcall __NR_socketcall
- LSS_INLINE _syscall2(int, _socketcall, int, c,
- va_list, a)
- LSS_INLINE int LSS_NAME(socketcall)(int op, ...) {
- int rc;
- va_list ap;
- va_start(ap, op);
- rc = LSS_NAME(_socketcall)(op, ap);
- va_end(ap);
- return rc;
- }
-
- LSS_INLINE ssize_t LSS_NAME(recvmsg)(int s,struct kernel_msghdr *msg,
- int flags){
- return (ssize_t)LSS_NAME(socketcall)(17, s, msg, flags);
- }
-
- LSS_INLINE ssize_t LSS_NAME(sendmsg)(int s,
- const struct kernel_msghdr *msg,
- int flags) {
- return (ssize_t)LSS_NAME(socketcall)(16, s, msg, flags);
- }
-
- LSS_INLINE ssize_t LSS_NAME(sendto)(int s, const void *buf, size_t len,
- int flags,
- const struct kernel_sockaddr *to,
- unsigned int tolen) {
- return (ssize_t)LSS_NAME(socketcall)(11, s, buf, len, flags, to, tolen);
- }
-
- LSS_INLINE int LSS_NAME(shutdown)(int s, int how) {
- return LSS_NAME(socketcall)(13, s, how);
- }
-
- LSS_INLINE int LSS_NAME(socket)(int domain, int type, int protocol) {
- return LSS_NAME(socketcall)(1, domain, type, protocol);
- }
-
- LSS_INLINE int LSS_NAME(socketpair)(int d, int type, int protocol,
- int sv[2]) {
- return LSS_NAME(socketcall)(8, d, type, protocol, sv);
- }
- #endif
- #if defined(__NR_fstatat64)
- LSS_INLINE _syscall4(int, fstatat64, int, d,
- const char *, p,
- struct kernel_stat64 *, b, int, f)
- #endif
- #if defined(__i386__) || defined(__PPC__) || \
- (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI32)
- LSS_INLINE _syscall3(pid_t, waitpid, pid_t, p,
- int*, s, int, o)
- #endif
- #if defined(__mips__)
- /* sys_pipe() on MIPS has non-standard calling conventions, as it returns
- * both file handles through CPU registers.
- */
- LSS_INLINE int LSS_NAME(pipe)(int *p) {
- register unsigned long __v0 __asm__("$2") = __NR_pipe;
- register unsigned long __v1 __asm__("$3");
- register unsigned long __r7 __asm__("$7");
- __asm__ __volatile__ ("syscall\n"
- : "=r"(__v0), "=r"(__v1), "=r" (__r7)
- : "0"(__v0)
- : "$8", "$9", "$10", "$11", "$12",
- "$13", "$14", "$15", "$24", "$25", "memory");
- if (__r7) {
- unsigned long __errnovalue = __v0;
- LSS_ERRNO = __errnovalue;
- return -1;
- } else {
- p[0] = __v0;
- p[1] = __v1;
- return 0;
- }
- }
- #elif !defined(__aarch64__)
- // The unlink syscall has been deprecated on aarch64. We polyfill it below.
- LSS_INLINE _syscall1(int, pipe, int *, p)
- #endif
- /* TODO(csilvers): see if ppc can/should support this as well */
- #if defined(__i386__) || defined(__ARM_ARCH_3__) || \
- defined(__ARM_EABI__) || \
- (defined(__mips__) && _MIPS_SIM != _MIPS_SIM_ABI64) || \
- (defined(__s390__) && !defined(__s390x__))
- #define __NR__statfs64 __NR_statfs64
- #define __NR__fstatfs64 __NR_fstatfs64
- LSS_INLINE _syscall3(int, _statfs64, const char*, p,
- size_t, s,struct kernel_statfs64*, b)
- LSS_INLINE _syscall3(int, _fstatfs64, int, f,
- size_t, s,struct kernel_statfs64*, b)
- LSS_INLINE int LSS_NAME(statfs64)(const char *p,
- struct kernel_statfs64 *b) {
- return LSS_NAME(_statfs64)(p, sizeof(*b), b);
- }
- LSS_INLINE int LSS_NAME(fstatfs64)(int f,struct kernel_statfs64 *b) {
- return LSS_NAME(_fstatfs64)(f, sizeof(*b), b);
- }
- #endif
-
- LSS_INLINE int LSS_NAME(execv)(const char *path, const char *const argv[]) {
- extern char **environ;
- return LSS_NAME(execve)(path, argv, (const char *const *)environ);
- }
-
- LSS_INLINE pid_t LSS_NAME(gettid)(void) {
- pid_t tid = LSS_NAME(_gettid)();
- if (tid != -1) {
- return tid;
- }
- return LSS_NAME(getpid)();
- }
-
- LSS_INLINE void *LSS_NAME(mremap)(void *old_address, size_t old_size,
- size_t new_size, int flags, ...) {
- va_list ap;
- void *new_address, *rc;
- va_start(ap, flags);
- new_address = va_arg(ap, void *);
- rc = LSS_NAME(_mremap)(old_address, old_size, new_size,
- flags, new_address);
- va_end(ap);
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(ptrace_detach)(pid_t pid) {
- /* PTRACE_DETACH can sometimes forget to wake up the tracee and it
- * then sends job control signals to the real parent, rather than to
- * the tracer. We reduce the risk of this happening by starting a
- * whole new time slice, and then quickly sending a SIGCONT signal
- * right after detaching from the tracee.
- *
- * We use tkill to ensure that we only issue a wakeup for the thread being
- * detached. Large multi threaded apps can take a long time in the kernel
- * processing SIGCONT.
- */
- int rc, err;
- LSS_NAME(sched_yield)();
- rc = LSS_NAME(ptrace)(PTRACE_DETACH, pid, (void *)0, (void *)0);
- err = LSS_ERRNO;
- LSS_NAME(tkill)(pid, SIGCONT);
- /* Old systems don't have tkill */
- if (LSS_ERRNO == ENOSYS)
- LSS_NAME(kill)(pid, SIGCONT);
- LSS_ERRNO = err;
- return rc;
- }
-
- LSS_INLINE int LSS_NAME(raise)(int sig) {
- return LSS_NAME(kill)(LSS_NAME(getpid)(), sig);
- }
-
- LSS_INLINE int LSS_NAME(setpgrp)(void) {
- return LSS_NAME(setpgid)(0, 0);
- }
-
- LSS_INLINE int LSS_NAME(sysconf)(int name) {
- extern int __getpagesize(void);
- switch (name) {
- case _SC_OPEN_MAX: {
- struct kernel_rlimit limit;
-#if defined(__ARM_EABI__)
- return LSS_NAME(ugetrlimit)(RLIMIT_NOFILE, &limit) < 0
- ? 8192 : limit.rlim_cur;
-#else
- return LSS_NAME(getrlimit)(RLIMIT_NOFILE, &limit) < 0
- ? 8192 : limit.rlim_cur;
-#endif
- }
- case _SC_PAGESIZE:
- return __getpagesize();
- default:
- LSS_ERRNO = ENOSYS;
- return -1;
- }
- }
- #if defined(__x86_64__)
- /* Need to make sure loff_t isn't truncated to 32-bits under x32. */
- LSS_INLINE ssize_t LSS_NAME(pread64)(int f, void *b, size_t c, loff_t o) {
- LSS_BODY(4, ssize_t, pread64, LSS_SYSCALL_ARG(f), LSS_SYSCALL_ARG(b),
- LSS_SYSCALL_ARG(c), (uint64_t)(o));
- }
-
- LSS_INLINE ssize_t LSS_NAME(pwrite64)(int f, const void *b, size_t c,
- loff_t o) {
- LSS_BODY(4, ssize_t, pwrite64, LSS_SYSCALL_ARG(f), LSS_SYSCALL_ARG(b),
- LSS_SYSCALL_ARG(c), (uint64_t)(o));
- }
-
- LSS_INLINE int LSS_NAME(readahead)(int f, loff_t o, unsigned c) {
- LSS_BODY(3, int, readahead, LSS_SYSCALL_ARG(f), (uint64_t)(o),
- LSS_SYSCALL_ARG(c));
- }
- #elif defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64
- LSS_INLINE _syscall4(ssize_t, pread64, int, f,
- void *, b, size_t, c,
- loff_t, o)
- LSS_INLINE _syscall4(ssize_t, pwrite64, int, f,
- const void *, b, size_t, c,
- loff_t, o)
- LSS_INLINE _syscall3(int, readahead, int, f,
- loff_t, o, unsigned, c)
- LSS_INLINE _syscall6(void *, mmap, void *, addr, size_t, length, int, prot,
- int, flags, int, fd, int64_t, offset)
- #else
- #define __NR__pread64 __NR_pread64
- #define __NR__pwrite64 __NR_pwrite64
- #define __NR__readahead __NR_readahead
- #if defined(__ARM_EABI__) || defined(__mips__)
- /* On ARM and MIPS, a 64-bit parameter has to be in an even-odd register
- * pair. Hence these calls ignore their fourth argument (r3) so that their
- * fifth and sixth make such a pair (r4,r5).
- */
- #define LSS_LLARG_PAD 0,
- LSS_INLINE _syscall6(ssize_t, _pread64, int, f,
- void *, b, size_t, c,
- unsigned, skip, unsigned, o1, unsigned, o2)
- LSS_INLINE _syscall6(ssize_t, _pwrite64, int, f,
- const void *, b, size_t, c,
- unsigned, skip, unsigned, o1, unsigned, o2)
- LSS_INLINE _syscall5(int, _readahead, int, f,
- unsigned, skip,
- unsigned, o1, unsigned, o2, size_t, c)
- #else
- #define LSS_LLARG_PAD
- LSS_INLINE _syscall5(ssize_t, _pread64, int, f,
- void *, b, size_t, c, unsigned, o1,
- unsigned, o2)
- LSS_INLINE _syscall5(ssize_t, _pwrite64, int, f,
- const void *, b, size_t, c, unsigned, o1,
- long, o2)
- LSS_INLINE _syscall4(int, _readahead, int, f,
- unsigned, o1, unsigned, o2, size_t, c)
- #endif
- /* We force 64bit-wide parameters onto the stack, then access each
- * 32-bit component individually. This guarantees that we build the
- * correct parameters independent of the native byte-order of the
- * underlying architecture.
- */
- LSS_INLINE ssize_t LSS_NAME(pread64)(int fd, void *buf, size_t count,
- loff_t off) {
- union { loff_t off; unsigned arg[2]; } o = { off };
- return LSS_NAME(_pread64)(fd, buf, count,
- LSS_LLARG_PAD o.arg[0], o.arg[1]);
- }
- LSS_INLINE ssize_t LSS_NAME(pwrite64)(int fd, const void *buf,
- size_t count, loff_t off) {
- union { loff_t off; unsigned arg[2]; } o = { off };
- return LSS_NAME(_pwrite64)(fd, buf, count,
- LSS_LLARG_PAD o.arg[0], o.arg[1]);
- }
- LSS_INLINE int LSS_NAME(readahead)(int fd, loff_t off, int len) {
- union { loff_t off; unsigned arg[2]; } o = { off };
- return LSS_NAME(_readahead)(fd, LSS_LLARG_PAD o.arg[0], o.arg[1], len);
- }
- #endif
-#endif
-
-#if defined(__aarch64__)
- LSS_INLINE _syscall3(int, dup3, int, s, int, d, int, f)
- LSS_INLINE _syscall6(void *, mmap, void *, addr, size_t, length, int, prot,
- int, flags, int, fd, int64_t, offset)
- LSS_INLINE _syscall4(int, newfstatat, int, dirfd, const char *, pathname,
- struct kernel_stat *, buf, int, flags)
- LSS_INLINE _syscall2(int, pipe2, int *, pipefd, int, flags)
- LSS_INLINE _syscall5(int, ppoll, struct kernel_pollfd *, u,
- unsigned int, n, const struct kernel_timespec *, t,
- const struct kernel_sigset_t *, sigmask, size_t, s)
- LSS_INLINE _syscall4(int, readlinkat, int, d, const char *, p, char *, b,
- size_t, s)
-#endif
-
-/*
- * Polyfills for deprecated syscalls.
- */
-
-#if defined(__aarch64__)
- LSS_INLINE int LSS_NAME(dup2)(int s, int d) {
- return LSS_NAME(dup3)(s, d, 0);
- }
-
- LSS_INLINE int LSS_NAME(open)(const char *pathname, int flags, int mode) {
- return LSS_NAME(openat)(AT_FDCWD, pathname, flags, mode);
- }
-
- LSS_INLINE int LSS_NAME(unlink)(const char *pathname) {
- return LSS_NAME(unlinkat)(AT_FDCWD, pathname, 0);
- }
-
- LSS_INLINE int LSS_NAME(readlink)(const char *pathname, char *buffer,
- size_t size) {
- return LSS_NAME(readlinkat)(AT_FDCWD, pathname, buffer, size);
- }
-
- LSS_INLINE pid_t LSS_NAME(pipe)(int *pipefd) {
- return LSS_NAME(pipe2)(pipefd, 0);
- }
-
- LSS_INLINE int LSS_NAME(poll)(struct kernel_pollfd *fds, unsigned int nfds,
- int timeout) {
- struct kernel_timespec timeout_ts;
- struct kernel_timespec *timeout_ts_p = NULL;
-
- if (timeout >= 0) {
- timeout_ts.tv_sec = timeout / 1000;
- timeout_ts.tv_nsec = (timeout % 1000) * 1000000;
- timeout_ts_p = &timeout_ts;
- }
- return LSS_NAME(ppoll)(fds, nfds, timeout_ts_p, NULL, 0);
- }
-
- LSS_INLINE int LSS_NAME(stat)(const char *pathname,
- struct kernel_stat *buf) {
- return LSS_NAME(newfstatat)(AT_FDCWD, pathname, buf, 0);
- }
-
- LSS_INLINE pid_t LSS_NAME(fork)(void) {
- // No fork syscall on aarch64 - implement by means of the clone syscall.
- // Note that this does not reset glibc's cached view of the PID/TID, so
- // some glibc interfaces might go wrong in the forked subprocess.
- int flags = SIGCHLD;
- void *child_stack = NULL;
- void *parent_tidptr = NULL;
- void *newtls = NULL;
- void *child_tidptr = NULL;
-
- LSS_REG(0, flags);
- LSS_REG(1, child_stack);
- LSS_REG(2, parent_tidptr);
- LSS_REG(3, newtls);
- LSS_REG(4, child_tidptr);
- LSS_BODY(pid_t, clone, "r"(__r0), "r"(__r1), "r"(__r2), "r"(__r3),
- "r"(__r4));
- }
-#endif
-
-#ifdef __ANDROID__
- /* These restore the original values of these macros saved by the
- * corresponding #pragma push_macro near the top of this file. */
-# pragma pop_macro("stat64")
-# pragma pop_macro("fstat64")
-# pragma pop_macro("lstat64")
-#endif
-
-#if defined(__cplusplus) && !defined(SYS_CPLUSPLUS)
-}
-#endif
-
-#endif
-#endif
-
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/README b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/README
deleted file mode 100644
index c681bb3d65..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/README
+++ /dev/null
@@ -1,2 +0,0 @@
-These headers were copied from the Mac OS X 10.7 SDK to enable building
-the Mac dump_syms code that processes Mach-O files on Linux.
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/architecture/byte_order.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/architecture/byte_order.h
deleted file mode 100644
index b772d9f38e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/architecture/byte_order.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 1999-2008 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-/*
- * Copyright (c) 1992 NeXT Computer, Inc.
- *
- * Byte ordering conversion.
- *
- */
-/* This file mostly left blank */
-
-#ifndef _ARCHITECTURE_BYTE_ORDER_H_
-#define _ARCHITECTURE_BYTE_ORDER_H_
-
-/*
- * Identify the byte order
- * of the current host.
- */
-
-enum NXByteOrder {
- NX_UnknownByteOrder,
- NX_LittleEndian,
- NX_BigEndian
-};
-
-#endif /* _ARCHITECTURE_BYTE_ORDER_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/i386/_types.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/i386/_types.h
deleted file mode 100644
index 2ed7fd6759..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/i386/_types.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-#ifndef _BSD_I386__TYPES_H_
-#define _BSD_I386__TYPES_H_
-
-typedef long __darwin_intptr_t;
-typedef unsigned int __darwin_natural_t;
-
-#endif /* _BSD_I386__TYPES_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/arch.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/arch.h
deleted file mode 100644
index 526c10fc84..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/arch.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _MACH_O_ARCH_H_
-#define _MACH_O_ARCH_H_
-/*
- * Copyright (c) 1997 Apple Computer, Inc.
- *
- * Functions that deal with information about architectures.
- *
- */
-
-#include <stdint.h>
-#include <mach/machine.h>
-#include <architecture/byte_order.h>
-
-/* The NXArchInfo structs contain the architectures symbolic name
- * (such as "ppc"), its CPU type and CPU subtype as defined in
- * mach/machine.h, the byte order for the architecture, and a
- * describing string (such as "PowerPC").
- * There will both be entries for specific CPUs (such as ppc604e) as
- * well as generic "family" entries (such as ppc).
- */
-typedef struct {
- const char *name;
- cpu_type_t cputype;
- cpu_subtype_t cpusubtype;
- enum NXByteOrder byteorder;
- const char *description;
-} NXArchInfo;
-
-#if __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
-/* NXGetAllArchInfos() returns a pointer to an array of all known
- * NXArchInfo structures. The last NXArchInfo is marked by a NULL name.
- */
-extern const NXArchInfo *NXGetAllArchInfos(void);
-
-/* NXGetLocalArchInfo() returns the NXArchInfo for the local host, or NULL
- * if none is known.
- */
-extern const NXArchInfo *NXGetLocalArchInfo(void);
-
-/* NXGetArchInfoFromName() and NXGetArchInfoFromCpuType() return the
- * NXArchInfo from the architecture's name or cputype/cpusubtype
- * combination. A cpusubtype of CPU_SUBTYPE_MULTIPLE can be used
- * to request the most general NXArchInfo known for the given cputype.
- * NULL is returned if no matching NXArchInfo can be found.
- */
-extern const NXArchInfo *NXGetArchInfoFromName(const char *name);
-extern const NXArchInfo *NXGetArchInfoFromCpuType(cpu_type_t cputype,
- cpu_subtype_t cpusubtype);
-
-/* NXFindBestFatArch() is passed a cputype and cpusubtype and a set of
- * fat_arch structs and selects the best one that matches (if any) and returns
- * a pointer to that fat_arch struct (or NULL). The fat_arch structs must be
- * in the host byte order and correct such that the fat_archs really points to
- * enough memory for nfat_arch structs. It is possible that this routine could
- * fail if new cputypes or cpusubtypes are added and an old version of this
- * routine is used. But if there is an exact match between the cputype and
- * cpusubtype and one of the fat_arch structs this routine will always succeed.
- */
-extern struct fat_arch *NXFindBestFatArch(cpu_type_t cputype,
- cpu_subtype_t cpusubtype,
- struct fat_arch *fat_archs,
- uint32_t nfat_archs);
-
-/* NXCombineCpuSubtypes() returns the resulting cpusubtype when combining two
- * different cpusubtypes for the specified cputype. If the two cpusubtypes
- * can't be combined (the specific subtypes are mutually exclusive) -1 is
- * returned indicating it is an error to combine them. This can also fail and
- * return -1 if new cputypes or cpusubtypes are added and an old version of
- * this routine is used. But if the cpusubtypes are the same they can always
- * be combined and this routine will return the cpusubtype pass in.
- */
-extern cpu_subtype_t NXCombineCpuSubtypes(cpu_type_t cputype,
- cpu_subtype_t cpusubtype1,
- cpu_subtype_t cpusubtype2);
-
-#if __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* _MACH_O_ARCH_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/fat.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/fat.h
deleted file mode 100644
index e2bcf433d5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/fat.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _MACH_O_FAT_H_
-#define _MACH_O_FAT_H_
-/*
- * This header file describes the structures of the file format for "fat"
- * architecture specific file (wrapper design). At the begining of the file
- * there is one fat_header structure followed by a number of fat_arch
- * structures. For each architecture in the file, specified by a pair of
- * cputype and cpusubtype, the fat_header describes the file offset, file
- * size and alignment in the file of the architecture specific member.
- * The padded bytes in the file to place each member on it's specific alignment
- * are defined to be read as zeros and can be left as "holes" if the file system
- * can support them as long as they read as zeros.
- *
- * All structures defined here are always written and read to/from disk
- * in big-endian order.
- */
-
-/*
- * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types
- * and contains the constants for the possible values of these types.
- */
-#include <stdint.h>
-#include <mach/machine.h>
-#include <architecture/byte_order.h>
-
-#define FAT_MAGIC 0xcafebabe
-#define FAT_CIGAM 0xbebafeca /* NXSwapLong(FAT_MAGIC) */
-
-struct fat_header {
- uint32_t magic; /* FAT_MAGIC */
- uint32_t nfat_arch; /* number of structs that follow */
-};
-
-struct fat_arch {
- cpu_type_t cputype; /* cpu specifier (int) */
- cpu_subtype_t cpusubtype; /* machine specifier (int) */
- uint32_t offset; /* file offset to this object file */
- uint32_t size; /* size of this object file */
- uint32_t align; /* alignment as a power of 2 */
-};
-
-#endif /* _MACH_O_FAT_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/loader.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/loader.h
deleted file mode 100644
index ff18e29c73..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/loader.h
+++ /dev/null
@@ -1,1402 +0,0 @@
-/*
- * Copyright (c) 1999-2010 Apple Inc. All Rights Reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _MACHO_LOADER_H_
-#define _MACHO_LOADER_H_
-
-/*
- * This file describes the format of mach object files.
- */
-#include <stdint.h>
-
-/*
- * <mach/machine.h> is needed here for the cpu_type_t and cpu_subtype_t types
- * and contains the constants for the possible values of these types.
- */
-#include <mach/machine.h>
-
-/*
- * <mach/vm_prot.h> is needed here for the vm_prot_t type and contains the
- * constants that are or'ed together for the possible values of this type.
- */
-#include <mach/vm_prot.h>
-
-/*
- * <machine/thread_status.h> is expected to define the flavors of the thread
- * states and the structures of those flavors for each machine.
- */
-#include <mach/machine/thread_status.h>
-#include <architecture/byte_order.h>
-
-/*
- * The 32-bit mach header appears at the very beginning of the object file for
- * 32-bit architectures.
- */
-struct mach_header {
- uint32_t magic; /* mach magic number identifier */
- cpu_type_t cputype; /* cpu specifier */
- cpu_subtype_t cpusubtype; /* machine specifier */
- uint32_t filetype; /* type of file */
- uint32_t ncmds; /* number of load commands */
- uint32_t sizeofcmds; /* the size of all the load commands */
- uint32_t flags; /* flags */
-};
-
-/* Constant for the magic field of the mach_header (32-bit architectures) */
-#define MH_MAGIC 0xfeedface /* the mach magic number */
-#define MH_CIGAM 0xcefaedfe /* NXSwapInt(MH_MAGIC) */
-
-/*
- * The 64-bit mach header appears at the very beginning of object files for
- * 64-bit architectures.
- */
-struct mach_header_64 {
- uint32_t magic; /* mach magic number identifier */
- cpu_type_t cputype; /* cpu specifier */
- cpu_subtype_t cpusubtype; /* machine specifier */
- uint32_t filetype; /* type of file */
- uint32_t ncmds; /* number of load commands */
- uint32_t sizeofcmds; /* the size of all the load commands */
- uint32_t flags; /* flags */
- uint32_t reserved; /* reserved */
-};
-
-/* Constant for the magic field of the mach_header_64 (64-bit architectures) */
-#define MH_MAGIC_64 0xfeedfacf /* the 64-bit mach magic number */
-#define MH_CIGAM_64 0xcffaedfe /* NXSwapInt(MH_MAGIC_64) */
-
-/*
- * The layout of the file depends on the filetype. For all but the MH_OBJECT
- * file type the segments are padded out and aligned on a segment alignment
- * boundary for efficient demand pageing. The MH_EXECUTE, MH_FVMLIB, MH_DYLIB,
- * MH_DYLINKER and MH_BUNDLE file types also have the headers included as part
- * of their first segment.
- *
- * The file type MH_OBJECT is a compact format intended as output of the
- * assembler and input (and possibly output) of the link editor (the .o
- * format). All sections are in one unnamed segment with no segment padding.
- * This format is used as an executable format when the file is so small the
- * segment padding greatly increases its size.
- *
- * The file type MH_PRELOAD is an executable format intended for things that
- * are not executed under the kernel (proms, stand alones, kernels, etc). The
- * format can be executed under the kernel but may demand paged it and not
- * preload it before execution.
- *
- * A core file is in MH_CORE format and can be any in an arbritray legal
- * Mach-O file.
- *
- * Constants for the filetype field of the mach_header
- */
-#define MH_OBJECT 0x1 /* relocatable object file */
-#define MH_EXECUTE 0x2 /* demand paged executable file */
-#define MH_FVMLIB 0x3 /* fixed VM shared library file */
-#define MH_CORE 0x4 /* core file */
-#define MH_PRELOAD 0x5 /* preloaded executable file */
-#define MH_DYLIB 0x6 /* dynamically bound shared library */
-#define MH_DYLINKER 0x7 /* dynamic link editor */
-#define MH_BUNDLE 0x8 /* dynamically bound bundle file */
-#define MH_DYLIB_STUB 0x9 /* shared library stub for static */
- /* linking only, no section contents */
-#define MH_DSYM 0xa /* companion file with only debug */
- /* sections */
-#define MH_KEXT_BUNDLE 0xb /* x86_64 kexts */
-
-/* Constants for the flags field of the mach_header */
-#define MH_NOUNDEFS 0x1 /* the object file has no undefined
- references */
-#define MH_INCRLINK 0x2 /* the object file is the output of an
- incremental link against a base file
- and can't be link edited again */
-#define MH_DYLDLINK 0x4 /* the object file is input for the
- dynamic linker and can't be staticly
- link edited again */
-#define MH_BINDATLOAD 0x8 /* the object file's undefined
- references are bound by the dynamic
- linker when loaded. */
-#define MH_PREBOUND 0x10 /* the file has its dynamic undefined
- references prebound. */
-#define MH_SPLIT_SEGS 0x20 /* the file has its read-only and
- read-write segments split */
-#define MH_LAZY_INIT 0x40 /* the shared library init routine is
- to be run lazily via catching memory
- faults to its writeable segments
- (obsolete) */
-#define MH_TWOLEVEL 0x80 /* the image is using two-level name
- space bindings */
-#define MH_FORCE_FLAT 0x100 /* the executable is forcing all images
- to use flat name space bindings */
-#define MH_NOMULTIDEFS 0x200 /* this umbrella guarantees no multiple
- defintions of symbols in its
- sub-images so the two-level namespace
- hints can always be used. */
-#define MH_NOFIXPREBINDING 0x400 /* do not have dyld notify the
- prebinding agent about this
- executable */
-#define MH_PREBINDABLE 0x800 /* the binary is not prebound but can
- have its prebinding redone. only used
- when MH_PREBOUND is not set. */
-#define MH_ALLMODSBOUND 0x1000 /* indicates that this binary binds to
- all two-level namespace modules of
- its dependent libraries. only used
- when MH_PREBINDABLE and MH_TWOLEVEL
- are both set. */
-#define MH_SUBSECTIONS_VIA_SYMBOLS 0x2000/* safe to divide up the sections into
- sub-sections via symbols for dead
- code stripping */
-#define MH_CANONICAL 0x4000 /* the binary has been canonicalized
- via the unprebind operation */
-#define MH_WEAK_DEFINES 0x8000 /* the final linked image contains
- external weak symbols */
-#define MH_BINDS_TO_WEAK 0x10000 /* the final linked image uses
- weak symbols */
-
-#define MH_ALLOW_STACK_EXECUTION 0x20000/* When this bit is set, all stacks
- in the task will be given stack
- execution privilege. Only used in
- MH_EXECUTE filetypes. */
-#define MH_ROOT_SAFE 0x40000 /* When this bit is set, the binary
- declares it is safe for use in
- processes with uid zero */
-
-#define MH_SETUID_SAFE 0x80000 /* When this bit is set, the binary
- declares it is safe for use in
- processes when issetugid() is true */
-
-#define MH_NO_REEXPORTED_DYLIBS 0x100000 /* When this bit is set on a dylib,
- the static linker does not need to
- examine dependent dylibs to see
- if any are re-exported */
-#define MH_PIE 0x200000 /* When this bit is set, the OS will
- load the main executable at a
- random address. Only used in
- MH_EXECUTE filetypes. */
-#define MH_DEAD_STRIPPABLE_DYLIB 0x400000 /* Only for use on dylibs. When
- linking against a dylib that
- has this bit set, the static linker
- will automatically not create a
- LC_LOAD_DYLIB load command to the
- dylib if no symbols are being
- referenced from the dylib. */
-#define MH_HAS_TLV_DESCRIPTORS 0x800000 /* Contains a section of type
- S_THREAD_LOCAL_VARIABLES */
-
-#define MH_NO_HEAP_EXECUTION 0x1000000 /* When this bit is set, the OS will
- run the main executable with
- a non-executable heap even on
- platforms (e.g. i386) that don't
- require it. Only used in MH_EXECUTE
- filetypes. */
-
-/*
- * The load commands directly follow the mach_header. The total size of all
- * of the commands is given by the sizeofcmds field in the mach_header. All
- * load commands must have as their first two fields cmd and cmdsize. The cmd
- * field is filled in with a constant for that command type. Each command type
- * has a structure specifically for it. The cmdsize field is the size in bytes
- * of the particular load command structure plus anything that follows it that
- * is a part of the load command (i.e. section structures, strings, etc.). To
- * advance to the next load command the cmdsize can be added to the offset or
- * pointer of the current load command. The cmdsize for 32-bit architectures
- * MUST be a multiple of 4 bytes and for 64-bit architectures MUST be a multiple
- * of 8 bytes (these are forever the maximum alignment of any load commands).
- * The padded bytes must be zero. All tables in the object file must also
- * follow these rules so the file can be memory mapped. Otherwise the pointers
- * to these tables will not work well or at all on some machines. With all
- * padding zeroed like objects will compare byte for byte.
- */
-struct load_command {
- uint32_t cmd; /* type of load command */
- uint32_t cmdsize; /* total size of command in bytes */
-};
-
-/*
- * After MacOS X 10.1 when a new load command is added that is required to be
- * understood by the dynamic linker for the image to execute properly the
- * LC_REQ_DYLD bit will be or'ed into the load command constant. If the dynamic
- * linker sees such a load command it it does not understand will issue a
- * "unknown load command required for execution" error and refuse to use the
- * image. Other load commands without this bit that are not understood will
- * simply be ignored.
- */
-#define LC_REQ_DYLD 0x80000000
-
-/* Constants for the cmd field of all load commands, the type */
-#define LC_SEGMENT 0x1 /* segment of this file to be mapped */
-#define LC_SYMTAB 0x2 /* link-edit stab symbol table info */
-#define LC_SYMSEG 0x3 /* link-edit gdb symbol table info (obsolete) */
-#define LC_THREAD 0x4 /* thread */
-#define LC_UNIXTHREAD 0x5 /* unix thread (includes a stack) */
-#define LC_LOADFVMLIB 0x6 /* load a specified fixed VM shared library */
-#define LC_IDFVMLIB 0x7 /* fixed VM shared library identification */
-#define LC_IDENT 0x8 /* object identification info (obsolete) */
-#define LC_FVMFILE 0x9 /* fixed VM file inclusion (internal use) */
-#define LC_PREPAGE 0xa /* prepage command (internal use) */
-#define LC_DYSYMTAB 0xb /* dynamic link-edit symbol table info */
-#define LC_LOAD_DYLIB 0xc /* load a dynamically linked shared library */
-#define LC_ID_DYLIB 0xd /* dynamically linked shared lib ident */
-#define LC_LOAD_DYLINKER 0xe /* load a dynamic linker */
-#define LC_ID_DYLINKER 0xf /* dynamic linker identification */
-#define LC_PREBOUND_DYLIB 0x10 /* modules prebound for a dynamically */
- /* linked shared library */
-#define LC_ROUTINES 0x11 /* image routines */
-#define LC_SUB_FRAMEWORK 0x12 /* sub framework */
-#define LC_SUB_UMBRELLA 0x13 /* sub umbrella */
-#define LC_SUB_CLIENT 0x14 /* sub client */
-#define LC_SUB_LIBRARY 0x15 /* sub library */
-#define LC_TWOLEVEL_HINTS 0x16 /* two-level namespace lookup hints */
-#define LC_PREBIND_CKSUM 0x17 /* prebind checksum */
-
-/*
- * load a dynamically linked shared library that is allowed to be missing
- * (all symbols are weak imported).
- */
-#define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
-
-#define LC_SEGMENT_64 0x19 /* 64-bit segment of this file to be
- mapped */
-#define LC_ROUTINES_64 0x1a /* 64-bit image routines */
-#define LC_UUID 0x1b /* the uuid */
-#define LC_RPATH (0x1c | LC_REQ_DYLD) /* runpath additions */
-#define LC_CODE_SIGNATURE 0x1d /* local of code signature */
-#define LC_SEGMENT_SPLIT_INFO 0x1e /* local of info to split segments */
-#define LC_REEXPORT_DYLIB (0x1f | LC_REQ_DYLD) /* load and re-export dylib */
-#define LC_LAZY_LOAD_DYLIB 0x20 /* delay load of dylib until first use */
-#define LC_ENCRYPTION_INFO 0x21 /* encrypted segment information */
-#define LC_DYLD_INFO 0x22 /* compressed dyld information */
-#define LC_DYLD_INFO_ONLY (0x22|LC_REQ_DYLD) /* compressed dyld information only */
-#define LC_LOAD_UPWARD_DYLIB (0x23 | LC_REQ_DYLD) /* load upward dylib */
-#define LC_VERSION_MIN_MACOSX 0x24 /* build for MacOSX min OS version */
-#define LC_VERSION_MIN_IPHONEOS 0x25 /* build for iPhoneOS min OS version */
-#define LC_FUNCTION_STARTS 0x26 /* compressed table of function start addresses */
-#define LC_DYLD_ENVIRONMENT 0x27 /* string for dyld to treat
- like environment variable */
-
-/*
- * A variable length string in a load command is represented by an lc_str
- * union. The strings are stored just after the load command structure and
- * the offset is from the start of the load command structure. The size
- * of the string is reflected in the cmdsize field of the load command.
- * Once again any padded bytes to bring the cmdsize field to a multiple
- * of 4 bytes must be zero.
- */
-union lc_str {
- uint32_t offset; /* offset to the string */
-#ifndef __LP64__
- char *ptr; /* pointer to the string */
-#endif
-};
-
-/*
- * The segment load command indicates that a part of this file is to be
- * mapped into the task's address space. The size of this segment in memory,
- * vmsize, maybe equal to or larger than the amount to map from this file,
- * filesize. The file is mapped starting at fileoff to the beginning of
- * the segment in memory, vmaddr. The rest of the memory of the segment,
- * if any, is allocated zero fill on demand. The segment's maximum virtual
- * memory protection and initial virtual memory protection are specified
- * by the maxprot and initprot fields. If the segment has sections then the
- * section structures directly follow the segment command and their size is
- * reflected in cmdsize.
- */
-struct segment_command { /* for 32-bit architectures */
- uint32_t cmd; /* LC_SEGMENT */
- uint32_t cmdsize; /* includes sizeof section structs */
- char segname[16]; /* segment name */
- uint32_t vmaddr; /* memory address of this segment */
- uint32_t vmsize; /* memory size of this segment */
- uint32_t fileoff; /* file offset of this segment */
- uint32_t filesize; /* amount to map from the file */
- vm_prot_t maxprot; /* maximum VM protection */
- vm_prot_t initprot; /* initial VM protection */
- uint32_t nsects; /* number of sections in segment */
- uint32_t flags; /* flags */
-};
-
-/*
- * The 64-bit segment load command indicates that a part of this file is to be
- * mapped into a 64-bit task's address space. If the 64-bit segment has
- * sections then section_64 structures directly follow the 64-bit segment
- * command and their size is reflected in cmdsize.
- */
-struct segment_command_64 { /* for 64-bit architectures */
- uint32_t cmd; /* LC_SEGMENT_64 */
- uint32_t cmdsize; /* includes sizeof section_64 structs */
- char segname[16]; /* segment name */
- uint64_t vmaddr; /* memory address of this segment */
- uint64_t vmsize; /* memory size of this segment */
- uint64_t fileoff; /* file offset of this segment */
- uint64_t filesize; /* amount to map from the file */
- vm_prot_t maxprot; /* maximum VM protection */
- vm_prot_t initprot; /* initial VM protection */
- uint32_t nsects; /* number of sections in segment */
- uint32_t flags; /* flags */
-};
-
-/* Constants for the flags field of the segment_command */
-#define SG_HIGHVM 0x1 /* the file contents for this segment is for
- the high part of the VM space, the low part
- is zero filled (for stacks in core files) */
-#define SG_FVMLIB 0x2 /* this segment is the VM that is allocated by
- a fixed VM library, for overlap checking in
- the link editor */
-#define SG_NORELOC 0x4 /* this segment has nothing that was relocated
- in it and nothing relocated to it, that is
- it maybe safely replaced without relocation*/
-#define SG_PROTECTED_VERSION_1 0x8 /* This segment is protected. If the
- segment starts at file offset 0, the
- first page of the segment is not
- protected. All other pages of the
- segment are protected. */
-
-/*
- * A segment is made up of zero or more sections. Non-MH_OBJECT files have
- * all of their segments with the proper sections in each, and padded to the
- * specified segment alignment when produced by the link editor. The first
- * segment of a MH_EXECUTE and MH_FVMLIB format file contains the mach_header
- * and load commands of the object file before its first section. The zero
- * fill sections are always last in their segment (in all formats). This
- * allows the zeroed segment padding to be mapped into memory where zero fill
- * sections might be. The gigabyte zero fill sections, those with the section
- * type S_GB_ZEROFILL, can only be in a segment with sections of this type.
- * These segments are then placed after all other segments.
- *
- * The MH_OBJECT format has all of its sections in one segment for
- * compactness. There is no padding to a specified segment boundary and the
- * mach_header and load commands are not part of the segment.
- *
- * Sections with the same section name, sectname, going into the same segment,
- * segname, are combined by the link editor. The resulting section is aligned
- * to the maximum alignment of the combined sections and is the new section's
- * alignment. The combined sections are aligned to their original alignment in
- * the combined section. Any padded bytes to get the specified alignment are
- * zeroed.
- *
- * The format of the relocation entries referenced by the reloff and nreloc
- * fields of the section structure for mach object files is described in the
- * header file <reloc.h>.
- */
-struct section { /* for 32-bit architectures */
- char sectname[16]; /* name of this section */
- char segname[16]; /* segment this section goes in */
- uint32_t addr; /* memory address of this section */
- uint32_t size; /* size in bytes of this section */
- uint32_t offset; /* file offset of this section */
- uint32_t align; /* section alignment (power of 2) */
- uint32_t reloff; /* file offset of relocation entries */
- uint32_t nreloc; /* number of relocation entries */
- uint32_t flags; /* flags (section type and attributes)*/
- uint32_t reserved1; /* reserved (for offset or index) */
- uint32_t reserved2; /* reserved (for count or sizeof) */
-};
-
-struct section_64 { /* for 64-bit architectures */
- char sectname[16]; /* name of this section */
- char segname[16]; /* segment this section goes in */
- uint64_t addr; /* memory address of this section */
- uint64_t size; /* size in bytes of this section */
- uint32_t offset; /* file offset of this section */
- uint32_t align; /* section alignment (power of 2) */
- uint32_t reloff; /* file offset of relocation entries */
- uint32_t nreloc; /* number of relocation entries */
- uint32_t flags; /* flags (section type and attributes)*/
- uint32_t reserved1; /* reserved (for offset or index) */
- uint32_t reserved2; /* reserved (for count or sizeof) */
- uint32_t reserved3; /* reserved */
-};
-
-/*
- * The flags field of a section structure is separated into two parts a section
- * type and section attributes. The section types are mutually exclusive (it
- * can only have one type) but the section attributes are not (it may have more
- * than one attribute).
- */
-#define SECTION_TYPE 0x000000ff /* 256 section types */
-#define SECTION_ATTRIBUTES 0xffffff00 /* 24 section attributes */
-
-/* Constants for the type of a section */
-#define S_REGULAR 0x0 /* regular section */
-#define S_ZEROFILL 0x1 /* zero fill on demand section */
-#define S_CSTRING_LITERALS 0x2 /* section with only literal C strings*/
-#define S_4BYTE_LITERALS 0x3 /* section with only 4 byte literals */
-#define S_8BYTE_LITERALS 0x4 /* section with only 8 byte literals */
-#define S_LITERAL_POINTERS 0x5 /* section with only pointers to */
- /* literals */
-/*
- * For the two types of symbol pointers sections and the symbol stubs section
- * they have indirect symbol table entries. For each of the entries in the
- * section the indirect symbol table entries, in corresponding order in the
- * indirect symbol table, start at the index stored in the reserved1 field
- * of the section structure. Since the indirect symbol table entries
- * correspond to the entries in the section the number of indirect symbol table
- * entries is inferred from the size of the section divided by the size of the
- * entries in the section. For symbol pointers sections the size of the entries
- * in the section is 4 bytes and for symbol stubs sections the byte size of the
- * stubs is stored in the reserved2 field of the section structure.
- */
-#define S_NON_LAZY_SYMBOL_POINTERS 0x6 /* section with only non-lazy
- symbol pointers */
-#define S_LAZY_SYMBOL_POINTERS 0x7 /* section with only lazy symbol
- pointers */
-#define S_SYMBOL_STUBS 0x8 /* section with only symbol
- stubs, byte size of stub in
- the reserved2 field */
-#define S_MOD_INIT_FUNC_POINTERS 0x9 /* section with only function
- pointers for initialization*/
-#define S_MOD_TERM_FUNC_POINTERS 0xa /* section with only function
- pointers for termination */
-#define S_COALESCED 0xb /* section contains symbols that
- are to be coalesced */
-#define S_GB_ZEROFILL 0xc /* zero fill on demand section
- (that can be larger than 4
- gigabytes) */
-#define S_INTERPOSING 0xd /* section with only pairs of
- function pointers for
- interposing */
-#define S_16BYTE_LITERALS 0xe /* section with only 16 byte
- literals */
-#define S_DTRACE_DOF 0xf /* section contains
- DTrace Object Format */
-#define S_LAZY_DYLIB_SYMBOL_POINTERS 0x10 /* section with only lazy
- symbol pointers to lazy
- loaded dylibs */
-/*
- * Section types to support thread local variables
- */
-#define S_THREAD_LOCAL_REGULAR 0x11 /* template of initial
- values for TLVs */
-#define S_THREAD_LOCAL_ZEROFILL 0x12 /* template of initial
- values for TLVs */
-#define S_THREAD_LOCAL_VARIABLES 0x13 /* TLV descriptors */
-#define S_THREAD_LOCAL_VARIABLE_POINTERS 0x14 /* pointers to TLV
- descriptors */
-#define S_THREAD_LOCAL_INIT_FUNCTION_POINTERS 0x15 /* functions to call
- to initialize TLV
- values */
-
-/*
- * Constants for the section attributes part of the flags field of a section
- * structure.
- */
-#define SECTION_ATTRIBUTES_USR 0xff000000 /* User setable attributes */
-#define S_ATTR_PURE_INSTRUCTIONS 0x80000000 /* section contains only true
- machine instructions */
-#define S_ATTR_NO_TOC 0x40000000 /* section contains coalesced
- symbols that are not to be
- in a ranlib table of
- contents */
-#define S_ATTR_STRIP_STATIC_SYMS 0x20000000 /* ok to strip static symbols
- in this section in files
- with the MH_DYLDLINK flag */
-#define S_ATTR_NO_DEAD_STRIP 0x10000000 /* no dead stripping */
-#define S_ATTR_LIVE_SUPPORT 0x08000000 /* blocks are live if they
- reference live blocks */
-#define S_ATTR_SELF_MODIFYING_CODE 0x04000000 /* Used with i386 code stubs
- written on by dyld */
-/*
- * If a segment contains any sections marked with S_ATTR_DEBUG then all
- * sections in that segment must have this attribute. No section other than
- * a section marked with this attribute may reference the contents of this
- * section. A section with this attribute may contain no symbols and must have
- * a section type S_REGULAR. The static linker will not copy section contents
- * from sections with this attribute into its output file. These sections
- * generally contain DWARF debugging info.
- */
-#define S_ATTR_DEBUG 0x02000000 /* a debug section */
-#define SECTION_ATTRIBUTES_SYS 0x00ffff00 /* system setable attributes */
-#define S_ATTR_SOME_INSTRUCTIONS 0x00000400 /* section contains some
- machine instructions */
-#define S_ATTR_EXT_RELOC 0x00000200 /* section has external
- relocation entries */
-#define S_ATTR_LOC_RELOC 0x00000100 /* section has local
- relocation entries */
-
-
-/*
- * The names of segments and sections in them are mostly meaningless to the
- * link-editor. But there are few things to support traditional UNIX
- * executables that require the link-editor and assembler to use some names
- * agreed upon by convention.
- *
- * The initial protection of the "__TEXT" segment has write protection turned
- * off (not writeable).
- *
- * The link-editor will allocate common symbols at the end of the "__common"
- * section in the "__DATA" segment. It will create the section and segment
- * if needed.
- */
-
-/* The currently known segment names and the section names in those segments */
-
-#define SEG_PAGEZERO "__PAGEZERO" /* the pagezero segment which has no */
- /* protections and catches NULL */
- /* references for MH_EXECUTE files */
-
-
-#define SEG_TEXT "__TEXT" /* the tradition UNIX text segment */
-#define SECT_TEXT "__text" /* the real text part of the text */
- /* section no headers, and no padding */
-#define SECT_FVMLIB_INIT0 "__fvmlib_init0" /* the fvmlib initialization */
- /* section */
-#define SECT_FVMLIB_INIT1 "__fvmlib_init1" /* the section following the */
- /* fvmlib initialization */
- /* section */
-
-#define SEG_DATA "__DATA" /* the tradition UNIX data segment */
-#define SECT_DATA "__data" /* the real initialized data section */
- /* no padding, no bss overlap */
-#define SECT_BSS "__bss" /* the real uninitialized data section*/
- /* no padding */
-#define SECT_COMMON "__common" /* the section common symbols are */
- /* allocated in by the link editor */
-
-#define SEG_OBJC "__OBJC" /* objective-C runtime segment */
-#define SECT_OBJC_SYMBOLS "__symbol_table" /* symbol table */
-#define SECT_OBJC_MODULES "__module_info" /* module information */
-#define SECT_OBJC_STRINGS "__selector_strs" /* string table */
-#define SECT_OBJC_REFS "__selector_refs" /* string table */
-
-#define SEG_ICON "__ICON" /* the icon segment */
-#define SECT_ICON_HEADER "__header" /* the icon headers */
-#define SECT_ICON_TIFF "__tiff" /* the icons in tiff format */
-
-#define SEG_LINKEDIT "__LINKEDIT" /* the segment containing all structs */
- /* created and maintained by the link */
- /* editor. Created with -seglinkedit */
- /* option to ld(1) for MH_EXECUTE and */
- /* FVMLIB file types only */
-
-#define SEG_UNIXSTACK "__UNIXSTACK" /* the unix stack segment */
-
-#define SEG_IMPORT "__IMPORT" /* the segment for the self (dyld) */
- /* modifing code stubs that has read, */
- /* write and execute permissions */
-
-/*
- * Fixed virtual memory shared libraries are identified by two things. The
- * target pathname (the name of the library as found for execution), and the
- * minor version number. The address of where the headers are loaded is in
- * header_addr. (THIS IS OBSOLETE and no longer supported).
- */
-struct fvmlib {
- union lc_str name; /* library's target pathname */
- uint32_t minor_version; /* library's minor version number */
- uint32_t header_addr; /* library's header address */
-};
-
-/*
- * A fixed virtual shared library (filetype == MH_FVMLIB in the mach header)
- * contains a fvmlib_command (cmd == LC_IDFVMLIB) to identify the library.
- * An object that uses a fixed virtual shared library also contains a
- * fvmlib_command (cmd == LC_LOADFVMLIB) for each library it uses.
- * (THIS IS OBSOLETE and no longer supported).
- */
-struct fvmlib_command {
- uint32_t cmd; /* LC_IDFVMLIB or LC_LOADFVMLIB */
- uint32_t cmdsize; /* includes pathname string */
- struct fvmlib fvmlib; /* the library identification */
-};
-
-/*
- * Dynamicly linked shared libraries are identified by two things. The
- * pathname (the name of the library as found for execution), and the
- * compatibility version number. The pathname must match and the compatibility
- * number in the user of the library must be greater than or equal to the
- * library being used. The time stamp is used to record the time a library was
- * built and copied into user so it can be use to determined if the library used
- * at runtime is exactly the same as used to built the program.
- */
-struct dylib {
- union lc_str name; /* library's path name */
- uint32_t timestamp; /* library's build time stamp */
- uint32_t current_version; /* library's current version number */
- uint32_t compatibility_version; /* library's compatibility vers number*/
-};
-
-/*
- * A dynamically linked shared library (filetype == MH_DYLIB in the mach header)
- * contains a dylib_command (cmd == LC_ID_DYLIB) to identify the library.
- * An object that uses a dynamically linked shared library also contains a
- * dylib_command (cmd == LC_LOAD_DYLIB, LC_LOAD_WEAK_DYLIB, or
- * LC_REEXPORT_DYLIB) for each library it uses.
- */
-struct dylib_command {
- uint32_t cmd; /* LC_ID_DYLIB, LC_LOAD_{,WEAK_}DYLIB,
- LC_REEXPORT_DYLIB */
- uint32_t cmdsize; /* includes pathname string */
- struct dylib dylib; /* the library identification */
-};
-
-/*
- * A dynamically linked shared library may be a subframework of an umbrella
- * framework. If so it will be linked with "-umbrella umbrella_name" where
- * Where "umbrella_name" is the name of the umbrella framework. A subframework
- * can only be linked against by its umbrella framework or other subframeworks
- * that are part of the same umbrella framework. Otherwise the static link
- * editor produces an error and states to link against the umbrella framework.
- * The name of the umbrella framework for subframeworks is recorded in the
- * following structure.
- */
-struct sub_framework_command {
- uint32_t cmd; /* LC_SUB_FRAMEWORK */
- uint32_t cmdsize; /* includes umbrella string */
- union lc_str umbrella; /* the umbrella framework name */
-};
-
-/*
- * For dynamically linked shared libraries that are subframework of an umbrella
- * framework they can allow clients other than the umbrella framework or other
- * subframeworks in the same umbrella framework. To do this the subframework
- * is built with "-allowable_client client_name" and an LC_SUB_CLIENT load
- * command is created for each -allowable_client flag. The client_name is
- * usually a framework name. It can also be a name used for bundles clients
- * where the bundle is built with "-client_name client_name".
- */
-struct sub_client_command {
- uint32_t cmd; /* LC_SUB_CLIENT */
- uint32_t cmdsize; /* includes client string */
- union lc_str client; /* the client name */
-};
-
-/*
- * A dynamically linked shared library may be a sub_umbrella of an umbrella
- * framework. If so it will be linked with "-sub_umbrella umbrella_name" where
- * Where "umbrella_name" is the name of the sub_umbrella framework. When
- * staticly linking when -twolevel_namespace is in effect a twolevel namespace
- * umbrella framework will only cause its subframeworks and those frameworks
- * listed as sub_umbrella frameworks to be implicited linked in. Any other
- * dependent dynamic libraries will not be linked it when -twolevel_namespace
- * is in effect. The primary library recorded by the static linker when
- * resolving a symbol in these libraries will be the umbrella framework.
- * Zero or more sub_umbrella frameworks may be use by an umbrella framework.
- * The name of a sub_umbrella framework is recorded in the following structure.
- */
-struct sub_umbrella_command {
- uint32_t cmd; /* LC_SUB_UMBRELLA */
- uint32_t cmdsize; /* includes sub_umbrella string */
- union lc_str sub_umbrella; /* the sub_umbrella framework name */
-};
-
-/*
- * A dynamically linked shared library may be a sub_library of another shared
- * library. If so it will be linked with "-sub_library library_name" where
- * Where "library_name" is the name of the sub_library shared library. When
- * staticly linking when -twolevel_namespace is in effect a twolevel namespace
- * shared library will only cause its subframeworks and those frameworks
- * listed as sub_umbrella frameworks and libraries listed as sub_libraries to
- * be implicited linked in. Any other dependent dynamic libraries will not be
- * linked it when -twolevel_namespace is in effect. The primary library
- * recorded by the static linker when resolving a symbol in these libraries
- * will be the umbrella framework (or dynamic library). Zero or more sub_library
- * shared libraries may be use by an umbrella framework or (or dynamic library).
- * The name of a sub_library framework is recorded in the following structure.
- * For example /usr/lib/libobjc_profile.A.dylib would be recorded as "libobjc".
- */
-struct sub_library_command {
- uint32_t cmd; /* LC_SUB_LIBRARY */
- uint32_t cmdsize; /* includes sub_library string */
- union lc_str sub_library; /* the sub_library name */
-};
-
-/*
- * A program (filetype == MH_EXECUTE) that is
- * prebound to its dynamic libraries has one of these for each library that
- * the static linker used in prebinding. It contains a bit vector for the
- * modules in the library. The bits indicate which modules are bound (1) and
- * which are not (0) from the library. The bit for module 0 is the low bit
- * of the first byte. So the bit for the Nth module is:
- * (linked_modules[N/8] >> N%8) & 1
- */
-struct prebound_dylib_command {
- uint32_t cmd; /* LC_PREBOUND_DYLIB */
- uint32_t cmdsize; /* includes strings */
- union lc_str name; /* library's path name */
- uint32_t nmodules; /* number of modules in library */
- union lc_str linked_modules; /* bit vector of linked modules */
-};
-
-/*
- * A program that uses a dynamic linker contains a dylinker_command to identify
- * the name of the dynamic linker (LC_LOAD_DYLINKER). And a dynamic linker
- * contains a dylinker_command to identify the dynamic linker (LC_ID_DYLINKER).
- * A file can have at most one of these.
- * This struct is also used for the LC_DYLD_ENVIRONMENT load command and
- * contains string for dyld to treat like environment variable.
- */
-struct dylinker_command {
- uint32_t cmd; /* LC_ID_DYLINKER, LC_LOAD_DYLINKER or
- LC_DYLD_ENVIRONMENT */
- uint32_t cmdsize; /* includes pathname string */
- union lc_str name; /* dynamic linker's path name */
-};
-
-/*
- * Thread commands contain machine-specific data structures suitable for
- * use in the thread state primitives. The machine specific data structures
- * follow the struct thread_command as follows.
- * Each flavor of machine specific data structure is preceded by an unsigned
- * long constant for the flavor of that data structure, an uint32_t
- * that is the count of longs of the size of the state data structure and then
- * the state data structure follows. This triple may be repeated for many
- * flavors. The constants for the flavors, counts and state data structure
- * definitions are expected to be in the header file <machine/thread_status.h>.
- * These machine specific data structures sizes must be multiples of
- * 4 bytes The cmdsize reflects the total size of the thread_command
- * and all of the sizes of the constants for the flavors, counts and state
- * data structures.
- *
- * For executable objects that are unix processes there will be one
- * thread_command (cmd == LC_UNIXTHREAD) created for it by the link-editor.
- * This is the same as a LC_THREAD, except that a stack is automatically
- * created (based on the shell's limit for the stack size). Command arguments
- * and environment variables are copied onto that stack.
- */
-struct thread_command {
- uint32_t cmd; /* LC_THREAD or LC_UNIXTHREAD */
- uint32_t cmdsize; /* total size of this command */
- /* uint32_t flavor flavor of thread state */
- /* uint32_t count count of longs in thread state */
- /* struct XXX_thread_state state thread state for this flavor */
- /* ... */
-};
-
-/*
- * The routines command contains the address of the dynamic shared library
- * initialization routine and an index into the module table for the module
- * that defines the routine. Before any modules are used from the library the
- * dynamic linker fully binds the module that defines the initialization routine
- * and then calls it. This gets called before any module initialization
- * routines (used for C++ static constructors) in the library.
- */
-struct routines_command { /* for 32-bit architectures */
- uint32_t cmd; /* LC_ROUTINES */
- uint32_t cmdsize; /* total size of this command */
- uint32_t init_address; /* address of initialization routine */
- uint32_t init_module; /* index into the module table that */
- /* the init routine is defined in */
- uint32_t reserved1;
- uint32_t reserved2;
- uint32_t reserved3;
- uint32_t reserved4;
- uint32_t reserved5;
- uint32_t reserved6;
-};
-
-/*
- * The 64-bit routines command. Same use as above.
- */
-struct routines_command_64 { /* for 64-bit architectures */
- uint32_t cmd; /* LC_ROUTINES_64 */
- uint32_t cmdsize; /* total size of this command */
- uint64_t init_address; /* address of initialization routine */
- uint64_t init_module; /* index into the module table that */
- /* the init routine is defined in */
- uint64_t reserved1;
- uint64_t reserved2;
- uint64_t reserved3;
- uint64_t reserved4;
- uint64_t reserved5;
- uint64_t reserved6;
-};
-
-/*
- * The symtab_command contains the offsets and sizes of the link-edit 4.3BSD
- * "stab" style symbol table information as described in the header files
- * <nlist.h> and <stab.h>.
- */
-struct symtab_command {
- uint32_t cmd; /* LC_SYMTAB */
- uint32_t cmdsize; /* sizeof(struct symtab_command) */
- uint32_t symoff; /* symbol table offset */
- uint32_t nsyms; /* number of symbol table entries */
- uint32_t stroff; /* string table offset */
- uint32_t strsize; /* string table size in bytes */
-};
-
-/*
- * This is the second set of the symbolic information which is used to support
- * the data structures for the dynamically link editor.
- *
- * The original set of symbolic information in the symtab_command which contains
- * the symbol and string tables must also be present when this load command is
- * present. When this load command is present the symbol table is organized
- * into three groups of symbols:
- * local symbols (static and debugging symbols) - grouped by module
- * defined external symbols - grouped by module (sorted by name if not lib)
- * undefined external symbols (sorted by name if MH_BINDATLOAD is not set,
- * and in order the were seen by the static
- * linker if MH_BINDATLOAD is set)
- * In this load command there are offsets and counts to each of the three groups
- * of symbols.
- *
- * This load command contains a the offsets and sizes of the following new
- * symbolic information tables:
- * table of contents
- * module table
- * reference symbol table
- * indirect symbol table
- * The first three tables above (the table of contents, module table and
- * reference symbol table) are only present if the file is a dynamically linked
- * shared library. For executable and object modules, which are files
- * containing only one module, the information that would be in these three
- * tables is determined as follows:
- * table of contents - the defined external symbols are sorted by name
- * module table - the file contains only one module so everything in the
- * file is part of the module.
- * reference symbol table - is the defined and undefined external symbols
- *
- * For dynamically linked shared library files this load command also contains
- * offsets and sizes to the pool of relocation entries for all sections
- * separated into two groups:
- * external relocation entries
- * local relocation entries
- * For executable and object modules the relocation entries continue to hang
- * off the section structures.
- */
-struct dysymtab_command {
- uint32_t cmd; /* LC_DYSYMTAB */
- uint32_t cmdsize; /* sizeof(struct dysymtab_command) */
-
- /*
- * The symbols indicated by symoff and nsyms of the LC_SYMTAB load command
- * are grouped into the following three groups:
- * local symbols (further grouped by the module they are from)
- * defined external symbols (further grouped by the module they are from)
- * undefined symbols
- *
- * The local symbols are used only for debugging. The dynamic binding
- * process may have to use them to indicate to the debugger the local
- * symbols for a module that is being bound.
- *
- * The last two groups are used by the dynamic binding process to do the
- * binding (indirectly through the module table and the reference symbol
- * table when this is a dynamically linked shared library file).
- */
- uint32_t ilocalsym; /* index to local symbols */
- uint32_t nlocalsym; /* number of local symbols */
-
- uint32_t iextdefsym;/* index to externally defined symbols */
- uint32_t nextdefsym;/* number of externally defined symbols */
-
- uint32_t iundefsym; /* index to undefined symbols */
- uint32_t nundefsym; /* number of undefined symbols */
-
- /*
- * For the for the dynamic binding process to find which module a symbol
- * is defined in the table of contents is used (analogous to the ranlib
- * structure in an archive) which maps defined external symbols to modules
- * they are defined in. This exists only in a dynamically linked shared
- * library file. For executable and object modules the defined external
- * symbols are sorted by name and is use as the table of contents.
- */
- uint32_t tocoff; /* file offset to table of contents */
- uint32_t ntoc; /* number of entries in table of contents */
-
- /*
- * To support dynamic binding of "modules" (whole object files) the symbol
- * table must reflect the modules that the file was created from. This is
- * done by having a module table that has indexes and counts into the merged
- * tables for each module. The module structure that these two entries
- * refer to is described below. This exists only in a dynamically linked
- * shared library file. For executable and object modules the file only
- * contains one module so everything in the file belongs to the module.
- */
- uint32_t modtaboff; /* file offset to module table */
- uint32_t nmodtab; /* number of module table entries */
-
- /*
- * To support dynamic module binding the module structure for each module
- * indicates the external references (defined and undefined) each module
- * makes. For each module there is an offset and a count into the
- * reference symbol table for the symbols that the module references.
- * This exists only in a dynamically linked shared library file. For
- * executable and object modules the defined external symbols and the
- * undefined external symbols indicates the external references.
- */
- uint32_t extrefsymoff; /* offset to referenced symbol table */
- uint32_t nextrefsyms; /* number of referenced symbol table entries */
-
- /*
- * The sections that contain "symbol pointers" and "routine stubs" have
- * indexes and (implied counts based on the size of the section and fixed
- * size of the entry) into the "indirect symbol" table for each pointer
- * and stub. For every section of these two types the index into the
- * indirect symbol table is stored in the section header in the field
- * reserved1. An indirect symbol table entry is simply a 32bit index into
- * the symbol table to the symbol that the pointer or stub is referring to.
- * The indirect symbol table is ordered to match the entries in the section.
- */
- uint32_t indirectsymoff; /* file offset to the indirect symbol table */
- uint32_t nindirectsyms; /* number of indirect symbol table entries */
-
- /*
- * To support relocating an individual module in a library file quickly the
- * external relocation entries for each module in the library need to be
- * accessed efficiently. Since the relocation entries can't be accessed
- * through the section headers for a library file they are separated into
- * groups of local and external entries further grouped by module. In this
- * case the presents of this load command who's extreloff, nextrel,
- * locreloff and nlocrel fields are non-zero indicates that the relocation
- * entries of non-merged sections are not referenced through the section
- * structures (and the reloff and nreloc fields in the section headers are
- * set to zero).
- *
- * Since the relocation entries are not accessed through the section headers
- * this requires the r_address field to be something other than a section
- * offset to identify the item to be relocated. In this case r_address is
- * set to the offset from the vmaddr of the first LC_SEGMENT command.
- * For MH_SPLIT_SEGS images r_address is set to the the offset from the
- * vmaddr of the first read-write LC_SEGMENT command.
- *
- * The relocation entries are grouped by module and the module table
- * entries have indexes and counts into them for the group of external
- * relocation entries for that the module.
- *
- * For sections that are merged across modules there must not be any
- * remaining external relocation entries for them (for merged sections
- * remaining relocation entries must be local).
- */
- uint32_t extreloff; /* offset to external relocation entries */
- uint32_t nextrel; /* number of external relocation entries */
-
- /*
- * All the local relocation entries are grouped together (they are not
- * grouped by their module since they are only used if the object is moved
- * from it staticly link edited address).
- */
- uint32_t locreloff; /* offset to local relocation entries */
- uint32_t nlocrel; /* number of local relocation entries */
-
-};
-
-/*
- * An indirect symbol table entry is simply a 32bit index into the symbol table
- * to the symbol that the pointer or stub is refering to. Unless it is for a
- * non-lazy symbol pointer section for a defined symbol which strip(1) as
- * removed. In which case it has the value INDIRECT_SYMBOL_LOCAL. If the
- * symbol was also absolute INDIRECT_SYMBOL_ABS is or'ed with that.
- */
-#define INDIRECT_SYMBOL_LOCAL 0x80000000
-#define INDIRECT_SYMBOL_ABS 0x40000000
-
-
-/* a table of contents entry */
-struct dylib_table_of_contents {
- uint32_t symbol_index; /* the defined external symbol
- (index into the symbol table) */
- uint32_t module_index; /* index into the module table this symbol
- is defined in */
-};
-
-/* a module table entry */
-struct dylib_module {
- uint32_t module_name; /* the module name (index into string table) */
-
- uint32_t iextdefsym; /* index into externally defined symbols */
- uint32_t nextdefsym; /* number of externally defined symbols */
- uint32_t irefsym; /* index into reference symbol table */
- uint32_t nrefsym; /* number of reference symbol table entries */
- uint32_t ilocalsym; /* index into symbols for local symbols */
- uint32_t nlocalsym; /* number of local symbols */
-
- uint32_t iextrel; /* index into external relocation entries */
- uint32_t nextrel; /* number of external relocation entries */
-
- uint32_t iinit_iterm; /* low 16 bits are the index into the init
- section, high 16 bits are the index into
- the term section */
- uint32_t ninit_nterm; /* low 16 bits are the number of init section
- entries, high 16 bits are the number of
- term section entries */
-
- uint32_t /* for this module address of the start of */
- objc_module_info_addr; /* the (__OBJC,__module_info) section */
- uint32_t /* for this module size of */
- objc_module_info_size; /* the (__OBJC,__module_info) section */
-};
-
-/* a 64-bit module table entry */
-struct dylib_module_64 {
- uint32_t module_name; /* the module name (index into string table) */
-
- uint32_t iextdefsym; /* index into externally defined symbols */
- uint32_t nextdefsym; /* number of externally defined symbols */
- uint32_t irefsym; /* index into reference symbol table */
- uint32_t nrefsym; /* number of reference symbol table entries */
- uint32_t ilocalsym; /* index into symbols for local symbols */
- uint32_t nlocalsym; /* number of local symbols */
-
- uint32_t iextrel; /* index into external relocation entries */
- uint32_t nextrel; /* number of external relocation entries */
-
- uint32_t iinit_iterm; /* low 16 bits are the index into the init
- section, high 16 bits are the index into
- the term section */
- uint32_t ninit_nterm; /* low 16 bits are the number of init section
- entries, high 16 bits are the number of
- term section entries */
-
- uint32_t /* for this module size of */
- objc_module_info_size; /* the (__OBJC,__module_info) section */
- uint64_t /* for this module address of the start of */
- objc_module_info_addr; /* the (__OBJC,__module_info) section */
-};
-
-/*
- * The entries in the reference symbol table are used when loading the module
- * (both by the static and dynamic link editors) and if the module is unloaded
- * or replaced. Therefore all external symbols (defined and undefined) are
- * listed in the module's reference table. The flags describe the type of
- * reference that is being made. The constants for the flags are defined in
- * <mach-o/nlist.h> as they are also used for symbol table entries.
- */
-struct dylib_reference {
- uint32_t isym:24, /* index into the symbol table */
- flags:8; /* flags to indicate the type of reference */
-};
-
-/*
- * The twolevel_hints_command contains the offset and number of hints in the
- * two-level namespace lookup hints table.
- */
-struct twolevel_hints_command {
- uint32_t cmd; /* LC_TWOLEVEL_HINTS */
- uint32_t cmdsize; /* sizeof(struct twolevel_hints_command) */
- uint32_t offset; /* offset to the hint table */
- uint32_t nhints; /* number of hints in the hint table */
-};
-
-/*
- * The entries in the two-level namespace lookup hints table are twolevel_hint
- * structs. These provide hints to the dynamic link editor where to start
- * looking for an undefined symbol in a two-level namespace image. The
- * isub_image field is an index into the sub-images (sub-frameworks and
- * sub-umbrellas list) that made up the two-level image that the undefined
- * symbol was found in when it was built by the static link editor. If
- * isub-image is 0 the the symbol is expected to be defined in library and not
- * in the sub-images. If isub-image is non-zero it is an index into the array
- * of sub-images for the umbrella with the first index in the sub-images being
- * 1. The array of sub-images is the ordered list of sub-images of the umbrella
- * that would be searched for a symbol that has the umbrella recorded as its
- * primary library. The table of contents index is an index into the
- * library's table of contents. This is used as the starting point of the
- * binary search or a directed linear search.
- */
-struct twolevel_hint {
- uint32_t
- isub_image:8, /* index into the sub images */
- itoc:24; /* index into the table of contents */
-};
-
-/*
- * The prebind_cksum_command contains the value of the original check sum for
- * prebound files or zero. When a prebound file is first created or modified
- * for other than updating its prebinding information the value of the check sum
- * is set to zero. When the file has it prebinding re-done and if the value of
- * the check sum is zero the original check sum is calculated and stored in
- * cksum field of this load command in the output file. If when the prebinding
- * is re-done and the cksum field is non-zero it is left unchanged from the
- * input file.
- */
-struct prebind_cksum_command {
- uint32_t cmd; /* LC_PREBIND_CKSUM */
- uint32_t cmdsize; /* sizeof(struct prebind_cksum_command) */
- uint32_t cksum; /* the check sum or zero */
-};
-
-/*
- * The uuid load command contains a single 128-bit unique random number that
- * identifies an object produced by the static link editor.
- */
-struct uuid_command {
- uint32_t cmd; /* LC_UUID */
- uint32_t cmdsize; /* sizeof(struct uuid_command) */
- uint8_t uuid[16]; /* the 128-bit uuid */
-};
-
-/*
- * The rpath_command contains a path which at runtime should be added to
- * the current run path used to find @rpath prefixed dylibs.
- */
-struct rpath_command {
- uint32_t cmd; /* LC_RPATH */
- uint32_t cmdsize; /* includes string */
- union lc_str path; /* path to add to run path */
-};
-
-/*
- * The linkedit_data_command contains the offsets and sizes of a blob
- * of data in the __LINKEDIT segment.
- */
-struct linkedit_data_command {
- uint32_t cmd; /* LC_CODE_SIGNATURE, LC_SEGMENT_SPLIT_INFO,
- or LC_FUNCTION_STARTS */
- uint32_t cmdsize; /* sizeof(struct linkedit_data_command) */
- uint32_t dataoff; /* file offset of data in __LINKEDIT segment */
- uint32_t datasize; /* file size of data in __LINKEDIT segment */
-};
-
-/*
- * The encryption_info_command contains the file offset and size of an
- * of an encrypted segment.
- */
-struct encryption_info_command {
- uint32_t cmd; /* LC_ENCRYPTION_INFO */
- uint32_t cmdsize; /* sizeof(struct encryption_info_command) */
- uint32_t cryptoff; /* file offset of encrypted range */
- uint32_t cryptsize; /* file size of encrypted range */
- uint32_t cryptid; /* which enryption system,
- 0 means not-encrypted yet */
-};
-
-/*
- * The version_min_command contains the min OS version on which this
- * binary was built to run.
- */
-struct version_min_command {
- uint32_t cmd; /* LC_VERSION_MIN_MACOSX or
- LC_VERSION_MIN_IPHONEOS */
- uint32_t cmdsize; /* sizeof(struct min_version_command) */
- uint32_t version; /* X.Y.Z is encoded in nibbles xxxx.yy.zz */
- uint32_t reserved; /* zero */
-};
-
-/*
- * The dyld_info_command contains the file offsets and sizes of
- * the new compressed form of the information dyld needs to
- * load the image. This information is used by dyld on Mac OS X
- * 10.6 and later. All information pointed to by this command
- * is encoded using byte streams, so no endian swapping is needed
- * to interpret it.
- */
-struct dyld_info_command {
- uint32_t cmd; /* LC_DYLD_INFO or LC_DYLD_INFO_ONLY */
- uint32_t cmdsize; /* sizeof(struct dyld_info_command) */
-
- /*
- * Dyld rebases an image whenever dyld loads it at an address different
- * from its preferred address. The rebase information is a stream
- * of byte sized opcodes whose symbolic names start with REBASE_OPCODE_.
- * Conceptually the rebase information is a table of tuples:
- * <seg-index, seg-offset, type>
- * The opcodes are a compressed way to encode the table by only
- * encoding when a column changes. In addition simple patterns
- * like "every n'th offset for m times" can be encoded in a few
- * bytes.
- */
- uint32_t rebase_off; /* file offset to rebase info */
- uint32_t rebase_size; /* size of rebase info */
-
- /*
- * Dyld binds an image during the loading process, if the image
- * requires any pointers to be initialized to symbols in other images.
- * The bind information is a stream of byte sized
- * opcodes whose symbolic names start with BIND_OPCODE_.
- * Conceptually the bind information is a table of tuples:
- * <seg-index, seg-offset, type, symbol-library-ordinal, symbol-name, addend>
- * The opcodes are a compressed way to encode the table by only
- * encoding when a column changes. In addition simple patterns
- * like for runs of pointers initialzed to the same value can be
- * encoded in a few bytes.
- */
- uint32_t bind_off; /* file offset to binding info */
- uint32_t bind_size; /* size of binding info */
-
- /*
- * Some C++ programs require dyld to unique symbols so that all
- * images in the process use the same copy of some code/data.
- * This step is done after binding. The content of the weak_bind
- * info is an opcode stream like the bind_info. But it is sorted
- * alphabetically by symbol name. This enable dyld to walk
- * all images with weak binding information in order and look
- * for collisions. If there are no collisions, dyld does
- * no updating. That means that some fixups are also encoded
- * in the bind_info. For instance, all calls to "operator new"
- * are first bound to libstdc++.dylib using the information
- * in bind_info. Then if some image overrides operator new
- * that is detected when the weak_bind information is processed
- * and the call to operator new is then rebound.
- */
- uint32_t weak_bind_off; /* file offset to weak binding info */
- uint32_t weak_bind_size; /* size of weak binding info */
-
- /*
- * Some uses of external symbols do not need to be bound immediately.
- * Instead they can be lazily bound on first use. The lazy_bind
- * are contains a stream of BIND opcodes to bind all lazy symbols.
- * Normal use is that dyld ignores the lazy_bind section when
- * loading an image. Instead the static linker arranged for the
- * lazy pointer to initially point to a helper function which
- * pushes the offset into the lazy_bind area for the symbol
- * needing to be bound, then jumps to dyld which simply adds
- * the offset to lazy_bind_off to get the information on what
- * to bind.
- */
- uint32_t lazy_bind_off; /* file offset to lazy binding info */
- uint32_t lazy_bind_size; /* size of lazy binding infs */
-
- /*
- * The symbols exported by a dylib are encoded in a trie. This
- * is a compact representation that factors out common prefixes.
- * It also reduces LINKEDIT pages in RAM because it encodes all
- * information (name, address, flags) in one small, contiguous range.
- * The export area is a stream of nodes. The first node sequentially
- * is the start node for the trie.
- *
- * Nodes for a symbol start with a uleb128 that is the length of
- * the exported symbol information for the string so far.
- * If there is no exported symbol, the node starts with a zero byte.
- * If there is exported info, it follows the length. First is
- * a uleb128 containing flags. Normally, it is followed by a
- * uleb128 encoded offset which is location of the content named
- * by the symbol from the mach_header for the image. If the flags
- * is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags is
- * a uleb128 encoded library ordinal, then a zero terminated
- * UTF8 string. If the string is zero length, then the symbol
- * is re-export from the specified dylib with the same name.
- *
- * After the optional exported symbol information is a byte of
- * how many edges (0-255) that this node has leaving it,
- * followed by each edge.
- * Each edge is a zero terminated UTF8 of the addition chars
- * in the symbol, followed by a uleb128 offset for the node that
- * edge points to.
- *
- */
- uint32_t export_off; /* file offset to lazy binding info */
- uint32_t export_size; /* size of lazy binding infs */
-};
-
-/*
- * The following are used to encode rebasing information
- */
-#define REBASE_TYPE_POINTER 1
-#define REBASE_TYPE_TEXT_ABSOLUTE32 2
-#define REBASE_TYPE_TEXT_PCREL32 3
-
-#define REBASE_OPCODE_MASK 0xF0
-#define REBASE_IMMEDIATE_MASK 0x0F
-#define REBASE_OPCODE_DONE 0x00
-#define REBASE_OPCODE_SET_TYPE_IMM 0x10
-#define REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x20
-#define REBASE_OPCODE_ADD_ADDR_ULEB 0x30
-#define REBASE_OPCODE_ADD_ADDR_IMM_SCALED 0x40
-#define REBASE_OPCODE_DO_REBASE_IMM_TIMES 0x50
-#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES 0x60
-#define REBASE_OPCODE_DO_REBASE_ADD_ADDR_ULEB 0x70
-#define REBASE_OPCODE_DO_REBASE_ULEB_TIMES_SKIPPING_ULEB 0x80
-
-
-/*
- * The following are used to encode binding information
- */
-#define BIND_TYPE_POINTER 1
-#define BIND_TYPE_TEXT_ABSOLUTE32 2
-#define BIND_TYPE_TEXT_PCREL32 3
-
-#define BIND_SPECIAL_DYLIB_SELF 0
-#define BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE -1
-#define BIND_SPECIAL_DYLIB_FLAT_LOOKUP -2
-
-#define BIND_SYMBOL_FLAGS_WEAK_IMPORT 0x1
-#define BIND_SYMBOL_FLAGS_NON_WEAK_DEFINITION 0x8
-
-#define BIND_OPCODE_MASK 0xF0
-#define BIND_IMMEDIATE_MASK 0x0F
-#define BIND_OPCODE_DONE 0x00
-#define BIND_OPCODE_SET_DYLIB_ORDINAL_IMM 0x10
-#define BIND_OPCODE_SET_DYLIB_ORDINAL_ULEB 0x20
-#define BIND_OPCODE_SET_DYLIB_SPECIAL_IMM 0x30
-#define BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM 0x40
-#define BIND_OPCODE_SET_TYPE_IMM 0x50
-#define BIND_OPCODE_SET_ADDEND_SLEB 0x60
-#define BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB 0x70
-#define BIND_OPCODE_ADD_ADDR_ULEB 0x80
-#define BIND_OPCODE_DO_BIND 0x90
-#define BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB 0xA0
-#define BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED 0xB0
-#define BIND_OPCODE_DO_BIND_ULEB_TIMES_SKIPPING_ULEB 0xC0
-
-
-/*
- * The following are used on the flags byte of a terminal node
- * in the export information.
- */
-#define EXPORT_SYMBOL_FLAGS_KIND_MASK 0x03
-#define EXPORT_SYMBOL_FLAGS_KIND_REGULAR 0x00
-#define EXPORT_SYMBOL_FLAGS_KIND_THREAD_LOCAL 0x01
-#define EXPORT_SYMBOL_FLAGS_WEAK_DEFINITION 0x04
-#define EXPORT_SYMBOL_FLAGS_REEXPORT 0x08
-#define EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER 0x10
-
-/*
- * The symseg_command contains the offset and size of the GNU style
- * symbol table information as described in the header file <symseg.h>.
- * The symbol roots of the symbol segments must also be aligned properly
- * in the file. So the requirement of keeping the offsets aligned to a
- * multiple of a 4 bytes translates to the length field of the symbol
- * roots also being a multiple of a long. Also the padding must again be
- * zeroed. (THIS IS OBSOLETE and no longer supported).
- */
-struct symseg_command {
- uint32_t cmd; /* LC_SYMSEG */
- uint32_t cmdsize; /* sizeof(struct symseg_command) */
- uint32_t offset; /* symbol segment offset */
- uint32_t size; /* symbol segment size in bytes */
-};
-
-/*
- * The ident_command contains a free format string table following the
- * ident_command structure. The strings are null terminated and the size of
- * the command is padded out with zero bytes to a multiple of 4 bytes/
- * (THIS IS OBSOLETE and no longer supported).
- */
-struct ident_command {
- uint32_t cmd; /* LC_IDENT */
- uint32_t cmdsize; /* strings that follow this command */
-};
-
-/*
- * The fvmfile_command contains a reference to a file to be loaded at the
- * specified virtual address. (Presently, this command is reserved for
- * internal use. The kernel ignores this command when loading a program into
- * memory).
- */
-struct fvmfile_command {
- uint32_t cmd; /* LC_FVMFILE */
- uint32_t cmdsize; /* includes pathname string */
- union lc_str name; /* files pathname */
- uint32_t header_addr; /* files virtual address */
-};
-
-/*
- * Sections of type S_THREAD_LOCAL_VARIABLES contain an array
- * of tlv_descriptor structures.
- */
-struct tlv_descriptor
-{
- void* (*thunk)(struct tlv_descriptor*);
- unsigned long key;
- unsigned long offset;
-};
-
-#endif /* _MACHO_LOADER_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/nlist.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/nlist.h
deleted file mode 100644
index 1c1941012e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach-o/nlist.h
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
- *
- * @APPLE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_LICENSE_HEADER_END@
- */
-#ifndef _MACHO_NLIST_H_
-#define _MACHO_NLIST_H_
-/* $NetBSD: nlist.h,v 1.5 1994/10/26 00:56:11 cgd Exp $ */
-
-/*-
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)nlist.h 8.2 (Berkeley) 1/21/94
- */
-#include <stdint.h>
-
-/*
- * Format of a symbol table entry of a Mach-O file for 32-bit architectures.
- * Modified from the BSD format. The modifications from the original format
- * were changing n_other (an unused field) to n_sect and the addition of the
- * N_SECT type. These modifications are required to support symbols in a larger
- * number of sections not just the three sections (text, data and bss) in a BSD
- * file.
- */
-struct nlist {
- union {
-#ifndef __LP64__
- char *n_name; /* for use when in-core */
-#endif
- int32_t n_strx; /* index into the string table */
- } n_un;
- uint8_t n_type; /* type flag, see below */
- uint8_t n_sect; /* section number or NO_SECT */
- int16_t n_desc; /* see <mach-o/stab.h> */
- uint32_t n_value; /* value of this symbol (or stab offset) */
-};
-
-/*
- * This is the symbol table entry structure for 64-bit architectures.
- */
-struct nlist_64 {
- union {
- uint32_t n_strx; /* index into the string table */
- } n_un;
- uint8_t n_type; /* type flag, see below */
- uint8_t n_sect; /* section number or NO_SECT */
- uint16_t n_desc; /* see <mach-o/stab.h> */
- uint64_t n_value; /* value of this symbol (or stab offset) */
-};
-
-/*
- * Symbols with a index into the string table of zero (n_un.n_strx == 0) are
- * defined to have a null, "", name. Therefore all string indexes to non null
- * names must not have a zero string index. This is bit historical information
- * that has never been well documented.
- */
-
-/*
- * The n_type field really contains four fields:
- * unsigned char N_STAB:3,
- * N_PEXT:1,
- * N_TYPE:3,
- * N_EXT:1;
- * which are used via the following masks.
- */
-#define N_STAB 0xe0 /* if any of these bits set, a symbolic debugging entry */
-#define N_PEXT 0x10 /* private external symbol bit */
-#define N_TYPE 0x0e /* mask for the type bits */
-#define N_EXT 0x01 /* external symbol bit, set for external symbols */
-
-/*
- * Only symbolic debugging entries have some of the N_STAB bits set and if any
- * of these bits are set then it is a symbolic debugging entry (a stab). In
- * which case then the values of the n_type field (the entire field) are given
- * in <mach-o/stab.h>
- */
-
-/*
- * Values for N_TYPE bits of the n_type field.
- */
-#define N_UNDF 0x0 /* undefined, n_sect == NO_SECT */
-#define N_ABS 0x2 /* absolute, n_sect == NO_SECT */
-#define N_SECT 0xe /* defined in section number n_sect */
-#define N_PBUD 0xc /* prebound undefined (defined in a dylib) */
-#define N_INDR 0xa /* indirect */
-
-/*
- * If the type is N_INDR then the symbol is defined to be the same as another
- * symbol. In this case the n_value field is an index into the string table
- * of the other symbol's name. When the other symbol is defined then they both
- * take on the defined type and value.
- */
-
-/*
- * If the type is N_SECT then the n_sect field contains an ordinal of the
- * section the symbol is defined in. The sections are numbered from 1 and
- * refer to sections in order they appear in the load commands for the file
- * they are in. This means the same ordinal may very well refer to different
- * sections in different files.
- *
- * The n_value field for all symbol table entries (including N_STAB's) gets
- * updated by the link editor based on the value of it's n_sect field and where
- * the section n_sect references gets relocated. If the value of the n_sect
- * field is NO_SECT then it's n_value field is not changed by the link editor.
- */
-#define NO_SECT 0 /* symbol is not in any section */
-#define MAX_SECT 255 /* 1 thru 255 inclusive */
-
-/*
- * Common symbols are represented by undefined (N_UNDF) external (N_EXT) types
- * who's values (n_value) are non-zero. In which case the value of the n_value
- * field is the size (in bytes) of the common symbol. The n_sect field is set
- * to NO_SECT. The alignment of a common symbol may be set as a power of 2
- * between 2^1 and 2^15 as part of the n_desc field using the macros below. If
- * the alignment is not set (a value of zero) then natural alignment based on
- * the size is used.
- */
-#define GET_COMM_ALIGN(n_desc) (((n_desc) >> 8) & 0x0f)
-#define SET_COMM_ALIGN(n_desc,align) \
- (n_desc) = (((n_desc) & 0xf0ff) | (((align) & 0x0f) << 8))
-
-/*
- * To support the lazy binding of undefined symbols in the dynamic link-editor,
- * the undefined symbols in the symbol table (the nlist structures) are marked
- * with the indication if the undefined reference is a lazy reference or
- * non-lazy reference. If both a non-lazy reference and a lazy reference is
- * made to the same symbol the non-lazy reference takes precedence. A reference
- * is lazy only when all references to that symbol are made through a symbol
- * pointer in a lazy symbol pointer section.
- *
- * The implementation of marking nlist structures in the symbol table for
- * undefined symbols will be to use some of the bits of the n_desc field as a
- * reference type. The mask REFERENCE_TYPE will be applied to the n_desc field
- * of an nlist structure for an undefined symbol to determine the type of
- * undefined reference (lazy or non-lazy).
- *
- * The constants for the REFERENCE FLAGS are propagated to the reference table
- * in a shared library file. In that case the constant for a defined symbol,
- * REFERENCE_FLAG_DEFINED, is also used.
- */
-/* Reference type bits of the n_desc field of undefined symbols */
-#define REFERENCE_TYPE 0x7
-/* types of references */
-#define REFERENCE_FLAG_UNDEFINED_NON_LAZY 0
-#define REFERENCE_FLAG_UNDEFINED_LAZY 1
-#define REFERENCE_FLAG_DEFINED 2
-#define REFERENCE_FLAG_PRIVATE_DEFINED 3
-#define REFERENCE_FLAG_PRIVATE_UNDEFINED_NON_LAZY 4
-#define REFERENCE_FLAG_PRIVATE_UNDEFINED_LAZY 5
-
-/*
- * To simplify stripping of objects that use are used with the dynamic link
- * editor, the static link editor marks the symbols defined an object that are
- * referenced by a dynamicly bound object (dynamic shared libraries, bundles).
- * With this marking strip knows not to strip these symbols.
- */
-#define REFERENCED_DYNAMICALLY 0x0010
-
-/*
- * For images created by the static link editor with the -twolevel_namespace
- * option in effect the flags field of the mach header is marked with
- * MH_TWOLEVEL. And the binding of the undefined references of the image are
- * determined by the static link editor. Which library an undefined symbol is
- * bound to is recorded by the static linker in the high 8 bits of the n_desc
- * field using the SET_LIBRARY_ORDINAL macro below. The ordinal recorded
- * references the libraries listed in the Mach-O's LC_LOAD_DYLIB,
- * LC_LOAD_WEAK_DYLIB, LC_REEXPORT_DYLIB, LC_LOAD_UPWARD_DYLIB, and
- * LC_LAZY_LOAD_DYLIB, etc. load commands in the order they appear in the
- * headers. The library ordinals start from 1.
- * For a dynamic library that is built as a two-level namespace image the
- * undefined references from module defined in another use the same nlist struct
- * an in that case SELF_LIBRARY_ORDINAL is used as the library ordinal. For
- * defined symbols in all images they also must have the library ordinal set to
- * SELF_LIBRARY_ORDINAL. The EXECUTABLE_ORDINAL refers to the executable
- * image for references from plugins that refer to the executable that loads
- * them.
- *
- * The DYNAMIC_LOOKUP_ORDINAL is for undefined symbols in a two-level namespace
- * image that are looked up by the dynamic linker with flat namespace semantics.
- * This ordinal was added as a feature in Mac OS X 10.3 by reducing the
- * value of MAX_LIBRARY_ORDINAL by one. So it is legal for existing binaries
- * or binaries built with older tools to have 0xfe (254) dynamic libraries. In
- * this case the ordinal value 0xfe (254) must be treated as a library ordinal
- * for compatibility.
- */
-#define GET_LIBRARY_ORDINAL(n_desc) (((n_desc) >> 8) & 0xff)
-#define SET_LIBRARY_ORDINAL(n_desc,ordinal) \
- (n_desc) = (((n_desc) & 0x00ff) | (((ordinal) & 0xff) << 8))
-#define SELF_LIBRARY_ORDINAL 0x0
-#define MAX_LIBRARY_ORDINAL 0xfd
-#define DYNAMIC_LOOKUP_ORDINAL 0xfe
-#define EXECUTABLE_ORDINAL 0xff
-
-/*
- * The bit 0x0020 of the n_desc field is used for two non-overlapping purposes
- * and has two different symbolic names, N_NO_DEAD_STRIP and N_DESC_DISCARDED.
- */
-
-/*
- * The N_NO_DEAD_STRIP bit of the n_desc field only ever appears in a
- * relocatable .o file (MH_OBJECT filetype). And is used to indicate to the
- * static link editor it is never to dead strip the symbol.
- */
-#define N_NO_DEAD_STRIP 0x0020 /* symbol is not to be dead stripped */
-
-/*
- * The N_DESC_DISCARDED bit of the n_desc field never appears in linked image.
- * But is used in very rare cases by the dynamic link editor to mark an in
- * memory symbol as discared and longer used for linking.
- */
-#define N_DESC_DISCARDED 0x0020 /* symbol is discarded */
-
-/*
- * The N_WEAK_REF bit of the n_desc field indicates to the dynamic linker that
- * the undefined symbol is allowed to be missing and is to have the address of
- * zero when missing.
- */
-#define N_WEAK_REF 0x0040 /* symbol is weak referenced */
-
-/*
- * The N_WEAK_DEF bit of the n_desc field indicates to the static and dynamic
- * linkers that the symbol definition is weak, allowing a non-weak symbol to
- * also be used which causes the weak definition to be discared. Currently this
- * is only supported for symbols in coalesed sections.
- */
-#define N_WEAK_DEF 0x0080 /* coalesed symbol is a weak definition */
-
-/*
- * The N_REF_TO_WEAK bit of the n_desc field indicates to the dynamic linker
- * that the undefined symbol should be resolved using flat namespace searching.
- */
-#define N_REF_TO_WEAK 0x0080 /* reference to a weak symbol */
-
-/*
- * The N_ARM_THUMB_DEF bit of the n_desc field indicates that the symbol is
- * a defintion of a Thumb function.
- */
-#define N_ARM_THUMB_DEF 0x0008 /* symbol is a Thumb function (ARM) */
-
-/*
- * The N_SYMBOL_RESOLVER bit of the n_desc field indicates that the
- * that the function is actually a resolver function and should
- * be called to get the address of the real function to use.
- * This bit is only available in .o files (MH_OBJECT filetype)
- */
-#define N_SYMBOL_RESOLVER 0x0100
-
-#ifndef __STRICT_BSD__
-#if __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-/*
- * The function nlist(3) from the C library.
- */
-extern int nlist (const char *filename, struct nlist *list);
-#if __cplusplus
-}
-#endif /* __cplusplus */
-#endif /* __STRICT_BSD__ */
-
-#endif /* _MACHO_LIST_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/boolean.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/boolean.h
deleted file mode 100644
index 641c3962d9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/boolean.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * File: mach/boolean.h
- *
- * Boolean data type.
- *
- */
-
-#ifndef _MACH_BOOLEAN_H_
-#define _MACH_BOOLEAN_H_
-
-/*
- * Pick up "boolean_t" type definition
- */
-
-#ifndef ASSEMBLER
-#include <mach/machine/boolean.h>
-#endif /* ASSEMBLER */
-
-/*
- * Define TRUE and FALSE if not defined.
- */
-
-#ifndef TRUE
-#define TRUE 1
-#endif /* TRUE */
-
-#ifndef FALSE
-#define FALSE 0
-#endif /* FALSE */
-
-#endif /* _MACH_BOOLEAN_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/boolean.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/boolean.h
deleted file mode 100644
index 100f7e7b51..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/boolean.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-
-/*
- * File: boolean.h
- *
- * Boolean type, for I386.
- */
-
-#ifndef _MACH_I386_BOOLEAN_H_
-#define _MACH_I386_BOOLEAN_H_
-
-#if defined(__x86_64__) && !defined(KERNEL)
-typedef unsigned int boolean_t;
-#else
-typedef int boolean_t;
-#endif
-
-#endif /* _MACH_I386_BOOLEAN_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_param.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_param.h
deleted file mode 100644
index edcb83496b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_param.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-
-/*
- * Copyright (c) 1994 The University of Utah and
- * the Computer Systems Laboratory at the University of Utah (CSL).
- * All rights reserved.
- *
- * Permission to use, copy, modify and distribute this software is hereby
- * granted provided that (1) source code retains these copyright, permission,
- * and disclaimer notices, and (2) redistributions including binaries
- * reproduce the notices in supporting documentation, and (3) all advertising
- * materials mentioning features or use of this software display the following
- * acknowledgement: ``This product includes software developed by the
- * Computer Systems Laboratory at the University of Utah.''
- *
- * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
- * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
- * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * CSL requests users of this software to return to csl-dist@cs.utah.edu any
- * improvements that they make and grant CSL redistribution rights.
- *
- */
-
-/*
- * File: vm_param.h
- * Author: Avadis Tevanian, Jr.
- * Date: 1985
- *
- * I386 machine dependent virtual memory parameters.
- * Most of the declarations are preceeded by I386_ (or i386_)
- * which is OK because only I386 specific code will be using
- * them.
- */
-
-#ifndef _MACH_I386_VM_PARAM_H_
-#define _MACH_I386_VM_PARAM_H_
-
-#define BYTE_SIZE 8 /* byte size in bits */
-
-#define I386_PGBYTES 4096 /* bytes per 80386 page */
-#define I386_PGSHIFT 12 /* bitshift for pages */
-
-#define PAGE_SIZE I386_PGBYTES
-#define PAGE_SHIFT I386_PGSHIFT
-#define PAGE_MASK (PAGE_SIZE - 1)
-
-#define I386_LPGBYTES 2*1024*1024 /* bytes per large page */
-#define I386_LPGSHIFT 21 /* bitshift for large pages */
-#define I386_LPGMASK (I386_LPGBYTES-1)
-
-/*
- * Convert bytes to pages and convert pages to bytes.
- * No rounding is used.
- */
-
-#define i386_btop(x) ((ppnum_t)((x) >> I386_PGSHIFT))
-#define machine_btop(x) i386_btop(x)
-#define i386_ptob(x) (((pmap_paddr_t)(x)) << I386_PGSHIFT)
-
-/*
- * Round off or truncate to the nearest page. These will work
- * for either addresses or counts. (i.e. 1 byte rounds to 1 page
- * bytes.
- */
-
-#define i386_round_page(x) ((((pmap_paddr_t)(x)) + I386_PGBYTES - 1) & \
- ~(I386_PGBYTES-1))
-#define i386_trunc_page(x) (((pmap_paddr_t)(x)) & ~(I386_PGBYTES-1))
-
-
-
-#define VM_MIN_ADDRESS64 ((user_addr_t) 0x0000000000000000ULL)
-/*
- * default top of user stack... it grows down from here
- */
-#define VM_USRSTACK64 ((user_addr_t) 0x00007FFF5FC00000ULL)
-#define VM_DYLD64 ((user_addr_t) 0x00007FFF5FC00000ULL)
-#define VM_LIB64_SHR_DATA ((user_addr_t) 0x00007FFF60000000ULL)
-#define VM_LIB64_SHR_TEXT ((user_addr_t) 0x00007FFF80000000ULL)
-/*
- * the end of the usable user address space , for now about 47 bits.
- * the 64 bit commpage is past the end of this
- */
-#define VM_MAX_PAGE_ADDRESS ((user_addr_t) 0x00007FFFFFE00000ULL)
-/*
- * canonical end of user address space for limits checking
- */
-#define VM_MAX_USER_PAGE_ADDRESS ((user_addr_t)0x00007FFFFFFFF000ULL)
-
-
-/* system-wide values */
-#define MACH_VM_MIN_ADDRESS ((mach_vm_offset_t) 0)
-#define MACH_VM_MAX_ADDRESS ((mach_vm_offset_t) VM_MAX_PAGE_ADDRESS)
-
-/* process-relative values (all 32-bit legacy only for now) */
-#define VM_MIN_ADDRESS ((vm_offset_t) 0)
-#define VM_USRSTACK32 ((vm_offset_t) 0xC0000000)
-#define VM_MAX_ADDRESS ((vm_offset_t) 0xFFE00000)
-
-
-
-#endif /* _MACH_I386_VM_PARAM_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_types.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_types.h
deleted file mode 100644
index 2c38fa2d70..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/i386/vm_types.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-
-/*
- * File: vm_types.h
- * Author: Avadis Tevanian, Jr.
- * Date: 1985
- *
- * Header file for VM data types. I386 version.
- */
-
-#ifndef _MACH_I386_VM_TYPES_H_
-#define _MACH_I386_VM_TYPES_H_
-
-#ifndef ASSEMBLER
-
-#include <i386/_types.h>
-#include <mach/i386/vm_param.h>
-#include <stdint.h>
-
-/*
- * natural_t and integer_t are Mach's legacy types for machine-
- * independent integer types (unsigned, and signed, respectively).
- * Their original purpose was to define other types in a machine/
- * compiler independent way.
- *
- * They also had an implicit "same size as pointer" characteristic
- * to them (i.e. Mach's traditional types are very ILP32 or ILP64
- * centric). We support x86 ABIs that do not follow either of
- * these models (specifically LP64). Therefore, we had to make a
- * choice between making these types scale with pointers or stay
- * tied to integers. Because their use is predominantly tied to
- * to the size of an integer, we are keeping that association and
- * breaking free from pointer size guarantees.
- *
- * New use of these types is discouraged.
- */
-typedef __darwin_natural_t natural_t;
-typedef int integer_t;
-
-/*
- * A vm_offset_t is a type-neutral pointer,
- * e.g. an offset into a virtual memory space.
- */
-#ifdef __LP64__
-typedef uintptr_t vm_offset_t;
-#else /* __LP64__ */
-typedef natural_t vm_offset_t;
-#endif /* __LP64__ */
-
-/*
- * A vm_size_t is the proper type for e.g.
- * expressing the difference between two
- * vm_offset_t entities.
- */
-#ifdef __LP64__
-typedef uintptr_t vm_size_t;
-#else /* __LP64__ */
-typedef natural_t vm_size_t;
-#endif /* __LP64__ */
-
-/*
- * This new type is independent of a particular vm map's
- * implementation size - and represents appropriate types
- * for all possible maps. This is used for interfaces
- * where the size of the map is not known - or we don't
- * want to have to distinguish.
- */
-typedef uint64_t mach_vm_address_t;
-typedef uint64_t mach_vm_offset_t;
-typedef uint64_t mach_vm_size_t;
-
-typedef uint64_t vm_map_offset_t;
-typedef uint64_t vm_map_address_t;
-typedef uint64_t vm_map_size_t;
-
-
-#endif /* ASSEMBLER */
-
-/*
- * If composing messages by hand (please do not)
- */
-#define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32
-
-#endif /* _MACH_I386_VM_TYPES_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine.h
deleted file mode 100644
index 91d9d709b5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine.h
+++ /dev/null
@@ -1,346 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/* File: machine.h
- * Author: Avadis Tevanian, Jr.
- * Date: 1986
- *
- * Machine independent machine abstraction.
- */
-
-#ifndef _MACH_MACHINE_H_
-#define _MACH_MACHINE_H_
-
-#include <stdint.h>
-#include <mach/machine/vm_types.h>
-#include <mach/boolean.h>
-
-typedef integer_t cpu_type_t;
-typedef integer_t cpu_subtype_t;
-typedef integer_t cpu_threadtype_t;
-
-#define CPU_STATE_MAX 4
-
-#define CPU_STATE_USER 0
-#define CPU_STATE_SYSTEM 1
-#define CPU_STATE_IDLE 2
-#define CPU_STATE_NICE 3
-
-
-
-/*
- * Capability bits used in the definition of cpu_type.
- */
-#define CPU_ARCH_MASK 0xff000000 /* mask for architecture bits */
-#define CPU_ARCH_ABI64 0x01000000 /* 64 bit ABI */
-
-/*
- * Machine types known by all.
- */
-
-#define CPU_TYPE_ANY ((cpu_type_t) -1)
-
-#define CPU_TYPE_VAX ((cpu_type_t) 1)
-/* skip ((cpu_type_t) 2) */
-/* skip ((cpu_type_t) 3) */
-/* skip ((cpu_type_t) 4) */
-/* skip ((cpu_type_t) 5) */
-#define CPU_TYPE_MC680x0 ((cpu_type_t) 6)
-#define CPU_TYPE_X86 ((cpu_type_t) 7)
-#define CPU_TYPE_I386 CPU_TYPE_X86 /* compatibility */
-#define CPU_TYPE_X86_64 (CPU_TYPE_X86 | CPU_ARCH_ABI64)
-
-/* skip CPU_TYPE_MIPS ((cpu_type_t) 8) */
-/* skip ((cpu_type_t) 9) */
-#define CPU_TYPE_MC98000 ((cpu_type_t) 10)
-#define CPU_TYPE_HPPA ((cpu_type_t) 11)
-#define CPU_TYPE_ARM ((cpu_type_t) 12)
-#define CPU_TYPE_MC88000 ((cpu_type_t) 13)
-#define CPU_TYPE_SPARC ((cpu_type_t) 14)
-#define CPU_TYPE_I860 ((cpu_type_t) 15)
-/* skip CPU_TYPE_ALPHA ((cpu_type_t) 16) */
-/* skip ((cpu_type_t) 17) */
-#define CPU_TYPE_POWERPC ((cpu_type_t) 18)
-#define CPU_TYPE_POWERPC64 (CPU_TYPE_POWERPC | CPU_ARCH_ABI64)
-
-/*
- * Machine subtypes (these are defined here, instead of in a machine
- * dependent directory, so that any program can get all definitions
- * regardless of where is it compiled).
- */
-
-/*
- * Capability bits used in the definition of cpu_subtype.
- */
-#define CPU_SUBTYPE_MASK 0xff000000 /* mask for feature flags */
-#define CPU_SUBTYPE_LIB64 0x80000000 /* 64 bit libraries */
-
-
-/*
- * Object files that are hand-crafted to run on any
- * implementation of an architecture are tagged with
- * CPU_SUBTYPE_MULTIPLE. This functions essentially the same as
- * the "ALL" subtype of an architecture except that it allows us
- * to easily find object files that may need to be modified
- * whenever a new implementation of an architecture comes out.
- *
- * It is the responsibility of the implementor to make sure the
- * software handles unsupported implementations elegantly.
- */
-#define CPU_SUBTYPE_MULTIPLE ((cpu_subtype_t) -1)
-#define CPU_SUBTYPE_LITTLE_ENDIAN ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_BIG_ENDIAN ((cpu_subtype_t) 1)
-
-/*
- * Machine threadtypes.
- * This is none - not defined - for most machine types/subtypes.
- */
-#define CPU_THREADTYPE_NONE ((cpu_threadtype_t) 0)
-
-/*
- * VAX subtypes (these do *not* necessary conform to the actual cpu
- * ID assigned by DEC available via the SID register).
- */
-
-#define CPU_SUBTYPE_VAX_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_VAX780 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_VAX785 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_VAX750 ((cpu_subtype_t) 3)
-#define CPU_SUBTYPE_VAX730 ((cpu_subtype_t) 4)
-#define CPU_SUBTYPE_UVAXI ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_UVAXII ((cpu_subtype_t) 6)
-#define CPU_SUBTYPE_VAX8200 ((cpu_subtype_t) 7)
-#define CPU_SUBTYPE_VAX8500 ((cpu_subtype_t) 8)
-#define CPU_SUBTYPE_VAX8600 ((cpu_subtype_t) 9)
-#define CPU_SUBTYPE_VAX8650 ((cpu_subtype_t) 10)
-#define CPU_SUBTYPE_VAX8800 ((cpu_subtype_t) 11)
-#define CPU_SUBTYPE_UVAXIII ((cpu_subtype_t) 12)
-
-/*
- * 680x0 subtypes
- *
- * The subtype definitions here are unusual for historical reasons.
- * NeXT used to consider 68030 code as generic 68000 code. For
- * backwards compatability:
- *
- * CPU_SUBTYPE_MC68030 symbol has been preserved for source code
- * compatability.
- *
- * CPU_SUBTYPE_MC680x0_ALL has been defined to be the same
- * subtype as CPU_SUBTYPE_MC68030 for binary comatability.
- *
- * CPU_SUBTYPE_MC68030_ONLY has been added to allow new object
- * files to be tagged as containing 68030-specific instructions.
- */
-
-#define CPU_SUBTYPE_MC680x0_ALL ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_MC68030 ((cpu_subtype_t) 1) /* compat */
-#define CPU_SUBTYPE_MC68040 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_MC68030_ONLY ((cpu_subtype_t) 3)
-
-/*
- * I386 subtypes
- */
-
-#define CPU_SUBTYPE_INTEL(f, m) ((cpu_subtype_t) (f) + ((m) << 4))
-
-#define CPU_SUBTYPE_I386_ALL CPU_SUBTYPE_INTEL(3, 0)
-#define CPU_SUBTYPE_386 CPU_SUBTYPE_INTEL(3, 0)
-#define CPU_SUBTYPE_486 CPU_SUBTYPE_INTEL(4, 0)
-#define CPU_SUBTYPE_486SX CPU_SUBTYPE_INTEL(4, 8) // 8 << 4 = 128
-#define CPU_SUBTYPE_586 CPU_SUBTYPE_INTEL(5, 0)
-#define CPU_SUBTYPE_PENT CPU_SUBTYPE_INTEL(5, 0)
-#define CPU_SUBTYPE_PENTPRO CPU_SUBTYPE_INTEL(6, 1)
-#define CPU_SUBTYPE_PENTII_M3 CPU_SUBTYPE_INTEL(6, 3)
-#define CPU_SUBTYPE_PENTII_M5 CPU_SUBTYPE_INTEL(6, 5)
-#define CPU_SUBTYPE_CELERON CPU_SUBTYPE_INTEL(7, 6)
-#define CPU_SUBTYPE_CELERON_MOBILE CPU_SUBTYPE_INTEL(7, 7)
-#define CPU_SUBTYPE_PENTIUM_3 CPU_SUBTYPE_INTEL(8, 0)
-#define CPU_SUBTYPE_PENTIUM_3_M CPU_SUBTYPE_INTEL(8, 1)
-#define CPU_SUBTYPE_PENTIUM_3_XEON CPU_SUBTYPE_INTEL(8, 2)
-#define CPU_SUBTYPE_PENTIUM_M CPU_SUBTYPE_INTEL(9, 0)
-#define CPU_SUBTYPE_PENTIUM_4 CPU_SUBTYPE_INTEL(10, 0)
-#define CPU_SUBTYPE_PENTIUM_4_M CPU_SUBTYPE_INTEL(10, 1)
-#define CPU_SUBTYPE_ITANIUM CPU_SUBTYPE_INTEL(11, 0)
-#define CPU_SUBTYPE_ITANIUM_2 CPU_SUBTYPE_INTEL(11, 1)
-#define CPU_SUBTYPE_XEON CPU_SUBTYPE_INTEL(12, 0)
-#define CPU_SUBTYPE_XEON_MP CPU_SUBTYPE_INTEL(12, 1)
-
-#define CPU_SUBTYPE_INTEL_FAMILY(x) ((x) & 15)
-#define CPU_SUBTYPE_INTEL_FAMILY_MAX 15
-
-#define CPU_SUBTYPE_INTEL_MODEL(x) ((x) >> 4)
-#define CPU_SUBTYPE_INTEL_MODEL_ALL 0
-
-/*
- * X86 subtypes.
- */
-
-#define CPU_SUBTYPE_X86_ALL ((cpu_subtype_t)3)
-#define CPU_SUBTYPE_X86_64_ALL ((cpu_subtype_t)3)
-#define CPU_SUBTYPE_X86_ARCH1 ((cpu_subtype_t)4)
-
-
-#define CPU_THREADTYPE_INTEL_HTT ((cpu_threadtype_t) 1)
-
-/*
- * Mips subtypes.
- */
-
-#define CPU_SUBTYPE_MIPS_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_MIPS_R2300 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_MIPS_R2600 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_MIPS_R2800 ((cpu_subtype_t) 3)
-#define CPU_SUBTYPE_MIPS_R2000a ((cpu_subtype_t) 4) /* pmax */
-#define CPU_SUBTYPE_MIPS_R2000 ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_MIPS_R3000a ((cpu_subtype_t) 6) /* 3max */
-#define CPU_SUBTYPE_MIPS_R3000 ((cpu_subtype_t) 7)
-
-/*
- * MC98000 (PowerPC) subtypes
- */
-#define CPU_SUBTYPE_MC98000_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_MC98601 ((cpu_subtype_t) 1)
-
-/*
- * HPPA subtypes for Hewlett-Packard HP-PA family of
- * risc processors. Port by NeXT to 700 series.
- */
-
-#define CPU_SUBTYPE_HPPA_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_HPPA_7100 ((cpu_subtype_t) 0) /* compat */
-#define CPU_SUBTYPE_HPPA_7100LC ((cpu_subtype_t) 1)
-
-/*
- * MC88000 subtypes.
- */
-#define CPU_SUBTYPE_MC88000_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_MC88100 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_MC88110 ((cpu_subtype_t) 2)
-
-/*
- * SPARC subtypes
- */
-#define CPU_SUBTYPE_SPARC_ALL ((cpu_subtype_t) 0)
-
-/*
- * I860 subtypes
- */
-#define CPU_SUBTYPE_I860_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_I860_860 ((cpu_subtype_t) 1)
-
-/*
- * PowerPC subtypes
- */
-#define CPU_SUBTYPE_POWERPC_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_POWERPC_601 ((cpu_subtype_t) 1)
-#define CPU_SUBTYPE_POWERPC_602 ((cpu_subtype_t) 2)
-#define CPU_SUBTYPE_POWERPC_603 ((cpu_subtype_t) 3)
-#define CPU_SUBTYPE_POWERPC_603e ((cpu_subtype_t) 4)
-#define CPU_SUBTYPE_POWERPC_603ev ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_POWERPC_604 ((cpu_subtype_t) 6)
-#define CPU_SUBTYPE_POWERPC_604e ((cpu_subtype_t) 7)
-#define CPU_SUBTYPE_POWERPC_620 ((cpu_subtype_t) 8)
-#define CPU_SUBTYPE_POWERPC_750 ((cpu_subtype_t) 9)
-#define CPU_SUBTYPE_POWERPC_7400 ((cpu_subtype_t) 10)
-#define CPU_SUBTYPE_POWERPC_7450 ((cpu_subtype_t) 11)
-#define CPU_SUBTYPE_POWERPC_970 ((cpu_subtype_t) 100)
-
-/*
- * ARM subtypes
- */
-#define CPU_SUBTYPE_ARM_ALL ((cpu_subtype_t) 0)
-#define CPU_SUBTYPE_ARM_V4T ((cpu_subtype_t) 5)
-#define CPU_SUBTYPE_ARM_V6 ((cpu_subtype_t) 6)
-#define CPU_SUBTYPE_ARM_V5TEJ ((cpu_subtype_t) 7)
-#define CPU_SUBTYPE_ARM_XSCALE ((cpu_subtype_t) 8)
-#define CPU_SUBTYPE_ARM_V7 ((cpu_subtype_t) 9)
-
-/*
- * CPU families (sysctl hw.cpufamily)
- *
- * These are meant to identify the CPU's marketing name - an
- * application can map these to (possibly) localized strings.
- * NB: the encodings of the CPU families are intentionally arbitrary.
- * There is no ordering, and you should never try to deduce whether
- * or not some feature is available based on the family.
- * Use feature flags (eg, hw.optional.altivec) to test for optional
- * functionality.
- */
-#define CPUFAMILY_UNKNOWN 0
-#define CPUFAMILY_POWERPC_G3 0xcee41549
-#define CPUFAMILY_POWERPC_G4 0x77c184ae
-#define CPUFAMILY_POWERPC_G5 0xed76d8aa
-#define CPUFAMILY_INTEL_6_13 0xaa33392b
-#define CPUFAMILY_INTEL_YONAH 0x73d67300
-#define CPUFAMILY_INTEL_MEROM 0x426f69ef
-#define CPUFAMILY_INTEL_PENRYN 0x78ea4fbc
-#define CPUFAMILY_INTEL_NEHALEM 0x6b5a4cd2
-#define CPUFAMILY_INTEL_WESTMERE 0x573b5eec
-#define CPUFAMILY_INTEL_SANDYBRIDGE 0x5490b78c
-#define CPUFAMILY_ARM_9 0xe73283ae
-#define CPUFAMILY_ARM_11 0x8ff620d8
-#define CPUFAMILY_ARM_XSCALE 0x53b005f5
-#define CPUFAMILY_ARM_13 0x0cc90e64
-#define CPUFAMILY_ARM_14 0x96077ef1
-
-/* The following synonyms are deprecated: */
-#define CPUFAMILY_INTEL_6_14 CPUFAMILY_INTEL_YONAH
-#define CPUFAMILY_INTEL_6_15 CPUFAMILY_INTEL_MEROM
-#define CPUFAMILY_INTEL_6_23 CPUFAMILY_INTEL_PENRYN
-#define CPUFAMILY_INTEL_6_26 CPUFAMILY_INTEL_NEHALEM
-
-#define CPUFAMILY_INTEL_CORE CPUFAMILY_INTEL_YONAH
-#define CPUFAMILY_INTEL_CORE2 CPUFAMILY_INTEL_MEROM
-
-
-#endif /* _MACH_MACHINE_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/boolean.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/boolean.h
deleted file mode 100644
index ffdc2390a8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/boolean.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_BOOLEAN_H_
-#define _MACH_MACHINE_BOOLEAN_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/boolean.h"
-#elif defined (__arm__)
-#include "mach/arm/boolean.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_BOOLEAN_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_state.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_state.h
deleted file mode 100644
index 1547acac76..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_state.h
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * This file is a stub with the bare minimum needed to make things work.
- */
-#ifndef _MACH_MACHINE_THREAD_STATE_H_
-#define _MACH_MACHINE_THREAD_STATE_H_
-
-#define THREAD_STATE_MAX 1
-
-#endif /* _MACH_MACHINE_THREAD_STATE_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_status.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_status.h
deleted file mode 100644
index d1ab56ad58..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/thread_status.h
+++ /dev/null
@@ -1 +0,0 @@
-/* This file intentionally left blank */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/vm_types.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/vm_types.h
deleted file mode 100644
index 8ccd24be53..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/machine/vm_types.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-
-#ifndef _MACH_MACHINE_VM_TYPES_H_
-#define _MACH_MACHINE_VM_TYPES_H_
-
-#if defined (__i386__) || defined(__x86_64__)
-#include "mach/i386/vm_types.h"
-#elif defined (__arm__)
-#include "mach/arm/vm_types.h"
-#else
-#error architecture not supported
-#endif
-
-#endif /* _MACH_MACHINE_VM_TYPES_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/thread_status.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/thread_status.h
deleted file mode 100644
index aead09bf97..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/thread_status.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * File: mach/thread_status.h
- * Author: Avadis Tevanian, Jr.
- *
- * This file contains the structure definitions for the user-visible
- * thread state. This thread state is examined with the thread_get_state
- * kernel call and may be changed with the thread_set_state kernel call.
- *
- */
-
-#ifndef _MACH_THREAD_STATUS_H_
-#define _MACH_THREAD_STATUS_H_
-
-/*
- * The actual structure that comprises the thread state is defined
- * in the machine dependent module.
- */
-#include <mach/machine/vm_types.h>
-#include <mach/machine/thread_status.h>
-#include <mach/machine/thread_state.h>
-
-/*
- * Generic definition for machine-dependent thread status.
- */
-
-typedef natural_t *thread_state_t; /* Variable-length array */
-
-/* THREAD_STATE_MAX is now defined in <mach/machine/thread_state.h> */
-typedef natural_t thread_state_data_t[THREAD_STATE_MAX];
-
-#define THREAD_STATE_FLAVOR_LIST 0 /* List of valid flavors */
-#define THREAD_STATE_FLAVOR_LIST_NEW 128
-
-typedef int thread_state_flavor_t;
-typedef thread_state_flavor_t *thread_state_flavor_array_t;
-
-#endif /* _MACH_THREAD_STATUS_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/vm_prot.h b/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/vm_prot.h
deleted file mode 100644
index 07c2114e5c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/mach/vm_prot.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2000-2002 Apple Computer, Inc. All rights reserved.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
- *
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. The rights granted to you under the License
- * may not be used to create, or enable the creation or redistribution of,
- * unlawful or unlicensed copies of an Apple operating system, or to
- * circumvent, violate, or enable the circumvention or violation of, any
- * terms of an Apple operating system software license agreement.
- *
- * Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
- * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
- *
- * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
- */
-/*
- * @OSF_COPYRIGHT@
- */
-/*
- * Mach Operating System
- * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
- * All Rights Reserved.
- *
- * Permission to use, copy, modify and distribute this software and its
- * documentation is hereby granted, provided that both the copyright
- * notice and this permission notice appear in all copies of the
- * software, derivative works or modified versions, and any portions
- * thereof, and that both notices appear in supporting documentation.
- *
- * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
- * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
- * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
- *
- * Carnegie Mellon requests users of this software to return to
- *
- * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
- * School of Computer Science
- * Carnegie Mellon University
- * Pittsburgh PA 15213-3890
- *
- * any improvements or extensions that they make and grant Carnegie Mellon
- * the rights to redistribute these changes.
- */
-/*
- */
-/*
- * File: mach/vm_prot.h
- * Author: Avadis Tevanian, Jr., Michael Wayne Young
- *
- * Virtual memory protection definitions.
- *
- */
-
-#ifndef _MACH_VM_PROT_H_
-#define _MACH_VM_PROT_H_
-
-/*
- * Types defined:
- *
- * vm_prot_t VM protection values.
- */
-
-typedef int vm_prot_t;
-
-/*
- * Protection values, defined as bits within the vm_prot_t type
- */
-
-#define VM_PROT_NONE ((vm_prot_t) 0x00)
-
-#define VM_PROT_READ ((vm_prot_t) 0x01) /* read permission */
-#define VM_PROT_WRITE ((vm_prot_t) 0x02) /* write permission */
-#define VM_PROT_EXECUTE ((vm_prot_t) 0x04) /* execute permission */
-
-/*
- * The default protection for newly-created virtual memory
- */
-
-#define VM_PROT_DEFAULT (VM_PROT_READ|VM_PROT_WRITE)
-
-/*
- * The maximum privileges possible, for parameter checking.
- */
-
-#define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE)
-
-/*
- * An invalid protection value.
- * Used only by memory_object_lock_request to indicate no change
- * to page locks. Using -1 here is a bad idea because it
- * looks like VM_PROT_ALL and then some.
- */
-
-#define VM_PROT_NO_CHANGE ((vm_prot_t) 0x08)
-
-/*
- * When a caller finds that he cannot obtain write permission on a
- * mapped entry, the following flag can be used. The entry will
- * be made "needs copy" effectively copying the object (using COW),
- * and write permission will be added to the maximum protections
- * for the associated entry.
- */
-
-#define VM_PROT_COPY ((vm_prot_t) 0x10)
-
-
-/*
- * Another invalid protection value.
- * Used only by memory_object_data_request upon an object
- * which has specified a copy_call copy strategy. It is used
- * when the kernel wants a page belonging to a copy of the
- * object, and is only asking the object as a result of
- * following a shadow chain. This solves the race between pages
- * being pushed up by the memory manager and the kernel
- * walking down the shadow chain.
- */
-
-#define VM_PROT_WANTS_COPY ((vm_prot_t) 0x10)
-
-
-/*
- * Another invalid protection value.
- * Indicates that the other protection bits are to be applied as a mask
- * against the actual protection bits of the map entry.
- */
-#define VM_PROT_IS_MASK ((vm_prot_t) 0x40)
-
-#endif /* _MACH_VM_PROT_H_ */
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/musl/COPYRIGHT b/toolkit/crashreporter/google-breakpad/src/third_party/musl/COPYRIGHT
deleted file mode 100644
index f0ee3b78d8..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/musl/COPYRIGHT
+++ /dev/null
@@ -1,163 +0,0 @@
-musl as a whole is licensed under the following standard MIT license:
-
-----------------------------------------------------------------------
-Copyright © 2005-2014 Rich Felker, et al.
-
-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.
-----------------------------------------------------------------------
-
-Authors/contributors include:
-
-Alex Dowad
-Alexander Monakov
-Anthony G. Basile
-Arvid Picciani
-Bobby Bingham
-Boris Brezillon
-Brent Cook
-Chris Spiegel
-Clément Vasseur
-Daniel Micay
-Denys Vlasenko
-Emil Renner Berthing
-Felix Fietkau
-Felix Janda
-Gianluca Anzolin
-Hauke Mehrtens
-Hiltjo Posthuma
-Isaac Dunham
-Jaydeep Patil
-Jens Gustedt
-Jeremy Huntwork
-Jo-Philipp Wich
-Joakim Sindholt
-John Spencer
-Josiah Worcester
-Justin Cormack
-Khem Raj
-Kylie McClain
-Luca Barbato
-Luka Perkov
-M Farkas-Dyck (Strake)
-Mahesh Bodapati
-Michael Forney
-Natanael Copa
-Nicholas J. Kain
-orc
-Pascal Cuoq
-Petr Hosek
-Pierre Carrier
-Rich Felker
-Richard Pennington
-Shiz
-sin
-Solar Designer
-Stefan Kristiansson
-Szabolcs Nagy
-Timo Teräs
-Trutz Behn
-Valentin Ochs
-William Haddon
-
-Portions of this software are derived from third-party works licensed
-under terms compatible with the above MIT license:
-
-The TRE regular expression implementation (src/regex/reg* and
-src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
-under a 2-clause BSD license (license text in the source files). The
-included version has been heavily modified by Rich Felker in 2012, in
-the interests of size, simplicity, and namespace cleanliness.
-
-Much of the math library code (src/math/* and src/complex/*) is
-Copyright © 1993,2004 Sun Microsystems or
-Copyright © 2003-2011 David Schultz or
-Copyright © 2003-2009 Steven G. Kargl or
-Copyright © 2003-2009 Bruce D. Evans or
-Copyright © 2008 Stephen L. Moshier
-and labelled as such in comments in the individual source files. All
-have been licensed under extremely permissive terms.
-
-The ARM memcpy code (src/string/arm/memcpy_el.S) is Copyright © 2008
-The Android Open Source Project and is licensed under a two-clause BSD
-license. It was taken from Bionic libc, used on Android.
-
-The implementation of DES for crypt (src/crypt/crypt_des.c) is
-Copyright © 1994 David Burren. It is licensed under a BSD license.
-
-The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was
-originally written by Solar Designer and placed into the public
-domain. The code also comes with a fallback permissive license for use
-in jurisdictions that may not recognize the public domain.
-
-The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011
-Valentin Ochs and is licensed under an MIT-style license.
-
-The BSD PRNG implementation (src/prng/random.c) and XSI search API
-(src/search/*.c) functions are Copyright © 2011 Szabolcs Nagy and
-licensed under following terms: "Permission to use, copy, modify,
-and/or distribute this code for any purpose with or without fee is
-hereby granted. There is no warranty."
-
-The x86_64 port was written by Nicholas J. Kain and is licensed under
-the standard MIT terms.
-
-The mips and microblaze ports were originally written by Richard
-Pennington for use in the ellcc project. The original code was adapted
-by Rich Felker for build system and code conventions during upstream
-integration. It is licensed under the standard MIT terms.
-
-The mips64 port was contributed by Imagination Technologies and is
-licensed under the standard MIT terms.
-
-The powerpc port was also originally written by Richard Pennington,
-and later supplemented and integrated by John Spencer. It is licensed
-under the standard MIT terms.
-
-All other files which have no copyright comments are original works
-produced specifically for use as part of this library, written either
-by Rich Felker, the main author of the library, or by one or more
-contibutors listed above. Details on authorship of individual files
-can be found in the git version control history of the project. The
-omission of copyright and license comments in each file is in the
-interest of source tree size.
-
-In addition, permission is hereby granted for all public header files
-(include/* and arch/*/bits/*) and crt files intended to be linked into
-applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit
-the copyright notice and permission notice otherwise required by the
-license, and to use these files without any requirement of
-attribution. These files include substantial contributions from:
-
-Bobby Bingham
-John Spencer
-Nicholas J. Kain
-Rich Felker
-Richard Pennington
-Stefan Kristiansson
-Szabolcs Nagy
-
-all of whom have explicitly granted such permission.
-
-This file previously contained text expressing a belief that most of
-the files covered by the above exception were sufficiently trivial not
-to be subject to copyright, resulting in confusion over whether it
-negated the permissions granted in the license. In the spirit of
-permissive licensing, and of not having licensing issues being an
-obstacle to adoption, that text has been removed.
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/musl/README b/toolkit/crashreporter/google-breakpad/src/third_party/musl/README
deleted file mode 100644
index a30eb11275..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/musl/README
+++ /dev/null
@@ -1,23 +0,0 @@
-
- musl libc
-
-musl, pronounced like the word "mussel", is an MIT-licensed
-implementation of the standard C library targetting the Linux syscall
-API, suitable for use in a wide range of deployment environments. musl
-offers efficient static and dynamic linking support, lightweight code
-and low runtime overhead, strong fail-safe guarantees under correct
-usage, and correctness in the sense of standards conformance and
-safety. musl is built on the principle that these goals are best
-achieved through simple code that is easy to understand and maintain.
-
-The 1.1 release series for musl features coverage for all interfaces
-defined in ISO C99 and POSIX 2008 base, along with a number of
-non-standardized interfaces for compatibility with Linux, BSD, and
-glibc functionality.
-
-For basic installation instructions, see the included INSTALL file.
-Information on full musl-targeted compiler toolchains, system
-bootstrapping, and Linux distributions built on musl can be found on
-the project website:
-
- http://www.musl-libc.org/
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/musl/README.breakpad b/toolkit/crashreporter/google-breakpad/src/third_party/musl/README.breakpad
deleted file mode 100644
index f500c4359e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/musl/README.breakpad
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains the elf header from
-https://git.musl-libc.org/cgit/musl/tree/
-that is required to get ELF working in dump_syms on Mac OS X.
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/musl/VERSION b/toolkit/crashreporter/google-breakpad/src/third_party/musl/VERSION
deleted file mode 100644
index e9bc14996e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/musl/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-1.1.14
diff --git a/toolkit/crashreporter/google-breakpad/src/third_party/musl/include/elf.h b/toolkit/crashreporter/google-breakpad/src/third_party/musl/include/elf.h
deleted file mode 100644
index 8b3cd3ed3f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/third_party/musl/include/elf.h
+++ /dev/null
@@ -1,2827 +0,0 @@
-#ifndef _ELF_H
-#define _ELF_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdint.h>
-
-typedef uint16_t Elf32_Half;
-typedef uint16_t Elf64_Half;
-
-typedef uint32_t Elf32_Word;
-typedef int32_t Elf32_Sword;
-typedef uint32_t Elf64_Word;
-typedef int32_t Elf64_Sword;
-
-typedef uint64_t Elf32_Xword;
-typedef int64_t Elf32_Sxword;
-typedef uint64_t Elf64_Xword;
-typedef int64_t Elf64_Sxword;
-
-typedef uint32_t Elf32_Addr;
-typedef uint64_t Elf64_Addr;
-
-typedef uint32_t Elf32_Off;
-typedef uint64_t Elf64_Off;
-
-typedef uint16_t Elf32_Section;
-typedef uint16_t Elf64_Section;
-
-typedef Elf32_Half Elf32_Versym;
-typedef Elf64_Half Elf64_Versym;
-
-#define EI_NIDENT (16)
-
-typedef struct {
- unsigned char e_ident[EI_NIDENT];
- Elf32_Half e_type;
- Elf32_Half e_machine;
- Elf32_Word e_version;
- Elf32_Addr e_entry;
- Elf32_Off e_phoff;
- Elf32_Off e_shoff;
- Elf32_Word e_flags;
- Elf32_Half e_ehsize;
- Elf32_Half e_phentsize;
- Elf32_Half e_phnum;
- Elf32_Half e_shentsize;
- Elf32_Half e_shnum;
- Elf32_Half e_shstrndx;
-} Elf32_Ehdr;
-
-typedef struct {
- unsigned char e_ident[EI_NIDENT];
- Elf64_Half e_type;
- Elf64_Half e_machine;
- Elf64_Word e_version;
- Elf64_Addr e_entry;
- Elf64_Off e_phoff;
- Elf64_Off e_shoff;
- Elf64_Word e_flags;
- Elf64_Half e_ehsize;
- Elf64_Half e_phentsize;
- Elf64_Half e_phnum;
- Elf64_Half e_shentsize;
- Elf64_Half e_shnum;
- Elf64_Half e_shstrndx;
-} Elf64_Ehdr;
-
-#define EI_MAG0 0
-#define ELFMAG0 0x7f
-
-#define EI_MAG1 1
-#define ELFMAG1 'E'
-
-#define EI_MAG2 2
-#define ELFMAG2 'L'
-
-#define EI_MAG3 3
-#define ELFMAG3 'F'
-
-
-#define ELFMAG "\177ELF"
-#define SELFMAG 4
-
-#define EI_CLASS 4
-#define ELFCLASSNONE 0
-#define ELFCLASS32 1
-#define ELFCLASS64 2
-#define ELFCLASSNUM 3
-
-#define EI_DATA 5
-#define ELFDATANONE 0
-#define ELFDATA2LSB 1
-#define ELFDATA2MSB 2
-#define ELFDATANUM 3
-
-#define EI_VERSION 6
-
-
-#define EI_OSABI 7
-#define ELFOSABI_NONE 0
-#define ELFOSABI_SYSV 0
-#define ELFOSABI_HPUX 1
-#define ELFOSABI_NETBSD 2
-#define ELFOSABI_LINUX 3
-#define ELFOSABI_GNU 3
-#define ELFOSABI_SOLARIS 6
-#define ELFOSABI_AIX 7
-#define ELFOSABI_IRIX 8
-#define ELFOSABI_FREEBSD 9
-#define ELFOSABI_TRU64 10
-#define ELFOSABI_MODESTO 11
-#define ELFOSABI_OPENBSD 12
-#define ELFOSABI_ARM 97
-#define ELFOSABI_STANDALONE 255
-
-#define EI_ABIVERSION 8
-
-#define EI_PAD 9
-
-
-
-#define ET_NONE 0
-#define ET_REL 1
-#define ET_EXEC 2
-#define ET_DYN 3
-#define ET_CORE 4
-#define ET_NUM 5
-#define ET_LOOS 0xfe00
-#define ET_HIOS 0xfeff
-#define ET_LOPROC 0xff00
-#define ET_HIPROC 0xffff
-
-
-
-#define EM_NONE 0
-#define EM_M32 1
-#define EM_SPARC 2
-#define EM_386 3
-#define EM_68K 4
-#define EM_88K 5
-#define EM_860 7
-#define EM_MIPS 8
-#define EM_S370 9
-#define EM_MIPS_RS3_LE 10
-
-#define EM_PARISC 15
-#define EM_VPP500 17
-#define EM_SPARC32PLUS 18
-#define EM_960 19
-#define EM_PPC 20
-#define EM_PPC64 21
-#define EM_S390 22
-
-#define EM_V800 36
-#define EM_FR20 37
-#define EM_RH32 38
-#define EM_RCE 39
-#define EM_ARM 40
-#define EM_FAKE_ALPHA 41
-#define EM_SH 42
-#define EM_SPARCV9 43
-#define EM_TRICORE 44
-#define EM_ARC 45
-#define EM_H8_300 46
-#define EM_H8_300H 47
-#define EM_H8S 48
-#define EM_H8_500 49
-#define EM_IA_64 50
-#define EM_MIPS_X 51
-#define EM_COLDFIRE 52
-#define EM_68HC12 53
-#define EM_MMA 54
-#define EM_PCP 55
-#define EM_NCPU 56
-#define EM_NDR1 57
-#define EM_STARCORE 58
-#define EM_ME16 59
-#define EM_ST100 60
-#define EM_TINYJ 61
-#define EM_X86_64 62
-#define EM_PDSP 63
-
-#define EM_FX66 66
-#define EM_ST9PLUS 67
-#define EM_ST7 68
-#define EM_68HC16 69
-#define EM_68HC11 70
-#define EM_68HC08 71
-#define EM_68HC05 72
-#define EM_SVX 73
-#define EM_ST19 74
-#define EM_VAX 75
-#define EM_CRIS 76
-#define EM_JAVELIN 77
-#define EM_FIREPATH 78
-#define EM_ZSP 79
-#define EM_MMIX 80
-#define EM_HUANY 81
-#define EM_PRISM 82
-#define EM_AVR 83
-#define EM_FR30 84
-#define EM_D10V 85
-#define EM_D30V 86
-#define EM_V850 87
-#define EM_M32R 88
-#define EM_MN10300 89
-#define EM_MN10200 90
-#define EM_PJ 91
-#define EM_OR1K 92
-#define EM_ARC_A5 93
-#define EM_XTENSA 94
-#define EM_AARCH64 183
-#define EM_TILEPRO 188
-#define EM_MICROBLAZE 189
-#define EM_TILEGX 191
-#define EM_NUM 192
-#define EM_ALPHA 0x9026
-
-#define EV_NONE 0
-#define EV_CURRENT 1
-#define EV_NUM 2
-
-typedef struct {
- Elf32_Word sh_name;
- Elf32_Word sh_type;
- Elf32_Word sh_flags;
- Elf32_Addr sh_addr;
- Elf32_Off sh_offset;
- Elf32_Word sh_size;
- Elf32_Word sh_link;
- Elf32_Word sh_info;
- Elf32_Word sh_addralign;
- Elf32_Word sh_entsize;
-} Elf32_Shdr;
-
-typedef struct {
- Elf64_Word sh_name;
- Elf64_Word sh_type;
- Elf64_Xword sh_flags;
- Elf64_Addr sh_addr;
- Elf64_Off sh_offset;
- Elf64_Xword sh_size;
- Elf64_Word sh_link;
- Elf64_Word sh_info;
- Elf64_Xword sh_addralign;
- Elf64_Xword sh_entsize;
-} Elf64_Shdr;
-
-
-
-#define SHN_UNDEF 0
-#define SHN_LORESERVE 0xff00
-#define SHN_LOPROC 0xff00
-#define SHN_BEFORE 0xff00
-
-#define SHN_AFTER 0xff01
-
-#define SHN_HIPROC 0xff1f
-#define SHN_LOOS 0xff20
-#define SHN_HIOS 0xff3f
-#define SHN_ABS 0xfff1
-#define SHN_COMMON 0xfff2
-#define SHN_XINDEX 0xffff
-#define SHN_HIRESERVE 0xffff
-
-
-
-#define SHT_NULL 0
-#define SHT_PROGBITS 1
-#define SHT_SYMTAB 2
-#define SHT_STRTAB 3
-#define SHT_RELA 4
-#define SHT_HASH 5
-#define SHT_DYNAMIC 6
-#define SHT_NOTE 7
-#define SHT_NOBITS 8
-#define SHT_REL 9
-#define SHT_SHLIB 10
-#define SHT_DYNSYM 11
-#define SHT_INIT_ARRAY 14
-#define SHT_FINI_ARRAY 15
-#define SHT_PREINIT_ARRAY 16
-#define SHT_GROUP 17
-#define SHT_SYMTAB_SHNDX 18
-#define SHT_NUM 19
-#define SHT_LOOS 0x60000000
-#define SHT_GNU_ATTRIBUTES 0x6ffffff5
-#define SHT_GNU_HASH 0x6ffffff6
-#define SHT_GNU_LIBLIST 0x6ffffff7
-#define SHT_CHECKSUM 0x6ffffff8
-#define SHT_LOSUNW 0x6ffffffa
-#define SHT_SUNW_move 0x6ffffffa
-#define SHT_SUNW_COMDAT 0x6ffffffb
-#define SHT_SUNW_syminfo 0x6ffffffc
-#define SHT_GNU_verdef 0x6ffffffd
-#define SHT_GNU_verneed 0x6ffffffe
-#define SHT_GNU_versym 0x6fffffff
-#define SHT_HISUNW 0x6fffffff
-#define SHT_HIOS 0x6fffffff
-#define SHT_LOPROC 0x70000000
-#define SHT_HIPROC 0x7fffffff
-#define SHT_LOUSER 0x80000000
-#define SHT_HIUSER 0x8fffffff
-
-#define SHF_WRITE (1 << 0)
-#define SHF_ALLOC (1 << 1)
-#define SHF_EXECINSTR (1 << 2)
-#define SHF_MERGE (1 << 4)
-#define SHF_STRINGS (1 << 5)
-#define SHF_INFO_LINK (1 << 6)
-#define SHF_LINK_ORDER (1 << 7)
-#define SHF_OS_NONCONFORMING (1 << 8)
-
-#define SHF_GROUP (1 << 9)
-#define SHF_TLS (1 << 10)
-#define SHF_MASKOS 0x0ff00000
-#define SHF_MASKPROC 0xf0000000
-#define SHF_ORDERED (1 << 30)
-#define SHF_EXCLUDE (1U << 31)
-
-#define GRP_COMDAT 0x1
-
-typedef struct {
- Elf32_Word st_name;
- Elf32_Addr st_value;
- Elf32_Word st_size;
- unsigned char st_info;
- unsigned char st_other;
- Elf32_Section st_shndx;
-} Elf32_Sym;
-
-typedef struct {
- Elf64_Word st_name;
- unsigned char st_info;
- unsigned char st_other;
- Elf64_Section st_shndx;
- Elf64_Addr st_value;
- Elf64_Xword st_size;
-} Elf64_Sym;
-
-typedef struct {
- Elf32_Half si_boundto;
- Elf32_Half si_flags;
-} Elf32_Syminfo;
-
-typedef struct {
- Elf64_Half si_boundto;
- Elf64_Half si_flags;
-} Elf64_Syminfo;
-
-#define SYMINFO_BT_SELF 0xffff
-#define SYMINFO_BT_PARENT 0xfffe
-#define SYMINFO_BT_LOWRESERVE 0xff00
-
-#define SYMINFO_FLG_DIRECT 0x0001
-#define SYMINFO_FLG_PASSTHRU 0x0002
-#define SYMINFO_FLG_COPY 0x0004
-#define SYMINFO_FLG_LAZYLOAD 0x0008
-
-#define SYMINFO_NONE 0
-#define SYMINFO_CURRENT 1
-#define SYMINFO_NUM 2
-
-#define ELF32_ST_BIND(val) (((unsigned char) (val)) >> 4)
-#define ELF32_ST_TYPE(val) ((val) & 0xf)
-#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
-
-#define ELF64_ST_BIND(val) ELF32_ST_BIND (val)
-#define ELF64_ST_TYPE(val) ELF32_ST_TYPE (val)
-#define ELF64_ST_INFO(bind, type) ELF32_ST_INFO ((bind), (type))
-
-#define STB_LOCAL 0
-#define STB_GLOBAL 1
-#define STB_WEAK 2
-#define STB_NUM 3
-#define STB_LOOS 10
-#define STB_GNU_UNIQUE 10
-#define STB_HIOS 12
-#define STB_LOPROC 13
-#define STB_HIPROC 15
-
-#define STT_NOTYPE 0
-#define STT_OBJECT 1
-#define STT_FUNC 2
-#define STT_SECTION 3
-#define STT_FILE 4
-#define STT_COMMON 5
-#define STT_TLS 6
-#define STT_NUM 7
-#define STT_LOOS 10
-#define STT_GNU_IFUNC 10
-#define STT_HIOS 12
-#define STT_LOPROC 13
-#define STT_HIPROC 15
-
-#define STN_UNDEF 0
-
-#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
-#define ELF64_ST_VISIBILITY(o) ELF32_ST_VISIBILITY (o)
-
-#define STV_DEFAULT 0
-#define STV_INTERNAL 1
-#define STV_HIDDEN 2
-#define STV_PROTECTED 3
-
-
-
-
-typedef struct
-{
- Elf32_Addr r_offset;
- Elf32_Word r_info;
-} Elf32_Rel;
-
-typedef struct {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
-} Elf64_Rel;
-
-
-
-typedef struct {
- Elf32_Addr r_offset;
- Elf32_Word r_info;
- Elf32_Sword r_addend;
-} Elf32_Rela;
-
-typedef struct {
- Elf64_Addr r_offset;
- Elf64_Xword r_info;
- Elf64_Sxword r_addend;
-} Elf64_Rela;
-
-
-
-#define ELF32_R_SYM(val) ((val) >> 8)
-#define ELF32_R_TYPE(val) ((val) & 0xff)
-#define ELF32_R_INFO(sym, type) (((sym) << 8) + ((type) & 0xff))
-
-#define ELF64_R_SYM(i) ((i) >> 32)
-#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
-#define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type))
-
-
-
-typedef struct {
- Elf32_Word p_type;
- Elf32_Off p_offset;
- Elf32_Addr p_vaddr;
- Elf32_Addr p_paddr;
- Elf32_Word p_filesz;
- Elf32_Word p_memsz;
- Elf32_Word p_flags;
- Elf32_Word p_align;
-} Elf32_Phdr;
-
-typedef struct {
- Elf64_Word p_type;
- Elf64_Word p_flags;
- Elf64_Off p_offset;
- Elf64_Addr p_vaddr;
- Elf64_Addr p_paddr;
- Elf64_Xword p_filesz;
- Elf64_Xword p_memsz;
- Elf64_Xword p_align;
-} Elf64_Phdr;
-
-
-
-#define PT_NULL 0
-#define PT_LOAD 1
-#define PT_DYNAMIC 2
-#define PT_INTERP 3
-#define PT_NOTE 4
-#define PT_SHLIB 5
-#define PT_PHDR 6
-#define PT_TLS 7
-#define PT_NUM 8
-#define PT_LOOS 0x60000000
-#define PT_GNU_EH_FRAME 0x6474e550
-#define PT_GNU_STACK 0x6474e551
-#define PT_GNU_RELRO 0x6474e552
-#define PT_LOSUNW 0x6ffffffa
-#define PT_SUNWBSS 0x6ffffffa
-#define PT_SUNWSTACK 0x6ffffffb
-#define PT_HISUNW 0x6fffffff
-#define PT_HIOS 0x6fffffff
-#define PT_LOPROC 0x70000000
-#define PT_HIPROC 0x7fffffff
-
-
-#define PN_XNUM 0xffff
-
-
-#define PF_X (1 << 0)
-#define PF_W (1 << 1)
-#define PF_R (1 << 2)
-#define PF_MASKOS 0x0ff00000
-#define PF_MASKPROC 0xf0000000
-
-
-
-#define NT_PRSTATUS 1
-#define NT_FPREGSET 2
-#define NT_PRPSINFO 3
-#define NT_PRXREG 4
-#define NT_TASKSTRUCT 4
-#define NT_PLATFORM 5
-#define NT_AUXV 6
-#define NT_GWINDOWS 7
-#define NT_ASRS 8
-#define NT_PSTATUS 10
-#define NT_PSINFO 13
-#define NT_PRCRED 14
-#define NT_UTSNAME 15
-#define NT_LWPSTATUS 16
-#define NT_LWPSINFO 17
-#define NT_PRFPXREG 20
-#define NT_SIGINFO 0x53494749
-#define NT_FILE 0x46494c45
-#define NT_PRXFPREG 0x46e62b7f
-#define NT_PPC_VMX 0x100
-#define NT_PPC_SPE 0x101
-#define NT_PPC_VSX 0x102
-#define NT_386_TLS 0x200
-#define NT_386_IOPERM 0x201
-#define NT_X86_XSTATE 0x202
-#define NT_S390_HIGH_GPRS 0x300
-#define NT_S390_TIMER 0x301
-#define NT_S390_TODCMP 0x302
-#define NT_S390_TODPREG 0x303
-#define NT_S390_CTRS 0x304
-#define NT_S390_PREFIX 0x305
-#define NT_S390_LAST_BREAK 0x306
-#define NT_S390_SYSTEM_CALL 0x307
-#define NT_S390_TDB 0x308
-#define NT_ARM_VFP 0x400
-#define NT_ARM_TLS 0x401
-#define NT_ARM_HW_BREAK 0x402
-#define NT_ARM_HW_WATCH 0x403
-#define NT_METAG_CBUF 0x500
-#define NT_METAG_RPIPE 0x501
-#define NT_METAG_TLS 0x502
-#define NT_VERSION 1
-
-
-
-
-typedef struct {
- Elf32_Sword d_tag;
- union {
- Elf32_Word d_val;
- Elf32_Addr d_ptr;
- } d_un;
-} Elf32_Dyn;
-
-typedef struct {
- Elf64_Sxword d_tag;
- union {
- Elf64_Xword d_val;
- Elf64_Addr d_ptr;
- } d_un;
-} Elf64_Dyn;
-
-
-
-#define DT_NULL 0
-#define DT_NEEDED 1
-#define DT_PLTRELSZ 2
-#define DT_PLTGOT 3
-#define DT_HASH 4
-#define DT_STRTAB 5
-#define DT_SYMTAB 6
-#define DT_RELA 7
-#define DT_RELASZ 8
-#define DT_RELAENT 9
-#define DT_STRSZ 10
-#define DT_SYMENT 11
-#define DT_INIT 12
-#define DT_FINI 13
-#define DT_SONAME 14
-#define DT_RPATH 15
-#define DT_SYMBOLIC 16
-#define DT_REL 17
-#define DT_RELSZ 18
-#define DT_RELENT 19
-#define DT_PLTREL 20
-#define DT_DEBUG 21
-#define DT_TEXTREL 22
-#define DT_JMPREL 23
-#define DT_BIND_NOW 24
-#define DT_INIT_ARRAY 25
-#define DT_FINI_ARRAY 26
-#define DT_INIT_ARRAYSZ 27
-#define DT_FINI_ARRAYSZ 28
-#define DT_RUNPATH 29
-#define DT_FLAGS 30
-#define DT_ENCODING 32
-#define DT_PREINIT_ARRAY 32
-#define DT_PREINIT_ARRAYSZ 33
-#define DT_NUM 34
-#define DT_LOOS 0x6000000d
-#define DT_HIOS 0x6ffff000
-#define DT_LOPROC 0x70000000
-#define DT_HIPROC 0x7fffffff
-#define DT_PROCNUM DT_MIPS_NUM
-
-#define DT_VALRNGLO 0x6ffffd00
-#define DT_GNU_PRELINKED 0x6ffffdf5
-#define DT_GNU_CONFLICTSZ 0x6ffffdf6
-#define DT_GNU_LIBLISTSZ 0x6ffffdf7
-#define DT_CHECKSUM 0x6ffffdf8
-#define DT_PLTPADSZ 0x6ffffdf9
-#define DT_MOVEENT 0x6ffffdfa
-#define DT_MOVESZ 0x6ffffdfb
-#define DT_FEATURE_1 0x6ffffdfc
-#define DT_POSFLAG_1 0x6ffffdfd
-
-#define DT_SYMINSZ 0x6ffffdfe
-#define DT_SYMINENT 0x6ffffdff
-#define DT_VALRNGHI 0x6ffffdff
-#define DT_VALTAGIDX(tag) (DT_VALRNGHI - (tag))
-#define DT_VALNUM 12
-
-#define DT_ADDRRNGLO 0x6ffffe00
-#define DT_GNU_HASH 0x6ffffef5
-#define DT_TLSDESC_PLT 0x6ffffef6
-#define DT_TLSDESC_GOT 0x6ffffef7
-#define DT_GNU_CONFLICT 0x6ffffef8
-#define DT_GNU_LIBLIST 0x6ffffef9
-#define DT_CONFIG 0x6ffffefa
-#define DT_DEPAUDIT 0x6ffffefb
-#define DT_AUDIT 0x6ffffefc
-#define DT_PLTPAD 0x6ffffefd
-#define DT_MOVETAB 0x6ffffefe
-#define DT_SYMINFO 0x6ffffeff
-#define DT_ADDRRNGHI 0x6ffffeff
-#define DT_ADDRTAGIDX(tag) (DT_ADDRRNGHI - (tag))
-#define DT_ADDRNUM 11
-
-
-
-#define DT_VERSYM 0x6ffffff0
-
-#define DT_RELACOUNT 0x6ffffff9
-#define DT_RELCOUNT 0x6ffffffa
-
-
-#define DT_FLAGS_1 0x6ffffffb
-#define DT_VERDEF 0x6ffffffc
-
-#define DT_VERDEFNUM 0x6ffffffd
-#define DT_VERNEED 0x6ffffffe
-
-#define DT_VERNEEDNUM 0x6fffffff
-#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag))
-#define DT_VERSIONTAGNUM 16
-
-
-
-#define DT_AUXILIARY 0x7ffffffd
-#define DT_FILTER 0x7fffffff
-#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
-#define DT_EXTRANUM 3
-
-
-#define DF_ORIGIN 0x00000001
-#define DF_SYMBOLIC 0x00000002
-#define DF_TEXTREL 0x00000004
-#define DF_BIND_NOW 0x00000008
-#define DF_STATIC_TLS 0x00000010
-
-
-
-#define DF_1_NOW 0x00000001
-#define DF_1_GLOBAL 0x00000002
-#define DF_1_GROUP 0x00000004
-#define DF_1_NODELETE 0x00000008
-#define DF_1_LOADFLTR 0x00000010
-#define DF_1_INITFIRST 0x00000020
-#define DF_1_NOOPEN 0x00000040
-#define DF_1_ORIGIN 0x00000080
-#define DF_1_DIRECT 0x00000100
-#define DF_1_TRANS 0x00000200
-#define DF_1_INTERPOSE 0x00000400
-#define DF_1_NODEFLIB 0x00000800
-#define DF_1_NODUMP 0x00001000
-#define DF_1_CONFALT 0x00002000
-#define DF_1_ENDFILTEE 0x00004000
-#define DF_1_DISPRELDNE 0x00008000
-#define DF_1_DISPRELPND 0x00010000
-#define DF_1_NODIRECT 0x00020000
-#define DF_1_IGNMULDEF 0x00040000
-#define DF_1_NOKSYMS 0x00080000
-#define DF_1_NOHDR 0x00100000
-#define DF_1_EDITED 0x00200000
-#define DF_1_NORELOC 0x00400000
-#define DF_1_SYMINTPOSE 0x00800000
-#define DF_1_GLOBAUDIT 0x01000000
-#define DF_1_SINGLETON 0x02000000
-
-#define DTF_1_PARINIT 0x00000001
-#define DTF_1_CONFEXP 0x00000002
-
-
-#define DF_P1_LAZYLOAD 0x00000001
-#define DF_P1_GROUPPERM 0x00000002
-
-
-
-
-typedef struct {
- Elf32_Half vd_version;
- Elf32_Half vd_flags;
- Elf32_Half vd_ndx;
- Elf32_Half vd_cnt;
- Elf32_Word vd_hash;
- Elf32_Word vd_aux;
- Elf32_Word vd_next;
-} Elf32_Verdef;
-
-typedef struct {
- Elf64_Half vd_version;
- Elf64_Half vd_flags;
- Elf64_Half vd_ndx;
- Elf64_Half vd_cnt;
- Elf64_Word vd_hash;
- Elf64_Word vd_aux;
- Elf64_Word vd_next;
-} Elf64_Verdef;
-
-
-
-#define VER_DEF_NONE 0
-#define VER_DEF_CURRENT 1
-#define VER_DEF_NUM 2
-
-
-#define VER_FLG_BASE 0x1
-#define VER_FLG_WEAK 0x2
-
-
-#define VER_NDX_LOCAL 0
-#define VER_NDX_GLOBAL 1
-#define VER_NDX_LORESERVE 0xff00
-#define VER_NDX_ELIMINATE 0xff01
-
-
-
-typedef struct {
- Elf32_Word vda_name;
- Elf32_Word vda_next;
-} Elf32_Verdaux;
-
-typedef struct {
- Elf64_Word vda_name;
- Elf64_Word vda_next;
-} Elf64_Verdaux;
-
-
-
-
-typedef struct {
- Elf32_Half vn_version;
- Elf32_Half vn_cnt;
- Elf32_Word vn_file;
- Elf32_Word vn_aux;
- Elf32_Word vn_next;
-} Elf32_Verneed;
-
-typedef struct {
- Elf64_Half vn_version;
- Elf64_Half vn_cnt;
- Elf64_Word vn_file;
- Elf64_Word vn_aux;
- Elf64_Word vn_next;
-} Elf64_Verneed;
-
-
-
-#define VER_NEED_NONE 0
-#define VER_NEED_CURRENT 1
-#define VER_NEED_NUM 2
-
-
-
-typedef struct {
- Elf32_Word vna_hash;
- Elf32_Half vna_flags;
- Elf32_Half vna_other;
- Elf32_Word vna_name;
- Elf32_Word vna_next;
-} Elf32_Vernaux;
-
-typedef struct {
- Elf64_Word vna_hash;
- Elf64_Half vna_flags;
- Elf64_Half vna_other;
- Elf64_Word vna_name;
- Elf64_Word vna_next;
-} Elf64_Vernaux;
-
-
-
-#define VER_FLG_WEAK 0x2
-
-
-
-typedef struct {
- uint32_t a_type;
- union {
- uint32_t a_val;
- } a_un;
-} Elf32_auxv_t;
-
-typedef struct {
- uint64_t a_type;
- union {
- uint64_t a_val;
- } a_un;
-} Elf64_auxv_t;
-
-
-
-#define AT_NULL 0
-#define AT_IGNORE 1
-#define AT_EXECFD 2
-#define AT_PHDR 3
-#define AT_PHENT 4
-#define AT_PHNUM 5
-#define AT_PAGESZ 6
-#define AT_BASE 7
-#define AT_FLAGS 8
-#define AT_ENTRY 9
-#define AT_NOTELF 10
-#define AT_UID 11
-#define AT_EUID 12
-#define AT_GID 13
-#define AT_EGID 14
-#define AT_CLKTCK 17
-
-
-#define AT_PLATFORM 15
-#define AT_HWCAP 16
-
-
-
-
-#define AT_FPUCW 18
-
-
-#define AT_DCACHEBSIZE 19
-#define AT_ICACHEBSIZE 20
-#define AT_UCACHEBSIZE 21
-
-
-
-#define AT_IGNOREPPC 22
-
-#define AT_SECURE 23
-
-#define AT_BASE_PLATFORM 24
-
-#define AT_RANDOM 25
-
-#define AT_HWCAP2 26
-
-#define AT_EXECFN 31
-
-
-
-#define AT_SYSINFO 32
-#define AT_SYSINFO_EHDR 33
-
-
-
-#define AT_L1I_CACHESHAPE 34
-#define AT_L1D_CACHESHAPE 35
-#define AT_L2_CACHESHAPE 36
-#define AT_L3_CACHESHAPE 37
-
-
-
-
-typedef struct {
- Elf32_Word n_namesz;
- Elf32_Word n_descsz;
- Elf32_Word n_type;
-} Elf32_Nhdr;
-
-typedef struct {
- Elf64_Word n_namesz;
- Elf64_Word n_descsz;
- Elf64_Word n_type;
-} Elf64_Nhdr;
-
-
-
-
-#define ELF_NOTE_SOLARIS "SUNW Solaris"
-
-
-#define ELF_NOTE_GNU "GNU"
-
-
-
-
-
-#define ELF_NOTE_PAGESIZE_HINT 1
-
-
-#define NT_GNU_ABI_TAG 1
-#define ELF_NOTE_ABI NT_GNU_ABI_TAG
-
-
-
-#define ELF_NOTE_OS_LINUX 0
-#define ELF_NOTE_OS_GNU 1
-#define ELF_NOTE_OS_SOLARIS2 2
-#define ELF_NOTE_OS_FREEBSD 3
-
-#define NT_GNU_BUILD_ID 3
-#define NT_GNU_GOLD_VERSION 4
-
-
-
-typedef struct {
- Elf32_Xword m_value;
- Elf32_Word m_info;
- Elf32_Word m_poffset;
- Elf32_Half m_repeat;
- Elf32_Half m_stride;
-} Elf32_Move;
-
-typedef struct {
- Elf64_Xword m_value;
- Elf64_Xword m_info;
- Elf64_Xword m_poffset;
- Elf64_Half m_repeat;
- Elf64_Half m_stride;
-} Elf64_Move;
-
-
-#define ELF32_M_SYM(info) ((info) >> 8)
-#define ELF32_M_SIZE(info) ((unsigned char) (info))
-#define ELF32_M_INFO(sym, size) (((sym) << 8) + (unsigned char) (size))
-
-#define ELF64_M_SYM(info) ELF32_M_SYM (info)
-#define ELF64_M_SIZE(info) ELF32_M_SIZE (info)
-#define ELF64_M_INFO(sym, size) ELF32_M_INFO (sym, size)
-
-#define EF_CPU32 0x00810000
-
-#define R_68K_NONE 0
-#define R_68K_32 1
-#define R_68K_16 2
-#define R_68K_8 3
-#define R_68K_PC32 4
-#define R_68K_PC16 5
-#define R_68K_PC8 6
-#define R_68K_GOT32 7
-#define R_68K_GOT16 8
-#define R_68K_GOT8 9
-#define R_68K_GOT32O 10
-#define R_68K_GOT16O 11
-#define R_68K_GOT8O 12
-#define R_68K_PLT32 13
-#define R_68K_PLT16 14
-#define R_68K_PLT8 15
-#define R_68K_PLT32O 16
-#define R_68K_PLT16O 17
-#define R_68K_PLT8O 18
-#define R_68K_COPY 19
-#define R_68K_GLOB_DAT 20
-#define R_68K_JMP_SLOT 21
-#define R_68K_RELATIVE 22
-#define R_68K_NUM 23
-
-#define R_386_NONE 0
-#define R_386_32 1
-#define R_386_PC32 2
-#define R_386_GOT32 3
-#define R_386_PLT32 4
-#define R_386_COPY 5
-#define R_386_GLOB_DAT 6
-#define R_386_JMP_SLOT 7
-#define R_386_RELATIVE 8
-#define R_386_GOTOFF 9
-#define R_386_GOTPC 10
-#define R_386_32PLT 11
-#define R_386_TLS_TPOFF 14
-#define R_386_TLS_IE 15
-#define R_386_TLS_GOTIE 16
-#define R_386_TLS_LE 17
-#define R_386_TLS_GD 18
-#define R_386_TLS_LDM 19
-#define R_386_16 20
-#define R_386_PC16 21
-#define R_386_8 22
-#define R_386_PC8 23
-#define R_386_TLS_GD_32 24
-#define R_386_TLS_GD_PUSH 25
-#define R_386_TLS_GD_CALL 26
-#define R_386_TLS_GD_POP 27
-#define R_386_TLS_LDM_32 28
-#define R_386_TLS_LDM_PUSH 29
-#define R_386_TLS_LDM_CALL 30
-#define R_386_TLS_LDM_POP 31
-#define R_386_TLS_LDO_32 32
-#define R_386_TLS_IE_32 33
-#define R_386_TLS_LE_32 34
-#define R_386_TLS_DTPMOD32 35
-#define R_386_TLS_DTPOFF32 36
-#define R_386_TLS_TPOFF32 37
-#define R_386_SIZE32 38
-#define R_386_TLS_GOTDESC 39
-#define R_386_TLS_DESC_CALL 40
-#define R_386_TLS_DESC 41
-#define R_386_IRELATIVE 42
-#define R_386_NUM 43
-
-
-
-
-
-#define STT_SPARC_REGISTER 13
-
-
-
-#define EF_SPARCV9_MM 3
-#define EF_SPARCV9_TSO 0
-#define EF_SPARCV9_PSO 1
-#define EF_SPARCV9_RMO 2
-#define EF_SPARC_LEDATA 0x800000
-#define EF_SPARC_EXT_MASK 0xFFFF00
-#define EF_SPARC_32PLUS 0x000100
-#define EF_SPARC_SUN_US1 0x000200
-#define EF_SPARC_HAL_R1 0x000400
-#define EF_SPARC_SUN_US3 0x000800
-
-
-
-#define R_SPARC_NONE 0
-#define R_SPARC_8 1
-#define R_SPARC_16 2
-#define R_SPARC_32 3
-#define R_SPARC_DISP8 4
-#define R_SPARC_DISP16 5
-#define R_SPARC_DISP32 6
-#define R_SPARC_WDISP30 7
-#define R_SPARC_WDISP22 8
-#define R_SPARC_HI22 9
-#define R_SPARC_22 10
-#define R_SPARC_13 11
-#define R_SPARC_LO10 12
-#define R_SPARC_GOT10 13
-#define R_SPARC_GOT13 14
-#define R_SPARC_GOT22 15
-#define R_SPARC_PC10 16
-#define R_SPARC_PC22 17
-#define R_SPARC_WPLT30 18
-#define R_SPARC_COPY 19
-#define R_SPARC_GLOB_DAT 20
-#define R_SPARC_JMP_SLOT 21
-#define R_SPARC_RELATIVE 22
-#define R_SPARC_UA32 23
-
-
-
-#define R_SPARC_PLT32 24
-#define R_SPARC_HIPLT22 25
-#define R_SPARC_LOPLT10 26
-#define R_SPARC_PCPLT32 27
-#define R_SPARC_PCPLT22 28
-#define R_SPARC_PCPLT10 29
-#define R_SPARC_10 30
-#define R_SPARC_11 31
-#define R_SPARC_64 32
-#define R_SPARC_OLO10 33
-#define R_SPARC_HH22 34
-#define R_SPARC_HM10 35
-#define R_SPARC_LM22 36
-#define R_SPARC_PC_HH22 37
-#define R_SPARC_PC_HM10 38
-#define R_SPARC_PC_LM22 39
-#define R_SPARC_WDISP16 40
-#define R_SPARC_WDISP19 41
-#define R_SPARC_GLOB_JMP 42
-#define R_SPARC_7 43
-#define R_SPARC_5 44
-#define R_SPARC_6 45
-#define R_SPARC_DISP64 46
-#define R_SPARC_PLT64 47
-#define R_SPARC_HIX22 48
-#define R_SPARC_LOX10 49
-#define R_SPARC_H44 50
-#define R_SPARC_M44 51
-#define R_SPARC_L44 52
-#define R_SPARC_REGISTER 53
-#define R_SPARC_UA64 54
-#define R_SPARC_UA16 55
-#define R_SPARC_TLS_GD_HI22 56
-#define R_SPARC_TLS_GD_LO10 57
-#define R_SPARC_TLS_GD_ADD 58
-#define R_SPARC_TLS_GD_CALL 59
-#define R_SPARC_TLS_LDM_HI22 60
-#define R_SPARC_TLS_LDM_LO10 61
-#define R_SPARC_TLS_LDM_ADD 62
-#define R_SPARC_TLS_LDM_CALL 63
-#define R_SPARC_TLS_LDO_HIX22 64
-#define R_SPARC_TLS_LDO_LOX10 65
-#define R_SPARC_TLS_LDO_ADD 66
-#define R_SPARC_TLS_IE_HI22 67
-#define R_SPARC_TLS_IE_LO10 68
-#define R_SPARC_TLS_IE_LD 69
-#define R_SPARC_TLS_IE_LDX 70
-#define R_SPARC_TLS_IE_ADD 71
-#define R_SPARC_TLS_LE_HIX22 72
-#define R_SPARC_TLS_LE_LOX10 73
-#define R_SPARC_TLS_DTPMOD32 74
-#define R_SPARC_TLS_DTPMOD64 75
-#define R_SPARC_TLS_DTPOFF32 76
-#define R_SPARC_TLS_DTPOFF64 77
-#define R_SPARC_TLS_TPOFF32 78
-#define R_SPARC_TLS_TPOFF64 79
-#define R_SPARC_GOTDATA_HIX22 80
-#define R_SPARC_GOTDATA_LOX10 81
-#define R_SPARC_GOTDATA_OP_HIX22 82
-#define R_SPARC_GOTDATA_OP_LOX10 83
-#define R_SPARC_GOTDATA_OP 84
-#define R_SPARC_H34 85
-#define R_SPARC_SIZE32 86
-#define R_SPARC_SIZE64 87
-#define R_SPARC_GNU_VTINHERIT 250
-#define R_SPARC_GNU_VTENTRY 251
-#define R_SPARC_REV32 252
-
-#define R_SPARC_NUM 253
-
-
-
-#define DT_SPARC_REGISTER 0x70000001
-#define DT_SPARC_NUM 2
-
-
-#define EF_MIPS_NOREORDER 1
-#define EF_MIPS_PIC 2
-#define EF_MIPS_CPIC 4
-#define EF_MIPS_XGOT 8
-#define EF_MIPS_64BIT_WHIRL 16
-#define EF_MIPS_ABI2 32
-#define EF_MIPS_ABI_ON32 64
-#define EF_MIPS_NAN2008 1024
-#define EF_MIPS_ARCH 0xf0000000
-
-
-
-#define EF_MIPS_ARCH_1 0x00000000
-#define EF_MIPS_ARCH_2 0x10000000
-#define EF_MIPS_ARCH_3 0x20000000
-#define EF_MIPS_ARCH_4 0x30000000
-#define EF_MIPS_ARCH_5 0x40000000
-#define EF_MIPS_ARCH_32 0x50000000
-#define EF_MIPS_ARCH_64 0x60000000
-#define EF_MIPS_ARCH_32R2 0x70000000
-#define EF_MIPS_ARCH_64R2 0x80000000
-
-
-#define E_MIPS_ARCH_1 0x00000000
-#define E_MIPS_ARCH_2 0x10000000
-#define E_MIPS_ARCH_3 0x20000000
-#define E_MIPS_ARCH_4 0x30000000
-#define E_MIPS_ARCH_5 0x40000000
-#define E_MIPS_ARCH_32 0x50000000
-#define E_MIPS_ARCH_64 0x60000000
-
-
-
-#define SHN_MIPS_ACOMMON 0xff00
-#define SHN_MIPS_TEXT 0xff01
-#define SHN_MIPS_DATA 0xff02
-#define SHN_MIPS_SCOMMON 0xff03
-#define SHN_MIPS_SUNDEFINED 0xff04
-
-
-
-#define SHT_MIPS_LIBLIST 0x70000000
-#define SHT_MIPS_MSYM 0x70000001
-#define SHT_MIPS_CONFLICT 0x70000002
-#define SHT_MIPS_GPTAB 0x70000003
-#define SHT_MIPS_UCODE 0x70000004
-#define SHT_MIPS_DEBUG 0x70000005
-#define SHT_MIPS_REGINFO 0x70000006
-#define SHT_MIPS_PACKAGE 0x70000007
-#define SHT_MIPS_PACKSYM 0x70000008
-#define SHT_MIPS_RELD 0x70000009
-#define SHT_MIPS_IFACE 0x7000000b
-#define SHT_MIPS_CONTENT 0x7000000c
-#define SHT_MIPS_OPTIONS 0x7000000d
-#define SHT_MIPS_SHDR 0x70000010
-#define SHT_MIPS_FDESC 0x70000011
-#define SHT_MIPS_EXTSYM 0x70000012
-#define SHT_MIPS_DENSE 0x70000013
-#define SHT_MIPS_PDESC 0x70000014
-#define SHT_MIPS_LOCSYM 0x70000015
-#define SHT_MIPS_AUXSYM 0x70000016
-#define SHT_MIPS_OPTSYM 0x70000017
-#define SHT_MIPS_LOCSTR 0x70000018
-#define SHT_MIPS_LINE 0x70000019
-#define SHT_MIPS_RFDESC 0x7000001a
-#define SHT_MIPS_DELTASYM 0x7000001b
-#define SHT_MIPS_DELTAINST 0x7000001c
-#define SHT_MIPS_DELTACLASS 0x7000001d
-#define SHT_MIPS_DWARF 0x7000001e
-#define SHT_MIPS_DELTADECL 0x7000001f
-#define SHT_MIPS_SYMBOL_LIB 0x70000020
-#define SHT_MIPS_EVENTS 0x70000021
-#define SHT_MIPS_TRANSLATE 0x70000022
-#define SHT_MIPS_PIXIE 0x70000023
-#define SHT_MIPS_XLATE 0x70000024
-#define SHT_MIPS_XLATE_DEBUG 0x70000025
-#define SHT_MIPS_WHIRL 0x70000026
-#define SHT_MIPS_EH_REGION 0x70000027
-#define SHT_MIPS_XLATE_OLD 0x70000028
-#define SHT_MIPS_PDR_EXCEPTION 0x70000029
-
-
-
-#define SHF_MIPS_GPREL 0x10000000
-#define SHF_MIPS_MERGE 0x20000000
-#define SHF_MIPS_ADDR 0x40000000
-#define SHF_MIPS_STRINGS 0x80000000
-#define SHF_MIPS_NOSTRIP 0x08000000
-#define SHF_MIPS_LOCAL 0x04000000
-#define SHF_MIPS_NAMES 0x02000000
-#define SHF_MIPS_NODUPE 0x01000000
-
-
-
-
-
-#define STO_MIPS_DEFAULT 0x0
-#define STO_MIPS_INTERNAL 0x1
-#define STO_MIPS_HIDDEN 0x2
-#define STO_MIPS_PROTECTED 0x3
-#define STO_MIPS_PLT 0x8
-#define STO_MIPS_SC_ALIGN_UNUSED 0xff
-
-
-#define STB_MIPS_SPLIT_COMMON 13
-
-
-
-typedef union {
- struct {
- Elf32_Word gt_current_g_value;
- Elf32_Word gt_unused;
- } gt_header;
- struct {
- Elf32_Word gt_g_value;
- Elf32_Word gt_bytes;
- } gt_entry;
-} Elf32_gptab;
-
-
-
-typedef struct {
- Elf32_Word ri_gprmask;
- Elf32_Word ri_cprmask[4];
- Elf32_Sword ri_gp_value;
-} Elf32_RegInfo;
-
-
-
-typedef struct {
- unsigned char kind;
-
- unsigned char size;
- Elf32_Section section;
-
- Elf32_Word info;
-} Elf_Options;
-
-
-
-#define ODK_NULL 0
-#define ODK_REGINFO 1
-#define ODK_EXCEPTIONS 2
-#define ODK_PAD 3
-#define ODK_HWPATCH 4
-#define ODK_FILL 5
-#define ODK_TAGS 6
-#define ODK_HWAND 7
-#define ODK_HWOR 8
-
-
-
-#define OEX_FPU_MIN 0x1f
-#define OEX_FPU_MAX 0x1f00
-#define OEX_PAGE0 0x10000
-#define OEX_SMM 0x20000
-#define OEX_FPDBUG 0x40000
-#define OEX_PRECISEFP OEX_FPDBUG
-#define OEX_DISMISS 0x80000
-
-#define OEX_FPU_INVAL 0x10
-#define OEX_FPU_DIV0 0x08
-#define OEX_FPU_OFLO 0x04
-#define OEX_FPU_UFLO 0x02
-#define OEX_FPU_INEX 0x01
-
-
-
-#define OHW_R4KEOP 0x1
-#define OHW_R8KPFETCH 0x2
-#define OHW_R5KEOP 0x4
-#define OHW_R5KCVTL 0x8
-
-#define OPAD_PREFIX 0x1
-#define OPAD_POSTFIX 0x2
-#define OPAD_SYMBOL 0x4
-
-
-
-typedef struct {
- Elf32_Word hwp_flags1;
- Elf32_Word hwp_flags2;
-} Elf_Options_Hw;
-
-
-
-#define OHWA0_R4KEOP_CHECKED 0x00000001
-#define OHWA1_R4KEOP_CLEAN 0x00000002
-
-
-
-#define R_MIPS_NONE 0
-#define R_MIPS_16 1
-#define R_MIPS_32 2
-#define R_MIPS_REL32 3
-#define R_MIPS_26 4
-#define R_MIPS_HI16 5
-#define R_MIPS_LO16 6
-#define R_MIPS_GPREL16 7
-#define R_MIPS_LITERAL 8
-#define R_MIPS_GOT16 9
-#define R_MIPS_PC16 10
-#define R_MIPS_CALL16 11
-#define R_MIPS_GPREL32 12
-
-#define R_MIPS_SHIFT5 16
-#define R_MIPS_SHIFT6 17
-#define R_MIPS_64 18
-#define R_MIPS_GOT_DISP 19
-#define R_MIPS_GOT_PAGE 20
-#define R_MIPS_GOT_OFST 21
-#define R_MIPS_GOT_HI16 22
-#define R_MIPS_GOT_LO16 23
-#define R_MIPS_SUB 24
-#define R_MIPS_INSERT_A 25
-#define R_MIPS_INSERT_B 26
-#define R_MIPS_DELETE 27
-#define R_MIPS_HIGHER 28
-#define R_MIPS_HIGHEST 29
-#define R_MIPS_CALL_HI16 30
-#define R_MIPS_CALL_LO16 31
-#define R_MIPS_SCN_DISP 32
-#define R_MIPS_REL16 33
-#define R_MIPS_ADD_IMMEDIATE 34
-#define R_MIPS_PJUMP 35
-#define R_MIPS_RELGOT 36
-#define R_MIPS_JALR 37
-#define R_MIPS_TLS_DTPMOD32 38
-#define R_MIPS_TLS_DTPREL32 39
-#define R_MIPS_TLS_DTPMOD64 40
-#define R_MIPS_TLS_DTPREL64 41
-#define R_MIPS_TLS_GD 42
-#define R_MIPS_TLS_LDM 43
-#define R_MIPS_TLS_DTPREL_HI16 44
-#define R_MIPS_TLS_DTPREL_LO16 45
-#define R_MIPS_TLS_GOTTPREL 46
-#define R_MIPS_TLS_TPREL32 47
-#define R_MIPS_TLS_TPREL64 48
-#define R_MIPS_TLS_TPREL_HI16 49
-#define R_MIPS_TLS_TPREL_LO16 50
-#define R_MIPS_GLOB_DAT 51
-#define R_MIPS_COPY 126
-#define R_MIPS_JUMP_SLOT 127
-
-#define R_MIPS_NUM 128
-
-
-
-#define PT_MIPS_REGINFO 0x70000000
-#define PT_MIPS_RTPROC 0x70000001
-#define PT_MIPS_OPTIONS 0x70000002
-
-
-
-#define PF_MIPS_LOCAL 0x10000000
-
-
-
-#define DT_MIPS_RLD_VERSION 0x70000001
-#define DT_MIPS_TIME_STAMP 0x70000002
-#define DT_MIPS_ICHECKSUM 0x70000003
-#define DT_MIPS_IVERSION 0x70000004
-#define DT_MIPS_FLAGS 0x70000005
-#define DT_MIPS_BASE_ADDRESS 0x70000006
-#define DT_MIPS_MSYM 0x70000007
-#define DT_MIPS_CONFLICT 0x70000008
-#define DT_MIPS_LIBLIST 0x70000009
-#define DT_MIPS_LOCAL_GOTNO 0x7000000a
-#define DT_MIPS_CONFLICTNO 0x7000000b
-#define DT_MIPS_LIBLISTNO 0x70000010
-#define DT_MIPS_SYMTABNO 0x70000011
-#define DT_MIPS_UNREFEXTNO 0x70000012
-#define DT_MIPS_GOTSYM 0x70000013
-#define DT_MIPS_HIPAGENO 0x70000014
-#define DT_MIPS_RLD_MAP 0x70000016
-#define DT_MIPS_DELTA_CLASS 0x70000017
-#define DT_MIPS_DELTA_CLASS_NO 0x70000018
-
-#define DT_MIPS_DELTA_INSTANCE 0x70000019
-#define DT_MIPS_DELTA_INSTANCE_NO 0x7000001a
-
-#define DT_MIPS_DELTA_RELOC 0x7000001b
-#define DT_MIPS_DELTA_RELOC_NO 0x7000001c
-
-#define DT_MIPS_DELTA_SYM 0x7000001d
-
-#define DT_MIPS_DELTA_SYM_NO 0x7000001e
-
-#define DT_MIPS_DELTA_CLASSSYM 0x70000020
-
-#define DT_MIPS_DELTA_CLASSSYM_NO 0x70000021
-
-#define DT_MIPS_CXX_FLAGS 0x70000022
-#define DT_MIPS_PIXIE_INIT 0x70000023
-#define DT_MIPS_SYMBOL_LIB 0x70000024
-#define DT_MIPS_LOCALPAGE_GOTIDX 0x70000025
-#define DT_MIPS_LOCAL_GOTIDX 0x70000026
-#define DT_MIPS_HIDDEN_GOTIDX 0x70000027
-#define DT_MIPS_PROTECTED_GOTIDX 0x70000028
-#define DT_MIPS_OPTIONS 0x70000029
-#define DT_MIPS_INTERFACE 0x7000002a
-#define DT_MIPS_DYNSTR_ALIGN 0x7000002b
-#define DT_MIPS_INTERFACE_SIZE 0x7000002c
-#define DT_MIPS_RLD_TEXT_RESOLVE_ADDR 0x7000002d
-
-#define DT_MIPS_PERF_SUFFIX 0x7000002e
-
-#define DT_MIPS_COMPACT_SIZE 0x7000002f
-#define DT_MIPS_GP_VALUE 0x70000030
-#define DT_MIPS_AUX_DYNAMIC 0x70000031
-
-#define DT_MIPS_PLTGOT 0x70000032
-
-#define DT_MIPS_RWPLT 0x70000034
-#define DT_MIPS_NUM 0x35
-
-
-
-#define RHF_NONE 0
-#define RHF_QUICKSTART (1 << 0)
-#define RHF_NOTPOT (1 << 1)
-#define RHF_NO_LIBRARY_REPLACEMENT (1 << 2)
-#define RHF_NO_MOVE (1 << 3)
-#define RHF_SGI_ONLY (1 << 4)
-#define RHF_GUARANTEE_INIT (1 << 5)
-#define RHF_DELTA_C_PLUS_PLUS (1 << 6)
-#define RHF_GUARANTEE_START_INIT (1 << 7)
-#define RHF_PIXIE (1 << 8)
-#define RHF_DEFAULT_DELAY_LOAD (1 << 9)
-#define RHF_REQUICKSTART (1 << 10)
-#define RHF_REQUICKSTARTED (1 << 11)
-#define RHF_CORD (1 << 12)
-#define RHF_NO_UNRES_UNDEF (1 << 13)
-#define RHF_RLD_ORDER_SAFE (1 << 14)
-
-
-
-typedef struct
-{
- Elf32_Word l_name;
- Elf32_Word l_time_stamp;
- Elf32_Word l_checksum;
- Elf32_Word l_version;
- Elf32_Word l_flags;
-} Elf32_Lib;
-
-typedef struct
-{
- Elf64_Word l_name;
- Elf64_Word l_time_stamp;
- Elf64_Word l_checksum;
- Elf64_Word l_version;
- Elf64_Word l_flags;
-} Elf64_Lib;
-
-
-
-
-#define LL_NONE 0
-#define LL_EXACT_MATCH (1 << 0)
-#define LL_IGNORE_INT_VER (1 << 1)
-#define LL_REQUIRE_MINOR (1 << 2)
-#define LL_EXPORTS (1 << 3)
-#define LL_DELAY_LOAD (1 << 4)
-#define LL_DELTA (1 << 5)
-
-
-
-typedef Elf32_Addr Elf32_Conflict;
-
-
-
-
-
-
-#define EF_PARISC_TRAPNIL 0x00010000
-#define EF_PARISC_EXT 0x00020000
-#define EF_PARISC_LSB 0x00040000
-#define EF_PARISC_WIDE 0x00080000
-#define EF_PARISC_NO_KABP 0x00100000
-
-#define EF_PARISC_LAZYSWAP 0x00400000
-#define EF_PARISC_ARCH 0x0000ffff
-
-
-
-#define EFA_PARISC_1_0 0x020b
-#define EFA_PARISC_1_1 0x0210
-#define EFA_PARISC_2_0 0x0214
-
-
-
-#define SHN_PARISC_ANSI_COMMON 0xff00
-
-#define SHN_PARISC_HUGE_COMMON 0xff01
-
-
-
-#define SHT_PARISC_EXT 0x70000000
-#define SHT_PARISC_UNWIND 0x70000001
-#define SHT_PARISC_DOC 0x70000002
-
-
-
-#define SHF_PARISC_SHORT 0x20000000
-#define SHF_PARISC_HUGE 0x40000000
-#define SHF_PARISC_SBP 0x80000000
-
-
-
-#define STT_PARISC_MILLICODE 13
-
-#define STT_HP_OPAQUE (STT_LOOS + 0x1)
-#define STT_HP_STUB (STT_LOOS + 0x2)
-
-
-
-#define R_PARISC_NONE 0
-#define R_PARISC_DIR32 1
-#define R_PARISC_DIR21L 2
-#define R_PARISC_DIR17R 3
-#define R_PARISC_DIR17F 4
-#define R_PARISC_DIR14R 6
-#define R_PARISC_PCREL32 9
-#define R_PARISC_PCREL21L 10
-#define R_PARISC_PCREL17R 11
-#define R_PARISC_PCREL17F 12
-#define R_PARISC_PCREL14R 14
-#define R_PARISC_DPREL21L 18
-#define R_PARISC_DPREL14R 22
-#define R_PARISC_GPREL21L 26
-#define R_PARISC_GPREL14R 30
-#define R_PARISC_LTOFF21L 34
-#define R_PARISC_LTOFF14R 38
-#define R_PARISC_SECREL32 41
-#define R_PARISC_SEGBASE 48
-#define R_PARISC_SEGREL32 49
-#define R_PARISC_PLTOFF21L 50
-#define R_PARISC_PLTOFF14R 54
-#define R_PARISC_LTOFF_FPTR32 57
-#define R_PARISC_LTOFF_FPTR21L 58
-#define R_PARISC_LTOFF_FPTR14R 62
-#define R_PARISC_FPTR64 64
-#define R_PARISC_PLABEL32 65
-#define R_PARISC_PLABEL21L 66
-#define R_PARISC_PLABEL14R 70
-#define R_PARISC_PCREL64 72
-#define R_PARISC_PCREL22F 74
-#define R_PARISC_PCREL14WR 75
-#define R_PARISC_PCREL14DR 76
-#define R_PARISC_PCREL16F 77
-#define R_PARISC_PCREL16WF 78
-#define R_PARISC_PCREL16DF 79
-#define R_PARISC_DIR64 80
-#define R_PARISC_DIR14WR 83
-#define R_PARISC_DIR14DR 84
-#define R_PARISC_DIR16F 85
-#define R_PARISC_DIR16WF 86
-#define R_PARISC_DIR16DF 87
-#define R_PARISC_GPREL64 88
-#define R_PARISC_GPREL14WR 91
-#define R_PARISC_GPREL14DR 92
-#define R_PARISC_GPREL16F 93
-#define R_PARISC_GPREL16WF 94
-#define R_PARISC_GPREL16DF 95
-#define R_PARISC_LTOFF64 96
-#define R_PARISC_LTOFF14WR 99
-#define R_PARISC_LTOFF14DR 100
-#define R_PARISC_LTOFF16F 101
-#define R_PARISC_LTOFF16WF 102
-#define R_PARISC_LTOFF16DF 103
-#define R_PARISC_SECREL64 104
-#define R_PARISC_SEGREL64 112
-#define R_PARISC_PLTOFF14WR 115
-#define R_PARISC_PLTOFF14DR 116
-#define R_PARISC_PLTOFF16F 117
-#define R_PARISC_PLTOFF16WF 118
-#define R_PARISC_PLTOFF16DF 119
-#define R_PARISC_LTOFF_FPTR64 120
-#define R_PARISC_LTOFF_FPTR14WR 123
-#define R_PARISC_LTOFF_FPTR14DR 124
-#define R_PARISC_LTOFF_FPTR16F 125
-#define R_PARISC_LTOFF_FPTR16WF 126
-#define R_PARISC_LTOFF_FPTR16DF 127
-#define R_PARISC_LORESERVE 128
-#define R_PARISC_COPY 128
-#define R_PARISC_IPLT 129
-#define R_PARISC_EPLT 130
-#define R_PARISC_TPREL32 153
-#define R_PARISC_TPREL21L 154
-#define R_PARISC_TPREL14R 158
-#define R_PARISC_LTOFF_TP21L 162
-#define R_PARISC_LTOFF_TP14R 166
-#define R_PARISC_LTOFF_TP14F 167
-#define R_PARISC_TPREL64 216
-#define R_PARISC_TPREL14WR 219
-#define R_PARISC_TPREL14DR 220
-#define R_PARISC_TPREL16F 221
-#define R_PARISC_TPREL16WF 222
-#define R_PARISC_TPREL16DF 223
-#define R_PARISC_LTOFF_TP64 224
-#define R_PARISC_LTOFF_TP14WR 227
-#define R_PARISC_LTOFF_TP14DR 228
-#define R_PARISC_LTOFF_TP16F 229
-#define R_PARISC_LTOFF_TP16WF 230
-#define R_PARISC_LTOFF_TP16DF 231
-#define R_PARISC_GNU_VTENTRY 232
-#define R_PARISC_GNU_VTINHERIT 233
-#define R_PARISC_TLS_GD21L 234
-#define R_PARISC_TLS_GD14R 235
-#define R_PARISC_TLS_GDCALL 236
-#define R_PARISC_TLS_LDM21L 237
-#define R_PARISC_TLS_LDM14R 238
-#define R_PARISC_TLS_LDMCALL 239
-#define R_PARISC_TLS_LDO21L 240
-#define R_PARISC_TLS_LDO14R 241
-#define R_PARISC_TLS_DTPMOD32 242
-#define R_PARISC_TLS_DTPMOD64 243
-#define R_PARISC_TLS_DTPOFF32 244
-#define R_PARISC_TLS_DTPOFF64 245
-#define R_PARISC_TLS_LE21L R_PARISC_TPREL21L
-#define R_PARISC_TLS_LE14R R_PARISC_TPREL14R
-#define R_PARISC_TLS_IE21L R_PARISC_LTOFF_TP21L
-#define R_PARISC_TLS_IE14R R_PARISC_LTOFF_TP14R
-#define R_PARISC_TLS_TPREL32 R_PARISC_TPREL32
-#define R_PARISC_TLS_TPREL64 R_PARISC_TPREL64
-#define R_PARISC_HIRESERVE 255
-
-
-
-#define PT_HP_TLS (PT_LOOS + 0x0)
-#define PT_HP_CORE_NONE (PT_LOOS + 0x1)
-#define PT_HP_CORE_VERSION (PT_LOOS + 0x2)
-#define PT_HP_CORE_KERNEL (PT_LOOS + 0x3)
-#define PT_HP_CORE_COMM (PT_LOOS + 0x4)
-#define PT_HP_CORE_PROC (PT_LOOS + 0x5)
-#define PT_HP_CORE_LOADABLE (PT_LOOS + 0x6)
-#define PT_HP_CORE_STACK (PT_LOOS + 0x7)
-#define PT_HP_CORE_SHM (PT_LOOS + 0x8)
-#define PT_HP_CORE_MMF (PT_LOOS + 0x9)
-#define PT_HP_PARALLEL (PT_LOOS + 0x10)
-#define PT_HP_FASTBIND (PT_LOOS + 0x11)
-#define PT_HP_OPT_ANNOT (PT_LOOS + 0x12)
-#define PT_HP_HSL_ANNOT (PT_LOOS + 0x13)
-#define PT_HP_STACK (PT_LOOS + 0x14)
-
-#define PT_PARISC_ARCHEXT 0x70000000
-#define PT_PARISC_UNWIND 0x70000001
-
-
-
-#define PF_PARISC_SBP 0x08000000
-
-#define PF_HP_PAGE_SIZE 0x00100000
-#define PF_HP_FAR_SHARED 0x00200000
-#define PF_HP_NEAR_SHARED 0x00400000
-#define PF_HP_CODE 0x01000000
-#define PF_HP_MODIFY 0x02000000
-#define PF_HP_LAZYSWAP 0x04000000
-#define PF_HP_SBP 0x08000000
-
-
-
-
-
-
-#define EF_ALPHA_32BIT 1
-#define EF_ALPHA_CANRELAX 2
-
-
-
-
-#define SHT_ALPHA_DEBUG 0x70000001
-#define SHT_ALPHA_REGINFO 0x70000002
-
-
-
-#define SHF_ALPHA_GPREL 0x10000000
-
-
-#define STO_ALPHA_NOPV 0x80
-#define STO_ALPHA_STD_GPLOAD 0x88
-
-
-
-#define R_ALPHA_NONE 0
-#define R_ALPHA_REFLONG 1
-#define R_ALPHA_REFQUAD 2
-#define R_ALPHA_GPREL32 3
-#define R_ALPHA_LITERAL 4
-#define R_ALPHA_LITUSE 5
-#define R_ALPHA_GPDISP 6
-#define R_ALPHA_BRADDR 7
-#define R_ALPHA_HINT 8
-#define R_ALPHA_SREL16 9
-#define R_ALPHA_SREL32 10
-#define R_ALPHA_SREL64 11
-#define R_ALPHA_GPRELHIGH 17
-#define R_ALPHA_GPRELLOW 18
-#define R_ALPHA_GPREL16 19
-#define R_ALPHA_COPY 24
-#define R_ALPHA_GLOB_DAT 25
-#define R_ALPHA_JMP_SLOT 26
-#define R_ALPHA_RELATIVE 27
-#define R_ALPHA_TLS_GD_HI 28
-#define R_ALPHA_TLSGD 29
-#define R_ALPHA_TLS_LDM 30
-#define R_ALPHA_DTPMOD64 31
-#define R_ALPHA_GOTDTPREL 32
-#define R_ALPHA_DTPREL64 33
-#define R_ALPHA_DTPRELHI 34
-#define R_ALPHA_DTPRELLO 35
-#define R_ALPHA_DTPREL16 36
-#define R_ALPHA_GOTTPREL 37
-#define R_ALPHA_TPREL64 38
-#define R_ALPHA_TPRELHI 39
-#define R_ALPHA_TPRELLO 40
-#define R_ALPHA_TPREL16 41
-
-#define R_ALPHA_NUM 46
-
-
-#define LITUSE_ALPHA_ADDR 0
-#define LITUSE_ALPHA_BASE 1
-#define LITUSE_ALPHA_BYTOFF 2
-#define LITUSE_ALPHA_JSR 3
-#define LITUSE_ALPHA_TLS_GD 4
-#define LITUSE_ALPHA_TLS_LDM 5
-
-
-#define DT_ALPHA_PLTRO (DT_LOPROC + 0)
-#define DT_ALPHA_NUM 1
-
-
-
-
-#define EF_PPC_EMB 0x80000000
-
-
-#define EF_PPC_RELOCATABLE 0x00010000
-#define EF_PPC_RELOCATABLE_LIB 0x00008000
-
-
-
-#define R_PPC_NONE 0
-#define R_PPC_ADDR32 1
-#define R_PPC_ADDR24 2
-#define R_PPC_ADDR16 3
-#define R_PPC_ADDR16_LO 4
-#define R_PPC_ADDR16_HI 5
-#define R_PPC_ADDR16_HA 6
-#define R_PPC_ADDR14 7
-#define R_PPC_ADDR14_BRTAKEN 8
-#define R_PPC_ADDR14_BRNTAKEN 9
-#define R_PPC_REL24 10
-#define R_PPC_REL14 11
-#define R_PPC_REL14_BRTAKEN 12
-#define R_PPC_REL14_BRNTAKEN 13
-#define R_PPC_GOT16 14
-#define R_PPC_GOT16_LO 15
-#define R_PPC_GOT16_HI 16
-#define R_PPC_GOT16_HA 17
-#define R_PPC_PLTREL24 18
-#define R_PPC_COPY 19
-#define R_PPC_GLOB_DAT 20
-#define R_PPC_JMP_SLOT 21
-#define R_PPC_RELATIVE 22
-#define R_PPC_LOCAL24PC 23
-#define R_PPC_UADDR32 24
-#define R_PPC_UADDR16 25
-#define R_PPC_REL32 26
-#define R_PPC_PLT32 27
-#define R_PPC_PLTREL32 28
-#define R_PPC_PLT16_LO 29
-#define R_PPC_PLT16_HI 30
-#define R_PPC_PLT16_HA 31
-#define R_PPC_SDAREL16 32
-#define R_PPC_SECTOFF 33
-#define R_PPC_SECTOFF_LO 34
-#define R_PPC_SECTOFF_HI 35
-#define R_PPC_SECTOFF_HA 36
-
-
-#define R_PPC_TLS 67
-#define R_PPC_DTPMOD32 68
-#define R_PPC_TPREL16 69
-#define R_PPC_TPREL16_LO 70
-#define R_PPC_TPREL16_HI 71
-#define R_PPC_TPREL16_HA 72
-#define R_PPC_TPREL32 73
-#define R_PPC_DTPREL16 74
-#define R_PPC_DTPREL16_LO 75
-#define R_PPC_DTPREL16_HI 76
-#define R_PPC_DTPREL16_HA 77
-#define R_PPC_DTPREL32 78
-#define R_PPC_GOT_TLSGD16 79
-#define R_PPC_GOT_TLSGD16_LO 80
-#define R_PPC_GOT_TLSGD16_HI 81
-#define R_PPC_GOT_TLSGD16_HA 82
-#define R_PPC_GOT_TLSLD16 83
-#define R_PPC_GOT_TLSLD16_LO 84
-#define R_PPC_GOT_TLSLD16_HI 85
-#define R_PPC_GOT_TLSLD16_HA 86
-#define R_PPC_GOT_TPREL16 87
-#define R_PPC_GOT_TPREL16_LO 88
-#define R_PPC_GOT_TPREL16_HI 89
-#define R_PPC_GOT_TPREL16_HA 90
-#define R_PPC_GOT_DTPREL16 91
-#define R_PPC_GOT_DTPREL16_LO 92
-#define R_PPC_GOT_DTPREL16_HI 93
-#define R_PPC_GOT_DTPREL16_HA 94
-
-
-
-#define R_PPC_EMB_NADDR32 101
-#define R_PPC_EMB_NADDR16 102
-#define R_PPC_EMB_NADDR16_LO 103
-#define R_PPC_EMB_NADDR16_HI 104
-#define R_PPC_EMB_NADDR16_HA 105
-#define R_PPC_EMB_SDAI16 106
-#define R_PPC_EMB_SDA2I16 107
-#define R_PPC_EMB_SDA2REL 108
-#define R_PPC_EMB_SDA21 109
-#define R_PPC_EMB_MRKREF 110
-#define R_PPC_EMB_RELSEC16 111
-#define R_PPC_EMB_RELST_LO 112
-#define R_PPC_EMB_RELST_HI 113
-#define R_PPC_EMB_RELST_HA 114
-#define R_PPC_EMB_BIT_FLD 115
-#define R_PPC_EMB_RELSDA 116
-
-
-#define R_PPC_DIAB_SDA21_LO 180
-#define R_PPC_DIAB_SDA21_HI 181
-#define R_PPC_DIAB_SDA21_HA 182
-#define R_PPC_DIAB_RELSDA_LO 183
-#define R_PPC_DIAB_RELSDA_HI 184
-#define R_PPC_DIAB_RELSDA_HA 185
-
-
-#define R_PPC_IRELATIVE 248
-
-
-#define R_PPC_REL16 249
-#define R_PPC_REL16_LO 250
-#define R_PPC_REL16_HI 251
-#define R_PPC_REL16_HA 252
-
-
-
-#define R_PPC_TOC16 255
-
-
-#define DT_PPC_GOT (DT_LOPROC + 0)
-#define DT_PPC_NUM 1
-
-
-#define R_PPC64_NONE R_PPC_NONE
-#define R_PPC64_ADDR32 R_PPC_ADDR32
-#define R_PPC64_ADDR24 R_PPC_ADDR24
-#define R_PPC64_ADDR16 R_PPC_ADDR16
-#define R_PPC64_ADDR16_LO R_PPC_ADDR16_LO
-#define R_PPC64_ADDR16_HI R_PPC_ADDR16_HI
-#define R_PPC64_ADDR16_HA R_PPC_ADDR16_HA
-#define R_PPC64_ADDR14 R_PPC_ADDR14
-#define R_PPC64_ADDR14_BRTAKEN R_PPC_ADDR14_BRTAKEN
-#define R_PPC64_ADDR14_BRNTAKEN R_PPC_ADDR14_BRNTAKEN
-#define R_PPC64_REL24 R_PPC_REL24
-#define R_PPC64_REL14 R_PPC_REL14
-#define R_PPC64_REL14_BRTAKEN R_PPC_REL14_BRTAKEN
-#define R_PPC64_REL14_BRNTAKEN R_PPC_REL14_BRNTAKEN
-#define R_PPC64_GOT16 R_PPC_GOT16
-#define R_PPC64_GOT16_LO R_PPC_GOT16_LO
-#define R_PPC64_GOT16_HI R_PPC_GOT16_HI
-#define R_PPC64_GOT16_HA R_PPC_GOT16_HA
-
-#define R_PPC64_COPY R_PPC_COPY
-#define R_PPC64_GLOB_DAT R_PPC_GLOB_DAT
-#define R_PPC64_JMP_SLOT R_PPC_JMP_SLOT
-#define R_PPC64_RELATIVE R_PPC_RELATIVE
-
-#define R_PPC64_UADDR32 R_PPC_UADDR32
-#define R_PPC64_UADDR16 R_PPC_UADDR16
-#define R_PPC64_REL32 R_PPC_REL32
-#define R_PPC64_PLT32 R_PPC_PLT32
-#define R_PPC64_PLTREL32 R_PPC_PLTREL32
-#define R_PPC64_PLT16_LO R_PPC_PLT16_LO
-#define R_PPC64_PLT16_HI R_PPC_PLT16_HI
-#define R_PPC64_PLT16_HA R_PPC_PLT16_HA
-
-#define R_PPC64_SECTOFF R_PPC_SECTOFF
-#define R_PPC64_SECTOFF_LO R_PPC_SECTOFF_LO
-#define R_PPC64_SECTOFF_HI R_PPC_SECTOFF_HI
-#define R_PPC64_SECTOFF_HA R_PPC_SECTOFF_HA
-#define R_PPC64_ADDR30 37
-#define R_PPC64_ADDR64 38
-#define R_PPC64_ADDR16_HIGHER 39
-#define R_PPC64_ADDR16_HIGHERA 40
-#define R_PPC64_ADDR16_HIGHEST 41
-#define R_PPC64_ADDR16_HIGHESTA 42
-#define R_PPC64_UADDR64 43
-#define R_PPC64_REL64 44
-#define R_PPC64_PLT64 45
-#define R_PPC64_PLTREL64 46
-#define R_PPC64_TOC16 47
-#define R_PPC64_TOC16_LO 48
-#define R_PPC64_TOC16_HI 49
-#define R_PPC64_TOC16_HA 50
-#define R_PPC64_TOC 51
-#define R_PPC64_PLTGOT16 52
-#define R_PPC64_PLTGOT16_LO 53
-#define R_PPC64_PLTGOT16_HI 54
-#define R_PPC64_PLTGOT16_HA 55
-
-#define R_PPC64_ADDR16_DS 56
-#define R_PPC64_ADDR16_LO_DS 57
-#define R_PPC64_GOT16_DS 58
-#define R_PPC64_GOT16_LO_DS 59
-#define R_PPC64_PLT16_LO_DS 60
-#define R_PPC64_SECTOFF_DS 61
-#define R_PPC64_SECTOFF_LO_DS 62
-#define R_PPC64_TOC16_DS 63
-#define R_PPC64_TOC16_LO_DS 64
-#define R_PPC64_PLTGOT16_DS 65
-#define R_PPC64_PLTGOT16_LO_DS 66
-
-
-#define R_PPC64_TLS 67
-#define R_PPC64_DTPMOD64 68
-#define R_PPC64_TPREL16 69
-#define R_PPC64_TPREL16_LO 70
-#define R_PPC64_TPREL16_HI 71
-#define R_PPC64_TPREL16_HA 72
-#define R_PPC64_TPREL64 73
-#define R_PPC64_DTPREL16 74
-#define R_PPC64_DTPREL16_LO 75
-#define R_PPC64_DTPREL16_HI 76
-#define R_PPC64_DTPREL16_HA 77
-#define R_PPC64_DTPREL64 78
-#define R_PPC64_GOT_TLSGD16 79
-#define R_PPC64_GOT_TLSGD16_LO 80
-#define R_PPC64_GOT_TLSGD16_HI 81
-#define R_PPC64_GOT_TLSGD16_HA 82
-#define R_PPC64_GOT_TLSLD16 83
-#define R_PPC64_GOT_TLSLD16_LO 84
-#define R_PPC64_GOT_TLSLD16_HI 85
-#define R_PPC64_GOT_TLSLD16_HA 86
-#define R_PPC64_GOT_TPREL16_DS 87
-#define R_PPC64_GOT_TPREL16_LO_DS 88
-#define R_PPC64_GOT_TPREL16_HI 89
-#define R_PPC64_GOT_TPREL16_HA 90
-#define R_PPC64_GOT_DTPREL16_DS 91
-#define R_PPC64_GOT_DTPREL16_LO_DS 92
-#define R_PPC64_GOT_DTPREL16_HI 93
-#define R_PPC64_GOT_DTPREL16_HA 94
-#define R_PPC64_TPREL16_DS 95
-#define R_PPC64_TPREL16_LO_DS 96
-#define R_PPC64_TPREL16_HIGHER 97
-#define R_PPC64_TPREL16_HIGHERA 98
-#define R_PPC64_TPREL16_HIGHEST 99
-#define R_PPC64_TPREL16_HIGHESTA 100
-#define R_PPC64_DTPREL16_DS 101
-#define R_PPC64_DTPREL16_LO_DS 102
-#define R_PPC64_DTPREL16_HIGHER 103
-#define R_PPC64_DTPREL16_HIGHERA 104
-#define R_PPC64_DTPREL16_HIGHEST 105
-#define R_PPC64_DTPREL16_HIGHESTA 106
-
-
-#define R_PPC64_JMP_IREL 247
-#define R_PPC64_IRELATIVE 248
-#define R_PPC64_REL16 249
-#define R_PPC64_REL16_LO 250
-#define R_PPC64_REL16_HI 251
-#define R_PPC64_REL16_HA 252
-
-
-#define DT_PPC64_GLINK (DT_LOPROC + 0)
-#define DT_PPC64_OPD (DT_LOPROC + 1)
-#define DT_PPC64_OPDSZ (DT_LOPROC + 2)
-#define DT_PPC64_NUM 3
-
-
-
-
-
-#define EF_ARM_RELEXEC 0x01
-#define EF_ARM_HASENTRY 0x02
-#define EF_ARM_INTERWORK 0x04
-#define EF_ARM_APCS_26 0x08
-#define EF_ARM_APCS_FLOAT 0x10
-#define EF_ARM_PIC 0x20
-#define EF_ARM_ALIGN8 0x40
-#define EF_ARM_NEW_ABI 0x80
-#define EF_ARM_OLD_ABI 0x100
-#define EF_ARM_SOFT_FLOAT 0x200
-#define EF_ARM_VFP_FLOAT 0x400
-#define EF_ARM_MAVERICK_FLOAT 0x800
-
-#define EF_ARM_ABI_FLOAT_SOFT 0x200
-#define EF_ARM_ABI_FLOAT_HARD 0x400
-
-
-#define EF_ARM_SYMSARESORTED 0x04
-#define EF_ARM_DYNSYMSUSESEGIDX 0x08
-#define EF_ARM_MAPSYMSFIRST 0x10
-#define EF_ARM_EABIMASK 0XFF000000
-
-
-#define EF_ARM_BE8 0x00800000
-#define EF_ARM_LE8 0x00400000
-
-#define EF_ARM_EABI_VERSION(flags) ((flags) & EF_ARM_EABIMASK)
-#define EF_ARM_EABI_UNKNOWN 0x00000000
-#define EF_ARM_EABI_VER1 0x01000000
-#define EF_ARM_EABI_VER2 0x02000000
-#define EF_ARM_EABI_VER3 0x03000000
-#define EF_ARM_EABI_VER4 0x04000000
-#define EF_ARM_EABI_VER5 0x05000000
-
-
-#define STT_ARM_TFUNC STT_LOPROC
-#define STT_ARM_16BIT STT_HIPROC
-
-
-#define SHF_ARM_ENTRYSECT 0x10000000
-#define SHF_ARM_COMDEF 0x80000000
-
-
-
-#define PF_ARM_SB 0x10000000
-
-#define PF_ARM_PI 0x20000000
-#define PF_ARM_ABS 0x40000000
-
-
-#define PT_ARM_EXIDX (PT_LOPROC + 1)
-
-
-#define SHT_ARM_EXIDX (SHT_LOPROC + 1)
-#define SHT_ARM_PREEMPTMAP (SHT_LOPROC + 2)
-#define SHT_ARM_ATTRIBUTES (SHT_LOPROC + 3)
-
-
-#define R_AARCH64_NONE 0
-#define R_AARCH64_ABS64 257
-#define R_AARCH64_ABS32 258
-#define R_AARCH64_ABS16 259
-#define R_AARCH64_PREL64 260
-#define R_AARCH64_PREL32 261
-#define R_AARCH64_PREL16 262
-#define R_AARCH64_MOVW_UABS_G0 263
-#define R_AARCH64_MOVW_UABS_G0_NC 264
-#define R_AARCH64_MOVW_UABS_G1 265
-#define R_AARCH64_MOVW_UABS_G1_NC 266
-#define R_AARCH64_MOVW_UABS_G2 267
-#define R_AARCH64_MOVW_UABS_G2_NC 268
-#define R_AARCH64_MOVW_UABS_G3 269
-#define R_AARCH64_MOVW_SABS_G0 270
-#define R_AARCH64_MOVW_SABS_G1 271
-#define R_AARCH64_MOVW_SABS_G2 272
-#define R_AARCH64_LD_PREL_LO19 273
-#define R_AARCH64_ADR_PREL_LO21 274
-#define R_AARCH64_ADR_PREL_PG_HI21 275
-#define R_AARCH64_ADR_PREL_PG_HI21_NC 276
-#define R_AARCH64_ADD_ABS_LO12_NC 277
-#define R_AARCH64_LDST8_ABS_LO12_NC 278
-#define R_AARCH64_TSTBR14 279
-#define R_AARCH64_CONDBR19 280
-#define R_AARCH64_JUMP26 282
-#define R_AARCH64_CALL26 283
-#define R_AARCH64_LDST16_ABS_LO12_NC 284
-#define R_AARCH64_LDST32_ABS_LO12_NC 285
-#define R_AARCH64_LDST64_ABS_LO12_NC 286
-#define R_AARCH64_MOVW_PREL_G0 287
-#define R_AARCH64_MOVW_PREL_G0_NC 288
-#define R_AARCH64_MOVW_PREL_G1 289
-#define R_AARCH64_MOVW_PREL_G1_NC 290
-#define R_AARCH64_MOVW_PREL_G2 291
-#define R_AARCH64_MOVW_PREL_G2_NC 292
-#define R_AARCH64_MOVW_PREL_G3 293
-#define R_AARCH64_LDST128_ABS_LO12_NC 299
-#define R_AARCH64_MOVW_GOTOFF_G0 300
-#define R_AARCH64_MOVW_GOTOFF_G0_NC 301
-#define R_AARCH64_MOVW_GOTOFF_G1 302
-#define R_AARCH64_MOVW_GOTOFF_G1_NC 303
-#define R_AARCH64_MOVW_GOTOFF_G2 304
-#define R_AARCH64_MOVW_GOTOFF_G2_NC 305
-#define R_AARCH64_MOVW_GOTOFF_G3 306
-#define R_AARCH64_GOTREL64 307
-#define R_AARCH64_GOTREL32 308
-#define R_AARCH64_GOT_LD_PREL19 309
-#define R_AARCH64_LD64_GOTOFF_LO15 310
-#define R_AARCH64_ADR_GOT_PAGE 311
-#define R_AARCH64_LD64_GOT_LO12_NC 312
-#define R_AARCH64_LD64_GOTPAGE_LO15 313
-#define R_AARCH64_TLSGD_ADR_PREL21 512
-#define R_AARCH64_TLSGD_ADR_PAGE21 513
-#define R_AARCH64_TLSGD_ADD_LO12_NC 514
-#define R_AARCH64_TLSGD_MOVW_G1 515
-#define R_AARCH64_TLSGD_MOVW_G0_NC 516
-#define R_AARCH64_TLSLD_ADR_PREL21 517
-#define R_AARCH64_TLSLD_ADR_PAGE21 518
-#define R_AARCH64_TLSLD_ADD_LO12_NC 519
-#define R_AARCH64_TLSLD_MOVW_G1 520
-#define R_AARCH64_TLSLD_MOVW_G0_NC 521
-#define R_AARCH64_TLSLD_LD_PREL19 522
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G2 523
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G1 524
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC 525
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G0 526
-#define R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC 527
-#define R_AARCH64_TLSLD_ADD_DTPREL_HI12 528
-#define R_AARCH64_TLSLD_ADD_DTPREL_LO12 529
-#define R_AARCH64_TLSLD_ADD_DTPREL_LO12_NC 530
-#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12 531
-#define R_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC 532
-#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12 533
-#define R_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC 534
-#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12 535
-#define R_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC 536
-#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12 537
-#define R_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC 538
-#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G1 539
-#define R_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC 540
-#define R_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21 541
-#define R_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC 542
-#define R_AARCH64_TLSIE_LD_GOTTPREL_PREL19 543
-#define R_AARCH64_TLSLE_MOVW_TPREL_G2 544
-#define R_AARCH64_TLSLE_MOVW_TPREL_G1 545
-#define R_AARCH64_TLSLE_MOVW_TPREL_G1_NC 546
-#define R_AARCH64_TLSLE_MOVW_TPREL_G0 547
-#define R_AARCH64_TLSLE_MOVW_TPREL_G0_NC 548
-#define R_AARCH64_TLSLE_ADD_TPREL_HI12 549
-#define R_AARCH64_TLSLE_ADD_TPREL_LO12 550
-#define R_AARCH64_TLSLE_ADD_TPREL_LO12_NC 551
-#define R_AARCH64_TLSLE_LDST8_TPREL_LO12 552
-#define R_AARCH64_TLSLE_LDST8_TPREL_LO12_NC 553
-#define R_AARCH64_TLSLE_LDST16_TPREL_LO12 554
-#define R_AARCH64_TLSLE_LDST16_TPREL_LO12_NC 555
-#define R_AARCH64_TLSLE_LDST32_TPREL_LO12 556
-#define R_AARCH64_TLSLE_LDST32_TPREL_LO12_NC 557
-#define R_AARCH64_TLSLE_LDST64_TPREL_LO12 558
-#define R_AARCH64_TLSLE_LDST64_TPREL_LO12_NC 559
-#define R_AARCH64_TLSDESC_LD_PREL19 560
-#define R_AARCH64_TLSDESC_ADR_PREL21 561
-#define R_AARCH64_TLSDESC_ADR_PAGE21 562
-#define R_AARCH64_TLSDESC_LD64_LO12 563
-#define R_AARCH64_TLSDESC_ADD_LO12 564
-#define R_AARCH64_TLSDESC_OFF_G1 565
-#define R_AARCH64_TLSDESC_OFF_G0_NC 566
-#define R_AARCH64_TLSDESC_LDR 567
-#define R_AARCH64_TLSDESC_ADD 568
-#define R_AARCH64_TLSDESC_CALL 569
-#define R_AARCH64_TLSLE_LDST128_TPREL_LO12 570
-#define R_AARCH64_TLSLE_LDST128_TPREL_LO12_NC 571
-#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12 572
-#define R_AARCH64_TLSLD_LDST128_DTPREL_LO12_NC 573
-#define R_AARCH64_COPY 1024
-#define R_AARCH64_GLOB_DAT 1025
-#define R_AARCH64_JUMP_SLOT 1026
-#define R_AARCH64_RELATIVE 1027
-#define R_AARCH64_TLS_DTPMOD64 1028
-#define R_AARCH64_TLS_DTPREL64 1029
-#define R_AARCH64_TLS_TPREL64 1030
-#define R_AARCH64_TLSDESC 1031
-
-
-#define R_ARM_NONE 0
-#define R_ARM_PC24 1
-#define R_ARM_ABS32 2
-#define R_ARM_REL32 3
-#define R_ARM_PC13 4
-#define R_ARM_ABS16 5
-#define R_ARM_ABS12 6
-#define R_ARM_THM_ABS5 7
-#define R_ARM_ABS8 8
-#define R_ARM_SBREL32 9
-#define R_ARM_THM_PC22 10
-#define R_ARM_THM_PC8 11
-#define R_ARM_AMP_VCALL9 12
-#define R_ARM_TLS_DESC 13
-#define R_ARM_THM_SWI8 14
-#define R_ARM_XPC25 15
-#define R_ARM_THM_XPC22 16
-#define R_ARM_TLS_DTPMOD32 17
-#define R_ARM_TLS_DTPOFF32 18
-#define R_ARM_TLS_TPOFF32 19
-#define R_ARM_COPY 20
-#define R_ARM_GLOB_DAT 21
-#define R_ARM_JUMP_SLOT 22
-#define R_ARM_RELATIVE 23
-#define R_ARM_GOTOFF 24
-#define R_ARM_GOTPC 25
-#define R_ARM_GOT32 26
-#define R_ARM_PLT32 27
-#define R_ARM_CALL 28
-#define R_ARM_JUMP24 29
-#define R_ARM_THM_JUMP24 30
-#define R_ARM_BASE_ABS 31
-#define R_ARM_ALU_PCREL_7_0 32
-#define R_ARM_ALU_PCREL_15_8 33
-#define R_ARM_ALU_PCREL_23_15 34
-#define R_ARM_LDR_SBREL_11_0 35
-#define R_ARM_ALU_SBREL_19_12 36
-#define R_ARM_ALU_SBREL_27_20 37
-#define R_ARM_TARGET1 38
-#define R_ARM_SBREL31 39
-#define R_ARM_V4BX 40
-#define R_ARM_TARGET2 41
-#define R_ARM_PREL31 42
-#define R_ARM_MOVW_ABS_NC 43
-#define R_ARM_MOVT_ABS 44
-#define R_ARM_MOVW_PREL_NC 45
-#define R_ARM_MOVT_PREL 46
-#define R_ARM_THM_MOVW_ABS_NC 47
-#define R_ARM_THM_MOVT_ABS 48
-#define R_ARM_THM_MOVW_PREL_NC 49
-#define R_ARM_THM_MOVT_PREL 50
-#define R_ARM_THM_JUMP19 51
-#define R_ARM_THM_JUMP6 52
-#define R_ARM_THM_ALU_PREL_11_0 53
-#define R_ARM_THM_PC12 54
-#define R_ARM_ABS32_NOI 55
-#define R_ARM_REL32_NOI 56
-#define R_ARM_ALU_PC_G0_NC 57
-#define R_ARM_ALU_PC_G0 58
-#define R_ARM_ALU_PC_G1_NC 59
-#define R_ARM_ALU_PC_G1 60
-#define R_ARM_ALU_PC_G2 61
-#define R_ARM_LDR_PC_G1 62
-#define R_ARM_LDR_PC_G2 63
-#define R_ARM_LDRS_PC_G0 64
-#define R_ARM_LDRS_PC_G1 65
-#define R_ARM_LDRS_PC_G2 66
-#define R_ARM_LDC_PC_G0 67
-#define R_ARM_LDC_PC_G1 68
-#define R_ARM_LDC_PC_G2 69
-#define R_ARM_ALU_SB_G0_NC 70
-#define R_ARM_ALU_SB_G0 71
-#define R_ARM_ALU_SB_G1_NC 72
-#define R_ARM_ALU_SB_G1 73
-#define R_ARM_ALU_SB_G2 74
-#define R_ARM_LDR_SB_G0 75
-#define R_ARM_LDR_SB_G1 76
-#define R_ARM_LDR_SB_G2 77
-#define R_ARM_LDRS_SB_G0 78
-#define R_ARM_LDRS_SB_G1 79
-#define R_ARM_LDRS_SB_G2 80
-#define R_ARM_LDC_SB_G0 81
-#define R_ARM_LDC_SB_G1 82
-#define R_ARM_LDC_SB_G2 83
-#define R_ARM_MOVW_BREL_NC 84
-#define R_ARM_MOVT_BREL 85
-#define R_ARM_MOVW_BREL 86
-#define R_ARM_THM_MOVW_BREL_NC 87
-#define R_ARM_THM_MOVT_BREL 88
-#define R_ARM_THM_MOVW_BREL 89
-#define R_ARM_TLS_GOTDESC 90
-#define R_ARM_TLS_CALL 91
-#define R_ARM_TLS_DESCSEQ 92
-#define R_ARM_THM_TLS_CALL 93
-#define R_ARM_PLT32_ABS 94
-#define R_ARM_GOT_ABS 95
-#define R_ARM_GOT_PREL 96
-#define R_ARM_GOT_BREL12 97
-#define R_ARM_GOTOFF12 98
-#define R_ARM_GOTRELAX 99
-#define R_ARM_GNU_VTENTRY 100
-#define R_ARM_GNU_VTINHERIT 101
-#define R_ARM_THM_PC11 102
-#define R_ARM_THM_PC9 103
-#define R_ARM_TLS_GD32 104
-
-#define R_ARM_TLS_LDM32 105
-
-#define R_ARM_TLS_LDO32 106
-
-#define R_ARM_TLS_IE32 107
-
-#define R_ARM_TLS_LE32 108
-#define R_ARM_TLS_LDO12 109
-#define R_ARM_TLS_LE12 110
-#define R_ARM_TLS_IE12GP 111
-#define R_ARM_ME_TOO 128
-#define R_ARM_THM_TLS_DESCSEQ 129
-#define R_ARM_THM_TLS_DESCSEQ16 129
-#define R_ARM_THM_TLS_DESCSEQ32 130
-#define R_ARM_THM_GOT_BREL12 131
-#define R_ARM_IRELATIVE 160
-#define R_ARM_RXPC25 249
-#define R_ARM_RSBREL32 250
-#define R_ARM_THM_RPC22 251
-#define R_ARM_RREL32 252
-#define R_ARM_RABS22 253
-#define R_ARM_RPC24 254
-#define R_ARM_RBASE 255
-
-#define R_ARM_NUM 256
-
-
-
-
-#define EF_IA_64_MASKOS 0x0000000f
-#define EF_IA_64_ABI64 0x00000010
-#define EF_IA_64_ARCH 0xff000000
-
-
-#define PT_IA_64_ARCHEXT (PT_LOPROC + 0)
-#define PT_IA_64_UNWIND (PT_LOPROC + 1)
-#define PT_IA_64_HP_OPT_ANOT (PT_LOOS + 0x12)
-#define PT_IA_64_HP_HSL_ANOT (PT_LOOS + 0x13)
-#define PT_IA_64_HP_STACK (PT_LOOS + 0x14)
-
-
-#define PF_IA_64_NORECOV 0x80000000
-
-
-#define SHT_IA_64_EXT (SHT_LOPROC + 0)
-#define SHT_IA_64_UNWIND (SHT_LOPROC + 1)
-
-
-#define SHF_IA_64_SHORT 0x10000000
-#define SHF_IA_64_NORECOV 0x20000000
-
-
-#define DT_IA_64_PLT_RESERVE (DT_LOPROC + 0)
-#define DT_IA_64_NUM 1
-
-
-#define R_IA64_NONE 0x00
-#define R_IA64_IMM14 0x21
-#define R_IA64_IMM22 0x22
-#define R_IA64_IMM64 0x23
-#define R_IA64_DIR32MSB 0x24
-#define R_IA64_DIR32LSB 0x25
-#define R_IA64_DIR64MSB 0x26
-#define R_IA64_DIR64LSB 0x27
-#define R_IA64_GPREL22 0x2a
-#define R_IA64_GPREL64I 0x2b
-#define R_IA64_GPREL32MSB 0x2c
-#define R_IA64_GPREL32LSB 0x2d
-#define R_IA64_GPREL64MSB 0x2e
-#define R_IA64_GPREL64LSB 0x2f
-#define R_IA64_LTOFF22 0x32
-#define R_IA64_LTOFF64I 0x33
-#define R_IA64_PLTOFF22 0x3a
-#define R_IA64_PLTOFF64I 0x3b
-#define R_IA64_PLTOFF64MSB 0x3e
-#define R_IA64_PLTOFF64LSB 0x3f
-#define R_IA64_FPTR64I 0x43
-#define R_IA64_FPTR32MSB 0x44
-#define R_IA64_FPTR32LSB 0x45
-#define R_IA64_FPTR64MSB 0x46
-#define R_IA64_FPTR64LSB 0x47
-#define R_IA64_PCREL60B 0x48
-#define R_IA64_PCREL21B 0x49
-#define R_IA64_PCREL21M 0x4a
-#define R_IA64_PCREL21F 0x4b
-#define R_IA64_PCREL32MSB 0x4c
-#define R_IA64_PCREL32LSB 0x4d
-#define R_IA64_PCREL64MSB 0x4e
-#define R_IA64_PCREL64LSB 0x4f
-#define R_IA64_LTOFF_FPTR22 0x52
-#define R_IA64_LTOFF_FPTR64I 0x53
-#define R_IA64_LTOFF_FPTR32MSB 0x54
-#define R_IA64_LTOFF_FPTR32LSB 0x55
-#define R_IA64_LTOFF_FPTR64MSB 0x56
-#define R_IA64_LTOFF_FPTR64LSB 0x57
-#define R_IA64_SEGREL32MSB 0x5c
-#define R_IA64_SEGREL32LSB 0x5d
-#define R_IA64_SEGREL64MSB 0x5e
-#define R_IA64_SEGREL64LSB 0x5f
-#define R_IA64_SECREL32MSB 0x64
-#define R_IA64_SECREL32LSB 0x65
-#define R_IA64_SECREL64MSB 0x66
-#define R_IA64_SECREL64LSB 0x67
-#define R_IA64_REL32MSB 0x6c
-#define R_IA64_REL32LSB 0x6d
-#define R_IA64_REL64MSB 0x6e
-#define R_IA64_REL64LSB 0x6f
-#define R_IA64_LTV32MSB 0x74
-#define R_IA64_LTV32LSB 0x75
-#define R_IA64_LTV64MSB 0x76
-#define R_IA64_LTV64LSB 0x77
-#define R_IA64_PCREL21BI 0x79
-#define R_IA64_PCREL22 0x7a
-#define R_IA64_PCREL64I 0x7b
-#define R_IA64_IPLTMSB 0x80
-#define R_IA64_IPLTLSB 0x81
-#define R_IA64_COPY 0x84
-#define R_IA64_SUB 0x85
-#define R_IA64_LTOFF22X 0x86
-#define R_IA64_LDXMOV 0x87
-#define R_IA64_TPREL14 0x91
-#define R_IA64_TPREL22 0x92
-#define R_IA64_TPREL64I 0x93
-#define R_IA64_TPREL64MSB 0x96
-#define R_IA64_TPREL64LSB 0x97
-#define R_IA64_LTOFF_TPREL22 0x9a
-#define R_IA64_DTPMOD64MSB 0xa6
-#define R_IA64_DTPMOD64LSB 0xa7
-#define R_IA64_LTOFF_DTPMOD22 0xaa
-#define R_IA64_DTPREL14 0xb1
-#define R_IA64_DTPREL22 0xb2
-#define R_IA64_DTPREL64I 0xb3
-#define R_IA64_DTPREL32MSB 0xb4
-#define R_IA64_DTPREL32LSB 0xb5
-#define R_IA64_DTPREL64MSB 0xb6
-#define R_IA64_DTPREL64LSB 0xb7
-#define R_IA64_LTOFF_DTPREL22 0xba
-
-
-
-
-#define R_SH_NONE 0
-#define R_SH_DIR32 1
-#define R_SH_REL32 2
-#define R_SH_DIR8WPN 3
-#define R_SH_IND12W 4
-#define R_SH_DIR8WPL 5
-#define R_SH_DIR8WPZ 6
-#define R_SH_DIR8BP 7
-#define R_SH_DIR8W 8
-#define R_SH_DIR8L 9
-#define R_SH_SWITCH16 25
-#define R_SH_SWITCH32 26
-#define R_SH_USES 27
-#define R_SH_COUNT 28
-#define R_SH_ALIGN 29
-#define R_SH_CODE 30
-#define R_SH_DATA 31
-#define R_SH_LABEL 32
-#define R_SH_SWITCH8 33
-#define R_SH_GNU_VTINHERIT 34
-#define R_SH_GNU_VTENTRY 35
-#define R_SH_TLS_GD_32 144
-#define R_SH_TLS_LD_32 145
-#define R_SH_TLS_LDO_32 146
-#define R_SH_TLS_IE_32 147
-#define R_SH_TLS_LE_32 148
-#define R_SH_TLS_DTPMOD32 149
-#define R_SH_TLS_DTPOFF32 150
-#define R_SH_TLS_TPOFF32 151
-#define R_SH_GOT32 160
-#define R_SH_PLT32 161
-#define R_SH_COPY 162
-#define R_SH_GLOB_DAT 163
-#define R_SH_JMP_SLOT 164
-#define R_SH_RELATIVE 165
-#define R_SH_GOTOFF 166
-#define R_SH_GOTPC 167
-#define R_SH_GOT20 201
-#define R_SH_GOTOFF20 202
-#define R_SH_GOTFUNCDESC 203
-#define R_SH_GOTFUNCDEST20 204
-#define R_SH_GOTOFFFUNCDESC 205
-#define R_SH_GOTOFFFUNCDEST20 206
-#define R_SH_FUNCDESC 207
-#define R_SH_FUNCDESC_VALUE 208
-
-#define R_SH_NUM 256
-
-
-
-#define R_390_NONE 0
-#define R_390_8 1
-#define R_390_12 2
-#define R_390_16 3
-#define R_390_32 4
-#define R_390_PC32 5
-#define R_390_GOT12 6
-#define R_390_GOT32 7
-#define R_390_PLT32 8
-#define R_390_COPY 9
-#define R_390_GLOB_DAT 10
-#define R_390_JMP_SLOT 11
-#define R_390_RELATIVE 12
-#define R_390_GOTOFF32 13
-#define R_390_GOTPC 14
-#define R_390_GOT16 15
-#define R_390_PC16 16
-#define R_390_PC16DBL 17
-#define R_390_PLT16DBL 18
-#define R_390_PC32DBL 19
-#define R_390_PLT32DBL 20
-#define R_390_GOTPCDBL 21
-#define R_390_64 22
-#define R_390_PC64 23
-#define R_390_GOT64 24
-#define R_390_PLT64 25
-#define R_390_GOTENT 26
-#define R_390_GOTOFF16 27
-#define R_390_GOTOFF64 28
-#define R_390_GOTPLT12 29
-#define R_390_GOTPLT16 30
-#define R_390_GOTPLT32 31
-#define R_390_GOTPLT64 32
-#define R_390_GOTPLTENT 33
-#define R_390_PLTOFF16 34
-#define R_390_PLTOFF32 35
-#define R_390_PLTOFF64 36
-#define R_390_TLS_LOAD 37
-#define R_390_TLS_GDCALL 38
-
-#define R_390_TLS_LDCALL 39
-
-#define R_390_TLS_GD32 40
-
-#define R_390_TLS_GD64 41
-
-#define R_390_TLS_GOTIE12 42
-
-#define R_390_TLS_GOTIE32 43
-
-#define R_390_TLS_GOTIE64 44
-
-#define R_390_TLS_LDM32 45
-
-#define R_390_TLS_LDM64 46
-
-#define R_390_TLS_IE32 47
-
-#define R_390_TLS_IE64 48
-
-#define R_390_TLS_IEENT 49
-
-#define R_390_TLS_LE32 50
-
-#define R_390_TLS_LE64 51
-
-#define R_390_TLS_LDO32 52
-
-#define R_390_TLS_LDO64 53
-
-#define R_390_TLS_DTPMOD 54
-#define R_390_TLS_DTPOFF 55
-#define R_390_TLS_TPOFF 56
-
-#define R_390_20 57
-#define R_390_GOT20 58
-#define R_390_GOTPLT20 59
-#define R_390_TLS_GOTIE20 60
-
-
-#define R_390_NUM 61
-
-
-
-#define R_CRIS_NONE 0
-#define R_CRIS_8 1
-#define R_CRIS_16 2
-#define R_CRIS_32 3
-#define R_CRIS_8_PCREL 4
-#define R_CRIS_16_PCREL 5
-#define R_CRIS_32_PCREL 6
-#define R_CRIS_GNU_VTINHERIT 7
-#define R_CRIS_GNU_VTENTRY 8
-#define R_CRIS_COPY 9
-#define R_CRIS_GLOB_DAT 10
-#define R_CRIS_JUMP_SLOT 11
-#define R_CRIS_RELATIVE 12
-#define R_CRIS_16_GOT 13
-#define R_CRIS_32_GOT 14
-#define R_CRIS_16_GOTPLT 15
-#define R_CRIS_32_GOTPLT 16
-#define R_CRIS_32_GOTREL 17
-#define R_CRIS_32_PLT_GOTREL 18
-#define R_CRIS_32_PLT_PCREL 19
-
-#define R_CRIS_NUM 20
-
-
-
-#define R_X86_64_NONE 0
-#define R_X86_64_64 1
-#define R_X86_64_PC32 2
-#define R_X86_64_GOT32 3
-#define R_X86_64_PLT32 4
-#define R_X86_64_COPY 5
-#define R_X86_64_GLOB_DAT 6
-#define R_X86_64_JUMP_SLOT 7
-#define R_X86_64_RELATIVE 8
-#define R_X86_64_GOTPCREL 9
-
-#define R_X86_64_32 10
-#define R_X86_64_32S 11
-#define R_X86_64_16 12
-#define R_X86_64_PC16 13
-#define R_X86_64_8 14
-#define R_X86_64_PC8 15
-#define R_X86_64_DTPMOD64 16
-#define R_X86_64_DTPOFF64 17
-#define R_X86_64_TPOFF64 18
-#define R_X86_64_TLSGD 19
-
-#define R_X86_64_TLSLD 20
-
-#define R_X86_64_DTPOFF32 21
-#define R_X86_64_GOTTPOFF 22
-
-#define R_X86_64_TPOFF32 23
-#define R_X86_64_PC64 24
-#define R_X86_64_GOTOFF64 25
-#define R_X86_64_GOTPC32 26
-#define R_X86_64_GOT64 27
-#define R_X86_64_GOTPCREL64 28
-#define R_X86_64_GOTPC64 29
-#define R_X86_64_GOTPLT64 30
-#define R_X86_64_PLTOFF64 31
-#define R_X86_64_SIZE32 32
-#define R_X86_64_SIZE64 33
-
-#define R_X86_64_GOTPC32_TLSDESC 34
-#define R_X86_64_TLSDESC_CALL 35
-
-#define R_X86_64_TLSDESC 36
-#define R_X86_64_IRELATIVE 37
-#define R_X86_64_RELATIVE64 38
-#define R_X86_64_NUM 39
-
-
-
-#define R_MN10300_NONE 0
-#define R_MN10300_32 1
-#define R_MN10300_16 2
-#define R_MN10300_8 3
-#define R_MN10300_PCREL32 4
-#define R_MN10300_PCREL16 5
-#define R_MN10300_PCREL8 6
-#define R_MN10300_GNU_VTINHERIT 7
-#define R_MN10300_GNU_VTENTRY 8
-#define R_MN10300_24 9
-#define R_MN10300_GOTPC32 10
-#define R_MN10300_GOTPC16 11
-#define R_MN10300_GOTOFF32 12
-#define R_MN10300_GOTOFF24 13
-#define R_MN10300_GOTOFF16 14
-#define R_MN10300_PLT32 15
-#define R_MN10300_PLT16 16
-#define R_MN10300_GOT32 17
-#define R_MN10300_GOT24 18
-#define R_MN10300_GOT16 19
-#define R_MN10300_COPY 20
-#define R_MN10300_GLOB_DAT 21
-#define R_MN10300_JMP_SLOT 22
-#define R_MN10300_RELATIVE 23
-
-#define R_MN10300_NUM 24
-
-
-
-#define R_M32R_NONE 0
-#define R_M32R_16 1
-#define R_M32R_32 2
-#define R_M32R_24 3
-#define R_M32R_10_PCREL 4
-#define R_M32R_18_PCREL 5
-#define R_M32R_26_PCREL 6
-#define R_M32R_HI16_ULO 7
-#define R_M32R_HI16_SLO 8
-#define R_M32R_LO16 9
-#define R_M32R_SDA16 10
-#define R_M32R_GNU_VTINHERIT 11
-#define R_M32R_GNU_VTENTRY 12
-
-#define R_M32R_16_RELA 33
-#define R_M32R_32_RELA 34
-#define R_M32R_24_RELA 35
-#define R_M32R_10_PCREL_RELA 36
-#define R_M32R_18_PCREL_RELA 37
-#define R_M32R_26_PCREL_RELA 38
-#define R_M32R_HI16_ULO_RELA 39
-#define R_M32R_HI16_SLO_RELA 40
-#define R_M32R_LO16_RELA 41
-#define R_M32R_SDA16_RELA 42
-#define R_M32R_RELA_GNU_VTINHERIT 43
-#define R_M32R_RELA_GNU_VTENTRY 44
-#define R_M32R_REL32 45
-
-#define R_M32R_GOT24 48
-#define R_M32R_26_PLTREL 49
-#define R_M32R_COPY 50
-#define R_M32R_GLOB_DAT 51
-#define R_M32R_JMP_SLOT 52
-#define R_M32R_RELATIVE 53
-#define R_M32R_GOTOFF 54
-#define R_M32R_GOTPC24 55
-#define R_M32R_GOT16_HI_ULO 56
-
-#define R_M32R_GOT16_HI_SLO 57
-
-#define R_M32R_GOT16_LO 58
-#define R_M32R_GOTPC_HI_ULO 59
-
-#define R_M32R_GOTPC_HI_SLO 60
-
-#define R_M32R_GOTPC_LO 61
-
-#define R_M32R_GOTOFF_HI_ULO 62
-
-#define R_M32R_GOTOFF_HI_SLO 63
-
-#define R_M32R_GOTOFF_LO 64
-#define R_M32R_NUM 256
-
-#define R_MICROBLAZE_NONE 0
-#define R_MICROBLAZE_32 1
-#define R_MICROBLAZE_32_PCREL 2
-#define R_MICROBLAZE_64_PCREL 3
-#define R_MICROBLAZE_32_PCREL_LO 4
-#define R_MICROBLAZE_64 5
-#define R_MICROBLAZE_32_LO 6
-#define R_MICROBLAZE_SRO32 7
-#define R_MICROBLAZE_SRW32 8
-#define R_MICROBLAZE_64_NONE 9
-#define R_MICROBLAZE_32_SYM_OP_SYM 10
-#define R_MICROBLAZE_GNU_VTINHERIT 11
-#define R_MICROBLAZE_GNU_VTENTRY 12
-#define R_MICROBLAZE_GOTPC_64 13
-#define R_MICROBLAZE_GOT_64 14
-#define R_MICROBLAZE_PLT_64 15
-#define R_MICROBLAZE_REL 16
-#define R_MICROBLAZE_JUMP_SLOT 17
-#define R_MICROBLAZE_GLOB_DAT 18
-#define R_MICROBLAZE_GOTOFF_64 19
-#define R_MICROBLAZE_GOTOFF_32 20
-#define R_MICROBLAZE_COPY 21
-#define R_MICROBLAZE_TLS 22
-#define R_MICROBLAZE_TLSGD 23
-#define R_MICROBLAZE_TLSLD 24
-#define R_MICROBLAZE_TLSDTPMOD32 25
-#define R_MICROBLAZE_TLSDTPREL32 26
-#define R_MICROBLAZE_TLSDTPREL64 27
-#define R_MICROBLAZE_TLSGOTTPREL32 28
-#define R_MICROBLAZE_TLSTPREL32 29
-
-#define R_OR1K_NONE 0
-#define R_OR1K_32 1
-#define R_OR1K_16 2
-#define R_OR1K_8 3
-#define R_OR1K_LO_16_IN_INSN 4
-#define R_OR1K_HI_16_IN_INSN 5
-#define R_OR1K_INSN_REL_26 6
-#define R_OR1K_GNU_VTENTRY 7
-#define R_OR1K_GNU_VTINHERIT 8
-#define R_OR1K_32_PCREL 9
-#define R_OR1K_16_PCREL 10
-#define R_OR1K_8_PCREL 11
-#define R_OR1K_GOTPC_HI16 12
-#define R_OR1K_GOTPC_LO16 13
-#define R_OR1K_GOT16 14
-#define R_OR1K_PLT26 15
-#define R_OR1K_GOTOFF_HI16 16
-#define R_OR1K_GOTOFF_LO16 17
-#define R_OR1K_COPY 18
-#define R_OR1K_GLOB_DAT 19
-#define R_OR1K_JMP_SLOT 20
-#define R_OR1K_RELATIVE 21
-#define R_OR1K_TLS_GD_HI16 22
-#define R_OR1K_TLS_GD_LO16 23
-#define R_OR1K_TLS_LDM_HI16 24
-#define R_OR1K_TLS_LDM_LO16 25
-#define R_OR1K_TLS_LDO_HI16 26
-#define R_OR1K_TLS_LDO_LO16 27
-#define R_OR1K_TLS_IE_HI16 28
-#define R_OR1K_TLS_IE_LO16 29
-#define R_OR1K_TLS_LE_HI16 30
-#define R_OR1K_TLS_LE_LO16 31
-#define R_OR1K_TLS_TPOFF 32
-#define R_OR1K_TLS_DTPOFF 33
-#define R_OR1K_TLS_DTPMOD 34
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/core2md/core2md.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/core2md/core2md.cc
deleted file mode 100644
index a0e8f8ba2f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/core2md/core2md.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2012, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// core2md.cc: A utility to convert an ELF core file to a minidump file.
-
-#include <stdio.h>
-
-#include "client/linux/minidump_writer/minidump_writer.h"
-#include "client/linux/minidump_writer/linux_core_dumper.h"
-
-using google_breakpad::AppMemoryList;
-using google_breakpad::MappingList;
-using google_breakpad::LinuxCoreDumper;
-
-static int ShowUsage(const char* argv0) {
- fprintf(stderr, "Usage: %s <core file> <procfs dir> <output>\n", argv0);
- return 1;
-}
-
-bool WriteMinidumpFromCore(const char* filename,
- const char* core_path,
- const char* procfs_override) {
- MappingList mappings;
- AppMemoryList memory_list;
- LinuxCoreDumper dumper(0, core_path, procfs_override);
- return google_breakpad::WriteMinidump(filename, mappings, memory_list,
- &dumper);
-}
-
-int main(int argc, char *argv[]) {
- if (argc != 4) {
- return ShowUsage(argv[0]);
- }
-
- const char* core_file = argv[1];
- const char* procfs_dir = argv[2];
- const char* minidump_file = argv[3];
- if (!WriteMinidumpFromCore(minidump_file,
- core_file,
- procfs_dir)) {
- fprintf(stderr, "Unable to generate minidump.\n");
- return 1;
- }
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc
deleted file mode 100644
index 84953172ea..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/dump_syms.cc
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <paths.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include <cstring>
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include "common/linux/dump_symbols.h"
-
-using google_breakpad::WriteSymbolFile;
-using google_breakpad::WriteSymbolFileHeader;
-
-int usage(const char* self) {
- fprintf(stderr, "Usage: %s [OPTION] <binary-with-debugging-info> "
- "[directories-for-debug-file]\n\n", self);
- fprintf(stderr, "Options:\n");
- fprintf(stderr, " -i: Output module header information only.\n");
- fprintf(stderr, " -c Do not generate CFI section\n");
- fprintf(stderr, " -r Do not handle inter-compilation unit references\n");
- fprintf(stderr, " -v Print all warnings to stderr\n");
- return 1;
-}
-
-int main(int argc, char **argv) {
- if (argc < 2)
- return usage(argv[0]);
- bool header_only = false;
- bool cfi = true;
- bool handle_inter_cu_refs = true;
- bool log_to_stderr = false;
- int arg_index = 1;
- while (arg_index < argc && strlen(argv[arg_index]) > 0 &&
- argv[arg_index][0] == '-') {
- if (strcmp("-i", argv[arg_index]) == 0) {
- header_only = true;
- } else if (strcmp("-c", argv[arg_index]) == 0) {
- cfi = false;
- } else if (strcmp("-r", argv[arg_index]) == 0) {
- handle_inter_cu_refs = false;
- } else if (strcmp("-v", argv[arg_index]) == 0) {
- log_to_stderr = true;
- } else {
- printf("2.4 %s\n", argv[arg_index]);
- return usage(argv[0]);
- }
- ++arg_index;
- }
- if (arg_index == argc)
- return usage(argv[0]);
- // Save stderr so it can be used below.
- FILE* saved_stderr = fdopen(dup(fileno(stderr)), "w");
- if (!log_to_stderr) {
- if (freopen(_PATH_DEVNULL, "w", stderr)) {
- // If it fails, not a lot we can (or should) do.
- // Add this brace section to silence gcc warnings.
- }
- }
- const char* binary;
- std::vector<string> debug_dirs;
- binary = argv[arg_index];
- for (int debug_dir_index = arg_index + 1;
- debug_dir_index < argc;
- ++debug_dir_index) {
- debug_dirs.push_back(argv[debug_dir_index]);
- }
-
- if (header_only) {
- if (!WriteSymbolFileHeader(binary, std::cout)) {
- fprintf(saved_stderr, "Failed to process file.\n");
- return 1;
- }
- } else {
- SymbolData symbol_data = cfi ? ALL_SYMBOL_DATA : NO_CFI;
- google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs);
- if (!WriteSymbolFile(binary, debug_dirs, options, std::cout)) {
- fprintf(saved_stderr, "Failed to write symbol file.\n");
- return 1;
- }
- }
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build
deleted file mode 100644
index 643020e840..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HOST_SOURCES += [
- 'dump_syms.cc',
-]
-
-HOST_CXXFLAGS += [
- '-O2',
- '-g',
-]
-
-# host_breakpad_linux_common_s needs to come first
-HOST_USE_LIBS += [
- 'host_breakpad_linux_common_s',
-]
-HOST_USE_LIBS += [
- 'host_breakpad_common_s',
- 'host_breakpad_dwarf_s',
-]
-
-# The HostProgram template may append 'host_stdc++compat' to
-# HOST_USE_LIBS, which needs to appear after the entries above.
-HostProgram('dump_syms')
-
-LOCAL_INCLUDES += [
- '../../../common/linux',
-]
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc
deleted file mode 100644
index 6f637845ee..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump-2-core.cc
+++ /dev/null
@@ -1,1276 +0,0 @@
-// Copyright (c) 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Converts a minidump file to a core file which gdb can read.
-// Large parts lifted from the userspace core dumper:
-// http://code.google.com/p/google-coredumper/
-//
-// Usage: minidump-2-core [-v] 1234.dmp > core
-
-#include <elf.h>
-#include <errno.h>
-#include <link.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/user.h>
-#include <unistd.h>
-
-#include <map>
-#include <string>
-#include <vector>
-
-#include "common/linux/memory_mapped_file.h"
-#include "common/minidump_type_helper.h"
-#include "common/scoped_ptr.h"
-#include "common/using_std_string.h"
-#include "google_breakpad/common/breakpad_types.h"
-#include "google_breakpad/common/minidump_format.h"
-#include "third_party/lss/linux_syscall_support.h"
-#include "tools/linux/md2core/minidump_memory_range.h"
-
-#if __WORDSIZE == 64
- #define ELF_CLASS ELFCLASS64
-#else
- #define ELF_CLASS ELFCLASS32
-#endif
-#define Ehdr ElfW(Ehdr)
-#define Phdr ElfW(Phdr)
-#define Shdr ElfW(Shdr)
-#define Nhdr ElfW(Nhdr)
-#define auxv_t ElfW(auxv_t)
-
-
-#if defined(__x86_64__)
- #define ELF_ARCH EM_X86_64
-#elif defined(__i386__)
- #define ELF_ARCH EM_386
-#elif defined(__arm__)
- #define ELF_ARCH EM_ARM
-#elif defined(__mips__)
- #define ELF_ARCH EM_MIPS
-#elif defined(__aarch64__)
- #define ELF_ARCH EM_AARCH64
-#endif
-
-#if defined(__arm__)
-// GLibc/ARM and Android/ARM both use 'user_regs' for the structure type
-// containing core registers, while they use 'user_regs_struct' on other
-// architectures. This file-local typedef simplifies the source code.
-typedef user_regs user_regs_struct;
-#elif defined (__mips__)
-// This file-local typedef simplifies the source code.
-typedef gregset_t user_regs_struct;
-#endif
-
-using google_breakpad::MDTypeHelper;
-using google_breakpad::MemoryMappedFile;
-using google_breakpad::MinidumpMemoryRange;
-
-typedef MDTypeHelper<sizeof(ElfW(Addr))>::MDRawDebug MDRawDebug;
-typedef MDTypeHelper<sizeof(ElfW(Addr))>::MDRawLinkMap MDRawLinkMap;
-
-static const MDRVA kInvalidMDRVA = static_cast<MDRVA>(-1);
-static bool verbose;
-static string g_custom_so_basedir;
-
-static int usage(const char* argv0) {
- fprintf(stderr, "Usage: %s [-v] <minidump file>\n", argv0);
- return 1;
-}
-
-// Write all of the given buffer, handling short writes and EINTR. Return true
-// iff successful.
-static bool
-writea(int fd, const void* idata, size_t length) {
- const uint8_t* data = (const uint8_t*) idata;
-
- size_t done = 0;
- while (done < length) {
- ssize_t r;
- do {
- r = write(fd, data + done, length - done);
- } while (r == -1 && errno == EINTR);
-
- if (r < 1)
- return false;
- done += r;
- }
-
- return true;
-}
-
-/* Dynamically determines the byte sex of the system. Returns non-zero
- * for big-endian machines.
- */
-static inline int sex() {
- int probe = 1;
- return !*(char *)&probe;
-}
-
-typedef struct elf_timeval { /* Time value with microsecond resolution */
- long tv_sec; /* Seconds */
- long tv_usec; /* Microseconds */
-} elf_timeval;
-
-typedef struct _elf_siginfo { /* Information about signal (unused) */
- int32_t si_signo; /* Signal number */
- int32_t si_code; /* Extra code */
- int32_t si_errno; /* Errno */
-} _elf_siginfo;
-
-typedef struct prstatus { /* Information about thread; includes CPU reg*/
- _elf_siginfo pr_info; /* Info associated with signal */
- uint16_t pr_cursig; /* Current signal */
- unsigned long pr_sigpend; /* Set of pending signals */
- unsigned long pr_sighold; /* Set of held signals */
- pid_t pr_pid; /* Process ID */
- pid_t pr_ppid; /* Parent's process ID */
- pid_t pr_pgrp; /* Group ID */
- pid_t pr_sid; /* Session ID */
- elf_timeval pr_utime; /* User time */
- elf_timeval pr_stime; /* System time */
- elf_timeval pr_cutime; /* Cumulative user time */
- elf_timeval pr_cstime; /* Cumulative system time */
- user_regs_struct pr_reg; /* CPU registers */
- uint32_t pr_fpvalid; /* True if math co-processor being used */
-} prstatus;
-
-typedef struct prpsinfo { /* Information about process */
- unsigned char pr_state; /* Numeric process state */
- char pr_sname; /* Char for pr_state */
- unsigned char pr_zomb; /* Zombie */
- signed char pr_nice; /* Nice val */
- unsigned long pr_flag; /* Flags */
-#if defined(__x86_64__) || defined(__mips__)
- uint32_t pr_uid; /* User ID */
- uint32_t pr_gid; /* Group ID */
-#else
- uint16_t pr_uid; /* User ID */
- uint16_t pr_gid; /* Group ID */
-#endif
- pid_t pr_pid; /* Process ID */
- pid_t pr_ppid; /* Parent's process ID */
- pid_t pr_pgrp; /* Group ID */
- pid_t pr_sid; /* Session ID */
- char pr_fname[16]; /* Filename of executable */
- char pr_psargs[80]; /* Initial part of arg list */
-} prpsinfo;
-
-// We parse the minidump file and keep the parsed information in this structure
-struct CrashedProcess {
- CrashedProcess()
- : crashing_tid(-1),
- auxv(NULL),
- auxv_length(0) {
- memset(&prps, 0, sizeof(prps));
- prps.pr_sname = 'R';
- memset(&debug, 0, sizeof(debug));
- }
-
- struct Mapping {
- Mapping()
- : permissions(0xFFFFFFFF),
- start_address(0),
- end_address(0),
- offset(0) {
- }
-
- uint32_t permissions;
- uint64_t start_address, end_address, offset;
- string filename;
- string data;
- };
- std::map<uint64_t, Mapping> mappings;
-
- pid_t crashing_tid;
- int fatal_signal;
-
- struct Thread {
- pid_t tid;
-#if defined(__mips__)
- mcontext_t mcontext;
-#else
- user_regs_struct regs;
-#endif
-#if defined(__i386__) || defined(__x86_64__)
- user_fpregs_struct fpregs;
-#endif
-#if defined(__i386__)
- user_fpxregs_struct fpxregs;
-#endif
-#if defined(__aarch64__)
- user_fpsimd_struct fpregs;
-#endif
- uintptr_t stack_addr;
- const uint8_t* stack;
- size_t stack_length;
- };
- std::vector<Thread> threads;
-
- const uint8_t* auxv;
- size_t auxv_length;
-
- prpsinfo prps;
-
- std::map<uintptr_t, string> signatures;
-
- string dynamic_data;
- MDRawDebug debug;
- std::vector<MDRawLinkMap> link_map;
-};
-
-#if defined(__i386__)
-static uint32_t
-U32(const uint8_t* data) {
- uint32_t v;
- memcpy(&v, data, sizeof(v));
- return v;
-}
-
-static uint16_t
-U16(const uint8_t* data) {
- uint16_t v;
- memcpy(&v, data, sizeof(v));
- return v;
-}
-
-static void
-ParseThreadRegisters(CrashedProcess::Thread* thread,
- const MinidumpMemoryRange& range) {
- const MDRawContextX86* rawregs = range.GetData<MDRawContextX86>(0);
-
- thread->regs.ebx = rawregs->ebx;
- thread->regs.ecx = rawregs->ecx;
- thread->regs.edx = rawregs->edx;
- thread->regs.esi = rawregs->esi;
- thread->regs.edi = rawregs->edi;
- thread->regs.ebp = rawregs->ebp;
- thread->regs.eax = rawregs->eax;
- thread->regs.xds = rawregs->ds;
- thread->regs.xes = rawregs->es;
- thread->regs.xfs = rawregs->fs;
- thread->regs.xgs = rawregs->gs;
- thread->regs.orig_eax = rawregs->eax;
- thread->regs.eip = rawregs->eip;
- thread->regs.xcs = rawregs->cs;
- thread->regs.eflags = rawregs->eflags;
- thread->regs.esp = rawregs->esp;
- thread->regs.xss = rawregs->ss;
-
- thread->fpregs.cwd = rawregs->float_save.control_word;
- thread->fpregs.swd = rawregs->float_save.status_word;
- thread->fpregs.twd = rawregs->float_save.tag_word;
- thread->fpregs.fip = rawregs->float_save.error_offset;
- thread->fpregs.fcs = rawregs->float_save.error_selector;
- thread->fpregs.foo = rawregs->float_save.data_offset;
- thread->fpregs.fos = rawregs->float_save.data_selector;
- memcpy(thread->fpregs.st_space, rawregs->float_save.register_area,
- 10 * 8);
-
- thread->fpxregs.cwd = rawregs->float_save.control_word;
- thread->fpxregs.swd = rawregs->float_save.status_word;
- thread->fpxregs.twd = rawregs->float_save.tag_word;
- thread->fpxregs.fop = U16(rawregs->extended_registers + 6);
- thread->fpxregs.fip = U16(rawregs->extended_registers + 8);
- thread->fpxregs.fcs = U16(rawregs->extended_registers + 12);
- thread->fpxregs.foo = U16(rawregs->extended_registers + 16);
- thread->fpxregs.fos = U16(rawregs->extended_registers + 20);
- thread->fpxregs.mxcsr = U32(rawregs->extended_registers + 24);
- memcpy(thread->fpxregs.st_space, rawregs->extended_registers + 32, 128);
- memcpy(thread->fpxregs.xmm_space, rawregs->extended_registers + 160, 128);
-}
-#elif defined(__x86_64__)
-static void
-ParseThreadRegisters(CrashedProcess::Thread* thread,
- const MinidumpMemoryRange& range) {
- const MDRawContextAMD64* rawregs = range.GetData<MDRawContextAMD64>(0);
-
- thread->regs.r15 = rawregs->r15;
- thread->regs.r14 = rawregs->r14;
- thread->regs.r13 = rawregs->r13;
- thread->regs.r12 = rawregs->r12;
- thread->regs.rbp = rawregs->rbp;
- thread->regs.rbx = rawregs->rbx;
- thread->regs.r11 = rawregs->r11;
- thread->regs.r10 = rawregs->r10;
- thread->regs.r9 = rawregs->r9;
- thread->regs.r8 = rawregs->r8;
- thread->regs.rax = rawregs->rax;
- thread->regs.rcx = rawregs->rcx;
- thread->regs.rdx = rawregs->rdx;
- thread->regs.rsi = rawregs->rsi;
- thread->regs.rdi = rawregs->rdi;
- thread->regs.orig_rax = rawregs->rax;
- thread->regs.rip = rawregs->rip;
- thread->regs.cs = rawregs->cs;
- thread->regs.eflags = rawregs->eflags;
- thread->regs.rsp = rawregs->rsp;
- thread->regs.ss = rawregs->ss;
- thread->regs.fs_base = 0;
- thread->regs.gs_base = 0;
- thread->regs.ds = rawregs->ds;
- thread->regs.es = rawregs->es;
- thread->regs.fs = rawregs->fs;
- thread->regs.gs = rawregs->gs;
-
- thread->fpregs.cwd = rawregs->flt_save.control_word;
- thread->fpregs.swd = rawregs->flt_save.status_word;
- thread->fpregs.ftw = rawregs->flt_save.tag_word;
- thread->fpregs.fop = rawregs->flt_save.error_opcode;
- thread->fpregs.rip = rawregs->flt_save.error_offset;
- thread->fpregs.rdp = rawregs->flt_save.data_offset;
- thread->fpregs.mxcsr = rawregs->flt_save.mx_csr;
- thread->fpregs.mxcr_mask = rawregs->flt_save.mx_csr_mask;
- memcpy(thread->fpregs.st_space, rawregs->flt_save.float_registers, 8 * 16);
- memcpy(thread->fpregs.xmm_space, rawregs->flt_save.xmm_registers, 16 * 16);
-}
-#elif defined(__arm__)
-static void
-ParseThreadRegisters(CrashedProcess::Thread* thread,
- const MinidumpMemoryRange& range) {
- const MDRawContextARM* rawregs = range.GetData<MDRawContextARM>(0);
-
- thread->regs.uregs[0] = rawregs->iregs[0];
- thread->regs.uregs[1] = rawregs->iregs[1];
- thread->regs.uregs[2] = rawregs->iregs[2];
- thread->regs.uregs[3] = rawregs->iregs[3];
- thread->regs.uregs[4] = rawregs->iregs[4];
- thread->regs.uregs[5] = rawregs->iregs[5];
- thread->regs.uregs[6] = rawregs->iregs[6];
- thread->regs.uregs[7] = rawregs->iregs[7];
- thread->regs.uregs[8] = rawregs->iregs[8];
- thread->regs.uregs[9] = rawregs->iregs[9];
- thread->regs.uregs[10] = rawregs->iregs[10];
- thread->regs.uregs[11] = rawregs->iregs[11];
- thread->regs.uregs[12] = rawregs->iregs[12];
- thread->regs.uregs[13] = rawregs->iregs[13];
- thread->regs.uregs[14] = rawregs->iregs[14];
- thread->regs.uregs[15] = rawregs->iregs[15];
-
- thread->regs.uregs[16] = rawregs->cpsr;
- thread->regs.uregs[17] = 0; // what is ORIG_r0 exactly?
-}
-#elif defined(__aarch64__)
-static void
-ParseThreadRegisters(CrashedProcess::Thread* thread,
- const MinidumpMemoryRange& range) {
- const MDRawContextARM64* rawregs = range.GetData<MDRawContextARM64>(0);
-
- for (int i = 0; i < 31; ++i)
- thread->regs.regs[i] = rawregs->iregs[i];
- thread->regs.sp = rawregs->iregs[MD_CONTEXT_ARM64_REG_SP];
- thread->regs.pc = rawregs->iregs[MD_CONTEXT_ARM64_REG_PC];
- thread->regs.pstate = rawregs->cpsr;
-
- memcpy(thread->fpregs.vregs, rawregs->float_save.regs, 8 * 32);
- thread->fpregs.fpsr = rawregs->float_save.fpsr;
- thread->fpregs.fpcr = rawregs->float_save.fpcr;
-}
-#elif defined(__mips__)
-static void
-ParseThreadRegisters(CrashedProcess::Thread* thread,
- const MinidumpMemoryRange& range) {
- const MDRawContextMIPS* rawregs = range.GetData<MDRawContextMIPS>(0);
-
- for (int i = 0; i < MD_CONTEXT_MIPS_GPR_COUNT; ++i)
- thread->mcontext.gregs[i] = rawregs->iregs[i];
-
- thread->mcontext.pc = rawregs->epc;
-
- thread->mcontext.mdlo = rawregs->mdlo;
- thread->mcontext.mdhi = rawregs->mdhi;
-
- thread->mcontext.hi1 = rawregs->hi[0];
- thread->mcontext.lo1 = rawregs->lo[0];
- thread->mcontext.hi2 = rawregs->hi[1];
- thread->mcontext.lo2 = rawregs->lo[1];
- thread->mcontext.hi3 = rawregs->hi[2];
- thread->mcontext.lo3 = rawregs->lo[2];
-
- for (int i = 0; i < MD_FLOATINGSAVEAREA_MIPS_FPR_COUNT; ++i) {
- thread->mcontext.fpregs.fp_r.fp_fregs[i]._fp_fregs =
- rawregs->float_save.regs[i];
- }
-
- thread->mcontext.fpc_csr = rawregs->float_save.fpcsr;
-#if _MIPS_SIM == _ABIO32
- thread->mcontext.fpc_eir = rawregs->float_save.fir;
-#endif
-}
-#else
-#error "This code has not been ported to your platform yet"
-#endif
-
-static void
-ParseThreadList(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
- const MinidumpMemoryRange& full_file) {
- const uint32_t num_threads = *range.GetData<uint32_t>(0);
- if (verbose) {
- fprintf(stderr,
- "MD_THREAD_LIST_STREAM:\n"
- "Found %d threads\n"
- "\n\n",
- num_threads);
- }
- for (unsigned i = 0; i < num_threads; ++i) {
- CrashedProcess::Thread thread;
- memset(&thread, 0, sizeof(thread));
- const MDRawThread* rawthread =
- range.GetArrayElement<MDRawThread>(sizeof(uint32_t), i);
- thread.tid = rawthread->thread_id;
- thread.stack_addr = rawthread->stack.start_of_memory_range;
- MinidumpMemoryRange stack_range =
- full_file.Subrange(rawthread->stack.memory);
- thread.stack = stack_range.data();
- thread.stack_length = rawthread->stack.memory.data_size;
-
- ParseThreadRegisters(&thread,
- full_file.Subrange(rawthread->thread_context));
-
- crashinfo->threads.push_back(thread);
- }
-}
-
-static void
-ParseSystemInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
- const MinidumpMemoryRange& full_file) {
- const MDRawSystemInfo* sysinfo = range.GetData<MDRawSystemInfo>(0);
- if (!sysinfo) {
- fprintf(stderr, "Failed to access MD_SYSTEM_INFO_STREAM\n");
- _exit(1);
- }
-#if defined(__i386__)
- if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_X86) {
- fprintf(stderr,
- "This version of minidump-2-core only supports x86 (32bit)%s.\n",
- sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64 ?
- ",\nbut the minidump file is from a 64bit machine" : "");
- _exit(1);
- }
-#elif defined(__x86_64__)
- if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_AMD64) {
- fprintf(stderr,
- "This version of minidump-2-core only supports x86 (64bit)%s.\n",
- sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86 ?
- ",\nbut the minidump file is from a 32bit machine" : "");
- _exit(1);
- }
-#elif defined(__arm__)
- if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM) {
- fprintf(stderr,
- "This version of minidump-2-core only supports ARM (32bit).\n");
- _exit(1);
- }
-#elif defined(__aarch64__)
- if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_ARM64) {
- fprintf(stderr,
- "This version of minidump-2-core only supports ARM (64bit).\n");
- _exit(1);
- }
-#elif defined(__mips__)
-# if _MIPS_SIM == _ABIO32
- if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_MIPS) {
- fprintf(stderr,
- "This version of minidump-2-core only supports mips o32 (32bit).\n");
- _exit(1);
- }
-# elif _MIPS_SIM == _ABI64
- if (sysinfo->processor_architecture != MD_CPU_ARCHITECTURE_MIPS64) {
- fprintf(stderr,
- "This version of minidump-2-core only supports mips n64 (64bit).\n");
- _exit(1);
- }
-# else
-# error "This mips ABI is currently not supported (n32)"
-# endif
-#else
-#error "This code has not been ported to your platform yet"
-#endif
- if (!strstr(full_file.GetAsciiMDString(sysinfo->csd_version_rva).c_str(),
- "Linux") &&
- sysinfo->platform_id != MD_OS_NACL) {
- fprintf(stderr, "This minidump was not generated by Linux or NaCl.\n");
- _exit(1);
- }
-
- if (verbose) {
- fprintf(stderr,
- "MD_SYSTEM_INFO_STREAM:\n"
- "Architecture: %s\n"
- "Number of processors: %d\n"
- "Processor level: %d\n"
- "Processor model: %d\n"
- "Processor stepping: %d\n",
- sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86
- ? "i386"
- : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64
- ? "x86-64"
- : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_ARM
- ? "ARM"
- : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_MIPS
- ? "MIPS"
- : sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_MIPS64
- ? "MIPS64"
- : "???",
- sysinfo->number_of_processors,
- sysinfo->processor_level,
- sysinfo->processor_revision >> 8,
- sysinfo->processor_revision & 0xFF);
- if (sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_X86 ||
- sysinfo->processor_architecture == MD_CPU_ARCHITECTURE_AMD64) {
- fputs("Vendor id: ", stderr);
- const char *nul =
- (const char *)memchr(sysinfo->cpu.x86_cpu_info.vendor_id, 0,
- sizeof(sysinfo->cpu.x86_cpu_info.vendor_id));
- fwrite(sysinfo->cpu.x86_cpu_info.vendor_id,
- nul ? nul - (const char *)&sysinfo->cpu.x86_cpu_info.vendor_id[0]
- : sizeof(sysinfo->cpu.x86_cpu_info.vendor_id), 1, stderr);
- fputs("\n", stderr);
- }
- fprintf(stderr, "OS: %s\n",
- full_file.GetAsciiMDString(sysinfo->csd_version_rva).c_str());
- fputs("\n\n", stderr);
- }
-}
-
-static void
-ParseCPUInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
- fputs("MD_LINUX_CPU_INFO:\n", stderr);
- fwrite(range.data(), range.length(), 1, stderr);
- fputs("\n\n\n", stderr);
- }
-}
-
-static void
-ParseProcessStatus(CrashedProcess* crashinfo,
- const MinidumpMemoryRange& range) {
- if (verbose) {
- fputs("MD_LINUX_PROC_STATUS:\n", stderr);
- fwrite(range.data(), range.length(), 1, stderr);
- fputs("\n\n", stderr);
- }
-}
-
-static void
-ParseLSBRelease(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
- fputs("MD_LINUX_LSB_RELEASE:\n", stderr);
- fwrite(range.data(), range.length(), 1, stderr);
- fputs("\n\n", stderr);
- }
-}
-
-static void
-ParseMaps(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
- fputs("MD_LINUX_MAPS:\n", stderr);
- fwrite(range.data(), range.length(), 1, stderr);
- }
- for (const uint8_t* ptr = range.data();
- ptr < range.data() + range.length();) {
- const uint8_t* eol = (uint8_t*)memchr(ptr, '\n',
- range.data() + range.length() - ptr);
- string line((const char*)ptr,
- eol ? eol - ptr : range.data() + range.length() - ptr);
- ptr = eol ? eol + 1 : range.data() + range.length();
- unsigned long long start, stop, offset;
- char* permissions = NULL;
- char* filename = NULL;
- sscanf(line.c_str(), "%llx-%llx %m[-rwxp] %llx %*[:0-9a-f] %*d %ms",
- &start, &stop, &permissions, &offset, &filename);
- if (filename && *filename == '/') {
- CrashedProcess::Mapping mapping;
- mapping.permissions = 0;
- if (strchr(permissions, 'r')) {
- mapping.permissions |= PF_R;
- }
- if (strchr(permissions, 'w')) {
- mapping.permissions |= PF_W;
- }
- if (strchr(permissions, 'x')) {
- mapping.permissions |= PF_X;
- }
- mapping.start_address = start;
- mapping.end_address = stop;
- mapping.offset = offset;
- if (filename) {
- mapping.filename = filename;
- }
- crashinfo->mappings[mapping.start_address] = mapping;
- }
- free(permissions);
- free(filename);
- }
- if (verbose) {
- fputs("\n\n\n", stderr);
- }
-}
-
-static void
-ParseEnvironment(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- if (verbose) {
- fputs("MD_LINUX_ENVIRON:\n", stderr);
- char* env = new char[range.length()];
- memcpy(env, range.data(), range.length());
- int nul_count = 0;
- for (char *ptr = env;;) {
- ptr = (char *)memchr(ptr, '\000', range.length() - (ptr - env));
- if (!ptr) {
- break;
- }
- if (ptr > env && ptr[-1] == '\n') {
- if (++nul_count > 5) {
- // Some versions of Chrome try to rewrite the process' command line
- // in a way that causes the environment to be corrupted. Afterwards,
- // part of the environment will contain the trailing bit of the
- // command line. The rest of the environment will be filled with
- // NUL bytes.
- // We detect this corruption by counting the number of consecutive
- // NUL bytes. Normally, we would not expect any consecutive NUL
- // bytes. But we are conservative and only suppress printing of
- // the environment if we see at least five consecutive NULs.
- fputs("Environment has been corrupted; no data available", stderr);
- goto env_corrupted;
- }
- } else {
- nul_count = 0;
- }
- *ptr = '\n';
- }
- fwrite(env, range.length(), 1, stderr);
- env_corrupted:
- delete[] env;
- fputs("\n\n\n", stderr);
- }
-}
-
-static void
-ParseAuxVector(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- // Some versions of Chrome erroneously used the MD_LINUX_AUXV stream value
- // when dumping /proc/$x/maps
- if (range.length() > 17) {
- // The AUXV vector contains binary data, whereas the maps always begin
- // with an 8+ digit hex address followed by a hyphen and another 8+ digit
- // address.
- char addresses[18];
- memcpy(addresses, range.data(), 17);
- addresses[17] = '\000';
- if (strspn(addresses, "0123456789abcdef-") == 17) {
- ParseMaps(crashinfo, range);
- return;
- }
- }
-
- crashinfo->auxv = range.data();
- crashinfo->auxv_length = range.length();
-}
-
-static void
-ParseCmdLine(CrashedProcess* crashinfo, const MinidumpMemoryRange& range) {
- // The command line is supposed to use NUL bytes to separate arguments.
- // As Chrome rewrites its own command line and (incorrectly) substitutes
- // spaces, this is often not the case in our minidump files.
- const char* cmdline = (const char*) range.data();
- if (verbose) {
- fputs("MD_LINUX_CMD_LINE:\n", stderr);
- unsigned i = 0;
- for (; i < range.length() && cmdline[i] && cmdline[i] != ' '; ++i) { }
- fputs("argv[0] = \"", stderr);
- fwrite(cmdline, i, 1, stderr);
- fputs("\"\n", stderr);
- for (unsigned j = ++i, argc = 1; j < range.length(); ++j) {
- if (!cmdline[j] || cmdline[j] == ' ') {
- fprintf(stderr, "argv[%d] = \"", argc++);
- fwrite(cmdline + i, j - i, 1, stderr);
- fputs("\"\n", stderr);
- i = j + 1;
- }
- }
- fputs("\n\n", stderr);
- }
-
- const char *binary_name = cmdline;
- for (size_t i = 0; i < range.length(); ++i) {
- if (cmdline[i] == '/') {
- binary_name = cmdline + i + 1;
- } else if (cmdline[i] == 0 || cmdline[i] == ' ') {
- static const size_t fname_len = sizeof(crashinfo->prps.pr_fname) - 1;
- static const size_t args_len = sizeof(crashinfo->prps.pr_psargs) - 1;
- memset(crashinfo->prps.pr_fname, 0, fname_len + 1);
- memset(crashinfo->prps.pr_psargs, 0, args_len + 1);
- unsigned len = cmdline + i - binary_name;
- memcpy(crashinfo->prps.pr_fname, binary_name,
- len > fname_len ? fname_len : len);
-
- len = range.length() > args_len ? args_len : range.length();
- memcpy(crashinfo->prps.pr_psargs, cmdline, len);
- for (unsigned j = 0; j < len; ++j) {
- if (crashinfo->prps.pr_psargs[j] == 0)
- crashinfo->prps.pr_psargs[j] = ' ';
- }
- break;
- }
- }
-}
-
-static void
-ParseDSODebugInfo(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
- const MinidumpMemoryRange& full_file) {
- const MDRawDebug* debug = range.GetData<MDRawDebug>(0);
- if (!debug) {
- return;
- }
- if (verbose) {
- fprintf(stderr,
- "MD_LINUX_DSO_DEBUG:\n"
- "Version: %d\n"
- "Number of DSOs: %d\n"
- "Brk handler: 0x%" PRIx64 "\n"
- "Dynamic loader at: 0x%" PRIx64 "\n"
- "_DYNAMIC: 0x%" PRIx64 "\n",
- debug->version,
- debug->dso_count,
- static_cast<uint64_t>(debug->brk),
- static_cast<uint64_t>(debug->ldbase),
- static_cast<uint64_t>(debug->dynamic));
- }
- crashinfo->debug = *debug;
- if (range.length() > sizeof(MDRawDebug)) {
- char* dynamic_data = (char*)range.data() + sizeof(MDRawDebug);
- crashinfo->dynamic_data.assign(dynamic_data,
- range.length() - sizeof(MDRawDebug));
- }
- if (debug->map != kInvalidMDRVA) {
- for (unsigned int i = 0; i < debug->dso_count; ++i) {
- const MDRawLinkMap* link_map =
- full_file.GetArrayElement<MDRawLinkMap>(debug->map, i);
- if (link_map) {
- if (verbose) {
- fprintf(stderr,
- "#%03d: %" PRIx64 ", %" PRIx64 ", \"%s\"\n",
- i, static_cast<uint64_t>(link_map->addr),
- static_cast<uint64_t>(link_map->ld),
- full_file.GetAsciiMDString(link_map->name).c_str());
- }
- crashinfo->link_map.push_back(*link_map);
- }
- }
- }
- if (verbose) {
- fputs("\n\n", stderr);
- }
-}
-
-static void
-ParseExceptionStream(CrashedProcess* crashinfo,
- const MinidumpMemoryRange& range) {
- const MDRawExceptionStream* exp = range.GetData<MDRawExceptionStream>(0);
- crashinfo->crashing_tid = exp->thread_id;
- crashinfo->fatal_signal = (int) exp->exception_record.exception_code;
-}
-
-static bool
-WriteThread(const CrashedProcess::Thread& thread, int fatal_signal) {
- struct prstatus pr;
- memset(&pr, 0, sizeof(pr));
-
- pr.pr_info.si_signo = fatal_signal;
- pr.pr_cursig = fatal_signal;
- pr.pr_pid = thread.tid;
-#if defined(__mips__)
- memcpy(&pr.pr_reg, &thread.mcontext.gregs, sizeof(user_regs_struct));
-#else
- memcpy(&pr.pr_reg, &thread.regs, sizeof(user_regs_struct));
-#endif
-
- Nhdr nhdr;
- memset(&nhdr, 0, sizeof(nhdr));
- nhdr.n_namesz = 5;
- nhdr.n_descsz = sizeof(struct prstatus);
- nhdr.n_type = NT_PRSTATUS;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, &pr, sizeof(struct prstatus))) {
- return false;
- }
-
-#if defined(__i386__) || defined(__x86_64__)
- nhdr.n_descsz = sizeof(user_fpregs_struct);
- nhdr.n_type = NT_FPREGSET;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, &thread.fpregs, sizeof(user_fpregs_struct))) {
- return false;
- }
-#endif
-
-#if defined(__i386__)
- nhdr.n_descsz = sizeof(user_fpxregs_struct);
- nhdr.n_type = NT_PRXFPREG;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "LINUX\0\0\0", 8) ||
- !writea(1, &thread.fpxregs, sizeof(user_fpxregs_struct))) {
- return false;
- }
-#endif
-
- return true;
-}
-
-static void
-ParseModuleStream(CrashedProcess* crashinfo, const MinidumpMemoryRange& range,
- const MinidumpMemoryRange& full_file) {
- if (verbose) {
- fputs("MD_MODULE_LIST_STREAM:\n", stderr);
- }
- const uint32_t num_mappings = *range.GetData<uint32_t>(0);
- for (unsigned i = 0; i < num_mappings; ++i) {
- CrashedProcess::Mapping mapping;
- const MDRawModule* rawmodule = reinterpret_cast<const MDRawModule*>(
- range.GetArrayElement(sizeof(uint32_t), MD_MODULE_SIZE, i));
- mapping.start_address = rawmodule->base_of_image;
- mapping.end_address = rawmodule->size_of_image + rawmodule->base_of_image;
-
- if (crashinfo->mappings.find(mapping.start_address) ==
- crashinfo->mappings.end()) {
- // We prefer data from MD_LINUX_MAPS over MD_MODULE_LIST_STREAM, as
- // the former is a strict superset of the latter.
- crashinfo->mappings[mapping.start_address] = mapping;
- }
-
- const MDCVInfoPDB70* record = reinterpret_cast<const MDCVInfoPDB70*>(
- full_file.GetData(rawmodule->cv_record.rva, MDCVInfoPDB70_minsize));
- char guid[40];
- sprintf(guid, "%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X",
- record->signature.data1, record->signature.data2,
- record->signature.data3,
- record->signature.data4[0], record->signature.data4[1],
- record->signature.data4[2], record->signature.data4[3],
- record->signature.data4[4], record->signature.data4[5],
- record->signature.data4[6], record->signature.data4[7]);
- string filename =
- full_file.GetAsciiMDString(rawmodule->module_name_rva);
- size_t slash = filename.find_last_of('/');
- string basename = slash == string::npos ?
- filename : filename.substr(slash + 1);
- if (strcmp(guid, "00000000-0000-0000-0000-000000000000")) {
- string prefix;
- if (!g_custom_so_basedir.empty())
- prefix = g_custom_so_basedir;
- else
- prefix = string("/var/lib/breakpad/") + guid + "-" + basename;
-
- crashinfo->signatures[rawmodule->base_of_image] = prefix + basename;
- }
-
- if (verbose) {
- fprintf(stderr, "0x%08llX-0x%08llX, ChkSum: 0x%08X, GUID: %s, \"%s\"\n",
- (unsigned long long)rawmodule->base_of_image,
- (unsigned long long)rawmodule->base_of_image +
- rawmodule->size_of_image,
- rawmodule->checksum, guid, filename.c_str());
- }
- }
- if (verbose) {
- fputs("\n\n", stderr);
- }
-}
-
-static void
-AddDataToMapping(CrashedProcess* crashinfo, const string& data,
- uintptr_t addr) {
- for (std::map<uint64_t, CrashedProcess::Mapping>::iterator
- iter = crashinfo->mappings.begin();
- iter != crashinfo->mappings.end();
- ++iter) {
- if (addr >= iter->second.start_address &&
- addr < iter->second.end_address) {
- CrashedProcess::Mapping mapping = iter->second;
- if ((addr & ~4095) != iter->second.start_address) {
- // If there are memory pages in the mapping prior to where the
- // data starts, truncate the existing mapping so that it ends with
- // the page immediately preceding the data region.
- iter->second.end_address = addr & ~4095;
- if (!mapping.filename.empty()) {
- // "mapping" is a copy of "iter->second". We are splitting the
- // existing mapping into two separate ones when we write the data
- // to the core file. The first one does not have any associated
- // data in the core file, the second one is backed by data that is
- // included with the core file.
- // If this mapping wasn't supposed to be anonymous, then we also
- // have to update the file offset upon splitting the mapping.
- mapping.offset += iter->second.end_address -
- iter->second.start_address;
- }
- }
- // Create a new mapping that contains the data contents. We often
- // limit the amount of data that is actually written to the core
- // file. But it is OK if the mapping itself extends past the end of
- // the data.
- mapping.start_address = addr & ~4095;
- mapping.data.assign(addr & 4095, 0).append(data);
- mapping.data.append(-mapping.data.size() & 4095, 0);
- crashinfo->mappings[mapping.start_address] = mapping;
- return;
- }
- }
- // Didn't find a suitable existing mapping for the data. Create a new one.
- CrashedProcess::Mapping mapping;
- mapping.permissions = PF_R | PF_W;
- mapping.start_address = addr & ~4095;
- mapping.end_address =
- (addr + data.size() + 4095) & ~4095;
- mapping.data.assign(addr & 4095, 0).append(data);
- mapping.data.append(-mapping.data.size() & 4095, 0);
- crashinfo->mappings[mapping.start_address] = mapping;
-}
-
-static void
-AugmentMappings(CrashedProcess* crashinfo,
- const MinidumpMemoryRange& full_file) {
- // For each thread, find the memory mapping that matches the thread's stack.
- // Then adjust the mapping to include the stack dump.
- for (unsigned i = 0; i < crashinfo->threads.size(); ++i) {
- const CrashedProcess::Thread& thread = crashinfo->threads[i];
- AddDataToMapping(crashinfo,
- string((char *)thread.stack, thread.stack_length),
- thread.stack_addr);
- }
-
- // Create a new link map with information about DSOs. We move this map to
- // the beginning of the address space, as this area should always be
- // available.
- static const uintptr_t start_addr = 4096;
- string data;
- struct r_debug debug = { 0 };
- debug.r_version = crashinfo->debug.version;
- debug.r_brk = (ElfW(Addr))crashinfo->debug.brk;
- debug.r_state = r_debug::RT_CONSISTENT;
- debug.r_ldbase = (ElfW(Addr))crashinfo->debug.ldbase;
- debug.r_map = crashinfo->debug.dso_count > 0 ?
- (struct link_map*)(start_addr + sizeof(debug)) : 0;
- data.append((char*)&debug, sizeof(debug));
-
- struct link_map* prev = 0;
- for (std::vector<MDRawLinkMap>::iterator iter = crashinfo->link_map.begin();
- iter != crashinfo->link_map.end();
- ++iter) {
- struct link_map link_map = { 0 };
- link_map.l_addr = (ElfW(Addr))iter->addr;
- link_map.l_name = (char*)(start_addr + data.size() + sizeof(link_map));
- link_map.l_ld = (ElfW(Dyn)*)iter->ld;
- link_map.l_prev = prev;
- prev = (struct link_map*)(start_addr + data.size());
- string filename = full_file.GetAsciiMDString(iter->name);
-
- // Look up signature for this filename. If available, change filename
- // to point to GUID, instead.
- std::map<uintptr_t, string>::const_iterator guid =
- crashinfo->signatures.find((uintptr_t)iter->addr);
- if (guid != crashinfo->signatures.end()) {
- filename = guid->second;
- }
-
- if (std::distance(iter, crashinfo->link_map.end()) == 1) {
- link_map.l_next = 0;
- } else {
- link_map.l_next = (struct link_map*)(start_addr + data.size() +
- sizeof(link_map) +
- ((filename.size() + 8) & ~7));
- }
- data.append((char*)&link_map, sizeof(link_map));
- data.append(filename);
- data.append(8 - (filename.size() & 7), 0);
- }
- AddDataToMapping(crashinfo, data, start_addr);
-
- // Map the page containing the _DYNAMIC array
- if (!crashinfo->dynamic_data.empty()) {
- // Make _DYNAMIC DT_DEBUG entry point to our link map
- for (int i = 0;; ++i) {
- ElfW(Dyn) dyn;
- if ((i+1)*sizeof(dyn) > crashinfo->dynamic_data.length()) {
- no_dt_debug:
- if (verbose) {
- fprintf(stderr, "No DT_DEBUG entry found\n");
- }
- return;
- }
- memcpy(&dyn, crashinfo->dynamic_data.c_str() + i*sizeof(dyn),
- sizeof(dyn));
- if (dyn.d_tag == DT_DEBUG) {
- crashinfo->dynamic_data.replace(i*sizeof(dyn) +
- offsetof(ElfW(Dyn), d_un.d_ptr),
- sizeof(start_addr),
- (char*)&start_addr, sizeof(start_addr));
- break;
- } else if (dyn.d_tag == DT_NULL) {
- goto no_dt_debug;
- }
- }
- AddDataToMapping(crashinfo, crashinfo->dynamic_data,
- (uintptr_t)crashinfo->debug.dynamic);
- }
-}
-
-int
-main(int argc, char** argv) {
- int argi = 1;
- while (argi < argc && argv[argi][0] == '-') {
- if (!strcmp(argv[argi], "-v")) {
- verbose = true;
- } else if (!strcmp(argv[argi], "--sobasedir")) {
- argi++;
- if (argi >= argc) {
- fprintf(stderr, "--sobasedir expects an argument.");
- return usage(argv[0]);
- }
-
- g_custom_so_basedir = argv[argi];
- } else {
- return usage(argv[0]);
- }
- argi++;
- }
-
- if (argc != argi + 1)
- return usage(argv[0]);
-
- MemoryMappedFile mapped_file(argv[argi], 0);
- if (!mapped_file.data()) {
- fprintf(stderr, "Failed to mmap dump file\n");
- return 1;
- }
-
- MinidumpMemoryRange dump(mapped_file.data(), mapped_file.size());
-
- const MDRawHeader* header = dump.GetData<MDRawHeader>(0);
-
- CrashedProcess crashinfo;
-
- // Always check the system info first, as that allows us to tell whether
- // this is a minidump file that is compatible with our converter.
- bool ok = false;
- for (unsigned i = 0; i < header->stream_count; ++i) {
- const MDRawDirectory* dirent =
- dump.GetArrayElement<MDRawDirectory>(header->stream_directory_rva, i);
- switch (dirent->stream_type) {
- case MD_SYSTEM_INFO_STREAM:
- ParseSystemInfo(&crashinfo, dump.Subrange(dirent->location), dump);
- ok = true;
- break;
- default:
- break;
- }
- }
- if (!ok) {
- fprintf(stderr, "Cannot determine input file format.\n");
- _exit(1);
- }
-
- for (unsigned i = 0; i < header->stream_count; ++i) {
- const MDRawDirectory* dirent =
- dump.GetArrayElement<MDRawDirectory>(header->stream_directory_rva, i);
- switch (dirent->stream_type) {
- case MD_THREAD_LIST_STREAM:
- ParseThreadList(&crashinfo, dump.Subrange(dirent->location), dump);
- break;
- case MD_LINUX_CPU_INFO:
- ParseCPUInfo(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_PROC_STATUS:
- ParseProcessStatus(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_LSB_RELEASE:
- ParseLSBRelease(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_ENVIRON:
- ParseEnvironment(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_MAPS:
- ParseMaps(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_AUXV:
- ParseAuxVector(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_CMD_LINE:
- ParseCmdLine(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_LINUX_DSO_DEBUG:
- ParseDSODebugInfo(&crashinfo, dump.Subrange(dirent->location), dump);
- break;
- case MD_EXCEPTION_STREAM:
- ParseExceptionStream(&crashinfo, dump.Subrange(dirent->location));
- break;
- case MD_MODULE_LIST_STREAM:
- ParseModuleStream(&crashinfo, dump.Subrange(dirent->location), dump);
- break;
- default:
- if (verbose)
- fprintf(stderr, "Skipping %x\n", dirent->stream_type);
- }
- }
-
- AugmentMappings(&crashinfo, dump);
-
- // Write the ELF header. The file will look like:
- // ELF header
- // Phdr for the PT_NOTE
- // Phdr for each of the thread stacks
- // PT_NOTE
- // each of the thread stacks
- Ehdr ehdr;
- memset(&ehdr, 0, sizeof(Ehdr));
- ehdr.e_ident[0] = ELFMAG0;
- ehdr.e_ident[1] = ELFMAG1;
- ehdr.e_ident[2] = ELFMAG2;
- ehdr.e_ident[3] = ELFMAG3;
- ehdr.e_ident[4] = ELF_CLASS;
- ehdr.e_ident[5] = sex() ? ELFDATA2MSB : ELFDATA2LSB;
- ehdr.e_ident[6] = EV_CURRENT;
- ehdr.e_type = ET_CORE;
- ehdr.e_machine = ELF_ARCH;
- ehdr.e_version = EV_CURRENT;
- ehdr.e_phoff = sizeof(Ehdr);
- ehdr.e_ehsize = sizeof(Ehdr);
- ehdr.e_phentsize= sizeof(Phdr);
- ehdr.e_phnum = 1 + // PT_NOTE
- crashinfo.mappings.size(); // memory mappings
- ehdr.e_shentsize= sizeof(Shdr);
- if (!writea(1, &ehdr, sizeof(Ehdr)))
- return 1;
-
- size_t offset = sizeof(Ehdr) + ehdr.e_phnum * sizeof(Phdr);
- size_t filesz = sizeof(Nhdr) + 8 + sizeof(prpsinfo) +
- // sizeof(Nhdr) + 8 + sizeof(user) +
- sizeof(Nhdr) + 8 + crashinfo.auxv_length +
- crashinfo.threads.size() * (
- (sizeof(Nhdr) + 8 + sizeof(prstatus))
-#if defined(__i386__) || defined(__x86_64__)
- + sizeof(Nhdr) + 8 + sizeof(user_fpregs_struct)
-#endif
-#if defined(__i386__)
- + sizeof(Nhdr) + 8 + sizeof(user_fpxregs_struct)
-#endif
- );
-
- Phdr phdr;
- memset(&phdr, 0, sizeof(Phdr));
- phdr.p_type = PT_NOTE;
- phdr.p_offset = offset;
- phdr.p_filesz = filesz;
- if (!writea(1, &phdr, sizeof(phdr)))
- return 1;
-
- phdr.p_type = PT_LOAD;
- phdr.p_align = 4096;
- size_t note_align = phdr.p_align - ((offset+filesz) % phdr.p_align);
- if (note_align == phdr.p_align)
- note_align = 0;
- offset += note_align;
-
- for (std::map<uint64_t, CrashedProcess::Mapping>::const_iterator iter =
- crashinfo.mappings.begin();
- iter != crashinfo.mappings.end(); ++iter) {
- const CrashedProcess::Mapping& mapping = iter->second;
- if (mapping.permissions == 0xFFFFFFFF) {
- // This is a map that we found in MD_MODULE_LIST_STREAM (as opposed to
- // MD_LINUX_MAPS). It lacks some of the information that we would like
- // to include.
- phdr.p_flags = PF_R;
- } else {
- phdr.p_flags = mapping.permissions;
- }
- phdr.p_vaddr = mapping.start_address;
- phdr.p_memsz = mapping.end_address - mapping.start_address;
- if (mapping.data.size()) {
- offset += filesz;
- filesz = mapping.data.size();
- phdr.p_filesz = mapping.data.size();
- phdr.p_offset = offset;
- } else {
- phdr.p_filesz = 0;
- phdr.p_offset = 0;
- }
- if (!writea(1, &phdr, sizeof(phdr)))
- return 1;
- }
-
- Nhdr nhdr;
- memset(&nhdr, 0, sizeof(nhdr));
- nhdr.n_namesz = 5;
- nhdr.n_descsz = sizeof(prpsinfo);
- nhdr.n_type = NT_PRPSINFO;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, &crashinfo.prps, sizeof(prpsinfo))) {
- return 1;
- }
-
- nhdr.n_descsz = crashinfo.auxv_length;
- nhdr.n_type = NT_AUXV;
- if (!writea(1, &nhdr, sizeof(nhdr)) ||
- !writea(1, "CORE\0\0\0\0", 8) ||
- !writea(1, crashinfo.auxv, crashinfo.auxv_length)) {
- return 1;
- }
-
- for (unsigned i = 0; i < crashinfo.threads.size(); ++i) {
- if (crashinfo.threads[i].tid == crashinfo.crashing_tid) {
- WriteThread(crashinfo.threads[i], crashinfo.fatal_signal);
- break;
- }
- }
-
- for (unsigned i = 0; i < crashinfo.threads.size(); ++i) {
- if (crashinfo.threads[i].tid != crashinfo.crashing_tid)
- WriteThread(crashinfo.threads[i], 0);
- }
-
- if (note_align) {
- google_breakpad::scoped_array<char> scratch(new char[note_align]);
- memset(scratch.get(), 0, note_align);
- if (!writea(1, scratch.get(), note_align))
- return 1;
- }
-
- for (std::map<uint64_t, CrashedProcess::Mapping>::const_iterator iter =
- crashinfo.mappings.begin();
- iter != crashinfo.mappings.end(); ++iter) {
- const CrashedProcess::Mapping& mapping = iter->second;
- if (mapping.data.size()) {
- if (!writea(1, mapping.data.c_str(), mapping.data.size()))
- return 1;
- }
- }
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range.h b/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range.h
deleted file mode 100644
index a793e2cfb9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_memory_range.h: Define the google_breakpad::MinidumpMemoryRange
-// class, which adds methods for handling minidump specific data structures
-// on top of google_breakpad::MemoryRange. See common/memory_range.h for
-// more details on MemoryRange.
-
-#ifndef TOOLS_LINUX_MD2CORE_MINIDUMP_MEMORY_RANGE_H_
-#define TOOLS_LINUX_MD2CORE_MINIDUMP_MEMORY_RANGE_H_
-
-#include <string>
-
-#include "common/memory_range.h"
-#include "google_breakpad/common/minidump_format.h"
-
-namespace google_breakpad {
-
-// A derived class of MemoryRange with added methods for handling minidump
-// specific data structures. To avoid virtual functions, it is not designed
-// to be used polymorphically.
-class MinidumpMemoryRange : public MemoryRange {
- public:
- MinidumpMemoryRange() {}
-
- MinidumpMemoryRange(const void* data, size_t length)
- : MemoryRange(data, length) {}
-
- // Returns a subrange of |length| bytes at |offset| bytes of this memory
- // range, or an empty range if the subrange is out of bounds.
- // This methods overrides the base implemementation in order to return
- // an instance of MinidumpMemoryRange instead of MemoryRange.
- MinidumpMemoryRange Subrange(size_t sub_offset, size_t sub_length) const {
- if (Covers(sub_offset, sub_length))
- return MinidumpMemoryRange(data() + sub_offset, sub_length);
- return MinidumpMemoryRange();
- }
-
- // Returns a subrange that covers the offset and length specified by
- // |location|, or an empty range if the subrange is out of bounds.
- MinidumpMemoryRange Subrange(const MDLocationDescriptor& location) const {
- return MinidumpMemoryRange::Subrange(location.rva, location.data_size);
- }
-
- // Gets a STL string from a MDString at |sub_offset| bytes of this memory
- // range. This method only works correctly for ASCII characters and does
- // not convert between UTF-16 and UTF-8.
- const std::string GetAsciiMDString(size_t sub_offset) const {
- std::string str;
- const MDString* md_str = GetData<MDString>(sub_offset);
- if (md_str) {
- const uint16_t* buffer = &md_str->buffer[0];
- for (uint32_t i = 0; i < md_str->length && buffer[i]; ++i) {
- str.push_back(buffer[i]);
- }
- }
- return str;
- }
-};
-
-} // namespace google_breakpad
-
-#endif // TOOLS_LINUX_MD2CORE_MINIDUMP_MEMORY_RANGE_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range_unittest.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range_unittest.cc
deleted file mode 100644
index fe4ded83dc..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/md2core/minidump_memory_range_unittest.cc
+++ /dev/null
@@ -1,258 +0,0 @@
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_memory_range_unittest.cc:
-// Unit tests for google_breakpad::MinidumpMemoryRange.
-
-#include "breakpad_googletest_includes.h"
-#include "tools/linux/md2core/minidump_memory_range.h"
-
-using google_breakpad::MinidumpMemoryRange;
-using testing::Message;
-
-namespace {
-
-const uint32_t kBuffer[10] = { 0 };
-const size_t kBufferSize = sizeof(kBuffer);
-const uint8_t* kBufferPointer = reinterpret_cast<const uint8_t*>(kBuffer);
-
-// Test vectors for verifying Covers, GetData, and Subrange.
-const struct {
- bool valid;
- size_t offset;
- size_t length;
-} kSubranges[] = {
- { true, 0, 0 },
- { true, 0, 2 },
- { true, 0, kBufferSize },
- { true, 2, 0 },
- { true, 2, 4 },
- { true, 2, kBufferSize - 2 },
- { true, kBufferSize - 1, 1 },
- { false, kBufferSize, 0 },
- { false, kBufferSize, static_cast<size_t>(-1) },
- { false, kBufferSize + 1, 0 },
- { false, static_cast<size_t>(-1), 2 },
- { false, 1, kBufferSize },
- { false, kBufferSize - 1, 2 },
- { false, 0, static_cast<size_t>(-1) },
- { false, 1, static_cast<size_t>(-1) },
-};
-const size_t kNumSubranges = sizeof(kSubranges) / sizeof(kSubranges[0]);
-
-// Test vectors for verifying GetArrayElement.
-const struct {
- size_t offset;
- size_t size;
- size_t index;
- const void* const pointer;
-} kElements[] = {
- // Valid array elemenets
- { 0, 1, 0, kBufferPointer },
- { 0, 1, 1, kBufferPointer + 1 },
- { 0, 1, kBufferSize - 1, kBufferPointer + kBufferSize - 1 },
- { 0, 2, 1, kBufferPointer + 2 },
- { 0, 4, 2, kBufferPointer + 8 },
- { 0, 4, 9, kBufferPointer + 36 },
- { kBufferSize - 1, 1, 0, kBufferPointer + kBufferSize - 1 },
- // Invalid array elemenets
- { 0, 1, kBufferSize, NULL },
- { 0, 4, 10, NULL },
- { kBufferSize - 1, 1, 1, NULL },
- { kBufferSize - 1, 2, 0, NULL },
- { kBufferSize, 1, 0, NULL },
-};
-const size_t kNumElements = sizeof(kElements) / sizeof(kElements[0]);
-
-} // namespace
-
-TEST(MinidumpMemoryRangeTest, DefaultConstructor) {
- MinidumpMemoryRange range;
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-}
-
-TEST(MinidumpMemoryRangeTest, ConstructorWithDataAndLength) {
- MinidumpMemoryRange range(kBuffer, kBufferSize);
- EXPECT_EQ(kBufferPointer, range.data());
- EXPECT_EQ(kBufferSize, range.length());
-}
-
-TEST(MinidumpMemoryRangeTest, Reset) {
- MinidumpMemoryRange range;
- range.Reset();
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-
- range.Set(kBuffer, kBufferSize);
- EXPECT_EQ(kBufferPointer, range.data());
- EXPECT_EQ(kBufferSize, range.length());
-
- range.Reset();
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-}
-
-TEST(MinidumpMemoryRangeTest, Set) {
- MinidumpMemoryRange range;
- range.Set(kBuffer, kBufferSize);
- EXPECT_EQ(kBufferPointer, range.data());
- EXPECT_EQ(kBufferSize, range.length());
-
- range.Set(NULL, 0);
- EXPECT_EQ(NULL, range.data());
- EXPECT_EQ(0U, range.length());
-}
-
-TEST(MinidumpMemoryRangeTest, SubrangeOfEmptyMemoryRange) {
- MinidumpMemoryRange range;
- MinidumpMemoryRange subrange = range.Subrange(0, 10);
- EXPECT_EQ(NULL, subrange.data());
- EXPECT_EQ(0U, subrange.length());
-}
-
-TEST(MinidumpMemoryRangeTest, SubrangeAndGetData) {
- MinidumpMemoryRange range(kBuffer, kBufferSize);
- for (size_t i = 0; i < kNumSubranges; ++i) {
- bool valid = kSubranges[i].valid;
- size_t sub_offset = kSubranges[i].offset;
- size_t sub_length = kSubranges[i].length;
- SCOPED_TRACE(Message() << "offset=" << sub_offset
- << ", length=" << sub_length);
-
- MinidumpMemoryRange subrange = range.Subrange(sub_offset, sub_length);
- if (valid) {
- EXPECT_TRUE(range.Covers(sub_offset, sub_length));
- EXPECT_EQ(kBufferPointer + sub_offset,
- range.GetData(sub_offset, sub_length));
- EXPECT_EQ(kBufferPointer + sub_offset, subrange.data());
- EXPECT_EQ(sub_length, subrange.length());
- } else {
- EXPECT_FALSE(range.Covers(sub_offset, sub_length));
- EXPECT_EQ(NULL, range.GetData(sub_offset, sub_length));
- EXPECT_EQ(NULL, subrange.data());
- EXPECT_EQ(0U, subrange.length());
- }
- }
-}
-
-TEST(MinidumpMemoryRangeTest, SubrangeWithMDLocationDescriptor) {
- MinidumpMemoryRange range(kBuffer, kBufferSize);
- for (size_t i = 0; i < kNumSubranges; ++i) {
- bool valid = kSubranges[i].valid;
- size_t sub_offset = kSubranges[i].offset;
- size_t sub_length = kSubranges[i].length;
- SCOPED_TRACE(Message() << "offset=" << sub_offset
- << ", length=" << sub_length);
-
- MDLocationDescriptor location;
- location.rva = sub_offset;
- location.data_size = sub_length;
- MinidumpMemoryRange subrange = range.Subrange(location);
- if (valid) {
- EXPECT_TRUE(range.Covers(sub_offset, sub_length));
- EXPECT_EQ(kBufferPointer + sub_offset,
- range.GetData(sub_offset, sub_length));
- EXPECT_EQ(kBufferPointer + sub_offset, subrange.data());
- EXPECT_EQ(sub_length, subrange.length());
- } else {
- EXPECT_FALSE(range.Covers(sub_offset, sub_length));
- EXPECT_EQ(NULL, range.GetData(sub_offset, sub_length));
- EXPECT_EQ(NULL, subrange.data());
- EXPECT_EQ(0U, subrange.length());
- }
- }
-}
-
-TEST(MinidumpMemoryRangeTest, GetDataWithTemplateType) {
- MinidumpMemoryRange range(kBuffer, kBufferSize);
- const char* char_pointer = range.GetData<char>(0);
- EXPECT_EQ(reinterpret_cast<const char*>(kBufferPointer), char_pointer);
- const int* int_pointer = range.GetData<int>(0);
- EXPECT_EQ(reinterpret_cast<const int*>(kBufferPointer), int_pointer);
-}
-
-TEST(MinidumpMemoryRangeTest, GetArrayElement) {
- MinidumpMemoryRange range(kBuffer, kBufferSize);
- for (size_t i = 0; i < kNumElements; ++i) {
- size_t element_offset = kElements[i].offset;
- size_t element_size = kElements[i].size;
- unsigned element_index = kElements[i].index;
- const void* const element_pointer = kElements[i].pointer;
- SCOPED_TRACE(Message() << "offset=" << element_offset
- << ", size=" << element_size
- << ", index=" << element_index);
- EXPECT_EQ(element_pointer, range.GetArrayElement(
- element_offset, element_size, element_index));
- }
-}
-
-TEST(MinidumpMemoryRangeTest, GetArrayElmentWithTemplateType) {
- MinidumpMemoryRange range(kBuffer, kBufferSize);
- const char* char_pointer = range.GetArrayElement<char>(0, 0);
- EXPECT_EQ(reinterpret_cast<const char*>(kBufferPointer), char_pointer);
- const int* int_pointer = range.GetArrayElement<int>(0, 0);
- EXPECT_EQ(reinterpret_cast<const int*>(kBufferPointer), int_pointer);
-}
-
-TEST(MinidumpMemoryRangeTest, GetAsciiMDString) {
- uint8_t buffer[100] = { 0 };
-
- MDString* md_str = reinterpret_cast<MDString*>(buffer);
- md_str->length = 4;
- md_str->buffer[0] = 'T';
- md_str->buffer[1] = 'e';
- md_str->buffer[2] = 's';
- md_str->buffer[3] = 't';
- md_str->buffer[4] = '\0';
-
- size_t str2_offset =
- sizeof(MDString) + (md_str->length + 1) * sizeof(uint16_t);
-
- md_str = reinterpret_cast<MDString*>(buffer + str2_offset);
- md_str->length = 9; // Test length larger than actual string
- md_str->buffer[0] = 'S';
- md_str->buffer[1] = 't';
- md_str->buffer[2] = 'r';
- md_str->buffer[3] = 'i';
- md_str->buffer[4] = 'n';
- md_str->buffer[5] = 'g';
- md_str->buffer[6] = '\0';
- md_str->buffer[7] = '1';
- md_str->buffer[8] = '2';
-
- MinidumpMemoryRange range(buffer, sizeof(buffer));
- EXPECT_EQ("Test", range.GetAsciiMDString(0));
- EXPECT_EQ("String", range.GetAsciiMDString(str2_offset));
-
- // Test out-of-bounds cases.
- EXPECT_EQ("", range.GetAsciiMDString(
- sizeof(buffer) - sizeof(MDString) + 1));
- EXPECT_EQ("", range.GetAsciiMDString(sizeof(buffer)));
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/minidump_upload.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/minidump_upload.cc
deleted file mode 100644
index 19f17450a1..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/minidump_upload.cc
+++ /dev/null
@@ -1,153 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_upload.cc: Upload a minidump to a HTTP server.
-// The upload is sent as a multipart/form-data POST request with
-// the following parameters:
-// prod: the product name
-// ver: the product version
-// symbol_file: the breakpad format symbol file
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include <string>
-
-#include "common/linux/http_upload.h"
-#include "common/using_std_string.h"
-
-using google_breakpad::HTTPUpload;
-
-struct Options {
- string minidumpPath;
- string uploadURLStr;
- string product;
- string version;
- string proxy;
- string proxy_user_pwd;
- bool success;
-};
-
-//=============================================================================
-static void Start(Options *options) {
- std::map<string, string> parameters;
- // Add parameters
- parameters["prod"] = options->product;
- parameters["ver"] = options->version;
-
- std::map<string, string> files;
- files["upload_file_minidump"] = options->minidumpPath;
-
- // Send it
- string response, error;
- bool success = HTTPUpload::SendRequest(options->uploadURLStr,
- parameters,
- files,
- options->proxy,
- options->proxy_user_pwd,
- "",
- &response,
- NULL,
- &error);
-
- if (success) {
- printf("Successfully sent the minidump file.\n");
- } else {
- printf("Failed to send minidump: %s\n", error.c_str());
- }
- printf("Response:\n");
- printf("%s\n", response.c_str());
- options->success = success;
-}
-
-//=============================================================================
-static void
-Usage(int argc, const char *argv[]) {
- fprintf(stderr, "Submit minidump information.\n");
- fprintf(stderr, "Usage: %s [options...] -p <product> -v <version> <minidump> "
- "<upload-URL>\n", argv[0]);
- fprintf(stderr, "Options:\n");
- fprintf(stderr, "<minidump> should be a minidump.\n");
- fprintf(stderr, "<upload-URL> is the destination for the upload\n");
-
- fprintf(stderr, "-p:\t <product> Product name\n");
- fprintf(stderr, "-v:\t <version> Product version\n");
- fprintf(stderr, "-x:\t <host[:port]> Use HTTP proxy on given port\n");
- fprintf(stderr, "-u:\t <user[:password]> Set proxy user and password\n");
- fprintf(stderr, "-h:\t Usage\n");
- fprintf(stderr, "-?:\t Usage\n");
-}
-
-//=============================================================================
-static void
-SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
- int ch;
-
- while ((ch = getopt(argc, (char * const *)argv, "p:u:v:x:h?")) != -1) {
- switch (ch) {
- case 'p':
- options->product = optarg;
- break;
- case 'u':
- options->proxy_user_pwd = optarg;
- break;
- case 'v':
- options->version = optarg;
- break;
- case 'x':
- options->proxy = optarg;
- break;
-
- default:
- fprintf(stderr, "Invalid option '%c'\n", ch);
- Usage(argc, argv);
- exit(1);
- break;
- }
- }
-
- if ((argc - optind) != 2) {
- fprintf(stderr, "%s: Missing symbols file and/or upload-URL\n", argv[0]);
- Usage(argc, argv);
- exit(1);
- }
-
- options->minidumpPath = argv[optind];
- options->uploadURLStr = argv[optind + 1];
-}
-
-//=============================================================================
-int main(int argc, const char* argv[]) {
- Options options;
- SetupOptions(argc, argv, &options);
- Start(&options);
- return options.success ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/sym_upload.cc b/toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/sym_upload.cc
deleted file mode 100644
index 9eeb2d447e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/symupload/sym_upload.cc
+++ /dev/null
@@ -1,112 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// symupload.cc: Upload a symbol file to a HTTP server. The upload is sent as
-// a multipart/form-data POST request with the following parameters:
-// code_file: the basename of the module, e.g. "app"
-// debug_file: the basename of the debugging file, e.g. "app"
-// debug_identifier: the debug file's identifier, usually consisting of
-// the guid and age embedded in the pdb, e.g.
-// "11111111BBBB3333DDDD555555555555F"
-// version: the file version of the module, e.g. "1.2.3.4"
-// os: the operating system that the module was built for
-// cpu: the CPU that the module was built for
-// symbol_file: the contents of the breakpad-format symbol file
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#include "common/linux/symbol_upload.h"
-
-using google_breakpad::sym_upload::Options;
-
-//=============================================================================
-static void
-Usage(int argc, const char *argv[]) {
- fprintf(stderr, "Submit symbol information.\n");
- fprintf(stderr, "Usage: %s [options...] <symbols> <upload-URL>\n", argv[0]);
- fprintf(stderr, "Options:\n");
- fprintf(stderr, "<symbols> should be created by using the dump_syms tool.\n");
- fprintf(stderr, "<upload-URL> is the destination for the upload\n");
- fprintf(stderr, "-v:\t Version information (e.g., 1.2.3.4)\n");
- fprintf(stderr, "-x:\t <host[:port]> Use HTTP proxy on given port\n");
- fprintf(stderr, "-u:\t <user[:password]> Set proxy user and password\n");
- fprintf(stderr, "-h:\t Usage\n");
- fprintf(stderr, "-?:\t Usage\n");
-}
-
-//=============================================================================
-static void
-SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
- int ch;
-
- while ((ch = getopt(argc, (char * const *)argv, "u:v:x:h?")) != -1) {
- switch (ch) {
- case 'h':
- case '?':
- Usage(argc, argv);
- exit(0);
- break;
- case 'u':
- options->proxy_user_pwd = optarg;
- break;
- case 'v':
- options->version = optarg;
- break;
- case 'x':
- options->proxy = optarg;
- break;
-
- default:
- fprintf(stderr, "Invalid option '%c'\n", ch);
- Usage(argc, argv);
- exit(1);
- break;
- }
- }
-
- if ((argc - optind) != 2) {
- fprintf(stderr, "%s: Missing symbols file and/or upload-URL\n", argv[0]);
- Usage(argc, argv);
- exit(1);
- }
-
- options->symbolsPath = argv[optind];
- options->uploadURLStr = argv[optind + 1];
-}
-
-//=============================================================================
-int main(int argc, const char* argv[]) {
- Options options;
- SetupOptions(argc, argv, &options);
- google_breakpad::sym_upload::Start(&options);
- return options.success ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/linux/tools_linux.gypi b/toolkit/crashreporter/google-breakpad/src/tools/linux/tools_linux.gypi
deleted file mode 100644
index 1c15992e11..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/tools_linux.gypi
+++ /dev/null
@@ -1,83 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'target_defaults': {
- 'include_dirs': [
- '../..',
- ],
- },
- 'targets': [
- {
- 'target_name': 'dump_syms',
- 'type': 'executable',
- 'sources': [
- 'dump_syms/dump_syms.cc',
- ],
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- {
- 'target_name': 'md2core',
- 'type': 'executable',
- 'sources': [
- 'md2core/minidump-2-core.cc',
- 'md2core/minidump_memory_range.h',
- ],
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- {
- 'target_name': 'minidump_upload',
- 'type': 'executable',
- 'sources': [
- 'symupload/minidump_upload.m',
- ],
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- {
- 'target_name': 'symupload',
- 'type': 'executable',
- 'sources': [
- 'symupload/sym_upload.cc',
- ],
- 'link_settings': {
- 'libraries': [
- '-ldl',
- ],
- },
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.mm b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.mm
deleted file mode 100644
index f68200c7c9..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.mm
+++ /dev/null
@@ -1,408 +0,0 @@
-// Copyright (c) 2010 Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// crash_report.mm: Convert the contents of a minidump into a format that
-// looks more like Apple's CrashReporter format
-
-#include <unistd.h>
-
-#include <mach/machine.h>
-#include <mach-o/arch.h>
-
-#include <string>
-
-#include <Foundation/Foundation.h>
-
-#include "common/scoped_ptr.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/minidump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stack_frame_cpu.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/pathname_stripper.h"
-#include "processor/simple_symbol_supplier.h"
-
-#include "on_demand_symbol_supplier.h"
-
-using std::string;
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::CodeModules;
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpProcessor;
-using google_breakpad::OnDemandSymbolSupplier;
-using google_breakpad::PathnameStripper;
-using google_breakpad::ProcessState;
-using google_breakpad::scoped_ptr;
-using google_breakpad::StackFrame;
-using google_breakpad::StackFramePPC;
-using google_breakpad::StackFrameX86;
-using google_breakpad::SystemInfo;
-
-typedef struct {
- NSString *minidumpPath;
- NSString *searchDir;
- NSString *symbolSearchDir;
- BOOL printThreadMemory;
-} Options;
-
-//=============================================================================
-static int PrintRegister(const char *name, u_int32_t value, int sequence) {
- if (sequence % 4 == 0) {
- printf("\n");
- }
- printf("%6s = 0x%08x ", name, value);
- return ++sequence;
-}
-
-//=============================================================================
-static void PrintStack(const CallStack *stack, const string &cpu) {
- size_t frame_count = stack->frames()->size();
- char buffer[1024];
- for (size_t frame_index = 0; frame_index < frame_count; ++frame_index) {
- const StackFrame *frame = stack->frames()->at(frame_index);
- const CodeModule *module = frame->module;
- printf("%2zu ", frame_index);
-
- if (module) {
- // Module name (20 chars max)
- strcpy(buffer, PathnameStripper::File(module->code_file()).c_str());
- int maxStr = 20;
- buffer[maxStr] = 0;
- printf("%-*s", maxStr, buffer);
-
- strcpy(buffer, module->version().c_str());
- buffer[maxStr] = 0;
-
- printf("%-*s",maxStr, buffer);
-
- u_int64_t instruction = frame->instruction;
-
- // PPC only: Adjust the instruction to match that of Crash reporter. The
- // instruction listed is actually the return address. See the detailed
- // comments in stackwalker_ppc.cc for more information.
- if (cpu == "ppc" && frame_index)
- instruction += 4;
-
- printf(" 0x%08llx ", instruction);
-
- // Function name
- if (!frame->function_name.empty()) {
- printf("%s", frame->function_name.c_str());
- if (!frame->source_file_name.empty()) {
- string source_file = PathnameStripper::File(frame->source_file_name);
- printf(" + 0x%llx (%s:%d)",
- instruction - frame->source_line_base,
- source_file.c_str(), frame->source_line);
- } else {
- printf(" + 0x%llx", instruction - frame->function_base);
- }
- }
- }
- printf("\n");
- }
-}
-
-//=============================================================================
-static void PrintRegisters(const CallStack *stack, const string &cpu) {
- int sequence = 0;
- const StackFrame *frame = stack->frames()->at(0);
- if (cpu == "x86") {
- const StackFrameX86 *frame_x86 =
- reinterpret_cast<const StackFrameX86*>(frame);
-
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EIP)
- sequence = PrintRegister("eip", frame_x86->context.eip, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESP)
- sequence = PrintRegister("esp", frame_x86->context.esp, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBP)
- sequence = PrintRegister("ebp", frame_x86->context.ebp, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EBX)
- sequence = PrintRegister("ebx", frame_x86->context.ebx, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_ESI)
- sequence = PrintRegister("esi", frame_x86->context.esi, sequence);
- if (frame_x86->context_validity & StackFrameX86::CONTEXT_VALID_EDI)
- sequence = PrintRegister("edi", frame_x86->context.edi, sequence);
- if (frame_x86->context_validity == StackFrameX86::CONTEXT_VALID_ALL) {
- sequence = PrintRegister("eax", frame_x86->context.eax, sequence);
- sequence = PrintRegister("ecx", frame_x86->context.ecx, sequence);
- sequence = PrintRegister("edx", frame_x86->context.edx, sequence);
- sequence = PrintRegister("efl", frame_x86->context.eflags, sequence);
- }
- } else if (cpu == "ppc") {
- const StackFramePPC *frame_ppc =
- reinterpret_cast<const StackFramePPC*>(frame);
-
- if ((frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_ALL) ==
- StackFramePPC::CONTEXT_VALID_ALL) {
- sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence);
- sequence = PrintRegister("srr1", frame_ppc->context.srr1, sequence);
- sequence = PrintRegister("cr", frame_ppc->context.cr, sequence);
- sequence = PrintRegister("xer", frame_ppc->context.xer, sequence);
- sequence = PrintRegister("lr", frame_ppc->context.lr, sequence);
- sequence = PrintRegister("ctr", frame_ppc->context.ctr, sequence);
- sequence = PrintRegister("mq", frame_ppc->context.mq, sequence);
- sequence = PrintRegister("vrsave", frame_ppc->context.vrsave, sequence);
-
- sequence = 0;
- char buffer[5];
- for (int i = 0; i < MD_CONTEXT_PPC_GPR_COUNT; ++i) {
- sprintf(buffer, "r%d", i);
- sequence = PrintRegister(buffer, frame_ppc->context.gpr[i], sequence);
- }
- } else {
- if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_SRR0)
- sequence = PrintRegister("srr0", frame_ppc->context.srr0, sequence);
- if (frame_ppc->context_validity & StackFramePPC::CONTEXT_VALID_GPR1)
- sequence = PrintRegister("r1", frame_ppc->context.gpr[1], sequence);
- }
- }
-
- printf("\n");
-}
-
-static void PrintModules(const CodeModules *modules) {
- if (!modules)
- return;
-
- printf("\n");
- printf("Loaded modules:\n");
-
- u_int64_t main_address = 0;
- const CodeModule *main_module = modules->GetMainModule();
- if (main_module) {
- main_address = main_module->base_address();
- }
-
- unsigned int module_count = modules->module_count();
- for (unsigned int module_sequence = 0;
- module_sequence < module_count;
- ++module_sequence) {
- const CodeModule *module = modules->GetModuleAtSequence(module_sequence);
- assert(module);
- u_int64_t base_address = module->base_address();
- printf("0x%08llx - 0x%08llx %s %s%s %s\n",
- base_address, base_address + module->size() - 1,
- PathnameStripper::File(module->code_file()).c_str(),
- module->version().empty() ? "???" : module->version().c_str(),
- main_module != NULL && base_address == main_address ?
- " (main)" : "",
- module->code_file().c_str());
- }
-}
-
-static void ProcessSingleReport(Options *options, NSString *file_path) {
- string minidump_file([file_path fileSystemRepresentation]);
- BasicSourceLineResolver resolver;
- string search_dir = options->searchDir ?
- [options->searchDir fileSystemRepresentation] : "";
- string symbol_search_dir = options->symbolSearchDir ?
- [options->symbolSearchDir fileSystemRepresentation] : "";
- scoped_ptr<OnDemandSymbolSupplier> symbol_supplier(
- new OnDemandSymbolSupplier(search_dir, symbol_search_dir));
- scoped_ptr<MinidumpProcessor>
- minidump_processor(new MinidumpProcessor(symbol_supplier.get(), &resolver));
- ProcessState process_state;
- scoped_ptr<Minidump> dump(new google_breakpad::Minidump(minidump_file));
-
- if (!dump->Read()) {
- fprintf(stderr, "Minidump %s could not be read\n", dump->path().c_str());
- return;
- }
- if (minidump_processor->Process(dump.get(), &process_state) !=
- google_breakpad::PROCESS_OK) {
- fprintf(stderr, "MinidumpProcessor::Process failed\n");
- return;
- }
-
- const SystemInfo *system_info = process_state.system_info();
- string cpu = system_info->cpu;
-
- // Convert the time to a string
- u_int32_t time_date_stamp = process_state.time_date_stamp();
- struct tm timestruct;
- gmtime_r(reinterpret_cast<time_t*>(&time_date_stamp), &timestruct);
- char timestr[20];
- strftime(timestr, 20, "%Y-%m-%d %H:%M:%S", &timestruct);
- printf("Date: %s GMT\n", timestr);
-
- printf("Operating system: %s (%s)\n", system_info->os.c_str(),
- system_info->os_version.c_str());
- printf("Architecture: %s\n", cpu.c_str());
-
- if (process_state.crashed()) {
- printf("Crash reason: %s\n", process_state.crash_reason().c_str());
- printf("Crash address: 0x%llx\n", process_state.crash_address());
- } else {
- printf("No crash\n");
- }
-
- int requesting_thread = process_state.requesting_thread();
- if (requesting_thread != -1) {
- printf("\n");
- printf("Thread %d (%s)\n",
- requesting_thread,
- process_state.crashed() ? "crashed" :
- "requested dump, did not crash");
- PrintStack(process_state.threads()->at(requesting_thread), cpu);
- }
-
- // Print all of the threads in the dump.
- int thread_count = static_cast<int>(process_state.threads()->size());
- const std::vector<google_breakpad::MemoryRegion*>
- *thread_memory_regions = process_state.thread_memory_regions();
-
- for (int thread_index = 0; thread_index < thread_count; ++thread_index) {
- if (thread_index != requesting_thread) {
- // Don't print the crash thread again, it was already printed.
- printf("\n");
- printf("Thread %d\n", thread_index);
- PrintStack(process_state.threads()->at(thread_index), cpu);
- google_breakpad::MemoryRegion *thread_stack_bytes =
- thread_memory_regions->at(thread_index);
- if (options->printThreadMemory) {
- thread_stack_bytes->Print();
- }
- }
- }
-
- // Print the crashed registers
- if (requesting_thread != -1) {
- printf("\nThread %d:", requesting_thread);
- PrintRegisters(process_state.threads()->at(requesting_thread), cpu);
- }
-
- // Print information about modules
- PrintModules(process_state.modules());
-}
-
-//=============================================================================
-static void Start(Options *options) {
- NSFileManager *manager = [NSFileManager defaultManager];
- NSString *minidump_path = options->minidumpPath;
- BOOL is_dir = NO;
- BOOL file_exists = [manager fileExistsAtPath:minidump_path
- isDirectory:&is_dir];
- if (file_exists && is_dir) {
- NSDirectoryEnumerator *enumerator =
- [manager enumeratorAtPath:minidump_path];
- NSString *current_file = nil;
- while ((current_file = [enumerator nextObject])) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- if ([[current_file pathExtension] isEqualTo:@"dmp"]) {
- printf("Attempting to process report: %s\n",
- [current_file cStringUsingEncoding:NSASCIIStringEncoding]);
- NSString *full_path =
- [minidump_path stringByAppendingPathComponent:current_file];
- ProcessSingleReport(options, full_path);
- }
- [pool release];
- }
- } else if (file_exists) {
- ProcessSingleReport(options, minidump_path);
- }
-}
-
-//=============================================================================
-static void Usage(int argc, const char *argv[]) {
- fprintf(stderr, "Convert a minidump to a crash report. Breakpad symbol "
- "files will be used (or created if missing) in /tmp.\n"
- "If a symbol-file-search-dir is specified, any symbol "
- "files in it will be used instead of being loaded from "
- "modules on disk.\n"
- "If modules cannot be found at the paths stored in the "
- "minidump file, they will be searched for at "
- "<module-search-dir>/<path-in-minidump-file>.\n");
- fprintf(stderr, "Usage: %s [-s module-search-dir] [-S symbol-file-search-dir] "
- "minidump-file\n", argv[0]);
- fprintf(stderr, "\t-s: Specify a search directory to use for missing modules\n"
- "\t-S: Specify a search directory to use for symbol files\n"
- "\t-t: Print thread stack memory in hex\n"
- "\t-h: Usage\n"
- "\t-?: Usage\n");
-}
-
-//=============================================================================
-static void SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
- char ch;
-
- while ((ch = getopt(argc, (char * const *)argv, "S:s:ht?")) != -1) {
- switch (ch) {
- case 's':
- options->searchDir = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:optarg
- length:strlen(optarg)];
- break;
-
- case 'S':
- options->symbolSearchDir = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:optarg
- length:strlen(optarg)];
- break;
-
- case 't':
- options->printThreadMemory = YES;
- break;
- case 'h':
- case '?':
- Usage(argc, argv);
- exit(1);
- break;
- }
- }
-
- if ((argc - optind) != 1) {
- fprintf(stderr, "%s: Missing minidump file\n", argv[0]);
- Usage(argc, argv);
- exit(1);
- }
-
- options->minidumpPath = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:argv[optind]
- length:strlen(argv[optind])];
-}
-
-//=============================================================================
-int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Options options;
-
- bzero(&options, sizeof(Options));
- SetupOptions(argc, argv, &options);
- Start(&options);
- [pool release];
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj
deleted file mode 100644
index d32837cbd4..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/crash_report.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,587 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 45;
- objects = {
-
-/* Begin PBXBuildFile section */
- 162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */; };
- 4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */; };
- 4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C721E126F9ADE00B43EAF /* exploitability.cc */; };
- 4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */; };
- 4D2C7227126F9B0F00B43EAF /* disassembler_x86.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7226126F9B0F00B43EAF /* disassembler_x86.cc */; };
- 4D2C722B126F9B5A00B43EAF /* x86_disasm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C722A126F9B5A00B43EAF /* x86_disasm.c */; };
- 4D2C722D126F9B6E00B43EAF /* x86_misc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C722C126F9B6E00B43EAF /* x86_misc.c */; };
- 4D2C722F126F9B8300B43EAF /* x86_operand_list.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C722E126F9B8300B43EAF /* x86_operand_list.c */; };
- 4D2C7233126F9BB000B43EAF /* ia32_invariant.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7232126F9BB000B43EAF /* ia32_invariant.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; };
- 4D2C7235126F9BC200B43EAF /* ia32_settings.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7234126F9BC200B43EAF /* ia32_settings.c */; };
- 4D2C7246126F9C0B00B43EAF /* ia32_insn.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7245126F9C0B00B43EAF /* ia32_insn.c */; };
- 4D2C724A126F9C2300B43EAF /* ia32_opcode_tables.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7249126F9C2300B43EAF /* ia32_opcode_tables.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; };
- 4D2C724C126F9C3800B43EAF /* ia32_implicit.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C724B126F9C3800B43EAF /* ia32_implicit.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; };
- 4D2C724E126F9C4D00B43EAF /* ia32_reg.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C724D126F9C4D00B43EAF /* ia32_reg.c */; settings = {COMPILER_FLAGS = "-Wno-error"; }; };
- 4D2C725B126F9C8000B43EAF /* ia32_operand.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C725A126F9C8000B43EAF /* ia32_operand.c */; };
- 4D2C725D126F9C9200B43EAF /* x86_insn.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C725C126F9C9200B43EAF /* x86_insn.c */; };
- 4D2C7264126F9CBB00B43EAF /* ia32_modrm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7261126F9CBB00B43EAF /* ia32_modrm.c */; };
- 4D2C726D126F9CDC00B43EAF /* x86_imm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4D2C7263126F9CBB00B43EAF /* x86_imm.c */; };
- 4D72CA5713DFBA84006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CA5613DFBA84006CABE3 /* md5.cc */; };
- 557800400BE1F28500EC23E0 /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */; };
- 8B31FF2A11F0C62700FCF3E4 /* dwarf_cfi_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */; };
- 8B31FF2B11F0C62700FCF3E4 /* dwarf_cu_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */; };
- 8B31FF2C11F0C62700FCF3E4 /* dwarf_line_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */; };
- 8B31FF4111F0C64400FCF3E4 /* stabs_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */; };
- 8B31FF4211F0C64400FCF3E4 /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */; };
- 8B31FF7411F0C6E000FCF3E4 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */; };
- 8B31FF8811F0C6FB00FCF3E4 /* language.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF8411F0C6FB00FCF3E4 /* language.cc */; };
- 8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FF8611F0C6FB00FCF3E4 /* module.cc */; };
- 8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */; };
- 8B40BDC00C0638E4009535AF /* logging.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8B40BDBF0C0638E4009535AF /* logging.cc */; };
- 8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* crash_report.mm */; settings = {ATTRIBUTES = (); }; };
- 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
- 9B35FEEA0B26761C008DE8C7 /* basic_code_modules.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */; };
- 9B3904990B2E52FD0059FABE /* basic_source_line_resolver.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */; };
- 9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF172A0B1B8B2400F8391B /* call_stack.cc */; };
- 9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */; };
- 9BDF17410B1B8B9A00F8391B /* minidump.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF173F0B1B8B9A00F8391B /* minidump.cc */; };
- 9BDF17540B1B8BF900F8391B /* stackwalker_ppc.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17510B1B8BF900F8391B /* stackwalker_ppc.cc */; };
- 9BDF17550B1B8BF900F8391B /* stackwalker_x86.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */; };
- 9BDF17560B1B8BF900F8391B /* stackwalker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF17530B1B8BF900F8391B /* stackwalker.cc */; };
- 9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF175B0B1B8C1B00F8391B /* process_state.cc */; };
- 9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */; };
- 9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */; };
- 9BDF21A70B1E825400F8391B /* dump_syms.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */; };
- 9BE650B20B52FE3000611104 /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AC0B52FE3000611104 /* file_id.cc */; };
- 9BE650B40B52FE3000611104 /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650AE0B52FE3000611104 /* macho_id.cc */; };
- 9BE650B60B52FE3000611104 /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650B00B52FE3000611104 /* macho_walker.cc */; };
- D2A5DD4D1188651100081F03 /* cfi_frame_info.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */; };
- D2A5DD631188658B00081F03 /* tokenize.cc in Sources */ = {isa = PBXBuildFile; fileRef = D2A5DD621188658B00081F03 /* tokenize.cc */; };
- F407DC48185773C10064622B /* exploitability_linux.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC40185773C10064622B /* exploitability_linux.cc */; };
- F407DC49185773C10064622B /* stack_frame_symbolizer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC41185773C10064622B /* stack_frame_symbolizer.cc */; };
- F407DC4A185773C10064622B /* stackwalker_arm64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC42185773C10064622B /* stackwalker_arm64.cc */; };
- F407DC4B185773C10064622B /* stackwalker_mips.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC44185773C10064622B /* stackwalker_mips.cc */; };
- F407DC4C185773C10064622B /* stackwalker_ppc64.cc in Sources */ = {isa = PBXBuildFile; fileRef = F407DC46185773C10064622B /* stackwalker_ppc64.cc */; };
- F44DDD8719C85CD50047280E /* dump_context.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8419C85CD50047280E /* dump_context.cc */; };
- F44DDD8819C85CD50047280E /* dump_object.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8519C85CD50047280E /* dump_object.cc */; };
- F44DDD8919C85CD50047280E /* microdump_processor.cc in Sources */ = {isa = PBXBuildFile; fileRef = F44DDD8619C85CD50047280E /* microdump_processor.cc */; };
- F4D43B2F1A38490700C290B2 /* microdump.cc in Sources */ = {isa = PBXBuildFile; fileRef = F4D43B2E1A38490700C290B2 /* microdump.cc */; };
- F9C7ECE50E8ABCA600E953AD /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE20E8ABCA600E953AD /* bytereader.cc */; };
- F9C7ECE60E8ABCA600E953AD /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */; };
- F9C7ECE70E8ABCA600E953AD /* functioninfo.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */; };
- F9F0706710FBC02D0037B88B /* stackwalker_arm.cc in Sources */ = {isa = PBXBuildFile; fileRef = F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */; };
- FD6625CD0CF4D45C004AC844 /* stackwalker_amd64.cc in Sources */ = {isa = PBXBuildFile; fileRef = FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */; };
- FD8EDEAE0CADDAD400A5EDF1 /* stackwalker_sparc.cc in Sources */ = {isa = PBXBuildFile; fileRef = FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 08FB7796FE84155DC02AAC07 /* crash_report.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = crash_report.mm; sourceTree = "<group>"; };
- 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
- 162F64FD161C5ECB00CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
- 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = source_line_resolver_base.cc; path = ../../../processor/source_line_resolver_base.cc; sourceTree = SOURCE_ROOT; };
- 4D2C721E126F9ADE00B43EAF /* exploitability.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability.cc; path = ../../../processor/exploitability.cc; sourceTree = SOURCE_ROOT; };
- 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability_win.cc; path = ../../../processor/exploitability_win.cc; sourceTree = SOURCE_ROOT; };
- 4D2C7226126F9B0F00B43EAF /* disassembler_x86.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = disassembler_x86.cc; path = ../../../processor/disassembler_x86.cc; sourceTree = SOURCE_ROOT; };
- 4D2C722A126F9B5A00B43EAF /* x86_disasm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_disasm.c; path = ../../../third_party/libdisasm/x86_disasm.c; sourceTree = SOURCE_ROOT; };
- 4D2C722C126F9B6E00B43EAF /* x86_misc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_misc.c; path = ../../../third_party/libdisasm/x86_misc.c; sourceTree = SOURCE_ROOT; };
- 4D2C722E126F9B8300B43EAF /* x86_operand_list.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_operand_list.c; path = ../../../third_party/libdisasm/x86_operand_list.c; sourceTree = SOURCE_ROOT; };
- 4D2C7232126F9BB000B43EAF /* ia32_invariant.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_invariant.c; path = ../../../third_party/libdisasm/ia32_invariant.c; sourceTree = SOURCE_ROOT; };
- 4D2C7234126F9BC200B43EAF /* ia32_settings.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_settings.c; path = ../../../third_party/libdisasm/ia32_settings.c; sourceTree = SOURCE_ROOT; };
- 4D2C7245126F9C0B00B43EAF /* ia32_insn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_insn.c; path = ../../../third_party/libdisasm/ia32_insn.c; sourceTree = SOURCE_ROOT; };
- 4D2C7249126F9C2300B43EAF /* ia32_opcode_tables.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_opcode_tables.c; path = ../../../third_party/libdisasm/ia32_opcode_tables.c; sourceTree = SOURCE_ROOT; };
- 4D2C724B126F9C3800B43EAF /* ia32_implicit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_implicit.c; path = ../../../third_party/libdisasm/ia32_implicit.c; sourceTree = SOURCE_ROOT; };
- 4D2C724D126F9C4D00B43EAF /* ia32_reg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_reg.c; path = ../../../third_party/libdisasm/ia32_reg.c; sourceTree = SOURCE_ROOT; };
- 4D2C725A126F9C8000B43EAF /* ia32_operand.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_operand.c; path = ../../../third_party/libdisasm/ia32_operand.c; sourceTree = SOURCE_ROOT; };
- 4D2C725C126F9C9200B43EAF /* x86_insn.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_insn.c; path = ../../../third_party/libdisasm/x86_insn.c; sourceTree = SOURCE_ROOT; };
- 4D2C7261126F9CBB00B43EAF /* ia32_modrm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ia32_modrm.c; path = ../../../third_party/libdisasm/ia32_modrm.c; sourceTree = SOURCE_ROOT; };
- 4D2C7263126F9CBB00B43EAF /* x86_imm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = x86_imm.c; path = ../../../third_party/libdisasm/x86_imm.c; sourceTree = SOURCE_ROOT; };
- 4D72CA5613DFBA84006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../../common/md5.cc; sourceTree = SOURCE_ROOT; };
- 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; };
- 5578003F0BE1F28500EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; };
- 8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cfi_to_module.cc; path = ../../../common/dwarf_cfi_to_module.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF2511F0C62700FCF3E4 /* dwarf_cfi_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cfi_to_module.h; path = ../../../common/dwarf_cfi_to_module.h; sourceTree = SOURCE_ROOT; };
- 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cu_to_module.cc; path = ../../../common/dwarf_cu_to_module.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF2711F0C62700FCF3E4 /* dwarf_cu_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cu_to_module.h; path = ../../../common/dwarf_cu_to_module.h; sourceTree = SOURCE_ROOT; };
- 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_line_to_module.cc; path = ../../../common/dwarf_line_to_module.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF2911F0C62700FCF3E4 /* dwarf_line_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_line_to_module.h; path = ../../../common/dwarf_line_to_module.h; sourceTree = SOURCE_ROOT; };
- 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_reader.cc; path = ../../../common/stabs_reader.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF3E11F0C64400FCF3E4 /* stabs_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_reader.h; path = ../../../common/stabs_reader.h; sourceTree = SOURCE_ROOT; };
- 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_to_module.cc; path = ../../../common/stabs_to_module.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF4011F0C64400FCF3E4 /* stabs_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_to_module.h; path = ../../../common/stabs_to_module.h; sourceTree = SOURCE_ROOT; };
- 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader.cc; path = ../../../common/mac/macho_reader.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_reader.h; path = ../../../common/mac/macho_reader.h; sourceTree = SOURCE_ROOT; };
- 8B31FF8411F0C6FB00FCF3E4 /* language.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = language.cc; path = ../../../common/language.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF8511F0C6FB00FCF3E4 /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = language.h; path = ../../../common/language.h; sourceTree = SOURCE_ROOT; };
- 8B31FF8611F0C6FB00FCF3E4 /* module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module.cc; path = ../../../common/module.cc; sourceTree = SOURCE_ROOT; };
- 8B31FF8711F0C6FB00FCF3E4 /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = module.h; path = ../../../common/module.h; sourceTree = SOURCE_ROOT; };
- 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2diehandler.cc; path = ../../../common/dwarf/dwarf2diehandler.cc; sourceTree = SOURCE_ROOT; };
- 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf2diehandler.h; path = ../../../common/dwarf/dwarf2diehandler.h; sourceTree = SOURCE_ROOT; };
- 8B40BDBF0C0638E4009535AF /* logging.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = logging.cc; path = ../../../processor/logging.cc; sourceTree = SOURCE_ROOT; };
- 8DD76FA10486AA7600D96B5E /* crash_report */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = crash_report; sourceTree = BUILT_PRODUCTS_DIR; };
- 9B35FEE20B2675F9008DE8C7 /* code_module.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = code_module.h; path = ../../../google_breakpad/processor/code_module.h; sourceTree = SOURCE_ROOT; };
- 9B35FEE30B2675F9008DE8C7 /* code_modules.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = code_modules.h; path = ../../../google_breakpad/processor/code_modules.h; sourceTree = SOURCE_ROOT; };
- 9B35FEE60B26761C008DE8C7 /* basic_code_module.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = basic_code_module.h; path = ../../../processor/basic_code_module.h; sourceTree = SOURCE_ROOT; };
- 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = basic_code_modules.cc; path = ../../../processor/basic_code_modules.cc; sourceTree = SOURCE_ROOT; };
- 9B35FEE80B26761C008DE8C7 /* basic_code_modules.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = basic_code_modules.h; path = ../../../processor/basic_code_modules.h; sourceTree = SOURCE_ROOT; };
- 9B3904940B2E52D90059FABE /* basic_source_line_resolver.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = basic_source_line_resolver.h; sourceTree = "<group>"; };
- 9B3904950B2E52D90059FABE /* source_line_resolver_interface.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = source_line_resolver_interface.h; sourceTree = "<group>"; };
- 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = basic_source_line_resolver.cc; path = ../../../processor/basic_source_line_resolver.cc; sourceTree = SOURCE_ROOT; };
- 9B44619D0B66C66B00BBB817 /* system_info.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = system_info.h; sourceTree = "<group>"; };
- 9BDF16F90B1B8ACD00F8391B /* breakpad_types.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = breakpad_types.h; sourceTree = "<group>"; };
- 9BDF16FA0B1B8ACD00F8391B /* minidump_format.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_format.h; sourceTree = "<group>"; };
- 9BDF16FC0B1B8ACD00F8391B /* call_stack.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = call_stack.h; sourceTree = "<group>"; };
- 9BDF16FD0B1B8ACD00F8391B /* memory_region.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = memory_region.h; sourceTree = "<group>"; };
- 9BDF16FE0B1B8ACD00F8391B /* minidump.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump.h; sourceTree = "<group>"; };
- 9BDF16FF0B1B8ACD00F8391B /* minidump_processor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = minidump_processor.h; sourceTree = "<group>"; };
- 9BDF17000B1B8ACD00F8391B /* process_state.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = process_state.h; sourceTree = "<group>"; };
- 9BDF17010B1B8ACD00F8391B /* stack_frame.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stack_frame.h; sourceTree = "<group>"; };
- 9BDF17020B1B8ACD00F8391B /* stack_frame_cpu.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stack_frame_cpu.h; sourceTree = "<group>"; };
- 9BDF17030B1B8ACD00F8391B /* stackwalker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = stackwalker.h; sourceTree = "<group>"; };
- 9BDF17040B1B8ACD00F8391B /* symbol_supplier.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = symbol_supplier.h; sourceTree = "<group>"; };
- 9BDF172A0B1B8B2400F8391B /* call_stack.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = call_stack.cc; path = ../../../processor/call_stack.cc; sourceTree = SOURCE_ROOT; };
- 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = minidump_processor.cc; path = ../../../processor/minidump_processor.cc; sourceTree = SOURCE_ROOT; };
- 9BDF173F0B1B8B9A00F8391B /* minidump.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = minidump.cc; path = ../../../processor/minidump.cc; sourceTree = SOURCE_ROOT; };
- 9BDF17510B1B8BF900F8391B /* stackwalker_ppc.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_ppc.cc; path = ../../../processor/stackwalker_ppc.cc; sourceTree = SOURCE_ROOT; };
- 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_x86.cc; path = ../../../processor/stackwalker_x86.cc; sourceTree = SOURCE_ROOT; };
- 9BDF17530B1B8BF900F8391B /* stackwalker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker.cc; path = ../../../processor/stackwalker.cc; sourceTree = SOURCE_ROOT; };
- 9BDF175B0B1B8C1B00F8391B /* process_state.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = process_state.cc; path = ../../../processor/process_state.cc; sourceTree = SOURCE_ROOT; };
- 9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = on_demand_symbol_supplier.h; sourceTree = "<group>"; };
- 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = on_demand_symbol_supplier.mm; sourceTree = "<group>"; };
- 9BDF192D0B1BC15D00F8391B /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = SOURCE_ROOT; };
- 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.mm; path = ../../../common/mac/dump_syms.mm; sourceTree = SOURCE_ROOT; };
- 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = pathname_stripper.cc; path = ../../../processor/pathname_stripper.cc; sourceTree = SOURCE_ROOT; };
- 9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "range_map-inl.h"; path = "../../../processor/range_map-inl.h"; sourceTree = SOURCE_ROOT; };
- 9BDF1A7B0B1BE30100F8391B /* range_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = range_map.h; path = ../../../processor/range_map.h; sourceTree = SOURCE_ROOT; };
- 9BDF1AFA0B1BEB6300F8391B /* address_map-inl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = "address_map-inl.h"; path = "../../../processor/address_map-inl.h"; sourceTree = SOURCE_ROOT; };
- 9BDF1AFB0B1BEB6300F8391B /* address_map.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = address_map.h; path = ../../../processor/address_map.h; sourceTree = SOURCE_ROOT; };
- 9BE650AC0B52FE3000611104 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; };
- 9BE650AD0B52FE3000611104 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ../../../common/mac/file_id.h; sourceTree = SOURCE_ROOT; };
- 9BE650AE0B52FE3000611104 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ../../../common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; };
- 9BE650AF0B52FE3000611104 /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ../../../common/mac/macho_id.h; sourceTree = SOURCE_ROOT; };
- 9BE650B00B52FE3000611104 /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ../../../common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; };
- 9BE650B10B52FE3000611104 /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ../../../common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; };
- D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cfi_frame_info.cc; path = ../../../processor/cfi_frame_info.cc; sourceTree = SOURCE_ROOT; };
- D2A5DD621188658B00081F03 /* tokenize.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = tokenize.cc; path = ../../../processor/tokenize.cc; sourceTree = SOURCE_ROOT; };
- F407DC40185773C10064622B /* exploitability_linux.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = exploitability_linux.cc; path = ../../../processor/exploitability_linux.cc; sourceTree = "<group>"; };
- F407DC41185773C10064622B /* stack_frame_symbolizer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stack_frame_symbolizer.cc; path = ../../../processor/stack_frame_symbolizer.cc; sourceTree = "<group>"; };
- F407DC42185773C10064622B /* stackwalker_arm64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_arm64.cc; path = ../../../processor/stackwalker_arm64.cc; sourceTree = "<group>"; };
- F407DC43185773C10064622B /* stackwalker_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_arm64.h; path = ../../../processor/stackwalker_arm64.h; sourceTree = "<group>"; };
- F407DC44185773C10064622B /* stackwalker_mips.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_mips.cc; path = ../../../processor/stackwalker_mips.cc; sourceTree = "<group>"; };
- F407DC45185773C10064622B /* stackwalker_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_mips.h; path = ../../../processor/stackwalker_mips.h; sourceTree = "<group>"; };
- F407DC46185773C10064622B /* stackwalker_ppc64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_ppc64.cc; path = ../../../processor/stackwalker_ppc64.cc; sourceTree = "<group>"; };
- F407DC47185773C10064622B /* stackwalker_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_ppc64.h; path = ../../../processor/stackwalker_ppc64.h; sourceTree = "<group>"; };
- F44DDD8419C85CD50047280E /* dump_context.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dump_context.cc; path = ../../../processor/dump_context.cc; sourceTree = "<group>"; };
- F44DDD8519C85CD50047280E /* dump_object.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dump_object.cc; path = ../../../processor/dump_object.cc; sourceTree = "<group>"; };
- F44DDD8619C85CD50047280E /* microdump_processor.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump_processor.cc; path = ../../../processor/microdump_processor.cc; sourceTree = "<group>"; };
- F44DDD8A19C85CFB0047280E /* dump_context.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_context.h; path = ../../../google_breakpad/processor/dump_context.h; sourceTree = "<group>"; };
- F44DDD8B19C85CFB0047280E /* dump_object.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = dump_object.h; path = ../../../google_breakpad/processor/dump_object.h; sourceTree = "<group>"; };
- F44DDD8C19C85CFC0047280E /* microdump_processor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump_processor.h; path = ../../../google_breakpad/processor/microdump_processor.h; sourceTree = "<group>"; };
- F44DDD8D19C85CFC0047280E /* process_result.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = process_result.h; path = ../../../google_breakpad/processor/process_result.h; sourceTree = "<group>"; };
- F4D43B2E1A38490700C290B2 /* microdump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = microdump.cc; path = ../../../processor/microdump.cc; sourceTree = "<group>"; };
- F4D43B301A38492000C290B2 /* microdump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = microdump.h; path = ../../../google_breakpad/processor/microdump.h; sourceTree = "<group>"; };
- F9C7ECE20E8ABCA600E953AD /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; };
- F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader.cc; path = ../../../common/dwarf/dwarf2reader.cc; sourceTree = SOURCE_ROOT; };
- F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = functioninfo.cc; path = ../../../common/dwarf/functioninfo.cc; sourceTree = SOURCE_ROOT; };
- F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_arm.cc; path = ../../../processor/stackwalker_arm.cc; sourceTree = SOURCE_ROOT; };
- F9F0706610FBC02D0037B88B /* stackwalker_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_arm.h; path = ../../../processor/stackwalker_arm.h; sourceTree = SOURCE_ROOT; };
- FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_amd64.cc; path = ../../../processor/stackwalker_amd64.cc; sourceTree = SOURCE_ROOT; };
- FD6625C50CF4D438004AC844 /* stackwalker_amd64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stackwalker_amd64.h; path = ../../../processor/stackwalker_amd64.h; sourceTree = SOURCE_ROOT; };
- FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = stackwalker_sparc.cc; path = ../../../processor/stackwalker_sparc.cc; sourceTree = SOURCE_ROOT; };
- FD8EDEAD0CADDAD400A5EDF1 /* stackwalker_sparc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = stackwalker_sparc.h; path = ../../../processor/stackwalker_sparc.h; sourceTree = SOURCE_ROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* crash_report */ = {
- isa = PBXGroup;
- children = (
- 8B31025311F0D2D400FCF3E4 /* Breakpad.xcconfig */,
- 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */,
- 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */,
- F9C7ECE10E8ABC7F00E953AD /* DWARF */,
- 162F64FC161C5ECB00CD68D5 /* arch_utilities.cc */,
- 162F64FD161C5ECB00CD68D5 /* arch_utilities.h */,
- 5578003E0BE1F28500EC23E0 /* macho_utilities.cc */,
- 5578003F0BE1F28500EC23E0 /* macho_utilities.h */,
- 8B31FF7211F0C6E000FCF3E4 /* macho_reader.cc */,
- 8B31FF7311F0C6E000FCF3E4 /* macho_reader.h */,
- 9BDF192D0B1BC15D00F8391B /* dump_syms.h */,
- 9BDF192E0B1BC15D00F8391B /* dump_syms.mm */,
- 08FB7796FE84155DC02AAC07 /* crash_report.mm */,
- F44DDD8D19C85CFC0047280E /* process_result.h */,
- 9BDF176B0B1B8CB100F8391B /* on_demand_symbol_supplier.h */,
- F44DDD8419C85CD50047280E /* dump_context.cc */,
- F44DDD8A19C85CFB0047280E /* dump_context.h */,
- F44DDD8519C85CD50047280E /* dump_object.cc */,
- F44DDD8B19C85CFB0047280E /* dump_object.h */,
- F4D43B2E1A38490700C290B2 /* microdump.cc */,
- F4D43B301A38492000C290B2 /* microdump.h */,
- F44DDD8619C85CD50047280E /* microdump_processor.cc */,
- F44DDD8C19C85CFC0047280E /* microdump_processor.h */,
- 9BDF176C0B1B8CB100F8391B /* on_demand_symbol_supplier.mm */,
- 8B31FF2411F0C62700FCF3E4 /* dwarf_cfi_to_module.cc */,
- 8B31FF2511F0C62700FCF3E4 /* dwarf_cfi_to_module.h */,
- 8B31FF2611F0C62700FCF3E4 /* dwarf_cu_to_module.cc */,
- 8B31FF2711F0C62700FCF3E4 /* dwarf_cu_to_module.h */,
- 8B31FF2811F0C62700FCF3E4 /* dwarf_line_to_module.cc */,
- 8B31FF2911F0C62700FCF3E4 /* dwarf_line_to_module.h */,
- 8B31FF3D11F0C64400FCF3E4 /* stabs_reader.cc */,
- 8B31FF3E11F0C64400FCF3E4 /* stabs_reader.h */,
- 8B31FF3F11F0C64400FCF3E4 /* stabs_to_module.cc */,
- 8B31FF4011F0C64400FCF3E4 /* stabs_to_module.h */,
- 8B31FF8411F0C6FB00FCF3E4 /* language.cc */,
- 8B31FF8511F0C6FB00FCF3E4 /* language.h */,
- 4D72CA5613DFBA84006CABE3 /* md5.cc */,
- 8B31FF8611F0C6FB00FCF3E4 /* module.cc */,
- 8B31FF8711F0C6FB00FCF3E4 /* module.h */,
- 08FB7795FE84155DC02AAC07 /* breakpad */,
- 4D2C726E126F9CE200B43EAF /* libdisasm */,
- 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
- 1AB674ADFE9D54B511CA2CBB /* Products */,
- );
- name = crash_report;
- sourceTree = "<group>";
- };
- 08FB7795FE84155DC02AAC07 /* breakpad */ = {
- isa = PBXGroup;
- children = (
- 9BE650AB0B52FE1A00611104 /* common */,
- 9BDF17280B1B8B0200F8391B /* processor */,
- 9BDF16F70B1B8ACD00F8391B /* google_breakpad */,
- );
- name = breakpad;
- sourceTree = "<group>";
- };
- 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
- isa = PBXGroup;
- children = (
- 08FB779EFE84155DC02AAC07 /* Foundation.framework */,
- );
- name = "External Frameworks and Libraries";
- sourceTree = "<group>";
- };
- 1AB674ADFE9D54B511CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8DD76FA10486AA7600D96B5E /* crash_report */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 4D2C726E126F9CE200B43EAF /* libdisasm */ = {
- isa = PBXGroup;
- children = (
- 4D2C7226126F9B0F00B43EAF /* disassembler_x86.cc */,
- 4D2C724B126F9C3800B43EAF /* ia32_implicit.c */,
- 4D2C7245126F9C0B00B43EAF /* ia32_insn.c */,
- 4D2C7232126F9BB000B43EAF /* ia32_invariant.c */,
- 4D2C7261126F9CBB00B43EAF /* ia32_modrm.c */,
- 4D2C7249126F9C2300B43EAF /* ia32_opcode_tables.c */,
- 4D2C725A126F9C8000B43EAF /* ia32_operand.c */,
- 4D2C724D126F9C4D00B43EAF /* ia32_reg.c */,
- 4D2C7234126F9BC200B43EAF /* ia32_settings.c */,
- 4D2C722A126F9B5A00B43EAF /* x86_disasm.c */,
- 4D2C7263126F9CBB00B43EAF /* x86_imm.c */,
- 4D2C725C126F9C9200B43EAF /* x86_insn.c */,
- 4D2C722C126F9B6E00B43EAF /* x86_misc.c */,
- 4D2C722E126F9B8300B43EAF /* x86_operand_list.c */,
- );
- name = libdisasm;
- sourceTree = "<group>";
- };
- 9BDF16F70B1B8ACD00F8391B /* google_breakpad */ = {
- isa = PBXGroup;
- children = (
- 9BDF16F80B1B8ACD00F8391B /* common */,
- 9BDF16FB0B1B8ACD00F8391B /* processor */,
- );
- name = google_breakpad;
- path = ../../../google_breakpad;
- sourceTree = SOURCE_ROOT;
- };
- 9BDF16F80B1B8ACD00F8391B /* common */ = {
- isa = PBXGroup;
- children = (
- 9BDF16F90B1B8ACD00F8391B /* breakpad_types.h */,
- 9BDF16FA0B1B8ACD00F8391B /* minidump_format.h */,
- );
- path = common;
- sourceTree = "<group>";
- };
- 9BDF16FB0B1B8ACD00F8391B /* processor */ = {
- isa = PBXGroup;
- children = (
- 9B3904940B2E52D90059FABE /* basic_source_line_resolver.h */,
- 9BDF16FC0B1B8ACD00F8391B /* call_stack.h */,
- 9B35FEE20B2675F9008DE8C7 /* code_module.h */,
- 9B35FEE30B2675F9008DE8C7 /* code_modules.h */,
- 9BDF16FD0B1B8ACD00F8391B /* memory_region.h */,
- 9BDF16FE0B1B8ACD00F8391B /* minidump.h */,
- 9BDF16FF0B1B8ACD00F8391B /* minidump_processor.h */,
- 9BDF17000B1B8ACD00F8391B /* process_state.h */,
- 9B3904950B2E52D90059FABE /* source_line_resolver_interface.h */,
- 9BDF17010B1B8ACD00F8391B /* stack_frame.h */,
- 9BDF17020B1B8ACD00F8391B /* stack_frame_cpu.h */,
- 9BDF17030B1B8ACD00F8391B /* stackwalker.h */,
- 9BDF17040B1B8ACD00F8391B /* symbol_supplier.h */,
- 9B44619D0B66C66B00BBB817 /* system_info.h */,
- );
- path = processor;
- sourceTree = "<group>";
- };
- 9BDF17280B1B8B0200F8391B /* processor */ = {
- isa = PBXGroup;
- children = (
- 4D2C7222126F9AF900B43EAF /* exploitability_win.cc */,
- F407DC40185773C10064622B /* exploitability_linux.cc */,
- F407DC41185773C10064622B /* stack_frame_symbolizer.cc */,
- F407DC42185773C10064622B /* stackwalker_arm64.cc */,
- F407DC43185773C10064622B /* stackwalker_arm64.h */,
- F407DC44185773C10064622B /* stackwalker_mips.cc */,
- F407DC45185773C10064622B /* stackwalker_mips.h */,
- F407DC46185773C10064622B /* stackwalker_ppc64.cc */,
- F407DC47185773C10064622B /* stackwalker_ppc64.h */,
- 4D2C721E126F9ADE00B43EAF /* exploitability.cc */,
- 4D2C721A126F9ACC00B43EAF /* source_line_resolver_base.cc */,
- D2A5DD621188658B00081F03 /* tokenize.cc */,
- D2A5DD4C1188651100081F03 /* cfi_frame_info.cc */,
- F9F0706510FBC02D0037B88B /* stackwalker_arm.cc */,
- F9F0706610FBC02D0037B88B /* stackwalker_arm.h */,
- 9B3904980B2E52FD0059FABE /* basic_source_line_resolver.cc */,
- 9BDF1AFA0B1BEB6300F8391B /* address_map-inl.h */,
- 9BDF1AFB0B1BEB6300F8391B /* address_map.h */,
- 9B35FEE60B26761C008DE8C7 /* basic_code_module.h */,
- 9B35FEE70B26761C008DE8C7 /* basic_code_modules.cc */,
- 9B35FEE80B26761C008DE8C7 /* basic_code_modules.h */,
- 9BDF172A0B1B8B2400F8391B /* call_stack.cc */,
- 8B40BDBF0C0638E4009535AF /* logging.cc */,
- 9BDF173F0B1B8B9A00F8391B /* minidump.cc */,
- 9BDF172B0B1B8B2400F8391B /* minidump_processor.cc */,
- 9BDF1A270B1BD58200F8391B /* pathname_stripper.cc */,
- 9BDF175B0B1B8C1B00F8391B /* process_state.cc */,
- 9BDF1A7A0B1BE30100F8391B /* range_map-inl.h */,
- 9BDF1A7B0B1BE30100F8391B /* range_map.h */,
- 9BDF17530B1B8BF900F8391B /* stackwalker.cc */,
- 9BDF17510B1B8BF900F8391B /* stackwalker_ppc.cc */,
- 9BDF17520B1B8BF900F8391B /* stackwalker_x86.cc */,
- FD8EDEAC0CADDAD400A5EDF1 /* stackwalker_sparc.cc */,
- FD8EDEAD0CADDAD400A5EDF1 /* stackwalker_sparc.h */,
- FD6625C40CF4D438004AC844 /* stackwalker_amd64.cc */,
- FD6625C50CF4D438004AC844 /* stackwalker_amd64.h */,
- );
- name = processor;
- sourceTree = "<group>";
- };
- 9BE650AB0B52FE1A00611104 /* common */ = {
- isa = PBXGroup;
- children = (
- 9BE650AC0B52FE3000611104 /* file_id.cc */,
- 9BE650AD0B52FE3000611104 /* file_id.h */,
- 9BE650AE0B52FE3000611104 /* macho_id.cc */,
- 9BE650AF0B52FE3000611104 /* macho_id.h */,
- 9BE650B00B52FE3000611104 /* macho_walker.cc */,
- 9BE650B10B52FE3000611104 /* macho_walker.h */,
- );
- name = common;
- sourceTree = "<group>";
- };
- F9C7ECE10E8ABC7F00E953AD /* DWARF */ = {
- isa = PBXGroup;
- children = (
- F9C7ECE20E8ABCA600E953AD /* bytereader.cc */,
- F9C7ECE30E8ABCA600E953AD /* dwarf2reader.cc */,
- 8B31FFC311F0C8AB00FCF3E4 /* dwarf2diehandler.cc */,
- 8B31FFC411F0C8AB00FCF3E4 /* dwarf2diehandler.h */,
- F9C7ECE40E8ABCA600E953AD /* functioninfo.cc */,
- );
- name = DWARF;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8DD76F960486AA7600D96B5E /* crash_report */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "crash_report" */;
- buildPhases = (
- 8DD76F990486AA7600D96B5E /* Sources */,
- 8DD76F9B0486AA7600D96B5E /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = crash_report;
- productInstallPath = "$(HOME)/bin";
- productName = crash_report;
- productReference = 8DD76FA10486AA7600D96B5E /* crash_report */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */;
- compatibilityVersion = "Xcode 3.1";
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- );
- mainGroup = 08FB7794FE84155DC02AAC07 /* crash_report */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8DD76F960486AA7600D96B5E /* crash_report */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8DD76F990486AA7600D96B5E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 162F64FE161C5ECB00CD68D5 /* arch_utilities.cc in Sources */,
- 8DD76F9A0486AA7600D96B5E /* crash_report.mm in Sources */,
- 9BDF172C0B1B8B2400F8391B /* call_stack.cc in Sources */,
- 9BDF172D0B1B8B2400F8391B /* minidump_processor.cc in Sources */,
- 9BDF17410B1B8B9A00F8391B /* minidump.cc in Sources */,
- F44DDD8719C85CD50047280E /* dump_context.cc in Sources */,
- 9BDF17540B1B8BF900F8391B /* stackwalker_ppc.cc in Sources */,
- 9BDF17550B1B8BF900F8391B /* stackwalker_x86.cc in Sources */,
- 9BDF17560B1B8BF900F8391B /* stackwalker.cc in Sources */,
- 9BDF175D0B1B8C1B00F8391B /* process_state.cc in Sources */,
- 9BDF176E0B1B8CB100F8391B /* on_demand_symbol_supplier.mm in Sources */,
- 9BDF1A280B1BD58200F8391B /* pathname_stripper.cc in Sources */,
- 9BDF21A70B1E825400F8391B /* dump_syms.mm in Sources */,
- 9B35FEEA0B26761C008DE8C7 /* basic_code_modules.cc in Sources */,
- 9B3904990B2E52FD0059FABE /* basic_source_line_resolver.cc in Sources */,
- 9BE650B20B52FE3000611104 /* file_id.cc in Sources */,
- 9BE650B40B52FE3000611104 /* macho_id.cc in Sources */,
- 9BE650B60B52FE3000611104 /* macho_walker.cc in Sources */,
- 557800400BE1F28500EC23E0 /* macho_utilities.cc in Sources */,
- 8B40BDC00C0638E4009535AF /* logging.cc in Sources */,
- FD8EDEAE0CADDAD400A5EDF1 /* stackwalker_sparc.cc in Sources */,
- FD6625CD0CF4D45C004AC844 /* stackwalker_amd64.cc in Sources */,
- F9C7ECE50E8ABCA600E953AD /* bytereader.cc in Sources */,
- F9C7ECE60E8ABCA600E953AD /* dwarf2reader.cc in Sources */,
- F9C7ECE70E8ABCA600E953AD /* functioninfo.cc in Sources */,
- F9F0706710FBC02D0037B88B /* stackwalker_arm.cc in Sources */,
- D2A5DD4D1188651100081F03 /* cfi_frame_info.cc in Sources */,
- D2A5DD631188658B00081F03 /* tokenize.cc in Sources */,
- 8B31FF2A11F0C62700FCF3E4 /* dwarf_cfi_to_module.cc in Sources */,
- F4D43B2F1A38490700C290B2 /* microdump.cc in Sources */,
- 8B31FF2B11F0C62700FCF3E4 /* dwarf_cu_to_module.cc in Sources */,
- F44DDD8819C85CD50047280E /* dump_object.cc in Sources */,
- 8B31FF2C11F0C62700FCF3E4 /* dwarf_line_to_module.cc in Sources */,
- 8B31FF4111F0C64400FCF3E4 /* stabs_reader.cc in Sources */,
- 8B31FF4211F0C64400FCF3E4 /* stabs_to_module.cc in Sources */,
- 8B31FF7411F0C6E000FCF3E4 /* macho_reader.cc in Sources */,
- 8B31FF8811F0C6FB00FCF3E4 /* language.cc in Sources */,
- 8B31FF8911F0C6FB00FCF3E4 /* module.cc in Sources */,
- 8B31FFC511F0C8AB00FCF3E4 /* dwarf2diehandler.cc in Sources */,
- F407DC49185773C10064622B /* stack_frame_symbolizer.cc in Sources */,
- 4D2C721B126F9ACC00B43EAF /* source_line_resolver_base.cc in Sources */,
- 4D2C721F126F9ADE00B43EAF /* exploitability.cc in Sources */,
- 4D2C7223126F9AF900B43EAF /* exploitability_win.cc in Sources */,
- 4D2C7227126F9B0F00B43EAF /* disassembler_x86.cc in Sources */,
- F407DC48185773C10064622B /* exploitability_linux.cc in Sources */,
- 4D2C722B126F9B5A00B43EAF /* x86_disasm.c in Sources */,
- 4D2C722D126F9B6E00B43EAF /* x86_misc.c in Sources */,
- 4D2C722F126F9B8300B43EAF /* x86_operand_list.c in Sources */,
- F407DC4A185773C10064622B /* stackwalker_arm64.cc in Sources */,
- 4D2C7233126F9BB000B43EAF /* ia32_invariant.c in Sources */,
- 4D2C7235126F9BC200B43EAF /* ia32_settings.c in Sources */,
- 4D2C7246126F9C0B00B43EAF /* ia32_insn.c in Sources */,
- 4D2C724A126F9C2300B43EAF /* ia32_opcode_tables.c in Sources */,
- 4D2C724C126F9C3800B43EAF /* ia32_implicit.c in Sources */,
- F44DDD8919C85CD50047280E /* microdump_processor.cc in Sources */,
- 4D2C724E126F9C4D00B43EAF /* ia32_reg.c in Sources */,
- 4D2C725B126F9C8000B43EAF /* ia32_operand.c in Sources */,
- F407DC4C185773C10064622B /* stackwalker_ppc64.cc in Sources */,
- 4D2C725D126F9C9200B43EAF /* x86_insn.c in Sources */,
- 4D2C7264126F9CBB00B43EAF /* ia32_modrm.c in Sources */,
- F407DC4B185773C10064622B /* stackwalker_mips.cc in Sources */,
- 4D2C726D126F9CDC00B43EAF /* x86_imm.c in Sources */,
- 4D72CA5713DFBA84006CABE3 /* md5.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB927508733DD40010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../../../../src;
- PRODUCT_NAME = crash_report;
- };
- name = Debug;
- };
- 1DEB927608733DD40010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../../../../src;
- PRODUCT_NAME = crash_report;
- };
- name = Release;
- };
- 1DEB927908733DD40010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B3102DA11F0D65600FCF3E4 /* BreakpadDebug.xcconfig */;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
- GCC_TREAT_WARNINGS_AS_ERRORS = NO;
- };
- name = Debug;
- };
- 1DEB927A08733DD40010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B3102DB11F0D65600FCF3E4 /* BreakpadRelease.xcconfig */;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "crash_report" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB927508733DD40010E9CD /* Debug */,
- 1DEB927608733DD40010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "crash_report" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB927908733DD40010E9CD /* Debug */,
- 1DEB927A08733DD40010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h
deleted file mode 100644
index 3fbe108ebd..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// on_demand_symbol_supplier.h: Provides a Symbol Supplier that will create
-// a breakpad symbol file on demand.
-
-#ifndef TOOLS_MAC_CRASH_REPORT_ON_DEMAND_SYMBOL_SUPPLIER_H__
-#define TOOLS_MAC_CRASH_REPORT_ON_DEMAND_SYMBOL_SUPPLIER_H__
-
-#include <map>
-#include <string>
-#include "google_breakpad/processor/symbol_supplier.h"
-
-namespace google_breakpad {
-
-using std::map;
-using std::string;
-class MinidumpModule;
-
-class OnDemandSymbolSupplier : public SymbolSupplier {
- public:
- // |search_dir| is the directory to search for alternative symbols with
- // the same name as the module in the minidump
- OnDemandSymbolSupplier(const string &search_dir,
- const string &symbol_search_dir);
- virtual ~OnDemandSymbolSupplier() {}
-
- // Returns the path to the symbol file for the given module.
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file);
-
- // Returns the path to the symbol file for the given module.
- virtual SymbolResult GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data);
- // Allocates data buffer on heap, and takes the ownership of
- // the data buffer.
- virtual SymbolResult GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size);
-
- // Delete the data buffer allocated for module in GetCStringSymbolData().
- virtual void FreeSymbolData(const CodeModule *module);
-
- protected:
- // Search directory
- string search_dir_;
- string symbol_search_dir_;
-
- // When we create a symbol file for a module, save the name of the module
- // and the path to that module's symbol file.
- map<string, string> module_file_map_;
-
- // Map of allocated data buffers, keyed by module->code_file().
- map<string, char *> memory_buffers_;
-
- // Return the name for |module| This will be the value used as the key
- // to the |module_file_map_|.
- string GetNameForModule(const CodeModule *module);
-
- // Find the module on local system. If the module resides in a different
- // location than the full path in the minidump, this will be the location
- // used.
- string GetLocalModulePath(const CodeModule *module);
-
- // Return the full path for |module|.
- string GetModulePath(const CodeModule *module);
-
- // Return the path to the symbol file for |module|. If an empty string is
- // returned, then |module| doesn't have a symbol file.
- string GetModuleSymbolFile(const CodeModule *module);
-
- // Generate the breakpad symbol file for |module|. Return true if successful.
- // File is generated in /tmp.
- bool GenerateSymbolFile(const CodeModule *module,
- const SystemInfo *system_info);
-};
-
-} // namespace google_breakpad
-
-#endif // TOOLS_MAC_CRASH_REPORT_ON_DEMAND_SYMBOL_SUPPLIER_H__
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm b/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
deleted file mode 100644
index ebbca87a05..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/crash_report/on_demand_symbol_supplier.mm
+++ /dev/null
@@ -1,316 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <sys/stat.h>
-#include <map>
-#include <string>
-#include <iostream>
-#include <fstream>
-#include <utility>
-
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/system_info.h"
-#include "processor/pathname_stripper.h"
-
-#include "on_demand_symbol_supplier.h"
-#include "common/mac/dump_syms.h"
-
-using std::map;
-using std::string;
-
-using google_breakpad::OnDemandSymbolSupplier;
-using google_breakpad::PathnameStripper;
-using google_breakpad::SymbolSupplier;
-using google_breakpad::SystemInfo;
-
-OnDemandSymbolSupplier::OnDemandSymbolSupplier(const string &search_dir,
- const string &symbol_search_dir)
- : search_dir_(search_dir) {
- NSFileManager *mgr = [NSFileManager defaultManager];
- size_t length = symbol_search_dir.length();
- if (length) {
- // Load all sym files in symbol_search_dir into our module_file_map
- // A symbol file always starts with a line like this:
- // MODULE mac x86 BBF0A8F9BEADDD2048E6464001CA193F0 GoogleDesktopDaemon
- // or
- // MODULE mac ppc BBF0A8F9BEADDD2048E6464001CA193F0 GoogleDesktopDaemon
- const char *symbolSearchStr = symbol_search_dir.c_str();
- NSString *symbolSearchPath =
- [mgr stringWithFileSystemRepresentation:symbolSearchStr
- length:strlen(symbolSearchStr)];
- NSDirectoryEnumerator *dirEnum = [mgr enumeratorAtPath:symbolSearchPath];
- NSString *fileName;
- NSCharacterSet *hexSet =
- [NSCharacterSet characterSetWithCharactersInString:@"0123456789ABCDEF"];
- NSCharacterSet *newlineSet =
- [NSCharacterSet characterSetWithCharactersInString:@"\r\n"];
- while ((fileName = [dirEnum nextObject])) {
- // Check to see what type of file we have
- NSDictionary *attrib = [dirEnum fileAttributes];
- NSString *fileType = [attrib objectForKey:NSFileType];
- if ([fileType isEqualToString:NSFileTypeDirectory]) {
- // Skip subdirectories
- [dirEnum skipDescendents];
- } else {
- NSString *filePath = [symbolSearchPath stringByAppendingPathComponent:fileName];
- NSString *dataStr = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL];
- if (dataStr) {
- // Check file to see if it is of appropriate type, and grab module
- // name.
- NSScanner *scanner = [NSScanner scannerWithString:dataStr];
- BOOL goodScan = [scanner scanString:@"MODULE mac " intoString:nil];
- if (goodScan) {
- goodScan = ([scanner scanString:@"x86 " intoString:nil] ||
- [scanner scanString:@"x86_64 " intoString:nil] ||
- [scanner scanString:@"ppc " intoString:nil]);
- if (goodScan) {
- NSString *moduleID;
- goodScan = [scanner scanCharactersFromSet:hexSet
- intoString:&moduleID];
- if (goodScan) {
- // Module IDs are always 33 chars long
- goodScan = [moduleID length] == 33;
- if (goodScan) {
- NSString *moduleName;
- goodScan = [scanner scanUpToCharactersFromSet:newlineSet
- intoString:&moduleName];
- if (goodScan) {
- goodScan = [moduleName length] > 0;
- if (goodScan) {
- const char *moduleNameStr = [moduleName UTF8String];
- const char *filePathStr = [filePath fileSystemRepresentation];
- // Map our file
- module_file_map_[moduleNameStr] = filePathStr;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
-}
-
-SymbolSupplier::SymbolResult
-OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file) {
- string path(GetModuleSymbolFile(module));
-
- if (path.empty()) {
- if (!GenerateSymbolFile(module, system_info))
- return NOT_FOUND;
-
- path = GetModuleSymbolFile(module);
- }
-
- if (path.empty())
- return NOT_FOUND;
-
- *symbol_file = path;
- return FOUND;
-}
-
-SymbolSupplier::SymbolResult
-OnDemandSymbolSupplier::GetSymbolFile(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- string *symbol_data) {
- SymbolSupplier::SymbolResult s = GetSymbolFile(module,
- system_info,
- symbol_file);
-
-
- if (s == FOUND) {
- std::ifstream in(symbol_file->c_str());
- getline(in, *symbol_data, std::string::traits_type::to_char_type(
- std::string::traits_type::eof()));
- in.close();
- }
-
- return s;
-}
-
-SymbolSupplier::SymbolResult
-OnDemandSymbolSupplier::GetCStringSymbolData(const CodeModule *module,
- const SystemInfo *system_info,
- string *symbol_file,
- char **symbol_data,
- size_t *symbol_data_size) {
- std::string symbol_data_string;
- SymbolSupplier::SymbolResult result = GetSymbolFile(module,
- system_info,
- symbol_file,
- &symbol_data_string);
- if (result == FOUND) {
- *symbol_data_size = symbol_data_string.size() + 1;
- *symbol_data = new char[*symbol_data_size];
- if (*symbol_data == NULL) {
- // Should return INTERRUPT on memory allocation failure.
- return INTERRUPT;
- }
- memcpy(*symbol_data, symbol_data_string.c_str(), symbol_data_string.size());
- (*symbol_data)[symbol_data_string.size()] = '\0';
- memory_buffers_.insert(make_pair(module->code_file(), *symbol_data));
- }
- return result;
-}
-
-void OnDemandSymbolSupplier::FreeSymbolData(const CodeModule *module) {
- map<string, char *>::iterator it = memory_buffers_.find(module->code_file());
- if (it != memory_buffers_.end()) {
- delete [] it->second;
- memory_buffers_.erase(it);
- }
-}
-
-string OnDemandSymbolSupplier::GetLocalModulePath(const CodeModule *module) {
- NSFileManager *mgr = [NSFileManager defaultManager];
- const char *moduleStr = module->code_file().c_str();
- NSString *modulePath =
- [mgr stringWithFileSystemRepresentation:moduleStr length:strlen(moduleStr)];
- const char *searchStr = search_dir_.c_str();
- NSString *searchDir =
- [mgr stringWithFileSystemRepresentation:searchStr length:strlen(searchStr)];
-
- if ([mgr fileExistsAtPath:modulePath])
- return module->code_file();
-
- // If the module is not found, try to start appending the components to the
- // search string and stop if a file (not dir) is found or all components
- // have been appended
- NSArray *pathComponents = [modulePath componentsSeparatedByString:@"/"];
- size_t count = [pathComponents count];
- NSMutableString *path = [NSMutableString string];
-
- for (size_t i = 0; i < count; ++i) {
- [path setString:searchDir];
-
- for (size_t j = 0; j < i + 1; ++j) {
- size_t idx = count - 1 - i + j;
- [path appendFormat:@"/%@", [pathComponents objectAtIndex:idx]];
- }
-
- BOOL isDir;
- if ([mgr fileExistsAtPath:path isDirectory:&isDir] && (!isDir)) {
- return [path fileSystemRepresentation];
- }
- }
-
- return "";
-}
-
-string OnDemandSymbolSupplier::GetModulePath(const CodeModule *module) {
- return module->code_file();
-}
-
-string OnDemandSymbolSupplier::GetNameForModule(const CodeModule *module) {
- return PathnameStripper::File(module->code_file());
-}
-
-string OnDemandSymbolSupplier::GetModuleSymbolFile(const CodeModule *module) {
- string name(GetNameForModule(module));
- map<string, string>::iterator result = module_file_map_.find(name);
-
- return (result == module_file_map_.end()) ? "" : (*result).second;
-}
-
-static float GetFileModificationTime(const char *path) {
- float result = 0;
- struct stat file_stat;
- if (stat(path, &file_stat) == 0)
- result = (float)file_stat.st_mtimespec.tv_sec +
- (float)file_stat.st_mtimespec.tv_nsec / 1.0e9f;
-
- return result;
-}
-
-bool OnDemandSymbolSupplier::GenerateSymbolFile(const CodeModule *module,
- const SystemInfo *system_info) {
- bool result = true;
- string name = GetNameForModule(module);
- string module_path = GetLocalModulePath(module);
- NSString *symbol_path = [NSString stringWithFormat:@"/tmp/%s.%s.sym",
- name.c_str(), system_info->cpu.c_str()];
-
- if (module_path.empty())
- return false;
-
- // Check if there's already a symbol file cached. Ensure that the file is
- // newer than the module. Otherwise, generate a new one.
- BOOL generate_file = YES;
- if ([[NSFileManager defaultManager] fileExistsAtPath:symbol_path]) {
- // Check if the module file is newer than the saved symbols
- float cache_time =
- GetFileModificationTime([symbol_path fileSystemRepresentation]);
- float module_time =
- GetFileModificationTime(module_path.c_str());
-
- if (cache_time > module_time)
- generate_file = NO;
- }
-
- if (generate_file) {
- NSString *module_str = [[NSFileManager defaultManager]
- stringWithFileSystemRepresentation:module_path.c_str()
- length:module_path.length()];
- DumpSymbols dump(ALL_SYMBOL_DATA, false);
- if (dump.Read(module_str)) {
- // What Breakpad calls "x86" should be given to the system as "i386".
- std::string architecture;
- if (system_info->cpu.compare("x86") == 0) {
- architecture = "i386";
- } else {
- architecture = system_info->cpu;
- }
-
- if (dump.SetArchitecture(architecture)) {
- std::fstream file([symbol_path fileSystemRepresentation],
- std::ios_base::out | std::ios_base::trunc);
- dump.WriteSymbolFile(file);
- } else {
- printf("Architecture %s not available for %s\n",
- system_info->cpu.c_str(), name.c_str());
- result = false;
- }
- } else {
- printf("Unable to open %s\n", [module_str UTF8String]);
- result = false;
- }
- }
-
- // Add the mapping
- if (result)
- module_file_map_[name] = [symbol_path fileSystemRepresentation];
-
- return result;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj
deleted file mode 100644
index 2e6bd9e102..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,1839 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 45;
- objects = {
-
-/* Begin PBXAggregateTarget section */
- B88FAFC9116BDCAD00407530 /* all_unittests */ = {
- isa = PBXAggregateTarget;
- buildConfigurationList = B88FAFCC116BDCCC00407530 /* Build configuration list for PBXAggregateTarget "all_unittests" */;
- buildPhases = (
- B88FB094116CE73E00407530 /* ShellScript */,
- );
- dependencies = (
- B88FB15B116CF53E00407530 /* PBXTargetDependency */,
- B88FAFCF116BDD7000407530 /* PBXTargetDependency */,
- B88FB01D116BDF9800407530 /* PBXTargetDependency */,
- B88FB167116CF54B00407530 /* PBXTargetDependency */,
- B88FAFD1116BDD7000407530 /* PBXTargetDependency */,
- B88FB165116CF54B00407530 /* PBXTargetDependency */,
- B88FB161116CF54B00407530 /* PBXTargetDependency */,
- B88FB15F116CF54B00407530 /* PBXTargetDependency */,
- B88FB15D116CF54B00407530 /* PBXTargetDependency */,
- B84A9201116CF7D2006C210E /* PBXTargetDependency */,
- B88FB0C8116CEB4A00407530 /* PBXTargetDependency */,
- 8B31051511F100CF00FCF3E4 /* PBXTargetDependency */,
- );
- name = all_unittests;
- productName = all_unittests;
- };
-/* End PBXAggregateTarget section */
-
-/* Begin PBXBuildFile section */
- 162F64FA161C591500CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F8161C591500CD68D5 /* arch_utilities.cc */; };
- 162F6500161C5F2200CD68D5 /* arch_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 162F64F8161C591500CD68D5 /* arch_utilities.cc */; };
- 4D72CAF513DFBAC2006CABE3 /* md5.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D72CAF413DFBAC2006CABE3 /* md5.cc */; };
- 8BCAAA4C1CE3A7980046090B /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */; };
- 8BCAAA4D1CE3B1260046090B /* elf_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */; };
- B84A91F8116CF78F006C210E /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B84A91FB116CF7AF006C210E /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
- B84A91FC116CF7AF006C210E /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE3C11666C8900407530 /* stabs_to_module.cc */; };
- B84A91FD116CF7AF006C210E /* stabs_to_module_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D8116CEC0600407530 /* stabs_to_module_unittest.cc */; };
- B88FAE1911665FE400407530 /* dwarf2diehandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE1711665FE400407530 /* dwarf2diehandler.cc */; };
- B88FAE261166603300407530 /* dwarf_cu_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE1E1166603300407530 /* dwarf_cu_to_module.cc */; };
- B88FAE271166603300407530 /* dwarf_line_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE201166603300407530 /* dwarf_line_to_module.cc */; };
- B88FAE281166603300407530 /* language.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE221166603300407530 /* language.cc */; };
- B88FAE291166603300407530 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
- B88FAE2C1166606200407530 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E6E1166571D00DD08C9 /* macho_reader.cc */; };
- B88FAE351166673E00407530 /* dwarf_cfi_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE331166673E00407530 /* dwarf_cfi_to_module.cc */; };
- B88FAE3B11666C6F00407530 /* stabs_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE3911666C6F00407530 /* stabs_reader.cc */; };
- B88FAE3E11666C8900407530 /* stabs_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE3C11666C8900407530 /* stabs_to_module.cc */; };
- B88FAF37116A595400407530 /* cfi_assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAF34116A595400407530 /* cfi_assembler.cc */; };
- B88FAF38116A595400407530 /* dwarf2reader_cfi_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAF36116A595400407530 /* dwarf2reader_cfi_unittest.cc */; };
- B88FAF3F116A5A2E00407530 /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F95B422F0E0E22D100DBDE83 /* dwarf2reader.cc */; };
- B88FAF40116A5A2E00407530 /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F95B422C0E0E22D100DBDE83 /* bytereader.cc */; };
- B88FB00F116BDEA700407530 /* stabs_reader_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB003116BDE7200407530 /* stabs_reader_unittest.cc */; };
- B88FB010116BDEA700407530 /* stabs_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE3911666C6F00407530 /* stabs_reader.cc */; };
- B88FB028116BE03100407530 /* test_assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE0911665B5700407530 /* test_assembler.cc */; };
- B88FB029116BE03100407530 /* gmock-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0EA311665AEA00DD08C9 /* gmock-all.cc */; };
- B88FB02A116BE03100407530 /* gtest_main.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E9F11665AC300DD08C9 /* gtest_main.cc */; };
- B88FB02B116BE03100407530 /* gtest-all.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0EA011665AC300DD08C9 /* gtest-all.cc */; };
- B88FB03F116BE24200407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB042116BE3C400407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB057116C0CDE00407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB0BD116CEAE000407530 /* module_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0B5116CEA8A00407530 /* module_unittest.cc */; };
- B88FB0C1116CEB0600407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB0C4116CEB4100407530 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
- B88FB0E3116CEEB000407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB0E5116CEED300407530 /* dwarf2diehandler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE1711665FE400407530 /* dwarf2diehandler.cc */; };
- B88FB0E6116CEED300407530 /* dwarf2diehandler_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0DB116CEC5800407530 /* dwarf2diehandler_unittest.cc */; };
- B88FB0F6116CEF2000407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB0FA116CF00E00407530 /* dwarf_line_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE201166603300407530 /* dwarf_line_to_module.cc */; };
- B88FB0FB116CF00E00407530 /* dwarf_line_to_module_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D7116CEC0600407530 /* dwarf_line_to_module_unittest.cc */; };
- B88FB0FE116CF02400407530 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
- B88FB10E116CF08100407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB112116CF1F000407530 /* dwarf_cu_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE1E1166603300407530 /* dwarf_cu_to_module.cc */; };
- B88FB113116CF1F000407530 /* dwarf_cu_to_module_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D6116CEC0600407530 /* dwarf_cu_to_module_unittest.cc */; };
- B88FB114116CF1F000407530 /* language.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE221166603300407530 /* language.cc */; };
- B88FB115116CF1F000407530 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
- B88FB123116CF28500407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB129116CF2DD00407530 /* module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE241166603300407530 /* module.cc */; };
- B88FB12A116CF2DD00407530 /* dwarf_cfi_to_module.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE331166673E00407530 /* dwarf_cfi_to_module.cc */; };
- B88FB12B116CF2DD00407530 /* dwarf_cfi_to_module_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D5116CEC0600407530 /* dwarf_cfi_to_module_unittest.cc */; };
- B88FB139116CF31600407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB13D116CF38300407530 /* cfi_assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAF34116A595400407530 /* cfi_assembler.cc */; };
- B88FB13E116CF38300407530 /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F95B422C0E0E22D100DBDE83 /* bytereader.cc */; };
- B88FB13F116CF38300407530 /* bytereader_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0DA116CEC5800407530 /* bytereader_unittest.cc */; };
- B88FB14F116CF4AE00407530 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- B88FB152116CF4D300407530 /* byte_cursor_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D4116CEC0600407530 /* byte_cursor_unittest.cc */; };
- B89E0E781166576C00DD08C9 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E6E1166571D00DD08C9 /* macho_reader.cc */; };
- B89E0E7A1166576C00DD08C9 /* macho_dump.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E701166573700DD08C9 /* macho_dump.cc */; };
- B89E0E9911665A7200DD08C9 /* macho_reader_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E6D1166571D00DD08C9 /* macho_reader_unittest.cc */; };
- B89E0E9A11665A7200DD08C9 /* macho_reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = B89E0E6E1166571D00DD08C9 /* macho_reader.cc */; };
- B8C5B5171166534700D34F4E /* dwarf2reader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F95B422F0E0E22D100DBDE83 /* dwarf2reader.cc */; };
- B8C5B5181166534700D34F4E /* bytereader.cc in Sources */ = {isa = PBXBuildFile; fileRef = F95B422C0E0E22D100DBDE83 /* bytereader.cc */; };
- B8C5B5191166534700D34F4E /* macho_utilities.cc in Sources */ = {isa = PBXBuildFile; fileRef = 557800890BE1F3AB00EC23E0 /* macho_utilities.cc */; };
- B8C5B51A1166534700D34F4E /* file_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650410B52F6D800611104 /* file_id.cc */; };
- B8C5B51B1166534700D34F4E /* macho_id.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650430B52F6D800611104 /* macho_id.cc */; };
- B8C5B51C1166534700D34F4E /* macho_walker.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BE650450B52F6D800611104 /* macho_walker.cc */; };
- B8C5B51D1166534700D34F4E /* dump_syms.cc in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* dump_syms.cc */; };
- B8C5B51E1166534700D34F4E /* dump_syms_tool.cc in Sources */ = {isa = PBXBuildFile; fileRef = 9BDF186E0B1BB43700F8391B /* dump_syms_tool.cc */; };
- B8C5B523116653BA00D34F4E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
- D21F97D711CBA12300239E38 /* test_assembler_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FB0D9116CEC0600407530 /* test_assembler_unittest.cc */; };
- D21F97D811CBA13D00239E38 /* libgtestmockall.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B88FB024116BDFFF00407530 /* libgtestmockall.a */; };
- D21F97E911CBA1FF00239E38 /* test_assembler.cc in Sources */ = {isa = PBXBuildFile; fileRef = B88FAE0911665B5700407530 /* test_assembler.cc */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 8B31051411F100CF00FCF3E4 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = D21F97D111CBA0F200239E38;
- remoteInfo = test_assembler_unittest;
- };
- B84A91F9116CF796006C210E /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B84A9200116CF7D2006C210E /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B84A91F3116CF784006C210E;
- remoteInfo = stabs_to_module_unittest;
- };
- B88FAFCE116BDD7000407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B89E0E9411665A6400DD08C9;
- remoteInfo = macho_reader_unittest;
- };
- B88FAFD0116BDD7000407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FAF2E116A591D00407530;
- remoteInfo = dwarf2reader_cfi_unittest;
- };
- B88FB01C116BDF9800407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB006116BDE8300407530;
- remoteInfo = stabs_reader_unittest;
- };
- B88FB039116BE17E00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB087116CE6D800407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB08F116CE71000407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB0BF116CEAFE00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB0C7116CEB4A00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB0B8116CEABF00407530;
- remoteInfo = module_unittest;
- };
- B88FB0E7116CEEDA00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB0F7116CEF2E00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB10F116CF08A00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB124116CF29E00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB13B116CF35C00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB150116CF4C100407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB023116BDFFF00407530;
- remoteInfo = gtestmockall;
- };
- B88FB15A116CF53E00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB14A116CF4A700407530;
- remoteInfo = byte_cursor_unittest;
- };
- B88FB15C116CF54B00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB11E116CF27F00407530;
- remoteInfo = dwarf_cfi_to_module_unittest;
- };
- B88FB15E116CF54B00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB0F1116CEF1900407530;
- remoteInfo = dwarf_line_to_module_unittest;
- };
- B88FB160116CF54B00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB109116CF07900407530;
- remoteInfo = dwarf_cu_to_module_unittest;
- };
- B88FB164116CF54B00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB0DE116CEEA800407530;
- remoteInfo = dwarf2diehandler_unittest;
- };
- B88FB166116CF54B00407530 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 08FB7793FE84155DC02AAC07 /* Project object */;
- proxyType = 1;
- remoteGlobalIDString = B88FB134116CF30F00407530;
- remoteInfo = bytereader_unittest;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXFileReference section */
- 08FB7796FE84155DC02AAC07 /* dump_syms.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = dump_syms.cc; path = ../../../common/mac/dump_syms.cc; sourceTree = "<group>"; };
- 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 162F64F8161C591500CD68D5 /* arch_utilities.cc */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = arch_utilities.cc; path = ../../../common/mac/arch_utilities.cc; sourceTree = "<group>"; };
- 162F64F9161C591500CD68D5 /* arch_utilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arch_utilities.h; path = ../../../common/mac/arch_utilities.h; sourceTree = "<group>"; };
- 4D72CAF413DFBAC2006CABE3 /* md5.cc */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.cc; path = ../../../common/md5.cc; sourceTree = SOURCE_ROOT; };
- 557800890BE1F3AB00EC23E0 /* macho_utilities.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_utilities.cc; path = ../../../common/mac/macho_utilities.cc; sourceTree = SOURCE_ROOT; };
- 5578008A0BE1F3AB00EC23E0 /* macho_utilities.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_utilities.h; path = ../../../common/mac/macho_utilities.h; sourceTree = SOURCE_ROOT; };
- 8B31023E11F0CF1C00FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
- 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = elf_reader.cc; path = ../../../common/dwarf/elf_reader.cc; sourceTree = "<group>"; };
- 8BCAAA4B1CE3A7980046090B /* elf_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = elf_reader.h; path = ../../../common/dwarf/elf_reader.h; sourceTree = "<group>"; };
- 9BDF186D0B1BB43700F8391B /* dump_syms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dump_syms.h; path = ../../../common/mac/dump_syms.h; sourceTree = "<group>"; };
- 9BDF186E0B1BB43700F8391B /* dump_syms_tool.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = dump_syms_tool.cc; sourceTree = "<group>"; };
- 9BE650410B52F6D800611104 /* file_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = file_id.cc; path = ../../../common/mac/file_id.cc; sourceTree = SOURCE_ROOT; };
- 9BE650420B52F6D800611104 /* file_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = file_id.h; path = ../../../common/mac/file_id.h; sourceTree = SOURCE_ROOT; };
- 9BE650430B52F6D800611104 /* macho_id.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_id.cc; path = ../../../common/mac/macho_id.cc; sourceTree = SOURCE_ROOT; };
- 9BE650440B52F6D800611104 /* macho_id.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_id.h; path = ../../../common/mac/macho_id.h; sourceTree = SOURCE_ROOT; };
- 9BE650450B52F6D800611104 /* macho_walker.cc */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = macho_walker.cc; path = ../../../common/mac/macho_walker.cc; sourceTree = SOURCE_ROOT; };
- 9BE650460B52F6D800611104 /* macho_walker.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = macho_walker.h; path = ../../../common/mac/macho_walker.h; sourceTree = SOURCE_ROOT; };
- B84A91F4116CF784006C210E /* stabs_to_module_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = stabs_to_module_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FAE0911665B5700407530 /* test_assembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = test_assembler.cc; path = ../../../common/test_assembler.cc; sourceTree = SOURCE_ROOT; };
- B88FAE0A11665B5700407530 /* test_assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = test_assembler.h; path = ../../../common/test_assembler.h; sourceTree = SOURCE_ROOT; };
- B88FAE1711665FE400407530 /* dwarf2diehandler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2diehandler.cc; path = ../../../common/dwarf/dwarf2diehandler.cc; sourceTree = SOURCE_ROOT; };
- B88FAE1811665FE400407530 /* dwarf2diehandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf2diehandler.h; path = ../../../common/dwarf/dwarf2diehandler.h; sourceTree = SOURCE_ROOT; };
- B88FAE1D1166603300407530 /* byte_cursor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = byte_cursor.h; path = ../../../common/byte_cursor.h; sourceTree = SOURCE_ROOT; };
- B88FAE1E1166603300407530 /* dwarf_cu_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cu_to_module.cc; path = ../../../common/dwarf_cu_to_module.cc; sourceTree = SOURCE_ROOT; };
- B88FAE1F1166603300407530 /* dwarf_cu_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cu_to_module.h; path = ../../../common/dwarf_cu_to_module.h; sourceTree = SOURCE_ROOT; };
- B88FAE201166603300407530 /* dwarf_line_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_line_to_module.cc; path = ../../../common/dwarf_line_to_module.cc; sourceTree = SOURCE_ROOT; };
- B88FAE211166603300407530 /* dwarf_line_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_line_to_module.h; path = ../../../common/dwarf_line_to_module.h; sourceTree = SOURCE_ROOT; };
- B88FAE221166603300407530 /* language.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = language.cc; path = ../../../common/language.cc; sourceTree = SOURCE_ROOT; };
- B88FAE231166603300407530 /* language.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = language.h; path = ../../../common/language.h; sourceTree = SOURCE_ROOT; };
- B88FAE241166603300407530 /* module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module.cc; path = ../../../common/module.cc; sourceTree = SOURCE_ROOT; };
- B88FAE251166603300407530 /* module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = module.h; path = ../../../common/module.h; sourceTree = SOURCE_ROOT; };
- B88FAE331166673E00407530 /* dwarf_cfi_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cfi_to_module.cc; path = ../../../common/dwarf_cfi_to_module.cc; sourceTree = SOURCE_ROOT; };
- B88FAE341166673E00407530 /* dwarf_cfi_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf_cfi_to_module.h; path = ../../../common/dwarf_cfi_to_module.h; sourceTree = SOURCE_ROOT; };
- B88FAE3911666C6F00407530 /* stabs_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_reader.cc; path = ../../../common/stabs_reader.cc; sourceTree = SOURCE_ROOT; };
- B88FAE3A11666C6F00407530 /* stabs_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_reader.h; path = ../../../common/stabs_reader.h; sourceTree = SOURCE_ROOT; };
- B88FAE3C11666C8900407530 /* stabs_to_module.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_to_module.cc; path = ../../../common/stabs_to_module.cc; sourceTree = SOURCE_ROOT; };
- B88FAE3D11666C8900407530 /* stabs_to_module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stabs_to_module.h; path = ../../../common/stabs_to_module.h; sourceTree = SOURCE_ROOT; };
- B88FAF2F116A591E00407530 /* dwarf2reader_cfi_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dwarf2reader_cfi_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FAF34116A595400407530 /* cfi_assembler.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = cfi_assembler.cc; path = ../../../common/dwarf/cfi_assembler.cc; sourceTree = SOURCE_ROOT; };
- B88FAF35116A595400407530 /* cfi_assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cfi_assembler.h; path = ../../../common/dwarf/cfi_assembler.h; sourceTree = SOURCE_ROOT; };
- B88FAF36116A595400407530 /* dwarf2reader_cfi_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader_cfi_unittest.cc; path = ../../../common/dwarf/dwarf2reader_cfi_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB003116BDE7200407530 /* stabs_reader_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_reader_unittest.cc; path = ../../../common/stabs_reader_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB007116BDE8300407530 /* stabs_reader_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = stabs_reader_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB024116BDFFF00407530 /* libgtestmockall.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libgtestmockall.a; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB0B5116CEA8A00407530 /* module_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = module_unittest.cc; path = ../../../common/module_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0B9116CEABF00407530 /* module_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = module_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB0D4116CEC0600407530 /* byte_cursor_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = byte_cursor_unittest.cc; path = ../../../common/byte_cursor_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0D5116CEC0600407530 /* dwarf_cfi_to_module_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cfi_to_module_unittest.cc; path = ../../../common/dwarf_cfi_to_module_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0D6116CEC0600407530 /* dwarf_cu_to_module_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_cu_to_module_unittest.cc; path = ../../../common/dwarf_cu_to_module_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0D7116CEC0600407530 /* dwarf_line_to_module_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf_line_to_module_unittest.cc; path = ../../../common/dwarf_line_to_module_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0D8116CEC0600407530 /* stabs_to_module_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = stabs_to_module_unittest.cc; path = ../../../common/stabs_to_module_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0D9116CEC0600407530 /* test_assembler_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = test_assembler_unittest.cc; path = ../../../common/test_assembler_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0DA116CEC5800407530 /* bytereader_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader_unittest.cc; path = ../../../common/dwarf/bytereader_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0DB116CEC5800407530 /* dwarf2diehandler_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2diehandler_unittest.cc; path = ../../../common/dwarf/dwarf2diehandler_unittest.cc; sourceTree = SOURCE_ROOT; };
- B88FB0DF116CEEA800407530 /* dwarf2diehandler_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dwarf2diehandler_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB0F2116CEF1900407530 /* dwarf_line_to_module_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dwarf_line_to_module_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB10A116CF07900407530 /* dwarf_cu_to_module_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dwarf_cu_to_module_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB11F116CF27F00407530 /* dwarf_cfi_to_module_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dwarf_cfi_to_module_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB135116CF30F00407530 /* bytereader_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = bytereader_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B88FB14B116CF4A700407530 /* byte_cursor_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = byte_cursor_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B89E0E6D1166571D00DD08C9 /* macho_reader_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader_unittest.cc; path = ../../../common/mac/macho_reader_unittest.cc; sourceTree = SOURCE_ROOT; };
- B89E0E6E1166571D00DD08C9 /* macho_reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = macho_reader.cc; path = ../../../common/mac/macho_reader.cc; sourceTree = SOURCE_ROOT; };
- B89E0E6F1166571D00DD08C9 /* macho_reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macho_reader.h; path = ../../../common/mac/macho_reader.h; sourceTree = SOURCE_ROOT; };
- B89E0E701166573700DD08C9 /* macho_dump.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = macho_dump.cc; sourceTree = "<group>"; };
- B89E0E741166575200DD08C9 /* macho_dump */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = macho_dump; sourceTree = BUILT_PRODUCTS_DIR; };
- B89E0E9511665A6400DD08C9 /* macho_reader_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = macho_reader_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- B89E0E9F11665AC300DD08C9 /* gtest_main.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = gtest_main.cc; path = ../../../testing/gtest/src/gtest_main.cc; sourceTree = SOURCE_ROOT; };
- B89E0EA011665AC300DD08C9 /* gtest-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gtest-all.cc"; path = "../../../testing/gtest/src/gtest-all.cc"; sourceTree = SOURCE_ROOT; };
- B89E0EA311665AEA00DD08C9 /* gmock-all.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "gmock-all.cc"; path = "../../../testing/src/gmock-all.cc"; sourceTree = SOURCE_ROOT; };
- B8C5B5111166531A00D34F4E /* dump_syms */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = dump_syms; sourceTree = BUILT_PRODUCTS_DIR; };
- B8E8CA0C1156C854009E61B2 /* byteswap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = byteswap.h; path = ../../../common/mac/byteswap.h; sourceTree = SOURCE_ROOT; };
- D21F97D211CBA0F200239E38 /* test_assembler_unittest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = test_assembler_unittest; sourceTree = BUILT_PRODUCTS_DIR; };
- F95B422B0E0E22D100DBDE83 /* bytereader-inl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "bytereader-inl.h"; path = "../../../common/dwarf/bytereader-inl.h"; sourceTree = SOURCE_ROOT; };
- F95B422C0E0E22D100DBDE83 /* bytereader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = bytereader.cc; path = ../../../common/dwarf/bytereader.cc; sourceTree = SOURCE_ROOT; };
- F95B422D0E0E22D100DBDE83 /* bytereader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = bytereader.h; path = ../../../common/dwarf/bytereader.h; sourceTree = SOURCE_ROOT; };
- F95B422E0E0E22D100DBDE83 /* dwarf2enums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf2enums.h; path = ../../../common/dwarf/dwarf2enums.h; sourceTree = SOURCE_ROOT; };
- F95B422F0E0E22D100DBDE83 /* dwarf2reader.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dwarf2reader.cc; path = ../../../common/dwarf/dwarf2reader.cc; sourceTree = SOURCE_ROOT; };
- F95B42300E0E22D100DBDE83 /* dwarf2reader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf2reader.h; path = ../../../common/dwarf/dwarf2reader.h; sourceTree = SOURCE_ROOT; };
- F95B42310E0E22D100DBDE83 /* line_state_machine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = line_state_machine.h; path = ../../../common/dwarf/line_state_machine.h; sourceTree = SOURCE_ROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- B84A91F2116CF784006C210E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B84A91F8116CF78F006C210E /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FAF2D116A591D00407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB042116BE3C400407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB005116BDE8300407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB03F116BE24200407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB022116BDFFF00407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB0B7116CEABF00407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB0C1116CEB0600407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB0DD116CEEA800407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB0E3116CEEB000407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB0F0116CEF1900407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB0F6116CEF2000407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB108116CF07900407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB10E116CF08100407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB11D116CF27F00407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB123116CF28500407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB133116CF30F00407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB139116CF31600407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB149116CF4A700407530 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB14F116CF4AE00407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B89E0E721166575200DD08C9 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B89E0E9311665A6400DD08C9 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB057116C0CDE00407530 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B8C5B50F1166531A00D34F4E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B8C5B523116653BA00D34F4E /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D21F97D011CBA0F200239E38 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D21F97D811CBA13D00239E38 /* libgtestmockall.a in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* dump_syms */ = {
- isa = PBXGroup;
- children = (
- 8B31023E11F0CF1C00FCF3E4 /* Breakpad.xcconfig */,
- 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */,
- 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */,
- B89E0E9D11665A9500DD08C9 /* TESTING */,
- F9F5344B0E7C8FFC0012363F /* DWARF */,
- B89E0E6C1166569700DD08C9 /* MACHO */,
- B88FAE3811666A1700407530 /* STABS */,
- B88FAE1C11665FFD00407530 /* MODULE */,
- 162F64F8161C591500CD68D5 /* arch_utilities.cc */,
- 162F64F9161C591500CD68D5 /* arch_utilities.h */,
- B88FAE1D1166603300407530 /* byte_cursor.h */,
- B88FB0D4116CEC0600407530 /* byte_cursor_unittest.cc */,
- B8E8CA0C1156C854009E61B2 /* byteswap.h */,
- 9BE650410B52F6D800611104 /* file_id.cc */,
- 9BE650420B52F6D800611104 /* file_id.h */,
- 9BDF186D0B1BB43700F8391B /* dump_syms.h */,
- 08FB7796FE84155DC02AAC07 /* dump_syms.cc */,
- 9BDF186E0B1BB43700F8391B /* dump_syms_tool.cc */,
- B89E0E701166573700DD08C9 /* macho_dump.cc */,
- 4D72CAF413DFBAC2006CABE3 /* md5.cc */,
- 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
- 1AB674ADFE9D54B511CA2CBB /* Products */,
- );
- name = dump_syms;
- sourceTree = "<group>";
- };
- 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
- isa = PBXGroup;
- children = (
- 08FB779EFE84155DC02AAC07 /* Foundation.framework */,
- );
- name = "External Frameworks and Libraries";
- sourceTree = "<group>";
- };
- 1AB674ADFE9D54B511CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- B8C5B5111166531A00D34F4E /* dump_syms */,
- B89E0E741166575200DD08C9 /* macho_dump */,
- B89E0E9511665A6400DD08C9 /* macho_reader_unittest */,
- B88FAF2F116A591E00407530 /* dwarf2reader_cfi_unittest */,
- B88FB007116BDE8300407530 /* stabs_reader_unittest */,
- B88FB024116BDFFF00407530 /* libgtestmockall.a */,
- B88FB0B9116CEABF00407530 /* module_unittest */,
- B88FB0DF116CEEA800407530 /* dwarf2diehandler_unittest */,
- B88FB0F2116CEF1900407530 /* dwarf_line_to_module_unittest */,
- B88FB10A116CF07900407530 /* dwarf_cu_to_module_unittest */,
- B88FB11F116CF27F00407530 /* dwarf_cfi_to_module_unittest */,
- B88FB135116CF30F00407530 /* bytereader_unittest */,
- B88FB14B116CF4A700407530 /* byte_cursor_unittest */,
- B84A91F4116CF784006C210E /* stabs_to_module_unittest */,
- D21F97D211CBA0F200239E38 /* test_assembler_unittest */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- B88FAE1C11665FFD00407530 /* MODULE */ = {
- isa = PBXGroup;
- children = (
- B88FAE1E1166603300407530 /* dwarf_cu_to_module.cc */,
- B88FAE1F1166603300407530 /* dwarf_cu_to_module.h */,
- B88FB0D6116CEC0600407530 /* dwarf_cu_to_module_unittest.cc */,
- B88FAE201166603300407530 /* dwarf_line_to_module.cc */,
- B88FAE211166603300407530 /* dwarf_line_to_module.h */,
- B88FB0D7116CEC0600407530 /* dwarf_line_to_module_unittest.cc */,
- B88FAE221166603300407530 /* language.cc */,
- B88FAE231166603300407530 /* language.h */,
- B88FAE241166603300407530 /* module.cc */,
- B88FAE251166603300407530 /* module.h */,
- B88FB0B5116CEA8A00407530 /* module_unittest.cc */,
- B88FAE331166673E00407530 /* dwarf_cfi_to_module.cc */,
- B88FAE341166673E00407530 /* dwarf_cfi_to_module.h */,
- B88FB0D5116CEC0600407530 /* dwarf_cfi_to_module_unittest.cc */,
- B88FAE3C11666C8900407530 /* stabs_to_module.cc */,
- B88FAE3D11666C8900407530 /* stabs_to_module.h */,
- B88FB0D8116CEC0600407530 /* stabs_to_module_unittest.cc */,
- );
- name = MODULE;
- sourceTree = "<group>";
- };
- B88FAE3811666A1700407530 /* STABS */ = {
- isa = PBXGroup;
- children = (
- B88FB003116BDE7200407530 /* stabs_reader_unittest.cc */,
- B88FAE3911666C6F00407530 /* stabs_reader.cc */,
- B88FAE3A11666C6F00407530 /* stabs_reader.h */,
- );
- name = STABS;
- sourceTree = "<group>";
- };
- B89E0E6C1166569700DD08C9 /* MACHO */ = {
- isa = PBXGroup;
- children = (
- B89E0E6D1166571D00DD08C9 /* macho_reader_unittest.cc */,
- B89E0E6E1166571D00DD08C9 /* macho_reader.cc */,
- B89E0E6F1166571D00DD08C9 /* macho_reader.h */,
- 557800890BE1F3AB00EC23E0 /* macho_utilities.cc */,
- 5578008A0BE1F3AB00EC23E0 /* macho_utilities.h */,
- 9BE650430B52F6D800611104 /* macho_id.cc */,
- 9BE650440B52F6D800611104 /* macho_id.h */,
- 9BE650450B52F6D800611104 /* macho_walker.cc */,
- 9BE650460B52F6D800611104 /* macho_walker.h */,
- );
- name = MACHO;
- sourceTree = "<group>";
- };
- B89E0E9D11665A9500DD08C9 /* TESTING */ = {
- isa = PBXGroup;
- children = (
- B88FAE0911665B5700407530 /* test_assembler.cc */,
- B88FAE0A11665B5700407530 /* test_assembler.h */,
- B88FB0D9116CEC0600407530 /* test_assembler_unittest.cc */,
- B89E0EA311665AEA00DD08C9 /* gmock-all.cc */,
- B89E0E9F11665AC300DD08C9 /* gtest_main.cc */,
- B89E0EA011665AC300DD08C9 /* gtest-all.cc */,
- );
- name = TESTING;
- sourceTree = "<group>";
- };
- F9F5344B0E7C8FFC0012363F /* DWARF */ = {
- isa = PBXGroup;
- children = (
- B88FAF34116A595400407530 /* cfi_assembler.cc */,
- B88FAF35116A595400407530 /* cfi_assembler.h */,
- F95B422E0E0E22D100DBDE83 /* dwarf2enums.h */,
- F95B422F0E0E22D100DBDE83 /* dwarf2reader.cc */,
- F95B42300E0E22D100DBDE83 /* dwarf2reader.h */,
- B88FAF36116A595400407530 /* dwarf2reader_cfi_unittest.cc */,
- F95B422D0E0E22D100DBDE83 /* bytereader.h */,
- F95B422B0E0E22D100DBDE83 /* bytereader-inl.h */,
- F95B422C0E0E22D100DBDE83 /* bytereader.cc */,
- B88FB0DA116CEC5800407530 /* bytereader_unittest.cc */,
- F95B42310E0E22D100DBDE83 /* line_state_machine.h */,
- B88FAE1711665FE400407530 /* dwarf2diehandler.cc */,
- B88FAE1811665FE400407530 /* dwarf2diehandler.h */,
- B88FB0DB116CEC5800407530 /* dwarf2diehandler_unittest.cc */,
- 8BCAAA4A1CE3A7980046090B /* elf_reader.cc */,
- 8BCAAA4B1CE3A7980046090B /* elf_reader.h */,
- );
- name = DWARF;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- B88FB020116BDFFF00407530 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- B84A91F3116CF784006C210E /* stabs_to_module_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B84A9202116CF7F0006C210E /* Build configuration list for PBXNativeTarget "stabs_to_module_unittest" */;
- buildPhases = (
- B84A91F1116CF784006C210E /* Sources */,
- B84A91F2116CF784006C210E /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B84A91FA116CF796006C210E /* PBXTargetDependency */,
- );
- name = stabs_to_module_unittest;
- productName = stabs_to_module_unittest;
- productReference = B84A91F4116CF784006C210E /* stabs_to_module_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FAF2E116A591D00407530 /* dwarf2reader_cfi_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FAF33116A594800407530 /* Build configuration list for PBXNativeTarget "dwarf2reader_cfi_unittest" */;
- buildPhases = (
- B88FAF2C116A591D00407530 /* Sources */,
- B88FAF2D116A591D00407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB03A116BE17E00407530 /* PBXTargetDependency */,
- );
- name = dwarf2reader_cfi_unittest;
- productName = dwarf2reader_cfi_unittest;
- productReference = B88FAF2F116A591E00407530 /* dwarf2reader_cfi_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB006116BDE8300407530 /* stabs_reader_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB013116BDEC800407530 /* Build configuration list for PBXNativeTarget "stabs_reader_unittest" */;
- buildPhases = (
- B88FB004116BDE8300407530 /* Sources */,
- B88FB005116BDE8300407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB088116CE6D800407530 /* PBXTargetDependency */,
- );
- name = stabs_reader_unittest;
- productName = stabs_reader_unittest;
- productReference = B88FB007116BDE8300407530 /* stabs_reader_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB023116BDFFF00407530 /* gtestmockall */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB027116BE02900407530 /* Build configuration list for PBXNativeTarget "gtestmockall" */;
- buildPhases = (
- B88FB020116BDFFF00407530 /* Headers */,
- B88FB021116BDFFF00407530 /* Sources */,
- B88FB022116BDFFF00407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = gtestmockall;
- productName = gtestmockall;
- productReference = B88FB024116BDFFF00407530 /* libgtestmockall.a */;
- productType = "com.apple.product-type.library.static";
- };
- B88FB0B8116CEABF00407530 /* module_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB0BE116CEAFE00407530 /* Build configuration list for PBXNativeTarget "module_unittest" */;
- buildPhases = (
- B88FB0B6116CEABF00407530 /* Sources */,
- B88FB0B7116CEABF00407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB0C0116CEAFE00407530 /* PBXTargetDependency */,
- );
- name = module_unittest;
- productName = module_unittest;
- productReference = B88FB0B9116CEABF00407530 /* module_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB0DE116CEEA800407530 /* dwarf2diehandler_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB0E4116CEECE00407530 /* Build configuration list for PBXNativeTarget "dwarf2diehandler_unittest" */;
- buildPhases = (
- B88FB0DC116CEEA800407530 /* Sources */,
- B88FB0DD116CEEA800407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB0E8116CEEDA00407530 /* PBXTargetDependency */,
- );
- name = dwarf2diehandler_unittest;
- productName = dwarf2diehandler_unittest;
- productReference = B88FB0DF116CEEA800407530 /* dwarf2diehandler_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB0F1116CEF1900407530 /* dwarf_line_to_module_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB0F9116CEF9800407530 /* Build configuration list for PBXNativeTarget "dwarf_line_to_module_unittest" */;
- buildPhases = (
- B88FB0EF116CEF1900407530 /* Sources */,
- B88FB0F0116CEF1900407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB0F8116CEF2E00407530 /* PBXTargetDependency */,
- );
- name = dwarf_line_to_module_unittest;
- productName = dwarf_line_to_module_unittest;
- productReference = B88FB0F2116CEF1900407530 /* dwarf_line_to_module_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB109116CF07900407530 /* dwarf_cu_to_module_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB111116CF0A800407530 /* Build configuration list for PBXNativeTarget "dwarf_cu_to_module_unittest" */;
- buildPhases = (
- B88FB107116CF07900407530 /* Sources */,
- B88FB108116CF07900407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB110116CF08A00407530 /* PBXTargetDependency */,
- );
- name = dwarf_cu_to_module_unittest;
- productName = dwarf_cu_to_module_unittest;
- productReference = B88FB10A116CF07900407530 /* dwarf_cu_to_module_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB11E116CF27F00407530 /* dwarf_cfi_to_module_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB128116CF2C800407530 /* Build configuration list for PBXNativeTarget "dwarf_cfi_to_module_unittest" */;
- buildPhases = (
- B88FB11C116CF27F00407530 /* Sources */,
- B88FB11D116CF27F00407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB125116CF29E00407530 /* PBXTargetDependency */,
- );
- name = dwarf_cfi_to_module_unittest;
- productName = dwarf_cfi_to_module_unittest;
- productReference = B88FB11F116CF27F00407530 /* dwarf_cfi_to_module_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB134116CF30F00407530 /* bytereader_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB13A116CF33400407530 /* Build configuration list for PBXNativeTarget "bytereader_unittest" */;
- buildPhases = (
- B88FB132116CF30F00407530 /* Sources */,
- B88FB133116CF30F00407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB13C116CF35C00407530 /* PBXTargetDependency */,
- );
- name = bytereader_unittest;
- productName = bytereader_unittest;
- productReference = B88FB135116CF30F00407530 /* bytereader_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B88FB14A116CF4A700407530 /* byte_cursor_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B88FB159116CF4F900407530 /* Build configuration list for PBXNativeTarget "byte_cursor_unittest" */;
- buildPhases = (
- B88FB148116CF4A700407530 /* Sources */,
- B88FB149116CF4A700407530 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB151116CF4C100407530 /* PBXTargetDependency */,
- );
- name = byte_cursor_unittest;
- productName = byte_cursor_unittest;
- productReference = B88FB14B116CF4A700407530 /* byte_cursor_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B89E0E731166575200DD08C9 /* macho_dump */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B89E0E7F116657A100DD08C9 /* Build configuration list for PBXNativeTarget "macho_dump" */;
- buildPhases = (
- B89E0E711166575200DD08C9 /* Sources */,
- B89E0E721166575200DD08C9 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = macho_dump;
- productName = macho_dump;
- productReference = B89E0E741166575200DD08C9 /* macho_dump */;
- productType = "com.apple.product-type.tool";
- };
- B89E0E9411665A6400DD08C9 /* macho_reader_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B89E0E9E11665A9600DD08C9 /* Build configuration list for PBXNativeTarget "macho_reader_unittest" */;
- buildPhases = (
- B89E0E9211665A6400DD08C9 /* Sources */,
- B89E0E9311665A6400DD08C9 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- B88FB090116CE71000407530 /* PBXTargetDependency */,
- );
- name = macho_reader_unittest;
- productName = macho_reader_unittest;
- productReference = B89E0E9511665A6400DD08C9 /* macho_reader_unittest */;
- productType = "com.apple.product-type.tool";
- };
- B8C5B5101166531A00D34F4E /* dump_syms */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = B8C5B5151166533900D34F4E /* Build configuration list for PBXNativeTarget "dump_syms" */;
- buildPhases = (
- B8C5B50E1166531A00D34F4E /* Sources */,
- B8C5B50F1166531A00D34F4E /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = dump_syms;
- productName = dump_syms;
- productReference = B8C5B5111166531A00D34F4E /* dump_syms */;
- productType = "com.apple.product-type.tool";
- };
- D21F97D111CBA0F200239E38 /* test_assembler_unittest */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = D21F97D611CBA11000239E38 /* Build configuration list for PBXNativeTarget "test_assembler_unittest" */;
- buildPhases = (
- D21F97CF11CBA0F200239E38 /* Sources */,
- D21F97D011CBA0F200239E38 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = test_assembler_unittest;
- productName = test_assembler_unittest;
- productReference = D21F97D211CBA0F200239E38 /* test_assembler_unittest */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- };
- buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "dump_syms" */;
- compatibilityVersion = "Xcode 3.1";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- );
- mainGroup = 08FB7794FE84155DC02AAC07 /* dump_syms */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- B8C5B5101166531A00D34F4E /* dump_syms */,
- B89E0E731166575200DD08C9 /* macho_dump */,
- B88FB023116BDFFF00407530 /* gtestmockall */,
- B88FB14A116CF4A700407530 /* byte_cursor_unittest */,
- B89E0E9411665A6400DD08C9 /* macho_reader_unittest */,
- B88FB006116BDE8300407530 /* stabs_reader_unittest */,
- B88FB134116CF30F00407530 /* bytereader_unittest */,
- B88FAF2E116A591D00407530 /* dwarf2reader_cfi_unittest */,
- B88FB0DE116CEEA800407530 /* dwarf2diehandler_unittest */,
- B88FB109116CF07900407530 /* dwarf_cu_to_module_unittest */,
- B88FB0F1116CEF1900407530 /* dwarf_line_to_module_unittest */,
- B88FB11E116CF27F00407530 /* dwarf_cfi_to_module_unittest */,
- B84A91F3116CF784006C210E /* stabs_to_module_unittest */,
- B88FB0B8116CEABF00407530 /* module_unittest */,
- B88FAFC9116BDCAD00407530 /* all_unittests */,
- D21F97D111CBA0F200239E38 /* test_assembler_unittest */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXShellScriptBuildPhase section */
- B88FB094116CE73E00407530 /* ShellScript */ = {
- isa = PBXShellScriptBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- inputPaths = (
- );
- outputPaths = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- shellPath = /bin/sh;
- shellScript = "set -eu\n\ncd $BUILT_PRODUCTS_DIR\npwd\n\n./byte_cursor_unittest\n./macho_reader_unittest\n./stabs_reader_unittest\n./bytereader_unittest\n./dwarf2reader_cfi_unittest\n./dwarf2diehandler_unittest\n./dwarf_cu_to_module_unittest\n./dwarf_line_to_module_unittest\n./dwarf_cfi_to_module_unittest\n./stabs_to_module_unittest\n./module_unittest\n./test_assembler_unittest\n\necho \"Expect two warnings from the following tests:\"\necho \" Errors.BadFileNumber\"\necho \" Errors.BadDirectoryNumber\"\necho \"The proper behavior of these tests is to print text that XCode confuses with compiler warnings.\"\n";
- };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- B84A91F1116CF784006C210E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B84A91FB116CF7AF006C210E /* module.cc in Sources */,
- B84A91FC116CF7AF006C210E /* stabs_to_module.cc in Sources */,
- B84A91FD116CF7AF006C210E /* stabs_to_module_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FAF2C116A591D00407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FAF38116A595400407530 /* dwarf2reader_cfi_unittest.cc in Sources */,
- B88FAF3F116A5A2E00407530 /* dwarf2reader.cc in Sources */,
- 8BCAAA4D1CE3B1260046090B /* elf_reader.cc in Sources */,
- B88FAF40116A5A2E00407530 /* bytereader.cc in Sources */,
- B88FAF37116A595400407530 /* cfi_assembler.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB004116BDE8300407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB00F116BDEA700407530 /* stabs_reader_unittest.cc in Sources */,
- B88FB010116BDEA700407530 /* stabs_reader.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB021116BDFFF00407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB028116BE03100407530 /* test_assembler.cc in Sources */,
- B88FB029116BE03100407530 /* gmock-all.cc in Sources */,
- B88FB02A116BE03100407530 /* gtest_main.cc in Sources */,
- B88FB02B116BE03100407530 /* gtest-all.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB0B6116CEABF00407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB0BD116CEAE000407530 /* module_unittest.cc in Sources */,
- B88FB0C4116CEB4100407530 /* module.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB0DC116CEEA800407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB0E5116CEED300407530 /* dwarf2diehandler.cc in Sources */,
- B88FB0E6116CEED300407530 /* dwarf2diehandler_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB0EF116CEF1900407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB0FA116CF00E00407530 /* dwarf_line_to_module.cc in Sources */,
- B88FB0FE116CF02400407530 /* module.cc in Sources */,
- B88FB0FB116CF00E00407530 /* dwarf_line_to_module_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB107116CF07900407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB112116CF1F000407530 /* dwarf_cu_to_module.cc in Sources */,
- B88FB113116CF1F000407530 /* dwarf_cu_to_module_unittest.cc in Sources */,
- B88FB114116CF1F000407530 /* language.cc in Sources */,
- B88FB115116CF1F000407530 /* module.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB11C116CF27F00407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB129116CF2DD00407530 /* module.cc in Sources */,
- B88FB12A116CF2DD00407530 /* dwarf_cfi_to_module.cc in Sources */,
- B88FB12B116CF2DD00407530 /* dwarf_cfi_to_module_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB132116CF30F00407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB13D116CF38300407530 /* cfi_assembler.cc in Sources */,
- B88FB13E116CF38300407530 /* bytereader.cc in Sources */,
- B88FB13F116CF38300407530 /* bytereader_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B88FB148116CF4A700407530 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B88FB152116CF4D300407530 /* byte_cursor_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B89E0E711166575200DD08C9 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 162F6500161C5F2200CD68D5 /* arch_utilities.cc in Sources */,
- B89E0E781166576C00DD08C9 /* macho_reader.cc in Sources */,
- B89E0E7A1166576C00DD08C9 /* macho_dump.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B89E0E9211665A6400DD08C9 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- B89E0E9911665A7200DD08C9 /* macho_reader_unittest.cc in Sources */,
- B89E0E9A11665A7200DD08C9 /* macho_reader.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- B8C5B50E1166531A00D34F4E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 162F64FA161C591500CD68D5 /* arch_utilities.cc in Sources */,
- B88FAE2C1166606200407530 /* macho_reader.cc in Sources */,
- 8BCAAA4C1CE3A7980046090B /* elf_reader.cc in Sources */,
- B8C5B5171166534700D34F4E /* dwarf2reader.cc in Sources */,
- B8C5B5181166534700D34F4E /* bytereader.cc in Sources */,
- B8C5B5191166534700D34F4E /* macho_utilities.cc in Sources */,
- B8C5B51A1166534700D34F4E /* file_id.cc in Sources */,
- B8C5B51B1166534700D34F4E /* macho_id.cc in Sources */,
- B8C5B51C1166534700D34F4E /* macho_walker.cc in Sources */,
- B8C5B51D1166534700D34F4E /* dump_syms.cc in Sources */,
- B8C5B51E1166534700D34F4E /* dump_syms_tool.cc in Sources */,
- B88FAE1911665FE400407530 /* dwarf2diehandler.cc in Sources */,
- B88FAE261166603300407530 /* dwarf_cu_to_module.cc in Sources */,
- B88FAE271166603300407530 /* dwarf_line_to_module.cc in Sources */,
- B88FAE281166603300407530 /* language.cc in Sources */,
- B88FAE291166603300407530 /* module.cc in Sources */,
- B88FAE351166673E00407530 /* dwarf_cfi_to_module.cc in Sources */,
- B88FAE3B11666C6F00407530 /* stabs_reader.cc in Sources */,
- B88FAE3E11666C8900407530 /* stabs_to_module.cc in Sources */,
- 4D72CAF513DFBAC2006CABE3 /* md5.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- D21F97CF11CBA0F200239E38 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- D21F97E911CBA1FF00239E38 /* test_assembler.cc in Sources */,
- D21F97D711CBA12300239E38 /* test_assembler_unittest.cc in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 8B31051511F100CF00FCF3E4 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = D21F97D111CBA0F200239E38 /* test_assembler_unittest */;
- targetProxy = 8B31051411F100CF00FCF3E4 /* PBXContainerItemProxy */;
- };
- B84A91FA116CF796006C210E /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B84A91F9116CF796006C210E /* PBXContainerItemProxy */;
- };
- B84A9201116CF7D2006C210E /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B84A91F3116CF784006C210E /* stabs_to_module_unittest */;
- targetProxy = B84A9200116CF7D2006C210E /* PBXContainerItemProxy */;
- };
- B88FAFCF116BDD7000407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B89E0E9411665A6400DD08C9 /* macho_reader_unittest */;
- targetProxy = B88FAFCE116BDD7000407530 /* PBXContainerItemProxy */;
- };
- B88FAFD1116BDD7000407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FAF2E116A591D00407530 /* dwarf2reader_cfi_unittest */;
- targetProxy = B88FAFD0116BDD7000407530 /* PBXContainerItemProxy */;
- };
- B88FB01D116BDF9800407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB006116BDE8300407530 /* stabs_reader_unittest */;
- targetProxy = B88FB01C116BDF9800407530 /* PBXContainerItemProxy */;
- };
- B88FB03A116BE17E00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB039116BE17E00407530 /* PBXContainerItemProxy */;
- };
- B88FB088116CE6D800407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB087116CE6D800407530 /* PBXContainerItemProxy */;
- };
- B88FB090116CE71000407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB08F116CE71000407530 /* PBXContainerItemProxy */;
- };
- B88FB0C0116CEAFE00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB0BF116CEAFE00407530 /* PBXContainerItemProxy */;
- };
- B88FB0C8116CEB4A00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB0B8116CEABF00407530 /* module_unittest */;
- targetProxy = B88FB0C7116CEB4A00407530 /* PBXContainerItemProxy */;
- };
- B88FB0E8116CEEDA00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB0E7116CEEDA00407530 /* PBXContainerItemProxy */;
- };
- B88FB0F8116CEF2E00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB0F7116CEF2E00407530 /* PBXContainerItemProxy */;
- };
- B88FB110116CF08A00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB10F116CF08A00407530 /* PBXContainerItemProxy */;
- };
- B88FB125116CF29E00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB124116CF29E00407530 /* PBXContainerItemProxy */;
- };
- B88FB13C116CF35C00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB13B116CF35C00407530 /* PBXContainerItemProxy */;
- };
- B88FB151116CF4C100407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB023116BDFFF00407530 /* gtestmockall */;
- targetProxy = B88FB150116CF4C100407530 /* PBXContainerItemProxy */;
- };
- B88FB15B116CF53E00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB14A116CF4A700407530 /* byte_cursor_unittest */;
- targetProxy = B88FB15A116CF53E00407530 /* PBXContainerItemProxy */;
- };
- B88FB15D116CF54B00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB11E116CF27F00407530 /* dwarf_cfi_to_module_unittest */;
- targetProxy = B88FB15C116CF54B00407530 /* PBXContainerItemProxy */;
- };
- B88FB15F116CF54B00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB0F1116CEF1900407530 /* dwarf_line_to_module_unittest */;
- targetProxy = B88FB15E116CF54B00407530 /* PBXContainerItemProxy */;
- };
- B88FB161116CF54B00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB109116CF07900407530 /* dwarf_cu_to_module_unittest */;
- targetProxy = B88FB160116CF54B00407530 /* PBXContainerItemProxy */;
- };
- B88FB165116CF54B00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB0DE116CEEA800407530 /* dwarf2diehandler_unittest */;
- targetProxy = B88FB164116CF54B00407530 /* PBXContainerItemProxy */;
- };
- B88FB167116CF54B00407530 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- target = B88FB134116CF30F00407530 /* bytereader_unittest */;
- targetProxy = B88FB166116CF54B00407530 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB927908733DD40010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B3102D411F0D60300FCF3E4 /* BreakpadDebug.xcconfig */;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../../..,
- ../../../common/mac/include/,
- ../../../third_party/musl/include/,
- );
- };
- name = Debug;
- };
- 1DEB927A08733DD40010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B3102D511F0D60300FCF3E4 /* BreakpadRelease.xcconfig */;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- ../../..,
- ../../../common/mac/include/,
- ../../../third_party/musl/include/,
- );
- };
- name = Release;
- };
- B84A91F6116CF784006C210E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = stabs_to_module_unittest;
- };
- name = Debug;
- };
- B84A91F7116CF784006C210E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = stabs_to_module_unittest;
- };
- name = Release;
- };
- B88FAF31116A591F00407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
- );
- LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug\"";
- PRODUCT_NAME = dwarf2reader_cfi_unittest;
- };
- name = Debug;
- };
- B88FAF32116A591F00407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- LIBRARY_SEARCH_PATHS = (
- "$(inherited)",
- "$(LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
- );
- LIBRARY_SEARCH_PATHS_QUOTED_FOR_TARGET_1 = "\"$(SRCROOT)/build/Debug\"";
- PRODUCT_NAME = dwarf2reader_cfi_unittest;
- };
- name = Release;
- };
- B88FAFCA116BDCAD00407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = all_unittests;
- };
- name = Debug;
- };
- B88FAFCB116BDCAD00407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = all_unittests;
- };
- name = Release;
- };
- B88FB009116BDE8400407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = stabs_reader_unittest;
- };
- name = Debug;
- };
- B88FB00A116BDE8400407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = stabs_reader_unittest;
- };
- name = Release;
- };
- B88FB025116BE00100407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = gtestmockall;
- };
- name = Debug;
- };
- B88FB026116BE00100407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = gtestmockall;
- };
- name = Release;
- };
- B88FB0BB116CEAC000407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = module_unittest;
- };
- name = Debug;
- };
- B88FB0BC116CEAC000407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = module_unittest;
- };
- name = Release;
- };
- B88FB0E1116CEEA800407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf2diehandler_unittest;
- };
- name = Debug;
- };
- B88FB0E2116CEEA800407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf2diehandler_unittest;
- };
- name = Release;
- };
- B88FB0F4116CEF1900407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf_line_to_module_unittest;
- };
- name = Debug;
- };
- B88FB0F5116CEF1900407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf_line_to_module_unittest;
- };
- name = Release;
- };
- B88FB10C116CF07A00407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf_cu_to_module_unittest;
- };
- name = Debug;
- };
- B88FB10D116CF07A00407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf_cu_to_module_unittest;
- };
- name = Release;
- };
- B88FB121116CF28000407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf_cfi_to_module_unittest;
- };
- name = Debug;
- };
- B88FB122116CF28000407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = dwarf_cfi_to_module_unittest;
- };
- name = Release;
- };
- B88FB137116CF30F00407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = bytereader_unittest;
- };
- name = Debug;
- };
- B88FB138116CF30F00407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = bytereader_unittest;
- };
- name = Release;
- };
- B88FB14D116CF4A800407530 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = byte_cursor_unittest;
- };
- name = Debug;
- };
- B88FB14E116CF4A800407530 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = byte_cursor_unittest;
- };
- name = Release;
- };
- B89E0E761166575300DD08C9 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = macho_dump;
- };
- name = Debug;
- };
- B89E0E771166575300DD08C9 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- PRODUCT_NAME = macho_dump;
- };
- name = Release;
- };
- B89E0E9711665A6400DD08C9 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = macho_reader_unittest;
- };
- name = Debug;
- };
- B89E0E9811665A6400DD08C9 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = macho_reader_unittest;
- };
- name = Release;
- };
- B8C5B5131166531B00D34F4E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
- GCC_VERSION = "";
- PRODUCT_NAME = dump_syms;
- };
- name = Debug;
- };
- B8C5B5141166531B00D34F4E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_PREPROCESSOR_DEFINITIONS = HAVE_MACH_O_NLIST_H;
- GCC_VERSION = "";
- PRODUCT_NAME = dump_syms;
- };
- name = Release;
- };
- D21F97D411CBA0F200239E38 /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = test_assembler_unittest;
- };
- name = Debug;
- };
- D21F97D511CBA0F200239E38 /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = (
- $inherited,
- ../../../testing,
- ../../../testing/include,
- ../../../testing/gtest,
- ../../../testing/gtest/include,
- );
- PRODUCT_NAME = test_assembler_unittest;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "dump_syms" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB927908733DD40010E9CD /* Debug */,
- 1DEB927A08733DD40010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B84A9202116CF7F0006C210E /* Build configuration list for PBXNativeTarget "stabs_to_module_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B84A91F6116CF784006C210E /* Debug */,
- B84A91F7116CF784006C210E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FAF33116A594800407530 /* Build configuration list for PBXNativeTarget "dwarf2reader_cfi_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FAF31116A591F00407530 /* Debug */,
- B88FAF32116A591F00407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FAFCC116BDCCC00407530 /* Build configuration list for PBXAggregateTarget "all_unittests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FAFCA116BDCAD00407530 /* Debug */,
- B88FAFCB116BDCAD00407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB013116BDEC800407530 /* Build configuration list for PBXNativeTarget "stabs_reader_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB009116BDE8400407530 /* Debug */,
- B88FB00A116BDE8400407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB027116BE02900407530 /* Build configuration list for PBXNativeTarget "gtestmockall" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB025116BE00100407530 /* Debug */,
- B88FB026116BE00100407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB0BE116CEAFE00407530 /* Build configuration list for PBXNativeTarget "module_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB0BB116CEAC000407530 /* Debug */,
- B88FB0BC116CEAC000407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB0E4116CEECE00407530 /* Build configuration list for PBXNativeTarget "dwarf2diehandler_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB0E1116CEEA800407530 /* Debug */,
- B88FB0E2116CEEA800407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB0F9116CEF9800407530 /* Build configuration list for PBXNativeTarget "dwarf_line_to_module_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB0F4116CEF1900407530 /* Debug */,
- B88FB0F5116CEF1900407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB111116CF0A800407530 /* Build configuration list for PBXNativeTarget "dwarf_cu_to_module_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB10C116CF07A00407530 /* Debug */,
- B88FB10D116CF07A00407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB128116CF2C800407530 /* Build configuration list for PBXNativeTarget "dwarf_cfi_to_module_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB121116CF28000407530 /* Debug */,
- B88FB122116CF28000407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB13A116CF33400407530 /* Build configuration list for PBXNativeTarget "bytereader_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB137116CF30F00407530 /* Debug */,
- B88FB138116CF30F00407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B88FB159116CF4F900407530 /* Build configuration list for PBXNativeTarget "byte_cursor_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B88FB14D116CF4A800407530 /* Debug */,
- B88FB14E116CF4A800407530 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B89E0E7F116657A100DD08C9 /* Build configuration list for PBXNativeTarget "macho_dump" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B89E0E761166575300DD08C9 /* Debug */,
- B89E0E771166575300DD08C9 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B89E0E9E11665A9600DD08C9 /* Build configuration list for PBXNativeTarget "macho_reader_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B89E0E9711665A6400DD08C9 /* Debug */,
- B89E0E9811665A6400DD08C9 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- B8C5B5151166533900D34F4E /* Build configuration list for PBXNativeTarget "dump_syms" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- B8C5B5131166531B00D34F4E /* Debug */,
- B8C5B5141166531B00D34F4E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- D21F97D611CBA11000239E38 /* Build configuration list for PBXNativeTarget "test_assembler_unittest" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- D21F97D411CBA0F200239E38 /* Debug */,
- D21F97D511CBA0F200239E38 /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc
deleted file mode 100644
index 6f68457b4c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/dump_syms_tool.cc
+++ /dev/null
@@ -1,264 +0,0 @@
-// -*- mode: c++ -*-
-
-// Copyright (c) 2011, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// dump_syms_tool.cc: Command line tool that uses the DumpSymbols class.
-// TODO(waylonis): accept stdin
-
-#include <mach-o/arch.h>
-#include <unistd.h>
-
-#include <algorithm>
-#include <iostream>
-#include <vector>
-
-#include "common/mac/dump_syms.h"
-#include "common/mac/arch_utilities.h"
-#include "common/mac/macho_utilities.h"
-#include "common/scoped_ptr.h"
-
-using google_breakpad::DumpSymbols;
-using google_breakpad::Module;
-using google_breakpad::scoped_ptr;
-using std::vector;
-
-struct Options {
- Options()
- : srcPath(), dsymPath(), arch(), header_only(false),
- cfi(true), handle_inter_cu_refs(true) {}
-
- string srcPath;
- string dsymPath;
- const NXArchInfo *arch;
- bool header_only;
- bool cfi;
- bool handle_inter_cu_refs;
-};
-
-static bool StackFrameEntryComparator(const Module::StackFrameEntry* a,
- const Module::StackFrameEntry* b) {
- return a->address < b->address;
-}
-
-// Copy the CFI data from |from_module| into |to_module|, for any non-
-// overlapping ranges.
-static void CopyCFIDataBetweenModules(Module* to_module,
- const Module* from_module) {
- typedef vector<Module::StackFrameEntry*>::const_iterator Iterator;
-
- // Get the CFI data from both the source and destination modules and ensure
- // it is sorted by start address.
- vector<Module::StackFrameEntry*> from_data;
- from_module->GetStackFrameEntries(&from_data);
- std::sort(from_data.begin(), from_data.end(), &StackFrameEntryComparator);
-
- vector<Module::StackFrameEntry*> to_data;
- to_module->GetStackFrameEntries(&to_data);
- std::sort(to_data.begin(), to_data.end(), &StackFrameEntryComparator);
-
- Iterator to_it = to_data.begin();
-
- for (Iterator it = from_data.begin(); it != from_data.end(); ++it) {
- Module::StackFrameEntry* from_entry = *it;
- Module::Address from_entry_end = from_entry->address + from_entry->size;
-
- // Find the first CFI record in the |to_module| that does not have an
- // address less than the entry to be copied.
- while (to_it != to_data.end()) {
- if (from_entry->address > (*to_it)->address)
- ++to_it;
- else
- break;
- }
-
- // If the entry does not overlap, then it is safe to copy to |to_module|.
- if (to_it == to_data.end() || (from_entry->address < (*to_it)->address &&
- from_entry_end < (*to_it)->address)) {
- to_module->AddStackFrameEntry(new Module::StackFrameEntry(*from_entry));
- }
- }
-}
-
-static bool Start(const Options &options) {
- SymbolData symbol_data = options.cfi ? ALL_SYMBOL_DATA : NO_CFI;
- DumpSymbols dump_symbols(symbol_data, options.handle_inter_cu_refs);
-
- // For x86_64 binaries, the CFI data is in the __TEXT,__eh_frame of the
- // Mach-O file, which is not copied into the dSYM. Whereas in i386, the CFI
- // data is in the __DWARF,__debug_frame section, which is moved into the
- // dSYM. Therefore, to get x86_64 CFI data, dump_syms needs to look at both
- // the dSYM and the Mach-O file. If both paths are present and CFI was
- // requested, then consider the Module as "split" and dump all the debug data
- // from the primary debug info file, the dSYM, and then dump additional CFI
- // data from the source Mach-O file.
- bool split_module =
- !options.dsymPath.empty() && !options.srcPath.empty() && options.cfi;
- const string& primary_file =
- split_module ? options.dsymPath : options.srcPath;
-
- if (!dump_symbols.Read(primary_file))
- return false;
-
- if (options.arch) {
- if (!dump_symbols.SetArchitecture(options.arch->cputype,
- options.arch->cpusubtype)) {
- fprintf(stderr, "%s: no architecture '%s' is present in file.\n",
- primary_file.c_str(), options.arch->name);
- size_t available_size;
- const SuperFatArch *available =
- dump_symbols.AvailableArchitectures(&available_size);
- if (available_size == 1)
- fprintf(stderr, "the file's architecture is: ");
- else
- fprintf(stderr, "architectures present in the file are:\n");
- for (size_t i = 0; i < available_size; i++) {
- const SuperFatArch *arch = &available[i];
- const NXArchInfo *arch_info =
- google_breakpad::BreakpadGetArchInfoFromCpuType(
- arch->cputype, arch->cpusubtype);
- if (arch_info)
- fprintf(stderr, "%s (%s)\n", arch_info->name, arch_info->description);
- else
- fprintf(stderr, "unrecognized cpu type 0x%x, subtype 0x%x\n",
- arch->cputype, arch->cpusubtype);
- }
- return false;
- }
- }
-
- if (options.header_only)
- return dump_symbols.WriteSymbolFileHeader(std::cout);
-
- // Read the primary file into a Breakpad Module.
- Module* module = NULL;
- if (!dump_symbols.ReadSymbolData(&module))
- return false;
- scoped_ptr<Module> scoped_module(module);
-
- // If this is a split module, read the secondary Mach-O file, from which the
- // CFI data will be extracted.
- if (split_module && primary_file == options.dsymPath) {
- if (!dump_symbols.Read(options.srcPath))
- return false;
-
- Module* cfi_module = NULL;
- if (!dump_symbols.ReadSymbolData(&cfi_module))
- return false;
- scoped_ptr<Module> scoped_cfi_module(cfi_module);
-
- // Ensure that the modules are for the same debug code file.
- if (cfi_module->name() != module->name() ||
- cfi_module->os() != module->os() ||
- cfi_module->architecture() != module->architecture() ||
- cfi_module->identifier() != module->identifier()) {
- fprintf(stderr, "Cannot generate a symbol file from split sources that do"
- " not match.\n");
- return false;
- }
-
- CopyCFIDataBetweenModules(module, cfi_module);
- }
-
- return module->Write(std::cout, symbol_data);
-}
-
-//=============================================================================
-static void Usage(int argc, const char *argv[]) {
- fprintf(stderr, "Output a Breakpad symbol file from a Mach-o file.\n");
- fprintf(stderr, "Usage: %s [-a ARCHITECTURE] [-c] [-g dSYM path] "
- "<Mach-o file>\n", argv[0]);
- fprintf(stderr, "\t-i: Output module header information only.\n");
- fprintf(stderr, "\t-a: Architecture type [default: native, or whatever is\n");
- fprintf(stderr, "\t in the file, if it contains only one architecture]\n");
- fprintf(stderr, "\t-g: Debug symbol file (dSYM) to dump in addition to the "
- "Mach-o file\n");
- fprintf(stderr, "\t-c: Do not generate CFI section\n");
- fprintf(stderr, "\t-r: Do not handle inter-compilation unit references\n");
- fprintf(stderr, "\t-h: Usage\n");
- fprintf(stderr, "\t-?: Usage\n");
-}
-
-//=============================================================================
-static void SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
- signed char ch;
-
- while ((ch = getopt(argc, (char * const *)argv, "ia:g:chr?")) != -1) {
- switch (ch) {
- case 'i':
- options->header_only = true;
- break;
- case 'a': {
- const NXArchInfo *arch_info =
- google_breakpad::BreakpadGetArchInfoFromName(optarg);
- if (!arch_info) {
- fprintf(stderr, "%s: Invalid architecture: %s\n", argv[0], optarg);
- Usage(argc, argv);
- exit(1);
- }
- options->arch = arch_info;
- break;
- }
- case 'g':
- options->dsymPath = optarg;
- break;
- case 'c':
- options->cfi = false;
- break;
- case 'r':
- options->handle_inter_cu_refs = false;
- break;
- case '?':
- case 'h':
- Usage(argc, argv);
- exit(0);
- break;
- }
- }
-
- if ((argc - optind) != 1) {
- fprintf(stderr, "Must specify Mach-o file\n");
- Usage(argc, argv);
- exit(1);
- }
-
- options->srcPath = argv[optind];
-}
-
-//=============================================================================
-int main (int argc, const char * argv[]) {
- Options options;
- bool result;
-
- SetupOptions(argc, argv, &options);
- result = Start(options);
-
- return !result;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc
deleted file mode 100644
index d882bbe883..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/macho_dump.cc
+++ /dev/null
@@ -1,203 +0,0 @@
-// Copyright (c) 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Original author: Jim Blandy <jimb@mozilla.com> <jimb@red-bean.com>
-
-// macho_dump.cc: Dump the contents of a Mach-O file. This is mostly
-// a test program for the Mach_O::FatReader and Mach_O::Reader classes.
-
-#include <errno.h>
-#include <fcntl.h>
-#include <libgen.h>
-#include <mach-o/arch.h>
-#include <sys/mman.h>
-#include <stdint.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "common/byte_cursor.h"
-#include "common/mac/arch_utilities.h"
-#include "common/mac/macho_reader.h"
-
-using google_breakpad::ByteBuffer;
-using std::ostringstream;
-using std::string;
-using std::vector;
-
-namespace {
-namespace mach_o = google_breakpad::mach_o;
-
-string program_name;
-
-int check_syscall(int result, const char *operation, const char *filename) {
- if (result < 0) {
- fprintf(stderr, "%s: %s '%s': %s\n",
- program_name.c_str(), operation,
- filename, strerror(errno));
- exit(1);
- }
- return result;
-}
-
-class DumpSection: public mach_o::Reader::SectionHandler {
- public:
- DumpSection() : index_(0) { }
- bool HandleSection(const mach_o::Section &section) {
- printf(" section %d '%s' in segment '%s'\n"
- " address: 0x%llx\n"
- " alignment: 1 << %d B\n"
- " flags: %d\n"
- " size: %ld\n",
- index_++, section.section_name.c_str(), section.segment_name.c_str(),
- section.address, section.align,
- mach_o::SectionFlags(section.flags),
- section.contents.Size());
- return true;
- }
-
- private:
- int index_;
-};
-
-class DumpCommand: public mach_o::Reader::LoadCommandHandler {
- public:
- DumpCommand(mach_o::Reader *reader) : reader_(reader), index_(0) { }
- bool UnknownCommand(mach_o::LoadCommandType type,
- const ByteBuffer &contents) {
- printf(" load command %d: %d", index_++, type);
- return true;
- }
- bool SegmentCommand(const mach_o::Segment &segment) {
- printf(" load command %d: %s-bit segment '%s'\n"
- " address: 0x%llx\n"
- " memory size: 0x%llx\n"
- " maximum protection: 0x%x\n"
- " initial protection: 0x%x\n"
- " flags: %d\n"
- " section_list size: %ld B\n",
- index_++, (segment.bits_64 ? "64" : "32"), segment.name.c_str(),
- segment.vmaddr, segment.vmsize, segment.maxprot,
- segment.initprot, mach_o::SegmentFlags(segment.flags),
- segment.section_list.Size());
-
- DumpSection dump_section;
- return reader_->WalkSegmentSections(segment, &dump_section);
- }
- private:
- mach_o::Reader *reader_;
- int index_;
-};
-
-void DumpFile(const char *filename) {
- int fd = check_syscall(open(filename, O_RDONLY), "opening", filename);
- struct stat attributes;
- check_syscall(fstat(fd, &attributes),
- "getting file attributes for", filename);
- void *mapping = mmap(NULL, attributes.st_size, PROT_READ,
- MAP_PRIVATE, fd, 0);
- close(fd);
- check_syscall(mapping == (void *)-1 ? -1 : 0,
- "mapping contents of", filename);
-
- mach_o::FatReader::Reporter fat_reporter(filename);
- mach_o::FatReader fat_reader(&fat_reporter);
- if (!fat_reader.Read(reinterpret_cast<uint8_t *>(mapping),
- attributes.st_size)) {
- exit(1);
- }
- printf("filename: %s\n", filename);
- size_t object_files_size;
- const SuperFatArch* super_fat_object_files =
- fat_reader.object_files(&object_files_size);
- struct fat_arch *object_files;
- if (!super_fat_object_files->ConvertToFatArch(object_files)) {
- exit(1);
- }
- printf(" object file count: %ld\n", object_files_size);
- for (size_t i = 0; i < object_files_size; i++) {
- const struct fat_arch &file = object_files[i];
- const NXArchInfo *fat_arch_info =
- google_breakpad::BreakpadGetArchInfoFromCpuType(
- file.cputype, file.cpusubtype);
- printf("\n object file %ld:\n"
- " fat header:\n:"
- " CPU type: %s (%s)\n"
- " size: %d B\n"
- " alignment: 1<<%d B\n",
- i, fat_arch_info->name, fat_arch_info->description,
- file.size, file.align);
-
- ostringstream name;
- name << filename;
- if (object_files_size > 1)
- name << ", object file #" << i;
- ByteBuffer file_contents(reinterpret_cast<uint8_t *>(mapping)
- + file.offset, file.size);
- mach_o::Reader::Reporter reporter(name.str());
- mach_o::Reader reader(&reporter);
- if (!reader.Read(file_contents, file.cputype, file.cpusubtype)) {
- exit(1);
- }
-
- const NXArchInfo *macho_arch_info =
- NXGetArchInfoFromCpuType(reader.cpu_type(),
- reader.cpu_subtype());
- printf(" Mach-O header:\n"
- " word size: %s\n"
- " CPU type: %s (%s)\n"
- " File type: %d\n"
- " flags: %x\n",
- (reader.bits_64() ? "64 bits" : "32 bits"),
- macho_arch_info->name, macho_arch_info->description,
- reader.file_type(), reader.flags());
-
- DumpCommand dump_command(&reader);
- reader.WalkLoadCommands(&dump_command);
- }
- munmap(mapping, attributes.st_size);
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- program_name = basename(argv[0]);
- if (argc == 1) {
- fprintf(stderr, "Usage: %s FILE ...\n"
- "Dump the contents of the Mach-O or fat binary files "
- "'FILE ...'.\n", program_name.c_str());
- }
- for (int i = 1; i < argc; i++) {
- DumpFile(argv[i]);
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build
deleted file mode 100644
index 99ae82aa7f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HOST_SOURCES += [
- 'dump_syms_tool.cc',
-]
-
-HOST_CXXFLAGS += [
- '-O2',
- '-g',
- '-pthread',
- '-stdlib=libc++',
-]
-
-# Order matters here, but HOST_USE_LIBS must be sorted.
-HOST_USE_LIBS += [
- 'host_breakpad_mac_common_s',
-]
-HOST_USE_LIBS += [
- 'host_breakpad_common_s',
- 'host_breakpad_dwarf_s',
-]
-
-# The HostProgram template may append 'host_stdc++compat' to
-# HOST_USE_LIBS, which needs to appear after the entries above.
-HostProgram('dump_syms')
-
-LOCAL_INCLUDES += [
- '../../../common/mac',
-]
-
-if CONFIG['HOST_OS_ARCH'] != 'Darwin':
- HOST_CXXFLAGS += [
- '-I%s/toolkit/crashreporter/google-breakpad/src/third_party/mac_headers/' % TOPSRCDIR,
- ]
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m
deleted file mode 100644
index 741ad765e5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/minidump_upload.m
+++ /dev/null
@@ -1,135 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// minidump_upload.m: Upload a minidump to a HTTP server. The upload is sent as
-// a multipart/form-data POST request with the following parameters:
-// prod: the product name
-// ver: the product version
-// symbol_file: the breakpad format symbol file
-
-#import <unistd.h>
-
-#import <Foundation/Foundation.h>
-
-#import "common/mac/HTTPMultipartUpload.h"
-
-typedef struct {
- NSString *minidumpPath;
- NSString *uploadURLStr;
- NSString *product;
- NSString *version;
- BOOL success;
-} Options;
-
-//=============================================================================
-static void Start(Options *options) {
- NSURL *url = [NSURL URLWithString:options->uploadURLStr];
- HTTPMultipartUpload *ul = [[HTTPMultipartUpload alloc] initWithURL:url];
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
-
- // Add parameters
- [parameters setObject:options->product forKey:@"prod"];
- [parameters setObject:options->version forKey:@"ver"];
- [ul setParameters:parameters];
-
- // Add file
- [ul addFileAtPath:options->minidumpPath name:@"upload_file_minidump"];
-
- // Send it
- NSError *error = nil;
- NSData *data = [ul send:&error];
- NSString *result = [[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding];
-
- NSLog(@"Send: %@", error ? [error description] : @"No Error");
- NSLog(@"Response: %ld", (long)[[ul response] statusCode]);
- NSLog(@"Result: %lu bytes\n%@", (unsigned long)[data length], result);
-
- [result release];
- [ul release];
- options->success = !error;
-}
-
-//=============================================================================
-static void
-Usage(int argc, const char *argv[]) {
- fprintf(stderr, "Submit minidump information.\n");
- fprintf(stderr, "Usage: %s -p <product> -v <version> <minidump> "
- "<upload-URL>\n", argv[0]);
- fprintf(stderr, "<minidump> should be a minidump.\n");
- fprintf(stderr, "<upload-URL> is the destination for the upload\n");
-
- fprintf(stderr, "\t-h: Usage\n");
- fprintf(stderr, "\t-?: Usage\n");
-}
-
-//=============================================================================
-static void
-SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
- char ch;
-
- while ((ch = getopt(argc, (char * const *)argv, "p:v:h?")) != -1) {
- switch (ch) {
- case 'p':
- options->product = [NSString stringWithUTF8String:optarg];
- break;
- case 'v':
- options->version = [NSString stringWithUTF8String:optarg];
- break;
-
- default:
- Usage(argc, argv);
- exit(0);
- break;
- }
- }
-
- if ((argc - optind) != 2) {
- fprintf(stderr, "%s: Missing symbols file and/or upload-URL\n", argv[0]);
- Usage(argc, argv);
- exit(1);
- }
-
- options->minidumpPath = [NSString stringWithUTF8String:argv[optind]];
- options->uploadURLStr = [NSString stringWithUTF8String:argv[optind + 1]];
-}
-
-//=============================================================================
-int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Options options;
-
- bzero(&options, sizeof(Options));
- SetupOptions(argc, argv, &options);
- Start(&options);
-
- [pool release];
- return options.success ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m
deleted file mode 100644
index a7cce7b00c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.m
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// symupload.m: Upload a symbol file to a HTTP server. The upload is sent as
-// a multipart/form-data POST request with the following parameters:
-// code_file: the basename of the module, e.g. "app"
-// debug_file: the basename of the debugging file, e.g. "app"
-// debug_identifier: the debug file's identifier, usually consisting of
-// the guid and age embedded in the pdb, e.g.
-// "11111111BBBB3333DDDD555555555555F"
-// os: the operating system that the module was built for
-// cpu: the CPU that the module was built for (x86 or ppc)
-// symbol_file: the contents of the breakpad-format symbol file
-
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#include <Foundation/Foundation.h>
-#include "HTTPMultipartUpload.h"
-
-typedef struct {
- NSString *symbolsPath;
- NSString *uploadURLStr;
- BOOL success;
-} Options;
-
-//=============================================================================
-static NSArray *ModuleDataForSymbolFile(NSString *file) {
- NSFileHandle *fh = [NSFileHandle fileHandleForReadingAtPath:file];
- NSData *data = [fh readDataOfLength:1024];
- NSString *str = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
- NSScanner *scanner = [NSScanner scannerWithString:str];
- NSString *line;
- NSMutableArray *parts = nil;
- const int MODULE_ID_INDEX = 3;
-
- if ([scanner scanUpToString:@"\n" intoString:&line]) {
- parts = [[NSMutableArray alloc] init];
- NSScanner *moduleInfoScanner = [NSScanner scannerWithString:line];
- NSString *moduleInfo;
- // Get everything BEFORE the module name. None of these properties
- // can have spaces.
- for (int i = 0; i <= MODULE_ID_INDEX; i++) {
- [moduleInfoScanner scanUpToString:@" " intoString:&moduleInfo];
- [parts addObject:moduleInfo];
- }
-
- // Now get the module name. This can have a space so we scan to
- // the end of the line.
- [moduleInfoScanner scanUpToString:@"\n" intoString:&moduleInfo];
- [parts addObject:moduleInfo];
- }
-
- [str release];
-
- return parts;
-}
-
-//=============================================================================
-static void Start(Options *options) {
- NSURL *url = [NSURL URLWithString:options->uploadURLStr];
- HTTPMultipartUpload *ul = [[HTTPMultipartUpload alloc] initWithURL:url];
- NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
- NSArray *moduleParts = ModuleDataForSymbolFile(options->symbolsPath);
- NSMutableString *compactedID =
- [NSMutableString stringWithString:[moduleParts objectAtIndex:3]];
- [compactedID replaceOccurrencesOfString:@"-" withString:@"" options:0
- range:NSMakeRange(0, [compactedID length])];
-
- // Add parameters
- [parameters setObject:compactedID forKey:@"debug_identifier"];
-
- // MODULE <os> <cpu> <uuid> <module-name>
- // 0 1 2 3 4
- [parameters setObject:[moduleParts objectAtIndex:1] forKey:@"os"];
- [parameters setObject:[moduleParts objectAtIndex:2] forKey:@"cpu"];
- [parameters setObject:[moduleParts objectAtIndex:4] forKey:@"debug_file"];
- [parameters setObject:[moduleParts objectAtIndex:4] forKey:@"code_file"];
- [ul setParameters:parameters];
-
- NSArray *keys = [parameters allKeys];
- int count = [keys count];
- for (int i = 0; i < count; ++i) {
- NSString *key = [keys objectAtIndex:i];
- NSString *value = [parameters objectForKey:key];
- fprintf(stdout, "'%s' = '%s'\n", [key UTF8String],
- [value UTF8String]);
- }
-
- // Add file
- [ul addFileAtPath:options->symbolsPath name:@"symbol_file"];
-
- // Send it
- NSError *error = nil;
- NSData *data = [ul send:&error];
- NSString *result = [[NSString alloc] initWithData:data
- encoding:NSUTF8StringEncoding];
- int status = [[ul response] statusCode];
-
- fprintf(stdout, "Send: %s\n", error ? [[error description] UTF8String] :
- "No Error");
- fprintf(stdout, "Response: %d\n", status);
- fprintf(stdout, "Result: %lu bytes\n%s\n",
- (unsigned long)[data length], [result UTF8String]);
-
- [result release];
- [ul release];
- options->success = !error && status==200;
-}
-
-//=============================================================================
-static void
-Usage(int argc, const char *argv[]) {
- fprintf(stderr, "Submit symbol information.\n");
- fprintf(stderr, "Usage: %s <symbols> <upload-URL>\n", argv[0]);
- fprintf(stderr, "<symbols> should be created by using the dump_syms tool.\n");
- fprintf(stderr, "<upload-URL> is the destination for the upload\n");
- fprintf(stderr, "\t-h: Usage\n");
- fprintf(stderr, "\t-?: Usage\n");
-}
-
-//=============================================================================
-static void
-SetupOptions(int argc, const char *argv[], Options *options) {
- extern int optind;
- char ch;
-
- while ((ch = getopt(argc, (char * const *)argv, "h?")) != -1) {
- switch (ch) {
- default:
- Usage(argc, argv);
- exit(0);
- break;
- }
- }
-
- if ((argc - optind) != 2) {
- fprintf(stderr, "%s: Missing symbols file and/or upload-URL\n", argv[0]);
- Usage(argc, argv);
- exit(1);
- }
-
- int fd = open(argv[optind], O_RDONLY);
- if (fd < 0) {
- fprintf(stderr, "%s: %s: %s\n", argv[0], argv[optind], strerror(errno));
- exit(1);
- }
-
- struct stat statbuf;
- if (fstat(fd, &statbuf) < 0) {
- fprintf(stderr, "%s: %s: %s\n", argv[0], argv[optind], strerror(errno));
- close(fd);
- exit(1);
- }
- close(fd);
-
- if (!S_ISREG(statbuf.st_mode)) {
- fprintf(stderr, "%s: %s: not a regular file\n", argv[0], argv[optind]);
- exit(1);
- }
-
- options->symbolsPath = [NSString stringWithUTF8String:argv[optind]];
- options->uploadURLStr = [NSString stringWithUTF8String:argv[optind + 1]];
-}
-
-//=============================================================================
-int main (int argc, const char * argv[]) {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- Options options;
-
- bzero(&options, sizeof(Options));
- SetupOptions(argc, argv, &options);
- Start(&options);
-
- [pool release];
- return options.success ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj b/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj
deleted file mode 100644
index a6a78dc5f3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/symupload/symupload.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,254 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 45;
- objects = {
-
-/* Begin PBXBuildFile section */
- 8B31022C11F0CEBD00FCF3E4 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
- 8DD76F9A0486AA7600D96B5E /* symupload.m in Sources */ = {isa = PBXBuildFile; fileRef = 08FB7796FE84155DC02AAC07 /* symupload.m */; settings = {ATTRIBUTES = (); }; };
- 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08FB779EFE84155DC02AAC07 /* Foundation.framework */; };
- 9BC1D49E0B37427A00F2A2B4 /* minidump_upload.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD836000B0544BA0055103E /* minidump_upload.m */; };
- 9BD8336A0B03E4080055103E /* HTTPMultipartUpload.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BD833680B03E4080055103E /* HTTPMultipartUpload.h */; };
- 9BD8336B0B03E4080055103E /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */; };
- 9BD836180B0549F70055103E /* HTTPMultipartUpload.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 8DD76F9E0486AA7600D96B5E /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 8;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- 9BD8336A0B03E4080055103E /* HTTPMultipartUpload.h in CopyFiles */,
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 08FB7796FE84155DC02AAC07 /* symupload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = symupload.m; sourceTree = "<group>"; };
- 08FB779EFE84155DC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 8B31022B11F0CE6900FCF3E4 /* Breakpad.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Breakpad.xcconfig; path = ../../../common/mac/Breakpad.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadDebug.xcconfig; path = ../../../common/mac/BreakpadDebug.xcconfig; sourceTree = SOURCE_ROOT; };
- 8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = BreakpadRelease.xcconfig; path = ../../../common/mac/BreakpadRelease.xcconfig; sourceTree = SOURCE_ROOT; };
- 8DD76FA10486AA7600D96B5E /* symupload */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = symupload; sourceTree = BUILT_PRODUCTS_DIR; };
- 9BD833680B03E4080055103E /* HTTPMultipartUpload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HTTPMultipartUpload.h; path = ../../../common/mac/HTTPMultipartUpload.h; sourceTree = "<group>"; };
- 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HTTPMultipartUpload.m; path = ../../../common/mac/HTTPMultipartUpload.m; sourceTree = "<group>"; };
- 9BD835FB0B0544950055103E /* minidump_upload */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = minidump_upload; sourceTree = BUILT_PRODUCTS_DIR; };
- 9BD836000B0544BA0055103E /* minidump_upload.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = minidump_upload.m; sourceTree = "<group>"; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8DD76F9B0486AA7600D96B5E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8DD76F9C0486AA7600D96B5E /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 9BD835F90B0544950055103E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8B31022C11F0CEBD00FCF3E4 /* Foundation.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* symupload */ = {
- isa = PBXGroup;
- children = (
- 8B31022B11F0CE6900FCF3E4 /* Breakpad.xcconfig */,
- 8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */,
- 8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */,
- 08FB7796FE84155DC02AAC07 /* symupload.m */,
- 9BD836000B0544BA0055103E /* minidump_upload.m */,
- 9BD833680B03E4080055103E /* HTTPMultipartUpload.h */,
- 9BD833690B03E4080055103E /* HTTPMultipartUpload.m */,
- 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */,
- 1AB674ADFE9D54B511CA2CBB /* Products */,
- );
- name = symupload;
- sourceTree = "<group>";
- };
- 08FB779DFE84155DC02AAC07 /* External Frameworks and Libraries */ = {
- isa = PBXGroup;
- children = (
- 08FB779EFE84155DC02AAC07 /* Foundation.framework */,
- );
- name = "External Frameworks and Libraries";
- sourceTree = "<group>";
- };
- 1AB674ADFE9D54B511CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8DD76FA10486AA7600D96B5E /* symupload */,
- 9BD835FB0B0544950055103E /* minidump_upload */,
- );
- name = Products;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8DD76F960486AA7600D96B5E /* symupload */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "symupload" */;
- buildPhases = (
- 8DD76F990486AA7600D96B5E /* Sources */,
- 8DD76F9B0486AA7600D96B5E /* Frameworks */,
- 8DD76F9E0486AA7600D96B5E /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = symupload;
- productInstallPath = "$(HOME)/bin";
- productName = symupload;
- productReference = 8DD76FA10486AA7600D96B5E /* symupload */;
- productType = "com.apple.product-type.tool";
- };
- 9BD835FA0B0544950055103E /* minidump_upload */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 9BD836020B0544BB0055103E /* Build configuration list for PBXNativeTarget "minidump_upload" */;
- buildPhases = (
- 9BD835F80B0544950055103E /* Sources */,
- 9BD835F90B0544950055103E /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = minidump_upload;
- productName = minidump_upload;
- productReference = 9BD835FB0B0544950055103E /* minidump_upload */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "symupload" */;
- compatibilityVersion = "Xcode 3.1";
- hasScannedForEncodings = 1;
- mainGroup = 08FB7794FE84155DC02AAC07 /* symupload */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8DD76F960486AA7600D96B5E /* symupload */,
- 9BD835FA0B0544950055103E /* minidump_upload */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8DD76F990486AA7600D96B5E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8DD76F9A0486AA7600D96B5E /* symupload.m in Sources */,
- 9BD8336B0B03E4080055103E /* HTTPMultipartUpload.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
- 9BD835F80B0544950055103E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 9BD836180B0549F70055103E /* HTTPMultipartUpload.m in Sources */,
- 9BC1D49E0B37427A00F2A2B4 /* minidump_upload.m in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB927508733DD40010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../../..;
- PRODUCT_NAME = symupload;
- };
- name = Debug;
- };
- 1DEB927608733DD40010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../../..;
- PRODUCT_NAME = symupload;
- };
- name = Release;
- };
- 1DEB927908733DD40010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B3102B611F0D5CE00FCF3E4 /* BreakpadDebug.xcconfig */;
- buildSettings = {
- };
- name = Debug;
- };
- 1DEB927A08733DD40010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- baseConfigurationReference = 8B3102B711F0D5CE00FCF3E4 /* BreakpadRelease.xcconfig */;
- buildSettings = {
- };
- name = Release;
- };
- 9BD836030B0544BB0055103E /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../../..;
- PRODUCT_NAME = minidump_upload;
- };
- name = Debug;
- };
- 9BD836040B0544BB0055103E /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- HEADER_SEARCH_PATHS = ../../..;
- PRODUCT_NAME = minidump_upload;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB927408733DD40010E9CD /* Build configuration list for PBXNativeTarget "symupload" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB927508733DD40010E9CD /* Debug */,
- 1DEB927608733DD40010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB927808733DD40010E9CD /* Build configuration list for PBXProject "symupload" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB927908733DD40010E9CD /* Debug */,
- 1DEB927A08733DD40010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 9BD836020B0544BB0055103E /* Build configuration list for PBXNativeTarget "minidump_upload" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 9BD836030B0544BB0055103E /* Debug */,
- 9BD836040B0544BB0055103E /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/tools_mac.gypi b/toolkit/crashreporter/google-breakpad/src/tools/mac/tools_mac.gypi
deleted file mode 100644
index 7457573b4b..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/tools_mac.gypi
+++ /dev/null
@@ -1,116 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'target_defaults': {
- 'include_dirs': [
- '../..',
- ],
- },
- 'targets': [
- {
- 'target_name': 'crash_report',
- 'type': 'executable',
- 'sources': [
- 'crash_report/crash_report.mm',
- 'crash_report/on_demand_symbol_supplier.h',
- 'crash_report/on_demand_symbol_supplier.mm',
- ],
- 'link_settings': {
- 'libraries': [
- '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
- ],
- },
- 'dependencies': [
- '../common/common.gyp:common',
- '../processor/processor.gyp:processor',
- ],
- },
- {
- 'target_name': 'dump_syms',
- 'type': 'executable',
- 'sources': [
- 'dump_syms/dump_syms_tool.cc',
- ],
- 'link_settings': {
- 'libraries': [
- '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
- ],
- },
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- {
- 'target_name': 'macho_dump',
- 'type': 'executable',
- 'sources': [
- 'dump_syms/macho_dump.cc',
- ],
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- {
- 'target_name': 'minidump_upload',
- 'type': 'executable',
- 'sources': [
- 'symupload/minidump_upload.m',
- ],
- 'include_dirs': [
- '../../common/mac',
- ],
- 'link_settings': {
- 'libraries': [
- '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
- ],
- },
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- {
- 'target_name': 'symupload',
- 'type': 'executable',
- 'sources': [
- 'symupload/symupload.m',
- ],
- 'include_dirs': [
- '../../common/mac',
- ],
- 'link_settings': {
- 'libraries': [
- '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
- ],
- },
- 'dependencies': [
- '../common/common.gyp:common',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_constants.h b/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_constants.h
deleted file mode 100644
index 2115e54e66..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_constants.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Copyright 2014, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include <mach-o/arch.h>
-#include <mach-o/loader.h>
-#include <mach/machine.h>
-
-// Go/Cgo does not support #define constants, so turn them into symbols
-// that are reachable from Go.
-
-#ifndef CPU_TYPE_ARM64
-#define CPU_TYPE_ARM64 (CPU_TYPE_ARM | CPU_ARCH_ABI64)
-#endif
-
-#ifndef CPU_SUBTYPE_ARM64_ALL
-#define CPU_SUBTYPE_ARM64_ALL 0
-#endif
-
-const cpu_type_t kCPU_TYPE_ARM = CPU_TYPE_ARM;
-const cpu_type_t kCPU_TYPE_ARM64 = CPU_TYPE_ARM64;
-
-const cpu_subtype_t kCPU_SUBTYPE_ARM64_ALL = CPU_SUBTYPE_ARM64_ALL;
-const cpu_subtype_t kCPU_SUBTYPE_ARM_V7S = CPU_SUBTYPE_ARM_V7S;
-
-const char* GetNXArchInfoName(cpu_type_t cpu_type, cpu_subtype_t cpu_subtype) {
- const NXArchInfo* arch_info = NXGetArchInfoFromCpuType(cpu_type, cpu_subtype);
- if (!arch_info)
- return 0;
- return arch_info->name;
-}
-
-const uint32_t kMachHeaderFtypeDylib = MH_DYLIB;
-const uint32_t kMachHeaderFtypeBundle = MH_BUNDLE;
-const uint32_t kMachHeaderFtypeExe = MH_EXECUTE;
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_reader.go b/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_reader.go
deleted file mode 100644
index f60648230c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/arch_reader.go
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright 2014, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-package main
-
-import (
- "debug/macho"
-)
-
-/*
-#include "arch_constants.h"
-*/
-import "C"
-
-// getArchStringFromHeader takes a MachO FileHeader and returns a string that
-// represents the CPU type and subtype.
-// This function is a Go version of src/common/mac/arch_utilities.cc:BreakpadGetArchInfoFromCpuType().
-func getArchStringFromHeader(header macho.FileHeader) string {
- // TODO(rsesek): As of 10.9.4, OS X doesn't list these in /usr/include/mach/machine.h.
- if header.Cpu == C.kCPU_TYPE_ARM64 && header.SubCpu == C.kCPU_SUBTYPE_ARM64_ALL {
- return "arm64"
- }
- if header.Cpu == C.kCPU_TYPE_ARM && header.SubCpu == C.kCPU_SUBTYPE_ARM_V7S {
- return "armv7s"
- }
-
- cstr := C.GetNXArchInfoName(C.cpu_type_t(header.Cpu), C.cpu_subtype_t(header.SubCpu))
- if cstr == nil {
- return ""
- }
- return C.GoString(cstr)
-}
-
-const (
- MachODylib macho.Type = C.kMachHeaderFtypeDylib
- MachOBundle = C.kMachHeaderFtypeBundle
- MachOExe = C.kMachHeaderFtypeExe
-)
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/upload_system_symbols.go b/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/upload_system_symbols.go
deleted file mode 100644
index 3556120868..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/upload_system_symbols/upload_system_symbols.go
+++ /dev/null
@@ -1,420 +0,0 @@
-/* Copyright 2014, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
-Tool upload_system_symbols generates and uploads Breakpad symbol files for OS X system libraries.
-
-This tool shells out to the dump_syms and symupload Breakpad tools. In its default mode, this
-will find all dynamic libraries on the system, run dump_syms to create the Breakpad symbol files,
-and then upload them to Google's crash infrastructure.
-
-The tool can also be used to only dump libraries or upload from a directory. See -help for more
-information.
-
-Both i386 and x86_64 architectures will be dumped and uploaded.
-*/
-package main
-
-import (
- "debug/macho"
- "flag"
- "fmt"
- "io"
- "io/ioutil"
- "log"
- "os"
- "os/exec"
- "path"
- "regexp"
- "strings"
- "sync"
- "time"
-)
-
-var (
- breakpadTools = flag.String("breakpad-tools", "out/Release/", "Path to the Breakpad tools directory, containing dump_syms and symupload.")
- uploadOnlyPath = flag.String("upload-from", "", "Upload a directory of symbol files that has been dumped independently.")
- dumpOnlyPath = flag.String("dump-to", "", "Dump the symbols to the specified directory, but do not upload them.")
- systemRoot = flag.String("system-root", "", "Path to the root of the Mac OS X system whose symbols will be dumped.")
- dumpArchitecture = flag.String("arch", "", "The CPU architecture for which symbols should be dumped. If not specified, dumps all architectures.")
-)
-
-var (
- // pathsToScan are the subpaths in the systemRoot that should be scanned for shared libraries.
- pathsToScan = []string{
- "/Library/QuickTime",
- "/System/Library/Components",
- "/System/Library/Frameworks",
- "/System/Library/PrivateFrameworks",
- "/usr/lib",
- }
-
- // uploadServers are the list of servers to which symbols should be uploaded.
- uploadServers = []string{
- "https://clients2.google.com/cr/symbol",
- "https://clients2.google.com/cr/staging_symbol",
- }
-
- // blacklistRegexps match paths that should be excluded from dumping.
- blacklistRegexps = []*regexp.Regexp{
- regexp.MustCompile(`/System/Library/Frameworks/Python\.framework/`),
- regexp.MustCompile(`/System/Library/Frameworks/Ruby\.framework/`),
- regexp.MustCompile(`_profile\.dylib$`),
- regexp.MustCompile(`_debug\.dylib$`),
- regexp.MustCompile(`\.a$`),
- regexp.MustCompile(`\.dat$`),
- }
-)
-
-func main() {
- flag.Parse()
- log.SetFlags(0)
-
- var uq *UploadQueue
-
- if *uploadOnlyPath != "" {
- // -upload-from specified, so handle that case early.
- uq = StartUploadQueue()
- uploadFromDirectory(*uploadOnlyPath, uq)
- uq.Wait()
- return
- }
-
- if *systemRoot == "" {
- log.Fatal("Need a -system-root to dump symbols for")
- }
-
- if *dumpOnlyPath != "" {
- // -dump-to specified, so make sure that the path is a directory.
- if fi, err := os.Stat(*dumpOnlyPath); err != nil {
- log.Fatal("-dump-to location: %v", err)
- } else if !fi.IsDir() {
- log.Fatal("-dump-to location is not a directory")
- }
- }
-
- dumpPath := *dumpOnlyPath
- if *dumpOnlyPath == "" {
- // If -dump-to was not specified, then run the upload pipeline and create
- // a temporary dump output directory.
- uq = StartUploadQueue()
-
- if p, err := ioutil.TempDir("", "upload_system_symbols"); err != nil {
- log.Fatal("Failed to create temporary directory: %v", err)
- } else {
- dumpPath = p
- defer os.RemoveAll(p)
- }
- }
-
- dq := StartDumpQueue(*systemRoot, dumpPath, uq)
- dq.Wait()
- if uq != nil {
- uq.Wait()
- }
-}
-
-type WorkerPool struct {
- wg sync.WaitGroup
-}
-
-// StartWorkerPool will launch numWorkers goroutines all running workerFunc.
-// When workerFunc exits, the goroutine will terminate.
-func StartWorkerPool(numWorkers int, workerFunc func()) *WorkerPool {
- p := new(WorkerPool)
- for i := 0; i < numWorkers; i++ {
- p.wg.Add(1)
- go func() {
- workerFunc()
- p.wg.Done()
- }()
- }
- return p
-}
-
-// Wait for all the workers in the pool to complete the workerFunc.
-func (p *WorkerPool) Wait() {
- p.wg.Wait()
-}
-
-type UploadQueue struct {
- *WorkerPool
- queue chan string
-}
-
-// StartUploadQueue creates a new worker pool and queue, to which paths to
-// Breakpad symbol files may be sent for uploading.
-func StartUploadQueue() *UploadQueue {
- uq := &UploadQueue{
- queue: make(chan string, 10),
- }
- uq.WorkerPool = StartWorkerPool(5, uq.worker)
- return uq
-}
-
-// Upload enqueues the contents of filepath to be uploaded.
-func (uq *UploadQueue) Upload(filepath string) {
- uq.queue <- filepath
-}
-
-// Done tells the queue that no more files need to be uploaded. This must be
-// called before WorkerPool.Wait.
-func (uq *UploadQueue) Done() {
- close(uq.queue)
-}
-
-func (uq *UploadQueue) worker() {
- symUpload := path.Join(*breakpadTools, "symupload")
-
- for symfile := range uq.queue {
- for _, server := range uploadServers {
- for i := 0; i < 3; i++ { // Give each upload 3 attempts to succeed.
- cmd := exec.Command(symUpload, symfile, server)
- if output, err := cmd.Output(); err == nil {
- // Success. No retry needed.
- fmt.Printf("Uploaded %s to %s\n", symfile, server)
- break
- } else {
- log.Printf("Error running symupload(%s, %s), attempt %d: %v: %s\n", symfile, server, i, err, output)
- time.Sleep(1 * time.Second)
- }
- }
- }
- }
-}
-
-type DumpQueue struct {
- *WorkerPool
- dumpPath string
- queue chan dumpRequest
- uq *UploadQueue
-}
-
-type dumpRequest struct {
- path string
- arch string
-}
-
-// StartDumpQueue creates a new worker pool to find all the Mach-O libraries in
-// root and dump their symbols to dumpPath. If an UploadQueue is passed, the
-// path to the symbol file will be enqueued there, too.
-func StartDumpQueue(root, dumpPath string, uq *UploadQueue) *DumpQueue {
- dq := &DumpQueue{
- dumpPath: dumpPath,
- queue: make(chan dumpRequest),
- uq: uq,
- }
- dq.WorkerPool = StartWorkerPool(12, dq.worker)
-
- findLibsInRoot(root, dq)
-
- return dq
-}
-
-// DumpSymbols enqueues the filepath to have its symbols dumped in the specified
-// architecture.
-func (dq *DumpQueue) DumpSymbols(filepath string, arch string) {
- dq.queue <- dumpRequest{
- path: filepath,
- arch: arch,
- }
-}
-
-func (dq *DumpQueue) Wait() {
- dq.WorkerPool.Wait()
- if dq.uq != nil {
- dq.uq.Done()
- }
-}
-
-func (dq *DumpQueue) done() {
- close(dq.queue)
-}
-
-func (dq *DumpQueue) worker() {
- dumpSyms := path.Join(*breakpadTools, "dump_syms")
-
- for req := range dq.queue {
- filebase := path.Join(dq.dumpPath, strings.Replace(req.path, "/", "_", -1))
- symfile := fmt.Sprintf("%s_%s.sym", filebase, req.arch)
- f, err := os.Create(symfile)
- if err != nil {
- log.Fatal("Error creating symbol file:", err)
- }
-
- cmd := exec.Command(dumpSyms, "-a", req.arch, req.path)
- cmd.Stdout = f
- err = cmd.Run()
- f.Close()
-
- if err != nil {
- os.Remove(symfile)
- log.Printf("Error running dump_syms(%s, %s): %v\n", req.arch, req.path, err)
- } else if dq.uq != nil {
- dq.uq.Upload(symfile)
- }
- }
-}
-
-// uploadFromDirectory handles the upload-only case and merely uploads all files in
-// a directory.
-func uploadFromDirectory(directory string, uq *UploadQueue) {
- d, err := os.Open(directory)
- if err != nil {
- log.Fatal("Could not open directory to upload: %v", err)
- }
- defer d.Close()
-
- entries, err := d.Readdirnames(0)
- if err != nil {
- log.Fatal("Could not read directory: %v", err)
- }
-
- for _, entry := range entries {
- uq.Upload(path.Join(directory, entry))
- }
-
- uq.Done()
-}
-
-// findQueue is an implementation detail of the DumpQueue that finds all the
-// Mach-O files and their architectures.
-type findQueue struct {
- *WorkerPool
- queue chan string
- dq *DumpQueue
-}
-
-// findLibsInRoot looks in all the pathsToScan in the root and manages the
-// interaction between findQueue and DumpQueue.
-func findLibsInRoot(root string, dq *DumpQueue) {
- fq := &findQueue{
- queue: make(chan string, 10),
- dq: dq,
- }
- fq.WorkerPool = StartWorkerPool(12, fq.worker)
-
- for _, p := range pathsToScan {
- fq.findLibsInPath(path.Join(root, p))
- }
-
- close(fq.queue)
- fq.Wait()
- dq.done()
-}
-
-// findLibsInPath recursively walks the directory tree, sending file paths to
-// test for being Mach-O to the findQueue.
-func (fq *findQueue) findLibsInPath(loc string) {
- d, err := os.Open(loc)
- if err != nil {
- log.Fatal("Could not open %s: %v", loc, err)
- }
- defer d.Close()
-
- for {
- fis, err := d.Readdir(100)
- if err != nil && err != io.EOF {
- log.Fatal("Error reading directory %s: %v", loc, err)
- }
-
- for _, fi := range fis {
- fp := path.Join(loc, fi.Name())
- if fi.IsDir() {
- fq.findLibsInPath(fp)
- continue
- } else if fi.Mode()&os.ModeSymlink != 0 {
- continue
- }
-
- // Test the blacklist in the worker to not slow down this main loop.
-
- fq.queue <- fp
- }
-
- if err == io.EOF {
- break
- }
- }
-}
-
-func (fq *findQueue) worker() {
- for fp := range fq.queue {
- blacklisted := false
- for _, re := range blacklistRegexps {
- blacklisted = blacklisted || re.MatchString(fp)
- }
- if blacklisted {
- continue
- }
-
- f, err := os.Open(fp)
- if err != nil {
- log.Printf("%s: %v", fp, err)
- continue
- }
-
- fatFile, err := macho.NewFatFile(f)
- if err == nil {
- // The file is fat, so dump its architectures.
- for _, fatArch := range fatFile.Arches {
- fq.dumpMachOFile(fp, fatArch.File)
- }
- fatFile.Close()
- } else if err == macho.ErrNotFat {
- // The file isn't fat but may still be MachO.
- thinFile, err := macho.NewFile(f)
- if err != nil {
- log.Printf("%s: %v", fp, err)
- continue
- }
- fq.dumpMachOFile(fp, thinFile)
- thinFile.Close()
- } else {
- f.Close()
- }
- }
-}
-
-func (fq *findQueue) dumpMachOFile(fp string, image *macho.File) {
- if image.Type != MachODylib && image.Type != MachOBundle {
- return
- }
-
- arch := getArchStringFromHeader(image.FileHeader)
- if arch == "" {
- // Don't know about this architecture type.
- return
- }
-
- if (*dumpArchitecture != "" && *dumpArchitecture == arch) || *dumpArchitecture == "" {
- fq.dq.DumpSymbols(fp, arch)
- }
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/python/filter_syms.py b/toolkit/crashreporter/google-breakpad/src/tools/python/filter_syms.py
deleted file mode 100644
index abddf7893e..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/python/filter_syms.py
+++ /dev/null
@@ -1,204 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Normalizes and de-duplicates paths within Breakpad symbol files.
-
-When using DWARF for storing debug symbols, some file information will be
-stored relative to the current working directory of the current compilation
-unit, and may be further relativized based upon how the file was #included.
-
-This helper can be used to parse the Breakpad symbol file generated from such
-DWARF files and normalize and de-duplicate the FILE records found within,
-updating any references to the FILE records in the other record types.
-"""
-
-import macpath
-import ntpath
-import optparse
-import os
-import posixpath
-import sys
-
-class BreakpadParseError(Exception):
- """Unsupported Breakpad symbol record exception class."""
- pass
-
-class SymbolFileParser(object):
- """Parser for Breakpad symbol files.
-
- The format of these files is documented at
- https://chromium.googlesource.com/breakpad/breakpad/+/master/docs/symbol_files.md
- """
-
- def __init__(self, input_stream, output_stream, ignored_prefixes=None,
- path_handler=os.path):
- """Inits a SymbolFileParser to read symbol records from |input_stream| and
- write the processed output to |output_stream|.
-
- |ignored_prefixes| contains a list of optional path prefixes that
- should be stripped from the final, normalized path outputs.
-
- For example, if the Breakpad symbol file had all paths starting with a
- common prefix, such as:
- FILE 1 /b/build/src/foo.cc
- FILE 2 /b/build/src/bar.cc
- Then adding "/b/build/src" as an ignored prefix would result in an output
- file that contained:
- FILE 1 foo.cc
- FILE 2 bar.cc
-
- Note that |ignored_prefixes| does not necessarily contain file system
- paths, as the contents of the DWARF DW_AT_comp_dir attribute is dependent
- upon the host system and compiler, and may contain additional information
- such as hostname or compiler version.
- """
-
- self.unique_files = {}
- self.duplicate_files = {}
- self.input_stream = input_stream
- self.output_stream = output_stream
- self.ignored_prefixes = ignored_prefixes or []
- self.path_handler = path_handler
-
- def Process(self):
- """Processes the Breakpad symbol file."""
- for line in self.input_stream:
- parsed = self._ParseRecord(line.rstrip())
- if parsed:
- self.output_stream.write(parsed + '\n')
-
- def _ParseRecord(self, record):
- """Parses a single Breakpad symbol record - a single line from the symbol
- file.
-
- Returns:
- The modified string to write to the output file, or None if no line
- should be written.
- """
- record_type = record.partition(' ')[0]
- if record_type == 'FILE':
- return self._ParseFileRecord(record)
- elif self._IsLineRecord(record_type):
- return self._ParseLineRecord(record)
- else:
- # Simply pass the record through unaltered.
- return record
-
- def _NormalizePath(self, path):
- """Normalizes a file path to its canonical form.
-
- As this may not execute on the machine or file system originally
- responsible for compilation, it may be necessary to further correct paths
- for symlinks, junctions, or other such file system indirections.
-
- Returns:
- A unique, canonical representation for the the file path.
- """
- return self.path_handler.normpath(path)
-
- def _AdjustPath(self, path):
- """Adjusts the supplied path after performing path de-duplication.
-
- This may be used to perform secondary adjustments, such as removing a
- common prefix, such as "/D/build", or replacing the file system path with
- information from the version control system.
-
- Returns:
- The actual path to use when writing the FILE record.
- """
- return path[len(filter(path.startswith,
- self.ignored_prefixes + [''])[0]):]
-
- def _ParseFileRecord(self, file_record):
- """Parses and corrects a FILE record."""
- file_info = file_record[5:].split(' ', 3)
- if len(file_info) > 2:
- raise BreakpadParseError('Unsupported FILE record: ' + file_record)
- file_index = int(file_info[0])
- file_name = self._NormalizePath(file_info[1])
- existing_file_index = self.unique_files.get(file_name)
- if existing_file_index is None:
- self.unique_files[file_name] = file_index
- file_info[1] = self._AdjustPath(file_name)
- return 'FILE ' + ' '.join(file_info)
- else:
- self.duplicate_files[file_index] = existing_file_index
- return None
-
- def _IsLineRecord(self, record_type):
- """Determines if the current record type is a Line record"""
- try:
- line = int(record_type, 16)
- except (ValueError, TypeError):
- return False
- return True
-
- def _ParseLineRecord(self, line_record):
- """Parses and corrects a Line record."""
- line_info = line_record.split(' ', 5)
- if len(line_info) > 4:
- raise BreakpadParseError('Unsupported Line record: ' + line_record)
- file_index = int(line_info[3])
- line_info[3] = str(self.duplicate_files.get(file_index, file_index))
- return ' '.join(line_info)
-
-def main():
- option_parser = optparse.OptionParser()
- option_parser.add_option("-p", "--prefix",
- action="append", dest="prefixes", type="string",
- default=[],
- help="A path prefix that should be removed from "
- "all FILE lines. May be repeated to specify "
- "multiple prefixes.")
- option_parser.add_option("-t", "--path_type",
- action="store", type="choice", dest="path_handler",
- choices=['win32', 'posix'],
- help="Indicates how file paths should be "
- "interpreted. The default is to treat paths "
- "the same as the OS running Python (eg: "
- "os.path)")
- options, args = option_parser.parse_args()
- if args:
- option_parser.error('Unknown argument: %s' % args)
-
- path_handler = { 'win32': ntpath,
- 'posix': posixpath }.get(options.path_handler, os.path)
- try:
- symbol_parser = SymbolFileParser(sys.stdin, sys.stdout, options.prefixes,
- path_handler)
- symbol_parser.Process()
- except BreakpadParseError, e:
- print >> sys.stderr, 'Got an error while processing symbol file'
- print >> sys.stderr, str(e)
- return 1
- return 0
-
-if __name__ == '__main__':
- sys.exit(main())
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/python/tests/filter_syms_unittest.py b/toolkit/crashreporter/google-breakpad/src/tools/python/tests/filter_syms_unittest.py
deleted file mode 100644
index b111f34983..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/python/tests/filter_syms_unittest.py
+++ /dev/null
@@ -1,138 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit tests for filter_syms.py"""
-
-import cStringIO
-import ntpath
-import os
-import StringIO
-import sys
-import unittest
-
-ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
-sys.path.insert(0, os.path.join(ROOT_DIR, '..'))
-
-# In root
-import filter_syms
-
-class FilterSysmsTest(unittest.TestCase):
- def assertParsed(self, input_data, ignored_prefixes, expected):
- input_io = cStringIO.StringIO(input_data)
- output_io = cStringIO.StringIO()
- parser = filter_syms.SymbolFileParser(input_io, output_io,
- ignored_prefixes, ntpath)
- parser.Process()
- self.assertEqual(output_io.getvalue(), expected)
-
- def testDuplicateFiles(self):
- """Tests that duplicate files in FILE records are correctly removed and
- that Line records are updated."""
-
- INPUT = \
-"""MODULE windows x86 111111111111111111111111111111111 module1.pdb
-INFO CODE_ID FFFFFFFF module1.exe
-FILE 1 foo/../file1_1.cc
-FILE 2 bar/../file1_1.cc
-FILE 3 baz/../file1_1.cc
-FUNC 1000 c 0 Function1_1
-1000 8 45 2
-1008 4 46 3
-100c 4 44 1
-"""
- EXPECTED_OUTPUT = \
-"""MODULE windows x86 111111111111111111111111111111111 module1.pdb
-INFO CODE_ID FFFFFFFF module1.exe
-FILE 1 file1_1.cc
-FUNC 1000 c 0 Function1_1
-1000 8 45 1
-1008 4 46 1
-100c 4 44 1
-"""
- self.assertParsed(INPUT, [], EXPECTED_OUTPUT)
-
- def testIgnoredPrefix(self):
- """Tests that prefixes in FILE records are correctly removed."""
-
- INPUT = \
-"""MODULE windows x86 111111111111111111111111111111111 module1.pdb
-INFO CODE_ID FFFFFFFF module1.exe
-FILE 1 /src/build/foo/../file1_1.cc
-FILE 2 /src/build/bar/../file1_2.cc
-FILE 3 /src/build/baz/../file1_2.cc
-FUNC 1000 c 0 Function1_1
-1000 8 45 2
-1008 4 46 3
-100c 4 44 1
-"""
- EXPECTED_OUTPUT = \
-"""MODULE windows x86 111111111111111111111111111111111 module1.pdb
-INFO CODE_ID FFFFFFFF module1.exe
-FILE 1 file1_1.cc
-FILE 2 file1_2.cc
-FUNC 1000 c 0 Function1_1
-1000 8 45 2
-1008 4 46 2
-100c 4 44 1
-"""
- IGNORED_PREFIXES = ['\\src\\build\\']
- self.assertParsed(INPUT, IGNORED_PREFIXES, EXPECTED_OUTPUT)
-
- def testIgnoredPrefixesDuplicateFiles(self):
- """Tests that de-duplication of FILE records happens BEFORE prefixes
- are removed."""
-
- INPUT = \
-"""MODULE windows x86 111111111111111111111111111111111 module1.pdb
-INFO CODE_ID FFFFFFFF module1.exe
-FILE 1 /src/build/foo/../file1_1.cc
-FILE 2 /src/build/bar/../file1_2.cc
-FILE 3 D:/src/build2/baz/../file1_2.cc
-FUNC 1000 c 0 Function1_1
-1000 8 45 2
-1008 4 46 3
-100c 4 44 1
-"""
- EXPECTED_OUTPUT = \
-"""MODULE windows x86 111111111111111111111111111111111 module1.pdb
-INFO CODE_ID FFFFFFFF module1.exe
-FILE 1 file1_1.cc
-FILE 2 file1_2.cc
-FILE 3 file1_2.cc
-FUNC 1000 c 0 Function1_1
-1000 8 45 2
-1008 4 46 3
-100c 4 44 1
-"""
- IGNORED_PREFIXES = ['\\src\\build\\', 'D:\\src\\build2\\']
- self.assertParsed(INPUT, IGNORED_PREFIXES, EXPECTED_OUTPUT)
-
-if __name__ == '__main__':
- unittest.main() \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile
deleted file mode 100644
index ff77105c61..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright (c) 2007, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Author: Alfred Peng
-
-CXX=CC
-CC=cc
-
-CXXFLAGS=-g -xs -xdebugformat=stabs -I../../.. -I../../../common/solaris -lelf -ldemangle -D_REENTRANT
-
-.PHONY:all clean
-
-BIN=dump_syms
-
-all:$(BIN)
-
-DUMP_OBJ=dump_symbols.o guid_creator.o dump_syms.o file_id.o md5.o
-
-dump_syms:$(DUMP_OBJ)
- $(CXX) $(CXXFLAGS) -o $@ $^
-
-dump_symbols.o:../../../common/solaris/dump_symbols.cc
- $(CXX) $(CXXFLAGS) -c $^
-
-guid_creator.o:../../../common/solaris/guid_creator.cc
- $(CXX) $(CXXFLAGS) -c $^
-
-file_id.o:../../../common/solaris/file_id.cc
- $(CXX) $(CXXFLAGS) -c $^
-
-md5.o:../../../common/md5.cc
- $(CXX) $(CXXFLAGS) -c $^
-
-test:all
- ./run_regtest.sh
-
-clean:
- rm -f $(BIN) $(DUMP_OBJ)
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile.in b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile.in
deleted file mode 100644
index 7bef51e078..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HOST_LDFLAGS += -lelf -ldemangle
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/dump_syms.cc b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/dump_syms.cc
deleted file mode 100644
index 54cea57e75..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/dump_syms.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Author: Alfred Peng
-
-#include <string>
-#include <cstdio>
-
-#include "common/solaris/dump_symbols.h"
-
-using namespace google_breakpad;
-
-int main(int argc, char **argv) {
- if (argc != 2) {
- fprintf(stderr, "Usage: %s <binary-with-stab-symbol>\n", argv[0]);
- return 1;
- }
-
- const char *binary = argv[1];
-
- DumpSymbols dumper;
- if (!dumper.WriteSymbolFile(binary, fileno(stdout))) {
- fprintf(stderr, "Failed to write symbol file.\n");
- return 1;
- }
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build
deleted file mode 100644
index 3efeac039a..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HOST_SOURCES += [
- 'dump_syms.cc',
-]
-
-HOST_CXXFLAGS += [
- '-O2',
- '-g',
-]
-
-HOST_USE_LIBS += [
- 'host_breakpad_common_s',
- 'host_breakpad_solaris_common_s',
-]
-
-# The HostProgram template may append 'host_stdc++compat' to
-# HOST_USE_LIBS, which needs to appear after the entries above.
-HostProgram('dump_syms')
-
-LOCAL_INCLUDES += [
- '../../../common/solaris',
-]
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/run_regtest.sh b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/run_regtest.sh
deleted file mode 100644
index ffb3433067..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/run_regtest.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2007, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-./dump_syms testdata/dump_syms_regtest.o > testdata/dump_syms_regtest.new
-status=$?
-
-if [ $status -ne 0 ] ; then
- echo "FAIL, dump_syms failed"
- exit $status
-fi
-
-diff -u testdata/dump_syms_regtest.new testdata/dump_syms_regtest.sym > \
- testdata/dump_syms_regtest.diff
-status=$?
-
-if [ $status -eq 0 ] ; then
- rm testdata/dump_syms_regtest.diff testdata/dump_syms_regtest.new
- echo "PASS"
-else
- echo "FAIL, see testdata/dump_syms_regtest.[new|diff]"
-fi
-
-exit $status
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc
deleted file mode 100644
index e617a23b81..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.cc
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ./dump_syms dump_syms_regtest.pdb > dump_syms_regtest.sym
-
-namespace google_breakpad {
-
-class C {
- public:
- C() : member_(1) {}
- virtual ~C() {}
-
- void set_member(int value) { member_ = value; }
- int member() const { return member_; }
-
- void f() { member_ = g(); }
- virtual int g() { return 2; }
- static char* h(const C &that) { return 0; }
-
- private:
- int member_;
-};
-
-static int i() {
- return 3;
-}
-
-} // namespace google_breakpad
-
-int main(int argc, char **argv) {
- google_breakpad::C object;
- object.set_member(google_breakpad::i());
- object.f();
- int value = object.g();
- char *nothing = object.h(object);
-
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs
deleted file mode 100644
index c5f93ef78c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.stabs
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-Debugging Stab table -- 104 entries
-
- 0: .stabs "dump_syms_regtest.cc",N_UNDF,0x0,0x67,0x71c
- 1: .stabs "/export/home/alfred/cvs/breakpad/google-breakpad20070927/src/tools/solaris/dump_syms/testdata/",N_SO,0x0,0x0,0x0
- 2: .stabs "dump_syms_regtest.cc",N_SO,0x0,0x4,0x0
- 3: .stabs "",N_OBJ,0x0,0x0,0x0
- 4: .stabs "",N_OBJ,0x0,0x0,0x0
- 5: .stabs "V=9.0;DBG_GEN=5.0.8;dm;cd;backend;ptf;ptx;ptk;s;g;R=5.8<<Sun C++ 5.8 Patch 121018-07 2006/11/01 (ccfe)>>;G=.XAB6Z2hOiL$Gl1b.;A=2",N_OPT,0x0,0x0,0x46fcb88e
- 6: .stabs "dump_syms_regtest.cc",N_SOL,0x0,0x0,0x0
- 7: .stabs "char:t(0,1)=bsc1;0;8",N_ISYM,0x0,0x0,0x0
- 8: .stabs "short:t(0,2)=bs2;0;16",N_ISYM,0x0,0x0,0x0
- 9: .stabs "int:t(0,3)=bs4;0;32",N_ISYM,0x0,0x0,0x0
- 10: .stabs "long:t(0,4)=bs4;0;32",N_ISYM,0x0,0x0,0x0
- 11: .stabs "long long:t(0,5)=bs8;0;64",N_ISYM,0x0,0x0,0x0
- 12: .stabs "unsigned char:t(0,6)=buc1;0;8",N_ISYM,0x0,0x0,0x0
- 13: .stabs "unsigned short:t(0,7)=bu2;0;16",N_ISYM,0x0,0x0,0x0
- 14: .stabs "unsigned:t(0,8)=bu4;0;32",N_ISYM,0x0,0x0,0x0
- 15: .stabs "unsigned long:t(0,9)=bu4;0;32",N_ISYM,0x0,0x0,0x0
- 16: .stabs "unsigned long long:t(0,10)=bu8;0;64",N_ISYM,0x0,0x0,0x0
- 17: .stabs "signed char:t(0,11)=bsc1;0;8",N_ISYM,0x0,0x0,0x0
- 18: .stabs "wchar_t:t(0,12)=buc4;0;32",N_ISYM,0x0,0x0,0x0
- 19: .stabs "void:t(0,13)=bs0;0;0",N_ISYM,0x0,0x0,0x0
- 20: .stabs "float:t(0,14)=R1;4",N_ISYM,0x0,0x0,0x0
- 21: .stabs "double:t(0,15)=R2;8",N_ISYM,0x0,0x0,0x0
- 22: .stabs "long double:t(0,16)=R6;12",N_ISYM,0x0,0x0,0x0
- 23: .stabs "...:t(0,17)=buv4;0;32",N_ISYM,0x0,0x0,0x0
- 24: .stabs "bool:t(0,18)=bub1;0;8",N_ISYM,0x0,0x0,0x0
- 25: .stabs "__1nPgoogle_breakpad_:T(0,19)=Yn0google_breakpad;",N_ISYM,0x0,0x0,0x0
- 26: .stabs "nBC(0,19):U(0,20)",N_ESYM,0x0,0x0,0x0
- 27: .stabs "nBC(0,19):T(0,20)=Yc8C;;AcHmember_:(0,3),32,32;;Cc2t6M_v K2c2T6M_v CcKset_member6Mi_v CcGmember6kM_i CcBf6M_v K3cBg6M_i GcBh6Frk1_pc;;;2 0;;;;110;",N_ESYM,0x0,0x8,0x0
- 28: .stabs "main:F(0,3);(0,3);(0,21)=*(0,22)=*(0,1)",N_FUN,0x0,0x38,0x0
- 29: .stabs "main",N_MAIN,0x0,0x0,0x0
- 30: .stabs "argc:p(0,3)",N_PSYM,0x0,0x4,0x8
- 31: .stabs "argv:p(0,21)",N_PSYM,0x0,0x4,0xc
- 32: .stabn N_LBRAC,0x0,0x1,0x12
- 33: .stabs "object:(0,20)",N_LSYM,0x0,0x8,0xfffffff4
- 34: .stabs "value:(0,3)",N_LSYM,0x0,0x4,0xfffffff0
- 35: .stabs "nothing:(0,22)",N_LSYM,0x0,0x4,0xffffffec
- 36: .stabn N_SLINE,0x0,0x39,0x12
- 37: .stabs "object:2",N_CONSTRUCT,0x0,0xc,0x12
- 38: .stabn N_SLINE,0x2,0x3a,0x1e
- 39: .stabn N_SLINE,0x0,0x3b,0x36
- 40: .stabn N_SLINE,0x0,0x3c,0x42
- 41: .stabn N_SLINE,0x0,0x3d,0x57
- 42: .stabn N_SLINE,0x0,0x3f,0x6c
- 43: .stabs "2:0",N_DESTRUCT,0x0,0xc,0x73
- 44: .stabn N_SLINE,0xfffffffe,0x40,0x9c
- 45: .stabn N_RBRAC,0x0,0x1,0x9c
- 46: .stabs "__1cPgoogle_breakpadBi6F_i_:f(0,3)",N_FUN,0x0,0x32,0x0
- 47: .stabn N_LBRAC,0x0,0x1,0x6
- 48: .stabn N_SLINE,0x0,0x33,0x6
- 49: .stabn N_SLINE,0x0,0x34,0x10
- 50: .stabn N_RBRAC,0x0,0x1,0x10
- 51: .stabs "__1cPgoogle_breakpadBC2t6M_v_:F(0,13);(0,23)=*(0,20)",N_FUN,0x0,0x24,0x0
- 52: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 53: .stabn N_LBRAC,0x0,0x1,0x3
- 54: .stabn N_SLINE,0x0,0x24,0x25
- 55: .stabn N_RBRAC,0x0,0x1,0x25
- 56: .stabs "__1cPgoogle_breakpadBC2T6M_v_:F(0,13);(0,23)",N_FUN,0x0,0x25,0x0
- 57: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 58: .stabn N_LBRAC,0x0,0x1,0x3
- 59: .stabn N_SLINE,0x0,0x25,0x3
- 60: .stabn N_RBRAC,0x0,0x1,0x3
- 61: .stabs "__1cPgoogle_breakpadBCKset_member6Mi_v_:F(0,13);(0,23);(0,3)",N_FUN,0x0,0x27,0x0
- 62: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 63: .stabs "value:p(0,3)",N_PSYM,0x0,0x4,0xc
- 64: .stabn N_LBRAC,0x0,0x1,0x3
- 65: .stabn N_SLINE,0x0,0x27,0x3
- 66: .stabn N_SLINE,0x0,0x27,0xc
- 67: .stabn N_RBRAC,0x0,0x1,0xc
- 68: .stabs "__1cPgoogle_breakpadBCBf6M_v_:F(0,13);(0,23)",N_FUN,0x0,0x2a,0x0
- 69: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 70: .stabn N_LBRAC,0x0,0x1,0x3
- 71: .stabn N_SLINE,0x0,0x2a,0x3
- 72: .stabn N_SLINE,0x0,0x2a,0x1d
- 73: .stabn N_RBRAC,0x0,0x1,0x1d
- 74: .stabs "__1cPgoogle_breakpadBCBg6M_i_:F(0,3);(0,23)",N_FUN,0x0,0x2b,0x0
- 75: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 76: .stabn N_LBRAC,0x0,0x1,0x6
- 77: .stabn N_SLINE,0x0,0x2b,0x6
- 78: .stabn N_SLINE,0x0,0x2b,0x10
- 79: .stabn N_RBRAC,0x0,0x1,0x10
- 80: .stabs "__1cPgoogle_breakpadBCBh6Frk1_pc_:F(0,22);(0,24)=&(0,25)=k(0,20)",N_FUN,0x0,0x2c,0x0
- 81: .stabs "that:p(0,24)",N_PSYM,0x0,0x4,0x8
- 82: .stabn N_LBRAC,0x0,0x1,0x6
- 83: .stabn N_SLINE,0x0,0x2c,0x6
- 84: .stabn N_SLINE,0x0,0x2c,0x10
- 85: .stabn N_RBRAC,0x0,0x1,0x10
- 86: .stabs "__1cPgoogle_breakpadBC2T5B6M_v_:F(0,13);(0,23)",N_FUN,0x0,0x25,0x0
- 87: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 88: .stabn N_LBRAC,0x0,0x1,0x3
- 89: .stabn N_SLINE,0x0,0x25,0xf
- 90: .stabn N_RBRAC,0x0,0x1,0xf
- 91: .stabs "__SLIP.DELETER__A:f(0,13);(0,23);(0,3)",N_FUN,0x0,0x25,0x0
- 92: .stabs "this:p(0,23)",N_PSYM,0x0,0x4,0x8
- 93: .stabs "delete:p(0,3)",N_PSYM,0x0,0x4,0xc
- 94: .stabn N_LBRAC,0x0,0x1,0x3
- 95: .stabn N_LBRAC,0x0,0x2,0x3
- 96: .stabn N_RBRAC,0x0,0x2,0x28
- 97: .stabn N_RBRAC,0x0,0x1,0x28
- 98: .stabs "true:l(0,18);1",N_LSYM,0x0,0x4,0x0
- 99: .stabs "false:l(0,18);0",N_LSYM,0x0,0x4,0x0
- 100: .stabs "__1c2k6Fpv_v_:P(0,13);(0,26)=*(0,13)",N_FUN,0x0,0x0,0x0
- 101: .stabs "__1cPgoogle_breakpadBC2t5B6M_v_:F__1cPgoogle_breakpadBC2t6M_v_",N_ALIAS,0x0,0x0,0x0
- 102: .stabs "cbD__RTTI__1nPgoogle_breakpadBC_(0,19):YR(0,20)",N_LSYM,0x0,0x0,0x0
- 103: .stabn N_ENDM,0x0,0x0,0x0
-
-
-Index Stab table -- 17 entries
-
- 0: .stabs "dump_syms_regtest.cc",N_UNDF,0x0,0x10,0x3b1
- 1: .stabs "/export/home/alfred/cvs/breakpad/google-breakpad20070927/src/tools/solaris/dump_syms/testdata/",N_SO,0x0,0x0,0x0
- 2: .stabs "dump_syms_regtest.cc",N_SO,0x0,0x4,0x0
- 3: .stabs "/export/home/alfred/cvs/breakpad/google-breakpad20070927/src/tools/solaris/dump_syms/testdata",N_OBJ,0x0,0x0,0x0
- 4: .stabs "dump_syms_regtest.o",N_OBJ,0x0,0x0,0x0
- 5: .stabs "V=9.0;DBG_GEN=5.0.8;dm;cd;backend;ptf;ptx;ptk;s;g;R=5.8<<Sun C++ 5.8 Patch 121018-07 2006/11/01 (ccfe)>>;G=.XAB6Z2hOiL$Gl1b.;A=2",N_OPT,0x0,0x0,0x46fcb88e
- 6: .stabs "/export/home/alfred/cvs/breakpad/google-breakpad20070927/src/tools/solaris/dump_syms/testdata/; /ws/on10-tools-prc/SUNWspro/SS11/prod/bin/CC -g -xs -xdebugformat=stabs -I../../.. -I../../../common/solaris -D_REENTRANT -xs dump_syms_regtest.cc -Qoption ccfe -prefix -Qoption ccfe .XAB6Z2hOiL\$Gl1b.",N_CMDLINE,0x0,0x0,0x0
- 7: .stabs "__1nPgoogle_breakpadBC_:U",N_ESYM,0x0,0x0,0x0
- 8: .stabs "main",N_MAIN,0x0,0x0,0x0
- 9: .stabs "main",N_FUN,0x0,0x0,0x0
- 10: .stabs "__1cPgoogle_breakpadBC2t6M_v_",N_FUN,0x0,0x0,0x0
- 11: .stabs "__1cPgoogle_breakpadBC2T6M_v_",N_FUN,0x0,0x0,0x0
- 12: .stabs "__1cPgoogle_breakpadBCKset_member6Mi_v_",N_FUN,0x0,0x0,0x0
- 13: .stabs "__1cPgoogle_breakpadBCBf6M_v_",N_FUN,0x0,0x0,0x0
- 14: .stabs "__1cPgoogle_breakpadBCBg6M_i_",N_FUN,0x0,0x0,0x0
- 15: .stabs "__1cPgoogle_breakpadBCBh6Frk1_pc_",N_FUN,0x0,0x0,0x0
- 16: .stabs "__1cPgoogle_breakpadBC2T5B6M_v_",N_FUN,0x0,0x0,0x0
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym
deleted file mode 100644
index 44d3c5391c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/testdata/dump_syms_regtest.sym
+++ /dev/null
@@ -1,33 +0,0 @@
-MODULE solaris x86 3DC8191474338D8587339B5FB3E2C62A0 dump_syms_regtest.o
-FILE 0 dump_syms_regtest.cc
-FUNC 0 156 0 main
-12 18 57 0
-1e 12 58 0
-36 24 59 0
-42 12 60 0
-57 21 61 0
-6c 21 63 0
-9c 48 64 0
-FUNC 0 16 0 int google_breakpad::i()
-6 6 51 0
-10 10 52 0
-FUNC 0 37 0 google_breakpad::C::C()
-25 37 36 0
-FUNC 0 3 0 google_breakpad::C::~C()
-3 3 37 0
-FUNC 0 12 0 void google_breakpad::C::set_member(int)
-3 3 39 0
-c 9 39 0
-FUNC 0 29 0 void google_breakpad::C::f()
-3 3 42 0
-1d 26 42 0
-FUNC 0 16 0 int google_breakpad::C::g()
-6 6 43 0
-10 10 43 0
-FUNC 0 16 0 char*google_breakpad::C::h(const google_breakpad::C&)
-6 6 44 0
-10 10 44 0
-FUNC 0 15 0 google_breakpad::C::~C #Nvariant 1()
-f 15 37 0
-FUNC 0 0 0 __SLIP.DELETER__A
-FUNC 0 0 0 void operator delete(void*)
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/tools.gyp b/toolkit/crashreporter/google-breakpad/src/tools/tools.gyp
deleted file mode 100644
index e6a4210fec..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/tools.gyp
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright 2014 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'conditions': [
- ['OS=="mac"', {
- 'includes': ['mac/tools_mac.gypi'],
- }],
- ['OS=="linux"', {
- 'includes': ['linux/tools_linux.gypi'],
- }],
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/dump_syms.exe b/toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/dump_syms.exe
deleted file mode 100644
index ca4676f502..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/dump_syms.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/symupload.exe b/toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/symupload.exe
deleted file mode 100644
index ba319b269f..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/binaries/symupload.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc b/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc
deleted file mode 100644
index dd3f770f55..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.cc
+++ /dev/null
@@ -1,576 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ms_symbol_server_converter.cc: Obtain symbol files from a Microsoft
-// symbol server, and convert them to Breakpad's dumped format.
-//
-// See ms_symbol_server_converter.h for documentation.
-//
-// Author: Mark Mentovai
-
-#include <windows.h>
-#include <dbghelp.h>
-
-#include <cassert>
-#include <cstdio>
-
-#include "tools/windows/converter/ms_symbol_server_converter.h"
-#include "common/windows/pdb_source_line_writer.h"
-#include "common/windows/string_utils-inl.h"
-
-// SYMOPT_NO_PROMPTS is not defined in earlier platform SDKs. Define it
-// in that case, in the event that this code is used with a newer version
-// of DbgHelp at runtime that recognizes the option. The presence of this
-// bit in the symbol options should not harm earlier versions of DbgHelp.
-#ifndef SYMOPT_NO_PROMPTS
-#define SYMOPT_NO_PROMPTS 0x00080000
-#endif // SYMOPT_NO_PROMPTS
-
-namespace google_breakpad {
-
-// Use sscanf_s if it is available, to quench the warning about scanf being
-// deprecated. Use scanf where sscanf_is not available. Note that the
-// parameters passed to sscanf and sscanf_s are only compatible as long as
-// fields of type c, C, s, S, and [ are not used.
-#if _MSC_VER >= 1400 // MSVC 2005/8
-#define SSCANF sscanf_s
-#else // _MSC_VER >= 1400
-#define SSCANF sscanf
-#endif // _MSC_VER >= 1400
-
-bool GUIDOrSignatureIdentifier::InitializeFromString(
- const string &identifier) {
- type_ = TYPE_NONE;
-
- size_t length = identifier.length();
-
- if (length > 32 && length <= 40) {
- // GUID
- if (SSCANF(identifier.c_str(),
- "%08X%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X%X",
- &guid_.Data1, &guid_.Data2, &guid_.Data3,
- &guid_.Data4[0], &guid_.Data4[1],
- &guid_.Data4[2], &guid_.Data4[3],
- &guid_.Data4[4], &guid_.Data4[5],
- &guid_.Data4[6], &guid_.Data4[7],
- &age_) != 12) {
- return false;
- }
-
- type_ = TYPE_GUID;
- } else if (length > 8 && length <= 15) {
- // Signature
- if (SSCANF(identifier.c_str(), "%08X%x", &signature_, &age_) != 2) {
- return false;
- }
-
- type_ = TYPE_SIGNATURE;
- } else {
- return false;
- }
-
- return true;
-}
-
-#undef SSCANF
-
-MSSymbolServerConverter::MSSymbolServerConverter(
- const string &local_cache, const vector<string> &symbol_servers)
- : symbol_path_(),
- fail_dns_(false),
- fail_timeout_(false),
- fail_not_found_(false) {
- // Setting local_cache can be done without verifying that it exists because
- // SymSrv will create it if it is missing - any creation failures will occur
- // at that time, so there's nothing to check here, making it safe to
- // assign this in the constructor.
-
- assert(symbol_servers.size() > 0);
-
-#if !defined(NDEBUG)
- // These are characters that are interpreted as having special meanings in
- // symbol_path_.
- const char kInvalidCharacters[] = "*;";
- assert(local_cache.find_first_of(kInvalidCharacters) == string::npos);
-#endif // !defined(NDEBUG)
-
- for (vector<string>::const_iterator symbol_server = symbol_servers.begin();
- symbol_server != symbol_servers.end();
- ++symbol_server) {
- // The symbol path format is explained by
- // http://msdn.microsoft.com/library/en-us/debug/base/using_symsrv.asp .
- // "srv*" is the same as "symsrv*symsrv.dll*", which means that
- // symsrv.dll is to be responsible for locating symbols. symsrv.dll
- // interprets the rest of the string as a series of symbol stores separated
- // by '*'. "srv*local_cache*symbol_server" means to check local_cache
- // first for the symbol file, and if it is not found there, to check
- // symbol_server. Symbol files found on the symbol server will be placed
- // in the local cache, decompressed.
- //
- // Multiple specifications in this format may be presented, separated by
- // semicolons.
-
- assert((*symbol_server).find_first_of(kInvalidCharacters) == string::npos);
- symbol_path_ += "srv*" + local_cache + "*" + *symbol_server + ";";
- }
-
- // Strip the trailing semicolon.
- symbol_path_.erase(symbol_path_.length() - 1);
-}
-
-// A stack-based class that manages SymInitialize and SymCleanup calls.
-class AutoSymSrv {
- public:
- AutoSymSrv() : initialized_(false) {}
-
- ~AutoSymSrv() {
- if (!Cleanup()) {
- // Print the error message here, because destructors have no return
- // value.
- fprintf(stderr, "~AutoSymSrv: SymCleanup: error %d\n", GetLastError());
- }
- }
-
- bool Initialize(HANDLE process, char *path, bool invade_process) {
- process_ = process;
- initialized_ = SymInitialize(process, path, invade_process) == TRUE;
- return initialized_;
- }
-
- bool Cleanup() {
- if (initialized_) {
- if (SymCleanup(process_)) {
- initialized_ = false;
- return true;
- }
- return false;
- }
-
- return true;
- }
-
- private:
- HANDLE process_;
- bool initialized_;
-};
-
-// A stack-based class that "owns" a pathname and deletes it when destroyed,
-// unless told not to by having its Release() method called. Early deletions
-// are supported by calling Delete().
-class AutoDeleter {
- public:
- explicit AutoDeleter(const string &path) : path_(path) {}
-
- ~AutoDeleter() {
- int error;
- if ((error = Delete()) != 0) {
- // Print the error message here, because destructors have no return
- // value.
- fprintf(stderr, "~AutoDeleter: Delete: error %d for %s\n",
- error, path_.c_str());
- }
- }
-
- int Delete() {
- if (path_.empty())
- return 0;
-
- int error = remove(path_.c_str());
- Release();
- return error;
- }
-
- void Release() {
- path_.clear();
- }
-
- private:
- string path_;
-};
-
-MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocateFile(const string &debug_or_code_file,
- const string &debug_or_code_id,
- const string &version,
- string *file_name) {
- assert(file_name);
- file_name->clear();
-
- GUIDOrSignatureIdentifier identifier;
- if (!identifier.InitializeFromString(debug_or_code_id)) {
- fprintf(stderr,
- "LocateFile: Unparseable identifier for %s %s %s\n",
- debug_or_code_file.c_str(),
- debug_or_code_id.c_str(),
- version.c_str());
- return LOCATE_FAILURE;
- }
-
- HANDLE process = GetCurrentProcess(); // CloseHandle is not needed.
- AutoSymSrv symsrv;
- if (!symsrv.Initialize(process,
- const_cast<char *>(symbol_path_.c_str()),
- false)) {
- fprintf(stderr, "LocateFile: SymInitialize: error %d for %s %s %s\n",
- GetLastError(),
- debug_or_code_file.c_str(),
- debug_or_code_id.c_str(),
- version.c_str());
- return LOCATE_FAILURE;
- }
-
- if (!SymRegisterCallback64(process, SymCallback,
- reinterpret_cast<ULONG64>(this))) {
- fprintf(stderr,
- "LocateFile: SymRegisterCallback64: error %d for %s %s %s\n",
- GetLastError(),
- debug_or_code_file.c_str(),
- debug_or_code_id.c_str(),
- version.c_str());
- return LOCATE_FAILURE;
- }
-
- // SYMOPT_DEBUG arranges for SymCallback to be called with additional
- // debugging information. This is used to determine the nature of failures.
- DWORD options = SymGetOptions() | SYMOPT_DEBUG | SYMOPT_NO_PROMPTS |
- SYMOPT_FAIL_CRITICAL_ERRORS | SYMOPT_SECURE;
- SymSetOptions(options);
-
- // SymCallback will set these as needed inisde the SymFindFileInPath call.
- fail_dns_ = false;
- fail_timeout_ = false;
- fail_not_found_ = false;
-
- // Do the lookup.
- char path[MAX_PATH];
- if (!SymFindFileInPath(
- process, NULL,
- const_cast<char *>(debug_or_code_file.c_str()),
- const_cast<void *>(identifier.guid_or_signature_pointer()),
- identifier.age(), 0,
- identifier.type() == GUIDOrSignatureIdentifier::TYPE_GUID ?
- SSRVOPT_GUIDPTR : SSRVOPT_DWORDPTR,
- path, SymFindFileInPathCallback, this)) {
- DWORD error = GetLastError();
- if (error == ERROR_FILE_NOT_FOUND) {
- // This can be returned for a number of reasons. Use the crumbs
- // collected by SymCallback to determine which one is relevant.
-
- // These errors are possibly transient.
- if (fail_dns_ || fail_timeout_) {
- return LOCATE_RETRY;
- }
-
- // This is an authoritiative file-not-found message.
- if (fail_not_found_) {
- fprintf(stderr,
- "LocateFile: SymFindFileInPath: LOCATE_NOT_FOUND error "
- "for %s %s %s\n",
- debug_or_code_file.c_str(),
- debug_or_code_id.c_str(),
- version.c_str());
- return LOCATE_NOT_FOUND;
- }
-
- // If the error is FILE_NOT_FOUND but none of the known error
- // conditions are matched, fall through to LOCATE_FAILURE.
- }
-
- fprintf(stderr,
- "LocateFile: SymFindFileInPath: error %d for %s %s %s\n",
- error,
- debug_or_code_file.c_str(),
- debug_or_code_id.c_str(),
- version.c_str());
- return LOCATE_FAILURE;
- }
-
- // Making sure path is null-terminated.
- path[MAX_PATH - 1] = '\0';
-
- // The AutoDeleter ensures that the file is only kept when returning
- // LOCATE_SUCCESS.
- AutoDeleter deleter(path);
-
- // Do the cleanup here even though it will happen when symsrv goes out of
- // scope, to allow it to influence the return value.
- if (!symsrv.Cleanup()) {
- fprintf(stderr, "LocateFile: SymCleanup: error %d for %s %s %s\n",
- GetLastError(),
- debug_or_code_file.c_str(),
- debug_or_code_id.c_str(),
- version.c_str());
- return LOCATE_FAILURE;
- }
-
- deleter.Release();
-
- printf("Downloaded: %s\n", path);
- *file_name = path;
- return LOCATE_SUCCESS;
-}
-
-
-MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocatePEFile(const MissingSymbolInfo &missing,
- string *pe_file) {
- return LocateFile(missing.code_file, missing.code_identifier,
- missing.version, pe_file);
-}
-
-MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocateSymbolFile(const MissingSymbolInfo &missing,
- string *symbol_file) {
- return LocateFile(missing.debug_file, missing.debug_identifier,
- missing.version, symbol_file);
-}
-
-
-// static
-BOOL CALLBACK MSSymbolServerConverter::SymCallback(HANDLE process,
- ULONG action,
- ULONG64 data,
- ULONG64 context) {
- MSSymbolServerConverter *self =
- reinterpret_cast<MSSymbolServerConverter *>(context);
-
- switch (action) {
- case CBA_EVENT: {
- IMAGEHLP_CBA_EVENT *cba_event =
- reinterpret_cast<IMAGEHLP_CBA_EVENT *>(data);
-
- // Put the string into a string object to be able to use string::find
- // for substring matching. This is important because the not-found
- // message does not use the entire string but is appended to the URL
- // that SymSrv attempted to retrieve.
- string desc(cba_event->desc);
-
- // desc_action maps strings (in desc) to boolean pointers that are to
- // be set to true if the string matches.
- struct desc_action {
- const char *desc; // The substring to match.
- bool *action; // On match, this pointer will be set to true.
- };
-
- static const desc_action desc_actions[] = {
- // When a DNS error occurs, it could be indiciative of network
- // problems.
- { "SYMSRV: The server name or address could not be resolved\n",
- &self->fail_dns_ },
-
- // This message is produced if no connection is opened.
- { "SYMSRV: A connection with the server could not be established\n",
- &self->fail_timeout_ },
-
- // This message is produced if a connection is established but the
- // server fails to respond to the HTTP request.
- { "SYMSRV: The operation timed out\n",
- &self->fail_timeout_ },
-
- // This message is produced when the requested file is not found,
- // even if one or more of the above messages are also produced.
- // It's trapped to distinguish between not-found and unknown-failure
- // conditions. Note that this message will not be produced if a
- // connection is established and the server begins to respond to the
- // HTTP request but does not finish transmitting the file.
- { " not found\n",
- &self->fail_not_found_ }
- };
-
- for (int desc_action_index = 0;
- desc_action_index < sizeof(desc_actions) / sizeof(desc_action);
- ++desc_action_index) {
- if (desc.find(desc_actions[desc_action_index].desc) != string::npos) {
- *(desc_actions[desc_action_index].action) = true;
- break;
- }
- }
-
- break;
- }
- }
-
- // This function is a mere fly on the wall. Treat everything as unhandled.
- return FALSE;
-}
-
-// static
-BOOL CALLBACK MSSymbolServerConverter::SymFindFileInPathCallback(
- const char *filename, void *context) {
- // FALSE ends the search, indicating that the located symbol file is
- // satisfactory.
- return FALSE;
-}
-
-MSSymbolServerConverter::LocateResult
-MSSymbolServerConverter::LocateAndConvertSymbolFile(
- const MissingSymbolInfo &missing,
- bool keep_symbol_file,
- bool keep_pe_file,
- string *converted_symbol_file,
- string *symbol_file,
- string *out_pe_file) {
- assert(converted_symbol_file);
- converted_symbol_file->clear();
- if (symbol_file) {
- symbol_file->clear();
- }
-
- string pdb_file;
- LocateResult result = LocateSymbolFile(missing, &pdb_file);
- if (result != LOCATE_SUCCESS) {
- return result;
- }
-
- if (symbol_file && keep_symbol_file) {
- *symbol_file = pdb_file;
- }
-
- // The conversion of a symbol file for a Windows 64-bit module requires
- // loading of the executable file. If there is no executable file, convert
- // using only the PDB file. Without an executable file, the conversion will
- // fail for 64-bit modules but it should succeed for 32-bit modules.
- string pe_file;
- result = LocatePEFile(missing, &pe_file);
- if (result != LOCATE_SUCCESS) {
- fprintf(stderr, "WARNING: Could not download: %s\n", pe_file.c_str());
- }
-
- if (out_pe_file && keep_pe_file) {
- *out_pe_file = pe_file;
- }
-
- // Conversion may fail because the file is corrupt. If a broken file is
- // kept in the local cache, LocateSymbolFile will not hit the network again
- // to attempt to locate it. To guard against problems like this, the
- // symbol file in the local cache will be removed if conversion fails.
- AutoDeleter pdb_deleter(pdb_file);
- AutoDeleter pe_deleter(pe_file);
-
- // Be sure that it's a .pdb file, since we'll be replacing .pdb with .sym
- // for the converted file's name.
- string pdb_extension = pdb_file.substr(pdb_file.length() - 4);
- // strcasecmp is called _stricmp here.
- if (_stricmp(pdb_extension.c_str(), ".pdb") != 0) {
- fprintf(stderr, "LocateAndConvertSymbolFile: "
- "no .pdb extension for %s %s %s %s\n",
- missing.debug_file.c_str(),
- missing.debug_identifier.c_str(),
- missing.version.c_str(),
- pdb_file.c_str());
- return LOCATE_FAILURE;
- }
-
- PDBSourceLineWriter writer;
- wstring pe_file_w;
- if (!WindowsStringUtils::safe_mbstowcs(pe_file, &pe_file_w)) {
- fprintf(stderr,
- "LocateAndConvertSymbolFile: "
- "WindowsStringUtils::safe_mbstowcs failed for %s\n",
- pe_file.c_str());
- return LOCATE_FAILURE;
- }
- wstring pdb_file_w;
- if (!WindowsStringUtils::safe_mbstowcs(pdb_file, &pdb_file_w)) {
- fprintf(stderr,
- "LocateAndConvertSymbolFile: "
- "WindowsStringUtils::safe_mbstowcs failed for %s\n",
- pdb_file_w.c_str());
- return LOCATE_FAILURE;
- }
- if (!writer.Open(pdb_file_w, PDBSourceLineWriter::PDB_FILE)) {
- fprintf(stderr,
- "ERROR: PDBSourceLineWriter::Open failed for %s %s %s %ws\n",
- missing.debug_file.c_str(), missing.debug_identifier.c_str(),
- missing.version.c_str(), pdb_file_w.c_str());
- return LOCATE_FAILURE;
- }
- if (!writer.SetCodeFile(pe_file_w)) {
- fprintf(stderr,
- "ERROR: PDBSourceLineWriter::SetCodeFile failed for %s %s %s %ws\n",
- missing.debug_file.c_str(), missing.debug_identifier.c_str(),
- missing.version.c_str(), pe_file_w.c_str());
- return LOCATE_FAILURE;
- }
-
- *converted_symbol_file = pdb_file.substr(0, pdb_file.length() - 4) + ".sym";
-
- FILE *converted_output = NULL;
-#if _MSC_VER >= 1400 // MSVC 2005/8
- errno_t err;
- if ((err = fopen_s(&converted_output, converted_symbol_file->c_str(), "w"))
- != 0) {
-#else // _MSC_VER >= 1400
- // fopen_s and errno_t were introduced in MSVC8. Use fopen for earlier
- // environments. Don't use fopen with MSVC8 and later, because it's
- // deprecated. fopen does not provide reliable error codes, so just use
- // -1 in the event of a failure.
- int err;
- if (!(converted_output = fopen(converted_symbol_file->c_str(), "w"))) {
- err = -1;
-#endif // _MSC_VER >= 1400
- fprintf(stderr, "LocateAndConvertSymbolFile: "
- "fopen_s: error %d for %s %s %s %s\n",
- err,
- missing.debug_file.c_str(),
- missing.debug_identifier.c_str(),
- missing.version.c_str(),
- converted_symbol_file->c_str());
- return LOCATE_FAILURE;
- }
-
- AutoDeleter sym_deleter(*converted_symbol_file);
-
- bool success = writer.WriteMap(converted_output);
- fclose(converted_output);
-
- if (!success) {
- fprintf(stderr, "LocateAndConvertSymbolFile: "
- "PDBSourceLineWriter::WriteMap failed for %s %s %s %s\n",
- missing.debug_file.c_str(),
- missing.debug_identifier.c_str(),
- missing.version.c_str(),
- pdb_file.c_str());
- return LOCATE_FAILURE;
- }
-
- if (keep_symbol_file) {
- pdb_deleter.Release();
- }
-
- if (keep_pe_file) {
- pe_deleter.Release();
- }
-
- sym_deleter.Release();
-
- return LOCATE_SUCCESS;
-}
-
-} // namespace google_breakpad
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.gyp b/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.gyp
deleted file mode 100644
index 57ec790686..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.gyp
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'ms_symbol_server_converter',
- 'type': 'static_library',
- 'msvs_guid': '1463C4CD-23FC-4DE9-BFDE-283338200157',
- 'sources': [
- 'ms_symbol_server_converter.cc',
- ],
- 'dependencies': [
- '../../../common/windows/common_windows.gyp:common_windows_lib',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.h b/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.h
deleted file mode 100644
index d601b4333c..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/converter/ms_symbol_server_converter.h
+++ /dev/null
@@ -1,219 +0,0 @@
-// Copyright (c) 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// ms_symbol_server_converter.h: Obtain symbol files from a Microsoft
-// symbol server, and convert them to Breakpad's dumped format.
-//
-// At runtime, MSSymbolServerConverter and code that it calls depend on being
-// able to locate suitable versions of dbghelp.dll and symsrv.dll. For best
-// results, place these files in the same directory as the executable.
-// dbghelp.dll and symsrv.dll as supplied with Debugging Tools for Windows are
-// both redistributable, as indicated by the package's redist.txt file.
-//
-// When connecting to Microsoft's symbol server at
-// http://msdl.microsoft.com/download/symbols/, which provides access to
-// symbols for the operating system itself, symsrv.dll requires agreement to
-// Microsoft's "Terms of Use for Microsoft Symbols and Binaries." Because this
-// library places the symbol engine into a promptless mode, the dialog with the
-// terms will not appear, and use of Microsoft's symbol server will not be
-// possible. To indicate agreement to the terms, create a file called
-// symsrv.yes in the same directory as symsrv.dll. (Note that symsrv.dll will
-// also recognize a symsrv.no file as indicating that you do not accept the
-// terms; the .yes file takes priority over the .no file.) The terms of use
-// are contained within symsrv.dll; they were formerly available online at
-// http://www.microsoft.com/whdc/devtools/debugging/symsrvTOU2.mspx , but
-// do not appear to be available online any longer as of January, 2007. It is
-// possible to view the terms from within WinDbg (Debugging Tools for Windows)
-// by removing any symsrv.yes and symsrv.no files from WinDbg's directory,
-// setting the symbol path to include Microsoft's symbol server (.sympath), and
-// attempting to load symbols from their server (.reload).
-//
-// This code has been tested with dbghelp.dll 6.5.3.7 and symsrv.dll 6.5.3.8,
-// included with Microsoft Visual Studio 8 in Common7/IDE. This has also been
-// tested with dbghelp.dll and symsrv.dll versions 6.6.7.5 and 6.12.2.633,
-// included with the same versions of Debugging Tools for Windows, available at
-// http://www.microsoft.com/whdc/devtools/debugging/ .
-//
-// Author: Mark Mentovai
-
-#ifndef TOOLS_WINDOWS_MS_SYMBOL_SERVER_CONVERTER_H_
-#define TOOLS_WINDOWS_MS_SYMBOL_SERVER_CONVERTER_H_
-
-#include <windows.h>
-
-#include <string>
-#include <vector>
-
-namespace google_breakpad {
-
-using std::string;
-using std::vector;
-
-// MissingSymbolInfo contains the subset of the information in the processor's
-// CodeModule structure relevant to obtaining a missing symbol file. Only
-// debug_file and debug_identifier are relevant in actually obtaining the
-// missing file; the other fields are for convenience.
-struct MissingSymbolInfo {
- string code_file;
- string code_identifier;
- string debug_file;
- string debug_identifier;
- string version;
-};
-
-class GUIDOrSignatureIdentifier {
- public:
- enum GUIDOrSignatureType {
- TYPE_NONE = 0,
- TYPE_GUID,
- TYPE_SIGNATURE
- };
-
- GUIDOrSignatureIdentifier() : type_(TYPE_NONE) {}
-
- // Converts |identifier|, a debug_identifier-formatted string, into its
- // component fields: either a GUID and age, or signature and age. If
- // successful, sets the relevant fields in the object, including the type
- // field, and returns true. On error, returns false.
- bool InitializeFromString(const string &identifier);
-
- GUIDOrSignatureType type() const { return type_; }
- GUID guid() const { return guid_; }
- DWORD signature() const { return signature_; }
- int age() const { return age_; }
- const void *guid_or_signature_pointer() const { return &guid_; }
-
- private:
- GUIDOrSignatureType type_;
-
- // An identifier contains either a 128-bit uuid or a 32-bit signature.
- union {
- GUID guid_;
- DWORD signature_;
- };
-
- // All identifiers used here have age fields, which indicate a specific
- // revision given a uuid or signature.
- int age_;
-};
-
-class MSSymbolServerConverter {
- public:
- enum LocateResult {
- LOCATE_FAILURE = 0,
- LOCATE_NOT_FOUND, // Authoritative: the file is not present.
- LOCATE_RETRY, // Transient (network?) error, try again later.
- LOCATE_SUCCESS
- };
-
- // Create a new object. local_cache is the location (pathname) of a local
- // symbol store used to hold downloaded and converted symbol files. This
- // directory will be created by LocateSymbolFile when it successfully
- // retrieves a symbol file. symbol_servers contains a list of locations (URLs
- // or pathnames) of the upstream symbol server stores, given in order of
- // preference, with the first string in the vector identifying the first
- // store to try. The vector must contain at least one string. None of the
- // strings passed to this constructor may contain asterisk ('*') or semicolon
- // (';') characters, as the symbol engine uses these characters as separators.
- MSSymbolServerConverter(const string &local_cache,
- const vector<string> &symbol_servers);
-
- // Locates the PE file (DLL or EXE) specified by the identifying information
- // in |missing|, by checking the symbol stores identified when the object
- // was created. When returning LOCATE_SUCCESS, pe_file is set to
- // the pathname of the decompressed PE file as it is stored in the
- // local cache.
- LocateResult LocatePEFile(const MissingSymbolInfo &missing, string *pe_file);
-
- // Locates the symbol file specified by the identifying information in
- // |missing|, by checking the symbol stores identified when the object
- // was created. When returning LOCATE_SUCCESS, symbol_file is set to
- // the pathname of the decompressed symbol file as it is stored in the
- // local cache.
- LocateResult LocateSymbolFile(const MissingSymbolInfo &missing,
- string *symbol_file);
-
- // Calls LocateSymbolFile and converts the returned symbol file to the
- // dumped-symbol format, storing it adjacent to the symbol file. The
- // only conversion supported is from pdb files. Returns the return
- // value of LocateSymbolFile, or if LocateSymbolFile succeeds but
- // conversion fails, returns LOCATE_FAILURE. The pathname to the
- // pdb file and to the converted symbol file are returned in
- // |converted_symbol_file|, |symbol_file|, and |pe_file|. |symbol_file| and
- // |pe_file| are optional and may be NULL. If only the converted symbol file
- // is desired, set |keep_symbol_file| and |keep_pe_file| to false to indicate
- // that the original symbol file (pdb) and executable file (exe, dll) should
- // be deleted after conversion.
- LocateResult LocateAndConvertSymbolFile(const MissingSymbolInfo &missing,
- bool keep_symbol_file,
- bool keep_pe_file,
- string *converted_symbol_file,
- string *symbol_file,
- string *pe_file);
-
- private:
- // Locates the PDB or PE file (DLL or EXE) specified by the identifying
- // information in |debug_or_code_file| and |debug_or_code_id|, by checking
- // the symbol stores identified when the object was created. When
- // returning LOCATE_SUCCESS, file_name is set to the pathname of the
- // decompressed PDB or PE file file as it is stored in the local cache.
- LocateResult LocateFile(const string &debug_or_code_file,
- const string &debug_or_code_id,
- const string &version, string *file_name);
-
- // Called by various SymSrv functions to report status as progress is made
- // and to allow the callback to influence processing. Messages sent to this
- // callback can be used to distinguish between the various failure modes
- // that SymFindFileInPath might encounter.
- static BOOL CALLBACK SymCallback(HANDLE process, ULONG action, ULONG64 data,
- ULONG64 context);
-
- // Called by SymFindFileInPath (in LocateSymbolFile) after a candidate
- // symbol file is located, when it's present in the local cache.
- // SymFindFileInPath actually seems to accept NULL for a callback function
- // and behave properly for our needs in that case, but the documentation
- // doesn't mention it, so this little callback is provided.
- static BOOL CALLBACK SymFindFileInPathCallback(const char *filename,
- void *context);
-
- // The search path used by SymSrv, built based on the arguments to the
- // constructor.
- string symbol_path_;
-
- // SymCallback will set at least one of these failure variables if
- // SymFindFileInPath fails for an expected reason.
- bool fail_dns_; // DNS failures (fail_not_found_ will also be set).
- bool fail_timeout_; // Timeouts (fail_not_found_ will also be set).
- bool fail_not_found_; // The file could not be found. If this is the only
- // fail_* member set, then it is authoritative.
-};
-
-} // namespace google_breakpad
-
-#endif // TOOLS_WINDOWS_MS_SYMBOL_SERVER_CONVERTER_H_
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.cc b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.cc
deleted file mode 100644
index 3e8827b613..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Windows utility to dump the line number data from a pdb file to
-// a text-based format that we can use from the minidump processor.
-
-#include <stdio.h>
-
-#include <string>
-
-#include "common/windows/pdb_source_line_writer.h"
-
-using std::wstring;
-using google_breakpad::PDBSourceLineWriter;
-
-int wmain(int argc, wchar_t **argv) {
- if (argc < 2) {
- fprintf(stderr, "Usage: %ws <file.[pdb|exe|dll]>\n", argv[0]);
- return 1;
- }
-
- PDBSourceLineWriter writer;
- if (!writer.Open(wstring(argv[1]), PDBSourceLineWriter::ANY_FILE)) {
- fprintf(stderr, "Open failed\n");
- return 1;
- }
-
- if (!writer.WriteMap(stdout)) {
- fprintf(stderr, "WriteMap failed\n");
- return 1;
- }
-
- writer.Close();
- return 0;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.gyp b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.gyp
deleted file mode 100644
index b815574b29..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms.gyp
+++ /dev/null
@@ -1,64 +0,0 @@
-# Copyright 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'dump_syms',
- 'type': 'executable',
- 'sources': [
- 'dump_syms.cc',
- ],
- 'dependencies': [
- '../../../common/windows/common_windows.gyp:common_windows_lib',
- ],
- },
- {
- 'target_name': 'dump_syms_unittest',
- 'type': 'executable',
- 'sources': [
- 'dump_syms_unittest.cc',
- ],
- 'dependencies': [
- '<(DEPTH)/client/windows/unittests/testing.gyp:gmock',
- '<(DEPTH)/client/windows/unittests/testing.gyp:gtest',
- 'dump_syms',
- ],
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'AdditionalDependencies': [
- 'shell32.lib',
- ],
- },
- },
- },
- ],
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc
deleted file mode 100644
index 61f84431ed..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/dump_syms_unittest.cc
+++ /dev/null
@@ -1,204 +0,0 @@
-// Copyright 2003 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <Windows.h>
-#include <shellapi.h>
-
-#include <string>
-#include <utility>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace tools {
-namespace windows {
-namespace dump_syms {
-
-namespace {
-
-// Root names of PDB and dumped symbol files to be regression tested. These are
-// specified in complexity of the resulting dumped symbol files.
-const wchar_t* kRootNames[] = {
- // A PDB file with no OMAP data.
- L"dump_syms_regtest",
- // A PDB file with OMAP data for an image that has been function-level
- // reordered.
- L"omap_reorder_funcs",
- // A PDB file with OMAP data for an image that had new content injected, all
- // of it with source data.
- L"omap_stretched_filled",
- // A PDB file with OMAP data for an image that had new content injected, but
- // without source data.
- L"omap_stretched",
- // A PDB file with OMAP data for an image that has been basic block reordered.
- L"omap_reorder_bbs",
- // A 64bit PDB file with no OMAP data.
- L"dump_syms_regtest64",
-};
-
-void TrimLastComponent(const std::wstring& path,
- std::wstring* trimmed,
- std::wstring* component) {
- size_t len = path.size();
- while (len > 0 && path[len - 1] != '\\')
- --len;
-
- if (component != NULL)
- component->assign(path.c_str() + len, path.c_str() + path.size());
-
- while (len > 0 && path[len - 1] == '\\')
- --len;
-
- if (trimmed != NULL)
- trimmed->assign(path.c_str(), len);
-}
-
-// Get the directory of the current executable.
-bool GetSelfDirectory(std::wstring* self_dir) {
- std::wstring command_line = GetCommandLineW();
-
- int num_args = 0;
- wchar_t** args = NULL;
- args = ::CommandLineToArgvW(command_line.c_str(), &num_args);
- if (args == NULL)
- return false;
-
- *self_dir = args[0];
- TrimLastComponent(*self_dir, self_dir, NULL);
-
- return true;
-}
-
-void RunCommand(const std::wstring& command_line,
- std::string* stdout_string) {
- // Create a PIPE for the child process stdout.
- HANDLE child_stdout_read = 0;
- HANDLE child_stdout_write = 0;
- SECURITY_ATTRIBUTES sec_attr_stdout = {};
- sec_attr_stdout.nLength = sizeof(sec_attr_stdout);
- sec_attr_stdout.bInheritHandle = TRUE;
- ASSERT_TRUE(::CreatePipe(&child_stdout_read, &child_stdout_write,
- &sec_attr_stdout, 0));
- ASSERT_TRUE(::SetHandleInformation(child_stdout_read, HANDLE_FLAG_INHERIT,
- 0));
-
- // Create a PIPE for the child process stdin.
- HANDLE child_stdin_read = 0;
- HANDLE child_stdin_write = 0;
- SECURITY_ATTRIBUTES sec_attr_stdin = {};
- sec_attr_stdin.nLength = sizeof(sec_attr_stdin);
- sec_attr_stdin.bInheritHandle = TRUE;
- ASSERT_TRUE(::CreatePipe(&child_stdin_read, &child_stdin_write,
- &sec_attr_stdin, 0));
- ASSERT_TRUE(::SetHandleInformation(child_stdin_write, HANDLE_FLAG_INHERIT,
- 0));
-
- // Startup the child.
- STARTUPINFO startup_info = {};
- PROCESS_INFORMATION process_info = {};
- startup_info.cb = sizeof(STARTUPINFO);
- startup_info.hStdError = child_stdout_write;
- startup_info.hStdInput = child_stdin_read;
- startup_info.hStdOutput = child_stdout_write;
- startup_info.dwFlags = STARTF_USESTDHANDLES;
- ASSERT_TRUE(::CreateProcessW(NULL, (LPWSTR)command_line.c_str(), NULL, NULL,
- TRUE, 0, NULL, NULL,
- &startup_info, &process_info));
-
- // Collect the output.
- ASSERT_TRUE(::CloseHandle(child_stdout_write));
- char buffer[4096] = {};
- DWORD bytes_read = 0;
- while (::ReadFile(child_stdout_read, buffer, sizeof(buffer), &bytes_read,
- NULL) && bytes_read > 0) {
- stdout_string->append(buffer, bytes_read);
- }
-
- // Wait for the process to finish.
- ::WaitForSingleObject(process_info.hProcess, INFINITE);
-
- // Shut down all of our handles.
- ASSERT_TRUE(::CloseHandle(process_info.hThread));
- ASSERT_TRUE(::CloseHandle(process_info.hProcess));
- ASSERT_TRUE(::CloseHandle(child_stdin_write));
- ASSERT_TRUE(::CloseHandle(child_stdin_read));
- ASSERT_TRUE(::CloseHandle(child_stdout_read));
-}
-
-void GetFileContents(const std::wstring& path, std::string* content) {
- FILE* f = ::_wfopen(path.c_str(), L"rb");
- ASSERT_TRUE(f != NULL);
-
- char buffer[4096] = {};
- while (true) {
- size_t bytes_read = ::fread(buffer, 1, sizeof(buffer), f);
- if (bytes_read == 0)
- break;
- content->append(buffer, bytes_read);
- }
-}
-
-class DumpSymsRegressionTest : public testing::Test {
- public:
- virtual void SetUp() {
- std::wstring self_dir;
- ASSERT_TRUE(GetSelfDirectory(&self_dir));
- dump_syms_exe = self_dir + L"\\dump_syms.exe";
-
- TrimLastComponent(self_dir, &testdata_dir, NULL);
- testdata_dir += L"\\testdata";
- }
-
- std::wstring dump_syms_exe;
- std::wstring testdata_dir;
-};
-
-} //namespace
-
-TEST_F(DumpSymsRegressionTest, EnsureDumpedSymbolsMatch) {
- for (size_t i = 0; i < sizeof(kRootNames) / sizeof(kRootNames[0]); ++i) {
- const wchar_t* root_name = kRootNames[i];
- std::wstring root_path = testdata_dir + L"\\" + root_name;
-
- std::wstring sym_path = root_path + L".sym";
- std::string expected_symbols;
- ASSERT_NO_FATAL_FAILURE(GetFileContents(sym_path, &expected_symbols));
-
- std::wstring pdb_path = root_path + L".pdb";
- std::wstring command_line = L"\"" + dump_syms_exe + L"\" \"" +
- pdb_path + L"\"";
- std::string symbols;
- ASSERT_NO_FATAL_FAILURE(RunCommand(command_line, &symbols));
-
- EXPECT_EQ(expected_symbols, symbols);
- }
-}
-
-} // namespace dump_syms
-} // namespace windows
-} // namespace tools \ No newline at end of file
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build
deleted file mode 100644
index 2a286da534..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/moz.build
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HostProgram('dump_syms')
-
-HOST_SOURCES += [
- '../../../common/windows/dia_util.cc',
- '../../../common/windows/guid_string.cc',
- '../../../common/windows/omap.cc',
- '../../../common/windows/pdb_source_line_writer.cc',
- '../../../common/windows/string_utils.cc',
- 'dump_syms.cc',
-]
-
-HOST_CXXFLAGS += [
- '-O2',
- '-EHsc',
- '-MD'
-]
-
-HOST_OS_LIBS += [
- 'diaguids',
- 'imagehlp'
-]
-
-LOCAL_INCLUDES += [
- '../../..'
-]
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/run_regtest.sh b/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/run_regtest.sh
deleted file mode 100755
index 1f20f64fd5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/dump_syms/run_regtest.sh
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/bin/sh
-
-# Copyright (c) 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Release/dump_syms.exe testdata/dump_syms_regtest.pdb | \
- tr -d '\015' > \
- testdata/dump_syms_regtest.new
-status=$?
-
-if [ $status -ne 0 ] ; then
- echo "FAIL, dump_syms.exe failed"
- exit $status
-fi
-
-diff -u testdata/dump_syms_regtest.new testdata/dump_syms_regtest.sym > \
- testdata/dump_syms_regtest.diff
-status=$?
-
-if [ $status -eq 0 ] ; then
- rm testdata/dump_syms_regtest.diff testdata/dump_syms_regtest.new
- echo "PASS"
-else
- echo "FAIL, see testdata/dump_syms_regtest.[new|diff]"
-fi
-
-exit $status
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/refresh_binaries.bat b/toolkit/crashreporter/google-breakpad/src/tools/windows/refresh_binaries.bat
deleted file mode 100644
index d881ae64b5..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/refresh_binaries.bat
+++ /dev/null
@@ -1,27 +0,0 @@
-REM This batch file is meant to facilitate regenerating prebuilt binaries for
-REM the Windows tools.
-REM You MUST run it from a Visual Studio xxxx Command Prompt. To do this,
-REM navigate to:
-REM
-REM Start->Programs->Microsoft Visual Studio XXXX->Tools->
-REM Visual Studio Command Prompt
-REM
-REM Then run this batch file. It performs an SVN update, edits the
-REM README.binaries file to contain
-REM the revision number, and builds the tools. You must run 'svn commit' to
-REM commit the pending edits to the repository.
-
-pushd %~dp0\..\..\
-call svn update --accept postpone
-cd tools\windows
-devenv symupload\symupload.vcproj /rebuild Release
-copy symupload\Release\symupload.exe binaries\
-REM switch back to top level so that 'svn info' displays useful information.
-cd ..\..\
-echo This checkin of the binaries was created by refresh_binaries.bat. > %TEMP%\checkin.txt
-echo Date: %DATE% %TIME% >> %TEMP%\checkin.txt
-echo Repository information (output of 'svn info') follows: >> %TEMP%\checkin.txt
-call svn info >> %TEMP%\checkin.txt
-echo Done!
-echo type 'svn commit -F %%TEMP%%\checkin.txt' to commit.
-popd
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.cc b/toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.cc
deleted file mode 100644
index fa5294ded3..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.cc
+++ /dev/null
@@ -1,259 +0,0 @@
-// Copyright (c) 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Tool to upload an exe/dll and its associated symbols to an HTTP server.
-// The PDB file is located automatically, using the path embedded in the
-// executable. The upload is sent as a multipart/form-data POST request,
-// with the following parameters:
-// code_file: the basename of the module, e.g. "app.exe"
-// debug_file: the basename of the debugging file, e.g. "app.pdb"
-// debug_identifier: the debug file's identifier, usually consisting of
-// the guid and age embedded in the pdb, e.g.
-// "11111111BBBB3333DDDD555555555555F"
-// product: the HTTP-friendly product name, e.g. "MyApp"
-// version: the file version of the module, e.g. "1.2.3.4"
-// os: the operating system that the module was built for, always
-// "windows" in this implementation.
-// cpu: the CPU that the module was built for, typically "x86".
-// symbol_file: the contents of the breakpad-format symbol file
-
-#include <windows.h>
-#include <dbghelp.h>
-#include <wininet.h>
-
-#include <cstdio>
-#include <map>
-#include <string>
-#include <vector>
-
-#include "common/windows/string_utils-inl.h"
-
-#include "common/windows/http_upload.h"
-#include "common/windows/pdb_source_line_writer.h"
-
-using std::string;
-using std::wstring;
-using std::vector;
-using std::map;
-using google_breakpad::HTTPUpload;
-using google_breakpad::PDBModuleInfo;
-using google_breakpad::PDBSourceLineWriter;
-using google_breakpad::WindowsStringUtils;
-
-// Extracts the file version information for the given filename,
-// as a string, for example, "1.2.3.4". Returns true on success.
-static bool GetFileVersionString(const wchar_t *filename, wstring *version) {
- DWORD handle;
- DWORD version_size = GetFileVersionInfoSize(filename, &handle);
- if (version_size < sizeof(VS_FIXEDFILEINFO)) {
- return false;
- }
-
- vector<char> version_info(version_size);
- if (!GetFileVersionInfo(filename, handle, version_size, &version_info[0])) {
- return false;
- }
-
- void *file_info_buffer = NULL;
- unsigned int file_info_length;
- if (!VerQueryValue(&version_info[0], L"\\",
- &file_info_buffer, &file_info_length)) {
- return false;
- }
-
- // The maximum value of each version component is 65535 (0xffff),
- // so the max length is 24, including the terminating null.
- wchar_t ver_string[24];
- VS_FIXEDFILEINFO *file_info =
- reinterpret_cast<VS_FIXEDFILEINFO*>(file_info_buffer);
- swprintf(ver_string, sizeof(ver_string) / sizeof(ver_string[0]),
- L"%d.%d.%d.%d",
- file_info->dwFileVersionMS >> 16,
- file_info->dwFileVersionMS & 0xffff,
- file_info->dwFileVersionLS >> 16,
- file_info->dwFileVersionLS & 0xffff);
-
- // remove when VC++7.1 is no longer supported
- ver_string[sizeof(ver_string) / sizeof(ver_string[0]) - 1] = L'\0';
-
- *version = ver_string;
- return true;
-}
-
-// Creates a new temporary file and writes the symbol data from the given
-// exe/dll file to it. Returns the path to the temp file in temp_file_path
-// and information about the pdb in pdb_info.
-static bool DumpSymbolsToTempFile(const wchar_t *file,
- wstring *temp_file_path,
- PDBModuleInfo *pdb_info) {
- google_breakpad::PDBSourceLineWriter writer;
- // Use EXE_FILE to get information out of the exe/dll in addition to the
- // pdb. The name and version number of the exe/dll are of value, and
- // there's no way to locate an exe/dll given a pdb.
- if (!writer.Open(file, PDBSourceLineWriter::EXE_FILE)) {
- return false;
- }
-
- wchar_t temp_path[_MAX_PATH];
- if (GetTempPath(_MAX_PATH, temp_path) == 0) {
- return false;
- }
-
- wchar_t temp_filename[_MAX_PATH];
- if (GetTempFileName(temp_path, L"sym", 0, temp_filename) == 0) {
- return false;
- }
-
- FILE *temp_file = NULL;
-#if _MSC_VER >= 1400 // MSVC 2005/8
- if (_wfopen_s(&temp_file, temp_filename, L"w") != 0)
-#else // _MSC_VER >= 1400
- // _wfopen_s was introduced in MSVC8. Use _wfopen for earlier environments.
- // Don't use it with MSVC8 and later, because it's deprecated.
- if (!(temp_file = _wfopen(temp_filename, L"w")))
-#endif // _MSC_VER >= 1400
- {
- return false;
- }
-
- bool success = writer.WriteMap(temp_file);
- fclose(temp_file);
- if (!success) {
- _wunlink(temp_filename);
- return false;
- }
-
- *temp_file_path = temp_filename;
-
- return writer.GetModuleInfo(pdb_info);
-}
-
-__declspec(noreturn) void printUsageAndExit() {
- wprintf(L"Usage:\n\n"
- L" symupload [--timeout NN] [--product product_name] ^\n"
- L" <file.exe|file.dll> <symbol upload URL> ^\n"
- L" [...<symbol upload URLs>]\n\n");
- wprintf(L" - Timeout is in milliseconds, or can be 0 to be unlimited.\n");
- wprintf(L" - product_name is an HTTP-friendly product name. It must only\n"
- L" contain an ascii subset: alphanumeric and punctuation.\n"
- L" This string is case-sensitive.\n\n");
- wprintf(L"Example:\n\n"
- L" symupload.exe --timeout 0 --product Chrome ^\n"
- L" chrome.dll http://no.free.symbol.server.for.you\n");
- exit(0);
-}
-int wmain(int argc, wchar_t *argv[]) {
- const wchar_t *module;
- const wchar_t *product = nullptr;
- int timeout = -1;
- int currentarg = 1;
- while (argc > currentarg + 1) {
- if (!wcscmp(L"--timeout", argv[currentarg])) {
- timeout = _wtoi(argv[currentarg + 1]);
- currentarg += 2;
- continue;
- }
- if (!wcscmp(L"--product", argv[currentarg])) {
- product = argv[currentarg + 1];
- currentarg += 2;
- continue;
- }
- break;
- }
-
- if (argc >= currentarg + 2)
- module = argv[currentarg++];
- else
- printUsageAndExit();
-
- wstring symbol_file;
- PDBModuleInfo pdb_info;
- if (!DumpSymbolsToTempFile(module, &symbol_file, &pdb_info)) {
- fwprintf(stderr, L"Could not get symbol data from %s\n", module);
- return 1;
- }
-
- wstring code_file = WindowsStringUtils::GetBaseName(wstring(module));
-
- map<wstring, wstring> parameters;
- parameters[L"code_file"] = code_file;
- parameters[L"debug_file"] = pdb_info.debug_file;
- parameters[L"debug_identifier"] = pdb_info.debug_identifier;
- parameters[L"os"] = L"windows"; // This version of symupload is Windows-only
- parameters[L"cpu"] = pdb_info.cpu;
-
- // Don't make a missing product name a hard error. Issue a warning and let
- // the server decide whether to reject files without product name.
- if (product) {
- parameters[L"product"] = product;
- } else {
- fwprintf(
- stderr,
- L"Warning: No product name (flag --product) was specified for %s\n",
- module);
- }
-
- // Don't make a missing version a hard error. Issue a warning, and let the
- // server decide whether to reject files without versions.
- wstring file_version;
- if (GetFileVersionString(module, &file_version)) {
- parameters[L"version"] = file_version;
- } else {
- fwprintf(stderr, L"Warning: Could not get file version for %s\n", module);
- }
-
- map<wstring, wstring> files;
- files[L"symbol_file"] = symbol_file;
-
- bool success = true;
-
- while (currentarg < argc) {
- int response_code;
- if (!HTTPUpload::SendRequest(argv[currentarg], parameters, files,
- timeout == -1 ? NULL : &timeout,
- nullptr, &response_code)) {
- success = false;
- fwprintf(stderr,
- L"Symbol file upload to %s failed. Response code = %ld\n",
- argv[currentarg], response_code);
- }
- currentarg++;
- }
-
- _wunlink(symbol_file.c_str());
-
- if (success) {
- wprintf(L"Uploaded symbols for windows-%s/%s/%s (%s %s)\n",
- pdb_info.cpu.c_str(), pdb_info.debug_file.c_str(),
- pdb_info.debug_identifier.c_str(), code_file.c_str(),
- file_version.c_str());
- }
-
- return success ? 0 : 1;
-}
diff --git a/toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.gyp b/toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.gyp
deleted file mode 100644
index d7e5fb7b97..0000000000
--- a/toolkit/crashreporter/google-breakpad/src/tools/windows/symupload/symupload.gyp
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2013 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-{
- 'includes': [
- '../../../build/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'symupload',
- 'type': 'executable',
- 'sources': [
- 'symupload.cc',
- ],
- 'dependencies': [
- '../../../common/windows/common_windows.gyp:common_windows_lib',
- ],
- },
- ],
-}
diff --git a/toolkit/crashreporter/injector/injector.cpp b/toolkit/crashreporter/injector/injector.cpp
deleted file mode 100644
index 048b42a934..0000000000
--- a/toolkit/crashreporter/injector/injector.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <windows.h>
-
-#include "client/windows/handler/exception_handler.h"
-
-using google_breakpad::ExceptionHandler;
-using std::wstring;
-
-extern "C" BOOL WINAPI DummyEntryPoint(HINSTANCE instance,
- DWORD reason,
- void* reserved)
-{
- __debugbreak();
-
- return FALSE; // We're being loaded remotely, this shouldn't happen!
-}
-
-// support.microsoft.com/kb/94248
-extern "C" BOOL WINAPI _CRT_INIT(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved);
-
-extern "C"
-__declspec(dllexport) DWORD Start(void* context)
-{
- // Because the remote DLL injector does not call DllMain, we have to
- // initialize the CRT manually
- _CRT_INIT(nullptr, DLL_PROCESS_ATTACH, nullptr);
-
- HANDLE hCrashPipe = reinterpret_cast<HANDLE>(context);
-
- ExceptionHandler* e = new (std::nothrow)
- ExceptionHandler(wstring(), nullptr, nullptr, nullptr,
- ExceptionHandler::HANDLER_ALL,
- MiniDumpNormal, hCrashPipe, nullptr);
- if (e)
- e->set_handle_debug_exceptions(true);
- return 1;
-}
diff --git a/toolkit/crashreporter/injector/moz.build b/toolkit/crashreporter/injector/moz.build
deleted file mode 100644
index 2009f823b2..0000000000
--- a/toolkit/crashreporter/injector/moz.build
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- 'injector.cpp',
-]
-
-SharedLibrary('breakpadinjector')
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src',
-]
-
-USE_STATIC_LIBS = True
-
-if CONFIG['GNU_CC']:
- LDFLAGS += ['-Wl,-e,_DummyEntryPoint@12']
-else:
- LDFLAGS += ['-ENTRY:DummyEntryPoint']
-
-DISABLE_STL_WRAPPING = True
diff --git a/toolkit/crashreporter/jar.mn b/toolkit/crashreporter/jar.mn
deleted file mode 100644
index a69b3caa87..0000000000
--- a/toolkit/crashreporter/jar.mn
+++ /dev/null
@@ -1,7 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-toolkit.jar:
- content/global/crashes.xhtml (content/crashes.xhtml)
- content/global/crashes.js (content/crashes.js)
diff --git a/toolkit/crashreporter/jsoncpp/AUTHORS b/toolkit/crashreporter/jsoncpp/AUTHORS
deleted file mode 100644
index c0fbbeec11..0000000000
--- a/toolkit/crashreporter/jsoncpp/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Baptiste Lepilleur <blep@users.sourceforge.net>
diff --git a/toolkit/crashreporter/jsoncpp/GIT-INFO b/toolkit/crashreporter/jsoncpp/GIT-INFO
deleted file mode 100644
index 7d4836e925..0000000000
--- a/toolkit/crashreporter/jsoncpp/GIT-INFO
+++ /dev/null
@@ -1 +0,0 @@
-a304d61a7b3ee2700b52abc0b28412aabee782e5
diff --git a/toolkit/crashreporter/jsoncpp/LICENSE b/toolkit/crashreporter/jsoncpp/LICENSE
deleted file mode 100644
index ca2bfe1a03..0000000000
--- a/toolkit/crashreporter/jsoncpp/LICENSE
+++ /dev/null
@@ -1,55 +0,0 @@
-The JsonCpp library's source code, including accompanying documentation,
-tests and demonstration applications, are licensed under the following
-conditions...
-
-The author (Baptiste Lepilleur) explicitly disclaims copyright in all
-jurisdictions which recognize such a disclaimer. In such jurisdictions,
-this software is released into the Public Domain.
-
-In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
-2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
-released under the terms of the MIT License (see below).
-
-In jurisdictions which recognize Public Domain property, the user of this
-software may choose to accept it either as 1) Public Domain, 2) under the
-conditions of the MIT License (see below), or 3) under the terms of dual
-Public Domain/MIT License conditions described here, as they choose.
-
-The MIT License is about as close to Public Domain as a license can get, and is
-described in clear, concise terms at:
-
- http://en.wikipedia.org/wiki/MIT_License
-
-The full text of the MIT License follows:
-
-========================================================================
-Copyright (c) 2007-2010 Baptiste Lepilleur
-
-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.
-========================================================================
-(END LICENSE TEXT)
-
-The MIT license is compatible with both the GPL and commercial
-software, affording one all of the rights of Public Domain with the
-minor nuisance of being required to keep the above copyright notice
-and license text in the source code. Note also that by accepting the
-Public Domain "license" you can re-license your copy using whatever
-license you like.
diff --git a/toolkit/crashreporter/jsoncpp/NEWS.txt b/toolkit/crashreporter/jsoncpp/NEWS.txt
deleted file mode 100644
index 5733fcd5ef..0000000000
--- a/toolkit/crashreporter/jsoncpp/NEWS.txt
+++ /dev/null
@@ -1,175 +0,0 @@
-New in SVN
-----------
-
- * Updated the type system's behavior, in order to better support backwards
- compatibility with code that was written before 64-bit integer support was
- introduced. Here's how it works now:
-
- * isInt, isInt64, isUInt, and isUInt64 return true if and only if the
- value can be exactly represented as that type. In particular, a value
- constructed with a double like 17.0 will now return true for all of
- these methods.
-
- * isDouble and isFloat now return true for all numeric values, since all
- numeric values can be converted to a double or float without
- truncation. Note however that the conversion may not be exact -- for
- example, doubles cannot exactly represent all integers above 2^53 + 1.
-
- * isBool, isNull, isString, isArray, and isObject now return true if and
- only if the value is of that type.
-
- * isConvertibleTo(fooValue) indicates that it is safe to call asFoo.
- (For each type foo, isFoo always implies isConvertibleTo(fooValue).)
- asFoo returns an approximate or exact representation as appropriate.
- For example, a double value may be truncated when asInt is called.
-
- * For backwards compatibility with old code, isConvertibleTo(intValue)
- may return false even if type() == intValue. This is because the value
- may have been constructed with a 64-bit integer larger than maxInt,
- and calling asInt() would cause an exception. If you're writing new
- code, use isInt64 to find out whether the value is exactly
- representable using an Int64, or asDouble() combined with minInt64 and
- maxInt64 to figure out whether it is approximately representable.
-
-* Value
- - Patch #10: BOOST_FOREACH compatibility. Made Json::iterator more
- standard compliant, added missing iterator_category and value_type
- typedefs (contribued by Robert A. Iannucci).
-
-* Compilation
-
- - New CMake based build system. Based in part on contribution from
- Igor Okulist and Damien Buhl (Patch #14).
-
- - New header json/version.h now contains version number macros
- (JSONCPP_VERSION_MAJOR, JSONCPP_VERSION_MINOR, JSONCPP_VERSION_PATCH
- and JSONCPP_VERSION_HEXA).
-
- - Patch #11: added missing JSON_API on some classes causing link issues
- when building as a dynamic library on Windows
- (contributed by Francis Bolduc).
-
- - Visual Studio DLL: suppressed warning "C4251: <data member>: <type>
- needs to have dll-interface to be used by..." via pragma push/pop
- in json-cpp headers.
-
- - Added Travis CI intregration: https://travis-ci.org/blep/jsoncpp-mirror
-
-* Bug fixes
- - Patch #15: Copy constructor does not initialize allocated_ for stringValue
- (contributed by rmongia).
-
- - Patch #16: Missing field copy in Json::Value::iterator causing infinite
- loop when using experimental internal map (#define JSON_VALUE_USE_INTERNAL_MAP)
- (contributed by Ming-Lin Kao).
-
-
- New in JsonCpp 0.6.0:
- ---------------------
-
-* Compilation
-
- - LD_LIBRARY_PATH and LIBRARY_PATH environment variables are now
- propagated to the build environment as this is required for some
- compiler installation.
-
- - Added support for Microsoft Visual Studio 2008 (bug #2930462):
- The platform "msvc90" has been added.
-
- Notes: you need to setup the environment by running vcvars32.bat
- (e.g. MSVC 2008 command prompt in start menu) before running scons.
-
- - Added support for amalgamated source and header generation (a la sqlite).
- Refer to README.md section "Generating amalgamated source and header"
- for detail.
-
-* Value
-
- - Removed experimental ValueAllocator, it caused static
- initialization/destruction order issues (bug #2934500).
- The DefaultValueAllocator has been inlined in code.
-
- - Added support for 64 bits integer:
-
- Types Json::Int64 and Json::UInt64 have been added. They are aliased
- to 64 bits integers on system that support them (based on __int64 on
- Microsoft Visual Studio platform, and long long on other platforms).
-
- Types Json::LargestInt and Json::LargestUInt have been added. They are
- aliased to the largest integer type supported:
- either Json::Int/Json::UInt or Json::Int64/Json::UInt64 respectively.
-
- Json::Value::asInt() and Json::Value::asUInt() still returns plain
- "int" based types, but asserts if an attempt is made to retrieve
- a 64 bits value that can not represented as the return type.
-
- Json::Value::asInt64() and Json::Value::asUInt64() have been added
- to obtain the 64 bits integer value.
-
- Json::Value::asLargestInt() and Json::Value::asLargestUInt() returns
- the integer as a LargestInt/LargestUInt respectively. Those functions
- functions are typically used when implementing writer.
-
- The reader attempts to read number as 64 bits integer, and fall back
- to reading a double if the number is not in the range of 64 bits
- integer.
-
- Warning: Json::Value::asInt() and Json::Value::asUInt() now returns
- long long. This changes break code that was passing the return value
- to *printf() function.
-
- Support for 64 bits integer can be disabled by defining the macro
- JSON_NO_INT64 (uncomment it in json/config.h for example), though
- it should have no impact on existing usage.
-
- - The type Json::ArrayIndex is used for indexes of a JSON value array. It
- is an unsigned int (typically 32 bits).
-
- - Array index can be passed as int to operator[], allowing use of literal:
- Json::Value array;
- array.append( 1234 );
- int value = array[0].asInt(); // did not compile previously
-
- - Added float Json::Value::asFloat() to obtain a floating point value as a
- float (avoid lost of precision warning caused by used of asDouble()
- to initialize a float).
-
-* Reader
-
- - Renamed Reader::getFormatedErrorMessages() to getFormattedErrorMessages.
- Bug #3023708 (Formatted has 2 't'). The old member function is deprecated
- but still present for backward compatibility.
-
-* Tests
-
- - Added test to ensure that the escape sequence "\/" is corrected handled
- by the parser.
-
-* Bug fixes
-
- - Bug #3139677: JSON [1 2 3] was incorrectly parsed as [1, 3]. Error is now
- correctly detected.
-
- - Bug #3139678: stack buffer overflow when parsing a double with a
- length of 32 characters.
-
- - Fixed Value::operator <= implementation (had the semantic of operator >=).
- Found when adding unit tests for comparison operators.
-
- - Value::compare() is now const and has an actual implementation with
- unit tests.
-
- - Bug #2407932: strpbrk() can fail for NULL pointer.
-
- - Bug #3306345: Fixed minor typo in Path::resolve().
-
- - Bug #3314841/#3306896: errors in amalgamate.py
-
- - Fixed some Coverity warnings and line-endings.
-
-* License
-
- - See file LICENSE for details. Basically JsonCpp is now licensed under
- MIT license, or public domain if desired and recognized in your jurisdiction.
- Thanks to Stephan G. Beal [http://wanderinghorse.net/home/stephan/]) who
- helped figuring out the solution to the public domain issue.
diff --git a/toolkit/crashreporter/jsoncpp/README.md b/toolkit/crashreporter/jsoncpp/README.md
deleted file mode 100644
index 93c8d1f593..0000000000
--- a/toolkit/crashreporter/jsoncpp/README.md
+++ /dev/null
@@ -1,214 +0,0 @@
-Introduction
-------------
-
-[JSON][json-org] is a lightweight data-interchange format. It can represent
-numbers, strings, ordered sequences of values, and collections of name/value
-pairs.
-
-[json-org]: http://json.org/
-
-[JsonCpp][] is a C++ library that allows manipulating JSON values, including
-serialization and deserialization to and from strings. It can also preserve
-existing comment in unserialization/serialization steps, making it a convenient
-format to store user input files.
-
-[JsonCpp]: http://open-source-parsers.github.io/jsoncpp-docs/doxygen/index.html
-
-## A note on backward-compatibility
-* `1.y.z` is built with C++11.
-* `0.y.z` can be used with older compilers.
-* Major versions maintain binary-compatibility.
-
-# Using JsonCpp in your project
------------------------------
-The recommended approach to integrating JsonCpp in your project is to include
-the [amalgamated source](#generating-amalgamated-source-and-header) (a single
-`.cpp` file and two `.h` files) in your project, and compile and build as you
-would any other source file. This ensures consistency of compilation flags and
-ABI compatibility, issues which arise when building shared or static
-libraries. See the next section for instructions.
-
-The `include/` should be added to your compiler include path. Jsoncpp headers
-should be included as follow:
-
- #include <json/json.h>
-
-If JsonCpp was built as a dynamic library on Windows, then your project needs to
-define the macro `JSON_DLL`.
-
-Generating amalgamated source and header
-----------------------------------------
-JsonCpp is provided with a script to generate a single header and a single
-source file to ease inclusion into an existing project. The amalgamated source
-can be generated at any time by running the following command from the
-top-directory (this requires Python 2.6):
-
- python amalgamate.py
-
-It is possible to specify header name. See the `-h` option for detail.
-
-By default, the following files are generated:
-* `dist/jsoncpp.cpp`: source file that needs to be added to your project.
-* `dist/json/json.h`: corresponding header file for use in your project. It is
- equivalent to including `json/json.h` in non-amalgamated source. This header
- only depends on standard headers.
-* `dist/json/json-forwards.h`: header that provides forward declaration of all
- JsonCpp types.
-
-The amalgamated sources are generated by concatenating JsonCpp source in the
-correct order and defining the macro `JSON_IS_AMALGAMATION` to prevent inclusion
-of other headers.
-
-# Contributing to JsonCpp
-
-Building and testing with CMake
--------------------------------
-[CMake][] is a C++ Makefiles/Solution generator. It is usually available on most
-Linux system as package. On Ubuntu:
-
- sudo apt-get install cmake
-
-[CMake]: http://www.cmake.org
-
-Note that Python is also required to run the JSON reader/writer tests. If
-missing, the build will skip running those tests.
-
-When running CMake, a few parameters are required:
-
-* a build directory where the makefiles/solution are generated. It is also used
- to store objects, libraries and executables files.
-* the generator to use: makefiles or Visual Studio solution? What version or
- Visual Studio, 32 or 64 bits solution?
-
-Steps for generating solution/makefiles using `cmake-gui`:
-
-* Make "source code" point to the source directory.
-* Make "where to build the binary" point to the directory to use for the build.
-* Click on the "Grouped" check box.
-* Review JsonCpp build options (tick `BUILD_SHARED_LIBS` to build as a
- dynamic library).
-* Click the configure button at the bottom, then the generate button.
-* The generated solution/makefiles can be found in the binary directory.
-
-Alternatively, from the command-line on Unix in the source directory:
-
- mkdir -p build/debug
- cd build/debug
- cmake -DCMAKE_BUILD_TYPE=debug -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF -DARCHIVE_INSTALL_DIR=. -G "Unix Makefiles" ../..
- make
-
-Running `cmake -h` will display the list of available generators (passed using
-the `-G` option).
-
-By default CMake hides compilation commands. This can be modified by specifying
-`-DCMAKE_VERBOSE_MAKEFILE=true` when generating makefiles.
-
-Building and testing with SCons
--------------------------------
-**Note:** The SCons-based build system is deprecated. Please use CMake; see the
-section above.
-
-JsonCpp can use [Scons][] as a build system. Note that SCons requires Python to
-be installed.
-
-[SCons]: http://www.scons.org/
-
-Invoke SCons as follows:
-
- scons platform=$PLATFORM [TARGET]
-
-where `$PLATFORM` may be one of:
-
-* `suncc`: Sun C++ (Solaris)
-* `vacpp`: Visual Age C++ (AIX)
-* `mingw`
-* `msvc6`: Microsoft Visual Studio 6 service pack 5-6
-* `msvc70`: Microsoft Visual Studio 2002
-* `msvc71`: Microsoft Visual Studio 2003
-* `msvc80`: Microsoft Visual Studio 2005
-* `msvc90`: Microsoft Visual Studio 2008
-* `linux-gcc`: Gnu C++ (linux, also reported to work for Mac OS X)
-
-If you are building with Microsoft Visual Studio 2008, you need to set up the
-environment by running `vcvars32.bat` (e.g. MSVC 2008 command prompt) before
-running SCons.
-
-## Running the tests manually
-You need to run tests manually only if you are troubleshooting an issue.
-
-In the instructions below, replace `path/to/jsontest` with the path of the
-`jsontest` executable that was compiled on your platform.
-
- cd test
- # This will run the Reader/Writer tests
- python runjsontests.py path/to/jsontest
-
- # This will run the Reader/Writer tests, using JSONChecker test suite
- # (http://www.json.org/JSON_checker/).
- # Notes: not all tests pass: JsonCpp is too lenient (for example,
- # it allows an integer to start with '0'). The goal is to improve
- # strict mode parsing to get all tests to pass.
- python runjsontests.py --with-json-checker path/to/jsontest
-
- # This will run the unit tests (mostly Value)
- python rununittests.py path/to/test_lib_json
-
- # You can run the tests using valgrind:
- python rununittests.py --valgrind path/to/test_lib_json
-
-## Running the tests using scons
-Note that tests can be run using SCons using the `check` target:
-
- scons platform=$PLATFORM check
-
-Building the documentation
---------------------------
-Run the Python script `doxybuild.py` from the top directory:
-
- python doxybuild.py --doxygen=$(which doxygen) --open --with-dot
-
-See `doxybuild.py --help` for options.
-
-Adding a reader/writer test
----------------------------
-To add a test, you need to create two files in test/data:
-
-* a `TESTNAME.json` file, that contains the input document in JSON format.
-* a `TESTNAME.expected` file, that contains a flatened representation of the
- input document.
-
-The `TESTNAME.expected` file format is as follows:
-
-* each line represents a JSON element of the element tree represented by the
- input document.
-* each line has two parts: the path to access the element separated from the
- element value by `=`. Array and object values are always empty (i.e.
- represented by either `[]` or `{}`).
-* element path: `.` represents the root element, and is used to separate object
- members. `[N]` is used to specify the value of an array element at index `N`.
-
-See the examples `test_complex_01.json` and `test_complex_01.expected` to better
-understand element paths.
-
-Understanding reader/writer test output
----------------------------------------
-When a test is run, output files are generated beside the input test files.
-Below is a short description of the content of each file:
-
-* `test_complex_01.json`: input JSON document.
-* `test_complex_01.expected`: flattened JSON element tree used to check if
- parsing was corrected.
-* `test_complex_01.actual`: flattened JSON element tree produced by `jsontest`
- from reading `test_complex_01.json`.
-* `test_complex_01.rewrite`: JSON document written by `jsontest` using the
- `Json::Value` parsed from `test_complex_01.json` and serialized using
- `Json::StyledWritter`.
-* `test_complex_01.actual-rewrite`: flattened JSON element tree produced by
- `jsontest` from reading `test_complex_01.rewrite`.
-* `test_complex_01.process-output`: `jsontest` output, typically useful for
- understanding parsing errors.
-
-License
--------
-See the `LICENSE` file for details. In summary, JsonCpp is licensed under the
-MIT license, or public domain if desired and recognized in your jurisdiction.
diff --git a/toolkit/crashreporter/jsoncpp/include/json/allocator.h b/toolkit/crashreporter/jsoncpp/include/json/allocator.h
deleted file mode 100644
index 9d8b9fc9cf..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/allocator.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_ALLOCATOR_H_INCLUDED
-#define CPPTL_JSON_ALLOCATOR_H_INCLUDED
-
-#include <cstring>
-#include <memory>
-
-namespace Json {
-template<typename T>
-class SecureAllocator {
- public:
- // Type definitions
- using value_type = T;
- using pointer = T*;
- using const_pointer = const T*;
- using reference = T&;
- using const_reference = const T&;
- using size_type = std::size_t;
- using difference_type = std::ptrdiff_t;
-
- /**
- * Allocate memory for N items using the standard allocator.
- */
- pointer allocate(size_type n) {
- // allocate using "global operator new"
- return static_cast<pointer>(::operator new(n * sizeof(T)));
- }
-
- /**
- * Release memory which was allocated for N items at pointer P.
- *
- * The memory block is filled with zeroes before being released.
- * The pointer argument is tagged as "volatile" to prevent the
- * compiler optimizing out this critical step.
- */
- void deallocate(volatile pointer p, size_type n) {
- std::memset(p, 0, n * sizeof(T));
- // free using "global operator delete"
- ::operator delete(p);
- }
-
- /**
- * Construct an item in-place at pointer P.
- */
- template<typename... Args>
- void construct(pointer p, Args&&... args) {
- // construct using "placement new" and "perfect forwarding"
- ::new (static_cast<void*>(p)) T(std::forward<Args>(args)...);
- }
-
- size_type max_size() const {
- return size_t(-1) / sizeof(T);
- }
-
- pointer address( reference x ) const {
- return std::addressof(x);
- }
-
- const_pointer address( const_reference x ) const {
- return std::addressof(x);
- }
-
- /**
- * Destroy an item in-place at pointer P.
- */
- void destroy(pointer p) {
- // destroy using "explicit destructor"
- p->~T();
- }
-
- // Boilerplate
- SecureAllocator() {}
- template<typename U> SecureAllocator(const SecureAllocator<U>&) {}
- template<typename U> struct rebind { using other = SecureAllocator<U>; };
-};
-
-
-template<typename T, typename U>
-bool operator==(const SecureAllocator<T>&, const SecureAllocator<U>&) {
- return true;
-}
-
-template<typename T, typename U>
-bool operator!=(const SecureAllocator<T>&, const SecureAllocator<U>&) {
- return false;
-}
-
-} //namespace Json
-
-#endif // CPPTL_JSON_ALLOCATOR_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/assertions.h b/toolkit/crashreporter/jsoncpp/include/json/assertions.h
deleted file mode 100644
index 9c5f8bc0fe..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/assertions.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
-#define CPPTL_JSON_ASSERTIONS_H_INCLUDED
-
-#include <stdlib.h>
-#include <sstream>
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include "config.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-
-/** It should not be possible for a maliciously designed file to
- * cause an abort() or seg-fault, so these macros are used only
- * for pre-condition violations and internal logic errors.
- */
-#if JSON_USE_EXCEPTION
-
-// @todo <= add detail about condition in exception
-# define JSON_ASSERT(condition) \
- {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
-
-# define JSON_FAIL_MESSAGE(message) \
- { \
- JSONCPP_OSTRINGSTREAM oss; oss << message; \
- Json::throwLogicError(oss.str()); \
- abort(); \
- }
-
-#else // JSON_USE_EXCEPTION
-
-# define JSON_ASSERT(condition) assert(condition)
-
-// The call to assert() will show the failure message in debug builds. In
-// release builds we abort, for a core-dump or debugger.
-# define JSON_FAIL_MESSAGE(message) \
- { \
- JSONCPP_OSTRINGSTREAM oss; oss << message; \
- assert(false && oss.str().c_str()); \
- abort(); \
- }
-
-
-#endif
-
-#define JSON_ASSERT_MESSAGE(condition, message) \
- if (!(condition)) { \
- JSON_FAIL_MESSAGE(message); \
- }
-
-#endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/autolink.h b/toolkit/crashreporter/jsoncpp/include/json/autolink.h
deleted file mode 100644
index 6fcc8afac5..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/autolink.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_AUTOLINK_H_INCLUDED
-#define JSON_AUTOLINK_H_INCLUDED
-
-#include "config.h"
-
-#ifdef JSON_IN_CPPTL
-#include <cpptl/cpptl_autolink.h>
-#endif
-
-#if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && \
- !defined(JSON_IN_CPPTL)
-#define CPPTL_AUTOLINK_NAME "json"
-#undef CPPTL_AUTOLINK_DLL
-#ifdef JSON_DLL
-#define CPPTL_AUTOLINK_DLL
-#endif
-#include "autolink.h"
-#endif
-
-#endif // JSON_AUTOLINK_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/config.h b/toolkit/crashreporter/jsoncpp/include/json/config.h
deleted file mode 100644
index 7f77d0c567..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/config.h
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_CONFIG_H_INCLUDED
-#define JSON_CONFIG_H_INCLUDED
-#include <stddef.h>
-#include <string> //typedef String
-#include <stdint.h> //typedef int64_t, uint64_t
-
-/// If defined, indicates that json library is embedded in CppTL library.
-//# define JSON_IN_CPPTL 1
-
-/// If defined, indicates that json may leverage CppTL library
-//# define JSON_USE_CPPTL 1
-/// If defined, indicates that cpptl vector based map should be used instead of
-/// std::map
-/// as Value container.
-//# define JSON_USE_CPPTL_SMALLMAP 1
-
-// If non-zero, the library uses exceptions to report bad input instead of C
-// assertion macros. The default is to use exceptions.
-#ifndef JSON_USE_EXCEPTION
-#define JSON_USE_EXCEPTION 1
-#endif
-
-/// If defined, indicates that the source file is amalgated
-/// to prevent private header inclusion.
-/// Remarks: it is automatically defined in the generated amalgated header.
-// #define JSON_IS_AMALGAMATION
-
-#ifdef JSON_IN_CPPTL
-#include <cpptl/config.h>
-#ifndef JSON_USE_CPPTL
-#define JSON_USE_CPPTL 1
-#endif
-#endif
-
-#ifdef JSON_IN_CPPTL
-#define JSON_API CPPTL_API
-#elif defined(JSON_DLL_BUILD)
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#define JSON_API __declspec(dllexport)
-#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
-#endif // if defined(_MSC_VER)
-#elif defined(JSON_DLL)
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#define JSON_API __declspec(dllimport)
-#define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
-#endif // if defined(_MSC_VER)
-#endif // ifdef JSON_IN_CPPTL
-#if !defined(JSON_API)
-#define JSON_API
-#endif
-
-// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for
-// integer
-// Storages, and 64 bits integer support is disabled.
-// #define JSON_NO_INT64 1
-
-#if defined(_MSC_VER) // MSVC
-# if _MSC_VER <= 1200 // MSVC 6
- // Microsoft Visual Studio 6 only support conversion from __int64 to double
- // (no conversion from unsigned __int64).
-# define JSON_USE_INT64_DOUBLE_CONVERSION 1
- // Disable warning 4786 for VS6 caused by STL (identifier was truncated to '255'
- // characters in the debug information)
- // All projects I've ever seen with VS6 were using this globally (not bothering
- // with pragma push/pop).
-# pragma warning(disable : 4786)
-# endif // MSVC 6
-
-# if _MSC_VER >= 1500 // MSVC 2008
- /// Indicates that the following function is deprecated.
-# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
-# endif
-
-#endif // defined(_MSC_VER)
-
-// In c++11 the override keyword allows you to explicity define that a function
-// is intended to override the base-class version. This makes the code more
-// managable and fixes a set of common hard-to-find bugs.
-#if __cplusplus >= 201103L
-# define JSONCPP_OVERRIDE override
-#elif defined(_MSC_VER) && _MSC_VER > 1600
-# define JSONCPP_OVERRIDE override
-#else
-# define JSONCPP_OVERRIDE
-#endif
-
-#ifndef JSON_HAS_RVALUE_REFERENCES
-
-#if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
-#define JSON_HAS_RVALUE_REFERENCES 1
-#endif // MSVC >= 2010
-
-#ifdef __clang__
-#if __has_feature(cxx_rvalue_references)
-#define JSON_HAS_RVALUE_REFERENCES 1
-#endif // has_feature
-
-#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
-#if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
-#define JSON_HAS_RVALUE_REFERENCES 1
-#endif // GXX_EXPERIMENTAL
-
-#endif // __clang__ || __GNUC__
-
-#endif // not defined JSON_HAS_RVALUE_REFERENCES
-
-#ifndef JSON_HAS_RVALUE_REFERENCES
-#define JSON_HAS_RVALUE_REFERENCES 0
-#endif
-
-#ifdef __clang__
-#elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
-# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
-# define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
-# elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
-# define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
-# endif // GNUC version
-#endif // __clang__ || __GNUC__
-
-#if !defined(JSONCPP_DEPRECATED)
-#define JSONCPP_DEPRECATED(message)
-#endif // if !defined(JSONCPP_DEPRECATED)
-
-#if __GNUC__ >= 6
-# define JSON_USE_INT64_DOUBLE_CONVERSION 1
-#endif
-
-#if !defined(JSON_IS_AMALGAMATION)
-
-# include "version.h"
-
-# if JSONCPP_USING_SECURE_MEMORY
-# include "allocator.h" //typedef Allocator
-# endif
-
-#endif // if !defined(JSON_IS_AMALGAMATION)
-
-namespace Json {
-typedef int Int;
-typedef unsigned int UInt;
-#if defined(JSON_NO_INT64)
-typedef int LargestInt;
-typedef unsigned int LargestUInt;
-#undef JSON_HAS_INT64
-#else // if defined(JSON_NO_INT64)
-// For Microsoft Visual use specific types as long long is not supported
-#if defined(_MSC_VER) // Microsoft Visual Studio
-typedef __int64 Int64;
-typedef unsigned __int64 UInt64;
-#else // if defined(_MSC_VER) // Other platforms, use long long
-typedef int64_t Int64;
-typedef uint64_t UInt64;
-#endif // if defined(_MSC_VER)
-typedef Int64 LargestInt;
-typedef UInt64 LargestUInt;
-#define JSON_HAS_INT64
-#endif // if defined(JSON_NO_INT64)
-#if JSONCPP_USING_SECURE_MEMORY
-#define JSONCPP_STRING std::basic_string<char, std::char_traits<char>, Json::SecureAllocator<char> >
-#define JSONCPP_OSTRINGSTREAM std::basic_ostringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
-#define JSONCPP_OSTREAM std::basic_ostream<char, std::char_traits<char>>
-#define JSONCPP_ISTRINGSTREAM std::basic_istringstream<char, std::char_traits<char>, Json::SecureAllocator<char> >
-#define JSONCPP_ISTREAM std::istream
-#else
-#define JSONCPP_STRING std::string
-#define JSONCPP_OSTRINGSTREAM std::ostringstream
-#define JSONCPP_OSTREAM std::ostream
-#define JSONCPP_ISTRINGSTREAM std::istringstream
-#define JSONCPP_ISTREAM std::istream
-#endif // if JSONCPP_USING_SECURE_MEMORY
-} // end namespace Json
-
-#endif // JSON_CONFIG_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/features.h b/toolkit/crashreporter/jsoncpp/include/json/features.h
deleted file mode 100644
index 1bb7bb6148..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/features.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_FEATURES_H_INCLUDED
-#define CPPTL_JSON_FEATURES_H_INCLUDED
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include "forwards.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-
-namespace Json {
-
-/** \brief Configuration passed to reader and writer.
- * This configuration object can be used to force the Reader or Writer
- * to behave in a standard conforming way.
- */
-class JSON_API Features {
-public:
- /** \brief A configuration that allows all features and assumes all strings
- * are UTF-8.
- * - C & C++ comments are allowed
- * - Root object can be any JSON value
- * - Assumes Value strings are encoded in UTF-8
- */
- static Features all();
-
- /** \brief A configuration that is strictly compatible with the JSON
- * specification.
- * - Comments are forbidden.
- * - Root object must be either an array or an object value.
- * - Assumes Value strings are encoded in UTF-8
- */
- static Features strictMode();
-
- /** \brief Initialize the configuration like JsonConfig::allFeatures;
- */
- Features();
-
- /// \c true if comments are allowed. Default: \c true.
- bool allowComments_;
-
- /// \c true if root must be either an array or an object value. Default: \c
- /// false.
- bool strictRoot_;
-
- /// \c true if dropped null placeholders are allowed. Default: \c false.
- bool allowDroppedNullPlaceholders_;
-
- /// \c true if numeric object key are allowed. Default: \c false.
- bool allowNumericKeys_;
-};
-
-} // namespace Json
-
-#endif // CPPTL_JSON_FEATURES_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/forwards.h b/toolkit/crashreporter/jsoncpp/include/json/forwards.h
deleted file mode 100644
index ccfe09abf4..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/forwards.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_FORWARDS_H_INCLUDED
-#define JSON_FORWARDS_H_INCLUDED
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include "config.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-
-namespace Json {
-
-// writer.h
-class FastWriter;
-class StyledWriter;
-
-// reader.h
-class Reader;
-
-// features.h
-class Features;
-
-// value.h
-typedef unsigned int ArrayIndex;
-class StaticString;
-class Path;
-class PathArgument;
-class Value;
-class ValueIteratorBase;
-class ValueIterator;
-class ValueConstIterator;
-
-} // namespace Json
-
-#endif // JSON_FORWARDS_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/json.h b/toolkit/crashreporter/jsoncpp/include/json/json.h
deleted file mode 100644
index 8f10ac2bf7..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/json.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_JSON_H_INCLUDED
-#define JSON_JSON_H_INCLUDED
-
-#include "autolink.h"
-#include "value.h"
-#include "reader.h"
-#include "writer.h"
-#include "features.h"
-
-#endif // JSON_JSON_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/reader.h b/toolkit/crashreporter/jsoncpp/include/json/reader.h
deleted file mode 100644
index caf8727378..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/reader.h
+++ /dev/null
@@ -1,404 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_READER_H_INCLUDED
-#define CPPTL_JSON_READER_H_INCLUDED
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include "features.h"
-#include "value.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <deque>
-#include <iosfwd>
-#include <stack>
-#include <string>
-#include <istream>
-
-// Disable warning C4251: <data member>: <type> needs to have dll-interface to
-// be used by...
-#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-#pragma warning(push)
-#pragma warning(disable : 4251)
-#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-
-namespace Json {
-
-/** \brief Unserialize a <a HREF="http://www.json.org">JSON</a> document into a
- *Value.
- *
- * \deprecated Use CharReader and CharReaderBuilder.
- */
-class JSON_API Reader {
-public:
- typedef char Char;
- typedef const Char* Location;
-
- /** \brief An error tagged with where in the JSON text it was encountered.
- *
- * The offsets give the [start, limit) range of bytes within the text. Note
- * that this is bytes, not codepoints.
- *
- */
- struct StructuredError {
- ptrdiff_t offset_start;
- ptrdiff_t offset_limit;
- JSONCPP_STRING message;
- };
-
- /** \brief Constructs a Reader allowing all features
- * for parsing.
- */
- Reader();
-
- /** \brief Constructs a Reader allowing the specified feature set
- * for parsing.
- */
- Reader(const Features& features);
-
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
- * document.
- * \param document UTF-8 encoded string containing the document to read.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param collectComments \c true to collect comment and allow writing them
- * back during
- * serialization, \c false to discard comments.
- * This parameter is ignored if
- * Features::allowComments_
- * is \c false.
- * \return \c true if the document was successfully parsed, \c false if an
- * error occurred.
- */
- bool
- parse(const std::string& document, Value& root, bool collectComments = true);
-
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
- document.
- * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
- document to read.
- * \param endDoc Pointer on the end of the UTF-8 encoded string of the
- document to read.
- * Must be >= beginDoc.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param collectComments \c true to collect comment and allow writing them
- back during
- * serialization, \c false to discard comments.
- * This parameter is ignored if
- Features::allowComments_
- * is \c false.
- * \return \c true if the document was successfully parsed, \c false if an
- error occurred.
- */
- bool parse(const char* beginDoc,
- const char* endDoc,
- Value& root,
- bool collectComments = true);
-
- /// \brief Parse from input stream.
- /// \see Json::operator>>(std::istream&, Json::Value&).
- bool parse(JSONCPP_ISTREAM& is, Value& root, bool collectComments = true);
-
- /** \brief Returns a user friendly string that list errors in the parsed
- * document.
- * \return Formatted error message with the list of errors with their location
- * in
- * the parsed document. An empty string is returned if no error
- * occurred
- * during parsing.
- * \deprecated Use getFormattedErrorMessages() instead (typo fix).
- */
- JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.")
- JSONCPP_STRING getFormatedErrorMessages() const;
-
- /** \brief Returns a user friendly string that list errors in the parsed
- * document.
- * \return Formatted error message with the list of errors with their location
- * in
- * the parsed document. An empty string is returned if no error
- * occurred
- * during parsing.
- */
- JSONCPP_STRING getFormattedErrorMessages() const;
-
- /** \brief Returns a vector of structured erros encounted while parsing.
- * \return A (possibly empty) vector of StructuredError objects. Currently
- * only one error can be returned, but the caller should tolerate
- * multiple
- * errors. This can occur if the parser recovers from a non-fatal
- * parse error and then encounters additional errors.
- */
- std::vector<StructuredError> getStructuredErrors() const;
-
- /** \brief Add a semantic error message.
- * \param value JSON Value location associated with the error
- * \param message The error message.
- * \return \c true if the error was successfully added, \c false if the
- * Value offset exceeds the document size.
- */
- bool pushError(const Value& value, const JSONCPP_STRING& message);
-
- /** \brief Add a semantic error message with extra context.
- * \param value JSON Value location associated with the error
- * \param message The error message.
- * \param extra Additional JSON Value location to contextualize the error
- * \return \c true if the error was successfully added, \c false if either
- * Value offset exceeds the document size.
- */
- bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);
-
- /** \brief Return whether there are any errors.
- * \return \c true if there are no errors to report \c false if
- * errors have occurred.
- */
- bool good() const;
-
-private:
- enum TokenType {
- tokenEndOfStream = 0,
- tokenObjectBegin,
- tokenObjectEnd,
- tokenArrayBegin,
- tokenArrayEnd,
- tokenString,
- tokenNumber,
- tokenTrue,
- tokenFalse,
- tokenNull,
- tokenArraySeparator,
- tokenMemberSeparator,
- tokenComment,
- tokenError
- };
-
- class Token {
- public:
- TokenType type_;
- Location start_;
- Location end_;
- };
-
- class ErrorInfo {
- public:
- Token token_;
- JSONCPP_STRING message_;
- Location extra_;
- };
-
- typedef std::deque<ErrorInfo> Errors;
-
- bool readToken(Token& token);
- void skipSpaces();
- bool match(Location pattern, int patternLength);
- bool readComment();
- bool readCStyleComment();
- bool readCppStyleComment();
- bool readString();
- void readNumber();
- bool readValue();
- bool readObject(Token& token);
- bool readArray(Token& token);
- bool decodeNumber(Token& token);
- bool decodeNumber(Token& token, Value& decoded);
- bool decodeString(Token& token);
- bool decodeString(Token& token, JSONCPP_STRING& decoded);
- bool decodeDouble(Token& token);
- bool decodeDouble(Token& token, Value& decoded);
- bool decodeUnicodeCodePoint(Token& token,
- Location& current,
- Location end,
- unsigned int& unicode);
- bool decodeUnicodeEscapeSequence(Token& token,
- Location& current,
- Location end,
- unsigned int& unicode);
- bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);
- bool recoverFromError(TokenType skipUntilToken);
- bool addErrorAndRecover(const JSONCPP_STRING& message,
- Token& token,
- TokenType skipUntilToken);
- void skipUntilSpace();
- Value& currentValue();
- Char getNextChar();
- void
- getLocationLineAndColumn(Location location, int& line, int& column) const;
- JSONCPP_STRING getLocationLineAndColumn(Location location) const;
- void addComment(Location begin, Location end, CommentPlacement placement);
- void skipCommentTokens(Token& token);
-
- typedef std::stack<Value*> Nodes;
- Nodes nodes_;
- Errors errors_;
- JSONCPP_STRING document_;
- Location begin_;
- Location end_;
- Location current_;
- Location lastValueEnd_;
- Value* lastValue_;
- JSONCPP_STRING commentsBefore_;
- Features features_;
- bool collectComments_;
-}; // Reader
-
-/** Interface for reading JSON from a char array.
- */
-class JSON_API CharReader {
-public:
- virtual ~CharReader() {}
- /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a>
- document.
- * The document must be a UTF-8 encoded string containing the document to read.
- *
- * \param beginDoc Pointer on the beginning of the UTF-8 encoded string of the
- document to read.
- * \param endDoc Pointer on the end of the UTF-8 encoded string of the
- document to read.
- * Must be >= beginDoc.
- * \param root [out] Contains the root value of the document if it was
- * successfully parsed.
- * \param errs [out] Formatted error messages (if not NULL)
- * a user friendly string that lists errors in the parsed
- * document.
- * \return \c true if the document was successfully parsed, \c false if an
- error occurred.
- */
- virtual bool parse(
- char const* beginDoc, char const* endDoc,
- Value* root, JSONCPP_STRING* errs) = 0;
-
- class JSON_API Factory {
- public:
- virtual ~Factory() {}
- /** \brief Allocate a CharReader via operator new().
- * \throw std::exception if something goes wrong (e.g. invalid settings)
- */
- virtual CharReader* newCharReader() const = 0;
- }; // Factory
-}; // CharReader
-
-/** \brief Build a CharReader implementation.
-
-Usage:
-\code
- using namespace Json;
- CharReaderBuilder builder;
- builder["collectComments"] = false;
- Value value;
- JSONCPP_STRING errs;
- bool ok = parseFromStream(builder, std::cin, &value, &errs);
-\endcode
-*/
-class JSON_API CharReaderBuilder : public CharReader::Factory {
-public:
- // Note: We use a Json::Value so that we can add data-members to this class
- // without a major version bump.
- /** Configuration of this builder.
- These are case-sensitive.
- Available settings (case-sensitive):
- - `"collectComments": false or true`
- - true to collect comment and allow writing them
- back during serialization, false to discard comments.
- This parameter is ignored if allowComments is false.
- - `"allowComments": false or true`
- - true if comments are allowed.
- - `"strictRoot": false or true`
- - true if root must be either an array or an object value
- - `"allowDroppedNullPlaceholders": false or true`
- - true if dropped null placeholders are allowed. (See StreamWriterBuilder.)
- - `"allowNumericKeys": false or true`
- - true if numeric object keys are allowed.
- - `"allowSingleQuotes": false or true`
- - true if '' are allowed for strings (both keys and values)
- - `"stackLimit": integer`
- - Exceeding stackLimit (recursive depth of `readValue()`) will
- cause an exception.
- - This is a security issue (seg-faults caused by deeply nested JSON),
- so the default is low.
- - `"failIfExtra": false or true`
- - If true, `parse()` returns false when extra non-whitespace trails
- the JSON value in the input string.
- - `"rejectDupKeys": false or true`
- - If true, `parse()` returns false when a key is duplicated within an object.
- - `"allowSpecialFloats": false or true`
- - If true, special float values (NaNs and infinities) are allowed
- and their values are lossfree restorable.
-
- You can examine 'settings_` yourself
- to see the defaults. You can also write and read them just like any
- JSON Value.
- \sa setDefaults()
- */
- Json::Value settings_;
-
- CharReaderBuilder();
- ~CharReaderBuilder() JSONCPP_OVERRIDE;
-
- CharReader* newCharReader() const JSONCPP_OVERRIDE;
-
- /** \return true if 'settings' are legal and consistent;
- * otherwise, indicate bad settings via 'invalid'.
- */
- bool validate(Json::Value* invalid) const;
-
- /** A simple way to update a specific setting.
- */
- Value& operator[](JSONCPP_STRING key);
-
- /** Called by ctor, but you can use this to reset settings_.
- * \pre 'settings' != NULL (but Json::null is fine)
- * \remark Defaults:
- * \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults
- */
- static void setDefaults(Json::Value* settings);
- /** Same as old Features::strictMode().
- * \pre 'settings' != NULL (but Json::null is fine)
- * \remark Defaults:
- * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode
- */
- static void strictMode(Json::Value* settings);
-};
-
-/** Consume entire stream and use its begin/end.
- * Someday we might have a real StreamReader, but for now this
- * is convenient.
- */
-bool JSON_API parseFromStream(
- CharReader::Factory const&,
- JSONCPP_ISTREAM&,
- Value* root, std::string* errs);
-
-/** \brief Read from 'sin' into 'root'.
-
- Always keep comments from the input JSON.
-
- This can be used to read a file into a particular sub-object.
- For example:
- \code
- Json::Value root;
- cin >> root["dir"]["file"];
- cout << root;
- \endcode
- Result:
- \verbatim
- {
- "dir": {
- "file": {
- // The input stream JSON would be nested here.
- }
- }
- }
- \endverbatim
- \throw std::exception on parse error.
- \see Json::operator<<()
-*/
-JSON_API JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM&, Value&);
-
-} // namespace Json
-
-#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-#pragma warning(pop)
-#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-
-#endif // CPPTL_JSON_READER_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/value.h b/toolkit/crashreporter/jsoncpp/include/json/value.h
deleted file mode 100644
index fb88c18295..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/value.h
+++ /dev/null
@@ -1,867 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef CPPTL_JSON_H_INCLUDED
-#define CPPTL_JSON_H_INCLUDED
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include "forwards.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <string>
-#include <vector>
-#include <exception>
-
-#ifndef JSON_USE_CPPTL_SMALLMAP
-#include <map>
-#else
-#include <cpptl/smallmap.h>
-#endif
-#ifdef JSON_USE_CPPTL
-#include <cpptl/forwards.h>
-#endif
-
-//Conditional NORETURN attribute on the throw functions would:
-// a) suppress false positives from static code analysis
-// b) possibly improve optimization opportunities.
-#if !defined(JSONCPP_NORETURN)
-# if defined(_MSC_VER)
-# define JSONCPP_NORETURN __declspec(noreturn)
-# elif defined(__GNUC__)
-# define JSONCPP_NORETURN __attribute__ ((__noreturn__))
-# else
-# define JSONCPP_NORETURN
-# endif
-#endif
-
-// Disable warning C4251: <data member>: <type> needs to have dll-interface to
-// be used by...
-#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-#pragma warning(push)
-#pragma warning(disable : 4251)
-#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-
-/** \brief JSON (JavaScript Object Notation).
- */
-namespace Json {
-
-/** Base class for all exceptions we throw.
- *
- * We use nothing but these internally. Of course, STL can throw others.
- */
-class JSON_API Exception : public std::exception {
-public:
- Exception(JSONCPP_STRING const& msg);
- ~Exception() throw() JSONCPP_OVERRIDE;
- char const* what() const throw() JSONCPP_OVERRIDE;
-protected:
- JSONCPP_STRING msg_;
-};
-
-/** Exceptions which the user cannot easily avoid.
- *
- * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input
- *
- * \remark derived from Json::Exception
- */
-class JSON_API RuntimeError : public Exception {
-public:
- RuntimeError(JSONCPP_STRING const& msg);
-};
-
-/** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros.
- *
- * These are precondition-violations (user bugs) and internal errors (our bugs).
- *
- * \remark derived from Json::Exception
- */
-class JSON_API LogicError : public Exception {
-public:
- LogicError(JSONCPP_STRING const& msg);
-};
-
-/// used internally
-JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg);
-/// used internally
-JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg);
-
-/** \brief Type of the value held by a Value object.
- */
-enum ValueType {
- nullValue = 0, ///< 'null' value
- intValue, ///< signed integer value
- uintValue, ///< unsigned integer value
- realValue, ///< double value
- stringValue, ///< UTF-8 string value
- booleanValue, ///< bool value
- arrayValue, ///< array value (ordered list)
- objectValue ///< object value (collection of name/value pairs).
-};
-
-enum CommentPlacement {
- commentBefore = 0, ///< a comment placed on the line before a value
- commentAfterOnSameLine, ///< a comment just after a value on the same line
- commentAfter, ///< a comment on the line after a value (only make sense for
- /// root value)
- numberOfCommentPlacement
-};
-
-//# ifdef JSON_USE_CPPTL
-// typedef CppTL::AnyEnumerator<const char *> EnumMemberNames;
-// typedef CppTL::AnyEnumerator<const Value &> EnumValues;
-//# endif
-
-/** \brief Lightweight wrapper to tag static string.
- *
- * Value constructor and objectValue member assignement takes advantage of the
- * StaticString and avoid the cost of string duplication when storing the
- * string or the member name.
- *
- * Example of usage:
- * \code
- * Json::Value aValue( StaticString("some text") );
- * Json::Value object;
- * static const StaticString code("code");
- * object[code] = 1234;
- * \endcode
- */
-class JSON_API StaticString {
-public:
- explicit StaticString(const char* czstring) : c_str_(czstring) {}
-
- operator const char*() const { return c_str_; }
-
- const char* c_str() const { return c_str_; }
-
-private:
- const char* c_str_;
-};
-
-/** \brief Represents a <a HREF="http://www.json.org">JSON</a> value.
- *
- * This class is a discriminated union wrapper that can represents a:
- * - signed integer [range: Value::minInt - Value::maxInt]
- * - unsigned integer (range: 0 - Value::maxUInt)
- * - double
- * - UTF-8 string
- * - boolean
- * - 'null'
- * - an ordered list of Value
- * - collection of name/value pairs (javascript object)
- *
- * The type of the held value is represented by a #ValueType and
- * can be obtained using type().
- *
- * Values of an #objectValue or #arrayValue can be accessed using operator[]()
- * methods.
- * Non-const methods will automatically create the a #nullValue element
- * if it does not exist.
- * The sequence of an #arrayValue will be automatically resized and initialized
- * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue.
- *
- * The get() methods can be used to obtain default value in the case the
- * required element does not exist.
- *
- * It is possible to iterate over the list of a #objectValue values using
- * the getMemberNames() method.
- *
- * \note #Value string-length fit in size_t, but keys must be < 2^30.
- * (The reason is an implementation detail.) A #CharReader will raise an
- * exception if a bound is exceeded to avoid security holes in your app,
- * but the Value API does *not* check bounds. That is the responsibility
- * of the caller.
- */
-class JSON_API Value {
- friend class ValueIteratorBase;
-public:
- typedef std::vector<JSONCPP_STRING> Members;
- typedef ValueIterator iterator;
- typedef ValueConstIterator const_iterator;
- typedef Json::UInt UInt;
- typedef Json::Int Int;
-#if defined(JSON_HAS_INT64)
- typedef Json::UInt64 UInt64;
- typedef Json::Int64 Int64;
-#endif // defined(JSON_HAS_INT64)
- typedef Json::LargestInt LargestInt;
- typedef Json::LargestUInt LargestUInt;
- typedef Json::ArrayIndex ArrayIndex;
-
- static const Value& null; ///< We regret this reference to a global instance; prefer the simpler Value().
- static const Value& nullRef; ///< just a kludge for binary-compatibility; same as null
- static Value const& nullSingleton(); ///< Prefer this to null or nullRef.
-
- /// Minimum signed integer value that can be stored in a Json::Value.
- static const LargestInt minLargestInt;
- /// Maximum signed integer value that can be stored in a Json::Value.
- static const LargestInt maxLargestInt;
- /// Maximum unsigned integer value that can be stored in a Json::Value.
- static const LargestUInt maxLargestUInt;
-
- /// Minimum signed int value that can be stored in a Json::Value.
- static const Int minInt;
- /// Maximum signed int value that can be stored in a Json::Value.
- static const Int maxInt;
- /// Maximum unsigned int value that can be stored in a Json::Value.
- static const UInt maxUInt;
-
-#if defined(JSON_HAS_INT64)
- /// Minimum signed 64 bits int value that can be stored in a Json::Value.
- static const Int64 minInt64;
- /// Maximum signed 64 bits int value that can be stored in a Json::Value.
- static const Int64 maxInt64;
- /// Maximum unsigned 64 bits int value that can be stored in a Json::Value.
- static const UInt64 maxUInt64;
-#endif // defined(JSON_HAS_INT64)
-
-private:
-#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
- class CZString {
- public:
- enum DuplicationPolicy {
- noDuplication = 0,
- duplicate,
- duplicateOnCopy
- };
- CZString(ArrayIndex index);
- CZString(char const* str, unsigned length, DuplicationPolicy allocate);
- CZString(CZString const& other);
-#if JSON_HAS_RVALUE_REFERENCES
- CZString(CZString&& other);
-#endif
- ~CZString();
- CZString& operator=(CZString other);
- bool operator<(CZString const& other) const;
- bool operator==(CZString const& other) const;
- ArrayIndex index() const;
- //const char* c_str() const; ///< \deprecated
- char const* data() const;
- unsigned length() const;
- bool isStaticString() const;
-
- private:
- void swap(CZString& other);
-
- struct StringStorage {
- unsigned policy_: 2;
- unsigned length_: 30; // 1GB max
- };
-
- char const* cstr_; // actually, a prefixed string, unless policy is noDup
- union {
- ArrayIndex index_;
- StringStorage storage_;
- };
- };
-
-public:
-#ifndef JSON_USE_CPPTL_SMALLMAP
- typedef std::map<CZString, Value> ObjectValues;
-#else
- typedef CppTL::SmallMap<CZString, Value> ObjectValues;
-#endif // ifndef JSON_USE_CPPTL_SMALLMAP
-#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
-
-public:
- /** \brief Create a default Value of the given type.
-
- This is a very useful constructor.
- To create an empty array, pass arrayValue.
- To create an empty object, pass objectValue.
- Another Value can then be set to this one by assignment.
-This is useful since clear() and resize() will not alter types.
-
- Examples:
-\code
-Json::Value null_value; // null
-Json::Value arr_value(Json::arrayValue); // []
-Json::Value obj_value(Json::objectValue); // {}
-\endcode
- */
- Value(ValueType type = nullValue);
- Value(Int value);
- Value(UInt value);
-#if defined(JSON_HAS_INT64)
- Value(Int64 value);
- Value(UInt64 value);
-#endif // if defined(JSON_HAS_INT64)
- Value(double value);
- Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
- Value(const char* begin, const char* end); ///< Copy all, incl zeroes.
- /** \brief Constructs a value from a static string.
-
- * Like other value string constructor but do not duplicate the string for
- * internal storage. The given string must remain alive after the call to this
- * constructor.
- * \note This works only for null-terminated strings. (We cannot change the
- * size of this class, so we have nowhere to store the length,
- * which might be computed later for various operations.)
- *
- * Example of usage:
- * \code
- * static StaticString foo("some text");
- * Json::Value aValue(foo);
- * \endcode
- */
- Value(const StaticString& value);
- Value(const JSONCPP_STRING& value); ///< Copy data() til size(). Embedded zeroes too.
-#ifdef JSON_USE_CPPTL
- Value(const CppTL::ConstString& value);
-#endif
- Value(bool value);
- /// Deep copy.
- Value(const Value& other);
-#if JSON_HAS_RVALUE_REFERENCES
- /// Move constructor
- Value(Value&& other);
-#endif
- ~Value();
-
- /// Deep copy, then swap(other).
- /// \note Over-write existing comments. To preserve comments, use #swapPayload().
- Value& operator=(Value other);
- /// Swap everything.
- void swap(Value& other);
- /// Swap values but leave comments and source offsets in place.
- void swapPayload(Value& other);
-
- ValueType type() const;
-
- /// Compare payload only, not comments etc.
- bool operator<(const Value& other) const;
- bool operator<=(const Value& other) const;
- bool operator>=(const Value& other) const;
- bool operator>(const Value& other) const;
- bool operator==(const Value& other) const;
- bool operator!=(const Value& other) const;
- int compare(const Value& other) const;
-
- const char* asCString() const; ///< Embedded zeroes could cause you trouble!
-#if JSONCPP_USING_SECURE_MEMORY
- unsigned getCStringLength() const; //Allows you to understand the length of the CString
-#endif
- JSONCPP_STRING asString() const; ///< Embedded zeroes are possible.
- /** Get raw char* of string-value.
- * \return false if !string. (Seg-fault if str or end are NULL.)
- */
- bool getString(
- char const** begin, char const** end) const;
-#ifdef JSON_USE_CPPTL
- CppTL::ConstString asConstString() const;
-#endif
- Int asInt() const;
- UInt asUInt() const;
-#if defined(JSON_HAS_INT64)
- Int64 asInt64() const;
- UInt64 asUInt64() const;
-#endif // if defined(JSON_HAS_INT64)
- LargestInt asLargestInt() const;
- LargestUInt asLargestUInt() const;
- float asFloat() const;
- double asDouble() const;
- bool asBool() const;
-
- bool isNull() const;
- bool isBool() const;
- bool isInt() const;
- bool isInt64() const;
- bool isUInt() const;
- bool isUInt64() const;
- bool isIntegral() const;
- bool isDouble() const;
- bool isNumeric() const;
- bool isString() const;
- bool isArray() const;
- bool isObject() const;
-
- bool isConvertibleTo(ValueType other) const;
-
- /// Number of values in array or object
- ArrayIndex size() const;
-
- /// \brief Return true if empty array, empty object, or null;
- /// otherwise, false.
- bool empty() const;
-
- /// Return isNull()
- bool operator!() const;
-
- /// Remove all object members and array elements.
- /// \pre type() is arrayValue, objectValue, or nullValue
- /// \post type() is unchanged
- void clear();
-
- /// Resize the array to size elements.
- /// New elements are initialized to null.
- /// May only be called on nullValue or arrayValue.
- /// \pre type() is arrayValue or nullValue
- /// \post type() is arrayValue
- void resize(ArrayIndex size);
-
- /// Access an array element (zero based index ).
- /// If the array contains less than index element, then null value are
- /// inserted
- /// in the array so that its size is index+1.
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- Value& operator[](ArrayIndex index);
-
- /// Access an array element (zero based index ).
- /// If the array contains less than index element, then null value are
- /// inserted
- /// in the array so that its size is index+1.
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- Value& operator[](int index);
-
- /// Access an array element (zero based index )
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- const Value& operator[](ArrayIndex index) const;
-
- /// Access an array element (zero based index )
- /// (You may need to say 'value[0u]' to get your compiler to distinguish
- /// this from the operator[] which takes a string.)
- const Value& operator[](int index) const;
-
- /// If the array contains at least index+1 elements, returns the element
- /// value,
- /// otherwise returns defaultValue.
- Value get(ArrayIndex index, const Value& defaultValue) const;
- /// Return true if index < size().
- bool isValidIndex(ArrayIndex index) const;
- /// \brief Append value to array at the end.
- ///
- /// Equivalent to jsonvalue[jsonvalue.size()] = value;
- Value& append(const Value& value);
-
- /// Access an object value by name, create a null member if it does not exist.
- /// \note Because of our implementation, keys are limited to 2^30 -1 chars.
- /// Exceeding that will cause an exception.
- Value& operator[](const char* key);
- /// Access an object value by name, returns null if there is no member with
- /// that name.
- const Value& operator[](const char* key) const;
- /// Access an object value by name, create a null member if it does not exist.
- /// \param key may contain embedded nulls.
- Value& operator[](const JSONCPP_STRING& key);
- /// Access an object value by name, returns null if there is no member with
- /// that name.
- /// \param key may contain embedded nulls.
- const Value& operator[](const JSONCPP_STRING& key) const;
- /** \brief Access an object value by name, create a null member if it does not
- exist.
-
- * If the object has no entry for that name, then the member name used to store
- * the new entry is not duplicated.
- * Example of use:
- * \code
- * Json::Value object;
- * static const StaticString code("code");
- * object[code] = 1234;
- * \endcode
- */
- Value& operator[](const StaticString& key);
-#ifdef JSON_USE_CPPTL
- /// Access an object value by name, create a null member if it does not exist.
- Value& operator[](const CppTL::ConstString& key);
- /// Access an object value by name, returns null if there is no member with
- /// that name.
- const Value& operator[](const CppTL::ConstString& key) const;
-#endif
- /// Return the member named key if it exist, defaultValue otherwise.
- /// \note deep copy
- Value get(const char* key, const Value& defaultValue) const;
- /// Return the member named key if it exist, defaultValue otherwise.
- /// \note deep copy
- /// \note key may contain embedded nulls.
- Value get(const char* begin, const char* end, const Value& defaultValue) const;
- /// Return the member named key if it exist, defaultValue otherwise.
- /// \note deep copy
- /// \param key may contain embedded nulls.
- Value get(const JSONCPP_STRING& key, const Value& defaultValue) const;
-#ifdef JSON_USE_CPPTL
- /// Return the member named key if it exist, defaultValue otherwise.
- /// \note deep copy
- Value get(const CppTL::ConstString& key, const Value& defaultValue) const;
-#endif
- /// Most general and efficient version of isMember()const, get()const,
- /// and operator[]const
- /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
- Value const* find(char const* begin, char const* end) const;
- /// Most general and efficient version of object-mutators.
- /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
- /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue.
- Value const* demand(char const* begin, char const* end);
- /// \brief Remove and return the named member.
- ///
- /// Do nothing if it did not exist.
- /// \return the removed Value, or null.
- /// \pre type() is objectValue or nullValue
- /// \post type() is unchanged
- /// \deprecated
- Value removeMember(const char* key);
- /// Same as removeMember(const char*)
- /// \param key may contain embedded nulls.
- /// \deprecated
- Value removeMember(const JSONCPP_STRING& key);
- /// Same as removeMember(const char* begin, const char* end, Value* removed),
- /// but 'key' is null-terminated.
- bool removeMember(const char* key, Value* removed);
- /** \brief Remove the named map member.
-
- Update 'removed' iff removed.
- \param key may contain embedded nulls.
- \return true iff removed (no exceptions)
- */
- bool removeMember(JSONCPP_STRING const& key, Value* removed);
- /// Same as removeMember(JSONCPP_STRING const& key, Value* removed)
- bool removeMember(const char* begin, const char* end, Value* removed);
- /** \brief Remove the indexed array element.
-
- O(n) expensive operations.
- Update 'removed' iff removed.
- \return true iff removed (no exceptions)
- */
- bool removeIndex(ArrayIndex i, Value* removed);
-
- /// Return true if the object has a member named key.
- /// \note 'key' must be null-terminated.
- bool isMember(const char* key) const;
- /// Return true if the object has a member named key.
- /// \param key may contain embedded nulls.
- bool isMember(const JSONCPP_STRING& key) const;
- /// Same as isMember(JSONCPP_STRING const& key)const
- bool isMember(const char* begin, const char* end) const;
-#ifdef JSON_USE_CPPTL
- /// Return true if the object has a member named key.
- bool isMember(const CppTL::ConstString& key) const;
-#endif
-
- /// \brief Return a list of the member names.
- ///
- /// If null, return an empty list.
- /// \pre type() is objectValue or nullValue
- /// \post if type() was nullValue, it remains nullValue
- Members getMemberNames() const;
-
- //# ifdef JSON_USE_CPPTL
- // EnumMemberNames enumMemberNames() const;
- // EnumValues enumValues() const;
- //# endif
-
- /// \deprecated Always pass len.
- JSONCPP_DEPRECATED("Use setComment(JSONCPP_STRING const&) instead.")
- void setComment(const char* comment, CommentPlacement placement);
- /// Comments must be //... or /* ... */
- void setComment(const char* comment, size_t len, CommentPlacement placement);
- /// Comments must be //... or /* ... */
- void setComment(const JSONCPP_STRING& comment, CommentPlacement placement);
- bool hasComment(CommentPlacement placement) const;
- /// Include delimiters and embedded newlines.
- JSONCPP_STRING getComment(CommentPlacement placement) const;
-
- JSONCPP_STRING toStyledString() const;
-
- const_iterator begin() const;
- const_iterator end() const;
-
- iterator begin();
- iterator end();
-
- // Accessors for the [start, limit) range of bytes within the JSON text from
- // which this value was parsed, if any.
- void setOffsetStart(ptrdiff_t start);
- void setOffsetLimit(ptrdiff_t limit);
- ptrdiff_t getOffsetStart() const;
- ptrdiff_t getOffsetLimit() const;
-
-private:
- void initBasic(ValueType type, bool allocated = false);
-
- Value& resolveReference(const char* key);
- Value& resolveReference(const char* key, const char* end);
-
- struct CommentInfo {
- CommentInfo();
- ~CommentInfo();
-
- void setComment(const char* text, size_t len);
-
- char* comment_;
- };
-
- // struct MemberNamesTransform
- //{
- // typedef const char *result_type;
- // const char *operator()( const CZString &name ) const
- // {
- // return name.c_str();
- // }
- //};
-
- union ValueHolder {
- LargestInt int_;
- LargestUInt uint_;
- double real_;
- bool bool_;
- char* string_; // actually ptr to unsigned, followed by str, unless !allocated_
- ObjectValues* map_;
- } value_;
- ValueType type_ : 8;
- unsigned int allocated_ : 1; // Notes: if declared as bool, bitfield is useless.
- // If not allocated_, string_ must be null-terminated.
- CommentInfo* comments_;
-
- // [start, limit) byte offsets in the source JSON text from which this Value
- // was extracted.
- ptrdiff_t start_;
- ptrdiff_t limit_;
-};
-
-/** \brief Experimental and untested: represents an element of the "path" to
- * access a node.
- */
-class JSON_API PathArgument {
-public:
- friend class Path;
-
- PathArgument();
- PathArgument(ArrayIndex index);
- PathArgument(const char* key);
- PathArgument(const JSONCPP_STRING& key);
-
-private:
- enum Kind {
- kindNone = 0,
- kindIndex,
- kindKey
- };
- JSONCPP_STRING key_;
- ArrayIndex index_;
- Kind kind_;
-};
-
-/** \brief Experimental and untested: represents a "path" to access a node.
- *
- * Syntax:
- * - "." => root node
- * - ".[n]" => elements at index 'n' of root node (an array value)
- * - ".name" => member named 'name' of root node (an object value)
- * - ".name1.name2.name3"
- * - ".[0][1][2].name1[3]"
- * - ".%" => member name is provided as parameter
- * - ".[%]" => index is provied as parameter
- */
-class JSON_API Path {
-public:
- Path(const JSONCPP_STRING& path,
- const PathArgument& a1 = PathArgument(),
- const PathArgument& a2 = PathArgument(),
- const PathArgument& a3 = PathArgument(),
- const PathArgument& a4 = PathArgument(),
- const PathArgument& a5 = PathArgument());
-
- const Value& resolve(const Value& root) const;
- Value resolve(const Value& root, const Value& defaultValue) const;
- /// Creates the "path" to access the specified node and returns a reference on
- /// the node.
- Value& make(Value& root) const;
-
-private:
- typedef std::vector<const PathArgument*> InArgs;
- typedef std::vector<PathArgument> Args;
-
- void makePath(const JSONCPP_STRING& path, const InArgs& in);
- void addPathInArg(const JSONCPP_STRING& path,
- const InArgs& in,
- InArgs::const_iterator& itInArg,
- PathArgument::Kind kind);
- void invalidPath(const JSONCPP_STRING& path, int location);
-
- Args args_;
-};
-
-/** \brief base class for Value iterators.
- *
- */
-class JSON_API ValueIteratorBase {
-public:
- typedef std::bidirectional_iterator_tag iterator_category;
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef ValueIteratorBase SelfType;
-
- bool operator==(const SelfType& other) const { return isEqual(other); }
-
- bool operator!=(const SelfType& other) const { return !isEqual(other); }
-
- difference_type operator-(const SelfType& other) const {
- return other.computeDistance(*this);
- }
-
- /// Return either the index or the member name of the referenced value as a
- /// Value.
- Value key() const;
-
- /// Return the index of the referenced Value, or -1 if it is not an arrayValue.
- UInt index() const;
-
- /// Return the member name of the referenced Value, or "" if it is not an
- /// objectValue.
- /// \note Avoid `c_str()` on result, as embedded zeroes are possible.
- JSONCPP_STRING name() const;
-
- /// Return the member name of the referenced Value. "" if it is not an
- /// objectValue.
- /// \deprecated This cannot be used for UTF-8 strings, since there can be embedded nulls.
- JSONCPP_DEPRECATED("Use `key = name();` instead.")
- char const* memberName() const;
- /// Return the member name of the referenced Value, or NULL if it is not an
- /// objectValue.
- /// \note Better version than memberName(). Allows embedded nulls.
- char const* memberName(char const** end) const;
-
-protected:
- Value& deref() const;
-
- void increment();
-
- void decrement();
-
- difference_type computeDistance(const SelfType& other) const;
-
- bool isEqual(const SelfType& other) const;
-
- void copy(const SelfType& other);
-
-private:
- Value::ObjectValues::iterator current_;
- // Indicates that iterator is for a null value.
- bool isNull_;
-
-public:
- // For some reason, BORLAND needs these at the end, rather
- // than earlier. No idea why.
- ValueIteratorBase();
- explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
-};
-
-/** \brief const iterator for object and array value.
- *
- */
-class JSON_API ValueConstIterator : public ValueIteratorBase {
- friend class Value;
-
-public:
- typedef const Value value_type;
- //typedef unsigned int size_t;
- //typedef int difference_type;
- typedef const Value& reference;
- typedef const Value* pointer;
- typedef ValueConstIterator SelfType;
-
- ValueConstIterator();
- ValueConstIterator(ValueIterator const& other);
-
-private:
-/*! \internal Use by Value to create an iterator.
- */
- explicit ValueConstIterator(const Value::ObjectValues::iterator& current);
-public:
- SelfType& operator=(const ValueIteratorBase& other);
-
- SelfType operator++(int) {
- SelfType temp(*this);
- ++*this;
- return temp;
- }
-
- SelfType operator--(int) {
- SelfType temp(*this);
- --*this;
- return temp;
- }
-
- SelfType& operator--() {
- decrement();
- return *this;
- }
-
- SelfType& operator++() {
- increment();
- return *this;
- }
-
- reference operator*() const { return deref(); }
-
- pointer operator->() const { return &deref(); }
-};
-
-/** \brief Iterator for object and array value.
- */
-class JSON_API ValueIterator : public ValueIteratorBase {
- friend class Value;
-
-public:
- typedef Value value_type;
- typedef unsigned int size_t;
- typedef int difference_type;
- typedef Value& reference;
- typedef Value* pointer;
- typedef ValueIterator SelfType;
-
- ValueIterator();
- explicit ValueIterator(const ValueConstIterator& other);
- ValueIterator(const ValueIterator& other);
-
-private:
-/*! \internal Use by Value to create an iterator.
- */
- explicit ValueIterator(const Value::ObjectValues::iterator& current);
-public:
- SelfType& operator=(const SelfType& other);
-
- SelfType operator++(int) {
- SelfType temp(*this);
- ++*this;
- return temp;
- }
-
- SelfType operator--(int) {
- SelfType temp(*this);
- --*this;
- return temp;
- }
-
- SelfType& operator--() {
- decrement();
- return *this;
- }
-
- SelfType& operator++() {
- increment();
- return *this;
- }
-
- reference operator*() const { return deref(); }
-
- pointer operator->() const { return &deref(); }
-};
-
-} // namespace Json
-
-
-namespace std {
-/// Specialize std::swap() for Json::Value.
-template<>
-inline void swap(Json::Value& a, Json::Value& b) { a.swap(b); }
-}
-
-
-#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-#pragma warning(pop)
-#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-
-#endif // CPPTL_JSON_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/version.h b/toolkit/crashreporter/jsoncpp/include/json/version.h
deleted file mode 100644
index 24e2b09033..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/version.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// DO NOT EDIT. This file (and "version") is generated by CMake.
-// Run CMake configure step to update it.
-#ifndef JSON_VERSION_H_INCLUDED
-# define JSON_VERSION_H_INCLUDED
-
-# define JSONCPP_VERSION_STRING "1.7.7"
-# define JSONCPP_VERSION_MAJOR 1
-# define JSONCPP_VERSION_MINOR 7
-# define JSONCPP_VERSION_PATCH 7
-# define JSONCPP_VERSION_QUALIFIER
-# define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
-
-#ifdef JSONCPP_USING_SECURE_MEMORY
-#undef JSONCPP_USING_SECURE_MEMORY
-#endif
-#define JSONCPP_USING_SECURE_MEMORY 0
-// If non-zero, the library zeroes any memory that it has allocated before
-// it frees its memory.
-
-#endif // JSON_VERSION_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/include/json/writer.h b/toolkit/crashreporter/jsoncpp/include/json/writer.h
deleted file mode 100644
index 2c1e65bf16..0000000000
--- a/toolkit/crashreporter/jsoncpp/include/json/writer.h
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef JSON_WRITER_H_INCLUDED
-#define JSON_WRITER_H_INCLUDED
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include "value.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <vector>
-#include <string>
-#include <ostream>
-
-// Disable warning C4251: <data member>: <type> needs to have dll-interface to
-// be used by...
-#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-#pragma warning(push)
-#pragma warning(disable : 4251)
-#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-
-namespace Json {
-
-class Value;
-
-/**
-
-Usage:
-\code
- using namespace Json;
- void writeToStdout(StreamWriter::Factory const& factory, Value const& value) {
- std::unique_ptr<StreamWriter> const writer(
- factory.newStreamWriter());
- writer->write(value, &std::cout);
- std::cout << std::endl; // add lf and flush
- }
-\endcode
-*/
-class JSON_API StreamWriter {
-protected:
- JSONCPP_OSTREAM* sout_; // not owned; will not delete
-public:
- StreamWriter();
- virtual ~StreamWriter();
- /** Write Value into document as configured in sub-class.
- Do not take ownership of sout, but maintain a reference during function.
- \pre sout != NULL
- \return zero on success (For now, we always return zero, so check the stream instead.)
- \throw std::exception possibly, depending on configuration
- */
- virtual int write(Value const& root, JSONCPP_OSTREAM* sout) = 0;
-
- /** \brief A simple abstract factory.
- */
- class JSON_API Factory {
- public:
- virtual ~Factory();
- /** \brief Allocate a CharReader via operator new().
- * \throw std::exception if something goes wrong (e.g. invalid settings)
- */
- virtual StreamWriter* newStreamWriter() const = 0;
- }; // Factory
-}; // StreamWriter
-
-/** \brief Write into stringstream, then return string, for convenience.
- * A StreamWriter will be created from the factory, used, and then deleted.
- */
-JSONCPP_STRING JSON_API writeString(StreamWriter::Factory const& factory, Value const& root);
-
-
-/** \brief Build a StreamWriter implementation.
-
-Usage:
-\code
- using namespace Json;
- Value value = ...;
- StreamWriterBuilder builder;
- builder["commentStyle"] = "None";
- builder["indentation"] = " "; // or whatever you like
- std::unique_ptr<Json::StreamWriter> writer(
- builder.newStreamWriter());
- writer->write(value, &std::cout);
- std::cout << std::endl; // add lf and flush
-\endcode
-*/
-class JSON_API StreamWriterBuilder : public StreamWriter::Factory {
-public:
- // Note: We use a Json::Value so that we can add data-members to this class
- // without a major version bump.
- /** Configuration of this builder.
- Available settings (case-sensitive):
- - "commentStyle": "None" or "All"
- - "indentation": "<anything>"
- - "enableYAMLCompatibility": false or true
- - slightly change the whitespace around colons
- - "dropNullPlaceholders": false or true
- - Drop the "null" string from the writer's output for nullValues.
- Strictly speaking, this is not valid JSON. But when the output is being
- fed to a browser's Javascript, it makes for smaller output and the
- browser can handle the output just fine.
- - "useSpecialFloats": false or true
- - If true, outputs non-finite floating point values in the following way:
- NaN values as "NaN", positive infinity as "Infinity", and negative infinity
- as "-Infinity".
-
- You can examine 'settings_` yourself
- to see the defaults. You can also write and read them just like any
- JSON Value.
- \sa setDefaults()
- */
- Json::Value settings_;
-
- StreamWriterBuilder();
- ~StreamWriterBuilder() JSONCPP_OVERRIDE;
-
- /**
- * \throw std::exception if something goes wrong (e.g. invalid settings)
- */
- StreamWriter* newStreamWriter() const JSONCPP_OVERRIDE;
-
- /** \return true if 'settings' are legal and consistent;
- * otherwise, indicate bad settings via 'invalid'.
- */
- bool validate(Json::Value* invalid) const;
- /** A simple way to update a specific setting.
- */
- Value& operator[](JSONCPP_STRING key);
-
- /** Called by ctor, but you can use this to reset settings_.
- * \pre 'settings' != NULL (but Json::null is fine)
- * \remark Defaults:
- * \snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults
- */
- static void setDefaults(Json::Value* settings);
-};
-
-/** \brief Abstract class for writers.
- * \deprecated Use StreamWriter. (And really, this is an implementation detail.)
- */
-class JSON_API Writer {
-public:
- virtual ~Writer();
-
- virtual JSONCPP_STRING write(const Value& root) = 0;
-};
-
-/** \brief Outputs a Value in <a HREF="http://www.json.org">JSON</a> format
- *without formatting (not human friendly).
- *
- * The JSON document is written in a single line. It is not intended for 'human'
- *consumption,
- * but may be usefull to support feature such as RPC where bandwith is limited.
- * \sa Reader, Value
- * \deprecated Use StreamWriterBuilder.
- */
-class JSON_API FastWriter : public Writer {
-
-public:
- FastWriter();
- ~FastWriter() JSONCPP_OVERRIDE {}
-
- void enableYAMLCompatibility();
-
- /** \brief Drop the "null" string from the writer's output for nullValues.
- * Strictly speaking, this is not valid JSON. But when the output is being
- * fed to a browser's Javascript, it makes for smaller output and the
- * browser can handle the output just fine.
- */
- void dropNullPlaceholders();
-
- void omitEndingLineFeed();
-
-public: // overridden from Writer
- JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
-
-private:
- void writeValue(const Value& value);
-
- JSONCPP_STRING document_;
- bool yamlCompatiblityEnabled_;
- bool dropNullPlaceholders_;
- bool omitEndingLineFeed_;
-};
-
-/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
- *human friendly way.
- *
- * The rules for line break and indent are as follow:
- * - Object value:
- * - if empty then print {} without indent and line break
- * - if not empty the print '{', line break & indent, print one value per
- *line
- * and then unindent and line break and print '}'.
- * - Array value:
- * - if empty then print [] without indent and line break
- * - if the array contains no object value, empty array or some other value
- *types,
- * and all the values fit on one lines, then print the array on a single
- *line.
- * - otherwise, it the values do not fit on one line, or the array contains
- * object or non empty array, then print one value per line.
- *
- * If the Value have comments then they are outputed according to their
- *#CommentPlacement.
- *
- * \sa Reader, Value, Value::setComment()
- * \deprecated Use StreamWriterBuilder.
- */
-class JSON_API StyledWriter : public Writer {
-public:
- StyledWriter();
- ~StyledWriter() JSONCPP_OVERRIDE {}
-
-public: // overridden from Writer
- /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
- * \param root Value to serialize.
- * \return String containing the JSON document that represents the root value.
- */
- JSONCPP_STRING write(const Value& root) JSONCPP_OVERRIDE;
-
-private:
- void writeValue(const Value& value);
- void writeArrayValue(const Value& value);
- bool isMultineArray(const Value& value);
- void pushValue(const JSONCPP_STRING& value);
- void writeIndent();
- void writeWithIndent(const JSONCPP_STRING& value);
- void indent();
- void unindent();
- void writeCommentBeforeValue(const Value& root);
- void writeCommentAfterValueOnSameLine(const Value& root);
- bool hasCommentForValue(const Value& value);
- static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
-
- typedef std::vector<JSONCPP_STRING> ChildValues;
-
- ChildValues childValues_;
- JSONCPP_STRING document_;
- JSONCPP_STRING indentString_;
- unsigned int rightMargin_;
- unsigned int indentSize_;
- bool addChildValues_;
-};
-
-/** \brief Writes a Value in <a HREF="http://www.json.org">JSON</a> format in a
- human friendly way,
- to a stream rather than to a string.
- *
- * The rules for line break and indent are as follow:
- * - Object value:
- * - if empty then print {} without indent and line break
- * - if not empty the print '{', line break & indent, print one value per
- line
- * and then unindent and line break and print '}'.
- * - Array value:
- * - if empty then print [] without indent and line break
- * - if the array contains no object value, empty array or some other value
- types,
- * and all the values fit on one lines, then print the array on a single
- line.
- * - otherwise, it the values do not fit on one line, or the array contains
- * object or non empty array, then print one value per line.
- *
- * If the Value have comments then they are outputed according to their
- #CommentPlacement.
- *
- * \param indentation Each level will be indented by this amount extra.
- * \sa Reader, Value, Value::setComment()
- * \deprecated Use StreamWriterBuilder.
- */
-class JSON_API StyledStreamWriter {
-public:
- StyledStreamWriter(JSONCPP_STRING indentation = "\t");
- ~StyledStreamWriter() {}
-
-public:
- /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format.
- * \param out Stream to write to. (Can be ostringstream, e.g.)
- * \param root Value to serialize.
- * \note There is no point in deriving from Writer, since write() should not
- * return a value.
- */
- void write(JSONCPP_OSTREAM& out, const Value& root);
-
-private:
- void writeValue(const Value& value);
- void writeArrayValue(const Value& value);
- bool isMultineArray(const Value& value);
- void pushValue(const JSONCPP_STRING& value);
- void writeIndent();
- void writeWithIndent(const JSONCPP_STRING& value);
- void indent();
- void unindent();
- void writeCommentBeforeValue(const Value& root);
- void writeCommentAfterValueOnSameLine(const Value& root);
- bool hasCommentForValue(const Value& value);
- static JSONCPP_STRING normalizeEOL(const JSONCPP_STRING& text);
-
- typedef std::vector<JSONCPP_STRING> ChildValues;
-
- ChildValues childValues_;
- JSONCPP_OSTREAM* document_;
- JSONCPP_STRING indentString_;
- unsigned int rightMargin_;
- JSONCPP_STRING indentation_;
- bool addChildValues_ : 1;
- bool indented_ : 1;
-};
-
-#if defined(JSON_HAS_INT64)
-JSONCPP_STRING JSON_API valueToString(Int value);
-JSONCPP_STRING JSON_API valueToString(UInt value);
-#endif // if defined(JSON_HAS_INT64)
-JSONCPP_STRING JSON_API valueToString(LargestInt value);
-JSONCPP_STRING JSON_API valueToString(LargestUInt value);
-JSONCPP_STRING JSON_API valueToString(double value);
-JSONCPP_STRING JSON_API valueToString(bool value);
-JSONCPP_STRING JSON_API valueToQuotedString(const char* value);
-
-/// \brief Output using the StyledStreamWriter.
-/// \see Json::operator>>()
-JSON_API JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM&, const Value& root);
-
-} // namespace Json
-
-#if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-#pragma warning(pop)
-#endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
-
-#endif // JSON_WRITER_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/src/lib_json/json_reader.cpp b/toolkit/crashreporter/jsoncpp/src/lib_json/json_reader.cpp
deleted file mode 100644
index 5e04d7447c..0000000000
--- a/toolkit/crashreporter/jsoncpp/src/lib_json/json_reader.cpp
+++ /dev/null
@@ -1,2039 +0,0 @@
-// Copyright 2007-2011 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include <json/assertions.h>
-#include <json/reader.h>
-#include <json/value.h>
-#include "json_tool.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <utility>
-#include <cstdio>
-#include <cassert>
-#include <cstring>
-#include <istream>
-#include <sstream>
-#include <memory>
-#include <set>
-#include <limits>
-
-#if defined(_MSC_VER)
-#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
-#define snprintf sprintf_s
-#elif _MSC_VER >= 1900 // VC++ 14.0 and above
-#define snprintf std::snprintf
-#else
-#define snprintf _snprintf
-#endif
-#elif defined(__ANDROID__) || defined(__QNXNTO__)
-#define snprintf snprintf
-#elif __cplusplus >= 201103L
-#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-#define snprintf std::snprintf
-#endif
-#endif
-
-#if defined(__QNXNTO__)
-#define sscanf std::sscanf
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
-// Disable warning about strdup being deprecated.
-#pragma warning(disable : 4996)
-#endif
-
-static int const stackLimit_g = 1000;
-static int stackDepth_g = 0; // see readValue()
-
-namespace Json {
-
-#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
-typedef std::unique_ptr<CharReader> CharReaderPtr;
-#else
-typedef std::auto_ptr<CharReader> CharReaderPtr;
-#endif
-
-// Implementation of class Features
-// ////////////////////////////////
-
-Features::Features()
- : allowComments_(true), strictRoot_(false),
- allowDroppedNullPlaceholders_(false), allowNumericKeys_(false) {}
-
-Features Features::all() { return Features(); }
-
-Features Features::strictMode() {
- Features features;
- features.allowComments_ = false;
- features.strictRoot_ = true;
- features.allowDroppedNullPlaceholders_ = false;
- features.allowNumericKeys_ = false;
- return features;
-}
-
-// Implementation of class Reader
-// ////////////////////////////////
-
-static bool containsNewLine(Reader::Location begin, Reader::Location end) {
- for (; begin < end; ++begin)
- if (*begin == '\n' || *begin == '\r')
- return true;
- return false;
-}
-
-// Class Reader
-// //////////////////////////////////////////////////////////////////
-
-Reader::Reader()
- : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
- lastValue_(), commentsBefore_(), features_(Features::all()),
- collectComments_() {}
-
-Reader::Reader(const Features& features)
- : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
- lastValue_(), commentsBefore_(), features_(features), collectComments_() {
-}
-
-bool
-Reader::parse(const std::string& document, Value& root, bool collectComments) {
- JSONCPP_STRING documentCopy(document.data(), document.data() + document.capacity());
- std::swap(documentCopy, document_);
- const char* begin = document_.c_str();
- const char* end = begin + document_.length();
- return parse(begin, end, root, collectComments);
-}
-
-bool Reader::parse(std::istream& sin, Value& root, bool collectComments) {
- // std::istream_iterator<char> begin(sin);
- // std::istream_iterator<char> end;
- // Those would allow streamed input from a file, if parse() were a
- // template function.
-
- // Since JSONCPP_STRING is reference-counted, this at least does not
- // create an extra copy.
- JSONCPP_STRING doc;
- std::getline(sin, doc, (char)EOF);
- return parse(doc.data(), doc.data() + doc.size(), root, collectComments);
-}
-
-bool Reader::parse(const char* beginDoc,
- const char* endDoc,
- Value& root,
- bool collectComments) {
- if (!features_.allowComments_) {
- collectComments = false;
- }
-
- begin_ = beginDoc;
- end_ = endDoc;
- collectComments_ = collectComments;
- current_ = begin_;
- lastValueEnd_ = 0;
- lastValue_ = 0;
- commentsBefore_ = "";
- errors_.clear();
- while (!nodes_.empty())
- nodes_.pop();
- nodes_.push(&root);
-
- stackDepth_g = 0; // Yes, this is bad coding, but options are limited.
- bool successful = readValue();
- Token token;
- skipCommentTokens(token);
- if (collectComments_ && !commentsBefore_.empty())
- root.setComment(commentsBefore_, commentAfter);
- if (features_.strictRoot_) {
- if (!root.isArray() && !root.isObject()) {
- // Set error location to start of doc, ideally should be first token found
- // in doc
- token.type_ = tokenError;
- token.start_ = beginDoc;
- token.end_ = endDoc;
- addError(
- "A valid JSON document must be either an array or an object value.",
- token);
- return false;
- }
- }
- return successful;
-}
-
-bool Reader::readValue() {
- // This is a non-reentrant way to support a stackLimit. Terrible!
- // But this deprecated class has a security problem: Bad input can
- // cause a seg-fault. This seems like a fair, binary-compatible way
- // to prevent the problem.
- if (stackDepth_g >= stackLimit_g) throwRuntimeError("Exceeded stackLimit in readValue().");
- ++stackDepth_g;
-
- Token token;
- skipCommentTokens(token);
- bool successful = true;
-
- if (collectComments_ && !commentsBefore_.empty()) {
- currentValue().setComment(commentsBefore_, commentBefore);
- commentsBefore_ = "";
- }
-
- switch (token.type_) {
- case tokenObjectBegin:
- successful = readObject(token);
- currentValue().setOffsetLimit(current_ - begin_);
- break;
- case tokenArrayBegin:
- successful = readArray(token);
- currentValue().setOffsetLimit(current_ - begin_);
- break;
- case tokenNumber:
- successful = decodeNumber(token);
- break;
- case tokenString:
- successful = decodeString(token);
- break;
- case tokenTrue:
- {
- Value v(true);
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenFalse:
- {
- Value v(false);
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenNull:
- {
- Value v;
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenArraySeparator:
- case tokenObjectEnd:
- case tokenArrayEnd:
- if (features_.allowDroppedNullPlaceholders_) {
- // "Un-read" the current token and mark the current value as a null
- // token.
- current_--;
- Value v;
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(current_ - begin_ - 1);
- currentValue().setOffsetLimit(current_ - begin_);
- break;
- } // Else, fall through...
- default:
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return addError("Syntax error: value, object or array expected.", token);
- }
-
- if (collectComments_) {
- lastValueEnd_ = current_;
- lastValue_ = &currentValue();
- }
-
- --stackDepth_g;
- return successful;
-}
-
-void Reader::skipCommentTokens(Token& token) {
- if (features_.allowComments_) {
- do {
- readToken(token);
- } while (token.type_ == tokenComment);
- } else {
- readToken(token);
- }
-}
-
-bool Reader::readToken(Token& token) {
- skipSpaces();
- token.start_ = current_;
- Char c = getNextChar();
- bool ok = true;
- switch (c) {
- case '{':
- token.type_ = tokenObjectBegin;
- break;
- case '}':
- token.type_ = tokenObjectEnd;
- break;
- case '[':
- token.type_ = tokenArrayBegin;
- break;
- case ']':
- token.type_ = tokenArrayEnd;
- break;
- case '"':
- token.type_ = tokenString;
- ok = readString();
- break;
- case '/':
- token.type_ = tokenComment;
- ok = readComment();
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- case '-':
- token.type_ = tokenNumber;
- readNumber();
- break;
- case 't':
- token.type_ = tokenTrue;
- ok = match("rue", 3);
- break;
- case 'f':
- token.type_ = tokenFalse;
- ok = match("alse", 4);
- break;
- case 'n':
- token.type_ = tokenNull;
- ok = match("ull", 3);
- break;
- case ',':
- token.type_ = tokenArraySeparator;
- break;
- case ':':
- token.type_ = tokenMemberSeparator;
- break;
- case 0:
- token.type_ = tokenEndOfStream;
- break;
- default:
- ok = false;
- break;
- }
- if (!ok)
- token.type_ = tokenError;
- token.end_ = current_;
- return true;
-}
-
-void Reader::skipSpaces() {
- while (current_ != end_) {
- Char c = *current_;
- if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
- ++current_;
- else
- break;
- }
-}
-
-bool Reader::match(Location pattern, int patternLength) {
- if (end_ - current_ < patternLength)
- return false;
- int index = patternLength;
- while (index--)
- if (current_[index] != pattern[index])
- return false;
- current_ += patternLength;
- return true;
-}
-
-bool Reader::readComment() {
- Location commentBegin = current_ - 1;
- Char c = getNextChar();
- bool successful = false;
- if (c == '*')
- successful = readCStyleComment();
- else if (c == '/')
- successful = readCppStyleComment();
- if (!successful)
- return false;
-
- if (collectComments_) {
- CommentPlacement placement = commentBefore;
- if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
- if (c != '*' || !containsNewLine(commentBegin, current_))
- placement = commentAfterOnSameLine;
- }
-
- addComment(commentBegin, current_, placement);
- }
- return true;
-}
-
-static JSONCPP_STRING normalizeEOL(Reader::Location begin, Reader::Location end) {
- JSONCPP_STRING normalized;
- normalized.reserve(static_cast<size_t>(end - begin));
- Reader::Location current = begin;
- while (current != end) {
- char c = *current++;
- if (c == '\r') {
- if (current != end && *current == '\n')
- // convert dos EOL
- ++current;
- // convert Mac EOL
- normalized += '\n';
- } else {
- normalized += c;
- }
- }
- return normalized;
-}
-
-void
-Reader::addComment(Location begin, Location end, CommentPlacement placement) {
- assert(collectComments_);
- const JSONCPP_STRING& normalized = normalizeEOL(begin, end);
- if (placement == commentAfterOnSameLine) {
- assert(lastValue_ != 0);
- lastValue_->setComment(normalized, placement);
- } else {
- commentsBefore_ += normalized;
- }
-}
-
-bool Reader::readCStyleComment() {
- while ((current_ + 1) < end_) {
- Char c = getNextChar();
- if (c == '*' && *current_ == '/')
- break;
- }
- return getNextChar() == '/';
-}
-
-bool Reader::readCppStyleComment() {
- while (current_ != end_) {
- Char c = getNextChar();
- if (c == '\n')
- break;
- if (c == '\r') {
- // Consume DOS EOL. It will be normalized in addComment.
- if (current_ != end_ && *current_ == '\n')
- getNextChar();
- // Break on Moc OS 9 EOL.
- break;
- }
- }
- return true;
-}
-
-void Reader::readNumber() {
- const char *p = current_;
- char c = '0'; // stopgap for already consumed character
- // integral part
- while (c >= '0' && c <= '9')
- c = (current_ = p) < end_ ? *p++ : '\0';
- // fractional part
- if (c == '.') {
- c = (current_ = p) < end_ ? *p++ : '\0';
- while (c >= '0' && c <= '9')
- c = (current_ = p) < end_ ? *p++ : '\0';
- }
- // exponential part
- if (c == 'e' || c == 'E') {
- c = (current_ = p) < end_ ? *p++ : '\0';
- if (c == '+' || c == '-')
- c = (current_ = p) < end_ ? *p++ : '\0';
- while (c >= '0' && c <= '9')
- c = (current_ = p) < end_ ? *p++ : '\0';
- }
-}
-
-bool Reader::readString() {
- Char c = '\0';
- while (current_ != end_) {
- c = getNextChar();
- if (c == '\\')
- getNextChar();
- else if (c == '"')
- break;
- }
- return c == '"';
-}
-
-bool Reader::readObject(Token& tokenStart) {
- Token tokenName;
- JSONCPP_STRING name;
- Value init(objectValue);
- currentValue().swapPayload(init);
- currentValue().setOffsetStart(tokenStart.start_ - begin_);
- while (readToken(tokenName)) {
- bool initialTokenOk = true;
- while (tokenName.type_ == tokenComment && initialTokenOk)
- initialTokenOk = readToken(tokenName);
- if (!initialTokenOk)
- break;
- if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
- return true;
- name = "";
- if (tokenName.type_ == tokenString) {
- if (!decodeString(tokenName, name))
- return recoverFromError(tokenObjectEnd);
- } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
- Value numberName;
- if (!decodeNumber(tokenName, numberName))
- return recoverFromError(tokenObjectEnd);
- name = JSONCPP_STRING(numberName.asCString());
- } else {
- break;
- }
-
- Token colon;
- if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
- return addErrorAndRecover(
- "Missing ':' after object member name", colon, tokenObjectEnd);
- }
- Value& value = currentValue()[name];
- nodes_.push(&value);
- bool ok = readValue();
- nodes_.pop();
- if (!ok) // error already set
- return recoverFromError(tokenObjectEnd);
-
- Token comma;
- if (!readToken(comma) ||
- (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
- comma.type_ != tokenComment)) {
- return addErrorAndRecover(
- "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
- }
- bool finalizeTokenOk = true;
- while (comma.type_ == tokenComment && finalizeTokenOk)
- finalizeTokenOk = readToken(comma);
- if (comma.type_ == tokenObjectEnd)
- return true;
- }
- return addErrorAndRecover(
- "Missing '}' or object member name", tokenName, tokenObjectEnd);
-}
-
-bool Reader::readArray(Token& tokenStart) {
- Value init(arrayValue);
- currentValue().swapPayload(init);
- currentValue().setOffsetStart(tokenStart.start_ - begin_);
- skipSpaces();
- if (current_ != end_ && *current_ == ']') // empty array
- {
- Token endArray;
- readToken(endArray);
- return true;
- }
- int index = 0;
- for (;;) {
- Value& value = currentValue()[index++];
- nodes_.push(&value);
- bool ok = readValue();
- nodes_.pop();
- if (!ok) // error already set
- return recoverFromError(tokenArrayEnd);
-
- Token token;
- // Accept Comment after last item in the array.
- ok = readToken(token);
- while (token.type_ == tokenComment && ok) {
- ok = readToken(token);
- }
- bool badTokenType =
- (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
- if (!ok || badTokenType) {
- return addErrorAndRecover(
- "Missing ',' or ']' in array declaration", token, tokenArrayEnd);
- }
- if (token.type_ == tokenArrayEnd)
- break;
- }
- return true;
-}
-
-bool Reader::decodeNumber(Token& token) {
- Value decoded;
- if (!decodeNumber(token, decoded))
- return false;
- currentValue().swapPayload(decoded);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return true;
-}
-
-bool Reader::decodeNumber(Token& token, Value& decoded) {
- // Attempts to parse the number as an integer. If the number is
- // larger than the maximum supported value of an integer then
- // we decode the number as a double.
- Location current = token.start_;
- bool isNegative = *current == '-';
- if (isNegative)
- ++current;
- // TODO: Help the compiler do the div and mod at compile time or get rid of them.
- Value::LargestUInt maxIntegerValue =
- isNegative ? Value::LargestUInt(Value::maxLargestInt) + 1
- : Value::maxLargestUInt;
- Value::LargestUInt threshold = maxIntegerValue / 10;
- Value::LargestUInt value = 0;
- while (current < token.end_) {
- Char c = *current++;
- if (c < '0' || c > '9')
- return decodeDouble(token, decoded);
- Value::UInt digit(static_cast<Value::UInt>(c - '0'));
- if (value >= threshold) {
- // We've hit or exceeded the max value divided by 10 (rounded down). If
- // a) we've only just touched the limit, b) this is the last digit, and
- // c) it's small enough to fit in that rounding delta, we're okay.
- // Otherwise treat this number as a double to avoid overflow.
- if (value > threshold || current != token.end_ ||
- digit > maxIntegerValue % 10) {
- return decodeDouble(token, decoded);
- }
- }
- value = value * 10 + digit;
- }
- if (isNegative && value == maxIntegerValue)
- decoded = Value::minLargestInt;
- else if (isNegative)
- decoded = -Value::LargestInt(value);
- else if (value <= Value::LargestUInt(Value::maxInt))
- decoded = Value::LargestInt(value);
- else
- decoded = value;
- return true;
-}
-
-bool Reader::decodeDouble(Token& token) {
- Value decoded;
- if (!decodeDouble(token, decoded))
- return false;
- currentValue().swapPayload(decoded);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return true;
-}
-
-bool Reader::decodeDouble(Token& token, Value& decoded) {
- double value = 0;
- JSONCPP_STRING buffer(token.start_, token.end_);
- JSONCPP_ISTRINGSTREAM is(buffer);
- if (!(is >> value))
- return addError("'" + JSONCPP_STRING(token.start_, token.end_) +
- "' is not a number.",
- token);
- decoded = value;
- return true;
-}
-
-bool Reader::decodeString(Token& token) {
- JSONCPP_STRING decoded_string;
- if (!decodeString(token, decoded_string))
- return false;
- Value decoded(decoded_string);
- currentValue().swapPayload(decoded);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return true;
-}
-
-bool Reader::decodeString(Token& token, JSONCPP_STRING& decoded) {
- decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
- Location current = token.start_ + 1; // skip '"'
- Location end = token.end_ - 1; // do not include '"'
- while (current != end) {
- Char c = *current++;
- if (c == '"')
- break;
- else if (c == '\\') {
- if (current == end)
- return addError("Empty escape sequence in string", token, current);
- Char escape = *current++;
- switch (escape) {
- case '"':
- decoded += '"';
- break;
- case '/':
- decoded += '/';
- break;
- case '\\':
- decoded += '\\';
- break;
- case 'b':
- decoded += '\b';
- break;
- case 'f':
- decoded += '\f';
- break;
- case 'n':
- decoded += '\n';
- break;
- case 'r':
- decoded += '\r';
- break;
- case 't':
- decoded += '\t';
- break;
- case 'u': {
- unsigned int unicode;
- if (!decodeUnicodeCodePoint(token, current, end, unicode))
- return false;
- decoded += codePointToUTF8(unicode);
- } break;
- default:
- return addError("Bad escape sequence in string", token, current);
- }
- } else {
- decoded += c;
- }
- }
- return true;
-}
-
-bool Reader::decodeUnicodeCodePoint(Token& token,
- Location& current,
- Location end,
- unsigned int& unicode) {
-
- if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
- return false;
- if (unicode >= 0xD800 && unicode <= 0xDBFF) {
- // surrogate pairs
- if (end - current < 6)
- return addError(
- "additional six characters expected to parse unicode surrogate pair.",
- token,
- current);
- unsigned int surrogatePair;
- if (*(current++) == '\\' && *(current++) == 'u') {
- if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
- unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
- } else
- return false;
- } else
- return addError("expecting another \\u token to begin the second half of "
- "a unicode surrogate pair",
- token,
- current);
- }
- return true;
-}
-
-bool Reader::decodeUnicodeEscapeSequence(Token& token,
- Location& current,
- Location end,
- unsigned int& ret_unicode) {
- if (end - current < 4)
- return addError(
- "Bad unicode escape sequence in string: four digits expected.",
- token,
- current);
- int unicode = 0;
- for (int index = 0; index < 4; ++index) {
- Char c = *current++;
- unicode *= 16;
- if (c >= '0' && c <= '9')
- unicode += c - '0';
- else if (c >= 'a' && c <= 'f')
- unicode += c - 'a' + 10;
- else if (c >= 'A' && c <= 'F')
- unicode += c - 'A' + 10;
- else
- return addError(
- "Bad unicode escape sequence in string: hexadecimal digit expected.",
- token,
- current);
- }
- ret_unicode = static_cast<unsigned int>(unicode);
- return true;
-}
-
-bool
-Reader::addError(const JSONCPP_STRING& message, Token& token, Location extra) {
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = extra;
- errors_.push_back(info);
- return false;
-}
-
-bool Reader::recoverFromError(TokenType skipUntilToken) {
- size_t const errorCount = errors_.size();
- Token skip;
- for (;;) {
- if (!readToken(skip))
- errors_.resize(errorCount); // discard errors caused by recovery
- if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
- break;
- }
- errors_.resize(errorCount);
- return false;
-}
-
-bool Reader::addErrorAndRecover(const JSONCPP_STRING& message,
- Token& token,
- TokenType skipUntilToken) {
- addError(message, token);
- return recoverFromError(skipUntilToken);
-}
-
-Value& Reader::currentValue() { return *(nodes_.top()); }
-
-Reader::Char Reader::getNextChar() {
- if (current_ == end_)
- return 0;
- return *current_++;
-}
-
-void Reader::getLocationLineAndColumn(Location location,
- int& line,
- int& column) const {
- Location current = begin_;
- Location lastLineStart = current;
- line = 0;
- while (current < location && current != end_) {
- Char c = *current++;
- if (c == '\r') {
- if (*current == '\n')
- ++current;
- lastLineStart = current;
- ++line;
- } else if (c == '\n') {
- lastLineStart = current;
- ++line;
- }
- }
- // column & line start at 1
- column = int(location - lastLineStart) + 1;
- ++line;
-}
-
-JSONCPP_STRING Reader::getLocationLineAndColumn(Location location) const {
- int line, column;
- getLocationLineAndColumn(location, line, column);
- char buffer[18 + 16 + 16 + 1];
- snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
- return buffer;
-}
-
-// Deprecated. Preserved for backward compatibility
-JSONCPP_STRING Reader::getFormatedErrorMessages() const {
- return getFormattedErrorMessages();
-}
-
-JSONCPP_STRING Reader::getFormattedErrorMessages() const {
- JSONCPP_STRING formattedMessage;
- for (Errors::const_iterator itError = errors_.begin();
- itError != errors_.end();
- ++itError) {
- const ErrorInfo& error = *itError;
- formattedMessage +=
- "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
- formattedMessage += " " + error.message_ + "\n";
- if (error.extra_)
- formattedMessage +=
- "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n";
- }
- return formattedMessage;
-}
-
-std::vector<Reader::StructuredError> Reader::getStructuredErrors() const {
- std::vector<Reader::StructuredError> allErrors;
- for (Errors::const_iterator itError = errors_.begin();
- itError != errors_.end();
- ++itError) {
- const ErrorInfo& error = *itError;
- Reader::StructuredError structured;
- structured.offset_start = error.token_.start_ - begin_;
- structured.offset_limit = error.token_.end_ - begin_;
- structured.message = error.message_;
- allErrors.push_back(structured);
- }
- return allErrors;
-}
-
-bool Reader::pushError(const Value& value, const JSONCPP_STRING& message) {
- ptrdiff_t const length = end_ - begin_;
- if(value.getOffsetStart() > length
- || value.getOffsetLimit() > length)
- return false;
- Token token;
- token.type_ = tokenError;
- token.start_ = begin_ + value.getOffsetStart();
- token.end_ = end_ + value.getOffsetLimit();
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = 0;
- errors_.push_back(info);
- return true;
-}
-
-bool Reader::pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra) {
- ptrdiff_t const length = end_ - begin_;
- if(value.getOffsetStart() > length
- || value.getOffsetLimit() > length
- || extra.getOffsetLimit() > length)
- return false;
- Token token;
- token.type_ = tokenError;
- token.start_ = begin_ + value.getOffsetStart();
- token.end_ = begin_ + value.getOffsetLimit();
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = begin_ + extra.getOffsetStart();
- errors_.push_back(info);
- return true;
-}
-
-bool Reader::good() const {
- return !errors_.size();
-}
-
-// exact copy of Features
-class OurFeatures {
-public:
- static OurFeatures all();
- bool allowComments_;
- bool strictRoot_;
- bool allowDroppedNullPlaceholders_;
- bool allowNumericKeys_;
- bool allowSingleQuotes_;
- bool failIfExtra_;
- bool rejectDupKeys_;
- bool allowSpecialFloats_;
- int stackLimit_;
-}; // OurFeatures
-
-// exact copy of Implementation of class Features
-// ////////////////////////////////
-
-OurFeatures OurFeatures::all() { return OurFeatures(); }
-
-// Implementation of class Reader
-// ////////////////////////////////
-
-// exact copy of Reader, renamed to OurReader
-class OurReader {
-public:
- typedef char Char;
- typedef const Char* Location;
- struct StructuredError {
- ptrdiff_t offset_start;
- ptrdiff_t offset_limit;
- JSONCPP_STRING message;
- };
-
- OurReader(OurFeatures const& features);
- bool parse(const char* beginDoc,
- const char* endDoc,
- Value& root,
- bool collectComments = true);
- JSONCPP_STRING getFormattedErrorMessages() const;
- std::vector<StructuredError> getStructuredErrors() const;
- bool pushError(const Value& value, const JSONCPP_STRING& message);
- bool pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra);
- bool good() const;
-
-private:
- OurReader(OurReader const&); // no impl
- void operator=(OurReader const&); // no impl
-
- enum TokenType {
- tokenEndOfStream = 0,
- tokenObjectBegin,
- tokenObjectEnd,
- tokenArrayBegin,
- tokenArrayEnd,
- tokenString,
- tokenNumber,
- tokenTrue,
- tokenFalse,
- tokenNull,
- tokenNaN,
- tokenPosInf,
- tokenNegInf,
- tokenArraySeparator,
- tokenMemberSeparator,
- tokenComment,
- tokenError
- };
-
- class Token {
- public:
- TokenType type_;
- Location start_;
- Location end_;
- };
-
- class ErrorInfo {
- public:
- Token token_;
- JSONCPP_STRING message_;
- Location extra_;
- };
-
- typedef std::deque<ErrorInfo> Errors;
-
- bool readToken(Token& token);
- void skipSpaces();
- bool match(Location pattern, int patternLength);
- bool readComment();
- bool readCStyleComment();
- bool readCppStyleComment();
- bool readString();
- bool readStringSingleQuote();
- bool readNumber(bool checkInf);
- bool readValue();
- bool readObject(Token& token);
- bool readArray(Token& token);
- bool decodeNumber(Token& token);
- bool decodeNumber(Token& token, Value& decoded);
- bool decodeString(Token& token);
- bool decodeString(Token& token, JSONCPP_STRING& decoded);
- bool decodeDouble(Token& token);
- bool decodeDouble(Token& token, Value& decoded);
- bool decodeUnicodeCodePoint(Token& token,
- Location& current,
- Location end,
- unsigned int& unicode);
- bool decodeUnicodeEscapeSequence(Token& token,
- Location& current,
- Location end,
- unsigned int& unicode);
- bool addError(const JSONCPP_STRING& message, Token& token, Location extra = 0);
- bool recoverFromError(TokenType skipUntilToken);
- bool addErrorAndRecover(const JSONCPP_STRING& message,
- Token& token,
- TokenType skipUntilToken);
- void skipUntilSpace();
- Value& currentValue();
- Char getNextChar();
- void
- getLocationLineAndColumn(Location location, int& line, int& column) const;
- JSONCPP_STRING getLocationLineAndColumn(Location location) const;
- void addComment(Location begin, Location end, CommentPlacement placement);
- void skipCommentTokens(Token& token);
-
- typedef std::stack<Value*> Nodes;
- Nodes nodes_;
- Errors errors_;
- JSONCPP_STRING document_;
- Location begin_;
- Location end_;
- Location current_;
- Location lastValueEnd_;
- Value* lastValue_;
- JSONCPP_STRING commentsBefore_;
- int stackDepth_;
-
- OurFeatures const features_;
- bool collectComments_;
-}; // OurReader
-
-// complete copy of Read impl, for OurReader
-
-OurReader::OurReader(OurFeatures const& features)
- : errors_(), document_(), begin_(), end_(), current_(), lastValueEnd_(),
- lastValue_(), commentsBefore_(),
- stackDepth_(0),
- features_(features), collectComments_() {
-}
-
-bool OurReader::parse(const char* beginDoc,
- const char* endDoc,
- Value& root,
- bool collectComments) {
- if (!features_.allowComments_) {
- collectComments = false;
- }
-
- begin_ = beginDoc;
- end_ = endDoc;
- collectComments_ = collectComments;
- current_ = begin_;
- lastValueEnd_ = 0;
- lastValue_ = 0;
- commentsBefore_ = "";
- errors_.clear();
- while (!nodes_.empty())
- nodes_.pop();
- nodes_.push(&root);
-
- stackDepth_ = 0;
- bool successful = readValue();
- Token token;
- skipCommentTokens(token);
- if (features_.failIfExtra_) {
- if ((features_.strictRoot_ || token.type_ != tokenError) && token.type_ != tokenEndOfStream) {
- addError("Extra non-whitespace after JSON value.", token);
- return false;
- }
- }
- if (collectComments_ && !commentsBefore_.empty())
- root.setComment(commentsBefore_, commentAfter);
- if (features_.strictRoot_) {
- if (!root.isArray() && !root.isObject()) {
- // Set error location to start of doc, ideally should be first token found
- // in doc
- token.type_ = tokenError;
- token.start_ = beginDoc;
- token.end_ = endDoc;
- addError(
- "A valid JSON document must be either an array or an object value.",
- token);
- return false;
- }
- }
- return successful;
-}
-
-bool OurReader::readValue() {
- if (stackDepth_ >= features_.stackLimit_) throwRuntimeError("Exceeded stackLimit in readValue().");
- ++stackDepth_;
- Token token;
- skipCommentTokens(token);
- bool successful = true;
-
- if (collectComments_ && !commentsBefore_.empty()) {
- currentValue().setComment(commentsBefore_, commentBefore);
- commentsBefore_ = "";
- }
-
- switch (token.type_) {
- case tokenObjectBegin:
- successful = readObject(token);
- currentValue().setOffsetLimit(current_ - begin_);
- break;
- case tokenArrayBegin:
- successful = readArray(token);
- currentValue().setOffsetLimit(current_ - begin_);
- break;
- case tokenNumber:
- successful = decodeNumber(token);
- break;
- case tokenString:
- successful = decodeString(token);
- break;
- case tokenTrue:
- {
- Value v(true);
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenFalse:
- {
- Value v(false);
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenNull:
- {
- Value v;
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenNaN:
- {
- Value v(std::numeric_limits<double>::quiet_NaN());
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenPosInf:
- {
- Value v(std::numeric_limits<double>::infinity());
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenNegInf:
- {
- Value v(-std::numeric_limits<double>::infinity());
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- }
- break;
- case tokenArraySeparator:
- case tokenObjectEnd:
- case tokenArrayEnd:
- if (features_.allowDroppedNullPlaceholders_) {
- // "Un-read" the current token and mark the current value as a null
- // token.
- current_--;
- Value v;
- currentValue().swapPayload(v);
- currentValue().setOffsetStart(current_ - begin_ - 1);
- currentValue().setOffsetLimit(current_ - begin_);
- break;
- } // else, fall through ...
- default:
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return addError("Syntax error: value, object or array expected.", token);
- }
-
- if (collectComments_) {
- lastValueEnd_ = current_;
- lastValue_ = &currentValue();
- }
-
- --stackDepth_;
- return successful;
-}
-
-void OurReader::skipCommentTokens(Token& token) {
- if (features_.allowComments_) {
- do {
- readToken(token);
- } while (token.type_ == tokenComment);
- } else {
- readToken(token);
- }
-}
-
-bool OurReader::readToken(Token& token) {
- skipSpaces();
- token.start_ = current_;
- Char c = getNextChar();
- bool ok = true;
- switch (c) {
- case '{':
- token.type_ = tokenObjectBegin;
- break;
- case '}':
- token.type_ = tokenObjectEnd;
- break;
- case '[':
- token.type_ = tokenArrayBegin;
- break;
- case ']':
- token.type_ = tokenArrayEnd;
- break;
- case '"':
- token.type_ = tokenString;
- ok = readString();
- break;
- case '\'':
- if (features_.allowSingleQuotes_) {
- token.type_ = tokenString;
- ok = readStringSingleQuote();
- break;
- } // else continue
- case '/':
- token.type_ = tokenComment;
- ok = readComment();
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- token.type_ = tokenNumber;
- readNumber(false);
- break;
- case '-':
- if (readNumber(true)) {
- token.type_ = tokenNumber;
- } else {
- token.type_ = tokenNegInf;
- ok = features_.allowSpecialFloats_ && match("nfinity", 7);
- }
- break;
- case 't':
- token.type_ = tokenTrue;
- ok = match("rue", 3);
- break;
- case 'f':
- token.type_ = tokenFalse;
- ok = match("alse", 4);
- break;
- case 'n':
- token.type_ = tokenNull;
- ok = match("ull", 3);
- break;
- case 'N':
- if (features_.allowSpecialFloats_) {
- token.type_ = tokenNaN;
- ok = match("aN", 2);
- } else {
- ok = false;
- }
- break;
- case 'I':
- if (features_.allowSpecialFloats_) {
- token.type_ = tokenPosInf;
- ok = match("nfinity", 7);
- } else {
- ok = false;
- }
- break;
- case ',':
- token.type_ = tokenArraySeparator;
- break;
- case ':':
- token.type_ = tokenMemberSeparator;
- break;
- case 0:
- token.type_ = tokenEndOfStream;
- break;
- default:
- ok = false;
- break;
- }
- if (!ok)
- token.type_ = tokenError;
- token.end_ = current_;
- return true;
-}
-
-void OurReader::skipSpaces() {
- while (current_ != end_) {
- Char c = *current_;
- if (c == ' ' || c == '\t' || c == '\r' || c == '\n')
- ++current_;
- else
- break;
- }
-}
-
-bool OurReader::match(Location pattern, int patternLength) {
- if (end_ - current_ < patternLength)
- return false;
- int index = patternLength;
- while (index--)
- if (current_[index] != pattern[index])
- return false;
- current_ += patternLength;
- return true;
-}
-
-bool OurReader::readComment() {
- Location commentBegin = current_ - 1;
- Char c = getNextChar();
- bool successful = false;
- if (c == '*')
- successful = readCStyleComment();
- else if (c == '/')
- successful = readCppStyleComment();
- if (!successful)
- return false;
-
- if (collectComments_) {
- CommentPlacement placement = commentBefore;
- if (lastValueEnd_ && !containsNewLine(lastValueEnd_, commentBegin)) {
- if (c != '*' || !containsNewLine(commentBegin, current_))
- placement = commentAfterOnSameLine;
- }
-
- addComment(commentBegin, current_, placement);
- }
- return true;
-}
-
-void
-OurReader::addComment(Location begin, Location end, CommentPlacement placement) {
- assert(collectComments_);
- const JSONCPP_STRING& normalized = normalizeEOL(begin, end);
- if (placement == commentAfterOnSameLine) {
- assert(lastValue_ != 0);
- lastValue_->setComment(normalized, placement);
- } else {
- commentsBefore_ += normalized;
- }
-}
-
-bool OurReader::readCStyleComment() {
- while ((current_ + 1) < end_) {
- Char c = getNextChar();
- if (c == '*' && *current_ == '/')
- break;
- }
- return getNextChar() == '/';
-}
-
-bool OurReader::readCppStyleComment() {
- while (current_ != end_) {
- Char c = getNextChar();
- if (c == '\n')
- break;
- if (c == '\r') {
- // Consume DOS EOL. It will be normalized in addComment.
- if (current_ != end_ && *current_ == '\n')
- getNextChar();
- // Break on Moc OS 9 EOL.
- break;
- }
- }
- return true;
-}
-
-bool OurReader::readNumber(bool checkInf) {
- const char *p = current_;
- if (checkInf && p != end_ && *p == 'I') {
- current_ = ++p;
- return false;
- }
- char c = '0'; // stopgap for already consumed character
- // integral part
- while (c >= '0' && c <= '9')
- c = (current_ = p) < end_ ? *p++ : '\0';
- // fractional part
- if (c == '.') {
- c = (current_ = p) < end_ ? *p++ : '\0';
- while (c >= '0' && c <= '9')
- c = (current_ = p) < end_ ? *p++ : '\0';
- }
- // exponential part
- if (c == 'e' || c == 'E') {
- c = (current_ = p) < end_ ? *p++ : '\0';
- if (c == '+' || c == '-')
- c = (current_ = p) < end_ ? *p++ : '\0';
- while (c >= '0' && c <= '9')
- c = (current_ = p) < end_ ? *p++ : '\0';
- }
- return true;
-}
-bool OurReader::readString() {
- Char c = 0;
- while (current_ != end_) {
- c = getNextChar();
- if (c == '\\')
- getNextChar();
- else if (c == '"')
- break;
- }
- return c == '"';
-}
-
-
-bool OurReader::readStringSingleQuote() {
- Char c = 0;
- while (current_ != end_) {
- c = getNextChar();
- if (c == '\\')
- getNextChar();
- else if (c == '\'')
- break;
- }
- return c == '\'';
-}
-
-bool OurReader::readObject(Token& tokenStart) {
- Token tokenName;
- JSONCPP_STRING name;
- Value init(objectValue);
- currentValue().swapPayload(init);
- currentValue().setOffsetStart(tokenStart.start_ - begin_);
- while (readToken(tokenName)) {
- bool initialTokenOk = true;
- while (tokenName.type_ == tokenComment && initialTokenOk)
- initialTokenOk = readToken(tokenName);
- if (!initialTokenOk)
- break;
- if (tokenName.type_ == tokenObjectEnd && name.empty()) // empty object
- return true;
- name = "";
- if (tokenName.type_ == tokenString) {
- if (!decodeString(tokenName, name))
- return recoverFromError(tokenObjectEnd);
- } else if (tokenName.type_ == tokenNumber && features_.allowNumericKeys_) {
- Value numberName;
- if (!decodeNumber(tokenName, numberName))
- return recoverFromError(tokenObjectEnd);
- name = numberName.asString();
- } else {
- break;
- }
-
- Token colon;
- if (!readToken(colon) || colon.type_ != tokenMemberSeparator) {
- return addErrorAndRecover(
- "Missing ':' after object member name", colon, tokenObjectEnd);
- }
- if (name.length() >= (1U<<30)) throwRuntimeError("keylength >= 2^30");
- if (features_.rejectDupKeys_ && currentValue().isMember(name)) {
- JSONCPP_STRING msg = "Duplicate key: '" + name + "'";
- return addErrorAndRecover(
- msg, tokenName, tokenObjectEnd);
- }
- Value& value = currentValue()[name];
- nodes_.push(&value);
- bool ok = readValue();
- nodes_.pop();
- if (!ok) // error already set
- return recoverFromError(tokenObjectEnd);
-
- Token comma;
- if (!readToken(comma) ||
- (comma.type_ != tokenObjectEnd && comma.type_ != tokenArraySeparator &&
- comma.type_ != tokenComment)) {
- return addErrorAndRecover(
- "Missing ',' or '}' in object declaration", comma, tokenObjectEnd);
- }
- bool finalizeTokenOk = true;
- while (comma.type_ == tokenComment && finalizeTokenOk)
- finalizeTokenOk = readToken(comma);
- if (comma.type_ == tokenObjectEnd)
- return true;
- }
- return addErrorAndRecover(
- "Missing '}' or object member name", tokenName, tokenObjectEnd);
-}
-
-bool OurReader::readArray(Token& tokenStart) {
- Value init(arrayValue);
- currentValue().swapPayload(init);
- currentValue().setOffsetStart(tokenStart.start_ - begin_);
- skipSpaces();
- if (current_ != end_ && *current_ == ']') // empty array
- {
- Token endArray;
- readToken(endArray);
- return true;
- }
- int index = 0;
- for (;;) {
- Value& value = currentValue()[index++];
- nodes_.push(&value);
- bool ok = readValue();
- nodes_.pop();
- if (!ok) // error already set
- return recoverFromError(tokenArrayEnd);
-
- Token token;
- // Accept Comment after last item in the array.
- ok = readToken(token);
- while (token.type_ == tokenComment && ok) {
- ok = readToken(token);
- }
- bool badTokenType =
- (token.type_ != tokenArraySeparator && token.type_ != tokenArrayEnd);
- if (!ok || badTokenType) {
- return addErrorAndRecover(
- "Missing ',' or ']' in array declaration", token, tokenArrayEnd);
- }
- if (token.type_ == tokenArrayEnd)
- break;
- }
- return true;
-}
-
-bool OurReader::decodeNumber(Token& token) {
- Value decoded;
- if (!decodeNumber(token, decoded))
- return false;
- currentValue().swapPayload(decoded);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return true;
-}
-
-bool OurReader::decodeNumber(Token& token, Value& decoded) {
- // Attempts to parse the number as an integer. If the number is
- // larger than the maximum supported value of an integer then
- // we decode the number as a double.
- Location current = token.start_;
- bool isNegative = *current == '-';
- if (isNegative)
- ++current;
- // TODO: Help the compiler do the div and mod at compile time or get rid of them.
- Value::LargestUInt maxIntegerValue =
- isNegative ? Value::LargestUInt(-Value::minLargestInt)
- : Value::maxLargestUInt;
- Value::LargestUInt threshold = maxIntegerValue / 10;
- Value::LargestUInt value = 0;
- while (current < token.end_) {
- Char c = *current++;
- if (c < '0' || c > '9')
- return decodeDouble(token, decoded);
- Value::UInt digit(static_cast<Value::UInt>(c - '0'));
- if (value >= threshold) {
- // We've hit or exceeded the max value divided by 10 (rounded down). If
- // a) we've only just touched the limit, b) this is the last digit, and
- // c) it's small enough to fit in that rounding delta, we're okay.
- // Otherwise treat this number as a double to avoid overflow.
- if (value > threshold || current != token.end_ ||
- digit > maxIntegerValue % 10) {
- return decodeDouble(token, decoded);
- }
- }
- value = value * 10 + digit;
- }
- if (isNegative)
- decoded = -Value::LargestInt(value);
- else if (value <= Value::LargestUInt(Value::maxInt))
- decoded = Value::LargestInt(value);
- else
- decoded = value;
- return true;
-}
-
-bool OurReader::decodeDouble(Token& token) {
- Value decoded;
- if (!decodeDouble(token, decoded))
- return false;
- currentValue().swapPayload(decoded);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return true;
-}
-
-bool OurReader::decodeDouble(Token& token, Value& decoded) {
- double value = 0;
- const int bufferSize = 32;
- int count;
- ptrdiff_t const length = token.end_ - token.start_;
-
- // Sanity check to avoid buffer overflow exploits.
- if (length < 0) {
- return addError("Unable to parse token length", token);
- }
- size_t const ulength = static_cast<size_t>(length);
-
- // Avoid using a string constant for the format control string given to
- // sscanf, as this can cause hard to debug crashes on OS X. See here for more
- // info:
- //
- // http://developer.apple.com/library/mac/#DOCUMENTATION/DeveloperTools/gcc-4.0.1/gcc/Incompatibilities.html
- char format[] = "%lf";
-
- if (length <= bufferSize) {
- Char buffer[bufferSize + 1];
- memcpy(buffer, token.start_, ulength);
- buffer[length] = 0;
- fixNumericLocaleInput(buffer, buffer + length);
- count = sscanf(buffer, format, &value);
- } else {
- JSONCPP_STRING buffer(token.start_, token.end_);
- count = sscanf(buffer.c_str(), format, &value);
- }
-
- if (count != 1)
- return addError("'" + JSONCPP_STRING(token.start_, token.end_) +
- "' is not a number.",
- token);
- decoded = value;
- return true;
-}
-
-bool OurReader::decodeString(Token& token) {
- JSONCPP_STRING decoded_string;
- if (!decodeString(token, decoded_string))
- return false;
- Value decoded(decoded_string);
- currentValue().swapPayload(decoded);
- currentValue().setOffsetStart(token.start_ - begin_);
- currentValue().setOffsetLimit(token.end_ - begin_);
- return true;
-}
-
-bool OurReader::decodeString(Token& token, JSONCPP_STRING& decoded) {
- decoded.reserve(static_cast<size_t>(token.end_ - token.start_ - 2));
- Location current = token.start_ + 1; // skip '"'
- Location end = token.end_ - 1; // do not include '"'
- while (current != end) {
- Char c = *current++;
- if (c == '"')
- break;
- else if (c == '\\') {
- if (current == end)
- return addError("Empty escape sequence in string", token, current);
- Char escape = *current++;
- switch (escape) {
- case '"':
- decoded += '"';
- break;
- case '/':
- decoded += '/';
- break;
- case '\\':
- decoded += '\\';
- break;
- case 'b':
- decoded += '\b';
- break;
- case 'f':
- decoded += '\f';
- break;
- case 'n':
- decoded += '\n';
- break;
- case 'r':
- decoded += '\r';
- break;
- case 't':
- decoded += '\t';
- break;
- case 'u': {
- unsigned int unicode;
- if (!decodeUnicodeCodePoint(token, current, end, unicode))
- return false;
- decoded += codePointToUTF8(unicode);
- } break;
- default:
- return addError("Bad escape sequence in string", token, current);
- }
- } else {
- decoded += c;
- }
- }
- return true;
-}
-
-bool OurReader::decodeUnicodeCodePoint(Token& token,
- Location& current,
- Location end,
- unsigned int& unicode) {
-
- if (!decodeUnicodeEscapeSequence(token, current, end, unicode))
- return false;
- if (unicode >= 0xD800 && unicode <= 0xDBFF) {
- // surrogate pairs
- if (end - current < 6)
- return addError(
- "additional six characters expected to parse unicode surrogate pair.",
- token,
- current);
- unsigned int surrogatePair;
- if (*(current++) == '\\' && *(current++) == 'u') {
- if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
- unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
- } else
- return false;
- } else
- return addError("expecting another \\u token to begin the second half of "
- "a unicode surrogate pair",
- token,
- current);
- }
- return true;
-}
-
-bool OurReader::decodeUnicodeEscapeSequence(Token& token,
- Location& current,
- Location end,
- unsigned int& ret_unicode) {
- if (end - current < 4)
- return addError(
- "Bad unicode escape sequence in string: four digits expected.",
- token,
- current);
- int unicode = 0;
- for (int index = 0; index < 4; ++index) {
- Char c = *current++;
- unicode *= 16;
- if (c >= '0' && c <= '9')
- unicode += c - '0';
- else if (c >= 'a' && c <= 'f')
- unicode += c - 'a' + 10;
- else if (c >= 'A' && c <= 'F')
- unicode += c - 'A' + 10;
- else
- return addError(
- "Bad unicode escape sequence in string: hexadecimal digit expected.",
- token,
- current);
- }
- ret_unicode = static_cast<unsigned int>(unicode);
- return true;
-}
-
-bool
-OurReader::addError(const JSONCPP_STRING& message, Token& token, Location extra) {
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = extra;
- errors_.push_back(info);
- return false;
-}
-
-bool OurReader::recoverFromError(TokenType skipUntilToken) {
- size_t errorCount = errors_.size();
- Token skip;
- for (;;) {
- if (!readToken(skip))
- errors_.resize(errorCount); // discard errors caused by recovery
- if (skip.type_ == skipUntilToken || skip.type_ == tokenEndOfStream)
- break;
- }
- errors_.resize(errorCount);
- return false;
-}
-
-bool OurReader::addErrorAndRecover(const JSONCPP_STRING& message,
- Token& token,
- TokenType skipUntilToken) {
- addError(message, token);
- return recoverFromError(skipUntilToken);
-}
-
-Value& OurReader::currentValue() { return *(nodes_.top()); }
-
-OurReader::Char OurReader::getNextChar() {
- if (current_ == end_)
- return 0;
- return *current_++;
-}
-
-void OurReader::getLocationLineAndColumn(Location location,
- int& line,
- int& column) const {
- Location current = begin_;
- Location lastLineStart = current;
- line = 0;
- while (current < location && current != end_) {
- Char c = *current++;
- if (c == '\r') {
- if (*current == '\n')
- ++current;
- lastLineStart = current;
- ++line;
- } else if (c == '\n') {
- lastLineStart = current;
- ++line;
- }
- }
- // column & line start at 1
- column = int(location - lastLineStart) + 1;
- ++line;
-}
-
-JSONCPP_STRING OurReader::getLocationLineAndColumn(Location location) const {
- int line, column;
- getLocationLineAndColumn(location, line, column);
- char buffer[18 + 16 + 16 + 1];
- snprintf(buffer, sizeof(buffer), "Line %d, Column %d", line, column);
- return buffer;
-}
-
-JSONCPP_STRING OurReader::getFormattedErrorMessages() const {
- JSONCPP_STRING formattedMessage;
- for (Errors::const_iterator itError = errors_.begin();
- itError != errors_.end();
- ++itError) {
- const ErrorInfo& error = *itError;
- formattedMessage +=
- "* " + getLocationLineAndColumn(error.token_.start_) + "\n";
- formattedMessage += " " + error.message_ + "\n";
- if (error.extra_)
- formattedMessage +=
- "See " + getLocationLineAndColumn(error.extra_) + " for detail.\n";
- }
- return formattedMessage;
-}
-
-std::vector<OurReader::StructuredError> OurReader::getStructuredErrors() const {
- std::vector<OurReader::StructuredError> allErrors;
- for (Errors::const_iterator itError = errors_.begin();
- itError != errors_.end();
- ++itError) {
- const ErrorInfo& error = *itError;
- OurReader::StructuredError structured;
- structured.offset_start = error.token_.start_ - begin_;
- structured.offset_limit = error.token_.end_ - begin_;
- structured.message = error.message_;
- allErrors.push_back(structured);
- }
- return allErrors;
-}
-
-bool OurReader::pushError(const Value& value, const JSONCPP_STRING& message) {
- ptrdiff_t length = end_ - begin_;
- if(value.getOffsetStart() > length
- || value.getOffsetLimit() > length)
- return false;
- Token token;
- token.type_ = tokenError;
- token.start_ = begin_ + value.getOffsetStart();
- token.end_ = end_ + value.getOffsetLimit();
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = 0;
- errors_.push_back(info);
- return true;
-}
-
-bool OurReader::pushError(const Value& value, const JSONCPP_STRING& message, const Value& extra) {
- ptrdiff_t length = end_ - begin_;
- if(value.getOffsetStart() > length
- || value.getOffsetLimit() > length
- || extra.getOffsetLimit() > length)
- return false;
- Token token;
- token.type_ = tokenError;
- token.start_ = begin_ + value.getOffsetStart();
- token.end_ = begin_ + value.getOffsetLimit();
- ErrorInfo info;
- info.token_ = token;
- info.message_ = message;
- info.extra_ = begin_ + extra.getOffsetStart();
- errors_.push_back(info);
- return true;
-}
-
-bool OurReader::good() const {
- return !errors_.size();
-}
-
-
-class OurCharReader : public CharReader {
- bool const collectComments_;
- OurReader reader_;
-public:
- OurCharReader(
- bool collectComments,
- OurFeatures const& features)
- : collectComments_(collectComments)
- , reader_(features)
- {}
- bool parse(
- char const* beginDoc, char const* endDoc,
- Value* root, JSONCPP_STRING* errs) JSONCPP_OVERRIDE {
- bool ok = reader_.parse(beginDoc, endDoc, *root, collectComments_);
- if (errs) {
- *errs = reader_.getFormattedErrorMessages();
- }
- return ok;
- }
-};
-
-CharReaderBuilder::CharReaderBuilder()
-{
- setDefaults(&settings_);
-}
-CharReaderBuilder::~CharReaderBuilder()
-{}
-CharReader* CharReaderBuilder::newCharReader() const
-{
- bool collectComments = settings_["collectComments"].asBool();
- OurFeatures features = OurFeatures::all();
- features.allowComments_ = settings_["allowComments"].asBool();
- features.strictRoot_ = settings_["strictRoot"].asBool();
- features.allowDroppedNullPlaceholders_ = settings_["allowDroppedNullPlaceholders"].asBool();
- features.allowNumericKeys_ = settings_["allowNumericKeys"].asBool();
- features.allowSingleQuotes_ = settings_["allowSingleQuotes"].asBool();
- features.stackLimit_ = settings_["stackLimit"].asInt();
- features.failIfExtra_ = settings_["failIfExtra"].asBool();
- features.rejectDupKeys_ = settings_["rejectDupKeys"].asBool();
- features.allowSpecialFloats_ = settings_["allowSpecialFloats"].asBool();
- return new OurCharReader(collectComments, features);
-}
-static void getValidReaderKeys(std::set<JSONCPP_STRING>* valid_keys)
-{
- valid_keys->clear();
- valid_keys->insert("collectComments");
- valid_keys->insert("allowComments");
- valid_keys->insert("strictRoot");
- valid_keys->insert("allowDroppedNullPlaceholders");
- valid_keys->insert("allowNumericKeys");
- valid_keys->insert("allowSingleQuotes");
- valid_keys->insert("stackLimit");
- valid_keys->insert("failIfExtra");
- valid_keys->insert("rejectDupKeys");
- valid_keys->insert("allowSpecialFloats");
-}
-bool CharReaderBuilder::validate(Json::Value* invalid) const
-{
- Json::Value my_invalid;
- if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
- Json::Value& inv = *invalid;
- std::set<JSONCPP_STRING> valid_keys;
- getValidReaderKeys(&valid_keys);
- Value::Members keys = settings_.getMemberNames();
- size_t n = keys.size();
- for (size_t i = 0; i < n; ++i) {
- JSONCPP_STRING const& key = keys[i];
- if (valid_keys.find(key) == valid_keys.end()) {
- inv[key] = settings_[key];
- }
- }
- return 0u == inv.size();
-}
-Value& CharReaderBuilder::operator[](JSONCPP_STRING key)
-{
- return settings_[key];
-}
-// static
-void CharReaderBuilder::strictMode(Json::Value* settings)
-{
-//! [CharReaderBuilderStrictMode]
- (*settings)["allowComments"] = false;
- (*settings)["strictRoot"] = true;
- (*settings)["allowDroppedNullPlaceholders"] = false;
- (*settings)["allowNumericKeys"] = false;
- (*settings)["allowSingleQuotes"] = false;
- (*settings)["stackLimit"] = 1000;
- (*settings)["failIfExtra"] = true;
- (*settings)["rejectDupKeys"] = true;
- (*settings)["allowSpecialFloats"] = false;
-//! [CharReaderBuilderStrictMode]
-}
-// static
-void CharReaderBuilder::setDefaults(Json::Value* settings)
-{
-//! [CharReaderBuilderDefaults]
- (*settings)["collectComments"] = true;
- (*settings)["allowComments"] = true;
- (*settings)["strictRoot"] = false;
- (*settings)["allowDroppedNullPlaceholders"] = false;
- (*settings)["allowNumericKeys"] = false;
- (*settings)["allowSingleQuotes"] = false;
- (*settings)["stackLimit"] = 1000;
- (*settings)["failIfExtra"] = false;
- (*settings)["rejectDupKeys"] = false;
- (*settings)["allowSpecialFloats"] = false;
-//! [CharReaderBuilderDefaults]
-}
-
-//////////////////////////////////
-// global functions
-
-bool parseFromStream(
- CharReader::Factory const& fact, JSONCPP_ISTREAM& sin,
- Value* root, JSONCPP_STRING* errs)
-{
- JSONCPP_OSTRINGSTREAM ssin;
- ssin << sin.rdbuf();
- JSONCPP_STRING doc = ssin.str();
- char const* begin = doc.data();
- char const* end = begin + doc.size();
- // Note that we do not actually need a null-terminator.
- CharReaderPtr const reader(fact.newCharReader());
- return reader->parse(begin, end, root, errs);
-}
-
-JSONCPP_ISTREAM& operator>>(JSONCPP_ISTREAM& sin, Value& root) {
- CharReaderBuilder b;
- JSONCPP_STRING errs;
- bool ok = parseFromStream(b, sin, &root, &errs);
- if (!ok) {
- fprintf(stderr,
- "Error from reader: %s",
- errs.c_str());
-
- throwRuntimeError(errs);
- }
- return sin;
-}
-
-} // namespace Json
diff --git a/toolkit/crashreporter/jsoncpp/src/lib_json/json_tool.h b/toolkit/crashreporter/jsoncpp/src/lib_json/json_tool.h
deleted file mode 100644
index 0e729e6374..0000000000
--- a/toolkit/crashreporter/jsoncpp/src/lib_json/json_tool.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED
-#define LIB_JSONCPP_JSON_TOOL_H_INCLUDED
-
-#ifndef NO_LOCALE_SUPPORT
-#include <clocale>
-#endif
-
-/* This header provides common string manipulation support, such as UTF-8,
- * portable conversion from/to string...
- *
- * It is an internal header that must not be exposed.
- */
-
-namespace Json {
-static char getDecimalPoint() {
-#ifdef NO_LOCALE_SUPPORT
- return '\0';
-#else
- struct lconv* lc = localeconv();
- return lc ? *(lc->decimal_point) : '\0';
-#endif
-}
-
-/// Converts a unicode code-point to UTF-8.
-static inline JSONCPP_STRING codePointToUTF8(unsigned int cp) {
- JSONCPP_STRING result;
-
- // based on description from http://en.wikipedia.org/wiki/UTF-8
-
- if (cp <= 0x7f) {
- result.resize(1);
- result[0] = static_cast<char>(cp);
- } else if (cp <= 0x7FF) {
- result.resize(2);
- result[1] = static_cast<char>(0x80 | (0x3f & cp));
- result[0] = static_cast<char>(0xC0 | (0x1f & (cp >> 6)));
- } else if (cp <= 0xFFFF) {
- result.resize(3);
- result[2] = static_cast<char>(0x80 | (0x3f & cp));
- result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
- result[0] = static_cast<char>(0xE0 | (0xf & (cp >> 12)));
- } else if (cp <= 0x10FFFF) {
- result.resize(4);
- result[3] = static_cast<char>(0x80 | (0x3f & cp));
- result[2] = static_cast<char>(0x80 | (0x3f & (cp >> 6)));
- result[1] = static_cast<char>(0x80 | (0x3f & (cp >> 12)));
- result[0] = static_cast<char>(0xF0 | (0x7 & (cp >> 18)));
- }
-
- return result;
-}
-
-/// Returns true if ch is a control character (in range [1,31]).
-static inline bool isControlCharacter(char ch) { return ch > 0 && ch <= 0x1F; }
-
-enum {
- /// Constant that specify the size of the buffer that must be passed to
- /// uintToString.
- uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1
-};
-
-// Defines a char buffer for use with uintToString().
-typedef char UIntToStringBuffer[uintToStringBufferSize];
-
-/** Converts an unsigned integer to string.
- * @param value Unsigned interger to convert to string
- * @param current Input/Output string buffer.
- * Must have at least uintToStringBufferSize chars free.
- */
-static inline void uintToString(LargestUInt value, char*& current) {
- *--current = 0;
- do {
- *--current = static_cast<char>(value % 10U + static_cast<unsigned>('0'));
- value /= 10;
- } while (value != 0);
-}
-
-/** Change ',' to '.' everywhere in buffer.
- *
- * We had a sophisticated way, but it did not work in WinCE.
- * @see https://github.com/open-source-parsers/jsoncpp/pull/9
- */
-static inline void fixNumericLocale(char* begin, char* end) {
- while (begin < end) {
- if (*begin == ',') {
- *begin = '.';
- }
- ++begin;
- }
-}
-
-static inline void fixNumericLocaleInput(char* begin, char* end) {
- char decimalPoint = getDecimalPoint();
- if (decimalPoint != '\0' && decimalPoint != '.') {
- while (begin < end) {
- if (*begin == '.') {
- *begin = decimalPoint;
- }
- ++begin;
- }
- }
-}
-
-} // namespace Json {
-
-#endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED
diff --git a/toolkit/crashreporter/jsoncpp/src/lib_json/json_value.cpp b/toolkit/crashreporter/jsoncpp/src/lib_json/json_value.cpp
deleted file mode 100644
index 88c630fdd2..0000000000
--- a/toolkit/crashreporter/jsoncpp/src/lib_json/json_value.cpp
+++ /dev/null
@@ -1,1604 +0,0 @@
-// Copyright 2011 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include <json/assertions.h>
-#include <json/value.h>
-#include <json/writer.h>
-#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <math.h>
-#include <sstream>
-#include <utility>
-#include <cstring>
-#include <cassert>
-#ifdef JSON_USE_CPPTL
-#include <cpptl/conststring.h>
-#endif
-#include <cstddef> // size_t
-#include <algorithm> // min()
-
-#define JSON_ASSERT_UNREACHABLE assert(false)
-
-namespace Json {
-
-// This is a walkaround to avoid the static initialization of Value::null.
-// kNull must be word-aligned to avoid crashing on ARM. We use an alignment of
-// 8 (instead of 4) as a bit of future-proofing.
-#if defined(__ARMEL__)
-#define ALIGNAS(byte_alignment) __attribute__((aligned(byte_alignment)))
-#else
-#define ALIGNAS(byte_alignment)
-#endif
-//static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = { 0 };
-//const unsigned char& kNullRef = kNull[0];
-//const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
-//const Value& Value::nullRef = null;
-
-// static
-Value const& Value::nullSingleton()
-{
- static Value const nullStatic;
- return nullStatic;
-}
-
-// for backwards compatibility, we'll leave these global references around, but DO NOT
-// use them in JSONCPP library code any more!
-Value const& Value::null = Value::nullSingleton();
-Value const& Value::nullRef = Value::nullSingleton();
-
-const Int Value::minInt = Int(~(UInt(-1) / 2));
-const Int Value::maxInt = Int(UInt(-1) / 2);
-const UInt Value::maxUInt = UInt(-1);
-#if defined(JSON_HAS_INT64)
-const Int64 Value::minInt64 = Int64(~(UInt64(-1) / 2));
-const Int64 Value::maxInt64 = Int64(UInt64(-1) / 2);
-const UInt64 Value::maxUInt64 = UInt64(-1);
-// The constant is hard-coded because some compiler have trouble
-// converting Value::maxUInt64 to a double correctly (AIX/xlC).
-// Assumes that UInt64 is a 64 bits integer.
-static const double maxUInt64AsDouble = 18446744073709551615.0;
-#endif // defined(JSON_HAS_INT64)
-const LargestInt Value::minLargestInt = LargestInt(~(LargestUInt(-1) / 2));
-const LargestInt Value::maxLargestInt = LargestInt(LargestUInt(-1) / 2);
-const LargestUInt Value::maxLargestUInt = LargestUInt(-1);
-
-#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
-template <typename T, typename U>
-static inline bool InRange(double d, T min, U max) {
- // The casts can lose precision, but we are looking only for
- // an approximate range. Might fail on edge cases though. ~cdunn
- //return d >= static_cast<double>(min) && d <= static_cast<double>(max);
- return d >= min && d <= max;
-}
-#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
-static inline double integerToDouble(Json::UInt64 value) {
- return static_cast<double>(Int64(value / 2)) * 2.0 + static_cast<double>(Int64(value & 1));
-}
-
-template <typename T> static inline double integerToDouble(T value) {
- return static_cast<double>(value);
-}
-
-template <typename T, typename U>
-static inline bool InRange(double d, T min, U max) {
- return d >= integerToDouble(min) && d <= integerToDouble(max);
-}
-#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
-
-/** Duplicates the specified string value.
- * @param value Pointer to the string to duplicate. Must be zero-terminated if
- * length is "unknown".
- * @param length Length of the value. if equals to unknown, then it will be
- * computed using strlen(value).
- * @return Pointer on the duplicate instance of string.
- */
-static inline char* duplicateStringValue(const char* value,
- size_t length)
-{
- // Avoid an integer overflow in the call to malloc below by limiting length
- // to a sane value.
- if (length >= static_cast<size_t>(Value::maxInt))
- length = Value::maxInt - 1;
-
- char* newString = static_cast<char*>(malloc(length + 1));
- if (newString == NULL) {
- throwRuntimeError(
- "in Json::Value::duplicateStringValue(): "
- "Failed to allocate string value buffer");
- }
- memcpy(newString, value, length);
- newString[length] = 0;
- return newString;
-}
-
-/* Record the length as a prefix.
- */
-static inline char* duplicateAndPrefixStringValue(
- const char* value,
- unsigned int length)
-{
- // Avoid an integer overflow in the call to malloc below by limiting length
- // to a sane value.
- JSON_ASSERT_MESSAGE(length <= static_cast<unsigned>(Value::maxInt) - sizeof(unsigned) - 1U,
- "in Json::Value::duplicateAndPrefixStringValue(): "
- "length too big for prefixing");
- unsigned actualLength = length + static_cast<unsigned>(sizeof(unsigned)) + 1U;
- char* newString = static_cast<char*>(malloc(actualLength));
- if (newString == 0) {
- throwRuntimeError(
- "in Json::Value::duplicateAndPrefixStringValue(): "
- "Failed to allocate string value buffer");
- }
- *reinterpret_cast<unsigned*>(newString) = length;
- memcpy(newString + sizeof(unsigned), value, length);
- newString[actualLength - 1U] = 0; // to avoid buffer over-run accidents by users later
- return newString;
-}
-inline static void decodePrefixedString(
- bool isPrefixed, char const* prefixed,
- unsigned* length, char const** value)
-{
- if (!isPrefixed) {
- *length = static_cast<unsigned>(strlen(prefixed));
- *value = prefixed;
- } else {
- *length = *reinterpret_cast<unsigned const*>(prefixed);
- *value = prefixed + sizeof(unsigned);
- }
-}
-/** Free the string duplicated by duplicateStringValue()/duplicateAndPrefixStringValue().
- */
-#if JSONCPP_USING_SECURE_MEMORY
-static inline void releasePrefixedStringValue(char* value) {
- unsigned length = 0;
- char const* valueDecoded;
- decodePrefixedString(true, value, &length, &valueDecoded);
- size_t const size = sizeof(unsigned) + length + 1U;
- memset(value, 0, size);
- free(value);
-}
-static inline void releaseStringValue(char* value, unsigned length) {
- // length==0 => we allocated the strings memory
- size_t size = (length==0) ? strlen(value) : length;
- memset(value, 0, size);
- free(value);
-}
-#else // !JSONCPP_USING_SECURE_MEMORY
-static inline void releasePrefixedStringValue(char* value) {
- free(value);
-}
-static inline void releaseStringValue(char* value, unsigned) {
- free(value);
-}
-#endif // JSONCPP_USING_SECURE_MEMORY
-
-} // namespace Json
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// ValueInternals...
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-#if !defined(JSON_IS_AMALGAMATION)
-
-#include "json_valueiterator.inl"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-
-namespace Json {
-
-Exception::Exception(JSONCPP_STRING const& msg)
- : msg_(msg)
-{}
-Exception::~Exception() throw()
-{}
-char const* Exception::what() const throw()
-{
- return msg_.c_str();
-}
-RuntimeError::RuntimeError(JSONCPP_STRING const& msg)
- : Exception(msg)
-{}
-LogicError::LogicError(JSONCPP_STRING const& msg)
- : Exception(msg)
-{}
-JSONCPP_NORETURN void throwRuntimeError(JSONCPP_STRING const& msg)
-{
- throw RuntimeError(msg);
-}
-JSONCPP_NORETURN void throwLogicError(JSONCPP_STRING const& msg)
-{
- throw LogicError(msg);
-}
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::CommentInfo
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-Value::CommentInfo::CommentInfo() : comment_(0)
-{}
-
-Value::CommentInfo::~CommentInfo() {
- if (comment_)
- releaseStringValue(comment_, 0u);
-}
-
-void Value::CommentInfo::setComment(const char* text, size_t len) {
- if (comment_) {
- releaseStringValue(comment_, 0u);
- comment_ = 0;
- }
- JSON_ASSERT(text != 0);
- JSON_ASSERT_MESSAGE(
- text[0] == '\0' || text[0] == '/',
- "in Json::Value::setComment(): Comments must start with /");
- // It seems that /**/ style comments are acceptable as well.
- comment_ = duplicateStringValue(text, len);
-}
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::CZString
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-// Notes: policy_ indicates if the string was allocated when
-// a string is stored.
-
-Value::CZString::CZString(ArrayIndex aindex) : cstr_(0), index_(aindex) {}
-
-Value::CZString::CZString(char const* str, unsigned ulength, DuplicationPolicy allocate)
- : cstr_(str) {
- // allocate != duplicate
- storage_.policy_ = allocate & 0x3;
- storage_.length_ = ulength & 0x3FFFFFFF;
-}
-
-Value::CZString::CZString(const CZString& other) {
- cstr_ = (other.storage_.policy_ != noDuplication && other.cstr_ != 0
- ? duplicateStringValue(other.cstr_, other.storage_.length_)
- : other.cstr_);
- storage_.policy_ = static_cast<unsigned>(other.cstr_
- ? (static_cast<DuplicationPolicy>(other.storage_.policy_) == noDuplication
- ? noDuplication : duplicate)
- : static_cast<DuplicationPolicy>(other.storage_.policy_)) & 3U;
- storage_.length_ = other.storage_.length_;
-}
-
-#if JSON_HAS_RVALUE_REFERENCES
-Value::CZString::CZString(CZString&& other)
- : cstr_(other.cstr_), index_(other.index_) {
- other.cstr_ = nullptr;
-}
-#endif
-
-Value::CZString::~CZString() {
- if (cstr_ && storage_.policy_ == duplicate) {
- releaseStringValue(const_cast<char*>(cstr_), storage_.length_ + 1u); //+1 for null terminating character for sake of completeness but not actually necessary
- }
-}
-
-void Value::CZString::swap(CZString& other) {
- std::swap(cstr_, other.cstr_);
- std::swap(index_, other.index_);
-}
-
-Value::CZString& Value::CZString::operator=(CZString other) {
- swap(other);
- return *this;
-}
-
-bool Value::CZString::operator<(const CZString& other) const {
- if (!cstr_) return index_ < other.index_;
- //return strcmp(cstr_, other.cstr_) < 0;
- // Assume both are strings.
- unsigned this_len = this->storage_.length_;
- unsigned other_len = other.storage_.length_;
- unsigned min_len = std::min(this_len, other_len);
- JSON_ASSERT(this->cstr_ && other.cstr_);
- int comp = memcmp(this->cstr_, other.cstr_, min_len);
- if (comp < 0) return true;
- if (comp > 0) return false;
- return (this_len < other_len);
-}
-
-bool Value::CZString::operator==(const CZString& other) const {
- if (!cstr_) return index_ == other.index_;
- //return strcmp(cstr_, other.cstr_) == 0;
- // Assume both are strings.
- unsigned this_len = this->storage_.length_;
- unsigned other_len = other.storage_.length_;
- if (this_len != other_len) return false;
- JSON_ASSERT(this->cstr_ && other.cstr_);
- int comp = memcmp(this->cstr_, other.cstr_, this_len);
- return comp == 0;
-}
-
-ArrayIndex Value::CZString::index() const { return index_; }
-
-//const char* Value::CZString::c_str() const { return cstr_; }
-const char* Value::CZString::data() const { return cstr_; }
-unsigned Value::CZString::length() const { return storage_.length_; }
-bool Value::CZString::isStaticString() const { return storage_.policy_ == noDuplication; }
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class Value::Value
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-/*! \internal Default constructor initialization must be equivalent to:
- * memset( this, 0, sizeof(Value) )
- * This optimization is used in ValueInternalMap fast allocator.
- */
-Value::Value(ValueType vtype) {
- static char const empty[] = "";
- initBasic(vtype);
- switch (vtype) {
- case nullValue:
- break;
- case intValue:
- case uintValue:
- value_.int_ = 0;
- break;
- case realValue:
- value_.real_ = 0.0;
- break;
- case stringValue:
- // allocated_ == false, so this is safe.
- value_.string_ = const_cast<char*>(static_cast<char const*>(empty));
- break;
- case arrayValue:
- case objectValue:
- value_.map_ = new ObjectValues();
- break;
- case booleanValue:
- value_.bool_ = false;
- break;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
-}
-
-Value::Value(Int value) {
- initBasic(intValue);
- value_.int_ = value;
-}
-
-Value::Value(UInt value) {
- initBasic(uintValue);
- value_.uint_ = value;
-}
-#if defined(JSON_HAS_INT64)
-Value::Value(Int64 value) {
- initBasic(intValue);
- value_.int_ = value;
-}
-Value::Value(UInt64 value) {
- initBasic(uintValue);
- value_.uint_ = value;
-}
-#endif // defined(JSON_HAS_INT64)
-
-Value::Value(double value) {
- initBasic(realValue);
- value_.real_ = value;
-}
-
-Value::Value(const char* value) {
- initBasic(stringValue, true);
- value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(strlen(value)));
-}
-
-Value::Value(const char* beginValue, const char* endValue) {
- initBasic(stringValue, true);
- value_.string_ =
- duplicateAndPrefixStringValue(beginValue, static_cast<unsigned>(endValue - beginValue));
-}
-
-Value::Value(const JSONCPP_STRING& value) {
- initBasic(stringValue, true);
- value_.string_ =
- duplicateAndPrefixStringValue(value.data(), static_cast<unsigned>(value.length()));
-}
-
-Value::Value(const StaticString& value) {
- initBasic(stringValue);
- value_.string_ = const_cast<char*>(value.c_str());
-}
-
-#ifdef JSON_USE_CPPTL
-Value::Value(const CppTL::ConstString& value) {
- initBasic(stringValue, true);
- value_.string_ = duplicateAndPrefixStringValue(value, static_cast<unsigned>(value.length()));
-}
-#endif
-
-Value::Value(bool value) {
- initBasic(booleanValue);
- value_.bool_ = value;
-}
-
-Value::Value(Value const& other)
- : type_(other.type_), allocated_(false)
- ,
- comments_(0), start_(other.start_), limit_(other.limit_)
-{
- switch (type_) {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- value_ = other.value_;
- break;
- case stringValue:
- if (other.value_.string_ && other.allocated_) {
- unsigned len;
- char const* str;
- decodePrefixedString(other.allocated_, other.value_.string_,
- &len, &str);
- value_.string_ = duplicateAndPrefixStringValue(str, len);
- allocated_ = true;
- } else {
- value_.string_ = other.value_.string_;
- allocated_ = false;
- }
- break;
- case arrayValue:
- case objectValue:
- value_.map_ = new ObjectValues(*other.value_.map_);
- break;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- if (other.comments_) {
- comments_ = new CommentInfo[numberOfCommentPlacement];
- for (int comment = 0; comment < numberOfCommentPlacement; ++comment) {
- const CommentInfo& otherComment = other.comments_[comment];
- if (otherComment.comment_)
- comments_[comment].setComment(
- otherComment.comment_, strlen(otherComment.comment_));
- }
- }
-}
-
-#if JSON_HAS_RVALUE_REFERENCES
-// Move constructor
-Value::Value(Value&& other) {
- initBasic(nullValue);
- swap(other);
-}
-#endif
-
-Value::~Value() {
- switch (type_) {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- break;
- case stringValue:
- if (allocated_)
- releasePrefixedStringValue(value_.string_);
- break;
- case arrayValue:
- case objectValue:
- delete value_.map_;
- break;
- default:
- JSON_ASSERT_UNREACHABLE;
- }
-
- delete[] comments_;
-
- value_.uint_ = 0;
-}
-
-Value& Value::operator=(Value other) {
- swap(other);
- return *this;
-}
-
-void Value::swapPayload(Value& other) {
- ValueType temp = type_;
- type_ = other.type_;
- other.type_ = temp;
- std::swap(value_, other.value_);
- int temp2 = allocated_;
- allocated_ = other.allocated_;
- other.allocated_ = temp2 & 0x1;
-}
-
-void Value::swap(Value& other) {
- swapPayload(other);
- std::swap(comments_, other.comments_);
- std::swap(start_, other.start_);
- std::swap(limit_, other.limit_);
-}
-
-ValueType Value::type() const { return type_; }
-
-int Value::compare(const Value& other) const {
- if (*this < other)
- return -1;
- if (*this > other)
- return 1;
- return 0;
-}
-
-bool Value::operator<(const Value& other) const {
- int typeDelta = type_ - other.type_;
- if (typeDelta)
- return typeDelta < 0 ? true : false;
- switch (type_) {
- case nullValue:
- return false;
- case intValue:
- return value_.int_ < other.value_.int_;
- case uintValue:
- return value_.uint_ < other.value_.uint_;
- case realValue:
- return value_.real_ < other.value_.real_;
- case booleanValue:
- return value_.bool_ < other.value_.bool_;
- case stringValue:
- {
- if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
- if (other.value_.string_) return true;
- else return false;
- }
- unsigned this_len;
- unsigned other_len;
- char const* this_str;
- char const* other_str;
- decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
- decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
- unsigned min_len = std::min(this_len, other_len);
- JSON_ASSERT(this_str && other_str);
- int comp = memcmp(this_str, other_str, min_len);
- if (comp < 0) return true;
- if (comp > 0) return false;
- return (this_len < other_len);
- }
- case arrayValue:
- case objectValue: {
- int delta = int(value_.map_->size() - other.value_.map_->size());
- if (delta)
- return delta < 0;
- return (*value_.map_) < (*other.value_.map_);
- }
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return false; // unreachable
-}
-
-bool Value::operator<=(const Value& other) const { return !(other < *this); }
-
-bool Value::operator>=(const Value& other) const { return !(*this < other); }
-
-bool Value::operator>(const Value& other) const { return other < *this; }
-
-bool Value::operator==(const Value& other) const {
- // if ( type_ != other.type_ )
- // GCC 2.95.3 says:
- // attempt to take address of bit-field structure member `Json::Value::type_'
- // Beats me, but a temp solves the problem.
- int temp = other.type_;
- if (type_ != temp)
- return false;
- switch (type_) {
- case nullValue:
- return true;
- case intValue:
- return value_.int_ == other.value_.int_;
- case uintValue:
- return value_.uint_ == other.value_.uint_;
- case realValue:
- return value_.real_ == other.value_.real_;
- case booleanValue:
- return value_.bool_ == other.value_.bool_;
- case stringValue:
- {
- if ((value_.string_ == 0) || (other.value_.string_ == 0)) {
- return (value_.string_ == other.value_.string_);
- }
- unsigned this_len;
- unsigned other_len;
- char const* this_str;
- char const* other_str;
- decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
- decodePrefixedString(other.allocated_, other.value_.string_, &other_len, &other_str);
- if (this_len != other_len) return false;
- JSON_ASSERT(this_str && other_str);
- int comp = memcmp(this_str, other_str, this_len);
- return comp == 0;
- }
- case arrayValue:
- case objectValue:
- return value_.map_->size() == other.value_.map_->size() &&
- (*value_.map_) == (*other.value_.map_);
- default:
- JSON_ASSERT_UNREACHABLE;
- }
- return false; // unreachable
-}
-
-bool Value::operator!=(const Value& other) const { return !(*this == other); }
-
-const char* Value::asCString() const {
- JSON_ASSERT_MESSAGE(type_ == stringValue,
- "in Json::Value::asCString(): requires stringValue");
- if (value_.string_ == 0) return 0;
- unsigned this_len;
- char const* this_str;
- decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
- return this_str;
-}
-
-#if JSONCPP_USING_SECURE_MEMORY
-unsigned Value::getCStringLength() const {
- JSON_ASSERT_MESSAGE(type_ == stringValue,
- "in Json::Value::asCString(): requires stringValue");
- if (value_.string_ == 0) return 0;
- unsigned this_len;
- char const* this_str;
- decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
- return this_len;
-}
-#endif
-
-bool Value::getString(char const** str, char const** cend) const {
- if (type_ != stringValue) return false;
- if (value_.string_ == 0) return false;
- unsigned length;
- decodePrefixedString(this->allocated_, this->value_.string_, &length, str);
- *cend = *str + length;
- return true;
-}
-
-JSONCPP_STRING Value::asString() const {
- switch (type_) {
- case nullValue:
- return "";
- case stringValue:
- {
- if (value_.string_ == 0) return "";
- unsigned this_len;
- char const* this_str;
- decodePrefixedString(this->allocated_, this->value_.string_, &this_len, &this_str);
- return JSONCPP_STRING(this_str, this_len);
- }
- case booleanValue:
- return value_.bool_ ? "true" : "false";
- case intValue:
- return valueToString(value_.int_);
- case uintValue:
- return valueToString(value_.uint_);
- case realValue:
- return valueToString(value_.real_);
- default:
- JSON_FAIL_MESSAGE("Type is not convertible to string");
- }
-}
-
-#ifdef JSON_USE_CPPTL
-CppTL::ConstString Value::asConstString() const {
- unsigned len;
- char const* str;
- decodePrefixedString(allocated_, value_.string_,
- &len, &str);
- return CppTL::ConstString(str, len);
-}
-#endif
-
-Value::Int Value::asInt() const {
- switch (type_) {
- case intValue:
- JSON_ASSERT_MESSAGE(isInt(), "LargestInt out of Int range");
- return Int(value_.int_);
- case uintValue:
- JSON_ASSERT_MESSAGE(isInt(), "LargestUInt out of Int range");
- return Int(value_.uint_);
- case realValue:
- JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt, maxInt),
- "double out of Int range");
- return Int(value_.real_);
- case nullValue:
- return 0;
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to Int.");
-}
-
-Value::UInt Value::asUInt() const {
- switch (type_) {
- case intValue:
- JSON_ASSERT_MESSAGE(isUInt(), "LargestInt out of UInt range");
- return UInt(value_.int_);
- case uintValue:
- JSON_ASSERT_MESSAGE(isUInt(), "LargestUInt out of UInt range");
- return UInt(value_.uint_);
- case realValue:
- JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt),
- "double out of UInt range");
- return UInt(value_.real_);
- case nullValue:
- return 0;
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to UInt.");
-}
-
-#if defined(JSON_HAS_INT64)
-
-Value::Int64 Value::asInt64() const {
- switch (type_) {
- case intValue:
- return Int64(value_.int_);
- case uintValue:
- JSON_ASSERT_MESSAGE(isInt64(), "LargestUInt out of Int64 range");
- return Int64(value_.uint_);
- case realValue:
- JSON_ASSERT_MESSAGE(InRange(value_.real_, minInt64, maxInt64),
- "double out of Int64 range");
- return Int64(value_.real_);
- case nullValue:
- return 0;
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to Int64.");
-}
-
-Value::UInt64 Value::asUInt64() const {
- switch (type_) {
- case intValue:
- JSON_ASSERT_MESSAGE(isUInt64(), "LargestInt out of UInt64 range");
- return UInt64(value_.int_);
- case uintValue:
- return UInt64(value_.uint_);
- case realValue:
- JSON_ASSERT_MESSAGE(InRange(value_.real_, 0, maxUInt64),
- "double out of UInt64 range");
- return UInt64(value_.real_);
- case nullValue:
- return 0;
- case booleanValue:
- return value_.bool_ ? 1 : 0;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to UInt64.");
-}
-#endif // if defined(JSON_HAS_INT64)
-
-LargestInt Value::asLargestInt() const {
-#if defined(JSON_NO_INT64)
- return asInt();
-#else
- return asInt64();
-#endif
-}
-
-LargestUInt Value::asLargestUInt() const {
-#if defined(JSON_NO_INT64)
- return asUInt();
-#else
- return asUInt64();
-#endif
-}
-
-double Value::asDouble() const {
- switch (type_) {
- case intValue:
- return static_cast<double>(value_.int_);
- case uintValue:
-#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return static_cast<double>(value_.uint_);
-#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return integerToDouble(value_.uint_);
-#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- case realValue:
- return value_.real_;
- case nullValue:
- return 0.0;
- case booleanValue:
- return value_.bool_ ? 1.0 : 0.0;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to double.");
-}
-
-float Value::asFloat() const {
- switch (type_) {
- case intValue:
- return static_cast<float>(value_.int_);
- case uintValue:
-#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- return static_cast<float>(value_.uint_);
-#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- // This can fail (silently?) if the value is bigger than MAX_FLOAT.
- return static_cast<float>(integerToDouble(value_.uint_));
-#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
- case realValue:
- return static_cast<float>(value_.real_);
- case nullValue:
- return 0.0;
- case booleanValue:
- return value_.bool_ ? 1.0f : 0.0f;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to float.");
-}
-
-bool Value::asBool() const {
- switch (type_) {
- case booleanValue:
- return value_.bool_;
- case nullValue:
- return false;
- case intValue:
- return value_.int_ ? true : false;
- case uintValue:
- return value_.uint_ ? true : false;
- case realValue:
- // This is kind of strange. Not recommended.
- return (value_.real_ != 0.0) ? true : false;
- default:
- break;
- }
- JSON_FAIL_MESSAGE("Value is not convertible to bool.");
-}
-
-bool Value::isConvertibleTo(ValueType other) const {
- switch (other) {
- case nullValue:
- return (isNumeric() && asDouble() == 0.0) ||
- (type_ == booleanValue && value_.bool_ == false) ||
- (type_ == stringValue && asString() == "") ||
- (type_ == arrayValue && value_.map_->size() == 0) ||
- (type_ == objectValue && value_.map_->size() == 0) ||
- type_ == nullValue;
- case intValue:
- return isInt() ||
- (type_ == realValue && InRange(value_.real_, minInt, maxInt)) ||
- type_ == booleanValue || type_ == nullValue;
- case uintValue:
- return isUInt() ||
- (type_ == realValue && InRange(value_.real_, 0, maxUInt)) ||
- type_ == booleanValue || type_ == nullValue;
- case realValue:
- return isNumeric() || type_ == booleanValue || type_ == nullValue;
- case booleanValue:
- return isNumeric() || type_ == booleanValue || type_ == nullValue;
- case stringValue:
- return isNumeric() || type_ == booleanValue || type_ == stringValue ||
- type_ == nullValue;
- case arrayValue:
- return type_ == arrayValue || type_ == nullValue;
- case objectValue:
- return type_ == objectValue || type_ == nullValue;
- }
- JSON_ASSERT_UNREACHABLE;
- return false;
-}
-
-/// Number of values in array or object
-ArrayIndex Value::size() const {
- switch (type_) {
- case nullValue:
- case intValue:
- case uintValue:
- case realValue:
- case booleanValue:
- case stringValue:
- return 0;
- case arrayValue: // size of the array is highest index + 1
- if (!value_.map_->empty()) {
- ObjectValues::const_iterator itLast = value_.map_->end();
- --itLast;
- return (*itLast).first.index() + 1;
- }
- return 0;
- case objectValue:
- return ArrayIndex(value_.map_->size());
- }
- JSON_ASSERT_UNREACHABLE;
- return 0; // unreachable;
-}
-
-bool Value::empty() const {
- if (isNull() || isArray() || isObject())
- return size() == 0u;
- else
- return false;
-}
-
-bool Value::operator!() const { return isNull(); }
-
-void Value::clear() {
- JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue ||
- type_ == objectValue,
- "in Json::Value::clear(): requires complex value");
- start_ = 0;
- limit_ = 0;
- switch (type_) {
- case arrayValue:
- case objectValue:
- value_.map_->clear();
- break;
- default:
- break;
- }
-}
-
-void Value::resize(ArrayIndex newSize) {
- JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue,
- "in Json::Value::resize(): requires arrayValue");
- if (type_ == nullValue)
- *this = Value(arrayValue);
- ArrayIndex oldSize = size();
- if (newSize == 0)
- clear();
- else if (newSize > oldSize)
- (*this)[newSize - 1];
- else {
- for (ArrayIndex index = newSize; index < oldSize; ++index) {
- value_.map_->erase(index);
- }
- JSON_ASSERT(size() == newSize);
- }
-}
-
-Value& Value::operator[](ArrayIndex index) {
- JSON_ASSERT_MESSAGE(
- type_ == nullValue || type_ == arrayValue,
- "in Json::Value::operator[](ArrayIndex): requires arrayValue");
- if (type_ == nullValue)
- *this = Value(arrayValue);
- CZString key(index);
- ObjectValues::iterator it = value_.map_->lower_bound(key);
- if (it != value_.map_->end() && (*it).first == key)
- return (*it).second;
-
- ObjectValues::value_type defaultValue(key, nullSingleton());
- it = value_.map_->insert(it, defaultValue);
- return (*it).second;
-}
-
-Value& Value::operator[](int index) {
- JSON_ASSERT_MESSAGE(
- index >= 0,
- "in Json::Value::operator[](int index): index cannot be negative");
- return (*this)[ArrayIndex(index)];
-}
-
-const Value& Value::operator[](ArrayIndex index) const {
- JSON_ASSERT_MESSAGE(
- type_ == nullValue || type_ == arrayValue,
- "in Json::Value::operator[](ArrayIndex)const: requires arrayValue");
- if (type_ == nullValue)
- return nullSingleton();
- CZString key(index);
- ObjectValues::const_iterator it = value_.map_->find(key);
- if (it == value_.map_->end())
- return nullSingleton();
- return (*it).second;
-}
-
-const Value& Value::operator[](int index) const {
- JSON_ASSERT_MESSAGE(
- index >= 0,
- "in Json::Value::operator[](int index) const: index cannot be negative");
- return (*this)[ArrayIndex(index)];
-}
-
-void Value::initBasic(ValueType vtype, bool allocated) {
- type_ = vtype;
- allocated_ = allocated;
- comments_ = 0;
- start_ = 0;
- limit_ = 0;
-}
-
-// Access an object value by name, create a null member if it does not exist.
-// @pre Type of '*this' is object or null.
-// @param key is null-terminated.
-Value& Value::resolveReference(const char* key) {
- JSON_ASSERT_MESSAGE(
- type_ == nullValue || type_ == objectValue,
- "in Json::Value::resolveReference(): requires objectValue");
- if (type_ == nullValue)
- *this = Value(objectValue);
- CZString actualKey(
- key, static_cast<unsigned>(strlen(key)), CZString::noDuplication); // NOTE!
- ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
- if (it != value_.map_->end() && (*it).first == actualKey)
- return (*it).second;
-
- ObjectValues::value_type defaultValue(actualKey, nullSingleton());
- it = value_.map_->insert(it, defaultValue);
- Value& value = (*it).second;
- return value;
-}
-
-// @param key is not null-terminated.
-Value& Value::resolveReference(char const* key, char const* cend)
-{
- JSON_ASSERT_MESSAGE(
- type_ == nullValue || type_ == objectValue,
- "in Json::Value::resolveReference(key, end): requires objectValue");
- if (type_ == nullValue)
- *this = Value(objectValue);
- CZString actualKey(
- key, static_cast<unsigned>(cend-key), CZString::duplicateOnCopy);
- ObjectValues::iterator it = value_.map_->lower_bound(actualKey);
- if (it != value_.map_->end() && (*it).first == actualKey)
- return (*it).second;
-
- ObjectValues::value_type defaultValue(actualKey, nullSingleton());
- it = value_.map_->insert(it, defaultValue);
- Value& value = (*it).second;
- return value;
-}
-
-Value Value::get(ArrayIndex index, const Value& defaultValue) const {
- const Value* value = &((*this)[index]);
- return value == &nullSingleton() ? defaultValue : *value;
-}
-
-bool Value::isValidIndex(ArrayIndex index) const { return index < size(); }
-
-Value const* Value::find(char const* key, char const* cend) const
-{
- JSON_ASSERT_MESSAGE(
- type_ == nullValue || type_ == objectValue,
- "in Json::Value::find(key, end, found): requires objectValue or nullValue");
- if (type_ == nullValue) return NULL;
- CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
- ObjectValues::const_iterator it = value_.map_->find(actualKey);
- if (it == value_.map_->end()) return NULL;
- return &(*it).second;
-}
-const Value& Value::operator[](const char* key) const
-{
- Value const* found = find(key, key + strlen(key));
- if (!found) return nullSingleton();
- return *found;
-}
-Value const& Value::operator[](JSONCPP_STRING const& key) const
-{
- Value const* found = find(key.data(), key.data() + key.length());
- if (!found) return nullSingleton();
- return *found;
-}
-
-Value& Value::operator[](const char* key) {
- return resolveReference(key, key + strlen(key));
-}
-
-Value& Value::operator[](const JSONCPP_STRING& key) {
- return resolveReference(key.data(), key.data() + key.length());
-}
-
-Value& Value::operator[](const StaticString& key) {
- return resolveReference(key.c_str());
-}
-
-#ifdef JSON_USE_CPPTL
-Value& Value::operator[](const CppTL::ConstString& key) {
- return resolveReference(key.c_str(), key.end_c_str());
-}
-Value const& Value::operator[](CppTL::ConstString const& key) const
-{
- Value const* found = find(key.c_str(), key.end_c_str());
- if (!found) return nullSingleton();
- return *found;
-}
-#endif
-
-Value& Value::append(const Value& value) { return (*this)[size()] = value; }
-
-Value Value::get(char const* key, char const* cend, Value const& defaultValue) const
-{
- Value const* found = find(key, cend);
- return !found ? defaultValue : *found;
-}
-Value Value::get(char const* key, Value const& defaultValue) const
-{
- return get(key, key + strlen(key), defaultValue);
-}
-Value Value::get(JSONCPP_STRING const& key, Value const& defaultValue) const
-{
- return get(key.data(), key.data() + key.length(), defaultValue);
-}
-
-
-bool Value::removeMember(const char* key, const char* cend, Value* removed)
-{
- if (type_ != objectValue) {
- return false;
- }
- CZString actualKey(key, static_cast<unsigned>(cend-key), CZString::noDuplication);
- ObjectValues::iterator it = value_.map_->find(actualKey);
- if (it == value_.map_->end())
- return false;
- *removed = it->second;
- value_.map_->erase(it);
- return true;
-}
-bool Value::removeMember(const char* key, Value* removed)
-{
- return removeMember(key, key + strlen(key), removed);
-}
-bool Value::removeMember(JSONCPP_STRING const& key, Value* removed)
-{
- return removeMember(key.data(), key.data() + key.length(), removed);
-}
-Value Value::removeMember(const char* key)
-{
- JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == objectValue,
- "in Json::Value::removeMember(): requires objectValue");
- if (type_ == nullValue)
- return nullSingleton();
-
- Value removed; // null
- removeMember(key, key + strlen(key), &removed);
- return removed; // still null if removeMember() did nothing
-}
-Value Value::removeMember(const JSONCPP_STRING& key)
-{
- return removeMember(key.c_str());
-}
-
-bool Value::removeIndex(ArrayIndex index, Value* removed) {
- if (type_ != arrayValue) {
- return false;
- }
- CZString key(index);
- ObjectValues::iterator it = value_.map_->find(key);
- if (it == value_.map_->end()) {
- return false;
- }
- *removed = it->second;
- ArrayIndex oldSize = size();
- // shift left all items left, into the place of the "removed"
- for (ArrayIndex i = index; i < (oldSize - 1); ++i){
- CZString keey(i);
- (*value_.map_)[keey] = (*this)[i + 1];
- }
- // erase the last one ("leftover")
- CZString keyLast(oldSize - 1);
- ObjectValues::iterator itLast = value_.map_->find(keyLast);
- value_.map_->erase(itLast);
- return true;
-}
-
-#ifdef JSON_USE_CPPTL
-Value Value::get(const CppTL::ConstString& key,
- const Value& defaultValue) const {
- return get(key.c_str(), key.end_c_str(), defaultValue);
-}
-#endif
-
-bool Value::isMember(char const* key, char const* cend) const
-{
- Value const* value = find(key, cend);
- return NULL != value;
-}
-bool Value::isMember(char const* key) const
-{
- return isMember(key, key + strlen(key));
-}
-bool Value::isMember(JSONCPP_STRING const& key) const
-{
- return isMember(key.data(), key.data() + key.length());
-}
-
-#ifdef JSON_USE_CPPTL
-bool Value::isMember(const CppTL::ConstString& key) const {
- return isMember(key.c_str(), key.end_c_str());
-}
-#endif
-
-Value::Members Value::getMemberNames() const {
- JSON_ASSERT_MESSAGE(
- type_ == nullValue || type_ == objectValue,
- "in Json::Value::getMemberNames(), value must be objectValue");
- if (type_ == nullValue)
- return Value::Members();
- Members members;
- members.reserve(value_.map_->size());
- ObjectValues::const_iterator it = value_.map_->begin();
- ObjectValues::const_iterator itEnd = value_.map_->end();
- for (; it != itEnd; ++it) {
- members.push_back(JSONCPP_STRING((*it).first.data(),
- (*it).first.length()));
- }
- return members;
-}
-//
-//# ifdef JSON_USE_CPPTL
-// EnumMemberNames
-// Value::enumMemberNames() const
-//{
-// if ( type_ == objectValue )
-// {
-// return CppTL::Enum::any( CppTL::Enum::transform(
-// CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ),
-// MemberNamesTransform() ) );
-// }
-// return EnumMemberNames();
-//}
-//
-//
-// EnumValues
-// Value::enumValues() const
-//{
-// if ( type_ == objectValue || type_ == arrayValue )
-// return CppTL::Enum::anyValues( *(value_.map_),
-// CppTL::Type<const Value &>() );
-// return EnumValues();
-//}
-//
-//# endif
-
-static bool IsIntegral(double d) {
- double integral_part;
- return modf(d, &integral_part) == 0.0;
-}
-
-bool Value::isNull() const { return type_ == nullValue; }
-
-bool Value::isBool() const { return type_ == booleanValue; }
-
-bool Value::isInt() const {
- switch (type_) {
- case intValue:
- return value_.int_ >= minInt && value_.int_ <= maxInt;
- case uintValue:
- return value_.uint_ <= UInt(maxInt);
- case realValue:
- return value_.real_ >= minInt && value_.real_ <= maxInt &&
- IsIntegral(value_.real_);
- default:
- break;
- }
- return false;
-}
-
-bool Value::isUInt() const {
- switch (type_) {
- case intValue:
- return value_.int_ >= 0 && LargestUInt(value_.int_) <= LargestUInt(maxUInt);
- case uintValue:
- return value_.uint_ <= maxUInt;
- case realValue:
- return value_.real_ >= 0 && value_.real_ <= maxUInt &&
- IsIntegral(value_.real_);
- default:
- break;
- }
- return false;
-}
-
-bool Value::isInt64() const {
-#if defined(JSON_HAS_INT64)
- switch (type_) {
- case intValue:
- return true;
- case uintValue:
- return value_.uint_ <= UInt64(maxInt64);
- case realValue:
- // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a
- // double, so double(maxInt64) will be rounded up to 2^63. Therefore we
- // require the value to be strictly less than the limit.
- return value_.real_ >= double(minInt64) &&
- value_.real_ < double(maxInt64) && IsIntegral(value_.real_);
- default:
- break;
- }
-#endif // JSON_HAS_INT64
- return false;
-}
-
-bool Value::isUInt64() const {
-#if defined(JSON_HAS_INT64)
- switch (type_) {
- case intValue:
- return value_.int_ >= 0;
- case uintValue:
- return true;
- case realValue:
- // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
- // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
- // require the value to be strictly less than the limit.
- return value_.real_ >= 0 && value_.real_ < maxUInt64AsDouble &&
- IsIntegral(value_.real_);
- default:
- break;
- }
-#endif // JSON_HAS_INT64
- return false;
-}
-
-bool Value::isIntegral() const {
-#if defined(JSON_HAS_INT64)
- return isInt64() || isUInt64();
-#else
- return isInt() || isUInt();
-#endif
-}
-
-bool Value::isDouble() const { return type_ == realValue || isIntegral(); }
-
-bool Value::isNumeric() const { return isIntegral() || isDouble(); }
-
-bool Value::isString() const { return type_ == stringValue; }
-
-bool Value::isArray() const { return type_ == arrayValue; }
-
-bool Value::isObject() const { return type_ == objectValue; }
-
-void Value::setComment(const char* comment, size_t len, CommentPlacement placement) {
- if (!comments_)
- comments_ = new CommentInfo[numberOfCommentPlacement];
- if ((len > 0) && (comment[len-1] == '\n')) {
- // Always discard trailing newline, to aid indentation.
- len -= 1;
- }
- comments_[placement].setComment(comment, len);
-}
-
-void Value::setComment(const char* comment, CommentPlacement placement) {
- setComment(comment, strlen(comment), placement);
-}
-
-void Value::setComment(const JSONCPP_STRING& comment, CommentPlacement placement) {
- setComment(comment.c_str(), comment.length(), placement);
-}
-
-bool Value::hasComment(CommentPlacement placement) const {
- return comments_ != 0 && comments_[placement].comment_ != 0;
-}
-
-JSONCPP_STRING Value::getComment(CommentPlacement placement) const {
- if (hasComment(placement))
- return comments_[placement].comment_;
- return "";
-}
-
-void Value::setOffsetStart(ptrdiff_t start) { start_ = start; }
-
-void Value::setOffsetLimit(ptrdiff_t limit) { limit_ = limit; }
-
-ptrdiff_t Value::getOffsetStart() const { return start_; }
-
-ptrdiff_t Value::getOffsetLimit() const { return limit_; }
-
-JSONCPP_STRING Value::toStyledString() const {
- StyledWriter writer;
- return writer.write(*this);
-}
-
-Value::const_iterator Value::begin() const {
- switch (type_) {
- case arrayValue:
- case objectValue:
- if (value_.map_)
- return const_iterator(value_.map_->begin());
- break;
- default:
- break;
- }
- return const_iterator();
-}
-
-Value::const_iterator Value::end() const {
- switch (type_) {
- case arrayValue:
- case objectValue:
- if (value_.map_)
- return const_iterator(value_.map_->end());
- break;
- default:
- break;
- }
- return const_iterator();
-}
-
-Value::iterator Value::begin() {
- switch (type_) {
- case arrayValue:
- case objectValue:
- if (value_.map_)
- return iterator(value_.map_->begin());
- break;
- default:
- break;
- }
- return iterator();
-}
-
-Value::iterator Value::end() {
- switch (type_) {
- case arrayValue:
- case objectValue:
- if (value_.map_)
- return iterator(value_.map_->end());
- break;
- default:
- break;
- }
- return iterator();
-}
-
-// class PathArgument
-// //////////////////////////////////////////////////////////////////
-
-PathArgument::PathArgument() : key_(), index_(), kind_(kindNone) {}
-
-PathArgument::PathArgument(ArrayIndex index)
- : key_(), index_(index), kind_(kindIndex) {}
-
-PathArgument::PathArgument(const char* key)
- : key_(key), index_(), kind_(kindKey) {}
-
-PathArgument::PathArgument(const JSONCPP_STRING& key)
- : key_(key.c_str()), index_(), kind_(kindKey) {}
-
-// class Path
-// //////////////////////////////////////////////////////////////////
-
-Path::Path(const JSONCPP_STRING& path,
- const PathArgument& a1,
- const PathArgument& a2,
- const PathArgument& a3,
- const PathArgument& a4,
- const PathArgument& a5) {
- InArgs in;
- in.push_back(&a1);
- in.push_back(&a2);
- in.push_back(&a3);
- in.push_back(&a4);
- in.push_back(&a5);
- makePath(path, in);
-}
-
-void Path::makePath(const JSONCPP_STRING& path, const InArgs& in) {
- const char* current = path.c_str();
- const char* end = current + path.length();
- InArgs::const_iterator itInArg = in.begin();
- while (current != end) {
- if (*current == '[') {
- ++current;
- if (*current == '%')
- addPathInArg(path, in, itInArg, PathArgument::kindIndex);
- else {
- ArrayIndex index = 0;
- for (; current != end && *current >= '0' && *current <= '9'; ++current)
- index = index * 10 + ArrayIndex(*current - '0');
- args_.push_back(index);
- }
- if (current == end || *++current != ']')
- invalidPath(path, int(current - path.c_str()));
- } else if (*current == '%') {
- addPathInArg(path, in, itInArg, PathArgument::kindKey);
- ++current;
- } else if (*current == '.' || *current == ']') {
- ++current;
- } else {
- const char* beginName = current;
- while (current != end && !strchr("[.", *current))
- ++current;
- args_.push_back(JSONCPP_STRING(beginName, current));
- }
- }
-}
-
-void Path::addPathInArg(const JSONCPP_STRING& /*path*/,
- const InArgs& in,
- InArgs::const_iterator& itInArg,
- PathArgument::Kind kind) {
- if (itInArg == in.end()) {
- // Error: missing argument %d
- } else if ((*itInArg)->kind_ != kind) {
- // Error: bad argument type
- } else {
- args_.push_back(**itInArg++);
- }
-}
-
-void Path::invalidPath(const JSONCPP_STRING& /*path*/, int /*location*/) {
- // Error: invalid path.
-}
-
-const Value& Path::resolve(const Value& root) const {
- const Value* node = &root;
- for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
- const PathArgument& arg = *it;
- if (arg.kind_ == PathArgument::kindIndex) {
- if (!node->isArray() || !node->isValidIndex(arg.index_)) {
- // Error: unable to resolve path (array value expected at position...
- return Value::null;
- }
- node = &((*node)[arg.index_]);
- } else if (arg.kind_ == PathArgument::kindKey) {
- if (!node->isObject()) {
- // Error: unable to resolve path (object value expected at position...)
- return Value::null;
- }
- node = &((*node)[arg.key_]);
- if (node == &Value::nullSingleton()) {
- // Error: unable to resolve path (object has no member named '' at
- // position...)
- return Value::null;
- }
- }
- }
- return *node;
-}
-
-Value Path::resolve(const Value& root, const Value& defaultValue) const {
- const Value* node = &root;
- for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
- const PathArgument& arg = *it;
- if (arg.kind_ == PathArgument::kindIndex) {
- if (!node->isArray() || !node->isValidIndex(arg.index_))
- return defaultValue;
- node = &((*node)[arg.index_]);
- } else if (arg.kind_ == PathArgument::kindKey) {
- if (!node->isObject())
- return defaultValue;
- node = &((*node)[arg.key_]);
- if (node == &Value::nullSingleton())
- return defaultValue;
- }
- }
- return *node;
-}
-
-Value& Path::make(Value& root) const {
- Value* node = &root;
- for (Args::const_iterator it = args_.begin(); it != args_.end(); ++it) {
- const PathArgument& arg = *it;
- if (arg.kind_ == PathArgument::kindIndex) {
- if (!node->isArray()) {
- // Error: node is not an array at position ...
- }
- node = &((*node)[arg.index_]);
- } else if (arg.kind_ == PathArgument::kindKey) {
- if (!node->isObject()) {
- // Error: node is not an object at position...
- }
- node = &((*node)[arg.key_]);
- }
- }
- return *node;
-}
-
-} // namespace Json
diff --git a/toolkit/crashreporter/jsoncpp/src/lib_json/json_valueiterator.inl b/toolkit/crashreporter/jsoncpp/src/lib_json/json_valueiterator.inl
deleted file mode 100644
index b45162b4a6..0000000000
--- a/toolkit/crashreporter/jsoncpp/src/lib_json/json_valueiterator.inl
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2007-2010 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-// included by json_value.cpp
-
-namespace Json {
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueIteratorBase
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueIteratorBase::ValueIteratorBase()
- : current_(), isNull_(true) {
-}
-
-ValueIteratorBase::ValueIteratorBase(
- const Value::ObjectValues::iterator& current)
- : current_(current), isNull_(false) {}
-
-Value& ValueIteratorBase::deref() const {
- return current_->second;
-}
-
-void ValueIteratorBase::increment() {
- ++current_;
-}
-
-void ValueIteratorBase::decrement() {
- --current_;
-}
-
-ValueIteratorBase::difference_type
-ValueIteratorBase::computeDistance(const SelfType& other) const {
-#ifdef JSON_USE_CPPTL_SMALLMAP
- return other.current_ - current_;
-#else
- // Iterator for null value are initialized using the default
- // constructor, which initialize current_ to the default
- // std::map::iterator. As begin() and end() are two instance
- // of the default std::map::iterator, they can not be compared.
- // To allow this, we handle this comparison specifically.
- if (isNull_ && other.isNull_) {
- return 0;
- }
-
- // Usage of std::distance is not portable (does not compile with Sun Studio 12
- // RogueWave STL,
- // which is the one used by default).
- // Using a portable hand-made version for non random iterator instead:
- // return difference_type( std::distance( current_, other.current_ ) );
- difference_type myDistance = 0;
- for (Value::ObjectValues::iterator it = current_; it != other.current_;
- ++it) {
- ++myDistance;
- }
- return myDistance;
-#endif
-}
-
-bool ValueIteratorBase::isEqual(const SelfType& other) const {
- if (isNull_) {
- return other.isNull_;
- }
- return current_ == other.current_;
-}
-
-void ValueIteratorBase::copy(const SelfType& other) {
- current_ = other.current_;
- isNull_ = other.isNull_;
-}
-
-Value ValueIteratorBase::key() const {
- const Value::CZString czstring = (*current_).first;
- if (czstring.data()) {
- if (czstring.isStaticString())
- return Value(StaticString(czstring.data()));
- return Value(czstring.data(), czstring.data() + czstring.length());
- }
- return Value(czstring.index());
-}
-
-UInt ValueIteratorBase::index() const {
- const Value::CZString czstring = (*current_).first;
- if (!czstring.data())
- return czstring.index();
- return Value::UInt(-1);
-}
-
-JSONCPP_STRING ValueIteratorBase::name() const {
- char const* keey;
- char const* end;
- keey = memberName(&end);
- if (!keey) return JSONCPP_STRING();
- return JSONCPP_STRING(keey, end);
-}
-
-char const* ValueIteratorBase::memberName() const {
- const char* cname = (*current_).first.data();
- return cname ? cname : "";
-}
-
-char const* ValueIteratorBase::memberName(char const** end) const {
- const char* cname = (*current_).first.data();
- if (!cname) {
- *end = NULL;
- return NULL;
- }
- *end = cname + (*current_).first.length();
- return cname;
-}
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueConstIterator
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueConstIterator::ValueConstIterator() {}
-
-ValueConstIterator::ValueConstIterator(
- const Value::ObjectValues::iterator& current)
- : ValueIteratorBase(current) {}
-
-ValueConstIterator::ValueConstIterator(ValueIterator const& other)
- : ValueIteratorBase(other) {}
-
-ValueConstIterator& ValueConstIterator::
-operator=(const ValueIteratorBase& other) {
- copy(other);
- return *this;
-}
-
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// class ValueIterator
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-// //////////////////////////////////////////////////////////////////
-
-ValueIterator::ValueIterator() {}
-
-ValueIterator::ValueIterator(const Value::ObjectValues::iterator& current)
- : ValueIteratorBase(current) {}
-
-ValueIterator::ValueIterator(const ValueConstIterator& other)
- : ValueIteratorBase(other) {
- throwRuntimeError("ConstIterator to Iterator should never be allowed.");
-}
-
-ValueIterator::ValueIterator(const ValueIterator& other)
- : ValueIteratorBase(other) {}
-
-ValueIterator& ValueIterator::operator=(const SelfType& other) {
- copy(other);
- return *this;
-}
-
-} // namespace Json
diff --git a/toolkit/crashreporter/jsoncpp/src/lib_json/json_writer.cpp b/toolkit/crashreporter/jsoncpp/src/lib_json/json_writer.cpp
deleted file mode 100644
index 1bb3b21826..0000000000
--- a/toolkit/crashreporter/jsoncpp/src/lib_json/json_writer.cpp
+++ /dev/null
@@ -1,1218 +0,0 @@
-// Copyright 2011 Baptiste Lepilleur
-// Distributed under MIT license, or public domain if desired and
-// recognized in your jurisdiction.
-// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
-
-#if !defined(JSON_IS_AMALGAMATION)
-#include <json/writer.h>
-#include "json_tool.h"
-#endif // if !defined(JSON_IS_AMALGAMATION)
-#include <iomanip>
-#include <memory>
-#include <sstream>
-#include <utility>
-#include <set>
-#include <cassert>
-#include <cstring>
-#include <cstdio>
-
-#if defined(_MSC_VER) && _MSC_VER >= 1200 && _MSC_VER < 1800 // Between VC++ 6.0 and VC++ 11.0
-#include <float.h>
-#define isfinite _finite
-#elif defined(__sun) && defined(__SVR4) //Solaris
-#if !defined(isfinite)
-#include <ieeefp.h>
-#define isfinite finite
-#endif
-#elif defined(_AIX)
-#if !defined(isfinite)
-#include <math.h>
-#define isfinite finite
-#endif
-#elif defined(__hpux)
-#if !defined(isfinite)
-#if defined(__ia64) && !defined(finite)
-#define isfinite(x) ((sizeof(x) == sizeof(float) ? \
- _Isfinitef(x) : _IsFinite(x)))
-#else
-#include <math.h>
-#define isfinite finite
-#endif
-#endif
-#else
-#include <cmath>
-#if !(defined(__QNXNTO__)) // QNX already defines isfinite
-#define isfinite std::isfinite
-#endif
-#endif
-
-#if defined(_MSC_VER)
-#if !defined(WINCE) && defined(__STDC_SECURE_LIB__) && _MSC_VER >= 1500 // VC++ 9.0 and above
-#define snprintf sprintf_s
-#elif _MSC_VER >= 1900 // VC++ 14.0 and above
-#define snprintf std::snprintf
-#else
-#define snprintf _snprintf
-#endif
-#elif defined(__ANDROID__) || defined(__QNXNTO__)
-#define snprintf snprintf
-#elif __cplusplus >= 201103L
-#if !defined(__MINGW32__) && !defined(__CYGWIN__)
-#define snprintf std::snprintf
-#endif
-#endif
-
-#if defined(__BORLANDC__)
-#include <float.h>
-#define isfinite _finite
-#define snprintf _snprintf
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
-// Disable warning about strdup being deprecated.
-#pragma warning(disable : 4996)
-#endif
-
-namespace Json {
-
-#if __cplusplus >= 201103L || (defined(_CPPLIB_VER) && _CPPLIB_VER >= 520)
-typedef std::unique_ptr<StreamWriter> StreamWriterPtr;
-#else
-typedef std::auto_ptr<StreamWriter> StreamWriterPtr;
-#endif
-
-static bool containsControlCharacter(const char* str) {
- while (*str) {
- if (isControlCharacter(*(str++)))
- return true;
- }
- return false;
-}
-
-static bool containsControlCharacter0(const char* str, unsigned len) {
- char const* end = str + len;
- while (end != str) {
- if (isControlCharacter(*str) || 0==*str)
- return true;
- ++str;
- }
- return false;
-}
-
-JSONCPP_STRING valueToString(LargestInt value) {
- UIntToStringBuffer buffer;
- char* current = buffer + sizeof(buffer);
- if (value == Value::minLargestInt) {
- uintToString(LargestUInt(Value::maxLargestInt) + 1, current);
- *--current = '-';
- } else if (value < 0) {
- uintToString(LargestUInt(-value), current);
- *--current = '-';
- } else {
- uintToString(LargestUInt(value), current);
- }
- assert(current >= buffer);
- return current;
-}
-
-JSONCPP_STRING valueToString(LargestUInt value) {
- UIntToStringBuffer buffer;
- char* current = buffer + sizeof(buffer);
- uintToString(value, current);
- assert(current >= buffer);
- return current;
-}
-
-#if defined(JSON_HAS_INT64)
-
-JSONCPP_STRING valueToString(Int value) {
- return valueToString(LargestInt(value));
-}
-
-JSONCPP_STRING valueToString(UInt value) {
- return valueToString(LargestUInt(value));
-}
-
-#endif // # if defined(JSON_HAS_INT64)
-
-namespace {
-JSONCPP_STRING valueToString(double value, bool useSpecialFloats, unsigned int precision) {
- // Allocate a buffer that is more than large enough to store the 16 digits of
- // precision requested below.
- char buffer[32];
- int len = -1;
-
- char formatString[6];
- sprintf(formatString, "%%.%dg", precision);
-
- // Print into the buffer. We need not request the alternative representation
- // that always has a decimal point because JSON doesn't distingish the
- // concepts of reals and integers.
- if (isfinite(value)) {
- len = snprintf(buffer, sizeof(buffer), formatString, value);
- } else {
- // IEEE standard states that NaN values will not compare to themselves
- if (value != value) {
- len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "NaN" : "null");
- } else if (value < 0) {
- len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "-Infinity" : "-1e+9999");
- } else {
- len = snprintf(buffer, sizeof(buffer), useSpecialFloats ? "Infinity" : "1e+9999");
- }
- // For those, we do not need to call fixNumLoc, but it is fast.
- }
- assert(len >= 0);
- fixNumericLocale(buffer, buffer + len);
- return buffer;
-}
-}
-
-JSONCPP_STRING valueToString(double value) { return valueToString(value, false, 17); }
-
-JSONCPP_STRING valueToString(bool value) { return value ? "true" : "false"; }
-
-JSONCPP_STRING valueToQuotedString(const char* value) {
- if (value == NULL)
- return "";
- // Not sure how to handle unicode...
- if (strpbrk(value, "\"\\\b\f\n\r\t") == NULL &&
- !containsControlCharacter(value))
- return JSONCPP_STRING("\"") + value + "\"";
- // We have to walk value and escape any special characters.
- // Appending to JSONCPP_STRING is not efficient, but this should be rare.
- // (Note: forward slashes are *not* rare, but I am not escaping them.)
- JSONCPP_STRING::size_type maxsize =
- strlen(value) * 2 + 3; // allescaped+quotes+NULL
- JSONCPP_STRING result;
- result.reserve(maxsize); // to avoid lots of mallocs
- result += "\"";
- for (const char* c = value; *c != 0; ++c) {
- switch (*c) {
- case '\"':
- result += "\\\"";
- break;
- case '\\':
- result += "\\\\";
- break;
- case '\b':
- result += "\\b";
- break;
- case '\f':
- result += "\\f";
- break;
- case '\n':
- result += "\\n";
- break;
- case '\r':
- result += "\\r";
- break;
- case '\t':
- result += "\\t";
- break;
- // case '/':
- // Even though \/ is considered a legal escape in JSON, a bare
- // slash is also legal, so I see no reason to escape it.
- // (I hope I am not misunderstanding something.
- // blep notes: actually escaping \/ may be useful in javascript to avoid </
- // sequence.
- // Should add a flag to allow this compatibility mode and prevent this
- // sequence from occurring.
- default:
- if (isControlCharacter(*c)) {
- JSONCPP_OSTRINGSTREAM oss;
- oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
- << std::setw(4) << static_cast<int>(*c);
- result += oss.str();
- } else {
- result += *c;
- }
- break;
- }
- }
- result += "\"";
- return result;
-}
-
-// https://github.com/upcaste/upcaste/blob/master/src/upcore/src/cstring/strnpbrk.cpp
-static char const* strnpbrk(char const* s, char const* accept, size_t n) {
- assert((s || !n) && accept);
-
- char const* const end = s + n;
- for (char const* cur = s; cur < end; ++cur) {
- int const c = *cur;
- for (char const* a = accept; *a; ++a) {
- if (*a == c) {
- return cur;
- }
- }
- }
- return NULL;
-}
-static JSONCPP_STRING valueToQuotedStringN(const char* value, unsigned length) {
- if (value == NULL)
- return "";
- // Not sure how to handle unicode...
- if (strnpbrk(value, "\"\\\b\f\n\r\t", length) == NULL &&
- !containsControlCharacter0(value, length))
- return JSONCPP_STRING("\"") + value + "\"";
- // We have to walk value and escape any special characters.
- // Appending to JSONCPP_STRING is not efficient, but this should be rare.
- // (Note: forward slashes are *not* rare, but I am not escaping them.)
- JSONCPP_STRING::size_type maxsize =
- length * 2 + 3; // allescaped+quotes+NULL
- JSONCPP_STRING result;
- result.reserve(maxsize); // to avoid lots of mallocs
- result += "\"";
- char const* end = value + length;
- for (const char* c = value; c != end; ++c) {
- switch (*c) {
- case '\"':
- result += "\\\"";
- break;
- case '\\':
- result += "\\\\";
- break;
- case '\b':
- result += "\\b";
- break;
- case '\f':
- result += "\\f";
- break;
- case '\n':
- result += "\\n";
- break;
- case '\r':
- result += "\\r";
- break;
- case '\t':
- result += "\\t";
- break;
- // case '/':
- // Even though \/ is considered a legal escape in JSON, a bare
- // slash is also legal, so I see no reason to escape it.
- // (I hope I am not misunderstanding something.)
- // blep notes: actually escaping \/ may be useful in javascript to avoid </
- // sequence.
- // Should add a flag to allow this compatibility mode and prevent this
- // sequence from occurring.
- default:
- if ((isControlCharacter(*c)) || (*c == 0)) {
- JSONCPP_OSTRINGSTREAM oss;
- oss << "\\u" << std::hex << std::uppercase << std::setfill('0')
- << std::setw(4) << static_cast<int>(*c);
- result += oss.str();
- } else {
- result += *c;
- }
- break;
- }
- }
- result += "\"";
- return result;
-}
-
-// Class Writer
-// //////////////////////////////////////////////////////////////////
-Writer::~Writer() {}
-
-// Class FastWriter
-// //////////////////////////////////////////////////////////////////
-
-FastWriter::FastWriter()
- : yamlCompatiblityEnabled_(false), dropNullPlaceholders_(false),
- omitEndingLineFeed_(false) {}
-
-void FastWriter::enableYAMLCompatibility() { yamlCompatiblityEnabled_ = true; }
-
-void FastWriter::dropNullPlaceholders() { dropNullPlaceholders_ = true; }
-
-void FastWriter::omitEndingLineFeed() { omitEndingLineFeed_ = true; }
-
-JSONCPP_STRING FastWriter::write(const Value& root) {
- document_ = "";
- writeValue(root);
- if (!omitEndingLineFeed_)
- document_ += "\n";
- return document_;
-}
-
-void FastWriter::writeValue(const Value& value) {
- switch (value.type()) {
- case nullValue:
- if (!dropNullPlaceholders_)
- document_ += "null";
- break;
- case intValue:
- document_ += valueToString(value.asLargestInt());
- break;
- case uintValue:
- document_ += valueToString(value.asLargestUInt());
- break;
- case realValue:
- document_ += valueToString(value.asDouble());
- break;
- case stringValue:
- {
- // Is NULL possible for value.string_? No.
- char const* str;
- char const* end;
- bool ok = value.getString(&str, &end);
- if (ok) document_ += valueToQuotedStringN(str, static_cast<unsigned>(end-str));
- break;
- }
- case booleanValue:
- document_ += valueToString(value.asBool());
- break;
- case arrayValue: {
- document_ += '[';
- ArrayIndex size = value.size();
- for (ArrayIndex index = 0; index < size; ++index) {
- if (index > 0)
- document_ += ',';
- writeValue(value[index]);
- }
- document_ += ']';
- } break;
- case objectValue: {
- Value::Members members(value.getMemberNames());
- document_ += '{';
- for (Value::Members::iterator it = members.begin(); it != members.end();
- ++it) {
- const JSONCPP_STRING& name = *it;
- if (it != members.begin())
- document_ += ',';
- document_ += valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length()));
- document_ += yamlCompatiblityEnabled_ ? ": " : ":";
- writeValue(value[name]);
- }
- document_ += '}';
- } break;
- }
-}
-
-// Class StyledWriter
-// //////////////////////////////////////////////////////////////////
-
-StyledWriter::StyledWriter()
- : rightMargin_(74), indentSize_(3), addChildValues_() {}
-
-JSONCPP_STRING StyledWriter::write(const Value& root) {
- document_ = "";
- addChildValues_ = false;
- indentString_ = "";
- writeCommentBeforeValue(root);
- writeValue(root);
- writeCommentAfterValueOnSameLine(root);
- document_ += "\n";
- return document_;
-}
-
-void StyledWriter::writeValue(const Value& value) {
- switch (value.type()) {
- case nullValue:
- pushValue("null");
- break;
- case intValue:
- pushValue(valueToString(value.asLargestInt()));
- break;
- case uintValue:
- pushValue(valueToString(value.asLargestUInt()));
- break;
- case realValue:
- pushValue(valueToString(value.asDouble()));
- break;
- case stringValue:
- {
- // Is NULL possible for value.string_? No.
- char const* str;
- char const* end;
- bool ok = value.getString(&str, &end);
- if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
- else pushValue("");
- break;
- }
- case booleanValue:
- pushValue(valueToString(value.asBool()));
- break;
- case arrayValue:
- writeArrayValue(value);
- break;
- case objectValue: {
- Value::Members members(value.getMemberNames());
- if (members.empty())
- pushValue("{}");
- else {
- writeWithIndent("{");
- indent();
- Value::Members::iterator it = members.begin();
- for (;;) {
- const JSONCPP_STRING& name = *it;
- const Value& childValue = value[name];
- writeCommentBeforeValue(childValue);
- writeWithIndent(valueToQuotedString(name.c_str()));
- document_ += " : ";
- writeValue(childValue);
- if (++it == members.end()) {
- writeCommentAfterValueOnSameLine(childValue);
- break;
- }
- document_ += ',';
- writeCommentAfterValueOnSameLine(childValue);
- }
- unindent();
- writeWithIndent("}");
- }
- } break;
- }
-}
-
-void StyledWriter::writeArrayValue(const Value& value) {
- unsigned size = value.size();
- if (size == 0)
- pushValue("[]");
- else {
- bool isArrayMultiLine = isMultineArray(value);
- if (isArrayMultiLine) {
- writeWithIndent("[");
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index = 0;
- for (;;) {
- const Value& childValue = value[index];
- writeCommentBeforeValue(childValue);
- if (hasChildValue)
- writeWithIndent(childValues_[index]);
- else {
- writeIndent();
- writeValue(childValue);
- }
- if (++index == size) {
- writeCommentAfterValueOnSameLine(childValue);
- break;
- }
- document_ += ',';
- writeCommentAfterValueOnSameLine(childValue);
- }
- unindent();
- writeWithIndent("]");
- } else // output on a single line
- {
- assert(childValues_.size() == size);
- document_ += "[ ";
- for (unsigned index = 0; index < size; ++index) {
- if (index > 0)
- document_ += ", ";
- document_ += childValues_[index];
- }
- document_ += " ]";
- }
- }
-}
-
-bool StyledWriter::isMultineArray(const Value& value) {
- ArrayIndex const size = value.size();
- bool isMultiLine = size * 3 >= rightMargin_;
- childValues_.clear();
- for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
- const Value& childValue = value[index];
- isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0);
- }
- if (!isMultiLine) // check if line length > max line length
- {
- childValues_.reserve(size);
- addChildValues_ = true;
- ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
- for (ArrayIndex index = 0; index < size; ++index) {
- if (hasCommentForValue(value[index])) {
- isMultiLine = true;
- }
- writeValue(value[index]);
- lineLength += static_cast<ArrayIndex>(childValues_[index].length());
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-void StyledWriter::pushValue(const JSONCPP_STRING& value) {
- if (addChildValues_)
- childValues_.push_back(value);
- else
- document_ += value;
-}
-
-void StyledWriter::writeIndent() {
- if (!document_.empty()) {
- char last = document_[document_.length() - 1];
- if (last == ' ') // already indented
- return;
- if (last != '\n') // Comments may add new-line
- document_ += '\n';
- }
- document_ += indentString_;
-}
-
-void StyledWriter::writeWithIndent(const JSONCPP_STRING& value) {
- writeIndent();
- document_ += value;
-}
-
-void StyledWriter::indent() { indentString_ += JSONCPP_STRING(indentSize_, ' '); }
-
-void StyledWriter::unindent() {
- assert(indentString_.size() >= indentSize_);
- indentString_.resize(indentString_.size() - indentSize_);
-}
-
-void StyledWriter::writeCommentBeforeValue(const Value& root) {
- if (!root.hasComment(commentBefore))
- return;
-
- document_ += "\n";
- writeIndent();
- const JSONCPP_STRING& comment = root.getComment(commentBefore);
- JSONCPP_STRING::const_iterator iter = comment.begin();
- while (iter != comment.end()) {
- document_ += *iter;
- if (*iter == '\n' &&
- (iter != comment.end() && *(iter + 1) == '/'))
- writeIndent();
- ++iter;
- }
-
- // Comments are stripped of trailing newlines, so add one here
- document_ += "\n";
-}
-
-void StyledWriter::writeCommentAfterValueOnSameLine(const Value& root) {
- if (root.hasComment(commentAfterOnSameLine))
- document_ += " " + root.getComment(commentAfterOnSameLine);
-
- if (root.hasComment(commentAfter)) {
- document_ += "\n";
- document_ += root.getComment(commentAfter);
- document_ += "\n";
- }
-}
-
-bool StyledWriter::hasCommentForValue(const Value& value) {
- return value.hasComment(commentBefore) ||
- value.hasComment(commentAfterOnSameLine) ||
- value.hasComment(commentAfter);
-}
-
-// Class StyledStreamWriter
-// //////////////////////////////////////////////////////////////////
-
-StyledStreamWriter::StyledStreamWriter(JSONCPP_STRING indentation)
- : document_(NULL), rightMargin_(74), indentation_(indentation),
- addChildValues_() {}
-
-void StyledStreamWriter::write(JSONCPP_OSTREAM& out, const Value& root) {
- document_ = &out;
- addChildValues_ = false;
- indentString_ = "";
- indented_ = true;
- writeCommentBeforeValue(root);
- if (!indented_) writeIndent();
- indented_ = true;
- writeValue(root);
- writeCommentAfterValueOnSameLine(root);
- *document_ << "\n";
- document_ = NULL; // Forget the stream, for safety.
-}
-
-void StyledStreamWriter::writeValue(const Value& value) {
- switch (value.type()) {
- case nullValue:
- pushValue("null");
- break;
- case intValue:
- pushValue(valueToString(value.asLargestInt()));
- break;
- case uintValue:
- pushValue(valueToString(value.asLargestUInt()));
- break;
- case realValue:
- pushValue(valueToString(value.asDouble()));
- break;
- case stringValue:
- {
- // Is NULL possible for value.string_? No.
- char const* str;
- char const* end;
- bool ok = value.getString(&str, &end);
- if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
- else pushValue("");
- break;
- }
- case booleanValue:
- pushValue(valueToString(value.asBool()));
- break;
- case arrayValue:
- writeArrayValue(value);
- break;
- case objectValue: {
- Value::Members members(value.getMemberNames());
- if (members.empty())
- pushValue("{}");
- else {
- writeWithIndent("{");
- indent();
- Value::Members::iterator it = members.begin();
- for (;;) {
- const JSONCPP_STRING& name = *it;
- const Value& childValue = value[name];
- writeCommentBeforeValue(childValue);
- writeWithIndent(valueToQuotedString(name.c_str()));
- *document_ << " : ";
- writeValue(childValue);
- if (++it == members.end()) {
- writeCommentAfterValueOnSameLine(childValue);
- break;
- }
- *document_ << ",";
- writeCommentAfterValueOnSameLine(childValue);
- }
- unindent();
- writeWithIndent("}");
- }
- } break;
- }
-}
-
-void StyledStreamWriter::writeArrayValue(const Value& value) {
- unsigned size = value.size();
- if (size == 0)
- pushValue("[]");
- else {
- bool isArrayMultiLine = isMultineArray(value);
- if (isArrayMultiLine) {
- writeWithIndent("[");
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index = 0;
- for (;;) {
- const Value& childValue = value[index];
- writeCommentBeforeValue(childValue);
- if (hasChildValue)
- writeWithIndent(childValues_[index]);
- else {
- if (!indented_) writeIndent();
- indented_ = true;
- writeValue(childValue);
- indented_ = false;
- }
- if (++index == size) {
- writeCommentAfterValueOnSameLine(childValue);
- break;
- }
- *document_ << ",";
- writeCommentAfterValueOnSameLine(childValue);
- }
- unindent();
- writeWithIndent("]");
- } else // output on a single line
- {
- assert(childValues_.size() == size);
- *document_ << "[ ";
- for (unsigned index = 0; index < size; ++index) {
- if (index > 0)
- *document_ << ", ";
- *document_ << childValues_[index];
- }
- *document_ << " ]";
- }
- }
-}
-
-bool StyledStreamWriter::isMultineArray(const Value& value) {
- ArrayIndex const size = value.size();
- bool isMultiLine = size * 3 >= rightMargin_;
- childValues_.clear();
- for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
- const Value& childValue = value[index];
- isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0);
- }
- if (!isMultiLine) // check if line length > max line length
- {
- childValues_.reserve(size);
- addChildValues_ = true;
- ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
- for (ArrayIndex index = 0; index < size; ++index) {
- if (hasCommentForValue(value[index])) {
- isMultiLine = true;
- }
- writeValue(value[index]);
- lineLength += static_cast<ArrayIndex>(childValues_[index].length());
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-void StyledStreamWriter::pushValue(const JSONCPP_STRING& value) {
- if (addChildValues_)
- childValues_.push_back(value);
- else
- *document_ << value;
-}
-
-void StyledStreamWriter::writeIndent() {
- // blep intended this to look at the so-far-written string
- // to determine whether we are already indented, but
- // with a stream we cannot do that. So we rely on some saved state.
- // The caller checks indented_.
- *document_ << '\n' << indentString_;
-}
-
-void StyledStreamWriter::writeWithIndent(const JSONCPP_STRING& value) {
- if (!indented_) writeIndent();
- *document_ << value;
- indented_ = false;
-}
-
-void StyledStreamWriter::indent() { indentString_ += indentation_; }
-
-void StyledStreamWriter::unindent() {
- assert(indentString_.size() >= indentation_.size());
- indentString_.resize(indentString_.size() - indentation_.size());
-}
-
-void StyledStreamWriter::writeCommentBeforeValue(const Value& root) {
- if (!root.hasComment(commentBefore))
- return;
-
- if (!indented_) writeIndent();
- const JSONCPP_STRING& comment = root.getComment(commentBefore);
- JSONCPP_STRING::const_iterator iter = comment.begin();
- while (iter != comment.end()) {
- *document_ << *iter;
- if (*iter == '\n' &&
- (iter != comment.end() && *(iter + 1) == '/'))
- // writeIndent(); // would include newline
- *document_ << indentString_;
- ++iter;
- }
- indented_ = false;
-}
-
-void StyledStreamWriter::writeCommentAfterValueOnSameLine(const Value& root) {
- if (root.hasComment(commentAfterOnSameLine))
- *document_ << ' ' << root.getComment(commentAfterOnSameLine);
-
- if (root.hasComment(commentAfter)) {
- writeIndent();
- *document_ << root.getComment(commentAfter);
- }
- indented_ = false;
-}
-
-bool StyledStreamWriter::hasCommentForValue(const Value& value) {
- return value.hasComment(commentBefore) ||
- value.hasComment(commentAfterOnSameLine) ||
- value.hasComment(commentAfter);
-}
-
-//////////////////////////
-// BuiltStyledStreamWriter
-
-/// Scoped enums are not available until C++11.
-struct CommentStyle {
- /// Decide whether to write comments.
- enum Enum {
- None, ///< Drop all comments.
- Most, ///< Recover odd behavior of previous versions (not implemented yet).
- All ///< Keep all comments.
- };
-};
-
-struct BuiltStyledStreamWriter : public StreamWriter
-{
- BuiltStyledStreamWriter(
- JSONCPP_STRING const& indentation,
- CommentStyle::Enum cs,
- JSONCPP_STRING const& colonSymbol,
- JSONCPP_STRING const& nullSymbol,
- JSONCPP_STRING const& endingLineFeedSymbol,
- bool useSpecialFloats,
- unsigned int precision);
- int write(Value const& root, JSONCPP_OSTREAM* sout) JSONCPP_OVERRIDE;
-private:
- void writeValue(Value const& value);
- void writeArrayValue(Value const& value);
- bool isMultineArray(Value const& value);
- void pushValue(JSONCPP_STRING const& value);
- void writeIndent();
- void writeWithIndent(JSONCPP_STRING const& value);
- void indent();
- void unindent();
- void writeCommentBeforeValue(Value const& root);
- void writeCommentAfterValueOnSameLine(Value const& root);
- static bool hasCommentForValue(const Value& value);
-
- typedef std::vector<JSONCPP_STRING> ChildValues;
-
- ChildValues childValues_;
- JSONCPP_STRING indentString_;
- unsigned int rightMargin_;
- JSONCPP_STRING indentation_;
- CommentStyle::Enum cs_;
- JSONCPP_STRING colonSymbol_;
- JSONCPP_STRING nullSymbol_;
- JSONCPP_STRING endingLineFeedSymbol_;
- bool addChildValues_ : 1;
- bool indented_ : 1;
- bool useSpecialFloats_ : 1;
- unsigned int precision_;
-};
-BuiltStyledStreamWriter::BuiltStyledStreamWriter(
- JSONCPP_STRING const& indentation,
- CommentStyle::Enum cs,
- JSONCPP_STRING const& colonSymbol,
- JSONCPP_STRING const& nullSymbol,
- JSONCPP_STRING const& endingLineFeedSymbol,
- bool useSpecialFloats,
- unsigned int precision)
- : rightMargin_(74)
- , indentation_(indentation)
- , cs_(cs)
- , colonSymbol_(colonSymbol)
- , nullSymbol_(nullSymbol)
- , endingLineFeedSymbol_(endingLineFeedSymbol)
- , addChildValues_(false)
- , indented_(false)
- , useSpecialFloats_(useSpecialFloats)
- , precision_(precision)
-{
-}
-int BuiltStyledStreamWriter::write(Value const& root, JSONCPP_OSTREAM* sout)
-{
- sout_ = sout;
- addChildValues_ = false;
- indented_ = true;
- indentString_ = "";
- writeCommentBeforeValue(root);
- if (!indented_) writeIndent();
- indented_ = true;
- writeValue(root);
- writeCommentAfterValueOnSameLine(root);
- *sout_ << endingLineFeedSymbol_;
- sout_ = NULL;
- return 0;
-}
-void BuiltStyledStreamWriter::writeValue(Value const& value) {
- switch (value.type()) {
- case nullValue:
- pushValue(nullSymbol_);
- break;
- case intValue:
- pushValue(valueToString(value.asLargestInt()));
- break;
- case uintValue:
- pushValue(valueToString(value.asLargestUInt()));
- break;
- case realValue:
- pushValue(valueToString(value.asDouble(), useSpecialFloats_, precision_));
- break;
- case stringValue:
- {
- // Is NULL is possible for value.string_? No.
- char const* str;
- char const* end;
- bool ok = value.getString(&str, &end);
- if (ok) pushValue(valueToQuotedStringN(str, static_cast<unsigned>(end-str)));
- else pushValue("");
- break;
- }
- case booleanValue:
- pushValue(valueToString(value.asBool()));
- break;
- case arrayValue:
- writeArrayValue(value);
- break;
- case objectValue: {
- Value::Members members(value.getMemberNames());
- if (members.empty())
- pushValue("{}");
- else {
- writeWithIndent("{");
- indent();
- Value::Members::iterator it = members.begin();
- for (;;) {
- JSONCPP_STRING const& name = *it;
- Value const& childValue = value[name];
- writeCommentBeforeValue(childValue);
- writeWithIndent(valueToQuotedStringN(name.data(), static_cast<unsigned>(name.length())));
- *sout_ << colonSymbol_;
- writeValue(childValue);
- if (++it == members.end()) {
- writeCommentAfterValueOnSameLine(childValue);
- break;
- }
- *sout_ << ",";
- writeCommentAfterValueOnSameLine(childValue);
- }
- unindent();
- writeWithIndent("}");
- }
- } break;
- }
-}
-
-void BuiltStyledStreamWriter::writeArrayValue(Value const& value) {
- unsigned size = value.size();
- if (size == 0)
- pushValue("[]");
- else {
- bool isMultiLine = (cs_ == CommentStyle::All) || isMultineArray(value);
- if (isMultiLine) {
- writeWithIndent("[");
- indent();
- bool hasChildValue = !childValues_.empty();
- unsigned index = 0;
- for (;;) {
- Value const& childValue = value[index];
- writeCommentBeforeValue(childValue);
- if (hasChildValue)
- writeWithIndent(childValues_[index]);
- else {
- if (!indented_) writeIndent();
- indented_ = true;
- writeValue(childValue);
- indented_ = false;
- }
- if (++index == size) {
- writeCommentAfterValueOnSameLine(childValue);
- break;
- }
- *sout_ << ",";
- writeCommentAfterValueOnSameLine(childValue);
- }
- unindent();
- writeWithIndent("]");
- } else // output on a single line
- {
- assert(childValues_.size() == size);
- *sout_ << "[";
- if (!indentation_.empty()) *sout_ << " ";
- for (unsigned index = 0; index < size; ++index) {
- if (index > 0)
- *sout_ << ((!indentation_.empty()) ? ", " : ",");
- *sout_ << childValues_[index];
- }
- if (!indentation_.empty()) *sout_ << " ";
- *sout_ << "]";
- }
- }
-}
-
-bool BuiltStyledStreamWriter::isMultineArray(Value const& value) {
- ArrayIndex const size = value.size();
- bool isMultiLine = size * 3 >= rightMargin_;
- childValues_.clear();
- for (ArrayIndex index = 0; index < size && !isMultiLine; ++index) {
- Value const& childValue = value[index];
- isMultiLine = ((childValue.isArray() || childValue.isObject()) &&
- childValue.size() > 0);
- }
- if (!isMultiLine) // check if line length > max line length
- {
- childValues_.reserve(size);
- addChildValues_ = true;
- ArrayIndex lineLength = 4 + (size - 1) * 2; // '[ ' + ', '*n + ' ]'
- for (ArrayIndex index = 0; index < size; ++index) {
- if (hasCommentForValue(value[index])) {
- isMultiLine = true;
- }
- writeValue(value[index]);
- lineLength += static_cast<ArrayIndex>(childValues_[index].length());
- }
- addChildValues_ = false;
- isMultiLine = isMultiLine || lineLength >= rightMargin_;
- }
- return isMultiLine;
-}
-
-void BuiltStyledStreamWriter::pushValue(JSONCPP_STRING const& value) {
- if (addChildValues_)
- childValues_.push_back(value);
- else
- *sout_ << value;
-}
-
-void BuiltStyledStreamWriter::writeIndent() {
- // blep intended this to look at the so-far-written string
- // to determine whether we are already indented, but
- // with a stream we cannot do that. So we rely on some saved state.
- // The caller checks indented_.
-
- if (!indentation_.empty()) {
- // In this case, drop newlines too.
- *sout_ << '\n' << indentString_;
- }
-}
-
-void BuiltStyledStreamWriter::writeWithIndent(JSONCPP_STRING const& value) {
- if (!indented_) writeIndent();
- *sout_ << value;
- indented_ = false;
-}
-
-void BuiltStyledStreamWriter::indent() { indentString_ += indentation_; }
-
-void BuiltStyledStreamWriter::unindent() {
- assert(indentString_.size() >= indentation_.size());
- indentString_.resize(indentString_.size() - indentation_.size());
-}
-
-void BuiltStyledStreamWriter::writeCommentBeforeValue(Value const& root) {
- if (cs_ == CommentStyle::None) return;
- if (!root.hasComment(commentBefore))
- return;
-
- if (!indented_) writeIndent();
- const JSONCPP_STRING& comment = root.getComment(commentBefore);
- JSONCPP_STRING::const_iterator iter = comment.begin();
- while (iter != comment.end()) {
- *sout_ << *iter;
- if (*iter == '\n' &&
- (iter != comment.end() && *(iter + 1) == '/'))
- // writeIndent(); // would write extra newline
- *sout_ << indentString_;
- ++iter;
- }
- indented_ = false;
-}
-
-void BuiltStyledStreamWriter::writeCommentAfterValueOnSameLine(Value const& root) {
- if (cs_ == CommentStyle::None) return;
- if (root.hasComment(commentAfterOnSameLine))
- *sout_ << " " + root.getComment(commentAfterOnSameLine);
-
- if (root.hasComment(commentAfter)) {
- writeIndent();
- *sout_ << root.getComment(commentAfter);
- }
-}
-
-// static
-bool BuiltStyledStreamWriter::hasCommentForValue(const Value& value) {
- return value.hasComment(commentBefore) ||
- value.hasComment(commentAfterOnSameLine) ||
- value.hasComment(commentAfter);
-}
-
-///////////////
-// StreamWriter
-
-StreamWriter::StreamWriter()
- : sout_(NULL)
-{
-}
-StreamWriter::~StreamWriter()
-{
-}
-StreamWriter::Factory::~Factory()
-{}
-StreamWriterBuilder::StreamWriterBuilder()
-{
- setDefaults(&settings_);
-}
-StreamWriterBuilder::~StreamWriterBuilder()
-{}
-StreamWriter* StreamWriterBuilder::newStreamWriter() const
-{
- JSONCPP_STRING indentation = settings_["indentation"].asString();
- JSONCPP_STRING cs_str = settings_["commentStyle"].asString();
- bool eyc = settings_["enableYAMLCompatibility"].asBool();
- bool dnp = settings_["dropNullPlaceholders"].asBool();
- bool usf = settings_["useSpecialFloats"].asBool();
- unsigned int pre = settings_["precision"].asUInt();
- CommentStyle::Enum cs = CommentStyle::All;
- if (cs_str == "All") {
- cs = CommentStyle::All;
- } else if (cs_str == "None") {
- cs = CommentStyle::None;
- } else {
- throwRuntimeError("commentStyle must be 'All' or 'None'");
- }
- JSONCPP_STRING colonSymbol = " : ";
- if (eyc) {
- colonSymbol = ": ";
- } else if (indentation.empty()) {
- colonSymbol = ":";
- }
- JSONCPP_STRING nullSymbol = "null";
- if (dnp) {
- nullSymbol = "";
- }
- if (pre > 17) pre = 17;
- JSONCPP_STRING endingLineFeedSymbol = "";
- return new BuiltStyledStreamWriter(
- indentation, cs,
- colonSymbol, nullSymbol, endingLineFeedSymbol, usf, pre);
-}
-static void getValidWriterKeys(std::set<JSONCPP_STRING>* valid_keys)
-{
- valid_keys->clear();
- valid_keys->insert("indentation");
- valid_keys->insert("commentStyle");
- valid_keys->insert("enableYAMLCompatibility");
- valid_keys->insert("dropNullPlaceholders");
- valid_keys->insert("useSpecialFloats");
- valid_keys->insert("precision");
-}
-bool StreamWriterBuilder::validate(Json::Value* invalid) const
-{
- Json::Value my_invalid;
- if (!invalid) invalid = &my_invalid; // so we do not need to test for NULL
- Json::Value& inv = *invalid;
- std::set<JSONCPP_STRING> valid_keys;
- getValidWriterKeys(&valid_keys);
- Value::Members keys = settings_.getMemberNames();
- size_t n = keys.size();
- for (size_t i = 0; i < n; ++i) {
- JSONCPP_STRING const& key = keys[i];
- if (valid_keys.find(key) == valid_keys.end()) {
- inv[key] = settings_[key];
- }
- }
- return 0u == inv.size();
-}
-Value& StreamWriterBuilder::operator[](JSONCPP_STRING key)
-{
- return settings_[key];
-}
-// static
-void StreamWriterBuilder::setDefaults(Json::Value* settings)
-{
- //! [StreamWriterBuilderDefaults]
- (*settings)["commentStyle"] = "All";
- (*settings)["indentation"] = "\t";
- (*settings)["enableYAMLCompatibility"] = false;
- (*settings)["dropNullPlaceholders"] = false;
- (*settings)["useSpecialFloats"] = false;
- (*settings)["precision"] = 17;
- //! [StreamWriterBuilderDefaults]
-}
-
-JSONCPP_STRING writeString(StreamWriter::Factory const& builder, Value const& root) {
- JSONCPP_OSTRINGSTREAM sout;
- StreamWriterPtr const writer(builder.newStreamWriter());
- writer->write(root, &sout);
- return sout.str();
-}
-
-JSONCPP_OSTREAM& operator<<(JSONCPP_OSTREAM& sout, Value const& root) {
- StreamWriterBuilder builder;
- StreamWriterPtr const writer(builder.newStreamWriter());
- writer->write(root, &sout);
- return sout;
-}
-
-} // namespace Json
diff --git a/toolkit/crashreporter/jsoncpp/src/lib_json/moz.build b/toolkit/crashreporter/jsoncpp/src/lib_json/moz.build
deleted file mode 100644
index c5c2a29801..0000000000
--- a/toolkit/crashreporter/jsoncpp/src/lib_json/moz.build
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-UNIFIED_SOURCES += [
- 'json_reader.cpp',
- 'json_value.cpp',
- 'json_writer.cpp'
-]
-
-LOCAL_INCLUDES += [
- '/toolkit/crashreporter/jsoncpp/include',
-]
-
-# This code is only used in the stand-alone minidump analyzer executable so
-# enabling exceptions should be fine.
-if CONFIG['CLANG_CL']:
- CXXFLAGS += [
- '-Xclang',
- '-fcxx-exceptions',
- ]
-elif not CONFIG['_MSC_VER']:
- CXXFLAGS += [
- '-fexceptions',
- ]
-
-# Required to build with exceptions enabled
-DISABLE_STL_WRAPPING = True
-
-Library('jsoncpp')
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
-
-if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL'] or CONFIG['GNU_CXX']:
- CXXFLAGS += [
- '-Wno-implicit-fallthrough',
- ]
diff --git a/toolkit/crashreporter/mac_utils.h b/toolkit/crashreporter/mac_utils.h
deleted file mode 100644
index 839baad558..0000000000
--- a/toolkit/crashreporter/mac_utils.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef toolkit_breakpad_mac_utils_h__
-#define toolkit_breakpad_mac_utils_h__
-
-#include "nsString.h"
-
-// Given an Objective-C NSException object, put exception info into a string.
-void GetObjCExceptionInfo(void* inException, nsACString& outString);
-
-#endif /* toolkit_breakpad_mac_utils_h__ */
diff --git a/toolkit/crashreporter/mac_utils.mm b/toolkit/crashreporter/mac_utils.mm
deleted file mode 100644
index bf70ad1d67..0000000000
--- a/toolkit/crashreporter/mac_utils.mm
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <Foundation/Foundation.h>
-
-#include "mac_utils.h"
-#include "nsXPCOM.h"
-
-void GetObjCExceptionInfo(void* inException, nsACString& outString)
-{
- NSException* e = (NSException*)inException;
-
- NSString* name = [e name];
- NSString* reason = [e reason];
- unsigned int nameLength = [name length];
- unsigned int reasonLength = [reason length];
-
- unichar* nameBuffer = (unichar*)moz_xmalloc(sizeof(unichar) * (nameLength + 1));
- if (!nameBuffer)
- return;
- unichar* reasonBuffer = (unichar*)moz_xmalloc(sizeof(unichar) * (reasonLength + 1));
- if (!reasonBuffer) {
- free(nameBuffer);
- return;
- }
-
- [name getCharacters:nameBuffer];
- [reason getCharacters:reasonBuffer];
- nameBuffer[nameLength] = '\0';
- reasonBuffer[reasonLength] = '\0';
-
- outString.AssignLiteral("\nObj-C Exception data:\n");
- AppendUTF16toUTF8(reinterpret_cast<const char16_t*>(nameBuffer), outString);
- outString.AppendLiteral(": ");
- AppendUTF16toUTF8(reinterpret_cast<const char16_t*>(reasonBuffer), outString);
-
- free(nameBuffer);
- free(reasonBuffer);
-}
diff --git a/toolkit/crashreporter/minidump-analyzer/minidump-analyzer.cpp b/toolkit/crashreporter/minidump-analyzer/minidump-analyzer.cpp
deleted file mode 100644
index b523826c90..0000000000
--- a/toolkit/crashreporter/minidump-analyzer/minidump-analyzer.cpp
+++ /dev/null
@@ -1,437 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <cstdio>
-#include <fstream>
-#include <string>
-#include <sstream>
-
-#include "json/json.h"
-#include "google_breakpad/processor/basic_source_line_resolver.h"
-#include "google_breakpad/processor/call_stack.h"
-#include "google_breakpad/processor/code_module.h"
-#include "google_breakpad/processor/code_modules.h"
-#include "google_breakpad/processor/minidump.h"
-#include "google_breakpad/processor/minidump_processor.h"
-#include "google_breakpad/processor/process_state.h"
-#include "google_breakpad/processor/stack_frame.h"
-#include "processor/pathname_stripper.h"
-
-#if defined(XP_WIN32)
-
-#include <windows.h>
-
-#elif defined(XP_UNIX) || defined(XP_MACOSX)
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#endif
-
-namespace CrashReporter {
-
-using std::ios;
-using std::ios_base;
-using std::hex;
-using std::ofstream;
-using std::map;
-using std::showbase;
-using std::string;
-using std::stringstream;
-using std::wstring;
-
-using google_breakpad::BasicSourceLineResolver;
-using google_breakpad::CallStack;
-using google_breakpad::CodeModule;
-using google_breakpad::CodeModules;
-using google_breakpad::Minidump;
-using google_breakpad::MinidumpProcessor;
-using google_breakpad::PathnameStripper;
-using google_breakpad::ProcessResult;
-using google_breakpad::ProcessState;
-using google_breakpad::StackFrame;
-
-#ifdef XP_WIN
-
-static wstring UTF8ToWide(const string& aUtf8Str, bool *aSuccess = nullptr)
-{
- wchar_t* buffer = nullptr;
- int buffer_size = MultiByteToWideChar(CP_UTF8, 0, aUtf8Str.c_str(),
- -1, nullptr, 0);
- if (buffer_size == 0) {
- if (aSuccess) {
- *aSuccess = false;
- }
-
- return L"";
- }
-
- buffer = new wchar_t[buffer_size];
-
- if (buffer == nullptr) {
- if (aSuccess) {
- *aSuccess = false;
- }
-
- return L"";
- }
-
- MultiByteToWideChar(CP_UTF8, 0, aUtf8Str.c_str(),
- -1, buffer, buffer_size);
- wstring str = buffer;
- delete [] buffer;
-
- if (aSuccess) {
- *aSuccess = true;
- }
-
- return str;
-}
-
-#endif
-
-struct ModuleCompare {
- bool operator() (const CodeModule* aLhs, const CodeModule* aRhs) const {
- return aLhs->base_address() < aRhs->base_address();
- }
-};
-
-typedef map<const CodeModule*, unsigned int, ModuleCompare> OrderedModulesMap;
-
-static const char kExtraDataExtension[] = ".extra";
-
-static string
-ToHex(uint64_t aValue) {
- stringstream output;
-
- output << hex << showbase << aValue;
-
- return output.str();
-}
-
-// Convert the stack frame trust value into a readable string.
-
-static string
-FrameTrust(const StackFrame::FrameTrust aTrust) {
- switch (aTrust) {
- case StackFrame::FRAME_TRUST_NONE:
- return "none";
- case StackFrame::FRAME_TRUST_SCAN:
- return "scan";
- case StackFrame::FRAME_TRUST_CFI_SCAN:
- return "cfi_scan";
- case StackFrame::FRAME_TRUST_FP:
- return "frame_pointer";
- case StackFrame::FRAME_TRUST_CFI:
- return "cfi";
- case StackFrame::FRAME_TRUST_PREWALKED:
- return "prewalked";
- case StackFrame::FRAME_TRUST_CONTEXT:
- return "context";
- }
-
- return "none";
-}
-
-// Convert the result value of the minidump processing step into a readable
-// string.
-
-static string
-ResultString(ProcessResult aResult) {
- switch (aResult) {
- case google_breakpad::PROCESS_OK:
- return "OK";
- case google_breakpad::PROCESS_ERROR_MINIDUMP_NOT_FOUND:
- return "ERROR_MINIDUMP_NOT_FOUND";
- case google_breakpad::PROCESS_ERROR_NO_MINIDUMP_HEADER:
- return "ERROR_NO_MINIDUMP_HEADER";
- case google_breakpad::PROCESS_ERROR_NO_THREAD_LIST:
- return "ERROR_NO_THREAD_LIST";
- case google_breakpad::PROCESS_ERROR_GETTING_THREAD:
- return "ERROR_GETTING_THREAD";
- case google_breakpad::PROCESS_ERROR_GETTING_THREAD_ID:
- return "ERROR_GETTING_THREAD_ID";
- case google_breakpad::PROCESS_ERROR_DUPLICATE_REQUESTING_THREADS:
- return "ERROR_DUPLICATE_REQUESTING_THREADS";
- case google_breakpad::PROCESS_SYMBOL_SUPPLIER_INTERRUPTED:
- return "SYMBOL_SUPPLIER_INTERRUPTED";
- default:
- return "";
- }
-}
-
-// Convert the list of stack frames to JSON and append them to the array
-// specified in the |aNode| parameter.
-
-static void
-ConvertStackToJSON(const ProcessState& aProcessState,
- const OrderedModulesMap& aOrderedModules,
- const CallStack *aStack,
- Json::Value& aNode)
-{
- int frameCount = aStack->frames()->size();
- unsigned int moduleIndex = 0;
-
- for (int frameIndex = 0; frameIndex < frameCount; ++frameIndex) {
- const StackFrame *frame = aStack->frames()->at(frameIndex);
- Json::Value frameNode;
-
- if (frame->module) {
- auto itr = aOrderedModules.find(frame->module);
-
- if (itr != aOrderedModules.end()) {
- moduleIndex = (*itr).second;
- frameNode["module_index"] = moduleIndex;
- }
- }
-
- frameNode["trust"] = FrameTrust(frame->trust);
- // The 'ip' field is equivalent to socorro's 'offset' field
- frameNode["ip"] = ToHex(frame->instruction);
-
- aNode.append(frameNode);
- }
-}
-
-// Convert the list of modules to JSON and append them to the array specified
-// in the |aNode| parameter.
-
-static int
-ConvertModulesToJSON(const ProcessState& aProcessState,
- OrderedModulesMap& aOrderedModules,
- Json::Value& aNode)
-{
- const CodeModules* modules = aProcessState.modules();
-
- if (!modules) {
- return -1;
- }
-
- // Create a sorted set of modules so that we'll be able to lookup the index
- // of a particular module.
- for (unsigned int i = 0; i < modules->module_count(); ++i) {
- aOrderedModules.insert(
- std::pair<const CodeModule*, unsigned int>(
- modules->GetModuleAtSequence(i), i
- )
- );
- }
-
- uint64_t mainAddress = 0;
- const CodeModule *mainModule = modules->GetMainModule();
-
- if (mainModule) {
- mainAddress = mainModule->base_address();
- }
-
- unsigned int moduleCount = modules->module_count();
- int mainModuleIndex = -1;
-
- for (unsigned int moduleSequence = 0;
- moduleSequence < moduleCount;
- ++moduleSequence)
- {
- const CodeModule *module = modules->GetModuleAtSequence(moduleSequence);
-
- if (module->base_address() == mainAddress) {
- mainModuleIndex = moduleSequence;
- }
-
- Json::Value moduleNode;
- moduleNode["filename"] = PathnameStripper::File(module->code_file());
- moduleNode["code_id"] = PathnameStripper::File(module->code_identifier());
- moduleNode["version"] = module->version();
- moduleNode["debug_file"] = PathnameStripper::File(module->debug_file());
- moduleNode["debug_id"] = module->debug_identifier();
- moduleNode["base_addr"] = ToHex(module->base_address());
- moduleNode["end_addr"] = ToHex(module->base_address() + module->size());
-
- aNode.append(moduleNode);
- }
-
- return mainModuleIndex;
-}
-
-// Convert the process state to JSON, this includes information about the
-// crash, the module list and stack traces for every thread
-
-static void
-ConvertProcessStateToJSON(const ProcessState& aProcessState, Json::Value& aRoot)
-{
- // We use this map to get the index of a module when listed by address
- OrderedModulesMap orderedModules;
-
- // Crash info
- Json::Value crashInfo;
- int requestingThread = aProcessState.requesting_thread();
-
- if (aProcessState.crashed()) {
- crashInfo["type"] = aProcessState.crash_reason();
- crashInfo["address"] = ToHex(aProcessState.crash_address());
-
- if (requestingThread != -1) {
- crashInfo["crashing_thread"] = requestingThread;
- }
- } else {
- crashInfo["type"] = Json::Value(Json::nullValue);
- // Add assertion info, if available
- string assertion = aProcessState.assertion();
-
- if (!assertion.empty()) {
- crashInfo["assertion"] = assertion;
- }
- }
-
- aRoot["crash_info"] = crashInfo;
-
- // Modules
- Json::Value modules(Json::arrayValue);
- int mainModule = ConvertModulesToJSON(aProcessState, orderedModules, modules);
-
- if (mainModule != -1) {
- aRoot["main_module"] = mainModule;
- }
-
- aRoot["modules"] = modules;
-
- // Threads
- Json::Value threads(Json::arrayValue);
- int threadCount = aProcessState.threads()->size();
-
- for (int threadIndex = 0; threadIndex < threadCount; ++threadIndex) {
- Json::Value thread;
- Json::Value stack(Json::arrayValue);
- const CallStack* rawStack = aProcessState.threads()->at(threadIndex);
-
- ConvertStackToJSON(aProcessState, orderedModules, rawStack, stack);
- thread["frames"] = stack;
- threads.append(thread);
- }
-
- aRoot["threads"] = threads;
-}
-
-// Process the minidump file and append the JSON-formatted stack traces to
-// the node specified in |aRoot|
-
-static bool
-ProcessMinidump(Json::Value& aRoot, const string& aDumpFile) {
- BasicSourceLineResolver resolver;
- // We don't have a valid symbol resolver so we pass nullptr instead.
- MinidumpProcessor minidumpProcessor(nullptr, &resolver);
-
- // Process the minidump.
- Minidump dump(aDumpFile);
- if (!dump.Read()) {
- return false;
- }
-
- ProcessResult rv;
- ProcessState processState;
- rv = minidumpProcessor.Process(&dump, &processState);
- aRoot["status"] = ResultString(rv);
-
- ConvertProcessStateToJSON(processState, aRoot);
-
- return true;
-}
-
-// Open the specified file in append mode
-
-static ofstream*
-OpenAppend(const string& aFilename)
-{
- ios_base::openmode mode = ios::out | ios::app;
-
-#if defined(XP_WIN)
-#if defined(_MSC_VER)
- ofstream* file = new ofstream();
- file->open(UTF8ToWide(aFilename).c_str(), mode);
-#else // GCC
- ofstream* file =
- new ofstream(WideToMBCP(UTF8ToWide(aFilename), CP_ACP).c_str(), mode);
-#endif // _MSC_VER
-#else // Non-Windows
- ofstream* file = new ofstream(aFilename.c_str(), mode);
-#endif // XP_WIN
- return file;
-}
-
-// Check if a file exists at the specified path
-
-static bool
-FileExists(const string& aPath)
-{
-#if defined(XP_WIN)
- DWORD attrs = GetFileAttributes(UTF8ToWide(aPath).c_str());
- return (attrs != INVALID_FILE_ATTRIBUTES);
-#else // Non-Windows
- struct stat sb;
- int ret = stat(aPath.c_str(), &sb);
- if (ret == -1 || !(sb.st_mode & S_IFREG)) {
- return false;
- }
-
- return true;
-#endif // XP_WIN
-}
-
-// Update the extra data file by adding the StackTraces field holding the
-// JSON output of this program.
-
-static void
-UpdateExtraDataFile(const string &aDumpPath, const Json::Value& aRoot)
-{
- string extraDataPath(aDumpPath);
- int dot = extraDataPath.rfind('.');
-
- if (dot < 0) {
- return; // Not a valid dump path
- }
-
- extraDataPath.replace(dot, extraDataPath.length() - dot, kExtraDataExtension);
- ofstream* f = OpenAppend(extraDataPath.c_str());
-
- if (f->is_open()) {
- Json::FastWriter writer;
-
- *f << "StackTraces=" << writer.write(aRoot);
-
- f->close();
- }
-
- delete f;
-}
-
-} // namespace CrashReporter
-
-using namespace CrashReporter;
-
-int main(int argc, char** argv)
-{
- string dumpPath;
-
- if (argc > 1) {
- dumpPath = argv[1];
- }
-
- if (dumpPath.empty()) {
- exit(EXIT_FAILURE);
- }
-
- if (!FileExists(dumpPath)) {
- // The dump file does not exist
- return 1;
- }
-
- // Try processing the minidump
- Json::Value root;
- if (ProcessMinidump(root, dumpPath)) {
- UpdateExtraDataFile(dumpPath, root);
- }
-
- exit(EXIT_SUCCESS);
-}
diff --git a/toolkit/crashreporter/minidump-analyzer/moz.build b/toolkit/crashreporter/minidump-analyzer/moz.build
deleted file mode 100644
index bd4aa762fb..0000000000
--- a/toolkit/crashreporter/minidump-analyzer/moz.build
+++ /dev/null
@@ -1,34 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if CONFIG['OS_TARGET'] != 'Android':
- Program('minidump-analyzer')
-
- DEFINES['UNICODE'] = True
- DEFINES['_UNICODE'] = True
-
- UNIFIED_SOURCES += [
- 'minidump-analyzer.cpp',
- ]
-
- USE_LIBS += [
- 'breakpad_processor',
- 'jsoncpp',
- ]
-
- LOCAL_INCLUDES += [
- '/toolkit/crashreporter/jsoncpp/include',
- ]
-
-
- if CONFIG['OS_TARGET'] == 'Darwin':
- DIST_SUBDIR = 'crashreporter.app/Contents/MacOS'
-
-# Don't use the STL wrappers in the crashreporter clients; they don't
-# link with -lmozalloc, and it really doesn't matter here anyway.
-DISABLE_STL_WRAPPING = True
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
diff --git a/toolkit/crashreporter/moz.build b/toolkit/crashreporter/moz.build
deleted file mode 100644
index 037ec43a54..0000000000
--- a/toolkit/crashreporter/moz.build
+++ /dev/null
@@ -1,122 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SPHINX_TREES['crashreporter'] = 'docs'
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- DIRS += [
- 'google-breakpad/src/common',
- 'google-breakpad/src/processor',
- 'breakpad-windows-libxul',
- ]
-
- if CONFIG['MSVC_HAS_DIA_SDK']:
- DIRS += ['google-breakpad/src/tools/windows/dump_syms']
-
- if CONFIG['MOZ_CRASHREPORTER_INJECTOR']:
- DIRS += ['breakpad-windows-standalone']
-
-elif CONFIG['OS_ARCH'] == 'Darwin':
- DIRS += [
- 'google-breakpad/src/common',
- 'google-breakpad/src/common/mac',
- 'google-breakpad/src/client',
- 'google-breakpad/src/client/mac/crash_generation',
- 'google-breakpad/src/client/mac/handler',
- 'google-breakpad/src/processor',
- 'google-breakpad/src/tools/mac/dump_syms',
- ]
-
-elif CONFIG['OS_ARCH'] == 'Linux':
- DIRS += [
- 'google-breakpad/src/common',
- 'google-breakpad/src/common/linux',
- 'google-breakpad/src/client',
- 'google-breakpad/src/client/linux/',
- 'google-breakpad/src/processor',
- 'google-breakpad/src/tools/linux/dump_syms',
- ]
-
-elif CONFIG['OS_ARCH'] == 'SunOS':
- DIRS += [
- 'google-breakpad/src/common',
- 'google-breakpad/src/common/solaris',
- 'google-breakpad/src/client',
- 'google-breakpad/src/client/solaris/handler',
- 'google-breakpad/src/tools/solaris/dump_syms',
- ]
-
-DIRS += [
- 'client',
- 'jsoncpp/src/lib_json',
- 'minidump-analyzer',
-]
-
-if CONFIG['MOZ_CRASHREPORTER_INJECTOR']:
- DIRS += ['injector']
- UNIFIED_SOURCES += [
- 'InjectCrashReporter.cpp',
- 'LoadLibraryRemote.cpp',
- ]
-
-TEST_DIRS += ['test']
-
-EXPORTS += [
- 'nsExceptionHandler.h',
-]
-
-UNIFIED_SOURCES += [
- 'nsExceptionHandler.cpp',
-]
-
-if CONFIG['OS_ARCH'] == 'Darwin':
- UNIFIED_SOURCES += [
- 'mac_utils.mm',
- ]
-
-EXTRA_JS_MODULES += [
- 'CrashReports.jsm',
- 'CrashSubmit.jsm',
- 'KeyValueParser.jsm',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
-
-if CONFIG['OS_TARGET'] == 'Android':
- DEFINES['ANDROID_PACKAGE_NAME'] = '"%s"' % CONFIG['ANDROID_PACKAGE_NAME']
- # NDK5 workarounds
- DEFINES['_STLP_CONST_CONSTRUCTOR_BUG'] = True
- DEFINES['_STLP_NO_MEMBER_TEMPLATES'] = True
- LOCAL_INCLUDES += [
- '/toolkit/crashreporter/google-breakpad/src/common/android/include',
- ]
-
-if CONFIG['OS_ARCH'] == 'SunOS':
- # there's no define for this normally
- DEFINES['XP_SOLARIS'] = True
-
-DEFINES['UNICODE'] = True
-DEFINES['_UNICODE'] = True
-
-JAR_MANIFESTS += ['jar.mn']
-
-LOCAL_INCLUDES += [
- 'google-breakpad/src',
-]
-
-PYTHON_UNIT_TESTS += [
- 'tools/unit-symbolstore.py',
-]
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Breakpad Integration')
-
-if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-shadow']
diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp
deleted file mode 100644
index 4d0b8cdfe4..0000000000
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ /dev/null
@@ -1,4101 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsExceptionHandler.h"
-
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsDirectoryServiceDefs.h"
-#include "nsDataHashtable.h"
-#include "mozilla/ArrayUtils.h"
-#include "mozilla/Services.h"
-#include "nsIObserverService.h"
-#include "mozilla/Unused.h"
-#include "mozilla/Sprintf.h"
-#include "mozilla/SyncRunnable.h"
-#include "mozilla/TimeStamp.h"
-
-#include "nsThreadUtils.h"
-#include "nsXULAppAPI.h"
-#include "jsfriendapi.h"
-
-#if defined(XP_WIN32)
-#ifdef WIN32_LEAN_AND_MEAN
-#undef WIN32_LEAN_AND_MEAN
-#endif
-
-#include "nsXULAppAPI.h"
-#include "nsIXULAppInfo.h"
-#include "nsIWindowsRegKey.h"
-#include "client/windows/crash_generation/client_info.h"
-#include "client/windows/crash_generation/crash_generation_server.h"
-#include "client/windows/handler/exception_handler.h"
-#include <dbghelp.h>
-#include <string.h>
-#include "nsDirectoryServiceUtils.h"
-
-#include "nsWindowsDllInterceptor.h"
-#elif defined(XP_MACOSX)
-#include "client/mac/crash_generation/client_info.h"
-#include "client/mac/crash_generation/crash_generation_server.h"
-#include "client/mac/handler/exception_handler.h"
-#include <string>
-#include <Carbon/Carbon.h>
-#include <CoreFoundation/CoreFoundation.h>
-#include <crt_externs.h>
-#include <fcntl.h>
-#include <mach/mach.h>
-#include <sys/types.h>
-#include <spawn.h>
-#include <unistd.h>
-#include "mac_utils.h"
-#elif defined(XP_LINUX)
-#include "nsIINIParser.h"
-#include "common/linux/linux_libc_support.h"
-#include "third_party/lss/linux_syscall_support.h"
-#include "client/linux/crash_generation/client_info.h"
-#include "client/linux/crash_generation/crash_generation_server.h"
-#include "client/linux/handler/exception_handler.h"
-#include "common/linux/eintr_wrapper.h"
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#elif defined(XP_SOLARIS)
-#include "client/solaris/handler/exception_handler.h"
-#include <fcntl.h>
-#include <sys/types.h>
-#include <unistd.h>
-#else
-#error "Not yet implemented for this platform"
-#endif // defined(XP_WIN32)
-
-#ifdef MOZ_CRASHREPORTER_INJECTOR
-#include "InjectCrashReporter.h"
-using mozilla::InjectCrashRunnable;
-#endif
-
-#include <stdlib.h>
-#include <time.h>
-#include <prenv.h>
-#include <prio.h>
-#include <prmem.h>
-#include "mozilla/Mutex.h"
-#include "nsDebug.h"
-#include "nsCRT.h"
-#include "nsIFile.h"
-#include "prprf.h"
-#include <map>
-#include <vector>
-
-#include "mozilla/double-conversion.h"
-#include "mozilla/IOInterposer.h"
-#include "mozilla/mozalloc_oom.h"
-#include "mozilla/WindowsDllBlocklist.h"
-
-#if defined(XP_MACOSX)
-CFStringRef reporterClientAppID = CFSTR("org.mozilla.crashreporter");
-#endif
-#if defined(MOZ_WIDGET_ANDROID)
-#include "common/linux/file_id.h"
-#endif
-
-using google_breakpad::CrashGenerationServer;
-using google_breakpad::ClientInfo;
-#ifdef XP_LINUX
-using google_breakpad::MinidumpDescriptor;
-#endif
-#if defined(MOZ_WIDGET_ANDROID)
-using google_breakpad::auto_wasteful_vector;
-using google_breakpad::FileID;
-using google_breakpad::PageAllocator;
-#endif
-using namespace mozilla;
-
-namespace CrashReporter {
-
-#ifdef XP_WIN32
-typedef wchar_t XP_CHAR;
-typedef std::wstring xpstring;
-#define XP_TEXT(x) L##x
-#define CONVERT_XP_CHAR_TO_UTF16(x) x
-#define XP_STRLEN(x) wcslen(x)
-#define my_strlen strlen
-#define CRASH_REPORTER_FILENAME "crashreporter.exe"
-#define PATH_SEPARATOR "\\"
-#define XP_PATH_SEPARATOR L"\\"
-#define XP_PATH_SEPARATOR_CHAR L'\\'
-#define XP_PATH_MAX (MAX_PATH + 1)
-// "<reporter path>" "<minidump path>"
-#define CMDLINE_SIZE ((XP_PATH_MAX * 2) + 6)
-#ifdef _USE_32BIT_TIME_T
-#define XP_TTOA(time, buffer, base) ltoa(time, buffer, base)
-#else
-#define XP_TTOA(time, buffer, base) _i64toa(time, buffer, base)
-#endif
-#define XP_STOA(size, buffer, base) _ui64toa(size, buffer, base)
-#else
-typedef char XP_CHAR;
-typedef std::string xpstring;
-#define XP_TEXT(x) x
-#define CONVERT_XP_CHAR_TO_UTF16(x) NS_ConvertUTF8toUTF16(x)
-#define CRASH_REPORTER_FILENAME "crashreporter"
-#define PATH_SEPARATOR "/"
-#define XP_PATH_SEPARATOR "/"
-#define XP_PATH_SEPARATOR_CHAR '/'
-#define XP_PATH_MAX PATH_MAX
-#ifdef XP_LINUX
-#define XP_STRLEN(x) my_strlen(x)
-#define XP_TTOA(time, buffer, base) my_inttostring(time, buffer, sizeof(buffer))
-#define XP_STOA(size, buffer, base) my_inttostring(size, buffer, sizeof(buffer))
-#else
-#define XP_STRLEN(x) strlen(x)
-#define XP_TTOA(time, buffer, base) sprintf(buffer, "%ld", time)
-#define XP_STOA(size, buffer, base) sprintf(buffer, "%zu", (size_t) size)
-#define my_strlen strlen
-#define sys_close close
-#define sys_fork fork
-#define sys_open open
-#define sys_read read
-#define sys_write write
-#endif
-#endif // XP_WIN32
-
-#if defined(__GNUC__)
-#define MAYBE_UNUSED __attribute__((unused))
-#else
-#define MAYBE_UNUSED
-#endif // defined(__GNUC__)
-
-#ifndef XP_LINUX
-static const XP_CHAR dumpFileExtension[] = XP_TEXT(".dmp");
-#endif
-
-static const XP_CHAR childCrashAnnotationBaseName[] = XP_TEXT("GeckoChildCrash");
-static const XP_CHAR extraFileExtension[] = XP_TEXT(".extra");
-static const XP_CHAR memoryReportExtension[] = XP_TEXT(".memory.json.gz");
-static xpstring *defaultMemoryReportPath = nullptr;
-
-// A whitelist of crash annotations which do not contain sensitive data
-// and are saved in the crash record and sent with Firefox Health Report.
-static char const * const kCrashEventAnnotations[] = {
- "AsyncShutdownTimeout",
- "BuildID",
- "ProductID",
- "ProductName",
- "ReleaseChannel",
- "SecondsSinceLastCrash",
- "ShutdownProgress",
- "StartupCrash",
- "TelemetryEnvironment",
- "Version",
- // The following entries are not normal annotations but are included
- // in the crash record/FHR:
- // "ContainsMemoryReport"
- // "EventLoopNestingLevel"
- // "IsGarbageCollecting"
- // "AvailablePageFile"
- // "AvailableVirtualMemory"
- // "SystemMemoryUsePercentage"
- // "OOMAllocationSize"
- // "TotalPageFile"
- // "TotalPhysicalMemory"
- // "TotalVirtualMemory"
- // "MozCrashReason"
-};
-
-static const char kCrashMainID[] = "crash.main.2\n";
-
-static google_breakpad::ExceptionHandler* gExceptionHandler = nullptr;
-
-static XP_CHAR* pendingDirectory;
-static XP_CHAR* crashReporterPath;
-static XP_CHAR* memoryReportPath;
-
-// Where crash events should go.
-static XP_CHAR* eventsDirectory;
-static char* eventsEnv = nullptr;
-
-// The current telemetry session ID to write to the event file
-static char* currentSessionId = nullptr;
-
-// If this is false, we don't launch the crash reporter
-static bool doReport = true;
-
-// If this is true, we don't have a crash reporter
-static bool headlessClient = false;
-
-// if this is true, we pass the exception on to the OS crash reporter
-static bool showOSCrashReporter = false;
-
-// The time of the last recorded crash, as a time_t value.
-static time_t lastCrashTime = 0;
-// The pathname of a file to store the crash time in
-static XP_CHAR lastCrashTimeFilename[XP_PATH_MAX] = {0};
-
-// A marker file to hold the path to the last dump written, which
-// will be checked on startup.
-static XP_CHAR crashMarkerFilename[XP_PATH_MAX] = {0};
-
-// Whether we've already looked for the marker file.
-static bool lastRunCrashID_checked = false;
-// The minidump ID contained in the marker file.
-static nsString* lastRunCrashID = nullptr;
-
-#if defined(MOZ_WIDGET_ANDROID)
-// on Android 4.2 and above there is a user serial number associated
-// with the current process that gets lost when we fork so we need to
-// explicitly pass it to am
-static char* androidUserSerial = nullptr;
-#endif
-
-// these are just here for readability
-static const char kTimeSinceLastCrashParameter[] = "SecondsSinceLastCrash=";
-static const int kTimeSinceLastCrashParameterLen =
- sizeof(kTimeSinceLastCrashParameter)-1;
-
-// this holds additional data sent via the API
-static Mutex* crashReporterAPILock;
-static Mutex* notesFieldLock;
-static AnnotationTable* crashReporterAPIData_Hash;
-static nsCString* crashReporterAPIData = nullptr;
-static nsCString* crashEventAPIData = nullptr;
-static nsCString* notesField = nullptr;
-static bool isGarbageCollecting;
-static uint32_t eventloopNestingLevel = 0;
-
-// Avoid a race during application termination.
-static Mutex* dumpSafetyLock;
-static bool isSafeToDump = false;
-
-// OOP crash reporting
-static CrashGenerationServer* crashServer; // chrome process has this
-
-static std::terminate_handler oldTerminateHandler = nullptr;
-
-#if (defined(XP_MACOSX) || defined(XP_WIN))
-// This field is valid in both chrome and content processes.
-static xpstring* childProcessTmpDir = nullptr;
-#endif
-
-# if defined(XP_WIN) || defined(XP_MACOSX)
-// If crash reporting is disabled, we hand out this "null" pipe to the
-// child process and don't attempt to connect to a parent server.
-static const char kNullNotifyPipe[] = "-";
-static char* childCrashNotifyPipe;
-
-# elif defined(XP_LINUX)
-static int serverSocketFd = -1;
-static int clientSocketFd = -1;
-static const int kMagicChildCrashReportFd = 4;
-
-# endif
-
-// |dumpMapLock| must protect all access to |pidToMinidump|.
-static Mutex* dumpMapLock;
-struct ChildProcessData : public nsUint32HashKey
-{
- explicit ChildProcessData(KeyTypePointer aKey)
- : nsUint32HashKey(aKey)
- , sequence(0)
-#ifdef MOZ_CRASHREPORTER_INJECTOR
- , callback(nullptr)
-#endif
- { }
-
- nsCOMPtr<nsIFile> minidump;
- // Each crashing process is assigned an increasing sequence number to
- // indicate which process crashed first.
- uint32_t sequence;
-#ifdef MOZ_CRASHREPORTER_INJECTOR
- InjectorCrashCallback* callback;
-#endif
-};
-
-typedef nsTHashtable<ChildProcessData> ChildMinidumpMap;
-static ChildMinidumpMap* pidToMinidump;
-static uint32_t crashSequence;
-static bool OOPInitialized();
-
-#ifdef MOZ_CRASHREPORTER_INJECTOR
-static nsIThread* sInjectorThread;
-
-class ReportInjectedCrash : public Runnable
-{
-public:
- explicit ReportInjectedCrash(uint32_t pid) : mPID(pid) { }
-
- NS_IMETHOD Run();
-
-private:
- uint32_t mPID;
-};
-#endif // MOZ_CRASHREPORTER_INJECTOR
-
-// Crashreporter annotations that we don't send along in subprocess reports.
-static const char* kSubprocessBlacklist[] = {
- "FramePoisonBase",
- "FramePoisonSize",
- "StartupCrash",
- "StartupTime",
- "URL"
-};
-
-// If annotations are attempted before the crash reporter is enabled,
-// they queue up here.
-class DelayedNote;
-nsTArray<nsAutoPtr<DelayedNote> >* gDelayedAnnotations;
-
-#if defined(XP_WIN)
-// the following are used to prevent other DLLs reverting the last chance
-// exception handler to the windows default. Any attempt to change the
-// unhandled exception filter or to reset it is ignored and our crash
-// reporter is loaded instead (in case it became unloaded somehow)
-typedef LPTOP_LEVEL_EXCEPTION_FILTER (WINAPI *SetUnhandledExceptionFilter_func)
- (LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
-static SetUnhandledExceptionFilter_func stub_SetUnhandledExceptionFilter = 0;
-static LPTOP_LEVEL_EXCEPTION_FILTER previousUnhandledExceptionFilter = nullptr;
-static WindowsDllInterceptor gKernel32Intercept;
-static bool gBlockUnhandledExceptionFilter = true;
-
-static LPTOP_LEVEL_EXCEPTION_FILTER GetUnhandledExceptionFilter()
-{
- // Set a dummy value to get the current filter, then restore
- LPTOP_LEVEL_EXCEPTION_FILTER current = SetUnhandledExceptionFilter(nullptr);
- SetUnhandledExceptionFilter(current);
- return current;
-}
-
-static LPTOP_LEVEL_EXCEPTION_FILTER WINAPI
-patched_SetUnhandledExceptionFilter (LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
-{
- if (!gBlockUnhandledExceptionFilter) {
- // don't intercept
- return stub_SetUnhandledExceptionFilter(lpTopLevelExceptionFilter);
- }
-
- if (lpTopLevelExceptionFilter == previousUnhandledExceptionFilter) {
- // OK to swap back and forth between the previous filter
- previousUnhandledExceptionFilter =
- stub_SetUnhandledExceptionFilter(lpTopLevelExceptionFilter);
- return previousUnhandledExceptionFilter;
- }
-
- // intercept attempts to change the filter
- return nullptr;
-}
-
-static LPTOP_LEVEL_EXCEPTION_FILTER sUnhandledExceptionFilter = nullptr;
-
-static long
-JitExceptionHandler(void *exceptionRecord, void *context)
-{
- EXCEPTION_POINTERS pointers = {
- (PEXCEPTION_RECORD)exceptionRecord,
- (PCONTEXT)context
- };
- return sUnhandledExceptionFilter(&pointers);
-}
-
-/**
- * Reserve some VM space. In the event that we crash because VM space is
- * being leaked without leaking memory, freeing this space before taking
- * the minidump will allow us to collect a minidump.
- *
- * This size is bigger than xul.dll plus some extra for MinidumpWriteDump
- * allocations.
- */
-static const SIZE_T kReserveSize = 0x4000000; // 64 MB
-static void* gBreakpadReservedVM;
-#endif
-
-#ifdef XP_MACOSX
-static cpu_type_t pref_cpu_types[2] = {
-#if defined(__i386__)
- CPU_TYPE_X86,
-#elif defined(__x86_64__)
- CPU_TYPE_X86_64,
-#elif defined(__ppc__)
- CPU_TYPE_POWERPC,
-#endif
- CPU_TYPE_ANY };
-
-static posix_spawnattr_t spawnattr;
-#endif
-
-#if defined(MOZ_WIDGET_ANDROID)
-// Android builds use a custom library loader,
-// so the embedding will provide a list of shared
-// libraries that are mapped into anonymous mappings.
-typedef struct {
- std::string name;
- uintptr_t start_address;
- size_t length;
- size_t file_offset;
-} mapping_info;
-static std::vector<mapping_info> library_mappings;
-typedef std::map<uint32_t,google_breakpad::MappingList> MappingMap;
-#endif
-}
-
-// Format a non-negative double to a string, without using C-library functions,
-// which need to be avoided (.e.g. bug 1240160, comment 10). Leave the utility
-// non-file static so that we can gtest it. Return false if we failed to
-// get the formatting done correctly.
-bool SimpleNoCLibDtoA(double aValue, char* aBuffer, int aBufferLength)
-{
- // aBufferLength is the size of the buffer. Be paranoid.
- aBuffer[aBufferLength-1] = '\0';
-
- if (aValue < 0) {
- return false;
- }
-
- int length, point, i;
- bool sign;
- bool ok = true;
- double_conversion::DoubleToStringConverter::DoubleToAscii(
- aValue,
- double_conversion::DoubleToStringConverter::SHORTEST,
- 8,
- aBuffer,
- aBufferLength,
- &sign,
- &length,
- &point);
-
- // length does not account for the 0 terminator.
- if (length > point && (length+1) < (aBufferLength-1)) {
- // We have to insert a decimal point. Not worried about adding a leading zero
- // in the < 1 (point == 0) case.
- aBuffer[length+1] = '\0';
- for (i=length; i>point; i-=1) {
- aBuffer[i] = aBuffer[i-1];
- }
- aBuffer[i] = '.'; // Not worried about locales
- } else if (length < point) {
- // Trailing zeros scenario
- for (i=length; i<point; i+=1) {
- if (i >= aBufferLength-2) {
- ok = false;
- }
- aBuffer[i] = '0';
- }
- aBuffer[i] = '\0';
- }
- return ok;
-}
-
-namespace CrashReporter {
-
-#ifdef XP_LINUX
-inline void
-my_inttostring(intmax_t t, char* buffer, size_t buffer_length)
-{
- my_memset(buffer, 0, buffer_length);
- my_uitos(buffer, t, my_uint_len(t));
-}
-#endif
-
-#ifdef XP_WIN
-static void
-CreateFileFromPath(const xpstring& path, nsIFile** file)
-{
- NS_NewLocalFile(nsDependentString(path.c_str()), false, file);
-}
-
-static void
-CreateFileFromPath(const wchar_t* path, nsIFile** file)
-{
- CreateFileFromPath(std::wstring(path), file);
-}
-
-static xpstring*
-CreatePathFromFile(nsIFile* file)
-{
- nsAutoString path;
- nsresult rv = file->GetPath(path);
- if (NS_FAILED(rv)) {
- return nullptr;
- }
- return new xpstring(static_cast<wchar_t*>(path.get()), path.Length());
-}
-#else
-static void
-CreateFileFromPath(const xpstring& path, nsIFile** file)
-{
- NS_NewNativeLocalFile(nsDependentCString(path.c_str()), false, file);
-}
-
-MAYBE_UNUSED static xpstring*
-CreatePathFromFile(nsIFile* file)
-{
- nsAutoCString path;
- nsresult rv = file->GetNativePath(path);
- if (NS_FAILED(rv)) {
- return nullptr;
- }
- return new xpstring(path.get(), path.Length());
-}
-#endif
-
-static XP_CHAR*
-Concat(XP_CHAR* str, const XP_CHAR* toAppend, int* size)
-{
- int appendLen = XP_STRLEN(toAppend);
- if (appendLen >= *size) appendLen = *size - 1;
-
- memcpy(str, toAppend, appendLen * sizeof(XP_CHAR));
- str += appendLen;
- *str = '\0';
- *size -= appendLen;
-
- return str;
-}
-
-static size_t gOOMAllocationSize = 0;
-
-void AnnotateOOMAllocationSize(size_t size)
-{
- gOOMAllocationSize = size;
-}
-
-static size_t gTexturesSize = 0;
-
-void AnnotateTexturesSize(size_t size)
-{
- gTexturesSize = size;
-}
-
-static size_t gNumOfPendingIPC = 0;
-static uint32_t gTopPendingIPCCount = 0;
-static const char* gTopPendingIPCName = nullptr;
-static uint32_t gTopPendingIPCType = 0;
-
-void AnnotatePendingIPC(size_t aNumOfPendingIPC,
- uint32_t aTopPendingIPCCount,
- const char* aTopPendingIPCName,
- uint32_t aTopPendingIPCType)
-{
- gNumOfPendingIPC = aNumOfPendingIPC;
- gTopPendingIPCCount = aTopPendingIPCCount;
- gTopPendingIPCName = aTopPendingIPCName;
- gTopPendingIPCType = aTopPendingIPCType;
-}
-
-#ifndef XP_WIN
-// Like Windows CopyFile for *nix
-bool copy_file(const char* from, const char* to)
-{
- const int kBufSize = 4096;
- int fdfrom = sys_open(from, O_RDONLY, 0);
- if (fdfrom < 0) {
- return false;
- }
-
- bool ok = false;
-
- int fdto = sys_open(to, O_WRONLY | O_CREAT, 0666);
- if (fdto < 0) {
- sys_close(fdfrom);
- return false;
- }
-
- char buf[kBufSize];
- while (true) {
- int r = sys_read(fdfrom, buf, kBufSize);
- if (r == 0) {
- ok = true;
- break;
- }
- if (r < 0) {
- break;
- }
- char* wbuf = buf;
- while (r) {
- int w = sys_write(fdto, wbuf, r);
- if (w > 0) {
- r -= w;
- wbuf += w;
- } else if (errno != EINTR) {
- break;
- }
- }
- if (r) {
- break;
- }
- }
-
- sys_close(fdfrom);
- sys_close(fdto);
-
- return ok;
-}
-#endif
-
-#ifdef XP_WIN
-
-class PlatformWriter
-{
-public:
- PlatformWriter()
- : mHandle(INVALID_HANDLE_VALUE)
- { }
-
- explicit PlatformWriter(const wchar_t* path)
- : PlatformWriter()
- {
- Open(path);
- }
-
- ~PlatformWriter() {
- if (Valid()) {
- CloseHandle(mHandle);
- }
- }
-
- void Open(const wchar_t* path) {
- mHandle = CreateFile(path, GENERIC_WRITE, 0,
- nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
- nullptr);
- }
-
- bool Valid() {
- return mHandle != INVALID_HANDLE_VALUE;
- }
-
- void WriteBuffer(const char* buffer, size_t len)
- {
- if (!Valid()) {
- return;
- }
- DWORD nBytes;
- WriteFile(mHandle, buffer, len, &nBytes, nullptr);
- }
-
- HANDLE Handle() {
- return mHandle;
- }
-
-private:
- HANDLE mHandle;
-};
-
-#elif defined(XP_UNIX)
-
-class PlatformWriter
-{
-public:
- PlatformWriter()
- : mFD(-1)
- { }
-
- explicit PlatformWriter(const char* path)
- : PlatformWriter()
- {
- Open(path);
- }
-
- ~PlatformWriter() {
- if (Valid()) {
- sys_close(mFD);
- }
- }
-
- void Open(const char* path) {
- mFD = sys_open(path, O_WRONLY | O_CREAT | O_TRUNC, 0600);
- }
-
- bool Valid() {
- return mFD != -1;
- }
-
- void WriteBuffer(const char* buffer, size_t len) {
- if (!Valid()) {
- return;
- }
- Unused << sys_write(mFD, buffer, len);
- }
-
-private:
- int mFD;
-};
-
-#else
-#error "Need implementation of PlatformWrite for this platform"
-#endif
-
-template<int N>
-void
-WriteLiteral(PlatformWriter& pw, const char (&str)[N])
-{
- pw.WriteBuffer(str, N - 1);
-}
-
-static void
-WriteString(PlatformWriter& pw, const char* str) {
-#ifdef XP_LINUX
- size_t len = my_strlen(str);
-#else
- size_t len = strlen(str);
-#endif
-
- pw.WriteBuffer(str, len);
-}
-
-template<int N>
-static void
-WriteAnnotation(PlatformWriter& pw, const char (&name)[N],
- const char* value) {
- WriteLiteral(pw, name);
- WriteLiteral(pw, "=");
- WriteString(pw, value);
- WriteLiteral(pw, "\n");
-};
-
-/**
- * If minidump_id is null, we assume that dump_path contains the full
- * dump file path.
- */
-static void
-OpenAPIData(PlatformWriter& aWriter,
- const XP_CHAR* dump_path, const XP_CHAR* minidump_id = nullptr
- )
-{
- static XP_CHAR extraDataPath[XP_PATH_MAX];
- int size = XP_PATH_MAX;
- XP_CHAR* p;
- if (minidump_id) {
- p = Concat(extraDataPath, dump_path, &size);
- p = Concat(p, XP_PATH_SEPARATOR, &size);
- p = Concat(p, minidump_id, &size);
- } else {
- p = Concat(extraDataPath, dump_path, &size);
- // Skip back past the .dmp extension, if any.
- if (*(p - 4) == XP_TEXT('.')) {
- p -= 4;
- size += 4;
- }
- }
- Concat(p, extraFileExtension, &size);
- aWriter.Open(extraDataPath);
-}
-
-#ifdef XP_WIN
-void
-WriteGlobalMemoryStatus(PlatformWriter* apiData, PlatformWriter* eventFile)
-{
- char buffer[128];
-
- // Try to get some information about memory.
- MEMORYSTATUSEX statex;
- statex.dwLength = sizeof(statex);
- if (GlobalMemoryStatusEx(&statex)) {
-
-#define WRITE_STATEX_FIELD(field, name, conversionFunc) \
- conversionFunc(statex.field, buffer, 10); \
- if (apiData) { \
- WriteAnnotation(*apiData, name, buffer); \
- } \
- if (eventFile) { \
- WriteAnnotation(*eventFile, name, buffer); \
- }
-
- WRITE_STATEX_FIELD(dwMemoryLoad, "SystemMemoryUsePercentage", ltoa);
- WRITE_STATEX_FIELD(ullTotalVirtual, "TotalVirtualMemory", _ui64toa);
- WRITE_STATEX_FIELD(ullAvailVirtual, "AvailableVirtualMemory", _ui64toa);
- WRITE_STATEX_FIELD(ullTotalPageFile, "TotalPageFile", _ui64toa);
- WRITE_STATEX_FIELD(ullAvailPageFile, "AvailablePageFile", _ui64toa);
- WRITE_STATEX_FIELD(ullTotalPhys, "TotalPhysicalMemory", _ui64toa);
- WRITE_STATEX_FIELD(ullAvailPhys, "AvailablePhysicalMemory", _ui64toa);
-
-#undef WRITE_STATEX_FIELD
- }
-}
-#endif
-
-bool MinidumpCallback(
-#ifdef XP_LINUX
- const MinidumpDescriptor& descriptor,
-#else
- const XP_CHAR* dump_path,
- const XP_CHAR* minidump_id,
-#endif
- void* context,
-#ifdef XP_WIN32
- EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion,
-#endif
- bool succeeded)
-{
- bool returnValue = showOSCrashReporter ? false : succeeded;
-
- static XP_CHAR minidumpPath[XP_PATH_MAX];
- int size = XP_PATH_MAX;
- XP_CHAR* p;
-#ifndef XP_LINUX
- p = Concat(minidumpPath, dump_path, &size);
- p = Concat(p, XP_PATH_SEPARATOR, &size);
- p = Concat(p, minidump_id, &size);
- Concat(p, dumpFileExtension, &size);
-#else
- Concat(minidumpPath, descriptor.path(), &size);
-#endif
-
- static XP_CHAR memoryReportLocalPath[XP_PATH_MAX];
- size = XP_PATH_MAX;
-#ifndef XP_LINUX
- p = Concat(memoryReportLocalPath, dump_path, &size);
- p = Concat(p, XP_PATH_SEPARATOR, &size);
- p = Concat(p, minidump_id, &size);
-#else
- p = Concat(memoryReportLocalPath, descriptor.path(), &size);
- // Skip back past the .dmp extension
- p -= 4;
-#endif
- Concat(p, memoryReportExtension, &size);
-
- if (memoryReportPath) {
-#ifdef XP_WIN
- CopyFile(memoryReportPath, memoryReportLocalPath, false);
-#else
- copy_file(memoryReportPath, memoryReportLocalPath);
-#endif
- }
-
- if (headlessClient) {
- // Leave a marker indicating that there was a crash.
- PlatformWriter markerFile(crashMarkerFilename);
-#if defined(XP_WIN)
- markerFile.WriteBuffer(reinterpret_cast<const char*>(minidumpPath),
- 2*wcslen(minidumpPath));
-#elif defined(XP_UNIX)
- markerFile.WriteBuffer(minidumpPath, my_strlen(minidumpPath));
-#endif
- }
-
- char oomAllocationSizeBuffer[32] = "";
- if (gOOMAllocationSize) {
- XP_STOA(gOOMAllocationSize, oomAllocationSizeBuffer, 10);
- }
-
- char texturesSizeBuffer[32] = "";
- if (gTexturesSize) {
- XP_STOA(gTexturesSize, texturesSizeBuffer, 10);
- }
-
- char numOfPendingIPCBuffer[32] = "";
- char topPendingIPCCountBuffer[32] = "";
- char topPendingIPCTypeBuffer[11] = "0x";
- if (gNumOfPendingIPC) {
- XP_STOA(gNumOfPendingIPC, numOfPendingIPCBuffer, 10);
- if (gTopPendingIPCCount) {
- XP_STOA(gTopPendingIPCCount, topPendingIPCCountBuffer, 10);
- }
- if (gTopPendingIPCType) {
- XP_STOA(gTopPendingIPCType, &topPendingIPCTypeBuffer[2], 16);
- }
- }
-
- // calculate time since last crash (if possible), and store
- // the time of this crash.
- time_t crashTime;
-#ifdef XP_LINUX
- struct kernel_timeval tv;
- sys_gettimeofday(&tv, nullptr);
- crashTime = tv.tv_sec;
-#else
- crashTime = time(nullptr);
-#endif
- time_t timeSinceLastCrash = 0;
- // stringified versions of the above
- char crashTimeString[32];
- char timeSinceLastCrashString[32];
-
- XP_TTOA(crashTime, crashTimeString, 10);
- if (lastCrashTime != 0) {
- timeSinceLastCrash = crashTime - lastCrashTime;
- XP_TTOA(timeSinceLastCrash, timeSinceLastCrashString, 10);
- }
- // write crash time to file
- if (lastCrashTimeFilename[0] != 0) {
- PlatformWriter lastCrashFile(lastCrashTimeFilename);
- WriteString(lastCrashFile, crashTimeString);
- }
-
- bool ignored = false;
- double uptimeTS = (TimeStamp::NowLoRes()-
- TimeStamp::ProcessCreation(ignored)).ToSecondsSigDigits();
- char uptimeTSString[64];
- SimpleNoCLibDtoA(uptimeTS, uptimeTSString, sizeof(uptimeTSString));
-
- // Write crash event file.
-
- // Minidump IDs are UUIDs (36) + NULL.
- static char id_ascii[37];
-#ifdef XP_LINUX
- const char * index = strrchr(descriptor.path(), '/');
- MOZ_ASSERT(index);
- MOZ_ASSERT(strlen(index) == 1 + 36 + 4); // "/" + UUID + ".dmp"
- for (uint32_t i = 0; i < 36; i++) {
- id_ascii[i] = *(index + 1 + i);
- }
-#else
- MOZ_ASSERT(XP_STRLEN(minidump_id) == 36);
- for (uint32_t i = 0; i < 36; i++) {
- id_ascii[i] = *((char *)(minidump_id + i));
- }
-#endif
-
- {
- PlatformWriter apiData;
- PlatformWriter eventFile;
-
- if (eventsDirectory) {
- static XP_CHAR crashEventPath[XP_PATH_MAX];
- int size = XP_PATH_MAX;
- XP_CHAR* p;
- p = Concat(crashEventPath, eventsDirectory, &size);
- p = Concat(p, XP_PATH_SEPARATOR, &size);
-#ifdef XP_LINUX
- p = Concat(p, id_ascii, &size);
-#else
- p = Concat(p, minidump_id, &size);
-#endif
-
- eventFile.Open(crashEventPath);
- WriteLiteral(eventFile, kCrashMainID);
- WriteString(eventFile, crashTimeString);
- WriteLiteral(eventFile, "\n");
- WriteString(eventFile, id_ascii);
- WriteLiteral(eventFile, "\n");
- if (currentSessionId) {
- WriteAnnotation(eventFile, "TelemetrySessionId", currentSessionId);
- }
- if (crashEventAPIData) {
- eventFile.WriteBuffer(crashEventAPIData->get(), crashEventAPIData->Length());
- }
- }
-
- if (!crashReporterAPIData->IsEmpty()) {
- // write out API data
-#ifdef XP_LINUX
- OpenAPIData(apiData, descriptor.path());
-#else
- OpenAPIData(apiData, dump_path, minidump_id);
-#endif
- apiData.WriteBuffer(crashReporterAPIData->get(), crashReporterAPIData->Length());
- }
- WriteAnnotation(apiData, "CrashTime", crashTimeString);
- WriteAnnotation(eventFile, "CrashTime", crashTimeString);
-
- WriteAnnotation(apiData, "UptimeTS", uptimeTSString);
- WriteAnnotation(eventFile, "UptimeTS", uptimeTSString);
-
- if (timeSinceLastCrash != 0) {
- WriteAnnotation(apiData, "SecondsSinceLastCrash",
- timeSinceLastCrashString);
- WriteAnnotation(eventFile, "SecondsSinceLastCrash",
- timeSinceLastCrashString);
- }
- if (isGarbageCollecting) {
- WriteAnnotation(apiData, "IsGarbageCollecting",
- isGarbageCollecting ? "1" : "0");
- WriteAnnotation(eventFile, "IsGarbageCollecting",
- isGarbageCollecting ? "1" : "0");
- }
-
- char buffer[128];
-
- if (eventloopNestingLevel > 0) {
- XP_STOA(eventloopNestingLevel, buffer, 10);
- WriteAnnotation(apiData, "EventLoopNestingLevel", buffer);
- WriteAnnotation(eventFile, "EventLoopNestingLevel", buffer);
- }
-
-#ifdef XP_WIN
- if (gBreakpadReservedVM) {
- _ui64toa(uintptr_t(gBreakpadReservedVM), buffer, 10);
- WriteAnnotation(apiData, "BreakpadReserveAddress", buffer);
- _ui64toa(kReserveSize, buffer, 10);
- WriteAnnotation(apiData, "BreakpadReserveSize", buffer);
- }
-
-#ifdef HAS_DLL_BLOCKLIST
- if (apiData.Valid()) {
- DllBlocklist_WriteNotes(apiData.Handle());
- DllBlocklist_WriteNotes(eventFile.Handle());
- }
-#endif
- WriteGlobalMemoryStatus(&apiData, &eventFile);
-#endif // XP_WIN
-
- if (gMozCrashReason) {
- WriteAnnotation(apiData, "MozCrashReason", gMozCrashReason);
- WriteAnnotation(eventFile, "MozCrashReason", gMozCrashReason);
- }
-
- if (oomAllocationSizeBuffer[0]) {
- WriteAnnotation(apiData, "OOMAllocationSize", oomAllocationSizeBuffer);
- WriteAnnotation(eventFile, "OOMAllocationSize", oomAllocationSizeBuffer);
- }
-
- if (texturesSizeBuffer[0]) {
- WriteAnnotation(apiData, "TextureUsage", texturesSizeBuffer);
- WriteAnnotation(eventFile, "TextureUsage", texturesSizeBuffer);
- }
-
- if (numOfPendingIPCBuffer[0]) {
- WriteAnnotation(apiData, "NumberOfPendingIPC", numOfPendingIPCBuffer);
- WriteAnnotation(eventFile, "NumberOfPendingIPC", numOfPendingIPCBuffer);
- if (topPendingIPCCountBuffer[0]) {
- WriteAnnotation(apiData, "TopPendingIPCCount", topPendingIPCCountBuffer);
- WriteAnnotation(eventFile, "TopPendingIPCCount", topPendingIPCCountBuffer);
- }
- if (gTopPendingIPCName) {
- WriteAnnotation(apiData, "TopPendingIPCName", gTopPendingIPCName);
- WriteAnnotation(eventFile, "TopPendingIPCName", gTopPendingIPCName);
- }
- if (topPendingIPCTypeBuffer[2]) {
- WriteAnnotation(apiData, "TopPendingIPCType", topPendingIPCTypeBuffer);
- WriteAnnotation(eventFile, "TopPendingIPCType", topPendingIPCTypeBuffer);
- }
- }
-
- if (memoryReportPath) {
- WriteLiteral(apiData, "ContainsMemoryReport=1\n");
- WriteLiteral(eventFile, "ContainsMemoryReport=1\n");
- }
- }
-
-#ifdef XP_WIN
- if (!doReport) {
- TerminateProcess(GetCurrentProcess(), 1);
- return returnValue;
- }
-
- XP_CHAR cmdLine[CMDLINE_SIZE];
- size = CMDLINE_SIZE;
- p = Concat(cmdLine, L"\"", &size);
- p = Concat(p, crashReporterPath, &size);
- p = Concat(p, L"\" \"", &size);
- p = Concat(p, minidumpPath, &size);
- Concat(p, L"\"", &size);
-
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
-
- ZeroMemory(&si, sizeof(si));
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_SHOWNORMAL;
- ZeroMemory(&pi, sizeof(pi));
-
- if (CreateProcess(nullptr, (LPWSTR)cmdLine, nullptr, nullptr, FALSE, 0,
- nullptr, nullptr, &si, &pi)) {
- CloseHandle( pi.hProcess );
- CloseHandle( pi.hThread );
- }
- // we're not really in a position to do anything if the CreateProcess fails
- TerminateProcess(GetCurrentProcess(), 1);
-#elif defined(XP_UNIX)
- if (!doReport) {
- return returnValue;
- }
-
-#ifdef XP_MACOSX
- char* const my_argv[] = {
- crashReporterPath,
- minidumpPath,
- nullptr
- };
-
- char **env = nullptr;
- char ***nsEnv = _NSGetEnviron();
- if (nsEnv)
- env = *nsEnv;
- int result = posix_spawnp(nullptr,
- my_argv[0],
- nullptr,
- &spawnattr,
- my_argv,
- env);
-
- if (result != 0)
- return false;
-
-#else // !XP_MACOSX
- pid_t pid = sys_fork();
-
- if (pid == -1)
- return false;
- else if (pid == 0) {
-#if !defined(MOZ_WIDGET_ANDROID)
- // need to clobber this, as libcurl might load NSS,
- // and we want it to load the system NSS.
- unsetenv("LD_LIBRARY_PATH");
- Unused << execl(crashReporterPath,
- crashReporterPath, minidumpPath, (char*)0);
-#else
- // Invoke the reportCrash activity using am
- if (androidUserSerial) {
- Unused << execlp("/system/bin/am",
- "/system/bin/am",
- "start",
- "--user", androidUserSerial,
- "-a", "org.mozilla.gecko.reportCrash",
- "-n", crashReporterPath,
- "--es", "minidumpPath", minidumpPath,
- "--ez", "minidumpSuccess", succeeded ? "true" : "false",
- (char*)0);
- } else {
- Unused << execlp("/system/bin/am",
- "/system/bin/am",
- "start",
- "-a", "org.mozilla.gecko.reportCrash",
- "-n", crashReporterPath,
- "--es", "minidumpPath", minidumpPath,
- "--ez", "minidumpSuccess", succeeded ? "true" : "false",
- (char*)0);
- }
-#endif
- _exit(1);
-#ifdef MOZ_WIDGET_ANDROID
- } else {
- // We need to wait on the 'am start' command above to finish, otherwise everything will
- // be killed by the ActivityManager as soon as the signal handler exits
- int status;
- Unused << HANDLE_EINTR(sys_waitpid(pid, &status, __WALL));
-#endif
- }
-#endif // XP_MACOSX
-#endif // XP_UNIX
-
- return returnValue;
-}
-
-#if defined(XP_MACOSX) || defined(__ANDROID__) || defined(XP_LINUX)
-static size_t
-EnsureTrailingSlash(XP_CHAR* aBuf, size_t aBufLen)
-{
- size_t len = XP_STRLEN(aBuf);
- if ((len + 1) < aBufLen
- && len > 0
- && aBuf[len - 1] != XP_PATH_SEPARATOR_CHAR) {
- aBuf[len] = XP_PATH_SEPARATOR_CHAR;
- ++len;
- aBuf[len] = 0;
- }
- return len;
-}
-#endif
-
-#if defined(XP_WIN32)
-
-static size_t
-BuildTempPath(wchar_t* aBuf, size_t aBufLen)
-{
- // first figure out buffer size
- DWORD pathLen = GetTempPath(0, nullptr);
- if (pathLen == 0 || pathLen >= aBufLen) {
- return 0;
- }
-
- return GetTempPath(pathLen, aBuf);
-}
-
-static size_t
-BuildTempPath(char16_t* aBuf, size_t aBufLen)
-{
- return BuildTempPath(reinterpret_cast<wchar_t*>(aBuf), aBufLen);
-}
-
-#elif defined(XP_MACOSX)
-
-static size_t
-BuildTempPath(char* aBuf, size_t aBufLen)
-{
- if (aBufLen < PATH_MAX) {
- return 0;
- }
-
- FSRef fsRef;
- OSErr err = FSFindFolder(kUserDomain, kTemporaryFolderType,
- kCreateFolder, &fsRef);
- if (err != noErr) {
- return 0;
- }
-
- OSStatus status = FSRefMakePath(&fsRef, (UInt8*)aBuf, PATH_MAX);
- if (status != noErr) {
- return 0;
- }
-
- return EnsureTrailingSlash(aBuf, aBufLen);
-}
-
-#elif defined(__ANDROID__)
-
-static size_t
-BuildTempPath(char* aBuf, size_t aBufLen)
-{
- // GeckoAppShell or Gonk's init.rc sets this in the environment
- const char *tempenv = PR_GetEnv("TMPDIR");
- if (!tempenv) {
- return false;
- }
- int size = (int)aBufLen;
- Concat(aBuf, tempenv, &size);
- return EnsureTrailingSlash(aBuf, aBufLen);
-}
-
-#elif defined(XP_UNIX)
-
-static size_t
-BuildTempPath(char* aBuf, size_t aBufLen)
-{
- const char *tempenv = PR_GetEnv("TMPDIR");
- const char *tmpPath = "/tmp/";
- if (!tempenv) {
- tempenv = tmpPath;
- }
- int size = (int)aBufLen;
- Concat(aBuf, tempenv, &size);
- return EnsureTrailingSlash(aBuf, aBufLen);
-}
-
-#else
-#error "Implement this for your platform"
-#endif
-
-template <typename CharT, size_t N>
-static size_t
-BuildTempPath(CharT (&aBuf)[N])
-{
- static_assert(N >= XP_PATH_MAX, "char array length is too small");
- return BuildTempPath(&aBuf[0], N);
-}
-
-template <typename PathStringT>
-static bool
-BuildTempPath(PathStringT& aResult)
-{
- aResult.SetLength(XP_PATH_MAX);
- size_t actualLen = BuildTempPath(aResult.BeginWriting(), XP_PATH_MAX);
- if (!actualLen) {
- return false;
- }
- aResult.SetLength(actualLen);
- return true;
-}
-
-static void
-PrepareChildExceptionTimeAnnotations()
-{
- MOZ_ASSERT(!XRE_IsParentProcess());
- static XP_CHAR tempPath[XP_PATH_MAX] = {0};
-
- // Get the temp path
- int charsAvailable = XP_PATH_MAX;
- XP_CHAR* p = tempPath;
-#if (defined(XP_MACOSX) || defined(XP_WIN))
- if (!childProcessTmpDir || childProcessTmpDir->empty()) {
- return;
- }
- p = Concat(p, childProcessTmpDir->c_str(), &charsAvailable);
- // Ensure that this path ends with a path separator
- if (p > tempPath && *(p - 1) != XP_PATH_SEPARATOR_CHAR) {
- p = Concat(p, XP_PATH_SEPARATOR, &charsAvailable);
- }
-#else
- size_t tempPathLen = BuildTempPath(tempPath);
- if (!tempPathLen) {
- return;
- }
- p += tempPathLen;
- charsAvailable -= tempPathLen;
-#endif
-
- // Generate and append the file name
- p = Concat(p, childCrashAnnotationBaseName, &charsAvailable);
- XP_CHAR pidBuffer[32] = XP_TEXT("");
-#if defined(XP_WIN32)
- _ui64tow(GetCurrentProcessId(), pidBuffer, 10);
-#else
- XP_STOA(getpid(), pidBuffer, 10);
-#endif
- p = Concat(p, pidBuffer, &charsAvailable);
-
- // Now open the file...
- PlatformWriter apiData;
- OpenAPIData(apiData, tempPath);
-
- // ...and write out any annotations. These must be escaped if necessary
- // (but don't call EscapeAnnotation here, because it touches the heap).
-#ifdef XP_WIN
- WriteGlobalMemoryStatus(&apiData, nullptr);
-#endif
-
- char oomAllocationSizeBuffer[32] = "";
- if (gOOMAllocationSize) {
- XP_STOA(gOOMAllocationSize, oomAllocationSizeBuffer, 10);
- }
-
- if (oomAllocationSizeBuffer[0]) {
- WriteAnnotation(apiData, "OOMAllocationSize", oomAllocationSizeBuffer);
- }
-
- if (gMozCrashReason) {
- WriteAnnotation(apiData, "MozCrashReason", gMozCrashReason);
- }
-
- char numOfPendingIPCBuffer[32] = "";
- char topPendingIPCCountBuffer[32] = "";
- char topPendingIPCTypeBuffer[11] = "0x";
- if (gNumOfPendingIPC) {
- XP_STOA(gNumOfPendingIPC, numOfPendingIPCBuffer, 10);
- if (gTopPendingIPCCount) {
- XP_STOA(gTopPendingIPCCount, topPendingIPCCountBuffer, 10);
- }
- if (gTopPendingIPCType) {
- XP_STOA(gTopPendingIPCType, &topPendingIPCTypeBuffer[2], 16);
- }
- }
-
- if (numOfPendingIPCBuffer[0]) {
- WriteAnnotation(apiData, "NumberOfPendingIPC", numOfPendingIPCBuffer);
- if (topPendingIPCCountBuffer[0]) {
- WriteAnnotation(apiData, "TopPendingIPCCount", topPendingIPCCountBuffer);
- }
- if (gTopPendingIPCName) {
- WriteAnnotation(apiData, "TopPendingIPCName", gTopPendingIPCName);
- }
- if (topPendingIPCTypeBuffer[2]) {
- WriteAnnotation(apiData, "TopPendingIPCType", topPendingIPCTypeBuffer);
- }
- }
-}
-
-#ifdef XP_WIN
-static void
-ReserveBreakpadVM()
-{
- if (!gBreakpadReservedVM) {
- gBreakpadReservedVM = VirtualAlloc(nullptr, kReserveSize, MEM_RESERVE,
- PAGE_NOACCESS);
- }
-}
-
-static void
-FreeBreakpadVM()
-{
- if (gBreakpadReservedVM) {
- VirtualFree(gBreakpadReservedVM, 0, MEM_RELEASE);
- }
-}
-
-/**
- * Filters out floating point exceptions which are handled by nsSigHandlers.cpp
- * and should not be handled as crashes.
- *
- * Also calls FreeBreakpadVM if appropriate.
- */
-static bool FPEFilter(void* context, EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion)
-{
- if (!exinfo) {
- mozilla::IOInterposer::Disable();
- FreeBreakpadVM();
- return true;
- }
-
- PEXCEPTION_RECORD e = (PEXCEPTION_RECORD)exinfo->ExceptionRecord;
- switch (e->ExceptionCode) {
- case STATUS_FLOAT_DENORMAL_OPERAND:
- case STATUS_FLOAT_DIVIDE_BY_ZERO:
- case STATUS_FLOAT_INEXACT_RESULT:
- case STATUS_FLOAT_INVALID_OPERATION:
- case STATUS_FLOAT_OVERFLOW:
- case STATUS_FLOAT_STACK_CHECK:
- case STATUS_FLOAT_UNDERFLOW:
- case STATUS_FLOAT_MULTIPLE_FAULTS:
- case STATUS_FLOAT_MULTIPLE_TRAPS:
- return false; // Don't write minidump, continue exception search
- }
- mozilla::IOInterposer::Disable();
- FreeBreakpadVM();
- return true;
-}
-
-static bool
-ChildFPEFilter(void* context, EXCEPTION_POINTERS* exinfo,
- MDRawAssertionInfo* assertion)
-{
- bool result = FPEFilter(context, exinfo, assertion);
- if (result) {
- PrepareChildExceptionTimeAnnotations();
- }
- return result;
-}
-
-MINIDUMP_TYPE GetMinidumpType()
-{
- MINIDUMP_TYPE minidump_type = MiniDumpNormal;
-
- // Try to determine what version of dbghelp.dll we're using.
- // MinidumpWithFullMemoryInfo is only available in 6.1.x or newer.
-
- DWORD version_size = GetFileVersionInfoSizeW(L"dbghelp.dll", nullptr);
- if (version_size > 0) {
- std::vector<BYTE> buffer(version_size);
- if (GetFileVersionInfoW(L"dbghelp.dll",
- 0,
- version_size,
- &buffer[0])) {
- UINT len;
- VS_FIXEDFILEINFO* file_info;
- VerQueryValue(&buffer[0], L"\\", (void**)&file_info, &len);
- WORD major = HIWORD(file_info->dwFileVersionMS),
- minor = LOWORD(file_info->dwFileVersionMS),
- revision = HIWORD(file_info->dwFileVersionLS);
- if (major > 6 || (major == 6 && minor > 1) ||
- (major == 6 && minor == 1 && revision >= 7600)) {
- minidump_type = MiniDumpWithFullMemoryInfo;
- }
- }
- }
-
- const char* e = PR_GetEnv("MOZ_CRASHREPORTER_FULLDUMP");
- if (e && *e) {
- minidump_type = MiniDumpWithFullMemory;
- }
-
- return minidump_type;
-}
-
-#endif // XP_WIN
-
-static bool ShouldReport()
-{
- // this environment variable prevents us from launching
- // the crash reporter client
- const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_NO_REPORT");
- if (envvar && *envvar) {
- return false;
- }
-
- envvar = PR_GetEnv("MOZ_CRASHREPORTER_FULLDUMP");
- if (envvar && *envvar) {
- return false;
- }
-
- return true;
-}
-
-static bool
-Filter(void* context)
-{
- mozilla::IOInterposer::Disable();
- return true;
-}
-
-static bool
-ChildFilter(void* context)
-{
- bool result = Filter(context);
- if (result) {
- PrepareChildExceptionTimeAnnotations();
- }
- return result;
-}
-
-void TerminateHandler()
-{
- MOZ_CRASH("Unhandled exception");
-}
-
-nsresult SetExceptionHandler(nsIFile* aXREDirectory,
- bool force/*=false*/)
-{
- if (gExceptionHandler)
- return NS_ERROR_ALREADY_INITIALIZED;
-
-#if !defined(DEBUG)
- // In non-debug builds, enable the crash reporter by default, and allow
- // disabling it with the MOZ_CRASHREPORTER_DISABLE environment variable.
- const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER_DISABLE");
- if (envvar && *envvar && !force)
- return NS_OK;
-#else
- // In debug builds, disable the crash reporter by default, and allow to
- // enable it with the MOZ_CRASHREPORTER environment variable.
- const char *envvar = PR_GetEnv("MOZ_CRASHREPORTER");
- if ((!envvar || !*envvar) && !force)
- return NS_OK;
-#endif
-
-#if defined(XP_WIN)
- doReport = ShouldReport();
-#else
- // this environment variable prevents us from launching
- // the crash reporter client
- doReport = ShouldReport();
-#endif
-
- // allocate our strings
- crashReporterAPIData = new nsCString();
- crashEventAPIData = new nsCString();
-
- NS_ASSERTION(!crashReporterAPILock, "Shouldn't have a lock yet");
- crashReporterAPILock = new Mutex("crashReporterAPILock");
- NS_ASSERTION(!notesFieldLock, "Shouldn't have a lock yet");
- notesFieldLock = new Mutex("notesFieldLock");
-
- crashReporterAPIData_Hash =
- new nsDataHashtable<nsCStringHashKey,nsCString>();
- NS_ENSURE_TRUE(crashReporterAPIData_Hash, NS_ERROR_OUT_OF_MEMORY);
-
- notesField = new nsCString();
- NS_ENSURE_TRUE(notesField, NS_ERROR_OUT_OF_MEMORY);
-
- if (!headlessClient) {
- // locate crashreporter executable
- nsCOMPtr<nsIFile> exePath;
- nsresult rv = aXREDirectory->Clone(getter_AddRefs(exePath));
- NS_ENSURE_SUCCESS(rv, rv);
-
-#if defined(XP_MACOSX)
- exePath->SetNativeLeafName(NS_LITERAL_CSTRING("MacOS"));
- exePath->Append(NS_LITERAL_STRING("crashreporter.app"));
- exePath->Append(NS_LITERAL_STRING("Contents"));
- exePath->Append(NS_LITERAL_STRING("MacOS"));
-#endif
-
- exePath->AppendNative(NS_LITERAL_CSTRING(CRASH_REPORTER_FILENAME));
-
-#ifdef XP_WIN32
- nsString crashReporterPath_temp;
-
- exePath->GetPath(crashReporterPath_temp);
- crashReporterPath = reinterpret_cast<wchar_t*>(ToNewUnicode(crashReporterPath_temp));
-#elif !defined(__ANDROID__)
- nsCString crashReporterPath_temp;
-
- exePath->GetNativePath(crashReporterPath_temp);
- crashReporterPath = ToNewCString(crashReporterPath_temp);
-#else
- // On Android, we launch using the application package name instead of a
- // filename, so use the dynamically set MOZ_ANDROID_PACKAGE_NAME, or fall
- // back to the static ANDROID_PACKAGE_NAME.
- const char* androidPackageName = PR_GetEnv("MOZ_ANDROID_PACKAGE_NAME");
- if (androidPackageName != nullptr) {
- nsCString package(androidPackageName);
- package.Append("/org.mozilla.gecko.CrashReporter");
- crashReporterPath = ToNewCString(package);
- } else {
- nsCString package(ANDROID_PACKAGE_NAME "/org.mozilla.gecko.CrashReporter");
- crashReporterPath = ToNewCString(package);
- }
-#endif
- }
-
- // get temp path to use for minidump path
-#if defined(XP_WIN32)
- nsString tempPath;
-#else
- nsCString tempPath;
-#endif
- if (!BuildTempPath(tempPath)) {
- return NS_ERROR_FAILURE;
- }
-
-#ifdef XP_MACOSX
- // Initialize spawn attributes, since this calls malloc.
- if (posix_spawnattr_init(&spawnattr) != 0) {
- return NS_ERROR_FAILURE;
- }
-
- // Set spawn attributes.
- size_t attr_count = ArrayLength(pref_cpu_types);
- size_t attr_ocount = 0;
- if (posix_spawnattr_setbinpref_np(&spawnattr,
- attr_count,
- pref_cpu_types,
- &attr_ocount) != 0 ||
- attr_ocount != attr_count) {
- posix_spawnattr_destroy(&spawnattr);
- return NS_ERROR_FAILURE;
- }
-#endif
-
-#ifdef XP_WIN32
- ReserveBreakpadVM();
-#endif // XP_WIN32
-
-#ifdef MOZ_WIDGET_ANDROID
- androidUserSerial = getenv("MOZ_ANDROID_USER_SERIAL_NUMBER");
-#endif
-
- // Initialize the flag and mutex used to avoid dump processing
- // once browser termination has begun.
- NS_ASSERTION(!dumpSafetyLock, "Shouldn't have a lock yet");
- // Do not deallocate this lock while it is still possible for
- // isSafeToDump to be tested on another thread.
- dumpSafetyLock = new Mutex("dumpSafetyLock");
- MutexAutoLock lock(*dumpSafetyLock);
- isSafeToDump = true;
-
- // now set the exception handler
-#ifdef XP_LINUX
- MinidumpDescriptor descriptor(tempPath.get());
-#endif
-
-#ifdef XP_WIN
- previousUnhandledExceptionFilter = GetUnhandledExceptionFilter();
-#endif
-
- gExceptionHandler = new google_breakpad::
- ExceptionHandler(
-#ifdef XP_LINUX
- descriptor,
-#elif defined(XP_WIN)
- std::wstring(tempPath.get()),
-#else
- tempPath.get(),
-#endif
-
-#ifdef XP_WIN
- FPEFilter,
-#else
- Filter,
-#endif
- MinidumpCallback,
- nullptr,
-#ifdef XP_WIN32
- google_breakpad::ExceptionHandler::HANDLER_ALL,
- GetMinidumpType(),
- (const wchar_t*) nullptr,
- nullptr);
-#else
- true
-#ifdef XP_MACOSX
- , nullptr
-#endif
-#ifdef XP_LINUX
- , -1
-#endif
- );
-#endif // XP_WIN32
-
- if (!gExceptionHandler)
- return NS_ERROR_OUT_OF_MEMORY;
-
-#ifdef XP_WIN
- gExceptionHandler->set_handle_debug_exceptions(true);
-
-#ifdef _WIN64
- // Tell JS about the new filter before we disable SetUnhandledExceptionFilter
- sUnhandledExceptionFilter = GetUnhandledExceptionFilter();
- if (sUnhandledExceptionFilter)
- js::SetJitExceptionHandler(JitExceptionHandler);
-#endif
-
- // protect the crash reporter from being unloaded
- gBlockUnhandledExceptionFilter = true;
- gKernel32Intercept.Init("kernel32.dll");
- bool ok = gKernel32Intercept.AddHook("SetUnhandledExceptionFilter",
- reinterpret_cast<intptr_t>(patched_SetUnhandledExceptionFilter),
- (void**) &stub_SetUnhandledExceptionFilter);
-
-#ifdef DEBUG
- if (!ok)
- printf_stderr ("SetUnhandledExceptionFilter hook failed; crash reporter is vulnerable.\n");
-#endif
-#endif
-
- // store application start time
- char timeString[32];
- time_t startupTime = time(nullptr);
- XP_TTOA(startupTime, timeString, 10);
- AnnotateCrashReport(NS_LITERAL_CSTRING("StartupTime"),
- nsDependentCString(timeString));
-
-#if defined(XP_MACOSX)
- // On OS X, many testers like to see the OS crash reporting dialog
- // since it offers immediate stack traces. We allow them to set
- // a default to pass exceptions to the OS handler.
- Boolean keyExistsAndHasValidFormat = false;
- Boolean prefValue = ::CFPreferencesGetAppBooleanValue(CFSTR("OSCrashReporter"),
- kCFPreferencesCurrentApplication,
- &keyExistsAndHasValidFormat);
- if (keyExistsAndHasValidFormat)
- showOSCrashReporter = prefValue;
-#endif
-
-#if defined(MOZ_WIDGET_ANDROID)
- for (unsigned int i = 0; i < library_mappings.size(); i++) {
- PageAllocator allocator;
- auto_wasteful_vector<uint8_t, sizeof(MDGUID)> guid(&allocator);
- FileID::ElfFileIdentifierFromMappedFile(
- (void const *)library_mappings[i].start_address, guid);
- gExceptionHandler->AddMappingInfo(library_mappings[i].name,
- guid.data(),
- library_mappings[i].start_address,
- library_mappings[i].length,
- library_mappings[i].file_offset);
- }
-#endif
-
- mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);
-
- oldTerminateHandler = std::set_terminate(&TerminateHandler);
-
- return NS_OK;
-}
-
-bool GetEnabled()
-{
- return gExceptionHandler != nullptr;
-}
-
-bool GetMinidumpPath(nsAString& aPath)
-{
- if (!gExceptionHandler)
- return false;
-
-#ifndef XP_LINUX
- aPath = CONVERT_XP_CHAR_TO_UTF16(gExceptionHandler->dump_path().c_str());
-#else
- aPath = CONVERT_XP_CHAR_TO_UTF16(
- gExceptionHandler->minidump_descriptor().directory().c_str());
-#endif
- return true;
-}
-
-nsresult SetMinidumpPath(const nsAString& aPath)
-{
- if (!gExceptionHandler)
- return NS_ERROR_NOT_INITIALIZED;
-
-#ifdef XP_WIN32
- gExceptionHandler->set_dump_path(std::wstring(char16ptr_t(aPath.BeginReading())));
-#elif defined(XP_LINUX)
- gExceptionHandler->set_minidump_descriptor(
- MinidumpDescriptor(NS_ConvertUTF16toUTF8(aPath).BeginReading()));
-#else
- gExceptionHandler->set_dump_path(NS_ConvertUTF16toUTF8(aPath).BeginReading());
-#endif
- return NS_OK;
-}
-
-static nsresult
-WriteDataToFile(nsIFile* aFile, const nsACString& data)
-{
- PRFileDesc* fd;
- nsresult rv = aFile->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE, 00600, &fd);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = NS_OK;
- if (PR_Write(fd, data.Data(), data.Length()) == -1) {
- rv = NS_ERROR_FAILURE;
- }
- PR_Close(fd);
- return rv;
-}
-
-static nsresult
-GetFileContents(nsIFile* aFile, nsACString& data)
-{
- PRFileDesc* fd;
- nsresult rv = aFile->OpenNSPRFileDesc(PR_RDONLY, 0, &fd);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = NS_OK;
- int32_t filesize = PR_Available(fd);
- if (filesize <= 0) {
- rv = NS_ERROR_FILE_NOT_FOUND;
- }
- else {
- data.SetLength(filesize);
- if (PR_Read(fd, data.BeginWriting(), filesize) == -1) {
- rv = NS_ERROR_FAILURE;
- }
- }
- PR_Close(fd);
- return rv;
-}
-
-// Function typedef for initializing a piece of data that we
-// don't already have.
-typedef nsresult (*InitDataFunc)(nsACString&);
-
-// Attempt to read aFile's contents into aContents, if aFile
-// does not exist, create it and initialize its contents
-// by calling aInitFunc for the data.
-static nsresult
-GetOrInit(nsIFile* aDir, const nsACString& filename,
- nsACString& aContents, InitDataFunc aInitFunc)
-{
- bool exists;
-
- nsCOMPtr<nsIFile> dataFile;
- nsresult rv = aDir->Clone(getter_AddRefs(dataFile));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = dataFile->AppendNative(filename);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = dataFile->Exists(&exists);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (!exists) {
- if (aInitFunc) {
- // get the initial value and write it to the file
- rv = aInitFunc(aContents);
- NS_ENSURE_SUCCESS(rv, rv);
- rv = WriteDataToFile(dataFile, aContents);
- }
- else {
- // didn't pass in an init func
- rv = NS_ERROR_FAILURE;
- }
- }
- else {
- // just get the file's contents
- rv = GetFileContents(dataFile, aContents);
- }
-
- return rv;
-}
-
-// Init the "install time" data. We're taking an easy way out here
-// and just setting this to "the time when this version was first run".
-static nsresult
-InitInstallTime(nsACString& aInstallTime)
-{
- time_t t = time(nullptr);
- char buf[16];
- SprintfLiteral(buf, "%ld", t);
- aInstallTime = buf;
-
- return NS_OK;
-}
-
-// Ensure a directory exists and create it if missing.
-static nsresult
-EnsureDirectoryExists(nsIFile* dir)
-{
- nsresult rv = dir->Create(nsIFile::DIRECTORY_TYPE, 0700);
-
- if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_FILE_ALREADY_EXISTS)) {
- return rv;
- }
-
- return NS_OK;
-}
-
-// Annotate the crash report with a Unique User ID and time
-// since install. Also do some prep work for recording
-// time since last crash, which must be calculated at
-// crash time.
-// If any piece of data doesn't exist, initialize it first.
-nsresult SetupExtraData(nsIFile* aAppDataDirectory,
- const nsACString& aBuildID)
-{
- nsCOMPtr<nsIFile> dataDirectory;
- nsresult rv = aAppDataDirectory->Clone(getter_AddRefs(dataDirectory));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = dataDirectory->AppendNative(NS_LITERAL_CSTRING("Crash Reports"));
- NS_ENSURE_SUCCESS(rv, rv);
-
- EnsureDirectoryExists(dataDirectory);
-
-#if defined(XP_WIN32)
- nsAutoString dataDirEnv(NS_LITERAL_STRING("MOZ_CRASHREPORTER_DATA_DIRECTORY="));
-
- nsAutoString dataDirectoryPath;
- rv = dataDirectory->GetPath(dataDirectoryPath);
- NS_ENSURE_SUCCESS(rv, rv);
-
- dataDirEnv.Append(dataDirectoryPath);
-
- _wputenv(dataDirEnv.get());
-#else
- // Save this path in the environment for the crash reporter application.
- nsAutoCString dataDirEnv("MOZ_CRASHREPORTER_DATA_DIRECTORY=");
-
- nsAutoCString dataDirectoryPath;
- rv = dataDirectory->GetNativePath(dataDirectoryPath);
- NS_ENSURE_SUCCESS(rv, rv);
-
- dataDirEnv.Append(dataDirectoryPath);
-
- char* env = ToNewCString(dataDirEnv);
- NS_ENSURE_TRUE(env, NS_ERROR_OUT_OF_MEMORY);
-
- PR_SetEnv(env);
-#endif
-
- nsAutoCString data;
- if(NS_SUCCEEDED(GetOrInit(dataDirectory,
- NS_LITERAL_CSTRING("InstallTime") + aBuildID,
- data, InitInstallTime)))
- AnnotateCrashReport(NS_LITERAL_CSTRING("InstallTime"), data);
-
- // this is a little different, since we can't init it with anything,
- // since it's stored at crash time, and we can't annotate the
- // crash report with the stored value, since we really want
- // (now - LastCrash), so we just get a value if it exists,
- // and store it in a time_t value.
- if(NS_SUCCEEDED(GetOrInit(dataDirectory, NS_LITERAL_CSTRING("LastCrash"),
- data, nullptr))) {
- lastCrashTime = (time_t)atol(data.get());
- }
-
- // not really the best place to init this, but I have the path I need here
- nsCOMPtr<nsIFile> lastCrashFile;
- rv = dataDirectory->Clone(getter_AddRefs(lastCrashFile));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = lastCrashFile->AppendNative(NS_LITERAL_CSTRING("LastCrash"));
- NS_ENSURE_SUCCESS(rv, rv);
- memset(lastCrashTimeFilename, 0, sizeof(lastCrashTimeFilename));
-
-#if defined(XP_WIN32)
- nsAutoString filename;
- rv = lastCrashFile->GetPath(filename);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (filename.Length() < XP_PATH_MAX)
- wcsncpy(lastCrashTimeFilename, filename.get(), filename.Length());
-#else
- nsAutoCString filename;
- rv = lastCrashFile->GetNativePath(filename);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (filename.Length() < XP_PATH_MAX)
- strncpy(lastCrashTimeFilename, filename.get(), filename.Length());
-#endif
-
- if (headlessClient) {
- nsCOMPtr<nsIFile> markerFile;
- rv = dataDirectory->Clone(getter_AddRefs(markerFile));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = markerFile->AppendNative(NS_LITERAL_CSTRING("LastCrashFilename"));
- NS_ENSURE_SUCCESS(rv, rv);
- memset(crashMarkerFilename, 0, sizeof(crashMarkerFilename));
-
-#if defined(XP_WIN32)
- nsAutoString markerFilename;
- rv = markerFile->GetPath(markerFilename);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (markerFilename.Length() < XP_PATH_MAX)
- wcsncpy(crashMarkerFilename, markerFilename.get(),
- markerFilename.Length());
-#else
- nsAutoCString markerFilename;
- rv = markerFile->GetNativePath(markerFilename);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (markerFilename.Length() < XP_PATH_MAX)
- strncpy(crashMarkerFilename, markerFilename.get(),
- markerFilename.Length());
-#endif
- }
-
- return NS_OK;
-}
-
-static void OOPDeinit();
-
-nsresult UnsetExceptionHandler()
-{
- if (isSafeToDump) {
- MutexAutoLock lock(*dumpSafetyLock);
- isSafeToDump = false;
- }
-
-#ifdef XP_WIN
- // allow SetUnhandledExceptionFilter
- gBlockUnhandledExceptionFilter = false;
-#endif
-
- delete gExceptionHandler;
-
- // do this here in the unlikely case that we succeeded in allocating
- // our strings but failed to allocate gExceptionHandler.
- delete crashReporterAPIData_Hash;
- crashReporterAPIData_Hash = nullptr;
-
- delete crashReporterAPILock;
- crashReporterAPILock = nullptr;
-
- delete notesFieldLock;
- notesFieldLock = nullptr;
-
- delete crashReporterAPIData;
- crashReporterAPIData = nullptr;
-
- delete crashEventAPIData;
- crashEventAPIData = nullptr;
-
- delete notesField;
- notesField = nullptr;
-
- delete lastRunCrashID;
- lastRunCrashID = nullptr;
-
- if (pendingDirectory) {
- free(pendingDirectory);
- pendingDirectory = nullptr;
- }
-
- if (crashReporterPath) {
- free(crashReporterPath);
- crashReporterPath = nullptr;
- }
-
- if (eventsDirectory) {
- free(eventsDirectory);
- eventsDirectory = nullptr;
- }
-
- if (currentSessionId) {
- free(currentSessionId);
- currentSessionId = nullptr;
- }
-
- if (memoryReportPath) {
- free(memoryReportPath);
- memoryReportPath = nullptr;
- }
-
-#ifdef XP_MACOSX
- posix_spawnattr_destroy(&spawnattr);
-#endif
-
- if (!gExceptionHandler)
- return NS_ERROR_NOT_INITIALIZED;
-
- gExceptionHandler = nullptr;
-
- OOPDeinit();
-
- delete dumpSafetyLock;
- dumpSafetyLock = nullptr;
-
- std::set_terminate(oldTerminateHandler);
-
- return NS_OK;
-}
-
-static void ReplaceChar(nsCString& str, const nsACString& character,
- const nsACString& replacement)
-{
- nsCString::const_iterator iter, end;
-
- str.BeginReading(iter);
- str.EndReading(end);
-
- while (FindInReadable(character, iter, end)) {
- nsCString::const_iterator start;
- str.BeginReading(start);
- int32_t pos = end - start;
- str.Replace(pos - 1, 1, replacement);
-
- str.BeginReading(iter);
- iter.advance(pos + replacement.Length() - 1);
- str.EndReading(end);
- }
-}
-
-static bool DoFindInReadable(const nsACString& str, const nsACString& value)
-{
- nsACString::const_iterator start, end;
- str.BeginReading(start);
- str.EndReading(end);
-
- return FindInReadable(value, start, end);
-}
-
-static bool
-IsInWhitelist(const nsACString& key)
-{
- for (size_t i = 0; i < ArrayLength(kCrashEventAnnotations); ++i) {
- if (key.EqualsASCII(kCrashEventAnnotations[i])) {
- return true;
- }
- }
- return false;
-}
-
-// This function is miscompiled with MSVC 2005/2008 when PGO is on.
-#ifdef _MSC_VER
-#pragma optimize("", off)
-#endif
-static nsresult
-EscapeAnnotation(const nsACString& key, const nsACString& data, nsCString& escapedData)
-{
- if (DoFindInReadable(key, NS_LITERAL_CSTRING("=")) ||
- DoFindInReadable(key, NS_LITERAL_CSTRING("\n")))
- return NS_ERROR_INVALID_ARG;
-
- if (DoFindInReadable(data, NS_LITERAL_CSTRING("\0")))
- return NS_ERROR_INVALID_ARG;
-
- escapedData = data;
-
- // escape backslashes
- ReplaceChar(escapedData, NS_LITERAL_CSTRING("\\"),
- NS_LITERAL_CSTRING("\\\\"));
- // escape newlines
- ReplaceChar(escapedData, NS_LITERAL_CSTRING("\n"),
- NS_LITERAL_CSTRING("\\n"));
- return NS_OK;
-}
-#ifdef _MSC_VER
-#pragma optimize("", on)
-#endif
-
-class DelayedNote
-{
- public:
- DelayedNote(const nsACString& aKey, const nsACString& aData)
- : mKey(aKey), mData(aData), mType(Annotation) {}
-
- explicit DelayedNote(const nsACString& aData)
- : mData(aData), mType(AppNote) {}
-
- void Run()
- {
- if (mType == Annotation) {
- AnnotateCrashReport(mKey, mData);
- } else {
- AppendAppNotesToCrashReport(mData);
- }
- }
-
- private:
- nsCString mKey;
- nsCString mData;
- enum AnnotationType { Annotation, AppNote } mType;
-};
-
-static void
-EnqueueDelayedNote(DelayedNote* aNote)
-{
- if (!gDelayedAnnotations) {
- gDelayedAnnotations = new nsTArray<nsAutoPtr<DelayedNote> >();
- }
- gDelayedAnnotations->AppendElement(aNote);
-}
-
-class CrashReporterHelperRunnable : public Runnable {
-public:
- explicit CrashReporterHelperRunnable(const nsACString& aKey,
- const nsACString& aData)
- : mKey(aKey)
- , mData(aData)
- , mAppendAppNotes(false)
- {}
- explicit CrashReporterHelperRunnable(const nsACString& aData)
- : mKey()
- , mData(aData)
- , mAppendAppNotes(true)
- {}
-
- NS_IMETHOD Run() override;
-
-private:
- nsCString mKey;
- nsCString mData;
- bool mAppendAppNotes;
-};
-
-nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data)
-{
- if (!GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
- nsCString escapedData;
- nsresult rv = EscapeAnnotation(key, data, escapedData);
- if (NS_FAILED(rv))
- return rv;
-
- if (!XRE_IsParentProcess()) {
- // We have to handle this on the main thread since we will go
- // through IPDL.
- if (!NS_IsMainThread()) {
- // Child process needs to handle this in the main thread:
- nsCOMPtr<nsIRunnable> r = new CrashReporterHelperRunnable(key, data);
- NS_DispatchToMainThread(r);
- return NS_OK;
- }
-
- MOZ_ASSERT(NS_IsMainThread());
- EnqueueDelayedNote(new DelayedNote(key, data));
- return NS_OK;
- }
-
- MutexAutoLock lock(*crashReporterAPILock);
-
- crashReporterAPIData_Hash->Put(key, escapedData);
-
- // now rebuild the file contents
- crashReporterAPIData->Truncate(0);
- crashEventAPIData->Truncate(0);
- for (auto it = crashReporterAPIData_Hash->Iter(); !it.Done(); it.Next()) {
- const nsACString& key = it.Key();
- nsCString entry = it.Data();
- if (!entry.IsEmpty()) {
- NS_NAMED_LITERAL_CSTRING(kEquals, "=");
- NS_NAMED_LITERAL_CSTRING(kNewline, "\n");
- nsAutoCString line = key + kEquals + entry + kNewline;
-
- crashReporterAPIData->Append(line);
- if (IsInWhitelist(key)) {
- crashEventAPIData->Append(line);
- }
- }
- }
-
- return NS_OK;
-}
-
-nsresult RemoveCrashReportAnnotation(const nsACString& key)
-{
- return AnnotateCrashReport(key, NS_LITERAL_CSTRING(""));
-}
-
-nsresult SetGarbageCollecting(bool collecting)
-{
- if (!GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
- isGarbageCollecting = collecting;
-
- return NS_OK;
-}
-
-void SetEventloopNestingLevel(uint32_t level)
-{
- eventloopNestingLevel = level;
-}
-
-nsresult AppendAppNotesToCrashReport(const nsACString& data)
-{
- if (!GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
- if (DoFindInReadable(data, NS_LITERAL_CSTRING("\0")))
- return NS_ERROR_INVALID_ARG;
-
- if (!XRE_IsParentProcess()) {
- // Since we don't go through AnnotateCrashReport in the parent process,
- // we must ensure that the data is escaped and valid before the parent
- // sees it.
- nsCString escapedData;
- nsresult rv = EscapeAnnotation(NS_LITERAL_CSTRING("Notes"), data, escapedData);
- if (NS_FAILED(rv))
- return rv;
-
- if (!NS_IsMainThread()) {
- // Child process needs to handle this in the main thread:
- nsCOMPtr<nsIRunnable> r = new CrashReporterHelperRunnable(data);
- NS_DispatchToMainThread(r);
- return NS_OK;
- }
-
- MOZ_ASSERT(NS_IsMainThread());
- EnqueueDelayedNote(new DelayedNote(data));
- return NS_OK;
- }
-
- MutexAutoLock lock(*notesFieldLock);
-
- notesField->Append(data);
- return AnnotateCrashReport(NS_LITERAL_CSTRING("Notes"), *notesField);
-}
-
-nsresult CrashReporterHelperRunnable::Run()
-{
- // We expect this to be in the child process' main thread. If it isn't,
- // something is happening we didn't design for.
- MOZ_ASSERT(!XRE_IsParentProcess());
- MOZ_ASSERT(NS_IsMainThread());
-
- // Don't just leave the assert, paranoid about infinite recursion
- if (NS_IsMainThread()) {
- if (mAppendAppNotes) {
- return AppendAppNotesToCrashReport(mData);
- } else {
- return AnnotateCrashReport(mKey, mData);
- }
- }
- return NS_ERROR_FAILURE;
-}
-
-// Returns true if found, false if not found.
-bool GetAnnotation(const nsACString& key, nsACString& data)
-{
- if (!gExceptionHandler)
- return false;
-
- nsAutoCString entry;
- if (!crashReporterAPIData_Hash->Get(key, &entry))
- return false;
-
- data = entry;
- return true;
-}
-
-nsresult RegisterAppMemory(void* ptr, size_t length)
-{
- if (!GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
-#if defined(XP_LINUX) || defined(XP_WIN32)
- gExceptionHandler->RegisterAppMemory(ptr, length);
- return NS_OK;
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-nsresult UnregisterAppMemory(void* ptr)
-{
- if (!GetEnabled())
- return NS_ERROR_NOT_INITIALIZED;
-
-#if defined(XP_LINUX) || defined(XP_WIN32)
- gExceptionHandler->UnregisterAppMemory(ptr);
- return NS_OK;
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-bool GetServerURL(nsACString& aServerURL)
-{
- if (!gExceptionHandler)
- return false;
-
- return GetAnnotation(NS_LITERAL_CSTRING("ServerURL"), aServerURL);
-}
-
-nsresult SetServerURL(const nsACString& aServerURL)
-{
- // store server URL with the API data
- // the client knows to handle this specially
- return AnnotateCrashReport(NS_LITERAL_CSTRING("ServerURL"),
- aServerURL);
-}
-
-nsresult
-SetRestartArgs(int argc, char** argv)
-{
- if (!gExceptionHandler)
- return NS_OK;
-
- int i;
- nsAutoCString envVar;
- char *env;
- char *argv0 = getenv("MOZ_APP_LAUNCHER");
- for (i = 0; i < argc; i++) {
- envVar = "MOZ_CRASHREPORTER_RESTART_ARG_";
- envVar.AppendInt(i);
- envVar += "=";
- if (argv0 && i == 0) {
- // Is there a request to suppress default binary launcher?
- envVar += argv0;
- } else {
- envVar += argv[i];
- }
-
- // PR_SetEnv() wants the string to be available for the lifetime
- // of the app, so dup it here
- env = ToNewCString(envVar);
- if (!env)
- return NS_ERROR_OUT_OF_MEMORY;
-
- PR_SetEnv(env);
- }
-
- // make sure the arg list is terminated
- envVar = "MOZ_CRASHREPORTER_RESTART_ARG_";
- envVar.AppendInt(i);
- envVar += "=";
-
- // PR_SetEnv() wants the string to be available for the lifetime
- // of the app, so dup it here
- env = ToNewCString(envVar);
- if (!env)
- return NS_ERROR_OUT_OF_MEMORY;
-
- PR_SetEnv(env);
-
- // make sure we save the info in XUL_APP_FILE for the reporter
- const char *appfile = PR_GetEnv("XUL_APP_FILE");
- if (appfile && *appfile) {
- envVar = "MOZ_CRASHREPORTER_RESTART_XUL_APP_FILE=";
- envVar += appfile;
- env = ToNewCString(envVar);
- PR_SetEnv(env);
- }
-
- return NS_OK;
-}
-
-#ifdef XP_WIN32
-nsresult WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo)
-{
- if (!gExceptionHandler)
- return NS_ERROR_NOT_INITIALIZED;
-
- return gExceptionHandler->WriteMinidumpForException(aExceptionInfo) ? NS_OK : NS_ERROR_FAILURE;
-}
-#endif
-
-#ifdef XP_LINUX
-bool WriteMinidumpForSigInfo(int signo, siginfo_t* info, void* uc)
-{
- if (!gExceptionHandler) {
- // Crash reporting is disabled.
- return false;
- }
- return gExceptionHandler->HandleSignal(signo, info, uc);
-}
-#endif
-
-#ifdef XP_MACOSX
-nsresult AppendObjCExceptionInfoToAppNotes(void *inException)
-{
- nsAutoCString excString;
- GetObjCExceptionInfo(inException, excString);
- AppendAppNotesToCrashReport(excString);
- return NS_OK;
-}
-#endif
-
-/*
- * Combined code to get/set the crash reporter submission pref on
- * different platforms.
- */
-static nsresult PrefSubmitReports(bool* aSubmitReports, bool writePref)
-{
- nsresult rv;
-#if defined(XP_WIN32)
- /*
- * NOTE! This needs to stay in sync with the preference checking code
- * in toolkit/crashreporter/client/crashreporter_win.cpp
- */
- nsCOMPtr<nsIXULAppInfo> appinfo =
- do_GetService("@mozilla.org/xre/app-info;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsAutoCString appVendor, appName;
- rv = appinfo->GetVendor(appVendor);
- NS_ENSURE_SUCCESS(rv, rv);
- rv = appinfo->GetName(appName);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIWindowsRegKey> regKey
- (do_CreateInstance("@mozilla.org/windows-registry-key;1", &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsAutoCString regPath;
-
- regPath.AppendLiteral("Software\\");
-
- // We need to ensure the registry keys are created so we can properly
- // write values to it
-
- // Create appVendor key
- if(!appVendor.IsEmpty()) {
- regPath.Append(appVendor);
- regKey->Create(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
- NS_ConvertUTF8toUTF16(regPath),
- nsIWindowsRegKey::ACCESS_SET_VALUE);
- regPath.Append('\\');
- }
-
- // Create appName key
- regPath.Append(appName);
- regKey->Create(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
- NS_ConvertUTF8toUTF16(regPath),
- nsIWindowsRegKey::ACCESS_SET_VALUE);
- regPath.Append('\\');
-
- // Create Crash Reporter key
- regPath.AppendLiteral("Crash Reporter");
- regKey->Create(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
- NS_ConvertUTF8toUTF16(regPath),
- nsIWindowsRegKey::ACCESS_SET_VALUE);
-
- // If we're saving the pref value, just write it to ROOT_KEY_CURRENT_USER
- // and we're done.
- if (writePref) {
- rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
- NS_ConvertUTF8toUTF16(regPath),
- nsIWindowsRegKey::ACCESS_SET_VALUE);
- NS_ENSURE_SUCCESS(rv, rv);
-
- uint32_t value = *aSubmitReports ? 1 : 0;
- rv = regKey->WriteIntValue(NS_LITERAL_STRING("SubmitCrashReport"), value);
- regKey->Close();
- return rv;
- }
-
- // We're reading the pref value, so we need to first look under
- // ROOT_KEY_LOCAL_MACHINE to see if it's set there, and then fall back to
- // ROOT_KEY_CURRENT_USER. If it's not set in either place, the pref defaults
- // to "true".
- uint32_t value;
- rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_LOCAL_MACHINE,
- NS_ConvertUTF8toUTF16(regPath),
- nsIWindowsRegKey::ACCESS_QUERY_VALUE);
- if (NS_SUCCEEDED(rv)) {
- rv = regKey->ReadIntValue(NS_LITERAL_STRING("SubmitCrashReport"), &value);
- regKey->Close();
- if (NS_SUCCEEDED(rv)) {
- *aSubmitReports = !!value;
- return NS_OK;
- }
- }
-
- rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
- NS_ConvertUTF8toUTF16(regPath),
- nsIWindowsRegKey::ACCESS_QUERY_VALUE);
- if (NS_FAILED(rv)) {
- *aSubmitReports = true;
- return NS_OK;
- }
-
- rv = regKey->ReadIntValue(NS_LITERAL_STRING("SubmitCrashReport"), &value);
- // default to true on failure
- if (NS_FAILED(rv)) {
- value = 1;
- rv = NS_OK;
- }
- regKey->Close();
-
- *aSubmitReports = !!value;
- return NS_OK;
-#elif defined(XP_MACOSX)
- rv = NS_OK;
- if (writePref) {
- CFPropertyListRef cfValue = (CFPropertyListRef)(*aSubmitReports ? kCFBooleanTrue : kCFBooleanFalse);
- ::CFPreferencesSetAppValue(CFSTR("submitReport"),
- cfValue,
- reporterClientAppID);
- if (!::CFPreferencesAppSynchronize(reporterClientAppID))
- rv = NS_ERROR_FAILURE;
- }
- else {
- *aSubmitReports = true;
- Boolean keyExistsAndHasValidFormat = false;
- Boolean prefValue = ::CFPreferencesGetAppBooleanValue(CFSTR("submitReport"),
- reporterClientAppID,
- &keyExistsAndHasValidFormat);
- if (keyExistsAndHasValidFormat)
- *aSubmitReports = !!prefValue;
- }
- return rv;
-#elif defined(XP_UNIX)
- /*
- * NOTE! This needs to stay in sync with the preference checking code
- * in toolkit/crashreporter/client/crashreporter_linux.cpp
- */
- nsCOMPtr<nsIFile> reporterINI;
- rv = NS_GetSpecialDirectory("UAppData", getter_AddRefs(reporterINI));
- NS_ENSURE_SUCCESS(rv, rv);
- reporterINI->AppendNative(NS_LITERAL_CSTRING("Crash Reports"));
- reporterINI->AppendNative(NS_LITERAL_CSTRING("crashreporter.ini"));
-
- bool exists;
- rv = reporterINI->Exists(&exists);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!exists) {
- if (!writePref) {
- // If reading the pref, default to true if .ini doesn't exist.
- *aSubmitReports = true;
- return NS_OK;
- }
- // Create the file so the INI processor can write to it.
- rv = reporterINI->Create(nsIFile::NORMAL_FILE_TYPE, 0600);
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- nsCOMPtr<nsIINIParserFactory> iniFactory =
- do_GetService("@mozilla.org/xpcom/ini-processor-factory;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIINIParser> iniParser;
- rv = iniFactory->CreateINIParser(reporterINI,
- getter_AddRefs(iniParser));
- NS_ENSURE_SUCCESS(rv, rv);
-
- // If we're writing the pref, just set and we're done.
- if (writePref) {
- nsCOMPtr<nsIINIParserWriter> iniWriter = do_QueryInterface(iniParser);
- NS_ENSURE_TRUE(iniWriter, NS_ERROR_FAILURE);
-
- rv = iniWriter->SetString(NS_LITERAL_CSTRING("Crash Reporter"),
- NS_LITERAL_CSTRING("SubmitReport"),
- *aSubmitReports ? NS_LITERAL_CSTRING("1") :
- NS_LITERAL_CSTRING("0"));
- NS_ENSURE_SUCCESS(rv, rv);
- rv = iniWriter->WriteFile(nullptr, 0);
- return rv;
- }
-
- nsAutoCString submitReportValue;
- rv = iniParser->GetString(NS_LITERAL_CSTRING("Crash Reporter"),
- NS_LITERAL_CSTRING("SubmitReport"),
- submitReportValue);
-
- // Default to "true" if the pref can't be found.
- if (NS_FAILED(rv))
- *aSubmitReports = true;
- else if (submitReportValue.EqualsASCII("0"))
- *aSubmitReports = false;
- else
- *aSubmitReports = true;
-
- return NS_OK;
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-nsresult GetSubmitReports(bool* aSubmitReports)
-{
- return PrefSubmitReports(aSubmitReports, false);
-}
-
-nsresult SetSubmitReports(bool aSubmitReports)
-{
- nsresult rv;
-
- nsCOMPtr<nsIObserverService> obsServ =
- mozilla::services::GetObserverService();
- if (!obsServ) {
- return NS_ERROR_FAILURE;
- }
-
- rv = PrefSubmitReports(&aSubmitReports, true);
- if (NS_FAILED(rv)) {
- return rv;
- }
-
- obsServ->NotifyObservers(nullptr, "submit-reports-pref-changed", nullptr);
- return NS_OK;
-}
-
-static void
-SetCrashEventsDir(nsIFile* aDir)
-{
- nsCOMPtr<nsIFile> eventsDir = aDir;
-
- const char *env = PR_GetEnv("CRASHES_EVENTS_DIR");
- if (env && *env) {
- NS_NewNativeLocalFile(nsDependentCString(env),
- false, getter_AddRefs(eventsDir));
- EnsureDirectoryExists(eventsDir);
- }
-
- if (eventsDirectory) {
- free(eventsDirectory);
- }
-
-#ifdef XP_WIN
- nsString path;
- eventsDir->GetPath(path);
- eventsDirectory = reinterpret_cast<wchar_t*>(ToNewUnicode(path));
-
- // Save the path in the environment for the crash reporter application.
- nsAutoString eventsDirEnv(NS_LITERAL_STRING("MOZ_CRASHREPORTER_EVENTS_DIRECTORY="));
- eventsDirEnv.Append(path);
- _wputenv(eventsDirEnv.get());
-#else
- nsCString path;
- eventsDir->GetNativePath(path);
- eventsDirectory = ToNewCString(path);
-
- // Save the path in the environment for the crash reporter application.
- nsAutoCString eventsDirEnv("MOZ_CRASHREPORTER_EVENTS_DIRECTORY=");
- eventsDirEnv.Append(path);
-
- // PR_SetEnv() wants the string to be available for the lifetime
- // of the app, so dup it here.
- char* oldEventsEnv = eventsEnv;
- eventsEnv = ToNewCString(eventsDirEnv);
- PR_SetEnv(eventsEnv);
-
- if (oldEventsEnv) {
- free(oldEventsEnv);
- }
-#endif
-}
-
-void
-SetProfileDirectory(nsIFile* aDir)
-{
- nsCOMPtr<nsIFile> dir;
- aDir->Clone(getter_AddRefs(dir));
-
- dir->Append(NS_LITERAL_STRING("crashes"));
- EnsureDirectoryExists(dir);
- dir->Append(NS_LITERAL_STRING("events"));
- EnsureDirectoryExists(dir);
- SetCrashEventsDir(dir);
-}
-
-void
-SetUserAppDataDirectory(nsIFile* aDir)
-{
- nsCOMPtr<nsIFile> dir;
- aDir->Clone(getter_AddRefs(dir));
-
- dir->Append(NS_LITERAL_STRING("Crash Reports"));
- EnsureDirectoryExists(dir);
- dir->Append(NS_LITERAL_STRING("events"));
- EnsureDirectoryExists(dir);
- SetCrashEventsDir(dir);
-}
-
-void
-UpdateCrashEventsDir()
-{
- const char *env = PR_GetEnv("CRASHES_EVENTS_DIR");
- if (env && *env) {
- SetCrashEventsDir(nullptr);
- }
-
- nsCOMPtr<nsIFile> eventsDir;
- nsresult rv = NS_GetSpecialDirectory("ProfD", getter_AddRefs(eventsDir));
- if (NS_SUCCEEDED(rv)) {
- SetProfileDirectory(eventsDir);
- return;
- }
-
- rv = NS_GetSpecialDirectory("UAppData", getter_AddRefs(eventsDir));
- if (NS_SUCCEEDED(rv)) {
- SetUserAppDataDirectory(eventsDir);
- return;
- }
-
- NS_WARNING("Couldn't get the user appdata directory. Crash events may not be produced.");
-}
-
-bool GetCrashEventsDir(nsAString& aPath)
-{
- if (!eventsDirectory) {
- return false;
- }
-
- aPath = CONVERT_XP_CHAR_TO_UTF16(eventsDirectory);
- return true;
-}
-
-void
-SetMemoryReportFile(nsIFile* aFile)
-{
- if (!gExceptionHandler) {
- return;
- }
-#ifdef XP_WIN
- nsString path;
- aFile->GetPath(path);
- memoryReportPath = reinterpret_cast<wchar_t*>(ToNewUnicode(path));
-#else
- nsCString path;
- aFile->GetNativePath(path);
- memoryReportPath = ToNewCString(path);
-#endif
-}
-
-nsresult
-GetDefaultMemoryReportFile(nsIFile** aFile)
-{
- nsCOMPtr<nsIFile> defaultMemoryReportFile;
- if (!defaultMemoryReportPath) {
- nsresult rv = NS_GetSpecialDirectory(NS_APP_PROFILE_DIR_STARTUP,
- getter_AddRefs(defaultMemoryReportFile));
- if (NS_FAILED(rv)) {
- return rv;
- }
- defaultMemoryReportFile->AppendNative(NS_LITERAL_CSTRING("memory-report.json.gz"));
- defaultMemoryReportPath = CreatePathFromFile(defaultMemoryReportFile);
- if (!defaultMemoryReportPath) {
- return NS_ERROR_FAILURE;
- }
- } else {
- CreateFileFromPath(*defaultMemoryReportPath,
- getter_AddRefs(defaultMemoryReportFile));
- if (!defaultMemoryReportFile) {
- return NS_ERROR_FAILURE;
- }
- }
- defaultMemoryReportFile.forget(aFile);
- return NS_OK;
-}
-
-void
-SetTelemetrySessionId(const nsACString& id)
-{
- if (!gExceptionHandler) {
- return;
- }
- if (currentSessionId) {
- free(currentSessionId);
- }
- currentSessionId = ToNewCString(id);
-}
-
-static void
-FindPendingDir()
-{
- if (pendingDirectory)
- return;
-
- nsCOMPtr<nsIFile> pendingDir;
- nsresult rv = NS_GetSpecialDirectory("UAppData", getter_AddRefs(pendingDir));
- if (NS_FAILED(rv)) {
- NS_WARNING("Couldn't get the user appdata directory, crash dumps will go in an unusual location");
- }
- else {
- pendingDir->Append(NS_LITERAL_STRING("Crash Reports"));
- pendingDir->Append(NS_LITERAL_STRING("pending"));
-
-#ifdef XP_WIN
- nsString path;
- pendingDir->GetPath(path);
- pendingDirectory = reinterpret_cast<wchar_t*>(ToNewUnicode(path));
-#else
- nsCString path;
- pendingDir->GetNativePath(path);
- pendingDirectory = ToNewCString(path);
-#endif
- }
-}
-
-// The "pending" dir is Crash Reports/pending, from which minidumps
-// can be submitted. Because this method may be called off the main thread,
-// we store the pending directory as a path.
-static bool
-GetPendingDir(nsIFile** dir)
-{
- // MOZ_ASSERT(OOPInitialized());
- if (!pendingDirectory) {
- return false;
- }
-
- nsCOMPtr<nsIFile> pending = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
- if (!pending) {
- NS_WARNING("Can't set up pending directory during shutdown.");
- return false;
- }
-#ifdef XP_WIN
- pending->InitWithPath(nsDependentString(pendingDirectory));
-#else
- pending->InitWithNativePath(nsDependentCString(pendingDirectory));
-#endif
- pending.swap(*dir);
- return true;
-}
-
-// The "limbo" dir is where minidumps go to wait for something else to
-// use them. If we're |ShouldReport()|, then the "something else" is
-// a minidump submitter, and they're coming from the
-// Crash Reports/pending/ dir. Otherwise, we don't know what the
-// "somthing else" is, but the minidumps stay in [profile]/minidumps/
-// limbo.
-static bool
-GetMinidumpLimboDir(nsIFile** dir)
-{
- if (ShouldReport()) {
- return GetPendingDir(dir);
- }
- else {
-#ifndef XP_LINUX
- CreateFileFromPath(gExceptionHandler->dump_path(), dir);
-#else
- CreateFileFromPath(gExceptionHandler->minidump_descriptor().directory(),
- dir);
-#endif
- return nullptr != *dir;
- }
-}
-
-void
-DeleteMinidumpFilesForID(const nsAString& id)
-{
- nsCOMPtr<nsIFile> minidumpFile;
- GetMinidumpForID(id, getter_AddRefs(minidumpFile));
- bool exists = false;
- if (minidumpFile && NS_SUCCEEDED(minidumpFile->Exists(&exists)) && exists) {
- nsCOMPtr<nsIFile> childExtraFile;
- GetExtraFileForMinidump(minidumpFile, getter_AddRefs(childExtraFile));
- if (childExtraFile) {
- childExtraFile->Remove(false);
- }
- minidumpFile->Remove(false);
- }
-}
-
-bool
-GetMinidumpForID(const nsAString& id, nsIFile** minidump)
-{
- if (!GetMinidumpLimboDir(minidump))
- return false;
- (*minidump)->Append(id + NS_LITERAL_STRING(".dmp"));
- return true;
-}
-
-bool
-GetIDFromMinidump(nsIFile* minidump, nsAString& id)
-{
- if (minidump && NS_SUCCEEDED(minidump->GetLeafName(id))) {
- id.Replace(id.Length() - 4, 4, NS_LITERAL_STRING(""));
- return true;
- }
- return false;
-}
-
-bool
-GetExtraFileForID(const nsAString& id, nsIFile** extraFile)
-{
- if (!GetMinidumpLimboDir(extraFile))
- return false;
- (*extraFile)->Append(id + NS_LITERAL_STRING(".extra"));
- return true;
-}
-
-bool
-GetExtraFileForMinidump(nsIFile* minidump, nsIFile** extraFile)
-{
- nsAutoString leafName;
- nsresult rv = minidump->GetLeafName(leafName);
- if (NS_FAILED(rv))
- return false;
-
- nsCOMPtr<nsIFile> extraF;
- rv = minidump->Clone(getter_AddRefs(extraF));
- if (NS_FAILED(rv))
- return false;
-
- leafName.Replace(leafName.Length() - 3, 3,
- NS_LITERAL_STRING("extra"));
- rv = extraF->SetLeafName(leafName);
- if (NS_FAILED(rv))
- return false;
-
- *extraFile = nullptr;
- extraF.swap(*extraFile);
- return true;
-}
-
-bool
-AppendExtraData(const nsAString& id, const AnnotationTable& data)
-{
- nsCOMPtr<nsIFile> extraFile;
- if (!GetExtraFileForID(id, getter_AddRefs(extraFile)))
- return false;
- return AppendExtraData(extraFile, data);
-}
-
-//-----------------------------------------------------------------------------
-// Helpers for AppendExtraData()
-//
-struct Blacklist {
- Blacklist() : mItems(nullptr), mLen(0) { }
- Blacklist(const char** items, int len) : mItems(items), mLen(len) { }
-
- bool Contains(const nsACString& key) const {
- for (int i = 0; i < mLen; ++i)
- if (key.EqualsASCII(mItems[i]))
- return true;
- return false;
- }
-
- const char** mItems;
- const int mLen;
-};
-
-static void
-WriteAnnotation(PRFileDesc* fd, const nsACString& key, const nsACString& value)
-{
- PR_Write(fd, key.BeginReading(), key.Length());
- PR_Write(fd, "=", 1);
- PR_Write(fd, value.BeginReading(), value.Length());
- PR_Write(fd, "\n", 1);
-}
-
-template<int N>
-void
-WriteLiteral(PRFileDesc* fd, const char (&str)[N])
-{
- PR_Write(fd, str, N - 1);
-}
-
-static bool
-WriteExtraData(nsIFile* extraFile,
- const AnnotationTable& data,
- const Blacklist& blacklist,
- bool writeCrashTime=false,
- bool truncate=false)
-{
- PRFileDesc* fd;
- int truncOrAppend = truncate ? PR_TRUNCATE : PR_APPEND;
- nsresult rv =
- extraFile->OpenNSPRFileDesc(PR_WRONLY | PR_CREATE_FILE | truncOrAppend,
- 0600, &fd);
- if (NS_FAILED(rv))
- return false;
-
- for (auto iter = data.ConstIter(); !iter.Done(); iter.Next()) {
- // Skip entries in the blacklist.
- const nsACString& key = iter.Key();
- if (blacklist.Contains(key)) {
- continue;
- }
- WriteAnnotation(fd, key, iter.Data());
- }
-
- if (writeCrashTime) {
- time_t crashTime = time(nullptr);
- char crashTimeString[32];
- XP_TTOA(crashTime, crashTimeString, 10);
-
- WriteAnnotation(fd,
- nsDependentCString("CrashTime"),
- nsDependentCString(crashTimeString));
-
- bool ignored = false;
- double uptimeTS = (TimeStamp::NowLoRes()-
- TimeStamp::ProcessCreation(ignored)).ToSecondsSigDigits();
- char uptimeTSString[64];
- SimpleNoCLibDtoA(uptimeTS, uptimeTSString, sizeof(uptimeTSString));
-
- WriteAnnotation(fd,
- nsDependentCString("UptimeTS"),
- nsDependentCString(uptimeTSString));
- }
-
- if (memoryReportPath) {
- WriteLiteral(fd, "ContainsMemoryReport=1\n");
- }
-
- PR_Close(fd);
- return true;
-}
-
-bool
-AppendExtraData(nsIFile* extraFile, const AnnotationTable& data)
-{
- return WriteExtraData(extraFile, data, Blacklist());
-}
-
-static bool
-GetExtraFileForChildPid(uint32_t aPid, nsIFile** aExtraFile)
-{
- MOZ_ASSERT(XRE_IsParentProcess());
-
- nsCOMPtr<nsIFile> extraFile;
- nsresult rv;
-
-#if defined(XP_WIN) || defined(XP_MACOSX)
- if (!childProcessTmpDir) {
- return false;
- }
- CreateFileFromPath(*childProcessTmpDir, getter_AddRefs(extraFile));
- if (!extraFile) {
- return false;
- }
-#elif defined(XP_UNIX)
- rv = NS_NewLocalFile(NS_LITERAL_STRING("/tmp"), false,
- getter_AddRefs(extraFile));
- if (NS_FAILED(rv)) {
- return false;
- }
-#else
-#error "Implement this for your platform"
-#endif
-
- nsAutoString leafName;
-#if defined(XP_WIN)
- leafName.AppendPrintf("%S%u%S", childCrashAnnotationBaseName, aPid,
- extraFileExtension);
-#else
- leafName.AppendPrintf("%s%u%s", childCrashAnnotationBaseName, aPid,
- extraFileExtension);
-#endif
-
- rv = extraFile->Append(leafName);
- if (NS_FAILED(rv)) {
- return false;
- }
-
- extraFile.forget(aExtraFile);
- return true;
-}
-
-static bool
-IsDataEscaped(char* aData)
-{
- if (strchr(aData, '\n')) {
- // There should not be any newlines
- return false;
- }
- char* pos = aData;
- while ((pos = strchr(pos, '\\'))) {
- if (*(pos + 1) != '\\') {
- return false;
- }
- // Add 2 to account for the second pos
- pos += 2;
- }
- return true;
-}
-
-static void
-ReadAndValidateExceptionTimeAnnotations(FILE*& aFd,
- AnnotationTable& aAnnotations)
-{
- char line[0x1000];
- while (fgets(line, sizeof(line), aFd)) {
- char* data = strchr(line, '=');
- if (!data) {
- // bad data? Abort!
- break;
- }
- // Move past the '='
- *data = 0;
- ++data;
- size_t dataLen = strlen(data);
- // Chop off any trailing newline
- if (dataLen > 0 && data[dataLen - 1] == '\n') {
- data[dataLen - 1] = 0;
- --dataLen;
- }
- // There should not be any newlines in the key
- if (strchr(line, '\n')) {
- break;
- }
- // Data should have been escaped by the child
- if (!IsDataEscaped(data)) {
- break;
- }
- // Looks good, save the (line,data) pair
- aAnnotations.Put(nsDependentCString(line),
- nsDependentCString(data, dataLen));
- }
-}
-
-/**
- * NOTE: One side effect of this function is that it deletes the
- * GeckoChildCrash<pid>.extra file if it exists, once processed.
- */
-static bool
-WriteExtraForMinidump(nsIFile* minidump,
- uint32_t pid,
- const Blacklist& blacklist,
- nsIFile** extraFile)
-{
- nsCOMPtr<nsIFile> extra;
- if (!GetExtraFileForMinidump(minidump, getter_AddRefs(extra))) {
- return false;
- }
-
- if (!WriteExtraData(extra, *crashReporterAPIData_Hash,
- blacklist,
- true /*write crash time*/,
- true /*truncate*/)) {
- return false;
- }
-
- nsCOMPtr<nsIFile> exceptionTimeExtra;
- FILE* fd;
- if (pid && GetExtraFileForChildPid(pid, getter_AddRefs(exceptionTimeExtra)) &&
- NS_SUCCEEDED(exceptionTimeExtra->OpenANSIFileDesc("r", &fd))) {
- AnnotationTable exceptionTimeAnnotations;
- ReadAndValidateExceptionTimeAnnotations(fd, exceptionTimeAnnotations);
- fclose(fd);
- if (!AppendExtraData(extra, exceptionTimeAnnotations)) {
- return false;
- }
- }
- if (exceptionTimeExtra) {
- exceptionTimeExtra->Remove(false);
- }
-
- extra.forget(extraFile);
-
- return true;
-}
-
-// It really only makes sense to call this function when
-// ShouldReport() is true.
-// Uses dumpFile's filename to generate memoryReport's filename (same name with
-// a different extension)
-static bool
-MoveToPending(nsIFile* dumpFile, nsIFile* extraFile, nsIFile* memoryReport)
-{
- nsCOMPtr<nsIFile> pendingDir;
- if (!GetPendingDir(getter_AddRefs(pendingDir)))
- return false;
-
- if (NS_FAILED(dumpFile->MoveTo(pendingDir, EmptyString()))) {
- return false;
- }
-
- if (extraFile && NS_FAILED(extraFile->MoveTo(pendingDir, EmptyString()))) {
- return false;
- }
-
- if (memoryReport) {
- nsAutoString leafName;
- nsresult rv = dumpFile->GetLeafName(leafName);
- if (NS_FAILED(rv)) {
- return false;
- }
- // Generate the correct memory report filename from the dumpFile's name
- leafName.Replace(leafName.Length() - 4, 4,
- static_cast<nsString>(CONVERT_XP_CHAR_TO_UTF16(memoryReportExtension)));
- if (NS_FAILED(memoryReport->MoveTo(pendingDir, leafName))) {
- return false;
- }
- }
-
- return true;
-}
-
-static void
-OnChildProcessDumpRequested(void* aContext,
-#ifdef XP_MACOSX
- const ClientInfo& aClientInfo,
- const xpstring& aFilePath
-#else
- const ClientInfo* aClientInfo,
- const xpstring* aFilePath
-#endif
- )
-{
- nsCOMPtr<nsIFile> minidump;
- nsCOMPtr<nsIFile> extraFile;
-
- // Hold the mutex until the current dump request is complete, to
- // prevent UnsetExceptionHandler() from pulling the rug out from
- // under us.
- MutexAutoLock lock(*dumpSafetyLock);
- if (!isSafeToDump)
- return;
-
- CreateFileFromPath(
-#ifdef XP_MACOSX
- aFilePath,
-#else
- *aFilePath,
-#endif
- getter_AddRefs(minidump));
-
- uint32_t pid =
-#ifdef XP_MACOSX
- aClientInfo.pid();
-#else
- aClientInfo->pid();
-#endif
-
- if (!WriteExtraForMinidump(minidump, pid,
- Blacklist(kSubprocessBlacklist,
- ArrayLength(kSubprocessBlacklist)),
- getter_AddRefs(extraFile)))
- return;
-
- if (ShouldReport()) {
- nsCOMPtr<nsIFile> memoryReport;
- if (memoryReportPath) {
- CreateFileFromPath(memoryReportPath, getter_AddRefs(memoryReport));
- MOZ_ASSERT(memoryReport);
- }
- MoveToPending(minidump, extraFile, memoryReport);
- }
-
- {
-
-#ifdef MOZ_CRASHREPORTER_INJECTOR
- bool runCallback;
-#endif
- {
- MutexAutoLock lock(*dumpMapLock);
- ChildProcessData* pd = pidToMinidump->PutEntry(pid);
- MOZ_ASSERT(!pd->minidump);
- pd->minidump = minidump;
- pd->sequence = ++crashSequence;
-#ifdef MOZ_CRASHREPORTER_INJECTOR
- runCallback = nullptr != pd->callback;
-#endif
- }
-#ifdef MOZ_CRASHREPORTER_INJECTOR
- if (runCallback)
- NS_DispatchToMainThread(new ReportInjectedCrash(pid));
-#endif
- }
-}
-
-static bool
-OOPInitialized()
-{
- return pidToMinidump != nullptr;
-}
-
-void
-OOPInit()
-{
- class ProxyToMainThread : public Runnable
- {
- public:
- NS_IMETHOD Run() override {
- OOPInit();
- return NS_OK;
- }
- };
- if (!NS_IsMainThread()) {
- // This logic needs to run on the main thread
- nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
- mozilla::SyncRunnable::DispatchToThread(mainThread, new ProxyToMainThread());
- return;
- }
-
- if (OOPInitialized())
- return;
-
- MOZ_ASSERT(NS_IsMainThread());
-
- MOZ_ASSERT(gExceptionHandler != nullptr,
- "attempt to initialize OOP crash reporter before in-process crashreporter!");
-
-#if (defined(XP_WIN) || defined(XP_MACOSX))
- nsCOMPtr<nsIFile> tmpDir;
- if (NS_SUCCEEDED(NS_GetSpecialDirectory(NS_OS_TEMP_DIR,
- getter_AddRefs(tmpDir)))) {
- childProcessTmpDir = CreatePathFromFile(tmpDir);
- }
-#endif // (defined(XP_WIN) || defined(XP_MACOSX))
-
-#if defined(XP_WIN)
- childCrashNotifyPipe =
- PR_smprintf("\\\\.\\pipe\\gecko-crash-server-pipe.%i",
- static_cast<int>(::GetCurrentProcessId()));
-
- const std::wstring dumpPath = gExceptionHandler->dump_path();
- crashServer = new CrashGenerationServer(
- std::wstring(NS_ConvertASCIItoUTF16(childCrashNotifyPipe).get()),
- nullptr, // default security attributes
- nullptr, nullptr, // we don't care about process connect here
- OnChildProcessDumpRequested, nullptr,
- nullptr, nullptr, // we don't care about process exit here
- nullptr, nullptr, // we don't care about upload request here
- true, // automatically generate dumps
- &dumpPath);
-
-#elif defined(XP_LINUX)
- if (!CrashGenerationServer::CreateReportChannel(&serverSocketFd,
- &clientSocketFd))
- NS_RUNTIMEABORT("can't create crash reporter socketpair()");
-
- const std::string dumpPath =
- gExceptionHandler->minidump_descriptor().directory();
- crashServer = new CrashGenerationServer(
- serverSocketFd,
- OnChildProcessDumpRequested, nullptr,
- nullptr, nullptr, // we don't care about process exit here
- true,
- &dumpPath);
-
-#elif defined(XP_MACOSX)
- childCrashNotifyPipe =
- PR_smprintf("gecko-crash-server-pipe.%i",
- static_cast<int>(getpid()));
- const std::string dumpPath = gExceptionHandler->dump_path();
-
- crashServer = new CrashGenerationServer(
- childCrashNotifyPipe,
- nullptr,
- nullptr,
- OnChildProcessDumpRequested, nullptr,
- nullptr, nullptr,
- true, // automatically generate dumps
- dumpPath);
-#endif
-
- if (!crashServer->Start())
- NS_RUNTIMEABORT("can't start crash reporter server()");
-
- pidToMinidump = new ChildMinidumpMap();
-
- dumpMapLock = new Mutex("CrashReporter::dumpMapLock");
-
- FindPendingDir();
- UpdateCrashEventsDir();
-}
-
-static void
-OOPDeinit()
-{
- if (!OOPInitialized()) {
- NS_WARNING("OOPDeinit() without successful OOPInit()");
- return;
- }
-
-#ifdef MOZ_CRASHREPORTER_INJECTOR
- if (sInjectorThread) {
- sInjectorThread->Shutdown();
- NS_RELEASE(sInjectorThread);
- }
-#endif
-
- delete crashServer;
- crashServer = nullptr;
-
- delete dumpMapLock;
- dumpMapLock = nullptr;
-
- delete pidToMinidump;
- pidToMinidump = nullptr;
-
-#if defined(XP_WIN)
- PR_Free(childCrashNotifyPipe);
- childCrashNotifyPipe = nullptr;
-#endif
-}
-
-#if defined(XP_WIN) || defined(XP_MACOSX)
-// Parent-side API for children
-const char*
-GetChildNotificationPipe()
-{
- if (!GetEnabled())
- return kNullNotifyPipe;
-
- MOZ_ASSERT(OOPInitialized());
-
- return childCrashNotifyPipe;
-}
-#endif
-
-#ifdef MOZ_CRASHREPORTER_INJECTOR
-void
-InjectCrashReporterIntoProcess(DWORD processID, InjectorCrashCallback* cb)
-{
- if (!GetEnabled())
- return;
-
- if (!OOPInitialized())
- OOPInit();
-
- if (!sInjectorThread) {
- if (NS_FAILED(NS_NewThread(&sInjectorThread)))
- return;
- }
-
- {
- MutexAutoLock lock(*dumpMapLock);
- ChildProcessData* pd = pidToMinidump->PutEntry(processID);
- MOZ_ASSERT(!pd->minidump && !pd->callback);
- pd->callback = cb;
- }
-
- nsCOMPtr<nsIRunnable> r = new InjectCrashRunnable(processID);
- sInjectorThread->Dispatch(r, nsIEventTarget::DISPATCH_NORMAL);
-}
-
-NS_IMETHODIMP
-ReportInjectedCrash::Run()
-{
- // Crash reporting may have been disabled after this method was dispatched
- if (!OOPInitialized())
- return NS_OK;
-
- InjectorCrashCallback* cb;
- {
- MutexAutoLock lock(*dumpMapLock);
- ChildProcessData* pd = pidToMinidump->GetEntry(mPID);
- if (!pd || !pd->callback)
- return NS_OK;
-
- MOZ_ASSERT(pd->minidump);
-
- cb = pd->callback;
- }
-
- cb->OnCrash(mPID);
- return NS_OK;
-}
-
-void
-UnregisterInjectorCallback(DWORD processID)
-{
- if (!OOPInitialized())
- return;
-
- MutexAutoLock lock(*dumpMapLock);
- pidToMinidump->RemoveEntry(processID);
-}
-
-#endif // MOZ_CRASHREPORTER_INJECTOR
-
-bool
-CheckForLastRunCrash()
-{
- if (lastRunCrashID)
- return true;
-
- // The exception handler callback leaves the filename of the
- // last minidump in a known file.
- nsCOMPtr<nsIFile> lastCrashFile;
- CreateFileFromPath(crashMarkerFilename,
- getter_AddRefs(lastCrashFile));
-
- bool exists;
- if (NS_FAILED(lastCrashFile->Exists(&exists)) || !exists) {
- return false;
- }
-
- nsAutoCString lastMinidump_contents;
- if (NS_FAILED(GetFileContents(lastCrashFile, lastMinidump_contents))) {
- return false;
- }
- lastCrashFile->Remove(false);
-
-#ifdef XP_WIN
- // Ugly but effective.
- nsDependentString lastMinidump(
- reinterpret_cast<const char16_t*>(lastMinidump_contents.get()));
-#else
- nsAutoCString lastMinidump = lastMinidump_contents;
-#endif
- nsCOMPtr<nsIFile> lastMinidumpFile;
- CreateFileFromPath(lastMinidump.get(),
- getter_AddRefs(lastMinidumpFile));
-
- if (!lastMinidumpFile || NS_FAILED(lastMinidumpFile->Exists(&exists)) || !exists) {
- return false;
- }
-
- nsCOMPtr<nsIFile> lastExtraFile;
- if (!GetExtraFileForMinidump(lastMinidumpFile,
- getter_AddRefs(lastExtraFile))) {
- return false;
- }
-
- nsCOMPtr<nsIFile> memoryReportFile;
- nsresult rv = GetDefaultMemoryReportFile(getter_AddRefs(memoryReportFile));
- if (NS_FAILED(rv) || NS_FAILED(memoryReportFile->Exists(&exists)) || !exists) {
- memoryReportFile = nullptr;
- }
-
- FindPendingDir();
-
- // Move {dump,extra,memory} to pending folder
- if (!MoveToPending(lastMinidumpFile, lastExtraFile, memoryReportFile)) {
- return false;
- }
-
- lastRunCrashID = new nsString();
- return GetIDFromMinidump(lastMinidumpFile, *lastRunCrashID);
-}
-
-bool
-GetLastRunCrashID(nsAString& id)
-{
- if (!lastRunCrashID_checked) {
- CheckForLastRunCrash();
- lastRunCrashID_checked = true;
- }
-
- if (!lastRunCrashID) {
- return false;
- }
-
- id = *lastRunCrashID;
- return true;
-}
-
-#if defined(XP_WIN) || defined(XP_MACOSX)
-void
-InitChildProcessTmpDir()
-{
- MOZ_ASSERT(!XRE_IsParentProcess());
- // When retrieved by the child process, this will always resolve to the
- // correct directory regardless of sandbox level.
- nsCOMPtr<nsIFile> tmpDir;
- nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(tmpDir));
- if (NS_SUCCEEDED(rv)) {
- childProcessTmpDir = CreatePathFromFile(tmpDir);
- }
-}
-#endif // defined(XP_WIN) || defined(XP_MACOSX)
-
-#if defined(XP_WIN)
-// Child-side API
-bool
-SetRemoteExceptionHandler(const nsACString& crashPipe)
-{
- // crash reporting is disabled
- if (crashPipe.Equals(kNullNotifyPipe))
- return true;
-
- MOZ_ASSERT(!gExceptionHandler, "crash client already init'd");
-
- gExceptionHandler = new google_breakpad::
- ExceptionHandler(L"",
- ChildFPEFilter,
- nullptr, // no minidump callback
- nullptr, // no callback context
- google_breakpad::ExceptionHandler::HANDLER_ALL,
- GetMinidumpType(),
- NS_ConvertASCIItoUTF16(crashPipe).get(),
- nullptr);
- gExceptionHandler->set_handle_debug_exceptions(true);
-
- mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);
-
- oldTerminateHandler = std::set_terminate(&TerminateHandler);
-
- // we either do remote or nothing, no fallback to regular crash reporting
- return gExceptionHandler->IsOutOfProcess();
-}
-
-//--------------------------------------------------
-#elif defined(XP_LINUX)
-
-// Parent-side API for children
-bool
-CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd)
-{
- if (!GetEnabled()) {
- *childCrashFd = -1;
- *childCrashRemapFd = -1;
- return true;
- }
-
- MOZ_ASSERT(OOPInitialized());
-
- *childCrashFd = clientSocketFd;
- *childCrashRemapFd = kMagicChildCrashReportFd;
-
- return true;
-}
-
-// Child-side API
-bool
-SetRemoteExceptionHandler()
-{
- MOZ_ASSERT(!gExceptionHandler, "crash client already init'd");
-
- // MinidumpDescriptor requires a non-empty path.
- google_breakpad::MinidumpDescriptor path(".");
-
- gExceptionHandler = new google_breakpad::
- ExceptionHandler(path,
- ChildFilter,
- nullptr, // no minidump callback
- nullptr, // no callback context
- true, // install signal handlers
- kMagicChildCrashReportFd);
-
- if (gDelayedAnnotations) {
- for (uint32_t i = 0; i < gDelayedAnnotations->Length(); i++) {
- gDelayedAnnotations->ElementAt(i)->Run();
- }
- delete gDelayedAnnotations;
- }
-
- mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);
-
- oldTerminateHandler = std::set_terminate(&TerminateHandler);
-
- // we either do remote or nothing, no fallback to regular crash reporting
- return gExceptionHandler->IsOutOfProcess();
-}
-
-//--------------------------------------------------
-#elif defined(XP_MACOSX)
-// Child-side API
-bool
-SetRemoteExceptionHandler(const nsACString& crashPipe)
-{
- // crash reporting is disabled
- if (crashPipe.Equals(kNullNotifyPipe))
- return true;
-
- MOZ_ASSERT(!gExceptionHandler, "crash client already init'd");
-
- gExceptionHandler = new google_breakpad::
- ExceptionHandler("",
- ChildFilter,
- nullptr, // no minidump callback
- nullptr, // no callback context
- true, // install signal handlers
- crashPipe.BeginReading());
-
- mozalloc_set_oom_abort_handler(AnnotateOOMAllocationSize);
-
- oldTerminateHandler = std::set_terminate(&TerminateHandler);
-
- // we either do remote or nothing, no fallback to regular crash reporting
- return gExceptionHandler->IsOutOfProcess();
-}
-#endif // XP_WIN
-
-
-bool
-TakeMinidumpForChild(uint32_t childPid, nsIFile** dump, uint32_t* aSequence)
-{
- if (!GetEnabled())
- return false;
-
- MutexAutoLock lock(*dumpMapLock);
-
- ChildProcessData* pd = pidToMinidump->GetEntry(childPid);
- if (!pd)
- return false;
-
- NS_IF_ADDREF(*dump = pd->minidump);
- if (aSequence) {
- *aSequence = pd->sequence;
- }
-
- pidToMinidump->RemoveEntry(pd);
-
- return !!*dump;
-}
-
-//-----------------------------------------------------------------------------
-// CreatePairedMinidumps() and helpers
-//
-
-void
-RenameAdditionalHangMinidump(nsIFile* minidump, nsIFile* childMinidump,
- const nsACString& name)
-{
- nsCOMPtr<nsIFile> directory;
- childMinidump->GetParent(getter_AddRefs(directory));
- if (!directory)
- return;
-
- nsAutoCString leafName;
- childMinidump->GetNativeLeafName(leafName);
-
- // turn "<id>.dmp" into "<id>-<name>.dmp
- leafName.Insert(NS_LITERAL_CSTRING("-") + name, leafName.Length() - 4);
-
- if (NS_FAILED(minidump->MoveToNative(directory, leafName))) {
- NS_WARNING("RenameAdditionalHangMinidump failed to move minidump.");
- }
-}
-
-static bool
-PairedDumpCallback(
-#ifdef XP_LINUX
- const MinidumpDescriptor& descriptor,
-#else
- const XP_CHAR* dump_path,
- const XP_CHAR* minidump_id,
-#endif
- void* context,
-#ifdef XP_WIN32
- EXCEPTION_POINTERS* /*unused*/,
- MDRawAssertionInfo* /*unused*/,
-#endif
- bool succeeded)
-{
- nsCOMPtr<nsIFile>& minidump = *static_cast< nsCOMPtr<nsIFile>* >(context);
-
- xpstring dump;
-#ifdef XP_LINUX
- dump = descriptor.path();
-#else
- dump = dump_path;
- dump += XP_PATH_SEPARATOR;
- dump += minidump_id;
- dump += dumpFileExtension;
-#endif
-
- CreateFileFromPath(dump, getter_AddRefs(minidump));
- return true;
-}
-
-static bool
-PairedDumpCallbackExtra(
-#ifdef XP_LINUX
- const MinidumpDescriptor& descriptor,
-#else
- const XP_CHAR* dump_path,
- const XP_CHAR* minidump_id,
-#endif
- void* context,
-#ifdef XP_WIN32
- EXCEPTION_POINTERS* /*unused*/,
- MDRawAssertionInfo* /*unused*/,
-#endif
- bool succeeded)
-{
- PairedDumpCallback(
-#ifdef XP_LINUX
- descriptor,
-#else
- dump_path, minidump_id,
-#endif
- context,
-#ifdef XP_WIN32
- nullptr, nullptr,
-#endif
- succeeded);
-
- nsCOMPtr<nsIFile>& minidump = *static_cast< nsCOMPtr<nsIFile>* >(context);
-
- nsCOMPtr<nsIFile> extra;
- return WriteExtraForMinidump(minidump, 0, Blacklist(), getter_AddRefs(extra));
-}
-
-ThreadId
-CurrentThreadId()
-{
-#if defined(XP_WIN)
- return ::GetCurrentThreadId();
-#elif defined(XP_LINUX)
- return sys_gettid();
-#elif defined(XP_MACOSX)
- // Just return an index, since Mach ports can't be directly serialized
- thread_act_port_array_t threads_for_task;
- mach_msg_type_number_t thread_count;
-
- if (task_threads(mach_task_self(), &threads_for_task, &thread_count))
- return -1;
-
- for (unsigned int i = 0; i < thread_count; ++i) {
- if (threads_for_task[i] == mach_thread_self())
- return i;
- }
- abort();
-#else
-# error "Unsupported platform"
-#endif
-}
-
-#ifdef XP_MACOSX
-static mach_port_t
-GetChildThread(ProcessHandle childPid, ThreadId childBlamedThread)
-{
- mach_port_t childThread = MACH_PORT_NULL;
- thread_act_port_array_t threads_for_task;
- mach_msg_type_number_t thread_count;
-
- if (task_threads(childPid, &threads_for_task, &thread_count)
- == KERN_SUCCESS && childBlamedThread < thread_count) {
- childThread = threads_for_task[childBlamedThread];
- }
-
- return childThread;
-}
-#endif
-
-bool TakeMinidump(nsIFile** aResult, bool aMoveToPending)
-{
- if (!GetEnabled())
- return false;
-
- AutoIOInterposerDisable disableIOInterposition;
-
- xpstring dump_path;
-#ifndef XP_LINUX
- dump_path = gExceptionHandler->dump_path();
-#else
- dump_path = gExceptionHandler->minidump_descriptor().directory();
-#endif
-
- // capture the dump
- if (!google_breakpad::ExceptionHandler::WriteMinidump(
- dump_path,
-#ifdef XP_MACOSX
- true,
-#endif
- PairedDumpCallback,
- static_cast<void*>(aResult)
-#ifdef XP_WIN32
- , GetMinidumpType()
-#endif
- )) {
- return false;
- }
-
- if (aMoveToPending) {
- MoveToPending(*aResult, nullptr, nullptr);
- }
- return true;
-}
-
-bool
-CreateMinidumpsAndPair(ProcessHandle aTargetPid,
- ThreadId aTargetBlamedThread,
- const nsACString& aIncomingPairName,
- nsIFile* aIncomingDumpToPair,
- nsIFile** aMainDumpOut)
-{
- if (!GetEnabled()) {
- return false;
- }
-
- AutoIOInterposerDisable disableIOInterposition;
-
-#ifdef XP_MACOSX
- mach_port_t targetThread = GetChildThread(aTargetPid, aTargetBlamedThread);
-#else
- ThreadId targetThread = aTargetBlamedThread;
-#endif
-
- xpstring dump_path;
-#ifndef XP_LINUX
- dump_path = gExceptionHandler->dump_path();
-#else
- dump_path = gExceptionHandler->minidump_descriptor().directory();
-#endif
-
- // dump the target
- nsCOMPtr<nsIFile> targetMinidump;
- if (!google_breakpad::ExceptionHandler::WriteMinidumpForChild(
- aTargetPid,
- targetThread,
- dump_path,
- PairedDumpCallbackExtra,
- static_cast<void*>(&targetMinidump)
-#ifdef XP_WIN32
- , GetMinidumpType()
-#endif
- ))
- return false;
-
- nsCOMPtr<nsIFile> targetExtra;
- GetExtraFileForMinidump(targetMinidump, getter_AddRefs(targetExtra));
-
- // If aIncomingDumpToPair isn't valid, create a dump of this process.
- nsCOMPtr<nsIFile> incomingDump;
- if (aIncomingDumpToPair == nullptr) {
- if (!google_breakpad::ExceptionHandler::WriteMinidump(
- dump_path,
-#ifdef XP_MACOSX
- true,
-#endif
- PairedDumpCallback,
- static_cast<void*>(&incomingDump)
-#ifdef XP_WIN32
- , GetMinidumpType()
-#endif
- )) {
- targetMinidump->Remove(false);
- targetExtra->Remove(false);
- return false;
- }
- } else {
- incomingDump = aIncomingDumpToPair;
- }
-
- RenameAdditionalHangMinidump(incomingDump, targetMinidump, aIncomingPairName);
-
- if (ShouldReport()) {
- MoveToPending(targetMinidump, targetExtra, nullptr);
- MoveToPending(incomingDump, nullptr, nullptr);
- }
-
- targetMinidump.forget(aMainDumpOut);
-
- return true;
-}
-
-bool
-CreateAdditionalChildMinidump(ProcessHandle childPid,
- ThreadId childBlamedThread,
- nsIFile* parentMinidump,
- const nsACString& name)
-{
- if (!GetEnabled())
- return false;
-
-#ifdef XP_MACOSX
- mach_port_t childThread = GetChildThread(childPid, childBlamedThread);
-#else
- ThreadId childThread = childBlamedThread;
-#endif
-
- xpstring dump_path;
-#ifndef XP_LINUX
- dump_path = gExceptionHandler->dump_path();
-#else
- dump_path = gExceptionHandler->minidump_descriptor().directory();
-#endif
-
- // dump the child
- nsCOMPtr<nsIFile> childMinidump;
- if (!google_breakpad::ExceptionHandler::WriteMinidumpForChild(
- childPid,
- childThread,
- dump_path,
- PairedDumpCallback,
- static_cast<void*>(&childMinidump)
-#ifdef XP_WIN32
- , GetMinidumpType()
-#endif
- )) {
- return false;
- }
-
- RenameAdditionalHangMinidump(childMinidump, parentMinidump, name);
-
- return true;
-}
-
-bool
-UnsetRemoteExceptionHandler()
-{
- std::set_terminate(oldTerminateHandler);
- delete gExceptionHandler;
- gExceptionHandler = nullptr;
- return true;
-}
-
-#if defined(MOZ_WIDGET_ANDROID)
-void AddLibraryMapping(const char* library_name,
- uintptr_t start_address,
- size_t mapping_length,
- size_t file_offset)
-{
- if (!gExceptionHandler) {
- mapping_info info;
- info.name = library_name;
- info.start_address = start_address;
- info.length = mapping_length;
- info.file_offset = file_offset;
- library_mappings.push_back(info);
- }
- else {
- PageAllocator allocator;
- auto_wasteful_vector<uint8_t, sizeof(MDGUID)> guid(&allocator);
- FileID::ElfFileIdentifierFromMappedFile((void const *)start_address, guid);
- gExceptionHandler->AddMappingInfo(library_name,
- guid.data(),
- start_address,
- mapping_length,
- file_offset);
- }
-}
-#endif
-
-} // namespace CrashReporter
diff --git a/toolkit/crashreporter/nsExceptionHandler.h b/toolkit/crashreporter/nsExceptionHandler.h
deleted file mode 100644
index f2db629f91..0000000000
--- a/toolkit/crashreporter/nsExceptionHandler.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsExceptionHandler_h__
-#define nsExceptionHandler_h__
-
-#include "mozilla/Assertions.h"
-
-#include <stddef.h>
-#include <stdint.h>
-#include "nsError.h"
-#include "nsStringGlue.h"
-
-#if defined(XP_WIN32)
-#ifdef WIN32_LEAN_AND_MEAN
-#undef WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#endif
-
-#if defined(XP_MACOSX)
-#include <mach/mach.h>
-#endif
-
-#if defined(XP_LINUX)
-#include <signal.h>
-#endif
-
-class nsIFile;
-template<class KeyClass, class DataType> class nsDataHashtable;
-class nsCStringHashKey;
-
-namespace CrashReporter {
-nsresult SetExceptionHandler(nsIFile* aXREDirectory, bool force=false);
-nsresult UnsetExceptionHandler();
-
-/**
- * Tell the crash reporter to recalculate where crash events files should go.
- * SetCrashEventsDir is used before XPCOM is initialized from the startup
- * code.
- *
- * UpdateCrashEventsDir uses the directory service to re-set the
- * crash event directory based on the current profile.
- *
- * 1. If environment variable is present, use it. We don't expect
- * the environment variable except for tests and other atypical setups.
- * 2. <profile>/crashes/events
- * 3. <UAppData>/Crash Reports/events
- */
-void SetUserAppDataDirectory(nsIFile* aDir);
-void SetProfileDirectory(nsIFile* aDir);
-void UpdateCrashEventsDir();
-void SetMemoryReportFile(nsIFile* aFile);
-nsresult GetDefaultMemoryReportFile(nsIFile** aFile);
-void SetTelemetrySessionId(const nsACString& id);
-
-/**
- * Get the path where crash event files should be written.
- */
-bool GetCrashEventsDir(nsAString& aPath);
-
-bool GetEnabled();
-bool GetServerURL(nsACString& aServerURL);
-nsresult SetServerURL(const nsACString& aServerURL);
-bool GetMinidumpPath(nsAString& aPath);
-nsresult SetMinidumpPath(const nsAString& aPath);
-
-
-// AnnotateCrashReport, RemoveCrashReportAnnotation and
-// AppendAppNotesToCrashReport may be called from any thread in a chrome
-// process, but may only be called from the main thread in a content process.
-nsresult AnnotateCrashReport(const nsACString& key, const nsACString& data);
-nsresult RemoveCrashReportAnnotation(const nsACString& key);
-nsresult AppendAppNotesToCrashReport(const nsACString& data);
-
-void AnnotateOOMAllocationSize(size_t size);
-void AnnotateTexturesSize(size_t size);
-void AnnotatePendingIPC(size_t aNumOfPendingIPC,
- uint32_t aTopPendingIPCCount,
- const char* aTopPendingIPCName,
- uint32_t aTopPendingIPCType);
-nsresult SetGarbageCollecting(bool collecting);
-void SetEventloopNestingLevel(uint32_t level);
-
-nsresult SetRestartArgs(int argc, char** argv);
-nsresult SetupExtraData(nsIFile* aAppDataDirectory,
- const nsACString& aBuildID);
-bool GetLastRunCrashID(nsAString& id);
-
-// Registers an additional memory region to be included in the minidump
-nsresult RegisterAppMemory(void* ptr, size_t length);
-nsresult UnregisterAppMemory(void* ptr);
-
-// Functions for working with minidumps and .extras
-typedef nsDataHashtable<nsCStringHashKey, nsCString> AnnotationTable;
-
-void DeleteMinidumpFilesForID(const nsAString& id);
-bool GetMinidumpForID(const nsAString& id, nsIFile** minidump);
-bool GetIDFromMinidump(nsIFile* minidump, nsAString& id);
-bool GetExtraFileForID(const nsAString& id, nsIFile** extraFile);
-bool GetExtraFileForMinidump(nsIFile* minidump, nsIFile** extraFile);
-bool AppendExtraData(const nsAString& id, const AnnotationTable& data);
-bool AppendExtraData(nsIFile* extraFile, const AnnotationTable& data);
-
-/*
- * Renames the stand alone dump file aDumpFile to:
- * |aOwnerDumpFile-aDumpFileProcessType.dmp|
- * and moves it into the same directory as aOwnerDumpFile. Does not
- * modify aOwnerDumpFile in any way.
- *
- * @param aDumpFile - the dump file to associate with aOwnerDumpFile.
- * @param aOwnerDumpFile - the new owner of aDumpFile.
- * @param aDumpFileProcessType - process name associated with aDumpFile.
- */
-void RenameAdditionalHangMinidump(nsIFile* aDumpFile, const nsIFile* aOwnerDumpFile,
- const nsACString& aDumpFileProcessType);
-
-#ifdef XP_WIN32
- nsresult WriteMinidumpForException(EXCEPTION_POINTERS* aExceptionInfo);
-#endif
-#ifdef XP_LINUX
- bool WriteMinidumpForSigInfo(int signo, siginfo_t* info, void* uc);
-#endif
-#ifdef XP_MACOSX
- nsresult AppendObjCExceptionInfoToAppNotes(void *inException);
-#endif
-nsresult GetSubmitReports(bool* aSubmitReport);
-nsresult SetSubmitReports(bool aSubmitReport);
-
-// Out-of-process crash reporter API.
-
-// Initializes out-of-process crash reporting. This method must be called
-// before the platform-specific notification pipe APIs are called. If called
-// from off the main thread, this method will synchronously proxy to the main
-// thread.
-void OOPInit();
-
-/*
- * Takes a minidump for the current process and returns the dump file.
- * Callers are responsible for managing the resulting file.
- *
- * @param aResult - file pointer that holds the resulting minidump.
- * @param aMoveToPending - if true move the report to the report
- * pending directory.
- * @returns boolean indicating success or failure.
- */
-bool TakeMinidump(nsIFile** aResult, bool aMoveToPending = false);
-
-// Return true if a dump was found for |childPid|, and return the
-// path in |dump|. The caller owns the last reference to |dump| if it
-// is non-nullptr. The sequence parameter will be filled with an ordinal
-// indicating which remote process crashed first.
-bool TakeMinidumpForChild(uint32_t childPid,
- nsIFile** dump,
- uint32_t* aSequence = nullptr);
-
-#if defined(XP_WIN)
-typedef HANDLE ProcessHandle;
-typedef DWORD ThreadId;
-#elif defined(XP_MACOSX)
-typedef task_t ProcessHandle;
-typedef mach_port_t ThreadId;
-#else
-typedef int ProcessHandle;
-typedef int ThreadId;
-#endif
-
-// Return the current thread's ID.
-//
-// XXX: this is a somewhat out-of-place interface to expose through
-// crashreporter, but it takes significant work to call sys_gettid()
-// correctly on Linux and breakpad has already jumped through those
-// hoops for us.
-ThreadId CurrentThreadId();
-
-/*
- * Take a minidump of the target process and pair it with an incoming minidump
- * provided by the caller or a new minidump of the calling process and thread.
- * The caller will own both dumps after this call. If this function fails
- * it will attempt to delete any files that were created.
- *
- * The .extra information created will not include an 'additional_minidumps'
- * annotation.
- *
- * @param aTargetPid The target process for the minidump.
- * @param aTargetBlamedThread The target thread for the minidump.
- * @param aIncomingPairName The name to apply to the paired dump the caller
- * passes in.
- * @param aIncomingDumpToPair Existing dump to pair with the new dump. if this
- * is null, TakeMinidumpAndPair will take a new minidump of the calling
- * process and thread and use it in aIncomingDumpToPairs place.
- * @param aTargetDumpOut The target minidump file paired up with
- * aIncomingDumpToPair.
- * @return bool indicating success or failure
- */
-bool CreateMinidumpsAndPair(ProcessHandle aTargetPid,
- ThreadId aTargetBlamedThread,
- const nsACString& aIncomingPairName,
- nsIFile* aIncomingDumpToPair,
- nsIFile** aTargetDumpOut);
-
-// Create an additional minidump for a child of a process which already has
-// a minidump (|parentMinidump|).
-// The resulting dump will get the id of the parent and use the |name| as
-// an extension.
-bool CreateAdditionalChildMinidump(ProcessHandle childPid,
- ThreadId childBlamedThread,
- nsIFile* parentMinidump,
- const nsACString& name);
-
-# if defined(XP_WIN32) || defined(XP_MACOSX)
-// Parent-side API for children
-const char* GetChildNotificationPipe();
-
-#ifdef MOZ_CRASHREPORTER_INJECTOR
-// Inject a crash report client into an arbitrary process, and inform the
-// callback object when it crashes. Parent process only.
-
-class InjectorCrashCallback
-{
-public:
- InjectorCrashCallback() { }
-
- /**
- * Inform the callback of a crash. The client code should call
- * TakeMinidumpForChild to remove it from the PID mapping table.
- *
- * The callback will not be fired if the client has already called
- * TakeMinidumpForChild for this process ID.
- */
- virtual void OnCrash(DWORD processID) = 0;
-};
-
-// This method implies OOPInit
-void InjectCrashReporterIntoProcess(DWORD processID, InjectorCrashCallback* cb);
-void UnregisterInjectorCallback(DWORD processID);
-#endif
-
-// Child-side API
-bool SetRemoteExceptionHandler(const nsACString& crashPipe);
-void InitChildProcessTmpDir();
-
-# elif defined(XP_LINUX)
-// Parent-side API for children
-
-// Set the outparams for crash reporter server's fd (|childCrashFd|)
-// and the magic fd number it should be remapped to
-// (|childCrashRemapFd|) before exec() in the child process.
-// |SetRemoteExceptionHandler()| in the child process expects to find
-// the server at |childCrashRemapFd|. Return true iff successful.
-//
-// If crash reporting is disabled, both outparams will be set to -1
-// and |true| will be returned.
-bool CreateNotificationPipeForChild(int* childCrashFd, int* childCrashRemapFd);
-
-// Child-side API
-bool SetRemoteExceptionHandler();
-
-#endif // XP_WIN32
-
-bool UnsetRemoteExceptionHandler();
-
-#if defined(MOZ_WIDGET_ANDROID)
-// Android builds use a custom library loader, so /proc/<pid>/maps
-// will just show anonymous mappings for all the non-system
-// shared libraries. This API is to work around that by providing
-// info about the shared libraries that are mapped into these anonymous
-// mappings.
-void AddLibraryMapping(const char* library_name,
- uintptr_t start_address,
- size_t mapping_length,
- size_t file_offset);
-
-#endif
-} // namespace CrashReporter
-
-#endif /* nsExceptionHandler_h__ */
diff --git a/toolkit/crashreporter/test/CrashTestUtils.jsm b/toolkit/crashreporter/test/CrashTestUtils.jsm
deleted file mode 100644
index 70162ab631..0000000000
--- a/toolkit/crashreporter/test/CrashTestUtils.jsm
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-this.EXPORTED_SYMBOLS = ["CrashTestUtils"];
-
-this.CrashTestUtils = {
- // These will be defined using ctypes APIs below.
- crash: null,
- lockDir: null,
- dumpHasStream: null,
- dumpHasInstructionPointerMemory: null,
-
- // Constants for crash()
- // Keep these in sync with nsTestCrasher.cpp!
- CRASH_INVALID_POINTER_DEREF: 0,
- CRASH_PURE_VIRTUAL_CALL: 1,
- CRASH_RUNTIMEABORT: 2,
- CRASH_OOM: 3,
- CRASH_MOZ_CRASH: 4,
- CRASH_ABORT: 5,
-
- // Constants for dumpHasStream()
- // From google_breakpad/common/minidump_format.h
- MD_THREAD_LIST_STREAM: 3,
- MD_MEMORY_INFO_LIST_STREAM: 16
-};
-
-// Grab APIs from the testcrasher shared library
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/ctypes.jsm");
-var dir = Services.dirsvc.get("CurWorkD", Components.interfaces.nsILocalFile);
-var file = dir.clone();
-file = file.parent;
-file.append(ctypes.libraryName("testcrasher"));
-var lib = ctypes.open(file.path);
-CrashTestUtils.crash = lib.declare("Crash",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.int16_t);
-CrashTestUtils.saveAppMemory = lib.declare("SaveAppMemory",
- ctypes.default_abi,
- ctypes.uint64_t);
-
-CrashTestUtils.lockDir = lib.declare("LockDir",
- ctypes.default_abi,
- ctypes.voidptr_t, // nsILocalFile*
- ctypes.voidptr_t); // nsISupports*
-
-
-try {
- CrashTestUtils.TryOverrideExceptionHandler = lib.declare("TryOverrideExceptionHandler",
- ctypes.default_abi,
- ctypes.void_t);
-}
-catch (ex) {}
-
-CrashTestUtils.dumpHasStream = lib.declare("DumpHasStream",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.char.ptr,
- ctypes.uint32_t);
-
-CrashTestUtils.dumpHasInstructionPointerMemory =
- lib.declare("DumpHasInstructionPointerMemory",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.char.ptr);
-
-CrashTestUtils.dumpCheckMemory = lib.declare("DumpCheckMemory",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.char.ptr);
diff --git a/toolkit/crashreporter/test/browser/.eslintrc.js b/toolkit/crashreporter/test/browser/.eslintrc.js
deleted file mode 100644
index c764b133dc..0000000000
--- a/toolkit/crashreporter/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/crashreporter/test/browser/browser.ini b/toolkit/crashreporter/test/browser/browser.ini
deleted file mode 100644
index b581765711..0000000000
--- a/toolkit/crashreporter/test/browser/browser.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-support-files =
- head.js
-
-[browser_aboutCrashes.js]
-[browser_aboutCrashesResubmit.js]
-[browser_bug471404.js]
-[browser_clearReports.js]
diff --git a/toolkit/crashreporter/test/browser/browser_aboutCrashes.js b/toolkit/crashreporter/test/browser/browser_aboutCrashes.js
deleted file mode 100644
index 1293df0300..0000000000
--- a/toolkit/crashreporter/test/browser/browser_aboutCrashes.js
+++ /dev/null
@@ -1,27 +0,0 @@
-add_task(function* test() {
- let appD = make_fake_appdir();
- let crD = appD.clone();
- crD.append("Crash Reports");
- let crashes = add_fake_crashes(crD, 5);
- // sanity check
- let dirSvc = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties);
- let appDtest = dirSvc.get("UAppData", Components.interfaces.nsILocalFile);
- ok(appD.equals(appDtest), "directory service provider registered ok");
-
- yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:crashes" }, function (browser) {
- info("about:crashes loaded");
- return ContentTask.spawn(browser, crashes, function (crashes) {
- let doc = content.document;
- let crashlinks = doc.getElementById("submitted").querySelectorAll(".crashReport");
- Assert.equal(crashlinks.length, crashes.length,
- "about:crashes lists correct number of crash reports");
- for (let i = 0; i < crashes.length; i++) {
- Assert.equal(crashlinks[i].firstChild.textContent, crashes[i].id,
- i + ": crash ID is correct");
- }
- });
- });
-
- cleanup_fake_appdir();
-});
diff --git a/toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js b/toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js
deleted file mode 100644
index a911c67e8a..0000000000
--- a/toolkit/crashreporter/test/browser/browser_aboutCrashesResubmit.js
+++ /dev/null
@@ -1,152 +0,0 @@
-function cleanup_and_finish() {
- try {
- cleanup_fake_appdir();
- } catch (ex) {}
- Services.prefs.clearUserPref("breakpad.reportURL");
- BrowserTestUtils.removeTab(gBrowser.selectedTab).then(finish);
-}
-
-/*
- * check_crash_list
- *
- * Check that the list of crashes displayed by about:crashes matches
- * the list of crashes that we placed in the pending+submitted directories.
- *
- * NB: This function is run in the child process via ContentTask.spawn.
- */
-function check_crash_list(crashes) {
- let doc = content.document;
- let crashlinks = doc.getElementsByClassName("crashReport");
- Assert.equal(crashlinks.length, crashes.length,
- "about:crashes lists correct number of crash reports");
- // no point in checking this if the lists aren't the same length
- if (crashlinks.length == crashes.length) {
- for (let i=0; i<crashes.length; i++) {
- Assert.equal(crashlinks[i].id, crashes[i].id, i + ": crash ID is correct");
- if (crashes[i].pending) {
- // we set the breakpad.reportURL pref in test()
- Assert.equal(crashlinks[i].getAttribute("href"),
- "http://example.com/browser/toolkit/crashreporter/about/throttling",
- "pending URL links to the correct static page");
- }
- }
- }
-}
-
-/*
- * check_submit_pending
- *
- * Click on a pending crash in about:crashes, wait for it to be submitted (which
- * should redirect us to the crash report page). Verify that the data provided
- * by our test crash report server matches the data we submitted.
- * Additionally, click "back" and verify that the link now points to our new
- */
-function check_submit_pending(tab, crashes) {
- let browser = gBrowser.getBrowserForTab(tab);
- let SubmittedCrash = null;
- let CrashID = null;
- let CrashURL = null;
- function csp_onload() {
- // loaded the crash report page
- ok(true, 'got submission onload');
-
- ContentTask.spawn(browser, null, function() {
- // grab the Crash ID here to verify later
- let CrashID = content.location.search.split("=")[1];
- let CrashURL = content.location.toString();
-
- // check the JSON content vs. what we submitted
- let result = JSON.parse(content.document.documentElement.textContent);
- Assert.equal(result.upload_file_minidump, "MDMP", "minidump file sent properly");
- Assert.equal(result.memory_report, "Let's pretend this is a memory report",
- "memory report sent properly");
- Assert.equal(+result.Throttleable, 0, "correctly sent as non-throttleable");
- // we checked these, they're set by the submission process,
- // so they won't be in the "extra" data.
- delete result.upload_file_minidump;
- delete result.memory_report;
- delete result.Throttleable;
-
- return { id: CrashID, url: CrashURL, result };
- }).then(({ id, url, result }) => {
- // Likewise, this is discarded before it gets to the server
- delete SubmittedCrash.extra.ServerURL;
-
- CrashID = id;
- CrashURL = url;
- for (let x in result) {
- if (x in SubmittedCrash.extra)
- is(result[x], SubmittedCrash.extra[x],
- "submitted value for " + x + " matches expected");
- else
- ok(false, "property " + x + " missing from submitted data!");
- }
- for (let y in SubmittedCrash.extra) {
- if (!(y in result))
- ok(false, "property " + y + " missing from result data!");
- }
-
- // NB: Despite appearances, this doesn't use a CPOW.
- BrowserTestUtils.waitForEvent(browser, "pageshow", true).then(csp_pageshow);
-
- // now navigate back
- browser.goBack();
- });
- }
- function csp_fail() {
- browser.removeEventListener("CrashSubmitFailed", csp_fail, true);
- ok(false, "failed to submit crash report!");
- cleanup_and_finish();
- }
- browser.addEventListener("CrashSubmitFailed", csp_fail, true);
- BrowserTestUtils.browserLoaded(browser, false, (url) => url !== "about:crashes").then(csp_onload);
- function csp_pageshow() {
- ContentTask.spawn(browser, { CrashID, CrashURL }, function({ CrashID, CrashURL }) {
- Assert.equal(content.location.href, "about:crashes", "navigated back successfully");
- let link = content.document.getElementById(CrashID);
- Assert.notEqual(link, null, "crash report link changed correctly");
- if (link)
- Assert.equal(link.href, CrashURL, "crash report link points to correct href");
- }).then(cleanup_and_finish);
- }
-
- // try submitting the pending report
- for (let crash of crashes) {
- if (crash.pending) {
- SubmittedCrash = crash;
- break;
- }
- }
-
- ContentTask.spawn(browser, SubmittedCrash.id, function(id) {
- let link = content.document.getElementById(id);
- link.click();
- });
-}
-
-function test() {
- waitForExplicitFinish();
- let appD = make_fake_appdir();
- let crD = appD.clone();
- crD.append("Crash Reports");
- let crashes = add_fake_crashes(crD, 1);
- // we don't need much data here, it's not going to a real Socorro
- crashes.push(addPendingCrashreport(crD,
- crashes[crashes.length - 1].date + 60000,
- {'ServerURL': 'http://example.com/browser/toolkit/crashreporter/test/browser/crashreport.sjs',
- 'ProductName': 'Test App',
- // test that we don't truncate
- // at = (bug 512853)
- 'Foo': 'ABC=XYZ'
- }));
- crashes.sort((a, b) => b.date - a.date);
-
- // set this pref so we can link to our test server
- Services.prefs.setCharPref("breakpad.reportURL",
- "http://example.com/browser/toolkit/crashreporter/test/browser/crashreport.sjs?id=");
-
- BrowserTestUtils.openNewForegroundTab(gBrowser, "about:crashes").then((tab) => {
- ContentTask.spawn(tab.linkedBrowser, crashes, check_crash_list)
- .then(() => check_submit_pending(tab, crashes));
- });
-}
diff --git a/toolkit/crashreporter/test/browser/browser_bug471404.js b/toolkit/crashreporter/test/browser/browser_bug471404.js
deleted file mode 100644
index f0eb00b71e..0000000000
--- a/toolkit/crashreporter/test/browser/browser_bug471404.js
+++ /dev/null
@@ -1,41 +0,0 @@
-function check_clear_visible(browser, aVisible) {
- return ContentTask.spawn(browser, aVisible, function (aVisible) {
- let doc = content.document;
- let visible = false;
- let button = doc.getElementById("clear-reports");
- if (button) {
- let style = doc.defaultView.getComputedStyle(button, "");
- if (style.display != "none" &&
- style.visibility == "visible")
- visible = true;
- }
- Assert.equal(visible, aVisible,
- "clear reports button is " + (aVisible ? "visible" : "hidden"));
- });
-}
-
-// each test here has a setup (run before loading about:crashes) and onload (run after about:crashes loads)
-var _tests = [{setup: null, onload: function(browser) { return check_clear_visible(browser, false); }},
- {setup: function(crD) { return add_fake_crashes(crD, 1); },
- onload: function(browser) { return check_clear_visible(browser, true); }}
- ];
-
-add_task(function* test() {
- let appD = make_fake_appdir();
- let crD = appD.clone();
- crD.append("Crash Reports");
-
- yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, function* (browser) {
- for (let test of _tests) {
- // Run setup before loading about:crashes.
- if (test.setup) {
- yield test.setup(crD);
- }
-
- BrowserTestUtils.loadURI(browser, "about:crashes");
- yield BrowserTestUtils.browserLoaded(browser).then(() => test.onload(browser));
- }
- });
-
- cleanup_fake_appdir();
-});
diff --git a/toolkit/crashreporter/test/browser/browser_clearReports.js b/toolkit/crashreporter/test/browser/browser_clearReports.js
deleted file mode 100644
index a7a1780a97..0000000000
--- a/toolkit/crashreporter/test/browser/browser_clearReports.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function clickClearReports(browser) {
- let doc = content.document;
-
- let button = doc.getElementById("clear-reports");
-
- if (!button) {
- Assert.ok(false, "Button not found");
- return Promise.resolve();
- }
-
- let style = doc.defaultView.getComputedStyle(button, "");
-
- Assert.notEqual(style.display, "none", "Clear reports button visible");
-
- let deferred = {};
- deferred.promise = new Promise(resolve => deferred.resolve = resolve);
- var observer = new content.MutationObserver(function(mutations) {
- for (let mutation of mutations) {
- if (mutation.type == "attributes" &&
- mutation.attributeName == "style") {
- observer.disconnect();
- Assert.equal(style.display, "none", "Clear reports button hidden");
- deferred.resolve();
- }
- }
- });
- observer.observe(button, {
- attributes: true,
- childList: true,
- characterData: true,
- attributeFilter: ["style"],
- });
-
- button.click();
- return deferred.promise;
-}
-
-var promptShown = false;
-
-var oldPrompt = Services.prompt;
-Services.prompt = {
- confirm: function() {
- promptShown = true;
- return true;
- },
-};
-
-registerCleanupFunction(function () {
- Services.prompt = oldPrompt;
-});
-
-add_task(function* test() {
- let appD = make_fake_appdir();
- let crD = appD.clone();
- crD.append("Crash Reports");
-
- // Add crashes to submitted dir
- let submitdir = crD.clone();
- submitdir.append("submitted");
-
- let file1 = submitdir.clone();
- file1.append("bp-nontxt");
- file1.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- let file2 = submitdir.clone();
- file2.append("nonbp-file.txt");
- file2.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- add_fake_crashes(crD, 5);
-
- // Add crashes to pending dir
- let pendingdir = crD.clone();
- pendingdir.append("pending");
-
- let crashes = add_fake_crashes(crD, 2);
- addPendingCrashreport(crD, crashes[0].date);
- addPendingCrashreport(crD, crashes[1].date);
-
- // Add crashes to reports dir
- let report1 = crD.clone();
- report1.append("NotInstallTime777");
- report1.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- let report2 = crD.clone();
- report2.append("InstallTime" + Services.appinfo.appBuildID);
- report2.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- let report3 = crD.clone();
- report3.append("InstallTimeNew");
- report3.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- let report4 = crD.clone();
- report4.append("InstallTimeOld");
- report4.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- report4.lastModifiedTime = Date.now() - 63172000000;
-
- registerCleanupFunction(function () {
- cleanup_fake_appdir();
- });
-
- yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:crashes" },
- function* (browser) {
- let dirs = [ submitdir, pendingdir, crD ];
- let existing = [ file1.path, file2.path, report1.path, report2.path,
- report3.path, submitdir.path, pendingdir.path ];
-
- yield ContentTask.spawn(browser, null, clickClearReports);
-
- for (let dir of dirs) {
- let entries = dir.directoryEntries;
- while (entries.hasMoreElements()) {
- let file = entries.getNext().QueryInterface(Ci.nsIFile);
- let index = existing.indexOf(file.path);
- isnot(index, -1, file.leafName + " exists");
-
- if (index != -1) {
- existing.splice(index, 1);
- }
- }
- }
-
- is(existing.length, 0, "All the files that should still exist exist");
- ok(promptShown, "Prompt shown");
- });
-});
diff --git a/toolkit/crashreporter/test/browser/crashreport.sjs b/toolkit/crashreporter/test/browser/crashreport.sjs
deleted file mode 100644
index f3bd858eb5..0000000000
--- a/toolkit/crashreporter/test/browser/crashreport.sjs
+++ /dev/null
@@ -1,180 +0,0 @@
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const CC = Components.Constructor;
-
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream",
- "setInputStream");
-
-function parseHeaders(data, start)
-{
- let headers = {};
-
- while (true) {
- let done = false;
- let end = data.indexOf("\r\n", start);
- if (end == -1) {
- done = true;
- end = data.length;
- }
- let line = data.substring(start, end);
- start = end + 2;
- if (line == "")
- // empty line, we're done
- break;
-
- //XXX: this doesn't handle multi-line headers. do we care?
- let [name, value] = line.split(':');
- //XXX: not normalized, should probably use nsHttpHeaders or something
- headers[name] = value.trimLeft();
- }
- return [headers, start];
-}
-
-function parseMultipartForm(request)
-{
- let boundary = null;
- // See if this is a multipart/form-data request, and if so, find the
- // boundary string
- if (request.hasHeader("Content-Type")) {
- var contenttype = request.getHeader("Content-Type");
- var bits = contenttype.split(";");
- if (bits[0] == "multipart/form-data") {
- for (var i = 1; i < bits.length; i++) {
- var b = bits[i].trimLeft();
- if (b.indexOf("boundary=") == 0) {
- // grab everything after boundary=
- boundary = "--" + b.substring(9);
- break;
- }
- }
- }
- }
- if (boundary == null)
- return null;
-
- let body = new BinaryInputStream(request.bodyInputStream);
- let avail;
- let bytes = [];
- while ((avail = body.available()) > 0) {
- let readBytes = body.readByteArray(avail);
- for (let b of readBytes) {
- bytes.push(b);
- }
- }
- let data = "";
- for (let b of bytes) {
- data += String.fromCharCode(b);
- }
- let formData = {};
- let done = false;
- let start = 0;
- while (true) {
- // read first line
- let end = data.indexOf("\r\n", start);
- if (end == -1) {
- done = true;
- end = data.length;
- }
-
- let line = data.substring(start, end);
- // look for closing boundary delimiter line
- if (line == boundary + "--") {
- break;
- }
-
- if (line != boundary) {
- dump("expected boundary line but didn't find it!");
- break;
- }
-
- // parse headers
- start = end + 2;
- let headers = null;
- [headers, start] = parseHeaders(data, start);
-
- // find next boundary string
- end = data.indexOf("\r\n" + boundary, start);
- if (end == -1) {
- dump("couldn't find next boundary string\n");
- break;
- }
-
- // read part data, stick in formData using Content-Disposition header
- let part = data.substring(start, end);
- start = end + 2;
-
- if ("Content-Disposition" in headers) {
- let bits = headers["Content-Disposition"].split(';');
- if (bits[0] == 'form-data') {
- for (let i = 0; i < bits.length; i++) {
- let b = bits[i].trimLeft();
- if (b.indexOf('name=') == 0) {
- //TODO: handle non-ascii here?
- let name = b.substring(6, b.length - 1);
- //TODO: handle multiple-value properties?
- formData[name] = part;
- }
- //TODO: handle filename= ?
- //TODO: handle multipart/mixed for multi-file uploads?
- }
- }
- }
- }
- return formData;
-}
-
-function handleRequest(request, response)
-{
- if (request.method == "GET") {
- let id = null;
- for (let p of request.queryString.split('&')) {
- let [key, value] = p.split('=');
- if (key == 'id')
- id = value;
- }
- if (id == null) {
- response.setStatusLine(request.httpVersion, 400, "Bad Request");
- response.write("Missing id parameter");
- }
- else {
- let data = getState(id);
- if (data == "") {
- response.setStatusLine(request.httpVersion, 404, "Not Found");
- response.write("Not Found");
- }
- else {
- response.setHeader("Content-Type", "text/plain", false);
- response.write(data);
- }
- }
- }
- else if (request.method == "POST") {
- let formData = parseMultipartForm(request);
-
- if (formData && 'upload_file_minidump' in formData) {
- response.setHeader("Content-Type", "text/plain", false);
-
- let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
- let uuid = uuidGenerator.generateUUID().toString();
- // ditch the {}, add bp- prefix
- uuid = 'bp-' + uuid.substring(1,uuid.length-2);
-
- let d = JSON.stringify(formData);
- //dump('saving crash report ' + uuid + ': ' + d + '\n');
- setState(uuid, d);
-
- response.write("CrashID=" + uuid + "\n");
- }
- else {
- dump('*** crashreport.sjs: Malformed request?\n');
- response.setStatusLine(request.httpVersion, 400, "Bad Request");
- response.write("Missing minidump file");
- }
- }
- else {
- response.setStatusLine(request.httpVersion, 405, "Method not allowed");
- response.write("Can't handle HTTP method " + request.method);
- }
-}
diff --git a/toolkit/crashreporter/test/browser/head.js b/toolkit/crashreporter/test/browser/head.js
deleted file mode 100644
index f35edfe387..0000000000
--- a/toolkit/crashreporter/test/browser/head.js
+++ /dev/null
@@ -1,139 +0,0 @@
-function create_subdir(dir, subdirname) {
- let subdir = dir.clone();
- subdir.append(subdirname);
- if (subdir.exists()) {
- subdir.remove(true);
- }
- subdir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
- return subdir;
-}
-
-// need to hold on to this to unregister for cleanup
-var _provider = null;
-
-function make_fake_appdir() {
- // Create a directory inside the profile and register it as UAppData, so
- // we can stick fake crash reports inside there. We put it inside the profile
- // just because we know that will get cleaned up after the mochitest run.
- let dirSvc = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Ci.nsIProperties);
- let profD = dirSvc.get("ProfD", Ci.nsILocalFile);
- // create a subdir just to keep our files out of the way
- let appD = create_subdir(profD, "UAppData");
-
- let crashesDir = create_subdir(appD, "Crash Reports");
- create_subdir(crashesDir, "pending");
- create_subdir(crashesDir, "submitted");
-
- _provider = {
- getFile: function(prop, persistent) {
- persistent.value = true;
- if (prop == "UAppData") {
- return appD.clone();
- }
- // Depending on timing we can get requests for other files.
- // When we threw an exception here, in the world before bug 997440, this got lost
- // because of the arbitrary JSContext being used in XPCWrappedJSClass::CallMethod.
- // After bug 997440 this gets reported to our window and causes the tests to fail.
- // So, we'll just dump out a message to the logs.
- dump("WARNING: make_fake_appdir - fake nsIDirectoryServiceProvider - Unexpected getFile for: '" + prop + "'\n");
- return null;
- },
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsIDirectoryServiceProvider) ||
- iid.equals(Ci.nsISupports)) {
- return this;
- }
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- };
- // register our new provider
- dirSvc.QueryInterface(Ci.nsIDirectoryService)
- .registerProvider(_provider);
- // and undefine the old value
- try {
- dirSvc.undefine("UAppData");
- } catch (ex) {} // it's ok if this fails, the value might not be cached yet
- return appD.clone();
-}
-
-function cleanup_fake_appdir() {
- let dirSvc = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Ci.nsIProperties);
- dirSvc.QueryInterface(Ci.nsIDirectoryService)
- .unregisterProvider(_provider);
- // undefine our value so future calls get the real value
- try {
- dirSvc.undefine("UAppData");
- } catch (ex) {
- dump("cleanup_fake_appdir: dirSvc.undefine failed: " + ex.message +"\n");
- }
-}
-
-function add_fake_crashes(crD, count) {
- let results = [];
- let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
- let submitdir = crD.clone();
- submitdir.append("submitted");
- // create them from oldest to newest, to ensure that about:crashes
- // displays them in the correct order
- let date = Date.now() - count * 60000;
- for (let i = 0; i < count; i++) {
- let uuid = uuidGenerator.generateUUID().toString();
- // ditch the {}
- uuid = "bp-" + uuid.substring(1, uuid.length - 2);
- let fn = uuid + ".txt";
- let file = submitdir.clone();
- file.append(fn);
- file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666);
- file.lastModifiedTime = date;
- results.push({'id': uuid, 'date': date, 'pending': false});
-
- date += 60000;
- }
- // we want them sorted newest to oldest, since that's the order
- // that about:crashes lists them in
- results.sort((a, b) => b.date - a.date);
- return results;
-}
-
-function writeDataToFile(file, data) {
- var fstream = Cc["@mozilla.org/network/file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- // open, write, truncate
- fstream.init(file, -1, -1, 0);
- var os = Cc["@mozilla.org/intl/converter-output-stream;1"]
- .createInstance(Ci.nsIConverterOutputStream);
- os.init(fstream, "UTF-8", 0, 0x0000);
- os.writeString(data);
- os.close();
- fstream.close();
-}
-
-function addPendingCrashreport(crD, date, extra) {
- let pendingdir = crD.clone();
- pendingdir.append("pending");
- let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
- let uuid = uuidGenerator.generateUUID().toString();
- // ditch the {}
- uuid = uuid.substring(1, uuid.length - 1);
- let dumpfile = pendingdir.clone();
- dumpfile.append(uuid + ".dmp");
- writeDataToFile(dumpfile, "MDMP"); // that's the start of a valid minidump, anyway
- let extrafile = pendingdir.clone();
- extrafile.append(uuid + ".extra");
- let extradata = "";
- for (let x in extra) {
- extradata += x + "=" + extra[x] + "\n";
- }
- writeDataToFile(extrafile, extradata);
- let memoryfile = pendingdir.clone();
- memoryfile.append(uuid + ".memory.json.gz");
- writeDataToFile(memoryfile, "Let's pretend this is a memory report");
- dumpfile.lastModifiedTime = date;
- extrafile.lastModifiedTime = date;
- memoryfile.lastModifiedTime = date;
- return {'id': uuid, 'date': date, 'pending': true, 'extra': extra};
-}
diff --git a/toolkit/crashreporter/test/dumputils.cpp b/toolkit/crashreporter/test/dumputils.cpp
deleted file mode 100644
index 36ee3eedf3..0000000000
--- a/toolkit/crashreporter/test/dumputils.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <stdio.h>
-
-#include "google_breakpad/processor/minidump.h"
-#include "nscore.h"
-
-using namespace google_breakpad;
-
-// Return true if the specified minidump contains a stream of |stream_type|.
-extern "C"
-NS_EXPORT bool
-DumpHasStream(const char* dump_file, uint32_t stream_type)
-{
- Minidump dump(dump_file);
- if (!dump.Read())
- return false;
-
- uint32_t length;
- if (!dump.SeekToStreamType(stream_type, &length) || length == 0)
- return false;
-
- return true;
-}
-
-// Return true if the specified minidump contains a memory region
-// that contains the instruction pointer from the exception record.
-extern "C"
-NS_EXPORT bool
-DumpHasInstructionPointerMemory(const char* dump_file)
-{
- Minidump minidump(dump_file);
- if (!minidump.Read())
- return false;
-
- MinidumpException* exception = minidump.GetException();
- MinidumpMemoryList* memory_list = minidump.GetMemoryList();
- if (!exception || !memory_list) {
- return false;
- }
-
- MinidumpContext* context = exception->GetContext();
- if (!context)
- return false;
-
- uint64_t instruction_pointer;
- if (!context->GetInstructionPointer(&instruction_pointer)) {
- return false;
- }
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(instruction_pointer);
- return region != nullptr;
-}
-
-// This function tests for a very specific condition. It finds
-// an address in a file, "crash-addr", in the CWD. It checks
-// that the minidump has a memory region starting at that
-// address. The region must be 32 bytes long and contain the
-// values 0 to 31 as bytes, in ascending order.
-extern "C"
-NS_EXPORT bool
-DumpCheckMemory(const char* dump_file)
-{
- Minidump dump(dump_file);
- if (!dump.Read())
- return false;
-
- MinidumpMemoryList* memory_list = dump.GetMemoryList();
- if (!memory_list) {
- return false;
- }
-
- void *addr;
- FILE *fp = fopen("crash-addr", "r");
- if (!fp)
- return false;
- if (fscanf(fp, "%p", &addr) != 1) {
- fclose(fp);
- return false;
- }
- fclose(fp);
-
- remove("crash-addr");
-
- MinidumpMemoryRegion* region =
- memory_list->GetMemoryRegionForAddress(uint64_t(addr));
- if(!region)
- return false;
-
- const uint8_t* chars = region->GetMemory();
- if (region->GetSize() != 32)
- return false;
-
- for (int i=0; i<32; i++) {
- if (chars[i] != i)
- return false;
- }
-
- return true;
-}
diff --git a/toolkit/crashreporter/test/moz.build b/toolkit/crashreporter/test/moz.build
deleted file mode 100644
index 058e6a71e0..0000000000
--- a/toolkit/crashreporter/test/moz.build
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-FINAL_TARGET = '_tests/xpcshell/toolkit/crashreporter/test'
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini', 'unit_ipc/xpcshell.ini']
-BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
-
-UNIFIED_SOURCES += [
- '../google-breakpad/src/processor/basic_code_modules.cc',
- '../google-breakpad/src/processor/dump_context.cc',
- '../google-breakpad/src/processor/dump_object.cc',
- '../google-breakpad/src/processor/logging.cc',
- '../google-breakpad/src/processor/minidump.cc',
- '../google-breakpad/src/processor/pathname_stripper.cc',
- '../google-breakpad/src/processor/proc_maps_linux.cc',
- 'dumputils.cpp',
- 'nsTestCrasher.cpp',
-]
-
-GeckoSharedLibrary('testcrasher')
-
-DEFINES['SHARED_LIBRARY'] = '%s%s%s' % (
- CONFIG['DLL_PREFIX'],
- LIBRARY_NAME,
- CONFIG['DLL_SUFFIX']
-)
-
-TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit += ['CrashTestUtils.jsm']
-TEST_HARNESS_FILES.xpcshell.toolkit.crashreporter.test.unit_ipc += ['CrashTestUtils.jsm']
-
-include('/toolkit/crashreporter/crashreporter.mozbuild')
-
-NO_PGO = True
-
-# Temporary workaround for an issue in upstream breakpad
-if CONFIG['_MSC_VER']:
- CXXFLAGS += ['-wd4334']
diff --git a/toolkit/crashreporter/test/nsTestCrasher.cpp b/toolkit/crashreporter/test/nsTestCrasher.cpp
deleted file mode 100644
index 1be001160b..0000000000
--- a/toolkit/crashreporter/test/nsTestCrasher.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-#include "mozilla/Assertions.h"
-
-#include <stdio.h>
-
-#include "nscore.h"
-#include "nsXULAppAPI.h"
-#include "nsExceptionHandler.h"
-#include "mozilla/Unused.h"
-
-/*
- * This pure virtual call example is from MSDN
- */
-class A;
-
-void fcn( A* );
-
-class A
-{
-public:
- virtual void f() = 0;
- A() { fcn( this ); }
-};
-
-class B : A
-{
- void f() { }
-public:
- void use() { }
-};
-
-void fcn( A* p )
-{
- p->f();
-}
-
-void PureVirtualCall()
-{
- // generates a pure virtual function call
- B b;
- b.use(); // make sure b's actually used
-}
-
-// Keep these in sync with CrashTestUtils.jsm!
-const int16_t CRASH_INVALID_POINTER_DEREF = 0;
-const int16_t CRASH_PURE_VIRTUAL_CALL = 1;
-const int16_t CRASH_RUNTIMEABORT = 2;
-const int16_t CRASH_OOM = 3;
-const int16_t CRASH_MOZ_CRASH = 4;
-const int16_t CRASH_ABORT = 5;
-
-extern "C" NS_EXPORT
-void Crash(int16_t how)
-{
- switch (how) {
- case CRASH_INVALID_POINTER_DEREF: {
- volatile int* foo = (int*)0x42;
- *foo = 0;
- // not reached
- break;
- }
- case CRASH_PURE_VIRTUAL_CALL: {
- PureVirtualCall();
- // not reached
- break;
- }
- case CRASH_RUNTIMEABORT: {
- NS_RUNTIMEABORT("Intentional crash");
- break;
- }
- case CRASH_OOM: {
- mozilla::Unused << moz_xmalloc((size_t) -1);
- mozilla::Unused << moz_xmalloc((size_t) -1);
- mozilla::Unused << moz_xmalloc((size_t) -1);
- break;
- }
- case CRASH_MOZ_CRASH: {
- MOZ_CRASH();
- break;
- }
- case CRASH_ABORT: {
- abort();
- break;
- }
- default:
- break;
- }
-}
-
-extern "C" NS_EXPORT
-nsISupports* LockDir(nsIFile *directory)
-{
- nsISupports* lockfile = nullptr;
- XRE_LockProfileDirectory(directory, &lockfile);
- return lockfile;
-}
-
-char testData[32];
-
-extern "C" NS_EXPORT
-uint64_t SaveAppMemory()
-{
- for (size_t i=0; i<sizeof(testData); i++)
- testData[i] = i;
-
- FILE *fp = fopen("crash-addr", "w");
- if (!fp)
- return 0;
- fprintf(fp, "%p\n", (void *)testData);
- fclose(fp);
-
- return (int64_t)testData;
-}
-
-#ifdef XP_WIN32
-static LONG WINAPI HandleException(EXCEPTION_POINTERS* exinfo)
-{
- TerminateProcess(GetCurrentProcess(), 0);
- return 0;
-}
-
-extern "C" NS_EXPORT
-void TryOverrideExceptionHandler()
-{
- SetUnhandledExceptionFilter(HandleException);
-}
-#endif
diff --git a/toolkit/crashreporter/test/unit/.eslintrc.js b/toolkit/crashreporter/test/unit/.eslintrc.js
deleted file mode 100644
index fee088c179..0000000000
--- a/toolkit/crashreporter/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/crashreporter/test/unit/crasher_subprocess_head.js b/toolkit/crashreporter/test/unit/crasher_subprocess_head.js
deleted file mode 100644
index ed8e16ae40..0000000000
--- a/toolkit/crashreporter/test/unit/crasher_subprocess_head.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// enable crash reporting first
-var cwd = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties)
- .get("CurWorkD", Components.interfaces.nsILocalFile);
-
-// get the temp dir
-var env = Components.classes["@mozilla.org/process/environment;1"].getService(Components.interfaces.nsIEnvironment);
-var _tmpd = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
-_tmpd.initWithPath(env.get("XPCSHELL_TEST_TEMP_DIR"));
-
-var crashReporter =
- Components.classes["@mozilla.org/toolkit/crash-reporter;1"]
- .getService(Components.interfaces.nsICrashReporter);
-
-// We need to call this or crash events go in an undefined location.
-crashReporter.UpdateCrashEventsDir();
-
-// Setting the minidump path is not allowed in content processes
-var processType = Components.classes["@mozilla.org/xre/runtime;1"].
- getService(Components.interfaces.nsIXULRuntime).processType;
-if (processType == Components.interfaces.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
- crashReporter.minidumpPath = _tmpd;
-}
-
-var ios = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
-var protocolHandler = ios.getProtocolHandler("resource")
- .QueryInterface(Components.interfaces.nsIResProtocolHandler);
-var curDirURI = ios.newFileURI(cwd);
-protocolHandler.setSubstitution("test", curDirURI);
-Components.utils.import("resource://test/CrashTestUtils.jsm");
-var crashType = CrashTestUtils.CRASH_INVALID_POINTER_DEREF;
-var shouldDelay = false;
diff --git a/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js b/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
deleted file mode 100644
index 8b4dd2b791..0000000000
--- a/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Let the event loop process a bit before crashing.
-if (shouldDelay) {
- let shouldCrashNow = false;
- let thr = Components.classes["@mozilla.org/thread-manager;1"]
- .getService().currentThread;
- thr.dispatch({ run: () => { shouldCrashNow = true; } },
- Components.interfaces.nsIThread.DISPATCH_NORMAL);
-
- while (!shouldCrashNow) {
- thr.processNextEvent(true);
- }
-}
-
-// now actually crash
-CrashTestUtils.crash(crashType);
diff --git a/toolkit/crashreporter/test/unit/head_crashreporter.js b/toolkit/crashreporter/test/unit/head_crashreporter.js
deleted file mode 100644
index 45c491ad2a..0000000000
--- a/toolkit/crashreporter/test/unit/head_crashreporter.js
+++ /dev/null
@@ -1,173 +0,0 @@
-Components.utils.import("resource://gre/modules/osfile.jsm");
-
-function getEventDir() {
- return OS.Path.join(do_get_tempdir().path, "crash-events");
-}
-
-/*
- * Run an xpcshell subprocess and crash it.
- *
- * @param setup
- * A string of JavaScript code to execute in the subprocess
- * before crashing. If this is a function and not a string,
- * it will have .toSource() called on it, and turned into
- * a call to itself. (for programmer convenience)
- * This code will be evaluted between crasher_subprocess_head.js
- * and crasher_subprocess_tail.js, so it will have access
- * to everything defined in crasher_subprocess_head.js,
- * which includes "crashReporter", a variable holding
- * the crash reporter service.
- *
- * @param callback
- * A JavaScript function to be called after the subprocess
- * crashes. It will be passed (minidump, extra), where
- * minidump is an nsILocalFile of the minidump file produced,
- * and extra is an object containing the key,value pairs from
- * the .extra file.
- *
- * @param canReturnZero
- * If true, the subprocess may return with a zero exit code.
- * Certain types of crashes may not cause the process to
- * exit with an error.
- */
-function do_crash(setup, callback, canReturnZero)
-{
- // get current process filename (xpcshell)
- let ds = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties);
- let bin = ds.get("XREExeF", Components.interfaces.nsILocalFile);
- if (!bin.exists()) {
- // weird, can't find xpcshell binary?
- do_throw("Can't find xpcshell binary!");
- }
- // get Gre dir (GreD)
- let greD = ds.get("GreD", Components.interfaces.nsILocalFile);
- let headfile = do_get_file("crasher_subprocess_head.js");
- let tailfile = do_get_file("crasher_subprocess_tail.js");
- // run xpcshell -g GreD -f head -e "some setup code" -f tail
- let process = Components.classes["@mozilla.org/process/util;1"]
- .createInstance(Components.interfaces.nsIProcess);
- process.init(bin);
- let args = ['-g', greD.path,
- '-f', headfile.path];
- if (setup) {
- if (typeof(setup) == "function")
- // funky, but convenient
- setup = "("+setup.toSource()+")();";
- args.push('-e', setup);
- }
- args.push('-f', tailfile.path);
-
- let env = Components.classes["@mozilla.org/process/environment;1"]
- .getService(Components.interfaces.nsIEnvironment);
-
- let crashD = do_get_tempdir();
- crashD.append("crash-events");
- if (!crashD.exists()) {
- crashD.create(crashD.DIRECTORY_TYPE, 0o700);
- }
-
- env.set("CRASHES_EVENTS_DIR", crashD.path);
-
- try {
- process.run(true, args, args.length);
- }
- catch (ex) {} // on Windows we exit with a -1 status when crashing.
- finally {
- env.set("CRASHES_EVENTS_DIR", "");
- }
-
- if (!canReturnZero) {
- // should exit with an error (should have crashed)
- do_check_neq(process.exitValue, 0);
- }
-
- handleMinidump(callback);
-}
-
-function handleMinidump(callback)
-{
- // find minidump
- let minidump = null;
- let en = do_get_tempdir().directoryEntries;
- while (en.hasMoreElements()) {
- let f = en.getNext().QueryInterface(Components.interfaces.nsILocalFile);
- if (f.leafName.substr(-4) == ".dmp") {
- minidump = f;
- break;
- }
- }
-
- if (minidump == null)
- do_throw("No minidump found!");
-
- let extrafile = minidump.clone();
- extrafile.leafName = extrafile.leafName.slice(0, -4) + ".extra";
-
- let memoryfile = minidump.clone();
- memoryfile.leafName = memoryfile.leafName.slice(0, -4) + ".memory.json.gz";
-
- // Just in case, don't let these files linger.
- do_register_cleanup(function() {
- if (minidump.exists())
- minidump.remove(false);
- if (extrafile.exists())
- extrafile.remove(false);
- if (memoryfile.exists())
- memoryfile.remove(false);
- });
- do_check_true(extrafile.exists());
- let extra = parseKeyValuePairsFromFile(extrafile);
-
- if (callback)
- callback(minidump, extra);
-
- if (minidump.exists())
- minidump.remove(false);
- if (extrafile.exists())
- extrafile.remove(false);
- if (memoryfile.exists())
- memoryfile.remove(false);
-}
-
-function do_content_crash(setup, callback)
-{
- do_load_child_test_harness();
- do_test_pending();
-
- // Setting the minidump path won't work in the child, so we need to do
- // that here.
- let crashReporter =
- Components.classes["@mozilla.org/toolkit/crash-reporter;1"]
- .getService(Components.interfaces.nsICrashReporter);
- crashReporter.minidumpPath = do_get_tempdir();
-
- let headfile = do_get_file("../unit/crasher_subprocess_head.js");
- let tailfile = do_get_file("../unit/crasher_subprocess_tail.js");
- if (setup) {
- if (typeof(setup) == "function")
- // funky, but convenient
- setup = "("+setup.toSource()+")();";
- }
-
- let handleCrash = function() {
- try {
- handleMinidump(callback);
- } catch (x) {
- do_report_unexpected_exception(x);
- }
- do_test_finished();
- };
-
- sendCommand("load(\"" + headfile.path.replace(/\\/g, "/") + "\");", () =>
- sendCommand(setup, () =>
- sendCommand("load(\"" + tailfile.path.replace(/\\/g, "/") + "\");", () =>
- do_execute_soon(handleCrash)
- )
- )
- );
-}
-
-// Import binary APIs via js-ctypes.
-Components.utils.import("resource://test/CrashTestUtils.jsm");
-Components.utils.import("resource://gre/modules/KeyValueParser.jsm");
diff --git a/toolkit/crashreporter/test/unit/test_crash_AsyncShutdown.js b/toolkit/crashreporter/test/unit/test_crash_AsyncShutdown.js
deleted file mode 100644
index bff1c57001..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_AsyncShutdown.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test that AsyncShutdown report errors correctly
-
-function setup_crash() {
- Components.utils.import("resource://gre/modules/AsyncShutdown.jsm", this);
- Components.utils.import("resource://gre/modules/Services.jsm", this);
- Components.utils.import("resource://gre/modules/Promise.jsm", this);
-
- Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
- Services.prefs.setIntPref("toolkit.asyncshutdown.crash_timeout", 10);
-
- let TOPIC = "testing-async-shutdown-crash";
- let phase = AsyncShutdown._getPhase(TOPIC);
- phase.addBlocker("A blocker that is never satisfied", function() {
- dump("Installing blocker\n");
- let deferred = Promise.defer();
- return deferred.promise;
- });
-
- Services.obs.notifyObservers(null, TOPIC, null);
- dump(new Error().stack + "\n");
- dump("Waiting for crash\n");
-}
-
-function after_crash(mdump, extra) {
- do_print("after crash: " + extra.AsyncShutdownTimeout);
- let info = JSON.parse(extra.AsyncShutdownTimeout);
- Assert.equal(info.phase, "testing-async-shutdown-crash");
- Assert.equal(info.conditions[0].name, "A blocker that is never satisfied");
- // This test spawns subprocesses by using argument "-e" of xpcshell, so
- // this is the filename known to xpcshell.
- Assert.equal(info.conditions[0].filename, "-e");
-}
-
-// Test that AsyncShutdown + OS.File reports errors correctly, in a case in which
-// the latest operation succeeded
-
-function setup_osfile_crash_noerror() {
- Components.utils.import("resource://gre/modules/Services.jsm", this);
- Components.utils.import("resource://gre/modules/osfile.jsm", this);
- Components.utils.import("resource://gre/modules/Promise.jsm", this);
-
- Services.prefs.setIntPref("toolkit.asyncshutdown.crash_timeout", 1);
- Services.prefs.setBoolPref("toolkit.osfile.native", false);
-
- OS.File.profileBeforeChange.addBlocker("Adding a blocker that will never be resolved", () => Promise.defer().promise);
- OS.File.getCurrentDirectory();
-
- Services.obs.notifyObservers(null, "profile-before-change", null);
- dump("Waiting for crash\n");
-}
-
-function after_osfile_crash_noerror(mdump, extra) {
- do_print("after OS.File crash: " + extra.AsyncShutdownTimeout);
- let info = JSON.parse(extra.AsyncShutdownTimeout);
- let state = info.conditions[0].state;
- do_print("Keys: " + Object.keys(state).join(", "));
- do_check_eq(info.phase, "profile-before-change");
- do_check_true(state.launched);
- do_check_false(state.shutdown);
- do_check_true(state.worker);
- do_check_true(!!state.latestSent);
- do_check_eq(state.latestSent[1], "getCurrentDirectory");
-}
-
-// Test that AsyncShutdown + OS.File reports errors correctly, in a case in which
-// the latest operation failed
-
-function setup_osfile_crash_exn() {
- Components.utils.import("resource://gre/modules/Services.jsm", this);
- Components.utils.import("resource://gre/modules/osfile.jsm", this);
- Components.utils.import("resource://gre/modules/Promise.jsm", this);
-
- Services.prefs.setIntPref("toolkit.asyncshutdown.crash_timeout", 1);
- Services.prefs.setBoolPref("toolkit.osfile.native", false);
-
- OS.File.profileBeforeChange.addBlocker("Adding a blocker that will never be resolved", () => Promise.defer().promise);
- OS.File.read("I do not exist");
-
- Services.obs.notifyObservers(null, "profile-before-change", null);
- dump("Waiting for crash\n");
-}
-
-function after_osfile_crash_exn(mdump, extra) {
- do_print("after OS.File crash: " + extra.AsyncShutdownTimeout);
- let info = JSON.parse(extra.AsyncShutdownTimeout);
- let state = info.conditions[0].state;
- do_print("Keys: " + Object.keys(state).join(", "));
- do_check_eq(info.phase, "profile-before-change");
- do_check_false(state.shutdown);
- do_check_true(state.worker);
- do_check_true(!!state.latestSent);
- do_check_eq(state.latestSent[1], "read");
-}
-
-function run_test() {
- do_crash(setup_crash, after_crash);
- do_crash(setup_osfile_crash_noerror, after_osfile_crash_noerror);
- do_crash(setup_osfile_crash_exn, after_osfile_crash_exn);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_abort.js b/toolkit/crashreporter/test/unit/test_crash_abort.js
deleted file mode 100644
index 67008346f8..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_abort.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test()
-{
- // Try crashing with an abort().
- do_crash(function() {
- crashType = CrashTestUtils.CRASH_ABORT;
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestKey, "TestValue");
- },
- // process will exit with a zero exit status
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure.js b/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure.js
deleted file mode 100644
index 084730cbab..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure.js
+++ /dev/null
@@ -1,21 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_after_js_large_allocation_failure.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_MOZ_CRASH;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
- Components.utils.getJSTestingFunctions().reportLargeAllocationFailure();
- Components.utils.forceGC();
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
- do_check_false("JSOutOfMemory" in extra);
- do_check_eq(extra.JSLargeAllocationFailure, "Recovered");
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js b/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js
deleted file mode 100644
index 42996ced14..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_after_js_large_allocation_failure_reporting.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_after_js_oom_reporting.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_MOZ_CRASH;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
-
- function crashWhileReporting() {
- CrashTestUtils.crash(crashType);
- }
-
- var observerService = Components.classes["@mozilla.org/observer-service;1"]
- .getService(Components.interfaces.nsIObserverService);
- observerService.addObserver(crashWhileReporting, "memory-pressure", false);
- Components.utils.getJSTestingFunctions().reportLargeAllocationFailure();
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
- do_check_eq(extra.JSLargeAllocationFailure, "Reporting");
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_after_js_oom_recovered.js b/toolkit/crashreporter/test/unit/test_crash_after_js_oom_recovered.js
deleted file mode 100644
index fd1ca1259f..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_after_js_oom_recovered.js
+++ /dev/null
@@ -1,20 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_after_js_oom_recovered.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_MOZ_CRASH;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
- Components.utils.getJSTestingFunctions().reportOutOfMemory();
- Components.utils.forceGC();
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
- do_check_eq(extra.JSOutOfMemory, "Recovered");
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported.js b/toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported.js
deleted file mode 100644
index 4bed8e2fd0..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported.js
+++ /dev/null
@@ -1,34 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_after_js_oom_reported.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_MOZ_CRASH;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
-
- // GC now to avoid having it happen randomly later, which would make the
- // test bogusly fail. See comment below.
- Components.utils.forceGC();
-
- Components.utils.getJSTestingFunctions().reportOutOfMemory();
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
-
- // The JSOutOfMemory field is absent if the JS engine never reported OOM,
- // "Reported" if it did, and "Recovered" if it reported OOM but
- // subsequently completed a full GC cycle. Since this test calls
- // reportOutOfMemory() and then crashes, we expect "Reported".
- //
- // Theoretically, GC can happen any time, so it is just possible that
- // this property could be "Recovered" even if the implementation is
- // correct. More likely, though, that indicates a bug, so only accept
- // "Reported".
- do_check_eq(extra.JSOutOfMemory, "Reported");
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported_2.js b/toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported_2.js
deleted file mode 100644
index 5c038c8226..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_after_js_oom_reported_2.js
+++ /dev/null
@@ -1,26 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_after_js_oom_reported_2.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_MOZ_CRASH;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
- Components.utils.getJSTestingFunctions().reportOutOfMemory();
- Components.utils.forceGC(); // recover from first OOM
- Components.utils.getJSTestingFunctions().reportOutOfMemory();
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
-
- // Technically, GC can happen at any time, but it would be really
- // peculiar for it to happen again heuristically right after a GC was
- // forced. If extra.JSOutOfMemory is "Recovered" here, that's most
- // likely a bug in the error reporting machinery.
- do_check_eq(extra.JSOutOfMemory, "Reported");
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_moz_crash.js b/toolkit/crashreporter/test/unit/test_crash_moz_crash.js
deleted file mode 100644
index 4e2b043ada..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_moz_crash.js
+++ /dev/null
@@ -1,16 +0,0 @@
-function run_test()
-{
- // Try crashing with a runtime abort
- do_crash(function() {
- crashType = CrashTestUtils.CRASH_MOZ_CRASH;
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestKey, "TestValue");
- do_check_false("OOMAllocationSize" in extra);
- do_check_false("JSOutOfMemory" in extra);
- do_check_false("JSLargeAllocationFailure" in extra);
- },
- // process will exit with a zero exit status
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_oom.js b/toolkit/crashreporter/test/unit/test_crash_oom.js
deleted file mode 100644
index 5596888410..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_oom.js
+++ /dev/null
@@ -1,19 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_oom.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_OOM;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
- do_check_true("OOMAllocationSize" in extra);
- do_check_true(Number(extra.OOMAllocationSize) > 0);
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js b/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
deleted file mode 100644
index 6746aca295..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_purevirtual.js
+++ /dev/null
@@ -1,24 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_purevirtual.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- var isOSX = ("nsILocalFileMac" in Components.interfaces);
- if (isOSX) {
- dump("INFO | test_crash_purevirtual.js | TODO: purecalls not caught on OS X\n");
- return;
- }
-
- // Try crashing with a pure virtual call
- do_crash(function() {
- crashType = CrashTestUtils.CRASH_PURE_VIRTUAL_CALL;
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestKey, "TestValue");
- },
- // process will exit with a zero exit status
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_runtimeabort.js b/toolkit/crashreporter/test/unit/test_crash_runtimeabort.js
deleted file mode 100644
index ffb076cec9..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_runtimeabort.js
+++ /dev/null
@@ -1,21 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_runtimeabort.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- // Try crashing with a runtime abort
- do_crash(function() {
- crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestKey, "TestValue");
- do_check_true(/xpcom_runtime_abort/.test(extra.Notes));
- do_check_false("OOMAllocationSize" in extra);
- do_check_true(/Intentional crash/.test(extra.AbortMessage));
- },
- // process will exit with a zero exit status
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_terminator.js b/toolkit/crashreporter/test/unit/test_crash_terminator.js
deleted file mode 100644
index 291bbc92f7..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_terminator.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Test that the Shutdown Terminator report errors correctly
-
-function setup_crash() {
- Components.utils.import("resource://gre/modules/Services.jsm");
-
- Services.prefs.setBoolPref("toolkit.terminator.testing", true);
- Services.prefs.setIntPref("toolkit.asyncshutdown.crash_timeout", 10);
-
- // Initialize the terminator
- // (normally, this is done through the manifest file, but xpcshell
- // doesn't take them into account).
- let terminator = Components.classes["@mozilla.org/toolkit/shutdown-terminator;1"].
- createInstance(Components.interfaces.nsIObserver);
- terminator.observe(null, "profile-after-change", null);
-
- // Inform the terminator that shutdown has started
- // Pick an arbitrary notification
- terminator.observe(null, "xpcom-will-shutdown", null);
- terminator.observe(null, "profile-before-change", null);
-
- dump("Waiting (actively) for the crash\n");
- while (true) {
- Services.tm.currentThread.processNextEvent(true);
- }
-}
-
-
-function after_crash(mdump, extra) {
- do_print("Crash signature: " + JSON.stringify(extra, null, "\t"));
- Assert.equal(extra.ShutdownProgress, "profile-before-change");
-}
-
-function run_test() {
- do_crash(setup_crash, after_crash);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crash_with_memory_report.js b/toolkit/crashreporter/test/unit/test_crash_with_memory_report.js
deleted file mode 100644
index d08b52206f..0000000000
--- a/toolkit/crashreporter/test/unit/test_crash_with_memory_report.js
+++ /dev/null
@@ -1,55 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_oom.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- // This was shamelessly copied and stripped down from do_get_profile() in
- // head.js so that nsICrashReporter::saveMemoryReport can use a profile
- // within the crasher subprocess.
-
- do_crash(
- function() {
- // Delay crashing so that the memory report has time to complete.
- shouldDelay = true;
-
- let Cc = Components.classes;
- let Ci = Components.interfaces;
-
- let env = Cc["@mozilla.org/process/environment;1"]
- .getService(Ci.nsIEnvironment);
- let profd = env.get("XPCSHELL_TEST_PROFILE_DIR");
- let file = Cc["@mozilla.org/file/local;1"]
- .createInstance(Ci.nsILocalFile);
- file.initWithPath(profd);
-
- let dirSvc = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Ci.nsIProperties);
- let provider = {
- getFile: function(prop, persistent) {
- persistent.value = true;
- if (prop == "ProfD" || prop == "ProfLD" || prop == "ProfDS" ||
- prop == "ProfLDS" || prop == "TmpD") {
- return file.clone();
- }
- throw Components.results.NS_ERROR_FAILURE;
- },
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsIDirectoryServiceProvider) ||
- iid.equals(Ci.nsISupports)) {
- return this;
- }
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- };
- dirSvc.QueryInterface(Ci.nsIDirectoryService)
- .registerProvider(provider);
-
- crashReporter.saveMemoryReport();
- },
- function(mdump, extra) {
- do_check_eq(extra.ContainsMemoryReport, "1");
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crashreporter.js b/toolkit/crashreporter/test/unit/test_crashreporter.js
deleted file mode 100644
index f861522341..0000000000
--- a/toolkit/crashreporter/test/unit/test_crashreporter.js
+++ /dev/null
@@ -1,85 +0,0 @@
-function run_test()
-{
- dump("INFO | test_crashreporter.js | Get crashreporter service.\n");
- var cr = Components.classes["@mozilla.org/toolkit/crash-reporter;1"]
- .getService(Components.interfaces.nsICrashReporter);
- do_check_neq(cr, null);
-
- do_check_true(cr.enabled);
-
- try {
- let su = cr.serverURL;
- do_throw("Getting serverURL when not set should have thrown!");
- }
- catch (ex) {
- do_check_eq(ex.result, Components.results.NS_ERROR_FAILURE);
- }
-
- // check setting/getting serverURL
- var ios = Components.classes["@mozilla.org/network/io-service;1"]
- .getService(Components.interfaces.nsIIOService);
-
- // try it with two different URLs, just for kicks
- var testspecs = ["http://example.com/submit",
- "https://example.org/anothersubmit"];
- for (var i = 0; i < testspecs.length; ++i) {
- cr.serverURL = ios.newURI(testspecs[i], null, null);
- do_check_eq(cr.serverURL.spec, testspecs[i]);
- }
-
- // should not allow setting non-http/https URLs
- try {
- cr.serverURL = ios.newURI("ftp://example.com/submit", null, null);
- do_throw("Setting serverURL to a non-http(s) URL should have thrown!");
- }
- catch (ex) {
- do_check_eq(ex.result, Components.results.NS_ERROR_INVALID_ARG);
- }
-
- // check getting/setting minidumpPath
- // it should be $TEMP by default, but I'm not sure if we can exactly test that
- // this will at least test that it doesn't throw
- do_check_neq(cr.minidumpPath.path, "");
- var cwd = do_get_cwd();
- cr.minidumpPath = cwd;
- do_check_eq(cr.minidumpPath.path, cwd.path);
-
- try {
- cr.annotateCrashReport("equal=equal", "");
- do_throw("Calling annotateCrashReport() with an '=' in key should have thrown!");
- }
- catch (ex) {
- do_check_eq(ex.result, Components.results.NS_ERROR_INVALID_ARG);
- }
- try {
- cr.annotateCrashReport("new\nline", "");
- do_throw("Calling annotateCrashReport() with a '\\n' in key should have thrown!");
- }
- catch (ex) {
- do_check_eq(ex.result, Components.results.NS_ERROR_INVALID_ARG);
- }
- try {
- cr.annotateCrashReport("", "da\0ta");
- do_throw("Calling annotateCrashReport() with a '\\0' in data should have thrown!");
- }
- catch (ex) {
- do_check_eq(ex.result, Components.results.NS_ERROR_INVALID_ARG);
- }
- cr.annotateCrashReport("testKey", "testData1");
- // Replace previous data.
- cr.annotateCrashReport("testKey", "testData2");
-
- try {
- cr.appendAppNotesToCrashReport("da\0ta");
- do_throw("Calling appendAppNotesToCrashReport() with a '\\0' in data should have thrown!");
- }
- catch (ex) {
- do_check_eq(ex.result, Components.results.NS_ERROR_INVALID_ARG);
- }
- cr.appendAppNotesToCrashReport("additional testData3");
- // Add more data.
- cr.appendAppNotesToCrashReport("additional testData4");
-
- cr.minidumpPath = cwd;
- do_check_eq(cr.minidumpPath.path, cwd.path);
-}
diff --git a/toolkit/crashreporter/test/unit/test_crashreporter_appmem.js b/toolkit/crashreporter/test/unit/test_crashreporter_appmem.js
deleted file mode 100644
index 29d96fe875..0000000000
--- a/toolkit/crashreporter/test/unit/test_crashreporter_appmem.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function run_test()
-{
- do_crash(function() {
- appAddr = CrashTestUtils.saveAppMemory();
- crashReporter.registerAppMemory(appAddr, 32);
- },
- function(mdump, extra) {
- do_check_true(mdump.exists());
- do_check_true(mdump.fileSize > 0);
- do_check_true(CrashTestUtils.dumpCheckMemory(mdump.path));
- });
-}
diff --git a/toolkit/crashreporter/test/unit/test_crashreporter_crash.js b/toolkit/crashreporter/test/unit/test_crashreporter_crash.js
deleted file mode 100644
index bfaaef90c2..0000000000
--- a/toolkit/crashreporter/test/unit/test_crashreporter_crash.js
+++ /dev/null
@@ -1,51 +0,0 @@
-function run_test()
-{
- var is_win7_or_newer = false;
- var is_windows = false;
- var ph = Components.classes["@mozilla.org/network/protocol;1?name=http"]
- .getService(Components.interfaces.nsIHttpProtocolHandler);
- var match = ph.userAgent.match(/Windows NT (\d+).(\d+)/);
- if (match) {
- is_windows = true;
- }
- if (match && (parseInt(match[1]) > 6 ||
- parseInt(match[1]) == 6 && parseInt(match[2]) >= 1)) {
- is_win7_or_newer = true;
- }
-
- // try a basic crash
- do_crash(null, function(mdump, extra) {
- do_check_true(mdump.exists());
- do_check_true(mdump.fileSize > 0);
- do_check_true('StartupTime' in extra);
- do_check_true('CrashTime' in extra);
- do_check_true(CrashTestUtils.dumpHasStream(mdump.path, CrashTestUtils.MD_THREAD_LIST_STREAM));
- do_check_true(CrashTestUtils.dumpHasInstructionPointerMemory(mdump.path));
- if (is_windows) {
- ['SystemMemoryUsePercentage', 'TotalVirtualMemory', 'AvailableVirtualMemory',
- 'AvailablePageFile', 'AvailablePhysicalMemory'].forEach(function(prop) {
- do_check_true(/^\d+$/.test(extra[prop].toString()));
- });
- }
- if (is_win7_or_newer)
- do_check_true(CrashTestUtils.dumpHasStream(mdump.path, CrashTestUtils.MD_MEMORY_INFO_LIST_STREAM));
- });
-
- // check setting some basic data
- do_crash(function() {
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- crashReporter.annotateCrashReport("\u2665", "\u{1F4A9}");
- crashReporter.appendAppNotesToCrashReport("Junk");
- crashReporter.appendAppNotesToCrashReport("MoreJunk");
- // TelemetrySession setup will trigger the session annotation
- let scope = {};
- Components.utils.import("resource://gre/modules/TelemetryController.jsm", scope);
- scope.TelemetryController.testSetup();
- },
- function(mdump, extra) {
- do_check_eq(extra.TestKey, "TestValue");
- do_check_eq(extra["\u2665"], "\u{1F4A9}");
- do_check_eq(extra.Notes, "JunkMoreJunk");
- do_check_true(!("TelemetrySessionId" in extra));
- });
-}
diff --git a/toolkit/crashreporter/test/unit/test_crashreporter_crash_profile_lock.js b/toolkit/crashreporter/test/unit/test_crashreporter_crash_profile_lock.js
deleted file mode 100644
index 78492ea5de..0000000000
--- a/toolkit/crashreporter/test/unit/test_crashreporter_crash_profile_lock.js
+++ /dev/null
@@ -1,26 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crashreporter.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- // lock a profile directory, crash, and ensure that
- // the profile lock signal handler doesn't interfere with
- // writing a minidump
- do_crash(function() {
- let env = Components.classes["@mozilla.org/process/environment;1"]
- .getService(Components.interfaces.nsIEnvironment);
- // the python harness sets this in the environment for us
- let profd = env.get("XPCSHELL_TEST_PROFILE_DIR");
- let dir = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- dir.initWithPath(profd);
- let lock = CrashTestUtils.lockDir(dir);
- // when we crash, the lock file should be cleaned up
- },
- function(mdump, extra) {
- // if we got here, we have a minidump, so that's all we wanted
- do_check_true(true);
- });
-}
diff --git a/toolkit/crashreporter/test/unit/test_event_files.js b/toolkit/crashreporter/test/unit/test_event_files.js
deleted file mode 100644
index d57978e23d..0000000000
--- a/toolkit/crashreporter/test/unit/test_event_files.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://testing-common/AppData.jsm", this);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_setup() {
- do_get_profile();
- yield makeFakeAppDir();
-});
-
-add_task(function* test_main_process_crash() {
- let cm = Services.crashmanager;
- Assert.ok(cm, "CrashManager available.");
-
- let basename;
- let deferred = Promise.defer();
- do_crash(
- function() {
- // TelemetrySession setup will trigger the session annotation
- let scope = {};
- Components.utils.import("resource://gre/modules/TelemetryController.jsm", scope);
- scope.TelemetryController.testSetup();
- crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
- crashReporter.annotateCrashReport("ShutdownProgress", "event-test");
- },
- (minidump, extra) => {
- basename = minidump.leafName;
- cm._eventsDirs = [getEventDir()];
- cm.aggregateEventsFiles().then(deferred.resolve, deferred.reject);
- },
- true);
-
- let count = yield deferred.promise;
- Assert.equal(count, 1, "A single crash event file was seen.");
- let crashes = yield cm.getCrashes();
- Assert.equal(crashes.length, 1);
- let crash = crashes[0];
- Assert.ok(crash.isOfType(cm.PROCESS_TYPE_MAIN, cm.CRASH_TYPE_CRASH));
- Assert.equal(crash.id + ".dmp", basename, "ID recorded properly");
- Assert.equal(crash.metadata.ShutdownProgress, "event-test");
- Assert.ok("TelemetrySessionId" in crash.metadata);
- Assert.ok("UptimeTS" in crash.metadata);
- Assert.ok(/^[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}$/.test(crash.metadata.TelemetrySessionId));
- Assert.ok("CrashTime" in crash.metadata);
- Assert.ok(/^\d+$/.test(crash.metadata.CrashTime));
-});
diff --git a/toolkit/crashreporter/test/unit/test_oom_annotation_windows.js b/toolkit/crashreporter/test/unit/test_oom_annotation_windows.js
deleted file mode 100644
index 4e103dee58..0000000000
--- a/toolkit/crashreporter/test/unit/test_oom_annotation_windows.js
+++ /dev/null
@@ -1,27 +0,0 @@
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_crash_oom.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- do_crash(
- function() {
- crashType = CrashTestUtils.CRASH_OOM;
- crashReporter.annotateCrashReport("TestingOOMCrash", "Yes");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestingOOMCrash, "Yes");
- do_check_true("OOMAllocationSize" in extra);
- do_check_true(Number(extra.OOMAllocationSize) > 0);
- do_check_true("SystemMemoryUsePercentage" in extra);
- do_check_true("TotalVirtualMemory" in extra);
- do_check_true("AvailableVirtualMemory" in extra);
- do_check_true("TotalPageFile" in extra);
- do_check_true("AvailablePageFile" in extra);
- do_check_true("TotalPhysicalMemory" in extra);
- do_check_true("AvailablePhysicalMemory" in extra);
-
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/test_override_exception_handler.js b/toolkit/crashreporter/test/unit/test_override_exception_handler.js
deleted file mode 100644
index 7e7787d80e..0000000000
--- a/toolkit/crashreporter/test/unit/test_override_exception_handler.js
+++ /dev/null
@@ -1,12 +0,0 @@
-function run_test()
-{
- // Ensure that attempting to override the exception handler doesn't cause
- // us to lose our exception handler.
- do_crash(
- function() {
- CrashTestUtils.TryOverrideExceptionHandler();
- },
- function(mdump, extra) {
- },
- true);
-}
diff --git a/toolkit/crashreporter/test/unit/xpcshell.ini b/toolkit/crashreporter/test/unit/xpcshell.ini
deleted file mode 100644
index ca9778086c..0000000000
--- a/toolkit/crashreporter/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,37 +0,0 @@
-[DEFAULT]
-head = head_crashreporter.js
-tail =
-skip-if = toolkit == 'android'
-support-files =
- crasher_subprocess_head.js
- crasher_subprocess_tail.js
-
-[test_crash_moz_crash.js]
-[test_crash_purevirtual.js]
-[test_crash_runtimeabort.js]
-[test_crash_after_js_oom_reported.js]
-[test_crash_after_js_oom_recovered.js]
-[test_crash_after_js_oom_reported_2.js]
-[test_crash_after_js_large_allocation_failure.js]
-[test_crash_after_js_large_allocation_failure_reporting.js]
-[test_crash_oom.js]
-[test_oom_annotation_windows.js]
-skip-if = os != 'win'
-
-[test_crash_abort.js]
-skip-if = os == 'win'
-
-[test_crash_with_memory_report.js]
-[test_crashreporter.js]
-[test_crashreporter_crash.js]
-[test_crashreporter_crash_profile_lock.js]
-[test_override_exception_handler.js]
-skip-if = os != 'win'
-
-[test_crashreporter_appmem.js]
-# we need to skip this due to bug 838613
-skip-if = (os != 'win' && os != 'linux') || (os=='linux' && bits==32)
-
-[test_crash_AsyncShutdown.js]
-[test_event_files.js]
-[test_crash_terminator.js]
diff --git a/toolkit/crashreporter/test/unit_ipc/.eslintrc.js b/toolkit/crashreporter/test/unit_ipc/.eslintrc.js
deleted file mode 100644
index fee088c179..0000000000
--- a/toolkit/crashreporter/test/unit_ipc/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/crashreporter/test/unit_ipc/test_content_annotation.js b/toolkit/crashreporter/test/unit_ipc/test_content_annotation.js
deleted file mode 100644
index 8a5c962e31..0000000000
--- a/toolkit/crashreporter/test/unit_ipc/test_content_annotation.js
+++ /dev/null
@@ -1,22 +0,0 @@
-load("../unit/head_crashreporter.js");
-
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_content_annotation.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- // Try crashing with a runtime abort
- do_content_crash(function() {
- crashType = CrashTestUtils.CRASH_RUNTIMEABORT;
- crashReporter.annotateCrashReport("TestKey", "TestValue");
- crashReporter.appendAppNotesToCrashReport("!!!foo!!!");
- },
- function(mdump, extra) {
- do_check_eq(extra.TestKey, "TestValue");
- do_check_true('StartupTime' in extra);
- do_check_true('ProcessType' in extra);
- do_check_neq(extra.Notes.indexOf("!!!foo!!!"), -1);
- });
-}
diff --git a/toolkit/crashreporter/test/unit_ipc/test_content_exception_time_annotation.js b/toolkit/crashreporter/test/unit_ipc/test_content_exception_time_annotation.js
deleted file mode 100644
index 810f683b20..0000000000
--- a/toolkit/crashreporter/test/unit_ipc/test_content_exception_time_annotation.js
+++ /dev/null
@@ -1,17 +0,0 @@
-load("../unit/head_crashreporter.js");
-
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_content_annotation.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- // Try crashing with an OOM
- do_content_crash(function() {
- crashType = CrashTestUtils.CRASH_OOM;
- },
- function(mdump, extra) {
- do_check_true('OOMAllocationSize' in extra);
- });
-}
diff --git a/toolkit/crashreporter/test/unit_ipc/test_content_memory_list.js b/toolkit/crashreporter/test/unit_ipc/test_content_memory_list.js
deleted file mode 100644
index 906f57e834..0000000000
--- a/toolkit/crashreporter/test/unit_ipc/test_content_memory_list.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// Any copyright is dedicated to the Public Domain.
-// http://creativecommons.org/publicdomain/zero/1.0/
-
-load("../unit/head_crashreporter.js");
-
-function run_test()
-{
- var is_win7_or_newer = false;
- var ph = Components.classes["@mozilla.org/network/protocol;1?name=http"]
- .getService(Components.interfaces.nsIHttpProtocolHandler);
- var match = ph.userAgent.match(/Windows NT (\d+).(\d+)/);
- if (match && (parseInt(match[1]) > 6 ||
- parseInt(match[1]) == 6 && parseInt(match[2]) >= 1)) {
- is_win7_or_newer = true;
- }
-
- do_content_crash(null, function(mdump, extra) {
- do_check_true(mdump.exists());
- do_check_true(mdump.fileSize > 0);
- if (is_win7_or_newer)
- do_check_true(CrashTestUtils.dumpHasStream(mdump.path, CrashTestUtils.MD_MEMORY_INFO_LIST_STREAM));
- });
-}
diff --git a/toolkit/crashreporter/test/unit_ipc/test_content_oom_annotation_windows.js b/toolkit/crashreporter/test/unit_ipc/test_content_oom_annotation_windows.js
deleted file mode 100644
index 9853696da8..0000000000
--- a/toolkit/crashreporter/test/unit_ipc/test_content_oom_annotation_windows.js
+++ /dev/null
@@ -1,23 +0,0 @@
-load("../unit/head_crashreporter.js");
-
-function run_test()
-{
- if (!("@mozilla.org/toolkit/crash-reporter;1" in Components.classes)) {
- dump("INFO | test_content_annotation.js | Can't test crashreporter in a non-libxul build.\n");
- return;
- }
-
- // Try crashing with an OOM
- do_content_crash(function() {
- crashType = CrashTestUtils.CRASH_OOM;
- },
- function(mdump, extra) {
- do_check_true("SystemMemoryUsePercentage" in extra);
- do_check_true("TotalVirtualMemory" in extra);
- do_check_true("AvailableVirtualMemory" in extra);
- do_check_true("TotalPageFile" in extra);
- do_check_true("AvailablePageFile" in extra);
- do_check_true("TotalPhysicalMemory" in extra);
- do_check_true("AvailablePhysicalMemory" in extra);
- });
-}
diff --git a/toolkit/crashreporter/test/unit_ipc/xpcshell.ini b/toolkit/crashreporter/test/unit_ipc/xpcshell.ini
deleted file mode 100644
index 33fcc1a4cc..0000000000
--- a/toolkit/crashreporter/test/unit_ipc/xpcshell.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-support-files =
- !/toolkit/crashreporter/test/unit/crasher_subprocess_head.js
- !/toolkit/crashreporter/test/unit/crasher_subprocess_tail.js
- !/toolkit/crashreporter/test/unit/head_crashreporter.js
-
-[test_content_annotation.js]
-[test_content_exception_time_annotation.js]
-[test_content_oom_annotation_windows.js]
-skip-if = os != 'win'
-[test_content_memory_list.js]
-skip-if = os != 'win'
diff --git a/toolkit/crashreporter/tools/symbolstore.py b/toolkit/crashreporter/tools/symbolstore.py
deleted file mode 100755
index 15eb5e1127..0000000000
--- a/toolkit/crashreporter/tools/symbolstore.py
+++ /dev/null
@@ -1,1078 +0,0 @@
-#!/bin/env python
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# Usage: symbolstore.py <params> <dump_syms path> <symbol store path>
-# <debug info files or dirs>
-# Runs dump_syms on each debug info file specified on the command line,
-# then places the resulting symbol file in the proper directory
-# structure in the symbol store path. Accepts multiple files
-# on the command line, so can be called as part of a pipe using
-# find <dir> | xargs symbolstore.pl <dump_syms> <storepath>
-# But really, you might just want to pass it <dir>.
-#
-# Parameters accepted:
-# -c : Copy debug info files to the same directory structure
-# as sym files. On Windows, this will also copy
-# binaries into the symbol store.
-# -a "<archs>" : Run dump_syms -a <arch> for each space separated
-# cpu architecture in <archs> (only on OS X)
-# -s <srcdir> : Use <srcdir> as the top source directory to
-# generate relative filenames.
-
-import buildconfig
-import errno
-import sys
-import platform
-import os
-import re
-import shutil
-import textwrap
-import fnmatch
-import subprocess
-import time
-import ctypes
-import urlparse
-import concurrent.futures
-import multiprocessing
-
-from optparse import OptionParser
-from xml.dom.minidom import parse
-
-from mozpack.copier import FileRegistry
-from mozpack.manifests import (
- InstallManifest,
- UnreadableInstallManifest,
-)
-
-# Utility classes
-
-class VCSFileInfo:
- """ A base class for version-controlled file information. Ensures that the
- following attributes are generated only once (successfully):
-
- self.root
- self.clean_root
- self.revision
- self.filename
-
- The attributes are generated by a single call to the GetRoot,
- GetRevision, and GetFilename methods. Those methods are explicitly not
- implemented here and must be implemented in derived classes. """
-
- def __init__(self, file):
- if not file:
- raise ValueError
- self.file = file
-
- def __getattr__(self, name):
- """ __getattr__ is only called for attributes that are not set on self,
- so setting self.[attr] will prevent future calls to the GetRoot,
- GetRevision, and GetFilename methods. We don't set the values on
- failure on the off chance that a future call might succeed. """
-
- if name == "root":
- root = self.GetRoot()
- if root:
- self.root = root
- return root
-
- elif name == "clean_root":
- clean_root = self.GetCleanRoot()
- if clean_root:
- self.clean_root = clean_root
- return clean_root
-
- elif name == "revision":
- revision = self.GetRevision()
- if revision:
- self.revision = revision
- return revision
-
- elif name == "filename":
- filename = self.GetFilename()
- if filename:
- self.filename = filename
- return filename
-
- raise AttributeError
-
- def GetRoot(self):
- """ This method should return the unmodified root for the file or 'None'
- on failure. """
- raise NotImplementedError
-
- def GetCleanRoot(self):
- """ This method should return the repository root for the file or 'None'
- on failure. """
- raise NotImplementedError
-
- def GetRevision(self):
- """ This method should return the revision number for the file or 'None'
- on failure. """
- raise NotImplementedError
-
- def GetFilename(self):
- """ This method should return the repository-specific filename for the
- file or 'None' on failure. """
- raise NotImplementedError
-
-
-# This regex separates protocol and optional username/password from a url.
-# For instance, all the following urls will be transformed into
-# 'foo.com/bar':
-#
-# http://foo.com/bar
-# svn+ssh://user@foo.com/bar
-# svn+ssh://user:pass@foo.com/bar
-#
-rootRegex = re.compile(r'^\S+?:/+(?:[^\s/]*@)?(\S+)$')
-
-def read_output(*args):
- (stdout, _) = subprocess.Popen(args=args, stdout=subprocess.PIPE).communicate()
- return stdout.rstrip()
-
-class HGRepoInfo:
- def __init__(self, path):
- self.path = path
-
- rev = os.environ.get('MOZ_SOURCE_CHANGESET')
- if not rev:
- rev = read_output('hg', '-R', path,
- 'parent', '--template={node|short}')
-
- # Look for the default hg path. If MOZ_SOURCE_REPO is set, we
- # don't bother asking hg.
- hg_root = os.environ.get('MOZ_SOURCE_REPO')
- if hg_root:
- root = hg_root
- else:
- root = read_output('hg', '-R', path,
- 'showconfig', 'paths.default')
- if not root:
- print >> sys.stderr, "Failed to get HG Repo for %s" % path
- cleanroot = None
- if root:
- match = rootRegex.match(root)
- if match:
- cleanroot = match.group(1)
- if cleanroot.endswith('/'):
- cleanroot = cleanroot[:-1]
- if cleanroot is None:
- print >> sys.stderr, textwrap.dedent("""\
- Could not determine repo info for %s. This is either not a clone of the web-based
- repository, or you have not specified MOZ_SOURCE_REPO, or the clone is corrupt.""") % path
- sys.exit(1)
- self.rev = rev
- self.root = root
- self.cleanroot = cleanroot
-
- def GetFileInfo(self, file):
- return HGFileInfo(file, self)
-
-class HGFileInfo(VCSFileInfo):
- def __init__(self, file, repo):
- VCSFileInfo.__init__(self, file)
- self.repo = repo
- self.file = os.path.relpath(file, repo.path)
-
- def GetRoot(self):
- return self.repo.root
-
- def GetCleanRoot(self):
- return self.repo.cleanroot
-
- def GetRevision(self):
- return self.repo.rev
-
- def GetFilename(self):
- if self.revision and self.clean_root:
- return "hg:%s:%s:%s" % (self.clean_root, self.file, self.revision)
- return self.file
-
-class GitRepoInfo:
- """
- Info about a local git repository. Does not currently
- support discovering info about a git clone, the info must be
- provided out-of-band.
- """
- def __init__(self, path, rev, root):
- self.path = path
- cleanroot = None
- if root:
- match = rootRegex.match(root)
- if match:
- cleanroot = match.group(1)
- if cleanroot.endswith('/'):
- cleanroot = cleanroot[:-1]
- if cleanroot is None:
- print >> sys.stderr, textwrap.dedent("""\
- Could not determine repo info for %s (%s). This is either not a clone of a web-based
- repository, or you have not specified MOZ_SOURCE_REPO, or the clone is corrupt.""") % (path, root)
- sys.exit(1)
- self.rev = rev
- self.cleanroot = cleanroot
-
- def GetFileInfo(self, file):
- return GitFileInfo(file, self)
-
-class GitFileInfo(VCSFileInfo):
- def __init__(self, file, repo):
- VCSFileInfo.__init__(self, file)
- self.repo = repo
- self.file = os.path.relpath(file, repo.path)
-
- def GetRoot(self):
- return self.repo.path
-
- def GetCleanRoot(self):
- return self.repo.cleanroot
-
- def GetRevision(self):
- return self.repo.rev
-
- def GetFilename(self):
- if self.revision and self.clean_root:
- return "git:%s:%s:%s" % (self.clean_root, self.file, self.revision)
- return self.file
-
-# Utility functions
-
-# A cache of files for which VCS info has already been determined. Used to
-# prevent extra filesystem activity or process launching.
-vcsFileInfoCache = {}
-
-def IsInDir(file, dir):
- # the lower() is to handle win32+vc8, where
- # the source filenames come out all lowercase,
- # but the srcdir can be mixed case
- return os.path.abspath(file).lower().startswith(os.path.abspath(dir).lower())
-
-def GetVCSFilenameFromSrcdir(file, srcdir):
- if srcdir not in Dumper.srcdirRepoInfo:
- # Not in cache, so find it adnd cache it
- if os.path.isdir(os.path.join(srcdir, '.hg')):
- Dumper.srcdirRepoInfo[srcdir] = HGRepoInfo(srcdir)
- else:
- # Unknown VCS or file is not in a repo.
- return None
- return Dumper.srcdirRepoInfo[srcdir].GetFileInfo(file)
-
-def GetVCSFilename(file, srcdirs):
- """Given a full path to a file, and the top source directory,
- look for version control information about this file, and return
- a tuple containing
- 1) a specially formatted filename that contains the VCS type,
- VCS location, relative filename, and revision number, formatted like:
- vcs:vcs location:filename:revision
- For example:
- cvs:cvs.mozilla.org/cvsroot:mozilla/browser/app/nsBrowserApp.cpp:1.36
- 2) the unmodified root information if it exists"""
- (path, filename) = os.path.split(file)
- if path == '' or filename == '':
- return (file, None)
-
- fileInfo = None
- root = ''
- if file in vcsFileInfoCache:
- # Already cached this info, use it.
- fileInfo = vcsFileInfoCache[file]
- else:
- for srcdir in srcdirs:
- if not IsInDir(file, srcdir):
- continue
- fileInfo = GetVCSFilenameFromSrcdir(file, srcdir)
- if fileInfo:
- vcsFileInfoCache[file] = fileInfo
- break
-
- if fileInfo:
- file = fileInfo.filename
- root = fileInfo.root
-
- # we want forward slashes on win32 paths
- return (file.replace("\\", "/"), root)
-
-def validate_install_manifests(install_manifest_args):
- args = []
- for arg in install_manifest_args:
- bits = arg.split(',')
- if len(bits) != 2:
- raise ValueError('Invalid format for --install-manifest: '
- 'specify manifest,target_dir')
- manifest_file, destination = map(os.path.abspath, bits)
- if not os.path.isfile(manifest_file):
- raise IOError(errno.ENOENT, 'Manifest file not found',
- manifest_file)
- if not os.path.isdir(destination):
- raise IOError(errno.ENOENT, 'Install directory not found',
- destination)
- try:
- manifest = InstallManifest(manifest_file)
- except UnreadableInstallManifest:
- raise IOError(errno.EINVAL, 'Error parsing manifest file',
- manifest_file)
- args.append((manifest, destination))
- return args
-
-def make_file_mapping(install_manifests):
- file_mapping = {}
- for manifest, destination in install_manifests:
- destination = os.path.abspath(destination)
- reg = FileRegistry()
- manifest.populate_registry(reg)
- for dst, src in reg:
- if hasattr(src, 'path'):
- abs_dest = os.path.normpath(os.path.join(destination, dst))
- file_mapping[abs_dest] = src.path
- return file_mapping
-
-def GetPlatformSpecificDumper(**kwargs):
- """This function simply returns a instance of a subclass of Dumper
- that is appropriate for the current platform."""
- return {'WINNT': Dumper_Win32,
- 'Linux': Dumper_Linux,
- 'Darwin': Dumper_Mac}[buildconfig.substs['OS_ARCH']](**kwargs)
-
-def SourceIndex(fileStream, outputPath, vcs_root):
- """Takes a list of files, writes info to a data block in a .stream file"""
- # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing
- # Create the srcsrv data block that indexes the pdb file
- result = True
- pdbStreamFile = open(outputPath, "w")
- pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=2\r\nINDEXVERSION=2\r\nVERCTRL=http\r\nSRCSRV: variables ------------------------------------------\r\nHGSERVER=''')
- pdbStreamFile.write(vcs_root)
- pdbStreamFile.write('''\r\nSRCSRVVERCTRL=http\r\nHTTP_EXTRACT_TARGET=%hgserver%/raw-file/%var3%/%var2%\r\nSRCSRVTRG=%http_extract_target%\r\nSRCSRV: source files ---------------------------------------\r\n''')
- pdbStreamFile.write(fileStream) # can't do string interpolation because the source server also uses this and so there are % in the above
- pdbStreamFile.write("SRCSRV: end ------------------------------------------------\r\n\n")
- pdbStreamFile.close()
- return result
-
-def StartJob(dumper, lock, srcdirRepoInfo, func_name, args):
- # Windows worker processes won't have run GlobalInit,
- # and due to a lack of fork(), won't inherit the class
- # variables from the parent, so set them here.
- Dumper.lock = lock
- Dumper.srcdirRepoInfo = srcdirRepoInfo
- return getattr(dumper, func_name)(*args)
-
-class JobPool(object):
- jobs = {}
- executor = None
-
- @classmethod
- def init(cls, executor):
- cls.executor = executor
-
- @classmethod
- def shutdown(cls):
- cls.executor.shutdown()
-
- @classmethod
- def submit(cls, args, callback):
- cls.jobs[cls.executor.submit(StartJob, *args)] = callback
-
- @classmethod
- def as_completed(cls):
- '''Like concurrent.futures.as_completed, but allows adding new futures
- between generator steps. Iteration will end when the generator has
- yielded all completed futures and JobQueue.jobs is empty.
- Yields (future, callback) pairs.
- '''
- while cls.jobs:
- completed, _ = concurrent.futures.wait(cls.jobs.keys(), return_when=concurrent.futures.FIRST_COMPLETED)
- for f in completed:
- callback = cls.jobs[f]
- del cls.jobs[f]
- yield f, callback
-
-class Dumper:
- """This class can dump symbols from a file with debug info, and
- store the output in a directory structure that is valid for use as
- a Breakpad symbol server. Requires a path to a dump_syms binary--
- |dump_syms| and a directory to store symbols in--|symbol_path|.
- Optionally takes a list of processor architectures to process from
- each debug file--|archs|, the full path to the top source
- directory--|srcdir|, for generating relative source file names,
- and an option to copy debug info files alongside the dumped
- symbol files--|copy_debug|, mostly useful for creating a
- Microsoft Symbol Server from the resulting output.
-
- You don't want to use this directly if you intend to process files.
- Instead, call GetPlatformSpecificDumper to get an instance of a
- subclass.
-
- Processing is performed asynchronously via worker processes; in
- order to wait for processing to finish and cleanup correctly, you
- must call Finish after all ProcessFiles calls have been made.
- You must also call Dumper.GlobalInit before creating or using any
- instances."""
- def __init__(self, dump_syms, symbol_path,
- archs=None,
- srcdirs=[],
- copy_debug=False,
- vcsinfo=False,
- srcsrv=False,
- exclude=[],
- repo_manifest=None,
- file_mapping=None):
- # popen likes absolute paths, at least on windows
- self.dump_syms = os.path.abspath(dump_syms)
- self.symbol_path = symbol_path
- if archs is None:
- # makes the loop logic simpler
- self.archs = ['']
- else:
- self.archs = ['-a %s' % a for a in archs.split()]
- self.srcdirs = [os.path.normpath(a) for a in srcdirs]
- self.copy_debug = copy_debug
- self.vcsinfo = vcsinfo
- self.srcsrv = srcsrv
- self.exclude = exclude[:]
- if repo_manifest:
- self.parse_repo_manifest(repo_manifest)
- self.file_mapping = file_mapping or {}
-
- # book-keeping to keep track of the cleanup work per file tuple
- self.files_record = {}
-
- @classmethod
- def GlobalInit(cls, executor=concurrent.futures.ProcessPoolExecutor):
- """Initialize the class globals for the multiprocessing setup; must
- be called before any Dumper instances are created and used. Test cases
- may pass in a different executor to use, usually
- concurrent.futures.ThreadPoolExecutor."""
- num_cpus = multiprocessing.cpu_count()
- if num_cpus is None:
- # assume a dual core machine if we can't find out for some reason
- # probably better on single core anyway due to I/O constraints
- num_cpus = 2
-
- # have to create any locks etc before the pool
- manager = multiprocessing.Manager()
- cls.lock = manager.RLock()
- cls.srcdirRepoInfo = manager.dict()
- JobPool.init(executor(max_workers=num_cpus))
-
- def output(self, dest, output_str):
- """Writes |output_str| to |dest|, holding |lock|;
- terminates with a newline."""
- with Dumper.lock:
- dest.write(output_str + "\n")
- dest.flush()
-
- def output_pid(self, dest, output_str):
- """Debugging output; prepends the pid to the string."""
- self.output(dest, "%d: %s" % (os.getpid(), output_str))
-
- def parse_repo_manifest(self, repo_manifest):
- """
- Parse an XML manifest of repository info as produced
- by the `repo manifest -r` command.
- """
- doc = parse(repo_manifest)
- if doc.firstChild.tagName != "manifest":
- return
- # First, get remotes.
- def ensure_slash(u):
- if not u.endswith("/"):
- return u + "/"
- return u
- remotes = dict([(r.getAttribute("name"), ensure_slash(r.getAttribute("fetch"))) for r in doc.getElementsByTagName("remote")])
- # And default remote.
- default_remote = None
- if doc.getElementsByTagName("default"):
- default_remote = doc.getElementsByTagName("default")[0].getAttribute("remote")
- # Now get projects. Assume they're relative to repo_manifest.
- base_dir = os.path.abspath(os.path.dirname(repo_manifest))
- for proj in doc.getElementsByTagName("project"):
- # name is the repository URL relative to the remote path.
- name = proj.getAttribute("name")
- # path is the path on-disk, relative to the manifest file.
- path = proj.getAttribute("path")
- # revision is the changeset ID.
- rev = proj.getAttribute("revision")
- # remote is the base URL to use.
- remote = proj.getAttribute("remote")
- # remote defaults to the <default remote>.
- if not remote:
- remote = default_remote
- # path defaults to name.
- if not path:
- path = name
- if not (name and path and rev and remote):
- print "Skipping project %s" % proj.toxml()
- continue
- remote = remotes[remote]
- # Turn git URLs into http URLs so that urljoin works.
- if remote.startswith("git:"):
- remote = "http" + remote[3:]
- # Add this project to srcdirs.
- srcdir = os.path.join(base_dir, path)
- self.srcdirs.append(srcdir)
- # And cache its VCS file info. Currently all repos mentioned
- # in a repo manifest are assumed to be git.
- root = urlparse.urljoin(remote, name)
- Dumper.srcdirRepoInfo[srcdir] = GitRepoInfo(srcdir, rev, root)
-
- # subclasses override this
- def ShouldProcess(self, file):
- return not any(fnmatch.fnmatch(os.path.basename(file), exclude) for exclude in self.exclude)
-
- # and can override this
- def ShouldSkipDir(self, dir):
- return False
-
- def RunFileCommand(self, file):
- """Utility function, returns the output of file(1)"""
- try:
- # we use -L to read the targets of symlinks,
- # and -b to print just the content, not the filename
- return os.popen("file -Lb " + file).read()
- except:
- return ""
-
- # This is a no-op except on Win32
- def FixFilenameCase(self, file):
- return file
-
- # This is a no-op except on Win32
- def SourceServerIndexing(self, debug_file, guid, sourceFileStream, vcs_root):
- return ""
-
- # subclasses override this if they want to support this
- def CopyDebug(self, file, debug_file, guid, code_file, code_id):
- pass
-
- def Finish(self, stop_pool=True):
- '''Process all pending jobs and any jobs their callbacks submit.
- By default, will shutdown the executor, but for testcases that
- need multiple runs, pass stop_pool = False.'''
- for job, callback in JobPool.as_completed():
- try:
- res = job.result()
- except Exception as e:
- self.output(sys.stderr, 'Job raised exception: %s' % e)
- continue
- callback(res)
- if stop_pool:
- JobPool.shutdown()
-
- def Process(self, *args):
- """Process files recursively in args."""
- # We collect all files to process first then sort by size to schedule
- # larger files first because larger files tend to take longer and we
- # don't like long pole stragglers.
- files = set()
- for arg in args:
- for f in self.get_files_to_process(arg):
- files.add(f)
-
- for f in sorted(files, key=os.path.getsize, reverse=True):
- self.ProcessFiles((f,))
-
- def get_files_to_process(self, file_or_dir):
- """Generate the files to process from an input."""
- if os.path.isdir(file_or_dir) and not self.ShouldSkipDir(file_or_dir):
- for f in self.get_files_to_process_in_dir(file_or_dir):
- yield f
- elif os.path.isfile(file_or_dir):
- yield file_or_dir
-
- def get_files_to_process_in_dir(self, path):
- """Generate the files to process in a directory.
-
- Valid files are are determined by calling ShouldProcess.
- """
- for root, dirs, files in os.walk(path):
- for d in dirs[:]:
- if self.ShouldSkipDir(d):
- dirs.remove(d)
- for f in files:
- fullpath = os.path.join(root, f)
- if self.ShouldProcess(fullpath):
- yield fullpath
-
- def SubmitJob(self, file_key, func_name, args, callback):
- """Submits a job to the pool of workers"""
- JobPool.submit((self, Dumper.lock, Dumper.srcdirRepoInfo, func_name, args), callback)
-
- def ProcessFilesFinished(self, res):
- """Callback from multiprocesing when ProcessFilesWork finishes;
- run the cleanup work, if any"""
- # only run the cleanup function once per tuple of files
- self.files_record[res['files']] += 1
- if self.files_record[res['files']] == len(self.archs):
- del self.files_record[res['files']]
- if res['after']:
- res['after'](res['status'], res['after_arg'])
-
- def ProcessFiles(self, files, after=None, after_arg=None):
- """Dump symbols from these files into a symbol file, stored
- in the proper directory structure in |symbol_path|; processing is performed
- asynchronously, and Finish must be called to wait for it complete and cleanup.
- All files after the first are fallbacks in case the first file does not process
- successfully; if it does, no other files will be touched."""
- self.output_pid(sys.stderr, "Submitting jobs for files: %s" % str(files))
-
- # tries to get the vcs root from the .mozconfig first - if it's not set
- # the tinderbox vcs path will be assigned further down
- vcs_root = os.environ.get('MOZ_SOURCE_REPO')
- for arch_num, arch in enumerate(self.archs):
- self.files_record[files] = 0 # record that we submitted jobs for this tuple of files
- self.SubmitJob(files[-1], 'ProcessFilesWork', args=(files, arch_num, arch, vcs_root, after, after_arg), callback=self.ProcessFilesFinished)
-
- def dump_syms_cmdline(self, file, arch, files):
- '''
- Get the commandline used to invoke dump_syms.
- '''
- # The Mac dumper overrides this.
- return [self.dump_syms, file]
-
- def ProcessFilesWork(self, files, arch_num, arch, vcs_root, after, after_arg):
- t_start = time.time()
- self.output_pid(sys.stderr, "Worker processing files: %s" % (files,))
-
- # our result is a status, a cleanup function, an argument to that function, and the tuple of files we were called on
- result = { 'status' : False, 'after' : after, 'after_arg' : after_arg, 'files' : files }
-
- sourceFileStream = ''
- code_id, code_file = None, None
- for file in files:
- # files is a tuple of files, containing fallbacks in case the first file doesn't process successfully
- try:
- cmd = self.dump_syms_cmdline(file, arch, files)
- self.output_pid(sys.stderr, ' '.join(cmd))
- proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
- stderr=open(os.devnull, 'wb'))
- module_line = proc.stdout.next()
- if module_line.startswith("MODULE"):
- # MODULE os cpu guid debug_file
- (guid, debug_file) = (module_line.split())[3:5]
- # strip off .pdb extensions, and append .sym
- sym_file = re.sub("\.pdb$", "", debug_file) + ".sym"
- # we do want forward slashes here
- rel_path = os.path.join(debug_file,
- guid,
- sym_file).replace("\\", "/")
- full_path = os.path.normpath(os.path.join(self.symbol_path,
- rel_path))
- try:
- os.makedirs(os.path.dirname(full_path))
- except OSError: # already exists
- pass
- f = open(full_path, "w")
- f.write(module_line)
- # now process the rest of the output
- for line in proc.stdout:
- if line.startswith("FILE"):
- # FILE index filename
- (x, index, filename) = line.rstrip().split(None, 2)
- filename = os.path.normpath(self.FixFilenameCase(filename))
- # We want original file paths for the source server.
- sourcepath = filename
- if filename in self.file_mapping:
- filename = self.file_mapping[filename]
- if self.vcsinfo:
- (filename, rootname) = GetVCSFilename(filename, self.srcdirs)
- # sets vcs_root in case the loop through files were to end on an empty rootname
- if vcs_root is None:
- if rootname:
- vcs_root = rootname
- # gather up files with hg for indexing
- if filename.startswith("hg"):
- (ver, checkout, source_file, revision) = filename.split(":", 3)
- sourceFileStream += sourcepath + "*" + source_file + '*' + revision + "\r\n"
- f.write("FILE %s %s\n" % (index, filename))
- elif line.startswith("INFO CODE_ID "):
- # INFO CODE_ID code_id code_file
- # This gives some info we can use to
- # store binaries in the symbol store.
- bits = line.rstrip().split(None, 3)
- if len(bits) == 4:
- code_id, code_file = bits[2:]
- f.write(line)
- else:
- # pass through all other lines unchanged
- f.write(line)
- # we want to return true only if at least one line is not a MODULE or FILE line
- result['status'] = True
- f.close()
- proc.wait()
- # we output relative paths so callers can get a list of what
- # was generated
- self.output(sys.stdout, rel_path)
- if self.srcsrv and vcs_root:
- # add source server indexing to the pdb file
- self.SourceServerIndexing(file, guid, sourceFileStream, vcs_root)
- # only copy debug the first time if we have multiple architectures
- if self.copy_debug and arch_num == 0:
- self.CopyDebug(file, debug_file, guid,
- code_file, code_id)
- except StopIteration:
- pass
- except Exception as e:
- self.output(sys.stderr, "Unexpected error: %s" % (str(e),))
- raise
- if result['status']:
- # we only need 1 file to work
- break
-
- elapsed = time.time() - t_start
- self.output_pid(sys.stderr, 'Worker finished processing %s in %.2fs' %
- (files, elapsed))
- return result
-
-# Platform-specific subclasses. For the most part, these just have
-# logic to determine what files to extract symbols from.
-
-class Dumper_Win32(Dumper):
- fixedFilenameCaseCache = {}
-
- def ShouldProcess(self, file):
- """This function will allow processing of pdb files that have dll
- or exe files with the same base name next to them."""
- if not Dumper.ShouldProcess(self, file):
- return False
- if file.endswith(".pdb"):
- (path,ext) = os.path.splitext(file)
- if os.path.isfile(path + ".exe") or os.path.isfile(path + ".dll"):
- return True
- return False
-
- def FixFilenameCase(self, file):
- """Recent versions of Visual C++ put filenames into
- PDB files as all lowercase. If the file exists
- on the local filesystem, fix it."""
-
- # Use a cached version if we have one.
- if file in self.fixedFilenameCaseCache:
- return self.fixedFilenameCaseCache[file]
-
- result = file
-
- ctypes.windll.kernel32.SetErrorMode(ctypes.c_uint(1))
- if not isinstance(file, unicode):
- file = unicode(file, sys.getfilesystemencoding())
- handle = ctypes.windll.kernel32.CreateFileW(file,
- # GENERIC_READ
- 0x80000000,
- # FILE_SHARE_READ
- 1,
- None,
- # OPEN_EXISTING
- 3,
- 0,
- None)
- if handle != -1:
- size = ctypes.windll.kernel32.GetFinalPathNameByHandleW(handle,
- None,
- 0,
- 0)
- buf = ctypes.create_unicode_buffer(size)
- if ctypes.windll.kernel32.GetFinalPathNameByHandleW(handle,
- buf,
- size,
- 0) > 0:
- # The return value of GetFinalPathNameByHandleW uses the
- # '\\?\' prefix.
- result = buf.value.encode(sys.getfilesystemencoding())[4:]
- ctypes.windll.kernel32.CloseHandle(handle)
-
- # Cache the corrected version to avoid future filesystem hits.
- self.fixedFilenameCaseCache[file] = result
- return result
-
- def CopyDebug(self, file, debug_file, guid, code_file, code_id):
- def compress(path):
- compressed_file = path[:-1] + '_'
- # ignore makecab's output
- success = subprocess.call(["makecab.exe", "/D",
- "CompressionType=MSZIP",
- path, compressed_file],
- stdout=open(os.devnull, 'w'),
- stderr=subprocess.STDOUT)
- if success == 0 and os.path.exists(compressed_file):
- os.unlink(path)
- return True
- return False
-
- rel_path = os.path.join(debug_file,
- guid,
- debug_file).replace("\\", "/")
- full_path = os.path.normpath(os.path.join(self.symbol_path,
- rel_path))
- shutil.copyfile(file, full_path)
- if compress(full_path):
- self.output(sys.stdout, rel_path[:-1] + '_')
- else:
- self.output(sys.stdout, rel_path)
-
- # Copy the binary file as well
- if code_file and code_id:
- full_code_path = os.path.join(os.path.dirname(file),
- code_file)
- if os.path.exists(full_code_path):
- rel_path = os.path.join(code_file,
- code_id,
- code_file).replace("\\", "/")
- full_path = os.path.normpath(os.path.join(self.symbol_path,
- rel_path))
- try:
- os.makedirs(os.path.dirname(full_path))
- except OSError as e:
- if e.errno != errno.EEXIST:
- raise
- shutil.copyfile(full_code_path, full_path)
- if compress(full_path):
- self.output(sys.stdout, rel_path[:-1] + '_')
- else:
- self.output(sys.stdout, rel_path)
-
- def SourceServerIndexing(self, debug_file, guid, sourceFileStream, vcs_root):
- # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing
- debug_file = os.path.abspath(debug_file)
- streamFilename = debug_file + ".stream"
- stream_output_path = os.path.abspath(streamFilename)
- # Call SourceIndex to create the .stream file
- result = SourceIndex(sourceFileStream, stream_output_path, vcs_root)
- if self.copy_debug:
- pdbstr_path = os.environ.get("PDBSTR_PATH")
- pdbstr = os.path.normpath(pdbstr_path)
- subprocess.call([pdbstr, "-w", "-p:" + os.path.basename(debug_file),
- "-i:" + os.path.basename(streamFilename), "-s:srcsrv"],
- cwd=os.path.dirname(stream_output_path))
- # clean up all the .stream files when done
- os.remove(stream_output_path)
- return result
-
-class Dumper_Linux(Dumper):
- objcopy = os.environ['OBJCOPY'] if 'OBJCOPY' in os.environ else 'objcopy'
- def ShouldProcess(self, file):
- """This function will allow processing of files that are
- executable, or end with the .so extension, and additionally
- file(1) reports as being ELF files. It expects to find the file
- command in PATH."""
- if not Dumper.ShouldProcess(self, file):
- return False
- if file.endswith(".so") or os.access(file, os.X_OK):
- return self.RunFileCommand(file).startswith("ELF")
- return False
-
- def CopyDebug(self, file, debug_file, guid, code_file, code_id):
- # We want to strip out the debug info, and add a
- # .gnu_debuglink section to the object, so the debugger can
- # actually load our debug info later.
- file_dbg = file + ".dbg"
- if subprocess.call([self.objcopy, '--only-keep-debug', file, file_dbg]) == 0 and \
- subprocess.call([self.objcopy, '--add-gnu-debuglink=%s' % file_dbg, file]) == 0:
- rel_path = os.path.join(debug_file,
- guid,
- debug_file + ".dbg")
- full_path = os.path.normpath(os.path.join(self.symbol_path,
- rel_path))
- shutil.move(file_dbg, full_path)
- # gzip the shipped debug files
- os.system("gzip -4 -f %s" % full_path)
- self.output(sys.stdout, rel_path + ".gz")
- else:
- if os.path.isfile(file_dbg):
- os.unlink(file_dbg)
-
-class Dumper_Solaris(Dumper):
- def RunFileCommand(self, file):
- """Utility function, returns the output of file(1)"""
- try:
- output = os.popen("file " + file).read()
- return output.split('\t')[1];
- except:
- return ""
-
- def ShouldProcess(self, file):
- """This function will allow processing of files that are
- executable, or end with the .so extension, and additionally
- file(1) reports as being ELF files. It expects to find the file
- command in PATH."""
- if not Dumper.ShouldProcess(self, file):
- return False
- if file.endswith(".so") or os.access(file, os.X_OK):
- return self.RunFileCommand(file).startswith("ELF")
- return False
-
-def AfterMac(status, dsymbundle):
- """Cleanup function to run on Macs after we process the file(s)."""
- # CopyDebug will already have been run from Dumper.ProcessFiles
- shutil.rmtree(dsymbundle)
-
-class Dumper_Mac(Dumper):
- def ShouldProcess(self, file):
- """This function will allow processing of files that are
- executable, or end with the .dylib extension, and additionally
- file(1) reports as being Mach-O files. It expects to find the file
- command in PATH."""
- if not Dumper.ShouldProcess(self, file):
- return False
- if file.endswith(".dylib") or os.access(file, os.X_OK):
- return self.RunFileCommand(file).startswith("Mach-O")
- return False
-
- def ShouldSkipDir(self, dir):
- """We create .dSYM bundles on the fly, but if someone runs
- buildsymbols twice, we should skip any bundles we created
- previously, otherwise we'll recurse into them and try to
- dump the inner bits again."""
- if dir.endswith(".dSYM"):
- return True
- return False
-
- def ProcessFiles(self, files, after=None, after_arg=None):
- # also note, files must be len 1 here, since we're the only ones
- # that ever add more than one file to the list
- self.output_pid(sys.stderr, "Submitting job for Mac pre-processing on file: %s" % (files[0]))
- self.SubmitJob(files[0], 'ProcessFilesWorkMac', args=(files[0],), callback=self.ProcessFilesMacFinished)
-
- def ProcessFilesMacFinished(self, result):
- if result['status']:
- # kick off new jobs per-arch with our new list of files
- Dumper.ProcessFiles(self, result['files'], after=AfterMac, after_arg=result['files'][0])
-
- def dump_syms_cmdline(self, file, arch, files):
- '''
- Get the commandline used to invoke dump_syms.
- '''
- # dump_syms wants the path to the original binary and the .dSYM
- # in order to dump all the symbols.
- if len(files) == 2 and file == files[0] and file.endswith('.dSYM'):
- # This is the .dSYM bundle.
- return [self.dump_syms] + arch.split() + ['-g', file, files[1]]
- return Dumper.dump_syms_cmdline(self, file, arch, files)
-
- def ProcessFilesWorkMac(self, file):
- """dump_syms on Mac needs to be run on a dSYM bundle produced
- by dsymutil(1), so run dsymutil here and pass the bundle name
- down to the superclass method instead."""
- t_start = time.time()
- self.output_pid(sys.stderr, "Worker running Mac pre-processing on file: %s" % (file,))
-
- # our return is a status and a tuple of files to dump symbols for
- # the extra files are fallbacks; as soon as one is dumped successfully, we stop
- result = { 'status' : False, 'files' : None, 'file_key' : file }
- dsymbundle = file + ".dSYM"
- if os.path.exists(dsymbundle):
- shutil.rmtree(dsymbundle)
- dsymutil = buildconfig.substs['DSYMUTIL']
- # dsymutil takes --arch=foo instead of -a foo like everything else
- try:
- cmd = ([dsymutil] +
- [a.replace('-a ', '--arch=') for a in self.archs if a] +
- [file])
- self.output_pid(sys.stderr, ' '.join(cmd))
- subprocess.check_call(cmd, stdout=open(os.devnull, 'w'))
- except subprocess.CalledProcessError as e:
- self.output_pid(sys.stderr, 'Error running dsymutil: %s' % str(e))
-
- if not os.path.exists(dsymbundle):
- # dsymutil won't produce a .dSYM for files without symbols
- self.output_pid(sys.stderr, "No symbols found in file: %s" % (file,))
- result['status'] = False
- result['files'] = (file, )
- return result
-
- result['status'] = True
- result['files'] = (dsymbundle, file)
- elapsed = time.time() - t_start
- self.output_pid(sys.stderr, 'Worker finished processing %s in %.2fs' %
- (file, elapsed))
- return result
-
- def CopyDebug(self, file, debug_file, guid, code_file, code_id):
- """ProcessFiles has already produced a dSYM bundle, so we should just
- copy that to the destination directory. However, we'll package it
- into a .tar.bz2 because the debug symbols are pretty huge, and
- also because it's a bundle, so it's a directory. |file| here is the
- dSYM bundle, and |debug_file| is the original filename."""
- rel_path = os.path.join(debug_file,
- guid,
- os.path.basename(file) + ".tar.bz2")
- full_path = os.path.abspath(os.path.join(self.symbol_path,
- rel_path))
- success = subprocess.call(["tar", "cjf", full_path, os.path.basename(file)],
- cwd=os.path.dirname(file),
- stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT)
- if success == 0 and os.path.exists(full_path):
- self.output(sys.stdout, rel_path)
-
-# Entry point if called as a standalone program
-def main():
- parser = OptionParser(usage="usage: %prog [options] <dump_syms binary> <symbol store path> <debug info files>")
- parser.add_option("-c", "--copy",
- action="store_true", dest="copy_debug", default=False,
- help="Copy debug info files into the same directory structure as symbol files")
- parser.add_option("-a", "--archs",
- action="store", dest="archs",
- help="Run dump_syms -a <arch> for each space separated cpu architecture in ARCHS (only on OS X)")
- parser.add_option("-s", "--srcdir",
- action="append", dest="srcdir", default=[],
- help="Use SRCDIR to determine relative paths to source files")
- parser.add_option("-v", "--vcs-info",
- action="store_true", dest="vcsinfo",
- help="Try to retrieve VCS info for each FILE listed in the output")
- parser.add_option("-i", "--source-index",
- action="store_true", dest="srcsrv", default=False,
- help="Add source index information to debug files, making them suitable for use in a source server.")
- parser.add_option("-x", "--exclude",
- action="append", dest="exclude", default=[], metavar="PATTERN",
- help="Skip processing files matching PATTERN.")
- parser.add_option("--repo-manifest",
- action="store", dest="repo_manifest",
- help="""Get source information from this XML manifest
-produced by the `repo manifest -r` command.
-""")
- parser.add_option("--install-manifest",
- action="append", dest="install_manifests",
- default=[],
- help="""Use this install manifest to map filenames back
-to canonical locations in the source repository. Specify
-<install manifest filename>,<install destination> as a comma-separated pair.
-""")
- (options, args) = parser.parse_args()
-
- #check to see if the pdbstr.exe exists
- if options.srcsrv:
- pdbstr = os.environ.get("PDBSTR_PATH")
- if not os.path.exists(pdbstr):
- print >> sys.stderr, "Invalid path to pdbstr.exe - please set/check PDBSTR_PATH.\n"
- sys.exit(1)
-
- if len(args) < 3:
- parser.error("not enough arguments")
- exit(1)
-
- try:
- manifests = validate_install_manifests(options.install_manifests)
- except (IOError, ValueError) as e:
- parser.error(str(e))
- exit(1)
- file_mapping = make_file_mapping(manifests)
- dumper = GetPlatformSpecificDumper(dump_syms=args[0],
- symbol_path=args[1],
- copy_debug=options.copy_debug,
- archs=options.archs,
- srcdirs=options.srcdir,
- vcsinfo=options.vcsinfo,
- srcsrv=options.srcsrv,
- exclude=options.exclude,
- repo_manifest=options.repo_manifest,
- file_mapping=file_mapping)
-
- dumper.Process(*args[2:])
- dumper.Finish()
-
-# run main if run directly
-if __name__ == "__main__":
- # set up the multiprocessing infrastructure before we start;
- # note that this needs to be in the __main__ guard, or else Windows will choke
- Dumper.GlobalInit()
-
- main()
diff --git a/toolkit/crashreporter/tools/unit-symbolstore.py b/toolkit/crashreporter/tools/unit-symbolstore.py
deleted file mode 100644
index 021efbeeb3..0000000000
--- a/toolkit/crashreporter/tools/unit-symbolstore.py
+++ /dev/null
@@ -1,583 +0,0 @@
-#!/usr/bin/env python
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-import concurrent.futures
-import mock
-import mozunit
-import os
-import platform
-import shutil
-import struct
-import subprocess
-import sys
-import tempfile
-import unittest
-
-from mock import patch
-from mozpack.manifests import InstallManifest
-
-import symbolstore
-
-# Some simple functions to mock out files that the platform-specific dumpers will accept.
-# dump_syms itself will not be run (we mock that call out), but we can't override
-# the ShouldProcessFile method since we actually want to test that.
-def write_elf(filename):
- open(filename, "wb").write(struct.pack("<7B45x", 0x7f, ord("E"), ord("L"), ord("F"), 1, 1, 1))
-
-def write_macho(filename):
- open(filename, "wb").write(struct.pack("<I28x", 0xfeedface))
-
-def write_pdb(filename):
- open(filename, "w").write("aaa")
- # write out a fake DLL too
- open(os.path.splitext(filename)[0] + ".dll", "w").write("aaa")
-
-writer = {'Windows': write_pdb,
- 'Microsoft': write_pdb,
- 'Linux': write_elf,
- 'Sunos5': write_elf,
- 'Darwin': write_macho}[platform.system()]
-extension = {'Windows': ".pdb",
- 'Microsoft': ".pdb",
- 'Linux': ".so",
- 'Sunos5': ".so",
- 'Darwin': ".dylib"}[platform.system()]
-
-def add_extension(files):
- return [f + extension for f in files]
-
-class HelperMixin(object):
- """
- Test that passing filenames to exclude from processing works.
- """
- def setUp(self):
- self.test_dir = tempfile.mkdtemp()
- if not self.test_dir.endswith(os.sep):
- self.test_dir += os.sep
- symbolstore.srcdirRepoInfo = {}
- symbolstore.vcsFileInfoCache = {}
-
- # Remove environment variables that can influence tests.
- for e in ('MOZ_SOURCE_CHANGESET', 'MOZ_SOURCE_REPO'):
- try:
- del os.environ[e]
- except KeyError:
- pass
-
- def tearDown(self):
- shutil.rmtree(self.test_dir)
- symbolstore.srcdirRepoInfo = {}
- symbolstore.vcsFileInfoCache = {}
-
- def make_dirs(self, f):
- d = os.path.dirname(f)
- if d and not os.path.exists(d):
- os.makedirs(d)
-
- def add_test_files(self, files):
- for f in files:
- f = os.path.join(self.test_dir, f)
- self.make_dirs(f)
- writer(f)
-
-class TestSizeOrder(HelperMixin, unittest.TestCase):
- def test_size_order(self):
- """
- Test that files are processed ordered by size on disk.
- """
- processed = []
- def mock_process_file(filenames):
- for filename in filenames:
- processed.append((filename[len(self.test_dir):] if filename.startswith(self.test_dir) else filename).replace('\\', '/'))
- return True
- for f, size in (('a/one', 10), ('b/c/two', 30), ('c/three', 20)):
- f = os.path.join(self.test_dir, f)
- d = os.path.dirname(f)
- if d and not os.path.exists(d):
- os.makedirs(d)
- open(f, 'wb').write('x' * size)
- d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
- symbol_path="symbol_path")
- d.ShouldProcess = lambda f: True
- d.ProcessFiles = mock_process_file
- d.Process(self.test_dir)
- d.Finish(stop_pool=False)
- self.assertEqual(processed, ['b/c/two', 'c/three', 'a/one'])
-
-
-class TestExclude(HelperMixin, unittest.TestCase):
- def test_exclude_wildcard(self):
- """
- Test that using an exclude list with a wildcard pattern works.
- """
- processed = []
- def mock_process_file(filenames):
- for filename in filenames:
- processed.append((filename[len(self.test_dir):] if filename.startswith(self.test_dir) else filename).replace('\\', '/'))
- return True
- self.add_test_files(add_extension(["foo", "bar", "abc/xyz", "abc/fooxyz", "def/asdf", "def/xyzfoo"]))
- d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
- symbol_path="symbol_path",
- exclude=["*foo*"])
- d.ProcessFiles = mock_process_file
- d.Process(self.test_dir)
- d.Finish(stop_pool=False)
- processed.sort()
- expected = add_extension(["bar", "abc/xyz", "def/asdf"])
- expected.sort()
- self.assertEqual(processed, expected)
-
-
- def test_exclude_filenames(self):
- """
- Test that excluding a filename without a wildcard works.
- """
- processed = []
- def mock_process_file(filenames):
- for filename in filenames:
- processed.append((filename[len(self.test_dir):] if filename.startswith(self.test_dir) else filename).replace('\\', '/'))
- return True
- self.add_test_files(add_extension(["foo", "bar", "abc/foo", "abc/bar", "def/foo", "def/bar"]))
- d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
- symbol_path="symbol_path",
- exclude=add_extension(["foo"]))
- d.ProcessFiles = mock_process_file
- d.Process(self.test_dir)
- d.Finish(stop_pool=False)
- processed.sort()
- expected = add_extension(["bar", "abc/bar", "def/bar"])
- expected.sort()
- self.assertEqual(processed, expected)
-
-
-def mock_dump_syms(module_id, filename, extra=[]):
- return ["MODULE os x86 %s %s" % (module_id, filename)
- ] + extra + [
- "FILE 0 foo.c",
- "PUBLIC xyz 123"]
-
-
-class TestCopyDebug(HelperMixin, unittest.TestCase):
- def setUp(self):
- HelperMixin.setUp(self)
- self.symbol_dir = tempfile.mkdtemp()
- self.mock_call = patch("subprocess.call").start()
- self.stdouts = []
- self.mock_popen = patch("subprocess.Popen").start()
- stdout_iter = self.next_mock_stdout()
- def next_popen(*args, **kwargs):
- m = mock.MagicMock()
- m.stdout = stdout_iter.next()
- m.wait.return_value = 0
- return m
- self.mock_popen.side_effect = next_popen
- shutil.rmtree = patch("shutil.rmtree").start()
-
- def tearDown(self):
- HelperMixin.tearDown(self)
- patch.stopall()
- shutil.rmtree(self.symbol_dir)
-
- def next_mock_stdout(self):
- if not self.stdouts:
- yield iter([])
- for s in self.stdouts:
- yield iter(s)
-
- def test_copy_debug_universal(self):
- """
- Test that dumping symbols for multiple architectures only copies debug symbols once
- per file.
- """
- copied = []
- def mock_copy_debug(filename, debug_file, guid, code_file, code_id):
- copied.append(filename[len(self.symbol_dir):] if filename.startswith(self.symbol_dir) else filename)
- self.add_test_files(add_extension(["foo"]))
- self.stdouts.append(mock_dump_syms("X" * 33, add_extension(["foo"])[0]))
- self.stdouts.append(mock_dump_syms("Y" * 33, add_extension(["foo"])[0]))
- def mock_dsymutil(args, **kwargs):
- filename = args[-1]
- os.makedirs(filename + ".dSYM")
- return 0
- self.mock_call.side_effect = mock_dsymutil
- d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
- symbol_path=self.symbol_dir,
- copy_debug=True,
- archs="abc xyz")
- d.CopyDebug = mock_copy_debug
- d.Process(self.test_dir)
- d.Finish(stop_pool=False)
- self.assertEqual(1, len(copied))
-
- def test_copy_debug_copies_binaries(self):
- """
- Test that CopyDebug copies binaries as well on Windows.
- """
- test_file = os.path.join(self.test_dir, 'foo.pdb')
- write_pdb(test_file)
- code_file = 'foo.dll'
- code_id = 'abc123'
- self.stdouts.append(mock_dump_syms('X' * 33, 'foo.pdb',
- ['INFO CODE_ID %s %s' % (code_id, code_file)]))
- def mock_compress(args, **kwargs):
- filename = args[-1]
- open(filename, 'w').write('stuff')
- return 0
- self.mock_call.side_effect = mock_compress
- d = symbolstore.Dumper_Win32(dump_syms='dump_syms',
- symbol_path=self.symbol_dir,
- copy_debug=True)
- d.FixFilenameCase = lambda f: f
- d.Process(self.test_dir)
- d.Finish(stop_pool=False)
- self.assertTrue(os.path.isfile(os.path.join(self.symbol_dir, code_file, code_id, code_file[:-1] + '_')))
-
-class TestGetVCSFilename(HelperMixin, unittest.TestCase):
- def setUp(self):
- HelperMixin.setUp(self)
-
- def tearDown(self):
- HelperMixin.tearDown(self)
-
- @patch("subprocess.Popen")
- def testVCSFilenameHg(self, mock_Popen):
- # mock calls to `hg parent` and `hg showconfig paths.default`
- mock_communicate = mock_Popen.return_value.communicate
- mock_communicate.side_effect = [("abcd1234", ""),
- ("http://example.com/repo", "")]
- os.mkdir(os.path.join(self.test_dir, ".hg"))
- filename = os.path.join(self.test_dir, "foo.c")
- self.assertEqual("hg:example.com/repo:foo.c:abcd1234",
- symbolstore.GetVCSFilename(filename, [self.test_dir])[0])
-
- @patch("subprocess.Popen")
- def testVCSFilenameHgMultiple(self, mock_Popen):
- # mock calls to `hg parent` and `hg showconfig paths.default`
- mock_communicate = mock_Popen.return_value.communicate
- mock_communicate.side_effect = [("abcd1234", ""),
- ("http://example.com/repo", ""),
- ("0987ffff", ""),
- ("http://example.com/other", "")]
- srcdir1 = os.path.join(self.test_dir, "one")
- srcdir2 = os.path.join(self.test_dir, "two")
- os.makedirs(os.path.join(srcdir1, ".hg"))
- os.makedirs(os.path.join(srcdir2, ".hg"))
- filename1 = os.path.join(srcdir1, "foo.c")
- filename2 = os.path.join(srcdir2, "bar.c")
- self.assertEqual("hg:example.com/repo:foo.c:abcd1234",
- symbolstore.GetVCSFilename(filename1, [srcdir1, srcdir2])[0])
- self.assertEqual("hg:example.com/other:bar.c:0987ffff",
- symbolstore.GetVCSFilename(filename2, [srcdir1, srcdir2])[0])
-
- def testVCSFilenameEnv(self):
- # repo URL and changeset read from environment variables if defined.
- os.environ['MOZ_SOURCE_REPO'] = 'https://somewhere.com/repo'
- os.environ['MOZ_SOURCE_CHANGESET'] = 'abcdef0123456'
- os.mkdir(os.path.join(self.test_dir, '.hg'))
- filename = os.path.join(self.test_dir, 'foo.c')
- self.assertEqual('hg:somewhere.com/repo:foo.c:abcdef0123456',
- symbolstore.GetVCSFilename(filename, [self.test_dir])[0])
-
-
-class TestRepoManifest(HelperMixin, unittest.TestCase):
- def testRepoManifest(self):
- manifest = os.path.join(self.test_dir, "sources.xml")
- open(manifest, "w").write("""<?xml version="1.0" encoding="UTF-8"?>
-<manifest>
-<remote fetch="http://example.com/foo/" name="foo"/>
-<remote fetch="git://example.com/bar/" name="bar"/>
-<default remote="bar"/>
-<project name="projects/one" revision="abcd1234"/>
-<project name="projects/two" path="projects/another" revision="ffffffff" remote="foo"/>
-<project name="something_else" revision="00000000" remote="bar"/>
-</manifest>
-""")
- # Use a source file from each of the three projects
- file1 = os.path.join(self.test_dir, "projects", "one", "src1.c")
- file2 = os.path.join(self.test_dir, "projects", "another", "src2.c")
- file3 = os.path.join(self.test_dir, "something_else", "src3.c")
- d = symbolstore.Dumper("dump_syms", "symbol_path",
- repo_manifest=manifest)
- self.assertEqual("git:example.com/bar/projects/one:src1.c:abcd1234",
- symbolstore.GetVCSFilename(file1, d.srcdirs)[0])
- self.assertEqual("git:example.com/foo/projects/two:src2.c:ffffffff",
- symbolstore.GetVCSFilename(file2, d.srcdirs)[0])
- self.assertEqual("git:example.com/bar/something_else:src3.c:00000000",
- symbolstore.GetVCSFilename(file3, d.srcdirs)[0])
-
-if platform.system() in ("Windows", "Microsoft"):
- class TestFixFilenameCase(HelperMixin, unittest.TestCase):
- def test_fix_filename_case(self):
- # self.test_dir is going to be 8.3 paths...
- junk = os.path.join(self.test_dir, 'x')
- with open(junk, 'wb') as o:
- o.write('x')
- d = symbolstore.Dumper_Win32(dump_syms='dump_syms',
- symbol_path=self.test_dir)
- fixed_dir = os.path.dirname(d.FixFilenameCase(junk))
- files = [
- 'one\\two.c',
- 'three\\Four.d',
- 'Five\\Six.e',
- 'seven\\Eight\\nine.F',
- ]
- for rel_path in files:
- full_path = os.path.normpath(os.path.join(self.test_dir,
- rel_path))
- self.make_dirs(full_path)
- with open(full_path, 'wb') as o:
- o.write('x')
- fixed_path = d.FixFilenameCase(full_path.lower())
- fixed_path = os.path.relpath(fixed_path, fixed_dir)
- self.assertEqual(rel_path, fixed_path)
-
- class TestSourceServer(HelperMixin, unittest.TestCase):
- @patch("subprocess.call")
- @patch("subprocess.Popen")
- def test_HGSERVER(self, mock_Popen, mock_call):
- """
- Test that HGSERVER gets set correctly in the source server index.
- """
- symbolpath = os.path.join(self.test_dir, "symbols")
- os.makedirs(symbolpath)
- srcdir = os.path.join(self.test_dir, "srcdir")
- os.makedirs(os.path.join(srcdir, ".hg"))
- sourcefile = os.path.join(srcdir, "foo.c")
- test_files = add_extension(["foo"])
- self.add_test_files(test_files)
- # srcsrv needs PDBSTR_PATH set
- os.environ["PDBSTR_PATH"] = "pdbstr"
- # mock calls to `dump_syms`, `hg parent` and
- # `hg showconfig paths.default`
- mock_Popen.return_value.stdout = iter([
- "MODULE os x86 %s %s" % ("X" * 33, test_files[0]),
- "FILE 0 %s" % sourcefile,
- "PUBLIC xyz 123"
- ])
- mock_communicate = mock_Popen.return_value.communicate
- mock_communicate.side_effect = [("abcd1234", ""),
- ("http://example.com/repo", ""),
- ]
- # And mock the call to pdbstr to capture the srcsrv stream data.
- global srcsrv_stream
- srcsrv_stream = None
- def mock_pdbstr(args, cwd="", **kwargs):
- for arg in args:
- if arg.startswith("-i:"):
- global srcsrv_stream
- srcsrv_stream = open(os.path.join(cwd, arg[3:]), 'r').read()
- return 0
- mock_call.side_effect = mock_pdbstr
- d = symbolstore.GetPlatformSpecificDumper(dump_syms="dump_syms",
- symbol_path=symbolpath,
- srcdirs=[srcdir],
- vcsinfo=True,
- srcsrv=True,
- copy_debug=True)
- # stub out CopyDebug
- d.CopyDebug = lambda *args: True
- d.Process(self.test_dir)
- d.Finish(stop_pool=False)
- self.assertNotEqual(srcsrv_stream, None)
- hgserver = [x.rstrip() for x in srcsrv_stream.splitlines() if x.startswith("HGSERVER=")]
- self.assertEqual(len(hgserver), 1)
- self.assertEqual(hgserver[0].split("=")[1], "http://example.com/repo")
-
-class TestInstallManifest(HelperMixin, unittest.TestCase):
- def setUp(self):
- HelperMixin.setUp(self)
- self.srcdir = os.path.join(self.test_dir, 'src')
- os.mkdir(self.srcdir)
- self.objdir = os.path.join(self.test_dir, 'obj')
- os.mkdir(self.objdir)
- self.manifest = InstallManifest()
- self.canonical_mapping = {}
- for s in ['src1', 'src2']:
- srcfile = os.path.join(self.srcdir, s)
- objfile = os.path.join(self.objdir, s)
- self.canonical_mapping[objfile] = srcfile
- self.manifest.add_copy(srcfile, s)
- self.manifest_file = os.path.join(self.test_dir, 'install-manifest')
- self.manifest.write(self.manifest_file)
-
- def testMakeFileMapping(self):
- '''
- Test that valid arguments are validated.
- '''
- arg = '%s,%s' % (self.manifest_file, self.objdir)
- ret = symbolstore.validate_install_manifests([arg])
- self.assertEqual(len(ret), 1)
- manifest, dest = ret[0]
- self.assertTrue(isinstance(manifest, InstallManifest))
- self.assertEqual(dest, self.objdir)
-
- file_mapping = symbolstore.make_file_mapping(ret)
- for obj, src in self.canonical_mapping.iteritems():
- self.assertTrue(obj in file_mapping)
- self.assertEqual(file_mapping[obj], src)
-
- def testMissingFiles(self):
- '''
- Test that missing manifest files or install directories give errors.
- '''
- missing_manifest = os.path.join(self.test_dir, 'missing-manifest')
- arg = '%s,%s' % (missing_manifest, self.objdir)
- with self.assertRaises(IOError) as e:
- symbolstore.validate_install_manifests([arg])
- self.assertEqual(e.filename, missing_manifest)
-
- missing_install_dir = os.path.join(self.test_dir, 'missing-dir')
- arg = '%s,%s' % (self.manifest_file, missing_install_dir)
- with self.assertRaises(IOError) as e:
- symbolstore.validate_install_manifests([arg])
- self.assertEqual(e.filename, missing_install_dir)
-
- def testBadManifest(self):
- '''
- Test that a bad manifest file give errors.
- '''
- bad_manifest = os.path.join(self.test_dir, 'bad-manifest')
- with open(bad_manifest, 'wb') as f:
- f.write('junk\n')
- arg = '%s,%s' % (bad_manifest, self.objdir)
- with self.assertRaises(IOError) as e:
- symbolstore.validate_install_manifests([arg])
- self.assertEqual(e.filename, bad_manifest)
-
- def testBadArgument(self):
- '''
- Test that a bad manifest argument gives an error.
- '''
- with self.assertRaises(ValueError) as e:
- symbolstore.validate_install_manifests(['foo'])
-
-class TestFileMapping(HelperMixin, unittest.TestCase):
- def setUp(self):
- HelperMixin.setUp(self)
- self.srcdir = os.path.join(self.test_dir, 'src')
- os.mkdir(self.srcdir)
- self.objdir = os.path.join(self.test_dir, 'obj')
- os.mkdir(self.objdir)
- self.symboldir = os.path.join(self.test_dir, 'symbols')
- os.mkdir(self.symboldir)
-
- @patch("subprocess.Popen")
- def testFileMapping(self, mock_Popen):
- files = [('a/b', 'mozilla/b'),
- ('c/d', 'foo/d')]
- if os.sep != '/':
- files = [[f.replace('/', os.sep) for f in x] for x in files]
- file_mapping = {}
- dumped_files = []
- expected_files = []
- for s, o in files:
- srcfile = os.path.join(self.srcdir, s)
- expected_files.append(srcfile)
- file_mapping[os.path.join(self.objdir, o)] = srcfile
- dumped_files.append(os.path.join(self.objdir, 'x', 'y',
- '..', '..', o))
- # mock the dump_syms output
- file_id = ("X" * 33, 'somefile')
- def mk_output(files):
- return iter(
- [
- 'MODULE os x86 %s %s\n' % file_id
- ] +
- [
- 'FILE %d %s\n' % (i,s) for i, s in enumerate(files)
- ] +
- [
- 'PUBLIC xyz 123\n'
- ]
- )
- mock_Popen.return_value.stdout = mk_output(dumped_files)
-
- d = symbolstore.Dumper('dump_syms', self.symboldir,
- file_mapping=file_mapping)
- f = os.path.join(self.objdir, 'somefile')
- open(f, 'wb').write('blah')
- d.Process(f)
- d.Finish(stop_pool=False)
- expected_output = ''.join(mk_output(expected_files))
- symbol_file = os.path.join(self.symboldir,
- file_id[1], file_id[0], file_id[1] + '.sym')
- self.assertEqual(open(symbol_file, 'r').read(), expected_output)
-
-class TestFunctional(HelperMixin, unittest.TestCase):
- '''Functional tests of symbolstore.py, calling it with a real
- dump_syms binary and passing in a real binary to dump symbols from.
-
- Since the rest of the tests in this file mock almost everything and
- don't use the actual process pool like buildsymbols does, this tests
- that the way symbolstore.py gets called in buildsymbols works.
- '''
- def setUp(self):
- HelperMixin.setUp(self)
- import buildconfig
- self.skip_test = False
- if buildconfig.substs['MOZ_BUILD_APP'] != 'browser':
- self.skip_test = True
- self.topsrcdir = buildconfig.topsrcdir
- self.script_path = os.path.join(self.topsrcdir, 'toolkit',
- 'crashreporter', 'tools',
- 'symbolstore.py')
- if platform.system() in ("Windows", "Microsoft"):
- if buildconfig.substs['MSVC_HAS_DIA_SDK']:
- self.dump_syms = os.path.join(buildconfig.topobjdir,
- 'dist', 'host', 'bin',
- 'dump_syms.exe')
- else:
- self.dump_syms = os.path.join(self.topsrcdir,
- 'toolkit',
- 'crashreporter',
- 'tools',
- 'win32',
- 'dump_syms_vc{_MSC_VER}.exe'.format(**buildconfig.substs))
- self.target_bin = os.path.join(buildconfig.topobjdir,
- 'browser',
- 'app',
- 'firefox.pdb')
- else:
- self.dump_syms = os.path.join(buildconfig.topobjdir,
- 'dist', 'host', 'bin',
- 'dump_syms')
- self.target_bin = os.path.join(buildconfig.topobjdir,
- 'dist', 'bin', 'firefox')
-
-
- def tearDown(self):
- HelperMixin.tearDown(self)
-
- def testSymbolstore(self):
- if self.skip_test:
- raise unittest.SkipTest('Skipping test in non-Firefox product')
- output = subprocess.check_output([sys.executable,
- self.script_path,
- '--vcs-info',
- '-s', self.topsrcdir,
- self.dump_syms,
- self.test_dir,
- self.target_bin],
- stderr=open(os.devnull, 'w'))
- lines = filter(lambda x: x.strip(), output.splitlines())
- self.assertEqual(1, len(lines),
- 'should have one filename in the output')
- symbol_file = os.path.join(self.test_dir, lines[0])
- self.assertTrue(os.path.isfile(symbol_file))
- symlines = open(symbol_file, 'r').readlines()
- file_lines = filter(lambda x: x.startswith('FILE') and 'nsBrowserApp.cpp' in x, symlines)
- self.assertEqual(len(file_lines), 1,
- 'should have nsBrowserApp.cpp FILE line')
- filename = file_lines[0].split(None, 2)[2]
- self.assertEqual('hg:', filename[:3])
-
-
-if __name__ == '__main__':
- # use ThreadPoolExecutor to use threading instead of processes so
- # that our mocking/module-patching works.
- symbolstore.Dumper.GlobalInit(concurrent.futures.ThreadPoolExecutor)
-
- mozunit.main()
-
diff --git a/toolkit/crashreporter/tools/upload_symbols.py b/toolkit/crashreporter/tools/upload_symbols.py
deleted file mode 100644
index 7e94b238db..0000000000
--- a/toolkit/crashreporter/tools/upload_symbols.py
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/usr/bin/env python
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This script uploads a symbol zip file passed on the commandline
-# to the Socorro symbol upload API hosted on crash-stats.mozilla.org.
-#
-# Using this script requires you to have generated an authentication
-# token in the crash-stats web interface. You must put the token in a file
-# and set SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE to the path to the file in
-# the mozconfig you're using.
-
-from __future__ import print_function
-
-import os
-import redo
-import requests
-import sys
-
-try:
- from buildconfig import substs
-except ImportError:
- # Allow standalone use of this script, for use in TaskCluster
- from os import environ as substs
-
-url = 'https://symbols.mozilla.org/upload/'
-# Allow overwriting of the upload url with an environmental variable
-if 'SOCORRO_SYMBOL_UPLOAD_URL' in os.environ:
- url = os.environ['SOCORRO_SYMBOL_UPLOAD_URL']
-MAX_RETRIES = 5
-
-def print_error(r):
- if r.status_code < 400:
- print('Error: bad auth token? ({0}: {1})'.format(r.status_code,
- r.reason),
- file=sys.stderr)
- else:
- print('Error: got HTTP response {0}: {1}'.format(r.status_code,
- r.reason),
- file=sys.stderr)
-
- print('Response body:\n{sep}\n{body}\n{sep}\n'.format(
- sep='=' * 20,
- body=r.text
- ))
-
-def main():
- if len(sys.argv) != 2:
- print('Usage: uploadsymbols.py <zip file>', file=sys.stderr)
- return 1
-
- if not os.path.isfile(sys.argv[1]):
- print('Error: zip file "{0}" does not exist!'.format(sys.argv[1]),
- file=sys.stderr)
- return 1
- symbols_zip = sys.argv[1]
-
- if 'SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE' not in substs:
- print('Error: you must set SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE in your mozconfig!', file=sys.stderr)
- return 1
- token_file = substs['SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE']
-
- if not os.path.isfile(token_file):
- print('Error: SOCORRO_SYMBOL_UPLOAD_TOKEN_FILE "{0}" does not exist!'.format(token_file), file=sys.stderr)
- return 1
- auth_token = open(token_file, 'r').read().strip()
-
- print('Uploading symbol file "{0}" to "{1}"'.format(sys.argv[1], url))
-
- for i, _ in enumerate(redo.retrier(attempts=MAX_RETRIES), start=1):
- print('Attempt %d of %d...' % (i, MAX_RETRIES))
- try:
- r = requests.post(
- url,
- files={'symbols.zip': open(sys.argv[1], 'rb')},
- headers={'Auth-Token': auth_token},
- allow_redirects=False,
- timeout=120)
- # 500 is likely to be a transient failure.
- # Break out for success or other error codes.
- if r.status_code < 500:
- break
- print_error(r)
- except requests.exceptions.RequestException as e:
- print('Error: {0}'.format(e))
- print('Retrying...')
- else:
- print('Maximum retries hit, giving up!')
- return 1
-
- if r.status_code >= 200 and r.status_code < 300:
- print('Uploaded successfully!')
- return 0
-
- print_error(r)
- return 1
-
-if __name__ == '__main__':
- sys.exit(main())
-
diff --git a/toolkit/crashreporter/tools/win32/dump_syms_vc1600.exe b/toolkit/crashreporter/tools/win32/dump_syms_vc1600.exe
deleted file mode 100755
index 489cc4c4ad..0000000000
--- a/toolkit/crashreporter/tools/win32/dump_syms_vc1600.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/tools/win32/dump_syms_vc1700.exe b/toolkit/crashreporter/tools/win32/dump_syms_vc1700.exe
deleted file mode 100644
index 0ead28957e..0000000000
--- a/toolkit/crashreporter/tools/win32/dump_syms_vc1700.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/tools/win32/dump_syms_vc1800.exe b/toolkit/crashreporter/tools/win32/dump_syms_vc1800.exe
deleted file mode 100644
index 22e7398abd..0000000000
--- a/toolkit/crashreporter/tools/win32/dump_syms_vc1800.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/crashreporter/update-breakpad.sh b/toolkit/crashreporter/update-breakpad.sh
deleted file mode 100755
index 3b3079876d..0000000000
--- a/toolkit/crashreporter/update-breakpad.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-set -v -e -x
-
-# Usage: update-breakpad.sh <path to breakpad git clone> [rev, defaults to HEAD]
-
-if [ $# -lt 1 ]; then
- echo "Usage: update-breakpad.sh /path/to/breakpad/src [rev]"
- exit 1
-fi
-
-crashreporter_dir=`realpath $(dirname $0)`
-repo=${crashreporter_dir}/../..
-rm -rf ${crashreporter_dir}/google-breakpad
-
-breakpad_repo=$1
-rev=${2-HEAD}
-(cd $breakpad_repo; git archive --prefix=toolkit/crashreporter/google-breakpad/ $rev) | (cd $repo; tar xf -)
-# Breakpad uses gclient for externals, so manually export what we need.
-lss_rev=`python -c "import sys; execfile(sys.argv[1]); print deps['src/src/third_party/lss'].split('@')[1]" ${crashreporter_dir}/google-breakpad/DEPS`
-(cd $breakpad_repo/src/third_party/lss; git archive --prefix=toolkit/crashreporter/google-breakpad/src/third_party/lss/ $lss_rev) | (cd $repo; tar xf -)
-
-# remove some extraneous bits
-rm -rf \
- ${crashreporter_dir}/google-breakpad/docs/ \
- ${crashreporter_dir}/google-breakpad/scripts/ \
- ${crashreporter_dir}/google-breakpad/src/third_party/protobuf \
- ${crashreporter_dir}/google-breakpad/src/testing/ \
- ${crashreporter_dir}/google-breakpad/src/tools/gyp/ \
- ${crashreporter_dir}/google-breakpad/src/processor/testdata/ \
- ${crashreporter_dir}/google-breakpad/src/tools/windows/dump_syms/testdata/ \
- ${crashreporter_dir}/.travis.yml
-
-# restore our Makefile.ins
-hg -R ${repo} st -n | grep "Makefile\.in$" | xargs hg revert --no-backup
-# and moz.build files
-hg -R ${repo} st -n | grep "moz\.build$" | xargs hg revert --no-backup
-# and some other makefiles
-hg -R ${repo} st -n | grep "objs\.mozbuild$" | xargs hg revert --no-backup
-
-# Record git rev
-(cd $breakpad_repo; git rev-parse $rev) > ${crashreporter_dir}/google-breakpad/GIT-INFO
-
-# Apply any local patches
-shopt -s nullglob
-for p in ${crashreporter_dir}/breakpad-patches/*.patch; do
- if grep -q -e "--git" $p; then
- patch_opts="-p1"
- else
- patch_opts="-p0"
- fi
- echo "Applying $p"
- if ! filterdiff -x '*/Makefile*' $p | \
- patch -d ${crashreporter_dir}/google-breakpad ${patch_opts}; then
- echo "Failed to apply $p"
- exit 1
- fi
-done
-# remove any .orig files that snuck in
-find ${crashreporter_dir}/google-breakpad -name "*.orig" -exec rm '{}' \;
-
-hg addremove ${crashreporter_dir}/google-breakpad/
diff --git a/toolkit/crashreporter/update-jsoncpp.sh b/toolkit/crashreporter/update-jsoncpp.sh
deleted file mode 100644
index 962e14a186..0000000000
--- a/toolkit/crashreporter/update-jsoncpp.sh
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/bash
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-set -v -e -x
-
-# Usage: update-jsoncpp.sh <path to jsoncpp git clone> [rev, defaults to HEAD]
-
-if [ $# -lt 1 ]; then
- echo "Usage: update-jsoncpp.sh /path/to/jsoncpp/src [rev]"
- exit 1
-fi
-
-crashreporter_dir=$(realpath $(dirname $0))
-repo=${crashreporter_dir}/../..
-rm -rf ${crashreporter_dir}/jsoncpp
-
-jsoncpp_repo=$1
-rev=${2-HEAD}
-(cd $jsoncpp_repo; git archive --prefix=toolkit/crashreporter/jsoncpp/ $rev) | (cd $repo; tar xf -)
-
-# remove some extraneous bits
-rm -rf \
- ${crashreporter_dir}/jsoncpp/.clang-format \
- ${crashreporter_dir}/jsoncpp/.gitattributes \
- ${crashreporter_dir}/jsoncpp/.gitignore \
- ${crashreporter_dir}/jsoncpp/.travis.yml \
- ${crashreporter_dir}/jsoncpp/CMakeLists.txt \
- ${crashreporter_dir}/jsoncpp/SConstruct \
- ${crashreporter_dir}/jsoncpp/amalgamate.py \
- ${crashreporter_dir}/jsoncpp/appveyor.yml \
- ${crashreporter_dir}/jsoncpp/dev.makefile \
- ${crashreporter_dir}/jsoncpp/devtools \
- ${crashreporter_dir}/jsoncpp/doc \
- ${crashreporter_dir}/jsoncpp/doxybuild.py \
- ${crashreporter_dir}/jsoncpp/include/CMakeLists.txt \
- ${crashreporter_dir}/jsoncpp/makefiles \
- ${crashreporter_dir}/jsoncpp/makerelease.py \
- ${crashreporter_dir}/jsoncpp/pkg-config \
- ${crashreporter_dir}/jsoncpp/scons-tools \
- ${crashreporter_dir}/jsoncpp/src/CMakeLists.txt \
- ${crashreporter_dir}/jsoncpp/src/jsontestrunner \
- ${crashreporter_dir}/jsoncpp/src/lib_json/CMakeLists.txt \
- ${crashreporter_dir}/jsoncpp/src/lib_json/sconscript \
- ${crashreporter_dir}/jsoncpp/src/lib_json/version.h.in \
- ${crashreporter_dir}/jsoncpp/src/test_lib_json \
- ${crashreporter_dir}/jsoncpp/test \
- ${crashreporter_dir}/jsoncpp/travis.sh \
- ${crashreporter_dir}/jsoncpp/version \
- ${crashreporter_dir}/jsoncpp/version.in
-
-# restore our moz.build files
-hg -R ${repo} st -n | grep "moz\.build$" | xargs hg revert --no-backup
-
-# Record git rev
-(cd $jsoncpp_repo; git rev-parse $rev) > ${crashreporter_dir}/jsoncpp/GIT-INFO
-
-# remove any .orig files that snuck in
-find ${crashreporter_dir}/jsoncpp -name "*.orig" -exec rm '{}' \;
-
-hg addremove ${crashreporter_dir}/jsoncpp/
diff --git a/toolkit/jetpack/moz.build b/toolkit/jetpack/moz.build
index 22be010d60..6d27f8a3fa 100644
--- a/toolkit/jetpack/moz.build
+++ b/toolkit/jetpack/moz.build
@@ -127,11 +127,6 @@ EXTRA_JS_MODULES.commonjs += [
'test.js',
]
-if CONFIG['MOZ_WEBEXTENSIONS']:
- EXTRA_JS_MODULES.commonjs.sdk += [
- 'sdk/webextension.js',
- ]
-
EXTRA_JS_MODULES.commonjs.dev += [
'dev/debuggee.js',
'dev/frame-script.js',
@@ -228,6 +223,7 @@ EXTRA_PP_JS_MODULES.commonjs.sdk += [
]
EXTRA_JS_MODULES.commonjs.sdk.addon += [
+ 'sdk/addon/bootstrap.js',
'sdk/addon/events.js',
'sdk/addon/host.js',
'sdk/addon/installer.js',
@@ -236,10 +232,6 @@ EXTRA_JS_MODULES.commonjs.sdk.addon += [
'sdk/addon/window.js',
]
-EXTRA_PP_JS_MODULES.commonjs.sdk.addon += [
- 'sdk/addon/bootstrap.js',
-]
-
EXTRA_JS_MODULES.commonjs.sdk.browser += [
'sdk/browser/events.js',
]
diff --git a/toolkit/jetpack/sdk/addon/bootstrap.js b/toolkit/jetpack/sdk/addon/bootstrap.js
index 6c5827f1eb..a6055bd10d 100644
--- a/toolkit/jetpack/sdk/addon/bootstrap.js
+++ b/toolkit/jetpack/sdk/addon/bootstrap.js
@@ -134,11 +134,6 @@ Bootstrap.prototype = {
const main = command === "test" ? "sdk/test/runner" : null;
const prefsURI = `${baseURI}defaults/preferences/prefs.js`;
-#ifdef MOZ_WEBEXTENSIONS
- // Init the 'sdk/webextension' module from the bootstrap addon parameter.
- require("sdk/webextension").initFromBootstrapAddonParam(addon);
-#endif
-
const { startup } = require("sdk/addon/runner");
startup(reason, {loader, main, prefsURI});
}.bind(this)).catch(error => {
diff --git a/toolkit/jetpack/sdk/webextension.js b/toolkit/jetpack/sdk/webextension.js
deleted file mode 100644
index d1c4385e2b..0000000000
--- a/toolkit/jetpack/sdk/webextension.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-module.metadata = {
- "stability": "experimental"
-};
-
-let webExtension;
-let waitForWebExtensionAPI;
-
-module.exports = {
- initFromBootstrapAddonParam(data) {
- if (webExtension) {
- throw new Error("'sdk/webextension' module has been already initialized");
- }
-
- webExtension = data.webExtension;
- },
-
- startup() {
- if (!webExtension) {
- return Promise.reject(new Error(
- "'sdk/webextension' module is currently disabled. " +
- "('hasEmbeddedWebExtension' option is missing or set to false)"
- ));
- }
-
- // NOTE: calling `startup` more than once raises an "Embedded Extension already started"
- // error, but given that SDK addons are going to have access to the startup method through
- // an SDK module that can be required in any part of the addon, it will be nicer if any
- // additional startup calls return the startup promise instead of raising an exception,
- // so that the SDK addon can access the API object in the other addon modules without the
- // need to manually pass this promise around.
- if (!waitForWebExtensionAPI) {
- waitForWebExtensionAPI = webExtension.startup();
- }
-
- return waitForWebExtensionAPI;
- }
-};
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
index 5191b5a212..ba7fb50329 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -270,15 +270,6 @@ if CONFIG['MOZ_ENABLE_STARTUP_NOTIFICATION']:
if CONFIG['MOZ_ENABLE_LIBPROXY']:
OS_LIBS += CONFIG['MOZ_LIBPROXY_LIBS']
-if CONFIG['OS_ARCH'] == 'SunOS':
- OS_LIBS += [
- 'elf',
- ]
- if CONFIG['GNU_CC']:
- OS_LIBS += [
- 'demangle',
- ]
-
if CONFIG['OS_ARCH'] == 'FreeBSD':
OS_LIBS += [
'util',
diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
index b5086032c1..febc18dfd0 100644
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -24,13 +24,6 @@
<!ENTITY cmd.back.tooltip "Go back one page">
<!ENTITY cmd.forward.tooltip "Go forward one page">
-#ifdef MOZ_WEBEXTENSIONS
-<!ENTITY showUnsignedExtensions.button.label "Some extensions could not be verified">
-<!ENTITY showAllExtensions.button.label "Show all extensions">
-<!ENTITY debugAddons.label "Debug Add-ons">
-<!ENTITY debugAddons.accesskey "B">
-#endif
-
<!-- global warnings -->
<!ENTITY warning.safemode.label "All add-ons have been disabled by safe mode.">
<!ENTITY warning.checkcompatibility.label "Add-on compatibility checking is disabled. You may have incompatible add-ons.">
@@ -242,23 +235,3 @@
<!ENTITY experiment.info.changetelemetry.accesskey "T">
<!ENTITY setting.learnmore "Learn More…">
-
-#ifdef MOZ_WEBEXTENSIONS
-<!ENTITY disabledUnsigned.heading "Some add-ons have been disabled">
-<!-- LOCALIZATION NOTE (disabledUnsigned.description.start, disabledUnsigned.description.findAddonsLink, disabledUnsigned.description.end):
- These entities form a sentence, with
- disabledUnsigned.description.findAddonsLink being a link to an external site. -->
-<!ENTITY disabledUnsigned.description.start "The following add-ons have not been verified for use in &brandShortName;. You can ">
-<!ENTITY disabledUnsigned.description.findAddonsLink "find replacements">
-<!ENTITY disabledUnsigned.description.end " or ask the developer to get them verified.">
-<!ENTITY disabledUnsigned.learnMore "Learn more about our efforts to help keep you safe online.">
-<!-- LOCALIZATION NOTE (disabledUnsigned.devInfo.start, disabledUnsigned.devInfo.linkToManual, disabledUnsigned.devInfo.end):
- These entities form a sentence, with disabledUnsigned.devInfo.linkToManual
- being a link to an external site. -->
-<!ENTITY disabledUnsigned.devInfo.start "Developers interested in getting their add-ons verified can continue by reading our ">
-<!ENTITY disabledUnsigned.devInfo.linkToManual "manual">
-<!ENTITY disabledUnsigned.devInfo.end ".">
-
-<!ENTITY pluginDeprecation.description "Missing something? Some plugins are no longer supported by &brandShortName;.">
-<!ENTITY pluginDeprecation.learnMore "Learn More.">
-#endif
diff --git a/toolkit/locales/jar.mn b/toolkit/locales/jar.mn
index e92e10599b..99c16de1d5 100644
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -107,7 +107,7 @@
locale/@AB_CD@/mozapps/downloads/settingsChange.dtd (%chrome/mozapps/downloads/settingsChange.dtd)
locale/@AB_CD@/mozapps/downloads/downloads.dtd (%chrome/mozapps/downloads/downloads.dtd)
locale/@AB_CD@/mozapps/downloads/downloads.properties (%chrome/mozapps/downloads/downloads.properties)
-* locale/@AB_CD@/mozapps/extensions/extensions.dtd (%chrome/mozapps/extensions/extensions.dtd)
+ locale/@AB_CD@/mozapps/extensions/extensions.dtd (%chrome/mozapps/extensions/extensions.dtd)
locale/@AB_CD@/mozapps/extensions/extensions.properties (%chrome/mozapps/extensions/extensions.properties)
locale/@AB_CD@/mozapps/extensions/blocklist.dtd (%chrome/mozapps/extensions/blocklist.dtd)
locale/@AB_CD@/mozapps/extensions/about.dtd (%chrome/mozapps/extensions/about.dtd)
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm
index 7c8a046e9b..1e2204f7ee 100644
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -180,13 +180,6 @@ MOZ_SAFE_BROWSING:
false,
#endif
- MOZ_MAINTENANCE_SERVICE:
-#ifdef MOZ_MAINTENANCE_SERVICE
- true,
-#else
- false,
-#endif
-
DEBUG:
#ifdef DEBUG
true,
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 948d8d2c9b..e0acdb19ef 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -103,11 +103,9 @@ EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm']
EXTRA_PP_JS_MODULES += [
'NewTabUtils.jsm',
'Troubleshoot.jsm',
+ 'UpdateChannel.jsm',
]
-if not CONFIG['MOZ_WEBEXTENSIONS']:
- EXTRA_PP_JS_MODULES += ['UpdateChannel.jsm']
-
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
diff --git a/toolkit/moz.build b/toolkit/moz.build
index 778f1c0dea..397444828a 100644
--- a/toolkit/moz.build
+++ b/toolkit/moz.build
@@ -22,15 +22,12 @@ DIRS += [
if CONFIG['MOZ_JETPACK']:
DIRS += ['jetpack']
-if CONFIG['MOZ_WEBEXTENSIONS']:
- DIRS += ['mozapps/webextensions']
-else:
- DIRS += ['mozapps/extensions']
+DIRS += ['mozapps/extensions']
if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
DIRS += ['mozapps/update']
-if CONFIG['MOZ_MAINTENANCE_SERVICE'] or CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
# Including mozapps/update/common-standalone allows the maintenance service
# to be built so the maintenance service can be used for things other than
# updating applications.
@@ -38,11 +35,6 @@ if CONFIG['MOZ_MAINTENANCE_SERVICE'] or CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WI
'mozapps/update/common-standalone',
]
-if CONFIG['MOZ_MAINTENANCE_SERVICE']:
- DIRS += [
- 'components/maintenanceservice'
- ]
-
DIRS += ['xre']
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3'):
@@ -54,10 +46,6 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
DIRS += ['system/androidproxy']
-TEST_HARNESS_FILES.testing.mochitest.browser.toolkit.crashreporter.test.browser += [
- 'crashreporter/test/browser/crashreport.sjs',
-]
-
with Files('mozapps/installer/windows/*'):
BUG_COMPONENT = ('Toolkit', 'NSIS Installer')
diff --git a/toolkit/mozapps/extensions/content/newaddon.js b/toolkit/mozapps/extensions/content/newaddon.js
index 79978a6986..aab556a620 100644
--- a/toolkit/mozapps/extensions/content/newaddon.js
+++ b/toolkit/mozapps/extensions/content/newaddon.js
@@ -43,9 +43,6 @@ function initialize() {
// been seen or it cannot be enabled then this UI is useless, just close it.
// This shouldn't normally happen unless session restore restores the tab.
if (!aAddon || !aAddon.userDisabled ||
-#ifdef MOZ_WEBEXTENSIONS
- aAddon.seen ||
-#endif
!(aAddon.permissions & AddonManager.PERM_CAN_ENABLE)) {
window.close();
return;
@@ -82,16 +79,6 @@ function initialize() {
document.getElementById("location").hidden = true;
}
-#ifdef MOZ_WEBEXTENSIONS
- // Only mark the add-on as seen if the page actually gets focus
- if (document.hasFocus()) {
- aAddon.markAsSeen();
- }
- else {
- document.addEventListener("focus", () => aAddon.markAsSeen(), false);
- }
-#endif
-
var event = document.createEvent("Events");
event.initEvent("AddonDisplayed", true, true);
document.dispatchEvent(event);
diff --git a/toolkit/mozapps/extensions/jar.mn b/toolkit/mozapps/extensions/jar.mn
index c4d8874c9e..e95d93ca02 100644
--- a/toolkit/mozapps/extensions/jar.mn
+++ b/toolkit/mozapps/extensions/jar.mn
@@ -26,7 +26,7 @@ toolkit.jar:
content/mozapps/extensions/eula.xul (content/eula.xul)
content/mozapps/extensions/eula.js (content/eula.js)
content/mozapps/extensions/newaddon.xul (content/newaddon.xul)
-* content/mozapps/extensions/newaddon.js (content/newaddon.js)
+ content/mozapps/extensions/newaddon.js (content/newaddon.js)
content/mozapps/extensions/setting.xml (content/setting.xml)
content/mozapps/extensions/pluginPrefs.xul (content/pluginPrefs.xul)
content/mozapps/extensions/gmpPrefs.xul (content/gmpPrefs.xul)
diff --git a/toolkit/mozapps/installer/windows/nsis/makensis.mk b/toolkit/mozapps/installer/windows/nsis/makensis.mk
index aff6d29e91..121819f6ab 100644
--- a/toolkit/mozapps/installer/windows/nsis/makensis.mk
+++ b/toolkit/mozapps/installer/windows/nsis/makensis.mk
@@ -75,10 +75,3 @@ uninstaller::
cd $(CONFIG_DIR) && $(MAKENSISU) uninstaller.nsi
$(NSINSTALL) -D $(DIST)/bin/uninstall
cp $(CONFIG_DIR)/helper.exe $(DIST)/bin/uninstall
-
-ifdef MOZ_MAINTENANCE_SERVICE
-maintenanceservice_installer::
- cd $(CONFIG_DIR) && $(MAKENSISU) maintenanceservice_installer.nsi
- $(NSINSTALL) -D $(DIST)/bin/
- cp $(CONFIG_DIR)/maintenanceservice_installer.exe $(DIST)/bin
-endif
diff --git a/toolkit/mozapps/update/common/errors.h b/toolkit/mozapps/update/common/errors.h
index aac0291759..846118d55d 100644
--- a/toolkit/mozapps/update/common/errors.h
+++ b/toolkit/mozapps/update/common/errors.h
@@ -42,18 +42,6 @@
#define MAR_CHANNEL_MISMATCH_ERROR 22
#define VERSION_DOWNGRADE_ERROR 23
-// Error codes 24-33 and 49-57 are for the Windows maintenance service.
-#define SERVICE_UPDATER_COULD_NOT_BE_STARTED 24
-#define SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS 25
-#define SERVICE_UPDATER_SIGN_ERROR 26
-#define SERVICE_UPDATER_COMPARE_ERROR 27
-#define SERVICE_UPDATER_IDENTITY_ERROR 28
-#define SERVICE_STILL_APPLYING_ON_SUCCESS 29
-#define SERVICE_STILL_APPLYING_ON_FAILURE 30
-#define SERVICE_UPDATER_NOT_FIXED_DRIVE 31
-#define SERVICE_COULD_NOT_LOCK_UPDATER 32
-#define SERVICE_INSTALLDIR_ERROR 33
-
#define NO_INSTALLDIR_ERROR 34
#define WRITE_ERROR_ACCESS_DENIED 35
// #define WRITE_ERROR_SHARING_VIOLATION 36 // Replaced with errors 46-48
@@ -67,17 +55,6 @@
#define DELETE_ERROR_EXPECTED_FILE 47
#define RENAME_ERROR_EXPECTED_FILE 48
-// Error codes 24-33 and 49-57 are for the Windows maintenance service.
-#define SERVICE_COULD_NOT_COPY_UPDATER 49
-#define SERVICE_STILL_APPLYING_TERMINATED 50
-#define SERVICE_STILL_APPLYING_NO_EXIT_CODE 51
-#define SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR 52
-#define SERVICE_CALC_REG_PATH_ERROR 53
-#define SERVICE_INVALID_APPLYTO_DIR_ERROR 54
-#define SERVICE_INVALID_INSTALL_DIR_PATH_ERROR 55
-#define SERVICE_INVALID_WORKING_DIR_PATH_ERROR 56
-#define SERVICE_INSTALL_DIR_REG_ERROR 57
-
#define WRITE_ERROR_FILE_COPY 61
#define WRITE_ERROR_DELETE_FILE 62
#define WRITE_ERROR_OPEN_PATCH_FILE 63
diff --git a/toolkit/mozapps/update/common/moz.build b/toolkit/mozapps/update/common/moz.build
index cacb0bad21..ca7c4c3073 100644
--- a/toolkit/mozapps/update/common/moz.build
+++ b/toolkit/mozapps/update/common/moz.build
@@ -17,11 +17,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'updatehelper.cpp',
'updatehelper.h',
]
- if CONFIG['MOZ_MAINTENANCE_SERVICE']:
- EXPORTS += [
- 'certificatecheck.h',
- 'registrycertificates.h',
- ]
Library('updatecommon')
diff --git a/toolkit/mozapps/update/common/sources.mozbuild b/toolkit/mozapps/update/common/sources.mozbuild
index cde51e09b0..3399446406 100644
--- a/toolkit/mozapps/update/common/sources.mozbuild
+++ b/toolkit/mozapps/update/common/sources.mozbuild
@@ -10,15 +10,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
'uachelper.cpp',
'updatehelper.cpp',
]
- if CONFIG['MOZ_MAINTENANCE_SERVICE']:
- sources += [
- 'certificatecheck.cpp',
- 'registrycertificates.cpp',
- ]
- OS_LIBS += [
- 'crypt32',
- 'wintrust',
- ]
sources += [
'readstrings.cpp',
diff --git a/toolkit/mozapps/update/common/updatedefines.h b/toolkit/mozapps/update/common/updatedefines.h
index 760d2c4c45..5790cf9967 100644
--- a/toolkit/mozapps/update/common/updatedefines.h
+++ b/toolkit/mozapps/update/common/updatedefines.h
@@ -96,11 +96,7 @@ static inline int mywcsprintf(WCHAR* dest, size_t count, const WCHAR* fmt, ...)
# include <sys/wait.h>
# include <unistd.h>
-#ifdef SOLARIS
-# include <sys/stat.h>
-#else
# include <fts.h>
-#endif
# include <dirent.h>
#ifdef XP_MACOSX
diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js
index 6e8de7275a..9996014b55 100644
--- a/toolkit/mozapps/update/content/updates.js
+++ b/toolkit/mozapps/update/content/updates.js
@@ -85,28 +85,6 @@ function openUpdateURL(event) {
}
/**
- * Gets a preference value, handling the case where there is no default.
- * @param func
- * The name of the preference function to call, on nsIPrefBranch
- * @param preference
- * The name of the preference
- * @param defaultValue
- * The default value to return in the event the preference has
- * no setting
- * @returns The value of the preference, or undefined if there was no
- * user or default value.
- */
-function getPref(func, preference, defaultValue) {
- try {
- return Services.prefs[func](preference);
- }
- catch (e) {
- LOG("General", "getPref - failed to get preference: " + preference);
- }
- return defaultValue;
-}
-
-/**
* A set of shared data and control functions for the wizard as a whole.
*/
var gUpdates = {
@@ -320,7 +298,7 @@ var gUpdates = {
onLoad: function() {
this.wiz = document.documentElement;
- gLogEnabled = getPref("getBoolPref", PREF_APP_UPDATE_LOG, false);
+ gLogEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_LOG, false);
this.strings = document.getElementById("updateStrings");
var brandStrings = document.getElementById("brandStrings");
@@ -601,7 +579,7 @@ var gNoUpdatesPage = {
LOG("gNoUpdatesPage", "onPageShow - could not select an appropriate " +
"update. Either there were no updates or |selectUpdate| failed");
- if (getPref("getBoolPref", PREF_APP_UPDATE_ENABLED, true))
+ if (Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true))
document.getElementById("noUpdatesAutoEnabled").hidden = false;
else
document.getElementById("noUpdatesAutoDisabled").hidden = false;
@@ -1309,7 +1287,7 @@ var gFinishedPage = {
moreElevatedLinkLabel.setAttribute("hidden", "false");
}
- if (getPref("getBoolPref", PREF_APP_UPDATE_TEST_LOOP, false)) {
+ if (Services.prefs.getBoolPref(PREF_APP_UPDATE_TEST_LOOP, false)) {
setTimeout(function () { gUpdates.wiz.getButton("finish").click(); },
UPDATE_TEST_LOOP_INTERVAL);
}
diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js
index 0cf7b89380..d9d09ba462 100644
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -35,15 +35,13 @@ const PREF_APP_UPDATE_LOG = "app.update.log";
const PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED = "app.update.notifiedUnsupported";
const PREF_APP_UPDATE_POSTUPDATE = "app.update.postupdate";
const PREF_APP_UPDATE_PROMPTWAITTIME = "app.update.promptWaitTime";
-const PREF_APP_UPDATE_SERVICE_ENABLED = "app.update.service.enabled";
-const PREF_APP_UPDATE_SERVICE_ERRORS = "app.update.service.errors";
-const PREF_APP_UPDATE_SERVICE_MAXERRORS = "app.update.service.maxErrors";
const PREF_APP_UPDATE_SILENT = "app.update.silent";
const PREF_APP_UPDATE_SOCKET_MAXERRORS = "app.update.socket.maxErrors";
const PREF_APP_UPDATE_SOCKET_RETRYTIMEOUT = "app.update.socket.retryTimeout";
const PREF_APP_UPDATE_STAGING_ENABLED = "app.update.staging.enabled";
const PREF_APP_UPDATE_URL = "app.update.url";
const PREF_APP_UPDATE_URL_DETAILS = "app.update.url.details";
+const PREF_APP_UPDATE_URL_OVERRIDE = "app.update.url.override";
const PREFBRANCH_APP_UPDATE_NEVER = "app.update.never.";
@@ -72,12 +70,10 @@ const FILE_UPDATE_VERSION = "update.version";
const STATE_NONE = "null";
const STATE_DOWNLOADING = "downloading";
const STATE_PENDING = "pending";
-const STATE_PENDING_SERVICE = "pending-service";
const STATE_PENDING_ELEVATE = "pending-elevate";
const STATE_APPLYING = "applying";
const STATE_APPLIED = "applied";
const STATE_APPLIED_OS = "applied-os";
-const STATE_APPLIED_SERVICE = "applied-service";
const STATE_SUCCEEDED = "succeeded";
const STATE_DOWNLOAD_FAILED = "download-failed";
const STATE_FAILED = "failed";
@@ -85,22 +81,9 @@ const STATE_FAILED = "failed";
// The values below used by this code are from common/errors.h
const WRITE_ERROR = 7;
const ELEVATION_CANCELED = 9;
-const SERVICE_UPDATER_COULD_NOT_BE_STARTED = 24;
-const SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS = 25;
-const SERVICE_UPDATER_SIGN_ERROR = 26;
-const SERVICE_UPDATER_COMPARE_ERROR = 27;
-const SERVICE_UPDATER_IDENTITY_ERROR = 28;
-const SERVICE_STILL_APPLYING_ON_SUCCESS = 29;
-const SERVICE_STILL_APPLYING_ON_FAILURE = 30;
-const SERVICE_UPDATER_NOT_FIXED_DRIVE = 31;
-const SERVICE_COULD_NOT_LOCK_UPDATER = 32;
-const SERVICE_INSTALLDIR_ERROR = 33;
const WRITE_ERROR_ACCESS_DENIED = 35;
const WRITE_ERROR_CALLBACK_APP = 37;
const FILESYSTEM_MOUNT_READWRITE_ERROR = 43;
-const SERVICE_COULD_NOT_COPY_UPDATER = 49;
-const SERVICE_STILL_APPLYING_TERMINATED = 50;
-const SERVICE_STILL_APPLYING_NO_EXIT_CODE = 51;
const WRITE_ERROR_FILE_COPY = 61;
const WRITE_ERROR_DELETE_FILE = 62;
const WRITE_ERROR_OPEN_PATCH_FILE = 63;
@@ -127,21 +110,6 @@ const WRITE_ERRORS = [WRITE_ERROR,
WRITE_ERROR_DELETE_BACKUP,
WRITE_ERROR_EXTRACT];
-// Array of write errors to simplify checks for service errors
-const SERVICE_ERRORS = [SERVICE_UPDATER_COULD_NOT_BE_STARTED,
- SERVICE_NOT_ENOUGH_COMMAND_LINE_ARGS,
- SERVICE_UPDATER_SIGN_ERROR,
- SERVICE_UPDATER_COMPARE_ERROR,
- SERVICE_UPDATER_IDENTITY_ERROR,
- SERVICE_STILL_APPLYING_ON_SUCCESS,
- SERVICE_STILL_APPLYING_ON_FAILURE,
- SERVICE_UPDATER_NOT_FIXED_DRIVE,
- SERVICE_COULD_NOT_LOCK_UPDATER,
- SERVICE_INSTALLDIR_ERROR,
- SERVICE_COULD_NOT_COPY_UPDATER,
- SERVICE_STILL_APPLYING_TERMINATED,
- SERVICE_STILL_APPLYING_NO_EXIT_CODE];
-
// Error codes 80 through 99 are reserved for nsUpdateService.js and are not
// defined in common/errors.h
const FOTA_GENERAL_ERROR = 80;
@@ -164,10 +132,6 @@ const DOWNLOAD_FOREGROUND_INTERVAL = 0;
const UPDATE_WINDOW_NAME = "Update:Wizard";
-// The number of consecutive failures when updating using the service before
-// setting the app.update.service.enabled preference to false.
-const DEFAULT_SERVICE_MAX_ERRORS = 10;
-
// The number of consecutive socket errors to allow before falling back to
// downloading a different MAR file or failing if already downloading the full.
const DEFAULT_SOCKET_MAX_ERRORS = 10;
@@ -200,7 +164,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
"resource://gre/modules/UpdateUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "gLogEnabled", function aus_gLogEnabled() {
- return getPref("getBoolPref", PREF_APP_UPDATE_LOG, false);
+ return Services.prefs.getBoolPref(PREF_APP_UPDATE_LOG, false);
});
XPCOMUtils.defineLazyGetter(this, "gUpdateBundle", function aus_gUpdateBundle() {
@@ -392,15 +356,7 @@ function getElevationRequired() {
* @return true if an update can be applied, false otherwise
*/
function getCanApplyUpdates() {
- let useService = false;
- if (shouldUseService()) {
- // No need to perform directory write checks, the maintenance service will
- // be able to write to all directories.
- LOG("getCanApplyUpdates - bypass the write checks because we'll use the service");
- useService = true;
- }
-
- if (!useService && AppConstants.platform != "macosx") {
+ if (AppConstants.platform != "macosx") {
try {
let updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
LOG("getCanApplyUpdates - testing write access " + updateTestFile.path);
@@ -478,7 +434,7 @@ function getCanApplyUpdates() {
// No write privileges to install directory
return false;
}
- } // if (!useService)
+ }
LOG("getCanApplyUpdates - able to apply updates");
return true;
@@ -538,19 +494,12 @@ XPCOMUtils.defineLazyGetter(this, "gCanStageUpdatesSession", function aus_gCSUS(
*/
function getCanStageUpdates() {
// If staging updates are disabled, then just bail out!
- if (!getPref("getBoolPref", PREF_APP_UPDATE_STAGING_ENABLED, false)) {
+ if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false)) {
LOG("getCanStageUpdates - staging updates is disabled by preference " +
PREF_APP_UPDATE_STAGING_ENABLED);
return false;
}
- if (AppConstants.platform == "win" && shouldUseService()) {
- // No need to perform directory write checks, the maintenance service will
- // be able to write to all directories.
- LOG("getCanStageUpdates - able to stage updates using the service");
- return true;
- }
-
if (!hasUpdateMutex()) {
LOG("getCanStageUpdates - unable to apply updates because another " +
"instance of the application is already handling updates for this " +
@@ -565,7 +514,7 @@ XPCOMUtils.defineLazyGetter(this, "gCanCheckForUpdates", function aus_gCanCheckF
// If the administrator has disabled app update and locked the preference so
// users can't check for updates. This preference check is ok in this lazy
// getter since locked prefs don't change until the application is restarted.
- var enabled = getPref("getBoolPref", PREF_APP_UPDATE_ENABLED, true);
+ var enabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true);
if (!enabled && Services.prefs.prefIsLocked(PREF_APP_UPDATE_ENABLED)) {
LOG("gCanCheckForUpdates - unable to automatically check for updates, " +
"the preference is disabled and admistratively locked.");
@@ -602,27 +551,6 @@ function LOG(string) {
}
/**
- * Gets a preference value, handling the case where there is no default.
- * @param func
- * The name of the preference function to call, on nsIPrefBranch
- * @param preference
- * The name of the preference
- * @param defaultValue
- * The default value to return in the event the preference has
- * no setting
- * @return The value of the preference, or undefined if there was no
- * user or default value.
- */
-function getPref(func, preference, defaultValue) {
- try {
- return Services.prefs[func](preference);
- }
- catch (e) {
- }
- return defaultValue;
-}
-
-/**
* Convert a string containing binary values to hex.
*/
function binaryToHex(input) {
@@ -778,120 +706,6 @@ function writeVersionFile(dir, version) {
}
/**
- * Determines if the service should be used to attempt an update
- * or not.
- *
- * @return true if the service should be used for updates.
- */
-function shouldUseService() {
- // This function will return true if the mantenance service should be used if
- // all of the following conditions are met:
- // 1) This build was done with the maintenance service enabled
- // 2) The maintenance service is installed
- // 3) The pref for using the service is enabled
- // 4) The Windows version is XP Service Pack 3 or above (for SHA-2 support)
- // The maintenance service requires SHA-2 support because we sign our binaries
- // with a SHA-2 certificate and the certificate is verified before the binary
- // is launched.
- if (!AppConstants.MOZ_MAINTENANCE_SERVICE || !isServiceInstalled() ||
- !getPref("getBoolPref", PREF_APP_UPDATE_SERVICE_ENABLED, false) ||
- !AppConstants.isPlatformAndVersionAtLeast("win", "5.1") /* WinXP */) {
- return false;
- }
-
- // If it's newer than XP, then the service pack doesn't matter.
- if (Services.sysinfo.getProperty("version") != "5.1") {
- return true;
- }
-
- // If the Windows version is XP, we also need to check the service pack.
- // We'll return false if only < SP3 is installed, or if we can't tell.
- // Check the service pack level by calling GetVersionEx via ctypes.
- const BYTE = ctypes.uint8_t;
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
- const WCHAR = ctypes.char16_t;
- const BOOL = ctypes.int;
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724833%28v=vs.85%29.aspx
- const SZCSDVERSIONLENGTH = 128;
- const OSVERSIONINFOEXW = new ctypes.StructType('OSVERSIONINFOEXW',
- [
- {dwOSVersionInfoSize: DWORD},
- {dwMajorVersion: DWORD},
- {dwMinorVersion: DWORD},
- {dwBuildNumber: DWORD},
- {dwPlatformId: DWORD},
- {szCSDVersion: ctypes.ArrayType(WCHAR, SZCSDVERSIONLENGTH)},
- {wServicePackMajor: WORD},
- {wServicePackMinor: WORD},
- {wSuiteMask: WORD},
- {wProductType: BYTE},
- {wReserved: BYTE}
- ]);
-
- let kernel32 = false;
- try {
- kernel32 = ctypes.open("Kernel32");
- } catch (e) {
- Cu.reportError("Unable to open kernel32! " + e);
- return false;
- }
-
- if (kernel32) {
- try {
- try {
- let GetVersionEx = kernel32.declare("GetVersionExW",
- ctypes.default_abi,
- BOOL,
- OSVERSIONINFOEXW.ptr);
- let winVer = OSVERSIONINFOEXW();
- winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
-
- if (0 !== GetVersionEx(winVer.address())) {
- return winVer.wServicePackMajor >= 3;
- }
- Cu.reportError("Unknown failure in GetVersionEX (returned 0)");
- return false;
- } catch (e) {
- Cu.reportError("Error getting service pack information. Exception: " + e);
- return false;
- }
- } finally {
- kernel32.close();
- }
- }
-
- // If the service pack check couldn't be done, assume we can't use the service.
- return false;
-}
-
-/**
- * Determines if the service is is installed.
- *
- * @return true if the service is installed.
- */
-function isServiceInstalled() {
- if (AppConstants.MOZ_MAINTENANCE_SERVICE && AppConstants.platform == "win") {
- let installed = 0;
- try {
- let wrk = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
- wrk.open(wrk.ROOT_KEY_LOCAL_MACHINE,
- "SOFTWARE\\Mozilla\\MaintenanceService",
- wrk.ACCESS_READ | wrk.WOW64_64);
- installed = wrk.readIntValue("Installed");
- wrk.close();
- } catch (e) {
- }
- installed = installed == 1; // convert to bool
- LOG("isServiceInstalled = " + installed);
- return installed;
- }
- return false;
-}
-
-/**
* Removes the contents of the updates patch directory and rotates the update
* logs when present. If the update.log exists in the patch directory this will
* move the last-update.log if it exists to backup-update.log in the parent
@@ -1063,16 +877,15 @@ function handleUpdateFailure(update, errorCode) {
}
if (update.errorCode == ELEVATION_CANCELED) {
- let cancelations = getPref("getIntPref", PREF_APP_UPDATE_CANCELATIONS, 0);
+ let cancelations = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS, 0);
cancelations++;
Services.prefs.setIntPref(PREF_APP_UPDATE_CANCELATIONS, cancelations);
if (AppConstants.platform == "macosx") {
- let osxCancelations = getPref("getIntPref",
- PREF_APP_UPDATE_CANCELATIONS_OSX, 0);
+ let osxCancelations = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX, 0);
osxCancelations++;
Services.prefs.setIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX,
osxCancelations);
- let maxCancels = getPref("getIntPref",
+ let maxCancels = Services.prefs.getIntPref(
PREF_APP_UPDATE_CANCELATIONS_OSX_MAX,
DEFAULT_CANCELATIONS_OSX_MAX);
// Prevent the preference from setting a value greater than 5.
@@ -1102,35 +915,6 @@ function handleUpdateFailure(update, errorCode) {
Services.prefs.clearUserPref(PREF_APP_UPDATE_CANCELATIONS_OSX);
}
- // Replace with Array.prototype.includes when it has stabilized.
- if (SERVICE_ERRORS.indexOf(update.errorCode) != -1) {
- var failCount = getPref("getIntPref",
- PREF_APP_UPDATE_SERVICE_ERRORS, 0);
- var maxFail = getPref("getIntPref",
- PREF_APP_UPDATE_SERVICE_MAXERRORS,
- DEFAULT_SERVICE_MAX_ERRORS);
- // Prevent the preference from setting a value greater than 10.
- maxFail = Math.min(maxFail, 10);
- // As a safety, when the service reaches maximum failures, it will
- // disable itself and fallback to using the normal update mechanism
- // without the service.
- if (failCount >= maxFail) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, false);
- Services.prefs.clearUserPref(PREF_APP_UPDATE_SERVICE_ERRORS);
- } else {
- failCount++;
- Services.prefs.setIntPref(PREF_APP_UPDATE_SERVICE_ERRORS,
- failCount);
- }
-
- writeStatusFile(getUpdatesDir(), update.state = STATE_PENDING);
- return true;
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_SERVICE_ERRORS)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_SERVICE_ERRORS);
- }
-
return false;
}
@@ -1189,9 +973,6 @@ function pingStateAndStatusCodes(aUpdate, aStartup, aStatus) {
case STATE_PENDING:
stateCode = 4;
break;
- case STATE_PENDING_SERVICE:
- stateCode = 5;
- break;
case STATE_APPLYING:
stateCode = 6;
break;
@@ -1201,9 +982,6 @@ function pingStateAndStatusCodes(aUpdate, aStartup, aStatus) {
case STATE_APPLIED_OS:
stateCode = 8;
break;
- case STATE_APPLIED_SERVICE:
- stateCode = 9;
- break;
case STATE_SUCCEEDED:
stateCode = 10;
break;
@@ -1377,8 +1155,8 @@ function Update(update) {
this.showNeverForVersion = false;
this.unsupported = false;
this.channel = "default";
- this.promptWaitTime = getPref("getIntPref", PREF_APP_UPDATE_PROMPTWAITTIME, 43200);
- this.backgroundInterval = getPref("getIntPref", PREF_APP_UPDATE_BACKGROUNDINTERVAL,
+ this.promptWaitTime = Services.prefs.getIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 43200);
+ this.backgroundInterval = Services.prefs.getIntPref(PREF_APP_UPDATE_BACKGROUNDINTERVAL,
DOWNLOAD_BACKGROUND_INTERVAL);
// Null <update>, assume this is a message container and do no
@@ -1758,7 +1536,7 @@ UpdateService.prototype = {
break;
case "nsPref:changed":
if (data == PREF_APP_UPDATE_LOG) {
- gLogEnabled = getPref("getBoolPref", PREF_APP_UPDATE_LOG, false);
+ gLogEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_LOG, false);
}
break;
case "profile-change-net-teardown": // fall thru
@@ -1831,8 +1609,8 @@ UpdateService.prototype = {
// version and nsUpdateDriver.cpp skipped updating due to the version being
// older than the current version.
if (update && update.appVersion &&
- (status == STATE_PENDING || status == STATE_PENDING_SERVICE ||
- status == STATE_APPLIED || status == STATE_APPLIED_SERVICE ||
+ (status == STATE_PENDING ||
+ status == STATE_APPLIED ||
status == STATE_PENDING_ELEVATE)) {
if (Services.vc.compare(update.appVersion, Services.appinfo.version) < 0 ||
Services.vc.compare(update.appVersion, Services.appinfo.version) == 0 &&
@@ -1870,9 +1648,7 @@ UpdateService.prototype = {
// that state to "applying" and we just wait and hope for the best.
// If it's "applying", we know that we've already been here once, so
// we really want to start from a clean state.
- if (update &&
- (update.state == STATE_PENDING ||
- update.state == STATE_PENDING_SERVICE)) {
+ if (update && (update.state == STATE_PENDING)) {
LOG("UpdateService:_postUpdateProcessing - patch found in applying " +
"state for the first time");
update.state = STATE_APPLYING;
@@ -1997,11 +1773,11 @@ UpdateService.prototype = {
// Send the error code to telemetry
AUSTLMY.pingCheckExError(this._pingSuffix, update.errorCode);
update.errorCode = BACKGROUNDCHECK_MULTIPLE_FAILURES;
- let errCount = getPref("getIntPref", PREF_APP_UPDATE_BACKGROUNDERRORS, 0);
+ let errCount = Services.prefs.getIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, 0);
errCount++;
Services.prefs.setIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, errCount);
// Don't allow the preference to set a value greater than 20 for max errors.
- let maxErrors = Math.min(getPref("getIntPref", PREF_APP_UPDATE_BACKGROUNDMAXERRORS, 10), 20);
+ let maxErrors = Math.min(Services.prefs.getIntPref(PREF_APP_UPDATE_BACKGROUNDMAXERRORS, 10), 20);
if (errCount >= maxErrors) {
let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
@@ -2121,27 +1897,13 @@ UpdateService.prototype = {
this._pingSuffix,
PREF_APP_UPDATE_CANCELATIONS_OSX, 0, 0);
}
- if (AppConstants.MOZ_MAINTENANCE_SERVICE) {
- // Histogram IDs:
- // UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_EXTERNAL
- // UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_NOTIFY
- AUSTLMY.pingBoolPref("UPDATE_NOT_PREF_UPDATE_SERVICE_ENABLED_" +
- this._pingSuffix,
- PREF_APP_UPDATE_SERVICE_ENABLED, true);
- // Histogram IDs:
- // UPDATE_PREF_SERVICE_ERRORS_EXTERNAL
- // UPDATE_PREF_SERVICE_ERRORS_NOTIFY
- AUSTLMY.pingIntPref("UPDATE_PREF_SERVICE_ERRORS_" + this._pingSuffix,
- PREF_APP_UPDATE_SERVICE_ERRORS, 0, 0);
- if (AppConstants.platform == "win") {
- // Histogram IDs:
- // UPDATE_SERVICE_INSTALLED_EXTERNAL
- // UPDATE_SERVICE_INSTALLED_NOTIFY
- // UPDATE_SERVICE_MANUALLY_UNINSTALLED_EXTERNAL
- // UPDATE_SERVICE_MANUALLY_UNINSTALLED_NOTIFY
- AUSTLMY.pingServiceInstallStatus(this._pingSuffix, isServiceInstalled());
- }
- }
+ let prefType = Services.prefs.getPrefType(PREF_APP_UPDATE_URL_OVERRIDE);
+ let overridePrefHasValue = prefType != Ci.nsIPrefBranch.PREF_INVALID;
+ // Histogram IDs:
+ // UPDATE_HAS_PREF_URL_OVERRIDE_EXTERNAL
+ // UPDATE_HAS_PREF_URL_OVERRIDE_NOTIFY
+ AUSTLMY.pingGeneric("UPDATE_HAS_PREF_URL_OVERRIDE_" + this._pingSuffix,
+ overridePrefHasValue, false);
// If a download is in progress or the patch has been staged do nothing.
if (this.isDownloading) {
@@ -2151,7 +1913,7 @@ UpdateService.prototype = {
if (this._downloader && this._downloader.patchIsStaged) {
let readState = readStatusFile(getUpdatesDir());
- if (readState == STATE_PENDING || readState == STATE_PENDING_SERVICE ||
+ if (readState == STATE_PENDING ||
readState == STATE_PENDING_ELEVATE) {
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_IS_DOWNLOADED);
} else {
@@ -2173,9 +1935,19 @@ UpdateService.prototype = {
} else if (!UpdateUtils.ABI) {
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_OS_ABI);
} else if (!validUpdateURL) {
- AUSTLMY.pingCheckCode(this._pingSuffix,
- AUSTLMY.CHK_INVALID_DEFAULT_URL);
- } else if (!getPref("getBoolPref", PREF_APP_UPDATE_ENABLED, true)) {
+ if (overridePrefHasValue) {
+ if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_OVERRIDE)) {
+ AUSTLMY.pingCheckCode(this._pingSuffix,
+ AUSTLMY.CHK_INVALID_USER_OVERRIDE_URL);
+ } else {
+ AUSTLMY.pingCheckCode(this._pingSuffix,
+ AUSTLMY.CHK_INVALID_DEFAULT_OVERRIDE_URL);
+ }
+ } else {
+ AUSTLMY.pingCheckCode(this._pingSuffix,
+ AUSTLMY.CHK_INVALID_DEFAULT_URL);
+ }
+ } else if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true)) {
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED);
} else if (!hasUpdateMutex()) {
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_NO_MUTEX);
@@ -2233,7 +2005,7 @@ UpdateService.prototype = {
// (see bug 350636).
let neverPrefName = PREFBRANCH_APP_UPDATE_NEVER + aUpdate.appVersion;
if (aUpdate.showNeverForVersion &&
- getPref("getBoolPref", neverPrefName, false)) {
+ Services.prefs.getBoolPref(neverPrefName, false)) {
LOG("UpdateService:selectUpdate - skipping update because the " +
"preference " + neverPrefName + " is true");
lastCheckCode = AUSTLMY.CHK_UPDATE_NEVER_PREF;
@@ -2264,9 +2036,9 @@ UpdateService.prototype = {
let update = minorUpdate || majorUpdate;
if (AppConstants.platform == "macosx" && update) {
if (getElevationRequired()) {
- let installAttemptVersion = getPref("getCharPref",
+ let installAttemptVersion = Services.prefs.getCharPref(
PREF_APP_UPDATE_ELEVATE_VERSION,
- null);
+ "");
if (vc.compare(installAttemptVersion, update.appVersion) != 0) {
Services.prefs.setCharPref(PREF_APP_UPDATE_ELEVATE_VERSION,
update.appVersion);
@@ -2278,12 +2050,9 @@ UpdateService.prototype = {
Services.prefs.clearUserPref(PREF_APP_UPDATE_ELEVATE_NEVER);
}
} else {
- let numCancels = getPref("getIntPref",
- PREF_APP_UPDATE_CANCELATIONS_OSX, 0);
- let rejectedVersion = getPref("getCharPref",
- PREF_APP_UPDATE_ELEVATE_NEVER, "");
- let maxCancels = getPref("getIntPref",
- PREF_APP_UPDATE_CANCELATIONS_OSX_MAX,
+ let numCancels = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX, 0);
+ let rejectedVersion = Services.prefs.getCharPref(PREF_APP_UPDATE_ELEVATE_NEVER, "");
+ let maxCancels = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX_MAX,
DEFAULT_CANCELATIONS_OSX_MAX);
if (numCancels >= maxCancels) {
LOG("UpdateService:selectUpdate - the user requires elevation to " +
@@ -2342,7 +2111,7 @@ UpdateService.prototype = {
return;
}
- var updateEnabled = getPref("getBoolPref", PREF_APP_UPDATE_ENABLED, true);
+ var updateEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true);
if (!updateEnabled) {
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_PREF_DISABLED);
LOG("UpdateService:_selectAndInstallUpdate - not prompting because " +
@@ -2358,7 +2127,7 @@ UpdateService.prototype = {
if (update.unsupported) {
LOG("UpdateService:_selectAndInstallUpdate - update not supported for " +
"this system");
- if (!getPref("getBoolPref", PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, false)) {
+ if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, false)) {
LOG("UpdateService:_selectAndInstallUpdate - notifying that the " +
"update is not supported for this system");
this._showPrompt(update);
@@ -2399,7 +2168,7 @@ UpdateService.prototype = {
return;
}
- if (!getPref("getBoolPref", PREF_APP_UPDATE_AUTO, true)) {
+ if (!Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO, true)) {
LOG("UpdateService:_selectAndInstallUpdate - prompting because silent " +
"install is disabled");
AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
@@ -2885,8 +2654,8 @@ UpdateManager.prototype = {
for (let i = updates.length - 1; i >= 0; --i) {
let state = updates[i].state;
if (state == STATE_NONE || state == STATE_DOWNLOADING ||
- state == STATE_APPLIED || state == STATE_APPLIED_SERVICE ||
- state == STATE_PENDING || state == STATE_PENDING_SERVICE ||
+ state == STATE_APPLIED ||
+ state == STATE_PENDING ||
state == STATE_PENDING_ELEVATE) {
updates.splice(i, 1);
}
@@ -2931,9 +2700,6 @@ UpdateManager.prototype = {
update.QueryInterface(Ci.nsIWritablePropertyBag);
update.setProperty("stagingFailed", "true");
}
- if (update.state == STATE_APPLIED && shouldUseService()) {
- writeStatusFile(getUpdatesDir(), update.state = STATE_APPLIED_SERVICE);
- }
// Send an observer notification which the update wizard uses in
// order to update its UI.
@@ -2942,16 +2708,14 @@ UpdateManager.prototype = {
Services.obs.notifyObservers(null, "update-staged", update.state);
// Only prompt when the UI isn't already open.
- let windowType = getPref("getCharPref", PREF_APP_UPDATE_ALTWINDOWTYPE, null);
+ let windowType = Services.prefs.getCharPref(PREF_APP_UPDATE_ALTWINDOWTYPE, "");
if (Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME) ||
windowType && Services.wm.getMostRecentWindow(windowType)) {
return;
}
if (update.state == STATE_APPLIED ||
- update.state == STATE_APPLIED_SERVICE ||
update.state == STATE_PENDING ||
- update.state == STATE_PENDING_SERVICE ||
update.state == STATE_PENDING_ELEVATE) {
// Notify the user that an update has been staged and is ready for
// installation (i.e. that they should restart the application).
@@ -3023,11 +2787,13 @@ Checker.prototype = {
getUpdateURL: function UC_getUpdateURL(force) {
this._forced = force;
- let url;
- try {
+ // Use the override URL if specified.
+ let url = Services.prefs.getCharPref(PREF_APP_UPDATE_URL_OVERRIDE, "");
+
+ // Otherwise, construct the update URL from component parts.
+ if (!url) {
url = Services.prefs.getDefaultBranch(null).
- getCharPref(PREF_APP_UPDATE_URL);
- } catch (e) {
+ getCharPref(PREF_APP_UPDATE_URL, "");
}
if (!url || url == "") {
@@ -3222,7 +2988,7 @@ Checker.prototype = {
*/
_enabled: true,
get enabled() {
- return getPref("getBoolPref", PREF_APP_UPDATE_ENABLED, true) &&
+ return Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED, true) &&
gCanCheckForUpdates && hasUpdateMutex() && this._enabled;
},
@@ -3309,9 +3075,9 @@ Downloader.prototype = {
// Note that if we decide to download and apply new updates after another
// update has been successfully applied in the background, we need to stop
// checking for the APPLIED state here.
- return readState == STATE_PENDING || readState == STATE_PENDING_SERVICE ||
+ return readState == STATE_PENDING ||
readState == STATE_PENDING_ELEVATE ||
- readState == STATE_APPLIED || readState == STATE_APPLIED_SERVICE;
+ readState == STATE_APPLIED;
},
/**
@@ -3428,7 +3194,7 @@ Downloader.prototype = {
return selectedPatch;
}
- if (state == STATE_PENDING || state == STATE_PENDING_SERVICE ||
+ if (state == STATE_PENDING ||
state == STATE_PENDING_ELEVATE) {
LOG("Downloader:_selectPatch - already downloaded and staged");
return null;
@@ -3708,11 +3474,11 @@ Downloader.prototype = {
var shouldRegisterOnlineObserver = false;
var shouldRetrySoon = false;
var deleteActiveUpdate = false;
- var retryTimeout = getPref("getIntPref", PREF_APP_UPDATE_SOCKET_RETRYTIMEOUT,
+ var retryTimeout = Services.prefs.getIntPref(PREF_APP_UPDATE_SOCKET_RETRYTIMEOUT,
DEFAULT_SOCKET_RETRYTIMEOUT);
// Prevent the preference from setting a value greater than 10000.
retryTimeout = Math.min(retryTimeout, 10000);
- var maxFail = getPref("getIntPref", PREF_APP_UPDATE_SOCKET_MAXERRORS,
+ var maxFail = Services.prefs.getIntPref(PREF_APP_UPDATE_SOCKET_MAXERRORS,
DEFAULT_SOCKET_MAX_ERRORS);
// Prevent the preference from setting a value greater than 20.
maxFail = Math.min(maxFail, 20);
@@ -3721,9 +3487,7 @@ Downloader.prototype = {
"max fail: " + maxFail + ", " + "retryTimeout: " + retryTimeout);
if (Components.isSuccessCode(status)) {
if (this._verifyDownload()) {
- if (shouldUseService()) {
- state = STATE_PENDING_SERVICE;
- } else if (getElevationRequired()) {
+ if (getElevationRequired()) {
state = STATE_PENDING_ELEVATE;
} else {
state = STATE_PENDING;
@@ -3873,7 +3637,7 @@ Downloader.prototype = {
return;
}
- if (state == STATE_PENDING || state == STATE_PENDING_SERVICE ||
+ if (state == STATE_PENDING ||
state == STATE_PENDING_ELEVATE) {
if (getCanStageUpdates()) {
LOG("Downloader:onStopRequest - attempting to stage update: " +
@@ -3970,7 +3734,7 @@ UpdatePrompt.prototype = {
* See nsIUpdateService.idl
*/
showUpdateAvailable: function UP_showUpdateAvailable(update) {
- if (getPref("getBoolPref", PREF_APP_UPDATE_SILENT, false) ||
+ if (Services.prefs.getBoolPref(PREF_APP_UPDATE_SILENT, false) ||
this._getUpdateWindow() || this._getAltUpdateWindow()) {
return;
}
@@ -3983,7 +3747,7 @@ UpdatePrompt.prototype = {
* See nsIUpdateService.idl
*/
showUpdateDownloaded: function UP_showUpdateDownloaded(update, background) {
- if (background && getPref("getBoolPref", PREF_APP_UPDATE_SILENT, false)) {
+ if (background && Services.prefs.getBoolPref(PREF_APP_UPDATE_SILENT, false)) {
return;
}
// Trigger the display of the hamburger menu badge.
@@ -4005,7 +3769,7 @@ UpdatePrompt.prototype = {
* See nsIUpdateService.idl
*/
showUpdateError: function UP_showUpdateError(update) {
- if (getPref("getBoolPref", PREF_APP_UPDATE_SILENT, false) ||
+ if (Services.prefs.getBoolPref(PREF_APP_UPDATE_SILENT, false) ||
this._getAltUpdateWindow())
return;
@@ -4048,7 +3812,7 @@ UpdatePrompt.prototype = {
* See nsIUpdateService.idl
*/
showUpdateElevationRequired: function UP_showUpdateElevationRequired() {
- if (getPref("getBoolPref", PREF_APP_UPDATE_SILENT, false) ||
+ if (Services.prefs.getBoolPref(PREF_APP_UPDATE_SILENT, false) ||
this._getAltUpdateWindow()) {
return;
}
@@ -4072,7 +3836,7 @@ UpdatePrompt.prototype = {
* application update user interface window.
*/
_getAltUpdateWindow: function UP__getAltUpdateWindow() {
- let windowType = getPref("getCharPref", PREF_APP_UPDATE_ALTWINDOWTYPE, null);
+ let windowType = Services.prefs.getCharPref(PREF_APP_UPDATE_ALTWINDOWTYPE, "");
if (!windowType)
return null;
return Services.wm.getMostRecentWindow(windowType);
@@ -4124,7 +3888,7 @@ UpdatePrompt.prototype = {
var idleService = Cc["@mozilla.org/widget/idleservice;1"].
getService(Ci.nsIIdleService);
// Don't allow the preference to set a value greater than 600 seconds for the idle time.
- const IDLE_TIME = Math.min(getPref("getIntPref", PREF_APP_UPDATE_IDLETIME, 60), 600);
+ const IDLE_TIME = Math.min(Services.prefs.getIntPref(PREF_APP_UPDATE_IDLETIME, 60), 600);
if (idleService.idleTime / 1000 >= IDLE_TIME) {
this._showUI(parent, uri, features, name, page, update);
return;
@@ -4169,7 +3933,7 @@ UpdatePrompt.prototype = {
getService(Ci.nsIIdleService);
// Don't allow the preference to set a value greater than 600 seconds for the idle time.
- const IDLE_TIME = Math.min(getPref("getIntPref", PREF_APP_UPDATE_IDLETIME, 60), 600);
+ const IDLE_TIME = Math.min(Services.prefs.getIntPref(PREF_APP_UPDATE_IDLETIME, 60), 600);
if (idleService.idleTime / 1000 >= IDLE_TIME) {
this._showUI(parent, uri, features, name, page, update);
} else {
diff --git a/toolkit/mozapps/update/tests/TestAUSHelper.cpp b/toolkit/mozapps/update/tests/TestAUSHelper.cpp
index f71103b7a0..a20c4a79a2 100644
--- a/toolkit/mozapps/update/tests/TestAUSHelper.cpp
+++ b/toolkit/mozapps/update/tests/TestAUSHelper.cpp
@@ -217,16 +217,8 @@ int NS_main(int argc, NS_tchar **argv)
}
if (!NS_tstrcmp(argv[1], NS_T("check-signature"))) {
-#if defined(XP_WIN) && defined(MOZ_MAINTENANCE_SERVICE)
- if (ERROR_SUCCESS == VerifyCertificateTrustForFile(argv[2])) {
- return 0;
- } else {
- return 1;
- }
-#else
- // Not implemented on non-Windows platforms
+ // Not implemented
return 1;
-#endif
}
if (!NS_tstrcmp(argv[1], NS_T("setup-symlink"))) {
diff --git a/toolkit/mozapps/update/tests/moz.build b/toolkit/mozapps/update/tests/moz.build
index 842ec7f900..94949b17f6 100644
--- a/toolkit/mozapps/update/tests/moz.build
+++ b/toolkit/mozapps/update/tests/moz.build
@@ -15,9 +15,6 @@ XPCSHELL_TESTS_MANIFESTS += [
'unit_base_updater/xpcshell.ini'
]
-if CONFIG['MOZ_MAINTENANCE_SERVICE']:
- XPCSHELL_TESTS_MANIFESTS += ['unit_service_updater/xpcshell.ini']
-
SimplePrograms([
'TestAUSHelper',
'TestAUSReadStrings',
@@ -47,9 +44,6 @@ for var in ('MOZ_APP_NAME', 'MOZ_APP_BASENAME', 'MOZ_APP_DISPLAYNAME',
DEFINES['NS_NO_XPCOM'] = True
-if CONFIG['MOZ_MAINTENANCE_SERVICE']:
- DEFINES['MOZ_MAINTENANCE_SERVICE'] = CONFIG['MOZ_MAINTENANCE_SERVICE']
-
# For debugging purposes only
#DEFINES['DISABLE_UPDATER_AUTHENTICODE_CHECK'] = True
diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp
index dbf50329c0..8025deaaf4 100644
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -119,9 +119,6 @@ struct UpdateServerThreadArgs
#endif
#ifdef XP_WIN
-#ifdef MOZ_MAINTENANCE_SERVICE
-#include "registrycertificates.h"
-#endif
BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra);
BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer,
LPCWSTR siblingFilePath,
@@ -290,7 +287,6 @@ static ArchiveReader gArchiveReader;
static bool gSucceeded = false;
static bool sStagedUpdate = false;
static bool sReplaceRequest = false;
-static bool sUsingService = false;
static bool sIsOSUpdate = false;
#ifdef XP_WIN
@@ -1954,8 +1950,7 @@ PatchIfFile::Finish(int status)
/**
* Launch the post update application (helper.exe). It takes in the path of the
- * callback application to calculate the path of helper.exe. For service updates
- * this is called from both the system account and the current user account.
+ * callback application to calculate the path of helper.exe.
*
* @param installationDir The path to the callback application binary.
* @param updateInfoDir The directory where update info is stored.
@@ -2024,13 +2019,6 @@ LaunchWinPostProcess(const WCHAR *installationDir,
return false;
}
-#if !defined(TEST_UPDATER) && defined(MOZ_MAINTENANCE_SERVICE)
- if (sUsingService &&
- !DoesBinaryMatchAllowedCertificates(installationDir, exefullpath)) {
- return false;
- }
-#endif
-
WCHAR dlogFile[MAX_PATH + 1];
if (!PathGetSiblingFilePath(dlogFile, exefullpath, L"uninstall.update")) {
return false;
@@ -2054,12 +2042,6 @@ LaunchWinPostProcess(const WCHAR *installationDir,
wcsncpy(cmdline, dummyArg, len);
wcscat(cmdline, exearg);
- if (sUsingService ||
- !_wcsnicmp(exeasync, L"false", 6) ||
- !_wcsnicmp(exeasync, L"0", 2)) {
- async = false;
- }
-
// We want to launch the post update helper app to update the Windows
// registry even if there is a failure with removing the uninstall.update
// file or copying the update.log file.
@@ -2095,8 +2077,7 @@ LaunchWinPostProcess(const WCHAR *installationDir,
static void
LaunchCallbackApp(const NS_tchar *workingDir,
int argc,
- NS_tchar **argv,
- bool usingService)
+ NS_tchar **argv)
{
putenv(const_cast<char*>("NO_EM_RESTART="));
putenv(const_cast<char*>("MOZ_LAUNCHED_CHILD=1"));
@@ -2113,11 +2094,7 @@ LaunchCallbackApp(const NS_tchar *workingDir,
#elif defined(XP_MACOSX)
LaunchChild(argc, (const char**)argv);
#elif defined(XP_WIN)
- // Do not allow the callback to run when running an update through the
- // service as session 0. The unelevated updater.exe will do the launching.
- if (!usingService) {
- WinLaunchChild(argv[0], argc, argv, nullptr);
- }
+ WinLaunchChild(argv[0], argc, argv, nullptr);
#else
# warning "Need implementaton of LaunchCallbackApp"
#endif
@@ -2188,40 +2165,6 @@ WriteStatusFile(int status)
WriteStatusFile(text);
}
-#ifdef MOZ_MAINTENANCE_SERVICE
-/*
- * Read the update.status file and sets isPendingService to true if
- * the status is set to pending-service.
- *
- * @param isPendingService Out parameter for specifying if the status
- * is set to pending-service or not.
- * @return true if the information was retrieved and it is pending
- * or pending-service.
-*/
-static bool
-IsUpdateStatusPendingService()
-{
- NS_tchar filename[MAXPATHLEN];
- NS_tsnprintf(filename, sizeof(filename)/sizeof(filename[0]),
- NS_T("%s/update.status"), gPatchDirPath);
-
- AutoFile file(NS_tfopen(filename, NS_T("rb")));
- if (file == nullptr)
- return false;
-
- char buf[32] = { 0 };
- fread(buf, sizeof(buf), 1, file);
-
- const char kPendingService[] = "pending-service";
- const char kAppliedService[] = "applied-service";
-
- return (strncmp(buf, kPendingService,
- sizeof(kPendingService) - 1) == 0) ||
- (strncmp(buf, kAppliedService,
- sizeof(kAppliedService) - 1) == 0);
-}
-#endif
-
#ifdef XP_WIN
/*
* Read the update.status file and sets isSuccess to true if
@@ -2601,7 +2544,7 @@ UpdateThreadFunc(void *param)
// updater application again in order to apply the update without
// staging.
if (sReplaceRequest) {
- WriteStatusFile(sUsingService ? "pending-service" : "pending");
+ WriteStatusFile("pending");
} else {
WriteStatusFile(rv);
}
@@ -2668,17 +2611,6 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv,
if (!LaunchWinPostProcess(gInstallDirPath, gPatchDirPath)) {
fprintf(stderr, "The post update process was not launched");
}
-
- // The service update will only be executed if it is already installed.
- // For first time installs of the service, the install will happen from
- // the PostUpdate process. We do the service update process here
- // because it's possible we are updating with updater.exe without the
- // service if the service failed to apply the update. We want to update
- // the service to a newer version in that case. If we are not running
- // through the service, then MOZ_USING_SERVICE will not exist.
- if (!sUsingService) {
- StartServiceUpdate(gInstallDirPath);
- }
}
EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 0);
#elif XP_MACOSX
@@ -2690,8 +2622,7 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv,
LaunchCallbackApp(argv[5],
argc - callbackIndex,
- argv + callbackIndex,
- sUsingService);
+ argv + callbackIndex);
#ifdef XP_MACOSX
} // if (!isElevated)
#endif /* XP_MACOSX */
@@ -2765,8 +2696,6 @@ int NS_main(int argc, NS_tchar **argv)
return 1;
}
- // This check is also performed in workmonitor.cpp since the maintenance
- // service can be called directly.
if (!IsValidFullPath(argv[1])) {
// Since the status file is written to the patch directory and the patch
// directory is invalid don't write the status file.
@@ -2783,8 +2712,6 @@ int NS_main(int argc, NS_tchar **argv)
// The directory containing the update information.
NS_tstrncpy(gPatchDirPath, argv[1], MAXPATHLEN);
- // This check is also performed in workmonitor.cpp since the maintenance
- // service can be called directly.
if (!IsValidFullPath(argv[2])) {
WriteStatusFile(INVALID_INSTALL_DIR_PATH_ERROR);
fprintf(stderr, "The install directory path is not valid for this " \
@@ -2809,23 +2736,7 @@ int NS_main(int argc, NS_tchar **argv)
}
#ifdef XP_WIN
- bool useService = false;
bool testOnlyFallbackKeyExists = false;
- bool noServiceFallback = false;
-
- // We never want the service to be used unless we build with
- // the maintenance service.
-#ifdef MOZ_MAINTENANCE_SERVICE
- useService = IsUpdateStatusPendingService();
-#ifdef TEST_UPDATER
- noServiceFallback = EnvHasValue("MOZ_NO_SERVICE_FALLBACK");
- putenv(const_cast<char*>("MOZ_NO_SERVICE_FALLBACK="));
- // Our tests run with a different apply directory for each test.
- // We use this registry key on our test slaves to store the
- // allowed name/issuers.
- testOnlyFallbackKeyExists = DoesFallbackKeyExist();
-#endif
-#endif
// Remove everything except close window from the context menu
{
@@ -2869,8 +2780,6 @@ int NS_main(int argc, NS_tchar **argv)
}
}
- // This check is also performed in workmonitor.cpp since the maintenance
- // service can be called directly.
if (!IsValidFullPath(argv[3])) {
WriteStatusFile(INVALID_WORKING_DIR_PATH_ERROR);
fprintf(stderr, "The working directory path is not valid for this " \
@@ -2894,8 +2803,6 @@ int NS_main(int argc, NS_tchar **argv)
*slash = NS_T('\0');
}
- // These checks are also performed in workmonitor.cpp since the maintenance
- // service can be called directly.
if (argc > callbackIndex) {
if (!IsValidFullPath(argv[callbackIndex])) {
WriteStatusFile(INVALID_CALLBACK_PATH_ERROR);
@@ -2977,8 +2884,6 @@ int NS_main(int argc, NS_tchar **argv)
LOG(("WORKING DIRECTORY " LOG_S, gWorkingDirPath));
#if defined(XP_WIN)
- // These checks are also performed in workmonitor.cpp since the maintenance
- // service can be called directly.
if (_wcsnicmp(gWorkingDirPath, gInstallDirPath, MAX_PATH) != 0) {
if (!sStagedUpdate && !sReplaceRequest) {
WriteStatusFile(INVALID_APPLYTO_DIR_ERROR);
@@ -3030,23 +2935,11 @@ int NS_main(int argc, NS_tchar **argv)
#endif
#ifdef XP_WIN
-#ifdef MOZ_MAINTENANCE_SERVICE
- sUsingService = EnvHasValue("MOZ_USING_SERVICE");
- putenv(const_cast<char*>("MOZ_USING_SERVICE="));
-#endif
- // lastFallbackError keeps track of the last error for the service not being
- // used, in case of an error when fallback is not enabled we write the
- // error to the update.status file.
- // When fallback is disabled (MOZ_NO_SERVICE_FALLBACK does not exist) then
- // we will instead fallback to not using the service and display a UAC prompt.
- int lastFallbackError = FALLBACKKEY_UNKNOWN_ERROR;
-
// Launch a second instance of the updater with the runas verb on Windows
// when write access is denied to the installation directory.
HANDLE updateLockFileHandle = INVALID_HANDLE_VALUE;
NS_tchar elevatedLockFilePath[MAXPATHLEN] = {NS_T('\0')};
- if (!sUsingService &&
- (argc > callbackIndex || sStagedUpdate || sReplaceRequest)) {
+ if (argc > callbackIndex || sStagedUpdate || sReplaceRequest) {
NS_tchar updateLockFilePath[MAXPATHLEN];
if (sStagedUpdate) {
// When staging an update, the lock file is:
@@ -3104,8 +2997,7 @@ int NS_main(int argc, NS_tchar **argv)
bool startedFromUnelevatedUpdater =
GetFileAttributesW(elevatedLockFilePath) != INVALID_FILE_ATTRIBUTES;
- // If we're running from the service, then we were started with the same
- // token as the service so the permissions are already dropped. If we're
+ // If we're
// running from an elevated updater that was started from an unelevated
// updater, then we drop the permissions here. We do not drop the
// permissions on the originally called updater because we use its token
@@ -3116,8 +3008,7 @@ int NS_main(int argc, NS_tchar **argv)
UACHelper::DisablePrivileges(nullptr);
}
- if (updateLockFileHandle == INVALID_HANDLE_VALUE ||
- (useService && testOnlyFallbackKeyExists && noServiceFallback)) {
+ if (updateLockFileHandle == INVALID_HANDLE_VALUE) {
if (!_waccess(elevatedLockFilePath, F_OK) &&
NS_tremove(elevatedLockFilePath) != 0) {
fprintf(stderr, "Unable to create elevated lock file! Exiting\n");
@@ -3144,105 +3035,11 @@ int NS_main(int argc, NS_tchar **argv)
return 1;
}
- // Make sure the path to the updater to use for the update is on local.
- // We do this check to make sure that file locking is available for
- // race condition security checks.
- if (useService) {
- BOOL isLocal = FALSE;
- useService = IsLocalFile(argv[0], isLocal) && isLocal;
- }
-
- // If we have unprompted elevation we should NOT use the service
- // for the update. Service updates happen with the SYSTEM account
- // which has more privs than we need to update with.
- // Windows 8 provides a user interface so users can configure this
- // behavior and it can be configured in the registry in all Windows
- // versions that support UAC.
- if (useService) {
- BOOL unpromptedElevation;
- if (IsUnpromptedElevation(unpromptedElevation)) {
- useService = !unpromptedElevation;
- }
- }
-
- // Make sure the service registry entries for the instsallation path
- // are available. If not don't use the service.
- if (useService) {
- WCHAR maintenanceServiceKey[MAX_PATH + 1];
- if (CalculateRegistryPathFromFilePath(gInstallDirPath,
- maintenanceServiceKey)) {
- HKEY baseKey = nullptr;
- if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
- maintenanceServiceKey, 0,
- KEY_READ | KEY_WOW64_64KEY,
- &baseKey) == ERROR_SUCCESS) {
- RegCloseKey(baseKey);
- } else {
-#ifdef TEST_UPDATER
- useService = testOnlyFallbackKeyExists;
-#endif
- if (!useService) {
- lastFallbackError = FALLBACKKEY_NOKEY_ERROR;
- }
- }
- } else {
- useService = false;
- lastFallbackError = FALLBACKKEY_REGPATH_ERROR;
- }
- }
-
- // Originally we used to write "pending" to update.status before
- // launching the service command. This is no longer needed now
- // since the service command is launched from updater.exe. If anything
- // fails in between, we can fall back to using the normal update process
- // on our own.
-
- // If we still want to use the service try to launch the service
- // comamnd for the update.
- if (useService) {
- // If the update couldn't be started, then set useService to false so
- // we do the update the old way.
- DWORD ret = LaunchServiceSoftwareUpdateCommand(argc, (LPCWSTR *)argv);
- useService = (ret == ERROR_SUCCESS);
- // If the command was launched then wait for the service to be done.
- if (useService) {
- bool showProgressUI = false;
- // Never show the progress UI when staging updates.
- if (!sStagedUpdate) {
- // We need to call this separately instead of allowing ShowProgressUI
- // to initialize the strings because the service will move the
- // ini file out of the way when running updater.
- showProgressUI = !InitProgressUIStrings();
- }
-
- // Wait for the service to stop for 5 seconds. If the service
- // has still not stopped then show an indeterminate progress bar.
- DWORD lastState = WaitForServiceStop(SVC_NAME, 5);
- if (lastState != SERVICE_STOPPED) {
- Thread t1;
- if (t1.Run(WaitForServiceFinishThread, nullptr) == 0 &&
- showProgressUI) {
- ShowProgressUI(true, false);
- }
- t1.Join();
- }
-
- lastState = WaitForServiceStop(SVC_NAME, 1);
- if (lastState != SERVICE_STOPPED) {
- // If the service doesn't stop after 10 minutes there is
- // something seriously wrong.
- lastFallbackError = FALLBACKKEY_SERVICE_NO_STOP_ERROR;
- useService = false;
- }
- } else {
- lastFallbackError = FALLBACKKEY_LAUNCH_ERROR;
- }
- }
- // If the service can't be used when staging an update, make sure that
+ // When staging an update, make sure that
// the UAC prompt is not shown! In this case, just set the status to
// pending and the update will be applied during the next startup.
- if (!useService && sStagedUpdate) {
+ if (sStagedUpdate) {
if (updateLockFileHandle != INVALID_HANDLE_VALUE) {
CloseHandle(updateLockFileHandle);
}
@@ -3250,32 +3047,10 @@ int NS_main(int argc, NS_tchar **argv)
return 0;
}
- // If we started the service command, and it finished, check the
- // update.status file to make sure it succeeded, and if it did
- // we need to manually start the PostUpdate process from the
- // current user's session of this unelevated updater.exe the
- // current process is running as.
- // Note that we don't need to do this if we're just staging the update,
- // as the PostUpdate step runs when performing the replacing in that case.
- if (useService && !sStagedUpdate) {
- bool updateStatusSucceeded = false;
- if (IsUpdateStatusSucceeded(updateStatusSucceeded) &&
- updateStatusSucceeded) {
- if (!LaunchWinPostProcess(gInstallDirPath, gPatchDirPath)) {
- fprintf(stderr, "The post update process which runs as the user"
- " for service update could not be launched.");
- }
- }
- }
-
- // If we didn't want to use the service at all, or if an update was
- // already happening, or launching the service command failed, then
- // launch the elevated updater.exe as we do without the service.
+ // If an update was already happening, launch the elevated updater.exe.
// We don't launch the elevated updater in the case that we did have
- // write access all along because in that case the only reason we're
- // using the service is because we are testing.
- if (!useService && !noServiceFallback &&
- updateLockFileHandle == INVALID_HANDLE_VALUE) {
+ // write access all along because in that case we are testing.
+ if (updateLockFileHandle == INVALID_HANDLE_VALUE) {
SHELLEXECUTEINFO sinfo;
memset(&sinfo, 0, sizeof(SHELLEXECUTEINFO));
sinfo.cbSize = sizeof(SHELLEXECUTEINFO);
@@ -3301,32 +3076,21 @@ int NS_main(int argc, NS_tchar **argv)
if (argc > callbackIndex) {
LaunchCallbackApp(argv[5], argc - callbackIndex,
- argv + callbackIndex, sUsingService);
+ argv + callbackIndex);
}
CloseHandle(elevatedFileHandle);
- if (!useService && !noServiceFallback &&
- INVALID_HANDLE_VALUE == updateLockFileHandle) {
- // We didn't use the service and we did run the elevated updater.exe.
+ if (INVALID_HANDLE_VALUE == updateLockFileHandle) {
+ // We ran the elevated updater.exe.
// The elevated updater.exe is responsible for writing out the
// update.status file.
return 0;
- } else if (useService) {
- // The service command was launched. The service is responsible for
- // writing out the update.status file.
- if (updateLockFileHandle != INVALID_HANDLE_VALUE) {
- CloseHandle(updateLockFileHandle);
- }
- return 0;
} else {
- // Otherwise the service command was not launched at all.
// We are only reaching this code path because we had write access
// all along to the directory and a fallback key existed, and we
- // have fallback disabled (MOZ_NO_SERVICE_FALLBACK env var exists).
- // We only currently use this env var from XPCShell tests.
+ // have fallback disabled.
CloseHandle(updateLockFileHandle);
- WriteStatusFile(lastFallbackError);
return 0;
}
}
@@ -3386,7 +3150,7 @@ int NS_main(int argc, NS_tchar **argv)
EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 1);
if (argc > callbackIndex) {
LaunchCallbackApp(argv[5], argc - callbackIndex,
- argv + callbackIndex, sUsingService);
+ argv + callbackIndex);
}
return 1;
}
@@ -3440,8 +3204,7 @@ int NS_main(int argc, NS_tchar **argv)
if (argc > callbackIndex) {
LaunchCallbackApp(argv[5],
argc - callbackIndex,
- argv + callbackIndex,
- sUsingService);
+ argv + callbackIndex);
}
return 1;
}
@@ -3504,8 +3267,7 @@ int NS_main(int argc, NS_tchar **argv)
EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 1);
LaunchCallbackApp(argv[callbackIndex],
argc - callbackIndex,
- argv + callbackIndex,
- sUsingService);
+ argv + callbackIndex);
return 1;
}
@@ -3553,8 +3315,7 @@ int NS_main(int argc, NS_tchar **argv)
EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 1);
LaunchCallbackApp(argv[5],
argc - callbackIndex,
- argv + callbackIndex,
- sUsingService);
+ argv + callbackIndex);
return 1;
}
LOG(("NS_main: callback app file in use, continuing without " \
@@ -3887,88 +3648,6 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
return rv;
}
-#elif defined(SOLARIS)
-int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
-{
- int rv = OK;
- NS_tchar foundpath[MAXPATHLEN];
- struct {
- dirent dent_buffer;
- char chars[MAXNAMLEN];
- } ent_buf;
- struct dirent* ent;
- mozilla::UniquePtr<NS_tchar[]> searchpath(get_full_path(dirpath));
-
- DIR* dir = opendir(searchpath.get());
- if (!dir) {
- LOG(("add_dir_entries error on opendir: " LOG_S ", err: %d", searchpath.get(),
- errno));
- return UNEXPECTED_FILE_OPERATION_ERROR;
- }
-
- while (readdir_r(dir, (dirent *)&ent_buf, &ent) == 0 && ent) {
- if ((strcmp(ent->d_name, ".") == 0) ||
- (strcmp(ent->d_name, "..") == 0))
- continue;
-
- NS_tsnprintf(foundpath, sizeof(foundpath)/sizeof(foundpath[0]),
- NS_T("%s%s"), searchpath.get(), ent->d_name);
- struct stat64 st_buf;
- int test = stat64(foundpath, &st_buf);
- if (test) {
- closedir(dir);
- return UNEXPECTED_FILE_OPERATION_ERROR;
- }
- if (S_ISDIR(st_buf.st_mode)) {
- NS_tsnprintf(foundpath, sizeof(foundpath)/sizeof(foundpath[0]),
- NS_T("%s/"), foundpath);
- // Recurse into the directory.
- rv = add_dir_entries(foundpath, list);
- if (rv) {
- LOG(("add_dir_entries error: " LOG_S ", err: %d", foundpath, rv));
- closedir(dir);
- return rv;
- }
- } else {
- // Add the file to be removed to the ActionList.
- NS_tchar *quotedpath = get_quoted_path(get_relative_path(foundpath));
- if (!quotedpath) {
- closedir(dir);
- return PARSE_ERROR;
- }
-
- Action *action = new RemoveFile();
- rv = action->Parse(quotedpath);
- if (rv) {
- LOG(("add_dir_entries Parse error on recurse: " LOG_S ", err: %d",
- quotedpath, rv));
- closedir(dir);
- return rv;
- }
-
- list->Append(action);
- }
- }
- closedir(dir);
-
- // Add the directory to be removed to the ActionList.
- NS_tchar *quotedpath = get_quoted_path(get_relative_path(dirpath));
- if (!quotedpath)
- return PARSE_ERROR;
-
- Action *action = new RemoveDir();
- rv = action->Parse(quotedpath);
- if (rv) {
- LOG(("add_dir_entries Parse error on close: " LOG_S ", err: %d",
- quotedpath, rv));
- }
- else {
- list->Append(action);
- }
-
- return rv;
-}
-
#else
int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
diff --git a/toolkit/mozapps/webextensions/AddonContentPolicy.cpp b/toolkit/mozapps/webextensions/AddonContentPolicy.cpp
deleted file mode 100644
index 90e53b2ea8..0000000000
--- a/toolkit/mozapps/webextensions/AddonContentPolicy.cpp
+++ /dev/null
@@ -1,478 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AddonContentPolicy.h"
-
-#include "mozilla/dom/nsCSPUtils.h"
-#include "nsCOMPtr.h"
-#include "nsContentPolicyUtils.h"
-#include "nsContentTypeParser.h"
-#include "nsContentUtils.h"
-#include "nsIConsoleService.h"
-#include "nsIContentSecurityPolicy.h"
-#include "nsIContent.h"
-#include "nsIDocument.h"
-#include "nsIEffectiveTLDService.h"
-#include "nsIScriptError.h"
-#include "nsIStringBundle.h"
-#include "nsIUUIDGenerator.h"
-#include "nsIURI.h"
-#include "nsNetCID.h"
-#include "nsNetUtil.h"
-
-using namespace mozilla;
-
-/* Enforces content policies for WebExtension scopes. Currently:
- *
- * - Prevents loading scripts with a non-default JavaScript version.
- * - Checks custom content security policies for sufficiently stringent
- * script-src and object-src directives.
- */
-
-#define VERSIONED_JS_BLOCKED_MESSAGE \
- u"Versioned JavaScript is a non-standard, deprecated extension, and is " \
- u"not supported in WebExtension code. For alternatives, please see: " \
- u"https://developer.mozilla.org/Add-ons/WebExtensions/Tips"
-
-AddonContentPolicy::AddonContentPolicy()
-{
-}
-
-AddonContentPolicy::~AddonContentPolicy()
-{
-}
-
-NS_IMPL_ISUPPORTS(AddonContentPolicy, nsIContentPolicy, nsIAddonContentPolicy)
-
-static nsresult
-GetWindowIDFromContext(nsISupports* aContext, uint64_t *aResult)
-{
- NS_ENSURE_TRUE(aContext, NS_ERROR_FAILURE);
-
- nsCOMPtr<nsIContent> content = do_QueryInterface(aContext);
- NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);
-
- nsCOMPtr<nsIDocument> document = content->OwnerDoc();
- NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);
-
- nsCOMPtr<nsPIDOMWindowInner> window = document->GetInnerWindow();
- NS_ENSURE_TRUE(window, NS_ERROR_FAILURE);
-
- *aResult = window->WindowID();
- return NS_OK;
-}
-
-static nsresult
-LogMessage(const nsAString &aMessage, nsIURI* aSourceURI, const nsAString &aSourceSample,
- nsISupports* aContext)
-{
- nsCOMPtr<nsIScriptError> error = do_CreateInstance(NS_SCRIPTERROR_CONTRACTID);
- NS_ENSURE_TRUE(error, NS_ERROR_OUT_OF_MEMORY);
-
- nsCString sourceName = aSourceURI->GetSpecOrDefault();
-
- uint64_t windowID = 0;
- GetWindowIDFromContext(aContext, &windowID);
-
- nsresult rv =
- error->InitWithWindowID(aMessage, NS_ConvertUTF8toUTF16(sourceName),
- aSourceSample, 0, 0, nsIScriptError::errorFlag,
- "JavaScript", windowID);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIConsoleService> console = do_GetService(NS_CONSOLESERVICE_CONTRACTID);
- NS_ENSURE_TRUE(console, NS_ERROR_OUT_OF_MEMORY);
-
- console->LogMessage(error);
- return NS_OK;
-}
-
-
-// Content policy enforcement:
-
-NS_IMETHODIMP
-AddonContentPolicy::ShouldLoad(uint32_t aContentType,
- nsIURI* aContentLocation,
- nsIURI* aRequestOrigin,
- nsISupports* aContext,
- const nsACString& aMimeTypeGuess,
- nsISupports* aExtra,
- nsIPrincipal* aRequestPrincipal,
- int16_t* aShouldLoad)
-{
- MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
- "We should only see external content policy types here.");
-
- *aShouldLoad = nsIContentPolicy::ACCEPT;
-
- if (!aRequestOrigin) {
- return NS_OK;
- }
-
- // Only apply this policy to requests from documents loaded from
- // moz-extension URLs, or to resources being loaded from moz-extension URLs.
- bool equals;
- if (!((NS_SUCCEEDED(aContentLocation->SchemeIs("moz-extension", &equals)) && equals) ||
- (NS_SUCCEEDED(aRequestOrigin->SchemeIs("moz-extension", &equals)) && equals))) {
- return NS_OK;
- }
-
- if (aContentType == nsIContentPolicy::TYPE_SCRIPT) {
- NS_ConvertUTF8toUTF16 typeString(aMimeTypeGuess);
- nsContentTypeParser mimeParser(typeString);
-
- // Reject attempts to load JavaScript scripts with a non-default version.
- nsAutoString mimeType, version;
- if (NS_SUCCEEDED(mimeParser.GetType(mimeType)) &&
- nsContentUtils::IsJavascriptMIMEType(mimeType) &&
- NS_SUCCEEDED(mimeParser.GetParameter("version", version))) {
- *aShouldLoad = nsIContentPolicy::REJECT_REQUEST;
-
- LogMessage(NS_MULTILINE_LITERAL_STRING(VERSIONED_JS_BLOCKED_MESSAGE),
- aRequestOrigin, typeString, aContext);
- return NS_OK;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-AddonContentPolicy::ShouldProcess(uint32_t aContentType,
- nsIURI* aContentLocation,
- nsIURI* aRequestOrigin,
- nsISupports* aRequestingContext,
- const nsACString& aMimeTypeGuess,
- nsISupports* aExtra,
- nsIPrincipal* aRequestPrincipal,
- int16_t* aShouldProcess)
-{
- MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
- "We should only see external content policy types here.");
-
- *aShouldProcess = nsIContentPolicy::ACCEPT;
- return NS_OK;
-}
-
-
-// CSP Validation:
-
-static const char* allowedSchemes[] = {
- "blob",
- "filesystem",
- nullptr
-};
-
-static const char* allowedHostSchemes[] = {
- "https",
- "moz-extension",
- nullptr
-};
-
-/**
- * Validates a CSP directive to ensure that it is sufficiently stringent.
- * In particular, ensures that:
- *
- * - No remote sources are allowed other than from https: schemes
- *
- * - No remote sources specify host wildcards for generic domains
- * (*.blogspot.com, *.com, *)
- *
- * - All remote sources and local extension sources specify a host
- *
- * - No scheme sources are allowed other than blob:, filesystem:,
- * moz-extension:, and https:
- *
- * - No keyword sources are allowed other than 'none', 'self', 'unsafe-eval',
- * and hash sources.
- */
-class CSPValidator final : public nsCSPSrcVisitor {
- public:
- CSPValidator(nsAString& aURL, CSPDirective aDirective, bool aDirectiveRequired = true) :
- mURL(aURL),
- mDirective(CSP_CSPDirectiveToString(aDirective)),
- mFoundSelf(false)
- {
- // Start with the default error message for a missing directive, since no
- // visitors will be called if the directive isn't present.
- if (aDirectiveRequired) {
- FormatError("csp.error.missing-directive");
- }
- }
-
- // Visitors
-
- bool visitSchemeSrc(const nsCSPSchemeSrc& src) override
- {
- nsAutoString scheme;
- src.getScheme(scheme);
-
- if (SchemeInList(scheme, allowedHostSchemes)) {
- FormatError("csp.error.missing-host", scheme);
- return false;
- }
- if (!SchemeInList(scheme, allowedSchemes)) {
- FormatError("csp.error.illegal-protocol", scheme);
- return false;
- }
- return true;
- };
-
- bool visitHostSrc(const nsCSPHostSrc& src) override
- {
- nsAutoString scheme, host;
-
- src.getScheme(scheme);
- src.getHost(host);
-
- if (scheme.LowerCaseEqualsLiteral("https")) {
- if (!HostIsAllowed(host)) {
- FormatError("csp.error.illegal-host-wildcard", scheme);
- return false;
- }
- } else if (scheme.LowerCaseEqualsLiteral("moz-extension")) {
- // The CSP parser silently converts 'self' keywords to the origin
- // URL, so we need to reconstruct the URL to see if it was present.
- if (!mFoundSelf) {
- nsAutoString url(u"moz-extension://");
- url.Append(host);
-
- mFoundSelf = url.Equals(mURL);
- }
-
- if (host.IsEmpty() || host.EqualsLiteral("*")) {
- FormatError("csp.error.missing-host", scheme);
- return false;
- }
- } else if (!SchemeInList(scheme, allowedSchemes)) {
- FormatError("csp.error.illegal-protocol", scheme);
- return false;
- }
-
- return true;
- };
-
- bool visitKeywordSrc(const nsCSPKeywordSrc& src) override
- {
- switch (src.getKeyword()) {
- case CSP_NONE:
- case CSP_SELF:
- case CSP_UNSAFE_EVAL:
- return true;
-
- default:
- NS_ConvertASCIItoUTF16 keyword(CSP_EnumToKeyword(src.getKeyword()));
-
- FormatError("csp.error.illegal-keyword", keyword);
- return false;
- }
- };
-
- bool visitNonceSrc(const nsCSPNonceSrc& src) override
- {
- FormatError("csp.error.illegal-keyword", NS_LITERAL_STRING("'nonce-*'"));
- return false;
- };
-
- bool visitHashSrc(const nsCSPHashSrc& src) override
- {
- return true;
- };
-
- // Accessors
-
- inline nsAString& GetError()
- {
- return mError;
- };
-
- inline bool FoundSelf()
- {
- return mFoundSelf;
- };
-
-
- // Formatters
-
- template <typename... T>
- inline void FormatError(const char* aName, const T ...aParams)
- {
- const char16_t* params[] = { mDirective.get(), aParams.get()... };
- FormatErrorParams(aName, params, MOZ_ARRAY_LENGTH(params));
- };
-
- private:
- // Validators
-
- bool HostIsAllowed(nsAString& host)
- {
- if (host.First() == '*') {
- if (host.EqualsLiteral("*") || host[1] != '.') {
- return false;
- }
-
- host.Cut(0, 2);
-
- nsCOMPtr<nsIEffectiveTLDService> tldService =
- do_GetService(NS_EFFECTIVETLDSERVICE_CONTRACTID);
-
- if (!tldService) {
- return false;
- }
-
- NS_ConvertUTF16toUTF8 cHost(host);
- nsAutoCString publicSuffix;
-
- nsresult rv = tldService->GetPublicSuffixFromHost(cHost, publicSuffix);
-
- return NS_SUCCEEDED(rv) && !cHost.Equals(publicSuffix);
- }
-
- return true;
- };
-
- bool SchemeInList(nsAString& scheme, const char** schemes)
- {
- for (; *schemes; schemes++) {
- if (scheme.LowerCaseEqualsASCII(*schemes)) {
- return true;
- }
- }
- return false;
- };
-
-
- // Formatters
-
- already_AddRefed<nsIStringBundle>
- GetStringBundle()
- {
- nsCOMPtr<nsIStringBundleService> sbs =
- mozilla::services::GetStringBundleService();
- NS_ENSURE_TRUE(sbs, nullptr);
-
- nsCOMPtr<nsIStringBundle> stringBundle;
- sbs->CreateBundle("chrome://global/locale/extensions.properties",
- getter_AddRefs(stringBundle));
-
- return stringBundle.forget();
- };
-
- void FormatErrorParams(const char* aName, const char16_t** aParams, int32_t aLength)
- {
- nsresult rv = NS_ERROR_FAILURE;
-
- nsCOMPtr<nsIStringBundle> stringBundle = GetStringBundle();
-
- if (stringBundle) {
- NS_ConvertASCIItoUTF16 name(aName);
-
- rv = stringBundle->FormatStringFromName(name.get(), aParams, aLength,
- getter_Copies(mError));
- }
-
- if (NS_WARN_IF(NS_FAILED(rv))) {
- mError.AssignLiteral("An unexpected error occurred");
- }
- };
-
-
- // Data members
-
- nsAutoString mURL;
- NS_ConvertASCIItoUTF16 mDirective;
- nsXPIDLString mError;
-
- bool mFoundSelf;
-};
-
-/**
- * Validates a custom content security policy string for use by an add-on.
- * In particular, ensures that:
- *
- * - Both object-src and script-src directives are present, and meet
- * the policies required by the CSPValidator class
- *
- * - The script-src directive includes the source 'self'
- */
-NS_IMETHODIMP
-AddonContentPolicy::ValidateAddonCSP(const nsAString& aPolicyString,
- nsAString& aResult)
-{
- nsresult rv;
-
- // Validate against a randomly-generated extension origin.
- // There is no add-on-specific behavior in the CSP code, beyond the ability
- // for add-ons to specify a custom policy, but the parser requires a valid
- // origin in order to operate correctly.
- nsAutoString url(u"moz-extension://");
- {
- nsCOMPtr<nsIUUIDGenerator> uuidgen = services::GetUUIDGenerator();
- NS_ENSURE_TRUE(uuidgen, NS_ERROR_FAILURE);
-
- nsID id;
- rv = uuidgen->GenerateUUIDInPlace(&id);
- NS_ENSURE_SUCCESS(rv, rv);
-
- char idString[NSID_LENGTH];
- id.ToProvidedString(idString);
-
- MOZ_RELEASE_ASSERT(idString[0] == '{' && idString[NSID_LENGTH - 2] == '}',
- "UUID generator did not return a valid UUID");
-
- url.AppendASCII(idString + 1, NSID_LENGTH - 3);
- }
-
-
- RefPtr<BasePrincipal> principal =
- BasePrincipal::CreateCodebasePrincipal(NS_ConvertUTF16toUTF8(url));
-
- nsCOMPtr<nsIContentSecurityPolicy> csp;
- rv = principal->EnsureCSP(nullptr, getter_AddRefs(csp));
- NS_ENSURE_SUCCESS(rv, rv);
-
-
- csp->AppendPolicy(aPolicyString, false, false);
-
- const nsCSPPolicy* policy = csp->GetPolicy(0);
- if (!policy) {
- CSPValidator validator(url, nsIContentSecurityPolicy::SCRIPT_SRC_DIRECTIVE);
- aResult.Assign(validator.GetError());
- return NS_OK;
- }
-
- bool haveValidDefaultSrc = false;
- {
- CSPDirective directive = nsIContentSecurityPolicy::DEFAULT_SRC_DIRECTIVE;
- CSPValidator validator(url, directive);
-
- haveValidDefaultSrc = policy->visitDirectiveSrcs(directive, &validator);
- }
-
- aResult.SetIsVoid(true);
- {
- CSPDirective directive = nsIContentSecurityPolicy::SCRIPT_SRC_DIRECTIVE;
- CSPValidator validator(url, directive, !haveValidDefaultSrc);
-
- if (!policy->visitDirectiveSrcs(directive, &validator)) {
- aResult.Assign(validator.GetError());
- } else if (!validator.FoundSelf()) {
- validator.FormatError("csp.error.missing-source", NS_LITERAL_STRING("'self'"));
- aResult.Assign(validator.GetError());
- }
- }
-
- if (aResult.IsVoid()) {
- CSPDirective directive = nsIContentSecurityPolicy::OBJECT_SRC_DIRECTIVE;
- CSPValidator validator(url, directive, !haveValidDefaultSrc);
-
- if (!policy->visitDirectiveSrcs(directive, &validator)) {
- aResult.Assign(validator.GetError());
- }
- }
-
- return NS_OK;
-}
diff --git a/toolkit/mozapps/webextensions/AddonContentPolicy.h b/toolkit/mozapps/webextensions/AddonContentPolicy.h
deleted file mode 100644
index 4c8af4828d..0000000000
--- a/toolkit/mozapps/webextensions/AddonContentPolicy.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIContentPolicy.h"
-#include "nsIAddonPolicyService.h"
-
-class AddonContentPolicy : public nsIContentPolicy,
- public nsIAddonContentPolicy
-{
-protected:
- virtual ~AddonContentPolicy();
-
-public:
- AddonContentPolicy();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSICONTENTPOLICY
- NS_DECL_NSIADDONCONTENTPOLICY
-};
diff --git a/toolkit/mozapps/webextensions/AddonManager.jsm b/toolkit/mozapps/webextensions/AddonManager.jsm
deleted file mode 100644
index a3bcbb504e..0000000000
--- a/toolkit/mozapps/webextensions/AddonManager.jsm
+++ /dev/null
@@ -1,3666 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-const Cu = Components.utils;
-
-// Cannot use Services.appinfo here, or else xpcshell-tests will blow up, as
-// most tests later register different nsIAppInfo implementations, which
-// wouldn't be reflected in Services.appinfo anymore, as the lazy getter
-// underlying it would have been initialized if we used it here.
-if ("@mozilla.org/xre/app-info;1" in Cc) {
- let runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
- if (runtime.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
- // Refuse to run in child processes.
- throw new Error("You cannot use the AddonManager in child processes!");
- }
-}
-
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-const MOZ_COMPATIBILITY_NIGHTLY = !['aurora', 'beta', 'release', 'esr'].includes(AppConstants.MOZ_UPDATE_CHANNEL);
-
-const PREF_BLOCKLIST_PINGCOUNTVERSION = "extensions.blocklist.pingCountVersion";
-const PREF_DEFAULT_PROVIDERS_ENABLED = "extensions.defaultProviders.enabled";
-const PREF_EM_UPDATE_ENABLED = "extensions.update.enabled";
-const PREF_EM_LAST_APP_VERSION = "extensions.lastAppVersion";
-const PREF_EM_LAST_PLATFORM_VERSION = "extensions.lastPlatformVersion";
-const PREF_EM_AUTOUPDATE_DEFAULT = "extensions.update.autoUpdateDefault";
-const PREF_EM_STRICT_COMPATIBILITY = "extensions.strictCompatibility";
-const PREF_EM_CHECK_UPDATE_SECURITY = "extensions.checkUpdateSecurity";
-const PREF_EM_UPDATE_BACKGROUND_URL = "extensions.update.background.url";
-const PREF_APP_UPDATE_ENABLED = "app.update.enabled";
-const PREF_APP_UPDATE_AUTO = "app.update.auto";
-const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
-const PREF_EM_HOTFIX_LASTVERSION = "extensions.hotfix.lastVersion";
-const PREF_EM_HOTFIX_URL = "extensions.hotfix.url";
-const PREF_EM_CERT_CHECKATTRIBUTES = "extensions.hotfix.cert.checkAttributes";
-const PREF_EM_HOTFIX_CERTS = "extensions.hotfix.certs.";
-const PREF_MATCH_OS_LOCALE = "intl.locale.matchOS";
-const PREF_SELECTED_LOCALE = "general.useragent.locale";
-const UNKNOWN_XPCOM_ABI = "unknownABI";
-
-const PREF_MIN_WEBEXT_PLATFORM_VERSION = "extensions.webExtensionsMinPlatformVersion";
-const PREF_WEBAPI_TESTING = "extensions.webapi.testing";
-
-const UPDATE_REQUEST_VERSION = 2;
-const CATEGORY_UPDATE_PARAMS = "extension-update-params";
-
-const XMLURI_BLOCKLIST = "http://www.mozilla.org/2006/addons-blocklist";
-
-const KEY_PROFILEDIR = "ProfD";
-const KEY_APPDIR = "XCurProcD";
-const FILE_BLOCKLIST = "blocklist.xml";
-
-const BRANCH_REGEXP = /^([^\.]+\.[0-9]+[a-z]*).*/gi;
-const PREF_EM_CHECK_COMPATIBILITY = "extensions.enableCompatibilityChecking";
-
-const TOOLKIT_ID = "toolkit@mozilla.org";
-
-const VALID_TYPES_REGEXP = /^[\w\-]+$/;
-
-const WEBAPI_INSTALL_HOSTS = ["addons.mozilla.org", "testpilot.firefox.com"];
-const WEBAPI_TEST_INSTALL_HOSTS = [
- "addons.allizom.org", "addons-dev.allizom.org",
- "testpilot.stage.mozaws.net", "testpilot.dev.mozaws.net",
- "example.com",
-];
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
- "resource://gre/modules/addons/AddonRepository.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Extension",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
- let certUtils = {};
- Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
- return certUtils;
-});
-
-const INTEGER = /^[1-9]\d*$/;
-
-this.EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ];
-
-const CATEGORY_PROVIDER_MODULE = "addon-provider-module";
-
-// A list of providers to load by default
-const DEFAULT_PROVIDERS = [
- "resource://gre/modules/addons/XPIProvider.jsm",
- "resource://gre/modules/LightweightThemeManager.jsm"
-];
-
-Cu.import("resource://gre/modules/Log.jsm");
-// Configure a logger at the parent 'addons' level to format
-// messages for all the modules under addons.*
-const PARENT_LOGGER_ID = "addons";
-var parentLogger = Log.repository.getLogger(PARENT_LOGGER_ID);
-parentLogger.level = Log.Level.Warn;
-var formatter = new Log.BasicFormatter();
-// Set parent logger (and its children) to append to
-// the Javascript section of the Browser Console
-parentLogger.addAppender(new Log.ConsoleAppender(formatter));
-// Set parent logger (and its children) to
-// also append to standard out
-parentLogger.addAppender(new Log.DumpAppender(formatter));
-
-// Create a new logger (child of 'addons' logger)
-// for use by the Addons Manager
-const LOGGER_ID = "addons.manager";
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-// Provide the ability to enable/disable logging
-// messages at runtime.
-// If the "extensions.logging.enabled" preference is
-// missing or 'false', messages at the WARNING and higher
-// severity should be logged to the JS console and standard error.
-// If "extensions.logging.enabled" is set to 'true', messages
-// at DEBUG and higher should go to JS console and standard error.
-const PREF_LOGGING_ENABLED = "extensions.logging.enabled";
-const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
-
-const UNNAMED_PROVIDER = "<unnamed-provider>";
-function providerName(aProvider) {
- return aProvider.name || UNNAMED_PROVIDER;
-}
-
-/**
- * Preference listener which listens for a change in the
- * "extensions.logging.enabled" preference and changes the logging level of the
- * parent 'addons' level logger accordingly.
- */
-var PrefObserver = {
- init: function() {
- Services.prefs.addObserver(PREF_LOGGING_ENABLED, this, false);
- Services.obs.addObserver(this, "xpcom-shutdown", false);
- this.observe(null, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID, PREF_LOGGING_ENABLED);
- },
-
- observe: function(aSubject, aTopic, aData) {
- if (aTopic == "xpcom-shutdown") {
- Services.prefs.removeObserver(PREF_LOGGING_ENABLED, this);
- Services.obs.removeObserver(this, "xpcom-shutdown");
- }
- else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
- let debugLogEnabled = false;
- try {
- debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
- }
- catch (e) {
- }
- if (debugLogEnabled) {
- parentLogger.level = Log.Level.Debug;
- }
- else {
- parentLogger.level = Log.Level.Warn;
- }
- }
- }
-};
-
-PrefObserver.init();
-
-/**
- * Calls a callback method consuming any thrown exception. Any parameters after
- * the callback parameter will be passed to the callback.
- *
- * @param aCallback
- * The callback method to call
- */
-function safeCall(aCallback, ...aArgs) {
- try {
- aCallback.apply(null, aArgs);
- }
- catch (e) {
- logger.warn("Exception calling callback", e);
- }
-}
-
-/**
- * Creates a function that will call the passed callback catching and logging
- * any exceptions.
- *
- * @param aCallback
- * The callback method to call
- */
-function makeSafe(aCallback) {
- return function(...aArgs) {
- safeCall(aCallback, ...aArgs);
- }
-}
-
-/**
- * Report an exception thrown by a provider API method.
- */
-function reportProviderError(aProvider, aMethod, aError) {
- let method = `provider ${providerName(aProvider)}.${aMethod}`;
- AddonManagerPrivate.recordException("AMI", method, aError);
- logger.error("Exception calling " + method, aError);
-}
-
-/**
- * Calls a method on a provider if it exists and consumes any thrown exception.
- * Any parameters after the aDefault parameter are passed to the provider's method.
- *
- * @param aProvider
- * The provider to call
- * @param aMethod
- * The method name to call
- * @param aDefault
- * A default return value if the provider does not implement the named
- * method or throws an error.
- * @return the return value from the provider, or aDefault if the provider does not
- * implement method or throws an error
- */
-function callProvider(aProvider, aMethod, aDefault, ...aArgs) {
- if (!(aMethod in aProvider))
- return aDefault;
-
- try {
- return aProvider[aMethod].apply(aProvider, aArgs);
- }
- catch (e) {
- reportProviderError(aProvider, aMethod, e);
- return aDefault;
- }
-}
-
-/**
- * Calls a method on a provider if it exists and consumes any thrown exception.
- * Parameters after aMethod are passed to aProvider.aMethod().
- * The last parameter must be a callback function.
- * If the provider does not implement the method, or the method throws, calls
- * the callback with 'undefined'.
- *
- * @param aProvider
- * The provider to call
- * @param aMethod
- * The method name to call
- */
-function callProviderAsync(aProvider, aMethod, ...aArgs) {
- let callback = aArgs[aArgs.length - 1];
- if (!(aMethod in aProvider)) {
- callback(undefined);
- return undefined;
- }
- try {
- return aProvider[aMethod].apply(aProvider, aArgs);
- }
- catch (e) {
- reportProviderError(aProvider, aMethod, e);
- callback(undefined);
- return undefined;
- }
-}
-
-/**
- * Calls a method on a provider if it exists and consumes any thrown exception.
- * Parameters after aMethod are passed to aProvider.aMethod() and an additional
- * callback is added for the provider to return a result to.
- *
- * @param aProvider
- * The provider to call
- * @param aMethod
- * The method name to call
- * @return {Promise}
- * @resolves The result the provider returns, or |undefined| if the provider
- * does not implement the method or the method throws.
- * @rejects Never
- */
-function promiseCallProvider(aProvider, aMethod, ...aArgs) {
- return new Promise(resolve => {
- callProviderAsync(aProvider, aMethod, ...aArgs, resolve);
- });
-}
-
-/**
- * Gets the currently selected locale for display.
- * @return the selected locale or "en-US" if none is selected
- */
-function getLocale() {
- try {
- if (Services.prefs.getBoolPref(PREF_MATCH_OS_LOCALE))
- return Services.locale.getLocaleComponentForUserAgent();
- }
- catch (e) { }
-
- try {
- let locale = Services.prefs.getComplexValue(PREF_SELECTED_LOCALE,
- Ci.nsIPrefLocalizedString);
- if (locale)
- return locale;
- }
- catch (e) { }
-
- try {
- return Services.prefs.getCharPref(PREF_SELECTED_LOCALE);
- }
- catch (e) { }
-
- return "en-US";
-}
-
-function webAPIForAddon(addon) {
- if (!addon) {
- return null;
- }
-
- let result = {};
-
- // By default just pass through any plain property, the webidl will
- // control access. Also filter out private properties, regular Addon
- // objects are okay but MockAddon used in tests has non-serializable
- // private properties.
- for (let prop in addon) {
- if (prop[0] != "_" && typeof(addon[prop]) != "function") {
- result[prop] = addon[prop];
- }
- }
-
- // A few properties are computed for a nicer API
- result.isEnabled = !addon.userDisabled;
- result.canUninstall = Boolean(addon.permissions & AddonManager.PERM_CAN_UNINSTALL);
-
- return result;
-}
-
-/**
- * A helper class to repeatedly call a listener with each object in an array
- * optionally checking whether the object has a method in it.
- *
- * @param aObjects
- * The array of objects to iterate through
- * @param aMethod
- * An optional method name, if not null any objects without this method
- * will not be passed to the listener
- * @param aListener
- * A listener implementing nextObject and noMoreObjects methods. The
- * former will be called with the AsyncObjectCaller as the first
- * parameter and the object as the second. noMoreObjects will be passed
- * just the AsyncObjectCaller
- */
-function AsyncObjectCaller(aObjects, aMethod, aListener) {
- this.objects = [...aObjects];
- this.method = aMethod;
- this.listener = aListener;
-
- this.callNext();
-}
-
-AsyncObjectCaller.prototype = {
- objects: null,
- method: null,
- listener: null,
-
- /**
- * Passes the next object to the listener or calls noMoreObjects if there
- * are none left.
- */
- callNext: function() {
- if (this.objects.length == 0) {
- this.listener.noMoreObjects(this);
- return;
- }
-
- let object = this.objects.shift();
- if (!this.method || this.method in object)
- this.listener.nextObject(this, object);
- else
- this.callNext();
- }
-};
-
-/**
- * Listens for a browser changing origin and cancels the installs that were
- * started by it.
- */
-function BrowserListener(aBrowser, aInstallingPrincipal, aInstalls) {
- this.browser = aBrowser;
- this.principal = aInstallingPrincipal;
- this.installs = aInstalls;
- this.installCount = aInstalls.length;
-
- aBrowser.addProgressListener(this, Ci.nsIWebProgress.NOTIFY_LOCATION);
- Services.obs.addObserver(this, "message-manager-close", true);
-
- for (let install of this.installs)
- install.addListener(this);
-
- this.registered = true;
-}
-
-BrowserListener.prototype = {
- browser: null,
- installs: null,
- installCount: null,
- registered: false,
-
- unregister: function() {
- if (!this.registered)
- return;
- this.registered = false;
-
- Services.obs.removeObserver(this, "message-manager-close");
- // The browser may have already been detached
- if (this.browser.removeProgressListener)
- this.browser.removeProgressListener(this);
-
- for (let install of this.installs)
- install.removeListener(this);
- this.installs = null;
- },
-
- cancelInstalls: function() {
- for (let install of this.installs) {
- try {
- install.cancel();
- }
- catch (e) {
- // Some installs may have already failed or been cancelled, ignore these
- }
- }
- },
-
- observe: function(subject, topic, data) {
- if (subject != this.browser.messageManager)
- return;
-
- // The browser's message manager has closed and so the browser is
- // going away, cancel all installs
- this.cancelInstalls();
- },
-
- onLocationChange: function(webProgress, request, location) {
- if (this.browser.contentPrincipal && this.principal.subsumes(this.browser.contentPrincipal))
- return;
-
- // The browser has navigated to a new origin so cancel all installs
- this.cancelInstalls();
- },
-
- onDownloadCancelled: function(install) {
- // Don't need to hear more events from this install
- install.removeListener(this);
-
- // Once all installs have ended unregister everything
- if (--this.installCount == 0)
- this.unregister();
- },
-
- onDownloadFailed: function(install) {
- this.onDownloadCancelled(install);
- },
-
- onInstallFailed: function(install) {
- this.onDownloadCancelled(install);
- },
-
- onInstallEnded: function(install) {
- this.onDownloadCancelled(install);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
- Ci.nsIWebProgressListener,
- Ci.nsIObserver])
-};
-
-/**
- * This represents an author of an add-on (e.g. creator or developer)
- *
- * @param aName
- * The name of the author
- * @param aURL
- * The URL of the author's profile page
- */
-function AddonAuthor(aName, aURL) {
- this.name = aName;
- this.url = aURL;
-}
-
-AddonAuthor.prototype = {
- name: null,
- url: null,
-
- // Returns the author's name, defaulting to the empty string
- toString: function() {
- return this.name || "";
- }
-}
-
-/**
- * This represents an screenshot for an add-on
- *
- * @param aURL
- * The URL to the full version of the screenshot
- * @param aWidth
- * The width in pixels of the screenshot
- * @param aHeight
- * The height in pixels of the screenshot
- * @param aThumbnailURL
- * The URL to the thumbnail version of the screenshot
- * @param aThumbnailWidth
- * The width in pixels of the thumbnail version of the screenshot
- * @param aThumbnailHeight
- * The height in pixels of the thumbnail version of the screenshot
- * @param aCaption
- * The caption of the screenshot
- */
-function AddonScreenshot(aURL, aWidth, aHeight, aThumbnailURL,
- aThumbnailWidth, aThumbnailHeight, aCaption) {
- this.url = aURL;
- if (aWidth) this.width = aWidth;
- if (aHeight) this.height = aHeight;
- if (aThumbnailURL) this.thumbnailURL = aThumbnailURL;
- if (aThumbnailWidth) this.thumbnailWidth = aThumbnailWidth;
- if (aThumbnailHeight) this.thumbnailHeight = aThumbnailHeight;
- if (aCaption) this.caption = aCaption;
-}
-
-AddonScreenshot.prototype = {
- url: null,
- width: null,
- height: null,
- thumbnailURL: null,
- thumbnailWidth: null,
- thumbnailHeight: null,
- caption: null,
-
- // Returns the screenshot URL, defaulting to the empty string
- toString: function() {
- return this.url || "";
- }
-}
-
-
-/**
- * This represents a compatibility override for an addon.
- *
- * @param aType
- * Overrride type - "compatible" or "incompatible"
- * @param aMinVersion
- * Minimum version of the addon to match
- * @param aMaxVersion
- * Maximum version of the addon to match
- * @param aAppID
- * Application ID used to match appMinVersion and appMaxVersion
- * @param aAppMinVersion
- * Minimum version of the application to match
- * @param aAppMaxVersion
- * Maximum version of the application to match
- */
-function AddonCompatibilityOverride(aType, aMinVersion, aMaxVersion, aAppID,
- aAppMinVersion, aAppMaxVersion) {
- this.type = aType;
- this.minVersion = aMinVersion;
- this.maxVersion = aMaxVersion;
- this.appID = aAppID;
- this.appMinVersion = aAppMinVersion;
- this.appMaxVersion = aAppMaxVersion;
-}
-
-AddonCompatibilityOverride.prototype = {
- /**
- * Type of override - "incompatible" or "compatible".
- * Only "incompatible" is supported for now.
- */
- type: null,
-
- /**
- * Min version of the addon to match.
- */
- minVersion: null,
-
- /**
- * Max version of the addon to match.
- */
- maxVersion: null,
-
- /**
- * Application ID to match.
- */
- appID: null,
-
- /**
- * Min version of the application to match.
- */
- appMinVersion: null,
-
- /**
- * Max version of the application to match.
- */
- appMaxVersion: null
-};
-
-
-/**
- * A type of add-on, used by the UI to determine how to display different types
- * of add-ons.
- *
- * @param aID
- * The add-on type ID
- * @param aLocaleURI
- * The URI of a localized properties file to get the displayable name
- * for the type from
- * @param aLocaleKey
- * The key for the string in the properties file or the actual display
- * name if aLocaleURI is null. Include %ID% to include the type ID in
- * the key
- * @param aViewType
- * The optional type of view to use in the UI
- * @param aUIPriority
- * The priority is used by the UI to list the types in order. Lower
- * values push the type higher in the list.
- * @param aFlags
- * An option set of flags that customize the display of the add-on in
- * the UI.
- */
-function AddonType(aID, aLocaleURI, aLocaleKey, aViewType, aUIPriority, aFlags) {
- if (!aID)
- throw Components.Exception("An AddonType must have an ID", Cr.NS_ERROR_INVALID_ARG);
-
- if (aViewType && aUIPriority === undefined)
- throw Components.Exception("An AddonType with a defined view must have a set UI priority",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aLocaleKey)
- throw Components.Exception("An AddonType must have a displayable name",
- Cr.NS_ERROR_INVALID_ARG);
-
- this.id = aID;
- this.uiPriority = aUIPriority;
- this.viewType = aViewType;
- this.flags = aFlags;
-
- if (aLocaleURI) {
- XPCOMUtils.defineLazyGetter(this, "name", () => {
- let bundle = Services.strings.createBundle(aLocaleURI);
- return bundle.GetStringFromName(aLocaleKey.replace("%ID%", aID));
- });
- }
- else {
- this.name = aLocaleKey;
- }
-}
-
-var gStarted = false;
-var gStartupComplete = false;
-var gCheckCompatibility = true;
-var gStrictCompatibility = true;
-var gCheckUpdateSecurityDefault = true;
-var gCheckUpdateSecurity = gCheckUpdateSecurityDefault;
-var gUpdateEnabled = true;
-var gAutoUpdateDefault = true;
-var gHotfixID = null;
-var gWebExtensionsMinPlatformVersion = null;
-var gShutdownBarrier = null;
-var gRepoShutdownState = "";
-var gShutdownInProgress = false;
-var gPluginPageListener = null;
-
-/**
- * This is the real manager, kept here rather than in AddonManager to keep its
- * contents hidden from API users.
- */
-var AddonManagerInternal = {
- managerListeners: [],
- installListeners: [],
- addonListeners: [],
- typeListeners: [],
- pendingProviders: new Set(),
- providers: new Set(),
- providerShutdowns: new Map(),
- types: {},
- startupChanges: {},
- // Store telemetry details per addon provider
- telemetryDetails: {},
- upgradeListeners: new Map(),
-
- recordTimestamp: function(name, value) {
- this.TelemetryTimestamps.add(name, value);
- },
-
- validateBlocklist: function() {
- let appBlocklist = FileUtils.getFile(KEY_APPDIR, [FILE_BLOCKLIST]);
-
- // If there is no application shipped blocklist then there is nothing to do
- if (!appBlocklist.exists())
- return;
-
- let profileBlocklist = FileUtils.getFile(KEY_PROFILEDIR, [FILE_BLOCKLIST]);
-
- // If there is no blocklist in the profile then copy the application shipped
- // one there
- if (!profileBlocklist.exists()) {
- try {
- appBlocklist.copyTo(profileBlocklist.parent, FILE_BLOCKLIST);
- }
- catch (e) {
- logger.warn("Failed to copy the application shipped blocklist to the profile", e);
- }
- return;
- }
-
- let fileStream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- try {
- let cstream = Cc["@mozilla.org/intl/converter-input-stream;1"].
- createInstance(Ci.nsIConverterInputStream);
- fileStream.init(appBlocklist, FileUtils.MODE_RDONLY, FileUtils.PERMS_FILE, 0);
- cstream.init(fileStream, "UTF-8", 0, 0);
-
- let data = "";
- let str = {};
- let read = 0;
- do {
- read = cstream.readString(0xffffffff, str);
- data += str.value;
- } while (read != 0);
-
- let parser = Cc["@mozilla.org/xmlextras/domparser;1"].
- createInstance(Ci.nsIDOMParser);
- var doc = parser.parseFromString(data, "text/xml");
- }
- catch (e) {
- logger.warn("Application shipped blocklist could not be loaded", e);
- return;
- }
- finally {
- try {
- fileStream.close();
- }
- catch (e) {
- logger.warn("Unable to close blocklist file stream", e);
- }
- }
-
- // If the namespace is incorrect then ignore the application shipped
- // blocklist
- if (doc.documentElement.namespaceURI != XMLURI_BLOCKLIST) {
- logger.warn("Application shipped blocklist has an unexpected namespace (" +
- doc.documentElement.namespaceURI + ")");
- return;
- }
-
- // If there is no lastupdate information then ignore the application shipped
- // blocklist
- if (!doc.documentElement.hasAttribute("lastupdate"))
- return;
-
- // If the application shipped blocklist is older than the profile blocklist
- // then do nothing
- if (doc.documentElement.getAttribute("lastupdate") <=
- profileBlocklist.lastModifiedTime)
- return;
-
- // Otherwise copy the application shipped blocklist to the profile
- try {
- appBlocklist.copyTo(profileBlocklist.parent, FILE_BLOCKLIST);
- }
- catch (e) {
- logger.warn("Failed to copy the application shipped blocklist to the profile", e);
- }
- },
-
- /**
- * Start up a provider, and register its shutdown hook if it has one
- */
- _startProvider(aProvider, aAppChanged, aOldAppVersion, aOldPlatformVersion) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- logger.debug(`Starting provider: ${providerName(aProvider)}`);
- callProvider(aProvider, "startup", null, aAppChanged, aOldAppVersion, aOldPlatformVersion);
- if ('shutdown' in aProvider) {
- let name = providerName(aProvider);
- let AMProviderShutdown = () => {
- // If the provider has been unregistered, it will have been removed from
- // this.providers. If it hasn't been unregistered, then this is a normal
- // shutdown - and we move it to this.pendingProviders incase we're
- // running in a test that will start AddonManager again.
- if (this.providers.has(aProvider)) {
- this.providers.delete(aProvider);
- this.pendingProviders.add(aProvider);
- }
-
- return new Promise((resolve, reject) => {
- logger.debug("Calling shutdown blocker for " + name);
- resolve(aProvider.shutdown());
- })
- .catch(err => {
- logger.warn("Failure during shutdown of " + name, err);
- AddonManagerPrivate.recordException("AMI", "Async shutdown of " + name, err);
- });
- };
- logger.debug("Registering shutdown blocker for " + name);
- this.providerShutdowns.set(aProvider, AMProviderShutdown);
- AddonManager.shutdown.addBlocker(name, AMProviderShutdown);
- }
-
- this.pendingProviders.delete(aProvider);
- this.providers.add(aProvider);
- logger.debug(`Provider finished startup: ${providerName(aProvider)}`);
- },
-
- _getProviderByName(aName) {
- for (let provider of this.providers) {
- if (providerName(provider) == aName)
- return provider;
- }
- return undefined;
- },
-
- /**
- * Initializes the AddonManager, loading any known providers and initializing
- * them.
- */
- startup: function() {
- try {
- if (gStarted)
- return;
-
- this.recordTimestamp("AMI_startup_begin");
-
- // clear this for xpcshell test restarts
- for (let provider in this.telemetryDetails)
- delete this.telemetryDetails[provider];
-
- let appChanged = undefined;
-
- let oldAppVersion = null;
- try {
- oldAppVersion = Services.prefs.getCharPref(PREF_EM_LAST_APP_VERSION);
- appChanged = Services.appinfo.version != oldAppVersion;
- }
- catch (e) { }
-
- Extension.browserUpdated = appChanged;
-
- let oldPlatformVersion = null;
- try {
- oldPlatformVersion = Services.prefs.getCharPref(PREF_EM_LAST_PLATFORM_VERSION);
- }
- catch (e) { }
-
- if (appChanged !== false) {
- logger.debug("Application has been upgraded");
- Services.prefs.setCharPref(PREF_EM_LAST_APP_VERSION,
- Services.appinfo.version);
- Services.prefs.setCharPref(PREF_EM_LAST_PLATFORM_VERSION,
- Services.appinfo.platformVersion);
- Services.prefs.setIntPref(PREF_BLOCKLIST_PINGCOUNTVERSION,
- (appChanged === undefined ? 0 : -1));
- this.validateBlocklist();
- }
-
- try {
- gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);
- } catch (e) {}
- Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this, false);
-
- try {
- gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY);
- } catch (e) {}
- Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this, false);
-
- try {
- let defaultBranch = Services.prefs.getDefaultBranch("");
- gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
- } catch (e) {}
-
- try {
- gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
- } catch (e) {}
- Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this, false);
-
- try {
- gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED);
- } catch (e) {}
- Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this, false);
-
- try {
- gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT);
- } catch (e) {}
- Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this, false);
-
- try {
- gHotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID);
- } catch (e) {}
- Services.prefs.addObserver(PREF_EM_HOTFIX_ID, this, false);
-
- try {
- gWebExtensionsMinPlatformVersion = Services.prefs.getCharPref(PREF_MIN_WEBEXT_PLATFORM_VERSION);
- } catch (e) {}
- Services.prefs.addObserver(PREF_MIN_WEBEXT_PLATFORM_VERSION, this, false);
-
- let defaultProvidersEnabled = true;
- try {
- defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED);
- } catch (e) {}
- AddonManagerPrivate.recordSimpleMeasure("default_providers", defaultProvidersEnabled);
-
- // Ensure all default providers have had a chance to register themselves
- if (defaultProvidersEnabled) {
- for (let url of DEFAULT_PROVIDERS) {
- try {
- let scope = {};
- Components.utils.import(url, scope);
- // Sanity check - make sure the provider exports a symbol that
- // has a 'startup' method
- let syms = Object.keys(scope);
- if ((syms.length < 1) ||
- (typeof scope[syms[0]].startup != "function")) {
- logger.warn("Provider " + url + " has no startup()");
- AddonManagerPrivate.recordException("AMI", "provider " + url, "no startup()");
- }
- logger.debug("Loaded provider scope for " + url + ": " + Object.keys(scope).toSource());
- }
- catch (e) {
- AddonManagerPrivate.recordException("AMI", "provider " + url + " load failed", e);
- logger.error("Exception loading default provider \"" + url + "\"", e);
- }
- }
- }
-
- // Load any providers registered in the category manager
- let catman = Cc["@mozilla.org/categorymanager;1"].
- getService(Ci.nsICategoryManager);
- let entries = catman.enumerateCategory(CATEGORY_PROVIDER_MODULE);
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
- let url = catman.getCategoryEntry(CATEGORY_PROVIDER_MODULE, entry);
-
- try {
- Components.utils.import(url, {});
- logger.debug(`Loaded provider scope for ${url}`);
- }
- catch (e) {
- AddonManagerPrivate.recordException("AMI", "provider " + url + " load failed", e);
- logger.error("Exception loading provider " + entry + " from category \"" +
- url + "\"", e);
- }
- }
-
- // Register our shutdown handler with the AsyncShutdown manager
- gShutdownBarrier = new AsyncShutdown.Barrier("AddonManager: Waiting for providers to shut down.");
- AsyncShutdown.profileBeforeChange.addBlocker("AddonManager: shutting down.",
- this.shutdownManager.bind(this),
- {fetchState: this.shutdownState.bind(this)});
-
- // Once we start calling providers we must allow all normal methods to work.
- gStarted = true;
-
- for (let provider of this.pendingProviders) {
- this._startProvider(provider, appChanged, oldAppVersion, oldPlatformVersion);
- }
-
- // If this is a new profile just pretend that there were no changes
- if (appChanged === undefined) {
- for (let type in this.startupChanges)
- delete this.startupChanges[type];
- }
-
- // Support for remote about:plugins. Note that this module isn't loaded
- // at the top because Services.appinfo is defined late in tests.
- let { RemotePages } = Cu.import("resource://gre/modules/RemotePageManager.jsm", {});
-
- gPluginPageListener = new RemotePages("about:plugins");
- gPluginPageListener.addMessageListener("RequestPlugins", this.requestPlugins);
-
- gStartupComplete = true;
- this.recordTimestamp("AMI_startup_end");
- }
- catch (e) {
- logger.error("startup failed", e);
- AddonManagerPrivate.recordException("AMI", "startup failed", e);
- }
-
- logger.debug("Completed startup sequence");
- this.callManagerListeners("onStartup");
- },
-
- /**
- * Registers a new AddonProvider.
- *
- * @param aProvider
- * The provider to register
- * @param aTypes
- * An optional array of add-on types
- */
- registerProvider: function(aProvider, aTypes) {
- if (!aProvider || typeof aProvider != "object")
- throw Components.Exception("aProvider must be specified",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aTypes && !Array.isArray(aTypes))
- throw Components.Exception("aTypes must be an array or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- this.pendingProviders.add(aProvider);
-
- if (aTypes) {
- for (let type of aTypes) {
- if (!(type.id in this.types)) {
- if (!VALID_TYPES_REGEXP.test(type.id)) {
- logger.warn("Ignoring invalid type " + type.id);
- return;
- }
-
- this.types[type.id] = {
- type: type,
- providers: [aProvider]
- };
-
- let typeListeners = this.typeListeners.slice(0);
- for (let listener of typeListeners)
- safeCall(() => listener.onTypeAdded(type));
- }
- else {
- this.types[type.id].providers.push(aProvider);
- }
- }
- }
-
- // If we're registering after startup call this provider's startup.
- if (gStarted) {
- this._startProvider(aProvider);
- }
- },
-
- /**
- * Unregisters an AddonProvider.
- *
- * @param aProvider
- * The provider to unregister
- * @return Whatever the provider's 'shutdown' method returns (if anything).
- * For providers that have async shutdown methods returning Promises,
- * the caller should wait for that Promise to resolve.
- */
- unregisterProvider: function(aProvider) {
- if (!aProvider || typeof aProvider != "object")
- throw Components.Exception("aProvider must be specified",
- Cr.NS_ERROR_INVALID_ARG);
-
- this.providers.delete(aProvider);
- // The test harness will unregister XPIProvider *after* shutdown, which is
- // after the provider will have been moved from providers to
- // pendingProviders.
- this.pendingProviders.delete(aProvider);
-
- for (let type in this.types) {
- this.types[type].providers = this.types[type].providers.filter(p => p != aProvider);
- if (this.types[type].providers.length == 0) {
- let oldType = this.types[type].type;
- delete this.types[type];
-
- let typeListeners = this.typeListeners.slice(0);
- for (let listener of typeListeners)
- safeCall(() => listener.onTypeRemoved(oldType));
- }
- }
-
- // If we're unregistering after startup but before shutting down,
- // remove the blocker for this provider's shutdown and call it.
- // If we're already shutting down, just let gShutdownBarrier call it to avoid races.
- if (gStarted && !gShutdownInProgress) {
- logger.debug("Unregistering shutdown blocker for " + providerName(aProvider));
- let shutter = this.providerShutdowns.get(aProvider);
- if (shutter) {
- this.providerShutdowns.delete(aProvider);
- gShutdownBarrier.client.removeBlocker(shutter);
- return shutter();
- }
- }
- return undefined;
- },
-
- /**
- * Mark a provider as safe to access via AddonManager APIs, before its
- * startup has completed.
- *
- * Normally a provider isn't marked as safe until after its (synchronous)
- * startup() method has returned. Until a provider has been marked safe,
- * it won't be used by any of the AddonManager APIs. markProviderSafe()
- * allows a provider to mark itself as safe during its startup; this can be
- * useful if the provider wants to perform tasks that block startup, which
- * happen after its required initialization tasks and therefore when the
- * provider is in a safe state.
- *
- * @param aProvider Provider object to mark safe
- */
- markProviderSafe: function(aProvider) {
- if (!gStarted) {
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
- }
-
- if (!aProvider || typeof aProvider != "object") {
- throw Components.Exception("aProvider must be specified",
- Cr.NS_ERROR_INVALID_ARG);
- }
-
- if (!this.pendingProviders.has(aProvider)) {
- return;
- }
-
- this.pendingProviders.delete(aProvider);
- this.providers.add(aProvider);
- },
-
- /**
- * Calls a method on all registered providers if it exists and consumes any
- * thrown exception. Return values are ignored. Any parameters after the
- * method parameter are passed to the provider's method.
- * WARNING: Do not use for asynchronous calls; callProviders() does not
- * invoke callbacks if provider methods throw synchronous exceptions.
- *
- * @param aMethod
- * The method name to call
- * @see callProvider
- */
- callProviders: function(aMethod, ...aArgs) {
- if (!aMethod || typeof aMethod != "string")
- throw Components.Exception("aMethod must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- let providers = [...this.providers];
- for (let provider of providers) {
- try {
- if (aMethod in provider)
- provider[aMethod].apply(provider, aArgs);
- }
- catch (e) {
- reportProviderError(provider, aMethod, e);
- }
- }
- },
-
- /**
- * Report the current state of asynchronous shutdown
- */
- shutdownState() {
- let state = [];
- if (gShutdownBarrier) {
- state.push({
- name: gShutdownBarrier.client.name,
- state: gShutdownBarrier.state
- });
- }
- state.push({
- name: "AddonRepository: async shutdown",
- state: gRepoShutdownState
- });
- return state;
- },
-
- /**
- * Shuts down the addon manager and all registered providers, this must clean
- * up everything in order for automated tests to fake restarts.
- * @return Promise{null} that resolves when all providers and dependent modules
- * have finished shutting down
- */
- shutdownManager: Task.async(function*() {
- logger.debug("shutdown");
- this.callManagerListeners("onShutdown");
-
- gRepoShutdownState = "pending";
- gShutdownInProgress = true;
- // Clean up listeners
- Services.prefs.removeObserver(PREF_EM_CHECK_COMPATIBILITY, this);
- Services.prefs.removeObserver(PREF_EM_STRICT_COMPATIBILITY, this);
- Services.prefs.removeObserver(PREF_EM_CHECK_UPDATE_SECURITY, this);
- Services.prefs.removeObserver(PREF_EM_UPDATE_ENABLED, this);
- Services.prefs.removeObserver(PREF_EM_AUTOUPDATE_DEFAULT, this);
- Services.prefs.removeObserver(PREF_EM_HOTFIX_ID, this);
- gPluginPageListener.destroy();
- gPluginPageListener = null;
-
- let savedError = null;
- // Only shut down providers if they've been started.
- if (gStarted) {
- try {
- yield gShutdownBarrier.wait();
- }
- catch (err) {
- savedError = err;
- logger.error("Failure during wait for shutdown barrier", err);
- AddonManagerPrivate.recordException("AMI", "Async shutdown of AddonManager providers", err);
- }
- }
-
- // Shut down AddonRepository after providers (if any).
- try {
- gRepoShutdownState = "in progress";
- yield AddonRepository.shutdown();
- gRepoShutdownState = "done";
- }
- catch (err) {
- savedError = err;
- logger.error("Failure during AddonRepository shutdown", err);
- AddonManagerPrivate.recordException("AMI", "Async shutdown of AddonRepository", err);
- }
-
- logger.debug("Async provider shutdown done");
- this.managerListeners.splice(0, this.managerListeners.length);
- this.installListeners.splice(0, this.installListeners.length);
- this.addonListeners.splice(0, this.addonListeners.length);
- this.typeListeners.splice(0, this.typeListeners.length);
- this.providerShutdowns.clear();
- for (let type in this.startupChanges)
- delete this.startupChanges[type];
- gStarted = false;
- gStartupComplete = false;
- gShutdownBarrier = null;
- gShutdownInProgress = false;
- if (savedError) {
- throw savedError;
- }
- }),
-
- requestPlugins: function({ target: port }) {
- // Lists all the properties that plugins.html needs
- const NEEDED_PROPS = ["name", "pluginLibraries", "pluginFullpath", "version",
- "isActive", "blocklistState", "description",
- "pluginMimeTypes"];
- function filterProperties(plugin) {
- let filtered = {};
- for (let prop of NEEDED_PROPS) {
- filtered[prop] = plugin[prop];
- }
- return filtered;
- }
-
- AddonManager.getAddonsByTypes(["plugin"], function(aPlugins) {
- port.sendAsyncMessage("PluginList", aPlugins.map(filterProperties));
- });
- },
-
- /**
- * Notified when a preference we're interested in has changed.
- *
- * @see nsIObserver
- */
- observe: function(aSubject, aTopic, aData) {
- switch (aData) {
- case PREF_EM_CHECK_COMPATIBILITY: {
- let oldValue = gCheckCompatibility;
- try {
- gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);
- } catch (e) {
- gCheckCompatibility = true;
- }
-
- this.callManagerListeners("onCompatibilityModeChanged");
-
- if (gCheckCompatibility != oldValue)
- this.updateAddonAppDisabledStates();
-
- break;
- }
- case PREF_EM_STRICT_COMPATIBILITY: {
- let oldValue = gStrictCompatibility;
- try {
- gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY);
- } catch (e) {
- gStrictCompatibility = true;
- }
-
- this.callManagerListeners("onCompatibilityModeChanged");
-
- if (gStrictCompatibility != oldValue)
- this.updateAddonAppDisabledStates();
-
- break;
- }
- case PREF_EM_CHECK_UPDATE_SECURITY: {
- let oldValue = gCheckUpdateSecurity;
- try {
- gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
- } catch (e) {
- gCheckUpdateSecurity = true;
- }
-
- this.callManagerListeners("onCheckUpdateSecurityChanged");
-
- if (gCheckUpdateSecurity != oldValue)
- this.updateAddonAppDisabledStates();
-
- break;
- }
- case PREF_EM_UPDATE_ENABLED: {
- let oldValue = gUpdateEnabled;
- try {
- gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED);
- } catch (e) {
- gUpdateEnabled = true;
- }
-
- this.callManagerListeners("onUpdateModeChanged");
- break;
- }
- case PREF_EM_AUTOUPDATE_DEFAULT: {
- let oldValue = gAutoUpdateDefault;
- try {
- gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT);
- } catch (e) {
- gAutoUpdateDefault = true;
- }
-
- this.callManagerListeners("onUpdateModeChanged");
- break;
- }
- case PREF_EM_HOTFIX_ID: {
- try {
- gHotfixID = Services.prefs.getCharPref(PREF_EM_HOTFIX_ID);
- } catch (e) {
- gHotfixID = null;
- }
- break;
- }
- case PREF_MIN_WEBEXT_PLATFORM_VERSION: {
- gWebExtensionsMinPlatformVersion = Services.prefs.getCharPref(PREF_MIN_WEBEXT_PLATFORM_VERSION);
- break;
- }
- }
- },
-
- /**
- * Replaces %...% strings in an addon url (update and updateInfo) with
- * appropriate values.
- *
- * @param aAddon
- * The Addon representing the add-on
- * @param aUri
- * The string representation of the URI to escape
- * @param aAppVersion
- * The optional application version to use for %APP_VERSION%
- * @return The appropriately escaped URI.
- */
- escapeAddonURI: function(aAddon, aUri, aAppVersion)
- {
- if (!aAddon || typeof aAddon != "object")
- throw Components.Exception("aAddon must be an Addon object",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aUri || typeof aUri != "string")
- throw Components.Exception("aUri must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aAppVersion && typeof aAppVersion != "string")
- throw Components.Exception("aAppVersion must be a string or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- var addonStatus = aAddon.userDisabled || aAddon.softDisabled ? "userDisabled"
- : "userEnabled";
-
- if (!aAddon.isCompatible)
- addonStatus += ",incompatible";
- if (aAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED)
- addonStatus += ",blocklisted";
- if (aAddon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED)
- addonStatus += ",softblocked";
-
- try {
- var xpcomABI = Services.appinfo.XPCOMABI;
- } catch (ex) {
- xpcomABI = UNKNOWN_XPCOM_ABI;
- }
-
- let uri = aUri.replace(/%ITEM_ID%/g, aAddon.id);
- uri = uri.replace(/%ITEM_VERSION%/g, aAddon.version);
- uri = uri.replace(/%ITEM_STATUS%/g, addonStatus);
- uri = uri.replace(/%APP_ID%/g, Services.appinfo.ID);
- uri = uri.replace(/%APP_VERSION%/g, aAppVersion ? aAppVersion :
- Services.appinfo.version);
- uri = uri.replace(/%REQ_VERSION%/g, UPDATE_REQUEST_VERSION);
- uri = uri.replace(/%APP_OS%/g, Services.appinfo.OS);
- uri = uri.replace(/%APP_ABI%/g, xpcomABI);
- uri = uri.replace(/%APP_LOCALE%/g, getLocale());
- uri = uri.replace(/%CURRENT_APP_VERSION%/g, Services.appinfo.version);
-
- // Replace custom parameters (names of custom parameters must have at
- // least 3 characters to prevent lookups for something like %D0%C8)
- var catMan = null;
- uri = uri.replace(/%(\w{3,})%/g, function(aMatch, aParam) {
- if (!catMan) {
- catMan = Cc["@mozilla.org/categorymanager;1"].
- getService(Ci.nsICategoryManager);
- }
-
- try {
- var contractID = catMan.getCategoryEntry(CATEGORY_UPDATE_PARAMS, aParam);
- var paramHandler = Cc[contractID].getService(Ci.nsIPropertyBag2);
- return paramHandler.getPropertyAsAString(aParam);
- }
- catch (e) {
- return aMatch;
- }
- });
-
- // escape() does not properly encode + symbols in any embedded FVF strings.
- return uri.replace(/\+/g, "%2B");
- },
-
- /**
- * Performs a background update check by starting an update for all add-ons
- * that can be updated.
- * @return Promise{null} Resolves when the background update check is complete
- * (the resulting addon installations may still be in progress).
- */
- backgroundUpdateCheck: function() {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- let buPromise = Task.spawn(function*() {
- let hotfixID = this.hotfixID;
-
- let appUpdateEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED) &&
- Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO);
- let checkHotfix = hotfixID && appUpdateEnabled;
-
- logger.debug("Background update check beginning");
-
- Services.obs.notifyObservers(null, "addons-background-update-start", null);
-
- if (this.updateEnabled) {
- let scope = {};
- Components.utils.import("resource://gre/modules/LightweightThemeManager.jsm", scope);
- scope.LightweightThemeManager.updateCurrentTheme();
-
- let allAddons = yield new Promise((resolve, reject) => this.getAllAddons(resolve));
-
- // Repopulate repository cache first, to ensure compatibility overrides
- // are up to date before checking for addon updates.
- yield AddonRepository.backgroundUpdateCheck();
-
- // Keep track of all the async add-on updates happening in parallel
- let updates = [];
-
- for (let addon of allAddons) {
- if (addon.id == hotfixID) {
- continue;
- }
-
- // Check all add-ons for updates so that any compatibility updates will
- // be applied
- updates.push(new Promise((resolve, reject) => {
- addon.findUpdates({
- onUpdateAvailable: function(aAddon, aInstall) {
- // Start installing updates when the add-on can be updated and
- // background updates should be applied.
- logger.debug("Found update for add-on ${id}", aAddon);
- if (aAddon.permissions & AddonManager.PERM_CAN_UPGRADE &&
- AddonManager.shouldAutoUpdate(aAddon)) {
- // XXX we really should resolve when this install is done,
- // not when update-available check completes, no?
- logger.debug(`Starting upgrade install of ${aAddon.id}`);
- aInstall.install();
- }
- },
-
- onUpdateFinished: aAddon => { logger.debug("onUpdateFinished for ${id}", aAddon); resolve(); }
- }, AddonManager.UPDATE_WHEN_PERIODIC_UPDATE);
- }));
- }
- yield Promise.all(updates);
- }
-
- if (checkHotfix) {
- var hotfixVersion = "";
- try {
- hotfixVersion = Services.prefs.getCharPref(PREF_EM_HOTFIX_LASTVERSION);
- }
- catch (e) { }
-
- let url = null;
- if (Services.prefs.getPrefType(PREF_EM_HOTFIX_URL) == Ci.nsIPrefBranch.PREF_STRING)
- url = Services.prefs.getCharPref(PREF_EM_HOTFIX_URL);
- else
- url = Services.prefs.getCharPref(PREF_EM_UPDATE_BACKGROUND_URL);
-
- // Build the URI from a fake add-on data.
- url = AddonManager.escapeAddonURI({
- id: hotfixID,
- version: hotfixVersion,
- userDisabled: false,
- appDisabled: false
- }, url);
-
- Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm");
- let update = null;
- try {
- let foundUpdates = yield new Promise((resolve, reject) => {
- AddonUpdateChecker.checkForUpdates(hotfixID, null, url, {
- onUpdateCheckComplete: resolve,
- onUpdateCheckError: reject
- });
- });
- update = AddonUpdateChecker.getNewestCompatibleUpdate(foundUpdates);
- } catch (e) {
- // AUC.checkForUpdates already logged the error
- }
-
- // Check that we have a hotfix update, and it's newer than the one we already
- // have installed (if any)
- if (update) {
- if (Services.vc.compare(hotfixVersion, update.version) < 0) {
- logger.debug("Downloading hotfix version " + update.version);
- let aInstall = yield new Promise((resolve, reject) =>
- AddonManager.getInstallForURL(update.updateURL, resolve,
- "application/x-xpinstall", update.updateHash, null,
- null, update.version));
-
- aInstall.addListener({
- onDownloadEnded: function(aInstall) {
- if (aInstall.addon.id != hotfixID) {
- logger.warn("The downloaded hotfix add-on did not have the " +
- "expected ID and so will not be installed.");
- aInstall.cancel();
- return;
- }
-
- // If XPIProvider has reported the hotfix as properly signed then
- // there is nothing more to do here
- if (aInstall.addon.signedState == AddonManager.SIGNEDSTATE_SIGNED)
- return;
-
- try {
- if (!Services.prefs.getBoolPref(PREF_EM_CERT_CHECKATTRIBUTES))
- return;
- }
- catch (e) {
- // By default don't do certificate checks.
- return;
- }
-
- try {
- CertUtils.validateCert(aInstall.certificate,
- CertUtils.readCertPrefs(PREF_EM_HOTFIX_CERTS));
- }
- catch (e) {
- logger.warn("The hotfix add-on was not signed by the expected " +
- "certificate and so will not be installed.", e);
- aInstall.cancel();
- }
- },
-
- onInstallEnded: function(aInstall) {
- // Remember the last successfully installed version.
- Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION,
- aInstall.version);
- },
-
- onInstallCancelled: function(aInstall) {
- // Revert to the previous version if the installation was
- // cancelled.
- Services.prefs.setCharPref(PREF_EM_HOTFIX_LASTVERSION,
- hotfixVersion);
- }
- });
-
- aInstall.install();
- }
- }
- }
-
- if (appUpdateEnabled) {
- try {
- yield AddonManagerInternal._getProviderByName("XPIProvider").updateSystemAddons();
- }
- catch (e) {
- logger.warn("Failed to update system addons", e);
- }
- }
-
- logger.debug("Background update check complete");
- Services.obs.notifyObservers(null,
- "addons-background-update-complete",
- null);
- }.bind(this));
- // Fork the promise chain so we can log the error and let our caller see it too.
- buPromise.then(null, e => logger.warn("Error in background update", e));
- return buPromise;
- },
-
- /**
- * Adds a add-on to the list of detected changes for this startup. If
- * addStartupChange is called multiple times for the same add-on in the same
- * startup then only the most recent change will be remembered.
- *
- * @param aType
- * The type of change as a string. Providers can define their own
- * types of changes or use the existing defined STARTUP_CHANGE_*
- * constants
- * @param aID
- * The ID of the add-on
- */
- addStartupChange: function(aType, aID) {
- if (!aType || typeof aType != "string")
- throw Components.Exception("aType must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aID || typeof aID != "string")
- throw Components.Exception("aID must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (gStartupComplete)
- return;
- logger.debug("Registering startup change '" + aType + "' for " + aID);
-
- // Ensure that an ID is only listed in one type of change
- for (let type in this.startupChanges)
- this.removeStartupChange(type, aID);
-
- if (!(aType in this.startupChanges))
- this.startupChanges[aType] = [];
- this.startupChanges[aType].push(aID);
- },
-
- /**
- * Removes a startup change for an add-on.
- *
- * @param aType
- * The type of change
- * @param aID
- * The ID of the add-on
- */
- removeStartupChange: function(aType, aID) {
- if (!aType || typeof aType != "string")
- throw Components.Exception("aType must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aID || typeof aID != "string")
- throw Components.Exception("aID must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (gStartupComplete)
- return;
-
- if (!(aType in this.startupChanges))
- return;
-
- this.startupChanges[aType] = this.startupChanges[aType].filter(aItem => aItem != aID);
- },
-
- /**
- * Calls all registered AddonManagerListeners with an event. Any parameters
- * after the method parameter are passed to the listener.
- *
- * @param aMethod
- * The method on the listeners to call
- */
- callManagerListeners: function(aMethod, ...aArgs) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aMethod || typeof aMethod != "string")
- throw Components.Exception("aMethod must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- let managerListeners = this.managerListeners.slice(0);
- for (let listener of managerListeners) {
- try {
- if (aMethod in listener)
- listener[aMethod].apply(listener, aArgs);
- }
- catch (e) {
- logger.warn("AddonManagerListener threw exception when calling " + aMethod, e);
- }
- }
- },
-
- /**
- * Calls all registered InstallListeners with an event. Any parameters after
- * the extraListeners parameter are passed to the listener.
- *
- * @param aMethod
- * The method on the listeners to call
- * @param aExtraListeners
- * An optional array of extra InstallListeners to also call
- * @return false if any of the listeners returned false, true otherwise
- */
- callInstallListeners: function(aMethod,
- aExtraListeners, ...aArgs) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aMethod || typeof aMethod != "string")
- throw Components.Exception("aMethod must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aExtraListeners && !Array.isArray(aExtraListeners))
- throw Components.Exception("aExtraListeners must be an array or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- let result = true;
- let listeners;
- if (aExtraListeners)
- listeners = aExtraListeners.concat(this.installListeners);
- else
- listeners = this.installListeners.slice(0);
-
- for (let listener of listeners) {
- try {
- if (aMethod in listener) {
- if (listener[aMethod].apply(listener, aArgs) === false)
- result = false;
- }
- }
- catch (e) {
- logger.warn("InstallListener threw exception when calling " + aMethod, e);
- }
- }
- return result;
- },
-
- /**
- * Calls all registered AddonListeners with an event. Any parameters after
- * the method parameter are passed to the listener.
- *
- * @param aMethod
- * The method on the listeners to call
- */
- callAddonListeners: function(aMethod, ...aArgs) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aMethod || typeof aMethod != "string")
- throw Components.Exception("aMethod must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- let addonListeners = this.addonListeners.slice(0);
- for (let listener of addonListeners) {
- try {
- if (aMethod in listener)
- listener[aMethod].apply(listener, aArgs);
- }
- catch (e) {
- logger.warn("AddonListener threw exception when calling " + aMethod, e);
- }
- }
- },
-
- /**
- * Notifies all providers that an add-on has been enabled when that type of
- * add-on only supports a single add-on being enabled at a time. This allows
- * the providers to disable theirs if necessary.
- *
- * @param aID
- * The ID of the enabled add-on
- * @param aType
- * The type of the enabled add-on
- * @param aPendingRestart
- * A boolean indicating if the change will only take place the next
- * time the application is restarted
- */
- notifyAddonChanged: function(aID, aType, aPendingRestart) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (aID && typeof aID != "string")
- throw Components.Exception("aID must be a string or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aType || typeof aType != "string")
- throw Components.Exception("aType must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- // Temporary hack until bug 520124 lands.
- // We can get here during synchronous startup, at which point it's
- // considered unsafe (and therefore disallowed by AddonManager.jsm) to
- // access providers that haven't been initialized yet. Since this is when
- // XPIProvider is starting up, XPIProvider can't access itself via APIs
- // going through AddonManager.jsm. Furthermore, LightweightThemeManager may
- // not be initialized until after XPIProvider is, and therefore would also
- // be unaccessible during XPIProvider startup. Thankfully, these are the
- // only two uses of this API, and we know it's safe to use this API with
- // both providers; so we have this hack to allow bypassing the normal
- // safetey guard.
- // The notifyAddonChanged/addonChanged API will be unneeded and therefore
- // removed by bug 520124, so this is a temporary quick'n'dirty hack.
- let providers = [...this.providers, ...this.pendingProviders];
- for (let provider of providers) {
- callProvider(provider, "addonChanged", null, aID, aType, aPendingRestart);
- }
- },
-
- /**
- * Notifies all providers they need to update the appDisabled property for
- * their add-ons in response to an application change such as a blocklist
- * update.
- */
- updateAddonAppDisabledStates: function() {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- this.callProviders("updateAddonAppDisabledStates");
- },
-
- /**
- * Notifies all providers that the repository has updated its data for
- * installed add-ons.
- *
- * @param aCallback
- * Function to call when operation is complete.
- */
- updateAddonRepositoryData: function(aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- new AsyncObjectCaller(this.providers, "updateAddonRepositoryData", {
- nextObject: function(aCaller, aProvider) {
- callProviderAsync(aProvider, "updateAddonRepositoryData",
- aCaller.callNext.bind(aCaller));
- },
- noMoreObjects: function(aCaller) {
- safeCall(aCallback);
- // only tests should care about this
- Services.obs.notifyObservers(null, "TEST:addon-repository-data-updated", null);
- }
- });
- },
-
- /**
- * Asynchronously gets an AddonInstall for a URL.
- *
- * @param aUrl
- * The string represenation of the URL the add-on is located at
- * @param aCallback
- * A callback to pass the AddonInstall to
- * @param aMimetype
- * The mimetype of the add-on
- * @param aHash
- * An optional hash of the add-on
- * @param aName
- * An optional placeholder name while the add-on is being downloaded
- * @param aIcons
- * Optional placeholder icons while the add-on is being downloaded
- * @param aVersion
- * An optional placeholder version while the add-on is being downloaded
- * @param aLoadGroup
- * An optional nsILoadGroup to associate any network requests with
- * @throws if the aUrl, aCallback or aMimetype arguments are not specified
- */
- getInstallForURL: function(aUrl, aCallback, aMimetype,
- aHash, aName, aIcons,
- aVersion, aBrowser) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aUrl || typeof aUrl != "string")
- throw Components.Exception("aURL must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aMimetype || typeof aMimetype != "string")
- throw Components.Exception("aMimetype must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aHash && typeof aHash != "string")
- throw Components.Exception("aHash must be a string or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aName && typeof aName != "string")
- throw Components.Exception("aName must be a string or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aIcons) {
- if (typeof aIcons == "string")
- aIcons = { "32": aIcons };
- else if (typeof aIcons != "object")
- throw Components.Exception("aIcons must be a string, an object or null",
- Cr.NS_ERROR_INVALID_ARG);
- } else {
- aIcons = {};
- }
-
- if (aVersion && typeof aVersion != "string")
- throw Components.Exception("aVersion must be a string or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aBrowser && (!(aBrowser instanceof Ci.nsIDOMElement)))
- throw Components.Exception("aBrowser must be a nsIDOMElement or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- let providers = [...this.providers];
- for (let provider of providers) {
- if (callProvider(provider, "supportsMimetype", false, aMimetype)) {
- callProviderAsync(provider, "getInstallForURL",
- aUrl, aHash, aName, aIcons, aVersion, aBrowser,
- function getInstallForURL_safeCall(aInstall) {
- safeCall(aCallback, aInstall);
- });
- return;
- }
- }
- safeCall(aCallback, null);
- },
-
- /**
- * Asynchronously gets an AddonInstall for an nsIFile.
- *
- * @param aFile
- * The nsIFile where the add-on is located
- * @param aCallback
- * A callback to pass the AddonInstall to
- * @param aMimetype
- * An optional mimetype hint for the add-on
- * @throws if the aFile or aCallback arguments are not specified
- */
- getInstallForFile: function(aFile, aCallback, aMimetype) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!(aFile instanceof Ci.nsIFile))
- throw Components.Exception("aFile must be a nsIFile",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aMimetype && typeof aMimetype != "string")
- throw Components.Exception("aMimetype must be a string or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- new AsyncObjectCaller(this.providers, "getInstallForFile", {
- nextObject: function(aCaller, aProvider) {
- callProviderAsync(aProvider, "getInstallForFile", aFile,
- function(aInstall) {
- if (aInstall)
- safeCall(aCallback, aInstall);
- else
- aCaller.callNext();
- });
- },
-
- noMoreObjects: function(aCaller) {
- safeCall(aCallback, null);
- }
- });
- },
-
- /**
- * Asynchronously gets all current AddonInstalls optionally limiting to a list
- * of types.
- *
- * @param aTypes
- * An optional array of types to retrieve. Each type is a string name
- * @param aCallback
- * A callback which will be passed an array of AddonInstalls
- * @throws If the aCallback argument is not specified
- */
- getInstallsByTypes: function(aTypes, aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (aTypes && !Array.isArray(aTypes))
- throw Components.Exception("aTypes must be an array or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- let installs = [];
-
- new AsyncObjectCaller(this.providers, "getInstallsByTypes", {
- nextObject: function(aCaller, aProvider) {
- callProviderAsync(aProvider, "getInstallsByTypes", aTypes,
- function(aProviderInstalls) {
- if (aProviderInstalls) {
- installs = installs.concat(aProviderInstalls);
- }
- aCaller.callNext();
- });
- },
-
- noMoreObjects: function(aCaller) {
- safeCall(aCallback, installs);
- }
- });
- },
-
- /**
- * Asynchronously gets all current AddonInstalls.
- *
- * @param aCallback
- * A callback which will be passed an array of AddonInstalls
- */
- getAllInstalls: function(aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- this.getInstallsByTypes(null, aCallback);
- },
-
- /**
- * Synchronously map a URI to the corresponding Addon ID.
- *
- * Mappable URIs are limited to in-application resources belonging to the
- * add-on, such as Javascript compartments, XUL windows, XBL bindings, etc.
- * but do not include URIs from meta data, such as the add-on homepage.
- *
- * @param aURI
- * nsIURI to map to an addon id
- * @return string containing the Addon ID or null
- * @see amIAddonManager.mapURIToAddonID
- */
- mapURIToAddonID: function(aURI) {
- if (!(aURI instanceof Ci.nsIURI)) {
- throw Components.Exception("aURI is not a nsIURI",
- Cr.NS_ERROR_INVALID_ARG);
- }
-
- // Try all providers
- let providers = [...this.providers];
- for (let provider of providers) {
- var id = callProvider(provider, "mapURIToAddonID", null, aURI);
- if (id !== null) {
- return id;
- }
- }
-
- return null;
- },
-
- /**
- * Checks whether installation is enabled for a particular mimetype.
- *
- * @param aMimetype
- * The mimetype to check
- * @return true if installation is enabled for the mimetype
- */
- isInstallEnabled: function(aMimetype) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aMimetype || typeof aMimetype != "string")
- throw Components.Exception("aMimetype must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- let providers = [...this.providers];
- for (let provider of providers) {
- if (callProvider(provider, "supportsMimetype", false, aMimetype) &&
- callProvider(provider, "isInstallEnabled"))
- return true;
- }
- return false;
- },
-
- /**
- * Checks whether a particular source is allowed to install add-ons of a
- * given mimetype.
- *
- * @param aMimetype
- * The mimetype of the add-on
- * @param aInstallingPrincipal
- * The nsIPrincipal that initiated the install
- * @return true if the source is allowed to install this mimetype
- */
- isInstallAllowed: function(aMimetype, aInstallingPrincipal) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aMimetype || typeof aMimetype != "string")
- throw Components.Exception("aMimetype must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aInstallingPrincipal || !(aInstallingPrincipal instanceof Ci.nsIPrincipal))
- throw Components.Exception("aInstallingPrincipal must be a nsIPrincipal",
- Cr.NS_ERROR_INVALID_ARG);
-
- let providers = [...this.providers];
- for (let provider of providers) {
- if (callProvider(provider, "supportsMimetype", false, aMimetype) &&
- callProvider(provider, "isInstallAllowed", null, aInstallingPrincipal))
- return true;
- }
- return false;
- },
-
- /**
- * Starts installation of an array of AddonInstalls notifying the registered
- * web install listener of blocked or started installs.
- *
- * @param aMimetype
- * The mimetype of add-ons being installed
- * @param aBrowser
- * The optional browser element that started the installs
- * @param aInstallingPrincipal
- * The nsIPrincipal that initiated the install
- * @param aInstalls
- * The array of AddonInstalls to be installed
- */
- installAddonsFromWebpage: function(aMimetype, aBrowser,
- aInstallingPrincipal, aInstalls) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aMimetype || typeof aMimetype != "string")
- throw Components.Exception("aMimetype must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (aBrowser && !(aBrowser instanceof Ci.nsIDOMElement))
- throw Components.Exception("aSource must be a nsIDOMElement, or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aInstallingPrincipal || !(aInstallingPrincipal instanceof Ci.nsIPrincipal))
- throw Components.Exception("aInstallingPrincipal must be a nsIPrincipal",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!Array.isArray(aInstalls))
- throw Components.Exception("aInstalls must be an array",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!("@mozilla.org/addons/web-install-listener;1" in Cc)) {
- logger.warn("No web installer available, cancelling all installs");
- for (let install of aInstalls)
- install.cancel();
- return;
- }
-
- // When a chrome in-content UI has loaded a <browser> inside to host a
- // website we want to do our security checks on the inner-browser but
- // notify front-end that install events came from the outer-browser (the
- // main tab's browser). Check this by seeing if the browser we've been
- // passed is in a content type docshell and if so get the outer-browser.
- let topBrowser = aBrowser;
- let docShell = aBrowser.ownerDocument.defaultView
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIDocShellTreeItem);
- if (docShell.itemType == Ci.nsIDocShellTreeItem.typeContent)
- topBrowser = docShell.chromeEventHandler;
-
- try {
- let weblistener = Cc["@mozilla.org/addons/web-install-listener;1"].
- getService(Ci.amIWebInstallListener);
-
- if (!this.isInstallEnabled(aMimetype)) {
- for (let install of aInstalls)
- install.cancel();
-
- weblistener.onWebInstallDisabled(topBrowser, aInstallingPrincipal.URI,
- aInstalls, aInstalls.length);
- return;
- }
- else if (!aBrowser.contentPrincipal || !aInstallingPrincipal.subsumes(aBrowser.contentPrincipal)) {
- for (let install of aInstalls)
- install.cancel();
-
- if (weblistener instanceof Ci.amIWebInstallListener2) {
- weblistener.onWebInstallOriginBlocked(topBrowser, aInstallingPrincipal.URI,
- aInstalls, aInstalls.length);
- }
- return;
- }
-
- // The installs may start now depending on the web install listener,
- // listen for the browser navigating to a new origin and cancel the
- // installs in that case.
- new BrowserListener(aBrowser, aInstallingPrincipal, aInstalls);
-
- if (!this.isInstallAllowed(aMimetype, aInstallingPrincipal)) {
- if (weblistener.onWebInstallBlocked(topBrowser, aInstallingPrincipal.URI,
- aInstalls, aInstalls.length)) {
- for (let install of aInstalls)
- install.install();
- }
- }
- else if (weblistener.onWebInstallRequested(topBrowser, aInstallingPrincipal.URI,
- aInstalls, aInstalls.length)) {
- for (let install of aInstalls)
- install.install();
- }
- }
- catch (e) {
- // In the event that the weblistener throws during instantiation or when
- // calling onWebInstallBlocked or onWebInstallRequested all of the
- // installs should get cancelled.
- logger.warn("Failure calling web installer", e);
- for (let install of aInstalls)
- install.cancel();
- }
- },
-
- /**
- * Adds a new InstallListener if the listener is not already registered.
- *
- * @param aListener
- * The InstallListener to add
- */
- addInstallListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be a InstallListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!this.installListeners.some(function(i) {
- return i == aListener; }))
- this.installListeners.push(aListener);
- },
-
- /**
- * Removes an InstallListener if the listener is registered.
- *
- * @param aListener
- * The InstallListener to remove
- */
- removeInstallListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be a InstallListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- let pos = 0;
- while (pos < this.installListeners.length) {
- if (this.installListeners[pos] == aListener)
- this.installListeners.splice(pos, 1);
- else
- pos++;
- }
- },
- /*
- * Adds new or overrides existing UpgradeListener.
- *
- * @param aInstanceID
- * The instance ID of an addon to register a listener for.
- * @param aCallback
- * The callback to invoke when updates are available for this addon.
- * @throws if there is no addon matching the instanceID
- */
- addUpgradeListener: function(aInstanceID, aCallback) {
- if (!aInstanceID || typeof aInstanceID != "symbol")
- throw Components.Exception("aInstanceID must be a symbol",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!aCallback || typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- this.getAddonByInstanceID(aInstanceID).then(wrapper => {
- if (!wrapper) {
- throw Error("No addon matching instanceID:", aInstanceID.toString());
- }
- let addonId = wrapper.addonId();
- logger.debug(`Registering upgrade listener for ${addonId}`);
- this.upgradeListeners.set(addonId, aCallback);
- });
- },
-
- /**
- * Removes an UpgradeListener if the listener is registered.
- *
- * @param aInstanceID
- * The instance ID of the addon to remove
- */
- removeUpgradeListener: function(aInstanceID) {
- if (!aInstanceID || typeof aInstanceID != "symbol")
- throw Components.Exception("aInstanceID must be a symbol",
- Cr.NS_ERROR_INVALID_ARG);
-
- this.getAddonByInstanceID(aInstanceID).then(addon => {
- if (!addon) {
- throw Error("No addon for instanceID:", aInstanceID.toString());
- }
- if (this.upgradeListeners.has(addon.id)) {
- this.upgradeListeners.delete(addon.id);
- } else {
- throw Error("No upgrade listener registered for addon ID:", addon.id);
- }
- });
- },
-
- /**
- * Installs a temporary add-on from a local file or directory.
- * @param aFile
- * An nsIFile for the file or directory of the add-on to be
- * temporarily installed.
- * @return a Promise that rejects if the add-on is not a valid restartless
- * add-on or if the same ID is already temporarily installed.
- */
- installTemporaryAddon: function(aFile) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!(aFile instanceof Ci.nsIFile))
- throw Components.Exception("aFile must be a nsIFile",
- Cr.NS_ERROR_INVALID_ARG);
-
- return AddonManagerInternal._getProviderByName("XPIProvider")
- .installTemporaryAddon(aFile);
- },
-
- installAddonFromSources: function(aFile) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!(aFile instanceof Ci.nsIFile))
- throw Components.Exception("aFile must be a nsIFile",
- Cr.NS_ERROR_INVALID_ARG);
-
- return AddonManagerInternal._getProviderByName("XPIProvider")
- .installAddonFromSources(aFile);
- },
-
- /**
- * Returns an Addon corresponding to an instance ID.
- * @param aInstanceID
- * An Addon Instance ID symbol
- * @return {Promise}
- * @resolves The found Addon or null if no such add-on exists.
- * @rejects Never
- * @throws if the aInstanceID argument is not specified
- * or the AddonManager is not initialized
- */
- getAddonByInstanceID: function(aInstanceID) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aInstanceID || typeof aInstanceID != "symbol")
- throw Components.Exception("aInstanceID must be a Symbol()",
- Cr.NS_ERROR_INVALID_ARG);
-
- return AddonManagerInternal._getProviderByName("XPIProvider")
- .getAddonByInstanceID(aInstanceID);
- },
-
- /**
- * Gets an icon from the icon set provided by the add-on
- * that is closest to the specified size.
- *
- * The optional window parameter will be used to determine
- * the screen resolution and select a more appropriate icon.
- * Calling this method with 48px on retina screens will try to
- * match an icon of size 96px.
- *
- * @param aAddon
- * An addon object, meaning:
- * An object with either an icons property that is a key-value
- * list of icon size and icon URL, or an object having an iconURL
- * and icon64URL property.
- * @param aSize
- * Ideal icon size in pixels
- * @param aWindow
- * Optional window object for determining the correct scale.
- * @return {String} The absolute URL of the icon or null if the addon doesn't have icons
- */
- getPreferredIconURL: function(aAddon, aSize, aWindow = undefined) {
- if (aWindow && aWindow.devicePixelRatio) {
- aSize *= aWindow.devicePixelRatio;
- }
-
- let icons = aAddon.icons;
-
- // certain addon-types only have iconURLs
- if (!icons) {
- icons = {};
- if (aAddon.iconURL) {
- icons[32] = aAddon.iconURL;
- icons[48] = aAddon.iconURL;
- }
- if (aAddon.icon64URL) {
- icons[64] = aAddon.icon64URL;
- }
- }
-
- // quick return if the exact size was found
- if (icons[aSize]) {
- return icons[aSize];
- }
-
- let bestSize = null;
-
- for (let size of Object.keys(icons)) {
- if (!INTEGER.test(size)) {
- throw Components.Exception("Invalid icon size, must be an integer",
- Cr.NS_ERROR_ILLEGAL_VALUE);
- }
-
- size = parseInt(size, 10);
-
- if (!bestSize) {
- bestSize = size;
- continue;
- }
-
- if (size > aSize && bestSize > aSize) {
- // If both best size and current size are larger than the wanted size then choose
- // the one closest to the wanted size
- bestSize = Math.min(bestSize, size);
- }
- else {
- // Otherwise choose the largest of the two so we'll prefer sizes as close to below aSize
- // or above aSize
- bestSize = Math.max(bestSize, size);
- }
- }
-
- return icons[bestSize] || null;
- },
-
- /**
- * Asynchronously gets an add-on with a specific ID.
- *
- * @param aID
- * The ID of the add-on to retrieve
- * @return {Promise}
- * @resolves The found Addon or null if no such add-on exists.
- * @rejects Never
- * @throws if the aID argument is not specified
- */
- getAddonByID: function(aID) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aID || typeof aID != "string")
- throw Components.Exception("aID must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- let promises = Array.from(this.providers,
- p => promiseCallProvider(p, "getAddonByID", aID));
- return Promise.all(promises).then(aAddons => {
- return aAddons.find(a => !!a) || null;
- });
- },
-
- /**
- * Asynchronously get an add-on with a specific Sync GUID.
- *
- * @param aGUID
- * String GUID of add-on to retrieve
- * @param aCallback
- * The callback to pass the retrieved add-on to.
- * @throws if the aGUID or aCallback arguments are not specified
- */
- getAddonBySyncGUID: function(aGUID, aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!aGUID || typeof aGUID != "string")
- throw Components.Exception("aGUID must be a non-empty string",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- new AsyncObjectCaller(this.providers, "getAddonBySyncGUID", {
- nextObject: function(aCaller, aProvider) {
- callProviderAsync(aProvider, "getAddonBySyncGUID", aGUID,
- function(aAddon) {
- if (aAddon) {
- safeCall(aCallback, aAddon);
- } else {
- aCaller.callNext();
- }
- });
- },
-
- noMoreObjects: function(aCaller) {
- safeCall(aCallback, null);
- }
- });
- },
-
- /**
- * Asynchronously gets an array of add-ons.
- *
- * @param aIDs
- * The array of IDs to retrieve
- * @return {Promise}
- * @resolves The array of found add-ons.
- * @rejects Never
- * @throws if the aIDs argument is not specified
- */
- getAddonsByIDs: function(aIDs) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (!Array.isArray(aIDs))
- throw Components.Exception("aIDs must be an array",
- Cr.NS_ERROR_INVALID_ARG);
-
- let promises = aIDs.map(a => AddonManagerInternal.getAddonByID(a));
- return Promise.all(promises);
- },
-
- /**
- * Asynchronously gets add-ons of specific types.
- *
- * @param aTypes
- * An optional array of types to retrieve. Each type is a string name
- * @param aCallback
- * The callback to pass an array of Addons to.
- * @throws if the aCallback argument is not specified
- */
- getAddonsByTypes: function(aTypes, aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (aTypes && !Array.isArray(aTypes))
- throw Components.Exception("aTypes must be an array or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- let addons = [];
-
- new AsyncObjectCaller(this.providers, "getAddonsByTypes", {
- nextObject: function(aCaller, aProvider) {
- callProviderAsync(aProvider, "getAddonsByTypes", aTypes,
- function(aProviderAddons) {
- if (aProviderAddons) {
- addons = addons.concat(aProviderAddons);
- }
- aCaller.callNext();
- });
- },
-
- noMoreObjects: function(aCaller) {
- safeCall(aCallback, addons);
- }
- });
- },
-
- /**
- * Asynchronously gets all installed add-ons.
- *
- * @param aCallback
- * A callback which will be passed an array of Addons
- */
- getAllAddons: function(aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- this.getAddonsByTypes(null, aCallback);
- },
-
- /**
- * Asynchronously gets add-ons that have operations waiting for an application
- * restart to complete.
- *
- * @param aTypes
- * An optional array of types to retrieve. Each type is a string name
- * @param aCallback
- * The callback to pass the array of Addons to
- * @throws if the aCallback argument is not specified
- */
- getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
- if (!gStarted)
- throw Components.Exception("AddonManager is not initialized",
- Cr.NS_ERROR_NOT_INITIALIZED);
-
- if (aTypes && !Array.isArray(aTypes))
- throw Components.Exception("aTypes must be an array or null",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- let addons = [];
-
- new AsyncObjectCaller(this.providers, "getAddonsWithOperationsByTypes", {
- nextObject: function getAddonsWithOperationsByTypes_nextObject
- (aCaller, aProvider) {
- callProviderAsync(aProvider, "getAddonsWithOperationsByTypes", aTypes,
- function getAddonsWithOperationsByTypes_concatAddons
- (aProviderAddons) {
- if (aProviderAddons) {
- addons = addons.concat(aProviderAddons);
- }
- aCaller.callNext();
- });
- },
-
- noMoreObjects: function(caller) {
- safeCall(aCallback, addons);
- }
- });
- },
-
- /**
- * Adds a new AddonManagerListener if the listener is not already registered.
- *
- * @param aListener
- * The listener to add
- */
- addManagerListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be an AddonManagerListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!this.managerListeners.some(i => i == aListener))
- this.managerListeners.push(aListener);
- },
-
- /**
- * Removes an AddonManagerListener if the listener is registered.
- *
- * @param aListener
- * The listener to remove
- */
- removeManagerListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be an AddonManagerListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- let pos = 0;
- while (pos < this.managerListeners.length) {
- if (this.managerListeners[pos] == aListener)
- this.managerListeners.splice(pos, 1);
- else
- pos++;
- }
- },
-
- /**
- * Adds a new AddonListener if the listener is not already registered.
- *
- * @param aListener
- * The AddonListener to add
- */
- addAddonListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be an AddonListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!this.addonListeners.some(i => i == aListener))
- this.addonListeners.push(aListener);
- },
-
- /**
- * Removes an AddonListener if the listener is registered.
- *
- * @param aListener
- * The AddonListener to remove
- */
- removeAddonListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be an AddonListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- let pos = 0;
- while (pos < this.addonListeners.length) {
- if (this.addonListeners[pos] == aListener)
- this.addonListeners.splice(pos, 1);
- else
- pos++;
- }
- },
-
- /**
- * Adds a new TypeListener if the listener is not already registered.
- *
- * @param aListener
- * The TypeListener to add
- */
- addTypeListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be a TypeListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!this.typeListeners.some(i => i == aListener))
- this.typeListeners.push(aListener);
- },
-
- /**
- * Removes an TypeListener if the listener is registered.
- *
- * @param aListener
- * The TypeListener to remove
- */
- removeTypeListener: function(aListener) {
- if (!aListener || typeof aListener != "object")
- throw Components.Exception("aListener must be a TypeListener object",
- Cr.NS_ERROR_INVALID_ARG);
-
- let pos = 0;
- while (pos < this.typeListeners.length) {
- if (this.typeListeners[pos] == aListener)
- this.typeListeners.splice(pos, 1);
- else
- pos++;
- }
- },
-
- get addonTypes() {
- // A read-only wrapper around the types dictionary
- return new Proxy(this.types, {
- defineProperty(target, property, descriptor) {
- // Not allowed to define properties
- return false;
- },
-
- deleteProperty(target, property) {
- // Not allowed to delete properties
- return false;
- },
-
- get(target, property, receiver) {
- if (!target.hasOwnProperty(property))
- return undefined;
-
- return target[property].type;
- },
-
- getOwnPropertyDescriptor(target, property) {
- if (!target.hasOwnProperty(property))
- return undefined;
-
- return {
- value: target[property].type,
- writable: false,
- // Claim configurability to maintain the proxy invariants.
- configurable: true,
- enumerable: true
- }
- },
-
- preventExtensions(target) {
- // Not allowed to prevent adding new properties
- return false;
- },
-
- set(target, property, value, receiver) {
- // Not allowed to set properties
- return false;
- },
-
- setPrototypeOf(target, prototype) {
- // Not allowed to change prototype
- return false;
- }
- });
- },
-
- get autoUpdateDefault() {
- return gAutoUpdateDefault;
- },
-
- set autoUpdateDefault(aValue) {
- aValue = !!aValue;
- if (aValue != gAutoUpdateDefault)
- Services.prefs.setBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, aValue);
- return aValue;
- },
-
- get checkCompatibility() {
- return gCheckCompatibility;
- },
-
- set checkCompatibility(aValue) {
- aValue = !!aValue;
- if (aValue != gCheckCompatibility) {
- if (!aValue)
- Services.prefs.setBoolPref(PREF_EM_CHECK_COMPATIBILITY, false);
- else
- Services.prefs.clearUserPref(PREF_EM_CHECK_COMPATIBILITY);
- }
- return aValue;
- },
-
- get strictCompatibility() {
- return gStrictCompatibility;
- },
-
- set strictCompatibility(aValue) {
- aValue = !!aValue;
- if (aValue != gStrictCompatibility)
- Services.prefs.setBoolPref(PREF_EM_STRICT_COMPATIBILITY, aValue);
- return aValue;
- },
-
- get checkUpdateSecurityDefault() {
- return gCheckUpdateSecurityDefault;
- },
-
- get checkUpdateSecurity() {
- return gCheckUpdateSecurity;
- },
-
- set checkUpdateSecurity(aValue) {
- aValue = !!aValue;
- if (aValue != gCheckUpdateSecurity) {
- if (aValue != gCheckUpdateSecurityDefault)
- Services.prefs.setBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, aValue);
- else
- Services.prefs.clearUserPref(PREF_EM_CHECK_UPDATE_SECURITY);
- }
- return aValue;
- },
-
- get updateEnabled() {
- return gUpdateEnabled;
- },
-
- set updateEnabled(aValue) {
- aValue = !!aValue;
- if (aValue != gUpdateEnabled)
- Services.prefs.setBoolPref(PREF_EM_UPDATE_ENABLED, aValue);
- return aValue;
- },
-
- get hotfixID() {
- return gHotfixID;
- },
-
- webAPI: {
- // installs maps integer ids to AddonInstall instances.
- installs: new Map(),
- nextInstall: 0,
-
- sendEvent: null,
- setEventHandler(fn) {
- this.sendEvent = fn;
- },
-
- getAddonByID(target, id) {
- return new Promise(resolve => {
- AddonManager.getAddonByID(id, (addon) => {
- resolve(webAPIForAddon(addon));
- });
- });
- },
-
- // helper to copy (and convert) the properties we care about
- copyProps(install, obj) {
- obj.state = AddonManager.stateToString(install.state);
- obj.error = AddonManager.errorToString(install.error);
- obj.progress = install.progress;
- obj.maxProgress = install.maxProgress;
- },
-
- makeListener(id, mm) {
- const events = [
- "onDownloadStarted",
- "onDownloadProgress",
- "onDownloadEnded",
- "onDownloadCancelled",
- "onDownloadFailed",
- "onInstallStarted",
- "onInstallEnded",
- "onInstallCancelled",
- "onInstallFailed",
- ];
-
- let listener = {};
- events.forEach(event => {
- listener[event] = (install) => {
- let data = {event, id};
- AddonManager.webAPI.copyProps(install, data);
- this.sendEvent(mm, data);
- }
- });
- return listener;
- },
-
- forgetInstall(id) {
- let info = this.installs.get(id);
- if (!info) {
- throw new Error(`forgetInstall cannot find ${id}`);
- }
- info.install.removeListener(info.listener);
- this.installs.delete(id);
- },
-
- createInstall(target, options) {
- // Throw an appropriate error if the given URL is not valid
- // as an installation source. Return silently if it is okay.
- function checkInstallUrl(url) {
- let host = Services.io.newURI(options.url, null, null).host;
- if (WEBAPI_INSTALL_HOSTS.includes(host)) {
- return;
- }
- if (Services.prefs.getBoolPref(PREF_WEBAPI_TESTING)
- && WEBAPI_TEST_INSTALL_HOSTS.includes(host)) {
- return;
- }
-
- throw new Error(`Install from ${host} not permitted`);
- }
-
- return new Promise((resolve, reject) => {
- try {
- checkInstallUrl(options.url);
- } catch (err) {
- reject({message: err.message});
- return;
- }
-
- let newInstall = install => {
- let id = this.nextInstall++;
- let listener = this.makeListener(id, target.messageManager);
- install.addListener(listener);
-
- this.installs.set(id, {install, target, listener});
-
- let result = {id};
- this.copyProps(install, result);
- resolve(result);
- };
- AddonManager.getInstallForURL(options.url, newInstall, "application/x-xpinstall", options.hash);
- });
- },
-
- addonUninstall(target, id) {
- return new Promise(resolve => {
- AddonManager.getAddonByID(id, addon => {
- if (!addon) {
- resolve(false);
- }
-
- try {
- addon.uninstall();
- resolve(true);
- } catch (err) {
- Cu.reportError(err);
- resolve(false);
- }
- });
- });
- },
-
- addonSetEnabled(target, id, value) {
- return new Promise((resolve, reject) => {
- AddonManager.getAddonByID(id, addon => {
- if (!addon) {
- reject({message: `No such addon ${id}`});
- }
- addon.userDisabled = !value;
- resolve();
- });
- });
- },
-
- addonInstallDoInstall(target, id) {
- let state = this.installs.get(id);
- if (!state) {
- return Promise.reject(`invalid id ${id}`);
- }
- return Promise.resolve(state.install.install());
- },
-
- addonInstallCancel(target, id) {
- let state = this.installs.get(id);
- if (!state) {
- return Promise.reject(`invalid id ${id}`);
- }
- return Promise.resolve(state.install.cancel());
- },
-
- clearInstalls(ids) {
- for (let id of ids) {
- this.forgetInstall(id);
- }
- },
-
- clearInstallsFrom(mm) {
- for (let [id, info] of this.installs) {
- if (info.target.messageManager == mm) {
- this.forgetInstall(id);
- }
- }
- },
- },
-};
-
-/**
- * Should not be used outside of core Mozilla code. This is a private API for
- * the startup and platform integration code to use. Refer to the methods on
- * AddonManagerInternal for documentation however note that these methods are
- * subject to change at any time.
- */
-this.AddonManagerPrivate = {
- startup: function() {
- AddonManagerInternal.startup();
- },
-
- registerProvider: function(aProvider, aTypes) {
- AddonManagerInternal.registerProvider(aProvider, aTypes);
- },
-
- unregisterProvider: function(aProvider) {
- AddonManagerInternal.unregisterProvider(aProvider);
- },
-
- markProviderSafe: function(aProvider) {
- AddonManagerInternal.markProviderSafe(aProvider);
- },
-
- backgroundUpdateCheck: function() {
- return AddonManagerInternal.backgroundUpdateCheck();
- },
-
- backgroundUpdateTimerHandler() {
- // Don't call through to the real update check if no checks are enabled.
- let checkHotfix = AddonManagerInternal.hotfixID &&
- Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED) &&
- Services.prefs.getBoolPref(PREF_APP_UPDATE_AUTO);
-
- if (!AddonManagerInternal.updateEnabled && !checkHotfix) {
- logger.info("Skipping background update check");
- return;
- }
- // Don't return the promise here, since the caller doesn't care.
- AddonManagerInternal.backgroundUpdateCheck();
- },
-
- addStartupChange: function(aType, aID) {
- AddonManagerInternal.addStartupChange(aType, aID);
- },
-
- removeStartupChange: function(aType, aID) {
- AddonManagerInternal.removeStartupChange(aType, aID);
- },
-
- notifyAddonChanged: function(aID, aType, aPendingRestart) {
- AddonManagerInternal.notifyAddonChanged(aID, aType, aPendingRestart);
- },
-
- updateAddonAppDisabledStates: function() {
- AddonManagerInternal.updateAddonAppDisabledStates();
- },
-
- updateAddonRepositoryData: function(aCallback) {
- AddonManagerInternal.updateAddonRepositoryData(aCallback);
- },
-
- callInstallListeners: function(...aArgs) {
- return AddonManagerInternal.callInstallListeners.apply(AddonManagerInternal,
- aArgs);
- },
-
- callAddonListeners: function(...aArgs) {
- AddonManagerInternal.callAddonListeners.apply(AddonManagerInternal, aArgs);
- },
-
- AddonAuthor: AddonAuthor,
-
- AddonScreenshot: AddonScreenshot,
-
- AddonCompatibilityOverride: AddonCompatibilityOverride,
-
- AddonType: AddonType,
-
- recordTimestamp: function(name, value) {
- AddonManagerInternal.recordTimestamp(name, value);
- },
-
- _simpleMeasures: {},
- recordSimpleMeasure: function(name, value) {
- this._simpleMeasures[name] = value;
- },
-
- recordException: function(aModule, aContext, aException) {
- let report = {
- module: aModule,
- context: aContext
- };
-
- if (typeof aException == "number") {
- report.message = Components.Exception("", aException).name;
- }
- else {
- report.message = aException.toString();
- if (aException.fileName) {
- report.file = aException.fileName;
- report.line = aException.lineNumber;
- }
- }
-
- this._simpleMeasures.exception = report;
- },
-
- getSimpleMeasures: function() {
- return this._simpleMeasures;
- },
-
- getTelemetryDetails: function() {
- return AddonManagerInternal.telemetryDetails;
- },
-
- setTelemetryDetails: function(aProvider, aDetails) {
- AddonManagerInternal.telemetryDetails[aProvider] = aDetails;
- },
-
- // Start a timer, record a simple measure of the time interval when
- // timer.done() is called
- simpleTimer: function(aName) {
- let startTime = Cu.now();
- return {
- done: () => this.recordSimpleMeasure(aName, Math.round(Cu.now() - startTime))
- };
- },
-
- /**
- * Helper to call update listeners when no update is available.
- *
- * This can be used as an implementation for Addon.findUpdates() when
- * no update mechanism is available.
- */
- callNoUpdateListeners: function(addon, listener, reason, appVersion, platformVersion) {
- if ("onNoCompatibilityUpdateAvailable" in listener) {
- safeCall(listener.onNoCompatibilityUpdateAvailable.bind(listener), addon);
- }
- if ("onNoUpdateAvailable" in listener) {
- safeCall(listener.onNoUpdateAvailable.bind(listener), addon);
- }
- if ("onUpdateFinished" in listener) {
- safeCall(listener.onUpdateFinished.bind(listener), addon);
- }
- },
-
- get webExtensionsMinPlatformVersion() {
- return gWebExtensionsMinPlatformVersion;
- },
-
- hasUpgradeListener: function(aId) {
- return AddonManagerInternal.upgradeListeners.has(aId);
- },
-
- getUpgradeListener: function(aId) {
- return AddonManagerInternal.upgradeListeners.get(aId);
- },
-};
-
-/**
- * This is the public API that UI and developers should be calling. All methods
- * just forward to AddonManagerInternal.
- */
-this.AddonManager = {
- // Constants for the AddonInstall.state property
- // These will show up as AddonManager.STATE_* (eg, STATE_AVAILABLE)
- _states: new Map([
- // The install is available for download.
- ["STATE_AVAILABLE", 0],
- // The install is being downloaded.
- ["STATE_DOWNLOADING", 1],
- // The install is checking for compatibility information.
- ["STATE_CHECKING", 2],
- // The install is downloaded and ready to install.
- ["STATE_DOWNLOADED", 3],
- // The download failed.
- ["STATE_DOWNLOAD_FAILED", 4],
- // The install has been postponed.
- ["STATE_POSTPONED", 5],
- // The add-on is being installed.
- ["STATE_INSTALLING", 6],
- // The add-on has been installed.
- ["STATE_INSTALLED", 7],
- // The install failed.
- ["STATE_INSTALL_FAILED", 8],
- // The install has been cancelled.
- ["STATE_CANCELLED", 9],
- ]),
-
- // Constants representing different types of errors while downloading an
- // add-on.
- // These will show up as AddonManager.ERROR_* (eg, ERROR_NETWORK_FAILURE)
- _errors: new Map([
- // The download failed due to network problems.
- ["ERROR_NETWORK_FAILURE", -1],
- // The downloaded file did not match the provided hash.
- ["ERROR_INCORRECT_HASH", -2],
- // The downloaded file seems to be corrupted in some way.
- ["ERROR_CORRUPT_FILE", -3],
- // An error occured trying to write to the filesystem.
- ["ERROR_FILE_ACCESS", -4],
- // The add-on must be signed and isn't.
- ["ERROR_SIGNEDSTATE_REQUIRED", -5],
- // The downloaded add-on had a different type than expected.
- ["ERROR_UNEXPECTED_ADDON_TYPE", -6],
- // The addon did not have the expected ID
- ["ERROR_INCORRECT_ID", -7],
- ]),
-
- // These must be kept in sync with AddonUpdateChecker.
- // No error was encountered.
- UPDATE_STATUS_NO_ERROR: 0,
- // The update check timed out
- UPDATE_STATUS_TIMEOUT: -1,
- // There was an error while downloading the update information.
- UPDATE_STATUS_DOWNLOAD_ERROR: -2,
- // The update information was malformed in some way.
- UPDATE_STATUS_PARSE_ERROR: -3,
- // The update information was not in any known format.
- UPDATE_STATUS_UNKNOWN_FORMAT: -4,
- // The update information was not correctly signed or there was an SSL error.
- UPDATE_STATUS_SECURITY_ERROR: -5,
- // The update was cancelled.
- UPDATE_STATUS_CANCELLED: -6,
-
- // Constants to indicate why an update check is being performed
- // Update check has been requested by the user.
- UPDATE_WHEN_USER_REQUESTED: 1,
- // Update check is necessary to see if the Addon is compatibile with a new
- // version of the application.
- UPDATE_WHEN_NEW_APP_DETECTED: 2,
- // Update check is necessary because a new application has been installed.
- UPDATE_WHEN_NEW_APP_INSTALLED: 3,
- // Update check is a regular background update check.
- UPDATE_WHEN_PERIODIC_UPDATE: 16,
- // Update check is needed to check an Addon that is being installed.
- UPDATE_WHEN_ADDON_INSTALLED: 17,
-
- // Constants for operations in Addon.pendingOperations
- // Indicates that the Addon has no pending operations.
- PENDING_NONE: 0,
- // Indicates that the Addon will be enabled after the application restarts.
- PENDING_ENABLE: 1,
- // Indicates that the Addon will be disabled after the application restarts.
- PENDING_DISABLE: 2,
- // Indicates that the Addon will be uninstalled after the application restarts.
- PENDING_UNINSTALL: 4,
- // Indicates that the Addon will be installed after the application restarts.
- PENDING_INSTALL: 8,
- PENDING_UPGRADE: 16,
-
- // Constants for operations in Addon.operationsRequiringRestart
- // Indicates that restart isn't required for any operation.
- OP_NEEDS_RESTART_NONE: 0,
- // Indicates that restart is required for enabling the addon.
- OP_NEEDS_RESTART_ENABLE: 1,
- // Indicates that restart is required for disabling the addon.
- OP_NEEDS_RESTART_DISABLE: 2,
- // Indicates that restart is required for uninstalling the addon.
- OP_NEEDS_RESTART_UNINSTALL: 4,
- // Indicates that restart is required for installing the addon.
- OP_NEEDS_RESTART_INSTALL: 8,
-
- // Constants for permissions in Addon.permissions.
- // Indicates that the Addon can be uninstalled.
- PERM_CAN_UNINSTALL: 1,
- // Indicates that the Addon can be enabled by the user.
- PERM_CAN_ENABLE: 2,
- // Indicates that the Addon can be disabled by the user.
- PERM_CAN_DISABLE: 4,
- // Indicates that the Addon can be upgraded.
- PERM_CAN_UPGRADE: 8,
- // Indicates that the Addon can be set to be optionally enabled
- // on a case-by-case basis.
- PERM_CAN_ASK_TO_ACTIVATE: 16,
-
- // General descriptions of where items are installed.
- // Installed in this profile.
- SCOPE_PROFILE: 1,
- // Installed for all of this user's profiles.
- SCOPE_USER: 2,
- // Installed and owned by the application.
- SCOPE_APPLICATION: 4,
- // Installed for all users of the computer.
- SCOPE_SYSTEM: 8,
- // Installed temporarily
- SCOPE_TEMPORARY: 16,
- // The combination of all scopes.
- SCOPE_ALL: 31,
-
- // Add-on type is expected to be displayed in the UI in a list.
- VIEW_TYPE_LIST: "list",
-
- // Constants describing how add-on types behave.
-
- // If no add-ons of a type are installed, then the category for that add-on
- // type should be hidden in the UI.
- TYPE_UI_HIDE_EMPTY: 16,
- // Indicates that this add-on type supports the ask-to-activate state.
- // That is, add-ons of this type can be set to be optionally enabled
- // on a case-by-case basis.
- TYPE_SUPPORTS_ASK_TO_ACTIVATE: 32,
- // The add-on type natively supports undo for restartless uninstalls.
- // If this flag is not specified, the UI is expected to handle this via
- // disabling the add-on, and performing the actual uninstall at a later time.
- TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL: 64,
-
- // Constants for Addon.applyBackgroundUpdates.
- // Indicates that the Addon should not update automatically.
- AUTOUPDATE_DISABLE: 0,
- // Indicates that the Addon should update automatically only if
- // that's the global default.
- AUTOUPDATE_DEFAULT: 1,
- // Indicates that the Addon should update automatically.
- AUTOUPDATE_ENABLE: 2,
-
- // Constants for how Addon options should be shown.
- // Options will be opened in a new window
- OPTIONS_TYPE_DIALOG: 1,
- // Options will be displayed within the AM detail view
- OPTIONS_TYPE_INLINE: 2,
- // Options will be displayed in a new tab, if possible
- OPTIONS_TYPE_TAB: 3,
- // Same as OPTIONS_TYPE_INLINE, but no Preferences button will be shown.
- // Used to indicate that only non-interactive information will be shown.
- OPTIONS_TYPE_INLINE_INFO: 4,
- // Similar to OPTIONS_TYPE_INLINE, but rather than generating inline
- // options from a specially-formatted XUL file, the contents of the
- // file are simply displayed in an inline <browser> element.
- OPTIONS_TYPE_INLINE_BROWSER: 5,
-
- // Constants for displayed or hidden options notifications
- // Options notification will be displayed
- OPTIONS_NOTIFICATION_DISPLAYED: "addon-options-displayed",
- // Options notification will be hidden
- OPTIONS_NOTIFICATION_HIDDEN: "addon-options-hidden",
-
- // Constants for getStartupChanges, addStartupChange and removeStartupChange
- // Add-ons that were detected as installed during startup. Doesn't include
- // add-ons that were pending installation the last time the application ran.
- STARTUP_CHANGE_INSTALLED: "installed",
- // Add-ons that were detected as changed during startup. This includes an
- // add-on moving to a different location, changing version or just having
- // been detected as possibly changed.
- STARTUP_CHANGE_CHANGED: "changed",
- // Add-ons that were detected as uninstalled during startup. Doesn't include
- // add-ons that were pending uninstallation the last time the application ran.
- STARTUP_CHANGE_UNINSTALLED: "uninstalled",
- // Add-ons that were detected as disabled during startup, normally because of
- // an application change making an add-on incompatible. Doesn't include
- // add-ons that were pending being disabled the last time the application ran.
- STARTUP_CHANGE_DISABLED: "disabled",
- // Add-ons that were detected as enabled during startup, normally because of
- // an application change making an add-on compatible. Doesn't include
- // add-ons that were pending being enabled the last time the application ran.
- STARTUP_CHANGE_ENABLED: "enabled",
-
- // Constants for Addon.signedState. Any states that should cause an add-on
- // to be unusable in builds that require signing should have negative values.
- // Add-on signing is not required, e.g. because the pref is disabled.
- SIGNEDSTATE_NOT_REQUIRED: undefined,
- // Add-on is signed but signature verification has failed.
- SIGNEDSTATE_BROKEN: -2,
- // Add-on may be signed but by an certificate that doesn't chain to our
- // our trusted certificate.
- SIGNEDSTATE_UNKNOWN: -1,
- // Add-on is unsigned.
- SIGNEDSTATE_MISSING: 0,
- // Add-on is preliminarily reviewed.
- SIGNEDSTATE_PRELIMINARY: 1,
- // Add-on is fully reviewed.
- SIGNEDSTATE_SIGNED: 2,
- // Add-on is system add-on.
- SIGNEDSTATE_SYSTEM: 3,
-
- // Constants for the Addon.userDisabled property
- // Indicates that the userDisabled state of this add-on is currently
- // ask-to-activate. That is, it can be conditionally enabled on a
- // case-by-case basis.
- STATE_ASK_TO_ACTIVATE: "askToActivate",
-
- get __AddonManagerInternal__() {
- return AppConstants.DEBUG ? AddonManagerInternal : undefined;
- },
-
- get isReady() {
- return gStartupComplete && !gShutdownInProgress;
- },
-
- init() {
- this._stateToString = new Map();
- for (let [name, value] of this._states) {
- this[name] = value;
- this._stateToString.set(value, name);
- }
- this._errorToString = new Map();
- for (let [name, value] of this._errors) {
- this[name] = value;
- this._errorToString.set(value, name);
- }
- },
-
- stateToString(state) {
- return this._stateToString.get(state);
- },
-
- errorToString(err) {
- return err ? this._errorToString.get(err) : null;
- },
-
- getInstallForURL: function(aUrl, aCallback, aMimetype,
- aHash, aName, aIcons,
- aVersion, aBrowser) {
- AddonManagerInternal.getInstallForURL(aUrl, aCallback, aMimetype, aHash,
- aName, aIcons, aVersion, aBrowser);
- },
-
- getInstallForFile: function(aFile, aCallback, aMimetype) {
- AddonManagerInternal.getInstallForFile(aFile, aCallback, aMimetype);
- },
-
- /**
- * Gets an array of add-on IDs that changed during the most recent startup.
- *
- * @param aType
- * The type of startup change to get
- * @return An array of add-on IDs
- */
- getStartupChanges: function(aType) {
- if (!(aType in AddonManagerInternal.startupChanges))
- return [];
- return AddonManagerInternal.startupChanges[aType].slice(0);
- },
-
- getAddonByID: function(aID, aCallback) {
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- AddonManagerInternal.getAddonByID(aID)
- .then(makeSafe(aCallback))
- .catch(logger.error);
- },
-
- getAddonBySyncGUID: function(aGUID, aCallback) {
- AddonManagerInternal.getAddonBySyncGUID(aGUID, aCallback);
- },
-
- getAddonsByIDs: function(aIDs, aCallback) {
- if (typeof aCallback != "function")
- throw Components.Exception("aCallback must be a function",
- Cr.NS_ERROR_INVALID_ARG);
-
- AddonManagerInternal.getAddonsByIDs(aIDs)
- .then(makeSafe(aCallback))
- .catch(logger.error);
- },
-
- getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
- AddonManagerInternal.getAddonsWithOperationsByTypes(aTypes, aCallback);
- },
-
- getAddonsByTypes: function(aTypes, aCallback) {
- AddonManagerInternal.getAddonsByTypes(aTypes, aCallback);
- },
-
- getAllAddons: function(aCallback) {
- AddonManagerInternal.getAllAddons(aCallback);
- },
-
- getInstallsByTypes: function(aTypes, aCallback) {
- AddonManagerInternal.getInstallsByTypes(aTypes, aCallback);
- },
-
- getAllInstalls: function(aCallback) {
- AddonManagerInternal.getAllInstalls(aCallback);
- },
-
- mapURIToAddonID: function(aURI) {
- return AddonManagerInternal.mapURIToAddonID(aURI);
- },
-
- isInstallEnabled: function(aType) {
- return AddonManagerInternal.isInstallEnabled(aType);
- },
-
- isInstallAllowed: function(aType, aInstallingPrincipal) {
- return AddonManagerInternal.isInstallAllowed(aType, aInstallingPrincipal);
- },
-
- installAddonsFromWebpage: function(aType, aBrowser, aInstallingPrincipal,
- aInstalls) {
- AddonManagerInternal.installAddonsFromWebpage(aType, aBrowser,
- aInstallingPrincipal,
- aInstalls);
- },
-
- installTemporaryAddon: function(aDirectory) {
- return AddonManagerInternal.installTemporaryAddon(aDirectory);
- },
-
- installAddonFromSources: function(aDirectory) {
- return AddonManagerInternal.installAddonFromSources(aDirectory);
- },
-
- getAddonByInstanceID: function(aInstanceID) {
- return AddonManagerInternal.getAddonByInstanceID(aInstanceID);
- },
-
- addManagerListener: function(aListener) {
- AddonManagerInternal.addManagerListener(aListener);
- },
-
- removeManagerListener: function(aListener) {
- AddonManagerInternal.removeManagerListener(aListener);
- },
-
- addInstallListener: function(aListener) {
- AddonManagerInternal.addInstallListener(aListener);
- },
-
- removeInstallListener: function(aListener) {
- AddonManagerInternal.removeInstallListener(aListener);
- },
-
- getUpgradeListener: function(aId) {
- return AddonManagerInternal.upgradeListeners.get(aId);
- },
-
- addUpgradeListener: function(aInstanceID, aCallback) {
- AddonManagerInternal.addUpgradeListener(aInstanceID, aCallback);
- },
-
- removeUpgradeListener: function(aInstanceID) {
- AddonManagerInternal.removeUpgradeListener(aInstanceID);
- },
-
- addAddonListener: function(aListener) {
- AddonManagerInternal.addAddonListener(aListener);
- },
-
- removeAddonListener: function(aListener) {
- AddonManagerInternal.removeAddonListener(aListener);
- },
-
- addTypeListener: function(aListener) {
- AddonManagerInternal.addTypeListener(aListener);
- },
-
- removeTypeListener: function(aListener) {
- AddonManagerInternal.removeTypeListener(aListener);
- },
-
- get addonTypes() {
- return AddonManagerInternal.addonTypes;
- },
-
- /**
- * Determines whether an Addon should auto-update or not.
- *
- * @param aAddon
- * The Addon representing the add-on
- * @return true if the addon should auto-update, false otherwise.
- */
- shouldAutoUpdate: function(aAddon) {
- if (!aAddon || typeof aAddon != "object")
- throw Components.Exception("aAddon must be specified",
- Cr.NS_ERROR_INVALID_ARG);
-
- if (!("applyBackgroundUpdates" in aAddon))
- return false;
- if (aAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_ENABLE)
- return true;
- if (aAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DISABLE)
- return false;
- return this.autoUpdateDefault;
- },
-
- get checkCompatibility() {
- return AddonManagerInternal.checkCompatibility;
- },
-
- set checkCompatibility(aValue) {
- AddonManagerInternal.checkCompatibility = aValue;
- },
-
- get strictCompatibility() {
- return AddonManagerInternal.strictCompatibility;
- },
-
- set strictCompatibility(aValue) {
- AddonManagerInternal.strictCompatibility = aValue;
- },
-
- get checkUpdateSecurityDefault() {
- return AddonManagerInternal.checkUpdateSecurityDefault;
- },
-
- get checkUpdateSecurity() {
- return AddonManagerInternal.checkUpdateSecurity;
- },
-
- set checkUpdateSecurity(aValue) {
- AddonManagerInternal.checkUpdateSecurity = aValue;
- },
-
- get updateEnabled() {
- return AddonManagerInternal.updateEnabled;
- },
-
- set updateEnabled(aValue) {
- AddonManagerInternal.updateEnabled = aValue;
- },
-
- get autoUpdateDefault() {
- return AddonManagerInternal.autoUpdateDefault;
- },
-
- set autoUpdateDefault(aValue) {
- AddonManagerInternal.autoUpdateDefault = aValue;
- },
-
- get hotfixID() {
- return AddonManagerInternal.hotfixID;
- },
-
- escapeAddonURI: function(aAddon, aUri, aAppVersion) {
- return AddonManagerInternal.escapeAddonURI(aAddon, aUri, aAppVersion);
- },
-
- getPreferredIconURL: function(aAddon, aSize, aWindow = undefined) {
- return AddonManagerInternal.getPreferredIconURL(aAddon, aSize, aWindow);
- },
-
- get webAPI() {
- return AddonManagerInternal.webAPI;
- },
-
- get shutdown() {
- return gShutdownBarrier.client;
- },
-};
-
-this.AddonManager.init();
-
-// load the timestamps module into AddonManagerInternal
-Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", AddonManagerInternal);
-Object.freeze(AddonManagerInternal);
-Object.freeze(AddonManagerPrivate);
-Object.freeze(AddonManager);
diff --git a/toolkit/mozapps/webextensions/AddonManagerWebAPI.cpp b/toolkit/mozapps/webextensions/AddonManagerWebAPI.cpp
deleted file mode 100644
index 3f2a7a5299..0000000000
--- a/toolkit/mozapps/webextensions/AddonManagerWebAPI.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AddonManagerWebAPI.h"
-
-#include "mozilla/dom/Navigator.h"
-#include "mozilla/dom/NavigatorBinding.h"
-
-#include "mozilla/Preferences.h"
-#include "nsGlobalWindow.h"
-
-#include "nsIDocShell.h"
-#include "nsIScriptObjectPrincipal.h"
-
-namespace mozilla {
-using namespace mozilla::dom;
-
-static bool
-IsValidHost(const nsACString& host) {
- // This is ugly, but Preferences.h doesn't have support
- // for default prefs or locked prefs
- nsCOMPtr<nsIPrefService> prefService (do_GetService(NS_PREFSERVICE_CONTRACTID));
- nsCOMPtr<nsIPrefBranch> prefs;
- if (prefService) {
- prefService->GetDefaultBranch(nullptr, getter_AddRefs(prefs));
- bool isEnabled;
- if (NS_SUCCEEDED(prefs->GetBoolPref("xpinstall.enabled", &isEnabled)) && !isEnabled) {
- bool isLocked;
- prefs->PrefIsLocked("xpinstall.enabled", &isLocked);
- if (isLocked) {
- return false;
- }
- }
- }
-
- if (host.Equals("addons.mozilla.org") ||
- host.Equals("discovery.addons.mozilla.org") ||
- host.Equals("testpilot.firefox.com")) {
- return true;
- }
-
- // When testing allow access to the developer sites.
- if (Preferences::GetBool("extensions.webapi.testing", false)) {
- if (host.LowerCaseEqualsLiteral("addons.allizom.org") ||
- host.LowerCaseEqualsLiteral("discovery.addons.allizom.org") ||
- host.LowerCaseEqualsLiteral("addons-dev.allizom.org") ||
- host.LowerCaseEqualsLiteral("discovery.addons-dev.allizom.org") ||
- host.LowerCaseEqualsLiteral("testpilot.stage.mozaws.net") ||
- host.LowerCaseEqualsLiteral("testpilot.dev.mozaws.net") ||
- host.LowerCaseEqualsLiteral("example.com")) {
- return true;
- }
- }
-
- return false;
-}
-
-// Checks if the given uri is secure and matches one of the hosts allowed to
-// access the API.
-bool
-AddonManagerWebAPI::IsValidSite(nsIURI* uri)
-{
- if (!uri) {
- return false;
- }
-
- bool isSecure;
- nsresult rv = uri->SchemeIs("https", &isSecure);
- if (NS_FAILED(rv) || !isSecure) {
- return false;
- }
-
- nsAutoCString host;
- rv = uri->GetHost(host);
- if (NS_FAILED(rv)) {
- return false;
- }
-
- return IsValidHost(host);
-}
-
-bool
-AddonManagerWebAPI::IsAPIEnabled(JSContext* cx, JSObject* obj)
-{
- nsGlobalWindow* global = xpc::WindowGlobalOrNull(obj);
- if (!global) {
- return false;
- }
-
- nsCOMPtr<nsPIDOMWindowInner> win = global->AsInner();
- if (!win) {
- return false;
- }
-
- // Check that the current window and all parent frames are allowed access to
- // the API.
- while (win) {
- nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(win);
- if (!sop) {
- return false;
- }
-
- nsCOMPtr<nsIPrincipal> principal = sop->GetPrincipal();
- if (!principal) {
- return false;
- }
-
- // Reaching a window with a system principal means we have reached
- // privileged UI of some kind so stop at this point and allow access.
- if (principal->GetIsSystemPrincipal()) {
- return true;
- }
-
- nsCOMPtr<nsIDocShell> docShell = win->GetDocShell();
- if (!docShell) {
- // This window has been torn down so don't allow access to the API.
- return false;
- }
-
- if (!IsValidSite(win->GetDocumentURI())) {
- return false;
- }
-
- // Checks whether there is a parent frame of the same type. This won't cross
- // mozbrowser or chrome boundaries.
- nsCOMPtr<nsIDocShellTreeItem> parent;
- nsresult rv = docShell->GetSameTypeParent(getter_AddRefs(parent));
- if (NS_FAILED(rv)) {
- return false;
- }
-
- if (!parent) {
- // No parent means we've hit a mozbrowser or chrome boundary so allow
- // access to the API.
- return true;
- }
-
- nsIDocument* doc = win->GetDoc();
- if (!doc) {
- return false;
- }
-
- doc = doc->GetParentDocument();
- if (!doc) {
- // Getting here means something has been torn down so fail safe.
- return false;
- }
-
-
- win = doc->GetInnerWindow();
- }
-
- // Found a document with no inner window, don't grant access to the API.
- return false;
-}
-
-namespace dom {
-
-bool
-AddonManagerPermissions::IsHostPermitted(const GlobalObject& /*unused*/, const nsAString& host)
-{
- return IsValidHost(NS_ConvertUTF16toUTF8(host));
-}
-
-} // namespace mozilla::dom
-
-
-} // namespace mozilla
diff --git a/toolkit/mozapps/webextensions/AddonManagerWebAPI.h b/toolkit/mozapps/webextensions/AddonManagerWebAPI.h
deleted file mode 100644
index 6830bc91f6..0000000000
--- a/toolkit/mozapps/webextensions/AddonManagerWebAPI.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef addonmanagerwebapi_h_
-#define addonmanagerwebapi_h_
-
-#include "nsPIDOMWindow.h"
-
-namespace mozilla {
-
-class AddonManagerWebAPI {
-public:
- static bool IsAPIEnabled(JSContext* cx, JSObject* obj);
-
-private:
- static bool IsValidSite(nsIURI* uri);
-};
-
-namespace dom {
-
-class AddonManagerPermissions {
-public:
- static bool IsHostPermitted(const GlobalObject&, const nsAString& host);
-};
-
-} // namespace mozilla::dom
-
-} // namespace mozilla
-
-#endif // addonmanagerwebapi_h_
diff --git a/toolkit/mozapps/webextensions/AddonPathService.cpp b/toolkit/mozapps/webextensions/AddonPathService.cpp
deleted file mode 100644
index 8a405c0ea4..0000000000
--- a/toolkit/mozapps/webextensions/AddonPathService.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AddonPathService.h"
-
-#include "amIAddonManager.h"
-#include "nsIURI.h"
-#include "nsXULAppAPI.h"
-#include "jsapi.h"
-#include "nsServiceManagerUtils.h"
-#include "nsLiteralString.h"
-#include "nsThreadUtils.h"
-#include "nsIIOService.h"
-#include "nsNetUtil.h"
-#include "nsIAddonPolicyService.h"
-#include "nsIFileURL.h"
-#include "nsIResProtocolHandler.h"
-#include "nsIChromeRegistry.h"
-#include "nsIJARURI.h"
-#include "nsJSUtils.h"
-#include "mozilla/dom/ScriptSettings.h"
-#include "mozilla/dom/ToJSValue.h"
-#include "mozilla/AddonPathService.h"
-#include "mozilla/Omnijar.h"
-
-#include <algorithm>
-
-namespace mozilla {
-
-struct PathEntryComparator
-{
- typedef AddonPathService::PathEntry PathEntry;
-
- bool Equals(const PathEntry& entry1, const PathEntry& entry2) const
- {
- return entry1.mPath == entry2.mPath;
- }
-
- bool LessThan(const PathEntry& entry1, const PathEntry& entry2) const
- {
- return entry1.mPath < entry2.mPath;
- }
-};
-
-AddonPathService::AddonPathService()
-{
-}
-
-AddonPathService::~AddonPathService()
-{
- sInstance = nullptr;
-}
-
-NS_IMPL_ISUPPORTS(AddonPathService, amIAddonPathService)
-
-AddonPathService *AddonPathService::sInstance;
-
-/* static */ AddonPathService*
-AddonPathService::GetInstance()
-{
- if (!sInstance) {
- sInstance = new AddonPathService();
- }
- NS_ADDREF(sInstance);
- return sInstance;
-}
-
-static JSAddonId*
-ConvertAddonId(const nsAString& addonIdString)
-{
- AutoSafeJSContext cx;
- JS::RootedValue strv(cx);
- if (!mozilla::dom::ToJSValue(cx, addonIdString, &strv)) {
- return nullptr;
- }
- JS::RootedString str(cx, strv.toString());
- return JS::NewAddonId(cx, str);
-}
-
-JSAddonId*
-AddonPathService::Find(const nsAString& path)
-{
- // Use binary search to find the nearest entry that is <= |path|.
- PathEntryComparator comparator;
- unsigned index = mPaths.IndexOfFirstElementGt(PathEntry(path, nullptr), comparator);
- if (index == 0) {
- return nullptr;
- }
- const PathEntry& entry = mPaths[index - 1];
-
- // Return the entry's addon if its path is a prefix of |path|.
- if (StringBeginsWith(path, entry.mPath)) {
- return entry.mAddonId;
- }
- return nullptr;
-}
-
-NS_IMETHODIMP
-AddonPathService::FindAddonId(const nsAString& path, nsAString& addonIdString)
-{
- if (JSAddonId* id = Find(path)) {
- JSFlatString* flat = JS_ASSERT_STRING_IS_FLAT(JS::StringOfAddonId(id));
- AssignJSFlatString(addonIdString, flat);
- }
- return NS_OK;
-}
-
-/* static */ JSAddonId*
-AddonPathService::FindAddonId(const nsAString& path)
-{
- // If no service has been created, then we're not going to find anything.
- if (!sInstance) {
- return nullptr;
- }
-
- return sInstance->Find(path);
-}
-
-NS_IMETHODIMP
-AddonPathService::InsertPath(const nsAString& path, const nsAString& addonIdString)
-{
- JSAddonId* addonId = ConvertAddonId(addonIdString);
-
- // Add the new path in sorted order.
- PathEntryComparator comparator;
- mPaths.InsertElementSorted(PathEntry(path, addonId), comparator);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-AddonPathService::MapURIToAddonId(nsIURI* aURI, nsAString& addonIdString)
-{
- if (JSAddonId* id = MapURIToAddonID(aURI)) {
- JSFlatString* flat = JS_ASSERT_STRING_IS_FLAT(JS::StringOfAddonId(id));
- AssignJSFlatString(addonIdString, flat);
- }
- return NS_OK;
-}
-
-static nsresult
-ResolveURI(nsIURI* aURI, nsAString& out)
-{
- bool equals;
- nsresult rv;
- nsCOMPtr<nsIURI> uri;
- nsAutoCString spec;
-
- // Resolve resource:// URIs. At the end of this if/else block, we
- // have both spec and uri variables identifying the same URI.
- if (NS_SUCCEEDED(aURI->SchemeIs("resource", &equals)) && equals) {
- nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- nsCOMPtr<nsIProtocolHandler> ph;
- rv = ioService->GetProtocolHandler("resource", getter_AddRefs(ph));
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- nsCOMPtr<nsIResProtocolHandler> irph(do_QueryInterface(ph, &rv));
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- rv = irph->ResolveURI(aURI, spec);
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- rv = ioService->NewURI(spec, nullptr, nullptr, getter_AddRefs(uri));
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
- } else if (NS_SUCCEEDED(aURI->SchemeIs("chrome", &equals)) && equals) {
- nsCOMPtr<nsIChromeRegistry> chromeReg =
- mozilla::services::GetChromeRegistryService();
- if (NS_WARN_IF(!chromeReg))
- return NS_ERROR_UNEXPECTED;
-
- rv = chromeReg->ConvertChromeURL(aURI, getter_AddRefs(uri));
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
- } else {
- uri = aURI;
- }
-
- if (NS_SUCCEEDED(uri->SchemeIs("jar", &equals)) && equals) {
- nsCOMPtr<nsIJARURI> jarURI = do_QueryInterface(uri, &rv);
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- nsCOMPtr<nsIURI> jarFileURI;
- rv = jarURI->GetJARFile(getter_AddRefs(jarFileURI));
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- return ResolveURI(jarFileURI, out);
- }
-
- if (NS_SUCCEEDED(uri->SchemeIs("file", &equals)) && equals) {
- nsCOMPtr<nsIFileURL> baseFileURL = do_QueryInterface(uri, &rv);
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- nsCOMPtr<nsIFile> file;
- rv = baseFileURL->GetFile(getter_AddRefs(file));
- if (NS_WARN_IF(NS_FAILED(rv)))
- return rv;
-
- return file->GetPath(out);
- }
- return NS_ERROR_FAILURE;
-}
-
-JSAddonId*
-MapURIToAddonID(nsIURI* aURI)
-{
- if (!NS_IsMainThread() || !XRE_IsParentProcess()) {
- return nullptr;
- }
-
- bool equals;
- nsresult rv;
- if (NS_SUCCEEDED(aURI->SchemeIs("moz-extension", &equals)) && equals) {
- nsCOMPtr<nsIAddonPolicyService> service = do_GetService("@mozilla.org/addons/policy-service;1");
- if (service) {
- nsString addonId;
- rv = service->ExtensionURIToAddonId(aURI, addonId);
- if (NS_FAILED(rv))
- return nullptr;
-
- return ConvertAddonId(addonId);
- }
- }
-
- nsAutoString filePath;
- rv = ResolveURI(aURI, filePath);
- if (NS_FAILED(rv))
- return nullptr;
-
- nsCOMPtr<nsIFile> greJar = Omnijar::GetPath(Omnijar::GRE);
- nsCOMPtr<nsIFile> appJar = Omnijar::GetPath(Omnijar::APP);
- if (greJar && appJar) {
- nsAutoString greJarString, appJarString;
- if (NS_FAILED(greJar->GetPath(greJarString)) || NS_FAILED(appJar->GetPath(appJarString)))
- return nullptr;
-
- // If |aURI| is part of either Omnijar, then it can't be part of an
- // add-on. This catches pretty much all URLs for Firefox content.
- if (filePath.Equals(greJarString) || filePath.Equals(appJarString))
- return nullptr;
- }
-
- // If it's not part of Firefox, we resort to binary searching through the
- // add-on paths.
- return AddonPathService::FindAddonId(filePath);
-}
-
-} // namespace mozilla
diff --git a/toolkit/mozapps/webextensions/AddonPathService.h b/toolkit/mozapps/webextensions/AddonPathService.h
deleted file mode 100644
index f739b018f3..0000000000
--- a/toolkit/mozapps/webextensions/AddonPathService.h
+++ /dev/null
@@ -1,55 +0,0 @@
-//* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-/
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AddonPathService_h
-#define AddonPathService_h
-
-#include "amIAddonPathService.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-class nsIURI;
-class JSAddonId;
-
-namespace mozilla {
-
-JSAddonId*
-MapURIToAddonID(nsIURI* aURI);
-
-class AddonPathService final : public amIAddonPathService
-{
-public:
- AddonPathService();
-
- static AddonPathService* GetInstance();
-
- JSAddonId* Find(const nsAString& path);
- static JSAddonId* FindAddonId(const nsAString& path);
-
- NS_DECL_ISUPPORTS
- NS_DECL_AMIADDONPATHSERVICE
-
- struct PathEntry
- {
- nsString mPath;
- JSAddonId* mAddonId;
-
- PathEntry(const nsAString& aPath, JSAddonId* aAddonId)
- : mPath(aPath), mAddonId(aAddonId)
- {}
- };
-
-private:
- virtual ~AddonPathService();
-
- // Paths are stored sorted in order of their mPath.
- nsTArray<PathEntry> mPaths;
-
- static AddonPathService* sInstance;
-};
-
-} // namespace mozilla
-
-#endif
diff --git a/toolkit/mozapps/webextensions/GMPInstallManager.jsm b/toolkit/mozapps/webextensions/GMPInstallManager.jsm
deleted file mode 100644
index b5987ca55c..0000000000
--- a/toolkit/mozapps/webextensions/GMPInstallManager.jsm
+++ /dev/null
@@ -1,523 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [];
-
-const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} =
- Components;
-// 1 day default
-const DEFAULT_SECONDS_BETWEEN_CHECKS = 60 * 60 * 24;
-
-var GMPInstallFailureReason = {
- GMP_INVALID: 1,
- GMP_HIDDEN: 2,
- GMP_DISABLED: 3,
- GMP_UPDATE_DISABLED: 4,
-};
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/GMPUtils.jsm");
-Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
-
-this.EXPORTED_SYMBOLS = ["GMPInstallManager", "GMPExtractor", "GMPDownloader",
- "GMPAddon"];
-
-// Shared code for suppressing bad cert dialogs
-XPCOMUtils.defineLazyGetter(this, "gCertUtils", function() {
- let temp = { };
- Cu.import("resource://gre/modules/CertUtils.jsm", temp);
- return temp;
-});
-
-XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
- "resource://gre/modules/UpdateUtils.jsm");
-
-function getScopedLogger(prefix) {
- // `PARENT_LOGGER_ID.` being passed here effectively links this logger
- // to the parentLogger.
- return Log.repository.getLoggerWithMessagePrefix("Toolkit.GMP", prefix + " ");
-}
-
-/**
- * Provides an easy API for downloading and installing GMP Addons
- */
-function GMPInstallManager() {
-}
-/**
- * Temp file name used for downloading
- */
-GMPInstallManager.prototype = {
- /**
- * Obtains a URL with replacement of vars
- */
- _getURL: function() {
- let log = getScopedLogger("GMPInstallManager._getURL");
- // Use the override URL if it is specified. The override URL is just like
- // the normal URL but it does not check the cert.
- let url = GMPPrefs.get(GMPPrefs.KEY_URL_OVERRIDE);
- if (url) {
- log.info("Using override url: " + url);
- } else {
- url = GMPPrefs.get(GMPPrefs.KEY_URL);
- log.info("Using url: " + url);
- }
-
- url = UpdateUtils.formatUpdateURL(url);
-
- log.info("Using url (with replacement): " + url);
- return url;
- },
- /**
- * Performs an addon check.
- * @return a promise which will be resolved or rejected.
- * The promise is resolved with an object with properties:
- * gmpAddons: array of GMPAddons
- * usedFallback: whether the data was collected from online or
- * from fallback data within the build
- * The promise is rejected with an object with properties:
- * target: The XHR request object
- * status: The HTTP status code
- * type: Sometimes specifies type of rejection
- */
- checkForAddons: function() {
- let log = getScopedLogger("GMPInstallManager.checkForAddons");
- if (this._deferred) {
- log.error("checkForAddons already called");
- return Promise.reject({type: "alreadycalled"});
- }
- this._deferred = Promise.defer();
- let url = this._getURL();
-
- let allowNonBuiltIn = true;
- let certs = null;
- if (!Services.prefs.prefHasUserValue(GMPPrefs.KEY_URL_OVERRIDE)) {
- allowNonBuiltIn = !GMPPrefs.get(GMPPrefs.KEY_CERT_REQUIREBUILTIN, true);
- if (GMPPrefs.get(GMPPrefs.KEY_CERT_CHECKATTRS, true)) {
- certs = gCertUtils.readCertPrefs(GMPPrefs.KEY_CERTS_BRANCH);
- }
- }
-
- let addonPromise = ProductAddonChecker
- .getProductAddonList(url, allowNonBuiltIn, certs);
-
- addonPromise.then(res => {
- if (!res || !res.gmpAddons) {
- this._deferred.resolve({gmpAddons: []});
- }
- else {
- res.gmpAddons = res.gmpAddons.map(a => new GMPAddon(a));
- this._deferred.resolve(res);
- }
- delete this._deferred;
- }, (ex) => {
- this._deferred.reject(ex);
- delete this._deferred;
- });
-
- return this._deferred.promise;
- },
- /**
- * Installs the specified addon and calls a callback when done.
- * @param gmpAddon The GMPAddon object to install
- * @return a promise which will be resolved or rejected
- * The promise will resolve with an array of paths that were extracted
- * The promise will reject with an error object:
- * target: The XHR request object
- * status: The HTTP status code
- * type: A string to represent the type of error
- * downloaderr, verifyerr or previouserrorencountered
- */
- installAddon: function(gmpAddon) {
- if (this._deferred) {
- log.error("previous error encountered");
- return Promise.reject({type: "previouserrorencountered"});
- }
- this.gmpDownloader = new GMPDownloader(gmpAddon);
- return this.gmpDownloader.start();
- },
- _getTimeSinceLastCheck: function() {
- let now = Math.round(Date.now() / 1000);
- // Default to 0 here because `now - 0` will be returned later if that case
- // is hit. We want a large value so a check will occur.
- let lastCheck = GMPPrefs.get(GMPPrefs.KEY_UPDATE_LAST_CHECK, 0);
- // Handle clock jumps, return now since we want it to represent
- // a lot of time has passed since the last check.
- if (now < lastCheck) {
- return now;
- }
- return now - lastCheck;
- },
- get _isEMEEnabled() {
- return GMPPrefs.get(GMPPrefs.KEY_EME_ENABLED, true);
- },
- _isAddonEnabled: function(aAddon) {
- return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_ENABLED, true, aAddon);
- },
- _isAddonUpdateEnabled: function(aAddon) {
- return this._isAddonEnabled(aAddon) &&
- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, aAddon);
- },
- _updateLastCheck: function() {
- let now = Math.round(Date.now() / 1000);
- GMPPrefs.set(GMPPrefs.KEY_UPDATE_LAST_CHECK, now);
- },
- _versionchangeOccurred: function() {
- let savedBuildID = GMPPrefs.get(GMPPrefs.KEY_BUILDID, null);
- let buildID = Services.appinfo.platformBuildID;
- if (savedBuildID == buildID) {
- return false;
- }
- GMPPrefs.set(GMPPrefs.KEY_BUILDID, buildID);
- return true;
- },
- /**
- * Wrapper for checkForAddons and installAddon.
- * Will only install if not already installed and will log the results.
- * This will only install/update the OpenH264 and EME plugins
- * @return a promise which will be resolved if all addons could be installed
- * successfully, rejected otherwise.
- */
- simpleCheckAndInstall: Task.async(function*() {
- let log = getScopedLogger("GMPInstallManager.simpleCheckAndInstall");
-
- if (this._versionchangeOccurred()) {
- log.info("A version change occurred. Ignoring " +
- "media.gmp-manager.lastCheck to check immediately for " +
- "new or updated GMPs.");
- } else {
- let secondsBetweenChecks =
- GMPPrefs.get(GMPPrefs.KEY_SECONDS_BETWEEN_CHECKS,
- DEFAULT_SECONDS_BETWEEN_CHECKS)
- let secondsSinceLast = this._getTimeSinceLastCheck();
- log.info("Last check was: " + secondsSinceLast +
- " seconds ago, minimum seconds: " + secondsBetweenChecks);
- if (secondsBetweenChecks > secondsSinceLast) {
- log.info("Will not check for updates.");
- return {status: "too-frequent-no-check"};
- }
- }
-
- try {
- let {usedFallback, gmpAddons} = yield this.checkForAddons();
- this._updateLastCheck();
- log.info("Found " + gmpAddons.length + " addons advertised.");
- let addonsToInstall = gmpAddons.filter(function(gmpAddon) {
- log.info("Found addon: " + gmpAddon.toString());
-
- if (!gmpAddon.isValid) {
- log.info("Addon |" + gmpAddon.id + "| is invalid.");
- return false;
- }
-
- if (GMPUtils.isPluginHidden(gmpAddon)) {
- log.info("Addon |" + gmpAddon.id + "| has been hidden.");
- return false;
- }
-
- if (gmpAddon.isInstalled) {
- log.info("Addon |" + gmpAddon.id + "| already installed.");
- return false;
- }
-
- // Do not install from fallback if already installed as it
- // may be a downgrade
- if (usedFallback && gmpAddon.isUpdate) {
- log.info("Addon |" + gmpAddon.id + "| not installing updates based " +
- "on fallback.");
- return false;
- }
-
- let addonUpdateEnabled = false;
- if (GMP_PLUGIN_IDS.indexOf(gmpAddon.id) >= 0) {
- if (!this._isAddonEnabled(gmpAddon.id)) {
- log.info("GMP |" + gmpAddon.id + "| has been disabled; skipping check.");
- } else if (!this._isAddonUpdateEnabled(gmpAddon.id)) {
- log.info("Auto-update is off for " + gmpAddon.id +
- ", skipping check.");
- } else {
- addonUpdateEnabled = true;
- }
- } else {
- // Currently, we only support installs of OpenH264 and EME plugins.
- log.info("Auto-update is off for unknown plugin '" + gmpAddon.id +
- "', skipping check.");
- }
-
- return addonUpdateEnabled;
- }, this);
-
- if (!addonsToInstall.length) {
- log.info("No new addons to install, returning");
- return {status: "nothing-new-to-install"};
- }
-
- let installResults = [];
- let failureEncountered = false;
- for (let addon of addonsToInstall) {
- try {
- yield this.installAddon(addon);
- installResults.push({
- id: addon.id,
- result: "succeeded",
- });
- } catch (e) {
- failureEncountered = true;
- installResults.push({
- id: addon.id,
- result: "failed",
- });
- }
- }
- if (failureEncountered) {
- throw {status: "failed",
- results: installResults};
- }
- return {status: "succeeded",
- results: installResults};
- } catch (e) {
- log.error("Could not check for addons", e);
- throw e;
- }
- }),
-
- /**
- * Makes sure everything is cleaned up
- */
- uninit: function() {
- let log = getScopedLogger("GMPInstallManager.uninit");
- if (this._request) {
- log.info("Aborting request");
- this._request.abort();
- }
- if (this._deferred) {
- log.info("Rejecting deferred");
- this._deferred.reject({type: "uninitialized"});
- }
- log.info("Done cleanup");
- },
-
- /**
- * If set to true, specifies to leave the temporary downloaded zip file.
- * This is useful for tests.
- */
- overrideLeaveDownloadedZip: false,
-};
-
-/**
- * Used to construct a single GMP addon
- * GMPAddon objects are returns from GMPInstallManager.checkForAddons
- * GMPAddon objects can also be used in calls to GMPInstallManager.installAddon
- *
- * @param addon The ProductAddonChecker `addon` object
- */
-function GMPAddon(addon) {
- let log = getScopedLogger("GMPAddon.constructor");
- for (let name of Object.keys(addon)) {
- this[name] = addon[name];
- }
- log.info ("Created new addon: " + this.toString());
-}
-
-GMPAddon.prototype = {
- /**
- * Returns a string representation of the addon
- */
- toString: function() {
- return this.id + " (" +
- "isValid: " + this.isValid +
- ", isInstalled: " + this.isInstalled +
- ", hashFunction: " + this.hashFunction+
- ", hashValue: " + this.hashValue +
- (this.size !== undefined ? ", size: " + this.size : "" ) +
- ")";
- },
- /**
- * If all the fields aren't specified don't consider this addon valid
- * @return true if the addon is parsed and valid
- */
- get isValid() {
- return this.id && this.URL && this.version &&
- this.hashFunction && !!this.hashValue;
- },
- get isInstalled() {
- return this.version &&
- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, "", this.id) === this.version;
- },
- get isEME() {
- return this.id == "gmp-widevinecdm" || this.id.indexOf("gmp-eme-") == 0;
- },
- /**
- * @return true if the addon has been previously installed and this is
- * a new version, if this is a fresh install return false
- */
- get isUpdate() {
- return this.version &&
- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, false, this.id);
- },
-};
-/**
- * Constructs a GMPExtractor object which is used to extract a GMP zip
- * into the specified location. (Which typically leties per platform)
- * @param zipPath The path on disk of the zip file to extract
- */
-function GMPExtractor(zipPath, installToDirPath) {
- this.zipPath = zipPath;
- this.installToDirPath = installToDirPath;
-}
-GMPExtractor.prototype = {
- /**
- * Obtains a list of all the entries in a zipfile in the format of *.*.
- * This also includes files inside directories.
- *
- * @param zipReader the nsIZipReader to check
- * @return An array of string name entries which can be used
- * in nsIZipReader.extract
- */
- _getZipEntries: function(zipReader) {
- let entries = [];
- let enumerator = zipReader.findEntries("*.*");
- while (enumerator.hasMore()) {
- entries.push(enumerator.getNext());
- }
- return entries;
- },
- /**
- * Installs the this.zipPath contents into the directory used to store GMP
- * addons for the current platform.
- *
- * @return a promise which will be resolved or rejected
- * See GMPInstallManager.installAddon for resolve/rejected info
- */
- install: function() {
- try {
- let log = getScopedLogger("GMPExtractor.install");
- this._deferred = Promise.defer();
- log.info("Installing " + this.zipPath + "...");
- // Get the input zip file
- let zipFile = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsIFile);
- zipFile.initWithPath(this.zipPath);
-
- // Initialize a zipReader and obtain the entries
- var zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- zipReader.open(zipFile)
- let entries = this._getZipEntries(zipReader);
- let extractedPaths = [];
-
- let destDir = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsILocalFile);
- destDir.initWithPath(this.installToDirPath);
- // Make sure the destination exists
- if (!destDir.exists()) {
- destDir.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
- }
-
- // Extract each of the entries
- entries.forEach(entry => {
- // We don't need these types of files
- if (entry.includes("__MACOSX") ||
- entry == "_metadata/verified_contents.json" ||
- entry == "imgs/icon-128x128.png") {
- return;
- }
- let outFile = destDir.clone();
- // Do not extract into directories. Extract all files to the same
- // directory. DO NOT use |OS.Path.basename()| here, as in Windows it
- // does not work properly with forward slashes (which we must use here).
- let outBaseName = entry.slice(entry.lastIndexOf("/") + 1);
- outFile.appendRelativePath(outBaseName);
-
- zipReader.extract(entry, outFile);
- extractedPaths.push(outFile.path);
- // Ensure files are writable and executable. Otherwise we may be unable to
- // execute or uninstall them.
- outFile.permissions |= parseInt("0700", 8);
- log.info(entry + " was successfully extracted to: " +
- outFile.path);
- });
- zipReader.close();
- if (!GMPInstallManager.overrideLeaveDownloadedZip) {
- zipFile.remove(false);
- }
-
- log.info(this.zipPath + " was installed successfully");
- this._deferred.resolve(extractedPaths);
- } catch (e) {
- if (zipReader) {
- zipReader.close();
- }
- this._deferred.reject({
- target: this,
- status: e,
- type: "exception"
- });
- }
- return this._deferred.promise;
- }
-};
-
-
-/**
- * Constructs an object which downloads and initiates an install of
- * the specified GMPAddon object.
- * @param gmpAddon The addon to install.
- */
-function GMPDownloader(gmpAddon)
-{
- this._gmpAddon = gmpAddon;
-}
-
-GMPDownloader.prototype = {
- /**
- * Starts the download process for an addon.
- * @return a promise which will be resolved or rejected
- * See GMPInstallManager.installAddon for resolve/rejected info
- */
- start: function() {
- let log = getScopedLogger("GMPDownloader");
- let gmpAddon = this._gmpAddon;
-
- if (!gmpAddon.isValid) {
- log.info("gmpAddon is not valid, will not continue");
- return Promise.reject({
- target: this,
- status: status,
- type: "downloaderr"
- });
- }
-
- return ProductAddonChecker.downloadAddon(gmpAddon).then((zipPath) => {
- let path = OS.Path.join(OS.Constants.Path.profileDir,
- gmpAddon.id,
- gmpAddon.version);
- log.info("install to directory path: " + path);
- let gmpInstaller = new GMPExtractor(zipPath, path);
- let installPromise = gmpInstaller.install();
- return installPromise.then(extractedPaths => {
- // Success, set the prefs
- let now = Math.round(Date.now() / 1000);
- GMPPrefs.set(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, now, gmpAddon.id);
- // Remember our ABI, so that if the profile is migrated to another
- // platform or from 32 -> 64 bit, we notice and don't try to load the
- // unexecutable plugin library.
- GMPPrefs.set(GMPPrefs.KEY_PLUGIN_ABI, UpdateUtils.ABI, gmpAddon.id);
- // Setting the version pref signals installation completion to consumers,
- // if you need to set other prefs etc. do it before this.
- GMPPrefs.set(GMPPrefs.KEY_PLUGIN_VERSION, gmpAddon.version,
- gmpAddon.id);
- return extractedPaths;
- });
- });
- },
-};
diff --git a/toolkit/mozapps/webextensions/LightweightThemeManager.jsm b/toolkit/mozapps/webextensions/LightweightThemeManager.jsm
deleted file mode 100644
index 5dd41831df..0000000000
--- a/toolkit/mozapps/webextensions/LightweightThemeManager.jsm
+++ /dev/null
@@ -1,909 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["LightweightThemeManager"];
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/AddonManager.jsm");
-/* globals AddonManagerPrivate*/
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const ID_SUFFIX = "@personas.mozilla.org";
-const PREF_LWTHEME_TO_SELECT = "extensions.lwThemeToSelect";
-const PREF_GENERAL_SKINS_SELECTEDSKIN = "general.skins.selectedSkin";
-const PREF_EM_DSS_ENABLED = "extensions.dss.enabled";
-const ADDON_TYPE = "theme";
-
-const URI_EXTENSION_STRINGS = "chrome://mozapps/locale/extensions/extensions.properties";
-
-const STRING_TYPE_NAME = "type.%ID%.name";
-
-const DEFAULT_MAX_USED_THEMES_COUNT = 30;
-
-const MAX_PREVIEW_SECONDS = 30;
-
-const MANDATORY = ["id", "name", "headerURL"];
-const OPTIONAL = ["footerURL", "textcolor", "accentcolor", "iconURL",
- "previewURL", "author", "description", "homepageURL",
- "updateURL", "version"];
-
-const PERSIST_ENABLED = true;
-const PERSIST_BYPASS_CACHE = false;
-const PERSIST_FILES = {
- headerURL: "lightweighttheme-header",
- footerURL: "lightweighttheme-footer"
-};
-
-XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
- "resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ServiceRequest",
- "resource://gre/modules/ServiceRequest.jsm");
-
-
-XPCOMUtils.defineLazyGetter(this, "_prefs", () => {
- return Services.prefs.getBranch("lightweightThemes.");
-});
-
-Object.defineProperty(this, "_maxUsedThemes", {
- get: function() {
- delete this._maxUsedThemes;
- try {
- this._maxUsedThemes = _prefs.getIntPref("maxUsedThemes");
- }
- catch (e) {
- this._maxUsedThemes = DEFAULT_MAX_USED_THEMES_COUNT;
- }
- return this._maxUsedThemes;
- },
-
- set: function(val) {
- delete this._maxUsedThemes;
- return this._maxUsedThemes = val;
- },
- configurable: true,
-});
-
-// Holds the ID of the theme being enabled or disabled while sending out the
-// events so cached AddonWrapper instances can return correct values for
-// permissions and pendingOperations
-var _themeIDBeingEnabled = null;
-var _themeIDBeingDisabled = null;
-
-// Convert from the old storage format (in which the order of usedThemes
-// was combined with isThemeSelected to determine which theme was selected)
-// to the new one (where a selectedThemeID determines which theme is selected).
-(function() {
- let wasThemeSelected = false;
- try {
- wasThemeSelected = _prefs.getBoolPref("isThemeSelected");
- } catch (e) { }
-
- if (wasThemeSelected) {
- _prefs.clearUserPref("isThemeSelected");
- let themes = [];
- try {
- themes = JSON.parse(_prefs.getComplexValue("usedThemes",
- Ci.nsISupportsString).data);
- } catch (e) { }
-
- if (Array.isArray(themes) && themes[0]) {
- _prefs.setCharPref("selectedThemeID", themes[0].id);
- }
- }
-})();
-
-this.LightweightThemeManager = {
- get name() {
- return "LightweightThemeManager";
- },
-
- // Themes that can be added for an application. They can't be removed, and
- // will always show up at the top of the list.
- _builtInThemes: new Map(),
-
- get usedThemes () {
- let themes = [];
- try {
- themes = JSON.parse(_prefs.getComplexValue("usedThemes",
- Ci.nsISupportsString).data);
- } catch (e) { }
-
- themes.push(...this._builtInThemes.values());
- return themes;
- },
-
- get currentTheme () {
- let selectedThemeID = null;
- try {
- selectedThemeID = _prefs.getCharPref("selectedThemeID");
- } catch (e) {}
-
- let data = null;
- if (selectedThemeID) {
- data = this.getUsedTheme(selectedThemeID);
- }
- return data;
- },
-
- get currentThemeForDisplay () {
- var data = this.currentTheme;
-
- if (data && PERSIST_ENABLED) {
- for (let key in PERSIST_FILES) {
- try {
- if (data[key] && _prefs.getBoolPref("persisted." + key))
- data[key] = _getLocalImageURI(PERSIST_FILES[key]).spec
- + "?" + data.id + ";" + _version(data);
- } catch (e) {}
- }
- }
-
- return data;
- },
-
- set currentTheme (aData) {
- return _setCurrentTheme(aData, false);
- },
-
- setLocalTheme: function(aData) {
- _setCurrentTheme(aData, true);
- },
-
- getUsedTheme: function(aId) {
- var usedThemes = this.usedThemes;
- for (let usedTheme of usedThemes) {
- if (usedTheme.id == aId)
- return usedTheme;
- }
- return null;
- },
-
- forgetUsedTheme: function(aId) {
- let theme = this.getUsedTheme(aId);
- if (!theme || LightweightThemeManager._builtInThemes.has(theme.id))
- return;
-
- let wrapper = new AddonWrapper(theme);
- AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper, false);
-
- var currentTheme = this.currentTheme;
- if (currentTheme && currentTheme.id == aId) {
- this.themeChanged(null);
- AddonManagerPrivate.notifyAddonChanged(null, ADDON_TYPE, false);
- }
-
- _updateUsedThemes(_usedThemesExceptId(aId));
- AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
- },
-
- addBuiltInTheme: function(theme) {
- if (!theme || !theme.id || this.usedThemes.some(t => t.id == theme.id)) {
- throw new Error("Trying to add invalid builtIn theme");
- }
-
- this._builtInThemes.set(theme.id, theme);
-
- if (_prefs.getCharPref("selectedThemeID") == theme.id) {
- this.currentTheme = theme;
- }
- },
-
- forgetBuiltInTheme: function(id) {
- if (!this._builtInThemes.has(id)) {
- let currentTheme = this.currentTheme;
- if (currentTheme && currentTheme.id == id) {
- this.currentTheme = null;
- }
- }
- return this._builtInThemes.delete(id);
- },
-
- clearBuiltInThemes: function() {
- for (let id of this._builtInThemes.keys()) {
- this.forgetBuiltInTheme(id);
- }
- },
-
- previewTheme: function(aData) {
- let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
- cancel.data = false;
- Services.obs.notifyObservers(cancel, "lightweight-theme-preview-requested",
- JSON.stringify(aData));
- if (cancel.data)
- return;
-
- if (_previewTimer)
- _previewTimer.cancel();
- else
- _previewTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- _previewTimer.initWithCallback(_previewTimerCallback,
- MAX_PREVIEW_SECONDS * 1000,
- _previewTimer.TYPE_ONE_SHOT);
-
- _notifyWindows(aData);
- },
-
- resetPreview: function() {
- if (_previewTimer) {
- _previewTimer.cancel();
- _previewTimer = null;
- _notifyWindows(this.currentThemeForDisplay);
- }
- },
-
- parseTheme: function(aString, aBaseURI) {
- try {
- return _sanitizeTheme(JSON.parse(aString), aBaseURI, false);
- } catch (e) {
- return null;
- }
- },
-
- updateCurrentTheme: function() {
- try {
- if (!_prefs.getBoolPref("update.enabled"))
- return;
- } catch (e) {
- return;
- }
-
- var theme = this.currentTheme;
- if (!theme || !theme.updateURL)
- return;
-
- var req = new ServiceRequest();
-
- req.mozBackgroundRequest = true;
- req.overrideMimeType("text/plain");
- req.open("GET", theme.updateURL, true);
- // Prevent the request from reading from the cache.
- req.channel.loadFlags |= Ci.nsIRequest.LOAD_BYPASS_CACHE;
- // Prevent the request from writing to the cache.
- req.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
-
- req.addEventListener("load", () => {
- if (req.status != 200)
- return;
-
- let newData = this.parseTheme(req.responseText, theme.updateURL);
- if (!newData ||
- newData.id != theme.id ||
- _version(newData) == _version(theme))
- return;
-
- var currentTheme = this.currentTheme;
- if (currentTheme && currentTheme.id == theme.id)
- this.currentTheme = newData;
- }, false);
-
- req.send(null);
- },
-
- /**
- * Switches to a new lightweight theme.
- *
- * @param aData
- * The lightweight theme to switch to
- */
- themeChanged: function(aData) {
- if (_previewTimer) {
- _previewTimer.cancel();
- _previewTimer = null;
- }
-
- if (aData) {
- let usedThemes = _usedThemesExceptId(aData.id);
- usedThemes.unshift(aData);
- _updateUsedThemes(usedThemes);
- if (PERSIST_ENABLED) {
- LightweightThemeImageOptimizer.purge();
- _persistImages(aData, function() {
- _notifyWindows(this.currentThemeForDisplay);
- }.bind(this));
- }
- }
-
- if (aData)
- _prefs.setCharPref("selectedThemeID", aData.id);
- else
- _prefs.setCharPref("selectedThemeID", "");
-
- _notifyWindows(aData);
- Services.obs.notifyObservers(null, "lightweight-theme-changed", null);
- },
-
- /**
- * Starts the Addons provider and enables the new lightweight theme if
- * necessary.
- */
- startup: function() {
- if (Services.prefs.prefHasUserValue(PREF_LWTHEME_TO_SELECT)) {
- let id = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
- if (id)
- this.themeChanged(this.getUsedTheme(id));
- else
- this.themeChanged(null);
- Services.prefs.clearUserPref(PREF_LWTHEME_TO_SELECT);
- }
-
- _prefs.addObserver("", _prefObserver, false);
- },
-
- /**
- * Shuts down the provider.
- */
- shutdown: function() {
- _prefs.removeObserver("", _prefObserver);
- },
-
- /**
- * Called when a new add-on has been enabled when only one add-on of that type
- * can be enabled.
- *
- * @param aId
- * The ID of the newly enabled add-on
- * @param aType
- * The type of the newly enabled add-on
- * @param aPendingRestart
- * true if the newly enabled add-on will only become enabled after a
- * restart
- */
- addonChanged: function(aId, aType, aPendingRestart) {
- if (aType != ADDON_TYPE)
- return;
-
- let id = _getInternalID(aId);
- let current = this.currentTheme;
-
- try {
- let next = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
- if (id == next && aPendingRestart)
- return;
-
- Services.prefs.clearUserPref(PREF_LWTHEME_TO_SELECT);
- if (next) {
- AddonManagerPrivate.callAddonListeners("onOperationCancelled",
- new AddonWrapper(this.getUsedTheme(next)));
- }
- else if (id == current.id) {
- AddonManagerPrivate.callAddonListeners("onOperationCancelled",
- new AddonWrapper(current));
- return;
- }
- }
- catch (e) {
- }
-
- if (current) {
- if (current.id == id)
- return;
- _themeIDBeingDisabled = current.id;
- let wrapper = new AddonWrapper(current);
- if (aPendingRestart) {
- Services.prefs.setCharPref(PREF_LWTHEME_TO_SELECT, "");
- AddonManagerPrivate.callAddonListeners("onDisabling", wrapper, true);
- }
- else {
- AddonManagerPrivate.callAddonListeners("onDisabling", wrapper, false);
- this.themeChanged(null);
- AddonManagerPrivate.callAddonListeners("onDisabled", wrapper);
- }
- _themeIDBeingDisabled = null;
- }
-
- if (id) {
- let theme = this.getUsedTheme(id);
- _themeIDBeingEnabled = id;
- let wrapper = new AddonWrapper(theme);
- if (aPendingRestart) {
- AddonManagerPrivate.callAddonListeners("onEnabling", wrapper, true);
- Services.prefs.setCharPref(PREF_LWTHEME_TO_SELECT, id);
-
- // Flush the preferences to disk so they survive any crash
- Services.prefs.savePrefFile(null);
- }
- else {
- AddonManagerPrivate.callAddonListeners("onEnabling", wrapper, false);
- this.themeChanged(theme);
- AddonManagerPrivate.callAddonListeners("onEnabled", wrapper);
- }
- _themeIDBeingEnabled = null;
- }
- },
-
- /**
- * Called to get an Addon with a particular ID.
- *
- * @param aId
- * The ID of the add-on to retrieve
- * @param aCallback
- * A callback to pass the Addon to
- */
- getAddonByID: function(aId, aCallback) {
- let id = _getInternalID(aId);
- if (!id) {
- aCallback(null);
- return;
- }
-
- let theme = this.getUsedTheme(id);
- if (!theme) {
- aCallback(null);
- return;
- }
-
- aCallback(new AddonWrapper(theme));
- },
-
- /**
- * Called to get Addons of a particular type.
- *
- * @param aTypes
- * An array of types to fetch. Can be null to get all types.
- * @param aCallback
- * A callback to pass an array of Addons to
- */
- getAddonsByTypes: function(aTypes, aCallback) {
- if (aTypes && aTypes.indexOf(ADDON_TYPE) == -1) {
- aCallback([]);
- return;
- }
-
- aCallback(this.usedThemes.map(a => new AddonWrapper(a)));
- },
-};
-
-const wrapperMap = new WeakMap();
-let themeFor = wrapper => wrapperMap.get(wrapper);
-
-/**
- * The AddonWrapper wraps lightweight theme to provide the data visible to
- * consumers of the AddonManager API.
- */
-function AddonWrapper(aTheme) {
- wrapperMap.set(this, aTheme);
-}
-
-AddonWrapper.prototype = {
- get id() {
- return themeFor(this).id + ID_SUFFIX;
- },
-
- get type() {
- return ADDON_TYPE;
- },
-
- get isActive() {
- let current = LightweightThemeManager.currentTheme;
- if (current)
- return themeFor(this).id == current.id;
- return false;
- },
-
- get name() {
- return themeFor(this).name;
- },
-
- get version() {
- let theme = themeFor(this);
- return "version" in theme ? theme.version : "";
- },
-
- get creator() {
- let theme = themeFor(this);
- return "author" in theme ? new AddonManagerPrivate.AddonAuthor(theme.author) : null;
- },
-
- get screenshots() {
- let url = themeFor(this).previewURL;
- return [new AddonManagerPrivate.AddonScreenshot(url)];
- },
-
- get pendingOperations() {
- let pending = AddonManager.PENDING_NONE;
- if (this.isActive == this.userDisabled)
- pending |= this.isActive ? AddonManager.PENDING_DISABLE : AddonManager.PENDING_ENABLE;
- return pending;
- },
-
- get operationsRequiringRestart() {
- // If a non-default theme is in use then a restart will be required to
- // enable lightweight themes unless dynamic theme switching is enabled
- if (Services.prefs.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN)) {
- try {
- if (Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED))
- return AddonManager.OP_NEEDS_RESTART_NONE;
- }
- catch (e) {
- }
- return AddonManager.OP_NEEDS_RESTART_ENABLE;
- }
-
- return AddonManager.OP_NEEDS_RESTART_NONE;
- },
-
- get size() {
- // The size changes depending on whether the theme is in use or not, this is
- // probably not worth exposing.
- return null;
- },
-
- get permissions() {
- let permissions = 0;
-
- // Do not allow uninstall of builtIn themes.
- if (!LightweightThemeManager._builtInThemes.has(themeFor(this).id))
- permissions = AddonManager.PERM_CAN_UNINSTALL;
- if (this.userDisabled)
- permissions |= AddonManager.PERM_CAN_ENABLE;
- else
- permissions |= AddonManager.PERM_CAN_DISABLE;
- return permissions;
- },
-
- get userDisabled() {
- let id = themeFor(this).id;
- if (_themeIDBeingEnabled == id)
- return false;
- if (_themeIDBeingDisabled == id)
- return true;
-
- try {
- let toSelect = Services.prefs.getCharPref(PREF_LWTHEME_TO_SELECT);
- return id != toSelect;
- }
- catch (e) {
- let current = LightweightThemeManager.currentTheme;
- return !current || current.id != id;
- }
- },
-
- set userDisabled(val) {
- if (val == this.userDisabled)
- return val;
-
- if (val)
- LightweightThemeManager.currentTheme = null;
- else
- LightweightThemeManager.currentTheme = themeFor(this);
-
- return val;
- },
-
- // Lightweight themes are never disabled by the application
- get appDisabled() {
- return false;
- },
-
- // Lightweight themes are always compatible
- get isCompatible() {
- return true;
- },
-
- get isPlatformCompatible() {
- return true;
- },
-
- get scope() {
- return AddonManager.SCOPE_PROFILE;
- },
-
- get foreignInstall() {
- return false;
- },
-
- uninstall: function() {
- LightweightThemeManager.forgetUsedTheme(themeFor(this).id);
- },
-
- cancelUninstall: function() {
- throw new Error("Theme is not marked to be uninstalled");
- },
-
- findUpdates: function(listener, reason, appVersion, platformVersion) {
- AddonManagerPrivate.callNoUpdateListeners(this, listener, reason, appVersion, platformVersion);
- },
-
- // Lightweight themes are always compatible
- isCompatibleWith: function(appVersion, platformVersion) {
- return true;
- },
-
- // Lightweight themes are always securely updated
- get providesUpdatesSecurely() {
- return true;
- },
-
- // Lightweight themes are never blocklisted
- get blocklistState() {
- return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
- }
-};
-
-["description", "homepageURL", "iconURL"].forEach(function(prop) {
- Object.defineProperty(AddonWrapper.prototype, prop, {
- get: function() {
- let theme = themeFor(this);
- return prop in theme ? theme[prop] : null;
- },
- enumarable: true,
- });
-});
-
-["installDate", "updateDate"].forEach(function(prop) {
- Object.defineProperty(AddonWrapper.prototype, prop, {
- get: function() {
- let theme = themeFor(this);
- return prop in theme ? new Date(theme[prop]) : null;
- },
- enumarable: true,
- });
-});
-
-/**
- * Converts the ID used by the public AddonManager API to an lightweight theme
- * ID.
- *
- * @param id
- * The ID to be converted
- *
- * @return the lightweight theme ID or null if the ID was not for a lightweight
- * theme.
- */
-function _getInternalID(id) {
- if (!id)
- return null;
- let len = id.length - ID_SUFFIX.length;
- if (len > 0 && id.substring(len) == ID_SUFFIX)
- return id.substring(0, len);
- return null;
-}
-
-function _setCurrentTheme(aData, aLocal) {
- aData = _sanitizeTheme(aData, null, aLocal);
-
- let needsRestart = (ADDON_TYPE == "theme") &&
- Services.prefs.prefHasUserValue(PREF_GENERAL_SKINS_SELECTEDSKIN);
-
- let cancel = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
- cancel.data = false;
- Services.obs.notifyObservers(cancel, "lightweight-theme-change-requested",
- JSON.stringify(aData));
-
- if (aData) {
- let theme = LightweightThemeManager.getUsedTheme(aData.id);
- let isInstall = !theme || theme.version != aData.version;
- if (isInstall) {
- aData.updateDate = Date.now();
- if (theme && "installDate" in theme)
- aData.installDate = theme.installDate;
- else
- aData.installDate = aData.updateDate;
-
- var oldWrapper = theme ? new AddonWrapper(theme) : null;
- var wrapper = new AddonWrapper(aData);
- AddonManagerPrivate.callInstallListeners("onExternalInstall", null,
- wrapper, oldWrapper, false);
- AddonManagerPrivate.callAddonListeners("onInstalling", wrapper, false);
- }
-
- let current = LightweightThemeManager.currentTheme;
- let usedThemes = _usedThemesExceptId(aData.id);
- if (current && current.id != aData.id)
- usedThemes.splice(1, 0, aData);
- else
- usedThemes.unshift(aData);
- _updateUsedThemes(usedThemes);
-
- if (isInstall)
- AddonManagerPrivate.callAddonListeners("onInstalled", wrapper);
- }
-
- if (cancel.data)
- return null;
-
- AddonManagerPrivate.notifyAddonChanged(aData ? aData.id + ID_SUFFIX : null,
- ADDON_TYPE, needsRestart);
-
- return LightweightThemeManager.currentTheme;
-}
-
-function _sanitizeTheme(aData, aBaseURI, aLocal) {
- if (!aData || typeof aData != "object")
- return null;
-
- var resourceProtocols = ["http", "https", "resource"];
- if (aLocal)
- resourceProtocols.push("file");
- var resourceProtocolExp = new RegExp("^(" + resourceProtocols.join("|") + "):");
-
- function sanitizeProperty(prop) {
- if (!(prop in aData))
- return null;
- if (typeof aData[prop] != "string")
- return null;
- let val = aData[prop].trim();
- if (!val)
- return null;
-
- if (!/URL$/.test(prop))
- return val;
-
- try {
- val = _makeURI(val, aBaseURI ? _makeURI(aBaseURI) : null).spec;
- if ((prop == "updateURL" ? /^https:/ : resourceProtocolExp).test(val))
- return val;
- return null;
- }
- catch (e) {
- return null;
- }
- }
-
- let result = {};
- for (let mandatoryProperty of MANDATORY) {
- let val = sanitizeProperty(mandatoryProperty);
- if (!val)
- throw Components.results.NS_ERROR_INVALID_ARG;
- result[mandatoryProperty] = val;
- }
-
- for (let optionalProperty of OPTIONAL) {
- let val = sanitizeProperty(optionalProperty);
- if (!val)
- continue;
- result[optionalProperty] = val;
- }
-
- return result;
-}
-
-function _usedThemesExceptId(aId) {
- return LightweightThemeManager.usedThemes.filter(function(t) {
- return "id" in t && t.id != aId;
- });
-}
-
-function _version(aThemeData) {
- return aThemeData.version || "";
-}
-
-function _makeURI(aURL, aBaseURI) {
- return Services.io.newURI(aURL, null, aBaseURI);
-}
-
-function _updateUsedThemes(aList) {
- // Remove app-specific themes before saving them to the usedThemes pref.
- aList = aList.filter(theme => !LightweightThemeManager._builtInThemes.has(theme.id));
-
- // Send uninstall events for all themes that need to be removed.
- while (aList.length > _maxUsedThemes) {
- let wrapper = new AddonWrapper(aList[aList.length - 1]);
- AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper, false);
- aList.pop();
- AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
- }
-
- var str = Cc["@mozilla.org/supports-string;1"]
- .createInstance(Ci.nsISupportsString);
- str.data = JSON.stringify(aList);
- _prefs.setComplexValue("usedThemes", Ci.nsISupportsString, str);
-
- Services.obs.notifyObservers(null, "lightweight-theme-list-changed", null);
-}
-
-function _notifyWindows(aThemeData) {
- Services.obs.notifyObservers(null, "lightweight-theme-styling-update",
- JSON.stringify(aThemeData));
-}
-
-var _previewTimer;
-var _previewTimerCallback = {
- notify: function() {
- LightweightThemeManager.resetPreview();
- }
-};
-
-/**
- * Called when any of the lightweightThemes preferences are changed.
- */
-function _prefObserver(aSubject, aTopic, aData) {
- switch (aData) {
- case "maxUsedThemes":
- try {
- _maxUsedThemes = _prefs.getIntPref(aData);
- }
- catch (e) {
- _maxUsedThemes = DEFAULT_MAX_USED_THEMES_COUNT;
- }
- // Update the theme list to remove any themes over the number we keep
- _updateUsedThemes(LightweightThemeManager.usedThemes);
- break;
- }
-}
-
-function _persistImages(aData, aCallback) {
- function onSuccess(key) {
- return function () {
- let current = LightweightThemeManager.currentTheme;
- if (current && current.id == aData.id) {
- _prefs.setBoolPref("persisted." + key, true);
- }
- if (--numFilesToPersist == 0 && aCallback) {
- aCallback();
- }
- };
- }
-
- let numFilesToPersist = 0;
- for (let key in PERSIST_FILES) {
- _prefs.setBoolPref("persisted." + key, false);
- if (aData[key]) {
- numFilesToPersist++;
- _persistImage(aData[key], PERSIST_FILES[key], onSuccess(key));
- }
- }
-}
-
-function _getLocalImageURI(localFileName) {
- var localFile = Services.dirsvc.get("ProfD", Ci.nsIFile);
- localFile.append(localFileName);
- return Services.io.newFileURI(localFile);
-}
-
-function _persistImage(sourceURL, localFileName, successCallback) {
- if (/^(file|resource):/.test(sourceURL))
- return;
-
- var targetURI = _getLocalImageURI(localFileName);
- var sourceURI = _makeURI(sourceURL);
-
- var persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
- .createInstance(Ci.nsIWebBrowserPersist);
-
- persist.persistFlags =
- Ci.nsIWebBrowserPersist.PERSIST_FLAGS_REPLACE_EXISTING_FILES |
- Ci.nsIWebBrowserPersist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION |
- (PERSIST_BYPASS_CACHE ?
- Ci.nsIWebBrowserPersist.PERSIST_FLAGS_BYPASS_CACHE :
- Ci.nsIWebBrowserPersist.PERSIST_FLAGS_FROM_CACHE);
-
- persist.progressListener = new _persistProgressListener(successCallback);
-
- persist.saveURI(sourceURI, null,
- null, Ci.nsIHttpChannel.REFERRER_POLICY_NO_REFERRER_WHEN_DOWNGRADE,
- null, null, targetURI, null);
-}
-
-function _persistProgressListener(successCallback) {
- this.onLocationChange = function() {};
- this.onProgressChange = function() {};
- this.onStatusChange = function() {};
- this.onSecurityChange = function() {};
- this.onStateChange = function(aWebProgress, aRequest, aStateFlags, aStatus) {
- if (aRequest &&
- aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK &&
- aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
- try {
- if (aRequest.QueryInterface(Ci.nsIHttpChannel).requestSucceeded) {
- // success
- successCallback();
- return;
- }
- } catch (e) { }
- // failure
- }
- };
-}
-
-AddonManagerPrivate.registerProvider(LightweightThemeManager, [
- new AddonManagerPrivate.AddonType("theme", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 5000)
-]);
diff --git a/toolkit/mozapps/webextensions/addonManager.js b/toolkit/mozapps/webextensions/addonManager.js
deleted file mode 100644
index d34cbaf624..0000000000
--- a/toolkit/mozapps/webextensions/addonManager.js
+++ /dev/null
@@ -1,296 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This component serves as integration between the platform and AddonManager.
- * It is responsible for initializing and shutting down the AddonManager as well
- * as passing new installs from webpages to the AddonManager.
- */
-
-"use strict";
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-// The old XPInstall error codes
-const EXECUTION_ERROR = -203;
-const CANT_READ_ARCHIVE = -207;
-const USER_CANCELLED = -210;
-const DOWNLOAD_ERROR = -228;
-const UNSUPPORTED_TYPE = -244;
-const SUCCESS = 0;
-
-const MSG_INSTALL_ENABLED = "WebInstallerIsInstallEnabled";
-const MSG_INSTALL_ADDONS = "WebInstallerInstallAddonsFromWebpage";
-const MSG_INSTALL_CALLBACK = "WebInstallerInstallCallback";
-
-const MSG_PROMISE_REQUEST = "WebAPIPromiseRequest";
-const MSG_PROMISE_RESULT = "WebAPIPromiseResult";
-const MSG_INSTALL_EVENT = "WebAPIInstallEvent";
-const MSG_INSTALL_CLEANUP = "WebAPICleanup";
-const MSG_ADDON_EVENT_REQ = "WebAPIAddonEventRequest";
-const MSG_ADDON_EVENT = "WebAPIAddonEvent";
-
-const CHILD_SCRIPT = "resource://gre/modules/addons/Content.js";
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-var gSingleton = null;
-
-function amManager() {
- Cu.import("resource://gre/modules/AddonManager.jsm");
- /* globals AddonManagerPrivate*/
-
- Services.mm.loadFrameScript(CHILD_SCRIPT, true);
- Services.mm.addMessageListener(MSG_INSTALL_ENABLED, this);
- Services.mm.addMessageListener(MSG_INSTALL_ADDONS, this);
- Services.mm.addMessageListener(MSG_PROMISE_REQUEST, this);
- Services.mm.addMessageListener(MSG_INSTALL_CLEANUP, this);
- Services.mm.addMessageListener(MSG_ADDON_EVENT_REQ, this);
-
- Services.obs.addObserver(this, "message-manager-close", false);
- Services.obs.addObserver(this, "message-manager-disconnect", false);
-
- AddonManager.webAPI.setEventHandler(this.sendEvent);
-
- // Needed so receiveMessage can be called directly by JS callers
- this.wrappedJSObject = this;
-}
-
-amManager.prototype = {
- observe: function(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "addons-startup":
- AddonManagerPrivate.startup();
- break;
-
- case "message-manager-close":
- case "message-manager-disconnect":
- this.childClosed(aSubject);
- break;
- }
- },
-
- /**
- * @see amIAddonManager.idl
- */
- mapURIToAddonID: function(uri, id) {
- id.value = AddonManager.mapURIToAddonID(uri);
- return !!id.value;
- },
-
- /**
- * @see amIWebInstaller.idl
- */
- isInstallEnabled: function(aMimetype, aReferer) {
- return AddonManager.isInstallEnabled(aMimetype);
- },
-
- /**
- * @see amIWebInstaller.idl
- */
- installAddonsFromWebpage: function(aMimetype, aBrowser, aInstallingPrincipal,
- aUris, aHashes, aNames, aIcons, aCallback) {
- if (aUris.length == 0)
- return false;
-
- let retval = true;
- if (!AddonManager.isInstallAllowed(aMimetype, aInstallingPrincipal)) {
- aCallback = null;
- retval = false;
- }
-
- let installs = [];
- function buildNextInstall() {
- if (aUris.length == 0) {
- AddonManager.installAddonsFromWebpage(aMimetype, aBrowser, aInstallingPrincipal, installs);
- return;
- }
- let uri = aUris.shift();
- AddonManager.getInstallForURL(uri, function(aInstall) {
- function callCallback(aUri, aStatus) {
- try {
- aCallback.onInstallEnded(aUri, aStatus);
- }
- catch (e) {
- Components.utils.reportError(e);
- }
- }
-
- if (aInstall) {
- installs.push(aInstall);
- if (aCallback) {
- aInstall.addListener({
- onDownloadCancelled: function(aInstall) {
- callCallback(uri, USER_CANCELLED);
- },
-
- onDownloadFailed: function(aInstall) {
- if (aInstall.error == AddonManager.ERROR_CORRUPT_FILE)
- callCallback(uri, CANT_READ_ARCHIVE);
- else
- callCallback(uri, DOWNLOAD_ERROR);
- },
-
- onInstallFailed: function(aInstall) {
- callCallback(uri, EXECUTION_ERROR);
- },
-
- onInstallEnded: function(aInstall, aStatus) {
- callCallback(uri, SUCCESS);
- }
- });
- }
- }
- else if (aCallback) {
- aCallback.onInstallEnded(uri, UNSUPPORTED_TYPE);
- }
- buildNextInstall();
- }, aMimetype, aHashes.shift(), aNames.shift(), aIcons.shift(), null, aBrowser);
- }
- buildNextInstall();
-
- return retval;
- },
-
- notify: function(aTimer) {
- AddonManagerPrivate.backgroundUpdateTimerHandler();
- },
-
- // Maps message manager instances for content processes to the associated
- // AddonListener instances.
- addonListeners: new Map(),
-
- _addAddonListener(target) {
- if (!this.addonListeners.has(target)) {
- let handler = (event, id, needsRestart) => {
- target.sendAsyncMessage(MSG_ADDON_EVENT, {event, id, needsRestart});
- };
- let listener = {
- onEnabling: (addon, needsRestart) => handler("onEnabling", addon.id, needsRestart),
- onEnabled: (addon) => handler("onEnabled", addon.id, false),
- onDisabling: (addon, needsRestart) => handler("onDisabling", addon.id, needsRestart),
- onDisabled: (addon) => handler("onDisabled", addon.id, false),
- onInstalling: (addon, needsRestart) => handler("onInstalling", addon.id, needsRestart),
- onInstalled: (addon) => handler("onInstalled", addon.id, false),
- onUninstalling: (addon, needsRestart) => handler("onUninstalling", addon.id, needsRestart),
- onUninstalled: (addon) => handler("onUninstalled", addon.id, false),
- onOperationCancelled: (addon) => handler("onOperationCancelled", addon.id, false),
- };
- this.addonListeners.set(target, listener);
- AddonManager.addAddonListener(listener);
- }
- },
-
- _removeAddonListener(target) {
- if (this.addonListeners.has(target)) {
- AddonManager.removeAddonListener(this.addonListeners.get(target));
- this.addonListeners.delete(target);
- }
- },
-
- /**
- * messageManager callback function.
- *
- * Listens to requests from child processes for InstallTrigger
- * activity, and sends back callbacks.
- */
- receiveMessage: function(aMessage) {
- let payload = aMessage.data;
-
- switch (aMessage.name) {
- case MSG_INSTALL_ENABLED:
- return AddonManager.isInstallEnabled(payload.mimetype);
-
- case MSG_INSTALL_ADDONS: {
- let callback = null;
- if (payload.callbackID != -1) {
- let mm = aMessage.target.messageManager;
- callback = {
- onInstallEnded: function(url, status) {
- mm.sendAsyncMessage(MSG_INSTALL_CALLBACK, {
- callbackID: payload.callbackID,
- url: url,
- status: status
- });
- },
- };
- }
-
- return this.installAddonsFromWebpage(payload.mimetype,
- aMessage.target, payload.triggeringPrincipal, payload.uris,
- payload.hashes, payload.names, payload.icons, callback);
- }
-
- case MSG_PROMISE_REQUEST: {
- let mm = aMessage.target.messageManager;
- let resolve = (value) => {
- mm.sendAsyncMessage(MSG_PROMISE_RESULT, {
- callbackID: payload.callbackID,
- resolve: value
- });
- }
- let reject = (value) => {
- mm.sendAsyncMessage(MSG_PROMISE_RESULT, {
- callbackID: payload.callbackID,
- reject: value
- });
- }
-
- let API = AddonManager.webAPI;
- if (payload.type in API) {
- API[payload.type](aMessage.target, ...payload.args).then(resolve, reject);
- }
- else {
- reject("Unknown Add-on API request.");
- }
- break;
- }
-
- case MSG_INSTALL_CLEANUP: {
- AddonManager.webAPI.clearInstalls(payload.ids);
- break;
- }
-
- case MSG_ADDON_EVENT_REQ: {
- let target = aMessage.target.messageManager;
- if (payload.enabled) {
- this._addAddonListener(target);
- } else {
- this._removeAddonListener(target);
- }
- }
- }
- return undefined;
- },
-
- childClosed(target) {
- AddonManager.webAPI.clearInstallsFrom(target);
- this._removeAddonListener(target);
- },
-
- sendEvent(mm, data) {
- mm.sendAsyncMessage(MSG_INSTALL_EVENT, data);
- },
-
- classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
- _xpcom_factory: {
- createInstance: function(aOuter, aIid) {
- if (aOuter != null)
- throw Components.Exception("Component does not support aggregation",
- Cr.NS_ERROR_NO_AGGREGATION);
-
- if (!gSingleton)
- gSingleton = new amManager();
- return gSingleton.QueryInterface(aIid);
- }
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.amIAddonManager,
- Ci.amIWebInstaller,
- Ci.nsITimerCallback,
- Ci.nsIObserver,
- Ci.nsIMessageListener])
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager]);
diff --git a/toolkit/mozapps/webextensions/amInstallTrigger.js b/toolkit/mozapps/webextensions/amInstallTrigger.js
deleted file mode 100644
index 382791d326..0000000000
--- a/toolkit/mozapps/webextensions/amInstallTrigger.js
+++ /dev/null
@@ -1,240 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/Log.jsm");
-
-const XPINSTALL_MIMETYPE = "application/x-xpinstall";
-
-const MSG_INSTALL_ENABLED = "WebInstallerIsInstallEnabled";
-const MSG_INSTALL_ADDONS = "WebInstallerInstallAddonsFromWebpage";
-const MSG_INSTALL_CALLBACK = "WebInstallerInstallCallback";
-
-
-var log = Log.repository.getLogger("AddonManager.InstallTrigger");
-log.level = Log.Level[Preferences.get("extensions.logging.enabled", false) ? "Warn" : "Trace"];
-
-function CallbackObject(id, callback, urls, mediator) {
- this.id = id;
- this.callback = callback;
- this.urls = new Set(urls);
- this.callCallback = function(url, status) {
- try {
- this.callback(url, status);
- }
- catch (e) {
- log.warn("InstallTrigger callback threw an exception: " + e);
- }
-
- this.urls.delete(url);
- if (this.urls.size == 0)
- mediator._callbacks.delete(id);
- };
-}
-
-function RemoteMediator(window) {
- window.QueryInterface(Ci.nsIInterfaceRequestor);
- let utils = window.getInterface(Ci.nsIDOMWindowUtils);
- this._windowID = utils.currentInnerWindowID;
-
- this.mm = window
- .getInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIContentFrameMessageManager);
- this.mm.addWeakMessageListener(MSG_INSTALL_CALLBACK, this);
-
- this._lastCallbackID = 0;
- this._callbacks = new Map();
-}
-
-RemoteMediator.prototype = {
- receiveMessage: function(message) {
- if (message.name == MSG_INSTALL_CALLBACK) {
- let payload = message.data;
- let callbackHandler = this._callbacks.get(payload.callbackID);
- if (callbackHandler) {
- callbackHandler.callCallback(payload.url, payload.status);
- }
- }
- },
-
- enabled: function(url) {
- let params = {
- mimetype: XPINSTALL_MIMETYPE
- };
- return this.mm.sendSyncMessage(MSG_INSTALL_ENABLED, params)[0];
- },
-
- install: function(installs, principal, callback, window) {
- let callbackID = this._addCallback(callback, installs.uris);
-
- installs.mimetype = XPINSTALL_MIMETYPE;
- installs.triggeringPrincipal = principal;
- installs.callbackID = callbackID;
-
- if (Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
- // When running in the main process this might be a frame inside an
- // in-content UI page, walk up to find the first frame element in a chrome
- // privileged document
- let element = window.frameElement;
- let ssm = Services.scriptSecurityManager;
- while (element && !ssm.isSystemPrincipal(element.ownerDocument.nodePrincipal))
- element = element.ownerDocument.defaultView.frameElement;
-
- if (element) {
- let listener = Cc["@mozilla.org/addons/integration;1"].
- getService(Ci.nsIMessageListener);
- return listener.wrappedJSObject.receiveMessage({
- name: MSG_INSTALL_ADDONS,
- target: element,
- data: installs,
- });
- }
- }
-
- // Fall back to sending through the message manager
- let messageManager = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIContentFrameMessageManager);
-
- return messageManager.sendSyncMessage(MSG_INSTALL_ADDONS, installs)[0];
- },
-
- _addCallback: function(callback, urls) {
- if (!callback || typeof callback != "function")
- return -1;
-
- let callbackID = this._windowID + "-" + ++this._lastCallbackID;
- let callbackObject = new CallbackObject(callbackID, callback, urls, this);
- this._callbacks.set(callbackID, callbackObject);
- return callbackID;
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference])
-};
-
-
-function InstallTrigger() {
-}
-
-InstallTrigger.prototype = {
- // Here be magic. We've declared ourselves as providing the
- // nsIDOMGlobalPropertyInitializer interface, and are registered in the
- // "JavaScript-global-property" category in the XPCOM category manager. This
- // means that for newly created windows, XPCOM will createinstance this
- // object, and then call init, passing in the window for which we need to
- // provide an instance. We then initialize ourselves and return the webidl
- // version of this object using the webidl-provided _create method, which
- // XPCOM will then duly expose as a property value on the window. All this
- // indirection is necessary because webidl does not (yet) support statics
- // (bug 863952). See bug 926712 for more details about this implementation.
- init: function(window) {
- this._window = window;
- this._principal = window.document.nodePrincipal;
- this._url = window.document.documentURIObject;
-
- try {
- this._mediator = new RemoteMediator(window);
- } catch (ex) {
- // If we can't set up IPC (e.g., because this is a top-level window
- // or something), then don't expose InstallTrigger.
- return null;
- }
-
- return window.InstallTriggerImpl._create(window, this);
- },
-
- enabled: function() {
- return this._mediator.enabled(this._url.spec);
- },
-
- updateEnabled: function() {
- return this.enabled();
- },
-
- install: function(installs, callback) {
- let installData = {
- uris: [],
- hashes: [],
- names: [],
- icons: [],
- };
-
- for (let name of Object.keys(installs)) {
- let item = installs[name];
- if (typeof item === "string") {
- item = { URL: item };
- }
- if (!item.URL) {
- throw new this._window.Error("Missing URL property for '" + name + "'");
- }
-
- let url = this._resolveURL(item.URL);
- if (!this._checkLoadURIFromScript(url)) {
- throw new this._window.Error("Insufficient permissions to install: " + url.spec);
- }
-
- let iconUrl = null;
- if (item.IconURL) {
- iconUrl = this._resolveURL(item.IconURL);
- if (!this._checkLoadURIFromScript(iconUrl)) {
- iconUrl = null; // If page can't load the icon, just ignore it
- }
- }
-
- installData.uris.push(url.spec);
- installData.hashes.push(item.Hash || null);
- installData.names.push(name);
- installData.icons.push(iconUrl ? iconUrl.spec : null);
- }
-
- return this._mediator.install(installData, this._principal, callback, this._window);
- },
-
- startSoftwareUpdate: function(url, flags) {
- let filename = Services.io.newURI(url, null, null)
- .QueryInterface(Ci.nsIURL)
- .filename;
- let args = {};
- args[filename] = { "URL": url };
- return this.install(args);
- },
-
- installChrome: function(type, url, skin) {
- return this.startSoftwareUpdate(url);
- },
-
- _resolveURL: function(url) {
- return Services.io.newURI(url, null, this._url);
- },
-
- _checkLoadURIFromScript: function(uri) {
- let secman = Services.scriptSecurityManager;
- try {
- secman.checkLoadURIWithPrincipal(this._principal,
- uri,
- secman.DISALLOW_INHERIT_PRINCIPAL);
- return true;
- }
- catch (e) {
- return false;
- }
- },
-
- classID: Components.ID("{9df8ef2b-94da-45c9-ab9f-132eb55fddf1}"),
- contractID: "@mozilla.org/addons/installtrigger;1",
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIDOMGlobalPropertyInitializer])
-};
-
-
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([InstallTrigger]);
diff --git a/toolkit/mozapps/webextensions/amWebAPI.js b/toolkit/mozapps/webextensions/amWebAPI.js
deleted file mode 100644
index 5ad0d23f1f..0000000000
--- a/toolkit/mozapps/webextensions/amWebAPI.js
+++ /dev/null
@@ -1,269 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-const MSG_PROMISE_REQUEST = "WebAPIPromiseRequest";
-const MSG_PROMISE_RESULT = "WebAPIPromiseResult";
-const MSG_INSTALL_EVENT = "WebAPIInstallEvent";
-const MSG_INSTALL_CLEANUP = "WebAPICleanup";
-const MSG_ADDON_EVENT_REQ = "WebAPIAddonEventRequest";
-const MSG_ADDON_EVENT = "WebAPIAddonEvent";
-
-class APIBroker {
- constructor(mm) {
- this.mm = mm;
-
- this._promises = new Map();
-
- // _installMap maps integer ids to DOM AddonInstall instances
- this._installMap = new Map();
-
- this.mm.addMessageListener(MSG_PROMISE_RESULT, this);
- this.mm.addMessageListener(MSG_INSTALL_EVENT, this);
-
- this._eventListener = null;
- }
-
- receiveMessage(message) {
- let payload = message.data;
-
- switch (message.name) {
- case MSG_PROMISE_RESULT: {
- if (!this._promises.has(payload.callbackID)) {
- return;
- }
-
- let resolve = this._promises.get(payload.callbackID);
- this._promises.delete(payload.callbackID);
- resolve(payload);
- break;
- }
-
- case MSG_INSTALL_EVENT: {
- let install = this._installMap.get(payload.id);
- if (!install) {
- let err = new Error(`Got install event for unknown install ${payload.id}`);
- Cu.reportError(err);
- return;
- }
- install._dispatch(payload);
- break;
- }
-
- case MSG_ADDON_EVENT: {
- if (this._eventListener) {
- this._eventListener(payload);
- }
- }
- }
- }
-
- sendRequest(type, ...args) {
- return new Promise(resolve => {
- let callbackID = APIBroker._nextID++;
-
- this._promises.set(callbackID, resolve);
- this.mm.sendAsyncMessage(MSG_PROMISE_REQUEST, { type, callbackID, args });
- });
- }
-
- setAddonListener(callback) {
- this._eventListener = callback;
- if (callback) {
- this.mm.addMessageListener(MSG_ADDON_EVENT, this);
- this.mm.sendAsyncMessage(MSG_ADDON_EVENT_REQ, {enabled: true});
- } else {
- this.mm.removeMessageListener(MSG_ADDON_EVENT, this);
- this.mm.sendAsyncMessage(MSG_ADDON_EVENT_REQ, {enabled: false});
- }
- }
-
- sendCleanup(ids) {
- this.setAddonListener(null);
- this.mm.sendAsyncMessage(MSG_INSTALL_CLEANUP, { ids });
- }
-}
-
-APIBroker._nextID = 0;
-
-// Base class for building classes to back content-exposed interfaces.
-class APIObject {
- init(window, broker, properties) {
- this.window = window;
- this.broker = broker;
-
- // Copy any provided properties onto this object, webidl bindings
- // will only expose to content what should be exposed.
- for (let key of Object.keys(properties)) {
- this[key] = properties[key];
- }
- }
-
- /**
- * Helper to implement an asychronous method visible to content, where
- * the method is implemented by sending a message to the parent process
- * and then wrapping the returned object or error in an appropriate object.
- * This helper method ensures that:
- * - Returned Promise objects are from the content window
- * - Rejected Promises have Error objects from the content window
- * - Only non-internal errors are exposed to the caller
- *
- * @param {string} apiRequest The command to invoke in the parent process.
- * @param {array<cloneable>} apiArgs The arguments to include with the
- * request to the parent process.
- * @param {function} resultConvert If provided, a function called with the
- * result from the parent process as an
- * argument. Used to convert the result
- * into something appropriate for content.
- * @returns {Promise<any>} A Promise suitable for passing directly to content.
- */
- _apiTask(apiRequest, apiArgs, resultConverter) {
- let win = this.window;
- let broker = this.broker;
- return new win.Promise((resolve, reject) => {
- Task.spawn(function*() {
- let result = yield broker.sendRequest(apiRequest, ...apiArgs);
- if ("reject" in result) {
- let err = new win.Error(result.reject.message);
- // We don't currently put any other properties onto Errors
- // generated by mozAddonManager. If/when we do, they will
- // need to get copied here.
- reject(err);
- return;
- }
-
- let obj = result.resolve;
- if (resultConverter) {
- obj = resultConverter(obj);
- }
- resolve(obj);
- }).catch(err => {
- Cu.reportError(err);
- reject(new win.Error("Unexpected internal error"));
- });
- });
- }
-}
-
-class Addon extends APIObject {
- constructor(...args) {
- super();
- this.init(...args);
- }
-
- uninstall() {
- return this._apiTask("addonUninstall", [this.id]);
- }
-
- setEnabled(value) {
- return this._apiTask("addonSetEnabled", [this.id, value]);
- }
-}
-
-class AddonInstall extends APIObject {
- constructor(window, broker, properties) {
- super();
- this.init(window, broker, properties);
-
- broker._installMap.set(properties.id, this);
- }
-
- _dispatch(data) {
- // The message for the event includes updated copies of all install
- // properties. Use the usual "let webidl filter visible properties" trick.
- for (let key of Object.keys(data)) {
- this[key] = data[key];
- }
-
- let event = new this.window.Event(data.event);
- this.__DOM_IMPL__.dispatchEvent(event);
- }
-
- install() {
- return this._apiTask("addonInstallDoInstall", [this.id]);
- }
-
- cancel() {
- return this._apiTask("addonInstallCancel", [this.id]);
- }
-}
-
-class WebAPI extends APIObject {
- constructor() {
- super();
- this.allInstalls = [];
- this.listenerCount = 0;
- }
-
- init(window) {
- let mm = window
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIContentFrameMessageManager);
- let broker = new APIBroker(mm);
-
- super.init(window, broker, {});
-
- window.addEventListener("unload", event => {
- this.broker.sendCleanup(this.allInstalls);
- });
- }
-
- getAddonByID(id) {
- return this._apiTask("getAddonByID", [id], addonInfo => {
- if (!addonInfo) {
- return null;
- }
- let addon = new Addon(this.window, this.broker, addonInfo);
- return this.window.Addon._create(this.window, addon);
- });
- }
-
- createInstall(options) {
- return this._apiTask("createInstall", [options], installInfo => {
- if (!installInfo) {
- return null;
- }
- let install = new AddonInstall(this.window, this.broker, installInfo);
- this.allInstalls.push(installInfo.id);
- return this.window.AddonInstall._create(this.window, install);
- });
- }
-
- eventListenerWasAdded(type) {
- if (this.listenerCount == 0) {
- this.broker.setAddonListener(data => {
- let event = new this.window.AddonEvent(data.event, data);
- this.__DOM_IMPL__.dispatchEvent(event);
- });
- }
- this.listenerCount++;
- }
-
- eventListenerWasRemoved(type) {
- this.listenerCount--;
- if (this.listenerCount == 0) {
- this.broker.setAddonListener(null);
- }
- }
-
- QueryInterface(iid) {
- if (iid.equals(WebAPI.classID) || iid.equals(Ci.nsISupports)
- || iid.equals(Ci.nsIDOMGlobalPropertyInitializer)) {
- return this;
- }
- return Cr.NS_ERROR_NO_INTERFACE;
- }
-}
-
-WebAPI.prototype.classID = Components.ID("{8866d8e3-4ea5-48b7-a891-13ba0ac15235}");
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebAPI]);
diff --git a/toolkit/mozapps/webextensions/amWebInstallListener.js b/toolkit/mozapps/webextensions/amWebInstallListener.js
deleted file mode 100644
index 0bcc345e83..0000000000
--- a/toolkit/mozapps/webextensions/amWebInstallListener.js
+++ /dev/null
@@ -1,348 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This is a default implementation of amIWebInstallListener that should work
- * for most applications but can be overriden. It notifies the observer service
- * about blocked installs. For normal installs it pops up an install
- * confirmation when all the add-ons have been downloaded.
- */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PromptUtils", "resource://gre/modules/SharedPromptUtils.jsm");
-
-const URI_XPINSTALL_DIALOG = "chrome://mozapps/content/xpinstall/xpinstallConfirm.xul";
-
-// Installation can begin from any of these states
-const READY_STATES = [
- AddonManager.STATE_AVAILABLE,
- AddonManager.STATE_DOWNLOAD_FAILED,
- AddonManager.STATE_INSTALL_FAILED,
- AddonManager.STATE_CANCELLED
-];
-
-Cu.import("resource://gre/modules/Log.jsm");
-const LOGGER_ID = "addons.weblistener";
-
-// Create a new logger for use by the Addons Web Listener
-// (Requires AddonManager.jsm)
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-function notifyObservers(aTopic, aBrowser, aUri, aInstalls) {
- let info = {
- browser: aBrowser,
- originatingURI: aUri,
- installs: aInstalls,
-
- QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
- };
- Services.obs.notifyObservers(info, aTopic, null);
-}
-
-/**
- * Creates a new installer to monitor downloads and prompt to install when
- * ready
- *
- * @param aBrowser
- * The browser that started the installations
- * @param aUrl
- * The URL that started the installations
- * @param aInstalls
- * An array of AddonInstalls
- */
-function Installer(aBrowser, aUrl, aInstalls) {
- this.browser = aBrowser;
- this.url = aUrl;
- this.downloads = aInstalls;
- this.installed = [];
-
- notifyObservers("addon-install-started", aBrowser, aUrl, aInstalls);
-
- for (let install of aInstalls) {
- install.addListener(this);
-
- // Start downloading if it hasn't already begun
- if (READY_STATES.indexOf(install.state) != -1)
- install.install();
- }
-
- this.checkAllDownloaded();
-}
-
-Installer.prototype = {
- browser: null,
- downloads: null,
- installed: null,
- isDownloading: true,
-
- /**
- * Checks if all downloads are now complete and if so prompts to install.
- */
- checkAllDownloaded: function() {
- // Prevent re-entrancy caused by the confirmation dialog cancelling unwanted
- // installs.
- if (!this.isDownloading)
- return;
-
- var failed = [];
- var installs = [];
-
- for (let install of this.downloads) {
- switch (install.state) {
- case AddonManager.STATE_AVAILABLE:
- case AddonManager.STATE_DOWNLOADING:
- // Exit early if any add-ons haven't started downloading yet or are
- // still downloading
- return;
- case AddonManager.STATE_DOWNLOAD_FAILED:
- failed.push(install);
- break;
- case AddonManager.STATE_DOWNLOADED:
- // App disabled items are not compatible and so fail to install
- if (install.addon.appDisabled)
- failed.push(install);
- else
- installs.push(install);
-
- if (install.linkedInstalls) {
- for (let linkedInstall of install.linkedInstalls) {
- linkedInstall.addListener(this);
- // Corrupt or incompatible items fail to install
- if (linkedInstall.state == AddonManager.STATE_DOWNLOAD_FAILED || linkedInstall.addon.appDisabled)
- failed.push(linkedInstall);
- else
- installs.push(linkedInstall);
- }
- }
- break;
- case AddonManager.STATE_CANCELLED:
- // Just ignore cancelled downloads
- break;
- default:
- logger.warn("Download of " + install.sourceURI.spec + " in unexpected state " +
- install.state);
- }
- }
-
- this.isDownloading = false;
- this.downloads = installs;
-
- if (failed.length > 0) {
- // Stop listening and cancel any installs that are failed because of
- // compatibility reasons.
- for (let install of failed) {
- if (install.state == AddonManager.STATE_DOWNLOADED) {
- install.removeListener(this);
- install.cancel();
- }
- }
- notifyObservers("addon-install-failed", this.browser, this.url, failed);
- }
-
- // If none of the downloads were successful then exit early
- if (this.downloads.length == 0)
- return;
-
- // Check for a custom installation prompt that may be provided by the
- // applicaton
- if ("@mozilla.org/addons/web-install-prompt;1" in Cc) {
- try {
- let prompt = Cc["@mozilla.org/addons/web-install-prompt;1"].
- getService(Ci.amIWebInstallPrompt);
- prompt.confirm(this.browser, this.url, this.downloads, this.downloads.length);
- return;
- }
- catch (e) {}
- }
-
- if (Preferences.get("xpinstall.customConfirmationUI", false)) {
- notifyObservers("addon-install-confirmation", this.browser, this.url, this.downloads);
- return;
- }
-
- let args = {};
- args.url = this.url;
- args.installs = this.downloads;
- args.wrappedJSObject = args;
-
- try {
- Cc["@mozilla.org/base/telemetry;1"].
- getService(Ci.nsITelemetry).
- getHistogramById("SECURITY_UI").
- add(Ci.nsISecurityUITelemetry.WARNING_CONFIRM_ADDON_INSTALL);
- let parentWindow = null;
- if (this.browser) {
- parentWindow = this.browser.ownerDocument.defaultView;
- PromptUtils.fireDialogEvent(parentWindow, "DOMWillOpenModalDialog", this.browser);
- }
- Services.ww.openWindow(parentWindow, URI_XPINSTALL_DIALOG,
- null, "chrome,modal,centerscreen", args);
- } catch (e) {
- logger.warn("Exception showing install confirmation dialog", e);
- for (let install of this.downloads) {
- install.removeListener(this);
- // Cancel the installs, as currently there is no way to make them fail
- // from here.
- install.cancel();
- }
- notifyObservers("addon-install-cancelled", this.browser, this.url,
- this.downloads);
- }
- },
-
- /**
- * Checks if all installs are now complete and if so notifies observers.
- */
- checkAllInstalled: function() {
- var failed = [];
-
- for (let install of this.downloads) {
- switch (install.state) {
- case AddonManager.STATE_DOWNLOADED:
- case AddonManager.STATE_INSTALLING:
- // Exit early if any add-ons haven't started installing yet or are
- // still installing
- return;
- case AddonManager.STATE_INSTALL_FAILED:
- failed.push(install);
- break;
- }
- }
-
- this.downloads = null;
-
- if (failed.length > 0)
- notifyObservers("addon-install-failed", this.browser, this.url, failed);
-
- if (this.installed.length > 0)
- notifyObservers("addon-install-complete", this.browser, this.url, this.installed);
- this.installed = null;
- },
-
- onDownloadCancelled: function(aInstall) {
- aInstall.removeListener(this);
- this.checkAllDownloaded();
- },
-
- onDownloadFailed: function(aInstall) {
- aInstall.removeListener(this);
- this.checkAllDownloaded();
- },
-
- onDownloadEnded: function(aInstall) {
- this.checkAllDownloaded();
- return false;
- },
-
- onInstallCancelled: function(aInstall) {
- aInstall.removeListener(this);
- this.checkAllInstalled();
- },
-
- onInstallFailed: function(aInstall) {
- aInstall.removeListener(this);
- this.checkAllInstalled();
- },
-
- onInstallEnded: function(aInstall) {
- aInstall.removeListener(this);
- this.installed.push(aInstall);
-
- // If installing a theme that is disabled and can be enabled then enable it
- if (aInstall.addon.type == "theme" &&
- aInstall.addon.userDisabled == true &&
- aInstall.addon.appDisabled == false) {
- aInstall.addon.userDisabled = false;
- }
-
- this.checkAllInstalled();
- }
-};
-
-function extWebInstallListener() {
-}
-
-extWebInstallListener.prototype = {
- /**
- * @see amIWebInstallListener.idl
- */
- onWebInstallDisabled: function(aBrowser, aUri, aInstalls) {
- let info = {
- browser: aBrowser,
- originatingURI: aUri,
- installs: aInstalls,
-
- QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
- };
- Services.obs.notifyObservers(info, "addon-install-disabled", null);
- },
-
- /**
- * @see amIWebInstallListener.idl
- */
- onWebInstallOriginBlocked: function(aBrowser, aUri, aInstalls) {
- let info = {
- browser: aBrowser,
- originatingURI: aUri,
- installs: aInstalls,
-
- install: function() {
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
- };
- Services.obs.notifyObservers(info, "addon-install-origin-blocked", null);
-
- return false;
- },
-
- /**
- * @see amIWebInstallListener.idl
- */
- onWebInstallBlocked: function(aBrowser, aUri, aInstalls) {
- let info = {
- browser: aBrowser,
- originatingURI: aUri,
- installs: aInstalls,
-
- install: function() {
- new Installer(this.browser, this.originatingURI, this.installs);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallInfo])
- };
- Services.obs.notifyObservers(info, "addon-install-blocked", null);
-
- return false;
- },
-
- /**
- * @see amIWebInstallListener.idl
- */
- onWebInstallRequested: function(aBrowser, aUri, aInstalls) {
- new Installer(aBrowser, aUri, aInstalls);
-
- // We start the installs ourself
- return false;
- },
-
- classDescription: "XPI Install Handler",
- contractID: "@mozilla.org/addons/web-install-listener;1",
- classID: Components.ID("{0f38e086-89a3-40a5-8ffc-9b694de1d04a}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallListener,
- Ci.amIWebInstallListener2])
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([extWebInstallListener]);
diff --git a/toolkit/mozapps/webextensions/content/about.js b/toolkit/mozapps/webextensions/content/about.js
deleted file mode 100644
index 4f8fb353eb..0000000000
--- a/toolkit/mozapps/webextensions/content/about.js
+++ /dev/null
@@ -1,103 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/* import-globals-from ../../../content/contentAreaUtils.js */
-
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/AddonManager.jsm");
-
-function init() {
- var addon = window.arguments[0];
- var extensionsStrings = document.getElementById("extensionsStrings");
-
- document.documentElement.setAttribute("addontype", addon.type);
-
- var iconURL = AddonManager.getPreferredIconURL(addon, 48, window);
- if (iconURL) {
- var extensionIcon = document.getElementById("extensionIcon");
- extensionIcon.src = iconURL;
- }
-
- document.title = extensionsStrings.getFormattedString("aboutWindowTitle", [addon.name]);
- var extensionName = document.getElementById("extensionName");
- extensionName.textContent = addon.name;
-
- var extensionVersion = document.getElementById("extensionVersion");
- if (addon.version)
- extensionVersion.setAttribute("value", extensionsStrings.getFormattedString("aboutWindowVersionString", [addon.version]));
- else
- extensionVersion.hidden = true;
-
- var extensionDescription = document.getElementById("extensionDescription");
- if (addon.description)
- extensionDescription.textContent = addon.description;
- else
- extensionDescription.hidden = true;
-
- var numDetails = 0;
-
- var extensionCreator = document.getElementById("extensionCreator");
- if (addon.creator) {
- extensionCreator.setAttribute("value", addon.creator);
- numDetails++;
- } else {
- extensionCreator.hidden = true;
- var extensionCreatorLabel = document.getElementById("extensionCreatorLabel");
- extensionCreatorLabel.hidden = true;
- }
-
- var extensionHomepage = document.getElementById("extensionHomepage");
- var homepageURL = addon.homepageURL;
- if (homepageURL) {
- extensionHomepage.setAttribute("homepageURL", homepageURL);
- extensionHomepage.setAttribute("tooltiptext", homepageURL);
- numDetails++;
- } else {
- extensionHomepage.hidden = true;
- }
-
- numDetails += appendToList("extensionDevelopers", "developersBox", addon.developers);
- numDetails += appendToList("extensionTranslators", "translatorsBox", addon.translators);
- numDetails += appendToList("extensionContributors", "contributorsBox", addon.contributors);
-
- if (numDetails == 0) {
- var groove = document.getElementById("groove");
- groove.hidden = true;
- var extensionDetailsBox = document.getElementById("extensionDetailsBox");
- extensionDetailsBox.hidden = true;
- }
-
- var acceptButton = document.documentElement.getButton("accept");
- acceptButton.label = extensionsStrings.getString("aboutWindowCloseButton");
-
- setTimeout(sizeToContent, 0);
-}
-
-function appendToList(aHeaderId, aNodeId, aItems) {
- var header = document.getElementById(aHeaderId);
- var node = document.getElementById(aNodeId);
-
- if (!aItems || aItems.length == 0) {
- header.hidden = true;
- return 0;
- }
-
- for (let currentItem of aItems) {
- var label = document.createElement("label");
- label.textContent = currentItem;
- label.setAttribute("class", "contributor");
- node.appendChild(label);
- }
-
- return aItems.length;
-}
-
-function loadHomepage(aEvent) {
- window.close();
- openURL(aEvent.target.getAttribute("homepageURL"));
-}
diff --git a/toolkit/mozapps/webextensions/content/eula.js b/toolkit/mozapps/webextensions/content/eula.js
deleted file mode 100644
index 537ee7284b..0000000000
--- a/toolkit/mozapps/webextensions/content/eula.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/AddonManager.jsm");
-
-function Startup() {
- var bundle = document.getElementById("extensionsStrings");
- var addon = window.arguments[0].addon;
-
- document.documentElement.setAttribute("addontype", addon.type);
-
- var iconURL = AddonManager.getPreferredIconURL(addon, 48, window);
- if (iconURL)
- document.getElementById("icon").src = iconURL;
-
- var label = document.createTextNode(bundle.getFormattedString("eulaHeader", [addon.name]));
- document.getElementById("heading").appendChild(label);
- document.getElementById("eula").value = addon.eula;
-}
diff --git a/toolkit/mozapps/webextensions/content/extensions.css b/toolkit/mozapps/webextensions/content/extensions.css
deleted file mode 100644
index cb5313365f..0000000000
--- a/toolkit/mozapps/webextensions/content/extensions.css
+++ /dev/null
@@ -1,270 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-@namespace xhtml "http://www.w3.org/1999/xhtml";
-
-/* HTML link elements do weird things to the layout if they are not hidden */
-xhtml|link {
- display: none;
-}
-
-#categories {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#categories-list");
-}
-
-.category {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#category");
-}
-
-.sort-controls {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#sorters");
-}
-
-.addon[status="installed"] {
- -moz-box-orient: vertical;
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#addon-generic");
-}
-
-.addon[status="installing"] {
- -moz-box-orient: vertical;
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#addon-installing");
-}
-
-.addon[pending="uninstall"] {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#addon-uninstalled");
-}
-
-.creator {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#creator-link");
-}
-
-.meta-rating {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#rating");
-}
-
-.download-progress, .download-progress[mode="undetermined"] {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#download-progress");
-}
-
-.install-status {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#install-status");
-}
-
-.detail-row {
- -moz-binding: url("chrome://mozapps/content/extensions/extensions.xml#detail-row");
-}
-
-.text-list {
- white-space: pre-line;
- -moz-user-select: element;
-}
-
-setting, row[unsupported="true"] {
- display: none;
-}
-
-setting[type="bool"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-bool");
-}
-
-setting[type="bool"][localized="true"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-localized-bool");
-}
-
-setting[type="bool"]:not([learnmore]) .preferences-learnmore,
-setting[type="boolint"]:not([learnmore]) .preferences-learnmore {
- visibility: collapse;
-}
-
-setting[type="boolint"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-boolint");
-}
-
-setting[type="integer"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-integer");
-}
-
-setting[type="integer"]:not([size]) textbox {
- -moz-box-flex: 1;
-}
-
-setting[type="control"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-control");
-}
-
-setting[type="string"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-string");
-}
-
-setting[type="color"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-color");
-}
-
-setting[type="file"],
-setting[type="directory"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-path");
-}
-
-setting[type="radio"],
-setting[type="menulist"] {
- display: -moz-grid-line;
- -moz-binding: url("chrome://mozapps/content/extensions/setting.xml#setting-multi");
-}
-
-#addonitem-popup > menuitem[disabled="true"] {
- display: none;
-}
-
-#addonitem-popup[addontype="theme"] > #menuitem_enableItem,
-#addonitem-popup[addontype="theme"] > #menuitem_disableItem,
-#addonitem-popup:not([addontype="theme"]) > #menuitem_enableTheme,
-#addonitem-popup:not([addontype="theme"]) > #menuitem_disableTheme {
- display: none;
-}
-
-#show-disabled-unsigned-extensions .button-text {
- margin-inline-start: 3px !important;
- margin-inline-end: 2px !important;
-}
-
-#header-searching:not([active]) {
- visibility: hidden;
-}
-
-#search-list[local="false"] > .addon[remote="false"],
-#search-list[remote="false"] > .addon[remote="true"] {
- visibility: collapse;
-}
-
-#detail-view {
- overflow: auto;
-}
-
-.addon:not([notification="warning"]) .warning,
-.addon:not([notification="error"]) .error,
-.addon:not([notification="info"]) .info,
-.addon:not([pending]) .pending,
-.addon:not([upgrade="true"]) .update-postfix,
-.addon[active="true"] .disabled-postfix,
-.addon[pending="install"] .update-postfix,
-.addon[pending="install"] .disabled-postfix,
-#detail-view:not([notification="warning"]) .warning,
-#detail-view:not([notification="error"]) .error,
-#detail-view:not([notification="info"]) .info,
-#detail-view:not([pending]) .pending,
-#detail-view:not([upgrade="true"]) .update-postfix,
-#detail-view[active="true"] .disabled-postfix,
-#detail-view[loading] .detail-view-container,
-#detail-view:not([loading]) .alert-container,
-.detail-row:not([value]),
-#search-list[remote="false"] #search-allresults-link {
- display: none;
-}
-
-#addons-page:not([warning]) #list-view > .global-warning-container {
- display: none;
-}
-#addon-list .date-updated {
- display: none;
-}
-
-.view-pane:not(#updates-view) .addon .relnotes-toggle,
-.view-pane:not(#updates-view) .addon .include-update,
-#updates-view:not([updatetype="available"]) .addon .include-update,
-#updates-view[updatetype="available"] .addon .update-available-notice {
- display: none;
-}
-
-#addons-page:not([warning]) .global-warning,
-#addons-page:not([warning="safemode"]) .global-warning-safemode,
-#addons-page:not([warning="checkcompatibility"]) .global-warning-checkcompatibility,
-#addons-page:not([warning="updatesecurity"]) .global-warning-updatesecurity {
- display: none;
-}
-
-/* Plugins aren't yet disabled by safemode (bug 342333),
- so don't show that warning when viewing plugins. */
-#addons-page[warning="safemode"] .view-pane[type="plugin"] .global-warning-container,
-#addons-page[warning="safemode"] #detail-view[loading="true"] .global-warning {
- display: none;
-}
-
-#addons-page .view-pane:not([type="plugin"]) #plugindeprecation-notice {
- display: none;
-}
-
-#addons-page .view-pane:not([type="experiment"]) .experiment-info-container {
- display: none;
-}
-
-.addon .relnotes {
- -moz-user-select: text;
-}
-#detail-name, #detail-desc, #detail-fulldesc {
- -moz-user-select: text;
-}
-
-/* Make sure we're not animating hidden images. See bug 623739. */
-#view-port:not([selectedIndex="0"]) #discover-view .loading,
-#discover-view:not([selectedIndex="0"]) .loading {
- display: none;
-}
-
-/* Elements in unselected richlistitems cannot be focused */
-richlistitem:not([selected]) * {
- -moz-user-focus: ignore;
-}
-
-#header-search {
- width: 22em;
-}
-
-#header-utils-btn {
- -moz-user-focus: normal;
-}
-
-.discover-button[disabled="true"] {
- display: none;
-}
-
-#experiments-learn-more[disabled="true"] {
- display: none;
-}
-
-#experiments-change-telemetry[disabled="true"] {
- display: none;
-}
-
-.view-pane[type="experiment"] .error,
-.view-pane[type="experiment"] .warning,
-.view-pane[type="experiment"] .addon:not([pending="uninstall"]) .pending,
-.view-pane[type="experiment"] .disabled-postfix,
-.view-pane[type="experiment"] .update-postfix,
-.view-pane[type="experiment"] .addon-control.enable,
-.view-pane[type="experiment"] .addon-control.disable,
-#detail-view[type="experiment"] .alert-container,
-#detail-view[type="experiment"] #detail-version,
-#detail-view[type="experiment"] #detail-creator,
-#detail-view[type="experiment"] #detail-enable-btn,
-#detail-view[type="experiment"] #detail-disable-btn {
- display: none;
-}
-
-.view-pane:not([type="experiment"]) .experiment-container,
-.view-pane:not([type="experiment"]) #detail-experiment-container {
- display: none;
-}
-
-.addon[type="experiment"][status="installing"] .experiment-time,
-.addon[type="experiment"][status="installing"] .experiment-state {
- display: none;
-}
diff --git a/toolkit/mozapps/webextensions/content/extensions.js b/toolkit/mozapps/webextensions/content/extensions.js
deleted file mode 100644
index 3159eb1e14..0000000000
--- a/toolkit/mozapps/webextensions/content/extensions.js
+++ /dev/null
@@ -1,3827 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-/* import-globals-from ../../../content/contentAreaUtils.js */
-/* globals XMLStylesheetProcessingInstruction*/
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/addons/AddonRepository.jsm");
-
-const CONSTANTS = {};
-Cu.import("resource://gre/modules/addons/AddonConstants.jsm", CONSTANTS);
-const SIGNING_REQUIRED = CONSTANTS.REQUIRE_SIGNING ?
- true :
- Services.prefs.getBoolPref("xpinstall.signatures.required");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
- "resource://gre/modules/PluralForm.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Preferences",
- "resource://gre/modules/Preferences.jsm");
-
-const PREF_DISCOVERURL = "extensions.webservice.discoverURL";
-const PREF_DISCOVER_ENABLED = "extensions.getAddons.showPane";
-const PREF_XPI_ENABLED = "xpinstall.enabled";
-const PREF_MAXRESULTS = "extensions.getAddons.maxResults";
-const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
-const PREF_GETADDONS_CACHE_ID_ENABLED = "extensions.%ID%.getAddons.cache.enabled";
-const PREF_UI_TYPE_HIDDEN = "extensions.ui.%TYPE%.hidden";
-const PREF_UI_LASTCATEGORY = "extensions.ui.lastCategory";
-
-const LOADING_MSG_DELAY = 100;
-
-const SEARCH_SCORE_MULTIPLIER_NAME = 2;
-const SEARCH_SCORE_MULTIPLIER_DESCRIPTION = 2;
-
-// Use integers so search scores are sortable by nsIXULSortService
-const SEARCH_SCORE_MATCH_WHOLEWORD = 10;
-const SEARCH_SCORE_MATCH_WORDBOUNDRY = 6;
-const SEARCH_SCORE_MATCH_SUBSTRING = 3;
-
-const UPDATES_RECENT_TIMESPAN = 2 * 24 * 3600000; // 2 days (in milliseconds)
-const UPDATES_RELEASENOTES_TRANSFORMFILE = "chrome://mozapps/content/extensions/updateinfo.xsl";
-
-const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/parsererror.xml"
-
-var gViewDefault = "addons://discover/";
-
-var gStrings = {};
-XPCOMUtils.defineLazyServiceGetter(gStrings, "bundleSvc",
- "@mozilla.org/intl/stringbundle;1",
- "nsIStringBundleService");
-
-XPCOMUtils.defineLazyGetter(gStrings, "brand", function() {
- return this.bundleSvc.createBundle("chrome://branding/locale/brand.properties");
-});
-XPCOMUtils.defineLazyGetter(gStrings, "ext", function() {
- return this.bundleSvc.createBundle("chrome://mozapps/locale/extensions/extensions.properties");
-});
-XPCOMUtils.defineLazyGetter(gStrings, "dl", function() {
- return this.bundleSvc.createBundle("chrome://mozapps/locale/downloads/downloads.properties");
-});
-
-XPCOMUtils.defineLazyGetter(gStrings, "brandShortName", function() {
- return this.brand.GetStringFromName("brandShortName");
-});
-XPCOMUtils.defineLazyGetter(gStrings, "appVersion", function() {
- return Services.appinfo.version;
-});
-
-document.addEventListener("load", initialize, true);
-window.addEventListener("unload", shutdown, false);
-
-class MessageDispatcher {
- constructor(target) {
- this.listeners = new Map();
- this.target = target;
- }
-
- addMessageListener(name, handler) {
- if (!this.listeners.has(name)) {
- this.listeners.set(name, new Set());
- }
-
- this.listeners.get(name).add(handler);
- }
-
- removeMessageListener(name, handler) {
- if (this.listeners.has(name)) {
- this.listeners.get(name).delete(handler);
- }
- }
-
- sendAsyncMessage(name, data) {
- for (let handler of this.listeners.get(name) || new Set()) {
- Promise.resolve().then(() => {
- handler.receiveMessage({
- name,
- data,
- target: this.target,
- });
- });
- }
- }
-}
-
-/**
- * A mock FrameMessageManager global to allow frame scripts to run in
- * non-top-level, non-remote <browser>s as if they were top-level or
- * remote.
- *
- * @param {Element} browser
- * A XUL <browser> element.
- */
-class FakeFrameMessageManager {
- constructor(browser) {
- let dispatcher = new MessageDispatcher(browser);
- let frameDispatcher = new MessageDispatcher(null);
-
- this.sendAsyncMessage = frameDispatcher.sendAsyncMessage.bind(frameDispatcher);
- this.addMessageListener = dispatcher.addMessageListener.bind(dispatcher);
- this.removeMessageListener = dispatcher.removeMessageListener.bind(dispatcher);
-
- this.frame = {
- get content() {
- return browser.contentWindow;
- },
-
- get docShell() {
- return browser.docShell;
- },
-
- addEventListener: browser.addEventListener.bind(browser),
- removeEventListener: browser.removeEventListener.bind(browser),
-
- sendAsyncMessage: dispatcher.sendAsyncMessage.bind(dispatcher),
- addMessageListener: frameDispatcher.addMessageListener.bind(frameDispatcher),
- removeMessageListener: frameDispatcher.removeMessageListener.bind(frameDispatcher),
- }
- }
-
- loadFrameScript(url) {
- Services.scriptloader.loadSubScript(url, Object.create(this.frame));
- }
-}
-
-var gPendingInitializations = 1;
-Object.defineProperty(this, "gIsInitializing", {
- get: () => gPendingInitializations > 0
-});
-
-function initialize(event) {
- // XXXbz this listener gets _all_ load events for all nodes in the
- // document... but relies on not being called "too early".
- if (event.target instanceof XMLStylesheetProcessingInstruction) {
- return;
- }
- document.removeEventListener("load", initialize, true);
-
- let globalCommandSet = document.getElementById("globalCommandSet");
- globalCommandSet.addEventListener("command", function(event) {
- gViewController.doCommand(event.target.id);
- });
-
- let viewCommandSet = document.getElementById("viewCommandSet");
- viewCommandSet.addEventListener("commandupdate", function(event) {
- gViewController.updateCommands();
- });
- viewCommandSet.addEventListener("command", function(event) {
- gViewController.doCommand(event.target.id);
- });
-
- let detailScreenshot = document.getElementById("detail-screenshot");
- detailScreenshot.addEventListener("load", function(event) {
- this.removeAttribute("loading");
- });
- detailScreenshot.addEventListener("error", function(event) {
- this.setAttribute("loading", "error");
- });
-
- let addonPage = document.getElementById("addons-page");
- addonPage.addEventListener("dragenter", function(event) {
- gDragDrop.onDragOver(event);
- });
- addonPage.addEventListener("dragover", function(event) {
- gDragDrop.onDragOver(event);
- });
- addonPage.addEventListener("drop", function(event) {
- gDragDrop.onDrop(event);
- });
- addonPage.addEventListener("keypress", function(event) {
- gHeader.onKeyPress(event);
- });
-
- if (!isDiscoverEnabled()) {
- gViewDefault = "addons://list/extension";
- }
-
- gViewController.initialize();
- gCategories.initialize();
- gHeader.initialize();
- gEventManager.initialize();
- Services.obs.addObserver(sendEMPong, "EM-ping", false);
- Services.obs.notifyObservers(window, "EM-loaded", "");
-
- // If the initial view has already been selected (by a call to loadView from
- // the above notifications) then bail out now
- if (gViewController.initialViewSelected)
- return;
-
- // If there is a history state to restore then use that
- if (window.history.state) {
- gViewController.updateState(window.history.state);
- return;
- }
-
- // Default to the last selected category
- var view = gCategories.node.value;
-
- // Allow passing in a view through the window arguments
- if ("arguments" in window && window.arguments.length > 0 &&
- window.arguments[0] !== null && "view" in window.arguments[0]) {
- view = window.arguments[0].view;
- }
-
- gViewController.loadInitialView(view);
-}
-
-function notifyInitialized() {
- if (!gIsInitializing)
- return;
-
- gPendingInitializations--;
- if (!gIsInitializing) {
- var event = document.createEvent("Events");
- event.initEvent("Initialized", true, true);
- document.dispatchEvent(event);
- }
-}
-
-function shutdown() {
- gCategories.shutdown();
- gSearchView.shutdown();
- gEventManager.shutdown();
- gViewController.shutdown();
- Services.obs.removeObserver(sendEMPong, "EM-ping");
-}
-
-function sendEMPong(aSubject, aTopic, aData) {
- Services.obs.notifyObservers(window, "EM-pong", "");
-}
-
-// Used by external callers to load a specific view into the manager
-function loadView(aViewId) {
- if (!gViewController.initialViewSelected) {
- // The caller opened the window and immediately loaded the view so it
- // should be the initial history entry
-
- gViewController.loadInitialView(aViewId);
- } else {
- gViewController.loadView(aViewId);
- }
-}
-
-function isCorrectlySigned(aAddon) {
- // Add-ons without an "isCorrectlySigned" property are correctly signed as
- // they aren't the correct type for signing.
- return aAddon.isCorrectlySigned !== false;
-}
-
-function isDiscoverEnabled() {
- if (Services.prefs.getPrefType(PREF_DISCOVERURL) == Services.prefs.PREF_INVALID)
- return false;
-
- try {
- if (!Services.prefs.getBoolPref(PREF_DISCOVER_ENABLED))
- return false;
- } catch (e) {}
-
- try {
- if (!Services.prefs.getBoolPref(PREF_XPI_ENABLED))
- return false;
- } catch (e) {}
-
- return true;
-}
-
-/**
- * Obtain the main DOMWindow for the current context.
- */
-function getMainWindow() {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-}
-
-function getBrowserElement() {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell)
- .chromeEventHandler;
-}
-
-/**
- * Obtain the DOMWindow that can open a preferences pane.
- *
- * This is essentially "get the browser chrome window" with the added check
- * that the supposed browser chrome window is capable of opening a preferences
- * pane.
- *
- * This may return null if we can't find the browser chrome window.
- */
-function getMainWindowWithPreferencesPane() {
- let mainWindow = getMainWindow();
- if (mainWindow && "openAdvancedPreferences" in mainWindow) {
- return mainWindow;
- }
- return null;
-}
-
-/**
- * A wrapper around the HTML5 session history service that allows the browser
- * back/forward controls to work within the manager
- */
-var HTML5History = {
- get index() {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .sessionHistory.index;
- },
-
- get canGoBack() {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .canGoBack;
- },
-
- get canGoForward() {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .canGoForward;
- },
-
- back: function() {
- window.history.back();
- gViewController.updateCommand("cmd_back");
- gViewController.updateCommand("cmd_forward");
- },
-
- forward: function() {
- window.history.forward();
- gViewController.updateCommand("cmd_back");
- gViewController.updateCommand("cmd_forward");
- },
-
- pushState: function(aState) {
- window.history.pushState(aState, document.title);
- },
-
- replaceState: function(aState) {
- window.history.replaceState(aState, document.title);
- },
-
- popState: function() {
- function onStatePopped(aEvent) {
- window.removeEventListener("popstate", onStatePopped, true);
- // TODO To ensure we can't go forward again we put an additional entry
- // for the current state into the history. Ideally we would just strip
- // the history but there doesn't seem to be a way to do that. Bug 590661
- window.history.pushState(aEvent.state, document.title);
- }
- window.addEventListener("popstate", onStatePopped, true);
- window.history.back();
- gViewController.updateCommand("cmd_back");
- gViewController.updateCommand("cmd_forward");
- }
-};
-
-/**
- * A wrapper around a fake history service
- */
-var FakeHistory = {
- pos: 0,
- states: [null],
-
- get index() {
- return this.pos;
- },
-
- get canGoBack() {
- return this.pos > 0;
- },
-
- get canGoForward() {
- return (this.pos + 1) < this.states.length;
- },
-
- back: function() {
- if (this.pos == 0)
- throw Components.Exception("Cannot go back from this point");
-
- this.pos--;
- gViewController.updateState(this.states[this.pos]);
- gViewController.updateCommand("cmd_back");
- gViewController.updateCommand("cmd_forward");
- },
-
- forward: function() {
- if ((this.pos + 1) >= this.states.length)
- throw Components.Exception("Cannot go forward from this point");
-
- this.pos++;
- gViewController.updateState(this.states[this.pos]);
- gViewController.updateCommand("cmd_back");
- gViewController.updateCommand("cmd_forward");
- },
-
- pushState: function(aState) {
- this.pos++;
- this.states.splice(this.pos, this.states.length);
- this.states.push(aState);
- },
-
- replaceState: function(aState) {
- this.states[this.pos] = aState;
- },
-
- popState: function() {
- if (this.pos == 0)
- throw Components.Exception("Cannot popState from this view");
-
- this.states.splice(this.pos, this.states.length);
- this.pos--;
-
- gViewController.updateState(this.states[this.pos]);
- gViewController.updateCommand("cmd_back");
- gViewController.updateCommand("cmd_forward");
- }
-};
-
-// If the window has a session history then use the HTML5 History wrapper
-// otherwise use our fake history implementation
-if (window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .sessionHistory) {
- var gHistory = HTML5History;
-}
-else {
- gHistory = FakeHistory;
-}
-
-var gEventManager = {
- _listeners: {},
- _installListeners: [],
-
- initialize: function() {
- const ADDON_EVENTS = ["onEnabling", "onEnabled", "onDisabling",
- "onDisabled", "onUninstalling", "onUninstalled",
- "onInstalled", "onOperationCancelled",
- "onUpdateAvailable", "onUpdateFinished",
- "onCompatibilityUpdateAvailable",
- "onPropertyChanged"];
- for (let evt of ADDON_EVENTS) {
- let event = evt;
- this[event] = (...aArgs) => this.delegateAddonEvent(event, aArgs);
- }
-
- const INSTALL_EVENTS = ["onNewInstall", "onDownloadStarted",
- "onDownloadEnded", "onDownloadFailed",
- "onDownloadProgress", "onDownloadCancelled",
- "onInstallStarted", "onInstallEnded",
- "onInstallFailed", "onInstallCancelled",
- "onExternalInstall"];
- for (let evt of INSTALL_EVENTS) {
- let event = evt;
- this[event] = (...aArgs) => this.delegateInstallEvent(event, aArgs);
- }
-
- AddonManager.addManagerListener(this);
- AddonManager.addInstallListener(this);
- AddonManager.addAddonListener(this);
-
- this.refreshGlobalWarning();
- this.refreshAutoUpdateDefault();
-
- var contextMenu = document.getElementById("addonitem-popup");
- contextMenu.addEventListener("popupshowing", function() {
- var addon = gViewController.currentViewObj.getSelectedAddon();
- contextMenu.setAttribute("addontype", addon.type);
-
- var menuSep = document.getElementById("addonitem-menuseparator");
- var countMenuItemsBeforeSep = 0;
- for (let child of contextMenu.children) {
- if (child == menuSep) {
- break;
- }
- if (child.nodeName == "menuitem" &&
- gViewController.isCommandEnabled(child.command)) {
- countMenuItemsBeforeSep++;
- }
- }
-
- // Hide the separator if there are no visible menu items before it
- menuSep.hidden = (countMenuItemsBeforeSep == 0);
-
- }, false);
-
- let addonTooltip = document.getElementById("addonitem-tooltip");
- addonTooltip.addEventListener("popupshowing", function() {
- let addonItem = addonTooltip.triggerNode;
- // The way the test triggers the tooltip the richlistitem is the
- // tooltipNode but in normal use it is the anonymous node. This allows
- // any case
- if (addonItem.localName != "richlistitem")
- addonItem = document.getBindingParent(addonItem);
-
- let tiptext = addonItem.getAttribute("name");
-
- if (addonItem.mAddon) {
- if (shouldShowVersionNumber(addonItem.mAddon)) {
- tiptext += " " + (addonItem.hasAttribute("upgrade") ? addonItem.mManualUpdate.version
- : addonItem.mAddon.version);
- }
- }
- else if (shouldShowVersionNumber(addonItem.mInstall)) {
- tiptext += " " + addonItem.mInstall.version;
- }
-
- addonTooltip.label = tiptext;
- }, false);
- },
-
- shutdown: function() {
- AddonManager.removeManagerListener(this);
- AddonManager.removeInstallListener(this);
- AddonManager.removeAddonListener(this);
- },
-
- registerAddonListener: function(aListener, aAddonId) {
- if (!(aAddonId in this._listeners))
- this._listeners[aAddonId] = [];
- else if (this._listeners[aAddonId].indexOf(aListener) != -1)
- return;
- this._listeners[aAddonId].push(aListener);
- },
-
- unregisterAddonListener: function(aListener, aAddonId) {
- if (!(aAddonId in this._listeners))
- return;
- var index = this._listeners[aAddonId].indexOf(aListener);
- if (index == -1)
- return;
- this._listeners[aAddonId].splice(index, 1);
- },
-
- registerInstallListener: function(aListener) {
- if (this._installListeners.indexOf(aListener) != -1)
- return;
- this._installListeners.push(aListener);
- },
-
- unregisterInstallListener: function(aListener) {
- var i = this._installListeners.indexOf(aListener);
- if (i == -1)
- return;
- this._installListeners.splice(i, 1);
- },
-
- delegateAddonEvent: function(aEvent, aParams) {
- var addon = aParams.shift();
- if (!(addon.id in this._listeners))
- return;
-
- var listeners = this._listeners[addon.id];
- for (let listener of listeners) {
- if (!(aEvent in listener))
- continue;
- try {
- listener[aEvent].apply(listener, aParams);
- } catch (e) {
- // this shouldn't be fatal
- Cu.reportError(e);
- }
- }
- },
-
- delegateInstallEvent: function(aEvent, aParams) {
- var existingAddon = aEvent == "onExternalInstall" ? aParams[1] : aParams[0].existingAddon;
- // If the install is an update then send the event to all listeners
- // registered for the existing add-on
- if (existingAddon)
- this.delegateAddonEvent(aEvent, [existingAddon].concat(aParams));
-
- for (let listener of this._installListeners) {
- if (!(aEvent in listener))
- continue;
- try {
- listener[aEvent].apply(listener, aParams);
- } catch (e) {
- // this shouldn't be fatal
- Cu.reportError(e);
- }
- }
- },
-
- refreshGlobalWarning: function() {
- var page = document.getElementById("addons-page");
-
- if (Services.appinfo.inSafeMode) {
- page.setAttribute("warning", "safemode");
- return;
- }
-
- if (AddonManager.checkUpdateSecurityDefault &&
- !AddonManager.checkUpdateSecurity) {
- page.setAttribute("warning", "updatesecurity");
- return;
- }
-
- if (!AddonManager.checkCompatibility) {
- page.setAttribute("warning", "checkcompatibility");
- return;
- }
-
- page.removeAttribute("warning");
- },
-
- refreshAutoUpdateDefault: function() {
- var updateEnabled = AddonManager.updateEnabled;
- var autoUpdateDefault = AddonManager.autoUpdateDefault;
-
- // The checkbox needs to reflect that both prefs need to be true
- // for updates to be checked for and applied automatically
- document.getElementById("utils-autoUpdateDefault")
- .setAttribute("checked", updateEnabled && autoUpdateDefault);
-
- document.getElementById("utils-resetAddonUpdatesToAutomatic").hidden = !autoUpdateDefault;
- document.getElementById("utils-resetAddonUpdatesToManual").hidden = autoUpdateDefault;
- },
-
- onCompatibilityModeChanged: function() {
- this.refreshGlobalWarning();
- },
-
- onCheckUpdateSecurityChanged: function() {
- this.refreshGlobalWarning();
- },
-
- onUpdateModeChanged: function() {
- this.refreshAutoUpdateDefault();
- }
-};
-
-
-var gViewController = {
- viewPort: null,
- currentViewId: "",
- currentViewObj: null,
- currentViewRequest: 0,
- viewObjects: {},
- viewChangeCallback: null,
- initialViewSelected: false,
- lastHistoryIndex: -1,
-
- initialize: function() {
- this.viewPort = document.getElementById("view-port");
- this.headeredViews = document.getElementById("headered-views");
- this.headeredViewsDeck = document.getElementById("headered-views-content");
-
- this.viewObjects["search"] = gSearchView;
- this.viewObjects["discover"] = gDiscoverView;
- this.viewObjects["list"] = gListView;
- this.viewObjects["detail"] = gDetailView;
- this.viewObjects["updates"] = gUpdatesView;
-
- for (let type in this.viewObjects) {
- let view = this.viewObjects[type];
- view.initialize();
- }
-
- window.controllers.appendController(this);
-
- window.addEventListener("popstate", function(e) {
- gViewController.updateState(e.state);
- },
- false);
- },
-
- shutdown: function() {
- if (this.currentViewObj)
- this.currentViewObj.hide();
- this.currentViewRequest = 0;
-
- for (let type in this.viewObjects) {
- let view = this.viewObjects[type];
- if ("shutdown" in view) {
- try {
- view.shutdown();
- } catch (e) {
- // this shouldn't be fatal
- Cu.reportError(e);
- }
- }
- }
-
- window.controllers.removeController(this);
- },
-
- updateState: function(state) {
- try {
- this.loadViewInternal(state.view, state.previousView, state);
- this.lastHistoryIndex = gHistory.index;
- }
- catch (e) {
- // The attempt to load the view failed, try moving further along history
- if (this.lastHistoryIndex > gHistory.index) {
- if (gHistory.canGoBack)
- gHistory.back();
- else
- gViewController.replaceView(gViewDefault);
- } else if (gHistory.canGoForward) {
- gHistory.forward();
- } else {
- gViewController.replaceView(gViewDefault);
- }
- }
- },
-
- parseViewId: function(aViewId) {
- var matchRegex = /^addons:\/\/([^\/]+)\/(.*)$/;
- var [, viewType, viewParam] = aViewId.match(matchRegex) || [];
- return {type: viewType, param: decodeURIComponent(viewParam)};
- },
-
- get isLoading() {
- return !this.currentViewObj || this.currentViewObj.node.hasAttribute("loading");
- },
-
- loadView: function(aViewId) {
- var isRefresh = false;
- if (aViewId == this.currentViewId) {
- if (this.isLoading)
- return;
- if (!("refresh" in this.currentViewObj))
- return;
- if (!this.currentViewObj.canRefresh())
- return;
- isRefresh = true;
- }
-
- var state = {
- view: aViewId,
- previousView: this.currentViewId
- };
- if (!isRefresh) {
- gHistory.pushState(state);
- this.lastHistoryIndex = gHistory.index;
- }
- this.loadViewInternal(aViewId, this.currentViewId, state);
- },
-
- // Replaces the existing view with a new one, rewriting the current history
- // entry to match.
- replaceView: function(aViewId) {
- if (aViewId == this.currentViewId)
- return;
-
- var state = {
- view: aViewId,
- previousView: null
- };
- gHistory.replaceState(state);
- this.loadViewInternal(aViewId, null, state);
- },
-
- loadInitialView: function(aViewId) {
- var state = {
- view: aViewId,
- previousView: null
- };
- gHistory.replaceState(state);
-
- this.loadViewInternal(aViewId, null, state);
- this.initialViewSelected = true;
- notifyInitialized();
- },
-
- get displayedView() {
- if (this.viewPort.selectedPanel == this.headeredViews) {
- return this.headeredViewsDeck.selectedPanel;
- }
- return this.viewPort.selectedPanel;
- },
-
- set displayedView(view) {
- let node = view.node;
- if (node.parentNode == this.headeredViewsDeck) {
- this.headeredViewsDeck.selectedPanel = node;
- this.viewPort.selectedPanel = this.headeredViews;
- } else {
- this.viewPort.selectedPanel = node;
- }
- },
-
- loadViewInternal: function(aViewId, aPreviousView, aState) {
- var view = this.parseViewId(aViewId);
-
- if (!view.type || !(view.type in this.viewObjects))
- throw Components.Exception("Invalid view: " + view.type);
-
- var viewObj = this.viewObjects[view.type];
- if (!viewObj.node)
- throw Components.Exception("Root node doesn't exist for '" + view.type + "' view");
-
- if (this.currentViewObj && aViewId != aPreviousView) {
- try {
- let canHide = this.currentViewObj.hide();
- if (canHide === false)
- return;
- this.displayedView.removeAttribute("loading");
- } catch (e) {
- // this shouldn't be fatal
- Cu.reportError(e);
- }
- }
-
- gCategories.select(aViewId, aPreviousView);
-
- this.currentViewId = aViewId;
- this.currentViewObj = viewObj;
-
- this.displayedView = this.currentViewObj;
- this.currentViewObj.node.setAttribute("loading", "true");
- this.currentViewObj.node.focus();
-
- if (aViewId == aPreviousView)
- this.currentViewObj.refresh(view.param, ++this.currentViewRequest, aState);
- else
- this.currentViewObj.show(view.param, ++this.currentViewRequest, aState);
- },
-
- // Moves back in the document history and removes the current history entry
- popState: function(aCallback) {
- this.viewChangeCallback = aCallback;
- gHistory.popState();
- },
-
- notifyViewChanged: function() {
- this.displayedView.removeAttribute("loading");
-
- if (this.viewChangeCallback) {
- this.viewChangeCallback();
- this.viewChangeCallback = null;
- }
-
- var event = document.createEvent("Events");
- event.initEvent("ViewChanged", true, true);
- this.currentViewObj.node.dispatchEvent(event);
- },
-
- commands: {
- cmd_back: {
- isEnabled: function() {
- return gHistory.canGoBack;
- },
- doCommand: function() {
- gHistory.back();
- }
- },
-
- cmd_forward: {
- isEnabled: function() {
- return gHistory.canGoForward;
- },
- doCommand: function() {
- gHistory.forward();
- }
- },
-
- cmd_focusSearch: {
- isEnabled: () => true,
- doCommand: function() {
- gHeader.focusSearchBox();
- }
- },
-
- cmd_restartApp: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
- createInstance(Ci.nsISupportsPRBool);
- Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
- "restart");
- if (cancelQuit.data)
- return; // somebody canceled our quit request
-
- let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
- getService(Ci.nsIAppStartup);
- appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
- }
- },
-
- cmd_enableCheckCompatibility: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- AddonManager.checkCompatibility = true;
- }
- },
-
- cmd_enableUpdateSecurity: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- AddonManager.checkUpdateSecurity = true;
- }
- },
-
- cmd_toggleAutoUpdateDefault: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- if (!AddonManager.updateEnabled || !AddonManager.autoUpdateDefault) {
- // One or both of the prefs is false, i.e. the checkbox is not checked.
- // Now toggle both to true. If the user wants us to auto-update
- // add-ons, we also need to auto-check for updates.
- AddonManager.updateEnabled = true;
- AddonManager.autoUpdateDefault = true;
- } else {
- // Both prefs are true, i.e. the checkbox is checked.
- // Toggle the auto pref to false, but don't touch the enabled check.
- AddonManager.autoUpdateDefault = false;
- }
- }
- },
-
- cmd_resetAddonAutoUpdate: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- AddonManager.getAllAddons(function(aAddonList) {
- for (let addon of aAddonList) {
- if ("applyBackgroundUpdates" in addon)
- addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;
- }
- });
- }
- },
-
- cmd_goToDiscoverPane: {
- isEnabled: function() {
- return gDiscoverView.enabled;
- },
- doCommand: function() {
- gViewController.loadView("addons://discover/");
- }
- },
-
- cmd_goToRecentUpdates: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- gViewController.loadView("addons://updates/recent");
- }
- },
-
- cmd_goToAvailableUpdates: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- gViewController.loadView("addons://updates/available");
- }
- },
-
- cmd_showItemDetails: {
- isEnabled: function(aAddon) {
- return !!aAddon && (gViewController.currentViewObj != gDetailView);
- },
- doCommand: function(aAddon, aScrollToPreferences) {
- gViewController.loadView("addons://detail/" +
- encodeURIComponent(aAddon.id) +
- (aScrollToPreferences ? "/preferences" : ""));
- }
- },
-
- cmd_findAllUpdates: {
- inProgress: false,
- isEnabled: function() {
- return !this.inProgress;
- },
- doCommand: function() {
- this.inProgress = true;
- gViewController.updateCommand("cmd_findAllUpdates");
- document.getElementById("updates-noneFound").hidden = true;
- document.getElementById("updates-progress").hidden = false;
- document.getElementById("updates-manualUpdatesFound-btn").hidden = true;
-
- var pendingChecks = 0;
- var numUpdated = 0;
- var numManualUpdates = 0;
- var restartNeeded = false;
-
- let updateStatus = () => {
- if (pendingChecks > 0)
- return;
-
- this.inProgress = false;
- gViewController.updateCommand("cmd_findAllUpdates");
- document.getElementById("updates-progress").hidden = true;
- gUpdatesView.maybeRefresh();
-
- if (numManualUpdates > 0 && numUpdated == 0) {
- document.getElementById("updates-manualUpdatesFound-btn").hidden = false;
- return;
- }
-
- if (numUpdated == 0) {
- document.getElementById("updates-noneFound").hidden = false;
- return;
- }
-
- if (restartNeeded) {
- document.getElementById("updates-downloaded").hidden = false;
- document.getElementById("updates-restart-btn").hidden = false;
- } else {
- document.getElementById("updates-installed").hidden = false;
- }
- }
-
- var updateInstallListener = {
- onDownloadFailed: function() {
- pendingChecks--;
- updateStatus();
- },
- onInstallFailed: function() {
- pendingChecks--;
- updateStatus();
- },
- onInstallEnded: function(aInstall, aAddon) {
- pendingChecks--;
- numUpdated++;
- if (isPending(aInstall.existingAddon, "upgrade"))
- restartNeeded = true;
- updateStatus();
- }
- };
-
- var updateCheckListener = {
- onUpdateAvailable: function(aAddon, aInstall) {
- gEventManager.delegateAddonEvent("onUpdateAvailable",
- [aAddon, aInstall]);
- if (AddonManager.shouldAutoUpdate(aAddon)) {
- aInstall.addListener(updateInstallListener);
- aInstall.install();
- } else {
- pendingChecks--;
- numManualUpdates++;
- updateStatus();
- }
- },
- onNoUpdateAvailable: function(aAddon) {
- pendingChecks--;
- updateStatus();
- },
- onUpdateFinished: function(aAddon, aError) {
- gEventManager.delegateAddonEvent("onUpdateFinished",
- [aAddon, aError]);
- }
- };
-
- AddonManager.getAddonsByTypes(null, function(aAddonList) {
- for (let addon of aAddonList) {
- if (addon.permissions & AddonManager.PERM_CAN_UPGRADE) {
- pendingChecks++;
- addon.findUpdates(updateCheckListener,
- AddonManager.UPDATE_WHEN_USER_REQUESTED);
- }
- }
-
- if (pendingChecks == 0)
- updateStatus();
- });
- }
- },
-
- cmd_findItemUpdates: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return hasPermission(aAddon, "upgrade");
- },
- doCommand: function(aAddon) {
- var listener = {
- onUpdateAvailable: function(aAddon, aInstall) {
- gEventManager.delegateAddonEvent("onUpdateAvailable",
- [aAddon, aInstall]);
- if (AddonManager.shouldAutoUpdate(aAddon))
- aInstall.install();
- },
- onNoUpdateAvailable: function(aAddon) {
- gEventManager.delegateAddonEvent("onNoUpdateAvailable",
- [aAddon]);
- }
- };
- gEventManager.delegateAddonEvent("onCheckingUpdate", [aAddon]);
- aAddon.findUpdates(listener, AddonManager.UPDATE_WHEN_USER_REQUESTED);
- }
- },
-
- cmd_showItemPreferences: {
- isEnabled: function(aAddon) {
- if (!aAddon ||
- (!aAddon.isActive && !aAddon.isGMPlugin) ||
- !aAddon.optionsURL) {
- return false;
- }
- if (gViewController.currentViewObj == gDetailView &&
- (aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE ||
- aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE_BROWSER)) {
- return false;
- }
- if (aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE_INFO)
- return false;
- return true;
- },
- doCommand: function(aAddon) {
- if (hasInlineOptions(aAddon)) {
- gViewController.commands.cmd_showItemDetails.doCommand(aAddon, true);
- return;
- }
- var optionsURL = aAddon.optionsURL;
- if (aAddon.optionsType == AddonManager.OPTIONS_TYPE_TAB &&
- openOptionsInTab(optionsURL)) {
- return;
- }
- var windows = Services.wm.getEnumerator(null);
- while (windows.hasMoreElements()) {
- var win = windows.getNext();
- if (win.closed) {
- continue;
- }
- if (win.document.documentURI == optionsURL) {
- win.focus();
- return;
- }
- }
- var features = "chrome,titlebar,toolbar,centerscreen";
- try {
- var instantApply = Services.prefs.getBoolPref("browser.preferences.instantApply");
- features += instantApply ? ",dialog=no" : ",modal";
- } catch (e) {
- features += ",modal";
- }
- openDialog(optionsURL, "", features);
- }
- },
-
- cmd_showItemAbout: {
- isEnabled: function(aAddon) {
- // XXXunf This may be applicable to install items too. See bug 561260
- return !!aAddon;
- },
- doCommand: function(aAddon) {
- var aboutURL = aAddon.aboutURL;
- if (aboutURL)
- openDialog(aboutURL, "", "chrome,centerscreen,modal", aAddon);
- else
- openDialog("chrome://mozapps/content/extensions/about.xul",
- "", "chrome,centerscreen,modal", aAddon);
- }
- },
-
- cmd_enableItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- let addonType = AddonManager.addonTypes[aAddon.type];
- return (!(addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) &&
- hasPermission(aAddon, "enable"));
- },
- doCommand: function(aAddon) {
- aAddon.userDisabled = false;
- },
- getTooltip: function(aAddon) {
- if (!aAddon)
- return "";
- if (aAddon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_ENABLE)
- return gStrings.ext.GetStringFromName("enableAddonRestartRequiredTooltip");
- return gStrings.ext.GetStringFromName("enableAddonTooltip");
- }
- },
-
- cmd_disableItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- let addonType = AddonManager.addonTypes[aAddon.type];
- return (!(addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) &&
- hasPermission(aAddon, "disable"));
- },
- doCommand: function(aAddon) {
- aAddon.userDisabled = true;
- },
- getTooltip: function(aAddon) {
- if (!aAddon)
- return "";
- if (aAddon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_DISABLE)
- return gStrings.ext.GetStringFromName("disableAddonRestartRequiredTooltip");
- return gStrings.ext.GetStringFromName("disableAddonTooltip");
- }
- },
-
- cmd_installItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return aAddon.install && aAddon.install.state == AddonManager.STATE_AVAILABLE;
- },
- doCommand: function(aAddon) {
- function doInstall() {
- gViewController.currentViewObj.getListItemForID(aAddon.id)._installStatus.installRemote();
- }
-
- if (gViewController.currentViewObj == gDetailView)
- gViewController.popState(doInstall);
- else
- doInstall();
- }
- },
-
- cmd_purchaseItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return !!aAddon.purchaseURL;
- },
- doCommand: function(aAddon) {
- openURL(aAddon.purchaseURL);
- }
- },
-
- cmd_uninstallItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return hasPermission(aAddon, "uninstall");
- },
- doCommand: function(aAddon) {
- if (gViewController.currentViewObj != gDetailView) {
- aAddon.uninstall();
- return;
- }
-
- gViewController.popState(function() {
- gViewController.currentViewObj.getListItemForID(aAddon.id).uninstall();
- });
- },
- getTooltip: function(aAddon) {
- if (!aAddon)
- return "";
- if (aAddon.operationsRequiringRestart & AddonManager.OP_NEEDS_RESTART_UNINSTALL)
- return gStrings.ext.GetStringFromName("uninstallAddonRestartRequiredTooltip");
- return gStrings.ext.GetStringFromName("uninstallAddonTooltip");
- }
- },
-
- cmd_cancelUninstallItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return isPending(aAddon, "uninstall");
- },
- doCommand: function(aAddon) {
- aAddon.cancelUninstall();
- }
- },
-
- cmd_installFromFile: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- const nsIFilePicker = Ci.nsIFilePicker;
- var fp = Cc["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
- fp.init(window,
- gStrings.ext.GetStringFromName("installFromFile.dialogTitle"),
- nsIFilePicker.modeOpenMultiple);
- try {
- fp.appendFilter(gStrings.ext.GetStringFromName("installFromFile.filterName"),
- "*.xpi;*.jar");
- fp.appendFilters(nsIFilePicker.filterAll);
- } catch (e) { }
-
- if (fp.show() != nsIFilePicker.returnOK)
- return;
-
- var files = fp.files;
- var installs = [];
-
- function buildNextInstall() {
- if (!files.hasMoreElements()) {
- if (installs.length > 0) {
- // Display the normal install confirmation for the installs
- let webInstaller = Cc["@mozilla.org/addons/web-install-listener;1"].
- getService(Ci.amIWebInstallListener);
- webInstaller.onWebInstallRequested(getBrowserElement(),
- document.documentURIObject,
- installs);
- }
- return;
- }
-
- var file = files.getNext();
- AddonManager.getInstallForFile(file, function(aInstall) {
- installs.push(aInstall);
- buildNextInstall();
- });
- }
-
- buildNextInstall();
- }
- },
-
- cmd_debugAddons: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- let mainWindow = getMainWindow();
- if ("switchToTabHavingURI" in mainWindow) {
- mainWindow.switchToTabHavingURI("about:debugging#addons", true);
- }
- },
- },
-
- cmd_cancelOperation: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return aAddon.pendingOperations != AddonManager.PENDING_NONE;
- },
- doCommand: function(aAddon) {
- if (isPending(aAddon, "install")) {
- aAddon.install.cancel();
- } else if (isPending(aAddon, "upgrade")) {
- aAddon.pendingUpgrade.install.cancel();
- } else if (isPending(aAddon, "uninstall")) {
- aAddon.cancelUninstall();
- } else if (isPending(aAddon, "enable")) {
- aAddon.userDisabled = true;
- } else if (isPending(aAddon, "disable")) {
- aAddon.userDisabled = false;
- }
- }
- },
-
- cmd_contribute: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- return ("contributionURL" in aAddon && aAddon.contributionURL);
- },
- doCommand: function(aAddon) {
- openURL(aAddon.contributionURL);
- }
- },
-
- cmd_askToActivateItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- let addonType = AddonManager.addonTypes[aAddon.type];
- return ((addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) &&
- hasPermission(aAddon, "ask_to_activate"));
- },
- doCommand: function(aAddon) {
- aAddon.userDisabled = AddonManager.STATE_ASK_TO_ACTIVATE;
- }
- },
-
- cmd_alwaysActivateItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- let addonType = AddonManager.addonTypes[aAddon.type];
- return ((addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) &&
- hasPermission(aAddon, "enable"));
- },
- doCommand: function(aAddon) {
- aAddon.userDisabled = false;
- }
- },
-
- cmd_neverActivateItem: {
- isEnabled: function(aAddon) {
- if (!aAddon)
- return false;
- let addonType = AddonManager.addonTypes[aAddon.type];
- return ((addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) &&
- hasPermission(aAddon, "disable"));
- },
- doCommand: function(aAddon) {
- aAddon.userDisabled = true;
- }
- },
-
- cmd_showUnsignedExtensions: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- gViewController.loadView("addons://list/extension?unsigned=true");
- },
- },
-
- cmd_showAllExtensions: {
- isEnabled: function() {
- return true;
- },
- doCommand: function() {
- gViewController.loadView("addons://list/extension");
- },
- },
- },
-
- supportsCommand: function(aCommand) {
- return (aCommand in this.commands);
- },
-
- isCommandEnabled: function(aCommand) {
- if (!this.supportsCommand(aCommand))
- return false;
- var addon = this.currentViewObj.getSelectedAddon();
- return this.commands[aCommand].isEnabled(addon);
- },
-
- updateCommands: function() {
- // wait until the view is initialized
- if (!this.currentViewObj)
- return;
- var addon = this.currentViewObj.getSelectedAddon();
- for (let commandId in this.commands)
- this.updateCommand(commandId, addon);
- },
-
- updateCommand: function(aCommandId, aAddon) {
- if (typeof aAddon == "undefined")
- aAddon = this.currentViewObj.getSelectedAddon();
- var cmd = this.commands[aCommandId];
- var cmdElt = document.getElementById(aCommandId);
- cmdElt.setAttribute("disabled", !cmd.isEnabled(aAddon));
- if ("getTooltip" in cmd) {
- let tooltip = cmd.getTooltip(aAddon);
- if (tooltip)
- cmdElt.setAttribute("tooltiptext", tooltip);
- else
- cmdElt.removeAttribute("tooltiptext");
- }
- },
-
- doCommand: function(aCommand, aAddon) {
- if (!this.supportsCommand(aCommand))
- return;
- var cmd = this.commands[aCommand];
- if (!aAddon)
- aAddon = this.currentViewObj.getSelectedAddon();
- if (!cmd.isEnabled(aAddon))
- return;
- cmd.doCommand(aAddon);
- },
-
- onEvent: function() {}
-};
-
-function hasInlineOptions(aAddon) {
- return (aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE ||
- aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE_BROWSER ||
- aAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE_INFO);
-}
-
-function openOptionsInTab(optionsURL) {
- let mainWindow = getMainWindow();
- if ("switchToTabHavingURI" in mainWindow) {
- mainWindow.switchToTabHavingURI(optionsURL, true);
- return true;
- }
- return false;
-}
-
-function formatDate(aDate) {
- const locale = Cc["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Ci.nsIXULChromeRegistry)
- .getSelectedLocale("global", true);
- const dtOptions = { year: 'numeric', month: 'long', day: 'numeric' };
- return aDate.toLocaleDateString(locale, dtOptions);
-}
-
-
-function hasPermission(aAddon, aPerm) {
- var perm = AddonManager["PERM_CAN_" + aPerm.toUpperCase()];
- return !!(aAddon.permissions & perm);
-}
-
-
-function isPending(aAddon, aAction) {
- var action = AddonManager["PENDING_" + aAction.toUpperCase()];
- return !!(aAddon.pendingOperations & action);
-}
-
-function isInState(aInstall, aState) {
- var state = AddonManager["STATE_" + aState.toUpperCase()];
- return aInstall.state == state;
-}
-
-function shouldShowVersionNumber(aAddon) {
- if (!aAddon.version)
- return false;
-
- // The version number is hidden for lightweight themes.
- if (aAddon.type == "theme")
- return !/@personas\.mozilla\.org$/.test(aAddon.id);
-
- return true;
-}
-
-function createItem(aObj, aIsInstall, aIsRemote) {
- let item = document.createElement("richlistitem");
-
- item.setAttribute("class", "addon addon-view");
- item.setAttribute("name", aObj.name);
- item.setAttribute("type", aObj.type);
- item.setAttribute("remote", !!aIsRemote);
-
- if (aIsInstall) {
- item.mInstall = aObj;
-
- if (aObj.state != AddonManager.STATE_INSTALLED) {
- item.setAttribute("status", "installing");
- return item;
- }
- aObj = aObj.addon;
- }
-
- item.mAddon = aObj;
-
- item.setAttribute("status", "installed");
-
- // set only attributes needed for sorting and XBL binding,
- // the binding handles the rest
- item.setAttribute("value", aObj.id);
-
- return item;
-}
-
-function sortElements(aElements, aSortBy, aAscending) {
- // aSortBy is an Array of attributes to sort by, in decending
- // order of priority.
-
- const DATE_FIELDS = ["updateDate"];
- const NUMERIC_FIELDS = ["size", "relevancescore", "purchaseAmount"];
-
- // We're going to group add-ons into the following buckets:
- //
- // enabledInstalled
- // * Enabled
- // * Incompatible but enabled because compatibility checking is off
- // * Waiting to be installed
- // * Waiting to be enabled
- //
- // pendingDisable
- // * Waiting to be disabled
- //
- // pendingUninstall
- // * Waiting to be removed
- //
- // disabledIncompatibleBlocked
- // * Disabled
- // * Incompatible
- // * Blocklisted
-
- const UISTATE_ORDER = ["enabled", "askToActivate", "pendingDisable",
- "pendingUninstall", "disabled"];
-
- function dateCompare(a, b) {
- var aTime = a.getTime();
- var bTime = b.getTime();
- if (aTime < bTime)
- return -1;
- if (aTime > bTime)
- return 1;
- return 0;
- }
-
- function numberCompare(a, b) {
- return a - b;
- }
-
- function stringCompare(a, b) {
- return a.localeCompare(b);
- }
-
- function uiStateCompare(a, b) {
- // If we're in descending order, swap a and b, because
- // we don't ever want to have descending uiStates
- if (!aAscending)
- [a, b] = [b, a];
-
- return (UISTATE_ORDER.indexOf(a) - UISTATE_ORDER.indexOf(b));
- }
-
- function getValue(aObj, aKey) {
- if (!aObj)
- return null;
-
- if (aObj.hasAttribute(aKey))
- return aObj.getAttribute(aKey);
-
- var addon = aObj.mAddon || aObj.mInstall;
- var addonType = aObj.mAddon && AddonManager.addonTypes[aObj.mAddon.type];
-
- if (!addon)
- return null;
-
- if (aKey == "uiState") {
- if (addon.pendingOperations == AddonManager.PENDING_DISABLE)
- return "pendingDisable";
- if (addon.pendingOperations == AddonManager.PENDING_UNINSTALL)
- return "pendingUninstall";
- if (!addon.isActive &&
- (addon.pendingOperations != AddonManager.PENDING_ENABLE &&
- addon.pendingOperations != AddonManager.PENDING_INSTALL))
- return "disabled";
- if (addonType && (addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) &&
- addon.userDisabled == AddonManager.STATE_ASK_TO_ACTIVATE)
- return "askToActivate";
- return "enabled";
- }
-
- return addon[aKey];
- }
-
- // aSortFuncs will hold the sorting functions that we'll
- // use per element, in the correct order.
- var aSortFuncs = [];
-
- for (let i = 0; i < aSortBy.length; i++) {
- var sortBy = aSortBy[i];
-
- aSortFuncs[i] = stringCompare;
-
- if (sortBy == "uiState")
- aSortFuncs[i] = uiStateCompare;
- else if (DATE_FIELDS.indexOf(sortBy) != -1)
- aSortFuncs[i] = dateCompare;
- else if (NUMERIC_FIELDS.indexOf(sortBy) != -1)
- aSortFuncs[i] = numberCompare;
- }
-
-
- aElements.sort(function(a, b) {
- if (!aAscending)
- [a, b] = [b, a];
-
- for (let i = 0; i < aSortFuncs.length; i++) {
- var sortBy = aSortBy[i];
- var aValue = getValue(a, sortBy);
- var bValue = getValue(b, sortBy);
-
- if (!aValue && !bValue)
- return 0;
- if (!aValue)
- return -1;
- if (!bValue)
- return 1;
- if (aValue != bValue) {
- var result = aSortFuncs[i](aValue, bValue);
-
- if (result != 0)
- return result;
- }
- }
-
- // If we got here, then all values of a and b
- // must have been equal.
- return 0;
-
- });
-}
-
-function sortList(aList, aSortBy, aAscending) {
- var elements = Array.slice(aList.childNodes, 0);
- sortElements(elements, [aSortBy], aAscending);
-
- while (aList.listChild)
- aList.removeChild(aList.lastChild);
-
- for (let element of elements)
- aList.appendChild(element);
-}
-
-function getAddonsAndInstalls(aType, aCallback) {
- let addons = null, installs = null;
- let types = (aType != null) ? [aType] : null;
-
- AddonManager.getAddonsByTypes(types, function(aAddonsList) {
- addons = aAddonsList.filter(a => !a.hidden);
- if (installs != null)
- aCallback(addons, installs);
- });
-
- AddonManager.getInstallsByTypes(types, function(aInstallsList) {
- // skip over upgrade installs and non-active installs
- installs = aInstallsList.filter(function(aInstall) {
- return !(aInstall.existingAddon ||
- aInstall.state == AddonManager.STATE_AVAILABLE);
- });
-
- if (addons != null)
- aCallback(addons, installs)
- });
-}
-
-function doPendingUninstalls(aListBox) {
- // Uninstalling add-ons can mutate the list so find the add-ons first then
- // uninstall them
- var items = [];
- var listitem = aListBox.firstChild;
- while (listitem) {
- if (listitem.getAttribute("pending") == "uninstall" &&
- !(listitem.opRequiresRestart("UNINSTALL")))
- items.push(listitem.mAddon);
- listitem = listitem.nextSibling;
- }
-
- for (let addon of items)
- addon.uninstall();
-}
-
-var gCategories = {
- node: null,
- _search: null,
-
- initialize: function() {
- this.node = document.getElementById("categories");
- this._search = this.get("addons://search/");
-
- var types = AddonManager.addonTypes;
- for (var type in types)
- this.onTypeAdded(types[type]);
-
- AddonManager.addTypeListener(this);
-
- try {
- this.node.value = Services.prefs.getCharPref(PREF_UI_LASTCATEGORY);
- } catch (e) { }
-
- // If there was no last view or no existing category matched the last view
- // then the list will default to selecting the search category and we never
- // want to show that as the first view so switch to the default category
- if (!this.node.selectedItem || this.node.selectedItem == this._search)
- this.node.value = gViewDefault;
-
- this.node.addEventListener("select", () => {
- this.maybeHideSearch();
- gViewController.loadView(this.node.selectedItem.value);
- }, false);
-
- this.node.addEventListener("click", (aEvent) => {
- var selectedItem = this.node.selectedItem;
- if (aEvent.target.localName == "richlistitem" &&
- aEvent.target == selectedItem) {
- var viewId = selectedItem.value;
-
- if (gViewController.parseViewId(viewId).type == "search") {
- viewId += encodeURIComponent(gHeader.searchQuery);
- }
-
- gViewController.loadView(viewId);
- }
- }, false);
- },
-
- shutdown: function() {
- AddonManager.removeTypeListener(this);
- },
-
- _insertCategory: function(aId, aName, aView, aPriority, aStartHidden) {
- // If this category already exists then don't re-add it
- if (document.getElementById("category-" + aId))
- return;
-
- var category = document.createElement("richlistitem");
- category.setAttribute("id", "category-" + aId);
- category.setAttribute("value", aView);
- category.setAttribute("class", "category");
- category.setAttribute("name", aName);
- category.setAttribute("tooltiptext", aName);
- category.setAttribute("priority", aPriority);
- category.setAttribute("hidden", aStartHidden);
-
- var node;
- for (node of this.node.children) {
- var nodePriority = parseInt(node.getAttribute("priority"));
- // If the new type's priority is higher than this one then this is the
- // insertion point
- if (aPriority < nodePriority)
- break;
- // If the new type's priority is lower than this one then this is isn't
- // the insertion point
- if (aPriority > nodePriority)
- continue;
- // If the priorities are equal and the new type's name is earlier
- // alphabetically then this is the insertion point
- if (String.localeCompare(aName, node.getAttribute("name")) < 0)
- break;
- }
-
- this.node.insertBefore(category, node);
- },
-
- _removeCategory: function(aId) {
- var category = document.getElementById("category-" + aId);
- if (!category)
- return;
-
- // If this category is currently selected then switch to the default view
- if (this.node.selectedItem == category)
- gViewController.replaceView(gViewDefault);
-
- this.node.removeChild(category);
- },
-
- onTypeAdded: function(aType) {
- // Ignore types that we don't have a view object for
- if (!(aType.viewType in gViewController.viewObjects))
- return;
-
- var aViewId = "addons://" + aType.viewType + "/" + aType.id;
-
- var startHidden = false;
- if (aType.flags & AddonManager.TYPE_UI_HIDE_EMPTY) {
- var prefName = PREF_UI_TYPE_HIDDEN.replace("%TYPE%", aType.id);
- try {
- startHidden = Services.prefs.getBoolPref(prefName);
- }
- catch (e) {
- // Default to hidden
- startHidden = true;
- }
-
- gPendingInitializations++;
- getAddonsAndInstalls(aType.id, (aAddonsList, aInstallsList) => {
- var hidden = (aAddonsList.length == 0 && aInstallsList.length == 0);
- var item = this.get(aViewId);
-
- // Don't load view that is becoming hidden
- if (hidden && aViewId == gViewController.currentViewId)
- gViewController.loadView(gViewDefault);
-
- item.hidden = hidden;
- Services.prefs.setBoolPref(prefName, hidden);
-
- if (aAddonsList.length > 0 || aInstallsList.length > 0) {
- notifyInitialized();
- return;
- }
-
- gEventManager.registerInstallListener({
- onDownloadStarted: function(aInstall) {
- this._maybeShowCategory(aInstall);
- },
-
- onInstallStarted: function(aInstall) {
- this._maybeShowCategory(aInstall);
- },
-
- onInstallEnded: function(aInstall, aAddon) {
- this._maybeShowCategory(aAddon);
- },
-
- onExternalInstall: function(aAddon, aExistingAddon, aRequiresRestart) {
- this._maybeShowCategory(aAddon);
- },
-
- _maybeShowCategory: aAddon => {
- if (aType.id == aAddon.type) {
- this.get(aViewId).hidden = false;
- Services.prefs.setBoolPref(prefName, false);
- gEventManager.unregisterInstallListener(this);
- }
- }
- });
-
- notifyInitialized();
- });
- }
-
- this._insertCategory(aType.id, aType.name, aViewId, aType.uiPriority,
- startHidden);
- },
-
- onTypeRemoved: function(aType) {
- this._removeCategory(aType.id);
- },
-
- get selected() {
- return this.node.selectedItem ? this.node.selectedItem.value : null;
- },
-
- select: function(aId, aPreviousView) {
- var view = gViewController.parseViewId(aId);
- if (view.type == "detail" && aPreviousView) {
- aId = aPreviousView;
- view = gViewController.parseViewId(aPreviousView);
- }
- aId = aId.replace(/\?.*/, "");
-
- Services.prefs.setCharPref(PREF_UI_LASTCATEGORY, aId);
-
- if (this.node.selectedItem &&
- this.node.selectedItem.value == aId) {
- this.node.selectedItem.hidden = false;
- this.node.selectedItem.disabled = false;
- return;
- }
-
- var item;
- if (view.type == "search")
- item = this._search;
- else
- item = this.get(aId);
-
- if (item) {
- item.hidden = false;
- item.disabled = false;
- this.node.suppressOnSelect = true;
- this.node.selectedItem = item;
- this.node.suppressOnSelect = false;
- this.node.ensureElementIsVisible(item);
-
- this.maybeHideSearch();
- }
- },
-
- get: function(aId) {
- var items = document.getElementsByAttribute("value", aId);
- if (items.length)
- return items[0];
- return null;
- },
-
- setBadge: function(aId, aCount) {
- let item = this.get(aId);
- if (item)
- item.badgeCount = aCount;
- },
-
- maybeHideSearch: function() {
- var view = gViewController.parseViewId(this.node.selectedItem.value);
- this._search.disabled = view.type != "search";
- }
-};
-
-
-var gHeader = {
- _search: null,
- _dest: "",
-
- initialize: function() {
- this._search = document.getElementById("header-search");
-
- this._search.addEventListener("command", function(aEvent) {
- var query = aEvent.target.value;
- if (query.length == 0)
- return;
-
- gViewController.loadView("addons://search/" + encodeURIComponent(query));
- }, false);
-
- function updateNavButtonVisibility() {
- var shouldShow = gHeader.shouldShowNavButtons;
- document.getElementById("back-btn").hidden = !shouldShow;
- document.getElementById("forward-btn").hidden = !shouldShow;
- }
-
- window.addEventListener("focus", function(aEvent) {
- if (aEvent.target == window)
- updateNavButtonVisibility();
- }, false);
-
- updateNavButtonVisibility();
- },
-
- focusSearchBox: function() {
- this._search.focus();
- },
-
- onKeyPress: function(aEvent) {
- if (String.fromCharCode(aEvent.charCode) == "/") {
- this.focusSearchBox();
- return;
- }
- },
-
- get shouldShowNavButtons() {
- var docshellItem = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem);
-
- // If there is no outer frame then make the buttons visible
- if (docshellItem.rootTreeItem == docshellItem)
- return true;
-
- var outerWin = docshellItem.rootTreeItem.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
- var outerDoc = outerWin.document;
- var node = outerDoc.getElementById("back-button");
- // If the outer frame has no back-button then make the buttons visible
- if (!node)
- return true;
-
- // If the back-button or any of its parents are hidden then make the buttons
- // visible
- while (node != outerDoc) {
- var style = outerWin.getComputedStyle(node, "");
- if (style.display == "none")
- return true;
- if (style.visibility != "visible")
- return true;
- node = node.parentNode;
- }
-
- return false;
- },
-
- get searchQuery() {
- return this._search.value;
- },
-
- set searchQuery(aQuery) {
- this._search.value = aQuery;
- },
-};
-
-
-var gDiscoverView = {
- node: null,
- enabled: true,
- // Set to true after the view is first shown. If initialization completes
- // after this then it must also load the discover homepage
- loaded: false,
- _browser: null,
- _loading: null,
- _error: null,
- homepageURL: null,
- _loadListeners: [],
- hideHeader: true,
-
- initialize: function() {
- this.enabled = isDiscoverEnabled();
- if (!this.enabled) {
- gCategories.get("addons://discover/").hidden = true;
- return;
- }
-
- this.node = document.getElementById("discover-view");
- this._loading = document.getElementById("discover-loading");
- this._error = document.getElementById("discover-error");
- this._browser = document.getElementById("discover-browser");
-
- let compatMode = "normal";
- if (!AddonManager.checkCompatibility)
- compatMode = "ignore";
- else if (AddonManager.strictCompatibility)
- compatMode = "strict";
-
- var url = Services.prefs.getCharPref(PREF_DISCOVERURL);
- url = url.replace("%COMPATIBILITY_MODE%", compatMode);
- url = Services.urlFormatter.formatURL(url);
-
- let setURL = (aURL) => {
- try {
- this.homepageURL = Services.io.newURI(aURL, null, null);
- } catch (e) {
- this.showError();
- notifyInitialized();
- return;
- }
-
- this._browser.homePage = this.homepageURL.spec;
- this._browser.addProgressListener(this);
-
- if (this.loaded)
- this._loadURL(this.homepageURL.spec, false, notifyInitialized);
- else
- notifyInitialized();
- }
-
- if (Services.prefs.getBoolPref(PREF_GETADDONS_CACHE_ENABLED) == false) {
- setURL(url);
- return;
- }
-
- gPendingInitializations++;
- AddonManager.getAllAddons(function(aAddons) {
- var list = {};
- for (let addon of aAddons) {
- var prefName = PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%",
- addon.id);
- try {
- if (!Services.prefs.getBoolPref(prefName))
- continue;
- } catch (e) { }
- list[addon.id] = {
- name: addon.name,
- version: addon.version,
- type: addon.type,
- userDisabled: addon.userDisabled,
- isCompatible: addon.isCompatible,
- isBlocklisted: addon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED
- }
- }
-
- setURL(url + "#" + JSON.stringify(list));
- });
- },
-
- destroy: function() {
- try {
- this._browser.removeProgressListener(this);
- }
- catch (e) {
- // Ignore the case when the listener wasn't already registered
- }
- },
-
- show: function(aParam, aRequest, aState, aIsRefresh) {
- gViewController.updateCommands();
-
- // If we're being told to load a specific URL then just do that
- if (aState && "url" in aState) {
- this.loaded = true;
- this._loadURL(aState.url);
- }
-
- // If the view has loaded before and still at the homepage (if refreshing),
- // and the error page is not visible then there is nothing else to do
- if (this.loaded && this.node.selectedPanel != this._error &&
- (!aIsRefresh || (this._browser.currentURI &&
- this._browser.currentURI.spec == this._browser.homePage))) {
- gViewController.notifyViewChanged();
- return;
- }
-
- this.loaded = true;
-
- // No homepage means initialization isn't complete, the browser will get
- // loaded once initialization is complete
- if (!this.homepageURL) {
- this._loadListeners.push(gViewController.notifyViewChanged.bind(gViewController));
- return;
- }
-
- this._loadURL(this.homepageURL.spec, aIsRefresh,
- gViewController.notifyViewChanged.bind(gViewController));
- },
-
- canRefresh: function() {
- if (this._browser.currentURI &&
- this._browser.currentURI.spec == this._browser.homePage)
- return false;
- return true;
- },
-
- refresh: function(aParam, aRequest, aState) {
- this.show(aParam, aRequest, aState, true);
- },
-
- hide: function() { },
-
- showError: function() {
- this.node.selectedPanel = this._error;
- },
-
- _loadURL: function(aURL, aKeepHistory, aCallback) {
- if (this._browser.currentURI.spec == aURL) {
- if (aCallback)
- aCallback();
- return;
- }
-
- if (aCallback)
- this._loadListeners.push(aCallback);
-
- var flags = 0;
- if (!aKeepHistory)
- flags |= Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
-
- this._browser.loadURIWithFlags(aURL, flags);
- },
-
- onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags) {
- // Ignore the about:blank load
- if (aLocation.spec == "about:blank")
- return;
-
- // When using the real session history the inner-frame will update the
- // session history automatically, if using the fake history though it must
- // be manually updated
- if (gHistory == FakeHistory) {
- var docshell = aWebProgress.QueryInterface(Ci.nsIDocShell);
-
- var state = {
- view: "addons://discover/",
- url: aLocation.spec
- };
-
- var replaceHistory = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY << 16;
- if (docshell.loadType & replaceHistory)
- gHistory.replaceState(state);
- else
- gHistory.pushState(state);
- gViewController.lastHistoryIndex = gHistory.index;
- }
-
- gViewController.updateCommands();
-
- // If the hostname is the same as the new location's host and either the
- // default scheme is insecure or the new location is secure then continue
- // with the load
- if (aLocation.host == this.homepageURL.host &&
- (!this.homepageURL.schemeIs("https") || aLocation.schemeIs("https")))
- return;
-
- // Canceling the request will send an error to onStateChange which will show
- // the error page
- aRequest.cancel(Components.results.NS_BINDING_ABORTED);
- },
-
- onSecurityChange: function(aWebProgress, aRequest, aState) {
- // Don't care about security if the page is not https
- if (!this.homepageURL.schemeIs("https"))
- return;
-
- // If the request was secure then it is ok
- if (aState & Ci.nsIWebProgressListener.STATE_IS_SECURE)
- return;
-
- // Canceling the request will send an error to onStateChange which will show
- // the error page
- aRequest.cancel(Components.results.NS_BINDING_ABORTED);
- },
-
- onStateChange: function(aWebProgress, aRequest, aStateFlags, aStatus) {
- let transferStart = Ci.nsIWebProgressListener.STATE_IS_DOCUMENT |
- Ci.nsIWebProgressListener.STATE_IS_REQUEST |
- Ci.nsIWebProgressListener.STATE_TRANSFERRING;
- // Once transferring begins show the content
- if ((aStateFlags & transferStart) === transferStart)
- this.node.selectedPanel = this._browser;
-
- // Only care about the network events
- if (!(aStateFlags & (Ci.nsIWebProgressListener.STATE_IS_NETWORK)))
- return;
-
- // If this is the start of network activity then show the loading page
- if (aStateFlags & (Ci.nsIWebProgressListener.STATE_START))
- this.node.selectedPanel = this._loading;
-
- // Ignore anything except stop events
- if (!(aStateFlags & (Ci.nsIWebProgressListener.STATE_STOP)))
- return;
-
- // Consider the successful load of about:blank as still loading
- if (aRequest instanceof Ci.nsIChannel && aRequest.URI.spec == "about:blank")
- return;
-
- // If there was an error loading the page or the new hostname is not the
- // same as the default hostname or the default scheme is secure and the new
- // scheme is insecure then show the error page
- const NS_ERROR_PARSED_DATA_CACHED = 0x805D0021;
- if (!(Components.isSuccessCode(aStatus) || aStatus == NS_ERROR_PARSED_DATA_CACHED) ||
- (aRequest && aRequest instanceof Ci.nsIHttpChannel && !aRequest.requestSucceeded)) {
- this.showError();
- } else {
- // Got a successful load, make sure the browser is visible
- this.node.selectedPanel = this._browser;
- gViewController.updateCommands();
- }
-
- var listeners = this._loadListeners;
- this._loadListeners = [];
-
- for (let listener of listeners)
- listener();
- },
-
- onProgressChange: function() { },
- onStatusChange: function() { },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
- Ci.nsISupportsWeakReference]),
-
- getSelectedAddon: function() {
- return null;
- }
-};
-
-
-var gCachedAddons = {};
-
-var gSearchView = {
- node: null,
- _filter: null,
- _sorters: null,
- _loading: null,
- _listBox: null,
- _emptyNotice: null,
- _allResultsLink: null,
- _lastQuery: null,
- _lastRemoteTotal: 0,
- _pendingSearches: 0,
-
- initialize: function() {
- this.node = document.getElementById("search-view");
- this._filter = document.getElementById("search-filter-radiogroup");
- this._sorters = document.getElementById("search-sorters");
- this._sorters.handler = this;
- this._loading = document.getElementById("search-loading");
- this._listBox = document.getElementById("search-list");
- this._emptyNotice = document.getElementById("search-list-empty");
- this._allResultsLink = document.getElementById("search-allresults-link");
-
- if (!AddonManager.isInstallEnabled("application/x-xpinstall"))
- this._filter.hidden = true;
-
- this._listBox.addEventListener("keydown", aEvent => {
- if (aEvent.keyCode == aEvent.DOM_VK_RETURN) {
- var item = this._listBox.selectedItem;
- if (item)
- item.showInDetailView();
- }
- }, false);
-
- this._filter.addEventListener("command", () => this.updateView(), false);
- },
-
- shutdown: function() {
- if (AddonRepository.isSearching)
- AddonRepository.cancelSearch();
- },
-
- get isSearching() {
- return this._pendingSearches > 0;
- },
-
- show: function(aQuery, aRequest) {
- gEventManager.registerInstallListener(this);
-
- this.showEmptyNotice(false);
- this.showAllResultsLink(0);
- this.showLoading(true);
- this._sorters.showprice = false;
-
- gHeader.searchQuery = aQuery;
- aQuery = aQuery.trim().toLocaleLowerCase();
- if (this._lastQuery == aQuery) {
- this.updateView();
- gViewController.notifyViewChanged();
- return;
- }
- this._lastQuery = aQuery;
-
- if (AddonRepository.isSearching)
- AddonRepository.cancelSearch();
-
- while (this._listBox.firstChild.localName == "richlistitem")
- this._listBox.removeChild(this._listBox.firstChild);
-
- gCachedAddons = {};
- this._pendingSearches = 2;
- this._sorters.setSort("relevancescore", false);
-
- var elements = [];
-
- let createSearchResults = (aObjsList, aIsInstall, aIsRemote) => {
- for (let index in aObjsList) {
- let obj = aObjsList[index];
- let score = aObjsList.length - index;
- if (!aIsRemote && aQuery.length > 0) {
- score = this.getMatchScore(obj, aQuery);
- if (score == 0)
- continue;
- }
-
- let item = createItem(obj, aIsInstall, aIsRemote);
- item.setAttribute("relevancescore", score);
- if (aIsRemote) {
- gCachedAddons[obj.id] = obj;
- if (obj.purchaseURL)
- this._sorters.showprice = true;
- }
-
- elements.push(item);
- }
- }
-
- let finishSearch = (createdCount) => {
- if (elements.length > 0) {
- sortElements(elements, [this._sorters.sortBy], this._sorters.ascending);
- for (let element of elements)
- this._listBox.insertBefore(element, this._listBox.lastChild);
- this.updateListAttributes();
- }
-
- this._pendingSearches--;
- this.updateView();
-
- if (!this.isSearching)
- gViewController.notifyViewChanged();
- }
-
- getAddonsAndInstalls(null, function(aAddons, aInstalls) {
- if (gViewController && aRequest != gViewController.currentViewRequest)
- return;
-
- createSearchResults(aAddons, false, false);
- createSearchResults(aInstalls, true, false);
- finishSearch();
- });
-
- var maxRemoteResults = 0;
- try {
- maxRemoteResults = Services.prefs.getIntPref(PREF_MAXRESULTS);
- } catch (e) {}
-
- if (maxRemoteResults <= 0) {
- finishSearch(0);
- return;
- }
-
- AddonRepository.searchAddons(aQuery, maxRemoteResults, {
- searchFailed: () => {
- if (gViewController && aRequest != gViewController.currentViewRequest)
- return;
-
- this._lastRemoteTotal = 0;
-
- // XXXunf Better handling of AMO search failure. See bug 579502
- finishSearch(0); // Silently fail
- },
-
- searchSucceeded: (aAddonsList, aAddonCount, aTotalResults) => {
- if (gViewController && aRequest != gViewController.currentViewRequest)
- return;
-
- if (aTotalResults > maxRemoteResults)
- this._lastRemoteTotal = aTotalResults;
- else
- this._lastRemoteTotal = 0;
-
- var createdCount = createSearchResults(aAddonsList, false, true);
- finishSearch(createdCount);
- }
- });
- },
-
- showLoading: function(aLoading) {
- this._loading.hidden = !aLoading;
- this._listBox.hidden = aLoading;
- },
-
- updateView: function() {
- var showLocal = this._filter.value == "local";
-
- if (!showLocal && !AddonManager.isInstallEnabled("application/x-xpinstall"))
- showLocal = true;
-
- this._listBox.setAttribute("local", showLocal);
- this._listBox.setAttribute("remote", !showLocal);
-
- this.showLoading(this.isSearching && !showLocal);
- if (!this.isSearching) {
- var isEmpty = true;
- var results = this._listBox.getElementsByTagName("richlistitem");
- for (let result of results) {
- var isRemote = (result.getAttribute("remote") == "true");
- if ((isRemote && !showLocal) || (!isRemote && showLocal)) {
- isEmpty = false;
- break;
- }
- }
-
- this.showEmptyNotice(isEmpty);
- this.showAllResultsLink(this._lastRemoteTotal);
- }
-
- gViewController.updateCommands();
- },
-
- hide: function() {
- gEventManager.unregisterInstallListener(this);
- doPendingUninstalls(this._listBox);
- },
-
- getMatchScore: function(aObj, aQuery) {
- var score = 0;
- score += this.calculateMatchScore(aObj.name, aQuery,
- SEARCH_SCORE_MULTIPLIER_NAME);
- score += this.calculateMatchScore(aObj.description, aQuery,
- SEARCH_SCORE_MULTIPLIER_DESCRIPTION);
- return score;
- },
-
- calculateMatchScore: function(aStr, aQuery, aMultiplier) {
- var score = 0;
- if (!aStr || aQuery.length == 0)
- return score;
-
- aStr = aStr.trim().toLocaleLowerCase();
- var haystack = aStr.split(/\s+/);
- var needles = aQuery.split(/\s+/);
-
- for (let needle of needles) {
- for (let hay of haystack) {
- if (hay == needle) {
- // matching whole words is best
- score += SEARCH_SCORE_MATCH_WHOLEWORD;
- } else {
- let i = hay.indexOf(needle);
- if (i == 0) // matching on word boundries is also good
- score += SEARCH_SCORE_MATCH_WORDBOUNDRY;
- else if (i > 0) // substring matches not so good
- score += SEARCH_SCORE_MATCH_SUBSTRING;
- }
- }
- }
-
- // give progressively higher score for longer queries, since longer queries
- // are more likely to be unique and therefore more relevant.
- if (needles.length > 1 && aStr.indexOf(aQuery) != -1)
- score += needles.length;
-
- return score * aMultiplier;
- },
-
- showEmptyNotice: function(aShow) {
- this._emptyNotice.hidden = !aShow;
- this._listBox.hidden = aShow;
- },
-
- showAllResultsLink: function(aTotalResults) {
- if (aTotalResults == 0) {
- this._allResultsLink.hidden = true;
- return;
- }
-
- var linkStr = gStrings.ext.GetStringFromName("showAllSearchResults");
- linkStr = PluralForm.get(aTotalResults, linkStr);
- linkStr = linkStr.replace("#1", aTotalResults);
- this._allResultsLink.setAttribute("value", linkStr);
-
- this._allResultsLink.setAttribute("href",
- AddonRepository.getSearchURL(this._lastQuery));
- this._allResultsLink.hidden = false;
- },
-
- updateListAttributes: function() {
- var item = this._listBox.querySelector("richlistitem[remote='true'][first]");
- if (item)
- item.removeAttribute("first");
- item = this._listBox.querySelector("richlistitem[remote='true'][last]");
- if (item)
- item.removeAttribute("last");
- var items = this._listBox.querySelectorAll("richlistitem[remote='true']");
- if (items.length > 0) {
- items[0].setAttribute("first", true);
- items[items.length - 1].setAttribute("last", true);
- }
-
- item = this._listBox.querySelector("richlistitem:not([remote='true'])[first]");
- if (item)
- item.removeAttribute("first");
- item = this._listBox.querySelector("richlistitem:not([remote='true'])[last]");
- if (item)
- item.removeAttribute("last");
- items = this._listBox.querySelectorAll("richlistitem:not([remote='true'])");
- if (items.length > 0) {
- items[0].setAttribute("first", true);
- items[items.length - 1].setAttribute("last", true);
- }
-
- },
-
- onSortChanged: function(aSortBy, aAscending) {
- var footer = this._listBox.lastChild;
- this._listBox.removeChild(footer);
-
- sortList(this._listBox, aSortBy, aAscending);
- this.updateListAttributes();
-
- this._listBox.appendChild(footer);
- },
-
- onDownloadCancelled: function(aInstall) {
- this.removeInstall(aInstall);
- },
-
- onInstallCancelled: function(aInstall) {
- this.removeInstall(aInstall);
- },
-
- removeInstall: function(aInstall) {
- for (let item of this._listBox.childNodes) {
- if (item.mInstall == aInstall) {
- this._listBox.removeChild(item);
- return;
- }
- }
- },
-
- getSelectedAddon: function() {
- var item = this._listBox.selectedItem;
- if (item)
- return item.mAddon;
- return null;
- },
-
- getListItemForID: function(aId) {
- var listitem = this._listBox.firstChild;
- while (listitem) {
- if (listitem.getAttribute("status") == "installed" && listitem.mAddon.id == aId)
- return listitem;
- listitem = listitem.nextSibling;
- }
- return null;
- }
-};
-
-
-var gListView = {
- node: null,
- _listBox: null,
- _emptyNotice: null,
- _type: null,
-
- initialize: function() {
- this.node = document.getElementById("list-view");
- this._listBox = document.getElementById("addon-list");
- this._emptyNotice = document.getElementById("addon-list-empty");
-
- this._listBox.addEventListener("keydown", (aEvent) => {
- if (aEvent.keyCode == aEvent.DOM_VK_RETURN) {
- var item = this._listBox.selectedItem;
- if (item)
- item.showInDetailView();
- }
- }, false);
-
- document.getElementById("signing-learn-more").setAttribute("href",
- Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons");
-
- let findSignedAddonsLink = document.getElementById("find-alternative-addons");
- try {
- findSignedAddonsLink.setAttribute("href",
- Services.urlFormatter.formatURLPref("extensions.getAddons.link.url"));
- } catch (e) {
- findSignedAddonsLink.classList.remove("text-link");
- }
-
- try {
- document.getElementById("signing-dev-manual-link").setAttribute("href",
- Services.prefs.getCharPref("xpinstall.signatures.devInfoURL"));
- } catch (e) {
- document.getElementById("signing-dev-info").hidden = true;
- }
-
- // To-Do: remove deprecation notice content.
- document.getElementById("plugindeprecation-notice").hidden = true;
- },
-
- show: function(aType, aRequest) {
- let showOnlyDisabledUnsigned = false;
- if (aType.endsWith("?unsigned=true")) {
- aType = aType.replace(/\?.*/, "");
- showOnlyDisabledUnsigned = true;
- }
-
- if (!(aType in AddonManager.addonTypes))
- throw Components.Exception("Attempting to show unknown type " + aType, Cr.NS_ERROR_INVALID_ARG);
-
- this._type = aType;
- this.node.setAttribute("type", aType);
- this.showEmptyNotice(false);
-
- while (this._listBox.itemCount > 0)
- this._listBox.removeItemAt(0);
-
- if (aType == "plugin") {
- navigator.plugins.refresh(false);
- }
-
- getAddonsAndInstalls(aType, (aAddonsList, aInstallsList) => {
- if (gViewController && aRequest != gViewController.currentViewRequest)
- return;
-
- var elements = [];
-
- for (let addonItem of aAddonsList)
- elements.push(createItem(addonItem));
-
- for (let installItem of aInstallsList)
- elements.push(createItem(installItem, true));
-
- this.showEmptyNotice(elements.length == 0);
- if (elements.length > 0) {
- sortElements(elements, ["uiState", "name"], true);
- for (let element of elements)
- this._listBox.appendChild(element);
- }
-
- this.filterDisabledUnsigned(showOnlyDisabledUnsigned);
-
- gEventManager.registerInstallListener(this);
- gViewController.updateCommands();
- gViewController.notifyViewChanged();
- });
- },
-
- hide: function() {
- gEventManager.unregisterInstallListener(this);
- doPendingUninstalls(this._listBox);
- },
-
- filterDisabledUnsigned: function(aFilter = true) {
- let foundDisabledUnsigned = false;
-
- if (SIGNING_REQUIRED) {
- for (let item of this._listBox.childNodes) {
- if (!isCorrectlySigned(item.mAddon))
- foundDisabledUnsigned = true;
- else
- item.hidden = aFilter;
- }
- }
-
- document.getElementById("show-disabled-unsigned-extensions").hidden =
- aFilter || !foundDisabledUnsigned;
-
- document.getElementById("show-all-extensions").hidden = !aFilter;
- document.getElementById("disabled-unsigned-addons-info").hidden = !aFilter;
- },
-
- showEmptyNotice: function(aShow) {
- this._emptyNotice.hidden = !aShow;
- this._listBox.hidden = aShow;
- },
-
- onSortChanged: function(aSortBy, aAscending) {
- sortList(this._listBox, aSortBy, aAscending);
- },
-
- onExternalInstall: function(aAddon, aExistingAddon, aRequiresRestart) {
- // The existing list item will take care of upgrade installs
- if (aExistingAddon)
- return;
-
- if (aAddon.hidden)
- return;
-
- this.addItem(aAddon);
- },
-
- onDownloadStarted: function(aInstall) {
- this.addItem(aInstall, true);
- },
-
- onInstallStarted: function(aInstall) {
- this.addItem(aInstall, true);
- },
-
- onDownloadCancelled: function(aInstall) {
- this.removeItem(aInstall, true);
- },
-
- onInstallCancelled: function(aInstall) {
- this.removeItem(aInstall, true);
- },
-
- onInstallEnded: function(aInstall) {
- // Remove any install entries for upgrades, their status will appear against
- // the existing item
- if (aInstall.existingAddon)
- this.removeItem(aInstall, true);
- },
-
- addItem: function(aObj, aIsInstall) {
- if (aObj.type != this._type)
- return;
-
- if (aIsInstall && aObj.existingAddon)
- return;
-
- let prop = aIsInstall ? "mInstall" : "mAddon";
- for (let item of this._listBox.childNodes) {
- if (item[prop] == aObj)
- return;
- }
-
- let item = createItem(aObj, aIsInstall);
- this._listBox.insertBefore(item, this._listBox.firstChild);
- this.showEmptyNotice(false);
- },
-
- removeItem: function(aObj, aIsInstall) {
- let prop = aIsInstall ? "mInstall" : "mAddon";
-
- for (let item of this._listBox.childNodes) {
- if (item[prop] == aObj) {
- this._listBox.removeChild(item);
- this.showEmptyNotice(this._listBox.itemCount == 0);
- return;
- }
- }
- },
-
- getSelectedAddon: function() {
- var item = this._listBox.selectedItem;
- if (item)
- return item.mAddon;
- return null;
- },
-
- getListItemForID: function(aId) {
- var listitem = this._listBox.firstChild;
- while (listitem) {
- if (listitem.getAttribute("status") == "installed" && listitem.mAddon.id == aId)
- return listitem;
- listitem = listitem.nextSibling;
- }
- return null;
- }
-};
-
-
-var gDetailView = {
- node: null,
- _addon: null,
- _loadingTimer: null,
- _autoUpdate: null,
-
- initialize: function() {
- this.node = document.getElementById("detail-view");
-
- this._autoUpdate = document.getElementById("detail-autoUpdate");
-
- this._autoUpdate.addEventListener("command", () => {
- this._addon.applyBackgroundUpdates = this._autoUpdate.value;
- }, true);
- },
-
- shutdown: function() {
- AddonManager.removeManagerListener(this);
- },
-
- onUpdateModeChanged: function() {
- this.onPropertyChanged(["applyBackgroundUpdates"]);
- },
-
- _updateView: function(aAddon, aIsRemote, aScrollToPreferences) {
- AddonManager.addManagerListener(this);
- this.clearLoading();
-
- this._addon = aAddon;
- gEventManager.registerAddonListener(this, aAddon.id);
- gEventManager.registerInstallListener(this);
-
- this.node.setAttribute("type", aAddon.type);
-
- // If the search category isn't selected then make sure to select the
- // correct category
- if (gCategories.selected != "addons://search/")
- gCategories.select("addons://list/" + aAddon.type);
-
- document.getElementById("detail-name").textContent = aAddon.name;
- var icon = AddonManager.getPreferredIconURL(aAddon, 64, window);
- document.getElementById("detail-icon").src = icon ? icon : "";
- document.getElementById("detail-creator").setCreator(aAddon.creator, aAddon.homepageURL);
-
- var version = document.getElementById("detail-version");
- if (shouldShowVersionNumber(aAddon)) {
- version.hidden = false;
- version.value = aAddon.version;
- } else {
- version.hidden = true;
- }
-
- var screenshotbox = document.getElementById("detail-screenshot-box");
- var screenshot = document.getElementById("detail-screenshot");
- if (aAddon.screenshots && aAddon.screenshots.length > 0) {
- if (aAddon.screenshots[0].thumbnailURL) {
- screenshot.src = aAddon.screenshots[0].thumbnailURL;
- screenshot.width = aAddon.screenshots[0].thumbnailWidth;
- screenshot.height = aAddon.screenshots[0].thumbnailHeight;
- } else {
- screenshot.src = aAddon.screenshots[0].url;
- screenshot.width = aAddon.screenshots[0].width;
- screenshot.height = aAddon.screenshots[0].height;
- }
- screenshot.setAttribute("loading", "true");
- screenshotbox.hidden = false;
- } else {
- screenshotbox.hidden = true;
- }
-
- var desc = document.getElementById("detail-desc");
- desc.textContent = aAddon.description;
-
- var fullDesc = document.getElementById("detail-fulldesc");
- if (aAddon.fullDescription) {
- // The following is part of an awful hack to include the licenses for GMP
- // plugins without having bug 624602 fixed yet, and intentionally ignores
- // localisation.
- if (aAddon.isGMPlugin) {
- fullDesc.innerHTML = aAddon.fullDescription;
- } else {
- fullDesc.textContent = aAddon.fullDescription;
- }
-
- fullDesc.hidden = false;
- } else {
- fullDesc.hidden = true;
- }
-
- var contributions = document.getElementById("detail-contributions");
- if ("contributionURL" in aAddon && aAddon.contributionURL) {
- contributions.hidden = false;
- var amount = document.getElementById("detail-contrib-suggested");
- if (aAddon.contributionAmount) {
- amount.value = gStrings.ext.formatStringFromName("contributionAmount2",
- [aAddon.contributionAmount],
- 1);
- amount.hidden = false;
- } else {
- amount.hidden = true;
- }
- } else {
- contributions.hidden = true;
- }
-
- if ("purchaseURL" in aAddon && aAddon.purchaseURL) {
- var purchase = document.getElementById("detail-purchase-btn");
- purchase.label = gStrings.ext.formatStringFromName("cmd.purchaseAddon.label",
- [aAddon.purchaseDisplayAmount],
- 1);
- purchase.accesskey = gStrings.ext.GetStringFromName("cmd.purchaseAddon.accesskey");
- }
-
- var updateDateRow = document.getElementById("detail-dateUpdated");
- if (aAddon.updateDate) {
- var date = formatDate(aAddon.updateDate);
- updateDateRow.value = date;
- } else {
- updateDateRow.value = null;
- }
-
- // TODO if the add-on was downloaded from releases.mozilla.org link to the
- // AMO profile (bug 590344)
- if (false) {
- document.getElementById("detail-repository-row").hidden = false;
- document.getElementById("detail-homepage-row").hidden = true;
- var repository = document.getElementById("detail-repository");
- repository.value = aAddon.homepageURL;
- repository.href = aAddon.homepageURL;
- } else if (aAddon.homepageURL) {
- document.getElementById("detail-repository-row").hidden = true;
- document.getElementById("detail-homepage-row").hidden = false;
- var homepage = document.getElementById("detail-homepage");
- homepage.value = aAddon.homepageURL;
- homepage.href = aAddon.homepageURL;
- } else {
- document.getElementById("detail-repository-row").hidden = true;
- document.getElementById("detail-homepage-row").hidden = true;
- }
-
- var rating = document.getElementById("detail-rating");
- if (aAddon.averageRating) {
- rating.averageRating = aAddon.averageRating;
- rating.hidden = false;
- } else {
- rating.hidden = true;
- }
-
- var reviews = document.getElementById("detail-reviews");
- if (aAddon.reviewURL) {
- var text = gStrings.ext.GetStringFromName("numReviews");
- text = PluralForm.get(aAddon.reviewCount, text)
- text = text.replace("#1", aAddon.reviewCount);
- reviews.value = text;
- reviews.hidden = false;
- reviews.href = aAddon.reviewURL;
- } else {
- reviews.hidden = true;
- }
-
- document.getElementById("detail-rating-row").hidden = !aAddon.averageRating && !aAddon.reviewURL;
-
- var sizeRow = document.getElementById("detail-size");
- if (aAddon.size && aIsRemote) {
- let [size, unit] = DownloadUtils.convertByteUnits(parseInt(aAddon.size));
- let formatted = gStrings.dl.GetStringFromName("doneSize");
- formatted = formatted.replace("#1", size).replace("#2", unit);
- sizeRow.value = formatted;
- } else {
- sizeRow.value = null;
- }
-
- var downloadsRow = document.getElementById("detail-downloads");
- if (aAddon.totalDownloads && aIsRemote) {
- var downloads = aAddon.totalDownloads;
- downloadsRow.value = downloads;
- } else {
- downloadsRow.value = null;
- }
-
- var canUpdate = !aIsRemote && hasPermission(aAddon, "upgrade") && aAddon.id != AddonManager.hotfixID;
- document.getElementById("detail-updates-row").hidden = !canUpdate;
-
- if ("applyBackgroundUpdates" in aAddon) {
- this._autoUpdate.hidden = false;
- this._autoUpdate.value = aAddon.applyBackgroundUpdates;
- let hideFindUpdates = AddonManager.shouldAutoUpdate(this._addon);
- document.getElementById("detail-findUpdates-btn").hidden = hideFindUpdates;
- } else {
- this._autoUpdate.hidden = true;
- document.getElementById("detail-findUpdates-btn").hidden = false;
- }
-
- document.getElementById("detail-prefs-btn").hidden = !aIsRemote &&
- !gViewController.commands.cmd_showItemPreferences.isEnabled(aAddon);
-
- var gridRows = document.querySelectorAll("#detail-grid rows row");
- let first = true;
- for (let gridRow of gridRows) {
- if (first && window.getComputedStyle(gridRow, null).getPropertyValue("display") != "none") {
- gridRow.setAttribute("first-row", true);
- first = false;
- } else {
- gridRow.removeAttribute("first-row");
- }
- }
-
- this.fillSettingsRows(aScrollToPreferences, (function() {
- this.updateState();
- gViewController.notifyViewChanged();
- }).bind(this));
- },
-
- show: function(aAddonId, aRequest) {
- let index = aAddonId.indexOf("/preferences");
- let scrollToPreferences = false;
- if (index >= 0) {
- aAddonId = aAddonId.substring(0, index);
- scrollToPreferences = true;
- }
-
- this._loadingTimer = setTimeout(() => {
- this.node.setAttribute("loading-extended", true);
- }, LOADING_MSG_DELAY);
-
- var view = gViewController.currentViewId;
-
- AddonManager.getAddonByID(aAddonId, (aAddon) => {
- if (gViewController && aRequest != gViewController.currentViewRequest)
- return;
-
- if (aAddon) {
- this._updateView(aAddon, false, scrollToPreferences);
- return;
- }
-
- // Look for an add-on pending install
- AddonManager.getAllInstalls(aInstalls => {
- for (let install of aInstalls) {
- if (install.state == AddonManager.STATE_INSTALLED &&
- install.addon.id == aAddonId) {
- this._updateView(install.addon, false);
- return;
- }
- }
-
- if (aAddonId in gCachedAddons) {
- this._updateView(gCachedAddons[aAddonId], true);
- return;
- }
-
- // This might happen due to session restore restoring us back to an
- // add-on that doesn't exist but otherwise shouldn't normally happen.
- // Either way just revert to the default view.
- gViewController.replaceView(gViewDefault);
- });
- });
- },
-
- hide: function() {
- AddonManager.removeManagerListener(this);
- this.clearLoading();
- if (this._addon) {
- if (hasInlineOptions(this._addon)) {
- Services.obs.notifyObservers(document,
- AddonManager.OPTIONS_NOTIFICATION_HIDDEN,
- this._addon.id);
- }
-
- gEventManager.unregisterAddonListener(this, this._addon.id);
- gEventManager.unregisterInstallListener(this);
- this._addon = null;
-
- // Flush the preferences to disk so they survive any crash
- if (this.node.getElementsByTagName("setting").length)
- Services.prefs.savePrefFile(null);
- }
- },
-
- updateState: function() {
- gViewController.updateCommands();
-
- var pending = this._addon.pendingOperations;
- if (pending != AddonManager.PENDING_NONE) {
- this.node.removeAttribute("notification");
-
- pending = null;
- const PENDING_OPERATIONS = ["enable", "disable", "install", "uninstall",
- "upgrade"];
- for (let op of PENDING_OPERATIONS) {
- if (isPending(this._addon, op))
- pending = op;
- }
-
- this.node.setAttribute("pending", pending);
- document.getElementById("detail-pending").textContent = gStrings.ext.formatStringFromName(
- "details.notification." + pending,
- [this._addon.name, gStrings.brandShortName], 2
- );
- } else {
- this.node.removeAttribute("pending");
-
- if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
- this.node.setAttribute("notification", "error");
- document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
- "details.notification.blocked",
- [this._addon.name], 1
- );
- var errorLink = document.getElementById("detail-error-link");
- errorLink.value = gStrings.ext.GetStringFromName("details.notification.blocked.link");
- errorLink.href = this._addon.blocklistURL;
- errorLink.hidden = false;
- } else if (!isCorrectlySigned(this._addon) && SIGNING_REQUIRED) {
- this.node.setAttribute("notification", "error");
- document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
- "details.notification.unsignedAndDisabled", [this._addon.name, gStrings.brandShortName], 2
- );
- let errorLink = document.getElementById("detail-error-link");
- errorLink.value = gStrings.ext.GetStringFromName("details.notification.unsigned.link");
- errorLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
- errorLink.hidden = false;
- } else if (!this._addon.isCompatible && (AddonManager.checkCompatibility ||
- (this._addon.blocklistState != Ci.nsIBlocklistService.STATE_SOFTBLOCKED))) {
- this.node.setAttribute("notification", "warning");
- document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
- "details.notification.incompatible",
- [this._addon.name, gStrings.brandShortName, gStrings.appVersion], 3
- );
- document.getElementById("detail-warning-link").hidden = true;
- } else if (!isCorrectlySigned(this._addon)) {
- this.node.setAttribute("notification", "warning");
- document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
- "details.notification.unsigned", [this._addon.name, gStrings.brandShortName], 2
- );
- var warningLink = document.getElementById("detail-warning-link");
- warningLink.value = gStrings.ext.GetStringFromName("details.notification.unsigned.link");
- warningLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
- warningLink.hidden = false;
- } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
- this.node.setAttribute("notification", "warning");
- document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
- "details.notification.softblocked",
- [this._addon.name], 1
- );
- let warningLink = document.getElementById("detail-warning-link");
- warningLink.value = gStrings.ext.GetStringFromName("details.notification.softblocked.link");
- warningLink.href = this._addon.blocklistURL;
- warningLink.hidden = false;
- } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
- this.node.setAttribute("notification", "warning");
- document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
- "details.notification.outdated",
- [this._addon.name], 1
- );
- let warningLink = document.getElementById("detail-warning-link");
- warningLink.value = gStrings.ext.GetStringFromName("details.notification.outdated.link");
- warningLink.href = this._addon.blocklistURL;
- warningLink.hidden = false;
- } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE) {
- this.node.setAttribute("notification", "error");
- document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
- "details.notification.vulnerableUpdatable",
- [this._addon.name], 1
- );
- let errorLink = document.getElementById("detail-error-link");
- errorLink.value = gStrings.ext.GetStringFromName("details.notification.vulnerableUpdatable.link");
- errorLink.href = this._addon.blocklistURL;
- errorLink.hidden = false;
- } else if (this._addon.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE) {
- this.node.setAttribute("notification", "error");
- document.getElementById("detail-error").textContent = gStrings.ext.formatStringFromName(
- "details.notification.vulnerableNoUpdate",
- [this._addon.name], 1
- );
- let errorLink = document.getElementById("detail-error-link");
- errorLink.value = gStrings.ext.GetStringFromName("details.notification.vulnerableNoUpdate.link");
- errorLink.href = this._addon.blocklistURL;
- errorLink.hidden = false;
- } else if (this._addon.isGMPlugin && !this._addon.isInstalled &&
- this._addon.isActive) {
- this.node.setAttribute("notification", "warning");
- let warning = document.getElementById("detail-warning");
- warning.textContent =
- gStrings.ext.formatStringFromName("details.notification.gmpPending",
- [this._addon.name], 1);
- } else {
- this.node.removeAttribute("notification");
- }
- }
-
- let menulist = document.getElementById("detail-state-menulist");
- let addonType = AddonManager.addonTypes[this._addon.type];
- if (addonType.flags & AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE) {
- let askItem = document.getElementById("detail-ask-to-activate-menuitem");
- let alwaysItem = document.getElementById("detail-always-activate-menuitem");
- let neverItem = document.getElementById("detail-never-activate-menuitem");
- let hasActivatePermission =
- ["ask_to_activate", "enable", "disable"].some(perm => hasPermission(this._addon, perm));
-
- if (!this._addon.isActive) {
- menulist.selectedItem = neverItem;
- } else if (this._addon.userDisabled == AddonManager.STATE_ASK_TO_ACTIVATE) {
- menulist.selectedItem = askItem;
- } else {
- menulist.selectedItem = alwaysItem;
- }
-
- menulist.disabled = !hasActivatePermission;
- menulist.hidden = false;
- menulist.classList.add('no-auto-hide');
- } else {
- menulist.hidden = true;
- }
-
- this.node.setAttribute("active", this._addon.isActive);
- },
-
- clearLoading: function() {
- if (this._loadingTimer) {
- clearTimeout(this._loadingTimer);
- this._loadingTimer = null;
- }
-
- this.node.removeAttribute("loading-extended");
- },
-
- emptySettingsRows: function() {
- var lastRow = document.getElementById("detail-downloads");
- var rows = lastRow.parentNode;
- while (lastRow.nextSibling)
- rows.removeChild(rows.lastChild);
- },
-
- fillSettingsRows: function(aScrollToPreferences, aCallback) {
- this.emptySettingsRows();
- if (!hasInlineOptions(this._addon)) {
- if (aCallback)
- aCallback();
- return;
- }
-
- // We can't use a promise for this, since some code (especially in tests)
- // relies on us finishing before the ViewChanged event bubbles up to its
- // listeners, and promises resolve asynchronously.
- let whenViewLoaded = callback => {
- if (gViewController.displayedView.hasAttribute("loading")) {
- gDetailView.node.addEventListener("ViewChanged", function viewChangedEventListener() {
- gDetailView.node.removeEventListener("ViewChanged", viewChangedEventListener);
- callback();
- });
- } else {
- callback();
- }
- };
-
- let finish = (firstSetting) => {
- // Ensure the page has loaded and force the XBL bindings to be synchronously applied,
- // then notify observers.
- whenViewLoaded(() => {
- if (firstSetting)
- firstSetting.clientTop;
- Services.obs.notifyObservers(document,
- AddonManager.OPTIONS_NOTIFICATION_DISPLAYED,
- this._addon.id);
- if (aScrollToPreferences)
- gDetailView.scrollToPreferencesRows();
- });
- }
-
- // This function removes and returns the text content of aNode without
- // removing any child elements. Removing the text nodes ensures any XBL
- // bindings apply properly.
- function stripTextNodes(aNode) {
- var text = '';
- for (var i = 0; i < aNode.childNodes.length; i++) {
- if (aNode.childNodes[i].nodeType != document.ELEMENT_NODE) {
- text += aNode.childNodes[i].textContent;
- aNode.removeChild(aNode.childNodes[i--]);
- } else {
- text += stripTextNodes(aNode.childNodes[i]);
- }
- }
- return text;
- }
-
- var rows = document.getElementById("detail-downloads").parentNode;
-
- try {
- if (this._addon.optionsType == AddonManager.OPTIONS_TYPE_INLINE_BROWSER) {
- whenViewLoaded(() => {
- this.createOptionsBrowser(rows).then(browser => {
- // Make sure the browser is unloaded as soon as we change views,
- // rather than waiting for the next detail view to load.
- document.addEventListener("ViewChanged", function viewChangedEventListener() {
- document.removeEventListener("ViewChanged", viewChangedEventListener);
- browser.remove();
- });
-
- finish(browser);
- });
- });
-
- if (aCallback)
- aCallback();
- } else {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", this._addon.optionsURL, true);
- xhr.responseType = "xml";
- xhr.onload = (function() {
- var xml = xhr.responseXML;
- var settings = xml.querySelectorAll(":root > setting");
-
- var firstSetting = null;
- for (var setting of settings) {
-
- var desc = stripTextNodes(setting).trim();
- if (!setting.hasAttribute("desc"))
- setting.setAttribute("desc", desc);
-
- var type = setting.getAttribute("type");
- if (type == "file" || type == "directory")
- setting.setAttribute("fullpath", "true");
-
- setting = document.importNode(setting, true);
- var style = setting.getAttribute("style");
- if (style) {
- setting.removeAttribute("style");
- setting.setAttribute("style", style);
- }
-
- rows.appendChild(setting);
- var visible = window.getComputedStyle(setting, null).getPropertyValue("display") != "none";
- if (!firstSetting && visible) {
- setting.setAttribute("first-row", true);
- firstSetting = setting;
- }
- }
-
- finish(firstSetting);
-
- if (aCallback)
- aCallback();
- }).bind(this);
- xhr.onerror = function(aEvent) {
- Cu.reportError("Error " + aEvent.target.status +
- " occurred while receiving " + this._addon.optionsURL);
- if (aCallback)
- aCallback();
- };
- xhr.send();
- }
- } catch (e) {
- Cu.reportError(e);
- if (aCallback)
- aCallback();
- }
- },
-
- scrollToPreferencesRows: function() {
- // We find this row, rather than remembering it from above,
- // in case it has been changed by the observers.
- let firstRow = gDetailView.node.querySelector('setting[first-row="true"]');
- if (firstRow) {
- let top = firstRow.boxObject.y;
- top -= parseInt(window.getComputedStyle(firstRow, null).getPropertyValue("margin-top"));
-
- let detailViewBoxObject = gDetailView.node.boxObject;
- top -= detailViewBoxObject.y;
-
- detailViewBoxObject.scrollTo(0, top);
- }
- },
-
- createOptionsBrowser: function(parentNode) {
- let browser = document.createElement("browser");
- browser.setAttribute("type", "content");
- browser.setAttribute("disableglobalhistory", "true");
- browser.setAttribute("class", "inline-options-browser");
-
- return new Promise((resolve, reject) => {
- let messageListener = {
- receiveMessage({name, data}) {
- if (name === "Extension:BrowserResized")
- browser.style.height = `${data.height}px`;
- else if (name === "Extension:BrowserContentLoaded")
- resolve(browser);
- },
- };
-
- let onload = () => {
- browser.removeEventListener("load", onload, true);
-
- let mm = new FakeFrameMessageManager(browser);
- mm.loadFrameScript("chrome://extensions/content/ext-browser-content.js",
- false);
- mm.addMessageListener("Extension:BrowserContentLoaded", messageListener);
- mm.addMessageListener("Extension:BrowserResized", messageListener);
- mm.sendAsyncMessage("Extension:InitBrowser", {fixedWidth: true});
-
- browser.setAttribute("src", this._addon.optionsURL);
- };
- browser.addEventListener("load", onload, true);
- browser.addEventListener("error", reject);
-
- parentNode.appendChild(browser);
- });
- },
-
- getSelectedAddon: function() {
- return this._addon;
- },
-
- onEnabling: function() {
- this.updateState();
- },
-
- onEnabled: function() {
- this.updateState();
- this.fillSettingsRows();
- },
-
- onDisabling: function(aNeedsRestart) {
- this.updateState();
- if (!aNeedsRestart && hasInlineOptions(this._addon)) {
- Services.obs.notifyObservers(document,
- AddonManager.OPTIONS_NOTIFICATION_HIDDEN,
- this._addon.id);
- }
- },
-
- onDisabled: function() {
- this.updateState();
- this.emptySettingsRows();
- },
-
- onUninstalling: function() {
- this.updateState();
- },
-
- onUninstalled: function() {
- gViewController.popState();
- },
-
- onOperationCancelled: function() {
- this.updateState();
- },
-
- onPropertyChanged: function(aProperties) {
- if (aProperties.indexOf("applyBackgroundUpdates") != -1) {
- this._autoUpdate.value = this._addon.applyBackgroundUpdates;
- let hideFindUpdates = AddonManager.shouldAutoUpdate(this._addon);
- document.getElementById("detail-findUpdates-btn").hidden = hideFindUpdates;
- }
-
- if (aProperties.indexOf("appDisabled") != -1 ||
- aProperties.indexOf("signedState") != -1 ||
- aProperties.indexOf("userDisabled") != -1)
- this.updateState();
- },
-
- onExternalInstall: function(aAddon, aExistingAddon, aNeedsRestart) {
- // Only care about upgrades for the currently displayed add-on
- if (!aExistingAddon || aExistingAddon.id != this._addon.id)
- return;
-
- if (!aNeedsRestart)
- this._updateView(aAddon, false);
- else
- this.updateState();
- },
-
- onInstallCancelled: function(aInstall) {
- if (aInstall.addon.id == this._addon.id)
- gViewController.popState();
- }
-};
-
-
-var gUpdatesView = {
- node: null,
- _listBox: null,
- _emptyNotice: null,
- _sorters: null,
- _updateSelected: null,
- _categoryItem: null,
-
- initialize: function() {
- this.node = document.getElementById("updates-view");
- this._listBox = document.getElementById("updates-list");
- this._emptyNotice = document.getElementById("updates-list-empty");
- this._sorters = document.getElementById("updates-sorters");
- this._sorters.handler = this;
-
- this._categoryItem = gCategories.get("addons://updates/available");
-
- this._updateSelected = document.getElementById("update-selected-btn");
- this._updateSelected.addEventListener("command", function() {
- gUpdatesView.installSelected();
- }, false);
-
- this.updateAvailableCount(true);
-
- AddonManager.addAddonListener(this);
- AddonManager.addInstallListener(this);
- },
-
- shutdown: function() {
- AddonManager.removeAddonListener(this);
- AddonManager.removeInstallListener(this);
- },
-
- show: function(aType, aRequest) {
- document.getElementById("empty-availableUpdates-msg").hidden = aType != "available";
- document.getElementById("empty-recentUpdates-msg").hidden = aType != "recent";
- this.showEmptyNotice(false);
-
- while (this._listBox.itemCount > 0)
- this._listBox.removeItemAt(0);
-
- this.node.setAttribute("updatetype", aType);
- if (aType == "recent")
- this._showRecentUpdates(aRequest);
- else
- this._showAvailableUpdates(false, aRequest);
- },
-
- hide: function() {
- this._updateSelected.hidden = true;
- this._categoryItem.disabled = this._categoryItem.badgeCount == 0;
- doPendingUninstalls(this._listBox);
- },
-
- _showRecentUpdates: function(aRequest) {
- AddonManager.getAllAddons((aAddonsList) => {
- if (gViewController && aRequest != gViewController.currentViewRequest)
- return;
-
- var elements = [];
- let threshold = Date.now() - UPDATES_RECENT_TIMESPAN;
- for (let addon of aAddonsList) {
- if (addon.hidden || !addon.updateDate || addon.updateDate.getTime() < threshold)
- continue;
-
- elements.push(createItem(addon));
- }
-
- this.showEmptyNotice(elements.length == 0);
- if (elements.length > 0) {
- sortElements(elements, [this._sorters.sortBy], this._sorters.ascending);
- for (let element of elements)
- this._listBox.appendChild(element);
- }
-
- gViewController.notifyViewChanged();
- });
- },
-
- _showAvailableUpdates: function(aIsRefresh, aRequest) {
- /* Disable the Update Selected button so it can't get clicked
- before everything is initialized asynchronously.
- It will get re-enabled by maybeDisableUpdateSelected(). */
- this._updateSelected.disabled = true;
-
- AddonManager.getAllInstalls((aInstallsList) => {
- if (!aIsRefresh && gViewController && aRequest &&
- aRequest != gViewController.currentViewRequest)
- return;
-
- if (aIsRefresh) {
- this.showEmptyNotice(false);
- this._updateSelected.hidden = true;
-
- while (this._listBox.childNodes.length > 0)
- this._listBox.removeChild(this._listBox.firstChild);
- }
-
- var elements = [];
-
- for (let install of aInstallsList) {
- if (!this.isManualUpdate(install))
- continue;
-
- let item = createItem(install.existingAddon);
- item.setAttribute("upgrade", true);
- item.addEventListener("IncludeUpdateChanged", () => {
- this.maybeDisableUpdateSelected();
- }, false);
- elements.push(item);
- }
-
- this.showEmptyNotice(elements.length == 0);
- if (elements.length > 0) {
- this._updateSelected.hidden = false;
- sortElements(elements, [this._sorters.sortBy], this._sorters.ascending);
- for (let element of elements)
- this._listBox.appendChild(element);
- }
-
- // ensure badge count is in sync
- this._categoryItem.badgeCount = this._listBox.itemCount;
-
- gViewController.notifyViewChanged();
- });
- },
-
- showEmptyNotice: function(aShow) {
- this._emptyNotice.hidden = !aShow;
- this._listBox.hidden = aShow;
- },
-
- isManualUpdate: function(aInstall, aOnlyAvailable) {
- var isManual = aInstall.existingAddon &&
- !AddonManager.shouldAutoUpdate(aInstall.existingAddon);
- if (isManual && aOnlyAvailable)
- return isInState(aInstall, "available");
- return isManual;
- },
-
- maybeRefresh: function() {
- if (gViewController.currentViewId == "addons://updates/available")
- this._showAvailableUpdates(true);
- this.updateAvailableCount();
- },
-
- updateAvailableCount: function(aInitializing) {
- if (aInitializing)
- gPendingInitializations++;
- AddonManager.getAllInstalls((aInstallsList) => {
- var count = aInstallsList.filter(aInstall => {
- return this.isManualUpdate(aInstall, true);
- }).length;
- this._categoryItem.disabled = gViewController.currentViewId != "addons://updates/available" &&
- count == 0;
- this._categoryItem.badgeCount = count;
- if (aInitializing)
- notifyInitialized();
- });
- },
-
- maybeDisableUpdateSelected: function() {
- for (let item of this._listBox.childNodes) {
- if (item.includeUpdate) {
- this._updateSelected.disabled = false;
- return;
- }
- }
- this._updateSelected.disabled = true;
- },
-
- installSelected: function() {
- for (let item of this._listBox.childNodes) {
- if (item.includeUpdate)
- item.upgrade();
- }
-
- this._updateSelected.disabled = true;
- },
-
- getSelectedAddon: function() {
- var item = this._listBox.selectedItem;
- if (item)
- return item.mAddon;
- return null;
- },
-
- getListItemForID: function(aId) {
- var listitem = this._listBox.firstChild;
- while (listitem) {
- if (listitem.mAddon.id == aId)
- return listitem;
- listitem = listitem.nextSibling;
- }
- return null;
- },
-
- onSortChanged: function(aSortBy, aAscending) {
- sortList(this._listBox, aSortBy, aAscending);
- },
-
- onNewInstall: function(aInstall) {
- if (!this.isManualUpdate(aInstall))
- return;
- this.maybeRefresh();
- },
-
- onInstallStarted: function(aInstall) {
- this.updateAvailableCount();
- },
-
- onInstallCancelled: function(aInstall) {
- if (!this.isManualUpdate(aInstall))
- return;
- this.maybeRefresh();
- },
-
- onPropertyChanged: function(aAddon, aProperties) {
- if (aProperties.indexOf("applyBackgroundUpdates") != -1)
- this.updateAvailableCount();
- }
-};
-
-var gDragDrop = {
- onDragOver: function(aEvent) {
- var types = aEvent.dataTransfer.types;
- if (types.includes("text/uri-list") ||
- types.includes("text/x-moz-url") ||
- types.includes("application/x-moz-file"))
- aEvent.preventDefault();
- },
-
- onDrop: function(aEvent) {
- var dataTransfer = aEvent.dataTransfer;
- var urls = [];
-
- // Convert every dropped item into a url
- for (var i = 0; i < dataTransfer.mozItemCount; i++) {
- var url = dataTransfer.mozGetDataAt("text/uri-list", i);
- if (url) {
- urls.push(url);
- continue;
- }
-
- url = dataTransfer.mozGetDataAt("text/x-moz-url", i);
- if (url) {
- urls.push(url.split("\n")[0]);
- continue;
- }
-
- var file = dataTransfer.mozGetDataAt("application/x-moz-file", i);
- if (file) {
- urls.push(Services.io.newFileURI(file).spec);
- continue;
- }
- }
-
- var pos = 0;
- var installs = [];
-
- function buildNextInstall() {
- if (pos == urls.length) {
- if (installs.length > 0) {
- // Display the normal install confirmation for the installs
- let webInstaller = Cc["@mozilla.org/addons/web-install-listener;1"].
- getService(Ci.amIWebInstallListener);
- webInstaller.onWebInstallRequested(getBrowserElement(),
- document.documentURIObject,
- installs);
- }
- return;
- }
-
- AddonManager.getInstallForURL(urls[pos++], function(aInstall) {
- installs.push(aInstall);
- buildNextInstall();
- }, "application/x-xpinstall");
- }
-
- buildNextInstall();
-
- aEvent.preventDefault();
- }
-};
diff --git a/toolkit/mozapps/webextensions/content/extensions.xml b/toolkit/mozapps/webextensions/content/extensions.xml
deleted file mode 100644
index b49645cf0a..0000000000
--- a/toolkit/mozapps/webextensions/content/extensions.xml
+++ /dev/null
@@ -1,2008 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-
-<!DOCTYPE page [
-<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
-%extensionsDTD;
-]>
-
-<!-- import-globals-from extensions.js -->
-
-<bindings id="addonBindings"
- xmlns="http://www.mozilla.org/xbl"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xbl="http://www.mozilla.org/xbl">
-
-
- <!-- Rating - displays current/average rating, allows setting user rating -->
- <binding id="rating">
- <content>
- <xul:image class="star"
- onmouseover="document.getBindingParent(this)._hover(1);"
- onclick="document.getBindingParent(this).userRating = 1;"/>
- <xul:image class="star"
- onmouseover="document.getBindingParent(this)._hover(2);"
- onclick="document.getBindingParent(this).userRating = 2;"/>
- <xul:image class="star"
- onmouseover="document.getBindingParent(this)._hover(3);"
- onclick="document.getBindingParent(this).userRating = 3;"/>
- <xul:image class="star"
- onmouseover="document.getBindingParent(this)._hover(4);"
- onclick="document.getBindingParent(this).userRating = 4;"/>
- <xul:image class="star"
- onmouseover="document.getBindingParent(this)._hover(5);"
- onclick="document.getBindingParent(this).userRating = 5;"/>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- this._updateStars();
- ]]></constructor>
-
- <property name="stars" readonly="true">
- <getter><![CDATA[
- return document.getAnonymousNodes(this);
- ]]></getter>
- </property>
-
- <property name="averageRating">
- <getter><![CDATA[
- if (this.hasAttribute("averagerating"))
- return this.getAttribute("averagerating");
- return -1;
- ]]></getter>
- <setter><![CDATA[
- this.setAttribute("averagerating", val);
- if (this.showRating == "average")
- this._updateStars();
- ]]></setter>
- </property>
-
- <property name="userRating">
- <getter><![CDATA[
- if (this.hasAttribute("userrating"))
- return this.getAttribute("userrating");
- return -1;
- ]]></getter>
- <setter><![CDATA[
- if (this.showRating != "user")
- return;
- this.setAttribute("userrating", val);
- if (this.showRating == "user")
- this._updateStars();
- ]]></setter>
- </property>
-
- <property name="showRating">
- <getter><![CDATA[
- if (this.hasAttribute("showrating"))
- return this.getAttribute("showrating");
- return "average";
- ]]></getter>
- <setter><![CDATA[
- if (val != "average" || val != "user")
- throw Components.Exception("Invalid value", Components.results.NS_ERROR_ILLEGAL_VALUE);
- this.setAttribute("showrating", val);
- this._updateStars();
- ]]></setter>
- </property>
-
- <method name="_updateStars">
- <body><![CDATA[
- var stars = this.stars;
- var rating = this[this.showRating + "Rating"];
- // average ratings can be non-whole numbers, round them so they
- // match to their closest star
- rating = Math.round(rating);
- for (let i = 0; i < stars.length; i++)
- stars[i].setAttribute("on", rating > i);
- ]]></body>
- </method>
-
- <method name="_hover">
- <parameter name="aScore"/>
- <body><![CDATA[
- if (this.showRating != "user")
- return;
- var stars = this.stars;
- for (let i = 0; i < stars.length; i++)
- stars[i].setAttribute("on", i <= (aScore -1));
- ]]></body>
- </method>
-
- </implementation>
-
- <handlers>
- <handler event="mouseout">
- this._updateStars();
- </handler>
- </handlers>
- </binding>
-
- <!-- Download progress - shows graphical progress of download and any
- related status message. -->
- <binding id="download-progress">
- <content>
- <xul:stack flex="1">
- <xul:hbox flex="1">
- <xul:hbox class="start-cap"/>
- <xul:progressmeter anonid="progress" class="progress" flex="1"
- min="0" max="100"/>
- <xul:hbox class="end-cap"/>
- </xul:hbox>
- <xul:hbox class="status-container">
- <xul:spacer flex="1"/>
- <xul:label anonid="status" class="status"/>
- <xul:spacer flex="1"/>
- <xul:button anonid="cancel-btn" class="cancel"
- tooltiptext="&progress.cancel.tooltip;"
- oncommand="document.getBindingParent(this).cancel();"/>
- </xul:hbox>
- </xul:stack>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- var progress = 0;
- if (this.hasAttribute("progress"))
- progress = parseInt(this.getAttribute("progress"));
- this.progress = progress;
- ]]></constructor>
-
- <field name="_progress">
- document.getAnonymousElementByAttribute(this, "anonid", "progress");
- </field>
- <field name="_cancel">
- document.getAnonymousElementByAttribute(this, "anonid", "cancel-btn");
- </field>
- <field name="_status">
- document.getAnonymousElementByAttribute(this, "anonid", "status");
- </field>
-
- <property name="progress">
- <getter><![CDATA[
- return this._progress.value;
- ]]></getter>
- <setter><![CDATA[
- this._progress.value = val;
- if (val == this._progress.max)
- this.setAttribute("complete", true);
- else
- this.removeAttribute("complete");
- ]]></setter>
- </property>
-
- <property name="maxProgress">
- <getter><![CDATA[
- return this._progress.max;
- ]]></getter>
- <setter><![CDATA[
- if (val == -1) {
- this._progress.mode = "undetermined";
- } else {
- this._progress.mode = "determined";
- this._progress.max = val;
- }
- this.setAttribute("mode", this._progress.mode);
- ]]></setter>
- </property>
-
- <property name="status">
- <getter><![CDATA[
- return this._status.value;
- ]]></getter>
- <setter><![CDATA[
- this._status.value = val;
- ]]></setter>
- </property>
-
- <method name="cancel">
- <body><![CDATA[
- this.mInstall.cancel();
- ]]></body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Sorters - displays and controls the sort state of a list. -->
- <binding id="sorters">
- <content orient="horizontal">
- <xul:button anonid="name-btn" class="sorter"
- label="&sort.name.label;" tooltiptext="&sort.name.tooltip;"
- oncommand="this.parentNode._handleChange('name');"/>
- <xul:button anonid="date-btn" class="sorter"
- label="&sort.dateUpdated.label;"
- tooltiptext="&sort.dateUpdated.tooltip;"
- oncommand="this.parentNode._handleChange('updateDate');"/>
- <xul:button anonid="price-btn" class="sorter" hidden="true"
- label="&sort.price.label;"
- tooltiptext="&sort.price.tooltip;"
- oncommand="this.parentNode._handleChange('purchaseAmount');"/>
- <xul:button anonid="relevance-btn" class="sorter" hidden="true"
- label="&sort.relevance.label;"
- tooltiptext="&sort.relevance.tooltip;"
- oncommand="this.parentNode._handleChange('relevancescore');"/>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- if (!this.hasAttribute("sortby"))
- this.setAttribute("sortby", "name");
-
- if (this.getAttribute("showrelevance") == "true")
- this._btnRelevance.hidden = false;
-
- if (this.getAttribute("showprice") == "true")
- this._btnPrice.hidden = false;
-
- this._refreshState();
- ]]></constructor>
-
- <field name="handler">null</field>
- <field name="_btnName">
- document.getAnonymousElementByAttribute(this, "anonid", "name-btn");
- </field>
- <field name="_btnDate">
- document.getAnonymousElementByAttribute(this, "anonid", "date-btn");
- </field>
- <field name="_btnPrice">
- document.getAnonymousElementByAttribute(this, "anonid", "price-btn");
- </field>
- <field name="_btnRelevance">
- document.getAnonymousElementByAttribute(this, "anonid", "relevance-btn");
- </field>
-
- <property name="sortBy">
- <getter><![CDATA[
- return this.getAttribute("sortby");
- ]]></getter>
- <setter><![CDATA[
- if (val != this.sortBy) {
- this.setAttribute("sortBy", val);
- this._refreshState();
- }
- ]]></setter>
- </property>
-
- <property name="ascending">
- <getter><![CDATA[
- return (this.getAttribute("ascending") == "true");
- ]]></getter>
- <setter><![CDATA[
- val = !!val;
- if (val != this.ascending) {
- this.setAttribute("ascending", val);
- this._refreshState();
- }
- ]]></setter>
- </property>
-
- <property name="showrelevance">
- <getter><![CDATA[
- return (this.getAttribute("showrelevance") == "true");
- ]]></getter>
- <setter><![CDATA[
- val = !!val;
- this.setAttribute("showrelevance", val);
- this._btnRelevance.hidden = !val;
- ]]></setter>
- </property>
-
- <property name="showprice">
- <getter><![CDATA[
- return (this.getAttribute("showprice") == "true");
- ]]></getter>
- <setter><![CDATA[
- val = !!val;
- this.setAttribute("showprice", val);
- this._btnPrice.hidden = !val;
- ]]></setter>
- </property>
-
- <method name="setSort">
- <parameter name="aSort"/>
- <parameter name="aAscending"/>
- <body><![CDATA[
- var sortChanged = false;
- if (aSort != this.sortBy) {
- this.setAttribute("sortby", aSort);
- sortChanged = true;
- }
-
- aAscending = !!aAscending;
- if (this.ascending != aAscending) {
- this.setAttribute("ascending", aAscending);
- sortChanged = true;
- }
-
- if (sortChanged)
- this._refreshState();
- ]]></body>
- </method>
-
- <method name="_handleChange">
- <parameter name="aSort"/>
- <body><![CDATA[
- const ASCENDING_SORT_FIELDS = ["name", "purchaseAmount"];
-
- // Toggle ascending if sort by is not changing, otherwise
- // name sorting defaults to ascending, others to descending
- if (aSort == this.sortBy)
- this.ascending = !this.ascending;
- else
- this.setSort(aSort, ASCENDING_SORT_FIELDS.indexOf(aSort) >= 0);
- ]]></body>
- </method>
-
- <method name="_refreshState">
- <body><![CDATA[
- var sortBy = this.sortBy;
- var checkState = this.ascending ? 2 : 1;
-
- if (sortBy == "name") {
- this._btnName.checkState = checkState;
- this._btnName.checked = true;
- } else {
- this._btnName.checkState = 0;
- this._btnName.checked = false;
- }
-
- if (sortBy == "updateDate") {
- this._btnDate.checkState = checkState;
- this._btnDate.checked = true;
- } else {
- this._btnDate.checkState = 0;
- this._btnDate.checked = false;
- }
-
- if (sortBy == "purchaseAmount") {
- this._btnPrice.checkState = checkState;
- this._btnPrice.checked = true;
- } else {
- this._btnPrice.checkState = 0;
- this._btnPrice.checked = false;
- }
-
- if (sortBy == "relevancescore") {
- this._btnRelevance.checkState = checkState;
- this._btnRelevance.checked = true;
- } else {
- this._btnRelevance.checkState = 0;
- this._btnRelevance.checked = false;
- }
-
- if (this.handler && "onSortChanged" in this.handler)
- this.handler.onSortChanged(sortBy, this.ascending);
- ]]></body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Categories list - displays the list of categories on the left pane. -->
- <binding id="categories-list"
- extends="chrome://global/content/bindings/richlistbox.xml#richlistbox">
- <implementation>
- <!-- This needs to be overridden to allow the fancy animation while not
- allowing that item to be selected when hiding. -->
- <method name="_canUserSelect">
- <parameter name="aItem"/>
- <body>
- <![CDATA[
- if (aItem.hasAttribute("disabled") &&
- aItem.getAttribute("disabled") == "true")
- return false;
- var style = document.defaultView.getComputedStyle(aItem, "");
- return style.display != "none" && style.visibility == "visible";
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Category item - an item in the category list. -->
- <binding id="category"
- extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
- <content align="center">
- <xul:image anonid="icon" class="category-icon"/>
- <xul:label anonid="name" class="category-name" flex="1" xbl:inherits="value=name"/>
- <xul:label anonid="badge" class="category-badge" xbl:inherits="value=count"/>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- if (!this.hasAttribute("count"))
- this.setAttribute("count", 0);
- ]]></constructor>
-
- <property name="badgeCount">
- <getter><![CDATA[
- return this.getAttribute("count");
- ]]></getter>
- <setter><![CDATA[
- if (this.getAttribute("count") == val)
- return;
-
- this.setAttribute("count", val);
- var event = document.createEvent("Events");
- event.initEvent("CategoryBadgeUpdated", true, true);
- this.dispatchEvent(event);
- ]]></setter>
- </property>
- </implementation>
- </binding>
-
-
- <!-- Creator link - Name of a user/developer, providing a link if relevant. -->
- <binding id="creator-link">
- <content>
- <xul:label anonid="label" value="&addon.createdBy.label;"/>
- <xul:label anonid="creator-link" class="creator-link text-link"/>
- <xul:label anonid="creator-name" class="creator-name"/>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- if (this.hasAttribute("nameonly") &&
- this.getAttribute("nameonly") == "true") {
- this._label.hidden = true;
- }
- ]]></constructor>
-
- <field name="_label">
- document.getAnonymousElementByAttribute(this, "anonid", "label");
- </field>
- <field name="_creatorLink">
- document.getAnonymousElementByAttribute(this, "anonid", "creator-link");
- </field>
- <field name="_creatorName">
- document.getAnonymousElementByAttribute(this, "anonid", "creator-name");
- </field>
-
- <method name="setCreator">
- <parameter name="aCreator"/>
- <parameter name="aHomepageURL"/>
- <body><![CDATA[
- if (!aCreator) {
- this.collapsed = true;
- return;
- }
- this.collapsed = false;
- var url = aCreator.url || aHomepageURL;
- var showLink = !!url;
- if (showLink) {
- this._creatorLink.value = aCreator.name;
- this._creatorLink.href = url;
- } else {
- this._creatorName.value = aCreator.name;
- }
- this._creatorLink.hidden = !showLink;
- this._creatorName.hidden = showLink;
- ]]></body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Install status - Displays the status of an install/upgrade. -->
- <binding id="install-status">
- <content>
- <xul:label anonid="message"/>
- <xul:progressmeter anonid="progress" class="download-progress"/>
- <xul:button anonid="purchase-remote-btn" hidden="true"
- class="addon-control"
- oncommand="document.getBindingParent(this).purchaseRemote();"/>
- <xul:button anonid="install-remote-btn" hidden="true"
- class="addon-control install" label="&addon.install.label;"
- tooltiptext="&addon.install.tooltip;"
- oncommand="document.getBindingParent(this).installRemote();"/>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- if (this.mInstall)
- this.initWithInstall(this.mInstall);
- else if (this.mControl.mAddon.install)
- this.initWithInstall(this.mControl.mAddon.install);
- else
- this.refreshState();
- ]]></constructor>
-
- <destructor><![CDATA[
- if (this.mInstall)
- this.mInstall.removeListener(this);
- ]]></destructor>
-
- <field name="_message">
- document.getAnonymousElementByAttribute(this, "anonid", "message");
- </field>
- <field name="_progress">
- document.getAnonymousElementByAttribute(this, "anonid", "progress");
- </field>
- <field name="_purchaseRemote">
- document.getAnonymousElementByAttribute(this, "anonid",
- "purchase-remote-btn");
- </field>
- <field name="_installRemote">
- document.getAnonymousElementByAttribute(this, "anonid",
- "install-remote-btn");
- </field>
- <field name="_restartNeeded">
- document.getAnonymousElementByAttribute(this, "anonid",
- "restart-needed");
- </field>
- <field name="_undo">
- document.getAnonymousElementByAttribute(this, "anonid",
- "undo-btn");
- </field>
-
- <method name="initWithInstall">
- <parameter name="aInstall"/>
- <body><![CDATA[
- if (this.mInstall) {
- this.mInstall.removeListener(this);
- this.mInstall = null;
- }
- this.mInstall = aInstall;
- this._progress.mInstall = aInstall;
- this.refreshState();
- this.mInstall.addListener(this);
- ]]></body>
- </method>
-
- <method name="refreshState">
- <body><![CDATA[
- var showInstallRemote = false;
- var showPurchase = false;
-
- if (this.mInstall) {
-
- switch (this.mInstall.state) {
- case AddonManager.STATE_AVAILABLE:
- if (this.mControl.getAttribute("remote") != "true")
- break;
-
- this._progress.hidden = true;
- showInstallRemote = true;
- break;
- case AddonManager.STATE_DOWNLOADING:
- this.showMessage("installDownloading");
- break;
- case AddonManager.STATE_CHECKING:
- this.showMessage("installVerifying");
- break;
- case AddonManager.STATE_DOWNLOADED:
- this.showMessage("installDownloaded");
- break;
- case AddonManager.STATE_DOWNLOAD_FAILED:
- // XXXunf expose what error occured (bug 553487)
- this.showMessage("installDownloadFailed", true);
- break;
- case AddonManager.STATE_INSTALLING:
- this.showMessage("installInstalling");
- break;
- case AddonManager.STATE_INSTALL_FAILED:
- // XXXunf expose what error occured (bug 553487)
- this.showMessage("installFailed", true);
- break;
- case AddonManager.STATE_CANCELLED:
- this.showMessage("installCancelled", true);
- break;
- }
-
- } else if (this.mControl.mAddon.purchaseURL) {
- this._progress.hidden = true;
- showPurchase = true;
- this._purchaseRemote.label =
- gStrings.ext.formatStringFromName("addon.purchase.label",
- [this.mControl.mAddon.purchaseDisplayAmount], 1);
- this._purchaseRemote.tooltiptext =
- gStrings.ext.GetStringFromName("addon.purchase.tooltip");
- }
-
- this._purchaseRemote.hidden = !showPurchase;
- this._installRemote.hidden = !showInstallRemote;
-
- if ("refreshInfo" in this.mControl)
- this.mControl.refreshInfo();
- ]]></body>
- </method>
-
- <method name="showMessage">
- <parameter name="aMsgId"/>
- <parameter name="aHideProgress"/>
- <body><![CDATA[
- this._message.setAttribute("hidden", !aHideProgress);
- this._progress.setAttribute("hidden", !!aHideProgress);
-
- var msg = gStrings.ext.GetStringFromName(aMsgId);
- if (aHideProgress)
- this._message.value = msg;
- else
- this._progress.status = msg;
- ]]></body>
- </method>
-
- <method name="purchaseRemote">
- <body><![CDATA[
- openURL(this.mControl.mAddon.purchaseURL);
- ]]></body>
- </method>
-
- <method name="installRemote">
- <body><![CDATA[
- if (this.mControl.getAttribute("remote") != "true")
- return;
-
- if (this.mControl.mAddon.eula) {
- var data = {
- addon: this.mControl.mAddon,
- accepted: false
- };
- window.openDialog("chrome://mozapps/content/extensions/eula.xul", "_blank",
- "chrome,dialog,modal,centerscreen,resizable=no", data);
- if (!data.accepted)
- return;
- }
-
- delete this.mControl.mAddon;
- this.mControl.mInstall = this.mInstall;
- this.mControl.setAttribute("status", "installing");
- this.mInstall.install();
- ]]></body>
- </method>
-
- <method name="undoAction">
- <body><![CDATA[
- if (!this.mAddon)
- return;
- var pending = this.mAddon.pendingOperations;
- if (pending & AddonManager.PENDING_ENABLE)
- this.mAddon.userDisabled = true;
- else if (pending & AddonManager.PENDING_DISABLE)
- this.mAddon.userDisabled = false;
- this.refreshState();
- ]]></body>
- </method>
-
- <method name="onDownloadStarted">
- <body><![CDATA[
- this.refreshState();
- ]]></body>
- </method>
-
- <method name="onDownloadEnded">
- <body><![CDATA[
- this.refreshState();
- ]]></body>
- </method>
-
- <method name="onDownloadFailed">
- <body><![CDATA[
- this.refreshState();
- ]]></body>
- </method>
-
- <method name="onDownloadProgress">
- <body><![CDATA[
- this._progress.maxProgress = this.mInstall.maxProgress;
- this._progress.progress = this.mInstall.progress;
- ]]></body>
- </method>
-
- <method name="onInstallStarted">
- <body><![CDATA[
- this._progress.progress = 0;
- this.refreshState();
- ]]></body>
- </method>
-
- <method name="onInstallEnded">
- <body><![CDATA[
- this.refreshState();
- if ("onInstallCompleted" in this.mControl)
- this.mControl.onInstallCompleted();
- ]]></body>
- </method>
-
- <method name="onInstallFailed">
- <body><![CDATA[
- this.refreshState();
- ]]></body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Addon - base - parent binding of any item representing an addon. -->
- <binding id="addon-base"
- extends="chrome://global/content/bindings/richlistbox.xml#richlistitem">
- <implementation>
- <method name="hasPermission">
- <parameter name="aPerm"/>
- <body><![CDATA[
- var perm = AddonManager["PERM_CAN_" + aPerm.toUpperCase()];
- return !!(this.mAddon.permissions & perm);
- ]]></body>
- </method>
-
- <method name="opRequiresRestart">
- <parameter name="aOperation"/>
- <body><![CDATA[
- var operation = AddonManager["OP_NEEDS_RESTART_" + aOperation.toUpperCase()];
- return !!(this.mAddon.operationsRequiringRestart & operation);
- ]]></body>
- </method>
-
- <method name="isPending">
- <parameter name="aAction"/>
- <body><![CDATA[
- var action = AddonManager["PENDING_" + aAction.toUpperCase()];
- return !!(this.mAddon.pendingOperations & action);
- ]]></body>
- </method>
-
- <method name="typeHasFlag">
- <parameter name="aFlag"/>
- <body><![CDATA[
- let flag = AddonManager["TYPE_" + aFlag];
- let type = AddonManager.addonTypes[this.mAddon.type];
-
- return !!(type.flags & flag);
- ]]></body>
- </method>
-
- <method name="onUninstalled">
- <body><![CDATA[
- this.parentNode.removeChild(this);
- ]]></body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Addon - generic - A normal addon item, or an update to one -->
- <binding id="addon-generic"
- extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
- <content>
- <xul:hbox anonid="warning-container"
- class="warning">
- <xul:image class="warning-icon"/>
- <xul:label anonid="warning" flex="1"/>
- <xul:label anonid="warning-link" class="text-link"/>
- <xul:button anonid="warning-btn" class="button-link" hidden="true"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- <xul:hbox anonid="error-container"
- class="error">
- <xul:image class="error-icon"/>
- <xul:label anonid="error" flex="1"/>
- <xul:label anonid="error-link" class="text-link" hidden="true"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- <xul:hbox anonid="pending-container"
- class="pending">
- <xul:image class="pending-icon"/>
- <xul:label anonid="pending" flex="1"/>
- <xul:button anonid="restart-btn" class="button-link"
- label="&addon.restartNow.label;"
- oncommand="document.getBindingParent(this).restart();"/>
- <xul:button anonid="undo-btn" class="button-link"
- label="&addon.undoAction.label;"
- tooltipText="&addon.undoAction.tooltip;"
- oncommand="document.getBindingParent(this).undo();"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
-
- <xul:hbox class="content-container" align="center">
- <xul:vbox class="icon-container">
- <xul:image anonid="icon" class="icon"/>
- </xul:vbox>
- <xul:vbox class="content-inner-container" flex="1">
- <xul:hbox class="basicinfo-container">
- <xul:hbox class="name-container">
- <xul:label anonid="name" class="name" crop="end" flex="1"
- tooltip="addonitem-tooltip" xbl:inherits="value=name"/>
- <xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/>
- <xul:label class="update-postfix" value="&addon.update.postfix;"/>
- <xul:spacer flex="5000"/> <!-- Necessary to make the name crop -->
- </xul:hbox>
- <xul:label anonid="date-updated" class="date-updated"
- unknown="&addon.unknownDate;"/>
- </xul:hbox>
- <xul:hbox class="experiment-container">
- <svg width="6" height="6" viewBox="0 0 6 6" version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- class="experiment-bullet-container">
- <circle cx="3" cy="3" r="3" class="experiment-bullet"/>
- </svg>
- <xul:label anonid="experiment-state" class="experiment-state"/>
- <xul:label anonid="experiment-time" class="experiment-time"/>
- </xul:hbox>
-
- <xul:hbox class="advancedinfo-container" flex="1">
- <xul:vbox class="description-outer-container" flex="1">
- <xul:hbox class="description-container">
- <xul:label anonid="description" class="description" crop="end" flex="1"/>
- <xul:button anonid="details-btn" class="details button-link"
- label="&addon.details.label;"
- tooltiptext="&addon.details.tooltip;"
- oncommand="document.getBindingParent(this).showInDetailView();"/>
- <xul:spacer flex="5000"/> <!-- Necessary to make the description crop -->
- </xul:hbox>
- <xul:vbox anonid="relnotes-container" class="relnotes-container">
- <xul:label class="relnotes-header" value="&addon.releaseNotes.label;"/>
- <xul:label anonid="relnotes-loading" value="&addon.loadingReleaseNotes.label;"/>
- <xul:label anonid="relnotes-error" hidden="true"
- value="&addon.errorLoadingReleaseNotes.label;"/>
- <xul:vbox anonid="relnotes" class="relnotes"/>
- </xul:vbox>
- <xul:hbox class="relnotes-toggle-container">
- <xul:button anonid="relnotes-toggle-btn" class="relnotes-toggle"
- hidden="true" label="&cmd.showReleaseNotes.label;"
- tooltiptext="&cmd.showReleaseNotes.tooltip;"
- showlabel="&cmd.showReleaseNotes.label;"
- showtooltip="&cmd.showReleaseNotes.tooltip;"
- hidelabel="&cmd.hideReleaseNotes.label;"
- hidetooltip="&cmd.hideReleaseNotes.tooltip;"
- oncommand="document.getBindingParent(this).toggleReleaseNotes();"/>
- </xul:hbox>
- </xul:vbox>
- </xul:hbox>
- </xul:vbox>
- <xul:vbox class="status-control-wrapper">
- <xul:hbox class="status-container">
- <xul:hbox anonid="checking-update" hidden="true">
- <xul:image class="spinner"/>
- <xul:label value="&addon.checkingForUpdates.label;"/>
- </xul:hbox>
- <xul:vbox anonid="update-available" class="update-available"
- hidden="true">
- <xul:checkbox anonid="include-update" class="include-update"
- label="&addon.includeUpdate.label;" checked="true"
- oncommand="document.getBindingParent(this).onIncludeUpdateChanged();"/>
- <xul:hbox class="update-info-container">
- <xul:label class="update-available-notice"
- value="&addon.updateAvailable.label;"/>
- <xul:button anonid="update-btn" class="addon-control update"
- label="&addon.updateNow.label;"
- tooltiptext="&addon.updateNow.tooltip;"
- oncommand="document.getBindingParent(this).upgrade();"/>
- </xul:hbox>
- </xul:vbox>
- <xul:hbox anonid="install-status" class="install-status"
- hidden="true"/>
- </xul:hbox>
- <xul:hbox anonid="control-container" class="control-container">
- <xul:button anonid="preferences-btn"
- class="addon-control preferences"
-#ifdef XP_WIN
- label="&cmd.showPreferencesWin.label;"
- tooltiptext="&cmd.showPreferencesWin.tooltip;"
-#else
- label="&cmd.showPreferencesUnix.label;"
- tooltiptext="&cmd.showPreferencesUnix.tooltip;"
-#endif
- oncommand="document.getBindingParent(this).showPreferences();"/>
- <xul:button anonid="enable-btn" class="addon-control enable"
- label="&cmd.enableAddon.label;"
- oncommand="document.getBindingParent(this).userDisabled = false;"/>
- <xul:button anonid="disable-btn" class="addon-control disable"
- label="&cmd.disableAddon.label;"
- oncommand="document.getBindingParent(this).userDisabled = true;"/>
- <xul:button anonid="remove-btn" class="addon-control remove"
- label="&cmd.uninstallAddon.label;"
- oncommand="document.getBindingParent(this).uninstall();"/>
- <xul:menulist anonid="state-menulist"
- class="addon-control state"
- tooltiptext="&cmd.stateMenu.tooltip;">
- <xul:menupopup>
- <xul:menuitem anonid="ask-to-activate-menuitem"
- class="addon-control"
- label="&cmd.askToActivate.label;"
- tooltiptext="&cmd.askToActivate.tooltip;"
- oncommand="document.getBindingParent(this).userDisabled = AddonManager.STATE_ASK_TO_ACTIVATE;"/>
- <xul:menuitem anonid="always-activate-menuitem"
- class="addon-control"
- label="&cmd.alwaysActivate.label;"
- tooltiptext="&cmd.alwaysActivate.tooltip;"
- oncommand="document.getBindingParent(this).userDisabled = false;"/>
- <xul:menuitem anonid="never-activate-menuitem"
- class="addon-control"
- label="&cmd.neverActivate.label;"
- tooltiptext="&cmd.neverActivate.tooltip;"
- oncommand="document.getBindingParent(this).userDisabled = true;"/>
- </xul:menupopup>
- </xul:menulist>
- </xul:hbox>
- </xul:vbox>
- </xul:hbox>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- this._installStatus = document.getAnonymousElementByAttribute(this, "anonid", "install-status");
- this._installStatus.mControl = this;
-
- this.setAttribute("contextmenu", "addonitem-popup");
-
- this._showStatus("none");
-
- this._initWithAddon(this.mAddon);
-
- gEventManager.registerAddonListener(this, this.mAddon.id);
- ]]></constructor>
-
- <destructor><![CDATA[
- gEventManager.unregisterAddonListener(this, this.mAddon.id);
- ]]></destructor>
-
- <field name="_warningContainer">
- document.getAnonymousElementByAttribute(this, "anonid",
- "warning-container");
- </field>
- <field name="_warning">
- document.getAnonymousElementByAttribute(this, "anonid",
- "warning");
- </field>
- <field name="_warningLink">
- document.getAnonymousElementByAttribute(this, "anonid",
- "warning-link");
- </field>
- <field name="_warningBtn">
- document.getAnonymousElementByAttribute(this, "anonid",
- "warning-btn");
- </field>
- <field name="_errorContainer">
- document.getAnonymousElementByAttribute(this, "anonid",
- "error-container");
- </field>
- <field name="_error">
- document.getAnonymousElementByAttribute(this, "anonid",
- "error");
- </field>
- <field name="_errorLink">
- document.getAnonymousElementByAttribute(this, "anonid",
- "error-link");
- </field>
- <field name="_pendingContainer">
- document.getAnonymousElementByAttribute(this, "anonid",
- "pending-container");
- </field>
- <field name="_pending">
- document.getAnonymousElementByAttribute(this, "anonid",
- "pending");
- </field>
- <field name="_infoContainer">
- document.getAnonymousElementByAttribute(this, "anonid",
- "info-container");
- </field>
- <field name="_info">
- document.getAnonymousElementByAttribute(this, "anonid",
- "info");
- </field>
- <field name="_experimentState">
- document.getAnonymousElementByAttribute(this, "anonid", "experiment-state");
- </field>
- <field name="_experimentTime">
- document.getAnonymousElementByAttribute(this, "anonid", "experiment-time");
- </field>
- <field name="_icon">
- document.getAnonymousElementByAttribute(this, "anonid", "icon");
- </field>
- <field name="_dateUpdated">
- document.getAnonymousElementByAttribute(this, "anonid",
- "date-updated");
- </field>
- <field name="_description">
- document.getAnonymousElementByAttribute(this, "anonid",
- "description");
- </field>
- <field name="_stateMenulist">
- document.getAnonymousElementByAttribute(this, "anonid",
- "state-menulist");
- </field>
- <field name="_askToActivateMenuitem">
- document.getAnonymousElementByAttribute(this, "anonid",
- "ask-to-activate-menuitem");
- </field>
- <field name="_alwaysActivateMenuitem">
- document.getAnonymousElementByAttribute(this, "anonid",
- "always-activate-menuitem");
- </field>
- <field name="_neverActivateMenuitem">
- document.getAnonymousElementByAttribute(this, "anonid",
- "never-activate-menuitem");
- </field>
- <field name="_preferencesBtn">
- document.getAnonymousElementByAttribute(this, "anonid",
- "preferences-btn");
- </field>
- <field name="_enableBtn">
- document.getAnonymousElementByAttribute(this, "anonid",
- "enable-btn");
- </field>
- <field name="_disableBtn">
- document.getAnonymousElementByAttribute(this, "anonid",
- "disable-btn");
- </field>
- <field name="_removeBtn">
- document.getAnonymousElementByAttribute(this, "anonid",
- "remove-btn");
- </field>
- <field name="_updateBtn">
- document.getAnonymousElementByAttribute(this, "anonid",
- "update-btn");
- </field>
- <field name="_controlContainer">
- document.getAnonymousElementByAttribute(this, "anonid",
- "control-container");
- </field>
- <field name="_installStatus">
- document.getAnonymousElementByAttribute(this, "anonid",
- "install-status");
- </field>
- <field name="_checkingUpdate">
- document.getAnonymousElementByAttribute(this, "anonid",
- "checking-update");
- </field>
- <field name="_updateAvailable">
- document.getAnonymousElementByAttribute(this, "anonid",
- "update-available");
- </field>
- <field name="_includeUpdate">
- document.getAnonymousElementByAttribute(this, "anonid",
- "include-update");
- </field>
- <field name="_relNotesLoaded">false</field>
- <field name="_relNotesToggle">
- document.getAnonymousElementByAttribute(this, "anonid",
- "relnotes-toggle-btn");
- </field>
- <field name="_relNotesLoading">
- document.getAnonymousElementByAttribute(this, "anonid",
- "relnotes-loading");
- </field>
- <field name="_relNotesError">
- document.getAnonymousElementByAttribute(this, "anonid",
- "relnotes-error");
- </field>
- <field name="_relNotesContainer">
- document.getAnonymousElementByAttribute(this, "anonid",
- "relnotes-container");
- </field>
- <field name="_relNotes">
- document.getAnonymousElementByAttribute(this, "anonid",
- "relnotes");
- </field>
-
- <property name="userDisabled">
- <getter><![CDATA[
- return this.mAddon.userDisabled;
- ]]></getter>
- <setter><![CDATA[
- this.mAddon.userDisabled = val;
- ]]></setter>
- </property>
-
- <property name="includeUpdate">
- <getter><![CDATA[
- return this._includeUpdate.checked && !!this.mManualUpdate;
- ]]></getter>
- <setter><![CDATA[
- // XXXunf Eventually, we'll want to persist this for individual
- // updates - see bug 594619.
- this._includeUpdate.checked = !!val;
- ]]></setter>
- </property>
-
- <method name="_initWithAddon">
- <parameter name="aAddon"/>
- <body><![CDATA[
- this.mAddon = aAddon;
-
- this._installStatus.mAddon = this.mAddon;
- this._updateDates();
- this._updateState();
-
- this.setAttribute("name", aAddon.name);
-
- var iconURL = AddonManager.getPreferredIconURL(aAddon, 48, window);
- if (iconURL)
- this._icon.src = iconURL;
- else
- this._icon.src = "";
-
- if (this.mAddon.description)
- this._description.value = this.mAddon.description;
- else
- this._description.hidden = true;
-
- if (!("applyBackgroundUpdates" in this.mAddon) ||
- (this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DISABLE ||
- (this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DEFAULT &&
- !AddonManager.autoUpdateDefault))) {
- AddonManager.getAllInstalls(aInstallsList => {
- // This can return after the binding has been destroyed,
- // so try to detect that and return early
- if (!("onNewInstall" in this))
- return;
- for (let install of aInstallsList) {
- if (install.existingAddon &&
- install.existingAddon.id == this.mAddon.id &&
- install.state == AddonManager.STATE_AVAILABLE) {
- this.onNewInstall(install);
- this.onIncludeUpdateChanged();
- }
- }
- });
- }
- ]]></body>
- </method>
-
- <method name="_showStatus">
- <parameter name="aType"/>
- <body><![CDATA[
- this._controlContainer.hidden = aType != "none" &&
- !(aType == "update-available" && !this.hasAttribute("upgrade"));
-
- this._installStatus.hidden = aType != "progress";
- if (aType == "progress")
- this._installStatus.refreshState();
- this._checkingUpdate.hidden = aType != "checking-update";
- this._updateAvailable.hidden = aType != "update-available";
- this._relNotesToggle.hidden = !(this.mManualUpdate ?
- this.mManualUpdate.releaseNotesURI :
- this.mAddon.releaseNotesURI);
- ]]></body>
- </method>
-
- <method name="_updateDates">
- <body><![CDATA[
- function formatDate(aDate) {
- const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Components.interfaces.nsIXULChromeRegistry)
- .getSelectedLocale("global", true);
- const dtOptions = { year: 'numeric', month: 'long', day: 'numeric' };
- return aDate.toLocaleDateString(locale, dtOptions);
- }
-
- if (this.mAddon.updateDate)
- this._dateUpdated.value = formatDate(this.mAddon.updateDate);
- else
- this._dateUpdated.value = this._dateUpdated.getAttribute("unknown");
- ]]></body>
- </method>
-
- <method name="_updateState">
- <body><![CDATA[
- if (this.parentNode.selectedItem == this)
- gViewController.updateCommands();
-
- var pending = this.mAddon.pendingOperations;
- if (pending != AddonManager.PENDING_NONE) {
- this.removeAttribute("notification");
-
- pending = null;
- const PENDING_OPERATIONS = ["enable", "disable", "install",
- "uninstall", "upgrade"];
- for (let op of PENDING_OPERATIONS) {
- if (this.isPending(op))
- pending = op;
- }
-
- this.setAttribute("pending", pending);
- this._pending.textContent = gStrings.ext.formatStringFromName(
- "notification." + pending,
- [this.mAddon.name, gStrings.brandShortName], 2
- );
- } else {
- this.removeAttribute("pending");
-
- var isUpgrade = this.hasAttribute("upgrade");
- var install = this._installStatus.mInstall;
-
- if (install && install.state == AddonManager.STATE_DOWNLOAD_FAILED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.downloadError",
- [this.mAddon.name], 1
- );
- this._warningBtn.label = gStrings.ext.GetStringFromName("notification.downloadError.retry");
- this._warningBtn.tooltipText = gStrings.ext.GetStringFromName("notification.downloadError.retry.tooltip");
- this._warningBtn.setAttribute("oncommand", "document.getBindingParent(this).retryInstall();");
- this._warningBtn.hidden = false;
- this._warningLink.hidden = true;
- } else if (install && install.state == AddonManager.STATE_INSTALL_FAILED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.installError",
- [this.mAddon.name], 1
- );
- this._warningBtn.label = gStrings.ext.GetStringFromName("notification.installError.retry");
- this._warningBtn.tooltipText = gStrings.ext.GetStringFromName("notification.downloadError.retry.tooltip");
- this._warningBtn.setAttribute("oncommand", "document.getBindingParent(this).retryInstall();");
- this._warningBtn.hidden = false;
- this._warningLink.hidden = true;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_BLOCKED) {
- this.setAttribute("notification", "error");
- this._error.textContent = gStrings.ext.formatStringFromName(
- "notification.blocked",
- [this.mAddon.name], 1
- );
- this._errorLink.value = gStrings.ext.GetStringFromName("notification.blocked.link");
- this._errorLink.href = this.mAddon.blocklistURL;
- this._errorLink.hidden = false;
- } else if (!isUpgrade && !isCorrectlySigned(this.mAddon) && SIGNING_REQUIRED) {
- this.setAttribute("notification", "error");
- this._error.textContent = gStrings.ext.formatStringFromName(
- "notification.unsignedAndDisabled", [this.mAddon.name, gStrings.brandShortName], 2
- );
- this._errorLink.value = gStrings.ext.GetStringFromName("notification.unsigned.link");
- this._errorLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
- this._errorLink.hidden = false;
- } else if ((!isUpgrade && !this.mAddon.isCompatible) && (AddonManager.checkCompatibility
- || (this.mAddon.blocklistState != Ci.nsIBlocklistService.STATE_SOFTBLOCKED))) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.incompatible",
- [this.mAddon.name, gStrings.brandShortName, gStrings.appVersion], 3
- );
- this._warningLink.hidden = true;
- this._warningBtn.hidden = true;
- } else if (!isUpgrade && !isCorrectlySigned(this.mAddon)) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.unsigned", [this.mAddon.name, gStrings.brandShortName], 2
- );
- this._warningLink.value = gStrings.ext.GetStringFromName("notification.unsigned.link");
- this._warningLink.href = Services.urlFormatter.formatURLPref("app.support.baseURL") + "unsigned-addons";
- this._warningLink.hidden = false;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_SOFTBLOCKED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.softblocked",
- [this.mAddon.name], 1
- );
- this._warningLink.value = gStrings.ext.GetStringFromName("notification.softblocked.link");
- this._warningLink.href = this.mAddon.blocklistURL;
- this._warningLink.hidden = false;
- this._warningBtn.hidden = true;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_OUTDATED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.outdated",
- [this.mAddon.name], 1
- );
- this._warningLink.value = gStrings.ext.GetStringFromName("notification.outdated.link");
- this._warningLink.href = this.mAddon.blocklistURL;
- this._warningLink.hidden = false;
- this._warningBtn.hidden = true;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE) {
- this.setAttribute("notification", "error");
- this._error.textContent = gStrings.ext.formatStringFromName(
- "notification.vulnerableUpdatable",
- [this.mAddon.name], 1
- );
- this._errorLink.value = gStrings.ext.GetStringFromName("notification.vulnerableUpdatable.link");
- this._errorLink.href = this.mAddon.blocklistURL;
- this._errorLink.hidden = false;
- } else if (!isUpgrade && this.mAddon.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE) {
- this.setAttribute("notification", "error");
- this._error.textContent = gStrings.ext.formatStringFromName(
- "notification.vulnerableNoUpdate",
- [this.mAddon.name], 1
- );
- this._errorLink.value = gStrings.ext.GetStringFromName("notification.vulnerableNoUpdate.link");
- this._errorLink.href = this.mAddon.blocklistURL;
- this._errorLink.hidden = false;
- } else if (this.mAddon.isGMPlugin && !this.mAddon.isInstalled &&
- this.mAddon.isActive) {
- this.setAttribute("notification", "warning");
- this._warning.textContent =
- gStrings.ext.formatStringFromName("notification.gmpPending",
- [this.mAddon.name], 1);
- } else {
- this.removeAttribute("notification");
- }
- }
-
- this._preferencesBtn.hidden = (!this.mAddon.optionsURL) ||
- this.mAddon.optionsType == AddonManager.OPTIONS_TYPE_INLINE_INFO;
-
- if (this.typeHasFlag("SUPPORTS_ASK_TO_ACTIVATE")) {
- this._enableBtn.disabled = true;
- this._disableBtn.disabled = true;
- this._askToActivateMenuitem.disabled = !this.hasPermission("ask_to_activate");
- this._alwaysActivateMenuitem.disabled = !this.hasPermission("enable");
- this._neverActivateMenuitem.disabled = !this.hasPermission("disable");
- if (!this.mAddon.isActive) {
- this._stateMenulist.selectedItem = this._neverActivateMenuitem;
- } else if (this.mAddon.userDisabled == AddonManager.STATE_ASK_TO_ACTIVATE) {
- this._stateMenulist.selectedItem = this._askToActivateMenuitem;
- } else {
- this._stateMenulist.selectedItem = this._alwaysActivateMenuitem;
- }
- let hasActivatePermission =
- ["ask_to_activate", "enable", "disable"].some(perm => this.hasPermission(perm));
- this._stateMenulist.disabled = !hasActivatePermission;
- this._stateMenulist.hidden = false;
- this._stateMenulist.classList.add('no-auto-hide');
- } else {
- this._stateMenulist.hidden = true;
-
- let enableTooltip = gViewController.commands["cmd_enableItem"]
- .getTooltip(this.mAddon);
- this._enableBtn.setAttribute("tooltiptext", enableTooltip);
- if (this.hasPermission("enable")) {
- this._enableBtn.hidden = false;
- } else {
- this._enableBtn.hidden = true;
- }
-
- let disableTooltip = gViewController.commands["cmd_disableItem"]
- .getTooltip(this.mAddon);
- this._disableBtn.setAttribute("tooltiptext", disableTooltip);
- if (this.hasPermission("disable")) {
- this._disableBtn.hidden = false;
- } else {
- this._disableBtn.hidden = true;
- }
- }
-
- let uninstallTooltip = gViewController.commands["cmd_uninstallItem"]
- .getTooltip(this.mAddon);
- this._removeBtn.setAttribute("tooltiptext", uninstallTooltip);
- if (this.hasPermission("uninstall")) {
- this._removeBtn.hidden = false;
- } else {
- this._removeBtn.hidden = true;
- }
-
- this.setAttribute("active", this.mAddon.isActive);
-
- var showProgress = this.mAddon.purchaseURL || (this.mAddon.install &&
- this.mAddon.install.state != AddonManager.STATE_INSTALLED);
- this._showStatus(showProgress ? "progress" : "none");
-
- if (this.mAddon.type == "experiment") {
- this.removeAttribute("notification");
- let prefix = "experiment.";
- let active = this.mAddon.isActive;
-
- if (!showProgress) {
- let stateKey = prefix + "state." + (active ? "active" : "complete");
- this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
-
- let now = Date.now();
- let end = this.endDate;
- let days = Math.abs(end - now) / (24 * 60 * 60 * 1000);
-
- let timeKey = prefix + "time.";
- let timeMessage;
-
- if (days < 1) {
- timeKey += (active ? "endsToday" : "endedToday");
- timeMessage = gStrings.ext.GetStringFromName(timeKey);
- } else {
- timeKey += (active ? "daysRemaining" : "daysPassed");
- days = Math.round(days);
- let timeString = gStrings.ext.GetStringFromName(timeKey);
- timeMessage = PluralForm.get(days, timeString)
- .replace("#1", days);
- }
-
- this._experimentTime.value = timeMessage;
- }
- }
- ]]></body>
- </method>
-
- <method name="_fetchReleaseNotes">
- <parameter name="aURI"/>
- <body><![CDATA[
- if (!aURI || this._relNotesLoaded) {
- sendToggleEvent();
- return;
- }
-
- var relNotesData = null, transformData = null;
-
- this._relNotesLoaded = true;
- this._relNotesLoading.hidden = false;
- this._relNotesError.hidden = true;
-
- let sendToggleEvent = () => {
- var event = document.createEvent("Events");
- event.initEvent("RelNotesToggle", true, true);
- this.dispatchEvent(event);
- }
-
- let showRelNotes = () => {
- if (!relNotesData || !transformData)
- return;
-
- this._relNotesLoading.hidden = true;
-
- var processor = Components.classes["@mozilla.org/document-transformer;1?type=xslt"]
- .createInstance(Components.interfaces.nsIXSLTProcessor);
- processor.flags |= Components.interfaces.nsIXSLTProcessorPrivate.DISABLE_ALL_LOADS;
-
- processor.importStylesheet(transformData);
- var fragment = processor.transformToFragment(relNotesData, document);
- this._relNotes.appendChild(fragment);
- if (this.hasAttribute("show-relnotes")) {
- var container = this._relNotesContainer;
- container.style.height = container.scrollHeight + "px";
- }
- sendToggleEvent();
- }
-
- let handleError = () => {
- dataReq.abort();
- styleReq.abort();
- this._relNotesLoading.hidden = true;
- this._relNotesError.hidden = false;
- this._relNotesLoaded = false; // allow loading to be re-tried
- sendToggleEvent();
- }
-
- function handleResponse(aEvent) {
- var req = aEvent.target;
- var ct = req.getResponseHeader("content-type");
- if ((!ct || ct.indexOf("text/html") < 0) &&
- req.responseXML &&
- req.responseXML.documentElement.namespaceURI != XMLURI_PARSE_ERROR) {
- if (req == dataReq)
- relNotesData = req.responseXML;
- else
- transformData = req.responseXML;
- showRelNotes();
- } else {
- handleError();
- }
- }
-
- var dataReq = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Components.interfaces.nsIXMLHttpRequest);
- dataReq.open("GET", aURI.spec, true);
- dataReq.responseType = "document";
- dataReq.addEventListener("load", handleResponse, false);
- dataReq.addEventListener("error", handleError, false);
- dataReq.send(null);
-
- var styleReq = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Components.interfaces.nsIXMLHttpRequest);
- styleReq.open("GET", UPDATES_RELEASENOTES_TRANSFORMFILE, true);
- styleReq.responseType = "document";
- styleReq.addEventListener("load", handleResponse, false);
- styleReq.addEventListener("error", handleError, false);
- styleReq.send(null);
- ]]></body>
- </method>
-
- <method name="toggleReleaseNotes">
- <body><![CDATA[
- if (this.hasAttribute("show-relnotes")) {
- this._relNotesContainer.style.height = "0px";
- this.removeAttribute("show-relnotes");
- this._relNotesToggle.setAttribute(
- "label",
- this._relNotesToggle.getAttribute("showlabel")
- );
- this._relNotesToggle.setAttribute(
- "tooltiptext",
- this._relNotesToggle.getAttribute("showtooltip")
- );
- var event = document.createEvent("Events");
- event.initEvent("RelNotesToggle", true, true);
- this.dispatchEvent(event);
- } else {
- this._relNotesContainer.style.height = this._relNotesContainer.scrollHeight +
- "px";
- this.setAttribute("show-relnotes", true);
- this._relNotesToggle.setAttribute(
- "label",
- this._relNotesToggle.getAttribute("hidelabel")
- );
- this._relNotesToggle.setAttribute(
- "tooltiptext",
- this._relNotesToggle.getAttribute("hidetooltip")
- );
- var uri = this.mManualUpdate ?
- this.mManualUpdate.releaseNotesURI :
- this.mAddon.releaseNotesURI;
- this._fetchReleaseNotes(uri);
- }
- ]]></body>
- </method>
-
- <method name="restart">
- <body><![CDATA[
- gViewController.commands["cmd_restartApp"].doCommand();
- ]]></body>
- </method>
-
- <method name="undo">
- <body><![CDATA[
- gViewController.commands["cmd_cancelOperation"].doCommand(this.mAddon);
- ]]></body>
- </method>
-
- <method name="uninstall">
- <body><![CDATA[
- // If uninstalling does not require a restart and the type doesn't
- // support undoing of restartless uninstalls, then we fake it by
- // just disabling it it, and doing the real uninstall later.
- if (!this.opRequiresRestart("uninstall") &&
- !this.typeHasFlag("SUPPORTS_UNDO_RESTARTLESS_UNINSTALL")) {
- this.setAttribute("wasDisabled", this.mAddon.userDisabled);
-
- // We must set userDisabled to true first, this will call
- // _updateState which will clear any pending attribute set.
- this.mAddon.userDisabled = true;
-
- // This won't update any other add-on manager views (bug 582002)
- this.setAttribute("pending", "uninstall");
- } else {
- this.mAddon.uninstall(true);
- }
- ]]></body>
- </method>
-
- <method name="showPreferences">
- <body><![CDATA[
- gViewController.doCommand("cmd_showItemPreferences", this.mAddon);
- ]]></body>
- </method>
-
- <method name="upgrade">
- <body><![CDATA[
- var install = this.mManualUpdate;
- delete this.mManualUpdate;
- install.install();
- ]]></body>
- </method>
-
- <method name="retryInstall">
- <body><![CDATA[
- var install = this._installStatus.mInstall;
- if (!install)
- return;
- if (install.state != AddonManager.STATE_DOWNLOAD_FAILED &&
- install.state != AddonManager.STATE_INSTALL_FAILED)
- return;
- install.install();
- ]]></body>
- </method>
-
- <method name="showInDetailView">
- <body><![CDATA[
- gViewController.loadView("addons://detail/" +
- encodeURIComponent(this.mAddon.id));
- ]]></body>
- </method>
-
- <method name="onIncludeUpdateChanged">
- <body><![CDATA[
- var event = document.createEvent("Events");
- event.initEvent("IncludeUpdateChanged", true, true);
- this.dispatchEvent(event);
- ]]></body>
- </method>
-
- <method name="onEnabling">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onEnabled">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onDisabling">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onDisabled">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onUninstalling">
- <parameter name="aRestartRequired"/>
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onOperationCancelled">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onPropertyChanged">
- <parameter name="aProperties"/>
- <body><![CDATA[
- if (aProperties.indexOf("appDisabled") != -1 ||
- aProperties.indexOf("signedState") != -1 ||
- aProperties.indexOf("userDisabled") != -1)
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onNoUpdateAvailable">
- <body><![CDATA[
- this._showStatus("none");
- ]]></body>
- </method>
-
- <method name="onCheckingUpdate">
- <body><![CDATA[
- this._showStatus("checking-update");
- ]]></body>
- </method>
-
- <method name="onCompatibilityUpdateAvailable">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onExternalInstall">
- <parameter name="aAddon"/>
- <parameter name="aExistingAddon"/>
- <parameter name="aNeedsRestart"/>
- <body><![CDATA[
- if (aExistingAddon.id != this.mAddon.id)
- return;
-
- // If the install completed without needing a restart then switch to
- // using the new Addon
- if (!aNeedsRestart)
- this._initWithAddon(aAddon);
- else
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onNewInstall">
- <parameter name="aInstall"/>
- <body><![CDATA[
- if (this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_ENABLE)
- return;
- if (this.mAddon.applyBackgroundUpdates == AddonManager.AUTOUPDATE_DEFAULT &&
- AddonManager.autoUpdateDefault)
- return;
-
- this.mManualUpdate = aInstall;
- this._showStatus("update-available");
- ]]></body>
- </method>
-
- <method name="onDownloadStarted">
- <parameter name="aInstall"/>
- <body><![CDATA[
- this._updateState();
- this._showStatus("progress");
- this._installStatus.initWithInstall(aInstall);
- ]]></body>
- </method>
-
- <method name="onInstallStarted">
- <parameter name="aInstall"/>
- <body><![CDATA[
- this._updateState();
- this._showStatus("progress");
- this._installStatus.initWithInstall(aInstall);
- ]]></body>
- </method>
-
- <method name="onInstallEnded">
- <parameter name="aInstall"/>
- <parameter name="aAddon"/>
- <body><![CDATA[
- // If the install completed without needing a restart then switch to
- // using the new Addon
- if (!(aAddon.pendingOperations & AddonManager.PENDING_INSTALL))
- this._initWithAddon(aAddon);
- else
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onDownloadFailed">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onInstallFailed">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
-
- <method name="onInstallCancelled">
- <body><![CDATA[
- this._updateState();
- ]]></body>
- </method>
- </implementation>
-
- <handlers>
- <handler event="click" button="0"><![CDATA[
- switch (event.detail) {
- case 1:
- // Prevent double-click where the UI changes on the first click
- this._lastClickTarget = event.originalTarget;
- break;
- case 2:
- if (event.originalTarget.localName != 'button' &&
- !event.originalTarget.classList.contains('text-link') &&
- event.originalTarget == this._lastClickTarget) {
- this.showInDetailView();
- }
- break;
- }
- ]]></handler>
- </handlers>
- </binding>
-
-
- <!-- Addon - uninstalled - An uninstalled addon that can be re-installed. -->
- <binding id="addon-uninstalled"
- extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
- <content>
- <xul:hbox class="pending">
- <xul:image class="pending-icon"/>
- <xul:label anonid="notice" flex="1"/>
- <xul:button anonid="restart-btn" class="button-link"
- label="&addon.restartNow.label;"
- command="cmd_restartApp"/>
- <xul:button anonid="undo-btn" class="button-link"
- label="&addon.undoRemove.label;"
- tooltiptext="&addon.undoRemove.tooltip;"
- oncommand="document.getBindingParent(this).cancelUninstall();"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- this._notice.textContent = gStrings.ext.formatStringFromName("uninstallNotice",
- [this.mAddon.name],
- 1);
-
- if (!this.opRequiresRestart("uninstall"))
- this._restartBtn.setAttribute("hidden", true);
-
- gEventManager.registerAddonListener(this, this.mAddon.id);
- ]]></constructor>
-
- <destructor><![CDATA[
- gEventManager.unregisterAddonListener(this, this.mAddon.id);
- ]]></destructor>
-
- <field name="_notice" readonly="true">
- document.getAnonymousElementByAttribute(this, "anonid", "notice");
- </field>
- <field name="_restartBtn" readonly="true">
- document.getAnonymousElementByAttribute(this, "anonid", "restart-btn");
- </field>
-
- <method name="cancelUninstall">
- <body><![CDATA[
- // This assumes that disabling does not require a restart when
- // uninstalling doesn't. Things will still work if not, the add-on
- // will just still be active until finally getting uninstalled.
-
- if (this.isPending("uninstall"))
- this.mAddon.cancelUninstall();
- else if (this.getAttribute("wasDisabled") != "true")
- this.mAddon.userDisabled = false;
-
- this.removeAttribute("pending");
- ]]></body>
- </method>
-
- <method name="onOperationCancelled">
- <body><![CDATA[
- if (!this.isPending("uninstall"))
- this.removeAttribute("pending");
- ]]></body>
- </method>
-
- <method name="onExternalInstall">
- <parameter name="aAddon"/>
- <parameter name="aExistingAddon"/>
- <parameter name="aNeedsRestart"/>
- <body><![CDATA[
- if (aExistingAddon.id != this.mAddon.id)
- return;
-
- // Make sure any newly installed add-on has the correct disabled state
- if (this.hasAttribute("wasDisabled"))
- aAddon.userDisabled = this.getAttribute("wasDisabled") == "true";
-
- // If the install completed without needing a restart then switch to
- // using the new Addon
- if (!aNeedsRestart)
- this.mAddon = aAddon;
-
- this.removeAttribute("pending");
- ]]></body>
- </method>
-
- <method name="onInstallStarted">
- <parameter name="aInstall"/>
- <body><![CDATA[
- // Make sure any newly installed add-on has the correct disabled state
- if (this.hasAttribute("wasDisabled"))
- aInstall.addon.userDisabled = this.getAttribute("wasDisabled") == "true";
- ]]></body>
- </method>
-
- <method name="onInstallEnded">
- <parameter name="aInstall"/>
- <parameter name="aAddon"/>
- <body><![CDATA[
- // If the install completed without needing a restart then switch to
- // using the new Addon
- if (!(aAddon.pendingOperations & AddonManager.PENDING_INSTALL))
- this.mAddon = aAddon;
-
- this.removeAttribute("pending");
- ]]></body>
- </method>
- </implementation>
- </binding>
-
-
- <!-- Addon - installing - an addon item that is currently being installed -->
- <binding id="addon-installing"
- extends="chrome://mozapps/content/extensions/extensions.xml#addon-base">
- <content>
- <xul:hbox anonid="warning-container" class="warning">
- <xul:image class="warning-icon"/>
- <xul:label anonid="warning" flex="1"/>
- <xul:button anonid="warning-link" class="button-link"
- oncommand="document.getBindingParent(this).retryInstall();"/>
- <xul:spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </xul:hbox>
- <xul:hbox class="content-container">
- <xul:vbox class="icon-outer-container">
- <xul:vbox class="icon-container">
- <xul:image anonid="icon" class="icon"/>
- </xul:vbox>
- </xul:vbox>
- <xul:vbox class="fade name-outer-container" flex="1">
- <xul:hbox class="name-container">
- <xul:label anonid="name" class="name" crop="end" tooltip="addonitem-tooltip"/>
- </xul:hbox>
- </xul:vbox>
- <xul:vbox class="install-status-container">
- <xul:hbox anonid="install-status" class="install-status"/>
- </xul:vbox>
- </xul:hbox>
- </content>
-
- <implementation>
- <constructor><![CDATA[
- this._installStatus.mControl = this;
- this._installStatus.mInstall = this.mInstall;
- this.refreshInfo();
- ]]></constructor>
-
- <field name="_icon">
- document.getAnonymousElementByAttribute(this, "anonid", "icon");
- </field>
- <field name="_name">
- document.getAnonymousElementByAttribute(this, "anonid", "name");
- </field>
- <field name="_warning">
- document.getAnonymousElementByAttribute(this, "anonid", "warning");
- </field>
- <field name="_warningLink">
- document.getAnonymousElementByAttribute(this, "anonid", "warning-link");
- </field>
- <field name="_installStatus">
- document.getAnonymousElementByAttribute(this, "anonid",
- "install-status");
- </field>
-
- <method name="onInstallCompleted">
- <body><![CDATA[
- this.mAddon = this.mInstall.addon;
- this.setAttribute("name", this.mAddon.name);
- this.setAttribute("value", this.mAddon.id);
- this.setAttribute("status", "installed");
- ]]></body>
- </method>
-
- <method name="refreshInfo">
- <body><![CDATA[
- this.mAddon = this.mAddon || this.mInstall.addon;
- if (this.mAddon) {
- this._icon.src = this.mAddon.iconURL ||
- (this.mInstall ? this.mInstall.iconURL : "");
- this._name.value = this.mAddon.name;
- } else {
- this._icon.src = this.mInstall.iconURL;
- // AddonInstall.name isn't always available - fallback to filename
- if (this.mInstall.name) {
- this._name.value = this.mInstall.name;
- } else if (this.mInstall.sourceURI) {
- var url = Components.classes["@mozilla.org/network/standard-url;1"]
- .createInstance(Components.interfaces.nsIStandardURL);
- url.init(url.URLTYPE_STANDARD, 80, this.mInstall.sourceURI.spec,
- null, null);
- url.QueryInterface(Components.interfaces.nsIURL);
- this._name.value = url.fileName;
- }
- }
-
- if (this.mInstall.state == AddonManager.STATE_DOWNLOAD_FAILED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.downloadError",
- [this._name.value], 1
- );
- this._warningLink.label = gStrings.ext.GetStringFromName("notification.downloadError.retry");
- this._warningLink.tooltipText = gStrings.ext.GetStringFromName("notification.downloadError.retry.tooltip");
- } else if (this.mInstall.state == AddonManager.STATE_INSTALL_FAILED) {
- this.setAttribute("notification", "warning");
- this._warning.textContent = gStrings.ext.formatStringFromName(
- "notification.installError",
- [this._name.value], 1
- );
- this._warningLink.label = gStrings.ext.GetStringFromName("notification.installError.retry");
- this._warningLink.tooltipText = gStrings.ext.GetStringFromName("notification.downloadError.retry.tooltip");
- } else {
- this.removeAttribute("notification");
- }
- ]]></body>
- </method>
-
- <method name="retryInstall">
- <body><![CDATA[
- this.mInstall.install();
- ]]></body>
- </method>
- </implementation>
- </binding>
-
- <binding id="detail-row">
- <content>
- <xul:label class="detail-row-label" xbl:inherits="value=label"/>
- <xul:label class="detail-row-value" xbl:inherits="value"/>
- </content>
-
- <implementation>
- <property name="value">
- <getter><![CDATA[
- return this.getAttribute("value");
- ]]></getter>
- <setter><![CDATA[
- if (!val)
- this.removeAttribute("value");
- else
- this.setAttribute("value", val);
- ]]></setter>
- </property>
- </implementation>
- </binding>
-
-</bindings>
diff --git a/toolkit/mozapps/webextensions/content/extensions.xul b/toolkit/mozapps/webextensions/content/extensions.xul
deleted file mode 100644
index 70939d0248..0000000000
--- a/toolkit/mozapps/webextensions/content/extensions.xul
+++ /dev/null
@@ -1,715 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mozapps/content/extensions/extensions.css"?>
-<?xml-stylesheet href="chrome://mozapps/skin/extensions/extensions.css"?>
-
-<!DOCTYPE page [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-%brandDTD;
-<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
-%extensionsDTD;
-]>
-
-<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xhtml="http://www.w3.org/1999/xhtml"
- id="addons-page" title="&addons.windowTitle;"
- role="application" windowtype="Addons:Manager"
- disablefastfind="true">
-
- <xhtml:link rel="shortcut icon"
- href="chrome://mozapps/skin/extensions/extensionGeneric-16.png"/>
-
- <script type="application/javascript"
- src="chrome://mozapps/content/extensions/extensions.js"/>
- <script type="application/javascript"
- src="chrome://global/content/contentAreaUtils.js"/>
-
- <popupset>
- <!-- menu for an addon item -->
- <menupopup id="addonitem-popup">
- <menuitem id="menuitem_showDetails" command="cmd_showItemDetails"
- default="true" label="&cmd.showDetails.label;"
- accesskey="&cmd.showDetails.accesskey;"/>
- <menuitem id="menuitem_enableItem" command="cmd_enableItem"
- label="&cmd.enableAddon.label;"
- accesskey="&cmd.enableAddon.accesskey;"/>
- <menuitem id="menuitem_disableItem" command="cmd_disableItem"
- label="&cmd.disableAddon.label;"
- accesskey="&cmd.disableAddon.accesskey;"/>
- <menuitem id="menuitem_enableTheme" command="cmd_enableItem"
- label="&cmd.enableTheme.label;"
- accesskey="&cmd.enableTheme.accesskey;"/>
- <menuitem id="menuitem_disableTheme" command="cmd_disableItem"
- label="&cmd.disableTheme.label;"
- accesskey="&cmd.disableTheme.accesskey;"/>
- <menuitem id="menuitem_installItem" command="cmd_installItem"
- label="&cmd.installAddon.label;"
- accesskey="&cmd.installAddon.accesskey;"/>
- <menuitem id="menuitem_uninstallItem" command="cmd_uninstallItem"
- label="&cmd.uninstallAddon.label;"
- accesskey="&cmd.uninstallAddon.accesskey;"/>
- <menuseparator id="addonitem-menuseparator" />
- <menuitem id="menuitem_preferences" command="cmd_showItemPreferences"
-#ifdef XP_WIN
- label="&cmd.preferencesWin.label;"
- accesskey="&cmd.preferencesWin.accesskey;"/>
-#else
- label="&cmd.preferencesUnix.label;"
- accesskey="&cmd.preferencesUnix.accesskey;"/>
-#endif
- <menuitem id="menuitem_findUpdates" command="cmd_findItemUpdates"
- label="&cmd.findUpdates.label;"
- accesskey="&cmd.findUpdates.accesskey;"/>
- <menuitem id="menuitem_about" command="cmd_showItemAbout"
- label="&cmd.about.label;"
- accesskey="&cmd.about.accesskey;"/>
- </menupopup>
-
- <tooltip id="addonitem-tooltip"/>
- </popupset>
-
- <!-- global commands - these act on all addons, or affect the addons manager
- in some other way -->
- <commandset id="globalCommandSet">
- <!-- XXXsw remove useless oncommand attribute once bug 371900 is fixed -->
- <command id="cmd_focusSearch" oncommand=";"/>
- <command id="cmd_findAllUpdates"/>
- <command id="cmd_restartApp"/>
- <command id="cmd_goToDiscoverPane"/>
- <command id="cmd_goToRecentUpdates"/>
- <command id="cmd_goToAvailableUpdates"/>
- <command id="cmd_installFromFile"/>
- <command id="cmd_debugAddons"/>
- <command id="cmd_back"/>
- <command id="cmd_forward"/>
- <command id="cmd_enableCheckCompatibility"/>
- <command id="cmd_enableUpdateSecurity"/>
- <command id="cmd_toggleAutoUpdateDefault"/>
- <command id="cmd_resetAddonAutoUpdate"/>
- <command id="cmd_experimentsLearnMore"/>
- <command id="cmd_experimentsOpenTelemetryPreferences"/>
- <command id="cmd_showUnsignedExtensions"/>
- <command id="cmd_showAllExtensions"/>
- </commandset>
-
- <!-- view commands - these act on the selected addon -->
- <commandset id="viewCommandSet"
- events="richlistbox-select" commandupdater="true">
- <command id="cmd_showItemDetails"/>
- <command id="cmd_findItemUpdates"/>
- <command id="cmd_showItemPreferences"/>
- <command id="cmd_showItemAbout"/>
- <command id="cmd_enableItem"/>
- <command id="cmd_disableItem"/>
- <command id="cmd_installItem"/>
- <command id="cmd_purchaseItem"/>
- <command id="cmd_uninstallItem"/>
- <command id="cmd_cancelUninstallItem"/>
- <command id="cmd_cancelOperation"/>
- <command id="cmd_contribute"/>
- <command id="cmd_askToActivateItem"/>
- <command id="cmd_alwaysActivateItem"/>
- <command id="cmd_neverActivateItem"/>
- </commandset>
-
- <keyset>
- <key id="focusSearch" key="&search.commandkey;" modifiers="accel"
- command="cmd_focusSearch"/>
- </keyset>
- <hbox flex="1">
- <vbox>
- <hbox id="nav-header"
- align="center"
- pack="center">
- <toolbarbutton id="back-btn"
- class="nav-button header-button"
- command="cmd_back"
- tooltiptext="&cmd.back.tooltip;"
- hidden="true"
- disabled="true"/>
- <toolbarbutton id="forward-btn"
- class="nav-button header-button"
- command="cmd_forward"
- tooltiptext="&cmd.forward.tooltip;"
- hidden="true"
- disabled="true"/>
- </hbox>
- <!-- category list -->
- <richlistbox id="categories" flex="1">
- <richlistitem id="category-search" value="addons://search/"
- class="category"
- name="&view.search.label;" priority="0"
- tooltiptext="&view.search.label;" disabled="true"/>
- <richlistitem id="category-discover" value="addons://discover/"
- class="category"
- name="&view.discover.label;" priority="1000"
- tooltiptext="&view.discover.label;"/>
- <richlistitem id="category-availableUpdates" value="addons://updates/available"
- class="category"
- name="&view.availableUpdates.label;" priority="100000"
- tooltiptext="&view.availableUpdates.label;"
- disabled="true"/>
- <richlistitem id="category-recentUpdates" value="addons://updates/recent"
- class="category"
- name="&view.recentUpdates.label;" priority="101000"
- tooltiptext="&view.recentUpdates.label;" disabled="true"/>
- </richlistbox>
- </vbox>
- <vbox class="main-content" flex="1">
- <!-- view port -->
- <deck id="view-port" flex="1" selectedIndex="0">
- <!-- discover view -->
- <deck id="discover-view" flex="1" class="view-pane" selectedIndex="0" tabindex="0">
- <vbox id="discover-loading" align="center" pack="stretch" flex="1" class="alert-container">
- <spacer class="alert-spacer-before"/>
- <hbox class="alert loading" align="center">
- <image/>
- <label value="&loading.label;"/>
- </hbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <vbox id="discover-error" align="center" pack="stretch" flex="1" class="alert-container">
- <spacer class="alert-spacer-before"/>
- <hbox>
- <spacer class="discover-spacer-before"/>
- <hbox class="alert" align="center">
- <image class="discover-logo"/>
- <vbox flex="1" align="stretch">
- <label class="discover-title">&discover.title;</label>
- <description class="discover-description">&discover.description2;</description>
- <description class="discover-footer">&discover.footer;</description>
- </vbox>
- </hbox>
- <spacer class="discover-spacer-after"/>
- </hbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <browser id="discover-browser" type="content" flex="1"
- disablehistory="true" homepage="about:blank"/>
- </deck>
-
- <!-- container for views with the search/tools header -->
- <vbox id="headered-views" flex="1">
- <!-- main header -->
- <hbox id="header" align="center">
- <button id="show-all-extensions" hidden="true"
- label="&showAllExtensions.button.label;"
- command="cmd_showAllExtensions"/>
- <spacer flex="1"/>
- <hbox id="updates-container" align="center">
- <image class="spinner"/>
- <label id="updates-noneFound" hidden="true"
- value="&updates.noneFound.label;"/>
- <button id="updates-manualUpdatesFound-btn" class="button-link"
- hidden="true" label="&updates.manualUpdatesFound.label;"
- command="cmd_goToAvailableUpdates"/>
- <label id="updates-progress" hidden="true"
- value="&updates.updating.label;"/>
- <label id="updates-installed" hidden="true"
- value="&updates.installed.label;"/>
- <label id="updates-downloaded" hidden="true"
- value="&updates.downloaded.label;"/>
- <button id="updates-restart-btn" class="button-link" hidden="true"
- label="&updates.restart.label;"
- command="cmd_restartApp"/>
- </hbox>
- <button id="show-disabled-unsigned-extensions" hidden="true"
- class="warning"
- label="&showUnsignedExtensions.button.label;"
- command="cmd_showUnsignedExtensions"/>
- <toolbarbutton id="header-utils-btn" class="header-button" type="menu"
- tooltiptext="&toolsMenu.tooltip;">
- <menupopup id="utils-menu">
- <menuitem id="utils-updateNow"
- label="&updates.checkForUpdates.label;"
- accesskey="&updates.checkForUpdates.accesskey;"
- command="cmd_findAllUpdates"/>
- <menuitem id="utils-viewUpdates"
- label="&updates.viewUpdates.label;"
- accesskey="&updates.viewUpdates.accesskey;"
- command="cmd_goToRecentUpdates"/>
- <menuseparator id="utils-installFromFile-separator"/>
- <menuitem id="utils-installFromFile"
- label="&installAddonFromFile.label;"
- accesskey="&installAddonFromFile.accesskey;"
- command="cmd_installFromFile"/>
- <menuitem id="utils-debugAddons"
- label="&debugAddons.label;"
- accesskey="&debugAddons.accesskey;"
- command="cmd_debugAddons"/>
- <menuseparator/>
- <menuitem id="utils-autoUpdateDefault"
- label="&updates.updateAddonsAutomatically.label;"
- accesskey="&updates.updateAddonsAutomatically.accesskey;"
- type="checkbox" autocheck="false"
- command="cmd_toggleAutoUpdateDefault"/>
- <menuitem id="utils-resetAddonUpdatesToAutomatic"
- label="&updates.resetUpdatesToAutomatic.label;"
- accesskey="&updates.resetUpdatesToAutomatic.accesskey;"
- command="cmd_resetAddonAutoUpdate"/>
- <menuitem id="utils-resetAddonUpdatesToManual"
- label="&updates.resetUpdatesToManual.label;"
- accesskey="&updates.resetUpdatesToManual.accesskey;"
- command="cmd_resetAddonAutoUpdate"/>
- </menupopup>
- </toolbarbutton>
- <textbox id="header-search" type="search" searchbutton="true"
- searchbuttonlabel="&search.buttonlabel;"
- placeholder="&search.placeholder;"/>
- </hbox>
-
- <deck id="headered-views-content" flex="1" selectedIndex="0">
- <!-- search view -->
- <vbox id="search-view" flex="1" class="view-pane" tabindex="0">
- <hbox class="view-header global-warning-container" align="center">
- <!-- global warnings -->
- <hbox class="global-warning" flex="1">
- <hbox class="global-warning-safemode" flex="1" align="center"
- tooltiptext="&warning.safemode.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.safemode.label;"/>
- </hbox>
- <hbox class="global-warning-checkcompatibility" flex="1" align="center"
- tooltiptext="&warning.checkcompatibility.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.checkcompatibility.label;"/>
- </hbox>
- <button class="button-link global-warning-checkcompatibility"
- label="&warning.checkcompatibility.enable.label;"
- tooltiptext="&warning.checkcompatibility.enable.tooltip;"
- command="cmd_enableCheckCompatibility"/>
- <hbox class="global-warning-updatesecurity" flex="1" align="center"
- tooltiptext="&warning.updatesecurity.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.updatesecurity.label;"/>
- </hbox>
- <button class="button-link global-warning-updatesecurity"
- label="&warning.updatesecurity.enable.label;"
- tooltiptext="&warning.updatesecurity.enable.tooltip;"
- command="cmd_enableUpdateSecurity"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- <spacer flex="1"/>
- <hbox id="search-sorters" class="sort-controls"
- showrelevance="true" sortby="relevancescore" ascending="false"/>
- </hbox>
- <hbox id="search-filter" align="center">
- <label id="search-filter-label" value="&search.filter2.label;"/>
- <radiogroup id="search-filter-radiogroup" orient="horizontal"
- align="center" persist="value" value="remote">
- <radio id="search-filter-local" class="search-filter-radio"
- label="&search.filter2.installed.label;" value="local"
- tooltiptext="&search.filter2.installed.tooltip;"/>
- <radio id="search-filter-remote" class="search-filter-radio"
- label="&search.filter2.available.label;" value="remote"
- tooltiptext="&search.filter2.available.tooltip;"/>
- </radiogroup>
- </hbox>
- <vbox id="search-loading" class="alert-container"
- flex="1" hidden="true">
- <spacer class="alert-spacer-before"/>
- <hbox class="alert loading" align="center">
- <image/>
- <label value="&loading.label;"/>
- </hbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <vbox id="search-list-empty" class="alert-container"
- flex="1" hidden="true">
- <spacer class="alert-spacer-before"/>
- <vbox class="alert">
- <label value="&listEmpty.search.label;"/>
- <button class="discover-button"
- id="discover-button-search"
- label="&listEmpty.button.label;"
- command="cmd_goToDiscoverPane"/>
- </vbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <richlistbox id="search-list" class="list" flex="1">
- <hbox pack="center">
- <label id="search-allresults-link" class="text-link"/>
- </hbox>
- </richlistbox>
- </vbox>
-
- <!-- list view -->
- <vbox id="list-view" flex="1" class="view-pane" align="stretch" tabindex="0">
- <!-- info UI for add-ons that have been disabled for being unsigned -->
- <vbox id="disabled-unsigned-addons-info" hidden="true">
- <label id="disabled-unsigned-addons-heading" value="&disabledUnsigned.heading;"/>
- <description>
- &disabledUnsigned.description.start;<label class="text-link plain" id="find-alternative-addons">&disabledUnsigned.description.findAddonsLink;</label>&disabledUnsigned.description.end;
- </description>
- <hbox pack="start"><label class="text-link" id="signing-learn-more">&disabledUnsigned.learnMore;</label></hbox>
- <description id="signing-dev-info">
- &disabledUnsigned.devInfo.start;<label class="text-link plain" id="signing-dev-manual-link">&disabledUnsigned.devInfo.linkToManual;</label>&disabledUnsigned.devInfo.end;
- </description>
- </vbox>
- <vbox id="plugindeprecation-notice" class="alert-container">
- <hbox class="alert">
- <description>&pluginDeprecation.description; &#160;
- <label class="text-link plain" id="plugindeprecation-learnmore-link">&pluginDeprecation.learnMore;</label>
- </description>
- </hbox>
- </vbox>
- <hbox class="view-header global-warning-container">
- <!-- global warnings -->
- <hbox class="global-warning" flex="1">
- <hbox class="global-warning-safemode" flex="1" align="center"
- tooltiptext="&warning.safemode.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.safemode.label;"/>
- </hbox>
- <hbox class="global-warning-checkcompatibility" flex="1" align="center"
- tooltiptext="&warning.checkcompatibility.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.checkcompatibility.label;"/>
- </hbox>
- <button class="button-link global-warning-checkcompatibility"
- label="&warning.checkcompatibility.enable.label;"
- tooltiptext="&warning.checkcompatibility.enable.tooltip;"
- command="cmd_enableCheckCompatibility"/>
- <hbox class="global-warning-updatesecurity" flex="1" align="center"
- tooltiptext="&warning.updatesecurity.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.updatesecurity.label;"/>
- </hbox>
- <button class="button-link global-warning-updatesecurity"
- label="&warning.updatesecurity.enable.label;"
- tooltiptext="&warning.updatesecurity.enable.tooltip;"
- command="cmd_enableUpdateSecurity"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- </hbox>
- <hbox class="view-header global-info-container experiment-info-container">
- <hbox class="global-info" flex="1" align="center">
- <label value="&experiment.info.label;"/>
- <button id="experiments-learn-more"
- label="&experiment.info.learnmore;"
- tooltiptext="&experiment.info.learnmore;"
- accesskey="&experiment.info.learnmore.accesskey;"
- command="cmd_experimentsLearnMore"/>
- <button id="experiments-change-telemetry"
- label="&experiment.info.changetelemetry;"
- tooltiptext="&experiment.info.changetelemetry;"
- accesskey="&experiment.info.changetelemetry.accesskey;"
- command="cmd_experimentsOpenTelemetryPreferences"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap. -->
- </hbox>
- </hbox>
- <vbox id="addon-list-empty" class="alert-container"
- flex="1" hidden="true">
- <spacer class="alert-spacer-before"/>
- <vbox class="alert">
- <label value="&listEmpty.installed.label;"/>
- <button class="discover-button"
- id="discover-button-install"
- label="&listEmpty.button.label;"
- command="cmd_goToDiscoverPane"/>
- </vbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <richlistbox id="addon-list" class="list" flex="1"/>
- </vbox>
- <!-- updates view -->
- <vbox id="updates-view" flex="1" class="view-pane" tabindex="0">
- <hbox class="view-header global-warning-container" align="center">
- <!-- global warnings -->
- <hbox class="global-warning" flex="1">
- <hbox class="global-warning-safemode" flex="1" align="center"
- tooltiptext="&warning.safemode.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.safemode.label;"/>
- </hbox>
- <hbox class="global-warning-checkcompatibility" flex="1" align="center"
- tooltiptext="&warning.checkcompatibility.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.checkcompatibility.label;"/>
- </hbox>
- <button class="button-link global-warning-checkcompatibility"
- label="&warning.checkcompatibility.enable.label;"
- tooltiptext="&warning.checkcompatibility.enable.tooltip;"
- command="cmd_enableCheckCompatibility"/>
- <hbox class="global-warning-updatesecurity" flex="1" align="center"
- tooltiptext="&warning.updatesecurity.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.updatesecurity.label;"/>
- </hbox>
- <button class="button-link global-warning-updatesecurity"
- label="&warning.updatesecurity.enable.label;"
- tooltiptext="&warning.updatesecurity.enable.tooltip;"
- command="cmd_enableUpdateSecurity"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- <spacer flex="1"/>
- <hbox id="updates-sorters" class="sort-controls" sortby="updateDate"
- ascending="false"/>
- </hbox>
- <vbox id="updates-list-empty" class="alert-container"
- flex="1" hidden="true">
- <spacer class="alert-spacer-before"/>
- <vbox class="alert">
- <label id="empty-availableUpdates-msg" value="&listEmpty.availableUpdates.label;"/>
- <label id="empty-recentUpdates-msg" value="&listEmpty.recentUpdates.label;"/>
- <button label="&listEmpty.findUpdates.label;"
- command="cmd_findAllUpdates"/>
- </vbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <hbox id="update-actions" pack="center">
- <button id="update-selected-btn" hidden="true"
- label="&updates.updateSelected.label;"
- tooltiptext="&updates.updateSelected.tooltip;"/>
- </hbox>
- <richlistbox id="updates-list" class="list" flex="1"/>
- </vbox>
-
- <!-- detail view -->
- <scrollbox id="detail-view" flex="1" class="view-pane addon-view" orient="vertical" tabindex="0"
- role="document">
- <!-- global warnings -->
- <hbox class="global-warning-container global-warning">
- <hbox class="global-warning-safemode" flex="1" align="center"
- tooltiptext="&warning.safemode.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.safemode.label;"/>
- </hbox>
- <hbox class="global-warning-checkcompatibility" flex="1" align="center"
- tooltiptext="&warning.checkcompatibility.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.checkcompatibility.label;"/>
- </hbox>
- <button class="button-link global-warning-checkcompatibility"
- label="&warning.checkcompatibility.enable.label;"
- tooltiptext="&warning.checkcompatibility.enable.tooltip;"
- command="cmd_enableCheckCompatibility"/>
- <hbox class="global-warning-updatesecurity" flex="1" align="center"
- tooltiptext="&warning.updatesecurity.label;">
- <image class="warning-icon"/>
- <label class="global-warning-text" flex="1" crop="end"
- value="&warning.updatesecurity.label;"/>
- </hbox>
- <button class="button-link global-warning-updatesecurity"
- label="&warning.updatesecurity.enable.label;"
- tooltiptext="&warning.updatesecurity.enable.tooltip;"
- command="cmd_enableUpdateSecurity"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- <hbox flex="1">
- <spacer flex="1"/>
- <!-- "loading" splash screen -->
- <vbox class="alert-container">
- <spacer class="alert-spacer-before"/>
- <hbox class="alert loading">
- <image/>
- <label value="&loading.label;"/>
- </hbox>
- <spacer class="alert-spacer-after"/>
- </vbox>
- <!-- actual detail view -->
- <vbox class="detail-view-container" flex="3" contextmenu="addonitem-popup">
- <vbox id="detail-notifications">
- <hbox id="warning-container" align="center" class="warning">
- <image class="warning-icon"/>
- <label id="detail-warning" flex="1"/>
- <label id="detail-warning-link" class="text-link"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- <hbox id="error-container" align="center" class="error">
- <image class="error-icon"/>
- <label id="detail-error" flex="1"/>
- <label id="detail-error-link" class="text-link"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- <hbox id="pending-container" align="center" class="pending">
- <image class="pending-icon"/>
- <label id="detail-pending" flex="1"/>
- <button id="detail-restart-btn" class="button-link"
- label="&addon.restartNow.label;"
- command="cmd_restartApp"/>
- <button id="detail-undo-btn" class="button-link"
- label="&addon.undoAction.label;"
- tooltipText="&addon.undoAction.tooltip;"
- command="cmd_cancelOperation"/>
- <spacer flex="5000"/> <!-- Necessary to allow the message to wrap -->
- </hbox>
- </vbox>
- <hbox align="start">
- <vbox id="detail-icon-container" align="end">
- <image id="detail-icon" class="icon"/>
- </vbox>
- <vbox flex="1">
- <vbox id="detail-summary">
- <hbox id="detail-name-container" class="name-container"
- align="start">
- <label id="detail-name" flex="1"/>
- <label id="detail-version"/>
- <label class="disabled-postfix" value="&addon.disabled.postfix;"/>
- <label class="update-postfix" value="&addon.update.postfix;"/>
- <spacer flex="5000"/> <!-- Necessary to allow the name to wrap -->
- </hbox>
- <label id="detail-creator" class="creator"/>
- </vbox>
- <hbox id="detail-experiment-container">
- <svg width="8" height="8" viewBox="0 0 8 8" version="1.1"
- xmlns="http://www.w3.org/2000/svg"
- id="detail-experiment-bullet-container">
- <circle cx="4" cy="4" r="4" id="detail-experiment-bullet"/>
- </svg>
- <label id="detail-experiment-state"/>
- <label id="detail-experiment-time"/>
- </hbox>
- <hbox id="detail-desc-container" align="start">
- <vbox id="detail-screenshot-box" pack="center" hidden="true"> <!-- Necessary to work around bug 394738 -->
- <image id="detail-screenshot"/>
- </vbox>
- <vbox flex="1">
- <description id="detail-desc"/>
- <description id="detail-fulldesc"/>
- </vbox>
- </hbox>
- <vbox id="detail-contributions">
- <description id="detail-contrib-description">
- &detail.contributions.description;
- </description>
- <hbox align="center">
- <label id="detail-contrib-suggested"/>
- <spacer flex="1"/>
- <button id="detail-contrib-btn"
- label="&cmd.contribute.label;"
- accesskey="&cmd.contribute.accesskey;"
- tooltiptext="&cmd.contribute.tooltip;"
- command="cmd_contribute"/>
- </hbox>
- </vbox>
- <grid id="detail-grid">
- <columns>
- <column flex="1"/>
- <column flex="2"/>
- </columns>
- <rows id="detail-rows">
- <row class="detail-row-complex" id="detail-updates-row">
- <label class="detail-row-label" value="&detail.updateType;"/>
- <hbox align="center">
- <radiogroup id="detail-autoUpdate" orient="horizontal">
- <!-- The values here need to match the values of
- AddonManager.AUTOUPDATE_* -->
- <radio label="&detail.updateDefault.label;"
- tooltiptext="&detail.updateDefault.tooltip;"
- value="1"/>
- <radio label="&detail.updateAutomatic.label;"
- tooltiptext="&detail.updateAutomatic.tooltip;"
- value="2"/>
- <radio label="&detail.updateManual.label;"
- tooltiptext="&detail.updateManual.tooltip;"
- value="0"/>
- </radiogroup>
- <button id="detail-findUpdates-btn" class="button-link"
- label="&detail.checkForUpdates.label;"
- accesskey="&detail.checkForUpdates.accesskey;"
- tooltiptext="&detail.checkForUpdates.tooltip;"
- command="cmd_findItemUpdates"/>
- </hbox>
- </row>
- <row class="detail-row" id="detail-dateUpdated" label="&detail.lastupdated.label;"/>
- <row class="detail-row-complex" id="detail-homepage-row" label="&detail.home;">
- <label class="detail-row-label" value="&detail.home;"/>
- <label id="detail-homepage" class="detail-row-value text-link" crop="end"/>
- </row>
- <row class="detail-row-complex" id="detail-repository-row" label="&detail.repository;">
- <label class="detail-row-label" value="&detail.repository;"/>
- <label id="detail-repository" class="detail-row-value text-link"/>
- </row>
- <row class="detail-row" id="detail-size" label="&detail.size;"/>
- <row class="detail-row-complex" id="detail-rating-row">
- <label class="detail-row-label" value="&rating2.label;"/>
- <hbox>
- <label id="detail-rating" class="meta-value meta-rating"
- showrating="average"/>
- <label id="detail-reviews" class="text-link"/>
- </hbox>
- </row>
- <row class="detail-row" id="detail-downloads" label="&detail.numberOfDownloads.label;"/>
- </rows>
- </grid>
- <hbox id="detail-controls">
- <button id="detail-prefs-btn" class="addon-control preferences"
-#ifdef XP_WIN
- label="&detail.showPreferencesWin.label;"
- accesskey="&detail.showPreferencesWin.accesskey;"
- tooltiptext="&detail.showPreferencesWin.tooltip;"
-#else
- label="&detail.showPreferencesUnix.label;"
- accesskey="&detail.showPreferencesUnix.accesskey;"
- tooltiptext="&detail.showPreferencesUnix.tooltip;"
-#endif
- command="cmd_showItemPreferences"/>
- <spacer flex="1"/>
- <button id="detail-enable-btn" class="addon-control enable"
- label="&cmd.enableAddon.label;"
- accesskey="&cmd.enableAddon.accesskey;"
- command="cmd_enableItem"/>
- <button id="detail-disable-btn" class="addon-control disable"
- label="&cmd.disableAddon.label;"
- accesskey="&cmd.disableAddon.accesskey;"
- command="cmd_disableItem"/>
- <button id="detail-uninstall-btn" class="addon-control remove"
- label="&cmd.uninstallAddon.label;"
- accesskey="&cmd.uninstallAddon.accesskey;"
- command="cmd_uninstallItem"/>
- <button id="detail-purchase-btn" class="addon-control purchase"
- command="cmd_purchaseItem"/>
- <button id="detail-install-btn" class="addon-control install"
- label="&cmd.installAddon.label;"
- accesskey="&cmd.installAddon.accesskey;"
- command="cmd_installItem"/>
- <menulist id="detail-state-menulist"
- crop="none" sizetopopup="always"
- tooltiptext="&cmd.stateMenu.tooltip;">
- <menupopup>
- <menuitem id="detail-ask-to-activate-menuitem"
- class="addon-control"
- label="&cmd.askToActivate.label;"
- tooltiptext="&cmd.askToActivate.tooltip;"
- command="cmd_askToActivateItem"/>
- <menuitem id="detail-always-activate-menuitem"
- class="addon-control"
- label="&cmd.alwaysActivate.label;"
- tooltiptext="&cmd.alwaysActivate.tooltip;"
- command="cmd_alwaysActivateItem"/>
- <menuitem id="detail-never-activate-menuitem"
- class="addon-control"
- label="&cmd.neverActivate.label;"
- tooltiptext="&cmd.neverActivate.tooltip;"
- command="cmd_neverActivateItem"/>
- </menupopup>
- </menulist>
- </hbox>
- </vbox>
- </hbox>
- </vbox>
- <spacer flex="1"/>
- </hbox>
- </scrollbox>
- </deck>
- </vbox>
- </deck>
- </vbox>
- </hbox>
-</page>
diff --git a/toolkit/mozapps/webextensions/content/newaddon.xul b/toolkit/mozapps/webextensions/content/newaddon.xul
deleted file mode 100644
index 1d85452492..0000000000
--- a/toolkit/mozapps/webextensions/content/newaddon.xul
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mozapps/skin/extensions/newaddon.css"?>
-
-<!DOCTYPE page [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-%brandDTD;
-<!ENTITY % newaddonDTD SYSTEM "chrome://mozapps/locale/extensions/newaddon.dtd">
-%newaddonDTD;
-]>
-
-<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xhtml="http://www.w3.org/1999/xhtml" title="&title;"
- disablefastfind="true" id="addon-page" onload="initialize()"
- onunload="unload()" role="application" align="stretch" pack="stretch">
-
- <xhtml:link rel="shortcut icon" style="display: none"
- href="chrome://mozapps/skin/extensions/extensionGeneric-16.png"/>
-
- <script type="application/javascript"
- src="chrome://mozapps/content/extensions/newaddon.js"/>
-
- <scrollbox id="addon-scrollbox" align="center">
- <spacer id="spacer-start"/>
-
- <vbox id="addon-container" class="main-content">
- <description>&intro;</description>
-
- <hbox id="addon-info">
- <image id="icon"/>
- <vbox flex="1">
- <label id="name"/>
- <label id="author"/>
- <label id="location" crop="end"/>
- </vbox>
- </hbox>
-
- <hbox id="warning">
- <image id="warning-icon"/>
- <description flex="1">&warning;</description>
- </hbox>
-
- <checkbox id="allow" label="&allow;"/>
- <description id="later">&later;</description>
-
- <deck id="buttonDeck">
- <hbox id="continuePanel">
- <button id="continue-button" label="&continue;"
- oncommand="continueClicked()"/>
- </hbox>
- <vbox id="restartPanel">
- <description id="restartMessage">&restartMessage;</description>
- <hbox id="restartPanelButtons">
- <button id="restart-button" label="&restartButton;" oncommand="restartClicked()"/>
- <button id="cancel-button" label="&cancelButton;" oncommand="cancelClicked()"/>
- </hbox>
- </vbox>
- </deck>
- </vbox>
-
- <spacer id="spacer-end"/>
- </scrollbox>
-</page>
diff --git a/toolkit/mozapps/webextensions/content/setting.xml b/toolkit/mozapps/webextensions/content/setting.xml
deleted file mode 100644
index 2b70eb0d04..0000000000
--- a/toolkit/mozapps/webextensions/content/setting.xml
+++ /dev/null
@@ -1,486 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<!DOCTYPE page [
-<!ENTITY % extensionsDTD SYSTEM "chrome://mozapps/locale/extensions/extensions.dtd">
-%extensionsDTD;
-]>
-
-<!-- import-globals-from extensions.js -->
-
-<bindings xmlns="http://www.mozilla.org/xbl"
- xmlns:xbl="http://www.mozilla.org/xbl"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <binding id="setting-base">
- <implementation>
- <constructor><![CDATA[
- this.preferenceChanged();
-
- this.addEventListener("keypress", function(event) {
- event.stopPropagation();
- }, false);
-
- if (this.usePref)
- Services.prefs.addObserver(this.pref, this._observer, true);
- ]]></constructor>
-
- <field name="_observer"><![CDATA[({
- _self: this,
-
- QueryInterface: function(aIID) {
- const Ci = Components.interfaces;
- if (aIID.equals(Ci.nsIObserver) ||
- aIID.equals(Ci.nsISupportsWeakReference) ||
- aIID.equals(Ci.nsISupports))
- return this;
-
- throw Components.Exception("No interface", Components.results.NS_ERROR_NO_INTERFACE);
- },
-
- observe: function(aSubject, aTopic, aPrefName) {
- if (aTopic != "nsPref:changed")
- return;
-
- if (this._self.pref == aPrefName)
- this._self.preferenceChanged();
- }
- })]]>
- </field>
-
- <method name="fireEvent">
- <parameter name="eventName"/>
- <parameter name="funcStr"/>
- <body>
- <![CDATA[
- let body = funcStr || this.getAttribute(eventName);
- if (!body)
- return;
-
- try {
- let event = document.createEvent("Events");
- event.initEvent(eventName, true, true);
- let f = new Function("event", body);
- f.call(this, event);
- }
- catch (e) {
- Cu.reportError(e);
- }
- ]]>
- </body>
- </method>
-
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- // Should be code to set the from the preference input.value
- throw Components.Exception("No valueFromPreference implementation",
- Components.results.NS_ERROR_NOT_IMPLEMENTED);
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- // Should be code to set the input.value from the preference
- throw Components.Exception("No valueToPreference implementation",
- Components.results.NS_ERROR_NOT_IMPLEMENTED);
- ]]>
- </body>
- </method>
-
- <method name="inputChanged">
- <body>
- <![CDATA[
- if (this.usePref && !this._updatingInput) {
- this.valueToPreference();
- this.fireEvent("oninputchanged");
- }
- ]]>
- </body>
- </method>
-
- <method name="preferenceChanged">
- <body>
- <![CDATA[
- if (this.usePref) {
- this._updatingInput = true;
- try {
- this.valueFromPreference();
- this.fireEvent("onpreferencechanged");
- } catch (e) {}
- this._updatingInput = false;
- }
- ]]>
- </body>
- </method>
-
- <property name="usePref" readonly="true" onget="return this.hasAttribute('pref');"/>
- <property name="pref" readonly="true" onget="return this.getAttribute('pref');"/>
- <property name="type" readonly="true" onget="return this.getAttribute('type');"/>
- <property name="value" onget="return this.input.value;" onset="return this.input.value = val;"/>
-
- <field name="_updatingInput">false</field>
- <field name="input">document.getAnonymousElementByAttribute(this, "anonid", "input");</field>
- <field name="settings">
- this.parentNode.localName == "settings" ? this.parentNode : null;
- </field>
- </implementation>
- </binding>
-
- <binding id="setting-bool" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- <xul:label class="preferences-learnmore text-link"
- onclick="document.getBindingParent(this).openLearnMore()">&setting.learnmore;</xul:label>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:checkbox anonid="input" xbl:inherits="disabled,onlabel,offlabel,label=checkboxlabel" oncommand="inputChanged();"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- let val = Services.prefs.getBoolPref(this.pref);
- this.value = this.inverted ? !val : val;
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- let val = this.value;
- Services.prefs.setBoolPref(this.pref, this.inverted ? !val : val);
- ]]>
- </body>
- </method>
-
- <property name="value" onget="return this.input.checked;" onset="return this.input.setChecked(val);"/>
- <property name="inverted" readonly="true" onget="return this.getAttribute('inverted');"/>
-
- <method name="openLearnMore">
- <body>
- <![CDATA[
- window.open(this.getAttribute("learnmore"), "_blank");
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
-
- <binding id="setting-boolint" extends="chrome://mozapps/content/extensions/setting.xml#setting-bool">
- <implementation>
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- let val = Services.prefs.getIntPref(this.pref);
- this.value = (val == this.getAttribute("on"));
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- Services.prefs.setIntPref(this.pref, this.getAttribute(this.value ? "on" : "off"));
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
-
- <binding id="setting-localized-bool" extends="chrome://mozapps/content/extensions/setting.xml#setting-bool">
- <implementation>
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- let val = Services.prefs.getComplexValue(this.pref, Components.interfaces.nsIPrefLocalizedString).data;
- if (this.inverted) val = !val;
- this.value = (val == "true");
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- let val = this.value;
- if (this.inverted) val = !val;
- let pref = Components.classes["@mozilla.org/pref-localizedstring;1"].createInstance(Components.interfaces.nsIPrefLocalizedString);
- pref.data = this.inverted ? (!val).toString() : val.toString();
- Services.prefs.setComplexValue(this.pref, Components.interfaces.nsIPrefLocalizedString, pref);
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
-
- <binding id="setting-integer" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:textbox type="number" anonid="input" oninput="inputChanged();" onchange="inputChanged();"
- xbl:inherits="disabled,emptytext,min,max,increment,hidespinbuttons,wraparound,size"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- let val = Services.prefs.getIntPref(this.pref);
- this.value = val;
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- Services.prefs.setIntPref(this.pref, this.value);
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
-
- <binding id="setting-control" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <children/>
- </xul:hbox>
- </content>
- </binding>
-
- <binding id="setting-string" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:textbox anonid="input" flex="1" oninput="inputChanged();"
- xbl:inherits="disabled,emptytext,type=inputtype,min,max,increment,hidespinbuttons,decimalplaces,wraparound"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- this.value = Preferences.get(this.pref, "");
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- Preferences.set(this.pref, this.value);
- ]]>
- </body>
- </method>
- </implementation>
- </binding>
-
- <binding id="setting-color" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:colorpicker type="button" anonid="input" xbl:inherits="disabled" onchange="document.getBindingParent(this).inputChanged();"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- // We must wait for the colorpicker's binding to be applied before setting the value
- if (!this.input.color)
- this.input.initialize();
- this.value = Services.prefs.getCharPref(this.pref);
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- Services.prefs.setCharPref(this.pref, this.value);
- ]]>
- </body>
- </method>
-
- <property name="value" onget="return this.input.color;" onset="return this.input.color = val;"/>
- </implementation>
- </binding>
-
- <binding id="setting-path" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:button type="button" anonid="button" label="&settings.path.button.label;" xbl:inherits="disabled" oncommand="showPicker();"/>
- <xul:label anonid="input" flex="1" crop="center" xbl:inherits="disabled"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <method name="showPicker">
- <body>
- <![CDATA[
- var filePicker = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
- filePicker.init(window, this.getAttribute("title"),
- this.type == "file" ? Ci.nsIFilePicker.modeOpen : Ci.nsIFilePicker.modeGetFolder);
- if (this.value) {
- try {
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.initWithPath(this.value);
- filePicker.displayDirectory = this.type == "file" ? file.parent : file;
- if (this.type == "file") {
- filePicker.defaultString = file.leafName;
- }
- } catch (e) {}
- }
- if (filePicker.show() != Ci.nsIFilePicker.returnCancel) {
- this.value = filePicker.file.path;
- this.inputChanged();
- }
- ]]>
- </body>
- </method>
-
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- this.value = Preferences.get(this.pref, "");
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- Preferences.set(this.pref, this.value);
- ]]>
- </body>
- </method>
-
- <field name="_value"></field>
-
- <property name="value">
- <getter>
- <![CDATA[
- return this._value;
- ]]>
- </getter>
- <setter>
- <![CDATA[
- this._value = val;
- let label = "";
- if (val) {
- try {
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.initWithPath(val);
- label = this.hasAttribute("fullpath") ? file.path : file.leafName;
- } catch (e) {}
- }
- this.input.tooltipText = val;
- return this.input.value = label;
- ]]>
- </setter>
- </property>
- </implementation>
- </binding>
-
- <binding id="setting-multi" extends="chrome://mozapps/content/extensions/setting.xml#setting-base">
- <content>
- <xul:vbox>
- <xul:hbox class="preferences-alignment">
- <xul:label class="preferences-title" flex="1" xbl:inherits="xbl:text=title"/>
- </xul:hbox>
- <xul:description class="preferences-description" flex="1" xbl:inherits="xbl:text=desc"/>
- </xul:vbox>
- <xul:hbox class="preferences-alignment">
- <children includes="radiogroup|menulist"/>
- </xul:hbox>
- </content>
-
- <implementation>
- <constructor>
- <![CDATA[
- this.control.addEventListener("command", this.inputChanged.bind(this), false);
- ]]>
- </constructor>
-
- <method name="valueFromPreference">
- <body>
- <![CDATA[
- let val = Preferences.get(this.pref, "").toString();
-
- if ("itemCount" in this.control) {
- for (let i = 0; i < this.control.itemCount; i++) {
- if (this.control.getItemAtIndex(i).value == val) {
- this.control.selectedIndex = i;
- break;
- }
- }
- } else {
- this.control.setAttribute("value", val);
- }
- ]]>
- </body>
- </method>
-
- <method name="valueToPreference">
- <body>
- <![CDATA[
- // We might not have a pref already set, so we guess the type from the value attribute
- let val = this.control.selectedItem.value;
- if (val == "true" || val == "false") {
- val = val == "true";
- } else if (/^-?\d+$/.test(val)) {
- val = parseInt(val, 10);
- }
- Preferences.set(this.pref, val);
- ]]>
- </body>
- </method>
-
- <field name="control">this.getElementsByTagName(this.getAttribute("type") == "radio" ? "radiogroup" : "menulist")[0];</field>
- </implementation>
- </binding>
-</bindings>
diff --git a/toolkit/mozapps/webextensions/content/update.js b/toolkit/mozapps/webextensions/content/update.js
deleted file mode 100644
index 80d0fa6885..0000000000
--- a/toolkit/mozapps/webextensions/content/update.js
+++ /dev/null
@@ -1,663 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This UI is only opened from the Extension Manager when the app is upgraded.
-
-"use strict";
-
-const PREF_UPDATE_EXTENSIONS_ENABLED = "extensions.update.enabled";
-const PREF_XPINSTALL_ENABLED = "xpinstall.enabled";
-
-// timeout (in milliseconds) to wait for response to the metadata ping
-const METADATA_TIMEOUT = 30000;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManagerPrivate", "resource://gre/modules/AddonManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", "resource://gre/modules/addons/AddonRepository.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Log", "resource://gre/modules/Log.jsm");
-var logger = null;
-
-var gUpdateWizard = {
- // When synchronizing app compatibility info this contains all installed
- // add-ons. When checking for compatible versions this contains only
- // incompatible add-ons.
- addons: [],
- // Contains a Set of IDs for add-on that were disabled by the application update.
- affectedAddonIDs: null,
- // The add-ons that we found updates available for
- addonsToUpdate: [],
- shouldSuggestAutoChecking: false,
- shouldAutoCheck: false,
- xpinstallEnabled: true,
- xpinstallLocked: false,
- // cached AddonInstall entries for add-ons we might want to update,
- // keyed by add-on ID
- addonInstalls: new Map(),
- shuttingDown: false,
- // Count the add-ons disabled by this update, enabled/disabled by
- // metadata checks, and upgraded.
- disabled: 0,
- metadataEnabled: 0,
- metadataDisabled: 0,
- upgraded: 0,
- upgradeFailed: 0,
- upgradeDeclined: 0,
-
- init: function()
- {
- logger = Log.repository.getLogger("addons.update-dialog");
- // XXX could we pass the addons themselves rather than the IDs?
- this.affectedAddonIDs = new Set(window.arguments[0]);
-
- try {
- this.shouldSuggestAutoChecking =
- !Services.prefs.getBoolPref(PREF_UPDATE_EXTENSIONS_ENABLED);
- }
- catch (e) {
- }
-
- try {
- this.xpinstallEnabled = Services.prefs.getBoolPref(PREF_XPINSTALL_ENABLED);
- this.xpinstallLocked = Services.prefs.prefIsLocked(PREF_XPINSTALL_ENABLED);
- }
- catch (e) {
- }
-
- if (Services.io.offline)
- document.documentElement.currentPage = document.getElementById("offline");
- else
- document.documentElement.currentPage = document.getElementById("versioninfo");
- },
-
- onWizardFinish: function gUpdateWizard_onWizardFinish ()
- {
- if (this.shouldSuggestAutoChecking)
- Services.prefs.setBoolPref(PREF_UPDATE_EXTENSIONS_ENABLED, this.shouldAutoCheck);
- },
-
- _setUpButton: function(aButtonID, aButtonKey, aDisabled)
- {
- var strings = document.getElementById("updateStrings");
- var button = document.documentElement.getButton(aButtonID);
- if (aButtonKey) {
- button.label = strings.getString(aButtonKey);
- try {
- button.setAttribute("accesskey", strings.getString(aButtonKey + "Accesskey"));
- }
- catch (e) {
- }
- }
- button.disabled = aDisabled;
- },
-
- setButtonLabels: function(aBackButton, aBackButtonIsDisabled,
- aNextButton, aNextButtonIsDisabled,
- aCancelButton, aCancelButtonIsDisabled)
- {
- this._setUpButton("back", aBackButton, aBackButtonIsDisabled);
- this._setUpButton("next", aNextButton, aNextButtonIsDisabled);
- this._setUpButton("cancel", aCancelButton, aCancelButtonIsDisabled);
- },
-
- // Update Errors
- errorItems: [],
-
- checkForErrors: function(aElementIDToShow)
- {
- if (this.errorItems.length > 0)
- document.getElementById(aElementIDToShow).hidden = false;
- },
-
- onWizardClose: function(aEvent)
- {
- return this.onWizardCancel();
- },
-
- onWizardCancel: function()
- {
- gUpdateWizard.shuttingDown = true;
- // Allow add-ons to continue downloading and installing
- // in the background, though some may require a later restart
- // Pages that are waiting for user input go into the background
- // on cancel
- if (gMismatchPage.waiting) {
- logger.info("Dialog closed in mismatch page");
- if (gUpdateWizard.addonInstalls.size > 0) {
- gInstallingPage.startInstalls(
- Array.from(gUpdateWizard.addonInstalls.values()));
- }
- return true;
- }
-
- // Pages that do asynchronous things will just keep running and check
- // gUpdateWizard.shuttingDown to trigger background behaviour
- if (!gInstallingPage.installing) {
- logger.info("Dialog closed while waiting for updated compatibility information");
- }
- else {
- logger.info("Dialog closed while downloading and installing updates");
- }
- return true;
- }
-};
-
-var gOfflinePage = {
- onPageAdvanced: function()
- {
- Services.io.offline = false;
- return true;
- },
-
- toggleOffline: function()
- {
- var nextbtn = document.documentElement.getButton("next");
- nextbtn.disabled = !nextbtn.disabled;
- }
-}
-
-// Addon listener to count addons enabled/disabled by metadata checks
-var listener = {
- onDisabled: function(aAddon) {
- gUpdateWizard.affectedAddonIDs.add(aAddon.id);
- gUpdateWizard.metadataDisabled++;
- },
- onEnabled: function(aAddon) {
- gUpdateWizard.affectedAddonIDs.delete(aAddon.id);
- gUpdateWizard.metadataEnabled++;
- }
-};
-
-var gVersionInfoPage = {
- _completeCount: 0,
- _totalCount: 0,
- _versionInfoDone: false,
- onPageShow: Task.async(function*() {
- gUpdateWizard.setButtonLabels(null, true,
- "nextButtonText", true,
- "cancelButtonText", false);
-
- gUpdateWizard.disabled = gUpdateWizard.affectedAddonIDs.size;
-
- // Ensure compatibility overrides are up to date before checking for
- // individual addon updates.
- AddonManager.addAddonListener(listener);
- if (AddonRepository.isMetadataStale()) {
- // Do the metadata ping, listening for any newly enabled/disabled add-ons.
- yield AddonRepository.repopulateCache(METADATA_TIMEOUT);
- if (gUpdateWizard.shuttingDown) {
- logger.debug("repopulateCache completed after dialog closed");
- }
- }
- // Fetch the add-ons that are still affected by this update,
- // excluding the hotfix add-on.
- let idlist = Array.from(gUpdateWizard.affectedAddonIDs).filter(
- a => a.id != AddonManager.hotfixID);
- if (idlist.length < 1) {
- gVersionInfoPage.onAllUpdatesFinished();
- return;
- }
-
- logger.debug("Fetching affected addons " + idlist.toSource());
- let fetchedAddons = yield new Promise((resolve, reject) =>
- AddonManager.getAddonsByIDs(idlist, resolve));
- // We shouldn't get nulls here, but let's be paranoid...
- gUpdateWizard.addons = fetchedAddons.filter(a => a);
- if (gUpdateWizard.addons.length < 1) {
- gVersionInfoPage.onAllUpdatesFinished();
- return;
- }
-
- gVersionInfoPage._totalCount = gUpdateWizard.addons.length;
-
- for (let addon of gUpdateWizard.addons) {
- logger.debug("VersionInfo Finding updates for ${id}", addon);
- addon.findUpdates(gVersionInfoPage, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
- }
- }),
-
- onAllUpdatesFinished: function() {
- AddonManager.removeAddonListener(listener);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_disabled",
- gUpdateWizard.disabled);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_metadata_enabled",
- gUpdateWizard.metadataEnabled);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_metadata_disabled",
- gUpdateWizard.metadataDisabled);
- // Record 0 for these here in case we exit early; values will be replaced
- // later if we actually upgrade any.
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgraded", 0);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgradeFailed", 0);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgradeDeclined", 0);
- // Filter out any add-ons that are now enabled.
- let addonList = gUpdateWizard.addons.map(a => a.id + ":" + a.appDisabled);
- logger.debug("VersionInfo updates finished: found " + addonList.toSource());
- let filteredAddons = [];
- for (let a of gUpdateWizard.addons) {
- if (a.appDisabled) {
- logger.debug("Continuing with add-on " + a.id);
- filteredAddons.push(a);
- }
- else if (gUpdateWizard.addonInstalls.has(a.id)) {
- gUpdateWizard.addonInstalls.get(a.id).cancel();
- gUpdateWizard.addonInstalls.delete(a.id);
- }
- }
- gUpdateWizard.addons = filteredAddons;
-
- if (gUpdateWizard.shuttingDown) {
- // jump directly to updating auto-update add-ons in the background
- if (gUpdateWizard.addonInstalls.size > 0) {
- let installs = Array.from(gUpdateWizard.addonInstalls.values());
- gInstallingPage.startInstalls(installs);
- }
- return;
- }
-
- if (filteredAddons.length > 0) {
- if (!gUpdateWizard.xpinstallEnabled && gUpdateWizard.xpinstallLocked) {
- document.documentElement.currentPage = document.getElementById("adminDisabled");
- return;
- }
- document.documentElement.currentPage = document.getElementById("mismatch");
- }
- else {
- logger.info("VersionInfo: No updates require further action");
- // VersionInfo compatibility updates resolved all compatibility problems,
- // close this window and continue starting the application...
- // XXX Bug 314754 - We need to use setTimeout to close the window due to
- // the EM using xmlHttpRequest when checking for updates.
- setTimeout(close, 0);
- }
- },
-
- // UpdateListener
- onUpdateFinished: function(aAddon, status) {
- ++this._completeCount;
-
- if (status != AddonManager.UPDATE_STATUS_NO_ERROR) {
- logger.debug("VersionInfo update " + this._completeCount + " of " + this._totalCount +
- " failed for " + aAddon.id + ": " + status);
- gUpdateWizard.errorItems.push(aAddon);
- }
- else {
- logger.debug("VersionInfo update " + this._completeCount + " of " + this._totalCount +
- " finished for " + aAddon.id);
- }
-
- // If we're not in the background, just make a list of add-ons that have
- // updates available
- if (!gUpdateWizard.shuttingDown) {
- // If we're still in the update check window and the add-on is now active
- // then it won't have been disabled by startup
- if (aAddon.active) {
- AddonManagerPrivate.removeStartupChange(AddonManager.STARTUP_CHANGE_DISABLED, aAddon.id);
- gUpdateWizard.metadataEnabled++;
- }
-
- // Update the status text and progress bar
- var updateStrings = document.getElementById("updateStrings");
- var statusElt = document.getElementById("versioninfo.status");
- var statusString = updateStrings.getFormattedString("statusPrefix", [aAddon.name]);
- statusElt.setAttribute("value", statusString);
-
- // Update the status text and progress bar
- var progress = document.getElementById("versioninfo.progress");
- progress.mode = "normal";
- progress.value = Math.ceil((this._completeCount / this._totalCount) * 100);
- }
-
- if (this._completeCount == this._totalCount)
- this.onAllUpdatesFinished();
- },
-
- onUpdateAvailable: function(aAddon, aInstall) {
- logger.debug("VersionInfo got an install for " + aAddon.id + ": " + aAddon.version);
- gUpdateWizard.addonInstalls.set(aAddon.id, aInstall);
- },
-};
-
-var gMismatchPage = {
- waiting: false,
-
- onPageShow: function()
- {
- gMismatchPage.waiting = true;
- gUpdateWizard.setButtonLabels(null, true,
- "mismatchCheckNow", false,
- "mismatchDontCheck", false);
- document.documentElement.getButton("next").focus();
-
- var incompatible = document.getElementById("mismatch.incompatible");
- for (let addon of gUpdateWizard.addons) {
- var listitem = document.createElement("listitem");
- listitem.setAttribute("label", addon.name + " " + addon.version);
- incompatible.appendChild(listitem);
- }
- }
-};
-
-var gUpdatePage = {
- _totalCount: 0,
- _completeCount: 0,
- onPageShow: function()
- {
- gMismatchPage.waiting = false;
- gUpdateWizard.setButtonLabels(null, true,
- "nextButtonText", true,
- "cancelButtonText", false);
- document.documentElement.getButton("next").focus();
-
- gUpdateWizard.errorItems = [];
-
- this._totalCount = gUpdateWizard.addons.length;
- for (let addon of gUpdateWizard.addons) {
- logger.debug("UpdatePage requesting update for " + addon.id);
- // Redundant call to find updates again here when we already got them
- // in the VersionInfo page: https://bugzilla.mozilla.org/show_bug.cgi?id=960597
- addon.findUpdates(this, AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
- }
- },
-
- onAllUpdatesFinished: function() {
- if (gUpdateWizard.shuttingDown)
- return;
-
- var nextPage = document.getElementById("noupdates");
- if (gUpdateWizard.addonsToUpdate.length > 0)
- nextPage = document.getElementById("found");
- document.documentElement.currentPage = nextPage;
- },
-
- // UpdateListener
- onUpdateAvailable: function(aAddon, aInstall) {
- logger.debug("UpdatePage got an update for " + aAddon.id + ": " + aAddon.version);
- gUpdateWizard.addonsToUpdate.push(aInstall);
- },
-
- onUpdateFinished: function(aAddon, status) {
- if (status != AddonManager.UPDATE_STATUS_NO_ERROR)
- gUpdateWizard.errorItems.push(aAddon);
-
- ++this._completeCount;
-
- if (!gUpdateWizard.shuttingDown) {
- // Update the status text and progress bar
- var updateStrings = document.getElementById("updateStrings");
- var statusElt = document.getElementById("checking.status");
- var statusString = updateStrings.getFormattedString("statusPrefix", [aAddon.name]);
- statusElt.setAttribute("value", statusString);
-
- var progress = document.getElementById("checking.progress");
- progress.value = Math.ceil((this._completeCount / this._totalCount) * 100);
- }
-
- if (this._completeCount == this._totalCount)
- this.onAllUpdatesFinished()
- },
-};
-
-var gFoundPage = {
- onPageShow: function()
- {
- gUpdateWizard.setButtonLabels(null, true,
- "installButtonText", false,
- null, false);
-
- var foundUpdates = document.getElementById("found.updates");
- var itemCount = gUpdateWizard.addonsToUpdate.length;
- for (let install of gUpdateWizard.addonsToUpdate) {
- let listItem = foundUpdates.appendItem(install.name + " " + install.version);
- listItem.setAttribute("type", "checkbox");
- listItem.setAttribute("checked", "true");
- listItem.install = install;
- }
-
- if (!gUpdateWizard.xpinstallEnabled) {
- document.getElementById("xpinstallDisabledAlert").hidden = false;
- document.getElementById("enableXPInstall").focus();
- document.documentElement.getButton("next").disabled = true;
- }
- else {
- document.documentElement.getButton("next").focus();
- document.documentElement.getButton("next").disabled = false;
- }
- },
-
- toggleXPInstallEnable: function(aEvent)
- {
- var enabled = aEvent.target.checked;
- gUpdateWizard.xpinstallEnabled = enabled;
- var pref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- pref.setBoolPref(PREF_XPINSTALL_ENABLED, enabled);
- this.updateNextButton();
- },
-
- updateNextButton: function()
- {
- if (!gUpdateWizard.xpinstallEnabled) {
- document.documentElement.getButton("next").disabled = true;
- return;
- }
-
- var oneChecked = false;
- var foundUpdates = document.getElementById("found.updates");
- var updates = foundUpdates.getElementsByTagName("listitem");
- for (let update of updates) {
- if (!update.checked)
- continue;
- oneChecked = true;
- break;
- }
-
- gUpdateWizard.setButtonLabels(null, true,
- "installButtonText", true,
- null, false);
- document.getElementById("found").setAttribute("next", "installing");
- document.documentElement.getButton("next").disabled = !oneChecked;
- }
-};
-
-var gInstallingPage = {
- _installs : [],
- _errors : [],
- _strings : null,
- _currentInstall : -1,
- _installing : false,
-
- // Initialize fields we need for installing and tracking progress,
- // and start iterating through the installations
- startInstalls: function(aInstallList) {
- if (!gUpdateWizard.xpinstallEnabled) {
- return;
- }
-
- let installs = Array.from(aInstallList).map(a => a.existingAddon.id);
- logger.debug("Start installs for " + installs.toSource());
- this._errors = [];
- this._installs = aInstallList;
- this._installing = true;
- this.startNextInstall();
- },
-
- onPageShow: function()
- {
- gUpdateWizard.setButtonLabels(null, true,
- "nextButtonText", true,
- null, true);
-
- var foundUpdates = document.getElementById("found.updates");
- var updates = foundUpdates.getElementsByTagName("listitem");
- let toInstall = [];
- for (let update of updates) {
- if (!update.checked) {
- logger.info("User chose to cancel update of " + update.label);
- gUpdateWizard.upgradeDeclined++;
- update.install.cancel();
- continue;
- }
- toInstall.push(update.install);
- }
- this._strings = document.getElementById("updateStrings");
-
- this.startInstalls(toInstall);
- },
-
- startNextInstall: function() {
- if (this._currentInstall >= 0) {
- this._installs[this._currentInstall].removeListener(this);
- }
-
- this._currentInstall++;
-
- if (this._installs.length == this._currentInstall) {
- Services.obs.notifyObservers(null, "TEST:all-updates-done", null);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgraded",
- gUpdateWizard.upgraded);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgradeFailed",
- gUpdateWizard.upgradeFailed);
- AddonManagerPrivate.recordSimpleMeasure("appUpdate_upgradeDeclined",
- gUpdateWizard.upgradeDeclined);
- this._installing = false;
- if (gUpdateWizard.shuttingDown) {
- return;
- }
- var nextPage = this._errors.length > 0 ? "installerrors" : "finished";
- document.getElementById("installing").setAttribute("next", nextPage);
- document.documentElement.advance();
- return;
- }
-
- let install = this._installs[this._currentInstall];
-
- if (gUpdateWizard.shuttingDown && !AddonManager.shouldAutoUpdate(install.existingAddon)) {
- logger.debug("Don't update " + install.existingAddon.id + " in background");
- gUpdateWizard.upgradeDeclined++;
- install.cancel();
- this.startNextInstall();
- return;
- }
- install.addListener(this);
- install.install();
- },
-
- // InstallListener
- onDownloadStarted: function(aInstall) {
- if (gUpdateWizard.shuttingDown) {
- return;
- }
- var strings = document.getElementById("updateStrings");
- var label = strings.getFormattedString("downloadingPrefix", [aInstall.name]);
- var actionItem = document.getElementById("actionItem");
- actionItem.value = label;
- },
-
- onDownloadProgress: function(aInstall) {
- if (gUpdateWizard.shuttingDown) {
- return;
- }
- var downloadProgress = document.getElementById("downloadProgress");
- downloadProgress.value = Math.ceil(100 * aInstall.progress / aInstall.maxProgress);
- },
-
- onDownloadEnded: function(aInstall) {
- },
-
- onDownloadFailed: function(aInstall) {
- this._errors.push(aInstall);
-
- gUpdateWizard.upgradeFailed++;
- this.startNextInstall();
- },
-
- onInstallStarted: function(aInstall) {
- if (gUpdateWizard.shuttingDown) {
- return;
- }
- var strings = document.getElementById("updateStrings");
- var label = strings.getFormattedString("installingPrefix", [aInstall.name]);
- var actionItem = document.getElementById("actionItem");
- actionItem.value = label;
- },
-
- onInstallEnded: function(aInstall, aAddon) {
- if (!gUpdateWizard.shuttingDown) {
- // Remember that this add-on was updated during startup
- AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED,
- aAddon.id);
- }
-
- gUpdateWizard.upgraded++;
- this.startNextInstall();
- },
-
- onInstallFailed: function(aInstall) {
- this._errors.push(aInstall);
-
- gUpdateWizard.upgradeFailed++;
- this.startNextInstall();
- }
-};
-
-var gInstallErrorsPage = {
- onPageShow: function()
- {
- gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
- document.documentElement.getButton("finish").focus();
- },
-};
-
-// Displayed when there are incompatible add-ons and the xpinstall.enabled
-// pref is false and locked.
-var gAdminDisabledPage = {
- onPageShow: function()
- {
- gUpdateWizard.setButtonLabels(null, true, null, true,
- "cancelButtonText", true);
- document.documentElement.getButton("finish").focus();
- }
-};
-
-// Displayed when selected add-on updates have been installed without error.
-// There can still be add-ons that are not compatible and don't have an update.
-var gFinishedPage = {
- onPageShow: function()
- {
- gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
- document.documentElement.getButton("finish").focus();
-
- if (gUpdateWizard.shouldSuggestAutoChecking) {
- document.getElementById("finishedCheckDisabled").hidden = false;
- gUpdateWizard.shouldAutoCheck = true;
- }
- else
- document.getElementById("finishedCheckEnabled").hidden = false;
-
- document.documentElement.getButton("finish").focus();
- }
-};
-
-// Displayed when there are incompatible add-ons and there are no available
-// updates.
-var gNoUpdatesPage = {
- onPageShow: function(aEvent)
- {
- gUpdateWizard.setButtonLabels(null, true, null, true, null, true);
- if (gUpdateWizard.shouldSuggestAutoChecking) {
- document.getElementById("noupdatesCheckDisabled").hidden = false;
- gUpdateWizard.shouldAutoCheck = true;
- }
- else
- document.getElementById("noupdatesCheckEnabled").hidden = false;
-
- gUpdateWizard.checkForErrors("updateCheckErrorNotFound");
- document.documentElement.getButton("finish").focus();
- }
-};
diff --git a/toolkit/mozapps/webextensions/content/update.xul b/toolkit/mozapps/webextensions/content/update.xul
deleted file mode 100644
index 7459838145..0000000000
--- a/toolkit/mozapps/webextensions/content/update.xul
+++ /dev/null
@@ -1,194 +0,0 @@
-<?xml version="1.0"?>
-
-# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mozapps/skin/extensions/update.css" type="text/css"?>
-
-<!DOCTYPE wizard [
-<!ENTITY % updateDTD SYSTEM "chrome://mozapps/locale/extensions/update.dtd">
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-%updateDTD;
-%brandDTD;
-]>
-
-<wizard id="updateWizard"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="&updateWizard.title;"
- windowtype="Addons:Compatibility"
- branded="true"
- onload="gUpdateWizard.init();"
- onwizardfinish="gUpdateWizard.onWizardFinish();"
- onwizardcancel="return gUpdateWizard.onWizardCancel();"
- onclose="return gUpdateWizard.onWizardClose(event);"
- buttons="accept,cancel">
-
- <script type="application/javascript" src="chrome://mozapps/content/extensions/update.js"/>
-
- <stringbundleset id="updateSet">
- <stringbundle id="brandStrings" src="chrome://branding/locale/brand.properties"/>
- <stringbundle id="updateStrings" src="chrome://mozapps/locale/extensions/update.properties"/>
- </stringbundleset>
-
- <wizardpage id="dummy" pageid="dummy"/>
-
- <wizardpage id="offline" pageid="offline" next="versioninfo"
- label="&offline.title;"
- onpageadvanced="return gOfflinePage.onPageAdvanced();">
- <description>&offline.description;</description>
- <checkbox id="toggleOffline"
- checked="true"
- label="&offline.toggleOffline.label;"
- accesskey="&offline.toggleOffline.accesskey;"
- oncommand="gOfflinePage.toggleOffline();"/>
- </wizardpage>
-
- <wizardpage id="versioninfo" pageid="versioninfo" next="mismatch"
- label="&versioninfo.wizard.title;"
- onpageshow="gVersionInfoPage.onPageShow();">
- <label>&versioninfo.top.label;</label>
- <separator class="thin"/>
- <progressmeter id="versioninfo.progress" mode="undetermined"/>
- <hbox align="center">
- <image id="versioninfo.throbber" class="throbber"/>
- <label flex="1" id="versioninfo.status" crop="right">&versioninfo.waiting;</label>
- </hbox>
- <separator/>
- </wizardpage>
-
- <wizardpage id="mismatch" pageid="mismatch" next="checking"
- label="&mismatch.win.title;"
- onpageshow="gMismatchPage.onPageShow();">
- <label>&mismatch.top.label;</label>
- <separator class="thin"/>
- <listbox id="mismatch.incompatible" flex="1"/>
- <separator class="thin"/>
- <label>&mismatch.bottom.label;</label>
- </wizardpage>
-
- <wizardpage id="checking" pageid="checking" next="noupdates"
- label="&checking.wizard.title;"
- onpageshow="gUpdatePage.onPageShow();">
- <label>&checking.top.label;</label>
- <separator class="thin"/>
- <progressmeter id="checking.progress"/>
- <hbox align="center">
- <image id="checking.throbber" class="throbber"/>
- <label id="checking.status" flex="1" crop="right">&checking.status;</label>
- </hbox>
- </wizardpage>
-
- <wizardpage id="noupdates" pageid="noupdates"
- label="&noupdates.wizard.title;"
- onpageshow="gNoUpdatesPage.onPageShow();">
- <description>&noupdates.intro.desc;</description>
- <separator class="thin"/>
- <hbox id="updateCheckErrorNotFound" class="alertBox" hidden="true" align="top">
- <description flex="1">&noupdates.error.desc;</description>
- </hbox>
- <separator class="thin"/>
- <description id="noupdatesCheckEnabled" hidden="true">
- &noupdates.checkEnabled.desc;
- </description>
- <vbox id="noupdatesCheckDisabled" hidden="true">
- <description>&finished.checkDisabled.desc;</description>
- <checkbox label="&enableChecking.label;" checked="true"
- oncommand="gUpdateWizard.shouldAutoCheck = this.checked;"/>
- </vbox>
- <separator flex="1"/>
-#ifndef XP_MACOSX
- <label>&clickFinish.label;</label>
-#else
- <label>&clickFinish.labelMac;</label>
-#endif
- <separator class="thin"/>
- </wizardpage>
-
- <wizardpage id="found" pageid="found" next="installing"
- label="&found.wizard.title;"
- onpageshow="gFoundPage.onPageShow();">
- <label>&found.top.label;</label>
- <separator class="thin"/>
- <listbox id="found.updates" flex="1" seltype="multiple"
- onclick="gFoundPage.updateNextButton();"/>
- <separator class="thin"/>
- <vbox align="left" id="xpinstallDisabledAlert" hidden="true">
- <description>&found.disabledXPinstall.label;</description>
- <checkbox label="&found.enableXPInstall.label;"
- id="enableXPInstall"
- accesskey="&found.enableXPInstall.accesskey;"
- oncommand="gFoundPage.toggleXPInstallEnable(event);"/>
- </vbox>
- </wizardpage>
-
- <wizardpage id="installing" pageid="installing" next="finished"
- label="&installing.wizard.title;"
- onpageshow="gInstallingPage.onPageShow();">
- <label>&installing.top.label;</label>
- <progressmeter id="downloadProgress"/>
- <hbox align="center">
- <image id="installing.throbber" class="throbber"/>
- <label id="actionItem" flex="1" crop="right"/>
- </hbox>
- <separator/>
- </wizardpage>
-
- <wizardpage id="installerrors" pageid="installerrors"
- label="&installerrors.wizard.title;"
- onpageshow="gInstallErrorsPage.onPageShow();">
- <hbox align="top" class="alertBox">
- <description flex="1">&installerrors.intro.label;</description>
- </hbox>
- <separator flex="1"/>
-#ifndef XP_MACOSX
- <label>&clickFinish.label;</label>
-#else
- <label>&clickFinish.labelMac;</label>
-#endif
- <separator class="thin"/>
- </wizardpage>
-
- <wizardpage id="adminDisabled" pageid="adminDisabled"
- label="&adminDisabled.wizard.title;"
- onpageshow="gAdminDisabledPage.onPageShow();">
- <separator/>
- <hbox class="alertBox" align="top">
- <description flex="1">&adminDisabled.warning.label;</description>
- </hbox>
- <separator flex="1"/>
-#ifndef XP_MACOSX
- <label>&clickFinish.label;</label>
-#else
- <label>&clickFinish.labelMac;</label>
-#endif
- <separator class="thin"/>
- </wizardpage>
-
- <wizardpage id="finished" pageid="finished"
- label="&finished.wizard.title;"
- onpageshow="gFinishedPage.onPageShow();">
-
- <label>&finished.top.label;</label>
- <separator/>
- <description id="finishedCheckEnabled" hidden="true">
- &finished.checkEnabled.desc;
- </description>
- <vbox id="finishedCheckDisabled" hidden="true">
- <description>&finished.checkDisabled.desc;</description>
- <checkbox label="&enableChecking.label;" checked="true"
- oncommand="gUpdateWizard.shouldAutoCheck = this.checked;"/>
- </vbox>
- <separator flex="1"/>
-#ifndef XP_MACOSX
- <label>&clickFinish.label;</label>
-#else
- <label>&clickFinish.labelMac;</label>
-#endif
- <separator class="thin"/>
- </wizardpage>
-
-</wizard>
-
diff --git a/toolkit/mozapps/webextensions/extensions.manifest b/toolkit/mozapps/webextensions/extensions.manifest
deleted file mode 100644
index 2129012abb..0000000000
--- a/toolkit/mozapps/webextensions/extensions.manifest
+++ /dev/null
@@ -1,18 +0,0 @@
-component {4399533d-08d1-458c-a87a-235f74451cfa} addonManager.js
-contract @mozilla.org/addons/integration;1 {4399533d-08d1-458c-a87a-235f74451cfa}
-#ifndef MOZ_WIDGET_ANDROID
-category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
-#endif
-component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js
-contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922}
-component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js
-contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a}
-component {9df8ef2b-94da-45c9-ab9f-132eb55fddf1} amInstallTrigger.js
-contract @mozilla.org/addons/installtrigger;1 {9df8ef2b-94da-45c9-ab9f-132eb55fddf1}
-category JavaScript-global-property InstallTrigger @mozilla.org/addons/installtrigger;1
-#ifndef MOZ_WIDGET_ANDROID
-category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm
-#endif
-category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.jsm
-component {8866d8e3-4ea5-48b7-a891-13ba0ac15235} amWebAPI.js
-contract @mozilla.org/addon-web-api/manager;1 {8866d8e3-4ea5-48b7-a891-13ba0ac15235}
diff --git a/toolkit/mozapps/webextensions/internal/APIExtensionBootstrap.js b/toolkit/mozapps/webextensions/internal/APIExtensionBootstrap.js
deleted file mode 100644
index 0eae2475c4..0000000000
--- a/toolkit/mozapps/webextensions/internal/APIExtensionBootstrap.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/ExtensionManagement.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var namespace;
-var resource;
-var resProto;
-
-function install(data, reason) {
-}
-
-function startup(data, reason) {
- namespace = data.id.replace(/@.*/, "");
- resource = `extension-${namespace}-api`;
-
- resProto = Services.io.getProtocolHandler("resource")
- .QueryInterface(Components.interfaces.nsIResProtocolHandler);
-
- resProto.setSubstitution(resource, data.resourceURI);
-
- ExtensionManagement.registerAPI(
- namespace,
- `resource://${resource}/schema.json`,
- `resource://${resource}/api.js`);
-}
-
-function shutdown(data, reason) {
- resProto.setSubstitution(resource, null);
-
- ExtensionManagement.unregisterAPI(namespace);
-}
-
-function uninstall(data, reason) {
-}
diff --git a/toolkit/mozapps/webextensions/internal/AddonConstants.jsm b/toolkit/mozapps/webextensions/internal/AddonConstants.jsm
deleted file mode 100644
index 22d91fdf5b..0000000000
--- a/toolkit/mozapps/webextensions/internal/AddonConstants.jsm
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [ "ADDON_SIGNING", "REQUIRE_SIGNING" ];
-
-// Make these non-changable properties so they can't be manipulated from other
-// code in the app.
-Object.defineProperty(this, "ADDON_SIGNING", {
- configurable: false,
- enumerable: false,
- writable: false,
-#ifdef MOZ_ADDON_SIGNING
- value: true,
-#else
- value: false,
-#endif
-});
-
-Object.defineProperty(this, "REQUIRE_SIGNING", {
- configurable: false,
- enumerable: false,
- writable: false,
-#ifdef MOZ_REQUIRE_SIGNING
- value: true,
-#else
- value: false,
-#endif
-});
diff --git a/toolkit/mozapps/webextensions/internal/AddonRepository.jsm b/toolkit/mozapps/webextensions/internal/AddonRepository.jsm
deleted file mode 100644
index 7f88d44ad3..0000000000
--- a/toolkit/mozapps/webextensions/internal/AddonRepository.jsm
+++ /dev/null
@@ -1,1988 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/AddonManager.jsm");
-/* globals AddonManagerPrivate*/
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
- "resource://gre/modules/DeferredSave.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository_SQLiteMigrator",
- "resource://gre/modules/addons/AddonRepository_SQLiteMigrator.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ServiceRequest",
- "resource://gre/modules/ServiceRequest.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-
-this.EXPORTED_SYMBOLS = [ "AddonRepository" ];
-
-const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled";
-const PREF_GETADDONS_CACHE_TYPES = "extensions.getAddons.cache.types";
-const PREF_GETADDONS_CACHE_ID_ENABLED = "extensions.%ID%.getAddons.cache.enabled"
-const PREF_GETADDONS_BROWSEADDONS = "extensions.getAddons.browseAddons";
-const PREF_GETADDONS_BYIDS = "extensions.getAddons.get.url";
-const PREF_GETADDONS_BYIDS_PERFORMANCE = "extensions.getAddons.getWithPerformance.url";
-const PREF_GETADDONS_BROWSERECOMMENDED = "extensions.getAddons.recommended.browseURL";
-const PREF_GETADDONS_GETRECOMMENDED = "extensions.getAddons.recommended.url";
-const PREF_GETADDONS_BROWSESEARCHRESULTS = "extensions.getAddons.search.browseURL";
-const PREF_GETADDONS_GETSEARCHRESULTS = "extensions.getAddons.search.url";
-const PREF_GETADDONS_DB_SCHEMA = "extensions.getAddons.databaseSchema"
-
-const PREF_METADATA_LASTUPDATE = "extensions.getAddons.cache.lastUpdate";
-const PREF_METADATA_UPDATETHRESHOLD_SEC = "extensions.getAddons.cache.updateThreshold";
-const DEFAULT_METADATA_UPDATETHRESHOLD_SEC = 172800; // two days
-
-const XMLURI_PARSE_ERROR = "http://www.mozilla.org/newlayout/xml/parsererror.xml";
-
-const API_VERSION = "1.5";
-const DEFAULT_CACHE_TYPES = "extension,theme,locale,dictionary";
-
-const KEY_PROFILEDIR = "ProfD";
-const FILE_DATABASE = "addons.json";
-const DB_SCHEMA = 5;
-const DB_MIN_JSON_SCHEMA = 5;
-const DB_BATCH_TIMEOUT_MS = 50;
-
-const BLANK_DB = function() {
- return {
- addons: new Map(),
- schema: DB_SCHEMA
- };
-}
-
-const TOOLKIT_ID = "toolkit@mozilla.org";
-
-Cu.import("resource://gre/modules/Log.jsm");
-const LOGGER_ID = "addons.repository";
-
-// Create a new logger for use by the Addons Repository
-// (Requires AddonManager.jsm)
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-// A map between XML keys to AddonSearchResult keys for string values
-// that require no extra parsing from XML
-const STRING_KEY_MAP = {
- name: "name",
- version: "version",
- homepage: "homepageURL",
- support: "supportURL"
-};
-
-// A map between XML keys to AddonSearchResult keys for string values
-// that require parsing from HTML
-const HTML_KEY_MAP = {
- summary: "description",
- description: "fullDescription",
- developer_comments: "developerComments",
- eula: "eula"
-};
-
-// A map between XML keys to AddonSearchResult keys for integer values
-// that require no extra parsing from XML
-const INTEGER_KEY_MAP = {
- total_downloads: "totalDownloads",
- weekly_downloads: "weeklyDownloads",
- daily_users: "dailyUsers"
-};
-
-function convertHTMLToPlainText(html) {
- if (!html)
- return html;
- var converter = Cc["@mozilla.org/widget/htmlformatconverter;1"].
- createInstance(Ci.nsIFormatConverter);
-
- var input = Cc["@mozilla.org/supports-string;1"].
- createInstance(Ci.nsISupportsString);
- input.data = html.replace(/\n/g, "<br>");
-
- var output = {};
- converter.convert("text/html", input, input.data.length, "text/unicode",
- output, {});
-
- if (output.value instanceof Ci.nsISupportsString)
- return output.value.data.replace(/\r\n/g, "\n");
- return html;
-}
-
-function getAddonsToCache(aIds, aCallback) {
- try {
- var types = Services.prefs.getCharPref(PREF_GETADDONS_CACHE_TYPES);
- }
- catch (e) { }
- if (!types)
- types = DEFAULT_CACHE_TYPES;
-
- types = types.split(",");
-
- AddonManager.getAddonsByIDs(aIds, function(aAddons) {
- let enabledIds = [];
- for (var i = 0; i < aIds.length; i++) {
- var preference = PREF_GETADDONS_CACHE_ID_ENABLED.replace("%ID%", aIds[i]);
- try {
- if (!Services.prefs.getBoolPref(preference))
- continue;
- } catch (e) {
- // If the preference doesn't exist caching is enabled by default
- }
-
- // The add-ons manager may not know about this ID yet if it is a pending
- // install. In that case we'll just cache it regardless
- if (aAddons[i] && (types.indexOf(aAddons[i].type) == -1))
- continue;
-
- enabledIds.push(aIds[i]);
- }
-
- aCallback(enabledIds);
- });
-}
-
-function AddonSearchResult(aId) {
- this.id = aId;
- this.icons = {};
- this._unsupportedProperties = {};
-}
-
-AddonSearchResult.prototype = {
- /**
- * The ID of the add-on
- */
- id: null,
-
- /**
- * The add-on type (e.g. "extension" or "theme")
- */
- type: null,
-
- /**
- * The name of the add-on
- */
- name: null,
-
- /**
- * The version of the add-on
- */
- version: null,
-
- /**
- * The creator of the add-on
- */
- creator: null,
-
- /**
- * The developers of the add-on
- */
- developers: null,
-
- /**
- * A short description of the add-on
- */
- description: null,
-
- /**
- * The full description of the add-on
- */
- fullDescription: null,
-
- /**
- * The developer comments for the add-on. This includes any information
- * that may be helpful to end users that isn't necessarily applicable to
- * the add-on description (e.g. known major bugs)
- */
- developerComments: null,
-
- /**
- * The end-user licensing agreement (EULA) of the add-on
- */
- eula: null,
-
- /**
- * The url of the add-on's icon
- */
- get iconURL() {
- return this.icons && this.icons[32];
- },
-
- /**
- * The URLs of the add-on's icons, as an object with icon size as key
- */
- icons: null,
-
- /**
- * An array of screenshot urls for the add-on
- */
- screenshots: null,
-
- /**
- * The homepage for the add-on
- */
- homepageURL: null,
-
- /**
- * The homepage for the add-on
- */
- learnmoreURL: null,
-
- /**
- * The support URL for the add-on
- */
- supportURL: null,
-
- /**
- * The contribution url of the add-on
- */
- contributionURL: null,
-
- /**
- * The suggested contribution amount
- */
- contributionAmount: null,
-
- /**
- * The URL to visit in order to purchase the add-on
- */
- purchaseURL: null,
-
- /**
- * The numerical cost of the add-on in some currency, for sorting purposes
- * only
- */
- purchaseAmount: null,
-
- /**
- * The display cost of the add-on, for display purposes only
- */
- purchaseDisplayAmount: null,
-
- /**
- * The rating of the add-on, 0-5
- */
- averageRating: null,
-
- /**
- * The number of reviews for this add-on
- */
- reviewCount: null,
-
- /**
- * The URL to the list of reviews for this add-on
- */
- reviewURL: null,
-
- /**
- * The total number of times the add-on was downloaded
- */
- totalDownloads: null,
-
- /**
- * The number of times the add-on was downloaded the current week
- */
- weeklyDownloads: null,
-
- /**
- * The number of daily users for the add-on
- */
- dailyUsers: null,
-
- /**
- * AddonInstall object generated from the add-on XPI url
- */
- install: null,
-
- /**
- * nsIURI storing where this add-on was installed from
- */
- sourceURI: null,
-
- /**
- * The status of the add-on in the repository (e.g. 4 = "Public")
- */
- repositoryStatus: null,
-
- /**
- * The size of the add-on's files in bytes. For an add-on that have not yet
- * been downloaded this may be an estimated value.
- */
- size: null,
-
- /**
- * The Date that the add-on was most recently updated
- */
- updateDate: null,
-
- /**
- * True or false depending on whether the add-on is compatible with the
- * current version of the application
- */
- isCompatible: true,
-
- /**
- * True or false depending on whether the add-on is compatible with the
- * current platform
- */
- isPlatformCompatible: true,
-
- /**
- * Array of AddonCompatibilityOverride objects, that describe overrides for
- * compatibility with an application versions.
- **/
- compatibilityOverrides: null,
-
- /**
- * True if the add-on has a secure means of updating
- */
- providesUpdatesSecurely: true,
-
- /**
- * The current blocklist state of the add-on
- */
- blocklistState: Ci.nsIBlocklistService.STATE_NOT_BLOCKED,
-
- /**
- * True if this add-on cannot be used in the application based on version
- * compatibility, dependencies and blocklisting
- */
- appDisabled: false,
-
- /**
- * True if the user wants this add-on to be disabled
- */
- userDisabled: false,
-
- /**
- * Indicates what scope the add-on is installed in, per profile, user,
- * system or application
- */
- scope: AddonManager.SCOPE_PROFILE,
-
- /**
- * True if the add-on is currently functional
- */
- isActive: true,
-
- /**
- * A bitfield holding all of the current operations that are waiting to be
- * performed for this add-on
- */
- pendingOperations: AddonManager.PENDING_NONE,
-
- /**
- * A bitfield holding all the the operations that can be performed on
- * this add-on
- */
- permissions: 0,
-
- /**
- * Tests whether this add-on is known to be compatible with a
- * particular application and platform version.
- *
- * @param appVersion
- * An application version to test against
- * @param platformVersion
- * A platform version to test against
- * @return Boolean representing if the add-on is compatible
- */
- isCompatibleWith: function(aAppVersion, aPlatformVersion) {
- return true;
- },
-
- /**
- * Starts an update check for this add-on. This will perform
- * asynchronously and deliver results to the given listener.
- *
- * @param aListener
- * An UpdateListener for the update process
- * @param aReason
- * A reason code for performing the update
- * @param aAppVersion
- * An application version to check for updates for
- * @param aPlatformVersion
- * A platform version to check for updates for
- */
- findUpdates: function(aListener, aReason, aAppVersion, aPlatformVersion) {
- if ("onNoCompatibilityUpdateAvailable" in aListener)
- aListener.onNoCompatibilityUpdateAvailable(this);
- if ("onNoUpdateAvailable" in aListener)
- aListener.onNoUpdateAvailable(this);
- if ("onUpdateFinished" in aListener)
- aListener.onUpdateFinished(this);
- },
-
- toJSON: function() {
- let json = {};
-
- for (let property of Object.keys(this)) {
- let value = this[property];
- if (property.startsWith("_") ||
- typeof(value) === "function")
- continue;
-
- try {
- switch (property) {
- case "sourceURI":
- json.sourceURI = value ? value.spec : "";
- break;
-
- case "updateDate":
- json.updateDate = value ? value.getTime() : "";
- break;
-
- default:
- json[property] = value;
- }
- } catch (ex) {
- logger.warn("Error writing property value for " + property);
- }
- }
-
- for (let property of Object.keys(this._unsupportedProperties)) {
- let value = this._unsupportedProperties[property];
- if (!property.startsWith("_"))
- json[property] = value;
- }
-
- return json;
- }
-}
-
-/**
- * The add-on repository is a source of add-ons that can be installed. It can
- * be searched in three ways. The first takes a list of IDs and returns a
- * list of the corresponding add-ons. The second returns a list of add-ons that
- * come highly recommended. This list should change frequently. The third is to
- * search for specific search terms entered by the user. Searches are
- * asynchronous and results should be passed to the provided callback object
- * when complete. The results passed to the callback should only include add-ons
- * that are compatible with the current application and are not already
- * installed.
- */
-this.AddonRepository = {
- /**
- * Whether caching is currently enabled
- */
- get cacheEnabled() {
- let preference = PREF_GETADDONS_CACHE_ENABLED;
- let enabled = false;
- try {
- enabled = Services.prefs.getBoolPref(preference);
- } catch (e) {
- logger.warn("cacheEnabled: Couldn't get pref: " + preference);
- }
-
- return enabled;
- },
-
- // A cache of the add-ons stored in the database
- _addons: null,
-
- // Whether a search is currently in progress
- _searching: false,
-
- // XHR associated with the current request
- _request: null,
-
- /*
- * Addon search results callback object that contains two functions
- *
- * searchSucceeded - Called when a search has suceeded.
- *
- * @param aAddons
- * An array of the add-on results. In the case of searching for
- * specific terms the ordering of results may be determined by
- * the search provider.
- * @param aAddonCount
- * The length of aAddons
- * @param aTotalResults
- * The total results actually available in the repository
- *
- *
- * searchFailed - Called when an error occurred when performing a search.
- */
- _callback: null,
-
- // Maximum number of results to return
- _maxResults: null,
-
- /**
- * Shut down AddonRepository
- * return: promise{integer} resolves with the result of flushing
- * the AddonRepository database
- */
- shutdown: function() {
- this.cancelSearch();
-
- this._addons = null;
- return AddonDatabase.shutdown(false);
- },
-
- metadataAge: function() {
- let now = Math.round(Date.now() / 1000);
-
- let lastUpdate = 0;
- try {
- lastUpdate = Services.prefs.getIntPref(PREF_METADATA_LASTUPDATE);
- } catch (e) {}
-
- // Handle clock jumps
- if (now < lastUpdate) {
- return now;
- }
- return now - lastUpdate;
- },
-
- isMetadataStale: function() {
- let threshold = DEFAULT_METADATA_UPDATETHRESHOLD_SEC;
- try {
- threshold = Services.prefs.getIntPref(PREF_METADATA_UPDATETHRESHOLD_SEC);
- } catch (e) {}
- return (this.metadataAge() > threshold);
- },
-
- /**
- * Asynchronously get a cached add-on by id. The add-on (or null if the
- * add-on is not found) is passed to the specified callback. If caching is
- * disabled, null is passed to the specified callback.
- *
- * @param aId
- * The id of the add-on to get
- * @param aCallback
- * The callback to pass the result back to
- */
- getCachedAddonByID: Task.async(function*(aId, aCallback) {
- if (!aId || !this.cacheEnabled) {
- aCallback(null);
- return;
- }
-
- function getAddon(aAddons) {
- aCallback(aAddons.get(aId) || null);
- }
-
- if (this._addons == null) {
- AddonDatabase.retrieveStoredData().then(aAddons => {
- this._addons = aAddons;
- getAddon(aAddons);
- });
-
- return;
- }
-
- getAddon(this._addons);
- }),
-
- /**
- * Asynchronously repopulate cache so it only contains the add-ons
- * corresponding to the specified ids. If caching is disabled,
- * the cache is completely removed.
- *
- * @param aTimeout
- * (Optional) timeout in milliseconds to abandon the XHR request
- * if we have not received a response from the server.
- * @return Promise{null}
- * Resolves when the metadata ping is complete
- */
- repopulateCache: function(aTimeout) {
- return this._repopulateCacheInternal(false, aTimeout);
- },
-
- /*
- * Clear and delete the AddonRepository database
- * @return Promise{null} resolves when the database is deleted
- */
- _clearCache: function() {
- this._addons = null;
- return AddonDatabase.delete().then(() =>
- new Promise((resolve, reject) =>
- AddonManagerPrivate.updateAddonRepositoryData(resolve))
- );
- },
-
- _repopulateCacheInternal: Task.async(function*(aSendPerformance, aTimeout) {
- let allAddons = yield new Promise((resolve, reject) =>
- AddonManager.getAllAddons(resolve));
-
- // Filter the hotfix out of our list of add-ons
- allAddons = allAddons.filter(a => a.id != AddonManager.hotfixID);
-
- // Completely remove cache if caching is not enabled
- if (!this.cacheEnabled) {
- logger.debug("Clearing cache because it is disabled");
- yield this._clearCache();
- return;
- }
-
- let ids = allAddons.map(a => a.id);
- logger.debug("Repopulate add-on cache with " + ids.toSource());
-
- let addonsToCache = yield new Promise((resolve, reject) =>
- getAddonsToCache(ids, resolve));
-
- // Completely remove cache if there are no add-ons to cache
- if (addonsToCache.length == 0) {
- logger.debug("Clearing cache because 0 add-ons were requested");
- yield this._clearCache();
- return;
- }
-
- yield new Promise((resolve, reject) =>
- this._beginGetAddons(addonsToCache, {
- searchSucceeded: aAddons => {
- this._addons = new Map();
- for (let addon of aAddons) {
- this._addons.set(addon.id, addon);
- }
- AddonDatabase.repopulate(aAddons, resolve);
- },
- searchFailed: () => {
- logger.warn("Search failed when repopulating cache");
- resolve();
- }
- }, aSendPerformance, aTimeout));
-
- // Always call AddonManager updateAddonRepositoryData after we refill the cache
- yield new Promise((resolve, reject) =>
- AddonManagerPrivate.updateAddonRepositoryData(resolve));
- }),
-
- /**
- * Asynchronously add add-ons to the cache corresponding to the specified
- * ids. If caching is disabled, the cache is unchanged and the callback is
- * immediately called if it is defined.
- *
- * @param aIds
- * The array of add-on ids to add to the cache
- * @param aCallback
- * The optional callback to call once complete
- */
- cacheAddons: function(aIds, aCallback) {
- logger.debug("cacheAddons: enabled " + this.cacheEnabled + " IDs " + aIds.toSource());
- if (!this.cacheEnabled) {
- if (aCallback)
- aCallback();
- return;
- }
-
- getAddonsToCache(aIds, aAddons => {
- // If there are no add-ons to cache, act as if caching is disabled
- if (aAddons.length == 0) {
- if (aCallback)
- aCallback();
- return;
- }
-
- this.getAddonsByIDs(aAddons, {
- searchSucceeded: aAddons => {
- for (let addon of aAddons) {
- this._addons.set(addon.id, addon);
- }
- AddonDatabase.insertAddons(aAddons, aCallback);
- },
- searchFailed: () => {
- logger.warn("Search failed when adding add-ons to cache");
- if (aCallback)
- aCallback();
- }
- });
- });
- },
-
- /**
- * The homepage for visiting this repository. If the corresponding preference
- * is not defined, defaults to about:blank.
- */
- get homepageURL() {
- let url = this._formatURLPref(PREF_GETADDONS_BROWSEADDONS, {});
- return (url != null) ? url : "about:blank";
- },
-
- /**
- * Returns whether this instance is currently performing a search. New
- * searches will not be performed while this is the case.
- */
- get isSearching() {
- return this._searching;
- },
-
- /**
- * The url that can be visited to see recommended add-ons in this repository.
- * If the corresponding preference is not defined, defaults to about:blank.
- */
- getRecommendedURL: function() {
- let url = this._formatURLPref(PREF_GETADDONS_BROWSERECOMMENDED, {});
- return (url != null) ? url : "about:blank";
- },
-
- /**
- * Retrieves the url that can be visited to see search results for the given
- * terms. If the corresponding preference is not defined, defaults to
- * about:blank.
- *
- * @param aSearchTerms
- * Search terms used to search the repository
- */
- getSearchURL: function(aSearchTerms) {
- let url = this._formatURLPref(PREF_GETADDONS_BROWSESEARCHRESULTS, {
- TERMS : encodeURIComponent(aSearchTerms)
- });
- return (url != null) ? url : "about:blank";
- },
-
- /**
- * Cancels the search in progress. If there is no search in progress this
- * does nothing.
- */
- cancelSearch: function() {
- this._searching = false;
- if (this._request) {
- this._request.abort();
- this._request = null;
- }
- this._callback = null;
- },
-
- /**
- * Begins a search for add-ons in this repository by ID. Results will be
- * passed to the given callback.
- *
- * @param aIDs
- * The array of ids to search for
- * @param aCallback
- * The callback to pass results to
- */
- getAddonsByIDs: function(aIDs, aCallback) {
- return this._beginGetAddons(aIDs, aCallback, false);
- },
-
- /**
- * Begins a search of add-ons, potentially sending performance data.
- *
- * @param aIDs
- * Array of ids to search for.
- * @param aCallback
- * Function to pass results to.
- * @param aSendPerformance
- * Boolean indicating whether to send performance data with the
- * request.
- * @param aTimeout
- * (Optional) timeout in milliseconds to abandon the XHR request
- * if we have not received a response from the server.
- */
- _beginGetAddons: function(aIDs, aCallback, aSendPerformance, aTimeout) {
- let ids = aIDs.slice(0);
-
- let params = {
- API_VERSION : API_VERSION,
- IDS : ids.map(encodeURIComponent).join(',')
- };
-
- let pref = PREF_GETADDONS_BYIDS;
-
- if (aSendPerformance) {
- let type = Services.prefs.getPrefType(PREF_GETADDONS_BYIDS_PERFORMANCE);
- if (type == Services.prefs.PREF_STRING) {
- pref = PREF_GETADDONS_BYIDS_PERFORMANCE;
-
- let startupInfo = Cc["@mozilla.org/toolkit/app-startup;1"].
- getService(Ci.nsIAppStartup).
- getStartupInfo();
-
- params.TIME_MAIN = "";
- params.TIME_FIRST_PAINT = "";
- params.TIME_SESSION_RESTORED = "";
- if (startupInfo.process) {
- if (startupInfo.main) {
- params.TIME_MAIN = startupInfo.main - startupInfo.process;
- }
- if (startupInfo.firstPaint) {
- params.TIME_FIRST_PAINT = startupInfo.firstPaint -
- startupInfo.process;
- }
- if (startupInfo.sessionRestored) {
- params.TIME_SESSION_RESTORED = startupInfo.sessionRestored -
- startupInfo.process;
- }
- }
- }
- }
-
- let url = this._formatURLPref(pref, params);
-
- let handleResults = (aElements, aTotalResults, aCompatData) => {
- // Don't use this._parseAddons() so that, for example,
- // incompatible add-ons are not filtered out
- let results = [];
- for (let i = 0; i < aElements.length && results.length < this._maxResults; i++) {
- let result = this._parseAddon(aElements[i], null, aCompatData);
- if (result == null)
- continue;
-
- // Ignore add-on if it wasn't actually requested
- let idIndex = ids.indexOf(result.addon.id);
- if (idIndex == -1)
- continue;
-
- // Ignore add-on if the add-on manager doesn't know about its type:
- if (!(result.addon.type in AddonManager.addonTypes)) {
- continue;
- }
-
- results.push(result);
- // Ignore this add-on from now on
- ids.splice(idIndex, 1);
- }
-
- // Include any compatibility overrides for addons not hosted by the
- // remote repository.
- for (let id in aCompatData) {
- let addonCompat = aCompatData[id];
- if (addonCompat.hosted)
- continue;
-
- let addon = new AddonSearchResult(addonCompat.id);
- // Compatibility overrides can only be for extensions.
- addon.type = "extension";
- addon.compatibilityOverrides = addonCompat.compatRanges;
- let result = {
- addon: addon,
- xpiURL: null,
- xpiHash: null
- };
- results.push(result);
- }
-
- // aTotalResults irrelevant
- this._reportSuccess(results, -1);
- }
-
- this._beginSearch(url, ids.length, aCallback, handleResults, aTimeout);
- },
-
- /**
- * Performs the daily background update check.
- *
- * This API both searches for the add-on IDs specified and sends performance
- * data. It is meant to be called as part of the daily update ping. It should
- * not be used for any other purpose. Use repopulateCache instead.
- *
- * @return Promise{null} Resolves when the metadata update is complete.
- */
- backgroundUpdateCheck: function() {
- return this._repopulateCacheInternal(true);
- },
-
- /**
- * Begins a search for recommended add-ons in this repository. Results will
- * be passed to the given callback.
- *
- * @param aMaxResults
- * The maximum number of results to return
- * @param aCallback
- * The callback to pass results to
- */
- retrieveRecommendedAddons: function(aMaxResults, aCallback) {
- let url = this._formatURLPref(PREF_GETADDONS_GETRECOMMENDED, {
- API_VERSION : API_VERSION,
-
- // Get twice as many results to account for potential filtering
- MAX_RESULTS : 2 * aMaxResults
- });
-
- let handleResults = (aElements, aTotalResults) => {
- this._getLocalAddonIds(aLocalAddonIds => {
- // aTotalResults irrelevant
- this._parseAddons(aElements, -1, aLocalAddonIds);
- });
- }
-
- this._beginSearch(url, aMaxResults, aCallback, handleResults);
- },
-
- /**
- * Begins a search for add-ons in this repository. Results will be passed to
- * the given callback.
- *
- * @param aSearchTerms
- * The terms to search for
- * @param aMaxResults
- * The maximum number of results to return
- * @param aCallback
- * The callback to pass results to
- */
- searchAddons: function(aSearchTerms, aMaxResults, aCallback) {
- let compatMode = "normal";
- if (!AddonManager.checkCompatibility)
- compatMode = "ignore";
- else if (AddonManager.strictCompatibility)
- compatMode = "strict";
-
- let substitutions = {
- API_VERSION : API_VERSION,
- TERMS : encodeURIComponent(aSearchTerms),
- // Get twice as many results to account for potential filtering
- MAX_RESULTS : 2 * aMaxResults,
- COMPATIBILITY_MODE : compatMode,
- };
-
- let url = this._formatURLPref(PREF_GETADDONS_GETSEARCHRESULTS, substitutions);
-
- let handleResults = (aElements, aTotalResults) => {
- this._getLocalAddonIds(aLocalAddonIds => {
- this._parseAddons(aElements, aTotalResults, aLocalAddonIds);
- });
- }
-
- this._beginSearch(url, aMaxResults, aCallback, handleResults);
- },
-
- // Posts results to the callback
- _reportSuccess: function(aResults, aTotalResults) {
- this._searching = false;
- this._request = null;
- // The callback may want to trigger a new search so clear references early
- let addons = aResults.map(result => result.addon);
- let callback = this._callback;
- this._callback = null;
- callback.searchSucceeded(addons, addons.length, aTotalResults);
- },
-
- // Notifies the callback of a failure
- _reportFailure: function() {
- this._searching = false;
- this._request = null;
- // The callback may want to trigger a new search so clear references early
- let callback = this._callback;
- this._callback = null;
- callback.searchFailed();
- },
-
- // Get descendant by unique tag name. Returns null if not unique tag name.
- _getUniqueDescendant: function(aElement, aTagName) {
- let elementsList = aElement.getElementsByTagName(aTagName);
- return (elementsList.length == 1) ? elementsList[0] : null;
- },
-
- // Get direct descendant by unique tag name.
- // Returns null if not unique tag name.
- _getUniqueDirectDescendant: function(aElement, aTagName) {
- let elementsList = Array.filter(aElement.children,
- aChild => aChild.tagName == aTagName);
- return (elementsList.length == 1) ? elementsList[0] : null;
- },
-
- // Parse out trimmed text content. Returns null if text content empty.
- _getTextContent: function(aElement) {
- let textContent = aElement.textContent.trim();
- return (textContent.length > 0) ? textContent : null;
- },
-
- // Parse out trimmed text content of a descendant with the specified tag name
- // Returns null if the parsing unsuccessful.
- _getDescendantTextContent: function(aElement, aTagName) {
- let descendant = this._getUniqueDescendant(aElement, aTagName);
- return (descendant != null) ? this._getTextContent(descendant) : null;
- },
-
- // Parse out trimmed text content of a direct descendant with the specified
- // tag name.
- // Returns null if the parsing unsuccessful.
- _getDirectDescendantTextContent: function(aElement, aTagName) {
- let descendant = this._getUniqueDirectDescendant(aElement, aTagName);
- return (descendant != null) ? this._getTextContent(descendant) : null;
- },
-
- /*
- * Creates an AddonSearchResult by parsing an <addon> element
- *
- * @param aElement
- * The <addon> element to parse
- * @param aSkip
- * Object containing ids and sourceURIs of add-ons to skip.
- * @param aCompatData
- * Array of parsed addon_compatibility elements to accosiate with the
- * resulting AddonSearchResult. Optional.
- * @return Result object containing the parsed AddonSearchResult, xpiURL and
- * xpiHash if the parsing was successful. Otherwise returns null.
- */
- _parseAddon: function(aElement, aSkip, aCompatData) {
- let skipIDs = (aSkip && aSkip.ids) ? aSkip.ids : [];
- let skipSourceURIs = (aSkip && aSkip.sourceURIs) ? aSkip.sourceURIs : [];
-
- let guid = this._getDescendantTextContent(aElement, "guid");
- if (guid == null || skipIDs.indexOf(guid) != -1)
- return null;
-
- let addon = new AddonSearchResult(guid);
- let result = {
- addon: addon,
- xpiURL: null,
- xpiHash: null
- };
-
- if (aCompatData && guid in aCompatData)
- addon.compatibilityOverrides = aCompatData[guid].compatRanges;
-
- for (let node = aElement.firstChild; node; node = node.nextSibling) {
- if (!(node instanceof Ci.nsIDOMElement))
- continue;
-
- let localName = node.localName;
-
- // Handle case where the wanted string value is located in text content
- // but only if the content is not empty
- if (localName in STRING_KEY_MAP) {
- addon[STRING_KEY_MAP[localName]] = this._getTextContent(node) || addon[STRING_KEY_MAP[localName]];
- continue;
- }
-
- // Handle case where the wanted string value is html located in text content
- if (localName in HTML_KEY_MAP) {
- addon[HTML_KEY_MAP[localName]] = convertHTMLToPlainText(this._getTextContent(node));
- continue;
- }
-
- // Handle case where the wanted integer value is located in text content
- if (localName in INTEGER_KEY_MAP) {
- let value = parseInt(this._getTextContent(node));
- if (value >= 0)
- addon[INTEGER_KEY_MAP[localName]] = value;
- continue;
- }
-
- // Handle cases that aren't as simple as grabbing the text content
- switch (localName) {
- case "type":
- // Map AMO's type id to corresponding string
- // https://github.com/mozilla/olympia/blob/master/apps/constants/base.py#L127
- // These definitions need to be updated whenever AMO adds a new type.
- let id = parseInt(node.getAttribute("id"));
- switch (id) {
- case 1:
- addon.type = "extension";
- break;
- case 2:
- addon.type = "theme";
- break;
- case 3:
- addon.type = "dictionary";
- break;
- case 4:
- addon.type = "search";
- break;
- case 5:
- case 6:
- addon.type = "locale";
- break;
- case 7:
- addon.type = "plugin";
- break;
- case 8:
- addon.type = "api";
- break;
- case 9:
- addon.type = "lightweight-theme";
- break;
- case 11:
- addon.type = "webapp";
- break;
- default:
- logger.info("Unknown type id " + id + " found when parsing response for GUID " + guid);
- }
- break;
- case "authors":
- let authorNodes = node.getElementsByTagName("author");
- for (let authorNode of authorNodes) {
- let name = this._getDescendantTextContent(authorNode, "name");
- let link = this._getDescendantTextContent(authorNode, "link");
- if (name == null || link == null)
- continue;
-
- let author = new AddonManagerPrivate.AddonAuthor(name, link);
- if (addon.creator == null)
- addon.creator = author;
- else {
- if (addon.developers == null)
- addon.developers = [];
-
- addon.developers.push(author);
- }
- }
- break;
- case "previews":
- let previewNodes = node.getElementsByTagName("preview");
- for (let previewNode of previewNodes) {
- let full = this._getUniqueDescendant(previewNode, "full");
- if (full == null)
- continue;
-
- let fullURL = this._getTextContent(full);
- let fullWidth = full.getAttribute("width");
- let fullHeight = full.getAttribute("height");
-
- let thumbnailURL, thumbnailWidth, thumbnailHeight;
- let thumbnail = this._getUniqueDescendant(previewNode, "thumbnail");
- if (thumbnail) {
- thumbnailURL = this._getTextContent(thumbnail);
- thumbnailWidth = thumbnail.getAttribute("width");
- thumbnailHeight = thumbnail.getAttribute("height");
- }
- let caption = this._getDescendantTextContent(previewNode, "caption");
- let screenshot = new AddonManagerPrivate.AddonScreenshot(fullURL, fullWidth, fullHeight,
- thumbnailURL, thumbnailWidth,
- thumbnailHeight, caption);
-
- if (addon.screenshots == null)
- addon.screenshots = [];
-
- if (previewNode.getAttribute("primary") == 1)
- addon.screenshots.unshift(screenshot);
- else
- addon.screenshots.push(screenshot);
- }
- break;
- case "learnmore":
- addon.learnmoreURL = this._getTextContent(node);
- addon.homepageURL = addon.homepageURL || addon.learnmoreURL;
- break;
- case "contribution_data":
- let meetDevelopers = this._getDescendantTextContent(node, "meet_developers");
- let suggestedAmount = this._getDescendantTextContent(node, "suggested_amount");
- if (meetDevelopers != null) {
- addon.contributionURL = meetDevelopers;
- addon.contributionAmount = suggestedAmount;
- }
- break
- case "payment_data":
- let link = this._getDescendantTextContent(node, "link");
- let amountTag = this._getUniqueDescendant(node, "amount");
- let amount = parseFloat(amountTag.getAttribute("amount"));
- let displayAmount = this._getTextContent(amountTag);
- if (link != null && amount != null && displayAmount != null) {
- addon.purchaseURL = link;
- addon.purchaseAmount = amount;
- addon.purchaseDisplayAmount = displayAmount;
- }
- break
- case "rating":
- let averageRating = parseInt(this._getTextContent(node));
- if (averageRating >= 0)
- addon.averageRating = Math.min(5, averageRating);
- break;
- case "reviews":
- let url = this._getTextContent(node);
- let num = parseInt(node.getAttribute("num"));
- if (url != null && num >= 0) {
- addon.reviewURL = url;
- addon.reviewCount = num;
- }
- break;
- case "status":
- let repositoryStatus = parseInt(node.getAttribute("id"));
- if (!isNaN(repositoryStatus))
- addon.repositoryStatus = repositoryStatus;
- break;
- case "all_compatible_os":
- let nodes = node.getElementsByTagName("os");
- addon.isPlatformCompatible = Array.some(nodes, function(aNode) {
- let text = aNode.textContent.toLowerCase().trim();
- return text == "all" || text == Services.appinfo.OS.toLowerCase();
- });
- break;
- case "install":
- // No os attribute means the xpi is compatible with any os
- if (node.hasAttribute("os")) {
- let os = node.getAttribute("os").trim().toLowerCase();
- // If the os is not ALL and not the current OS then ignore this xpi
- if (os != "all" && os != Services.appinfo.OS.toLowerCase())
- break;
- }
-
- let xpiURL = this._getTextContent(node);
- if (xpiURL == null)
- break;
-
- if (skipSourceURIs.indexOf(xpiURL) != -1)
- return null;
-
- result.xpiURL = xpiURL;
- addon.sourceURI = NetUtil.newURI(xpiURL);
-
- let size = parseInt(node.getAttribute("size"));
- addon.size = (size >= 0) ? size : null;
-
- let xpiHash = node.getAttribute("hash");
- if (xpiHash != null)
- xpiHash = xpiHash.trim();
- result.xpiHash = xpiHash ? xpiHash : null;
- break;
- case "last_updated":
- let epoch = parseInt(node.getAttribute("epoch"));
- if (!isNaN(epoch))
- addon.updateDate = new Date(1000 * epoch);
- break;
- case "icon":
- addon.icons[node.getAttribute("size")] = this._getTextContent(node);
- break;
- }
- }
-
- return result;
- },
-
- _parseAddons: function(aElements, aTotalResults, aSkip) {
- let results = [];
-
- let isSameApplication = aAppNode => this._getTextContent(aAppNode) == Services.appinfo.ID;
-
- for (let i = 0; i < aElements.length && results.length < this._maxResults; i++) {
- let element = aElements[i];
-
- let tags = this._getUniqueDescendant(element, "compatible_applications");
- if (tags == null)
- continue;
-
- let applications = tags.getElementsByTagName("appID");
- let compatible = Array.some(applications, aAppNode => {
- if (!isSameApplication(aAppNode))
- return false;
-
- let parent = aAppNode.parentNode;
- let minVersion = this._getDescendantTextContent(parent, "min_version");
- let maxVersion = this._getDescendantTextContent(parent, "max_version");
- if (minVersion == null || maxVersion == null)
- return false;
-
- let currentVersion = Services.appinfo.version;
- return (Services.vc.compare(minVersion, currentVersion) <= 0 &&
- ((!AddonManager.strictCompatibility) ||
- Services.vc.compare(currentVersion, maxVersion) <= 0));
- });
-
- // Ignore add-ons not compatible with this Application
- if (!compatible) {
- if (AddonManager.checkCompatibility)
- continue;
-
- if (!Array.some(applications, isSameApplication))
- continue;
- }
-
- // Add-on meets all requirements, so parse out data.
- // Don't pass in compatiblity override data, because that's only returned
- // in GUID searches, which don't use _parseAddons().
- let result = this._parseAddon(element, aSkip);
- if (result == null)
- continue;
-
- // Ignore add-on missing a required attribute
- let requiredAttributes = ["id", "name", "version", "type", "creator"];
- if (requiredAttributes.some(aAttribute => !result.addon[aAttribute]))
- continue;
-
- // Ignore add-on with a type AddonManager doesn't understand:
- if (!(result.addon.type in AddonManager.addonTypes))
- continue;
-
- // Add only if the add-on is compatible with the platform
- if (!result.addon.isPlatformCompatible)
- continue;
-
- // Add only if there was an xpi compatible with this OS or there was a
- // way to purchase the add-on
- if (!result.xpiURL && !result.addon.purchaseURL)
- continue;
-
- result.addon.isCompatible = compatible;
-
- results.push(result);
- // Ignore this add-on from now on by adding it to the skip array
- aSkip.ids.push(result.addon.id);
- }
-
- // Immediately report success if no AddonInstall instances to create
- let pendingResults = results.length;
- if (pendingResults == 0) {
- this._reportSuccess(results, aTotalResults);
- return;
- }
-
- // Create an AddonInstall for each result
- for (let result of results) {
- let addon = result.addon;
- let callback = aInstall => {
- addon.install = aInstall;
- pendingResults--;
- if (pendingResults == 0)
- this._reportSuccess(results, aTotalResults);
- }
-
- if (result.xpiURL) {
- AddonManager.getInstallForURL(result.xpiURL, callback,
- "application/x-xpinstall", result.xpiHash,
- addon.name, addon.icons, addon.version);
- }
- else {
- callback(null);
- }
- }
- },
-
- // Parses addon_compatibility nodes, that describe compatibility overrides.
- _parseAddonCompatElement: function(aResultObj, aElement) {
- let guid = this._getDescendantTextContent(aElement, "guid");
- if (!guid) {
- logger.debug("Compatibility override is missing guid.");
- return;
- }
-
- let compat = {id: guid};
- compat.hosted = aElement.getAttribute("hosted") != "false";
-
- function findMatchingAppRange(aNodes) {
- let toolkitAppRange = null;
- for (let node of aNodes) {
- let appID = this._getDescendantTextContent(node, "appID");
- if (appID != Services.appinfo.ID && appID != TOOLKIT_ID)
- continue;
-
- let minVersion = this._getDescendantTextContent(node, "min_version");
- let maxVersion = this._getDescendantTextContent(node, "max_version");
- if (minVersion == null || maxVersion == null)
- continue;
-
- let appRange = { appID: appID,
- appMinVersion: minVersion,
- appMaxVersion: maxVersion };
-
- // Only use Toolkit app ranges if no ranges match the application ID.
- if (appID == TOOLKIT_ID)
- toolkitAppRange = appRange;
- else
- return appRange;
- }
- return toolkitAppRange;
- }
-
- function parseRangeNode(aNode) {
- let type = aNode.getAttribute("type");
- // Only "incompatible" (blacklisting) is supported for now.
- if (type != "incompatible") {
- logger.debug("Compatibility override of unsupported type found.");
- return null;
- }
-
- let override = new AddonManagerPrivate.AddonCompatibilityOverride(type);
-
- override.minVersion = this._getDirectDescendantTextContent(aNode, "min_version");
- override.maxVersion = this._getDirectDescendantTextContent(aNode, "max_version");
-
- if (!override.minVersion) {
- logger.debug("Compatibility override is missing min_version.");
- return null;
- }
- if (!override.maxVersion) {
- logger.debug("Compatibility override is missing max_version.");
- return null;
- }
-
- let appRanges = aNode.querySelectorAll("compatible_applications > application");
- let appRange = findMatchingAppRange.bind(this)(appRanges);
- if (!appRange) {
- logger.debug("Compatibility override is missing a valid application range.");
- return null;
- }
-
- override.appID = appRange.appID;
- override.appMinVersion = appRange.appMinVersion;
- override.appMaxVersion = appRange.appMaxVersion;
-
- return override;
- }
-
- let rangeNodes = aElement.querySelectorAll("version_ranges > version_range");
- compat.compatRanges = Array.map(rangeNodes, parseRangeNode.bind(this))
- .filter(aItem => !!aItem);
- if (compat.compatRanges.length == 0)
- return;
-
- aResultObj[compat.id] = compat;
- },
-
- // Parses addon_compatibility elements.
- _parseAddonCompatData: function(aElements) {
- let compatData = {};
- Array.forEach(aElements, this._parseAddonCompatElement.bind(this, compatData));
- return compatData;
- },
-
- // Begins a new search if one isn't currently executing
- _beginSearch: function(aURI, aMaxResults, aCallback, aHandleResults, aTimeout) {
- if (this._searching || aURI == null || aMaxResults <= 0) {
- logger.warn("AddonRepository search failed: searching " + this._searching + " aURI " + aURI +
- " aMaxResults " + aMaxResults);
- aCallback.searchFailed();
- return;
- }
-
- this._searching = true;
- this._callback = aCallback;
- this._maxResults = aMaxResults;
-
- logger.debug("Requesting " + aURI);
-
- this._request = new ServiceRequest();
- this._request.mozBackgroundRequest = true;
- this._request.open("GET", aURI, true);
- this._request.overrideMimeType("text/xml");
- if (aTimeout) {
- this._request.timeout = aTimeout;
- }
-
- this._request.addEventListener("error", aEvent => this._reportFailure(), false);
- this._request.addEventListener("timeout", aEvent => this._reportFailure(), false);
- this._request.addEventListener("load", aEvent => {
- logger.debug("Got metadata search load event");
- let request = aEvent.target;
- let responseXML = request.responseXML;
-
- if (!responseXML || responseXML.documentElement.namespaceURI == XMLURI_PARSE_ERROR ||
- (request.status != 200 && request.status != 0)) {
- this._reportFailure();
- return;
- }
-
- let documentElement = responseXML.documentElement;
- let elements = documentElement.getElementsByTagName("addon");
- let totalResults = elements.length;
- let parsedTotalResults = parseInt(documentElement.getAttribute("total_results"));
- // Parsed value of total results only makes sense if >= elements.length
- if (parsedTotalResults >= totalResults)
- totalResults = parsedTotalResults;
-
- let compatElements = documentElement.getElementsByTagName("addon_compatibility");
- let compatData = this._parseAddonCompatData(compatElements);
-
- aHandleResults(elements, totalResults, compatData);
- }, false);
- this._request.send(null);
- },
-
- // Gets the id's of local add-ons, and the sourceURI's of local installs,
- // passing the results to aCallback
- _getLocalAddonIds: function(aCallback) {
- let localAddonIds = {ids: null, sourceURIs: null};
-
- AddonManager.getAllAddons(function(aAddons) {
- localAddonIds.ids = aAddons.map(a => a.id);
- if (localAddonIds.sourceURIs)
- aCallback(localAddonIds);
- });
-
- AddonManager.getAllInstalls(function(aInstalls) {
- localAddonIds.sourceURIs = [];
- for (let install of aInstalls) {
- if (install.state != AddonManager.STATE_AVAILABLE)
- localAddonIds.sourceURIs.push(install.sourceURI.spec);
- }
-
- if (localAddonIds.ids)
- aCallback(localAddonIds);
- });
- },
-
- // Create url from preference, returning null if preference does not exist
- _formatURLPref: function(aPreference, aSubstitutions) {
- let url = null;
- try {
- url = Services.prefs.getCharPref(aPreference);
- } catch (e) {
- logger.warn("_formatURLPref: Couldn't get pref: " + aPreference);
- return null;
- }
-
- url = url.replace(/%([A-Z_]+)%/g, function(aMatch, aKey) {
- return (aKey in aSubstitutions) ? aSubstitutions[aKey] : aMatch;
- });
-
- return Services.urlFormatter.formatURL(url);
- },
-
- // Find a AddonCompatibilityOverride that matches a given aAddonVersion and
- // application/platform version.
- findMatchingCompatOverride: function(aAddonVersion,
- aCompatOverrides,
- aAppVersion,
- aPlatformVersion) {
- for (let override of aCompatOverrides) {
-
- let appVersion = null;
- if (override.appID == TOOLKIT_ID)
- appVersion = aPlatformVersion || Services.appinfo.platformVersion;
- else
- appVersion = aAppVersion || Services.appinfo.version;
-
- if (Services.vc.compare(override.minVersion, aAddonVersion) <= 0 &&
- Services.vc.compare(aAddonVersion, override.maxVersion) <= 0 &&
- Services.vc.compare(override.appMinVersion, appVersion) <= 0 &&
- Services.vc.compare(appVersion, override.appMaxVersion) <= 0) {
- return override;
- }
- }
- return null;
- },
-
- flush: function() {
- return AddonDatabase.flush();
- }
-};
-
-var AddonDatabase = {
- connectionPromise: null,
- // the in-memory database
- DB: BLANK_DB(),
-
- /**
- * A getter to retrieve the path to the DB
- */
- get jsonFile() {
- return OS.Path.join(OS.Constants.Path.profileDir, FILE_DATABASE);
- },
-
- /**
- * Asynchronously opens a new connection to the database file.
- *
- * @return {Promise} a promise that resolves to the database.
- */
- openConnection: function() {
- if (!this.connectionPromise) {
- this.connectionPromise = Task.spawn(function*() {
- this.DB = BLANK_DB();
-
- let inputDB, schema;
-
- try {
- let data = yield OS.File.read(this.jsonFile, { encoding: "utf-8"})
- inputDB = JSON.parse(data);
-
- if (!inputDB.hasOwnProperty("addons") ||
- !Array.isArray(inputDB.addons)) {
- throw new Error("No addons array.");
- }
-
- if (!inputDB.hasOwnProperty("schema")) {
- throw new Error("No schema specified.");
- }
-
- schema = parseInt(inputDB.schema, 10);
-
- if (!Number.isInteger(schema) ||
- schema < DB_MIN_JSON_SCHEMA) {
- throw new Error("Invalid schema value.");
- }
- } catch (e) {
- if (e instanceof OS.File.Error && e.becauseNoSuchFile) {
- logger.debug("No " + FILE_DATABASE + " found.");
- } else {
- logger.error(`Malformed ${FILE_DATABASE}: ${e} - resetting to empty`);
- }
-
- // Create a blank addons.json file
- this._saveDBToDisk();
-
- let dbSchema = 0;
- try {
- dbSchema = Services.prefs.getIntPref(PREF_GETADDONS_DB_SCHEMA);
- } catch (e) {}
-
- if (dbSchema < DB_MIN_JSON_SCHEMA) {
- let results = yield new Promise((resolve, reject) => {
- AddonRepository_SQLiteMigrator.migrate(resolve);
- });
-
- if (results.length) {
- yield this._insertAddons(results);
- }
-
- }
-
- Services.prefs.setIntPref(PREF_GETADDONS_DB_SCHEMA, DB_SCHEMA);
- return this.DB;
- }
-
- Services.prefs.setIntPref(PREF_GETADDONS_DB_SCHEMA, DB_SCHEMA);
-
- // We use _insertAddon manually instead of calling
- // insertAddons to avoid the write to disk which would
- // be a waste since this is the data that was just read.
- for (let addon of inputDB.addons) {
- this._insertAddon(addon);
- }
-
- return this.DB;
- }.bind(this));
- }
-
- return this.connectionPromise;
- },
-
- /**
- * A lazy getter for the database connection.
- */
- get connection() {
- return this.openConnection();
- },
-
- /**
- * Asynchronously shuts down the database connection and releases all
- * cached objects
- *
- * @param aCallback
- * An optional callback to call once complete
- * @param aSkipFlush
- * An optional boolean to skip flushing data to disk. Useful
- * when the database is going to be deleted afterwards.
- */
- shutdown: function(aSkipFlush) {
- if (!this.connectionPromise) {
- return Promise.resolve();
- }
-
- this.connectionPromise = null;
-
- if (aSkipFlush) {
- return Promise.resolve();
- }
- return this.Writer.flush();
- },
-
- /**
- * Asynchronously deletes the database, shutting down the connection
- * first if initialized
- *
- * @param aCallback
- * An optional callback to call once complete
- * @return Promise{null} resolves when the database has been deleted
- */
- delete: function(aCallback) {
- this.DB = BLANK_DB();
-
- this._deleting = this.Writer.flush()
- .then(null, () => {})
- // shutdown(true) never rejects
- .then(() => this.shutdown(true))
- .then(() => OS.File.remove(this.jsonFile, {}))
- .then(null, error => logger.error("Unable to delete Addon Repository file " +
- this.jsonFile, error))
- .then(() => this._deleting = null)
- .then(aCallback);
- return this._deleting;
- },
-
- toJSON: function() {
- let json = {
- schema: this.DB.schema,
- addons: []
- }
-
- for (let [, value] of this.DB.addons)
- json.addons.push(value);
-
- return json;
- },
-
- /*
- * This is a deferred task writer that is used
- * to batch operations done within 50ms of each
- * other and thus generating only one write to disk
- */
- get Writer() {
- delete this.Writer;
- this.Writer = new DeferredSave(
- this.jsonFile,
- () => { return JSON.stringify(this); },
- DB_BATCH_TIMEOUT_MS
- );
- return this.Writer;
- },
-
- /**
- * Flush any pending I/O on the addons.json file
- * @return: Promise{null}
- * Resolves when the pending I/O (writing out or deleting
- * addons.json) completes
- */
- flush: function() {
- if (this._deleting) {
- return this._deleting;
- }
- return this.Writer.flush();
- },
-
- /**
- * Asynchronously retrieve all add-ons from the database
- * @return: Promise{Map}
- * Resolves when the add-ons are retrieved from the database
- */
- retrieveStoredData: function() {
- return this.openConnection().then(db => db.addons);
- },
-
- /**
- * Asynchronously repopulates the database so it only contains the
- * specified add-ons
- *
- * @param aAddons
- * The array of add-ons to repopulate the database with
- * @param aCallback
- * An optional callback to call once complete
- */
- repopulate: function(aAddons, aCallback) {
- this.DB.addons.clear();
- this.insertAddons(aAddons, function() {
- let now = Math.round(Date.now() / 1000);
- logger.debug("Cache repopulated, setting " + PREF_METADATA_LASTUPDATE + " to " + now);
- Services.prefs.setIntPref(PREF_METADATA_LASTUPDATE, now);
- if (aCallback)
- aCallback();
- });
- },
-
- /**
- * Asynchronously inserts an array of add-ons into the database
- *
- * @param aAddons
- * The array of add-ons to insert
- * @param aCallback
- * An optional callback to call once complete
- */
- insertAddons: Task.async(function*(aAddons, aCallback) {
- yield this.openConnection();
- yield this._insertAddons(aAddons, aCallback);
- }),
-
- _insertAddons: Task.async(function*(aAddons, aCallback) {
- for (let addon of aAddons) {
- this._insertAddon(addon);
- }
-
- yield this._saveDBToDisk();
- aCallback && aCallback();
- }),
-
- /**
- * Inserts an individual add-on into the database. If the add-on already
- * exists in the database (by id), then the specified add-on will not be
- * inserted.
- *
- * @param aAddon
- * The add-on to insert into the database
- * @param aCallback
- * The callback to call once complete
- */
- _insertAddon: function(aAddon) {
- let newAddon = this._parseAddon(aAddon);
- if (!newAddon ||
- !newAddon.id ||
- this.DB.addons.has(newAddon.id))
- return;
-
- this.DB.addons.set(newAddon.id, newAddon);
- },
-
- /*
- * Creates an AddonSearchResult by parsing an object structure
- * retrieved from the DB JSON representation.
- *
- * @param aObj
- * The object to parse
- * @return Returns an AddonSearchResult object.
- */
- _parseAddon: function(aObj) {
- if (aObj instanceof AddonSearchResult)
- return aObj;
-
- let id = aObj.id;
- if (!aObj.id)
- return null;
-
- let addon = new AddonSearchResult(id);
-
- for (let expectedProperty of Object.keys(AddonSearchResult.prototype)) {
- if (!(expectedProperty in aObj) ||
- typeof(aObj[expectedProperty]) === "function")
- continue;
-
- let value = aObj[expectedProperty];
-
- try {
- switch (expectedProperty) {
- case "sourceURI":
- addon.sourceURI = value ? NetUtil.newURI(value) : null;
- break;
-
- case "creator":
- addon.creator = value
- ? this._makeDeveloper(value)
- : null;
- break;
-
- case "updateDate":
- addon.updateDate = value ? new Date(value) : null;
- break;
-
- case "developers":
- if (!addon.developers) addon.developers = [];
- for (let developer of value) {
- addon.developers.push(this._makeDeveloper(developer));
- }
- break;
-
- case "screenshots":
- if (!addon.screenshots) addon.screenshots = [];
- for (let screenshot of value) {
- addon.screenshots.push(this._makeScreenshot(screenshot));
- }
- break;
-
- case "compatibilityOverrides":
- if (!addon.compatibilityOverrides) addon.compatibilityOverrides = [];
- for (let override of value) {
- addon.compatibilityOverrides.push(
- this._makeCompatOverride(override)
- );
- }
- break;
-
- case "icons":
- if (!addon.icons) addon.icons = {};
- for (let size of Object.keys(aObj.icons)) {
- addon.icons[size] = aObj.icons[size];
- }
- break;
-
- case "iconURL":
- break;
-
- default:
- addon[expectedProperty] = value;
- }
- } catch (ex) {
- logger.warn("Error in parsing property value for " + expectedProperty + " | " + ex);
- }
-
- // delete property from obj to indicate we've already
- // handled it. The remaining public properties will
- // be stored separately and just passed through to
- // be written back to the DB.
- delete aObj[expectedProperty];
- }
-
- // Copy remaining properties to a separate object
- // to prevent accidental access on downgraded versions.
- // The properties will be merged in the same object
- // prior to being written back through toJSON.
- for (let remainingProperty of Object.keys(aObj)) {
- switch (typeof(aObj[remainingProperty])) {
- case "boolean":
- case "number":
- case "string":
- case "object":
- // these types are accepted
- break;
- default:
- continue;
- }
-
- if (!remainingProperty.startsWith("_"))
- addon._unsupportedProperties[remainingProperty] =
- aObj[remainingProperty];
- }
-
- return addon;
- },
-
- /**
- * Write the in-memory DB to disk, after waiting for
- * the DB_BATCH_TIMEOUT_MS timeout.
- *
- * @return Promise A promise that resolves after the
- * write to disk has completed.
- */
- _saveDBToDisk: function() {
- return this.Writer.saveChanges().then(
- null,
- e => logger.error("SaveDBToDisk failed", e));
- },
-
- /**
- * Make a developer object from a vanilla
- * JS object from the JSON database
- *
- * @param aObj
- * The JS object to use
- * @return The created developer
- */
- _makeDeveloper: function(aObj) {
- let name = aObj.name;
- let url = aObj.url;
- return new AddonManagerPrivate.AddonAuthor(name, url);
- },
-
- /**
- * Make a screenshot object from a vanilla
- * JS object from the JSON database
- *
- * @param aObj
- * The JS object to use
- * @return The created screenshot
- */
- _makeScreenshot: function(aObj) {
- let url = aObj.url;
- let width = aObj.width;
- let height = aObj.height;
- let thumbnailURL = aObj.thumbnailURL;
- let thumbnailWidth = aObj.thumbnailWidth;
- let thumbnailHeight = aObj.thumbnailHeight;
- let caption = aObj.caption;
- return new AddonManagerPrivate.AddonScreenshot(url, width, height, thumbnailURL,
- thumbnailWidth, thumbnailHeight, caption);
- },
-
- /**
- * Make a CompatibilityOverride from a vanilla
- * JS object from the JSON database
- *
- * @param aObj
- * The JS object to use
- * @return The created CompatibilityOverride
- */
- _makeCompatOverride: function(aObj) {
- let type = aObj.type;
- let minVersion = aObj.minVersion;
- let maxVersion = aObj.maxVersion;
- let appID = aObj.appID;
- let appMinVersion = aObj.appMinVersion;
- let appMaxVersion = aObj.appMaxVersion;
- return new AddonManagerPrivate.AddonCompatibilityOverride(type,
- minVersion,
- maxVersion,
- appID,
- appMinVersion,
- appMaxVersion);
- },
-};
diff --git a/toolkit/mozapps/webextensions/internal/AddonRepository_SQLiteMigrator.jsm b/toolkit/mozapps/webextensions/internal/AddonRepository_SQLiteMigrator.jsm
deleted file mode 100644
index e3479643be..0000000000
--- a/toolkit/mozapps/webextensions/internal/AddonRepository_SQLiteMigrator.jsm
+++ /dev/null
@@ -1,522 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/* globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/FileUtils.jsm");
-
-const KEY_PROFILEDIR = "ProfD";
-const FILE_DATABASE = "addons.sqlite";
-const LAST_DB_SCHEMA = 4;
-
-// Add-on properties present in the columns of the database
-const PROP_SINGLE = ["id", "type", "name", "version", "creator", "description",
- "fullDescription", "developerComments", "eula",
- "homepageURL", "supportURL", "contributionURL",
- "contributionAmount", "averageRating", "reviewCount",
- "reviewURL", "totalDownloads", "weeklyDownloads",
- "dailyUsers", "sourceURI", "repositoryStatus", "size",
- "updateDate"];
-
-Cu.import("resource://gre/modules/Log.jsm");
-const LOGGER_ID = "addons.repository.sqlmigrator";
-
-// Create a new logger for use by the Addons Repository SQL Migrator
-// (Requires AddonManager.jsm)
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-this.EXPORTED_SYMBOLS = ["AddonRepository_SQLiteMigrator"];
-
-
-this.AddonRepository_SQLiteMigrator = {
-
- /**
- * Migrates data from a previous SQLite version of the
- * database to the JSON version.
- *
- * @param structFunctions an object that contains functions
- * to create the various objects used
- * in the new JSON format
- * @param aCallback A callback to be called when migration
- * finishes, with the results in an array
- * @returns bool True if a migration will happen (DB was
- * found and succesfully opened)
- */
- migrate: function(aCallback) {
- if (!this._openConnection()) {
- this._closeConnection();
- aCallback([]);
- return false;
- }
-
- logger.debug("Importing addon repository from previous " + FILE_DATABASE + " storage.");
-
- this._retrieveStoredData((results) => {
- this._closeConnection();
- let resultArray = Object.keys(results).map(k => results[k]);
- logger.debug(resultArray.length + " addons imported.")
- aCallback(resultArray);
- });
-
- return true;
- },
-
- /**
- * Synchronously opens a new connection to the database file.
- *
- * @return bool Whether the DB was opened successfully.
- */
- _openConnection: function() {
- delete this.connection;
-
- let dbfile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true);
- if (!dbfile.exists())
- return false;
-
- try {
- this.connection = Services.storage.openUnsharedDatabase(dbfile);
- } catch (e) {
- return false;
- }
-
- this.connection.executeSimpleSQL("PRAGMA locking_mode = EXCLUSIVE");
-
- // Any errors in here should rollback
- try {
- this.connection.beginTransaction();
-
- switch (this.connection.schemaVersion) {
- case 0:
- return false;
-
- case 1:
- logger.debug("Upgrading database schema to version 2");
- this.connection.executeSimpleSQL("ALTER TABLE screenshot ADD COLUMN width INTEGER");
- this.connection.executeSimpleSQL("ALTER TABLE screenshot ADD COLUMN height INTEGER");
- this.connection.executeSimpleSQL("ALTER TABLE screenshot ADD COLUMN thumbnailWidth INTEGER");
- this.connection.executeSimpleSQL("ALTER TABLE screenshot ADD COLUMN thumbnailHeight INTEGER");
- case 2:
- logger.debug("Upgrading database schema to version 3");
- this.connection.createTable("compatibility_override",
- "addon_internal_id INTEGER, " +
- "num INTEGER, " +
- "type TEXT, " +
- "minVersion TEXT, " +
- "maxVersion TEXT, " +
- "appID TEXT, " +
- "appMinVersion TEXT, " +
- "appMaxVersion TEXT, " +
- "PRIMARY KEY (addon_internal_id, num)");
- case 3:
- logger.debug("Upgrading database schema to version 4");
- this.connection.createTable("icon",
- "addon_internal_id INTEGER, " +
- "size INTEGER, " +
- "url TEXT, " +
- "PRIMARY KEY (addon_internal_id, size)");
- this._createIndices();
- this._createTriggers();
- this.connection.schemaVersion = LAST_DB_SCHEMA;
- case LAST_DB_SCHEMA:
- break;
- default:
- return false;
- }
- this.connection.commitTransaction();
- } catch (e) {
- logger.error("Failed to open " + FILE_DATABASE + ". Data import will not happen.", e);
- this.logSQLError(this.connection.lastError, this.connection.lastErrorString);
- this.connection.rollbackTransaction();
- return false;
- }
-
- return true;
- },
-
- _closeConnection: function() {
- for (let key in this.asyncStatementsCache) {
- let stmt = this.asyncStatementsCache[key];
- stmt.finalize();
- }
- this.asyncStatementsCache = {};
-
- if (this.connection)
- this.connection.asyncClose();
-
- delete this.connection;
- },
-
- /**
- * Asynchronously retrieve all add-ons from the database, and pass it
- * to the specified callback
- *
- * @param aCallback
- * The callback to pass the add-ons back to
- */
- _retrieveStoredData: function(aCallback) {
- let addons = {};
-
- // Retrieve all data from the addon table
- let getAllAddons = () => {
- this.getAsyncStatement("getAllAddons").executeAsync({
- handleResult: aResults => {
- let row = null;
- while ((row = aResults.getNextRow())) {
- let internal_id = row.getResultByName("internal_id");
- addons[internal_id] = this._makeAddonFromAsyncRow(row);
- }
- },
-
- handleError: this.asyncErrorLogger,
-
- handleCompletion: function(aReason) {
- if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
- logger.error("Error retrieving add-ons from database. Returning empty results");
- aCallback({});
- return;
- }
-
- getAllDevelopers();
- }
- });
- }
-
- // Retrieve all data from the developer table
- let getAllDevelopers = () => {
- this.getAsyncStatement("getAllDevelopers").executeAsync({
- handleResult: aResults => {
- let row = null;
- while ((row = aResults.getNextRow())) {
- let addon_internal_id = row.getResultByName("addon_internal_id");
- if (!(addon_internal_id in addons)) {
- logger.warn("Found a developer not linked to an add-on in database");
- continue;
- }
-
- let addon = addons[addon_internal_id];
- if (!addon.developers)
- addon.developers = [];
-
- addon.developers.push(this._makeDeveloperFromAsyncRow(row));
- }
- },
-
- handleError: this.asyncErrorLogger,
-
- handleCompletion: function(aReason) {
- if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
- logger.error("Error retrieving developers from database. Returning empty results");
- aCallback({});
- return;
- }
-
- getAllScreenshots();
- }
- });
- }
-
- // Retrieve all data from the screenshot table
- let getAllScreenshots = () => {
- this.getAsyncStatement("getAllScreenshots").executeAsync({
- handleResult: aResults => {
- let row = null;
- while ((row = aResults.getNextRow())) {
- let addon_internal_id = row.getResultByName("addon_internal_id");
- if (!(addon_internal_id in addons)) {
- logger.warn("Found a screenshot not linked to an add-on in database");
- continue;
- }
-
- let addon = addons[addon_internal_id];
- if (!addon.screenshots)
- addon.screenshots = [];
- addon.screenshots.push(this._makeScreenshotFromAsyncRow(row));
- }
- },
-
- handleError: this.asyncErrorLogger,
-
- handleCompletion: function(aReason) {
- if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
- logger.error("Error retrieving screenshots from database. Returning empty results");
- aCallback({});
- return;
- }
-
- getAllCompatOverrides();
- }
- });
- }
-
- let getAllCompatOverrides = () => {
- this.getAsyncStatement("getAllCompatOverrides").executeAsync({
- handleResult: aResults => {
- let row = null;
- while ((row = aResults.getNextRow())) {
- let addon_internal_id = row.getResultByName("addon_internal_id");
- if (!(addon_internal_id in addons)) {
- logger.warn("Found a compatibility override not linked to an add-on in database");
- continue;
- }
-
- let addon = addons[addon_internal_id];
- if (!addon.compatibilityOverrides)
- addon.compatibilityOverrides = [];
- addon.compatibilityOverrides.push(this._makeCompatOverrideFromAsyncRow(row));
- }
- },
-
- handleError: this.asyncErrorLogger,
-
- handleCompletion: function(aReason) {
- if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
- logger.error("Error retrieving compatibility overrides from database. Returning empty results");
- aCallback({});
- return;
- }
-
- getAllIcons();
- }
- });
- }
-
- let getAllIcons = () => {
- this.getAsyncStatement("getAllIcons").executeAsync({
- handleResult: aResults => {
- let row = null;
- while ((row = aResults.getNextRow())) {
- let addon_internal_id = row.getResultByName("addon_internal_id");
- if (!(addon_internal_id in addons)) {
- logger.warn("Found an icon not linked to an add-on in database");
- continue;
- }
-
- let addon = addons[addon_internal_id];
- let { size, url } = this._makeIconFromAsyncRow(row);
- addon.icons[size] = url;
- if (size == 32)
- addon.iconURL = url;
- }
- },
-
- handleError: this.asyncErrorLogger,
-
- handleCompletion: function(aReason) {
- if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED) {
- logger.error("Error retrieving icons from database. Returning empty results");
- aCallback({});
- return;
- }
-
- let returnedAddons = {};
- for (let id in addons) {
- let addon = addons[id];
- returnedAddons[addon.id] = addon;
- }
- aCallback(returnedAddons);
- }
- });
- }
-
- // Begin asynchronous process
- getAllAddons();
- },
-
- // A cache of statements that are used and need to be finalized on shutdown
- asyncStatementsCache: {},
-
- /**
- * Gets a cached async statement or creates a new statement if it doesn't
- * already exist.
- *
- * @param aKey
- * A unique key to reference the statement
- * @return a mozIStorageAsyncStatement for the SQL corresponding to the
- * unique key
- */
- getAsyncStatement: function(aKey) {
- if (aKey in this.asyncStatementsCache)
- return this.asyncStatementsCache[aKey];
-
- let sql = this.queries[aKey];
- try {
- return this.asyncStatementsCache[aKey] = this.connection.createAsyncStatement(sql);
- } catch (e) {
- logger.error("Error creating statement " + aKey + " (" + sql + ")");
- throw Components.Exception("Error creating statement " + aKey + " (" + sql + "): " + e,
- e.result);
- }
- },
-
- // The queries used by the database
- queries: {
- getAllAddons: "SELECT internal_id, id, type, name, version, " +
- "creator, creatorURL, description, fullDescription, " +
- "developerComments, eula, homepageURL, supportURL, " +
- "contributionURL, contributionAmount, averageRating, " +
- "reviewCount, reviewURL, totalDownloads, weeklyDownloads, " +
- "dailyUsers, sourceURI, repositoryStatus, size, updateDate " +
- "FROM addon",
-
- getAllDevelopers: "SELECT addon_internal_id, name, url FROM developer " +
- "ORDER BY addon_internal_id, num",
-
- getAllScreenshots: "SELECT addon_internal_id, url, width, height, " +
- "thumbnailURL, thumbnailWidth, thumbnailHeight, caption " +
- "FROM screenshot ORDER BY addon_internal_id, num",
-
- getAllCompatOverrides: "SELECT addon_internal_id, type, minVersion, " +
- "maxVersion, appID, appMinVersion, appMaxVersion " +
- "FROM compatibility_override " +
- "ORDER BY addon_internal_id, num",
-
- getAllIcons: "SELECT addon_internal_id, size, url FROM icon " +
- "ORDER BY addon_internal_id, size",
- },
-
- /**
- * Make add-on structure from an asynchronous row.
- *
- * @param aRow
- * The asynchronous row to use
- * @return The created add-on
- */
- _makeAddonFromAsyncRow: function(aRow) {
- // This is intentionally not an AddonSearchResult object in order
- // to allow AddonDatabase._parseAddon to parse it, same as if it
- // was read from the JSON database.
-
- let addon = { icons: {} };
-
- for (let prop of PROP_SINGLE) {
- addon[prop] = aRow.getResultByName(prop)
- }
-
- return addon;
- },
-
- /**
- * Make a developer from an asynchronous row
- *
- * @param aRow
- * The asynchronous row to use
- * @return The created developer
- */
- _makeDeveloperFromAsyncRow: function(aRow) {
- let name = aRow.getResultByName("name");
- let url = aRow.getResultByName("url")
- return new AddonManagerPrivate.AddonAuthor(name, url);
- },
-
- /**
- * Make a screenshot from an asynchronous row
- *
- * @param aRow
- * The asynchronous row to use
- * @return The created screenshot
- */
- _makeScreenshotFromAsyncRow: function(aRow) {
- let url = aRow.getResultByName("url");
- let width = aRow.getResultByName("width");
- let height = aRow.getResultByName("height");
- let thumbnailURL = aRow.getResultByName("thumbnailURL");
- let thumbnailWidth = aRow.getResultByName("thumbnailWidth");
- let thumbnailHeight = aRow.getResultByName("thumbnailHeight");
- let caption = aRow.getResultByName("caption");
- return new AddonManagerPrivate.AddonScreenshot(url, width, height, thumbnailURL,
- thumbnailWidth, thumbnailHeight, caption);
- },
-
- /**
- * Make a CompatibilityOverride from an asynchronous row
- *
- * @param aRow
- * The asynchronous row to use
- * @return The created CompatibilityOverride
- */
- _makeCompatOverrideFromAsyncRow: function(aRow) {
- let type = aRow.getResultByName("type");
- let minVersion = aRow.getResultByName("minVersion");
- let maxVersion = aRow.getResultByName("maxVersion");
- let appID = aRow.getResultByName("appID");
- let appMinVersion = aRow.getResultByName("appMinVersion");
- let appMaxVersion = aRow.getResultByName("appMaxVersion");
- return new AddonManagerPrivate.AddonCompatibilityOverride(type,
- minVersion,
- maxVersion,
- appID,
- appMinVersion,
- appMaxVersion);
- },
-
- /**
- * Make an icon from an asynchronous row
- *
- * @param aRow
- * The asynchronous row to use
- * @return An object containing the size and URL of the icon
- */
- _makeIconFromAsyncRow: function(aRow) {
- let size = aRow.getResultByName("size");
- let url = aRow.getResultByName("url");
- return { size: size, url: url };
- },
-
- /**
- * A helper function to log an SQL error.
- *
- * @param aError
- * The storage error code associated with the error
- * @param aErrorString
- * An error message
- */
- logSQLError: function(aError, aErrorString) {
- logger.error("SQL error " + aError + ": " + aErrorString);
- },
-
- /**
- * A helper function to log any errors that occur during async statements.
- *
- * @param aError
- * A mozIStorageError to log
- */
- asyncErrorLogger: function(aError) {
- logger.error("Async SQL error " + aError.result + ": " + aError.message);
- },
-
- /**
- * Synchronously creates the triggers in the database.
- */
- _createTriggers: function() {
- this.connection.executeSimpleSQL("DROP TRIGGER IF EXISTS delete_addon");
- this.connection.executeSimpleSQL("CREATE TRIGGER delete_addon AFTER DELETE " +
- "ON addon BEGIN " +
- "DELETE FROM developer WHERE addon_internal_id=old.internal_id; " +
- "DELETE FROM screenshot WHERE addon_internal_id=old.internal_id; " +
- "DELETE FROM compatibility_override WHERE addon_internal_id=old.internal_id; " +
- "DELETE FROM icon WHERE addon_internal_id=old.internal_id; " +
- "END");
- },
-
- /**
- * Synchronously creates the indices in the database.
- */
- _createIndices: function() {
- this.connection.executeSimpleSQL("CREATE INDEX IF NOT EXISTS developer_idx " +
- "ON developer (addon_internal_id)");
- this.connection.executeSimpleSQL("CREATE INDEX IF NOT EXISTS screenshot_idx " +
- "ON screenshot (addon_internal_id)");
- this.connection.executeSimpleSQL("CREATE INDEX IF NOT EXISTS compatibility_override_idx " +
- "ON compatibility_override (addon_internal_id)");
- this.connection.executeSimpleSQL("CREATE INDEX IF NOT EXISTS icon_idx " +
- "ON icon (addon_internal_id)");
- }
-}
diff --git a/toolkit/mozapps/webextensions/internal/GMPProvider.jsm b/toolkit/mozapps/webextensions/internal/GMPProvider.jsm
deleted file mode 100644
index 9bb34a7af6..0000000000
--- a/toolkit/mozapps/webextensions/internal/GMPProvider.jsm
+++ /dev/null
@@ -1,699 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-this.EXPORTED_SYMBOLS = [];
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/* globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-/* globals OS*/
-Cu.import("resource://gre/modules/Log.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/GMPUtils.jsm");
-/* globals EME_ADOBE_ID, GMP_PLUGIN_IDS, GMPPrefs, GMPUtils, OPEN_H264_ID, WIDEVINE_ID */
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(
- this, "GMPInstallManager", "resource://gre/modules/GMPInstallManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(
- this, "setTimeout", "resource://gre/modules/Timer.jsm");
-
-const URI_EXTENSION_STRINGS = "chrome://mozapps/locale/extensions/extensions.properties";
-const STRING_TYPE_NAME = "type.%ID%.name";
-
-const SEC_IN_A_DAY = 24 * 60 * 60;
-// How long to wait after a user enabled EME before attempting to download CDMs.
-const GMP_CHECK_DELAY = 10 * 1000; // milliseconds
-
-const NS_GRE_DIR = "GreD";
-const CLEARKEY_PLUGIN_ID = "gmp-clearkey";
-const CLEARKEY_VERSION = "0.1";
-
-const GMP_LICENSE_INFO = "gmp_license_info";
-const GMP_PRIVACY_INFO = "gmp_privacy_info";
-const GMP_LEARN_MORE = "learn_more_label";
-
-const GMP_PLUGINS = [
- {
- id: OPEN_H264_ID,
- name: "openH264_name",
- description: "openH264_description2",
- // The following licenseURL is part of an awful hack to include the OpenH264
- // license without having bug 624602 fixed yet, and intentionally ignores
- // localisation.
- licenseURL: "chrome://mozapps/content/extensions/OpenH264-license.txt",
- homepageURL: "http://www.openh264.org/",
- optionsURL: "chrome://mozapps/content/extensions/gmpPrefs.xul",
- },
- {
- id: EME_ADOBE_ID,
- name: "eme-adobe_name",
- description: "eme-adobe_description",
- // The following learnMoreURL is another hack to be able to support a SUMO page for this
- // feature.
- get learnMoreURL() {
- return Services.urlFormatter.formatURLPref("app.support.baseURL") + "drm-content";
- },
- licenseURL: "http://help.adobe.com/en_US/primetime/drm/HTML5_CDM_EULA/index.html",
- homepageURL: "http://help.adobe.com/en_US/primetime/drm/HTML5_CDM",
- optionsURL: "chrome://mozapps/content/extensions/gmpPrefs.xul",
- isEME: true,
- },
- {
- id: WIDEVINE_ID,
- name: "widevine_description",
- // Describe the purpose of both CDMs in the same way.
- description: "eme-adobe_description",
- licenseURL: "https://www.google.com/policies/privacy/",
- homepageURL: "https://www.widevine.com/",
- optionsURL: "chrome://mozapps/content/extensions/gmpPrefs.xul",
- isEME: true
- }];
-XPCOMUtils.defineConstant(this, "GMP_PLUGINS", GMP_PLUGINS);
-
-XPCOMUtils.defineLazyGetter(this, "pluginsBundle",
- () => Services.strings.createBundle("chrome://global/locale/plugins.properties"));
-XPCOMUtils.defineLazyGetter(this, "gmpService",
- () => Cc["@mozilla.org/gecko-media-plugin-service;1"].getService(Ci.mozIGeckoMediaPluginChromeService));
-
-var messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
- .getService(Ci.nsIMessageListenerManager);
-
-var gLogger;
-var gLogAppenderDump = null;
-
-function configureLogging() {
- if (!gLogger) {
- gLogger = Log.repository.getLogger("Toolkit.GMP");
- gLogger.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter()));
- }
- gLogger.level = GMPPrefs.get(GMPPrefs.KEY_LOGGING_LEVEL, Log.Level.Warn);
-
- let logDumping = GMPPrefs.get(GMPPrefs.KEY_LOGGING_DUMP, false);
- if (logDumping != !!gLogAppenderDump) {
- if (logDumping) {
- gLogAppenderDump = new Log.DumpAppender(new Log.BasicFormatter());
- gLogger.addAppender(gLogAppenderDump);
- } else {
- gLogger.removeAppender(gLogAppenderDump);
- gLogAppenderDump = null;
- }
- }
-}
-
-
-
-/**
- * The GMPWrapper provides the info for the various GMP plugins to public
- * callers through the API.
- */
-function GMPWrapper(aPluginInfo) {
- this._plugin = aPluginInfo;
- this._log =
- Log.repository.getLoggerWithMessagePrefix("Toolkit.GMP",
- "GMPWrapper(" +
- this._plugin.id + ") ");
- Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED,
- this._plugin.id),
- this.onPrefEnabledChanged, this);
- Preferences.observe(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_VERSION,
- this._plugin.id),
- this.onPrefVersionChanged, this);
- if (this._plugin.isEME) {
- Preferences.observe(GMPPrefs.KEY_EME_ENABLED,
- this.onPrefEMEGlobalEnabledChanged, this);
- messageManager.addMessageListener("EMEVideo:ContentMediaKeysRequest", this);
- }
-}
-
-GMPWrapper.prototype = {
- // An active task that checks for plugin updates and installs them.
- _updateTask: null,
- _gmpPath: null,
- _isUpdateCheckPending: false,
-
- optionsType: AddonManager.OPTIONS_TYPE_INLINE,
- get optionsURL() { return this._plugin.optionsURL; },
-
- set gmpPath(aPath) { this._gmpPath = aPath; },
- get gmpPath() {
- if (!this._gmpPath && this.isInstalled) {
- this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
- this._plugin.id,
- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION,
- null, this._plugin.id));
- }
- return this._gmpPath;
- },
-
- get id() { return this._plugin.id; },
- get type() { return "plugin"; },
- get isGMPlugin() { return true; },
- get name() { return this._plugin.name; },
- get creator() { return null; },
- get homepageURL() { return this._plugin.homepageURL; },
-
- get description() { return this._plugin.description; },
- get fullDescription() { return this._plugin.fullDescription; },
-
- get version() { return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION, null,
- this._plugin.id); },
-
- get isActive() {
- return !this.appDisabled &&
- !this.userDisabled &&
- !GMPUtils.isPluginHidden(this._plugin);
- },
- get appDisabled() {
- if (this._plugin.isEME && !GMPPrefs.get(GMPPrefs.KEY_EME_ENABLED, true)) {
- // If "media.eme.enabled" is false, all EME plugins are disabled.
- return true;
- }
- return false;
- },
-
- get userDisabled() {
- return !GMPPrefs.get(GMPPrefs.KEY_PLUGIN_ENABLED, true, this._plugin.id);
- },
- set userDisabled(aVal) { GMPPrefs.set(GMPPrefs.KEY_PLUGIN_ENABLED,
- aVal === false,
- this._plugin.id); },
-
- get blocklistState() { return Ci.nsIBlocklistService.STATE_NOT_BLOCKED; },
- get size() { return 0; },
- get scope() { return AddonManager.SCOPE_APPLICATION; },
- get pendingOperations() { return AddonManager.PENDING_NONE; },
-
- get operationsRequiringRestart() { return AddonManager.OP_NEEDS_RESTART_NONE },
-
- get permissions() {
- let permissions = 0;
- if (!this.appDisabled) {
- permissions |= AddonManager.PERM_CAN_UPGRADE;
- permissions |= this.userDisabled ? AddonManager.PERM_CAN_ENABLE :
- AddonManager.PERM_CAN_DISABLE;
- }
- return permissions;
- },
-
- get updateDate() {
- let time = Number(GMPPrefs.get(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, null,
- this._plugin.id));
- if (!isNaN(time) && this.isInstalled) {
- return new Date(time * 1000)
- }
- return null;
- },
-
- get isCompatible() {
- return true;
- },
-
- get isPlatformCompatible() {
- return true;
- },
-
- get providesUpdatesSecurely() {
- return true;
- },
-
- get foreignInstall() {
- return false;
- },
-
- isCompatibleWith: function(aAppVersion, aPlatformVersion) {
- return true;
- },
-
- get applyBackgroundUpdates() {
- if (!GMPPrefs.isSet(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, this._plugin.id)) {
- return AddonManager.AUTOUPDATE_DEFAULT;
- }
-
- return GMPPrefs.get(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, this._plugin.id) ?
- AddonManager.AUTOUPDATE_ENABLE : AddonManager.AUTOUPDATE_DISABLE;
- },
-
- set applyBackgroundUpdates(aVal) {
- if (aVal == AddonManager.AUTOUPDATE_DEFAULT) {
- GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, this._plugin.id);
- } else if (aVal == AddonManager.AUTOUPDATE_ENABLE) {
- GMPPrefs.set(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, this._plugin.id);
- } else if (aVal == AddonManager.AUTOUPDATE_DISABLE) {
- GMPPrefs.set(GMPPrefs.KEY_PLUGIN_AUTOUPDATE, false, this._plugin.id);
- }
- },
-
- findUpdates: function(aListener, aReason, aAppVersion, aPlatformVersion) {
- this._log.trace("findUpdates() - " + this._plugin.id + " - reason=" +
- aReason);
-
- AddonManagerPrivate.callNoUpdateListeners(this, aListener);
-
- if (aReason === AddonManager.UPDATE_WHEN_PERIODIC_UPDATE) {
- if (!AddonManager.shouldAutoUpdate(this)) {
- this._log.trace("findUpdates() - " + this._plugin.id +
- " - no autoupdate");
- return Promise.resolve(false);
- }
-
- let secSinceLastCheck =
- Date.now() / 1000 - Preferences.get(GMPPrefs.KEY_UPDATE_LAST_CHECK, 0);
- if (secSinceLastCheck <= SEC_IN_A_DAY) {
- this._log.trace("findUpdates() - " + this._plugin.id +
- " - last check was less then a day ago");
- return Promise.resolve(false);
- }
- } else if (aReason !== AddonManager.UPDATE_WHEN_USER_REQUESTED) {
- this._log.trace("findUpdates() - " + this._plugin.id +
- " - the given reason to update is not supported");
- return Promise.resolve(false);
- }
-
- if (this._updateTask !== null) {
- this._log.trace("findUpdates() - " + this._plugin.id +
- " - update task already running");
- return this._updateTask;
- }
-
- this._updateTask = Task.spawn(function*() {
- this._log.trace("findUpdates() - updateTask");
- try {
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- let update = res.gmpAddons.find(addon => addon.id === this._plugin.id);
- if (update && update.isValid && !update.isInstalled) {
- this._log.trace("findUpdates() - found update for " +
- this._plugin.id + ", installing");
- yield installManager.installAddon(update);
- } else {
- this._log.trace("findUpdates() - no updates for " + this._plugin.id);
- }
- this._log.info("findUpdates() - updateTask succeeded for " +
- this._plugin.id);
- } catch (e) {
- this._log.error("findUpdates() - updateTask for " + this._plugin.id +
- " threw", e);
- throw e;
- } finally {
- this._updateTask = null;
- return true;
- }
- }.bind(this));
-
- return this._updateTask;
- },
-
- get pluginMimeTypes() { return []; },
- get pluginLibraries() {
- if (this.isInstalled) {
- let path = this.version;
- return [path];
- }
- return [];
- },
- get pluginFullpath() {
- if (this.isInstalled) {
- let path = OS.Path.join(OS.Constants.Path.profileDir,
- this._plugin.id,
- this.version);
- return [path];
- }
- return [];
- },
-
- get isInstalled() {
- return this.version && this.version.length > 0;
- },
-
- _handleEnabledChanged: function() {
- this._log.info("_handleEnabledChanged() id=" +
- this._plugin.id + " isActive=" + this.isActive);
-
- AddonManagerPrivate.callAddonListeners(this.isActive ?
- "onEnabling" : "onDisabling",
- this, false);
- if (this._gmpPath) {
- if (this.isActive) {
- this._log.info("onPrefEnabledChanged() - adding gmp directory " +
- this._gmpPath);
- gmpService.addPluginDirectory(this._gmpPath);
- } else {
- this._log.info("onPrefEnabledChanged() - removing gmp directory " +
- this._gmpPath);
- gmpService.removePluginDirectory(this._gmpPath);
- }
- }
- AddonManagerPrivate.callAddonListeners(this.isActive ?
- "onEnabled" : "onDisabled",
- this);
- },
-
- onPrefEMEGlobalEnabledChanged: function() {
- this._log.info("onPrefEMEGlobalEnabledChanged() id=" + this._plugin.id +
- " appDisabled=" + this.appDisabled + " isActive=" + this.isActive +
- " hidden=" + GMPUtils.isPluginHidden(this._plugin));
-
- AddonManagerPrivate.callAddonListeners("onPropertyChanged", this,
- ["appDisabled"]);
- // If EME or the GMP itself are disabled, uninstall the GMP.
- // Otherwise, check for updates, so we download and install the GMP.
- if (this.appDisabled) {
- this.uninstallPlugin();
- } else if (!GMPUtils.isPluginHidden(this._plugin)) {
- AddonManagerPrivate.callInstallListeners("onExternalInstall", null, this,
- null, false);
- AddonManagerPrivate.callAddonListeners("onInstalling", this, false);
- AddonManagerPrivate.callAddonListeners("onInstalled", this);
- this.checkForUpdates(GMP_CHECK_DELAY);
- }
- if (!this.userDisabled) {
- this._handleEnabledChanged();
- }
- },
-
- checkForUpdates: function(delay) {
- if (this._isUpdateCheckPending) {
- return;
- }
- this._isUpdateCheckPending = true;
- GMPPrefs.reset(GMPPrefs.KEY_UPDATE_LAST_CHECK, null);
- // Delay this in case the user changes his mind and doesn't want to
- // enable EME after all.
- setTimeout(() => {
- if (!this.appDisabled) {
- let gmpInstallManager = new GMPInstallManager();
- // We don't really care about the results, if someone is interested
- // they can check the log.
- gmpInstallManager.simpleCheckAndInstall().then(null, () => {});
- }
- this._isUpdateCheckPending = false;
- }, delay);
- },
-
- receiveMessage: function({target: browser, data: data}) {
- this._log.trace("receiveMessage() data=" + data);
- let parsedData;
- try {
- parsedData = JSON.parse(data);
- } catch (ex) {
- this._log.error("Malformed EME video message with data: " + data);
- return;
- }
- let {status: status, keySystem: keySystem} = parsedData;
- if (status == "cdm-not-installed") {
- this.checkForUpdates(0);
- }
- },
-
- onPrefEnabledChanged: function() {
- if (!this._plugin.isEME || !this.appDisabled) {
- this._handleEnabledChanged();
- }
- },
-
- onPrefVersionChanged: function() {
- AddonManagerPrivate.callAddonListeners("onUninstalling", this, false);
- if (this._gmpPath) {
- this._log.info("onPrefVersionChanged() - unregistering gmp directory " +
- this._gmpPath);
- gmpService.removeAndDeletePluginDirectory(this._gmpPath, true /* can defer */);
- }
- AddonManagerPrivate.callAddonListeners("onUninstalled", this);
-
- AddonManagerPrivate.callInstallListeners("onExternalInstall", null, this,
- null, false);
- AddonManagerPrivate.callAddonListeners("onInstalling", this, false);
- this._gmpPath = null;
- if (this.isInstalled) {
- this._gmpPath = OS.Path.join(OS.Constants.Path.profileDir,
- this._plugin.id,
- GMPPrefs.get(GMPPrefs.KEY_PLUGIN_VERSION,
- null, this._plugin.id));
- }
- if (this._gmpPath && this.isActive) {
- this._log.info("onPrefVersionChanged() - registering gmp directory " +
- this._gmpPath);
- gmpService.addPluginDirectory(this._gmpPath);
- }
- AddonManagerPrivate.callAddonListeners("onInstalled", this);
- },
-
- uninstallPlugin: function() {
- AddonManagerPrivate.callAddonListeners("onUninstalling", this, false);
- if (this.gmpPath) {
- this._log.info("uninstallPlugin() - unregistering gmp directory " +
- this.gmpPath);
- gmpService.removeAndDeletePluginDirectory(this.gmpPath);
- }
- GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_VERSION, this.id);
- GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_ABI, this.id);
- GMPPrefs.reset(GMPPrefs.KEY_PLUGIN_LAST_UPDATE, this.id);
- AddonManagerPrivate.callAddonListeners("onUninstalled", this);
- },
-
- shutdown: function() {
- Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_ENABLED,
- this._plugin.id),
- this.onPrefEnabledChanged, this);
- Preferences.ignore(GMPPrefs.getPrefKey(GMPPrefs.KEY_PLUGIN_VERSION,
- this._plugin.id),
- this.onPrefVersionChanged, this);
- if (this._plugin.isEME) {
- Preferences.ignore(GMPPrefs.KEY_EME_ENABLED,
- this.onPrefEMEGlobalEnabledChanged, this);
- messageManager.removeMessageListener("EMEVideo:ContentMediaKeysRequest", this);
- }
- return this._updateTask;
- },
-
- _arePluginFilesOnDisk: function() {
- let fileExists = function(aGmpPath, aFileName) {
- let f = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- let path = OS.Path.join(aGmpPath, aFileName);
- f.initWithPath(path);
- return f.exists();
- };
-
- let id = this._plugin.id.substring(4);
- let libName = AppConstants.DLL_PREFIX + id + AppConstants.DLL_SUFFIX;
- let infoName;
- if (this._plugin.id == WIDEVINE_ID) {
- infoName = "manifest.json";
- } else {
- infoName = id + ".info";
- }
-
- return fileExists(this.gmpPath, libName) &&
- fileExists(this.gmpPath, infoName) &&
- (this._plugin.id != EME_ADOBE_ID || fileExists(this.gmpPath, id + ".voucher"));
- },
-
- validate: function() {
- if (!this.isInstalled) {
- // Not installed -> Valid.
- return {
- installed: false,
- valid: true
- };
- }
-
- let abi = GMPPrefs.get(GMPPrefs.KEY_PLUGIN_ABI, UpdateUtils.ABI, this._plugin.id);
- if (abi != UpdateUtils.ABI) {
- // ABI doesn't match. Possibly this is a profile migrated across platforms
- // or from 32 -> 64 bit.
- return {
- installed: true,
- mismatchedABI: true,
- valid: false
- };
- }
-
- // Installed -> Check if files are missing.
- let filesOnDisk = this._arePluginFilesOnDisk();
- return {
- installed: true,
- valid: filesOnDisk
- };
- },
-};
-
-var GMPProvider = {
- get name() { return "GMPProvider"; },
-
- _plugins: null,
-
- startup: function() {
- configureLogging();
- this._log = Log.repository.getLoggerWithMessagePrefix("Toolkit.GMP",
- "GMPProvider.");
- this.buildPluginList();
- this.ensureProperCDMInstallState();
-
- Preferences.observe(GMPPrefs.KEY_LOG_BASE, configureLogging);
-
- for (let [id, plugin] of this._plugins) {
- let wrapper = plugin.wrapper;
- let gmpPath = wrapper.gmpPath;
- let isEnabled = wrapper.isActive;
- this._log.trace("startup - enabled=" + isEnabled + ", gmpPath=" +
- gmpPath);
-
- if (gmpPath && isEnabled) {
- let validation = wrapper.validate();
- if (validation.mismatchedABI) {
- this._log.info("startup - gmp " + plugin.id +
- " mismatched ABI, uninstalling");
- wrapper.uninstallPlugin();
- continue;
- }
- if (!validation.valid) {
- this._log.info("startup - gmp " + plugin.id +
- " invalid, uninstalling");
- wrapper.uninstallPlugin();
- continue;
- }
- this._log.info("startup - adding gmp directory " + gmpPath);
- try {
- gmpService.addPluginDirectory(gmpPath);
- } catch (e) {
- if (e.name != 'NS_ERROR_NOT_AVAILABLE')
- throw e;
- this._log.warn("startup - adding gmp directory failed with " +
- e.name + " - sandboxing not available?", e);
- }
- }
- }
-
- try {
- let greDir = Services.dirsvc.get(NS_GRE_DIR,
- Ci.nsILocalFile);
- let clearkeyPath = OS.Path.join(greDir.path,
- CLEARKEY_PLUGIN_ID,
- CLEARKEY_VERSION);
- this._log.info("startup - adding clearkey CDM directory " +
- clearkeyPath);
- gmpService.addPluginDirectory(clearkeyPath);
- } catch (e) {
- this._log.warn("startup - adding clearkey CDM failed", e);
- }
- },
-
- shutdown: function() {
- this._log.trace("shutdown");
- Preferences.ignore(GMPPrefs.KEY_LOG_BASE, configureLogging);
-
- let shutdownTask = Task.spawn(function*() {
- this._log.trace("shutdown - shutdownTask");
- let shutdownSucceeded = true;
-
- for (let plugin of this._plugins.values()) {
- try {
- yield plugin.wrapper.shutdown();
- } catch (e) {
- shutdownSucceeded = false;
- }
- }
-
- this._plugins = null;
-
- if (!shutdownSucceeded) {
- throw new Error("Shutdown failed");
- }
- }.bind(this));
-
- return shutdownTask;
- },
-
- getAddonByID: function(aId, aCallback) {
- if (!this.isEnabled) {
- aCallback(null);
- return;
- }
-
- let plugin = this._plugins.get(aId);
- if (plugin && !GMPUtils.isPluginHidden(plugin)) {
- aCallback(plugin.wrapper);
- } else {
- aCallback(null);
- }
- },
-
- getAddonsByTypes: function(aTypes, aCallback) {
- if (!this.isEnabled ||
- (aTypes && aTypes.indexOf("plugin") < 0)) {
- aCallback([]);
- return;
- }
-
- let results = Array.from(this._plugins.values())
- .filter(p => !GMPUtils.isPluginHidden(p))
- .map(p => p.wrapper);
-
- aCallback(results);
- },
-
- get isEnabled() {
- return GMPPrefs.get(GMPPrefs.KEY_PROVIDER_ENABLED, false);
- },
-
- generateFullDescription: function(aPlugin) {
- let rv = [];
- for (let [urlProp, labelId] of [["learnMoreURL", GMP_LEARN_MORE],
- ["licenseURL", aPlugin.id == WIDEVINE_ID ?
- GMP_PRIVACY_INFO : GMP_LICENSE_INFO]]) {
- if (aPlugin[urlProp]) {
- let label = pluginsBundle.GetStringFromName(labelId);
- rv.push(`<xhtml:a href="${aPlugin[urlProp]}" target="_blank">${label}</xhtml:a>.`);
- }
- }
- return rv.length ? rv.join("<xhtml:br /><xhtml:br />") : undefined;
- },
-
- buildPluginList: function() {
- this._plugins = new Map();
- for (let aPlugin of GMP_PLUGINS) {
- let plugin = {
- id: aPlugin.id,
- name: pluginsBundle.GetStringFromName(aPlugin.name),
- description: pluginsBundle.GetStringFromName(aPlugin.description),
- homepageURL: aPlugin.homepageURL,
- optionsURL: aPlugin.optionsURL,
- wrapper: null,
- isEME: aPlugin.isEME,
- };
- plugin.fullDescription = this.generateFullDescription(aPlugin);
- plugin.wrapper = new GMPWrapper(plugin);
- this._plugins.set(plugin.id, plugin);
- }
- },
-
- ensureProperCDMInstallState: function() {
- if (!GMPPrefs.get(GMPPrefs.KEY_EME_ENABLED, true)) {
- for (let [id, plugin] of this._plugins) {
- if (plugin.isEME && plugin.wrapper.isInstalled) {
- gmpService.addPluginDirectory(plugin.wrapper.gmpPath);
- plugin.wrapper.uninstallPlugin();
- }
- }
- }
- },
-};
-
-AddonManagerPrivate.registerProvider(GMPProvider, [
- new AddonManagerPrivate.AddonType("plugin", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 6000,
- AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE)
-]);
diff --git a/toolkit/mozapps/webextensions/internal/LightweightThemeImageOptimizer.jsm b/toolkit/mozapps/webextensions/internal/LightweightThemeImageOptimizer.jsm
deleted file mode 100644
index 49dfa237fe..0000000000
--- a/toolkit/mozapps/webextensions/internal/LightweightThemeImageOptimizer.jsm
+++ /dev/null
@@ -1,180 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["LightweightThemeImageOptimizer"];
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-
-const ORIGIN_TOP_RIGHT = 1;
-const ORIGIN_BOTTOM_LEFT = 2;
-
-this.LightweightThemeImageOptimizer = {
- optimize: function(aThemeData, aScreen) {
- let data = Object.assign({}, aThemeData);
- if (!data.headerURL) {
- return data;
- }
-
- data.headerURL = ImageCropper.getCroppedImageURL(
- data.headerURL, aScreen, ORIGIN_TOP_RIGHT);
-
- if (data.footerURL) {
- data.footerURL = ImageCropper.getCroppedImageURL(
- data.footerURL, aScreen, ORIGIN_BOTTOM_LEFT);
- }
-
- return data;
- },
-
- purge: function() {
- let dir = FileUtils.getDir("ProfD", ["lwtheme"]);
- dir.followLinks = false;
- try {
- dir.remove(true);
- } catch (e) {}
- }
-};
-
-Object.freeze(LightweightThemeImageOptimizer);
-
-var ImageCropper = {
- _inProgress: {},
-
- getCroppedImageURL: function(aImageURL, aScreen, aOrigin) {
- // We can crop local files, only.
- if (!aImageURL.startsWith("file://")) {
- return aImageURL;
- }
-
- // Generate the cropped image's file name using its
- // base name and the current screen size.
- let uri = Services.io.newURI(aImageURL, null, null);
- let file = uri.QueryInterface(Ci.nsIFileURL).file;
-
- // Make sure the source file exists.
- if (!file.exists()) {
- return aImageURL;
- }
-
- let fileName = file.leafName + "-" + aScreen.width + "x" + aScreen.height;
- let croppedFile = FileUtils.getFile("ProfD", ["lwtheme", fileName]);
-
- // If we have a local file that is not in progress, return it.
- if (croppedFile.exists() && !(croppedFile.path in this._inProgress)) {
- let fileURI = Services.io.newFileURI(croppedFile);
-
- // Copy the query part to avoid wrong caching.
- fileURI.QueryInterface(Ci.nsIURL).query = uri.query;
- return fileURI.spec;
- }
-
- // Crop the given image in the background.
- this._crop(uri, croppedFile, aScreen, aOrigin);
-
- // Return the original image while we're waiting for the cropped version
- // to be written to disk.
- return aImageURL;
- },
-
- _crop: function(aURI, aTargetFile, aScreen, aOrigin) {
- let inProgress = this._inProgress;
- inProgress[aTargetFile.path] = true;
-
- function resetInProgress() {
- delete inProgress[aTargetFile.path];
- }
-
- ImageFile.read(aURI, function(aInputStream, aContentType) {
- if (aInputStream && aContentType) {
- let image = ImageTools.decode(aInputStream, aContentType);
- if (image && image.width && image.height) {
- let stream = ImageTools.encode(image, aScreen, aOrigin, aContentType);
- if (stream) {
- ImageFile.write(aTargetFile, stream, resetInProgress);
- return;
- }
- }
- }
-
- resetInProgress();
- });
- }
-};
-
-var ImageFile = {
- read: function(aURI, aCallback) {
- this._netUtil.asyncFetch({
- uri: aURI,
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE
- }, function(aInputStream, aStatus, aRequest) {
- if (Components.isSuccessCode(aStatus) && aRequest instanceof Ci.nsIChannel) {
- let channel = aRequest.QueryInterface(Ci.nsIChannel);
- aCallback(aInputStream, channel.contentType);
- } else {
- aCallback();
- }
- });
- },
-
- write: function(aFile, aInputStream, aCallback) {
- let fos = FileUtils.openSafeFileOutputStream(aFile);
- this._netUtil.asyncCopy(aInputStream, fos, function(aResult) {
- FileUtils.closeSafeFileOutputStream(fos);
-
- // Remove the file if writing was not successful.
- if (!Components.isSuccessCode(aResult)) {
- try {
- aFile.remove(false);
- } catch (e) {}
- }
-
- aCallback();
- });
- }
-};
-
-XPCOMUtils.defineLazyModuleGetter(ImageFile, "_netUtil",
- "resource://gre/modules/NetUtil.jsm", "NetUtil");
-
-var ImageTools = {
- decode: function(aInputStream, aContentType) {
- let outParam = {value: null};
-
- try {
- this._imgTools.decodeImageData(aInputStream, aContentType, outParam);
- } catch (e) {}
-
- return outParam.value;
- },
-
- encode: function(aImage, aScreen, aOrigin, aContentType) {
- let stream;
- let width = Math.min(aImage.width, aScreen.width);
- let height = Math.min(aImage.height, aScreen.height);
- let x = aOrigin == ORIGIN_TOP_RIGHT ? aImage.width - width : 0;
-
- try {
- stream = this._imgTools.encodeCroppedImage(aImage, aContentType, x, 0,
- width, height);
- } catch (e) {}
-
- return stream;
- }
-};
-
-XPCOMUtils.defineLazyServiceGetter(ImageTools, "_imgTools",
- "@mozilla.org/image/tools;1", "imgITools");
-
diff --git a/toolkit/mozapps/webextensions/internal/PluginProvider.jsm b/toolkit/mozapps/webextensions/internal/PluginProvider.jsm
deleted file mode 100644
index 075159a9ac..0000000000
--- a/toolkit/mozapps/webextensions/internal/PluginProvider.jsm
+++ /dev/null
@@ -1,600 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-
-this.EXPORTED_SYMBOLS = [];
-
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/* globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Services.jsm");
-
-const URI_EXTENSION_STRINGS = "chrome://mozapps/locale/extensions/extensions.properties";
-const STRING_TYPE_NAME = "type.%ID%.name";
-const LIST_UPDATED_TOPIC = "plugins-list-updated";
-const FLASH_MIME_TYPE = "application/x-shockwave-flash";
-
-Cu.import("resource://gre/modules/Log.jsm");
-const LOGGER_ID = "addons.plugins";
-
-// Create a new logger for use by the Addons Plugin Provider
-// (Requires AddonManager.jsm)
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-function getIDHashForString(aStr) {
- // return the two-digit hexadecimal code for a byte
- let toHexString = charCode => ("0" + charCode.toString(16)).slice(-2);
-
- let hasher = Cc["@mozilla.org/security/hash;1"].
- createInstance(Ci.nsICryptoHash);
- hasher.init(Ci.nsICryptoHash.MD5);
- let stringStream = Cc["@mozilla.org/io/string-input-stream;1"].
- createInstance(Ci.nsIStringInputStream);
- stringStream.data = aStr ? aStr : "null";
- hasher.updateFromStream(stringStream, -1);
-
- // convert the binary hash data to a hex string.
- let binary = hasher.finish(false);
- let hash = Array.from(binary, c => toHexString(c.charCodeAt(0)));
- hash = hash.join("").toLowerCase();
- return "{" + hash.substr(0, 8) + "-" +
- hash.substr(8, 4) + "-" +
- hash.substr(12, 4) + "-" +
- hash.substr(16, 4) + "-" +
- hash.substr(20) + "}";
-}
-
-var PluginProvider = {
- get name() {
- return "PluginProvider";
- },
-
- // A dictionary mapping IDs to names and descriptions
- plugins: null,
-
- startup: function() {
- Services.obs.addObserver(this, LIST_UPDATED_TOPIC, false);
- Services.obs.addObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED, false);
- },
-
- /**
- * Called when the application is shutting down. Only necessary for tests
- * to be able to simulate a shutdown.
- */
- shutdown: function() {
- this.plugins = null;
- Services.obs.removeObserver(this, AddonManager.OPTIONS_NOTIFICATION_DISPLAYED);
- Services.obs.removeObserver(this, LIST_UPDATED_TOPIC);
- },
-
- observe: function(aSubject, aTopic, aData) {
- switch (aTopic) {
- case AddonManager.OPTIONS_NOTIFICATION_DISPLAYED:
- this.getAddonByID(aData, function(plugin) {
- if (!plugin)
- return;
-
- let libLabel = aSubject.getElementById("pluginLibraries");
- libLabel.textContent = plugin.pluginLibraries.join(", ");
-
- let typeLabel = aSubject.getElementById("pluginMimeTypes"), types = [];
- for (let type of plugin.pluginMimeTypes) {
- let extras = [type.description.trim(), type.suffixes].
- filter(x => x).join(": ");
- types.push(type.type + (extras ? " (" + extras + ")" : ""));
- }
- typeLabel.textContent = types.join(",\n");
- let showProtectedModePref = canDisableFlashProtectedMode(plugin);
- aSubject.getElementById("pluginEnableProtectedMode")
- .setAttribute("collapsed", showProtectedModePref ? "" : "true");
- });
- break;
- case LIST_UPDATED_TOPIC:
- if (this.plugins)
- this.updatePluginList();
- break;
- }
- },
-
- /**
- * Creates a PluginWrapper for a plugin object.
- */
- buildWrapper: function(aPlugin) {
- return new PluginWrapper(aPlugin.id,
- aPlugin.name,
- aPlugin.description,
- aPlugin.tags);
- },
-
- /**
- * Called to get an Addon with a particular ID.
- *
- * @param aId
- * The ID of the add-on to retrieve
- * @param aCallback
- * A callback to pass the Addon to
- */
- getAddonByID: function(aId, aCallback) {
- if (!this.plugins)
- this.buildPluginList();
-
- if (aId in this.plugins)
- aCallback(this.buildWrapper(this.plugins[aId]));
- else
- aCallback(null);
- },
-
- /**
- * Called to get Addons of a particular type.
- *
- * @param aTypes
- * An array of types to fetch. Can be null to get all types.
- * @param callback
- * A callback to pass an array of Addons to
- */
- getAddonsByTypes: function(aTypes, aCallback) {
- if (aTypes && aTypes.indexOf("plugin") < 0) {
- aCallback([]);
- return;
- }
-
- if (!this.plugins)
- this.buildPluginList();
-
- let results = [];
-
- for (let id in this.plugins)
- this.getAddonByID(id, (addon) => results.push(addon));
-
- aCallback(results);
- },
-
- /**
- * Called to get Addons that have pending operations.
- *
- * @param aTypes
- * An array of types to fetch. Can be null to get all types
- * @param aCallback
- * A callback to pass an array of Addons to
- */
- getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
- aCallback([]);
- },
-
- /**
- * Called to get the current AddonInstalls, optionally restricting by type.
- *
- * @param aTypes
- * An array of types or null to get all types
- * @param aCallback
- * A callback to pass the array of AddonInstalls to
- */
- getInstallsByTypes: function(aTypes, aCallback) {
- aCallback([]);
- },
-
- /**
- * Builds a list of the current plugins reported by the plugin host
- *
- * @return a dictionary of plugins indexed by our generated ID
- */
- getPluginList: function() {
- let tags = Cc["@mozilla.org/plugin/host;1"].
- getService(Ci.nsIPluginHost).
- getPluginTags({});
-
- let list = {};
- let seenPlugins = {};
- for (let tag of tags) {
- if (!(tag.name in seenPlugins))
- seenPlugins[tag.name] = {};
- if (!(tag.description in seenPlugins[tag.name])) {
- let plugin = {
- id: getIDHashForString(tag.name + tag.description),
- name: tag.name,
- description: tag.description,
- tags: [tag]
- };
-
- seenPlugins[tag.name][tag.description] = plugin;
- list[plugin.id] = plugin;
- }
- else {
- seenPlugins[tag.name][tag.description].tags.push(tag);
- }
- }
-
- return list;
- },
-
- /**
- * Builds the list of known plugins from the plugin host
- */
- buildPluginList: function() {
- this.plugins = this.getPluginList();
- },
-
- /**
- * Updates the plugins from the plugin host by comparing the current plugins
- * to the last known list sending out any necessary API notifications for
- * changes.
- */
- updatePluginList: function() {
- let newList = this.getPluginList();
-
- let lostPlugins = Object.keys(this.plugins).filter(id => !(id in newList)).
- map(id => this.buildWrapper(this.plugins[id]));
- let newPlugins = Object.keys(newList).filter(id => !(id in this.plugins)).
- map(id => this.buildWrapper(newList[id]));
- let matchedIDs = Object.keys(newList).filter(id => id in this.plugins);
-
- // The plugin host generates new tags for every plugin after a scan and
- // if the plugin's filename has changed then the disabled state won't have
- // been carried across, send out notifications for anything that has
- // changed (see bug 830267).
- let changedWrappers = [];
- for (let id of matchedIDs) {
- let oldWrapper = this.buildWrapper(this.plugins[id]);
- let newWrapper = this.buildWrapper(newList[id]);
-
- if (newWrapper.isActive != oldWrapper.isActive) {
- AddonManagerPrivate.callAddonListeners(newWrapper.isActive ?
- "onEnabling" : "onDisabling",
- newWrapper, false);
- changedWrappers.push(newWrapper);
- }
- }
-
- // Notify about new installs
- for (let plugin of newPlugins) {
- AddonManagerPrivate.callInstallListeners("onExternalInstall", null,
- plugin, null, false);
- AddonManagerPrivate.callAddonListeners("onInstalling", plugin, false);
- }
-
- // Notify for any plugins that have vanished.
- for (let plugin of lostPlugins)
- AddonManagerPrivate.callAddonListeners("onUninstalling", plugin, false);
-
- this.plugins = newList;
-
- // Signal that new installs are complete
- for (let plugin of newPlugins)
- AddonManagerPrivate.callAddonListeners("onInstalled", plugin);
-
- // Signal that enables/disables are complete
- for (let wrapper of changedWrappers) {
- AddonManagerPrivate.callAddonListeners(wrapper.isActive ?
- "onEnabled" : "onDisabled",
- wrapper);
- }
-
- // Signal that uninstalls are complete
- for (let plugin of lostPlugins)
- AddonManagerPrivate.callAddonListeners("onUninstalled", plugin);
- }
-};
-
-function isFlashPlugin(aPlugin) {
- for (let type of aPlugin.pluginMimeTypes) {
- if (type.type == FLASH_MIME_TYPE) {
- return true;
- }
- }
- return false;
-}
-// Protected mode is win32-only, not win64
-function canDisableFlashProtectedMode(aPlugin) {
- return isFlashPlugin(aPlugin) && Services.appinfo.XPCOMABI == "x86-msvc";
-}
-
-const wrapperMap = new WeakMap();
-let pluginFor = wrapper => wrapperMap.get(wrapper);
-
-/**
- * The PluginWrapper wraps a set of nsIPluginTags to provide the data visible to
- * public callers through the API.
- */
-function PluginWrapper(id, name, description, tags) {
- wrapperMap.set(this, { id, name, description, tags });
-}
-
-PluginWrapper.prototype = {
- get id() {
- return pluginFor(this).id;
- },
-
- get type() {
- return "plugin";
- },
-
- get name() {
- return pluginFor(this).name;
- },
-
- get creator() {
- return null;
- },
-
- get description() {
- return pluginFor(this).description.replace(/<\/?[a-z][^>]*>/gi, " ");
- },
-
- get version() {
- let { tags: [tag] } = pluginFor(this);
- return tag.version;
- },
-
- get homepageURL() {
- let { description } = pluginFor(this);
- if (/<A\s+HREF=[^>]*>/i.test(description))
- return /<A\s+HREF=["']?([^>"'\s]*)/i.exec(description)[1];
- return null;
- },
-
- get isActive() {
- let { tags: [tag] } = pluginFor(this);
- return !tag.blocklisted && !tag.disabled;
- },
-
- get appDisabled() {
- let { tags: [tag] } = pluginFor(this);
- return tag.blocklisted;
- },
-
- get userDisabled() {
- let { tags: [tag] } = pluginFor(this);
- if (tag.disabled)
- return true;
-
- if ((Services.prefs.getBoolPref("plugins.click_to_play") && tag.clicktoplay) ||
- this.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE ||
- this.blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE)
- return AddonManager.STATE_ASK_TO_ACTIVATE;
-
- return false;
- },
-
- set userDisabled(val) {
- let previousVal = this.userDisabled;
- if (val === previousVal)
- return val;
-
- let { tags } = pluginFor(this);
-
- for (let tag of tags) {
- if (val === true)
- tag.enabledState = Ci.nsIPluginTag.STATE_DISABLED;
- else if (val === false)
- tag.enabledState = Ci.nsIPluginTag.STATE_ENABLED;
- else if (val == AddonManager.STATE_ASK_TO_ACTIVATE)
- tag.enabledState = Ci.nsIPluginTag.STATE_CLICKTOPLAY;
- }
-
- // If 'userDisabled' was 'true' and we're going to a state that's not
- // that, we're enabling, so call those listeners.
- if (previousVal === true && val !== true) {
- AddonManagerPrivate.callAddonListeners("onEnabling", this, false);
- AddonManagerPrivate.callAddonListeners("onEnabled", this);
- }
-
- // If 'userDisabled' was not 'true' and we're going to a state where
- // it is, we're disabling, so call those listeners.
- if (previousVal !== true && val === true) {
- AddonManagerPrivate.callAddonListeners("onDisabling", this, false);
- AddonManagerPrivate.callAddonListeners("onDisabled", this);
- }
-
- // If the 'userDisabled' value involved AddonManager.STATE_ASK_TO_ACTIVATE,
- // call the onPropertyChanged listeners.
- if (previousVal == AddonManager.STATE_ASK_TO_ACTIVATE ||
- val == AddonManager.STATE_ASK_TO_ACTIVATE) {
- AddonManagerPrivate.callAddonListeners("onPropertyChanged", this, ["userDisabled"]);
- }
-
- return val;
- },
-
- get blocklistState() {
- let { tags: [tag] } = pluginFor(this);
- let bs = Cc["@mozilla.org/extensions/blocklist;1"].
- getService(Ci.nsIBlocklistService);
- return bs.getPluginBlocklistState(tag);
- },
-
- get blocklistURL() {
- let { tags: [tag] } = pluginFor(this);
- let bs = Cc["@mozilla.org/extensions/blocklist;1"].
- getService(Ci.nsIBlocklistService);
- return bs.getPluginBlocklistURL(tag);
- },
-
- get size() {
- function getDirectorySize(aFile) {
- let size = 0;
- let entries = aFile.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
- let entry;
- while ((entry = entries.nextFile)) {
- if (entry.isSymlink() || !entry.isDirectory())
- size += entry.fileSize;
- else
- size += getDirectorySize(entry);
- }
- entries.close();
- return size;
- }
-
- let size = 0;
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- for (let tag of pluginFor(this).tags) {
- file.initWithPath(tag.fullpath);
- if (file.isDirectory())
- size += getDirectorySize(file);
- else
- size += file.fileSize;
- }
- return size;
- },
-
- get pluginLibraries() {
- let libs = [];
- for (let tag of pluginFor(this).tags)
- libs.push(tag.filename);
- return libs;
- },
-
- get pluginFullpath() {
- let paths = [];
- for (let tag of pluginFor(this).tags)
- paths.push(tag.fullpath);
- return paths;
- },
-
- get pluginMimeTypes() {
- let types = [];
- for (let tag of pluginFor(this).tags) {
- let mimeTypes = tag.getMimeTypes({});
- let mimeDescriptions = tag.getMimeDescriptions({});
- let extensions = tag.getExtensions({});
- for (let i = 0; i < mimeTypes.length; i++) {
- let type = {};
- type.type = mimeTypes[i];
- type.description = mimeDescriptions[i];
- type.suffixes = extensions[i];
-
- types.push(type);
- }
- }
- return types;
- },
-
- get installDate() {
- let date = 0;
- for (let tag of pluginFor(this).tags) {
- date = Math.max(date, tag.lastModifiedTime);
- }
- return new Date(date);
- },
-
- get scope() {
- let { tags: [tag] } = pluginFor(this);
- let path = tag.fullpath;
- // Plugins inside the application directory are in the application scope
- let dir = Services.dirsvc.get("APlugns", Ci.nsIFile);
- if (path.startsWith(dir.path))
- return AddonManager.SCOPE_APPLICATION;
-
- // Plugins inside the profile directory are in the profile scope
- dir = Services.dirsvc.get("ProfD", Ci.nsIFile);
- if (path.startsWith(dir.path))
- return AddonManager.SCOPE_PROFILE;
-
- // Plugins anywhere else in the user's home are in the user scope,
- // but not all platforms have a home directory.
- try {
- dir = Services.dirsvc.get("Home", Ci.nsIFile);
- if (path.startsWith(dir.path))
- return AddonManager.SCOPE_USER;
- } catch (e) {
- if (!e.result || e.result != Components.results.NS_ERROR_FAILURE)
- throw e;
- // Do nothing: missing "Home".
- }
-
- // Any other locations are system scope
- return AddonManager.SCOPE_SYSTEM;
- },
-
- get pendingOperations() {
- return AddonManager.PENDING_NONE;
- },
-
- get operationsRequiringRestart() {
- return AddonManager.OP_NEEDS_RESTART_NONE;
- },
-
- get permissions() {
- let { tags: [tag] } = pluginFor(this);
- let permissions = 0;
- if (tag.isEnabledStateLocked) {
- return permissions;
- }
- if (!this.appDisabled) {
-
- if (this.userDisabled !== true)
- permissions |= AddonManager.PERM_CAN_DISABLE;
-
- let blocklistState = this.blocklistState;
- let isCTPBlocklisted =
- (blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_NO_UPDATE ||
- blocklistState == Ci.nsIBlocklistService.STATE_VULNERABLE_UPDATE_AVAILABLE);
-
- if (this.userDisabled !== AddonManager.STATE_ASK_TO_ACTIVATE &&
- (Services.prefs.getBoolPref("plugins.click_to_play") ||
- isCTPBlocklisted)) {
- permissions |= AddonManager.PERM_CAN_ASK_TO_ACTIVATE;
- }
-
- if (this.userDisabled !== false && !isCTPBlocklisted) {
- permissions |= AddonManager.PERM_CAN_ENABLE;
- }
- }
- return permissions;
- },
-
- get optionsType() {
- if (canDisableFlashProtectedMode(this)) {
- return AddonManager.OPTIONS_TYPE_INLINE;
- }
- return AddonManager.OPTIONS_TYPE_INLINE_INFO;
- },
-
- get optionsURL() {
- return "chrome://mozapps/content/extensions/pluginPrefs.xul";
- },
-
- get updateDate() {
- return this.installDate;
- },
-
- get isCompatible() {
- return true;
- },
-
- get isPlatformCompatible() {
- return true;
- },
-
- get providesUpdatesSecurely() {
- return true;
- },
-
- get foreignInstall() {
- return true;
- },
-
- isCompatibleWith: function(aAppVersion, aPlatformVersion) {
- return true;
- },
-
- findUpdates: function(aListener, aReason, aAppVersion, aPlatformVersion) {
- if ("onNoCompatibilityUpdateAvailable" in aListener)
- aListener.onNoCompatibilityUpdateAvailable(this);
- if ("onNoUpdateAvailable" in aListener)
- aListener.onNoUpdateAvailable(this);
- if ("onUpdateFinished" in aListener)
- aListener.onUpdateFinished(this);
- }
-};
-
-AddonManagerPrivate.registerProvider(PluginProvider, [
- new AddonManagerPrivate.AddonType("plugin", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 6000,
- AddonManager.TYPE_SUPPORTS_ASK_TO_ACTIVATE)
-]);
diff --git a/toolkit/mozapps/webextensions/internal/WebExtensionBootstrap.js b/toolkit/mozapps/webextensions/internal/WebExtensionBootstrap.js
deleted file mode 100644
index a920c2eae8..0000000000
--- a/toolkit/mozapps/webextensions/internal/WebExtensionBootstrap.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/Extension.jsm");
-
-var extension;
-
-const BOOTSTRAP_REASON_TO_STRING_MAP = {
- 1: "APP_STARTUP",
- 2: "APP_SHUTDOWN",
- 3: "ADDON_ENABLE",
- 4: "ADDON_DISABLE",
- 5: "ADDON_INSTALL",
- 6: "ADDON_UNINSTALL",
- 7: "ADDON_UPGRADE",
- 8: "ADDON_DOWNGRADE",
-}
-
-function install(data, reason)
-{
-}
-
-function startup(data, reason)
-{
- extension = new Extension(data, BOOTSTRAP_REASON_TO_STRING_MAP[reason]);
- extension.startup();
-}
-
-function shutdown(data, reason)
-{
- extension.shutdown();
-}
-
-function uninstall(data, reason)
-{
-}
diff --git a/toolkit/mozapps/webextensions/internal/XPIProvider.jsm b/toolkit/mozapps/webextensions/internal/XPIProvider.jsm
deleted file mode 100644
index c952214172..0000000000
--- a/toolkit/mozapps/webextensions/internal/XPIProvider.jsm
+++ /dev/null
@@ -1,9217 +0,0 @@
- /* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cr = Components.results;
-const Cu = Components.utils;
-
-this.EXPORTED_SYMBOLS = ["XPIProvider"];
-
-const CONSTANTS = {};
-Cu.import("resource://gre/modules/addons/AddonConstants.jsm", CONSTANTS);
-const { ADDON_SIGNING, REQUIRE_SIGNING } = CONSTANTS
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
- "resource://gre/modules/addons/AddonRepository.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ChromeManifestParser",
- "resource://gre/modules/ChromeManifestParser.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
- "resource://gre/modules/LightweightThemeManager.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionData",
- "resource://gre/modules/Extension.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ExtensionManagement",
- "resource://gre/modules/ExtensionManagement.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Locale",
- "resource://gre/modules/Locale.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ZipUtils",
- "resource://gre/modules/ZipUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PermissionsUtils",
- "resource://gre/modules/PermissionsUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "BrowserToolboxProcess",
- "resource://devtools/client/framework/ToolboxProcess.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ConsoleAPI",
- "resource://gre/modules/Console.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "ProductAddonChecker",
- "resource://gre/modules/addons/ProductAddonChecker.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "UpdateUtils",
- "resource://gre/modules/UpdateUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LegacyExtensionsUtils",
- "resource://gre/modules/LegacyExtensionsUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "Blocklist",
- "@mozilla.org/extensions/blocklist;1",
- Ci.nsIBlocklistService);
-XPCOMUtils.defineLazyServiceGetter(this,
- "ChromeRegistry",
- "@mozilla.org/chrome/chrome-registry;1",
- "nsIChromeRegistry");
-XPCOMUtils.defineLazyServiceGetter(this,
- "ResProtocolHandler",
- "@mozilla.org/network/protocol;1?name=resource",
- "nsIResProtocolHandler");
-XPCOMUtils.defineLazyServiceGetter(this,
- "AddonPolicyService",
- "@mozilla.org/addons/policy-service;1",
- "nsIAddonPolicyService");
-XPCOMUtils.defineLazyServiceGetter(this,
- "AddonPathService",
- "@mozilla.org/addon-path-service;1",
- "amIAddonPathService");
-
-XPCOMUtils.defineLazyGetter(this, "CertUtils", function() {
- let certUtils = {};
- Components.utils.import("resource://gre/modules/CertUtils.jsm", certUtils);
- return certUtils;
-});
-
-Cu.importGlobalProperties(["URL"]);
-
-const nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile",
- "initWithPath");
-
-const PREF_DB_SCHEMA = "extensions.databaseSchema";
-const PREF_INSTALL_CACHE = "extensions.installCache";
-const PREF_XPI_STATE = "extensions.xpiState";
-const PREF_BOOTSTRAP_ADDONS = "extensions.bootstrappedAddons";
-const PREF_PENDING_OPERATIONS = "extensions.pendingOperations";
-const PREF_EM_DSS_ENABLED = "extensions.dss.enabled";
-const PREF_DSS_SWITCHPENDING = "extensions.dss.switchPending";
-const PREF_DSS_SKIN_TO_SELECT = "extensions.lastSelectedSkin";
-const PREF_GENERAL_SKINS_SELECTEDSKIN = "general.skins.selectedSkin";
-const PREF_EM_UPDATE_URL = "extensions.update.url";
-const PREF_EM_UPDATE_BACKGROUND_URL = "extensions.update.background.url";
-const PREF_EM_ENABLED_ADDONS = "extensions.enabledAddons";
-const PREF_EM_EXTENSION_FORMAT = "extensions.";
-const PREF_EM_ENABLED_SCOPES = "extensions.enabledScopes";
-const PREF_EM_SHOW_MISMATCH_UI = "extensions.showMismatchUI";
-const PREF_XPI_ENABLED = "xpinstall.enabled";
-const PREF_XPI_WHITELIST_REQUIRED = "xpinstall.whitelist.required";
-const PREF_XPI_DIRECT_WHITELISTED = "xpinstall.whitelist.directRequest";
-const PREF_XPI_FILE_WHITELISTED = "xpinstall.whitelist.fileRequest";
-// xpinstall.signatures.required only supported in dev builds
-const PREF_XPI_SIGNATURES_REQUIRED = "xpinstall.signatures.required";
-const PREF_XPI_SIGNATURES_DEV_ROOT = "xpinstall.signatures.dev-root";
-const PREF_XPI_PERMISSIONS_BRANCH = "xpinstall.";
-const PREF_XPI_UNPACK = "extensions.alwaysUnpack";
-const PREF_INSTALL_REQUIREBUILTINCERTS = "extensions.install.requireBuiltInCerts";
-const PREF_INSTALL_REQUIRESECUREORIGIN = "extensions.install.requireSecureOrigin";
-const PREF_INSTALL_DISTRO_ADDONS = "extensions.installDistroAddons";
-const PREF_BRANCH_INSTALLED_ADDON = "extensions.installedDistroAddon.";
-const PREF_INTERPOSITION_ENABLED = "extensions.interposition.enabled";
-const PREF_SYSTEM_ADDON_SET = "extensions.systemAddonSet";
-const PREF_SYSTEM_ADDON_UPDATE_URL = "extensions.systemAddon.update.url";
-
-const PREF_EM_MIN_COMPAT_APP_VERSION = "extensions.minCompatibleAppVersion";
-const PREF_EM_MIN_COMPAT_PLATFORM_VERSION = "extensions.minCompatiblePlatformVersion";
-
-const PREF_EM_HOTFIX_ID = "extensions.hotfix.id";
-const PREF_EM_CERT_CHECKATTRIBUTES = "extensions.hotfix.cert.checkAttributes";
-const PREF_EM_HOTFIX_CERTS = "extensions.hotfix.certs.";
-
-const URI_EXTENSION_UPDATE_DIALOG = "chrome://mozapps/content/extensions/update.xul";
-const URI_EXTENSION_STRINGS = "chrome://mozapps/locale/extensions/extensions.properties";
-
-const STRING_TYPE_NAME = "type.%ID%.name";
-
-const DIR_EXTENSIONS = "extensions";
-const DIR_SYSTEM_ADDONS = "features";
-const DIR_STAGE = "staged";
-const DIR_TRASH = "trash";
-
-const FILE_DATABASE = "extensions.json";
-const FILE_OLD_CACHE = "extensions.cache";
-const FILE_RDF_MANIFEST = "install.rdf";
-const FILE_WEB_MANIFEST = "manifest.json";
-const FILE_XPI_ADDONS_LIST = "extensions.ini";
-
-const KEY_PROFILEDIR = "ProfD";
-const KEY_ADDON_APP_DIR = "XREAddonAppDir";
-const KEY_TEMPDIR = "TmpD";
-const KEY_APP_DISTRIBUTION = "XREAppDist";
-const KEY_APP_FEATURES = "XREAppFeat";
-
-const KEY_APP_PROFILE = "app-profile";
-const KEY_APP_SYSTEM_ADDONS = "app-system-addons";
-const KEY_APP_SYSTEM_DEFAULTS = "app-system-defaults";
-const KEY_APP_GLOBAL = "app-global";
-const KEY_APP_SYSTEM_LOCAL = "app-system-local";
-const KEY_APP_SYSTEM_SHARE = "app-system-share";
-const KEY_APP_SYSTEM_USER = "app-system-user";
-const KEY_APP_TEMPORARY = "app-temporary";
-
-const NOTIFICATION_FLUSH_PERMISSIONS = "flush-pending-permissions";
-const XPI_PERMISSION = "install";
-
-const RDFURI_INSTALL_MANIFEST_ROOT = "urn:mozilla:install-manifest";
-const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
-
-const TOOLKIT_ID = "toolkit@mozilla.org";
-const WEBEXTENSIONS_ID = "webextensions@mozilla.org";
-const WEBEXTENSIONS_VERSION = "52.0";
-
-const XPI_SIGNATURE_CHECK_PERIOD = 24 * 60 * 60;
-
-XPCOMUtils.defineConstant(this, "DB_SCHEMA", 19);
-
-const NOTIFICATION_TOOLBOXPROCESS_LOADED = "ToolboxProcessLoaded";
-
-// Properties that exist in the install manifest
-const PROP_METADATA = ["id", "version", "type", "internalName", "updateURL",
- "updateKey", "optionsURL", "optionsType", "aboutURL",
- "iconURL", "icon64URL"];
-const PROP_LOCALE_SINGLE = ["name", "description", "creator", "homepageURL"];
-const PROP_LOCALE_MULTI = ["developers", "translators", "contributors"];
-const PROP_TARGETAPP = ["id", "minVersion", "maxVersion"];
-
-// Properties to cache and reload when an addon installation is pending
-const PENDING_INSTALL_METADATA =
- ["syncGUID", "targetApplications", "userDisabled", "softDisabled",
- "existingAddonID", "sourceURI", "releaseNotesURI", "installDate",
- "updateDate", "applyBackgroundUpdates", "compatibilityOverrides"];
-
-// Note: When adding/changing/removing items here, remember to change the
-// DB schema version to ensure changes are picked up ASAP.
-const STATIC_BLOCKLIST_PATTERNS = [
- { creator: "Mozilla Corp.",
- level: Blocklist.STATE_BLOCKED,
- blockID: "i162" },
- { creator: "Mozilla.org",
- level: Blocklist.STATE_BLOCKED,
- blockID: "i162" }
-];
-
-
-const BOOTSTRAP_REASONS = {
- APP_STARTUP : 1,
- APP_SHUTDOWN : 2,
- ADDON_ENABLE : 3,
- ADDON_DISABLE : 4,
- ADDON_INSTALL : 5,
- ADDON_UNINSTALL : 6,
- ADDON_UPGRADE : 7,
- ADDON_DOWNGRADE : 8
-};
-
-// Map new string type identifiers to old style nsIUpdateItem types
-const TYPES = {
- extension: 2,
- theme: 4,
- locale: 8,
- multipackage: 32,
- dictionary: 64,
- experiment: 128,
-};
-
-if (!AppConstants.RELEASE_OR_BETA)
- TYPES.apiextension = 256;
-
-// Some add-on types that we track internally are presented as other types
-// externally
-const TYPE_ALIASES = {
- "webextension": "extension",
- "apiextension": "extension",
-};
-
-const CHROME_TYPES = new Set([
- "extension",
- "locale",
- "experiment",
-]);
-
-const RESTARTLESS_TYPES = new Set([
- "webextension",
- "dictionary",
- "experiment",
- "locale",
- "apiextension",
-]);
-
-const SIGNED_TYPES = new Set([
- "webextension",
- "extension",
- "experiment",
- "apiextension",
-]);
-
-// This is a random number array that can be used as "salt" when generating
-// an automatic ID based on the directory path of an add-on. It will prevent
-// someone from creating an ID for a permanent add-on that could be replaced
-// by a temporary add-on (because that would be confusing, I guess).
-const TEMP_INSTALL_ID_GEN_SESSION =
- new Uint8Array(Float64Array.of(Math.random()).buffer);
-
-// Whether add-on signing is required.
-function mustSign(aType) {
- if (!SIGNED_TYPES.has(aType))
- return false;
- return REQUIRE_SIGNING || Preferences.get(PREF_XPI_SIGNATURES_REQUIRED, false);
-}
-
-// Keep track of where we are in startup for telemetry
-// event happened during XPIDatabase.startup()
-const XPI_STARTING = "XPIStarting";
-// event happened after startup() but before the final-ui-startup event
-const XPI_BEFORE_UI_STARTUP = "BeforeFinalUIStartup";
-// event happened after final-ui-startup
-const XPI_AFTER_UI_STARTUP = "AfterFinalUIStartup";
-
-const COMPATIBLE_BY_DEFAULT_TYPES = {
- extension: true,
- dictionary: true
-};
-
-const MSG_JAR_FLUSH = "AddonJarFlush";
-const MSG_MESSAGE_MANAGER_CACHES_FLUSH = "AddonMessageManagerCachesFlush";
-
-var gGlobalScope = this;
-
-/**
- * Valid IDs fit this pattern.
- */
-var gIDTest = /^(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\}|[a-z0-9-\._]*\@[a-z0-9-\._]+)$/i;
-
-Cu.import("resource://gre/modules/Log.jsm");
-const LOGGER_ID = "addons.xpi";
-
-// Create a new logger for use by all objects in this Addons XPI Provider module
-// (Requires AddonManager.jsm)
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-const LAZY_OBJECTS = ["XPIDatabase", "XPIDatabaseReconcile"];
-/* globals XPIDatabase, XPIDatabaseReconcile*/
-
-var gLazyObjectsLoaded = false;
-
-function loadLazyObjects() {
- let uri = "resource://gre/modules/addons/XPIProviderUtils.js";
- let scope = Cu.Sandbox(Services.scriptSecurityManager.getSystemPrincipal(), {
- sandboxName: uri,
- wantGlobalProperties: ["TextDecoder"],
- });
-
- let shared = {
- ADDON_SIGNING,
- SIGNED_TYPES,
- BOOTSTRAP_REASONS,
- DB_SCHEMA,
- AddonInternal,
- XPIProvider,
- XPIStates,
- syncLoadManifestFromFile,
- isUsableAddon,
- recordAddonTelemetry,
- applyBlocklistChanges,
- flushChromeCaches,
- canRunInSafeMode,
- }
-
- for (let key of Object.keys(shared))
- scope[key] = shared[key];
-
- Services.scriptloader.loadSubScript(uri, scope);
-
- for (let name of LAZY_OBJECTS) {
- delete gGlobalScope[name];
- gGlobalScope[name] = scope[name];
- }
- gLazyObjectsLoaded = true;
- return scope;
-}
-
-LAZY_OBJECTS.forEach(name => {
- Object.defineProperty(gGlobalScope, name, {
- get: function() {
- let objs = loadLazyObjects();
- return objs[name];
- },
- configurable: true
- });
-});
-
-
-// Behaves like Promise.all except waits for all promises to resolve/reject
-// before resolving/rejecting itself
-function waitForAllPromises(promises) {
- return new Promise((resolve, reject) => {
- let shouldReject = false;
- let rejectValue = null;
-
- let newPromises = promises.map(
- p => p.catch(value => {
- shouldReject = true;
- rejectValue = value;
- })
- );
- Promise.all(newPromises)
- .then((results) => shouldReject ? reject(rejectValue) : resolve(results));
- });
-}
-
-function findMatchingStaticBlocklistItem(aAddon) {
- for (let item of STATIC_BLOCKLIST_PATTERNS) {
- if ("creator" in item && typeof item.creator == "string") {
- if ((aAddon.defaultLocale && aAddon.defaultLocale.creator == item.creator) ||
- (aAddon.selectedLocale && aAddon.selectedLocale.creator == item.creator)) {
- return item;
- }
- }
- }
- return null;
-}
-
-/**
- * Converts an iterable of addon objects into a map with the add-on's ID as key.
- */
-function addonMap(addons) {
- return new Map(addons.map(a => [a.id, a]));
-}
-
-/**
- * Sets permissions on a file
- *
- * @param aFile
- * The file or directory to operate on.
- * @param aPermissions
- * The permisions to set
- */
-function setFilePermissions(aFile, aPermissions) {
- try {
- aFile.permissions = aPermissions;
- }
- catch (e) {
- logger.warn("Failed to set permissions " + aPermissions.toString(8) + " on " +
- aFile.path, e);
- }
-}
-
-/**
- * Write a given string to a file
- *
- * @param file
- * The nsIFile instance to write into
- * @param string
- * The string to write
- */
-function writeStringToFile(file, string) {
- let stream = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- let converter = Cc["@mozilla.org/intl/converter-output-stream;1"].
- createInstance(Ci.nsIConverterOutputStream);
-
- try {
- stream.init(file, FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE |
- FileUtils.MODE_TRUNCATE, FileUtils.PERMS_FILE,
- 0);
- converter.init(stream, "UTF-8", 0, 0x0000);
- converter.writeString(string);
- }
- finally {
- converter.close();
- stream.close();
- }
-}
-
-/**
- * A safe way to install a file or the contents of a directory to a new
- * directory. The file or directory is moved or copied recursively and if
- * anything fails an attempt is made to rollback the entire operation. The
- * operation may also be rolled back to its original state after it has
- * completed by calling the rollback method.
- *
- * Operations can be chained. Calling move or copy multiple times will remember
- * the whole set and if one fails all of the operations will be rolled back.
- */
-function SafeInstallOperation() {
- this._installedFiles = [];
- this._createdDirs = [];
-}
-
-SafeInstallOperation.prototype = {
- _installedFiles: null,
- _createdDirs: null,
-
- _installFile: function(aFile, aTargetDirectory, aCopy) {
- let oldFile = aCopy ? null : aFile.clone();
- let newFile = aFile.clone();
- try {
- if (aCopy) {
- newFile.copyTo(aTargetDirectory, null);
- // copyTo does not update the nsIFile with the new.
- newFile = aTargetDirectory.clone();
- newFile.append(aFile.leafName);
- // Windows roaming profiles won't properly sync directories if a new file
- // has an older lastModifiedTime than a previous file, so update.
- newFile.lastModifiedTime = Date.now();
- }
- else {
- newFile.moveTo(aTargetDirectory, null);
- }
- }
- catch (e) {
- logger.error("Failed to " + (aCopy ? "copy" : "move") + " file " + aFile.path +
- " to " + aTargetDirectory.path, e);
- throw e;
- }
- this._installedFiles.push({ oldFile: oldFile, newFile: newFile });
- },
-
- _installDirectory: function(aDirectory, aTargetDirectory, aCopy) {
- if (aDirectory.contains(aTargetDirectory)) {
- let err = new Error(`Not installing ${aDirectory} into its own descendent ${aTargetDirectory}`);
- logger.error(err);
- throw err;
- }
-
- let newDir = aTargetDirectory.clone();
- newDir.append(aDirectory.leafName);
- try {
- newDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- }
- catch (e) {
- logger.error("Failed to create directory " + newDir.path, e);
- throw e;
- }
- this._createdDirs.push(newDir);
-
- // Use a snapshot of the directory contents to avoid possible issues with
- // iterating over a directory while removing files from it (the YAFFS2
- // embedded filesystem has this issue, see bug 772238), and to remove
- // normal files before their resource forks on OSX (see bug 733436).
- let entries = getDirectoryEntries(aDirectory, true);
- for (let entry of entries) {
- try {
- this._installDirEntry(entry, newDir, aCopy);
- }
- catch (e) {
- logger.error("Failed to " + (aCopy ? "copy" : "move") + " entry " +
- entry.path, e);
- throw e;
- }
- }
-
- // If this is only a copy operation then there is nothing else to do
- if (aCopy)
- return;
-
- // The directory should be empty by this point. If it isn't this will throw
- // and all of the operations will be rolled back
- try {
- setFilePermissions(aDirectory, FileUtils.PERMS_DIRECTORY);
- aDirectory.remove(false);
- }
- catch (e) {
- logger.error("Failed to remove directory " + aDirectory.path, e);
- throw e;
- }
-
- // Note we put the directory move in after all the file moves so the
- // directory is recreated before all the files are moved back
- this._installedFiles.push({ oldFile: aDirectory, newFile: newDir });
- },
-
- _installDirEntry: function(aDirEntry, aTargetDirectory, aCopy) {
- let isDir = null;
-
- try {
- isDir = aDirEntry.isDirectory() && !aDirEntry.isSymlink();
- }
- catch (e) {
- // If the file has already gone away then don't worry about it, this can
- // happen on OSX where the resource fork is automatically moved with the
- // data fork for the file. See bug 733436.
- if (e.result == Cr.NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
- return;
-
- logger.error("Failure " + (aCopy ? "copying" : "moving") + " " + aDirEntry.path +
- " to " + aTargetDirectory.path);
- throw e;
- }
-
- try {
- if (isDir)
- this._installDirectory(aDirEntry, aTargetDirectory, aCopy);
- else
- this._installFile(aDirEntry, aTargetDirectory, aCopy);
- }
- catch (e) {
- logger.error("Failure " + (aCopy ? "copying" : "moving") + " " + aDirEntry.path +
- " to " + aTargetDirectory.path);
- throw e;
- }
- },
-
- /**
- * Moves a file or directory into a new directory. If an error occurs then all
- * files that have been moved will be moved back to their original location.
- *
- * @param aFile
- * The file or directory to be moved.
- * @param aTargetDirectory
- * The directory to move into, this is expected to be an empty
- * directory.
- */
- moveUnder: function(aFile, aTargetDirectory) {
- try {
- this._installDirEntry(aFile, aTargetDirectory, false);
- }
- catch (e) {
- this.rollback();
- throw e;
- }
- },
-
- /**
- * Renames a file to a new location. If an error occurs then all
- * files that have been moved will be moved back to their original location.
- *
- * @param aOldLocation
- * The old location of the file.
- * @param aNewLocation
- * The new location of the file.
- */
- moveTo: function(aOldLocation, aNewLocation) {
- try {
- let oldFile = aOldLocation.clone(), newFile = aNewLocation.clone();
- oldFile.moveTo(newFile.parent, newFile.leafName);
- this._installedFiles.push({ oldFile: oldFile, newFile: newFile, isMoveTo: true});
- }
- catch (e) {
- this.rollback();
- throw e;
- }
- },
-
- /**
- * Copies a file or directory into a new directory. If an error occurs then
- * all new files that have been created will be removed.
- *
- * @param aFile
- * The file or directory to be copied.
- * @param aTargetDirectory
- * The directory to copy into, this is expected to be an empty
- * directory.
- */
- copy: function(aFile, aTargetDirectory) {
- try {
- this._installDirEntry(aFile, aTargetDirectory, true);
- }
- catch (e) {
- this.rollback();
- throw e;
- }
- },
-
- /**
- * Rolls back all the moves that this operation performed. If an exception
- * occurs here then both old and new directories are left in an indeterminate
- * state
- */
- rollback: function() {
- while (this._installedFiles.length > 0) {
- let move = this._installedFiles.pop();
- if (move.isMoveTo) {
- move.newFile.moveTo(move.oldDir.parent, move.oldDir.leafName);
- }
- else if (move.newFile.isDirectory() && !move.newFile.isSymlink()) {
- let oldDir = move.oldFile.parent.clone();
- oldDir.append(move.oldFile.leafName);
- oldDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- }
- else if (!move.oldFile) {
- // No old file means this was a copied file
- move.newFile.remove(true);
- }
- else {
- move.newFile.moveTo(move.oldFile.parent, null);
- }
- }
-
- while (this._createdDirs.length > 0)
- recursiveRemove(this._createdDirs.pop());
- }
-};
-
-/**
- * Sets the userDisabled and softDisabled properties of an add-on based on what
- * values those properties had for a previous instance of the add-on. The
- * previous instance may be a previous install or in the case of an application
- * version change the same add-on.
- *
- * NOTE: this may modify aNewAddon in place; callers should save the database if
- * necessary
- *
- * @param aOldAddon
- * The previous instance of the add-on
- * @param aNewAddon
- * The new instance of the add-on
- * @param aAppVersion
- * The optional application version to use when checking the blocklist
- * or undefined to use the current application
- * @param aPlatformVersion
- * The optional platform version to use when checking the blocklist or
- * undefined to use the current platform
- */
-function applyBlocklistChanges(aOldAddon, aNewAddon, aOldAppVersion,
- aOldPlatformVersion) {
- // Copy the properties by default
- aNewAddon.userDisabled = aOldAddon.userDisabled;
- aNewAddon.softDisabled = aOldAddon.softDisabled;
-
- let oldBlocklistState = Blocklist.getAddonBlocklistState(aOldAddon.wrapper,
- aOldAppVersion,
- aOldPlatformVersion);
- let newBlocklistState = Blocklist.getAddonBlocklistState(aNewAddon.wrapper);
-
- // If the blocklist state hasn't changed then the properties don't need to
- // change
- if (newBlocklistState == oldBlocklistState)
- return;
-
- if (newBlocklistState == Blocklist.STATE_SOFTBLOCKED) {
- if (aNewAddon.type != "theme") {
- // The add-on has become softblocked, set softDisabled if it isn't already
- // userDisabled
- aNewAddon.softDisabled = !aNewAddon.userDisabled;
- }
- else {
- // Themes just get userDisabled to switch back to the default theme
- aNewAddon.userDisabled = true;
- }
- }
- else {
- // If the new add-on is not softblocked then it cannot be softDisabled
- aNewAddon.softDisabled = false;
- }
-}
-
-/**
- * Evaluates whether an add-on is allowed to run in safe mode.
- *
- * @param aAddon
- * The add-on to check
- * @return true if the add-on should run in safe mode
- */
-function canRunInSafeMode(aAddon) {
- // Even though the updated system add-ons aren't generally run in safe mode we
- // include them here so their uninstall functions get called when switching
- // back to the default set.
-
- // TODO product should make the call about temporary add-ons running
- // in safe mode. assuming for now that they are.
- if (aAddon._installLocation.name == KEY_APP_TEMPORARY)
- return true;
-
- return aAddon._installLocation.name == KEY_APP_SYSTEM_DEFAULTS ||
- aAddon._installLocation.name == KEY_APP_SYSTEM_ADDONS;
-}
-
-/**
- * Calculates whether an add-on should be appDisabled or not.
- *
- * @param aAddon
- * The add-on to check
- * @return true if the add-on should not be appDisabled
- */
-function isUsableAddon(aAddon) {
- // Hack to ensure the default theme is always usable
- if (aAddon.type == "theme" && aAddon.internalName == XPIProvider.defaultSkin)
- return true;
-
- if (mustSign(aAddon.type) && !aAddon.isCorrectlySigned) {
- logger.warn(`Add-on ${aAddon.id} is not correctly signed.`);
- return false;
- }
-
- if (aAddon.blocklistState == Blocklist.STATE_BLOCKED) {
- logger.warn(`Add-on ${aAddon.id} is blocklisted.`);
- return false;
- }
-
- // Experiments are installed through an external mechanism that
- // limits target audience to compatible clients. We trust it knows what
- // it's doing and skip compatibility checks.
- //
- // This decision does forfeit defense in depth. If the experiments system
- // is ever wrong about targeting an add-on to a specific application
- // or platform, the client will likely see errors.
- if (aAddon.type == "experiment")
- return true;
-
- if (AddonManager.checkUpdateSecurity && !aAddon.providesUpdatesSecurely) {
- logger.warn(`Updates for add-on ${aAddon.id} must be provided over HTTPS.`);
- return false;
- }
-
-
- if (!aAddon.isPlatformCompatible) {
- logger.warn(`Add-on ${aAddon.id} is not compatible with platform.`);
- return false;
- }
-
- if (aAddon.dependencies.length) {
- let isActive = id => {
- let active = XPIProvider.activeAddons.get(id);
- return active && !active.disable;
- };
-
- if (aAddon.dependencies.some(id => !isActive(id)))
- return false;
- }
-
- if (AddonManager.checkCompatibility) {
- if (!aAddon.isCompatible) {
- logger.warn(`Add-on ${aAddon.id} is not compatible with application version.`);
- return false;
- }
- }
- else {
- if (!aAddon.matchingTargetApplication) {
- logger.warn(`Add-on ${aAddon.id} is not compatible with target application.`);
- return false;
- }
- }
-
- return true;
-}
-
-XPCOMUtils.defineLazyServiceGetter(this, "gRDF", "@mozilla.org/rdf/rdf-service;1",
- Ci.nsIRDFService);
-
-function EM_R(aProperty) {
- return gRDF.GetResource(PREFIX_NS_EM + aProperty);
-}
-
-function createAddonDetails(id, aAddon) {
- return {
- id: id || aAddon.id,
- type: aAddon.type,
- version: aAddon.version,
- multiprocessCompatible: aAddon.multiprocessCompatible,
- mpcOptedOut: aAddon.mpcOptedOut,
- runInSafeMode: aAddon.runInSafeMode,
- dependencies: aAddon.dependencies,
- hasEmbeddedWebExtension: aAddon.hasEmbeddedWebExtension,
- };
-}
-
-/**
- * Converts an internal add-on type to the type presented through the API.
- *
- * @param aType
- * The internal add-on type
- * @return an external add-on type
- */
-function getExternalType(aType) {
- if (aType in TYPE_ALIASES)
- return TYPE_ALIASES[aType];
- return aType;
-}
-
-function getManifestFileForDir(aDir) {
- let file = aDir.clone();
- file.append(FILE_RDF_MANIFEST);
- if (file.exists() && file.isFile())
- return file;
- file.leafName = FILE_WEB_MANIFEST;
- if (file.exists() && file.isFile())
- return file;
- return null;
-}
-
-function getManifestEntryForZipReader(aZipReader) {
- if (aZipReader.hasEntry(FILE_RDF_MANIFEST))
- return FILE_RDF_MANIFEST;
- if (aZipReader.hasEntry(FILE_WEB_MANIFEST))
- return FILE_WEB_MANIFEST;
- return null;
-}
-
-/**
- * Converts a list of API types to a list of API types and any aliases for those
- * types.
- *
- * @param aTypes
- * An array of types or null for all types
- * @return an array of types or null for all types
- */
-function getAllAliasesForTypes(aTypes) {
- if (!aTypes)
- return null;
-
- // Build a set of all requested types and their aliases
- let typeset = new Set(aTypes);
-
- for (let alias of Object.keys(TYPE_ALIASES)) {
- // Ignore any requested internal types
- typeset.delete(alias);
-
- // Add any alias for the internal type
- if (typeset.has(TYPE_ALIASES[alias]))
- typeset.add(alias);
- }
-
- return [...typeset];
-}
-
-/**
- * Converts an RDF literal, resource or integer into a string.
- *
- * @param aLiteral
- * The RDF object to convert
- * @return a string if the object could be converted or null
- */
-function getRDFValue(aLiteral) {
- if (aLiteral instanceof Ci.nsIRDFLiteral)
- return aLiteral.Value;
- if (aLiteral instanceof Ci.nsIRDFResource)
- return aLiteral.Value;
- if (aLiteral instanceof Ci.nsIRDFInt)
- return aLiteral.Value;
- return null;
-}
-
-/**
- * Gets an RDF property as a string
- *
- * @param aDs
- * The RDF datasource to read the property from
- * @param aResource
- * The RDF resource to read the property from
- * @param aProperty
- * The property to read
- * @return a string if the property existed or null
- */
-function getRDFProperty(aDs, aResource, aProperty) {
- return getRDFValue(aDs.GetTarget(aResource, EM_R(aProperty), true));
-}
-
-/**
- * Reads an AddonInternal object from a manifest stream.
- *
- * @param aUri
- * A |file:| or |jar:| URL for the manifest
- * @return an AddonInternal object
- * @throws if the install manifest in the stream is corrupt or could not
- * be read
- */
-var loadManifestFromWebManifest = Task.async(function*(aUri) {
- // We're passed the URI for the manifest file. Get the URI for its
- // parent directory.
- let uri = NetUtil.newURI("./", null, aUri);
-
- let extension = new ExtensionData(uri);
-
- let manifest = yield extension.readManifest();
-
- // Read the list of available locales, and pre-load messages for
- // all locales.
- let locales = yield extension.initAllLocales();
-
- // If there were any errors loading the extension, bail out now.
- if (extension.errors.length)
- throw new Error("Extension is invalid");
-
- let bss = (manifest.browser_specific_settings && manifest.browser_specific_settings.gecko)
- || (manifest.applications && manifest.applications.gecko) || {};
- if (manifest.browser_specific_settings && manifest.applications) {
- logger.warn("Ignoring applications property in manifest");
- }
-
- // A * is illegal in strict_min_version
- if (bss.strict_min_version && bss.strict_min_version.split(".").some(part => part == "*")) {
- throw new Error("The use of '*' in strict_min_version is invalid");
- }
-
- let addon = new AddonInternal();
- addon.id = bss.id;
- addon.version = manifest.version;
- addon.type = "webextension";
- addon.unpack = false;
- addon.strictCompatibility = true;
- addon.bootstrap = true;
- addon.hasBinaryComponents = false;
- addon.multiprocessCompatible = true;
- addon.internalName = null;
- addon.updateURL = bss.update_url;
- addon.updateKey = null;
- addon.optionsURL = null;
- addon.optionsType = null;
- addon.aboutURL = null;
- addon.dependencies = Object.freeze(Array.from(extension.dependencies));
-
- if (manifest.options_ui) {
- // Store just the relative path here, the AddonWrapper getURL
- // wrapper maps this to a full URL.
- addon.optionsURL = manifest.options_ui.page;
- if (manifest.options_ui.open_in_tab)
- addon.optionsType = AddonManager.OPTIONS_TYPE_TAB;
- else
- addon.optionsType = AddonManager.OPTIONS_TYPE_INLINE_BROWSER;
- }
-
- // WebExtensions don't use iconURLs
- addon.iconURL = null;
- addon.icon64URL = null;
- addon.icons = manifest.icons || {};
-
- addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;
-
- function getLocale(aLocale) {
- // Use the raw manifest, here, since we need values with their
- // localization placeholders still in place.
- let rawManifest = extension.rawManifest;
-
- // As a convenience, allow author to be set if its a string bug 1313567.
- let creator = typeof(rawManifest.author) === 'string' ? rawManifest.author : null;
- let homepageURL = rawManifest.homepage_url;
-
- // Allow developer to override creator and homepage_url.
- if (rawManifest.developer) {
- if (rawManifest.developer.name) {
- creator = rawManifest.developer.name;
- }
- if (rawManifest.developer.url) {
- homepageURL = rawManifest.developer.url;
- }
- }
-
- let result = {
- name: extension.localize(rawManifest.name, aLocale),
- description: extension.localize(rawManifest.description, aLocale),
- creator: extension.localize(creator, aLocale),
- homepageURL: extension.localize(homepageURL, aLocale),
-
- developers: null,
- translators: null,
- contributors: null,
- locales: [aLocale],
- };
- return result;
- }
-
- addon.defaultLocale = getLocale(extension.defaultLocale);
- addon.locales = Array.from(locales.keys(), getLocale);
-
- delete addon.defaultLocale.locales;
-
- addon.targetApplications = [{
- id: WEBEXTENSIONS_ID,
- minVersion: bss.strict_min_version,
- maxVersion: bss.strict_max_version,
- }];
-
- addon.targetPlatforms = [];
- addon.userDisabled = false;
- addon.softDisabled = addon.blocklistState == Blocklist.STATE_SOFTBLOCKED;
-
- return addon;
-});
-
-/**
- * Reads an AddonInternal object from an RDF stream.
- *
- * @param aUri
- * The URI that the manifest is being read from
- * @param aStream
- * An open stream to read the RDF from
- * @return an AddonInternal object
- * @throws if the install manifest in the RDF stream is corrupt or could not
- * be read
- */
-let loadManifestFromRDF = Task.async(function*(aUri, aStream) {
- function getPropertyArray(aDs, aSource, aProperty) {
- let values = [];
- let targets = aDs.GetTargets(aSource, EM_R(aProperty), true);
- while (targets.hasMoreElements())
- values.push(getRDFValue(targets.getNext()));
-
- return values;
- }
-
- /**
- * Reads locale properties from either the main install manifest root or
- * an em:localized section in the install manifest.
- *
- * @param aDs
- * The nsIRDFDatasource to read from
- * @param aSource
- * The nsIRDFResource to read the properties from
- * @param isDefault
- * True if the locale is to be read from the main install manifest
- * root
- * @param aSeenLocales
- * An array of locale names already seen for this install manifest.
- * Any locale names seen as a part of this function will be added to
- * this array
- * @return an object containing the locale properties
- */
- function readLocale(aDs, aSource, isDefault, aSeenLocales) {
- let locale = { };
- if (!isDefault) {
- locale.locales = [];
- let targets = ds.GetTargets(aSource, EM_R("locale"), true);
- while (targets.hasMoreElements()) {
- let localeName = getRDFValue(targets.getNext());
- if (!localeName) {
- logger.warn("Ignoring empty locale in localized properties");
- continue;
- }
- if (aSeenLocales.indexOf(localeName) != -1) {
- logger.warn("Ignoring duplicate locale in localized properties");
- continue;
- }
- aSeenLocales.push(localeName);
- locale.locales.push(localeName);
- }
-
- if (locale.locales.length == 0) {
- logger.warn("Ignoring localized properties with no listed locales");
- return null;
- }
- }
-
- for (let prop of PROP_LOCALE_SINGLE) {
- locale[prop] = getRDFProperty(aDs, aSource, prop);
- }
-
- for (let prop of PROP_LOCALE_MULTI) {
- // Don't store empty arrays
- let props = getPropertyArray(aDs, aSource,
- prop.substring(0, prop.length - 1));
- if (props.length > 0)
- locale[prop] = props;
- }
-
- return locale;
- }
-
- let rdfParser = Cc["@mozilla.org/rdf/xml-parser;1"].
- createInstance(Ci.nsIRDFXMLParser)
- let ds = Cc["@mozilla.org/rdf/datasource;1?name=in-memory-datasource"].
- createInstance(Ci.nsIRDFDataSource);
- let listener = rdfParser.parseAsync(ds, aUri);
- let channel = Cc["@mozilla.org/network/input-stream-channel;1"].
- createInstance(Ci.nsIInputStreamChannel);
- channel.setURI(aUri);
- channel.contentStream = aStream;
- channel.QueryInterface(Ci.nsIChannel);
- channel.contentType = "text/xml";
-
- listener.onStartRequest(channel, null);
-
- try {
- let pos = 0;
- let count = aStream.available();
- while (count > 0) {
- listener.onDataAvailable(channel, null, aStream, pos, count);
- pos += count;
- count = aStream.available();
- }
- listener.onStopRequest(channel, null, Components.results.NS_OK);
- }
- catch (e) {
- listener.onStopRequest(channel, null, e.result);
- throw e;
- }
-
- let root = gRDF.GetResource(RDFURI_INSTALL_MANIFEST_ROOT);
- let addon = new AddonInternal();
- for (let prop of PROP_METADATA) {
- addon[prop] = getRDFProperty(ds, root, prop);
- }
- addon.unpack = getRDFProperty(ds, root, "unpack") == "true";
-
- if (!addon.type) {
- addon.type = addon.internalName ? "theme" : "extension";
- }
- else {
- let type = addon.type;
- addon.type = null;
- for (let name in TYPES) {
- if (TYPES[name] == type) {
- addon.type = name;
- break;
- }
- }
- }
-
- if (!(addon.type in TYPES))
- throw new Error("Install manifest specifies unknown type: " + addon.type);
-
- if (addon.type != "multipackage") {
- if (!addon.id)
- throw new Error("No ID in install manifest");
- if (!gIDTest.test(addon.id))
- throw new Error("Illegal add-on ID " + addon.id);
- if (!addon.version)
- throw new Error("No version in install manifest");
- }
-
- addon.strictCompatibility = !(addon.type in COMPATIBLE_BY_DEFAULT_TYPES) ||
- getRDFProperty(ds, root, "strictCompatibility") == "true";
-
- // Only read these properties for extensions.
- if (addon.type == "extension") {
- addon.bootstrap = getRDFProperty(ds, root, "bootstrap") == "true";
-
- let mpcValue = getRDFProperty(ds, root, "multiprocessCompatible");
- addon.multiprocessCompatible = mpcValue == "true";
- addon.mpcOptedOut = mpcValue == "false";
-
- addon.hasEmbeddedWebExtension = getRDFProperty(ds, root, "hasEmbeddedWebExtension") == "true";
-
- if (addon.optionsType &&
- addon.optionsType != AddonManager.OPTIONS_TYPE_DIALOG &&
- addon.optionsType != AddonManager.OPTIONS_TYPE_INLINE &&
- addon.optionsType != AddonManager.OPTIONS_TYPE_TAB &&
- addon.optionsType != AddonManager.OPTIONS_TYPE_INLINE_INFO) {
- throw new Error("Install manifest specifies unknown type: " + addon.optionsType);
- }
-
- if (addon.hasEmbeddedWebExtension) {
- let uri = NetUtil.newURI("webextension/manifest.json", null, aUri);
- let embeddedAddon = yield loadManifestFromWebManifest(uri);
- if (embeddedAddon.optionsURL) {
- if (addon.optionsType || addon.optionsURL)
- logger.warn(`Addon ${addon.id} specifies optionsType or optionsURL ` +
- `in both install.rdf and manifest.json`);
-
- addon.optionsURL = embeddedAddon.optionsURL;
- addon.optionsType = embeddedAddon.optionsType;
- }
- }
- }
- else {
- // Some add-on types are always restartless.
- if (RESTARTLESS_TYPES.has(addon.type)) {
- addon.bootstrap = true;
- }
-
- // Only extensions are allowed to provide an optionsURL, optionsType or aboutURL. For
- // all other types they are silently ignored
- addon.optionsURL = null;
- addon.optionsType = null;
- addon.aboutURL = null;
-
- if (addon.type == "theme") {
- if (!addon.internalName)
- throw new Error("Themes must include an internalName property");
- addon.skinnable = getRDFProperty(ds, root, "skinnable") == "true";
- }
- }
-
- addon.defaultLocale = readLocale(ds, root, true);
-
- let seenLocales = [];
- addon.locales = [];
- let targets = ds.GetTargets(root, EM_R("localized"), true);
- while (targets.hasMoreElements()) {
- let target = targets.getNext().QueryInterface(Ci.nsIRDFResource);
- let locale = readLocale(ds, target, false, seenLocales);
- if (locale)
- addon.locales.push(locale);
- }
-
- let dependencies = new Set();
- targets = ds.GetTargets(root, EM_R("dependency"), true);
- while (targets.hasMoreElements()) {
- let target = targets.getNext().QueryInterface(Ci.nsIRDFResource);
- let id = getRDFProperty(ds, target, "id");
- dependencies.add(id);
- }
- addon.dependencies = Object.freeze(Array.from(dependencies));
-
- let seenApplications = [];
- addon.targetApplications = [];
- targets = ds.GetTargets(root, EM_R("targetApplication"), true);
- while (targets.hasMoreElements()) {
- let target = targets.getNext().QueryInterface(Ci.nsIRDFResource);
- let targetAppInfo = {};
- for (let prop of PROP_TARGETAPP) {
- targetAppInfo[prop] = getRDFProperty(ds, target, prop);
- }
- if (!targetAppInfo.id || !targetAppInfo.minVersion ||
- !targetAppInfo.maxVersion) {
- logger.warn("Ignoring invalid targetApplication entry in install manifest");
- continue;
- }
- if (seenApplications.indexOf(targetAppInfo.id) != -1) {
- logger.warn("Ignoring duplicate targetApplication entry for " + targetAppInfo.id +
- " in install manifest");
- continue;
- }
- seenApplications.push(targetAppInfo.id);
- addon.targetApplications.push(targetAppInfo);
- }
-
- // Note that we don't need to check for duplicate targetPlatform entries since
- // the RDF service coalesces them for us.
- let targetPlatforms = getPropertyArray(ds, root, "targetPlatform");
- addon.targetPlatforms = [];
- for (let targetPlatform of targetPlatforms) {
- let platform = {
- os: null,
- abi: null
- };
-
- let pos = targetPlatform.indexOf("_");
- if (pos != -1) {
- platform.os = targetPlatform.substring(0, pos);
- platform.abi = targetPlatform.substring(pos + 1);
- }
- else {
- platform.os = targetPlatform;
- }
-
- addon.targetPlatforms.push(platform);
- }
-
- // A theme's userDisabled value is true if the theme is not the selected skin
- // or if there is an active lightweight theme. We ignore whether softblocking
- // is in effect since it would change the active theme.
- if (addon.type == "theme") {
- addon.userDisabled = !!LightweightThemeManager.currentTheme ||
- addon.internalName != XPIProvider.selectedSkin;
- }
- else if (addon.type == "experiment") {
- // Experiments are disabled by default. It is up to the Experiments Manager
- // to enable them (it drives installation).
- addon.userDisabled = true;
- }
- else {
- addon.userDisabled = false;
- }
-
- addon.softDisabled = addon.blocklistState == Blocklist.STATE_SOFTBLOCKED;
- addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DEFAULT;
-
- // Experiments are managed and updated through an external "experiments
- // manager." So disable some built-in mechanisms.
- if (addon.type == "experiment") {
- addon.applyBackgroundUpdates = AddonManager.AUTOUPDATE_DISABLE;
- addon.updateURL = null;
- addon.updateKey = null;
- }
-
- // icons will be filled by the calling function
- addon.icons = {};
-
- return addon;
-});
-
-function defineSyncGUID(aAddon) {
- // Define .syncGUID as a lazy property which is also settable
- Object.defineProperty(aAddon, "syncGUID", {
- get: () => {
- // Generate random GUID used for Sync.
- let guid = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator)
- .generateUUID().toString();
-
- delete aAddon.syncGUID;
- aAddon.syncGUID = guid;
- return guid;
- },
- set: (val) => {
- delete aAddon.syncGUID;
- aAddon.syncGUID = val;
- },
- configurable: true,
- enumerable: true,
- });
-}
-
-// Generate a unique ID based on the path to this temporary add-on location.
-function generateTemporaryInstallID(aFile) {
- const hasher = Cc["@mozilla.org/security/hash;1"]
- .createInstance(Ci.nsICryptoHash);
- hasher.init(hasher.SHA1);
- const data = new TextEncoder().encode(aFile.path);
- // Make it so this ID cannot be guessed.
- const sess = TEMP_INSTALL_ID_GEN_SESSION;
- hasher.update(sess, sess.length);
- hasher.update(data, data.length);
- let id = `${getHashStringForCrypto(hasher)}@temporary-addon`;
- logger.info(`Generated temp id ${id} (${sess.join("")}) for ${aFile.path}`);
- return id;
-}
-
-/**
- * Loads an AddonInternal object from an add-on extracted in a directory.
- *
- * @param aDir
- * The nsIFile directory holding the add-on
- * @return an AddonInternal object
- * @throws if the directory does not contain a valid install manifest
- */
-var loadManifestFromDir = Task.async(function*(aDir, aInstallLocation) {
- function getFileSize(aFile) {
- if (aFile.isSymlink())
- return 0;
-
- if (!aFile.isDirectory())
- return aFile.fileSize;
-
- let size = 0;
- let entries = aFile.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
- let entry;
- while ((entry = entries.nextFile))
- size += getFileSize(entry);
- entries.close();
- return size;
- }
-
- function* loadFromRDF(aUri) {
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fis.init(aUri.file, -1, -1, false);
- let bis = Cc["@mozilla.org/network/buffered-input-stream;1"].
- createInstance(Ci.nsIBufferedInputStream);
- bis.init(fis, 4096);
- try {
- var addon = yield loadManifestFromRDF(aUri, bis);
- } finally {
- bis.close();
- fis.close();
- }
-
- let iconFile = aDir.clone();
- iconFile.append("icon.png");
-
- if (iconFile.exists()) {
- addon.icons[32] = "icon.png";
- addon.icons[48] = "icon.png";
- }
-
- let icon64File = aDir.clone();
- icon64File.append("icon64.png");
-
- if (icon64File.exists()) {
- addon.icons[64] = "icon64.png";
- }
-
- let file = aDir.clone();
- file.append("chrome.manifest");
- let chromeManifest = ChromeManifestParser.parseSync(Services.io.newFileURI(file));
- addon.hasBinaryComponents = ChromeManifestParser.hasType(chromeManifest,
- "binary-component");
- return addon;
- }
-
- let file = getManifestFileForDir(aDir);
- if (!file) {
- throw new Error("Directory " + aDir.path + " does not contain a valid " +
- "install manifest");
- }
-
- let uri = Services.io.newFileURI(file).QueryInterface(Ci.nsIFileURL);
-
- let addon;
- if (file.leafName == FILE_WEB_MANIFEST) {
- addon = yield loadManifestFromWebManifest(uri);
- if (!addon.id) {
- if (aInstallLocation == TemporaryInstallLocation) {
- addon.id = generateTemporaryInstallID(aDir);
- } else {
- addon.id = aDir.leafName;
- }
- }
- } else {
- addon = yield loadFromRDF(uri);
- }
-
- addon._sourceBundle = aDir.clone();
- addon._installLocation = aInstallLocation;
- addon.size = getFileSize(aDir);
- addon.signedState = yield verifyDirSignedState(aDir, addon)
- .then(({signedState}) => signedState);
- addon.appDisabled = !isUsableAddon(addon);
-
- defineSyncGUID(addon);
-
- return addon;
-});
-
-/**
- * Loads an AddonInternal object from an nsIZipReader for an add-on.
- *
- * @param aZipReader
- * An open nsIZipReader for the add-on's files
- * @return an AddonInternal object
- * @throws if the XPI file does not contain a valid install manifest
- */
-var loadManifestFromZipReader = Task.async(function*(aZipReader, aInstallLocation) {
- function* loadFromRDF(aUri) {
- let zis = aZipReader.getInputStream(entry);
- let bis = Cc["@mozilla.org/network/buffered-input-stream;1"].
- createInstance(Ci.nsIBufferedInputStream);
- bis.init(zis, 4096);
- try {
- var addon = yield loadManifestFromRDF(aUri, bis);
- } finally {
- bis.close();
- zis.close();
- }
-
- if (aZipReader.hasEntry("icon.png")) {
- addon.icons[32] = "icon.png";
- addon.icons[48] = "icon.png";
- }
-
- if (aZipReader.hasEntry("icon64.png")) {
- addon.icons[64] = "icon64.png";
- }
-
- // Binary components can only be loaded from unpacked addons.
- if (addon.unpack) {
- let uri = buildJarURI(aZipReader.file, "chrome.manifest");
- let chromeManifest = ChromeManifestParser.parseSync(uri);
- addon.hasBinaryComponents = ChromeManifestParser.hasType(chromeManifest,
- "binary-component");
- } else {
- addon.hasBinaryComponents = false;
- }
-
- return addon;
- }
-
- let entry = getManifestEntryForZipReader(aZipReader);
- if (!entry) {
- throw new Error("File " + aZipReader.file.path + " does not contain a valid " +
- "install manifest");
- }
-
- let uri = buildJarURI(aZipReader.file, entry);
-
- let isWebExtension = (entry == FILE_WEB_MANIFEST);
-
- let addon = isWebExtension ?
- yield loadManifestFromWebManifest(uri) :
- yield loadFromRDF(uri);
-
- addon._sourceBundle = aZipReader.file;
- addon._installLocation = aInstallLocation;
-
- addon.size = 0;
- let entries = aZipReader.findEntries(null);
- while (entries.hasMore())
- addon.size += aZipReader.getEntry(entries.getNext()).realSize;
-
- let {signedState, cert} = yield verifyZipSignedState(aZipReader.file, addon);
- addon.signedState = signedState;
- if (isWebExtension && !addon.id) {
- if (cert) {
- addon.id = cert.commonName;
- if (!gIDTest.test(addon.id)) {
- throw new Error(`Webextension is signed with an invalid id (${addon.id})`);
- }
- }
- if (!addon.id && aInstallLocation == TemporaryInstallLocation) {
- addon.id = generateTemporaryInstallID(aZipReader.file);
- }
- }
- addon.appDisabled = !isUsableAddon(addon);
-
- defineSyncGUID(addon);
-
- return addon;
-});
-
-/**
- * Loads an AddonInternal object from an add-on in an XPI file.
- *
- * @param aXPIFile
- * An nsIFile pointing to the add-on's XPI file
- * @return an AddonInternal object
- * @throws if the XPI file does not contain a valid install manifest
- */
-var loadManifestFromZipFile = Task.async(function*(aXPIFile, aInstallLocation) {
- let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- try {
- zipReader.open(aXPIFile);
-
- // Can't return this promise because that will make us close the zip reader
- // before it has finished loading the manifest. Wait for the result and then
- // return.
- let manifest = yield loadManifestFromZipReader(zipReader, aInstallLocation);
- return manifest;
- }
- finally {
- zipReader.close();
- }
-});
-
-function loadManifestFromFile(aFile, aInstallLocation) {
- if (aFile.isFile())
- return loadManifestFromZipFile(aFile, aInstallLocation);
- return loadManifestFromDir(aFile, aInstallLocation);
-}
-
-/**
- * A synchronous method for loading an add-on's manifest. This should only ever
- * be used during startup or a sync load of the add-ons DB
- */
-function syncLoadManifestFromFile(aFile, aInstallLocation) {
- let success = undefined;
- let result = null;
-
- loadManifestFromFile(aFile, aInstallLocation).then(val => {
- success = true;
- result = val;
- }, val => {
- success = false;
- result = val
- });
-
- let thread = Services.tm.currentThread;
-
- while (success === undefined)
- thread.processNextEvent(true);
-
- if (!success)
- throw result;
- return result;
-}
-
-/**
- * Gets an nsIURI for a file within another file, either a directory or an XPI
- * file. If aFile is a directory then this will return a file: URI, if it is an
- * XPI file then it will return a jar: URI.
- *
- * @param aFile
- * The file containing the resources, must be either a directory or an
- * XPI file
- * @param aPath
- * The path to find the resource at, "/" separated. If aPath is empty
- * then the uri to the root of the contained files will be returned
- * @return an nsIURI pointing at the resource
- */
-function getURIForResourceInFile(aFile, aPath) {
- if (aFile.isDirectory()) {
- let resource = aFile.clone();
- if (aPath)
- aPath.split("/").forEach(part => resource.append(part));
-
- return NetUtil.newURI(resource);
- }
-
- return buildJarURI(aFile, aPath);
-}
-
-/**
- * Creates a jar: URI for a file inside a ZIP file.
- *
- * @param aJarfile
- * The ZIP file as an nsIFile
- * @param aPath
- * The path inside the ZIP file
- * @return an nsIURI for the file
- */
-function buildJarURI(aJarfile, aPath) {
- let uri = Services.io.newFileURI(aJarfile);
- uri = "jar:" + uri.spec + "!/" + aPath;
- return NetUtil.newURI(uri);
-}
-
-/**
- * Sends local and remote notifications to flush a JAR file cache entry
- *
- * @param aJarFile
- * The ZIP/XPI/JAR file as a nsIFile
- */
-function flushJarCache(aJarFile) {
- Services.obs.notifyObservers(aJarFile, "flush-cache-entry", null);
- Services.mm.broadcastAsyncMessage(MSG_JAR_FLUSH, aJarFile.path);
-}
-
-function flushChromeCaches() {
- // Init this, so it will get the notification.
- Services.obs.notifyObservers(null, "startupcache-invalidate", null);
- // Flush message manager cached scripts
- Services.obs.notifyObservers(null, "message-manager-flush-caches", null);
- // Also dispatch this event to child processes
- Services.mm.broadcastAsyncMessage(MSG_MESSAGE_MANAGER_CACHES_FLUSH, null);
-}
-
-/**
- * Creates and returns a new unique temporary file. The caller should delete
- * the file when it is no longer needed.
- *
- * @return an nsIFile that points to a randomly named, initially empty file in
- * the OS temporary files directory
- */
-function getTemporaryFile() {
- let file = FileUtils.getDir(KEY_TEMPDIR, []);
- let random = Math.random().toString(36).replace(/0./, '').substr(-3);
- file.append("tmp-" + random + ".xpi");
- file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
-
- return file;
-}
-
-/**
- * Verifies that a zip file's contents are all signed by the same principal.
- * Directory entries and anything in the META-INF directory are not checked.
- *
- * @param aZip
- * A nsIZipReader to check
- * @param aCertificate
- * The nsIX509Cert to compare against
- * @return true if all the contents that should be signed were signed by the
- * principal
- */
-function verifyZipSigning(aZip, aCertificate) {
- var count = 0;
- var entries = aZip.findEntries(null);
- while (entries.hasMore()) {
- var entry = entries.getNext();
- // Nothing in META-INF is in the manifest.
- if (entry.substr(0, 9) == "META-INF/")
- continue;
- // Directory entries aren't in the manifest.
- if (entry.substr(-1) == "/")
- continue;
- count++;
- var entryCertificate = aZip.getSigningCert(entry);
- if (!entryCertificate || !aCertificate.equals(entryCertificate)) {
- return false;
- }
- }
- return aZip.manifestEntriesCount == count;
-}
-
-/**
- * Returns the signedState for a given return code and certificate by verifying
- * it against the expected ID.
- */
-function getSignedStatus(aRv, aCert, aAddonID) {
- let expectedCommonName = aAddonID;
- if (aAddonID && aAddonID.length > 64) {
- let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
- createInstance(Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- let data = converter.convertToByteArray(aAddonID, {});
-
- let crypto = Cc["@mozilla.org/security/hash;1"].
- createInstance(Ci.nsICryptoHash);
- crypto.init(Ci.nsICryptoHash.SHA256);
- crypto.update(data, data.length);
- expectedCommonName = getHashStringForCrypto(crypto);
- }
-
- switch (aRv) {
- case Cr.NS_OK:
- if (expectedCommonName && expectedCommonName != aCert.commonName)
- return AddonManager.SIGNEDSTATE_BROKEN;
-
- let hotfixID = Preferences.get(PREF_EM_HOTFIX_ID, undefined);
- if (hotfixID && hotfixID == aAddonID && Preferences.get(PREF_EM_CERT_CHECKATTRIBUTES, false)) {
- // The hotfix add-on has some more rigorous certificate checks
- try {
- CertUtils.validateCert(aCert,
- CertUtils.readCertPrefs(PREF_EM_HOTFIX_CERTS));
- }
- catch (e) {
- logger.warn("The hotfix add-on was not signed by the expected " +
- "certificate and so will not be installed.", e);
- return AddonManager.SIGNEDSTATE_BROKEN;
- }
- }
-
- if (aCert.organizationalUnit == "Mozilla Components")
- return AddonManager.SIGNEDSTATE_SYSTEM;
-
- return /preliminary/i.test(aCert.organizationalUnit)
- ? AddonManager.SIGNEDSTATE_PRELIMINARY
- : AddonManager.SIGNEDSTATE_SIGNED;
- case Cr.NS_ERROR_SIGNED_JAR_NOT_SIGNED:
- return AddonManager.SIGNEDSTATE_MISSING;
- case Cr.NS_ERROR_SIGNED_JAR_MANIFEST_INVALID:
- case Cr.NS_ERROR_SIGNED_JAR_ENTRY_INVALID:
- case Cr.NS_ERROR_SIGNED_JAR_ENTRY_MISSING:
- case Cr.NS_ERROR_SIGNED_JAR_ENTRY_TOO_LARGE:
- case Cr.NS_ERROR_SIGNED_JAR_UNSIGNED_ENTRY:
- case Cr.NS_ERROR_SIGNED_JAR_MODIFIED_ENTRY:
- return AddonManager.SIGNEDSTATE_BROKEN;
- default:
- // Any other error indicates that either the add-on isn't signed or it
- // is signed by a signature that doesn't chain to the trusted root.
- return AddonManager.SIGNEDSTATE_UNKNOWN;
- }
-}
-
-function shouldVerifySignedState(aAddon) {
- // Updated system add-ons should always have their signature checked
- if (aAddon._installLocation.name == KEY_APP_SYSTEM_ADDONS)
- return true;
-
- // We don't care about signatures for default system add-ons
- if (aAddon._installLocation.name == KEY_APP_SYSTEM_DEFAULTS)
- return false;
-
- // Hotfixes should always have their signature checked
- let hotfixID = Preferences.get(PREF_EM_HOTFIX_ID, undefined);
- if (hotfixID && aAddon.id == hotfixID)
- return true;
-
- // Otherwise only check signatures if signing is enabled and the add-on is one
- // of the signed types.
- return ADDON_SIGNING && SIGNED_TYPES.has(aAddon.type);
-}
-
-let gCertDB = Cc["@mozilla.org/security/x509certdb;1"]
- .getService(Ci.nsIX509CertDB);
-
-/**
- * Verifies that a zip file's contents are all correctly signed by an
- * AMO-issued certificate
- *
- * @param aFile
- * the xpi file to check
- * @param aAddon
- * the add-on object to verify
- * @return a Promise that resolves to an object with properties:
- * signedState: an AddonManager.SIGNEDSTATE_* constant
- * cert: an nsIX509Cert
- */
-function verifyZipSignedState(aFile, aAddon) {
- if (!shouldVerifySignedState(aAddon))
- return Promise.resolve({
- signedState: AddonManager.SIGNEDSTATE_NOT_REQUIRED,
- cert: null
- });
-
- let root = Ci.nsIX509CertDB.AddonsPublicRoot;
- if (!REQUIRE_SIGNING && Preferences.get(PREF_XPI_SIGNATURES_DEV_ROOT, false))
- root = Ci.nsIX509CertDB.AddonsStageRoot;
-
- return new Promise(resolve => {
- let callback = {
- openSignedAppFileFinished: function(aRv, aZipReader, aCert) {
- if (aZipReader)
- aZipReader.close();
- resolve({
- signedState: getSignedStatus(aRv, aCert, aAddon.id),
- cert: aCert
- });
- }
- };
- // This allows the certificate DB to get the raw JS callback object so the
- // test code can pass through objects that XPConnect would reject.
- callback.wrappedJSObject = callback;
-
- gCertDB.openSignedAppFileAsync(root, aFile, callback);
- });
-}
-
-/**
- * Verifies that a directory's contents are all correctly signed by an
- * AMO-issued certificate
- *
- * @param aDir
- * the directory to check
- * @param aAddon
- * the add-on object to verify
- * @return a Promise that resolves to an object with properties:
- * signedState: an AddonManager.SIGNEDSTATE_* constant
- * cert: an nsIX509Cert
- */
-function verifyDirSignedState(aDir, aAddon) {
- if (!shouldVerifySignedState(aAddon))
- return Promise.resolve({
- signedState: AddonManager.SIGNEDSTATE_NOT_REQUIRED,
- cert: null,
- });
-
- let root = Ci.nsIX509CertDB.AddonsPublicRoot;
- if (!REQUIRE_SIGNING && Preferences.get(PREF_XPI_SIGNATURES_DEV_ROOT, false))
- root = Ci.nsIX509CertDB.AddonsStageRoot;
-
- return new Promise(resolve => {
- let callback = {
- verifySignedDirectoryFinished: function(aRv, aCert) {
- resolve({
- signedState: getSignedStatus(aRv, aCert, aAddon.id),
- cert: null,
- });
- }
- };
- // This allows the certificate DB to get the raw JS callback object so the
- // test code can pass through objects that XPConnect would reject.
- callback.wrappedJSObject = callback;
-
- gCertDB.verifySignedDirectoryAsync(root, aDir, callback);
- });
-}
-
-/**
- * Verifies that a bundle's contents are all correctly signed by an
- * AMO-issued certificate
- *
- * @param aBundle
- * the nsIFile for the bundle to check, either a directory or zip file
- * @param aAddon
- * the add-on object to verify
- * @return a Promise that resolves to an AddonManager.SIGNEDSTATE_* constant.
- */
-function verifyBundleSignedState(aBundle, aAddon) {
- let promise = aBundle.isFile() ? verifyZipSignedState(aBundle, aAddon)
- : verifyDirSignedState(aBundle, aAddon);
- return promise.then(({signedState}) => signedState);
-}
-
-/**
- * Replaces %...% strings in an addon url (update and updateInfo) with
- * appropriate values.
- *
- * @param aAddon
- * The AddonInternal representing the add-on
- * @param aUri
- * The uri to escape
- * @param aUpdateType
- * An optional number representing the type of update, only applicable
- * when creating a url for retrieving an update manifest
- * @param aAppVersion
- * The optional application version to use for %APP_VERSION%
- * @return the appropriately escaped uri.
- */
-function escapeAddonURI(aAddon, aUri, aUpdateType, aAppVersion)
-{
- let uri = AddonManager.escapeAddonURI(aAddon, aUri, aAppVersion);
-
- // If there is an updateType then replace the UPDATE_TYPE string
- if (aUpdateType)
- uri = uri.replace(/%UPDATE_TYPE%/g, aUpdateType);
-
- // If this add-on has compatibility information for either the current
- // application or toolkit then replace the ITEM_MAXAPPVERSION with the
- // maxVersion
- let app = aAddon.matchingTargetApplication;
- if (app)
- var maxVersion = app.maxVersion;
- else
- maxVersion = "";
- uri = uri.replace(/%ITEM_MAXAPPVERSION%/g, maxVersion);
-
- let compatMode = "normal";
- if (!AddonManager.checkCompatibility)
- compatMode = "ignore";
- else if (AddonManager.strictCompatibility)
- compatMode = "strict";
- uri = uri.replace(/%COMPATIBILITY_MODE%/g, compatMode);
-
- return uri;
-}
-
-function removeAsync(aFile) {
- return Task.spawn(function*() {
- let info = null;
- try {
- info = yield OS.File.stat(aFile.path);
- if (info.isDir)
- yield OS.File.removeDir(aFile.path);
- else
- yield OS.File.remove(aFile.path);
- }
- catch (e) {
- if (!(e instanceof OS.File.Error) || ! e.becauseNoSuchFile)
- throw e;
- // The file has already gone away
- return;
- }
- });
-}
-
-/**
- * Recursively removes a directory or file fixing permissions when necessary.
- *
- * @param aFile
- * The nsIFile to remove
- */
-function recursiveRemove(aFile) {
- let isDir = null;
-
- try {
- isDir = aFile.isDirectory();
- }
- catch (e) {
- // If the file has already gone away then don't worry about it, this can
- // happen on OSX where the resource fork is automatically moved with the
- // data fork for the file. See bug 733436.
- if (e.result == Cr.NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
- return;
- if (e.result == Cr.NS_ERROR_FILE_NOT_FOUND)
- return;
-
- throw e;
- }
-
- setFilePermissions(aFile, isDir ? FileUtils.PERMS_DIRECTORY
- : FileUtils.PERMS_FILE);
-
- try {
- aFile.remove(true);
- return;
- }
- catch (e) {
- if (!aFile.isDirectory() || aFile.isSymlink()) {
- logger.error("Failed to remove file " + aFile.path, e);
- throw e;
- }
- }
-
- // Use a snapshot of the directory contents to avoid possible issues with
- // iterating over a directory while removing files from it (the YAFFS2
- // embedded filesystem has this issue, see bug 772238), and to remove
- // normal files before their resource forks on OSX (see bug 733436).
- let entries = getDirectoryEntries(aFile, true);
- entries.forEach(recursiveRemove);
-
- try {
- aFile.remove(true);
- }
- catch (e) {
- logger.error("Failed to remove empty directory " + aFile.path, e);
- throw e;
- }
-}
-
-/**
- * Returns the timestamp and leaf file name of the most recently modified
- * entry in a directory,
- * or simply the file's own timestamp if it is not a directory.
- * Also returns the total number of items (directories and files) visited in the scan
- *
- * @param aFile
- * A non-null nsIFile object
- * @return [File Name, Epoch time, items visited], as described above.
- */
-function recursiveLastModifiedTime(aFile) {
- try {
- let modTime = aFile.lastModifiedTime;
- let fileName = aFile.leafName;
- if (aFile.isFile())
- return [fileName, modTime, 1];
-
- if (aFile.isDirectory()) {
- let entries = aFile.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
- let entry;
- let totalItems = 1;
- while ((entry = entries.nextFile)) {
- let [subName, subTime, items] = recursiveLastModifiedTime(entry);
- totalItems += items;
- if (subTime > modTime) {
- modTime = subTime;
- fileName = subName;
- }
- }
- entries.close();
- return [fileName, modTime, totalItems];
- }
- }
- catch (e) {
- logger.warn("Problem getting last modified time for " + aFile.path, e);
- }
-
- // If the file is something else, just ignore it.
- return ["", 0, 0];
-}
-
-/**
- * Gets a snapshot of directory entries.
- *
- * @param aDir
- * Directory to look at
- * @param aSortEntries
- * True to sort entries by filename
- * @return An array of nsIFile, or an empty array if aDir is not a readable directory
- */
-function getDirectoryEntries(aDir, aSortEntries) {
- let dirEnum;
- try {
- dirEnum = aDir.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
- let entries = [];
- while (dirEnum.hasMoreElements())
- entries.push(dirEnum.nextFile);
-
- if (aSortEntries) {
- entries.sort(function(a, b) {
- return a.path > b.path ? -1 : 1;
- });
- }
-
- return entries
- }
- catch (e) {
- logger.warn("Can't iterate directory " + aDir.path, e);
- return [];
- }
- finally {
- if (dirEnum) {
- dirEnum.close();
- }
- }
-}
-
-/**
- * Record a bit of per-addon telemetry
- * @param aAddon the addon to record
- */
-function recordAddonTelemetry(aAddon) {
- let locale = aAddon.defaultLocale;
- if (locale) {
- if (locale.name)
- XPIProvider.setTelemetry(aAddon.id, "name", locale.name);
- if (locale.creator)
- XPIProvider.setTelemetry(aAddon.id, "creator", locale.creator);
- }
-}
-
-/**
- * The on-disk state of an individual XPI, created from an Object
- * as stored in the 'extensions.xpiState' pref.
- */
-function XPIState(saved) {
- for (let [short, long] of XPIState.prototype.fields) {
- if (short in saved) {
- this[long] = saved[short];
- }
- }
-}
-
-XPIState.prototype = {
- fields: [['d', 'descriptor'],
- ['e', 'enabled'],
- ['v', 'version'],
- ['st', 'scanTime'],
- ['mt', 'manifestTime']],
- /**
- * Return the last modified time, based on enabled/disabled
- */
- get mtime() {
- if (!this.enabled && ('manifestTime' in this) && this.manifestTime > this.scanTime) {
- return this.manifestTime;
- }
- return this.scanTime;
- },
-
- toJSON() {
- let json = {};
- for (let [short, long] of XPIState.prototype.fields) {
- if (long in this) {
- json[short] = this[long];
- }
- }
- return json;
- },
-
- /**
- * Update the last modified time for an add-on on disk.
- * @param aFile: nsIFile path of the add-on.
- * @param aId: The add-on ID.
- * @return True if the time stamp has changed.
- */
- getModTime(aFile, aId) {
- let changed = false;
- let scanStarted = Cu.now();
- // For an unknown or enabled add-on, we do a full recursive scan.
- if (!('scanTime' in this) || this.enabled) {
- logger.debug('getModTime: Recursive scan of ' + aId);
- let [modFile, modTime, items] = recursiveLastModifiedTime(aFile);
- XPIProvider._mostRecentlyModifiedFile[aId] = modFile;
- XPIProvider.setTelemetry(aId, "scan_items", items);
- if (modTime != this.scanTime) {
- this.scanTime = modTime;
- changed = true;
- }
- }
- // if the add-on is disabled, modified time is the install manifest time, if
- // any. If no manifest exists, we assume this is a packed .xpi and use
- // the time stamp of {path}
- try {
- // Get the install manifest update time, if any.
- let maniFile = getManifestFileForDir(aFile);
- if (!(aId in XPIProvider._mostRecentlyModifiedFile)) {
- XPIProvider._mostRecentlyModifiedFile[aId] = maniFile.leafName;
- }
- let maniTime = maniFile.lastModifiedTime;
- if (maniTime != this.manifestTime) {
- this.manifestTime = maniTime;
- changed = true;
- }
- } catch (e) {
- // No manifest
- delete this.manifestTime;
- try {
- let dtime = aFile.lastModifiedTime;
- if (dtime != this.scanTime) {
- changed = true;
- this.scanTime = dtime;
- }
- } catch (e) {
- logger.warn("Can't get modified time of ${file}: ${e}", {file: aFile.path, e: e});
- changed = true;
- this.scanTime = 0;
- }
- }
- // Record duration of file-modified check
- XPIProvider.setTelemetry(aId, "scan_MS", Math.round(Cu.now() - scanStarted));
-
- return changed;
- },
-
- /**
- * Update the XPIState to match an XPIDatabase entry; if 'enabled' is changed to true,
- * update the last-modified time. This should probably be made async, but for now we
- * don't want to maintain parallel sync and async versions of the scan.
- * Caller is responsible for doing XPIStates.save() if necessary.
- * @param aDBAddon The DBAddonInternal for this add-on.
- * @param aUpdated The add-on was updated, so we must record new modified time.
- */
- syncWithDB(aDBAddon, aUpdated = false) {
- logger.debug("Updating XPIState for " + JSON.stringify(aDBAddon));
- // If the add-on changes from disabled to enabled, we should re-check the modified time.
- // If this is a newly found add-on, it won't have an 'enabled' field but we
- // did a full recursive scan in that case, so we don't need to do it again.
- // We don't use aDBAddon.active here because it's not updated until after restart.
- let mustGetMod = (aDBAddon.visible && !aDBAddon.disabled && !this.enabled);
- this.enabled = (aDBAddon.visible && !aDBAddon.disabled);
- this.version = aDBAddon.version;
- // XXX Eventually also copy bootstrap, etc.
- if (aUpdated || mustGetMod) {
- this.getModTime(new nsIFile(this.descriptor), aDBAddon.id);
- if (this.scanTime != aDBAddon.updateDate) {
- aDBAddon.updateDate = this.scanTime;
- XPIDatabase.saveChanges();
- }
- }
- },
-};
-
-// Constructor for an ES6 Map that knows how to convert itself into a
-// regular object for toJSON().
-function SerializableMap() {
- let m = new Map();
- m.toJSON = function() {
- let out = {}
- for (let [key, val] of m) {
- out[key] = val;
- }
- return out;
- };
- return m;
-}
-
-/**
- * Keeps track of the state of XPI add-ons on the file system.
- */
-this.XPIStates = {
- // Map(location name -> Map(add-on ID -> XPIState))
- db: null,
-
- get size() {
- if (!this.db) {
- return 0;
- }
- let count = 0;
- for (let location of this.db.values()) {
- count += location.size;
- }
- return count;
- },
-
- /**
- * Load extension state data from preferences.
- */
- loadExtensionState() {
- let state = {};
-
- // Clear out old directory state cache.
- Preferences.reset(PREF_INSTALL_CACHE);
-
- let cache = Preferences.get(PREF_XPI_STATE, "{}");
- try {
- state = JSON.parse(cache);
- } catch (e) {
- logger.warn("Error parsing extensions.xpiState ${state}: ${error}",
- {state: cache, error: e});
- }
- logger.debug("Loaded add-on state from prefs: ${}", state);
- return state;
- },
-
- /**
- * Walk through all install locations, highest priority first,
- * comparing the on-disk state of extensions to what is stored in prefs.
- * @return true if anything has changed.
- */
- getInstallState() {
- let oldState = this.loadExtensionState();
- let changed = false;
- this.db = new SerializableMap();
-
- for (let location of XPIProvider.installLocations) {
- // The list of add-on like file/directory names in the install location.
- let addons = location.getAddonLocations();
- // The results of scanning this location.
- let foundAddons = new SerializableMap();
-
- // What our old state thinks should be in this location.
- let locState = {};
- if (location.name in oldState) {
- locState = oldState[location.name];
- // We've seen this location.
- delete oldState[location.name];
- }
-
- for (let [id, file] of addons) {
- if (!(id in locState)) {
- logger.debug("New add-on ${id} in ${location}", {id: id, location: location.name});
- let xpiState = new XPIState({d: file.persistentDescriptor});
- changed = xpiState.getModTime(file, id) || changed;
- foundAddons.set(id, xpiState);
- } else {
- let xpiState = new XPIState(locState[id]);
- // We found this add-on in the file system
- delete locState[id];
-
- changed = xpiState.getModTime(file, id) || changed;
-
- if (file.persistentDescriptor != xpiState.descriptor) {
- xpiState.descriptor = file.persistentDescriptor;
- changed = true;
- }
- if (changed) {
- logger.debug("Changed add-on ${id} in ${location}", {id: id, location: location.name});
- }
- else {
- logger.debug("Existing add-on ${id} in ${location}", {id: id, location: location.name});
- }
- foundAddons.set(id, xpiState);
- }
- XPIProvider.setTelemetry(id, "location", location.name);
- }
-
- // Anything left behind in oldState was removed from the file system.
- for (let id in locState) {
- changed = true;
- break;
- }
- // If we found anything, add this location to our database.
- if (foundAddons.size != 0) {
- this.db.set(location.name, foundAddons);
- }
- }
-
- // If there's anything left in oldState, an install location that held add-ons
- // was removed from the browser configuration.
- for (let location in oldState) {
- changed = true;
- break;
- }
-
- logger.debug("getInstallState changed: ${rv}, state: ${state}",
- {rv: changed, state: this.db});
- return changed;
- },
-
- /**
- * Get the Map of XPI states for a particular location.
- * @param aLocation The name of the install location.
- * @return Map (id -> XPIState) or null if there are no add-ons in the location.
- */
- getLocation(aLocation) {
- return this.db.get(aLocation);
- },
-
- /**
- * Get the XPI state for a specific add-on in a location.
- * If the state is not in our cache, return null.
- * @param aLocation The name of the location where the add-on is installed.
- * @param aId The add-on ID
- * @return The XPIState entry for the add-on, or null.
- */
- getAddon(aLocation, aId) {
- let location = this.db.get(aLocation);
- if (!location) {
- return null;
- }
- return location.get(aId);
- },
-
- /**
- * Find the highest priority location of an add-on by ID and return the
- * location and the XPIState.
- * @param aId The add-on ID
- * @return [locationName, XPIState] if the add-on is found, [undefined, undefined]
- * if the add-on is not found.
- */
- findAddon(aId) {
- // Fortunately the Map iterator returns in order of insertion, which is
- // also our highest -> lowest priority order.
- for (let [name, location] of this.db) {
- if (location.has(aId)) {
- return [name, location.get(aId)];
- }
- }
- return [undefined, undefined];
- },
-
- /**
- * Add a new XPIState for an add-on and synchronize it with the DBAddonInternal.
- * @param aAddon DBAddonInternal for the new add-on.
- */
- addAddon(aAddon) {
- let location = this.db.get(aAddon.location);
- if (!location) {
- // First add-on in this location.
- location = new SerializableMap();
- this.db.set(aAddon.location, location);
- }
- logger.debug("XPIStates adding add-on ${id} in ${location}: ${descriptor}", aAddon);
- let xpiState = new XPIState({d: aAddon.descriptor});
- location.set(aAddon.id, xpiState);
- xpiState.syncWithDB(aAddon, true);
- XPIProvider.setTelemetry(aAddon.id, "location", aAddon.location);
- },
-
- /**
- * Save the current state of installed add-ons.
- * XXX this *totally* should be a .json file using DeferredSave...
- */
- save() {
- let cache = JSON.stringify(this.db);
- Services.prefs.setCharPref(PREF_XPI_STATE, cache);
- },
-
- /**
- * Remove the XPIState for an add-on and save the new state.
- * @param aLocation The name of the add-on location.
- * @param aId The ID of the add-on.
- */
- removeAddon(aLocation, aId) {
- logger.debug("Removing XPIState for " + aLocation + ":" + aId);
- let location = this.db.get(aLocation);
- if (!location) {
- return;
- }
- location.delete(aId);
- if (location.size == 0) {
- this.db.delete(aLocation);
- }
- this.save();
- },
-};
-
-this.XPIProvider = {
- get name() {
- return "XPIProvider";
- },
-
- // An array of known install locations
- installLocations: null,
- // A dictionary of known install locations by name
- installLocationsByName: null,
- // An array of currently active AddonInstalls
- installs: null,
- // The default skin for the application
- defaultSkin: "classic/1.0",
- // The current skin used by the application
- currentSkin: null,
- // The selected skin to be used by the application when it is restarted. This
- // will be the same as currentSkin when it is the skin to be used when the
- // application is restarted
- selectedSkin: null,
- // The value of the minCompatibleAppVersion preference
- minCompatibleAppVersion: null,
- // The value of the minCompatiblePlatformVersion preference
- minCompatiblePlatformVersion: null,
- // A dictionary of the file descriptors for bootstrappable add-ons by ID
- bootstrappedAddons: {},
- // A Map of active addons to their bootstrapScope by ID
- activeAddons: new Map(),
- // True if the platform could have activated extensions
- extensionsActive: false,
- // True if all of the add-ons found during startup were installed in the
- // application install location
- allAppGlobal: true,
- // A string listing the enabled add-ons for annotating crash reports
- enabledAddons: null,
- // Keep track of startup phases for telemetry
- runPhase: XPI_STARTING,
- // Keep track of the newest file in each add-on, in case we want to
- // report it to telemetry.
- _mostRecentlyModifiedFile: {},
- // Per-addon telemetry information
- _telemetryDetails: {},
- // A Map from an add-on install to its ID
- _addonFileMap: new Map(),
- // Flag to know if ToolboxProcess.jsm has already been loaded by someone or not
- _toolboxProcessLoaded: false,
- // Have we started shutting down bootstrap add-ons?
- _closing: false,
-
- /**
- * Returns an array of the add-on values in `bootstrappedAddons`,
- * sorted so that all of an add-on's dependencies appear in the array
- * before itself.
- *
- * @returns {Array<object>}
- * A sorted array of add-on objects. Each value is a copy of the
- * corresponding value in the `bootstrappedAddons` object, with an
- * additional `id` property, which corresponds to the key in that
- * object, which is the same as the add-ons ID.
- */
- sortBootstrappedAddons: function() {
- let addons = {};
-
- // Sort the list of IDs so that the ordering is deterministic.
- for (let id of Object.keys(this.bootstrappedAddons).sort()) {
- addons[id] = Object.assign({id}, this.bootstrappedAddons[id]);
- }
-
- let res = new Set();
- let seen = new Set();
-
- let add = addon => {
- seen.add(addon.id);
-
- for (let id of addon.dependencies || []) {
- if (id in addons && !seen.has(id)) {
- add(addons[id]);
- }
- }
-
- res.add(addon.id);
- }
-
- Object.values(addons).forEach(add);
-
- return Array.from(res, id => addons[id]);
- },
-
- /*
- * Set a value in the telemetry hash for a given ID
- */
- setTelemetry: function(aId, aName, aValue) {
- if (!this._telemetryDetails[aId])
- this._telemetryDetails[aId] = {};
- this._telemetryDetails[aId][aName] = aValue;
- },
-
- // Keep track of in-progress operations that support cancel()
- _inProgress: [],
-
- doing: function(aCancellable) {
- this._inProgress.push(aCancellable);
- },
-
- done: function(aCancellable) {
- let i = this._inProgress.indexOf(aCancellable);
- if (i != -1) {
- this._inProgress.splice(i, 1);
- return true;
- }
- return false;
- },
-
- cancelAll: function() {
- // Cancelling one may alter _inProgress, so don't use a simple iterator
- while (this._inProgress.length > 0) {
- let c = this._inProgress.shift();
- try {
- c.cancel();
- }
- catch (e) {
- logger.warn("Cancel failed", e);
- }
- }
- },
-
- /**
- * Adds or updates a URI mapping for an Addon.id.
- *
- * Mappings should not be removed at any point. This is so that the mappings
- * will be still valid after an add-on gets disabled or uninstalled, as
- * consumers may still have URIs of (leaked) resources they want to map.
- */
- _addURIMapping: function(aID, aFile) {
- logger.info("Mapping " + aID + " to " + aFile.path);
- this._addonFileMap.set(aID, aFile.path);
-
- AddonPathService.insertPath(aFile.path, aID);
- },
-
- /**
- * Resolve a URI back to physical file.
- *
- * Of course, this works only for URIs pointing to local resources.
- *
- * @param aURI
- * URI to resolve
- * @return
- * resolved nsIFileURL
- */
- _resolveURIToFile: function(aURI) {
- switch (aURI.scheme) {
- case "jar":
- case "file":
- if (aURI instanceof Ci.nsIJARURI) {
- return this._resolveURIToFile(aURI.JARFile);
- }
- return aURI;
-
- case "chrome":
- aURI = ChromeRegistry.convertChromeURL(aURI);
- return this._resolveURIToFile(aURI);
-
- case "resource":
- aURI = Services.io.newURI(ResProtocolHandler.resolveURI(aURI), null,
- null);
- return this._resolveURIToFile(aURI);
-
- case "view-source":
- aURI = Services.io.newURI(aURI.path, null, null);
- return this._resolveURIToFile(aURI);
-
- case "about":
- if (aURI.spec == "about:blank") {
- // Do not attempt to map about:blank
- return null;
- }
-
- let chan;
- try {
- chan = NetUtil.newChannel({
- uri: aURI,
- loadUsingSystemPrincipal: true
- });
- }
- catch (ex) {
- return null;
- }
- // Avoid looping
- if (chan.URI.equals(aURI)) {
- return null;
- }
- // We want to clone the channel URI to avoid accidentially keeping
- // unnecessary references to the channel or implementation details
- // around.
- return this._resolveURIToFile(chan.URI.clone());
-
- default:
- return null;
- }
- },
-
- /**
- * Starts the XPI provider initializes the install locations and prefs.
- *
- * @param aAppChanged
- * A tri-state value. Undefined means the current profile was created
- * for this session, true means the profile already existed but was
- * last used with an application with a different version number,
- * false means that the profile was last used by this version of the
- * application.
- * @param aOldAppVersion
- * The version of the application last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aOldPlatformVersion
- * The version of the platform last run with this profile or null
- * if it is a new profile or the version is unknown
- */
- startup: function(aAppChanged, aOldAppVersion, aOldPlatformVersion) {
- function addDirectoryInstallLocation(aName, aKey, aPaths, aScope, aLocked) {
- try {
- var dir = FileUtils.getDir(aKey, aPaths);
- }
- catch (e) {
- // Some directories aren't defined on some platforms, ignore them
- logger.debug("Skipping unavailable install location " + aName);
- return;
- }
-
- try {
- var location = aLocked ? new DirectoryInstallLocation(aName, dir, aScope)
- : new MutableDirectoryInstallLocation(aName, dir, aScope);
- }
- catch (e) {
- logger.warn("Failed to add directory install location " + aName, e);
- return;
- }
-
- XPIProvider.installLocations.push(location);
- XPIProvider.installLocationsByName[location.name] = location;
- }
-
- function addSystemAddonInstallLocation(aName, aKey, aPaths, aScope) {
- try {
- var dir = FileUtils.getDir(aKey, aPaths);
- }
- catch (e) {
- // Some directories aren't defined on some platforms, ignore them
- logger.debug("Skipping unavailable install location " + aName);
- return;
- }
-
- try {
- var location = new SystemAddonInstallLocation(aName, dir, aScope, aAppChanged !== false);
- }
- catch (e) {
- logger.warn("Failed to add system add-on install location " + aName, e);
- return;
- }
-
- XPIProvider.installLocations.push(location);
- XPIProvider.installLocationsByName[location.name] = location;
- }
-
- function addRegistryInstallLocation(aName, aRootkey, aScope) {
- try {
- var location = new WinRegInstallLocation(aName, aRootkey, aScope);
- }
- catch (e) {
- logger.warn("Failed to add registry install location " + aName, e);
- return;
- }
-
- XPIProvider.installLocations.push(location);
- XPIProvider.installLocationsByName[location.name] = location;
- }
-
- try {
- AddonManagerPrivate.recordTimestamp("XPI_startup_begin");
-
- logger.debug("startup");
- this.runPhase = XPI_STARTING;
- this.installs = new Set();
- this.installLocations = [];
- this.installLocationsByName = {};
- // Hook for tests to detect when saving database at shutdown time fails
- this._shutdownError = null;
- // Clear this at startup for xpcshell test restarts
- this._telemetryDetails = {};
- // Register our details structure with AddonManager
- AddonManagerPrivate.setTelemetryDetails("XPI", this._telemetryDetails);
-
- let hasRegistry = ("nsIWindowsRegKey" in Ci);
-
- let enabledScopes = Preferences.get(PREF_EM_ENABLED_SCOPES,
- AddonManager.SCOPE_ALL);
-
- // These must be in order of priority, highest to lowest,
- // for processFileChanges etc. to work
-
- XPIProvider.installLocations.push(TemporaryInstallLocation);
- XPIProvider.installLocationsByName[TemporaryInstallLocation.name] =
- TemporaryInstallLocation;
-
- // The profile location is always enabled
- addDirectoryInstallLocation(KEY_APP_PROFILE, KEY_PROFILEDIR,
- [DIR_EXTENSIONS],
- AddonManager.SCOPE_PROFILE, false);
-
- addSystemAddonInstallLocation(KEY_APP_SYSTEM_ADDONS, KEY_PROFILEDIR,
- [DIR_SYSTEM_ADDONS],
- AddonManager.SCOPE_PROFILE);
-
- addDirectoryInstallLocation(KEY_APP_SYSTEM_DEFAULTS, KEY_APP_FEATURES,
- [], AddonManager.SCOPE_PROFILE, true);
-
- if (enabledScopes & AddonManager.SCOPE_USER) {
- addDirectoryInstallLocation(KEY_APP_SYSTEM_USER, "XREUSysExt",
- [Services.appinfo.ID],
- AddonManager.SCOPE_USER, true);
- if (hasRegistry) {
- addRegistryInstallLocation("winreg-app-user",
- Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER,
- AddonManager.SCOPE_USER);
- }
- }
-
- addDirectoryInstallLocation(KEY_APP_GLOBAL, KEY_ADDON_APP_DIR,
- [DIR_EXTENSIONS],
- AddonManager.SCOPE_APPLICATION, true);
-
- if (enabledScopes & AddonManager.SCOPE_SYSTEM) {
- addDirectoryInstallLocation(KEY_APP_SYSTEM_SHARE, "XRESysSExtPD",
- [Services.appinfo.ID],
- AddonManager.SCOPE_SYSTEM, true);
- addDirectoryInstallLocation(KEY_APP_SYSTEM_LOCAL, "XRESysLExtPD",
- [Services.appinfo.ID],
- AddonManager.SCOPE_SYSTEM, true);
- if (hasRegistry) {
- addRegistryInstallLocation("winreg-app-global",
- Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE,
- AddonManager.SCOPE_SYSTEM);
- }
- }
-
- let defaultPrefs = new Preferences({ defaultBranch: true });
- this.defaultSkin = defaultPrefs.get(PREF_GENERAL_SKINS_SELECTEDSKIN,
- "classic/1.0");
- this.currentSkin = Preferences.get(PREF_GENERAL_SKINS_SELECTEDSKIN,
- this.defaultSkin);
- this.selectedSkin = this.currentSkin;
- this.applyThemeChange();
-
- this.minCompatibleAppVersion = Preferences.get(PREF_EM_MIN_COMPAT_APP_VERSION,
- null);
- this.minCompatiblePlatformVersion = Preferences.get(PREF_EM_MIN_COMPAT_PLATFORM_VERSION,
- null);
- this.enabledAddons = "";
-
- Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this, false);
- Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this, false);
- if (!REQUIRE_SIGNING)
- Services.prefs.addObserver(PREF_XPI_SIGNATURES_REQUIRED, this, false);
- Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS, false);
-
- // Cu.isModuleLoaded can fail here for external XUL apps where there is
- // no chrome.manifest that defines resource://devtools.
- if (ResProtocolHandler.hasSubstitution("devtools")) {
- if (Cu.isModuleLoaded("resource://devtools/client/framework/ToolboxProcess.jsm")) {
- // If BrowserToolboxProcess is already loaded, set the boolean to true
- // and do whatever is needed
- this._toolboxProcessLoaded = true;
- BrowserToolboxProcess.on("connectionchange",
- this.onDebugConnectionChange.bind(this));
- } else {
- // Else, wait for it to load
- Services.obs.addObserver(this, NOTIFICATION_TOOLBOXPROCESS_LOADED, false);
- }
- }
-
- let flushCaches = this.checkForChanges(aAppChanged, aOldAppVersion,
- aOldPlatformVersion);
-
- // Changes to installed extensions may have changed which theme is selected
- this.applyThemeChange();
-
- AddonManagerPrivate.markProviderSafe(this);
-
- if (aAppChanged && !this.allAppGlobal &&
- Preferences.get(PREF_EM_SHOW_MISMATCH_UI, true)) {
- let addonsToUpdate = this.shouldForceUpdateCheck(aAppChanged);
- if (addonsToUpdate) {
- this.showUpgradeUI(addonsToUpdate);
- flushCaches = true;
- }
- }
-
- if (flushCaches) {
- Services.obs.notifyObservers(null, "startupcache-invalidate", null);
- // UI displayed early in startup (like the compatibility UI) may have
- // caused us to cache parts of the skin or locale in memory. These must
- // be flushed to allow extension provided skins and locales to take full
- // effect
- Services.obs.notifyObservers(null, "chrome-flush-skin-caches", null);
- Services.obs.notifyObservers(null, "chrome-flush-caches", null);
- }
-
- this.enabledAddons = Preferences.get(PREF_EM_ENABLED_ADDONS, "");
-
- if ("nsICrashReporter" in Ci &&
- Services.appinfo instanceof Ci.nsICrashReporter) {
- // Annotate the crash report with relevant add-on information.
- try {
- Services.appinfo.annotateCrashReport("Theme", this.currentSkin);
- } catch (e) { }
- try {
- Services.appinfo.annotateCrashReport("EMCheckCompatibility",
- AddonManager.checkCompatibility);
- } catch (e) { }
- this.addAddonsToCrashReporter();
- }
-
- try {
- AddonManagerPrivate.recordTimestamp("XPI_bootstrap_addons_begin");
-
- for (let addon of this.sortBootstrappedAddons()) {
- try {
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.persistentDescriptor = addon.descriptor;
- let reason = BOOTSTRAP_REASONS.APP_STARTUP;
- // Eventually set INSTALLED reason when a bootstrap addon
- // is dropped in profile folder and automatically installed
- if (AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED)
- .indexOf(addon.id) !== -1)
- reason = BOOTSTRAP_REASONS.ADDON_INSTALL;
- this.callBootstrapMethod(createAddonDetails(addon.id, addon),
- file, "startup", reason);
- }
- catch (e) {
- logger.error("Failed to load bootstrap addon " + addon.id + " from " +
- addon.descriptor, e);
- }
- }
- AddonManagerPrivate.recordTimestamp("XPI_bootstrap_addons_end");
- }
- catch (e) {
- logger.error("bootstrap startup failed", e);
- AddonManagerPrivate.recordException("XPI-BOOTSTRAP", "startup failed", e);
- }
-
- // Let these shutdown a little earlier when they still have access to most
- // of XPCOM
- Services.obs.addObserver({
- observe: function(aSubject, aTopic, aData) {
- XPIProvider._closing = true;
- for (let addon of XPIProvider.sortBootstrappedAddons().reverse()) {
- // If no scope has been loaded for this add-on then there is no need
- // to shut it down (should only happen when a bootstrapped add-on is
- // pending enable)
- if (!XPIProvider.activeAddons.has(addon.id))
- continue;
-
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.persistentDescriptor = addon.descriptor;
- let addonDetails = createAddonDetails(addon.id, addon);
-
- // If the add-on was pending disable then shut it down and remove it
- // from the persisted data.
- if (addon.disable) {
- XPIProvider.callBootstrapMethod(addonDetails, file, "shutdown",
- BOOTSTRAP_REASONS.ADDON_DISABLE);
- delete XPIProvider.bootstrappedAddons[addon.id];
- }
- else {
- XPIProvider.callBootstrapMethod(addonDetails, file, "shutdown",
- BOOTSTRAP_REASONS.APP_SHUTDOWN);
- }
- }
- Services.obs.removeObserver(this, "quit-application-granted");
- }
- }, "quit-application-granted", false);
-
- // Detect final-ui-startup for telemetry reporting
- Services.obs.addObserver({
- observe: function(aSubject, aTopic, aData) {
- AddonManagerPrivate.recordTimestamp("XPI_finalUIStartup");
- XPIProvider.runPhase = XPI_AFTER_UI_STARTUP;
- Services.obs.removeObserver(this, "final-ui-startup");
- }
- }, "final-ui-startup", false);
-
- AddonManagerPrivate.recordTimestamp("XPI_startup_end");
-
- this.extensionsActive = true;
- this.runPhase = XPI_BEFORE_UI_STARTUP;
-
- let timerManager = Cc["@mozilla.org/updates/timer-manager;1"].
- getService(Ci.nsIUpdateTimerManager);
- timerManager.registerTimer("xpi-signature-verification", () => {
- this.verifySignatures();
- }, XPI_SIGNATURE_CHECK_PERIOD);
- }
- catch (e) {
- logger.error("startup failed", e);
- AddonManagerPrivate.recordException("XPI", "startup failed", e);
- }
- },
-
- /**
- * Shuts down the database and releases all references.
- * Return: Promise{integer} resolves / rejects with the result of
- * flushing the XPI Database if it was loaded,
- * 0 otherwise.
- */
- shutdown: function() {
- logger.debug("shutdown");
-
- // Stop anything we were doing asynchronously
- this.cancelAll();
-
- this.bootstrappedAddons = {};
- this.activeAddons.clear();
- this.enabledAddons = null;
- this.allAppGlobal = true;
-
- // If there are pending operations then we must update the list of active
- // add-ons
- if (Preferences.get(PREF_PENDING_OPERATIONS, false)) {
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_pending_ops", 1);
- XPIDatabase.updateActiveAddons();
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS,
- !XPIDatabase.writeAddonsList());
- }
-
- this.installs = null;
- this.installLocations = null;
- this.installLocationsByName = null;
-
- // This is needed to allow xpcshell tests to simulate a restart
- this.extensionsActive = false;
- this._addonFileMap.clear();
-
- if (gLazyObjectsLoaded) {
- let done = XPIDatabase.shutdown();
- done.then(
- ret => {
- logger.debug("Notifying XPI shutdown observers");
- Services.obs.notifyObservers(null, "xpi-provider-shutdown", null);
- },
- err => {
- logger.debug("Notifying XPI shutdown observers");
- this._shutdownError = err;
- Services.obs.notifyObservers(null, "xpi-provider-shutdown", err);
- }
- );
- return done;
- }
- logger.debug("Notifying XPI shutdown observers");
- Services.obs.notifyObservers(null, "xpi-provider-shutdown", null);
- return undefined;
- },
-
- /**
- * Applies any pending theme change to the preferences.
- */
- applyThemeChange: function() {
- if (!Preferences.get(PREF_DSS_SWITCHPENDING, false))
- return;
-
- // Tell the Chrome Registry which Skin to select
- try {
- this.selectedSkin = Preferences.get(PREF_DSS_SKIN_TO_SELECT);
- Services.prefs.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN,
- this.selectedSkin);
- Services.prefs.clearUserPref(PREF_DSS_SKIN_TO_SELECT);
- logger.debug("Changed skin to " + this.selectedSkin);
- this.currentSkin = this.selectedSkin;
- }
- catch (e) {
- logger.error("Error applying theme change", e);
- }
- Services.prefs.clearUserPref(PREF_DSS_SWITCHPENDING);
- },
-
- /**
- * If the application has been upgraded and there are add-ons outside the
- * application directory then we may need to synchronize compatibility
- * information but only if the mismatch UI isn't disabled.
- *
- * @returns False if no update check is needed, otherwise an array of add-on
- * IDs to check for updates. Array may be empty if no add-ons can be/need
- * to be updated, but the metadata check needs to be performed.
- */
- shouldForceUpdateCheck: function(aAppChanged) {
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_metadata_age", AddonRepository.metadataAge());
-
- let startupChanges = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED);
- logger.debug("shouldForceUpdateCheck startupChanges: " + startupChanges.toSource());
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startup_disabled", startupChanges.length);
-
- let forceUpdate = [];
- if (startupChanges.length > 0) {
- let addons = XPIDatabase.getAddons();
- for (let addon of addons) {
- if ((startupChanges.indexOf(addon.id) != -1) &&
- (addon.permissions() & AddonManager.PERM_CAN_UPGRADE) &&
- !addon.isCompatible) {
- logger.debug("shouldForceUpdateCheck: can upgrade disabled add-on " + addon.id);
- forceUpdate.push(addon.id);
- }
- }
- }
-
- if (AddonRepository.isMetadataStale()) {
- logger.debug("shouldForceUpdateCheck: metadata is stale");
- return forceUpdate;
- }
- if (forceUpdate.length > 0) {
- return forceUpdate;
- }
-
- return false;
- },
-
- /**
- * Shows the "Compatibility Updates" UI.
- *
- * @param aAddonIDs
- * Array opf addon IDs that were disabled by the application update, and
- * should therefore be checked for updates.
- */
- showUpgradeUI: function(aAddonIDs) {
- logger.debug("XPI_showUpgradeUI: " + aAddonIDs.toSource());
- Services.telemetry.getHistogramById("ADDON_MANAGER_UPGRADE_UI_SHOWN").add(1);
-
- // Flip a flag to indicate that we interrupted startup with an interactive prompt
- Services.startup.interrupted = true;
-
- var variant = Cc["@mozilla.org/variant;1"].
- createInstance(Ci.nsIWritableVariant);
- variant.setFromVariant(aAddonIDs);
-
- // This *must* be modal as it has to block startup.
- var features = "chrome,centerscreen,dialog,titlebar,modal";
- var ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
- getService(Ci.nsIWindowWatcher);
- ww.openWindow(null, URI_EXTENSION_UPDATE_DIALOG, "", features, variant);
-
- // Ensure any changes to the add-ons list are flushed to disk
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS,
- !XPIDatabase.writeAddonsList());
- },
-
- updateSystemAddons: Task.async(function*() {
- let systemAddonLocation = XPIProvider.installLocationsByName[KEY_APP_SYSTEM_ADDONS];
- if (!systemAddonLocation)
- return;
-
- // Don't do anything in safe mode
- if (Services.appinfo.inSafeMode)
- return;
-
- // Download the list of system add-ons
- let url = Preferences.get(PREF_SYSTEM_ADDON_UPDATE_URL, null);
- if (!url) {
- yield systemAddonLocation.cleanDirectories();
- return;
- }
-
- url = UpdateUtils.formatUpdateURL(url);
-
- logger.info(`Starting system add-on update check from ${url}.`);
- let res = yield ProductAddonChecker.getProductAddonList(url);
-
- // If there was no list then do nothing.
- if (!res || !res.gmpAddons) {
- logger.info("No system add-ons list was returned.");
- yield systemAddonLocation.cleanDirectories();
- return;
- }
-
- let addonList = new Map(
- res.gmpAddons.map(spec => [spec.id, { spec, path: null, addon: null }]));
-
- let getAddonsInLocation = (location) => {
- return new Promise(resolve => {
- XPIDatabase.getAddonsInLocation(location, resolve);
- });
- };
-
- let setMatches = (wanted, existing) => {
- if (wanted.size != existing.size)
- return false;
-
- for (let [id, addon] of existing) {
- let wantedInfo = wanted.get(id);
-
- if (!wantedInfo)
- return false;
- if (wantedInfo.spec.version != addon.version)
- return false;
- }
-
- return true;
- };
-
- // If this matches the current set in the profile location then do nothing.
- let updatedAddons = addonMap(yield getAddonsInLocation(KEY_APP_SYSTEM_ADDONS));
- if (setMatches(addonList, updatedAddons)) {
- logger.info("Retaining existing updated system add-ons.");
- yield systemAddonLocation.cleanDirectories();
- return;
- }
-
- // If this matches the current set in the default location then reset the
- // updated set.
- let defaultAddons = addonMap(yield getAddonsInLocation(KEY_APP_SYSTEM_DEFAULTS));
- if (setMatches(addonList, defaultAddons)) {
- logger.info("Resetting system add-ons.");
- systemAddonLocation.resetAddonSet();
- yield systemAddonLocation.cleanDirectories();
- return;
- }
-
- // Download all the add-ons
- let downloadAddon = Task.async(function*(item) {
- try {
- let sourceAddon = updatedAddons.get(item.spec.id);
- if (sourceAddon && sourceAddon.version == item.spec.version) {
- // Copying the file to a temporary location has some benefits. If the
- // file is locked and cannot be read then we'll fall back to
- // downloading a fresh copy. It also means we don't have to remember
- // whether to delete the temporary copy later.
- try {
- let path = OS.Path.join(OS.Constants.Path.tmpDir, "tmpaddon");
- let unique = yield OS.File.openUnique(path);
- unique.file.close();
- yield OS.File.copy(sourceAddon._sourceBundle.path, unique.path);
- // Make sure to update file modification times so this is detected
- // as a new add-on.
- yield OS.File.setDates(unique.path);
- item.path = unique.path;
- }
- catch (e) {
- logger.warn(`Failed make temporary copy of ${sourceAddon._sourceBundle.path}.`, e);
- }
- }
- if (!item.path) {
- item.path = yield ProductAddonChecker.downloadAddon(item.spec);
- }
- item.addon = yield loadManifestFromFile(nsIFile(item.path), systemAddonLocation);
- }
- catch (e) {
- logger.error(`Failed to download system add-on ${item.spec.id}`, e);
- }
- });
- yield Promise.all(Array.from(addonList.values()).map(downloadAddon));
-
- // The download promises all resolve regardless, now check if they all
- // succeeded
- let validateAddon = (item) => {
- if (item.spec.id != item.addon.id) {
- logger.warn(`Downloaded system add-on expected to be ${item.spec.id} but was ${item.addon.id}.`);
- return false;
- }
-
- if (item.spec.version != item.addon.version) {
- logger.warn(`Expected system add-on ${item.spec.id} to be version ${item.spec.version} but was ${item.addon.version}.`);
- return false;
- }
-
- if (!systemAddonLocation.isValidAddon(item.addon))
- return false;
-
- return true;
- }
-
- if (!Array.from(addonList.values()).every(item => item.path && item.addon && validateAddon(item))) {
- throw new Error("Rejecting updated system add-on set that either could not " +
- "be downloaded or contained unusable add-ons.");
- }
-
- // Install into the install location
- logger.info("Installing new system add-on set");
- yield systemAddonLocation.installAddonSet(Array.from(addonList.values())
- .map(a => a.addon));
- }),
-
- /**
- * Verifies that all installed add-ons are still correctly signed.
- */
- verifySignatures: function() {
- XPIDatabase.getAddonList(a => true, (addons) => {
- Task.spawn(function*() {
- let changes = {
- enabled: [],
- disabled: []
- };
-
- for (let addon of addons) {
- // The add-on might have vanished, we'll catch that on the next startup
- if (!addon._sourceBundle.exists())
- continue;
-
- let signedState = yield verifyBundleSignedState(addon._sourceBundle, addon);
-
- if (signedState != addon.signedState) {
- addon.signedState = signedState;
- AddonManagerPrivate.callAddonListeners("onPropertyChanged",
- addon.wrapper,
- ["signedState"]);
- }
-
- let disabled = XPIProvider.updateAddonDisabledState(addon);
- if (disabled !== undefined)
- changes[disabled ? "disabled" : "enabled"].push(addon.id);
- }
-
- XPIDatabase.saveChanges();
-
- Services.obs.notifyObservers(null, "xpi-signature-changed", JSON.stringify(changes));
- }).then(null, err => {
- logger.error("XPI_verifySignature: " + err);
- })
- });
- },
-
- /**
- * Persists changes to XPIProvider.bootstrappedAddons to its store (a pref).
- */
- persistBootstrappedAddons: function() {
- // Experiments are disabled upon app load, so don't persist references.
- let filtered = {};
- for (let id in this.bootstrappedAddons) {
- let entry = this.bootstrappedAddons[id];
- if (entry.type == "experiment") {
- continue;
- }
-
- filtered[id] = entry;
- }
-
- Services.prefs.setCharPref(PREF_BOOTSTRAP_ADDONS,
- JSON.stringify(filtered));
- },
-
- /**
- * Adds a list of currently active add-ons to the next crash report.
- */
- addAddonsToCrashReporter: function() {
- if (!("nsICrashReporter" in Ci) ||
- !(Services.appinfo instanceof Ci.nsICrashReporter))
- return;
-
- // In safe mode no add-ons are loaded so we should not include them in the
- // crash report
- if (Services.appinfo.inSafeMode)
- return;
-
- let data = this.enabledAddons;
- for (let id in this.bootstrappedAddons) {
- data += (data ? "," : "") + encodeURIComponent(id) + ":" +
- encodeURIComponent(this.bootstrappedAddons[id].version);
- }
-
- try {
- Services.appinfo.annotateCrashReport("Add-ons", data);
- }
- catch (e) { }
-
- let TelemetrySession =
- Cu.import("resource://gre/modules/TelemetrySession.jsm", {}).TelemetrySession;
- TelemetrySession.setAddOns(data);
- },
-
- /**
- * Check the staging directories of install locations for any add-ons to be
- * installed or add-ons to be uninstalled.
- *
- * @param aManifests
- * A dictionary to add detected install manifests to for the purpose
- * of passing through updated compatibility information
- * @return true if an add-on was installed or uninstalled
- */
- processPendingFileChanges: function(aManifests) {
- let changed = false;
- for (let location of this.installLocations) {
- aManifests[location.name] = {};
- // We can't install or uninstall anything in locked locations
- if (location.locked) {
- continue;
- }
-
- let stagingDir = location.getStagingDir();
-
- try {
- if (!stagingDir || !stagingDir.exists() || !stagingDir.isDirectory())
- continue;
- }
- catch (e) {
- logger.warn("Failed to find staging directory", e);
- continue;
- }
-
- let seenFiles = [];
- // Use a snapshot of the directory contents to avoid possible issues with
- // iterating over a directory while removing files from it (the YAFFS2
- // embedded filesystem has this issue, see bug 772238), and to remove
- // normal files before their resource forks on OSX (see bug 733436).
- let stagingDirEntries = getDirectoryEntries(stagingDir, true);
- for (let stageDirEntry of stagingDirEntries) {
- let id = stageDirEntry.leafName;
-
- let isDir;
- try {
- isDir = stageDirEntry.isDirectory();
- }
- catch (e) {
- if (e.result != Cr.NS_ERROR_FILE_TARGET_DOES_NOT_EXIST)
- throw e;
- // If the file has already gone away then don't worry about it, this
- // can happen on OSX where the resource fork is automatically moved
- // with the data fork for the file. See bug 733436.
- continue;
- }
-
- if (!isDir) {
- if (id.substring(id.length - 4).toLowerCase() == ".xpi") {
- id = id.substring(0, id.length - 4);
- }
- else {
- if (id.substring(id.length - 5).toLowerCase() != ".json") {
- logger.warn("Ignoring file: " + stageDirEntry.path);
- seenFiles.push(stageDirEntry.leafName);
- }
- continue;
- }
- }
-
- // Check that the directory's name is a valid ID.
- if (!gIDTest.test(id)) {
- logger.warn("Ignoring directory whose name is not a valid add-on ID: " +
- stageDirEntry.path);
- seenFiles.push(stageDirEntry.leafName);
- continue;
- }
-
- changed = true;
-
- if (isDir) {
- // Check if the directory contains an install manifest.
- let manifest = getManifestFileForDir(stageDirEntry);
-
- // If the install manifest doesn't exist uninstall this add-on in this
- // install location.
- if (!manifest) {
- logger.debug("Processing uninstall of " + id + " in " + location.name);
-
- try {
- let addonFile = location.getLocationForID(id);
- let addonToUninstall = syncLoadManifestFromFile(addonFile, location);
- if (addonToUninstall.bootstrap) {
- this.callBootstrapMethod(addonToUninstall, addonToUninstall._sourceBundle,
- "uninstall", BOOTSTRAP_REASONS.ADDON_UNINSTALL);
- }
- }
- catch (e) {
- logger.warn("Failed to call uninstall for " + id, e);
- }
-
- try {
- location.uninstallAddon(id);
- seenFiles.push(stageDirEntry.leafName);
- }
- catch (e) {
- logger.error("Failed to uninstall add-on " + id + " in " + location.name, e);
- }
- // The file check later will spot the removal and cleanup the database
- continue;
- }
- }
-
- aManifests[location.name][id] = null;
- let existingAddonID = id;
-
- let jsonfile = stagingDir.clone();
- jsonfile.append(id + ".json");
- // Assume this was a foreign install if there is no cached metadata file
- let foreignInstall = !jsonfile.exists();
- let addon;
-
- try {
- addon = syncLoadManifestFromFile(stageDirEntry, location);
- }
- catch (e) {
- logger.error("Unable to read add-on manifest from " + stageDirEntry.path, e);
- // This add-on can't be installed so just remove it now
- seenFiles.push(stageDirEntry.leafName);
- seenFiles.push(jsonfile.leafName);
- continue;
- }
-
- if (mustSign(addon.type) &&
- addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
- logger.warn("Refusing to install staged add-on " + id + " with signed state " + addon.signedState);
- seenFiles.push(stageDirEntry.leafName);
- seenFiles.push(jsonfile.leafName);
- continue;
- }
-
- // Check for a cached metadata for this add-on, it may contain updated
- // compatibility information
- if (!foreignInstall) {
- logger.debug("Found updated metadata for " + id + " in " + location.name);
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- let json = Cc["@mozilla.org/dom/json;1"].
- createInstance(Ci.nsIJSON);
-
- try {
- fis.init(jsonfile, -1, 0, 0);
- let metadata = json.decodeFromStream(fis, jsonfile.fileSize);
- addon.importMetadata(metadata);
-
- // Pass this through to addMetadata so it knows this add-on was
- // likely installed through the UI
- aManifests[location.name][id] = addon;
- }
- catch (e) {
- // If some data can't be recovered from the cached metadata then it
- // is unlikely to be a problem big enough to justify throwing away
- // the install, just log an error and continue
- logger.error("Unable to read metadata from " + jsonfile.path, e);
- }
- finally {
- fis.close();
- }
- }
- seenFiles.push(jsonfile.leafName);
-
- existingAddonID = addon.existingAddonID || id;
-
- var oldBootstrap = null;
- logger.debug("Processing install of " + id + " in " + location.name);
- if (existingAddonID in this.bootstrappedAddons) {
- try {
- var existingAddon = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- existingAddon.persistentDescriptor = this.bootstrappedAddons[existingAddonID].descriptor;
- if (existingAddon.exists()) {
- oldBootstrap = this.bootstrappedAddons[existingAddonID];
-
- // We'll be replacing a currently active bootstrapped add-on so
- // call its uninstall method
- let newVersion = addon.version;
- let oldVersion = oldBootstrap.version;
- let uninstallReason = Services.vc.compare(oldVersion, newVersion) < 0 ?
- BOOTSTRAP_REASONS.ADDON_UPGRADE :
- BOOTSTRAP_REASONS.ADDON_DOWNGRADE;
-
- this.callBootstrapMethod(createAddonDetails(existingAddonID, oldBootstrap),
- existingAddon, "uninstall", uninstallReason,
- { newVersion: newVersion });
- this.unloadBootstrapScope(existingAddonID);
- flushChromeCaches();
- }
- }
- catch (e) {
- }
- }
-
- try {
- addon._sourceBundle = location.installAddon({
- id,
- source: stageDirEntry,
- existingAddonID
- });
- }
- catch (e) {
- logger.error("Failed to install staged add-on " + id + " in " + location.name,
- e);
- // Re-create the staged install
- new StagedAddonInstall(location, stageDirEntry, addon);
- // Make sure not to delete the cached manifest json file
- seenFiles.pop();
-
- delete aManifests[location.name][id];
-
- if (oldBootstrap) {
- // Re-install the old add-on
- this.callBootstrapMethod(createAddonDetails(existingAddonID, oldBootstrap),
- existingAddon, "install",
- BOOTSTRAP_REASONS.ADDON_INSTALL);
- }
- continue;
- }
- }
-
- try {
- location.cleanStagingDir(seenFiles);
- }
- catch (e) {
- // Non-critical, just saves some perf on startup if we clean this up.
- logger.debug("Error cleaning staging dir " + stagingDir.path, e);
- }
- }
- return changed;
- },
-
- /**
- * Installs any add-ons located in the extensions directory of the
- * application's distribution specific directory into the profile unless a
- * newer version already exists or the user has previously uninstalled the
- * distributed add-on.
- *
- * @param aManifests
- * A dictionary to add new install manifests to to save having to
- * reload them later
- * @param aAppChanged
- * See checkForChanges
- * @return true if any new add-ons were installed
- */
- installDistributionAddons: function(aManifests, aAppChanged) {
- let distroDir;
- try {
- distroDir = FileUtils.getDir(KEY_APP_DISTRIBUTION, [DIR_EXTENSIONS]);
- }
- catch (e) {
- return false;
- }
-
- if (!distroDir.exists())
- return false;
-
- if (!distroDir.isDirectory())
- return false;
-
- let changed = false;
- let profileLocation = this.installLocationsByName[KEY_APP_PROFILE];
-
- let entries = distroDir.directoryEntries
- .QueryInterface(Ci.nsIDirectoryEnumerator);
- let entry;
- while ((entry = entries.nextFile)) {
-
- let id = entry.leafName;
-
- if (entry.isFile()) {
- if (id.substring(id.length - 4).toLowerCase() == ".xpi") {
- id = id.substring(0, id.length - 4);
- }
- else {
- logger.debug("Ignoring distribution add-on that isn't an XPI: " + entry.path);
- continue;
- }
- }
- else if (!entry.isDirectory()) {
- logger.debug("Ignoring distribution add-on that isn't a file or directory: " +
- entry.path);
- continue;
- }
-
- if (!gIDTest.test(id)) {
- logger.debug("Ignoring distribution add-on whose name is not a valid add-on ID: " +
- entry.path);
- continue;
- }
-
- /* If this is not an upgrade and we've already handled this extension
- * just continue */
- if (!aAppChanged && Preferences.isSet(PREF_BRANCH_INSTALLED_ADDON + id)) {
- continue;
- }
-
- let addon;
- try {
- addon = syncLoadManifestFromFile(entry, profileLocation);
- }
- catch (e) {
- logger.warn("File entry " + entry.path + " contains an invalid add-on", e);
- continue;
- }
-
- if (addon.id != id) {
- logger.warn("File entry " + entry.path + " contains an add-on with an " +
- "incorrect ID")
- continue;
- }
-
- let existingEntry = null;
- try {
- existingEntry = profileLocation.getLocationForID(id);
- }
- catch (e) {
- }
-
- if (existingEntry) {
- let existingAddon;
- try {
- existingAddon = syncLoadManifestFromFile(existingEntry, profileLocation);
-
- if (Services.vc.compare(addon.version, existingAddon.version) <= 0)
- continue;
- }
- catch (e) {
- // Bad add-on in the profile so just proceed and install over the top
- logger.warn("Profile contains an add-on with a bad or missing install " +
- "manifest at " + existingEntry.path + ", overwriting", e);
- }
- }
- else if (Preferences.get(PREF_BRANCH_INSTALLED_ADDON + id, false)) {
- continue;
- }
-
- // Install the add-on
- try {
- addon._sourceBundle = profileLocation.installAddon({ id, source: entry, action: "copy" });
- logger.debug("Installed distribution add-on " + id);
-
- Services.prefs.setBoolPref(PREF_BRANCH_INSTALLED_ADDON + id, true)
-
- // aManifests may contain a copy of a newly installed add-on's manifest
- // and we'll have overwritten that so instead cache our install manifest
- // which will later be put into the database in processFileChanges
- if (!(KEY_APP_PROFILE in aManifests))
- aManifests[KEY_APP_PROFILE] = {};
- aManifests[KEY_APP_PROFILE][id] = addon;
- changed = true;
- }
- catch (e) {
- logger.error("Failed to install distribution add-on " + entry.path, e);
- }
- }
-
- entries.close();
-
- return changed;
- },
-
- /**
- * Imports the xpinstall permissions from preferences into the permissions
- * manager for the user to change later.
- */
- importPermissions: function() {
- PermissionsUtils.importFromPrefs(PREF_XPI_PERMISSIONS_BRANCH,
- XPI_PERMISSION);
- },
-
- getDependentAddons: function(aAddon) {
- return Array.from(XPIDatabase.getAddons())
- .filter(addon => addon.dependencies.includes(aAddon.id));
- },
-
- /**
- * Checks for any changes that have occurred since the last time the
- * application was launched.
- *
- * @param aAppChanged
- * A tri-state value. Undefined means the current profile was created
- * for this session, true means the profile already existed but was
- * last used with an application with a different version number,
- * false means that the profile was last used by this version of the
- * application.
- * @param aOldAppVersion
- * The version of the application last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aOldPlatformVersion
- * The version of the platform last run with this profile or null
- * if it is a new profile or the version is unknown
- * @return true if a change requiring a restart was detected
- */
- checkForChanges: function(aAppChanged, aOldAppVersion,
- aOldPlatformVersion) {
- logger.debug("checkForChanges");
-
- // Keep track of whether and why we need to open and update the database at
- // startup time.
- let updateReasons = [];
- if (aAppChanged) {
- updateReasons.push("appChanged");
- }
-
- // Load the list of bootstrapped add-ons first so processFileChanges can
- // modify it
- // XXX eventually get rid of bootstrappedAddons
- try {
- this.bootstrappedAddons = JSON.parse(Preferences.get(PREF_BOOTSTRAP_ADDONS,
- "{}"));
- } catch (e) {
- logger.warn("Error parsing enabled bootstrapped extensions cache", e);
- }
-
- // First install any new add-ons into the locations, if there are any
- // changes then we must update the database with the information in the
- // install locations
- let manifests = {};
- let updated = this.processPendingFileChanges(manifests);
- if (updated) {
- updateReasons.push("pendingFileChanges");
- }
-
- // This will be true if the previous session made changes that affect the
- // active state of add-ons but didn't commit them properly (normally due
- // to the application crashing)
- let hasPendingChanges = Preferences.get(PREF_PENDING_OPERATIONS);
- if (hasPendingChanges) {
- updateReasons.push("hasPendingChanges");
- }
-
- // If the application has changed then check for new distribution add-ons
- if (Preferences.get(PREF_INSTALL_DISTRO_ADDONS, true))
- {
- updated = this.installDistributionAddons(manifests, aAppChanged);
- if (updated) {
- updateReasons.push("installDistributionAddons");
- }
- }
-
- // Telemetry probe added around getInstallState() to check perf
- let telemetryCaptureTime = Cu.now();
- let installChanged = XPIStates.getInstallState();
- let telemetry = Services.telemetry;
- telemetry.getHistogramById("CHECK_ADDONS_MODIFIED_MS").add(Math.round(Cu.now() - telemetryCaptureTime));
- if (installChanged) {
- updateReasons.push("directoryState");
- }
-
- let haveAnyAddons = (XPIStates.size > 0);
-
- // If the schema appears to have changed then we should update the database
- if (DB_SCHEMA != Preferences.get(PREF_DB_SCHEMA, 0)) {
- // If we don't have any add-ons, just update the pref, since we don't need to
- // write the database
- if (!haveAnyAddons) {
- logger.debug("Empty XPI database, setting schema version preference to " + DB_SCHEMA);
- Services.prefs.setIntPref(PREF_DB_SCHEMA, DB_SCHEMA);
- }
- else {
- updateReasons.push("schemaChanged");
- }
- }
-
- // If the database doesn't exist and there are add-ons installed then we
- // must update the database however if there are no add-ons then there is
- // no need to update the database.
- let dbFile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true);
- if (!dbFile.exists() && haveAnyAddons) {
- updateReasons.push("needNewDatabase");
- }
-
- // XXX This will go away when we fold bootstrappedAddons into XPIStates.
- if (updateReasons.length == 0) {
- let bootstrapDescriptors = new Set(Object.keys(this.bootstrappedAddons)
- .map(b => this.bootstrappedAddons[b].descriptor));
-
- for (let location of XPIStates.db.values()) {
- for (let state of location.values()) {
- bootstrapDescriptors.delete(state.descriptor);
- }
- }
-
- if (bootstrapDescriptors.size > 0) {
- logger.warn("Bootstrap state is invalid (missing add-ons: "
- + Array.from(bootstrapDescriptors).join(", ") + ")");
- updateReasons.push("missingBootstrapAddon");
- }
- }
-
- // Catch and log any errors during the main startup
- try {
- let extensionListChanged = false;
- // If the database needs to be updated then open it and then update it
- // from the filesystem
- if (updateReasons.length > 0) {
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startup_load_reasons", updateReasons);
- XPIDatabase.syncLoadDB(false);
- try {
- extensionListChanged = XPIDatabaseReconcile.processFileChanges(manifests,
- aAppChanged,
- aOldAppVersion,
- aOldPlatformVersion,
- updateReasons.includes("schemaChanged"));
- }
- catch (e) {
- logger.error("Failed to process extension changes at startup", e);
- }
- }
-
- if (aAppChanged) {
- // When upgrading the app and using a custom skin make sure it is still
- // compatible otherwise switch back the default
- if (this.currentSkin != this.defaultSkin) {
- let oldSkin = XPIDatabase.getVisibleAddonForInternalName(this.currentSkin);
- if (!oldSkin || oldSkin.disabled)
- this.enableDefaultTheme();
- }
-
- // When upgrading remove the old extensions cache to force older
- // versions to rescan the entire list of extensions
- let oldCache = FileUtils.getFile(KEY_PROFILEDIR, [FILE_OLD_CACHE], true);
- try {
- if (oldCache.exists())
- oldCache.remove(true);
- }
- catch (e) {
- logger.warn("Unable to remove old extension cache " + oldCache.path, e);
- }
- }
-
- // If the application crashed before completing any pending operations then
- // we should perform them now.
- if (extensionListChanged || hasPendingChanges) {
- logger.debug("Updating database with changes to installed add-ons");
- XPIDatabase.updateActiveAddons();
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS,
- !XPIDatabase.writeAddonsList());
- Services.prefs.setCharPref(PREF_BOOTSTRAP_ADDONS,
- JSON.stringify(this.bootstrappedAddons));
- return true;
- }
-
- logger.debug("No changes found");
- }
- catch (e) {
- logger.error("Error during startup file checks", e);
- }
-
- // Check that the add-ons list still exists
- let addonsList = FileUtils.getFile(KEY_PROFILEDIR, [FILE_XPI_ADDONS_LIST],
- true);
- // the addons list file should exist if and only if we have add-ons installed
- if (addonsList.exists() != haveAnyAddons) {
- logger.debug("Add-ons list is invalid, rebuilding");
- XPIDatabase.writeAddonsList();
- }
-
- return false;
- },
-
- /**
- * Called to test whether this provider supports installing a particular
- * mimetype.
- *
- * @param aMimetype
- * The mimetype to check for
- * @return true if the mimetype is application/x-xpinstall
- */
- supportsMimetype: function(aMimetype) {
- return aMimetype == "application/x-xpinstall";
- },
-
- /**
- * Called to test whether installing XPI add-ons is enabled.
- *
- * @return true if installing is enabled
- */
- isInstallEnabled: function() {
- // Default to enabled if the preference does not exist
- return Preferences.get(PREF_XPI_ENABLED, true);
- },
-
- /**
- * Called to test whether installing XPI add-ons by direct URL requests is
- * whitelisted.
- *
- * @return true if installing by direct requests is whitelisted
- */
- isDirectRequestWhitelisted: function() {
- // Default to whitelisted if the preference does not exist.
- return Preferences.get(PREF_XPI_DIRECT_WHITELISTED, true);
- },
-
- /**
- * Called to test whether installing XPI add-ons from file referrers is
- * whitelisted.
- *
- * @return true if installing from file referrers is whitelisted
- */
- isFileRequestWhitelisted: function() {
- // Default to whitelisted if the preference does not exist.
- return Preferences.get(PREF_XPI_FILE_WHITELISTED, true);
- },
-
- /**
- * Called to test whether installing XPI add-ons from a URI is allowed.
- *
- * @param aInstallingPrincipal
- * The nsIPrincipal that initiated the install
- * @return true if installing is allowed
- */
- isInstallAllowed: function(aInstallingPrincipal) {
- if (!this.isInstallEnabled())
- return false;
-
- let uri = aInstallingPrincipal.URI;
-
- // Direct requests without a referrer are either whitelisted or blocked.
- if (!uri)
- return this.isDirectRequestWhitelisted();
-
- // Local referrers can be whitelisted.
- if (this.isFileRequestWhitelisted() &&
- (uri.schemeIs("chrome") || uri.schemeIs("file")))
- return true;
-
- this.importPermissions();
-
- let permission = Services.perms.testPermissionFromPrincipal(aInstallingPrincipal, XPI_PERMISSION);
- if (permission == Ci.nsIPermissionManager.DENY_ACTION)
- return false;
-
- let requireWhitelist = Preferences.get(PREF_XPI_WHITELIST_REQUIRED, true);
- if (requireWhitelist && (permission != Ci.nsIPermissionManager.ALLOW_ACTION))
- return false;
-
- let requireSecureOrigin = Preferences.get(PREF_INSTALL_REQUIRESECUREORIGIN, true);
- let safeSchemes = ["https", "chrome", "file"];
- if (requireSecureOrigin && safeSchemes.indexOf(uri.scheme) == -1)
- return false;
-
- return true;
- },
-
- /**
- * Called to get an AddonInstall to download and install an add-on from a URL.
- *
- * @param aUrl
- * The URL to be installed
- * @param aHash
- * A hash for the install
- * @param aName
- * A name for the install
- * @param aIcons
- * Icon URLs for the install
- * @param aVersion
- * A version for the install
- * @param aBrowser
- * The browser performing the install
- * @param aCallback
- * A callback to pass the AddonInstall to
- */
- getInstallForURL: function(aUrl, aHash, aName, aIcons, aVersion, aBrowser,
- aCallback) {
- createDownloadInstall(function(aInstall) {
- aCallback(aInstall.wrapper);
- }, aUrl, aHash, aName, aIcons, aVersion, aBrowser);
- },
-
- /**
- * Called to get an AddonInstall to install an add-on from a local file.
- *
- * @param aFile
- * The file to be installed
- * @param aCallback
- * A callback to pass the AddonInstall to
- */
- getInstallForFile: function(aFile, aCallback) {
- createLocalInstall(aFile).then(install => {
- aCallback(install ? install.wrapper : null);
- });
- },
-
- /**
- * Temporarily installs add-on from a local XPI file or directory.
- * As this is intended for development, the signature is not checked and
- * the add-on does not persist on application restart.
- *
- * @param aFile
- * An nsIFile for the unpacked add-on directory or XPI file.
- *
- * @return See installAddonFromLocation return value.
- */
- installTemporaryAddon: function(aFile) {
- return this.installAddonFromLocation(aFile, TemporaryInstallLocation);
- },
-
- /**
- * Permanently installs add-on from a local XPI file or directory.
- * The signature is checked but the add-on persist on application restart.
- *
- * @param aFile
- * An nsIFile for the unpacked add-on directory or XPI file.
- *
- * @return See installAddonFromLocation return value.
- */
- installAddonFromSources: Task.async(function*(aFile) {
- let location = XPIProvider.installLocationsByName[KEY_APP_PROFILE];
- return this.installAddonFromLocation(aFile, location, "proxy");
- }),
-
- /**
- * Installs add-on from a local XPI file or directory.
- *
- * @param aFile
- * An nsIFile for the unpacked add-on directory or XPI file.
- * @param aInstallLocation
- * Define a custom install location object to use for the install.
- * @param aInstallAction
- * Optional action mode to use when installing the addon
- * (see MutableDirectoryInstallLocation.installAddon)
- *
- * @return a Promise that resolves to an Addon object on success, or rejects
- * if the add-on is not a valid restartless add-on or if the
- * same ID is already installed.
- */
- installAddonFromLocation: Task.async(function*(aFile, aInstallLocation, aInstallAction) {
- if (aFile.exists() && aFile.isFile()) {
- flushJarCache(aFile);
- }
- let addon = yield loadManifestFromFile(aFile, aInstallLocation);
-
- aInstallLocation.installAddon({ id: addon.id, source: aFile, action: aInstallAction });
-
- if (addon.appDisabled) {
- let message = `Add-on ${addon.id} is not compatible with application version.`;
-
- let app = addon.matchingTargetApplication;
- if (app) {
- if (app.minVersion) {
- message += ` add-on minVersion: ${app.minVersion}.`;
- }
- if (app.maxVersion) {
- message += ` add-on maxVersion: ${app.maxVersion}.`;
- }
- }
- throw new Error(message);
- }
-
- if (!addon.bootstrap) {
- throw new Error("Only restartless (bootstrap) add-ons"
- + " can be installed from sources:", addon.id);
- }
- let installReason = BOOTSTRAP_REASONS.ADDON_INSTALL;
- let oldAddon = yield new Promise(
- resolve => XPIDatabase.getVisibleAddonForID(addon.id, resolve));
- if (oldAddon) {
- if (!oldAddon.bootstrap) {
- logger.warn("Non-restartless Add-on is already installed", addon.id);
- throw new Error("Non-restartless add-on with ID "
- + oldAddon.id + " is already installed");
- }
- else {
- logger.warn("Addon with ID " + oldAddon.id + " already installed,"
- + " older version will be disabled");
-
- let existingAddonID = oldAddon.id;
- let existingAddon = oldAddon._sourceBundle;
-
- // We'll be replacing a currently active bootstrapped add-on so
- // call its uninstall method
- let newVersion = addon.version;
- let oldVersion = oldAddon.version;
- if (Services.vc.compare(newVersion, oldVersion) >= 0) {
- installReason = BOOTSTRAP_REASONS.ADDON_UPGRADE;
- } else {
- installReason = BOOTSTRAP_REASONS.ADDON_DOWNGRADE;
- }
- let uninstallReason = installReason;
-
- if (oldAddon.active) {
- XPIProvider.callBootstrapMethod(oldAddon, existingAddon,
- "shutdown", uninstallReason,
- { newVersion });
- }
- this.callBootstrapMethod(oldAddon, existingAddon,
- "uninstall", uninstallReason, { newVersion });
- this.unloadBootstrapScope(existingAddonID);
- flushChromeCaches();
- }
- }
-
- let file = addon._sourceBundle;
-
- XPIProvider._addURIMapping(addon.id, file);
- XPIProvider.callBootstrapMethod(addon, file, "install", installReason);
- addon.state = AddonManager.STATE_INSTALLED;
- logger.debug("Install of temporary addon in " + aFile.path + " completed.");
- addon.visible = true;
- addon.enabled = true;
- addon.active = true;
-
- addon = XPIDatabase.addAddonMetadata(addon, file.persistentDescriptor);
-
- XPIStates.addAddon(addon);
- XPIDatabase.saveChanges();
- XPIStates.save();
-
- AddonManagerPrivate.callAddonListeners("onInstalling", addon.wrapper,
- false);
- XPIProvider.callBootstrapMethod(addon, file, "startup",
- BOOTSTRAP_REASONS.ADDON_ENABLE);
- AddonManagerPrivate.callInstallListeners("onExternalInstall",
- null, addon.wrapper,
- oldAddon ? oldAddon.wrapper : null,
- false);
- AddonManagerPrivate.callAddonListeners("onInstalled", addon.wrapper);
-
- return addon.wrapper;
- }),
-
- /**
- * Returns an Addon corresponding to an instance ID.
- * @param aInstanceID
- * An Addon Instance ID
- * @return {Promise}
- * @resolves The found Addon or null if no such add-on exists.
- * @rejects Never
- * @throws if the aInstanceID argument is not specified
- */
- getAddonByInstanceID: function(aInstanceID) {
- if (!aInstanceID || typeof aInstanceID != "symbol")
- throw Components.Exception("aInstanceID must be a Symbol()",
- Cr.NS_ERROR_INVALID_ARG);
-
- for (let [id, val] of this.activeAddons) {
- if (aInstanceID == val.instanceID) {
- if (val.safeWrapper) {
- return Promise.resolve(val.safeWrapper);
- }
-
- return new Promise(resolve => {
- this.getAddonByID(id, function(addon) {
- val.safeWrapper = new PrivateWrapper(addon);
- resolve(val.safeWrapper);
- });
- });
- }
- }
-
- return Promise.resolve(null);
- },
-
- /**
- * Removes an AddonInstall from the list of active installs.
- *
- * @param install
- * The AddonInstall to remove
- */
- removeActiveInstall: function(aInstall) {
- this.installs.delete(aInstall);
- },
-
- /**
- * Called to get an Addon with a particular ID.
- *
- * @param aId
- * The ID of the add-on to retrieve
- * @param aCallback
- * A callback to pass the Addon to
- */
- getAddonByID: function(aId, aCallback) {
- XPIDatabase.getVisibleAddonForID (aId, function(aAddon) {
- aCallback(aAddon ? aAddon.wrapper : null);
- });
- },
-
- /**
- * Called to get Addons of a particular type.
- *
- * @param aTypes
- * An array of types to fetch. Can be null to get all types.
- * @param aCallback
- * A callback to pass an array of Addons to
- */
- getAddonsByTypes: function(aTypes, aCallback) {
- let typesToGet = getAllAliasesForTypes(aTypes);
-
- XPIDatabase.getVisibleAddons(typesToGet, function(aAddons) {
- aCallback(aAddons.map(a => a.wrapper));
- });
- },
-
- /**
- * Obtain an Addon having the specified Sync GUID.
- *
- * @param aGUID
- * String GUID of add-on to retrieve
- * @param aCallback
- * A callback to pass the Addon to. Receives null if not found.
- */
- getAddonBySyncGUID: function(aGUID, aCallback) {
- XPIDatabase.getAddonBySyncGUID(aGUID, function(aAddon) {
- aCallback(aAddon ? aAddon.wrapper : null);
- });
- },
-
- /**
- * Called to get Addons that have pending operations.
- *
- * @param aTypes
- * An array of types to fetch. Can be null to get all types
- * @param aCallback
- * A callback to pass an array of Addons to
- */
- getAddonsWithOperationsByTypes: function(aTypes, aCallback) {
- let typesToGet = getAllAliasesForTypes(aTypes);
-
- XPIDatabase.getVisibleAddonsWithPendingOperations(typesToGet, function(aAddons) {
- let results = aAddons.map(a => a.wrapper);
- for (let install of XPIProvider.installs) {
- if (install.state == AddonManager.STATE_INSTALLED &&
- !(install.addon.inDatabase))
- results.push(install.addon.wrapper);
- }
- aCallback(results);
- });
- },
-
- /**
- * Called to get the current AddonInstalls, optionally limiting to a list of
- * types.
- *
- * @param aTypes
- * An array of types or null to get all types
- * @param aCallback
- * A callback to pass the array of AddonInstalls to
- */
- getInstallsByTypes: function(aTypes, aCallback) {
- let results = [...this.installs];
- if (aTypes) {
- results = results.filter(install => {
- return aTypes.includes(getExternalType(install.type));
- });
- }
-
- aCallback(results.map(install => install.wrapper));
- },
-
- /**
- * Synchronously map a URI to the corresponding Addon ID.
- *
- * Mappable URIs are limited to in-application resources belonging to the
- * add-on, such as Javascript compartments, XUL windows, XBL bindings, etc.
- * but do not include URIs from meta data, such as the add-on homepage.
- *
- * @param aURI
- * nsIURI to map or null
- * @return string containing the Addon ID
- * @see AddonManager.mapURIToAddonID
- * @see amIAddonManager.mapURIToAddonID
- */
- mapURIToAddonID: function(aURI) {
- // Returns `null` instead of empty string if the URI can't be mapped.
- return AddonPathService.mapURIToAddonId(aURI) || null;
- },
-
- /**
- * Called when a new add-on has been enabled when only one add-on of that type
- * can be enabled.
- *
- * @param aId
- * The ID of the newly enabled add-on
- * @param aType
- * The type of the newly enabled add-on
- * @param aPendingRestart
- * true if the newly enabled add-on will only become enabled after a
- * restart
- */
- addonChanged: function(aId, aType, aPendingRestart) {
- // We only care about themes in this provider
- if (aType != "theme")
- return;
-
- if (!aId) {
- // Fallback to the default theme when no theme was enabled
- this.enableDefaultTheme();
- return;
- }
-
- // Look for the previously enabled theme and find the internalName of the
- // currently selected theme
- let previousTheme = null;
- let newSkin = this.defaultSkin;
- let addons = XPIDatabase.getAddonsByType("theme");
- for (let theme of addons) {
- if (!theme.visible)
- return;
- if (theme.id == aId)
- newSkin = theme.internalName;
- else if (theme.userDisabled == false && !theme.pendingUninstall)
- previousTheme = theme;
- }
-
- if (aPendingRestart) {
- Services.prefs.setBoolPref(PREF_DSS_SWITCHPENDING, true);
- Services.prefs.setCharPref(PREF_DSS_SKIN_TO_SELECT, newSkin);
- }
- else if (newSkin == this.currentSkin) {
- try {
- Services.prefs.clearUserPref(PREF_DSS_SWITCHPENDING);
- }
- catch (e) { }
- try {
- Services.prefs.clearUserPref(PREF_DSS_SKIN_TO_SELECT);
- }
- catch (e) { }
- }
- else {
- Services.prefs.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN, newSkin);
- this.currentSkin = newSkin;
- }
- this.selectedSkin = newSkin;
-
- // Flush the preferences to disk so they don't get out of sync with the
- // database
- Services.prefs.savePrefFile(null);
-
- // Mark the previous theme as disabled. This won't cause recursion since
- // only enabled calls notifyAddonChanged.
- if (previousTheme)
- this.updateAddonDisabledState(previousTheme, true);
- },
-
- /**
- * Update the appDisabled property for all add-ons.
- */
- updateAddonAppDisabledStates: function() {
- let addons = XPIDatabase.getAddons();
- for (let addon of addons) {
- this.updateAddonDisabledState(addon);
- }
- },
-
- /**
- * Update the repositoryAddon property for all add-ons.
- *
- * @param aCallback
- * Function to call when operation is complete.
- */
- updateAddonRepositoryData: function(aCallback) {
- XPIDatabase.getVisibleAddons(null, aAddons => {
- let pending = aAddons.length;
- logger.debug("updateAddonRepositoryData found " + pending + " visible add-ons");
- if (pending == 0) {
- aCallback();
- return;
- }
-
- function notifyComplete() {
- if (--pending == 0)
- aCallback();
- }
-
- for (let addon of aAddons) {
- AddonRepository.getCachedAddonByID(addon.id, aRepoAddon => {
- if (aRepoAddon) {
- logger.debug("updateAddonRepositoryData got info for " + addon.id);
- addon._repositoryAddon = aRepoAddon;
- addon.compatibilityOverrides = aRepoAddon.compatibilityOverrides;
- this.updateAddonDisabledState(addon);
- }
-
- notifyComplete();
- });
- }
- });
- },
-
- /**
- * When the previously selected theme is removed this method will be called
- * to enable the default theme.
- */
- enableDefaultTheme: function() {
- logger.debug("Activating default theme");
- let addon = XPIDatabase.getVisibleAddonForInternalName(this.defaultSkin);
- if (addon) {
- if (addon.userDisabled) {
- this.updateAddonDisabledState(addon, false);
- }
- else if (!this.extensionsActive) {
- // During startup we may end up trying to enable the default theme when
- // the database thinks it is already enabled (see f.e. bug 638847). In
- // this case just force the theme preferences to be correct
- Services.prefs.setCharPref(PREF_GENERAL_SKINS_SELECTEDSKIN,
- addon.internalName);
- this.currentSkin = this.selectedSkin = addon.internalName;
- Preferences.reset(PREF_DSS_SKIN_TO_SELECT);
- Preferences.reset(PREF_DSS_SWITCHPENDING);
- }
- else {
- logger.warn("Attempting to activate an already active default theme");
- }
- }
- else {
- logger.warn("Unable to activate the default theme");
- }
- },
-
- onDebugConnectionChange: function(aEvent, aWhat, aConnection) {
- if (aWhat != "opened")
- return;
-
- for (let [id, val] of this.activeAddons) {
- aConnection.setAddonOptions(
- id, { global: val.debugGlobal || val.bootstrapScope });
- }
- },
-
- /**
- * Notified when a preference we're interested in has changed.
- *
- * @see nsIObserver
- */
- observe: function(aSubject, aTopic, aData) {
- if (aTopic == NOTIFICATION_FLUSH_PERMISSIONS) {
- if (!aData || aData == XPI_PERMISSION) {
- this.importPermissions();
- }
- return;
- }
- else if (aTopic == NOTIFICATION_TOOLBOXPROCESS_LOADED) {
- Services.obs.removeObserver(this, NOTIFICATION_TOOLBOXPROCESS_LOADED, false);
- this._toolboxProcessLoaded = true;
- BrowserToolboxProcess.on("connectionchange",
- this.onDebugConnectionChange.bind(this));
- }
-
- if (aTopic == "nsPref:changed") {
- switch (aData) {
- case PREF_EM_MIN_COMPAT_APP_VERSION:
- this.minCompatibleAppVersion = Preferences.get(PREF_EM_MIN_COMPAT_APP_VERSION,
- null);
- this.updateAddonAppDisabledStates();
- break;
- case PREF_EM_MIN_COMPAT_PLATFORM_VERSION:
- this.minCompatiblePlatformVersion = Preferences.get(PREF_EM_MIN_COMPAT_PLATFORM_VERSION,
- null);
- this.updateAddonAppDisabledStates();
- break;
- case PREF_XPI_SIGNATURES_REQUIRED:
- this.updateAddonAppDisabledStates();
- break;
- }
- }
- },
-
- /**
- * Tests whether enabling an add-on will require a restart.
- *
- * @param aAddon
- * The add-on to test
- * @return true if the operation requires a restart
- */
- enableRequiresRestart: function(aAddon) {
- // If the platform couldn't have activated extensions then we can make
- // changes without any restart.
- if (!this.extensionsActive)
- return false;
-
- // If the application is in safe mode then any change can be made without
- // restarting
- if (Services.appinfo.inSafeMode)
- return false;
-
- // Anything that is active is already enabled
- if (aAddon.active)
- return false;
-
- if (aAddon.type == "theme") {
- // If dynamic theme switching is enabled then switching themes does not
- // require a restart
- if (Preferences.get(PREF_EM_DSS_ENABLED))
- return false;
-
- // If the theme is already the theme in use then no restart is necessary.
- // This covers the case where the default theme is in use but a
- // lightweight theme is considered active.
- return aAddon.internalName != this.currentSkin;
- }
-
- return !aAddon.bootstrap;
- },
-
- /**
- * Tests whether disabling an add-on will require a restart.
- *
- * @param aAddon
- * The add-on to test
- * @return true if the operation requires a restart
- */
- disableRequiresRestart: function(aAddon) {
- // If the platform couldn't have activated up extensions then we can make
- // changes without any restart.
- if (!this.extensionsActive)
- return false;
-
- // If the application is in safe mode then any change can be made without
- // restarting
- if (Services.appinfo.inSafeMode)
- return false;
-
- // Anything that isn't active is already disabled
- if (!aAddon.active)
- return false;
-
- if (aAddon.type == "theme") {
- // If dynamic theme switching is enabled then switching themes does not
- // require a restart
- if (Preferences.get(PREF_EM_DSS_ENABLED))
- return false;
-
- // Non-default themes always require a restart to disable since it will
- // be switching from one theme to another or to the default theme and a
- // lightweight theme.
- if (aAddon.internalName != this.defaultSkin)
- return true;
-
- // The default theme requires a restart to disable if we are in the
- // process of switching to a different theme. Note that this makes the
- // disabled flag of operationsRequiringRestart incorrect for the default
- // theme (it will be false most of the time). Bug 520124 would be required
- // to fix it. For the UI this isn't a problem since we never try to
- // disable or uninstall the default theme.
- return this.selectedSkin != this.currentSkin;
- }
-
- return !aAddon.bootstrap;
- },
-
- /**
- * Tests whether installing an add-on will require a restart.
- *
- * @param aAddon
- * The add-on to test
- * @return true if the operation requires a restart
- */
- installRequiresRestart: function(aAddon) {
- // If the platform couldn't have activated up extensions then we can make
- // changes without any restart.
- if (!this.extensionsActive)
- return false;
-
- // If the application is in safe mode then any change can be made without
- // restarting
- if (Services.appinfo.inSafeMode)
- return false;
-
- // Add-ons that are already installed don't require a restart to install.
- // This wouldn't normally be called for an already installed add-on (except
- // for forming the operationsRequiringRestart flags) so is really here as
- // a safety measure.
- if (aAddon.inDatabase)
- return false;
-
- // If we have an AddonInstall for this add-on then we can see if there is
- // an existing installed add-on with the same ID
- if ("_install" in aAddon && aAddon._install) {
- // If there is an existing installed add-on and uninstalling it would
- // require a restart then installing the update will also require a
- // restart
- let existingAddon = aAddon._install.existingAddon;
- if (existingAddon && this.uninstallRequiresRestart(existingAddon))
- return true;
- }
-
- // If the add-on is not going to be active after installation then it
- // doesn't require a restart to install.
- if (aAddon.disabled)
- return false;
-
- // Themes will require a restart (even if dynamic switching is enabled due
- // to some caching issues) and non-bootstrapped add-ons will require a
- // restart
- return aAddon.type == "theme" || !aAddon.bootstrap;
- },
-
- /**
- * Tests whether uninstalling an add-on will require a restart.
- *
- * @param aAddon
- * The add-on to test
- * @return true if the operation requires a restart
- */
- uninstallRequiresRestart: function(aAddon) {
- // If the platform couldn't have activated up extensions then we can make
- // changes without any restart.
- if (!this.extensionsActive)
- return false;
-
- // If the application is in safe mode then any change can be made without
- // restarting
- if (Services.appinfo.inSafeMode)
- return false;
-
- // If the add-on can be disabled without a restart then it can also be
- // uninstalled without a restart
- return this.disableRequiresRestart(aAddon);
- },
-
- /**
- * Loads a bootstrapped add-on's bootstrap.js into a sandbox and the reason
- * values as constants in the scope. This will also add information about the
- * add-on to the bootstrappedAddons dictionary and notify the crash reporter
- * that new add-ons have been loaded.
- *
- * @param aId
- * The add-on's ID
- * @param aFile
- * The nsIFile for the add-on
- * @param aVersion
- * The add-on's version
- * @param aType
- * The type for the add-on
- * @param aMultiprocessCompatible
- * Boolean indicating whether the add-on is compatible with electrolysis.
- * @param aRunInSafeMode
- * Boolean indicating whether the add-on can run in safe mode.
- * @param aDependencies
- * An array of add-on IDs on which this add-on depends.
- * @param hasEmbeddedWebExtension
- * Boolean indicating whether the add-on has an embedded webextension.
- * @return a JavaScript scope
- */
- loadBootstrapScope: function(aId, aFile, aVersion, aType,
- aMultiprocessCompatible, aRunInSafeMode,
- aDependencies, hasEmbeddedWebExtension) {
- // Mark the add-on as active for the crash reporter before loading
- this.bootstrappedAddons[aId] = {
- version: aVersion,
- type: aType,
- descriptor: aFile.persistentDescriptor,
- multiprocessCompatible: aMultiprocessCompatible,
- runInSafeMode: aRunInSafeMode,
- dependencies: aDependencies,
- hasEmbeddedWebExtension,
- };
- this.persistBootstrappedAddons();
- this.addAddonsToCrashReporter();
-
- this.activeAddons.set(aId, {
- debugGlobal: null,
- safeWrapper: null,
- bootstrapScope: null,
- // a Symbol passed to this add-on, which it can use to identify itself
- instanceID: Symbol(aId),
- });
- let activeAddon = this.activeAddons.get(aId);
-
- // Locales only contain chrome and can't have bootstrap scripts
- if (aType == "locale") {
- return;
- }
-
- logger.debug("Loading bootstrap scope from " + aFile.path);
-
- let principal = Cc["@mozilla.org/systemprincipal;1"].
- createInstance(Ci.nsIPrincipal);
- if (!aMultiprocessCompatible && Preferences.get(PREF_INTERPOSITION_ENABLED, false)) {
- let interposition = Cc["@mozilla.org/addons/multiprocess-shims;1"].
- getService(Ci.nsIAddonInterposition);
- Cu.setAddonInterposition(aId, interposition);
- Cu.allowCPOWsInAddon(aId, true);
- }
-
- if (!aFile.exists()) {
- activeAddon.bootstrapScope =
- new Cu.Sandbox(principal, { sandboxName: aFile.path,
- wantGlobalProperties: ["indexedDB"],
- addonId: aId,
- metadata: { addonID: aId } });
- logger.error("Attempted to load bootstrap scope from missing directory " + aFile.path);
- return;
- }
-
- let uri = getURIForResourceInFile(aFile, "bootstrap.js").spec;
- if (aType == "dictionary")
- uri = "resource://gre/modules/addons/SpellCheckDictionaryBootstrap.js"
- else if (aType == "webextension")
- uri = "resource://gre/modules/addons/WebExtensionBootstrap.js"
- else if (aType == "apiextension")
- uri = "resource://gre/modules/addons/APIExtensionBootstrap.js"
-
- activeAddon.bootstrapScope =
- new Cu.Sandbox(principal, { sandboxName: uri,
- wantGlobalProperties: ["indexedDB"],
- addonId: aId,
- metadata: { addonID: aId, URI: uri } });
-
- let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
- createInstance(Ci.mozIJSSubScriptLoader);
-
- try {
- // Copy the reason values from the global object into the bootstrap scope.
- for (let name in BOOTSTRAP_REASONS)
- activeAddon.bootstrapScope[name] = BOOTSTRAP_REASONS[name];
-
- // Add other stuff that extensions want.
- const features = [ "Worker", "ChromeWorker" ];
-
- for (let feature of features)
- activeAddon.bootstrapScope[feature] = gGlobalScope[feature];
-
- // Define a console for the add-on
- activeAddon.bootstrapScope["console"] = new ConsoleAPI(
- { consoleID: "addon/" + aId });
-
- // As we don't want our caller to control the JS version used for the
- // bootstrap file, we run loadSubScript within the context of the
- // sandbox with the latest JS version set explicitly.
- activeAddon.bootstrapScope.__SCRIPT_URI_SPEC__ = uri;
- Components.utils.evalInSandbox(
- "Components.classes['@mozilla.org/moz/jssubscript-loader;1'] \
- .createInstance(Components.interfaces.mozIJSSubScriptLoader) \
- .loadSubScript(__SCRIPT_URI_SPEC__);",
- activeAddon.bootstrapScope, "ECMAv5");
- }
- catch (e) {
- logger.warn("Error loading bootstrap.js for " + aId, e);
- }
-
- // Only access BrowserToolboxProcess if ToolboxProcess.jsm has been
- // initialized as otherwise, when it will be initialized, all addons'
- // globals will be added anyways
- if (this._toolboxProcessLoaded) {
- BrowserToolboxProcess.setAddonOptions(aId,
- { global: activeAddon.bootstrapScope });
- }
- },
-
- /**
- * Unloads a bootstrap scope by dropping all references to it and then
- * updating the list of active add-ons with the crash reporter.
- *
- * @param aId
- * The add-on's ID
- */
- unloadBootstrapScope: function(aId) {
- // In case the add-on was not multiprocess-compatible, deregister
- // any interpositions for it.
- Cu.setAddonInterposition(aId, null);
- Cu.allowCPOWsInAddon(aId, false);
-
- this.activeAddons.delete(aId);
- delete this.bootstrappedAddons[aId];
- this.persistBootstrappedAddons();
- this.addAddonsToCrashReporter();
-
- // Only access BrowserToolboxProcess if ToolboxProcess.jsm has been
- // initialized as otherwise, there won't be any addon globals added to it
- if (this._toolboxProcessLoaded) {
- BrowserToolboxProcess.setAddonOptions(aId, { global: null });
- }
- },
-
- /**
- * Calls a bootstrap method for an add-on.
- *
- * @param aAddon
- * An object representing the add-on, with `id`, `type` and `version`
- * @param aFile
- * The nsIFile for the add-on
- * @param aMethod
- * The name of the bootstrap method to call
- * @param aReason
- * The reason flag to pass to the bootstrap's startup method
- * @param aExtraParams
- * An object of additional key/value pairs to pass to the method in
- * the params argument
- */
- callBootstrapMethod: function(aAddon, aFile, aMethod, aReason, aExtraParams) {
- if (!aAddon.id || !aAddon.version || !aAddon.type) {
- throw new Error("aAddon must include an id, version, and type");
- }
-
- // Only run in safe mode if allowed to
- let runInSafeMode = "runInSafeMode" in aAddon ? aAddon.runInSafeMode : canRunInSafeMode(aAddon);
- if (Services.appinfo.inSafeMode && !runInSafeMode)
- return;
-
- let timeStart = new Date();
- if (CHROME_TYPES.has(aAddon.type) && aMethod == "startup") {
- logger.debug("Registering manifest for " + aFile.path);
- Components.manager.addBootstrappedManifestLocation(aFile);
- }
-
- try {
- // Load the scope if it hasn't already been loaded
- let activeAddon = this.activeAddons.get(aAddon.id);
- if (!activeAddon) {
- this.loadBootstrapScope(aAddon.id, aFile, aAddon.version, aAddon.type,
- aAddon.multiprocessCompatible || false,
- runInSafeMode, aAddon.dependencies,
- aAddon.hasEmbeddedWebExtension || false);
- activeAddon = this.activeAddons.get(aAddon.id);
- }
-
- if (aMethod == "startup" || aMethod == "shutdown") {
- if (!aExtraParams) {
- aExtraParams = {};
- }
- aExtraParams["instanceID"] = this.activeAddons.get(aAddon.id).instanceID;
- }
-
- // Nothing to call for locales
- if (aAddon.type == "locale")
- return;
-
- let method = undefined;
- try {
- method = Components.utils.evalInSandbox(`${aMethod};`,
- activeAddon.bootstrapScope, "ECMAv5");
- }
- catch (e) {
- // An exception will be caught if the expected method is not defined.
- // That will be logged below.
- }
-
- if (!method) {
- logger.warn("Add-on " + aAddon.id + " is missing bootstrap method " + aMethod);
- return;
- }
-
- // Extensions are automatically deinitialized in the correct order at shutdown.
- if (aMethod == "shutdown" && aReason != BOOTSTRAP_REASONS.APP_SHUTDOWN) {
- activeAddon.disable = true;
- for (let addon of this.getDependentAddons(aAddon)) {
- if (addon.active)
- this.updateAddonDisabledState(addon);
- }
- }
-
- let params = {
- id: aAddon.id,
- version: aAddon.version,
- installPath: aFile.clone(),
- resourceURI: getURIForResourceInFile(aFile, "")
- };
-
- if (aExtraParams) {
- for (let key in aExtraParams) {
- params[key] = aExtraParams[key];
- }
- }
-
- if (aAddon.hasEmbeddedWebExtension) {
- if (aMethod == "startup") {
- const webExtension = LegacyExtensionsUtils.getEmbeddedExtensionFor(params);
- params.webExtension = {
- startup: () => webExtension.startup(),
- };
- } else if (aMethod == "shutdown") {
- LegacyExtensionsUtils.getEmbeddedExtensionFor(params).shutdown();
- }
- }
-
- logger.debug("Calling bootstrap method " + aMethod + " on " + aAddon.id + " version " +
- aAddon.version);
- try {
- method(params, aReason);
- }
- catch (e) {
- logger.warn("Exception running bootstrap method " + aMethod + " on " + aAddon.id, e);
- }
- }
- finally {
- // Extensions are automatically initialized in the correct order at startup.
- if (aMethod == "startup" && aReason != BOOTSTRAP_REASONS.APP_STARTUP) {
- for (let addon of this.getDependentAddons(aAddon))
- this.updateAddonDisabledState(addon);
- }
-
- if (CHROME_TYPES.has(aAddon.type) && aMethod == "shutdown" && aReason != BOOTSTRAP_REASONS.APP_SHUTDOWN) {
- logger.debug("Removing manifest for " + aFile.path);
- Components.manager.removeBootstrappedManifestLocation(aFile);
-
- let manifest = getURIForResourceInFile(aFile, "chrome.manifest");
- for (let line of ChromeManifestParser.parseSync(manifest)) {
- if (line.type == "resource") {
- ResProtocolHandler.setSubstitution(line.args[0], null);
- }
- }
- }
- this.setTelemetry(aAddon.id, aMethod + "_MS", new Date() - timeStart);
- }
- },
-
- /**
- * Updates the disabled state for an add-on. Its appDisabled property will be
- * calculated and if the add-on is changed the database will be saved and
- * appropriate notifications will be sent out to the registered AddonListeners.
- *
- * @param aAddon
- * The DBAddonInternal to update
- * @param aUserDisabled
- * Value for the userDisabled property. If undefined the value will
- * not change
- * @param aSoftDisabled
- * Value for the softDisabled property. If undefined the value will
- * not change. If true this will force userDisabled to be true
- * @return a tri-state indicating the action taken for the add-on:
- * - undefined: The add-on did not change state
- * - true: The add-on because disabled
- * - false: The add-on became enabled
- * @throws if addon is not a DBAddonInternal
- */
- updateAddonDisabledState: function(aAddon, aUserDisabled, aSoftDisabled) {
- if (!(aAddon.inDatabase))
- throw new Error("Can only update addon states for installed addons.");
- if (aUserDisabled !== undefined && aSoftDisabled !== undefined) {
- throw new Error("Cannot change userDisabled and softDisabled at the " +
- "same time");
- }
-
- if (aUserDisabled === undefined) {
- aUserDisabled = aAddon.userDisabled;
- }
- else if (!aUserDisabled) {
- // If enabling the add-on then remove softDisabled
- aSoftDisabled = false;
- }
-
- // If not changing softDisabled or the add-on is already userDisabled then
- // use the existing value for softDisabled
- if (aSoftDisabled === undefined || aUserDisabled)
- aSoftDisabled = aAddon.softDisabled;
-
- let appDisabled = !isUsableAddon(aAddon);
- // No change means nothing to do here
- if (aAddon.userDisabled == aUserDisabled &&
- aAddon.appDisabled == appDisabled &&
- aAddon.softDisabled == aSoftDisabled)
- return undefined;
-
- let wasDisabled = aAddon.disabled;
- let isDisabled = aUserDisabled || aSoftDisabled || appDisabled;
-
- // If appDisabled changes but addon.disabled doesn't,
- // no onDisabling/onEnabling is sent - so send a onPropertyChanged.
- let appDisabledChanged = aAddon.appDisabled != appDisabled;
-
- // Update the properties in the database.
- XPIDatabase.setAddonProperties(aAddon, {
- userDisabled: aUserDisabled,
- appDisabled: appDisabled,
- softDisabled: aSoftDisabled
- });
-
- let wrapper = aAddon.wrapper;
-
- if (appDisabledChanged) {
- AddonManagerPrivate.callAddonListeners("onPropertyChanged",
- wrapper,
- ["appDisabled"]);
- }
-
- // If the add-on is not visible or the add-on is not changing state then
- // there is no need to do anything else
- if (!aAddon.visible || (wasDisabled == isDisabled))
- return undefined;
-
- // Flag that active states in the database need to be updated on shutdown
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
-
- // Have we just gone back to the current state?
- if (isDisabled != aAddon.active) {
- AddonManagerPrivate.callAddonListeners("onOperationCancelled", wrapper);
- }
- else {
- if (isDisabled) {
- var needsRestart = this.disableRequiresRestart(aAddon);
- AddonManagerPrivate.callAddonListeners("onDisabling", wrapper,
- needsRestart);
- }
- else {
- needsRestart = this.enableRequiresRestart(aAddon);
- AddonManagerPrivate.callAddonListeners("onEnabling", wrapper,
- needsRestart);
- }
-
- if (!needsRestart) {
- XPIDatabase.updateAddonActive(aAddon, !isDisabled);
-
- if (isDisabled) {
- if (aAddon.bootstrap) {
- this.callBootstrapMethod(aAddon, aAddon._sourceBundle, "shutdown",
- BOOTSTRAP_REASONS.ADDON_DISABLE);
- this.unloadBootstrapScope(aAddon.id);
- }
- AddonManagerPrivate.callAddonListeners("onDisabled", wrapper);
- }
- else {
- if (aAddon.bootstrap) {
- this.callBootstrapMethod(aAddon, aAddon._sourceBundle, "startup",
- BOOTSTRAP_REASONS.ADDON_ENABLE);
- }
- AddonManagerPrivate.callAddonListeners("onEnabled", wrapper);
- }
- }
- else if (aAddon.bootstrap) {
- // Something blocked the restartless add-on from enabling or disabling
- // make sure it happens on the next startup
- if (isDisabled) {
- this.bootstrappedAddons[aAddon.id].disable = true;
- }
- else {
- this.bootstrappedAddons[aAddon.id] = {
- version: aAddon.version,
- type: aAddon.type,
- descriptor: aAddon._sourceBundle.persistentDescriptor,
- multiprocessCompatible: aAddon.multiprocessCompatible,
- runInSafeMode: canRunInSafeMode(aAddon),
- dependencies: aAddon.dependencies,
- hasEmbeddedWebExtension: aAddon.hasEmbeddedWebExtension,
- };
- this.persistBootstrappedAddons();
- }
- }
- }
-
- // Sync with XPIStates.
- let xpiState = XPIStates.getAddon(aAddon.location, aAddon.id);
- if (xpiState) {
- xpiState.syncWithDB(aAddon);
- XPIStates.save();
- } else {
- // There should always be an xpiState
- logger.warn("No XPIState for ${id} in ${location}", aAddon);
- }
-
- // Notify any other providers that a new theme has been enabled
- if (aAddon.type == "theme" && !isDisabled)
- AddonManagerPrivate.notifyAddonChanged(aAddon.id, aAddon.type, needsRestart);
-
- return isDisabled;
- },
-
- /**
- * Uninstalls an add-on, immediately if possible or marks it as pending
- * uninstall if not.
- *
- * @param aAddon
- * The DBAddonInternal to uninstall
- * @param aForcePending
- * Force this addon into the pending uninstall state, even if
- * it isn't marked as requiring a restart (used e.g. while the
- * add-on manager is open and offering an "undo" button)
- * @throws if the addon cannot be uninstalled because it is in an install
- * location that does not allow it
- */
- uninstallAddon: function(aAddon, aForcePending) {
- if (!(aAddon.inDatabase))
- throw new Error("Cannot uninstall addon " + aAddon.id + " because it is not installed");
-
- if (aAddon._installLocation.locked)
- throw new Error("Cannot uninstall addon " + aAddon.id
- + " from locked install location " + aAddon._installLocation.name);
-
- // Inactive add-ons don't require a restart to uninstall
- let requiresRestart = this.uninstallRequiresRestart(aAddon);
-
- // if makePending is true, we don't actually apply the uninstall,
- // we just mark the addon as having a pending uninstall
- let makePending = aForcePending || requiresRestart;
-
- if (makePending && aAddon.pendingUninstall)
- throw new Error("Add-on is already marked to be uninstalled");
-
- aAddon._hasResourceCache.clear();
-
- if (aAddon._updateCheck) {
- logger.debug("Cancel in-progress update check for " + aAddon.id);
- aAddon._updateCheck.cancel();
- }
-
- let wasPending = aAddon.pendingUninstall;
-
- if (makePending) {
- // We create an empty directory in the staging directory to indicate
- // that an uninstall is necessary on next startup. Temporary add-ons are
- // automatically uninstalled on shutdown anyway so there is no need to
- // do this for them.
- if (aAddon._installLocation.name != KEY_APP_TEMPORARY) {
- let stage = aAddon._installLocation.getStagingDir();
- stage.append(aAddon.id);
- if (!stage.exists())
- stage.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
- }
-
- XPIDatabase.setAddonProperties(aAddon, {
- pendingUninstall: true
- });
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
- let xpiState = XPIStates.getAddon(aAddon.location, aAddon.id);
- if (xpiState) {
- xpiState.enabled = false;
- XPIStates.save();
- } else {
- logger.warn("Can't find XPI state while uninstalling ${id} from ${location}", aAddon);
- }
- }
-
- // If the add-on is not visible then there is no need to notify listeners.
- if (!aAddon.visible)
- return;
-
- let wrapper = aAddon.wrapper;
-
- // If the add-on wasn't already pending uninstall then notify listeners.
- if (!wasPending) {
- // Passing makePending as the requiresRestart parameter is a little
- // strange as in some cases this operation can complete without a restart
- // so really this is now saying that the uninstall isn't going to happen
- // immediately but will happen later.
- AddonManagerPrivate.callAddonListeners("onUninstalling", wrapper,
- makePending);
- }
-
- // Reveal the highest priority add-on with the same ID
- function revealAddon(aAddon) {
- XPIDatabase.makeAddonVisible(aAddon);
-
- let wrappedAddon = aAddon.wrapper;
- AddonManagerPrivate.callAddonListeners("onInstalling", wrappedAddon, false);
-
- if (!aAddon.disabled && !XPIProvider.enableRequiresRestart(aAddon)) {
- XPIDatabase.updateAddonActive(aAddon, true);
- }
-
- if (aAddon.bootstrap) {
- XPIProvider.callBootstrapMethod(aAddon, aAddon._sourceBundle,
- "install", BOOTSTRAP_REASONS.ADDON_INSTALL);
-
- if (aAddon.active) {
- XPIProvider.callBootstrapMethod(aAddon, aAddon._sourceBundle,
- "startup", BOOTSTRAP_REASONS.ADDON_INSTALL);
- }
- else {
- XPIProvider.unloadBootstrapScope(aAddon.id);
- }
- }
-
- // We always send onInstalled even if a restart is required to enable
- // the revealed add-on
- AddonManagerPrivate.callAddonListeners("onInstalled", wrappedAddon);
- }
-
- function findAddonAndReveal(aId) {
- let [locationName, ] = XPIStates.findAddon(aId);
- if (locationName) {
- XPIDatabase.getAddonInLocation(aId, locationName, revealAddon);
- }
- }
-
- if (!makePending) {
- if (aAddon.bootstrap) {
- if (aAddon.active) {
- this.callBootstrapMethod(aAddon, aAddon._sourceBundle, "shutdown",
- BOOTSTRAP_REASONS.ADDON_UNINSTALL);
- }
-
- this.callBootstrapMethod(aAddon, aAddon._sourceBundle, "uninstall",
- BOOTSTRAP_REASONS.ADDON_UNINSTALL);
- this.unloadBootstrapScope(aAddon.id);
- flushChromeCaches();
- }
- aAddon._installLocation.uninstallAddon(aAddon.id);
- XPIDatabase.removeAddonMetadata(aAddon);
- XPIStates.removeAddon(aAddon.location, aAddon.id);
- AddonManagerPrivate.callAddonListeners("onUninstalled", wrapper);
-
- findAddonAndReveal(aAddon.id);
- }
- else if (aAddon.bootstrap && aAddon.active && !this.disableRequiresRestart(aAddon)) {
- this.callBootstrapMethod(aAddon, aAddon._sourceBundle, "shutdown",
- BOOTSTRAP_REASONS.ADDON_UNINSTALL);
- this.unloadBootstrapScope(aAddon.id);
- XPIDatabase.updateAddonActive(aAddon, false);
- }
-
- // Notify any other providers that a new theme has been enabled
- if (aAddon.type == "theme" && aAddon.active)
- AddonManagerPrivate.notifyAddonChanged(null, aAddon.type, requiresRestart);
- },
-
- /**
- * Cancels the pending uninstall of an add-on.
- *
- * @param aAddon
- * The DBAddonInternal to cancel uninstall for
- */
- cancelUninstallAddon: function(aAddon) {
- if (!(aAddon.inDatabase))
- throw new Error("Can only cancel uninstall for installed addons.");
- if (!aAddon.pendingUninstall)
- throw new Error("Add-on is not marked to be uninstalled");
-
- if (aAddon._installLocation.name != KEY_APP_TEMPORARY)
- aAddon._installLocation.cleanStagingDir([aAddon.id]);
-
- XPIDatabase.setAddonProperties(aAddon, {
- pendingUninstall: false
- });
-
- if (!aAddon.visible)
- return;
-
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
-
- // TODO hide hidden add-ons (bug 557710)
- let wrapper = aAddon.wrapper;
- AddonManagerPrivate.callAddonListeners("onOperationCancelled", wrapper);
-
- if (aAddon.bootstrap && !aAddon.disabled && !this.enableRequiresRestart(aAddon)) {
- this.callBootstrapMethod(aAddon, aAddon._sourceBundle, "startup",
- BOOTSTRAP_REASONS.ADDON_INSTALL);
- XPIDatabase.updateAddonActive(aAddon, true);
- }
-
- // Notify any other providers that this theme is now enabled again.
- if (aAddon.type == "theme" && aAddon.active)
- AddonManagerPrivate.notifyAddonChanged(aAddon.id, aAddon.type, false);
- }
-};
-
-function getHashStringForCrypto(aCrypto) {
- // return the two-digit hexadecimal code for a byte
- let toHexString = charCode => ("0" + charCode.toString(16)).slice(-2);
-
- // convert the binary hash data to a hex string.
- let binary = aCrypto.finish(false);
- let hash = Array.from(binary, c => toHexString(c.charCodeAt(0)))
- return hash.join("").toLowerCase();
-}
-
-/**
- * Base class for objects that manage the installation of an addon.
- * This class isn't instantiated directly, see the derived classes below.
- */
-class AddonInstall {
- /**
- * Instantiates an AddonInstall.
- *
- * @param aInstallLocation
- * The install location the add-on will be installed into
- * @param aUrl
- * The nsIURL to get the add-on from. If this is an nsIFileURL then
- * the add-on will not need to be downloaded
- * @param aHash
- * An optional hash for the add-on
- * @param aExistingAddon
- * The add-on this install will update if known
- */
- constructor(aInstallLocation, aUrl, aHash, aExistingAddon) {
- this.wrapper = new AddonInstallWrapper(this);
- this.installLocation = aInstallLocation;
- this.sourceURI = aUrl;
-
- if (aHash) {
- let hashSplit = aHash.toLowerCase().split(":");
- this.originalHash = {
- algorithm: hashSplit[0],
- data: hashSplit[1]
- };
- }
- this.hash = this.originalHash;
- this.existingAddon = aExistingAddon;
- this.releaseNotesURI = null;
-
- this.listeners = [];
- this.icons = {};
- this.error = 0;
-
- this.progress = 0;
- this.maxProgress = -1;
-
- // Giving each instance of AddonInstall a reference to the logger.
- this.logger = logger;
-
- this.name = null;
- this.type = null;
- this.version = null;
-
- this.file = null;
- this.ownsTempFile = null;
- this.certificate = null;
- this.certName = null;
-
- this.linkedInstalls = null;
- this.addon = null;
- this.state = null;
-
- XPIProvider.installs.add(this);
- }
-
- /**
- * Starts installation of this add-on from whatever state it is currently at
- * if possible.
- *
- * Note this method is overridden to handle additional state in
- * the subclassses below.
- *
- * @throws if installation cannot proceed from the current state
- */
- install() {
- switch (this.state) {
- case AddonManager.STATE_DOWNLOADED:
- this.startInstall();
- break;
- case AddonManager.STATE_POSTPONED:
- logger.debug(`Postponing install of ${this.addon.id}`);
- break;
- case AddonManager.STATE_DOWNLOADING:
- case AddonManager.STATE_CHECKING:
- case AddonManager.STATE_INSTALLING:
- // Installation is already running
- return;
- default:
- throw new Error("Cannot start installing from this state");
- }
- }
-
- /**
- * Cancels installation of this add-on.
- *
- * Note this method is overridden to handle additional state in
- * the subclass DownloadAddonInstall.
- *
- * @throws if installation cannot be cancelled from the current state
- */
- cancel() {
- switch (this.state) {
- case AddonManager.STATE_AVAILABLE:
- case AddonManager.STATE_DOWNLOADED:
- logger.debug("Cancelling download of " + this.sourceURI.spec);
- this.state = AddonManager.STATE_CANCELLED;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadCancelled",
- this.listeners, this.wrapper);
- this.removeTemporaryFile();
- break;
- case AddonManager.STATE_INSTALLED:
- logger.debug("Cancelling install of " + this.addon.id);
- let xpi = this.installLocation.getStagingDir();
- xpi.append(this.addon.id + ".xpi");
- flushJarCache(xpi);
- this.installLocation.cleanStagingDir([this.addon.id, this.addon.id + ".xpi",
- this.addon.id + ".json"]);
- this.state = AddonManager.STATE_CANCELLED;
- XPIProvider.removeActiveInstall(this);
-
- if (this.existingAddon) {
- delete this.existingAddon.pendingUpgrade;
- this.existingAddon.pendingUpgrade = null;
- }
-
- AddonManagerPrivate.callAddonListeners("onOperationCancelled", this.addon.wrapper);
-
- AddonManagerPrivate.callInstallListeners("onInstallCancelled",
- this.listeners, this.wrapper);
- break;
- case AddonManager.STATE_POSTPONED:
- logger.debug(`Cancelling postponed install of ${this.addon.id}`);
- this.state = AddonManager.STATE_CANCELLED;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onInstallCancelled",
- this.listeners, this.wrapper);
- this.removeTemporaryFile();
-
- let stagingDir = this.installLocation.getStagingDir();
- let stagedAddon = stagingDir.clone();
-
- this.unstageInstall(stagedAddon);
- default:
- throw new Error("Cannot cancel install of " + this.sourceURI.spec +
- " from this state (" + this.state + ")");
- }
- }
-
- /**
- * Adds an InstallListener for this instance if the listener is not already
- * registered.
- *
- * @param aListener
- * The InstallListener to add
- */
- addListener(aListener) {
- if (!this.listeners.some(function(i) { return i == aListener; }))
- this.listeners.push(aListener);
- }
-
- /**
- * Removes an InstallListener for this instance if it is registered.
- *
- * @param aListener
- * The InstallListener to remove
- */
- removeListener(aListener) {
- this.listeners = this.listeners.filter(function(i) {
- return i != aListener;
- });
- }
-
- /**
- * Removes the temporary file owned by this AddonInstall if there is one.
- */
- removeTemporaryFile() {
- // Only proceed if this AddonInstall owns its XPI file
- if (!this.ownsTempFile) {
- this.logger.debug("removeTemporaryFile: " + this.sourceURI.spec + " does not own temp file");
- return;
- }
-
- try {
- this.logger.debug("removeTemporaryFile: " + this.sourceURI.spec + " removing temp file " +
- this.file.path);
- this.file.remove(true);
- this.ownsTempFile = false;
- }
- catch (e) {
- this.logger.warn("Failed to remove temporary file " + this.file.path + " for addon " +
- this.sourceURI.spec,
- e);
- }
- }
-
- /**
- * Updates the sourceURI and releaseNotesURI values on the Addon being
- * installed by this AddonInstall instance.
- */
- updateAddonURIs() {
- this.addon.sourceURI = this.sourceURI.spec;
- if (this.releaseNotesURI)
- this.addon.releaseNotesURI = this.releaseNotesURI.spec;
- }
-
- /**
- * Fills out linkedInstalls with AddonInstall instances for the other files
- * in a multi-package XPI.
- *
- * @param aFiles
- * An array of { entryName, file } for each remaining file from the
- * multi-package XPI.
- */
- _createLinkedInstalls(aFiles) {
- return Task.spawn((function*() {
- if (aFiles.length == 0)
- return;
-
- // Create new AddonInstall instances for every remaining file
- if (!this.linkedInstalls)
- this.linkedInstalls = [];
-
- for (let { entryName, file } of aFiles) {
- logger.debug("Creating linked install from " + entryName);
- let install = yield createLocalInstall(file);
-
- // Make the new install own its temporary file
- install.ownsTempFile = true;
-
- this.linkedInstalls.push(install);
-
- // If one of the internal XPIs was multipackage then move its linked
- // installs to the outer install
- if (install.linkedInstalls) {
- this.linkedInstalls.push(...install.linkedInstalls);
- install.linkedInstalls = null;
- }
-
- install.sourceURI = this.sourceURI;
- install.releaseNotesURI = this.releaseNotesURI;
- if (install.state != AddonManager.STATE_DOWNLOAD_FAILED)
- install.updateAddonURIs();
- }
- }).bind(this));
- }
-
- /**
- * Loads add-on manifests from a multi-package XPI file. Each of the
- * XPI and JAR files contained in the XPI will be extracted. Any that
- * do not contain valid add-ons will be ignored. The first valid add-on will
- * be installed by this AddonInstall instance, the rest will have new
- * AddonInstall instances created for them.
- *
- * @param aZipReader
- * An open nsIZipReader for the multi-package XPI's files. This will
- * be closed before this method returns.
- */
- _loadMultipackageManifests(aZipReader) {
- return Task.spawn((function*() {
- let files = [];
- let entries = aZipReader.findEntries("(*.[Xx][Pp][Ii]|*.[Jj][Aa][Rr])");
- while (entries.hasMore()) {
- let entryName = entries.getNext();
- let file = getTemporaryFile();
- try {
- aZipReader.extract(entryName, file);
- files.push({ entryName, file });
- }
- catch (e) {
- logger.warn("Failed to extract " + entryName + " from multi-package " +
- "XPI", e);
- file.remove(false);
- }
- }
-
- aZipReader.close();
-
- if (files.length == 0) {
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE,
- "Multi-package XPI does not contain any packages to install"]);
- }
-
- let addon = null;
-
- // Find the first file that is a valid install and use it for
- // the add-on that this AddonInstall instance will install.
- for (let { entryName, file } of files) {
- this.removeTemporaryFile();
- try {
- yield this.loadManifest(file);
- logger.debug("Base multi-package XPI install came from " + entryName);
- this.file = file;
- this.ownsTempFile = true;
-
- yield this._createLinkedInstalls(files.filter(f => f.file != file));
- return undefined;
- }
- catch (e) {
- // _createLinkedInstalls will log errors when it tries to process this
- // file
- }
- }
-
- // No valid add-on was found, delete all the temporary files
- for (let { file } of files) {
- try {
- file.remove(true);
- } catch (e) {
- this.logger.warn("Could not remove temp file " + file.path);
- }
- }
-
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE,
- "Multi-package XPI does not contain any valid packages to install"]);
- }).bind(this));
- }
-
- /**
- * Called after the add-on is a local file and the signature and install
- * manifest can be read.
- *
- * @param aCallback
- * A function to call when the manifest has been loaded
- * @throws if the add-on does not contain a valid install manifest or the
- * XPI is incorrectly signed
- */
- loadManifest(file) {
- return Task.spawn((function*() {
- let zipreader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- try {
- zipreader.open(file);
- }
- catch (e) {
- zipreader.close();
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE, e]);
- }
-
- try {
- // loadManifestFromZipReader performs the certificate verification for us
- this.addon = yield loadManifestFromZipReader(zipreader, this.installLocation);
- }
- catch (e) {
- zipreader.close();
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE, e]);
- }
-
- // A multi-package XPI is a container, the add-ons it holds each
- // have their own id. Everything else had better have an id here.
- if (!this.addon.id && this.addon.type != "multipackage") {
- let err = new Error(`Cannot find id for addon ${file.path}`);
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE, err]);
- }
-
- if (this.existingAddon) {
- // Check various conditions related to upgrades
- if (this.addon.id != this.existingAddon.id) {
- zipreader.close();
- return Promise.reject([AddonManager.ERROR_INCORRECT_ID,
- `Refusing to upgrade addon ${this.existingAddon.id} to different ID {this.addon.id}`]);
- }
-
- if (this.addon.type == "multipackage") {
- zipreader.close();
- return Promise.reject([AddonManager.ERROR_UNEXPECTED_ADDON_TYPE,
- `Refusing to upgrade addon ${this.existingAddon.id} to a multi-package xpi`]);
- }
-
- if (this.existingAddon.type == "webextension" && this.addon.type != "webextension") {
- zipreader.close();
- return Promise.reject([AddonManager.ERROR_UNEXPECTED_ADDON_TYPE,
- "WebExtensions may not be upated to other extension types"]);
- }
- }
-
- if (mustSign(this.addon.type)) {
- if (this.addon.signedState <= AddonManager.SIGNEDSTATE_MISSING) {
- // This add-on isn't properly signed by a signature that chains to the
- // trusted root.
- let state = this.addon.signedState;
- this.addon = null;
- zipreader.close();
-
- if (state == AddonManager.SIGNEDSTATE_MISSING)
- return Promise.reject([AddonManager.ERROR_SIGNEDSTATE_REQUIRED,
- "signature is required but missing"])
-
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE,
- "signature verification failed"])
- }
- }
- else if (this.addon.signedState == AddonManager.SIGNEDSTATE_UNKNOWN ||
- this.addon.signedState == AddonManager.SIGNEDSTATE_NOT_REQUIRED) {
- // Check object signing certificate, if any
- let x509 = zipreader.getSigningCert(null);
- if (x509) {
- logger.debug("Verifying XPI signature");
- if (verifyZipSigning(zipreader, x509)) {
- this.certificate = x509;
- if (this.certificate.commonName.length > 0) {
- this.certName = this.certificate.commonName;
- } else {
- this.certName = this.certificate.organization;
- }
- } else {
- zipreader.close();
- return Promise.reject([AddonManager.ERROR_CORRUPT_FILE,
- "XPI is incorrectly signed"]);
- }
- }
- }
-
- if (this.addon.type == "multipackage")
- return this._loadMultipackageManifests(zipreader);
-
- zipreader.close();
-
- this.updateAddonURIs();
-
- this.addon._install = this;
- this.name = this.addon.selectedLocale.name || this.addon.defaultLocale.name;
- this.type = this.addon.type;
- this.version = this.addon.version;
-
- // Setting the iconURL to something inside the XPI locks the XPI and
- // makes it impossible to delete on Windows.
-
- // Try to load from the existing cache first
- let repoAddon = yield new Promise(resolve => AddonRepository.getCachedAddonByID(this.addon.id, resolve));
-
- // It wasn't there so try to re-download it
- if (!repoAddon) {
- yield new Promise(resolve => AddonRepository.cacheAddons([this.addon.id], resolve));
- repoAddon = yield new Promise(resolve => AddonRepository.getCachedAddonByID(this.addon.id, resolve));
- }
-
- this.addon._repositoryAddon = repoAddon;
- this.name = this.name || this.addon._repositoryAddon.name;
- this.addon.compatibilityOverrides = repoAddon ?
- repoAddon.compatibilityOverrides :
- null;
- this.addon.appDisabled = !isUsableAddon(this.addon);
- return undefined;
- }).bind(this));
- }
-
- // TODO This relies on the assumption that we are always installing into the
- // highest priority install location so the resulting add-on will be visible
- // overriding any existing copy in another install location (bug 557710).
- /**
- * Installs the add-on into the install location.
- */
- startInstall() {
- this.state = AddonManager.STATE_INSTALLING;
- if (!AddonManagerPrivate.callInstallListeners("onInstallStarted",
- this.listeners, this.wrapper)) {
- this.state = AddonManager.STATE_DOWNLOADED;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onInstallCancelled",
- this.listeners, this.wrapper)
- return;
- }
-
- // Find and cancel any pending installs for the same add-on in the same
- // install location
- for (let aInstall of XPIProvider.installs) {
- if (aInstall.state == AddonManager.STATE_INSTALLED &&
- aInstall.installLocation == this.installLocation &&
- aInstall.addon.id == this.addon.id) {
- logger.debug("Cancelling previous pending install of " + aInstall.addon.id);
- aInstall.cancel();
- }
- }
-
- let isUpgrade = this.existingAddon &&
- this.existingAddon._installLocation == this.installLocation;
- let requiresRestart = XPIProvider.installRequiresRestart(this.addon);
-
- logger.debug("Starting install of " + this.addon.id + " from " + this.sourceURI.spec);
- AddonManagerPrivate.callAddonListeners("onInstalling",
- this.addon.wrapper,
- requiresRestart);
-
- let stagedAddon = this.installLocation.getStagingDir();
-
- Task.spawn((function*() {
- let installedUnpacked = 0;
-
- yield this.installLocation.requestStagingDir();
-
- // remove any previously staged files
- yield this.unstageInstall(stagedAddon);
-
- stagedAddon.append(this.addon.id);
- stagedAddon.leafName = this.addon.id + ".xpi";
-
- installedUnpacked = yield this.stageInstall(requiresRestart, stagedAddon, isUpgrade);
-
- if (requiresRestart) {
- this.state = AddonManager.STATE_INSTALLED;
- AddonManagerPrivate.callInstallListeners("onInstallEnded",
- this.listeners, this.wrapper,
- this.addon.wrapper);
- }
- else {
- // The install is completed so it should be removed from the active list
- XPIProvider.removeActiveInstall(this);
-
- // Deactivate and remove the old add-on as necessary
- let reason = BOOTSTRAP_REASONS.ADDON_INSTALL;
- if (this.existingAddon) {
- if (Services.vc.compare(this.existingAddon.version, this.addon.version) < 0)
- reason = BOOTSTRAP_REASONS.ADDON_UPGRADE;
- else
- reason = BOOTSTRAP_REASONS.ADDON_DOWNGRADE;
-
- if (this.existingAddon.bootstrap) {
- let file = this.existingAddon._sourceBundle;
- if (this.existingAddon.active) {
- XPIProvider.callBootstrapMethod(this.existingAddon, file,
- "shutdown", reason,
- { newVersion: this.addon.version });
- }
-
- XPIProvider.callBootstrapMethod(this.existingAddon, file,
- "uninstall", reason,
- { newVersion: this.addon.version });
- XPIProvider.unloadBootstrapScope(this.existingAddon.id);
- flushChromeCaches();
- }
-
- if (!isUpgrade && this.existingAddon.active) {
- XPIDatabase.updateAddonActive(this.existingAddon, false);
- }
- }
-
- // Install the new add-on into its final location
- let existingAddonID = this.existingAddon ? this.existingAddon.id : null;
- let file = this.installLocation.installAddon({
- id: this.addon.id,
- source: stagedAddon,
- existingAddonID
- });
-
- // Update the metadata in the database
- this.addon._sourceBundle = file;
- this.addon.visible = true;
-
- if (isUpgrade) {
- this.addon = XPIDatabase.updateAddonMetadata(this.existingAddon, this.addon,
- file.persistentDescriptor);
- let state = XPIStates.getAddon(this.installLocation.name, this.addon.id);
- if (state) {
- state.syncWithDB(this.addon, true);
- } else {
- logger.warn("Unexpected missing XPI state for add-on ${id}", this.addon);
- }
- }
- else {
- this.addon.active = (this.addon.visible && !this.addon.disabled);
- this.addon = XPIDatabase.addAddonMetadata(this.addon, file.persistentDescriptor);
- XPIStates.addAddon(this.addon);
- this.addon.installDate = this.addon.updateDate;
- XPIDatabase.saveChanges();
- }
- XPIStates.save();
-
- let extraParams = {};
- if (this.existingAddon) {
- extraParams.oldVersion = this.existingAddon.version;
- }
-
- if (this.addon.bootstrap) {
- XPIProvider.callBootstrapMethod(this.addon, file, "install",
- reason, extraParams);
- }
-
- AddonManagerPrivate.callAddonListeners("onInstalled",
- this.addon.wrapper);
-
- logger.debug("Install of " + this.sourceURI.spec + " completed.");
- this.state = AddonManager.STATE_INSTALLED;
- AddonManagerPrivate.callInstallListeners("onInstallEnded",
- this.listeners, this.wrapper,
- this.addon.wrapper);
-
- if (this.addon.bootstrap) {
- if (this.addon.active) {
- XPIProvider.callBootstrapMethod(this.addon, file, "startup",
- reason, extraParams);
- }
- else {
- // XXX this makes it dangerous to do some things in onInstallEnded
- // listeners because important cleanup hasn't been done yet
- XPIProvider.unloadBootstrapScope(this.addon.id);
- }
- }
- XPIProvider.setTelemetry(this.addon.id, "unpacked", installedUnpacked);
- recordAddonTelemetry(this.addon);
- }
- }).bind(this)).then(null, (e) => {
- logger.warn(`Failed to install ${this.file.path} from ${this.sourceURI.spec} to ${stagedAddon.path}`, e);
-
- if (stagedAddon.exists())
- recursiveRemove(stagedAddon);
- this.state = AddonManager.STATE_INSTALL_FAILED;
- this.error = AddonManager.ERROR_FILE_ACCESS;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callAddonListeners("onOperationCancelled",
- this.addon.wrapper);
- AddonManagerPrivate.callInstallListeners("onInstallFailed",
- this.listeners,
- this.wrapper);
- }).then(() => {
- this.removeTemporaryFile();
- return this.installLocation.releaseStagingDir();
- });
- }
-
- /**
- * Stages an upgrade for next application restart.
- */
- stageInstall(restartRequired, stagedAddon, isUpgrade) {
- return Task.spawn((function*() {
- let stagedJSON = stagedAddon.clone();
- stagedJSON.leafName = this.addon.id + ".json";
-
- let installedUnpacked = 0;
-
- // First stage the file regardless of whether restarting is necessary
- if (this.addon.unpack || Preferences.get(PREF_XPI_UNPACK, false)) {
- logger.debug("Addon " + this.addon.id + " will be installed as " +
- "an unpacked directory");
- stagedAddon.leafName = this.addon.id;
- yield OS.File.makeDir(stagedAddon.path);
- yield ZipUtils.extractFilesAsync(this.file, stagedAddon);
- installedUnpacked = 1;
- }
- else {
- logger.debug(`Addon ${this.addon.id} will be installed as a packed xpi`);
- stagedAddon.leafName = this.addon.id + ".xpi";
-
- yield OS.File.copy(this.file.path, stagedAddon.path);
- }
-
- if (restartRequired) {
- // Point the add-on to its extracted files as the xpi may get deleted
- this.addon._sourceBundle = stagedAddon;
-
- // Cache the AddonInternal as it may have updated compatibility info
- writeStringToFile(stagedJSON, JSON.stringify(this.addon));
-
- logger.debug("Staged install of " + this.addon.id + " from " + this.sourceURI.spec + " ready; waiting for restart.");
- if (isUpgrade) {
- delete this.existingAddon.pendingUpgrade;
- this.existingAddon.pendingUpgrade = this.addon;
- }
- }
-
- return installedUnpacked;
- }).bind(this));
- }
-
- /**
- * Removes any previously staged upgrade.
- */
- unstageInstall(stagedAddon) {
- return Task.spawn((function*() {
- let stagedJSON = stagedAddon.clone();
- let removedAddon = stagedAddon.clone();
-
- stagedJSON.append(this.addon.id + ".json");
-
- if (stagedJSON.exists()) {
- stagedJSON.remove(true);
- }
-
- removedAddon.append(this.addon.id);
- yield removeAsync(removedAddon);
- removedAddon.leafName = this.addon.id + ".xpi";
- yield removeAsync(removedAddon);
- }).bind(this));
- }
-
- /**
- * Postone a pending update, until restart or until the add-on resumes.
- *
- * @param {Function} resumeFunction - a function for the add-on to run
- * when resuming.
- */
- postpone(resumeFunction) {
- return Task.spawn((function*() {
- this.state = AddonManager.STATE_POSTPONED;
-
- let stagingDir = this.installLocation.getStagingDir();
- let stagedAddon = stagingDir.clone();
-
- yield this.installLocation.requestStagingDir();
- yield this.unstageInstall(stagedAddon);
-
- stagedAddon.append(this.addon.id);
- stagedAddon.leafName = this.addon.id + ".xpi";
-
- yield this.stageInstall(true, stagedAddon, true);
-
- AddonManagerPrivate.callInstallListeners("onInstallPostponed",
- this.listeners, this.wrapper)
-
- // upgrade has been staged for restart, provide a way for it to call the
- // resume function.
- if (resumeFunction) {
- let callback = AddonManagerPrivate.getUpgradeListener(this.addon.id);
- if (callback) {
- callback({
- version: this.version,
- install: () => {
- switch (this.state) {
- case AddonManager.STATE_POSTPONED:
- resumeFunction();
- break;
- default:
- logger.warn(`${this.addon.id} cannot resume postponed upgrade from state (${this.state})`);
- break;
- }
- },
- });
- }
- }
- this.installLocation.releaseStagingDir();
- }).bind(this));
- }
-}
-
-class LocalAddonInstall extends AddonInstall {
- /**
- * Initialises this install to be an install from a local file.
- *
- * @returns Promise
- * A Promise that resolves when the object is ready to use.
- */
- init() {
- return Task.spawn((function*() {
- this.file = this.sourceURI.QueryInterface(Ci.nsIFileURL).file;
-
- if (!this.file.exists()) {
- logger.warn("XPI file " + this.file.path + " does not exist");
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = AddonManager.ERROR_NETWORK_FAILURE;
- XPIProvider.removeActiveInstall(this);
- return;
- }
-
- this.state = AddonManager.STATE_DOWNLOADED;
- this.progress = this.file.fileSize;
- this.maxProgress = this.file.fileSize;
-
- if (this.hash) {
- let crypto = Cc["@mozilla.org/security/hash;1"].
- createInstance(Ci.nsICryptoHash);
- try {
- crypto.initWithString(this.hash.algorithm);
- }
- catch (e) {
- logger.warn("Unknown hash algorithm '" + this.hash.algorithm + "' for addon " + this.sourceURI.spec, e);
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = AddonManager.ERROR_INCORRECT_HASH;
- XPIProvider.removeActiveInstall(this);
- return;
- }
-
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fis.init(this.file, -1, -1, false);
- crypto.updateFromStream(fis, this.file.fileSize);
- let calculatedHash = getHashStringForCrypto(crypto);
- if (calculatedHash != this.hash.data) {
- logger.warn("File hash (" + calculatedHash + ") did not match provided hash (" +
- this.hash.data + ")");
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = AddonManager.ERROR_INCORRECT_HASH;
- XPIProvider.removeActiveInstall(this);
- return;
- }
- }
-
- try {
- yield this.loadManifest(this.file);
- } catch ([error, message]) {
- logger.warn("Invalid XPI", message);
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = error;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onNewInstall",
- this.listeners,
- this.wrapper);
- return;
- }
-
- let addon = yield new Promise(resolve => {
- XPIDatabase.getVisibleAddonForID(this.addon.id, resolve);
- });
-
- this.existingAddon = addon;
- if (addon)
- applyBlocklistChanges(addon, this.addon);
- this.addon.updateDate = Date.now();
- this.addon.installDate = addon ? addon.installDate : this.addon.updateDate;
-
- if (!this.addon.isCompatible) {
- this.state = AddonManager.STATE_CHECKING;
-
- yield new Promise(resolve => {
- new UpdateChecker(this.addon, {
- onUpdateFinished: aAddon => {
- this.state = AddonManager.STATE_DOWNLOADED;
- AddonManagerPrivate.callInstallListeners("onNewInstall",
- this.listeners,
- this.wrapper);
- resolve();
- }
- }, AddonManager.UPDATE_WHEN_ADDON_INSTALLED);
- });
- }
- else {
- AddonManagerPrivate.callInstallListeners("onNewInstall",
- this.listeners,
- this.wrapper);
-
- }
- }).bind(this));
- }
-
- install() {
- if (this.state == AddonManager.STATE_DOWNLOAD_FAILED) {
- // For a local install, this state means that verification of the
- // file failed (e.g., the hash or signature or manifest contents
- // were invalid). It doesn't make sense to retry anything in this
- // case but we have callers who don't know if their AddonInstall
- // object is a local file or a download so accomodate them here.
- AddonManagerPrivate.callInstallListeners("onDownloadFailed",
- this.listeners, this.wrapper);
- return;
- }
- super.install();
- }
-}
-
-class DownloadAddonInstall extends AddonInstall {
- /**
- * Instantiates a DownloadAddonInstall
- *
- * @param installLocation
- * The InstallLocation the add-on will be installed into
- * @param url
- * The nsIURL to get the add-on from
- * @param name
- * An optional name for the add-on
- * @param hash
- * An optional hash for the add-on
- * @param existingAddon
- * The add-on this install will update if known
- * @param browser
- * The browser performing the install, used to display
- * authentication prompts.
- * @param type
- * An optional type for the add-on
- * @param icons
- * Optional icons for the add-on
- * @param version
- * An optional version for the add-on
- */
- constructor(installLocation, url, hash, existingAddon, browser,
- name, type, icons, version) {
- super(installLocation, url, hash, existingAddon);
-
- this.browser = browser;
-
- this.state = AddonManager.STATE_AVAILABLE;
- this.name = name;
- this.type = type;
- this.version = version;
- this.icons = icons;
-
- this.stream = null;
- this.crypto = null;
- this.badCertHandler = null;
- this.restartDownload = false;
-
- AddonManagerPrivate.callInstallListeners("onNewInstall", this.listeners,
- this.wrapper);
- }
-
- install() {
- switch (this.state) {
- case AddonManager.STATE_AVAILABLE:
- this.startDownload();
- break;
- case AddonManager.STATE_DOWNLOAD_FAILED:
- case AddonManager.STATE_INSTALL_FAILED:
- case AddonManager.STATE_CANCELLED:
- this.removeTemporaryFile();
- this.state = AddonManager.STATE_AVAILABLE;
- this.error = 0;
- this.progress = 0;
- this.maxProgress = -1;
- this.hash = this.originalHash;
- this.startDownload();
- break;
- default:
- super.install();
- }
- }
-
- cancel() {
- if (this.state == AddonManager.STATE_DOWNLOADING) {
- if (this.channel) {
- logger.debug("Cancelling download of " + this.sourceURI.spec);
- this.channel.cancel(Cr.NS_BINDING_ABORTED);
- }
- } else {
- super.cancel();
- }
- }
-
- observe(aSubject, aTopic, aData) {
- // Network is going offline
- this.cancel();
- }
-
- /**
- * Starts downloading the add-on's XPI file.
- */
- startDownload() {
- this.state = AddonManager.STATE_DOWNLOADING;
- if (!AddonManagerPrivate.callInstallListeners("onDownloadStarted",
- this.listeners, this.wrapper)) {
- logger.debug("onDownloadStarted listeners cancelled installation of addon " + this.sourceURI.spec);
- this.state = AddonManager.STATE_CANCELLED;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadCancelled",
- this.listeners, this.wrapper)
- return;
- }
-
- // If a listener changed our state then do not proceed with the download
- if (this.state != AddonManager.STATE_DOWNLOADING)
- return;
-
- if (this.channel) {
- // A previous download attempt hasn't finished cleaning up yet, signal
- // that it should restart when complete
- logger.debug("Waiting for previous download to complete");
- this.restartDownload = true;
- return;
- }
-
- this.openChannel();
- }
-
- openChannel() {
- this.restartDownload = false;
-
- try {
- this.file = getTemporaryFile();
- this.ownsTempFile = true;
- this.stream = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- this.stream.init(this.file, FileUtils.MODE_WRONLY | FileUtils.MODE_CREATE |
- FileUtils.MODE_TRUNCATE, FileUtils.PERMS_FILE, 0);
- }
- catch (e) {
- logger.warn("Failed to start download for addon " + this.sourceURI.spec, e);
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = AddonManager.ERROR_FILE_ACCESS;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadFailed",
- this.listeners, this.wrapper);
- return;
- }
-
- let listener = Cc["@mozilla.org/network/stream-listener-tee;1"].
- createInstance(Ci.nsIStreamListenerTee);
- listener.init(this, this.stream);
- try {
- let requireBuiltIn = Preferences.get(PREF_INSTALL_REQUIREBUILTINCERTS, true);
- this.badCertHandler = new CertUtils.BadCertHandler(!requireBuiltIn);
-
- this.channel = NetUtil.newChannel({
- uri: this.sourceURI,
- loadUsingSystemPrincipal: true
- });
- this.channel.notificationCallbacks = this;
- if (this.channel instanceof Ci.nsIHttpChannel) {
- this.channel.setRequestHeader("Moz-XPI-Update", "1", true);
- if (this.channel instanceof Ci.nsIHttpChannelInternal)
- this.channel.forceAllowThirdPartyCookie = true;
- }
- this.channel.asyncOpen2(listener);
-
- Services.obs.addObserver(this, "network:offline-about-to-go-offline", false);
- }
- catch (e) {
- logger.warn("Failed to start download for addon " + this.sourceURI.spec, e);
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = AddonManager.ERROR_NETWORK_FAILURE;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadFailed",
- this.listeners, this.wrapper);
- }
- }
-
- /**
- * Update the crypto hasher with the new data and call the progress listeners.
- *
- * @see nsIStreamListener
- */
- onDataAvailable(aRequest, aContext, aInputstream, aOffset, aCount) {
- this.crypto.updateFromStream(aInputstream, aCount);
- this.progress += aCount;
- if (!AddonManagerPrivate.callInstallListeners("onDownloadProgress",
- this.listeners, this.wrapper)) {
- // TODO cancel the download and make it available again (bug 553024)
- }
- }
-
- /**
- * Check the redirect response for a hash of the target XPI and verify that
- * we don't end up on an insecure channel.
- *
- * @see nsIChannelEventSink
- */
- asyncOnChannelRedirect(aOldChannel, aNewChannel, aFlags, aCallback) {
- if (!this.hash && aOldChannel.originalURI.schemeIs("https") &&
- aOldChannel instanceof Ci.nsIHttpChannel) {
- try {
- let hashStr = aOldChannel.getResponseHeader("X-Target-Digest");
- let hashSplit = hashStr.toLowerCase().split(":");
- this.hash = {
- algorithm: hashSplit[0],
- data: hashSplit[1]
- };
- }
- catch (e) {
- }
- }
-
- // Verify that we don't end up on an insecure channel if we haven't got a
- // hash to verify with (see bug 537761 for discussion)
- if (!this.hash)
- this.badCertHandler.asyncOnChannelRedirect(aOldChannel, aNewChannel, aFlags, aCallback);
- else
- aCallback.onRedirectVerifyCallback(Cr.NS_OK);
-
- this.channel = aNewChannel;
- }
-
- /**
- * This is the first chance to get at real headers on the channel.
- *
- * @see nsIStreamListener
- */
- onStartRequest(aRequest, aContext) {
- this.crypto = Cc["@mozilla.org/security/hash;1"].
- createInstance(Ci.nsICryptoHash);
- if (this.hash) {
- try {
- this.crypto.initWithString(this.hash.algorithm);
- }
- catch (e) {
- logger.warn("Unknown hash algorithm '" + this.hash.algorithm + "' for addon " + this.sourceURI.spec, e);
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = AddonManager.ERROR_INCORRECT_HASH;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadFailed",
- this.listeners, this.wrapper);
- aRequest.cancel(Cr.NS_BINDING_ABORTED);
- return;
- }
- }
- else {
- // We always need something to consume data from the inputstream passed
- // to onDataAvailable so just create a dummy cryptohasher to do that.
- this.crypto.initWithString("sha1");
- }
-
- this.progress = 0;
- if (aRequest instanceof Ci.nsIChannel) {
- try {
- this.maxProgress = aRequest.contentLength;
- }
- catch (e) {
- }
- logger.debug("Download started for " + this.sourceURI.spec + " to file " +
- this.file.path);
- }
- }
-
- /**
- * The download is complete.
- *
- * @see nsIStreamListener
- */
- onStopRequest(aRequest, aContext, aStatus) {
- this.stream.close();
- this.channel = null;
- this.badCerthandler = null;
- Services.obs.removeObserver(this, "network:offline-about-to-go-offline");
-
- // If the download was cancelled then update the state and send events
- if (aStatus == Cr.NS_BINDING_ABORTED) {
- if (this.state == AddonManager.STATE_DOWNLOADING) {
- logger.debug("Cancelled download of " + this.sourceURI.spec);
- this.state = AddonManager.STATE_CANCELLED;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadCancelled",
- this.listeners, this.wrapper);
- // If a listener restarted the download then there is no need to
- // remove the temporary file
- if (this.state != AddonManager.STATE_CANCELLED)
- return;
- }
-
- this.removeTemporaryFile();
- if (this.restartDownload)
- this.openChannel();
- return;
- }
-
- logger.debug("Download of " + this.sourceURI.spec + " completed.");
-
- if (Components.isSuccessCode(aStatus)) {
- if (!(aRequest instanceof Ci.nsIHttpChannel) || aRequest.requestSucceeded) {
- if (!this.hash && (aRequest instanceof Ci.nsIChannel)) {
- try {
- CertUtils.checkCert(aRequest,
- !Preferences.get(PREF_INSTALL_REQUIREBUILTINCERTS, true));
- }
- catch (e) {
- this.downloadFailed(AddonManager.ERROR_NETWORK_FAILURE, e);
- return;
- }
- }
-
- // convert the binary hash data to a hex string.
- let calculatedHash = getHashStringForCrypto(this.crypto);
- this.crypto = null;
- if (this.hash && calculatedHash != this.hash.data) {
- this.downloadFailed(AddonManager.ERROR_INCORRECT_HASH,
- "Downloaded file hash (" + calculatedHash +
- ") did not match provided hash (" + this.hash.data + ")");
- return;
- }
-
- this.loadManifest(this.file).then(() => {
- if (this.addon.isCompatible) {
- this.downloadCompleted();
- }
- else {
- // TODO Should we send some event here (bug 557716)?
- this.state = AddonManager.STATE_CHECKING;
- new UpdateChecker(this.addon, {
- onUpdateFinished: aAddon => this.downloadCompleted(),
- }, AddonManager.UPDATE_WHEN_ADDON_INSTALLED);
- }
- }, ([error, message]) => {
- this.removeTemporaryFile();
- this.downloadFailed(error, message);
- });
- }
- else if (aRequest instanceof Ci.nsIHttpChannel) {
- this.downloadFailed(AddonManager.ERROR_NETWORK_FAILURE,
- aRequest.responseStatus + " " +
- aRequest.responseStatusText);
- }
- else {
- this.downloadFailed(AddonManager.ERROR_NETWORK_FAILURE, aStatus);
- }
- }
- else {
- this.downloadFailed(AddonManager.ERROR_NETWORK_FAILURE, aStatus);
- }
- }
-
- /**
- * Notify listeners that the download failed.
- *
- * @param aReason
- * Something to log about the failure
- * @param error
- * The error code to pass to the listeners
- */
- downloadFailed(aReason, aError) {
- logger.warn("Download of " + this.sourceURI.spec + " failed", aError);
- this.state = AddonManager.STATE_DOWNLOAD_FAILED;
- this.error = aReason;
- XPIProvider.removeActiveInstall(this);
- AddonManagerPrivate.callInstallListeners("onDownloadFailed", this.listeners,
- this.wrapper);
-
- // If the listener hasn't restarted the download then remove any temporary
- // file
- if (this.state == AddonManager.STATE_DOWNLOAD_FAILED) {
- logger.debug("downloadFailed: removing temp file for " + this.sourceURI.spec);
- this.removeTemporaryFile();
- }
- else
- logger.debug("downloadFailed: listener changed AddonInstall state for " +
- this.sourceURI.spec + " to " + this.state);
- }
-
- /**
- * Notify listeners that the download completed.
- */
- downloadCompleted() {
- XPIDatabase.getVisibleAddonForID(this.addon.id, aAddon => {
- if (aAddon)
- this.existingAddon = aAddon;
-
- this.state = AddonManager.STATE_DOWNLOADED;
- this.addon.updateDate = Date.now();
-
- if (this.existingAddon) {
- this.addon.existingAddonID = this.existingAddon.id;
- this.addon.installDate = this.existingAddon.installDate;
- applyBlocklistChanges(this.existingAddon, this.addon);
- }
- else {
- this.addon.installDate = this.addon.updateDate;
- }
-
- if (AddonManagerPrivate.callInstallListeners("onDownloadEnded",
- this.listeners,
- this.wrapper)) {
- // If a listener changed our state then do not proceed with the install
- if (this.state != AddonManager.STATE_DOWNLOADED)
- return;
-
- // If an upgrade listener is registered for this add-on, pass control
- // over the upgrade to the add-on.
- if (AddonManagerPrivate.hasUpgradeListener(this.addon.id)) {
- logger.info(`add-on ${this.addon.id} has an upgrade listener, postponing upgrade until restart`);
- let resumeFn = () => {
- logger.info(`${this.addon.id} has resumed a previously postponed upgrade`);
- this.state = AddonManager.STATE_DOWNLOADED;
- this.install();
- }
- this.postpone(resumeFn);
- } else {
- // no upgrade listener present, so proceed with normal install
- this.install();
- if (this.linkedInstalls) {
- for (let install of this.linkedInstalls) {
- if (install.state == AddonManager.STATE_DOWNLOADED)
- install.install();
- }
- }
- }
- }
- });
- }
-
- getInterface(iid) {
- if (iid.equals(Ci.nsIAuthPrompt2)) {
- let win = null;
- if (this.browser) {
- win = this.browser.contentWindow || this.browser.ownerDocument.defaultView;
- }
-
- let factory = Cc["@mozilla.org/prompter;1"].
- getService(Ci.nsIPromptFactory);
- let prompt = factory.getPrompt(win, Ci.nsIAuthPrompt2);
-
- if (this.browser && prompt instanceof Ci.nsILoginManagerPrompter)
- prompt.browser = this.browser;
-
- return prompt;
- }
- else if (iid.equals(Ci.nsIChannelEventSink)) {
- return this;
- }
-
- return this.badCertHandler.getInterface(iid);
- }
-
- /**
- * Postone a pending update, until restart or until the add-on resumes.
- *
- * @param {Function} resumeFn - a function for the add-on to run
- * when resuming.
- */
- postpone(resumeFn) {
- return Task.spawn((function*() {
- this.state = AddonManager.STATE_POSTPONED;
-
- let stagingDir = this.installLocation.getStagingDir();
- let stagedAddon = stagingDir.clone();
-
- yield this.installLocation.requestStagingDir();
- yield this.unstageInstall(stagedAddon);
-
- stagedAddon.append(this.addon.id);
- stagedAddon.leafName = this.addon.id + ".xpi";
-
- yield this.stageInstall(true, stagedAddon, true);
-
- AddonManagerPrivate.callInstallListeners("onInstallPostponed",
- this.listeners, this.wrapper)
-
- // upgrade has been staged for restart, provide a way for it to call the
- // resume function.
- let callback = AddonManagerPrivate.getUpgradeListener(this.addon.id);
- if (callback) {
- callback({
- version: this.version,
- install: () => {
- switch (this.state) {
- case AddonManager.STATE_POSTPONED:
- if (resumeFn) {
- resumeFn();
- }
- break;
- default:
- logger.warn(`${this.addon.id} cannot resume postponed upgrade from state (${this.state})`);
- break;
- }
- },
- });
- }
- // Release the staging directory lock, but since the staging dir is populated
- // it will not be removed until resumed or installed by restart.
- // See also cleanStagingDir()
- this.installLocation.releaseStagingDir();
- }).bind(this));
- }
-}
-
-/**
- * This class exists just for the specific case of staged add-ons that
- * fail to install at startup. When that happens, the add-on remains
- * staged but we want to keep track of it like other installs so that we
- * can clean it up if the same add-on is installed again (see the comment
- * about "pending installs for the same add-on" in AddonInstall.startInstall)
- */
-class StagedAddonInstall extends AddonInstall {
- constructor(installLocation, dir, manifest) {
- super(installLocation, dir);
-
- this.name = manifest.name;
- this.type = manifest.type;
- this.version = manifest.version;
- this.icons = manifest.icons;
- this.releaseNotesURI = manifest.releaseNotesURI ?
- NetUtil.newURI(manifest.releaseNotesURI) :
- null;
- this.sourceURI = manifest.sourceURI ?
- NetUtil.newURI(manifest.sourceURI) :
- null;
- this.file = null;
- this.addon = manifest;
-
- this.state = AddonManager.STATE_INSTALLED;
- }
-}
-
-/**
- * Creates a new AddonInstall to install an add-on from a local file.
- *
- * @param file
- * The file to install
- * @param location
- * The location to install to
- * @returns Promise
- * A Promise that resolves with the new install object.
- */
-function createLocalInstall(file, location) {
- if (!location) {
- location = XPIProvider.installLocationsByName[KEY_APP_PROFILE];
- }
- let url = Services.io.newFileURI(file);
-
- try {
- let install = new LocalAddonInstall(location, url);
- return install.init().then(() => install);
- }
- catch (e) {
- logger.error("Error creating install", e);
- XPIProvider.removeActiveInstall(this);
- return Promise.resolve(null);
- }
-}
-
-/**
- * Creates a new AddonInstall to download and install a URL.
- *
- * @param aCallback
- * The callback to pass the new AddonInstall to
- * @param aUri
- * The URI to download
- * @param aHash
- * A hash for the add-on
- * @param aName
- * A name for the add-on
- * @param aIcons
- * An icon URLs for the add-on
- * @param aVersion
- * A version for the add-on
- * @param aBrowser
- * The browser performing the install
- */
-function createDownloadInstall(aCallback, aUri, aHash, aName, aIcons,
- aVersion, aBrowser) {
- let location = XPIProvider.installLocationsByName[KEY_APP_PROFILE];
- let url = NetUtil.newURI(aUri);
-
- if (url instanceof Ci.nsIFileURL) {
- let install = new LocalAddonInstall(location, url, aHash);
- install.init().then(() => { aCallback(install); });
- } else {
- let install = new DownloadAddonInstall(location, url, aHash, null,
- aBrowser, aName, null, aIcons,
- aVersion);
- aCallback(install);
- }
-}
-
-/**
- * Creates a new AddonInstall for an update.
- *
- * @param aCallback
- * The callback to pass the new AddonInstall to
- * @param aAddon
- * The add-on being updated
- * @param aUpdate
- * The metadata about the new version from the update manifest
- */
-function createUpdate(aCallback, aAddon, aUpdate) {
- let url = NetUtil.newURI(aUpdate.updateURL);
-
- Task.spawn(function*() {
- let install;
- if (url instanceof Ci.nsIFileURL) {
- install = new LocalAddonInstall(aAddon._installLocation, url,
- aUpdate.updateHash, aAddon);
- yield install.init();
- } else {
- install = new DownloadAddonInstall(aAddon._installLocation, url,
- aUpdate.updateHash, aAddon, null,
- aAddon.selectedLocale.name ?
- aAddon.selectedLocale.name : aAddon.defaultLocale.name,
- aAddon.type, aAddon.icons, aUpdate.version);
- }
- try {
- if (aUpdate.updateInfoURL)
- install.releaseNotesURI = NetUtil.newURI(escapeAddonURI(aAddon, aUpdate.updateInfoURL));
- }
- catch (e) {
- // If the releaseNotesURI cannot be parsed then just ignore it.
- }
-
- aCallback(install);
- });
-}
-
-// This map is shared between AddonInstallWrapper and AddonWrapper
-const wrapperMap = new WeakMap();
-let installFor = wrapper => wrapperMap.get(wrapper);
-let addonFor = installFor;
-
-/**
- * Creates a wrapper for an AddonInstall that only exposes the public API
- *
- * @param install
- * The AddonInstall to create a wrapper for
- */
-function AddonInstallWrapper(aInstall) {
- wrapperMap.set(this, aInstall);
-}
-
-AddonInstallWrapper.prototype = {
- get __AddonInstallInternal__() {
- return AppConstants.DEBUG ? installFor(this) : undefined;
- },
-
- get type() {
- return getExternalType(installFor(this).type);
- },
-
- get iconURL() {
- return installFor(this).icons[32];
- },
-
- get existingAddon() {
- let install = installFor(this);
- return install.existingAddon ? install.existingAddon.wrapper : null;
- },
-
- get addon() {
- let install = installFor(this);
- return install.addon ? install.addon.wrapper : null;
- },
-
- get sourceURI() {
- return installFor(this).sourceURI;
- },
-
- get linkedInstalls() {
- let install = installFor(this);
- if (!install.linkedInstalls)
- return null;
- return install.linkedInstalls.map(i => i.wrapper);
- },
-
- install: function() {
- installFor(this).install();
- },
-
- cancel: function() {
- installFor(this).cancel();
- },
-
- addListener: function(listener) {
- installFor(this).addListener(listener);
- },
-
- removeListener: function(listener) {
- installFor(this).removeListener(listener);
- },
-};
-
-["name", "version", "icons", "releaseNotesURI", "file", "state", "error",
- "progress", "maxProgress", "certificate", "certName"].forEach(function(aProp) {
- Object.defineProperty(AddonInstallWrapper.prototype, aProp, {
- get: function() {
- return installFor(this)[aProp];
- },
- enumerable: true,
- });
-});
-
-/**
- * Creates a new update checker.
- *
- * @param aAddon
- * The add-on to check for updates
- * @param aListener
- * An UpdateListener to notify of updates
- * @param aReason
- * The reason for the update check
- * @param aAppVersion
- * An optional application version to check for updates for
- * @param aPlatformVersion
- * An optional platform version to check for updates for
- * @throws if the aListener or aReason arguments are not valid
- */
-function UpdateChecker(aAddon, aListener, aReason, aAppVersion, aPlatformVersion) {
- if (!aListener || !aReason)
- throw Cr.NS_ERROR_INVALID_ARG;
-
- Components.utils.import("resource://gre/modules/addons/AddonUpdateChecker.jsm");
-
- this.addon = aAddon;
- aAddon._updateCheck = this;
- XPIProvider.doing(this);
- this.listener = aListener;
- this.appVersion = aAppVersion;
- this.platformVersion = aPlatformVersion;
- this.syncCompatibility = (aReason == AddonManager.UPDATE_WHEN_NEW_APP_INSTALLED);
-
- let updateURL = aAddon.updateURL;
- if (!updateURL) {
- if (aReason == AddonManager.UPDATE_WHEN_PERIODIC_UPDATE &&
- Services.prefs.getPrefType(PREF_EM_UPDATE_BACKGROUND_URL) == Services.prefs.PREF_STRING) {
- updateURL = Services.prefs.getCharPref(PREF_EM_UPDATE_BACKGROUND_URL);
- } else {
- updateURL = Services.prefs.getCharPref(PREF_EM_UPDATE_URL);
- }
- }
-
- const UPDATE_TYPE_COMPATIBILITY = 32;
- const UPDATE_TYPE_NEWVERSION = 64;
-
- aReason |= UPDATE_TYPE_COMPATIBILITY;
- if ("onUpdateAvailable" in this.listener)
- aReason |= UPDATE_TYPE_NEWVERSION;
-
- let url = escapeAddonURI(aAddon, updateURL, aReason, aAppVersion);
- this._parser = AddonUpdateChecker.checkForUpdates(aAddon.id, aAddon.updateKey,
- url, this);
-}
-
-UpdateChecker.prototype = {
- addon: null,
- listener: null,
- appVersion: null,
- platformVersion: null,
- syncCompatibility: null,
-
- /**
- * Calls a method on the listener passing any number of arguments and
- * consuming any exceptions.
- *
- * @param aMethod
- * The method to call on the listener
- */
- callListener: function(aMethod, ...aArgs) {
- if (!(aMethod in this.listener))
- return;
-
- try {
- this.listener[aMethod].apply(this.listener, aArgs);
- }
- catch (e) {
- logger.warn("Exception calling UpdateListener method " + aMethod, e);
- }
- },
-
- /**
- * Called when AddonUpdateChecker completes the update check
- *
- * @param updates
- * The list of update details for the add-on
- */
- onUpdateCheckComplete: function(aUpdates) {
- XPIProvider.done(this.addon._updateCheck);
- this.addon._updateCheck = null;
- let AUC = AddonUpdateChecker;
-
- let ignoreMaxVersion = false;
- let ignoreStrictCompat = false;
- if (!AddonManager.checkCompatibility) {
- ignoreMaxVersion = true;
- ignoreStrictCompat = true;
- } else if (this.addon.type in COMPATIBLE_BY_DEFAULT_TYPES &&
- !AddonManager.strictCompatibility &&
- !this.addon.strictCompatibility &&
- !this.addon.hasBinaryComponents) {
- ignoreMaxVersion = true;
- }
-
- // Always apply any compatibility update for the current version
- let compatUpdate = AUC.getCompatibilityUpdate(aUpdates, this.addon.version,
- this.syncCompatibility,
- null, null,
- ignoreMaxVersion,
- ignoreStrictCompat);
- // Apply the compatibility update to the database
- if (compatUpdate)
- this.addon.applyCompatibilityUpdate(compatUpdate, this.syncCompatibility);
-
- // If the request is for an application or platform version that is
- // different to the current application or platform version then look for a
- // compatibility update for those versions.
- if ((this.appVersion &&
- Services.vc.compare(this.appVersion, Services.appinfo.version) != 0) ||
- (this.platformVersion &&
- Services.vc.compare(this.platformVersion, Services.appinfo.platformVersion) != 0)) {
- compatUpdate = AUC.getCompatibilityUpdate(aUpdates, this.addon.version,
- false, this.appVersion,
- this.platformVersion,
- ignoreMaxVersion,
- ignoreStrictCompat);
- }
-
- if (compatUpdate)
- this.callListener("onCompatibilityUpdateAvailable", this.addon.wrapper);
- else
- this.callListener("onNoCompatibilityUpdateAvailable", this.addon.wrapper);
-
- function sendUpdateAvailableMessages(aSelf, aInstall) {
- if (aInstall) {
- aSelf.callListener("onUpdateAvailable", aSelf.addon.wrapper,
- aInstall.wrapper);
- }
- else {
- aSelf.callListener("onNoUpdateAvailable", aSelf.addon.wrapper);
- }
- aSelf.callListener("onUpdateFinished", aSelf.addon.wrapper,
- AddonManager.UPDATE_STATUS_NO_ERROR);
- }
-
- let compatOverrides = AddonManager.strictCompatibility ?
- null :
- this.addon.compatibilityOverrides;
-
- let update = AUC.getNewestCompatibleUpdate(aUpdates,
- this.appVersion,
- this.platformVersion,
- ignoreMaxVersion,
- ignoreStrictCompat,
- compatOverrides);
-
- if (update && Services.vc.compare(this.addon.version, update.version) < 0
- && !this.addon._installLocation.locked) {
- for (let currentInstall of XPIProvider.installs) {
- // Skip installs that don't match the available update
- if (currentInstall.existingAddon != this.addon ||
- currentInstall.version != update.version)
- continue;
-
- // If the existing install has not yet started downloading then send an
- // available update notification. If it is already downloading then
- // don't send any available update notification
- if (currentInstall.state == AddonManager.STATE_AVAILABLE) {
- logger.debug("Found an existing AddonInstall for " + this.addon.id);
- sendUpdateAvailableMessages(this, currentInstall);
- }
- else
- sendUpdateAvailableMessages(this, null);
- return;
- }
-
- createUpdate(aInstall => {
- sendUpdateAvailableMessages(this, aInstall);
- }, this.addon, update);
- }
- else {
- sendUpdateAvailableMessages(this, null);
- }
- },
-
- /**
- * Called when AddonUpdateChecker fails the update check
- *
- * @param aError
- * An error status
- */
- onUpdateCheckError: function(aError) {
- XPIProvider.done(this.addon._updateCheck);
- this.addon._updateCheck = null;
- this.callListener("onNoCompatibilityUpdateAvailable", this.addon.wrapper);
- this.callListener("onNoUpdateAvailable", this.addon.wrapper);
- this.callListener("onUpdateFinished", this.addon.wrapper, aError);
- },
-
- /**
- * Called to cancel an in-progress update check
- */
- cancel: function() {
- let parser = this._parser;
- if (parser) {
- this._parser = null;
- // This will call back to onUpdateCheckError with a CANCELLED error
- parser.cancel();
- }
- }
-};
-
-/**
- * The AddonInternal is an internal only representation of add-ons. It may
- * have come from the database (see DBAddonInternal in XPIProviderUtils.jsm)
- * or an install manifest.
- */
-function AddonInternal() {
- this._hasResourceCache = new Map();
-
- XPCOMUtils.defineLazyGetter(this, "wrapper", () => {
- return new AddonWrapper(this);
- });
-}
-
-AddonInternal.prototype = {
- _selectedLocale: null,
- _hasResourceCache: null,
- active: false,
- visible: false,
- userDisabled: false,
- appDisabled: false,
- softDisabled: false,
- sourceURI: null,
- releaseNotesURI: null,
- foreignInstall: false,
- seen: true,
- skinnable: false,
-
- /**
- * @property {Array<string>} dependencies
- * An array of bootstrapped add-on IDs on which this add-on depends.
- * The add-on will remain appDisabled if any of the dependent
- * add-ons is not installed and enabled.
- */
- dependencies: Object.freeze([]),
- hasEmbeddedWebExtension: false,
-
- get selectedLocale() {
- if (this._selectedLocale)
- return this._selectedLocale;
- let locale = Locale.findClosestLocale(this.locales);
- this._selectedLocale = locale ? locale : this.defaultLocale;
- return this._selectedLocale;
- },
-
- get providesUpdatesSecurely() {
- return !!(this.updateKey || !this.updateURL ||
- this.updateURL.substring(0, 6) == "https:");
- },
-
- get isCorrectlySigned() {
- switch (this._installLocation.name) {
- case KEY_APP_SYSTEM_ADDONS:
- // System add-ons must be signed by the system key.
- return this.signedState == AddonManager.SIGNEDSTATE_SYSTEM
-
- case KEY_APP_SYSTEM_DEFAULTS:
- case KEY_APP_TEMPORARY:
- // Temporary and built-in system add-ons do not require signing.
- return true;
-
- case KEY_APP_SYSTEM_SHARE:
- case KEY_APP_SYSTEM_LOCAL:
- // On UNIX platforms except OSX, an additional location for system
- // add-ons exists in /usr/{lib,share}/mozilla/extensions. Add-ons
- // installed there do not require signing.
- if (Services.appinfo.OS != "Darwin")
- return true;
- break;
- }
-
- if (this.signedState === AddonManager.SIGNEDSTATE_NOT_REQUIRED)
- return true;
- return this.signedState > AddonManager.SIGNEDSTATE_MISSING;
- },
-
- get isCompatible() {
- return this.isCompatibleWith();
- },
-
- get disabled() {
- return (this.userDisabled || this.appDisabled || this.softDisabled);
- },
-
- get isPlatformCompatible() {
- if (this.targetPlatforms.length == 0)
- return true;
-
- let matchedOS = false;
-
- // If any targetPlatform matches the OS and contains an ABI then we will
- // only match a targetPlatform that contains both the current OS and ABI
- let needsABI = false;
-
- // Some platforms do not specify an ABI, test against null in that case.
- let abi = null;
- try {
- abi = Services.appinfo.XPCOMABI;
- }
- catch (e) { }
-
- // Something is causing errors in here
- try {
- for (let platform of this.targetPlatforms) {
- if (platform.os == Services.appinfo.OS) {
- if (platform.abi) {
- needsABI = true;
- if (platform.abi === abi)
- return true;
- }
- else {
- matchedOS = true;
- }
- }
- }
- } catch (e) {
- let message = "Problem with addon " + this.id + " targetPlatforms "
- + JSON.stringify(this.targetPlatforms);
- logger.error(message, e);
- AddonManagerPrivate.recordException("XPI", message, e);
- // don't trust this add-on
- return false;
- }
-
- return matchedOS && !needsABI;
- },
-
- isCompatibleWith: function(aAppVersion, aPlatformVersion) {
- let app = this.matchingTargetApplication;
- if (!app)
- return false;
-
- // set reasonable defaults for minVersion and maxVersion
- let minVersion = app.minVersion || "0";
- let maxVersion = app.maxVersion || "*";
-
- if (!aAppVersion)
- aAppVersion = Services.appinfo.version;
- if (!aPlatformVersion)
- aPlatformVersion = Services.appinfo.platformVersion;
-
- let version;
- if (app.id == Services.appinfo.ID)
- version = aAppVersion;
- else if (app.id == TOOLKIT_ID)
- version = aPlatformVersion
- else if (app.id == WEBEXTENSIONS_ID)
- version = WEBEXTENSIONS_VERSION
-
- // Only extensions and dictionaries can be compatible by default; themes
- // and language packs always use strict compatibility checking.
- if (this.type in COMPATIBLE_BY_DEFAULT_TYPES &&
- !AddonManager.strictCompatibility && !this.strictCompatibility &&
- !this.hasBinaryComponents) {
-
- // The repository can specify compatibility overrides.
- // Note: For now, only blacklisting is supported by overrides.
- if (this._repositoryAddon &&
- this._repositoryAddon.compatibilityOverrides) {
- let overrides = this._repositoryAddon.compatibilityOverrides;
- let override = AddonRepository.findMatchingCompatOverride(this.version,
- overrides);
- if (override && override.type == "incompatible")
- return false;
- }
-
- // Extremely old extensions should not be compatible by default.
- let minCompatVersion;
- if (app.id == Services.appinfo.ID)
- minCompatVersion = XPIProvider.minCompatibleAppVersion;
- else if (app.id == TOOLKIT_ID || app.id == WEBEXTENSIONS_ID)
- minCompatVersion = XPIProvider.minCompatiblePlatformVersion;
-
- if (minCompatVersion &&
- Services.vc.compare(minCompatVersion, maxVersion) > 0)
- return false;
-
- return Services.vc.compare(version, minVersion) >= 0;
- }
-
- return (Services.vc.compare(version, minVersion) >= 0) &&
- (Services.vc.compare(version, maxVersion) <= 0)
- },
-
- get matchingTargetApplication() {
- let app = null;
- for (let targetApp of this.targetApplications) {
- if (targetApp.id == Services.appinfo.ID)
- return targetApp;
- if (targetApp.id == TOOLKIT_ID || targetApp.id == WEBEXTENSIONS_ID)
- app = targetApp;
- }
- return app;
- },
-
- get blocklistState() {
- let staticItem = findMatchingStaticBlocklistItem(this);
- if (staticItem)
- return staticItem.level;
-
- return Blocklist.getAddonBlocklistState(this.wrapper);
- },
-
- get blocklistURL() {
- let staticItem = findMatchingStaticBlocklistItem(this);
- if (staticItem) {
- let url = Services.urlFormatter.formatURLPref("extensions.blocklist.itemURL");
- return url.replace(/%blockID%/g, staticItem.blockID);
- }
-
- return Blocklist.getAddonBlocklistURL(this.wrapper);
- },
-
- applyCompatibilityUpdate: function(aUpdate, aSyncCompatibility) {
- for (let targetApp of this.targetApplications) {
- for (let updateTarget of aUpdate.targetApplications) {
- if (targetApp.id == updateTarget.id && (aSyncCompatibility ||
- Services.vc.compare(targetApp.maxVersion, updateTarget.maxVersion) < 0)) {
- targetApp.minVersion = updateTarget.minVersion;
- targetApp.maxVersion = updateTarget.maxVersion;
- }
- }
- }
- if (aUpdate.multiprocessCompatible !== undefined)
- this.multiprocessCompatible = aUpdate.multiprocessCompatible;
- this.appDisabled = !isUsableAddon(this);
- },
-
- /**
- * getDataDirectory tries to execute the callback with two arguments:
- * 1) the path of the data directory within the profile,
- * 2) any exception generated from trying to build it.
- */
- getDataDirectory: function(callback) {
- let parentPath = OS.Path.join(OS.Constants.Path.profileDir, "extension-data");
- let dirPath = OS.Path.join(parentPath, this.id);
-
- Task.spawn(function*() {
- yield OS.File.makeDir(parentPath, {ignoreExisting: true});
- yield OS.File.makeDir(dirPath, {ignoreExisting: true});
- }).then(() => callback(dirPath, null),
- e => callback(dirPath, e));
- },
-
- /**
- * toJSON is called by JSON.stringify in order to create a filtered version
- * of this object to be serialized to a JSON file. A new object is returned
- * with copies of all non-private properties. Functions, getters and setters
- * are not copied.
- *
- * @param aKey
- * The key that this object is being serialized as in the JSON.
- * Unused here since this is always the main object serialized
- *
- * @return an object containing copies of the properties of this object
- * ignoring private properties, functions, getters and setters
- */
- toJSON: function(aKey) {
- let obj = {};
- for (let prop in this) {
- // Ignore the wrapper property
- if (prop == "wrapper")
- continue;
-
- // Ignore private properties
- if (prop.substring(0, 1) == "_")
- continue;
-
- // Ignore getters
- if (this.__lookupGetter__(prop))
- continue;
-
- // Ignore setters
- if (this.__lookupSetter__(prop))
- continue;
-
- // Ignore functions
- if (typeof this[prop] == "function")
- continue;
-
- obj[prop] = this[prop];
- }
-
- return obj;
- },
-
- /**
- * When an add-on install is pending its metadata will be cached in a file.
- * This method reads particular properties of that metadata that may be newer
- * than that in the install manifest, like compatibility information.
- *
- * @param aObj
- * A JS object containing the cached metadata
- */
- importMetadata: function(aObj) {
- for (let prop of PENDING_INSTALL_METADATA) {
- if (!(prop in aObj))
- continue;
-
- this[prop] = aObj[prop];
- }
-
- // Compatibility info may have changed so update appDisabled
- this.appDisabled = !isUsableAddon(this);
- },
-
- permissions: function() {
- let permissions = 0;
-
- // Add-ons that aren't installed cannot be modified in any way
- if (!(this.inDatabase))
- return permissions;
-
- if (!this.appDisabled) {
- if (this.userDisabled || this.softDisabled) {
- permissions |= AddonManager.PERM_CAN_ENABLE;
- }
- else if (this.type != "theme") {
- permissions |= AddonManager.PERM_CAN_DISABLE;
- }
- }
-
- // Add-ons that are in locked install locations, or are pending uninstall
- // cannot be upgraded or uninstalled
- if (!this._installLocation.locked && !this.pendingUninstall) {
- // Experiments cannot be upgraded.
- // System add-on upgrades are triggered through a different mechanism (see updateSystemAddons())
- let isSystem = (this._installLocation.name == KEY_APP_SYSTEM_DEFAULTS ||
- this._installLocation.name == KEY_APP_SYSTEM_ADDONS);
- // Add-ons that are installed by a file link cannot be upgraded.
- if (this.type != "experiment" &&
- !this._installLocation.isLinkedAddon(this.id) && !isSystem) {
- permissions |= AddonManager.PERM_CAN_UPGRADE;
- }
-
- permissions |= AddonManager.PERM_CAN_UNINSTALL;
- }
-
- return permissions;
- },
-};
-
-/**
- * The AddonWrapper wraps an Addon to provide the data visible to consumers of
- * the public API.
- */
-function AddonWrapper(aAddon) {
- wrapperMap.set(this, aAddon);
-}
-
-AddonWrapper.prototype = {
- get __AddonInternal__() {
- return AppConstants.DEBUG ? addonFor(this) : undefined;
- },
-
- get seen() {
- return addonFor(this).seen;
- },
-
- get hasEmbeddedWebExtension() {
- return addonFor(this).hasEmbeddedWebExtension;
- },
-
- markAsSeen: function() {
- addonFor(this).seen = true;
- XPIDatabase.saveChanges();
- },
-
- get type() {
- return getExternalType(addonFor(this).type);
- },
-
- get isWebExtension() {
- return addonFor(this).type == "webextension";
- },
-
- get temporarilyInstalled() {
- return addonFor(this)._installLocation == TemporaryInstallLocation;
- },
-
- get aboutURL() {
- return this.isActive ? addonFor(this)["aboutURL"] : null;
- },
-
- get optionsURL() {
- if (!this.isActive) {
- return null;
- }
-
- let addon = addonFor(this);
- if (addon.optionsURL) {
- if (this.isWebExtension || this.hasEmbeddedWebExtension) {
- // The internal object's optionsURL property comes from the addons
- // DB and should be a relative URL. However, extensions with
- // options pages installed before bug 1293721 was fixed got absolute
- // URLs in the addons db. This code handles both cases.
- let base = ExtensionManagement.getURLForExtension(addon.id);
- if (!base) {
- return null;
- }
- return new URL(addon.optionsURL, base).href;
- }
- return addon.optionsURL;
- }
-
- if (this.hasResource("options.xul"))
- return this.getResourceURI("options.xul").spec;
-
- return null;
- },
-
- get optionsType() {
- if (!this.isActive)
- return null;
-
- let addon = addonFor(this);
- let hasOptionsXUL = this.hasResource("options.xul");
- let hasOptionsURL = !!this.optionsURL;
-
- if (addon.optionsType) {
- switch (parseInt(addon.optionsType, 10)) {
- case AddonManager.OPTIONS_TYPE_DIALOG:
- case AddonManager.OPTIONS_TYPE_TAB:
- return hasOptionsURL ? addon.optionsType : null;
- case AddonManager.OPTIONS_TYPE_INLINE:
- case AddonManager.OPTIONS_TYPE_INLINE_INFO:
- case AddonManager.OPTIONS_TYPE_INLINE_BROWSER:
- return (hasOptionsXUL || hasOptionsURL) ? addon.optionsType : null;
- }
- return null;
- }
-
- if (hasOptionsXUL)
- return AddonManager.OPTIONS_TYPE_INLINE;
-
- if (hasOptionsURL)
- return AddonManager.OPTIONS_TYPE_DIALOG;
-
- return null;
- },
-
- get iconURL() {
- return AddonManager.getPreferredIconURL(this, 48);
- },
-
- get icon64URL() {
- return AddonManager.getPreferredIconURL(this, 64);
- },
-
- get icons() {
- let addon = addonFor(this);
- let icons = {};
-
- if (addon._repositoryAddon) {
- for (let size in addon._repositoryAddon.icons) {
- icons[size] = addon._repositoryAddon.icons[size];
- }
- }
-
- if (addon.icons) {
- for (let size in addon.icons) {
- icons[size] = this.getResourceURI(addon.icons[size]).spec;
- }
- } else {
- // legacy add-on that did not update its icon data yet
- if (this.hasResource("icon.png")) {
- icons[32] = icons[48] = this.getResourceURI("icon.png").spec;
- }
- if (this.hasResource("icon64.png")) {
- icons[64] = this.getResourceURI("icon64.png").spec;
- }
- }
-
- if (this.isActive && addon.iconURL) {
- icons[32] = addon.iconURL;
- icons[48] = addon.iconURL;
- }
-
- if (this.isActive && addon.icon64URL) {
- icons[64] = addon.icon64URL;
- }
-
- Object.freeze(icons);
- return icons;
- },
-
- get screenshots() {
- let addon = addonFor(this);
- let repositoryAddon = addon._repositoryAddon;
- if (repositoryAddon && ("screenshots" in repositoryAddon)) {
- let repositoryScreenshots = repositoryAddon.screenshots;
- if (repositoryScreenshots && repositoryScreenshots.length > 0)
- return repositoryScreenshots;
- }
-
- if (addon.type == "theme" && this.hasResource("preview.png")) {
- let url = this.getResourceURI("preview.png").spec;
- return [new AddonManagerPrivate.AddonScreenshot(url)];
- }
-
- return null;
- },
-
- get applyBackgroundUpdates() {
- return addonFor(this).applyBackgroundUpdates;
- },
- set applyBackgroundUpdates(val) {
- let addon = addonFor(this);
- if (this.type == "experiment") {
- logger.warn("Setting applyBackgroundUpdates on an experiment is not supported.");
- return addon.applyBackgroundUpdates;
- }
-
- if (val != AddonManager.AUTOUPDATE_DEFAULT &&
- val != AddonManager.AUTOUPDATE_DISABLE &&
- val != AddonManager.AUTOUPDATE_ENABLE) {
- val = val ? AddonManager.AUTOUPDATE_DEFAULT :
- AddonManager.AUTOUPDATE_DISABLE;
- }
-
- if (val == addon.applyBackgroundUpdates)
- return val;
-
- XPIDatabase.setAddonProperties(addon, {
- applyBackgroundUpdates: val
- });
- AddonManagerPrivate.callAddonListeners("onPropertyChanged", this, ["applyBackgroundUpdates"]);
-
- return val;
- },
-
- set syncGUID(val) {
- let addon = addonFor(this);
- if (addon.syncGUID == val)
- return val;
-
- if (addon.inDatabase)
- XPIDatabase.setAddonSyncGUID(addon, val);
-
- addon.syncGUID = val;
-
- return val;
- },
-
- get install() {
- let addon = addonFor(this);
- if (!("_install" in addon) || !addon._install)
- return null;
- return addon._install.wrapper;
- },
-
- get pendingUpgrade() {
- let addon = addonFor(this);
- return addon.pendingUpgrade ? addon.pendingUpgrade.wrapper : null;
- },
-
- get scope() {
- let addon = addonFor(this);
- if (addon._installLocation)
- return addon._installLocation.scope;
-
- return AddonManager.SCOPE_PROFILE;
- },
-
- get pendingOperations() {
- let addon = addonFor(this);
- let pending = 0;
- if (!(addon.inDatabase)) {
- // Add-on is pending install if there is no associated install (shouldn't
- // happen here) or if the install is in the process of or has successfully
- // completed the install. If an add-on is pending install then we ignore
- // any other pending operations.
- if (!addon._install || addon._install.state == AddonManager.STATE_INSTALLING ||
- addon._install.state == AddonManager.STATE_INSTALLED)
- return AddonManager.PENDING_INSTALL;
- }
- else if (addon.pendingUninstall) {
- // If an add-on is pending uninstall then we ignore any other pending
- // operations
- return AddonManager.PENDING_UNINSTALL;
- }
-
- if (addon.active && addon.disabled)
- pending |= AddonManager.PENDING_DISABLE;
- else if (!addon.active && !addon.disabled)
- pending |= AddonManager.PENDING_ENABLE;
-
- if (addon.pendingUpgrade)
- pending |= AddonManager.PENDING_UPGRADE;
-
- return pending;
- },
-
- get operationsRequiringRestart() {
- let addon = addonFor(this);
- let ops = 0;
- if (XPIProvider.installRequiresRestart(addon))
- ops |= AddonManager.OP_NEEDS_RESTART_INSTALL;
- if (XPIProvider.uninstallRequiresRestart(addon))
- ops |= AddonManager.OP_NEEDS_RESTART_UNINSTALL;
- if (XPIProvider.enableRequiresRestart(addon))
- ops |= AddonManager.OP_NEEDS_RESTART_ENABLE;
- if (XPIProvider.disableRequiresRestart(addon))
- ops |= AddonManager.OP_NEEDS_RESTART_DISABLE;
-
- return ops;
- },
-
- get isDebuggable() {
- return this.isActive && addonFor(this).bootstrap;
- },
-
- get permissions() {
- return addonFor(this).permissions();
- },
-
- get isActive() {
- let addon = addonFor(this);
- if (!addon.active)
- return false;
- if (!Services.appinfo.inSafeMode)
- return true;
- return addon.bootstrap && canRunInSafeMode(addon);
- },
-
- get userDisabled() {
- let addon = addonFor(this);
- return addon.softDisabled || addon.userDisabled;
- },
- set userDisabled(val) {
- let addon = addonFor(this);
- if (val == this.userDisabled) {
- return val;
- }
-
- if (addon.inDatabase) {
- if (addon.type == "theme" && val) {
- if (addon.internalName == XPIProvider.defaultSkin)
- throw new Error("Cannot disable the default theme");
- XPIProvider.enableDefaultTheme();
- }
- else {
- // hidden and system add-ons should not be user disasbled,
- // as there is no UI to re-enable them.
- if (this.hidden) {
- throw new Error(`Cannot disable hidden add-on ${addon.id}`);
- }
- XPIProvider.updateAddonDisabledState(addon, val);
- }
- }
- else {
- addon.userDisabled = val;
- // When enabling remove the softDisabled flag
- if (!val)
- addon.softDisabled = false;
- }
-
- return val;
- },
-
- set softDisabled(val) {
- let addon = addonFor(this);
- if (val == addon.softDisabled)
- return val;
-
- if (addon.inDatabase) {
- // When softDisabling a theme just enable the active theme
- if (addon.type == "theme" && val && !addon.userDisabled) {
- if (addon.internalName == XPIProvider.defaultSkin)
- throw new Error("Cannot disable the default theme");
- XPIProvider.enableDefaultTheme();
- }
- else {
- XPIProvider.updateAddonDisabledState(addon, undefined, val);
- }
- }
- else if (!addon.userDisabled) {
- // Only set softDisabled if not already disabled
- addon.softDisabled = val;
- }
-
- return val;
- },
-
- get hidden() {
- let addon = addonFor(this);
- if (addon._installLocation.name == KEY_APP_TEMPORARY)
- return false;
-
- return (addon._installLocation.name == KEY_APP_SYSTEM_DEFAULTS ||
- addon._installLocation.name == KEY_APP_SYSTEM_ADDONS);
- },
-
- get isSystem() {
- let addon = addonFor(this);
- return (addon._installLocation.name == KEY_APP_SYSTEM_DEFAULTS ||
- addon._installLocation.name == KEY_APP_SYSTEM_ADDONS);
- },
-
- // Returns true if Firefox Sync should sync this addon. Only non-hotfixes
- // directly in the profile are considered syncable.
- get isSyncable() {
- let addon = addonFor(this);
- let hotfixID = Preferences.get(PREF_EM_HOTFIX_ID, undefined);
- if (hotfixID && hotfixID == addon.id) {
- return false;
- }
- return (addon._installLocation.name == KEY_APP_PROFILE);
- },
-
- isCompatibleWith: function(aAppVersion, aPlatformVersion) {
- return addonFor(this).isCompatibleWith(aAppVersion, aPlatformVersion);
- },
-
- uninstall: function(alwaysAllowUndo) {
- let addon = addonFor(this);
- XPIProvider.uninstallAddon(addon, alwaysAllowUndo);
- },
-
- cancelUninstall: function() {
- let addon = addonFor(this);
- XPIProvider.cancelUninstallAddon(addon);
- },
-
- findUpdates: function(aListener, aReason, aAppVersion, aPlatformVersion) {
- // Short-circuit updates for experiments because updates are handled
- // through the Experiments Manager.
- if (this.type == "experiment") {
- AddonManagerPrivate.callNoUpdateListeners(this, aListener, aReason,
- aAppVersion, aPlatformVersion);
- return;
- }
-
- new UpdateChecker(addonFor(this), aListener, aReason, aAppVersion, aPlatformVersion);
- },
-
- // Returns true if there was an update in progress, false if there was no update to cancel
- cancelUpdate: function() {
- let addon = addonFor(this);
- if (addon._updateCheck) {
- addon._updateCheck.cancel();
- return true;
- }
- return false;
- },
-
- hasResource: function(aPath) {
- let addon = addonFor(this);
- if (addon._hasResourceCache.has(aPath))
- return addon._hasResourceCache.get(aPath);
-
- let bundle = addon._sourceBundle.clone();
-
- // Bundle may not exist any more if the addon has just been uninstalled,
- // but explicitly first checking .exists() results in unneeded file I/O.
- try {
- var isDir = bundle.isDirectory();
- } catch (e) {
- addon._hasResourceCache.set(aPath, false);
- return false;
- }
-
- if (isDir) {
- if (aPath)
- aPath.split("/").forEach(part => bundle.append(part));
- let result = bundle.exists();
- addon._hasResourceCache.set(aPath, result);
- return result;
- }
-
- let zipReader = Cc["@mozilla.org/libjar/zip-reader;1"].
- createInstance(Ci.nsIZipReader);
- try {
- zipReader.open(bundle);
- let result = zipReader.hasEntry(aPath);
- addon._hasResourceCache.set(aPath, result);
- return result;
- }
- catch (e) {
- addon._hasResourceCache.set(aPath, false);
- return false;
- }
- finally {
- zipReader.close();
- }
- },
-
- /**
- * Reloads the add-on.
- *
- * For temporarily installed add-ons, this uninstalls and re-installs the
- * add-on. Otherwise, the addon is disabled and then re-enabled, and the cache
- * is flushed.
- *
- * @return Promise
- */
- reload: function() {
- return new Promise((resolve) => {
- const addon = addonFor(this);
-
- logger.debug(`reloading add-on ${addon.id}`);
-
- if (!this.temporarilyInstalled) {
- let addonFile = addon.getResourceURI;
- XPIProvider.updateAddonDisabledState(addon, true);
- Services.obs.notifyObservers(addonFile, "flush-cache-entry", null);
- XPIProvider.updateAddonDisabledState(addon, false)
- resolve();
- } else {
- // This function supports re-installing an existing add-on.
- resolve(AddonManager.installTemporaryAddon(addon._sourceBundle));
- }
- });
- },
-
- /**
- * Returns a URI to the selected resource or to the add-on bundle if aPath
- * is null. URIs to the bundle will always be file: URIs. URIs to resources
- * will be file: URIs if the add-on is unpacked or jar: URIs if the add-on is
- * still an XPI file.
- *
- * @param aPath
- * The path in the add-on to get the URI for or null to get a URI to
- * the file or directory the add-on is installed as.
- * @return an nsIURI
- */
- getResourceURI: function(aPath) {
- let addon = addonFor(this);
- if (!aPath)
- return NetUtil.newURI(addon._sourceBundle);
-
- return getURIForResourceInFile(addon._sourceBundle, aPath);
- }
-};
-
-/**
- * The PrivateWrapper is used to expose certain functionality only when being
- * called with the add-on instanceID, disallowing other add-ons to access it.
- */
-function PrivateWrapper(aAddon) {
- AddonWrapper.call(this, aAddon);
-}
-
-PrivateWrapper.prototype = Object.create(AddonWrapper.prototype);
-Object.assign(PrivateWrapper.prototype, {
- addonId() {
- return this.id;
- },
-
- /**
- * Retrieves the preferred global context to be used from the
- * add-on debugging window.
- *
- * @returns global
- * The object set as global context. Must be a window object.
- */
- getDebugGlobal(global) {
- let activeAddon = XPIProvider.activeAddons.get(this.id);
- if (activeAddon) {
- return activeAddon.debugGlobal;
- }
-
- return null;
- },
-
- /**
- * Defines a global context to be used in the console
- * of the add-on debugging window.
- *
- * @param global
- * The object to set as global context. Must be a window object.
- */
- setDebugGlobal(global) {
- if (!global) {
- // If the new global is null, notify the listeners regardless
- // from the current state of the addon.
- // NOTE: this happen after the addon has been disabled and
- // the global will never be set to null otherwise.
- AddonManagerPrivate.callAddonListeners("onPropertyChanged",
- addonFor(this),
- ["debugGlobal"]);
- } else {
- let activeAddon = XPIProvider.activeAddons.get(this.id);
- if (activeAddon) {
- let globalChanged = activeAddon.debugGlobal != global;
- activeAddon.debugGlobal = global;
-
- if (globalChanged) {
- AddonManagerPrivate.callAddonListeners("onPropertyChanged",
- addonFor(this),
- ["debugGlobal"]);
- }
- }
- }
- }
-});
-
-function chooseValue(aAddon, aObj, aProp) {
- let repositoryAddon = aAddon._repositoryAddon;
- let objValue = aObj[aProp];
-
- if (repositoryAddon && (aProp in repositoryAddon) &&
- (objValue === undefined || objValue === null)) {
- return [repositoryAddon[aProp], true];
- }
-
- return [objValue, false];
-}
-
-function defineAddonWrapperProperty(name, getter) {
- Object.defineProperty(AddonWrapper.prototype, name, {
- get: getter,
- enumerable: true,
- });
-}
-
-["id", "syncGUID", "version", "isCompatible", "isPlatformCompatible",
- "providesUpdatesSecurely", "blocklistState", "blocklistURL", "appDisabled",
- "softDisabled", "skinnable", "size", "foreignInstall", "hasBinaryComponents",
- "strictCompatibility", "compatibilityOverrides", "updateURL", "dependencies",
- "getDataDirectory", "multiprocessCompatible", "signedState", "mpcOptedOut",
- "isCorrectlySigned"].forEach(function(aProp) {
- defineAddonWrapperProperty(aProp, function() {
- let addon = addonFor(this);
- return (aProp in addon) ? addon[aProp] : undefined;
- });
-});
-
-["fullDescription", "developerComments", "eula", "supportURL",
- "contributionURL", "contributionAmount", "averageRating", "reviewCount",
- "reviewURL", "totalDownloads", "weeklyDownloads", "dailyUsers",
- "repositoryStatus"].forEach(function(aProp) {
- defineAddonWrapperProperty(aProp, function() {
- let addon = addonFor(this);
- if (addon._repositoryAddon)
- return addon._repositoryAddon[aProp];
-
- return null;
- });
-});
-
-["installDate", "updateDate"].forEach(function(aProp) {
- defineAddonWrapperProperty(aProp, function() {
- return new Date(addonFor(this)[aProp]);
- });
-});
-
-["sourceURI", "releaseNotesURI"].forEach(function(aProp) {
- defineAddonWrapperProperty(aProp, function() {
- let addon = addonFor(this);
-
- // Temporary Installed Addons do not have a "sourceURI",
- // But we can use the "_sourceBundle" as an alternative,
- // which points to the path of the addon xpi installed
- // or its source dir (if it has been installed from a
- // directory).
- if (aProp == "sourceURI" && this.temporarilyInstalled) {
- return Services.io.newFileURI(addon._sourceBundle);
- }
-
- let [target, fromRepo] = chooseValue(addon, addon, aProp);
- if (!target)
- return null;
- if (fromRepo)
- return target;
- return NetUtil.newURI(target);
- });
-});
-
-PROP_LOCALE_SINGLE.forEach(function(aProp) {
- defineAddonWrapperProperty(aProp, function() {
- let addon = addonFor(this);
- // Override XPI creator if repository creator is defined
- if (aProp == "creator" &&
- addon._repositoryAddon && addon._repositoryAddon.creator) {
- return addon._repositoryAddon.creator;
- }
-
- let result = null;
-
- if (addon.active) {
- try {
- let pref = PREF_EM_EXTENSION_FORMAT + addon.id + "." + aProp;
- let value = Preferences.get(pref, null, Ci.nsIPrefLocalizedString);
- if (value)
- result = value;
- }
- catch (e) {
- }
- }
-
- let rest;
- if (result == null)
- [result, ...rest] = chooseValue(addon, addon.selectedLocale, aProp);
-
- if (aProp == "creator")
- return result ? new AddonManagerPrivate.AddonAuthor(result) : null;
-
- if (aProp == "name")
- return result ? result : addon.defaultLocale.name;
-
- return result;
- });
-});
-
-PROP_LOCALE_MULTI.forEach(function(aProp) {
- defineAddonWrapperProperty(aProp, function() {
- let addon = addonFor(this);
- let results = null;
- let usedRepository = false;
-
- if (addon.active) {
- let pref = PREF_EM_EXTENSION_FORMAT + addon.id + "." +
- aProp.substring(0, aProp.length - 1);
- let list = Services.prefs.getChildList(pref, {});
- if (list.length > 0) {
- list.sort();
- results = [];
- for (let childPref of list) {
- let value = Preferences.get(childPref, null, Ci.nsIPrefLocalizedString);
- if (value)
- results.push(value);
- }
- }
- }
-
- if (results == null)
- [results, usedRepository] = chooseValue(addon, addon.selectedLocale, aProp);
-
- if (results && !usedRepository) {
- results = results.map(function(aResult) {
- return new AddonManagerPrivate.AddonAuthor(aResult);
- });
- }
-
- return results;
- });
-});
-
-/**
- * An object which identifies a directory install location for add-ons. The
- * location consists of a directory which contains the add-ons installed in the
- * location.
- *
- * Each add-on installed in the location is either a directory containing the
- * add-on's files or a text file containing an absolute path to the directory
- * containing the add-ons files. The directory or text file must have the same
- * name as the add-on's ID.
- *
- * @param aName
- * The string identifier for the install location
- * @param aDirectory
- * The nsIFile directory for the install location
- * @param aScope
- * The scope of add-ons installed in this location
- */
-function DirectoryInstallLocation(aName, aDirectory, aScope) {
- this._name = aName;
- this.locked = true;
- this._directory = aDirectory;
- this._scope = aScope
- this._IDToFileMap = {};
- this._linkedAddons = [];
-
- if (!aDirectory || !aDirectory.exists())
- return;
- if (!aDirectory.isDirectory())
- throw new Error("Location must be a directory.");
-
- this._readAddons();
-}
-
-DirectoryInstallLocation.prototype = {
- _name : "",
- _directory : null,
- _IDToFileMap : null, // mapping from add-on ID to nsIFile
-
- /**
- * Reads a directory linked to in a file.
- *
- * @param file
- * The file containing the directory path
- * @return An nsIFile object representing the linked directory.
- */
- _readDirectoryFromFile: function(aFile) {
- let linkedDirectory;
- if (aFile.isSymlink()) {
- linkedDirectory = aFile.clone();
- try {
- linkedDirectory.normalize();
- } catch (e) {
- logger.warn("Symbolic link " + aFile.path + " points to a path" +
- " which does not exist");
- return null;
- }
- }
- else {
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fis.init(aFile, -1, -1, false);
- let line = { value: "" };
- if (fis instanceof Ci.nsILineInputStream)
- fis.readLine(line);
- fis.close();
- if (line.value) {
- linkedDirectory = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsIFile);
-
- try {
- linkedDirectory.initWithPath(line.value);
- }
- catch (e) {
- linkedDirectory.setRelativeDescriptor(aFile.parent, line.value);
- }
- }
- }
-
- if (linkedDirectory) {
- if (!linkedDirectory.exists()) {
- logger.warn("File pointer " + aFile.path + " points to " + linkedDirectory.path +
- " which does not exist");
- return null;
- }
-
- if (!linkedDirectory.isDirectory()) {
- logger.warn("File pointer " + aFile.path + " points to " + linkedDirectory.path +
- " which is not a directory");
- return null;
- }
-
- return linkedDirectory;
- }
-
- logger.warn("File pointer " + aFile.path + " does not contain a path");
- return null;
- },
-
- /**
- * Finds all the add-ons installed in this location.
- */
- _readAddons: function() {
- // Use a snapshot of the directory contents to avoid possible issues with
- // iterating over a directory while removing files from it (the YAFFS2
- // embedded filesystem has this issue, see bug 772238).
- let entries = getDirectoryEntries(this._directory);
- for (let entry of entries) {
- let id = entry.leafName;
-
- if (id == DIR_STAGE || id == DIR_TRASH)
- continue;
-
- let directLoad = false;
- if (entry.isFile() &&
- id.substring(id.length - 4).toLowerCase() == ".xpi") {
- directLoad = true;
- id = id.substring(0, id.length - 4);
- }
-
- if (!gIDTest.test(id)) {
- logger.debug("Ignoring file entry whose name is not a valid add-on ID: " +
- entry.path);
- continue;
- }
-
- if (!directLoad && (entry.isFile() || entry.isSymlink())) {
- let newEntry = this._readDirectoryFromFile(entry);
- if (!newEntry) {
- logger.debug("Deleting stale pointer file " + entry.path);
- try {
- entry.remove(true);
- }
- catch (e) {
- logger.warn("Failed to remove stale pointer file " + entry.path, e);
- // Failing to remove the stale pointer file is ignorable
- }
- continue;
- }
-
- entry = newEntry;
- this._linkedAddons.push(id);
- }
-
- this._IDToFileMap[id] = entry;
- XPIProvider._addURIMapping(id, entry);
- }
- },
-
- /**
- * Gets the name of this install location.
- */
- get name() {
- return this._name;
- },
-
- /**
- * Gets the scope of this install location.
- */
- get scope() {
- return this._scope;
- },
-
- /**
- * Gets an array of nsIFiles for add-ons installed in this location.
- */
- getAddonLocations: function() {
- let locations = new Map();
- for (let id in this._IDToFileMap) {
- locations.set(id, this._IDToFileMap[id].clone());
- }
- return locations;
- },
-
- /**
- * Gets the directory that the add-on with the given ID is installed in.
- *
- * @param aId
- * The ID of the add-on
- * @return The nsIFile
- * @throws if the ID does not match any of the add-ons installed
- */
- getLocationForID: function(aId) {
- if (aId in this._IDToFileMap)
- return this._IDToFileMap[aId].clone();
- throw new Error("Unknown add-on ID " + aId);
- },
-
- /**
- * Returns true if the given addon was installed in this location by a text
- * file pointing to its real path.
- *
- * @param aId
- * The ID of the addon
- */
- isLinkedAddon: function(aId) {
- return this._linkedAddons.indexOf(aId) != -1;
- }
-};
-
-/**
- * An extension of DirectoryInstallLocation which adds methods to installing
- * and removing add-ons from the directory at runtime.
- *
- * @param aName
- * The string identifier for the install location
- * @param aDirectory
- * The nsIFile directory for the install location
- * @param aScope
- * The scope of add-ons installed in this location
- */
-function MutableDirectoryInstallLocation(aName, aDirectory, aScope) {
- DirectoryInstallLocation.call(this, aName, aDirectory, aScope);
- this.locked = false;
- this._stagingDirLock = 0;
-}
-
-MutableDirectoryInstallLocation.prototype = Object.create(DirectoryInstallLocation.prototype);
-Object.assign(MutableDirectoryInstallLocation.prototype, {
- /**
- * Gets the staging directory to put add-ons that are pending install and
- * uninstall into.
- *
- * @return an nsIFile
- */
- getStagingDir: function() {
- let dir = this._directory.clone();
- dir.append(DIR_STAGE);
- return dir;
- },
-
- requestStagingDir: function() {
- this._stagingDirLock++;
-
- if (this._stagingDirPromise)
- return this._stagingDirPromise;
-
- OS.File.makeDir(this._directory.path);
- let stagepath = OS.Path.join(this._directory.path, DIR_STAGE);
- return this._stagingDirPromise = OS.File.makeDir(stagepath).then(null, (e) => {
- if (e instanceof OS.File.Error && e.becauseExists)
- return;
- logger.error("Failed to create staging directory", e);
- throw e;
- });
- },
-
- releaseStagingDir: function() {
- this._stagingDirLock--;
-
- if (this._stagingDirLock == 0) {
- this._stagingDirPromise = null;
- this.cleanStagingDir();
- }
-
- return Promise.resolve();
- },
-
- /**
- * Removes the specified files or directories in the staging directory and
- * then if the staging directory is empty attempts to remove it.
- *
- * @param aLeafNames
- * An array of file or directory to remove from the directory, the
- * array may be empty
- */
- cleanStagingDir: function(aLeafNames = []) {
- let dir = this.getStagingDir();
-
- for (let name of aLeafNames) {
- let file = dir.clone();
- file.append(name);
- recursiveRemove(file);
- }
-
- if (this._stagingDirLock > 0)
- return;
-
- let dirEntries = dir.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
- try {
- if (dirEntries.nextFile)
- return;
- }
- finally {
- dirEntries.close();
- }
-
- try {
- setFilePermissions(dir, FileUtils.PERMS_DIRECTORY);
- dir.remove(false);
- }
- catch (e) {
- logger.warn("Failed to remove staging dir", e);
- // Failing to remove the staging directory is ignorable
- }
- },
-
- /**
- * Returns a directory that is normally on the same filesystem as the rest of
- * the install location and can be used for temporarily storing files during
- * safe move operations. Calling this method will delete the existing trash
- * directory and its contents.
- *
- * @return an nsIFile
- */
- getTrashDir: function() {
- let trashDir = this._directory.clone();
- trashDir.append(DIR_TRASH);
- let trashDirExists = trashDir.exists();
- try {
- if (trashDirExists)
- recursiveRemove(trashDir);
- trashDirExists = false;
- } catch (e) {
- logger.warn("Failed to remove trash directory", e);
- }
- if (!trashDirExists)
- trashDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
- return trashDir;
- },
-
- /**
- * Installs an add-on into the install location.
- *
- * @param id
- * The ID of the add-on to install
- * @param source
- * The source nsIFile to install from
- * @param existingAddonID
- * The ID of an existing add-on to uninstall at the same time
- * @param action
- * What to we do with the given source file:
- * "move"
- * Default action, the source files will be moved to the new
- * location,
- * "copy"
- * The source files will be copied,
- * "proxy"
- * A "proxy file" is going to refer to the source file path
- * @return an nsIFile indicating where the add-on was installed to
- */
- installAddon: function({ id, source, existingAddonID, action = "move" }) {
- let trashDir = this.getTrashDir();
-
- let transaction = new SafeInstallOperation();
-
- let moveOldAddon = aId => {
- let file = this._directory.clone();
- file.append(aId);
-
- if (file.exists())
- transaction.moveUnder(file, trashDir);
-
- file = this._directory.clone();
- file.append(aId + ".xpi");
- if (file.exists()) {
- flushJarCache(file);
- transaction.moveUnder(file, trashDir);
- }
- }
-
- // If any of these operations fails the finally block will clean up the
- // temporary directory
- try {
- moveOldAddon(id);
- if (existingAddonID && existingAddonID != id) {
- moveOldAddon(existingAddonID);
-
- {
- // Move the data directories.
- /* XXX ajvincent We can't use OS.File: installAddon isn't compatible
- * with Promises, nor is SafeInstallOperation. Bug 945540 has been filed
- * for porting to OS.File.
- */
- let oldDataDir = FileUtils.getDir(
- KEY_PROFILEDIR, ["extension-data", existingAddonID], false, true
- );
-
- if (oldDataDir.exists()) {
- let newDataDir = FileUtils.getDir(
- KEY_PROFILEDIR, ["extension-data", id], false, true
- );
- if (newDataDir.exists()) {
- let trashData = trashDir.clone();
- trashData.append("data-directory");
- transaction.moveUnder(newDataDir, trashData);
- }
-
- transaction.moveTo(oldDataDir, newDataDir);
- }
- }
- }
-
- if (action == "copy") {
- transaction.copy(source, this._directory);
- }
- else if (action == "move") {
- if (source.isFile())
- flushJarCache(source);
-
- transaction.moveUnder(source, this._directory);
- }
- // Do nothing for the proxy file as we sideload an addon permanently
- }
- finally {
- // It isn't ideal if this cleanup fails but it isn't worth rolling back
- // the install because of it.
- try {
- recursiveRemove(trashDir);
- }
- catch (e) {
- logger.warn("Failed to remove trash directory when installing " + id, e);
- }
- }
-
- let newFile = this._directory.clone();
-
- if (action == "proxy") {
- // When permanently installing sideloaded addon, we just put a proxy file
- // refering to the addon sources
- newFile.append(id);
-
- writeStringToFile(newFile, source.path);
- } else {
- newFile.append(source.leafName);
- }
-
- try {
- newFile.lastModifiedTime = Date.now();
- } catch (e) {
- logger.warn("failed to set lastModifiedTime on " + newFile.path, e);
- }
- this._IDToFileMap[id] = newFile;
- XPIProvider._addURIMapping(id, newFile);
-
- if (existingAddonID && existingAddonID != id &&
- existingAddonID in this._IDToFileMap) {
- delete this._IDToFileMap[existingAddonID];
- }
-
- return newFile;
- },
-
- /**
- * Uninstalls an add-on from this location.
- *
- * @param aId
- * The ID of the add-on to uninstall
- * @throws if the ID does not match any of the add-ons installed
- */
- uninstallAddon: function(aId) {
- let file = this._IDToFileMap[aId];
- if (!file) {
- logger.warn("Attempted to remove " + aId + " from " +
- this._name + " but it was already gone");
- return;
- }
-
- file = this._directory.clone();
- file.append(aId);
- if (!file.exists())
- file.leafName += ".xpi";
-
- if (!file.exists()) {
- logger.warn("Attempted to remove " + aId + " from " +
- this._name + " but it was already gone");
-
- delete this._IDToFileMap[aId];
- return;
- }
-
- let trashDir = this.getTrashDir();
-
- if (file.leafName != aId) {
- logger.debug("uninstallAddon: flushing jar cache " + file.path + " for addon " + aId);
- flushJarCache(file);
- }
-
- let transaction = new SafeInstallOperation();
-
- try {
- transaction.moveUnder(file, trashDir);
- }
- finally {
- // It isn't ideal if this cleanup fails, but it is probably better than
- // rolling back the uninstall at this point
- try {
- recursiveRemove(trashDir);
- }
- catch (e) {
- logger.warn("Failed to remove trash directory when uninstalling " + aId, e);
- }
- }
-
- delete this._IDToFileMap[aId];
- },
-});
-
-/**
- * An object which identifies a directory install location for system add-ons
- * upgrades.
- *
- * The location consists of a directory which contains the add-ons installed.
- *
- * @param aName
- * The string identifier for the install location
- * @param aDirectory
- * The nsIFile directory for the install location
- * @param aScope
- * The scope of add-ons installed in this location
- * @param aResetSet
- * True to throw away the current add-on set
- */
-function SystemAddonInstallLocation(aName, aDirectory, aScope, aResetSet) {
- this._baseDir = aDirectory;
- this._nextDir = null;
-
- this._stagingDirLock = 0;
-
- if (aResetSet)
- this.resetAddonSet();
-
- this._addonSet = this._loadAddonSet();
-
- this._directory = null;
- if (this._addonSet.directory) {
- this._directory = aDirectory.clone();
- this._directory.append(this._addonSet.directory);
- logger.info("SystemAddonInstallLocation scanning directory " + this._directory.path);
- }
- else {
- logger.info("SystemAddonInstallLocation directory is missing");
- }
-
- DirectoryInstallLocation.call(this, aName, this._directory, aScope);
- this.locked = false;
-}
-
-SystemAddonInstallLocation.prototype = Object.create(DirectoryInstallLocation.prototype);
-Object.assign(SystemAddonInstallLocation.prototype, {
- /**
- * Removes the specified files or directories in the staging directory and
- * then if the staging directory is empty attempts to remove it.
- *
- * @param aLeafNames
- * An array of file or directory to remove from the directory, the
- * array may be empty
- */
- cleanStagingDir: function(aLeafNames = []) {
- let dir = this.getStagingDir();
-
- for (let name of aLeafNames) {
- let file = dir.clone();
- file.append(name);
- recursiveRemove(file);
- }
-
- if (this._stagingDirLock > 0)
- return;
-
- let dirEntries = dir.directoryEntries.QueryInterface(Ci.nsIDirectoryEnumerator);
- try {
- if (dirEntries.nextFile)
- return;
- }
- finally {
- dirEntries.close();
- }
-
- try {
- setFilePermissions(dir, FileUtils.PERMS_DIRECTORY);
- dir.remove(false);
- }
- catch (e) {
- logger.warn("Failed to remove staging dir", e);
- // Failing to remove the staging directory is ignorable
- }
- },
-
- /**
- * Gets the staging directory to put add-ons that are pending install and
- * uninstall into.
- *
- * @return {nsIFile} - staging directory for system add-on upgrades.
- */
- getStagingDir: function() {
- this._addonSet = this._loadAddonSet();
- let dir = null;
- if (this._addonSet.directory) {
- this._directory = this._baseDir.clone();
- this._directory.append(this._addonSet.directory);
- dir = this._directory.clone();
- dir.append(DIR_STAGE);
- }
- else {
- logger.info("SystemAddonInstallLocation directory is missing");
- }
-
- return dir;
- },
-
- requestStagingDir: function() {
- this._stagingDirLock++;
- if (this._stagingDirPromise)
- return this._stagingDirPromise;
-
- this._addonSet = this._loadAddonSet();
- if (this._addonSet.directory) {
- this._directory = this._baseDir.clone();
- this._directory.append(this._addonSet.directory);
- }
-
- OS.File.makeDir(this._directory.path);
- let stagepath = OS.Path.join(this._directory.path, DIR_STAGE);
- return this._stagingDirPromise = OS.File.makeDir(stagepath).then(null, (e) => {
- if (e instanceof OS.File.Error && e.becauseExists)
- return;
- logger.error("Failed to create staging directory", e);
- throw e;
- });
- },
-
- releaseStagingDir: function() {
- this._stagingDirLock--;
-
- if (this._stagingDirLock == 0) {
- this._stagingDirPromise = null;
- this.cleanStagingDir();
- }
-
- return Promise.resolve();
- },
-
- /**
- * Reads the current set of system add-ons
- */
- _loadAddonSet: function() {
- try {
- let setStr = Preferences.get(PREF_SYSTEM_ADDON_SET, null);
- if (setStr) {
- let addonSet = JSON.parse(setStr);
- if ((typeof addonSet == "object") && addonSet.schema == 1)
- return addonSet;
- }
- }
- catch (e) {
- logger.error("Malformed system add-on set, resetting.");
- }
-
- return { schema: 1, addons: {} };
- },
-
- /**
- * Saves the current set of system add-ons
- *
- * @param {Object} aAddonSet - object containing schema, directory and set
- * of system add-on IDs and versions.
- */
- _saveAddonSet: function(aAddonSet) {
- Preferences.set(PREF_SYSTEM_ADDON_SET, JSON.stringify(aAddonSet));
- },
-
- getAddonLocations: function() {
- // Updated system add-ons are ignored in safe mode
- if (Services.appinfo.inSafeMode)
- return new Map();
-
- let addons = DirectoryInstallLocation.prototype.getAddonLocations.call(this);
-
- // Strip out any unexpected add-ons from the list
- for (let id of addons.keys()) {
- if (!(id in this._addonSet.addons))
- addons.delete(id);
- }
-
- return addons;
- },
-
- /**
- * Tests whether updated system add-ons are expected.
- */
- isActive: function() {
- return this._directory != null;
- },
-
- isValidAddon: function(aAddon) {
- if (aAddon.appDisabled) {
- logger.warn(`System add-on ${aAddon.id} isn't compatible with the application.`);
- return false;
- }
-
- if (aAddon.unpack) {
- logger.warn(`System add-on ${aAddon.id} isn't a packed add-on.`);
- return false;
- }
-
- if (!aAddon.bootstrap) {
- logger.warn(`System add-on ${aAddon.id} isn't restartless.`);
- return false;
- }
-
- if (!aAddon.multiprocessCompatible) {
- logger.warn(`System add-on ${aAddon.id} isn't multiprocess compatible.`);
- return false;
- }
-
- return true;
- },
-
- /**
- * Tests whether the loaded add-on information matches what is expected.
- */
- isValid: function(aAddons) {
- for (let id of Object.keys(this._addonSet.addons)) {
- if (!aAddons.has(id)) {
- logger.warn(`Expected add-on ${id} is missing from the system add-on location.`);
- return false;
- }
-
- let addon = aAddons.get(id);
- if (addon.version != this._addonSet.addons[id].version) {
- logger.warn(`Expected system add-on ${id} to be version ${this._addonSet.addons[id].version} but was ${addon.version}.`);
- return false;
- }
-
- if (!this.isValidAddon(addon))
- return false;
- }
-
- return true;
- },
-
- /**
- * Resets the add-on set so on the next startup the default set will be used.
- */
- resetAddonSet: function() {
-
- if (this._addonSet) {
- logger.info("Removing all system add-on upgrades.");
-
- // remove everything from the pref first, if uninstall
- // fails then at least they will not be re-activated on
- // next restart.
- this._saveAddonSet({ schema: 1, addons: {} });
-
- for (let id of Object.keys(this._addonSet.addons)) {
- AddonManager.getAddonByID(id, addon => {
- if (addon) {
- addon.uninstall();
- }
- });
- }
- }
- },
-
- /**
- * Removes any directories not currently in use or pending use after a
- * restart. Any errors that happen here don't really matter as we'll attempt
- * to cleanup again next time.
- */
- cleanDirectories: Task.async(function*() {
-
- // System add-ons directory does not exist
- if (!(yield OS.File.exists(this._baseDir.path))) {
- return;
- }
-
- let iterator;
- try {
- iterator = new OS.File.DirectoryIterator(this._baseDir.path);
- }
- catch (e) {
- logger.error("Failed to clean updated system add-ons directories.", e);
- return;
- }
-
- try {
- let entries = [];
-
- yield iterator.forEach(entry => {
- // Skip the directory currently in use
- if (this._directory && this._directory.path == entry.path)
- return;
-
- // Skip the next directory
- if (this._nextDir && this._nextDir.path == entry.path)
- return;
-
- entries.push(entry);
- });
-
- for (let entry of entries) {
- if (entry.isDir) {
- yield OS.File.removeDir(entry.path, {
- ignoreAbsent: true,
- ignorePermissions: true,
- });
- }
- else {
- yield OS.File.remove(entry.path, {
- ignoreAbsent: true,
- });
- }
- }
- }
- catch (e) {
- logger.error("Failed to clean updated system add-ons directories.", e);
- }
- finally {
- iterator.close();
- }
- }),
-
- /**
- * Installs a new set of system add-ons into the location and updates the
- * add-on set in prefs.
- *
- * @param {Array} aAddons - An array of addons to install.
- */
- installAddonSet: Task.async(function*(aAddons) {
- // Make sure the base dir exists
- yield OS.File.makeDir(this._baseDir.path, { ignoreExisting: true });
-
- let addonSet = this._loadAddonSet();
-
- // Remove any add-ons that are no longer part of the set.
- for (let addonID of Object.keys(addonSet.addons)) {
- if (!aAddons.includes(addonID)) {
- AddonManager.getAddonByID(addonID, a => a.uninstall());
- }
- }
-
- let newDir = this._baseDir.clone();
-
- let uuidGen = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- newDir.append("blank");
-
- while (true) {
- newDir.leafName = uuidGen.generateUUID().toString();
-
- try {
- yield OS.File.makeDir(newDir.path, { ignoreExisting: false });
- break;
- }
- catch (e) {
- logger.debug("Could not create new system add-on updates dir, retrying", e);
- }
- }
-
- // Record the new upgrade directory.
- let state = { schema: 1, directory: newDir.leafName, addons: {} };
- this._saveAddonSet(state);
-
- this._nextDir = newDir;
- let location = this;
-
- let installs = [];
- for (let addon of aAddons) {
- let install = yield createLocalInstall(addon._sourceBundle, location);
- installs.push(install);
- }
-
- let installAddon = Task.async(function*(install) {
- // Make the new install own its temporary file.
- install.ownsTempFile = true;
- install.install();
- });
-
- let postponeAddon = Task.async(function*(install) {
- let resumeFn;
- if (AddonManagerPrivate.hasUpgradeListener(install.addon.id)) {
- logger.info(`system add-on ${install.addon.id} has an upgrade listener, postponing upgrade set until restart`);
- resumeFn = () => {
- logger.info(`${install.addon.id} has resumed a previously postponed addon set`);
- install.installLocation.resumeAddonSet(installs);
- }
- }
- yield install.postpone(resumeFn);
- });
-
- let previousState;
-
- try {
- // All add-ons in position, create the new state and store it in prefs
- state = { schema: 1, directory: newDir.leafName, addons: {} };
- for (let addon of aAddons) {
- state.addons[addon.id] = {
- version: addon.version
- }
- }
-
- previousState = this._loadAddonSet();
- this._saveAddonSet(state);
-
- let blockers = aAddons.filter(
- addon => AddonManagerPrivate.hasUpgradeListener(addon.id)
- );
-
- if (blockers.length > 0) {
- yield waitForAllPromises(installs.map(postponeAddon));
- } else {
- yield waitForAllPromises(installs.map(installAddon));
- }
- }
- catch (e) {
- // Roll back to previous upgrade set (if present) on restart.
- if (previousState) {
- this._saveAddonSet(previousState);
- }
- // Otherwise, roll back to built-in set on restart.
- // TODO try to do these restartlessly
- this.resetAddonSet();
-
- try {
- yield OS.File.removeDir(newDir.path, { ignorePermissions: true });
- }
- catch (e) {
- logger.warn(`Failed to remove failed system add-on directory ${newDir.path}.`, e);
- }
- throw e;
- }
- }),
-
- /**
- * Resumes upgrade of a previously-delayed add-on set.
- */
- resumeAddonSet: Task.async(function*(installs) {
- let resumeAddon = Task.async(function*(install) {
- install.state = AddonManager.STATE_DOWNLOADED;
- install.installLocation.releaseStagingDir();
- install.install();
- });
-
- let addonSet = this._loadAddonSet();
- let addonIDs = Object.keys(addonSet.addons);
-
- let blockers = installs.filter(
- install => AddonManagerPrivate.hasUpgradeListener(install.addon.id)
- );
-
- if (blockers.length > 1) {
- logger.warn("Attempted to resume system add-on install but upgrade blockers are still present");
- } else {
- yield waitForAllPromises(installs.map(resumeAddon));
- }
- }),
-
- /**
- * Returns a directory that is normally on the same filesystem as the rest of
- * the install location and can be used for temporarily storing files during
- * safe move operations. Calling this method will delete the existing trash
- * directory and its contents.
- *
- * @return an nsIFile
- */
- getTrashDir: function() {
- let trashDir = this._directory.clone();
- trashDir.append(DIR_TRASH);
- let trashDirExists = trashDir.exists();
- try {
- if (trashDirExists)
- recursiveRemove(trashDir);
- trashDirExists = false;
- } catch (e) {
- logger.warn("Failed to remove trash directory", e);
- }
- if (!trashDirExists)
- trashDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-
- return trashDir;
- },
-
- /**
- * Installs an add-on into the install location.
- *
- * @param id
- * The ID of the add-on to install
- * @param source
- * The source nsIFile to install from
- * @return an nsIFile indicating where the add-on was installed to
- */
- installAddon: function({id, source}) {
- let trashDir = this.getTrashDir();
- let transaction = new SafeInstallOperation();
-
- // If any of these operations fails the finally block will clean up the
- // temporary directory
- try {
- if (source.isFile()) {
- flushJarCache(source);
- }
-
- transaction.moveUnder(source, this._directory);
- }
- finally {
- // It isn't ideal if this cleanup fails but it isn't worth rolling back
- // the install because of it.
- try {
- recursiveRemove(trashDir);
- }
- catch (e) {
- logger.warn("Failed to remove trash directory when installing " + id, e);
- }
- }
-
- let newFile = this._directory.clone();
- newFile.append(source.leafName);
-
- try {
- newFile.lastModifiedTime = Date.now();
- } catch (e) {
- logger.warn("failed to set lastModifiedTime on " + newFile.path, e);
- }
- this._IDToFileMap[id] = newFile;
- XPIProvider._addURIMapping(id, newFile);
-
- return newFile;
- },
-
- // old system add-on upgrade dirs get automatically removed
- uninstallAddon: (aAddon) => {},
-});
-
-/**
- * An object which identifies an install location for temporary add-ons.
- */
-const TemporaryInstallLocation = {
- locked: false,
- name: KEY_APP_TEMPORARY,
- scope: AddonManager.SCOPE_TEMPORARY,
- getAddonLocations: () => [],
- isLinkedAddon: () => false,
- installAddon: () => {},
- uninstallAddon: (aAddon) => {},
- getStagingDir: () => {},
-}
-
-/**
- * An object that identifies a registry install location for add-ons. The location
- * consists of a registry key which contains string values mapping ID to the
- * path where an add-on is installed
- *
- * @param aName
- * The string identifier of this Install Location.
- * @param aRootKey
- * The root key (one of the ROOT_KEY_ values from nsIWindowsRegKey).
- * @param scope
- * The scope of add-ons installed in this location
- */
-function WinRegInstallLocation(aName, aRootKey, aScope) {
- this.locked = true;
- this._name = aName;
- this._rootKey = aRootKey;
- this._scope = aScope;
- this._IDToFileMap = {};
-
- let path = this._appKeyPath + "\\Extensions";
- let key = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
-
- // Reading the registry may throw an exception, and that's ok. In error
- // cases, we just leave ourselves in the empty state.
- try {
- key.open(this._rootKey, path, Ci.nsIWindowsRegKey.ACCESS_READ);
- }
- catch (e) {
- return;
- }
-
- this._readAddons(key);
- key.close();
-}
-
-WinRegInstallLocation.prototype = {
- _name : "",
- _rootKey : null,
- _scope : null,
- _IDToFileMap : null, // mapping from ID to nsIFile
-
- /**
- * Retrieves the path of this Application's data key in the registry.
- */
- get _appKeyPath() {
- let appVendor = Services.appinfo.vendor;
- let appName = Services.appinfo.name;
-
- // XXX Thunderbird doesn't specify a vendor string
- if (AppConstants.MOZ_APP_NAME == "thunderbird" && appVendor == "")
- appVendor = "Mozilla";
-
- // XULRunner-based apps may intentionally not specify a vendor
- if (appVendor != "")
- appVendor += "\\";
-
- return "SOFTWARE\\" + appVendor + appName;
- },
-
- /**
- * Read the registry and build a mapping between ID and path for each
- * installed add-on.
- *
- * @param key
- * The key that contains the ID to path mapping
- */
- _readAddons: function(aKey) {
- let count = aKey.valueCount;
- for (let i = 0; i < count; ++i) {
- let id = aKey.getValueName(i);
-
- let file = new nsIFile(aKey.readStringValue(id));
-
- if (!file.exists()) {
- logger.warn("Ignoring missing add-on in " + file.path);
- continue;
- }
-
- this._IDToFileMap[id] = file;
- XPIProvider._addURIMapping(id, file);
- }
- },
-
- /**
- * Gets the name of this install location.
- */
- get name() {
- return this._name;
- },
-
- /**
- * Gets the scope of this install location.
- */
- get scope() {
- return this._scope;
- },
-
- /**
- * Gets an array of nsIFiles for add-ons installed in this location.
- */
- getAddonLocations: function() {
- let locations = new Map();
- for (let id in this._IDToFileMap) {
- locations.set(id, this._IDToFileMap[id].clone());
- }
- return locations;
- },
-
- /**
- * @see DirectoryInstallLocation
- */
- isLinkedAddon: function(aId) {
- return true;
- }
-};
-
-var addonTypes = [
- new AddonManagerPrivate.AddonType("extension", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 4000,
- AddonManager.TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL),
- new AddonManagerPrivate.AddonType("theme", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 5000),
- new AddonManagerPrivate.AddonType("dictionary", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 7000,
- AddonManager.TYPE_UI_HIDE_EMPTY | AddonManager.TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL),
- new AddonManagerPrivate.AddonType("locale", URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 8000,
- AddonManager.TYPE_UI_HIDE_EMPTY | AddonManager.TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL),
-];
-
-// We only register experiments support if the application supports them.
-// Ideally, we would install an observer to watch the pref. Installing
-// an observer for this pref is not necessary here and may be buggy with
-// regards to registering this XPIProvider twice.
-if (Preferences.get("experiments.supported", false)) {
- addonTypes.push(
- new AddonManagerPrivate.AddonType("experiment",
- URI_EXTENSION_STRINGS,
- STRING_TYPE_NAME,
- AddonManager.VIEW_TYPE_LIST, 11000,
- AddonManager.TYPE_UI_HIDE_EMPTY | AddonManager.TYPE_SUPPORTS_UNDO_RESTARTLESS_UNINSTALL));
-}
-
-AddonManagerPrivate.registerProvider(XPIProvider, addonTypes);
diff --git a/toolkit/mozapps/webextensions/internal/XPIProviderUtils.js b/toolkit/mozapps/webextensions/internal/XPIProviderUtils.js
deleted file mode 100644
index 63ff6d8c85..0000000000
--- a/toolkit/mozapps/webextensions/internal/XPIProviderUtils.js
+++ /dev/null
@@ -1,2239 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-// These are injected from XPIProvider.jsm
-/* globals ADDON_SIGNING, SIGNED_TYPES, BOOTSTRAP_REASONS, DB_SCHEMA,
- AddonInternal, XPIProvider, XPIStates, syncLoadManifestFromFile,
- isUsableAddon, recordAddonTelemetry, applyBlocklistChanges,
- flushChromeCaches, canRunInSafeMode*/
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AddonManager.jsm");
-/* globals AddonManagerPrivate*/
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository",
- "resource://gre/modules/addons/AddonRepository.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "DeferredSave",
- "resource://gre/modules/DeferredSave.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyServiceGetter(this, "Blocklist",
- "@mozilla.org/extensions/blocklist;1",
- Ci.nsIBlocklistService);
-
-Cu.import("resource://gre/modules/Log.jsm");
-const LOGGER_ID = "addons.xpi-utils";
-
-const nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile");
-
-// Create a new logger for use by the Addons XPI Provider Utils
-// (Requires AddonManager.jsm)
-var logger = Log.repository.getLogger(LOGGER_ID);
-
-const KEY_PROFILEDIR = "ProfD";
-const FILE_DATABASE = "extensions.sqlite";
-const FILE_JSON_DB = "extensions.json";
-const FILE_OLD_DATABASE = "extensions.rdf";
-const FILE_XPI_ADDONS_LIST = "extensions.ini";
-
-// The last version of DB_SCHEMA implemented in SQLITE
-const LAST_SQLITE_DB_SCHEMA = 14;
-const PREF_DB_SCHEMA = "extensions.databaseSchema";
-const PREF_PENDING_OPERATIONS = "extensions.pendingOperations";
-const PREF_EM_ENABLED_ADDONS = "extensions.enabledAddons";
-const PREF_EM_DSS_ENABLED = "extensions.dss.enabled";
-const PREF_EM_AUTO_DISABLED_SCOPES = "extensions.autoDisableScopes";
-const PREF_E10S_BLOCKED_BY_ADDONS = "extensions.e10sBlockedByAddons";
-const PREF_E10S_HAS_NONEXEMPT_ADDON = "extensions.e10s.rollout.hasAddon";
-
-const KEY_APP_PROFILE = "app-profile";
-const KEY_APP_SYSTEM_ADDONS = "app-system-addons";
-const KEY_APP_SYSTEM_DEFAULTS = "app-system-defaults";
-const KEY_APP_GLOBAL = "app-global";
-
-// Properties that only exist in the database
-const DB_METADATA = ["syncGUID",
- "installDate",
- "updateDate",
- "size",
- "sourceURI",
- "releaseNotesURI",
- "applyBackgroundUpdates"];
-const DB_BOOL_METADATA = ["visible", "active", "userDisabled", "appDisabled",
- "pendingUninstall", "bootstrap", "skinnable",
- "softDisabled", "isForeignInstall",
- "hasBinaryComponents", "strictCompatibility"];
-
-// Properties to save in JSON file
-const PROP_JSON_FIELDS = ["id", "syncGUID", "location", "version", "type",
- "internalName", "updateURL", "updateKey", "optionsURL",
- "optionsType", "aboutURL", "icons", "iconURL", "icon64URL",
- "defaultLocale", "visible", "active", "userDisabled",
- "appDisabled", "pendingUninstall", "descriptor", "installDate",
- "updateDate", "applyBackgroundUpdates", "bootstrap",
- "skinnable", "size", "sourceURI", "releaseNotesURI",
- "softDisabled", "foreignInstall", "hasBinaryComponents",
- "strictCompatibility", "locales", "targetApplications",
- "targetPlatforms", "multiprocessCompatible", "signedState",
- "seen", "dependencies", "hasEmbeddedWebExtension", "mpcOptedOut"];
-
-// Properties that should be migrated where possible from an old database. These
-// shouldn't include properties that can be read directly from install.rdf files
-// or calculated
-const DB_MIGRATE_METADATA= ["installDate", "userDisabled", "softDisabled",
- "sourceURI", "applyBackgroundUpdates",
- "releaseNotesURI", "foreignInstall", "syncGUID"];
-
-// Time to wait before async save of XPI JSON database, in milliseconds
-const ASYNC_SAVE_DELAY_MS = 20;
-
-const PREFIX_ITEM_URI = "urn:mozilla:item:";
-const RDFURI_ITEM_ROOT = "urn:mozilla:item:root"
-const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
-
-XPCOMUtils.defineLazyServiceGetter(this, "gRDF", "@mozilla.org/rdf/rdf-service;1",
- Ci.nsIRDFService);
-
-function EM_R(aProperty) {
- return gRDF.GetResource(PREFIX_NS_EM + aProperty);
-}
-
-/**
- * Converts an RDF literal, resource or integer into a string.
- *
- * @param aLiteral
- * The RDF object to convert
- * @return a string if the object could be converted or null
- */
-function getRDFValue(aLiteral) {
- if (aLiteral instanceof Ci.nsIRDFLiteral)
- return aLiteral.Value;
- if (aLiteral instanceof Ci.nsIRDFResource)
- return aLiteral.Value;
- if (aLiteral instanceof Ci.nsIRDFInt)
- return aLiteral.Value;
- return null;
-}
-
-/**
- * Gets an RDF property as a string
- *
- * @param aDs
- * The RDF datasource to read the property from
- * @param aResource
- * The RDF resource to read the property from
- * @param aProperty
- * The property to read
- * @return a string if the property existed or null
- */
-function getRDFProperty(aDs, aResource, aProperty) {
- return getRDFValue(aDs.GetTarget(aResource, EM_R(aProperty), true));
-}
-
-/**
- * Asynchronously fill in the _repositoryAddon field for one addon
- */
-function getRepositoryAddon(aAddon, aCallback) {
- if (!aAddon) {
- aCallback(aAddon);
- return;
- }
- function completeAddon(aRepositoryAddon) {
- aAddon._repositoryAddon = aRepositoryAddon;
- aAddon.compatibilityOverrides = aRepositoryAddon ?
- aRepositoryAddon.compatibilityOverrides :
- null;
- aCallback(aAddon);
- }
- AddonRepository.getCachedAddonByID(aAddon.id, completeAddon);
-}
-
-/**
- * Wrap an API-supplied function in an exception handler to make it safe to call
- */
-function makeSafe(aCallback) {
- return function(...aArgs) {
- try {
- aCallback(...aArgs);
- }
- catch (ex) {
- logger.warn("XPI Database callback failed", ex);
- }
- }
-}
-
-/**
- * A helper method to asynchronously call a function on an array
- * of objects, calling a callback when function(x) has been gathered
- * for every element of the array.
- * WARNING: not currently error-safe; if the async function does not call
- * our internal callback for any of the array elements, asyncMap will not
- * call the callback parameter.
- *
- * @param aObjects
- * The array of objects to process asynchronously
- * @param aMethod
- * Function with signature function(object, function(f_of_object))
- * @param aCallback
- * Function with signature f([aMethod(object)]), called when all values
- * are available
- */
-function asyncMap(aObjects, aMethod, aCallback) {
- var resultsPending = aObjects.length;
- var results = []
- if (resultsPending == 0) {
- aCallback(results);
- return;
- }
-
- function asyncMap_gotValue(aIndex, aValue) {
- results[aIndex] = aValue;
- if (--resultsPending == 0) {
- aCallback(results);
- }
- }
-
- aObjects.map(function(aObject, aIndex, aArray) {
- try {
- aMethod(aObject, function(aResult) {
- asyncMap_gotValue(aIndex, aResult);
- });
- }
- catch (e) {
- logger.warn("Async map function failed", e);
- asyncMap_gotValue(aIndex, undefined);
- }
- });
-}
-
-/**
- * A generator to synchronously return result rows from an mozIStorageStatement.
- *
- * @param aStatement
- * The statement to execute
- */
-function* resultRows(aStatement) {
- try {
- while (stepStatement(aStatement))
- yield aStatement.row;
- }
- finally {
- aStatement.reset();
- }
-}
-
-/**
- * A helper function to log an SQL error.
- *
- * @param aError
- * The storage error code associated with the error
- * @param aErrorString
- * An error message
- */
-function logSQLError(aError, aErrorString) {
- logger.error("SQL error " + aError + ": " + aErrorString);
-}
-
-/**
- * A helper function to log any errors that occur during async statements.
- *
- * @param aError
- * A mozIStorageError to log
- */
-function asyncErrorLogger(aError) {
- logSQLError(aError.result, aError.message);
-}
-
-/**
- * A helper function to step a statement synchronously and log any error that
- * occurs.
- *
- * @param aStatement
- * A mozIStorageStatement to execute
- */
-function stepStatement(aStatement) {
- try {
- return aStatement.executeStep();
- }
- catch (e) {
- logSQLError(XPIDatabase.connection.lastError,
- XPIDatabase.connection.lastErrorString);
- throw e;
- }
-}
-
-/**
- * Copies properties from one object to another. If no target object is passed
- * a new object will be created and returned.
- *
- * @param aObject
- * An object to copy from
- * @param aProperties
- * An array of properties to be copied
- * @param aTarget
- * An optional target object to copy the properties to
- * @return the object that the properties were copied onto
- */
-function copyProperties(aObject, aProperties, aTarget) {
- if (!aTarget)
- aTarget = {};
- aProperties.forEach(function(aProp) {
- if (aProp in aObject)
- aTarget[aProp] = aObject[aProp];
- });
- return aTarget;
-}
-
-/**
- * Copies properties from a mozIStorageRow to an object. If no target object is
- * passed a new object will be created and returned.
- *
- * @param aRow
- * A mozIStorageRow to copy from
- * @param aProperties
- * An array of properties to be copied
- * @param aTarget
- * An optional target object to copy the properties to
- * @return the object that the properties were copied onto
- */
-function copyRowProperties(aRow, aProperties, aTarget) {
- if (!aTarget)
- aTarget = {};
- aProperties.forEach(function(aProp) {
- aTarget[aProp] = aRow.getResultByName(aProp);
- });
- return aTarget;
-}
-
-/**
- * The DBAddonInternal is a special AddonInternal that has been retrieved from
- * the database. The constructor will initialize the DBAddonInternal with a set
- * of fields, which could come from either the JSON store or as an
- * XPIProvider.AddonInternal created from an addon's manifest
- * @constructor
- * @param aLoaded
- * Addon data fields loaded from JSON or the addon manifest.
- */
-function DBAddonInternal(aLoaded) {
- AddonInternal.call(this);
-
- copyProperties(aLoaded, PROP_JSON_FIELDS, this);
-
- if (!this.dependencies)
- this.dependencies = [];
- Object.freeze(this.dependencies);
-
- if (aLoaded._installLocation) {
- this._installLocation = aLoaded._installLocation;
- this.location = aLoaded._installLocation.name;
- }
- else if (aLoaded.location) {
- this._installLocation = XPIProvider.installLocationsByName[this.location];
- }
-
- this._key = this.location + ":" + this.id;
-
- if (!aLoaded._sourceBundle) {
- throw new Error("Expected passed argument to contain a descriptor");
- }
-
- this._sourceBundle = aLoaded._sourceBundle;
-
- XPCOMUtils.defineLazyGetter(this, "pendingUpgrade", function() {
- for (let install of XPIProvider.installs) {
- if (install.state == AddonManager.STATE_INSTALLED &&
- !(install.addon.inDatabase) &&
- install.addon.id == this.id &&
- install.installLocation == this._installLocation) {
- delete this.pendingUpgrade;
- return this.pendingUpgrade = install.addon;
- }
- }
- return null;
- });
-}
-
-DBAddonInternal.prototype = Object.create(AddonInternal.prototype);
-Object.assign(DBAddonInternal.prototype, {
- applyCompatibilityUpdate: function(aUpdate, aSyncCompatibility) {
- let wasCompatible = this.isCompatible;
-
- this.targetApplications.forEach(function(aTargetApp) {
- aUpdate.targetApplications.forEach(function(aUpdateTarget) {
- if (aTargetApp.id == aUpdateTarget.id && (aSyncCompatibility ||
- Services.vc.compare(aTargetApp.maxVersion, aUpdateTarget.maxVersion) < 0)) {
- aTargetApp.minVersion = aUpdateTarget.minVersion;
- aTargetApp.maxVersion = aUpdateTarget.maxVersion;
- XPIDatabase.saveChanges();
- }
- });
- });
- if (aUpdate.multiprocessCompatible !== undefined &&
- aUpdate.multiprocessCompatible != this.multiprocessCompatible) {
- this.multiprocessCompatible = aUpdate.multiprocessCompatible;
- XPIDatabase.saveChanges();
- }
-
- if (wasCompatible != this.isCompatible)
- XPIProvider.updateAddonDisabledState(this);
- },
-
- toJSON: function() {
- let jsonData = copyProperties(this, PROP_JSON_FIELDS);
-
- // Experiments are serialized as disabled so they aren't run on the next
- // startup.
- if (this.type == "experiment") {
- jsonData.userDisabled = true;
- jsonData.active = false;
- }
-
- return jsonData;
- },
-
- get inDatabase() {
- return true;
- }
-});
-
-/**
- * Internal interface: find an addon from an already loaded addonDB
- */
-function _findAddon(addonDB, aFilter) {
- for (let addon of addonDB.values()) {
- if (aFilter(addon)) {
- return addon;
- }
- }
- return null;
-}
-
-/**
- * Internal interface to get a filtered list of addons from a loaded addonDB
- */
-function _filterDB(addonDB, aFilter) {
- return Array.from(addonDB.values()).filter(aFilter);
-}
-
-this.XPIDatabase = {
- // true if the database connection has been opened
- initialized: false,
- // The database file
- jsonFile: FileUtils.getFile(KEY_PROFILEDIR, [FILE_JSON_DB], true),
- // Migration data loaded from an old version of the database.
- migrateData: null,
- // Active add-on directories loaded from extensions.ini and prefs at startup.
- activeBundles: null,
-
- // Saved error object if we fail to read an existing database
- _loadError: null,
-
- // Error reported by our most recent attempt to read or write the database, if any
- get lastError() {
- if (this._loadError)
- return this._loadError;
- if (this._deferredSave)
- return this._deferredSave.lastError;
- return null;
- },
-
- /**
- * Mark the current stored data dirty, and schedule a flush to disk
- */
- saveChanges: function() {
- if (!this.initialized) {
- throw new Error("Attempt to use XPI database when it is not initialized");
- }
-
- if (XPIProvider._closing) {
- // use an Error here so we get a stack trace.
- let err = new Error("XPI database modified after shutdown began");
- logger.warn(err);
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_late_stack", Log.stackTrace(err));
- }
-
- if (!this._deferredSave) {
- this._deferredSave = new DeferredSave(this.jsonFile.path,
- () => JSON.stringify(this),
- ASYNC_SAVE_DELAY_MS);
- }
-
- let promise = this._deferredSave.saveChanges();
- if (!this._schemaVersionSet) {
- this._schemaVersionSet = true;
- promise = promise.then(
- count => {
- // Update the XPIDB schema version preference the first time we successfully
- // save the database.
- logger.debug("XPI Database saved, setting schema version preference to " + DB_SCHEMA);
- Services.prefs.setIntPref(PREF_DB_SCHEMA, DB_SCHEMA);
- // Reading the DB worked once, so we don't need the load error
- this._loadError = null;
- },
- error => {
- // Need to try setting the schema version again later
- this._schemaVersionSet = false;
- // this._deferredSave.lastError has the most recent error so we don't
- // need this any more
- this._loadError = null;
-
- throw error;
- });
- }
-
- promise.catch(error => {
- logger.warn("Failed to save XPI database", error);
- });
- },
-
- flush: function() {
- // handle the "in memory only" and "saveChanges never called" cases
- if (!this._deferredSave) {
- return Promise.resolve(0);
- }
-
- return this._deferredSave.flush();
- },
-
- /**
- * Converts the current internal state of the XPI addon database to
- * a JSON.stringify()-ready structure
- */
- toJSON: function() {
- if (!this.addonDB) {
- // We never loaded the database?
- throw new Error("Attempt to save database without loading it first");
- }
-
- let toSave = {
- schemaVersion: DB_SCHEMA,
- addons: [...this.addonDB.values()]
- };
- return toSave;
- },
-
- /**
- * Pull upgrade information from an existing SQLITE database
- *
- * @return false if there is no SQLITE database
- * true and sets this.migrateData to null if the SQLITE DB exists
- * but does not contain useful information
- * true and sets this.migrateData to
- * {location: {id1:{addon1}, id2:{addon2}}, location2:{...}, ...}
- * if there is useful information
- */
- getMigrateDataFromSQLITE: function() {
- let connection = null;
- let dbfile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true);
- // Attempt to open the database
- try {
- connection = Services.storage.openUnsharedDatabase(dbfile);
- }
- catch (e) {
- logger.warn("Failed to open sqlite database " + dbfile.path + " for upgrade", e);
- return null;
- }
- logger.debug("Migrating data from sqlite");
- let migrateData = this.getMigrateDataFromDatabase(connection);
- connection.close();
- return migrateData;
- },
-
- /**
- * Synchronously opens and reads the database file, upgrading from old
- * databases or making a new DB if needed.
- *
- * The possibilities, in order of priority, are:
- * 1) Perfectly good, up to date database
- * 2) Out of date JSON database needs to be upgraded => upgrade
- * 3) JSON database exists but is mangled somehow => build new JSON
- * 4) no JSON DB, but a useable SQLITE db we can upgrade from => upgrade
- * 5) useless SQLITE DB => build new JSON
- * 6) useable RDF DB => upgrade
- * 7) useless RDF DB => build new JSON
- * 8) Nothing at all => build new JSON
- * @param aRebuildOnError
- * A boolean indicating whether add-on information should be loaded
- * from the install locations if the database needs to be rebuilt.
- * (if false, caller is XPIProvider.checkForChanges() which will rebuild)
- */
- syncLoadDB: function(aRebuildOnError) {
- this.migrateData = null;
- let fstream = null;
- let data = "";
- try {
- let readTimer = AddonManagerPrivate.simpleTimer("XPIDB_syncRead_MS");
- logger.debug("Opening XPI database " + this.jsonFile.path);
- fstream = Components.classes["@mozilla.org/network/file-input-stream;1"].
- createInstance(Components.interfaces.nsIFileInputStream);
- fstream.init(this.jsonFile, -1, 0, 0);
- let cstream = null;
- try {
- cstream = Components.classes["@mozilla.org/intl/converter-input-stream;1"].
- createInstance(Components.interfaces.nsIConverterInputStream);
- cstream.init(fstream, "UTF-8", 0, 0);
-
- let str = {};
- let read = 0;
- do {
- read = cstream.readString(0xffffffff, str); // read as much as we can and put it in str.value
- data += str.value;
- } while (read != 0);
-
- readTimer.done();
- this.parseDB(data, aRebuildOnError);
- }
- catch (e) {
- logger.error("Failed to load XPI JSON data from profile", e);
- let rebuildTimer = AddonManagerPrivate.simpleTimer("XPIDB_rebuildReadFailed_MS");
- this.rebuildDatabase(aRebuildOnError);
- rebuildTimer.done();
- }
- finally {
- if (cstream)
- cstream.close();
- }
- }
- catch (e) {
- if (e.result === Cr.NS_ERROR_FILE_NOT_FOUND) {
- this.upgradeDB(aRebuildOnError);
- }
- else {
- this.rebuildUnreadableDB(e, aRebuildOnError);
- }
- }
- finally {
- if (fstream)
- fstream.close();
- }
- // If an async load was also in progress, resolve that promise with our DB;
- // otherwise create a resolved promise
- if (this._dbPromise) {
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_overlapped_load", 1);
- this._dbPromise.resolve(this.addonDB);
- }
- else
- this._dbPromise = Promise.resolve(this.addonDB);
- },
-
- /**
- * Parse loaded data, reconstructing the database if the loaded data is not valid
- * @param aRebuildOnError
- * If true, synchronously reconstruct the database from installed add-ons
- */
- parseDB: function(aData, aRebuildOnError) {
- let parseTimer = AddonManagerPrivate.simpleTimer("XPIDB_parseDB_MS");
- try {
- // dump("Loaded JSON:\n" + aData + "\n");
- let inputAddons = JSON.parse(aData);
- // Now do some sanity checks on our JSON db
- if (!("schemaVersion" in inputAddons) || !("addons" in inputAddons)) {
- parseTimer.done();
- // Content of JSON file is bad, need to rebuild from scratch
- logger.error("bad JSON file contents");
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startupError", "badJSON");
- let rebuildTimer = AddonManagerPrivate.simpleTimer("XPIDB_rebuildBadJSON_MS");
- this.rebuildDatabase(aRebuildOnError);
- rebuildTimer.done();
- return;
- }
- if (inputAddons.schemaVersion != DB_SCHEMA) {
- // Handle mismatched JSON schema version. For now, we assume
- // compatibility for JSON data, though we throw away any fields we
- // don't know about (bug 902956)
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startupError",
- "schemaMismatch-" + inputAddons.schemaVersion);
- logger.debug("JSON schema mismatch: expected " + DB_SCHEMA +
- ", actual " + inputAddons.schemaVersion);
- // When we rev the schema of the JSON database, we need to make sure we
- // force the DB to save so that the DB_SCHEMA value in the JSON file and
- // the preference are updated.
- }
- // If we got here, we probably have good data
- // Make AddonInternal instances from the loaded data and save them
- let addonDB = new Map();
- for (let loadedAddon of inputAddons.addons) {
- loadedAddon._sourceBundle = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- try {
- loadedAddon._sourceBundle.persistentDescriptor = loadedAddon.descriptor;
- }
- catch (e) {
- // We can fail here when the descriptor is invalid, usually from the
- // wrong OS
- logger.warn("Could not find source bundle for add-on " + loadedAddon.id, e);
- }
-
- let newAddon = new DBAddonInternal(loadedAddon);
- addonDB.set(newAddon._key, newAddon);
- }
- parseTimer.done();
- this.addonDB = addonDB;
- logger.debug("Successfully read XPI database");
- this.initialized = true;
- }
- catch (e) {
- // If we catch and log a SyntaxError from the JSON
- // parser, the xpcshell test harness fails the test for us: bug 870828
- parseTimer.done();
- if (e.name == "SyntaxError") {
- logger.error("Syntax error parsing saved XPI JSON data");
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startupError", "syntax");
- }
- else {
- logger.error("Failed to load XPI JSON data from profile", e);
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startupError", "other");
- }
- let rebuildTimer = AddonManagerPrivate.simpleTimer("XPIDB_rebuildReadFailed_MS");
- this.rebuildDatabase(aRebuildOnError);
- rebuildTimer.done();
- }
- },
-
- /**
- * Upgrade database from earlier (sqlite or RDF) version if available
- */
- upgradeDB: function(aRebuildOnError) {
- let upgradeTimer = AddonManagerPrivate.simpleTimer("XPIDB_upgradeDB_MS");
- try {
- let schemaVersion = Services.prefs.getIntPref(PREF_DB_SCHEMA);
- if (schemaVersion <= LAST_SQLITE_DB_SCHEMA) {
- // we should have an older SQLITE database
- logger.debug("Attempting to upgrade from SQLITE database");
- this.migrateData = this.getMigrateDataFromSQLITE();
- }
- else {
- // we've upgraded before but the JSON file is gone, fall through
- // and rebuild from scratch
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startupError", "dbMissing");
- }
- }
- catch (e) {
- // No schema version pref means either a really old upgrade (RDF) or
- // a new profile
- this.migrateData = this.getMigrateDataFromRDF();
- }
-
- this.rebuildDatabase(aRebuildOnError);
- upgradeTimer.done();
- },
-
- /**
- * Reconstruct when the DB file exists but is unreadable
- * (for example because read permission is denied)
- */
- rebuildUnreadableDB: function(aError, aRebuildOnError) {
- let rebuildTimer = AddonManagerPrivate.simpleTimer("XPIDB_rebuildUnreadableDB_MS");
- logger.warn("Extensions database " + this.jsonFile.path +
- " exists but is not readable; rebuilding", aError);
- // Remember the error message until we try and write at least once, so
- // we know at shutdown time that there was a problem
- this._loadError = aError;
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_startupError", "unreadable");
- this.rebuildDatabase(aRebuildOnError);
- rebuildTimer.done();
- },
-
- /**
- * Open and read the XPI database asynchronously, upgrading if
- * necessary. If any DB load operation fails, we need to
- * synchronously rebuild the DB from the installed extensions.
- *
- * @return Promise<Map> resolves to the Map of loaded JSON data stored
- * in this.addonDB; never rejects.
- */
- asyncLoadDB: function() {
- // Already started (and possibly finished) loading
- if (this._dbPromise) {
- return this._dbPromise;
- }
-
- logger.debug("Starting async load of XPI database " + this.jsonFile.path);
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_async_load", XPIProvider.runPhase);
- let readOptions = {
- outExecutionDuration: 0
- };
- return this._dbPromise = OS.File.read(this.jsonFile.path, null, readOptions).then(
- byteArray => {
- logger.debug("Async JSON file read took " + readOptions.outExecutionDuration + " MS");
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_asyncRead_MS",
- readOptions.outExecutionDuration);
- if (this._addonDB) {
- logger.debug("Synchronous load completed while waiting for async load");
- return this.addonDB;
- }
- logger.debug("Finished async read of XPI database, parsing...");
- let decodeTimer = AddonManagerPrivate.simpleTimer("XPIDB_decode_MS");
- let decoder = new TextDecoder();
- let data = decoder.decode(byteArray);
- decodeTimer.done();
- this.parseDB(data, true);
- return this.addonDB;
- })
- .then(null,
- error => {
- if (this._addonDB) {
- logger.debug("Synchronous load completed while waiting for async load");
- return this.addonDB;
- }
- if (error.becauseNoSuchFile) {
- this.upgradeDB(true);
- }
- else {
- // it's there but unreadable
- this.rebuildUnreadableDB(error, true);
- }
- return this.addonDB;
- });
- },
-
- /**
- * Rebuild the database from addon install directories. If this.migrateData
- * is available, uses migrated information for settings on the addons found
- * during rebuild
- * @param aRebuildOnError
- * A boolean indicating whether add-on information should be loaded
- * from the install locations if the database needs to be rebuilt.
- * (if false, caller is XPIProvider.checkForChanges() which will rebuild)
- */
- rebuildDatabase: function(aRebuildOnError) {
- this.addonDB = new Map();
- this.initialized = true;
-
- if (XPIStates.size == 0) {
- // No extensions installed, so we're done
- logger.debug("Rebuilding XPI database with no extensions");
- return;
- }
-
- // If there is no migration data then load the list of add-on directories
- // that were active during the last run
- if (!this.migrateData)
- this.activeBundles = this.getActiveBundles();
-
- if (aRebuildOnError) {
- logger.warn("Rebuilding add-ons database from installed extensions.");
- try {
- XPIDatabaseReconcile.processFileChanges({}, false);
- }
- catch (e) {
- logger.error("Failed to rebuild XPI database from installed extensions", e);
- }
- // Make sure to update the active add-ons and add-ons list on shutdown
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
- }
- },
-
- /**
- * Gets the list of file descriptors of active extension directories or XPI
- * files from the add-ons list. This must be loaded from disk since the
- * directory service gives no easy way to get both directly. This list doesn't
- * include themes as preferences already say which theme is currently active
- *
- * @return an array of persistent descriptors for the directories
- */
- getActiveBundles: function() {
- let bundles = [];
-
- // non-bootstrapped extensions
- let addonsList = FileUtils.getFile(KEY_PROFILEDIR, [FILE_XPI_ADDONS_LIST],
- true);
-
- if (!addonsList.exists())
- // XXX Irving believes this is broken in the case where there is no
- // extensions.ini but there are bootstrap extensions (e.g. Android)
- return null;
-
- try {
- let iniFactory = Cc["@mozilla.org/xpcom/ini-parser-factory;1"]
- .getService(Ci.nsIINIParserFactory);
- let parser = iniFactory.createINIParser(addonsList);
- let keys = parser.getKeys("ExtensionDirs");
-
- while (keys.hasMore())
- bundles.push(parser.getString("ExtensionDirs", keys.getNext()));
- }
- catch (e) {
- logger.warn("Failed to parse extensions.ini", e);
- return null;
- }
-
- // Also include the list of active bootstrapped extensions
- for (let id in XPIProvider.bootstrappedAddons)
- bundles.push(XPIProvider.bootstrappedAddons[id].descriptor);
-
- return bundles;
- },
-
- /**
- * Retrieves migration data from the old extensions.rdf database.
- *
- * @return an object holding information about what add-ons were previously
- * userDisabled and any updated compatibility information
- */
- getMigrateDataFromRDF: function(aDbWasMissing) {
-
- // Migrate data from extensions.rdf
- let rdffile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_OLD_DATABASE], true);
- if (!rdffile.exists())
- return null;
-
- logger.debug("Migrating data from " + FILE_OLD_DATABASE);
- let migrateData = {};
-
- try {
- let ds = gRDF.GetDataSourceBlocking(Services.io.newFileURI(rdffile).spec);
- let root = Cc["@mozilla.org/rdf/container;1"].
- createInstance(Ci.nsIRDFContainer);
- root.Init(ds, gRDF.GetResource(RDFURI_ITEM_ROOT));
- let elements = root.GetElements();
-
- while (elements.hasMoreElements()) {
- let source = elements.getNext().QueryInterface(Ci.nsIRDFResource);
-
- let location = getRDFProperty(ds, source, "installLocation");
- if (location) {
- if (!(location in migrateData))
- migrateData[location] = {};
- let id = source.ValueUTF8.substring(PREFIX_ITEM_URI.length);
- migrateData[location][id] = {
- version: getRDFProperty(ds, source, "version"),
- userDisabled: false,
- targetApplications: []
- }
-
- let disabled = getRDFProperty(ds, source, "userDisabled");
- if (disabled == "true" || disabled == "needs-disable")
- migrateData[location][id].userDisabled = true;
-
- let targetApps = ds.GetTargets(source, EM_R("targetApplication"),
- true);
- while (targetApps.hasMoreElements()) {
- let targetApp = targetApps.getNext()
- .QueryInterface(Ci.nsIRDFResource);
- let appInfo = {
- id: getRDFProperty(ds, targetApp, "id")
- };
-
- let minVersion = getRDFProperty(ds, targetApp, "updatedMinVersion");
- if (minVersion) {
- appInfo.minVersion = minVersion;
- appInfo.maxVersion = getRDFProperty(ds, targetApp, "updatedMaxVersion");
- }
- else {
- appInfo.minVersion = getRDFProperty(ds, targetApp, "minVersion");
- appInfo.maxVersion = getRDFProperty(ds, targetApp, "maxVersion");
- }
- migrateData[location][id].targetApplications.push(appInfo);
- }
- }
- }
- }
- catch (e) {
- logger.warn("Error reading " + FILE_OLD_DATABASE, e);
- migrateData = null;
- }
-
- return migrateData;
- },
-
- /**
- * Retrieves migration data from a database that has an older or newer schema.
- *
- * @return an object holding information about what add-ons were previously
- * userDisabled and any updated compatibility information
- */
- getMigrateDataFromDatabase: function(aConnection) {
- let migrateData = {};
-
- // Attempt to migrate data from a different (even future!) version of the
- // database
- try {
- var stmt = aConnection.createStatement("PRAGMA table_info(addon)");
-
- const REQUIRED = ["internal_id", "id", "location", "userDisabled",
- "installDate", "version"];
-
- let reqCount = 0;
- let props = [];
- for (let row of resultRows(stmt)) {
- if (REQUIRED.indexOf(row.name) != -1) {
- reqCount++;
- props.push(row.name);
- }
- else if (DB_METADATA.indexOf(row.name) != -1) {
- props.push(row.name);
- }
- else if (DB_BOOL_METADATA.indexOf(row.name) != -1) {
- props.push(row.name);
- }
- }
-
- if (reqCount < REQUIRED.length) {
- logger.error("Unable to read anything useful from the database");
- return null;
- }
- stmt.finalize();
-
- stmt = aConnection.createStatement("SELECT " + props.join(",") + " FROM addon");
- for (let row of resultRows(stmt)) {
- if (!(row.location in migrateData))
- migrateData[row.location] = {};
- let addonData = {
- targetApplications: []
- }
- migrateData[row.location][row.id] = addonData;
-
- props.forEach(function(aProp) {
- if (aProp == "isForeignInstall")
- addonData.foreignInstall = (row[aProp] == 1);
- if (DB_BOOL_METADATA.indexOf(aProp) != -1)
- addonData[aProp] = row[aProp] == 1;
- else
- addonData[aProp] = row[aProp];
- })
- }
-
- var taStmt = aConnection.createStatement("SELECT id, minVersion, " +
- "maxVersion FROM " +
- "targetApplication WHERE " +
- "addon_internal_id=:internal_id");
-
- for (let location in migrateData) {
- for (let id in migrateData[location]) {
- taStmt.params.internal_id = migrateData[location][id].internal_id;
- delete migrateData[location][id].internal_id;
- for (let row of resultRows(taStmt)) {
- migrateData[location][id].targetApplications.push({
- id: row.id,
- minVersion: row.minVersion,
- maxVersion: row.maxVersion
- });
- }
- }
- }
- }
- catch (e) {
- // An error here means the schema is too different to read
- logger.error("Error migrating data", e);
- return null;
- }
- finally {
- if (taStmt)
- taStmt.finalize();
- if (stmt)
- stmt.finalize();
- }
-
- return migrateData;
- },
-
- /**
- * Shuts down the database connection and releases all cached objects.
- * Return: Promise{integer} resolves / rejects with the result of the DB
- * flush after the database is flushed and
- * all cleanup is done
- */
- shutdown: function() {
- logger.debug("shutdown");
- if (this.initialized) {
- // If our last database I/O had an error, try one last time to save.
- if (this.lastError)
- this.saveChanges();
-
- this.initialized = false;
-
- if (this._deferredSave) {
- AddonManagerPrivate.recordSimpleMeasure(
- "XPIDB_saves_total", this._deferredSave.totalSaves);
- AddonManagerPrivate.recordSimpleMeasure(
- "XPIDB_saves_overlapped", this._deferredSave.overlappedSaves);
- AddonManagerPrivate.recordSimpleMeasure(
- "XPIDB_saves_late", this._deferredSave.dirty ? 1 : 0);
- }
-
- // Return a promise that any pending writes of the DB are complete and we
- // are finished cleaning up
- let flushPromise = this.flush();
- flushPromise.then(null, error => {
- logger.error("Flush of XPI database failed", error);
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_shutdownFlush_failed", 1);
- // If our last attempt to read or write the DB failed, force a new
- // extensions.ini to be written to disk on the next startup
- Services.prefs.setBoolPref(PREF_PENDING_OPERATIONS, true);
- })
- .then(count => {
- // Clear out the cached addons data loaded from JSON
- delete this.addonDB;
- delete this._dbPromise;
- // same for the deferred save
- delete this._deferredSave;
- // re-enable the schema version setter
- delete this._schemaVersionSet;
- });
- return flushPromise;
- }
- return Promise.resolve(0);
- },
-
- /**
- * Asynchronously list all addons that match the filter function
- * @param aFilter
- * Function that takes an addon instance and returns
- * true if that addon should be included in the selected array
- * @param aCallback
- * Called back with an array of addons matching aFilter
- * or an empty array if none match
- */
- getAddonList: function(aFilter, aCallback) {
- this.asyncLoadDB().then(
- addonDB => {
- let addonList = _filterDB(addonDB, aFilter);
- asyncMap(addonList, getRepositoryAddon, makeSafe(aCallback));
- })
- .then(null,
- error => {
- logger.error("getAddonList failed", error);
- makeSafe(aCallback)([]);
- });
- },
-
- /**
- * (Possibly asynchronously) get the first addon that matches the filter function
- * @param aFilter
- * Function that takes an addon instance and returns
- * true if that addon should be selected
- * @param aCallback
- * Called back with the addon, or null if no matching addon is found
- */
- getAddon: function(aFilter, aCallback) {
- return this.asyncLoadDB().then(
- addonDB => {
- getRepositoryAddon(_findAddon(addonDB, aFilter), makeSafe(aCallback));
- })
- .then(null,
- error => {
- logger.error("getAddon failed", error);
- makeSafe(aCallback)(null);
- });
- },
-
- /**
- * Asynchronously gets an add-on with a particular ID in a particular
- * install location.
- *
- * @param aId
- * The ID of the add-on to retrieve
- * @param aLocation
- * The name of the install location
- * @param aCallback
- * A callback to pass the DBAddonInternal to
- */
- getAddonInLocation: function(aId, aLocation, aCallback) {
- this.asyncLoadDB().then(
- addonDB => getRepositoryAddon(addonDB.get(aLocation + ":" + aId),
- makeSafe(aCallback)));
- },
-
- /**
- * Asynchronously get all the add-ons in a particular install location.
- *
- * @param aLocation
- * The name of the install location
- * @param aCallback
- * A callback to pass the array of DBAddonInternals to
- */
- getAddonsInLocation: function(aLocation, aCallback) {
- this.getAddonList(aAddon => aAddon._installLocation.name == aLocation, aCallback);
- },
-
- /**
- * Asynchronously gets the add-on with the specified ID that is visible.
- *
- * @param aId
- * The ID of the add-on to retrieve
- * @param aCallback
- * A callback to pass the DBAddonInternal to
- */
- getVisibleAddonForID: function(aId, aCallback) {
- this.getAddon(aAddon => ((aAddon.id == aId) && aAddon.visible),
- aCallback);
- },
-
- /**
- * Asynchronously gets the visible add-ons, optionally restricting by type.
- *
- * @param aTypes
- * An array of types to include or null to include all types
- * @param aCallback
- * A callback to pass the array of DBAddonInternals to
- */
- getVisibleAddons: function(aTypes, aCallback) {
- this.getAddonList(aAddon => (aAddon.visible &&
- (!aTypes || (aTypes.length == 0) ||
- (aTypes.indexOf(aAddon.type) > -1))),
- aCallback);
- },
-
- /**
- * Synchronously gets all add-ons of a particular type.
- *
- * @param aType
- * The type of add-on to retrieve
- * @return an array of DBAddonInternals
- */
- getAddonsByType: function(aType) {
- if (!this.addonDB) {
- // jank-tastic! Must synchronously load DB if the theme switches from
- // an XPI theme to a lightweight theme before the DB has loaded,
- // because we're called from sync XPIProvider.addonChanged
- logger.warn("Synchronous load of XPI database due to getAddonsByType(" + aType + ")");
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_lateOpen_byType", XPIProvider.runPhase);
- this.syncLoadDB(true);
- }
- return _filterDB(this.addonDB, aAddon => (aAddon.type == aType));
- },
-
- /**
- * Synchronously gets an add-on with a particular internalName.
- *
- * @param aInternalName
- * The internalName of the add-on to retrieve
- * @return a DBAddonInternal
- */
- getVisibleAddonForInternalName: function(aInternalName) {
- if (!this.addonDB) {
- // This may be called when the DB hasn't otherwise been loaded
- logger.warn("Synchronous load of XPI database due to getVisibleAddonForInternalName");
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_lateOpen_forInternalName",
- XPIProvider.runPhase);
- this.syncLoadDB(true);
- }
-
- return _findAddon(this.addonDB,
- aAddon => aAddon.visible &&
- (aAddon.internalName == aInternalName));
- },
-
- /**
- * Asynchronously gets all add-ons with pending operations.
- *
- * @param aTypes
- * The types of add-ons to retrieve or null to get all types
- * @param aCallback
- * A callback to pass the array of DBAddonInternal to
- */
- getVisibleAddonsWithPendingOperations: function(aTypes, aCallback) {
- this.getAddonList(
- aAddon => (aAddon.visible &&
- (aAddon.pendingUninstall ||
- // Logic here is tricky. If we're active but disabled,
- // we're pending disable; !active && !disabled, we're pending enable
- (aAddon.active == aAddon.disabled)) &&
- (!aTypes || (aTypes.length == 0) || (aTypes.indexOf(aAddon.type) > -1))),
- aCallback);
- },
-
- /**
- * Asynchronously get an add-on by its Sync GUID.
- *
- * @param aGUID
- * Sync GUID of add-on to fetch
- * @param aCallback
- * A callback to pass the DBAddonInternal record to. Receives null
- * if no add-on with that GUID is found.
- *
- */
- getAddonBySyncGUID: function(aGUID, aCallback) {
- this.getAddon(aAddon => aAddon.syncGUID == aGUID,
- aCallback);
- },
-
- /**
- * Synchronously gets all add-ons in the database.
- * This is only called from the preference observer for the default
- * compatibility version preference, so we can return an empty list if
- * we haven't loaded the database yet.
- *
- * @return an array of DBAddonInternals
- */
- getAddons: function() {
- if (!this.addonDB) {
- return [];
- }
- return _filterDB(this.addonDB, aAddon => true);
- },
-
- /**
- * Synchronously adds an AddonInternal's metadata to the database.
- *
- * @param aAddon
- * AddonInternal to add
- * @param aDescriptor
- * The file descriptor of the add-on
- * @return The DBAddonInternal that was added to the database
- */
- addAddonMetadata: function(aAddon, aDescriptor) {
- if (!this.addonDB) {
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_lateOpen_addMetadata",
- XPIProvider.runPhase);
- this.syncLoadDB(false);
- }
-
- let newAddon = new DBAddonInternal(aAddon);
- newAddon.descriptor = aDescriptor;
- this.addonDB.set(newAddon._key, newAddon);
- if (newAddon.visible) {
- this.makeAddonVisible(newAddon);
- }
-
- this.saveChanges();
- return newAddon;
- },
-
- /**
- * Synchronously updates an add-on's metadata in the database. Currently just
- * removes and recreates.
- *
- * @param aOldAddon
- * The DBAddonInternal to be replaced
- * @param aNewAddon
- * The new AddonInternal to add
- * @param aDescriptor
- * The file descriptor of the add-on
- * @return The DBAddonInternal that was added to the database
- */
- updateAddonMetadata: function(aOldAddon, aNewAddon, aDescriptor) {
- this.removeAddonMetadata(aOldAddon);
- aNewAddon.syncGUID = aOldAddon.syncGUID;
- aNewAddon.installDate = aOldAddon.installDate;
- aNewAddon.applyBackgroundUpdates = aOldAddon.applyBackgroundUpdates;
- aNewAddon.foreignInstall = aOldAddon.foreignInstall;
- aNewAddon.seen = aOldAddon.seen;
- aNewAddon.active = (aNewAddon.visible && !aNewAddon.disabled && !aNewAddon.pendingUninstall);
-
- // addAddonMetadata does a saveChanges()
- return this.addAddonMetadata(aNewAddon, aDescriptor);
- },
-
- /**
- * Synchronously removes an add-on from the database.
- *
- * @param aAddon
- * The DBAddonInternal being removed
- */
- removeAddonMetadata: function(aAddon) {
- this.addonDB.delete(aAddon._key);
- this.saveChanges();
- },
-
- /**
- * Synchronously marks a DBAddonInternal as visible marking all other
- * instances with the same ID as not visible.
- *
- * @param aAddon
- * The DBAddonInternal to make visible
- */
- makeAddonVisible: function(aAddon) {
- logger.debug("Make addon " + aAddon._key + " visible");
- for (let [, otherAddon] of this.addonDB) {
- if ((otherAddon.id == aAddon.id) && (otherAddon._key != aAddon._key)) {
- logger.debug("Hide addon " + otherAddon._key);
- otherAddon.visible = false;
- otherAddon.active = false;
- }
- }
- aAddon.visible = true;
- this.saveChanges();
- },
-
- /**
- * Synchronously sets properties for an add-on.
- *
- * @param aAddon
- * The DBAddonInternal being updated
- * @param aProperties
- * A dictionary of properties to set
- */
- setAddonProperties: function(aAddon, aProperties) {
- for (let key in aProperties) {
- aAddon[key] = aProperties[key];
- }
- this.saveChanges();
- },
-
- /**
- * Synchronously sets the Sync GUID for an add-on.
- * Only called when the database is already loaded.
- *
- * @param aAddon
- * The DBAddonInternal being updated
- * @param aGUID
- * GUID string to set the value to
- * @throws if another addon already has the specified GUID
- */
- setAddonSyncGUID: function(aAddon, aGUID) {
- // Need to make sure no other addon has this GUID
- function excludeSyncGUID(otherAddon) {
- return (otherAddon._key != aAddon._key) && (otherAddon.syncGUID == aGUID);
- }
- let otherAddon = _findAddon(this.addonDB, excludeSyncGUID);
- if (otherAddon) {
- throw new Error("Addon sync GUID conflict for addon " + aAddon._key +
- ": " + otherAddon._key + " already has GUID " + aGUID);
- }
- aAddon.syncGUID = aGUID;
- this.saveChanges();
- },
-
- /**
- * Synchronously updates an add-on's active flag in the database.
- *
- * @param aAddon
- * The DBAddonInternal to update
- */
- updateAddonActive: function(aAddon, aActive) {
- logger.debug("Updating active state for add-on " + aAddon.id + " to " + aActive);
-
- aAddon.active = aActive;
- this.saveChanges();
- },
-
- /**
- * Synchronously calculates and updates all the active flags in the database.
- */
- updateActiveAddons: function() {
- if (!this.addonDB) {
- logger.warn("updateActiveAddons called when DB isn't loaded");
- // force the DB to load
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_lateOpen_updateActive",
- XPIProvider.runPhase);
- this.syncLoadDB(true);
- }
- logger.debug("Updating add-on states");
- for (let [, addon] of this.addonDB) {
- let newActive = (addon.visible && !addon.disabled && !addon.pendingUninstall);
- if (newActive != addon.active) {
- addon.active = newActive;
- this.saveChanges();
- }
- }
- },
-
- /**
- * Writes out the XPI add-ons list for the platform to read.
- * @return true if the file was successfully updated, false otherwise
- */
- writeAddonsList: function() {
- if (!this.addonDB) {
- // force the DB to load
- AddonManagerPrivate.recordSimpleMeasure("XPIDB_lateOpen_writeList",
- XPIProvider.runPhase);
- this.syncLoadDB(true);
- }
- Services.appinfo.invalidateCachesOnRestart();
-
- let addonsList = FileUtils.getFile(KEY_PROFILEDIR, [FILE_XPI_ADDONS_LIST],
- true);
- let enabledAddons = [];
- let text = "[ExtensionDirs]\r\n";
- let count = 0;
- let fullCount = 0;
-
- let activeAddons = _filterDB(
- this.addonDB,
- aAddon => aAddon.active && !aAddon.bootstrap && (aAddon.type != "theme"));
-
- for (let row of activeAddons) {
- text += "Extension" + (count++) + "=" + row.descriptor + "\r\n";
- enabledAddons.push(encodeURIComponent(row.id) + ":" +
- encodeURIComponent(row.version));
- }
- fullCount += count;
-
- // The selected skin may come from an inactive theme (the default theme
- // when a lightweight theme is applied for example)
- text += "\r\n[ThemeDirs]\r\n";
-
- let dssEnabled = false;
- try {
- dssEnabled = Services.prefs.getBoolPref(PREF_EM_DSS_ENABLED);
- } catch (e) {}
-
- let themes = [];
- if (dssEnabled) {
- themes = _filterDB(this.addonDB, aAddon => aAddon.type == "theme");
- }
- else {
- let activeTheme = _findAddon(
- this.addonDB,
- aAddon => (aAddon.type == "theme") &&
- (aAddon.internalName == XPIProvider.selectedSkin));
- if (activeTheme) {
- themes.push(activeTheme);
- }
- }
-
- if (themes.length > 0) {
- count = 0;
- for (let row of themes) {
- text += "Extension" + (count++) + "=" + row.descriptor + "\r\n";
- enabledAddons.push(encodeURIComponent(row.id) + ":" +
- encodeURIComponent(row.version));
- }
- fullCount += count;
- }
-
- text += "\r\n[MultiprocessIncompatibleExtensions]\r\n";
-
- count = 0;
- for (let row of activeAddons) {
- if (!row.multiprocessCompatible) {
- text += "Extension" + (count++) + "=" + row.id + "\r\n";
- }
- }
-
- if (fullCount > 0) {
- logger.debug("Writing add-ons list");
-
- try {
- let addonsListTmp = FileUtils.getFile(KEY_PROFILEDIR, [FILE_XPI_ADDONS_LIST + ".tmp"],
- true);
- var fos = FileUtils.openFileOutputStream(addonsListTmp);
- fos.write(text, text.length);
- fos.close();
- addonsListTmp.moveTo(addonsListTmp.parent, FILE_XPI_ADDONS_LIST);
-
- Services.prefs.setCharPref(PREF_EM_ENABLED_ADDONS, enabledAddons.join(","));
- }
- catch (e) {
- logger.error("Failed to write add-ons list to profile directory", e);
- return false;
- }
- }
- else {
- if (addonsList.exists()) {
- logger.debug("Deleting add-ons list");
- try {
- addonsList.remove(false);
- }
- catch (e) {
- logger.error("Failed to remove " + addonsList.path, e);
- return false;
- }
- }
-
- Services.prefs.clearUserPref(PREF_EM_ENABLED_ADDONS);
- }
- return true;
- }
-};
-
-this.XPIDatabaseReconcile = {
- /**
- * Returns a map of ID -> add-on. When the same add-on ID exists in multiple
- * install locations the highest priority location is chosen.
- */
- flattenByID(addonMap, hideLocation) {
- let map = new Map();
-
- for (let installLocation of XPIProvider.installLocations) {
- if (installLocation.name == hideLocation)
- continue;
-
- let locationMap = addonMap.get(installLocation.name);
- if (!locationMap)
- continue;
-
- for (let [id, addon] of locationMap) {
- if (!map.has(id))
- map.set(id, addon);
- }
- }
-
- return map;
- },
-
- /**
- * Finds the visible add-ons from the map.
- */
- getVisibleAddons(addonMap) {
- let map = new Map();
-
- for (let [location, addons] of addonMap) {
- for (let [id, addon] of addons) {
- if (!addon.visible)
- continue;
-
- if (map.has(id)) {
- logger.warn("Previous database listed more than one visible add-on with id " + id);
- continue;
- }
-
- map.set(id, addon);
- }
- }
-
- return map;
- },
-
- /**
- * Called to add the metadata for an add-on in one of the install locations
- * to the database. This can be called in three different cases. Either an
- * add-on has been dropped into the location from outside of Firefox, or
- * an add-on has been installed through the application, or the database
- * has been upgraded or become corrupt and add-on data has to be reloaded
- * into it.
- *
- * @param aInstallLocation
- * The install location containing the add-on
- * @param aId
- * The ID of the add-on
- * @param aAddonState
- * The new state of the add-on
- * @param aNewAddon
- * The manifest for the new add-on if it has already been loaded
- * @param aOldAppVersion
- * The version of the application last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aOldPlatformVersion
- * The version of the platform last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aMigrateData
- * If during startup the database had to be upgraded this will
- * contain data that used to be held about this add-on
- * @return a boolean indicating if flushing caches is required to complete
- * changing this add-on
- */
- addMetadata(aInstallLocation, aId, aAddonState, aNewAddon, aOldAppVersion,
- aOldPlatformVersion, aMigrateData) {
- logger.debug("New add-on " + aId + " installed in " + aInstallLocation.name);
-
- // If we had staged data for this add-on or we aren't recovering from a
- // corrupt database and we don't have migration data for this add-on then
- // this must be a new install.
- let isNewInstall = (!!aNewAddon) || (!XPIDatabase.activeBundles && !aMigrateData);
-
- // If it's a new install and we haven't yet loaded the manifest then it
- // must be something dropped directly into the install location
- let isDetectedInstall = isNewInstall && !aNewAddon;
-
- // Load the manifest if necessary and sanity check the add-on ID
- try {
- if (!aNewAddon) {
- // Load the manifest from the add-on.
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.persistentDescriptor = aAddonState.descriptor;
- aNewAddon = syncLoadManifestFromFile(file, aInstallLocation);
- }
- // The add-on in the manifest should match the add-on ID.
- if (aNewAddon.id != aId) {
- throw new Error("Invalid addon ID: expected addon ID " + aId +
- ", found " + aNewAddon.id + " in manifest");
- }
- }
- catch (e) {
- logger.warn("addMetadata: Add-on " + aId + " is invalid", e);
-
- // Remove the invalid add-on from the install location if the install
- // location isn't locked, no restart will be necessary
- if (aInstallLocation.isLinkedAddon(aId))
- logger.warn("Not uninstalling invalid item because it is a proxy file");
- else if (aInstallLocation.locked)
- logger.warn("Could not uninstall invalid item from locked install location");
- else
- aInstallLocation.uninstallAddon(aId);
- return null;
- }
-
- // Update the AddonInternal properties.
- aNewAddon.installDate = aAddonState.mtime;
- aNewAddon.updateDate = aAddonState.mtime;
-
- // Assume that add-ons in the system add-ons install location aren't
- // foreign and should default to enabled.
- aNewAddon.foreignInstall = isDetectedInstall &&
- aInstallLocation.name != KEY_APP_SYSTEM_ADDONS &&
- aInstallLocation.name != KEY_APP_SYSTEM_DEFAULTS;
-
- // appDisabled depends on whether the add-on is a foreignInstall so update
- aNewAddon.appDisabled = !isUsableAddon(aNewAddon);
-
- if (aMigrateData) {
- // If there is migration data then apply it.
- logger.debug("Migrating data from old database");
-
- DB_MIGRATE_METADATA.forEach(function(aProp) {
- // A theme's disabled state is determined by the selected theme
- // preference which is read in loadManifestFromRDF
- if (aProp == "userDisabled" && aNewAddon.type == "theme")
- return;
-
- if (aProp in aMigrateData)
- aNewAddon[aProp] = aMigrateData[aProp];
- });
-
- // Force all non-profile add-ons to be foreignInstalls since they can't
- // have been installed through the API
- aNewAddon.foreignInstall |= aInstallLocation.name != KEY_APP_PROFILE;
-
- // Some properties should only be migrated if the add-on hasn't changed.
- // The version property isn't a perfect check for this but covers the
- // vast majority of cases.
- if (aMigrateData.version == aNewAddon.version) {
- logger.debug("Migrating compatibility info");
- if ("targetApplications" in aMigrateData)
- aNewAddon.applyCompatibilityUpdate(aMigrateData, true);
- }
-
- // Since the DB schema has changed make sure softDisabled is correct
- applyBlocklistChanges(aNewAddon, aNewAddon, aOldAppVersion,
- aOldPlatformVersion);
- }
-
- // The default theme is never a foreign install
- if (aNewAddon.type == "theme" && aNewAddon.internalName == XPIProvider.defaultSkin)
- aNewAddon.foreignInstall = false;
-
- if (isDetectedInstall && aNewAddon.foreignInstall) {
- // If the add-on is a foreign install and is in a scope where add-ons
- // that were dropped in should default to disabled then disable it
- let disablingScopes = Preferences.get(PREF_EM_AUTO_DISABLED_SCOPES, 0);
- if (aInstallLocation.scope & disablingScopes) {
- logger.warn("Disabling foreign installed add-on " + aNewAddon.id + " in "
- + aInstallLocation.name);
- aNewAddon.userDisabled = true;
-
- // If we don't have an old app version then this is a new profile in
- // which case just mark any sideloaded add-ons as already seen.
- aNewAddon.seen = !aOldAppVersion;
- }
- }
-
- return XPIDatabase.addAddonMetadata(aNewAddon, aAddonState.descriptor);
- },
-
- /**
- * Called when an add-on has been removed.
- *
- * @param aOldAddon
- * The AddonInternal as it appeared the last time the application
- * ran
- * @return a boolean indicating if flushing caches is required to complete
- * changing this add-on
- */
- removeMetadata(aOldAddon) {
- // This add-on has disappeared
- logger.debug("Add-on " + aOldAddon.id + " removed from " + aOldAddon.location);
- XPIDatabase.removeAddonMetadata(aOldAddon);
- },
-
- /**
- * Updates an add-on's metadata and determines if a restart of the
- * application is necessary. This is called when either the add-on's
- * install directory path or last modified time has changed.
- *
- * @param aInstallLocation
- * The install location containing the add-on
- * @param aOldAddon
- * The AddonInternal as it appeared the last time the application
- * ran
- * @param aAddonState
- * The new state of the add-on
- * @param aNewAddon
- * The manifest for the new add-on if it has already been loaded
- * @return a boolean indicating if flushing caches is required to complete
- * changing this add-on
- */
- updateMetadata(aInstallLocation, aOldAddon, aAddonState, aNewAddon) {
- logger.debug("Add-on " + aOldAddon.id + " modified in " + aInstallLocation.name);
-
- try {
- // If there isn't an updated install manifest for this add-on then load it.
- if (!aNewAddon) {
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.persistentDescriptor = aAddonState.descriptor;
- aNewAddon = syncLoadManifestFromFile(file, aInstallLocation);
- applyBlocklistChanges(aOldAddon, aNewAddon);
-
- // Carry over any pendingUninstall state to add-ons modified directly
- // in the profile. This is important when the attempt to remove the
- // add-on in processPendingFileChanges failed and caused an mtime
- // change to the add-ons files.
- aNewAddon.pendingUninstall = aOldAddon.pendingUninstall;
- }
-
- // The ID in the manifest that was loaded must match the ID of the old
- // add-on.
- if (aNewAddon.id != aOldAddon.id)
- throw new Error("Incorrect id in install manifest for existing add-on " + aOldAddon.id);
- }
- catch (e) {
- logger.warn("updateMetadata: Add-on " + aOldAddon.id + " is invalid", e);
- XPIDatabase.removeAddonMetadata(aOldAddon);
- XPIStates.removeAddon(aOldAddon.location, aOldAddon.id);
- if (!aInstallLocation.locked)
- aInstallLocation.uninstallAddon(aOldAddon.id);
- else
- logger.warn("Could not uninstall invalid item from locked install location");
-
- return null;
- }
-
- // Set the additional properties on the new AddonInternal
- aNewAddon.updateDate = aAddonState.mtime;
-
- // Update the database
- return XPIDatabase.updateAddonMetadata(aOldAddon, aNewAddon, aAddonState.descriptor);
- },
-
- /**
- * Updates an add-on's descriptor for when the add-on has moved in the
- * filesystem but hasn't changed in any other way.
- *
- * @param aInstallLocation
- * The install location containing the add-on
- * @param aOldAddon
- * The AddonInternal as it appeared the last time the application
- * ran
- * @param aAddonState
- * The new state of the add-on
- * @return a boolean indicating if flushing caches is required to complete
- * changing this add-on
- */
- updateDescriptor(aInstallLocation, aOldAddon, aAddonState) {
- logger.debug("Add-on " + aOldAddon.id + " moved to " + aAddonState.descriptor);
- aOldAddon.descriptor = aAddonState.descriptor;
- aOldAddon._sourceBundle.persistentDescriptor = aAddonState.descriptor;
-
- return aOldAddon;
- },
-
- /**
- * Called when no change has been detected for an add-on's metadata but the
- * application has changed so compatibility may have changed.
- *
- * @param aInstallLocation
- * The install location containing the add-on
- * @param aOldAddon
- * The AddonInternal as it appeared the last time the application
- * ran
- * @param aAddonState
- * The new state of the add-on
- * @param aOldAppVersion
- * The version of the application last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aOldPlatformVersion
- * The version of the platform last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aReloadMetadata
- * A boolean which indicates whether metadata should be reloaded from
- * the addon manifests. Default to false.
- * @return the new addon.
- */
- updateCompatibility(aInstallLocation, aOldAddon, aAddonState, aOldAppVersion,
- aOldPlatformVersion, aReloadMetadata) {
- logger.debug("Updating compatibility for add-on " + aOldAddon.id + " in " + aInstallLocation.name);
-
- // If updating from a version of the app that didn't support signedState
- // then fetch that property now
- if (aOldAddon.signedState === undefined && ADDON_SIGNING &&
- SIGNED_TYPES.has(aOldAddon.type)) {
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.persistentDescriptor = aAddonState.descriptor;
- let manifest = syncLoadManifestFromFile(file, aInstallLocation);
- aOldAddon.signedState = manifest.signedState;
- }
-
- // May be updating from a version of the app that didn't support all the
- // properties of the currently-installed add-ons.
- if (aReloadMetadata) {
- let file = new nsIFile()
- file.persistentDescriptor = aAddonState.descriptor;
- let manifest = syncLoadManifestFromFile(file, aInstallLocation);
-
- // Avoid re-reading these properties from manifest,
- // use existing addon instead.
- // TODO - consider re-scanning for targetApplications.
- let remove = ["syncGUID", "foreignInstall", "visible", "active",
- "userDisabled", "applyBackgroundUpdates", "sourceURI",
- "releaseNotesURI", "targetApplications"];
-
- let props = PROP_JSON_FIELDS.filter(a => !remove.includes(a));
- copyProperties(manifest, props, aOldAddon);
- }
-
- // This updates the addon's JSON cached data in place
- applyBlocklistChanges(aOldAddon, aOldAddon, aOldAppVersion,
- aOldPlatformVersion);
- aOldAddon.appDisabled = !isUsableAddon(aOldAddon);
-
- return aOldAddon;
- },
-
- /**
- * Compares the add-ons that are currently installed to those that were
- * known to be installed when the application last ran and applies any
- * changes found to the database. Also sends "startupcache-invalidate" signal to
- * observerservice if it detects that data may have changed.
- * Always called after XPIProviderUtils.js and extensions.json have been loaded.
- *
- * @param aManifests
- * A dictionary of cached AddonInstalls for add-ons that have been
- * installed
- * @param aUpdateCompatibility
- * true to update add-ons appDisabled property when the application
- * version has changed
- * @param aOldAppVersion
- * The version of the application last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aOldPlatformVersion
- * The version of the platform last run with this profile or null
- * if it is a new profile or the version is unknown
- * @param aSchemaChange
- * The schema has changed and all add-on manifests should be re-read.
- * @return a boolean indicating if a change requiring flushing the caches was
- * detected
- */
- processFileChanges(aManifests, aUpdateCompatibility, aOldAppVersion, aOldPlatformVersion,
- aSchemaChange) {
- let loadedManifest = (aInstallLocation, aId) => {
- if (!(aInstallLocation.name in aManifests))
- return null;
- if (!(aId in aManifests[aInstallLocation.name]))
- return null;
- return aManifests[aInstallLocation.name][aId];
- };
-
- // Add-ons loaded from the database can have an uninitialized _sourceBundle
- // if the descriptor was invalid. Swallow that error and say they don't exist.
- let exists = (aAddon) => {
- try {
- return aAddon._sourceBundle.exists();
- }
- catch (e) {
- if (e.result == Cr.NS_ERROR_NOT_INITIALIZED)
- return false;
- throw e;
- }
- };
-
- // Get the previous add-ons from the database and put them into maps by location
- let previousAddons = new Map();
- for (let a of XPIDatabase.getAddons()) {
- let locationAddonMap = previousAddons.get(a.location);
- if (!locationAddonMap) {
- locationAddonMap = new Map();
- previousAddons.set(a.location, locationAddonMap);
- }
- locationAddonMap.set(a.id, a);
- }
-
- // Build the list of current add-ons into similar maps. When add-ons are still
- // present we re-use the add-on objects from the database and update their
- // details directly
- let currentAddons = new Map();
- for (let installLocation of XPIProvider.installLocations) {
- let locationAddonMap = new Map();
- currentAddons.set(installLocation.name, locationAddonMap);
-
- // Get all the on-disk XPI states for this location, and keep track of which
- // ones we see in the database.
- let states = XPIStates.getLocation(installLocation.name);
-
- // Iterate through the add-ons installed the last time the application
- // ran
- let dbAddons = previousAddons.get(installLocation.name);
- if (dbAddons) {
- for (let [id, oldAddon] of dbAddons) {
- // Check if the add-on is still installed
- let xpiState = states && states.get(id);
- if (xpiState) {
- // Here the add-on was present in the database and on disk
- recordAddonTelemetry(oldAddon);
-
- // Check if the add-on has been changed outside the XPI provider
- if (oldAddon.updateDate != xpiState.mtime) {
- // Did time change in the wrong direction?
- if (xpiState.mtime < oldAddon.updateDate) {
- XPIProvider.setTelemetry(oldAddon.id, "olderFile", {
- name: XPIProvider._mostRecentlyModifiedFile[id],
- mtime: xpiState.mtime,
- oldtime: oldAddon.updateDate
- });
- } else {
- XPIProvider.setTelemetry(oldAddon.id, "modifiedFile",
- XPIProvider._mostRecentlyModifiedFile[id]);
- }
- }
-
- // The add-on has changed if the modification time has changed, if
- // we have an updated manifest for it, or if the schema version has
- // changed.
- //
- // Also reload the metadata for add-ons in the application directory
- // when the application version has changed.
- let newAddon = loadedManifest(installLocation, id);
- if (newAddon || oldAddon.updateDate != xpiState.mtime ||
- (aUpdateCompatibility && (installLocation.name == KEY_APP_GLOBAL ||
- installLocation.name == KEY_APP_SYSTEM_DEFAULTS))) {
- newAddon = this.updateMetadata(installLocation, oldAddon, xpiState, newAddon);
- }
- else if (oldAddon.descriptor != xpiState.descriptor) {
- newAddon = this.updateDescriptor(installLocation, oldAddon, xpiState);
- }
- // Check compatility when the application version and/or schema
- // version has changed. A schema change also reloads metadata from
- // the manifests.
- else if (aUpdateCompatibility || aSchemaChange) {
- newAddon = this.updateCompatibility(installLocation, oldAddon, xpiState,
- aOldAppVersion, aOldPlatformVersion,
- aSchemaChange);
- }
- else {
- // No change
- newAddon = oldAddon;
- }
-
- if (newAddon)
- locationAddonMap.set(newAddon.id, newAddon);
- }
- else {
- // The add-on is in the DB, but not in xpiState (and thus not on disk).
- this.removeMetadata(oldAddon);
- }
- }
- }
-
- // Any add-on in our current location that we haven't seen needs to
- // be added to the database.
- // Get the migration data for this install location so we can include that as
- // we add, in case this is a database upgrade or rebuild.
- let locMigrateData = {};
- if (XPIDatabase.migrateData && installLocation.name in XPIDatabase.migrateData)
- locMigrateData = XPIDatabase.migrateData[installLocation.name];
-
- if (states) {
- for (let [id, xpiState] of states) {
- if (locationAddonMap.has(id))
- continue;
- let migrateData = id in locMigrateData ? locMigrateData[id] : null;
- let newAddon = loadedManifest(installLocation, id);
- let addon = this.addMetadata(installLocation, id, xpiState, newAddon,
- aOldAppVersion, aOldPlatformVersion, migrateData);
- if (addon)
- locationAddonMap.set(addon.id, addon);
- }
- }
- }
-
- // previousAddons may contain locations where the database contains add-ons
- // but the browser is no longer configured to use that location. The metadata
- // for those add-ons must be removed from the database.
- for (let [locationName, addons] of previousAddons) {
- if (!currentAddons.has(locationName)) {
- for (let [id, oldAddon] of addons)
- this.removeMetadata(oldAddon);
- }
- }
-
- // Validate the updated system add-ons
- let systemAddonLocation = XPIProvider.installLocationsByName[KEY_APP_SYSTEM_ADDONS];
- let addons = currentAddons.get(KEY_APP_SYSTEM_ADDONS) || new Map();
-
- let hideLocation;
-
- if (!systemAddonLocation.isValid(addons)) {
- // Hide the system add-on updates if any are invalid.
- logger.info("One or more updated system add-ons invalid, falling back to defaults.");
- hideLocation = KEY_APP_SYSTEM_ADDONS;
- }
-
- let previousVisible = this.getVisibleAddons(previousAddons);
- let currentVisible = this.flattenByID(currentAddons, hideLocation);
- let sawActiveTheme = false;
- XPIProvider.bootstrappedAddons = {};
-
- // Pass over the new set of visible add-ons, record any changes that occured
- // during startup and call bootstrap install/uninstall scripts as necessary
- for (let [id, currentAddon] of currentVisible) {
- let previousAddon = previousVisible.get(id);
-
- // Note if any visible add-on is not in the application install location
- if (currentAddon._installLocation.name != KEY_APP_GLOBAL)
- XPIProvider.allAppGlobal = false;
-
- let isActive = !currentAddon.disabled;
- let wasActive = previousAddon ? previousAddon.active : currentAddon.active
-
- if (!previousAddon) {
- // If we had a manifest for this add-on it was a staged install and
- // so wasn't something recovered from a corrupt database
- let wasStaged = !!loadedManifest(currentAddon._installLocation, id);
-
- // We might be recovering from a corrupt database, if so use the
- // list of known active add-ons to update the new add-on
- if (!wasStaged && XPIDatabase.activeBundles) {
- // For themes we know which is active by the current skin setting
- if (currentAddon.type == "theme")
- isActive = currentAddon.internalName == XPIProvider.currentSkin;
- else
- isActive = XPIDatabase.activeBundles.indexOf(currentAddon.descriptor) != -1;
-
- // If the add-on wasn't active and it isn't already disabled in some way
- // then it was probably either softDisabled or userDisabled
- if (!isActive && !currentAddon.disabled) {
- // If the add-on is softblocked then assume it is softDisabled
- if (currentAddon.blocklistState == Blocklist.STATE_SOFTBLOCKED)
- currentAddon.softDisabled = true;
- else
- currentAddon.userDisabled = true;
- }
- }
- else {
- // This is a new install
- if (currentAddon.foreignInstall)
- AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_INSTALLED, id);
-
- if (currentAddon.bootstrap) {
- AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_INSTALLED, id);
- // Visible bootstrapped add-ons need to have their install method called
- XPIProvider.callBootstrapMethod(currentAddon, currentAddon._sourceBundle,
- "install", BOOTSTRAP_REASONS.ADDON_INSTALL);
- if (!isActive)
- XPIProvider.unloadBootstrapScope(currentAddon.id);
- }
- }
- }
- else {
- if (previousAddon !== currentAddon) {
- // This is an add-on that has changed, either the metadata was reloaded
- // or the version in a different location has become visible
- AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_CHANGED, id);
-
- let installReason = Services.vc.compare(previousAddon.version, currentAddon.version) < 0 ?
- BOOTSTRAP_REASONS.ADDON_UPGRADE :
- BOOTSTRAP_REASONS.ADDON_DOWNGRADE;
-
- // If the previous add-on was in a different path, bootstrapped
- // and still exists then call its uninstall method.
- if (previousAddon.bootstrap && previousAddon._installLocation &&
- exists(previousAddon) &&
- currentAddon._sourceBundle.path != previousAddon._sourceBundle.path) {
-
- XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,
- "uninstall", installReason,
- { newVersion: currentAddon.version });
- XPIProvider.unloadBootstrapScope(previousAddon.id);
- }
-
- // Make sure to flush the cache when an old add-on has gone away
- flushChromeCaches();
-
- if (currentAddon.bootstrap) {
- // Visible bootstrapped add-ons need to have their install method called
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.persistentDescriptor = currentAddon._sourceBundle.persistentDescriptor;
- XPIProvider.callBootstrapMethod(currentAddon, file,
- "install", installReason,
- { oldVersion: previousAddon.version });
- if (currentAddon.disabled)
- XPIProvider.unloadBootstrapScope(currentAddon.id);
- }
- }
-
- if (isActive != wasActive) {
- let change = isActive ? AddonManager.STARTUP_CHANGE_ENABLED
- : AddonManager.STARTUP_CHANGE_DISABLED;
- AddonManagerPrivate.addStartupChange(change, id);
- }
- }
-
- XPIDatabase.makeAddonVisible(currentAddon);
- currentAddon.active = isActive;
-
- // Make sure the bootstrap information is up to date for this ID
- if (currentAddon.bootstrap && currentAddon.active) {
- XPIProvider.bootstrappedAddons[id] = {
- version: currentAddon.version,
- type: currentAddon.type,
- descriptor: currentAddon._sourceBundle.persistentDescriptor,
- multiprocessCompatible: currentAddon.multiprocessCompatible,
- runInSafeMode: canRunInSafeMode(currentAddon),
- dependencies: currentAddon.dependencies,
- hasEmbeddedWebExtension: currentAddon.hasEmbeddedWebExtension,
- };
- }
-
- if (currentAddon.active && currentAddon.internalName == XPIProvider.selectedSkin)
- sawActiveTheme = true;
- }
-
- // Pass over the set of previously visible add-ons that have now gone away
- // and record the change.
- for (let [id, previousAddon] of previousVisible) {
- if (currentVisible.has(id))
- continue;
-
- // This add-on vanished
-
- // If the previous add-on was bootstrapped and still exists then call its
- // uninstall method.
- if (previousAddon.bootstrap && exists(previousAddon)) {
- XPIProvider.callBootstrapMethod(previousAddon, previousAddon._sourceBundle,
- "uninstall", BOOTSTRAP_REASONS.ADDON_UNINSTALL);
- XPIProvider.unloadBootstrapScope(previousAddon.id);
- }
- AddonManagerPrivate.addStartupChange(AddonManager.STARTUP_CHANGE_UNINSTALLED, id);
-
- // Make sure to flush the cache when an old add-on has gone away
- flushChromeCaches();
- }
-
- // Make sure add-ons from hidden locations are marked invisible and inactive
- let locationAddonMap = currentAddons.get(hideLocation);
- if (locationAddonMap) {
- for (let addon of locationAddonMap.values()) {
- addon.visible = false;
- addon.active = false;
- }
- }
-
- // If a custom theme is selected and it wasn't seen in the new list of
- // active add-ons then enable the default theme
- if (XPIProvider.selectedSkin != XPIProvider.defaultSkin && !sawActiveTheme) {
- logger.info("Didn't see selected skin " + XPIProvider.selectedSkin);
- XPIProvider.enableDefaultTheme();
- }
-
- // Finally update XPIStates to match everything
- for (let [locationName, locationAddonMap] of currentAddons) {
- for (let [id, addon] of locationAddonMap) {
- let xpiState = XPIStates.getAddon(locationName, id);
- xpiState.syncWithDB(addon);
- }
- }
- XPIStates.save();
-
- XPIProvider.persistBootstrappedAddons();
-
- // Clear out any cached migration data.
- XPIDatabase.migrateData = null;
- XPIDatabase.saveChanges();
-
- return true;
- },
-}
diff --git a/toolkit/mozapps/webextensions/internal/moz.build b/toolkit/mozapps/webextensions/internal/moz.build
deleted file mode 100644
index 8f1e4fea63..0000000000
--- a/toolkit/mozapps/webextensions/internal/moz.build
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXTRA_JS_MODULES.addons += [
- '../../extensions/internal/AddonLogging.jsm',
- '../../extensions/internal/Content.js',
- '../../extensions/internal/ProductAddonChecker.jsm',
- '../../extensions/internal/SpellCheckDictionaryBootstrap.js',
- 'AddonRepository.jsm',
- 'AddonRepository_SQLiteMigrator.jsm',
- 'APIExtensionBootstrap.js',
- 'GMPProvider.jsm',
- 'LightweightThemeImageOptimizer.jsm',
- 'WebExtensionBootstrap.js',
- 'XPIProvider.jsm',
- 'XPIProviderUtils.js',
-]
-
-# Don't ship unused providers on Android
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- EXTRA_JS_MODULES.addons += [
- 'PluginProvider.jsm',
- ]
-
-EXTRA_PP_JS_MODULES.addons += [
- '../../extensions/internal/AddonUpdateChecker.jsm',
- 'AddonConstants.jsm',
-]
diff --git a/toolkit/mozapps/webextensions/jar.mn b/toolkit/mozapps/webextensions/jar.mn
deleted file mode 100644
index 0c63396cc8..0000000000
--- a/toolkit/mozapps/webextensions/jar.mn
+++ /dev/null
@@ -1,35 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-toolkit.jar:
-#ifndef MOZ_FENNEC
-% content mozapps %content/mozapps/
-* content/mozapps/extensions/extensions.xul (content/extensions.xul)
- content/mozapps/extensions/extensions.css (content/extensions.css)
-* content/mozapps/extensions/extensions.js (content/extensions.js)
-* content/mozapps/extensions/extensions.xml (content/extensions.xml)
- content/mozapps/extensions/updateinfo.xsl (../extensions/content/updateinfo.xsl)
- content/mozapps/extensions/about.xul (../extensions/content/about.xul)
- content/mozapps/extensions/about.js (content/about.js)
- content/mozapps/extensions/list.xul (../extensions/content/list.xul)
- content/mozapps/extensions/list.js (../extensions/content/list.js)
- content/mozapps/extensions/blocklist.xul (../extensions/content/blocklist.xul)
- content/mozapps/extensions/blocklist.js (../extensions/content/blocklist.js)
- content/mozapps/extensions/blocklist.css (../extensions/content/blocklist.css)
- content/mozapps/extensions/blocklist.xml (../extensions/content/blocklist.xml)
-* content/mozapps/extensions/update.xul (content/update.xul)
- content/mozapps/extensions/update.js (content/update.js)
- content/mozapps/extensions/eula.xul (../extensions/content/eula.xul)
- content/mozapps/extensions/eula.js (content/eula.js)
- content/mozapps/extensions/newaddon.xul (content/newaddon.xul)
-* content/mozapps/extensions/newaddon.js (../extensions/content/newaddon.js)
- content/mozapps/extensions/pluginPrefs.xul (../extensions/content/pluginPrefs.xul)
- content/mozapps/extensions/gmpPrefs.xul (../extensions/content/gmpPrefs.xul)
- content/mozapps/extensions/OpenH264-license.txt (../extensions/content/OpenH264-license.txt)
-#endif
- content/mozapps/extensions/setting.xml (content/setting.xml)
- content/mozapps/xpinstall/xpinstallConfirm.xul (../extensions/content/xpinstallConfirm.xul)
- content/mozapps/xpinstall/xpinstallConfirm.js (../extensions/content/xpinstallConfirm.js)
- content/mozapps/xpinstall/xpinstallConfirm.css (../extensions/content/xpinstallConfirm.css)
- content/mozapps/xpinstall/xpinstallItem.xml (../extensions/content/xpinstallItem.xml)
diff --git a/toolkit/mozapps/webextensions/moz.build b/toolkit/mozapps/webextensions/moz.build
deleted file mode 100644
index f6e83a355b..0000000000
--- a/toolkit/mozapps/webextensions/moz.build
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DIRS += ['internal']
-
-XPIDL_SOURCES += [
- '../extensions/amIAddonManager.idl',
- '../extensions/amIAddonPathService.idl',
- '../extensions/amIWebInstaller.idl',
- '../extensions/amIWebInstallListener.idl',
-]
-
-XPIDL_MODULE = 'extensions'
-
-EXTRA_COMPONENTS += [
- '../extensions/amContentHandler.js',
- 'addonManager.js',
- 'amInstallTrigger.js',
- 'amWebAPI.js',
- 'amWebInstallListener.js',
-]
-
-EXTRA_PP_COMPONENTS += [
- 'extensions.manifest',
-]
-
-EXTRA_JS_MODULES += [
- '../extensions/ChromeManifestParser.jsm',
- '../extensions/DeferredSave.jsm',
- '../extensions/GMPUtils.jsm',
- 'AddonManager.jsm',
- 'LightweightThemeManager.jsm',
- 'GMPInstallManager.jsm',
-]
-
-JAR_MANIFESTS += ['jar.mn']
-
-EXPORTS.mozilla += [
- 'AddonContentPolicy.h',
- 'AddonManagerWebAPI.h',
- 'AddonPathService.h',
-]
-
-UNIFIED_SOURCES += [
- 'AddonContentPolicy.cpp',
- 'AddonManagerWebAPI.cpp',
- 'AddonPathService.cpp',
-]
-
-LOCAL_INCLUDES += [
- '/dom/base',
-]
-
-FINAL_LIBRARY = 'xul'
diff --git a/toolkit/themes/linux/mozapps/jar.mn b/toolkit/themes/linux/mozapps/jar.mn
index 37325c0bec..0931d1823d 100644
--- a/toolkit/themes/linux/mozapps/jar.mn
+++ b/toolkit/themes/linux/mozapps/jar.mn
@@ -6,23 +6,6 @@ toolkit.jar:
#include ../../shared/mozapps.inc.mn
skin/classic/mozapps/downloads/downloadIcon.png (downloads/downloadIcon.png)
skin/classic/mozapps/downloads/downloads.css (downloads/downloads.css)
-#ifdef MOZ_WEBEXTENSIONS
-* skin/classic/mozapps/extensions/extensions.css (webextensions/extensions.css)
- skin/classic/mozapps/extensions/category-search.png (webextensions/category-search.png)
- skin/classic/mozapps/extensions/category-discover.png (webextensions/category-discover.png)
- skin/classic/mozapps/extensions/category-plugins.png (webextensions/category-plugins.png)
- skin/classic/mozapps/extensions/category-service.png (webextensions/category-service.png)
- skin/classic/mozapps/extensions/category-recent.png (webextensions/category-recent.png)
- skin/classic/mozapps/extensions/category-available.png (webextensions/category-available.png)
- skin/classic/mozapps/extensions/extensionGeneric-16.png (webextensions/extensionGeneric-16.png)
- skin/classic/mozapps/extensions/dictionaryGeneric.png (webextensions/dictionaryGeneric.png)
- skin/classic/mozapps/extensions/dictionaryGeneric-16.png (webextensions/dictionaryGeneric-16.png)
- skin/classic/mozapps/extensions/themeGeneric.png (webextensions/themeGeneric.png)
- skin/classic/mozapps/extensions/themeGeneric-16.png (webextensions/themeGeneric-16.png)
- skin/classic/mozapps/extensions/localeGeneric.png (webextensions/localeGeneric.png)
-* skin/classic/mozapps/extensions/newaddon.css (webextensions/newaddon.css)
- skin/classic/mozapps/extensions/heart.png (webextensions/heart.png)
-#else
skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css)
skin/classic/mozapps/extensions/category-search.png (extensions/category-search.png)
skin/classic/mozapps/extensions/category-discover.png (extensions/category-discover.png)
@@ -46,7 +29,6 @@ toolkit.jar:
skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css)
skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css)
skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png)
-#endif
skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png)
skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png)
skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png)
diff --git a/toolkit/themes/linux/mozapps/webextensions/category-available.png b/toolkit/themes/linux/mozapps/webextensions/category-available.png
deleted file mode 100644
index 689d526c9d..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/category-available.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/category-discover.png b/toolkit/themes/linux/mozapps/webextensions/category-discover.png
deleted file mode 100644
index ccea27524f..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/category-discover.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/category-plugins.png b/toolkit/themes/linux/mozapps/webextensions/category-plugins.png
deleted file mode 100644
index b253dd08f9..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/category-plugins.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/category-recent.png b/toolkit/themes/linux/mozapps/webextensions/category-recent.png
deleted file mode 100644
index 9039b27aac..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/category-recent.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/category-search.png b/toolkit/themes/linux/mozapps/webextensions/category-search.png
deleted file mode 100644
index 52e91a7cea..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/category-search.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/category-service.png b/toolkit/themes/linux/mozapps/webextensions/category-service.png
deleted file mode 100644
index 997c8541ca..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/category-service.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric-16.png b/toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric-16.png
deleted file mode 100644
index 08a0447a47..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric.png b/toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric.png
deleted file mode 100644
index a1e0d53596..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/dictionaryGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/extensionGeneric-16.png b/toolkit/themes/linux/mozapps/webextensions/extensionGeneric-16.png
deleted file mode 100644
index b1a2f36521..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/extensionGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/extensions.css b/toolkit/themes/linux/mozapps/webextensions/extensions.css
deleted file mode 100644
index 5a11df1191..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/extensions.css
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../shared/webextensions/extensions.inc.css
-
-#header-utils-btn .toolbarbutton-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities-native");
-}
-
-.sorter[checkState="1"] .button-icon {
- display: -moz-box;
- list-style-image: url("moz-icon://stock/gtk-sort-descending?size=16");
-}
-
-.sorter[checkState="2"] .button-icon {
- display: -moz-box;
- list-style-image: url("moz-icon://stock/gtk-sort-ascending?size=16");
-}
-
-.addon .relnotes-toggle {
- list-style-image: url("moz-icon://stock/gtk-go-down?size=16");
-}
-
-.addon .relnotes-toggle > .button-box > .button-icon {
- display: -moz-box;
-}
-
-.addon[show-relnotes] .relnotes-toggle {
- list-style-image: url("moz-icon://stock/gtk-go-up?size=16");
-}
-
-.meta-rating[showrating="average"] > .star {
- list-style-image: url("chrome://mozapps/skin/extensions/rating-not-won.png");
- padding: 0 1px;
-}
-
-.meta-rating > .star[on="true"],
-.meta-rating[showrating="user"] > .star[hover] {
- list-style-image: url("chrome://mozapps/skin/extensions/rating-won.png");
- padding: 0 1px;
-}
diff --git a/toolkit/themes/linux/mozapps/webextensions/heart.png b/toolkit/themes/linux/mozapps/webextensions/heart.png
deleted file mode 100644
index 655f4c4be7..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/heart.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/localeGeneric.png b/toolkit/themes/linux/mozapps/webextensions/localeGeneric.png
deleted file mode 100644
index c721159066..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/localeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/newaddon.css b/toolkit/themes/linux/mozapps/webextensions/newaddon.css
deleted file mode 100644
index 5856c08b54..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/newaddon.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../shared/webextensions/newaddon.inc.css
diff --git a/toolkit/themes/linux/mozapps/webextensions/themeGeneric-16.png b/toolkit/themes/linux/mozapps/webextensions/themeGeneric-16.png
deleted file mode 100644
index 019886fea5..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/themeGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/webextensions/themeGeneric.png b/toolkit/themes/linux/mozapps/webextensions/themeGeneric.png
deleted file mode 100644
index cde1c7834b..0000000000
--- a/toolkit/themes/linux/mozapps/webextensions/themeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/jar.mn b/toolkit/themes/osx/mozapps/jar.mn
index f8ade11d91..eabd2eddb5 100644
--- a/toolkit/themes/osx/mozapps/jar.mn
+++ b/toolkit/themes/osx/mozapps/jar.mn
@@ -8,36 +8,6 @@ toolkit.jar:
skin/classic/mozapps/downloads/downloadIcon.png (downloads/downloadIcon.png)
* skin/classic/mozapps/downloads/downloads.css (downloads/downloads.css)
skin/classic/mozapps/downloads/unknownContentType.css (downloads/unknownContentType.css)
-#ifdef MOZ_WEBEXTENSIONS
- skin/classic/mozapps/extensions/category-search.png (webextensions/category-search.png)
- skin/classic/mozapps/extensions/category-discover.png (webextensions/category-discover.png)
- skin/classic/mozapps/extensions/category-plugins.png (webextensions/category-plugins.png)
- skin/classic/mozapps/extensions/category-service.png (webextensions/category-service.png)
- skin/classic/mozapps/extensions/category-dictionaries.png (webextensions/category-dictionaries.png)
- skin/classic/mozapps/extensions/category-experiments.png (webextensions/category-experiments.png)
- skin/classic/mozapps/extensions/category-recent.png (webextensions/category-recent.png)
- skin/classic/mozapps/extensions/category-available.png (webextensions/category-available.png)
- skin/classic/mozapps/extensions/discover-logo.png (webextensions/discover-logo.png)
- skin/classic/mozapps/extensions/extensionGeneric-16.png (webextensions/extensionGeneric-16.png)
- skin/classic/mozapps/extensions/themeGeneric.png (webextensions/themeGeneric.png)
- skin/classic/mozapps/extensions/themeGeneric-16.png (webextensions/themeGeneric-16.png)
- skin/classic/mozapps/extensions/dictionaryGeneric.png (webextensions/dictionaryGeneric.png)
- skin/classic/mozapps/extensions/dictionaryGeneric-16.png (webextensions/dictionaryGeneric-16.png)
- skin/classic/mozapps/extensions/experimentGeneric.png (webextensions/experimentGeneric.png)
- skin/classic/mozapps/extensions/localeGeneric.png (webextensions/localeGeneric.png)
- skin/classic/mozapps/extensions/rating-won.png (webextensions/rating-won.png)
- skin/classic/mozapps/extensions/rating-not-won.png (webextensions/rating-not-won.png)
- skin/classic/mozapps/extensions/cancel.png (webextensions/cancel.png)
- skin/classic/mozapps/extensions/toolbarbutton-dropmarker.png (webextensions/toolbarbutton-dropmarker.png)
- skin/classic/mozapps/extensions/heart.png (webextensions/heart.png)
- skin/classic/mozapps/extensions/search.png (webextensions/search.png)
- skin/classic/mozapps/extensions/about.css (webextensions/about.css)
-* skin/classic/mozapps/extensions/extensions.css (webextensions/extensions.css)
- skin/classic/mozapps/extensions/update.css (webextensions/update.css)
- skin/classic/mozapps/extensions/eula.css (webextensions/eula.css)
- skin/classic/mozapps/extensions/blocklist.css (webextensions/blocklist.css)
-* skin/classic/mozapps/extensions/newaddon.css (webextensions/newaddon.css)
-#else
skin/classic/mozapps/extensions/category-search.png (extensions/category-search.png)
skin/classic/mozapps/extensions/category-discover.png (extensions/category-discover.png)
skin/classic/mozapps/extensions/category-languages.png (extensions/localeGeneric.png)
@@ -82,7 +52,6 @@ toolkit.jar:
skin/classic/mozapps/extensions/eula.css (extensions/eula.css)
skin/classic/mozapps/extensions/blocklist.css (extensions/blocklist.css)
* skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css)
-#endif
skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png)
skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png)
skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png)
@@ -98,12 +67,8 @@ toolkit.jar:
skin/classic/mozapps/update/buttons.png (update/buttons.png)
* skin/classic/mozapps/update/updates.css (update/updates.css)
skin/classic/mozapps/viewsource/viewsource.css (viewsource/viewsource.css)
-#ifdef MOZ_WEBEXTENSIONS
- skin/classic/mozapps/xpinstall/xpinstallConfirm.css (webextensions/xpinstallConfirm.css)
-#else
skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png)
skin/classic/mozapps/xpinstall/xpinstallConfirm.css (extensions/xpinstallConfirm.css)
-#endif
skin/classic/mozapps/handling/handling.css (handling/handling.css)
#ifdef MOZ_PHOENIX
@@ -111,9 +76,4 @@ toolkit.jar:
#elif MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES
[extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
#endif
-#ifdef MOZ_WEBEXTENSIONS
-% override chrome://mozapps/skin/extensions/category-extensions.svg chrome://mozapps/skin/extensions/extensionGeneric.svg
-% override chrome://mozapps/skin/extensions/category-languages.png chrome://mozapps/skin/extensions/localeGeneric.png
-% override chrome://mozapps/skin/extensions/category-themes.png chrome://mozapps/skin/extensions/themeGeneric.png
-#endif
% override chrome://mozapps/skin/plugins/notifyPluginCrashed.png chrome://mozapps/skin/plugins/notifyPluginGeneric.png
diff --git a/toolkit/themes/osx/mozapps/webextensions/about.css b/toolkit/themes/osx/mozapps/webextensions/about.css
deleted file mode 100644
index c13ce5f598..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/about.css
+++ /dev/null
@@ -1,78 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#genericAbout {
- padding: 0px;
- min-height: 200px;
- max-height: 400px;
- width: 30em;
-}
-
-#clientBox {
- background-color: -moz-Dialog;
- color: -moz-DialogText;
-}
-
-.basic-info {
- padding: 10px;
-}
-
-#extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
- max-width: 64px;
- max-height: 64px;
- margin-inline-end: 6px;
-}
-
-#genericAbout[addontype="theme"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-#genericAbout[addontype="locale"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-#genericAbout[addontype="plugin"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-#genericAbout[addontype="dictionary"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
-
-#extensionName {
- font-size: 200%;
- font-weight: bolder;
-}
-
-#extensionVersion {
- font-weight: bold;
-}
-
-#extensionDescription {
- margin-top: 4px;
-}
-
-#groove {
- margin-top: 8px;
-}
-
-#extensionDetailsBox {
- overflow: auto;
- min-height: 100px;
-}
-
-.boxIndent {
- margin-inline-start: 18px;
-}
-
-#extensionCreator, .contributor {
- margin: 0px;
-}
-
-.sectionTitle {
- padding: 2px 0px 3px 0px;
- margin-top: 3px;
- font-weight: bold;
-}
diff --git a/toolkit/themes/osx/mozapps/webextensions/blocklist.css b/toolkit/themes/osx/mozapps/webextensions/blocklist.css
deleted file mode 100644
index 02f6e1d494..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/blocklist.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-richlistitem {
- padding-top: 6px;
- padding-bottom: 6px;
- padding-inline-start: 7px;
- padding-inline-end: 7px;
- border-bottom: 1px solid #C0C0C0;
-}
-
-.addon-name-version {
- font-size: 110%;
-}
-
-.blockedLabel {
- font-weight: bold;
- font-style: italic;
-}
diff --git a/toolkit/themes/osx/mozapps/webextensions/cancel.png b/toolkit/themes/osx/mozapps/webextensions/cancel.png
deleted file mode 100644
index 0d98ab2359..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/cancel.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-available.png b/toolkit/themes/osx/mozapps/webextensions/category-available.png
deleted file mode 100644
index d1b737ab05..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-available.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-dictionaries.png b/toolkit/themes/osx/mozapps/webextensions/category-dictionaries.png
deleted file mode 100644
index 54ae4f93fc..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-dictionaries.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-discover.png b/toolkit/themes/osx/mozapps/webextensions/category-discover.png
deleted file mode 100644
index a6f5b49b37..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-discover.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-experiments.png b/toolkit/themes/osx/mozapps/webextensions/category-experiments.png
deleted file mode 100644
index a9d00545ef..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-experiments.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-plugins.png b/toolkit/themes/osx/mozapps/webextensions/category-plugins.png
deleted file mode 100644
index 5c4d8bf471..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-plugins.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-recent.png b/toolkit/themes/osx/mozapps/webextensions/category-recent.png
deleted file mode 100644
index 7ecfc7d4c8..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-recent.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-search.png b/toolkit/themes/osx/mozapps/webextensions/category-search.png
deleted file mode 100644
index 52e91a7cea..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-search.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/category-service.png b/toolkit/themes/osx/mozapps/webextensions/category-service.png
deleted file mode 100644
index 997c8541ca..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/category-service.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric-16.png b/toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric-16.png
deleted file mode 100644
index 4ad1a1a825..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric.png b/toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric.png
deleted file mode 100644
index 54ae4f93fc..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/dictionaryGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/discover-logo.png b/toolkit/themes/osx/mozapps/webextensions/discover-logo.png
deleted file mode 100644
index cd50735a89..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/discover-logo.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/eula.css b/toolkit/themes/osx/mozapps/webextensions/eula.css
deleted file mode 100644
index 05aeb3c1c4..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/eula.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#icon {
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
- max-width: 48px;
- max-height: 48px;
- margin-inline-end: 6px;
-}
-
-#eula-dialog[addontype="theme"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-#eula-dialog[addontype="locale"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-#eula-dialog[addontype="plugin"] #icon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-#eula-dialog[addontype="dictionary"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
-
-#heading-container {
- -moz-box-align: center;
-}
-
-#heading {
- font-size: 120%;
-}
-
-#eula {
- -moz-appearance: none;
- color: -moz-FieldText;
- background-color: -moz-Field;
- margin: 1em;
- border: 1px solid;
- -moz-border-top-colors: ActiveBorder;
- -moz-border-right-colors: ActiveBorder;
- -moz-border-bottom-colors: ActiveBorder;
- -moz-border-left-colors: ActiveBorder;
-}
-
diff --git a/toolkit/themes/osx/mozapps/webextensions/experimentGeneric.png b/toolkit/themes/osx/mozapps/webextensions/experimentGeneric.png
deleted file mode 100644
index a9d00545ef..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/experimentGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/extensionGeneric-16.png b/toolkit/themes/osx/mozapps/webextensions/extensionGeneric-16.png
deleted file mode 100644
index fc6c8a2583..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/extensionGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/extensions.css b/toolkit/themes/osx/mozapps/webextensions/extensions.css
deleted file mode 100644
index cbdd9a5b06..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/extensions.css
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../shared/webextensions/extensions.inc.css
-
-.no-auto-hide > .menulist-dropmarker {
- padding-inline-start: 0px !important;
-}
-
-#header-utils-btn {
- list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities");
- margin-inline-end: 18px;
-}
-
-#header-utils-btn > .toolbarbutton-menu-dropmarker {
- list-style-image: url("chrome://mozapps/skin/extensions/toolbarbutton-dropmarker.png");
- padding: 0;
- margin-inline-start: 2px;
-}
-
-.sorter[checkState="1"] {
- list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
-}
-
-.sorter[checkState="2"] {
- list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
-}
-
-.addon .relnotes-toggle {
- -moz-box-direction: reverse;
- list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
-}
-
-.addon[show-relnotes] .relnotes-toggle {
- list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
-}
-
-.download-progress {
- margin-top: 3px;
- margin-bottom: 3px;
-}
-
-.meta-rating > .star {
- list-style-image: url("chrome://mozapps/skin/extensions/rating-not-won.png");
- padding: 0 1px;
-}
-
-.meta-rating > .star[on="true"] {
- list-style-image: url("chrome://mozapps/skin/extensions/rating-won.png");
-}
diff --git a/toolkit/themes/osx/mozapps/webextensions/heart.png b/toolkit/themes/osx/mozapps/webextensions/heart.png
deleted file mode 100644
index 655f4c4be7..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/heart.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/localeGeneric.png b/toolkit/themes/osx/mozapps/webextensions/localeGeneric.png
deleted file mode 100644
index 4d9ac5ad89..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/localeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/newaddon.css b/toolkit/themes/osx/mozapps/webextensions/newaddon.css
deleted file mode 100644
index 5856c08b54..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/newaddon.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../shared/webextensions/newaddon.inc.css
diff --git a/toolkit/themes/osx/mozapps/webextensions/rating-not-won.png b/toolkit/themes/osx/mozapps/webextensions/rating-not-won.png
deleted file mode 100644
index 2761f19255..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/rating-not-won.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/rating-won.png b/toolkit/themes/osx/mozapps/webextensions/rating-won.png
deleted file mode 100644
index 336dd8f6eb..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/rating-won.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/search.png b/toolkit/themes/osx/mozapps/webextensions/search.png
deleted file mode 100644
index 93196dbbf6..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/search.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/themeGeneric-16.png b/toolkit/themes/osx/mozapps/webextensions/themeGeneric-16.png
deleted file mode 100644
index 190bb30d71..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/themeGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/themeGeneric.png b/toolkit/themes/osx/mozapps/webextensions/themeGeneric.png
deleted file mode 100644
index be645f76df..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/themeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/toolbarbutton-dropmarker.png b/toolkit/themes/osx/mozapps/webextensions/toolbarbutton-dropmarker.png
deleted file mode 100644
index e7674c62a6..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/toolbarbutton-dropmarker.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/osx/mozapps/webextensions/update.css b/toolkit/themes/osx/mozapps/webextensions/update.css
deleted file mode 100644
index a0a016868c..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/update.css
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-.throbber {
- list-style-image: url("chrome://global/skin/icons/loading.png");
- width: 16px;
- height: 16px;
- margin-top: 5px;
- margin-bottom: 5px;
- margin-inline-start: 5px;
- margin-inline-end: 2px;
-}
-
-@media (min-resolution: 2dppx) {
- .throbber {
- list-style-image: url("chrome://global/skin/icons/loading@2x.png");
- }
-}
-
-.alertBox {
- background-color: InfoBackground;
- color: InfoText;
- border: 1px outset InfoBackground;
- margin-left: 3px;
- margin-right: 3px;
- padding: 5px;
-}
diff --git a/toolkit/themes/osx/mozapps/webextensions/xpinstallConfirm.css b/toolkit/themes/osx/mozapps/webextensions/xpinstallConfirm.css
deleted file mode 100644
index 48af7c1a91..0000000000
--- a/toolkit/themes/osx/mozapps/webextensions/xpinstallConfirm.css
+++ /dev/null
@@ -1,90 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#xpinstallheader {
- margin-bottom: 2em;
-}
-
-.alert-icon {
- width: 48px;
- height: 48px;
- list-style-image: url("chrome://global/skin/icons/warning-large.png");
- margin-top: 0 !important;
- margin-bottom: 6px !important;
- margin-inline-start: 6px !important;
- margin-inline-end: 20px !important;
-}
-
-#itemList {
- -moz-appearance: listbox;
- margin: 3px 4px 10px 4px;
- height: 14em;
-}
-
-#itemWarningIntro {
- margin-inline-start: 8px;
-}
-
-#dialogContentBox {
- padding: 5px;
-}
-
-installitem {
- padding: 5px 0 5px 5px;
- border-bottom: 1px dotted #C0C0C0;
- margin-bottom: 5px;
-}
-
-.warning {
- font-weight: bold;
- font-size: 1.25em;
- margin-bottom: 1em;
-}
-
-.xpinstallIconContainer {
- width: 32px;
- height: 32px;
- margin-inline-end: 5px;
-}
-
-.xpinstallItemName {
- font-weight: bold;
-}
-
-.xpinstallItemSigned {
- font-style: italic;
- font-size: 0.9em;
-}
-
-.xpinstallItemURL {
- -moz-appearance: none;
- border: none;
- background-color: Window;
- margin-top: 2px;
- margin-bottom: 1px;
- margin-inline-start: 6px;
- margin-inline-end: 5px;
-}
-
-.xpinstallItemIcon {
- max-width: 32px;
- max-height: 32px;
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
-}
-
-installitem[type="theme"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-installitem[type="locale"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-installitem[type="plugin"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-installitem[type="dictionary"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
diff --git a/toolkit/themes/shared/non-mac.jar.inc.mn b/toolkit/themes/shared/non-mac.jar.inc.mn
index 23f9da5192..b17e9d7bab 100644
--- a/toolkit/themes/shared/non-mac.jar.inc.mn
+++ b/toolkit/themes/shared/non-mac.jar.inc.mn
@@ -36,10 +36,12 @@
skin/classic/global/arrow/arrow-down.png (../../windows/global/arrow/arrow-down.png)
skin/classic/global/arrow/arrow-lft.gif (../../windows/global/arrow/arrow-lft.gif)
skin/classic/global/arrow/arrow-lft-dis.gif (../../windows/global/arrow/arrow-lft-dis.gif)
+ skin/classic/global/arrow/arrow-lft-hov.gif (../../windows/global/arrow/arrow-lft-hov.gif)
skin/classic/global/arrow/arrow-lft-sharp.gif (../../windows/global/arrow/arrow-lft-sharp.gif)
skin/classic/global/arrow/arrow-lft-sharp-end.gif (../../windows/global/arrow/arrow-lft-sharp-end.gif)
skin/classic/global/arrow/arrow-rit.gif (../../windows/global/arrow/arrow-rit.gif)
skin/classic/global/arrow/arrow-rit-dis.gif (../../windows/global/arrow/arrow-rit-dis.gif)
+ skin/classic/global/arrow/arrow-rit-hov.gif (../../windows/global/arrow/arrow-rit-hov.gif)
skin/classic/global/arrow/arrow-rit-sharp.gif (../../windows/global/arrow/arrow-rit-sharp.gif)
skin/classic/global/arrow/arrow-rit-sharp-end.gif (../../windows/global/arrow/arrow-rit-sharp-end.gif)
skin/classic/global/arrow/arrow-up.gif (../../windows/global/arrow/arrow-up.gif)
@@ -109,40 +111,15 @@
skin/classic/mozapps/downloads/downloadButtons.png (../../windows/mozapps/downloads/downloadButtons.png)
skin/classic/mozapps/downloads/unknownContentType.css (../../windows/mozapps/downloads/unknownContentType.css)
-#ifdef MOZ_WEBEXTENSIONS
- skin/classic/mozapps/extensions/about.css (../../windows/mozapps/webextensions/about.css)
- skin/classic/mozapps/extensions/blocklist.css (../../windows/mozapps/webextensions/blocklist.css)
- skin/classic/mozapps/extensions/update.css (../../windows/mozapps/webextensions/update.css)
- skin/classic/mozapps/extensions/discover-logo.png (../../windows/mozapps/webextensions/discover-logo.png)
- skin/classic/mozapps/extensions/experimentGeneric.png (../../windows/mozapps/webextensions/experimentGeneric.png)
- skin/classic/mozapps/extensions/rating-won.png (../../windows/mozapps/webextensions/rating-won.png)
- skin/classic/mozapps/extensions/rating-not-won.png (../../windows/mozapps/webextensions/rating-not-won.png)
- skin/classic/mozapps/extensions/cancel.png (../../windows/mozapps/webextensions/cancel.png)
- skin/classic/mozapps/extensions/eula.css (../../windows/mozapps/webextensions/eula.css)
-#endif
skin/classic/mozapps/handling/handling.css (../../windows/mozapps/handling/handling.css)
skin/classic/mozapps/plugins/pluginBlocked-64.png (../../windows/mozapps/plugins/pluginBlocked-64.png)
skin/classic/mozapps/plugins/pluginHelp-16.png (../../windows/mozapps/plugins/pluginHelp-16.png)
skin/classic/mozapps/profile/profileSelection.css (../../windows/mozapps/profile/profileSelection.css)
skin/classic/mozapps/update/downloadButtons.png (../../windows/mozapps/update/downloadButtons.png)
-#ifdef MOZ_WEBEXTENSIONS
-* skin/classic/mozapps/xpinstall/xpinstallConfirm.css (../../windows/mozapps/webextensions/xpinstallConfirm.css)
-#endif
#ifdef MOZ_PHOENIX
[browser/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
#elif MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES
[extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}] chrome.jar:
#endif
-#ifdef MOZ_WEBEXTENSIONS
-% override chrome://global/skin/arrow/arrow-lft-hov.gif chrome://global/skin/arrow/arrow-lft.gif
-% override chrome://global/skin/arrow/arrow-rit-hov.gif chrome://global/skin/arrow/arrow-rit.gif
-% override chrome://mozapps/skin/extensions/category-dictionaries.png chrome://mozapps/skin/extensions/dictionaryGeneric.png
-% override chrome://mozapps/skin/extensions/category-experiments.png chrome://mozapps/skin/extensions/experimentGeneric.png
-% override chrome://mozapps/skin/extensions/category-extensions.svg chrome://mozapps/skin/extensions/extensionGeneric.svg
-% override chrome://mozapps/skin/extensions/category-languages.png chrome://mozapps/skin/extensions/localeGeneric.png
-% override chrome://mozapps/skin/extensions/category-themes.png chrome://mozapps/skin/extensions/themeGeneric.png
-% override chrome://mozapps/skin/plugins/notifyPluginGeneric.png chrome://mozapps/skin/plugins/pluginGeneric-16.png
-% override chrome://mozapps/skin/xpinstall/xpinstallItemGeneric.png chrome://mozapps/skin/extensions/extensionGeneric.png
-#endif
% override chrome://mozapps/skin/plugins/notifyPluginCrashed.png chrome://mozapps/skin/plugins/pluginGeneric-16.png
diff --git a/toolkit/themes/windows/global/arrow/arrow-lft-hov.gif b/toolkit/themes/windows/global/arrow/arrow-lft-hov.gif
new file mode 100644
index 0000000000..2c814ca65b
--- /dev/null
+++ b/toolkit/themes/windows/global/arrow/arrow-lft-hov.gif
Binary files differ
diff --git a/toolkit/themes/windows/global/arrow/arrow-rit-hov.gif b/toolkit/themes/windows/global/arrow/arrow-rit-hov.gif
new file mode 100644
index 0000000000..d0a401647a
--- /dev/null
+++ b/toolkit/themes/windows/global/arrow/arrow-rit-hov.gif
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/jar.mn b/toolkit/themes/windows/mozapps/jar.mn
index 0d77a4e798..9f7562995f 100644
--- a/toolkit/themes/windows/mozapps/jar.mn
+++ b/toolkit/themes/windows/mozapps/jar.mn
@@ -6,23 +6,6 @@ toolkit.jar:
#include ../../shared/mozapps.inc.mn
skin/classic/mozapps/downloads/downloadIcon.png (downloads/downloadIcon.png)
skin/classic/mozapps/downloads/downloads.css (downloads/downloads.css)
-#ifdef MOZ_WEBEXTENSIONS
-* skin/classic/mozapps/extensions/extensions.css (webextensions/extensions.css)
- skin/classic/mozapps/extensions/category-search.png (webextensions/category-search.png)
- skin/classic/mozapps/extensions/category-discover.png (webextensions/category-discover.png)
- skin/classic/mozapps/extensions/category-plugins.png (webextensions/category-plugins.png)
- skin/classic/mozapps/extensions/category-service.png (webextensions/category-service.png)
- skin/classic/mozapps/extensions/category-recent.png (webextensions/category-recent.png)
- skin/classic/mozapps/extensions/category-available.png (webextensions/category-available.png)
- skin/classic/mozapps/extensions/extensionGeneric-16.png (webextensions/extensionGeneric-16.png)
- skin/classic/mozapps/extensions/themeGeneric.png (webextensions/themeGeneric.png)
- skin/classic/mozapps/extensions/themeGeneric-16.png (webextensions/themeGeneric-16.png)
- skin/classic/mozapps/extensions/dictionaryGeneric.png (webextensions/dictionaryGeneric.png)
- skin/classic/mozapps/extensions/dictionaryGeneric-16.png (webextensions/dictionaryGeneric-16.png)
- skin/classic/mozapps/extensions/localeGeneric.png (webextensions/localeGeneric.png)
- skin/classic/mozapps/extensions/heart.png (webextensions/heart.png)
-* skin/classic/mozapps/extensions/newaddon.css (webextensions/newaddon.css)
-#else
skin/classic/mozapps/extensions/about.css (extensions/about.css)
skin/classic/mozapps/extensions/blocklist.css (extensions/blocklist.css)
* skin/classic/mozapps/extensions/extensions.css (extensions/extensions.css)
@@ -67,7 +50,6 @@ toolkit.jar:
skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css)
* skin/classic/mozapps/xpinstall/xpinstallConfirm.css (extensions/xpinstallConfirm.css)
skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png)
-#endif
skin/classic/mozapps/passwordmgr/key.png (passwordmgr/key.png)
skin/classic/mozapps/passwordmgr/key-16.png (passwordmgr/key-16.png)
skin/classic/mozapps/passwordmgr/key-64.png (passwordmgr/key-64.png)
diff --git a/toolkit/themes/windows/mozapps/webextensions/about.css b/toolkit/themes/windows/mozapps/webextensions/about.css
deleted file mode 100644
index 19eaddca86..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/about.css
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#genericAbout {
- padding: 0px;
- min-height: 200px;
- max-height: 400px;
- width: 30em;
-}
-
-#clientBox {
- background-color: -moz-Dialog;
- color: -moz-DialogText;
-}
-
-@media (-moz-windows-compositor) {
- #genericAbout {
- -moz-appearance: -moz-win-glass;
- background: transparent;
- }
-
- #clientBox {
- -moz-appearance: -moz-win-exclude-glass;
- }
-}
-
-
-.basic-info {
- padding: 10px;
-}
-
-#extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
- max-width: 64px;
- max-height: 64px;
- margin-inline-end: 6px;
-}
-
-#genericAbout[addontype="theme"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-#genericAbout[addontype="locale"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-#genericAbout[addontype="plugin"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-#genericAbout[addontype="dictionary"] #extensionIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
-
-#extensionName {
- font-size: 200%;
- font-weight: bolder;
-}
-
-#extensionVersion {
- font-weight: bold;
-}
-
-#extensionDescription {
- margin-top: 4px;
-}
-
-#groove {
- margin-top: 8px;
-}
-
-#extensionDetailsBox {
- overflow: auto;
- min-height: 100px;
-}
-
-.boxIndent {
- margin-inline-start: 18px;
-}
-
-#extensionCreator, .contributor {
- margin: 0px;
-}
-
-.sectionTitle {
- padding: 2px 0px 3px 0px;
- margin-top: 3px;
- font-weight: bold;
-}
-
diff --git a/toolkit/themes/windows/mozapps/webextensions/blocklist.css b/toolkit/themes/windows/mozapps/webextensions/blocklist.css
deleted file mode 100644
index 1cdbb35ac6..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/blocklist.css
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-richlistitem {
- padding-top: 6px;
- padding-bottom: 6px;
- padding-inline-start: 7px;
- padding-inline-end: 7px;
- border-bottom: 1px solid #C0C0C0;
-}
-
-.addonName {
- font-weight: bold;
-}
-
-.blockedLabel {
- font-weight: bold;
- font-style: italic;
-}
diff --git a/toolkit/themes/windows/mozapps/webextensions/cancel.png b/toolkit/themes/windows/mozapps/webextensions/cancel.png
deleted file mode 100644
index 0d98ab2359..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/cancel.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/category-available.png b/toolkit/themes/windows/mozapps/webextensions/category-available.png
deleted file mode 100644
index 9341f2aa7b..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/category-available.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/category-discover.png b/toolkit/themes/windows/mozapps/webextensions/category-discover.png
deleted file mode 100644
index af954a6135..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/category-discover.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/category-plugins.png b/toolkit/themes/windows/mozapps/webextensions/category-plugins.png
deleted file mode 100644
index 100a90307b..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/category-plugins.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/category-recent.png b/toolkit/themes/windows/mozapps/webextensions/category-recent.png
deleted file mode 100644
index d651586465..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/category-recent.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/category-search.png b/toolkit/themes/windows/mozapps/webextensions/category-search.png
deleted file mode 100644
index 52e91a7cea..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/category-search.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/category-service.png b/toolkit/themes/windows/mozapps/webextensions/category-service.png
deleted file mode 100644
index 997c8541ca..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/category-service.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric-16.png b/toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric-16.png
deleted file mode 100644
index 37e2a5e4ce..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric.png b/toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric.png
deleted file mode 100644
index b26bb7100c..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/dictionaryGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/discover-logo.png b/toolkit/themes/windows/mozapps/webextensions/discover-logo.png
deleted file mode 100644
index cd50735a89..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/discover-logo.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/eula.css b/toolkit/themes/windows/mozapps/webextensions/eula.css
deleted file mode 100644
index 05aeb3c1c4..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/eula.css
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#icon {
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
- max-width: 48px;
- max-height: 48px;
- margin-inline-end: 6px;
-}
-
-#eula-dialog[addontype="theme"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-#eula-dialog[addontype="locale"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-#eula-dialog[addontype="plugin"] #icon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-#eula-dialog[addontype="dictionary"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
-
-#heading-container {
- -moz-box-align: center;
-}
-
-#heading {
- font-size: 120%;
-}
-
-#eula {
- -moz-appearance: none;
- color: -moz-FieldText;
- background-color: -moz-Field;
- margin: 1em;
- border: 1px solid;
- -moz-border-top-colors: ActiveBorder;
- -moz-border-right-colors: ActiveBorder;
- -moz-border-bottom-colors: ActiveBorder;
- -moz-border-left-colors: ActiveBorder;
-}
-
diff --git a/toolkit/themes/windows/mozapps/webextensions/experimentGeneric.png b/toolkit/themes/windows/mozapps/webextensions/experimentGeneric.png
deleted file mode 100644
index a9d00545ef..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/experimentGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/extensionGeneric-16.png b/toolkit/themes/windows/mozapps/webextensions/extensionGeneric-16.png
deleted file mode 100644
index 2724b9e7c6..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/extensionGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/extensions.css b/toolkit/themes/windows/mozapps/webextensions/extensions.css
deleted file mode 100644
index 7c4aed05e7..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/extensions.css
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../shared/webextensions/extensions.inc.css
-
-#header-utils-btn {
- list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities");
- margin-inline-end: 16px;
-}
-
-@media not all and (-moz-windows-default-theme) {
- #header-utils-btn {
- list-style-image: url("chrome://mozapps/skin/extensions/utilities.svg#utilities-native");
- }
-}
-
-.sorter[checkState="1"] {
- list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
-}
-
-.sorter[checkState="2"] {
- list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
-}
-
-.addon .relnotes-toggle {
- -moz-box-direction: reverse;
- list-style-image: url("chrome://global/skin/arrow/arrow-dn.gif");
-}
-
-.addon[show-relnotes] .relnotes-toggle {
- list-style-image: url("chrome://global/skin/arrow/arrow-up.gif");
-}
-
-.meta-rating > .star {
- list-style-image: url("chrome://mozapps/skin/extensions/rating-not-won.png");
- padding: 0 1px;
-}
-
-.meta-rating > .star[on="true"] {
- list-style-image: url("chrome://mozapps/skin/extensions/rating-won.png");
-}
diff --git a/toolkit/themes/windows/mozapps/webextensions/heart.png b/toolkit/themes/windows/mozapps/webextensions/heart.png
deleted file mode 100644
index 655f4c4be7..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/heart.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/localeGeneric.png b/toolkit/themes/windows/mozapps/webextensions/localeGeneric.png
deleted file mode 100644
index 623ba3a6a2..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/localeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/newaddon.css b/toolkit/themes/windows/mozapps/webextensions/newaddon.css
deleted file mode 100644
index 5856c08b54..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/newaddon.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-%include ../../../shared/webextensions/newaddon.inc.css
diff --git a/toolkit/themes/windows/mozapps/webextensions/rating-not-won.png b/toolkit/themes/windows/mozapps/webextensions/rating-not-won.png
deleted file mode 100644
index 2761f19255..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/rating-not-won.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/rating-won.png b/toolkit/themes/windows/mozapps/webextensions/rating-won.png
deleted file mode 100644
index 336dd8f6eb..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/rating-won.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/themeGeneric-16.png b/toolkit/themes/windows/mozapps/webextensions/themeGeneric-16.png
deleted file mode 100644
index ff13ce37f7..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/themeGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/themeGeneric.png b/toolkit/themes/windows/mozapps/webextensions/themeGeneric.png
deleted file mode 100644
index 9cea549dd8..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/themeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/webextensions/update.css b/toolkit/themes/windows/mozapps/webextensions/update.css
deleted file mode 100644
index 0db1793303..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/update.css
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-.throbber {
- list-style-image: url("chrome://global/skin/icons/loading.png");
- width: 16px;
- height: 16px;
- margin-top: 5px;
- margin-bottom: 5px;
- margin-inline-start: 5px;
- margin-inline-end: 2px;
-}
-
-@media (min-resolution: 1.1dppx) {
- .throbber {
- list-style-image: url("chrome://global/skin/icons/loading@2x.png");
- }
-}
-
-.alertBox {
- background-color: InfoBackground;
- color: InfoText;
- border: 1px outset InfoBackground;
- margin-left: 3px;
- margin-right: 3px;
- padding: 5px;
-}
diff --git a/toolkit/themes/windows/mozapps/webextensions/xpinstallConfirm.css b/toolkit/themes/windows/mozapps/webextensions/xpinstallConfirm.css
deleted file mode 100644
index 42db4cd4d7..0000000000
--- a/toolkit/themes/windows/mozapps/webextensions/xpinstallConfirm.css
+++ /dev/null
@@ -1,101 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#xpinstallheader {
- margin-bottom: 2em;
-}
-
-#itemList {
- -moz-appearance: listbox;
- margin: 3px 4px 10px 4px;
- height: 14em;
- border: 2px solid;
- -moz-border-top-colors: ThreeDShadow ThreeDDarkShadow;
- -moz-border-right-colors: ThreeDHighlight ThreeDLightShadow;
- -moz-border-bottom-colors: ThreeDHighlight ThreeDLightShadow;
- -moz-border-left-colors: ThreeDShadow ThreeDDarkShadow;
- background-color: -moz-Field;
- color: -moz-FieldText;
-}
-
-#itemWarningIntro {
- margin-inline-start: 8px;
-}
-
-#dialogContentBox {
- padding: 5px;
-}
-
-installitem {
- padding-top: 5px;
- padding-bottom: 5px;
- padding-inline-start: 5px;
- padding-inline-end: 0;
- border-bottom: 1px dotted #C0C0C0;
- margin-bottom: 5px;
-}
-
-.alert-icon {
-%ifdef XP_WIN
- list-style-image: url("chrome://global/skin/icons/warning-large.png");
- width: 48px;
- height: 48px;
-%endif
- margin-inline-end: 20px;
-}
-
-.warning {
- font-weight: bold;
- font-size: 1.25em;
- margin-bottom: 1em;
-}
-
-.xpinstallIconContainer {
- width: 32px;
- height: 32px;
- margin-inline-end: 5px;
-}
-
-.xpinstallItemName {
- font-weight: bold;
-}
-
-.xpinstallItemSigned {
- font-style: italic;
- font-size: 0.9em;
-}
-
-.xpinstallItemURL {
- -moz-appearance: none;
- border: none;
- padding: 0;
- background-color: -moz-Field;
- color: -moz-FieldText;
- margin-top: 1px;
- margin-bottom: 1px;
- margin-inline-start: 6px;
- margin-inline-end: 5px;
-}
-
-.xpinstallItemIcon {
- max-width: 32px;
- max-height: 32px;
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
-}
-
-installitem[type="theme"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-installitem[type="locale"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-installitem[type="plugin"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-installitem[type="dictionary"] .xpinstallItemIcon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
index 55b59ca835..072bd9ff93 100644
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -145,7 +145,6 @@ LOCAL_INCLUDES += [
'/dom/base',
'/dom/ipc',
'/testing/gtest/mozilla',
- '/toolkit/crashreporter',
'/xpcom/build',
]
diff --git a/toolkit/xre/nsAndroidStartup.cpp b/toolkit/xre/nsAndroidStartup.cpp
index 47b9ec6e52..68ad75c014 100644
--- a/toolkit/xre/nsAndroidStartup.cpp
+++ b/toolkit/xre/nsAndroidStartup.cpp
@@ -17,7 +17,6 @@
#include "nsIFile.h"
#include "nsAppRunner.h"
#include "APKOpen.h"
-#include "nsExceptionHandler.h"
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, MOZ_APP_NAME, args)
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index 59a72c4321..26e432b3cf 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -4130,9 +4130,12 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
#endif
const char *path = nullptr;
- ArgResult ar = CheckArg("greomni", false, &path);
+ ArgResult ar = CheckArg("greomni", true, &path);
if (ar == ARG_BAD) {
- PR_fprintf(PR_STDERR, "Error: argument --greomni requires a path argument\n");
+ PR_fprintf(PR_STDERR,
+ "Error: argument --greomni requires a path argument or the "
+ "--osint argument was specified with the --greomni argument "
+ "which is invalid.\n");
return NS_ERROR_FAILURE;
}
@@ -4146,9 +4149,12 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
return rv;
}
- ar = CheckArg("appomni", false, &path);
+ ar = CheckArg("appomni", true, &path);
if (ar == ARG_BAD) {
- PR_fprintf(PR_STDERR, "Error: argument --appomni requires a path argument\n");
+ PR_fprintf(PR_STDERR,
+ "Error: argument --appomni requires a path argument or the "
+ "--osint argument was specified with the --appomni argument "
+ "which is invalid.\n");
return NS_ERROR_FAILURE;
}
diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
index 3757dec2fa..52b4437703 100644
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -32,7 +32,6 @@
#include "nsAppRunner.h"
#include "nsAutoRef.h"
#include "nsDirectoryServiceDefs.h"
-#include "nsExceptionHandler.h"
#include "nsString.h"
#include "nsThreadUtils.h"
#include "nsJSUtils.h"
diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp
index 098d9ae7e0..454882c1b0 100644
--- a/toolkit/xre/nsSigHandlers.cpp
+++ b/toolkit/xre/nsSigHandlers.cpp
@@ -32,11 +32,6 @@
#endif
#endif
-#if defined(SOLARIS)
-#include <sys/resource.h>
-#include <ucontext.h>
-#endif
-
static const char* gProgname = "huh?";
// Note: some tests manipulate this value.
@@ -198,32 +193,6 @@ static void fpehandler(int signum, siginfo_t *si, void *context)
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
#endif
-#ifdef SOLARIS
- ucontext_t *uc = (ucontext_t *)context;
-
-#if defined(__i386)
- uint32_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[0];
- *cw |= FPU_EXCEPTION_MASK;
-
- uint32_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[1];
- *sw &= ~FPU_STATUS_FLAGS;
-
- /* address of the instruction that caused the exception */
- uint32_t *ip = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.state[3];
- uc->uc_mcontext.gregs[REG_PC] = *ip;
-#endif
-#if defined(__amd64__)
- uint16_t *cw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.cw;
- *cw |= FPU_EXCEPTION_MASK;
-
- uint16_t *sw = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.sw;
- *sw &= ~FPU_STATUS_FLAGS;
-
- uint32_t *mxcsr = &uc->uc_mcontext.fpregs.fp_reg_set.fpchip_state.mxcsr;
- *mxcsr |= SSE_EXCEPTION_MASK; /* disable all SSE exceptions */
- *mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
-#endif
-#endif
}
#endif
@@ -286,30 +255,6 @@ void InstallSignalHandlers(const char *aProgname)
}
#endif
-#if defined(SOLARIS)
-#define NOFILES 512
-
- // Boost Solaris file descriptors
- {
- struct rlimit rl;
-
- if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
-
- if (rl.rlim_cur < NOFILES) {
- rl.rlim_cur = NOFILES;
-
- if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
- perror("setrlimit(RLIMIT_NOFILE)");
- fprintf(stderr, "Cannot exceed hard limit for open files");
- }
-#if defined(DEBUG)
- if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
- printf("File descriptors set to %d\n", rl.rlim_cur);
-#endif //DEBUG
- }
- }
-#endif //SOLARIS
-
#if defined(MOZ_WIDGET_GTK) && (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6))
const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK");
if (assertString &&
diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp
index ab0bdf005a..aac856d6ec 100644
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -212,10 +212,8 @@ GetStatusFileContents(nsIFile *statusFile, char (&buf)[Size])
typedef enum {
eNoUpdateAction,
ePendingUpdate,
- ePendingService,
ePendingElevate,
eAppliedUpdate,
- eAppliedService,
} UpdateStatus;
/**
@@ -233,22 +231,14 @@ GetUpdateStatus(nsIFile* dir, nsCOMPtr<nsIFile> &statusFile)
char buf[32];
if (GetStatusFileContents(statusFile, buf)) {
const char kPending[] = "pending";
- const char kPendingService[] = "pending-service";
const char kPendingElevate[] = "pending-elevate";
const char kApplied[] = "applied";
- const char kAppliedService[] = "applied-service";
if (!strncmp(buf, kPendingElevate, sizeof(kPendingElevate) - 1)) {
return ePendingElevate;
}
- if (!strncmp(buf, kPendingService, sizeof(kPendingService) - 1)) {
- return ePendingService;
- }
if (!strncmp(buf, kPending, sizeof(kPending) - 1)) {
return ePendingUpdate;
}
- if (!strncmp(buf, kAppliedService, sizeof(kAppliedService) - 1)) {
- return eAppliedService;
- }
if (!strncmp(buf, kApplied, sizeof(kApplied) - 1)) {
return eAppliedUpdate;
}
@@ -760,9 +750,6 @@ ApplyUpdate(nsIFile *greDir, nsIFile *updateDir, nsIFile *statusFile,
// We used to write out "Applying" to the update.status file here.
// Instead we do this from within the updater application now.
- // This is so that we don't overwrite the status of pending-service
- // in the Windows case. This change was made for all platforms so
- // that it stays consistent across all OS.
// On platforms where we are not calling execv, we may need to make the
// updater executable wait for the calling process to exit. Otherwise, the
@@ -969,17 +956,15 @@ ProcessUpdates(nsIFile *greDir, nsIFile *appDir, nsIFile *updRootDir,
}
break;
}
- // Intentional fallthrough to ePendingUpdate and ePendingService.
+ // Intentional fallthrough to ePendingUpdate.
MOZ_FALLTHROUGH;
}
- case ePendingUpdate:
- case ePendingService: {
+ case ePendingUpdate: {
ApplyUpdate(greDir, updatesDir, statusFile, appDir, argc, argv, restart,
isOSUpdate, osApplyToDir, pid);
break;
}
case eAppliedUpdate:
- case eAppliedService:
// An update was staged and needs to be switched so the updated application
// is used.
SwitchToUpdatedApp(greDir, updatesDir, appDir, argc, argv);
diff --git a/toolkit/xre/nsX11ErrorHandler.cpp b/toolkit/xre/nsX11ErrorHandler.cpp
index 0fb0d29c5d..9a6888adff 100644
--- a/toolkit/xre/nsX11ErrorHandler.cpp
+++ b/toolkit/xre/nsX11ErrorHandler.cpp
@@ -7,7 +7,6 @@
#include "prenv.h"
#include "nsXULAppAPI.h"
-#include "nsExceptionHandler.h"
#include "nsDebug.h"
#include "mozilla/X11Util.h"
diff --git a/uriloader/exthandler/win/nsOSHelperAppService.cpp b/uriloader/exthandler/win/nsOSHelperAppService.cpp
index f01f3b49b5..48b6f1795d 100644
--- a/uriloader/exthandler/win/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/win/nsOSHelperAppService.cpp
@@ -29,8 +29,6 @@
#define LOG(args) MOZ_LOG(mLog, mozilla::LogLevel::Debug, args)
// helper methods: forward declarations...
-static nsresult GetExtensionFrom4xRegistryInfo(const nsACString& aMimeType,
- nsString& aFileExtension);
static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType,
nsString& aFileExtension);
@@ -77,79 +75,45 @@ static nsresult GetExtensionFromWindowsMimeDatabase(const nsACString& aMimeType,
return NS_OK;
}
-// We have a serious problem!! I have this content type and the windows registry only gives me
-// helper apps based on extension. Right now, we really don't have a good place to go for
-// trying to figure out the extension for a particular mime type....One short term hack is to look
-// this information in 4.x (it's stored in the windows regsitry).
-static nsresult GetExtensionFrom4xRegistryInfo(const nsACString& aMimeType,
- nsString& aFileExtension)
-{
- nsCOMPtr<nsIWindowsRegKey> regKey =
- do_CreateInstance("@mozilla.org/windows-registry-key;1");
- if (!regKey)
- return NS_ERROR_NOT_AVAILABLE;
-
- nsresult rv = regKey->
- Open(nsIWindowsRegKey::ROOT_KEY_CURRENT_USER,
- NS_LITERAL_STRING("Software\\Netscape\\Netscape Navigator\\Suffixes"),
- nsIWindowsRegKey::ACCESS_QUERY_VALUE);
- if (NS_FAILED(rv))
- return NS_ERROR_NOT_AVAILABLE;
-
- rv = regKey->ReadStringValue(NS_ConvertASCIItoUTF16(aMimeType),
- aFileExtension);
- if (NS_FAILED(rv))
- return NS_OK;
-
- aFileExtension.Insert(char16_t('.'), 0);
-
- // this may be a comma separated list of extensions...just take the
- // first one for now...
-
- int32_t pos = aFileExtension.FindChar(char16_t(','));
- if (pos > 0) {
- // we have a comma separated list of types...
- // truncate everything after the first comma (including the comma)
- aFileExtension.Truncate(pos);
- }
-
- return NS_OK;
-}
-
nsresult nsOSHelperAppService::OSProtocolHandlerExists(const char * aProtocolScheme, bool * aHandlerExists)
{
// look up the protocol scheme in the windows registry....if we find a match then we have a handler for it...
*aHandlerExists = false;
if (aProtocolScheme && *aProtocolScheme)
{
- // Vista: use new application association interface
- if (mAppAssoc) {
- wchar_t * pResult = nullptr;
- NS_ConvertASCIItoUTF16 scheme(aProtocolScheme);
- // We are responsible for freeing returned strings.
- HRESULT hr = mAppAssoc->QueryCurrentDefault(scheme.get(),
- AT_URLPROTOCOL, AL_EFFECTIVE,
- &pResult);
- if (SUCCEEDED(hr)) {
- CoTaskMemFree(pResult);
- *aHandlerExists = true;
+ NS_ENSURE_TRUE(mAppAssoc, NS_ERROR_NOT_AVAILABLE);
+ wchar_t * pResult = nullptr;
+ NS_ConvertASCIItoUTF16 scheme(aProtocolScheme);
+ // We are responsible for freeing returned strings.
+ HRESULT hr = mAppAssoc->QueryCurrentDefault(scheme.get(),
+ AT_URLPROTOCOL, AL_EFFECTIVE,
+ &pResult);
+ if (SUCCEEDED(hr)) {
+ CoTaskMemFree(pResult);
+ // Check the registry to see if it's a valid handler.
+ nsCOMPtr<nsIWindowsRegKey> regKey = do_CreateInstance("@mozilla.org/windows-registry-key;1");
+ if (!regKey) {
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+
+ nsresult rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
+ nsDependentString(scheme.get()),
+ nsIWindowsRegKey::ACCESS_QUERY_VALUE);
+ if (NS_FAILED(rv)) {
+ // Open will fail if the registry key path doesn't exist.
+ return NS_OK;
+ }
+
+ bool hasValue;
+ rv = regKey->HasValue(NS_LITERAL_STRING("URL Protocol"), &hasValue);
+ if (NS_FAILED(rv)) {
+ return NS_ERROR_FAILURE;
+ }
+ if (!hasValue) {
+ return NS_OK;
}
- return NS_OK;
- }
- HKEY hKey;
- LONG err = ::RegOpenKeyExW(HKEY_CLASSES_ROOT,
- NS_ConvertASCIItoUTF16(aProtocolScheme).get(),
- 0,
- KEY_QUERY_VALUE,
- &hKey);
- if (err == ERROR_SUCCESS)
- {
- err = ::RegQueryValueExW(hKey, L"URL Protocol",
- nullptr, nullptr, nullptr, nullptr);
- *aHandlerExists = (err == ERROR_SUCCESS);
- // close the key
- ::RegCloseKey(hKey);
+ *aHandlerExists = true;
}
}
@@ -180,40 +144,21 @@ NS_IMETHODIMP nsOSHelperAppService::GetApplicationDescription(const nsACString&
}
}
- if (mAppAssoc) {
- // Vista: use new application association interface
- wchar_t * pResult = nullptr;
- // We are responsible for freeing returned strings.
- HRESULT hr = mAppAssoc->QueryCurrentDefault(buf.get(),
- AT_URLPROTOCOL, AL_EFFECTIVE,
- &pResult);
- if (SUCCEEDED(hr)) {
- nsCOMPtr<nsIFile> app;
- nsAutoString appInfo(pResult);
- CoTaskMemFree(pResult);
- if (NS_SUCCEEDED(GetDefaultAppInfo(appInfo, _retval, getter_AddRefs(app))))
- return NS_OK;
- }
- return NS_ERROR_NOT_AVAILABLE;
+ NS_ENSURE_TRUE(mAppAssoc, NS_ERROR_NOT_AVAILABLE);
+ wchar_t * pResult = nullptr;
+ // We are responsible for freeing returned strings.
+ HRESULT hr = mAppAssoc->QueryCurrentDefault(buf.get(),
+ AT_URLPROTOCOL, AL_EFFECTIVE,
+ &pResult);
+ if (SUCCEEDED(hr)) {
+ nsCOMPtr<nsIFile> app;
+ nsAutoString appInfo(pResult);
+ CoTaskMemFree(pResult);
+ if (NS_SUCCEEDED(GetDefaultAppInfo(appInfo, _retval, getter_AddRefs(app))))
+ return NS_OK;
}
- nsCOMPtr<nsIFile> app;
- GetDefaultAppInfo(buf, _retval, getter_AddRefs(app));
-
- if (!_retval.Equals(buf))
- return NS_OK;
-
- // Fall back to full path
- buf.AppendLiteral("\\shell\\open\\command");
- nsresult rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
- buf,
- nsIWindowsRegKey::ACCESS_QUERY_VALUE);
- if (NS_FAILED(rv))
- return NS_ERROR_NOT_AVAILABLE;
-
- rv = regKey->ReadStringValue(EmptyString(), _retval);
-
- return NS_SUCCEEDED(rv) ? NS_OK : NS_ERROR_NOT_AVAILABLE;
+ return NS_ERROR_NOT_AVAILABLE;
}
// GetMIMEInfoFromRegistry: This function obtains the values of some of the nsIMIMEInfo
@@ -421,36 +366,18 @@ already_AddRefed<nsMIMEInfoWin> nsOSHelperAppService::GetByExtension(const nsAFl
bool found;
// Retrieve the default application for this extension
- if (mAppAssoc) {
- // Vista: use the new application association COM interfaces
- // for resolving helpers.
- nsString assocType(fileExtToUse);
- wchar_t * pResult = nullptr;
- HRESULT hr = mAppAssoc->QueryCurrentDefault(assocType.get(),
- AT_FILEEXTENSION, AL_EFFECTIVE,
- &pResult);
- if (SUCCEEDED(hr)) {
- found = true;
- appInfo.Assign(pResult);
- CoTaskMemFree(pResult);
- }
- else {
- found = false;
- }
- }
- else
- {
- nsCOMPtr<nsIWindowsRegKey> regKey =
- do_CreateInstance("@mozilla.org/windows-registry-key;1");
- if (!regKey)
- return nullptr;
- nsresult rv = regKey->Open(nsIWindowsRegKey::ROOT_KEY_CLASSES_ROOT,
- fileExtToUse,
- nsIWindowsRegKey::ACCESS_QUERY_VALUE);
- if (NS_SUCCEEDED(rv)) {
- found = NS_SUCCEEDED(regKey->ReadStringValue(EmptyString(),
- appInfo));
- }
+ NS_ENSURE_TRUE(mAppAssoc, nullptr);
+ nsString assocType(fileExtToUse);
+ wchar_t * pResult = nullptr;
+ HRESULT hr = mAppAssoc->QueryCurrentDefault(assocType.get(),
+ AT_FILEEXTENSION, AL_EFFECTIVE,
+ &pResult);
+ if (SUCCEEDED(hr)) {
+ found = true;
+ appInfo.Assign(pResult);
+ CoTaskMemFree(pResult);
+ } else {
+ found = false;
}
// Bug 358297 - ignore the default handler, force the user to choose app
@@ -496,14 +423,9 @@ already_AddRefed<nsIMIMEInfo> nsOSHelperAppService::GetMIMEInfoFromOS(const nsAC
* We'll do extension-based lookup for this type later in this function.
*/
if (!aMIMEType.LowerCaseEqualsLiteral(APPLICATION_OCTET_STREAM)) {
- // (1) try to use the windows mime database to see if there is a mapping to a file extension
- // (2) try to see if we have some left over 4.x registry info we can peek at...
+ // try to use the windows mime database to see if there is a mapping to a file extension
GetExtensionFromWindowsMimeDatabase(aMIMEType, fileExtension);
LOG(("Windows mime database: extension '%s'\n", fileExtension.get()));
- if (fileExtension.IsEmpty()) {
- GetExtensionFrom4xRegistryInfo(aMIMEType, fileExtension);
- LOG(("4.x Registry: extension '%s'\n", fileExtension.get()));
- }
}
// If we found an extension for the type, do the lookup
RefPtr<nsMIMEInfoWin> mi;
diff --git a/widget/windows/moz.build b/widget/windows/moz.build
index 1e7fc4b021..4a449de95e 100644
--- a/widget/windows/moz.build
+++ b/widget/windows/moz.build
@@ -41,7 +41,6 @@ UNIFIED_SOURCES += [
'nsDataObjCollection.cpp',
'nsDragService.cpp',
'nsIdleServiceWin.cpp',
- 'nsImageClipboard.cpp',
'nsLookAndFeel.cpp',
'nsNativeDragSource.cpp',
'nsNativeDragTarget.cpp',
diff --git a/widget/windows/nsClipboard.cpp b/widget/windows/nsClipboard.cpp
index 0db1dd3424..c93f351c87 100644
--- a/widget/windows/nsClipboard.cpp
+++ b/widget/windows/nsClipboard.cpp
@@ -26,7 +26,6 @@
#include "nsReadableUtils.h"
#include "nsUnicharUtils.h"
#include "nsPrimitiveHelpers.h"
-#include "nsImageClipboard.h"
#include "nsIWidget.h"
#include "nsIComponentManager.h"
#include "nsWidgetsCID.h"
@@ -36,6 +35,8 @@
#include "nsIOutputStream.h"
#include "nsEscape.h"
#include "nsIObserverService.h"
+#include "nsMimeTypes.h"
+#include "imgITools.h"
using mozilla::LogLevel;
@@ -283,16 +284,19 @@ nsresult nsClipboard::GetGlobalData(HGLOBAL aHGBL, void ** aData, uint32_t * aLe
{
// Allocate a new memory buffer and copy the data from global memory.
// Recall that win98 allocates to nearest DWORD boundary. As a safety
- // precaution, allocate an extra 2 bytes (but don't report them!) and
- // null them out to ensure that all of our strlen calls will succeed.
+ // precaution, allocate an extra 3 bytes (but don't report them in |aLen|!)
+ // and null them out to ensure that all of our NS_strlen calls will succeed.
+ // NS_strlen operates on char16_t, so we need 3 NUL bytes to ensure it finds
+ // a full NUL char16_t when |*aLen| is odd.
nsresult result = NS_ERROR_FAILURE;
if (aHGBL != nullptr) {
LPSTR lpStr = (LPSTR) GlobalLock(aHGBL);
DWORD allocSize = GlobalSize(aHGBL);
- char* data = static_cast<char*>(malloc(allocSize + sizeof(char16_t)));
+ char* data = static_cast<char*>(malloc(allocSize + 3));
if ( data ) {
memcpy ( data, lpStr, allocSize );
- data[allocSize] = data[allocSize + 1] = '\0'; // null terminate for safety
+ data[allocSize] = data[allocSize + 1] = data[allocSize + 2] =
+ '\0'; // null terminate for safety
GlobalUnlock(aHGBL);
*aData = data;
@@ -471,17 +475,45 @@ nsresult nsClipboard::GetNativeDataOffClipboard(IDataObject * aDataObject, UINT
if (aMIMEImageFormat)
{
uint32_t allocLen = 0;
- unsigned char * clipboardData;
+ const char * clipboardData;
if (NS_SUCCEEDED(GetGlobalData(stm.hGlobal, (void **)&clipboardData, &allocLen)))
{
- nsImageFromClipboard converter;
- nsIInputStream * inputStream;
- converter.GetEncodedImageStream(clipboardData, aMIMEImageFormat, &inputStream); // addrefs for us, don't release
- if ( inputStream ) {
- *aData = inputStream;
- *aLen = sizeof(nsIInputStream*);
- result = NS_OK;
+ nsCOMPtr<imgIContainer> container;
+ nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
+ nsCOMPtr<nsIInputStream> inputStream;
+ nsresult rv = NS_NewByteInputStream(getter_AddRefs(inputStream),
+ clipboardData,
+ allocLen,
+ NS_ASSIGNMENT_DEPEND);
+ NS_ENSURE_SUCCESS(rv, rv);
+
+ result = imgTools->DecodeImage(inputStream,
+ NS_LITERAL_CSTRING(IMAGE_BMP_MS_CLIPBOARD),
+ getter_AddRefs(container));
+ if (NS_FAILED(result)) {
+ break;
}
+
+ nsAutoCString mimeType;
+ if (strcmp(aMIMEImageFormat, kJPGImageMime) == 0) {
+ mimeType.Assign(IMAGE_JPEG);
+ } else {
+ mimeType.Assign(aMIMEImageFormat);
+ }
+
+ result = imgTools->EncodeImage(container, mimeType, EmptyString(),
+ getter_AddRefs(inputStream));
+ if (NS_FAILED(result)) {
+ break;
+ }
+
+ if (!inputStream) {
+ result = NS_ERROR_FAILURE;
+ break;
+ }
+
+ *aData = inputStream.forget().take();
+ *aLen = sizeof(nsIInputStream*);
}
} break;
diff --git a/widget/windows/nsDataObj.cpp b/widget/windows/nsDataObj.cpp
index 977a87c08c..a19dcb1820 100644
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -17,7 +17,6 @@
#include "IEnumFE.h"
#include "nsPrimitiveHelpers.h"
#include "nsXPIDLString.h"
-#include "nsImageClipboard.h"
#include "nsCRT.h"
#include "nsPrintfCString.h"
#include "nsIStringBundle.h"
@@ -35,6 +34,8 @@
#include "nsIContentPolicy.h"
#include "nsContentUtils.h"
#include "nsIPrincipal.h"
+#include "nsMimeTypes.h"
+#include "imgITools.h"
#include "WinUtils.h"
#include "mozilla/LazyIdleThread.h"
@@ -45,6 +46,7 @@
using namespace mozilla;
using namespace mozilla::widget;
+#define BFH_LENGTH 14
#define DEFAULT_THREAD_TIMEOUT_MS 30000
NS_IMPL_ISUPPORTS(nsDataObj::CStream, nsIStreamListener)
@@ -917,20 +919,60 @@ nsDataObj::GetDib(const nsACString& inFlavor,
}
if ( image ) {
- // use the |nsImageToClipboard| helper class to build up a bitmap. We now own
- // the bits, and pass them back to the OS in |aSTG|.
- nsImageToClipboard converter(image, aFormat.cfFormat == CF_DIBV5);
- HANDLE bits = nullptr;
- nsresult rv = converter.GetPicture ( &bits );
- if ( NS_SUCCEEDED(rv) && bits ) {
- aSTG.hGlobal = bits;
- aSTG.tymed = TYMED_HGLOBAL;
- result = S_OK;
+ nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
+
+ nsAutoString options(NS_LITERAL_STRING("bpp=32;"));
+ if (aFormat.cfFormat == CF_DIBV5) {
+ options.AppendLiteral("version=5");
+ } else {
+ options.AppendLiteral("version=3");
+ }
+
+ nsCOMPtr<nsIInputStream> inputStream;
+ nsresult rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
+ options, getter_AddRefs(inputStream));
+ if (NS_FAILED(rv) || !inputStream) {
+ return E_FAIL;
}
- } // if we have an image
- else
+
+ nsCOMPtr<imgIEncoder> encoder = do_QueryInterface(inputStream);
+ if (!encoder) {
+ return E_FAIL;
+ }
+
+ uint32_t size = 0;
+ rv = encoder->GetImageBufferUsed(&size);
+ if (NS_FAILED(rv) || size <= BFH_LENGTH) {
+ return E_FAIL;
+ }
+
+ char *src = nullptr;
+ rv = encoder->GetImageBuffer(&src);
+ if (NS_FAILED(rv) || !src) {
+ return E_FAIL;
+ }
+
+ // We don't want the file header.
+ src += BFH_LENGTH;
+ size -= BFH_LENGTH;
+
+ HGLOBAL glob = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size);
+ if (!glob) {
+ DWORD err = ::GetLastError();
+ return E_FAIL;
+ }
+
+ char *dst = (char*) ::GlobalLock(glob);
+ ::CopyMemory(dst, src, size);
+ ::GlobalUnlock(glob);
+
+ aSTG.hGlobal = glob;
+ aSTG.tymed = TYMED_HGLOBAL;
+ result = S_OK;
+ } else {
NS_WARNING ( "Definitely not an image on clipboard" );
- return result;
+ }
+ return result;
}
@@ -1535,18 +1577,29 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
if (!image)
return E_FAIL;
- // Use the clipboard helper class to build up a memory bitmap.
- nsImageToClipboard converter(image);
- HANDLE bits = nullptr;
- rv = converter.GetPicture(&bits); // Clipboard routines return a global handle we own.
+ nsCOMPtr<imgITools> imgTools = do_CreateInstance("@mozilla.org/image/tools;1");
+ nsCOMPtr<nsIInputStream> inputStream;
+ rv = imgTools->EncodeImage(image, NS_LITERAL_CSTRING(IMAGE_BMP),
+ NS_LITERAL_STRING("bpp=32;version=3"),
+ getter_AddRefs(inputStream));
+ if (NS_FAILED(rv) || !inputStream) {
+ return E_FAIL;
+ }
+
+ nsCOMPtr<imgIEncoder> encoder = do_QueryInterface(inputStream);
+ if (!encoder) {
+ return E_FAIL;
+ }
- if (NS_FAILED(rv) || !bits)
+ uint32_t size = 0;
+ rv = encoder->GetImageBufferUsed(&size);
+ if (NS_FAILED(rv)) {
return E_FAIL;
+ }
- // We now own these bits!
- uint32_t bitmapSize = GlobalSize(bits);
- if (!bitmapSize) {
- GlobalFree(bits);
+ char *src = nullptr;
+ rv = encoder->GetImageBuffer(&src);
+ if (NS_FAILED(rv) || !src) {
return E_FAIL;
}
@@ -1554,7 +1607,6 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
nsCOMPtr<nsIFile> dropFile;
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(dropFile));
if (!dropFile) {
- GlobalFree(bits);
return E_FAIL;
}
@@ -1568,7 +1620,6 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
dropFile->AppendNative(filename);
rv = dropFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0660);
if (NS_FAILED(rv)) {
- GlobalFree(bits);
return E_FAIL;
}
@@ -1581,33 +1632,16 @@ HRESULT nsDataObj::DropImage(FORMATETC& aFE, STGMEDIUM& aSTG)
nsCOMPtr<nsIOutputStream> outStream;
rv = NS_NewLocalFileOutputStream(getter_AddRefs(outStream), dropFile);
if (NS_FAILED(rv)) {
- GlobalFree(bits);
return E_FAIL;
}
- char * bm = (char *)GlobalLock(bits);
-
- BITMAPFILEHEADER fileHdr;
- BITMAPINFOHEADER *bmpHdr = (BITMAPINFOHEADER*)bm;
-
- fileHdr.bfType = ((WORD) ('M' << 8) | 'B');
- fileHdr.bfSize = GlobalSize (bits) + sizeof(fileHdr);
- fileHdr.bfReserved1 = 0;
- fileHdr.bfReserved2 = 0;
- fileHdr.bfOffBits = (DWORD) (sizeof(fileHdr) + bmpHdr->biSize);
-
- uint32_t writeCount = 0;
- if (NS_FAILED(outStream->Write((const char *)&fileHdr, sizeof(fileHdr), &writeCount)) ||
- NS_FAILED(outStream->Write((const char *)bm, bitmapSize, &writeCount)))
- rv = NS_ERROR_FAILURE;
+ uint32_t written = 0;
+ rv = outStream->Write(src, size, &written);
+ if (NS_FAILED(rv) || written != size) {
+ return E_FAIL;
+ }
outStream->Close();
-
- GlobalUnlock(bits);
- GlobalFree(bits);
-
- if (NS_FAILED(rv))
- return E_FAIL;
}
// Pass the file name back to the drop target so that it can access the file.
diff --git a/widget/windows/nsImageClipboard.cpp b/widget/windows/nsImageClipboard.cpp
deleted file mode 100644
index fab62eab58..0000000000
--- a/widget/windows/nsImageClipboard.cpp
+++ /dev/null
@@ -1,497 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsImageClipboard.h"
-
-#include "gfxUtils.h"
-#include "mozilla/gfx/2D.h"
-#include "mozilla/gfx/DataSurfaceHelpers.h"
-#include "mozilla/RefPtr.h"
-#include "nsITransferable.h"
-#include "nsGfxCIID.h"
-#include "nsMemory.h"
-#include "prmem.h"
-#include "imgIEncoder.h"
-#include "nsLiteralString.h"
-#include "nsComponentManagerUtils.h"
-
-#define BFH_LENGTH 14
-
-using namespace mozilla;
-using namespace mozilla::gfx;
-
-/* Things To Do 11/8/00
-
-Check image metrics, can we support them? Do we need to?
-Any other render format? HTML?
-
-*/
-
-
-//
-// nsImageToClipboard ctor
-//
-// Given an imgIContainer, convert it to a DIB that is ready to go on the win32 clipboard
-//
-nsImageToClipboard::nsImageToClipboard(imgIContainer* aInImage, bool aWantDIBV5)
- : mImage(aInImage)
- , mWantDIBV5(aWantDIBV5)
-{
- // nothing to do here
-}
-
-
-//
-// nsImageToClipboard dtor
-//
-// Clean up after ourselves. We know that we have created the bitmap
-// successfully if we still have a pointer to the header.
-//
-nsImageToClipboard::~nsImageToClipboard()
-{
-}
-
-
-//
-// GetPicture
-//
-// Call to get the actual bits that go on the clipboard. If an error
-// ocurred during conversion, |outBits| will be null.
-//
-// NOTE: The caller owns the handle and must delete it with ::GlobalRelease()
-//
-nsresult
-nsImageToClipboard :: GetPicture ( HANDLE* outBits )
-{
- NS_ASSERTION ( outBits, "Bad parameter" );
-
- return CreateFromImage ( mImage, outBits );
-
-} // GetPicture
-
-
-//
-// CalcSize
-//
-// Computes # of bytes needed by a bitmap with the specified attributes.
-//
-int32_t
-nsImageToClipboard :: CalcSize ( int32_t aHeight, int32_t aColors, WORD aBitsPerPixel, int32_t aSpanBytes )
-{
- int32_t HeaderMem = sizeof(BITMAPINFOHEADER);
-
- // add size of pallette to header size
- if (aBitsPerPixel < 16)
- HeaderMem += aColors * sizeof(RGBQUAD);
-
- if (aHeight < 0)
- aHeight = -aHeight;
-
- return (HeaderMem + (aHeight * aSpanBytes));
-}
-
-
-//
-// CalcSpanLength
-//
-// Computes the span bytes for determining the overall size of the image
-//
-int32_t
-nsImageToClipboard::CalcSpanLength(uint32_t aWidth, uint32_t aBitCount)
-{
- int32_t spanBytes = (aWidth * aBitCount) >> 5;
-
- if ((aWidth * aBitCount) & 0x1F)
- spanBytes++;
- spanBytes <<= 2;
-
- return spanBytes;
-}
-
-
-//
-// CreateFromImage
-//
-// Do the work to setup the bitmap header and copy the bits out of the
-// image.
-//
-nsresult
-nsImageToClipboard::CreateFromImage ( imgIContainer* inImage, HANDLE* outBitmap )
-{
- nsresult rv;
- *outBitmap = nullptr;
-
- RefPtr<SourceSurface> surface =
- inImage->GetFrame(imgIContainer::FRAME_CURRENT,
- imgIContainer::FLAG_SYNC_DECODE);
- NS_ENSURE_TRUE(surface, NS_ERROR_FAILURE);
-
- MOZ_ASSERT(surface->GetFormat() == SurfaceFormat::B8G8R8A8 ||
- surface->GetFormat() == SurfaceFormat::B8G8R8X8);
-
- RefPtr<DataSourceSurface> dataSurface;
- if (surface->GetFormat() == SurfaceFormat::B8G8R8A8) {
- dataSurface = surface->GetDataSurface();
- } else {
- // XXXjwatt Bug 995923 - get rid of this copy and handle B8G8R8X8
- // directly below once bug 995807 is fixed.
- dataSurface = gfxUtils::
- CopySurfaceToDataSourceSurfaceWithFormat(surface,
- SurfaceFormat::B8G8R8A8);
- }
- NS_ENSURE_TRUE(dataSurface, NS_ERROR_FAILURE);
-
- nsCOMPtr<imgIEncoder> encoder = do_CreateInstance("@mozilla.org/image/encoder;2?type=image/bmp", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- uint32_t format;
- nsAutoString options;
- if (mWantDIBV5) {
- options.AppendLiteral("version=5;bpp=");
- } else {
- options.AppendLiteral("version=3;bpp=");
- }
- switch (dataSurface->GetFormat()) {
- case SurfaceFormat::B8G8R8A8:
- format = imgIEncoder::INPUT_FORMAT_HOSTARGB;
- options.AppendInt(32);
- break;
-#if 0
- // XXXjwatt Bug 995923 - fix |format| and reenable once bug 995807 is fixed.
- case SurfaceFormat::B8G8R8X8:
- format = imgIEncoder::INPUT_FORMAT_RGB;
- options.AppendInt(24);
- break;
-#endif
- default:
- NS_NOTREACHED("Unexpected surface format");
- return NS_ERROR_INVALID_ARG;
- }
-
- DataSourceSurface::MappedSurface map;
- bool mappedOK = dataSurface->Map(DataSourceSurface::MapType::READ, &map);
- NS_ENSURE_TRUE(mappedOK, NS_ERROR_FAILURE);
-
- rv = encoder->InitFromData(map.mData, 0,
- dataSurface->GetSize().width,
- dataSurface->GetSize().height,
- map.mStride,
- format, options);
- dataSurface->Unmap();
- NS_ENSURE_SUCCESS(rv, rv);
-
- uint32_t size;
- encoder->GetImageBufferUsed(&size);
- NS_ENSURE_TRUE(size > BFH_LENGTH, NS_ERROR_FAILURE);
- HGLOBAL glob = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE | GMEM_ZEROINIT,
- size - BFH_LENGTH);
- if (!glob)
- return NS_ERROR_OUT_OF_MEMORY;
-
- char *dst = (char*) ::GlobalLock(glob);
- char *src;
- rv = encoder->GetImageBuffer(&src);
- NS_ENSURE_SUCCESS(rv, rv);
-
- ::CopyMemory(dst, src + BFH_LENGTH, size - BFH_LENGTH);
- ::GlobalUnlock(glob);
-
- *outBitmap = (HANDLE)glob;
- return NS_OK;
-}
-
-nsImageFromClipboard :: nsImageFromClipboard ()
-{
- // nothing to do here
-}
-
-nsImageFromClipboard :: ~nsImageFromClipboard ( )
-{
-}
-
-//
-// GetEncodedImageStream
-//
-// Take the raw clipboard image data and convert it to aMIMEFormat in the form of a nsIInputStream
-//
-nsresult
-nsImageFromClipboard ::GetEncodedImageStream (unsigned char * aClipboardData, const char * aMIMEFormat, nsIInputStream** aInputStream )
-{
- NS_ENSURE_ARG_POINTER (aInputStream);
- NS_ENSURE_ARG_POINTER (aMIMEFormat);
- nsresult rv;
- *aInputStream = nullptr;
-
- // pull the size information out of the BITMAPINFO header and
- // initialize the image
- BITMAPINFO* header = (BITMAPINFO *) aClipboardData;
- int32_t width = header->bmiHeader.biWidth;
- int32_t height = header->bmiHeader.biHeight;
- // neg. heights mean the Y axis is inverted and we don't handle that case
- NS_ENSURE_TRUE(height > 0, NS_ERROR_FAILURE);
-
- unsigned char * rgbData = new unsigned char[width * height * 3 /* RGB */];
-
- if (rgbData) {
- BYTE * pGlobal = (BYTE *) aClipboardData;
- // Convert the clipboard image into RGB packed pixel data
- rv = ConvertColorBitMap((unsigned char *) (pGlobal + header->bmiHeader.biSize), header, rgbData);
- // if that succeeded, encode the bitmap as aMIMEFormat data. Don't return early or we risk leaking rgbData
- if (NS_SUCCEEDED(rv)) {
- nsAutoCString encoderCID(NS_LITERAL_CSTRING("@mozilla.org/image/encoder;2?type="));
-
- // Map image/jpg to image/jpeg (which is how the encoder is registered).
- if (strcmp(aMIMEFormat, kJPGImageMime) == 0)
- encoderCID.AppendLiteral("image/jpeg");
- else
- encoderCID.Append(aMIMEFormat);
- nsCOMPtr<imgIEncoder> encoder = do_CreateInstance(encoderCID.get(), &rv);
- if (NS_SUCCEEDED(rv)){
- rv = encoder->InitFromData(rgbData, 0, width, height, 3 * width /* RGB * # pixels in a row */,
- imgIEncoder::INPUT_FORMAT_RGB, EmptyString());
- if (NS_SUCCEEDED(rv)) {
- encoder.forget(aInputStream);
- }
- }
- }
- delete [] rgbData;
- }
- else
- rv = NS_ERROR_OUT_OF_MEMORY;
-
- return rv;
-} // GetImage
-
-//
-// InvertRows
-//
-// Take the image data from the clipboard and invert the rows. Modifying aInitialBuffer in place.
-//
-void
-nsImageFromClipboard::InvertRows(unsigned char * aInitialBuffer, uint32_t aSizeOfBuffer, uint32_t aNumBytesPerRow)
-{
- if (!aNumBytesPerRow)
- return;
-
- uint32_t numRows = aSizeOfBuffer / aNumBytesPerRow;
- unsigned char * row = new unsigned char[aNumBytesPerRow];
-
- uint32_t currentRow = 0;
- uint32_t lastRow = (numRows - 1) * aNumBytesPerRow;
- while (currentRow < lastRow)
- {
- // store the current row into a temporary buffer
- memcpy(row, &aInitialBuffer[currentRow], aNumBytesPerRow);
- memcpy(&aInitialBuffer[currentRow], &aInitialBuffer[lastRow], aNumBytesPerRow);
- memcpy(&aInitialBuffer[lastRow], row, aNumBytesPerRow);
- lastRow -= aNumBytesPerRow;
- currentRow += aNumBytesPerRow;
- }
-
- delete[] row;
-}
-
-//
-// ConvertColorBitMap
-//
-// Takes the clipboard bitmap and converts it into a RGB packed pixel values.
-//
-nsresult
-nsImageFromClipboard::ConvertColorBitMap(unsigned char * aInputBuffer, PBITMAPINFO pBitMapInfo, unsigned char * aOutBuffer)
-{
- uint8_t bitCount = pBitMapInfo->bmiHeader.biBitCount;
- uint32_t imageSize = pBitMapInfo->bmiHeader.biSizeImage; // may be zero for BI_RGB bitmaps which means we need to calculate by hand
- uint32_t bytesPerPixel = bitCount / 8;
-
- if (bitCount <= 4)
- bytesPerPixel = 1;
-
- // rows are DWORD aligned. Calculate how many real bytes are in each row in the bitmap. This number won't
- // correspond to biWidth.
- uint32_t rowSize = (bitCount * pBitMapInfo->bmiHeader.biWidth + 7) / 8; // +7 to round up
- if (rowSize % 4)
- rowSize += (4 - (rowSize % 4)); // Pad to DWORD Boundary
-
- // if our buffer includes a color map, skip over it
- if (bitCount <= 8)
- {
- int32_t bytesToSkip = (pBitMapInfo->bmiHeader.biClrUsed ? pBitMapInfo->bmiHeader.biClrUsed : (1 << bitCount) ) * sizeof(RGBQUAD);
- aInputBuffer += bytesToSkip;
- }
-
- bitFields colorMasks; // only used if biCompression == BI_BITFIELDS
-
- if (pBitMapInfo->bmiHeader.biCompression == BI_BITFIELDS)
- {
- // color table consists of 3 DWORDS containing the color masks...
- colorMasks.red = (*((uint32_t*)&(pBitMapInfo->bmiColors[0])));
- colorMasks.green = (*((uint32_t*)&(pBitMapInfo->bmiColors[1])));
- colorMasks.blue = (*((uint32_t*)&(pBitMapInfo->bmiColors[2])));
- CalcBitShift(&colorMasks);
- aInputBuffer += 3 * sizeof(DWORD);
- }
- else if (pBitMapInfo->bmiHeader.biCompression == BI_RGB && !imageSize) // BI_RGB can have a size of zero which means we figure it out
- {
- // XXX: note use rowSize here and not biWidth. rowSize accounts for the DWORD padding for each row
- imageSize = rowSize * pBitMapInfo->bmiHeader.biHeight;
- }
-
- // The windows clipboard image format inverts the rows
- InvertRows(aInputBuffer, imageSize, rowSize);
-
- if (!pBitMapInfo->bmiHeader.biCompression || pBitMapInfo->bmiHeader.biCompression == BI_BITFIELDS)
- {
- uint32_t index = 0;
- uint32_t writeIndex = 0;
-
- unsigned char redValue, greenValue, blueValue;
- uint8_t colorTableEntry = 0;
- int8_t bit; // used for grayscale bitmaps where each bit is a pixel
- uint32_t numPixelsLeftInRow = pBitMapInfo->bmiHeader.biWidth; // how many more pixels do we still need to read for the current row
- uint32_t pos = 0;
-
- while (index < imageSize)
- {
- switch (bitCount)
- {
- case 1:
- for (bit = 7; bit >= 0 && numPixelsLeftInRow; bit--)
- {
- colorTableEntry = (aInputBuffer[index] >> bit) & 1;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbRed;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbGreen;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbBlue;
- numPixelsLeftInRow--;
- }
- pos += 1;
- break;
- case 4:
- {
- // each aInputBuffer[index] entry contains data for two pixels.
- // read the first pixel
- colorTableEntry = aInputBuffer[index] >> 4;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbRed;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbGreen;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbBlue;
- numPixelsLeftInRow--;
-
- if (numPixelsLeftInRow) // now read the second pixel
- {
- colorTableEntry = aInputBuffer[index] & 0xF;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbRed;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbGreen;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[colorTableEntry].rgbBlue;
- numPixelsLeftInRow--;
- }
- pos += 1;
- }
- break;
- case 8:
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[aInputBuffer[index]].rgbRed;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[aInputBuffer[index]].rgbGreen;
- aOutBuffer[writeIndex++] = pBitMapInfo->bmiColors[aInputBuffer[index]].rgbBlue;
- numPixelsLeftInRow--;
- pos += 1;
- break;
- case 16:
- {
- uint16_t num = 0;
- num = (uint8_t) aInputBuffer[index+1];
- num <<= 8;
- num |= (uint8_t) aInputBuffer[index];
-
- redValue = ((uint32_t) (((float)(num & 0xf800) / 0xf800) * 0xFF0000) & 0xFF0000)>> 16;
- greenValue = ((uint32_t)(((float)(num & 0x07E0) / 0x07E0) * 0x00FF00) & 0x00FF00)>> 8;
- blueValue = ((uint32_t)(((float)(num & 0x001F) / 0x001F) * 0x0000FF) & 0x0000FF);
-
- // now we have the right RGB values...
- aOutBuffer[writeIndex++] = redValue;
- aOutBuffer[writeIndex++] = greenValue;
- aOutBuffer[writeIndex++] = blueValue;
- numPixelsLeftInRow--;
- pos += 2;
- }
- break;
- case 32:
- case 24:
- if (pBitMapInfo->bmiHeader.biCompression == BI_BITFIELDS)
- {
- uint32_t val = *((uint32_t*) (aInputBuffer + index) );
- aOutBuffer[writeIndex++] = (val & colorMasks.red) >> colorMasks.redRightShift << colorMasks.redLeftShift;
- aOutBuffer[writeIndex++] = (val & colorMasks.green) >> colorMasks.greenRightShift << colorMasks.greenLeftShift;
- aOutBuffer[writeIndex++] = (val & colorMasks.blue) >> colorMasks.blueRightShift << colorMasks.blueLeftShift;
- numPixelsLeftInRow--;
- pos += 4; // we read in 4 bytes of data in order to process this pixel
- }
- else
- {
- aOutBuffer[writeIndex++] = aInputBuffer[index+2];
- aOutBuffer[writeIndex++] = aInputBuffer[index+1];
- aOutBuffer[writeIndex++] = aInputBuffer[index];
- numPixelsLeftInRow--;
- pos += bytesPerPixel; // 3 bytes for 24 bit data, 4 bytes for 32 bit data (we skip over the 4th byte)...
- }
- break;
- default:
- // This is probably the wrong place to check this...
- return NS_ERROR_FAILURE;
- }
-
- index += bytesPerPixel; // increment our loop counter
-
- if (!numPixelsLeftInRow)
- {
- if (rowSize != pos)
- {
- // advance index to skip over remaining padding bytes
- index += (rowSize - pos);
- }
- numPixelsLeftInRow = pBitMapInfo->bmiHeader.biWidth;
- pos = 0;
- }
-
- } // while we still have bytes to process
- }
-
- return NS_OK;
-}
-
-void nsImageFromClipboard::CalcBitmask(uint32_t aMask, uint8_t& aBegin, uint8_t& aLength)
-{
- // find the rightmost 1
- uint8_t pos;
- bool started = false;
- aBegin = aLength = 0;
- for (pos = 0; pos <= 31; pos++)
- {
- if (!started && (aMask & (1 << pos)))
- {
- aBegin = pos;
- started = true;
- }
- else if (started && !(aMask & (1 << pos)))
- {
- aLength = pos - aBegin;
- break;
- }
- }
-}
-
-void nsImageFromClipboard::CalcBitShift(bitFields * aColorMask)
-{
- uint8_t begin, length;
- // red
- CalcBitmask(aColorMask->red, begin, length);
- aColorMask->redRightShift = begin;
- aColorMask->redLeftShift = 8 - length;
- // green
- CalcBitmask(aColorMask->green, begin, length);
- aColorMask->greenRightShift = begin;
- aColorMask->greenLeftShift = 8 - length;
- // blue
- CalcBitmask(aColorMask->blue, begin, length);
- aColorMask->blueRightShift = begin;
- aColorMask->blueLeftShift = 8 - length;
-}
diff --git a/widget/windows/nsImageClipboard.h b/widget/windows/nsImageClipboard.h
deleted file mode 100644
index 25b33cc56c..0000000000
--- a/widget/windows/nsImageClipboard.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsImageClipboard_h
-#define nsImageClipboard_h
-
-/* Things To Do 11/8/00
-
-Check image metrics, can we support them? Do we need to?
-Any other render format? HTML?
-
-*/
-
-#include "nsError.h"
-#include <windows.h>
-
-#include "nsCOMPtr.h"
-#include "imgIContainer.h"
-#include "nsIInputStream.h"
-
-
-//
-// nsImageToClipboard
-//
-// A utility class that takes an imgIContainer and does all the bitmap magic
-// to allow us to put it on the clipboard
-//
-class nsImageToClipboard
-{
-public:
- nsImageToClipboard(imgIContainer* aInImage, bool aWantDIBV5 = true);
- ~nsImageToClipboard();
-
- // Call to get the actual bits that go on the clipboard. If |nullptr|, the
- // setup operations have failed.
- //
- // NOTE: The caller owns the handle and must delete it with ::GlobalRelease()
- nsresult GetPicture ( HANDLE* outBits ) ;
-
-private:
-
- // Computes # of bytes needed by a bitmap with the specified attributes.
- int32_t CalcSize(int32_t aHeight, int32_t aColors, WORD aBitsPerPixel, int32_t aSpanBytes);
- int32_t CalcSpanLength(uint32_t aWidth, uint32_t aBitCount);
-
- // Do the work
- nsresult CreateFromImage ( imgIContainer* inImage, HANDLE* outBitmap );
-
- nsCOMPtr<imgIContainer> mImage; // the image we're working with
- bool mWantDIBV5;
-
-}; // class nsImageToClipboard
-
-
-struct bitFields {
- uint32_t red;
- uint32_t green;
- uint32_t blue;
- uint8_t redLeftShift;
- uint8_t redRightShift;
- uint8_t greenLeftShift;
- uint8_t greenRightShift;
- uint8_t blueLeftShift;
- uint8_t blueRightShift;
-};
-
-//
-// nsImageFromClipboard
-//
-// A utility class that takes a DIB from the win32 clipboard and does
-// all the bitmap magic to convert it to a PNG or a JPEG in the form of a nsIInputStream
-//
-class nsImageFromClipboard
-{
-public:
- nsImageFromClipboard () ;
- ~nsImageFromClipboard ( ) ;
-
- // Retrieve the newly created image
- nsresult GetEncodedImageStream (unsigned char * aClipboardData, const char * aMIMEFormat, nsIInputStream** outImage);
-
-private:
-
- void InvertRows(unsigned char * aInitialBuffer, uint32_t aSizeOfBuffer, uint32_t aNumBytesPerRow);
- nsresult ConvertColorBitMap(unsigned char * aInputBuffer, PBITMAPINFO pBitMapInfo, unsigned char * aOutBuffer);
- void CalcBitmask(uint32_t aMask, uint8_t& aBegin, uint8_t& aLength);
- void CalcBitShift(bitFields * aColorMask);
-
-}; // nsImageFromClipboard
-
-#endif
diff --git a/widget/windows/nsNativeThemeWin.cpp b/widget/windows/nsNativeThemeWin.cpp
index 475ebce945..e84a2b80ce 100644
--- a/widget/windows/nsNativeThemeWin.cpp
+++ b/widget/windows/nsNativeThemeWin.cpp
@@ -8,6 +8,7 @@
#include "mozilla/EventStates.h"
#include "mozilla/Logging.h"
#include "mozilla/WindowsVersion.h"
+#include "mozilla/gfx/Types.h" // for Color::FromABGR
#include "nsDeviceContext.h"
#include "nsRenderingContext.h"
#include "nsRect.h"
@@ -40,6 +41,7 @@
#include <algorithm>
using namespace mozilla;
+using namespace mozilla::gfx;
using namespace mozilla::widget;
extern mozilla::LazyLogModule gWindowsLog;
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
index d6dc26954c..06ed423263 100644
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -2265,7 +2265,7 @@ CCGraphBuilder::BuildGraph(SliceBudget& aBudget)
SetFirstChild();
if (pi->mParticipant) {
- nsresult rv = pi->mParticipant->Traverse(pi->mPointer, *this);
+ nsresult rv = pi->mParticipant->TraverseNativeAndJS(pi->mPointer, *this);
MOZ_RELEASE_ASSERT(!NS_FAILED(rv), "Cycle collector Traverse method failed");
}
@@ -2539,7 +2539,7 @@ static bool
MayHaveChild(void* aObj, nsCycleCollectionParticipant* aCp)
{
ChildFinder cf;
- aCp->Traverse(aObj, cf);
+ aCp->TraverseNativeAndJS(aObj, cf);
return cf.MayHaveChild();
}
@@ -2596,7 +2596,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(JSPurpleBuffer)
CycleCollectionNoteChild(cb, tmp, "self");
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
#define NS_TRACE_SEGMENTED_ARRAY(_field, _type) \
diff --git a/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp b/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp
index 7c48002e30..f65a92e617 100644
--- a/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp
+++ b/xpcom/base/nsCycleCollectorTraceJSHelpers.cpp
@@ -21,8 +21,9 @@ CycleCollectionNoteEdgeNameImpl(nsCycleCollectionTraversalCallback& aCallback,
}
void
-nsScriptObjectTracer::NoteJSChild(JS::GCCellPtr aGCThing, const char* aName,
- void* aClosure)
+nsCycleCollectionParticipant::NoteJSChild(JS::GCCellPtr aGCThing,
+ const char* aName,
+ void* aClosure)
{
nsCycleCollectionTraversalCallback* cb =
static_cast<nsCycleCollectionTraversalCallback*>(aClosure);
diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp
index 96487acda9..a81eb3d712 100644
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -450,12 +450,6 @@ RealBreak()
".object_arch armv4t\n"
#endif
"BKPT #0");
-#elif defined(SOLARIS)
-#if defined(__i386__) || defined(__i386) || defined(__x86_64__)
- asm("int $3");
-#else
- raise(SIGTRAP);
-#endif
#else
#warning do not know how to break on this platform
#endif
@@ -530,8 +524,6 @@ Break(const char* aMsg)
RealBreak();
#elif defined(__arm__)
RealBreak();
-#elif defined(SOLARIS)
- RealBreak();
#else
#warning do not know how to break on this platform
#endif
diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp
index bfeda063bb..88964f9b53 100644
--- a/xpcom/base/nsMemoryReporterManager.cpp
+++ b/xpcom/base/nsMemoryReporterManager.cpp
@@ -317,85 +317,6 @@ VsizeMaxContiguousDistinguishedAmount(int64_t* aN)
}
#endif // FreeBSD
-#elif defined(SOLARIS)
-
-#include <procfs.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-static void
-XMappingIter(int64_t& aVsize, int64_t& aResident)
-{
- aVsize = -1;
- aResident = -1;
- int mapfd = open("/proc/self/xmap", O_RDONLY);
- struct stat st;
- prxmap_t* prmapp = nullptr;
- if (mapfd >= 0) {
- if (!fstat(mapfd, &st)) {
- int nmap = st.st_size / sizeof(prxmap_t);
- while (1) {
- // stat(2) on /proc/<pid>/xmap returns an incorrect value,
- // prior to the release of Solaris 11.
- // Here is a workaround for it.
- nmap *= 2;
- prmapp = (prxmap_t*)malloc((nmap + 1) * sizeof(prxmap_t));
- if (!prmapp) {
- // out of memory
- break;
- }
- int n = pread(mapfd, prmapp, (nmap + 1) * sizeof(prxmap_t), 0);
- if (n < 0) {
- break;
- }
- if (nmap >= n / sizeof(prxmap_t)) {
- aVsize = 0;
- aResident = 0;
- for (int i = 0; i < n / sizeof(prxmap_t); i++) {
- aVsize += prmapp[i].pr_size;
- aResident += prmapp[i].pr_rss * prmapp[i].pr_pagesize;
- }
- break;
- }
- free(prmapp);
- }
- free(prmapp);
- }
- close(mapfd);
- }
-}
-
-#define HAVE_VSIZE_AND_RESIDENT_REPORTERS 1
-static MOZ_MUST_USE nsresult
-VsizeDistinguishedAmount(int64_t* aN)
-{
- int64_t vsize, resident;
- XMappingIter(vsize, resident);
- if (vsize == -1) {
- return NS_ERROR_FAILURE;
- }
- *aN = vsize;
- return NS_OK;
-}
-
-static MOZ_MUST_USE nsresult
-ResidentDistinguishedAmount(int64_t* aN)
-{
- int64_t vsize, resident;
- XMappingIter(vsize, resident);
- if (resident == -1) {
- return NS_ERROR_FAILURE;
- }
- *aN = resident;
- return NS_OK;
-}
-
-static MOZ_MUST_USE nsresult
-ResidentFastDistinguishedAmount(int64_t* aN)
-{
- return ResidentDistinguishedAmount(aN);
-}
-
#elif defined(XP_MACOSX)
#include <mach/mach_init.h>
@@ -1145,13 +1066,9 @@ ResidentPeakDistinguishedAmount(int64_t* aN)
if (0 == getrusage(RUSAGE_SELF, &usage)) {
// The units for ru_maxrrs:
// - Mac: bytes
- // - Solaris: pages? But some sources it actually always returns 0, so
- // check for that
// - Linux, {Net/Open/Free}BSD, DragonFly: KiB
#ifdef XP_MACOSX
*aN = usage.ru_maxrss;
-#elif defined(SOLARIS)
- *aN = usage.ru_maxrss * getpagesize();
#else
*aN = usage.ru_maxrss * 1024;
#endif
diff --git a/xpcom/base/nsObjCExceptions.h b/xpcom/base/nsObjCExceptions.h
index b3ed532ec4..e542a22f82 100644
--- a/xpcom/base/nsObjCExceptions.h
+++ b/xpcom/base/nsObjCExceptions.h
@@ -13,10 +13,6 @@
#import <Foundation/Foundation.h>
-#ifdef DEBUG
-#import <ExceptionHandling/NSExceptionHandler.h>
-#endif
-
#include <unistd.h>
#include <signal.h>
#include "nsError.h"
@@ -40,80 +36,6 @@ nsObjCExceptionLog(NSException* aException)
{
NSLog(@"Mozilla has caught an Obj-C exception [%@: %@]",
[aException name], [aException reason]);
-
-#ifdef DEBUG
- @try {
- // Try to get stack information out of the exception. 10.5 returns the stack
- // info with the callStackReturnAddresses selector.
- NSArray* stackTrace = nil;
- if ([aException respondsToSelector:@selector(callStackReturnAddresses)]) {
- NSArray* addresses = (NSArray*)
- [aException performSelector:@selector(callStackReturnAddresses)];
- if ([addresses count]) {
- stackTrace = addresses;
- }
- }
-
- // 10.4 doesn't respond to callStackReturnAddresses so we'll try to pull the
- // stack info out of the userInfo. It might not be there, sadly :(
- if (!stackTrace) {
- stackTrace = [[aException userInfo] objectForKey:NSStackTraceKey];
- }
-
- if (stackTrace) {
- // The command line should look like this:
- // /usr/bin/atos -p <pid> -printHeader <stack frame addresses>
- NSMutableArray* args =
- [NSMutableArray arrayWithCapacity:[stackTrace count] + 3];
-
- [args addObject:@"-p"];
- int pid = [[NSProcessInfo processInfo] processIdentifier];
- [args addObject:[NSString stringWithFormat:@"%d", pid]];
-
- [args addObject:@"-printHeader"];
-
- unsigned int stackCount = [stackTrace count];
- unsigned int stackIndex = 0;
- for (; stackIndex < stackCount; stackIndex++) {
- unsigned long address =
- [[stackTrace objectAtIndex:stackIndex] unsignedLongValue];
- [args addObject:[NSString stringWithFormat:@"0x%lx", address]];
- }
-
- NSPipe* outPipe = [NSPipe pipe];
-
- NSTask* task = [[NSTask alloc] init];
- [task setLaunchPath:@"/usr/bin/atos"];
- [task setArguments:args];
- [task setStandardOutput:outPipe];
- [task setStandardError:outPipe];
-
- NSLog(@"Generating stack trace for Obj-C exception...");
-
- // This will throw an exception if the atos tool cannot be found, and in
- // that case we'll just hit our @catch block below.
- [task launch];
-
- [task waitUntilExit];
- [task release];
-
- NSData* outData =
- [[outPipe fileHandleForReading] readDataToEndOfFile];
- NSString* outString =
- [[NSString alloc] initWithData:outData encoding:NSUTF8StringEncoding];
-
- NSLog(@"Stack trace:\n%@", outString);
-
- [outString release];
- } else {
- NSLog(@"<No stack information available for Obj-C exception>");
- }
- }
- @catch (NSException* exn) {
- NSLog(@"Failed to generate stack trace for Obj-C exception [%@: %@]",
- [exn name], [exn reason]);
- }
-#endif
}
__attribute__((unused))
diff --git a/xpcom/build/nsXPCOMPrivate.h b/xpcom/build/nsXPCOMPrivate.h
index 99a9940133..143ed034ec 100644
--- a/xpcom/build/nsXPCOMPrivate.h
+++ b/xpcom/build/nsXPCOMPrivate.h
@@ -281,10 +281,6 @@ void LogTerm();
#error need_to_define_your_file_path_separator_and_illegal_characters
#endif
-#ifdef AIX
-#include <sys/param.h>
-#endif
-
#ifndef MAXPATHLEN
#ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
diff --git a/xpcom/ds/nsMathUtils.h b/xpcom/ds/nsMathUtils.h
index b10b8144e9..cbbd38611a 100644
--- a/xpcom/ds/nsMathUtils.h
+++ b/xpcom/ds/nsMathUtils.h
@@ -11,10 +11,6 @@
#include <cmath>
#include <float.h>
-#ifdef SOLARIS
-#include <ieeefp.h>
-#endif
-
/*
* round
*/
diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h
index 2dfbb6750e..5d03acd26f 100644
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -113,11 +113,38 @@ private:
class NS_NO_VTABLE nsCycleCollectionParticipant
{
public:
- constexpr nsCycleCollectionParticipant() : mMightSkip(false) {}
- constexpr explicit nsCycleCollectionParticipant(bool aSkip) : mMightSkip(aSkip) {}
+ constexpr nsCycleCollectionParticipant()
+ : mMightSkip(false)
+ , mTraverseShouldTrace(false)
+ {
+ }
+
+ constexpr explicit nsCycleCollectionParticipant(bool aSkip,
+ bool aTraverseShouldTrace = false)
+ : mMightSkip(aSkip)
+ , mTraverseShouldTrace(aTraverseShouldTrace)
+ {
+ }
NS_IMETHOD Traverse(void* aPtr, nsCycleCollectionTraversalCallback& aCb) = 0;
+ nsresult TraverseNativeAndJS(void* aPtr,
+ nsCycleCollectionTraversalCallback& aCb)
+ {
+ nsresult rv = Traverse(aPtr, aCb);
+ if (mTraverseShouldTrace) {
+ // Note, we always call Trace, even if Traverse returned
+ // NS_SUCCESS_INTERRUPTED_TRAVERSE.
+ TraceCallbackFunc noteJsChild(&nsCycleCollectionParticipant::NoteJSChild);
+ Trace(aPtr, noteJsChild, &aCb);
+ }
+ return rv;
+ }
+
+ // Implemented in nsCycleCollectorTraceJSHelpers.cpp.
+ static void NoteJSChild(JS::GCCellPtr aGCThing, const char* aName,
+ void* aClosure);
+
NS_IMETHOD_(void) Root(void* aPtr) = 0;
NS_IMETHOD_(void) Unlink(void* aPtr) = 0;
NS_IMETHOD_(void) Unroot(void* aPtr) = 0;
@@ -172,26 +199,24 @@ protected:
private:
const bool mMightSkip;
+ const bool mTraverseShouldTrace;
};
class NS_NO_VTABLE nsScriptObjectTracer : public nsCycleCollectionParticipant
{
public:
constexpr nsScriptObjectTracer()
- : nsCycleCollectionParticipant(false)
+ : nsCycleCollectionParticipant(false, true)
{
}
constexpr explicit nsScriptObjectTracer(bool aSkip)
- : nsCycleCollectionParticipant(aSkip)
+ : nsCycleCollectionParticipant(aSkip, true)
{
}
NS_IMETHOD_(void) Trace(void* aPtr, const TraceCallbacks& aCb,
void* aClosure) override = 0;
- // Implemented in nsCycleCollectorTraceJSHelpers.cpp.
- static void NoteJSChild(JS::GCCellPtr aGCThing, const char* aName,
- void* aClosure);
};
class NS_NO_VTABLE nsXPCOMCycleCollectionParticipant : public nsScriptObjectTracer
@@ -440,12 +465,6 @@ DowncastCCParticipant(void* aPtr)
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(_field) \
CycleCollectionNoteChild(cb, tmp->_field, #_field);
-#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS \
- { \
- TraceCallbackFunc noteJsChild(&nsScriptObjectTracer::NoteJSChild); \
- Trace(p, noteJsChild, &cb); \
- }
-
#define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END \
(void)tmp; \
return NS_OK; \
diff --git a/xpcom/glue/nsTArray.h b/xpcom/glue/nsTArray.h
index 82586a79a7..64af17bbb3 100644
--- a/xpcom/glue/nsTArray.h
+++ b/xpcom/glue/nsTArray.h
@@ -1503,6 +1503,24 @@ public:
mozilla::Forward<Item>(aItem));
}
+ // Reconstruct the element at the given index, and return a pointer to the
+ // reconstructed element. This will destroy the existing element and
+ // default-construct a new one, giving you a state much like what single-arg
+ // InsertElementAt(), or no-arg AppendElement() does, but without changing the
+ // length of the array.
+ //
+ // array[idx] = T()
+ //
+ // would accomplish the same thing as long as T has the appropriate moving
+ // operator=, but some types don't for various reasons.
+ elem_type* ReconstructElementAt(index_type aIndex)
+ {
+ elem_type* elem = &ElementAt(aIndex);
+ elem_traits::Destruct(elem);
+ elem_traits::Construct(elem);
+ return elem;
+ }
+
// This method searches for the smallest index of an element that is strictly
// greater than |aItem|. If |aItem| is inserted at this index, the array will
// remain sorted and |aItem| would come after all elements that are equal to
diff --git a/xpcom/io/nsLocalFile.h b/xpcom/io/nsLocalFile.h
index f7bdb86f7e..a8e0a12796 100644
--- a/xpcom/io/nsLocalFile.h
+++ b/xpcom/io/nsLocalFile.h
@@ -91,15 +91,8 @@ nsresultForErrno(int aErr)
case EROFS: /* Read-only file system. */
return NS_ERROR_FILE_READ_ONLY;
#endif
- /*
- * On AIX 4.3, ENOTEMPTY is defined as EEXIST,
- * so there can't be cases for both without
- * preprocessing.
- */
-#if ENOTEMPTY != EEXIST
case ENOTEMPTY:
return NS_ERROR_FILE_DIR_NOT_EMPTY;
-#endif /* ENOTEMPTY != EEXIST */
/* Note that nsIFile.createUnique() returns
NS_ERROR_FILE_TOO_BIG when it cannot create a temporary
file with a unique filename.
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
index 194e5835e7..272153bbab 100644
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -1591,22 +1591,6 @@ nsLocalFile::IsExecutable(bool* aResult)
// Then check the execute bit.
*aResult = (access(mPath.get(), X_OK) == 0);
-#ifdef SOLARIS
- // On Solaris, access will always return 0 for root user, however
- // the file is only executable if S_IXUSR | S_IXGRP | S_IXOTH is set.
- // See bug 351950, https://bugzilla.mozilla.org/show_bug.cgi?id=351950
- if (*aResult) {
- struct STAT buf;
-
- *aResult = (STAT(mPath.get(), &buf) == 0);
- if (*aResult || errno == EACCES) {
- *aResult = *aResult && (buf.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH));
- return NS_OK;
- }
-
- return NSRESULT_FOR_ERRNO();
- }
-#endif
if (*aResult || errno == EACCES) {
return NS_OK;
}
diff --git a/xpcom/io/nsLocalFileUnix.h b/xpcom/io/nsLocalFileUnix.h
index 9a3e7d6afe..5ef581ed1a 100644
--- a/xpcom/io/nsLocalFileUnix.h
+++ b/xpcom/io/nsLocalFileUnix.h
@@ -65,11 +65,6 @@
// stat64 and lstat64 are deprecated on OS X. Normal stat and lstat are
// 64-bit by default on OS X 10.6+.
#if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && !defined(XP_DARWIN)
- #if defined (AIX)
- #if defined STAT
- #undef STAT
- #endif
- #endif
#define STAT stat64
#define LSTAT lstat64
#define HAVE_STATS64 1
diff --git a/xpcom/reflect/xptcall/md/unix/Makefile.in b/xpcom/reflect/xptcall/md/unix/Makefile.in
index 716d79623a..4a5bc6f02f 100644
--- a/xpcom/reflect/xptcall/md/unix/Makefile.in
+++ b/xpcom/reflect/xptcall/md/unix/Makefile.in
@@ -24,13 +24,6 @@ endif
# PowerPC
######################################################################
#
-# AIX/PPC
-#
-ifeq ($(OS_ARCH),AIX)
-# #24617 Building the CPP's (CXX) optimized causes a crash
-CXXFLAGS := $(filter-out $(MOZ_OPTIMIZE_FLAGS), $(CXXFLAGS))
-endif
-
include $(topsrcdir)/config/rules.mk
ifeq ($(OS_ARCH),Linux)
@@ -43,26 +36,3 @@ ifeq ($(OS_ARCH),Darwin)
xptcstubs_asm_ppc_darwin.s: xptcstubs_asm_ppc_darwin.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
gm4 $(INCLUDES) $< > $@
endif
-
-ifeq ($(OS_ARCH),AIX)
-ifdef HAVE_64BIT_BUILD
-xptcstubs_asm_ppc_aix64.s: xptcstubs_asm_ppc_aix64.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
- m4 -DAIX_OBJMODEL=$(AIX_OBJMODEL) $(INCLUDES) -I. $< > $@
-else
-xptcstubs_asm_ppc_aix.s: xptcstubs_asm_ppc_aix.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
- m4 -DAIX_OBJMODEL=$(AIX_OBJMODEL) $(INCLUDES) -I. $< > $@
-endif
-endif
-
-ifeq ($(OS_ARCH),SunOS)
-ifeq (86,$(findstring 86,$(OS_TEST)))
-ifndef GNU_CC
-xptcstubsdef_asm.solx86: $(DIST)/include/xptcstubsdef.inc
- sed \
- -e 's/^\(STUB_ENTRY\)(\([0-9]\))/\11\(\2\)/' \
- -e 's/^\(STUB_ENTRY\)(\([0-9][0-9]\))/\12\(\2\)/' \
- -e 's/^\(STUB_ENTRY\)(\([0-9][0-9][0-9]\))/\13\(\2\)/' \
- $(DIST)/include/xptcstubsdef.inc > $@
-endif
-endif
-endif
diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build
index 148d3bf351..d455ed8549 100644
--- a/xpcom/reflect/xptcall/md/unix/moz.build
+++ b/xpcom/reflect/xptcall/md/unix/moz.build
@@ -46,36 +46,6 @@ if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'):
'xptcstubs_ipf64.cpp'
]
-if CONFIG['OS_ARCH'] == 'SunOS' and '86' in CONFIG['OS_TEST']:
- GENERATED_FILES = [
- 'xptcstubsdef_asm.solx86',
- ]
- if CONFIG['OS_TEST'] == 'x86_64':
- if CONFIG['GNU_CC']:
- SOURCES += [
- 'xptcinvoke_x86_64_unix.cpp',
- 'xptcstubs_x86_64_linux.cpp'
- ]
- else:
- ASFLAGS += ['-xarch=amd64']
- SOURCES += [
- 'xptcinvoke_x86_64_solaris.cpp',
- 'xptcstubs_asm_x86_64_solaris_SUNW.s',
- 'xptcstubs_x86_64_solaris.cpp',
- ]
- else:
- if CONFIG['GNU_CC']:
- SOURCES += [
- 'xptcinvoke_gcc_x86_unix.cpp',
- 'xptcstubs_gcc_x86_unix.cpp'
- ]
- else:
- SOURCES += [
- 'xptcinvoke_asm_x86_solaris_SUNW.s',
- 'xptcinvoke_x86_solaris.cpp',
- 'xptcstubs_asm_x86_solaris_SUNW.s',
- 'xptcstubs_x86_solaris.cpp'
- ]
if CONFIG['OS_TEST'] == 'alpha':
if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD'):
@@ -157,29 +127,6 @@ if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD', 'NetBSD', 'OpenBSD'):
'xptcstubs_mips.cpp',
]
-if CONFIG['OS_ARCH'] == 'AIX':
- if CONFIG['HAVE_64BIT_BUILD']:
- SOURCES += [
- '!xptcstubs_asm_ppc_aix64.s',
- 'xptcinvoke_asm_ppc_aix64.s',
- 'xptcinvoke_ppc_aix64.cpp',
- 'xptcstubs_ppc_aix64.cpp',
- ]
- else:
- SOURCES += [
- '!xptcstubs_asm_ppc_aix.s',
- 'xptcinvoke_ppc_aix.cpp',
- 'xptcstubs_ppc_aix.cpp',
- ]
- if CONFIG['AIX_OBJMODEL'] == 'ibm':
- SOURCES += [
- 'xptcinvoke_asm_ppc_ibmobj_aix.s',
- ]
- else:
- SOURCES += [
- 'xptcinvoke_asm_ppc_aix.s',
- ]
-
if CONFIG['OS_TEST'] == 'powerpc':
if CONFIG['OS_ARCH'] in ('Linux', 'FreeBSD'):
SOURCES += [
@@ -247,35 +194,6 @@ if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD') and CONFIG['OS_TEST'] == 'sparc64
'xptcstubs_sparc64_openbsd.cpp',
]
-if CONFIG['OS_ARCH'] == 'SunOS' and '86' not in CONFIG['OS_TEST']:
- if CONFIG['HAVE_64BIT_BUILD']:
- ASFLAGS += ['-xarch=v9']
- SOURCES += [
- 'xptcinvoke_sparcv9_solaris.cpp',
- 'xptcstubs_sparcv9_solaris.cpp',
- ]
- else:
- SOURCES += [
- 'xptcinvoke_sparc_solaris.cpp',
- 'xptcstubs_sparc_solaris.cpp',
- ]
- if CONFIG['GNU_CC']:
- SOURCES += [
- 'xptcinvoke_asm_sparc_solaris_GCC3.s',
- 'xptcstubs_asm_sparc_solaris.s',
- ]
- else:
- if CONFIG['HAVE_64BIT_BUILD']:
- SOURCES += [
- 'xptcinvoke_asm_sparcv9_solaris_SUNW.s',
- 'xptcstubs_asm_sparcv9_solaris.s',
- ]
- else:
- SOURCES += [
- 'xptcinvoke_asm_sparc_solaris_SUNW.s',
- 'xptcstubs_asm_sparc_solaris.s',
- ]
-
if CONFIG['OS_ARCH'] == 'Linux':
if CONFIG['OS_TEST'] == 's390':
SOURCES += [
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix.s
deleted file mode 100644
index eb6b6661d3..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix.s
+++ /dev/null
@@ -1,129 +0,0 @@
-#
-# -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
-.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
-.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
-.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
-.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
-.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
-.set r30,30; .set r31,31
-.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
-.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
-.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
-.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
-.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
-.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
-.set f30,30; .set f31,31
-.set BO_IF,12
-.set CR0_EQ,2
-
-
-
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.NS_InvokeByIndex{TC},"NS_InvokeByIndex"
-
-
-# .text section
-
- .csect H.10.NO_SYMBOL{PR}
- .globl .NS_InvokeByIndex
- .globl NS_InvokeByIndex{DS}
- .extern .invoke_copy_to_stack
- .extern ._ptrgl{PR}
-
-
-#
-# NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
-# uint32_t paramCount, nsXPTCVariant* params)
-#
-
-.NS_InvokeByIndex:
- mflr r0
- stw r31,-4(sp)
-#
-# save off the incoming values in the caller's parameter area
-#
- stw r3,24(sp) # that
- stw r4,28(sp) # methodIndex
- stw r5,32(sp) # paramCount
- stw r6,36(sp) # params
- stw r0,8(sp)
- stwu sp,-136(sp) # = 24 for linkage area, 8 * 13 for fprData area, 8 for saved registers
-
-# prepare args for 'invoke_copy_to_stack' call
-#
- lwz r4,168(sp) # paramCount
- lwz r5,172(sp) # params
- mr r6,sp # fprData
- slwi r3,r4,3 # number of bytes of stack required
- # at most 8*paramCount
- addi r3,r3,28 # linkage area
- mr r31,sp # save original stack top
- subfc sp,r3,sp # bump the stack
- addi r3,sp,28 # parameter pointer excludes linkage area size + 'this'
-
- bl .invoke_copy_to_stack
- nop
-
- lfd f1,0(r31) # Restore floating point registers
- lfd f2,8(r31)
- lfd f3,16(r31)
- lfd f4,24(r31)
- lfd f5,32(r31)
- lfd f6,40(r31)
- lfd f7,48(r31)
- lfd f8,56(r31)
- lfd f9,64(r31)
- lfd f10,72(r31)
- lfd f11,80(r31)
- lfd f12,88(r31)
- lfd f13,96(r31)
-
- lwz r3,160(r31) # that
- lwz r4,0(r3) # get vTable from 'that'
- lwz r5,164(r31) # methodIndex
- slwi r5,r5,3 # methodIndex * 8
- addi r5,r5,8 # step over junk at start of vTable !
- lwzx r11,r5,r4 # get function pointer
-
- addi r5,r5,4 # We need to manually adjust the 'that' pointer, this is CFRONT based
- lwzx r5,r4,r5 # offset = r4(vtable) + r5(methodIndex offset) - 4
- add r3,r5,r3 # adjust 'that' r3 = r3 + r5
-
- lwz r4,28(sp)
- lwz r5,32(sp)
- lwz r6,36(sp)
- lwz r7,40(sp)
- lwz r8,44(sp)
- lwz r9,48(sp)
- lwz r10,52(sp)
-
- bl ._ptrgl{PR}
- nop
-
- mr sp,r31
- lwz r0,144(sp)
- addi sp,sp,136
- mtlr r0
- lwz r31,-4(sp)
- blr
-
-
-# .data section
-
- .toc # 0x00000038
-T.18.NS_InvokeByIndex:
- .tc H.18.NS_InvokeByIndex{TC},NS_InvokeByIndex{DS}
-
- .csect NS_InvokeByIndex{DS}
- .long .NS_InvokeByIndex # "\0\0\0\0"
- .long TOC{TC0} # "\0\0\0008"
- .long 0x00000000 # "\0\0\0\0"
-# End csect NS_InvokeByIndex{DS}
-
-# .bss section
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix64.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix64.s
deleted file mode 100644
index 722583de5b..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_aix64.s
+++ /dev/null
@@ -1,128 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
-.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
-.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
-.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
-.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
-.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
-.set r30,30; .set r31,31
-.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
-.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
-.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
-.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
-.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
-.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
-.set f30,30; .set f31,31
-.set BO_IF,12
-.set CR0_EQ,2
-
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.NS_InvokeByIndex{TC},"NS_InvokeByIndex"
-
-
-# .text section
-
- .csect H.10.NO_SYMBOL{PR}
- .globl .NS_InvokeByIndex
- .globl NS_InvokeByIndex{DS}
- .extern .invoke_copy_to_stack
- .extern ._ptrgl{PR}
-
-#
-# NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
-# uint32_t paramCount, nsXPTCVariant* params)
-#
-
-.NS_InvokeByIndex:
- mflr r0
- std r31,-8(sp)
-#
-# save off the incoming values in the caller's parameter area
-#
- std r3,48(sp) # that
- std r4,56(sp) # methodIndex
- std r5,64(sp) # paramCount
- std r6,72(sp) # params
- std r0,16(sp)
- stdu sp,-168(sp) # 2*24=48 for linkage area,
- # 8*13=104 for fprData area
- # 16 for saved registers
-
-# prepare args for 'invoke_copy_to_stack' call
-#
- ld r4,232(sp) # paramCount (168+8+56)
- ld r5,240(sp) # params
- mr r6,sp # fprData
- sldi r3,r4,3 # number of bytes of stack required
- # is at most numParams*8
- addi r3,r3,56 # linkage area (48) + this (8)
- mr r31,sp # save original stack top
- subfc sp,r3,sp # bump the stack
- addi r3,sp,56 # parameter pointer excludes linkage area
- # size + 'this'
-
- bl .invoke_copy_to_stack
- nop
-
- lfd f1,0(r31) # Restore floating point registers
- lfd f2,8(r31)
- lfd f3,16(r31)
- lfd f4,24(r31)
- lfd f5,32(r31)
- lfd f6,40(r31)
- lfd f7,48(r31)
- lfd f8,56(r31)
- lfd f9,64(r31)
- lfd f10,72(r31)
- lfd f11,80(r31)
- lfd f12,88(r31)
- lfd f13,96(r31)
-
- ld r3,216(r31) # that (168+48)
- ld r4,0(r3) # get vTable from 'that'
- ld r5,224(r31) # methodIndex (168+56)
- sldi r5,r5,3 # methodIndex * 8
- # No junk at the start of 64bit vtable !!!
- ldx r11,r5,r4 # get function pointer (this jumps
- # either to the function if no adjustment
- # is needed (displacement = 0), or it
- # jumps to the thunk code, which will jump
- # to the function at the end)
-
- # No adjustment of the that pointer in 64bit mode, this is done
- # by the thunk code
-
- ld r4,56(sp)
- ld r5,64(sp)
- ld r6,72(sp)
- ld r7,80(sp)
- ld r8,88(sp)
- ld r9,96(sp)
- ld r10,104(sp)
-
- bl ._ptrgl{PR}
- nop
-
- mr sp,r31
- ld r0,184(sp) # 168+16
- addi sp,sp,168
- mtlr r0
- ld r31,-8(sp)
- blr
-
-# .data section
-
- .toc # 0x00000038
-T.18.NS_InvokeByIndex:
- .tc H.18.NS_InvokeByIndex{TC},NS_InvokeByIndex{DS}
-
- .csect NS_InvokeByIndex{DS}
- .llong .NS_InvokeByIndex # "\0\0\0\0"
- .llong TOC{TC0} # "\0\0\0008"
- .llong 0x00000000 # "\0\0\0\0"
-# End csect NS_InvokeByIndex{DS}
-
-# .bss section
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s
deleted file mode 100644
index 414a6536fa..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc_ibmobj_aix.s
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-# -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
-.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
-.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
-.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
-.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
-.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
-.set r30,30; .set r31,31
-.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
-.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
-.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
-.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
-.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
-.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
-.set f30,30; .set f31,31
-.set BO_IF,12
-.set CR0_EQ,2
-
-
-
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.NS_InvokeByIndex{TC},"NS_InvokeByIndex"
-
-
-# .text section
-
- .csect H.10.NO_SYMBOL{PR}
- .globl .NS_InvokeByIndex
- .globl NS_InvokeByIndex{DS}
- .extern .invoke_copy_to_stack
- .extern ._ptrgl{PR}
-
-
-#
-# NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
-# uint32_t paramCount, nsXPTCVariant* params)
-#
-
-.NS_InvokeByIndex:
- mflr r0
- stw r31,-4(sp)
-#
-# save off the incoming values in the caller's parameter area
-#
- stw r3,24(sp) # that
- stw r4,28(sp) # methodIndex
- stw r5,32(sp) # paramCount
- stw r6,36(sp) # params
- stw r0,8(sp)
- stwu sp,-136(sp) # = 24 for linkage area, 8 * 13 for fprData area, 8 for saved registers
-
-# prepare args for 'invoke_copy_to_stack' call
-#
- lwz r4,168(sp) # paramCount
- lwz r5,172(sp) # params
- mr r6,sp # fprData
- slwi r3,r4,3 # number of bytes of stack required
- # at most 8*paramCount
- addi r3,r3,28 # linkage area
- mr r31,sp # save original stack top
- subfc sp,r3,sp # bump the stack
- addi r3,sp,28 # parameter pointer excludes linkage area size + 'this'
-
- bl .invoke_copy_to_stack
- nop
-
- lfd f1,0(r31) # Restore floating point registers
- lfd f2,8(r31)
- lfd f3,16(r31)
- lfd f4,24(r31)
- lfd f5,32(r31)
- lfd f6,40(r31)
- lfd f7,48(r31)
- lfd f8,56(r31)
- lfd f9,64(r31)
- lfd f10,72(r31)
- lfd f11,80(r31)
- lfd f12,88(r31)
- lfd f13,96(r31)
-
- lwz r3,160(r31) # that
- lwz r4,0(r3) # get vTable from 'that'
- lwz r5,164(r31) # methodIndex
- slwi r5,r5,2 # methodIndex * 4
- lwzx r11,r5,r4 # get function pointer
-
- lwz r4,28(sp)
- lwz r5,32(sp)
- lwz r6,36(sp)
- lwz r7,40(sp)
- lwz r8,44(sp)
- lwz r9,48(sp)
- lwz r10,52(sp)
-
- bl ._ptrgl{PR}
- nop
-
- mr sp,r31
- lwz r0,144(sp)
- addi sp,sp,136
- mtlr r0
- lwz r31,-4(sp)
- blr
-
-
-# .data section
-
- .toc # 0x00000038
-T.18.NS_InvokeByIndex:
- .tc H.18.NS_InvokeByIndex{TC},NS_InvokeByIndex{DS}
-
- .csect NS_InvokeByIndex{DS}
- .long .NS_InvokeByIndex # "\0\0\0\0"
- .long TOC{TC0} # "\0\0\0008"
- .long 0x00000000 # "\0\0\0\0"
-# End csect NS_InvokeByIndex{DS}
-
-# .bss section
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s
deleted file mode 100644
index 54adcd1474..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_GCC3.s
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * Platform specific code to invoke XPCOM methods on native objects for
- * solaris/sparc with gcc 3 ABI.
- */
- .global NS_InvokeByIndex
-/*
- * NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
- * uint32_t paramCount, nsXPTCVariant* params);
- */
-NS_InvokeByIndex:
- save %sp,-(64 + 32),%sp ! room for the register window and
- ! struct pointer, rounded up to 0 % 32
- mov %i2,%o0 ! paramCount
- call invoke_count_words ! returns the required stack size in %o0
- mov %i3,%o1 ! params
-
- sll %o0,2,%l0 ! number of bytes
- sub %sp,%l0,%sp ! create the additional stack space
-
- mov %sp,%o0 ! pointer for copied args
- add %o0,72,%o0 ! step past the register window, the
- ! struct result pointer and the 'this' slot
- mov %i2,%o1 ! paramCount
- call invoke_copy_to_stack
- mov %i3,%o2 ! params
-!
-! calculate the target address from the vtable
-!
- ld [%i0],%l1 ! *that --> vTable
- sll %i1,2,%i1 ! multiply index by 4
- add %i1,%l1,%l1 ! l1 now points to vTable entry
- ld [%l1],%l0 ! target address
-
-.L5: ld [%sp + 88],%o5
-.L4: ld [%sp + 84],%o4
-.L3: ld [%sp + 80],%o3
-.L2: ld [%sp + 76],%o2
-.L1: ld [%sp + 72],%o1
-.L0:
- jmpl %l0,%o7 ! call the routine
-! always have a 'this', from the incoming 'that'
- mov %i0,%o0
-
- mov %o0,%i0 ! propagate return value
- ret
- restore
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s
deleted file mode 100644
index 0137703924..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparc_solaris_SUNW.s
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Platform specific code to invoke XPCOM methods on native objects */
-
- .global NS_InvokeByIndex
- .type NS_InvokeByIndex, #function
-/*
- NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
- uint32_t paramCount, nsXPTCVariant* params);
-
-*/
-NS_InvokeByIndex:
- save %sp,-(64 + 32),%sp ! room for the register window and
- ! struct pointer, rounded up to 0 % 32
- sll %i2,3,%l0 ! assume the worst case
- ! paramCount * 2 * 4 bytes
- cmp %l0, 0 ! are there any args? If not,
- be .invoke ! no need to copy args to stack
-
- sub %sp,%l0,%sp ! create the additional stack space
- add %sp,72,%o0 ! step past the register window, the
- ! struct result pointer and the 'this' slot
- mov %i2,%o1 ! paramCount
- call invoke_copy_to_stack
- mov %i3,%o2 ! params
-
-!
-! load arguments from stack into the outgoing registers
-!
- ld [%sp + 72],%o1
- ld [%sp + 76],%o2
- ld [%sp + 80],%o3
- ld [%sp + 84],%o4
- ld [%sp + 88],%o5
-
-!
-! calculate the target address from the vtable
-!
-.invoke:
- sll %i1,2,%l0 ! index *= 4
- add %l0,8,%l0 ! there are 2 extra entries in the vTable
- ld [%i0],%l1 ! *that --> address of vtable
- ld [%l0 + %l1],%l0 ! that->vtable[index * 4 + 8] --> address
-
- jmpl %l0,%o7 ! call the routine
- mov %i0,%o0 ! move 'this' pointer to out register
-
- mov %o0,%i0 ! propagate return value
- ret
- restore
-
- .size NS_InvokeByIndex, .-NS_InvokeByIndex
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s
deleted file mode 100644
index 34861abc0e..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_sparcv9_solaris_SUNW.s
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: asm; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- Platform specific code to invoke XPCOM methods on native objects
- for sparcv9 Solaris.
-
- See the SPARC Compliance Definition (SCD) Chapter 3
- for more information about what is going on here, including
- the use of BIAS (0x7ff).
- The SCD is available from http://www.sparc.com/.
-*/
-
- .global NS_InvokeByIndex
- .type NS_InvokeByIndex, #function
-
-/*
- NS_InvokeByIndex(nsISupports* that, uint32_t methodIndex,
- uint32_t paramCount, nsXPTCVariant* params);
-
-*/
-NS_InvokeByIndex:
- save %sp,-(128 + 64),%sp ! room for the register window and
- ! struct pointer, rounded up to 0 % 64
- sll %i2,4,%l0 ! assume the worst case
- ! paramCount * 2 * 8 bytes
- cmp %l0, 0 ! are there any args? If not,
- be .invoke ! no need to copy args to stack
-
- sub %sp,%l0,%sp ! create the additional stack space
- add %sp,0x7ff+136,%o0 ! step past the register window, the
- ! struct result pointer and the 'this' slot
- mov %i2,%o1 ! paramCount
- call invoke_copy_to_stack
- mov %i3,%o2 ! params
-
-!
-! load arguments from stack into the outgoing registers
-! BIAS is 0x7ff (2047)
-!
-
-! load the %o1..5 64bit (extended word) output registers registers
- ldx [%sp + 0x7ff + 136],%o1 ! %i1
- ldx [%sp + 0x7ff + 144],%o2 ! %i2
- ldx [%sp + 0x7ff + 152],%o3 ! %i3
- ldx [%sp + 0x7ff + 160],%o4 ! %i4
- ldx [%sp + 0x7ff + 168],%o5 ! %i5
-
-! load the even number double registers starting with %d2
- ldd [%sp + 0x7ff + 136],%d2
- ldd [%sp + 0x7ff + 144],%d4
- ldd [%sp + 0x7ff + 152],%d6
- ldd [%sp + 0x7ff + 160],%d8
- ldd [%sp + 0x7ff + 168],%d10
- ldd [%sp + 0x7ff + 176],%d12
- ldd [%sp + 0x7ff + 184],%d14
- ldd [%sp + 0x7ff + 192],%d16
- ldd [%sp + 0x7ff + 200],%d18
- ldd [%sp + 0x7ff + 208],%d20
- ldd [%sp + 0x7ff + 216],%d22
- ldd [%sp + 0x7ff + 224],%d24
- ldd [%sp + 0x7ff + 232],%d26
- ldd [%sp + 0x7ff + 240],%d28
- ldd [%sp + 0x7ff + 248],%d30
-
-!
-! calculate the target address from the vtable
-!
-.invoke:
- sll %i1,3,%l0 ! index *= 8
- add %l0,16,%l0 ! there are 2 extra entries in the vTable (16bytes)
- ldx [%i0],%l1 ! *that --> address of vtable
- ldx [%l0 + %l1],%l0 ! that->vtable[index * 8 + 16] --> address
-
- jmpl %l0,%o7 ! call the routine
- mov %i0,%o0 ! move 'this' pointer to out register
-
- mov %o0,%i0 ! propagate return value
- ret
- restore
-
- .size NS_InvokeByIndex, .-NS_InvokeByIndex
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s
deleted file mode 100644
index af665a1628..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_solaris_SUNW.s
+++ /dev/null
@@ -1,55 +0,0 @@
- .globl NS_InvokeByIndex
- .type NS_InvokeByIndex, @function
-NS_InvokeByIndex:
- push %ebp
- movl %esp,%ebp
- push %ebx
- call .CG0.66
-.CG0.66:
- pop %ebx
- addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx
- push 20(%ebp)
- push 16(%ebp)
- push 12(%ebp)
- push 8(%ebp)
- / INLINE: invoke_by_index
-
-
-
- pushl %ebx
- pushl %esi
- movl %esp, %ebx
-
- pushl 0x14(%ebp)
- pushl 0x10(%ebp)
- call invoke_count_words
- mov %ebx, %esp
-
- sall $0x2 , %eax
- subl %eax, %esp
- movl %esp, %esi
-
- pushl %esp
- pushl 0x14(%ebp)
- pushl 0x10(%ebp)
- call invoke_copy_to_stack
- movl %esi, %esp
-
- movl 0x8(%ebp), %ecx
- pushl %ecx
- movl (%ecx), %edx
- movl 0xc(%ebp), %eax
- movl 0x8(%edx, %eax, 4), %edx
-
- call *%edx
- mov %ebx, %esp
- popl %esi
- popl %ebx
- / INLINE_END
- addl $16,%esp
- pop %ebx
- movl %ebp,%esp
- pop %ebp
- ret
- .size NS_InvokeByIndex, . - NS_InvokeByIndex
-
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix.cpp
deleted file mode 100644
index ba2a5dab08..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Platform specific code to invoke XPCOM methods on native objects */
-
-#include "xptcprivate.h"
-
-#ifndef AIX
-#error "This code is for PowerPC only"
-#endif
-
-extern "C" void
-invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s, double *fprData)
-{
-/*
- We need to copy the parameters for this function to locals and use them
- from there since the parameters occupy the same stack space as the stack
- we're trying to populate.
-*/
- uint32_t *l_d = d;
- nsXPTCVariant *l_s = s;
- uint32_t l_paramCount = paramCount, fpCount = 0;
- double *l_fprData = fprData;
-
- typedef struct {
- uint32_t hi;
- uint32_t lo;
- } DU; // have to move 64 bit entities as 32 bit halves since
- // stack slots are not guaranteed 16 byte aligned
-
- for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
- {
- if(l_s->IsPtrData())
- {
- *((void**)l_d) = l_s->ptr;
- continue;
- }
- switch(l_s->type)
- {
- case nsXPTType::T_I8 : *((int32_t*) l_d) = l_s->val.i8; break;
- case nsXPTType::T_I16 : *((int32_t*) l_d) = l_s->val.i16; break;
- case nsXPTType::T_I32 : *((int32_t*) l_d) = l_s->val.i32; break;
- case nsXPTType::T_I64 :
- case nsXPTType::T_U64 :
- *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
- *((uint32_t*) l_d) = ((DU *)l_s)->lo;
- break;
- case nsXPTType::T_DOUBLE :
- *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
- *((uint32_t*) l_d) = ((DU *)l_s)->lo;
- if(fpCount < 13)
- l_fprData[fpCount++] = l_s->val.d;
- break;
- case nsXPTType::T_U8 : *((uint32_t*) l_d) = l_s->val.u8; break;
- case nsXPTType::T_U16 : *((uint32_t*) l_d) = l_s->val.u16; break;
- case nsXPTType::T_U32 : *((uint32_t*) l_d) = l_s->val.u32; break;
- case nsXPTType::T_FLOAT :
- *((float*) l_d) = l_s->val.f;
- if(fpCount < 13)
- l_fprData[fpCount++] = l_s->val.f;
- break;
- case nsXPTType::T_BOOL : *((uint32_t*) l_d) = l_s->val.b; break;
- case nsXPTType::T_CHAR : *((uint32_t*) l_d) = l_s->val.c; break;
- case nsXPTType::T_WCHAR : *((int32_t*) l_d) = l_s->val.wc; break;
- default:
- // all the others are plain pointer types
- *((void**)l_d) = l_s->val.p;
- break;
- }
- }
-}
-
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix64.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix64.cpp
deleted file mode 100644
index 616c2f687e..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_ppc_aix64.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Platform specific code to invoke XPCOM methods on native objects */
-
-#include "xptcprivate.h"
-
-#ifdef _AIX
-
-extern "C" void
-invoke_copy_to_stack(uint64_t* d, uint32_t paramCount, nsXPTCVariant* s, double *fprData)
-{
-/*
- We need to copy the parameters for this function to locals and use them
- from there since the parameters occupy the same stack space as the stack
- we're trying to populate.
-*/
- uint64_t *l_d = d;
- nsXPTCVariant *l_s = s;
- uint32_t l_paramCount = paramCount, fpCount = 0;
- double *l_fprData = fprData;
-
- for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
- {
- if(l_s->IsPtrData())
- {
- *l_d = (uint64_t)l_s->ptr;
- continue;
- }
- switch(l_s->type)
- {
- case nsXPTType::T_I8: *l_d = (uint64_t)l_s->val.i8; break;
- case nsXPTType::T_I16: *l_d = (uint64_t)l_s->val.i16; break;
- case nsXPTType::T_I32: *l_d = (uint64_t)l_s->val.i32; break;
- case nsXPTType::T_I64: *l_d = (uint64_t)l_s->val.i64; break;
- case nsXPTType::T_U8: *l_d = (uint64_t)l_s->val.u8; break;
- case nsXPTType::T_U16: *l_d = (uint64_t)l_s->val.u16; break;
- case nsXPTType::T_U32: *l_d = (uint64_t)l_s->val.u32; break;
- case nsXPTType::T_U64: *l_d = (uint64_t)l_s->val.u64; break;
- case nsXPTType::T_BOOL: *l_d = (uint64_t)l_s->val.b; break;
- case nsXPTType::T_CHAR: *l_d = (uint64_t)l_s->val.c; break;
- case nsXPTType::T_WCHAR: *l_d = (uint64_t)l_s->val.wc; break;
-
- case nsXPTType::T_DOUBLE:
- *((double*)l_d) = l_s->val.d;
- if(fpCount < 13)
- l_fprData[fpCount++] = l_s->val.d;
- break;
- case nsXPTType::T_FLOAT:
- *((float*)l_d) = l_s->val.f;
- if(fpCount < 13)
- l_fprData[fpCount++] = l_s->val.f;
- break;
- default:
- // all the others are plain pointer types
- *l_d = (uint64_t)l_s->val.p;
- break;
- }
- }
-}
-#endif
-
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp
deleted file mode 100644
index 126ef1dad2..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparc_solaris.cpp
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Platform specific code to invoke XPCOM methods on native objects */
-
-#include "xptcprivate.h"
-
-/* solaris defines __sparc for workshop compilers and
- linux defines __sparc__ */
-
-#if !defined(__sparc) && !defined(__sparc__)
-#error "This code is for Sparc only"
-#endif
-
-typedef unsigned nsXPCVariant;
-
-extern "C" uint32_t
-invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
-{
- uint32_t result = 0;
- for(uint32_t i = 0; i < paramCount; i++, s++)
- {
- if(s->IsPtrData())
- {
- result++;
- continue;
- }
- switch(s->type)
- {
- case nsXPTType::T_I8 :
- case nsXPTType::T_I16 :
- case nsXPTType::T_I32 :
- result++;
- break;
- case nsXPTType::T_I64 :
- result+=2;
- break;
- case nsXPTType::T_U8 :
- case nsXPTType::T_U16 :
- case nsXPTType::T_U32 :
- result++;
- break;
- case nsXPTType::T_U64 :
- result+=2;
- break;
- case nsXPTType::T_FLOAT :
- result++;
- break;
- case nsXPTType::T_DOUBLE :
- result+=2;
- break;
- case nsXPTType::T_BOOL :
- case nsXPTType::T_CHAR :
- case nsXPTType::T_WCHAR :
- result++;
- break;
- default:
- // all the others are plain pointer types
- result++;
- break;
- }
- }
- // nuts, I know there's a cooler way of doing this, but it's late
- // now and it'll probably come to me in the morning.
- if (result & 0x3) result += 4 - (result & 0x3); // ensure q-word alignment
- return result;
-}
-
-extern "C" uint32_t
-invoke_copy_to_stack(uint32_t* d, uint32_t paramCount, nsXPTCVariant* s)
-{
-/*
- We need to copy the parameters for this function to locals and use them
- from there since the parameters occupy the same stack space as the stack
- we're trying to populate.
-*/
- uint32_t *l_d = d;
- nsXPTCVariant *l_s = s;
- uint32_t l_paramCount = paramCount;
- uint32_t regCount = 0; // return the number of registers to load from the stack
-
- typedef struct {
- uint32_t hi;
- uint32_t lo;
- } DU; // have to move 64 bit entities as 32 bit halves since
- // stack slots are not guaranteed 16 byte aligned
-
- for(uint32_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
- {
- if (regCount < 5) regCount++;
- if(l_s->IsPtrData())
- {
- if(l_s->type == nsXPTType::T_JSVAL)
- {
- // On SPARC, we need to pass a pointer to HandleValue
- *((void**)l_d) = &l_s->ptr;
- } else
- {
- *((void**)l_d) = l_s->ptr;
- }
- continue;
- }
- switch(l_s->type)
- {
- case nsXPTType::T_I8 : *((int32_t*) l_d) = l_s->val.i8; break;
- case nsXPTType::T_I16 : *((int32_t*) l_d) = l_s->val.i16; break;
- case nsXPTType::T_I32 : *((int32_t*) l_d) = l_s->val.i32; break;
- case nsXPTType::T_I64 :
- case nsXPTType::T_U64 :
- case nsXPTType::T_DOUBLE : *((uint32_t*) l_d++) = ((DU *)l_s)->hi;
- if (regCount < 5) regCount++;
- *((uint32_t*) l_d) = ((DU *)l_s)->lo;
- break;
- case nsXPTType::T_U8 : *((uint32_t*) l_d) = l_s->val.u8; break;
- case nsXPTType::T_U16 : *((uint32_t*) l_d) = l_s->val.u16; break;
- case nsXPTType::T_U32 : *((uint32_t*) l_d) = l_s->val.u32; break;
- case nsXPTType::T_FLOAT : *((float*) l_d) = l_s->val.f; break;
- case nsXPTType::T_BOOL : *((uint32_t*) l_d) = l_s->val.b; break;
- case nsXPTType::T_CHAR : *((uint32_t*) l_d) = l_s->val.c; break;
- case nsXPTType::T_WCHAR : *((int32_t*) l_d) = l_s->val.wc; break;
- default:
- // all the others are plain pointer types
- *((void**)l_d) = l_s->val.p;
- break;
- }
- }
- return regCount;
-}
-
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparcv9_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparcv9_solaris.cpp
deleted file mode 100644
index 0d2d6b0a8f..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_sparcv9_solaris.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-/* Platform specific code to invoke XPCOM methods on native objects */
-
-#include "xptcprivate.h"
-
-#if !defined(__sparc) && !defined(__sparc__)
-#error "This code is for Sparc only"
-#endif
-
-/* Prototype specifies unmangled function name */
-extern "C" uint64_t
-invoke_copy_to_stack(uint64_t* d, uint32_t paramCount, nsXPTCVariant* s);
-
-extern "C" uint64_t
-invoke_copy_to_stack(uint64_t* d, uint32_t paramCount, nsXPTCVariant* s)
-{
- /*
- We need to copy the parameters for this function to locals and use them
- from there since the parameters occupy the same stack space as the stack
- we're trying to populate.
- */
- uint64_t *l_d = d;
- nsXPTCVariant *l_s = s;
- uint64_t l_paramCount = paramCount;
- uint64_t regCount = 0; // return the number of registers to load from the stack
-
- for(uint64_t i = 0; i < l_paramCount; i++, l_d++, l_s++)
- {
- if (regCount < 5) regCount++;
-
- if (l_s->IsPtrData())
- {
- *l_d = (uint64_t)l_s->ptr;
- continue;
- }
- switch (l_s->type)
- {
- case nsXPTType::T_I8 : *((int64_t*)l_d) = l_s->val.i8; break;
- case nsXPTType::T_I16 : *((int64_t*)l_d) = l_s->val.i16; break;
- case nsXPTType::T_I32 : *((int64_t*)l_d) = l_s->val.i32; break;
- case nsXPTType::T_I64 : *((int64_t*)l_d) = l_s->val.i64; break;
-
- case nsXPTType::T_U8 : *((uint64_t*)l_d) = l_s->val.u8; break;
- case nsXPTType::T_U16 : *((uint64_t*)l_d) = l_s->val.u16; break;
- case nsXPTType::T_U32 : *((uint64_t*)l_d) = l_s->val.u32; break;
- case nsXPTType::T_U64 : *((uint64_t*)l_d) = l_s->val.u64; break;
-
- /* in the case of floats, we want to put the bits in to the
- 64bit space right justified... floats in the parameter array on
- sparcv9 use odd numbered registers.. %f1, %f3, so we have to skip
- the space that would be occupied by %f0, %f2, etc.
- */
- case nsXPTType::T_FLOAT : *(((float*)l_d) + 1) = l_s->val.f; break;
- case nsXPTType::T_DOUBLE: *((double*)l_d) = l_s->val.d; break;
- case nsXPTType::T_BOOL : *((uint64_t*)l_d) = l_s->val.b; break;
- case nsXPTType::T_CHAR : *((uint64_t*)l_d) = l_s->val.c; break;
- case nsXPTType::T_WCHAR : *((int64_t*)l_d) = l_s->val.wc; break;
-
- default:
- // all the others are plain pointer types
- *((void**)l_d) = l_s->val.p;
- break;
- }
- }
-
- return regCount;
-}
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp
deleted file mode 100644
index 0d34243663..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_64_solaris.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Platform specific code to invoke XPCOM methods on native objects
-
-#include "xptcprivate.h"
-#include "alloca.h"
-
-// 6 integral parameters are passed in registers
-const uint32_t GPR_COUNT = 6;
-
-// 8 floating point parameters are passed in SSE registers
-const uint32_t FPR_COUNT = 8;
-
-// Remember that these 'words' are 64-bit long
-static inline void
-invoke_count_words(uint32_t paramCount, nsXPTCVariant * s,
- uint32_t & nr_gpr, uint32_t & nr_fpr, uint32_t & nr_stack)
-{
- nr_gpr = 1; // skip one GP register for 'that'
- nr_fpr = 0;
- nr_stack = 0;
-
- /* Compute number of eightbytes of class MEMORY. */
- for (uint32_t i = 0; i < paramCount; i++, s++) {
- if (!s->IsPtrData()
- && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
- if (nr_fpr < FPR_COUNT)
- nr_fpr++;
- else
- nr_stack++;
- }
- else {
- if (nr_gpr < GPR_COUNT)
- nr_gpr++;
- else
- nr_stack++;
- }
- }
-}
-
-static void
-invoke_copy_to_stack(uint64_t * d, uint32_t paramCount, nsXPTCVariant * s,
- uint64_t * gpregs, double * fpregs)
-{
- uint32_t nr_gpr = 1; // skip one GP register for 'that'
- uint32_t nr_fpr = 0;
- uint64_t value;
-
- for (uint32_t i = 0; i < paramCount; i++, s++) {
- if (s->IsPtrData())
- value = (uint64_t) s->ptr;
- else {
- switch (s->type) {
- case nsXPTType::T_FLOAT: break;
- case nsXPTType::T_DOUBLE: break;
- case nsXPTType::T_I8: value = s->val.i8; break;
- case nsXPTType::T_I16: value = s->val.i16; break;
- case nsXPTType::T_I32: value = s->val.i32; break;
- case nsXPTType::T_I64: value = s->val.i64; break;
- case nsXPTType::T_U8: value = s->val.u8; break;
- case nsXPTType::T_U16: value = s->val.u16; break;
- case nsXPTType::T_U32: value = s->val.u32; break;
- case nsXPTType::T_U64: value = s->val.u64; break;
- case nsXPTType::T_BOOL: value = s->val.b; break;
- case nsXPTType::T_CHAR: value = s->val.c; break;
- case nsXPTType::T_WCHAR: value = s->val.wc; break;
- default: value = (uint64_t) s->val.p; break;
- }
- }
-
- if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) {
- if (nr_fpr < FPR_COUNT)
- fpregs[nr_fpr++] = s->val.d;
- else {
- *((double *)d) = s->val.d;
- d++;
- }
- }
- else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
- if (nr_fpr < FPR_COUNT)
- // The value in %xmm register is already prepared to
- // be retrieved as a float. Therefore, we pass the
- // value verbatim, as a double without conversion.
- fpregs[nr_fpr++] = s->val.d;
- else {
- *((float *)d) = s->val.f;
- d++;
- }
- }
- else {
- if (nr_gpr < GPR_COUNT)
- gpregs[nr_gpr++] = value;
- else
- *d++ = value;
- }
- }
-}
-
-// Avoid AddressSanitizer instrumentation for the next function because it
-// depends on __builtin_alloca behavior and alignment that cannot be relied on
-// once the function is compiled with a version of ASan that has dynamic-alloca
-// instrumentation enabled.
-
-MOZ_ASAN_BLACKLIST
-EXPORT_XPCOM_API(nsresult)
-NS_InvokeByIndex(nsISupports * that, uint32_t methodIndex,
- uint32_t paramCount, nsXPTCVariant * params)
-{
- uint32_t nr_gpr, nr_fpr, nr_stack;
- invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack);
-
- // Stack, if used, must be 16-bytes aligned
- if (nr_stack)
- nr_stack = (nr_stack + 1) & ~1;
-
- // Load parameters to stack, if necessary
- uint64_t *stack = (uint64_t *) __builtin_alloca(nr_stack * 8);
- uint64_t gpregs[GPR_COUNT];
- double fpregs[FPR_COUNT];
- invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs);
-
- switch (nr_fpr) {
- case 8: asm("movupd %0, %xmm7" : : "xmm7" (fpregs[7]));
- case 7: asm("movupd %0, %xmm6" : : "xmm6" (fpregs[6]));
- case 6: asm("movupd %0, %xmm5" : : "xmm5" (fpregs[5]));
- case 5: asm("movupd %0, %xmm4" : : "xmm4" (fpregs[4]));
- case 4: asm("movupd %0, %xmm3" : : "xmm3" (fpregs[3]));
- case 3: asm("movupd %0, %xmm2" : : "xmm2" (fpregs[2]));
- case 2: asm("movupd %0, %xmm1" : : "xmm1" (fpregs[1]));
- case 1: asm("movupd %0, %xmm0" : : "xmm0" (fpregs[0]));
- case 0:;
- }
-
- // Ensure that assignments to SSE registers won't be optimized away
- asm("" ::: "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7");
-
- // Get pointer to method
- uint64_t methodAddress = *((uint64_t *)that);
- methodAddress += 16 + 8 * methodIndex;
- methodAddress = *((uint64_t *)methodAddress);
-
- typedef uint32_t (*Method)(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
- uint32_t result = ((Method)methodAddress)((uint64_t)that, gpregs[1], gpregs[2], gpregs[3], gpregs[4], gpregs[5]);
- return result;
-}
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_solaris.cpp
deleted file mode 100644
index f545fcc996..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_x86_solaris.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Platform specific code to invoke XPCOM methods on native objects */
-
-#include "xptcprivate.h"
-
-extern "C" {
-
-// Remember that these 'words' are 32bit DWORDS
-
-uint32_t
-invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
-{
- uint32_t result = 0;
- for(uint32_t i = 0; i < paramCount; i++, s++)
- {
- if(s->IsPtrData())
- {
- result++;
- continue;
- }
- result++;
- switch(s->type)
- {
- case nsXPTType::T_I64 :
- case nsXPTType::T_U64 :
- case nsXPTType::T_DOUBLE :
- result++;
- break;
- }
- }
- return result;
-}
-
-void
-invoke_copy_to_stack(uint32_t paramCount, nsXPTCVariant* s, uint32_t* d)
-{
- for(uint32_t i = 0; i < paramCount; i++, d++, s++)
- {
- if(s->IsPtrData())
- {
- *((void**)d) = s->ptr;
- continue;
- }
-
-/* XXX: the following line is here (rather than as the default clause in
- * the following switch statement) so that the Sun native compiler
- * will generate the correct assembly code on the Solaris Intel
- * platform. See the comments in bug #28817 for more details.
- */
-
- *((void**)d) = s->val.p;
-
- switch(s->type)
- {
- case nsXPTType::T_I64 : *((int64_t*) d) = s->val.i64; d++; break;
- case nsXPTType::T_U64 : *((uint64_t*)d) = s->val.u64; d++; break;
- case nsXPTType::T_DOUBLE : *((double*) d) = s->val.d; d++; break;
- }
- }
-}
-
-}
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix.s.m4 b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix.s.m4
deleted file mode 100644
index 6dabf334da..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix.s.m4
+++ /dev/null
@@ -1,119 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
-.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
-.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
-.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
-.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
-.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
-.set r30,30; .set r31,31
-.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
-.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
-.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
-.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
-.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
-.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
-.set f30,30; .set f31,31
-
-# Define the correct name of the stub function based on the object model
-
-define(STUB_NAME,
- ifelse(AIX_OBJMODEL, ibm,
- `Stub'$1`__EI14nsXPTCStubBaseFv',
- `Stub'$1`__14nsXPTCStubBaseFv'))
-
-define(STUB_ENTRY, `
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`"
- .csect H.10.NO_SYMBOL{PR}
- .globl .'STUB_NAME($1)`
- .globl 'STUB_NAME($1)`{DS}
-
-.'STUB_NAME($1)`:
- li r12, '$1`
- b .SharedStub
- nop
-
-
- .toc
-T.18.'STUB_NAME($1)`:
- .tc H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS}
- .csect 'STUB_NAME($1)`{DS}
- .long .'STUB_NAME($1)`
- .long TOC{TC0}
- .long 0x00000000
-')
-
-define(SENTINEL_ENTRY, `')
-
-include(xptcstubsdef.inc)
-
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.SharedStub{TC},"SharedStub"
-
-# .text section
- .csect H.10.NO_SYMBOL{PR}
- .globl .SharedStub
- .globl SharedStub{DS}
- .extern .PrepareAndDispatch
-
-.SharedStub:
- mflr r0
- stw r0,8(sp)
-
- stwu sp,-176(sp) # room for linkage (24), fprData (104), gprData(28)
- # outgoing params to PrepareAndDispatch (20)
-
- stw r4,44(sp) # link area (24) + PrepareAndDispatch params (20)
- stw r5,48(sp)
- stw r6,52(sp)
- stw r7,56(sp)
- stw r8,60(sp)
- stw r9,64(sp)
- stw r10,68(sp)
- stfd f1,72(sp)
- stfd f2,80(sp)
- stfd f3,88(sp)
- stfd f4,96(sp)
- stfd f5,104(sp)
- stfd f6,112(sp)
- stfd f7,120(sp)
- stfd f8,128(sp)
- stfd f9,136(sp)
- stfd f10,144(sp)
- stfd f11,152(sp)
- stfd f12,156(sp)
- stfd f13,164(sp)
-
- addi r6,sp,44 # gprData
-
- addi r7,sp,72 # fprData
- # r3 has the 'self' pointer already
- mr r4,r12 # methodIndex selector (it is now LATER)
- addi r5,sp,232 # pointer to callers args area, beyond r3-r10
- # mapped range
-
- bl .PrepareAndDispatch
- nop
-
-
- lwz r0,184(sp)
- addi sp,sp,176
- mtlr r0
- blr
-
-# .data section
-
- .toc # 0x00000038
-T.18.SharedStub:
- .tc H.18.SharedStub{TC},SharedStub{DS}
-
- .csect SharedStub{DS}
- .long .SharedStub # "\0\0\0\0"
- .long TOC{TC0} # "\0\0\0008"
- .long 0x00000000 # "\0\0\0\0"
-# End csect SharedStub{DS}
-
-# .bss section
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix64.s.m4 b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix64.s.m4
deleted file mode 100644
index 24d713cc9b..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc_aix64.s.m4
+++ /dev/null
@@ -1,97 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-.set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4
-.set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9
-.set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14
-.set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19
-.set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24
-.set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29
-.set r30,30; .set r31,31
-.set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4
-.set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9
-.set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14
-.set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19
-.set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24
-.set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29
-.set f30,30; .set f31,31
-# Define the correct name of the stub function based on the object model
-define(STUB_NAME,
- ifelse(AIX_OBJMODEL, ibm,
- `Stub'$1`__EI14nsXPTCStubBaseFv',
- `Stub'$1`__14nsXPTCStubBaseFv'))
-define(STUB_ENTRY, `
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`"
- .csect H.10.NO_SYMBOL{PR}
- .globl .'STUB_NAME($1)`
- .globl 'STUB_NAME($1)`{DS}
-.'STUB_NAME($1)`:
- li r12, '$1`
- b .SharedStub
- nop
- .toc
-T.18.'STUB_NAME($1)`:
- .tc H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS}
- .csect 'STUB_NAME($1)`{DS}
- .llong .'STUB_NAME($1)`
- .llong TOC{TC0}
- .llong 0x00000000
-')
-define(SENTINEL_ENTRY, `')
-include(xptcstubsdef.inc)
- .rename H.10.NO_SYMBOL{PR},""
- .rename H.18.SharedStub{TC},"SharedStub"
-# .text section
- .csect H.10.NO_SYMBOL{PR}
- .globl .SharedStub
- .globl SharedStub{DS}
- .extern .PrepareAndDispatch
-.SharedStub:
- mflr r0
- std r0,16(sp)
- stdu sp,-248(sp) # room for linkage (24*2), fprData (104), gprData(28*2)
- # outgoing params to PrepareAndDispatch (40)
- std r4,88(sp) # link area (48) + PrepareAndDispatch params (20)
- std r5,96(sp)
- std r6,104(sp)
- std r7,112(sp)
- std r8,120(sp)
- std r9,128(sp)
- std r10,136(sp)
- stfd f1,144(sp)
- stfd f2,152(sp)
- stfd f3,160(sp)
- stfd f4,168(sp)
- stfd f5,176(sp)
- stfd f6,184(sp)
- stfd f7,192(sp)
- stfd f8,200(sp)
- stfd f9,208(sp)
- stfd f10,216(sp)
- stfd f11,224(sp)
- stfd f12,232(sp)
- stfd f13,240(sp)
- addi r6,sp,88 # gprData
- addi r7,sp,144 # fprData
- # r3 has the 'self' pointer already
- mr r4,r12 # methodIndex selector (it is now LATER)
- addi r5,sp,360 # pointer to callers args area, beyond r3-r10
- # mapped range
- bl .PrepareAndDispatch
- nop
- ld r0,264(sp)
- addi sp,sp,248
- mtlr r0
- blr
-# .data section
- .toc # 0x00000038
-T.18.SharedStub:
- .tc H.18.SharedStub{TC},SharedStub{DS}
- .csect SharedStub{DS}
- .llong .SharedStub # "\0\0\0\0"
- .llong TOC{TC0} # "\0\0\0008"
- .llong 0x00000000 # "\0\0\0\0"
-# End csect SharedStub{DS}
-# .bss section
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s
deleted file mode 100644
index 9b448d7c7d..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparc_solaris.s
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- .global SharedStub
-
-/*
- in the frame for the function that called SharedStub are the
- rest of the parameters we need
-
-*/
-
-SharedStub:
-! we don't create a new frame yet, but work within the frame of the calling
-! function to give ourselves the other parameters we want
-
- mov %o0, %o1 ! shuffle the index up to 2nd place
- mov %i0, %o0 ! the original 'this'
- add %fp, 72, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this')
-! save off the original incoming parameters that arrived in
-! registers, the ABI guarantees the space for us to do this
- st %i1, [%fp + 72]
- st %i2, [%fp + 76]
- st %i3, [%fp + 80]
- st %i4, [%fp + 84]
- st %i5, [%fp + 88]
-! now we can build our own stack frame
- save %sp,-(64 + 32),%sp ! room for the register window and
- ! struct pointer, rounded up to 0 % 32
-! our function now appears to have been called
-! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args)
-! so we can just copy these through
-
- mov %i0, %o0
- mov %i1, %o1
- mov %i2, %o2
- call PrepareAndDispatch
- nop
- mov %o0,%i0 ! propagate return value
- b .LL1
- nop
-.LL1:
- ret
- restore
-
- .size SharedStub, .-SharedStub
- .type SharedStub, #function
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparcv9_solaris.s b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparcv9_solaris.s
deleted file mode 100644
index ab97a890c3..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_sparcv9_solaris.s
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: asm; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- .global SharedStub
-
-/*
- in the frame for the function that called SharedStub are the
- rest of the parameters we need
-
-*/
-
-SharedStub:
-! we don't create a new frame yet, but work within the frame of the calling
-! function to give ourselves the other parameters we want
-
- mov %o0, %o1 ! shuffle the index up to 2nd place
- mov %i0, %o0 ! the original 'this'
- add %fp, 0x7ff + 136, %o2 ! previous stack top adjusted to the first argument slot (beyond 'this')
-
-! save off the original incoming parameters that arrived in
-! registers, the ABI guarantees the space for us to do this
- stx %i1, [%fp + 0x7ff + 136]
- stx %i2, [%fp + 0x7ff + 144]
- stx %i3, [%fp + 0x7ff + 152]
- stx %i4, [%fp + 0x7ff + 160]
- stx %i5, [%fp + 0x7ff + 168]
-! now we can build our own stack frame
- save %sp,-(128 + 64),%sp ! room for the register window and
- ! struct pointer, rounded up to 0 % 64
-! our function now appears to have been called
-! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args)
-! so we can just copy these through
-
- mov %i0, %o0
- mov %i1, %o1
- mov %i2, %o2
- call PrepareAndDispatch
- nop
- mov %o0,%i0 ! propagate return value
- b .LL1
- nop
-.LL1:
- ret
- restore
-
- .size SharedStub, .-SharedStub
- .type SharedStub, #function
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_64_solaris_SUNW.s b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_64_solaris_SUNW.s
deleted file mode 100644
index aa6d84434a..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_64_solaris_SUNW.s
+++ /dev/null
@@ -1,63 +0,0 @@
-#define STUB_ENTRY1(nn) \
- .globl __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_; \
- .hidden __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_; \
- .type __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_, @function; \
-__1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_: \
- movl $/**/nn/**/, %eax; \
- jmp SharedStub; \
- .size __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_ \
-
-#define STUB_ENTRY2(nn) \
- .globl __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_; \
- .hidden __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_; \
- .type __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_, @function; \
-__1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_: \
- movl $/**/nn/**/, %eax; \
- jmp SharedStub; \
- .size __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_ \
-
-#define STUB_ENTRY3(nn) \
- .globl __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_; \
- .hidden __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_; \
- .type __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_, @function; \
-__1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_: \
- movl $/**/nn/**/, %eax; \
- jmp SharedStub; \
- .size __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_ \
-
-// static nsresult SharedStub(uint32_t methodIndex)
- .type SharedStub, @function;
- SharedStub:
- // make room for gpregs (48), fpregs (64)
- pushq %rbp;
- movq %rsp,%rbp;
- subq $112,%rsp;
- // save GP registers
- movq %rdi,-112(%rbp);
- movq %rsi,-104(%rbp);
- movq %rdx, -96(%rbp);
- movq %rcx, -88(%rbp);
- movq %r8 , -80(%rbp);
- movq %r9 , -72(%rbp);
- leaq -112(%rbp),%rcx;
- // save FP registers
- movsd %xmm0,-64(%rbp);
- movsd %xmm1,-56(%rbp);
- movsd %xmm2,-48(%rbp);
- movsd %xmm3,-40(%rbp);
- movsd %xmm4,-32(%rbp);
- movsd %xmm5,-24(%rbp);
- movsd %xmm6,-16(%rbp);
- movsd %xmm7, -8(%rbp);
- leaq -64(%rbp),%r8;
- // rdi has the 'self' pointer already
- movl %eax,%esi;
- leaq 16(%rbp),%rdx;
- call PrepareAndDispatch@plt;
- leave;
- ret;
- .size SharedStub, . - SharedStub
-
-#define SENTINEL_ENTRY(nn)
-
-#include "xptcstubsdef_asm.solx86"
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_solaris_SUNW.s b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_solaris_SUNW.s
deleted file mode 100644
index 76bdcf925b..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_x86_solaris_SUNW.s
+++ /dev/null
@@ -1,78 +0,0 @@
-#define STUB_ENTRY1(nn) \
- .globl __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_; \
- .type __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_, @function; \
-__1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_: \
- push %ebp; \
- movl %esp,%ebp; \
- andl $-16,%esp; \
- push %ebx; \
- call .CG4./**/nn/**/; \
-.CG4./**/nn/**/: \
- pop %ebx; \
- addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx; \
- leal 0xc(%ebp), %ecx; \
- pushl %ecx; \
- pushl $/**/nn/**/; \
- movl 0x8(%ebp), %ecx; \
- pushl %ecx; \
- call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_; \
- addl $0xc , %esp; \
- pop %ebx; \
- movl %ebp,%esp; \
- pop %ebp; \
- ret ; \
- .size __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseFStub/**/nn/**/6M_I_ \
-
-#define STUB_ENTRY2(nn) \
- .globl __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_; \
- .type __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_, @function; \
-__1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_: \
- push %ebp; \
- movl %esp,%ebp; \
- andl $-16,%esp; \
- push %ebx; \
- call .CG4./**/nn/**/; \
-.CG4./**/nn/**/: \
- pop %ebx; \
- addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx; \
- leal 0xc(%ebp), %ecx; \
- pushl %ecx; \
- pushl $/**/nn/**/; \
- movl 0x8(%ebp), %ecx; \
- pushl %ecx; \
- call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_; \
- addl $0xc , %esp; \
- pop %ebx; \
- movl %ebp,%esp; \
- pop %ebp; \
- ret ; \
- .size __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseGStub/**/nn/**/6M_I_ \
-
-#define STUB_ENTRY3(nn) \
- .globl __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_; \
- .type __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_, @function; \
-__1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_: \
- push %ebp; \
- movl %esp,%ebp; \
- andl $-16,%esp; \
- push %ebx; \
- call .CG4./**/nn/**/; \
-.CG4./**/nn/**/: \
- pop %ebx; \
- addl $_GLOBAL_OFFSET_TABLE_+0x1,%ebx; \
- leal 0xc(%ebp), %ecx; \
- pushl %ecx; \
- pushl $/**/nn/**/; \
- movl 0x8(%ebp), %ecx; \
- pushl %ecx; \
- call __1cSPrepareAndDispatch6FpnOnsXPTCStubBase_IpI_I_; \
- addl $0xc , %esp; \
- pop %ebx; \
- movl %ebp,%esp; \
- pop %ebp; \
- ret ; \
- .size __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_, . - __1cOnsXPTCStubBaseHStub/**/nn/**/6M_I_ \
-
-#define SENTINEL_ENTRY(nn)
-
-#include "xptcstubsdef_asm.solx86"
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix.cpp
deleted file mode 100644
index 0463c21c5f..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix.cpp
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implement shared vtbl methods. */
-
-#include "xptcprivate.h"
-#include "xptiprivate.h"
-
-#if defined(AIX)
-
-/*
- For PPC (AIX & MAC), the first 8 integral and the first 13 f.p. parameters
- arrive in a separate chunk of data that has been loaded from the registers.
- The args pointer has been set to the start of the parameters BEYOND the ones
- arriving in registers
-*/
-extern "C" nsresult ATTRIBUTE_USED
-PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args, uint32_t *gprData, double *fprData)
-{
- typedef struct {
- uint32_t hi;
- uint32_t lo; // have to move 64 bit entities as 32 bit halves since
- } DU; // stack slots are not guaranteed 16 byte aligned
-
-#define PARAM_BUFFER_COUNT 16
-#define PARAM_GPR_COUNT 7
-
- nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
- nsXPTCMiniVariant* dispatchParams = nullptr;
- const nsXPTMethodInfo* info = nullptr;
- uint8_t paramCount;
- uint8_t i;
- nsresult result = NS_ERROR_FAILURE;
-
- NS_ASSERTION(self,"no self");
-
- self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
- NS_ASSERTION(info,"no method info");
-
- paramCount = info->GetParamCount();
-
- // setup variant array pointer
- if(paramCount > PARAM_BUFFER_COUNT)
- dispatchParams = new nsXPTCMiniVariant[paramCount];
- else
- dispatchParams = paramBuffer;
- NS_ASSERTION(dispatchParams,"no place for params");
-
- uint32_t* ap = args;
- uint32_t iCount = 0;
- uint32_t fpCount = 0;
- for(i = 0; i < paramCount; i++)
- {
- const nsXPTParamInfo& param = info->GetParam(i);
- const nsXPTType& type = param.GetType();
- nsXPTCMiniVariant* dp = &dispatchParams[i];
-
- if(param.IsOut() || !type.IsArithmetic())
- {
- if (iCount < PARAM_GPR_COUNT)
- dp->val.p = (void*) gprData[iCount++];
- else
- dp->val.p = (void*) *ap++;
- continue;
- }
- // else
- switch(type)
- {
- case nsXPTType::T_I8 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i8 = (int8_t) gprData[iCount++];
- else
- dp->val.i8 = (int8_t) *ap++;
- break;
- case nsXPTType::T_I16 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i16 = (int16_t) gprData[iCount++];
- else
- dp->val.i16 = (int16_t) *ap++;
- break;
- case nsXPTType::T_I32 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i32 = (int32_t) gprData[iCount++];
- else
- dp->val.i32 = (int32_t) *ap++;
- break;
- case nsXPTType::T_I64 : if (iCount < PARAM_GPR_COUNT)
- ((DU *)dp)->hi = (int32_t) gprData[iCount++];
- else
- ((DU *)dp)->hi = (int32_t) *ap++;
- if (iCount < PARAM_GPR_COUNT)
- ((DU *)dp)->lo = (uint32_t) gprData[iCount++];
- else
- ((DU *)dp)->lo = (uint32_t) *ap++;
- break;
- case nsXPTType::T_U8 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u8 = (uint8_t) gprData[iCount++];
- else
- dp->val.u8 = (uint8_t) *ap++;
- break;
- case nsXPTType::T_U16 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u16 = (uint16_t) gprData[iCount++];
- else
- dp->val.u16 = (uint16_t) *ap++;
- break;
- case nsXPTType::T_U32 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u32 = (uint32_t) gprData[iCount++];
- else
- dp->val.u32 = (uint32_t) *ap++;
- break;
- case nsXPTType::T_U64 : if (iCount < PARAM_GPR_COUNT)
- ((DU *)dp)->hi = (uint32_t) gprData[iCount++];
- else
- ((DU *)dp)->hi = (uint32_t) *ap++;
- if (iCount < PARAM_GPR_COUNT)
- ((DU *)dp)->lo = (uint32_t) gprData[iCount++];
- else
- ((DU *)dp)->lo = (uint32_t) *ap++;
- break;
- case nsXPTType::T_FLOAT : if (fpCount < 13) {
- dp->val.f = (float) fprData[fpCount++];
- if (iCount < PARAM_GPR_COUNT)
- ++iCount;
- else
- ++ap;
- }
- else
- dp->val.f = *((float*) ap++);
- break;
- case nsXPTType::T_DOUBLE : if (fpCount < 13) {
- dp->val.d = (double) fprData[fpCount++];
- if (iCount < PARAM_GPR_COUNT)
- ++iCount;
- else
- ++ap;
- if (iCount < PARAM_GPR_COUNT)
- ++iCount;
- else
- ++ap;
- }
- else {
- dp->val.f = *((double*) ap);
- ap += 2;
- }
- break;
- case nsXPTType::T_BOOL : if (iCount < PARAM_GPR_COUNT)
- dp->val.b = (bool) gprData[iCount++];
- else
- dp->val.b = (bool) *ap++;
- break;
- case nsXPTType::T_CHAR : if (iCount < PARAM_GPR_COUNT)
- dp->val.c = (char) gprData[iCount++];
- else
- dp->val.c = (char) *ap++;
- break;
- case nsXPTType::T_WCHAR : if (iCount < PARAM_GPR_COUNT)
- dp->val.wc = (wchar_t) gprData[iCount++];
- else
- dp->val.wc = (wchar_t) *ap++;
- break;
- default:
- NS_ERROR("bad type");
- break;
- }
- }
-
- result = self->mOuter->CallMethod((uint16_t)methodIndex,info,dispatchParams);
-
- if(dispatchParams != paramBuffer)
- delete [] dispatchParams;
-
- return result;
-}
-
-#define STUB_ENTRY(n)
-
-#define SENTINEL_ENTRY(n) \
-nsresult nsXPTCStubBase::Sentinel##n() \
-{ \
- NS_ERROR("nsXPTCStubBase::Sentinel called"); \
- return NS_ERROR_NOT_IMPLEMENTED; \
-}
-
-#include "xptcstubsdef.inc"
-
-#endif /* AIX */
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix64.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix64.cpp
deleted file mode 100644
index 08eb557ab6..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_ppc_aix64.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implement shared vtbl methods. */
-
-#include "xptcprivate.h"
-#include "xptiprivate.h"
-
-#if defined(AIX)
-
-/*
- For PPC (AIX & MAC), the first 8 integral and the first 13 f.p. parameters
- arrive in a separate chunk of data that has been loaded from the registers.
- The args pointer has been set to the start of the parameters BEYOND the ones
- arriving in registers
-*/
-extern "C" nsresult ATTRIBUTE_USED
-PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args, uint64_t *gprData, double *fprData)
-{
-
-#define PARAM_BUFFER_COUNT 16
-#define PARAM_GPR_COUNT 7
-
- nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
- nsXPTCMiniVariant* dispatchParams = nullptr;
- const nsXPTMethodInfo* info = nullptr;
- uint8_t paramCount;
- uint8_t i;
- nsresult result = NS_ERROR_FAILURE;
-
- NS_ASSERTION(self,"no self");
-
- self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
- NS_ASSERTION(info,"no method info");
-
- paramCount = info->GetParamCount();
-
- // setup variant array pointer
- if(paramCount > PARAM_BUFFER_COUNT)
- dispatchParams = new nsXPTCMiniVariant[paramCount];
- else
- dispatchParams = paramBuffer;
- NS_ASSERTION(dispatchParams,"no place for params");
-
- uint64_t* ap = args;
- uint32_t iCount = 0;
- uint32_t fpCount = 0;
- for(i = 0; i < paramCount; i++)
- {
- const nsXPTParamInfo& param = info->GetParam(i);
- const nsXPTType& type = param.GetType();
- nsXPTCMiniVariant* dp = &dispatchParams[i];
-
- if(param.IsOut() || !type.IsArithmetic())
- {
- if (iCount < PARAM_GPR_COUNT)
- dp->val.p = (void*) gprData[iCount++];
- else
- dp->val.p = (void*) *ap++;
- continue;
- }
- // else
- switch(type)
- {
- case nsXPTType::T_I8 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i8 = (int8_t) gprData[iCount++];
- else
- dp->val.i8 = (int8_t) *ap++;
- break;
- case nsXPTType::T_I16 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i16 = (int16_t) gprData[iCount++];
- else
- dp->val.i16 = (int16_t) *ap++;
- break;
- case nsXPTType::T_I32 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i32 = (int32_t) gprData[iCount++];
- else
- dp->val.i32 = (int32_t) *ap++;
- break;
- case nsXPTType::T_I64 : if (iCount < PARAM_GPR_COUNT)
- dp->val.i64 = (int64_t) gprData[iCount++];
- else
- dp->val.i64 = (int64_t) *ap++;
- break;
- case nsXPTType::T_U8 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u8 = (uint8_t) gprData[iCount++];
- else
- dp->val.u8 = (uint8_t) *ap++;
- break;
- case nsXPTType::T_U16 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u16 = (uint16_t) gprData[iCount++];
- else
- dp->val.u16 = (uint16_t) *ap++;
- break;
- case nsXPTType::T_U32 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u32 = (uint32_t) gprData[iCount++];
- else
- dp->val.u32 = (uint32_t) *ap++;
- break;
- case nsXPTType::T_U64 : if (iCount < PARAM_GPR_COUNT)
- dp->val.u64 = (uint64_t) gprData[iCount++];
- else
- dp->val.u64 = (uint64_t) *ap++;
- break;
- case nsXPTType::T_FLOAT : if (fpCount < 13) {
- dp->val.f = (float) fprData[fpCount++];
- if (iCount < PARAM_GPR_COUNT)
- ++iCount;
- else
- ++ap;
- }
- else
- dp->val.f = *((float*) ap++);
- break;
- case nsXPTType::T_DOUBLE : if (fpCount < 13) {
- dp->val.d = (double) fprData[fpCount++];
- if (iCount < PARAM_GPR_COUNT)
- ++iCount;
- else
- ++ap;
- if (iCount < PARAM_GPR_COUNT)
- ++iCount;
- else
- ++ap;
- }
- else {
- dp->val.f = *((double*) ap);
- ap += 2;
- }
- break;
- case nsXPTType::T_BOOL : if (iCount < PARAM_GPR_COUNT)
- dp->val.b = (bool) gprData[iCount++];
- else
- dp->val.b = (bool) *ap++;
- break;
- case nsXPTType::T_CHAR : if (iCount < PARAM_GPR_COUNT)
- dp->val.c = (char) gprData[iCount++];
- else
- dp->val.c = (char) *ap++;
- break;
- case nsXPTType::T_WCHAR : if (iCount < PARAM_GPR_COUNT)
- dp->val.wc = (wchar_t) gprData[iCount++];
- else
- dp->val.wc = (wchar_t) *ap++;
- break;
- default:
- NS_ERROR("bad type");
- break;
- }
- }
-
- result = self->mOuter->CallMethod((uint16_t)methodIndex,info,dispatchParams);
-
- if(dispatchParams != paramBuffer)
- delete [] dispatchParams;
-
- return result;
-}
-
-#define STUB_ENTRY(n)
-
-#define SENTINEL_ENTRY(n) \
-nsresult nsXPTCStubBase::Sentinel##n() \
-{ \
- NS_ERROR("nsXPTCStubBase::Sentinel called"); \
- return NS_ERROR_NOT_IMPLEMENTED; \
-}
-
-#include "xptcstubsdef.inc"
-
-#endif /* AIX */
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp
deleted file mode 100644
index 61f3df4ffa..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparc_solaris.cpp
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implement shared vtbl methods. */
-
-#include "xptcprivate.h"
-#include "xptiprivate.h"
-
-#if defined(sparc) || defined(__sparc__)
-
-extern "C" nsresult ATTRIBUTE_USED
-PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
-{
-
- typedef struct {
- uint32_t hi;
- uint32_t lo;
- } DU; // have to move 64 bit entities as 32 bit halves since
- // stack slots are not guaranteed 16 byte aligned
-
-#define PARAM_BUFFER_COUNT 16
-
- nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
- nsXPTCMiniVariant* dispatchParams = nullptr;
- const nsXPTMethodInfo* info;
- uint8_t paramCount;
- uint8_t i;
- nsresult result = NS_ERROR_FAILURE;
-
- NS_ASSERTION(self,"no self");
-
- self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
- NS_ASSERTION(info,"no interface info");
-
- paramCount = info->GetParamCount();
-
- // setup variant array pointer
- if(paramCount > PARAM_BUFFER_COUNT)
- dispatchParams = new nsXPTCMiniVariant[paramCount];
- else
- dispatchParams = paramBuffer;
- NS_ASSERTION(dispatchParams,"no place for params");
-
- uint32_t* ap = args;
- for(i = 0; i < paramCount; i++, ap++)
- {
- const nsXPTParamInfo& param = info->GetParam(i);
- const nsXPTType& type = param.GetType();
- nsXPTCMiniVariant* dp = &dispatchParams[i];
-
- if(param.IsOut() || !type.IsArithmetic())
- {
- if (type == nsXPTType::T_JSVAL)
- dp->val.p = *((void**) *ap);
- else
- dp->val.p = (void*) *ap;
- continue;
- }
- // else
- switch(type)
- {
- case nsXPTType::T_I8 : dp->val.i8 = *((int32_t*) ap); break;
- case nsXPTType::T_I16 : dp->val.i16 = *((int32_t*) ap); break;
- case nsXPTType::T_I32 : dp->val.i32 = *((int32_t*) ap); break;
- case nsXPTType::T_DOUBLE :
- case nsXPTType::T_U64 :
- case nsXPTType::T_I64 : ((DU *)dp)->hi = ((DU *)ap)->hi;
- ((DU *)dp)->lo = ((DU *)ap)->lo;
- ap++;
- break;
- case nsXPTType::T_U8 : dp->val.u8 = *((uint32_t*)ap); break;
- case nsXPTType::T_U16 : dp->val.u16 = *((uint32_t*)ap); break;
- case nsXPTType::T_U32 : dp->val.u32 = *((uint32_t*)ap); break;
- case nsXPTType::T_FLOAT : dp->val.f = *((float*) ap); break;
- case nsXPTType::T_BOOL : dp->val.b = *((uint32_t*)ap); break;
- case nsXPTType::T_CHAR : dp->val.c = *((uint32_t*)ap); break;
- case nsXPTType::T_WCHAR : dp->val.wc = *((int32_t*) ap); break;
- default:
- NS_ERROR("bad type");
- break;
- }
- }
-
- result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
-
- if(dispatchParams != paramBuffer)
- delete [] dispatchParams;
-
- return result;
-}
-
-extern "C" nsresult SharedStub(int, int*);
-
-#define STUB_ENTRY(n) \
-nsresult nsXPTCStubBase::Stub##n() \
-{ \
- int dummy; /* defeat tail-call optimization */ \
- return SharedStub(n, &dummy); \
-}
-
-#define SENTINEL_ENTRY(n) \
-nsresult nsXPTCStubBase::Sentinel##n() \
-{ \
- NS_ERROR("nsXPTCStubBase::Sentinel called"); \
- return NS_ERROR_NOT_IMPLEMENTED; \
-}
-
-#include "xptcstubsdef.inc"
-
-#endif /* sparc || __sparc__ */
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparcv9_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_sparcv9_solaris.cpp
deleted file mode 100644
index 583ce9864b..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_sparcv9_solaris.cpp
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implement shared vtbl methods. */
-
-#include "xptcprivate.h"
-#include "xptiprivate.h"
-
-#if defined(sparc) || defined(__sparc__)
-
-extern "C" nsresult ATTRIBUTE_USED
-PrepareAndDispatch(nsXPTCStubBase* self, uint64_t methodIndex, uint64_t* args)
-{
-
-#define PARAM_BUFFER_COUNT 16
-
- nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
- nsXPTCMiniVariant* dispatchParams = nullptr;
- const nsXPTMethodInfo* info;
- uint8_t paramCount;
- uint8_t i;
- nsresult result = NS_ERROR_FAILURE;
-
- NS_ASSERTION(self,"no self");
-
- self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
- NS_ASSERTION(info,"no interface info");
-
- paramCount = info->GetParamCount();
-
- // setup variant array pointer
- if(paramCount > PARAM_BUFFER_COUNT)
- dispatchParams = new nsXPTCMiniVariant[paramCount];
- else
- dispatchParams = paramBuffer;
- NS_ASSERTION(dispatchParams,"no place for params");
-
- uint64_t* ap = args;
- for(i = 0; i < paramCount; i++, ap++)
- {
- const nsXPTParamInfo& param = info->GetParam(i);
- const nsXPTType& type = param.GetType();
- nsXPTCMiniVariant* dp = &dispatchParams[i];
-
- if(param.IsOut() || !type.IsArithmetic())
- {
- dp->val.p = (void*) *ap;
- continue;
- }
- // else
- switch(type)
- {
- case nsXPTType::T_I8 : dp->val.i8 = *((int64_t*) ap); break;
- case nsXPTType::T_I16 : dp->val.i16 = *((int64_t*) ap); break;
- case nsXPTType::T_I32 : dp->val.i32 = *((int64_t*) ap); break;
- case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); break;
- case nsXPTType::T_U64 : dp->val.u64 = *((uint64_t*)ap); break;
- case nsXPTType::T_I64 : dp->val.i64 = *((int64_t*) ap); break;
- case nsXPTType::T_U8 : dp->val.u8 = *((uint64_t*)ap); break;
- case nsXPTType::T_U16 : dp->val.u16 = *((uint64_t*)ap); break;
- case nsXPTType::T_U32 : dp->val.u32 = *((uint64_t*)ap); break;
- case nsXPTType::T_FLOAT : dp->val.f = ((float*) ap)[1]; break;
- case nsXPTType::T_BOOL : dp->val.b = *((uint64_t*)ap); break;
- case nsXPTType::T_CHAR : dp->val.c = *((uint64_t*)ap); break;
- case nsXPTType::T_WCHAR : dp->val.wc = *((int64_t*) ap); break;
- default:
- NS_ERROR("bad type");
- break;
- }
- }
-
- result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
-
- if(dispatchParams != paramBuffer)
- delete [] dispatchParams;
-
- return result;
-}
-
-extern "C" nsresult SharedStub(int, int*);
-
-#define STUB_ENTRY(n) \
-nsresult nsXPTCStubBase::Stub##n() \
-{ \
- int dummy; /* defeat tail-call optimization */ \
- return SharedStub(n, &dummy); \
-}
-
-#define SENTINEL_ENTRY(n) \
-nsresult nsXPTCStubBase::Sentinel##n() \
-{ \
- NS_ERROR("nsXPTCStubBase::Sentinel called"); \
- return NS_ERROR_NOT_IMPLEMENTED; \
-}
-
-#include "xptcstubsdef.inc"
-
-#endif /* sparc || __sparc__ */
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_solaris.cpp
deleted file mode 100644
index 677fa99606..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_64_solaris.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Implement shared vtbl methods.
-
-// Keep this in sync with the darwin version.
-
-#include "xptcprivate.h"
-#include "xptiprivate.h"
-
-// The Linux/x86-64 ABI passes the first 6 integer parameters and the
-// first 8 floating point parameters in registers (rdi, rsi, rdx, rcx,
-// r8, r9 and xmm0-xmm7), no stack space is allocated for these by the
-// caller. The rest of the parameters are passed in the callers stack
-// area.
-
-const uint32_t PARAM_BUFFER_COUNT = 16;
-const uint32_t GPR_COUNT = 6;
-const uint32_t FPR_COUNT = 8;
-
-// PrepareAndDispatch() is called by SharedStub() and calls the actual method.
-//
-// - 'args[]' contains the arguments passed on stack
-// - 'gpregs[]' contains the arguments passed in integer registers
-// - 'fpregs[]' contains the arguments passed in floating point registers
-//
-// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
-// and then the method gets called.
-
-extern "C" nsresult ATTRIBUTE_USED
-PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
- uint64_t * args, uint64_t * gpregs, double *fpregs)
-{
- nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
- nsXPTCMiniVariant* dispatchParams = nullptr;
- const nsXPTMethodInfo* info;
- uint32_t paramCount;
- uint32_t i;
- nsresult result = NS_ERROR_FAILURE;
-
- NS_ASSERTION(self,"no self");
-
- self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
- NS_ASSERTION(info,"no method info");
- if (!info)
- return NS_ERROR_UNEXPECTED;
-
- paramCount = info->GetParamCount();
-
- // setup variant array pointer
- if (paramCount > PARAM_BUFFER_COUNT)
- dispatchParams = new nsXPTCMiniVariant[paramCount];
- else
- dispatchParams = paramBuffer;
-
- NS_ASSERTION(dispatchParams,"no place for params");
- if (!dispatchParams)
- return NS_ERROR_OUT_OF_MEMORY;
-
- uint64_t* ap = args;
- uint32_t nr_gpr = 1; // skip one GPR register for 'that'
- uint32_t nr_fpr = 0;
- uint64_t value;
-
- for (i = 0; i < paramCount; i++) {
- const nsXPTParamInfo& param = info->GetParam(i);
- const nsXPTType& type = param.GetType();
- nsXPTCMiniVariant* dp = &dispatchParams[i];
-
- if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
- if (nr_fpr < FPR_COUNT)
- dp->val.d = fpregs[nr_fpr++];
- else
- dp->val.d = *(double*) ap++;
- continue;
- }
- else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
- if (nr_fpr < FPR_COUNT)
- // The value in %xmm register is already prepared to
- // be retrieved as a float. Therefore, we pass the
- // value verbatim, as a double without conversion.
- dp->val.d = fpregs[nr_fpr++];
- else
- dp->val.f = *(float*) ap++;
- continue;
- }
- else {
- if (nr_gpr < GPR_COUNT)
- value = gpregs[nr_gpr++];
- else
- value = *ap++;
- }
-
- if (param.IsOut() || !type.IsArithmetic()) {
- dp->val.p = (void*) value;
- continue;
- }
-
- switch (type) {
- case nsXPTType::T_I8: dp->val.i8 = (int8_t) value; break;
- case nsXPTType::T_I16: dp->val.i16 = (int16_t) value; break;
- case nsXPTType::T_I32: dp->val.i32 = (int32_t) value; break;
- case nsXPTType::T_I64: dp->val.i64 = (int64_t) value; break;
- case nsXPTType::T_U8: dp->val.u8 = (uint8_t) value; break;
- case nsXPTType::T_U16: dp->val.u16 = (uint16_t) value; break;
- case nsXPTType::T_U32: dp->val.u32 = (uint32_t) value; break;
- case nsXPTType::T_U64: dp->val.u64 = (uint64_t) value; break;
- // Cast to uint8_t first, to remove garbage on upper 56 bits.
- case nsXPTType::T_BOOL: dp->val.b = (bool)(uint8_t) value; break;
- case nsXPTType::T_CHAR: dp->val.c = (char) value; break;
- case nsXPTType::T_WCHAR: dp->val.wc = (wchar_t) value; break;
-
- default:
- NS_ERROR("bad type");
- break;
- }
- }
-
- result = self->mOuter->CallMethod((uint16_t) methodIndex, info, dispatchParams);
-
- if (dispatchParams != paramBuffer)
- delete [] dispatchParams;
-
- return result;
-}
-
-#define STUB_ENTRY(n)
-
-#define SENTINEL_ENTRY(n) \
-nsresult nsXPTCStubBase::Sentinel##n() \
-{ \
- NS_ERROR("nsXPTCStubBase::Sentinel called"); \
- return NS_ERROR_NOT_IMPLEMENTED; \
-}
-
-#include "xptcstubsdef.inc"
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_solaris.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_solaris.cpp
deleted file mode 100644
index 39eec5e545..0000000000
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_x86_solaris.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Implement shared vtbl methods. */
-
-#include "xptcprivate.h"
-#include "xptiprivate.h"
-
-nsresult ATTRIBUTE_USED
-PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
-{
-#define PARAM_BUFFER_COUNT 16
-
- nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
- nsXPTCMiniVariant* dispatchParams = nullptr;
- const nsXPTMethodInfo* info;
- uint8_t paramCount;
- uint8_t i;
- nsresult result = NS_ERROR_FAILURE;
-
- NS_ASSERTION(self,"no self");
-
- self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
- NS_ASSERTION(info,"no interface info");
-
- paramCount = info->GetParamCount();
-
- // setup variant array pointer
- if(paramCount > PARAM_BUFFER_COUNT)
- dispatchParams = new nsXPTCMiniVariant[paramCount];
- else
- dispatchParams = paramBuffer;
- NS_ASSERTION(dispatchParams,"no place for params");
-
- uint32_t* ap = args;
- for(i = 0; i < paramCount; i++, ap++)
- {
- const nsXPTParamInfo& param = info->GetParam(i);
- const nsXPTType& type = param.GetType();
- nsXPTCMiniVariant* dp = &dispatchParams[i];
-
- if(param.IsOut() || !type.IsArithmetic())
- {
- dp->val.p = (void*) *ap;
- continue;
- }
- // else
- dp->val.p = (void*) *ap;
- switch(type)
- {
- case nsXPTType::T_I64 : dp->val.i64 = *((int64_t*) ap); ap++; break;
- case nsXPTType::T_U64 : dp->val.u64 = *((uint64_t*)ap); ap++; break;
- case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break;
- }
- }
-
- result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
-
- if(dispatchParams != paramBuffer)
- delete [] dispatchParams;
-
- return result;
-}
-
-#define STUB_ENTRY(n)
-
-#define SENTINEL_ENTRY(n) \
-nsresult nsXPTCStubBase::Sentinel##n() \
-{ \
- NS_ERROR("nsXPTCStubBase::Sentinel called"); \
- return NS_ERROR_NOT_IMPLEMENTED; \
-}
-
-#include "xptcstubsdef.inc"
diff --git a/xpcom/reflect/xptcall/status.html b/xpcom/reflect/xptcall/status.html
index 7f8e54a0c4..deb4da92ef 100644
--- a/xpcom/reflect/xptcall/status.html
+++ b/xpcom/reflect/xptcall/status.html
@@ -241,31 +241,6 @@ a port.
<TR>
<TD bgcolor="green"><font color="white"><b>Done</b></font></TD>
-<TD>SunOS x86</TD>
-<TD>
-<img alt="Contributed code!" title="Contributed code!" src="http://tinderbox.mozilla.org/star.gif">
-<a href="mailto:aljones@lbl.gov">Arthur Jones &lt;aljones@lbl.gov&gt;</a><BR>
-<font color="red"><b>?</b></font>
-<a href="mailto:ppokorny@mindspring.com">Philip Pokorny &lt;ppokorny@mindspring.com&gt;</a><BR>
-</TD>
-<TD>
-The word I hear is that this is working and done
-</TD>
-</TR>
-
-<TR>
-<TD bgcolor="green"><font color="white"><b>Done</b></font></TD>
-<TD>AIX PPC</TD>
-<TD><img alt="Contributed code!" title="Contributed code!" src="http://tinderbox.mozilla.org/star.gif">
-<a href="mailto:jdunn@netscape.com">Jim Dunn &lt;jdunn@netscape.com&gt;</a></TD>
-<TD>Philip K. Warren writes: <BR>
-
-We have gone through several releases of AIX without any problems.
-</TD>
-</TR>
-
-<TR>
-<TD bgcolor="green"><font color="white"><b>Done</b></font></TD>
<TD>Irix</TD>
<TD><img alt="Contributed code!" title="Contributed code!" src="http://tinderbox.mozilla.org/star.gif">
<a href="mailto:jasonh@m7.engr.sgi.com">Jason Heirtzler &lt;jasonh@m7.engr.sgi.com&gt;</a><BR>
diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp
index 7c1af08f48..19464f2f08 100644
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -203,11 +203,9 @@ public:
}
}
- // This method needs to be public to support older compilers (xlC_r on AIX).
- // It should be called directly as this class type is reference counted.
+private:
virtual ~nsThreadStartupEvent() {}
-private:
NS_IMETHOD Run() override
{
ReentrantMonitorAutoEnter mon(mMon);